From 34fe545dc7f619a40cffa207b8660ecb0c027c1f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Apr 2011 21:23:47 +1000 Subject: TSAGE: Created stub classes for ASound and Sound, and reworked engine to use proper named methods --- engines/tsage/converse.cpp | 2 +- engines/tsage/converse.h | 3 +- engines/tsage/core.cpp | 46 ++----- engines/tsage/core.h | 69 ---------- engines/tsage/globals.h | 3 +- engines/tsage/ringworld_demo.cpp | 2 +- engines/tsage/ringworld_demo.h | 3 +- engines/tsage/ringworld_logic.cpp | 2 +- engines/tsage/ringworld_scenes1.cpp | 148 ++++++++++---------- engines/tsage/ringworld_scenes1.h | 21 +-- engines/tsage/ringworld_scenes10.cpp | 42 +++--- engines/tsage/ringworld_scenes10.h | 8 +- engines/tsage/ringworld_scenes2.cpp | 36 ++--- engines/tsage/ringworld_scenes2.h | 4 +- engines/tsage/ringworld_scenes3.cpp | 252 +++++++++++++++++------------------ engines/tsage/ringworld_scenes3.h | 20 +-- engines/tsage/ringworld_scenes4.cpp | 8 +- engines/tsage/ringworld_scenes4.h | 2 +- engines/tsage/ringworld_scenes5.cpp | 88 ++++++------ engines/tsage/ringworld_scenes5.h | 10 +- engines/tsage/ringworld_scenes6.cpp | 36 ++--- engines/tsage/ringworld_scenes6.h | 8 +- engines/tsage/ringworld_scenes8.cpp | 48 +++---- engines/tsage/ringworld_scenes8.h | 14 +- engines/tsage/sound.cpp | 91 +++++++++++++ engines/tsage/sound.h | 43 ++++++ 26 files changed, 524 insertions(+), 485 deletions(-) diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 7183266cf4..5c6050a363 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -231,7 +231,7 @@ void SequenceManager::signal() { case 26: v1 = getNextValue(); v2 = getNextValue(); - _soundHandler.startSound(v1, v2 ? this : NULL, 127); + _soundHandler.play(v1, v2 ? this : NULL, 127); break; case 27: { v1 = getNextValue(); diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index fd2abcd872..12fde5819c 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -28,6 +28,7 @@ #include "tsage/core.h" #include "tsage/dialogs.h" +#include "tsage/sound.h" namespace tSage { @@ -53,7 +54,7 @@ public: int _objectIndex; SceneObject *_sceneObject; SceneObject *_objectList[6]; - SoundHandler _soundHandler; + ASound _soundHandler; public: SequenceManager(); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index e56cadb68a..36e2961aca 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -32,6 +32,7 @@ #include "tsage/scenes.h" #include "tsage/staticres.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -2911,53 +2912,22 @@ int SceneRegions::indexOf(const Common::Point &pt) { /*--------------------------------------------------------------------------*/ -SoundHandler::SoundHandler() { +ASound::ASound() { _action = NULL; _field280 = -1; - if (_globals) - _globals->_sceneListeners.push_back(this); -} - -SoundHandler::~SoundHandler() { - if (_globals) - _globals->_sceneListeners.remove(this); } -void SoundHandler::dispatch() { - EventHandler::dispatch(); - int v = _sound.proc12(); - - if (v != -1) { - _field280 = v; - _sound.proc2(-1); - - if (_action) - _action->signal(); - } +void ASound::synchronise(Serialiser &s) { + EventHandler::synchronise(s); - if (_field280 != -1) { - // FIXME: Hardcoded to only flag a sound ended if an action has been set - if (_action) { -// if (!_sound.proc3()) { - _field280 = -1; - if (_action) { - _action->signal(); - _action = NULL; - } - } - } + SYNC_POINTER(_action); + s.syncAsSint16LE(_field280); } -void SoundHandler::startSound(int soundNum, Action *action, int volume) { - _action = action; - _field280 = 0; - setVolume(volume); - _sound.startSound(soundNum); - - warning("TODO: SoundHandler::startSound"); +void ASound::dispatch() { + } - /*--------------------------------------------------------------------------*/ void SceneItemList::addItems(SceneItem *first, ...) { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index e1ff95dcdd..38ca269c9c 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -36,7 +36,6 @@ #include "tsage/graphics.h" #include "tsage/resources.h" #include "tsage/saveload.h" -#include "tsage/sound.h" namespace tSage { @@ -720,74 +719,6 @@ public: /*--------------------------------------------------------------------------*/ -class GameSoundHandler { -public: - void proc1() { - warning("TODO: GameSoundHandler::proc1"); - } - void proc5(int v) { - warning("TODO: GameSoundHandler::proc5"); - } - void proc11(int v1, int v2, int v3, int v4) { - warning("TODO: GameSoundHandler::proc11"); - } - int proc12() { - // TODO - return -1; - } - void proc2(int v) { - // TODO - } - int proc3() { - return 0; - } - void setVolume(int volume) { - warning("TODO GameSoundHandler::setVolume"); - } - void startSound(int soundNum) { - warning("TODO GameSoundHandler::startSound"); - } -}; - -class SoundHandler : public EventHandler { -public: - GameSoundHandler _sound; - Action *_action; - int _field280; -public: - SoundHandler(); - ~SoundHandler(); - - void startSound(int soundNum, Action *action = NULL, int volume = 127); - void proc1(Action *action) { - proc11(0, 5, 10, 1, action); - } - void proc2(int v) { - warning("TODO: SoundHandler::proc2"); - } - void proc3() { - warning("TODO: SoundHandler::proc5"); - } - void proc4() { - _sound.proc1(); - } - void proc5(int v) { - _sound.proc5(v); - } - void proc11(int v1, int v2, int v3, int v4, Action *action) { - if (action) - _action = action; - - _sound.proc11(v1, v2, v3, v4); - } - void setVolume(int volume) { _sound.setVolume(volume); } - - virtual Common::String getClassName() { return "SoundHandler"; } - virtual void dispatch(); -}; - -/*--------------------------------------------------------------------------*/ - class SceneItemList : public SynchronisedList { public: void addItems(SceneItem *first, ...); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 9e9ddd58d7..49aaf595c5 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -31,6 +31,7 @@ #include "tsage/dialogs.h" #include "tsage/scenes.h" #include "tsage/events.h" +#include "tsage/sound.h" #include "tsage/saveload.h" namespace tSage { @@ -60,7 +61,7 @@ public: SynchronisedList _sceneListeners; bool _flags[256]; Player _player; - SoundHandler _soundHandler; + ASound _soundHandler; InvObjectList *_inventory; Region _paneRegions[2]; int _paneRefreshFlag[2]; diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 29438c0347..77aabe9e1f 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -40,7 +40,7 @@ void RingworldDemoScene::postInit(SceneObjectList *OwnerList) { } void RingworldDemoScene::signal() { - _soundHandler.startSound(4); + _soundHandler.play(4); _actor1.postInit(); _actor2.postInit(); _actor3.postInit(); diff --git a/engines/tsage/ringworld_demo.h b/engines/tsage/ringworld_demo.h index 63ffe56555..2653cd621c 100644 --- a/engines/tsage/ringworld_demo.h +++ b/engines/tsage/ringworld_demo.h @@ -31,6 +31,7 @@ #include "tsage/core.h" #include "tsage/scenes.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -40,7 +41,7 @@ public: SequenceManager _sequenceManager; SceneObject _actor1, _actor2, _actor3; SceneObject _actor4, _actor5, _actor6; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 0a2220c690..a2691beca3 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1323,7 +1323,7 @@ void RingworldGame::start() { void RingworldGame::restart() { _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); // Reset the flags _globals->reset(); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index fd51670fb8..b5c0d7a893 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -101,7 +101,7 @@ void Scene10::Action1::signal() { scene->_object4.animate(ANIM_MODE_6, this); break; case 10: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 11: _globals->_scenePalette.clearListeners(); @@ -188,7 +188,7 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; setAction(&_action1); - _globals->_soundHandler.startSound(5); + _globals->_soundHandler.play(5); } void Scene10::stripCallback(int v) { @@ -235,7 +235,7 @@ void Scene15::Action1::signal() { Common::Point pt(160, 100); NpcMover *mover = new NpcMover(); scene->_object1.addMover(mover, &pt, this); - scene->_soundHandler.startSound(7); + scene->_soundHandler.play(7); break; } case 3: @@ -259,7 +259,7 @@ void Scene15::postInit(SceneObjectList *OwnerList) { loadScene(15); Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_soundHandler.startSound(6); + _globals->_soundHandler.play(6); setAction(&_action1); } @@ -279,7 +279,7 @@ void Scene20::Action1::signal() { scene->_stripManager.start(20, this); break; case 2: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 3: _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; @@ -344,8 +344,8 @@ void Scene20::Action2::signal() { break; } case 8: - scene->_sound.proc4(); - scene->_sound.proc1(this); + scene->_sound.release(); + scene->_sound.fadeOut(this); break; case 9: SceneItem::display(0, 0, LIST_END); @@ -403,8 +403,8 @@ void Scene20::Action3::signal() { break; } case 6: - scene->_sound.startSound(60, this, 127); - _globals->_soundHandler.proc4(); + scene->_sound.play(60, this, 127); + _globals->_soundHandler.release(); break; case 7: _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; @@ -453,7 +453,7 @@ void Scene20::Action4::signal() { break; } case 4: { - scene->_sound.startSound(28); + scene->_sound.play(28); scene->_sceneObject4.postInit(); scene->_sceneObject4.setVisage(21); scene->_sceneObject4.setStrip(3); @@ -466,7 +466,7 @@ void Scene20::Action4::signal() { break; } case 5: { - scene->_sound.startSound(42); + scene->_sound.play(42); scene->_sceneObject4.remove(); scene->_SceneObjectExt.setVisage(21); scene->_SceneObjectExt.setStrip(1); @@ -490,7 +490,7 @@ void Scene20::Action4::signal() { break; } case 6: { - scene->_sound.startSound(42); + scene->_sound.play(42); scene->_SceneObjectExt.setStrip(2); scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL); @@ -509,7 +509,7 @@ void Scene20::Action4::signal() { case 7: _globals->_player.setStrip(2); _globals->_player.animate(ANIM_MODE_2, NULL); - scene->_sound.startSound(77, this, 127); + scene->_sound.play(77, this, 127); break; case 8: _globals->_game->endGame(20, 0); @@ -552,15 +552,15 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _SceneObjectExt._moveDiff = Common::Point(10, 10); _sceneObject3._moveDiff = Common::Point(10, 10); - _globals->_soundHandler.startSound(20); - _sound.startSound(21); - _sound.proc5(1); + _globals->_soundHandler.play(20); + _sound.play(21); + _sound.holdAt(true); setAction(&_action2); _sceneBounds = Rect(320, 0, 640, 200); } else if (_globals->_sceneManager._previousScene == 60) { // Evasion - _sound.startSound(30); + _sound.play(30); _globals->_player.postInit(); _globals->_player.setVisage(20); _globals->_player.setPosition(Common::Point(588, 79)); @@ -608,7 +608,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _speakerGameText.setTextPos(Common::Point(350, 20)); _speakerGameText._textWidth = 260; - _globals->_soundHandler.startSound(8); + _globals->_soundHandler.play(8); _sceneBounds = Rect(320, 0, 640, 200); } @@ -672,7 +672,7 @@ void Scene30::BeamAction::signal() { case 2: // Hide the beam and lower the player's hand - scene->_sound.startSound(10, NULL, 127); + scene->_sound.play(10, NULL, 127); _globals->_player.animate(ANIM_MODE_6, this); scene->_beam.remove(); break; @@ -696,14 +696,14 @@ void Scene30::BeamAction::signal() { case 4: // Open the door - scene->_sound.startSound(11, NULL, 127); + scene->_sound.play(11, NULL, 127); scene->_door.animate(ANIM_MODE_5, this); break; case 5: // Run the Kzin's talk sequence - scene->_sound.startSound(13, NULL, 127); - _globals->_soundHandler.startSound(12, NULL, 127); + scene->_sound.play(13, NULL, 127); + _globals->_soundHandler.play(12, NULL, 127); scene->_stripManager.start((scene->_sceneMode == 0) ? 30 : 37, this); break; @@ -735,7 +735,7 @@ void Scene30::KzinAction::signal() { setDelay(1200); break; case 1: - _globals->_soundHandler.proc2(0); + _globals->_soundHandler.fadeOut(NULL); _globals->_player.disableControl(); setAction(&scene->_sequenceManager, _globals->_sceneManager._scene, 31, &scene->_kzin, &scene->_door, NULL); break; @@ -775,12 +775,12 @@ void Scene30::RingAction::signal() { } case 3: - scene->_sound.startSound(11, NULL, 127); + scene->_sound.play(11, NULL, 127); scene->_door.animate(ANIM_MODE_6, this); break; case 4: { - scene->_sound.startSound(13, NULL, 127); + scene->_sound.play(13, NULL, 127); NpcMover *kzinMover = new NpcMover(); Common::Point pt(354, 5); scene->_kzin.addMover(kzinMover, &pt, this); @@ -958,7 +958,7 @@ void Scene40::Action1::signal() { scene->_doorway.setVisage(46); scene->_doorway.setPosition(Common::Point(305, 61)); scene->_doorway.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 3: scene->_doorway.hide(); @@ -979,7 +979,7 @@ void Scene40::Action1::signal() { scene->_assassin.setFrame(1); scene->_assassin.setPosition(Common::Point(13, 171)); scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 5: scene->_doorway.show(); @@ -1014,7 +1014,7 @@ void Scene40::Action1::signal() { break; } case 10: { - scene->_soundHandler.startSound(27); + scene->_soundHandler.play(27); Common::Point pt(223, 184); NpcMover *mover = new NpcMover(); scene->_dyingKzin.addMover(mover, &pt, this); @@ -1027,7 +1027,7 @@ void Scene40::Action1::signal() { break; } case 12: { - _globals->_soundHandler.startSound(26); + _globals->_soundHandler.play(26); _globals->_player._uiEnabled = true; scene->_assassin.setVisage(42); scene->_assassin.setPosition(Common::Point(4, 191)); @@ -1046,7 +1046,7 @@ void Scene40::Action1::signal() { scene->_assassin.setStrip(1); scene->_assassin.setFrame(1); scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); break; case 15: _globals->_player.disableControl(); @@ -1060,7 +1060,7 @@ void Scene40::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 16: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 17: _globals->_game->endGame(40, 20); @@ -1086,7 +1086,7 @@ void Scene40::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 2: { - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); scene->_doorway.postInit(); scene->_doorway.setVisage(16); scene->_doorway.setStrip2(6); @@ -1106,7 +1106,7 @@ void Scene40::Action2::signal() { scene->_assassin.setVisage(44); scene->_assassin._frame = 1; scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(29); + scene->_soundHandler.play(29); RING_INVENTORY._infoDisk._sceneNumber = 40; break; case 4: @@ -1237,11 +1237,11 @@ void Scene40::Action6::signal() { scene->_doorway.setVisage(46); scene->_doorway.setPosition(Common::Point(305, 61)); scene->_doorway.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; } case 1: - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); scene->_doorway.setPosition(Common::Point(148, 74)); scene->_doorway.setFrame(1); scene->_doorway.setStrip(2); @@ -1273,7 +1273,7 @@ void Scene40::Action7::signal() { scene->_object7.setFrame(15); } scene->_object7.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 2: scene->_object7.remove(); @@ -1325,7 +1325,7 @@ void Scene40::Action8::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 4: _globals->_game->endGame(40, 45); @@ -1483,7 +1483,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _globals->_player.disableControl(); if (_globals->_sceneManager._previousScene == 20) { - _globals->_soundHandler.startSound(24); + _globals->_soundHandler.play(24); _globals->_player.setVisage(43); _object1.postInit(); @@ -1872,7 +1872,7 @@ void Scene60::Action1::signal() { scene->_floppyDrive.setPosition(Common::Point(136, 65)); scene->_floppyDrive.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(35); + scene->_soundHandler1.play(35); break; case 2: scene->_redLights.postInit(); @@ -1893,13 +1893,13 @@ void Scene60::Action1::signal() { scene->_message._numFrames = 5; _globals->_sceneItems.push_front(&scene->_message); - scene->_soundHandler2.startSound(38); + scene->_soundHandler2.play(38); } _globals->_events.setCursor(CURSOR_USE); break; case 3: - scene->_soundHandler2.startSound(37); + scene->_soundHandler2.play(37); scene->loadScene(65); scene->_message.remove(); @@ -1968,8 +1968,8 @@ void Scene60::Action1::signal() { scene->_floppyDrive.setFrame(scene->_floppyDrive.getFrameCount()); scene->_floppyDrive.animate(ANIM_MODE_6, this); - scene->_soundHandler1.startSound(35); - scene->_soundHandler3.proc3(); + scene->_soundHandler1.play(35); + scene->_soundHandler3.stop(); scene->_masterButton.setFrame(1); scene->_masterButton._state = 0; @@ -2019,7 +2019,7 @@ void Scene60::PrevObject::doAction(int action) { animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() > 5) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); scene->_action1.setActionIndex(scene->_action1.getActionIndex() - 2); scene->_action1.setDelay(1); } @@ -2037,7 +2037,7 @@ void Scene60::NextObject::doAction(int action) { animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() < 8) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); scene->_action1.setDelay(1); } } else { @@ -2051,7 +2051,7 @@ void Scene60::ExitObject::doAction(int action) { if (action == CURSOR_LOOK) { SceneItem::display2(60, 18); } else if (action == CURSOR_USE) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); animate(ANIM_MODE_8, 1, NULL); scene->_nextButton.remove(); scene->_prevButton.remove(); @@ -2132,8 +2132,8 @@ void Scene60::ControlObject::doAction(int action) { if (_animateMode == ANIM_MODE_NONE) SceneItem::display2(60, 14); else if (!scene->_slaveButton._state) { - _globals->_soundHandler.startSound(40); - _globals->_soundHandler.proc5(1); + _globals->_soundHandler.play(40); + _globals->_soundHandler.holdAt(true); _globals->_sceneManager.changeScene(20); } else { scene->_sceneMode = 15; @@ -2153,14 +2153,14 @@ void Scene60::SlaveObject::doAction(int action) { if (scene->_masterButton._state) scene->_sceneMode = 19; else if (_state) { - scene->_soundHandler3.proc3(); + scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); _globals->clearFlag(102); _globals->clearFlag(!_globals->_stripNum ? 117 : 120); _state = 0; scene->_sceneMode = 9998; } else { - scene->_soundHandler3.startSound(39); + scene->_soundHandler3.play(39); _globals->setFlag(102); _globals->setFlag(!_globals->_stripNum ? 117 : 120); animate(ANIM_MODE_5, NULL); @@ -2185,14 +2185,14 @@ void Scene60::MasterObject::doAction(int action) { else if (scene->_slaveButton._state) scene->_sceneMode = 20; else if (_state) { - scene->_soundHandler3.proc3(); + scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); _state = 0; _globals->clearFlag(103); _globals->clearFlag(!_globals->_stripNum ? 116 : 119); scene->_sceneMode = 9998; } else { - scene->_soundHandler3.startSound(39); + scene->_soundHandler3.play(39); animate(ANIM_MODE_5, NULL); _state = 1; _globals->setFlag(103); @@ -2347,7 +2347,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _redLights.setPosition(Common::Point(199, 186)); _redLights.animate(ANIM_MODE_8, 0, NULL); - _soundHandler1.startSound(35); + _soundHandler1.play(35); if (!_globals->getFlag(83)) { _message.postInit(); @@ -2359,7 +2359,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message._numFrames = 5; _globals->_sceneItems.push_front(&_message); - _soundHandler2.startSound(38); + _soundHandler2.play(38); } } } else { @@ -2382,7 +2382,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _redLights.animate(ANIM_MODE_8, 0, NULL); _redLights._numFrames = 5; - _soundHandler1.startSound(35); + _soundHandler1.play(35); if (!_globals->getFlag(83)) { _message.postInit(); @@ -2394,7 +2394,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message._numFrames = 5; _globals->_sceneItems.push_front(&_message); - _soundHandler2.startSound(38); + _soundHandler2.play(38); } } } @@ -2462,7 +2462,7 @@ void Scene90::Action1::signal() { setDelay(2); break; case 5: - scene->_soundHandler2.startSound(58); + scene->_soundHandler2.play(58); if (scene->_stripManager._field2E8 == 220) scene->_stripManager.start(91, this, scene); @@ -2477,7 +2477,7 @@ void Scene90::Action1::signal() { break; case 7: scene->_object2.animate(ANIM_MODE_NONE); - _globals->_soundHandler.startSound(56); + _globals->_soundHandler.play(56); scene->_object3.animate(ANIM_MODE_5, this); break; case 8: { @@ -2507,8 +2507,8 @@ void Scene90::Action1::signal() { break; } case 11: - _globals->_soundHandler.startSound(57); - _globals->_soundHandler.startSound(68); + _globals->_soundHandler.play(57); + _globals->_soundHandler.play(68); scene->_object3.animate(ANIM_MODE_6, NULL); SceneItem::display(90, _globals->getFlag(104) ? 15 : 14, @@ -2556,8 +2556,8 @@ void Scene90::Object2::doAction(int action) { scene->_object6.hide(); scene->_sceneMode = 91; - scene->_soundHandler1.startSound(59); - scene->_soundHandler1.proc5(1); + scene->_soundHandler1.play(59); + scene->_soundHandler1.holdAt(true); scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_object6, NULL); break; case CURSOR_LOOK: @@ -2653,9 +2653,9 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _globals->_sceneItems.push_back(&_object3); _globals->_player.disableControl(); - _globals->_soundHandler.startSound(55); - _soundHandler1.startSound(52); - _soundHandler1.proc5(1); + _globals->_soundHandler.play(55); + _soundHandler1.play(52); + _soundHandler1.holdAt(true); setAction(&_action1); @@ -2670,7 +2670,7 @@ void Scene90::signal() { switch (_sceneMode) { case 91: _sceneMode = 92; - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 92: _globals->_scenePalette.clearListeners(); @@ -2713,7 +2713,7 @@ void Scene95::Action1::signal() { setDelay(60); break; case 2: { - scene->_soundHandler.startSound(66); + scene->_soundHandler.play(66); scene->_object3._numFrames = 5; scene->_object3.animate(ANIM_MODE_5, NULL); SceneItem::display(0, 0); @@ -2728,7 +2728,7 @@ void Scene95::Action1::signal() { break; } case 3: { - scene->_soundHandler.startSound(21); + scene->_soundHandler.play(21); Common::Point pt1(235, 72); PlayerMover *mover1 = new PlayerMover(); @@ -2768,7 +2768,7 @@ void Scene95::Action1::signal() { scene->_object1.setVisage(91); scene->_object1.setPosition(Common::Point(-22, 220)); - scene->_soundHandler.startSound(21); + scene->_soundHandler.play(21); Common::Point pt1(5, 198); NpcMover *mover1 = new NpcMover(); @@ -2826,7 +2826,7 @@ void Scene95::postInit(SceneObjectList *OwnerList) { _object3.setVisage(96); _object3.setPosition(Common::Point(29, 198)); - _soundHandler.startSound(67); + _soundHandler.play(67); setAction(&_action1); } @@ -3000,14 +3000,14 @@ void Scene6100::Action5::dispatch() { (tempSet.sqrt(floatSet) < 150.0)) { switch (scene->_hitCount++) { case 1: - scene->_soundHandler.startSound(233); + scene->_soundHandler.play(233); scene->showMessage(0, NULL, 0); if (!_globals->getFlag(76)) scene->_object5.setAction(&scene->_action2); case 2: - scene->_soundHandler.startSound(234); + scene->_soundHandler.play(234); scene->showMessage(0, NULL, 0); if (!_globals->getFlag(76)) @@ -3016,7 +3016,7 @@ void Scene6100::Action5::dispatch() { break; default: - scene->_soundHandler.startSound(233); + scene->_soundHandler.play(233); scene->showMessage(0, NULL, 0); if (!_globals->getFlag(76)) @@ -3216,7 +3216,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { if (!_globals->getFlag(76)) _probe.setAction(&_action4); - _globals->_soundHandler.startSound(231); + _globals->_soundHandler.play(231); } void Scene6100::remove() { diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h index be6d8e6337..81efe28f53 100644 --- a/engines/tsage/ringworld_scenes1.h +++ b/engines/tsage/ringworld_scenes1.h @@ -33,6 +33,7 @@ #include "tsage/core.h" #include "tsage/scenes.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -68,7 +69,7 @@ class Scene15 : public Scene { public: Action1 _action1; SceneObject _object1; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -100,7 +101,7 @@ public: Action3 _action3; Action4 _action4; SceneObject _sceneObject1, _SceneObjectExt, _sceneObject3, _sceneObject4, _sceneObject5; - SoundHandler _sound; + ASound _sound; public: Scene20(); virtual ~Scene20() {} @@ -146,7 +147,7 @@ class Scene30 : public Scene { }; public: - SoundHandler _sound; + ASound _sound; DisplayHotspot _groundHotspot, _wallsHotspot, _courtyardHotspot, _treeHotspot; BeamObject _beam; DoorObject _door; @@ -235,7 +236,7 @@ public: SpeakerQText _speakerQText; SpeakerSText _speakerSText; SpeakerGameText _speakerGameText; - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; Action3 _action3; @@ -390,9 +391,9 @@ public: SceneObject _redLights; Item1 _item1; Item _item2, _item3, _item4, _item5, _item6; - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; - SoundHandler _soundHandler3; + ASound _soundHandler1; + ASound _soundHandler2; + ASound _soundHandler3; Scene60(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -426,7 +427,7 @@ public: DisplayObject _object3, _object4, _object5; SceneObject _object6; DisplayHotspot _item1, _item2, _item3; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; Scene90(); @@ -445,7 +446,7 @@ public: Action1 _action1; int _field326; SceneObject _object1, _object2, _object3; - SoundHandler _soundHandler; + ASound _soundHandler; Scene95(); virtual void postInit(SceneObjectList *OwnerList); @@ -507,7 +508,7 @@ public: Action5 _action5; GetBoxAction _getBoxAction; Action7 _action7; - SoundHandler _soundHandler; + ASound _soundHandler; Speaker _speaker1; SpeakerQR _speakerQR; SpeakerSL _speakerSL; diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 045ea71586..dd5f7fecca 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -155,7 +155,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46); _sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48); - _globals->_soundHandler.startSound(251); + _globals->_soundHandler.play(251); if (_globals->_sceneManager._previousScene == 9150) { if (_globals->getFlag(20)) { _globals->_player.disableControl(); @@ -240,7 +240,7 @@ void Scene9150::dispatch() { } else { _globals->_player.disableControl(); if (_globals->getFlag(11)) { - _globals->_soundHandler.startSound(286); + _globals->_soundHandler.play(286); _sceneMode = 9153; } else { _sceneMode = 9156; @@ -274,7 +274,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { _sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1); _sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59); - _globals->_soundHandler.startSound(285); + _globals->_soundHandler.play(285); _globals->_player.disableControl(); if (_globals->getFlag(20)) { @@ -406,7 +406,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_2, 0); _object1.setPosition(Common::Point(132, 114), 0); _object1.setPriority2(140); - _soundHandler.startSound(297); + _soundHandler.play(297); _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerGR); _stripManager.addSpeaker(&_speakerGText); @@ -479,7 +479,7 @@ void Scene9300::signal() { _globals->setFlag(84); // No break on purpose case 9303: - _globals->_soundHandler.startSound(295); + _globals->_soundHandler.play(295); _globals->_sceneManager.changeScene(9350); break; case 9302: @@ -509,7 +509,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { _globals->_player.changeZoom(-1); _object1.postInit(); _object2.postInit(); - _globals->_soundHandler.startSound(289); + _globals->_soundHandler.play(289); _hotspot1.setup(35, 142, 76, 212, 9300, 0, 1); _hotspot2.setup(28, 90, 81, 143, 9300, 2, 3); @@ -763,7 +763,7 @@ void Scene9400::signal() { void Scene9400::dispatch() { if ((_object1._animateMode == 2) && (_object1._strip == 1) && (_object1._frame == 4)){ if (_field1032 == 0) { - _soundHandler.startSound(296); + _soundHandler.play(296); _field1032 = 1; } } else { @@ -1072,7 +1072,7 @@ void Scene9500::signal() { switch (_sceneMode) { case 9503: _globals->_sceneManager.changeScene(9200); - _globals->_soundHandler.startSound(295); + _globals->_soundHandler.play(295); break; case 9504: _globals->_sceneManager.changeScene(9850); @@ -1128,7 +1128,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { setZoomPercents(110, 75, 200, 150); _globals->_player.postInit(); - _globals->_soundHandler.startSound(305); + _globals->_soundHandler.play(305); _candle.postInit(0); _candle.setVisage(9500); @@ -1236,7 +1236,7 @@ void Scene9700::signal() { _globals->_events.setCursor(CURSOR_USE); break; case 9704: - _globals->_soundHandler.startSound(323); + _globals->_soundHandler.play(323); _globals->_sceneManager.changeScene(9750); break; } @@ -1294,7 +1294,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { void Scene9750::signal() { switch (_sceneMode ++) { case 9751: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 9752: _globals->_sceneManager.changeScene(2100); @@ -1426,7 +1426,7 @@ void Scene9850::Hotspot17::doAction(int action) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(306); + scene->_soundHandler.play(306); NamedHotspot::doAction(action); } } @@ -1438,7 +1438,7 @@ void Scene9850::Hotspot18::doAction(int action) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(306); + scene->_soundHandler.play(306); NamedHotspot::doAction(action); } } @@ -1450,7 +1450,7 @@ void Scene9850::Hotspot19::doAction(int action) { SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(313); + scene->_soundHandler.play(313); NamedHotspot::doAction(action); } } @@ -1639,7 +1639,7 @@ void Scene9900::strAction1::signal() { switch (_actionIndex++) { case 0: - scene->_soundHandler.startSound(351); + scene->_soundHandler.play(351); _object9.postInit(); _object9.setVisage(18); _object9._frame = 1; @@ -1658,7 +1658,7 @@ void Scene9900::strAction1::signal() { _globals->_scenePalette.addFader(&mask2[0], 1, 5, this); break; case 3: - _globals->_soundHandler.startSound(377); + _globals->_soundHandler.play(377); setDelay(120); break; case 4: @@ -1829,7 +1829,7 @@ void Scene9900::signal() { switch (_sceneMode){ case 150: - _globals->_soundHandler.startSound(380); + _globals->_soundHandler.play(380); _object8.postInit(0); _object8.setVisage(2002); _object8.setStrip(1); @@ -1862,7 +1862,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9904: - _globals->_soundHandler.startSound(390); + _globals->_soundHandler.play(390); _sceneMode = 9912; setAction(&_strAction2, this); break; @@ -1893,7 +1893,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9909: - _globals->_soundHandler.startSound(375); + _globals->_soundHandler.play(375); _globals->_player.disableControl(); _sceneMode = 9907; setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); @@ -1904,7 +1904,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9911: - _globals->_soundHandler.startSound(367); + _globals->_soundHandler.play(367); _globals->_player.disableControl(); _sceneMode = 9909; setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); @@ -2055,7 +2055,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { else _globals->_stripNum = 2121; - _globals->_soundHandler.startSound(118); + _globals->_soundHandler.play(118); } diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index 2f5ce0f825..43f0938439 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -132,7 +132,7 @@ public: SpeakerGText _speakerGText; SpeakerGR _speakerGR; SpeakerQText _speakerQText; - SoundHandler _soundHandler; + ASound _soundHandler; SceneHotspot1 _hotspot1; NamedHotspot _hotspot2; NamedHotspot _hotspot3; @@ -233,7 +233,7 @@ public: NamedHotspot _hotspot4; NamedHotspot _hotspot5; NamedHotspot _hotspot6; - SoundHandler _soundHandler; + ASound _soundHandler; int _field1032; SceneHotspot7 _hotspot7; SceneHotspot8 _hotspot8; @@ -426,7 +426,7 @@ public: SceneObject _objLever; Object6 _objScimitar; Object7 _objSword; - SoundHandler _soundHandler; + ASound _soundHandler; NamedHotspot _hotspot1; NamedHotspot _hotspot2; NamedHotspot _hotspot3; @@ -483,7 +483,7 @@ class Scene9900 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SceneObject _object1; SceneObject _object2; diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index 3e3686e2d5..746d0df676 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -123,7 +123,7 @@ void Scene1000::Action3::signal() { if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { _actionIndex = 20; - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); } else { setDelay(1); } @@ -212,7 +212,7 @@ void Scene1000::Action3::signal() { case 18: zoom(false); _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 19: _globals->_sceneManager.changeScene(10); @@ -265,7 +265,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.startSound(114); + _globals->_soundHandler.play(114); } else if (_globals->_sceneManager._previousScene == 2222) { setZoomPercents(150, 10, 180, 100); _object1.postInit(); @@ -281,7 +281,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } else { - _globals->_soundHandler.startSound(4); + _globals->_soundHandler.play(4); setZoomPercents(0, 10, 30, 100); _object3.postInit(); _object3.setVisage(1050); @@ -427,7 +427,7 @@ void Scene1001::Action1::signal() { setDelay(10); break; case 16: { - scene->_soundHandler1.startSound(90); + scene->_soundHandler1.play(90); scene->_object6.postInit(); scene->_object6.setVisage(16); @@ -444,7 +444,7 @@ void Scene1001::Action1::signal() { break; } case 17: { - scene->_soundHandler1.startSound(90); + scene->_soundHandler1.play(90); scene->_object6.remove(); scene->_object7.postInit(); @@ -473,7 +473,7 @@ void Scene1001::Action1::signal() { setDelay(30); break; case 19: { - _globals->_soundHandler.startSound(91); + _globals->_soundHandler.play(91); byte adjustData[4] = {0xff, 0xff, 0xff, 0}; _globals->_scenePalette.fade(adjustData, true, 0); @@ -493,7 +493,7 @@ void Scene1001::Action1::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 22: - _globals->_soundHandler.startSound(92); + _globals->_soundHandler.play(92); scene->_stripManager.start(111, this); break; case 23: @@ -523,7 +523,7 @@ void Scene1001::postInit(SceneObjectList *OwnerList) { _object3.setStrip2(4); _object3.setPosition(Common::Point(61, 177)); - _globals->_soundHandler.startSound(85); + _globals->_soundHandler.play(85); setAction(&_action1); } @@ -644,7 +644,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { setAction(&_action4); } else { setAction(&_action3); - _globals->_soundHandler.startSound(114); + _globals->_soundHandler.play(114); } } @@ -731,7 +731,7 @@ void Scene1400::Action1::signal() { _globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180); _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_stripNum = 1500; - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); _globals->_sceneManager.changeScene(1500); break; @@ -776,7 +776,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100; setAction(&_action1); - _globals->_soundHandler.startSound(118); + _globals->_soundHandler.play(118); } /*-------------------------------------------------------------------------- @@ -839,7 +839,7 @@ void Scene1500::Action1::signal() { setDelay(30); break; case 6: - scene->_soundHandler.startSound(123); + scene->_soundHandler.play(123); scene->_object1.setStrip2(4); scene->_object1.setFrame(1); scene->_object1.animate(ANIM_MODE_5, this); @@ -847,13 +847,13 @@ void Scene1500::Action1::signal() { case 7: scene->_object1.setStrip2(5); scene->_object1.animate(ANIM_MODE_2, NULL); - scene->_soundHandler.startSound(124, this); + scene->_soundHandler.play(124, this); break; case 8: - _globals->_soundHandler.startSound(126, this); + _globals->_soundHandler.play(126, this); break; case 9: - _globals->_soundHandler.startSound(127); + _globals->_soundHandler.play(127); _globals->_sceneManager.changeScene(2000); break; } @@ -890,7 +890,7 @@ void Scene1500::Action2::signal() { break; } case 3: - scene->_soundHandler.proc4(); + scene->_soundHandler.release(); _globals->_stripNum = 1505; _globals->_sceneManager.changeScene(2400); break; @@ -904,7 +904,7 @@ void Scene1500::postInit(SceneObjectList *OwnerList) { Scene::postInit(); if ((_globals->_stripNum == 1500) || ((_globals->_stripNum != 1504) && (_globals->_stripNum != 2751))) { - _globals->_soundHandler.startSound(120); + _globals->_soundHandler.play(120); setZoomPercents(105, 20, 145, 100); setAction(&_action1); diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h index 75843d3570..9c781a94d6 100644 --- a/engines/tsage/ringworld_scenes2.h +++ b/engines/tsage/ringworld_scenes2.h @@ -75,7 +75,7 @@ public: Action1 _action1; SceneObject _object1, _object2, _object3, _object4; SceneObject _object5, _object6, _object7; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -137,7 +137,7 @@ public: virtual void signal(); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; SceneObject _object1, _object2, _object3; diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 4ed2d98662..296eebe653 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -132,11 +132,11 @@ void Scene2000::Action6::signal() { setDelay(130); break; case 1: - scene->_soundHandler2.startSound(79); + scene->_soundHandler2.play(79); scene->_stripManager.start(2000, this); break; case 2: - _globals->_soundHandler.startSound(81); + _globals->_soundHandler.play(81); scene->_object6.postInit(); scene->_object6.setVisage(2003); scene->_object6.setAction(NULL); @@ -151,7 +151,7 @@ void Scene2000::Action6::signal() { scene->_object6.animate(ANIM_MODE_6, this); break; case 5: - _globals->_soundHandler.startSound(80); + _globals->_soundHandler.play(80); scene->_object6.remove(); _globals->_sceneManager.changeScene(1001); break; @@ -311,12 +311,12 @@ void Scene2000::Action14::signal() { setDelay(60); break; case 3: - _globals->_soundHandler.startSound(99); + _globals->_soundHandler.play(99); scene->_object8.show(); scene->_object8.animate(ANIM_MODE_5, this); break; case 4: - _globals->_soundHandler.startSound(12); + _globals->_soundHandler.play(12); scene->_object8.setStrip(2); scene->_object8.setFrame(1); scene->_object9.show(); @@ -327,7 +327,7 @@ void Scene2000::Action14::signal() { scene->_stripManager.start(2001, this, scene); break; case 6: - _globals->_soundHandler.proc1(0/* was false */); + _globals->_soundHandler.fadeOut(0/* was false */); scene->_object8.setStrip(1); scene->_object8.setFrame(scene->_object8.getFrameCount()); scene->_object8.animate(ANIM_MODE_6, this); @@ -336,7 +336,7 @@ void Scene2000::Action14::signal() { scene->_object10.remove(); break; case 7: - _globals->_soundHandler.startSound(111); + _globals->_soundHandler.play(111); scene->_object8.remove(); setDelay(5); break; @@ -428,11 +428,11 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { setAction(&_action13); break; case 2200: - _globals->_soundHandler.startSound(111); + _globals->_soundHandler.play(111); setAction(&_action14); break; case 2222: - _globals->_soundHandler.startSound(115); + _globals->_soundHandler.play(115); setAction(&_action8); break; case 3500: @@ -440,12 +440,12 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { break; default: _object6.remove(); - _globals->_soundHandler.startSound(80); + _globals->_soundHandler.play(80); setAction(&_action6); break; } - _soundHandler1.startSound(78); + _soundHandler1.play(78); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } @@ -505,7 +505,7 @@ void Scene2100::Action1::signal() { break; } case 2: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 3: { @@ -554,7 +554,7 @@ void Scene2100::Action1::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -563,7 +563,7 @@ void Scene2100::Action1::signal() { if (_state == 2100) { setDelay(1); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); } break; @@ -579,7 +579,7 @@ void Scene2100::Action1::signal() { break; case 7: _globals->_player.setPriority2(-1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 8: @@ -777,17 +777,17 @@ void Scene2100::Action9::signal() { scene->_stripManager.start(6050, this); break; case 2: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler.startSound(12); + scene->_soundHandler.play(12); scene->_object4.setStrip(2); scene->_stripManager.start(6051, this, scene); break; case 4: - scene->_soundHandler.proc1(0/* was false */); + scene->_soundHandler.fadeOut(0/* was false */); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -848,7 +848,7 @@ void Scene2100::Action10::signal() { break; } case 5: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { @@ -881,7 +881,7 @@ void Scene2100::Action10::signal() { setDelay(45); break; case 9: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 10: @@ -924,7 +924,7 @@ void Scene2100::Action11::signal() { break; } case 3: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 4: { @@ -945,7 +945,7 @@ void Scene2100::Action11::signal() { setDelay(45); break; case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 7: @@ -970,7 +970,7 @@ void Scene2100::Action12::signal() { scene->_stripManager.start(6000, this); break; case 2: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 3: { @@ -984,7 +984,7 @@ void Scene2100::Action12::signal() { break; } case 4: { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, NULL); _globals->_player.setPriority2(-1); @@ -1094,7 +1094,7 @@ void Scene2100::Action14::signal() { scene->_stripManager.start(6008, this); break; case 4: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; @@ -1103,7 +1103,7 @@ void Scene2100::Action14::signal() { scene->_stripManager.start(6009, this, scene); break; case 6: - scene->_soundHandler.proc1(0/* was false */); + scene->_soundHandler.fadeOut(0/* was false */); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -1134,7 +1134,7 @@ void Scene2100::Action14::signal() { break; } case 10: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 11: { @@ -1148,7 +1148,7 @@ void Scene2100::Action14::signal() { setDelay(30); case 13: scene->_object3.setPriority2(1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 14: @@ -1177,7 +1177,7 @@ void Scene2100::Action15::signal() { scene->_object3.setPriority2(1); scene->_object3.changeZoom(-1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 2: { @@ -1188,7 +1188,7 @@ void Scene2100::Action15::signal() { break; } case 3: { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); Common::Point pt(272, 140); @@ -1248,7 +1248,7 @@ void Scene2100::Action16::signal() { break; } case 5: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { @@ -1263,7 +1263,7 @@ void Scene2100::Action16::signal() { setDelay(45); break; case 8: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 9: @@ -1292,17 +1292,17 @@ void Scene2100::Action17::signal() { scene->_stripManager.start(7070, this); break; case 4: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; case 5: - scene->_soundHandler.startSound(12); + scene->_soundHandler.play(12); scene->_object4.setStrip(2); scene->_stripManager.start(7071, this, scene); break; case 6: - scene->_soundHandler.proc1(NULL); + scene->_soundHandler.fadeOut(NULL); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -1676,8 +1676,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _object1.setPriority2(-1); _globals->_player.setPriority2(-1); _globals->_player.setPosition(Common::Point(80, 66)); @@ -1744,8 +1744,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { } break; case 3700: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); Scene::setZoomPercents(80, 75, 100, 90); if (_globals->_sceneObjects->contains(&_object2)) @@ -1763,8 +1763,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2105, &_object3, NULL); break; case 4250: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->clearFlag(43); _globals->_player.setVisage(2104); @@ -1782,8 +1782,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2107, &_object4, NULL); break; case 5000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (_globals->_sceneObjects->contains(&_object2)) _object2.remove(); @@ -1799,8 +1799,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action5); break; case 5100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); @@ -1818,8 +1818,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action9); break; case 7000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (RING_INVENTORY._stasisBox2._sceneNumber == 1) { _globals->_player.setPriority2(1); @@ -1846,8 +1846,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { } break; case 7600: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (_globals->_sceneObjects->contains(&_object2)) _object2.remove(); @@ -1858,8 +1858,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action8); break; case 8100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); @@ -1871,8 +1871,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2106, NULL); break; case 9750: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); @@ -1889,8 +1889,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2103, &_object4, NULL); break; default: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player._uiEnabled = true; break; @@ -2053,7 +2053,7 @@ void Scene2120::Action1::dispatch() { _actionIndex = !_entries[scene->_subjectIndex]._visage ? 4 : 3; setDelay(30); - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Next Page button handling @@ -2084,7 +2084,7 @@ void Scene2120::Action1::dispatch() { setDelay(30); } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Previous Page button handling @@ -2111,7 +2111,7 @@ void Scene2120::Action1::dispatch() { break; } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Exit button handling @@ -2141,7 +2141,7 @@ void Scene2120::Action1::dispatch() { setDelay(1); } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } } @@ -2209,7 +2209,7 @@ void Scene2150::Action1::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 2: { @@ -2259,7 +2259,7 @@ void Scene2150::Action1::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -2268,7 +2268,7 @@ void Scene2150::Action1::signal() { if (_state == 2150) { setDelay(1); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_6, this); } break; @@ -2283,7 +2283,7 @@ void Scene2150::Action1::signal() { } break; case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_6, this); break; case 7: @@ -2310,10 +2310,10 @@ void Scene2150::Action2::signal() { _globals->_player.setStrip(8); _globals->_player.animate(ANIM_MODE_8, 1, this); - scene->_soundHandler.startSound(163); + scene->_soundHandler.play(163); break; case 2: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot10.animate(ANIM_MODE_5, this); break; case 3: @@ -2338,7 +2338,7 @@ void Scene2150::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 5: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot10.animate(ANIM_MODE_6, NULL); scene->_hotspot14.remove(); @@ -2537,8 +2537,8 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setPosition(Common::Point(108, 99)); break; case 2200: @@ -2687,7 +2687,7 @@ void Scene2200::Action3::signal() { switch (_actionIndex++) { case 0: { - scene->_soundHandler2.startSound(103); + scene->_soundHandler2.play(103); scene->_hotspot4.setStrip(4); scene->_hotspot4.animate(ANIM_MODE_NONE, NULL); @@ -2704,7 +2704,7 @@ void Scene2200::Action3::signal() { break; } case 1: - scene->_soundHandler2.startSound(104); + scene->_soundHandler2.play(104); scene->_hotspot4.setStrip(2); scene->_hotspot4.setFrame(2); setDelay(120); @@ -2860,7 +2860,7 @@ void Scene2200::Hotspot9::doAction(int action) { break; case OBJECT_INFODISK: if (_globals->_sceneManager._previousScene == 2310) { - scene->_soundHandler2.startSound(35); + scene->_soundHandler2.play(35); _globals->_player.disableControl(); scene->setAction(&scene->_action3); } @@ -2921,8 +2921,8 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot8.remove(); break; case 4000: - _globals->_soundHandler.startSound(100); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(100); + _globals->_soundHandler.holdAt(true); _globals->_player.remove(); _hotspot5.remove(); _hotspot8.remove(); @@ -2962,9 +2962,9 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot4.setPriority2(255); _globals->_sceneItems.push_back(&_hotspot4); - _soundHandler1.startSound(101); - _soundHandler2.startSound(100); - _globals->_soundHandler.proc5(true); + _soundHandler1.play(101); + _soundHandler2.play(100); + _globals->_soundHandler.holdAt(true); _globals->_sceneItems.push_back(&_hotspot5); setAction(&_action2); @@ -3117,7 +3117,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } - _soundHandler.startSound(116); + _soundHandler.play(116); _globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); @@ -3203,7 +3203,7 @@ void Scene2230::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler.startSound(157); + scene->_soundHandler.play(157); _globals->_player._moveDiff = Common::Point(1, 1); _globals->_player.setAction(&scene->_action4); _globals->_player._uiEnabled = true; @@ -3227,7 +3227,7 @@ void Scene2230::Action3::signal() { NpcMover *mover = new NpcMover(); _globals->_player.addMover(mover, &pt, this); - scene->_soundHandler.proc3(); + scene->_soundHandler.stop(); break; } case 1: @@ -3346,7 +3346,7 @@ void Scene2230::Action7::signal() { break; } case 2: { - scene->_soundHandler.startSound(158); + scene->_soundHandler.play(158); scene->_hotspot8.setStrip2(2); Common::Point pt(scene->_hotspot8._position.x, 97); @@ -3429,7 +3429,7 @@ void Scene2230::Action8::signal() { scene->_hotspot2.animate(ANIM_MODE_6, this); break; case 4: { - scene->_soundHandler.startSound(158); + scene->_soundHandler.play(158); scene->_hotspot2.remove(); scene->_hotspot8._frame = 1; @@ -3752,7 +3752,7 @@ void Scene2280::Action1::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot16.animate(ANIM_MODE_5, this); break; case 2: { @@ -3767,7 +3767,7 @@ void Scene2280::Action1::signal() { break; case 4: _globals->_player.setPriority2(1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot16.animate(ANIM_MODE_6, this); break; case 5: @@ -3788,7 +3788,7 @@ void Scene2280::Action2::signal() { break; } case 1: - scene->_soundHandler.startSound(265); + scene->_soundHandler.play(265); _globals->_player.setVisage(2162); _globals->_player._frame = 1; @@ -3808,7 +3808,7 @@ void Scene2280::Action2::signal() { scene->_hotspot12.remove(); break; case 4: - scene->_soundHandler.startSound(266); + scene->_soundHandler.play(266); _globals->_player.setVisage(2170); _globals->_player._frame = 1; _globals->_player._strip = 4; @@ -3836,7 +3836,7 @@ void Scene2280::Action3::signal() { break; } case 1: - scene->_soundHandler.startSound(265); + scene->_soundHandler.play(265); _globals->_player.setVisage(2162); _globals->_player._frame = 6; @@ -4316,8 +4316,8 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _sceneMode = 2281; setAction(&_sequenceManager, this, 2281, &_globals->_player, &_hotspot16, NULL); - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); } _globals->_sceneItems.addItems(&_hotspot13, &_hotspot11, &_hotspot9, &_hotspot14, &_hotspot7, @@ -4367,7 +4367,7 @@ void Scene2300::Action1::signal() { } case 2: { scene->_hotspot8.setAction(&scene->_action4); - scene->_soundHandler2.startSound(21); + scene->_soundHandler2.play(21); Common::Point pt1(95, scene->_hotspot5._position.y); NpcMover *mover1 = new NpcMover(); @@ -4405,7 +4405,7 @@ void Scene2300::Action1::signal() { break; } case 6: - scene->_soundHandler1.startSound(28); + scene->_soundHandler1.play(28); _globals->_player.disableControl(); scene->_hotspot2.setVisage(40); @@ -4419,7 +4419,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 7: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 8: _globals->_game->endGame(2300, 0); @@ -4446,7 +4446,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 11: - scene->_soundHandler1.startSound(28); + scene->_soundHandler1.play(28); scene->_hotspot5._strip = 2; scene->_hotspot6._strip = 2; @@ -4463,7 +4463,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_6, this); break; case 12: - scene->_soundHandler1.startSound(77); + scene->_soundHandler1.play(77); _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setStrip(4); @@ -4540,8 +4540,8 @@ void Scene2300::Action2::signal() { scene->_hotspot2.setFrame(1); scene->_hotspot2.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(28); - scene->_soundHandler2.startSound(97); + scene->_soundHandler1.play(28); + scene->_soundHandler2.play(97); break; case 7: scene->_hotspot7._strip = 2; @@ -4584,8 +4584,8 @@ void Scene2300::Action3::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler1.startSound(97); - scene->_soundHandler2.startSound(28); + scene->_soundHandler1.play(97); + scene->_soundHandler2.play(28); scene->_hotspot7._strip = 2; scene->_hotspot7._frame = 1; @@ -4597,7 +4597,7 @@ void Scene2300::Action3::signal() { _globals->_player.animate(ANIM_MODE_6, NULL); break; case 4: - scene->_soundHandler2.startSound(97); + scene->_soundHandler2.play(97); _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setStrip(1); @@ -4618,7 +4618,7 @@ void Scene2300::Action4::signal() { switch (_actionIndex++) { case 0: scene->_hotspot8.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 1: scene->_hotspot9.postInit(); @@ -4628,7 +4628,7 @@ void Scene2300::Action4::signal() { scene->_hotspot9.setPosition(Common::Point(273, 199)); scene->_hotspot9.setPriority2(19); scene->_hotspot9.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 2: scene->_hotspot8.remove(); @@ -4639,10 +4639,10 @@ void Scene2300::Action4::signal() { scene->_hotspot10.setFrame(4); scene->_hotspot10.setPosition(Common::Point(292, 113)); scene->_hotspot10.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 3: - scene->_soundHandler1.startSound(13); + scene->_soundHandler1.play(13); remove(); break; } @@ -4718,7 +4718,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot8.setVisage(2301); _hotspot8.setPosition(Common::Point(288, 74)); - _globals->_soundHandler.startSound(96); + _globals->_soundHandler.play(96); if (_globals->_sceneManager._previousScene == 2000) { _hotspot8.remove(); @@ -4749,8 +4749,8 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot7.setPosition(Common::Point(229, 125)); _hotspot7._numFrames = 5; - _soundHandler1.startSound(95); - _soundHandler2.startSound(96); + _soundHandler1.play(95); + _soundHandler2.play(96); _globals->_sceneItems.push_back(&_hotspot7); setAction(&_action2); @@ -5032,7 +5032,7 @@ void Scene2320::Action2::signal() { switch (_actionIndex++) { case 0: { - scene->_soundHandler.startSound(253); + scene->_soundHandler.play(253); scene->_hotspot13.setPriority2(99); Common::Point pt(scene->_hotspot13._position.x, 200); @@ -5058,7 +5058,7 @@ void Scene2320::Action3::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: { @@ -5107,7 +5107,7 @@ void Scene2320::Action3::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -5116,7 +5116,7 @@ void Scene2320::Action3::signal() { if (_state == 2320) { setDelay(10); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_6, this); } break; @@ -5132,7 +5132,7 @@ void Scene2320::Action3::signal() { break; } case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_6, this); break; case 7: @@ -5217,8 +5217,8 @@ void Scene2320::Action4::signal() { break; case 10: if (_globals->getFlag(109)) { - _globals->_soundHandler.startSound(40); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(40); + _globals->_soundHandler.holdAt(true); Common::Point pt(303, 240); NpcMover *mover = new NpcMover(); @@ -5277,7 +5277,7 @@ void Scene2320::Action4::signal() { } case 19: { scene->_hotspot16.remove(); - scene->_soundHandler.startSound(253); + scene->_soundHandler.play(253); scene->_hotspot13.show(); Common::Point pt(319, 157); @@ -5428,7 +5428,7 @@ void Scene2320::Action7::signal() { setDelay(30); break; case 1: - _globals->_soundHandler.startSound(162); + _globals->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: @@ -5857,8 +5857,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setPriority2(-1); _globals->_player.setPosition(Common::Point(389, 72)); @@ -5875,8 +5875,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { case 4250: case 5000: case 7000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if ((_globals->_sceneManager._previousScene == 7000) && !_globals->getFlag(80)) _globals->setFlag(36); @@ -5892,8 +5892,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_action6); break; case 6100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _hotspot8.postInit(); _hotspot8.setVisage(2345); @@ -5904,9 +5904,9 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; case 7600: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); - _soundHandler.startSound(21); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); + _soundHandler.play(21); _globals->_player.setVisage(2323); _globals->_player.setStrip(2); @@ -5963,8 +5963,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; default: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _sceneMode = 2321; _globals->_player.setStrip(3); @@ -6095,7 +6095,7 @@ void Scene2400::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.startSound(153); + _globals->_soundHandler.play(153); } } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index 2cbe8de65b..8cb8374361 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -117,7 +117,7 @@ public: Action14 _action14; SceneObject _object1, _object2, _object3, _object4, _object5; SceneObject _object6, _object7, _object8, _object9, _object10; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void stripCallback(int v); @@ -235,7 +235,7 @@ class Scene2100 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerMText _speakerMText; SpeakerMR _speakerMR; SpeakerQL _speakerQL; @@ -313,7 +313,7 @@ class Scene2120 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SceneObject _topicArrowHotspot, _arrowHotspot, _visageHotspot; SceneObject _subjectButton, _nextPageButton, _previousPageButton, _exitButton; Action1 _action1; @@ -360,7 +360,7 @@ class Scene2150 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerGameText _speakerGameText; @@ -441,7 +441,7 @@ public: DisplayHotspot _hotspot10; SceneObject _hotspot2, _hotspot4; SceneObject _hotspot6, _hotspot7, _hotspot8; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; Scene2200(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -463,7 +463,7 @@ class Scene2222 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSText _speakerSText; SpeakerMText _speakerMText; SpeakerQText _speakerQText; @@ -553,7 +553,7 @@ class Scene2230 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; Action3 _action3; @@ -653,7 +653,7 @@ class Scene2280 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; Rect _exitRect; Action1 _action1; @@ -713,7 +713,7 @@ class Scene2300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SpeakerSL _speakerSL; SpeakerMText _speakerMText; SpeakerQText _speakerQText; @@ -835,7 +835,7 @@ class Scene2320 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager1, _sequenceManager2; SpeakerMText _speakerMText; SpeakerMR _speakerMR; diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp index 89feb223a1..f8338f24cd 100644 --- a/engines/tsage/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld_scenes4.cpp @@ -181,7 +181,7 @@ void Scene3700::Action1::signal() { setDelay(90); break; case 3: - scene->_soundHandler.startSound(196); + scene->_soundHandler.play(196); scene->_viewer.hide(); scene->_hotspot1.postInit(); @@ -193,7 +193,7 @@ void Scene3700::Action1::signal() { setDelay(90); break; case 4: - scene->_soundHandler.startSound(197); + scene->_soundHandler.play(197); scene->_hotspot1.hide(); scene->_hotspot2.postInit(); @@ -205,7 +205,7 @@ void Scene3700::Action1::signal() { setDelay(30); break; case 5: - scene->_soundHandler.startSound(198); + scene->_soundHandler.play(198); scene->_hotspot2.hide(); scene->_hotspot1.show(); setDelay(90); @@ -247,7 +247,7 @@ void Scene3700::postInit(tSage::SceneObjectList *OwnerList) { _viewer.setPosition(Common::Point(195, 83)); setAction(&_action1); - _globals->_soundHandler.startSound(195); + _globals->_soundHandler.play(195); } } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h index f5dac297fc..ab9c5011be 100644 --- a/engines/tsage/ringworld_scenes4.h +++ b/engines/tsage/ringworld_scenes4.h @@ -85,7 +85,7 @@ public: SpeakerSText _speakerSText; SpeakerMText _speakerMText; SpeakerMR _speakerMR; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index 910a35e492..d7a4e770f0 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -105,7 +105,7 @@ void Scene4000::Action1::signal() { ADD_MOVER(scene->_hotspot5, -40, 86); break; case 5: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->setFlag(43); _globals->setFlag(114); scene->_stripManager.start(4430, this); @@ -349,14 +349,14 @@ void Scene4000::Action8::signal() { setDelay(60); break; case 3: - _globals->_soundHandler.startSound(170); + _globals->_soundHandler.play(170); scene->_smoke2.setVisage(4000); scene->_smoke2.setStrip(6); scene->_smoke2.animate(ANIM_MODE_2, NULL); setDelay(60); break; case 4: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 5: _globals->_game->endGame(4000, 15); @@ -422,7 +422,7 @@ void Scene4000::Action11::signal() { scene->_olo.animate(ANIM_MODE_1, NULL); break; case 5: - scene->_soundHandler1.proc3(); + scene->_soundHandler1.stop(); scene->_forceField.remove(); ADD_MOVER(_globals->_player, 340, 163); @@ -485,12 +485,12 @@ void Scene4000::Action13::signal() { setDelay(3); break; case 1: - scene->_soundHandler2.startSound(151); - scene->_soundHandler2.proc5(true); + scene->_soundHandler2.play(151); + scene->_soundHandler2.holdAt(true); ADD_MOVER(scene->_lander, -30, 70); break; case 2: - scene->_soundHandler2.proc4(); + scene->_soundHandler2.release(); _globals->_sceneManager.changeScene(4010); break; } @@ -856,7 +856,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _theTech.setPosition(Common::Point(281, 176)); if (_globals->getFlag(34)) { - _soundHandler1.startSound(156); + _soundHandler1.play(156); _forceField.postInit(); _forceField.setVisage(4000); @@ -889,7 +889,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2320: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); if (RING_INVENTORY._ale._sceneNumber == 1) { _guardRock.postInit(); @@ -951,7 +951,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { } if (_globals->_stripNum == 4025) { - _soundHandler1.startSound(182); + _soundHandler1.play(182); _forceField.remove(); _hotspot5.postInit(); @@ -1029,7 +1029,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; case 4050: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->_player.disableControl(); if (_globals->_stripNum == 4050) { @@ -1066,7 +1066,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; default: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _lander.postInit(); _lander.setVisage(4002); @@ -1090,7 +1090,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { RING_INVENTORY._ladder._sceneNumber = 4100; RING_INVENTORY._rope._sceneNumber = 4150; - _soundHandler1.startSound(156); + _soundHandler1.play(156); _forceField.postInit(); _forceField.setVisage(4000); @@ -1229,8 +1229,8 @@ void Scene4000::dispatch() { if ((RING_INVENTORY._peg._sceneNumber == 1) && _globals->getFlag(34) && _globals->getFlag(37) && !_globals->getFlag(40)) { _globals->_player.disableControl(); - _soundHandler1.startSound(177); - _globals->_soundHandler.startSound(178); + _soundHandler1.play(177); + _globals->_soundHandler.play(178); setAction(&_action1); } @@ -1873,7 +1873,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _olloFace.setPriority2(152); if(_globals->_sceneManager._previousScene == 4050) { - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->_player.setPosition(Common::Point(72, 128)); _globals->_player.enableControl(); @@ -2247,7 +2247,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.setStrip(2); setAction(&_action2); - _globals->_soundHandler.startSound(175); + _globals->_soundHandler.play(175); } else { // Without the rope _globals->_player.setVisage(5315); @@ -2258,7 +2258,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_2, NULL); setAction(&_action4); - _globals->_soundHandler.startSound(176); + _globals->_soundHandler.play(176); } break; case 4045: @@ -2272,7 +2272,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setPosition(Common::Point(193, 193)); - _globals->_soundHandler.startSound(175); + _globals->_soundHandler.play(175); break; default: break; @@ -2691,7 +2691,7 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { &_hotspot11, &_hotspot9, &_hotspot7, &_hotspot10, &_hotspot8, &_hotspot14, NULL); if (_globals->_sceneManager._previousScene == 4150) { - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); if (!_globals->getFlag(42)) { _hotspot1.setVisage(4104); @@ -3065,8 +3065,8 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { &_hotspot10, &_hotspot9, &_hotspot8, &_hotspot7, &_hotspot6, &_hotspot2, &_hotspot5, NULL); - _globals->_soundHandler.startSound(165); - _soundHandler.startSound(311); + _globals->_soundHandler.play(165); + _soundHandler.play(311); } void Scene4150::signal() { @@ -3080,7 +3080,7 @@ void Scene4150::dispatch() { Scene::dispatch(); if (!_action && (_globals->_player._position.x >= 316)) { - _globals->_soundHandler.proc1(NULL); + _globals->_soundHandler.fadeOut(NULL); _globals->_player.disableControl(); _sceneMode = 4152; setAction(&_sequenceManager, this, 4152, &_globals->_player, NULL); @@ -3382,7 +3382,7 @@ void Scene4250::Hotspot6::doAction(int action) { SceneItem::display2(4250, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 20 : 3); break; case OBJECT_HELMET: - _globals->_soundHandler.startSound(354); + _globals->_soundHandler.play(354); _globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 4250; @@ -3410,7 +3410,7 @@ void Scene4250::Hotspot6::doAction(int action) { break; case OBJECT_NULLIFIER: if (RING_INVENTORY._helmet._sceneNumber == 4250) { - _globals->_soundHandler.startSound(353); + _globals->_soundHandler.play(353); _globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 1; @@ -3618,7 +3618,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) { _hotspot7.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _globals->_sceneItems.push_back(&_hotspot7); - _globals->_soundHandler.startSound(185); + _globals->_soundHandler.play(185); } void Scene4250::signal() { @@ -3654,7 +3654,7 @@ void Scene4250::signal() { case 4263: break; case 4259: - _globals->_soundHandler.startSound(360); + _globals->_soundHandler.play(360); _globals->_sceneManager.changeScene(9900); break; case 4261: @@ -3717,36 +3717,36 @@ void Scene4300::Action1::signal() { _globals->setFlag(56); _globals->_scenePalette.addRotation(240, 254, -1); scene->_hotspot7.animate(ANIM_MODE_6, this); - _globals->_soundHandler.startSound(164); + _globals->_soundHandler.play(164); break; case 1: - _globals->_soundHandler.startSound(340); - scene->_soundHandler1.startSound(341); + _globals->_soundHandler.play(340); + scene->_soundHandler1.play(341); scene->_hotspot1.remove(); setDelay(3); break; case 2: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot2.remove(); setDelay(6); break; case 3: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot3.remove(); setDelay(6); break; case 4: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot4.remove(); setDelay(12); break; case 5: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot5.remove(); setDelay(12); break; case 6: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot6.remove(); setDelay(60); break; @@ -3759,7 +3759,7 @@ void Scene4300::Action1::signal() { scene->_stripManager.start(8015, this, scene); break; case 9: - _globals->_soundHandler.startSound(350); + _globals->_soundHandler.play(350); _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_events.setCursor(CURSOR_USE); _globals->_player.enableControl(); @@ -3881,7 +3881,7 @@ void Scene4300::Hotspot10::doAction(int action) { void Scene4300::Hotspot15::signal() { Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; - scene->_soundHandler2.startSound(345); + scene->_soundHandler2.play(345); _strip = (_globals->_randomSource.getRandomNumber(6) < 2) ? 2 : 1; if ((RING_INVENTORY._stasisBox2._sceneNumber == 4300) || @@ -3947,7 +3947,7 @@ void Scene4300::Hotspot17::doAction(int action) { SceneItem::display2(4300, 26); break; case OBJECT_STASIS_BOX2: - scene->_soundHandler1.startSound(352); + scene->_soundHandler1.play(352); _globals->_events.setCursor(CURSOR_USE); scene->_sceneMode = 4303; @@ -4206,11 +4206,11 @@ void Scene4301::Action1::signal() { switch (_actionIndex++) { case 0: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 1: - _globals->_soundHandler.startSound(335); + _globals->_soundHandler.play(335); _globals->_events.setCursor(CURSOR_USE); scene->_hotspot2.postInit(); @@ -4234,7 +4234,7 @@ void Scene4301::Action1::signal() { break; case 10: _globals->_events.setCursor(CURSOR_NONE); - scene->_soundHandler.startSound(337); + scene->_soundHandler.play(337); if (scene->_hotspot3._flags & OBJFLAG_HIDE) scene->_hotspot3.show(); else @@ -4249,7 +4249,7 @@ void Scene4301::Action1::signal() { for (_state = 0; _state < 6; ++_state) _buttonList[_state].remove(); - scene->_soundHandler.startSound(338); + scene->_soundHandler.play(338); scene->_hotspot3.hide(); _actionIndex = 2; @@ -4258,7 +4258,7 @@ void Scene4301::Action1::signal() { break; case 20: _globals->_player.disableControl(); - scene->_soundHandler.startSound(339); + scene->_soundHandler.play(339); scene->_hotspot3._frame = 3; if (scene->_hotspot3._flags & OBJFLAG_HIDE) scene->_hotspot3.show(); @@ -4291,7 +4291,7 @@ void Scene4301::Action1::process(Event &event) { if ((event.eventType == EVENT_BUTTON_DOWN) && buttonsRect.contains(event.mousePos)) { event.handled = true; - scene->_soundHandler.startSound(336); + scene->_soundHandler.play(336); int buttonIndex = ((event.mousePos.y - buttonsRect.top) / 33) * 3 + ((event.mousePos.x - buttonsRect.left) / 33); diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index e3d1ae08b5..2353b843c6 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -137,7 +137,7 @@ class Scene4000 : public Scene { }; public: SequenceManager _sequenceManager1, _sequenceManager2, _sequenceManager3; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SpeakerQR _speakerQR; SpeakerML _speakerML; SpeakerMR _speakerMR; @@ -473,7 +473,7 @@ class Scene4150 : public Scene { public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerQText _speakerQText; SpeakerQR _speakerQR; SpeakerCDL _speakerCDL; @@ -543,7 +543,7 @@ class Scene4250 : public Scene { public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSR _speakerSR; SpeakerSL _speakerSL; SpeakerSText _speakerSText; @@ -615,7 +615,7 @@ class Scene4300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SequenceManager _sequenceManager; GfxButton _gfxButton; SpeakerQText _speakerQText; @@ -674,7 +674,7 @@ class Scene4301 : public Scene { public: Common::List _list1; SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; SceneObject _hotspot1, _hotspot2, _hotspot3; Hotspot4 _hotspot4; diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 6bb2605de5..a7bcc00cbb 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -44,8 +44,8 @@ void Scene5000::Action1::signal() { setDelay(10); break; case 1: - scene->_soundHandler.startSound(190); - scene->_soundHandler.proc5(true); + scene->_soundHandler.play(190); + scene->_soundHandler.holdAt(true); ADD_MOVER(scene->_hotspot1, 283, 12); break; case 2: @@ -58,7 +58,7 @@ void Scene5000::Action1::signal() { setDelay(15); break; case 4: - scene->_soundHandler.proc4(); + scene->_soundHandler.release(); ADD_MOVER(scene->_hotspot1, 233, 80); break; case 5: @@ -563,7 +563,7 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { break; } - _globals->_soundHandler.startSound(190); + _globals->_soundHandler.play(190); } void Scene5000::signal() { @@ -640,7 +640,7 @@ void Scene5100::Action1::signal() { } break; case 4: - scene->_soundHandler.startSound(206); + scene->_soundHandler.play(206); scene->_hotspot5.postInit(); scene->_hotspot5.setVisage(5362); @@ -739,7 +739,7 @@ void Scene5100::Action3::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 2: - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); if (static_cast(_owner)->_position.x < _globals->_player._position.x) { scene->_hotspot2.setVisage(5130); scene->_hotspot2._strip = 1; @@ -785,7 +785,7 @@ void Scene5100::Action4::signal() { switch (_actionIndex++) { case 0: { _globals->_player.disableControl(); - scene->_soundHandler.startSound(208); + scene->_soundHandler.play(208); SceneItem::display2(5100, 15); ObjectMover3 *mover = new ObjectMover3(); @@ -1282,7 +1282,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); loadScene(5100); - _globals->_soundHandler.startSound(205); + _globals->_soundHandler.play(205); } void Scene5100::signal() { @@ -1377,7 +1377,7 @@ void Scene5100::dispatch() { _globals->_player.disableControl(); _globals->_player.addMover(NULL); - _soundHandler.startSound(207); + _soundHandler.play(207); _sceneMode = 5103; setAction(&_sequenceManager, this, (_globals->_player._position.x >= 966) ? 5104 : 5103, &_globals->_player, &_hotspot15, NULL); @@ -1389,7 +1389,7 @@ void Scene5100::dispatch() { (_globals->_sceneManager._previousScene != 5150)) { setAction(NULL); _sceneMode = 5150; - _soundHandler.startSound(208); + _soundHandler.play(208); if (RING_INVENTORY._vial._sceneNumber == 5100) { _globals->_player.addMover(NULL); @@ -1462,7 +1462,7 @@ void Scene5200::Action2::signal() { _globals->_player.animate(ANIM_MODE_4, 3, 1, this); break; case 2: - scene->_soundHandler.proc3(); + scene->_soundHandler.stop(); scene->_hotspot14.remove(); RING_INVENTORY._stasisBox._sceneNumber = 1; @@ -1477,7 +1477,7 @@ void Scene5200::Action2::signal() { ADD_MOVER(scene->_hotspot8, 141, 77); break; case 4: - scene->_soundHandler.startSound(303); + scene->_soundHandler.play(303); scene->_hotspot8._strip = 2; scene->_hotspot8._frame = 1; @@ -1513,7 +1513,7 @@ void Scene5200::Action4::signal() { setDelay(120); break; case 1: - _globals->_soundHandler.startSound(209); + _globals->_soundHandler.play(209); scene->_stripManager.start(5202, this, scene); break; case 2: @@ -1615,8 +1615,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _speakerQText._textPos.x = 20; if (RING_INVENTORY._stasisBox._sceneNumber == 5200) { - _soundHandler.startSound(216); - _soundHandler.proc5(true); + _soundHandler.play(216); + _soundHandler.holdAt(true); _hotspot14.postInit(); _hotspot14.setVisage(5202); @@ -1633,7 +1633,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { } if (_globals->_stripNum == 1111) { - _globals->_soundHandler.startSound(205); + _globals->_soundHandler.play(205); _globals->_player.disableControl(); _globals->_player.postInit(); @@ -2107,7 +2107,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot8._sceneRegionId = 8; _globals->_sceneItems.addItems(&_hotspot8, &_hotspot2, &_hotspot6, &_hotspot3, &_hotspot7, NULL); - _globals->_soundHandler.startSound(212); + _globals->_soundHandler.play(212); } void Scene5300::signal() { @@ -2153,7 +2153,7 @@ void Scene5300::signal() { _sceneMode = 5302; break; case 5307: - _soundHandler.proc1(NULL); + _soundHandler.fadeOut(NULL); break; case 5309: _hotspot5.remove(); diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h index 272aea4fe9..db0217315d 100644 --- a/engines/tsage/ringworld_scenes6.h +++ b/engines/tsage/ringworld_scenes6.h @@ -78,7 +78,7 @@ class Scene5000 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSText _speakerSText; SpeakerQText _speakerQText; Action1 _action1; @@ -166,7 +166,7 @@ class Scene5100 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerMText _speakerMText; SpeakerQText _speakerQText; SpeakerSText _speakerSText; @@ -229,7 +229,7 @@ class Scene5200 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerFLL _speakerFLL; SpeakerFLText _speakerFLText; SpeakerQL _speakerQL; @@ -294,7 +294,7 @@ class Scene5300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerQR _speakerQR; SpeakerQL _speakerQL; diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 0891f64597..7c0a05468f 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -48,7 +48,7 @@ void Scene7000::Action1::signal() { setAction(&scene->_action6, this); break; case 2: - scene->_soundHandler.startSound(252); + scene->_soundHandler.play(252); scene->_object8.remove(); scene->_object1.postInit(); scene->_object1.setVisage(7003); @@ -169,7 +169,7 @@ void Scene7000::Action4::signal() { setDelay(300); break; case 2: - _globals->_soundHandler.startSound(252); + _globals->_soundHandler.play(252); scene->_object1.show(); scene->_object1.setStrip(3); scene->_object1.setFrame(1); @@ -199,7 +199,7 @@ void Scene7000::Action5::signal() { } case 1: _globals->_player.checkAngle(&scene->_object1); - _globals->_soundHandler.startSound(252); + _globals->_soundHandler.play(252); scene->_object1.setStrip(2); scene->_stripManager.start(7015, this); break; @@ -532,7 +532,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_8, 0, 0); _globals->_sceneItems.addItems(&_object1, 0); } - _soundHandler.startSound(251); + _soundHandler.play(251); if (_globals->_sceneManager._previousScene == 2100) { if (_globals->getFlag(72)) { _globals->_player.postInit(); @@ -550,7 +550,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } } else { - _globals->_soundHandler.startSound(250); + _globals->_soundHandler.play(250); _globals->setFlag(72); _object3.postInit(); @@ -597,9 +597,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.setVisage(5001); _object3.setStrip2(1); _object3.setPosition(Common::Point(307, 0), 0); - _soundHandler.startSound(151); - _soundHandler.proc5(1); - _globals->_soundHandler.startSound(250); + _soundHandler.play(151); + _soundHandler.holdAt(true); + _globals->_soundHandler.play(250); setAction(&_action3); } } @@ -1114,9 +1114,9 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object1.setPosition(Common::Point(100, 100), 0); setAction(&_action11); - _soundHandler1.startSound(270); - _soundHandler2.startSound(275); - _globals->_soundHandler.startSound(270); + _soundHandler1.play(270); + _soundHandler2.play(275); + _globals->_soundHandler.play(270); } /*-------------------------------------------------------------------------- * Scene 7200 @@ -1281,7 +1281,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { _swimmer.setPosition(Common::Point(-8, 16), 0); setAction(&_action1); - _soundHandler.startSound(271); + _soundHandler.play(271); } /*-------------------------------------------------------------------------- @@ -1323,7 +1323,7 @@ void Scene7300::Action1::signal() { break; case 7: setDelay(3); - _globals->_soundHandler.proc1(0); + _globals->_soundHandler.fadeOut(0); break; case 8: _globals->_sceneManager.changeScene(2280); @@ -1476,7 +1476,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object8._numFrames = 2; setAction(&_action1); - _globals->_soundHandler.startSound(272); + _globals->_soundHandler.play(272); } /*-------------------------------------------------------------------------- @@ -1580,8 +1580,8 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { } _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); loadScene(7600); - _soundHandler2.startSound(255); - _soundHandler1.startSound(251); + _soundHandler2.play(255); + _soundHandler1.play(251); } /*-------------------------------------------------------------------------- @@ -1644,7 +1644,7 @@ void Scene7700::Action3::signal() { setDelay(60); // No break on purpose! case 2: - scene->_soundHandler.startSound(260); + scene->_soundHandler.play(260); scene->_object8.setVisage(7703); scene->_object8.setPosition(Common::Point(177, 97), 0); scene->_object8.setStrip2(3); @@ -1853,7 +1853,7 @@ void Scene7700::SceneHotspot8::doAction(int action) { break; case CURSOR_USE: scene->_sceneMode = 7709; - scene->_soundHandler.startSound(259); + scene->_soundHandler.play(259); scene->_object15.setFrame(scene->_object15.getFrameCount()); scene->_object15.animate(ANIM_MODE_6, scene); if ((scene->_field977 == 2) && (scene->_field97B == 0)) { @@ -1879,7 +1879,7 @@ void Scene7700::SceneHotspot9::doAction(int action) { break; case CURSOR_USE: scene->_sceneMode = 7709; - scene->_soundHandler.startSound(259); + scene->_soundHandler.play(259); scene->_object15.setFrame(1); scene->_object15.animate(ANIM_MODE_5, scene); if (scene->_field977 > 2) { @@ -2013,7 +2013,7 @@ void Scene7700::Object7::doAction(int action) { break; case OBJECT_STUNNER: if (!_globals->getFlag(78)) { - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); _globals->setFlag(78); setAction(0); _globals->_player.disableControl(); @@ -2102,7 +2102,7 @@ void Scene7700::Object9::doAction(int action) { _globals->_sceneItems.push_front(&scene->_object10); scene->_object10.setPriority2(240); } - scene->_soundHandler.startSound(262); + scene->_soundHandler.play(262); scene->_object14.animate(ANIM_MODE_5, 0); } _globals->_events.setCursor(CURSOR_WALK); @@ -2198,7 +2198,7 @@ void Scene7700::signal() { } break; case 7702: - _soundHandler.proc1(0); + _soundHandler.fadeOut(0); _globals->_sceneManager.changeScene(7600); break; case 7703: @@ -2209,7 +2209,7 @@ void Scene7700::signal() { _globals->_player.enableControl(); break; case 7704: - _globals->_soundHandler.startSound(256); + _globals->_soundHandler.play(256); _prof.setStrip2(4); _prof.setFrame2(1); _prof.setPosition(Common::Point(159, 87), 0); @@ -2493,7 +2493,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _sceneMode = 7701; setAction(&_sequenceManager, this, 7701, &_globals->_player, 0); - _soundHandler.startSound(256); + _soundHandler.play(256); } Scene7700::Scene7700() { diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index 0c39920614..90b8d293ef 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -100,7 +100,7 @@ class Scene7000 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerSKText _speakerSKText; SpeakerSKL _speakerSKL; @@ -171,8 +171,8 @@ class Scene7100 : public Scene { }; public: - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; + ASound _soundHandler1; + ASound _soundHandler2; SceneObject _object1; SceneObject _object2; SceneObject _object3; @@ -236,7 +236,7 @@ public: SceneObject _object7; SceneObject _object8; SceneObject _object9; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -302,8 +302,8 @@ public: SceneObject _object4; SceneObject _object5; SceneObject _object6; - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; + ASound _soundHandler1; + ASound _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -415,7 +415,7 @@ class Scene7700 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; GfxButton _gfxButton; SpeakerEText _speakerEText; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 7c8325d53e..cdb7470c58 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -59,4 +59,95 @@ void SoundManager::listenerSynchronise(Serialiser &s) { warning("TODO: SoundManager listenerSynchronise"); } +/*--------------------------------------------------------------------------*/ + +void ASound::play(int soundNum, Action *action, int volume) { + +} + +void ASound::stop() { + +} + +void ASound::prime(int v, Action *action) { + +} + +void ASound::unPrime() { + +} + +void ASound::go() { + +} + +void ASound::hault(void) { +} + +int ASound::getSoundNum() const { return 0; } +bool ASound::isPlaying() const { return false; } +bool ASound::isPaused() const { return false; } +bool ASound::isMuted() const { return false; } + +void ASound::pause() { + +} + +void ASound::mute() { + +} + +void ASound::fadeIn() { + +} + +void ASound::fadeOut(EventHandler *evtHandler) { + +} + +void ASound::fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler) { + +} + +void ASound::setTimeIndex(uint32 timeIndex) { + +} + +uint32 ASound::getTimeIndex() const { + return 0; +} + +void ASound::setPri(int v) { + +} + +void ASound::setLoop(bool flag) { + +} + +int ASound::getPri() const { + return 0; +} + +bool ASound::getLoop() { + return false; +} + +void ASound::setVolume(int volume) { + +} + +int ASound::getVol() const { + return 0; +} + +void ASound::holdAt(int v) { + +} + +void ASound::release() { + +} + + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index a495344038..a1843545a9 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -28,6 +28,7 @@ #include "common/scummsys.h" #include "tsage/saveload.h" +#include "tsage/core.h" namespace tSage { @@ -44,6 +45,48 @@ public: void loadNotifierProc(bool postFlag); }; +class Sound: public EventHandler { +public: + +}; + +class ASound: public Sound { +public: + Sound _sound; + Action *_action; + int _field280; + + ASound(); + virtual void synchronise(Serialiser &s); + virtual void dispatch(); + + void play(int soundNum, Action *action = NULL, int volume = 127); + void stop(); + void prime(int v, Action *action = NULL); + void unPrime(); + void go(); + void hault(void); + int getSoundNum() const; + bool isPlaying() const; + bool isPaused() const; + bool isMuted() const; + void pause(); + void mute(); + void fadeIn(); + void fadeOut(EventHandler *evtHandler); + void fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler); + void setTimeIndex(uint32 timeIndex); + uint32 getTimeIndex() const; + void setPri(int v); + void setLoop(bool flag); + int getPri() const; + bool getLoop(); + void setVolume(int volume); + int getVol() const; + void holdAt(int v); + void release(); +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From 52ff20148eeb0455ed1548bf7bd7563a82dd016f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Apr 2011 22:22:20 +1000 Subject: TSAGE: Implemented the code for the ASound class --- engines/tsage/core.cpp | 18 ------ engines/tsage/sound.cpp | 156 +++++++++++++++++++++++++++++++++++++++--------- engines/tsage/sound.h | 67 +++++++++++++++------ 3 files changed, 175 insertions(+), 66 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 36e2961aca..2b8256ebd2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2912,24 +2912,6 @@ int SceneRegions::indexOf(const Common::Point &pt) { /*--------------------------------------------------------------------------*/ -ASound::ASound() { - _action = NULL; - _field280 = -1; -} - -void ASound::synchronise(Serialiser &s) { - EventHandler::synchronise(s); - - SYNC_POINTER(_action); - s.syncAsSint16LE(_field280); -} - -void ASound::dispatch() { - -} - -/*--------------------------------------------------------------------------*/ - void SceneItemList::addItems(SceneItem *first, ...) { va_list va; va_start(va, first); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index cdb7470c58..793409d123 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -61,93 +61,191 @@ void SoundManager::listenerSynchronise(Serialiser &s) { /*--------------------------------------------------------------------------*/ -void ASound::play(int soundNum, Action *action, int volume) { - +void Sound::play(int soundNum, int volume) { + } -void ASound::stop() { +void Sound::stop() { } -void ASound::prime(int v, Action *action) { +void Sound::prime(int soundNum) { } -void ASound::unPrime() { +void Sound::prime(int soundNum, int v2) { + +} + +void Sound::_unPrime() { } -void ASound::go() { +void Sound::unPrime() { } -void ASound::hault(void) { +void Sound::go() { + } -int ASound::getSoundNum() const { return 0; } -bool ASound::isPlaying() const { return false; } -bool ASound::isPaused() const { return false; } -bool ASound::isMuted() const { return false; } +void Sound::halt(void) { -void ASound::pause() { +} +int Sound::getSoundNum() const { + return 0; } -void ASound::mute() { +bool Sound::isPlaying() const { + return false; +} +bool Sound::isPrimed() const { + return false; } -void ASound::fadeIn() { +bool Sound::isPaused() const { + return false; +} +bool Sound::isMuted() const { + return false; } -void ASound::fadeOut(EventHandler *evtHandler) { +void Sound::pause() { } -void ASound::fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler) { +void Sound::mute() { } -void ASound::setTimeIndex(uint32 timeIndex) { +void Sound::fadeIn() { } -uint32 ASound::getTimeIndex() const { - return 0; +void Sound::fadeOut(EventHandler *evtHandler) { + } -void ASound::setPri(int v) { +void Sound::fade(int v1, int v2, int v3, int v4) { } -void ASound::setLoop(bool flag) { +void Sound::setTimeIndex(uint32 timeIndex) { } -int ASound::getPri() const { - return 0; +uint32 Sound::getTimeIndex() const { + return 0; +} + +bool Sound::getCueValue() const { + return false; } -bool ASound::getLoop() { - return false; +void Sound::setCueValue(bool flag) { + } -void ASound::setVolume(int volume) { +void Sound::setVol(int volume) { } -int ASound::getVol() const { +int Sound::getVol() const { return 0; } -void ASound::holdAt(int v) { +void Sound::setPri(int v) { + +} + +void Sound::setLoop(bool flag) { } -void ASound::release() { +int Sound::getPri() const { + return 0; +} +bool Sound::getLoop() { + return false; } +void Sound::holdAt(int v) { + +} + +void Sound::release() { + +} + + +/*--------------------------------------------------------------------------*/ + +ASound::ASound(): EventHandler() { + _action = NULL; + _cueFlag = false; +} + +void ASound::synchronise(Serialiser &s) { + EventHandler::synchronise(s); + SYNC_POINTER(_action); + s.syncAsByte(_cueFlag); +} + +void ASound::dispatch() { + EventHandler::dispatch(); + + if (!_sound.getCueValue()) { + _cueFlag = false; + _sound.setCueValue(true); + + if (_action) + _action->signal(); + } + + if (!_cueFlag) { + if (!_sound.isPrimed()) { + _cueFlag = true; + if (_action) { + _action->signal(); + _action = NULL; + } + } + } +} + +void ASound::play(int soundNum, Action *action, int volume) { + _action = action; + _cueFlag = false; + + setVol(volume); + _sound.play(soundNum); +} + +void ASound::stop() { + _sound.stop(); + _action = NULL; +} + +void ASound::prime(int soundNum, Action *action) { + _action = action; + _cueFlag = false; + _sound.prime(soundNum); +} + +void ASound::unPrime() { + _sound.unPrime(); + _action = NULL; +} + +void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { + if (action) + _action = action; + + _sound.fade(v1, v2, v3, v4); +} } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index a1843545a9..a029c9a81c 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -47,46 +47,75 @@ public: class Sound: public EventHandler { public: - -}; - -class ASound: public Sound { -public: - Sound _sound; - Action *_action; - int _field280; - - ASound(); - virtual void synchronise(Serialiser &s); - virtual void dispatch(); - - void play(int soundNum, Action *action = NULL, int volume = 127); + void play(int soundNum, int volume = 127); void stop(); - void prime(int v, Action *action = NULL); + void prime(int soundNum); + void prime(int soundNum, int v2); + void _unPrime(); void unPrime(); void go(); - void hault(void); + void halt(void); int getSoundNum() const; bool isPlaying() const; + bool isPrimed() const; bool isPaused() const; bool isMuted() const; void pause(); void mute(); void fadeIn(); void fadeOut(EventHandler *evtHandler); - void fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler); + void fade(int v1, int v2, int v3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; + bool getCueValue() const; + void setCueValue(bool flag); + void setVol(int volume); + int getVol() const; void setPri(int v); void setLoop(bool flag); int getPri() const; bool getLoop(); - void setVolume(int volume); - int getVol() const; void holdAt(int v); void release(); }; +class ASound: public EventHandler { +public: + Sound _sound; + Action *_action; + bool _cueFlag; + + ASound(); + virtual void synchronise(Serialiser &s); + virtual void dispatch(); + + void play(int soundNum, Action *action = NULL, int volume = 127); + void stop(); + void prime(int soundNum, Action *action = NULL); + void unPrime(); + void go() { _sound.go(); } + void hault(void) { _sound.halt(); } + int getSoundNum() const { return _sound.getSoundNum(); } + bool isPlaying() const { return _sound.isPlaying(); } + bool isPaused() const { return _sound.isPaused(); } + bool isMuted() const { return _sound.isMuted(); } + void pause() { _sound.pause(); } + void mute() { _sound.mute(); } + void fadeIn() { fade(127, 5, 10, 0, NULL); } + void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } + void fade(int v1, int v2, int v3, int v4, Action *action); + void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } + uint32 getTimeIndex() const { return _sound.getTimeIndex(); } + void setPri(int v) { _sound.setPri(v); } + void setLoop(bool flag) { _sound.setLoop(flag); } + int getPri() const { return _sound.getPri(); } + bool getLoop() { return _sound.getLoop(); } + void setVol(int volume) { _sound.setVol(volume); } + int getVol() const { return _sound.getVol(); } + void holdAt(int v) { _sound.holdAt(v); } + void release() { _sound.release(); } +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From 660d3858755750ca2d71694ab15cd170e1c42446 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 29 Apr 2011 20:19:37 +1000 Subject: TSAGE: Added fields for the Sound class --- engines/tsage/sound.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index a029c9a81c..7a21b9df3f 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -45,13 +45,61 @@ public: void loadNotifierProc(bool postFlag); }; +#define SOUND_ARR_SIZE 16 + +struct trackInfoStruct { + int count; + int rlbList[32]; + uint32 handleList[75]; +}; + class Sound: public EventHandler { +private: + void _prime(int soundNum, int v2); + void _unPrime(); +public: + int _field6; + int _soundNum; + int _fieldA; + int _fieldE; + int _priority2; + int _field10; + bool _loopFlag2; + int _priority; + int _volume; + bool _loopFlag; + int _pauseCtr; + int _muteCtr; + int _holdAt; + bool _cueValue; + int _field1E; + int _field1F; + int _field20; + int _field21; + int _field22; + uint _timeIndex; + int _field26; + int _field28[SOUND_ARR_SIZE]; + int _field38[SOUND_ARR_SIZE]; + int _field48[SOUND_ARR_SIZE]; + int _field58[SOUND_ARR_SIZE]; + int _field68[SOUND_ARR_SIZE]; + int _field78[SOUND_ARR_SIZE]; + int _field98[SOUND_ARR_SIZE]; + int _fieldA8[SOUND_ARR_SIZE]; + int _fieldB8[SOUND_ARR_SIZE]; + int _fieldC8[SOUND_ARR_SIZE]; + int _fieldE8[SOUND_ARR_SIZE]; + trackInfoStruct _trackInfo; + int _field266; + int _field268; + bool _primed; + int _field26C; + int _field26E; public: void play(int soundNum, int volume = 127); void stop(); void prime(int soundNum); - void prime(int soundNum, int v2); - void _unPrime(); void unPrime(); void go(); void halt(void); -- cgit v1.2.3 From 57612224ca76c34832599a13938b99fd68bff7bf Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2011 15:23:30 +1000 Subject: TSAGE: Implemented the methods of the Sound class --- engines/tsage/sound.cpp | 352 +++++++++++++++++++++++++++++++++++++++++++----- engines/tsage/sound.h | 106 +++++++++++---- 2 files changed, 395 insertions(+), 63 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 793409d123..0db43506ea 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -29,6 +29,7 @@ #include "tsage/globals.h" #include "tsage/debugger.h" #include "tsage/graphics.h" +#include "tsage/tsage.h" namespace tSage { @@ -61,127 +62,406 @@ void SoundManager::listenerSynchronise(Serialiser &s) { /*--------------------------------------------------------------------------*/ -void Sound::play(int soundNum, int volume) { +void SoundManager::checkResVersion(const byte *soundData) { + int minVersion = READ_LE_UINT16(soundData + 4); + int maxVersion = READ_LE_UINT16(soundData + 6); + if (_globals->_soundManager._minVersion >= maxVersion) + error("Attempt to play/prime sound resource that is too new"); + if (_globals->_soundManager._minVersion > minVersion) + error("Attempt to play/prime sound resource that is too old"); } -void Sound::stop() { +int SoundManager::determineGroup(const byte *soundData) { + return _sfDetermineGroup(soundData); +} + +int SoundManager::extractPriority(const byte *soundData) { + return READ_LE_UINT16(soundData + 12); +} + +int SoundManager::extractLoop(const byte *soundData) { + return READ_LE_UINT16(soundData + 14); +} + +void SoundManager::addToSoundList(Sound *sound) { + if (!contains(_soundList, sound)) + _soundList.push_back(sound); +} + +void SoundManager::removeFromSoundList(Sound *sound) { + _soundList.remove(sound); +} + +void SoundManager::addToPlayList(Sound *sound) { + _sfAddToPlayList(sound); +} + +void SoundManager::removeFromPlayList(Sound *sound) { + _sfRemoveFromPlayList(sound); +} + +bool SoundManager::isOnPlayList(Sound *sound) { + return _sfIsOnPlayList(sound); +} + +void SoundManager::extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum) { + +} + +void SoundManager::suspendSoundServer() { + ++_globals->_soundManager._suspendCtr; +} + +void SoundManager::rethinkVoiceTypes() { + _sfRethinkVoiceTypes(); +} + +void SoundManager::restartSoundServer() { + if (_globals->_soundManager._suspendCtr > 0) + --_globals->_soundManager._suspendCtr; +} + +void SoundManager::updateSoundVol(Sound *sound) { + _sfUpdateVolume(sound); +} + +void SoundManager::updateSoundPri(Sound *sound) { + _sfUpdatePriority(sound); +} + +void SoundManager::updateSoundLoop(Sound *sound) { + _sfUpdateLoop(sound); +} + +/*--------------------------------------------------------------------------*/ + +void SoundManager::_soSetTimeIndex(int timeIndex) { + warning("TODO: _soSetTimeIndex"); +} + +int SoundManager::_sfDetermineGroup(const byte *soundData) { + const byte *p = soundData + READ_LE_UINT16(soundData + 8); + uint32 v; + while ((v = READ_LE_UINT32(p)) != 0) { + if ((v & _globals->_soundManager._groupMask) == v) + return v; + + p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + } + + return 0; +} + +void SoundManager::_sfAddToPlayList(Sound*soundData) { + +} + +void SoundManager::_sfRemoveFromPlayList(Sound *sound) { + +} + +bool SoundManager::_sfIsOnPlayList(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + bool result = contains(_globals->_soundManager._playList, sound); + --_globals->_soundManager._suspendCtr; + + return result; +} + +void SoundManager::_sfRethinkVoiceTypes() { + +} + +void SoundManager::_sfUpdateVolume(Sound *sound) { + _sfDereferenceAll(); + sub_233EE(sound); +} + +void SoundManager::_sfDereferenceAll() { + +} + +void SoundManager::sub_233EE(Sound *sound) { + +} + +void SoundManager::_sfUpdatePriority(Sound *sound) { + +} + +void SoundManager::_sfUpdateLoop(Sound *sound) { } +/*--------------------------------------------------------------------------*/ + +Sound::Sound() { + _field6 = 0; + _soundNum = 0; + _groupNum = 0; + _soundPriority = 0; + _priority2 = -1; + _loop = true; + _loopFlag2 = true; + _priority = 0; + _volume = 127; + _loopFlag = false; + _pauseCtr = 0; + _muteCtr = 0; + _holdAt = false; + _cueValue = -1; + _volume1 = -1; + _field1F = 0; + _volume2 = 0; + _field21 = 0; + _field22 = 0; + _timeIndex = 0; + _field26 = 0; + _trackInfo.count = 0; + _primed = false; + _field26C = 0; + _field26E = NULL; +} + +void Sound::play(int soundNum) { + prime(soundNum); + _globals->_soundManager.addToPlayList(this); +} + +void Sound::stop() { + _globals->_soundManager.removeFromPlayList(this); + _unPrime(); +} + void Sound::prime(int soundNum) { + if (_soundNum != -1) { + stop(); + _prime(soundNum, false); + } +} +void Sound::unPrime() { + stop(); } -void Sound::prime(int soundNum, int v2) { +void Sound::_prime(int soundNum, bool queFlag) { + if (_primed) + unPrime(); + + if (_soundNum != -1) { + // Sound number specified + _field26E = NULL; + byte *soundData = _resourceManager->getResource(RES_SOUND, soundNum, 0); + _globals->_soundManager.checkResVersion(soundData); + _groupNum = _globals->_soundManager.determineGroup(soundData); + _soundPriority = _globals->_soundManager.extractPriority(soundData); + _loop = _globals->_soundManager.extractLoop(soundData); + _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); + + for (int idx = 0; idx < _trackInfo.count; ++idx) { + _trackInfo.handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); + } + + DEALLOCATE(soundData); + } else { + // No sound specified + _groupNum = 0; + _soundPriority = 0; + _loop = 0; + _trackInfo.count = 0; + _trackInfo.handleList[0] = ALLOCATE(200); + _field26E = ALLOCATE(200); + } + + if (queFlag) + _globals->_soundManager.addToSoundList(this); + _primed = true; } void Sound::_unPrime() { + if (_primed) { + if (_field26C) { + DEALLOCATE(_trackInfo.handleList[0]); + DEALLOCATE(_field26E); + _field26E = NULL; + } else { + for (int idx = 0; idx < _trackInfo.count; ++idx) { + DEALLOCATE(_trackInfo.handleList[idx]); + } + } + _trackInfo.count = 0; + _globals->_soundManager.removeFromSoundList(this); + + _primed = false; + _field6 = 0; + } } -void Sound::unPrime() { +void Sound::orientAfterDriverChange() { + if (!_field26C) { + int timeIndex = getTimeIndex(); + + for (int idx = 0; idx < _trackInfo.count; ++idx) + DEALLOCATE(_trackInfo.handleList[idx]); + + _trackInfo.count = 0; + _primed = false; + _prime(_soundNum, true); + setTimeIndex(timeIndex); + } +} +void Sound::orientAfterRestore() { + if (_field26C) { + int timeIndex = getTimeIndex(); + _primed = false; + _prime(_soundNum, true); + setTimeIndex(timeIndex); + } } void Sound::go() { + if (!_primed) + error("Attempt to execute Sound::go() on an unprimed Sound"); + _globals->_soundManager.addToPlayList(this); } void Sound::halt(void) { - + _globals->_soundManager.removeFromPlayList(this); } int Sound::getSoundNum() const { - return 0; + return _soundNum; } -bool Sound::isPlaying() const { - return false; +bool Sound::isPlaying() { + return _globals->_soundManager.isOnPlayList(this); } bool Sound::isPrimed() const { - return false; + return _primed; } bool Sound::isPaused() const { - return false; + return _pauseCtr != 0; } bool Sound::isMuted() const { - return false; + return _muteCtr != 0; } -void Sound::pause() { +void Sound::pause(bool flag) { + _globals->_soundManager.suspendSoundServer(); -} - -void Sound::mute() { + if (flag) + ++_pauseCtr; + else if (_pauseCtr > 0) + --_pauseCtr; + _globals->_soundManager.rethinkVoiceTypes(); + _globals->_soundManager.restartSoundServer(); } -void Sound::fadeIn() { +void Sound::mute(bool flag) { + _globals->_soundManager.suspendSoundServer(); + + if (flag) + ++_muteCtr; + else if (_muteCtr > 0) + --_muteCtr; + _globals->_soundManager.rethinkVoiceTypes(); + _globals->_soundManager.restartSoundServer(); } -void Sound::fadeOut(EventHandler *evtHandler) { +void Sound::fade(int volume1, int volume2, int v3, int v4) { + _globals->_soundManager.suspendSoundServer(); -} + if (volume1 > 127) + volume1 = 127; + if (volume2 > 127) + volume2 = 127; + if (v3 > 255) + v3 = 255; -void Sound::fade(int v1, int v2, int v3, int v4) { + _volume1 = volume1; + _volume2 = volume2; + _field1F = v3; + _field21 = 0; + _field22 = v4; + _globals->_soundManager.restartSoundServer(); } void Sound::setTimeIndex(uint32 timeIndex) { - + if (_primed) { + mute(true); + SoundManager::_soSetTimeIndex(timeIndex); + mute(false); + } } uint32 Sound::getTimeIndex() const { - return 0; + return _timeIndex; } -bool Sound::getCueValue() const { - return false; +int Sound::getCueValue() const { + return _cueValue; } -void Sound::setCueValue(bool flag) { - +void Sound::setCueValue(int cueValue) { + _cueValue = cueValue; } void Sound::setVol(int volume) { + if (volume > 127) + volume = 127; + if (_volume != volume) { + _volume = volume; + if (isPlaying()) + _globals->_soundManager.updateSoundVol(this); + } } int Sound::getVol() const { - return 0; + return _volume; } -void Sound::setPri(int v) { - +void Sound::setPri(int priority) { + if (priority > 127) + priority = 127; + _priority2 = priority; + _globals->_soundManager.updateSoundPri(this); } void Sound::setLoop(bool flag) { - + _loopFlag2 = flag; + _globals->_soundManager.updateSoundLoop(this); } int Sound::getPri() const { - return 0; + return _priority; } bool Sound::getLoop() { - return false; + return _loopFlag; } -void Sound::holdAt(int v) { - +void Sound::holdAt(int amount) { + if (amount > 127) + amount = 127; + _holdAt = amount; } void Sound::release() { - + _holdAt = -1; } - /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { @@ -200,7 +480,7 @@ void ASound::dispatch() { if (!_sound.getCueValue()) { _cueFlag = false; - _sound.setCueValue(true); + _sound.setCueValue(1); if (_action) _action->signal(); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 7a21b9df3f..20edd70292 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -27,12 +27,37 @@ #define TSAGE_SOUND_H #include "common/scummsys.h" +#include "common/list.h" #include "tsage/saveload.h" #include "tsage/core.h" namespace tSage { +class Sound; + +struct trackInfoStruct { + int count; + int rlbList[32]; + byte *handleList[75]; +}; + class SoundManager : public SaveListener { +public: + int _minVersion, _maxVersion; + Common::List _playList; + void *driverList2[16]; + int _field89[16]; + int _fieldA9[16]; + int _fieldE9[16]; + int _field109[16]; + uint32 _groupMask; + int volume; + int _disableCtr; + int _suspendCtr; + int _field153; + Common::List _soundList; + Common::List _driverList; + int _field16D; public: void dispatch() {} virtual void listenerSynchronise(Serialiser &s); @@ -43,27 +68,54 @@ public: void saveNotifierProc(bool postFlag); static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); -}; -#define SOUND_ARR_SIZE 16 + void checkResVersion(const byte *soundData); + int determineGroup(const byte *soundData); + int extractPriority(const byte *soundData); + int extractLoop(const byte *soundData); + void addToSoundList(Sound *sound); + void removeFromSoundList(Sound *sound); + void addToPlayList(Sound *sound); + void removeFromPlayList(Sound *sound); + bool isOnPlayList(Sound *sound); + void extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum); + void suspendSoundServer(); + void rethinkVoiceTypes(); + void restartSoundServer(); + void updateSoundVol(Sound *sound); + void updateSoundPri(Sound *sound); + void updateSoundLoop(Sound *sound); + + // _so methods + static void _soSetTimeIndex(int timeIndex); + static int _sfDetermineGroup(const byte *soundData); + static void _sfAddToPlayList(Sound *sound); + static void _sfRemoveFromPlayList(Sound *sound); + static bool _sfIsOnPlayList(Sound *sound); + static void _sfRethinkVoiceTypes(); + static void _sfUpdateVolume(Sound *sound); + static void _sfDereferenceAll(); + static void sub_233EE(Sound *sound); + static void _sfUpdatePriority(Sound *sound); + static void _sfUpdateLoop(Sound *sound); -struct trackInfoStruct { - int count; - int rlbList[32]; - uint32 handleList[75]; }; +#define SOUND_ARR_SIZE 16 + class Sound: public EventHandler { private: - void _prime(int soundNum, int v2); + void _prime(int soundNum, bool queFlag); void _unPrime(); + void orientAfterDriverChange(); + void orientAfterRestore(); public: int _field6; int _soundNum; - int _fieldA; - int _fieldE; + int _groupNum; + int _soundPriority; int _priority2; - int _field10; + int _loop; bool _loopFlag2; int _priority; int _volume; @@ -71,10 +123,10 @@ public: int _pauseCtr; int _muteCtr; int _holdAt; - bool _cueValue; - int _field1E; + int _cueValue; + int _volume1; int _field1F; - int _field20; + int _volume2; int _field21; int _field22; uint _timeIndex; @@ -95,35 +147,35 @@ public: int _field268; bool _primed; int _field26C; - int _field26E; + byte *_field26E; public: - void play(int soundNum, int volume = 127); + Sound(); + + void play(int soundNum); void stop(); void prime(int soundNum); void unPrime(); void go(); void halt(void); + bool isPlaying(); int getSoundNum() const; - bool isPlaying() const; bool isPrimed() const; bool isPaused() const; bool isMuted() const; - void pause(); - void mute(); - void fadeIn(); - void fadeOut(EventHandler *evtHandler); + void pause(bool flag); + void mute(bool flag); void fade(int v1, int v2, int v3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; - bool getCueValue() const; - void setCueValue(bool flag); + int getCueValue() const; + void setCueValue(int cueValue); void setVol(int volume); int getVol() const; - void setPri(int v); + void setPri(int priority); void setLoop(bool flag); int getPri() const; bool getLoop(); - void holdAt(int v); + void holdAt(int amount); void release(); }; @@ -143,12 +195,12 @@ public: void unPrime(); void go() { _sound.go(); } void hault(void) { _sound.halt(); } + bool isPlaying() { return _sound.isPlaying(); } int getSoundNum() const { return _sound.getSoundNum(); } - bool isPlaying() const { return _sound.isPlaying(); } bool isPaused() const { return _sound.isPaused(); } bool isMuted() const { return _sound.isMuted(); } - void pause() { _sound.pause(); } - void mute() { _sound.mute(); } + void pause(bool flag) { _sound.pause(flag); } + void mute(bool flag) { _sound.mute(flag); } void fadeIn() { fade(127, 5, 10, 0, NULL); } void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } void fade(int v1, int v2, int v3, int v4, Action *action); -- cgit v1.2.3 From bc3469eef29b95fcdd002ba7d64b6f041d52ea77 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2011 19:28:30 +1000 Subject: TSAGE: Implemented a lot of the SoundManager methods --- engines/tsage/sound.cpp | 168 ++++++++++++++++++++++++++++++++++++++++-------- engines/tsage/sound.h | 60 +++++++++++++---- 2 files changed, 187 insertions(+), 41 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 0db43506ea..834395e7da 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -33,10 +33,39 @@ namespace tSage { +SoundManager::SoundManager() { + __sndmgrReady = false; + _minVersion = 0x102; + _maxVersion = 0x10A; + + for (int i = 0; i < 16; ++i) + _field109[i] = 0; + + _groupMask = 0; + _volume = 127; + _suspendCtr = 0; + _disableCtr = 0; + _field153 = 0; + _field16D = 0; +} + +SoundManager::~SoundManager() { + if (__sndmgrReady) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->stop(); + for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) + unInstallDriver(*i); + _sfTerminate(); + } +} + void SoundManager::postInit() { - _saver->addSaveNotifier(&SoundManager::saveNotifier); - _saver->addLoadNotifier(&SoundManager::loadNotifier); - _saver->addListener(this); + if (!__sndmgrReady) { + _saver->addSaveNotifier(&SoundManager::saveNotifier); + _saver->addLoadNotifier(&SoundManager::loadNotifier); + _saver->addListener(this); + __sndmgrReady = true; + } } void SoundManager::saveNotifier(bool postFlag) { @@ -60,8 +89,6 @@ void SoundManager::listenerSynchronise(Serialiser &s) { warning("TODO: SoundManager listenerSynchronise"); } -/*--------------------------------------------------------------------------*/ - void SoundManager::checkResVersion(const byte *soundData) { int minVersion = READ_LE_UINT16(soundData + 4); int maxVersion = READ_LE_UINT16(soundData + 6); @@ -72,6 +99,57 @@ void SoundManager::checkResVersion(const byte *soundData) { error("Attempt to play/prime sound resource that is too old"); } +/*--------------------------------------------------------------------------*/ + +void SoundManager::suspendSoundServer() { + ++_globals->_soundManager._suspendCtr; +} + + +void SoundManager::restartSoundServer() { + if (_globals->_soundManager._suspendCtr > 0) + --_globals->_soundManager._suspendCtr; +} + +void SoundManager::unInstallDriver(SoundDriver *driver) { + +} + +Common::List &SoundManager::buildDriverList(bool flag) { + assert(__sndmgrReady); + _driverList.clear(); + + warning("TODO: SoundManager::buildDriverList"); + return _driverList; +} + +Common::List &SoundManager::getDriverList(bool flag) { + if (flag) + return _driverList; + else + return buildDriverList(false); +} + +void SoundManager::dumpDriverList() { + _driverList.clear(); +} + +void SoundManager::setMasterVol(int volume) { + _sfSetMasterVol(volume); +} + +int SoundManager::getMasterVol() const { + return _volume; +} + +void SoundManager::loadSound(int soundNum, bool showErrors) { + // This method preloaded the data associated with a given sound, so is now redundant +} + +void SoundManager::unloadSound(int soundNum) { + // This method signalled the resource manager to unload the data for a sound, and is now redundant +} + int SoundManager::determineGroup(const byte *soundData) { return _sfDetermineGroup(soundData); } @@ -84,6 +162,10 @@ int SoundManager::extractLoop(const byte *soundData) { return READ_LE_UINT16(soundData + 14); } +void SoundManager::extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { + _sfExtractTrackInfo(trackInfo, soundData, groupNum); +} + void SoundManager::addToSoundList(Sound *sound) { if (!contains(_soundList, sound)) _soundList.push_back(sound); @@ -105,23 +187,6 @@ bool SoundManager::isOnPlayList(Sound *sound) { return _sfIsOnPlayList(sound); } -void SoundManager::extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum) { - -} - -void SoundManager::suspendSoundServer() { - ++_globals->_soundManager._suspendCtr; -} - -void SoundManager::rethinkVoiceTypes() { - _sfRethinkVoiceTypes(); -} - -void SoundManager::restartSoundServer() { - if (_globals->_soundManager._suspendCtr > 0) - --_globals->_soundManager._suspendCtr; -} - void SoundManager::updateSoundVol(Sound *sound) { _sfUpdateVolume(sound); } @@ -134,6 +199,10 @@ void SoundManager::updateSoundLoop(Sound *sound) { _sfUpdateLoop(sound); } +void SoundManager::rethinkVoiceTypes() { + _sfRethinkVoiceTypes(); +} + /*--------------------------------------------------------------------------*/ void SoundManager::_soSetTimeIndex(int timeIndex) { @@ -194,6 +263,51 @@ void SoundManager::_sfUpdateLoop(Sound *sound) { } +void SoundManager::_sfSetMasterVol(int volume) { + if (volume > 127) + volume = 127; + + if (volume != _globals->_soundManager._volume) { + _globals->_soundManager._volume = volume; + + for (Common::List::iterator i = _globals->_soundManager._installedDrivers.begin(); + i != _globals->_soundManager._installedDrivers.end(); ++i) { + (*i)->setVolume(volume); + } + } +} + +void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { + trackInfo->count = 0; + + const byte *p = soundData + READ_LE_UINT16(soundData + 8); + uint32 v; + while ((v = READ_LE_UINT32(p)) != 0) { + while ((v == 0x80000000) || (v == (uint)groupNum)) { + int count = READ_LE_UINT16(p + 4); + p += 6; + + for (int idx = 0; idx < count; ++idx) { + if (trackInfo->count == 16) { + trackInfo->count = -1; + return; + } + + trackInfo->rlbList[trackInfo->count] = READ_LE_UINT16(p); + trackInfo->arr2[trackInfo->count] = READ_LE_UINT16(p + 2); + ++trackInfo->count; + p += 4; + } + } + + p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + } +} + +void SoundManager::_sfTerminate() { + +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { @@ -260,7 +374,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); for (int idx = 0; idx < _trackInfo.count; ++idx) { - _trackInfo.handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); + _handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); } DEALLOCATE(soundData); @@ -270,7 +384,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _soundPriority = 0; _loop = 0; _trackInfo.count = 0; - _trackInfo.handleList[0] = ALLOCATE(200); + _handleList[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -283,12 +397,12 @@ void Sound::_prime(int soundNum, bool queFlag) { void Sound::_unPrime() { if (_primed) { if (_field26C) { - DEALLOCATE(_trackInfo.handleList[0]); + DEALLOCATE(_handleList[0]); DEALLOCATE(_field26E); _field26E = NULL; } else { for (int idx = 0; idx < _trackInfo.count; ++idx) { - DEALLOCATE(_trackInfo.handleList[idx]); + DEALLOCATE(_handleList[idx]); } } @@ -305,7 +419,7 @@ void Sound::orientAfterDriverChange() { int timeIndex = getTimeIndex(); for (int idx = 0; idx < _trackInfo.count; ++idx) - DEALLOCATE(_trackInfo.handleList[idx]); + DEALLOCATE(_handleList[idx]); _trackInfo.count = 0; _primed = false; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 20edd70292..b175da71c5 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -35,58 +35,90 @@ namespace tSage { class Sound; +#define SOUND_ARR_SIZE 16 + struct trackInfoStruct { int count; - int rlbList[32]; - byte *handleList[75]; + int rlbList[SOUND_ARR_SIZE]; + int arr2[SOUND_ARR_SIZE]; +}; + +class SoundDriverEntry { +public: + +}; + +class SoundDriver { +private: + Common::String _shortDescription, _longDescription; +public: + const Common::String &getShortDriverDescription() { return _shortDescription; } + const Common::String &getLongDriverDescription() { return _longDescription; } + + virtual void setVolume(int volume) = 0; }; class SoundManager : public SaveListener { +private: + void unInstallDriver(SoundDriver *driver); public: + bool __sndmgrReady; int _minVersion, _maxVersion; Common::List _playList; - void *driverList2[16]; - int _field89[16]; - int _fieldA9[16]; - int _fieldE9[16]; int _field109[16]; uint32 _groupMask; - int volume; + int _volume; int _disableCtr; int _suspendCtr; int _field153; Common::List _soundList; - Common::List _driverList; + Common::List _driverList; + + Common::List _installedDrivers; + int _field89[16]; + int _fieldA9[16]; + int _fieldE9[16]; + int _field16D; public: + SoundManager(); + ~SoundManager(); + void dispatch() {} virtual void listenerSynchronise(Serialiser &s); virtual void postInit(); - void proc2() {} static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); + Common::List &buildDriverList(bool flag); + Common::List &getDriverList(bool flag); + void dumpDriverList(); void checkResVersion(const byte *soundData); int determineGroup(const byte *soundData); int extractPriority(const byte *soundData); int extractLoop(const byte *soundData); + bool isOnPlayList(Sound *sound); + void extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); void addToSoundList(Sound *sound); void removeFromSoundList(Sound *sound); void addToPlayList(Sound *sound); void removeFromPlayList(Sound *sound); - bool isOnPlayList(Sound *sound); - void extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum); void suspendSoundServer(); void rethinkVoiceTypes(); void restartSoundServer(); void updateSoundVol(Sound *sound); void updateSoundPri(Sound *sound); void updateSoundLoop(Sound *sound); + void setMasterVol(int volume); + int getMasterVol() const; + void loadSound(int soundNum, bool showErrors); + void unloadSound(int soundNum); // _so methods + static void _sfTerminate(); static void _soSetTimeIndex(int timeIndex); static int _sfDetermineGroup(const byte *soundData); static void _sfAddToPlayList(Sound *sound); @@ -98,11 +130,10 @@ public: static void sub_233EE(Sound *sound); static void _sfUpdatePriority(Sound *sound); static void _sfUpdateLoop(Sound *sound); - + static void _sfSetMasterVol(int volume); + static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); }; -#define SOUND_ARR_SIZE 16 - class Sound: public EventHandler { private: void _prime(int soundNum, bool queFlag); @@ -143,6 +174,7 @@ public: int _fieldC8[SOUND_ARR_SIZE]; int _fieldE8[SOUND_ARR_SIZE]; trackInfoStruct _trackInfo; + byte *_handleList[75]; int _field266; int _field268; bool _primed; -- cgit v1.2.3 From 765a82dd9699bb952803c9941b5f942a82c16c7c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 2 May 2011 21:30:20 +1000 Subject: TSAGE: Bugfixes for extracting sound data properties --- engines/tsage/sound.cpp | 26 +++++++++++++++++++------- engines/tsage/sound.h | 9 +++++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 834395e7da..a8dcb5cd07 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -38,8 +38,12 @@ SoundManager::SoundManager() { _minVersion = 0x102; _maxVersion = 0x10A; - for (int i = 0; i < 16; ++i) + for (int i = 0; i < SOUND_ARR_SIZE; ++i) { + _field89[i] = 0; + _groupList[i] = 0; + _fieldE9[i] = 0; _field109[i] = 0; + } _groupMask = 0; _volume = 127; @@ -90,12 +94,12 @@ void SoundManager::listenerSynchronise(Serialiser &s) { } void SoundManager::checkResVersion(const byte *soundData) { - int minVersion = READ_LE_UINT16(soundData + 4); - int maxVersion = READ_LE_UINT16(soundData + 6); + int maxVersion = READ_LE_UINT16(soundData + 4); + int minVersion = READ_LE_UINT16(soundData + 6); - if (_globals->_soundManager._minVersion >= maxVersion) + if (_globals->_soundManager._minVersion < minVersion) error("Attempt to play/prime sound resource that is too new"); - if (_globals->_soundManager._minVersion > minVersion) + if (_globals->_soundManager._minVersion > maxVersion) error("Attempt to play/prime sound resource that is too old"); } @@ -216,7 +220,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { if ((v & _globals->_soundManager._groupMask) == v) return v; - p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + p += 6 + (READ_LE_UINT16(p + 4) * 4); } return 0; @@ -300,7 +304,7 @@ void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *s } } - p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + p += 6 + (READ_LE_UINT16(p + 4) * 4); } } @@ -308,6 +312,14 @@ void SoundManager::_sfTerminate() { } +void SoundManager::_sfExtractGroupMask() { + uint32 mask = 0; + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) + mask |= _globals->_soundManager._groupList[idx]; + + _globals->_soundManager._groupMask = mask; +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index b175da71c5..0da04d3044 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -65,7 +65,7 @@ public: bool __sndmgrReady; int _minVersion, _maxVersion; Common::List _playList; - int _field109[16]; + int _field109[SOUND_ARR_SIZE]; uint32 _groupMask; int _volume; int _disableCtr; @@ -75,9 +75,9 @@ public: Common::List _driverList; Common::List _installedDrivers; - int _field89[16]; - int _fieldA9[16]; - int _fieldE9[16]; + int _field89[SOUND_ARR_SIZE]; + uint16 _groupList[SOUND_ARR_SIZE]; + int _fieldE9[SOUND_ARR_SIZE]; int _field16D; public: @@ -132,6 +132,7 @@ public: static void _sfUpdateLoop(Sound *sound); static void _sfSetMasterVol(int volume); static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); + static void _sfExtractGroupMask(); }; class Sound: public EventHandler { -- cgit v1.2.3 From c470d1e6d2977622530ae53f1620e813849720c9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 May 2011 23:13:15 +1000 Subject: TSAGE: Implemented more SoundManager methods --- engines/tsage/core.cpp | 3 +- engines/tsage/sound.cpp | 216 ++++++++++++++++++++++++++++++++++++++---------- engines/tsage/sound.h | 47 ++++++++--- 3 files changed, 211 insertions(+), 55 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 2b8256ebd2..490845a9ca 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -3389,8 +3389,9 @@ void SceneHandler::postInit(SceneObjectList *OwnerList) { _globals->_scenePalette.loadPalette(0); _globals->_scenePalette.refresh(); - // TODO: Bunch of other scene related setup goes here _globals->_soundManager.postInit(); + _globals->_soundManager.buildDriverList(true); + _globals->_soundManager.installConfigDrivers(); _globals->_game->start(); } diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index a8dcb5cd07..2b7a2c686d 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -50,15 +50,18 @@ SoundManager::SoundManager() { _suspendCtr = 0; _disableCtr = 0; _field153 = 0; - _field16D = 0; + _driversDetected = false; } SoundManager::~SoundManager() { if (__sndmgrReady) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->stop(); - for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) - unInstallDriver(*i); + for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { + int driverNum = (*i)->_driverNum; + ++i; + unInstallDriver(driverNum); + } _sfTerminate(); } } @@ -72,70 +75,154 @@ void SoundManager::postInit() { } } -void SoundManager::saveNotifier(bool postFlag) { - _globals->_soundManager.saveNotifierProc(postFlag); -} +Common::List &SoundManager::buildDriverList(bool detectFlag) { + assert(__sndmgrReady); + _availableDrivers.clear(); -void SoundManager::saveNotifierProc(bool postFlag) { - warning("TODO: SoundManager::saveNotifierProc"); -} + // Build up a list of available drivers. Currently we only implement an Adlib driver + SoundDriverEntry sd; + sd.driverNum = ADLIB_DRIVER_NUM; + sd.status = detectFlag ? SNDSTATUS_DETECTED : SNDSTATUS_SKIPPED; + sd.field2 = 0; + sd.field6 = 15000; + sd.shortDescription = "Adlib or SoundBlaster"; + sd.longDescription = "3812fm"; + _availableDrivers.push_back(sd); -void SoundManager::loadNotifier(bool postFlag) { - _globals->_soundManager.loadNotifierProc(postFlag); + _driversDetected = true; + return _availableDrivers; } -void SoundManager::loadNotifierProc(bool postFlag) { - warning("TODO: SoundManager::loadNotifierProc"); +void SoundManager::installConfigDrivers() { + } -void SoundManager::listenerSynchronise(Serialiser &s) { - s.validate("SoundManager"); - warning("TODO: SoundManager listenerSynchronise"); +Common::List &SoundManager::getDriverList(bool detectFlag) { + if (detectFlag) + return _availableDrivers; + else + return buildDriverList(false); } -void SoundManager::checkResVersion(const byte *soundData) { - int maxVersion = READ_LE_UINT16(soundData + 4); - int minVersion = READ_LE_UINT16(soundData + 6); +void SoundManager::dumpDriverList() { + _availableDrivers.clear(); +} - if (_globals->_soundManager._minVersion < minVersion) - error("Attempt to play/prime sound resource that is too new"); - if (_globals->_soundManager._minVersion > maxVersion) - error("Attempt to play/prime sound resource that is too old"); +void SoundManager::disableSoundServer() { + ++_disableCtr; } -/*--------------------------------------------------------------------------*/ +void SoundManager::enableSoundServer() { + if (_disableCtr > 0) + --_disableCtr; +} void SoundManager::suspendSoundServer() { - ++_globals->_soundManager._suspendCtr; + ++_suspendCtr; } - void SoundManager::restartSoundServer() { - if (_globals->_soundManager._suspendCtr > 0) - --_globals->_soundManager._suspendCtr; + if (_suspendCtr > 0) + --_suspendCtr; } -void SoundManager::unInstallDriver(SoundDriver *driver) { +/** + * Install the specified driver number + */ +void SoundManager::installDriver(int driverNum) { + // If driver is already installed, no need to install it + if (isInstalled(driverNum)) + return; + + // Instantiate the sound driver + SoundDriver *driver = instantiateDriver(driverNum); + if (!driver) + return; + + assert((_maxVersion >= driver->_minVersion) && (_maxVersion <= driver->_maxVersion)); + + // Mute any loaded sounds + disableSoundServer(); + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(true); + + // Install the driver + if (!_sfInstallDriver(driver)) + error("Sound driver initialization failed"); + + switch (driverNum) { + case ROLAND_DRIVER_NUM: + case ADLIB_DRIVER_NUM: { + // Handle loading bank infomation + byte *bankData = _resourceManager->getResource(RES_BANK, ROLAND_DRIVER_NUM, 0, true); + if (bankData) { + // Install the patch bank data + _sfInstallPatchBank(bankData); + DEALLOCATE(bankData); + } else { + // Could not locate patch bank data, so unload the driver + _sfUnInstallDriver(driver); + + // Unmute currently active sounds + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(false); + enableSoundServer(); + } + break; + } + } } -Common::List &SoundManager::buildDriverList(bool flag) { - assert(__sndmgrReady); - _driverList.clear(); - - warning("TODO: SoundManager::buildDriverList"); - return _driverList; +/** + * Instantiate a driver class for the specified driver number + */ +SoundDriver *SoundManager::instantiateDriver(int driverNum) { + assert(driverNum == ADLIB_DRIVER_NUM); + return new AdlibSoundDriver(); } -Common::List &SoundManager::getDriverList(bool flag) { - if (flag) - return _driverList; - else - return buildDriverList(false); +/** + * Uninstall the specified driver + */ +void SoundManager::unInstallDriver(int driverNum) { + Common::List::const_iterator i; + for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { + if ((*i)->_driverNum == driverNum) { + // Found driver to remove + + // Mute any loaded sounds + disableSoundServer(); + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(true); + + // Uninstall the driver + _sfUnInstallDriver(*i); + + // Re-orient all the loaded sounds + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->orientAfterDriverChange(); + + // Unmute currently active sounds + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(false); + + enableSoundServer(); + } + } } -void SoundManager::dumpDriverList() { - _driverList.clear(); +/** + * Returns true if a specified driver number is currently installed + */ +bool SoundManager::isInstalled(int driverNum) const { + Common::List::const_iterator i; + for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { + if ((*i)->_driverNum == driverNum) + return true; + } + + return false; } void SoundManager::setMasterVol(int volume) { @@ -158,6 +245,16 @@ int SoundManager::determineGroup(const byte *soundData) { return _sfDetermineGroup(soundData); } +void SoundManager::checkResVersion(const byte *soundData) { + int maxVersion = READ_LE_UINT16(soundData + 4); + int minVersion = READ_LE_UINT16(soundData + 6); + + if (_globals->_soundManager._minVersion < minVersion) + error("Attempt to play/prime sound resource that is too new"); + if (_globals->_soundManager._minVersion > maxVersion) + error("Attempt to play/prime sound resource that is too old"); +} + int SoundManager::extractPriority(const byte *soundData) { return READ_LE_UINT16(soundData + 12); } @@ -209,6 +306,29 @@ void SoundManager::rethinkVoiceTypes() { /*--------------------------------------------------------------------------*/ +void SoundManager::saveNotifier(bool postFlag) { + _globals->_soundManager.saveNotifierProc(postFlag); +} + +void SoundManager::saveNotifierProc(bool postFlag) { + warning("TODO: SoundManager::saveNotifierProc"); +} + +void SoundManager::loadNotifier(bool postFlag) { + _globals->_soundManager.loadNotifierProc(postFlag); +} + +void SoundManager::loadNotifierProc(bool postFlag) { + warning("TODO: SoundManager::loadNotifierProc"); +} + +void SoundManager::listenerSynchronise(Serialiser &s) { + s.validate("SoundManager"); + warning("TODO: SoundManager listenerSynchronise"); +} + +/*--------------------------------------------------------------------------*/ + void SoundManager::_soSetTimeIndex(int timeIndex) { warning("TODO: _soSetTimeIndex"); } @@ -320,6 +440,18 @@ void SoundManager::_sfExtractGroupMask() { _globals->_soundManager._groupMask = mask; } +bool SoundManager::_sfInstallDriver(SoundDriver *driver) { + return false; +} + +void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { + +} + +void SoundManager::_sfInstallPatchBank(const byte *bankData) { + +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 0da04d3044..40388d1055 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -36,6 +36,8 @@ namespace tSage { class Sound; #define SOUND_ARR_SIZE 16 +#define ROLAND_DRIVER_NUM 2 +#define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { int count; @@ -43,14 +45,22 @@ struct trackInfoStruct { int arr2[SOUND_ARR_SIZE]; }; +enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2}; + class SoundDriverEntry { public: - + int driverNum; + SoundDriverStatus status; + int field2, field6; + Common::String shortDescription; + Common::String longDescription; }; class SoundDriver { -private: +public: Common::String _shortDescription, _longDescription; + int _driverNum; + int _minVersion, _maxVersion; public: const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } @@ -60,7 +70,7 @@ public: class SoundManager : public SaveListener { private: - void unInstallDriver(SoundDriver *driver); + SoundDriver *instantiateDriver(int driverNum); public: bool __sndmgrReady; int _minVersion, _maxVersion; @@ -71,15 +81,13 @@ public: int _disableCtr; int _suspendCtr; int _field153; + bool _driversDetected; Common::List _soundList; - Common::List _driverList; - + Common::List _availableDrivers; Common::List _installedDrivers; int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; - - int _field16D; public: SoundManager(); ~SoundManager(); @@ -93,9 +101,17 @@ public: static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); - Common::List &buildDriverList(bool flag); - Common::List &getDriverList(bool flag); + void installConfigDrivers(); + Common::List &buildDriverList(bool detectFlag); + Common::List &getDriverList(bool detectFlag); void dumpDriverList(); + void installDriver(int driverNum); + bool isInstalled(int driverNum) const; + void unInstallDriver(int driverNum); + void disableSoundServer(); + void enableSoundServer(); + void suspendSoundServer(); + void restartSoundServer(); void checkResVersion(const byte *soundData); int determineGroup(const byte *soundData); int extractPriority(const byte *soundData); @@ -106,9 +122,7 @@ public: void removeFromSoundList(Sound *sound); void addToPlayList(Sound *sound); void removeFromPlayList(Sound *sound); - void suspendSoundServer(); void rethinkVoiceTypes(); - void restartSoundServer(); void updateSoundVol(Sound *sound); void updateSoundPri(Sound *sound); void updateSoundLoop(Sound *sound); @@ -133,13 +147,15 @@ public: static void _sfSetMasterVol(int volume); static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); static void _sfExtractGroupMask(); + static bool _sfInstallDriver(SoundDriver *driver); + static void _sfUnInstallDriver(SoundDriver *driver); + static void _sfInstallPatchBank(const byte *bankData); }; class Sound: public EventHandler { private: void _prime(int soundNum, bool queFlag); void _unPrime(); - void orientAfterDriverChange(); void orientAfterRestore(); public: int _field6; @@ -210,6 +226,8 @@ public: bool getLoop(); void holdAt(int amount); void release(); + + void orientAfterDriverChange(); }; class ASound: public EventHandler { @@ -249,6 +267,11 @@ public: void release() { _sound.release(); } }; +class AdlibSoundDriver: public SoundDriver { +public: + void setVolume(int volume) {} +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From 43dbf9ff56b932f0f0b8fe09361af87c64a68d16 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 May 2011 14:13:52 +1000 Subject: TSAGE: Implemented more _sf methods --- engines/tsage/sound.cpp | 92 +++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 7 +++- 2 files changed, 87 insertions(+), 12 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 2b7a2c686d..39ebf07221 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -94,7 +94,7 @@ Common::List &SoundManager::buildDriverList(bool detectFlag) { } void SoundManager::installConfigDrivers() { - + installDriver(ADLIB_DRIVER_NUM); } Common::List &SoundManager::getDriverList(bool detectFlag) { @@ -329,6 +329,10 @@ void SoundManager::listenerSynchronise(Serialiser &s) { /*--------------------------------------------------------------------------*/ +SoundManager &SoundManager::sfManager() { + return _globals->_soundManager; +} + void SoundManager::_soSetTimeIndex(int timeIndex) { warning("TODO: _soSetTimeIndex"); } @@ -346,12 +350,19 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { return 0; } -void SoundManager::_sfAddToPlayList(Sound*soundData) { - +void SoundManager::_sfAddToPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + _sfDoAddToPlayList(sound); + sound->_field6 = 0; + _sfRethinkVoiceTypes(); + --sfManager()._suspendCtr; } void SoundManager::_sfRemoveFromPlayList(Sound *sound) { - + ++sfManager()._suspendCtr; + if (_sfDoRemoveFromPlayList(sound)) + _sfRethinkVoiceTypes(); + --sfManager()._suspendCtr; } bool SoundManager::_sfIsOnPlayList(Sound *sound) { @@ -368,23 +379,35 @@ void SoundManager::_sfRethinkVoiceTypes() { void SoundManager::_sfUpdateVolume(Sound *sound) { _sfDereferenceAll(); - sub_233EE(sound); + _sfDoUpdateVolume(sound); } void SoundManager::_sfDereferenceAll() { - -} - -void SoundManager::sub_233EE(Sound *sound) { - + // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed + // pointer lists based on the handles. Since in ScummVM we're just using pointers directly, this + // method doesn't need any implementation } void SoundManager::_sfUpdatePriority(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + int tempPriority = (sound->_priority2 == 255) ? sound->_soundPriority : sound->_priority; + if (sound->_priority != tempPriority) { + sound->_priority = tempPriority; + if (_sfDoRemoveFromPlayList(sound)) { + _sfDoAddToPlayList(sound); + _sfRethinkVoiceTypes(); + } + } + + --_globals->_soundManager._suspendCtr; } void SoundManager::_sfUpdateLoop(Sound *sound) { - + if (sound->_loopFlag2) + sound->_loopFlag = sound->_loop; + else + sound->_loopFlag = sound->_loopFlag2; } void SoundManager::_sfSetMasterVol(int volume) { @@ -452,6 +475,53 @@ void SoundManager::_sfInstallPatchBank(const byte *bankData) { } +/** + * Adds the specified sound in the playing sound list, inserting in order of priority + */ +void SoundManager::_sfDoAddToPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + + Common::List::iterator i = sfManager()._playList.begin(); + while ((i != sfManager()._playList.end()) && (sound->_priority > (*i)->_priority)) + ++i; + + sfManager()._playList.insert(i, sound); + --sfManager()._suspendCtr; +} + +/** + * Removes the specified sound from the play list + */ +bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + + bool result = false; + for (Common::List::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) { + if (*i == sound) { + result = true; + sfManager()._playList.erase(i); + break; + } + } + + --sfManager()._suspendCtr; + return result; +} + +void SoundManager::_sfDoUpdateVolume(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + + for (int idx = 0; idx < 16; ++idx) { + Sound *snd = sfManager()._voiceStructPtrs[idx]; + if (!snd) + continue; + + // TODO: More stuff + } + + --_globals->_soundManager._suspendCtr; +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 40388d1055..6f86a930c0 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -88,6 +88,7 @@ public: int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; + Sound *_voiceStructPtrs[SOUND_ARR_SIZE]; public: SoundManager(); ~SoundManager(); @@ -132,6 +133,7 @@ public: void unloadSound(int soundNum); // _so methods + static SoundManager &sfManager(); static void _sfTerminate(); static void _soSetTimeIndex(int timeIndex); static int _sfDetermineGroup(const byte *soundData); @@ -141,7 +143,6 @@ public: static void _sfRethinkVoiceTypes(); static void _sfUpdateVolume(Sound *sound); static void _sfDereferenceAll(); - static void sub_233EE(Sound *sound); static void _sfUpdatePriority(Sound *sound); static void _sfUpdateLoop(Sound *sound); static void _sfSetMasterVol(int volume); @@ -150,6 +151,9 @@ public: static bool _sfInstallDriver(SoundDriver *driver); static void _sfUnInstallDriver(SoundDriver *driver); static void _sfInstallPatchBank(const byte *bankData); + static void _sfDoAddToPlayList(Sound *sound); + static bool _sfDoRemoveFromPlayList(Sound *sound); + static void _sfDoUpdateVolume(Sound *sound); }; class Sound: public EventHandler { @@ -158,6 +162,7 @@ private: void _unPrime(); void orientAfterRestore(); public: + int _field0; int _field6; int _soundNum; int _groupNum; -- cgit v1.2.3 From 5b61092584042df494b871cfeb054a64933c2664 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 12 May 2011 23:09:48 +1000 Subject: TSAGE: More code for installing sound drivers --- engines/tsage/sound.cpp | 57 +++++++++++++++++++++++++++++++++++++------------ engines/tsage/sound.h | 27 ++++++++++++++++------- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 39ebf07221..b47d95f36e 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -49,7 +49,7 @@ SoundManager::SoundManager() { _volume = 127; _suspendCtr = 0; _disableCtr = 0; - _field153 = 0; + _suspendedCount = 0; _driversDetected = false; } @@ -157,7 +157,7 @@ void SoundManager::installDriver(int driverNum) { byte *bankData = _resourceManager->getResource(RES_BANK, ROLAND_DRIVER_NUM, 0, true); if (bankData) { // Install the patch bank data - _sfInstallPatchBank(bankData); + _sfInstallPatchBank(driver, bankData); DEALLOCATE(bankData); } else { // Could not locate patch bank data, so unload the driver @@ -373,6 +373,10 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { return result; } +void SoundManager::_sfRethinkSoundDrivers() { + +} + void SoundManager::_sfRethinkVoiceTypes() { } @@ -464,15 +468,29 @@ void SoundManager::_sfExtractGroupMask() { } bool SoundManager::_sfInstallDriver(SoundDriver *driver) { - return false; + if (!driver->open()) + return false; + + sfManager()._installedDrivers.push_back(driver); + uint32 *maskList = driver->getGroupMaskList(); + driver->_groupMask = *maskList; + + _sfExtractGroupMask(); + _sfRethinkSoundDrivers(); + driver->setVolume(sfManager()._volume); + + return true; } void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { + sfManager()._installedDrivers.remove(driver); + _sfExtractGroupMask(); + _sfRethinkSoundDrivers(); } -void SoundManager::_sfInstallPatchBank(const byte *bankData) { - +void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) { + driver->installPatchBank(bankData); } /** @@ -540,10 +558,10 @@ Sound::Sound() { _holdAt = false; _cueValue = -1; _volume1 = -1; - _field1F = 0; + _volume3 = 0; _volume2 = 0; - _field21 = 0; - _field22 = 0; + _volume5 = 0; + _volume4 = 0; _timeIndex = 0; _field26 = 0; _trackInfo.count = 0; @@ -706,21 +724,21 @@ void Sound::mute(bool flag) { _globals->_soundManager.restartSoundServer(); } -void Sound::fade(int volume1, int volume2, int v3, int v4) { +void Sound::fade(int volume1, int volume2, int volume3, int volume4) { _globals->_soundManager.suspendSoundServer(); if (volume1 > 127) volume1 = 127; if (volume2 > 127) volume2 = 127; - if (v3 > 255) - v3 = 255; + if (volume3 > 255) + volume3 = 255; _volume1 = volume1; _volume2 = volume2; - _field1F = v3; - _field21 = 0; - _field22 = v4; + _volume3 = volume3; + _volume5 = 0; + _volume4 = volume4; _globals->_soundManager.restartSoundServer(); } @@ -856,4 +874,15 @@ void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { _sound.fade(v1, v2, v3, v4); } + +/*--------------------------------------------------------------------------*/ + +SoundDriver::SoundDriver() { + _driverNum = 0; + _minVersion = _maxVersion = 0; + _groupMaskList = NULL; + + _groupMask = 0; +} + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 6f86a930c0..a42f9b8c3a 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -61,11 +61,20 @@ public: Common::String _shortDescription, _longDescription; int _driverNum; int _minVersion, _maxVersion; + uint32 *_groupMaskList; + // The following fields were originally held in separate arrays in the SoundManager class + uint32 _groupMask; public: + SoundDriver(); + const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } - virtual void setVolume(int volume) = 0; + virtual bool open() { return true; } + virtual void close() {} + virtual uint32 *getGroupMaskList() const { return _groupMaskList; } + virtual void setVolume(int volume) {} + virtual void installPatchBank(const byte *data) {} }; class SoundManager : public SaveListener { @@ -80,7 +89,7 @@ public: int _volume; int _disableCtr; int _suspendCtr; - int _field153; + int _suspendedCount; bool _driversDetected; Common::List _soundList; Common::List _availableDrivers; @@ -140,6 +149,7 @@ public: static void _sfAddToPlayList(Sound *sound); static void _sfRemoveFromPlayList(Sound *sound); static bool _sfIsOnPlayList(Sound *sound); + static void _sfRethinkSoundDrivers(); static void _sfRethinkVoiceTypes(); static void _sfUpdateVolume(Sound *sound); static void _sfDereferenceAll(); @@ -150,7 +160,7 @@ public: static void _sfExtractGroupMask(); static bool _sfInstallDriver(SoundDriver *driver); static void _sfUnInstallDriver(SoundDriver *driver); - static void _sfInstallPatchBank(const byte *bankData); + static void _sfInstallPatchBank(SoundDriver *driver, const byte *bankData); static void _sfDoAddToPlayList(Sound *sound); static bool _sfDoRemoveFromPlayList(Sound *sound); static void _sfDoUpdateVolume(Sound *sound); @@ -178,10 +188,10 @@ public: int _holdAt; int _cueValue; int _volume1; - int _field1F; + int _volume3; int _volume2; - int _field21; - int _field22; + int _volume5; + int _volume4; uint _timeIndex; int _field26; int _field28[SOUND_ARR_SIZE]; @@ -218,7 +228,7 @@ public: bool isMuted() const; void pause(bool flag); void mute(bool flag); - void fade(int v1, int v2, int v3, int v4); + void fade(int volume1, int volume2, int volume3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; int getCueValue() const; @@ -274,7 +284,8 @@ public: class AdlibSoundDriver: public SoundDriver { public: - void setVolume(int volume) {} + virtual void setVolume(int volume) {} + virtual void installPatchBank(const byte *data) {} }; } // End of namespace tSage -- cgit v1.2.3 From 687d033d28f9d85b29f1f0edfcfb1751e1a92031 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 May 2011 20:32:40 +1000 Subject: TSAGE: Further sound driver installation logic --- engines/tsage/sound.cpp | 237 +++++++++++++++++++++++++++++++++++++++++++----- engines/tsage/sound.h | 51 +++++++++-- engines/tsage/tsage.cpp | 9 ++ engines/tsage/tsage.h | 5 +- 4 files changed, 274 insertions(+), 28 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index b47d95f36e..270325e284 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -43,6 +43,7 @@ SoundManager::SoundManager() { _groupList[i] = 0; _fieldE9[i] = 0; _field109[i] = 0; + _voiceStructPtrs[i] = NULL; } _groupMask = 0; @@ -51,6 +52,7 @@ SoundManager::SoundManager() { _disableCtr = 0; _suspendedCount = 0; _driversDetected = false; + _needToRethink = false; } SoundManager::~SoundManager() { @@ -58,9 +60,9 @@ SoundManager::~SoundManager() { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->stop(); for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { - int driverNum = (*i)->_driverNum; + SoundDriver *driver = *i; ++i; - unInstallDriver(driverNum); + delete driver; } _sfTerminate(); } @@ -75,6 +77,43 @@ void SoundManager::postInit() { } } +/** + * Loops through all the loaded sounds, and stops any that have been flagged for stopping + */ +void SoundManager::dispatch() { + Common::List::iterator i = _soundList.begin(); + while (i != _soundList.end()) { + Sound *sound = *i; + ++i; + + // If the sound is flagged for stopping, then stop it + if (sound->_stopFlag) { + sound->stop(); + } + } +} + +void SoundManager::syncSounds() { + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + bool music_mute = mute; + bool sfx_mute = mute; + + if (!mute) { + music_mute = ConfMan.getBool("music_mute"); + sfx_mute = ConfMan.getBool("sfx_mute"); + } + + // Get the new music and sfx volumes + int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); + int sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); + + warning("Set volume music=%d sfx=%d", musicVolume, sfxVolume); + this->setMasterVol(musicVolume / 2); +} + Common::List &SoundManager::buildDriverList(bool detectFlag) { assert(__sndmgrReady); _availableDrivers.clear(); @@ -94,7 +133,9 @@ Common::List &SoundManager::buildDriverList(bool detectFlag) { } void SoundManager::installConfigDrivers() { +#ifdef TSAGE_SOUND installDriver(ADLIB_DRIVER_NUM); +#endif } Common::List &SoundManager::getDriverList(bool detectFlag) { @@ -304,6 +345,34 @@ void SoundManager::rethinkVoiceTypes() { _sfRethinkVoiceTypes(); } +void SoundManager::_sfSoundServer() { + if (!sfManager()._disableCtr && !sfManager()._suspendCtr) + return; + + if (sfManager()._needToRethink) { + _sfRethinkVoiceTypes(); + sfManager()._needToRethink = false; + } else { + _sfDereferenceAll(); + } + + // Handle any fading if necessary + do { + _sfProcessFading(); + } while (sfManager()._suspendCtr > 0); + sfManager()._suspendCtr = 0; + + // Poll all sound drivers in case they need it + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + (*i)->poll(); + } +} + +void SoundManager::_sfProcessFading() { + //TODO +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -353,7 +422,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { void SoundManager::_sfAddToPlayList(Sound *sound) { ++sfManager()._suspendCtr; _sfDoAddToPlayList(sound); - sound->_field6 = 0; + sound->_stopFlag = false; _sfRethinkVoiceTypes(); --sfManager()._suspendCtr; } @@ -374,7 +443,121 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { } void SoundManager::_sfRethinkSoundDrivers() { - + // Free any existing entries + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + if (sfManager()._voiceStructPtrs[idx]) { + delete sfManager()._voiceStructPtrs[idx]; + sfManager()._voiceStructPtrs[idx] = NULL; + } + } + + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + byte flag = 0xff; + int total = 0; + + // Loop through the sound drivers + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + // Process the group data for each sound driver + SoundDriver *driver = *i; + const byte *groupData = driver->_groupOffset->pData; + + while (*groupData != 0xff) { + byte byteVal = *groupData++; + + if (byteVal == idx) { + byte byteVal2 = *groupData++; + if (flag == 0xff) + flag = byteVal2; + else { + assert(flag == byteVal2); + } + + if (!flag) { + while (*groupData++ != 0xff) + ++total; + } else { + total += *groupData; + groupData += 2; + } + } else if (*groupData++ == 0) { + while (*groupData != 0xff) + ++groupData; + ++groupData; + } else { + groupData += 2; + } + } + } + + if (total) { + int dataSize = !flag ? total * 28 + 30 : total * 26 + 30; + debugC(9, ktSageSound, "data Size = %d\n", dataSize); + + VoiceStruct *vs = new VoiceStruct(); + sfManager()._voiceStructPtrs[idx] = vs; + + if (!flag) { + vs->_field0 = 0; + vs->_field1 = total; +// offset = 2; + } else { + vs->_field0 = 1; + vs->_field1 = vs->_field2 = total; +// offset = 4; + } + + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + // Process the group data for each sound driver + SoundDriver *driver = *i; + const byte *groupData = driver->_groupOffset->pData; + + while (*groupData != 0xff) { + byte byteVal = *groupData++; + + if (byteVal == idx) { + if (!flag) { + while ((byteVal = *groupData++) != 0xff) { + VoiceStructEntry ve; + ve._field1 = (byteVal & 0x80) ? 0 : 1; + ve._driver = driver; + ve._field4 = 0; + ve._field6 = 0; + ve._field8 = 0; + ve._field9 = 0; + ve._fieldA = 0; + + vs->_entries.push_back(ve); + } + } else { + byteVal = *groupData; + groupData += 2; + + for (int idx = 0; idx < byteVal; ++idx) { + VoiceStructEntry ve; + ve._field0 = idx; + ve._driver = driver; + ve._field4 = 0xff; + ve._field6 = 0; + ve._field8 = 0; + ve._fieldA = 0; + ve._fieldC = 0; + ve._fieldD = 0; + + vs->_entries.push_back(ve); + } + } + } else { + if (*groupData++ != 0) { + while (*groupData != 0xff) + ++groupData; + } + } + } + } + } + } } void SoundManager::_sfRethinkVoiceTypes() { @@ -472,8 +655,8 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { return false; sfManager()._installedDrivers.push_back(driver); - uint32 *maskList = driver->getGroupMaskList(); - driver->_groupMask = *maskList; + driver->_groupOffset = driver->getGroupData(); + driver->_groupMask = READ_LE_UINT32(driver->_groupOffset); _sfExtractGroupMask(); _sfRethinkSoundDrivers(); @@ -484,6 +667,7 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { sfManager()._installedDrivers.remove(driver); + delete driver; _sfExtractGroupMask(); _sfRethinkSoundDrivers(); @@ -530,10 +714,11 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { ++_globals->_soundManager._suspendCtr; for (int idx = 0; idx < 16; ++idx) { + /* Sound *snd = sfManager()._voiceStructPtrs[idx]; if (!snd) continue; - +*/ // TODO: More stuff } @@ -543,7 +728,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { /*--------------------------------------------------------------------------*/ Sound::Sound() { - _field6 = 0; + _stopFlag = false; _soundNum = 0; _groupNum = 0; _soundPriority = 0; @@ -555,7 +740,7 @@ Sound::Sound() { _loopFlag = false; _pauseCtr = 0; _muteCtr = 0; - _holdAt = false; + _holdAt = 0xff; _cueValue = -1; _volume1 = -1; _volume3 = 0; @@ -642,7 +827,7 @@ void Sound::_unPrime() { _globals->_soundManager.removeFromSoundList(this); _primed = false; - _field6 = 0; + _stopFlag = false; } } @@ -812,29 +997,30 @@ void Sound::release() { ASound::ASound(): EventHandler() { _action = NULL; - _cueFlag = false; + _cueValue = -1; } void ASound::synchronise(Serialiser &s) { EventHandler::synchronise(s); SYNC_POINTER(_action); - s.syncAsByte(_cueFlag); + s.syncAsByte(_cueValue); } void ASound::dispatch() { EventHandler::dispatch(); - if (!_sound.getCueValue()) { - _cueFlag = false; - _sound.setCueValue(1); + int cueValue = _sound.getCueValue(); + if (cueValue != -1) { + _cueValue = cueValue; + _sound.setCueValue(-1); if (_action) _action->signal(); } - if (!_cueFlag) { + if (_cueValue != -1) { if (!_sound.isPrimed()) { - _cueFlag = true; + _cueValue = -1; if (_action) { _action->signal(); _action = NULL; @@ -845,7 +1031,7 @@ void ASound::dispatch() { void ASound::play(int soundNum, Action *action, int volume) { _action = action; - _cueFlag = false; + _cueValue = 0; setVol(volume); _sound.play(soundNum); @@ -858,7 +1044,7 @@ void ASound::stop() { void ASound::prime(int soundNum, Action *action) { _action = action; - _cueFlag = false; + _cueValue = 0; _sound.prime(soundNum); } @@ -880,9 +1066,18 @@ void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { SoundDriver::SoundDriver() { _driverNum = 0; _minVersion = _maxVersion = 0; - _groupMaskList = NULL; - _groupMask = 0; } +/*--------------------------------------------------------------------------*/ + +const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; + +AdlibSoundDriver::AdlibSoundDriver() { + _groupData.groupMask = 1; + _groupData.v1 = 0x46; + _groupData.v2 = 0; + _groupData.pData = &adlib_group_data[0]; +} + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index a42f9b8c3a..aaaaf5842d 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -56,14 +56,21 @@ public: Common::String longDescription; }; +struct GroupData { + uint32 groupMask; + byte v1; + byte v2; + const byte *pData; +}; + class SoundDriver { public: Common::String _shortDescription, _longDescription; int _driverNum; int _minVersion, _maxVersion; - uint32 *_groupMaskList; // The following fields were originally held in separate arrays in the SoundManager class uint32 _groupMask; + const GroupData *_groupOffset; public: SoundDriver(); @@ -72,9 +79,32 @@ public: virtual bool open() { return true; } virtual void close() {} - virtual uint32 *getGroupMaskList() const { return _groupMaskList; } + virtual const GroupData *getGroupData() = 0; virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void poll() {} +}; + +struct VoiceStructEntry { + int _field0; + int _field1; + SoundDriver *_driver; + int _field4; + int _field6; + int _field8; + int _field9; + int _fieldA; + int _fieldC; + int _fieldD; +}; + +class VoiceStruct { +public: + int _field0; + int _field1; + int _field2; + + Common::Array _entries; }; class SoundManager : public SaveListener { @@ -97,14 +127,16 @@ public: int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; - Sound *_voiceStructPtrs[SOUND_ARR_SIZE]; + VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; + bool _needToRethink; public: SoundManager(); ~SoundManager(); - void dispatch() {} + void dispatch(); virtual void listenerSynchronise(Serialiser &s); virtual void postInit(); + void syncSounds(); static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); @@ -164,6 +196,8 @@ public: static void _sfDoAddToPlayList(Sound *sound); static bool _sfDoRemoveFromPlayList(Sound *sound); static void _sfDoUpdateVolume(Sound *sound); + static void _sfSoundServer(); + static void _sfProcessFading(); }; class Sound: public EventHandler { @@ -173,7 +207,7 @@ private: void orientAfterRestore(); public: int _field0; - int _field6; + bool _stopFlag; int _soundNum; int _groupNum; int _soundPriority; @@ -249,7 +283,7 @@ class ASound: public EventHandler { public: Sound _sound; Action *_action; - bool _cueFlag; + int _cueValue; ASound(); virtual void synchronise(Serialiser &s); @@ -283,9 +317,14 @@ public: }; class AdlibSoundDriver: public SoundDriver { +private: + GroupData _groupData; public: + AdlibSoundDriver(); + virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual const GroupData *getGroupData() { return &_groupData; } }; } // End of namespace tSage diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 16756f59fa..05aea8eeb5 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -82,6 +82,9 @@ void TSageEngine::initialise() { _globals = new Globals(); _globals->gfxManager().setDefaults(); + + // Setup sound settings + syncSoundSettings(); } void TSageEngine::deinitialise() { @@ -139,4 +142,10 @@ Common::String TSageEngine::generateSaveName(int slot) { return Common::String::format("%s.%03d", _targetName.c_str(), slot); } +void TSageEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + _globals->_soundManager.syncSounds(); +} + } // End of namespace tSage diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 06c66d8f42..5903527701 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -55,7 +55,9 @@ enum { }; enum { - kRingDebugScripts = 1 << 0 + kRingDebugScripts = 1 << 0, + ktSageSound = 1 << 1, + ktSageCore = 1 << 2 }; struct tSageGameDescription; @@ -87,6 +89,7 @@ public: virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); virtual Common::Error saveGameState(int slot, const char *desc); + virtual void syncSoundSettings(); Common::String generateSaveName(int slot); void initialise(); -- cgit v1.2.3 From d52e69d82c650ab711668835da178a0f04e9e5f3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 24 May 2011 20:07:41 +1000 Subject: TSAGE: Added some extra code for volume control and start on rethinking voice types --- engines/tsage/sound.cpp | 113 ++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 21 ++++++++- 2 files changed, 119 insertions(+), 15 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 270325e284..878710b0f8 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -373,6 +373,29 @@ void SoundManager::_sfProcessFading() { //TODO } +void SoundManager::_sfUpdateVoiceStructs() { + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + + if (vs->_voiceType == VOICETYPE_0) { + vse._field4 = vse._fieldC; + vse._field6 = vse._fieldE; + vse._field8 = vse._field10; + vse._field9 = vse._field11; + vse._fieldA = vse._field12; + } else { + vse._field8 = vse._fieldE; + vse._fieldA = vse._field10; + vse._fieldC = vse._field12; + vse._fieldD = vse._field13; + } + } + } +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -498,13 +521,11 @@ void SoundManager::_sfRethinkSoundDrivers() { sfManager()._voiceStructPtrs[idx] = vs; if (!flag) { - vs->_field0 = 0; + vs->_voiceType = VOICETYPE_0; vs->_field1 = total; -// offset = 2; } else { - vs->_field0 = 1; + vs->_voiceType = VOICETYPE_1; vs->_field1 = vs->_field2 = total; -// offset = 4; } for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -561,7 +582,56 @@ void SoundManager::_sfRethinkSoundDrivers() { } void SoundManager::_sfRethinkVoiceTypes() { - + ++sfManager()._suspendCtr; + _sfDereferenceAll(); + + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + if (!vs) + continue; + + if (vs->_voiceType == VOICETYPE_0) { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._field14 = vse._field4; + vse._field16 = vse._field6; + vse._field18 = vse._field8; + vse._field19 = vse._field9; + vse._field1A = vse._fieldA; + vse._field4 = 0; + vse._field6 = 0; + vse._field8 = 0; + vse._field9 = 0; + vse._fieldA = 0; + vse._fieldC = 0; + vse._fieldE = 0; + vse._field10 = 0; + vse._field11 = 0; + vse._field12 = 0; + } + } else { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._field14 = vse._field8; + vse._field16 = vse._fieldA; + vse._field18 = vse._fieldC; + vse._field19 = vse._fieldD; + vse._field8 = 0; + vse._fieldA = 0; + vse._fieldC = 0; + vse._fieldD = 0; + vse._fieldE = 0; + vse._field10 = 0; + vse._field12 = 0; + } + } + } + + int var2 = 0; + for (Common::List::iterator playIterator = sfManager()._playList.begin(); + playIterator != sfManager()._playList.end(); ++playIterator) { + + } } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -606,7 +676,7 @@ void SoundManager::_sfSetMasterVol(int volume) { for (Common::List::iterator i = _globals->_soundManager._installedDrivers.begin(); i != _globals->_soundManager._installedDrivers.end(); ++i) { - (*i)->setVolume(volume); + (*i)->setMasterVolume(volume); } } } @@ -660,7 +730,7 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { _sfExtractGroupMask(); _sfRethinkSoundDrivers(); - driver->setVolume(sfManager()._volume); + driver->setMasterVolume(sfManager()._volume); return true; } @@ -713,13 +783,27 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { void SoundManager::_sfDoUpdateVolume(Sound *sound) { ++_globals->_soundManager._suspendCtr; - for (int idx = 0; idx < 16; ++idx) { - /* - Sound *snd = sfManager()._voiceStructPtrs[idx]; - if (!snd) + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + if (!vs) continue; -*/ - // TODO: More stuff + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + SoundDriver *driver = vse._driver; + + if (vs->_voiceType == VOICETYPE_0) { + if (!vse._field4 && !vse._field6) { + int vol = sound->_volume * sound->_field48[vse._field8] / 127; + driver->setVolume0(voiceIndex, vse._field0, 7, vol); + } + } else { + if (!vse._field8 && !vse._fieldA) { + int vol = sound->_volume * sound->_field48[vse._fieldC] / 127; + driver->setVolume1(voiceIndex, vse._field0, 7, vol); + } + } + } } --_globals->_soundManager._suspendCtr; @@ -1074,6 +1158,9 @@ SoundDriver::SoundDriver() { const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; AdlibSoundDriver::AdlibSoundDriver() { + _minVersion = 0x102; + + _groupData.groupMask = 1; _groupData.v1 = 0x46; _groupData.v2 = 0; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index aaaaf5842d..29fafe79ba 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -80,8 +80,10 @@ public: virtual bool open() { return true; } virtual void close() {} virtual const GroupData *getGroupData() = 0; - virtual void setVolume(int volume) {} + virtual void setMasterVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void setVolume0(int channel, int v2, int v3, int volume) {} + virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void poll() {} }; @@ -96,11 +98,25 @@ struct VoiceStructEntry { int _fieldA; int _fieldC; int _fieldD; + int _fieldE; + int _field10; + int _field11; + int _field12; + int _field13; + int _field14; + int _field16; + int _field18; + int _field19; + + int _field1A; + int _field1B; }; +enum VoiceType {VOICETYPE_0 = 0, VOICETYPE_1 = 1}; + class VoiceStruct { public: - int _field0; + VoiceType _voiceType; int _field1; int _field2; @@ -198,6 +214,7 @@ public: static void _sfDoUpdateVolume(Sound *sound); static void _sfSoundServer(); static void _sfProcessFading(); + static void _sfUpdateVoiceStructs(); }; class Sound: public EventHandler { -- cgit v1.2.3 From 16666ec40c5425db1d8ae957c546d02a12f52c7d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Apr 2011 21:23:47 +1000 Subject: TSAGE: Created stub classes for ASound and Sound, and reworked engine to use proper named methods --- engines/tsage/converse.cpp | 2 +- engines/tsage/converse.h | 3 +- engines/tsage/core.cpp | 46 ++----- engines/tsage/core.h | 69 ---------- engines/tsage/globals.h | 3 +- engines/tsage/graphics.cpp | 2 +- engines/tsage/ringworld_demo.cpp | 2 +- engines/tsage/ringworld_demo.h | 3 +- engines/tsage/ringworld_logic.cpp | 2 +- engines/tsage/ringworld_scenes1.cpp | 148 ++++++++++---------- engines/tsage/ringworld_scenes1.h | 21 +-- engines/tsage/ringworld_scenes10.cpp | 43 +++--- engines/tsage/ringworld_scenes10.h | 8 +- engines/tsage/ringworld_scenes2.cpp | 37 ++--- engines/tsage/ringworld_scenes2.h | 4 +- engines/tsage/ringworld_scenes3.cpp | 252 +++++++++++++++++------------------ engines/tsage/ringworld_scenes3.h | 20 +-- engines/tsage/ringworld_scenes4.cpp | 8 +- engines/tsage/ringworld_scenes4.h | 2 +- engines/tsage/ringworld_scenes5.cpp | 88 ++++++------ engines/tsage/ringworld_scenes5.h | 10 +- engines/tsage/ringworld_scenes6.cpp | 36 ++--- engines/tsage/ringworld_scenes6.h | 8 +- engines/tsage/ringworld_scenes8.cpp | 50 +++---- engines/tsage/ringworld_scenes8.h | 14 +- engines/tsage/sound.cpp | 91 +++++++++++++ engines/tsage/sound.h | 43 ++++++ 27 files changed, 529 insertions(+), 486 deletions(-) diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 5fa36142e7..b475310533 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -231,7 +231,7 @@ void SequenceManager::signal() { case 26: v1 = getNextValue(); v2 = getNextValue(); - _soundHandler.startSound(v1, v2 ? this : NULL, 127); + _soundHandler.play(v1, v2 ? this : NULL, 127); break; case 27: { v1 = getNextValue(); diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 6876fa41cb..13c490e995 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -25,6 +25,7 @@ #include "tsage/core.h" #include "tsage/dialogs.h" +#include "tsage/sound.h" namespace tSage { @@ -50,7 +51,7 @@ public: int _objectIndex; SceneObject *_sceneObject; SceneObject *_objectList[6]; - SoundHandler _soundHandler; + ASound _soundHandler; public: SequenceManager(); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 7534abdec7..4cbe70f0e3 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -30,6 +30,7 @@ #include "tsage/scenes.h" #include "tsage/staticres.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -2944,53 +2945,22 @@ int SceneRegions::indexOf(const Common::Point &pt) { /*--------------------------------------------------------------------------*/ -SoundHandler::SoundHandler() { +ASound::ASound() { _action = NULL; _field280 = -1; - if (_globals) - _globals->_sceneListeners.push_back(this); -} - -SoundHandler::~SoundHandler() { - if (_globals) - _globals->_sceneListeners.remove(this); } -void SoundHandler::dispatch() { - EventHandler::dispatch(); - int v = _sound.proc12(); - - if (v != -1) { - _field280 = v; - _sound.proc2(-1); - - if (_action) - _action->signal(); - } +void ASound::synchronize(Serializer &s) { + EventHandler::synchronize(s); - if (_field280 != -1) { - // FIXME: Hardcoded to only flag a sound ended if an action has been set - if (_action) { -// if (!_sound.proc3()) { - _field280 = -1; - if (_action) { - _action->signal(); - _action = NULL; - } - } - } + SYNC_POINTER(_action); + s.syncAsSint16LE(_field280); } -void SoundHandler::startSound(int soundNum, Action *action, int volume) { - _action = action; - _field280 = 0; - setVolume(volume); - _sound.startSound(soundNum); - - warning("TODO: SoundHandler::startSound"); +void ASound::dispatch() { + } - /*--------------------------------------------------------------------------*/ void SceneItemList::addItems(SceneItem *first, ...) { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 71130e5b0b..6c30c4fe19 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -33,7 +33,6 @@ #include "tsage/graphics.h" #include "tsage/resources.h" #include "tsage/saveload.h" -#include "tsage/sound.h" namespace tSage { @@ -719,74 +718,6 @@ public: /*--------------------------------------------------------------------------*/ -class GameSoundHandler { -public: - void proc1() { - warning("TODO: GameSoundHandler::proc1"); - } - void proc5(int v) { - warning("TODO: GameSoundHandler::proc5"); - } - void proc11(int v1, int v2, int v3, int v4) { - warning("TODO: GameSoundHandler::proc11"); - } - int proc12() { - // TODO - return -1; - } - void proc2(int v) { - // TODO - } - int proc3() { - return 0; - } - void setVolume(int volume) { - warning("TODO GameSoundHandler::setVolume"); - } - void startSound(int soundNum) { - warning("TODO GameSoundHandler::startSound"); - } -}; - -class SoundHandler : public EventHandler { -public: - GameSoundHandler _sound; - Action *_action; - int _field280; -public: - SoundHandler(); - ~SoundHandler(); - - void startSound(int soundNum, Action *action = NULL, int volume = 127); - void proc1(Action *action) { - proc11(0, 5, 10, 1, action); - } - void proc2(int v) { - warning("TODO: SoundHandler::proc2"); - } - void proc3() { - warning("TODO: SoundHandler::proc5"); - } - void proc4() { - _sound.proc1(); - } - void proc5(int v) { - _sound.proc5(v); - } - void proc11(int v1, int v2, int v3, int v4, Action *action) { - if (action) - _action = action; - - _sound.proc11(v1, v2, v3, v4); - } - void setVolume(int volume) { _sound.setVolume(volume); } - - virtual Common::String getClassName() { return "SoundHandler"; } - virtual void dispatch(); -}; - -/*--------------------------------------------------------------------------*/ - class SceneItemList : public SynchronizedList { public: void addItems(SceneItem *first, ...); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 6b3df587b6..fb1f3657b4 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -28,6 +28,7 @@ #include "tsage/dialogs.h" #include "tsage/scenes.h" #include "tsage/events.h" +#include "tsage/sound.h" #include "tsage/saveload.h" namespace tSage { @@ -57,7 +58,7 @@ public: SynchronizedList _sceneListeners; bool _flags[256]; Player _player; - SoundHandler _soundHandler; + ASound _soundHandler; InvObjectList *_inventory; Region _paneRegions[2]; int _paneRefreshFlag[2]; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index a212c5dd77..29262447f2 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -207,7 +207,7 @@ void Rect::expandPanes() { } /** - * Serialises the given rect + * Serializes the given rect */ void Rect::synchronize(Serializer &s) { s.syncAsSint16LE(left); diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 3ad414fa20..4d3b527ac7 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -111,7 +111,7 @@ void RingworldDemoScene::postInit(SceneObjectList *OwnerList) { } void RingworldDemoScene::signal() { - _soundHandler.startSound(4); + _soundHandler.play(4); _actor1.postInit(); _actor2.postInit(); _actor3.postInit(); diff --git a/engines/tsage/ringworld_demo.h b/engines/tsage/ringworld_demo.h index 7492c1e871..3e7431e107 100644 --- a/engines/tsage/ringworld_demo.h +++ b/engines/tsage/ringworld_demo.h @@ -28,6 +28,7 @@ #include "tsage/core.h" #include "tsage/scenes.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -46,7 +47,7 @@ public: SequenceManager _sequenceManager; SceneObject _actor1, _actor2, _actor3; SceneObject _actor4, _actor5, _actor6; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 2141fcce5a..022e706f36 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1342,7 +1342,7 @@ void RingworldGame::start() { void RingworldGame::restart() { _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); // Reset the flags _globals->reset(); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index b6daadbef7..9d261ac074 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -98,7 +98,7 @@ void Scene10::Action1::signal() { scene->_object4.animate(ANIM_MODE_6, this); break; case 10: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 11: _globals->_scenePalette.clearListeners(); @@ -185,7 +185,7 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; setAction(&_action1); - _globals->_soundHandler.startSound(5); + _globals->_soundHandler.play(5); } void Scene10::stripCallback(int v) { @@ -232,7 +232,7 @@ void Scene15::Action1::signal() { Common::Point pt(160, 100); NpcMover *mover = new NpcMover(); scene->_object1.addMover(mover, &pt, this); - scene->_soundHandler.startSound(7); + scene->_soundHandler.play(7); break; } case 3: @@ -256,7 +256,7 @@ void Scene15::postInit(SceneObjectList *OwnerList) { loadScene(15); Scene::postInit(); setZoomPercents(0, 100, 200, 100); - _globals->_soundHandler.startSound(6); + _globals->_soundHandler.play(6); setAction(&_action1); } @@ -276,7 +276,7 @@ void Scene20::Action1::signal() { scene->_stripManager.start(20, this); break; case 2: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 3: _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; @@ -341,8 +341,8 @@ void Scene20::Action2::signal() { break; } case 8: - scene->_sound.proc4(); - scene->_sound.proc1(this); + scene->_sound.release(); + scene->_sound.fadeOut(this); break; case 9: SceneItem::display(0, 0, LIST_END); @@ -400,8 +400,8 @@ void Scene20::Action3::signal() { break; } case 6: - scene->_sound.startSound(60, this, 127); - _globals->_soundHandler.proc4(); + scene->_sound.play(60, this, 127); + _globals->_soundHandler.release(); break; case 7: _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; @@ -450,7 +450,7 @@ void Scene20::Action4::signal() { break; } case 4: { - scene->_sound.startSound(28); + scene->_sound.play(28); scene->_sceneObject4.postInit(); scene->_sceneObject4.setVisage(21); scene->_sceneObject4.setStrip(3); @@ -463,7 +463,7 @@ void Scene20::Action4::signal() { break; } case 5: { - scene->_sound.startSound(42); + scene->_sound.play(42); scene->_sceneObject4.remove(); scene->_SceneObjectExt.setVisage(21); scene->_SceneObjectExt.setStrip(1); @@ -487,7 +487,7 @@ void Scene20::Action4::signal() { break; } case 6: { - scene->_sound.startSound(42); + scene->_sound.play(42); scene->_SceneObjectExt.setStrip(2); scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL); @@ -506,7 +506,7 @@ void Scene20::Action4::signal() { case 7: _globals->_player.setStrip(2); _globals->_player.animate(ANIM_MODE_2, NULL); - scene->_sound.startSound(77, this, 127); + scene->_sound.play(77, this, 127); break; case 8: _globals->_game->endGame(20, 0); @@ -549,15 +549,15 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _SceneObjectExt._moveDiff = Common::Point(10, 10); _sceneObject3._moveDiff = Common::Point(10, 10); - _globals->_soundHandler.startSound(20); - _sound.startSound(21); - _sound.proc5(1); + _globals->_soundHandler.play(20); + _sound.play(21); + _sound.holdAt(true); setAction(&_action2); _sceneBounds = Rect(320, 0, 640, 200); } else if (_globals->_sceneManager._previousScene == 60) { // Evasion - _sound.startSound(30); + _sound.play(30); _globals->_player.postInit(); _globals->_player.setVisage(20); _globals->_player.setPosition(Common::Point(588, 79)); @@ -605,7 +605,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _speakerGameText.setTextPos(Common::Point(350, 20)); _speakerGameText._textWidth = 260; - _globals->_soundHandler.startSound(8); + _globals->_soundHandler.play(8); _sceneBounds = Rect(320, 0, 640, 200); } @@ -669,7 +669,7 @@ void Scene30::BeamAction::signal() { case 2: // Hide the beam and lower the player's hand - scene->_sound.startSound(10, NULL, 127); + scene->_sound.play(10, NULL, 127); _globals->_player.animate(ANIM_MODE_6, this); scene->_beam.remove(); break; @@ -693,14 +693,14 @@ void Scene30::BeamAction::signal() { case 4: // Open the door - scene->_sound.startSound(11, NULL, 127); + scene->_sound.play(11, NULL, 127); scene->_door.animate(ANIM_MODE_5, this); break; case 5: // Run the Kzin's talk sequence - scene->_sound.startSound(13, NULL, 127); - _globals->_soundHandler.startSound(12, NULL, 127); + scene->_sound.play(13, NULL, 127); + _globals->_soundHandler.play(12, NULL, 127); scene->_stripManager.start((scene->_sceneMode == 0) ? 30 : 37, this); break; @@ -732,7 +732,7 @@ void Scene30::KzinAction::signal() { setDelay(1200); break; case 1: - _globals->_soundHandler.proc2(0); + _globals->_soundHandler.fadeOut(NULL); _globals->_player.disableControl(); setAction(&scene->_sequenceManager, _globals->_sceneManager._scene, 31, &scene->_kzin, &scene->_door, NULL); break; @@ -772,12 +772,12 @@ void Scene30::RingAction::signal() { } case 3: - scene->_sound.startSound(11, NULL, 127); + scene->_sound.play(11, NULL, 127); scene->_door.animate(ANIM_MODE_6, this); break; case 4: { - scene->_sound.startSound(13, NULL, 127); + scene->_sound.play(13, NULL, 127); NpcMover *kzinMover = new NpcMover(); Common::Point pt(354, 5); scene->_kzin.addMover(kzinMover, &pt, this); @@ -955,7 +955,7 @@ void Scene40::Action1::signal() { scene->_doorway.setVisage(46); scene->_doorway.setPosition(Common::Point(305, 61)); scene->_doorway.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 3: scene->_doorway.hide(); @@ -976,7 +976,7 @@ void Scene40::Action1::signal() { scene->_assassin.setFrame(1); scene->_assassin.setPosition(Common::Point(13, 171)); scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 5: scene->_doorway.show(); @@ -1011,7 +1011,7 @@ void Scene40::Action1::signal() { break; } case 10: { - scene->_soundHandler.startSound(27); + scene->_soundHandler.play(27); Common::Point pt(223, 184); NpcMover *mover = new NpcMover(); scene->_dyingKzin.addMover(mover, &pt, this); @@ -1024,7 +1024,7 @@ void Scene40::Action1::signal() { break; } case 12: { - _globals->_soundHandler.startSound(26); + _globals->_soundHandler.play(26); _globals->_player._uiEnabled = true; scene->_assassin.setVisage(42); scene->_assassin.setPosition(Common::Point(4, 191)); @@ -1043,7 +1043,7 @@ void Scene40::Action1::signal() { scene->_assassin.setStrip(1); scene->_assassin.setFrame(1); scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); break; case 15: _globals->_player.disableControl(); @@ -1057,7 +1057,7 @@ void Scene40::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 16: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 17: _globals->_game->endGame(40, 20); @@ -1083,7 +1083,7 @@ void Scene40::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 2: { - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); scene->_doorway.postInit(); scene->_doorway.setVisage(16); scene->_doorway.setStrip2(6); @@ -1103,7 +1103,7 @@ void Scene40::Action2::signal() { scene->_assassin.setVisage(44); scene->_assassin._frame = 1; scene->_assassin.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(29); + scene->_soundHandler.play(29); RING_INVENTORY._infoDisk._sceneNumber = 40; break; case 4: @@ -1234,11 +1234,11 @@ void Scene40::Action6::signal() { scene->_doorway.setVisage(46); scene->_doorway.setPosition(Common::Point(305, 61)); scene->_doorway.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; } case 1: - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); scene->_doorway.setPosition(Common::Point(148, 74)); scene->_doorway.setFrame(1); scene->_doorway.setStrip(2); @@ -1270,7 +1270,7 @@ void Scene40::Action7::signal() { scene->_object7.setFrame(15); } scene->_object7.animate(ANIM_MODE_5, this); - scene->_soundHandler.startSound(25); + scene->_soundHandler.play(25); break; case 2: scene->_object7.remove(); @@ -1322,7 +1322,7 @@ void Scene40::Action8::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 4: _globals->_game->endGame(40, 45); @@ -1480,7 +1480,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _globals->_player.disableControl(); if (_globals->_sceneManager._previousScene == 20) { - _globals->_soundHandler.startSound(24); + _globals->_soundHandler.play(24); _globals->_player.setVisage(43); _object1.postInit(); @@ -1872,7 +1872,7 @@ void Scene60::Action1::signal() { scene->_floppyDrive.setPosition(Common::Point(136, 65)); scene->_floppyDrive.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(35); + scene->_soundHandler1.play(35); break; case 2: scene->_redLights.postInit(); @@ -1893,13 +1893,13 @@ void Scene60::Action1::signal() { scene->_message._numFrames = 5; _globals->_sceneItems.push_front(&scene->_message); - scene->_soundHandler2.startSound(38); + scene->_soundHandler2.play(38); } _globals->_events.setCursor(CURSOR_USE); break; case 3: - scene->_soundHandler2.startSound(37); + scene->_soundHandler2.play(37); scene->loadScene(65); scene->_message.remove(); @@ -1968,8 +1968,8 @@ void Scene60::Action1::signal() { scene->_floppyDrive.setFrame(scene->_floppyDrive.getFrameCount()); scene->_floppyDrive.animate(ANIM_MODE_6, this); - scene->_soundHandler1.startSound(35); - scene->_soundHandler3.proc3(); + scene->_soundHandler1.play(35); + scene->_soundHandler3.stop(); scene->_masterButton.setFrame(1); scene->_masterButton._state = 0; @@ -2019,7 +2019,7 @@ void Scene60::PrevObject::doAction(int action) { animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() > 5) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); scene->_action1.setActionIndex(scene->_action1.getActionIndex() - 2); scene->_action1.setDelay(1); } @@ -2037,7 +2037,7 @@ void Scene60::NextObject::doAction(int action) { animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() < 8) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); scene->_action1.setDelay(1); } } else { @@ -2051,7 +2051,7 @@ void Scene60::ExitObject::doAction(int action) { if (action == CURSOR_LOOK) { SceneItem::display2(60, 18); } else if (action == CURSOR_USE) { - scene->_soundHandler3.startSound(36); + scene->_soundHandler3.play(36); animate(ANIM_MODE_8, 1, NULL); scene->_nextButton.remove(); scene->_prevButton.remove(); @@ -2132,8 +2132,8 @@ void Scene60::ControlObject::doAction(int action) { if (_animateMode == ANIM_MODE_NONE) SceneItem::display2(60, 14); else if (!scene->_slaveButton._state) { - _globals->_soundHandler.startSound(40); - _globals->_soundHandler.proc5(1); + _globals->_soundHandler.play(40); + _globals->_soundHandler.holdAt(true); _globals->_sceneManager.changeScene(20); } else { scene->_sceneMode = 15; @@ -2153,14 +2153,14 @@ void Scene60::SlaveObject::doAction(int action) { if (scene->_masterButton._state) scene->_sceneMode = 19; else if (_state) { - scene->_soundHandler3.proc3(); + scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); _globals->clearFlag(102); _globals->clearFlag(!_globals->_stripNum ? 117 : 120); _state = 0; scene->_sceneMode = 9998; } else { - scene->_soundHandler3.startSound(39); + scene->_soundHandler3.play(39); _globals->setFlag(102); _globals->setFlag(!_globals->_stripNum ? 117 : 120); animate(ANIM_MODE_5, NULL); @@ -2185,14 +2185,14 @@ void Scene60::MasterObject::doAction(int action) { else if (scene->_slaveButton._state) scene->_sceneMode = 20; else if (_state) { - scene->_soundHandler3.proc3(); + scene->_soundHandler3.stop(); animate(ANIM_MODE_6, NULL); _state = 0; _globals->clearFlag(103); _globals->clearFlag(!_globals->_stripNum ? 116 : 119); scene->_sceneMode = 9998; } else { - scene->_soundHandler3.startSound(39); + scene->_soundHandler3.play(39); animate(ANIM_MODE_5, NULL); _state = 1; _globals->setFlag(103); @@ -2347,7 +2347,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _redLights.setPosition(Common::Point(199, 186)); _redLights.animate(ANIM_MODE_8, 0, NULL); - _soundHandler1.startSound(35); + _soundHandler1.play(35); if (!_globals->getFlag(83)) { _message.postInit(); @@ -2359,7 +2359,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message._numFrames = 5; _globals->_sceneItems.push_front(&_message); - _soundHandler2.startSound(38); + _soundHandler2.play(38); } } } else { @@ -2382,7 +2382,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _redLights.animate(ANIM_MODE_8, 0, NULL); _redLights._numFrames = 5; - _soundHandler1.startSound(35); + _soundHandler1.play(35); if (!_globals->getFlag(83)) { _message.postInit(); @@ -2394,7 +2394,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { _message._numFrames = 5; _globals->_sceneItems.push_front(&_message); - _soundHandler2.startSound(38); + _soundHandler2.play(38); } } } @@ -2462,7 +2462,7 @@ void Scene90::Action1::signal() { setDelay(2); break; case 5: - scene->_soundHandler2.startSound(58); + scene->_soundHandler2.play(58); if (scene->_stripManager._field2E8 == 220) scene->_stripManager.start(91, this, scene); @@ -2477,7 +2477,7 @@ void Scene90::Action1::signal() { break; case 7: scene->_object2.animate(ANIM_MODE_NONE); - _globals->_soundHandler.startSound(56); + _globals->_soundHandler.play(56); scene->_object3.animate(ANIM_MODE_5, this); break; case 8: { @@ -2507,8 +2507,8 @@ void Scene90::Action1::signal() { break; } case 11: - _globals->_soundHandler.startSound(57); - _globals->_soundHandler.startSound(68); + _globals->_soundHandler.play(57); + _globals->_soundHandler.play(68); scene->_object3.animate(ANIM_MODE_6, NULL); SceneItem::display(90, _globals->getFlag(104) ? 15 : 14, @@ -2556,8 +2556,8 @@ void Scene90::Object2::doAction(int action) { scene->_object6.hide(); scene->_sceneMode = 91; - scene->_soundHandler1.startSound(59); - scene->_soundHandler1.proc5(1); + scene->_soundHandler1.play(59); + scene->_soundHandler1.holdAt(true); scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_object6, NULL); break; case CURSOR_LOOK: @@ -2653,9 +2653,9 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _globals->_sceneItems.push_back(&_object3); _globals->_player.disableControl(); - _globals->_soundHandler.startSound(55); - _soundHandler1.startSound(52); - _soundHandler1.proc5(1); + _globals->_soundHandler.play(55); + _soundHandler1.play(52); + _soundHandler1.holdAt(true); setAction(&_action1); @@ -2670,7 +2670,7 @@ void Scene90::signal() { switch (_sceneMode) { case 91: _sceneMode = 92; - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 92: _globals->_scenePalette.clearListeners(); @@ -2713,7 +2713,7 @@ void Scene95::Action1::signal() { setDelay(60); break; case 2: { - scene->_soundHandler.startSound(66); + scene->_soundHandler.play(66); scene->_object3._numFrames = 5; scene->_object3.animate(ANIM_MODE_5, NULL); SceneItem::display(0, 0); @@ -2728,7 +2728,7 @@ void Scene95::Action1::signal() { break; } case 3: { - scene->_soundHandler.startSound(21); + scene->_soundHandler.play(21); Common::Point pt1(235, 72); PlayerMover *mover1 = new PlayerMover(); @@ -2768,7 +2768,7 @@ void Scene95::Action1::signal() { scene->_object1.setVisage(91); scene->_object1.setPosition(Common::Point(-22, 220)); - scene->_soundHandler.startSound(21); + scene->_soundHandler.play(21); Common::Point pt1(5, 198); NpcMover *mover1 = new NpcMover(); @@ -2826,7 +2826,7 @@ void Scene95::postInit(SceneObjectList *OwnerList) { _object3.setVisage(96); _object3.setPosition(Common::Point(29, 198)); - _soundHandler.startSound(67); + _soundHandler.play(67); setAction(&_action1); } @@ -3000,7 +3000,7 @@ void Scene6100::Action5::dispatch() { (tempSet.sqrt(zeroSet) < 150.0)) { switch (scene->_hitCount++) { case 1: - scene->_soundHandler.startSound(233); + scene->_soundHandler.play(233); scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) @@ -3008,7 +3008,7 @@ void Scene6100::Action5::dispatch() { break; case 2: - scene->_soundHandler.startSound(234); + scene->_soundHandler.play(234); scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) @@ -3017,7 +3017,7 @@ void Scene6100::Action5::dispatch() { break; default: - scene->_soundHandler.startSound(233); + scene->_soundHandler.play(233); scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) @@ -3217,7 +3217,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { if (!_globals->getFlag(76)) _probe.setAction(&_action4); - _globals->_soundHandler.startSound(231); + _globals->_soundHandler.play(231); } void Scene6100::remove() { diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h index 554b261f2c..07c89aff25 100644 --- a/engines/tsage/ringworld_scenes1.h +++ b/engines/tsage/ringworld_scenes1.h @@ -30,6 +30,7 @@ #include "tsage/core.h" #include "tsage/scenes.h" #include "tsage/globals.h" +#include "tsage/sound.h" namespace tSage { @@ -65,7 +66,7 @@ class Scene15 : public Scene { public: Action1 _action1; SceneObject _object1; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -97,7 +98,7 @@ public: Action3 _action3; Action4 _action4; SceneObject _sceneObject1, _SceneObjectExt, _sceneObject3, _sceneObject4, _sceneObject5; - SoundHandler _sound; + ASound _sound; public: Scene20(); virtual ~Scene20() {} @@ -143,7 +144,7 @@ class Scene30 : public Scene { }; public: - SoundHandler _sound; + ASound _sound; DisplayHotspot _groundHotspot, _wallsHotspot, _courtyardHotspot, _treeHotspot; BeamObject _beam; DoorObject _door; @@ -232,7 +233,7 @@ public: SpeakerQText _speakerQText; SpeakerSText _speakerSText; SpeakerGameText _speakerGameText; - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; Action3 _action3; @@ -387,9 +388,9 @@ public: SceneObject _redLights; Item1 _item1; Item _item2, _item3, _item4, _item5, _item6; - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; - SoundHandler _soundHandler3; + ASound _soundHandler1; + ASound _soundHandler2; + ASound _soundHandler3; Scene60(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -423,7 +424,7 @@ public: DisplayObject _object3, _object4, _object5; SceneObject _object6; DisplayHotspot _item1, _item2, _item3; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; Scene90(); @@ -441,7 +442,7 @@ class Scene95 : public Scene { public: Action1 _action1; SceneObject _object1, _object2, _object3; - SoundHandler _soundHandler; + ASound _soundHandler; Scene95(); virtual void postInit(SceneObjectList *OwnerList); @@ -503,7 +504,7 @@ public: Action5 _action5; GetBoxAction _getBoxAction; Action7 _action7; - SoundHandler _soundHandler; + ASound _soundHandler; Speaker _speaker1; SpeakerQR _speakerQR; SpeakerSL _speakerSL; diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index f8844ec486..368992628f 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -151,7 +151,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46); _sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48); - _globals->_soundHandler.startSound(251); + _globals->_soundHandler.play(251); if (_globals->_sceneManager._previousScene == 9150) { if (_globals->getFlag(20)) { _globals->_player.disableControl(); @@ -236,7 +236,7 @@ void Scene9150::dispatch() { } else { _globals->_player.disableControl(); if (_globals->getFlag(11)) { - _globals->_soundHandler.startSound(286); + _globals->_soundHandler.play(286); _sceneMode = 9153; } else { _sceneMode = 9156; @@ -270,7 +270,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) { _sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1); _sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59); - _globals->_soundHandler.startSound(285); + _globals->_soundHandler.play(285); _globals->_player.disableControl(); if (_globals->getFlag(20)) { @@ -402,7 +402,8 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_2, NULL); _object1.setPosition(Common::Point(132, 114)); _object1.fixPriority(140); - _soundHandler.startSound(297); + _soundHandler.play(297); + _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerGR); _stripManager.addSpeaker(&_speakerGText); @@ -479,7 +480,7 @@ void Scene9300::signal() { _globals->setFlag(84); // No break on purpose case 9303: - _globals->_soundHandler.startSound(295); + _globals->_soundHandler.play(295); _globals->_sceneManager.changeScene(9350); break; case 9302: @@ -509,7 +510,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) { _globals->_player.changeZoom(-1); _object1.postInit(); _object2.postInit(); - _globals->_soundHandler.startSound(289); + _globals->_soundHandler.play(289); _hotspot1.setup(35, 142, 76, 212, 9300, 0, 1); _hotspot2.setup(28, 90, 81, 143, 9300, 2, 3); @@ -764,7 +765,7 @@ void Scene9400::signal() { void Scene9400::dispatch() { if ((_object1._animateMode == 2) && (_object1._strip == 1) && (_object1._frame == 4)){ if (_field1032 == 0) { - _soundHandler.startSound(296); + _soundHandler.play(296); _field1032 = 1; } } else { @@ -1083,7 +1084,7 @@ void Scene9500::signal() { switch (_sceneMode) { case 9503: _globals->_sceneManager.changeScene(9200); - _globals->_soundHandler.startSound(295); + _globals->_soundHandler.play(295); break; case 9504: _globals->_sceneManager.changeScene(9850); @@ -1141,7 +1142,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { setZoomPercents(110, 75, 200, 150); _globals->_player.postInit(); - _globals->_soundHandler.startSound(305); + _globals->_soundHandler.play(305); _candle.postInit(); _candle.setVisage(9500); @@ -1249,7 +1250,7 @@ void Scene9700::signal() { _globals->_events.setCursor(CURSOR_USE); break; case 9704: - _globals->_soundHandler.startSound(323); + _globals->_soundHandler.play(323); _globals->_sceneManager.changeScene(9750); break; } @@ -1308,7 +1309,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) { void Scene9750::signal() { switch (_sceneMode ++) { case 9751: - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 9752: _globals->_sceneManager.changeScene(2100); @@ -1440,7 +1441,7 @@ void Scene9850::Hotspot17::doAction(int action) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(306); + scene->_soundHandler.play(306); NamedHotspot::doAction(action); } } @@ -1452,7 +1453,7 @@ void Scene9850::Hotspot18::doAction(int action) { SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(306); + scene->_soundHandler.play(306); NamedHotspot::doAction(action); } } @@ -1464,7 +1465,7 @@ void Scene9850::Hotspot19::doAction(int action) { SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else { if (action == CURSOR_USE) - scene->_soundHandler.startSound(313); + scene->_soundHandler.play(313); NamedHotspot::doAction(action); } } @@ -1653,7 +1654,7 @@ void Scene9900::strAction1::signal() { switch (_actionIndex++) { case 0: - scene->_soundHandler.startSound(351); + scene->_soundHandler.play(351); _object9.postInit(); _object9.setVisage(18); _object9._frame = 1; @@ -1673,7 +1674,7 @@ void Scene9900::strAction1::signal() { _globals->_scenePalette.addFader(&mask2[0], 1, 5, this); break; case 3: - _globals->_soundHandler.startSound(377); + _globals->_soundHandler.play(377); setDelay(120); break; case 4: @@ -1854,7 +1855,7 @@ void Scene9900::signal() { switch (_sceneMode){ case 150: - _globals->_soundHandler.startSound(380); + _globals->_soundHandler.play(380); _object8.postInit(); _object8.setVisage(2002); _object8.setStrip(1); @@ -1887,7 +1888,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9904: - _globals->_soundHandler.startSound(390); + _globals->_soundHandler.play(390); _sceneMode = 9912; setAction(&_strAction2, this); break; @@ -1918,7 +1919,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9909: - _globals->_soundHandler.startSound(375); + _globals->_soundHandler.play(375); _globals->_player.disableControl(); _sceneMode = 9907; setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); @@ -1929,7 +1930,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 9911: - _globals->_soundHandler.startSound(367); + _globals->_soundHandler.play(367); _globals->_player.disableControl(); _sceneMode = 9909; setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); @@ -2080,7 +2081,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { else _globals->_stripNum = 2121; - _globals->_soundHandler.startSound(118); + _globals->_soundHandler.play(118); } diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h index aa41555718..33b16d0014 100644 --- a/engines/tsage/ringworld_scenes10.h +++ b/engines/tsage/ringworld_scenes10.h @@ -129,7 +129,7 @@ public: SpeakerGText _speakerGText; SpeakerGR _speakerGR; SpeakerQText _speakerQText; - SoundHandler _soundHandler; + ASound _soundHandler; SceneHotspot1 _hotspot1; NamedHotspot _hotspot2; NamedHotspot _hotspot3; @@ -230,7 +230,7 @@ public: NamedHotspot _hotspot4; NamedHotspot _hotspot5; NamedHotspot _hotspot6; - SoundHandler _soundHandler; + ASound _soundHandler; int _field1032; SceneHotspot7 _hotspot7; SceneHotspot8 _hotspot8; @@ -424,7 +424,7 @@ public: SceneObject _objLever; Object6 _objScimitar; Object7 _objSword; - SoundHandler _soundHandler; + ASound _soundHandler; NamedHotspot _hotspot1; NamedHotspot _hotspot2; NamedHotspot _hotspot3; @@ -482,7 +482,7 @@ class Scene9900 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SceneObject _object1; SceneObject _object2; diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index 4378eac724..0154123c3d 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -117,6 +117,7 @@ void Scene1000::Action3::signal() { // First time being played, so show the introduction ConfMan.setBool(SEEN_INTRO, true); ConfMan.flushToDisk(); + setDelay(1); } else { // Prompt user for whether to start play or watch introduction @@ -124,7 +125,7 @@ void Scene1000::Action3::signal() { if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { _actionIndex = 20; - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); } else { setDelay(1); } @@ -214,7 +215,7 @@ void Scene1000::Action3::signal() { case 18: zoom(false); _globals->_scenePalette.clearListeners(); - _globals->_soundHandler.proc1(this); + _globals->_soundHandler.fadeOut(this); break; case 19: _globals->_sceneManager.changeScene(10); @@ -267,7 +268,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.startSound(114); + _globals->_soundHandler.play(114); } else if (_globals->_sceneManager._previousScene == 2222) { setZoomPercents(150, 10, 180, 100); _object1.postInit(); @@ -283,7 +284,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } else { - _globals->_soundHandler.startSound(4); + _globals->_soundHandler.play(4); setZoomPercents(0, 10, 30, 100); _object3.postInit(); _object3.setVisage(1050); @@ -429,7 +430,7 @@ void Scene1001::Action1::signal() { setDelay(10); break; case 16: { - scene->_soundHandler1.startSound(90); + scene->_soundHandler1.play(90); scene->_object6.postInit(); scene->_object6.setVisage(16); @@ -446,7 +447,7 @@ void Scene1001::Action1::signal() { break; } case 17: { - scene->_soundHandler1.startSound(90); + scene->_soundHandler1.play(90); scene->_object6.remove(); scene->_object7.postInit(); @@ -475,7 +476,7 @@ void Scene1001::Action1::signal() { setDelay(30); break; case 19: { - _globals->_soundHandler.startSound(91); + _globals->_soundHandler.play(91); byte adjustData[4] = {0xff, 0xff, 0xff, 0}; _globals->_scenePalette.fade(adjustData, false, 0); @@ -496,7 +497,7 @@ void Scene1001::Action1::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 22: - _globals->_soundHandler.startSound(92); + _globals->_soundHandler.play(92); scene->_stripManager.start(111, this); break; case 23: @@ -526,7 +527,7 @@ void Scene1001::postInit(SceneObjectList *OwnerList) { _object3.setStrip2(4); _object3.setPosition(Common::Point(61, 177)); - _globals->_soundHandler.startSound(85); + _globals->_soundHandler.play(85); setAction(&_action1); } @@ -647,7 +648,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { setAction(&_action4); } else { setAction(&_action3); - _globals->_soundHandler.startSound(114); + _globals->_soundHandler.play(114); } } @@ -734,7 +735,7 @@ void Scene1400::Action1::signal() { _globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180); _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_stripNum = 1500; - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); _globals->_sceneManager.changeScene(1500); break; @@ -779,7 +780,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) { _globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100; setAction(&_action1); - _globals->_soundHandler.startSound(118); + _globals->_soundHandler.play(118); } /*-------------------------------------------------------------------------- @@ -842,7 +843,7 @@ void Scene1500::Action1::signal() { setDelay(30); break; case 6: - scene->_soundHandler.startSound(123); + scene->_soundHandler.play(123); scene->_object1.setStrip2(4); scene->_object1.setFrame(1); scene->_object1.animate(ANIM_MODE_5, this); @@ -850,13 +851,13 @@ void Scene1500::Action1::signal() { case 7: scene->_object1.setStrip2(5); scene->_object1.animate(ANIM_MODE_2, NULL); - scene->_soundHandler.startSound(124, this); + scene->_soundHandler.play(124, this); break; case 8: - _globals->_soundHandler.startSound(126, this); + _globals->_soundHandler.play(126, this); break; case 9: - _globals->_soundHandler.startSound(127); + _globals->_soundHandler.play(127); _globals->_sceneManager.changeScene(2000); break; } @@ -893,7 +894,7 @@ void Scene1500::Action2::signal() { break; } case 3: - scene->_soundHandler.proc4(); + scene->_soundHandler.release(); _globals->_stripNum = 1505; _globals->_sceneManager.changeScene(2400); break; @@ -907,7 +908,7 @@ void Scene1500::postInit(SceneObjectList *OwnerList) { Scene::postInit(); if ((_globals->_stripNum == 1500) || ((_globals->_stripNum != 1504) && (_globals->_stripNum != 2751))) { - _globals->_soundHandler.startSound(120); + _globals->_soundHandler.play(120); setZoomPercents(105, 20, 145, 100); setAction(&_action1); diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h index 7731b45ae8..93a8f04fd4 100644 --- a/engines/tsage/ringworld_scenes2.h +++ b/engines/tsage/ringworld_scenes2.h @@ -72,7 +72,7 @@ public: Action1 _action1; SceneObject _object1, _object2, _object3, _object4; SceneObject _object5, _object6, _object7; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -134,7 +134,7 @@ public: virtual void signal(); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; SceneObject _object1, _object2, _object3; diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 9931d89ad4..f1aedc84cf 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -129,11 +129,11 @@ void Scene2000::Action6::signal() { setDelay(130); break; case 1: - scene->_soundHandler2.startSound(79); + scene->_soundHandler2.play(79); scene->_stripManager.start(2000, this); break; case 2: - _globals->_soundHandler.startSound(81); + _globals->_soundHandler.play(81); scene->_object6.postInit(); scene->_object6.setVisage(2003); scene->_object6.setAction(NULL); @@ -148,7 +148,7 @@ void Scene2000::Action6::signal() { scene->_object6.animate(ANIM_MODE_6, this); break; case 5: - _globals->_soundHandler.startSound(80); + _globals->_soundHandler.play(80); scene->_object6.remove(); _globals->_sceneManager.changeScene(1001); break; @@ -308,12 +308,12 @@ void Scene2000::Action14::signal() { setDelay(60); break; case 3: - _globals->_soundHandler.startSound(99); + _globals->_soundHandler.play(99); scene->_object8.show(); scene->_object8.animate(ANIM_MODE_5, this); break; case 4: - _globals->_soundHandler.startSound(12); + _globals->_soundHandler.play(12); scene->_object8.setStrip(2); scene->_object8.setFrame(1); scene->_object9.show(); @@ -324,7 +324,7 @@ void Scene2000::Action14::signal() { scene->_stripManager.start(2001, this, scene); break; case 6: - _globals->_soundHandler.proc1(0/* was false */); + _globals->_soundHandler.fadeOut(0/* was false */); scene->_object8.setStrip(1); scene->_object8.setFrame(scene->_object8.getFrameCount()); scene->_object8.animate(ANIM_MODE_6, this); @@ -333,7 +333,7 @@ void Scene2000::Action14::signal() { scene->_object10.remove(); break; case 7: - _globals->_soundHandler.startSound(111); + _globals->_soundHandler.play(111); scene->_object8.remove(); setDelay(5); break; @@ -425,11 +425,11 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { setAction(&_action13); break; case 2200: - _globals->_soundHandler.startSound(111); + _globals->_soundHandler.play(111); setAction(&_action14); break; case 2222: - _globals->_soundHandler.startSound(115); + _globals->_soundHandler.play(115); setAction(&_action8); break; case 3500: @@ -437,12 +437,12 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { break; default: _object6.remove(); - _globals->_soundHandler.startSound(80); + _globals->_soundHandler.play(80); setAction(&_action6); break; } - _soundHandler1.startSound(78); + _soundHandler1.play(78); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; } @@ -502,7 +502,7 @@ void Scene2100::Action1::signal() { break; } case 2: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 3: { @@ -551,7 +551,7 @@ void Scene2100::Action1::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -560,7 +560,7 @@ void Scene2100::Action1::signal() { if (_state == 2100) { setDelay(1); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); } break; @@ -576,7 +576,7 @@ void Scene2100::Action1::signal() { break; case 7: _globals->_player.fixPriority(-1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 8: @@ -775,17 +775,17 @@ void Scene2100::Action9::signal() { scene->_stripManager.start(6050, this); break; case 2: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler.startSound(12); + scene->_soundHandler.play(12); scene->_object4.setStrip(2); scene->_stripManager.start(6051, this, scene); break; case 4: - scene->_soundHandler.proc1(0/* was false */); + scene->_soundHandler.fadeOut(0/* was false */); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -846,7 +846,7 @@ void Scene2100::Action10::signal() { break; } case 5: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { @@ -879,7 +879,7 @@ void Scene2100::Action10::signal() { setDelay(45); break; case 9: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 10: @@ -923,7 +923,7 @@ void Scene2100::Action11::signal() { break; } case 3: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 4: { @@ -944,7 +944,7 @@ void Scene2100::Action11::signal() { setDelay(45); break; case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 7: @@ -969,7 +969,7 @@ void Scene2100::Action12::signal() { scene->_stripManager.start(6000, this); break; case 2: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 3: { @@ -983,7 +983,7 @@ void Scene2100::Action12::signal() { break; } case 4: { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, NULL); _globals->_player.fixPriority(-1); @@ -1095,7 +1095,7 @@ void Scene2100::Action14::signal() { scene->_stripManager.start(6008, this); break; case 4: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; @@ -1104,7 +1104,7 @@ void Scene2100::Action14::signal() { scene->_stripManager.start(6009, this, scene); break; case 6: - scene->_soundHandler.proc1(0/* was false */); + scene->_soundHandler.fadeOut(0/* was false */); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -1135,7 +1135,7 @@ void Scene2100::Action14::signal() { break; } case 10: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 11: { @@ -1150,7 +1150,7 @@ void Scene2100::Action14::signal() { break; case 13: scene->_object3.fixPriority(1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 14: @@ -1179,7 +1179,7 @@ void Scene2100::Action15::signal() { scene->_object3.fixPriority(1); scene->_object3.changeZoom(-1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 2: { @@ -1190,7 +1190,7 @@ void Scene2100::Action15::signal() { break; } case 3: { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); Common::Point pt(272, 140); @@ -1250,7 +1250,7 @@ void Scene2100::Action16::signal() { break; } case 5: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { @@ -1265,7 +1265,7 @@ void Scene2100::Action16::signal() { setDelay(45); break; case 8: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_object1.animate(ANIM_MODE_6, this); break; case 9: @@ -1294,17 +1294,17 @@ void Scene2100::Action17::signal() { scene->_stripManager.start(7070, this); break; case 4: - scene->_soundHandler.startSound(99); + scene->_soundHandler.play(99); scene->_object4.show(); scene->_object4.animate(ANIM_MODE_5, this); break; case 5: - scene->_soundHandler.startSound(12); + scene->_soundHandler.play(12); scene->_object4.setStrip(2); scene->_stripManager.start(7071, this, scene); break; case 6: - scene->_soundHandler.proc1(NULL); + scene->_soundHandler.fadeOut(NULL); scene->_object4.setStrip(1); scene->_object4.setFrame(scene->_object4.getFrameCount()); scene->_object4.animate(ANIM_MODE_6, this); @@ -1687,8 +1687,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _object1.fixPriority(-1); _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(80, 66)); @@ -1755,8 +1755,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { } break; case 3700: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); Scene::setZoomPercents(80, 75, 100, 90); if (_globals->_sceneObjects->contains(&_object2)) @@ -1774,8 +1774,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2105, &_object3, NULL); break; case 4250: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->clearFlag(43); _globals->_player.setVisage(2104); @@ -1793,8 +1793,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2107, &_object4, NULL); break; case 5000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (_globals->_sceneObjects->contains(&_object2)) _object2.remove(); @@ -1810,8 +1810,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action5); break; case 5100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); @@ -1829,8 +1829,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action9); break; case 7000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (RING_INVENTORY._stasisBox2._sceneNumber == 1) { _globals->_player.fixPriority(1); @@ -1857,8 +1857,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { } break; case 7600: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if (_globals->_sceneObjects->contains(&_object2)) _object2.remove(); @@ -1869,8 +1869,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action8); break; case 8100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); @@ -1882,8 +1882,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2106, NULL); break; case 9750: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setVisage(2104); _globals->_player.setFrame(1); @@ -1900,8 +1900,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 2103, &_object4, NULL); break; default: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player._uiEnabled = true; break; @@ -2070,7 +2070,7 @@ void Scene2120::Action1::dispatch() { _actionIndex = !_entries[scene->_subjectIndex]._visage ? 4 : 3; setDelay(30); - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Next Page button handling @@ -2101,7 +2101,7 @@ void Scene2120::Action1::dispatch() { setDelay(30); } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Previous Page button handling @@ -2128,7 +2128,7 @@ void Scene2120::Action1::dispatch() { break; } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } // Exit button handling @@ -2158,7 +2158,7 @@ void Scene2120::Action1::dispatch() { setDelay(1); } - scene->_soundHandler.startSound(159); + scene->_soundHandler.play(159); } } @@ -2228,7 +2228,7 @@ void Scene2150::Action1::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 2: { @@ -2278,7 +2278,7 @@ void Scene2150::Action1::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -2287,7 +2287,7 @@ void Scene2150::Action1::signal() { if (_state == 2150) { setDelay(1); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_6, this); } break; @@ -2302,7 +2302,7 @@ void Scene2150::Action1::signal() { } break; case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot1.animate(ANIM_MODE_6, this); break; case 7: @@ -2329,10 +2329,10 @@ void Scene2150::Action2::signal() { _globals->_player.setStrip(8); _globals->_player.animate(ANIM_MODE_8, 1, this); - scene->_soundHandler.startSound(163); + scene->_soundHandler.play(163); break; case 2: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot10.animate(ANIM_MODE_5, this); break; case 3: @@ -2357,7 +2357,7 @@ void Scene2150::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 5: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot10.animate(ANIM_MODE_6, NULL); scene->_hotspot14.remove(); @@ -2555,8 +2555,8 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.setPosition(Common::Point(108, 99)); break; case 2200: @@ -2705,7 +2705,7 @@ void Scene2200::Action3::signal() { switch (_actionIndex++) { case 0: { - scene->_soundHandler2.startSound(103); + scene->_soundHandler2.play(103); scene->_hotspot4.setStrip(4); scene->_hotspot4.animate(ANIM_MODE_NONE, NULL); @@ -2722,7 +2722,7 @@ void Scene2200::Action3::signal() { break; } case 1: - scene->_soundHandler2.startSound(104); + scene->_soundHandler2.play(104); scene->_hotspot4.setStrip(2); scene->_hotspot4.setFrame(2); setDelay(120); @@ -2878,7 +2878,7 @@ void Scene2200::Hotspot9::doAction(int action) { break; case OBJECT_INFODISK: if (_globals->_sceneManager._previousScene == 2310) { - scene->_soundHandler2.startSound(35); + scene->_soundHandler2.play(35); _globals->_player.disableControl(); scene->setAction(&scene->_action3); } @@ -2939,8 +2939,8 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot8.remove(); break; case 4000: - _globals->_soundHandler.startSound(100); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(100); + _globals->_soundHandler.holdAt(true); _globals->_player.remove(); _hotspot5.remove(); _hotspot8.remove(); @@ -2980,9 +2980,9 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot4.fixPriority(255); _globals->_sceneItems.push_back(&_hotspot4); - _soundHandler1.startSound(101); - _soundHandler2.startSound(100); - _globals->_soundHandler.proc5(true); + _soundHandler1.play(101); + _soundHandler2.play(100); + _globals->_soundHandler.holdAt(true); _globals->_sceneItems.push_back(&_hotspot5); setAction(&_action2); @@ -3135,7 +3135,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } - _soundHandler.startSound(116); + _soundHandler.play(116); _globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position); _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); @@ -3221,7 +3221,7 @@ void Scene2230::Action2::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler.startSound(157); + scene->_soundHandler.play(157); _globals->_player._moveDiff = Common::Point(1, 1); _globals->_player.setAction(&scene->_action4); _globals->_player._uiEnabled = true; @@ -3245,7 +3245,7 @@ void Scene2230::Action3::signal() { NpcMover *mover = new NpcMover(); _globals->_player.addMover(mover, &pt, this); - scene->_soundHandler.proc3(); + scene->_soundHandler.stop(); break; } case 1: @@ -3364,7 +3364,7 @@ void Scene2230::Action7::signal() { break; } case 2: { - scene->_soundHandler.startSound(158); + scene->_soundHandler.play(158); scene->_hotspot8.setStrip2(2); Common::Point pt(scene->_hotspot8._position.x, 97); @@ -3447,7 +3447,7 @@ void Scene2230::Action8::signal() { scene->_hotspot2.animate(ANIM_MODE_6, this); break; case 4: { - scene->_soundHandler.startSound(158); + scene->_soundHandler.play(158); scene->_hotspot2.remove(); scene->_hotspot8._frame = 1; @@ -3770,7 +3770,7 @@ void Scene2280::Action1::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot16.animate(ANIM_MODE_5, this); break; case 2: { @@ -3785,7 +3785,7 @@ void Scene2280::Action1::signal() { break; case 4: _globals->_player.fixPriority(1); - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot16.animate(ANIM_MODE_6, this); break; case 5: @@ -3806,7 +3806,7 @@ void Scene2280::Action2::signal() { break; } case 1: - scene->_soundHandler.startSound(265); + scene->_soundHandler.play(265); _globals->_player.setVisage(2162); _globals->_player._frame = 1; @@ -3826,7 +3826,7 @@ void Scene2280::Action2::signal() { scene->_hotspot12.remove(); break; case 4: - scene->_soundHandler.startSound(266); + scene->_soundHandler.play(266); _globals->_player.setVisage(2170); _globals->_player._frame = 1; _globals->_player._strip = 4; @@ -3854,7 +3854,7 @@ void Scene2280::Action3::signal() { break; } case 1: - scene->_soundHandler.startSound(265); + scene->_soundHandler.play(265); _globals->_player.setVisage(2162); _globals->_player._frame = 6; @@ -4334,8 +4334,8 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _sceneMode = 2281; setAction(&_sequenceManager, this, 2281, &_globals->_player, &_hotspot16, NULL); - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); } _globals->_sceneItems.addItems(&_hotspot13, &_hotspot11, &_hotspot9, &_hotspot14, &_hotspot7, @@ -4385,7 +4385,7 @@ void Scene2300::Action1::signal() { } case 2: { scene->_hotspot8.setAction(&scene->_action4); - scene->_soundHandler2.startSound(21); + scene->_soundHandler2.play(21); Common::Point pt1(95, scene->_hotspot5._position.y); NpcMover *mover1 = new NpcMover(); @@ -4423,7 +4423,7 @@ void Scene2300::Action1::signal() { break; } case 6: - scene->_soundHandler1.startSound(28); + scene->_soundHandler1.play(28); _globals->_player.disableControl(); scene->_hotspot2.setVisage(40); @@ -4437,7 +4437,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 7: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 8: _globals->_game->endGame(2300, 0); @@ -4464,7 +4464,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 11: - scene->_soundHandler1.startSound(28); + scene->_soundHandler1.play(28); scene->_hotspot5._strip = 2; scene->_hotspot6._strip = 2; @@ -4481,7 +4481,7 @@ void Scene2300::Action1::signal() { _globals->_player.animate(ANIM_MODE_6, this); break; case 12: - scene->_soundHandler1.startSound(77); + scene->_soundHandler1.play(77); _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setStrip(4); @@ -4558,8 +4558,8 @@ void Scene2300::Action2::signal() { scene->_hotspot2.setFrame(1); scene->_hotspot2.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(28); - scene->_soundHandler2.startSound(97); + scene->_soundHandler1.play(28); + scene->_soundHandler2.play(97); break; case 7: scene->_hotspot7._strip = 2; @@ -4602,8 +4602,8 @@ void Scene2300::Action3::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 3: - scene->_soundHandler1.startSound(97); - scene->_soundHandler2.startSound(28); + scene->_soundHandler1.play(97); + scene->_soundHandler2.play(28); scene->_hotspot7._strip = 2; scene->_hotspot7._frame = 1; @@ -4615,7 +4615,7 @@ void Scene2300::Action3::signal() { _globals->_player.animate(ANIM_MODE_6, NULL); break; case 4: - scene->_soundHandler2.startSound(97); + scene->_soundHandler2.play(97); _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setStrip(1); @@ -4636,7 +4636,7 @@ void Scene2300::Action4::signal() { switch (_actionIndex++) { case 0: scene->_hotspot8.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 1: scene->_hotspot9.postInit(); @@ -4646,7 +4646,7 @@ void Scene2300::Action4::signal() { scene->_hotspot9.setPosition(Common::Point(273, 199)); scene->_hotspot9.fixPriority(19); scene->_hotspot9.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 2: scene->_hotspot8.remove(); @@ -4657,10 +4657,10 @@ void Scene2300::Action4::signal() { scene->_hotspot10.setFrame(4); scene->_hotspot10.setPosition(Common::Point(292, 113)); scene->_hotspot10.animate(ANIM_MODE_5, this); - scene->_soundHandler1.startSound(11); + scene->_soundHandler1.play(11); break; case 3: - scene->_soundHandler1.startSound(13); + scene->_soundHandler1.play(13); remove(); break; } @@ -4736,7 +4736,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot8.setVisage(2301); _hotspot8.setPosition(Common::Point(288, 74)); - _globals->_soundHandler.startSound(96); + _globals->_soundHandler.play(96); if (_globals->_sceneManager._previousScene == 2000) { _hotspot8.remove(); @@ -4767,8 +4767,8 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot7.setPosition(Common::Point(229, 125)); _hotspot7._numFrames = 5; - _soundHandler1.startSound(95); - _soundHandler2.startSound(96); + _soundHandler1.play(95); + _soundHandler2.play(96); _globals->_sceneItems.push_back(&_hotspot7); setAction(&_action2); @@ -5051,7 +5051,7 @@ void Scene2320::Action2::signal() { switch (_actionIndex++) { case 0: { - scene->_soundHandler.startSound(253); + scene->_soundHandler.play(253); scene->_hotspot13.fixPriority(99); Common::Point pt(scene->_hotspot13._position.x, 200); @@ -5077,7 +5077,7 @@ void Scene2320::Action3::signal() { break; } case 1: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: { @@ -5126,7 +5126,7 @@ void Scene2320::Action3::signal() { } } - scene->_soundHandler.startSound(161); + scene->_soundHandler.play(161); scene->_area1.restore(); scene->_area2.restore(); scene->_area3.restore(); @@ -5135,7 +5135,7 @@ void Scene2320::Action3::signal() { if (_state == 2320) { setDelay(10); } else { - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_6, this); } break; @@ -5151,7 +5151,7 @@ void Scene2320::Action3::signal() { break; } case 6: - scene->_soundHandler.startSound(162); + scene->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_6, this); break; case 7: @@ -5236,8 +5236,8 @@ void Scene2320::Action4::signal() { break; case 10: if (_globals->getFlag(109)) { - _globals->_soundHandler.startSound(40); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(40); + _globals->_soundHandler.holdAt(true); Common::Point pt(303, 240); NpcMover *mover = new NpcMover(); @@ -5296,7 +5296,7 @@ void Scene2320::Action4::signal() { } case 19: { scene->_hotspot16.remove(); - scene->_soundHandler.startSound(253); + scene->_soundHandler.play(253); scene->_hotspot13.show(); Common::Point pt(319, 157); @@ -5447,7 +5447,7 @@ void Scene2320::Action7::signal() { setDelay(30); break; case 1: - _globals->_soundHandler.startSound(162); + _globals->_soundHandler.play(162); scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: @@ -5872,8 +5872,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2120: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(389, 72)); @@ -5890,8 +5890,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { case 4250: case 5000: case 7000: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); if ((_globals->_sceneManager._previousScene == 7000) && !_globals->getFlag(80)) _globals->setFlag(36); @@ -5907,8 +5907,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_action6); break; case 6100: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _hotspot8.postInit(); _hotspot8.setVisage(2345); @@ -5919,9 +5919,9 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; case 7600: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); - _soundHandler.startSound(21); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); + _soundHandler.play(21); _globals->_player.setVisage(2323); _globals->_player.setStrip(2); @@ -5978,8 +5978,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL); break; default: - _globals->_soundHandler.startSound(160); - _globals->_soundHandler.proc5(true); + _globals->_soundHandler.play(160); + _globals->_soundHandler.holdAt(true); _sceneMode = 2321; _globals->_player.setStrip(3); @@ -6110,7 +6110,7 @@ void Scene2400::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; - _globals->_soundHandler.startSound(153); + _globals->_soundHandler.play(153); } } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index 3c3b90db56..6699ec5d1e 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -114,7 +114,7 @@ public: Action14 _action14; SceneObject _object1, _object2, _object3, _object4, _object5; SceneObject _object6, _object7, _object8, _object9, _object10; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void stripCallback(int v); @@ -232,7 +232,7 @@ class Scene2100 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerMText _speakerMText; SpeakerMR _speakerMR; SpeakerQL _speakerQL; @@ -311,7 +311,7 @@ class Scene2120 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SceneObject _topicArrowHotspot, _arrowHotspot, _visageHotspot; SceneObject _subjectButton, _nextPageButton, _previousPageButton, _exitButton; Action1 _action1; @@ -359,7 +359,7 @@ class Scene2150 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerGameText _speakerGameText; @@ -440,7 +440,7 @@ public: DisplayHotspot _hotspot10; SceneObject _hotspot2, _hotspot4; SceneObject _hotspot6, _hotspot7, _hotspot8; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; Scene2200(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -462,7 +462,7 @@ class Scene2222 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSText _speakerSText; SpeakerMText _speakerMText; SpeakerQText _speakerQText; @@ -552,7 +552,7 @@ class Scene2230 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; Action2 _action2; Action3 _action3; @@ -652,7 +652,7 @@ class Scene2280 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; Rect _exitRect; Action1 _action1; @@ -712,7 +712,7 @@ class Scene2300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SpeakerSL _speakerSL; SpeakerMText _speakerMText; SpeakerQText _speakerQText; @@ -834,7 +834,7 @@ class Scene2320 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager1, _sequenceManager2; SpeakerMText _speakerMText; SpeakerMR _speakerMR; diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp index 883da9b5b1..838769e4af 100644 --- a/engines/tsage/ringworld_scenes4.cpp +++ b/engines/tsage/ringworld_scenes4.cpp @@ -178,7 +178,7 @@ void Scene3700::Action1::signal() { setDelay(90); break; case 3: - scene->_soundHandler.startSound(196); + scene->_soundHandler.play(196); scene->_viewer.hide(); scene->_hotspot1.postInit(); @@ -190,7 +190,7 @@ void Scene3700::Action1::signal() { setDelay(90); break; case 4: - scene->_soundHandler.startSound(197); + scene->_soundHandler.play(197); scene->_hotspot1.hide(); scene->_hotspot2.postInit(); @@ -202,7 +202,7 @@ void Scene3700::Action1::signal() { setDelay(30); break; case 5: - scene->_soundHandler.startSound(198); + scene->_soundHandler.play(198); scene->_hotspot2.hide(); scene->_hotspot1.show(); setDelay(90); @@ -244,7 +244,7 @@ void Scene3700::postInit(tSage::SceneObjectList *OwnerList) { _viewer.setPosition(Common::Point(195, 83)); setAction(&_action1); - _globals->_soundHandler.startSound(195); + _globals->_soundHandler.play(195); } } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h index 389c67b83a..0b575d02d3 100644 --- a/engines/tsage/ringworld_scenes4.h +++ b/engines/tsage/ringworld_scenes4.h @@ -82,7 +82,7 @@ public: SpeakerSText _speakerSText; SpeakerMText _speakerMText; SpeakerMR _speakerMR; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index fc7362c380..cdd0236cf8 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -101,7 +101,7 @@ void Scene4000::Action1::signal() { ADD_MOVER_NULL(scene->_hotspot5, -40, 86); break; case 5: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->setFlag(43); _globals->setFlag(114); scene->_stripManager.start(4430, this); @@ -345,14 +345,14 @@ void Scene4000::Action8::signal() { setDelay(60); break; case 3: - _globals->_soundHandler.startSound(170); + _globals->_soundHandler.play(170); scene->_smoke2.setVisage(4000); scene->_smoke2.setStrip(6); scene->_smoke2.animate(ANIM_MODE_2, NULL); setDelay(60); break; case 4: - _globals->_soundHandler.startSound(77, this); + _globals->_soundHandler.play(77, this); break; case 5: _globals->_game->endGame(4000, 15); @@ -418,7 +418,7 @@ void Scene4000::Action11::signal() { scene->_olo.animate(ANIM_MODE_1, NULL); break; case 5: - scene->_soundHandler1.proc3(); + scene->_soundHandler1.stop(); scene->_forceField.remove(); ADD_MOVER(_globals->_player, 340, 163); @@ -481,12 +481,12 @@ void Scene4000::Action13::signal() { setDelay(3); break; case 1: - scene->_soundHandler2.startSound(151); - scene->_soundHandler2.proc5(true); + scene->_soundHandler2.play(151); + scene->_soundHandler2.holdAt(true); ADD_MOVER(scene->_lander, -30, 70); break; case 2: - scene->_soundHandler2.proc4(); + scene->_soundHandler2.release(); _globals->_sceneManager.changeScene(4010); break; } @@ -851,7 +851,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _theTech.setPosition(Common::Point(281, 176)); if (_globals->getFlag(34)) { - _soundHandler1.startSound(156); + _soundHandler1.play(156); _forceField.postInit(); _forceField.setVisage(4000); @@ -884,7 +884,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { switch (_globals->_sceneManager._previousScene) { case 2320: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); if (RING_INVENTORY._ale._sceneNumber == 1) { _guardRock.postInit(); @@ -946,7 +946,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { } if (_globals->_stripNum == 4025) { - _soundHandler1.startSound(182); + _soundHandler1.play(182); _forceField.remove(); _hotspot5.postInit(); @@ -1024,7 +1024,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; case 4050: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->_player.disableControl(); if (_globals->_stripNum == 4050) { @@ -1061,7 +1061,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { break; default: - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _lander.postInit(); _lander.setVisage(4002); @@ -1085,7 +1085,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { RING_INVENTORY._ladder._sceneNumber = 4100; RING_INVENTORY._rope._sceneNumber = 4150; - _soundHandler1.startSound(156); + _soundHandler1.play(156); _forceField.postInit(); _forceField.setVisage(4000); @@ -1224,8 +1224,8 @@ void Scene4000::dispatch() { if ((RING_INVENTORY._peg._sceneNumber == 1) && _globals->getFlag(34) && _globals->getFlag(37) && !_globals->getFlag(40)) { _globals->_player.disableControl(); - _soundHandler1.startSound(177); - _globals->_soundHandler.startSound(178); + _soundHandler1.play(177); + _globals->_soundHandler.play(178); setAction(&_action1); } @@ -1873,7 +1873,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _olloFace.fixPriority(152); if(_globals->_sceneManager._previousScene == 4050) { - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); _globals->_player.setPosition(Common::Point(72, 128)); _globals->_player.enableControl(); @@ -2254,7 +2254,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.setStrip(2); setAction(&_action2); - _globals->_soundHandler.startSound(175); + _globals->_soundHandler.play(175); } else { // Without the rope _globals->_player.setVisage(5315); @@ -2265,7 +2265,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_2, NULL); setAction(&_action4); - _globals->_soundHandler.startSound(176); + _globals->_soundHandler.play(176); } break; case 4045: @@ -2279,7 +2279,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setPosition(Common::Point(193, 193)); - _globals->_soundHandler.startSound(175); + _globals->_soundHandler.play(175); break; default: break; @@ -2698,7 +2698,7 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { &_hotspot11, &_hotspot9, &_hotspot7, &_hotspot10, &_hotspot8, &_hotspot14, NULL); if (_globals->_sceneManager._previousScene == 4150) { - _globals->_soundHandler.startSound(155); + _globals->_soundHandler.play(155); if (!_globals->getFlag(42)) { _hotspot1.setVisage(4104); @@ -3072,8 +3072,8 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { &_hotspot10, &_hotspot9, &_hotspot8, &_hotspot7, &_hotspot6, &_hotspot2, &_hotspot5, NULL); - _globals->_soundHandler.startSound(165); - _soundHandler.startSound(311); + _globals->_soundHandler.play(165); + _soundHandler.play(311); } void Scene4150::signal() { @@ -3087,7 +3087,7 @@ void Scene4150::dispatch() { Scene::dispatch(); if (!_action && (_globals->_player._position.x >= 316)) { - _globals->_soundHandler.proc1(NULL); + _globals->_soundHandler.fadeOut(NULL); _globals->_player.disableControl(); _sceneMode = 4152; setAction(&_sequenceManager, this, 4152, &_globals->_player, NULL); @@ -3390,7 +3390,7 @@ void Scene4250::Hotspot6::doAction(int action) { SceneItem::display2(4250, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 20 : 3); break; case OBJECT_HELMET: - _globals->_soundHandler.startSound(354); + _globals->_soundHandler.play(354); _globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 4250; @@ -3419,7 +3419,7 @@ void Scene4250::Hotspot6::doAction(int action) { break; case OBJECT_NULLIFIER: if (RING_INVENTORY._helmet._sceneNumber == 4250) { - _globals->_soundHandler.startSound(353); + _globals->_soundHandler.play(353); _globals->_player.disableControl(); RING_INVENTORY._helmet._sceneNumber = 1; @@ -3626,7 +3626,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) { _hotspot7.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _globals->_sceneItems.push_back(&_hotspot7); - _globals->_soundHandler.startSound(185); + _globals->_soundHandler.play(185); } void Scene4250::signal() { @@ -3659,7 +3659,7 @@ void Scene4250::signal() { _globals->_player.enableControl(); break; case 4259: - _globals->_soundHandler.startSound(360); + _globals->_soundHandler.play(360); _globals->_sceneManager.changeScene(9900); break; case 4261: @@ -3727,36 +3727,36 @@ void Scene4300::Action1::signal() { _globals->setFlag(56); _globals->_scenePalette.addRotation(240, 254, -1); scene->_hotspot7.animate(ANIM_MODE_6, this); - _globals->_soundHandler.startSound(164); + _globals->_soundHandler.play(164); break; case 1: - _globals->_soundHandler.startSound(340); - scene->_soundHandler1.startSound(341); + _globals->_soundHandler.play(340); + scene->_soundHandler1.play(341); scene->_hotspot1.remove(); setDelay(3); break; case 2: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot2.remove(); setDelay(6); break; case 3: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot3.remove(); setDelay(6); break; case 4: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot4.remove(); setDelay(12); break; case 5: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot5.remove(); setDelay(12); break; case 6: - scene->_soundHandler1.startSound(341); + scene->_soundHandler1.play(341); scene->_hotspot6.remove(); setDelay(60); break; @@ -3769,7 +3769,7 @@ void Scene4300::Action1::signal() { scene->_stripManager.start(8015, this, scene); break; case 9: - _globals->_soundHandler.startSound(350); + _globals->_soundHandler.play(350); _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_events.setCursor(CURSOR_USE); _globals->_player.enableControl(); @@ -3892,7 +3892,7 @@ void Scene4300::Hotspot10::doAction(int action) { void Scene4300::Hotspot15::signal() { Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene; - scene->_soundHandler2.startSound(345); + scene->_soundHandler2.play(345); _strip = (_globals->_randomSource.getRandomNumber(6) < 2) ? 2 : 1; if ((RING_INVENTORY._stasisBox2._sceneNumber == 4300) || @@ -3958,7 +3958,7 @@ void Scene4300::Hotspot17::doAction(int action) { SceneItem::display2(4300, 26); break; case OBJECT_STASIS_BOX2: - scene->_soundHandler1.startSound(352); + scene->_soundHandler1.play(352); _globals->_events.setCursor(CURSOR_USE); scene->_sceneMode = 4303; @@ -4217,11 +4217,11 @@ void Scene4301::Action1::signal() { switch (_actionIndex++) { case 0: - scene->_soundHandler.startSound(164); + scene->_soundHandler.play(164); scene->_hotspot1.animate(ANIM_MODE_5, this); break; case 1: - _globals->_soundHandler.startSound(335); + _globals->_soundHandler.play(335); _globals->_events.setCursor(CURSOR_USE); scene->_hotspot2.postInit(); @@ -4246,7 +4246,7 @@ void Scene4301::Action1::signal() { case 10: // Puzzle: Wrong code _globals->_events.setCursor(CURSOR_NONE); - scene->_soundHandler.startSound(337); + scene->_soundHandler.play(337); if (scene->_hotspot3._flags & OBJFLAG_HIDE) scene->_hotspot3.show(); else @@ -4261,7 +4261,7 @@ void Scene4301::Action1::signal() { for (_state = 0; _state < 6; ++_state) _buttonList[_state].remove(); - scene->_soundHandler.startSound(338); + scene->_soundHandler.play(338); scene->_hotspot3.hide(); _actionIndex = 2; @@ -4271,7 +4271,7 @@ void Scene4301::Action1::signal() { case 20: // Puzzle: Correct code _globals->_player.disableControl(); - scene->_soundHandler.startSound(339); + scene->_soundHandler.play(339); scene->_hotspot3._frame = 3; if (scene->_hotspot3._flags & OBJFLAG_HIDE) scene->_hotspot3.show(); @@ -4305,7 +4305,7 @@ void Scene4301::Action1::process(Event &event) { if ((event.eventType == EVENT_BUTTON_DOWN) && buttonsRect.contains(event.mousePos)) { event.handled = true; - scene->_soundHandler.startSound(336); + scene->_soundHandler.play(336); int buttonIndex = ((event.mousePos.y - buttonsRect.top) / 33) * 3 + ((event.mousePos.x - buttonsRect.left) / 33); diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index a2991c7283..c3ae9f4aa9 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -134,7 +134,7 @@ class Scene4000 : public Scene { }; public: SequenceManager _sequenceManager1, _sequenceManager2, _sequenceManager3; - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SpeakerQR _speakerQR; SpeakerML _speakerML; SpeakerMR _speakerMR; @@ -471,7 +471,7 @@ class Scene4150 : public Scene { public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerQText _speakerQText; SpeakerQR _speakerQR; SpeakerCDL _speakerCDL; @@ -541,7 +541,7 @@ class Scene4250 : public Scene { public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSR _speakerSR; SpeakerSL _speakerSL; SpeakerSText _speakerSText; @@ -613,7 +613,7 @@ class Scene4300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler1, _soundHandler2; + ASound _soundHandler1, _soundHandler2; SequenceManager _sequenceManager; GfxButton _gfxButton; SpeakerQText _speakerQText; @@ -672,7 +672,7 @@ class Scene4301 : public Scene { public: Common::List _list1; SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; Action1 _action1; SceneObject _hotspot1, _hotspot2, _hotspot3; Hotspot4 _hotspot4; diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 958c0ef9e2..edcd638dd7 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -41,8 +41,8 @@ void Scene5000::Action1::signal() { setDelay(10); break; case 1: - scene->_soundHandler.startSound(190); - scene->_soundHandler.proc5(true); + scene->_soundHandler.play(190); + scene->_soundHandler.holdAt(true); ADD_MOVER(scene->_hotspot1, 283, 12); break; case 2: @@ -55,7 +55,7 @@ void Scene5000::Action1::signal() { setDelay(15); break; case 4: - scene->_soundHandler.proc4(); + scene->_soundHandler.release(); ADD_MOVER(scene->_hotspot1, 233, 80); break; case 5: @@ -561,7 +561,7 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { break; } - _globals->_soundHandler.startSound(190); + _globals->_soundHandler.play(190); } void Scene5000::signal() { @@ -638,7 +638,7 @@ void Scene5100::Action1::signal() { } break; case 4: - scene->_soundHandler.startSound(206); + scene->_soundHandler.play(206); scene->_hotspot5.postInit(); scene->_hotspot5.setVisage(5362); @@ -737,7 +737,7 @@ void Scene5100::Action3::signal() { _globals->_player.animate(ANIM_MODE_5, this); break; case 2: - scene->_soundHandler.startSound(28); + scene->_soundHandler.play(28); if (static_cast(_owner)->_position.x < _globals->_player._position.x) { scene->_hotspot2.setVisage(5130); scene->_hotspot2._strip = 1; @@ -783,7 +783,7 @@ void Scene5100::Action4::signal() { switch (_actionIndex++) { case 0: { _globals->_player.disableControl(); - scene->_soundHandler.startSound(208); + scene->_soundHandler.play(208); SceneItem::display2(5100, 15); ObjectMover3 *mover = new ObjectMover3(); @@ -1284,7 +1284,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); loadScene(5100); - _globals->_soundHandler.startSound(205); + _globals->_soundHandler.play(205); } void Scene5100::signal() { @@ -1380,7 +1380,7 @@ void Scene5100::dispatch() { _globals->_player.disableControl(); _globals->_player.addMover(NULL); - _soundHandler.startSound(207); + _soundHandler.play(207); _sceneMode = 5103; setAction(&_sequenceManager, this, (_globals->_player._position.x >= 966) ? 5104 : 5103, &_globals->_player, &_hotspot15, NULL); @@ -1391,7 +1391,7 @@ void Scene5100::dispatch() { (_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) { setAction(NULL); _sceneMode = 5150; - _soundHandler.startSound(208); + _soundHandler.play(208); if (RING_INVENTORY._vial._sceneNumber == 5100) { _globals->_player.addMover(NULL); @@ -1466,7 +1466,7 @@ void Scene5200::Action2::signal() { _globals->_player.animate(ANIM_MODE_4, 3, 1, this); break; case 2: - scene->_soundHandler.proc3(); + scene->_soundHandler.stop(); scene->_hotspot14.remove(); RING_INVENTORY._stasisBox._sceneNumber = 1; @@ -1481,7 +1481,7 @@ void Scene5200::Action2::signal() { ADD_MOVER(scene->_hotspot8, 141, 77); break; case 4: - scene->_soundHandler.startSound(303); + scene->_soundHandler.play(303); scene->_hotspot8._strip = 2; scene->_hotspot8._frame = 1; @@ -1518,7 +1518,7 @@ void Scene5200::Action4::signal() { setDelay(120); break; case 1: - _globals->_soundHandler.startSound(209); + _globals->_soundHandler.play(209); scene->_stripManager.start(5202, this, scene); break; case 2: @@ -1617,8 +1617,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _speakerQText._textPos.x = 20; if (RING_INVENTORY._stasisBox._sceneNumber == 5200) { - _soundHandler.startSound(216); - _soundHandler.proc5(true); + _soundHandler.play(216); + _soundHandler.holdAt(true); _hotspot14.postInit(); _hotspot14.setVisage(5202); @@ -1638,7 +1638,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { // Happens when the player enters the throne room via the secret passage, // after talking with the bat. No NPCs are around and the player can // obtain the stasis box. - _globals->_soundHandler.startSound(205); + _globals->_soundHandler.play(205); _globals->_player.disableControl(); _globals->_player.postInit(); @@ -2116,7 +2116,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot8._sceneRegionId = 8; _globals->_sceneItems.addItems(&_hotspot8, &_hotspot2, &_hotspot6, &_hotspot3, &_hotspot7, NULL); - _globals->_soundHandler.startSound(212); + _globals->_soundHandler.play(212); } void Scene5300::signal() { @@ -2126,7 +2126,7 @@ void Scene5300::signal() { _globals->_sceneManager.changeScene(5100); break; case 5307: - _soundHandler.proc1(NULL); + _soundHandler.fadeOut(NULL); // No break on purpose case 5302: case 5308: diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h index 6ac73d4bff..2e99f5ab87 100644 --- a/engines/tsage/ringworld_scenes6.h +++ b/engines/tsage/ringworld_scenes6.h @@ -75,7 +75,7 @@ class Scene5000 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerSText _speakerSText; SpeakerQText _speakerQText; Action1 _action1; @@ -163,7 +163,7 @@ class Scene5100 : public Scene { }; public: SequenceManager _sequenceManager; - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerMText _speakerMText; SpeakerQText _speakerQText; SpeakerSText _speakerSText; @@ -226,7 +226,7 @@ class Scene5200 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SpeakerFLL _speakerFLL; SpeakerFLText _speakerFLText; SpeakerQL _speakerQL; @@ -291,7 +291,7 @@ class Scene5300 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerQR _speakerQR; SpeakerQL _speakerQL; diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 05306fb450..f37a9346a7 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -59,7 +59,7 @@ void Scene7000::Action1::signal() { setAction(&scene->_action6, this); break; case 2: - scene->_soundHandler.startSound(252); + scene->_soundHandler.play(252); scene->_object8.remove(); scene->_object1.postInit(); scene->_object1.setVisage(7003); @@ -182,7 +182,7 @@ void Scene7000::Action4::signal() { setDelay(300); break; case 2: - _globals->_soundHandler.startSound(252); + _globals->_soundHandler.play(252); scene->_object1.show(); scene->_object1.setStrip(3); scene->_object1.setFrame(1); @@ -212,7 +212,7 @@ void Scene7000::Action5::signal() { } case 1: _globals->_player.checkAngle(&scene->_object1); - _globals->_soundHandler.startSound(252); + _globals->_soundHandler.play(252); scene->_object1.setStrip(2); scene->_stripManager.start(7015, this); break; @@ -542,7 +542,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_8, 0, NULL); _globals->_sceneItems.push_back(&_object1); } - _soundHandler.startSound(251); + _soundHandler.play(251); if (_globals->_sceneManager._previousScene == 2100) { if (_globals->getFlag(72)) { _globals->_player.postInit(); @@ -561,7 +561,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { setAction(&_action1); } } else { - _globals->_soundHandler.startSound(250); + _globals->_soundHandler.play(250); _globals->setFlag(72); _object3.postInit(); @@ -607,9 +607,10 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.setVisage(5001); _object3.setStrip2(1); _object3.setPosition(Common::Point(307, 0)); - _soundHandler.startSound(151); - _soundHandler.proc5(1); - _globals->_soundHandler.startSound(250); + _soundHandler.play(151); + _soundHandler.holdAt(true); + _globals->_soundHandler.play(250); + setAction(&_action3); } @@ -1131,9 +1132,9 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object1.setPosition(Common::Point(100, 100)); setAction(&_action11); - _soundHandler1.startSound(270); - _soundHandler2.startSound(275); - _globals->_soundHandler.startSound(270); + _soundHandler1.play(270); + _soundHandler2.play(275); + _globals->_soundHandler.play(270); } /*-------------------------------------------------------------------------- * Scene 7200 @@ -1298,7 +1299,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) { _swimmer.setPosition(Common::Point(-8, 16)); setAction(&_action1); - _soundHandler.startSound(271); + _soundHandler.play(271); } /*-------------------------------------------------------------------------- @@ -1340,7 +1341,7 @@ void Scene7300::Action1::signal() { break; case 7: setDelay(3); - _globals->_soundHandler.proc1(NULL); + _globals->_soundHandler.fadeOut(NULL); break; case 8: _globals->_sceneManager.changeScene(2280); @@ -1493,7 +1494,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object8._numFrames = 2; setAction(&_action1); - _globals->_soundHandler.startSound(272); + _globals->_soundHandler.play(272); } /*-------------------------------------------------------------------------- @@ -1597,8 +1598,8 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { } _sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y); loadScene(7600); - _soundHandler2.startSound(255); - _soundHandler1.startSound(251); + _soundHandler2.play(255); + _soundHandler1.play(251); } /*-------------------------------------------------------------------------- @@ -1661,7 +1662,7 @@ void Scene7700::Action3::signal() { setDelay(60); // No break on purpose! case 2: - scene->_soundHandler.startSound(260); + scene->_soundHandler.play(260); scene->_object8.setVisage(7703); scene->_object8.setPosition(Common::Point(177, 97)); scene->_object8.setStrip2(3); @@ -1870,7 +1871,7 @@ void Scene7700::SceneHotspot8::doAction(int action) { break; case CURSOR_USE: scene->_sceneMode = 7709; - scene->_soundHandler.startSound(259); + scene->_soundHandler.play(259); scene->_object15.setFrame(scene->_object15.getFrameCount()); scene->_object15.animate(ANIM_MODE_6, scene); if ((scene->_field977 == 2) && (scene->_field97B == 0)) { @@ -1896,7 +1897,7 @@ void Scene7700::SceneHotspot9::doAction(int action) { break; case CURSOR_USE: scene->_sceneMode = 7709; - scene->_soundHandler.startSound(259); + scene->_soundHandler.play(259); scene->_object15.setFrame(1); scene->_object15.animate(ANIM_MODE_5, scene); if (scene->_field977 > 2) { @@ -2030,7 +2031,7 @@ void Scene7700::Object7::doAction(int action) { break; case OBJECT_STUNNER: if (!_globals->getFlag(78)) { - _globals->_soundHandler.proc3(); + _globals->_soundHandler.stop(); _globals->setFlag(78); setAction(NULL); _globals->_player.disableControl(); @@ -2120,7 +2121,8 @@ void Scene7700::Object9::doAction(int action) { _globals->_sceneItems.push_front(&scene->_object10); scene->_object10.fixPriority(240); } - scene->_soundHandler.startSound(262); + + scene->_soundHandler.play(262); scene->_object14.animate(ANIM_MODE_5, NULL); } _globals->_events.setCursor(CURSOR_WALK); @@ -2218,7 +2220,7 @@ void Scene7700::signal() { } break; case 7702: - _soundHandler.proc1(0); + _soundHandler.fadeOut(0); _globals->_sceneManager.changeScene(7600); break; case 7703: @@ -2229,7 +2231,7 @@ void Scene7700::signal() { _globals->_player.enableControl(); break; case 7704: - _globals->_soundHandler.startSound(256); + _globals->_soundHandler.play(256); _prof.setStrip2(4); _prof.setFrame2(1); _prof.setPosition(Common::Point(159, 87)); @@ -2516,7 +2518,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _sceneMode = 7701; setAction(&_sequenceManager, this, 7701, &_globals->_player, NULL); - _soundHandler.startSound(256); + _soundHandler.play(256); } Scene7700::Scene7700() { diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index 8b183e895f..fe9560d9d8 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -94,7 +94,7 @@ class Scene7000 : public Scene { }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; SpeakerSKText _speakerSKText; SpeakerSKL _speakerSKL; @@ -165,8 +165,8 @@ class Scene7100 : public Scene { }; public: - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; + ASound _soundHandler1; + ASound _soundHandler2; SceneObject _object1; SceneObject _object2; SceneObject _object3; @@ -230,7 +230,7 @@ public: SceneObject _object7; SceneObject _object8; SceneObject _object9; - SoundHandler _soundHandler; + ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -296,8 +296,8 @@ public: SceneObject _object4; SceneObject _object5; SceneObject _object6; - SoundHandler _soundHandler1; - SoundHandler _soundHandler2; + ASound _soundHandler1; + ASound _soundHandler2; virtual void postInit(SceneObjectList *OwnerList = NULL); }; @@ -409,7 +409,7 @@ class Scene7700 : public Scene { virtual void doAction(int action); }; public: - SoundHandler _soundHandler; + ASound _soundHandler; SequenceManager _sequenceManager; GfxButton _gfxButton; SpeakerEText _speakerEText; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index defec1cebd..912bbacadd 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -54,4 +54,95 @@ void SoundManager::listenerSynchronize(Serializer &s) { warning("TODO: SoundManager listenerSynchronize"); } +/*--------------------------------------------------------------------------*/ + +void ASound::play(int soundNum, Action *action, int volume) { + +} + +void ASound::stop() { + +} + +void ASound::prime(int v, Action *action) { + +} + +void ASound::unPrime() { + +} + +void ASound::go() { + +} + +void ASound::hault(void) { +} + +int ASound::getSoundNum() const { return 0; } +bool ASound::isPlaying() const { return false; } +bool ASound::isPaused() const { return false; } +bool ASound::isMuted() const { return false; } + +void ASound::pause() { + +} + +void ASound::mute() { + +} + +void ASound::fadeIn() { + +} + +void ASound::fadeOut(EventHandler *evtHandler) { + +} + +void ASound::fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler) { + +} + +void ASound::setTimeIndex(uint32 timeIndex) { + +} + +uint32 ASound::getTimeIndex() const { + return 0; +} + +void ASound::setPri(int v) { + +} + +void ASound::setLoop(bool flag) { + +} + +int ASound::getPri() const { + return 0; +} + +bool ASound::getLoop() { + return false; +} + +void ASound::setVolume(int volume) { + +} + +int ASound::getVol() const { + return 0; +} + +void ASound::holdAt(int v) { + +} + +void ASound::release() { + +} + + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 03ae77b703..d1099fabcc 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "tsage/saveload.h" +#include "tsage/core.h" namespace tSage { @@ -41,6 +42,48 @@ public: void loadNotifierProc(bool postFlag); }; +class Sound: public EventHandler { +public: + +}; + +class ASound: public Sound { +public: + Sound _sound; + Action *_action; + int _field280; + + ASound(); + virtual void synchronize(Serializer &s); + virtual void dispatch(); + + void play(int soundNum, Action *action = NULL, int volume = 127); + void stop(); + void prime(int v, Action *action = NULL); + void unPrime(); + void go(); + void hault(void); + int getSoundNum() const; + bool isPlaying() const; + bool isPaused() const; + bool isMuted() const; + void pause(); + void mute(); + void fadeIn(); + void fadeOut(EventHandler *evtHandler); + void fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler); + void setTimeIndex(uint32 timeIndex); + uint32 getTimeIndex() const; + void setPri(int v); + void setLoop(bool flag); + int getPri() const; + bool getLoop(); + void setVolume(int volume); + int getVol() const; + void holdAt(int v); + void release(); +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From 120a648e68a35790ee92682d4dfddc0c216b53ef Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Apr 2011 22:22:20 +1000 Subject: TSAGE: Implemented the code for the ASound class --- engines/tsage/core.cpp | 18 ------ engines/tsage/sound.cpp | 156 +++++++++++++++++++++++++++++++++++++++--------- engines/tsage/sound.h | 67 +++++++++++++++------ 3 files changed, 175 insertions(+), 66 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 4cbe70f0e3..873bbc56a5 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2945,24 +2945,6 @@ int SceneRegions::indexOf(const Common::Point &pt) { /*--------------------------------------------------------------------------*/ -ASound::ASound() { - _action = NULL; - _field280 = -1; -} - -void ASound::synchronize(Serializer &s) { - EventHandler::synchronize(s); - - SYNC_POINTER(_action); - s.syncAsSint16LE(_field280); -} - -void ASound::dispatch() { - -} - -/*--------------------------------------------------------------------------*/ - void SceneItemList::addItems(SceneItem *first, ...) { va_list va; va_start(va, first); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 912bbacadd..c628cf4d31 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -56,93 +56,191 @@ void SoundManager::listenerSynchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ -void ASound::play(int soundNum, Action *action, int volume) { - +void Sound::play(int soundNum, int volume) { + } -void ASound::stop() { +void Sound::stop() { } -void ASound::prime(int v, Action *action) { +void Sound::prime(int soundNum) { } -void ASound::unPrime() { +void Sound::prime(int soundNum, int v2) { + +} + +void Sound::_unPrime() { } -void ASound::go() { +void Sound::unPrime() { } -void ASound::hault(void) { +void Sound::go() { + } -int ASound::getSoundNum() const { return 0; } -bool ASound::isPlaying() const { return false; } -bool ASound::isPaused() const { return false; } -bool ASound::isMuted() const { return false; } +void Sound::halt(void) { -void ASound::pause() { +} +int Sound::getSoundNum() const { + return 0; } -void ASound::mute() { +bool Sound::isPlaying() const { + return false; +} +bool Sound::isPrimed() const { + return false; } -void ASound::fadeIn() { +bool Sound::isPaused() const { + return false; +} +bool Sound::isMuted() const { + return false; } -void ASound::fadeOut(EventHandler *evtHandler) { +void Sound::pause() { } -void ASound::fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler) { +void Sound::mute() { } -void ASound::setTimeIndex(uint32 timeIndex) { +void Sound::fadeIn() { } -uint32 ASound::getTimeIndex() const { - return 0; +void Sound::fadeOut(EventHandler *evtHandler) { + } -void ASound::setPri(int v) { +void Sound::fade(int v1, int v2, int v3, int v4) { } -void ASound::setLoop(bool flag) { +void Sound::setTimeIndex(uint32 timeIndex) { } -int ASound::getPri() const { - return 0; +uint32 Sound::getTimeIndex() const { + return 0; +} + +bool Sound::getCueValue() const { + return false; } -bool ASound::getLoop() { - return false; +void Sound::setCueValue(bool flag) { + } -void ASound::setVolume(int volume) { +void Sound::setVol(int volume) { } -int ASound::getVol() const { +int Sound::getVol() const { return 0; } -void ASound::holdAt(int v) { +void Sound::setPri(int v) { + +} + +void Sound::setLoop(bool flag) { } -void ASound::release() { +int Sound::getPri() const { + return 0; +} +bool Sound::getLoop() { + return false; } +void Sound::holdAt(int v) { + +} + +void Sound::release() { + +} + + +/*--------------------------------------------------------------------------*/ + +ASound::ASound(): EventHandler() { + _action = NULL; + _cueFlag = false; +} + +void ASound::synchronize(Serializer &s) { + EventHandler::synchronize(s); + SYNC_POINTER(_action); + s.syncAsByte(_cueFlag); +} + +void ASound::dispatch() { + EventHandler::dispatch(); + + if (!_sound.getCueValue()) { + _cueFlag = false; + _sound.setCueValue(true); + + if (_action) + _action->signal(); + } + + if (!_cueFlag) { + if (!_sound.isPrimed()) { + _cueFlag = true; + if (_action) { + _action->signal(); + _action = NULL; + } + } + } +} + +void ASound::play(int soundNum, Action *action, int volume) { + _action = action; + _cueFlag = false; + + setVol(volume); + _sound.play(soundNum); +} + +void ASound::stop() { + _sound.stop(); + _action = NULL; +} + +void ASound::prime(int soundNum, Action *action) { + _action = action; + _cueFlag = false; + _sound.prime(soundNum); +} + +void ASound::unPrime() { + _sound.unPrime(); + _action = NULL; +} + +void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { + if (action) + _action = action; + + _sound.fade(v1, v2, v3, v4); +} } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index d1099fabcc..2155a935cd 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -44,46 +44,75 @@ public: class Sound: public EventHandler { public: - -}; - -class ASound: public Sound { -public: - Sound _sound; - Action *_action; - int _field280; - - ASound(); - virtual void synchronize(Serializer &s); - virtual void dispatch(); - - void play(int soundNum, Action *action = NULL, int volume = 127); + void play(int soundNum, int volume = 127); void stop(); - void prime(int v, Action *action = NULL); + void prime(int soundNum); + void prime(int soundNum, int v2); + void _unPrime(); void unPrime(); void go(); - void hault(void); + void halt(void); int getSoundNum() const; bool isPlaying() const; + bool isPrimed() const; bool isPaused() const; bool isMuted() const; void pause(); void mute(); void fadeIn(); void fadeOut(EventHandler *evtHandler); - void fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler); + void fade(int v1, int v2, int v3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; + bool getCueValue() const; + void setCueValue(bool flag); + void setVol(int volume); + int getVol() const; void setPri(int v); void setLoop(bool flag); int getPri() const; bool getLoop(); - void setVolume(int volume); - int getVol() const; void holdAt(int v); void release(); }; +class ASound: public EventHandler { +public: + Sound _sound; + Action *_action; + bool _cueFlag; + + ASound(); + virtual void synchronize(Serializer &s); + virtual void dispatch(); + + void play(int soundNum, Action *action = NULL, int volume = 127); + void stop(); + void prime(int soundNum, Action *action = NULL); + void unPrime(); + void go() { _sound.go(); } + void hault(void) { _sound.halt(); } + int getSoundNum() const { return _sound.getSoundNum(); } + bool isPlaying() const { return _sound.isPlaying(); } + bool isPaused() const { return _sound.isPaused(); } + bool isMuted() const { return _sound.isMuted(); } + void pause() { _sound.pause(); } + void mute() { _sound.mute(); } + void fadeIn() { fade(127, 5, 10, 0, NULL); } + void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } + void fade(int v1, int v2, int v3, int v4, Action *action); + void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } + uint32 getTimeIndex() const { return _sound.getTimeIndex(); } + void setPri(int v) { _sound.setPri(v); } + void setLoop(bool flag) { _sound.setLoop(flag); } + int getPri() const { return _sound.getPri(); } + bool getLoop() { return _sound.getLoop(); } + void setVol(int volume) { _sound.setVol(volume); } + int getVol() const { return _sound.getVol(); } + void holdAt(int v) { _sound.holdAt(v); } + void release() { _sound.release(); } +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From c1dea849039d3df944c619df93f5a3423816101b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 29 Apr 2011 20:19:37 +1000 Subject: TSAGE: Added fields for the Sound class --- engines/tsage/sound.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 2155a935cd..1797da2b79 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -42,13 +42,61 @@ public: void loadNotifierProc(bool postFlag); }; +#define SOUND_ARR_SIZE 16 + +struct trackInfoStruct { + int count; + int rlbList[32]; + uint32 handleList[75]; +}; + class Sound: public EventHandler { +private: + void _prime(int soundNum, int v2); + void _unPrime(); +public: + int _field6; + int _soundNum; + int _fieldA; + int _fieldE; + int _priority2; + int _field10; + bool _loopFlag2; + int _priority; + int _volume; + bool _loopFlag; + int _pauseCtr; + int _muteCtr; + int _holdAt; + bool _cueValue; + int _field1E; + int _field1F; + int _field20; + int _field21; + int _field22; + uint _timeIndex; + int _field26; + int _field28[SOUND_ARR_SIZE]; + int _field38[SOUND_ARR_SIZE]; + int _field48[SOUND_ARR_SIZE]; + int _field58[SOUND_ARR_SIZE]; + int _field68[SOUND_ARR_SIZE]; + int _field78[SOUND_ARR_SIZE]; + int _field98[SOUND_ARR_SIZE]; + int _fieldA8[SOUND_ARR_SIZE]; + int _fieldB8[SOUND_ARR_SIZE]; + int _fieldC8[SOUND_ARR_SIZE]; + int _fieldE8[SOUND_ARR_SIZE]; + trackInfoStruct _trackInfo; + int _field266; + int _field268; + bool _primed; + int _field26C; + int _field26E; public: void play(int soundNum, int volume = 127); void stop(); void prime(int soundNum); - void prime(int soundNum, int v2); - void _unPrime(); void unPrime(); void go(); void halt(void); -- cgit v1.2.3 From 22bab4ef954640d78c75cbc2aef11571b24550ac Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2011 15:23:30 +1000 Subject: TSAGE: Implemented the methods of the Sound class --- engines/tsage/sound.cpp | 352 +++++++++++++++++++++++++++++++++++++++++++----- engines/tsage/sound.h | 106 +++++++++++---- 2 files changed, 395 insertions(+), 63 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c628cf4d31..fab6377647 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -24,6 +24,7 @@ #include "tsage/globals.h" #include "tsage/debugger.h" #include "tsage/graphics.h" +#include "tsage/tsage.h" namespace tSage { @@ -56,127 +57,406 @@ void SoundManager::listenerSynchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ -void Sound::play(int soundNum, int volume) { +void SoundManager::checkResVersion(const byte *soundData) { + int minVersion = READ_LE_UINT16(soundData + 4); + int maxVersion = READ_LE_UINT16(soundData + 6); + if (_globals->_soundManager._minVersion >= maxVersion) + error("Attempt to play/prime sound resource that is too new"); + if (_globals->_soundManager._minVersion > minVersion) + error("Attempt to play/prime sound resource that is too old"); } -void Sound::stop() { +int SoundManager::determineGroup(const byte *soundData) { + return _sfDetermineGroup(soundData); +} + +int SoundManager::extractPriority(const byte *soundData) { + return READ_LE_UINT16(soundData + 12); +} + +int SoundManager::extractLoop(const byte *soundData) { + return READ_LE_UINT16(soundData + 14); +} + +void SoundManager::addToSoundList(Sound *sound) { + if (!contains(_soundList, sound)) + _soundList.push_back(sound); +} + +void SoundManager::removeFromSoundList(Sound *sound) { + _soundList.remove(sound); +} + +void SoundManager::addToPlayList(Sound *sound) { + _sfAddToPlayList(sound); +} + +void SoundManager::removeFromPlayList(Sound *sound) { + _sfRemoveFromPlayList(sound); +} + +bool SoundManager::isOnPlayList(Sound *sound) { + return _sfIsOnPlayList(sound); +} + +void SoundManager::extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum) { + +} + +void SoundManager::suspendSoundServer() { + ++_globals->_soundManager._suspendCtr; +} + +void SoundManager::rethinkVoiceTypes() { + _sfRethinkVoiceTypes(); +} + +void SoundManager::restartSoundServer() { + if (_globals->_soundManager._suspendCtr > 0) + --_globals->_soundManager._suspendCtr; +} + +void SoundManager::updateSoundVol(Sound *sound) { + _sfUpdateVolume(sound); +} + +void SoundManager::updateSoundPri(Sound *sound) { + _sfUpdatePriority(sound); +} + +void SoundManager::updateSoundLoop(Sound *sound) { + _sfUpdateLoop(sound); +} + +/*--------------------------------------------------------------------------*/ + +void SoundManager::_soSetTimeIndex(int timeIndex) { + warning("TODO: _soSetTimeIndex"); +} + +int SoundManager::_sfDetermineGroup(const byte *soundData) { + const byte *p = soundData + READ_LE_UINT16(soundData + 8); + uint32 v; + while ((v = READ_LE_UINT32(p)) != 0) { + if ((v & _globals->_soundManager._groupMask) == v) + return v; + + p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + } + + return 0; +} + +void SoundManager::_sfAddToPlayList(Sound*soundData) { + +} + +void SoundManager::_sfRemoveFromPlayList(Sound *sound) { + +} + +bool SoundManager::_sfIsOnPlayList(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + bool result = contains(_globals->_soundManager._playList, sound); + --_globals->_soundManager._suspendCtr; + + return result; +} + +void SoundManager::_sfRethinkVoiceTypes() { + +} + +void SoundManager::_sfUpdateVolume(Sound *sound) { + _sfDereferenceAll(); + sub_233EE(sound); +} + +void SoundManager::_sfDereferenceAll() { + +} + +void SoundManager::sub_233EE(Sound *sound) { + +} + +void SoundManager::_sfUpdatePriority(Sound *sound) { + +} + +void SoundManager::_sfUpdateLoop(Sound *sound) { } +/*--------------------------------------------------------------------------*/ + +Sound::Sound() { + _field6 = 0; + _soundNum = 0; + _groupNum = 0; + _soundPriority = 0; + _priority2 = -1; + _loop = true; + _loopFlag2 = true; + _priority = 0; + _volume = 127; + _loopFlag = false; + _pauseCtr = 0; + _muteCtr = 0; + _holdAt = false; + _cueValue = -1; + _volume1 = -1; + _field1F = 0; + _volume2 = 0; + _field21 = 0; + _field22 = 0; + _timeIndex = 0; + _field26 = 0; + _trackInfo.count = 0; + _primed = false; + _field26C = 0; + _field26E = NULL; +} + +void Sound::play(int soundNum) { + prime(soundNum); + _globals->_soundManager.addToPlayList(this); +} + +void Sound::stop() { + _globals->_soundManager.removeFromPlayList(this); + _unPrime(); +} + void Sound::prime(int soundNum) { + if (_soundNum != -1) { + stop(); + _prime(soundNum, false); + } +} +void Sound::unPrime() { + stop(); } -void Sound::prime(int soundNum, int v2) { +void Sound::_prime(int soundNum, bool queFlag) { + if (_primed) + unPrime(); + + if (_soundNum != -1) { + // Sound number specified + _field26E = NULL; + byte *soundData = _resourceManager->getResource(RES_SOUND, soundNum, 0); + _globals->_soundManager.checkResVersion(soundData); + _groupNum = _globals->_soundManager.determineGroup(soundData); + _soundPriority = _globals->_soundManager.extractPriority(soundData); + _loop = _globals->_soundManager.extractLoop(soundData); + _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); + + for (int idx = 0; idx < _trackInfo.count; ++idx) { + _trackInfo.handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); + } + + DEALLOCATE(soundData); + } else { + // No sound specified + _groupNum = 0; + _soundPriority = 0; + _loop = 0; + _trackInfo.count = 0; + _trackInfo.handleList[0] = ALLOCATE(200); + _field26E = ALLOCATE(200); + } + + if (queFlag) + _globals->_soundManager.addToSoundList(this); + _primed = true; } void Sound::_unPrime() { + if (_primed) { + if (_field26C) { + DEALLOCATE(_trackInfo.handleList[0]); + DEALLOCATE(_field26E); + _field26E = NULL; + } else { + for (int idx = 0; idx < _trackInfo.count; ++idx) { + DEALLOCATE(_trackInfo.handleList[idx]); + } + } + _trackInfo.count = 0; + _globals->_soundManager.removeFromSoundList(this); + + _primed = false; + _field6 = 0; + } } -void Sound::unPrime() { +void Sound::orientAfterDriverChange() { + if (!_field26C) { + int timeIndex = getTimeIndex(); + + for (int idx = 0; idx < _trackInfo.count; ++idx) + DEALLOCATE(_trackInfo.handleList[idx]); + + _trackInfo.count = 0; + _primed = false; + _prime(_soundNum, true); + setTimeIndex(timeIndex); + } +} +void Sound::orientAfterRestore() { + if (_field26C) { + int timeIndex = getTimeIndex(); + _primed = false; + _prime(_soundNum, true); + setTimeIndex(timeIndex); + } } void Sound::go() { + if (!_primed) + error("Attempt to execute Sound::go() on an unprimed Sound"); + _globals->_soundManager.addToPlayList(this); } void Sound::halt(void) { - + _globals->_soundManager.removeFromPlayList(this); } int Sound::getSoundNum() const { - return 0; + return _soundNum; } -bool Sound::isPlaying() const { - return false; +bool Sound::isPlaying() { + return _globals->_soundManager.isOnPlayList(this); } bool Sound::isPrimed() const { - return false; + return _primed; } bool Sound::isPaused() const { - return false; + return _pauseCtr != 0; } bool Sound::isMuted() const { - return false; + return _muteCtr != 0; } -void Sound::pause() { +void Sound::pause(bool flag) { + _globals->_soundManager.suspendSoundServer(); -} - -void Sound::mute() { + if (flag) + ++_pauseCtr; + else if (_pauseCtr > 0) + --_pauseCtr; + _globals->_soundManager.rethinkVoiceTypes(); + _globals->_soundManager.restartSoundServer(); } -void Sound::fadeIn() { +void Sound::mute(bool flag) { + _globals->_soundManager.suspendSoundServer(); + + if (flag) + ++_muteCtr; + else if (_muteCtr > 0) + --_muteCtr; + _globals->_soundManager.rethinkVoiceTypes(); + _globals->_soundManager.restartSoundServer(); } -void Sound::fadeOut(EventHandler *evtHandler) { +void Sound::fade(int volume1, int volume2, int v3, int v4) { + _globals->_soundManager.suspendSoundServer(); -} + if (volume1 > 127) + volume1 = 127; + if (volume2 > 127) + volume2 = 127; + if (v3 > 255) + v3 = 255; -void Sound::fade(int v1, int v2, int v3, int v4) { + _volume1 = volume1; + _volume2 = volume2; + _field1F = v3; + _field21 = 0; + _field22 = v4; + _globals->_soundManager.restartSoundServer(); } void Sound::setTimeIndex(uint32 timeIndex) { - + if (_primed) { + mute(true); + SoundManager::_soSetTimeIndex(timeIndex); + mute(false); + } } uint32 Sound::getTimeIndex() const { - return 0; + return _timeIndex; } -bool Sound::getCueValue() const { - return false; +int Sound::getCueValue() const { + return _cueValue; } -void Sound::setCueValue(bool flag) { - +void Sound::setCueValue(int cueValue) { + _cueValue = cueValue; } void Sound::setVol(int volume) { + if (volume > 127) + volume = 127; + if (_volume != volume) { + _volume = volume; + if (isPlaying()) + _globals->_soundManager.updateSoundVol(this); + } } int Sound::getVol() const { - return 0; + return _volume; } -void Sound::setPri(int v) { - +void Sound::setPri(int priority) { + if (priority > 127) + priority = 127; + _priority2 = priority; + _globals->_soundManager.updateSoundPri(this); } void Sound::setLoop(bool flag) { - + _loopFlag2 = flag; + _globals->_soundManager.updateSoundLoop(this); } int Sound::getPri() const { - return 0; + return _priority; } bool Sound::getLoop() { - return false; + return _loopFlag; } -void Sound::holdAt(int v) { - +void Sound::holdAt(int amount) { + if (amount > 127) + amount = 127; + _holdAt = amount; } void Sound::release() { - + _holdAt = -1; } - /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { @@ -195,7 +475,7 @@ void ASound::dispatch() { if (!_sound.getCueValue()) { _cueFlag = false; - _sound.setCueValue(true); + _sound.setCueValue(1); if (_action) _action->signal(); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 1797da2b79..4529ec89f1 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -24,12 +24,37 @@ #define TSAGE_SOUND_H #include "common/scummsys.h" +#include "common/list.h" #include "tsage/saveload.h" #include "tsage/core.h" namespace tSage { +class Sound; + +struct trackInfoStruct { + int count; + int rlbList[32]; + byte *handleList[75]; +}; + class SoundManager : public SaveListener { +public: + int _minVersion, _maxVersion; + Common::List _playList; + void *driverList2[16]; + int _field89[16]; + int _fieldA9[16]; + int _fieldE9[16]; + int _field109[16]; + uint32 _groupMask; + int volume; + int _disableCtr; + int _suspendCtr; + int _field153; + Common::List _soundList; + Common::List _driverList; + int _field16D; public: void dispatch() {} virtual void listenerSynchronize(Serializer &s); @@ -40,27 +65,54 @@ public: void saveNotifierProc(bool postFlag); static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); -}; -#define SOUND_ARR_SIZE 16 + void checkResVersion(const byte *soundData); + int determineGroup(const byte *soundData); + int extractPriority(const byte *soundData); + int extractLoop(const byte *soundData); + void addToSoundList(Sound *sound); + void removeFromSoundList(Sound *sound); + void addToPlayList(Sound *sound); + void removeFromPlayList(Sound *sound); + bool isOnPlayList(Sound *sound); + void extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum); + void suspendSoundServer(); + void rethinkVoiceTypes(); + void restartSoundServer(); + void updateSoundVol(Sound *sound); + void updateSoundPri(Sound *sound); + void updateSoundLoop(Sound *sound); + + // _so methods + static void _soSetTimeIndex(int timeIndex); + static int _sfDetermineGroup(const byte *soundData); + static void _sfAddToPlayList(Sound *sound); + static void _sfRemoveFromPlayList(Sound *sound); + static bool _sfIsOnPlayList(Sound *sound); + static void _sfRethinkVoiceTypes(); + static void _sfUpdateVolume(Sound *sound); + static void _sfDereferenceAll(); + static void sub_233EE(Sound *sound); + static void _sfUpdatePriority(Sound *sound); + static void _sfUpdateLoop(Sound *sound); -struct trackInfoStruct { - int count; - int rlbList[32]; - uint32 handleList[75]; }; +#define SOUND_ARR_SIZE 16 + class Sound: public EventHandler { private: - void _prime(int soundNum, int v2); + void _prime(int soundNum, bool queFlag); void _unPrime(); + void orientAfterDriverChange(); + void orientAfterRestore(); public: int _field6; int _soundNum; - int _fieldA; - int _fieldE; + int _groupNum; + int _soundPriority; int _priority2; - int _field10; + int _loop; bool _loopFlag2; int _priority; int _volume; @@ -68,10 +120,10 @@ public: int _pauseCtr; int _muteCtr; int _holdAt; - bool _cueValue; - int _field1E; + int _cueValue; + int _volume1; int _field1F; - int _field20; + int _volume2; int _field21; int _field22; uint _timeIndex; @@ -92,35 +144,35 @@ public: int _field268; bool _primed; int _field26C; - int _field26E; + byte *_field26E; public: - void play(int soundNum, int volume = 127); + Sound(); + + void play(int soundNum); void stop(); void prime(int soundNum); void unPrime(); void go(); void halt(void); + bool isPlaying(); int getSoundNum() const; - bool isPlaying() const; bool isPrimed() const; bool isPaused() const; bool isMuted() const; - void pause(); - void mute(); - void fadeIn(); - void fadeOut(EventHandler *evtHandler); + void pause(bool flag); + void mute(bool flag); void fade(int v1, int v2, int v3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; - bool getCueValue() const; - void setCueValue(bool flag); + int getCueValue() const; + void setCueValue(int cueValue); void setVol(int volume); int getVol() const; - void setPri(int v); + void setPri(int priority); void setLoop(bool flag); int getPri() const; bool getLoop(); - void holdAt(int v); + void holdAt(int amount); void release(); }; @@ -140,12 +192,12 @@ public: void unPrime(); void go() { _sound.go(); } void hault(void) { _sound.halt(); } + bool isPlaying() { return _sound.isPlaying(); } int getSoundNum() const { return _sound.getSoundNum(); } - bool isPlaying() const { return _sound.isPlaying(); } bool isPaused() const { return _sound.isPaused(); } bool isMuted() const { return _sound.isMuted(); } - void pause() { _sound.pause(); } - void mute() { _sound.mute(); } + void pause(bool flag) { _sound.pause(flag); } + void mute(bool flag) { _sound.mute(flag); } void fadeIn() { fade(127, 5, 10, 0, NULL); } void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } void fade(int v1, int v2, int v3, int v4, Action *action); -- cgit v1.2.3 From 941fc4b1d53b25c4655771594476d855fbaa2a15 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2011 19:28:30 +1000 Subject: TSAGE: Implemented a lot of the SoundManager methods --- engines/tsage/sound.cpp | 168 ++++++++++++++++++++++++++++++++++++++++-------- engines/tsage/sound.h | 60 +++++++++++++---- 2 files changed, 187 insertions(+), 41 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index fab6377647..ccc64726ae 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -28,10 +28,39 @@ namespace tSage { +SoundManager::SoundManager() { + __sndmgrReady = false; + _minVersion = 0x102; + _maxVersion = 0x10A; + + for (int i = 0; i < 16; ++i) + _field109[i] = 0; + + _groupMask = 0; + _volume = 127; + _suspendCtr = 0; + _disableCtr = 0; + _field153 = 0; + _field16D = 0; +} + +SoundManager::~SoundManager() { + if (__sndmgrReady) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->stop(); + for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) + unInstallDriver(*i); + _sfTerminate(); + } +} + void SoundManager::postInit() { - _saver->addSaveNotifier(&SoundManager::saveNotifier); - _saver->addLoadNotifier(&SoundManager::loadNotifier); - _saver->addListener(this); + if (!__sndmgrReady) { + _saver->addSaveNotifier(&SoundManager::saveNotifier); + _saver->addLoadNotifier(&SoundManager::loadNotifier); + _saver->addListener(this); + __sndmgrReady = true; + } } void SoundManager::saveNotifier(bool postFlag) { @@ -55,8 +84,6 @@ void SoundManager::listenerSynchronize(Serializer &s) { warning("TODO: SoundManager listenerSynchronize"); } -/*--------------------------------------------------------------------------*/ - void SoundManager::checkResVersion(const byte *soundData) { int minVersion = READ_LE_UINT16(soundData + 4); int maxVersion = READ_LE_UINT16(soundData + 6); @@ -67,6 +94,57 @@ void SoundManager::checkResVersion(const byte *soundData) { error("Attempt to play/prime sound resource that is too old"); } +/*--------------------------------------------------------------------------*/ + +void SoundManager::suspendSoundServer() { + ++_globals->_soundManager._suspendCtr; +} + + +void SoundManager::restartSoundServer() { + if (_globals->_soundManager._suspendCtr > 0) + --_globals->_soundManager._suspendCtr; +} + +void SoundManager::unInstallDriver(SoundDriver *driver) { + +} + +Common::List &SoundManager::buildDriverList(bool flag) { + assert(__sndmgrReady); + _driverList.clear(); + + warning("TODO: SoundManager::buildDriverList"); + return _driverList; +} + +Common::List &SoundManager::getDriverList(bool flag) { + if (flag) + return _driverList; + else + return buildDriverList(false); +} + +void SoundManager::dumpDriverList() { + _driverList.clear(); +} + +void SoundManager::setMasterVol(int volume) { + _sfSetMasterVol(volume); +} + +int SoundManager::getMasterVol() const { + return _volume; +} + +void SoundManager::loadSound(int soundNum, bool showErrors) { + // This method preloaded the data associated with a given sound, so is now redundant +} + +void SoundManager::unloadSound(int soundNum) { + // This method signalled the resource manager to unload the data for a sound, and is now redundant +} + int SoundManager::determineGroup(const byte *soundData) { return _sfDetermineGroup(soundData); } @@ -79,6 +157,10 @@ int SoundManager::extractLoop(const byte *soundData) { return READ_LE_UINT16(soundData + 14); } +void SoundManager::extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { + _sfExtractTrackInfo(trackInfo, soundData, groupNum); +} + void SoundManager::addToSoundList(Sound *sound) { if (!contains(_soundList, sound)) _soundList.push_back(sound); @@ -100,23 +182,6 @@ bool SoundManager::isOnPlayList(Sound *sound) { return _sfIsOnPlayList(sound); } -void SoundManager::extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum) { - -} - -void SoundManager::suspendSoundServer() { - ++_globals->_soundManager._suspendCtr; -} - -void SoundManager::rethinkVoiceTypes() { - _sfRethinkVoiceTypes(); -} - -void SoundManager::restartSoundServer() { - if (_globals->_soundManager._suspendCtr > 0) - --_globals->_soundManager._suspendCtr; -} - void SoundManager::updateSoundVol(Sound *sound) { _sfUpdateVolume(sound); } @@ -129,6 +194,10 @@ void SoundManager::updateSoundLoop(Sound *sound) { _sfUpdateLoop(sound); } +void SoundManager::rethinkVoiceTypes() { + _sfRethinkVoiceTypes(); +} + /*--------------------------------------------------------------------------*/ void SoundManager::_soSetTimeIndex(int timeIndex) { @@ -189,6 +258,51 @@ void SoundManager::_sfUpdateLoop(Sound *sound) { } +void SoundManager::_sfSetMasterVol(int volume) { + if (volume > 127) + volume = 127; + + if (volume != _globals->_soundManager._volume) { + _globals->_soundManager._volume = volume; + + for (Common::List::iterator i = _globals->_soundManager._installedDrivers.begin(); + i != _globals->_soundManager._installedDrivers.end(); ++i) { + (*i)->setVolume(volume); + } + } +} + +void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { + trackInfo->count = 0; + + const byte *p = soundData + READ_LE_UINT16(soundData + 8); + uint32 v; + while ((v = READ_LE_UINT32(p)) != 0) { + while ((v == 0x80000000) || (v == (uint)groupNum)) { + int count = READ_LE_UINT16(p + 4); + p += 6; + + for (int idx = 0; idx < count; ++idx) { + if (trackInfo->count == 16) { + trackInfo->count = -1; + return; + } + + trackInfo->rlbList[trackInfo->count] = READ_LE_UINT16(p); + trackInfo->arr2[trackInfo->count] = READ_LE_UINT16(p + 2); + ++trackInfo->count; + p += 4; + } + } + + p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + } +} + +void SoundManager::_sfTerminate() { + +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { @@ -255,7 +369,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); for (int idx = 0; idx < _trackInfo.count; ++idx) { - _trackInfo.handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); + _handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); } DEALLOCATE(soundData); @@ -265,7 +379,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _soundPriority = 0; _loop = 0; _trackInfo.count = 0; - _trackInfo.handleList[0] = ALLOCATE(200); + _handleList[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -278,12 +392,12 @@ void Sound::_prime(int soundNum, bool queFlag) { void Sound::_unPrime() { if (_primed) { if (_field26C) { - DEALLOCATE(_trackInfo.handleList[0]); + DEALLOCATE(_handleList[0]); DEALLOCATE(_field26E); _field26E = NULL; } else { for (int idx = 0; idx < _trackInfo.count; ++idx) { - DEALLOCATE(_trackInfo.handleList[idx]); + DEALLOCATE(_handleList[idx]); } } @@ -300,7 +414,7 @@ void Sound::orientAfterDriverChange() { int timeIndex = getTimeIndex(); for (int idx = 0; idx < _trackInfo.count; ++idx) - DEALLOCATE(_trackInfo.handleList[idx]); + DEALLOCATE(_handleList[idx]); _trackInfo.count = 0; _primed = false; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 4529ec89f1..fb9a0c3f89 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -32,58 +32,90 @@ namespace tSage { class Sound; +#define SOUND_ARR_SIZE 16 + struct trackInfoStruct { int count; - int rlbList[32]; - byte *handleList[75]; + int rlbList[SOUND_ARR_SIZE]; + int arr2[SOUND_ARR_SIZE]; +}; + +class SoundDriverEntry { +public: + +}; + +class SoundDriver { +private: + Common::String _shortDescription, _longDescription; +public: + const Common::String &getShortDriverDescription() { return _shortDescription; } + const Common::String &getLongDriverDescription() { return _longDescription; } + + virtual void setVolume(int volume) = 0; }; class SoundManager : public SaveListener { +private: + void unInstallDriver(SoundDriver *driver); public: + bool __sndmgrReady; int _minVersion, _maxVersion; Common::List _playList; - void *driverList2[16]; - int _field89[16]; - int _fieldA9[16]; - int _fieldE9[16]; int _field109[16]; uint32 _groupMask; - int volume; + int _volume; int _disableCtr; int _suspendCtr; int _field153; Common::List _soundList; - Common::List _driverList; + Common::List _driverList; + + Common::List _installedDrivers; + int _field89[16]; + int _fieldA9[16]; + int _fieldE9[16]; + int _field16D; public: + SoundManager(); + ~SoundManager(); + void dispatch() {} virtual void listenerSynchronize(Serializer &s); virtual void postInit(); - void proc2() {} static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); + Common::List &buildDriverList(bool flag); + Common::List &getDriverList(bool flag); + void dumpDriverList(); void checkResVersion(const byte *soundData); int determineGroup(const byte *soundData); int extractPriority(const byte *soundData); int extractLoop(const byte *soundData); + bool isOnPlayList(Sound *sound); + void extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); void addToSoundList(Sound *sound); void removeFromSoundList(Sound *sound); void addToPlayList(Sound *sound); void removeFromPlayList(Sound *sound); - bool isOnPlayList(Sound *sound); - void extractTrackInfo(trackInfoStruct *data, const byte *soundData, int groupNum); void suspendSoundServer(); void rethinkVoiceTypes(); void restartSoundServer(); void updateSoundVol(Sound *sound); void updateSoundPri(Sound *sound); void updateSoundLoop(Sound *sound); + void setMasterVol(int volume); + int getMasterVol() const; + void loadSound(int soundNum, bool showErrors); + void unloadSound(int soundNum); // _so methods + static void _sfTerminate(); static void _soSetTimeIndex(int timeIndex); static int _sfDetermineGroup(const byte *soundData); static void _sfAddToPlayList(Sound *sound); @@ -95,11 +127,10 @@ public: static void sub_233EE(Sound *sound); static void _sfUpdatePriority(Sound *sound); static void _sfUpdateLoop(Sound *sound); - + static void _sfSetMasterVol(int volume); + static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); }; -#define SOUND_ARR_SIZE 16 - class Sound: public EventHandler { private: void _prime(int soundNum, bool queFlag); @@ -140,6 +171,7 @@ public: int _fieldC8[SOUND_ARR_SIZE]; int _fieldE8[SOUND_ARR_SIZE]; trackInfoStruct _trackInfo; + byte *_handleList[75]; int _field266; int _field268; bool _primed; -- cgit v1.2.3 From c5cbfc4ac21c285ee02876daf603031f0ed4c830 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 2 May 2011 21:30:20 +1000 Subject: TSAGE: Bugfixes for extracting sound data properties --- engines/tsage/sound.cpp | 26 +++++++++++++++++++------- engines/tsage/sound.h | 9 +++++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ccc64726ae..73ce7a1f53 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -33,8 +33,12 @@ SoundManager::SoundManager() { _minVersion = 0x102; _maxVersion = 0x10A; - for (int i = 0; i < 16; ++i) + for (int i = 0; i < SOUND_ARR_SIZE; ++i) { + _field89[i] = 0; + _groupList[i] = 0; + _fieldE9[i] = 0; _field109[i] = 0; + } _groupMask = 0; _volume = 127; @@ -85,12 +89,12 @@ void SoundManager::listenerSynchronize(Serializer &s) { } void SoundManager::checkResVersion(const byte *soundData) { - int minVersion = READ_LE_UINT16(soundData + 4); - int maxVersion = READ_LE_UINT16(soundData + 6); + int maxVersion = READ_LE_UINT16(soundData + 4); + int minVersion = READ_LE_UINT16(soundData + 6); - if (_globals->_soundManager._minVersion >= maxVersion) + if (_globals->_soundManager._minVersion < minVersion) error("Attempt to play/prime sound resource that is too new"); - if (_globals->_soundManager._minVersion > minVersion) + if (_globals->_soundManager._minVersion > maxVersion) error("Attempt to play/prime sound resource that is too old"); } @@ -211,7 +215,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { if ((v & _globals->_soundManager._groupMask) == v) return v; - p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + p += 6 + (READ_LE_UINT16(p + 4) * 4); } return 0; @@ -295,7 +299,7 @@ void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *s } } - p = soundData + 6 + (READ_LE_UINT16(p + 4) * 4); + p += 6 + (READ_LE_UINT16(p + 4) * 4); } } @@ -303,6 +307,14 @@ void SoundManager::_sfTerminate() { } +void SoundManager::_sfExtractGroupMask() { + uint32 mask = 0; + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) + mask |= _globals->_soundManager._groupList[idx]; + + _globals->_soundManager._groupMask = mask; +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index fb9a0c3f89..2cc5dec61e 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -62,7 +62,7 @@ public: bool __sndmgrReady; int _minVersion, _maxVersion; Common::List _playList; - int _field109[16]; + int _field109[SOUND_ARR_SIZE]; uint32 _groupMask; int _volume; int _disableCtr; @@ -72,9 +72,9 @@ public: Common::List _driverList; Common::List _installedDrivers; - int _field89[16]; - int _fieldA9[16]; - int _fieldE9[16]; + int _field89[SOUND_ARR_SIZE]; + uint16 _groupList[SOUND_ARR_SIZE]; + int _fieldE9[SOUND_ARR_SIZE]; int _field16D; public: @@ -129,6 +129,7 @@ public: static void _sfUpdateLoop(Sound *sound); static void _sfSetMasterVol(int volume); static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); + static void _sfExtractGroupMask(); }; class Sound: public EventHandler { -- cgit v1.2.3 From 1d866e57491bbc703d13a406e09336b732212c2b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 May 2011 23:13:15 +1000 Subject: TSAGE: Implemented more SoundManager methods --- engines/tsage/core.cpp | 3 +- engines/tsage/sound.cpp | 216 ++++++++++++++++++++++++++++++++++++++---------- engines/tsage/sound.h | 47 ++++++++--- 3 files changed, 211 insertions(+), 55 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 873bbc56a5..41ee021432 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -3425,8 +3425,9 @@ void SceneHandler::postInit(SceneObjectList *OwnerList) { _globals->_scenePalette.loadPalette(0); _globals->_scenePalette.refresh(); - // TODO: Bunch of other scene related setup goes here _globals->_soundManager.postInit(); + _globals->_soundManager.buildDriverList(true); + _globals->_soundManager.installConfigDrivers(); _globals->_game->start(); } diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 73ce7a1f53..e08885a51a 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -45,15 +45,18 @@ SoundManager::SoundManager() { _suspendCtr = 0; _disableCtr = 0; _field153 = 0; - _field16D = 0; + _driversDetected = false; } SoundManager::~SoundManager() { if (__sndmgrReady) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->stop(); - for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) - unInstallDriver(*i); + for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { + int driverNum = (*i)->_driverNum; + ++i; + unInstallDriver(driverNum); + } _sfTerminate(); } } @@ -67,70 +70,154 @@ void SoundManager::postInit() { } } -void SoundManager::saveNotifier(bool postFlag) { - _globals->_soundManager.saveNotifierProc(postFlag); -} +Common::List &SoundManager::buildDriverList(bool detectFlag) { + assert(__sndmgrReady); + _availableDrivers.clear(); -void SoundManager::saveNotifierProc(bool postFlag) { - warning("TODO: SoundManager::saveNotifierProc"); -} + // Build up a list of available drivers. Currently we only implement an Adlib driver + SoundDriverEntry sd; + sd.driverNum = ADLIB_DRIVER_NUM; + sd.status = detectFlag ? SNDSTATUS_DETECTED : SNDSTATUS_SKIPPED; + sd.field2 = 0; + sd.field6 = 15000; + sd.shortDescription = "Adlib or SoundBlaster"; + sd.longDescription = "3812fm"; + _availableDrivers.push_back(sd); -void SoundManager::loadNotifier(bool postFlag) { - _globals->_soundManager.loadNotifierProc(postFlag); + _driversDetected = true; + return _availableDrivers; } -void SoundManager::loadNotifierProc(bool postFlag) { - warning("TODO: SoundManager::loadNotifierProc"); +void SoundManager::installConfigDrivers() { + } -void SoundManager::listenerSynchronize(Serializer &s) { - s.validate("SoundManager"); - warning("TODO: SoundManager listenerSynchronize"); +Common::List &SoundManager::getDriverList(bool detectFlag) { + if (detectFlag) + return _availableDrivers; + else + return buildDriverList(false); } -void SoundManager::checkResVersion(const byte *soundData) { - int maxVersion = READ_LE_UINT16(soundData + 4); - int minVersion = READ_LE_UINT16(soundData + 6); +void SoundManager::dumpDriverList() { + _availableDrivers.clear(); +} - if (_globals->_soundManager._minVersion < minVersion) - error("Attempt to play/prime sound resource that is too new"); - if (_globals->_soundManager._minVersion > maxVersion) - error("Attempt to play/prime sound resource that is too old"); +void SoundManager::disableSoundServer() { + ++_disableCtr; } -/*--------------------------------------------------------------------------*/ +void SoundManager::enableSoundServer() { + if (_disableCtr > 0) + --_disableCtr; +} void SoundManager::suspendSoundServer() { - ++_globals->_soundManager._suspendCtr; + ++_suspendCtr; } - void SoundManager::restartSoundServer() { - if (_globals->_soundManager._suspendCtr > 0) - --_globals->_soundManager._suspendCtr; + if (_suspendCtr > 0) + --_suspendCtr; } -void SoundManager::unInstallDriver(SoundDriver *driver) { +/** + * Install the specified driver number + */ +void SoundManager::installDriver(int driverNum) { + // If driver is already installed, no need to install it + if (isInstalled(driverNum)) + return; + + // Instantiate the sound driver + SoundDriver *driver = instantiateDriver(driverNum); + if (!driver) + return; + + assert((_maxVersion >= driver->_minVersion) && (_maxVersion <= driver->_maxVersion)); + + // Mute any loaded sounds + disableSoundServer(); + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(true); + + // Install the driver + if (!_sfInstallDriver(driver)) + error("Sound driver initialization failed"); + + switch (driverNum) { + case ROLAND_DRIVER_NUM: + case ADLIB_DRIVER_NUM: { + // Handle loading bank infomation + byte *bankData = _resourceManager->getResource(RES_BANK, ROLAND_DRIVER_NUM, 0, true); + if (bankData) { + // Install the patch bank data + _sfInstallPatchBank(bankData); + DEALLOCATE(bankData); + } else { + // Could not locate patch bank data, so unload the driver + _sfUnInstallDriver(driver); + + // Unmute currently active sounds + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(false); + enableSoundServer(); + } + break; + } + } } -Common::List &SoundManager::buildDriverList(bool flag) { - assert(__sndmgrReady); - _driverList.clear(); - - warning("TODO: SoundManager::buildDriverList"); - return _driverList; +/** + * Instantiate a driver class for the specified driver number + */ +SoundDriver *SoundManager::instantiateDriver(int driverNum) { + assert(driverNum == ADLIB_DRIVER_NUM); + return new AdlibSoundDriver(); } -Common::List &SoundManager::getDriverList(bool flag) { - if (flag) - return _driverList; - else - return buildDriverList(false); +/** + * Uninstall the specified driver + */ +void SoundManager::unInstallDriver(int driverNum) { + Common::List::const_iterator i; + for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { + if ((*i)->_driverNum == driverNum) { + // Found driver to remove + + // Mute any loaded sounds + disableSoundServer(); + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(true); + + // Uninstall the driver + _sfUnInstallDriver(*i); + + // Re-orient all the loaded sounds + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->orientAfterDriverChange(); + + // Unmute currently active sounds + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) + (*i)->mute(false); + + enableSoundServer(); + } + } } -void SoundManager::dumpDriverList() { - _driverList.clear(); +/** + * Returns true if a specified driver number is currently installed + */ +bool SoundManager::isInstalled(int driverNum) const { + Common::List::const_iterator i; + for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { + if ((*i)->_driverNum == driverNum) + return true; + } + + return false; } void SoundManager::setMasterVol(int volume) { @@ -153,6 +240,16 @@ int SoundManager::determineGroup(const byte *soundData) { return _sfDetermineGroup(soundData); } +void SoundManager::checkResVersion(const byte *soundData) { + int maxVersion = READ_LE_UINT16(soundData + 4); + int minVersion = READ_LE_UINT16(soundData + 6); + + if (_globals->_soundManager._minVersion < minVersion) + error("Attempt to play/prime sound resource that is too new"); + if (_globals->_soundManager._minVersion > maxVersion) + error("Attempt to play/prime sound resource that is too old"); +} + int SoundManager::extractPriority(const byte *soundData) { return READ_LE_UINT16(soundData + 12); } @@ -204,6 +301,29 @@ void SoundManager::rethinkVoiceTypes() { /*--------------------------------------------------------------------------*/ +void SoundManager::saveNotifier(bool postFlag) { + _globals->_soundManager.saveNotifierProc(postFlag); +} + +void SoundManager::saveNotifierProc(bool postFlag) { + warning("TODO: SoundManager::saveNotifierProc"); +} + +void SoundManager::loadNotifier(bool postFlag) { + _globals->_soundManager.loadNotifierProc(postFlag); +} + +void SoundManager::loadNotifierProc(bool postFlag) { + warning("TODO: SoundManager::loadNotifierProc"); +} + +void SoundManager::listenerSynchronize(Serializer &s) { + s.validate("SoundManager"); + warning("TODO: SoundManager listenerSynchronise"); +} + +/*--------------------------------------------------------------------------*/ + void SoundManager::_soSetTimeIndex(int timeIndex) { warning("TODO: _soSetTimeIndex"); } @@ -315,6 +435,18 @@ void SoundManager::_sfExtractGroupMask() { _globals->_soundManager._groupMask = mask; } +bool SoundManager::_sfInstallDriver(SoundDriver *driver) { + return false; +} + +void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { + +} + +void SoundManager::_sfInstallPatchBank(const byte *bankData) { + +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 2cc5dec61e..f52edc121b 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -33,6 +33,8 @@ namespace tSage { class Sound; #define SOUND_ARR_SIZE 16 +#define ROLAND_DRIVER_NUM 2 +#define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { int count; @@ -40,14 +42,22 @@ struct trackInfoStruct { int arr2[SOUND_ARR_SIZE]; }; +enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2}; + class SoundDriverEntry { public: - + int driverNum; + SoundDriverStatus status; + int field2, field6; + Common::String shortDescription; + Common::String longDescription; }; class SoundDriver { -private: +public: Common::String _shortDescription, _longDescription; + int _driverNum; + int _minVersion, _maxVersion; public: const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } @@ -57,7 +67,7 @@ public: class SoundManager : public SaveListener { private: - void unInstallDriver(SoundDriver *driver); + SoundDriver *instantiateDriver(int driverNum); public: bool __sndmgrReady; int _minVersion, _maxVersion; @@ -68,15 +78,13 @@ public: int _disableCtr; int _suspendCtr; int _field153; + bool _driversDetected; Common::List _soundList; - Common::List _driverList; - + Common::List _availableDrivers; Common::List _installedDrivers; int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; - - int _field16D; public: SoundManager(); ~SoundManager(); @@ -90,9 +98,17 @@ public: static void loadNotifier(bool postFlag); void loadNotifierProc(bool postFlag); - Common::List &buildDriverList(bool flag); - Common::List &getDriverList(bool flag); + void installConfigDrivers(); + Common::List &buildDriverList(bool detectFlag); + Common::List &getDriverList(bool detectFlag); void dumpDriverList(); + void installDriver(int driverNum); + bool isInstalled(int driverNum) const; + void unInstallDriver(int driverNum); + void disableSoundServer(); + void enableSoundServer(); + void suspendSoundServer(); + void restartSoundServer(); void checkResVersion(const byte *soundData); int determineGroup(const byte *soundData); int extractPriority(const byte *soundData); @@ -103,9 +119,7 @@ public: void removeFromSoundList(Sound *sound); void addToPlayList(Sound *sound); void removeFromPlayList(Sound *sound); - void suspendSoundServer(); void rethinkVoiceTypes(); - void restartSoundServer(); void updateSoundVol(Sound *sound); void updateSoundPri(Sound *sound); void updateSoundLoop(Sound *sound); @@ -130,13 +144,15 @@ public: static void _sfSetMasterVol(int volume); static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum); static void _sfExtractGroupMask(); + static bool _sfInstallDriver(SoundDriver *driver); + static void _sfUnInstallDriver(SoundDriver *driver); + static void _sfInstallPatchBank(const byte *bankData); }; class Sound: public EventHandler { private: void _prime(int soundNum, bool queFlag); void _unPrime(); - void orientAfterDriverChange(); void orientAfterRestore(); public: int _field6; @@ -207,6 +223,8 @@ public: bool getLoop(); void holdAt(int amount); void release(); + + void orientAfterDriverChange(); }; class ASound: public EventHandler { @@ -246,6 +264,11 @@ public: void release() { _sound.release(); } }; +class AdlibSoundDriver: public SoundDriver { +public: + void setVolume(int volume) {} +}; + } // End of namespace tSage #endif -- cgit v1.2.3 From 3457253f03cd5a57281735360fc600f0fe831298 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 May 2011 14:13:52 +1000 Subject: TSAGE: Implemented more _sf methods --- engines/tsage/sound.cpp | 92 +++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 7 +++- 2 files changed, 87 insertions(+), 12 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index e08885a51a..062fb6dda8 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -89,7 +89,7 @@ Common::List &SoundManager::buildDriverList(bool detectFlag) { } void SoundManager::installConfigDrivers() { - + installDriver(ADLIB_DRIVER_NUM); } Common::List &SoundManager::getDriverList(bool detectFlag) { @@ -324,6 +324,10 @@ void SoundManager::listenerSynchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ +SoundManager &SoundManager::sfManager() { + return _globals->_soundManager; +} + void SoundManager::_soSetTimeIndex(int timeIndex) { warning("TODO: _soSetTimeIndex"); } @@ -341,12 +345,19 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { return 0; } -void SoundManager::_sfAddToPlayList(Sound*soundData) { - +void SoundManager::_sfAddToPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + _sfDoAddToPlayList(sound); + sound->_field6 = 0; + _sfRethinkVoiceTypes(); + --sfManager()._suspendCtr; } void SoundManager::_sfRemoveFromPlayList(Sound *sound) { - + ++sfManager()._suspendCtr; + if (_sfDoRemoveFromPlayList(sound)) + _sfRethinkVoiceTypes(); + --sfManager()._suspendCtr; } bool SoundManager::_sfIsOnPlayList(Sound *sound) { @@ -363,23 +374,35 @@ void SoundManager::_sfRethinkVoiceTypes() { void SoundManager::_sfUpdateVolume(Sound *sound) { _sfDereferenceAll(); - sub_233EE(sound); + _sfDoUpdateVolume(sound); } void SoundManager::_sfDereferenceAll() { - -} - -void SoundManager::sub_233EE(Sound *sound) { - + // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed + // pointer lists based on the handles. Since in ScummVM we're just using pointers directly, this + // method doesn't need any implementation } void SoundManager::_sfUpdatePriority(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + int tempPriority = (sound->_priority2 == 255) ? sound->_soundPriority : sound->_priority; + if (sound->_priority != tempPriority) { + sound->_priority = tempPriority; + if (_sfDoRemoveFromPlayList(sound)) { + _sfDoAddToPlayList(sound); + _sfRethinkVoiceTypes(); + } + } + + --_globals->_soundManager._suspendCtr; } void SoundManager::_sfUpdateLoop(Sound *sound) { - + if (sound->_loopFlag2) + sound->_loopFlag = sound->_loop; + else + sound->_loopFlag = sound->_loopFlag2; } void SoundManager::_sfSetMasterVol(int volume) { @@ -447,6 +470,53 @@ void SoundManager::_sfInstallPatchBank(const byte *bankData) { } +/** + * Adds the specified sound in the playing sound list, inserting in order of priority + */ +void SoundManager::_sfDoAddToPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + + Common::List::iterator i = sfManager()._playList.begin(); + while ((i != sfManager()._playList.end()) && (sound->_priority > (*i)->_priority)) + ++i; + + sfManager()._playList.insert(i, sound); + --sfManager()._suspendCtr; +} + +/** + * Removes the specified sound from the play list + */ +bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { + ++sfManager()._suspendCtr; + + bool result = false; + for (Common::List::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) { + if (*i == sound) { + result = true; + sfManager()._playList.erase(i); + break; + } + } + + --sfManager()._suspendCtr; + return result; +} + +void SoundManager::_sfDoUpdateVolume(Sound *sound) { + ++_globals->_soundManager._suspendCtr; + + for (int idx = 0; idx < 16; ++idx) { + Sound *snd = sfManager()._voiceStructPtrs[idx]; + if (!snd) + continue; + + // TODO: More stuff + } + + --_globals->_soundManager._suspendCtr; +} + /*--------------------------------------------------------------------------*/ Sound::Sound() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index f52edc121b..26c26817a5 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -85,6 +85,7 @@ public: int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; + Sound *_voiceStructPtrs[SOUND_ARR_SIZE]; public: SoundManager(); ~SoundManager(); @@ -129,6 +130,7 @@ public: void unloadSound(int soundNum); // _so methods + static SoundManager &sfManager(); static void _sfTerminate(); static void _soSetTimeIndex(int timeIndex); static int _sfDetermineGroup(const byte *soundData); @@ -138,7 +140,6 @@ public: static void _sfRethinkVoiceTypes(); static void _sfUpdateVolume(Sound *sound); static void _sfDereferenceAll(); - static void sub_233EE(Sound *sound); static void _sfUpdatePriority(Sound *sound); static void _sfUpdateLoop(Sound *sound); static void _sfSetMasterVol(int volume); @@ -147,6 +148,9 @@ public: static bool _sfInstallDriver(SoundDriver *driver); static void _sfUnInstallDriver(SoundDriver *driver); static void _sfInstallPatchBank(const byte *bankData); + static void _sfDoAddToPlayList(Sound *sound); + static bool _sfDoRemoveFromPlayList(Sound *sound); + static void _sfDoUpdateVolume(Sound *sound); }; class Sound: public EventHandler { @@ -155,6 +159,7 @@ private: void _unPrime(); void orientAfterRestore(); public: + int _field0; int _field6; int _soundNum; int _groupNum; -- cgit v1.2.3 From b3fb2b5db8aa73703dc86fdcd06be0d7d0c1b0b6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 12 May 2011 23:09:48 +1000 Subject: TSAGE: More code for installing sound drivers --- engines/tsage/sound.cpp | 57 +++++++++++++++++++++++++++++++++++++------------ engines/tsage/sound.h | 27 ++++++++++++++++------- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 062fb6dda8..6082537766 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -44,7 +44,7 @@ SoundManager::SoundManager() { _volume = 127; _suspendCtr = 0; _disableCtr = 0; - _field153 = 0; + _suspendedCount = 0; _driversDetected = false; } @@ -152,7 +152,7 @@ void SoundManager::installDriver(int driverNum) { byte *bankData = _resourceManager->getResource(RES_BANK, ROLAND_DRIVER_NUM, 0, true); if (bankData) { // Install the patch bank data - _sfInstallPatchBank(bankData); + _sfInstallPatchBank(driver, bankData); DEALLOCATE(bankData); } else { // Could not locate patch bank data, so unload the driver @@ -368,6 +368,10 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { return result; } +void SoundManager::_sfRethinkSoundDrivers() { + +} + void SoundManager::_sfRethinkVoiceTypes() { } @@ -459,15 +463,29 @@ void SoundManager::_sfExtractGroupMask() { } bool SoundManager::_sfInstallDriver(SoundDriver *driver) { - return false; + if (!driver->open()) + return false; + + sfManager()._installedDrivers.push_back(driver); + uint32 *maskList = driver->getGroupMaskList(); + driver->_groupMask = *maskList; + + _sfExtractGroupMask(); + _sfRethinkSoundDrivers(); + driver->setVolume(sfManager()._volume); + + return true; } void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { + sfManager()._installedDrivers.remove(driver); + _sfExtractGroupMask(); + _sfRethinkSoundDrivers(); } -void SoundManager::_sfInstallPatchBank(const byte *bankData) { - +void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) { + driver->installPatchBank(bankData); } /** @@ -535,10 +553,10 @@ Sound::Sound() { _holdAt = false; _cueValue = -1; _volume1 = -1; - _field1F = 0; + _volume3 = 0; _volume2 = 0; - _field21 = 0; - _field22 = 0; + _volume5 = 0; + _volume4 = 0; _timeIndex = 0; _field26 = 0; _trackInfo.count = 0; @@ -701,21 +719,21 @@ void Sound::mute(bool flag) { _globals->_soundManager.restartSoundServer(); } -void Sound::fade(int volume1, int volume2, int v3, int v4) { +void Sound::fade(int volume1, int volume2, int volume3, int volume4) { _globals->_soundManager.suspendSoundServer(); if (volume1 > 127) volume1 = 127; if (volume2 > 127) volume2 = 127; - if (v3 > 255) - v3 = 255; + if (volume3 > 255) + volume3 = 255; _volume1 = volume1; _volume2 = volume2; - _field1F = v3; - _field21 = 0; - _field22 = v4; + _volume3 = volume3; + _volume5 = 0; + _volume4 = volume4; _globals->_soundManager.restartSoundServer(); } @@ -851,4 +869,15 @@ void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { _sound.fade(v1, v2, v3, v4); } + +/*--------------------------------------------------------------------------*/ + +SoundDriver::SoundDriver() { + _driverNum = 0; + _minVersion = _maxVersion = 0; + _groupMaskList = NULL; + + _groupMask = 0; +} + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 26c26817a5..22132bc6ca 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -58,11 +58,20 @@ public: Common::String _shortDescription, _longDescription; int _driverNum; int _minVersion, _maxVersion; + uint32 *_groupMaskList; + // The following fields were originally held in separate arrays in the SoundManager class + uint32 _groupMask; public: + SoundDriver(); + const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } - virtual void setVolume(int volume) = 0; + virtual bool open() { return true; } + virtual void close() {} + virtual uint32 *getGroupMaskList() const { return _groupMaskList; } + virtual void setVolume(int volume) {} + virtual void installPatchBank(const byte *data) {} }; class SoundManager : public SaveListener { @@ -77,7 +86,7 @@ public: int _volume; int _disableCtr; int _suspendCtr; - int _field153; + int _suspendedCount; bool _driversDetected; Common::List _soundList; Common::List _availableDrivers; @@ -137,6 +146,7 @@ public: static void _sfAddToPlayList(Sound *sound); static void _sfRemoveFromPlayList(Sound *sound); static bool _sfIsOnPlayList(Sound *sound); + static void _sfRethinkSoundDrivers(); static void _sfRethinkVoiceTypes(); static void _sfUpdateVolume(Sound *sound); static void _sfDereferenceAll(); @@ -147,7 +157,7 @@ public: static void _sfExtractGroupMask(); static bool _sfInstallDriver(SoundDriver *driver); static void _sfUnInstallDriver(SoundDriver *driver); - static void _sfInstallPatchBank(const byte *bankData); + static void _sfInstallPatchBank(SoundDriver *driver, const byte *bankData); static void _sfDoAddToPlayList(Sound *sound); static bool _sfDoRemoveFromPlayList(Sound *sound); static void _sfDoUpdateVolume(Sound *sound); @@ -175,10 +185,10 @@ public: int _holdAt; int _cueValue; int _volume1; - int _field1F; + int _volume3; int _volume2; - int _field21; - int _field22; + int _volume5; + int _volume4; uint _timeIndex; int _field26; int _field28[SOUND_ARR_SIZE]; @@ -215,7 +225,7 @@ public: bool isMuted() const; void pause(bool flag); void mute(bool flag); - void fade(int v1, int v2, int v3, int v4); + void fade(int volume1, int volume2, int volume3, int v4); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; int getCueValue() const; @@ -271,7 +281,8 @@ public: class AdlibSoundDriver: public SoundDriver { public: - void setVolume(int volume) {} + virtual void setVolume(int volume) {} + virtual void installPatchBank(const byte *data) {} }; } // End of namespace tSage -- cgit v1.2.3 From 52fbf6709aaa84574d96b98aedc99b1c611da1e6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 May 2011 20:32:40 +1000 Subject: TSAGE: Further sound driver installation logic --- engines/tsage/sound.cpp | 238 +++++++++++++++++++++++++++++++++++++++++++----- engines/tsage/sound.h | 51 +++++++++-- engines/tsage/tsage.cpp | 9 ++ engines/tsage/tsage.h | 5 +- 4 files changed, 275 insertions(+), 28 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 6082537766..73355a69e3 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -20,6 +20,7 @@ * */ +#include "common/config-manager.h" #include "tsage/core.h" #include "tsage/globals.h" #include "tsage/debugger.h" @@ -38,6 +39,7 @@ SoundManager::SoundManager() { _groupList[i] = 0; _fieldE9[i] = 0; _field109[i] = 0; + _voiceStructPtrs[i] = NULL; } _groupMask = 0; @@ -46,6 +48,7 @@ SoundManager::SoundManager() { _disableCtr = 0; _suspendedCount = 0; _driversDetected = false; + _needToRethink = false; } SoundManager::~SoundManager() { @@ -53,9 +56,9 @@ SoundManager::~SoundManager() { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->stop(); for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { - int driverNum = (*i)->_driverNum; + SoundDriver *driver = *i; ++i; - unInstallDriver(driverNum); + delete driver; } _sfTerminate(); } @@ -70,6 +73,43 @@ void SoundManager::postInit() { } } +/** + * Loops through all the loaded sounds, and stops any that have been flagged for stopping + */ +void SoundManager::dispatch() { + Common::List::iterator i = _soundList.begin(); + while (i != _soundList.end()) { + Sound *sound = *i; + ++i; + + // If the sound is flagged for stopping, then stop it + if (sound->_stopFlag) { + sound->stop(); + } + } +} + +void SoundManager::syncSounds() { + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + bool music_mute = mute; + bool sfx_mute = mute; + + if (!mute) { + music_mute = ConfMan.getBool("music_mute"); + sfx_mute = ConfMan.getBool("sfx_mute"); + } + + // Get the new music and sfx volumes + int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); + int sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); + + warning("Set volume music=%d sfx=%d", musicVolume, sfxVolume); + this->setMasterVol(musicVolume / 2); +} + Common::List &SoundManager::buildDriverList(bool detectFlag) { assert(__sndmgrReady); _availableDrivers.clear(); @@ -89,7 +129,9 @@ Common::List &SoundManager::buildDriverList(bool detectFlag) { } void SoundManager::installConfigDrivers() { +#ifdef TSAGE_SOUND installDriver(ADLIB_DRIVER_NUM); +#endif } Common::List &SoundManager::getDriverList(bool detectFlag) { @@ -299,6 +341,34 @@ void SoundManager::rethinkVoiceTypes() { _sfRethinkVoiceTypes(); } +void SoundManager::_sfSoundServer() { + if (!sfManager()._disableCtr && !sfManager()._suspendCtr) + return; + + if (sfManager()._needToRethink) { + _sfRethinkVoiceTypes(); + sfManager()._needToRethink = false; + } else { + _sfDereferenceAll(); + } + + // Handle any fading if necessary + do { + _sfProcessFading(); + } while (sfManager()._suspendCtr > 0); + sfManager()._suspendCtr = 0; + + // Poll all sound drivers in case they need it + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + (*i)->poll(); + } +} + +void SoundManager::_sfProcessFading() { + //TODO +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -348,7 +418,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { void SoundManager::_sfAddToPlayList(Sound *sound) { ++sfManager()._suspendCtr; _sfDoAddToPlayList(sound); - sound->_field6 = 0; + sound->_stopFlag = false; _sfRethinkVoiceTypes(); --sfManager()._suspendCtr; } @@ -369,7 +439,121 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { } void SoundManager::_sfRethinkSoundDrivers() { - + // Free any existing entries + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + if (sfManager()._voiceStructPtrs[idx]) { + delete sfManager()._voiceStructPtrs[idx]; + sfManager()._voiceStructPtrs[idx] = NULL; + } + } + + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + byte flag = 0xff; + int total = 0; + + // Loop through the sound drivers + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + // Process the group data for each sound driver + SoundDriver *driver = *i; + const byte *groupData = driver->_groupOffset->pData; + + while (*groupData != 0xff) { + byte byteVal = *groupData++; + + if (byteVal == idx) { + byte byteVal2 = *groupData++; + if (flag == 0xff) + flag = byteVal2; + else { + assert(flag == byteVal2); + } + + if (!flag) { + while (*groupData++ != 0xff) + ++total; + } else { + total += *groupData; + groupData += 2; + } + } else if (*groupData++ == 0) { + while (*groupData != 0xff) + ++groupData; + ++groupData; + } else { + groupData += 2; + } + } + } + + if (total) { + int dataSize = !flag ? total * 28 + 30 : total * 26 + 30; + debugC(9, ktSageSound, "data Size = %d\n", dataSize); + + VoiceStruct *vs = new VoiceStruct(); + sfManager()._voiceStructPtrs[idx] = vs; + + if (!flag) { + vs->_field0 = 0; + vs->_field1 = total; +// offset = 2; + } else { + vs->_field0 = 1; + vs->_field1 = vs->_field2 = total; +// offset = 4; + } + + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) { + // Process the group data for each sound driver + SoundDriver *driver = *i; + const byte *groupData = driver->_groupOffset->pData; + + while (*groupData != 0xff) { + byte byteVal = *groupData++; + + if (byteVal == idx) { + if (!flag) { + while ((byteVal = *groupData++) != 0xff) { + VoiceStructEntry ve; + ve._field1 = (byteVal & 0x80) ? 0 : 1; + ve._driver = driver; + ve._field4 = 0; + ve._field6 = 0; + ve._field8 = 0; + ve._field9 = 0; + ve._fieldA = 0; + + vs->_entries.push_back(ve); + } + } else { + byteVal = *groupData; + groupData += 2; + + for (int idx = 0; idx < byteVal; ++idx) { + VoiceStructEntry ve; + ve._field0 = idx; + ve._driver = driver; + ve._field4 = 0xff; + ve._field6 = 0; + ve._field8 = 0; + ve._fieldA = 0; + ve._fieldC = 0; + ve._fieldD = 0; + + vs->_entries.push_back(ve); + } + } + } else { + if (*groupData++ != 0) { + while (*groupData != 0xff) + ++groupData; + } + } + } + } + } + } } void SoundManager::_sfRethinkVoiceTypes() { @@ -467,8 +651,8 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { return false; sfManager()._installedDrivers.push_back(driver); - uint32 *maskList = driver->getGroupMaskList(); - driver->_groupMask = *maskList; + driver->_groupOffset = driver->getGroupData(); + driver->_groupMask = READ_LE_UINT32(driver->_groupOffset); _sfExtractGroupMask(); _sfRethinkSoundDrivers(); @@ -479,6 +663,7 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { sfManager()._installedDrivers.remove(driver); + delete driver; _sfExtractGroupMask(); _sfRethinkSoundDrivers(); @@ -525,10 +710,11 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { ++_globals->_soundManager._suspendCtr; for (int idx = 0; idx < 16; ++idx) { + /* Sound *snd = sfManager()._voiceStructPtrs[idx]; if (!snd) continue; - +*/ // TODO: More stuff } @@ -538,7 +724,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { /*--------------------------------------------------------------------------*/ Sound::Sound() { - _field6 = 0; + _stopFlag = false; _soundNum = 0; _groupNum = 0; _soundPriority = 0; @@ -550,7 +736,7 @@ Sound::Sound() { _loopFlag = false; _pauseCtr = 0; _muteCtr = 0; - _holdAt = false; + _holdAt = 0xff; _cueValue = -1; _volume1 = -1; _volume3 = 0; @@ -637,7 +823,7 @@ void Sound::_unPrime() { _globals->_soundManager.removeFromSoundList(this); _primed = false; - _field6 = 0; + _stopFlag = false; } } @@ -807,29 +993,30 @@ void Sound::release() { ASound::ASound(): EventHandler() { _action = NULL; - _cueFlag = false; + _cueValue = -1; } void ASound::synchronize(Serializer &s) { EventHandler::synchronize(s); SYNC_POINTER(_action); - s.syncAsByte(_cueFlag); + s.syncAsByte(_cueValue); } void ASound::dispatch() { EventHandler::dispatch(); - if (!_sound.getCueValue()) { - _cueFlag = false; - _sound.setCueValue(1); + int cueValue = _sound.getCueValue(); + if (cueValue != -1) { + _cueValue = cueValue; + _sound.setCueValue(-1); if (_action) _action->signal(); } - if (!_cueFlag) { + if (_cueValue != -1) { if (!_sound.isPrimed()) { - _cueFlag = true; + _cueValue = -1; if (_action) { _action->signal(); _action = NULL; @@ -840,7 +1027,7 @@ void ASound::dispatch() { void ASound::play(int soundNum, Action *action, int volume) { _action = action; - _cueFlag = false; + _cueValue = 0; setVol(volume); _sound.play(soundNum); @@ -853,7 +1040,7 @@ void ASound::stop() { void ASound::prime(int soundNum, Action *action) { _action = action; - _cueFlag = false; + _cueValue = 0; _sound.prime(soundNum); } @@ -875,9 +1062,18 @@ void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { SoundDriver::SoundDriver() { _driverNum = 0; _minVersion = _maxVersion = 0; - _groupMaskList = NULL; - _groupMask = 0; } +/*--------------------------------------------------------------------------*/ + +const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; + +AdlibSoundDriver::AdlibSoundDriver() { + _groupData.groupMask = 1; + _groupData.v1 = 0x46; + _groupData.v2 = 0; + _groupData.pData = &adlib_group_data[0]; +} + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 22132bc6ca..591d0e1e07 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -53,14 +53,21 @@ public: Common::String longDescription; }; +struct GroupData { + uint32 groupMask; + byte v1; + byte v2; + const byte *pData; +}; + class SoundDriver { public: Common::String _shortDescription, _longDescription; int _driverNum; int _minVersion, _maxVersion; - uint32 *_groupMaskList; // The following fields were originally held in separate arrays in the SoundManager class uint32 _groupMask; + const GroupData *_groupOffset; public: SoundDriver(); @@ -69,9 +76,32 @@ public: virtual bool open() { return true; } virtual void close() {} - virtual uint32 *getGroupMaskList() const { return _groupMaskList; } + virtual const GroupData *getGroupData() = 0; virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void poll() {} +}; + +struct VoiceStructEntry { + int _field0; + int _field1; + SoundDriver *_driver; + int _field4; + int _field6; + int _field8; + int _field9; + int _fieldA; + int _fieldC; + int _fieldD; +}; + +class VoiceStruct { +public: + int _field0; + int _field1; + int _field2; + + Common::Array _entries; }; class SoundManager : public SaveListener { @@ -94,14 +124,16 @@ public: int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; - Sound *_voiceStructPtrs[SOUND_ARR_SIZE]; + VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; + bool _needToRethink; public: SoundManager(); ~SoundManager(); - void dispatch() {} + void dispatch(); virtual void listenerSynchronize(Serializer &s); virtual void postInit(); + void syncSounds(); static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); @@ -161,6 +193,8 @@ public: static void _sfDoAddToPlayList(Sound *sound); static bool _sfDoRemoveFromPlayList(Sound *sound); static void _sfDoUpdateVolume(Sound *sound); + static void _sfSoundServer(); + static void _sfProcessFading(); }; class Sound: public EventHandler { @@ -170,7 +204,7 @@ private: void orientAfterRestore(); public: int _field0; - int _field6; + bool _stopFlag; int _soundNum; int _groupNum; int _soundPriority; @@ -246,7 +280,7 @@ class ASound: public EventHandler { public: Sound _sound; Action *_action; - bool _cueFlag; + int _cueValue; ASound(); virtual void synchronize(Serializer &s); @@ -280,9 +314,14 @@ public: }; class AdlibSoundDriver: public SoundDriver { +private: + GroupData _groupData; public: + AdlibSoundDriver(); + virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual const GroupData *getGroupData() { return &_groupData; } }; } // End of namespace tSage diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 4f55ecfb83..68d477aa0b 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -81,6 +81,9 @@ void TSageEngine::initialise() { _globals = new Globals(); _globals->gfxManager().setDefaults(); + + // Setup sound settings + syncSoundSettings(); } void TSageEngine::deinitialise() { @@ -136,4 +139,10 @@ Common::String TSageEngine::generateSaveName(int slot) { return Common::String::format("%s.%03d", _targetName.c_str(), slot); } +void TSageEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + _globals->_soundManager.syncSounds(); +} + } // End of namespace tSage diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 2228212510..3138179442 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -52,7 +52,9 @@ enum { }; enum { - kRingDebugScripts = 1 << 0 + kRingDebugScripts = 1 << 0, + ktSageSound = 1 << 1, + ktSageCore = 1 << 2 }; struct tSageGameDescription; @@ -84,6 +86,7 @@ public: virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); virtual Common::Error saveGameState(int slot, const char *desc); + virtual void syncSoundSettings(); Common::String generateSaveName(int slot); void initialise(); -- cgit v1.2.3 From a4f3907bb1c8cc7d9a861f0901135e8a8d9846b0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 24 May 2011 20:07:41 +1000 Subject: TSAGE: Added some extra code for volume control and start on rethinking voice types --- engines/tsage/sound.cpp | 113 ++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 21 ++++++++- 2 files changed, 119 insertions(+), 15 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 73355a69e3..3db5759f6f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -369,6 +369,29 @@ void SoundManager::_sfProcessFading() { //TODO } +void SoundManager::_sfUpdateVoiceStructs() { + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + + if (vs->_voiceType == VOICETYPE_0) { + vse._field4 = vse._fieldC; + vse._field6 = vse._fieldE; + vse._field8 = vse._field10; + vse._field9 = vse._field11; + vse._fieldA = vse._field12; + } else { + vse._field8 = vse._fieldE; + vse._fieldA = vse._field10; + vse._fieldC = vse._field12; + vse._fieldD = vse._field13; + } + } + } +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -494,13 +517,11 @@ void SoundManager::_sfRethinkSoundDrivers() { sfManager()._voiceStructPtrs[idx] = vs; if (!flag) { - vs->_field0 = 0; + vs->_voiceType = VOICETYPE_0; vs->_field1 = total; -// offset = 2; } else { - vs->_field0 = 1; + vs->_voiceType = VOICETYPE_1; vs->_field1 = vs->_field2 = total; -// offset = 4; } for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -557,7 +578,56 @@ void SoundManager::_sfRethinkSoundDrivers() { } void SoundManager::_sfRethinkVoiceTypes() { - + ++sfManager()._suspendCtr; + _sfDereferenceAll(); + + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + if (!vs) + continue; + + if (vs->_voiceType == VOICETYPE_0) { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._field14 = vse._field4; + vse._field16 = vse._field6; + vse._field18 = vse._field8; + vse._field19 = vse._field9; + vse._field1A = vse._fieldA; + vse._field4 = 0; + vse._field6 = 0; + vse._field8 = 0; + vse._field9 = 0; + vse._fieldA = 0; + vse._fieldC = 0; + vse._fieldE = 0; + vse._field10 = 0; + vse._field11 = 0; + vse._field12 = 0; + } + } else { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._field14 = vse._field8; + vse._field16 = vse._fieldA; + vse._field18 = vse._fieldC; + vse._field19 = vse._fieldD; + vse._field8 = 0; + vse._fieldA = 0; + vse._fieldC = 0; + vse._fieldD = 0; + vse._fieldE = 0; + vse._field10 = 0; + vse._field12 = 0; + } + } + } + + int var2 = 0; + for (Common::List::iterator playIterator = sfManager()._playList.begin(); + playIterator != sfManager()._playList.end(); ++playIterator) { + + } } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -602,7 +672,7 @@ void SoundManager::_sfSetMasterVol(int volume) { for (Common::List::iterator i = _globals->_soundManager._installedDrivers.begin(); i != _globals->_soundManager._installedDrivers.end(); ++i) { - (*i)->setVolume(volume); + (*i)->setMasterVolume(volume); } } } @@ -656,7 +726,7 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { _sfExtractGroupMask(); _sfRethinkSoundDrivers(); - driver->setVolume(sfManager()._volume); + driver->setMasterVolume(sfManager()._volume); return true; } @@ -709,13 +779,27 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { void SoundManager::_sfDoUpdateVolume(Sound *sound) { ++_globals->_soundManager._suspendCtr; - for (int idx = 0; idx < 16; ++idx) { - /* - Sound *snd = sfManager()._voiceStructPtrs[idx]; - if (!snd) + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + if (!vs) continue; -*/ - // TODO: More stuff + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + SoundDriver *driver = vse._driver; + + if (vs->_voiceType == VOICETYPE_0) { + if (!vse._field4 && !vse._field6) { + int vol = sound->_volume * sound->_field48[vse._field8] / 127; + driver->setVolume0(voiceIndex, vse._field0, 7, vol); + } + } else { + if (!vse._field8 && !vse._fieldA) { + int vol = sound->_volume * sound->_field48[vse._fieldC] / 127; + driver->setVolume1(voiceIndex, vse._field0, 7, vol); + } + } + } } --_globals->_soundManager._suspendCtr; @@ -1070,6 +1154,9 @@ SoundDriver::SoundDriver() { const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; AdlibSoundDriver::AdlibSoundDriver() { + _minVersion = 0x102; + + _groupData.groupMask = 1; _groupData.v1 = 0x46; _groupData.v2 = 0; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 591d0e1e07..145282c499 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -77,8 +77,10 @@ public: virtual bool open() { return true; } virtual void close() {} virtual const GroupData *getGroupData() = 0; - virtual void setVolume(int volume) {} + virtual void setMasterVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void setVolume0(int channel, int v2, int v3, int volume) {} + virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void poll() {} }; @@ -93,11 +95,25 @@ struct VoiceStructEntry { int _fieldA; int _fieldC; int _fieldD; + int _fieldE; + int _field10; + int _field11; + int _field12; + int _field13; + int _field14; + int _field16; + int _field18; + int _field19; + + int _field1A; + int _field1B; }; +enum VoiceType {VOICETYPE_0 = 0, VOICETYPE_1 = 1}; + class VoiceStruct { public: - int _field0; + VoiceType _voiceType; int _field1; int _field2; @@ -195,6 +211,7 @@ public: static void _sfDoUpdateVolume(Sound *sound); static void _sfSoundServer(); static void _sfProcessFading(); + static void _sfUpdateVoiceStructs(); }; class Sound: public EventHandler { -- cgit v1.2.3 From 1d190139125bd5ed0af43213c779a71b3b0615f5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 26 May 2011 20:30:30 +1000 Subject: TSAGE: Updated the separation of fields from the Sound class to the trackInfoStruct structure --- engines/tsage/resources.cpp | 4 +++- engines/tsage/sound.cpp | 46 +++++++++++++++++++++++---------------------- engines/tsage/sound.h | 20 +++++++++++++------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 676d319ba9..d24c564a1f 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -66,7 +66,9 @@ uint16 MemoryManager::allocate(uint32 size) { byte *MemoryManager::allocate2(uint32 size) { uint32 idx = allocate(size); - return lock(idx); + byte *result = lock(idx); + Common::set_to(result, result + size, 0); + return result; } byte *MemoryManager::lock(uint32 handle) { diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 329a1ea321..c66b428950 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -678,7 +678,7 @@ void SoundManager::_sfSetMasterVol(int volume) { } void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { - trackInfo->count = 0; + trackInfo->_count = 0; const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; @@ -688,14 +688,14 @@ void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *s p += 6; for (int idx = 0; idx < count; ++idx) { - if (trackInfo->count == 16) { - trackInfo->count = -1; + if (trackInfo->_count == 16) { + trackInfo->_count = -1; return; } - trackInfo->rlbList[trackInfo->count] = READ_LE_UINT16(p); - trackInfo->arr2[trackInfo->count] = READ_LE_UINT16(p + 2); - ++trackInfo->count; + trackInfo->_rlbList[trackInfo->_count] = READ_LE_UINT16(p); + trackInfo->_arr2[trackInfo->_count] = READ_LE_UINT16(p + 2); + ++trackInfo->_count; p += 4; } } @@ -829,9 +829,9 @@ Sound::Sound() { _volume4 = 0; _timeIndex = 0; _field26 = 0; - _trackInfo.count = 0; + _trackInfo._count = 0; _primed = false; - _field26C = 0; + _isEmpty = false; _field26E = NULL; } @@ -862,6 +862,7 @@ void Sound::_prime(int soundNum, bool queFlag) { if (_soundNum != -1) { // Sound number specified + _isEmpty = false; _field26E = NULL; byte *soundData = _resourceManager->getResource(RES_SOUND, soundNum, 0); _globals->_soundManager.checkResVersion(soundData); @@ -870,18 +871,19 @@ void Sound::_prime(int soundNum, bool queFlag) { _loop = _globals->_soundManager.extractLoop(soundData); _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); - for (int idx = 0; idx < _trackInfo.count; ++idx) { - _handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo.rlbList[idx]); + for (int idx = 0; idx < _trackInfo._count; ++idx) { + _trackInfo._handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); } DEALLOCATE(soundData); } else { // No sound specified + _isEmpty = true; _groupNum = 0; _soundPriority = 0; _loop = 0; - _trackInfo.count = 0; - _handleList[0] = ALLOCATE(200); + _trackInfo._count = 0; + _trackInfo._handleList[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -893,17 +895,17 @@ void Sound::_prime(int soundNum, bool queFlag) { void Sound::_unPrime() { if (_primed) { - if (_field26C) { - DEALLOCATE(_handleList[0]); + if (_isEmpty) { + DEALLOCATE(_trackInfo._handleList[0]); DEALLOCATE(_field26E); _field26E = NULL; } else { - for (int idx = 0; idx < _trackInfo.count; ++idx) { - DEALLOCATE(_handleList[idx]); + for (int idx = 0; idx < _trackInfo._count; ++idx) { + DEALLOCATE(_trackInfo._handleList[idx]); } } - _trackInfo.count = 0; + _trackInfo._count = 0; _globals->_soundManager.removeFromSoundList(this); _primed = false; @@ -912,13 +914,13 @@ void Sound::_unPrime() { } void Sound::orientAfterDriverChange() { - if (!_field26C) { + if (!_isEmpty) { int timeIndex = getTimeIndex(); - for (int idx = 0; idx < _trackInfo.count; ++idx) - DEALLOCATE(_handleList[idx]); + for (int idx = 0; idx < _trackInfo._count; ++idx) + DEALLOCATE(_trackInfo._handleList[idx]); - _trackInfo.count = 0; + _trackInfo._count = 0; _primed = false; _prime(_soundNum, true); setTimeIndex(timeIndex); @@ -926,7 +928,7 @@ void Sound::orientAfterDriverChange() { } void Sound::orientAfterRestore() { - if (_field26C) { + if (_isEmpty) { int timeIndex = getTimeIndex(); _primed = false; _prime(_soundNum, true); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 145282c499..0f361e00bd 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -37,9 +37,18 @@ class Sound; #define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { - int count; - int rlbList[SOUND_ARR_SIZE]; - int arr2[SOUND_ARR_SIZE]; + int _count; + int _rlbList[SOUND_ARR_SIZE]; + int _arr2[SOUND_ARR_SIZE]; + byte *_handleList[SOUND_ARR_SIZE]; + int field82[SOUND_ARR_SIZE]; + int field92[SOUND_ARR_SIZE]; + int fielda2[SOUND_ARR_SIZE]; + int fieldb2[SOUND_ARR_SIZE]; + int fieldf2[SOUND_ARR_SIZE]; + int field132[SOUND_ARR_SIZE]; + int field152[SOUND_ARR_SIZE]; + }; enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2}; @@ -254,11 +263,8 @@ public: int _fieldC8[SOUND_ARR_SIZE]; int _fieldE8[SOUND_ARR_SIZE]; trackInfoStruct _trackInfo; - byte *_handleList[75]; - int _field266; - int _field268; bool _primed; - int _field26C; + bool _isEmpty; byte *_field26E; public: Sound(); -- cgit v1.2.3 From fd4c55850d0afd40be779169c917bdbf34ba7959 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 May 2011 20:55:09 +1000 Subject: TSAGE: Bugfixes for sound de-initialisation --- engines/tsage/globals.cpp | 1 - engines/tsage/sound.cpp | 9 ++++++--- engines/tsage/sound.h | 3 ++- engines/tsage/tsage.cpp | 3 +++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index e38fb21237..910fd033d0 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -101,7 +101,6 @@ Globals::Globals() : } Globals::~Globals() { - _globals = NULL; delete _inventory; delete _game; } diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c66b428950..b6b434e279 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -129,9 +129,7 @@ Common::List &SoundManager::buildDriverList(bool detectFlag) { } void SoundManager::installConfigDrivers() { -#ifdef TSAGE_SOUND installDriver(ADLIB_DRIVER_NUM); -#endif } Common::List &SoundManager::getDriverList(bool detectFlag) { @@ -623,7 +621,7 @@ void SoundManager::_sfRethinkVoiceTypes() { } } - int var2 = 0; +// int var2 = 0; for (Common::List::iterator playIterator = sfManager()._playList.begin(); playIterator != sfManager()._playList.end(); ++playIterator) { @@ -835,6 +833,10 @@ Sound::Sound() { _field26E = NULL; } +Sound::~Sound() { + stop(); +} + void Sound::play(int soundNum) { prime(soundNum); _globals->_soundManager.addToPlayList(this); @@ -1158,6 +1160,7 @@ const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; AdlibSoundDriver::AdlibSoundDriver() { _minVersion = 0x102; + _maxVersion = 0x10A; _groupData.groupMask = 1; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 0f361e00bd..eebb549a76 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -257,7 +257,7 @@ public: int _field58[SOUND_ARR_SIZE]; int _field68[SOUND_ARR_SIZE]; int _field78[SOUND_ARR_SIZE]; - int _field98[SOUND_ARR_SIZE]; + int _voiceStructIndex[SOUND_ARR_SIZE]; int _fieldA8[SOUND_ARR_SIZE]; int _fieldB8[SOUND_ARR_SIZE]; int _fieldC8[SOUND_ARR_SIZE]; @@ -268,6 +268,7 @@ public: byte *_field26E; public: Sound(); + ~Sound(); void play(int soundNum); void stop(); diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 68d477aa0b..99708d617b 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -90,6 +90,9 @@ void TSageEngine::deinitialise() { delete _globals; delete _resourceManager; delete _saver; + _globals = NULL; + _resourceManager = NULL; + _saver = NULL; } Common::Error TSageEngine::run() { -- cgit v1.2.3 From 815c1537b74f3ff34e7fd395fa88093389a0b95a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 May 2011 21:19:06 +1000 Subject: TSAGE: Tweaks to the destructor sequence to fix crashes --- engines/tsage/globals.cpp | 1 + engines/tsage/sound.cpp | 91 +++++++++++++++++++++++++---------------------- engines/tsage/tsage.cpp | 1 - 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 910fd033d0..39a974173b 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -103,6 +103,7 @@ Globals::Globals() : Globals::~Globals() { delete _inventory; delete _game; + _globals = NULL; } void Globals::reset() { diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index b6b434e279..389086a97d 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -29,7 +29,12 @@ namespace tSage { +static SoundManager *_soundManager = NULL; + +/*--------------------------------------------------------------------------*/ + SoundManager::SoundManager() { + _soundManager = this; __sndmgrReady = false; _minVersion = 0x102; _maxVersion = 0x10A; @@ -62,6 +67,8 @@ SoundManager::~SoundManager() { } _sfTerminate(); } + + _soundManager = NULL; } void SoundManager::postInit() { @@ -284,9 +291,9 @@ void SoundManager::checkResVersion(const byte *soundData) { int maxVersion = READ_LE_UINT16(soundData + 4); int minVersion = READ_LE_UINT16(soundData + 6); - if (_globals->_soundManager._minVersion < minVersion) + if (_soundManager->_minVersion < minVersion) error("Attempt to play/prime sound resource that is too new"); - if (_globals->_soundManager._minVersion > maxVersion) + if (_soundManager->_minVersion > maxVersion) error("Attempt to play/prime sound resource that is too old"); } @@ -393,7 +400,7 @@ void SoundManager::_sfUpdateVoiceStructs() { /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { - _globals->_soundManager.saveNotifierProc(postFlag); + _soundManager->saveNotifierProc(postFlag); } void SoundManager::saveNotifierProc(bool postFlag) { @@ -401,7 +408,7 @@ void SoundManager::saveNotifierProc(bool postFlag) { } void SoundManager::loadNotifier(bool postFlag) { - _globals->_soundManager.loadNotifierProc(postFlag); + _soundManager->loadNotifierProc(postFlag); } void SoundManager::loadNotifierProc(bool postFlag) { @@ -416,7 +423,7 @@ void SoundManager::listenerSynchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ SoundManager &SoundManager::sfManager() { - return _globals->_soundManager; + return *_soundManager; } void SoundManager::_soSetTimeIndex(int timeIndex) { @@ -427,7 +434,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; while ((v = READ_LE_UINT32(p)) != 0) { - if ((v & _globals->_soundManager._groupMask) == v) + if ((v & _soundManager->_groupMask) == v) return v; p += 6 + (READ_LE_UINT16(p + 4) * 4); @@ -452,9 +459,9 @@ void SoundManager::_sfRemoveFromPlayList(Sound *sound) { } bool SoundManager::_sfIsOnPlayList(Sound *sound) { - ++_globals->_soundManager._suspendCtr; - bool result = contains(_globals->_soundManager._playList, sound); - --_globals->_soundManager._suspendCtr; + ++_soundManager->_suspendCtr; + bool result = contains(_soundManager->_playList, sound); + --_soundManager->_suspendCtr; return result; } @@ -640,7 +647,7 @@ void SoundManager::_sfDereferenceAll() { } void SoundManager::_sfUpdatePriority(Sound *sound) { - ++_globals->_soundManager._suspendCtr; + ++_soundManager->_suspendCtr; int tempPriority = (sound->_priority2 == 255) ? sound->_soundPriority : sound->_priority; if (sound->_priority != tempPriority) { @@ -651,7 +658,7 @@ void SoundManager::_sfUpdatePriority(Sound *sound) { } } - --_globals->_soundManager._suspendCtr; + --_soundManager->_suspendCtr; } void SoundManager::_sfUpdateLoop(Sound *sound) { @@ -665,11 +672,11 @@ void SoundManager::_sfSetMasterVol(int volume) { if (volume > 127) volume = 127; - if (volume != _globals->_soundManager._volume) { - _globals->_soundManager._volume = volume; + if (volume != _soundManager->_volume) { + _soundManager->_volume = volume; - for (Common::List::iterator i = _globals->_soundManager._installedDrivers.begin(); - i != _globals->_soundManager._installedDrivers.end(); ++i) { + for (Common::List::iterator i = _soundManager->_installedDrivers.begin(); + i != _soundManager->_installedDrivers.end(); ++i) { (*i)->setMasterVolume(volume); } } @@ -709,9 +716,9 @@ void SoundManager::_sfTerminate() { void SoundManager::_sfExtractGroupMask() { uint32 mask = 0; for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) - mask |= _globals->_soundManager._groupList[idx]; + mask |= _soundManager->_groupList[idx]; - _globals->_soundManager._groupMask = mask; + _soundManager->_groupMask = mask; } bool SoundManager::_sfInstallDriver(SoundDriver *driver) { @@ -775,7 +782,7 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { } void SoundManager::_sfDoUpdateVolume(Sound *sound) { - ++_globals->_soundManager._suspendCtr; + ++_soundManager->_suspendCtr; for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; @@ -800,7 +807,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { } } - --_globals->_soundManager._suspendCtr; + --_soundManager->_suspendCtr; } /*--------------------------------------------------------------------------*/ @@ -839,11 +846,11 @@ Sound::~Sound() { void Sound::play(int soundNum) { prime(soundNum); - _globals->_soundManager.addToPlayList(this); + _soundManager->addToPlayList(this); } void Sound::stop() { - _globals->_soundManager.removeFromPlayList(this); + _soundManager->removeFromPlayList(this); _unPrime(); } @@ -867,11 +874,11 @@ void Sound::_prime(int soundNum, bool queFlag) { _isEmpty = false; _field26E = NULL; byte *soundData = _resourceManager->getResource(RES_SOUND, soundNum, 0); - _globals->_soundManager.checkResVersion(soundData); - _groupNum = _globals->_soundManager.determineGroup(soundData); - _soundPriority = _globals->_soundManager.extractPriority(soundData); - _loop = _globals->_soundManager.extractLoop(soundData); - _globals->_soundManager.extractTrackInfo(&_trackInfo, soundData, _groupNum); + _soundManager->checkResVersion(soundData); + _groupNum = _soundManager->determineGroup(soundData); + _soundPriority = _soundManager->extractPriority(soundData); + _loop = _soundManager->extractLoop(soundData); + _soundManager->extractTrackInfo(&_trackInfo, soundData, _groupNum); for (int idx = 0; idx < _trackInfo._count; ++idx) { _trackInfo._handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); @@ -890,7 +897,7 @@ void Sound::_prime(int soundNum, bool queFlag) { } if (queFlag) - _globals->_soundManager.addToSoundList(this); + _soundManager->addToSoundList(this); _primed = true; } @@ -908,7 +915,7 @@ void Sound::_unPrime() { } _trackInfo._count = 0; - _globals->_soundManager.removeFromSoundList(this); + _soundManager->removeFromSoundList(this); _primed = false; _stopFlag = false; @@ -942,11 +949,11 @@ void Sound::go() { if (!_primed) error("Attempt to execute Sound::go() on an unprimed Sound"); - _globals->_soundManager.addToPlayList(this); + _soundManager->addToPlayList(this); } void Sound::halt(void) { - _globals->_soundManager.removeFromPlayList(this); + _soundManager->removeFromPlayList(this); } int Sound::getSoundNum() const { @@ -954,7 +961,7 @@ int Sound::getSoundNum() const { } bool Sound::isPlaying() { - return _globals->_soundManager.isOnPlayList(this); + return _soundManager->isOnPlayList(this); } bool Sound::isPrimed() const { @@ -970,31 +977,31 @@ bool Sound::isMuted() const { } void Sound::pause(bool flag) { - _globals->_soundManager.suspendSoundServer(); + _soundManager->suspendSoundServer(); if (flag) ++_pauseCtr; else if (_pauseCtr > 0) --_pauseCtr; - _globals->_soundManager.rethinkVoiceTypes(); - _globals->_soundManager.restartSoundServer(); + _soundManager->rethinkVoiceTypes(); + _soundManager->restartSoundServer(); } void Sound::mute(bool flag) { - _globals->_soundManager.suspendSoundServer(); + _soundManager->suspendSoundServer(); if (flag) ++_muteCtr; else if (_muteCtr > 0) --_muteCtr; - _globals->_soundManager.rethinkVoiceTypes(); - _globals->_soundManager.restartSoundServer(); + _soundManager->rethinkVoiceTypes(); + _soundManager->restartSoundServer(); } void Sound::fade(int volume1, int volume2, int volume3, int volume4) { - _globals->_soundManager.suspendSoundServer(); + _soundManager->suspendSoundServer(); if (volume1 > 127) volume1 = 127; @@ -1009,7 +1016,7 @@ void Sound::fade(int volume1, int volume2, int volume3, int volume4) { _volume5 = 0; _volume4 = volume4; - _globals->_soundManager.restartSoundServer(); + _soundManager->restartSoundServer(); } void Sound::setTimeIndex(uint32 timeIndex) { @@ -1039,7 +1046,7 @@ void Sound::setVol(int volume) { if (_volume != volume) { _volume = volume; if (isPlaying()) - _globals->_soundManager.updateSoundVol(this); + _soundManager->updateSoundVol(this); } } @@ -1051,12 +1058,12 @@ void Sound::setPri(int priority) { if (priority > 127) priority = 127; _priority2 = priority; - _globals->_soundManager.updateSoundPri(this); + _soundManager->updateSoundPri(this); } void Sound::setLoop(bool flag) { _loopFlag2 = flag; - _globals->_soundManager.updateSoundLoop(this); + _soundManager->updateSoundLoop(this); } int Sound::getPri() const { diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 99708d617b..cb39f66618 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -90,7 +90,6 @@ void TSageEngine::deinitialise() { delete _globals; delete _resourceManager; delete _saver; - _globals = NULL; _resourceManager = NULL; _saver = NULL; } -- cgit v1.2.3 From 339f60bb8fbb260b2952194fb9b771e41ca40f2c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 28 May 2011 09:07:30 +1000 Subject: TSAGE: Fix usage of trackInfo count field --- engines/tsage/sound.cpp | 26 +++++++++++++------------- engines/tsage/sound.h | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 389086a97d..50cb76b6ba 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -683,7 +683,7 @@ void SoundManager::_sfSetMasterVol(int volume) { } void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { - trackInfo->_count = 0; + trackInfo->_maxTrack = 0; const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; @@ -693,14 +693,14 @@ void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *s p += 6; for (int idx = 0; idx < count; ++idx) { - if (trackInfo->_count == 16) { - trackInfo->_count = -1; + if (trackInfo->_maxTrack == 16) { + trackInfo->_maxTrack = -1; return; } - trackInfo->_rlbList[trackInfo->_count] = READ_LE_UINT16(p); - trackInfo->_arr2[trackInfo->_count] = READ_LE_UINT16(p + 2); - ++trackInfo->_count; + trackInfo->_rlbList[trackInfo->_maxTrack] = READ_LE_UINT16(p); + trackInfo->_arr2[trackInfo->_maxTrack] = READ_LE_UINT16(p + 2); + ++trackInfo->_maxTrack; p += 4; } } @@ -834,7 +834,7 @@ Sound::Sound() { _volume4 = 0; _timeIndex = 0; _field26 = 0; - _trackInfo._count = 0; + _trackInfo._maxTrack = 0; _primed = false; _isEmpty = false; _field26E = NULL; @@ -880,7 +880,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _loop = _soundManager->extractLoop(soundData); _soundManager->extractTrackInfo(&_trackInfo, soundData, _groupNum); - for (int idx = 0; idx < _trackInfo._count; ++idx) { + for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) { _trackInfo._handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); } @@ -891,7 +891,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _groupNum = 0; _soundPriority = 0; _loop = 0; - _trackInfo._count = 0; + _trackInfo._maxTrack = 0; _trackInfo._handleList[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -909,12 +909,12 @@ void Sound::_unPrime() { DEALLOCATE(_field26E); _field26E = NULL; } else { - for (int idx = 0; idx < _trackInfo._count; ++idx) { + for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) { DEALLOCATE(_trackInfo._handleList[idx]); } } - _trackInfo._count = 0; + _trackInfo._maxTrack = 0; _soundManager->removeFromSoundList(this); _primed = false; @@ -926,10 +926,10 @@ void Sound::orientAfterDriverChange() { if (!_isEmpty) { int timeIndex = getTimeIndex(); - for (int idx = 0; idx < _trackInfo._count; ++idx) + for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) DEALLOCATE(_trackInfo._handleList[idx]); - _trackInfo._count = 0; + _trackInfo._maxTrack = 0; _primed = false; _prime(_soundNum, true); setTimeIndex(timeIndex); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index eebb549a76..8670eca64e 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -37,7 +37,7 @@ class Sound; #define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { - int _count; + int _maxTrack; int _rlbList[SOUND_ARR_SIZE]; int _arr2[SOUND_ARR_SIZE]; byte *_handleList[SOUND_ARR_SIZE]; -- cgit v1.2.3 From 93f92a72dcb311bdfc5be7ccc891f10b2b4d6881 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 28 May 2011 10:09:14 +1000 Subject: TSAGE: Partly reverted trackInfo changes, and fixed extract process --- engines/tsage/sound.cpp | 44 ++++++++++++++++++++++++-------------------- engines/tsage/sound.h | 2 +- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 50cb76b6ba..9ed4041148 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -683,29 +683,31 @@ void SoundManager::_sfSetMasterVol(int volume) { } void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { - trackInfo->_maxTrack = 0; + trackInfo->_count = 0; const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; while ((v = READ_LE_UINT32(p)) != 0) { - while ((v == 0x80000000) || (v == (uint)groupNum)) { + if ((v == 0x80000000) || (v == (uint)groupNum)) { + // Found group to process int count = READ_LE_UINT16(p + 4); p += 6; for (int idx = 0; idx < count; ++idx) { - if (trackInfo->_maxTrack == 16) { - trackInfo->_maxTrack = -1; + if (trackInfo->_count == 16) { + trackInfo->_count = -1; return; } - trackInfo->_rlbList[trackInfo->_maxTrack] = READ_LE_UINT16(p); - trackInfo->_arr2[trackInfo->_maxTrack] = READ_LE_UINT16(p + 2); - ++trackInfo->_maxTrack; + trackInfo->_rlbList[trackInfo->_count] = READ_LE_UINT16(p); + trackInfo->_arr2[trackInfo->_count] = READ_LE_UINT16(p + 2); + ++trackInfo->_count; p += 4; - } + } + } else { + // Not correct group, so move to next one + p += 6 + (READ_LE_UINT16(p + 4) * 4); } - - p += 6 + (READ_LE_UINT16(p + 4) * 4); } } @@ -715,8 +717,10 @@ void SoundManager::_sfTerminate() { void SoundManager::_sfExtractGroupMask() { uint32 mask = 0; - for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) - mask |= _soundManager->_groupList[idx]; + + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) + mask |= (*i)->_groupMask; _soundManager->_groupMask = mask; } @@ -834,7 +838,7 @@ Sound::Sound() { _volume4 = 0; _timeIndex = 0; _field26 = 0; - _trackInfo._maxTrack = 0; + _trackInfo._count = 0; _primed = false; _isEmpty = false; _field26E = NULL; @@ -880,7 +884,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _loop = _soundManager->extractLoop(soundData); _soundManager->extractTrackInfo(&_trackInfo, soundData, _groupNum); - for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) { + for (int idx = 0; idx < _trackInfo._count; ++idx) { _trackInfo._handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); } @@ -891,7 +895,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _groupNum = 0; _soundPriority = 0; _loop = 0; - _trackInfo._maxTrack = 0; + _trackInfo._count = 0; _trackInfo._handleList[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -909,12 +913,12 @@ void Sound::_unPrime() { DEALLOCATE(_field26E); _field26E = NULL; } else { - for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) { + for (int idx = 0; idx < _trackInfo._count; ++idx) { DEALLOCATE(_trackInfo._handleList[idx]); } } - _trackInfo._maxTrack = 0; + _trackInfo._count = 0; _soundManager->removeFromSoundList(this); _primed = false; @@ -926,10 +930,10 @@ void Sound::orientAfterDriverChange() { if (!_isEmpty) { int timeIndex = getTimeIndex(); - for (int idx = 0; idx <= _trackInfo._maxTrack; ++idx) + for (int idx = 0; idx < _trackInfo._count; ++idx) DEALLOCATE(_trackInfo._handleList[idx]); - _trackInfo._maxTrack = 0; + _trackInfo._count = 0; _primed = false; _prime(_soundNum, true); setTimeIndex(timeIndex); @@ -1170,7 +1174,7 @@ AdlibSoundDriver::AdlibSoundDriver() { _maxVersion = 0x10A; - _groupData.groupMask = 1; + _groupData.groupMask = 9; _groupData.v1 = 0x46; _groupData.v2 = 0; _groupData.pData = &adlib_group_data[0]; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 8670eca64e..eebb549a76 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -37,7 +37,7 @@ class Sound; #define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { - int _maxTrack; + int _count; int _rlbList[SOUND_ARR_SIZE]; int _arr2[SOUND_ARR_SIZE]; byte *_handleList[SOUND_ARR_SIZE]; -- cgit v1.2.3 From 12464b101fc92f0f148f59e906829c568280a455 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 1 Jun 2011 21:02:00 +1000 Subject: TSAGE: Added sound driver classes copied from CRUISE engine --- engines/tsage/sound.cpp | 659 ++++++++++++++++++++++++++++++++++++++++++++---- engines/tsage/sound.h | 175 ++++++++++++- 2 files changed, 787 insertions(+), 47 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 9ed4041148..ac77edd7d9 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -586,53 +586,41 @@ void SoundManager::_sfRethinkVoiceTypes() { ++sfManager()._suspendCtr; _sfDereferenceAll(); - for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { - VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; - if (!vs) - continue; - - if (vs->_voiceType == VOICETYPE_0) { - for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._field14 = vse._field4; - vse._field16 = vse._field6; - vse._field18 = vse._field8; - vse._field19 = vse._field9; - vse._field1A = vse._fieldA; - vse._field4 = 0; - vse._field6 = 0; - vse._field8 = 0; - vse._field9 = 0; - vse._fieldA = 0; - vse._fieldC = 0; - vse._fieldE = 0; - vse._field10 = 0; - vse._field11 = 0; - vse._field12 = 0; - } - } else { - for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._field14 = vse._field8; - vse._field16 = vse._fieldA; - vse._field18 = vse._fieldC; - vse._field19 = vse._fieldD; - vse._field8 = 0; - vse._fieldA = 0; - vse._fieldC = 0; - vse._fieldD = 0; - vse._fieldE = 0; - vse._field10 = 0; - vse._field12 = 0; - } + // Check for any active sound currently playing + for (Common::List::iterator playIterator = sfManager()._playList.begin(); + playIterator != sfManager()._playList.end(); ++playIterator) { + Sound *sound = *playIterator; + if (sound->getCueValue() >= 0) { + // Currently playing sound + // TODO: Figure out how to determine when raw playback has ended + return; } } -// int var2 = 0; + // No currently playing sound, so look for any queued sounds to play for (Common::List::iterator playIterator = sfManager()._playList.begin(); playIterator != sfManager()._playList.end(); ++playIterator) { + Sound *sound = *playIterator; + if (sound->getCueValue() == -1) { + // Found a sound to start playing + + // Get the first sound driver + assert(sfManager()._installedDrivers.size() > 0); + SoundDriver *driver = *sfManager()._installedDrivers.begin(); + + // Start each channel of the sound + for (int channelNum = 0; channelNum < sound->_trackInfo._count; ++channelNum) { + const byte *data = sound->_trackInfo._channelData[channelNum]; + int dataSize = _vm->_memoryManager.getSize(data); + + driver->play(data, dataSize, channelNum, sfManager()._volume); + } + sound->_cueValue = 0; + return; + } } + } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -885,7 +873,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _soundManager->extractTrackInfo(&_trackInfo, soundData, _groupNum); for (int idx = 0; idx < _trackInfo._count; ++idx) { - _trackInfo._handleList[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); + _trackInfo._channelData[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); } DEALLOCATE(soundData); @@ -896,7 +884,7 @@ void Sound::_prime(int soundNum, bool queFlag) { _soundPriority = 0; _loop = 0; _trackInfo._count = 0; - _trackInfo._handleList[0] = ALLOCATE(200); + _trackInfo._channelData[0] = ALLOCATE(200); _field26E = ALLOCATE(200); } @@ -909,12 +897,12 @@ void Sound::_prime(int soundNum, bool queFlag) { void Sound::_unPrime() { if (_primed) { if (_isEmpty) { - DEALLOCATE(_trackInfo._handleList[0]); + DEALLOCATE(_trackInfo._channelData[0]); DEALLOCATE(_field26E); _field26E = NULL; } else { for (int idx = 0; idx < _trackInfo._count; ++idx) { - DEALLOCATE(_trackInfo._handleList[idx]); + DEALLOCATE(_trackInfo._channelData[idx]); } } @@ -931,7 +919,7 @@ void Sound::orientAfterDriverChange() { int timeIndex = getTimeIndex(); for (int idx = 0; idx < _trackInfo._count; ++idx) - DEALLOCATE(_trackInfo._handleList[idx]); + DEALLOCATE(_trackInfo._channelData[idx]); _trackInfo._count = 0; _primed = false; @@ -1167,17 +1155,596 @@ SoundDriver::SoundDriver() { /*--------------------------------------------------------------------------*/ +const int PCSoundDriver::_noteTable[] = { + 0xEEE, 0xE17, 0xD4D, 0xC8C, 0xBD9, 0xB2F, 0xA8E, 0x9F7, + 0x967, 0x8E0, 0x861, 0x7E8, 0x777, 0x70B, 0x6A6, 0x647, + 0x5EC, 0x597, 0x547, 0x4FB, 0x4B3, 0x470, 0x430, 0x3F4, + 0x3BB, 0x385, 0x353, 0x323, 0x2F6, 0x2CB, 0x2A3, 0x27D, + 0x259, 0x238, 0x218, 0x1FA, 0x1DD, 0x1C2, 0x1A9, 0x191, + 0x17B, 0x165, 0x151, 0x13E, 0x12C, 0x11C, 0x10C, 0x0FD, + 0x0EE, 0x0E1, 0x0D4, 0x0C8, 0x0BD, 0x0B2, 0x0A8, 0x09F, + 0x096, 0x08E, 0x086, 0x07E, 0x077, 0x070, 0x06A, 0x064, + 0x05E, 0x059, 0x054, 0x04F, 0x04B, 0x047, 0x043, 0x03F, + 0x03B, 0x038, 0x035, 0x032, 0x02F, 0x02C, 0x02A, 0x027, + 0x025, 0x023, 0x021, 0x01F, 0x01D, 0x01C, 0x01A, 0x019, + 0x017, 0x016, 0x015, 0x013, 0x012, 0x011, 0x010, 0x00F +}; + +const int PCSoundDriver::_noteTableCount = ARRAYSIZE(_noteTable); + +void PCSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) { + _upCb = upCb; + _upRef = ref; +} + +void PCSoundDriver::findNote(int freq, int *note, int *oct) const { + *note = _noteTableCount - 1; + for (int i = 0; i < _noteTableCount; ++i) { + if (_noteTable[i] <= freq) { + *note = i; + break; + } + } + + *oct = *note / 12; + *note %= 12; +} + +void PCSoundDriver::resetChannel(int channel) { + stopChannel(channel); + stopAll(); +} + +void PCSoundDriver::syncSounds() { + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + bool music_mute = mute; + bool sfx_mute = mute; + + if (!mute) { + music_mute = ConfMan.getBool("music_mute"); + sfx_mute = ConfMan.getBool("sfx_mute"); + } + + // Get the new music and sfx volumes + _musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); + _sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); +} + +/*--------------------------------------------------------------------------*/ + +const int AdlibDriverBase::_freqTable[] = { + 0x157, 0x16C, 0x181, 0x198, 0x1B1, 0x1CB, + 0x1E6, 0x203, 0x222, 0x243, 0x266, 0x28A +}; + +const int AdlibDriverBase::_freqTableCount = ARRAYSIZE(_freqTable); + +const int AdlibDriverBase::_operatorsTable[] = { + 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 +}; + +const int AdlibDriverBase::_operatorsTableCount = ARRAYSIZE(_operatorsTable); + +const int AdlibDriverBase::_voiceOperatorsTable[] = { + 0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 16, 16, 14, 14, 17, 17, 13, 13 +}; + +const int AdlibDriverBase::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable); + + +AdlibDriverBase::AdlibDriverBase(Audio::Mixer *mixer) + : _mixer(mixer) { + _sampleRate = _mixer->getOutputRate(); + _opl = makeAdLibOPL(_sampleRate); + + for (int i = 0; i < 5; ++i) { + _channelsVolumeTable[i].original = 0; + _channelsVolumeTable[i].adjusted = 0; + } + memset(_instrumentsTable, 0, sizeof(_instrumentsTable)); + initCard(); + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); + + _musicVolume = ConfMan.getBool("music_mute") ? 0 : MIN(255, ConfMan.getInt("music_volume")); + _sfxVolume = ConfMan.getBool("sfx_mute") ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); +} + +AdlibDriverBase::~AdlibDriverBase() { + _mixer->stopHandle(_soundHandle); + OPLDestroy(_opl); +} + +void AdlibDriverBase::syncSounds() { + PCSoundDriver::syncSounds(); + + // Force all instruments to reload on the next playing point + for (int i = 0; i < 5; ++i) { + adjustVolume(i, _channelsVolumeTable[i].original); + AdLibSoundInstrument *ins = &_instrumentsTable[i]; + setupInstrument(ins, i); + } +} + +void AdlibDriverBase::adjustVolume(int channel, int volume) { + _channelsVolumeTable[channel].original = volume; + + if (volume > 80) { + volume = 80; + } else if (volume < 0) { + volume = 0; + } + volume += volume / 4; + if (volume > 127) { + volume = 127; + } + + int volAdjust = (channel == 4) ? _sfxVolume : _musicVolume; + volume = (volume * volAdjust) / 128; + + if (volume > 127) + volume = 127; + + _channelsVolumeTable[channel].adjusted = volume; +} + +void AdlibDriverBase::setupChannel(int channel, const byte *data, int instrument, int volume) { + assert(channel < 5); + if (data) { + adjustVolume(channel, volume); + setupInstrument(data, channel); + } +} + +void AdlibDriverBase::stopChannel(int channel) { + assert(channel < 5); + AdLibSoundInstrument *ins = &_instrumentsTable[channel]; + if (ins->mode != 0 && ins->channel == 6) { + channel = 6; + } + if (ins->mode == 0 || channel == 6) { + OPLWriteReg(_opl, 0xB0 | channel, 0); + } + if (ins->mode != 0) { + _vibrato &= ~(1 << (10 - ins->channel)); + OPLWriteReg(_opl, 0xBD, _vibrato); + } +} + +void AdlibDriverBase::stopAll() { + int i; + for (i = 0; i < 18; ++i) { + OPLWriteReg(_opl, 0x40 | _operatorsTable[i], 63); + } + for (i = 0; i < 9; ++i) { + OPLWriteReg(_opl, 0xB0 | i, 0); + } + OPLWriteReg(_opl, 0xBD, 0); +} + +int AdlibDriverBase::readBuffer(int16 *buffer, const int numSamples) { + update(buffer, numSamples); + return numSamples; +} + +void AdlibDriverBase::initCard() { + _vibrato = 0x20; + OPLWriteReg(_opl, 0xBD, _vibrato); + OPLWriteReg(_opl, 0x08, 0x40); + + static const int oplRegs[] = { 0x40, 0x60, 0x80, 0x20, 0xE0 }; + + for (int i = 0; i < 9; ++i) { + OPLWriteReg(_opl, 0xB0 | i, 0); + } + for (int i = 0; i < 9; ++i) { + OPLWriteReg(_opl, 0xC0 | i, 0); + } + + for (int j = 0; j < 5; j++) { + for (int i = 0; i < 18; ++i) { + OPLWriteReg(_opl, oplRegs[j] | _operatorsTable[i], 0); + } + } + + OPLWriteReg(_opl, 1, 0x20); + OPLWriteReg(_opl, 1, 0); +} + +void AdlibDriverBase::update(int16 *buf, int len) { + static int samplesLeft = 0; + while (len != 0) { + int count = samplesLeft; + if (count > len) { + count = len; + } + samplesLeft -= count; + len -= count; + YM3812UpdateOne(_opl, buf, count); + if (samplesLeft == 0) { + if (_upCb) { + (*_upCb)(_upRef); + } + samplesLeft = _sampleRate / 50; + } + buf += count; + } +} + +void AdlibDriverBase::setupInstrument(const byte *data, int channel) { + AdLibSoundInstrument *ins = &_instrumentsTable[channel]; + loadInstrument(data, ins); + + setupInstrument(ins, channel); +} + +void AdlibDriverBase::setupInstrument(const AdLibSoundInstrument *ins, int channel) { + int mod, car, tmp; + const AdLibRegisterSoundInstrument *reg; + + if (ins->mode != 0) { + mod = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 0]]; + car = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 1]]; + } else { + mod = _operatorsTable[_voiceOperatorsTable[2 * channel + 0]]; + car = _operatorsTable[_voiceOperatorsTable[2 * channel + 1]]; + } + + if (ins->mode == 0 || ins->channel == 6) { + reg = &ins->regMod; + OPLWriteReg(_opl, 0x20 | mod, reg->vibrato); + if (reg->freqMod) { + tmp = reg->outputLevel & 0x3F; + } else { + tmp = (63 - (reg->outputLevel & 0x3F)) * _channelsVolumeTable[channel].adjusted; + tmp = 63 - (2 * tmp + 127) / (2 * 127); + } + OPLWriteReg(_opl, 0x40 | mod, tmp | (reg->keyScaling << 6)); + OPLWriteReg(_opl, 0x60 | mod, reg->attackDecay); + OPLWriteReg(_opl, 0x80 | mod, reg->sustainRelease); + if (ins->mode != 0) { + OPLWriteReg(_opl, 0xC0 | ins->channel, reg->feedbackStrength); + } else { + OPLWriteReg(_opl, 0xC0 | channel, reg->feedbackStrength); + } + OPLWriteReg(_opl, 0xE0 | mod, ins->waveSelectMod); + } + + reg = &ins->regCar; + OPLWriteReg(_opl, 0x20 | car, reg->vibrato); + tmp = (63 - (reg->outputLevel & 0x3F)) * _channelsVolumeTable[channel].adjusted; + tmp = 63 - (2 * tmp + 127) / (2 * 127); + OPLWriteReg(_opl, 0x40 | car, tmp | (reg->keyScaling << 6)); + OPLWriteReg(_opl, 0x60 | car, reg->attackDecay); + OPLWriteReg(_opl, 0x80 | car, reg->sustainRelease); + OPLWriteReg(_opl, 0xE0 | car, ins->waveSelectCar); +} + +void AdlibDriverBase::loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg) { + reg->vibrato = 0; + if (READ_LE_UINT16(data + 18)) { // amplitude vibrato + reg->vibrato |= 0x80; + } + if (READ_LE_UINT16(data + 20)) { // frequency vibrato + reg->vibrato |= 0x40; + } + if (READ_LE_UINT16(data + 10)) { // sustaining sound + reg->vibrato |= 0x20; + } + if (READ_LE_UINT16(data + 22)) { // envelope scaling + reg->vibrato |= 0x10; + } + reg->vibrato |= READ_LE_UINT16(data + 2) & 0xF; // frequency multiplier + + reg->attackDecay = READ_LE_UINT16(data + 6) << 4; // attack rate + reg->attackDecay |= READ_LE_UINT16(data + 12) & 0xF; // decay rate + + reg->sustainRelease = READ_LE_UINT16(data + 8) << 4; // sustain level + reg->sustainRelease |= READ_LE_UINT16(data + 14) & 0xF; // release rate + + reg->feedbackStrength = READ_LE_UINT16(data + 4) << 1; // feedback + if (READ_LE_UINT16(data + 24) == 0) { // frequency modulation + reg->feedbackStrength |= 1; + } + + reg->keyScaling = READ_LE_UINT16(data); + reg->outputLevel = READ_LE_UINT16(data + 16); + reg->freqMod = READ_LE_UINT16(data + 24); +} + +/*--------------------------------------------------------------------------*/ + +void AdlibSoundDriverADL::loadInstrument(const byte *data, AdLibSoundInstrument *asi) { + asi->mode = *data++; + asi->channel = *data++; + asi->waveSelectMod = *data++ & 3; + asi->waveSelectCar = *data++ & 3; + asi->amDepth = *data++; + ++data; + loadRegisterInstrument(data, &asi->regMod); data += 26; + loadRegisterInstrument(data, &asi->regCar); data += 26; +} + +void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) { + assert(channel < 5); + AdLibSoundInstrument *ins = &_instrumentsTable[channel]; + if (ins->mode != 0) { + channel = ins->channel; + if (channel == 9) { + channel = 8; + } else if (channel == 10) { + channel = 7; + } + } + int freq, note, oct; + findNote(frequency, ¬e, &oct); + + note += oct * 12; + if (ins->amDepth) { + note = ins->amDepth; + } + if (note < 0) { + note = 0; + } + + freq = _freqTable[note % 12]; + OPLWriteReg(_opl, 0xA0 | channel, freq); + freq = ((note / 12) << 2) | ((freq & 0x300) >> 8); + if (ins->mode == 0) { + freq |= 0x20; + } + OPLWriteReg(_opl, 0xB0 | channel, freq); + if (ins->mode != 0) { + _vibrato |= 1 << (10 - channel); + OPLWriteReg(_opl, 0xBD, _vibrato); + } +} + +void AdlibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) { + adjustVolume(channel, 127); + + setupInstrument(data, channel); + AdLibSoundInstrument *ins = &_instrumentsTable[channel]; + if (ins->mode != 0 && ins->channel == 6) { + OPLWriteReg(_opl, 0xB0 | channel, 0); + } + if (ins->mode != 0) { + _vibrato &= ~(1 << (10 - ins->channel)); + OPLWriteReg(_opl, 0xBD, _vibrato); + } + if (ins->mode != 0) { + channel = ins->channel; + if (channel == 9) { + channel = 8; + } else if (channel == 10) { + channel = 7; + } + } + uint16 note = 48; + if (ins->amDepth) { + note = ins->amDepth; + } + int freq = _freqTable[note % 12]; + OPLWriteReg(_opl, 0xA0 | channel, freq); + freq = ((note / 12) << 2) | ((freq & 0x300) >> 8); + if (ins->mode == 0) { + freq |= 0x20; + } + OPLWriteReg(_opl, 0xB0 | channel, freq); + if (ins->mode != 0) { + _vibrato |= 1 << (10 - channel); + OPLWriteReg(_opl, 0xBD, _vibrato); + } +} + +/*--------------------------------------------------------------------------*/ + +PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver) + : _playing(false), _songPlayed(false), _driver(driver) { + memset(_instrumentsData, 0, sizeof(_instrumentsData)); + _sfxData = NULL; + _fadeOutCounter = 0; + _driver->setUpdateCallback(updateCallback, this); +} + +PCSoundFxPlayer::~PCSoundFxPlayer() { + _driver->setUpdateCallback(NULL, NULL); + stop(); +} + +bool PCSoundFxPlayer::load(const char *song) { + /* + debug(9, "PCSoundFxPlayer::load('%s')", song); + + // stop (w/ fade out) the previous song + while (_fadeOutCounter != 0 && _fadeOutCounter < 100) { + g_system->delayMillis(50); + } + _fadeOutCounter = 0; + + if (_playing) { + stop(); + } + + strcpy(_musicName, song); + _songPlayed = false; + _looping = false; + _sfxData = readBundleSoundFile(song); + if (!_sfxData) { + warning("Unable to load soundfx module '%s'", song); + return 0; + } + + for (int i = 0; i < NUM_INSTRUMENTS; ++i) { + _instrumentsData[i] = NULL; + + char instrument[64]; + memset(instrument, 0, 64); // Clear the data first + memcpy(instrument, _sfxData + 20 + i * 30, 12); + instrument[63] = '\0'; + + if (strlen(instrument) != 0) { + char *dot = strrchr(instrument, '.'); + if (dot) { + *dot = '\0'; + } + strcat(instrument, _driver->getInstrumentExtension()); + _instrumentsData[i] = readBundleSoundFile(instrument); + if (!_instrumentsData[i]) { + warning("Unable to load soundfx instrument '%s'", instrument); + } + } + } + */ + return 1; +} + +void PCSoundFxPlayer::play() { + debug(9, "PCSoundFxPlayer::play()"); + if (_sfxData) { + for (int i = 0; i < NUM_CHANNELS; ++i) { + _instrumentsChannelTable[i] = -1; + } + _currentPos = 0; + _currentOrder = 0; +// _numOrders = _sfxData[470]; + _eventsDelay = 5; // TODO: What to do with this? + _updateTicksCounter = 0; + _playing = true; + } +} + +void PCSoundFxPlayer::stop() { + if (_playing || _fadeOutCounter != 0) { + _fadeOutCounter = 0; + _playing = false; + for (int i = 0; i < NUM_CHANNELS; ++i) { + _driver->stopChannel(i); + } + _driver->stopAll(); + } + unload(); +} + +void PCSoundFxPlayer::fadeOut() { + if (_playing) { + _fadeOutCounter = 1; + _playing = false; + } +} + +void PCSoundFxPlayer::updateCallback(void *ref) { + ((PCSoundFxPlayer *)ref)->update(); +} + +void PCSoundFxPlayer::update() { + if (_playing || (_fadeOutCounter != 0 && _fadeOutCounter < 100)) { + ++_updateTicksCounter; + if (_updateTicksCounter > _eventsDelay) { + handleEvents(); + _updateTicksCounter = 0; + } + } +} + +void PCSoundFxPlayer::handleEvents() { + const byte *patternData = _sfxData + 600 + 1800; + const byte *orderTable = _sfxData + 472; + uint16 patternNum = orderTable[_currentOrder] * 1024; + + for (int i = 0; i < 4; ++i) { + handlePattern(i, patternData + patternNum + _currentPos); + patternData += 4; + } + + if (_fadeOutCounter != 0 && _fadeOutCounter < 100) { + _fadeOutCounter += 2; + } + if (_fadeOutCounter >= 100) { + stop(); + return; + } + + _currentPos += 16; + if (_currentPos >= 1024) { + _currentPos = 0; + ++_currentOrder; + if (_currentOrder == _numOrders) { + _currentOrder = 0; + } + } + debug(7, "_currentOrder=%d/%d _currentPos=%d", _currentOrder, _numOrders, _currentPos); +} + +void PCSoundFxPlayer::handlePattern(int channel, const byte *patternData) { + int instrument = patternData[2] >> 4; + if (instrument != 0) { + --instrument; + if (_instrumentsChannelTable[channel] != instrument || _fadeOutCounter != 0) { + _instrumentsChannelTable[channel] = instrument; + const int volume = _sfxData[instrument] - _fadeOutCounter; + _driver->setupChannel(channel, _instrumentsData[instrument], instrument, volume); + } + } + int16 freq = (int16)READ_BE_UINT16(patternData); + if (freq > 0) { + _driver->stopChannel(channel); + _driver->setChannelFrequency(channel, freq); + } +} + +void PCSoundFxPlayer::unload() { + for (int i = 0; i < NUM_INSTRUMENTS; ++i) { + free(_instrumentsData[i]); + _instrumentsData[i] = NULL; + } + free(_sfxData); + _sfxData = NULL; + _songPlayed = true; +} + +void PCSoundFxPlayer::doSync(Common::Serializer &s) { + s.syncBytes((byte *)_musicName, 33); + uint16 v = (uint16)songLoaded(); + s.syncAsSint16LE(v); + + if (s.isLoading() && v) { + load(_musicName); + + for (int i = 0; i < NUM_CHANNELS; ++i) { + _instrumentsChannelTable[i] = -1; + } + + _numOrders = _sfxData[470]; + _eventsDelay = (244 - _sfxData[471]) * 100 / 1060; + _updateTicksCounter = 0; + } + + s.syncAsSint16LE(_songPlayed); + s.syncAsSint16LE(_looping); + s.syncAsSint16LE(_currentPos); + s.syncAsSint16LE(_currentOrder); + s.syncAsSint16LE(_playing); +} + +/*--------------------------------------------------------------------------*/ + const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; AdlibSoundDriver::AdlibSoundDriver() { _minVersion = 0x102; _maxVersion = 0x10A; - _groupData.groupMask = 9; _groupData.v1 = 0x46; _groupData.v2 = 0; _groupData.pData = &adlib_group_data[0]; + + _mixer = _vm->_mixer; + _soundDriver = new AdlibSoundDriverADL(_mixer); + _player = new PCSoundFxPlayer(_soundDriver); } } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index eebb549a76..7ad4da5755 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -24,6 +24,9 @@ #define TSAGE_SOUND_H #include "common/scummsys.h" +#include "audio/audiostream.h" +#include "audio/fmopl.h" +#include "audio/mixer.h" #include "common/list.h" #include "tsage/saveload.h" #include "tsage/core.h" @@ -40,7 +43,7 @@ struct trackInfoStruct { int _count; int _rlbList[SOUND_ARR_SIZE]; int _arr2[SOUND_ARR_SIZE]; - byte *_handleList[SOUND_ARR_SIZE]; + byte *_channelData[SOUND_ARR_SIZE]; int field82[SOUND_ARR_SIZE]; int field92[SOUND_ARR_SIZE]; int fielda2[SOUND_ARR_SIZE]; @@ -90,6 +93,7 @@ public: virtual void installPatchBank(const byte *data) {} virtual void setVolume0(int channel, int v2, int v3, int volume) {} virtual void setVolume1(int channel, int v2, int v3, int volume) {} + virtual void play(const byte *data, int size, int channel, int volume) {} virtual void poll() {} }; @@ -337,15 +341,184 @@ public: void release() { _sound.release(); } }; +/*-------------------------------------------------------------------------- + * Adlib related classes + *-------------------------------------------------------------------------- + */ + +struct AdLibRegisterSoundInstrument { + uint8 vibrato; + uint8 attackDecay; + uint8 sustainRelease; + uint8 feedbackStrength; + uint8 keyScaling; + uint8 outputLevel; + uint8 freqMod; +}; + +struct AdLibSoundInstrument { + byte mode; + byte channel; + AdLibRegisterSoundInstrument regMod; + AdLibRegisterSoundInstrument regCar; + byte waveSelectMod; + byte waveSelectCar; + byte amDepth; +}; + +struct VolumeEntry { + int original; + int adjusted; +}; + +class PCSoundDriver { +public: + typedef void (*UpdateCallback)(void *); + + PCSoundDriver() { _upCb = NULL, _upRef = NULL, _musicVolume = 0, _sfxVolume = 0; } + virtual ~PCSoundDriver() {} + + virtual void setupChannel(int channel, const byte *data, int instrument, int volume) = 0; + virtual void setChannelFrequency(int channel, int frequency) = 0; + virtual void stopChannel(int channel) = 0; + virtual void playSample(const byte *data, int size, int channel, int volume) = 0; + virtual void stopAll() = 0; + virtual const char *getInstrumentExtension() const { return ""; } + virtual void syncSounds(); + + void setUpdateCallback(UpdateCallback upCb, void *ref); + void resetChannel(int channel); + void findNote(int freq, int *note, int *oct) const; +protected: + UpdateCallback _upCb; + void *_upRef; + uint8 _musicVolume; + uint8 _sfxVolume; + + static const int _noteTable[]; + static const int _noteTableCount; +}; + +class AdlibDriverBase : public PCSoundDriver, Audio::AudioStream { +public: + AdlibDriverBase(Audio::Mixer *mixer); + virtual ~AdlibDriverBase(); + + // PCSoundDriver interface + virtual void setupChannel(int channel, const byte *data, int instrument, int volume); + virtual void stopChannel(int channel); + virtual void stopAll(); + + // AudioStream interface + virtual int readBuffer(int16 *buffer, const int numSamples); + virtual bool isStereo() const { return false; } + virtual bool endOfData() const { return false; } + virtual int getRate() const { return _sampleRate; } + + void initCard(); + void update(int16 *buf, int len); + void setupInstrument(const byte *data, int channel); + void setupInstrument(const AdLibSoundInstrument *ins, int channel); + void loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg); + virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi) = 0; + virtual void syncSounds(); + + void adjustVolume(int channel, int volume); + +protected: + FM_OPL *_opl; + int _sampleRate; + Audio::Mixer *_mixer; + Audio::SoundHandle _soundHandle; + + byte _vibrato; + VolumeEntry _channelsVolumeTable[10]; + AdLibSoundInstrument _instrumentsTable[10]; + + static const int _freqTable[]; + static const int _freqTableCount; + static const int _operatorsTable[]; + static const int _operatorsTableCount; + static const int _voiceOperatorsTable[]; + static const int _voiceOperatorsTableCount; +}; + +class AdlibSoundDriverADL : public AdlibDriverBase { +public: + AdlibSoundDriverADL(Audio::Mixer *mixer) : AdlibDriverBase(mixer) {} + virtual const char *getInstrumentExtension() const { return ".ADL"; } + virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi); + virtual void setChannelFrequency(int channel, int frequency); + virtual void playSample(const byte *data, int size, int channel, int volume); +}; + +class PCSoundFxPlayer { +private: + enum { + NUM_INSTRUMENTS = 15, + NUM_CHANNELS = 4 + }; + + void update(); + void handleEvents(); + void handlePattern(int channel, const byte *patternData); + + char _musicName[33]; + bool _playing; + bool _songPlayed; + int _currentPos; + int _currentOrder; + int _numOrders; + int _eventsDelay; + bool _looping; + int _fadeOutCounter; + int _updateTicksCounter; + int _instrumentsChannelTable[NUM_CHANNELS]; + byte *_sfxData; + byte *_instrumentsData[NUM_INSTRUMENTS]; + PCSoundDriver *_driver; + +public: + PCSoundFxPlayer(PCSoundDriver *driver); + ~PCSoundFxPlayer(); + + bool load(const char *song); + void play(); + void stop(); + void unload(); + void fadeOut(); + void doSync(Common::Serializer &s); + + static void updateCallback(void *ref); + + bool songLoaded() const { return _sfxData != NULL; } + bool songPlayed() const { return _songPlayed; } + bool playing() const { return _playing; } + uint8 numOrders() const { assert(_sfxData); return _sfxData[470]; } + void setNumOrders(uint8 v) { assert(_sfxData); _sfxData[470] = v; } + void setPattern(int offset, uint8 value) { assert(_sfxData); _sfxData[472 + offset] = value; } + const char *musicName() { return _musicName; } + + // Note: Original game never actually uses looping variable. Songs are hardcoded to loop + bool looping() const { return _looping; } + void setLooping(bool v) { _looping = v; } +}; + class AdlibSoundDriver: public SoundDriver { private: GroupData _groupData; + Audio::Mixer *_mixer; + PCSoundDriver *_soundDriver; + PCSoundFxPlayer *_player; public: AdlibSoundDriver(); virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} virtual const GroupData *getGroupData() { return &_groupData; } + virtual void play(const byte *data, int size, int channel, int volume) { + _soundDriver->playSample(data, size, channel, volume); + } }; } // End of namespace tSage -- cgit v1.2.3 From b855a87d708b292df2813c0f676fd411a1021d81 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jun 2011 08:42:26 +1000 Subject: TSAGE: Removed CRUISE sound code that didn't work --- engines/tsage/sound.cpp | 612 ------------------------------------------------ engines/tsage/sound.h | 170 +------------- 2 files changed, 1 insertion(+), 781 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ac77edd7d9..e3d746ecd6 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -586,40 +586,6 @@ void SoundManager::_sfRethinkVoiceTypes() { ++sfManager()._suspendCtr; _sfDereferenceAll(); - // Check for any active sound currently playing - for (Common::List::iterator playIterator = sfManager()._playList.begin(); - playIterator != sfManager()._playList.end(); ++playIterator) { - Sound *sound = *playIterator; - if (sound->getCueValue() >= 0) { - // Currently playing sound - // TODO: Figure out how to determine when raw playback has ended - return; - } - } - - // No currently playing sound, so look for any queued sounds to play - for (Common::List::iterator playIterator = sfManager()._playList.begin(); - playIterator != sfManager()._playList.end(); ++playIterator) { - Sound *sound = *playIterator; - if (sound->getCueValue() == -1) { - // Found a sound to start playing - - // Get the first sound driver - assert(sfManager()._installedDrivers.size() > 0); - SoundDriver *driver = *sfManager()._installedDrivers.begin(); - - // Start each channel of the sound - for (int channelNum = 0; channelNum < sound->_trackInfo._count; ++channelNum) { - const byte *data = sound->_trackInfo._channelData[channelNum]; - int dataSize = _vm->_memoryManager.getSize(data); - - driver->play(data, dataSize, channelNum, sfManager()._volume); - } - - sound->_cueValue = 0; - return; - } - } } @@ -1155,582 +1121,6 @@ SoundDriver::SoundDriver() { /*--------------------------------------------------------------------------*/ -const int PCSoundDriver::_noteTable[] = { - 0xEEE, 0xE17, 0xD4D, 0xC8C, 0xBD9, 0xB2F, 0xA8E, 0x9F7, - 0x967, 0x8E0, 0x861, 0x7E8, 0x777, 0x70B, 0x6A6, 0x647, - 0x5EC, 0x597, 0x547, 0x4FB, 0x4B3, 0x470, 0x430, 0x3F4, - 0x3BB, 0x385, 0x353, 0x323, 0x2F6, 0x2CB, 0x2A3, 0x27D, - 0x259, 0x238, 0x218, 0x1FA, 0x1DD, 0x1C2, 0x1A9, 0x191, - 0x17B, 0x165, 0x151, 0x13E, 0x12C, 0x11C, 0x10C, 0x0FD, - 0x0EE, 0x0E1, 0x0D4, 0x0C8, 0x0BD, 0x0B2, 0x0A8, 0x09F, - 0x096, 0x08E, 0x086, 0x07E, 0x077, 0x070, 0x06A, 0x064, - 0x05E, 0x059, 0x054, 0x04F, 0x04B, 0x047, 0x043, 0x03F, - 0x03B, 0x038, 0x035, 0x032, 0x02F, 0x02C, 0x02A, 0x027, - 0x025, 0x023, 0x021, 0x01F, 0x01D, 0x01C, 0x01A, 0x019, - 0x017, 0x016, 0x015, 0x013, 0x012, 0x011, 0x010, 0x00F -}; - -const int PCSoundDriver::_noteTableCount = ARRAYSIZE(_noteTable); - -void PCSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) { - _upCb = upCb; - _upRef = ref; -} - -void PCSoundDriver::findNote(int freq, int *note, int *oct) const { - *note = _noteTableCount - 1; - for (int i = 0; i < _noteTableCount; ++i) { - if (_noteTable[i] <= freq) { - *note = i; - break; - } - } - - *oct = *note / 12; - *note %= 12; -} - -void PCSoundDriver::resetChannel(int channel) { - stopChannel(channel); - stopAll(); -} - -void PCSoundDriver::syncSounds() { - bool mute = false; - if (ConfMan.hasKey("mute")) - mute = ConfMan.getBool("mute"); - - bool music_mute = mute; - bool sfx_mute = mute; - - if (!mute) { - music_mute = ConfMan.getBool("music_mute"); - sfx_mute = ConfMan.getBool("sfx_mute"); - } - - // Get the new music and sfx volumes - _musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); - _sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); -} - -/*--------------------------------------------------------------------------*/ - -const int AdlibDriverBase::_freqTable[] = { - 0x157, 0x16C, 0x181, 0x198, 0x1B1, 0x1CB, - 0x1E6, 0x203, 0x222, 0x243, 0x266, 0x28A -}; - -const int AdlibDriverBase::_freqTableCount = ARRAYSIZE(_freqTable); - -const int AdlibDriverBase::_operatorsTable[] = { - 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 -}; - -const int AdlibDriverBase::_operatorsTableCount = ARRAYSIZE(_operatorsTable); - -const int AdlibDriverBase::_voiceOperatorsTable[] = { - 0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 16, 16, 14, 14, 17, 17, 13, 13 -}; - -const int AdlibDriverBase::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable); - - -AdlibDriverBase::AdlibDriverBase(Audio::Mixer *mixer) - : _mixer(mixer) { - _sampleRate = _mixer->getOutputRate(); - _opl = makeAdLibOPL(_sampleRate); - - for (int i = 0; i < 5; ++i) { - _channelsVolumeTable[i].original = 0; - _channelsVolumeTable[i].adjusted = 0; - } - memset(_instrumentsTable, 0, sizeof(_instrumentsTable)); - initCard(); - _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); - - _musicVolume = ConfMan.getBool("music_mute") ? 0 : MIN(255, ConfMan.getInt("music_volume")); - _sfxVolume = ConfMan.getBool("sfx_mute") ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); -} - -AdlibDriverBase::~AdlibDriverBase() { - _mixer->stopHandle(_soundHandle); - OPLDestroy(_opl); -} - -void AdlibDriverBase::syncSounds() { - PCSoundDriver::syncSounds(); - - // Force all instruments to reload on the next playing point - for (int i = 0; i < 5; ++i) { - adjustVolume(i, _channelsVolumeTable[i].original); - AdLibSoundInstrument *ins = &_instrumentsTable[i]; - setupInstrument(ins, i); - } -} - -void AdlibDriverBase::adjustVolume(int channel, int volume) { - _channelsVolumeTable[channel].original = volume; - - if (volume > 80) { - volume = 80; - } else if (volume < 0) { - volume = 0; - } - volume += volume / 4; - if (volume > 127) { - volume = 127; - } - - int volAdjust = (channel == 4) ? _sfxVolume : _musicVolume; - volume = (volume * volAdjust) / 128; - - if (volume > 127) - volume = 127; - - _channelsVolumeTable[channel].adjusted = volume; -} - -void AdlibDriverBase::setupChannel(int channel, const byte *data, int instrument, int volume) { - assert(channel < 5); - if (data) { - adjustVolume(channel, volume); - setupInstrument(data, channel); - } -} - -void AdlibDriverBase::stopChannel(int channel) { - assert(channel < 5); - AdLibSoundInstrument *ins = &_instrumentsTable[channel]; - if (ins->mode != 0 && ins->channel == 6) { - channel = 6; - } - if (ins->mode == 0 || channel == 6) { - OPLWriteReg(_opl, 0xB0 | channel, 0); - } - if (ins->mode != 0) { - _vibrato &= ~(1 << (10 - ins->channel)); - OPLWriteReg(_opl, 0xBD, _vibrato); - } -} - -void AdlibDriverBase::stopAll() { - int i; - for (i = 0; i < 18; ++i) { - OPLWriteReg(_opl, 0x40 | _operatorsTable[i], 63); - } - for (i = 0; i < 9; ++i) { - OPLWriteReg(_opl, 0xB0 | i, 0); - } - OPLWriteReg(_opl, 0xBD, 0); -} - -int AdlibDriverBase::readBuffer(int16 *buffer, const int numSamples) { - update(buffer, numSamples); - return numSamples; -} - -void AdlibDriverBase::initCard() { - _vibrato = 0x20; - OPLWriteReg(_opl, 0xBD, _vibrato); - OPLWriteReg(_opl, 0x08, 0x40); - - static const int oplRegs[] = { 0x40, 0x60, 0x80, 0x20, 0xE0 }; - - for (int i = 0; i < 9; ++i) { - OPLWriteReg(_opl, 0xB0 | i, 0); - } - for (int i = 0; i < 9; ++i) { - OPLWriteReg(_opl, 0xC0 | i, 0); - } - - for (int j = 0; j < 5; j++) { - for (int i = 0; i < 18; ++i) { - OPLWriteReg(_opl, oplRegs[j] | _operatorsTable[i], 0); - } - } - - OPLWriteReg(_opl, 1, 0x20); - OPLWriteReg(_opl, 1, 0); -} - -void AdlibDriverBase::update(int16 *buf, int len) { - static int samplesLeft = 0; - while (len != 0) { - int count = samplesLeft; - if (count > len) { - count = len; - } - samplesLeft -= count; - len -= count; - YM3812UpdateOne(_opl, buf, count); - if (samplesLeft == 0) { - if (_upCb) { - (*_upCb)(_upRef); - } - samplesLeft = _sampleRate / 50; - } - buf += count; - } -} - -void AdlibDriverBase::setupInstrument(const byte *data, int channel) { - AdLibSoundInstrument *ins = &_instrumentsTable[channel]; - loadInstrument(data, ins); - - setupInstrument(ins, channel); -} - -void AdlibDriverBase::setupInstrument(const AdLibSoundInstrument *ins, int channel) { - int mod, car, tmp; - const AdLibRegisterSoundInstrument *reg; - - if (ins->mode != 0) { - mod = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 0]]; - car = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 1]]; - } else { - mod = _operatorsTable[_voiceOperatorsTable[2 * channel + 0]]; - car = _operatorsTable[_voiceOperatorsTable[2 * channel + 1]]; - } - - if (ins->mode == 0 || ins->channel == 6) { - reg = &ins->regMod; - OPLWriteReg(_opl, 0x20 | mod, reg->vibrato); - if (reg->freqMod) { - tmp = reg->outputLevel & 0x3F; - } else { - tmp = (63 - (reg->outputLevel & 0x3F)) * _channelsVolumeTable[channel].adjusted; - tmp = 63 - (2 * tmp + 127) / (2 * 127); - } - OPLWriteReg(_opl, 0x40 | mod, tmp | (reg->keyScaling << 6)); - OPLWriteReg(_opl, 0x60 | mod, reg->attackDecay); - OPLWriteReg(_opl, 0x80 | mod, reg->sustainRelease); - if (ins->mode != 0) { - OPLWriteReg(_opl, 0xC0 | ins->channel, reg->feedbackStrength); - } else { - OPLWriteReg(_opl, 0xC0 | channel, reg->feedbackStrength); - } - OPLWriteReg(_opl, 0xE0 | mod, ins->waveSelectMod); - } - - reg = &ins->regCar; - OPLWriteReg(_opl, 0x20 | car, reg->vibrato); - tmp = (63 - (reg->outputLevel & 0x3F)) * _channelsVolumeTable[channel].adjusted; - tmp = 63 - (2 * tmp + 127) / (2 * 127); - OPLWriteReg(_opl, 0x40 | car, tmp | (reg->keyScaling << 6)); - OPLWriteReg(_opl, 0x60 | car, reg->attackDecay); - OPLWriteReg(_opl, 0x80 | car, reg->sustainRelease); - OPLWriteReg(_opl, 0xE0 | car, ins->waveSelectCar); -} - -void AdlibDriverBase::loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg) { - reg->vibrato = 0; - if (READ_LE_UINT16(data + 18)) { // amplitude vibrato - reg->vibrato |= 0x80; - } - if (READ_LE_UINT16(data + 20)) { // frequency vibrato - reg->vibrato |= 0x40; - } - if (READ_LE_UINT16(data + 10)) { // sustaining sound - reg->vibrato |= 0x20; - } - if (READ_LE_UINT16(data + 22)) { // envelope scaling - reg->vibrato |= 0x10; - } - reg->vibrato |= READ_LE_UINT16(data + 2) & 0xF; // frequency multiplier - - reg->attackDecay = READ_LE_UINT16(data + 6) << 4; // attack rate - reg->attackDecay |= READ_LE_UINT16(data + 12) & 0xF; // decay rate - - reg->sustainRelease = READ_LE_UINT16(data + 8) << 4; // sustain level - reg->sustainRelease |= READ_LE_UINT16(data + 14) & 0xF; // release rate - - reg->feedbackStrength = READ_LE_UINT16(data + 4) << 1; // feedback - if (READ_LE_UINT16(data + 24) == 0) { // frequency modulation - reg->feedbackStrength |= 1; - } - - reg->keyScaling = READ_LE_UINT16(data); - reg->outputLevel = READ_LE_UINT16(data + 16); - reg->freqMod = READ_LE_UINT16(data + 24); -} - -/*--------------------------------------------------------------------------*/ - -void AdlibSoundDriverADL::loadInstrument(const byte *data, AdLibSoundInstrument *asi) { - asi->mode = *data++; - asi->channel = *data++; - asi->waveSelectMod = *data++ & 3; - asi->waveSelectCar = *data++ & 3; - asi->amDepth = *data++; - ++data; - loadRegisterInstrument(data, &asi->regMod); data += 26; - loadRegisterInstrument(data, &asi->regCar); data += 26; -} - -void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) { - assert(channel < 5); - AdLibSoundInstrument *ins = &_instrumentsTable[channel]; - if (ins->mode != 0) { - channel = ins->channel; - if (channel == 9) { - channel = 8; - } else if (channel == 10) { - channel = 7; - } - } - int freq, note, oct; - findNote(frequency, ¬e, &oct); - - note += oct * 12; - if (ins->amDepth) { - note = ins->amDepth; - } - if (note < 0) { - note = 0; - } - - freq = _freqTable[note % 12]; - OPLWriteReg(_opl, 0xA0 | channel, freq); - freq = ((note / 12) << 2) | ((freq & 0x300) >> 8); - if (ins->mode == 0) { - freq |= 0x20; - } - OPLWriteReg(_opl, 0xB0 | channel, freq); - if (ins->mode != 0) { - _vibrato |= 1 << (10 - channel); - OPLWriteReg(_opl, 0xBD, _vibrato); - } -} - -void AdlibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) { - adjustVolume(channel, 127); - - setupInstrument(data, channel); - AdLibSoundInstrument *ins = &_instrumentsTable[channel]; - if (ins->mode != 0 && ins->channel == 6) { - OPLWriteReg(_opl, 0xB0 | channel, 0); - } - if (ins->mode != 0) { - _vibrato &= ~(1 << (10 - ins->channel)); - OPLWriteReg(_opl, 0xBD, _vibrato); - } - if (ins->mode != 0) { - channel = ins->channel; - if (channel == 9) { - channel = 8; - } else if (channel == 10) { - channel = 7; - } - } - uint16 note = 48; - if (ins->amDepth) { - note = ins->amDepth; - } - int freq = _freqTable[note % 12]; - OPLWriteReg(_opl, 0xA0 | channel, freq); - freq = ((note / 12) << 2) | ((freq & 0x300) >> 8); - if (ins->mode == 0) { - freq |= 0x20; - } - OPLWriteReg(_opl, 0xB0 | channel, freq); - if (ins->mode != 0) { - _vibrato |= 1 << (10 - channel); - OPLWriteReg(_opl, 0xBD, _vibrato); - } -} - -/*--------------------------------------------------------------------------*/ - -PCSoundFxPlayer::PCSoundFxPlayer(PCSoundDriver *driver) - : _playing(false), _songPlayed(false), _driver(driver) { - memset(_instrumentsData, 0, sizeof(_instrumentsData)); - _sfxData = NULL; - _fadeOutCounter = 0; - _driver->setUpdateCallback(updateCallback, this); -} - -PCSoundFxPlayer::~PCSoundFxPlayer() { - _driver->setUpdateCallback(NULL, NULL); - stop(); -} - -bool PCSoundFxPlayer::load(const char *song) { - /* - debug(9, "PCSoundFxPlayer::load('%s')", song); - - // stop (w/ fade out) the previous song - while (_fadeOutCounter != 0 && _fadeOutCounter < 100) { - g_system->delayMillis(50); - } - _fadeOutCounter = 0; - - if (_playing) { - stop(); - } - - strcpy(_musicName, song); - _songPlayed = false; - _looping = false; - _sfxData = readBundleSoundFile(song); - if (!_sfxData) { - warning("Unable to load soundfx module '%s'", song); - return 0; - } - - for (int i = 0; i < NUM_INSTRUMENTS; ++i) { - _instrumentsData[i] = NULL; - - char instrument[64]; - memset(instrument, 0, 64); // Clear the data first - memcpy(instrument, _sfxData + 20 + i * 30, 12); - instrument[63] = '\0'; - - if (strlen(instrument) != 0) { - char *dot = strrchr(instrument, '.'); - if (dot) { - *dot = '\0'; - } - strcat(instrument, _driver->getInstrumentExtension()); - _instrumentsData[i] = readBundleSoundFile(instrument); - if (!_instrumentsData[i]) { - warning("Unable to load soundfx instrument '%s'", instrument); - } - } - } - */ - return 1; -} - -void PCSoundFxPlayer::play() { - debug(9, "PCSoundFxPlayer::play()"); - if (_sfxData) { - for (int i = 0; i < NUM_CHANNELS; ++i) { - _instrumentsChannelTable[i] = -1; - } - _currentPos = 0; - _currentOrder = 0; -// _numOrders = _sfxData[470]; - _eventsDelay = 5; // TODO: What to do with this? - _updateTicksCounter = 0; - _playing = true; - } -} - -void PCSoundFxPlayer::stop() { - if (_playing || _fadeOutCounter != 0) { - _fadeOutCounter = 0; - _playing = false; - for (int i = 0; i < NUM_CHANNELS; ++i) { - _driver->stopChannel(i); - } - _driver->stopAll(); - } - unload(); -} - -void PCSoundFxPlayer::fadeOut() { - if (_playing) { - _fadeOutCounter = 1; - _playing = false; - } -} - -void PCSoundFxPlayer::updateCallback(void *ref) { - ((PCSoundFxPlayer *)ref)->update(); -} - -void PCSoundFxPlayer::update() { - if (_playing || (_fadeOutCounter != 0 && _fadeOutCounter < 100)) { - ++_updateTicksCounter; - if (_updateTicksCounter > _eventsDelay) { - handleEvents(); - _updateTicksCounter = 0; - } - } -} - -void PCSoundFxPlayer::handleEvents() { - const byte *patternData = _sfxData + 600 + 1800; - const byte *orderTable = _sfxData + 472; - uint16 patternNum = orderTable[_currentOrder] * 1024; - - for (int i = 0; i < 4; ++i) { - handlePattern(i, patternData + patternNum + _currentPos); - patternData += 4; - } - - if (_fadeOutCounter != 0 && _fadeOutCounter < 100) { - _fadeOutCounter += 2; - } - if (_fadeOutCounter >= 100) { - stop(); - return; - } - - _currentPos += 16; - if (_currentPos >= 1024) { - _currentPos = 0; - ++_currentOrder; - if (_currentOrder == _numOrders) { - _currentOrder = 0; - } - } - debug(7, "_currentOrder=%d/%d _currentPos=%d", _currentOrder, _numOrders, _currentPos); -} - -void PCSoundFxPlayer::handlePattern(int channel, const byte *patternData) { - int instrument = patternData[2] >> 4; - if (instrument != 0) { - --instrument; - if (_instrumentsChannelTable[channel] != instrument || _fadeOutCounter != 0) { - _instrumentsChannelTable[channel] = instrument; - const int volume = _sfxData[instrument] - _fadeOutCounter; - _driver->setupChannel(channel, _instrumentsData[instrument], instrument, volume); - } - } - int16 freq = (int16)READ_BE_UINT16(patternData); - if (freq > 0) { - _driver->stopChannel(channel); - _driver->setChannelFrequency(channel, freq); - } -} - -void PCSoundFxPlayer::unload() { - for (int i = 0; i < NUM_INSTRUMENTS; ++i) { - free(_instrumentsData[i]); - _instrumentsData[i] = NULL; - } - free(_sfxData); - _sfxData = NULL; - _songPlayed = true; -} - -void PCSoundFxPlayer::doSync(Common::Serializer &s) { - s.syncBytes((byte *)_musicName, 33); - uint16 v = (uint16)songLoaded(); - s.syncAsSint16LE(v); - - if (s.isLoading() && v) { - load(_musicName); - - for (int i = 0; i < NUM_CHANNELS; ++i) { - _instrumentsChannelTable[i] = -1; - } - - _numOrders = _sfxData[470]; - _eventsDelay = (244 - _sfxData[471]) * 100 / 1060; - _updateTicksCounter = 0; - } - - s.syncAsSint16LE(_songPlayed); - s.syncAsSint16LE(_looping); - s.syncAsSint16LE(_currentPos); - s.syncAsSint16LE(_currentOrder); - s.syncAsSint16LE(_playing); -} - -/*--------------------------------------------------------------------------*/ - const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; AdlibSoundDriver::AdlibSoundDriver() { @@ -1743,8 +1133,6 @@ AdlibSoundDriver::AdlibSoundDriver() { _groupData.pData = &adlib_group_data[0]; _mixer = _vm->_mixer; - _soundDriver = new AdlibSoundDriverADL(_mixer); - _player = new PCSoundFxPlayer(_soundDriver); } } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 7ad4da5755..e0c550562c 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -44,7 +44,7 @@ struct trackInfoStruct { int _rlbList[SOUND_ARR_SIZE]; int _arr2[SOUND_ARR_SIZE]; byte *_channelData[SOUND_ARR_SIZE]; - int field82[SOUND_ARR_SIZE]; + int _channelNum[SOUND_ARR_SIZE]; int field92[SOUND_ARR_SIZE]; int fielda2[SOUND_ARR_SIZE]; int fieldb2[SOUND_ARR_SIZE]; @@ -341,184 +341,16 @@ public: void release() { _sound.release(); } }; -/*-------------------------------------------------------------------------- - * Adlib related classes - *-------------------------------------------------------------------------- - */ - -struct AdLibRegisterSoundInstrument { - uint8 vibrato; - uint8 attackDecay; - uint8 sustainRelease; - uint8 feedbackStrength; - uint8 keyScaling; - uint8 outputLevel; - uint8 freqMod; -}; - -struct AdLibSoundInstrument { - byte mode; - byte channel; - AdLibRegisterSoundInstrument regMod; - AdLibRegisterSoundInstrument regCar; - byte waveSelectMod; - byte waveSelectCar; - byte amDepth; -}; - -struct VolumeEntry { - int original; - int adjusted; -}; - -class PCSoundDriver { -public: - typedef void (*UpdateCallback)(void *); - - PCSoundDriver() { _upCb = NULL, _upRef = NULL, _musicVolume = 0, _sfxVolume = 0; } - virtual ~PCSoundDriver() {} - - virtual void setupChannel(int channel, const byte *data, int instrument, int volume) = 0; - virtual void setChannelFrequency(int channel, int frequency) = 0; - virtual void stopChannel(int channel) = 0; - virtual void playSample(const byte *data, int size, int channel, int volume) = 0; - virtual void stopAll() = 0; - virtual const char *getInstrumentExtension() const { return ""; } - virtual void syncSounds(); - - void setUpdateCallback(UpdateCallback upCb, void *ref); - void resetChannel(int channel); - void findNote(int freq, int *note, int *oct) const; -protected: - UpdateCallback _upCb; - void *_upRef; - uint8 _musicVolume; - uint8 _sfxVolume; - - static const int _noteTable[]; - static const int _noteTableCount; -}; - -class AdlibDriverBase : public PCSoundDriver, Audio::AudioStream { -public: - AdlibDriverBase(Audio::Mixer *mixer); - virtual ~AdlibDriverBase(); - - // PCSoundDriver interface - virtual void setupChannel(int channel, const byte *data, int instrument, int volume); - virtual void stopChannel(int channel); - virtual void stopAll(); - - // AudioStream interface - virtual int readBuffer(int16 *buffer, const int numSamples); - virtual bool isStereo() const { return false; } - virtual bool endOfData() const { return false; } - virtual int getRate() const { return _sampleRate; } - - void initCard(); - void update(int16 *buf, int len); - void setupInstrument(const byte *data, int channel); - void setupInstrument(const AdLibSoundInstrument *ins, int channel); - void loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg); - virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi) = 0; - virtual void syncSounds(); - - void adjustVolume(int channel, int volume); - -protected: - FM_OPL *_opl; - int _sampleRate; - Audio::Mixer *_mixer; - Audio::SoundHandle _soundHandle; - - byte _vibrato; - VolumeEntry _channelsVolumeTable[10]; - AdLibSoundInstrument _instrumentsTable[10]; - - static const int _freqTable[]; - static const int _freqTableCount; - static const int _operatorsTable[]; - static const int _operatorsTableCount; - static const int _voiceOperatorsTable[]; - static const int _voiceOperatorsTableCount; -}; - -class AdlibSoundDriverADL : public AdlibDriverBase { -public: - AdlibSoundDriverADL(Audio::Mixer *mixer) : AdlibDriverBase(mixer) {} - virtual const char *getInstrumentExtension() const { return ".ADL"; } - virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi); - virtual void setChannelFrequency(int channel, int frequency); - virtual void playSample(const byte *data, int size, int channel, int volume); -}; - -class PCSoundFxPlayer { -private: - enum { - NUM_INSTRUMENTS = 15, - NUM_CHANNELS = 4 - }; - - void update(); - void handleEvents(); - void handlePattern(int channel, const byte *patternData); - - char _musicName[33]; - bool _playing; - bool _songPlayed; - int _currentPos; - int _currentOrder; - int _numOrders; - int _eventsDelay; - bool _looping; - int _fadeOutCounter; - int _updateTicksCounter; - int _instrumentsChannelTable[NUM_CHANNELS]; - byte *_sfxData; - byte *_instrumentsData[NUM_INSTRUMENTS]; - PCSoundDriver *_driver; - -public: - PCSoundFxPlayer(PCSoundDriver *driver); - ~PCSoundFxPlayer(); - - bool load(const char *song); - void play(); - void stop(); - void unload(); - void fadeOut(); - void doSync(Common::Serializer &s); - - static void updateCallback(void *ref); - - bool songLoaded() const { return _sfxData != NULL; } - bool songPlayed() const { return _songPlayed; } - bool playing() const { return _playing; } - uint8 numOrders() const { assert(_sfxData); return _sfxData[470]; } - void setNumOrders(uint8 v) { assert(_sfxData); _sfxData[470] = v; } - void setPattern(int offset, uint8 value) { assert(_sfxData); _sfxData[472 + offset] = value; } - const char *musicName() { return _musicName; } - - // Note: Original game never actually uses looping variable. Songs are hardcoded to loop - bool looping() const { return _looping; } - void setLooping(bool v) { _looping = v; } -}; - class AdlibSoundDriver: public SoundDriver { private: GroupData _groupData; Audio::Mixer *_mixer; - PCSoundDriver *_soundDriver; - PCSoundFxPlayer *_player; public: AdlibSoundDriver(); virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} virtual const GroupData *getGroupData() { return &_groupData; } - virtual void play(const byte *data, int size, int channel, int volume) { - _soundDriver->playSample(data, size, channel, volume); - } }; } // End of namespace tSage -- cgit v1.2.3 From 239e9886d682fd9bd83f09d4b16686d2dea08824 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jun 2011 09:16:56 +1000 Subject: TSAGE: Renamed Sound class fields to match Protostar debug info --- engines/tsage/sound.cpp | 188 ++++++++++++++++++++++++------------------------ engines/tsage/sound.h | 92 ++++++++++++------------ 2 files changed, 140 insertions(+), 140 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index e3d746ecd6..8456321bd8 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -90,7 +90,7 @@ void SoundManager::dispatch() { ++i; // If the sound is flagged for stopping, then stop it - if (sound->_stopFlag) { + if (sound->_stoppedAsynchronously) { sound->stop(); } } @@ -446,7 +446,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { void SoundManager::_sfAddToPlayList(Sound *sound) { ++sfManager()._suspendCtr; _sfDoAddToPlayList(sound); - sound->_stopFlag = false; + sound->_stoppedAsynchronously = false; _sfRethinkVoiceTypes(); --sfManager()._suspendCtr; } @@ -603,7 +603,7 @@ void SoundManager::_sfDereferenceAll() { void SoundManager::_sfUpdatePriority(Sound *sound) { ++_soundManager->_suspendCtr; - int tempPriority = (sound->_priority2 == 255) ? sound->_soundPriority : sound->_priority; + int tempPriority = (sound->_fixedPriority == 255) ? sound->_sndResPriority : sound->_priority; if (sound->_priority != tempPriority) { sound->_priority = tempPriority; if (_sfDoRemoveFromPlayList(sound)) { @@ -616,10 +616,10 @@ void SoundManager::_sfUpdatePriority(Sound *sound) { } void SoundManager::_sfUpdateLoop(Sound *sound) { - if (sound->_loopFlag2) - sound->_loopFlag = sound->_loop; + if (sound->_fixedLoop) + sound->_loop = sound->_sndResLoop; else - sound->_loopFlag = sound->_loopFlag2; + sound->_loop = sound->_fixedLoop; } void SoundManager::_sfSetMasterVol(int volume) { @@ -637,7 +637,7 @@ void SoundManager::_sfSetMasterVol(int volume) { } void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) { - trackInfo->_count = 0; + trackInfo->_numTracks = 0; const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; @@ -648,14 +648,14 @@ void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *s p += 6; for (int idx = 0; idx < count; ++idx) { - if (trackInfo->_count == 16) { - trackInfo->_count = -1; + if (trackInfo->_numTracks == 16) { + trackInfo->_numTracks = -1; return; } - trackInfo->_rlbList[trackInfo->_count] = READ_LE_UINT16(p); - trackInfo->_arr2[trackInfo->_count] = READ_LE_UINT16(p + 2); - ++trackInfo->_count; + trackInfo->_chunks[trackInfo->_numTracks] = READ_LE_UINT16(p); + trackInfo->_voiceTypes[trackInfo->_numTracks] = READ_LE_UINT16(p + 2); + ++trackInfo->_numTracks; p += 4; } } else { @@ -753,12 +753,12 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { if (vs->_voiceType == VOICETYPE_0) { if (!vse._field4 && !vse._field6) { - int vol = sound->_volume * sound->_field48[vse._field8] / 127; + int vol = sound->_volume * sound->_chVolume[vse._field8] / 127; driver->setVolume0(voiceIndex, vse._field0, 7, vol); } } else { if (!vse._field8 && !vse._fieldA) { - int vol = sound->_volume * sound->_field48[vse._fieldC] / 127; + int vol = sound->_volume * sound->_chVolume[vse._fieldC] / 127; driver->setVolume1(voiceIndex, vse._field0, 7, vol); } } @@ -771,31 +771,31 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { /*--------------------------------------------------------------------------*/ Sound::Sound() { - _stopFlag = false; - _soundNum = 0; - _groupNum = 0; - _soundPriority = 0; - _priority2 = -1; - _loop = true; - _loopFlag2 = true; + _stoppedAsynchronously = false; + _soundResID = 0; + _group = 0; + _sndResPriority = 0; + _fixedPriority = -1; + _sndResLoop = true; + _fixedLoop = true; _priority = 0; _volume = 127; - _loopFlag = false; - _pauseCtr = 0; - _muteCtr = 0; - _holdAt = 0xff; + _loop = false; + _pausedCount = 0; + _mutedCount = 0; + _hold = 0xff; _cueValue = -1; - _volume1 = -1; - _volume3 = 0; - _volume2 = 0; - _volume5 = 0; - _volume4 = 0; - _timeIndex = 0; - _field26 = 0; - _trackInfo._count = 0; + _fadeDest = -1; + _fadeSteps = 0; + _fadeTicks = 0; + _fadeCounter = 0; + _stopAfterFadeFlag = false; + _timer = 0; + _loopTimer = 0; + _trackInfo._numTracks = 0; _primed = false; _isEmpty = false; - _field26E = NULL; + _remoteReceiver = NULL; } Sound::~Sound() { @@ -812,10 +812,10 @@ void Sound::stop() { _unPrime(); } -void Sound::prime(int soundNum) { - if (_soundNum != -1) { +void Sound::prime(int soundResID) { + if (_soundResID != -1) { stop(); - _prime(soundNum, false); + _prime(soundResID, false); } } @@ -823,35 +823,35 @@ void Sound::unPrime() { stop(); } -void Sound::_prime(int soundNum, bool queFlag) { +void Sound::_prime(int soundResID, bool queFlag) { if (_primed) unPrime(); - if (_soundNum != -1) { + if (_soundResID != -1) { // Sound number specified _isEmpty = false; - _field26E = NULL; - byte *soundData = _resourceManager->getResource(RES_SOUND, soundNum, 0); + _remoteReceiver = NULL; + byte *soundData = _resourceManager->getResource(RES_SOUND, soundResID, 0); _soundManager->checkResVersion(soundData); - _groupNum = _soundManager->determineGroup(soundData); - _soundPriority = _soundManager->extractPriority(soundData); - _loop = _soundManager->extractLoop(soundData); - _soundManager->extractTrackInfo(&_trackInfo, soundData, _groupNum); + _group = _soundManager->determineGroup(soundData); + _sndResPriority = _soundManager->extractPriority(soundData); + _sndResLoop = _soundManager->extractLoop(soundData); + _soundManager->extractTrackInfo(&_trackInfo, soundData, _group); - for (int idx = 0; idx < _trackInfo._count; ++idx) { - _trackInfo._channelData[idx] = _resourceManager->getResource(RES_SOUND, soundNum, _trackInfo._rlbList[idx]); + for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { + _channelData[idx] = _resourceManager->getResource(RES_SOUND, soundResID, _trackInfo._chunks[idx]); } DEALLOCATE(soundData); } else { // No sound specified _isEmpty = true; - _groupNum = 0; - _soundPriority = 0; - _loop = 0; - _trackInfo._count = 0; - _trackInfo._channelData[0] = ALLOCATE(200); - _field26E = ALLOCATE(200); + _group = 0; + _sndResPriority = 0; + _sndResLoop = 0; + _trackInfo._numTracks = 0; + _channelData[0] = ALLOCATE(200); + _remoteReceiver = ALLOCATE(200); } if (queFlag) @@ -863,20 +863,20 @@ void Sound::_prime(int soundNum, bool queFlag) { void Sound::_unPrime() { if (_primed) { if (_isEmpty) { - DEALLOCATE(_trackInfo._channelData[0]); - DEALLOCATE(_field26E); - _field26E = NULL; + DEALLOCATE(_channelData[0]); + DEALLOCATE(_remoteReceiver); + _remoteReceiver = NULL; } else { - for (int idx = 0; idx < _trackInfo._count; ++idx) { - DEALLOCATE(_trackInfo._channelData[idx]); + for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { + DEALLOCATE(_channelData[idx]); } } - _trackInfo._count = 0; + _trackInfo._numTracks = 0; _soundManager->removeFromSoundList(this); _primed = false; - _stopFlag = false; + _stoppedAsynchronously = false; } } @@ -884,12 +884,12 @@ void Sound::orientAfterDriverChange() { if (!_isEmpty) { int timeIndex = getTimeIndex(); - for (int idx = 0; idx < _trackInfo._count; ++idx) - DEALLOCATE(_trackInfo._channelData[idx]); + for (int idx = 0; idx < _trackInfo._numTracks; ++idx) + DEALLOCATE(_channelData[idx]); - _trackInfo._count = 0; + _trackInfo._numTracks = 0; _primed = false; - _prime(_soundNum, true); + _prime(_soundResID, true); setTimeIndex(timeIndex); } } @@ -898,7 +898,7 @@ void Sound::orientAfterRestore() { if (_isEmpty) { int timeIndex = getTimeIndex(); _primed = false; - _prime(_soundNum, true); + _prime(_soundResID, true); setTimeIndex(timeIndex); } } @@ -915,7 +915,7 @@ void Sound::halt(void) { } int Sound::getSoundNum() const { - return _soundNum; + return _soundResID; } bool Sound::isPlaying() { @@ -927,20 +927,20 @@ bool Sound::isPrimed() const { } bool Sound::isPaused() const { - return _pauseCtr != 0; + return _pausedCount != 0; } bool Sound::isMuted() const { - return _muteCtr != 0; + return _mutedCount != 0; } void Sound::pause(bool flag) { _soundManager->suspendSoundServer(); if (flag) - ++_pauseCtr; - else if (_pauseCtr > 0) - --_pauseCtr; + ++_pausedCount; + else if (_pausedCount > 0) + --_pausedCount; _soundManager->rethinkVoiceTypes(); _soundManager->restartSoundServer(); @@ -950,29 +950,29 @@ void Sound::mute(bool flag) { _soundManager->suspendSoundServer(); if (flag) - ++_muteCtr; - else if (_muteCtr > 0) - --_muteCtr; + ++_mutedCount; + else if (_mutedCount > 0) + --_mutedCount; _soundManager->rethinkVoiceTypes(); _soundManager->restartSoundServer(); } -void Sound::fade(int volume1, int volume2, int volume3, int volume4) { +void Sound::fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag) { _soundManager->suspendSoundServer(); - if (volume1 > 127) - volume1 = 127; - if (volume2 > 127) - volume2 = 127; - if (volume3 > 255) - volume3 = 255; + if (fadeDest > 127) + fadeDest = 127; + if (fadeTicks > 127) + fadeTicks = 127; + if (fadeSteps > 255) + fadeSteps = 255; - _volume1 = volume1; - _volume2 = volume2; - _volume3 = volume3; - _volume5 = 0; - _volume4 = volume4; + _fadeDest = fadeDest; + _fadeTicks = fadeTicks; + _fadeSteps = fadeSteps; + _fadeCounter = 0; + _stopAfterFadeFlag = stopAfterFadeFlag; _soundManager->restartSoundServer(); } @@ -986,7 +986,7 @@ void Sound::setTimeIndex(uint32 timeIndex) { } uint32 Sound::getTimeIndex() const { - return _timeIndex; + return _timer; } int Sound::getCueValue() const { @@ -1015,12 +1015,12 @@ int Sound::getVol() const { void Sound::setPri(int priority) { if (priority > 127) priority = 127; - _priority2 = priority; + _fixedPriority = priority; _soundManager->updateSoundPri(this); } void Sound::setLoop(bool flag) { - _loopFlag2 = flag; + _fixedLoop = flag; _soundManager->updateSoundLoop(this); } @@ -1029,17 +1029,17 @@ int Sound::getPri() const { } bool Sound::getLoop() { - return _loopFlag; + return _loop; } void Sound::holdAt(int amount) { if (amount > 127) amount = 127; - _holdAt = amount; + _hold = amount; } void Sound::release() { - _holdAt = -1; + _hold = -1; } /*--------------------------------------------------------------------------*/ @@ -1092,10 +1092,10 @@ void ASound::stop() { _action = NULL; } -void ASound::prime(int soundNum, Action *action) { +void ASound::prime(int soundResID, Action *action) { _action = action; _cueValue = 0; - _sound.prime(soundNum); + _sound.prime(soundResID); } void ASound::unPrime() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index e0c550562c..9f7ea34e93 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -40,18 +40,9 @@ class Sound; #define ADLIB_DRIVER_NUM 3 struct trackInfoStruct { - int _count; - int _rlbList[SOUND_ARR_SIZE]; - int _arr2[SOUND_ARR_SIZE]; - byte *_channelData[SOUND_ARR_SIZE]; - int _channelNum[SOUND_ARR_SIZE]; - int field92[SOUND_ARR_SIZE]; - int fielda2[SOUND_ARR_SIZE]; - int fieldb2[SOUND_ARR_SIZE]; - int fieldf2[SOUND_ARR_SIZE]; - int field132[SOUND_ARR_SIZE]; - int field152[SOUND_ARR_SIZE]; - + int _numTracks; + int _chunks[SOUND_ARR_SIZE]; + int _voiceTypes[SOUND_ARR_SIZE]; }; enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2}; @@ -229,54 +220,63 @@ public: class Sound: public EventHandler { private: - void _prime(int soundNum, bool queFlag); + void _prime(int soundResID, bool queFlag); void _unPrime(); void orientAfterRestore(); public: int _field0; - bool _stopFlag; - int _soundNum; - int _groupNum; - int _soundPriority; - int _priority2; - int _loop; - bool _loopFlag2; + bool _stoppedAsynchronously; + int _soundResID; + int _group; + int _sndResPriority; + int _fixedPriority; + int _sndResLoop; + bool _fixedLoop; int _priority; int _volume; - bool _loopFlag; - int _pauseCtr; - int _muteCtr; - int _holdAt; + bool _loop; + int _pausedCount; + int _mutedCount; + int _hold; int _cueValue; - int _volume1; - int _volume3; - int _volume2; - int _volume5; - int _volume4; - uint _timeIndex; - int _field26; - int _field28[SOUND_ARR_SIZE]; - int _field38[SOUND_ARR_SIZE]; - int _field48[SOUND_ARR_SIZE]; - int _field58[SOUND_ARR_SIZE]; - int _field68[SOUND_ARR_SIZE]; - int _field78[SOUND_ARR_SIZE]; - int _voiceStructIndex[SOUND_ARR_SIZE]; - int _fieldA8[SOUND_ARR_SIZE]; - int _fieldB8[SOUND_ARR_SIZE]; - int _fieldC8[SOUND_ARR_SIZE]; - int _fieldE8[SOUND_ARR_SIZE]; + int _fadeDest; + int _fadeSteps; + int _fadeTicks; + int _fadeCounter; + bool _stopAfterFadeFlag; + uint _timer; + int _loopTimer; + int _chProgram[SOUND_ARR_SIZE]; + int _chModulation[SOUND_ARR_SIZE]; + int _chVolume[SOUND_ARR_SIZE]; + int _chPan[SOUND_ARR_SIZE]; + int _chDamper[SOUND_ARR_SIZE]; + int _chPitchBlend[SOUND_ARR_SIZE]; + int _chVoiceType[SOUND_ARR_SIZE]; + int _chNumVoices[SOUND_ARR_SIZE]; + int _chSubPriority[SOUND_ARR_SIZE]; + int _chFlags[SOUND_ARR_SIZE]; + int _chWork[SOUND_ARR_SIZE]; trackInfoStruct _trackInfo; + byte *_channelData[SOUND_ARR_SIZE]; + int _trkChannel[SOUND_ARR_SIZE]; + int _trkState[SOUND_ARR_SIZE]; + int _trkLoopState[SOUND_ARR_SIZE]; + int _trkIndex[SOUND_ARR_SIZE]; + int _trkLoopIndex[SOUND_ARR_SIZE]; + int _trkRest[SOUND_ARR_SIZE]; + int _trkLoopRest[SOUND_ARR_SIZE]; + bool _primed; bool _isEmpty; - byte *_field26E; + byte *_remoteReceiver; public: Sound(); ~Sound(); - void play(int soundNum); + void play(int soundResID); void stop(); - void prime(int soundNum); + void prime(int soundResID); void unPrime(); void go(); void halt(void); @@ -287,7 +287,7 @@ public: bool isMuted() const; void pause(bool flag); void mute(bool flag); - void fade(int volume1, int volume2, int volume3, int v4); + void fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; int getCueValue() const; -- cgit v1.2.3 From ce7c00f509346bdecffac5f4e84a9c27ff45d8d1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jun 2011 09:44:48 +1000 Subject: TSAGE: Changed SoundManager fields to match Protostar debug info --- engines/tsage/sound.cpp | 91 +++++++++++++++++++++++-------------------------- engines/tsage/sound.h | 20 +++++------ 2 files changed, 51 insertions(+), 60 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 8456321bd8..64ac602be7 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -36,21 +36,16 @@ static SoundManager *_soundManager = NULL; SoundManager::SoundManager() { _soundManager = this; __sndmgrReady = false; - _minVersion = 0x102; - _maxVersion = 0x10A; + _ourSndResVersion = 0x102; + _ourDrvResVersion = 0x10A; - for (int i = 0; i < SOUND_ARR_SIZE; ++i) { - _field89[i] = 0; - _groupList[i] = 0; - _fieldE9[i] = 0; - _field109[i] = 0; + for (int i = 0; i < SOUND_ARR_SIZE; ++i) _voiceStructPtrs[i] = NULL; - } - _groupMask = 0; - _volume = 127; - _suspendCtr = 0; - _disableCtr = 0; + _groupsAvail = 0; + _masterVol = 127; + _serverSuspendedCount = 0; + _serverDisabledCount = 0; _suspendedCount = 0; _driversDetected = false; _needToRethink = false; @@ -151,21 +146,21 @@ void SoundManager::dumpDriverList() { } void SoundManager::disableSoundServer() { - ++_disableCtr; + ++_serverDisabledCount; } void SoundManager::enableSoundServer() { - if (_disableCtr > 0) - --_disableCtr; + if (_serverDisabledCount > 0) + --_serverDisabledCount; } void SoundManager::suspendSoundServer() { - ++_suspendCtr; + ++_serverSuspendedCount; } void SoundManager::restartSoundServer() { - if (_suspendCtr > 0) - --_suspendCtr; + if (_serverSuspendedCount > 0) + --_serverSuspendedCount; } /** @@ -181,7 +176,7 @@ void SoundManager::installDriver(int driverNum) { if (!driver) return; - assert((_maxVersion >= driver->_minVersion) && (_maxVersion <= driver->_maxVersion)); + assert((_ourDrvResVersion >= driver->_minVersion) && (_ourDrvResVersion <= driver->_maxVersion)); // Mute any loaded sounds disableSoundServer(); @@ -230,7 +225,7 @@ SoundDriver *SoundManager::instantiateDriver(int driverNum) { void SoundManager::unInstallDriver(int driverNum) { Common::List::const_iterator i; for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { - if ((*i)->_driverNum == driverNum) { + if ((*i)->_driverResID == driverNum) { // Found driver to remove // Mute any loaded sounds @@ -260,7 +255,7 @@ void SoundManager::unInstallDriver(int driverNum) { bool SoundManager::isInstalled(int driverNum) const { Common::List::const_iterator i; for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) { - if ((*i)->_driverNum == driverNum) + if ((*i)->_driverResID == driverNum) return true; } @@ -272,7 +267,7 @@ void SoundManager::setMasterVol(int volume) { } int SoundManager::getMasterVol() const { - return _volume; + return _masterVol; } void SoundManager::loadSound(int soundNum, bool showErrors) { @@ -291,9 +286,9 @@ void SoundManager::checkResVersion(const byte *soundData) { int maxVersion = READ_LE_UINT16(soundData + 4); int minVersion = READ_LE_UINT16(soundData + 6); - if (_soundManager->_minVersion < minVersion) + if (_soundManager->_ourSndResVersion < minVersion) error("Attempt to play/prime sound resource that is too new"); - if (_soundManager->_minVersion > maxVersion) + if (_soundManager->_ourSndResVersion > maxVersion) error("Attempt to play/prime sound resource that is too old"); } @@ -347,7 +342,7 @@ void SoundManager::rethinkVoiceTypes() { } void SoundManager::_sfSoundServer() { - if (!sfManager()._disableCtr && !sfManager()._suspendCtr) + if (!sfManager()._serverDisabledCount && !sfManager()._serverSuspendedCount) return; if (sfManager()._needToRethink) { @@ -360,8 +355,8 @@ void SoundManager::_sfSoundServer() { // Handle any fading if necessary do { _sfProcessFading(); - } while (sfManager()._suspendCtr > 0); - sfManager()._suspendCtr = 0; + } while (sfManager()._serverSuspendedCount > 0); + sfManager()._serverSuspendedCount = 0; // Poll all sound drivers in case they need it for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -434,7 +429,7 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; while ((v = READ_LE_UINT32(p)) != 0) { - if ((v & _soundManager->_groupMask) == v) + if ((v & _soundManager->_groupsAvail) == v) return v; p += 6 + (READ_LE_UINT16(p + 4) * 4); @@ -444,24 +439,24 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { } void SoundManager::_sfAddToPlayList(Sound *sound) { - ++sfManager()._suspendCtr; + ++sfManager()._serverSuspendedCount; _sfDoAddToPlayList(sound); sound->_stoppedAsynchronously = false; _sfRethinkVoiceTypes(); - --sfManager()._suspendCtr; + --sfManager()._serverSuspendedCount; } void SoundManager::_sfRemoveFromPlayList(Sound *sound) { - ++sfManager()._suspendCtr; + ++sfManager()._serverSuspendedCount; if (_sfDoRemoveFromPlayList(sound)) _sfRethinkVoiceTypes(); - --sfManager()._suspendCtr; + --sfManager()._serverSuspendedCount; } bool SoundManager::_sfIsOnPlayList(Sound *sound) { - ++_soundManager->_suspendCtr; + ++_soundManager->_serverSuspendedCount; bool result = contains(_soundManager->_playList, sound); - --_soundManager->_suspendCtr; + --_soundManager->_serverSuspendedCount; return result; } @@ -583,7 +578,7 @@ void SoundManager::_sfRethinkSoundDrivers() { } void SoundManager::_sfRethinkVoiceTypes() { - ++sfManager()._suspendCtr; + ++sfManager()._serverSuspendedCount; _sfDereferenceAll(); @@ -601,7 +596,7 @@ void SoundManager::_sfDereferenceAll() { } void SoundManager::_sfUpdatePriority(Sound *sound) { - ++_soundManager->_suspendCtr; + ++_soundManager->_serverSuspendedCount; int tempPriority = (sound->_fixedPriority == 255) ? sound->_sndResPriority : sound->_priority; if (sound->_priority != tempPriority) { @@ -612,7 +607,7 @@ void SoundManager::_sfUpdatePriority(Sound *sound) { } } - --_soundManager->_suspendCtr; + --_soundManager->_serverSuspendedCount; } void SoundManager::_sfUpdateLoop(Sound *sound) { @@ -626,8 +621,8 @@ void SoundManager::_sfSetMasterVol(int volume) { if (volume > 127) volume = 127; - if (volume != _soundManager->_volume) { - _soundManager->_volume = volume; + if (volume != _soundManager->_masterVol) { + _soundManager->_masterVol = volume; for (Common::List::iterator i = _soundManager->_installedDrivers.begin(); i != _soundManager->_installedDrivers.end(); ++i) { @@ -676,7 +671,7 @@ void SoundManager::_sfExtractGroupMask() { i != sfManager()._installedDrivers.end(); ++i) mask |= (*i)->_groupMask; - _soundManager->_groupMask = mask; + _soundManager->_groupsAvail = mask; } bool SoundManager::_sfInstallDriver(SoundDriver *driver) { @@ -689,7 +684,7 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { _sfExtractGroupMask(); _sfRethinkSoundDrivers(); - driver->setMasterVolume(sfManager()._volume); + driver->setMasterVolume(sfManager()._masterVol); return true; } @@ -710,21 +705,21 @@ void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData * Adds the specified sound in the playing sound list, inserting in order of priority */ void SoundManager::_sfDoAddToPlayList(Sound *sound) { - ++sfManager()._suspendCtr; + ++sfManager()._serverSuspendedCount; Common::List::iterator i = sfManager()._playList.begin(); while ((i != sfManager()._playList.end()) && (sound->_priority > (*i)->_priority)) ++i; sfManager()._playList.insert(i, sound); - --sfManager()._suspendCtr; + --sfManager()._serverSuspendedCount; } /** * Removes the specified sound from the play list */ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { - ++sfManager()._suspendCtr; + ++sfManager()._serverSuspendedCount; bool result = false; for (Common::List::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) { @@ -735,12 +730,12 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { } } - --sfManager()._suspendCtr; + --sfManager()._serverSuspendedCount; return result; } void SoundManager::_sfDoUpdateVolume(Sound *sound) { - ++_soundManager->_suspendCtr; + ++_soundManager->_serverSuspendedCount; for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; @@ -765,7 +760,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { } } - --_soundManager->_suspendCtr; + --_soundManager->_serverSuspendedCount; } /*--------------------------------------------------------------------------*/ @@ -1114,7 +1109,7 @@ void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { /*--------------------------------------------------------------------------*/ SoundDriver::SoundDriver() { - _driverNum = 0; + _driverResID = 0; _minVersion = _maxVersion = 0; _groupMask = 0; } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 9f7ea34e93..9765059489 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -66,11 +66,11 @@ struct GroupData { class SoundDriver { public: Common::String _shortDescription, _longDescription; - int _driverNum; int _minVersion, _maxVersion; // The following fields were originally held in separate arrays in the SoundManager class uint32 _groupMask; const GroupData *_groupOffset; + int _driverResID; public: SoundDriver(); @@ -129,22 +129,18 @@ private: SoundDriver *instantiateDriver(int driverNum); public: bool __sndmgrReady; - int _minVersion, _maxVersion; + int _ourSndResVersion, _ourDrvResVersion; Common::List _playList; - int _field109[SOUND_ARR_SIZE]; - uint32 _groupMask; - int _volume; - int _disableCtr; - int _suspendCtr; + Common::List _installedDrivers; + VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; + uint32 _groupsAvail; + int _masterVol; + int _serverDisabledCount; + int _serverSuspendedCount; int _suspendedCount; bool _driversDetected; Common::List _soundList; Common::List _availableDrivers; - Common::List _installedDrivers; - int _field89[SOUND_ARR_SIZE]; - uint16 _groupList[SOUND_ARR_SIZE]; - int _fieldE9[SOUND_ARR_SIZE]; - VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; bool _needToRethink; public: SoundManager(); -- cgit v1.2.3 From 72148570de56e5c42e2fe8091e9b466610e49785 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 5 Jun 2011 11:00:00 +0200 Subject: DREAMWEB: Add original Dreamweb assembly sources They have been released under the GPL with permission from Neil Dodwell. Note that the version of these sources that was added in 9599894a4b2f79672fc3e2ca5a93ef9c7d457c08 has been tweaked to prepare for processing by tasmrecover. --- devtools/tasmrecover/dreamweb/LICENSE | 339 ++ devtools/tasmrecover/dreamweb/backdrop.asm | 877 ++++ devtools/tasmrecover/dreamweb/debug.asm | 382 ++ devtools/tasmrecover/dreamweb/dreamweb.asm | 6276 ++++++++++++++++++++++++++++ devtools/tasmrecover/dreamweb/keypad.asm | 1758 ++++++++ devtools/tasmrecover/dreamweb/look.asm | 167 + devtools/tasmrecover/dreamweb/monitor.asm | 1496 +++++++ devtools/tasmrecover/dreamweb/newplace.asm | 581 +++ devtools/tasmrecover/dreamweb/object.asm | 2608 ++++++++++++ devtools/tasmrecover/dreamweb/print.asm | 591 +++ devtools/tasmrecover/dreamweb/saveload.asm | 1489 +++++++ devtools/tasmrecover/dreamweb/sblaster.asm | 1293 ++++++ devtools/tasmrecover/dreamweb/sprite.asm | 5034 ++++++++++++++++++++++ devtools/tasmrecover/dreamweb/talk.asm | 569 +++ devtools/tasmrecover/dreamweb/titles.asm | 528 +++ devtools/tasmrecover/dreamweb/use.asm | 3810 +++++++++++++++++ devtools/tasmrecover/dreamweb/vars.asm | 564 +++ devtools/tasmrecover/dreamweb/vgafades.asm | 867 ++++ devtools/tasmrecover/dreamweb/vgagrafx.asm | 1762 ++++++++ 19 files changed, 30991 insertions(+) create mode 100644 devtools/tasmrecover/dreamweb/LICENSE create mode 100644 devtools/tasmrecover/dreamweb/backdrop.asm create mode 100644 devtools/tasmrecover/dreamweb/debug.asm create mode 100644 devtools/tasmrecover/dreamweb/dreamweb.asm create mode 100644 devtools/tasmrecover/dreamweb/keypad.asm create mode 100644 devtools/tasmrecover/dreamweb/look.asm create mode 100644 devtools/tasmrecover/dreamweb/monitor.asm create mode 100644 devtools/tasmrecover/dreamweb/newplace.asm create mode 100644 devtools/tasmrecover/dreamweb/object.asm create mode 100644 devtools/tasmrecover/dreamweb/print.asm create mode 100644 devtools/tasmrecover/dreamweb/saveload.asm create mode 100644 devtools/tasmrecover/dreamweb/sblaster.asm create mode 100644 devtools/tasmrecover/dreamweb/sprite.asm create mode 100644 devtools/tasmrecover/dreamweb/talk.asm create mode 100644 devtools/tasmrecover/dreamweb/titles.asm create mode 100644 devtools/tasmrecover/dreamweb/use.asm create mode 100644 devtools/tasmrecover/dreamweb/vars.asm create mode 100644 devtools/tasmrecover/dreamweb/vgafades.asm create mode 100644 devtools/tasmrecover/dreamweb/vgagrafx.asm diff --git a/devtools/tasmrecover/dreamweb/LICENSE b/devtools/tasmrecover/dreamweb/LICENSE new file mode 100644 index 0000000000..d159169d10 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm new file mode 100644 index 0000000000..c02d95bbe9 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/backdrop.asm @@ -0,0 +1,877 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;----------------------------------------------Code to draw floor and panel---- + +Blockget proc near + + mov ah,al + mov al,0 + mov ds,backdrop + mov si,blocks + add si,ax + ret + + endp + + + + + + + + + + + + + + + + +;--------------------------------------------------------Background display---- + + + + + + + + +Drawfloor proc near + + push es bx ;in case this was called during + call eraseoldobs ;some sprite update. + call drawflags + call calcmapad + call doblocks + call showallobs + call showallfree + call showallex + call paneltomap + call initrain + mov newobs,0 + pop bx es + ret + + endp + + + + + + + + + + + + + + + + + + +Calcmapad proc near + + call getdimension + + push cx dx + + mov al,11 + sub al,dl + sub al,cl + sub al,cl + cbw + mov bx,8 + mul bx + add ax,mapoffsetx + mov mapadx,ax + pop dx cx + + mov al,10 + sub al,dh + sub al,ch + sub al,ch + cbw + mov bx,8 + mul bx + add ax,mapoffsety + mov mapady,ax + ret + + endp + + + + + + + + + +Getdimension proc near ;Routine finds width, length + ;and top corner of room + + mov es,buffers + mov bx,mapflags + mov ch,0 +dimloop1: call addalong + cmp al,0 + jnz finishdim1 + inc ch + jmp dimloop1 ;ch holds y of top corner + +finishdim1: mov bx,mapflags + mov cl,0 +dimloop2: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim2 + inc cl + add bx,3 + jmp dimloop2 ;cl holds x of top corner + +finishdim2: mov bx,mapflags+(11*3*9) + mov dh,10 +dimloop3: push bx + call addalong + pop bx + cmp al,0 + jnz finishdim3 + dec dh + sub bx,11*3 + jmp dimloop3 ;dh holds y of bottom corner + +finishdim3: mov bx,mapflags+(3*10) + mov dl,11 +dimloop4: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim4 + dec dl + sub bx,3 + jmp dimloop4 ;dl holds x of bottom corner + +finishdim4: mov al,cl ;cl holds x start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxstart,ax + mov al,ch ;ch holds y start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapystart,ax + + sub dl,cl + sub dh,ch + ;dx holds x and y size of room + mov al,dl ;dl holds x size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxsize,al + mov al,dh ;dh holds y size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapysize,al ;cx still holds top left corner + ret + + endp + + + + + + + + + + + + +Addalong proc near + + mov ah,11 +addloop: cmp byte ptr [es:bx],0 + jnz gotalong + add bx,3 + dec ah + jnz addloop + mov al,0 + ret +gotalong: mov al,1 + ret + + endp + + + + + +Addlength proc near + + mov ah,10 +addloop2: cmp byte ptr [es:bx],0 + jnz gotlength + add bx,3*11 + dec ah + jnz addloop2 + mov al,0 + ret +gotlength: mov al,1 + ret + + endp + + + + + + + + + + + + + + + + + + + + +Drawflags proc near + + mov es,buffers + mov di,mapflags + mov al,mapy + mov ah,0 + mov cx,mapwidth + mul cx + mov bl,mapx + mov bh,0 + add ax,bx + mov si,map + add si,ax + + mov cx,10 +$28: push cx + mov cx,11 +$28a: mov ds,mapdata + lodsb + mov ds,backdrop + push si ax + mov ah,0 + add ax,ax + mov si,flags + add si,ax + movsw + pop ax + stosb + pop si + loop $28a + add si,mapwidth-11 + pop cx + loop $28 + ret + + endp + + + + + + + + + + + + + + +;-------------------------------------------------------Set object printing---- + +Eraseoldobs proc near + + cmp newobs,0 + jz donterase + + mov es,buffers + mov bx,spritetable + + mov cx,16 +oberase: push cx bx + mov ax,[es:bx+20] + cmp ax,0ffffh + jz notthisob + mov di,bx + mov al,255 + mov cx,tablesize + rep stosb +notthisob: pop bx cx + add bx,tablesize + loop oberase + +donterase: ret + + endp + + + + + + + + + + + + + + + + + + + + +Showallobs proc near + + mov es,buffers + mov bx,setlist + mov listpos,bx + mov di,bx + mov cx,128*5 + mov al,255 + rep stosb + + mov es,setframes + mov frsegment,es + mov ax,framedata + mov dataad,ax + mov ax,frames + mov framesad,ax + mov currentob,0 + + mov ds,setdat + mov si,0 + + mov cx,128 +showobsloop: push cx si + + push si + add si,58 + mov es,setdat + call getmapad + pop si + cmp ch,0 + jz blankframe + + mov al,[es:si+18] + mov ah,0 + mov currentframe,ax + cmp al,255 + jz blankframe + + push es si + call calcfrframe + call finalframe + pop si es + + mov al,[es:si+18] + mov [es:si+17],al + cmp byte ptr [es:si+8],0 + jnz animating + cmp byte ptr [es:si+5],5 + jz animating + cmp byte ptr [es:si+5],6 + jz animating + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + jmp drawnsetob + +animating: call makebackob + +drawnsetob: mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + mov al,currentob + mov [es:si+4],al + add si,5 + mov listpos,si + +blankframe: inc currentob + pop si cx + add si,64 + dec cx + jz finishedsetobs + jmp showobsloop + +finishedsetobs: ret + + endp + + + + + + + + + + + + + + +Makebackob proc near + + cmp newobs,0 + jz nomake + + mov al,[es:si+5] ; priority + mov ah,[es:si+8] ; type - steady, constant,random,door etc. + push si ax si + mov ax,objectx + mov bx,objecty + mov ah,bl + mov si,ax + mov cx,offset cs:backobject + mov dx,setframes + mov di,framedata + call makesprite + pop ax + mov [es:bx+20],ax + pop ax + cmp al,255 + jnz usedpriority ; forgotten to specify priority + mov al,0 +usedpriority: mov [es:bx+23],al + mov [es:bx+30],ah + mov byte ptr [es:bx+16],0 + mov byte ptr [es:bx+18],0 + mov byte ptr [es:bx+19],0 + pop si +nomake: ret + + endp + + + + +;------------------------------------------------------Free object printing---- + +Showallfree proc near + + mov es,buffers + mov bx,freelist + mov listpos,bx + mov di,freelist + mov cx,80*5 + mov al,255 + rep stosb + + mov es,freeframes + mov frsegment,es + mov ax,frframedata + mov dataad,ax + mov ax,frframes + mov framesad,ax + mov al,0 + mov currentfree,al + + mov ds,freedat + mov si,2 + + mov cx,0 +loop127: push cx si + + push si + mov es,freedat + call getmapad + pop si + cmp ch,0 + jz over138 + + mov al,currentfree + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz over138 + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +over138: inc currentfree + pop si cx + add si,16 + inc cx + cmp cx,80 + jz finfree + jmp loop127 + +finfree: ret + + endp + + + + + + + + + + + + +Showallex proc near + + mov es,buffers + mov bx,exlist + mov listpos,bx + mov di,exlist + mov cx,100*5 + mov al,255 + rep stosb + + mov es,extras + mov frsegment,es + mov ax,exframedata + mov dataad,ax + mov ax,exframes + mov framesad,ax + mov currentex,0 + + mov si,exdata+2 + + mov cx,0 +exloop: push cx si + + mov es,extras + + push si + mov ch,0 + cmp byte ptr [es:si],255 + jz notinroom + mov al,[es:si-2] + cmp al,reallocation + jnz notinroom + call getmapad +notinroom: pop si + cmp ch,0 + jz blankex + + mov al,currentex + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz blankex + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +blankex: inc currentex + pop si cx + add si,16 + inc cx + cmp cx,100 + jz finex + jmp exloop + +finex: ret + + endp + + + + + + + +Calcfrframe proc near + + mov dx,frsegment + mov ax,framesad + push ax + mov cx,dataad + mov ax,currentframe + mov ds,dx + mov bx,6 + mul bx + add ax,cx + mov bx,ax + mov cx,[bx] + mov ax,[bx+2] + mov dx,[bx+4] + pop bx + push dx + add ax,bx ;ax=source add, cx=x,y + ;need this later + mov savesource,ax + mov savesize,cx + pop ax + push ax + mov ah,0 + mov offsetx,ax + pop ax + mov al,ah + mov ah,0 + mov offsety,ax + ret +nullframe: pop ax + mov cx,0 + mov savesize,cx + ret + + endp + + + + + + + + + + + + + + + + + + +Finalframe proc near + + mov ax,objecty + add ax,offsety + mov bx,objectx + add bx,offsetx + mov savex,bl + mov savey,al + mov di,objectx + mov bx,objecty + ret + + endp + + + + + + + + + + + + + +Adjustlen proc near + + mov ah,al + add al,ch + cmp al,100 + jc over242 + mov al,224 + sub al,ch + mov ch,al +over242: ret + + endp + + + + + + + + + +Getmapad proc near + + call getxad + cmp ch,0 + jz over146 + mov objectx,ax + call getyad + cmp ch,0 + jz over146 + mov objecty,ax + mov ch,1 +over146: ret + + endp + + + + + + + + + +Getxad proc near + + mov cl,[es:si] + inc si + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + cmp cl,0 + jnz over148 + sub al,mapx + jc over148 + cmp al,11 + jnc over148 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret +over148: mov ch,0 + ret + + endp + + + + + + + + + +Getyad proc near + + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + sub al,mapy + jc over147 + cmp al,10 + jnc over147 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret + +over147: mov ch,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm new file mode 100644 index 0000000000..991e240fd1 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/debug.asm @@ -0,0 +1,382 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + if debuglevel2 + + +Debugkeys proc near + + ret + + endp + + + +Debugstart proc near + + call allpalette + mov reeltohold,-1 + mov newlocation,23 + mov dreamnumber,0 + mov al,"W" + mov ah,"S" + mov cl,"H" + mov ch,"D" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"C"-"A" + mov byte ptr [es:bx+14],"R"-"A" + mov byte ptr [es:bx+15],"W"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov byte ptr [es:bx+12],"G"-"A" + mov byte ptr [es:bx+13],"U"-"A" + mov byte ptr [es:bx+14],"N"-"A" + mov byte ptr [es:bx+15],"A"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"H"-"A" + mov byte ptr [es:bx+14],"L"-"A" + mov byte ptr [es:bx+15],"D"-"A" + mov card1money,12342 + + ret + + endp + + + + + +Debuggreen proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,63 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + + + + + +Debugred proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,63 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + +Debugblue proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,63 + out dx,al + pop dx ax + ret + + endp + + + + + +Debugblack proc near + + push dx ax + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop ax dx + ret + + endp + + + + + + + + + + + +Debug proc near + + push ds dx cx + mov ah,3ch + mov cx,0 + mov dx,seg filenamed + mov ds,dx + mov dx,offset filenamed + int 21h + mov bx,ax + pop cx dx ds + push bx + mov ah,40h + int 21h + pop bx + mov ah,3eh + int 21h + ret + +filenamed db "DREAMWEB.TXT",0 + + endp + + + + + + + + +Shout proc near + + push ax bx cx dx si di es ds + call debugblue + mov cx,50 + call hangon + call debugblack + mov cx,10 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + +Shoutred proc near + + push ax bx cx dx si di es ds + call debugred + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + +Shoutgreen proc near + + push ax bx cx dx si di es ds + call debuggreen + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + + + + + + + +;Checkmemingame proc near + +; cmp charset1,0 +; jz nodebug +; mov bx,60000 +; mov ah,48h +; int 21h +; mov ax,bx +; mov cl,6 +; shr ax,cl +; mov di,offset cs:debugtextig +; call showword + +; mov ax,soundbufferwrite +; ;mov ax,exframepos +; mov di,offset cs:debugtextex +; call showword + +; ;mov ax,extextpos +; ;mov di,offset cs:debugtextex2 +; ;call showword + +; push cs +; pop es +; mov si,offset cs:debugtextig +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,14 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,22 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex2 +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,30 +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +;nodebug: ret + + endp + +debugtextig: db "00000K",0 + +debugtextex: db "00000b",0 + +debugtextex2: db "00000b",0 + + + + + + + if recording + + mov ax,recordpos + mov di,offset cs:debugtextr + call showword + + mov al,0 + call print + dw 4,4,100 +debugtextr: db "00000",0 + + mov si,0 + mov di,0 + mov cl,40 + mov ch,12 + call multidump + + endif + + ret + + endp + + + + + + + + + + + + + + + + + + +;Debugax proc near +; +; push ax +; call showpanel +; pop ax +; mov di,offset cs:debugaxtext +; call showword +; +; mov di,204 +; mov bx,14 +; mov al,0 +; mov ah,0 +; mov dl,100 +; push cs +; pop es +; mov si,offset cs:debugaxtext +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +; ret +; +;debugaxtext db "00000 ",0 +; +; endp + + + + + + + + endif + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm new file mode 100644 index 0000000000..88cf2a91c0 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -0,0 +1,6276 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + + + + + + + + +;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ +;³ ³ +;³ DREAMWEB ³ +;³ ³ +;³ ³ +;³ ³ +;³ ³ +;³ Written by Neil Dodwell. Graphics by Dave Dew. ³ +;³ ³ +;³ Started on Friday 28 December 1990 at 1:20 pm ³ +;³ ³ +;³ Copyright 1990/1991 Creative Reality ³ ³ +;³ ³ +;³ ³ +;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + + + + + + + + + + + + + + +;----------------------------------------------------------Assembly options---- + +JUMPS + +playback equ 0 +recording equ 0 +debuglevel1 equ 0 ;memory debug on +debuglevel2 equ 0 ;debug keys on+shouts +demo equ 0 +CD equ 0 +Foreign equ 1 +Spanish equ 1 +German equ 0 + +;----------------------------------------------------------------Code start---- + +DREAMWEBPROG segment para public 'CODE' + + assume cs:DREAMWEBPROG,ss:STACKSPACE + + + + +;------------------------------------------------------------------Includes---- + +include \pc\dreamweb\vars.asm ;variables and equates +include \pc\dreamweb\sprite.asm ;sprite routines +include \pc\dreamweb\vgagrafx.asm ;screen routines for vga +include \pc\dreamweb\vgafades.asm ;fade routines +include \pc\dreamweb\titles.asm ;guess! +include \pc\dreamweb\print.asm ;text printing routines +include \pc\dreamweb\object.asm ;pickup +include \pc\dreamweb\backdrop.asm ;draws floor etc. +include \pc\dreamweb\look.asm ;look command +include \pc\dreamweb\talk.asm ;conversations +include \pc\dreamweb\newplace.asm ;travel +include \pc\dreamweb\monitor.asm ;network machine +include \pc\dreamweb\use.asm ;individual use routines +include \pc\dreamweb\keypad.asm ;accept code with keypad +include \pc\dreamweb\saveload.asm ;in game options +include \pc\dreamweb\sblaster.asm + if debuglevel1 +include \pc\dreamweb\debug.asm + else + if debuglevel2 +include \pc\dreamweb\debug.asm + endif + endif + +;-----------------------------------------------------------------Main loop---- + + +Dreamweb proc near + + call seecommandtail + mov ah,4ah + mov bx,seg stak + sub bx,seg dreamweb + add bx,20h + int 21h + + call checkbasemem + call soundstartup + call setkeyboardint + call setupemm + call allocatebuffers + call setmouse + call fadedos + call gettime + + call clearbuffers + call clearpalette + call set16colpalette + call readsetdata + if demo + call changeroomnums + endif + mov wongame,0 + + mov dx,offset cs:basicsample + call loadsample + call setsoundoff + + if demo + else + call scanfornames + cmp al,0 + jnz dodecisions + endif + + call setmode + call loadpalfromiff + + call titles + call credits + jmp playgame + +dodecisions: call cls + call setmode + call decide + cmp getback,4 + jz mainloop + + call titles + call credits + +playgame: call clearchanges + call setmode + call loadpalfromiff + mov location,255 + mov roomafterdream,1 + if demo + mov newlocation,5 + else + mov newlocation,35 + endif + mov volume,7 + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov destpos,3 + call initialinv + mov lastflag,32 + call startup1 + mov volumeto,0 + mov volumedirection,-1 + mov commandtype,255 + jmp mainloop + +loadnew: if demo + cmp newlocation,27 + jnz not27 + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame +not27: + endif + call clearbeforeload + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov newlocation,255 + call startup + mov commandtype,255 + call worktoscreenm + jmp mainloop + +alreadyloaded: mov newlocation,255 + call clearsprites + call initman + call startup + mov commandtype,255 + +mainloop: call screenupdate + cmp wongame,0 + jnz endofgame + cmp mandead,1 + jz gameover + cmp mandead,2 + jz gameover + cmp watchingtime,0 + jz notwatching + mov al,finaldest + cmp al,manspath + jnz mainloop + dec watchingtime + jnz mainloop + +notwatching: cmp mandead,4 + jz gameover + cmp newlocation,255 + jnz loadnew + jmp mainloop + +gameover: if demo + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame + endif + call clearbeforeload + call showgun + call fadescreendown + mov cx,100 + call hangon + jmp dodecisions + +endofgame: call clearbeforeload + call fadescreendowns + mov cx,200 + call hangon + call endgame + jmp quickquit2 + + endp + + + + + endp + + + + if demo + +Changeroomnums proc near + + mov di,offset cs:roomdata+10 + mov cx,50 +changenumloop: mov al,[cs:di] + cmp al,"0" + jnz nochange + mov al,[cs:di+1] + cmp al,"5" + jnz nochange + mov al,"6" + mov ah,"0" + mov [cs:di],ax +nochange: add di,32 + loop changenumloop + ret + + endp + + endif + + + + +Entrytexts proc near + + cmp location,21 + jnz notloc15 + mov al,28 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc15: cmp location,30 + jnz notloc43 + mov al,27 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc43: cmp location,23 + jnz notloc23 + mov al,29 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc23: cmp location,31 + jnz notloc44 + mov al,30 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc44: cmp location,20 + jnz notsarters2 + mov al,31 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notsarters2: cmp location,24 + jnz notedenlob + mov al,32 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notedenlob: cmp location,34 + jnz noteden2 + mov al,33 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +noteden2: ret + + endp + + + + + + + + +Entryanims proc near + + mov reeltowatch,-1 + mov watchmode,-1 + cmp location,33 + jnz notinthebeach + call switchryanoff + mov watchingtime,76*2 + mov reeltowatch,0 + mov endwatchreel,76 + mov watchspeed,1 + mov speedcount,1 + ret +notinthebeach: cmp location,44 + jnz notsparkys + mov al,8 + call resetlocation + mov watchingtime,50*2 + mov reeltowatch,247 + mov endwatchreel,297 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notsparkys: cmp location,22 + jnz notinthelift + mov watchingtime,31*2 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notinthelift: cmp location,26 + jnz notunderchurch + mov symboltopnum,2 + mov symbolbotnum,1 + ret +notunderchurch: cmp location,45 + jnz notenterdream + mov keeperflag,0 + mov watchingtime,296 + mov reeltowatch,45 + mov endwatchreel,198 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notenterdream: cmp reallocation,46 + jnz notcrystal + cmp sartaindead,1 + jnz notcrystal + mov al,0 + call removefreeobject + ret +notcrystal: cmp location,9 + jnz nottopchurch + mov al,2 + call checkifpathison + jz nottopchurch + cmp aidedead,0 + jz nottopchurch + mov al,3 + call checkifpathison + jnz makedoorsopen + mov al,2 + call turnpathon +makedoorsopen: mov al,4 + call removesetobject + mov al,5 + call placesetobject + ret +nottopchurch: cmp location,47 + jnz notdreamcentre + mov al,4 + call placesetobject + mov al,5 + call placesetobject + ret +notdreamcentre: cmp location,38 + jnz notcarpark + mov watchingtime,57*2 + mov reeltowatch,4 + mov endwatchreel,57 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notcarpark: cmp location,32 + jnz notalley + mov watchingtime,66*2 + mov reeltowatch,0 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notalley: cmp location,24 + jnz notedensagain + mov al,2 + mov ah,roomnum + dec ah + call turnanypathon +notedensagain: ret + + endp + + + + + + + if demo +Initialinv proc near + + mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov al,2 + mov ah,4 + call pickupob + + mov al,29 + mov ah,10 + call pickupob + mov al,33 + mov ah,11 + call pickupob + mov al,44 + mov ah,12 + call pickupob + mov card1money,12342 + ret + + endp + else +Initialinv proc near + + cmp reallocation,24 + jz isedens + ret + +isedens: mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov watchmode,1 + mov reeltohold,0 + mov endofholdreel,6 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret + + endp + + endif + + + + + + + + + + + +Pickupob proc near + + mov lastinvpos,ah + mov objecttype,2 + mov itemframe,al + mov command,al + call getanyad + call transfertoex + ret + + endp + + + + + + + + + + + + + + + +;---------------------------------------------------------Memory allocation---- + + + + +Setupemm proc near + + cmp soundint,255 + jz noneedforemm + call checkforemm + + mov ah,43h ;allocate handle and 160 pages + mov bx,176 ;was 176 + int 67h + cmp ah,0 + jnz emmerror1 ;if there's an error drop to DOS + mov emmhandle,dx + mov ah,41h ;get the page frame base address + int 67h + cmp ah,0 + jnz emmerror1 + mov emmpageframe,bx + mov ax,bx + mov cl,12 + shr ax,cl + mov emmhardwarepage,al +noneedforemm: ret +emmerror1: mov gameerror,1 + jmp quickquit2 + + endp + + + + + + + + +Removeemm proc near + + cmp soundint,255 + jz noneedtoremove + mov ah,45h + mov dx,emmhandle + int 67h +noneedtoremove: ret + + endp + + + + + +Checkforemm proc near + + ret + + endp + + + + +Checkbasemem proc near + + mov bx,howmuchalloc + cmp bx,9360h + jnc enoughmem + mov gameerror,5 + jmp quickquit +enoughmem: ret + + endp + + + +Allocatebuffers proc near + + mov bx,lengthofextra/16 + call allocatemem + mov extras,ax + + call trysoundalloc + mov bx,lengthofmap/16 + call allocatemem + mov mapdata,ax + + call trysoundalloc + mov bx,lengthofbuffer/16 + call allocatemem + mov buffers,ax + + call trysoundalloc + mov bx,freedatlen/16 + call allocatemem + mov freedat,ax + + call trysoundalloc + mov bx,setdatlen/16 + call allocatemem + mov setdat,ax + + call trysoundalloc + mov bx,lenofmapstore/16 + call allocatemem + mov mapstore,ax + + if recording + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + if playback + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + call allocatework + + mov bx,2048/16 + call allocatemem + mov sounddata,ax + + mov bx,2048/16 + call allocatemem + mov sounddata2,ax + ret + + endp + + + + + + + + + + +Clearbuffers proc near + + mov es,buffers + mov cx,lengthofbuffer/2 + mov ax,0 + mov di,0 + rep stosw + + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + mov es,buffers + mov di,initialreelrouts + push cs + pop ds + mov si,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov es,buffers + mov di,initialvars + push cs + pop ds + mov si,offset cs:startvars + mov cx,lengthofvars + rep movsb + call clearchanges + ret + + endp + + + + + + +Clearchanges proc near + + mov es,buffers + mov cx,numchanges*2 + mov ax,0ffffh + mov di,listofchanges + rep stosw + mov ds,buffers + mov si,initialreelrouts + push cs + pop es + mov di,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov ds,buffers + mov si,initialvars + push cs + pop es + mov di,offset cs:startvars + mov cx,lengthofvars + rep movsb + + mov expos,0 + mov exframepos,0 + mov extextpos,0 + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + push cs + pop es + mov di,offset cs:roomscango + mov al,1 + stosb + stosb + mov al,0 + stosb + mov al,1 + stosb + mov ax,0 + mov cx,6 + rep stosw + ret + + endp + + + + + + + +Clearbeforeload proc near ;deallocates variable buffers + ;and clears out fixed ones + cmp roomloaded,1 + jnz noclear + call clearreels + call clearrest + mov roomloaded,0 +noclear: ret + + endp + + + +;Clearnoreels proc near +; +; cmp roomloaded,1 +; jnz noclear2 +; call clearrest +; mov roomloaded,0 +;noclear2: ret +; +; endp + + + + + + +Clearreels proc near + + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + ret + + endp + + + +Clearrest proc near + + mov es,mapdata + mov cx,maplen/2 + mov ax,0 + mov di,map + rep stosw + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + + +Deallocatemem proc near + + mov ah,49h + int 21h + jc deallerror + ret +deallerror: mov gameerror,4 + jmp quickquit2 + ret + + endp + + + + + + + + +Allocatemem proc near + + add bx,2 + mov ah,48h + int 21h + jc memerror + ret + +memerror: mov gameerror,3 + jmp quickquit2 + + endp + + + + +Seecommandtail proc near + + mov soundbaseadd,220h + mov soundint,5 + mov sounddmachannel,1 + mov brightness,0 + + mov bx,2 + mov ax,[es:bx] + mov dx,es + sub ax,dx + mov howmuchalloc,ax + + mov bx,02ch + mov ax,[es:bx] + push es bx + + mov es,ax + mov bx,0 +findblaster: mov ax,[es:bx] + cmp ax,0 + jz endofenvironment + cmp al,"B" + jnz notblast + cmp ah,"L" + jnz notblast + cmp byte ptr [es:bx+2],"A" + jnz notblast + cmp byte ptr [es:bx+3],"S" + jnz notblast + cmp byte ptr [es:bx+4],"T" + jnz notblast + cmp byte ptr [es:bx+5],"E" + jnz notblast + cmp byte ptr [es:bx+6],"R" + jnz notblast + add bx,7 + call parseblaster + jmp endofenvironment +notblast: inc bx + jmp findblaster + +endofenvironment: pop bx es + mov bx,81h + call parseblaster + ret + + endp + + + +Parseblaster proc near + +lookattail: mov al,[es:bx] + cmp al,0 + jz endtail + cmp al,13 + jz endtail + cmp al,"i" + jz issoundint + cmp al,"I" + jz issoundint + cmp al,"b" + jz isbright + cmp al,"B" + jz isbright + cmp al,"a" + jz isbaseadd + cmp al,"A" + jz isbaseadd + cmp al,"n" + jz isnosound + cmp al,"N" + jz isnosound + cmp al,"d" + jz isdma + cmp al,"D" + jz isdma + inc bx + loop lookattail + ret + +issoundint: mov al,[es:bx+1] + sub al,"0" + mov soundint,al + inc bx + jmp lookattail +isdma: mov al,[es:bx+1] + sub al,"0" + mov sounddmachannel,al + inc bx + jmp lookattail +isbaseadd: push cx + mov al,[es:bx+2] + sub al,"0" + mov ah,0 + mov cl,4 + shl ax,cl + add ax,200h + mov soundbaseadd,ax + pop cx + inc bx + jmp lookattail +isbright: mov brightness,1 + inc bx + jmp lookattail +isnosound: mov soundint,255 + inc bx + jmp lookattail +endtail: ret + + endp + + + + +;-------------------------------------------------------High level routines---- + +Startup proc near + + mov currentkey,0 + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + ret + + endp + + + + +Startup1 proc near + + + call clearpalette + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + call worktoscreen + call fadescreenup + ret + + endp + + + + + + + + +;--------------------------------------------------Scroll location routines---- + + + + + +Screenupdate proc near + + call newplace + call mainscreen + call animpointer + call showpointer + cmp watchingtime,0 + jnz iswatchingmode + cmp newlocation,255 + jnz finishearly +iswatchingmode: call vsync + call readmouse1 + call dumppointer + call dumptextline + call delpointer + call autolook + call spriteupdate + call watchcount + call zoom + call showpointer + cmp wongame,0 + jnz finishearly + + call vsync + call readmouse2 + call dumppointer + call dumpzoom + call delpointer + call deleverything + call printsprites + call reelsonscreen + call afternewroom + call showpointer + + call vsync + call readmouse3 + call dumppointer + call dumpmap + call dumptimedtext + call delpointer + call showpointer + + call vsync + call readmouse4 + call dumppointer + call dumpwatch + call delpointer + +finishearly: ret + + endp + + + + + + + + + + + + + + + +Watchreel proc near + + cmp reeltowatch,-1 + jz notplayingreel + mov al,manspath + cmp al,finaldest + jnz waitstopwalk + mov al,turntoface + cmp al,facing + jz notwatchpath +waitstopwalk: ret + +notwatchpath: dec speedcount + cmp speedcount,-1 + jnz showwatchreel + mov al,watchspeed + mov speedcount,al + mov ax,reeltowatch + cmp ax,endwatchreel + jnz ismorereel + cmp watchingtime,0 + jnz showwatchreel + mov reeltowatch,-1 + mov watchmode,-1 + cmp reeltohold,-1 + jz nomorereel + mov watchmode,1 + jmp notplayingreel +ismorereel: inc reeltowatch +showwatchreel: mov ax,reeltowatch + mov reelpointer,ax + call plotreel + mov ax,reelpointer + mov reeltowatch,ax + call checkforshake +nomorereel: ret + + +notplayingreel: cmp watchmode,1 + jnz notholdingreel + mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notholdingreel: cmp watchmode,2 + jnz notreleasehold + dec speedcount + cmp speedcount,-1 + jnz notlastspeed2 + mov al,watchspeed + mov speedcount,al + inc reeltohold +notlastspeed2: mov ax,reeltohold + cmp ax,endofholdreel + jnz ismorereel2 + mov reeltohold,-1 + mov watchmode,-1 + mov al,destafterhold + mov destination,al + mov finaldest,al + call autosetwalk + ret +ismorereel2: mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notreleasehold: ret + + endp + + + + + +Checkforshake proc near + + cmp reallocation,26 + jnz notstartshake + cmp ax,104 + jnz notstartshake + mov shakecounter,-1 +notstartshake: ret + + endp + + + + + +Watchcount proc near + + cmp watchon,0 + jz nowatchworn + inc timercount + cmp timercount,9 + jz flashdots + cmp timercount,18 + jz uptime +nowatchworn: ret + +flashdots: mov ax,91*3+21 + mov di,268+4 + mov bx,21 + mov ds,charset1 + call showframe + jmp finishwatch + +uptime: mov timercount,0 + add secondcount,1 + cmp secondcount,60 + jnz finishtime + mov secondcount,0 + inc minutecount + cmp minutecount,60 + jnz finishtime + mov minutecount,0 + inc hourcount + cmp hourcount,24 + jnz finishtime + mov hourcount,0 + +finishtime: call showtime +finishwatch: mov watchdump,1 + ret + + endp + + + +Showtime proc near + + cmp watchon,0 + jz nowatch + + mov al,secondcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+9 + mov bx,21 + call showframe + + mov al,minutecount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+11 + mov bx,21 + call showframe + + mov al,hourcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+11 + mov bx,21 + call showframe + + mov ax,91*3+20 + mov ds,charset1 + mov di,267+5 + mov bx,21 + call showframe +nowatch: ret + + + endp + + + + +Dumpwatch proc near + + cmp watchdump,1 + jnz nodumpwatch + mov di,256 + mov bx,21 + mov cl,40 + mov ch,12 + call multidump + mov watchdump,0 +nodumpwatch: ret + + endp + + + + +Showbyte proc near + + mov dl,al + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + call onedigit + mov [es:di],dl + mov dl,al + and dl,15 + call onedigit + mov [es:di+1],dl + add di,3 + ret + + endp + + +Onedigit proc near + + cmp dl,10 + jnc morethan10 + add dl,"0" + ret +morethan10: sub dl,10 + add dl,"A" + ret + + endp + + + + + +Twodigitnum proc near + + mov ah,cl + dec ah +numloop1: inc ah + sub al,10 + jnc numloop1 + add al,10 + add al,cl + ret + + endp + + + + + +Showword proc near + + mov ch,0 + mov bx,10000 + mov cl,47 +word1: inc cl + sub ax,bx + jnc word1 + add ax,bx + call convnum + mov [cs:di],cl + mov bx,1000 + mov cl,47 +word2: inc cl + sub ax,bx + jnc word2 + add ax,bx + call convnum + mov [cs:di+1],cl + mov bx,100 + mov cl,47 +word3: inc cl + sub ax,bx + jnc word3 + add ax,bx + call convnum + mov [cs:di+2],cl + mov bx,10 + mov cl,47 +word4: inc cl + sub ax,bx + jnc word4 + add ax,bx + call convnum + mov [cs:di+3],cl + add al,48 + mov cl,al + call convnum + mov [cs:di+4],cl + ret + + endp + + + + +Convnum proc near + + cmp ch,0 + jnz noconvnum + cmp cl,"0" + jnz notzeronum + mov cl,32 + jmp noconvnum +notzeronum: mov ch,1 +noconvnum: ret + + endp + + + + + + + + +;---------------------------------------------Handling of pointer on screen---- + +Mainscreen proc near + + mov inmaparea,0 + mov bx,offset cs:mainlist + cmp watchon,1 + jz checkmain + mov bx,offset cs:mainlist2 +checkmain: call checkcoords + cmp walkandexam,0 + jz finishmain + call walkandexamine +finishmain: ret + +mainlist: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226,244,10,26,zoomonoff + dw 226,244,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + +mainlist2: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226+48,244+48,10,26,zoomonoff + dw 226+48,244+48,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + + endp + + + + + + +Madmanrun proc near + + cmp location,14 + jnz identifyob + cmp mapx,22 + jnz identifyob + cmp pointermode,2 + jnz identifyob + cmp madmanflag,0 + jnz identifyob + + cmp commandtype,211 + jz alreadyrun + mov commandtype,211 + mov al,52 + call commandonly +alreadyrun: cmp mousebutton,1 + jnz norun + mov ax,mousebutton + cmp ax,oldbutton + jz norun + mov lastweapon,8 +norun: ret + + endp + + + + + + +Checkcoords proc near + +loop048: mov ax,[cs:bx] + cmp ax,0ffffh + jz nonefound + push bx + cmp mousex,ax + jl over045 + mov ax,[cs:bx+2] + cmp mousex,ax + jge over045 + mov ax,[cs:bx+4] + cmp mousey,ax + jl over045 + mov ax,[cs:bx+6] + cmp mousey,ax + jge over045 + mov ax,[cs:bx+8] + call ax +finished: pop ax + ret +over045: pop bx + add bx,10 + jmp loop048 +nonefound: ret + + endp + + + + + +;-------------------------------------------Printing of icons during scroll---- + + + + + +Identifyob proc near + + cmp watchingtime,0 + jnz blank + + mov ax,mousex + sub ax,mapadx + cmp ax,22*8 + jc notover1 + call blank + ret + +notover1: mov bx,mousey + sub bx,mapady + cmp bx,20*8 + jc notover2 + call blank + ret + +notover2: mov inmaparea,1 + mov ah,bl + push ax + call findpathofpoint + mov pointerspath,dl + pop ax + push ax + call findfirstpath + mov pointerfirstpath,al + pop ax + + call checkifex + jnz finishidentify + call checkiffree + jnz finishidentify + call checkifperson + jnz finishidentify + call checkifset + jnz finishidentify + + mov ax,mousex + sub ax,mapadx + mov cl,al + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + cmp al,0 + jz nothingund + ;cmp watchingtime,0 + ;jnz nothingund + cmp mandead,1 + jz nothingund + mov ah,3 + call obname +finishidentify: ret + +nothingund: call blank + ret + + endp + + + + + + + + +Checkifperson proc near + + mov es,buffers + mov bx,peoplelist + mov cx,12 +identifyreel: push cx + + cmp byte ptr [es:bx+4],255 + jz notareelid + + push es bx ax + mov ax,[es:bx+0] + mov reelpointer,ax + call getreelstart + cmp [es:si+2],0ffffh + jnz notblankpers + add si,5 +notblankpers: mov cx,[es:si+2] ;x,y of reel slot + mov ax,[es:si+0] ;frame number + push cx + call getreelframeax + pop cx + add cl,[es:bx+4] + add ch,[es:bx+5] + mov dx,cx + add dl,[es:bx+0] + add dh,[es:bx+1] + pop ax bx es + + cmp al,cl + jc notareelid + cmp ah,ch + jc notareelid + cmp al,dl + jnc notareelid + cmp ah,dh + jnc notareelid + + pop cx + mov ax,[es:bx+2] + mov persondata,ax + mov al,[es:bx+4] + mov ah,5 + call obname + mov al,0 + cmp al,1 + ret + +notareelid: pop cx + add bx,5 + dec cx + jnz identifyreel + ret + + endp + + + + + + + + +Checkifset proc near + + mov es,buffers + mov bx,setlist+(127*5) + mov cx,127 +identifyset: cmp byte ptr [es:bx+4],255 + jz notasetid + cmp al,[es:bx] + jc notasetid + cmp al,[es:bx+2] + jnc notasetid + cmp ah,[es:bx+1] + jc notasetid + cmp ah,[es:bx+3] + jnc notasetid + call pixelcheckset + jz notasetid + call isitdescribed + jz notasetid + mov al,[es:bx+4] + mov ah,1 + call obname + mov al,0 + cmp al,1 + ret +notasetid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyset + ret + + endp + + + + + + + + + + +Checkifex proc near + + mov es,buffers + mov bx,exlist+(99*5) + mov cx,99 +identifyex: cmp byte ptr [es:bx+4],255 + jz notanexid + cmp al,[es:bx] + jc notanexid + cmp al,[es:bx+2] + jnc notanexid + cmp ah,[es:bx+1] + jc notanexid + cmp ah,[es:bx+3] + jnc notanexid + mov al,[es:bx+4] + mov ah,4 + call obname + mov al,1 + cmp al,0 + ret +notanexid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyex + ret + + endp + + + + + + +Checkiffree proc near + + mov es,buffers + mov bx,freelist+(79*5) + mov cx,79 +identifyfree: cmp byte ptr [es:bx+4],255 + jz notafreeid + cmp al,[es:bx] + jc notafreeid + cmp al,[es:bx+2] + jnc notafreeid + cmp ah,[es:bx+1] + jc notafreeid + cmp ah,[es:bx+3] + jnc notafreeid + mov al,[es:bx+4] + mov ah,2 + call obname + mov al,0 + cmp al,1 + ret +notafreeid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyfree + ret + + endp + + + + + + +Isitdescribed proc near + + push ax cx es bx + mov al,[es:bx+4] ;get object number + mov ah,0 + add ax,ax + mov bx,ax + mov es,setdesc + add bx,settextdat + mov ax,[es:bx] + add ax,settext + mov bx,ax + mov dl,[es:bx] + pop bx es cx ax + cmp dl,0 + ret + + endp + + + + + + + + +;Getcurrentpath proc near ;routine finds out which path +; ;block the pointer is in. +; push ax ;used to see if an object is +; call findpathofpoint ;close or not +; pop ax +; mov pointerspath,dl +; ret +; +; endp + + + + + +Findpathofpoint proc near + + push ax + mov bx,pathdata + mov es,reels + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +pathloop: mov al,[es:bx+6] + cmp al,255 + jnz flunkedit + mov ax,[es:bx+2] + cmp ax,0ffffh + jz flunkedit + cmp cl,al + jc flunkedit + cmp ch,ah + jc flunkedit + mov ax,[es:bx+4] + cmp cl,al + jnc flunkedit + cmp ch,ah + jnc flunkedit + jmp gotvalidpath +flunkedit: add bx,8 + inc dl + cmp dl,12 + jnz pathloop + mov dl,255 +gotvalidpath: ret + + endp + + + + + +Findfirstpath proc near ;similar to last routine, but it + ;searches each path to see if + push ax ;pointer is within it, regardless + mov bx,pathdata ;of whether the path is on or off + mov es,reels ;it returns the on or off state in + mov al,roomnum ;al (255=on 0=off) 0 if no path + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +fpathloop: mov ax,[es:bx+2] + cmp ax,0ffffh + jz nofirst + cmp cl,al + jc nofirst + cmp ch,ah + jc nofirst + mov ax,[es:bx+4] + cmp cl,al + jnc nofirst + cmp ch,ah + jnc nofirst + jmp gotfirst +nofirst: add bx,8 + inc dl + cmp dl,12 + jnz fpathloop + mov al,0 + ret +gotfirst: mov al,[es:bx+6] + ret + + endp + + + + + + + + +Turnpathon proc near ;turns path on permanently + + push ax ax + mov cl,255 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathon + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al +nopathon: ret + + endp + + + + + + + +Turnpathoff proc near ;turns path on permanently + + push ax ax + mov cl,0 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathoff + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al +nopathoff: ret + + endp + + + + + + + + + + + + + + + +Turnanypathon proc near + + push ax ax + mov cl,255 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al + ret + + endp + + + + + + +Turnanypathoff proc near + + push ax ax + mov cl,0 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + +Checkifpathison proc near + + push ax + call getroomspaths + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+6] + cmp al,255 + ret + + endp + + + + + +Afternewroom proc near + + cmp nowinnewroom,0 + jz notnew + mov timecount,0 + call createpanel + mov commandtype,0 + call findroominloc + + cmp ryanon,1 + jz ryansoff + + mov al,ryanx + add al,12 + mov ah,ryany + add ah,12 + call findpathofpoint + mov manspath,dl + call findxyfrompath + mov resetmanxy,1 + +ryansoff: mov newobs,1 + call drawfloor + mov lookcounter,160 + mov nowinnewroom,0 + + call showicon + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call mainscreen + call getunderzoom + call zoom + call worktoscreenm + call walkintoroom + call reminders + call atmospheres +notnew: ret + + endp + + + + + + +Atmospheres proc near + + mov cl,mapx + mov ch,mapy + mov bx,offset cs:atmospherelist +nextatmos: mov al,[cs:bx] + cmp al,255 + jz nomoreatmos + cmp al,reallocation + jnz wrongatmos + mov ax,[cs:bx+1] + cmp ax,cx + jnz wrongatmos + mov ax,[cs:bx+3] + cmp al,ch0playing + jz playingalready + cmp location,45 + jnz notweb + cmp reeltowatch,45 + jz wrongatmos +notweb: call playchannel0 + cmp reallocation,2 + cmp mapy,0 + jz fullvol + jnz notlouisvol + cmp mapy,10 + jnz notlouisvol + cmp mapx,22 + jnz notlouisvol + mov volume,5 +notlouisvol: if cd + cmp reallocation,14 + jnz notmad1 + cmp mapx,33 + jz ismad2 + cmp mapx,22 + jnz notmad1 + mov volume,5 + ret +ismad2: mov volume,0 + ret +notmad1: endif +playingalready: cmp reallocation,2 + jnz notlouisvol2 + cmp mapx,22 + jz louisvol + cmp mapx,11 + jnz notlouisvol2 +fullvol: mov volume,0 +notlouisvol2: ret +louisvol: mov volume,5 + ret +wrongatmos: add bx,5 + jmp nextatmos +nomoreatmos: call cancelch0 + ret + +atmospherelist: db 0,33,10,15,255 + db 0,22,10,15,255 + db 0,22,0,15,255 + db 0,11,0,15,255 + db 0,11,10,15,255 + db 0,0,10,15,255 + + db 1,44,10,6,255 ;location,map x,y,sound,repeat + db 1,44,0,13,255 + + db 2,33,0,6,255 + db 2,22,0,5,255 + db 2,22,10,16,255 + db 2,11,10,16,255 + + db 3,44,0,15,255 + db 3,33,10,6,255 + db 3,33,0,5,255 + + db 4,11,30,6,255 + db 4,22,30,5,255 + db 4,22,20,13,255 + + db 10,33,30,6,255 + db 10,22,30,6,255 + + db 9,22,10,6,255 + db 9,22,20,16,255 + db 9,22,30,16,255 + db 9,22,40,16,255 + db 9,22,50,16,255 + + db 6,11,30,6,255 + db 6,0,10,15,255 + db 6,0,20,15,255 + db 6,11,20,15,255 + db 6,22,20,15,255 + + db 7,11,20,6,255 + db 7,0,20,6,255 + db 7,0,30,6,255 + + db 55,44,0,5,255 + db 55,44,10,5,255 + + db 5,22,30,6,255 + if demo + db 5,22,20,16,255 + db 5,22,10,16,255 + else + db 5,22,20,15,255 + db 5,22,10,15,255 + endif + + db 24,22,0,15,255 + db 24,33,0,15,255 + db 24,44,0,15,255 + db 24,33,10,15,255 + + db 8,0,10,6,255 + db 8,11,10,6,255 + db 8,22,10,6,255 + db 8,33,10,6,255 + db 8,33,20,6,255 + db 8,33,30,6,255 + db 8,33,40,6,255 + db 8,22,40,6,255 + db 8,11,40,6,255 + + db 11,11,20,12,255 + db 11,11,30,12,255 + db 11,22,20,12,255 + db 11,22,30,12,255 + + db 12,22,20,12,255 + db 13,22,20,12,255 + db 13,33,20,12,255 + + db 14,44,20,12,255 + db 14,33,0,12,255 + db 14,33,10,12,255 + db 14,33,20,12,255 + db 14,33,30,12,255 + db 14,33,40,12,255 + db 14,22,0,16,255 + + db 19,0,0,12,255 + + db 20,0,20,16,255 + db 20,0,30,16,255 + db 20,11,30,16,255 + db 20,0,40,16,255 + db 20,11,40,16,255 + + if demo + db 21,11,10,16,255 + db 21,11,20,16,255 + db 21,0,20,16,255 + db 21,22,20,16,255 + db 21,33,20,16,255 + db 21,44,20,16,255 + db 21,44,10,16,255 + else + db 21,11,10,15,255 + db 21,11,20,15,255 + db 21,0,20,15,255 + db 21,22,20,15,255 + db 21,33,20,15,255 + db 21,44,20,15,255 + db 21,44,10,15,255 + endif + + db 22,22,10,16,255 + db 22,22,20,16,255 + + db 23,22,30,13,255 + db 23,22,40,13,255 + db 23,33,40,13,255 + db 23,11,40,13,255 + db 23,0,40,13,255 + db 23,0,50,13,255 + + db 25,11,40,16,255 + db 25,11,50,16,255 + db 25,0,50,16,255 + + db 27,11,20,16,255 + db 27,11,30,16,255 + + db 29,11,10,16,255 + + db 45,22,30,12,255 + db 45,22,40,12,255 + db 45,22,50,12,255 + + db 46,22,40,12,255 + db 46,11,50,12,255 + db 46,22,50,12,255 + db 46,33,50,12,255 + + db 47,0,0,12,255 + + db 26,22,20,16,255 + db 26,33,10,16,255 + db 26,33,20,16,255 + db 26,33,30,16,255 + db 26,44,30,16,255 + db 26,22,30,16,255 + db 26,11,30,16,255 + db 26,11,20,16,255 + db 26,0,20,16,255 + db 26,11,40,16,255 + db 26,0,40,16,255 + db 26,22,40,16,255 + db 26,11,50,16,255 + + db 28,0,30,15,255 + db 28,0,20,15,255 + db 28,0,40,15,255 + db 28,11,30,15,255 + db 28,11,20,15,255 + db 28,22,30,15,255 + db 28,22,20,15,255 + + db 255 + + endp + + + + + + +Walkintoroom proc near + + cmp location,14 + jnz notlair + cmp mapx,22 + jnz notlair + mov destination,1 + mov finaldest,1 + call autosetwalk +notlair: ret + + endp + + + + + + + + + + + + +Afterintroroom proc near + + cmp nowinnewroom,0 + jz notnewintro + call clearwork + call findroominloc + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + mov nowinnewroom,0 +notnewintro: ret + + endp + + + + + + + + + + + +Obname proc near + + cmp reasseschanges,0 + jz notnewpath + mov reasseschanges,0 + jmp diff + +notnewpath: cmp ah,commandtype + jz notdiffob + jmp diff +notdiffob: cmp al,command + jnz diff + cmp walkandexam,1 + jz walkandexamine + cmp mousebutton,0 + jz noobselect + cmp commandtype,3 + jnz isntblock + cmp lastflag,2 + jc noobselect +isntblock: mov bl,manspath + cmp bl,pointerspath + jnz wantstowalk + cmp commandtype,3 + jz wantstowalk + call finishedwalking + jnz noobselect + cmp commandtype,5 + jz wantstotalk + cmp watchingtime,0 + jnz noobselect + call examineob + ret +wantstotalk: cmp watchingtime,0 + jnz noobselect + call talk + ret +walkandexamine: call finishedwalking + jnz noobselect + mov al,walkexamtype + mov commandtype,al + mov al,walkexamnum + mov command,al + mov walkandexam,0 + cmp commandtype,5 + jz noobselect + call examineob + ret +wantstowalk: call setwalk + mov reasseschanges,1 +noobselect: ret + + +diff: mov command,al + mov commandtype,ah +diff2: cmp linepointer,254 + jnz middleofwalk + cmp watchingtime,0 + jnz middleofwalk + mov al,facing + cmp al,turntoface + jnz middleofwalk + cmp commandtype,3 + jnz notblock + mov bl,manspath + cmp bl,pointerspath + jnz dontcheck + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc isblock +dontcheck: call getflagunderp + cmp lastflag,2 + jc isblock + cmp lastflag,128 + jnc isblock + jmp toofaraway ; only here for turning on doorstep +notblock: mov bl,manspath + cmp bl,pointerspath + jnz toofaraway + cmp commandtype,3 + jz isblock + cmp commandtype,5 + jz isaperson + call examineobtext + ret +middleofwalk: call blocknametext + ret +isblock: call blocknametext + ret +isaperson: call personnametext + ret +toofaraway: call walktotext + ret + + endp + + + + + + + +Finishedwalking proc near + + cmp linepointer,254 + jnz iswalking + mov al,facing + cmp al,turntoface +iswalking: ret + + endp + + + + + + + +Examineobtext proc near + + mov bl,command + mov bh,commandtype + mov al,1 + call commandwithob + ret + + endp + + + + + +Commandwithob proc near + + push ax + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + push bx + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + + pop ax + mov di,offset cs:commandline + call copyname + pop ax + + mov di,lastxpos + cmp al,0 + jz noadd + add di,5 +noadd: mov bx,textaddressy + push cs + pop es + mov si,offset cs:commandline + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + +commandline: db "OBJECT NAME ONE ",0 + + endp + + + + +Commandonly proc near + + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + + endp + + + + + +Printmessage proc near + + push dx bx di + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + +Printmessage2 proc near + + push dx bx di + push ax + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop ax + +searchmess: push ax + call findnextcolon + pop ax + dec ah + jnz searchmess + + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + +Blocknametext proc near + + mov bl,command + mov bh,commandtype + mov al,0 + call commandwithob + ret + + endp + + + + +Personnametext proc near + + mov bl,command + and bl,127 + mov bh,commandtype + mov al,2 + call commandwithob + ret + + endp + + + + + + + +Walktotext proc near + + mov bl,command + mov bh,commandtype + mov al,3 + call commandwithob + ret + + endp + + + + + +Getflagunderp proc near + + mov cx,mousex + sub cx,mapadx + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + mov lastflag,cl + mov lastflagex,ch + ret + + endp + + + + + +Setwalk proc near + + cmp linepointer,254 + jnz alreadywalking + mov al,pointerspath + cmp al,manspath + jz cantwalk2 + cmp watchmode,1 + jz holdingreel + cmp watchmode,2 + jz cantwalk + mov destination,al + mov finaldest,al + cmp mousebutton,2 + jnz notwalkandexam + cmp commandtype,3 + jz notwalkandexam + mov walkandexam,1 + mov al,commandtype + mov walkexamtype,al + mov al,command + mov walkexamnum,al +notwalkandexam: call autosetwalk +cantwalk: ret +cantwalk2: call facerightway + ret +alreadywalking: mov al,pointerspath + mov finaldest,al + ret + +holdingreel: mov destafterhold,al + mov watchmode,2 + ret + + endp + + + + + + + +Autosetwalk proc near + + mov al,manspath + cmp finaldest,al + jnz notsamealready + ret +notsamealready: call getroomspaths + call checkdest + push bx + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov linestartx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov linestarty,ax + pop bx + + mov al,destination + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov lineendx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov lineendy,ax + call bresenhams + + cmp linedirection,0 + jz normalline + mov al,linelength + dec al + mov linepointer,al + mov linedirection,1 + ret + +normalline: mov linepointer,0 + ret + + endp + + + + + + + + +Checkdest proc near + + push bx + add bx,12*8 + mov ah,manspath + mov cl,4 + shl ah,cl + mov al,destination + + mov cl,24 + mov ch,destination +checkdestloop: mov dh,[es:bx] + and dh,11110000b + mov dl,[es:bx] + and dl,00001111b + cmp ax,dx + jnz nextcheck + mov al,[es:bx+1] + and al,15 + mov destination,al + pop bx + ret +nextcheck: mov dl,[es:bx] + and dl,11110000b + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + mov dh,[es:bx] + and dh,00001111b + shl dh,1 + shl dh,1 + shl dh,1 + shl dh,1 + cmp ax,dx + jnz nextcheck2 + mov ch,[es:bx+1] + and ch,15 +nextcheck2: add bx,2 + dec cl + jnz checkdestloop + mov destination,ch + pop bx + ret + + endp + + + + + + + + + + + + + + +Bresenhams proc near + + call workoutframes + + mov dx,seg linedata + mov es,dx + mov di,offset es:linedata + mov si,1 + mov linedirection,0 + + mov cx,lineendx + sub cx,linestartx + jz vertline + jns line1 + + neg cx + mov bx,lineendx + xchg bx,linestartx + mov lineendx,bx + + mov bx,lineendy + xchg bx,linestarty + mov lineendy,bx + mov linedirection,1 + +line1: mov bx,lineendy + sub bx,linestarty + jz horizline + jns line3 + + neg bx + neg si + +line3: push si + mov lineroutine,0 ; means lo slope + cmp bx,cx + jle line4 + mov lineroutine,1 ; means hi slope + xchg bx,cx + +line4: shl bx,1 + mov increment1,bx + sub bx,cx + mov si,bx + sub bx,cx + mov increment2,bx + + mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx + pop bx + cmp lineroutine,1 + jz hislope + jmp loslope + +vertline: mov ax,linestarty + mov bx,lineendy + mov cx,bx + sub cx,ax + jge line31 + + neg cx + mov ax,bx + mov linedirection,1 + +line31: inc cx + mov bx,linestartx + xchg ax,bx + mov ah,bl + mov bx,si +line32: stosw + add ah,bl + loop line32 + jmp lineexit + + +horizline: mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx +horizloop: stosw + inc al + loop horizloop + jmp lineexit + + +loslope: +loloop: stosw + inc al + or si,si + jns line12 + add si,increment1 + loop loloop + jmp lineexit + +line12: add si,increment2 + add ah,bl + loop loloop + jmp lineexit + + + +hislope: +hiloop: stosw + add ah,bl + or si,si + jns line23 + add si,increment1 + loop hiloop + jmp lineexit + +line23: add si,increment2 + inc al + loop hiloop + +lineexit: sub di,offset es:linedata + mov ax,di + shr ax,1 + mov linelength,al + ret + + endp + + + + + + + +Workoutframes proc near + + mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jnc notneg1 + neg bx +notneg1: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc notneg2 + neg cx +notneg2: cmp bx,cx + jnc tendstohoriz + mov dl,2 + mov ax,cx + shr ax,1 + cmp bx,ax + jc gotquad + mov dl,1 + jmp gotquad +tendstohoriz: mov dl,0 + mov ax,bx + shr ax,1 + cmp cx,ax + jc gotquad + mov dl,1 + jmp gotquad + +gotquad: mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jc isinright +isinleft: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc topleft + cmp dl,1 + jz noswap1 + xor dl,2 +noswap1: add dl,4 + jmp success +topleft: add dl,6 + jmp success + +isinright: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc botright + add dl,2 + jmp success +botright: cmp dl,1 + jz noswap2 + xor dl,2 +noswap2: + +success: and dl,7 + mov turntoface,dl + mov turndirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + +;Multiply8 proc near +; +; mov ah,0 +; mov cx,8 +; mul cx +; ret +; +; endp + + + + + + +Getroomspaths proc near + + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + ret + + endp + + + + + + + + + + + + + + + + +Copyname proc near + + push di + call findobname + pop di + push cs + pop es + +copytext: mov cx,28 +make: lodsb + cmp al,":" + jz finishmakename + cmp al,0 + jz finishmakename + stosb + loop make + +finishmakename: inc cx + mov al,0 + stosb + ret + mov al,255 + rep stosb + ret + + endp + + + + + + + + + +Findobname proc near + + push ax + mov ah,0 + add ax,ax + mov bx,ax + pop ax + + cmp ah,5 + jnz notpersonname + + push ax + and al,127 + mov ah,0 + mov bx,64*2 + mul bx + mov si,ax + mov ds,people + add si,persontxtdat + mov cx,persontext + mov ax,[si] + add ax,cx + mov si,ax + pop ax + ret + +notpersonname: cmp ah,4 + jnz notextraname + mov ds,extras + add bx,extextdat + mov ax,[bx] + add ax,extext + mov si,ax + ret + +notextraname: cmp ah,2 + jnz notfreename + mov ds,freedesc + add bx,freetextdat + mov ax,[bx] + add ax,freetext + mov si,ax + ret + +notfreename: cmp ah,1 + jnz notsetname + mov ds,setdesc + add bx,settextdat + mov ax,[bx] + add ax,settext + mov si,ax + ret + +notsetname: mov ds,blockdesc + add bx,blocktextdat + mov ax,[bx] + add ax,blocktext + mov si,ax + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------Printing of non scrolling icons---- + +Showicon proc near + + cmp reallocation,50 + jnc isdream1 + call showpanel + call showman + call roomname + call panelicons1 + call zoomicon + ret + +isdream1: mov ds,tempsprites + mov di,72 + mov bx,2 + mov al,45 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+47 + mov bx,2 + mov al,46 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,69-10 + mov bx,21 + mov al,49 + mov ah,0 + call showframe + + mov ds,tempsprites + mov di,160+88 + mov bx,2 + mov al,45 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+43 + mov bx,2 + mov al,46 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+101 + mov bx,21 + mov al,49 + mov ah,4 + call showframe + call middlepanel + ret + + endp + + + + + +Middlepanel proc near + + mov ds,tempsprites + mov di,72+47+20 + mov bx,0 + mov al,48 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+19 + mov bx,21 + mov al,47 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,160+23 + mov bx,0 + mov al,48 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+71 + mov bx,21 + mov al,47 + mov ah,4 + call showframe + ret + + endp + + + + + + + + + + +Showman proc near + + mov ds,icons1 + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,icons1 + mov di,0 + mov bx,114 + mov al,1 + mov ah,0 + call showframe + + cmp shadeson,0 + jz notverycool + + mov ds,icons1 + mov di,28 + mov bx,25 + mov al,2 + mov ah,0 + call showframe +notverycool: ret + + endp + + + + + + + + + + + + + + + + + + + +Showpanel proc near + + mov ds,icons1 + mov di,72 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + mov ds,icons1 + mov di,192 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Roomname proc near + + mov di,88 + mov bx,18 + mov al,53 + mov dl,240 + call printmessage + + mov bl,roomnum + cmp bl,32 + jc notover32 + sub bl,32 + +notover32: mov bh,0 + add bx,bx + mov es,roomdesc + add bx,intextdat + mov ax,[es:bx] + add ax,intext + mov si,ax + + mov linespacing,7 + mov di,88 + mov bx,25 + mov dl,120 + cmp watchon,1 + jz gotpl + mov dl,160 +gotpl: mov al,0 + mov ah,0 + call printdirect + mov linespacing,10 + + call usecharset1 + ret + + endp + + + + + + +Usecharset1 proc near + + mov ax,charset1 + mov currentset,ax + ret + + endp + + + + + + + + + + + +Usetempcharset proc near + + mov ax,tempcharset + mov currentset,ax + ret + + endp + + + + + +Showexit proc near + + mov ds,icons1 + mov di,274 + mov bx,154 + mov al,11 + mov ah,0 + call showframe + ret + + endp + + + + +Panelicons1 proc near + + mov di,0 + cmp watchon,1 + jz watchison + mov di,48 +watchison: push di + mov ds,icons2 + add di,204 + mov bx,4 + mov al,2 + mov ah,0 + call showframe + pop di + push di + cmp zoomon,1 + jz zoomisoff + mov ds,icons1 + add di,228 + mov bx,8 + mov al,5 + mov ah,0 + call showframe +zoomisoff: pop di + call showwatch + ret + + endp + + + + + + + + + + + + +Showwatch proc near + + cmp watchon,0 + jz nowristwatch + mov ds,icons1 + mov di,250 + mov bx,1 + mov al,6 + mov ah,0 + call showframe + call showtime +nowristwatch: ret + + endp + + +Gettime proc near + + mov ah,2ch + int 21h + mov secondcount,dh + mov minutecount,cl + mov hourcount,ch + ret + + endp + + + + + +Zoomicon proc near + + cmp zoomon,0 + jz nozoom1 + mov ds,icons1 + mov di,zoomx + mov bx,zoomy-1 + mov al,8 + mov ah,0 + call showframe +nozoom1: ret + + endp + + + + + + +Showblink proc near + + cmp manisoffscreen,1 + jz finblink1 + inc blinkcount + cmp shadeson,0 + jnz finblink1 + cmp reallocation,50 + jnc eyesshut + mov al,blinkcount + cmp al,3 + jnz finblink1 + mov blinkcount,0 + mov al,blinkframe + inc al + mov blinkframe,al + cmp al,6 + jc nomorethan6 + mov al,6 +nomorethan6: mov ah,0 + mov bx,offset cs:blinktab + add bx,ax + + mov al,[cs:bx] + mov ds,icons1 + mov di,44 + mov bx,32 + mov ah,0 + call showframe +finblink1: ret + +eyesshut: ;mov al,32 + ;mov ds,icons1 + ;mov di,44 + ;mov bx,32 + ;mov ah,0 + ;call showframe + ret + +blinktab: db 16,18,18,17,16,16,16 + + endp + + + + + + +Dumpblink proc near + + cmp shadeson,0 + jnz nodumpeye + cmp blinkcount,0 + jnz nodumpeye + mov al,blinkframe + cmp al,6 + jnc nodumpeye + push ds + mov di,44 + mov bx,32 + mov cl,16 + mov ch,12 + call multidump + pop ds +nodumpeye: ret + + endp + + + + + + + + + + + + + + + + + + +Worktoscreenm proc near + + call animpointer + call readmouse + call showpointer + call vsync + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------------------------Blank routine---- + + + + +Blank proc near + + cmp commandtype,199 + jz alreadyblnk + mov commandtype,199 + mov al,0 + call commandonly +alreadyblnk: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +;---------------------------------------------------------Standard routines---- + + + + + + + + + + + + + +Allpointer proc near + + call readmouse + call showpointer + call dumppointer + ret + + endp + + + + + + + +Hangonp proc near + + push cx + add cx,cx + pop ax + add cx,ax + mov maintimer,0 + mov al,pointerframe + mov ah,pickup + push ax + mov pointermode,3 + mov pickup,0 + push cx + mov commandtype,255 + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + +hangloop: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + mov ax,mousebutton + cmp ax,0 + jz notpressed + cmp ax,oldbutton + jnz getoutofit +notpressed: loop hangloop + +getoutofit: call delpointer + pop ax + mov pointerframe,al + mov pickup,ah + mov pointermode,0 + ret + + endp + + + + + +Hangonw proc near + +hangloopw: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + loop hangloopw + ret + + endp + + + + +Hangoncurs proc near + +monloop1: push cx + call printcurs + call vsync + call delcurs + pop cx + loop monloop1 + ret + + endp + + + + + + + + +Getunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiget + ret + + endp + + + + + +Dumpzoom proc near + + cmp zoomon,1 + jnz notzoomon + mov di,zoomx+5 + mov bx,zoomy+4 + mov cl,46 + mov ch,40 + call multidump +notzoomon: ret + + endp + + + + + + + +Putunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiput + ret + + endp + + + + + +Crosshair proc near + + cmp commandtype,3 + jz nocross + cmp commandtype,10 + jnc nocross + + mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,9 + mov ah,0 + call showframe + ret + +nocross: mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,29 + mov ah,0 + call showframe + ret + + endp + + + + + + +Showpointer proc near + + call showblink + mov di,mousex + mov oldpointerx,di + mov bx,mousey + mov oldpointery,bx + cmp pickup,1 + jz itsanobject + + push bx di + mov ds,icons1 + mov al,pointerframe + add al,20 + mov ah,0 + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cx,[si] + cmp cl,12 + jnc notsmallx + mov cl,12 +notsmallx: cmp ch,12 + jnc notsmally + mov ch,12 +notsmally: mov pointerxs,cl + mov pointerys,ch + push ds + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx + push di bx + mov al,pointerframe + add al,20 + mov ah,0 + call showframe + pop bx di + ret + +itsanobject: mov al,itemframe + mov ds,extras + cmp objecttype,4 + jz itsfrominv + mov ds,freeframes +itsfrominv: mov cl,al + add al,al + add al,cl + inc al + mov ah,0 + + push ax + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov ax,2080 + mov cx,[si] + cmp cl,12 + jnc notsmallx2 + mov cl,12 +notsmallx2: cmp ch,12 + jnc notsmally2 + mov ch,12 +notsmally2: mov pointerxs,cl + mov pointerys,ch + pop ax + + push di bx + push ax bx di ds + mov al,cl + mov ah,0 + shr ax,1 + sub oldpointerx,ax + sub di,ax + mov al,ch + shr ax,1 + sub oldpointery,ax + sub bx,ax + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx ax + mov ah,128 + call showframe + pop bx di + mov ds,icons1 + mov al,3 + mov ah,128 + call showframe + ret + + endp + + + + + + + +Delpointer proc near + + mov ax,oldpointerx + cmp ax,0ffffh + jz nevershown + mov delherex,ax + mov ax,oldpointery + mov delherey,ax + mov cl,pointerxs + mov delxs,cl + mov ch,pointerys + mov delys,ch + mov ds,buffers + mov si,pointerback + mov di,delherex + mov bx,delherey + call multiput +nevershown: ret + + endp + + + + + + + + + +Dumppointer proc near + + call dumpblink + mov cl,delxs + mov ch,delys + mov di,delherex + mov bx,delherey + call multidump + + mov bx,oldpointery + mov di,oldpointerx + cmp di,delherex + jnz difffound + cmp bx,delherey + jz notboth +difffound: mov cl,pointerxs + mov ch,pointerys + call multidump +notboth: ret + + endp + + + + + + + + + + + +Undertextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiget + ret + + endp + + + + + + + + +Deltextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiput + ret + + endp + + + + + +Dumptextline proc near + + cmp newtextline,1 + jnz nodumptextline + mov newtextline,0 + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov cl,undertextsizex + mov ch,undertextsizey + call multidump +nodumptextline: ret + + endp + + + + + + + + + + + + + + + + + +Animpointer proc near + + cmp pointermode,2 + jz combathand + cmp pointermode,3 + jz mousehand + + cmp watchingtime,0 + jz notwatchpoint + mov pointerframe,11 + ret +notwatchpoint: mov pointerframe,0 + cmp inmaparea,0 + jz gothand + cmp pointerfirstpath,0 + jz gothand +arrow: call getflagunderp + cmp cl,2 + jc gothand + cmp cl,128 + jnc gothand + mov pointerframe,3 + test cl,4 + jnz gothand + mov pointerframe,4 + test cl,16 + jnz gothand + mov pointerframe,5 + test cl,2 + jnz gothand + mov pointerframe,6 + test cl,8 + jnz gothand + mov pointerframe,8 +gothand: ret + +mousehand: cmp pointerspeed,0 + jz rightspeed3 + dec pointerspeed + jmp finflashmouse +rightspeed3: mov pointerspeed,5 + inc pointercount + cmp pointercount,16 + jnz finflashmouse + mov pointercount,0 +finflashmouse: mov al,pointercount + mov ah,0 + mov bx,offset cs:flashmousetab + add bx,ax + mov al,[cs:bx] + mov pointerframe,al + ret + +combathand: mov pointerframe,0 + cmp reallocation,14 + jnz notarrow + cmp commandtype,211 + jnz notarrow + mov pointerframe,5 +notarrow: ret + +flashmousetab: db 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2 + + endp + + + + +;------------------------------------------------Mouse and keyboard-readers---- + +Setmouse proc near + + if recording + mov recordpos,-8 + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov rechandle,ax + endif + + if playback + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov ah,3dh + mov al,2 + int 21h + mov rechandle,ax + call loadrec + endif + + mov oldpointerx,0ffffh + + mov ax,0 + int 33h + mov ax,8 + mov cx,15 + mov dx,184 + int 33h + mov ax,7 + mov cx,15 + mov dx,298*2 + int 33h + ret + + endp + + + + + +Readmouse proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton,bx + ret + + endp + + + + + + + +Mousecall proc near + + if playback + call playmouse + ret + endif + + mov ax,3 + int 33h + shr cx,1 + cmp cx,298 + jc notxover + mov cx,298 +notxover: cmp cx,15 + jnc notxover2 + mov cx,15 +notxover2: cmp dx,184 + jc notyover + mov dx,184 +notyover: cmp dx,15 + jnc notyover2 + mov dx,15 +notyover2: + if recording + call recmouse + endif + ret + + endp + + + + + + + if playback + +Playmouse proc near + + mov es,recordspace + mov di,recordpos + cmp word ptr [es:di+6],0 + jnz isthisplay + add di,8 + add recordpos,8 + cmp di,16384 + jnz isthisplay + call loadrec +isthisplay: mov cx,[es:di] + mov dx,[es:di+2] + mov bx,[es:di+4] + dec word ptr [es:di+6] + ret + + endp + + endif + + if recording + +Recmouse proc near + + mov es,recordspace + mov di,recordpos + cmp di,-8 + jz diffrec + cmp [es:di],cx + jnz diffrec + cmp [es:di+2],dx + jnz diffrec + cmp [es:di+4],bx + jnz diffrec + inc word ptr [es:di+6] + cmp word ptr [es:di+5],0ffffh + jz diffrec + ret +diffrec: add recordpos,8 + add di,8 + cmp di,16384 + jnz notsaverec + push cx dx bx + call saverec + pop bx dx cx +notsaverec: mov [es:di],cx + mov [es:di+2],dx + mov [es:di+4],bx + mov word ptr [es:di+6],1 + ret + + endp + + + + + +Saverec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,recordpos + add cx,8 + mov ah,40h + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + + + + +Loadrec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,16384+8 + mov ah,3fh + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + endif + + + + + + + +Readmouse1 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton1,bx + ret + + endp + + + +Readmouse2 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton2,bx + ret + + endp + + +Readmouse3 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton3,bx + ret + + endp + + + + + + +Readmouse4 proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov ax,mousebutton1 + or ax,mousebutton2 + or ax,mousebutton3 + or bx,ax + mov mousebutton,bx + ret + + endp + + + + + +Readkey proc near + + mov bx,bufferout + cmp bx,bufferin + jz nokey + inc bx + and bx,15 + mov bufferout,bx + mov di,offset cs:keybuffer + add di,bx + mov al,[cs:di] + mov currentkey,al + ret +nokey: mov currentkey,0 + ret + +keybuffer: db 16 dup (0) + + endp + + + + +Convertkey proc near + + and al,127 + mov ah,0 + mov di,offset cs:keyconverttab + add di,ax + mov al,[cs:di] + ret + +keyconverttab: db 0,0,"1","2","3","4","5","6","7","8","9","0","-",0,8,0 + db "Q","W","E","R","T","Y","U","I","O","P",0,0,13,0,"A","S" + db "D","F","G","H","J","K","L",0,0,0,0,0,"Z","X","C","V","B","N","M" + db 0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + endp + + + + +;-------------------------------------------------------------Miscellaneous---- + +Randomnum1 proc near + + push ds es di bx cx + call randomnumber + pop cx bx di es ds + ret + + endp + + + + + +Randomnum2 proc near + + push ds es di bx ax + call randomnumber + mov cl,al + pop ax bx di es ds + ret + + endp + + + + + +Randomnumber proc near + + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + + mov al,seed + ret + + endp + + + + + + +Hangon proc near + +hangonloop: push cx + call vsync + pop cx + loop hangonloop + ret + + endp + + + + + +;-------------------------------------------------------------Disc handling---- + + +Loadtraveltext proc near + + mov dx,offset cs:traveltextname + call standardload + mov traveltext,ax + ret + + endp + + + + + + +Loadintotemp proc near + + push cs + pop ds + call standardload + mov tempgraphics,ax + ret + + endp + + + + + + +Loadintotemp2 proc near + + push cs + pop ds + call standardload + mov tempgraphics2,ax + ret + + endp + + + + +Loadintotemp3 proc near + + push cs + pop ds + call standardload + mov tempgraphics3,ax + ret + + endp + + + +Loadtempcharset proc near + + call standardload + mov tempcharset,ax + ret + + endp + + + + + + +Standardload proc near + + call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov ds,ax + pop cx + push ax + mov dx,0 + call readfromfile + call closefile + pop ax + ret + + endp + + + + + + +Loadtemptext proc near + + call standardload + mov textfile1,ax + ret + + endp + + + + + + + +Loadroom proc near + + mov roomloaded,1 + mov timecount,0 + mov maintimer,0 + mov mapoffsetx,104 + mov mapoffsety,38 + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + mov al,newlocation + mov location,al + call getroomdata + call startloading + call loadroomssample + call switchryanon + call drawflags + call getdimension + ret + + endp + + + + +Loadroomssample proc near + + mov al,roomssample + cmp al,255 + jz loadedalready + cmp al,currentsample + jz loadedalready + mov currentsample,al + mov al,currentsample + mov cl,"0" + call twodigitnum + mov di,offset cs:samplename + xchg al,ah + mov [cs:di+10],ax + mov dx,di + call loadsecondsample +loadedalready: ret + + endp + + + + + +Getridofreels proc near + + cmp roomloaded,0 + jz dontgetrid + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem +dontgetrid: ret + + endp + + + + + +Getridofall proc near + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + +Restorereels proc near + + cmp roomloaded,0 + jz dontrestore + mov al,reallocation + call getroomdata + mov dx,bx + call openfile + call readheader + + call dontloadseg + call dontloadseg + call dontloadseg + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + call closefile +dontrestore: ret + + endp + + + + + + + +Restoreall proc near + + mov al,location + call getroomdata + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + ;mov ds,setdat + ;mov dx,0 + ;mov cx,setdatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call bloc + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + ;mov ds,freedat + ;mov dx,0 + ;mov cx,freedatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + call setallchanges + ret + + endp + + + +Sortoutmap proc near + + push es di + mov ds,workspace + mov si,0 + mov es,mapdata + mov di,0 + + mov cx,maplength +blimey: push cx si + mov cx,mapwidth + rep movsb + pop si cx + add si,132 + loop blimey + pop di es + ret + + endp + + + + +Startloading proc near + + mov combatcount,0 + mov al,[cs:bx+13] + mov roomssample,al + mov al,[cs:bx+15] + mov mapx,al + mov al,[cs:bx+16] + mov mapy,al + + mov al,[cs:bx+20] ; start path pos + mov liftflag,al + mov al,[cs:bx+21] ; start path pos + mov manspath,al + mov destination,al + mov finaldest,al + mov al,[cs:bx+22] + mov facing,al + mov turntoface,al + mov al,[cs:bx+23] + mov counttoopen,al + mov al,[cs:bx+24] + mov liftpath,al + mov al,[cs:bx+25] + mov doorpath,al + mov lastweapon,-1 + mov al,[cs:bx+27] + push ax + + mov al,[cs:bx+31] + mov ah,reallocation + mov reallocation,al + + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + mov ds,setdat + mov dx,0 + mov cx,setdatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + mov ds,freedat + mov dx,0 + mov cx,freedatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + + call findroominloc + call deletetaken + call setallchanges + call autoappear + mov al,newlocation + call getroomdata + mov lastweapon,-1 + mov mandead,0 + mov lookcounter,160 + mov newlocation,255 + mov linepointer,254 + pop ax + cmp al,255 + jz dontwalkin + mov manspath,al + push bx + call autosetwalk + pop bx +dontwalkin: call findxyfrompath + ret + + endp + + + + + + + + + + +Disablepath proc near ;needs al,ah map x,y cl=path + + push cx + xchg al,ah + mov cx,-6 +looky2: add cx,6 + sub al,10 + jnc looky2 + mov al,ah + dec cx +lookx2: inc cx + sub al,11 + jnc lookx2 + mov al,cl + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + + + + +Findxyfrompath proc near ;path number was found from + ;room data. Fill ryanxy from + call getroomspaths ;the pathdata. + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov ax,[es:bx] + sub al,12 + sub ah,12 + mov ryanx,al + mov ryany,ah + ret + + endp + + + + + +Findroominloc proc near + + mov al,mapy + mov cx,-6 +looky: add cx,6 + sub al,10 + jnc looky + mov al,mapx + dec cx +lookx: inc cx + sub al,11 + jnc lookx + mov roomnum,cl + ret + + endp + + + + + + +Getroomdata proc near + + mov ah,0 + mov cx,32 + mul cx + mov bx,offset cs:roomdata + add bx,ax + ret + + endp + + + + + + + + + + + + + +Readheader proc near + + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen + call readfromfile + push cs + pop es + mov di,offset cs:filedata + ret + + endp + + + + + + + + +Dontloadseg proc neqr + + mov ax,[es:di] + add di,2 + push bx di es + mov cx,0 + mov dx,ax + mov al,1 + mov ah,42h + int 21h + pop es di bx + ret + + endp + + + + + + +Allocateload proc near + + push es di + mov bx,[es:di] + mov cl,4 + shr bx,cl + call allocatemem + pop di es + ret + + endp + + + + +Fillspace proc near + + push es ds dx di bx + mov di,dx + push ds + pop es + rep stosb + pop bx di dx ds es + ret + + endp + + + + + + + +Getridoftemp proc near + + mov es,tempgraphics + call deallocatemem + ret + + endp + + + + + +Getridoftemptext proc near + + mov es,textfile1 + call deallocatemem + ret + + endp + + + + + +Getridoftemp2 proc near + + mov es,tempgraphics2 + call deallocatemem + ret + + endp + + + +Getridoftemp3 proc near + + mov es,tempgraphics3 + call deallocatemem + ret + + endp + + + +Getridoftempcharset proc near + + mov es,tempcharset + call deallocatemem + ret + + endp + + + +Getridoftempsp proc near + + mov es,tempsprites + call deallocatemem + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + +Readsetdata proc near + + if cd + if demo + else + mov dx,offset cs:idname + call openfilefromc + push cs + pop ds + mov dx,offset cs:id + mov cx,1 + call readfromfile + call closefile + endif + endif + + mov dx,offset cs:characterset1 + call standardload + mov charset1,ax + + mov dx,offset cs:icongraphics0 + call standardload + mov icons1,ax + + mov dx,offset cs:icongraphics1 + call standardload + mov icons2,ax + + mov dx,offset cs:spritename1 + call standardload + mov mainsprites,ax + + mov dx,offset cs:puzzletextname + call standardload + mov puzzletext,ax + + mov dx,offset cs:commandtextname + call standardload + mov commandtext,ax + + mov ax,charset1 + mov currentset,ax + + cmp soundint,255 + jz novolumeload + mov dx,offset cs:volumetabname + call openfile + mov cx,2048-256 + mov ds,soundbuffer + mov dx,16384 + call readfromfile + call closefile +novolumeload: ret + + endp + + + + + + + + + + + +Createfile proc near + + mov ah,3ch + mov cx,0 + int 21h + mov bx,ax + ret + + endp + + + + + + + +Openfile proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + jc fileerror + mov handle,ax + ret +fileerror: mov gameerror,8 + jmp quickquit2 + + endp + + + if cd +Openfilefromc proc near + + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + mov handle,ax + ret + + endp + endif + + + if cd +Makename proc near + + if demo + ret + endif + mov si,dx + mov di,offset cs:place +transfer: mov al,[cs:si] + mov [cs:di],al + inc si + inc di + cmp al,0 + jnz transfer + mov dx,offset cs:id + ret +id: db "D:\" +place: db 30 dup (0) + + endp + endif + + + + + +Openfilenocheck proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Openforsave proc near + + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Closefile proc near + + mov bx,handle + mov ah,3eh + int 21h + ret + + endp + + + + +Readfromfile proc near + + mov bx,handle + mov ah,3fh + int 21h + ret + + endp + + + + +Setkeyboardint proc near + + mov ah,35h + mov al,9 + int 21h + mov oldint9seg,es ; Save es:bx to temp memory + mov oldint9add,bx + push cs + pop ds + mov dx,offset cs:keyboardread + mov ah,25h + mov al,9 + int 21h ; Set to new + ret + + endp + + + + +Resetkeyboard proc near + + cmp oldint9add,-1 + jz noreset + mov dx,oldint9add ;Restore old interupt vector + mov ax,oldint9seg ;for keys + mov ds,ax + mov ah,25h + mov al,9 + int 21h +noreset: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Keyboardread proc near + + push ax dx di ds es + in al,60h + cmp al,lasthardkey + jz same + mov lasthardkey,al + cmp al,128 + jnc same + mov dx,bufferin + inc dx + and dx,15 + cmp dx,bufferout + jz same ;buffer is full + mov bufferin,dx + call convertkey + mov di,offset cs:keybuffer + mov dx,bufferin + add di,dx + mov [cs:di],al +same: in al,61h + mov ah,al + or al,80h ; Mask for Akn + out 61h,al ; Set Akn. + and al,7fh + out 61h,al + cli + mov al,20h ; 8259 end of interrupt + out 20h,al + pop es ds di dx ax + iret + + endp + + + +;------------------------------------------------------Text and tables data---- + + + +Fileheader db "DREAMWEB DATA FILE " + db "COPYRIGHT 1992 " + db "CREATIVE REALITY" +Filedata dw 20 dup (0) +Extradata db 6 dup (0) +Headerlen equ $-Fileheader + + +Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment + db 5,255,33,10 + db 255,255,255,0 + db 1,6,2,255,3,255,255,255,255,255,0 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 7,2,255,255,255,255,6,255,255,255,1 + + db "DREAMWEB.R02",0 + db 2,255,33,0 + db 255,255,255,0 + db 1,0,255,255,1,255,3,255,255,255,2 + + db "DREAMWEB.R03",0 + db 5,255,33,10 + db 255,255,255,0 + db 2,2,0,2,4,255,0,255,255,255,3 + + db "DREAMWEB.R04",0 + db 23,255,11,30 + db 255,255,255,0 + db 1,4,0,5,255,255,3,255,255,255,4 + + db "DREAMWEB.R05",0 + if demo + db 22,255,22,30 + else + db 5,255,22,30 + endif + db 255,255,255,0 + db 1,2,0,4,255,255,3,255,255,255,5 + + db "DREAMWEB.R06",0 + db 5,255,11,30 + db 255,255,255,0 + db 1,0,0,1,2,255,0,255,255,255,6 + + db "DREAMWEB.R07",0 + db 255,255,0,20 + db 255,255,255,0 + db 2,2,255,255,255,255,0,255,255,255,7 + + db "DREAMWEB.R08",0 + db 8,255,0,10 + db 255,255,255,0 + db 1,2,255,255,255,255,0,11,40,0,8 + + db "DREAMWEB.R09",0 + db 9,255,22,10 + db 255,255,255,0 + db 4,6,255,255,255,255,0,255,255,255,9 + + db "DREAMWEB.R10",0 + db 10,255,33,30 + db 255,255,255,0 + db 2,0,255,255,2,2,4,22,30,255,10 ;22,30,0 switches + ;off path 0 in skip + db "DREAMWEB.R11",0 + db 11,255,11,20 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R12",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R13",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,13 + + db "DREAMWEB.R14",0 + db 14,255,44,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,14 + + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R20",0 + db 22,255,0,20 + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,20 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R22",0 + db 22,255,22,10 + db 255,255,255,0 + db 0,4,255,255,1,255,255,255,255,255,22 + + db "DREAMWEB.R23",0 + db 23,255,22,30 + db 255,255,255,0 + db 1,4,2,15,3,255,255,255,255,255,23 + + db "DREAMWEB.R24",0 + db 5,255,44,0 + db 255,255,255,0 + db 1,6,2,15,255,255,255,255,255,255,24 + + db "DREAMWEB.R25",0 + db 22,255,11,40 + db 255,255,255,0 + db 1,0,255,255,255,255,255,255,255,255,25 + + db "DREAMWEB.R26",0 + db 9,255,22,20 + db 255,255,255,0 + db 4,2,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R27",0 + db 22,255,11,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,27 + + db "DREAMWEB.R28",0 + db 5,255,11,30 + db 255,255,255,0 + db 0,0,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R29",0 + db 22,255,11,10 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,29 + + + + db "DREAMWEB.R05",0 ;Duplicate of hotel lobby, + if demo + db 22,255,22,10 ;but emerging from the lift. + else + db 5,255,22,10 + endif + db 255,255,255,0 + db 1,4,1,15,255,255,255,255,255,255,5 + + db "DREAMWEB.R04",0 ;Duplicate of pool hall lobby, + db 23,255,22,20 ;but emerging from the lift. + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,4 + + db "DREAMWEB.R10",0 ;entering alley via skip + db 10,255,22,30 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,10 + + db "DREAMWEB.R12",0 ;on the beach, getting up. + db 12,255,22,20 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R03",0 ;Duplicate of Eden's lobby + db 5,255,44,0 ;but emerging from the lift + db 255,255,255,0 + db 1,6,2,255,4,255,255,255,255,255,3 + + db "DREAMWEB.R24",0 ;Duplicate of Eden's flat + db 5,255,22,0 ;but starting on the bed + db 255,255,255,0 + db 3,6,0,255,255,255,255,33,0,3,24 ; 33,0,3 turns off + ; path for lift + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 ;coming out of bedroom + db 0,2,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R11",0 ;Duplicate + db 11,255,22,30 ;of carpark but getting + db 255,255,255,0 ;up off the floor + db 0,0,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R28",0 + db 5,255,11,20 + db 255,255,255,0 + db 0,6,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R26",0 + db 9,255,0,40 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 2,2,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R08",0 ;leaving tvstudio into street + db 8,255,11,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,8 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,1 + + + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + db "DREAMWEB.R47",0 ;Dream room + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,47 + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 4,0,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,50 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + + + db "DREAMWEB.R50",0 ; Intro sequence one + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,50 + + db "DREAMWEB.R51",0 ; Intro sequence two + db 35,255,11,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,51 + + db "DREAMWEB.R52",0 ; Intro sequence three + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,52 + + db "DREAMWEB.R53",0 ; Intro sequence four + db 35,255,33,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,53 + + db "DREAMWEB.R54",0 ; Intro sequence five - wasteland + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,54 + + db "DREAMWEB.R55",0 ; End sequence + db 14,255,44,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,55 + + +Madeuproomdat db 32 dup (0) + +Roomscango db 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0 + +Roompics db 5,0,3,2,4,1,10,9,8,6,11,4,7,7,0 + +Oplist db 3 dup (0) + +Inputline db 128 dup (0) + +linedata dw 200 dup (0ffffh) + +presslist db 6 dup (255) + +savenames db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + + + +savefiles db "DREAMWEB.D00",0 + db "DREAMWEB.D01",0 + db "DREAMWEB.D02",0 + db "DREAMWEB.D03",0 + db "DREAMWEB.D04",0 + db "DREAMWEB.D05",0 + db "DREAMWEB.D06",0 + +Recname db "DREAMWEB.DEM",0 + + +;-------------------------------------------------------End of code segment---- + +DREAMWEBPROG ends + + + + +;---------------------------------------------------------------Stack space----s + +STACKSPACE segment para stack 'STACK' + +stak db 256 dup (?) + +STACKSPACE ends + + + +;-----------------------------------------------------------End of all code---- + + end Dreamweb + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm new file mode 100644 index 0000000000..d75a4fde82 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -0,0 +1,1758 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Entercode proc near + + mov keypadax,ax + mov keypadcx,cx + call getridofreels + call loadkeypad + call createpanel + call showicon + call showouterpad + call showkeypad + call readmouse + call showpointer + call worktoscreen + call delpointer + mov presspointer,0 + mov getback,0 + +keypadloop: call delpointer + call readmouse + call showkeypad + call showpointer + cmp presscount,0 + jz nopresses + dec presscount + jmp afterpress +nopresses: mov pressed,255 + mov graphicpress,255 + call vsync + +afterpress: call dumppointer + call dumpkeypad + call dumptextline + mov bx,offset cs:keypadlist + call checkcoords + cmp getback,1 + jz numberright + + cmp lightcount,1 + jnz notendkey + cmp lockstatus,0 + jz numberright + jmp keypadloop + +notendkey: cmp presscount,40 + jnz keypadloop + call addtopresslist + cmp pressed,11 + jnz keypadloop + mov ax,keypadax + mov cx,keypadcx + call isitright + jnz incorrect + mov lockstatus,0 + mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop +incorrect: mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop + +numberright: mov manisoffscreen,0 + call getridoftemp + call restorereels + call redrawmainscrn + call worktoscreenm + ret + +keypadlist: dw keypadx+9,keypadx+30,keypady+9,keypady+22,buttonone + dw keypadx+31,keypadx+52,keypady+9,keypady+22,buttontwo + dw keypadx+53,keypadx+74,keypady+9,keypady+22,buttonthree + dw keypadx+9,keypadx+30,keypady+23,keypady+40,buttonfour + dw keypadx+31,keypadx+52,keypady+23,keypady+40,buttonfive + dw keypadx+53,keypadx+74,keypady+23,keypady+40,buttonsix + dw keypadx+9,keypadx+30,keypady+41,keypady+58,buttonseven + dw keypadx+31,keypadx+52,keypady+41,keypady+58,buttoneight + dw keypadx+53,keypadx+74,keypady+41,keypady+58,buttonnine + dw keypadx+9,keypadx+30,keypady+59,keypady+73,buttonnought + dw keypadx+31,keypadx+74,keypady+59,keypady+73,buttonenter + dw keypadx+72,keypadx+86,keypady+80,keypady+94,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Loadkeypad proc near + + mov dx,offset cs:extragraphics1 + call loadintotemp + ret + + endp + + + + +Quitkey proc near + + cmp commandtype,222 + jz alreadyqk + mov commandtype,222 + mov al,4 + call commandonly +alreadyqk: mov ax,mousebutton + cmp ax,oldbutton + jz notqk + and ax,1 + jnz doqk +notqk: ret + +doqk: mov getback,1 + ret + + endp + + + + + + + + + + + + + + + + + + +Addtopresslist proc near + + cmp presspointer,5 + jz nomorekeys + mov al,pressed + cmp al,10 + jnz not10 + mov al,0 +not10: mov bx,presspointer + mov dx,seg presslist + mov es,dx + add bx,offset es:presslist + mov [es:bx],al + inc presspointer +nomorekeys: ret + + endp + + + + +Buttonone proc near + + mov cl,1 + call buttonpress + ret + + endp + + +Buttontwo proc near + + mov cl,2 + call buttonpress + ret + + endp + + + +Buttonthree proc near + + mov cl,3 + call buttonpress + ret + + endp + + + +Buttonfour proc near + + mov cl,4 + call buttonpress + ret + + endp + + +Buttonfive proc near + + mov cl,5 + call buttonpress + ret + + endp + + + +Buttonsix proc near + + mov cl,6 + call buttonpress + ret + + endp + + +Buttonseven proc near + + mov cl,7 + call buttonpress + ret + + endp + + +Buttoneight proc near + + mov cl,8 + call buttonpress + ret + + endp + +Buttonnine proc near + + mov cl,9 + call buttonpress + ret + + endp + + + +Buttonnought proc near + + mov cl,10 + call buttonpress + ret + + endp + + + + + + +Buttonenter proc near + + mov cl,11 + call buttonpress + ret + + endp + + + +Buttonpress proc near + + mov ch,cl + add ch,100 + cmp commandtype,ch + jz alreadyb + mov commandtype,ch + mov al,cl + add al,4 + push cx + call commandonly + pop cx +alreadyb: mov ax,mousebutton + cmp ax,oldbutton + jz notb + and ax,1 + jnz dob +notb: ret + +dob: mov pressed,cl + add cl,21 + mov graphicpress,cl + mov presscount,40 + cmp cl,32 + jz nonoise + mov al,10 + call playchannel1 +nonoise: ret + + endp + + + + + + + + + + + + + + +Showouterpad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,keypadx+74 + mov bx,keypady+76 + mov ds,tempgraphics + mov al,37 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + +Showkeypad proc near + + mov al,22 + mov di,keypadx+9 + mov bx,keypady+5 + call singlekey + mov al,23 + mov di,keypadx+31 + mov bx,keypady+5 + call singlekey + mov al,24 + mov di,keypadx+53 + mov bx,keypady+5 + call singlekey + + mov al,25 + mov di,keypadx+9 + mov bx,keypady+23 + call singlekey + mov al,26 + mov di,keypadx+31 + mov bx,keypady+23 + call singlekey + mov al,27 + mov di,keypadx+53 + mov bx,keypady+23 + call singlekey + + mov al,28 + mov di,keypadx+9 + mov bx,keypady+41 + call singlekey + mov al,29 + mov di,keypadx+31 + mov bx,keypady+41 + call singlekey + mov al,30 + mov di,keypadx+53 + mov bx,keypady+41 + call singlekey + + mov al,31 + mov di,keypadx+9 + mov bx,keypady+59 + call singlekey + mov al,32 + mov di,keypadx+31 + mov bx,keypady+59 + call singlekey + + cmp lightcount,0 + jz notenter + dec lightcount + mov al,36 + mov bx,keypady-1+63 + cmp lockstatus,0 + jnz changelight + mov al,41 + mov bx,keypady+4+63 +changelight: cmp lightcount,60 + jc gotlight + cmp lightcount,100 + jnc gotlight + dec al +gotlight: mov ds,tempgraphics + mov ah,0 + mov di,keypadx+60 + call showframe + +notenter: ret + + endp + + + + + +Singlekey proc near + + cmp graphicpress,al + jnz gotkey + add al,11 + cmp presscount,8 + jnc gotkey + sub al,11 +; cmp presscount,10 +; jnc gotkey +; sub al,11 +gotkey: mov ds,tempgraphics + sub al,20 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Dumpkeypad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov cl,120 + mov ch,90 + call multidump + ret + + endp + + + + + +;--------------------------------- + + + + +Usemenu proc near + + call getridofreels + call loadmenu + call createpanel + call showpanel + call showicon + mov newobs,0 + call drawfloor + call printsprites + + mov al,4 + mov ah,0 + mov di,menux-48 + mov bx,menuy-4 + mov ds,tempgraphics2 + call showframe + call getundermenu + mov al,5 + mov ah,0 + mov di,menux+54 + mov bx,menuy+72 + mov ds,tempgraphics2 + call showframe + + + call worktoscreenm + mov getback,0 + +menuloop: call delpointer + call putundermenu + call showmenu + call readmouse + call showpointer + call vsync + call dumppointer + call dumpmenu + call dumptextline + mov bx,offset cs:menulist + call checkcoords + cmp getback,1 + jnz menuloop + + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call getridoftemp2 + call restorereels + call worktoscreenm + ret + +menulist: dw menux+54,menux+68,menuy+72,menuy+88,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Dumpmenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + call multidump + ret + + endp + + + + + + +Getundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + + + + + +Putundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + +Showoutermenu proc near + + mov al,40 + mov ah,0 + mov di,menux-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,41 + mov ah,0 + mov di,menux+64-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,42 + mov ah,0 + mov di,menux-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + mov al,43 + mov ah,0 + mov di,menux+64-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + ret + + endp + + + + + + + + +Showmenu proc near + + inc menucount + cmp menucount,37*2 + jnz menuframeok + mov menucount,0 +menuframeok: mov al,menucount + shr al,1 + mov ah,0 + mov di,menux + mov bx,menuy + mov ds,tempgraphics + call showframe + ret + + endp + + + +Loadmenu proc near + + mov dx,offset cs:spritename3 + call loadintotemp + mov dx,offset cs:mongraphics2 + call loadintotemp2 + ret + + endp + + + + + + + + + + + + + + + + +Viewfolder proc near + + mov manisoffscreen,1 + call getridofall + call loadfolder + mov folderpage,0 + call showfolder + call worktoscreenm + mov getback,0 + +folderloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:folderlist + call checkcoords + cmp getback,0 + jz folderloop + + mov manisoffscreen,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + call getridoftempcharset + call restoreall + call redrawmainscrn + call worktoscreenm + ret + +folderlist: dw 280,320,160,200,quitkey + dw 143,300,6,194,nextfolder + dw 0,143,6,194,lastfolder + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + +Nextfolder proc near + + cmp folderpage,12 + jnz cannextf + call blank + ret +cannextf: cmp commandtype,201 + jz alreadynextf + mov commandtype,201 + mov al,16 + call commandonly +alreadynextf: mov ax,mousebutton + cmp ax,oldbutton + jz notnextf + cmp ax,1 + jz donextf +notnextf: ret +donextf: inc folderpage + call folderhints + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + + +Folderhints proc near + + cmp folderpage,5 + jnz notaideadd + cmp aidedead,1 + jz notaideadd + mov al,13 + call getlocation + cmp al,1 + jz notaideadd + mov al,13 + call setlocation + call showfolder + mov al,30 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp + ret + +notaideadd: cmp folderpage,9 + jnz notaristoadd + mov al,7 + call getlocation + cmp al,1 + jz notaristoadd + mov al,7 + call setlocation + call showfolder + mov al,31 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp +notaristoadd: ret + + endp + + + +Lastfolder proc near + + cmp folderpage,0 + jnz canlastf + call blank + ret +canlastf: cmp commandtype,202 + jz alreadylastf + mov commandtype,202 + mov al,17 + call commandonly +alreadylastf: cmp folderpage,0 + jz notlastf + mov ax,mousebutton + cmp ax,oldbutton + jz notlastf + cmp ax,1 + jz dolastf +notlastf: ret +dolastf: dec folderpage + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + +Loadfolder proc near + + mov dx,offset cs:foldergraphic1 + call loadintotemp + mov dx,offset cs:foldergraphic2 + call loadintotemp2 + mov dx,offset cs:foldergraphic3 + call loadintotemp3 + mov dx,offset cs:characterset3 + call loadtempcharset + mov dx,offset cs:foldertext + call loadtemptext + ret + + endp + + + + +Showfolder proc near + + mov commandtype,255 + cmp folderpage,0 + jz closedfolder + call usetempcharset + call createpanel2 + mov ds,tempgraphics + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,0 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,0 + mov bx,92 + mov al,2 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,92 + mov al,3 + mov ah,0 + call showframe + call folderexit + + cmp folderpage,1 + jz noleftpage + call showleftpage +noleftpage: cmp folderpage,12 + jz norightpage + call showrightpage +norightpage: call usecharset1 + call undertextline + ret + +closedfolder: call createpanel2 + mov ds,tempgraphics3 + mov di,143-28 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics3 + mov di,143-28 + mov bx,92 + mov al,1 + mov ah,0 + call showframe + call folderexit + call undertextline + ret + + endp + + + + + + + + +Folderexit proc near + + mov ds,tempgraphics2 + mov di,296 + mov bx,178 + mov al,6 + mov ah,0 + call showframe + ret + + endp + + + + + +Showleftpage proc near + + mov ds,tempgraphics2 + mov di,0 + mov bx,12 + mov al,3 + mov ah,0 + call showframe + + mov bx,12+5 + mov cx,9 +leftpageloop: push cx bx + mov ds,tempgraphics2 + mov di,0 + mov al,4 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop leftpageloop + + mov ds,tempgraphics2 + mov di,0 + mov al,5 + mov ah,0 + call showframe + + mov linespacing,8 + mov charshift,91 + mov kerning,1 + mov bl,folderpage + dec bl + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,2 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsleft: push cx +contleftpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contleftpage + pop cx + loop twolotsleft + + mov kerning,0 + mov charshift,0 + mov linespacing,10 + + mov es,workspace + mov ds,workspace + mov di,(48*320)+2 + mov si,(48*320)+2+130 + mov cx,120 +flipfolder: push cx di si + mov cx,65 +flipfolderline: mov al,[es:di] + mov ah,[es:si] + mov [es:di],ah + mov [es:si],al + dec si + inc di + loop flipfolderline + pop si di cx + add si,320 + add di,320 + loop flipfolder + ret + + endp + + + +Showrightpage proc near + + mov ds,tempgraphics2 + mov di,143 + mov bx,12 + mov al,0 + mov ah,0 + call showframe + + mov bx,12+37 + mov cx,7 +rightpageloop: push cx bx + mov ds,tempgraphics2 + mov di,143 + mov al,1 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop rightpageloop + + mov ds,tempgraphics2 + mov di,143 + mov al,2 + mov ah,0 + call showframe + + mov linespacing,8 + mov kerning,1 + mov bl,folderpage + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,152 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsright: push cx +contrightpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contrightpage + pop cx + loop twolotsright + + mov kerning,0 + mov linespacing,10 + ret + + endp + + + + + + + + + +Entersymbol proc near + + mov manisoffscreen,1 + call getridofreels + mov dx,offset cs:symbolgraphic + call loadintotemp + mov symboltopx,24 + mov symboltopdir,0 + mov symbolbotx,24 + mov symbolbotdir,0 + call redrawmainscrn + call showsymbol + call undertextline + call worktoscreenm + mov getback,0 + +symbolloop: call delpointer + call updatesymboltop + call updatesymbolbot + call showsymbol + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call dumpsymbol + mov bx,offset cs:symbollist + call checkcoords + cmp getback,0 + jz symbolloop + + cmp symbolbotnum,3 + jnz symbolwrong + cmp symboltopnum,5 + jnz symbolwrong + mov al,43 + call removesetobject + mov al,46 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathon + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + mov al,13 + call playchannel1 + ret + +symbolwrong: mov al,46 + call removesetobject + mov al,43 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathoff + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + ret + +symbollist: dw symbolx+40,symbolx+64,symboly+2,symboly+16,quitsymbol + dw symbolx,symbolx+52,symboly+20,symboly+50,settopleft + dw symbolx+52,symbolx+104,symboly+20,symboly+50,settopright + dw symbolx,symbolx+52,symboly+50,symboly+80,setbotleft + dw symbolx+52,symbolx+104,symboly+50,symboly+80,setbotright + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + + + + + +Quitsymbol proc near + + cmp symboltopx,24 + jnz blank + cmp symbolbotx,24 + jnz blank + cmp commandtype,222 + jz alreadyqs + mov commandtype,222 + mov al,18 + call commandonly +alreadyqs: mov ax,mousebutton + cmp ax,oldbutton + jz notqs + and ax,1 + jnz doqs +notqs: ret + +doqs: mov getback,1 + ret + + endp + + + + +Settopleft proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,210 + jz alreadytopl + mov commandtype,210 + mov al,19 + call commandonly +alreadytopl: cmp mousebutton,0 + jz notopleft + mov symboltopdir,-1 +notopleft: ret + + endp + + + +Settopright proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,211 + jz alreadytopr + mov commandtype,211 + mov al,20 + call commandonly +alreadytopr: cmp mousebutton,0 + jz notopright + mov symboltopdir,1 +notopright: ret + + endp + + + + +Setbotleft proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,212 + jz alreadybotl + mov commandtype,212 + mov al,21 + call commandonly +alreadybotl: cmp mousebutton,0 + jz nobotleft + mov symbolbotdir,-1 +nobotleft: ret + + endp + + + +Setbotright proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,213 + jz alreadybotr + mov commandtype,213 + mov al,22 + call commandonly +alreadybotr: cmp mousebutton,0 + jz nobotright + mov symbolbotdir,1 +nobotright: ret + + endp + + + + + + + +Dumpsymbol proc near + + mov newtextline,0 + mov di,symbolx + mov bx,symboly+20 + mov cl,104 + mov ch,60 + call multidump + ret + + endp + + + + +Showsymbol proc near + + mov al,12 + mov ah,0 + mov di,symbolx + mov bx,symboly + mov ds,tempgraphics + call showframe + + mov al,symboltopx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symboltopnum + mov bx,symboly+20 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + + mov al,symbolbotx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symbolbotnum + add al,6 + mov bx,symboly+49 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + ret + + endp + + + + + + +Nextsymbol proc near + + inc al + cmp al,6 + jz topwrap + cmp al,12 + jz botwrap + ret +topwrap: mov al,0 + ret +botwrap: mov al,6 + ret + + endp + + + +Updatesymboltop proc near + + cmp symboltopdir,0 + jz topfinished + cmp symboltopdir,-1 + jz backwards + + inc symboltopx + cmp symboltopx,49 + jnz notwrapfor + mov symboltopx,0 + dec symboltopnum + cmp symboltopnum,-1 + jnz topfinished + mov symboltopnum,5 + ret +notwrapfor: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 + ret + +backwards: dec symboltopx + cmp symboltopx,-1 + jnz notwrapback + mov symboltopx,48 + inc symboltopnum + cmp symboltopnum,6 + jnz topfinished + mov symboltopnum,0 + ret +notwrapback: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 +topfinished: ret + + endp + + + +Updatesymbolbot proc near + + cmp symbolbotdir,0 + jz botfinished + cmp symbolbotdir,-1 + jz backwardsbot + + inc symbolbotx + cmp symbolbotx,49 + jnz notwrapforb + mov symbolbotx,0 + dec symbolbotnum + cmp symbolbotnum,-1 + jnz botfinished + mov symbolbotnum,5 + ret +notwrapforb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 + ret + +backwardsbot: dec symbolbotx + cmp symbolbotx,-1 + jnz notwrapbackb + mov symbolbotx,48 + inc symbolbotnum + cmp symbolbotnum,6 + jnz botfinished + mov symbolbotnum,0 + ret +notwrapbackb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 +botfinished: ret + + endp + + + + + + + + + + +Dumpsymbox proc near + + cmp dumpx,-1 + jz nodumpsym + mov di,dumpx + mov bx,dumpy + mov cl,30 + mov ch,77;30 + call multidump + mov dumpx,-1 +nodumpsym: ret + + endp + + + + + + + +Usediary proc near + + call getridofreels + mov dx,offset cs:diarygraphic + call loadintotemp + mov dx,offset cs:diarytext + call loadtemptext + + mov dx,offset cs:characterset3 + call loadtempcharset + call createpanel + call showicon + call showdiary + call undertextline + call showdiarypage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov getback,0 + +diaryloop: call delpointer + call readmouse + call showdiarykeys + call showpointer + call vsync + call dumppointer + call dumpdiarykeys + call dumptextline + mov bx,offset cs:diarylist + call checkcoords + cmp getback,0 + jz diaryloop + + call getridoftemp + call getridoftemptext + call getridoftempcharset + call restorereels + mov manisoffscreen,0 + call redrawmainscrn + call worktoscreenm + ret + +diarylist: dw diaryx+94,diaryx+110,diaryy+97,diaryy+113,diarykeyn + dw diaryx+151,diaryx+167,diaryy+71,diaryy+87,diarykeyp + dw diaryx+176,diaryx+192,diaryy+108,diaryy+124,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Showdiary proc near + + mov al,1 + mov ah,0 + mov di,diaryx + mov bx,diaryy+37 + mov ds,tempgraphics + call showframe + mov al,2 + mov ah,0 + mov di,diaryx+176 + mov bx,diaryy+108 + mov ds,tempgraphics + call showframe + ret + + endp + + + + +Showdiarykeys proc near + + cmp presscount,0 + jz nokeyatall + dec presscount + cmp presscount,0 + jz nokeyatall + cmp pressed,"N" + jnz nokeyn + mov al,3 + cmp presscount,1 + jz gotkeyn + mov al,4 +gotkeyn: mov ah,0 + mov di,diaryx+94 + mov bx,diaryy+97 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshown + call showdiarypage +notshown: ret + +nokeyn: mov al,5 + cmp presscount,1 + jz gotkeyp + mov al,6 +gotkeyp: mov ah,0 + mov di,diaryx+151 + mov bx,diaryy+71 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshowp + call showdiarypage +notshowp: ret + +nokeyatall: ret + + endp + + + + + + +Dumpdiarykeys proc near + + cmp presscount,1 + jnz notdumpdiary + cmp sartaindead,1 + jz notsartadd + cmp diarypage,5 + jnz notsartadd + cmp diarypage,5 + jnz notsartadd + mov al,6 + call getlocation + cmp al,1 + jz notsartadd + mov al,6 + call setlocation + + call delpointer + mov al,12 + call findtext1 + mov di,70 ;diaryx+48 + mov bx,106 ;diaryy+16 + mov dl,241 + mov ah,16 + call printdirect + + call worktoscreenm + mov cx,200 + call hangonp + call createpanel + call showicon + call showdiary + call showdiarypage + call worktoscreenm + call showpointer + ret + +notsartadd: mov di,diaryx+48 + mov bx,diaryy+15 + mov cl,200 + mov ch,16 + call multidump +notdumpdiary: mov di,diaryx+94 + mov bx,diaryy+97 + mov cl,16 + mov ch,16 + call multidump + mov di,diaryx+151 + mov bx,diaryy+71 + mov cl,16 + mov ch,16 + call multidump + ret + + endp + + + +Diarykeyp proc near + + cmp commandtype,214 + jz alreadykeyp + mov commandtype,214 + mov al,23 + call commandonly +alreadykeyp: cmp mousebutton,0 + jz notkeyp + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyp + cmp presscount,0 + jnz notkeyp + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"P" + dec diarypage + cmp diarypage,-1 + jnz notkeyp + mov diarypage,11 +notkeyp: ret + + endp + + + +Diarykeyn proc near + + cmp commandtype,213 + jz alreadykeyn + mov commandtype,213 + mov al,23 + call commandonly +alreadykeyn: cmp mousebutton,0 + jz notkeyn + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyn + cmp presscount,0 + jnz notkeyn + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"N" + inc diarypage + cmp diarypage,12 + jnz notkeyn + mov diarypage,0 +notkeyn: ret + + endp + + + + + + +Showdiarypage proc near + + mov al,0 + mov ah,0 + mov di,diaryx + mov bx,diaryy + mov ds,tempgraphics + call showframe + + mov al,diarypage + call findtext1 + + mov kerning,1 + call usetempcharset + mov di,diaryx+48 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + mov charshift,91+91 + call printdirect + + mov di,diaryx+129 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + call printdirect + + mov di,diaryx+48 + mov bx,diaryy+23 + mov dl,240 + mov ah,16 + call printdirect + + mov kerning,0 + mov charshift,0 + call usecharset1 + ret + + endp + + + + + +Findtext1 proc near + + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/look.asm b/devtools/tasmrecover/dreamweb/look.asm new file mode 100644 index 0000000000..b5bc913a73 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/look.asm @@ -0,0 +1,167 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------------------Look-routine---- + +Autolook proc near + + mov ax,mousex + cmp ax,oldx + jnz diffmouse + mov ax,mousey + cmp ax,oldy + jnz diffmouse + + dec lookcounter + cmp lookcounter,0 + jnz noautolook + cmp watchingtime,0 + jnz noautolook + call dolook +noautolook: ret + +diffmouse: mov lookcounter,1000 + ret + + endp + + + + +Look proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + + cmp commandtype,241 + jz alreadylook + mov commandtype,241 + mov al,25 + call commandonly +alreadylook: cmp mousebutton,1 + jnz nolook + mov ax,mousebutton + cmp ax,oldbutton + jz nolook + call dolook +nolook: ret + + endp + + + + + +Dolook proc near + + call createpanel + call showicon + call undertextline + call worktoscreenm + + mov commandtype,255 + call dumptextline + + mov bl,roomnum + and bl,31 + mov bh,0 + add bx,bx + + mov es,roomdesc + add bx,intextdat + + mov si,[es:bx] + add si,intext + + call findnextcolon + + mov di,66 + cmp reallocation,50 + jc notdream3 + mov di,40 +notdream3: mov bx,80 + mov dl,241 + call printslow + + cmp al,1 + jz afterlook + mov cx,400 + call hangonp + +afterlook: mov pointermode,0 + mov commandtype,0 + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Redrawmainscrn proc near + + mov timecount,0 + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + call readmouse + mov commandtype,255 + ret + + endp + + + + + + + + + + + + + + + +Getback1 proc near + + cmp pickup,0 + jz notgotobject + call blank + ret + +notgotobject: cmp commandtype,202 + jz alreadyget + mov commandtype,202 + mov al,26 + call commandonly +alreadyget: mov ax,mousebutton + cmp ax,oldbutton + jz nogetback + and ax,1 + jnz dogetback +nogetback: ret + +dogetback: mov getback,1 + mov pickup,0 + ret + + endp + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm new file mode 100644 index 0000000000..7cc1a5a4dd --- /dev/null +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -0,0 +1,1496 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Usemon proc near + + mov lasttrigger,0 + + push cs ;start off with no file name + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + mov al,32 + rep stosb + push cs ;start off with no file name + pop es + mov di,offset cs:operand1+1 + mov cx,12 + mov al,32 + rep stosb + + push cs ;clear all keys + pop es + mov di,offset cs:keys + mov byte ptr [es:di],1 + add di,26 + mov cx,3 +keyloop: mov byte ptr [es:di],0 + add di,26 + loop keyloop + + call createpanel + call showpanel + call showicon + call drawfloor + call getridofall ;reels + + mov dx,offset cs:mongraphicname + call loadintotemp + call loadpersonal + call loadnews + call loadcart + mov dx,offset cs:characterset2 + call loadtempcharset + + call printoutermon + call initialmoncols + call printlogo + call worktoscreen + call turnonpower + call fadeupyellows + call fadeupmonfirst + + mov monadx,76 + mov monady,141 + mov al,1 + call monmessage + mov cx,120 + call hangoncurs + mov al,2 + call monmessage + mov cx,60 + call randomaccess + mov al,3 + call monmessage + mov cx,100 + call hangoncurs + call printlogo + call scrollmonitor + mov bufferin,0 + mov bufferout,0 + +moreinput: mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + call execcommand + cmp al,0 + jz moreinput + +endmon: call getridoftemp + call getridoftempcharset + mov es,textfile1 + call deallocatemem + mov es,textfile2 + call deallocatemem + mov es,textfile3 + call deallocatemem + mov getback,1 + mov al,26 + call playchannel1 + mov manisoffscreen,0 + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Printoutermon proc near + + mov di,40 + mov bx,32 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,264 + mov bx,32 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + mov di,40 + mov bx,12 + mov ds,tempgraphics + mov al,3 + mov ah,0 + call showframe + mov di,40 + mov bx,164 + mov ds,tempgraphics + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Loadpersonal proc near + + mov al,location + mov dx,offset cs:monitorfile1 + cmp al,0 + jz foundpersonal + cmp al,42 + jz foundpersonal + mov dx,offset cs:monitorfile2 + cmp al,2 + jz foundpersonal + +foundpersonal: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile1,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + +Loadnews proc near ;textfile2 holds information + ;accessable by anyone + mov al,newsitem + mov dx,offset cs:monitorfile10 + cmp al,0 + jz foundnews + mov dx,offset cs:monitorfile11 + cmp al,1 + jz foundnews + mov dx,offset cs:monitorfile12 + cmp al,2 + jz foundnews + mov dx,offset cs:monitorfile13 +foundnews: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile2,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Loadcart proc near + + call lookininterface + + mov dx,offset cs:monitorfile20 + cmp al,0 + jz gotcart + mov dx,offset cs:monitorfile21 + cmp al,1 + jz gotcart + mov dx,offset cs:monitorfile22 + cmp al,2 + jz gotcart + mov dx,offset cs:monitorfile23 + cmp al,3 + jz gotcart + mov dx,offset cs:monitorfile24 +gotcart: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile3,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Lookininterface proc near + + mov al,"I" + mov ah,"N" + mov cl,"T" + mov ch,"F" + call findsetobject ;this bit searches set obs + ;until the interface is found + ;al holds object number + mov ah,1 ;ah holds type, 1=set object + call checkinside ;this searches for any extra + ;object inside the interface.. + cmp cl,numexobjects + jz emptyinterface + mov al,[es:bx+15] ;get the last letter of ID code + inc al + ret +emptyinterface: mov al,0 + ret + + endp + + + + + + + +Turnonpower proc near + + mov cx,3 +powerloop: push cx + call powerlighton + mov cx,30 + call hangon + call powerlightoff + mov cx,30 + call hangon + pop cx + loop powerloop + call powerlighton + ret + + endp + + + + + +Randomaccess proc near + +accessloop: push cx + call vsync + call vsync + call randomnum1 + and al,15 + cmp al,10 + jc off + call accesslighton + jmp chosenaccess +off: call accesslightoff +chosenaccess: pop cx + loop accessloop + call accesslightoff + ret + + endp + + + +Powerlighton proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,6 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Powerlightoff proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,5 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslighton proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,8 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslightoff proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,7 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + +Locklighton proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,10 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Locklightoff proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,9 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + + + + + + +Input proc near + + push cs + pop es + mov di,offset cs:inputline + mov cx,64 + mov al,0 + rep stosb + + mov curpos,0 + mov al,">" + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + mov di,monadx + mov bx,monady + mov cl,6 + mov ch,8 + call multidump + add monadx,6 + mov ax,monadx + mov curslocx,ax + mov ax,monady + mov curslocy,ax + +waitkey: call printcurs + call vsync + call delcurs + call readkey + mov al,currentkey + cmp al,0 + jz waitkey + cmp al,13 + jz endofinput + cmp al,8 + jnz notdel + cmp curpos,0 + jz waitkey + call delchar + jmp waitkey +notdel: cmp curpos,28 + jz waitkey + cmp currentkey,32 + jnz notleadingspace + cmp curpos,0 + jz waitkey +notleadingspace: call makecaps + push cs + pop es + mov si,curpos + add si,si + add si,offset cs:inputline + mov [es:si],al + + cmp al,"Z"+1 + jnc waitkey + + push ax es si + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiget + pop si es ax + + push es si + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + pop si es + ;dec cx + mov [es:si+1],cl + mov ch,0 + add monadx,cx + inc curpos + add curslocx,cx + jmp waitkey + +endofinput: ret + + endp + + + + + + + + +Makecaps proc near + + cmp al,"a" + jc notupperc + sub al,32 +notupperc: ret + + endp + + + + + + + + + +Delchar proc near + + dec curpos + mov si,curpos + add si,si + push cs + pop es + add si,offset cs:inputline + mov byte ptr [es:si],0 + mov al,[es:si+1] + mov ah,0 + sub monadx,ax + sub curslocx,ax + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiput + mov di,monadx + mov bx,monady + mov cl,al + mov ch,8 + call multidump + ret + + endp + + + + + + + +Execcommand proc near + + push cs + pop es + mov bx,offset cs:comlist + push cs + pop ds + mov si,offset cs:inputline + mov al,[si] + cmp al,0 + jnz notblankinp + call scrollmonitor + ret + +notblankinp: mov cl,0 +comloop: push bx si +comloop2: mov al,[si] + add si,2 + mov ah,[es:bx] + inc bx + cmp ah,32 + jz foundcom + cmp al,ah + jz comloop2 + pop si bx + add bx,10 + inc cl + cmp cl,6 + jnz comloop + call neterror + mov al,0 + ret +foundcom: pop si bx + cmp cl,1 + jz testcom + cmp cl,2 + jz directory + cmp cl,3 + jz accesscom + cmp cl,4 + jz signoncom + cmp cl,5 + jz keyscom + jmp quitcom + +directory: call dircom + mov al,0 + ret + +signoncom: call signon + mov al,0 + ret + +accesscom: call read + mov al,0 + ret + +keyscom: call showkeys + mov al,0 + ret + +testcom: mov al,6 + call monmessage + mov al,0 + ret + +quitcom: mov al,1 + ret + +comlist: db "EXIT " + db "HELP " + db "LIST " + db "READ " + db "LOGON " + db "KEYS " + +keys: db 1,0,"PUBLIC PUBLIC ",0 + db 0,0,"BLACKDRAGON RYAN ",0 + db 0,0,"HENDRIX LOUIS ",0 + db 0,0,"SEPTIMUS BECKETT ",0 + db 255,255 + +operand1: db " ",0 +rootdir: db 34,"ROOT ",0 +currentfile db 34," ",0 + + endp + + + + + + + +Neterror proc near + + mov al,5 + call monmessage + call scrollmonitor + ret + + endp + + + + + + + + + +Dircom proc near + + mov cx,30 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jz dirroot + call dirfile + ret + +dirroot: mov logonum,0 + push cs + pop ds + mov si,offset cs:rootdir + inc si + push cs + pop es + mov di,offset cs:currentfile + inc di + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + + mov al,9 + call monmessage + + mov es,textfile1 + call searchforfiles + mov es,textfile2 + call searchforfiles + mov es,textfile3 + call searchforfiles + + call scrollmonitor + ret + + endp + + + + + + +Searchforfiles proc near + + mov bx,textstart +directloop1: mov al,[es:bx] + inc bx + cmp al,"*" + jz endofdir + cmp al,34 + jnz directloop1 + call monprint + jmp directloop1 +endofdir: ret + + endp + + + + + + + + + + + + +Signon proc near + + call parser + inc di + push cs + pop ds + mov si,offset cs:keys + mov cx,4 +signonloop: push cx si di + add si,14 + mov cx,11 +signonloop2: lodsb + cmp al,32 + jz foundsign + call makecaps + mov ah,[es:di] + inc di + cmp al,ah + jnz nomatch + loop signonloop2 +nomatch: pop di si cx + add si,26 + loop signonloop + mov al,13 + call monmessage + ret + +foundsign: pop di si cx ;ds:si contains ad of key matched + mov bx,si + push ds + pop es ;now ds:si is in es:bx + + cmp byte ptr [es:bx],0 + jz notyetassigned + + mov al,17 + call monmessage + ret + +notyetassigned: push es bx + call scrollmonitor + mov al,15 + call monmessage + mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + pop bx es + push es bx + + add bx,2 + push cs + pop ds + mov si,offset cs:inputline +checkpass: lodsw + mov ah,[es:bx] + inc bx + ;cmp al,0 + cmp ah,32 + jz passpassed + cmp al,ah + jz checkpass +passerror: pop bx es + call scrollmonitor + mov al,16 + call monmessage + ret + +passpassed: mov al,14 + call monmessage + pop bx es + push es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov byte ptr [es:bx],1 + ret + + endp + + + + + + + +Showkeys proc near + + mov cx,10 + call randomaccess + call scrollmonitor + mov al,18 + call monmessage + + push cs + pop es + mov bx,offset cs:keys + mov cx,4 +keysloop: push cx bx + cmp byte ptr [es:bx],0 + jz notheld + add bx,14 + call monprint +notheld: pop bx cx + add bx,26 + loop keysloop + call scrollmonitor + ret + + endp + + + + + + + + + + + +Read proc near + + mov cx,40 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jnz okcom + call neterror + ret +okcom: push cs + pop es + mov di,offset cs:currentfile + mov ax,textfile1 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile2 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile3 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov al,7 + call monmessage + ret +foundfile2: call getkeyandlogo + cmp al,0 + jz keyok1 + ret +keyok1: push cs + pop es + mov di,offset cs:operand1 + mov ds,monsource + call searchforstring + cmp al,0 + jz findtopictext + mov al,oldlogonum + mov logonum,al + mov al,11 + call monmessage + ret + +findtopictext: inc bx + push es bx + call monitorlogo + call scrollmonitor + pop bx es +moretopic: call monprint + mov al,[es:bx] + cmp al,34 + jz endoftopic + cmp al,"=" + jz endoftopic + cmp al,"*" + jz endoftopic + push es bx + call processtrigger + mov cx,24 + call randomaccess + pop bx es + jmp moretopic + +endoftopic: call scrollmonitor + ret + + endp + + + + + + + + + +Dirfile proc near + + mov al,34 + mov [es:di],al + push es di ;save start point held in es:di + mov ds,textfile1 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile2 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile3 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + + pop di es + mov al,7 + call monmessage + ret + +foundfile: pop ax ax ;discard old values of es:di + call getkeyandlogo + cmp al,0 + jz keyok2 + ret + +keyok2: push es bx + push cs + pop ds + mov si,offset cs:operand1+1 + push cs + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + mov al,10 + call monmessage + pop bx es + + +directloop2: mov al,[es:bx] + inc bx + cmp al,34 + jz endofdir2 + cmp al,"*" + jz endofdir2 + cmp al,"=" + jnz directloop2 + call monprint + jmp directloop2 + +endofdir2: call scrollmonitor + ret + + endp + + + + + + +Getkeyandlogo proc near + + inc bx + mov al,[es:bx] + sub al,48 + mov newlogonum,al + add bx,2 + mov al,[es:bx] + sub al,48 + mov keynum,al + inc bx + push es bx + mov al,keynum + mov ah,0 + mov cx,26 + mul cx + push cs + pop es + mov bx,offset cs:keys + add bx,ax + mov al,[es:bx] + cmp al,1 + jz keyok + push bx es + mov al,12 + call monmessage + pop es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov al,1 + ret + +keyok: pop bx es + mov al,newlogonum + mov logonum,al + mov al,0 + ret + + endp + + + + + + + + + +Searchforstring proc near ;finds string at es:di in + ;text at ds:si + + mov dl,[es:di] ;needs to know first character + ;if it's an equals then we must + ;stop at the next quotation mark + mov cx,di ;need to remember starting point + +restartlook: mov di,cx + mov bx,si + + mov dh,0 ;dh holds count of brackets + ;brackets are either " or = +keeplooking: lodsb + call makecaps + cmp al,"*" + jz notfound + cmp dl,"=" + jnz nofindingtopic ;are we looking for a topic? + cmp al,34 ;if YES, check we haven't reached + jz notfound ;the end of this file. +nofindingtopic: mov ah,[es:di] + cmp al,dl ;all searches bracketed by same thing + jnz notbracket + inc dh + cmp dh,2 + jz complete +notbracket: cmp al,ah + jnz restartlook + inc di + jmp keeplooking +complete: push ds ;es:bx returns found string + pop es + mov al,0 + mov bx,si + ret +notfound: mov al,1 + ret + + endp + + + + + + +Parser proc near + + push cs + pop es + mov di,offset cs:operand1 + mov cx,13 + mov al,0 + rep stosb + + mov di,offset cs:operand1 + mov al,"=" + stosb + + push cs + pop ds + mov si,offset cs:inputline + +notspace1: lodsw + cmp al,32 + jz stillspace1 + cmp al,0 + jnz notspace1 + jmp finishpars + +stillspace1: lodsw + cmp al,32 + jz stillspace1 + +copyin1: stosb + lodsw + cmp al,0 + jz finishpars + cmp al,32 + jnz copyin1 + +finishpars: mov di,offset cs:operand1 + ret + + endp + + + + + + +Scrollmonitor proc near + + push ax bx cx dx di si es ds + + call printlogo + mov di,monadx + mov bx,monady + call printundermon + mov ax,monady + call worktoscreen + mov al,25 + call playchannel1 + + pop ds es si di dx cx bx ax + ret + + endp + + + + + + + + + + + + + + +Lockmon proc near + + cmp lasthardkey,57 + jnz notlock + call locklighton +lockloop: cmp lasthardkey,57 + jz lockloop + call locklightoff +notlock: ret + + endp + + + + + +Monitorlogo proc near + + mov al,logonum + cmp al,oldlogonum + jz notnewlogo + mov oldlogonum,al + ;call fadedownmon + call printlogo + call printundermon + call worktoscreen + call printlogo + ;call fadeupmon + call printlogo + mov al,26 + call playchannel1 + mov cx,20 + call randomaccess + ret +notnewlogo: call printlogo + ret + + endp + + + + + + + + +Printlogo proc near + + mov di,56 + mov bx,32 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + call showcurrentfile + ret + + endp + + + + + + +Showcurrentfile proc near + + mov di,178 ;99 + mov bx,37 + mov si,offset cs:currentfile+1 +curfileloop: mov al,[cs:si] + cmp al,0 + jz finishfile + inc si + push si + if foreign + call modifychar + endif + mov ds,tempcharset + mov ah,0 + call printchar + pop si + jmp curfileloop +finishfile: ret + + endp + + + + + + + + + +Monmessage proc near + + mov es,textfile1 + mov bx,textstart + mov cl,al + mov ch,0 +monmessageloop: mov al,[es:bx] + inc bx + cmp al,"+" + jnz monmessageloop + loop monmessageloop + call monprint + ret + + endp + + + + + + +Processtrigger proc near + + cmp lasttrigger,"1" + jnz notfirsttrigger + mov al,8 + call setlocation + mov al,45 + call triggermessage + ret + +notfirsttrigger: cmp lasttrigger,"2" + jnz notsecondtrigger + mov al,9 + call setlocation + mov al,55 + call triggermessage + ret + +notsecondtrigger: cmp lasttrigger,"3" + jnz notthirdtrigger + mov al,2 + call setlocation + mov al,59 + call triggermessage + +notthirdtrigger: ret + + endp + + + + +Triggermessage proc near + + push ax + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiget + pop ax + call findpuztext + mov di,174 + mov bx,156 + mov dl,141 + mov ah,16 + call printdirect + mov cx,140 + call hangon + call worktoscreen + mov cx,340 + call hangon + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiput + call worktoscreen + mov lasttrigger,0 + ret + + endp + + + + + + +Printcurs proc near + + push si di ds dx bx es + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + mov ds,buffers + mov si,textunder + push di bx + call multiget + pop bx di + + push bx di + inc maintimer + mov ax,maintimer + and al,16 + jnz flashcurs + mov al,"/" + sub al,32 + mov ah,0 + mov ds,tempcharset + call showframe + +flashcurs: pop di bx + sub di,6 + mov cl,12 + if foreign + mov ch,11 + else + mov ch,8 + endif + call multidump + + pop es bx dx ds di si + ret + + endp + + + + + + +Delcurs proc near + + push es bx di ds dx si + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + push di bx cx + mov ds,buffers + mov si,textunder + call multiput + pop cx bx di + call multidump +finishcurdel: + pop si dx ds di bx es + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm new file mode 100644 index 0000000000..cac6e100a7 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -0,0 +1,581 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;----------------------------------------------------Choosing a new location---- + +Newplace proc near + + cmp needtotravel,1 + jz istravel + cmp autolocation,-1 + jnz isautoloc + ret + +isautoloc: mov al,autolocation + mov newlocation,al + mov autolocation,-1 + ret + +istravel: mov needtotravel,0 + call selectlocation + ret + + endp + + + + +Selectlocation proc near + + mov inmaparea,0 + call clearbeforeload + mov getback,0 + mov pointerframe,22 + + call readcitypic + call showcity + call getridoftemp + call readdesticon + call loadtraveltext + call showpanel + call showman + call showarrows + call showexit + call locationpic + call undertextline + mov commandtype,255 + call readmouse + mov pointerframe,0 + call showpointer + call worktoscreen + mov al,9 + mov ah,255 + call playchannel0 + mov newlocation,255 + +select: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + cmp getback,1 + jz quittravel + mov bx,offset cs:destlist + call checkcoords + cmp newlocation,255 + jz select + mov al,newlocation + cmp al,location + jz quittravel + + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +quittravel: mov al,reallocation ; was just location + mov newlocation,al + mov getback,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +destlist: dw 238,258,4,44,nextdest + dw 104,124,4,44,lastdest + dw 280,308,4,44,lookatplace + dw 104,216,138,192,destselect + dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Showcity proc near + + call clearwork + mov ds,tempgraphics + mov di,57 + mov bx,32 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,120+57 + mov bx,32 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + +Lookatplace proc near + + cmp commandtype,224 + jz alreadyinfo + mov commandtype,224 + mov al,27 + call commandonly +alreadyinfo: mov ax,mousebutton + and ax,1 + jz noinfo + cmp ax,oldbutton + jz noinfo + + mov bl,destpos + cmp bl,15 + jnc noinfo + + push bx + call delpointer + call deltextline + call getundercentre + mov ds,tempgraphics3 + mov al,0 + mov ah,0 + mov di,60 + mov bx,72 + call showframe + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55 + call showframe + if foreign + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55+21 + call showframe + endif + pop bx + + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + call findnextcolon + + mov di,63 + if foreign + mov bx,84+4 + else + mov bx,84 + endif + mov dl,191 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,500 + call hangonp + +afterinfo: mov pointermode,0 + mov pointerframe,0 + call putundercentre + call worktoscreenm + +noinfo: ret + + endp + + + + +Getundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiget + ret + + endp + + + + + + + + + + +Putundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiput + ret + + endp + + + + + + + +Locationpic proc near + + call getdestinfo + mov al,[es:si] + push es si + mov di,0 + cmp al,6 + jnc secondlot + mov ds,tempgraphics + add al,4 + jmp gotgraphic +secondlot: sub al,6 + mov ds,tempgraphics2 +gotgraphic: add di,104 + mov bx,138+14 + mov ah,0 + call showframe + pop si es + mov al,destpos + cmp al,reallocation + jnz notinthisone + mov al,3 + mov di,104 + mov bx,140+14 + mov ds,tempgraphics + mov ah,0 + call showframe +notinthisone: mov bl,destpos + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + mov di,50 + mov bx,20 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + +Getdestinfo proc near + + mov al,destpos + mov ah,0 + push ax + mov dx,seg roomscango + mov es,dx + mov si,offset es:roomscango + add si,ax + mov cl,[es:si] + pop ax + push cx + mov dx,seg roompics + mov es,dx + mov si,offset es:roompics + add si,ax + pop ax + ret + + endp + + + + + + +Showarrows proc near + + mov di,116-12 + mov bx,16 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + mov di,226+12 + mov bx,16 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,280 + mov bx,14 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Nextdest proc near + +duok: cmp commandtype,218 + jz alreadydu + mov commandtype,218 + mov al,28 + call commandonly +alreadydu: mov ax,mousebutton + and ax,1 + jz nodu + cmp ax,oldbutton + jz nodu + +searchdestup: inc destpos + cmp destpos,15 + jnz notlastdest + mov destpos,0 +notlastdest: call getdestinfo + cmp al,0 + jz searchdestup + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodu: ret + + endp + + + + + + + +Lastdest proc near + +ddok: cmp commandtype,219 + jz alreadydd + mov commandtype,219 + mov al,29 + call commandonly +alreadydd: mov ax,mousebutton + and ax,1 + jz nodd + cmp ax,oldbutton + jz nodd + +searchdestdown: dec destpos + cmp destpos,-1 + jnz notfirstdest + mov destpos,15 +notfirstdest: call getdestinfo + cmp al,0 + jz searchdestdown + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodd: ret + + endp + + + + + + + + +Destselect proc near + + cmp commandtype,222 + jz alreadytrav + mov commandtype,222 + mov al,30 + call commandonly +alreadytrav: mov ax,mousebutton + and ax,1 + jz notrav + cmp ax,oldbutton + jz notrav + + call getdestinfo + mov al,destpos + mov newlocation,al +notrav: ret + + endp + + + + + + + + + + + + + + + + + + + +Getlocation proc near + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov al,[es:bx] + ret + + endp + + +Setlocation proc near ;makes a location accessable + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],1 + ret + + endp + + + + +Resetlocation proc near ;makes a location inaccessable + + push ax + cmp al,5 + jnz notdelhotel + call purgealocation + mov al,21 + call purgealocation + mov al,22 + call purgealocation + mov al,27 + call purgealocation + jmp clearedlocations + +notdelhotel: cmp al,8 + jnz notdeltvstud + call purgealocation + mov al,28 + call purgealocation + jmp clearedlocations + +notdeltvstud: cmp al,6 + jnz notdelsarters + call purgealocation + mov al,20 + call purgealocation + mov al,25 + call purgealocation + jmp clearedlocations + +notdelsarters: cmp al,13 + jnz notdelboathouse + call purgealocation + mov al,29 + call purgealocation + jmp clearedlocations + +notdelboathouse: + +clearedlocations: pop ax + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],0 + ret + + endp + + + + +Readdesticon proc near + + mov dx,offset cs:travelgraphic1 + call loadintotemp + + mov dx,offset cs:travelgraphic2 + call loadintotemp2 + + mov dx,offset cs:icongraphics8 + call loadintotemp3 + ret + + endp + + + + +Readcitypic proc near + + mov dx,offset cs:cityname + call loadintotemp + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm new file mode 100644 index 0000000000..93710d3c23 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -0,0 +1,2608 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------------Inventory printer---- + +Fillryan proc near + ; cx=what to search for + mov es,buffers + mov di,ryaninvlist + call findallryan + mov si,ryaninvlist + mov al,ryanpage + mov ah,0 + mov cx,20 + mul cx + add si,ax + + mov di,inventx + mov bx,inventy + + mov cx,2 +ryanloop2: push cx di bx + mov cx,5 +ryanloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + call obtoinv + pop es si + pop bx di cx + add di,itempicsize + loop ryanloop1 + pop bx di cx + add bx,itempicsize + loop ryanloop2 + + call showryanpage + ret + + endp + + + + + + + + + + + +Fillopen proc near + + call deltextline + + call getopenedsize ;find out how many slots + cmp ah,4 ;ah=slots, al=size holdable + jc lessthanapage + mov ah,4 +lessthanapage: mov al,1 + + push ax + mov es,buffers + mov di,openinvlist + call findallopen + mov si,openinvlist + mov di,inventx + mov bx,inventy+96 + pop cx + +openloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + cmp ch,cl + jc nextopenslot + call obtoinv +nextopenslot: pop es si + pop bx di cx + add di,itempicsize + inc cl + cmp cl,5 + jnz openloop1 + + call undertextline + ret + + endp + + + + + + + + + + + + + + + + +Findallryan proc near + + push di + mov cx,30 + mov ax,0ffffh + rep stosw + pop di + + mov cl,4 + mov ds,extras + mov bx,exdata + mov ch,0 +findryanloop: cmp [bx+2],cl + jnz notinryaninv + cmp byte ptr [bx+3],255 + jnz notinryaninv + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 ;means it is an exchanged object ie:not free or set + stosw + pop di +notinryaninv: add bx,16 + inc ch + cmp ch,numexobjects + jnz findryanloop + ret + + endp + + + + + + + +Findallopen proc near + + push di + mov cx,16 + mov ax,0ffffh + rep stosw + pop di + + mov cl,openedob + mov dl,openedtype + mov ds,extras + mov bx,exdata + mov ch,0 +findopen1: cmp [bx+3],cl + jnz findopen2 + cmp [bx+2],dl + jnz findopen2 + cmp openedtype,4 + jz noloccheck + mov al,[bx+5] + cmp al,reallocation + jnz findopen2 +noloccheck: mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 + stosw + pop di +findopen2: add bx,16 + inc ch + cmp ch,numexobjects + jnz findopen1 + + mov cl,openedob + mov dl,openedtype + push dx + mov ds,freedat + pop dx + mov bx,0 + mov ch,0 +findopen1a: cmp [bx+3],cl + jnz findopen2a + cmp [bx+2],dl + jnz findopen2a + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,2 ; means it's in a free ob + stosw + pop di +findopen2a: add bx,16 + inc ch + cmp ch,80 + jnz findopen1a + ret + + endp + + + + + + +Obtoinv proc near + + push bx es si ax + + push ax di bx + mov ds,icons1 + sub di,2 + sub bx,1 + mov al,10 + mov ah,0 + call showframe + pop bx di ax + cmp al,255 + jz finishfill + + push bx di ax + mov ds,extras + cmp ah,4 + jz isanextra + mov ds,freeframes +isanextra: mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + add bx,19 + add di,18 + call showframe + pop ax di bx + + push bx + call getanyaddir + call isitworn + pop bx + jnz finishfill + mov ds,icons1 ;Print wearing logo + sub di,3 + sub bx,2 + mov al,7 + mov ah,0 + call showframe + +finishfill: pop ax si es bx + ret + + endp + + + + + +Isitworn proc near ;zero if yes + + mov al,[es:bx+12] + cmp al,"W"-"A" + jnz notworn + mov al,[es:bx+13] + cmp al,"E"-"A" +notworn: ret + + endp + + + +Makeworn proc near + + mov byte ptr [es:bx+12],"W"-"A" + mov byte ptr [es:bx+13],"E"-"A" + ret + + endp + + + + + + +;-------------------------------------------------------Examining an object---- + +Examineob proc near + + mov pointermode,0 + mov timecount,0 + +examineagain: mov inmaparea,0 + mov examagain,0 + mov openedob,255 + mov openedtype,255 + mov invopen,0 + mov al,commandtype + mov objecttype,al + mov itemframe,0 + mov pointerframe,0 + + call createpanel + call showpanel + call showman + call showexit + call obicons + call obpicture + call describeob + call undertextline + + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + +waitexam: ;call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + + mov getback,0 + mov bx,offset cs:examlist + cmp invopen,0 + jz notuseinv + mov bx,offset cs:invlist1 + cmp invopen,1 + jz notuseinv + mov bx,offset cs:withlist1 +notuseinv: call checkcoords + cmp examagain,0 + jz norex + jmp examineagain +norex: cmp getback,0 + jz waitexam + + mov pickup,0 + cmp watchingtime,0 + jnz iswatching + cmp newlocation,255 + jnz justgetback + +iswatching: call makemainscreen + mov invopen,0 + mov openedob,255 + ret + +justgetback: mov invopen,0 + mov openedob,255 + ret + +examlist: dw 273,320,157,198,getbackfromob + dw 260,300,0,44,useobject + dw 210,254,0,44,selectopenob + dw 144,176,64,96,setpickup + dw 0,50,50,200,examinventory + dw 0,320,0,200,blank + dw 0ffffh + +invlist1: dw 273,320,157,198,getbackfromob + dw 255,294,0,24,dropobject + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx +openchangesize: dw inventx+(4*itempicsize) + dw inventy+100,inventy+100+itempicsize,useopened + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),intoinv + dw 0,320,0,200,blank + dw 0ffffh + +withlist1: dw 273,320,157,198,getbackfromob + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),selectob + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Makemainscreen proc near + + call createpanel + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov commandtype,255 + call animpointer + call worktoscreenm + mov commandtype,200 + mov manisoffscreen,0 + ret + + endp + + + + +Getbackfromob proc near + + cmp pickup,1 + jnz notheldob + call blank + ret +notheldob: call getback1 + ret + + endp + + + + + + + + + + + + + + + + +Incryanpage proc near + + cmp commandtype,222 + jz alreadyincryan + mov commandtype,222 + mov al,31 + call commandonly +alreadyincryan: mov ax,mousebutton + cmp ax,oldbutton + jz noincryan + and ax,1 + jnz doincryan +noincryan: ret + +doincryan: mov ax,mousex + sub ax,inventx+167 + mov ryanpage,-1 +findnewpage: inc ryanpage + sub ax,18 + jnc findnewpage + call delpointer + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Openinv proc near + + mov invopen,1 + mov al,61 + mov di,inventx + mov bx,inventy-10 + mov dl,240 + call printmessage + call fillryan + mov commandtype,255 + ret + + endp + + + + + + + +Showryanpage proc near + + mov ds,icons1 + mov di,inventx+167 + mov bx,inventy-12 + mov al,12 + mov ah,0 + call showframe + + mov al,13 + add al,ryanpage + push ax + mov al,ryanpage + mov ah,0 + mov cx,18 + mul cx + mov ds,icons1 + mov di,inventx+167 + add di,ax + mov bx,inventy-12 + pop ax + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Openob proc near + + mov al,openedob + mov ah,openedtype + mov di,offset cs:commandline + call copyname + + mov di,inventx + mov bx,inventy+86 + mov al,62 + mov dl,240 + call printmessage + + mov di,lastxpos + add di,5 + mov bx,inventy+86 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + call fillopen + call getopenedsize + mov al,ah + mov ah,0 + mov cx,itempicsize + mul cx + add ax,inventx + mov bx,offset cs:openchangesize + mov [cs:bx],ax + ret + + endp + + + + + + +Obicons proc near + + mov al,command + call getanyad + cmp al,255 + jz cantopenit + + mov ds,icons2 + mov di,210 + mov bx,1 + mov al,4 + mov ah,0 + call showframe + +cantopenit: mov ds,icons2 + mov di,260 + mov bx,1 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Examicon proc near + + mov ds,icons2 + mov di,254 + mov bx,5 + mov al,3 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Obpicture proc near + + mov al,command + mov ah,objecttype + cmp ah,1 + jz setframe + cmp ah,4 + jz exframe + + mov ds,freeframes + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + +setframe: ret + +exframe: mov ds,extras + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + + endp + + + + + + + + + + +Describeob proc near + + call getobtextstart + + mov di,33 + mov bx,92 + if foreign + cmp objecttype,1 + jnz notsetd + mov bx,82 +notsetd: endif + mov dl,241 + mov ah,16 + mov charshift,91+91 + call printdirect + mov charshift,0 + mov di,36 + mov bx,104 + if foreign + cmp objecttype,1 + jnz notsetd2 + mov bx,94 +notsetd2: endif + mov dl,241 + mov ah,0 + call printdirect + push bx + call obsthatdothings + pop bx + call additionaltext + ret + + + endp + + + + + +Additionaltext proc near + + add bx,10 + push bx + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz emptycup + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz fullcup + pop bx + ret +emptycup: mov al,40 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret +fullcup: mov al,39 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + + + +Obsthatdothings proc near + + mov al,command + mov ah,objecttype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jnz notlouiscard + mov al,4 + call getlocation + cmp al,1 + jz seencard + mov al,4 + call setlocation + call lookatcard +seencard: ret +notlouiscard: ret + + endp + + + + + + + +Getobtextstart proc near + + mov es,freedesc + mov si,freetextdat + mov cx,freetext + cmp objecttype,2 + jz describe + mov es,setdesc + mov si,settextdat + mov cx,settext + cmp objecttype,1 + jz describe + mov es,extras + mov si,extextdat + mov cx,extext + +describe: mov al,command + mov ah,0 + add ax,ax + add si,ax + mov ax,[es:si] + add ax,cx + mov si,ax + mov bx,ax +tryagain: push si + call findnextcolon + mov al,[es:si] + mov cx,si + pop si + cmp objecttype,1 + jnz cantmakeoneup + cmp al,0 + jz findsometext + cmp al,":" + jz findsometext +cantmakeoneup: ret + +findsometext: call searchforsame + jmp tryagain + ret + + endp + + + + + + +Searchforsame proc near + + mov si,cx +searchagain: inc si + mov al,[es:bx] +search: cmp [es:si],al + jz gotstartletter + inc cx + inc si + cmp si,8000 ;arbitrary give-up + jc search ;counter. + mov si,bx + pop ax + ret + +gotstartletter: push bx si +keepchecking: inc si + inc bx + mov al,[es:bx] + mov ah,[es:si] + cmp al,":" + jz foundmatch + cmp al,0 + jz foundmatch + cmp al,ah + jz keepchecking + pop si bx + jmp searchagain + +foundmatch: pop si bx + ret + + endp + + + + + + + +;-----------------------------------------------------------Using an object---- + + + + + +Findnextcolon proc near + +isntcolon: mov al,[es:si] + inc si + cmp al,0 + jz endofcolon + cmp al,":" + jnz isntcolon +endofcolon: ret + + endp + + +;------------------------------------------------------Taking, dropping etc---- + + + + + + +Inventory proc near + + cmp mandead,1 + jz iswatchinv + cmp watchingtime,0 + jz notwatchinv +iswatchinv: call blank + ret +notwatchinv: cmp commandtype,239 + jz alreadyopinv + mov commandtype,239 + mov al,32 + call commandonly +alreadyopinv: mov ax,mousebutton + cmp ax,oldbutton + jz cantopinv + and ax,1 + jnz doopeninv +cantopinv: ret + +doopeninv: mov timecount,0 + mov pointermode,0 + mov inmaparea,0 + call animpointer + call createpanel + call showpanel + call examicon + call showman + call showexit + call undertextline + mov pickup,0 + mov invopen,2 + call openinv + call readmouse + call showpointer + call worktoscreen + call delpointer + mov openedob,255 + jmp waitexam ; very naughty! + + endp + + + + + + +Setpickup proc near + + cmp objecttype,1 + jz cantpick + cmp objecttype,3 + jz cantpick + call getanyad + mov al,[es:bx+2] + cmp al,4 + jnz canpick +cantpick: call blank + ret + +canpick: cmp commandtype,209 + jz alreadysp + mov commandtype,209 + + mov bl,command + mov bh,objecttype + mov al,33 + call commandwithob +alreadysp: mov ax,mousebutton + cmp ax,1 + jnz nosetpick + cmp ax,oldbutton + jnz dosetpick +nosetpick: ret + +dosetpick: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,1 + mov invopen,2 + cmp objecttype,4 + jz pickupexob + + mov al,command + mov itemframe,al + mov openedob,255 + call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + call openinv + call worktoscreenm + ret + +pickupexob: mov al,command + mov itemframe,al + mov openedob,255 + call openinv + call worktoscreenm + ret + + endp + + + + + +Examinventory proc near + + cmp commandtype,249 + jz alreadyexinv + mov commandtype,249 + mov al,32 + call commandonly +alreadyexinv: mov ax,mousebutton + and ax,1 + jnz doexinv + ret + +doexinv: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,0 + mov invopen,2 + call openinv + call worktoscreenm + ret + + endp + + + + + +Reexfrominv proc near + + call findinvpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + +Reexfromopen proc near + + ret + call findopenpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + + + + + + + + + + + + + +Swapwithinv proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub7 + cmp commandtype,243 + jz alreadyswap1 + mov commandtype,243 + +difsub7: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap1: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap1 + and ax,1 + jnz doswap1 +cantswap1: ret + +doswap1: mov ah,objecttype + mov al,itemframe + push ax + + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + mov bl,itemframe + mov bh,objecttype + + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findinvpos ;NONE OF THIS IS NEEDED + call delpointer ;ONLY EXTRAS CAN BE IN + mov al,itemframe + call geteitherad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Swapwithopen proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub8 + cmp commandtype,242 + jz alreadyswap2 + mov commandtype,242 + +difsub8: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap2: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap2 + and ax,1 + jnz doswap2 +cantswap2: ret + +doswap2: call geteitherad + call isitworn + jnz notwornswap + call wornerror + ret +notwornswap: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame2 + mov al,objecttype + cmp al,openedtype + jnz isntsame2 + call errormessage1 + ret + +isntsame2: call checkobjectsize + cmp al,0 + jz sizeok2 + ret + +sizeok2: mov ah,objecttype + mov al,itemframe + push ax + + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeswapex + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + jmp actuallyswap + +makeswapex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + +actuallyswap: mov bl,itemframe + mov bh,objecttype + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findopenpos + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillopen + call fillryan + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + +Intoinv proc near + + cmp pickup,0 + jnz notout + call outofinv + ret + +notout: call findinvpos + mov ax,[es:bx] + cmp al,255 + jz canplace1 + call swapwithinv + ret + +canplace1: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub1 + cmp commandtype,220 + jz alreadyplce + mov commandtype,220 + +difsub1: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplce: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo2 + and ax,1 + jnz doplace +notletgo2: ret + +doplace: call delpointer + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + mov pickup,0 + call fillryan + call readmouse + call showpointer + call outofinv + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Deletetaken proc near ;gets rid of objects that were + ;transfered to exlist ages ago + mov es,freedat + mov ah,reallocation + mov ds,extras + mov si,exdata + + mov cx,numexobjects +takenloop: mov al,[si+11] + cmp al,ah + jnz notinhere + mov bl,[si+1] + mov bh,0 + add bx,bx + add bx,bx + add bx,bx + add bx,bx + mov byte ptr [es:bx+2],254 ; was 255 + +notinhere: add si,16 + loop takenloop + + ret + + endp + + + + + + +Outofinv proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canpick2 + call blank + ret + +canpick2: mov bx,mousebutton + cmp bx,2 + jnz canpick2a + call reexfrominv + ret + +canpick2a: cmp ax,oldsubject + jnz difsub3 + cmp commandtype,221 + jz alreadygrab + mov commandtype,221 + +difsub3: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrab: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo + and ax,1 + jnz dograb +notletgo: ret + +dograb: call delpointer + mov pickup,1 + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call getexad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + call fillryan + call readmouse + call showpointer + call intoinv + call worktoscreen + call delpointer + ret + + endp + + + + + +Getfreead proc near + + mov ah,0 + mov cl,4 + shl ax,cl + mov bx,ax + mov es,freedat + ret + + endp + + + + + + + + +Getexad proc near + + mov ah,0 + mov bx,16 + mul bx + mov bx,ax + mov es,extras + add bx,exdata + ret + + endp + + + + + + +Geteitherad proc near + + cmp objecttype,4 + jz isinexlist + mov al,itemframe + call getfreead + ret +isinexlist: mov al,itemframe + call getexad + ret + + endp + + + + + + +Getanyad proc near ;nearly same as above + ;but uses command + cmp objecttype,4 + jz isex + cmp objecttype,2 + jz isfree + mov al,command + call getsetad + mov ax,[es:bx+4] + ret +isfree: mov al,command + call getfreead + mov ax,[es:bx+7] + ret +isex: mov al,command + call getexad + mov ax,[es:bx+7] + ret + + endp + + + +Getanyaddir proc near ;nearly same as above + ;but uses ax + cmp ah,4 + jz isex3 + cmp ah,2 + jz isfree3 + call getsetad + ret +isfree3: call getfreead + ret +isex3: call getexad + ret + + endp + + + + + + +Getopenedsize proc near ;nearly same as above again + ;but finds ad of opened ob + cmp openedtype,4 + jz isex2 + cmp openedtype,2 + jz isfree2 + mov al,openedob + call getsetad + mov ax,[es:bx+3] + ret +isfree2: mov al,openedob + call getfreead + mov ax,[es:bx+7] + ret +isex2: mov al,openedob + call getexad + mov ax,[es:bx+7] + ret + + endp + + + + + + + + +Getsetad proc near + + mov ah,0 + mov bx,64 + mul bx + mov bx,ax + mov es,setdat + ret + + endp + + + + + + +Findinvpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findinv1: inc bx + sub cx,itempicsize + jnc findinv1 + + mov cx,mousey + sub cx,inventy + sub bx,5 +findinv2: add bx,5 + sub cx,itempicsize + jnc findinv2 + + mov al,ryanpage + mov ah,0 + mov cx,10 + mul cx + add bx,ax + + mov al,bl + mov lastinvpos,al + add bx,bx + + mov es,buffers + add bx,ryaninvlist + ret + + endp + + + + + + + + + +Findopenpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findopenp1: inc bx + sub cx,itempicsize + jnc findopenp1 + + mov al,bl + mov lastinvpos,al + + add bx,bx + mov es,buffers + add bx,openinvlist + ret + + endp + + + + + + + + + + + + +;--------------------------------------------------------Dropping an object---- + +Dropobject proc near + + cmp commandtype,223 + jz alreadydrop + mov commandtype,223 + cmp pickup,0 + jz blank + + mov bl,itemframe + mov bh,objecttype + mov al,37 + call commandwithob +alreadydrop: mov ax,mousebutton + cmp ax,oldbutton + jz nodrop + and ax,1 + jnz dodrop +nodrop: ret + +dodrop: call geteitherad + call isitworn + jnz nowornerror + call wornerror + ret +nowornerror: cmp reallocation,47 + jz nodrop2 + mov cl,ryanx + add cl,12 + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc nodroperror +nodrop2: call droperror + ret +nodroperror: cmp mapxsize,64 + jnz notinlift + cmp mapysize,64 + jnz notinlift + call droperror + ret +notinlift: mov al,itemframe + mov ah,4 + mov cl,"G" + mov ch,"U" + mov dl,"N" + mov dh,"A" + call compare + jz cantdrop + mov al,itemframe + mov ah,4 + mov cl,"S" + mov ch,"H" + mov dl,"L" + mov dh,"D" + call compare + jz cantdrop + mov objecttype,4 + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],0 + mov al,ryanx + add al,4 + mov cl,4 + shr al,cl + add al,mapx + mov ah,ryany + add ah,8 + mov cl,4 + shr ah,cl + add ah,mapy + mov byte ptr [es:bx+3],al + mov byte ptr [es:bx+5],ah + mov al,ryanx + add al,4 + and al,15 + mov ah,ryany + add ah,8 + and ah,15 + mov byte ptr [es:bx+4],al + mov byte ptr [es:bx+6],ah + mov pickup,0 + mov al,reallocation + mov [es:bx],al + ret + + endp + + + + +Droperror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,56 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + +Cantdrop proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,24 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + +Wornerror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,57 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + + + + + + + +Removeobfrominv proc near + + cmp command,100 + jz obnotexist + call getanyad + mov di,bx + mov cl,command + mov ch,0 + call deleteexobject + ;mov byte ptr [es:bx+2],0 +obnotexist: ret + + endp + + + + +;---------------------------------------------------------Opening an object---- + +Selectopenob proc near + + mov al,command + call getanyad + cmp al,255 + jnz canopenit1 + call blank + ret + +canopenit1: cmp commandtype,224 + jz alreadyopob + mov commandtype,224 + + mov bl,command + mov bh,objecttype + mov al,38 + call commandwithob +alreadyopob: mov ax,mousebutton + cmp ax,oldbutton + jz noopenob + and ax,1 + jnz doopenob +noopenob: ret + +doopenob: mov al,command + mov openedob,al + mov al,objecttype + mov openedtype,al + + call createpanel + call showpanel + call showman + call examicon + call showexit + call openinv + call openob + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Useopened proc near + + cmp openedob,255 + jz cannotuseopen + cmp pickup,0 + jnz notout2 + call outofopen + ret + +notout2: call findopenpos + mov ax,[es:bx] + cmp al,255 + jz canplace3 + call swapwithopen +cannotuseopen: ret + +canplace3: cmp pickup,1 + jz intoopen + call blank + ret + +intoopen: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub2 + cmp commandtype,227 + jz alreadyplc2 + mov commandtype,227 + +difsub2: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplc2: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo3 + cmp ax,1 + jz doplace2 +notletgo3: ret + +doplace2: call geteitherad + call isitworn + jnz notworntoopen + call wornerror + ret +notworntoopen: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame + mov al,objecttype + cmp al,openedtype + jnz isntsame + call errormessage1 + ret + +isntsame: call checkobjectsize + cmp al,0 + jz sizeok1 + ret + +sizeok1: mov pickup,0 + mov al,itemframe + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + +Errormessage1 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,58 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Errormessage2 proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,59 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Errormessage3 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,60 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + +Checkobjectsize proc near + + call getopenedsize + push ax + mov al,itemframe + call geteitherad + mov al,[es:bx+9] + pop cx + + cmp al,255 ;gives a size of 6 if no + jnz notunsized ;size was defined in the editor + mov al,6 ;could be a bad idea +notunsized: + + + cmp al,100 + jnc specialcase + cmp cl,100 + jc isntspecial + call errormessage3 + jmp sizewrong +isntspecial: cmp cl,al + jnc sizeok +specialcase: sub al,100 + cmp cl,100 + jnc bothspecial + cmp cl,al + jnc sizeok + call errormessage2 + jmp sizewrong +bothspecial: sub cl,100 + cmp al,cl + jz sizeok + call errormessage3 +sizewrong: mov al,1 + ret +sizeok: mov al,0 + ret + + endp + + + + + + + + +Outofopen proc near + + cmp openedob,255 + jz cantuseopen + call findopenpos + mov ax,[es:bx] + cmp al,255 + jnz canpick4 +cantuseopen: call blank + ret + +canpick4: cmp ax,oldsubject + jnz difsub4 + cmp commandtype,228 + jz alreadygrb + mov commandtype,228 + +difsub4: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrb: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo4 + cmp ax,1 + jz dogrb + cmp ax,2 + jnz notletgo4 + call reexfromopen +notletgo4: ret + +dogrb: call delpointer + mov pickup,1 + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeintoex + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + jmp actuallyout + +makeintoex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + +actuallyout: call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + +;All Extra object code - adding and removing plus purge routines ------------- + + + + + + +Transfertoex proc near + + call emergencypurge + + call getexpos + mov al,expos + push ax + + push di + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov cx,8 + rep movsw + pop di + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemframe + mov [es:di+1],al + mov byte ptr [es:di+2],4 + mov byte ptr [es:di+3],255 + mov al,lastinvpos + mov [es:di+4],al + + mov al,itemframe + mov itemtotran,al + call transfermap + call transferinv + call transfertext + + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov byte ptr [si+2],254 ; was 255 + call pickupconts + + pop ax + ret + + endp + + + + + + + + + + + + + + +Pickupconts proc near + + mov al,[si+7] + cmp al,255 + jz notopenable + + mov al,itemframe + mov ah,objecttype + mov dl,expos + ;dec dl + mov es,freedat + mov bx,0 + mov cx,0 +pickupcontloop: push cx es bx dx ax + + cmp byte ptr [es:bx+2],ah + jnz notinsidethis + cmp byte ptr [es:bx+3],al + jnz notinsidethis + + mov itemtotran,cl + call transfercontoex + +notinsidethis: pop ax dx bx es cx + add bx,16 + inc cx + cmp cx,80 + jnz pickupcontloop + +notopenable: ret + + endp + + + + + + + +Transfercontoex proc near + + push es bx + + push dx es bx + call getexpos + pop si ds + + push di + mov cx,8 + rep movsw + pop di + pop dx + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemtotran + mov [es:di+1],al + mov [es:di+3],dl + mov byte ptr [es:di+2],4 + + call transfermap + call transferinv + call transfertext + ;inc expos + + pop si ds + mov byte ptr [si+2],255 + ret + + endp + + + + + + + + + + + + + + + + + + +Transfertext proc near + + mov es,extras + mov al,expos + mov ah,0 + add ax,ax + mov bx,extextdat + add bx,ax + mov di,extextpos + mov [es:bx],di + add di,extext + + mov al,itemtotran + mov ah,0 + add ax,ax + mov ds,freedesc + mov bx,freetextdat + add bx,ax + mov si,freetext + mov ax,[bx] + add si,ax + +moretext: lodsb + stosb + inc extextpos + cmp al,0 + jnz moretext + ret + + endp + + + + + + + + + + +Getexpos proc near + + + mov es,extras + mov al,0 + mov di,exdata +tryanotherex: cmp byte ptr [es:di+2],255 + jz foundnewex + add di,16 + inc al + cmp al,numexobjects + jnz tryanotherex +foundnewex: mov expos,al + ret + + endp + + + + + + + + + +Purgealocation proc near + + push ax + mov es,extras + mov di,exdata + pop bx + mov cx,0 +purgeloc: cmp bl,[es:di+0] + jnz dontpurge + cmp byte ptr [es:di+2],0 + jnz dontpurge + push di es bx cx + call deleteexobject + pop cx bx es di +dontpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz purgeloc + ret + + endp + + + + + +Emergencypurge proc near + +checkpurgeagain: mov ax,exframepos + add ax,4000 + cmp ax,exframeslen + jc notnearframeend + call purgeanitem + jmp checkpurgeagain +notnearframeend: mov ax,extextpos + add ax,400 + cmp ax,extextlen + jc notneartextend + call purgeanitem + jmp checkpurgeagain +notneartextend: ret + + endp + + + + + + +Purgeanitem proc near + + mov es,extras ;first time try and + mov di,exdata ;find an object in a + mov bl,reallocation ;location other than + mov cx,0 ;the one the player is +lookforpurge: mov al,[es:di+2] ;in + cmp al,0 + jnz cantpurge + cmp byte ptr [es:di+12],2 + jz iscup + cmp byte ptr [es:di+12],255 + jnz cantpurge +iscup: cmp byte ptr [es:di+11],bl + jz cantpurge + call deleteexobject + ret +cantpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge + + mov di,exdata + mov bl,reallocation + mov cx,0 +lookforpurge2: mov al,[es:di+2] + cmp al,0 + jnz cantpurge2 + cmp byte ptr [es:di+12],255 + jnz cantpurge2 + call deleteexobject + ret +cantpurge2: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge2 + ret + + endp + + + + + +Deleteexobject proc near ;es:di holds data ad + ;cx holds number + push cx cx cx cx + mov al,255 + mov cx,16 + rep stosb + pop ax + mov cl,al + add al,al + add al,cl + call deleteexframe + pop ax + mov cl,al + add al,al + add al,cl + inc al + call deleteexframe + pop ax + call deleteextext + + pop bx + mov bh,bl + mov bl,4 + mov di,exdata + mov cx,0 +deleteconts: cmp [es:di+2],bx + jnz notinsideex + push bx cx di + call deleteexobject ;Oooh missus! + pop di cx bx ;Recursive code! +notinsideex: add di,16 + inc cx + cmp cx,numexobjects + jnz deleteconts + ret + + endp + + + + + +Deleteexframe proc near ;al holds frame to delete + + mov di,exframedata + mov ah,0 + add ax,ax + add di,ax + add ax,ax + add di,ax + mov al,[es:di] + mov ah,0 + mov cl,[es:di+1] + mov ch,0 + mul cx ;ax holds size of this + ;frame in bytes + mov si,[es:di+2] + push si + add si,exframes + mov cx,exframeslen + sub cx,[es:di+2] + mov di,si ;di/si hold start of frame + add si,ax ;si holds end of frame + push ax + push es + pop ds + rep movsb + pop bx ;bx holds size now + sub exframepos,bx + pop si ;si holds start of frame + ;(offset only) + mov cx,numexobjects*3 + mov di,exframedata +shuffleadsdown: mov ax,[es:di+2] + cmp ax,si + jc beforethisone + sub ax,bx +beforethisone: mov [es:di+2],ax + add di,6 + loop shuffleadsdown + ret + + endp + + + + +Deleteextext proc near + + mov di,extextdat + mov ah,0 + add ax,ax + add di,ax + mov ax,[es:di] + mov si,ax + mov di,ax + add si,extext + add di,extext + mov ax,0 +findlenextext: mov cl,[es:si] + inc ax + inc si + cmp cl,0 + jnz findlenextext + + mov cx,extextlen + mov bx,si + sub bx,extext + push bx ax + sub cx,bx + rep movsb + pop bx + sub extextpos,bx + + pop si + mov cx,numexobjects + mov di,extextdat +shuffletextads: mov ax,[es:di] + cmp ax,si + jc beforethistext + sub ax,bx +beforethistext: mov [es:di],ax + add di,2 + loop shuffletextads + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm new file mode 100644 index 0000000000..a276db7298 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -0,0 +1,591 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Printchar proc near + + cmp al,255 + jz ignoreit + push si bx di + if foreign + sub bx,3 + endif + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + call showframe + pop ax di bx si + cmp kerning,0 + jnz nokern + call kernchars +nokern: push cx + mov ch,0 + add di,cx + pop cx + ;dec di +ignoreit: ret + + endp + + + + + + + + + + +Kernchars proc near + + ;sub al,13 + cmp al,"a" + jz iskern + cmp al,"u" + jz iskern + ret +iskern: cmp ah,"n" + jz kernit + cmp ah,"t" + jz kernit + cmp ah,"r" + jz kernit + cmp ah,"i" + jz kernit + cmp ah,"l" + jz kernit + ret +kernit: dec cl + ret + + endp + + + + + + +;------------------------------------------------Proportional text printing---- + + +;Memprint proc near +; +; call usecharset1 +; +; push ax bx cx dx es ds si di +; call deltextline +; pop di si ds es dx cx bx ax +; +; pop si +; push cs +; pop es +; inc si +; mov ds,currentset +; mov di,textaddressx +; mov bx,textaddressy +; mov dl,textlen +; mov al,0 +; mov ah,0 +; call printdirect +; push si + +; mov newtextline,1 +; ret + +; endp + + + + + + +;------------------------------------------------Proportional text printing---- + +;Print proc near +; +; pop si +; mov bx,[cs:si+2] +; mov di,[cs:si+0] +; mov dl,[cs:si+4] +; add si,6 +; mov ds,currentset +; +;printloop2: push bx di dx +; push es cs +; pop es +; call getnumber +; pop es +; mov ch,0 +;printloop1: mov ax,[cs:si] +; inc si +; cmp al,0 +; jz finishprint +; push cx es +; call modifychar +; call printchar +; pop es cx +; loop printloop1 +; pop dx di bx +; add bx,linespacing +; jmp printloop2 + +;finishprint: pop dx di bx + ; push si + ; ret + + ; endp + + + + + + + + + +Printslow proc near + + mov pointerframe,1 + mov pointermode,3 + mov ds,charset1 +printloopslow6: push bx di dx + call getnumber + + mov ch,0 +printloopslow5: push cx si es + mov ax,[es:si] + push bx cx es si ds + if foreign + call modifychar + endif + call printboth + pop ds si es cx bx + mov ax,[es:si+1] + inc si + cmp al,0 + jz finishslow + cmp al,":" + jz finishslow + cmp cl,1 + jz afterslow + push di ds bx cx es si + if foreign + call modifychar + endif + mov charshift,91 + call printboth + mov charshift,0 + pop si es cx bx ds di + call waitframes + cmp ax,0 + jz keepgoing + cmp ax,oldbutton + jnz finishslow2 +keepgoing: call waitframes +noslow: cmp ax,0 + jz afterslow + cmp ax,oldbutton + jnz finishslow2 ;used to finish early +afterslow: pop es si cx + inc si + loop printloopslow5 + + pop dx di bx + add bx,10 + jmp printloopslow6 + +finishslow: pop cx si es dx di bx + mov al,0 + ret + +finishslow2: pop cx si es dx di bx + mov al,1 + ret + + endp + + + +Waitframes proc near + + push di bx es si ds + call readmouse + call showpointer + call vsync + call dumppointer + call delpointer + mov ax,mousebutton + pop ds si es bx di + ret + + endp + + + + +Printboth proc near + + push ax cx bx + push di + call printchar + pop ax + push di + mov di,ax + call multidump + pop di + pop bx cx ax + ret + + endp + + + + + + +Printdirect proc near + + mov lastxpos,di + mov ds,currentset +printloop6: push bx di dx + call getnumber + mov ch,0 +printloop5: mov ax,[es:si] + inc si + cmp al,0 + jz finishdirct + cmp al,":" + jz finishdirct + push cx es + if foreign + call modifychar + endif + call printchar + mov lastxpos,di + pop es cx + loop printloop5 + pop dx di bx + add bx,linespacing + jmp printloop6 + +finishdirct: pop dx di bx + ret + + endp + + + + + + + + + + + + + + +Monprint proc near + + mov kerning,1 + mov si,bx + mov dl,166 + mov di,monadx + mov bx,monady + mov ds,tempcharset + +printloop8: push bx di dx + call getnumber + mov ch,0 +printloop7: mov al,[es:si] + inc si + + cmp al,":" + jz finishmon2 + cmp al,0 + jz finishmon + cmp al,34 + jz finishmon + cmp al,"=" + jz finishmon + cmp al,"%" + jnz nottrigger + mov ah,[es:si] + inc si + inc si + jmp finishmon +nottrigger: push cx es + if foreign + call modifychar + endif + call printchar + mov curslocx,di + mov curslocy,bx + mov maintimer,1 + call printcurs + + call vsync + push si dx ds es bx di + call lockmon + pop di bx es ds dx si + call delcurs + pop es cx + loop printloop7 + +finishmon2: pop dx di bx + call scrollmonitor + mov curslocx,di + jmp printloop8 + +finishmon: pop dx di bx + cmp al,"%" + jnz nottrigger2 + mov lasttrigger,ah +nottrigger2: mov curslocx,di + call scrollmonitor + mov bx,si + mov kerning,0 + ret + + endp + + + + + + + + + +Getnumber proc near + + mov cx,0 + push si bx di ds es + mov di,si + +wordloop: push cx dx + call getnextword + pop dx cx + cmp al,1 + jz endoftext + mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend + add cl,bl + add ch,bh + jmp wordloop + +gotoverend: mov al,dl + and al,1 + jz notcentre + push cx + mov al,dl + and al,11111110b + mov ah,0 + mov ch,0 + sub ax,cx + add ax,20 + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcentre: pop es ds di bx si + mov cl,ch + ret + + + +endoftext: mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend2 + add cl,bl + add ch,bh + +gotoverend2: mov al,dl + and al,1 + jz notcent2 + push cx + mov al,dl + and al,11111110b + add al,2 + mov ah,0 + mov ch,0 + add ax,20 + sub ax,cx + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcent2: pop es ds di bx si + mov cl,ch + ret + + endp + + + + + +Getnextword proc near + + mov bx,0 +getloop: mov ax,[es:di] + inc di + inc bh + cmp al,":" + jz endall + cmp al,0 + jz endall + cmp al,32 + jz endword + if foreign + call modifychar + endif + cmp al,255 + jz getloop + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cl,[si+0] + pop ax + call kernchars + add bl,cl + ;dec bl + jmp getloop + +endword: add bl,6 + mov al,0 + ret + +endall: add bl,6 + mov al,1 + ret + + endp + + + + + + if german + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,129 + jnz not129 + mov al,"Z"+3 + ret +not129: cmp al,132 + jnz not132 + mov al,"Z"+1 + ret +not132: cmp al,142 + jnz not142 + mov al,"Z"+4 + ret +not142: cmp al,154 + jnz not154 + mov al,"Z"+6 + ret +not154: cmp al,225 + jnz not225 + mov al,"A"-1 + ret +not225: cmp al,153 + jnz not153 + mov al,"Z"+5 + ret +not153: cmp al,148 + jnz not148 + mov al,"Z"+2 + ret +not148: ret + +nomod: ret + + endp + + endif + + + + + if spanish + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,160 + jnz not160 + mov al,"Z"+1 + ret +not160: cmp al,130 + jnz not130 + mov al,"Z"+2 + ret +not130: cmp al,161 + jnz not161 + mov al,"Z"+3 + ret +not161: cmp al,162 + jnz not162 + mov al,"Z"+4 + ret +not162: cmp al,163 + jnz not163 + mov al,"Z"+5 + ret +not163: cmp al,164 + jnz not164 + mov al,"Z"+6 + ret +not164: cmp al,165 + jnz not165 + mov al,","-1 + ret +not165: cmp al,168 + jnz not168 + mov al,"A"-1 + ret +not168: cmp al,173 + jnz not173 + mov al,"A"-4 + ret +not173: cmp al,129 + jnz not129 + mov al,"A"-5 +not129: ret + +nomod: ret + + endp + + endif + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm new file mode 100644 index 0000000000..e8fa018de8 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -0,0 +1,1489 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + +Zoomonoff proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,222 + jz alreadyonoff + mov commandtype,222 + mov al,39 + call commandonly +alreadyonoff: mov ax,mousebutton + cmp ax,oldbutton + jz nozoomonoff + and ax,1 + jnz dozoomonoff +nozoomonoff: ret + +dozoomonoff: mov al,zoomon + xor al,1 + mov zoomon,al + + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov al,39 + call commandonly + call readmouse + call worktoscreenm + ret + + endp + + + + + + + + + + + + +Saveload proc near + + if demo + call dosreturn + ret + else + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,253 + jz alreadyops + mov commandtype,253 + mov al,43 + call commandonly +alreadyops: mov ax,mousebutton + cmp ax,oldbutton + jz noops + and ax,1 + jz noops + call dosaveload +noops: ret + endif + + endp + + + + + + + + + + + +Dosaveload proc near + + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call clearwork + call createpanel2 + call undertextline + call getridofall ;reels + call loadsavebox + call showopbox + call showmainops + call worktoscreen ;2 + jmp donefirstops + +restartops: call showopbox + call showmainops + call worktoscreenm +donefirstops: mov getback,0 +waitops: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:opslist + call checkcoords + cmp getback,0 + jz waitops + cmp getback,2 + jz restartops + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + cmp getback,4 + jz justret + call getridoftemp + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + mov commandtype,200 +justret: mov manisoffscreen,0 + ret + +opslist: dw opsx+59,opsx+114,opsy+30,opsy+76,getbackfromops + dw opsx+10,opsx+77,opsy+10,opsy+59,dosreturn + dw opsx+128,opsx+190,opsy+16,opsy+100,discops + dw 0,320,0,200,blank + dw 0ffffh + + + endp + + + +Getbackfromops proc near + + cmp mandead,2 + jz opsblock1 + call getback1 + ret +opsblock1: call blank + ret + + endp + + + + + +Showmainops proc near + + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,8 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,7 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + +Showdiscops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,9 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,10 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + ret + + endp + + + + +Loadsavebox proc near + + mov dx,offset cs:icongraphics8 + call loadintotemp + ret + + endp + + + + + + + + +Loadgame proc near + + cmp commandtype,246 + jz alreadyload + mov commandtype,246 + mov al,41 + call commandonly +alreadyload: mov ax,mousebutton + cmp ax,oldbutton + jz noload + cmp ax,1 + jz doload +noload: ret + +doload: mov loadingorsave,1 + call showopbox + call showloadops + mov currentslot,0 + call showslots + call shownames + mov pointerframe,0 + call worktoscreenm + call namestoold + mov getback,0 + +loadops: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:loadlist + call checkcoords + cmp getback,0 + jz loadops + cmp getback,2 + jz quitloaded + call getridoftemp + ;call clearnoreels + mov dx,seg madeuproomdat + mov es,dx + mov bx,offset es:madeuproomdat + call startloading + call loadroomssample + mov roomloaded,1 + mov newlocation,255 + call clearsprites + call initman + call initrain + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call startup + call worktoscreen + mov getback,4 +quitloaded: ret + +loadlist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualload + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + +Getbacktoops proc near + + cmp commandtype,201 + jz alreadygetops + mov commandtype,201 + mov al,42 + call commandonly +alreadygetops: mov ax,mousebutton + cmp ax,oldbutton + jz nogetbackops + and ax,1 + jnz dogetbackops +nogetbackops: ret + +dogetbackops: call oldtonames + mov getback,2 + ret + + endp + + + + + + + +Discops proc near + + cmp commandtype,249 + jz alreadydiscops + mov commandtype,249 + mov al,43 + call commandonly +alreadydiscops: mov ax,mousebutton + cmp ax,oldbutton + jz nodiscops + and ax,1 + jnz dodiscops +nodiscops: ret +dodiscops: call scanfornames + mov loadingorsave,2 + call showopbox + call showdiscops + mov currentslot,0 + call worktoscreenm + + mov getback,0 +discopsloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:discopslist + call checkcoords + cmp getback,0 + jz discopsloop + ret + +discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame + dw opsx+10,opsx+79,opsy+10,opsy+59,savegame + dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Savegame proc near + + cmp mandead,2 + jnz cansaveok + call blank + ret + +cansaveok: cmp commandtype,247 + jz alreadysave + mov commandtype,247 + mov al,44 + call commandonly +alreadysave: mov ax,mousebutton + and ax,1 + jnz dosave + ret +dosave: mov loadingorsave,2 + call showopbox + call showsaveops + mov currentslot,0 + call showslots + call shownames + call worktoscreenm + + call namestoold + mov bufferin,0 + mov bufferout,0 + + mov getback,0 + +saveops: call delpointer + call checkinput + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:savelist + call checkcoords + cmp getback,0 + jz saveops + ret + +savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualsave + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Actualsave proc near + + cmp commandtype,222 + jz alreadyactsave + mov commandtype,222 + mov al,44 + call commandonly +alreadyactsave: mov ax,mousebutton + and ax,1 + jz noactsave + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz noactsave + + mov al,location + mov ah,0 + mov cx,32 + mul cx + push cs + pop ds + mov si,offset cs:roomdata + add si,ax + + mov di,offset cs:madeuproomdat + mov bx,di + push cs + pop es + mov cx,16 + rep movsw + + mov al,roomssample + mov [es:bx+13],al + mov al,mapx + mov [es:bx+15],al + mov al,mapy + mov [es:bx+16],al + mov al,liftflag + mov [es:bx+20],al + mov al,manspath + mov [es:bx+21],al + mov al,facing + mov [es:bx+22],al + mov al,255 + mov [es:bx+27],al + call saveposition + call getridoftemp + call restoreall ;reels + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call redrawmainscrn + call worktoscreenm + mov getback,4 +noactsave: ret + + endp + + + + +Actualload proc near + + cmp commandtype,221 + jz alreadyactload + mov commandtype,221 + mov al,41 + call commandonly +alreadyactload: mov ax,mousebutton + cmp ax,oldbutton + jz notactload + cmp ax,1 + jnz notactload + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz notactload + call loadposition + mov getback,1 +notactload: ret + + endp + + + + +Selectslot2 proc near + + cmp mousebutton,0 + jz noselslot2 + mov loadingorsave,2 +noselslot2: call selectslot + ret + + endp + + + + + +Checkinput proc near + + cmp loadingorsave,3 + jz nokeypress + call readkey + mov al,currentkey + cmp al,0 + jz nokeypress + cmp al,13 + jnz notret + mov loadingorsave,3 + jmp afterkey +notret: cmp al,8 + jnz nodel2 + cmp cursorpos,0 + jz nokeypress + call getnamepos + dec cursorpos + mov byte ptr [es:bx],0 + mov byte ptr [es:bx+1],1 + jmp afterkey +nodel2: ;cmp al,32 + ;jz spacepress + ;cmp al,"A" + ;jc nokeypress + ;cmp al,"Z"+1 + ;jnc nokeypress +spacepress: cmp cursorpos,14 + jz nokeypress + call getnamepos + inc cursorpos + mov al,currentkey + mov [es:bx+1],al + mov byte ptr [es:bx+2],0 + mov byte ptr [es:bx+3],1 + jmp afterkey + +nokeypress: ret + +afterkey: call showopbox + call shownames + call showslots + call showsaveops + call worktoscreenm + ret + + endp + + + + + +Getnamepos proc near + + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + mov dx,seg savenames + mov es,dx + mov bx,offset es:savenames + add bx,ax + mov al,cursorpos + mov ah,0 + add bx,ax + ret + + endp + + + + + + + + +Showopbox proc near + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy + mov al,0 + mov ah,0 + call showframe + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy+55 + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Showloadops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,55 + mov dl,101 + call printmessage + ret + + endp + + + + +Showsaveops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,54 + mov dl,101 + call printmessage + ret + + endp + + + + + +Selectslot proc near + + cmp commandtype,244 + jz alreadysel + mov commandtype,244 + mov al,45 + call commandonly +alreadysel: mov ax,mousebutton + cmp ax,1 + jnz noselslot + cmp ax,oldbutton + jz noselslot + + cmp loadingorsave,3 + jnz notnocurs + dec loadingorsave +notnocurs: call oldtonames + mov ax,mousey + sub ax,opsy+4 + mov cl,-1 +getslotnum: inc cl + sub ax,11 + jnc getslotnum + mov currentslot,cl + call delpointer + call showopbox + call showslots + call shownames + cmp loadingorsave,1 + jz isloadmode + call showsaveops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret +isloadmode: call showloadops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + +noselslot: ret + + endp + + + + + + + + + + +Showslots proc near + + mov di,opsx+7 + mov bx,opsy+8 + mov al,2 + mov ds,tempgraphics + mov ah,0 + call showframe + + mov di,opsx+10 + mov bx,opsy+11 + mov cl,0 +slotloop: push cx di bx + + cmp cl,currentslot + jnz nomatchslot + mov al,3 + mov ds,tempgraphics + mov ah,0 + call showframe + +nomatchslot: pop bx di cx + add bx,10 + inc cl + cmp cl,7 + jnz slotloop + ret + + endp + + + + + +Shownames proc near + + mov dx,seg savenames + mov es,dx + mov si,offset es:savenames+1 + mov di,opsx+21 + mov bx,opsy+10 + mov cl,0 + +shownameloop: push cx di es bx si + mov al,4 + cmp cl,currentslot + jnz nomatchslot2 + + cmp loadingorsave,2 + jnz loadmode + + mov dx,si + mov cx,15 + add si,15 +zerostill: dec si + dec cl + cmp byte ptr [es:si],1 + jnz foundcharacter + jmp zerostill +foundcharacter: mov cursorpos,cl + mov byte ptr [es:si],"/" + mov byte ptr [es:si+1],0 + push si + mov si,dx + mov dl,200 + mov ah,0 + call printdirect + pop si + mov byte ptr [es:si],0 + mov byte ptr [es:si+1],1 + jmp afterprintname + +loadmode: mov al,0 + mov dl,200 + mov ah,0 + mov charshift,91 + call printdirect + mov charshift,0 + jmp afterprintname + +nomatchslot2: mov dl,200 + mov ah,0 + call printdirect + +afterprintname: pop si bx es di cx + add si,17 + add bx,10 + inc cl + cmp cl,7 + jnz shownameloop + ret + + endp + + + + + + + + + + + + + + + + + + +Dosreturn proc near + + cmp commandtype,250 + jz alreadydos + mov commandtype,250 + mov al,46 + call commandonly +alreadydos: mov ax,mousebutton + and ax,1 + jz nodos + +quickquit2: call soundend + call removeemm + +quickquit: if recording + call saverec + mov bx,rechandle + mov ah,3eh + int 21h + endif + if playback + mov bx,rechandle + mov ah,3eh + int 21h + endif + + call resetkeyboard + mov bl,31h + mov al,0 + mov ah,12h + int 10h + call vsync + + mov ah,0 + mov al,3 + int 10h + call error + mov ax,4c00h + int 21h + ret + + endp + + + +Error proc near + + cmp gameerror,1 + jz error1 + cmp gameerror,2 + jz error2 + cmp gameerror,3 + jz error3 + cmp gameerror,4 + jz error4 + cmp gameerror,5 + jz error5 + cmp gameerror,6 + jz error6 + cmp gameerror,7 + jz error7 + cmp gameerror,8 + jz error8 + ret + +error1: mov dx,offset cs:gameerror1 + jmp generalerror + +error2: mov ax,soundbaseadd + sub ax,200h + mov cl,4 + shr ax,cl + add al,"0" + mov bx,offset cs:error2patch + mov [cs:bx+1],al + mov dx,offset cs:gameerror2 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error3: mov dx,offset cs:gameerror3 + jmp generalerror + +error4: mov dx,offset cs:gameerror4 + jmp generalerror + +error5: mov dx,offset cs:gameerror5 + jmp generalerror + +error6: mov al,soundint + add al,"0" + mov bx,offset cs:error6patch + mov [cs:bx],al + mov dx,offset cs:gameerror6 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error7: mov dx,offset cs:gameerror7 + jmp generalerror + +error8: mov dx,offset cs:gameerror8 + jmp generalerror + +generalerror: mov ah,9h + push cs + pop ds + int 21h + ret + +nodos: ret + +gameerror1: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to allocate Expanded Memory." + db 13,10,13,10 + db 24h +gameerror2: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster card not found at address " +error2patch: db "220 Hex." + db 13,10,13,10 + db 24h +gameerror3: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Out of Base Memory." + db 13,10,13,10 + db 24h +gameerror4: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Memory Deallocation problem." + db 13,10,13,10 + db 24h +gameerror5: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "At least 590K of base memory is required." + db 13,10,13,10 + db 24h +gameerror6: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster not found on interupt " +error6patch: db "0" + db 13,10,13,10 + db 24h +gameerror7: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to select EMM page." + db 13,10,13,10 + db 24h +gameerror8: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "File not found.c" +error8patch: db 13,10,13,10 + db 24h + +gameinfo: db "Dreamweb looks for Sound Blaster information in",13,10 + db "the BLASTER environment variable (in your AUTOEXEC.BAT)",13,10 + db 13,10,"If this is not found then IRQ 7, DMA channel 1 and base",13,10 + db "address 220h are assumed.",13,10,13,10 + + db "To alter any or all of these settings you can specify them",13,10 + db "on the command line. For example:",13,10,13,10 + db "Type DREAMWEB I7 A220 D1 to run Dreamweb on IRQ 7, DMA",13,10 + db " channel 1 and base address 220h" + db 13,10 + db " DREAMWEB I5 to run Dreamweb on IRQ 5 and",13,10 + db " default address of 220h, DMA 1",13,10 + db 13,10 + db 24h + +endgametext1: db 13,10,13,10 + db "Try the Dreamweb CD in your stereo....",13,10 + db 13,10,13,10 + db 24h + + endp + + + + + + + + +Namestoold proc near + + push cs + pop ds + mov si,offset cs:savenames + mov di,zoomspace + mov es,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + +Oldtonames proc near + + push cs + pop es + mov di,offset cs:savenames + mov si,zoomspace + mov ds,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + + + +Saveposition proc near + + call makeheader + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + call openforsave + + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen + mov bx,handle + mov ah,40h + int 21h + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call saveseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call saveseg + + mov ds,extras + mov dx,exframedata + call saveseg + + mov ds,buffers + mov dx,listofchanges + call saveseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call saveseg + + mov dx,seg reelroutines + mov ds,dx + mov dx,offset reelroutines + call saveseg + +fquit: call closefile + ret + + endp + + + + + + +Loadposition proc near + + mov timecount,0 + call clearchanges + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + if cd + call openfilefromc + else + call openfile + endif + + mov ah,3fh + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen + mov bx,handle + int 21h + push cs + pop es + mov di,offset cs:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call loadseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call loadseg + + mov ds,extras + mov dx,exframedata + call loadseg + + mov ds,buffers + mov dx,listofchanges + call loadseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call loadseg + + push cs + pop ds + mov dx,offset cs:reelroutines + call loadseg + + call closefile + ret + + endp + + + + + +Loadseg proc near + + mov bx,handle + mov ax,[es:di] + add di,2 + push di + push es + mov cx,ax + mov ah,3fh + int 21h + pop es + pop di + ret + + endp + + + + + +Makeheader proc near + + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + mov ax,17 + call storeit + mov ax,lengthofvars + call storeit + mov ax,lengthofextra + call storeit + mov ax,numchanges*4 + call storeit + mov ax,48 + call storeit + mov ax,lenofreelrouts + call storeit + ret + + endp + + + + + +Storeit proc near + + cmp ax,0 + jnz isntblank + inc ax +isntblank: stosw + ret + + endp + + + + +Saveseg proc near + + mov cx,[es:di] + add di,2 + push di es + mov bx,handle + mov ah,40h + int 21h + pop es di + ret + + endp + + + +Findlen proc near + + dec bx + add bx,ax +nextone: cmp cl,[bx] + jnz foundlen + dec bx + dec ax + cmp ax,0 + jnz nextone +foundlen: ret + + endp + + + + + +Scanfornames proc near + + mov dx,seg savenames + mov es,dx + mov di,offset es:savenames + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + mov cx,7 +scanloop: push es ds di dx cx + + if cd + call openfilefromc + else + call openfilenocheck + endif + jc notexist + pop cx + inc ch + push cx + push di es + mov ah,3fh + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen + mov bx,handle + int 21h + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + pop ds dx + call loadseg + mov bx,handle + call closefile + +notexist: pop cx dx di ds es + add dx,13 + add di,17 + dec cl + jnz scanloop + mov al,ch + ret + + endp + + + + + +Decide proc near + + call setmode + call loadpalfromiff + call clearpalette + mov pointermode,0 + mov watchingtime,0 + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call loadsavebox + call showdecisions + call worktoscreen + call fadescreenup + mov getback,0 + +waitdecide: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:decidelist + call checkcoords + cmp getback,0 + jz waitdecide + cmp getback,4 + jz hasloadedroom + call getridoftemp +hasloadedroom: mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + ret + +decidelist: dw opsx+69,opsx+124,opsy+30,opsy+76,newgame + dw opsx+20,opsx+87,opsy+10,opsy+59,dosreturn + dw opsx+123,opsx+190,opsy+10,opsy+59,loadold + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Showdecisions proc near + + call createpanel2 + call showopbox + mov ds,tempgraphics + mov di,opsx+17 + mov bx,opsy+13 + mov al,6 + mov ah,0 + call showframe + call undertextline + ret + + endp + + + + + +Newgame proc near + + cmp commandtype,251 + jz alreadynewgame + mov commandtype,251 + mov al,47 + call commandonly +alreadynewgame: mov ax,mousebutton + cmp ax,1 + jnz nonewgame + mov getback,3 +nonewgame: ret + + endp + + + + + + + +Loadold proc near + + cmp commandtype,252 + jz alreadyloadold + mov commandtype,252 + mov al,48 + call commandonly +alreadyloadold: mov ax,mousebutton + and ax,1 + jz noloadold + call doload + cmp getback,4 + jz noloadold + call showdecisions + call worktoscreenm + mov getback,0 +noloadold: ret + + endp + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm new file mode 100644 index 0000000000..9eb9afc08f --- /dev/null +++ b/devtools/tasmrecover/dreamweb/sblaster.asm @@ -0,0 +1,1293 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +; Creative Reality Sound Blaster Drivers . (C) 1994 Creative Reality + +; Very sparsly commented. + + + +;These drivers are not stand alone. We had them as an integral part of the +;game. +; +;Put interupt no. into SOUNDINT, base address (eg 220h) into SOUNDBASEADD. +;If interupt is 255 then no card is assumed. +; +;Call soundstartup at beginning of program to test card and initialise. +; +;This code assumes that EMS has been initialised +;Emm page frame is in variable EMMPAGEFRAME. Handle is in EMMHANDLE. +; +;Call loadsample with a filename in CS:DX (ie. in the code somewhere) +; +;To play a sample call playchannel0 or playchannel1 with sound no. in al. +; +;Call endsample to restore interupts and halt sound. +; +; + + + + +;------------------------------------------- Initial sound set up and end --- + +Loadspeech proc near + + cmp soundint,255 + jz dontbother8 + + call cancelch1 + + mov speechloaded,0 + call createname + + mov speechlength,0 + mov dx,offset cs:speechfilename + call openfilenocheck + jc dontbother8 + + mov bx,speechemmpage + +moreloadspeech: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + mov es,emmpageframe + mov di,8000h + mov cx,4000h + mov ax,0 + rep stosw + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + mov cl,11 + shr ax,cl + add speechlength,ax + pop bx dx + add bx,2 + cmp ax,0 + jnz moreloadspeech + call closefile + + mov es,sounddata2 + mov di,50*6 + mov ax,speechemmpage + mov [es:di],al + mov ax,0 + mov [es:di+1],ax + mov ax,speechlength + mov [es:di+3],ax + mov speechloaded,1 +dontbother8: ret + +speechfilename: db "SPEECH\" +speechfile: db "R24C0005.RAW",0 + + endp + + + +Createname proc near + + push ax + mov di,offset cs:speechfile + mov byte ptr [cs:di+0],dl ;"R" + mov [cs:di+3],cl + + mov al,dh ;reallocation + mov ah,"0"-1 +findten: inc ah + sub al,10 + jnc findten + mov [cs:di+1],ah + add al,10+"0" + mov [cs:di+2],al + pop ax + + mov cl,"0"-1 +thousandsc: inc cl + sub ax,1000 + jnc thousandsc + add ax,1000 + mov [cs:di+4],cl + mov cl,"0"-1 +hundredsc: inc cl + sub ax,100 + jnc hundredsc + add ax,100 + mov [cs:di+5],cl + mov cl,"0"-1 +tensc: inc cl + sub ax,10 + jnc tensc + add ax,10 + mov [cs:di+6],cl + add al,"0" + mov [cs:di+7],al + ret + + endp + + + + + + +Loadsample proc near + + cmp soundint,255 + jz dontbother + + call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata + pop cx + mov dx,0 + call readfromfile + pop di es + + add di,2 + mov bx,0 + mov dx,[es:di] + add dx,1 + shr dx,1 + + mov soundemmpage,0 + +moreload: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add soundemmpage,2 + dec dx + jnz moreload + ;inc soundemmpage + call closefile +dontbother: ret + +emmerror: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Loadsecondsample proc near + + cmp soundint,255 + jz dontbother9 + + cmp ch0playing,12 + jc ch0oksecond + cmp ch0playing,255 + jz ch0oksecond + call cancelch0 + ;mov cx,100 + ;call hangon + jmp ch0oksecond +justcancel: call cancelch0 +ch0oksecond: cmp ch1playing,12 + jc ch1oksecond + call cancelch1 + +ch1oksecond: call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata2 + pop cx + mov dx,0 + call readfromfile + + mov cx,100 + mov di,0 + mov es,sounddata2 + mov bx,soundemmpage +adjustemmpage: mov al,[es:di] + add al,bl + mov [es:di],al + add di,6 + loop adjustemmpage + + pop di es + + add di,2 + mov bx,soundemmpage + mov speechemmpage,bx + mov dx,[es:di] + add dx,1 + shr dx,1 + +moreload2: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add speechemmpage,2 + dec dx + jnz moreload2 + call closefile +dontbother9: ret + +emmerror2: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Soundstartup proc near + + cmp soundint,255 + jz dontbother2 + + mov dx,soundbaseadd + add dx,0eh + mov DSP_status,dx + mov dx,soundbaseadd + add dx,0ch + mov DSP_write,dx + + mov al,1 + mov dx,soundbaseadd + add dx,0006h + out dx,al + push ax ax ax ax ax ax ax ax + pop ax ax ax ax ax ax ax ax + mov al,0 + out dx,al + + mov dx,DSP_status + mov cx,2000 +waitinit: in al,dx + and al,128 + jz waitinit + mov dx,soundbaseadd + add dx,000ah + in al,dx + cmp al,0aah + jz dspready + loop waitinit + mov gameerror,2 + jmp quickquit + +dspready: call trysoundalloc + + cli + mov ah,40h ;set sample rate + call out22c + mov ah,210 ;of 22050Hz + call out22c + sti + + call checksoundint + + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es ; Save es:bx to temp memory + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:dmaend + mov ah,25h + mov al,soundint + add al,8 + int 21h ; Set to new + + call enablesoundint + + mov al,sounddmachannel + xor ah,ah + mov bx,offset cs:dmaaddresses + add bx,ax + mov al,[cs:bx] + mov dmaaddress,al + + mov ah,0d1h ;speaker on + call out22c + mov ah,0d0h + call out22c + +dontbother2: ret + +dmaaddresses db 87h,83h,81h,82h + + endp + + + + + +Trysoundalloc proc near + + cmp needsoundbuff,1 + jz gotsoundbuff + inc soundtimes + mov bx,(16384+2048)/16 + call allocatemem + mov soundbuffer,ax + push ax + mov al,ah + mov cl,4 + shr al,cl + mov soundbufferpage,al + pop ax + mov cl,4 + shl ax,cl + mov soundbufferad,ax + cmp ax,0b7ffh + jnc soundfail + + mov es,soundbuffer + mov di,0 + mov cx,16384/2 + mov ax,7f7fh + rep stosw + mov needsoundbuff,1 + ret + +soundfail: mov es,soundbuffer + call deallocatemem +gotsoundbuff: ret + + endp + + + + + + +Setsoundoff proc near + + cmp soundint,255 + jz dontbother28 + mov soundbufferwrite,0 + cli + call setupPIT + mov soundbufferwrite,4096 + call startdmablock + sti +dontbother28: ret + + endp + + + + + + +Checksoundint proc near + + mov ah,0d3h ;speaker off + call out22c + + mov testresult,0 + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:interupttest + mov ah,25h + mov al,soundint + add al,8 + int 21h + + call enablesoundint + + mov ah,0f2h + call out22c + + mov cx,20 + call hangon + + call disablesoundint + + mov dx,oldsoundintseg + mov ds,dx + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + + cmp testresult,1 + jz interuptworked + mov gameerror,6 ;interupt wrong + jmp quickquit ;exit to DOS with error + +interuptworked: ret + + endp + + + + + +Enablesoundint proc near + + mov dx,21h ; Enable int? + in al,dx + mov currentirq,al + mov ah,11111110b + mov cl,soundint + rol ah,cl + and al,ah + out dx,al + ret + + endp + + + + + +Disablesoundint proc near + + mov al,soundint + mov dx,21h + mov al,currentirq + out dx,al + ret + + endp + + + + +Interupttest proc near + + cli + push ax dx + mov testresult,1 + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx ax + iret + + endp + + + + + +Soundend proc near + + cmp soundint,255 + jz dontbother3 + + call getridofPIT + + mov ah,0d0h + call out22c + + call disablesoundint + + mov ds,oldsoundintseg ;for keys + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + +dontbother3: ret + + endp + + + + + +Out22c proc near + + mov dx,DSP_write +notclear: in al,dx + or al,al + js notclear + mov al,ah + out dx,al + ret + + endp + + + + + +;--------------------------------------------------------------------------- + + + + +Playchannel0 proc near ;al=sound no + ;ah=times to repeat + cmp soundint,255 + jz dontbother4 + + push es ds bx cx di si + + mov ch0playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank + mov es,sounddata2 + sub al,12 +notsecondbank: mov ch0repeat,ah + mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch0emmpage,ax + mov ax,[es:bx+1] + mov ch0offset,ax + mov ax,[es:bx+3] + mov ch0blockstocopy,ax + + cmp ch0repeat,0 + jz nosetloop + mov ax,ch0emmpage + mov ch0oldemmpage,ax + mov ax,ch0offset + mov ch0oldoffset,ax + mov ax,ch0blockstocopy + mov ch0oldblockstocopy,ax + +nosetloop: pop si di cx bx ds es + +dontbother4: ret + + endp + + + + + + + +Playchannel1 proc near ;al=sound no + + cmp soundint,255 + jz dontbother5 + cmp ch1playing,7 + jz dontbother5 + push es ds bx cx di si + + mov ch1playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank1 + mov es,sounddata2 + sub al,12 +notsecondbank1: mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch1emmpage,ax + mov ax,[es:bx+1] + mov ch1offset,ax + mov ax,[es:bx+3] + mov ch1blockstocopy,ax + + pop si di cx bx ds es + +dontbother5: ret + + endp + + + + + + + + +Makenextblock proc near + + call volumeadjust + + call loopchannel0 + cmp ch1blockstocopy,0 + jz mightbeonlych0 + cmp ch0blockstocopy,0 + jz mightbeonlych1 + + dec ch0blockstocopy + dec ch1blockstocopy + call bothchannels + ret + +mightbeonlych1: mov ch0playing,255 + cmp ch1blockstocopy,0 + jz notch1only + dec ch1blockstocopy + call channel1only +notch1only: ret + +mightbeonlych0: mov ch1playing,255 + cmp ch0blockstocopy,0 + jz notch0only + dec ch0blockstocopy + call channel0only + ret +notch0only: mov es,soundbuffer + mov di,soundbufferwrite + mov cx,1024 + mov ax,7f7fh + rep stosw + and di,16384-1 + mov soundbufferwrite,di + ret + + endp + + + + +Volumeadjust proc near + + mov al,volumedirection + cmp al,0 + jz volok + mov al,volume + cmp al,volumeto + jz volfinish + add volumecount,64 + jnz volok + mov al,volume + add al,volumedirection + mov volume,al + ret +volfinish: mov volumedirection,0 +volok: ret + + endp + + + +Loopchannel0 proc near + + cmp ch0blockstocopy,0 + jnz notloop + cmp ch0repeat,0 + jz notloop + cmp ch0repeat,255 + jz endlessloop + dec ch0repeat +endlessloop: mov ax,ch0oldemmpage + mov ch0emmpage,ax + mov ax,ch0oldoffset + mov ch0offset,ax + mov ax,ch0blockstocopy + add ax,ch0oldblockstocopy + mov ch0blockstocopy,ax + ret +notloop: ret + + endp + + + + + + + +Cancelch0 proc near + + mov ch0repeat,0 + mov ch0blockstocopy,0 + mov ch0playing,255 + ret + + endp + + + +Cancelch1 proc near + + mov ch1blockstocopy,0 + mov ch1playing,255 + ret + + endp + + + + +Channel0only proc near + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + + call channel0tran + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notch0endofpage0 + inc ch0emmpage +notch0endofpage0: ret + + endp + + + + +Channel1only proc near + + call saveems + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch1offset + add si,16384 + + mov cx,1024 + rep movsw + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notch1endofpage1 + inc ch1emmpage +notch1endofpage1: ret + + endp + + + + + +Channel0tran proc near + + cmp volume,0 + jnz lowvolumetran + mov cx,1024 + rep movsw + ret + +lowvolumetran: mov cx,1024 + mov bh,volume + mov bl,0 + add bx,16384-256 +volloop: lodsw + mov bl,al + mov al,[es:bx] + mov bl,ah + mov ah,[es:bx] + stosw + loop volloop + ret + + + endp + + + + + + + + +Bothchannels proc near ;rather slow routine + ;to mix two channels + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + mov bx,ch1offset + add bx,16384 + mov cx,2048 + mov dh,128 + mov dl,255 + + call domix + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + + mov si,ch0offset + add si,2048 + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notbothendofpage0 + inc ch0emmpage +notbothendofpage0: mov si,ch1offset + add si,2048 + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notbothendofpage1 + inc ch1emmpage +notbothendofpage1: ret + + endp + + + +Saveems proc near + + mov ah,4eh + mov al,0 + mov es,soundbuffer + mov di,16384+2048-256 + int 67h + ret + + endp + + +Restoreems proc near + + push si di + mov ah,4eh + mov al,1 + mov ds,soundbuffer + mov si,16384+2048-256 + int 67h + pop di si + ret + + endp + + + +Domix proc near + + cmp volume,0 + jnz lowvolumemix + +slow: lodsb + mov ah,[bx] + inc bx + cmp al,dh + jnc toplot + +botlot: cmp ah,dh + jnc nodistort + add al,ah + js botok + xor al,al + stosb + loop slow + jmp doneit +botok: xor al,dh + stosb + loop slow + jmp doneit + +toplot: cmp ah,dh + jc nodistort + add al,ah + jns topok + mov al,dl + stosb + loop slow + jmp doneit +topok: xor al,dh + stosb + loop slow + jmp doneit + +nodistort: add al,ah + xor al,dh + stosb + loop slow + jmp doneit + + +lowvolumemix: lodsb + push bx + mov bh,volume + add bh,63 + mov bl,al + mov al,[es:bx] + pop bx + + mov ah,[bx] + inc bx + cmp al,dh + jnc toplotv + +botlotv: cmp ah,dh + jnc nodistortv + add al,ah + js botokv + xor al,al + stosb + loop lowvolumemix + jmp doneit +botokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +toplotv: cmp ah,dh + jc nodistortv + add al,ah + jns topokv + mov al,dl + stosb + loop lowvolumemix + jmp doneit +topokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +nodistortv: add al,ah + xor al,dh + stosb + loop lowvolumemix +doneit: ret + + + endp + + + + + + + +Dmaend proc near + + cli + push ax cx dx + call startdmablock + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx cx ax + iret + + endp + + + + + + + + + + + + + + + + +Startdmablock proc near + + mov al,sounddmachannel ;cx=length + or al,4 ;bx=offset + out 0ah,al + xor al,al + out 0ch,al + + mov al,48h + or al,sounddmachannel + out 0bh,al + + mov cx,soundbufferad + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov dl,dmaaddress + mov al,soundbufferpage ;hardware page + out dx,al + + mov dl,sounddmachannel + shl dl,1 + inc dl + mov cx,16384-1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov al,sounddmachannel + out 0ah,al ;dmac programmed + + mov dx,DSP_write +notclear1: in al,dx + or al,al + js notclear1 + mov al,14h + out dx,al +notclear2: in al,dx + or al,al + js notclear2 + mov al,cl + out dx,al +notclear3: in al,dx + or al,al + js notclear3 + mov al,ch + out dx,al + + ret + + + endp + + + + + + + + + + + + + + + +SetupPIT proc near + + mov ah,35h + mov al,8 + int 21h + mov oldint8seg,es ; Save es:bx to temp memory + mov oldint8add,bx + push cs + pop ds + mov dx,offset cs:PITinterupt + mov ah,25h + mov al,8 + int 21h ; Set to new + + mov al,34h + out 43h,al + mov al,0h + out 40h,al + mov al,0dah + out 40h,al + ret + + endp + + + + + + +Getridofpit proc near + + cmp oldint8seg,-1 + jz noresetPIT + mov dx,oldint8add + mov ax,oldint8seg + mov ds,ax + mov ah,25h + mov al,8 + int 21h + mov al,34h + out 43h,al + mov al,0 + out 40h,al + mov al,0 + out 40h,al +noresetPIT: ret + + endp + + + + + + +PITinterupt proc near + + cli + push ax dx cx + + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + in al,dx + mov cl,al + in al,dx + mov ch,al + sub cx,soundbufferad + mov ax,soundbufferwrite + sub ax,cx + and ax,3fffh + sti + cmp ax,8192 + jnc mustgo + cmp ax,2048 + jnc nopitflip + +mustgo: push bx si di es ds + call makenextblock + pop ds es di si bx + +nopitflip: cli + mov al,20h + out 20h,al + pop cx dx ax + iret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm new file mode 100644 index 0000000000..bb7ba402f8 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -0,0 +1,5034 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;------------------------------------------------------------People Routines---- + + + +Reelroutines db 1,44,0 ;Room number and x,y + dw 20 ;reel pointer + db 2,0,1 ;speed,speed count,convers. no. + + db 1,55,0 + dw 0 + db 50,20,0 + + db 24,22,0 + dw 74 + db 1,0,0 + + db 24,33,10 + dw 75 + db 1,0,1 + + db 1,44,0 + dw 27 + db 2,0,2 + + db 1,44,0 + dw 96 + db 3,0,4 + + db 1,44,0 + dw 118 + db 2,0,5 + + db 1,44,10 + dw 0 + db 2,0,0 + + db 5,22,20 + dw 53 + db 3,0,0 + + db 5,22,20 + dw 40 + db 1,0,2 + + db 5,22,20 + dw 50 + db 1,0,3 + + db 2,11,10 + dw 192 + db 1,0,0 + + db 2,11,10 + dw 182 + db 2,0,1 + + db 8,11,10 + dw 0 + db 2,0,1 + + db 23,0,50 + dw 0 + db 3,0,0 + + db 28,11,20 + dw 250 + db 4,0,0 + + db 23,0,50 + dw 43 + db 2,0,8 + + db 23,11,40 + dw 130 + db 2,0,1 + + db 23,22,40 + dw 122 + db 2,0,2 + + db 23,22,40 + dw 105 + db 2,0,3 + + db 23,22,40 + dw 81 + db 2,0,4 + + db 23,11,40 + dw 135 + db 2,0,5 + + db 23,22,40 + dw 145 + db 2,0,6 + + db 4,22,30 + dw 0 + db 2,0,0 + + db 45,22,30 + dw 200 + db 0,0,20 + + db 45,22,30 + dw 39 + db 2,0,0 + + db 45,22,30 + dw 25 + db 2,0,0 + + db 8,22,40 + dw 32 + db 2,0,0 + + db 7,11,20 + dw 64 + db 2,0,0 + + db 22,22,20 + dw 82 + db 2,0,0 + + db 27,11,30 + dw 0 + db 2,0,0 + + db 20,0,30 + dw 0 + db 2,0,0 + + db 14,33,40 + dw 21 + db 1,0,0 + + db 29,11,10 + dw 0 + db 1,0,0 + + db 2,22,0 + dw 2 + db 2,0,0 + + db 25,0,50 + dw 4 + db 2,0,0 + + db 50,22,30 + dw 121 + db 2,0,0 + + db 50,22,30 + dw 0 + db 20,0,0 + + db 52,22,30 + dw 192 + db 2,0,0 + + db 52,22,30 + dw 233 + db 2,0,0 + + db 50,22,40 + dw 104 + if cd + if german + db 65,0,0 + else + db 55,0,0 + endif + else + db 55,0,0 + endif + + db 53,33,0 + dw 99 + db 2,0,0 + + db 50,22,40 + dw 0 + db 3,0,0 + + db 50,22,30 + dw 162 + db 2,0,0 + + db 52,22,30 + dw 57 + db 2,0,0 + + db 52,22,30 + dw 0 + db 2,0,0 + + db 54,0,0 + dw 72 + db 3,0,0 + + db 55,44,0 + dw 0 + db 2,0,0 + + db 19,0,0 + dw 0 + db 28,0,0 + + db 14,22,0 + dw 2 + db 2,0,0 + + db 14,22,0 + dw 300 + db 1,0,0 + + db 10,22,30 + dw 174 + db 0,0,0 + + db 12,22,20 + dw 0 + db 1,0,0 + + db 11,11,20 + dw 0 + db 50,20,0 + + db 11,11,30 + dw 0 + db 50,20,0 + + db 11,22,20 + dw 0 + db 50,20,0 + + db 14,33,40 + dw 0 + db 50,20,0 + + db 255 + + +Lenofreelrouts equ $-reelroutines + + +Reelcalls dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke + dw manasleep,drunk,receptionist,malefan,femalefan + dw louis,louischair,soldier1,bossman,interviewer + dw heavy,manasleep2,mansatstill,drinker,bartender + dw othersmoker,tattooman,attendant,keeper,candles1 + dw smallcandle,security,copper,poolguard,rockstar + dw businessman,train,aide,mugger,helicopter + dw intromagic1,intromusic,intromagic2,candles2,gates + dw intromagic3,intromonks1,candles,intromonks2 + dw handclap,monkandryan,endgameseq,priest,madman + dw madmanstelly,alleybarksound,foghornsound + dw carparkdrip,carparkdrip,carparkdrip,carparkdrip + + + +;---------------------------------------------------------Character updates---- + + + +Alleybarksound proc near + + mov ax,[es:bx+3] + dec ax + cmp ax,0 + jnz nobark + push bx es + mov al,14 + call playchannel1 + pop es bx + mov ax,1000 +nobark: mov [es:bx+3],ax + ret + + endp + + + + +Intromusic proc near + + ret + + endp + + +Foghornsound proc near + + call randomnumber + cmp al,198 + jnz nofog + mov al,13 + call playchannel1 +nofog: ret + + endp + + + + +Receptionist proc near + + call checkspeed + jnz gotrecep + cmp cardpassflag,1 + jnz notsetcard + inc cardpassflag + mov byte ptr [es:bx+7],1 + mov word ptr [es:bx+3],64 +notsetcard: cmp word ptr [es:bx+3],58 + jnz notdes1 + call randomnumber + cmp al,30 + jc notdes2 + mov word ptr [es:bx+3],55 + jmp gotrecep + +notdes1: cmp word ptr [es:bx+3],60 + jnz notdes2 + call randomnumber + cmp al,240 + jc gotrecep + mov word ptr [es:bx+3],53 + jmp gotrecep + +notdes2: cmp word ptr [es:bx+3],88 + jnz notendcard + mov word ptr [es:bx+3],53 + jmp gotrecep + +notendcard: inc word ptr [es:bx+3] +gotrecep: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedrecep + mov talkedtorecep,1 +nottalkedrecep: ret + + endp + + + + +Smokebloke proc near + + cmp rockstardead,0 + jnz notspokento + mov al,[es:bx+7] + and al,128 + jz notspokento + push es bx + mov al,5 + call setlocation + pop bx es +notspokento: ;mov al,[es:bx+7] + ;and al,127 + ;mov [es:bx+7],al + call checkspeed + jnz gotsmokeb + cmp word ptr [es:bx+3],100 + jnz notsmokeb1 + call randomnumber + cmp al,30 + jc notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb1: cmp word ptr [es:bx+3],117 + jnz notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb2: inc word ptr [es:bx+3] +gotsmokeb: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Attendant proc near + + call showgamereel + call addtopeoplelist + mov al,[es:bx+7] + and al,128 + jz nottalked + mov talkedtoattendant,1 +nottalked: ret + + endp + + + + + + +Manasleep proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + +Eden proc near + + cmp generaldead,0 + jnz notinbed + call showgamereel + call addtopeoplelist +notinbed: ret + + endp + + + +Edeninbath proc near + + cmp generaldead,0 + jz notinbed + cmp sartaindead,0 + jnz notinbath + call showgamereel + call addtopeoplelist +notinbath: ret + + endp + + + +Malefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + +Femalefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Louis proc near + + cmp rockstardead,0 + jnz notlouis1 + call showgamereel + call addtopeoplelist +notlouis1: ret + + endp + + + + +Louischair proc near + + cmp rockstardead,0 + jz notlouis2 + call checkspeed + jnz notlouisanim + mov ax,[es:bx+3] + inc ax + cmp ax,191 + jz restartlouis + cmp ax,185 + jz randomlouis + mov [es:bx+3],ax + jmp notlouisanim +randomlouis: mov [es:bx+3],ax + call randomnumber + cmp al,245 + jnc notlouisanim +restartlouis: mov ax,182 + mov [es:bx+3],ax +notlouisanim: call showgamereel + call addtopeoplelist +notlouis2: ret + + endp + + + +Manasleep2 proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Mansatstill proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Tattooman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Drinker proc near + + call checkspeed + jnz gotdrinker + inc word ptr [es:bx+3] + cmp word ptr [es:bx+3],115 + jnz notdrinker1 + mov word ptr [es:bx+3],105 + jmp gotdrinker + +notdrinker1: cmp word ptr [es:bx+3],106 + jnz gotdrinker + call randomnumber + cmp al,3 + jc gotdrinker + mov word ptr [es:bx+3],105 + +gotdrinker: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Bartender proc near + + call checkspeed + jnz gotsmoket + cmp word ptr [es:bx+3],86 + jnz notsmoket1 + call randomnumber + cmp al,18 + jc notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket1: cmp word ptr [es:bx+3],103 + jnz notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket2: inc word ptr [es:bx+3] +gotsmoket: call showgamereel + cmp gunpassflag,1 + jnz notgotgun + mov byte ptr [es:bx+7],9 +notgotgun: call addtopeoplelist + ret + + endp + + + + + + + +Othersmoker proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Barwoman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + +Interviewer proc near + + cmp reeltowatch,68 + jnz notgeneralstart + inc word ptr [es:bx+3] +notgeneralstart: cmp word ptr [es:bx+3],250 + jz talking + call checkspeed + jnz talking + cmp word ptr [es:bx+3],259 + jz talking + inc word ptr [es:bx+3] +talking: call showgamereel + ret + + endp + + + + + +Soldier1 proc near + + cmp word ptr [es:bx+3],0 + jz soldierwait + mov watchingtime,10 + cmp word ptr [es:bx+3],30 + jnz notaftersshot + inc combatcount + cmp combatcount,40 + jnz gotsoldframe + mov mandead,2 + jmp gotsoldframe +notaftersshot: call checkspeed + jnz gotsoldframe + inc word ptr [es:bx+3] + jmp gotsoldframe +soldierwait: cmp lastweapon,1 + jnz gotsoldframe + mov watchingtime,10 + cmp manspath,2 + jnz gotsoldframe + cmp facing,4 + jnz gotsoldframe + inc word ptr [es:bx+3] + mov lastweapon,-1 + mov combatcount,0 +gotsoldframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + +Rockstar proc near + + mov ax,[es:bx+3] + cmp ax,303 + jz rockcombatend + cmp ax,118 + jz rockcombatend + call checkspeed + jnz rockspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,118 + jnz notbeforedead + mov mandead,2 + jmp gotrockframe + +notbeforedead: cmp ax,79 + jnz gotrockframe + dec ax + cmp lastweapon,1 + jnz notgunonrock + mov lastweapon,-1 + mov ax,123 + jmp gotrockframe +notgunonrock: inc combatcount + cmp combatcount,40 + jnz gotrockframe + mov combatcount,0 + mov ax,79 + +gotrockframe: mov [es:bx+3],ax +rockspeed: call showgamereel + cmp word ptr [es:bx+3],78 + jnz notalkrock + call addtopeoplelist + mov pointermode,2 + mov watchingtime,0 + ret + +notalkrock: mov watchingtime,2 + mov pointermode,0 + mov al,mapy + mov [es:bx+2],al + ret + +rockcombatend: mov newlocation,45 + call showgamereel + ret + + endp + + + + + + + + + + + + + + + +Helicopter proc near + + mov ax,[es:bx+3] + cmp ax,203 + jz heliwon + ;cmp ax,53 + ;jz helicombatend + call checkspeed + jnz helispeed + + mov ax,[es:bx+3] + inc ax + cmp ax,53 + jnz notbeforehdead + inc combatcount + cmp combatcount,8 + jc waitabit + mov mandead,2 +waitabit: mov ax,49 + jmp gotheliframe + +notbeforehdead: cmp ax,9 + jnz gotheliframe + dec ax + cmp lastweapon,1 + jnz notgunonheli + mov lastweapon,-1 + mov ax,55 + jmp gotheliframe +notgunonheli: mov ax,5 + inc combatcount + cmp combatcount,20 + jnz gotheliframe + mov combatcount,0 + mov ax,9 + +gotheliframe: mov [es:bx+3],ax +helispeed: call showgamereel + mov al,mapx + mov [es:bx+1],al +helicombatend: mov ax,[es:bx+3] + cmp ax,9 ;8 + jnc notwaitingheli + cmp combatcount,7 + jc notwaitingheli + mov pointermode,2 + mov watchingtime,0 + ret +notwaitingheli: mov pointermode,0 + mov watchingtime,2 + ret + +heliwon: mov pointermode,0 + ret + + endp + + +Mugger proc near + + mov ax,[es:bx+3] + cmp ax,138 + jz endmugger1 + cmp ax,176 + jz endmugger2 + cmp ax,2 + jnz havesetwatch + mov watchingtime,175*2 +havesetwatch: call checkspeed + jnz notmugger + inc word ptr [es:bx+3] +notmugger: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + +endmugger1: push es bx + call createpanel2 + call showicon + mov al,41 + call findpuztext + mov di,33+20 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreen + mov cx,300 + call hangon + pop bx es + push es bx + mov word ptr [es:bx+3],140 + mov manspath,2 + mov finaldest,2 + call findxyfrompath + mov resetmanxy,1 + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + call makemainscreen + mov al,48 + mov bl,68-32 + mov bh,54+64 + mov cx,70 ; time on screen + mov dx,10 ; pause before show + call setuptimeduse + mov beenmugged,1 + pop bx es + ret + +endmugger2: ret + + + endp + + + + + + + + +Aide proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Businessman proc near + + mov pointermode,0 + mov watchingtime,2 + mov ax,[es:bx+3] + cmp ax,2 + jnz notfirstbiz + push ax bx es + mov al,49 + mov cx,30 + mov dx,1 + mov bl,68 + mov bh,174 + call setuptimeduse + pop es bx ax + +notfirstbiz: cmp ax,95 + jz buscombatwonend + cmp ax,49 + jz buscombatend + + call checkspeed + jnz busspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,48 + jnz notbeforedeadb + mov mandead,2 + jmp gotbusframe + +notbeforedeadb: cmp ax,15 + jnz buscombatwon + dec ax + cmp lastweapon,3 + jnz notshieldonbus + mov lastweapon,-1 + mov combatcount,0 + mov ax,51 + jmp gotbusframe +notshieldonbus: inc combatcount + cmp combatcount,20 + jnz gotbusframe + mov combatcount,0 + mov ax,15 + jmp gotbusframe + +buscombatwon: cmp ax,91 + jnz gotbusframe + push bx es + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,3 + call turnpathoff + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + pop es bx + mov ax,92 + jmp gotbusframe + +gotbusframe: mov [es:bx+3],ax +busspeed: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,14 + jnz buscombatend + mov watchingtime,0 + mov pointermode,2 + ret + +buscombatend: ret + +buscombatwonend: mov pointermode,0 + mov watchingtime,0 + ret + + endp + + + + + + +Poolguard proc near + + mov ax,[es:bx+3] + cmp ax,214 + jz combatover2 + cmp ax,258 + jz combatover2 + cmp ax,185 + jz combatover1 + cmp ax,0 + jnz notfirstpool + mov al,0 + call turnpathon +notfirstpool: call checkspeed + jnz guardspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,122 + jnz notendguard1 + dec ax + cmp lastweapon,2 + jnz notaxeonpool + mov lastweapon,-1 + mov ax,122 + jmp gotguardframe +notaxeonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,195 + jmp gotguardframe + +notendguard1: cmp ax,147 + jnz gotguardframe + dec ax + cmp lastweapon,1 + jnz notgunonpool + mov lastweapon,-1 + mov ax,147 + jmp gotguardframe +notgunonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,220 + +gotguardframe: mov [es:bx+3],ax +guardspeed: call showgamereel + mov ax,[es:bx+3] + cmp ax,121 + jz iswaitingpool + cmp ax,146 + jz iswaitingpool + mov pointermode,0 + mov watchingtime,2 + ret +iswaitingpool: mov pointermode,2 + mov watchingtime,0 + ret + +combatover1: mov watchingtime,0 + mov pointermode,0 + mov al,0 + call turnpathon + mov al,1 + call turnpathoff + ret + +combatover2: call showgamereel + mov watchingtime,2 + mov pointermode,0 + inc combatcount + cmp combatcount,100 + jc doneover2 + mov watchingtime,0 + mov mandead,2 +doneover2: ret + + endp + + + + + + + + + + +Security proc near + + cmp word ptr [es:bx+3],32 + jz securwait + cmp word ptr [es:bx+3],69 + jnz notaftersec + ret +notaftersec: mov watchingtime,10 + call checkspeed + jnz gotsecurframe + inc word ptr [es:bx+3] + jmp gotsecurframe +securwait: cmp lastweapon,1 + jnz gotsecurframe + mov watchingtime,10 + cmp manspath,9 + jnz gotsecurframe + cmp facing,0 + jnz gotsecurframe + mov lastweapon,-1 + inc word ptr [es:bx+3] +gotsecurframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Heavy proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + cmp word ptr [es:bx+3],43 + jz heavywait + mov watchingtime,10 + cmp word ptr [es:bx+3],70 + jnz notafterhshot + inc combatcount + cmp combatcount,80 + jnz gotheavyframe + mov mandead,2 + jmp gotheavyframe +notafterhshot: call checkspeed + jnz gotheavyframe + inc word ptr [es:bx+3] + jmp gotheavyframe +heavywait: cmp lastweapon,1 + jnz gotheavyframe + cmp manspath,5 + jnz gotheavyframe + cmp facing,4 + jnz gotheavyframe + mov lastweapon,-1 + inc word ptr [es:bx+3] + mov combatcount,0 +gotheavyframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + +Bossman proc near + + call checkspeed + jnz notboss + mov ax,[es:bx+3] + inc ax + cmp ax,4 + jz firstdes + cmp ax,20 + jz secdes + cmp ax,41 + jnz gotallboss + mov ax,0 + inc gunpassflag + mov byte ptr [es:bx+7],10 + jmp gotallboss +firstdes: cmp gunpassflag,1 + jz gotallboss + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,10 + jc gotallboss + mov ax,0 + jmp gotallboss +secdes: cmp gunpassflag,1 + jz gotallboss + mov ax,0 +gotallboss: mov [es:bx+3],ax +notboss: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedboss + mov talkedtoboss,1 +nottalkedboss: ret + + endp + + + + + +Gamer proc near + + call checkspeed + jnz gamerfin +gameragain: call randomnum1 + and al,7 + cmp al,5 + jnc gameragain + add al,20 + cmp al,[es:bx+3] + jz gameragain + mov ah,0 + mov [es:bx+3],ax +gamerfin: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Sparkydrip proc near + + call checkspeed + jnz cantdrip + mov al,14 + mov ah,0 + call playchannel0 +cantdrip: ret + + endp + + + +Carparkdrip proc near + + call checkspeed + jnz cantdrip2 + mov al,14 + call playchannel1 +cantdrip2: ret + + endp + + + +Keeper proc near + + cmp keeperflag,0 + jnz notwaiting + cmp reeltowatch,190 + jc waiting + inc keeperflag + mov ah,[es:bx+7] + and ah,127 + cmp ah,dreamnumber + jz notdiff + mov al,dreamnumber + mov [es:bx+7],al +notdiff: ret +notwaiting: call addtopeoplelist + call showgamereel +waiting: ret + + endp + + + +Candles1 proc near + + call checkspeed + jnz candle1 + mov ax,[es:bx+3] + inc ax + cmp ax,44 + jnz notendcandle1 + mov ax,39 +notendcandle1: mov [es:bx+3],ax +candle1: call showgamereel + ret + + endp + + + +Smallcandle proc near + + call checkspeed + jnz smallcandlef + mov ax,[es:bx+3] + inc ax + cmp ax,37 + jnz notendsmallcandle + mov ax,25 +notendsmallcandle: mov [es:bx+3],ax +smallcandlef: call showgamereel + ret + + endp + + + + + + + + + + + +Intromagic1 proc near + + call checkspeed + jnz introm1fin + mov ax,[es:bx+3] + inc ax + cmp ax,145 + jnz gotintrom1 + mov ax,121 +gotintrom1: mov [es:bx+3],ax + cmp ax,121 + jnz introm1fin + inc introcount + push es bx + call intro1text + pop bx es + cmp introcount,8 ; was 7 + jnz introm1fin + add mapy,10 + mov nowinnewroom,1 +introm1fin: call showgamereel + ret + + endp + + + + +Candles proc near + + call checkspeed + jnz candlesfin + mov ax,[es:bx+3] + inc ax + cmp ax,167 + jnz gotcandles + mov ax,162 +gotcandles: mov [es:bx+3],ax +candlesfin: call showgamereel + ret + + endp + + + +Candles2 proc near + + call checkspeed + jnz candles2fin + mov ax,[es:bx+3] + inc ax + cmp ax,238 + jnz gotcandles2 + mov ax,233 +gotcandles2: mov [es:bx+3],ax +candles2fin: call showgamereel + ret + + endp + + + +Gates proc near + + call checkspeed + jnz gatesfin + mov ax,[es:bx+3] + inc ax + cmp ax,116 + jnz notbang + push ax bx es + mov al,17 ;12 + call playchannel1 + pop es bx ax +notbang: cmp ax,110 + jc slowgates + mov byte ptr [es:bx+5],2 +slowgates: cmp ax,120 + jnz gotgates + mov getback,1 + mov ax,119 +gotgates: mov [es:bx+3],ax + push es bx + call intro3text + pop bx es +gatesfin: call showgamereel + ret + + endp + + + + +Intromagic2 proc near + + call checkspeed + jnz introm2fin + mov ax,[es:bx+3] + inc ax + cmp ax,216 + jnz gotintrom2 + mov ax,192 +gotintrom2: mov [es:bx+3],ax +introm2fin: call showgamereel + ret + + endp + + + + +Intromagic3 proc near + + call checkspeed + jnz introm3fin + mov ax,[es:bx+3] + inc ax + cmp ax,218 + jnz gotintrom3 + mov getback,1 +gotintrom3: mov [es:bx+3],ax +introm3fin: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + + endp + + + + + + + +Intromonks1 proc near + + call checkspeed + jnz intromonk1fin + mov ax,[es:bx+3] + inc ax + cmp ax,80 + jnz notendmonk1 + add mapy,10 + mov nowinnewroom,1 + call showgamereel + ret +notendmonk1: cmp ax,30 + jnz gotintromonk1 + sub mapy,10 + mov nowinnewroom,1 + mov ax,51 +gotintromonk1: mov [es:bx+3],ax + cmp ax,5 + jz waitstep + cmp ax,15 + jz waitstep + cmp ax,25 + jz waitstep + cmp ax,61 + jz waitstep + cmp ax,71 + jz waitstep + jmp intromonk1fin +waitstep: push es bx + call intro2text + pop bx es + mov byte ptr [es:bx+6],-20 +intromonk1fin: call showgamereel + mov al,mapy + mov [es:bx+2],al + ret + + endp + + + + +Intromonks2 proc near + + call checkspeed + jnz intromonk2fin + mov ax,[es:bx+3] + inc ax + cmp ax,87 + jnz nottalk1 + inc introcount + push es bx + call monks2text + pop bx es + cmp introcount,19 + jnz notlasttalk1 + mov ax,87 + jmp gotintromonk2 +notlasttalk1: mov ax,74 + jmp gotintromonk2 + +nottalk1: cmp ax,110 + jnz notraisearm + inc introcount + push es bx + call monks2text + pop bx es + if cd + if german + cmp introcount,42 + else + cmp introcount,35 + endif + else + cmp introcount,35 + endif + jnz notlastraise + mov ax,111 + jmp gotintromonk2 +notlastraise: mov ax,98 + jmp gotintromonk2 + +notraisearm: cmp ax,176 + jnz notendmonk2 + mov getback,1 + jmp gotintromonk2 +notendmonk2: cmp ax,125 + jnz gotintromonk2 + mov ax,140 +gotintromonk2: mov [es:bx+3],ax +intromonk2fin: call showgamereel + ret + + endp + + + + + +Handclap proc near + + ret + + endp + + + + + if german + if cd + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,5 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,9 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,13 + jnz notmonk2text4 + mov introcount,14 + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,23 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,27 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: cmp introcount,30 + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,35 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + + endif + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + endif + + + + + + +Intro1text proc near + + cmp introcount,2 + jnz notintro1text1 + mov al,40 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text1: cmp introcount,4 + jnz notintro1text2 + mov al,41 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text2: cmp introcount,6 + jnz notintro1text3 + mov al,42 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text3: ret + +gotintro1text: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk2 + dec introcount + ret + endif +oktalk2: call setuptimedtemp + ret + + endp + + + +Intro2text proc near + + cmp ax,5 + jnz notintro2text1 + mov al,43 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text1: cmp ax,15 + jnz notintro2text2 + mov al,44 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text2: ret + +gotintro2text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + +Intro3text proc near + + cmp ax,107 + jnz notintro3text1 + mov al,45 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text1: if cd + cmp ax,108 + else + cmp ax,109 + endif + jnz notintro3text2 + mov al,46 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text2: ret + +gotintro3text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + + +Monkandryan proc near + + call checkspeed + jnz notmonkryan + mov ax,[es:bx+3] + inc ax + cmp ax,83 + jnz gotmonkryan + inc introcount + push es bx + call textformonk + pop bx es + mov ax,77 + cmp introcount,57 + jnz gotmonkryan + mov getback,1 + ret +gotmonkryan: mov [es:bx+3],ax +notmonkryan: call showgamereel + ret + + endp + + + + + +Endgameseq proc near + + call checkspeed + jnz notendseq + mov ax,[es:bx+3] + inc ax + cmp ax,51 + jnz gotendseq + cmp introcount,140 + jz gotendseq + inc introcount + push es bx + call textforend + pop bx es + mov ax,50 +gotendseq: mov [es:bx+3],ax + cmp ax,134 + jnz notfadedown + push es bx ax + call fadescreendownhalf + pop ax bx es + jmp notendseq +notfadedown: cmp ax,324 + jnz notfadeend + push es bx ax + call fadescreendowns + mov volumeto,7 + mov volumedirection,1 + pop ax bx es +notfadeend: cmp ax,340 + jnz notendseq + mov getback,1 +notendseq: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,145 + jnz notendcreds + mov word ptr [es:bx+3],146 + call rollendcredits +notendcreds: ret + + endp + + + + + + +Rollendcredits proc near + + mov al,16 + mov ah,255 + call playchannel0 + mov volume,7 + mov volumeto,0 + mov volumedirection,-1 + + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,3*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,254 +endcredits1: push cx + + mov bx,10 + mov cx,linespacing +endcredits2: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot: push cx + mov di,75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + call multidump + + pop bx es di si cx + dec bx + loop endcredits2 + pop cx +looknext: mov al,[es:si] + inc si + cmp al,":" + jz gotnext + cmp al,0 + jz gotnext + jmp looknext +gotnext: loop endcredits1 + + mov cx,100 + call hangon + call paneltomap + call fadescreenuphalf + ret + + endp + + + + + + +Priest proc near + + cmp word ptr [es:bx+3],8 + jz priestspoken + mov pointermode,0 + mov watchingtime,2 + call checkspeed + jnz priestwait + inc word ptr [es:bx+3] + push es bx + call priesttext + pop bx es +priestwait: ret + +priestspoken: ret + + endp + + + + + + +Madmanstelly proc near + + mov ax,[es:bx+3] + inc ax + cmp ax,307 + jnz notendtelly + mov ax,300 +notendtelly: mov [es:bx+3],ax + call showgamereel + ret + + endp + + + + + +Madman proc near + + mov watchingtime,2 + call checkspeed + jnz nomadspeed + mov ax,[es:bx+3] + cmp ax,364 + jnc ryansded + cmp ax,10 + jnz notfirstmad + push es bx ax + mov dx,offset cs:introtextname + call loadtemptext + pop ax bx es + mov combatcount,-1 + mov speechcount,0 +notfirstmad: inc ax + cmp ax,294 + jz madmanspoken + cmp ax,66 + jnz nomadspeak + inc combatcount + push es bx + call madmantext + pop bx es + mov ax,53 + if cd + cmp combatcount,64 + else + cmp combatcount,62 + endif + jc nomadspeak + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jz killryan + cmp lastweapon,8 + jnz nomadspeak + if cd + mov combatcount,72 + else + mov combatcount,70 + endif + mov lastweapon,-1 + mov madmanflag,1 + mov ax,67 + jmp nomadspeak +killryan: mov ax,310 +nomadspeak: mov [es:bx+3],ax +nomadspeed: call showgamereel + mov al,mapx + mov [es:bx+1],al + call madmode + ret +madmanspoken: cmp wongame,1 + jz alreadywon + mov wongame,1 + push es bx + call getridoftemptext + pop bx es +alreadywon: ret + +ryansded: mov mandead,2 + call showgamereel + ret + + endp + + + + + + + + + + if cd +Madmantext proc near + + cmp speechcount,63 + jnc nomadtext + cmp ch1playing,255 + jnz nomadtext + + mov al,speechcount + inc speechcount + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + + else + +Madmantext proc near + + cmp combatcount,61 + jnc nomadtext + mov al,combatcount + and al,3 + jnz nomadtext + mov al,combatcount + shr al,1 + shr al,1 + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + endif + + + + +Madmode proc near + + mov watchingtime,2 + mov pointermode,0 + if cd + cmp combatcount,65 + else + cmp combatcount,63 + endif + jc iswatchmad + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jnc iswatchmad + mov pointermode,2 +iswatchmad: ret + + endp + + + + + +Priesttext proc near + + cmp word ptr [es:bx+3],2 + jc nopriesttext + cmp word ptr [es:bx+3],7 + jnc nopriesttext + mov al,[es:bx+3] + and al,1 + jnz nopriesttext + mov al,[es:bx+3] + shr al,1 + add al,50 + mov bl,72 + mov bh,80 + mov cx,54 + mov dx,1 + call setuptimeduse +nopriesttext: ret + + endp + + + + +Textforend proc near + + cmp introcount,20 + jnz notendtext1 + mov al,0 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext1: if cd + cmp introcount,50 + else + cmp introcount,65 + endif + jnz notendtext2 + mov al,1 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext2: if cd + cmp introcount,85 + else + cmp introcount,110 + endif + jnz notendtext3 + mov al,2 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext3: ret + +gotendtext: mov dx,1 + mov ah,83 + call setuptimedtemp + ret + + endp + + + + + + + + +Textformonk proc near + + cmp introcount,1 + jnz notmonktext1 + mov al,19 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext1: cmp introcount,5 + jnz notmonktext2 + mov al,20 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext2: cmp introcount,9 + jnz notmonktext3 + mov al,21 + mov bl,48 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext3: cmp introcount,13 + jnz notmonktext4 + mov al,22 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext4: if cd + cmp introcount,15 + else + cmp introcount,17 + endif + jnz notmonktext5 + mov al,23 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext5: cmp introcount,21 + jnz notmonktext6 + mov al,24 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext6: cmp introcount,25 + jnz notmonktext7 + mov al,25 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext7: cmp introcount,29 + jnz notmonktext8 + mov al,26 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext8: cmp introcount,33 + jnz notmonktext9 + mov al,27 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext9: cmp introcount,37 + jnz notmonktext10 + mov al,28 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext10: cmp introcount,41 + jnz notmonktext11 + mov al,29 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext11: cmp introcount,45 + jnz notmonktext12 + mov al,30 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext12: if cd + cmp introcount,52 + else + cmp introcount,49 + endif + jnz notmonktext13 + mov al,31 + mov bl,68 + mov bh,154 + mov cx,220 ;132 + jmp gotmonktext +notmonktext13: cmp introcount,53 + jnz notendtitles + call fadescreendowns + if cd + mov volumeto,7 + mov volumedirection,1 + endif +notendtitles: ret + +gotmonktext: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk + dec introcount + ret + endif +oktalk: call setuptimedtemp + ret + + endp + + + + + + + + + + +Drunk proc near + + cmp generaldead,0 + jnz trampgone + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist +trampgone: ret + + endp + + +Advisor proc near + + call checkspeed + jnz noadvisor + jmp noadvisor + mov ax,[es:bx+3] + inc ax + cmp ax,123 + jnz notendadvis + mov ax,106 + jmp gotadvframe +notendadvis: cmp ax,108 + jnz gotadvframe + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,3 + jc gotadvframe + mov ax,106 +gotadvframe: mov [es:bx+3],ax +noadvisor: call showgamereel + call addtopeoplelist + ret + + endp + + + +Copper proc near + + call checkspeed + jnz nocopper + mov ax,[es:bx+3] + inc ax + cmp ax,94 + jnz notendcopper + mov ax,64 + jmp gotcopframe +notendcopper: cmp ax,81 + jz mightwait + cmp ax,66 + jnz gotcopframe +mightwait: push ax + call randomnumber + mov cl,al + pop ax + cmp cl,7 + jc gotcopframe + dec ax +gotcopframe: mov [es:bx+3],ax +nocopper: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Sparky proc near + + cmp card1money,0 + jz animsparky + mov byte ptr [es:bx+7],3 + jmp animsparky + +animsparky: call checkspeed + jnz finishsparky + cmp word ptr [es:bx+3],34 + jnz notsparky1 + call randomnumber + cmp al,30 + jc dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +notsparky1: cmp word ptr [es:bx+3],48 + jnz dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +dosparky: inc word ptr [es:bx+3] +finishsparky: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedsparky + mov talkedtosparky,1 +nottalkedsparky: ret + + endp + + + + + +Train proc near + + ret + mov ax,[es:bx+3] + cmp ax,21 + jnc notrainyet + inc ax + jmp gottrainframe +notrainyet: call randomnumber + cmp al,253 + jc notrainatall + cmp manspath,5 + jnz notrainatall + cmp finaldest,5 + jnz notrainatall + mov ax,5 +gottrainframe: mov [es:bx+3],ax + call showgamereel +notrainatall: ret + + endp + + + + + + + +Addtopeoplelist proc near + + push es bx bx + mov cl,[es:bx+7] + mov ax,[es:bx+3] + mov bx,listpos + mov es,buffers + mov [es:bx],ax ;reel pointer position + pop ax + mov [es:bx+2],ax + mov [es:bx+4],cl ;coversation number + pop bx es + add listpos,5 + ret + + endp + + + +Showgamereel proc near + + mov ax,[es:bx+3] + cmp ax,512 + jnc noshow + mov reelpointer,ax + push es bx + call plotreel + pop bx es + mov ax,reelpointer + mov [es:bx+3],ax +noshow: ret + + endp + + + + + + +Checkspeed proc near + + cmp lastweapon,-1 + jnz forcenext + inc byte ptr [es:bx+6] + mov al,[es:bx+6] + cmp al,[es:bx+5] + jnz notspeed + mov al,0 + mov [es:bx+6],al + cmp al,al +notspeed: ret + +forcenext: cmp al,al + ret + + endp + + + + + + + + + + +;------------------------------------------------------------Sprite Routines---- + + + +Clearsprites proc near + + mov es,buffers + mov di,spritetable + mov al,255 + mov cx,tablesize*16 + rep stosb + ret + + endp + + + + +Makesprite proc near ;si holds x,y cx holds update + ;di,dx holds data offset,seg + mov es,buffers + mov bx,spritetable +$17: cmp byte ptr [es:bx+15],255 + jz $17a + add bx,tablesize + jmp $17 + +$17a: mov [es:bx],cx + mov [es:bx+10],si + mov [es:bx+6],dx + mov [es:bx+8],di + mov [es:bx+2],0ffffh + mov byte ptr [es:bx+15],0 + mov byte ptr [es:bx+18],0 + ret + + endp + + + + + + + + + + +Delsprite proc near + + mov di,bx + mov cx,tablesize + mov al,255 + rep stosb + ret + + endp + + + + + + + + + + +Spriteupdate proc near + + mov es,buffers + mov bx,spritetable + mov al,ryanon + mov byte ptr [es:bx+31],al + + mov es,buffers + mov bx,spritetable + mov cx,16 +$18: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz $18a + push es ds + mov cx,[es:bx+2] + mov [es:bx+24],cx + call ax + pop ds es +$18a: pop bx cx + cmp nowinnewroom,1 + jz $18b + add bx,tablesize + loop $18 + +$18b: ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Printsprites proc near + + mov es,buffers + mov cx,0 +priorityloop: push cx + mov priority,cl + mov bx,spritetable + mov cx,16 +prtspriteloop: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz skipsprite + mov al,priority + cmp al,[es:bx+23] + jnz skipsprite + cmp byte ptr [es:bx+31],1 + jz skipsprite + call printasprite +skipsprite: pop bx cx + add bx,tablesize + loop prtspriteloop + pop cx + inc cx + cmp cx,7 + jnz priorityloop + ret + + endp + + + + + + + + + + +Printasprite proc near + + push es bx + mov si,bx + mov ds,[es:si+6] + mov al,[es:si+11] + mov ah,0 + cmp al,220 + jc notnegative1 + mov ah,255 +notnegative1: mov bx,ax + add bx,mapady + mov al,[es:si+10] + mov ah,0 + cmp al,220 + jc notnegative2 + mov ah,255 +notnegative2: mov di,ax + add di,mapadx + mov al,[es:si+15] + mov ah,0 + cmp byte ptr [es:si+30],0 + jz steadyframe + mov ah,8 +steadyframe: cmp priority,6 + jnz notquickp +notquickp: call showframe + pop bx es + ret + + endp + + + + +;cmp priority,6 +; ;jz quicksprite ; WIll NEED TO DO THIS LATER!!!!! +;Quicksprite: mov cl,al +; mov ch,0 +; mov dx,[es:bx+6] +; mov es,workspace +; mov ds,dx +; mov bx,ax +; mov dx,vgawidth +; +;printquickloop: push di si +; +; push si +; add si,cx +; dec si +; jmp startzero +;zeroloop: dec si +; dec cl +;startzero: cmp [si],ch +; jz zeroloop +; pop si +; +;;printquickline: cmp [si],ch +; jnz foundfirstpix +; inc si +; inc di +; dec cl +; jnz printquickline +; +;foundfirstpix: cmp cl,0 +; jz finquickspr +; rep movsb +; +;finquickspr: pop si di +; mov cl,bl +; add si,cx +; add di,dx +; dec bh +; jnz printquickloop +; +; pop bx ds es +; ret + + + + + + + +;Calcframe proc near +; +; ret +; +; mov al,[es:bx+15] +; mov ah,0 +; mov cx,6 +; mul cx +; add ax,[es:bx+8] +; +; mov dx,[es:bx+6] +; push bx +; mov ds,dx +; mov bx,ax +; mov ax,[bx] +; mov cx,[bx+2] +; mov dx,[bx+4] +; pop bx +; mov [es:bx+2],ax +; add cx,[es:bx+8] +; add cx,2080 +; mov [es:bx+4],cx ;calculates frame data +; +; mov al,[es:bx+10] ;this bit calculates the actual +; add al,dl ;x and y (including any offset) +; mov [es:bx+12],al +; mov al,[es:bx+11] +; add al,dh +; mov [es:bx+13],al +; ret +; +; endp + + + + + + + + + + + + + + + + + + + + +Checkone proc near ;cx=x,y to check + + push cx + mov al,ch + mov ah,0 + mov cl,4 + shr ax,cl + mov dl,al + pop cx + mov al,cl + mov ah,0 + mov cl,4 + shr ax,cl + mov ah,dl ; al,ah holds x,y in blocks + + push ax + mov ch,0 + mov cl,al + push cx + mov al,ah + mov ah,0 + mov cx,11 + mul cx + pop cx + add ax,cx + + mov cx,3 + mul cx + mov si,ax + + mov ds,buffers + add si,mapflags + lodsw + mov cx,ax + lodsb + pop dx + ret + + + endp + + + + + + + + + + + + + + + + + + +Findsource proc near + + mov ax,currentframe + cmp ax,160 + jnc over1000 + mov ds,reel1 + mov takeoff,0 + ret +over1000: cmp ax,320 + jnc over1001 + mov ds,reel2 + mov takeoff,160 + ret +over1001: mov ds,reel3 + mov takeoff,320 + ret + + endp + + + + + + + + + + + +;---------------------------------------------------------Routines for Ryan---- + + +Initman proc near + + ;mov linepointer,254 + mov al,ryanx + mov ah,ryany + mov si,ax + mov cx,offset cs:mainman + mov dx,mainsprites + mov di,0 + call makesprite + mov byte ptr [es:bx+23],4 + mov byte ptr [es:bx+22],0 + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + +Mainman proc near + + cmp resetmanxy,1 + jnz notinnewroom + mov resetmanxy,0 + mov al,ryanx + mov ah,ryany + mov [es:bx+10],ax + mov byte ptr [es:bx+29],0 + jmp executewalk +notinnewroom: dec byte ptr [es:bx+22] + cmp byte ptr [es:bx+22],-1 + jz executewalk + ret + + +executewalk: mov byte ptr [es:bx+22],0 ; speed + mov al,turntoface + cmp al,facing + jz facingok + call aboutturn + jmp notwalk + +facingok: cmp turndirection,0 + jz alreadyturned + cmp linepointer,254 + jnz alreadyturned + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz alreadyturned + call checkforexit +alreadyturned: mov turndirection,0 + cmp linepointer,254 + jnz walkman + mov byte ptr [es:bx+29],0 + jmp notwalk + +walkman: mov al,[es:bx+29] + inc al + cmp al,11 + jnz notanimend1 + mov al,1 +notanimend1: mov [es:bx+29],al + + call walking + cmp linepointer,254 + jz afterwalk + + mov al,facing + and al,1 + jz isdouble + mov al,[es:bx+29] + cmp al,2 + jz afterwalk + cmp al,7 + jz afterwalk +isdouble: call walking +afterwalk: cmp linepointer,254 + jnz notwalk + mov al,turntoface + cmp al,facing + jnz notwalk + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz notwalk + call checkforexit + +notwalk: mov al,facing + mov ah,0 + mov di,offset cs:facelist + add di,ax + mov al,[cs:di] + add al,[es:bx+29] + mov [es:bx+15],al + mov ax,[es:bx+10] + mov ryanx,al + mov ryany,ah + ret + +facelist: db 0,60,33,71,11,82,22,93 + + endp + + + + + + + + + + +Aboutturn proc near + + cmp turndirection,1 + jz incdir + cmp turndirection,-1 + jz decdir + mov al,facing + sub al,turntoface + jnc higher + neg al + cmp al,4 + jnc decdir + jmp incdir +higher: cmp al,4 + jnc incdir + jmp decdir + +incdir: mov turndirection,1 + mov al,facing + inc al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + +decdir: mov turndirection,-1 + mov al,facing + dec al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + + +Walking proc near + + cmp linedirection,0 + jz normalwalk + mov al,linepointer + dec al + mov linepointer,al + cmp al,200 + jnc endofline + jmp continuewalk + +normalwalk: mov al,linepointer + inc al + mov linepointer,al + cmp al,linelength + jnc endofline + +continuewalk: mov ah,0 + add ax,ax + push es bx + mov dx,seg linedata + mov es,dx + mov bx,offset es:linedata + add bx,ax + mov ax,[es:bx] + pop bx es +stillline: mov [es:bx+10],ax + ret + +endofline: mov linepointer,254 + mov al,destination + mov manspath,al + cmp al,finaldest + jz finishedwalk + mov al,finaldest + mov destination,al + push es bx + call autosetwalk + pop bx es + ret + +finishedwalk: call facerightway + ret + + endp + + + + + + + +Facerightway proc near + + push es bx ;Face object when finished + call getroomspaths ;walking + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+7] + mov turntoface,al + mov leavedirection,al + pop bx es + ret + + endp + + + + + + + +Checkforexit proc near + + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + mov lastflag,cl + mov lastflagex,ch + mov flagx,dl + mov flagy,dh + mov al,lastflag + + test al,64 + jz notnewdirect + mov al,lastflagex + mov autolocation,al + ret + +notnewdirect: test al,32 + jz notleave + push es bx + cmp reallocation,2 + jnz notlouis + mov bl,0 + push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call isryanholding + pop bx + jz noshoe1 + inc bl +noshoe1: push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call isryanholding + pop bx + jz noshoe2 + inc bl +noshoe2: cmp bl,2 + jz notlouis + mov al,42 + cmp bl,0 + jz notravmessage + inc al +notravmessage: mov cx,80 + mov dx,10 + mov bl,68 + mov bh,64 + call setuptimeduse + mov al,facing + add al,4 + and al,7 + mov turntoface,al + pop bx es + ret + +notlouis: pop bx es + mov needtotravel,1 + ret + + + +notleave: test al,4 + jz notaleft + call adjustleft + ret + +notaleft: test al,2 + jz notaright + call adjustright + ret + +notaright: test al,8 + jz notadown + call adjustdown + ret + +notadown: test al,16 + jz notanup + call adjustup + ret + +notanup: ret + + endp + + + + + +Adjustdown proc near + + push es bx + add mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + +Adjustup proc near + + push es bx + sub mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Adjustleft proc near + + push es bx + mov lastflag,0 + sub mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + + +Adjustright proc near + + push es bx + add mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + sub al,2 + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Reminders proc nar + + cmp reallocation,24 + jnz notinedenslift + cmp mapx,44 + jnz notinedenslift + cmp progresspoints,0 + jnz notfirst + mov al,"D" + mov ah,"K" + mov cl,"E" + mov ch,"Y" + call isryanholding + jz forgotone + mov al,"C" + mov ah,"S" + mov cl,"H" + mov ch,"R" + call findexobject + cmp al,numexobjects + jz forgotone + mov ax,[es:bx+2] + cmp al,4 + jnz forgotone ;card is in inventory + cmp ah,255 + jz havegotcard ;card must be in an ex + mov cl,"P" ;object + mov ch,"U" + mov dl,"R" + mov dh,"S" + xchg al,ah + call compare + jnz forgotone ;is it in wallet? +havegotcard: inc progresspoints +notfirst: ret + +forgotone: mov al,50 ;message number + mov bl,54 ;x pos of message + mov bh,70 ;and y pos + mov cx,48 ;time on screen + mov dx,8 ;pause before show + call setuptimeduse + ret +notinedenslift: ret + + endp + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for rain effect +; +;--------------------------------------------------------------------------- + + + + +Initrain proc near + + mov es,buffers + mov di,rainlist + mov bx,offset cs:rainlocations +checkmorerain: mov al,[cs:bx] + cmp al,255 + jz finishinitrain + cmp al,reallocation + jnz checkrain + mov al,[cs:bx+1] + cmp al,mapx + jnz checkrain + mov al,[cs:bx+2] + cmp al,mapy + jnz checkrain + mov al,[cs:bx+3] + mov rainspace,al + jmp dorain +checkrain: add bx,4 + jmp checkmorerain + +dorain: mov cx,4 +initraintop: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initraintop + add cl,al + cmp cl,mapxsize + jnc initrainside + push cx + call splitintolines + pop cx + jmp initraintop + +initrainside: mov cl,mapxsize + dec cl +initrainside2: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initrainside2 + add ch,al + cmp ch,mapysize + jnc finishinitrain + push cx + call splitintolines + pop cx + jmp initrainside2 +finishinitrain: mov al,255 + stosb + ret + +rainlocations: db 1,44,10,16 ;location,map x,y,seed + db 4,11,30,14 + db 4,22,30,14 + db 3,33,10,14 + db 10,33,30,14 + db 10,22,30,24 + db 9,22,10,14 + db 2,33,0,14 + db 2,22,0,14 + db 6,11,30,14 + db 7,11,20,18 + db 7,0,20,18 + db 7,0,30,18 + db 55,44,0,14 + db 5,22,30,14 + + db 8,0,10,18 + db 8,11,10,18 + db 8,22,10,18 + db 8,33,10,18 + db 8,33,20,18 + db 8,33,30,18 + db 8,33,40,18 + db 8,22,40,18 + db 8,11,40,18 + + db 21,44,20,18 + db 255 + + endp + + + + + + + + + + +Splitintolines proc near + + +lookforlinestart: call getblockofpixel + cmp al,0 + jnz foundlinestart + dec cl + inc ch + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +foundlinestart: mov [es:di],cx + mov bh,1 +lookforlineend: call getblockofpixel + cmp al,0 + jz foundlineend + dec cl + inc ch + cmp cl,0 + jz foundlineend + cmp ch,mapysize + jnc foundlineend + inc bh + jmp lookforlineend + +foundlineend: push cx + mov [es:di+2],bh + call randomnumber + mov [es:di+3],al + call randomnumber + mov [es:di+4],al + call randomnumber + and al,3 + add al,4 + mov [es:di+5],al + add di,6 + pop cx + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +endofthisline: ret + + endp + + + + +Getblockofpixel proc near + + push cx es di + mov ax,mapxstart + add cl,al + mov ax,mapystart + add ch,al + call checkone + and cl,1 + jnz failrain + pop di es cx + ret +failrain: pop di es cx + mov al,0 + ret + + endp + + + + +Showrain proc near + + mov ds,mainsprites + mov si,6*58 + mov ax,[si+2] + mov si,ax + add si,2080 + + mov bx,rainlist + mov es,buffers + cmp byte ptr [es:bx],255 + jz nothunder + +morerain: mov es,buffers + cmp byte ptr [es:bx],255 + jz finishrain + + mov al,[es:bx+1] + mov ah,0 + add ax,mapady + add ax,mapystart + mov cx,320 + mul cx + mov cl,[es:bx] + mov ch,0 + add ax,cx + add ax,mapadx + add ax,mapxstart + mov di,ax + + mov cl,[es:bx+2] + mov ch,0 + mov ax,[es:bx+3] + mov dl,[es:bx+5] + mov dh,0 + sub ax,dx + and ax,511 + mov [es:bx+3],ax + add bx,6 + + push si + add si,ax + mov es,workspace + mov ah,0 + mov dx,320-2 +rainloop: lodsb + cmp al,ah + jz noplot + stosb + add di,dx + loop rainloop + pop si + jmp morerain +noplot: add di,320-1 + loop rainloop + pop si + jmp morerain + +finishrain: cmp ch1blockstocopy,0 + jnz nothunder + cmp reallocation,2 + jnz notlouisthund + cmp beenmugged,1 + jnz nothunder +notlouisthund: cmp reallocation,55 + jz nothunder + call randomnum1 + cmp al,1 + jnc nothunder + mov al,7 + cmp ch0playing,6 + jz isthunder1 + mov al,4 +isthunder1: call playchannel1 +nothunder: ret + + endp + + + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for background objects +; +;--------------------------------------------------------------------------- + + + + + + +Backobject proc near + + mov ds,setdat + mov di,[es:bx+20] + + mov al,[es:bx+18] + cmp al,0 + jz $48z + dec al + mov [es:bx+18],al + jmp finishback + +$48z: mov al,[di+7] + mov [es:bx+18],al + mov al,[di+8] + cmp al,6 + jnz notwidedoor + call widedoor + jmp finishback + +notwidedoor: cmp al,5 + jnz notrandom + call random + jmp finishback + +notrandom: cmp al,4 + jnz notlockdoor + call lockeddoorway + jmp finishback + +notlockdoor: cmp al,3 + jnz notlift + call liftsprite + jmp finishback + +notlift: cmp al,2 + jnz notdoor + call doorway + jmp finishback + +notdoor: cmp al,1 + jnz steadyob + call constant + jmp finishback + +steadyob: call steady + +finishback: ;call calcframe + ret + + endp + + + + + + + + + +Liftsprite proc near + + mov al,liftflag + cmp al,0 + jz liftclosed + cmp al,1 + jz liftopen + cmp al,3 + jz openlift + + mov al,[es:bx+19] + cmp al,0 + jz finishclose + dec al + cmp al,11 + jnz pokelift + push ax + mov al,3 + call liftnoise + pop ax + jmp pokelift +finishclose: mov liftflag,0 + ret + +openlift: mov al,[es:bx+19] + cmp al,12 + jz endoflist + inc al + cmp al,1 + jnz pokelift + push ax + mov al,2 + call liftnoise + pop ax +pokelift: mov [es:bx+19],al + mov ah,0 + push di + add di,ax + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + ret + +endoflist: mov liftflag,1 + ret + +liftopen: mov al,liftpath + push es bx + call turnpathon + pop bx es + cmp counttoclose,0 + jz nocountclose + dec counttoclose + cmp counttoclose,0 + jnz nocountclose + mov liftflag,2 +nocountclose: mov al,12 + jmp pokelift + +liftclosed: mov al,liftpath + push es bx + call turnpathoff + pop bx es + cmp counttoopen,0 + jz nocountopen + dec counttoopen + cmp counttoopen,0 + jnz nocountopen + mov liftflag,3 +nocountopen: mov al,0 + jmp pokelift + + endp + + +Liftnoise proc near + + cmp reallocation,5 + jz hissnoise + cmp reallocation,21 + jz hissnoise + call playchannel1 + ret +hissnoise: if demo + mov al,25 + else + mov al,13 + endif + call playchannel1 + ret + + endp + + + + +Random proc near + + call randomnum1 + push di + and ax,7 + add di,18 + add di,ax + mov al,[di] + pop di + mov [es:bx+15],al + ret + + endp + + + + + + + + +Steady proc near + + mov al,[di+18] + mov [di+17],al + mov [es:bx+15],al + ret + + endp + + + + + +Constant proc near + + inc byte ptr [es:bx+19] + mov cl,[es:bx+19] + mov ch,0 + add di,cx + cmp byte ptr [di+18],255 + jnz gotconst + sub di,cx + mov cx,0 + mov [es:bx+19],cl +gotconst: mov al,[di+18] + sub di,cx + mov [es:bx+15],al + mov [di+17],al + ret + + endp + + + + + + + + + + + + + + +Doorway proc near + + mov doorcheck1,-24 + mov doorcheck2,10 + mov doorcheck3,-30 + mov doorcheck4,10 + call dodoor + ret + + endp + + + +Widedoor proc near + + mov doorcheck1,-24 + mov doorcheck2,24 + mov doorcheck3,-30 + mov doorcheck4,24 + call dodoor + ret + + endp + + + + + + + + + +Dodoor proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor + sub al,cl + cmp al,doorcheck1 + jnc upordown + jmp shutdoor +rtofdoor: sub al,cl + cmp al,doorcheck2 + jnc shutdoor + +upordown: cmp ah,ch + jnc botofdoor + sub ah,ch + cmp ah,doorcheck3 + jc shutdoor + jmp opendoor +botofdoor: sub ah,ch + cmp ah,doorcheck4 + jnc shutdoor + +opendoor: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough + cmp cl,0 + jnz notthrough + mov cl,6 +notthrough: inc cl + cmp cl,1 + jnz notdoorsound2 + mov al,0 + cmp reallocation,5 + jnz nothoteldoor2 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor2: call playchannel1 +notdoorsound2: mov ch,0 + + push di + add di,cx + mov al,[di+18] ; must be a better way than this + cmp al,255 + jnz atlast1 + dec di + dec cl +atlast1: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + mov throughdoor,1 + ret + + +shutdoor: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound1 + mov al,1 + cmp reallocation,5 + jnz nothoteldoor1 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor1: call playchannel1 +notdoorsound1: cmp cl,0 + jz atlast2 + dec cl + mov [es:bx+19],cl +atlast2: mov ch,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz notnearly + mov throughdoor,0 +notnearly: ret + + endp + + + + + + + + +Lockeddoorway proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor2 + sub al,cl + cmp al,-24 + jnc upordown2 + jmp shutdoor2 +rtofdoor2: sub al,cl + cmp al,10 + jnc shutdoor2 + +upordown2: cmp ah,ch + jnc botofdoor2 + sub ah,ch + cmp ah,-30 + jc shutdoor2 + jmp opendoor2 +botofdoor2: sub ah,ch + cmp ah,12 + jnc shutdoor2 + +opendoor2: cmp throughdoor,1 + jz mustbeopen + cmp lockstatus,1 + jz shutdoor +mustbeopen: mov cl,[es:bx+19] + cmp cl,1 + jnz notdoorsound4 + mov al,0 + call playchannel1 +notdoorsound4: cmp cl,6 ; was 3 + jnz noturnonyet + mov al,doorpath + push es bx + call turnpathon + pop bx es + +noturnonyet: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough2 + cmp cl,0 + jnz notthrough2 + mov cl,6 +notthrough2: inc cl + mov ch,0 + + push di + add di,cx + mov al,[di+18] + cmp al,255 + jnz atlast3 + dec di + dec cl +atlast3: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz justshutting + mov throughdoor,1 +justshutting: ret + + + +shutdoor2: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound3 + mov al,1 + call playchannel1 +notdoorsound3: cmp cl,0 + jz atlast4 + dec cl + mov [es:bx+19],cl +atlast4: mov ch,0 + mov throughdoor,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,0 ;1 + jnz notlocky + mov al,doorpath + push es bx + call turnpathoff + pop bx es + mov lockstatus,1 +notlocky: ret + + endp + + + + + + + + + + +;------------------------------------------------------------People handler---- + +Updatepeople proc near + + mov es,buffers + mov di,peoplelist + mov listpos,di + mov cx,12*5 + mov al,255 + rep stosb + + inc maintimer + push cs + pop es + mov bx,offset cs:reelroutines + mov di,offset cs:reelcalls +updateloop: mov al,[es:bx] + cmp al,255 + jz endupdate + cmp al,reallocation + jnz notinthisroom + mov cx,[es:bx+1] + cmp cl,mapx + jnz notinthisroom + cmp ch,mapy + jnz notinthisroom + push di + mov ax,[cs:di] + call ax + pop di +notinthisroom: add bx,8 + add di,2 + jmp updateloop +endupdate: ret + + endp + + + + + + + + + + + + + + +Getreelframeax proc near + + push ds + mov currentframe,ax + call findsource + push ds + pop es + pop ds + mov ax,currentframe + sub ax,takeoff + add ax,ax + mov cx,ax + add ax,ax + add ax,cx + mov bx,ax + ret + + endp + + + + + + + + + + +Reelsonscreen proc near + + call reconstruct + call updatepeople + call watchreel + call showrain + call usetimedtext + ret + + endp + + + + + + +Plotreel proc near + + call getreelstart +retryreel: push es si + mov ax,[es:si+2] + cmp al,220 + jc normalreel + cmp al,255 + jz normalreel + call dealwithspecial + inc reelpointer + pop si es + add si,40 + jmp retryreel + +normalreel: mov cx,8 +plotloop: push cx es si + mov ax,[es:si] + cmp ax,0ffffh + jz notplot + call showreelframe +notplot: pop si es cx + add si,5 + loop plotloop + call soundonreels + pop bx es + ret + + endp + + + + + +Soundonreels proc near + + mov bl,reallocation + add bl,bl + xor bh,bh + add bx,offset cs:roombyroom + mov si,[cs:bx] + +reelsoundloop: mov al,[cs:si] + cmp al,255 + jz endreelsound + mov ax,[cs:si+1] + cmp ax,reelpointer + jnz skipreelsound + + cmp ax,lastsoundreel + jz skipreelsound + + mov lastsoundreel,ax + mov al,[cs:si] + cmp al,64 + jc playchannel1 + cmp al,128 + jc channel0once + and al,63 + mov ah,255 + jmp playchannel0 +channel0once: and al,63 + mov ah,0 + jmp playchannel0 +skipreelsound: add si,3 + jmp reelsoundloop +endreelsound: mov ax,lastsoundreel + cmp ax,reelpointer + jz nochange2 + mov lastsoundreel,-1 +nochange2: ret + +roombyroom dw r0,r1,r2,r0,r0,r0,r6,r0,r8,r9,r10,r11,r12,r13,r14,r0,r0,r0,r0,r0 + dw r20,r0,r22,r23,r0,r25,r26,r27,r28,r29,r0,r0,r0,r0,r0 + dw r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r45,r46,r47,r0,r0,r0,r0,r52,r53,r0,r55 + +r0 db 255 + +r1 db 15 + dw 257 + db 255 + +r2 db 12 + dw 5 + db 13 + dw 21 + db 15 ;hitting floor? + dw 35 + db 17 + dw 50 + db 18 + dw 103 + db 19 + dw 108 + db 255 + +r6 db 18 + dw 19 + db 19 + dw 23 + db 255 + +r8 db 12 + dw 51 + db 13 + dw 53 + db 14 + dw 14 + db 15 + dw 20 + db 0 + dw 78 + db 255 + +r9 db 12 + dw 119 + db 12 + dw 145 + db 255 + +r10 db 13 + dw 16 + db 255 + +r11 db 13 + dw 20 + db 255 + +r12 db 14 + dw 16 + db 255 + +r13 db 15 + dw 4 + db 16 + dw 8 + db 17 + dw 134 + db 18 + dw 153 + db 255 + +r14 db 13 + dw 108 + db 15 + dw 326 + db 15 + dw 331 + db 15 + dw 336 + db 15 + dw 342 + db 15 + dw 348 + db 15 + dw 354 + db 18 + dw 159 + db 18 + dw 178 + db 19+128 + dw 217 + db 20+64 + dw 228 + db 255 + +r20 db 13 + dw 20 + db 13 + dw 21 + db 15 + dw 34 + db 13 + dw 52 + db 13 + dw 55 + db 25 + dw 57 + db 21 + dw 73 + db 255 + +r22 db 13 ;room,sample + dw 196 ;reelpointer + db 13 + dw 234 + db 13 + dw 156 + db 14 + dw 129 + db 13 + dw 124 + db 15 + dw 162 + db 15 + dw 200 + db 15 + dw 239 + db 17 + dw 99 + db 12 + dw 52 + db 255 + +r23 db 15 + dw 56 + db 16 + dw 64 + db 19 + dw 22 + db 20 + dw 33 + db 255 + +r25 db 20 + dw 11 + db 20 + dw 15 + db 15 + dw 28 + db 13 + dw 80 + db 21 + dw 82 + db 19+128 + dw 87 + db 23+64 + dw 128 + db 255 + +r26 db 12 + dw 13 + db 14 + dw 39 + db 12 + dw 67 + db 12 + dw 75 + db 12 + dw 83 + db 12 + dw 91 + db 15 + dw 102 ; was 90, should be mine cart + db 255 + +r27 db 22 + dw 36 + db 13 + dw 125 + db 18 + dw 88 + db 15 + dw 107 + db 14 + dw 127 + db 14 + dw 154 + db 19+128 + dw 170 + db 23+64 + dw 232 + db 255 + +r28 db 21 + dw 16 + db 21 + dw 72 + db 21 + dw 205 + db 22 + dw 63 ;65 + db 23+128 + dw 99 + db 24+64 + dw 158 + db 255 + +r29 db 13 + dw 21 + db 14 + dw 24 + db 19+128 + dw 50 + db 23+64 + dw 75 + if german + else + db 24 + dw 128 + endif + db 255 + +r45 db 19+64 + dw 46 + db 16 + dw 167 + db 255 + +r46 db 16 + dw 19 + db 14 + dw 36 + db 16 + dw 50 + db 14 + dw 65 + db 16 + dw 81 + db 14 + dw 96 + db 16 + dw 114 + db 14 + dw 129 + db 16 + dw 147 + db 14 + dw 162 + db 16 + dw 177 + db 14 + dw 191 + db 255 + +r47 db 13 + dw 48 + db 14 + dw 41 + db 15 + dw 78 + db 16 + dw 92 + db 255 + +r52 db 16 + dw 115 + db 255 + +r53 db 21 + dw 103 + db 20 + dw 199 + db 255 + +r55 db 17 + dw 53 + db 17 + dw 54 + db 17 + dw 55 + db 17 + dw 56 + db 17 + dw 57 + db 17 + dw 58 + db 17 + dw 59 + db 17 + dw 61 + db 17 + dw 63 + db 17 + dw 64 + db 17 + dw 65 + db 255 + + endp + + + + + + + + + +Reconstruct proc near + + cmp havedoneobs,0 + jz noneedtorecon + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + if foreign + cmp reallocation,20 + jnz notfudge + call undertextline +notfudge: + endif + mov havedoneobs,0 +noneedtorecon: ret + + endp + + + + + + + + + + +Dealwithspecial proc near + + sub al,220 + cmp al,0 + jnz notplset + mov al,ah + call placesetobject + mov havedoneobs,1 + ret +notplset: cmp al,1 + jnz notremset + mov al,ah + call removesetobject + mov havedoneobs,1 + ret +notremset: cmp al,2 + jnz notplfree + mov al,ah + call placefreeobject + mov havedoneobs,1 + ret +notplfree: cmp al,3 + jnz notremfree + mov al,ah + call removefreeobject + mov havedoneobs,1 + ret +notremfree: cmp al,4 + jnz notryanoff + call switchryanoff + ret +notryanoff: cmp al,5 + jnz notryanon + mov turntoface,ah + mov facing,ah + call switchryanon + ret +notryanon: cmp al,6 + jnz notchangeloc + mov newlocation,ah ; was new loc in watch + ;call switchryanon + ret +notchangeloc: call movemap + ret + + endp + + + +Movemap proc near + + cmp ah,32 + jnz notmapup2 + sub mapy,20 + mov nowinnewroom,1 + ret + +notmapup2: cmp ah,16 + jnz notmapupspec + sub mapy,10 + mov nowinnewroom,1 + ret + +notmapupspec: cmp ah,8 + jnz notmapdownspec + add mapy,10 + mov nowinnewroom,1 + ret + +notmapdownspec: cmp ah,2 + jnz notmaprightspec + add mapx,11 + mov nowinnewroom,1 + ret + +notmaprightspec: sub mapx,11 + mov nowinnewroom,1 + ret + + endp + + + + +Getreelstart proc near + + mov ax,reelpointer + mov cx,40 + mul cx + mov es,reels + mov si,ax + add si,reellist + ret + + endp + + + + + +;------------------------------------------------------Printing a reel frame---- + + + +Showreelframe proc near + + mov al,[es:si+2] + mov ah,0 + mov di,ax + add di,mapadx + mov al,[es:si+3] + mov bx,ax + add bx,mapady + mov ax,[es:si] + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,8 + call showframe + ret + + endp + + + + + + +;------------------------------------------------------------------------------- + + + + + + + + + +Deleverything proc near + + mov al,mapysize + mov ah,0 + add ax,mapoffsety + cmp ax,182 + jnc bigroom + call maptopanel + ret +bigroom: sub mapysize,8 + call maptopanel + add mapysize,8 + ret + + endp + + + + + + + + + + + +Dumpeverything proc near + + mov es,buffers + mov bx,printedlist +dumpevery1: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery1 + cmp ax,[es:bx+(40*5)] + jnz notskip1 + cmp cx,[es:bx+(40*5)+2] + jz skip1 + +notskip1: push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + +skip1: add bx,5 + jmp dumpevery1 + +finishevery1: mov bx,printedlist+(40*5) +dumpevery2: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery2 + + push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + add bx,5 + jmp dumpevery2 + +finishevery2: ret + + endp + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm new file mode 100644 index 0000000000..d19257072b --- /dev/null +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -0,0 +1,569 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Talk proc near + + mov talkpos,0 + mov inmaparea,0 + mov al,command + mov character,al + call createpanel + call showpanel + call showman + call showexit + call undertextline + call convicons + call starttalk + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen +waittalk: call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov getback,0 + mov bx,offset cs:talklist + call checkcoords + cmp getback,0 + jz waittalk +finishtalk: mov bx,persondata + push cs + pop es + cmp talkpos,4 + jc notnexttalk + mov al,[es:bx+7] + or al,128 + mov [es:bx+7],al +notnexttalk: call redrawmainscrn + call worktoscreenm + cmp speechloaded,1 + jnz nospeech + call cancelch1 + mov volumedirection,-1 ;fade (louder) + mov volumeto,0 ;up to 0 (max) +nospeech: ret + +talklist: dw 273,320,157,198,getback1 + dw 240,290,2,44,moretalk + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + +Convicons proc near + + mov al,character + and al,127 + call getpersframe + mov di,234 + mov bx,2 + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Getpersframe proc near + + mov ah,0 + add ax,ax + mov bx,ax + mov es,people + add bx,personframes + mov ax,[es:bx] + ret + + endp + + + + + +Starttalk proc near + + mov talkmode,0 + mov al,character + and al,127 + call getpersontext + mov charshift,91+91 + mov di,66 + mov bx,64 + mov dl,241 + mov al,0 + mov ah,79 + call printdirect + mov charshift,0 + mov di,66 + mov bx,80 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + if cd + mov speechloaded,0 + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,1 + jnz nospeech1 + mov volumedirection,1 ;quieter + mov volumeto,6 ;quite quiet! + mov al,50+12 + call playchannel1 + endif +nospeech1: ret + + endp + + + + + +Getpersontext proc near + + mov ah,0 + mov cx,64*2 + mul cx + mov si,ax + mov es,people + add si,persontxtdat + mov cx,persontext + mov ax,[es:si] + add ax,cx + mov si,ax + ret + + endp + + + + + + + +Moretalk proc near + + ;cmp ch1playing,255 + ;jnz cantredes + cmp talkmode,0 + jz canmore + call redes + ret + +canmore: cmp commandtype,215 + jz alreadymore + mov commandtype,215 + mov al,49 + call commandonly +alreadymore: mov ax,mousebutton + cmp ax,oldbutton + jz nomore + and ax,1 + jnz domoretalk +nomore: ret + +domoretalk: mov talkmode,2 + mov talkpos,4 + cmp character,100 + jc notsecondpart + mov talkpos,48 +notsecondpart: call dosometalk + ret + + endp + + + + + + + + + + + + + + +Dosometalk proc near + + if cd +dospeech: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay1 + mov al,62 + call playchannel1 + +noplay1: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + cmp byte ptr [es:si],":" + jz skiptalk2 + cmp byte ptr [es:si],32 + jz skiptalk2 + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay2 + mov al,62 + call playchannel1 + +noplay2: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + +skiptalk2: inc talkpos + jmp dospeech + +endheartalk: mov pointermode,0 + ret + + else + +watchtalk: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + cmp byte ptr [es:si],":" + jz skiptalk + cmp byte ptr [es:si],32 + jz skiptalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + +skiptalk: inc talkpos + jmp watchtalk + +endwatchtalk: mov pointermode,0 + ret + + endif + + endp + + + + + + + +Hangonpq proc near + + mov getback,0 + mov bx,0 +hangloopq: push cx bx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:quitlist + call checkcoords + pop bx cx + cmp getback,1 + jz quitconv + cmp speechloaded,1 + jnz notspeaking + cmp ch1playing,255 + jnz notspeaking + inc bx + cmp bx,40 ;pause after speech ends + jz finishconv +notspeaking: cmp mousebutton,0 + jz hangloopq + cmp oldbutton,0 + jnz hangloopq +finishconv: call delpointer + mov pointermode,0 + ret + +quitconv: call delpointer + mov pointermode,0 + pop ax + call cancelch1 + ret + +quitlist: dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + +Redes proc near + + cmp ch1playing,255 + jnz cantredes + cmp talkmode,2 + jz canredes +cantredes: call blank + ret + +canredes: cmp commandtype,217 + jz alreadyreds + mov commandtype,217 + mov al,50 + call commandonly +alreadyreds: mov ax,mousebutton + and ax,1 + jnz doredes + ret + +doredes: call delpointer + call createpanel + call showpanel + call showman + call showexit + call convicons + call starttalk + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm new file mode 100644 index 0000000000..6441d568ec --- /dev/null +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -0,0 +1,528 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + +Titles proc near + + if demo + ret + else + call clearpalette + call biblequote + call intro + ret + endif + + endp + + + + +Endgame proc near + + mov dx,offset cs:endtextname + call loadtemptext + call monkspeaking + call gettingshot + call getridoftemptext + mov volumeto,7 + mov volumedirection,1 + mov cx,200 + call hangon + ret + + endp + + + if cd + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,5 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +loadspeech2: push ax + mov dl,"T" + mov dh,83 + mov cl,"T" + mov ah,0 + call loadspeech + mov al,50+12 + call playchannel1 +notloadspeech2: cmp ch1playing,255 + jnz notloadspeech2 + pop ax + inc al + cmp al,48 + jnz loadspeech2 + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + else + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,0 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +nextmonkspeak: push ax + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax +nextbit: mov di,36 + mov bx,140 + mov dl,239 + call printdirect + push ax si es + call worktoscreen + call clearwork + call showmonk + mov cx,240 + call hangon + pop es si ax + cmp al,0 + jnz nextbit + pop ax + inc al + cmp al,44 + jnz nextmonkspeak + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + endif + + + + +Showmonk proc near + + mov al,0 + mov ah,128 + mov di,160 + mov bx,72 + mov ds,tempgraphics + call showframe + ret + + endp + + +Gettingshot proc near + + mov newlocation,55 + call clearpalette + call loadintroroom + call fadescreenups + mov volumeto,0 + mov volumedirection,-1 + call runendseq + call clearbeforeload + ret + + endp + + + + + + +Credits proc near + + call clearpalette + call realcredits + ret + + endp + + + +Biblequote proc near + + call mode640x480 + mov dx,offset cs:title0graphics + call showpcx + call fadescreenups + mov cx,80 + call hangone + mov cx,560 + call hangone + call fadescreendowns + mov cx,200 ;128 + call hangone + call cancelch0 + ret + + endp + + + + +Hangone proc near + +hangonloope: push cx + call vsync + pop cx + cmp lasthardkey,1 + jz hangonearly + loop hangonloope + ret +hangonearly: pop ax + pop ax + ret + + endp + + + + + + +Intro proc near + + mov dx,offset cs:introtextname + call loadtemptext + + call loadpalfromiff + call setmode + + mov newlocation,50 + call clearpalette + call loadintroroom + mov volume,7 + mov volumedirection,-1 + if cd + mov volumeto,4 + else + mov volumeto,0 + endif + mov al,12 ;4 + mov ah,255 + call playchannel0 + call fadescreenups + call runintroseq +;waitsound: cmp ch1blockstoplay,0 +; jnz waitsound + call clearbeforeload + + mov newlocation,52 + call loadintroroom + call runintroseq + call clearbeforeload + + mov newlocation,53 + call loadintroroom + call runintroseq + call clearbeforeload + + call allpalette + mov newlocation,54 + call loadintroroom + ;mov al,12 + ;mov ah,255 + ;call playchannel0 + call runintroseq + + call getridoftemptext + call clearbeforeload + ret + + endp + + + + + + + + +Runintroseq proc near + + mov getback,0 + +moreintroseq: call vsync + cmp lasthardkey,1 + jz earlyendrun + call spriteupdate + call vsync + cmp lasthardkey,1 + jz earlyendrun + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + call dumpmap + call dumptimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + cmp getback,1 + jnz moreintroseq + ret +earlyendrun: pop ax ax + call getridoftemptext + call clearbeforeload + ret + + endp + + + + + +Runendseq proc near + + call atmospheres + mov getback,0 +moreendseq: call vsync + call spriteupdate + call vsync + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + call dumpmap + call dumptimedtext + call vsync + cmp getback,1 + jnz moreendseq + ret + + endp + + + + +Loadintroroom proc near + + mov introcount,0 + mov location,255 + call loadroom + mov mapoffsetx,72 + mov mapoffsety,16 + call clearsprites + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call clearwork + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + ret + + endp + + + + + + +Mode640x480 proc near + + mov al,12h+128 + mov ah,0 + int 10h + ;call clearpalette + ret + + endp + + + +Set16colpalette proc near + + mov cx,16 + mov bl,0 + mov bh,0 + mov al,0 + mov ah,10h +set16palloop2: push ax bx cx + int 10h + pop cx bx ax + inc bl + inc bh + loop set16palloop2 + + mov bl,31h + mov al,1 + mov ah,12h + int 10h + ret + + endp + + + + + +RealCredits proc near + + mov roomssample,33 + call loadroomssample + mov volume,0 + + call mode640x480 + mov cx,35 + call hangon + + mov dx,offset cs:title1graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + call allpalette + mov cx,80 + call hangone + call fadescreendowns + mov cx,256 + call hangone + + mov dx,offset cs:title2graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + call allpalette + mov cx,80 + call hangone + call fadescreendowns + mov cx,256 + call hangone + + if demo + else + mov dx,offset cs:title3graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + call allpalette + mov cx,80 + call hangone + call fadescreendowns + mov cx,256 + call hangone + + mov dx,offset cs:title4graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + call allpalette + mov cx,80 + call hangone + call fadescreendowns + mov cx,256 + call hangone + + mov dx,offset cs:title5graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + call allpalette + mov cx,80 + call hangone + call fadescreendowns + mov cx,256 + call hangone + endif + + mov dx,offset cs:title6graphics + call showpcx + call fadescreenups + mov cx,60 + call hangone + mov al,13 + mov ah,0 + call playchannel0 + mov cx,350 + call hangone + call fadescreendowns + mov cx,256 + call hangone + ret + + endp + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm new file mode 100644 index 0000000000..250aa00240 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -0,0 +1,3810 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + +Useobject proc near + + mov withobject,255 + + cmp commandtype,229 + jz alreadyuse + mov commandtype,229 + + mov bl,command + mov bh,objecttype + mov al,51 + call commandwithob +alreadyuse: mov ax,mousebutton + cmp ax,oldbutton + jz nouse + and ax,1 + jnz douse +nouse: ret + +douse: call useroutine + ret + + endp + + + + + + + +Useroutine proc near + + cmp reallocation,50 + jc nodream7 + cmp pointerpower,0 + jnz powerok + ret +powerok: mov pointerpower,0 + +nodream7: call getanyad + mov dx,seg uselist + mov ds,dx + mov si,offset uselist +checkuselist: push si + lodsb + sub al,"A" + cmp al,[es:bx+12] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+13] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+14] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+15] + jnz failed + lodsw + pop si + call ax + ret +failed: pop si + add si,6 + cmp byte ptr [si],140 + jnz checkuselist + + call delpointer + call getobtextstart + call findnextcolon + cmp al,0 + jz cantuse2 + call findnextcolon + cmp al,0 + jz cantuse2 + mov al,[es:si] + cmp al,0 + jz cantuse2 + call usetext + mov cx,400 + call hangonp + call putbackobstuff + ret +cantuse2: call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,33 + mov bx,100 + mov al,63 + mov dl,241 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + mov commandtype,255 + ret + +Uselist: db "NETW" + dw usemon + db "ELVA" + dw useelevator1 + db "ELVB" + dw useelevator2 + db "ELVC" + dw useelevator3 + db "ELVE" + dw useelevator4 + db "ELVF" + dw useelevator5 + db "CGAT" + dw usechurchgate + db "REMO" + dw usestereo + db "BUTA" + dw usebuttona + db "CBOX" + dw usewinch + db "LITE" + dw uselighter + db "PLAT" + dw useplate + db "LIFT" + dw usecontrol + db "WIRE" + dw usewire + db "HNDL" + dw usehandle + db "HACH" + dw usehatch + db "DOOR" + dw useelvdoor + db "CSHR" + dw usecashcard + db "GUNA" + dw usegun + db "CRAA" + dw usecardreader1 + db "CRBB" + dw usecardreader2 + db "CRCC" + dw usecardreader3 + db "SEAT" + dw sitdowninbar + db "MENU" + dw usemenu + db "COOK" + dw usecooker + db "ELCA" + dw callhotellift + db "EDCA" + dw calledenslift + db "DDCA" + dw calledensdlift + db "ALTR" + dw usealtar + db "LOKA" + dw openhoteldoor + db "LOKB" + dw openhoteldoor2 + db "ENTA" + dw openlouis + db "ENTB" + dw openryan + db "ENTE" + dw openpoolboss + db "ENTC" + dw openyourneighbour + db "ENTD" + dw openeden + db "ENTH" + dw opensarters + db "WWAT" + dw wearwatch + db "POOL" + dw usepoolreader + db "WSHD" + dw wearshades + db "GRAF" + dw grafittidoor + db "TRAP" + dw trapdoor + db "CDPE" + dw edenscdplayer + + db "DLOK" + dw opentvdoor + + db "HOLE" + dw usehole + + db "DRYR" + dw usedryer + + db "HOLY" + dw usechurchhole + + db "WALL" + dw usewall + db "BOOK" + dw usediary + + db "AXED" + dw useaxe + db "SHLD" + dw useshield + + db "BCNY" + dw userailing + db "LIDC" + dw usecoveredbox + db "LIDU" + dw useclearbox + db "LIDO" + dw useopenbox + db "PIPE" + dw usepipe + + db "BALC" + dw usebalcony + db "WIND" + dw usewindow + db "PAPR" + dw viewfolder + + db "UWTA" + dw usetrainer + db "UWTB" + dw usetrainer + + db "STAT" + dw entersymbol + db "TLID" + dw opentomb + db "SLAB" + dw useslab + db "CART" + dw usecart + db "FCAR" + dw usefullcart + + + db "SLBA" + dw slabdoora + db "SLBB" + dw slabdoorb + db "SLBC" + dw slabdoorc + db "SLBD" + dw slabdoord + db "SLBE" + dw slabdoore + db "SLBF" + dw slabdoorf + db "PLIN" + dw useplinth + + db "LADD" + dw useladder + db "LADB" + dw useladderb + + db "GUMA" + dw chewy + + db "SQEE" + dw wheelsound + db "TAPP" + dw runtap + db "GUIT" + dw playguitar + db "CONT" + dw hotelcontrol + + db "BELL" + dw hotelbell + + db 140,140,140,140 + + endp + + + + + + +;-----------------------------------------------------------Puzzle routines---- + + +Wheelsound proc near + + mov al,17 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + +Runtap proc near + + cmp withobject,255 + jnz tapwith + call withwhat + ret +tapwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcupfromtap + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz cupfromtapfull + mov cx,300 + mov al,56 + call showpuztext + call putbackobstuff + ret + +fillcupfromtap: mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + mov al,8 + call playchannel1 + mov cx,300 + mov al,57 + call showpuztext + call putbackobstuff + ret + +cupfromtapfull: mov cx,300 + mov al,58 + call showpuztext + call putbackobstuff + ret + + + endp + + + +Playguitar proc near + + mov al,14 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + +Hotelcontrol proc near + + cmp reallocation,21 + jnz notrightcont + cmp mapx,33 + jnz notrightcont + call showfirstuse + call putbackobstuff + ret +notrightcont: call showseconduse + call putbackobstuff + ret + + endp + + + + +Hotelbell proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Opentomb proc near + + inc progresspoints + call showfirstuse + mov watchingtime,35*2 + mov reeltowatch,1 + mov endwatchreel,33 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Usetrainer proc near + + call getanyad + cmp byte ptr [es:bx+2],4 + jnz notheldtrainer + inc progresspoints + call makeworn + call showseconduse + call putbackobstuff + ret +notheldtrainer: call nothelderror + ret + + endp + + + +Nothelderror proc near + + call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,64 + mov bx,100 + mov al,63 + mov ah,1 + mov dl,201 + call printmessage2 + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + ret + + endp + + + +Usepipe proc near + + cmp withobject,255 + jnz pipewith + call withwhat + ret +pipewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcup + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz alreadyfull + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +fillcup: mov cx,300 + mov al,36 + call showpuztext + call putbackobstuff + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + ret + +alreadyfull: mov cx,300 + mov al,35 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + +Usefullcart proc near + + inc progresspoints + mov al,2 + mov ah,roomnum + add ah,6 + call turnanypathon + mov manspath,4 + mov facing,4 + mov turntoface,4 + mov finaldest,4 + call findxyfrompath + mov resetmanxy,1 + call showfirstuse + mov watchingtime,72*2 + mov reeltowatch,58 + mov endwatchreel,142 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + + + +Useplinth proc near + + cmp withobject,255 + jnz plinthwith + call withwhat + ret + +plinthwith: mov al,withobject + mov ah,withtype + mov cl,"D" + mov ch,"K" + mov dl,"E" + mov dh,"Y" + call compare + jz isrightkey + call showfirstuse + call putbackobstuff + ret + +isrightkey: inc progresspoints + call showseconduse + mov watchingtime,220 + mov reeltowatch,0 + mov endwatchreel,104 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,roomafterdream + mov newlocation,al + ret + + endp + + + +Chewy proc near + + call showfirstuse + call getanyad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + +Useladder proc near + + call showfirstuse + sub mapx,11 + call findroominloc + mov facing,6 + mov turntoface,6 + mov manspath,0 + mov destination,0 + mov finaldest,0 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Useladderb proc near + + call showfirstuse + add mapx,11 + call findroominloc + mov facing,2 + mov turntoface,2 + mov manspath,1 + mov destination,1 + mov finaldest,1 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Slabdoora proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,13 + cmp dreamnumber,3 + jnz slabawrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,42 + mov newlocation,47 + ret +slabawrong: mov watchingtime,40 + mov endwatchreel,34 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + +Slabdoorb proc near + + cmp dreamnumber,1 + jnz slabbwrong + mov al,"S" + mov ah,"H" + mov cl,"L" + mov ch,"D" + call isryanholding + jnz gotcrystal + mov al,44 + mov cx,200 + call showpuztext + call putbackobstuff + ret +gotcrystal: call showfirstuse + inc progresspoints + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,60 + mov endwatchreel,71 + mov newlocation,47 + ret +slabbwrong: call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,40 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoord proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,75 + cmp dreamnumber,0 + jnz slabcwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,102 + mov newlocation,47 + ret +slabcwrong: mov watchingtime,40 + mov endwatchreel,94 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorc proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,108 + cmp dreamnumber,4 + jnz slabdwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,135 + mov newlocation,47 + ret +slabdwrong: mov watchingtime,40 + mov endwatchreel,127 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoore proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,141 + cmp dreamnumber,5 + jnz slabewrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,168 + mov newlocation,47 + ret +slabewrong: mov watchingtime,40 + mov endwatchreel,160 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorf proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,171 + cmp dreamnumber,2 + jnz slabfwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,197 + mov newlocation,47 + ret +slabfwrong: mov watchingtime,40 + mov endwatchreel,189 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + + + +Useslab proc near + + cmp withobject,255 + jnz slabwith + call withwhat + ret +slabwith: mov al,withobject + mov ah,withtype + mov cl,"J" + mov ch,"E" + mov dl,"W" + mov dh,"L" + call compare + jz nextslab + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextslab: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + push ax + call placesetobject + pop ax + cmp al,54 + jnz notlastslab + mov al,0 + call turnpathon + mov watchingtime,22 + mov reeltowatch,35 + mov endwatchreel,48 + mov watchspeed,1 + mov speedcount,1 +notlastslab: inc progresspoints + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Usecart proc near + + cmp withobject,255 + jnz cartwith + call withwhat + ret +cartwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"O" + mov dl,"C" + mov dh,"K" + call compare + jz nextcart + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextcart: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + call placesetobject + inc progresspoints + mov al,17 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + +Useclearbox proc near + + cmp withobject,255 + jnz clearboxwith + call withwhat + ret +clearboxwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"A" + mov dl,"I" + mov dh,"L" + call compare + jz openbox + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openbox: inc progresspoints + call showfirstuse + mov watchingtime,80 + mov reeltowatch,67 + mov endwatchreel,105 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usecoveredbox proc near + + inc progresspoints + call showfirstuse + mov watchingtime,50 + mov reeltowatch,41 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Userailing proc near + + call showfirstuse + mov watchingtime,80 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov mandead,4 + ret + + endp + + + + + +Useopenbox proc near + + cmp withobject,255 + jnz openboxwith + call withwhat + ret +openboxwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz destoryopenbox + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz openboxwrong + call showfirstuse + ret + +destoryopenbox: inc progresspoints + mov cx,300 + mov al,37 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"E"-"A" + mov watchingtime,140 + mov reeltowatch,105 + mov endwatchreel,181 + mov watchspeed,1 + mov speedcount,1 + mov al,4 + call turnpathon + mov getback,1 + ret + +openboxwrong: mov cx,300 + mov al,38 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + +Wearwatch proc near + + cmp watchon,1 + jz wearingwatch + call showfirstuse + mov watchon,1 + mov getback,1 + call getanyad + call makeworn + ret +wearingwatch: call showseconduse + call putbackobstuff + ret + + endp + + + + +Wearshades proc near + + cmp shadeson,1 + jz wearingshades + mov shadeson,1 + call showfirstuse + mov getback,1 + call getanyad + call makeworn + ret +wearingshades: call showseconduse + call putbackobstuff + ret + + endp + + + +Sitdowninbar proc near + + cmp watchmode,-1 + jnz satdown + call showfirstuse + mov watchingtime,50 + mov reeltowatch,55 + mov endwatchreel,71 + mov reeltohold,73 + mov endofholdreel,83 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret +satdown: call showseconduse + call putbackobstuff + ret + + endp + + + +Usechurchhole proc near + + call showfirstuse + mov getback,1 + mov watchingtime,28 + mov reeltowatch,13 + mov endwatchreel,26 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Usehole proc near + + cmp withobject,255 + jnz holewith + call withwhat + ret +holewith: mov al,withobject + mov ah,withtype + mov cl,"H" + mov ch,"N" + mov dl,"D" + mov dh,"A" + call compare + jz righthand + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +righthand: call showfirstuse + mov al,86 + call removesetobject + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov canmovealtar,1 + mov getback,1 + ret + + endp + + + + +Usealtar proc near + + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"A" + call findexobject + cmp al,numexobjects + jz thingsonaltar + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"B" + call findexobject + cmp al,numexobjects + jz thingsonaltar + cmp canmovealtar,1 + jz movealtar + mov cx,300 + mov al,23 + call showpuztext + mov getback,1 + ret + +movealtar: inc progresspoints + call showseconduse + mov watchingtime,160 + mov reeltowatch,81 + mov endwatchreel,174 + mov watchspeed,1 + mov speedcount,1 + + mov al,47 ;message number + mov bl,52 ;x pos of message + mov bh,76 ;and y pos + mov cx,32 ;time on screen + mov dx,98 ;pause before show + call setuptimeduse + mov getback,1 + ret + +thingsonaltar: call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + + +Opentvdoor proc near + + cmp withobject,255 + jnz tvdoorwith + call withwhat + ret +tvdoorwith: mov al,withobject + mov ah,withtype + mov cl,"U" + mov ch,"L" + mov dl,"O" + mov dh,"K" + call compare + jz keyontv + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyontv: call showfirstuse + mov lockstatus,0 + mov getback,1 + ret + + endp + + + + + + + +Usedryer proc near + + mov al,12 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Openlouis proc near + + mov al,5 + mov ah,2 + mov cl,3 + mov ch,8 + call entercode + mov getback,1 + ret + + endp + + + + +Nextcolon proc near + +lookcolon: mov al,[es:si] + inc si + cmp al,":" + jnz lookcolon + ret + + endp + + + + +Openyourneighbour proc near + + mov al,255 + mov ah,255 + mov cl,255 + mov ch,255 + call entercode + mov getback,1 + ret + + endp + + + +Usewindow proc near + + cmp manspath,6 + jnz notonbalc + inc progresspoints + call showfirstuse + mov newlocation,29 + mov getback,1 + ret +notonbalc: call showseconduse + call putbackobstuff + ret + + endp + + + +Usebalcony proc near + + call showfirstuse + mov al,6 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,5 + call turnpathoff + inc progresspoints + mov manspath,6 + mov destination,6 + mov finaldest,6 + call findxyfrompath + call switchryanoff + mov resetmanxy,1 + + mov watchingtime,30*2 + mov reeltowatch,183 + mov endwatchreel,212 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Openryan proc near + + mov al,5 + mov ah,1 + mov cl,0 + mov ch,6 + call entercode + mov getback,1 + ret + + endp + + + +Openpoolboss proc near + + mov al,5 + mov ah,2 + mov cl,2 + mov ch,2 + call entercode + mov getback,1 + ret + + endp + + + + +Openeden proc near + + mov al,2 + mov ah,8 + mov cl,6 + mov ch,5 + call entercode + mov getback,1 + ret + + endp + + +Opensarters proc near + + mov al,7 + mov ah,8 + mov cl,3 + mov ch,3 + call entercode + mov getback,1 + ret + + endp + + + + +Isitright proc near + + mov bx,seg presslist + mov es,bx + mov bx,offset es:presslist + cmp [es:bx+0],al + jnz notright + cmp [es:bx+1],ah + jnz notright + cmp [es:bx+2],cl + jnz notright + cmp [es:bx+3],ch +notright: ret + + endp + + + + +Drawitall proc near + + call createpanel + call drawfloor + ;call dumpallmap + call printsprites + call showicon + ret + + endp + + + + +Openhoteldoor proc near + + cmp withobject,255 + jnz hoteldoorwith + call withwhat + ret +hoteldoorwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel1 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel1: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + ;mov destination,1 + ;mov finaldest,1 + ;call autosetwalk + mov lockstatus,0 + mov getback,1 + ret + + endp + + + +Openhoteldoor2 proc near + + cmp withobject,255 + jnz hoteldoorwith2 + call withwhat + ret +hoteldoorwith2: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel2: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Grafittidoor proc near + + cmp withobject,255 + jnz grafwith + call withwhat + ret +grafwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"P" + mov dl,"E" + mov dh,"N" + call compare + jz dograf + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +dograf: call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Trapdoor proc near + + inc progresspoints + call showfirstuse + call switchryanoff + mov watchingtime,20*2 + mov reeltowatch,181 + mov endwatchreel,197 + mov newlocation,26 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + +Callhotellift proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov destination,5 + mov finaldest,5 + call autosetwalk + mov al,4 + call turnpathon + ret + + endp + + + + +Calledenslift proc near + + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret + + endp + + + +Calledensdlift proc near + + cmp liftflag,1 + jz edensdhere + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret +edensdhere: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Usepoolreader proc near + + cmp withobject,255 + jnz poolwith + call withwhat + ret +poolwith: mov al,withobject + mov ah,withtype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jz openpool + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openpool: cmp talkedtoattendant,1 + jz canopenpool + call showseconduse + call putbackobstuff + ret + +canopenpool: mov al,17 + call playchannel1 + call showfirstuse + mov counttoopen,6 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Uselighter proc near + + cmp withobject,255 + jnz gotlighterwith + call withwhat + ret +gotlighterwith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"M" + mov dl,"K" + mov dh,"E" + call compare + jz cigarette + call showfirstuse + call putbackobstuff + ret +cigarette: mov cx,300 + mov al,9 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Showseconduse proc near + + call getobtextstart + call nextcolon + call nextcolon + call nextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + + +Usecardreader1 proc near + + cmp withobject,255 + jnz gotreader1with + call withwhat + ret +gotreader1with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +correctcard: cmp talkedtosparky,0 + jz notyet + cmp card1money,0 + jz getscash + mov cx,300 + mov al,17 + call showpuztext + call putbackobstuff + ret +getscash: mov al,16 + call playchannel1 + mov cx,300 + mov al,18 + call showpuztext + inc progresspoints + mov card1money,12432 + mov getback,1 + ret +notyet: call showfirstuse + call putbackobstuff + ret + + endp + + + + +Usecardreader2 proc near + + cmp withobject,255 + jnz gotreader2with + call withwhat + ret +gotreader2with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +correctcard2: cmp talkedtoboss,0 + jz notyetboss + cmp card1money,0 + jz nocash + cmp gunpassflag,2 + jz alreadygotnew + mov al,18 + call playchannel1 + mov cx,300 + mov al,19 + call showpuztext + mov al,94 + call placesetobject + mov gunpassflag,1 + sub card1money,2000 + inc progresspoints + mov getback,1 + ret +nocash: mov cx,300 + mov al,20 + call showpuztext + call putbackobstuff + ret +alreadygotnew: mov cx,300 + mov al,22 + call showpuztext + call putbackobstuff + ret +notyetboss: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Usecardreader3 proc near + + cmp withobject,255 + jnz gotreader3with + call withwhat + ret +gotreader3with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz rightcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +rightcard: cmp talkedtorecep,0 + jz notyetrecep + cmp cardpassflag,0 + jnz alreadyusedit + if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + mov cx,300 + mov al,25 + call showpuztext + inc progresspoints + sub card1money,8300 + mov cardpassflag,1 + mov getback,1 + ret +alreadyusedit: mov cx,300 + mov al,26 + call showpuztext + call putbackobstuff + ret +notyetrecep: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + +Usecashcard proc near + + call getridofreels + call loadkeypad + call createpanel + call showpanel + call showexit + call showman + + mov di,114 + if foreign + mov bx,120-3 + else + mov bx,120 + endif + mov ds,tempgraphics + mov al,39 + mov ah,0 + call showframe + + mov ax,card1money + call moneypoke + + call getobtextstart + call nextcolon + call nextcolon + + mov di,36 + mov bx,98 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + mov di,160 + mov bx,155 + push cs + pop es + mov si,offset cs:money1poke + mov charshift,91*2+75 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov di,187 + mov bx,155 + push cs + pop es + mov si,offset cs:money2poke + mov charshift,91*2+85 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov charshift,0 + call worktoscreenm + mov cx,400 + call hangonp + call getridoftemp + call restorereels + call putbackobstuff + ret + +money1poke: db "0000",0 +money2poke: db "00",0 + + endp + + + + +Lookatcard proc near + + mov manisoffscreen,1 + call getridofreels + call loadkeypad + + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + + call getobtextstart + call findnextcolon + call findnextcolon + call findnextcolon + mov di,36 + mov bx,124 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + push es si + call worktoscreenm + mov cx,280 + call hangonw + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + pop si es + + mov di,36 + mov bx,130 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,200 + call hangonw + mov manisoffscreen,0 + call getridoftemp + call restorereels + call putbackobstuff + ret + + endp + + + + + +Moneypoke proc near + + mov bx,offset cs:money1poke + mov cl,48-1 +numberpoke0: inc cl + sub ax,10000 + jnc numberpoke0 + add ax,10000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke1: inc cl + sub ax,1000 + jnc numberpoke1 + add ax,1000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke2: inc cl + sub ax,100 + jnc numberpoke2 + add ax,100 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke3: inc cl + sub ax,10 + jnc numberpoke3 + add ax,10 + mov [cs:bx],cl + + mov bx,offset cs:money2poke + add al,48 + mov [cs:bx],al + ret + + endp + + + + + + + +Usecontrol proc near + + cmp withobject,255 + jnz gotcontrolwith + call withwhat + ret +gotcontrolwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz rightkey + cmp reallocation,21 + jnz balls + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz jimmycontrols + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeoncontrols + +balls: call showfirstuse + call putbackobstuff + ret + +rightkey: mov al,16 + call playchannel1 + cmp location,21 + jz goingdown + mov cx,300 + mov al,0 + call showpuztext + mov newlocation,21 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +goingdown: mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +jimmycontrols: mov al,50 + call placesetobject + mov al,51 + call placesetobject + mov al,26 + call placesetobject + mov al,30 + call placesetobject + mov al,16 + call removesetobject + mov al,17 + call removesetobject + if demo + mov al,26 + else + mov al,14 + endif + call playchannel1 + mov cx,300 + mov al,10 + call showpuztext + inc progresspoints + mov getback,1 + ret + +axeoncontrols: mov cx,300 + mov al,16 + call showpuztext + inc progresspoints + call putbackobstuff + ret + + endp + + + + + + +Usehatch proc near + + call showfirstuse + mov newlocation,40 + mov getback,1 + ret + + endp + + + + + +Usewire proc near + + cmp withobject,255 + jnz gotwirewith + call withwhat + ret +gotwirewith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz wireknife + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz wireaxe + + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +wireaxe: mov cx,300 + mov al,16 + call showpuztext + call putbackobstuff + ret + +wireknife: mov al,51 + call removesetobject + mov al,52 + call placesetobject + mov cx,300 + mov al,11 + call showpuztext + inc progresspoints + mov getback,1 + ret + + endp + + + + + + + +Usehandle proc near + + mov al,"C" + mov ah,"U" + mov cl,"T" + mov ch,"W" + call findsetobject + mov al,[es:bx+58] + cmp al,255 + jnz havecutwire + mov cx,300 + mov al,12 + call showpuztext + mov getback,1 + ret + +havecutwire: mov cx,300 + mov al,13 + call showpuztext + mov newlocation,22 + mov getback,1 + ret + + endp + + + + + + + + +Useelevator1 proc near + + call showfirstuse + call selectlocation + mov getback,1 + ret + + endp + + + + + + +Showfirstuse proc near ;shows but does not delete the + ;first bit of text after the + call getobtextstart ;description + call findnextcolon + call findnextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + +Useelevator3 proc near + + call showfirstuse + mov counttoclose,20 + mov newlocation,34 + mov reeltowatch,46 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + mov watchingtime,80 ;40 + mov getback,1 + ret + + endp + + + + +Useelevator4 proc near + + call showfirstuse + mov reeltowatch,0 + mov endwatchreel,11 + mov watchspeed,1 + mov speedcount,1 + mov counttoclose,20 + mov watchingtime,80 ;40 + mov getback,1 + mov newlocation,24 + ret + + endp + + + +Useelevator2 proc near + + cmp location,23 + jz inpoolhall + call showfirstuse + mov newlocation,23 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret +inpoolhall: call showfirstuse + mov newlocation,31 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + + endp + + + + +Useelevator5 proc near + + mov al,4 + call placesetobject + mov al,0 + call removesetobject + mov newlocation,20 + mov watchingtime,80 + mov liftflag,1 + mov counttoclose,8 + mov getback,1 + ret + + endp + + + + + +Usekey proc near + + cmp location,5 + jz usekey1 + cmp location,30 + jz usekey1 + cmp location,21 + jz usekey2 + mov cx,200 + mov al,1 + call showpuztext + call putbackobstuff + ret + +usekey1: cmp mapx,22 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,0 + call showpuztext + mov counttoclose,100 + mov getback,1 + ret + +usekey2: cmp mapx,11 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov al,2 + call fadescreendown + call showfirstuse + call putbackobstuff + ret + +wrongroom1: mov cx,200 + mov al,2 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + +Usestereo proc near + + cmp location,0 + jz stereook + mov cx,400 ;Ryan isn't in his flat. + mov al,4 + call showpuztext + call putbackobstuff + ret + +stereook: cmp mapx,11 + jnz stereonotok + cmp mapy,0 + jz stereook2 +stereonotok: mov cx,400 ;Ryan isn't in his bedroom. + mov al,5 + call showpuztext + call putbackobstuff + ret + +stereook2: mov al,"C" + mov ah,"D" + mov cl,"P" + mov ch,"L" + call findsetobject ;find object number of CD player + mov ah,1 ;searching for inside a set ob + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz cdinside + mov al,6 ;Need a CD inside + mov cx,400 + call showpuztext + call putbackobstuff + call getanyad ;if the CD's been taken out, + mov al,255 ;make sure the player isn't still + mov [es:bx+10],al ;playing, ie:reset the puzzle + ret ;flag for the remote. + +cdinside: call getanyad + mov al,[es:bx+10] + xor al,1 + mov [es:bx+10],al + cmp al,255 + jz stereoon + mov al,7 ;The stereo works + mov cx,400 + call showpuztext + call putbackobstuff + ret + +stereoon: mov al,8 ;Stereo was already on, + mov cx,400 ;so switch it off + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + + +Usecooker proc near + + mov al,command + mov ah,objecttype + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz foodinside + call showfirstuse + call putbackobstuff + ret ;flag for the remote. + +foodinside: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Useaxe proc near + + cmp reallocation,22 + jnz notinpool + cmp mapy,10 + jz axeondoor + call showseconduse + inc progresspoints + mov lastweapon,2 + mov getback,1 + call removeobfrominv + ret + +notinpool: call showfirstuse + ret + + endp + + + + + + + + +Useelvdoor proc near + + cmp withobject,255 + jnz gotdoorwith + call withwhat + ret +gotdoorwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeondoor + mov al,14 + mov cx,300 + call showpuztext + call putbackobstuff + ret + +axeondoor: mov al,15 + mov cx,300 + call showpuztext + inc progresspoints + + mov watchingtime,46*2 + mov reeltowatch,31 + mov endwatchreel,77 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + +;------------------------------------------------------------------------------ + +Withwhat proc near ;Gets player to identify object + ;to use selected item with. + call createpanel + call showpanel + call showman + call showexit + mov al,command + mov ah,objecttype + push cs + pop es + mov di,offset cs:commandline + call copyname + + mov di,100 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,2 + call printmessage2 + + mov di,lastxpos + add di,5 + mov bx,21 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + mov di,lastxpos + add di,5 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,3 + call printmessage2 + + call fillryan + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + mov invopen,2 + ret + + endp + + + + + +Selectob proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canselectob + call blank + ret + +canselectob: mov withobject,al + mov withtype,ah + cmp ax,oldsubject + jnz diffsub3 + cmp commandtype,221 + jz alreadyselob + mov commandtype,221 + +diffsub3: mov oldsubject,ax + mov bx,ax + mov al,0 + call commandwithob +alreadyselob: mov ax,mousebutton + cmp ax,oldbutton + jz notselob + and ax,1 + jnz doselob +notselob: ret + +doselob: call delpointer + mov invopen,0 + call useroutine + ret + + endp + + + + + + + + +Compare proc near + + sub dl,"A" + sub dh,"A" + sub cl,"A" + sub ch,"A" + push cx dx + call getanyaddir + pop dx cx + cmp [es:bx+12],cx + jnz comparefin + cmp [es:bx+14],dx +comparefin: ret + + endp + + + + + + + + + + + +Findsetobject proc near ;searches set object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,setdat + mov bx,0 + mov dl,0 ;dl counts object number +findsetloop: cmp al,[es:bx+12] + jnz nofind + cmp ah,[es:bx+13] + jnz nofind + cmp cl,[es:bx+14] + jnz nofind + cmp ch,[es:bx+15] + jnz nofind + mov al,dl + ret +nofind: add bx,64 + inc dl + cmp dl,128 ;number of objects to search + jnz findsetloop + mov al,dl + ret + + endp + + + + + + +Findexobject proc near ;searches ex object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +findexloop: cmp al,[es:bx+12] + jnz nofindex + cmp ah,[es:bx+13] + jnz nofindex + cmp cl,[es:bx+14] + jnz nofindex + cmp ch,[es:bx+15] + jnz nofindex + mov al,dl + ret +nofindex: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz findexloop + mov al,dl + ret + + endp + + + +Isryanholding proc near + + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +searchinv: cmp byte ptr [es:bx+2],4 + jnz nofindininv + cmp al,[es:bx+12] + jnz nofindininv + cmp ah,[es:bx+13] + jnz nofindininv + cmp cl,[es:bx+14] + jnz nofindininv + cmp ch,[es:bx+15] + jnz nofindininv + mov al,dl + cmp al,numexobjects + ret +nofindininv: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz searchinv + mov al,dl + cmp al,numexobjects ;if not zero he is holding + ret ;if zero, he is not holding + + endp + + + + +Checkinside proc near ;finds an extra object inside + ;object number al, type ah + + mov es,extras + mov bx,exdata + mov cl,0 +insideloop: cmp al,[es:bx+3] ;OI! might need to check room number!!! + jnz notfoundinside + cmp ah,[es:bx+2] + jnz notfoundinside + ret +notfoundinside: add bx,16 + inc cl + cmp cl,numexobjects + jnz insideloop + ret ;ch returns the object number + ;in the extras list + endp + + + + + + + + + + + + +Usetext proc near + + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + + mov di,36 + mov bx,104 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + call worktoscreenm + ret + + endp + + + + + +Putbackobstuff proc near + + call createpanel + call showpanel + call showman + call obicons + call showexit + call obpicture + call describeob + call undertextline + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Showpuztext proc near + + push cx + call findpuztext + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + mov di,36 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreenm + pop cx + call hangonp + ret + + endp + + + +Findpuztext proc near + + mov ah,0 + mov si,ax + add si,si + mov es,puzzletext + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp + + + +;------------------------------------------------------------------------------- + +Placesetobject proc near + + push es bx + mov cl,0 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],0 + pop bx es + ret + + endp + + + + +Removesetobject proc near + + push es bx + mov cl,255 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],255 + pop bx es + ret + + endp + + + + +Issetobonmap proc near + + push es bx + call getsetad + mov al,[es:bx+58] + pop bx es + cmp al,0 + ret + + endp + + + + + + +Placefreeobject proc near + + push es bx + mov cl,0 + mov ch,1 + call findormake + call getfreead + mov byte ptr [es:bx+2],0 + pop bx es + ret + + endp + + + + + +Removefreeobject proc near + + push es bx + ;mov cl,255 + ;mov ch,1 + ;call findormake + call getfreead + mov byte ptr [es:bx+2],255 + pop bx es + ret + + endp + + + + + + + + + + +Findormake proc near + + mov bx,listofchanges + push ax + mov es,buffers + mov ah,reallocation +changeloop: cmp byte ptr [es:bx],255 + jz haventfound + cmp ax,[es:bx] + jnz nofoundchange + cmp ch,[es:bx+3] + jz foundchange +nofoundchange: add bx,4 + jmp changeloop +foundchange: pop ax + mov [es:bx+2],cl + ret +haventfound: mov [es:bx],ax + mov [es:bx+2],cx + pop ax + ret + + endp + + + + + + + + +Switchryanon proc near + + mov ryanon,255 + ret + + endp + + + + + +Switchryanoff proc near + + mov ryanon,1 + ret + + endp + + + +Setallchanges proc near + + mov es,buffers + mov bx,listofchanges +setallloop: mov ax,[es:bx] + cmp al,255 + jz endsetloop + mov cx,[es:bx+2] + add bx,4 + cmp ah,reallocation + jnz setallloop + push es bx + call dochange + pop bx es + jmp setallloop +endsetloop: ret + + endp + + + + + + +Dochange proc near + + cmp ch,0 + jz object + cmp ch,1 + jz freeobject + +path: push cx + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + push ax + mov al,ch + sub al,100 + mov ah,0 + mov cx,144 + mul cx + pop bx + add bx,ax + add bx,pathdata + mov es,reels + pop cx + mov byte ptr [es:bx+6],cl +nopath: ret + +object: push cx + call getsetad + pop cx + mov [es:bx+58],cl + ret + +freeobject: push cx + call getfreead + pop cx + cmp byte ptr [es:bx+2],255 + jnz beenpickedup + mov [es:bx+2],cl +beenpickedup: ret + + endp + + + +Autoappear proc near ;places objects that appear + ;in rooms after certain + cmp location,32 ;conditions are met. + jnz notinalley + mov al,5 ;switch off travel to + call resetlocation ;hotel after kill + mov al,10 + call setlocation + mov destpos,10 + ret +notinalley: cmp reallocation,24 + jnz notinedens + cmp generaldead,1 + jnz edenspart2 + inc generaldead + mov al,44 + call placesetobject + mov al,18 + call placesetobject + mov al,93 + call placesetobject + mov al,92 + call removesetobject + mov al,55 + call removesetobject + mov al,75 + call removesetobject + mov al,84 + call removesetobject + mov al,85 + call removesetobject + ret +edenspart2: cmp sartaindead,1 + jnz notedens2 + mov al,44 + call removesetobject + mov al,93 + call removesetobject + mov al,55 + call placesetobject + inc sartaindead +notedens2: ret +notinedens: cmp reallocation,25 + jnz notonsartroof + mov newsitem,3 + mov al,6 + call resetlocation ;turn off Sartain Industries + mov al,11 + call setlocation ;turn on carpark for later + mov destpos,11 + ret +notonsartroof: cmp reallocation,2 + jnz notinlouiss + cmp rockstardead,0 + jz notinlouiss + mov al,23 + call placesetobject +notinlouiss: ret + + endp + + + + + + + + + + +;--------------------------------------------------------- Timed text stuff ---- + + + +Getundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + +Putundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + + + + +Dumptimedtext proc near + + cmp needtodumptimed,1 + jnz nodumptimed + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov cl,240 + mov ch,undertimedysize + call multidump + mov needtodumptimed,0 +nodumptimed: ret + + endp + + + + + + + + +Setuptimeduse proc near + + cmp timecount,0 + jnz cantsetup + + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,puzzletext + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup: ret + + endp + + + +Setuptimedtemp proc near + + if cd + cmp ah,0 + jz notloadspeech3 + mov dl,"T" + mov dh,ah + mov cl,"T" + mov ah,0 + call loadspeech + cmp speechloaded,1 + jnz notloadspeech3 + mov al,50+12 + call playchannel1 + ret +notloadspeech3: + endif + cmp timecount,0 + jnz cantsetup2 + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,textfile1 + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup2: ret + + endp + + + + + + + +Usetimedtext proc near + + cmp timecount,0 + jz notext + dec timecount + cmp timecount,0 + jz deltimedtext + mov ax,timecount + cmp ax,counttotimed + jz firsttimed + jnc notext + jmp notfirsttimed +firsttimed: call getundertimed +notfirsttimed: mov bl,timedy + mov bh,0 + mov al,timedx + mov ah,0 + mov di,ax + mov es,timedseg + mov si,timedoffset + mov dl,237 + mov ah,0 + call printdirect + mov needtodumptimed,1 +notext: ret + +deltimedtext: call putundertimed + mov needtodumptimed,1 + ret + + endp + + + + + + + + + + + + +Edenscdplayer proc near + + call showfirstuse + mov watchingtime,18*2 + mov reeltowatch,25 + mov endwatchreel,42 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usewall proc near + + call showfirstuse + cmp manspath,3 + jz gobackover + mov watchingtime,30*2 + mov reeltowatch,2 + mov endwatchreel,31 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathon + mov al,4 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,5 + call turnpathoff + mov manspath,3 + mov finaldest,3 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret +gobackover: mov watchingtime,30*2 + mov reeltowatch,34 + mov endwatchreel,60 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,5 + call turnpathon + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret + + endp + + + + + + + +Usechurchgate proc near + + cmp withobject,255 + jnz gatewith + call withwhat + ret +gatewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"T" + mov dh,"T" + call compare + jz cutgate + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +cutgate: call showfirstuse + mov watchingtime,64*2 + mov reeltowatch,4 + mov endwatchreel,70 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + mov al,3 + call turnpathon + cmp aidedead,0 + jz notopenchurch + mov al,2 + call turnpathon +notopenchurch: ret + + endp + + + + + +Usegun proc near + + cmp objecttype,4 + jz istakengun + call showseconduse + call putbackobstuff + ret +istakengun: cmp reallocation,22 + jnz notinpoolroom + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,39 + mov getback,1 + inc progresspoints + ret +notinpoolroom: cmp reallocation,25 + jnz nothelicopter + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,19 + mov getback,1 + mov dreamnumber,2 + mov roomafterdream,38 + mov sartaindead,1 + inc progresspoints + ret +nothelicopter: cmp reallocation,27 + jnz notinrockroom + mov cx,300 + mov al,46 + call showpuztext + mov pointermode,2 ;0 + mov rockstardead,1 + mov lastweapon,1 + mov newsitem,1 + mov getback,1 + mov roomafterdream,32 ; skip + mov dreamnumber,0 + inc progresspoints + ret +notinrockroom: cmp reallocation,8 + jnz notbystudio + cmp mapx,22 + jnz notbystudio + cmp mapy,40 + jnz notbystudio + mov al,92 + call issetobonmap + jz notbystudio + cmp manspath,9 + jz notbystudio + mov destination,9 + mov finaldest,9 + call autosetwalk + mov lastweapon,1 + mov getback,1 + inc progresspoints + ret +notbystudio: cmp reallocation,6 + jnz notsarters + cmp mapx,11 + jnz notsarters + cmp mapy,20 + jnz notsarters + mov al,5 + call issetobonmap + jnz notsarters + mov destination,1 + mov finaldest,1 + call autosetwalk + mov al,5 + call removesetobject + mov al,6 + call placesetobject + mov al,1 + mov ah,roomnum + dec ah + call turnanypathon + mov liftflag,1 + mov watchingtime,40*2 + mov reeltowatch,4 + mov endwatchreel,43 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + ret +notsarters: cmp reallocation,29 + jnz notaide + mov getback,1 + mov al,13 + call resetlocation + mov al,12 + call setlocation + mov destpos,12 + mov destination,2 + mov finaldest,2 + call autosetwalk + mov watchingtime,164*2 + mov reeltowatch,3 + mov endwatchreel,164 + mov watchspeed,1 + mov speedcount,1 + mov aidedead,1 + mov dreamnumber,3 + mov roomafterdream,33 + inc progresspoints + ret +notaide: cmp reallocation,23 + jnz notwithboss + cmp mapx,0 + jnz notwithboss + cmp mapy,50 + jnz notwithboss + cmp manspath,5 + jz pathokboss + mov destination,5 + mov finaldest,5 + call autosetwalk +pathokboss: mov lastweapon,1 + mov getback,1 + ret +notwithboss: cmp reallocation,8 + jnz nottvsoldier + cmp mapx,11 + jnz nottvsoldier + cmp mapy,10 + jnz nottvsoldier + cmp manspath,2 + jz pathoktv + mov destination,2 + mov finaldest,2 + call autosetwalk +pathoktv: mov lastweapon,1 + mov getback,1 + ret +nottvsoldier: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Useshield proc near + + cmp reallocation,20 + jnz notinsartroom + cmp combatcount,0 + jz notinsartroom + mov lastweapon,3 + call showseconduse + mov getback,1 + inc progresspoints + call removeobfrominv + ret +notinsartroom: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Usebuttona proc near + + mov al,95 + call issetobonmap + jz donethisbit + + call showfirstuse + mov al,0 + mov ah,roomnum + dec ah + call turnanypathon + mov al,9 + call removesetobject + mov al,95 + call placesetobject + + mov watchingtime,15*2 + mov reeltowatch,71 + mov endwatchreel,85 + mov watchspeed,1 + mov speedcount,1 + + mov getback,1 + inc progresspoints + ret +donethisbit: call showseconduse + call putbackobstuff + ret + + endp + + + + +Useplate proc near + + cmp withobject,255 + jnz platewith + call withwhat + ret +platewith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"C" + mov dl,"R" + mov dh,"W" + call compare + jz unscrewplate + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz triedknife + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +unscrewplate: mov al,20 + call playchannel1 + call showfirstuse + mov al,28 + call placesetobject + mov al,24 + call placesetobject + mov al,25 + call removesetobject + mov al,0 + call placefreeobject + inc progresspoints + mov getback,1 + ret + +triedknife: mov cx,300 + mov al,54 + call showpuztext + call putbackobstuff + ret + + endp + + + + + +Usewinch proc near + + mov al,40 + mov ah,1 + call checkinside + cmp cl,numexobjects + jz nowinch + mov al,cl + mov ah,4 + mov cl,"F" + mov ch,"U" + mov dl,"S" + mov dh,"E" + call compare + jnz nowinch + + mov watchingtime,217*2 + mov reeltowatch,0 + mov endwatchreel,217 + mov watchspeed,1 + mov speedcount,1 + mov destpos,1 + mov newlocation,45 + mov dreamnumber,1 + mov roomafterdream,44 + mov generaldead,1 + mov newsitem,2 + mov getback,1 + inc progresspoints + ret + +nowinch: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm new file mode 100644 index 0000000000..37d48e944b --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -0,0 +1,564 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------Equates and definitions---- + +Inputport equ 63h +Mapwidth equ 66 ;132/2 +Maplength equ 60 ;6/2 +Tablesize equ 32 ;size of each entry in spritetable +Itempicsize equ 44 ;size of inventory slots +Opsy equ 52 +Opsx equ 60 +Inventx equ 80 +Inventy equ 58 +Zoomx equ 8 +Zoomy equ 132 +Keypadx equ 36+112 +Keypady equ 72 +Diaryx equ 68+24 +Diaryy equ 48+12 +Symbolx equ 64 +Symboly equ 56 +Menux equ 80+40 +Menuy equ 60 + + if foreign +Undertextsizex equ 228 +Undertextsizey equ 13 +Undertimedysize equ 30 + else +Undertextsizex equ 180 +Undertextsizey equ 10 +Undertimedysize equ 24 + endif + +Numchanges equ 250 + +Textunder equ 0 ;offsets for items in buffer segment +Openinvlist equ textunder+(undertextsizex*undertextsizey) +Ryaninvlist equ openinvlist+32 +Pointerback equ ryaninvlist+60 +Mapflags equ pointerback+(32*32) +Startpal equ mapflags+(11*10*3) +Endpal equ startpal+768 +Maingamepal equ endpal+768 +Spritetable equ maingamepal+768 +Setlist equ spritetable+(32*tablesize) +Freelist equ setlist+(128*5) +Exlist equ freelist+(80*5) +Peoplelist equ exlist+(100*5) +Zoomspace equ peoplelist+(12*5) +Printedlist equ zoomspace+(46*40) +Listofchanges equ printedlist(5*80) +Undertimedtext equ listofchanges+(numchanges*4) +Rainlist equ undertimedtext+(256*undertimedysize) +Initialreelrouts equ rainlist+(6*64) +Initialvars equ initialreelrouts+lenofreelrouts +Lengthofbuffer equ initialvars+lengthofvars + +Flags equ 0 ;offsets of items in backdrop segment +Blocks equ flags+192 +Map equ 0 +Lengthofmap equ map+(mapwidth*maplength) + +Intextdat equ 0 +Intext equ intextdat+(38*2) +Blocktextdat equ 0 +Blocktext equ blocktextdat+(98*2) +Settextdat equ 0 +Settext equ settextdat+(130*2) +Freetextdat equ 0 +Freetext equ freetextdat+(82*2) + +Numexobjects equ 114 +Exframeslen equ 30000 +Extextlen equ 18000 + +Exframedata equ 0 +Exframes equ exframedata+2080 +Exdata equ exframes+exframeslen +Extextdat equ exdata+(16*numexobjects) +Extext equ extextdat+((numexobjects+2)*2) +Lengthofextra equ extext+extextlen + +Framedata equ 0 +Frames equ framedata+2080 + +Frframedata equ 0 +Frframes equ frframedata+2080 + +Personframes equ 0 +Persontxtdat equ personframes+24 +Persontext equ persontxtdat+(1026*2) + +Pathdata equ 0 +Reellist equ pathdata+(36*144) + +Lenofmapstore equ 22*8*20*8 +Maplen equ mapwidth*maplength +Freedatlen equ 16*80 +Setdatlen equ 64*128 +Textstart equ 66*2 + +;-----------------------------------------------------------------Variables---- + + +startvars db 0 +progresspoints db 0 +watchon db 0 +shadeson db 0 +secondcount db 0 +minutecount db 30 +hourcount db 19 +zoomon db 1 +location db 0 +expos db 0 +exframepos dw 0 +extextpos dw 0 +card1money dw 0 +listpos dw 0 +ryanpage db 0 + + +watchingtime dw 0 +reeltowatch dw -1 ;reel plays from here in mode 0 +endwatchreel dw 0 ;and stops here. Mode set to 1 +speedcount db 0 +watchspeed db 0 +reeltohold dw -1 ;if mode is 1 hold on this reel +endofholdreel dw -1 ;if mode is 2 then play to end of +watchmode db -1 ;hold reel. Set mode back to -1 +destafterhold db 0 ;set walking destination. + +newsitem db 0 + +liftflag db 0 +liftpath db 0 +lockstatus db 1 +doorpath db 0 +counttoopen db 0 +counttoclose db 0 +rockstardead db 0 +generaldead db 0 +sartaindead db 0 +aidedead db 0 +beenmugged db 0 + +gunpassflag db 0 +canmovealtar db 0 +talkedtoattendant db 0 +talkedtosparky db 0 +talkedtoboss db 0 +talkedtorecep db 0 +cardpassflag db 0 +madmanflag db 0 +keeperflag db 0 +lasttrigger db 0 +mandead db 0 +seed db 1,2,3 +needtotravel db 0 +throughdoor db 0 +newobs db 0 +ryanon db 255 +combatcount db 0 +lastweapon db -1 + +dreamnumber db 0 +roomafterdream db 0 + +shakecounter db 48 + +lengthofvars equ $-startvars + + +speechcount db 0 + +charshift dw 0 +kerning db 0 + +brightness db 0 + +roomloaded db 0 + +didzoom db 0 + +linespacing dw 10 +textaddressx dw 13 +textaddressy dw 182 ;address on screen for text +textlen db 0 +lastxpos dw 0 + +icontop dw 0 +iconleft dw 0 +itemframe db 0 +itemtotran db 0 +roomad dw 0 +oldsubject dw 0 + +withobject db 0 +withtype db 0 + +lookcounter dw 0 + +command db 0 +commandtype db 0 +oldcommandtype db 0 +objecttype db 0 +getback db 0 +invopen db 0 +mainmode db 0 +pickup db 0 +lastinvpos db 0 +examagain db 0 +newtextline db 0 + +openedob db 0 +openedtype db 0 + +oldmapadx dw 0 +oldmapady dw 0 +mapadx dw 0 +mapady dw 0 +mapoffsetx dw 104 +mapoffsety dw 38 + +mapxstart dw 0 +mapystart dw 0 +mapxsize db 0 +mapysize db 0 + +havedoneobs db 0 +manisoffscreen db 0 +rainspace db 0 + +facing db 0 +leavedirection db 0 +turntoface db 0 +turndirection db 0 + +maintimer dw 0 +introcount db 0 +arrowad dw 0 +currentkey db 0 +oldkey db 0 +useddirection db 0 +currentkey2 db 0 + +timercount db 0 +oldtimercount db 0 + +mapx db 0 +mapy db 0 +newscreen db 0 +ryanx db 0 +ryany db 0 +lastflag db 0 +lastflagex db 0 +flagx db 0 +flagy db 0 + +currentex db 0 +currentfree db 0 +currentframe dw 0 +framesad dw 0 +dataad dw 0 +frsegment dw 0 +objectx dw 0 +objecty dw 0 +offsetx dw 0 +offsety dw 0 +savesize dw 0 +savesource dw 0 +savex db 0 +savey db 0 +currentob db 0 +priority db 0 + +destpos db 0 + +reallocation db 0 ;----------;some rooms have more than one +roomnum db 0 ;place in the Roomdata list, to + ;account for different start points +nowinnewroom db 0 ;this variable holds the rooms +resetmanxy db 0 ;real value - ie:which file it's in +newlocation db -1 ;if set then room is loaded at end of watch mode, or straight away if not in watch mode +autolocation db -1 +mustload db 0 +answered db 0 +saidno db 0 + +doorcheck1 db 0 +doorcheck2 db 0 +doorcheck3 db 0 +doorcheck4 db 0 + +mousex dw 0 +mousey dw 0 +mousebutton dw 0 +mousebutton1 dw 0 +mousebutton2 dw 0 +mousebutton3 dw 0 +mousebutton4 dw 0 +oldbutton dw 0 +oldx dw 0 +oldy dw 0 +lastbutton dw 0 +oldpointerx dw 0 +oldpointery dw 0 +delherex dw 0 +delherey dw 0 +pointerxs db 32 +pointerys db 32 +delxs db 0 +delys db 0 +pointerframe db 0 +pointerpower db 0 +auxpointerframe db 0 +pointermode db 0 +pointerspeed db 0 +pointercount db 0 +inmaparea db 0 + +reelpointer dw 0 +slotdata db 0 +thisslot db 0 +slotflags db 0 +takeoff dw 0 + +talkmode db 0 +talkpos db 0 +character db 0 +persondata dw 0 +talknum db 0 +numberinroom db 0 + +currentcel db 0 +oldselection db 0 + +stopwalking db 0 + +mouseon db 0 +played dw 0 +timer1 db 0 +timer2 db 0 +timer3 db 0 +wholetimer dw 0 +timer1to db 0 +timer2to db 0 +timer3to db 0 + +watchdump db 0 + +currentset dw 0 + +logonum db 0 +oldlogonum db 0 +newlogonum db 0 +netseg dw 0 +netpoint dw 0 +keynum db 0 +cursorstate db 0 + +pressed db 0 +presspointer dw 0 +graphicpress db 0 +presscount db 0 +keypadax dw 0 +keypadcx dw 0 +lightcount db 0 +folderpage db 0 +diarypage db 0 +menucount db 0 +symboltopx db 0 +symboltopnum db 0 +symboltopdir db 0 +symbolbotx db 0 +symbolbotnum db 0 +symbolbotdir db 0 + +symboltolight db 0 +symbol1 db 0 +symbol2 db 0 +symbol3 db 0 +symbolnum db 0 +dumpx dw 0 +dumpy dw 0 + +walkandexam db 0 +walkexamtype db 0 +walkexamnum db 0 + +cursloc dw 0 +curslocx dw 0 +curslocy dw 0 +curpos dw 0 +monadx dw 0 +monady dw 0 +gotfrom dw 0 + +monsource dw 0 +numtodo dw 0 + +timecount dw 0 +counttotimed dw 0 +timedseg dw 0 +timedoffset dw 0 +timedy db 0 +timedx db 0 +needtodumptimed db 0 + +;recordpos dw 0 +;rechandle dw 0 +handle dw 0 + +loadingorsave db 0 ;1 if load 2 if save +currentslot db 0 +cursorpos db 0 + +colourpos db 0 +fadedirection db 0 +numtofade db 0 +fadecount db 0 +addtogreen db 0 +addtored db 0 +addtoblue db 0 + + +lastsoundreel dw 0 + +soundbuffer dw 0 +soundbufferad dw 0 +soundbufferpage db 0 +soundtimes db 0 +needsoundbuff db 0 + +oldint9seg dw -1 +oldint9add dw -1 +oldint8seg dw -1 +oldint8add dw -1 +oldsoundintseg dw 0 +oldsoundintadd dw 0 +soundbaseadd dw 0 +dsp_status dw 0 +dsp_write dw 0 +dmaaddress db 0 +soundint db 5 +sounddmachannel db 1 +sampleplaying db 255 +testresult db 0 +currentirq db 0 +speechloaded db 0 +speechlength dw 0 +volume db 0 +volumeto db 0 +volumedirection db 0 +volumecount db 0 + +playblock db 0 + +wongame db 0 + +lasthardkey db 0 +bufferin dw 0 +bufferout dw 0 + +extras dw 0 ;for allocated memory +workspace dw 0 ;allocated mem for screen buffer +mapstore dw 0 ;allocated mem for copy of room +charset1 dw 0 ;allocated mem for normal charset +tempcharset dw 0 ;monitor char set +icons1 dw 0 ;allocated mem for on screen stuff +icons2 dw 0 +buffers dw 0 ;allocated mem for buffers +mainsprites dw 0 ;allocated mem for Ryan sprites +backdrop dw 0 +mapdata dw 0 + +sounddata dw 0 +sounddata2 dw 0 + +recordspace dw 0 + +freedat dw 0 +setdat dw 0 + +reel1 dw -1 +reel2 dw -1 +reel3 dw -1 +roomdesc dw -1 +freedesc dw -1 +setdesc dw -1 +blockdesc dw -1 +setframes dw -1 +freeframes dw -1 +people dw -1 +reels dw -1 +commandtext dw -1 +puzzletext dw -1 +traveltext dw -1 +tempgraphics dw -1 +tempgraphics2 dw -1 +tempgraphics3 dw -1 +tempsprites dw -1 + +textfile1 dw -1 +textfile2 dw -1 +textfile3 dw -1 + +blinkframe db 23 +blinkcount db 0 + + +reasseschanges db 0 ; if it's a 1 then obname will assume that +pointerspath db 0 ;the command has changed. +manspath db 0 ;ie. from "walk to" to "Examine" +pointerfirstpath db 0 +finaldest db 0 +destination db 0 +linestartx dw 0 +linestarty dw 0 +lineendx dw 0 +lineendy dw 0 +increment1 dw 0 +increment2 dw 0 +lineroutine db 0 +linepointer db 0 +linedirection db 0 +linelength db 0 + +liftsoundcount db 0 + +emmhandle dw 0 +emmpageframe dw 0 +emmhardwarepage db 0 + +ch0emmpage dw 0 +ch0offset dw 0 +ch0blockstocopy dw 0 + +ch0playing db 0 +ch0repeat db 0 +ch0oldemmpage dw 0 +ch0oldoffset dw 0 +ch0oldblockstocopy dw 0 + +ch1playing db 255 +ch1emmpage dw 0 +ch1offset dw 0 +ch1blockstocopy dw 0 +ch1blocksplayed dw 0 + +soundbufferwrite dw 0 + +soundemmpage dw 0 +speechemmpage dw 0 + +currentsample db -1 +roomssample db 0 + +gameerror db 0 + +howmuchalloc dw 0 + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm new file mode 100644 index 0000000000..26874a428f --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vgafades.asm @@ -0,0 +1,867 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Fadedos proc near + + call vsync + mov es,buffers + mov di,startpal + mov al,0 + mov dx,3c7h + out dx,al + mov dx,3c9h + mov cx,768/4 +dos1: in al,dx + stosb + loop dos1 + + mov cx,64 +fadedosloop: push cx + + mov ds,buffers + mov si,startpal + mov cx,768 +dos3: lodsb + cmp al,0 + jz nodown + dec al +nodown: mov [si-1],al + loop dos3 + + call vsync + mov ds,buffers + mov si,startpal + mov al,0 + mov dx,3c8h + out dx,al + inc dx + mov cx,768/4 +dos2: lodsb + out dx,al + loop dos2 + + pop cx + loop fadedosloop + ret + + endp + + + + + + + + + + + +Dofade proc near + + cmp fadedirection,0 + jz finishfade + mov cl,numtofade + mov ch,0 + mov al,colourpos + mov ah,0 + mov ds,buffers + mov si,startpal + add si,ax + add si,ax + add si,ax + call showgroup + mov al,numtofade + add al,colourpos + mov colourpos,al + cmp al,0 + jnz finishfade + call fadecalculation +finishfade: ret + + endp + + + + + + + +Clearendpal proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,0 + rep stosb + ret + + endp + + + + +Clearpalette proc near + + mov fadedirection,0 + call clearstartpal + call dumpcurrent + ret + + endp + + + + + + + + + + +Fadescreenup proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + +Fadetowhite proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,63 + rep stosb + mov di,endpal + mov al,0 + stosb + stosb + stosb + call paltostartpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadefromwhite proc near + + mov es,buffers + mov di,startpal + mov cx,768 + mov al,63 + rep stosb + mov di,startpal + mov al,0 + stosb + stosb + stosb + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + + + + + + +Fadescreenups proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + +Fadescreendownhalf proc near + + call paltostartpal + call paltoendpal + mov cx,768 + mov es,buffers + mov bx,endpal +halfend: mov al,[es:bx] + shr al,1 + mov [es:bx],al + inc bx + loop halfend + + mov ds,buffers + mov es,buffers + mov si,startpal+(56*3) + mov di,endpal+(56*3) + mov cx,3*5 + rep movsb + mov si,startpal+(77*3) + mov di,endpal+(77*3) + mov cx,3*2 + rep movsb + + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + +Fadescreenuphalf proc near + + call endpaltostart + call paltoendpal + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + + + + + + + + + +Fadescreendown proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadescreendowns proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + + + + + + +Clearstartpal proc near + + mov es,buffers + mov di,startpal + mov cx,256 +wholeloop1: mov ax,0 + stosw + mov al,0 + stosb + loop wholeloop1 + ret + + endp + + + + + + +Showgun proc near + + mov addtored,0 ;12 + mov addtogreen,0 + mov addtoblue,0 + call paltostartpal + call paltoendpal + call greyscalesum + +; mov es,buffers +; mov di,endpal+3 +; mov cx,255 +; mov ax,0 +;reds: mov byte ptr [es:di],63 +; inc di +; stosw +; loop reds + + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,130 + call hangon + call endpaltostart + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,200 + call hangon + mov roomssample,34 + call loadroomssample + mov volume,0 + mov dx,offset cs:gungraphic + call loadintotemp + call createpanel2 + mov ds,tempgraphics + mov al,0 + mov ah,0 + mov di,100 + mov bx,4 + call showframe + mov ds,tempgraphics + mov al,1 + mov ah,0 + mov di,158 + mov bx,106 + call showframe + call worktoscreen + call getridoftemp + call fadescreenup + mov cx,160 + call hangon + mov al,12 + mov ah,0 + call playchannel0 + mov dx,offset cs:endtextname + call loadtemptext + call rollendcredits2 + call getridoftemptext + ret + + endp + + + + + +Rollendcredits2 proc near + + call rollem + ret + + endp + + + + +Rollem proc near + + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,49*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,80 +endcredits21: push cx + + mov bx,10 + mov cx,linespacing +endcredits22: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot2: push cx + mov di,25 ;75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot2 + + call vsync + mov cl,160 + mov ch,160 + mov di,25 ;75 + mov bx,20 + call multidump + + pop bx es di si cx + cmp lasthardkey,1 + jz endearly2 + dec bx + loop endcredits22 + pop cx +looknext2: mov al,[es:si] + inc si + cmp al,":" + jz gotnext2 + cmp al,0 + jz gotnext2 + jmp looknext2 +gotnext2: cmp lasthardkey,1 + jz endearly + loop endcredits21 + + mov cx,120 + call hangone + ret +endearly2: pop cx +endearly: ret + + endp + + + + + + + + + +Fadecalculation proc near + + cmp fadecount,0 + jz nomorefading + mov bl,fadecount + mov es,buffers + mov si,startpal + mov di,endpal + mov cx,768 +fadecolloop: mov al,[es:si] + mov ah,[es:di] + cmp al,ah + jz gotthere + jc lesscolour + dec byte ptr [es:si] + jmp gotthere +lesscolour: cmp bl,ah + jz withit + jnc gotthere +withit: inc byte ptr [es:si] +gotthere: inc si + inc di + loop fadecolloop + dec fadecount + ret +nomorefading: mov fadedirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + +Greyscalesum proc near ;converts palette to grey scale + ;summed using formula: + mov es,buffers ; .20xred + .59xGreen + .11xBlue + mov si,maingamepal + mov di,endpal + mov cx,256 ;convert 256 colours + +greysumloop1: push cx + mov bx,0 + mov al,[es:si] + mov ah,0 + mov cx,20 + mul cx + add bx,ax + mov al,[es:si+1] + mov ah,0 + mov cx,59 + mul cx + add bx,ax + mov al,[es:si+2] + mov ah,0 + mov cx,11 + mul cx + add bx,ax ;bx holds equationx100 + + mov al,-1 ;divide result by 100 +greysumloop2: inc al + sub bx,100 + jnc greysumloop2 ;ah holds grey scale number + mov bl,al + + mov al,bl + mov ah,addtored + cmp al,0 + ;jz noaddr + add al,ah +noaddr: stosb + mov ah,addtogreen + mov al,bl + cmp al,0 + jz noaddg + add al,ah +noaddg: stosb ;store result in red, green and + mov ah,addtoblue + mov al,bl + cmp al,0 + jz noaddb + add al,ah +noaddb: stosb ;blue portions of palette. + + add si,3 + pop cx + loop greysumloop1 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Showgroup proc near + + mov dx,3c8h + out dx,al + mov dx,3c9h +showgroup1: lodsb + out dx,al + lodsb + out dx,al + lodsb + out dx,al + loop showgroup1 + ret + + endp + + + + + +Paltostartpal proc near + + mov es,buffers + mov ds,buffers + mov si,maingamepal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + +Endpaltostart proc near + + mov es,buffers + mov ds,buffers + mov si,endpal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + +Startpaltoend proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + +Paltoendpal proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,maingamepal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + + + + + + +Allpalette proc near + + mov es,buffers + mov ds,buffers + mov di,startpal + mov si,maingamepal + mov cx,768/2 + rep movsw + call dumpcurrent + ret + + endp + + + + + +Dumpcurrent proc near + + mov si,startpal + mov ds,buffers + call vsync + mov al,0 + mov cx,128 + call showgroup + call vsync + mov al,128 + mov cx,128 + call showgroup + ret + + endp + + + + + + + + + + + +Fadedownmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 ;100 + call hangon ;curs + ret + + endp + + + + + +Fadeupmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon ;curs + ret + + endp + + + + + +Fadeupmonfirst proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 + call hangon + mov al,26 + call playchannel1 + mov cx,64 + call hangon + + ret + + endp + + + + + + + +Fadeupyellows proc near + + ;call startpaltoend + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon + ret + + endp + + + +Initialmoncols proc near + + call paltostartpal + mov es,buffers + mov di,startpal+(230*3) + mov cx,3*9 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov ds,buffers + mov si,startpal+(230*3) + mov al,230 + mov cx,18 + call showgroup + ret + + endp + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm new file mode 100644 index 0000000000..4082883b6a --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm @@ -0,0 +1,1762 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Screenwidth equ 320 ;physical width of screen + + + +Allocatework proc near + + mov bx,1000h + call allocatemem + mov workspace,ax + ret + + endp + + + + + +Showpcx proc near + + call openfile + mov bx,handle + mov ds,workspace + mov ah,3fh + mov cx,128 + mov dx,0 + int 21h + + mov ds,workspace + mov si,16 + mov cx,48 + mov es,buffers + mov di,maingamepal +pcxpal: push cx + call readabyte + shr al,1 + shr al,1 + stosb + pop cx + loop pcxpal + mov cx,768-48 + mov ax,0ffffh + rep stosw + + call readoneblock + mov si,0 + mov di,0 + mov cx,480 +convertpcx: push cx + push di + mov ds,workspace + mov es,buffers + mov di,pointerback + mov bx,0 +sameline: call readabyte + mov ah,al + and ah,11000000b + cmp ah,11000000b + jnz normal + mov cl,al + and cl,00111111b + mov ch,0 + push cx + call readabyte + pop cx + add bx,cx + rep stosb + cmp bx,4*80 + jnz sameline + jmp endline +normal: stosb + inc bx + cmp bx,4*80 + jnz sameline + +endline: pop di + push si + mov dx,0a000h + mov es,dx + mov si,pointerback + mov ds,buffers + + mov dx,03c4h + mov al,2 + mov ah,1 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,2 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,4 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,8 + out dx,ax + mov cx,40 + rep movsw + + pop si + pop cx + loop convertpcx + + mov bx,handle + call closefile + ret + + endp + + + + +Readabyte proc near + + cmp si,30000 + jnz notendblock + push bx es di ds si + call readoneblock + pop si ds di es bx + mov si,0 +notendblock: lodsb + ret + + endp + + + + +Readoneblock proc near + + mov bx,handle + mov ah,3fh + mov ds,workspace + mov ah,3fh + mov cx,30000 + mov dx,0 + int 21h + ret + + endp + + + + + + + + +Loadpalfromiff proc near + + mov dx,offset cs:palettescreen + call openfile + mov cx,2000 + mov ds,mapstore + mov dx,0 + call readfromfile + call closefile + mov es,buffers + mov di,maingamepal + mov ds,mapstore + mov si,30h + mov cx,768 +palloop: lodsb + shr al,1 + shr al,1 + + cmp brightness,1 + jnz nought + cmp al,0 + jz nought + mov ah,al + shr ah,1 + add al,ah + shr ah,1 + add al,ah + cmp al,64 + jc nought + mov al,63 + +nought: stosb + loop palloop + ret + + endp + + + + + + +Setmode proc near + + call vsync + mov ah,12h + mov al,1 + mov bl,33h + int 10h + + mov ah,0 + mov al,13h + int 10h + + mov al,6 ; sets graphic controller + mov dx,3ceh ; register 6 (MM) to 1 - 64K + out dx,al + inc dx + in al,dx + and al,11110011b + or al,00000100b + out dx,al + + mov al,4 ; sets sequencer + mov dx,3c4h ; register 4 (EM) to 1 - >64K + out dx,al + inc dx + in al,dx + and al,11111101b + or al,00000010b + out dx,al + + mov al,13h ;give screen 16 extra hidden + mov dx,3d4h ;pixels at one side + out dx,al + inc dx + mov al,screenwidth/8 ; width of screen + out dx,al + + mov al,8h + mov dx,3d4h + out dx,al + inc dx + mov al,00000000b + out dx,al + + mov al,11h + mov dx,3d4h + out dx,al + inc dx + in al,dx + or al,128 + out dx,al + + mov al,00 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + mov al,01 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + ret + + endp + + + +Cls proc near + + mov ax,0a000h + mov es,ax + mov di,0 + mov cx,7fffh + mov ax,0 + rep stosw + ret + + endp + + + +Printundermon proc near ;prints workspace through the text + + mov si,(screenwidth*43)+76 + mov di,si + mov es,workspace + add si,8*screenwidth + mov dx,0a000h + mov ds,dx + mov cx,104 +scrollmonloop1: push cx di si + mov cx,170 +scrollmonloop2: lodsb + cmp al,231 + jnc dontplace +placeit: stosb + loop scrollmonloop2 + jmp finmonscroll +dontplace: inc di + loop scrollmonloop2 + +finmonscroll: pop si di cx + add si,screenwidth + add di,screenwidth + loop scrollmonloop1 + ret + + endp + + + + + + + + +Worktoscreen proc near + + call vsync + mov si,0 + mov di,0 + mov cx,25 + mov ds,workspace + mov dx,0a000h + mov es,dx + +dumpallloop: call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + loop dumpallloop + + ret + + endp + + + + + + + + + +; +;Worktoscreen2 proc near +; +; call showpointer +; +; mov ds,workspace +; mov dx,0a000h +; mov es,dx +; +; mov si,320-16 +; mov di,320-16 +; mov bl,33 +; mov cx,16 +;screen2loop1: push di si cx +; call vsync +; cmp bl,21 +; jc screen2loop2 +; sub cx,16 +; jz isoneblock +;screen2loop2: movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; add di,320-15 +; add si,320-15 +; loop screen2loop2 +;isoneblock: mov cx,16 +; mov ax,320-15 +;oneblockloop: push cx +; rep movsb +; pop cx +; add si,ax +; add di,ax +; inc ax +; loop oneblockloop +; +; pop cx si di +; add cx,16 +; cmp cx,200 +; jc itsallright +; mov cx,200 +;itsallright: sub si,16 +; sub di,16 +; dec bl +; jnz screen2loop1 +; +; call delpointer +; ret +; +; endp +; +; +; +; + + + + +Paneltomap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiget + ret + + endp + + + +Maptopanel proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiput + + ret + + endp + + + + + +Dumpmap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov cl,mapxsize + mov ch,mapysize + call multidump + ret + + endp + + + + +Pixelcheckset proc near ;al=x, ah=y, es:bx=setlist pos + ;checks exact pixel in a frame + push ax + sub al,[es:bx] ;for detection. + sub ah,[es:bx+1] ;al,ah now holds offset within + ;the frame + push es bx cx ax + mov al,[es:bx+4] ;object number + call getsetad + mov al,[es:bx+17] ;finds frame number + mov es,setframes + mov bx,framedata + mov ah,0 + mov cx,6 + mul cx + add bx,ax ;get data for this frame in es:bx + pop ax + + push ax + mov al,ah + mov ah,0 + mov cl,[es:bx] + mov ch,0 + mul cx + pop cx + mov ch,0 + add ax,cx ;ax now holds offset from corner + ;of the frame + add ax,[es:bx+2] + mov bx,ax ;es:bx now holds offset of pixel! + add bx,frames + + mov al,[es:bx] + mov dl,al + pop cx bx es ax + cmp dl,0 + ret + + endp + + + + + + + + + + + + +Createpanel proc near + + mov di,0 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,0 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + ret + + endp + + + +Createpanel2 proc near + + call createpanel + mov di,0 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + mov di,160 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + ret + + endp + + + + + + +;Showspritef proc near +; +; mov ax,bx +; mov bx,screenwidth +; mul bx +; add di,ax +; mov dx,screenwidth +; mov es,workspace +; mov si,2080 +; mov ah,0 +; add ax,ax +; mov bx,ax +; add ax,ax +; add bx,ax +; add si,[bx+2] +; mov cx,[bx+0] +;spritefloop: push cx di +; call width80 +; pop di cx +; add di,dx +; dec ch +; jnz spritefloop +; ret +; +; endp +; +; + + + + + + + + +Clearwork proc near + + mov ax,0h + mov es,workspace + mov di,0 + mov cx,(200*320)/64 +clearloop: stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + loop clearloop + ret + + endp + + + + + + +Vsync proc near + + push ax bx cx dx si di ds es + + mov dx,03dah +loop2: in al,dx + test al,8 + jz loop2 +loop1: in al,dx + test al,8 + jnz loop1 + + call doshake + call dofade + if debuglevel2 + call debugkeys + endif + pop es ds di si dx cx bx ax + ret + + endp + + + +Doshake proc near + + cmp shakecounter,48 + jz finishshake + inc shakecounter + mov bl,shakecounter + mov bh,0 + add bx,offset cs:shaketable + mov al,10h + mov dx,3d4h + out dx,al + inc dx + mov al,[cs:bx] + out dx,al +finishshake: ret + +shaketable: db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9ch + + endp + + + + + + +Zoom proc near + + cmp watchingtime,0 + jnz inwatching + cmp zoomon,1 + jz zoomswitch +inwatching: ret + +zoomswitch: cmp commandtype,199 + jc zoomit +cantzoom: call putunderzoom + ret + +zoomit: mov ax,oldpointery + sub ax,9 + mov cx,screenwidth + mul cx + add ax,oldpointerx + sub ax,11 + mov si,ax + + mov ax,zoomy+4 + mov cx,screenwidth + mul cx + add ax,zoomx+5 + mov di,ax + mov es,workspace + mov ds,workspace + + mov cx,20 +zoomloop: push cx + mov cx,23 +zoomloop2: lodsb + mov ah,al + stosw + mov [es:di+screenwidth-2],ax + loop zoomloop2 + add si,screenwidth-23 + add di,screenwidth-46+screenwidth + pop cx + loop zoomloop + + call crosshair + mov didzoom,1 + ret + + endp + + + + + + + + + +Delthisone proc near + + push ax + push ax + mov al,ah + mov ah,0 + add ax,mapady + mov bx,screenwidth + mul bx + pop bx + mov bh,0 + add bx,mapadx + add ax,bx + mov di,ax + pop ax + push ax + mov al,ah + mov ah,0 + mov bx,22*8 + mul bx + pop bx + mov bh,0 + add ax,bx + mov si,ax + + mov es,workspace + mov ds,mapstore + mov dl,cl + mov dh,0 + mov ax,screenwidth + sub ax,dx + neg dx + add dx,22*8 +deloneloop: push cx + mov ch,0 + rep movsb + pop cx + add di,ax + add si,dx + dec ch + jnz deloneloop + ret + + endp + + + + + + + +;------------------------------------------------------------Pointer update---- + + +Multiget proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + push es ds + pop es ds + xchg di,si + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth2 + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop3: call ax + add si,dx + loop multiloop3 + ret + +oddwidth2: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop4: call ax + movsb + add si,dx + loop multiloop4 + ret + + endp + + + + + + + +Multiput proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth3 + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop5: call ax + add di,dx + loop multiloop5 + ret + +oddwidth3: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop6: call ax + movsb + add di,dx + loop multiloop6 + ret + + + endp + + + + + + + + + +Multidump proc near ;di,bx = dest x,y + ;cl,ch = size + mov dx,0a000h + mov es,dx + mov ds,workspace + + mov ax,bx + mov bx,screenwidth + mul bx + add di,ax + mov dx,screenwidth + mov si,di + + mov al,cl + and al,1 + jnz oddwidth + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,dx + mov cl,ch + mov ch,0 +multiloop1: call ax + add di,bx + add si,bx + loop multiloop1 + ret + +oddwidth: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,screenwidth + mov cl,ch + mov ch,0 +multiloop2: call ax + movsb + add di,bx + add si,bx + loop multiloop2 + ret + + endp + + + + + +Widthroutine proc near + +width160: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width128: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width110: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width88: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width80: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width63: movsw +width62: movsw +width61: movsw +width60: movsw +width59: movsw +width58: movsw +width57: movsw +width56: movsw +width55: movsw +width54: movsw +width53: movsw +width52: movsw +width51: movsw +width50: movsw +width49: movsw +width48: movsw +width47: movsw +width46: movsw +width45: movsw +width44: movsw +width43: movsw +width42: movsw +width41: movsw +width40: movsw +width39: movsw +width38: movsw +width37: movsw +width36: movsw +width35: movsw +width34: movsw +width33: movsw +width32: movsw +width31: movsw +width30: movsw +width29: movsw +width28: movsw +width27: movsw +width26: movsw +width25: movsw +width24: movsw +width23: movsw +width22: movsw +width21: movsw +width20: movsw +width19: movsw +width18: movsw +width17: movsw +width16: movsw +width15: movsw +width14: movsw +width13: movsw +width12: movsw +width11: movsw +width10: movsw +width9: movsw +width8: movsw +width7: movsw +width6: movsw +width5: movsw +width4: movsw +width3: movsw +width2: movsw +width1: movsw +width0: ret + + endp + + + + + + + + + +Doblocks proc near + + mov es,workspace + mov ax,mapady + mov cx,screenwidth + mul cx + mov di,mapadx + add di,ax + + mov al,mapy + mov ah,0 + mov bx,mapwidth + mul bx + mov bl,mapx + mov bh,0 + add ax,bx + + mov si,map + add si,ax + + mov cx,10 +loop120: push di cx + mov cx,11 +loop124: push cx di + + mov ds,mapdata + lodsb + mov ds,backdrop + + push si + cmp al,0 + jz zeroblock + mov ah,al + mov al,0 + mov si,blocks + add si,ax + mov bh,14 + + + mov bh,4 +firstbitofblock: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + add di,screenwidth-16 + dec bh + jnz firstbitofblock + + mov bh,12 +loop125: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + mov ax,0dfdfh + stosw + stosw + + add di,screenwidth-20 + dec bh + jnz loop125 + + add di,4 + mov ax,0dfdfh + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + + +zeroblock: pop si + + pop di cx + add di,16 + loop loop124 + add si,mapwidth-11 + pop cx di + add di,screenwidth*16 + loop loop120 + ret + + endp + + + + + + + +;----------------------------------------------General sprite output routine---- + +Showframe proc near ; shows a frame from sprites + + push dx ax ; es=destination + mov cx,ax ; ds=source + and cx,511 ; di=x, bx=y + add cx,cx ; al=frame number + mov si,cx ; ah=effects flag + add cx,cx + add si,cx + cmp word ptr [si],0 + jnz notblankshow + mov cx,0 + ret + +notblankshow: test ah,128 + jnz skipoffsets + mov al,[si+4] + mov ah,0 + add di,ax + mov al,[si+5] + mov ah,0 + add bx,ax +skipoffsets: mov cx,[si+0] + mov ax,[si+2] + add ax,2080 + mov si,ax + pop ax dx + cmp ah,0 + jz noeffects + + test ah,128 + jz notcentred + push ax + mov al,cl + mov ah,0 + shr ax,1 + sub di,ax + mov al,ch + mov ah,0 + shr ax,1 + sub bx,ax + pop ax + +notcentred: test ah,64 + jz notdiffdest + push cx + call frameoutfx + pop cx + ret + +notdiffdest: test ah,8 + jz notprintlist + push ax + mov ax,di + sub ax,mapadx + push bx + sub bx,mapady + mov ah,bl + pop bx + ;call addtoprintlist + pop ax + +notprintlist: test ah,4 + jz notflippedx + mov dx,screenwidth + mov es,workspace + push cx + call frameoutfx + pop cx + ret + +notflippedx: test ah,2 + jz notnomask + mov dx,screenwidth + mov es,workspace + push cx + call frameoutnm + pop cx + ret + +notnomask: test ah,32 + jz noeffects + mov dx,screenwidth + mov es,workspace + push cx + call frameoutbh + pop cx + ret + +noeffects: mov dx,screenwidth + mov es,workspace + push cx + call frameoutv + pop cx ; returns size printed in cx + ret + + endp + + + + + + + + + + +Frameoutv proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +frameloop1: push cx + mov ch,0 + +frameloop2: lodsb + cmp al,0 + jnz backtosolid +backtoother: inc di + loop frameloop2 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + +frameloop3: lodsb + cmp al,0 + jz backtoother +backtosolid: stosb + loop frameloop3 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + + endp + + + + + + +Frameoutnm proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + + mov al,cl + and al,1 + jnz oddwidthframe + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop1: call ax + add di,dx + loop nmloop1 + ret + +oddwidthframe: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop2: call ax + movsb + add di,dx + loop nmloop2 + ret + + endp + + + + + + +Frameoutbh proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +bhloop2: push cx + mov ch,0 + mov ah,255 +bhloop1: cmp [es:di],ah + jnz nofill + movsb + loop bhloop1 + jmp nextline +nofill: inc di + inc si + loop bhloop1 +nextline: add di,dx + pop cx + dec ch + jnz bhloop2 + ret + + endp + + + + + + + +Frameoutfx proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + add dx,cx + pop cx + +frameloopfx1: push cx + mov ch,0 + +frameloopfx2: lodsb + cmp al,0 + jnz backtosolidfx +backtootherfx: dec di + loop frameloopfx2 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + +frameloopfx3: lodsb + cmp al,0 + jz backtootherfx +backtosolidfx: mov [es:di],al + dec di + loop frameloopfx3 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + + endp + + + + +;---------------------------------------------------Transfers for extra data---- + +Transferinv proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + + + + + + + + + +Transfermap proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + +;------------------------------------------------------------------Filenames---- + + +Spritename1 db "DREAMWEB.S00",0 +Spritename3 db "DREAMWEB.S02",0 + +Idname db "INSTALL.DAT",0 + +Characterset1 db "DREAMWEB.C00",0 +Characterset2 db "DREAMWEB.C01",0 +Characterset3 db "DREAMWEB.C02",0 + +Samplename db "DREAMWEB.V00",0 + +Basicsample db "DREAMWEB.V99",0 + +Icongraphics0 db "DREAMWEB.G00",0 +Icongraphics1 db "DREAMWEB.G01",0 +Extragraphics1 db "DREAMWEB.G02",0 +Icongraphics8 db "DREAMWEB.G08",0 +Mongraphicname db "DREAMWEB.G03",0 +Mongraphics2 db "DREAMWEB.G07",0 +Cityname db "DREAMWEB.G04",0 +Travelgraphic1 db "DREAMWEB.G05",0 +Travelgraphic2 db "DREAMWEB.G06",0 +Diarygraphic db "DREAMWEB.G14",0 + +Monitorfile1 db "DREAMWEB.T01",0 +Monitorfile2 db "DREAMWEB.T02",0 +Monitorfile10 db "DREAMWEB.T10",0 ;News items 10-13 +Monitorfile11 db "DREAMWEB.T11",0 +Monitorfile12 db "DREAMWEB.T12",0 +Monitorfile13 db "DREAMWEB.T13",0 +Monitorfile20 db "DREAMWEB.T20",0 +Monitorfile21 db "DREAMWEB.T21",0 ;Ryan's private stuff +Monitorfile22 db "DREAMWEB.T22",0 ;Use for blank carts +Monitorfile23 db "DREAMWEB.T23",0 ;Use for edens cart +Monitorfile24 db "DREAMWEB.T24",0 ;Use for church cart +Foldertext db "DREAMWEB.T50",0 +Diarytext db "DREAMWEB.T51",0 +Puzzletextname db "DREAMWEB.T80",0 ;puzzle text +Traveltextname db "DREAMWEB.T81",0 ;location descriptions +Introtextname db "DREAMWEB.T82",0 ;intro sequence +Endtextname db "DREAMWEB.T83",0 ;end sequence/credits +Commandtextname db "DREAMWEB.T84",0 ;commands + +Volumetabname db "DREAMWEB.VOL",0 + +Foldergraphic1 db "DREAMWEB.G09",0 +Foldergraphic2 db "DREAMWEB.G10",0 +Foldergraphic3 db "DREAMWEB.G11",0 +Symbolgraphic db "DREAMWEB.G12",0 +Gungraphic db "DREAMWEB.G13",0 +Monkface db "DREAMWEB.G15",0 + +Title0graphics db "DREAMWEB.I00",0 +Title1graphics db "DREAMWEB.I01",0 +Title2graphics db "DREAMWEB.I02",0 +Title3graphics db "DREAMWEB.I03",0 +Title4graphics db "DREAMWEB.I04",0 +Title5graphics db "DREAMWEB.I05",0 +Title6graphics db "DREAMWEB.I06",0 +Title7graphics db "DREAMWEB.I07",0 + +Palettescreen db "DREAMWEB.PAL",0 + + + \ No newline at end of file -- cgit v1.2.3 From 054555f78e7e81c3da31be39cb4bd583c1124d6f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jun 2011 22:39:05 +1000 Subject: TSAGE: Implemented the _soServiceTrackType0 method --- engines/tsage/sound.cpp | 543 ++++++++++++++++++++++++++++++++++++++++++++---- engines/tsage/sound.h | 73 +++++-- 2 files changed, 559 insertions(+), 57 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 64ac602be7..625c687320 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -40,7 +40,7 @@ SoundManager::SoundManager() { _ourDrvResVersion = 0x10A; for (int i = 0; i < SOUND_ARR_SIZE; ++i) - _voiceStructPtrs[i] = NULL; + _voiceTypeStructPtrs[i] = NULL; _groupsAvail = 0; _masterVol = 127; @@ -49,6 +49,8 @@ SoundManager::SoundManager() { _suspendedCount = 0; _driversDetected = false; _needToRethink = false; + + _soTimeIndexFlag = false; } SoundManager::~SoundManager() { @@ -371,22 +373,21 @@ void SoundManager::_sfProcessFading() { void SoundManager::_sfUpdateVoiceStructs() { for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { - VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; for (uint idx = 0; idx < vs->_entries.size(); ++idx) { VoiceStructEntry &vse = vs->_entries[idx]; if (vs->_voiceType == VOICETYPE_0) { - vse._field4 = vse._fieldC; - vse._field6 = vse._fieldE; - vse._field8 = vse._field10; - vse._field9 = vse._field11; - vse._fieldA = vse._field12; + vse._type0._sound = vse._type0._sound2; + vse._type0._channelNum = vse._type0._channelNum2; + vse._type0._field9 = vse._type0._field11; + vse._type0._fieldA = vse._type0._field12; } else { - vse._field8 = vse._fieldE; - vse._fieldA = vse._field10; - vse._fieldC = vse._field12; - vse._fieldD = vse._field13; + vse._type1._field8 = vse._type1._fieldE; + vse._type1._fieldA = vse._type1._field10; + vse._type1._fieldC = vse._type1._field12; + vse._type1._fieldD = vse._type1._field13; } } } @@ -421,10 +422,6 @@ SoundManager &SoundManager::sfManager() { return *_soundManager; } -void SoundManager::_soSetTimeIndex(int timeIndex) { - warning("TODO: _soSetTimeIndex"); -} - int SoundManager::_sfDetermineGroup(const byte *soundData) { const byte *p = soundData + READ_LE_UINT16(soundData + 8); uint32 v; @@ -464,9 +461,9 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { void SoundManager::_sfRethinkSoundDrivers() { // Free any existing entries for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { - if (sfManager()._voiceStructPtrs[idx]) { - delete sfManager()._voiceStructPtrs[idx]; - sfManager()._voiceStructPtrs[idx] = NULL; + if (sfManager()._voiceTypeStructPtrs[idx]) { + delete sfManager()._voiceTypeStructPtrs[idx]; + sfManager()._voiceTypeStructPtrs[idx] = NULL; } } @@ -513,8 +510,8 @@ void SoundManager::_sfRethinkSoundDrivers() { int dataSize = !flag ? total * 28 + 30 : total * 26 + 30; debugC(9, ktSageSound, "data Size = %d\n", dataSize); - VoiceStruct *vs = new VoiceStruct(); - sfManager()._voiceStructPtrs[idx] = vs; + VoiceTypeStruct *vs = new VoiceTypeStruct(); + sfManager()._voiceTypeStructPtrs[idx] = vs; if (!flag) { vs->_voiceType = VOICETYPE_0; @@ -539,11 +536,10 @@ void SoundManager::_sfRethinkSoundDrivers() { VoiceStructEntry ve; ve._field1 = (byteVal & 0x80) ? 0 : 1; ve._driver = driver; - ve._field4 = 0; - ve._field6 = 0; - ve._field8 = 0; - ve._field9 = 0; - ve._fieldA = 0; + ve._type0._sound = NULL; + ve._type0._channelNum = 0; + ve._type0._field9 = 0; + ve._type0._fieldA = 0; vs->_entries.push_back(ve); } @@ -555,12 +551,13 @@ void SoundManager::_sfRethinkSoundDrivers() { VoiceStructEntry ve; ve._field0 = idx; ve._driver = driver; - ve._field4 = 0xff; - ve._field6 = 0; - ve._field8 = 0; - ve._fieldA = 0; - ve._fieldC = 0; - ve._fieldD = 0; + ve._type1._field4 = 0xff; + ve._type1._field5 = 0; + ve._type1._field6 = 0; + ve._type1._field8 = 0; + ve._type1._fieldA = 0; + ve._type1._fieldC = 0; + ve._type1._fieldD = 0; vs->_entries.push_back(ve); } @@ -581,7 +578,75 @@ void SoundManager::_sfRethinkVoiceTypes() { ++sfManager()._serverSuspendedCount; _sfDereferenceAll(); + // Pre-processing + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; + if (!vs) + continue; + + if (vs->_voiceType == VOICETYPE_0) { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._type0._sound3 = vse._type0._sound; + vse._type0._channelNum3 = vse._type0._channelNum; + vse._type0._field19 = vse._type0._field9; + vse._type0._field1A = vse._type0._fieldA; + vse._type0._sound = NULL; + vse._type0._channelNum = 0; + vse._type0._field9 = 0; + vse._type0._fieldA = 0; + vse._type0._sound2 = NULL; + vse._type0._channelNum2 = 0; + vse._type0._field11 = 0; + vse._type0._field12 = 0; + } + } else { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._type1._field14 = vse._type1._field8; + vse._type1._field16 = vse._type1._fieldA; + vse._type1._field18 = vse._type1._fieldC; + vse._type1._field19 = vse._type1._fieldD; + vse._type1._field8 = 0; + vse._type1._fieldA = 0; + vse._type1._fieldC = 0; + vse._type1._fieldD = 0; + vse._type1._fieldE = 0; + vse._type1._field10 = 0; + vse._type1._field12 = 0; + } + } + } + + // Post-processing + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; + if (!vs) + continue; + + if (vs->_voiceType == VOICETYPE_0) { + // Type 0 + } else { + // Type 1 + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._type1._field8 = 0; + vse._type1._fieldA = 0; + vse._type1._fieldC = 0; + vse._type1._fieldD = 0; + } + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + if (vse._type1._fieldE | vse._type1._field10) { + //dx = vse._field10; + //ax = vse._fieldE; + //si = 0; + } + } + } + } } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -738,7 +803,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { ++_soundManager->_serverSuspendedCount; for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { - VoiceStruct *vs = sfManager()._voiceStructPtrs[voiceIndex]; + VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; if (!vs) continue; @@ -747,13 +812,13 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { SoundDriver *driver = vse._driver; if (vs->_voiceType == VOICETYPE_0) { - if (!vse._field4 && !vse._field6) { - int vol = sound->_volume * sound->_chVolume[vse._field8] / 127; + if (!vse._type0._sound) { + int vol = sound->_volume * sound->_chVolume[vse._type0._channelNum] / 127; driver->setVolume0(voiceIndex, vse._field0, 7, vol); } } else { - if (!vse._field8 && !vse._fieldA) { - int vol = sound->_volume * sound->_chVolume[vse._fieldC] / 127; + if (!vse._type1._field8 && !vse._type1._fieldA) { + int vol = sound->_volume * sound->_chVolume[vse._type1._fieldC] / 127; driver->setVolume1(voiceIndex, vse._field0, 7, vol); } } @@ -818,7 +883,7 @@ void Sound::unPrime() { stop(); } -void Sound::_prime(int soundResID, bool queFlag) { +void Sound::_prime(int soundResID, bool queueFlag) { if (_primed) unPrime(); @@ -849,7 +914,8 @@ void Sound::_prime(int soundResID, bool queFlag) { _remoteReceiver = ALLOCATE(200); } - if (queFlag) + _soPrimeSound(queueFlag); + if (queueFlag) _soundManager->addToSoundList(this); _primed = true; @@ -975,7 +1041,7 @@ void Sound::fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeF void Sound::setTimeIndex(uint32 timeIndex) { if (_primed) { mute(true); - SoundManager::_soSetTimeIndex(timeIndex); + _soSetTimeIndex(timeIndex); mute(false); } } @@ -1037,6 +1103,405 @@ void Sound::release() { _hold = -1; } + +void Sound::_soPrimeSound(bool queueFlag) { + if (!queueFlag) { + _priority = (_fixedPriority != -1) ? _fixedPriority : _sndResPriority; + _loop = !_fixedLoop ? _fixedLoop : _sndResLoop; + _pausedCount = 0; + _mutedCount = 0; + _hold = -1; + _cueValue = -1; + _fadeDest = -1; + _fadeSteps = 0; + _fadeTicks = 0; + _fadeCounter = 0; + _stopAfterFadeFlag = false; + } + + _timer = 0; + _loopTimer = 0; + _soPrimeChannelData(); +} + +void Sound::_soPrimeChannelData() { + if (_isEmpty) { + for (int idx = 0; idx < 16; ++idx) { + _chProgram[idx] = 0; + _chModulation[idx] = 0; + _chVolume[idx] = 127; + _chPan[idx] = 64; + _chDamper[idx] = 0; + _chVoiceType[idx] = VOICETYPE_0; + _chNumVoices[idx] = 0; + _chSubPriority[idx] = 0; + _chPitchBlend[idx] = 0x2000; + _chFlags[idx] = 1; + } + + _trkChannel[0] = 0; + _trkState[0] = 1; + _trkLoopState[0] = 1; + _trkIndex[0] = 0; + _trkLoopIndex[0] = 0; + } else { + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) + _chFlags[idx] = 0x8000; + + for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { + byte *d = _channelData[idx]; + int mode = *d; + int channelNum = (int8)*(d + 1); + assert((channelNum >= 0) && (channelNum < 16)); + + _chProgram[idx] = *(d + 10); + _chModulation[idx] = 0; + _chVolume[idx] = *(d + 11); + _chPan[idx] = *(d + 12); + _chDamper[idx] = 0; + _chVoiceType[idx] = _trackInfo._voiceTypes[idx]; + _chNumVoices[idx] = *(d + 6); + _chSubPriority[idx] = *(d + 7); + _chPitchBlend[idx] = 0x2000; + _chFlags[idx] = READ_LE_UINT16(d + 8); + + if (mode == 0) { + _trkState[idx] = 1; + _trkLoopState[idx] = 1; + _trkIndex[idx] = 14; + _trkLoopIndex[idx] = 14; + _trkRest[idx] = 0; + _trkLoopRest[idx] = 0; + } else if (mode == 1) { + _trkState[idx] = 1; + _trkLoopState[idx] = 1; + _trkIndex[idx] = 0; + _trkLoopIndex[idx] = 0; + _trkRest[idx] = 0; + _trkLoopRest[idx] = 0; + } else { + error("Unknown sound mode encountered"); + } + } + } +} + +void Sound::_soSetTimeIndex(uint timeIndex) { + ++_soundManager->_serverDisabledCount; + + if (timeIndex != _timer) { + _soundManager->_soTimeIndexFlag = true; + _timer = 0; + _loopTimer = 0; + _soPrimeChannelData(); + + while (timeIndex > 0) { + if (_soServiceTracks()) { + SoundManager::_sfDoRemoveFromPlayList(this); + _stoppedAsynchronously = true; + _soundManager->_needToRethink = true; + break; + } + } + + _soundManager->_soTimeIndexFlag = false; + } + + --_soundManager->_serverDisabledCount; +} + +bool Sound::_soServiceTracks() { + if (_isEmpty) { + assert("TODO: Service empty sound"); + return 0; + } + + bool flag = true; + for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { + int mode = *_channelData[trackCtr]; + + if (mode == 0) { + _soServiceTrackType0(trackCtr, _channelData[trackCtr]); + } else if (mode == 1) { + _soServiceTrackType1(trackCtr, _channelData[trackCtr]); + } else { + error("Unknown sound mode encountered"); + } + + if (_trkState[trackCtr]) + flag = false; + } + + if (!flag) + return false; + else if ((_loop > 0) && (--_loop == 0)) + return true; + else { + for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { + _trkState[trackCtr] = _trkLoopState[trackCtr]; + _trkRest[trackCtr] = _trkLoopRest[trackCtr]; + _trkIndex[trackCtr] = _trkLoopIndex[trackCtr]; + } + + _timer = _loopTimer; + return false; + } +} + +void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { + if (_trkRest[trackIndex]) { + --_trkRest[trackIndex]; + return; + } + if (!_trkState[trackIndex]) + return; + + int channelNum = _trkChannel[trackIndex]; + int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum]; + int var1A = -1; + SoundDriver *driver = NULL; + + VoiceTypeStruct *vtStruct; + VoiceType voiceType = VOICETYPE_0, chVoiceType = VOICETYPE_0; + + if ((channelNum == -1) || _soundManager->_soTimeIndexFlag) { + vtStruct = NULL; + voiceType = VOICETYPE_0; + } else { + chVoiceType = (VoiceType)_chVoiceType[channelNum]; + vtStruct = _soundManager->_voiceTypeStructPtrs[channelNum]; + + if (vtStruct) { + voiceType = vtStruct->_voiceType; + if (voiceType == VOICETYPE_0) { + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (!vtStruct->_entries[idx]._type0._sound && + (vtStruct->_entries[idx]._type0._channelNum != channelNum)) { + var1A = vtStruct->_entries[idx]._field0; + driver = vtStruct->_entries[idx]._driver; + break; + } + } + } + } + } + + const byte *pData = channelData + _trkIndex[trackIndex]; + + for (;;) { + byte v = *pData++; + if (!(v & 0x80)) { + // Area #1 + if (!_soundManager->_soTimeIndexFlag) { + // Only do processing if fast forwarding to a given time index + if (channelNum != -1) { + if (voiceType == VOICETYPE_1) { + // TODO: sub_25D49 + error("TODO"); + } else if (var1A != -1) { + assert(driver); + driver->proc18(var1A, chVoiceType); + } + } + } + } else if (!(v & 0x40)) { + // Area #2 + if (!_soundManager->_soTimeIndexFlag) { + // Only do processing if fast forwarding to a given time index + byte b = *pData++; + v <<= 1; + if (b & 0x80) + v |= 1; + + b &= 0x7f; + + if (channelNum != -1) { + if (voiceType == VOICETYPE_1) { + // TODO: sub_25E32/sub_25DD8 + if (chFlags & 0x10) + error("TODO: sub_25E32"); + else + error("TODO: sub_25DD8"); + } else if (var1A != -1) { + assert(driver); + driver->proc20(var1A, chVoiceType); + } + } + } else { + ++pData; + } + } else if (!(v & 0x20)) { + // Area #3 + v &= 0x1f; + + // Gather up an extended number + int trkRest = v; + while ((*pData & 0xE0) == 0xC0) { + byte b = *pData++; + trkRest = (trkRest << 5) | (b & 0x1f); + } + + _trkRest[trackIndex] = trkRest; + _trkIndex[trackIndex] = pData - channelData; + return; + } else if (!(v & 0x10)) { + // Area #4 + v = (v & 0xf) << 1; + + byte b = *pData++; + if (b & 0x80) + v |= 1; + b &= 0x7f; + + assert(v < 4); + int cmdList[32] = { 1, 7, 10, 64 }; + int cmdVal = cmdList[v]; + + if (channelNum == -1) { + if (_soDoUpdateTracks(cmdVal, b)) + return; + } else { + _soDoTrackCommand(_trkChannel[trackIndex], cmdVal, b); + + if (!_soundManager->_soTimeIndexFlag) { + if (voiceType != VOICETYPE_0) { + error("sub_25F0E"); + } else if (var1A != -1) { + assert(driver); + driver->setVolume0(var1A, chVoiceType, cmdVal, b); + } + } + } + } else if (!(v & 0x8)) { + // Area #5 + if (!_soundManager->_soTimeIndexFlag) { + // Only do processing if fast forwarding to a given time index + int cx = READ_LE_UINT16(pData); + pData += 2; + + if (channelNum != -1) { + assert(driver); + driver->proc22(var1A, chVoiceType, cx); + } + } else { + pData += 2; + } + } else if (!(v & 0x4)) { + // Area #6 + int cmd = *pData++; + int value = *pData++; + + if (channelNum != -1) { + _soDoTrackCommand(_trkChannel[trackIndex], cmd, value); + + if (!_soundManager->_soTimeIndexFlag) { + if (voiceType != VOICETYPE_0) { + error("sub_25F0E"); + } else if (var1A != -1) { + assert(driver); + driver->setVolume0(var1A, chVoiceType, cmd, value); + } + } + } else if (_soDoUpdateTracks(cmd, value)) { + return; + } + } else if (!(v & 0x2)) { + // Area #7 + if (!_soundManager->_soTimeIndexFlag) { + int pitchBlend = READ_LE_UINT16(pData); + pData += 2; + + if (channelNum != -1) { + int channel = _trkChannel[trackIndex]; + _chPitchBlend[channel] = pitchBlend; + + if (voiceType != VOICETYPE_0) { + error("sub_25FD0"); + } else if (var1A != -1) { + assert(driver); + driver->setPitchBlend(channel, pitchBlend); + } + } + } else { + pData += 2; + } + } else if (!(v & 0x1)) { + // Area #8 + int program = *pData++; + + if (channelNum != -1) { + int channel = _trkChannel[trackIndex]; + _chProgram[channel] = program; + + if (!_soundManager->_soTimeIndexFlag) { + if ((voiceType == VOICETYPE_0) && (var1A != -1)) { + assert(driver); + driver->setProgram(var1A, program); + } + } + } else { + error("sub_260C3"); + } + + } else { + // Area #9 + byte b = *pData++; + + if (b & 0x80) { + _trkState[trackIndex] = 0; + _trkIndex[trackIndex] = pData - channelData; + return; + } + + if (!_soundManager->_soTimeIndexFlag) { + if ((channelNum != -1) && (voiceType == VOICETYPE_0) && (var1A != -1)) { + assert(driver); + driver->setVolume1(var1A, chVoiceType, 0, b); + } + + } + } + } +} + +void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { + +} + +void Sound::_soDoTrackCommand(int channelNum, int command, int value) { + switch (command) { + case 1: + _chModulation[channelNum] = value; + break; + case 7: + _chVolume[channelNum] = value; + break; + case 10: + _chPan[channelNum] = value; + break; + case 64: + _chDamper[channelNum] = value; + break; + case 75: + _chNumVoices[channelNum] = value; + break; + } +} + +bool Sound::_soDoUpdateTracks(int command, int value) { + if ((command == 76) || (_hold != value)) + return false; + + for (int trackIndex = 0; trackIndex < _trackInfo._numTracks; ++trackIndex) { + _trkState[trackIndex] = _trkLoopState[trackIndex]; + _trkRest[trackIndex] = _trkLoopRest[trackIndex]; + _trkIndex[trackIndex] = _trkLoopIndex[trackIndex]; + } + + _timer = _loopTimer; + return true; +} + /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 9765059489..1b5ee04f05 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -46,6 +46,7 @@ struct trackInfoStruct { }; enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2}; +enum VoiceType {VOICETYPE_0 = 0, VOICETYPE_1 = 1}; class SoundDriverEntry { public: @@ -80,19 +81,40 @@ public: virtual bool open() { return true; } virtual void close() {} virtual const GroupData *getGroupData() = 0; - virtual void setMasterVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void poll() {} + virtual void setMasterVolume(int volume) {} + virtual void proc18(int al, VoiceType voiceType) {} + virtual void proc20(int al, VoiceType voiceType) {} + virtual void proc22(int al, VoiceType voiceType, int v3) {} virtual void setVolume0(int channel, int v2, int v3, int volume) {} + virtual void setProgram(int channel, int program) {} virtual void setVolume1(int channel, int v2, int v3, int volume) {} + virtual void setPitchBlend(int channel, int pitchBlend) {} virtual void play(const byte *data, int size, int channel, int volume) {} - virtual void poll() {} }; -struct VoiceStructEntry { - int _field0; - int _field1; - SoundDriver *_driver; +struct VoiceStructEntryType0 { + Sound *_sound; + int _channelNum; + int _field9; + int _fieldA; + Sound *_sound2; + int _channelNum2; + int _field11; + int _field12; + int _field13; + Sound *_sound3; + int _field16; + int _channelNum3; + int _field19; + int _field1A; + int _field1B; +}; + +struct VoiceStructEntryType1 { int _field4; + int _field5; int _field6; int _field8; int _field9; @@ -108,18 +130,23 @@ struct VoiceStructEntry { int _field16; int _field18; int _field19; - - int _field1A; - int _field1B; }; -enum VoiceType {VOICETYPE_0 = 0, VOICETYPE_1 = 1}; +struct VoiceStructEntry { + int _field0; + int _field1; + SoundDriver *_driver; + + VoiceStructEntryType0 _type0; + VoiceStructEntryType1 _type1; +}; -class VoiceStruct { +class VoiceTypeStruct { public: VoiceType _voiceType; int _field1; int _field2; + int _field3; Common::Array _entries; }; @@ -132,7 +159,7 @@ public: int _ourSndResVersion, _ourDrvResVersion; Common::List _playList; Common::List _installedDrivers; - VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; + VoiceTypeStruct *_voiceTypeStructPtrs[SOUND_ARR_SIZE]; uint32 _groupsAvail; int _masterVol; int _serverDisabledCount; @@ -142,6 +169,8 @@ public: Common::List _soundList; Common::List _availableDrivers; bool _needToRethink; + // Misc flags + bool _soTimeIndexFlag; public: SoundManager(); ~SoundManager(); @@ -186,10 +215,9 @@ public: void loadSound(int soundNum, bool showErrors); void unloadSound(int soundNum); - // _so methods + // _sf methods static SoundManager &sfManager(); static void _sfTerminate(); - static void _soSetTimeIndex(int timeIndex); static int _sfDetermineGroup(const byte *soundData); static void _sfAddToPlayList(Sound *sound); static void _sfRemoveFromPlayList(Sound *sound); @@ -216,7 +244,7 @@ public: class Sound: public EventHandler { private: - void _prime(int soundResID, bool queFlag); + void _prime(int soundResID, bool queueFlag); void _unPrime(); void orientAfterRestore(); public: @@ -226,11 +254,11 @@ public: int _group; int _sndResPriority; int _fixedPriority; - int _sndResLoop; + bool _sndResLoop; bool _fixedLoop; int _priority; int _volume; - bool _loop; + int _loop; int _pausedCount; int _mutedCount; int _hold; @@ -296,8 +324,17 @@ public: bool getLoop(); void holdAt(int amount); void release(); - void orientAfterDriverChange(); + + // _so methods + void _soPrimeSound(bool queueFlag); + void _soSetTimeIndex(uint timeIndex); + void _soPrimeChannelData(); + bool _soServiceTracks(); + void _soServiceTrackType0(int trackIndex, const byte *channelData); + void _soServiceTrackType1(int trackIndex, const byte *channelData); + void _soDoTrackCommand(int channelNum, int command, int value); + bool _soDoUpdateTracks(int command, int value); }; class ASound: public EventHandler { -- cgit v1.2.3 From 1923c0d0a94947ad6efc5af78476b61fa026c163 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 6 Jun 2011 22:15:03 +1000 Subject: TSAGE: Started implementing support methods for track servicing --- engines/tsage/sound.cpp | 298 +++++++++++++++++++++++++++++++----------------- engines/tsage/sound.h | 26 ++--- 2 files changed, 204 insertions(+), 120 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 625c687320..db1532253a 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -368,7 +368,63 @@ void SoundManager::_sfSoundServer() { } void SoundManager::_sfProcessFading() { - //TODO + // Loop through processing active sounds + bool removeFlag = false; + Common::List::iterator i = sfManager()._playList.begin(); + while (i != sfManager()._playList.end()) { + Sound *s = *i; + ++i; + + if (!s->_pausedCount) + removeFlag = s->_soServiceTracks(); + if (removeFlag) { + _sfDoRemoveFromPlayList(s); + s->_stoppedAsynchronously = true; + sfManager()._needToRethink = true; + } + + if (s->_fadeDest != 255) { + if (s->_fadeCounter != 0) + --s->_fadeCounter; + else { + if (s->_volume >= s->_fadeDest) { + if ((s->_fadeDest - s->_volume) > s->_fadeSteps) + s->_volume += s->_fadeSteps; + else + s->_volume = s->_fadeDest; + } else { + if (s->_fadeDest > s->_fadeSteps) + s->_volume -= s->_fadeSteps; + else + s->_volume = s->_fadeDest; + } + + _sfDoUpdateVolume(s); + if (s->_volume != s->_fadeDest) + s->_fadeCounter = s->_fadeTicks; + else { + s->_fadeDest = -1; + if (s->_stopAfterFadeFlag) { + _sfDoRemoveFromPlayList(s); + s->_stoppedAsynchronously = true; + sfManager()._needToRethink = true; + } + } + } + } + } + + // Loop through the voiceType list + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceTypeStruct &voiceType = *sfManager()._voiceTypeStructPtrs[voiceIndex]; + + if (voiceType._voiceType == VOICETYPE_1) { + for (uint idx = 0; idx < voiceType._entries.size(); ++idx) { + if (voiceType._entries[idx]._type1._field6 >= -1) + ++voiceType._entries[idx]._type1._field6; + } + } + } } void SoundManager::_sfUpdateVoiceStructs() { @@ -384,9 +440,8 @@ void SoundManager::_sfUpdateVoiceStructs() { vse._type0._field9 = vse._type0._field11; vse._type0._fieldA = vse._type0._field12; } else { - vse._type1._field8 = vse._type1._fieldE; - vse._type1._fieldA = vse._type1._field10; - vse._type1._fieldC = vse._type1._field12; + vse._type1._sound = vse._type1._sound2; + vse._type1._channelNum = vse._type1._channelNum2; vse._type1._fieldD = vse._type1._field13; } } @@ -549,14 +604,13 @@ void SoundManager::_sfRethinkSoundDrivers() { for (int idx = 0; idx < byteVal; ++idx) { VoiceStructEntry ve; - ve._field0 = idx; + ve._voiceNum = idx; ve._driver = driver; ve._type1._field4 = 0xff; ve._type1._field5 = 0; ve._type1._field6 = 0; - ve._type1._field8 = 0; - ve._type1._fieldA = 0; - ve._type1._fieldC = 0; + ve._type1._sound = NULL; + ve._type1._channelNum = 0; ve._type1._fieldD = 0; vs->_entries.push_back(ve); @@ -603,21 +657,18 @@ void SoundManager::_sfRethinkVoiceTypes() { } else { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._field14 = vse._type1._field8; - vse._type1._field16 = vse._type1._fieldA; - vse._type1._field18 = vse._type1._fieldC; + vse._type1._sound3 = vse._type1._sound; + vse._type1._channelNum3 = vse._type1._channelNum; vse._type1._field19 = vse._type1._fieldD; - vse._type1._field8 = 0; - vse._type1._fieldA = 0; - vse._type1._fieldC = 0; + vse._type1._sound = NULL; + vse._type1._channelNum = 0; vse._type1._fieldD = 0; - vse._type1._fieldE = 0; - vse._type1._field10 = 0; - vse._type1._field12 = 0; + vse._type1._sound2 = NULL; + vse._type1._channelNum2 = 0; } } } - +//TODO: Lots of this method // Post-processing for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; @@ -631,17 +682,15 @@ void SoundManager::_sfRethinkVoiceTypes() { // Type 1 for (uint idx = 0; idx < vs->_entries.size(); ++idx) { VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._field8 = 0; - vse._type1._fieldA = 0; - vse._type1._fieldC = 0; + vse._type1._sound = NULL; + vse._type1._channelNum = 0; vse._type1._fieldD = 0; } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { VoiceStructEntry &vse = vs->_entries[idx]; - if (vse._type1._fieldE | vse._type1._field10) { - //dx = vse._field10; - //ax = vse._fieldE; + if (vse._type1._sound2) { + //dx/ax = vse._sound2; //si = 0; } } @@ -814,12 +863,12 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { if (vs->_voiceType == VOICETYPE_0) { if (!vse._type0._sound) { int vol = sound->_volume * sound->_chVolume[vse._type0._channelNum] / 127; - driver->setVolume0(voiceIndex, vse._field0, 7, vol); + driver->setVolume0(voiceIndex, vse._voiceNum, 7, vol); } } else { - if (!vse._type1._field8 && !vse._type1._fieldA) { - int vol = sound->_volume * sound->_chVolume[vse._type1._fieldC] / 127; - driver->setVolume1(voiceIndex, vse._field0, 7, vol); + if (!vse._type1._sound) { + int vol = sound->_volume * sound->_chVolume[vse._type1._channelNum] / 127; + driver->setVolume1(voiceIndex, vse._voiceNum, 7, vol); } } } @@ -1124,6 +1173,68 @@ void Sound::_soPrimeSound(bool queueFlag) { _soPrimeChannelData(); } +void Sound::_soSetTimeIndex(uint timeIndex) { + ++_soundManager->_serverDisabledCount; + + if (timeIndex != _timer) { + _soundManager->_soTimeIndexFlag = true; + _timer = 0; + _loopTimer = 0; + _soPrimeChannelData(); + + while (timeIndex > 0) { + if (_soServiceTracks()) { + SoundManager::_sfDoRemoveFromPlayList(this); + _stoppedAsynchronously = true; + _soundManager->_needToRethink = true; + break; + } + } + + _soundManager->_soTimeIndexFlag = false; + } + + --_soundManager->_serverDisabledCount; +} + +bool Sound::_soServiceTracks() { + if (_isEmpty) { + _soRemoteReceive(); + return false; + } + + bool flag = true; + for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { + int mode = *_channelData[trackCtr]; + + if (mode == 0) { + _soServiceTrackType0(trackCtr, _channelData[trackCtr]); + } else if (mode == 1) { + _soServiceTrackType1(trackCtr, _channelData[trackCtr]); + } else { + error("Unknown sound mode encountered"); + } + + if (_trkState[trackCtr]) + flag = false; + } + + if (!flag) + return false; + else if ((_loop > 0) && (--_loop == 0)) + return true; + else { + for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { + _trkState[trackCtr] = _trkLoopState[trackCtr]; + _trkRest[trackCtr] = _trkLoopRest[trackCtr]; + _trkIndex[trackCtr] = _trkLoopIndex[trackCtr]; + } + + _timer = _loopTimer; + return false; + } +} + void Sound::_soPrimeChannelData() { if (_isEmpty) { for (int idx = 0; idx < 16; ++idx) { @@ -1186,66 +1297,8 @@ void Sound::_soPrimeChannelData() { } } -void Sound::_soSetTimeIndex(uint timeIndex) { - ++_soundManager->_serverDisabledCount; - - if (timeIndex != _timer) { - _soundManager->_soTimeIndexFlag = true; - _timer = 0; - _loopTimer = 0; - _soPrimeChannelData(); - - while (timeIndex > 0) { - if (_soServiceTracks()) { - SoundManager::_sfDoRemoveFromPlayList(this); - _stoppedAsynchronously = true; - _soundManager->_needToRethink = true; - break; - } - } - - _soundManager->_soTimeIndexFlag = false; - } - - --_soundManager->_serverDisabledCount; -} - -bool Sound::_soServiceTracks() { - if (_isEmpty) { - assert("TODO: Service empty sound"); - return 0; - } - - bool flag = true; - for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { - int mode = *_channelData[trackCtr]; - - if (mode == 0) { - _soServiceTrackType0(trackCtr, _channelData[trackCtr]); - } else if (mode == 1) { - _soServiceTrackType1(trackCtr, _channelData[trackCtr]); - } else { - error("Unknown sound mode encountered"); - } - - if (_trkState[trackCtr]) - flag = false; - } - - if (!flag) - return false; - else if ((_loop > 0) && (--_loop == 0)) - return true; - else { - for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { - _trkState[trackCtr] = _trkLoopState[trackCtr]; - _trkRest[trackCtr] = _trkLoopRest[trackCtr]; - _trkIndex[trackCtr] = _trkLoopIndex[trackCtr]; - } - - _timer = _loopTimer; - return false; - } +void Sound::_soRemoteReceive() { + error("_soRemoteReceive not implemented"); } void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { @@ -1258,7 +1311,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { int channelNum = _trkChannel[trackIndex]; int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum]; - int var1A = -1; + int voiceNum = -1; SoundDriver *driver = NULL; VoiceTypeStruct *vtStruct; @@ -1277,7 +1330,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (!vtStruct->_entries[idx]._type0._sound && (vtStruct->_entries[idx]._type0._channelNum != channelNum)) { - var1A = vtStruct->_entries[idx]._field0; + voiceNum = vtStruct->_entries[idx]._voiceNum; driver = vtStruct->_entries[idx]._driver; break; } @@ -1296,11 +1349,10 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { // Only do processing if fast forwarding to a given time index if (channelNum != -1) { if (voiceType == VOICETYPE_1) { - // TODO: sub_25D49 - error("TODO"); - } else if (var1A != -1) { + _soUpdateDamper(vtStruct, channelNum, chVoiceType, v); + } else if (voiceNum != -1) { assert(driver); - driver->proc18(var1A, chVoiceType); + driver->proc18(voiceNum, chVoiceType); } } } @@ -1322,9 +1374,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { error("TODO: sub_25E32"); else error("TODO: sub_25DD8"); - } else if (var1A != -1) { + } else if (voiceNum != -1) { assert(driver); - driver->proc20(var1A, chVoiceType); + driver->proc20(voiceNum, chVoiceType); } } } else { @@ -1366,9 +1418,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (!_soundManager->_soTimeIndexFlag) { if (voiceType != VOICETYPE_0) { error("sub_25F0E"); - } else if (var1A != -1) { + } else if (voiceNum != -1) { assert(driver); - driver->setVolume0(var1A, chVoiceType, cmdVal, b); + driver->setVolume0(voiceNum, chVoiceType, cmdVal, b); } } } @@ -1381,7 +1433,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (channelNum != -1) { assert(driver); - driver->proc22(var1A, chVoiceType, cx); + driver->proc22(voiceNum, chVoiceType, cx); } } else { pData += 2; @@ -1397,9 +1449,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (!_soundManager->_soTimeIndexFlag) { if (voiceType != VOICETYPE_0) { error("sub_25F0E"); - } else if (var1A != -1) { + } else if (voiceNum != -1) { assert(driver); - driver->setVolume0(var1A, chVoiceType, cmd, value); + driver->setVolume0(voiceNum, chVoiceType, cmd, value); } } } else if (_soDoUpdateTracks(cmd, value)) { @@ -1417,7 +1469,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (voiceType != VOICETYPE_0) { error("sub_25FD0"); - } else if (var1A != -1) { + } else if (voiceNum != -1) { assert(driver); driver->setPitchBlend(channel, pitchBlend); } @@ -1434,9 +1486,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _chProgram[channel] = program; if (!_soundManager->_soTimeIndexFlag) { - if ((voiceType == VOICETYPE_0) && (var1A != -1)) { + if ((voiceType == VOICETYPE_0) && (voiceNum != -1)) { assert(driver); - driver->setProgram(var1A, program); + driver->setProgram(voiceNum, program); } } } else { @@ -1454,9 +1506,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } if (!_soundManager->_soTimeIndexFlag) { - if ((channelNum != -1) && (voiceType == VOICETYPE_0) && (var1A != -1)) { + if ((channelNum != -1) && (voiceType == VOICETYPE_0) && (voiceNum != -1)) { assert(driver); - driver->setVolume1(var1A, chVoiceType, 0, b); + driver->setVolume1(voiceNum, chVoiceType, 0, b); } } @@ -1464,8 +1516,42 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } } +void Sound::_soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0) { + bool hasDamper = _chDamper[channelNum] != 0; + + for (uint idx = 0; idx < voiceType->_entries.size(); ++idx) { + VoiceStructEntryType1 &vte = voiceType->_entries[idx]._type1; + + if ((vte._field4 == v0) && (vte._channelNum == channelNum) && (vte._sound == this)) { + if (hasDamper) + vte._field5 = 1; + else { + SoundDriver *driver = voiceType->_entries[idx]._driver; + assert(driver); + + vte._field4 = -1; + vte._field5 = 0; + driver->updateVoice(voiceType->_entries[idx]._voiceNum); + } + } + } +} + void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { + if (_soundManager->_soTimeIndexFlag || !_trkState[trackIndex]) + return; + int channel = _trkChannel[trackIndex]; + if (channel == -1) + _trkState[trackIndex] = 0; + else { + VoiceTypeStruct *voiceType = _soundManager->_voiceTypeStructPtrs[_chVoiceType[channel]]; + if (!voiceType) + _trkState[trackIndex] = 0; + else { + + } + } } void Sound::_soDoTrackCommand(int channelNum, int command, int value) { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 1b5ee04f05..1158ce3c87 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -91,7 +91,7 @@ public: virtual void setProgram(int channel, int program) {} virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void setPitchBlend(int channel, int pitchBlend) {} - virtual void play(const byte *data, int size, int channel, int volume) {} + virtual void updateVoice(int voiceNum) {} }; struct VoiceStructEntryType0 { @@ -116,24 +116,19 @@ struct VoiceStructEntryType1 { int _field4; int _field5; int _field6; - int _field8; - int _field9; - int _fieldA; - int _fieldC; + Sound *_sound; + int _channelNum; int _fieldD; - int _fieldE; - int _field10; - int _field11; - int _field12; + Sound *_sound2; + int _channelNum2; int _field13; - int _field14; - int _field16; - int _field18; + Sound *_sound3; + int _channelNum3; int _field19; }; struct VoiceStructEntry { - int _field0; + int _voiceNum; int _field1; SoundDriver *_driver; @@ -329,9 +324,12 @@ public: // _so methods void _soPrimeSound(bool queueFlag); void _soSetTimeIndex(uint timeIndex); - void _soPrimeChannelData(); bool _soServiceTracks(); + void _soPrimeChannelData(); + void _soRemoteReceive(); void _soServiceTrackType0(int trackIndex, const byte *channelData); + void _soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0); + void _soServiceTrackType1(int trackIndex, const byte *channelData); void _soDoTrackCommand(int channelNum, int command, int value); bool _soDoUpdateTracks(int command, int value); -- cgit v1.2.3 From 08c01d116b3abd99d7be61e2459c01e686ea1e29 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 18:40:24 -0400 Subject: TESTBED: Add const modifiers to some parameters/functions --- engines/testbed/config.cpp | 6 +++--- engines/testbed/config.h | 6 +++--- engines/testbed/graphics.cpp | 2 +- engines/testbed/graphics.h | 2 +- engines/testbed/misc.cpp | 2 +- engines/testbed/misc.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 6adf82952f..467d28ad56 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -150,7 +150,7 @@ void TestbedInteractionDialog::addButton(uint w, uint h, const Common::String na _yOffset += h; } -void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, Common::Array &strArray, GUI::ListWidget::ColorList *colors, uint yPadding) { +void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Common::Array &strArray, GUI::ListWidget::ColorList *colors, uint yPadding) { _yOffset += yPadding; GUI::ListWidget *list = new GUI::ListWidget(this, x, y, w, h); list->setEditable(false); @@ -186,13 +186,13 @@ void TestbedConfigManager::writeTestbedConfigToStream(Common::WriteStream *ws) { ws->flush(); } -Common::SeekableReadStream *TestbedConfigManager::getConfigReadStream() { +Common::SeekableReadStream *TestbedConfigManager::getConfigReadStream() const { // Look for config file using SearchMan Common::SeekableReadStream *rs = SearchMan.createReadStreamForMember(_configFileName); return rs; } -Common::WriteStream *TestbedConfigManager::getConfigWriteStream() { +Common::WriteStream *TestbedConfigManager::getConfigWriteStream() const { // Look for config file in game-path const Common::String &path = ConfMan.get("path"); Common::WriteStream *ws; diff --git a/engines/testbed/config.h b/engines/testbed/config.h index c0df65ad32..fd5588aa31 100644 --- a/engines/testbed/config.h +++ b/engines/testbed/config.h @@ -50,8 +50,8 @@ public: ~TestbedConfigManager() {} void selectTestsuites(); void setConfigFile(const Common::String fName) { _configFileName = fName; } - Common::SeekableReadStream *getConfigReadStream(); - Common::WriteStream *getConfigWriteStream(); + Common::SeekableReadStream *getConfigReadStream() const; + Common::WriteStream *getConfigWriteStream() const; void writeTestbedConfigToStream(Common::WriteStream *ws); Testsuite *getTestsuiteByName(const Common::String &name); bool stringToBool(const Common::String str) { return str.equalsIgnoreCase("true") ? true : false; } @@ -119,7 +119,7 @@ public: void addButton(uint w, uint h, const Common::String name, uint32 cmd, uint xOffset = 0, uint yPadding = 8); void addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd); void addText(uint w, uint h, const Common::String text, Graphics::TextAlign textAlign, uint xOffset, uint yPadding = 8); - void addList(uint x, uint y, uint w, uint h, Common::Array &strArray, GUI::ListWidget::ColorList *colors = 0, uint yPadding = 8); + void addList(uint x, uint y, uint w, uint h, const Common::Array &strArray, GUI::ListWidget::ColorList *colors = 0, uint yPadding = 8); protected: Common::Array _buttonArray; uint _xOffset; diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index d5b5da788a..b7f6857c9f 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -102,7 +102,7 @@ void GFXtests::initMousePalette() { CursorMan.replaceCursorPalette(palette, 0, 3); } -Common::Rect GFXtests::computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) { +Common::Rect GFXtests::computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) { if (cursorTargetScale == 1 || scalingFactor == 1) { // Game data and cursor would be scaled equally. // so dimensions would be same. diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h index 7fa8f9d708..07a68b5584 100644 --- a/engines/testbed/graphics.h +++ b/engines/testbed/graphics.h @@ -32,7 +32,7 @@ namespace GFXtests { void drawEllipse(int x, int y, int a, int b); void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = "", int cursorTargetScale = 1); void initMousePalette(); -Common::Rect computeSize(Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale); +Common::Rect computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale); void HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val); Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1); diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp index 642e0b8ae2..034d3eb27e 100644 --- a/engines/testbed/misc.cpp +++ b/engines/testbed/misc.cpp @@ -24,7 +24,7 @@ namespace Testbed { -Common::String MiscTests::getHumanReadableFormat(TimeDate &td) { +Common::String MiscTests::getHumanReadableFormat(const TimeDate &td) { return Common::String::format("%d:%d:%d on %d/%d/%d (dd/mm/yyyy)", td.tm_hour, td.tm_min, td.tm_sec, td.tm_mday, td.tm_mon + 1, td.tm_year + 1900); } diff --git a/engines/testbed/misc.h b/engines/testbed/misc.h index 415fe82903..3f0772c6e5 100644 --- a/engines/testbed/misc.h +++ b/engines/testbed/misc.h @@ -40,7 +40,7 @@ namespace MiscTests { // Miscellaneous tests include testing datetime, timers and mutexes // Helper functions for Misc tests -Common::String getHumanReadableFormat(TimeDate &td); +Common::String getHumanReadableFormat(const TimeDate &td); void timerCallback(void *arg); void criticalSection(void *arg); -- cgit v1.2.3 From 63625428366c8be0ed832924dbdb52f2e81df74e Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 18:49:58 -0400 Subject: TESTBED: Remove dead code, unused arguments and unreferenced symbols --- engines/testbed/config.cpp | 3 +-- engines/testbed/detection.cpp | 2 +- engines/testbed/graphics.cpp | 21 ++++++++++----------- engines/testbed/graphics.h | 2 +- engines/testbed/savegame.cpp | 4 +--- engines/testbed/sound.h | 4 ---- engines/testbed/testsuite.cpp | 5 +++-- engines/testbed/testsuite.h | 6 +++--- 8 files changed, 20 insertions(+), 27 deletions(-) diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 467d28ad56..2ffd1b2050 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -159,7 +159,7 @@ void TestbedInteractionDialog::addList(uint x, uint y, uint w, uint h, const Com _yOffset += h; } -void TestbedInteractionDialog::addButtonXY(uint x, uint y, uint w, uint h, const Common::String name, uint32 cmd) { +void TestbedInteractionDialog::addButtonXY(uint x, uint /* y */, uint w, uint h, const Common::String name, uint32 cmd) { _buttonArray.push_back(new GUI::ButtonWidget(this, x, _yOffset, w, h, name, 0, cmd)); } @@ -174,7 +174,6 @@ void TestbedConfigManager::initDefaultConfiguration() { } void TestbedConfigManager::writeTestbedConfigToStream(Common::WriteStream *ws) { - Common::String wStr; for (Common::Array::const_iterator i = _testsuiteList.begin(); i < _testsuiteList.end(); i++) { _configFileInterface.setKey("this", (*i)->getName(), boolToString((*i)->isEnabled())); const Common::Array &testList = (*i)->getTestList(); diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 91518b2b8e..13af0f1584 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -83,7 +83,7 @@ public: return "Copyright (C) ScummVM"; } - virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { + virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription * /* desc */) const { // Instantiate Engine even if the game data is not found. *engine = new Testbed::TestbedEngine(syst); return true; diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index b7f6857c9f..5b30b3c6ee 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -186,7 +186,7 @@ void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, in bComp = (int)(b * 255); } -Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, const char *gfxModeName, int cursorTargetScale) { +Common::Rect GFXtests::drawCursor(bool cursorPaletteDisabled, int cursorTargetScale) { // Buffer initialized with yellow color byte buffer[500]; memset(buffer, 2, sizeof(buffer)); @@ -249,7 +249,7 @@ void GFXtests::setupMouseLoop(bool disableCursorPalette, const char *gfxModeName if (isFeaturePresent) { - cursorRect = GFXtests::drawCursor(disableCursorPalette, gfxModeName, cursorTargetScale); + cursorRect = GFXtests::drawCursor(disableCursorPalette, cursorTargetScale); Common::EventManager *eventMan = g_system->getEventManager(); Common::Event event; @@ -741,7 +741,7 @@ TestExitStatus GFXtests::scaledCursors() { if (isAspectRatioCorrected) { info += "\nDisabling Aspect ratio correction, for letting cusors match exactly, will be restored after this test."; } - + if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) { Testsuite::logPrintf("Info! Skipping test : Scaled Cursors\n"); return kTestSkipped; @@ -753,7 +753,7 @@ TestExitStatus GFXtests::scaledCursors() { } - if (isAspectRatioCorrected) { + if (isAspectRatioCorrected) { g_system->beginGFXTransaction(); g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, false); g_system->endGFXTransaction(); @@ -766,7 +766,7 @@ TestExitStatus GFXtests::scaledCursors() { // for every graphics mode display cursors for cursorTargetScale 1, 2 and 3 // Switch Graphics mode // FIXME: Crashes with "3x" mode now.: - + info = Common::String::format("Testing : Scaled cursors with GFX Mode %s\n", gfxMode->name); if (Testsuite::handleInteractiveInput(info, "OK", "Skip", kOptionRight)) { Testsuite::logPrintf("\tInfo! Skipping sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name); @@ -779,7 +779,7 @@ TestExitStatus GFXtests::scaledCursors() { Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n"); return kTestSkipped; } - + g_system->beginGFXTransaction(); bool isGFXModeSet = g_system->setGraphicsMode(gfxMode->id); @@ -807,7 +807,7 @@ TestExitStatus GFXtests::scaledCursors() { if (Testsuite::handleInteractiveInput(info, "Yes", "No", kOptionRight)) { Testsuite::logPrintf("\tInfo! Failed sub-test : Scaled Cursors :: GFX Mode %s\n", gfxMode->name); } - + if (Engine::shouldQuit()) { // Explicit exit requested Testsuite::logPrintf("Info! Explicit exit requested during scaling test, this test may be incomplete\n"); @@ -824,7 +824,7 @@ TestExitStatus GFXtests::scaledCursors() { if (isAspectRatioCorrected) { g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, true); } - + OSystem::TransactionError gfxError = g_system->endGFXTransaction(); if (gfxError != OSystem::kTransactionSuccess || !isGFXModeSet) { @@ -962,7 +962,7 @@ TestExitStatus GFXtests::paletteRotation() { Testsuite::logPrintf("Info! Skipping test : palette Rotation\n"); return kTestSkipped; } - Common::Point pt(0, 10); + Testsuite::clearEntireScreen(); // Use 256 colors @@ -1065,7 +1065,6 @@ TestExitStatus GFXtests::pixelFormats() { } Common::List pfList = g_system->getSupportedFormats(); - Common::List::const_iterator iter = pfList.begin(); int numFormatsTested = 0; int numPassed = 0; @@ -1073,7 +1072,7 @@ TestExitStatus GFXtests::pixelFormats() { Testsuite::logDetailedPrintf("Testing Pixel Formats. Size of list : %d\n", pfList.size()); - for (iter = pfList.begin(); iter != pfList.end(); iter++) { + for (Common::List::const_iterator iter = pfList.begin(); iter != pfList.end(); iter++) { numFormatsTested++; if (iter->bytesPerPixel == 1) { // Palettes already tested diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h index 07a68b5584..f3013fdf53 100644 --- a/engines/testbed/graphics.h +++ b/engines/testbed/graphics.h @@ -34,7 +34,7 @@ void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = void initMousePalette(); Common::Rect computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale); void HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val); -Common::Rect drawCursor(bool cursorPaletteDisabled = false, const char *gfxModeName = "", int cursorTargetScale = 1); +Common::Rect drawCursor(bool cursorPaletteDisabled = false, int cursorTargetScale = 1); // will contain function declarations for GFX tests TestExitStatus cursorTrails(); diff --git a/engines/testbed/savegame.cpp b/engines/testbed/savegame.cpp index b19c8e3872..b90c79aa11 100644 --- a/engines/testbed/savegame.cpp +++ b/engines/testbed/savegame.cpp @@ -158,11 +158,9 @@ TestExitStatus SaveGametests::testListingSavefile() { } } return kTestPassed; - } else { - Testsuite::logDetailedPrintf("listing Savefiles failed!\n"); - return kTestFailed; } + Testsuite::logDetailedPrintf("listing Savefiles failed!\n"); return kTestFailed; } diff --git a/engines/testbed/sound.h b/engines/testbed/sound.h index 76d0c7bb61..fea7d9d45b 100644 --- a/engines/testbed/sound.h +++ b/engines/testbed/sound.h @@ -69,10 +69,6 @@ public: const char *getDescription() const { return "Sound Subsystem"; } - -private: - bool _isTestDataFound; - }; } // End of namespace Testbed diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp index 77211b3e64..655179aa74 100644 --- a/engines/testbed/testsuite.cpp +++ b/engines/testbed/testsuite.cpp @@ -113,7 +113,7 @@ bool Testsuite::handleInteractiveInput(const Common::String &textToDisplay, cons return prompt.runModal() == result ? true : false; } -void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton, const char *altButton) { +void Testsuite::displayMessage(const Common::String &textToDisplay, const char *defaultButton) { GUI::MessageDialog prompt(textToDisplay, defaultButton); prompt.runModal(); } @@ -214,10 +214,11 @@ uint Testsuite::parseEvents() { return kSkipNext; } break; + case Common::EVENT_QUIT: case Common::EVENT_RTL: return kEngineQuit; - break; + default: break; } diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h index 3a3a78b9bb..dc159ce25f 100644 --- a/engines/testbed/testsuite.h +++ b/engines/testbed/testsuite.h @@ -112,7 +112,7 @@ public: */ static bool handleInteractiveInput(const Common::String &textToDisplay, const char *opt1 = "Yes", const char *opt2 = "No", OptionSelected result = kOptionLeft); - static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK", const char *altButton = 0); + static void displayMessage(const Common::String &textToDisplay, const char *defaultButton = "OK"); static Common::Rect writeOnScreen(const Common::String &textToDisplay, const Common::Point &pt, bool flag = false); static void clearScreen(const Common::Rect &rect); static void clearEntireScreen() { @@ -145,7 +145,7 @@ public: static void logPrintf(const char *s, ...) GCC_PRINTF(1, 2); static void logDetailedPrintf(const char *s, ...) GCC_PRINTF(1, 2); - + // Progress bar (Information Display) related methods. /** * Display region is in the bottom. Probably 1/4th of the game screen. @@ -180,7 +180,7 @@ protected: bool _isTsEnabled; private: - + /** * Used from the code to decide if the engine needs to exit */ -- cgit v1.2.3 From 04f4605f539c6ed5e95f53daaaca1bf0054a028a Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 19:08:21 -0400 Subject: TESTBED: Rename error variable to err (was hiding error() symbol) --- engines/testbed/savegame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engines/testbed/savegame.cpp b/engines/testbed/savegame.cpp index b90c79aa11..226e9880a6 100644 --- a/engines/testbed/savegame.cpp +++ b/engines/testbed/savegame.cpp @@ -133,11 +133,11 @@ TestExitStatus SaveGametests::testListingSavefile() { writeDataToFile("tBedSavefileToList.1", "Save me!"); writeDataToFile("tBedSavefileToList.2", "Save me!"); - Common::Error error = saveFileMan->getError(); + Common::Error err = saveFileMan->getError(); - if (error.getCode() != Common::kNoError) { + if (err.getCode() != Common::kNoError) { // Abort. Some Error in writing files - Testsuite::logDetailedPrintf("Error while creating savefiles: %s\n", error.getDesc().c_str()); + Testsuite::logDetailedPrintf("Error while creating savefiles: %s\n", err.getDesc().c_str()); return kTestFailed; } @@ -171,8 +171,8 @@ TestExitStatus SaveGametests::testErrorMessages() { // Try opening a non existing file readAndVerifyData("tBedSomeNonExistentSaveFile.0", "File doesn't exists!"); - Common::Error error = saveFileMan->getError(); - if (error.getCode() == Common::kNoError) { + Common::Error err = saveFileMan->getError(); + if (err.getCode() == Common::kNoError) { // blunder! how come? Testsuite::logDetailedPrintf("SaveFileMan.getError() failed\n"); return kTestFailed; -- cgit v1.2.3 From 063814b15c82403c257362af049715d7462225f5 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 19:11:09 -0400 Subject: TESTBED: Update some switch constructs for better control flow handling --- engines/testbed/config.cpp | 7 +++++-- engines/testbed/testbed.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 2ffd1b2050..6bd4c82b41 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -126,10 +126,13 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ws = _testbedConfMan->getConfigWriteStream(); _testbedConfMan->writeTestbedConfigToStream(ws); delete ws; - default: - GUI::Dialog::handleCommand(sender, cmd, data); + break; + default: + break; } + + GUI::Dialog::handleCommand(sender, cmd, data); } void TestbedInteractionDialog::addText(uint w, uint h, const Common::String text, Graphics::TextAlign textAlign, uint xOffset, uint yPadding) { diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 41a705e292..152764eb27 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -76,12 +76,16 @@ void TestbedExitDialog::init() { void TestbedExitDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { + default: + break; + case kCmdRerunTestbed : ConfParams.setRerunFlag(true); cmd = GUI::kCloseCmd; - default: - GUI::Dialog::handleCommand(sender, cmd, data); + break; } + + GUI::Dialog::handleCommand(sender, cmd, data); } bool TestbedEngine::hasFeature(EngineFeature f) const { -- cgit v1.2.3 From fe9ee92b252620b9bcf67e5bc37d5f5a64a03c56 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 19:14:45 -0400 Subject: TESTBED: Cleanup boolean use in enable() function for fs and midi tests --- engines/testbed/fs.cpp | 4 ++-- engines/testbed/midi.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp index e2bedb1898..62ac616192 100644 --- a/engines/testbed/fs.cpp +++ b/engines/testbed/fs.cpp @@ -167,7 +167,7 @@ TestExitStatus FStests::testWriteFile() { return kTestPassed; } - return kTestFailed; + return kTestFailed; } @@ -189,7 +189,7 @@ FSTestSuite::FSTestSuite() { } void FSTestSuite::enable(bool flag) { - Testsuite::enable(ConfParams.isGameDataFound() & flag); + Testsuite::enable(ConfParams.isGameDataFound() ? flag : false); } } // End of namespace Testbed diff --git a/engines/testbed/midi.cpp b/engines/testbed/midi.cpp index 54be866b4c..af5260c826 100644 --- a/engines/testbed/midi.cpp +++ b/engines/testbed/midi.cpp @@ -147,7 +147,7 @@ MidiTestSuite::MidiTestSuite() { } void MidiTestSuite::enable(bool flag) { - Testsuite::enable(_isMidiDataFound & flag); + Testsuite::enable(_isMidiDataFound ? flag : false); } } -- cgit v1.2.3 From 3e1c4f8e1624f645c77e1105742ed56e36a1d6f7 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 19:20:40 -0400 Subject: TESTBED: Specialize call to enable() in MidiTestSuite constructor --- engines/testbed/midi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/testbed/midi.cpp b/engines/testbed/midi.cpp index af5260c826..69d361b0d6 100644 --- a/engines/testbed/midi.cpp +++ b/engines/testbed/midi.cpp @@ -142,7 +142,7 @@ MidiTestSuite::MidiTestSuite() { // add some fallback test if filesystem loading failed Testsuite::logPrintf("Warning! Midi: Sound data file music.mid not found\n"); _isMidiDataFound = false; - enable(false); + MidiTestSuite::enable(false); } } -- cgit v1.2.3 From 55f46a13767e75ffe40582c35a22bbccbb7b1568 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Jun 2011 03:50:03 -0400 Subject: TESTBED: Fix GFXtests::HSVtoRGB() and caller - update passed values and not local variables when s == 0 - initialize r, g, b values in palette rotation test instead of passing unitialized variables --- engines/testbed/graphics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index 5b30b3c6ee..36ec726fc7 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -137,7 +137,7 @@ void GFXtests::HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, in float f, p, q, t; if (s == 0) { - r = g = b = v * 255; + rComp = gComp = bComp = (int)(v * 255); return; } @@ -969,6 +969,7 @@ TestExitStatus GFXtests::paletteRotation() { byte palette[256 * 3] = {0}; int r, g, b; + r = g = b = 0; int colIndx; for (int i = 0; i < 256; i++) { -- cgit v1.2.3 From 074d491a6e98e8946253b47d76aeef96447c7c41 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Jun 2011 05:23:46 -0400 Subject: DISTS: Update XCode workspace The workspace was broken by 39076ef9722529d80fef. This reverts it to the previous revision and reapplies the changes: - change UNIX to POSIX - remove mpeg2 support And adds the following changes: - add missing files to the workspace - enable translation support - silence multi-character constant warning --- dists/iphone/scummvm.xcodeproj/project.pbxproj | 2780 ++++++++++++++++-------- 1 file changed, 1866 insertions(+), 914 deletions(-) diff --git a/dists/iphone/scummvm.xcodeproj/project.pbxproj b/dists/iphone/scummvm.xcodeproj/project.pbxproj index b9b276d654..8f6ba6429d 100755 --- a/dists/iphone/scummvm.xcodeproj/project.pbxproj +++ b/dists/iphone/scummvm.xcodeproj/project.pbxproj @@ -36,7 +36,6 @@ 8CB5A9E41253FDF500CB6BC7 /* teenagent.dat in Resources */ = {isa = PBXBuildFile; fileRef = 8CB5A9D81253FDF500CB6BC7 /* teenagent.dat */; }; 8CD1ED0B126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED0C126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; - 8CD1ED0D126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED0E126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED0F126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED10126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -68,7 +67,6 @@ 8CD1ED2E126202AB00FA198C /* toon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ED09126202AA00FA198C /* toon.cpp */; }; 8CD1ED2F126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED30126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; - 8CD1ED31126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED32126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED33126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED34126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -100,7 +98,6 @@ 8CD1ED52126202AB00FA198C /* toon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ED09126202AA00FA198C /* toon.cpp */; }; 8CD1ED53126202AB00FA198C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC6126202AA00FA198C /* detection.cpp */; }; 8CD1ED54126202AB00FA198C /* display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC7126202AA00FA198C /* display.cpp */; }; - 8CD1ED55126202AB00FA198C /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECC9126202AA00FA198C /* engine.cpp */; }; 8CD1ED56126202AB00FA198C /* file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCB126202AA00FA198C /* file.cpp */; }; 8CD1ED57126202AB00FA198C /* hugo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECCF126202AA00FA198C /* hugo.cpp */; }; 8CD1ED58126202AB00FA198C /* intro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CD1ECD1126202AA00FA198C /* intro.cpp */; }; @@ -227,7 +224,6 @@ DF093E9C0F63CB26002D821E /* consolefont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */; }; DF093E9D0F63CB26002D821E /* newfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775E0D81F4E900B6D1FB /* newfont.cpp */; }; DF093E9E0F63CB26002D821E /* newfont_big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */; }; - DF093E9F0F63CB26002D821E /* scummfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477600D81F4E900B6D1FB /* scummfont.cpp */; }; DF093EA00F63CB26002D821E /* iff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477610D81F4E900B6D1FB /* iff.cpp */; }; DF093EA10F63CB26002D821E /* imagedec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477630D81F4E900B6D1FB /* imagedec.cpp */; }; DF093EA20F63CB26002D821E /* primitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4776A0D81F4E900B6D1FB /* primitives.cpp */; }; @@ -238,49 +234,20 @@ DF093EA80F63CB26002D821E /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DF093EA90F63CB26002D821E /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DF093EAA0F63CB26002D821E /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; - DF093EAB0F63CB26002D821E /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; - DF093EAC0F63CB26002D821E /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DF093EAD0F63CB26002D821E /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DF093EAE0F63CB26002D821E /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; - DF093EAF0F63CB26002D821E /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DF093EB00F63CB26002D821E /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DF093EB10F63CB26002D821E /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DF093EB20F63CB26002D821E /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DF093EB30F63CB26002D821E /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; - DF093EB40F63CB26002D821E /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; - DF093EB50F63CB26002D821E /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; - DF093EB60F63CB26002D821E /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DF093EB70F63CB26002D821E /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DF093EB80F63CB26002D821E /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; - DF093EBB0F63CB26002D821E /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; - DF093EBC0F63CB26002D821E /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; - DF093EBE0F63CB26002D821E /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; - DF093EC00F63CB26002D821E /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; - DF093EC10F63CB26002D821E /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; - DF093EC20F63CB26002D821E /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; - DF093EC30F63CB26002D821E /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; - DF093EC40F63CB26002D821E /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; - DF093EC50F63CB26002D821E /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; - DF093EC60F63CB26002D821E /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; - DF093EC70F63CB26002D821E /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; - DF093EC80F63CB26002D821E /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; - DF093EC90F63CB26002D821E /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; - DF093ECA0F63CB26002D821E /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; - DF093ECC0F63CB26002D821E /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; - DF093ECD0F63CB26002D821E /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; - DF093ECE0F63CB26002D821E /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; - DF093ECF0F63CB26002D821E /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; - DF093ED00F63CB26002D821E /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; - DF093ED10F63CB26002D821E /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; - DF093ED20F63CB26002D821E /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DF093ED60F63CB26002D821E /* memorypool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD511460DF3383500854012 /* memorypool.cpp */; }; DF093ED70F63CB26002D821E /* seq.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD517E10DF33CAC00854012 /* seq.cpp */; }; DF093ED80F63CB26002D821E /* scaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD5183B0DF3411800854012 /* scaler.cpp */; }; DF093ED90F63CB26002D821E /* scalebit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518A00DF34B2500854012 /* scalebit.cpp */; }; DF093EDA0F63CB26002D821E /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AA0DF34BA600854012 /* 2xsai.cpp */; }; DF093EDB0F63CB26002D821E /* aspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AB0DF34BA600854012 /* aspect.cpp */; }; - DF093EDC0F63CB26002D821E /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AD0DF34BA600854012 /* hq2x.cpp */; }; - DF093EDD0F63CB26002D821E /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B10DF34BA600854012 /* hq3x.cpp */; }; DF093EDE0F63CB26002D821E /* scale2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B50DF34BA600854012 /* scale2x.cpp */; }; DF093EDF0F63CB26002D821E /* scale3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B80DF34BA600854012 /* scale3x.cpp */; }; DF093EE20F63CB26002D821E /* agi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF841FF70E7BA6A600F5680E /* agi.cpp */; }; @@ -900,7 +867,6 @@ DF09417A0F63CB26002D821E /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DF09417B0F63CB26002D821E /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DF09417C0F63CB26002D821E /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; - DF09417D0F63CB26002D821E /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; DF09417E0F63CB26002D821E /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF00ED5FC77001CB19F /* saveload.cpp */; }; DF09417F0F63CB26002D821E /* ThemeEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */; }; DF0941800F63CB26002D821E /* ThemeEval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF60ED5FC77001CB19F /* ThemeEval.cpp */; }; @@ -917,7 +883,6 @@ DF09418B0F63CB26002D821E /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DF09418C0F63CB26002D821E /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DF0941920F63CB26002D821E /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; - DF0941930F63CB26002D821E /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DF0941940F63CB26002D821E /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DF0941950F63CB26002D821E /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DF0941960F63CB26002D821E /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -989,12 +954,9 @@ DF09420D0F63CB26002D821E /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; DF0942100F63CB26002D821E /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DF0942110F63CB26002D821E /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; - DF0942140F63CB26002D821E /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DF0942150F63CB26002D821E /* pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5C0F63CAD4002D821E /* pn.cpp */; }; DF0942160F63CB26002D821E /* script_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5D0F63CAD4002D821E /* script_pn.cpp */; }; DF0942170F63CB26002D821E /* vga_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5E0F63CAD4002D821E /* vga_pn.cpp */; }; - DF0942430F63CB9A002D821E /* events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942350F63CB9A002D821E /* events.cpp */; }; - DF0942450F63CB9A002D821E /* graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942370F63CB9A002D821E /* graphics.cpp */; }; DF0942470F63CB9A002D821E /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0942390F63CB9A002D821E /* main.cpp */; }; DF09424A0F63CB9A002D821E /* sdl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09423C0F63CB9A002D821E /* sdl.cpp */; }; DF0943730F63D1DA002D821E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A170E7BB34E00F5680E /* CoreFoundation.framework */; }; @@ -1029,9 +991,249 @@ DF0E303A1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; DF0E303B1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; DF0E303C1252C5BD0082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E30391252C5BD0082D593 /* cms.cpp */; }; - DF0E30411252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; - DF0E30421252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; - DF0E30431252C6090082D593 /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF0E303F1252C6090082D593 /* cms.cpp */; }; + DF203F471380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; + DF203F481380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; + DF203F491380C06E0056300A /* gui-manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F461380C06E0056300A /* gui-manager.cpp */; }; + DF203F631380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; + DF203F641380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; + DF203F651380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; + DF203F661380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; + DF203F681380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; + DF203F691380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; + DF203F6A1380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; + DF203F6B1380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; + DF203F6C1380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; + DF203F6D1380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; + DF203F6E1380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; + DF203F701380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; + DF203F711380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; + DF203F721380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; + DF203F731380C2750056300A /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F531380C2740056300A /* avi_decoder.cpp */; }; + DF203F741380C2750056300A /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F551380C2740056300A /* coktel_decoder.cpp */; }; + DF203F751380C2750056300A /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F571380C2740056300A /* dxa_decoder.cpp */; }; + DF203F761380C2750056300A /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F591380C2740056300A /* flic_decoder.cpp */; }; + DF203F781380C2750056300A /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5D1380C2740056300A /* qt_decoder.cpp */; }; + DF203F791380C2750056300A /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F5F1380C2750056300A /* smk_decoder.cpp */; }; + DF203F7A1380C2750056300A /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F611380C2750056300A /* video_decoder.cpp */; }; + DF203F951380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; + DF203F961380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; + DF203F971380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; + DF203F981380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; + DF203F991380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; + DF203F9A1380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; + DF203F9C1380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; + DF203F9D1380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; + DF203F9E1380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; + DF203F9F1380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; + DF203FA01380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; + DF203FA11380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; + DF203FA21380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; + DF203FA31380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; + DF203FA41380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; + DF203FA51380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; + DF203FA71380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; + DF203FA81380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; + DF203FA91380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; + DF203FAA1380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; + DF203FAB1380C2920056300A /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7C1380C2920056300A /* cdtoons.cpp */; }; + DF203FAC1380C2920056300A /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F7E1380C2920056300A /* cinepak.cpp */; }; + DF203FAD1380C2920056300A /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F811380C2920056300A /* indeo3.cpp */; }; + DF203FAE1380C2920056300A /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F831380C2920056300A /* mjpeg.cpp */; }; + DF203FAF1380C2920056300A /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F851380C2920056300A /* msrle.cpp */; }; + DF203FB01380C2920056300A /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F871380C2920056300A /* msvideo1.cpp */; }; + DF203FB21380C2920056300A /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8C1380C2920056300A /* qtrle.cpp */; }; + DF203FB31380C2920056300A /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F8E1380C2920056300A /* rpza.cpp */; }; + DF203FB41380C2920056300A /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F901380C2920056300A /* smc.cpp */; }; + DF203FB51380C2920056300A /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203F921380C2920056300A /* truemotion1.cpp */; }; + DF203FD51380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; + DF203FD61380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; + DF203FD71380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; + DF203FD81380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; + DF203FD91380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; + DF203FDA1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; + DF203FDB1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; + DF203FDC1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; + DF203FDD1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; + DF203FDE1380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; + DF203FDF1380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; + DF203FE01380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; + DF203FE11380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; + DF203FE21380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; + DF203FE31380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; + DF203FE41380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; + DF203FE51380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; + DF203FE61380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; + DF203FE71380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; + DF203FE81380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; + DF203FE91380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; + DF203FEA1380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; + DF203FEB1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; + DF203FEC1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; + DF203FED1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; + DF203FEE1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; + DF203FEF1380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; + DF203FF01380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; + DF203FF11380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; + DF203FF21380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; + DF203FF31380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; + DF203FF41380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; + DF203FF51380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; + DF203FF61380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; + DF203FF71380C3BC0056300A /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC01380C3BC0056300A /* console.cpp */; }; + DF203FF81380C3BC0056300A /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC21380C3BC0056300A /* dialogs.cpp */; }; + DF203FF91380C3BC0056300A /* file_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC41380C3BC0056300A /* file_v1d.cpp */; }; + DF203FFA1380C3BC0056300A /* file_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC51380C3BC0056300A /* file_v1w.cpp */; }; + DF203FFB1380C3BC0056300A /* file_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC61380C3BC0056300A /* file_v2d.cpp */; }; + DF203FFC1380C3BC0056300A /* file_v2w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC71380C3BC0056300A /* file_v2w.cpp */; }; + DF203FFD1380C3BC0056300A /* file_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC81380C3BC0056300A /* file_v3d.cpp */; }; + DF203FFE1380C3BC0056300A /* object_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FC91380C3BC0056300A /* object_v1d.cpp */; }; + DF203FFF1380C3BC0056300A /* object_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCA1380C3BC0056300A /* object_v1w.cpp */; }; + DF2040001380C3BC0056300A /* object_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCB1380C3BC0056300A /* object_v2d.cpp */; }; + DF2040011380C3BC0056300A /* object_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCC1380C3BC0056300A /* object_v3d.cpp */; }; + DF2040021380C3BC0056300A /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCD1380C3BC0056300A /* object.cpp */; }; + DF2040031380C3BC0056300A /* parser_v1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FCF1380C3BC0056300A /* parser_v1d.cpp */; }; + DF2040041380C3BC0056300A /* parser_v1w.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD01380C3BC0056300A /* parser_v1w.cpp */; }; + DF2040051380C3BC0056300A /* parser_v2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD11380C3BC0056300A /* parser_v2d.cpp */; }; + DF2040061380C3BC0056300A /* parser_v3d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD21380C3BC0056300A /* parser_v3d.cpp */; }; + DF2040071380C3BC0056300A /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF203FD31380C3BC0056300A /* text.cpp */; }; + DF20402E1380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; + DF20402F1380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; + DF2040301380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; + DF2040311380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; + DF2040321380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; + DF2040331380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; + DF2040341380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; + DF2040351380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; + DF2040361380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; + DF2040371380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; + DF2040381380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; + DF2040391380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; + DF20403A1380C8B70056300A /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040221380C8B70056300A /* editable.cpp */; }; + DF20403B1380C8B70056300A /* edittext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040241380C8B70056300A /* edittext.cpp */; }; + DF20403C1380C8B70056300A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040261380C8B70056300A /* list.cpp */; }; + DF20403D1380C8B70056300A /* popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040281380C8B70056300A /* popup.cpp */; }; + DF20403E1380C8B70056300A /* scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402A1380C8B70056300A /* scrollbar.cpp */; }; + DF20403F1380C8B70056300A /* tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20402C1380C8B70056300A /* tab.cpp */; }; + DF20405E1380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; + DF20405F1380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; + DF2040601380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; + DF2040611380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; + DF2040621380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; + DF2040631380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; + DF2040641380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; + DF2040651380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; + DF2040661380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; + DF2040671380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; + DF2040681380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; + DF2040691380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; + DF20406A1380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; + DF20406B1380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; + DF20406C1380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; + DF20406D1380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; + DF20406E1380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; + DF20406F1380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; + DF2040701380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; + DF2040711380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; + DF2040721380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; + DF2040731380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; + DF2040741380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; + DF2040751380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; + DF2040761380CA230056300A /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040471380CA230056300A /* audiostream.cpp */; }; + DF2040771380CA230056300A /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040491380CA230056300A /* fmopl.cpp */; }; + DF2040781380CA230056300A /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404B1380CA230056300A /* mididrv.cpp */; }; + DF2040791380CA230056300A /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404D1380CA230056300A /* midiparser_smf.cpp */; }; + DF20407A1380CA230056300A /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404E1380CA230056300A /* midiparser_xmidi.cpp */; }; + DF20407B1380CA230056300A /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20404F1380CA230056300A /* midiparser.cpp */; }; + DF20407C1380CA230056300A /* midiplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040511380CA230056300A /* midiplayer.cpp */; }; + DF20407D1380CA230056300A /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040541380CA230056300A /* mixer.cpp */; }; + DF20407E1380CA230056300A /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040561380CA230056300A /* mpu401.cpp */; }; + DF20407F1380CA230056300A /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040581380CA230056300A /* musicplugin.cpp */; }; + DF2040801380CA230056300A /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405A1380CA230056300A /* rate.cpp */; }; + DF2040811380CA230056300A /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20405C1380CA230056300A /* timestamp.cpp */; }; + DF20409A1380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; + DF20409B1380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; + DF20409C1380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; + DF20409D1380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; + DF20409E1380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; + DF20409F1380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; + DF2040A01380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; + DF2040A11380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; + DF2040A21380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; + DF2040A31380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; + DF2040A41380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; + DF2040A51380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; + DF2040A61380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; + DF2040A71380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; + DF2040A81380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; + DF2040A91380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; + DF2040AA1380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; + DF2040AB1380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; + DF2040AC1380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; + DF2040AD1380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; + DF2040AE1380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; + DF2040AF1380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; + DF2040B01380CA400056300A /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040841380CA400056300A /* adpcm.cpp */; }; + DF2040B11380CA400056300A /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040861380CA400056300A /* aiff.cpp */; }; + DF2040B21380CA400056300A /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040881380CA400056300A /* flac.cpp */; }; + DF2040B31380CA400056300A /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408A1380CA400056300A /* iff_sound.cpp */; }; + DF2040B41380CA400056300A /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408C1380CA400056300A /* mac_snd.cpp */; }; + DF2040B51380CA400056300A /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF20408E1380CA400056300A /* mp3.cpp */; }; + DF2040B61380CA400056300A /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040901380CA400056300A /* raw.cpp */; }; + DF2040B71380CA400056300A /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040921380CA400056300A /* vag.cpp */; }; + DF2040B81380CA400056300A /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040941380CA400056300A /* voc.cpp */; }; + DF2040B91380CA400056300A /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040961380CA400056300A /* vorbis.cpp */; }; + DF2040BA1380CA400056300A /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040981380CA400056300A /* wave.cpp */; }; + DF2040CC1380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; + DF2040CD1380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; + DF2040CE1380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; + DF2040CF1380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; + DF2040D01380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; + DF2040D11380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; + DF2040D21380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; + DF2040D31380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; + DF2040D41380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; + DF2040D51380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; + DF2040D61380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; + DF2040D71380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; + DF2040D81380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; + DF2040D91380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; + DF2040DA1380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; + DF2040DB1380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; + DF2040DC1380CA810056300A /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BC1380CA810056300A /* infogrames.cpp */; }; + DF2040DD1380CA810056300A /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040BE1380CA810056300A /* maxtrax.cpp */; }; + DF2040DE1380CA810056300A /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C01380CA810056300A /* module.cpp */; }; + DF2040DF1380CA810056300A /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C21380CA810056300A /* paula.cpp */; }; + DF2040E01380CA810056300A /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C41380CA810056300A /* protracker.cpp */; }; + DF2040E11380CA810056300A /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C61380CA810056300A /* rjp1.cpp */; }; + DF2040E21380CA810056300A /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040C81380CA810056300A /* soundfx.cpp */; }; + DF2040E31380CA810056300A /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040CA1380CA810056300A /* tfmx.cpp */; }; + DF2040F41380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; + DF2040F51380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; + DF2040F61380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; + DF2040F71380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; + DF2040F81380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; + DF2040F91380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; + DF2040FA1380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; + DF2040FB1380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; + DF2040FC1380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; + DF2040FE1380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; + DF2040FF1380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; + DF2041001380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; + DF2041011380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; + DF2041021380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; + DF2041031380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; + DF2041041380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; + DF2041051380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; + DF2041061380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; + DF2041081380CAA40056300A /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E51380CAA40056300A /* adlib.cpp */; }; + DF2041091380CAA40056300A /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E61380CAA40056300A /* appleiigs.cpp */; }; + DF20410A1380CAA40056300A /* cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E71380CAA40056300A /* cms.cpp */; }; + DF20410B1380CAA40056300A /* eas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040E91380CAA40056300A /* eas.cpp */; }; + DF20410C1380CAA40056300A /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EB1380CAA40056300A /* fluidsynth.cpp */; }; + DF20410D1380CAA40056300A /* mt32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EC1380CAA40056300A /* mt32.cpp */; }; + DF20410E1380CAA40056300A /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040ED1380CAA40056300A /* pcspk.cpp */; }; + DF20410F1380CAA40056300A /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040EF1380CAA40056300A /* sid.cpp */; }; + DF2041101380CAA40056300A /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2040F11380CAA40056300A /* wave6581.cpp */; }; DF224E040FB23BC500C8E453 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF224E020FB23BC500C8E453 /* OpenGLES.framework */; }; DF224E050FB23BC500C8E453 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF224E020FB23BC500C8E453 /* OpenGLES.framework */; }; DF2EC3E510E6490800765801 /* browser_osx.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC3E410E6490800765801 /* browser_osx.mm */; }; @@ -1053,15 +1255,8 @@ DF2EC50B10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; DF2EC50C10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; DF2EC50D10E64DB300765801 /* textconsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC50910E64DB300765801 /* textconsole.cpp */; }; - DF2EC51210E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; - DF2EC51310E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; - DF2EC51410E64E3100765801 /* sid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51010E64E3100765801 /* sid.cpp */; }; - DF2EC51810E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; - DF2EC51910E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; - DF2EC51A10E64EE600765801 /* wave6581.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2EC51710E64EE600765801 /* wave6581.cpp */; }; DF2FFB930F485D890006E566 /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DF2FFBD30F485DFB0006E566 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; - DF2FFBD90F485E360006E566 /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DF2FFBFC0F4860A60006E566 /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DF2FFC290F4862520006E566 /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DF2FFC2A0F4862520006E566 /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -1109,36 +1304,6 @@ DF2FFD2B0F48717F0006E566 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFD290F48717F0006E566 /* Default.png */; }; DF2FFD2C0F48717F0006E566 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFD2A0F48717F0006E566 /* icon.png */; }; DF2FFD2D0F48719E0006E566 /* scummclassic.zip in Resources */ = {isa = PBXBuildFile; fileRef = DF2FFBDB0F485E480006E566 /* scummclassic.zip */; }; - DF45B11F116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; - DF45B121116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; - DF45B123116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; - DF45B125116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; - DF45B127116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; - DF45B129116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; - DF45B12B116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; - DF45B12D116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; - DF45B12F116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; - DF45B131116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; - DF45B13D116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; - DF45B13F116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; - DF45B141116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; - DF45B143116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; - DF45B145116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; - DF45B147116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; - DF45B149116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; - DF45B14B116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; - DF45B14D116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; - DF45B14F116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; - DF45B15B116627DA009B85CC /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0F7116627DA009B85CC /* adpcm.cpp */; }; - DF45B15D116627DA009B85CC /* aiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FA116627DA009B85CC /* aiff.cpp */; }; - DF45B15F116627DA009B85CC /* flac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B0FD116627DA009B85CC /* flac.cpp */; }; - DF45B161116627DA009B85CC /* iff_sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B100116627DA009B85CC /* iff_sound.cpp */; }; - DF45B163116627DA009B85CC /* mp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B103116627DA009B85CC /* mp3.cpp */; }; - DF45B165116627DA009B85CC /* raw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B106116627DA009B85CC /* raw.cpp */; }; - DF45B167116627DA009B85CC /* vag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B109116627DA009B85CC /* vag.cpp */; }; - DF45B169116627DA009B85CC /* voc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10C116627DA009B85CC /* voc.cpp */; }; - DF45B16B116627DA009B85CC /* vorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B10F116627DA009B85CC /* vorbis.cpp */; }; - DF45B16D116627DA009B85CC /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B112116627DA009B85CC /* wave.cpp */; }; DF45B1CA116628A5009B85CC /* animate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B176116628A5009B85CC /* animate.cpp */; }; DF45B1CB116628A5009B85CC /* cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B178116628A5009B85CC /* cache.cpp */; }; DF45B1CC116628A5009B85CC /* compare.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B17A116628A5009B85CC /* compare.cpp */; }; @@ -1229,6 +1394,137 @@ DF45B244116628A5009B85CC /* music.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C1116628A5009B85CC /* music.cpp */; }; DF45B245116628A5009B85CC /* soundcmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C3116628A5009B85CC /* soundcmd.cpp */; }; DF45B246116628A5009B85CC /* seq_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF45B1C6116628A5009B85CC /* seq_decoder.cpp */; }; + DF46B6F31381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; + DF46B6F41381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; + DF46B6F51381E18900D08723 /* coroutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F21381E18900D08723 /* coroutine.cpp */; }; + DF46B6FF1381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; + DF46B7001381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; + DF46B7011381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; + DF46B7021381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; + DF46B7031381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; + DF46B7041381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; + DF46B7051381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; + DF46B7061381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; + DF46B7071381E1FF00D08723 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F71381E1FF00D08723 /* towns_audio.cpp */; }; + DF46B7081381E1FF00D08723 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */; }; + DF46B7091381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */; }; + DF46B70A1381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */; }; + DF46B7191381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; + DF46B71A1381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; + DF46B71B1381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; + DF46B71C1381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; + DF46B71D1381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; + DF46B71E1381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; + DF46B71F1381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; + DF46B7201381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; + DF46B7211381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; + DF46B7221381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; + DF46B7231381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; + DF46B7241381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; + DF46B7251381E27000D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B70F1381E27000D08723 /* console.cpp */; }; + DF46B7261381E27000D08723 /* databases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7111381E27000D08723 /* databases.cpp */; }; + DF46B7271381E27000D08723 /* dbase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7131381E27000D08723 /* dbase.cpp */; }; + DF46B7281381E27000D08723 /* iniconfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7151381E27000D08723 /* iniconfig.cpp */; }; + DF46B7291381E27000D08723 /* init_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7171381E27000D08723 /* init_v7.cpp */; }; + DF46B72A1381E27000D08723 /* inter_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7181381E27000D08723 /* inter_inca2.cpp */; }; + DF46B7441381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; + DF46B7451381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; + DF46B7461381E40500D08723 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7421381E40500D08723 /* log.cpp */; }; + DF46B7491381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; + DF46B74A1381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; + DF46B74B1381E40F00D08723 /* modular-backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7471381E40F00D08723 /* modular-backend.cpp */; }; + DF46B7541381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; + DF46B7551381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; + DF46B7561381E46700D08723 /* player_v2base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7511381E46700D08723 /* player_v2base.cpp */; }; + DF46B75E1381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; + DF46B75F1381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; + DF46B7601381E4A400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B75B1381E4A400D08723 /* console.cpp */; }; + DF46B7631381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; + DF46B7641381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; + DF46B7651381E4D400D08723 /* robot_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7611381E4D400D08723 /* robot_decoder.cpp */; }; + DF46B7671381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; + DF46B7681381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; + DF46B7691381E4E400D08723 /* vm_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7661381E4E400D08723 /* vm_types.cpp */; }; + DF46B77B1381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; + DF46B77C1381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; + DF46B77D1381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; + DF46B77E1381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; + DF46B77F1381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; + DF46B7801381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; + DF46B7811381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; + DF46B7821381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; + DF46B7831381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; + DF46B7841381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; + DF46B7851381E54200D08723 /* dcl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B76F1381E54200D08723 /* dcl.cpp */; }; + DF46B7861381E54200D08723 /* iff_container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7721381E54200D08723 /* iff_container.cpp */; }; + DF46B7871381E54200D08723 /* winexe_ne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7751381E54200D08723 /* winexe_ne.cpp */; }; + DF46B7881381E54200D08723 /* winexe_pe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7771381E54200D08723 /* winexe_pe.cpp */; }; + DF46B7891381E54200D08723 /* winexe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7791381E54200D08723 /* winexe.cpp */; }; + DF46B7931381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; + DF46B7941381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; + DF46B7951381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; + DF46B7961381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; + DF46B7971381E58000D08723 /* png.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B78F1381E58000D08723 /* png.cpp */; }; + DF46B7981381E58000D08723 /* wincursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7911381E58000D08723 /* wincursor.cpp */; }; + DF46B79F1381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; + DF46B7A01381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; + DF46B7A11381E5B500D08723 /* winfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B79D1381E5B500D08723 /* winfont.cpp */; }; + DF46B7A51381E5D900D08723 /* sdl-timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A31381E5D900D08723 /* sdl-timer.cpp */; }; + DF46B7A91381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; + DF46B7AA1381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; + DF46B7AB1381E5F100D08723 /* header.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7A81381E5F100D08723 /* header.cpp */; }; + DF46B7B41381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; + DF46B7B51381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; + DF46B7B61381E67800D08723 /* sdl-mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7B21381E67800D08723 /* sdl-mutex.cpp */; }; + DF46B7BD1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; + DF46B7BE1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; + DF46B7BF1381E6C000D08723 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7BB1381E6C000D08723 /* object.cpp */; }; + DF46B7C81381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; + DF46B7C91381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; + DF46B7CA1381E72500D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7C61381E72500D08723 /* console.cpp */; }; + DF46B7CF1381E76300D08723 /* sdl-events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7CD1381E76300D08723 /* sdl-events.cpp */; }; + DF46B7D61381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; + DF46B7D71381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; + DF46B7D81381E7C600D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B7D41381E7C600D08723 /* console.cpp */; }; + DF46B83C1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; + DF46B83D1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; + DF46B83E1381F13500D08723 /* saveload_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B83B1381F13500D08723 /* saveload_v7.cpp */; }; + DF46B8441381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; + DF46B8451381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; + DF46B8461381F35500D08723 /* saveload_inca2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8431381F35500D08723 /* saveload_inca2.cpp */; }; + DF46B8481381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; + DF46B8491381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; + DF46B84A1381F38700D08723 /* inter_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8471381F38700D08723 /* inter_v7.cpp */; }; + DF46B84D1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; + DF46B84E1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; + DF46B84F1381F39E00D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B84B1381F39E00D08723 /* console.cpp */; }; + DF46B8521381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; + DF46B8531381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; + DF46B8541381F3B400D08723 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8501381F3B400D08723 /* console.cpp */; }; + DF46B8601381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; + DF46B8611381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; + DF46B8621381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; + DF46B8631381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; + DF46B8641381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; + DF46B8651381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; + DF46B8661381F44E00D08723 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85A1381F44E00D08723 /* dbopl.cpp */; }; + DF46B8671381F44E00D08723 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85C1381F44E00D08723 /* dosbox.cpp */; }; + DF46B8681381F44E00D08723 /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B85E1381F44E00D08723 /* mame.cpp */; }; + DF46B8711381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; + DF46B8721381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; + DF46B8731381F4A200D08723 /* sdl-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */; }; + DF46B87D1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; + DF46B87E1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; + DF46B87F1381F4F200D08723 /* default-audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B87B1381F4F200D08723 /* default-audiocd.cpp */; }; + DF46B8891381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; + DF46B88A1381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; + DF46B88B1381F5D800D08723 /* sdl-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8871381F5D800D08723 /* sdl-provider.cpp */; }; + DF46B8921381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; + DF46B8931381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; + DF46B8941381F62B00D08723 /* adpcm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8901381F62B00D08723 /* adpcm.cpp */; }; + DF46B89B1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; + DF46B89C1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; + DF46B89D1381F6C400D08723 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF46B8991381F6C400D08723 /* null.cpp */; }; DF573C080F5A81EA00961A72 /* state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573C010F5A81EA00961A72 /* state.cpp */; }; DF573CBB0F5A85B300961A72 /* exec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBA0F5A85B300961A72 /* exec.cpp */; }; DF573CBE0F5A85E100961A72 /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; @@ -1253,20 +1549,10 @@ DF6118550FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; DF6118560FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; DF6118570FE3A8990042AD3F /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118540FE3A8990042AD3F /* disk.cpp */; }; - DF6118680FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; - DF6118690FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; - DF61186A0FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; - DF61186D0FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; - DF61186E0FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; - DF61186F0FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; - DF6118720FE3A9410042AD3F /* dxa_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */; }; - DF6118730FE3A9410042AD3F /* flic_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118620FE3A9410042AD3F /* flic_decoder.cpp */; }; - DF6118740FE3A9410042AD3F /* smk_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118640FE3A9410042AD3F /* smk_decoder.cpp */; }; DF6118890FE3A9AA0042AD3F /* saveconverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */; }; DF61188A0FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF61188B0FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF61188C0FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; - DF61188D0FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF61188E0FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF61188F0FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF6118900FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1278,7 +1564,6 @@ DF6118960FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF6118970FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF6118980FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; - DF6118990FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF61189A0FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF61189B0FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF61189C0FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1290,7 +1575,6 @@ DF6118A20FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */; }; DF6118A30FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */; }; DF6118A40FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */; }; - DF6118A50FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */; }; DF6118A60FE3A9AA0042AD3F /* savefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF61187F0FE3A9AA0042AD3F /* savefile.cpp */; }; DF6118A70FE3A9AA0042AD3F /* savehandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118810FE3A9AA0042AD3F /* savehandler.cpp */; }; DF6118A80FE3A9AA0042AD3F /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118830FE3A9AA0042AD3F /* saveload.cpp */; }; @@ -1317,9 +1601,6 @@ DF6118C80FE3AABD0042AD3F /* player_v2cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */; }; DF6118C90FE3AABD0042AD3F /* player_v2cms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */; }; DF6118CC0FE3AAFD0042AD3F /* hardwarekeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */; }; - DF6118D10FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; - DF6118D20FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; - DF6118D30FE3AB560042AD3F /* mame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6118CF0FE3AB560042AD3F /* mame.cpp */; }; DF6BF4C410529DA50069811F /* conversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C010529DA50069811F /* conversion.cpp */; }; DF6BF4C510529DA50069811F /* jpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C210529DA50069811F /* jpeg.cpp */; }; DF6BF4C610529DA50069811F /* conversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4C010529DA50069811F /* conversion.cpp */; }; @@ -1353,12 +1634,6 @@ DF6BF4FF10529F140069811F /* EventRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F810529F140069811F /* EventRecorder.cpp */; }; DF6BF50010529F140069811F /* EventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F710529F140069811F /* EventDispatcher.cpp */; }; DF6BF50110529F140069811F /* EventRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF4F810529F140069811F /* EventRecorder.cpp */; }; - DF6BF50610529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; - DF6BF50710529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; - DF6BF50810529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; - DF6BF50910529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; - DF6BF50A10529F540069811F /* maxtrax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50210529F540069811F /* maxtrax.cpp */; }; - DF6BF50B10529F540069811F /* tfmx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF6BF50410529F540069811F /* tfmx.cpp */; }; DF7585CE100CB66E00CC3324 /* expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C3100CB66E00CC3324 /* expression.cpp */; }; DF7585CF100CB66E00CC3324 /* hotspots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C5100CB66E00CC3324 /* hotspots.cpp */; }; DF7585D0100CB66E00CC3324 /* init_v6.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7585C7100CB66E00CC3324 /* init_v6.cpp */; }; @@ -1435,9 +1710,6 @@ DF7F289311FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; DF7F289511FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; DF7F289711FF247300159131 /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289111FF247300159131 /* translation.cpp */; }; - DF7F28A011FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; - DF7F28A111FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; - DF7F28A211FF24B000159131 /* mac_snd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F289E11FF24B000159131 /* mac_snd.cpp */; }; DF7F28A511FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; DF7F28A611FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; DF7F28A711FF24C400159131 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7F28A311FF24C400159131 /* console.cpp */; }; @@ -2067,28 +2339,9 @@ DF842A470E7BBBB400F5680E /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DF842A490E7BBBB400F5680E /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DF842A6D0E7BBD5700F5680E /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; - DF842A710E7BBDB200F5680E /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; - DF895BFE124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; - DF895BFF124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; - DF895C00124C24350077F6E8 /* coktel_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */; }; DF895C03124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; DF895C04124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; DF895C05124C24680077F6E8 /* player_towns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C01124C24680077F6E8 /* player_towns.cpp */; }; - DF895C09124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; - DF895C0A124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; - DF895C0B124C24B60077F6E8 /* appleiigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C08124C24B50077F6E8 /* appleiigs.cpp */; }; - DF895C15124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; - DF895C16124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; - DF895C17124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; - DF895C18124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; - DF895C19124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; - DF895C1A124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; - DF895C1B124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; - DF895C1C124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; - DF895C1D124C24C10077F6E8 /* towns_audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0D124C24C00077F6E8 /* towns_audio.cpp */; }; - DF895C1E124C24C10077F6E8 /* towns_euphony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */; }; - DF895C1F124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */; }; - DF895C20124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */; }; DF895C25124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; DF895C26124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; DF895C27124C25150077F6E8 /* init_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895C24124C25150077F6E8 /* init_fascin.cpp */; }; @@ -2101,27 +2354,8 @@ DF895C41124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; DF895C42124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; DF895C43124C271F0077F6E8 /* icon4.png in Resources */ = {isa = PBXBuildFile; fileRef = DF895C40124C271F0077F6E8 /* icon4.png */; }; - DF895CB8124E58980077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; - DF895CB9124E58980077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; - DF895CBA124E58980077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; - DF895CBB124E58980077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; - DF895CBC124E58980077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; - DF895CBD124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; - DF895CBE124E58990077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; - DF895CBF124E58990077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; - DF895CC0124E58990077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; - DF895CC1124E58990077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; - DF895CC2124E58990077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; - DF895CC3124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; - DF895CC4124E58990077F6E8 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAB124E58980077F6E8 /* indeo3.cpp */; }; - DF895CC5124E58990077F6E8 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAD124E58980077F6E8 /* mjpeg.cpp */; }; - DF895CC6124E58990077F6E8 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CAF124E58980077F6E8 /* qdm2.cpp */; }; - DF895CC7124E58990077F6E8 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB2124E58980077F6E8 /* qtrle.cpp */; }; - DF895CC8124E58990077F6E8 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB4124E58980077F6E8 /* rpza.cpp */; }; - DF895CC9124E58990077F6E8 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF895CB6124E58980077F6E8 /* smc.cpp */; }; DF89C2880F62D55C00D756B6 /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DF89C2A40F62D79E00D756B6 /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; - DF89C2BB0F62D91000D756B6 /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DF90E9BF10AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; DF90E9C110AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; DF90E9C310AEDA9B00C8F93F /* selector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90E9BD10AEDA9B00C8F93F /* selector.cpp */; }; @@ -2131,12 +2365,6 @@ DF90EAAD10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; DF90EAAE10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; DF90EAAF10B0236F00C8F93F /* staticres.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAAB10B0236F00C8F93F /* staticres.cpp */; }; - DF90EAB810B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; - DF90EAB910B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; - DF90EABA10B023D100C8F93F /* avi_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAB610B023D100C8F93F /* avi_decoder.cpp */; }; - DF90EAC310B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; - DF90EAC410B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; - DF90EAC510B023F400C8F93F /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF90EAC110B023F400C8F93F /* msvideo1.cpp */; }; DF9B9248118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; DF9B9249118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; DF9B924A118E46730069C19D /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF9B9246118E46730069C19D /* error.cpp */; }; @@ -2151,12 +2379,13 @@ DFAAAFFC0F0112DF003E9390 /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAAFFB0F0112DF003E9390 /* detection.cpp */; }; DFAAB0020F011392003E9390 /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DFAAD23D0F50120E00C3A4E2 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAD2390F50120E00C3A4E2 /* console.cpp */; }; - DFB0576911B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; - DFB0576A11B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; - DFB0576C11B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; - DFB0576D11B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; - DFB0576F11B753AF0015AE65 /* qt_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576411B753AF0015AE65 /* qt_decoder.cpp */; }; - DFB0577011B753AF0015AE65 /* video_decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0576611B753AF0015AE65 /* video_decoder.cpp */; }; + DFADEBB313820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; + DFADEBB413820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; + DFADEBB513820DF500C46364 /* maccursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB113820DF500C46364 /* maccursor.cpp */; }; + DFADEBB713820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; + DFADEBB813820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; + DFADEBB913820E0C00C46364 /* posix-fs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFADEBB613820E0C00C46364 /* posix-fs.cpp */; }; + DFADEC071382140300C46364 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DFADEC061382140300C46364 /* libz.dylib */; }; DFB0577611B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; DFB0577711B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; DFB0577811B753DA0015AE65 /* rational.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0577411B753DA0015AE65 /* rational.cpp */; }; @@ -2172,9 +2401,6 @@ DFB0579111B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; DFB0579211B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; DFB0579311B7547D0015AE65 /* pict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0578F11B7547D0015AE65 /* pict.cpp */; }; - DFB0579811B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; - DFB0579911B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; - DFB0579A11B7549C0015AE65 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFB0579611B7549C0015AE65 /* cinepak.cpp */; }; DFC831210F48AF19005EF03C /* detection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC8301A0F48AF18005EF03C /* detection.cpp */; }; DFC831240F48AF19005EF03C /* gc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC8301E0F48AF18005EF03C /* gc.cpp */; }; DFC831270F48AF19005EF03C /* kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFC830230F48AF18005EF03C /* kernel.cpp */; }; @@ -2204,9 +2430,6 @@ DFCDC6F711662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; DFCDC6F811662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; DFCDC6F911662AAB00A7D2A0 /* resource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6F611662AAB00A7D2A0 /* resource.cpp */; }; - DFCDC6FE11662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; - DFCDC6FF11662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; - DFCDC70011662AD700A7D2A0 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */; }; DFCDC70411662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; DFCDC70511662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; DFCDC70611662B0200A7D2A0 /* saveload_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */; }; @@ -2219,8 +2442,6 @@ DFD518A20DF34B2500854012 /* scalebit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518A00DF34B2500854012 /* scalebit.cpp */; }; DFD518BC0DF34BA600854012 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AA0DF34BA600854012 /* 2xsai.cpp */; }; DFD518BD0DF34BA600854012 /* aspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AB0DF34BA600854012 /* aspect.cpp */; }; - DFD518BF0DF34BA600854012 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AD0DF34BA600854012 /* hq2x.cpp */; }; - DFD518C20DF34BA600854012 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B10DF34BA600854012 /* hq3x.cpp */; }; DFD518C50DF34BA600854012 /* scale2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B50DF34BA600854012 /* scale2x.cpp */; }; DFD518C70DF34BA600854012 /* scale3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B80DF34BA600854012 /* scale3x.cpp */; }; DFD6470C0F495B51008E18EF /* unzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE473C10D81F4E800B6D1FB /* unzip.cpp */; }; @@ -2253,7 +2474,6 @@ DFE47BFF0D81F4E900B6D1FB /* consolefont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */; }; DFE47C000D81F4E900B6D1FB /* newfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775E0D81F4E900B6D1FB /* newfont.cpp */; }; DFE47C010D81F4E900B6D1FB /* newfont_big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */; }; - DFE47C020D81F4E900B6D1FB /* scummfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477600D81F4E900B6D1FB /* scummfont.cpp */; }; DFE47C030D81F4E900B6D1FB /* iff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477610D81F4E900B6D1FB /* iff.cpp */; }; DFE47C040D81F4E900B6D1FB /* imagedec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477630D81F4E900B6D1FB /* imagedec.cpp */; }; DFE47C080D81F4E900B6D1FB /* primitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4776A0D81F4E900B6D1FB /* primitives.cpp */; }; @@ -2265,41 +2485,14 @@ DFE47C200D81F4E900B6D1FB /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DFE47C210D81F4E900B6D1FB /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DFE47C220D81F4E900B6D1FB /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; - DFE47C230D81F4E900B6D1FB /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; - DFE47C240D81F4E900B6D1FB /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DFE47C260D81F4E900B6D1FB /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DFE47C280D81F4E900B6D1FB /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; - DFE47C290D81F4E900B6D1FB /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DFE47C2A0D81F4E900B6D1FB /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DFE47C2B0D81F4E900B6D1FB /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DFE47C2E0D81F4E900B6D1FB /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DFE47C2F0D81F4E900B6D1FB /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; - DFE47C300D81F4E900B6D1FB /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; - DFE47C310D81F4E900B6D1FB /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; - DFE47C320D81F4E900B6D1FB /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DFE47C350D81F4E900B6D1FB /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DFE47C3B0D81F4E900B6D1FB /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; - DFE47C3E0D81F4E900B6D1FB /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; - DFE47C3F0D81F4E900B6D1FB /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; - DFE47C410D81F4E900B6D1FB /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; - DFE47C430D81F4E900B6D1FB /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; - DFE47C440D81F4E900B6D1FB /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; - DFE47C450D81F4E900B6D1FB /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; - DFE47C460D81F4E900B6D1FB /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; - DFE47C470D81F4E900B6D1FB /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; - DFE47C480D81F4E900B6D1FB /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; - DFE47C490D81F4E900B6D1FB /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; - DFE47C4A0D81F4E900B6D1FB /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; - DFE47C4B0D81F4E900B6D1FB /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; - DFE47C4C0D81F4E900B6D1FB /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; - DFE47C4D0D81F4E900B6D1FB /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; - DFE47C500D81F4E900B6D1FB /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; - DFE47C510D81F4E900B6D1FB /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; - DFE47C520D81F4E900B6D1FB /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; - DFE47C570D81F4E900B6D1FB /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; - DFE47C580D81F4E900B6D1FB /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; - DFE47C740D81F4E900B6D1FB /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; - DFE47C750D81F4E900B6D1FB /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DFE47C870D81F86900B6D1FB /* kyra.dat in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C810D81F86900B6D1FB /* kyra.dat */; }; DFE47C880D81F86900B6D1FB /* lure.dat in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C820D81F86900B6D1FB /* lure.dat */; }; DFE47C890D81F86900B6D1FB /* queen.tbl in Resources */ = {isa = PBXBuildFile; fileRef = DFE47C830D81F86900B6D1FB /* queen.tbl */; }; @@ -2315,11 +2508,6 @@ DFEC5D361166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; DFEC5D371166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; DFEC5D381166C67300C90552 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D341166C67300C90552 /* savestate.cpp */; }; - DFEC5D3F1166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; - DFEC5D401166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; - DFEC5D411166C6B400C90552 /* dbopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFEC5D3D1166C6B400C90552 /* dbopl.cpp */; }; - DFF958AF0FB222F300A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; - DFF958B20FB222F300A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; DFF959050FB22D3000A3EC78 /* libmad.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476C0F49F7EF008E18EF /* libmad.a */; }; DFF959060FB22D3100A3EC78 /* libFLAC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476B0F49F7EF008E18EF /* libFLAC.a */; }; DFF959080FB22D3300A3EC78 /* libvorbisidec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DFD6476F0F49F7EF008E18EF /* libvorbisidec.a */; }; @@ -2360,7 +2548,6 @@ DFF959320FB22D5700A3EC78 /* consolefont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */; }; DFF959330FB22D5700A3EC78 /* newfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775E0D81F4E900B6D1FB /* newfont.cpp */; }; DFF959340FB22D5700A3EC78 /* newfont_big.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */; }; - DFF959350FB22D5700A3EC78 /* scummfont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477600D81F4E900B6D1FB /* scummfont.cpp */; }; DFF959360FB22D5700A3EC78 /* iff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477610D81F4E900B6D1FB /* iff.cpp */; }; DFF959370FB22D5700A3EC78 /* imagedec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477630D81F4E900B6D1FB /* imagedec.cpp */; }; DFF959380FB22D5700A3EC78 /* primitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4776A0D81F4E900B6D1FB /* primitives.cpp */; }; @@ -2372,49 +2559,20 @@ DFF9593E0FB22D5700A3EC78 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477910D81F4E900B6D1FB /* console.cpp */; }; DFF9593F0FB22D5700A3EC78 /* debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477940D81F4E900B6D1FB /* debugger.cpp */; }; DFF959400FB22D5700A3EC78 /* dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477960D81F4E900B6D1FB /* dialog.cpp */; }; - DFF959410FB22D5700A3EC78 /* editable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477980D81F4E900B6D1FB /* editable.cpp */; }; - DFF959420FB22D5700A3EC78 /* EditTextWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */; }; DFF959430FB22D5700A3EC78 /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE4779E0D81F4E900B6D1FB /* Key.cpp */; }; DFF959440FB22D5700A3EC78 /* launcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A20D81F4E900B6D1FB /* launcher.cpp */; }; - DFF959450FB22D5700A3EC78 /* ListWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */; }; DFF959460FB22D5700A3EC78 /* massadd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A60D81F4E900B6D1FB /* massadd.cpp */; }; DFF959470FB22D5700A3EC78 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477A80D81F4E900B6D1FB /* message.cpp */; }; DFF959480FB22D5700A3EC78 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AD0D81F4E900B6D1FB /* object.cpp */; }; DFF959490FB22D5700A3EC78 /* options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477AF0D81F4E900B6D1FB /* options.cpp */; }; - DFF9594A0FB22D5700A3EC78 /* PopUpWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */; }; - DFF9594B0FB22D5700A3EC78 /* ScrollBarWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */; }; - DFF9594C0FB22D5700A3EC78 /* TabWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */; }; DFF9594D0FB22D5700A3EC78 /* themebrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */; }; DFF9594E0FB22D5700A3EC78 /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477C40D81F4E900B6D1FB /* widget.cpp */; }; - DFF959510FB22D5700A3EC78 /* audiocd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */; }; - DFF959520FB22D5700A3EC78 /* audiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */; }; - DFF959540FB22D5700A3EC78 /* fmopl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D10D81F4E900B6D1FB /* fmopl.cpp */; }; - DFF959560FB22D5700A3EC78 /* mididrv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D50D81F4E900B6D1FB /* mididrv.cpp */; }; - DFF959570FB22D5700A3EC78 /* midiparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D70D81F4E900B6D1FB /* midiparser.cpp */; }; - DFF959580FB22D5700A3EC78 /* midiparser_smf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */; }; - DFF959590FB22D5700A3EC78 /* midiparser_xmidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */; }; - DFF9595A0FB22D5700A3EC78 /* mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DB0D81F4E900B6D1FB /* mixer.cpp */; }; - DFF9595B0FB22D5700A3EC78 /* infogrames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */; }; - DFF9595C0FB22D5700A3EC78 /* module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E00D81F4E900B6D1FB /* module.cpp */; }; - DFF9595D0FB22D5700A3EC78 /* paula.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E20D81F4E900B6D1FB /* paula.cpp */; }; - DFF9595E0FB22D5700A3EC78 /* protracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E40D81F4E900B6D1FB /* protracker.cpp */; }; - DFF9595F0FB22D5700A3EC78 /* rjp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E60D81F4E900B6D1FB /* rjp1.cpp */; }; - DFF959600FB22D5700A3EC78 /* soundfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477E80D81F4E900B6D1FB /* soundfx.cpp */; }; - DFF959620FB22D5700A3EC78 /* mpu401.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */; }; - DFF959630FB22D5700A3EC78 /* null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477EF0D81F4E900B6D1FB /* null.cpp */; }; - DFF959640FB22D5700A3EC78 /* rate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F00D81F4E900B6D1FB /* rate.cpp */; }; - DFF959650FB22D5700A3EC78 /* adlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F70D81F4E900B6D1FB /* adlib.cpp */; }; - DFF959660FB22D5700A3EC78 /* fluidsynth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */; }; - DFF959670FB22D5700A3EC78 /* pcspk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478210D81F4E900B6D1FB /* pcspk.cpp */; }; - DFF959680FB22D5700A3EC78 /* ym2612.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFE478230D81F4E900B6D1FB /* ym2612.cpp */; }; DFF9596C0FB22D5700A3EC78 /* memorypool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD511460DF3383500854012 /* memorypool.cpp */; }; DFF9596D0FB22D5700A3EC78 /* seq.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD517E10DF33CAC00854012 /* seq.cpp */; }; DFF9596E0FB22D5700A3EC78 /* scaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD5183B0DF3411800854012 /* scaler.cpp */; }; DFF9596F0FB22D5700A3EC78 /* scalebit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518A00DF34B2500854012 /* scalebit.cpp */; }; DFF959700FB22D5700A3EC78 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AA0DF34BA600854012 /* 2xsai.cpp */; }; DFF959710FB22D5700A3EC78 /* aspect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AB0DF34BA600854012 /* aspect.cpp */; }; - DFF959720FB22D5700A3EC78 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518AD0DF34BA600854012 /* hq2x.cpp */; }; - DFF959730FB22D5700A3EC78 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B10DF34BA600854012 /* hq3x.cpp */; }; DFF959740FB22D5700A3EC78 /* scale2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B50DF34BA600854012 /* scale2x.cpp */; }; DFF959750FB22D5700A3EC78 /* scale3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD518B80DF34BA600854012 /* scale3x.cpp */; }; DFF959760FB22D5700A3EC78 /* iphone_keyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = DF841FD90E7BA61800F5680E /* iphone_keyboard.m */; }; @@ -3037,7 +3195,6 @@ DFF95C0F0FB22D5700A3EC78 /* archive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A400E7BBBB400F5680E /* archive.cpp */; }; DFF95C100FB22D5700A3EC78 /* unarj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A450E7BBBB400F5680E /* unarj.cpp */; }; DFF95C110FB22D5700A3EC78 /* stdiostream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */; }; - DFF95C120FB22D5700A3EC78 /* musicplugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */; }; DFF95C130FB22D5700A3EC78 /* saveload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF00ED5FC77001CB19F /* saveload.cpp */; }; DFF95C140FB22D5700A3EC78 /* ThemeEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */; }; DFF95C150FB22D5700A3EC78 /* ThemeEval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF7E8BF60ED5FC77001CB19F /* ThemeEval.cpp */; }; @@ -3054,7 +3211,6 @@ DFF95C200FB22D5700A3EC78 /* thumbnail_intern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */; }; DFF95C210FB22D5700A3EC78 /* dither.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFB900F485D890006E566 /* dither.cpp */; }; DFF95C270FB22D5700A3EC78 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD10F485DFB0006E566 /* debug.cpp */; }; - DFF95C280FB22D5700A3EC78 /* gui-manager.hcpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBD50F485E360006E566 /* gui-manager.hcpp */; }; DFF95C290FB22D5700A3EC78 /* posix-saves.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFBF80F4860A60006E566 /* posix-saves.cpp */; }; DFF95C2A0FB22D5700A3EC78 /* bmv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC1F0F4862520006E566 /* bmv.cpp */; }; DFF95C2B0FB22D5700A3EC78 /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2FFC200F4862520006E566 /* dialogs.cpp */; }; @@ -3126,7 +3282,6 @@ DFF95C920FB22D5700A3EC78 /* timer_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF573CBD0F5A85E100961A72 /* timer_lol.cpp */; }; DFF95C940FB22D5700A3EC78 /* sprites_lol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */; }; DFF95C950FB22D5700A3EC78 /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2A30F62D79E00D756B6 /* script.cpp */; }; - DFF95C980FB22D5700A3EC78 /* timestamp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF89C2B80F62D91000D756B6 /* timestamp.cpp */; }; DFF95C990FB22D5700A3EC78 /* pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5C0F63CAD4002D821E /* pn.cpp */; }; DFF95C9A0FB22D5700A3EC78 /* script_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5D0F63CAD4002D821E /* script_pn.cpp */; }; DFF95C9B0FB22D5700A3EC78 /* vga_pn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF093E5E0F63CAD4002D821E /* vga_pn.cpp */; }; @@ -3141,13 +3296,90 @@ DFF95CB30FB22D5700A3EC78 /* inter_fascin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC0F0FAC4E1900A5AFD7 /* inter_fascin.cpp */; }; DFF95CB40FB22D5700A3EC78 /* script_v3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC260FAC4EAB00A5AFD7 /* script_v3.cpp */; }; DFF95CB50FB22D5700A3EC78 /* script_v4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF09CC270FAC4EAB00A5AFD7 /* script_v4.cpp */; }; - DFF95CB70FB22D5700A3EC78 /* dosbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFF958A90FB222F300A3EC78 /* dosbox.cpp */; }; DFF95CBC0FB22D5700A3EC78 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A160E7BB34E00F5680E /* CoreAudio.framework */; }; DFF95CBD0FB22D5700A3EC78 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A170E7BB34E00F5680E /* CoreFoundation.framework */; }; DFF95CBE0FB22D5700A3EC78 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A180E7BB34E00F5680E /* Foundation.framework */; }; DFF95CBF0FB22D5700A3EC78 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A190E7BB34E00F5680E /* UIKit.framework */; }; DFF95CC00FB22D5700A3EC78 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A270E7BB37500F5680E /* AudioToolbox.framework */; }; DFF95CC10FB22D5700A3EC78 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF842A2E0E7BB39E00F5680E /* QuartzCore.framework */; }; + F92B4DCE139DD428000D1BF1 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DCC139DD428000D1BF1 /* quicktime.cpp */; }; + F92B4DCF139DD428000D1BF1 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DCC139DD428000D1BF1 /* quicktime.cpp */; }; + F92B4DD0139DD428000D1BF1 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DCC139DD428000D1BF1 /* quicktime.cpp */; }; + F92B4DD3139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DD1139DD449000D1BF1 /* yuv_to_rgb.cpp */; }; + F92B4DD4139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DD1139DD449000D1BF1 /* yuv_to_rgb.cpp */; }; + F92B4DD5139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DD1139DD449000D1BF1 /* yuv_to_rgb.cpp */; }; + F92B4DDA139DDC92000D1BF1 /* macosx-main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DD7139DDC92000D1BF1 /* macosx-main.cpp */; }; + F92B4DDB139DDC92000D1BF1 /* macosx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F92B4DD8139DDC92000D1BF1 /* macosx.cpp */; }; + F9946D90139E1A260072D195 /* cdtoons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D7A139E1A260072D195 /* cdtoons.cpp */; }; + F9946D91139E1A260072D195 /* cinepak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D7C139E1A260072D195 /* cinepak.cpp */; }; + F9946D92139E1A260072D195 /* indeo3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D7F139E1A260072D195 /* indeo3.cpp */; }; + F9946D93139E1A260072D195 /* mjpeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D81139E1A260072D195 /* mjpeg.cpp */; }; + F9946D94139E1A260072D195 /* msrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D83139E1A260072D195 /* msrle.cpp */; }; + F9946D95139E1A260072D195 /* msvideo1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D85139E1A260072D195 /* msvideo1.cpp */; }; + F9946D96139E1A260072D195 /* qtrle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D87139E1A260072D195 /* qtrle.cpp */; }; + F9946D97139E1A260072D195 /* rpza.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D89139E1A260072D195 /* rpza.cpp */; }; + F9946D98139E1A260072D195 /* smc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D8B139E1A260072D195 /* smc.cpp */; }; + F9946D99139E1A260072D195 /* truemotion1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D8D139E1A260072D195 /* truemotion1.cpp */; }; + F9946D9D139E1A560072D195 /* towns_midi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9A139E1A560072D195 /* towns_midi.cpp */; }; + F9946D9E139E1A560072D195 /* towns_midi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9A139E1A560072D195 /* towns_midi.cpp */; }; + F9946D9F139E1A560072D195 /* towns_midi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9A139E1A560072D195 /* towns_midi.cpp */; }; + F9946DA0139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9C139E1A560072D195 /* towns_pc98_plugins.cpp */; }; + F9946DA1139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9C139E1A560072D195 /* towns_pc98_plugins.cpp */; }; + F9946DA2139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946D9C139E1A560072D195 /* towns_pc98_plugins.cpp */; }; + F9946DB5139E1A880072D195 /* freeverb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA3139E1A880072D195 /* freeverb.cpp */; }; + F9946DB6139E1A880072D195 /* freeverb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA3139E1A880072D195 /* freeverb.cpp */; }; + F9946DB7139E1A880072D195 /* freeverb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA3139E1A880072D195 /* freeverb.cpp */; }; + F9946DB8139E1A880072D195 /* i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA5139E1A880072D195 /* i386.cpp */; }; + F9946DB9139E1A880072D195 /* i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA5139E1A880072D195 /* i386.cpp */; }; + F9946DBA139E1A880072D195 /* i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA5139E1A880072D195 /* i386.cpp */; }; + F9946DBB139E1A880072D195 /* mt32_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA7139E1A880072D195 /* mt32_file.cpp */; }; + F9946DBC139E1A880072D195 /* mt32_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA7139E1A880072D195 /* mt32_file.cpp */; }; + F9946DBD139E1A880072D195 /* mt32_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DA7139E1A880072D195 /* mt32_file.cpp */; }; + F9946DBE139E1A880072D195 /* part.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAA139E1A880072D195 /* part.cpp */; }; + F9946DBF139E1A880072D195 /* part.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAA139E1A880072D195 /* part.cpp */; }; + F9946DC0139E1A880072D195 /* part.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAA139E1A880072D195 /* part.cpp */; }; + F9946DC1139E1A880072D195 /* partial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAC139E1A880072D195 /* partial.cpp */; }; + F9946DC2139E1A880072D195 /* partial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAC139E1A880072D195 /* partial.cpp */; }; + F9946DC3139E1A880072D195 /* partial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAC139E1A880072D195 /* partial.cpp */; }; + F9946DC4139E1A880072D195 /* partialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAE139E1A880072D195 /* partialManager.cpp */; }; + F9946DC5139E1A880072D195 /* partialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAE139E1A880072D195 /* partialManager.cpp */; }; + F9946DC6139E1A880072D195 /* partialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DAE139E1A880072D195 /* partialManager.cpp */; }; + F9946DC7139E1A880072D195 /* synth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB1139E1A880072D195 /* synth.cpp */; }; + F9946DC8139E1A880072D195 /* synth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB1139E1A880072D195 /* synth.cpp */; }; + F9946DC9139E1A880072D195 /* synth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB1139E1A880072D195 /* synth.cpp */; }; + F9946DCA139E1A880072D195 /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB3139E1A880072D195 /* tables.cpp */; }; + F9946DCB139E1A880072D195 /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB3139E1A880072D195 /* tables.cpp */; }; + F9946DCC139E1A880072D195 /* tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DB3139E1A880072D195 /* tables.cpp */; }; + F9946DD6139E1AD30072D195 /* aac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DCE139E1AD30072D195 /* aac.cpp */; }; + F9946DD7139E1AD30072D195 /* aac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DCE139E1AD30072D195 /* aac.cpp */; }; + F9946DD8139E1AD30072D195 /* aac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DCE139E1AD30072D195 /* aac.cpp */; }; + F9946DD9139E1AD30072D195 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD0139E1AD30072D195 /* qdm2.cpp */; }; + F9946DDA139E1AD30072D195 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD0139E1AD30072D195 /* qdm2.cpp */; }; + F9946DDB139E1AD30072D195 /* qdm2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD0139E1AD30072D195 /* qdm2.cpp */; }; + F9946DDC139E1AD30072D195 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD4139E1AD30072D195 /* quicktime.cpp */; }; + F9946DDD139E1AD30072D195 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD4139E1AD30072D195 /* quicktime.cpp */; }; + F9946DDE139E1AD30072D195 /* quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DD4139E1AD30072D195 /* quicktime.cpp */; }; + F9946DE3139E1B180072D195 /* posix-main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE0139E1B180072D195 /* posix-main.cpp */; }; + F9946DE4139E1B180072D195 /* posix-main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE0139E1B180072D195 /* posix-main.cpp */; }; + F9946DE5139E1B180072D195 /* posix-main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE0139E1B180072D195 /* posix-main.cpp */; }; + F9946DE6139E1B180072D195 /* posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE1139E1B180072D195 /* posix.cpp */; }; + F9946DE7139E1B180072D195 /* posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE1139E1B180072D195 /* posix.cpp */; }; + F9946DE8139E1B180072D195 /* posix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DE1139E1B180072D195 /* posix.cpp */; }; + F9946DEC139E1B6F0072D195 /* downscaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEA139E1B6F0072D195 /* downscaler.cpp */; }; + F9946DED139E1B6F0072D195 /* downscaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEA139E1B6F0072D195 /* downscaler.cpp */; }; + F9946DEE139E1B6F0072D195 /* downscaler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEA139E1B6F0072D195 /* downscaler.cpp */; }; + F9946DF1139E1BA00072D195 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEF139E1BA00072D195 /* console.cpp */; }; + F9946DF2139E1BA00072D195 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEF139E1BA00072D195 /* console.cpp */; }; + F9946DF3139E1BA00072D195 /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DEF139E1BA00072D195 /* console.cpp */; }; + F9946DF7139E1BBF0072D195 /* sdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DF5139E1BBF0072D195 /* sdl-mixer.cpp */; }; + F9946DF8139E1BBF0072D195 /* sdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DF5139E1BBF0072D195 /* sdl-mixer.cpp */; }; + F9946DF9139E1BBF0072D195 /* sdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DF5139E1BBF0072D195 /* sdl-mixer.cpp */; }; + F9946DFE139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DFC139E1BEB0072D195 /* doublebuffersdl-mixer.cpp */; }; + F9946DFF139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DFC139E1BEB0072D195 /* doublebuffersdl-mixer.cpp */; }; + F9946E00139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946DFC139E1BEB0072D195 /* doublebuffersdl-mixer.cpp */; }; + F9946E04139E1C390072D195 /* sdl-graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946E02139E1C390072D195 /* sdl-graphics.cpp */; }; + F9946E05139E1C390072D195 /* sdl-graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946E02139E1C390072D195 /* sdl-graphics.cpp */; }; + F9946E06139E1C3A0072D195 /* sdl-graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9946E02139E1C390072D195 /* sdl-graphics.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -3199,12 +3431,9 @@ 8CD1ECC6126202AA00FA198C /* detection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detection.cpp; sourceTree = ""; }; 8CD1ECC7126202AA00FA198C /* display.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = display.cpp; sourceTree = ""; }; 8CD1ECC8126202AA00FA198C /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = display.h; sourceTree = ""; }; - 8CD1ECC9126202AA00FA198C /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = engine.cpp; sourceTree = ""; }; - 8CD1ECCA126202AA00FA198C /* engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = engine.h; sourceTree = ""; }; 8CD1ECCB126202AA00FA198C /* file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file.cpp; sourceTree = ""; }; 8CD1ECCC126202AA00FA198C /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = ""; }; 8CD1ECCD126202AA00FA198C /* game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = ""; }; - 8CD1ECCE126202AA00FA198C /* global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = global.h; sourceTree = ""; }; 8CD1ECCF126202AA00FA198C /* hugo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hugo.cpp; sourceTree = ""; }; 8CD1ECD0126202AA00FA198C /* hugo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hugo.h; sourceTree = ""; }; 8CD1ECD1126202AA00FA198C /* intro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = intro.cpp; sourceTree = ""; }; @@ -3301,8 +3530,6 @@ DF093E5D0F63CAD4002D821E /* script_pn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_pn.cpp; sourceTree = ""; }; DF093E5E0F63CAD4002D821E /* vga_pn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vga_pn.cpp; sourceTree = ""; }; DF09422A0F63CB26002D821E /* ScummVM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScummVM.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DF0942350F63CB9A002D821E /* events.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = events.cpp; sourceTree = ""; }; - DF0942370F63CB9A002D821E /* graphics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = graphics.cpp; sourceTree = ""; }; DF0942390F63CB9A002D821E /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; DF09423C0F63CB9A002D821E /* sdl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sdl.cpp; sourceTree = ""; }; DF09423D0F63CB9A002D821E /* sdl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdl.h; sourceTree = ""; }; @@ -3335,8 +3562,151 @@ DF09CC260FAC4EAB00A5AFD7 /* script_v3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_v3.cpp; sourceTree = ""; }; DF09CC270FAC4EAB00A5AFD7 /* script_v4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_v4.cpp; sourceTree = ""; }; DF0E30391252C5BD0082D593 /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cms.cpp; sourceTree = ""; }; - DF0E303F1252C6090082D593 /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cms.cpp; sourceTree = ""; }; - DF0E30401252C6090082D593 /* cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cms.h; sourceTree = ""; }; + DF203F461380C06E0056300A /* gui-manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gui-manager.cpp"; sourceTree = ""; }; + DF203F531380C2740056300A /* avi_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = avi_decoder.cpp; path = ../../video/avi_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F541380C2740056300A /* avi_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = avi_decoder.h; path = ../../video/avi_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F551380C2740056300A /* coktel_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = coktel_decoder.cpp; path = ../../video/coktel_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F561380C2740056300A /* coktel_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = coktel_decoder.h; path = ../../video/coktel_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F571380C2740056300A /* dxa_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dxa_decoder.cpp; path = ../../video/dxa_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F581380C2740056300A /* dxa_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dxa_decoder.h; path = ../../video/dxa_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F591380C2740056300A /* flic_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = flic_decoder.cpp; path = ../../video/flic_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F5A1380C2740056300A /* flic_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = flic_decoder.h; path = ../../video/flic_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F5D1380C2740056300A /* qt_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qt_decoder.cpp; path = ../../video/qt_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F5E1380C2750056300A /* qt_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qt_decoder.h; path = ../../video/qt_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F5F1380C2750056300A /* smk_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = smk_decoder.cpp; path = ../../video/smk_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F601380C2750056300A /* smk_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smk_decoder.h; path = ../../video/smk_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F611380C2750056300A /* video_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video_decoder.cpp; path = ../../video/video_decoder.cpp; sourceTree = SOURCE_ROOT; }; + DF203F621380C2750056300A /* video_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = video_decoder.h; path = ../../video/video_decoder.h; sourceTree = SOURCE_ROOT; }; + DF203F7C1380C2920056300A /* cdtoons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cdtoons.cpp; path = ../../video/codecs/cdtoons.cpp; sourceTree = SOURCE_ROOT; }; + DF203F7D1380C2920056300A /* cdtoons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cdtoons.h; path = ../../video/codecs/cdtoons.h; sourceTree = SOURCE_ROOT; }; + DF203F7E1380C2920056300A /* cinepak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cinepak.cpp; path = ../../video/codecs/cinepak.cpp; sourceTree = SOURCE_ROOT; }; + DF203F7F1380C2920056300A /* cinepak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cinepak.h; path = ../../video/codecs/cinepak.h; sourceTree = SOURCE_ROOT; }; + DF203F801380C2920056300A /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codec.h; path = ../../video/codecs/codec.h; sourceTree = SOURCE_ROOT; }; + DF203F811380C2920056300A /* indeo3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = indeo3.cpp; path = ../../video/codecs/indeo3.cpp; sourceTree = SOURCE_ROOT; }; + DF203F821380C2920056300A /* indeo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = indeo3.h; path = ../../video/codecs/indeo3.h; sourceTree = SOURCE_ROOT; }; + DF203F831380C2920056300A /* mjpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mjpeg.cpp; path = ../../video/codecs/mjpeg.cpp; sourceTree = SOURCE_ROOT; }; + DF203F841380C2920056300A /* mjpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mjpeg.h; path = ../../video/codecs/mjpeg.h; sourceTree = SOURCE_ROOT; }; + DF203F851380C2920056300A /* msrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msrle.cpp; path = ../../video/codecs/msrle.cpp; sourceTree = SOURCE_ROOT; }; + DF203F861380C2920056300A /* msrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msrle.h; path = ../../video/codecs/msrle.h; sourceTree = SOURCE_ROOT; }; + DF203F871380C2920056300A /* msvideo1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msvideo1.cpp; path = ../../video/codecs/msvideo1.cpp; sourceTree = SOURCE_ROOT; }; + DF203F881380C2920056300A /* msvideo1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msvideo1.h; path = ../../video/codecs/msvideo1.h; sourceTree = SOURCE_ROOT; }; + DF203F8C1380C2920056300A /* qtrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qtrle.cpp; path = ../../video/codecs/qtrle.cpp; sourceTree = SOURCE_ROOT; }; + DF203F8D1380C2920056300A /* qtrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qtrle.h; path = ../../video/codecs/qtrle.h; sourceTree = SOURCE_ROOT; }; + DF203F8E1380C2920056300A /* rpza.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rpza.cpp; path = ../../video/codecs/rpza.cpp; sourceTree = SOURCE_ROOT; }; + DF203F8F1380C2920056300A /* rpza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rpza.h; path = ../../video/codecs/rpza.h; sourceTree = SOURCE_ROOT; }; + DF203F901380C2920056300A /* smc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = smc.cpp; path = ../../video/codecs/smc.cpp; sourceTree = SOURCE_ROOT; }; + DF203F911380C2920056300A /* smc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smc.h; path = ../../video/codecs/smc.h; sourceTree = SOURCE_ROOT; }; + DF203F921380C2920056300A /* truemotion1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = truemotion1.cpp; path = ../../video/codecs/truemotion1.cpp; sourceTree = SOURCE_ROOT; }; + DF203F931380C2920056300A /* truemotion1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = truemotion1.h; path = ../../video/codecs/truemotion1.h; sourceTree = SOURCE_ROOT; }; + DF203F941380C2920056300A /* truemotion1data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = truemotion1data.h; path = ../../video/codecs/truemotion1data.h; sourceTree = SOURCE_ROOT; }; + DF203FC01380C3BC0056300A /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF203FC11380C3BC0056300A /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF203FC21380C3BC0056300A /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialogs.cpp; sourceTree = ""; }; + DF203FC31380C3BC0056300A /* dialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialogs.h; sourceTree = ""; }; + DF203FC41380C3BC0056300A /* file_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v1d.cpp; sourceTree = ""; }; + DF203FC51380C3BC0056300A /* file_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v1w.cpp; sourceTree = ""; }; + DF203FC61380C3BC0056300A /* file_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v2d.cpp; sourceTree = ""; }; + DF203FC71380C3BC0056300A /* file_v2w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v2w.cpp; sourceTree = ""; }; + DF203FC81380C3BC0056300A /* file_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_v3d.cpp; sourceTree = ""; }; + DF203FC91380C3BC0056300A /* object_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v1d.cpp; sourceTree = ""; }; + DF203FCA1380C3BC0056300A /* object_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v1w.cpp; sourceTree = ""; }; + DF203FCB1380C3BC0056300A /* object_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v2d.cpp; sourceTree = ""; }; + DF203FCC1380C3BC0056300A /* object_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object_v3d.cpp; sourceTree = ""; }; + DF203FCD1380C3BC0056300A /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cpp; sourceTree = ""; }; + DF203FCE1380C3BC0056300A /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = ""; }; + DF203FCF1380C3BC0056300A /* parser_v1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v1d.cpp; sourceTree = ""; }; + DF203FD01380C3BC0056300A /* parser_v1w.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v1w.cpp; sourceTree = ""; }; + DF203FD11380C3BC0056300A /* parser_v2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v2d.cpp; sourceTree = ""; }; + DF203FD21380C3BC0056300A /* parser_v3d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parser_v3d.cpp; sourceTree = ""; }; + DF203FD31380C3BC0056300A /* text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = text.cpp; sourceTree = ""; }; + DF203FD41380C3BC0056300A /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = text.h; sourceTree = ""; }; + DF2040221380C8B70056300A /* editable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = editable.cpp; path = widgets/editable.cpp; sourceTree = ""; }; + DF2040231380C8B70056300A /* editable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = editable.h; path = widgets/editable.h; sourceTree = ""; }; + DF2040241380C8B70056300A /* edittext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = edittext.cpp; path = widgets/edittext.cpp; sourceTree = ""; }; + DF2040251380C8B70056300A /* edittext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = edittext.h; path = widgets/edittext.h; sourceTree = ""; }; + DF2040261380C8B70056300A /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = widgets/list.cpp; sourceTree = ""; }; + DF2040271380C8B70056300A /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = widgets/list.h; sourceTree = ""; }; + DF2040281380C8B70056300A /* popup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = popup.cpp; path = widgets/popup.cpp; sourceTree = ""; }; + DF2040291380C8B70056300A /* popup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = popup.h; path = widgets/popup.h; sourceTree = ""; }; + DF20402A1380C8B70056300A /* scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scrollbar.cpp; path = widgets/scrollbar.cpp; sourceTree = ""; }; + DF20402B1380C8B70056300A /* scrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scrollbar.h; path = widgets/scrollbar.h; sourceTree = ""; }; + DF20402C1380C8B70056300A /* tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tab.cpp; path = widgets/tab.cpp; sourceTree = ""; }; + DF20402D1380C8B70056300A /* tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tab.h; path = widgets/tab.h; sourceTree = ""; }; + DF2040471380CA230056300A /* audiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audiostream.cpp; path = ../../audio/audiostream.cpp; sourceTree = SOURCE_ROOT; }; + DF2040481380CA230056300A /* audiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audiostream.h; path = ../../audio/audiostream.h; sourceTree = SOURCE_ROOT; }; + DF2040491380CA230056300A /* fmopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fmopl.cpp; path = ../../audio/fmopl.cpp; sourceTree = SOURCE_ROOT; }; + DF20404A1380CA230056300A /* fmopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmopl.h; path = ../../audio/fmopl.h; sourceTree = SOURCE_ROOT; }; + DF20404B1380CA230056300A /* mididrv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mididrv.cpp; path = ../../audio/mididrv.cpp; sourceTree = SOURCE_ROOT; }; + DF20404C1380CA230056300A /* mididrv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mididrv.h; path = ../../audio/mididrv.h; sourceTree = SOURCE_ROOT; }; + DF20404D1380CA230056300A /* midiparser_smf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser_smf.cpp; path = ../../audio/midiparser_smf.cpp; sourceTree = SOURCE_ROOT; }; + DF20404E1380CA230056300A /* midiparser_xmidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser_xmidi.cpp; path = ../../audio/midiparser_xmidi.cpp; sourceTree = SOURCE_ROOT; }; + DF20404F1380CA230056300A /* midiparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiparser.cpp; path = ../../audio/midiparser.cpp; sourceTree = SOURCE_ROOT; }; + DF2040501380CA230056300A /* midiparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = midiparser.h; path = ../../audio/midiparser.h; sourceTree = SOURCE_ROOT; }; + DF2040511380CA230056300A /* midiplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = midiplayer.cpp; path = ../../audio/midiplayer.cpp; sourceTree = SOURCE_ROOT; }; + DF2040521380CA230056300A /* midiplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = midiplayer.h; path = ../../audio/midiplayer.h; sourceTree = SOURCE_ROOT; }; + DF2040531380CA230056300A /* mixer_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mixer_intern.h; path = ../../audio/mixer_intern.h; sourceTree = SOURCE_ROOT; }; + DF2040541380CA230056300A /* mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mixer.cpp; path = ../../audio/mixer.cpp; sourceTree = SOURCE_ROOT; }; + DF2040551380CA230056300A /* mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mixer.h; path = ../../audio/mixer.h; sourceTree = SOURCE_ROOT; }; + DF2040561380CA230056300A /* mpu401.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mpu401.cpp; path = ../../audio/mpu401.cpp; sourceTree = SOURCE_ROOT; }; + DF2040571380CA230056300A /* mpu401.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mpu401.h; path = ../../audio/mpu401.h; sourceTree = SOURCE_ROOT; }; + DF2040581380CA230056300A /* musicplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = musicplugin.cpp; path = ../../audio/musicplugin.cpp; sourceTree = SOURCE_ROOT; }; + DF2040591380CA230056300A /* musicplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musicplugin.h; path = ../../audio/musicplugin.h; sourceTree = SOURCE_ROOT; }; + DF20405A1380CA230056300A /* rate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rate.cpp; path = ../../audio/rate.cpp; sourceTree = SOURCE_ROOT; }; + DF20405B1380CA230056300A /* rate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rate.h; path = ../../audio/rate.h; sourceTree = SOURCE_ROOT; }; + DF20405C1380CA230056300A /* timestamp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = timestamp.cpp; path = ../../audio/timestamp.cpp; sourceTree = SOURCE_ROOT; }; + DF20405D1380CA230056300A /* timestamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = timestamp.h; path = ../../audio/timestamp.h; sourceTree = SOURCE_ROOT; }; + DF2040831380CA400056300A /* adpcm_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = adpcm_intern.h; path = ../../audio/decoders/adpcm_intern.h; sourceTree = SOURCE_ROOT; }; + DF2040841380CA400056300A /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adpcm.cpp; path = ../../audio/decoders/adpcm.cpp; sourceTree = SOURCE_ROOT; }; + DF2040851380CA400056300A /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = adpcm.h; path = ../../audio/decoders/adpcm.h; sourceTree = SOURCE_ROOT; }; + DF2040861380CA400056300A /* aiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aiff.cpp; path = ../../audio/decoders/aiff.cpp; sourceTree = SOURCE_ROOT; }; + DF2040871380CA400056300A /* aiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = aiff.h; path = ../../audio/decoders/aiff.h; sourceTree = SOURCE_ROOT; }; + DF2040881380CA400056300A /* flac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = flac.cpp; path = ../../audio/decoders/flac.cpp; sourceTree = SOURCE_ROOT; }; + DF2040891380CA400056300A /* flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = flac.h; path = ../../audio/decoders/flac.h; sourceTree = SOURCE_ROOT; }; + DF20408A1380CA400056300A /* iff_sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = iff_sound.cpp; path = ../../audio/decoders/iff_sound.cpp; sourceTree = SOURCE_ROOT; }; + DF20408B1380CA400056300A /* iff_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iff_sound.h; path = ../../audio/decoders/iff_sound.h; sourceTree = SOURCE_ROOT; }; + DF20408C1380CA400056300A /* mac_snd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mac_snd.cpp; path = ../../audio/decoders/mac_snd.cpp; sourceTree = SOURCE_ROOT; }; + DF20408D1380CA400056300A /* mac_snd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mac_snd.h; path = ../../audio/decoders/mac_snd.h; sourceTree = SOURCE_ROOT; }; + DF20408E1380CA400056300A /* mp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mp3.cpp; path = ../../audio/decoders/mp3.cpp; sourceTree = SOURCE_ROOT; }; + DF20408F1380CA400056300A /* mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mp3.h; path = ../../audio/decoders/mp3.h; sourceTree = SOURCE_ROOT; }; + DF2040901380CA400056300A /* raw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = raw.cpp; path = ../../audio/decoders/raw.cpp; sourceTree = SOURCE_ROOT; }; + DF2040911380CA400056300A /* raw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = raw.h; path = ../../audio/decoders/raw.h; sourceTree = SOURCE_ROOT; }; + DF2040921380CA400056300A /* vag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vag.cpp; path = ../../audio/decoders/vag.cpp; sourceTree = SOURCE_ROOT; }; + DF2040931380CA400056300A /* vag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vag.h; path = ../../audio/decoders/vag.h; sourceTree = SOURCE_ROOT; }; + DF2040941380CA400056300A /* voc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = voc.cpp; path = ../../audio/decoders/voc.cpp; sourceTree = SOURCE_ROOT; }; + DF2040951380CA400056300A /* voc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = voc.h; path = ../../audio/decoders/voc.h; sourceTree = SOURCE_ROOT; }; + DF2040961380CA400056300A /* vorbis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vorbis.cpp; path = ../../audio/decoders/vorbis.cpp; sourceTree = SOURCE_ROOT; }; + DF2040971380CA400056300A /* vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vorbis.h; path = ../../audio/decoders/vorbis.h; sourceTree = SOURCE_ROOT; }; + DF2040981380CA400056300A /* wave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wave.cpp; path = ../../audio/decoders/wave.cpp; sourceTree = SOURCE_ROOT; }; + DF2040991380CA400056300A /* wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wave.h; path = ../../audio/decoders/wave.h; sourceTree = SOURCE_ROOT; }; + DF2040BC1380CA810056300A /* infogrames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = infogrames.cpp; path = ../../audio/mods/infogrames.cpp; sourceTree = SOURCE_ROOT; }; + DF2040BD1380CA810056300A /* infogrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = infogrames.h; path = ../../audio/mods/infogrames.h; sourceTree = SOURCE_ROOT; }; + DF2040BE1380CA810056300A /* maxtrax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = maxtrax.cpp; path = ../../audio/mods/maxtrax.cpp; sourceTree = SOURCE_ROOT; }; + DF2040BF1380CA810056300A /* maxtrax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = maxtrax.h; path = ../../audio/mods/maxtrax.h; sourceTree = SOURCE_ROOT; }; + DF2040C01380CA810056300A /* module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cpp; path = ../../audio/mods/module.cpp; sourceTree = SOURCE_ROOT; }; + DF2040C11380CA810056300A /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../audio/mods/module.h; sourceTree = SOURCE_ROOT; }; + DF2040C21380CA810056300A /* paula.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = paula.cpp; path = ../../audio/mods/paula.cpp; sourceTree = SOURCE_ROOT; }; + DF2040C31380CA810056300A /* paula.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = paula.h; path = ../../audio/mods/paula.h; sourceTree = SOURCE_ROOT; }; + DF2040C41380CA810056300A /* protracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = protracker.cpp; path = ../../audio/mods/protracker.cpp; sourceTree = SOURCE_ROOT; }; + DF2040C51380CA810056300A /* protracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = protracker.h; path = ../../audio/mods/protracker.h; sourceTree = SOURCE_ROOT; }; + DF2040C61380CA810056300A /* rjp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rjp1.cpp; path = ../../audio/mods/rjp1.cpp; sourceTree = SOURCE_ROOT; }; + DF2040C71380CA810056300A /* rjp1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rjp1.h; path = ../../audio/mods/rjp1.h; sourceTree = SOURCE_ROOT; }; + DF2040C81380CA810056300A /* soundfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = soundfx.cpp; path = ../../audio/mods/soundfx.cpp; sourceTree = SOURCE_ROOT; }; + DF2040C91380CA810056300A /* soundfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = soundfx.h; path = ../../audio/mods/soundfx.h; sourceTree = SOURCE_ROOT; }; + DF2040CA1380CA810056300A /* tfmx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tfmx.cpp; path = ../../audio/mods/tfmx.cpp; sourceTree = SOURCE_ROOT; }; + DF2040CB1380CA810056300A /* tfmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tfmx.h; path = ../../audio/mods/tfmx.h; sourceTree = SOURCE_ROOT; }; + DF2040E51380CAA40056300A /* adlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adlib.cpp; path = ../../audio/softsynth/adlib.cpp; sourceTree = SOURCE_ROOT; }; + DF2040E61380CAA40056300A /* appleiigs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = appleiigs.cpp; path = ../../audio/softsynth/appleiigs.cpp; sourceTree = SOURCE_ROOT; }; + DF2040E71380CAA40056300A /* cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cms.cpp; path = ../../audio/softsynth/cms.cpp; sourceTree = SOURCE_ROOT; }; + DF2040E81380CAA40056300A /* cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cms.h; path = ../../audio/softsynth/cms.h; sourceTree = SOURCE_ROOT; }; + DF2040E91380CAA40056300A /* eas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = eas.cpp; path = ../../audio/softsynth/eas.cpp; sourceTree = SOURCE_ROOT; }; + DF2040EA1380CAA40056300A /* emumidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = emumidi.h; path = ../../audio/softsynth/emumidi.h; sourceTree = SOURCE_ROOT; }; + DF2040EB1380CAA40056300A /* fluidsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fluidsynth.cpp; path = ../../audio/softsynth/fluidsynth.cpp; sourceTree = SOURCE_ROOT; }; + DF2040EC1380CAA40056300A /* mt32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mt32.cpp; path = ../../audio/softsynth/mt32.cpp; sourceTree = SOURCE_ROOT; }; + DF2040ED1380CAA40056300A /* pcspk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pcspk.cpp; path = ../../audio/softsynth/pcspk.cpp; sourceTree = SOURCE_ROOT; }; + DF2040EE1380CAA40056300A /* pcspk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pcspk.h; path = ../../audio/softsynth/pcspk.h; sourceTree = SOURCE_ROOT; }; + DF2040EF1380CAA40056300A /* sid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sid.cpp; path = ../../audio/softsynth/sid.cpp; sourceTree = SOURCE_ROOT; }; + DF2040F01380CAA40056300A /* sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sid.h; path = ../../audio/softsynth/sid.h; sourceTree = SOURCE_ROOT; }; + DF2040F11380CAA40056300A /* wave6581.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wave6581.cpp; path = ../../audio/softsynth/wave6581.cpp; sourceTree = SOURCE_ROOT; }; DF224E020FB23BC500C8E453 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; DF2EC3E410E6490800765801 /* browser_osx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = browser_osx.mm; sourceTree = ""; }; DF2EC3F610E64C0C00765801 /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialogs.cpp; sourceTree = ""; }; @@ -3350,16 +3720,12 @@ DF2EC50010E64D7C00765801 /* player_sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_sid.h; sourceTree = ""; }; DF2EC50910E64DB300765801 /* textconsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = textconsole.cpp; sourceTree = ""; }; DF2EC50A10E64DB300765801 /* textconsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = textconsole.h; sourceTree = ""; }; - DF2EC51010E64E3100765801 /* sid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sid.cpp; sourceTree = ""; }; - DF2EC51110E64E3100765801 /* sid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sid.h; sourceTree = ""; }; - DF2EC51710E64EE600765801 /* wave6581.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wave6581.cpp; sourceTree = ""; }; DF2FFB900F485D890006E566 /* dither.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dither.cpp; sourceTree = ""; }; DF2FFB910F485D890006E566 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = ""; }; DF2FFB920F485D890006E566 /* pixelformat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pixelformat.h; sourceTree = ""; }; DF2FFBD10F485DFB0006E566 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debug.cpp; sourceTree = ""; }; DF2FFBD20F485DFB0006E566 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; - DF2FFBD50F485E360006E566 /* gui-manager.hcpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gui-manager.hcpp; sourceTree = ""; }; - DF2FFBD60F485E360006E566 /* gui-manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui-manager.h; sourceTree = ""; }; + DF2FFBD60F485E360006E566 /* gui-manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gui-manager.h"; sourceTree = ""; }; DF2FFBDB0F485E480006E566 /* scummclassic.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = scummclassic.zip; sourceTree = ""; }; DF2FFBF80F4860A60006E566 /* posix-saves.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "posix-saves.cpp"; sourceTree = ""; }; DF2FFBF90F4860A60006E566 /* posix-saves.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "posix-saves.h"; sourceTree = ""; }; @@ -3437,26 +3803,6 @@ DF2FFD0F0F4870E50006E566 /* tucker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tucker.h; sourceTree = ""; }; DF2FFD290F48717F0006E566 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; DF2FFD2A0F48717F0006E566 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; - DF45B0F7116627DA009B85CC /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adpcm.cpp; sourceTree = ""; }; - DF45B0F8116627DA009B85CC /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adpcm.h; sourceTree = ""; }; - DF45B0FA116627DA009B85CC /* aiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aiff.cpp; sourceTree = ""; }; - DF45B0FB116627DA009B85CC /* aiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiff.h; sourceTree = ""; }; - DF45B0FD116627DA009B85CC /* flac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flac.cpp; sourceTree = ""; }; - DF45B0FE116627DA009B85CC /* flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flac.h; sourceTree = ""; }; - DF45B100116627DA009B85CC /* iff_sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iff_sound.cpp; sourceTree = ""; }; - DF45B101116627DA009B85CC /* iff_sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iff_sound.h; sourceTree = ""; }; - DF45B103116627DA009B85CC /* mp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mp3.cpp; sourceTree = ""; }; - DF45B104116627DA009B85CC /* mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mp3.h; sourceTree = ""; }; - DF45B106116627DA009B85CC /* raw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = raw.cpp; sourceTree = ""; }; - DF45B107116627DA009B85CC /* raw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raw.h; sourceTree = ""; }; - DF45B109116627DA009B85CC /* vag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vag.cpp; sourceTree = ""; }; - DF45B10A116627DA009B85CC /* vag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vag.h; sourceTree = ""; }; - DF45B10C116627DA009B85CC /* voc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = voc.cpp; sourceTree = ""; }; - DF45B10D116627DA009B85CC /* voc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = voc.h; sourceTree = ""; }; - DF45B10F116627DA009B85CC /* vorbis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vorbis.cpp; sourceTree = ""; }; - DF45B110116627DA009B85CC /* vorbis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbis.h; sourceTree = ""; }; - DF45B112116627DA009B85CC /* wave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wave.cpp; sourceTree = ""; }; - DF45B113116627DA009B85CC /* wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wave.h; sourceTree = ""; }; DF45B176116628A5009B85CC /* animate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = animate.cpp; sourceTree = ""; }; DF45B177116628A5009B85CC /* animate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = animate.h; sourceTree = ""; }; DF45B178116628A5009B85CC /* cache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cache.cpp; sourceTree = ""; }; @@ -3519,6 +3865,97 @@ DF45B1C4116628A5009B85CC /* soundcmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundcmd.h; sourceTree = ""; }; DF45B1C6116628A5009B85CC /* seq_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = seq_decoder.cpp; sourceTree = ""; }; DF45B1C7116628A5009B85CC /* seq_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seq_decoder.h; sourceTree = ""; }; + DF46B6F21381E18900D08723 /* coroutine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coroutine.cpp; sourceTree = ""; }; + DF46B6F71381E1FF00D08723 /* towns_audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_audio.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_audio.cpp; sourceTree = SOURCE_ROOT; }; + DF46B6F81381E1FF00D08723 /* towns_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_audio.h; path = ../../audio/softsynth/fmtowns_pc98/towns_audio.h; sourceTree = SOURCE_ROOT; }; + DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_euphony.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_euphony.cpp; sourceTree = SOURCE_ROOT; }; + DF46B6FA1381E1FF00D08723 /* towns_euphony.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_euphony.h; path = ../../audio/softsynth/fmtowns_pc98/towns_euphony.h; sourceTree = SOURCE_ROOT; }; + DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_pc98_driver.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp; sourceTree = SOURCE_ROOT; }; + DF46B6FC1381E1FF00D08723 /* towns_pc98_driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_pc98_driver.h; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_driver.h; sourceTree = SOURCE_ROOT; }; + DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_pc98_fmsynth.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp; sourceTree = SOURCE_ROOT; }; + DF46B6FE1381E1FF00D08723 /* towns_pc98_fmsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_pc98_fmsynth.h; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h; sourceTree = SOURCE_ROOT; }; + DF46B70F1381E27000D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B7101381E27000D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B7111381E27000D08723 /* databases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = databases.cpp; sourceTree = ""; }; + DF46B7121381E27000D08723 /* databases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = databases.h; sourceTree = ""; }; + DF46B7131381E27000D08723 /* dbase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dbase.cpp; sourceTree = ""; }; + DF46B7141381E27000D08723 /* dbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dbase.h; sourceTree = ""; }; + DF46B7151381E27000D08723 /* iniconfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iniconfig.cpp; sourceTree = ""; }; + DF46B7161381E27000D08723 /* iniconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iniconfig.h; sourceTree = ""; }; + DF46B7171381E27000D08723 /* init_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init_v7.cpp; sourceTree = ""; }; + DF46B7181381E27000D08723 /* inter_inca2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inter_inca2.cpp; sourceTree = ""; }; + DF46B7421381E40500D08723 /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = log.cpp; path = log/log.cpp; sourceTree = ""; }; + DF46B7431381E40500D08723 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = log.h; path = log/log.h; sourceTree = ""; }; + DF46B7471381E40F00D08723 /* modular-backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "modular-backend.cpp"; sourceTree = ""; }; + DF46B7481381E40F00D08723 /* modular-backend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "modular-backend.h"; sourceTree = ""; }; + DF46B7501381E46700D08723 /* actor_he.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = actor_he.h; sourceTree = ""; }; + DF46B7511381E46700D08723 /* player_v2base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_v2base.cpp; sourceTree = ""; }; + DF46B7521381E46700D08723 /* player_v2base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_v2base.h; sourceTree = ""; }; + DF46B7531381E46700D08723 /* player_v2cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_v2cms.h; sourceTree = ""; }; + DF46B75B1381E4A400D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B75C1381E4A400D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B75D1381E4A400D08723 /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = ""; }; + DF46B7611381E4D400D08723 /* robot_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = robot_decoder.cpp; sourceTree = ""; }; + DF46B7621381E4D400D08723 /* robot_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = robot_decoder.h; sourceTree = ""; }; + DF46B7661381E4E400D08723 /* vm_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vm_types.cpp; sourceTree = ""; }; + DF46B76E1381E54200D08723 /* bufferedstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bufferedstream.h; sourceTree = ""; }; + DF46B76F1381E54200D08723 /* dcl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dcl.cpp; sourceTree = ""; }; + DF46B7701381E54200D08723 /* dcl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dcl.h; sourceTree = ""; }; + DF46B7711381E54200D08723 /* forbidden.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = forbidden.h; sourceTree = ""; }; + DF46B7721381E54200D08723 /* iff_container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iff_container.cpp; sourceTree = ""; }; + DF46B7731381E54200D08723 /* substream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = substream.h; sourceTree = ""; }; + DF46B7741381E54200D08723 /* translation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = translation.h; sourceTree = ""; }; + DF46B7751381E54200D08723 /* winexe_ne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe_ne.cpp; sourceTree = ""; }; + DF46B7761381E54200D08723 /* winexe_ne.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe_ne.h; sourceTree = ""; }; + DF46B7771381E54200D08723 /* winexe_pe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe_pe.cpp; sourceTree = ""; }; + DF46B7781381E54200D08723 /* winexe_pe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe_pe.h; sourceTree = ""; }; + DF46B7791381E54200D08723 /* winexe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winexe.cpp; sourceTree = ""; }; + DF46B77A1381E54200D08723 /* winexe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winexe.h; sourceTree = ""; }; + DF46B78E1381E58000D08723 /* palette.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = palette.h; sourceTree = ""; }; + DF46B78F1381E58000D08723 /* png.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = png.cpp; sourceTree = ""; }; + DF46B7901381E58000D08723 /* png.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = png.h; sourceTree = ""; }; + DF46B7911381E58000D08723 /* wincursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wincursor.cpp; sourceTree = ""; }; + DF46B7921381E58000D08723 /* wincursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wincursor.h; sourceTree = ""; }; + DF46B79D1381E5B500D08723 /* winfont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = winfont.cpp; sourceTree = ""; }; + DF46B79E1381E5B500D08723 /* winfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winfont.h; sourceTree = ""; }; + DF46B7A31381E5D900D08723 /* sdl-timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-timer.cpp"; path = "sdl/sdl-timer.cpp"; sourceTree = ""; }; + DF46B7A41381E5D900D08723 /* sdl-timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-timer.h"; path = "sdl/sdl-timer.h"; sourceTree = ""; }; + DF46B7A81381E5F100D08723 /* header.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = header.cpp; sourceTree = ""; }; + DF46B7B21381E67800D08723 /* sdl-mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-mutex.cpp"; path = "mutex/sdl/sdl-mutex.cpp"; sourceTree = ""; }; + DF46B7B31381E67800D08723 /* sdl-mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-mutex.h"; path = "mutex/sdl/sdl-mutex.h"; sourceTree = ""; }; + DF46B7BB1381E6C000D08723 /* object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = object.cpp; sourceTree = ""; }; + DF46B7BC1381E6C000D08723 /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = ""; }; + DF46B7C61381E72500D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B7C71381E72500D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B7CD1381E76300D08723 /* sdl-events.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-events.cpp"; path = "events/sdl/sdl-events.cpp"; sourceTree = ""; }; + DF46B7CE1381E76300D08723 /* sdl-events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-events.h"; path = "events/sdl/sdl-events.h"; sourceTree = ""; }; + DF46B7D41381E7C600D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B7D51381E7C600D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B83B1381F13500D08723 /* saveload_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_v7.cpp; sourceTree = ""; }; + DF46B8431381F35500D08723 /* saveload_inca2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_inca2.cpp; sourceTree = ""; }; + DF46B8471381F38700D08723 /* inter_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inter_v7.cpp; sourceTree = ""; }; + DF46B84B1381F39E00D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B84C1381F39E00D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B8501381F3B400D08723 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + DF46B8511381F3B400D08723 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + DF46B85A1381F44E00D08723 /* dbopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dbopl.cpp; path = ../../audio/softsynth/opl/dbopl.cpp; sourceTree = SOURCE_ROOT; }; + DF46B85B1381F44E00D08723 /* dbopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dbopl.h; path = ../../audio/softsynth/opl/dbopl.h; sourceTree = SOURCE_ROOT; }; + DF46B85C1381F44E00D08723 /* dosbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dosbox.cpp; path = ../../audio/softsynth/opl/dosbox.cpp; sourceTree = SOURCE_ROOT; }; + DF46B85D1381F44E00D08723 /* dosbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dosbox.h; path = ../../audio/softsynth/opl/dosbox.h; sourceTree = SOURCE_ROOT; }; + DF46B85E1381F44E00D08723 /* mame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mame.cpp; path = ../../audio/softsynth/opl/mame.cpp; sourceTree = SOURCE_ROOT; }; + DF46B85F1381F44E00D08723 /* mame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mame.h; path = ../../audio/softsynth/opl/mame.h; sourceTree = SOURCE_ROOT; }; + DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-audiocd.cpp"; path = "audiocd/sdl/sdl-audiocd.cpp"; sourceTree = ""; }; + DF46B8701381F4A200D08723 /* sdl-audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-audiocd.h"; path = "audiocd/sdl/sdl-audiocd.h"; sourceTree = ""; }; + DF46B87B1381F4F200D08723 /* default-audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "default-audiocd.cpp"; path = "audiocd/default/default-audiocd.cpp"; sourceTree = ""; }; + DF46B87C1381F4F200D08723 /* default-audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "default-audiocd.h"; path = "audiocd/default/default-audiocd.h"; sourceTree = ""; }; + DF46B8801381F4FF00D08723 /* audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audiocd.h; path = audiocd/audiocd.h; sourceTree = ""; }; + DF46B8851381F56400D08723 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + DF46B8871381F5D800D08723 /* sdl-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "sdl-provider.cpp"; path = "sdl/sdl-provider.cpp"; sourceTree = ""; }; + DF46B8881381F5D800D08723 /* sdl-provider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sdl-provider.h"; path = "sdl/sdl-provider.h"; sourceTree = ""; }; + DF46B8901381F62B00D08723 /* adpcm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adpcm.cpp; sourceTree = ""; }; + DF46B8911381F62B00D08723 /* adpcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adpcm.h; sourceTree = ""; }; + DF46B8991381F6C400D08723 /* null.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = null.cpp; path = ../../audio/null.cpp; sourceTree = SOURCE_ROOT; }; + DF46B89A1381F6C400D08723 /* null.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = null.h; path = ../../audio/null.h; sourceTree = SOURCE_ROOT; }; DF573BFE0F5A81EA00961A72 /* kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel.h; sourceTree = ""; }; DF573BFF0F5A81EA00961A72 /* script.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = script.h; sourceTree = ""; }; DF573C000F5A81EA00961A72 /* seg_manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seg_manager.h; sourceTree = ""; }; @@ -3542,19 +3979,11 @@ DF6118450FE3A8250042AD3F /* resource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resource.cpp; sourceTree = ""; }; DF6118460FE3A8250042AD3F /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; DF6118540FE3A8990042AD3F /* disk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disk.cpp; sourceTree = ""; }; - DF6118590FE3A9020042AD3F /* helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = helper.h; sourceTree = ""; }; - DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dxa_decoder.cpp; sourceTree = ""; }; - DF6118610FE3A9410042AD3F /* dxa_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dxa_decoder.h; sourceTree = ""; }; - DF6118620FE3A9410042AD3F /* flic_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flic_decoder.cpp; sourceTree = ""; }; - DF6118630FE3A9410042AD3F /* flic_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flic_decoder.h; sourceTree = ""; }; - DF6118640FE3A9410042AD3F /* smk_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smk_decoder.cpp; sourceTree = ""; }; - DF6118650FE3A9410042AD3F /* smk_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smk_decoder.h; sourceTree = ""; }; DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter.cpp; sourceTree = ""; }; DF61187A0FE3A9AA0042AD3F /* saveconverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saveconverter.h; sourceTree = ""; }; DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v2.cpp; sourceTree = ""; }; DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v3.cpp; sourceTree = ""; }; DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v4.cpp; sourceTree = ""; }; - DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveconverter_v6.cpp; sourceTree = ""; }; DF61187F0FE3A9AA0042AD3F /* savefile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savefile.cpp; sourceTree = ""; }; DF6118800FE3A9AA0042AD3F /* savefile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = savefile.h; sourceTree = ""; }; DF6118810FE3A9AA0042AD3F /* savehandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savehandler.cpp; sourceTree = ""; }; @@ -3573,8 +4002,6 @@ DF6118B70FE3AA280042AD3F /* text_lol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = text_lol.h; sourceTree = ""; }; DF6118C60FE3AABD0042AD3F /* player_v2cms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_v2cms.cpp; sourceTree = ""; }; DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hardwarekeys.cpp; sourceTree = ""; }; - DF6118CF0FE3AB560042AD3F /* mame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mame.cpp; sourceTree = ""; }; - DF6118D00FE3AB560042AD3F /* mame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mame.h; sourceTree = ""; }; DF6BF4C010529DA50069811F /* conversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conversion.cpp; sourceTree = ""; }; DF6BF4C110529DA50069811F /* conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conversion.h; sourceTree = ""; }; DF6BF4C210529DA50069811F /* jpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jpeg.cpp; sourceTree = ""; }; @@ -3593,10 +4020,6 @@ DF6BF4F910529F140069811F /* EventRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventRecorder.h; sourceTree = ""; }; DF6BF4FA10529F140069811F /* list_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = list_intern.h; sourceTree = ""; }; DF6BF4FB10529F140069811F /* serializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = serializer.h; sourceTree = ""; }; - DF6BF50210529F540069811F /* maxtrax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maxtrax.cpp; sourceTree = ""; }; - DF6BF50310529F540069811F /* maxtrax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maxtrax.h; sourceTree = ""; }; - DF6BF50410529F540069811F /* tfmx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tfmx.cpp; sourceTree = ""; }; - DF6BF50510529F540069811F /* tfmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tfmx.h; sourceTree = ""; }; DF7585C3100CB66E00CC3324 /* expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expression.cpp; sourceTree = ""; }; DF7585C4100CB66E00CC3324 /* expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expression.h; sourceTree = ""; }; DF7585C5100CB66E00CC3324 /* hotspots.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hotspots.cpp; sourceTree = ""; }; @@ -3657,8 +4080,6 @@ DF7F288911FF244F00159131 /* Tooltip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tooltip.cpp; sourceTree = ""; }; DF7F288A11FF244F00159131 /* Tooltip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tooltip.h; sourceTree = ""; }; DF7F289111FF247300159131 /* translation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = translation.cpp; sourceTree = ""; }; - DF7F289E11FF24B000159131 /* mac_snd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mac_snd.cpp; sourceTree = ""; }; - DF7F289F11FF24B000159131 /* mac_snd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mac_snd.h; sourceTree = ""; }; DF7F28A311FF24C400159131 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; DF7F28A411FF24C400159131 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; DF841FD90E7BA61800F5680E /* iphone_keyboard.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = iphone_keyboard.m; sourceTree = ""; }; @@ -4701,54 +5122,21 @@ DF842A4C0E7BBBEB00F5680E /* posix-fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "posix-fs.h"; sourceTree = ""; }; DF842A6B0E7BBD5700F5680E /* stdiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdiostream.cpp; sourceTree = ""; }; DF842A6C0E7BBD5700F5680E /* stdiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdiostream.h; sourceTree = ""; }; - DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = musicplugin.cpp; sourceTree = ""; }; - DF842A700E7BBDB200F5680E /* musicplugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = musicplugin.h; sourceTree = ""; }; - DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coktel_decoder.cpp; sourceTree = ""; }; - DF895BFD124C24350077F6E8 /* coktel_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coktel_decoder.h; sourceTree = ""; }; DF895C01124C24680077F6E8 /* player_towns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = player_towns.cpp; sourceTree = ""; }; DF895C02124C24680077F6E8 /* player_towns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = player_towns.h; sourceTree = ""; }; - DF895C08124C24B50077F6E8 /* appleiigs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = appleiigs.cpp; sourceTree = ""; }; - DF895C0D124C24C00077F6E8 /* towns_audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_audio.cpp; sourceTree = ""; }; - DF895C0E124C24C00077F6E8 /* towns_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_audio.h; sourceTree = ""; }; - DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_euphony.cpp; sourceTree = ""; }; - DF895C10124C24C00077F6E8 /* towns_euphony.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_euphony.h; sourceTree = ""; }; - DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_pc98_driver.cpp; sourceTree = ""; }; - DF895C12124C24C00077F6E8 /* towns_pc98_driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_pc98_driver.h; sourceTree = ""; }; - DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = towns_pc98_fmsynth.cpp; sourceTree = ""; }; - DF895C14124C24C00077F6E8 /* towns_pc98_fmsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = towns_pc98_fmsynth.h; sourceTree = ""; }; DF895C23124C25150077F6E8 /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = ""; }; DF895C24124C25150077F6E8 /* init_fascin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init_fascin.cpp; sourceTree = ""; }; DF895C28124C25350077F6E8 /* kernel_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_tables.h; sourceTree = ""; }; DF895C29124C25350077F6E8 /* script_patches.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script_patches.cpp; sourceTree = ""; }; DF895C33124C26660077F6E8 /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = ""; }; DF895C40124C271F0077F6E8 /* icon4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon4.png; sourceTree = ""; }; - DF895CAB124E58980077F6E8 /* indeo3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = indeo3.cpp; sourceTree = ""; }; - DF895CAC124E58980077F6E8 /* indeo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = indeo3.h; sourceTree = ""; }; - DF895CAD124E58980077F6E8 /* mjpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mjpeg.cpp; sourceTree = ""; }; - DF895CAE124E58980077F6E8 /* mjpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mjpeg.h; sourceTree = ""; }; - DF895CAF124E58980077F6E8 /* qdm2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qdm2.cpp; sourceTree = ""; }; - DF895CB0124E58980077F6E8 /* qdm2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qdm2.h; sourceTree = ""; }; - DF895CB1124E58980077F6E8 /* qdm2data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qdm2data.h; sourceTree = ""; }; - DF895CB2124E58980077F6E8 /* qtrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qtrle.cpp; sourceTree = ""; }; - DF895CB3124E58980077F6E8 /* qtrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qtrle.h; sourceTree = ""; }; - DF895CB4124E58980077F6E8 /* rpza.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rpza.cpp; sourceTree = ""; }; - DF895CB5124E58980077F6E8 /* rpza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpza.h; sourceTree = ""; }; - DF895CB6124E58980077F6E8 /* smc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smc.cpp; sourceTree = ""; }; - DF895CB7124E58980077F6E8 /* smc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smc.h; sourceTree = ""; }; DF89C2870F62D55C00D756B6 /* sprites_lol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sprites_lol.cpp; sourceTree = ""; }; DF89C2A30F62D79E00D756B6 /* script.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script.cpp; sourceTree = ""; }; - DF89C2B80F62D91000D756B6 /* timestamp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timestamp.cpp; sourceTree = ""; }; - DF89C2B90F62D91000D756B6 /* timestamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timestamp.h; sourceTree = ""; }; DF90E9B410AEDA5300C8F93F /* detection_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detection_tables.h; sourceTree = ""; }; DF90E9BD10AEDA9B00C8F93F /* selector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = selector.cpp; sourceTree = ""; }; DF90EAA310B0234300C8F93F /* draw_playtoons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = draw_playtoons.cpp; sourceTree = ""; }; DF90EAAB10B0236F00C8F93F /* staticres.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = staticres.cpp; sourceTree = ""; }; DF90EAAC10B0236F00C8F93F /* staticres.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = staticres.h; sourceTree = ""; }; - DF90EAB610B023D100C8F93F /* avi_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = avi_decoder.cpp; sourceTree = ""; }; - DF90EAB710B023D100C8F93F /* avi_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = avi_decoder.h; sourceTree = ""; }; - DF90EAC010B023F400C8F93F /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = ""; }; - DF90EAC110B023F400C8F93F /* msvideo1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msvideo1.cpp; sourceTree = ""; }; - DF90EAC210B023F400C8F93F /* msvideo1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msvideo1.h; sourceTree = ""; }; DF9B9246118E46730069C19D /* error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error.cpp; sourceTree = ""; }; DF9B9247118E46730069C19D /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = ""; }; DF9B924F118E46A00069C19D /* fontsjis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fontsjis.cpp; sourceTree = ""; }; @@ -4761,10 +5149,10 @@ DFAAB0010F011392003E9390 /* thumbnail_intern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = thumbnail_intern.cpp; sourceTree = ""; }; DFAAD2390F50120E00C3A4E2 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; DFAAD23A0F50120E00C3A4E2 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; - DFB0576411B753AF0015AE65 /* qt_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qt_decoder.cpp; sourceTree = ""; }; - DFB0576511B753AF0015AE65 /* qt_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qt_decoder.h; sourceTree = ""; }; - DFB0576611B753AF0015AE65 /* video_decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = video_decoder.cpp; sourceTree = ""; }; - DFB0576711B753AF0015AE65 /* video_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = video_decoder.h; sourceTree = ""; }; + DFADEBB113820DF500C46364 /* maccursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = maccursor.cpp; sourceTree = ""; }; + DFADEBB213820DF500C46364 /* maccursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maccursor.h; sourceTree = ""; }; + DFADEBB613820E0C00C46364 /* posix-fs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "posix-fs.cpp"; sourceTree = ""; }; + DFADEC061382140300C46364 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; DFB0577311B753DA0015AE65 /* debug-channels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "debug-channels.h"; sourceTree = ""; }; DFB0577411B753DA0015AE65 /* rational.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rational.cpp; sourceTree = ""; }; DFB0577511B753DA0015AE65 /* rational.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rational.h; sourceTree = ""; }; @@ -4775,8 +5163,6 @@ DFB0578911B754570015AE65 /* maciconbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maciconbar.h; sourceTree = ""; }; DFB0578F11B7547D0015AE65 /* pict.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pict.cpp; sourceTree = ""; }; DFB0579011B7547D0015AE65 /* pict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pict.h; sourceTree = ""; }; - DFB0579611B7549C0015AE65 /* cinepak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cinepak.cpp; sourceTree = ""; }; - DFB0579711B7549C0015AE65 /* cinepak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cinepak.h; sourceTree = ""; }; DFC8301A0F48AF18005EF03C /* detection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detection.cpp; sourceTree = ""; }; DFC8301E0F48AF18005EF03C /* gc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gc.cpp; sourceTree = ""; }; DFC8301F0F48AF18005EF03C /* gc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gc.h; sourceTree = ""; }; @@ -4805,8 +5191,6 @@ DFCDC6D7116629CE00A7D2A0 /* kparse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kparse.cpp; sourceTree = ""; }; DFCDC6D8116629CE00A7D2A0 /* selector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = selector.h; sourceTree = ""; }; DFCDC6F611662AAB00A7D2A0 /* resource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resource.cpp; sourceTree = ""; }; - DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msrle.cpp; sourceTree = ""; }; - DFCDC6FD11662AD700A7D2A0 /* msrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msrle.h; sourceTree = ""; }; DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = saveload_fascin.cpp; sourceTree = ""; }; DFCDC70911662B6B00A7D2A0 /* macresman.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macresman.cpp; sourceTree = ""; }; DFCDC70A11662B6B00A7D2A0 /* macresman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macresman.h; sourceTree = ""; }; @@ -4820,8 +5204,6 @@ DFD518A10DF34B2500854012 /* scalebit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scalebit.h; sourceTree = ""; }; DFD518AA0DF34BA600854012 /* 2xsai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = 2xsai.cpp; sourceTree = ""; }; DFD518AB0DF34BA600854012 /* aspect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aspect.cpp; sourceTree = ""; }; - DFD518AD0DF34BA600854012 /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq2x.cpp; sourceTree = ""; }; - DFD518B10DF34BA600854012 /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq3x.cpp; sourceTree = ""; }; DFD518B50DF34BA600854012 /* scale2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scale2x.cpp; sourceTree = ""; }; DFD518B60DF34BA600854012 /* scale2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scale2x.h; sourceTree = ""; }; DFD518B80DF34BA600854012 /* scale3x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scale3x.cpp; sourceTree = ""; }; @@ -4911,7 +5293,6 @@ DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consolefont.cpp; sourceTree = ""; }; DFE4775E0D81F4E900B6D1FB /* newfont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = newfont.cpp; sourceTree = ""; }; DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = newfont_big.cpp; sourceTree = ""; }; - DFE477600D81F4E900B6D1FB /* scummfont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scummfont.cpp; sourceTree = ""; }; DFE477610D81F4E900B6D1FB /* iff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iff.cpp; sourceTree = ""; }; DFE477620D81F4E900B6D1FB /* iff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iff.h; sourceTree = ""; }; DFE477630D81F4E900B6D1FB /* imagedec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = imagedec.cpp; sourceTree = ""; }; @@ -4935,16 +5316,10 @@ DFE477950D81F4E900B6D1FB /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugger.h; sourceTree = ""; }; DFE477960D81F4E900B6D1FB /* dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialog.cpp; sourceTree = ""; }; DFE477970D81F4E900B6D1FB /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dialog.h; sourceTree = ""; }; - DFE477980D81F4E900B6D1FB /* editable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = editable.cpp; sourceTree = ""; }; - DFE477990D81F4E900B6D1FB /* editable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = editable.h; sourceTree = ""; }; - DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditTextWidget.cpp; sourceTree = ""; }; - DFE4779B0D81F4E900B6D1FB /* EditTextWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditTextWidget.h; sourceTree = ""; }; DFE4779E0D81F4E900B6D1FB /* Key.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Key.cpp; sourceTree = ""; }; DFE4779F0D81F4E900B6D1FB /* Key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Key.h; sourceTree = ""; }; DFE477A20D81F4E900B6D1FB /* launcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = launcher.cpp; sourceTree = ""; }; DFE477A30D81F4E900B6D1FB /* launcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = launcher.h; sourceTree = ""; }; - DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListWidget.cpp; sourceTree = ""; }; - DFE477A50D81F4E900B6D1FB /* ListWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListWidget.h; sourceTree = ""; }; DFE477A60D81F4E900B6D1FB /* massadd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = massadd.cpp; sourceTree = ""; }; DFE477A70D81F4E900B6D1FB /* massadd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = massadd.h; sourceTree = ""; }; DFE477A80D81F4E900B6D1FB /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = ""; }; @@ -4953,54 +5328,10 @@ DFE477AE0D81F4E900B6D1FB /* object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = object.h; sourceTree = ""; }; DFE477AF0D81F4E900B6D1FB /* options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = options.cpp; sourceTree = ""; }; DFE477B00D81F4E900B6D1FB /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = ""; }; - DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PopUpWidget.cpp; sourceTree = ""; }; - DFE477B20D81F4E900B6D1FB /* PopUpWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopUpWidget.h; sourceTree = ""; }; - DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollBarWidget.cpp; sourceTree = ""; }; - DFE477B40D81F4E900B6D1FB /* ScrollBarWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBarWidget.h; sourceTree = ""; }; - DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TabWidget.cpp; sourceTree = ""; }; - DFE477B60D81F4E900B6D1FB /* TabWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabWidget.h; sourceTree = ""; }; DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = themebrowser.cpp; sourceTree = ""; }; DFE477BB0D81F4E900B6D1FB /* themebrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = themebrowser.h; sourceTree = ""; }; DFE477C40D81F4E900B6D1FB /* widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cpp; sourceTree = ""; }; DFE477C50D81F4E900B6D1FB /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = ""; }; - DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audiocd.cpp; sourceTree = ""; }; - DFE477CC0D81F4E900B6D1FB /* audiocd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audiocd.h; sourceTree = ""; }; - DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audiostream.cpp; sourceTree = ""; }; - DFE477CE0D81F4E900B6D1FB /* audiostream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audiostream.h; sourceTree = ""; }; - DFE477D10D81F4E900B6D1FB /* fmopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fmopl.cpp; sourceTree = ""; }; - DFE477D20D81F4E900B6D1FB /* fmopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fmopl.h; sourceTree = ""; }; - DFE477D50D81F4E900B6D1FB /* mididrv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mididrv.cpp; sourceTree = ""; }; - DFE477D60D81F4E900B6D1FB /* mididrv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mididrv.h; sourceTree = ""; }; - DFE477D70D81F4E900B6D1FB /* midiparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser.cpp; sourceTree = ""; }; - DFE477D80D81F4E900B6D1FB /* midiparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = midiparser.h; sourceTree = ""; }; - DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser_smf.cpp; sourceTree = ""; }; - DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = midiparser_xmidi.cpp; sourceTree = ""; }; - DFE477DB0D81F4E900B6D1FB /* mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mixer.cpp; sourceTree = ""; }; - DFE477DC0D81F4E900B6D1FB /* mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mixer.h; sourceTree = ""; }; - DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infogrames.cpp; sourceTree = ""; }; - DFE477DF0D81F4E900B6D1FB /* infogrames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infogrames.h; sourceTree = ""; }; - DFE477E00D81F4E900B6D1FB /* module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = module.cpp; sourceTree = ""; }; - DFE477E10D81F4E900B6D1FB /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = module.h; sourceTree = ""; }; - DFE477E20D81F4E900B6D1FB /* paula.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = paula.cpp; sourceTree = ""; }; - DFE477E30D81F4E900B6D1FB /* paula.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paula.h; sourceTree = ""; }; - DFE477E40D81F4E900B6D1FB /* protracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = protracker.cpp; sourceTree = ""; }; - DFE477E50D81F4E900B6D1FB /* protracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = protracker.h; sourceTree = ""; }; - DFE477E60D81F4E900B6D1FB /* rjp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rjp1.cpp; sourceTree = ""; }; - DFE477E70D81F4E900B6D1FB /* rjp1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rjp1.h; sourceTree = ""; }; - DFE477E80D81F4E900B6D1FB /* soundfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = soundfx.cpp; sourceTree = ""; }; - DFE477E90D81F4E900B6D1FB /* soundfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundfx.h; sourceTree = ""; }; - DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mpu401.cpp; sourceTree = ""; }; - DFE477EE0D81F4E900B6D1FB /* mpu401.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpu401.h; sourceTree = ""; }; - DFE477EF0D81F4E900B6D1FB /* null.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = null.cpp; sourceTree = ""; }; - DFE477F00D81F4E900B6D1FB /* rate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rate.cpp; sourceTree = ""; }; - DFE477F10D81F4E900B6D1FB /* rate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rate.h; sourceTree = ""; }; - DFE477F70D81F4E900B6D1FB /* adlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adlib.cpp; sourceTree = ""; }; - DFE477F80D81F4E900B6D1FB /* emumidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = emumidi.h; sourceTree = ""; }; - DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fluidsynth.cpp; sourceTree = ""; }; - DFE478210D81F4E900B6D1FB /* pcspk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcspk.cpp; sourceTree = ""; }; - DFE478220D81F4E900B6D1FB /* pcspk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pcspk.h; sourceTree = ""; }; - DFE478230D81F4E900B6D1FB /* ym2612.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ym2612.cpp; sourceTree = ""; }; - DFE478240D81F4E900B6D1FB /* ym2612.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ym2612.h; sourceTree = ""; }; DFE47C810D81F86900B6D1FB /* kyra.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = kyra.dat; sourceTree = ""; }; DFE47C820D81F86900B6D1FB /* lure.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = lure.dat; sourceTree = ""; }; DFE47C830D81F86900B6D1FB /* queen.tbl */ = {isa = PBXFileReference; lastKnownFileType = file; path = queen.tbl; sourceTree = ""; }; @@ -5015,12 +5346,82 @@ DFEC5D0F1166C5CF00C90552 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; DFEC5D341166C67300C90552 /* savestate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savestate.cpp; sourceTree = ""; }; DFEC5D351166C67300C90552 /* savestate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = savestate.h; sourceTree = ""; }; - DFEC5D3D1166C6B400C90552 /* dbopl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dbopl.cpp; sourceTree = ""; }; - DFEC5D3E1166C6B400C90552 /* dbopl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dbopl.h; sourceTree = ""; }; DFF4DFFC0F4B449F00C50BC7 /* Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist.in; sourceTree = ""; }; - DFF958A90FB222F300A3EC78 /* dosbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dosbox.cpp; sourceTree = ""; }; - DFF958AA0FB222F300A3EC78 /* dosbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dosbox.h; sourceTree = ""; }; DFF95CCA0FB22D5700A3EC78 /* ScummVM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScummVM.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F92B4DCB139DD428000D1BF1 /* memstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memstream.h; sourceTree = ""; }; + F92B4DCC139DD428000D1BF1 /* quicktime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = quicktime.cpp; sourceTree = ""; }; + F92B4DCD139DD428000D1BF1 /* quicktime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quicktime.h; sourceTree = ""; }; + F92B4DD1139DD449000D1BF1 /* yuv_to_rgb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = yuv_to_rgb.cpp; sourceTree = ""; }; + F92B4DD2139DD449000D1BF1 /* yuv_to_rgb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_to_rgb.h; sourceTree = ""; }; + F92B4DD6139DDC7A000D1BF1 /* sdl-sys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sdl-sys.h"; sourceTree = ""; }; + F92B4DD7139DDC92000D1BF1 /* macosx-main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "macosx-main.cpp"; path = "sdl/macosx/macosx-main.cpp"; sourceTree = ""; }; + F92B4DD8139DDC92000D1BF1 /* macosx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macosx.cpp; path = sdl/macosx/macosx.cpp; sourceTree = ""; }; + F92B4DD9139DDC92000D1BF1 /* macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macosx.h; path = sdl/macosx/macosx.h; sourceTree = ""; }; + F9946D7A139E1A260072D195 /* cdtoons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cdtoons.cpp; sourceTree = ""; }; + F9946D7B139E1A260072D195 /* cdtoons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cdtoons.h; sourceTree = ""; }; + F9946D7C139E1A260072D195 /* cinepak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cinepak.cpp; sourceTree = ""; }; + F9946D7D139E1A260072D195 /* cinepak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cinepak.h; sourceTree = ""; }; + F9946D7E139E1A260072D195 /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = ""; }; + F9946D7F139E1A260072D195 /* indeo3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = indeo3.cpp; sourceTree = ""; }; + F9946D80139E1A260072D195 /* indeo3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = indeo3.h; sourceTree = ""; }; + F9946D81139E1A260072D195 /* mjpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mjpeg.cpp; sourceTree = ""; }; + F9946D82139E1A260072D195 /* mjpeg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mjpeg.h; sourceTree = ""; }; + F9946D83139E1A260072D195 /* msrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msrle.cpp; sourceTree = ""; }; + F9946D84139E1A260072D195 /* msrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msrle.h; sourceTree = ""; }; + F9946D85139E1A260072D195 /* msvideo1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msvideo1.cpp; sourceTree = ""; }; + F9946D86139E1A260072D195 /* msvideo1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msvideo1.h; sourceTree = ""; }; + F9946D87139E1A260072D195 /* qtrle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qtrle.cpp; sourceTree = ""; }; + F9946D88139E1A260072D195 /* qtrle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qtrle.h; sourceTree = ""; }; + F9946D89139E1A260072D195 /* rpza.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rpza.cpp; sourceTree = ""; }; + F9946D8A139E1A260072D195 /* rpza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpza.h; sourceTree = ""; }; + F9946D8B139E1A260072D195 /* smc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smc.cpp; sourceTree = ""; }; + F9946D8C139E1A260072D195 /* smc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smc.h; sourceTree = ""; }; + F9946D8D139E1A260072D195 /* truemotion1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = truemotion1.cpp; sourceTree = ""; }; + F9946D8E139E1A260072D195 /* truemotion1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = truemotion1.h; sourceTree = ""; }; + F9946D8F139E1A260072D195 /* truemotion1data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = truemotion1data.h; sourceTree = ""; }; + F9946D9A139E1A560072D195 /* towns_midi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_midi.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_midi.cpp; sourceTree = ""; }; + F9946D9B139E1A560072D195 /* towns_midi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = towns_midi.h; path = ../../audio/softsynth/fmtowns_pc98/towns_midi.h; sourceTree = ""; }; + F9946D9C139E1A560072D195 /* towns_pc98_plugins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towns_pc98_plugins.cpp; path = ../../audio/softsynth/fmtowns_pc98/towns_pc98_plugins.cpp; sourceTree = ""; }; + F9946DA3139E1A880072D195 /* freeverb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = freeverb.cpp; path = ../../audio/softsynth/mt32/freeverb.cpp; sourceTree = ""; }; + F9946DA4139E1A880072D195 /* freeverb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = freeverb.h; path = ../../audio/softsynth/mt32/freeverb.h; sourceTree = ""; }; + F9946DA5139E1A880072D195 /* i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = i386.cpp; path = ../../audio/softsynth/mt32/i386.cpp; sourceTree = ""; }; + F9946DA6139E1A880072D195 /* i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = i386.h; path = ../../audio/softsynth/mt32/i386.h; sourceTree = ""; }; + F9946DA7139E1A880072D195 /* mt32_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mt32_file.cpp; path = ../../audio/softsynth/mt32/mt32_file.cpp; sourceTree = ""; }; + F9946DA8139E1A880072D195 /* mt32_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mt32_file.h; path = ../../audio/softsynth/mt32/mt32_file.h; sourceTree = ""; }; + F9946DA9139E1A880072D195 /* mt32emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mt32emu.h; path = ../../audio/softsynth/mt32/mt32emu.h; sourceTree = ""; }; + F9946DAA139E1A880072D195 /* part.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = part.cpp; path = ../../audio/softsynth/mt32/part.cpp; sourceTree = ""; }; + F9946DAB139E1A880072D195 /* part.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = part.h; path = ../../audio/softsynth/mt32/part.h; sourceTree = ""; }; + F9946DAC139E1A880072D195 /* partial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = partial.cpp; path = ../../audio/softsynth/mt32/partial.cpp; sourceTree = ""; }; + F9946DAD139E1A880072D195 /* partial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = partial.h; path = ../../audio/softsynth/mt32/partial.h; sourceTree = ""; }; + F9946DAE139E1A880072D195 /* partialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = partialManager.cpp; path = ../../audio/softsynth/mt32/partialManager.cpp; sourceTree = ""; }; + F9946DAF139E1A880072D195 /* partialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = partialManager.h; path = ../../audio/softsynth/mt32/partialManager.h; sourceTree = ""; }; + F9946DB0139E1A880072D195 /* structures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = structures.h; path = ../../audio/softsynth/mt32/structures.h; sourceTree = ""; }; + F9946DB1139E1A880072D195 /* synth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = synth.cpp; path = ../../audio/softsynth/mt32/synth.cpp; sourceTree = ""; }; + F9946DB2139E1A880072D195 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = synth.h; path = ../../audio/softsynth/mt32/synth.h; sourceTree = ""; }; + F9946DB3139E1A880072D195 /* tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tables.cpp; path = ../../audio/softsynth/mt32/tables.cpp; sourceTree = ""; }; + F9946DB4139E1A880072D195 /* tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tables.h; path = ../../audio/softsynth/mt32/tables.h; sourceTree = ""; }; + F9946DCE139E1AD30072D195 /* aac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = aac.cpp; path = ../../audio/decoders/aac.cpp; sourceTree = ""; }; + F9946DCF139E1AD30072D195 /* aac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = aac.h; path = ../../audio/decoders/aac.h; sourceTree = ""; }; + F9946DD0139E1AD30072D195 /* qdm2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qdm2.cpp; path = ../../audio/decoders/qdm2.cpp; sourceTree = ""; }; + F9946DD1139E1AD30072D195 /* qdm2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qdm2.h; path = ../../audio/decoders/qdm2.h; sourceTree = ""; }; + F9946DD2139E1AD30072D195 /* qdm2data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qdm2data.h; path = ../../audio/decoders/qdm2data.h; sourceTree = ""; }; + F9946DD3139E1AD30072D195 /* quicktime_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = quicktime_intern.h; path = ../../audio/decoders/quicktime_intern.h; sourceTree = ""; }; + F9946DD4139E1AD30072D195 /* quicktime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quicktime.cpp; path = ../../audio/decoders/quicktime.cpp; sourceTree = ""; }; + F9946DD5139E1AD30072D195 /* quicktime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = quicktime.h; path = ../../audio/decoders/quicktime.h; sourceTree = ""; }; + F9946DE0139E1B180072D195 /* posix-main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "posix-main.cpp"; sourceTree = ""; }; + F9946DE1139E1B180072D195 /* posix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = posix.cpp; sourceTree = ""; }; + F9946DE2139E1B180072D195 /* posix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = posix.h; sourceTree = ""; }; + F9946DE9139E1B6F0072D195 /* aspect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aspect.h; sourceTree = ""; }; + F9946DEA139E1B6F0072D195 /* downscaler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = downscaler.cpp; sourceTree = ""; }; + F9946DEB139E1B6F0072D195 /* downscaler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = downscaler.h; sourceTree = ""; }; + F9946DEF139E1BA00072D195 /* console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = console.cpp; sourceTree = ""; }; + F9946DF0139E1BA00072D195 /* console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = console.h; sourceTree = ""; }; + F9946DF5139E1BBF0072D195 /* sdl-mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "sdl-mixer.cpp"; sourceTree = ""; }; + F9946DF6139E1BBF0072D195 /* sdl-mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sdl-mixer.h"; sourceTree = ""; }; + F9946DFC139E1BEB0072D195 /* doublebuffersdl-mixer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "doublebuffersdl-mixer.cpp"; sourceTree = ""; }; + F9946DFD139E1BEB0072D195 /* doublebuffersdl-mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "doublebuffersdl-mixer.h"; sourceTree = ""; }; + F9946E02139E1C390072D195 /* sdl-graphics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "sdl-graphics.cpp"; sourceTree = ""; }; + F9946E03139E1C390072D195 /* sdl-graphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sdl-graphics.h"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -5038,6 +5439,7 @@ DFF959060FB22D3100A3EC78 /* libFLAC.a in Frameworks */, DFF959080FB22D3300A3EC78 /* libvorbisidec.a in Frameworks */, DF224E040FB23BC500C8E453 /* OpenGLES.framework in Frameworks */, + DFADEC071382140300C46364 /* libz.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5094,6 +5496,7 @@ DF842A170E7BB34E00F5680E /* CoreFoundation.framework */, DF842A180E7BB34E00F5680E /* Foundation.framework */, DF842A190E7BB34E00F5680E /* UIKit.framework */, + DFADEC061382140300C46364 /* libz.dylib */, ); name = "Linked Frameworks"; sourceTree = ""; @@ -5118,6 +5521,8 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + DF2040461380C9ED0056300A /* audio */, + DF203F521380C2470056300A /* video */, DF9B9277118E475D0069C19D /* games */, DFD6476A0F49F7D2008E18EF /* libs */, DF841FF50E7BA6A600F5680E /* engines */, @@ -5126,7 +5531,6 @@ DFE473950D81F4E800B6D1FB /* common */, DFE477520D81F4E900B6D1FB /* graphics */, DFE477880D81F4E900B6D1FB /* gui */, - DFE477C60D81F4E900B6D1FB /* sound */, 29B97317FDCFA39411CA2CEA /* Resources */, DFA2A57A118E433A00344DFD /* Resources-iPad */, 29B97323FDCFA39411CA2CEA /* Frameworks */, @@ -5179,15 +5583,33 @@ 8CD1ECC5126202AA00FA198C /* hugo */ = { isa = PBXGroup; children = ( + DF203FC01380C3BC0056300A /* console.cpp */, + DF203FC11380C3BC0056300A /* console.h */, + DF203FC21380C3BC0056300A /* dialogs.cpp */, + DF203FC31380C3BC0056300A /* dialogs.h */, + DF203FC41380C3BC0056300A /* file_v1d.cpp */, + DF203FC51380C3BC0056300A /* file_v1w.cpp */, + DF203FC61380C3BC0056300A /* file_v2d.cpp */, + DF203FC71380C3BC0056300A /* file_v2w.cpp */, + DF203FC81380C3BC0056300A /* file_v3d.cpp */, + DF203FC91380C3BC0056300A /* object_v1d.cpp */, + DF203FCA1380C3BC0056300A /* object_v1w.cpp */, + DF203FCB1380C3BC0056300A /* object_v2d.cpp */, + DF203FCC1380C3BC0056300A /* object_v3d.cpp */, + DF203FCD1380C3BC0056300A /* object.cpp */, + DF203FCE1380C3BC0056300A /* object.h */, + DF203FCF1380C3BC0056300A /* parser_v1d.cpp */, + DF203FD01380C3BC0056300A /* parser_v1w.cpp */, + DF203FD11380C3BC0056300A /* parser_v2d.cpp */, + DF203FD21380C3BC0056300A /* parser_v3d.cpp */, + DF203FD31380C3BC0056300A /* text.cpp */, + DF203FD41380C3BC0056300A /* text.h */, 8CD1ECC6126202AA00FA198C /* detection.cpp */, 8CD1ECC7126202AA00FA198C /* display.cpp */, 8CD1ECC8126202AA00FA198C /* display.h */, - 8CD1ECC9126202AA00FA198C /* engine.cpp */, - 8CD1ECCA126202AA00FA198C /* engine.h */, 8CD1ECCB126202AA00FA198C /* file.cpp */, 8CD1ECCC126202AA00FA198C /* file.h */, 8CD1ECCD126202AA00FA198C /* game.h */, - 8CD1ECCE126202AA00FA198C /* global.h */, 8CD1ECCF126202AA00FA198C /* hugo.cpp */, 8CD1ECD0126202AA00FA198C /* hugo.h */, 8CD1ECD1126202AA00FA198C /* intro.cpp */, @@ -5213,6 +5635,8 @@ 8CD1ECE3126202AA00FA198C /* toon */ = { isa = PBXGroup; children = ( + F9946DEF139E1BA00072D195 /* console.cpp */, + F9946DF0139E1BA00072D195 /* console.h */, 8CD1ECE4126202AA00FA198C /* anim.cpp */, 8CD1ECE5126202AA00FA198C /* anim.h */, 8CD1ECE6126202AA00FA198C /* audio.cpp */, @@ -5296,9 +5720,9 @@ DF09422F0F63CB9A002D821E /* sdl */ = { isa = PBXGroup; children = ( + F9946DDF139E1B180072D195 /* posix */, + F92B4DD6139DDC7A000D1BF1 /* sdl-sys.h */, DF6118CB0FE3AAFD0042AD3F /* hardwarekeys.cpp */, - DF0942350F63CB9A002D821E /* events.cpp */, - DF0942370F63CB9A002D821E /* graphics.cpp */, DF0942390F63CB9A002D821E /* main.cpp */, DF09423C0F63CB9A002D821E /* sdl.cpp */, DF09423D0F63CB9A002D821E /* sdl.h */, @@ -5319,26 +5743,194 @@ path = demos; sourceTree = ""; }; - DF2FFB940F485D950006E566 /* video */ = { + DF203F521380C2470056300A /* video */ = { isa = PBXGroup; children = ( - DF90EAB610B023D100C8F93F /* avi_decoder.cpp */, - DF90EAB710B023D100C8F93F /* avi_decoder.h */, - DF90EABF10B023F300C8F93F /* codecs */, - DF895BFC124C24350077F6E8 /* coktel_decoder.cpp */, - DF895BFD124C24350077F6E8 /* coktel_decoder.h */, - DF6118600FE3A9410042AD3F /* dxa_decoder.cpp */, - DF6118610FE3A9410042AD3F /* dxa_decoder.h */, - DF6118620FE3A9410042AD3F /* flic_decoder.cpp */, - DF6118630FE3A9410042AD3F /* flic_decoder.h */, - DFB0576411B753AF0015AE65 /* qt_decoder.cpp */, - DFB0576511B753AF0015AE65 /* qt_decoder.h */, - DF6118640FE3A9410042AD3F /* smk_decoder.cpp */, - DF6118650FE3A9410042AD3F /* smk_decoder.h */, - DFB0576611B753AF0015AE65 /* video_decoder.cpp */, - DFB0576711B753AF0015AE65 /* video_decoder.h */, + DF203F7B1380C27A0056300A /* codecs */, + DF203F531380C2740056300A /* avi_decoder.cpp */, + DF203F541380C2740056300A /* avi_decoder.h */, + DF203F551380C2740056300A /* coktel_decoder.cpp */, + DF203F561380C2740056300A /* coktel_decoder.h */, + DF203F571380C2740056300A /* dxa_decoder.cpp */, + DF203F581380C2740056300A /* dxa_decoder.h */, + DF203F591380C2740056300A /* flic_decoder.cpp */, + DF203F5A1380C2740056300A /* flic_decoder.h */, + DF203F5D1380C2740056300A /* qt_decoder.cpp */, + DF203F5E1380C2750056300A /* qt_decoder.h */, + DF203F5F1380C2750056300A /* smk_decoder.cpp */, + DF203F601380C2750056300A /* smk_decoder.h */, + DF203F611380C2750056300A /* video_decoder.cpp */, + DF203F621380C2750056300A /* video_decoder.h */, ); - path = video; + name = video; + sourceTree = ""; + }; + DF203F7B1380C27A0056300A /* codecs */ = { + isa = PBXGroup; + children = ( + DF203F7C1380C2920056300A /* cdtoons.cpp */, + DF203F7D1380C2920056300A /* cdtoons.h */, + DF203F7E1380C2920056300A /* cinepak.cpp */, + DF203F7F1380C2920056300A /* cinepak.h */, + DF203F801380C2920056300A /* codec.h */, + DF203F811380C2920056300A /* indeo3.cpp */, + DF203F821380C2920056300A /* indeo3.h */, + DF203F831380C2920056300A /* mjpeg.cpp */, + DF203F841380C2920056300A /* mjpeg.h */, + DF203F851380C2920056300A /* msrle.cpp */, + DF203F861380C2920056300A /* msrle.h */, + DF203F871380C2920056300A /* msvideo1.cpp */, + DF203F881380C2920056300A /* msvideo1.h */, + DF203F8C1380C2920056300A /* qtrle.cpp */, + DF203F8D1380C2920056300A /* qtrle.h */, + DF203F8E1380C2920056300A /* rpza.cpp */, + DF203F8F1380C2920056300A /* rpza.h */, + DF203F901380C2920056300A /* smc.cpp */, + DF203F911380C2920056300A /* smc.h */, + DF203F921380C2920056300A /* truemotion1.cpp */, + DF203F931380C2920056300A /* truemotion1.h */, + DF203F941380C2920056300A /* truemotion1data.h */, + ); + name = codecs; + sourceTree = ""; + }; + DF2040211380C8A60056300A /* widgets */ = { + isa = PBXGroup; + children = ( + DF2040221380C8B70056300A /* editable.cpp */, + DF2040231380C8B70056300A /* editable.h */, + DF2040241380C8B70056300A /* edittext.cpp */, + DF2040251380C8B70056300A /* edittext.h */, + DF2040261380C8B70056300A /* list.cpp */, + DF2040271380C8B70056300A /* list.h */, + DF2040281380C8B70056300A /* popup.cpp */, + DF2040291380C8B70056300A /* popup.h */, + DF20402A1380C8B70056300A /* scrollbar.cpp */, + DF20402B1380C8B70056300A /* scrollbar.h */, + DF20402C1380C8B70056300A /* tab.cpp */, + DF20402D1380C8B70056300A /* tab.h */, + ); + name = widgets; + sourceTree = ""; + }; + DF2040461380C9ED0056300A /* audio */ = { + isa = PBXGroup; + children = ( + F9946D79139E1A260072D195 /* codecs */, + DF46B8991381F6C400D08723 /* null.cpp */, + DF46B89A1381F6C400D08723 /* null.h */, + DF2040E41380CA8C0056300A /* softsynth */, + DF2040BB1380CA5C0056300A /* mods */, + DF2040821380CA280056300A /* decoders */, + DF2040471380CA230056300A /* audiostream.cpp */, + DF2040481380CA230056300A /* audiostream.h */, + DF2040491380CA230056300A /* fmopl.cpp */, + DF20404A1380CA230056300A /* fmopl.h */, + DF20404B1380CA230056300A /* mididrv.cpp */, + DF20404C1380CA230056300A /* mididrv.h */, + DF20404D1380CA230056300A /* midiparser_smf.cpp */, + DF20404E1380CA230056300A /* midiparser_xmidi.cpp */, + DF20404F1380CA230056300A /* midiparser.cpp */, + DF2040501380CA230056300A /* midiparser.h */, + DF2040511380CA230056300A /* midiplayer.cpp */, + DF2040521380CA230056300A /* midiplayer.h */, + DF2040531380CA230056300A /* mixer_intern.h */, + DF2040541380CA230056300A /* mixer.cpp */, + DF2040551380CA230056300A /* mixer.h */, + DF2040561380CA230056300A /* mpu401.cpp */, + DF2040571380CA230056300A /* mpu401.h */, + DF2040581380CA230056300A /* musicplugin.cpp */, + DF2040591380CA230056300A /* musicplugin.h */, + DF20405A1380CA230056300A /* rate.cpp */, + DF20405B1380CA230056300A /* rate.h */, + DF20405C1380CA230056300A /* timestamp.cpp */, + DF20405D1380CA230056300A /* timestamp.h */, + ); + name = audio; + sourceTree = ""; + }; + DF2040821380CA280056300A /* decoders */ = { + isa = PBXGroup; + children = ( + F9946DCE139E1AD30072D195 /* aac.cpp */, + F9946DCF139E1AD30072D195 /* aac.h */, + F9946DD0139E1AD30072D195 /* qdm2.cpp */, + F9946DD1139E1AD30072D195 /* qdm2.h */, + F9946DD2139E1AD30072D195 /* qdm2data.h */, + F9946DD3139E1AD30072D195 /* quicktime_intern.h */, + F9946DD4139E1AD30072D195 /* quicktime.cpp */, + F9946DD5139E1AD30072D195 /* quicktime.h */, + DF2040831380CA400056300A /* adpcm_intern.h */, + DF2040841380CA400056300A /* adpcm.cpp */, + DF2040851380CA400056300A /* adpcm.h */, + DF2040861380CA400056300A /* aiff.cpp */, + DF2040871380CA400056300A /* aiff.h */, + DF2040881380CA400056300A /* flac.cpp */, + DF2040891380CA400056300A /* flac.h */, + DF20408A1380CA400056300A /* iff_sound.cpp */, + DF20408B1380CA400056300A /* iff_sound.h */, + DF20408C1380CA400056300A /* mac_snd.cpp */, + DF20408D1380CA400056300A /* mac_snd.h */, + DF20408E1380CA400056300A /* mp3.cpp */, + DF20408F1380CA400056300A /* mp3.h */, + DF2040901380CA400056300A /* raw.cpp */, + DF2040911380CA400056300A /* raw.h */, + DF2040921380CA400056300A /* vag.cpp */, + DF2040931380CA400056300A /* vag.h */, + DF2040941380CA400056300A /* voc.cpp */, + DF2040951380CA400056300A /* voc.h */, + DF2040961380CA400056300A /* vorbis.cpp */, + DF2040971380CA400056300A /* vorbis.h */, + DF2040981380CA400056300A /* wave.cpp */, + DF2040991380CA400056300A /* wave.h */, + ); + name = decoders; + sourceTree = ""; + }; + DF2040BB1380CA5C0056300A /* mods */ = { + isa = PBXGroup; + children = ( + DF2040BC1380CA810056300A /* infogrames.cpp */, + DF2040BD1380CA810056300A /* infogrames.h */, + DF2040BE1380CA810056300A /* maxtrax.cpp */, + DF2040BF1380CA810056300A /* maxtrax.h */, + DF2040C01380CA810056300A /* module.cpp */, + DF2040C11380CA810056300A /* module.h */, + DF2040C21380CA810056300A /* paula.cpp */, + DF2040C31380CA810056300A /* paula.h */, + DF2040C41380CA810056300A /* protracker.cpp */, + DF2040C51380CA810056300A /* protracker.h */, + DF2040C61380CA810056300A /* rjp1.cpp */, + DF2040C71380CA810056300A /* rjp1.h */, + DF2040C81380CA810056300A /* soundfx.cpp */, + DF2040C91380CA810056300A /* soundfx.h */, + DF2040CA1380CA810056300A /* tfmx.cpp */, + DF2040CB1380CA810056300A /* tfmx.h */, + ); + name = mods; + sourceTree = ""; + }; + DF2040E41380CA8C0056300A /* softsynth */ = { + isa = PBXGroup; + children = ( + F9946DCD139E1A9A0072D195 /* mt32 */, + DF46B8591381F43100D08723 /* opl */, + DF46B6F61381E1D100D08723 /* fmtowns_pc98 */, + DF2040E51380CAA40056300A /* adlib.cpp */, + DF2040E61380CAA40056300A /* appleiigs.cpp */, + DF2040E71380CAA40056300A /* cms.cpp */, + DF2040E81380CAA40056300A /* cms.h */, + DF2040E91380CAA40056300A /* eas.cpp */, + DF2040EA1380CAA40056300A /* emumidi.h */, + DF2040EB1380CAA40056300A /* fluidsynth.cpp */, + DF2040EC1380CAA40056300A /* mt32.cpp */, + DF2040ED1380CAA40056300A /* pcspk.cpp */, + DF2040EE1380CAA40056300A /* pcspk.h */, + DF2040EF1380CAA40056300A /* sid.cpp */, + DF2040F01380CAA40056300A /* sid.h */, + DF2040F11380CAA40056300A /* wave6581.cpp */, + ); + name = softsynth; sourceTree = ""; }; DF2FFBF50F4860A60006E566 /* posix */ = { @@ -5389,6 +5981,8 @@ DF2FFD040F4870E50006E566 /* tucker */ = { isa = PBXGroup; children = ( + DF46B7D41381E7C600D08723 /* console.cpp */, + DF46B7D51381E7C600D08723 /* console.h */, DF2FFD050F4870E50006E566 /* detection.cpp */, DF2FFD060F4870E50006E566 /* graphics.cpp */, DF2FFD070F4870E50006E566 /* graphics.h */, @@ -5403,35 +5997,6 @@ path = tucker; sourceTree = ""; }; - DF45B0EB116627D9009B85CC /* decoders */ = { - isa = PBXGroup; - children = ( - DF45B0F7116627DA009B85CC /* adpcm.cpp */, - DF45B0F8116627DA009B85CC /* adpcm.h */, - DF45B0FA116627DA009B85CC /* aiff.cpp */, - DF45B0FB116627DA009B85CC /* aiff.h */, - DF45B0FD116627DA009B85CC /* flac.cpp */, - DF45B0FE116627DA009B85CC /* flac.h */, - DF45B100116627DA009B85CC /* iff_sound.cpp */, - DF45B101116627DA009B85CC /* iff_sound.h */, - DF7F289E11FF24B000159131 /* mac_snd.cpp */, - DF7F289F11FF24B000159131 /* mac_snd.h */, - DF45B103116627DA009B85CC /* mp3.cpp */, - DF45B104116627DA009B85CC /* mp3.h */, - DF45B106116627DA009B85CC /* raw.cpp */, - DF45B107116627DA009B85CC /* raw.h */, - DF45B109116627DA009B85CC /* vag.cpp */, - DF45B10A116627DA009B85CC /* vag.h */, - DF45B10C116627DA009B85CC /* voc.cpp */, - DF45B10D116627DA009B85CC /* voc.h */, - DF45B10F116627DA009B85CC /* vorbis.cpp */, - DF45B110116627DA009B85CC /* vorbis.h */, - DF45B112116627DA009B85CC /* wave.cpp */, - DF45B113116627DA009B85CC /* wave.h */, - ); - path = decoders; - sourceTree = ""; - }; DF45B175116628A5009B85CC /* graphics */ = { isa = PBXGroup; children = ( @@ -5531,15 +6096,132 @@ DF45B1C5116628A5009B85CC /* video */ = { isa = PBXGroup; children = ( + DF46B7611381E4D400D08723 /* robot_decoder.cpp */, + DF46B7621381E4D400D08723 /* robot_decoder.h */, DF45B1C6116628A5009B85CC /* seq_decoder.cpp */, DF45B1C7116628A5009B85CC /* seq_decoder.h */, ); path = video; sourceTree = ""; }; + DF46B6F61381E1D100D08723 /* fmtowns_pc98 */ = { + isa = PBXGroup; + children = ( + F9946D9A139E1A560072D195 /* towns_midi.cpp */, + F9946D9B139E1A560072D195 /* towns_midi.h */, + F9946D9C139E1A560072D195 /* towns_pc98_plugins.cpp */, + DF46B6F71381E1FF00D08723 /* towns_audio.cpp */, + DF46B6F81381E1FF00D08723 /* towns_audio.h */, + DF46B6F91381E1FF00D08723 /* towns_euphony.cpp */, + DF46B6FA1381E1FF00D08723 /* towns_euphony.h */, + DF46B6FB1381E1FF00D08723 /* towns_pc98_driver.cpp */, + DF46B6FC1381E1FF00D08723 /* towns_pc98_driver.h */, + DF46B6FD1381E1FF00D08723 /* towns_pc98_fmsynth.cpp */, + DF46B6FE1381E1FF00D08723 /* towns_pc98_fmsynth.h */, + ); + name = fmtowns_pc98; + sourceTree = ""; + }; + DF46B7411381E3F200D08723 /* log */ = { + isa = PBXGroup; + children = ( + DF46B7421381E40500D08723 /* log.cpp */, + DF46B7431381E40500D08723 /* log.h */, + ); + name = log; + sourceTree = ""; + }; + DF46B7A21381E5CC00D08723 /* sdl */ = { + isa = PBXGroup; + children = ( + DF46B7A31381E5D900D08723 /* sdl-timer.cpp */, + DF46B7A41381E5D900D08723 /* sdl-timer.h */, + ); + name = sdl; + sourceTree = ""; + }; + DF46B7B01381E64E00D08723 /* mutex */ = { + isa = PBXGroup; + children = ( + DF46B7B11381E66000D08723 /* sdl */, + ); + name = mutex; + sourceTree = ""; + }; + DF46B7B11381E66000D08723 /* sdl */ = { + isa = PBXGroup; + children = ( + DF46B7B21381E67800D08723 /* sdl-mutex.cpp */, + DF46B7B31381E67800D08723 /* sdl-mutex.h */, + ); + name = sdl; + sourceTree = ""; + }; + DF46B7CC1381E74D00D08723 /* sdl */ = { + isa = PBXGroup; + children = ( + DF46B7CD1381E76300D08723 /* sdl-events.cpp */, + DF46B7CE1381E76300D08723 /* sdl-events.h */, + ); + name = sdl; + path = ..; + sourceTree = ""; + }; + DF46B8591381F43100D08723 /* opl */ = { + isa = PBXGroup; + children = ( + DF46B85A1381F44E00D08723 /* dbopl.cpp */, + DF46B85B1381F44E00D08723 /* dbopl.h */, + DF46B85C1381F44E00D08723 /* dosbox.cpp */, + DF46B85D1381F44E00D08723 /* dosbox.h */, + DF46B85E1381F44E00D08723 /* mame.cpp */, + DF46B85F1381F44E00D08723 /* mame.h */, + ); + name = opl; + sourceTree = ""; + }; + DF46B86D1381F47B00D08723 /* audiocd */ = { + isa = PBXGroup; + children = ( + DF46B8801381F4FF00D08723 /* audiocd.h */, + DF46B8781381F4C500D08723 /* default */, + DF46B86E1381F48D00D08723 /* sdl */, + ); + name = audiocd; + sourceTree = ""; + }; + DF46B86E1381F48D00D08723 /* sdl */ = { + isa = PBXGroup; + children = ( + DF46B86F1381F4A200D08723 /* sdl-audiocd.cpp */, + DF46B8701381F4A200D08723 /* sdl-audiocd.h */, + ); + name = sdl; + sourceTree = ""; + }; + DF46B8781381F4C500D08723 /* default */ = { + isa = PBXGroup; + children = ( + DF46B87B1381F4F200D08723 /* default-audiocd.cpp */, + DF46B87C1381F4F200D08723 /* default-audiocd.h */, + ); + name = default; + sourceTree = ""; + }; + DF46B8861381F5C600D08723 /* sdl */ = { + isa = PBXGroup; + children = ( + DF46B8871381F5D800D08723 /* sdl-provider.cpp */, + DF46B8881381F5D800D08723 /* sdl-provider.h */, + ); + name = sdl; + sourceTree = ""; + }; DF6118780FE3A9AA0042AD3F /* save */ = { isa = PBXGroup; children = ( + DF46B8431381F35500D08723 /* saveload_inca2.cpp */, + DF46B83B1381F13500D08723 /* saveload_v7.cpp */, DFCDC70311662B0200A7D2A0 /* saveload_fascin.cpp */, DF7585F0100CB70600CC3324 /* saveload_playtoons.cpp */, DF6118790FE3A9AA0042AD3F /* saveconverter.cpp */, @@ -5547,7 +6229,6 @@ DF61187B0FE3A9AA0042AD3F /* saveconverter_v2.cpp */, DF61187C0FE3A9AA0042AD3F /* saveconverter_v3.cpp */, DF61187D0FE3A9AA0042AD3F /* saveconverter_v4.cpp */, - DF61187E0FE3A9AA0042AD3F /* saveconverter_v6.cpp */, DF61187F0FE3A9AA0042AD3F /* savefile.cpp */, DF6118800FE3A9AA0042AD3F /* savefile.h */, DF6118810FE3A9AA0042AD3F /* savehandler.cpp */, @@ -5565,6 +6246,7 @@ DF841FF50E7BA6A600F5680E /* engines */ = { isa = PBXGroup; children = ( + DF46B8851381F56400D08723 /* util.h */, DF2FFC4C0F4863560006E566 /* advancedDetector.cpp */, DF2FFC4D0F4863560006E566 /* advancedDetector.h */, DF841FF60E7BA6A600F5680E /* agi */, @@ -5747,6 +6429,9 @@ DF8420640E7BA6A600F5680E /* cine */ = { isa = PBXGroup; children = ( + DF46B75B1381E4A400D08723 /* console.cpp */, + DF46B75C1381E4A400D08723 /* console.h */, + DF46B75D1381E4A400D08723 /* detection_tables.h */, DF8420650E7BA6A600F5680E /* anim.cpp */, DF8420660E7BA6A600F5680E /* anim.h */, DF8420670E7BA6A600F5680E /* bg.cpp */, @@ -5882,6 +6567,17 @@ DF8421170E7BA6A700F5680E /* gob */ = { isa = PBXGroup; children = ( + DF46B8471381F38700D08723 /* inter_v7.cpp */, + DF46B70F1381E27000D08723 /* console.cpp */, + DF46B7101381E27000D08723 /* console.h */, + DF46B7111381E27000D08723 /* databases.cpp */, + DF46B7121381E27000D08723 /* databases.h */, + DF46B7131381E27000D08723 /* dbase.cpp */, + DF46B7141381E27000D08723 /* dbase.h */, + DF46B7151381E27000D08723 /* iniconfig.cpp */, + DF46B7161381E27000D08723 /* iniconfig.h */, + DF46B7171381E27000D08723 /* init_v7.cpp */, + DF46B7181381E27000D08723 /* inter_inca2.cpp */, DF84211B0E7BA6A700F5680E /* dataio.cpp */, DF84211C0E7BA6A700F5680E /* dataio.h */, DF09CC060FAC4E1900A5AFD7 /* demos */, @@ -5908,7 +6604,6 @@ DF8421300E7BA6A700F5680E /* goblin_v2.cpp */, DF8421310E7BA6A700F5680E /* goblin_v3.cpp */, DF8421320E7BA6A700F5680E /* goblin_v4.cpp */, - DF6118590FE3A9020042AD3F /* helper.h */, DF7585C5100CB66E00CC3324 /* hotspots.cpp */, DF7585C6100CB66E00CC3324 /* hotspots.h */, DF8421330E7BA6A700F5680E /* init.cpp */, @@ -6255,6 +6950,8 @@ DF8422C90E7BA6A900F5680E /* made */ = { isa = PBXGroup; children = ( + DF46B8501381F3B400D08723 /* console.cpp */, + DF46B8511381F3B400D08723 /* console.h */, DF8422CA0E7BA6A900F5680E /* database.cpp */, DF8422CB0E7BA6A900F5680E /* database.h */, DF8422CC0E7BA6A900F5680E /* detection.cpp */, @@ -6453,6 +7150,10 @@ DF84237B0E7BA6AA00F5680E /* scumm */ = { isa = PBXGroup; children = ( + DF46B7501381E46700D08723 /* actor_he.h */, + DF46B7511381E46700D08723 /* player_v2base.cpp */, + DF46B7521381E46700D08723 /* player_v2base.h */, + DF46B7531381E46700D08723 /* player_v2cms.h */, DF84237C0E7BA6AA00F5680E /* actor.cpp */, DF84237D0E7BA6AA00F5680E /* actor.h */, DF84237E0E7BA6AA00F5680E /* akos.cpp */, @@ -6728,6 +7429,8 @@ DF84244E0E7BA6AB00F5680E /* sword1 */ = { isa = PBXGroup; children = ( + DF46B7C61381E72500D08723 /* console.cpp */, + DF46B7C71381E72500D08723 /* console.h */, DF84244F0E7BA6AB00F5680E /* animation.cpp */, DF8424500E7BA6AB00F5680E /* animation.h */, DF8424510E7BA6AB00F5680E /* collision.h */, @@ -6773,6 +7476,7 @@ DF8424770E7BA6AB00F5680E /* sword2 */ = { isa = PBXGroup; children = ( + DF46B7A81381E5F100D08723 /* header.cpp */, DF8424780E7BA6AB00F5680E /* animation.cpp */, DF8424790E7BA6AB00F5680E /* animation.h */, DF84247A0E7BA6AB00F5680E /* anims.cpp */, @@ -6829,6 +7533,9 @@ DF8424AA0E7BA6AB00F5680E /* tinsel */ = { isa = PBXGroup; children = ( + DF46B8901381F62B00D08723 /* adpcm.cpp */, + DF46B8911381F62B00D08723 /* adpcm.h */, + DF46B6F21381E18900D08723 /* coroutine.cpp */, DF8424AB0E7BA6AB00F5680E /* actors.cpp */, DF8424AC0E7BA6AB00F5680E /* actors.h */, DF8424AD0E7BA6AB00F5680E /* anim.cpp */, @@ -6923,6 +7630,8 @@ DF8424FC0E7BA6AB00F5680E /* touche */ = { isa = PBXGroup; children = ( + DF46B84B1381F39E00D08723 /* console.cpp */, + DF46B84C1381F39E00D08723 /* console.h */, DF8424FD0E7BA6AB00F5680E /* detection.cpp */, DF8424FE0E7BA6AB00F5680E /* graphics.cpp */, DF8424FF0E7BA6AB00F5680E /* graphics.h */, @@ -6939,48 +7648,6 @@ path = touche; sourceTree = ""; }; - DF895C0C124C24C00077F6E8 /* fmtowns_pc98 */ = { - isa = PBXGroup; - children = ( - DF895C0D124C24C00077F6E8 /* towns_audio.cpp */, - DF895C0E124C24C00077F6E8 /* towns_audio.h */, - DF895C0F124C24C00077F6E8 /* towns_euphony.cpp */, - DF895C10124C24C00077F6E8 /* towns_euphony.h */, - DF895C11124C24C00077F6E8 /* towns_pc98_driver.cpp */, - DF895C12124C24C00077F6E8 /* towns_pc98_driver.h */, - DF895C13124C24C00077F6E8 /* towns_pc98_fmsynth.cpp */, - DF895C14124C24C00077F6E8 /* towns_pc98_fmsynth.h */, - ); - path = fmtowns_pc98; - sourceTree = ""; - }; - DF90EABF10B023F300C8F93F /* codecs */ = { - isa = PBXGroup; - children = ( - DFB0579611B7549C0015AE65 /* cinepak.cpp */, - DFB0579711B7549C0015AE65 /* cinepak.h */, - DF90EAC010B023F400C8F93F /* codec.h */, - DF895CAB124E58980077F6E8 /* indeo3.cpp */, - DF895CAC124E58980077F6E8 /* indeo3.h */, - DF895CAD124E58980077F6E8 /* mjpeg.cpp */, - DF895CAE124E58980077F6E8 /* mjpeg.h */, - DFCDC6FC11662AD700A7D2A0 /* msrle.cpp */, - DFCDC6FD11662AD700A7D2A0 /* msrle.h */, - DF90EAC110B023F400C8F93F /* msvideo1.cpp */, - DF90EAC210B023F400C8F93F /* msvideo1.h */, - DF895CAF124E58980077F6E8 /* qdm2.cpp */, - DF895CB0124E58980077F6E8 /* qdm2.h */, - DF895CB1124E58980077F6E8 /* qdm2data.h */, - DF895CB2124E58980077F6E8 /* qtrle.cpp */, - DF895CB3124E58980077F6E8 /* qtrle.h */, - DF895CB4124E58980077F6E8 /* rpza.cpp */, - DF895CB5124E58980077F6E8 /* rpza.h */, - DF895CB6124E58980077F6E8 /* smc.cpp */, - DF895CB7124E58980077F6E8 /* smc.h */, - ); - path = codecs; - sourceTree = ""; - }; DF9B9277118E475D0069C19D /* games */ = { isa = PBXGroup; children = ( @@ -7026,6 +7693,9 @@ DFC8301B0F48AF18005EF03C /* engine */ = { isa = PBXGroup; children = ( + DF46B7BB1381E6C000D08723 /* object.cpp */, + DF46B7BC1381E6C000D08723 /* object.h */, + DF46B7661381E4E400D08723 /* vm_types.cpp */, DFCDC6D5116629CE00A7D2A0 /* features.cpp */, DFCDC6D6116629CE00A7D2A0 /* features.h */, DFC8301E0F48AF18005EF03C /* gc.cpp */, @@ -7076,10 +7746,11 @@ DFD5184C0DF3420D00854012 /* scaler */ = { isa = PBXGroup; children = ( + F9946DE9139E1B6F0072D195 /* aspect.h */, + F9946DEA139E1B6F0072D195 /* downscaler.cpp */, + F9946DEB139E1B6F0072D195 /* downscaler.h */, DFD518AA0DF34BA600854012 /* 2xsai.cpp */, DFD518AB0DF34BA600854012 /* aspect.cpp */, - DFD518AD0DF34BA600854012 /* hq2x.cpp */, - DFD518B10DF34BA600854012 /* hq3x.cpp */, DFD5189E0DF34AD700854012 /* intern.h */, DFD518B50DF34BA600854012 /* scale2x.cpp */, DFD518B60DF34BA600854012 /* scale2x.h */, @@ -7121,6 +7792,13 @@ DFE470D50D81F4E700B6D1FB /* backends */ = { isa = PBXGroup; children = ( + F9946E07139E1C3E0072D195 /* graphics */, + F9946DFA139E1BCB0072D195 /* mixer */, + DF46B86D1381F47B00D08723 /* audiocd */, + DF46B7B01381E64E00D08723 /* mutex */, + DF46B7471381E40F00D08723 /* modular-backend.cpp */, + DF46B7481381E40F00D08723 /* modular-backend.h */, + DF46B7411381E3F200D08723 /* log */, DF2FFC5B0F4866E70006E566 /* base-backend.cpp */, DF2FFC5C0F4866E70006E566 /* base-backend.h */, DFE470D60D81F4E700B6D1FB /* events */, @@ -7138,6 +7816,7 @@ DFE470D60D81F4E700B6D1FB /* events */ = { isa = PBXGroup; children = ( + DF46B7CC1381E74D00D08723 /* sdl */, DFE470D70D81F4E700B6D1FB /* default */, ); path = events; @@ -7167,6 +7846,7 @@ DFE470F50D81F4E700B6D1FB /* posix */ = { isa = PBXGroup; children = ( + DFADEBB613820E0C00C46364 /* posix-fs.cpp */, DF842A4C0E7BBBEB00F5680E /* posix-fs.h */, DFE470F60D81F4E700B6D1FB /* posix-fs-factory.cpp */, DFE470F70D81F4E700B6D1FB /* posix-fs-factory.h */, @@ -7188,6 +7868,7 @@ DFE471170D81F4E700B6D1FB /* platform */ = { isa = PBXGroup; children = ( + F92B4DDC139DDC9E000D1BF1 /* macosx */, DF09422F0F63CB9A002D821E /* sdl */, DFE471D70D81F4E700B6D1FB /* iphone */, ); @@ -7217,6 +7898,7 @@ DFE4737B0D81F4E800B6D1FB /* plugins */ = { isa = PBXGroup; children = ( + DF46B8861381F5C600D08723 /* sdl */, DFE4737F0D81F4E800B6D1FB /* dynamic-plugin.h */, DFE473800D81F4E800B6D1FB /* posix */, ); @@ -7254,6 +7936,7 @@ DFE473910D81F4E800B6D1FB /* timer */ = { isa = PBXGroup; children = ( + DF46B7A21381E5CC00D08723 /* sdl */, DFE473920D81F4E800B6D1FB /* default */, ); path = timer; @@ -7271,6 +7954,22 @@ DFE473950D81F4E800B6D1FB /* common */ = { isa = PBXGroup; children = ( + F92B4DCB139DD428000D1BF1 /* memstream.h */, + F92B4DCC139DD428000D1BF1 /* quicktime.cpp */, + F92B4DCD139DD428000D1BF1 /* quicktime.h */, + DF46B76E1381E54200D08723 /* bufferedstream.h */, + DF46B76F1381E54200D08723 /* dcl.cpp */, + DF46B7701381E54200D08723 /* dcl.h */, + DF46B7711381E54200D08723 /* forbidden.h */, + DF46B7721381E54200D08723 /* iff_container.cpp */, + DF46B7731381E54200D08723 /* substream.h */, + DF46B7741381E54200D08723 /* translation.h */, + DF46B7751381E54200D08723 /* winexe_ne.cpp */, + DF46B7761381E54200D08723 /* winexe_ne.h */, + DF46B7771381E54200D08723 /* winexe_pe.cpp */, + DF46B7781381E54200D08723 /* winexe_pe.h */, + DF46B7791381E54200D08723 /* winexe.cpp */, + DF46B77A1381E54200D08723 /* winexe.h */, DFE473980D81F4E800B6D1FB /* algorithm.h */, DF842A400E7BBBB400F5680E /* archive.cpp */, DF842A410E7BBBB400F5680E /* archive.h */, @@ -7357,6 +8056,15 @@ DFE477520D81F4E900B6D1FB /* graphics */ = { isa = PBXGroup; children = ( + F92B4DD1139DD449000D1BF1 /* yuv_to_rgb.cpp */, + F92B4DD2139DD449000D1BF1 /* yuv_to_rgb.h */, + DFADEBB113820DF500C46364 /* maccursor.cpp */, + DFADEBB213820DF500C46364 /* maccursor.h */, + DF46B78E1381E58000D08723 /* palette.h */, + DF46B78F1381E58000D08723 /* png.cpp */, + DF46B7901381E58000D08723 /* png.h */, + DF46B7911381E58000D08723 /* wincursor.cpp */, + DF46B7921381E58000D08723 /* wincursor.h */, DFE477530D81F4E900B6D1FB /* colormasks.h */, DF6BF4C010529DA50069811F /* conversion.cpp */, DF6BF4C110529DA50069811F /* conversion.h */, @@ -7393,7 +8101,6 @@ DF7E8C080ED5FCAF001CB19F /* VectorRenderer.h */, DF7E8C090ED5FCAF001CB19F /* VectorRendererSpec.cpp */, DF7E8C0A0ED5FCAF001CB19F /* VectorRendererSpec.h */, - DF2FFB940F485D950006E566 /* video */, ); name = graphics; path = ../../graphics; @@ -7402,10 +8109,11 @@ DFE4775C0D81F4E900B6D1FB /* fonts */ = { isa = PBXGroup; children = ( + DF46B79D1381E5B500D08723 /* winfont.cpp */, + DF46B79E1381E5B500D08723 /* winfont.h */, DFE4775D0D81F4E900B6D1FB /* consolefont.cpp */, DFE4775E0D81F4E900B6D1FB /* newfont.cpp */, DFE4775F0D81F4E900B6D1FB /* newfont_big.cpp */, - DFE477600D81F4E900B6D1FB /* scummfont.cpp */, ); path = fonts; sourceTree = ""; @@ -7413,6 +8121,8 @@ DFE477880D81F4E900B6D1FB /* gui */ = { isa = PBXGroup; children = ( + DF2040211380C8A60056300A /* widgets */, + DF203F461380C06E0056300A /* gui-manager.cpp */, DFE477890D81F4E900B6D1FB /* about.cpp */, DFE4778A0D81F4E900B6D1FB /* about.h */, DFE4778B0D81F4E900B6D1FB /* Actions.cpp */, @@ -7429,20 +8139,13 @@ DFE477950D81F4E900B6D1FB /* debugger.h */, DFE477960D81F4E900B6D1FB /* dialog.cpp */, DFE477970D81F4E900B6D1FB /* dialog.h */, - DFE477980D81F4E900B6D1FB /* editable.cpp */, - DFE477990D81F4E900B6D1FB /* editable.h */, - DFE4779A0D81F4E900B6D1FB /* EditTextWidget.cpp */, - DFE4779B0D81F4E900B6D1FB /* EditTextWidget.h */, DF9B9246118E46730069C19D /* error.cpp */, DF9B9247118E46730069C19D /* error.h */, - DF2FFBD50F485E360006E566 /* gui-manager.hcpp */, DF2FFBD60F485E360006E566 /* gui-manager.h */, DFE4779E0D81F4E900B6D1FB /* Key.cpp */, DFE4779F0D81F4E900B6D1FB /* Key.h */, DFE477A20D81F4E900B6D1FB /* launcher.cpp */, DFE477A30D81F4E900B6D1FB /* launcher.h */, - DFE477A40D81F4E900B6D1FB /* ListWidget.cpp */, - DFE477A50D81F4E900B6D1FB /* ListWidget.h */, DFE477A60D81F4E900B6D1FB /* massadd.cpp */, DFE477A70D81F4E900B6D1FB /* massadd.h */, DFE477A80D81F4E900B6D1FB /* message.cpp */, @@ -7451,14 +8154,8 @@ DFE477AE0D81F4E900B6D1FB /* object.h */, DFE477AF0D81F4E900B6D1FB /* options.cpp */, DFE477B00D81F4E900B6D1FB /* options.h */, - DFE477B10D81F4E900B6D1FB /* PopUpWidget.cpp */, - DFE477B20D81F4E900B6D1FB /* PopUpWidget.h */, DF7E8BF00ED5FC77001CB19F /* saveload.cpp */, DF7E8BF10ED5FC77001CB19F /* saveload.h */, - DFE477B30D81F4E900B6D1FB /* ScrollBarWidget.cpp */, - DFE477B40D81F4E900B6D1FB /* ScrollBarWidget.h */, - DFE477B50D81F4E900B6D1FB /* TabWidget.cpp */, - DFE477B60D81F4E900B6D1FB /* TabWidget.h */, DFE477BA0D81F4E900B6D1FB /* themebrowser.cpp */, DFE477BB0D81F4E900B6D1FB /* themebrowser.h */, DF7E8BF40ED5FC77001CB19F /* ThemeEngine.cpp */, @@ -7488,96 +8185,126 @@ path = themes; sourceTree = ""; }; - DFE477C60D81F4E900B6D1FB /* sound */ = { + F92B4DDC139DDC9E000D1BF1 /* macosx */ = { isa = PBXGroup; children = ( - DFE477CB0D81F4E900B6D1FB /* audiocd.cpp */, - DFE477CC0D81F4E900B6D1FB /* audiocd.h */, - DFE477CD0D81F4E900B6D1FB /* audiostream.cpp */, - DFE477CE0D81F4E900B6D1FB /* audiostream.h */, - DF45B0EB116627D9009B85CC /* decoders */, - DFE477D10D81F4E900B6D1FB /* fmopl.cpp */, - DFE477D20D81F4E900B6D1FB /* fmopl.h */, - DFE477D50D81F4E900B6D1FB /* mididrv.cpp */, - DFE477D60D81F4E900B6D1FB /* mididrv.h */, - DFE477D70D81F4E900B6D1FB /* midiparser.cpp */, - DFE477D80D81F4E900B6D1FB /* midiparser.h */, - DFE477D90D81F4E900B6D1FB /* midiparser_smf.cpp */, - DFE477DA0D81F4E900B6D1FB /* midiparser_xmidi.cpp */, - DFE477DB0D81F4E900B6D1FB /* mixer.cpp */, - DFE477DC0D81F4E900B6D1FB /* mixer.h */, - DFE477DD0D81F4E900B6D1FB /* mods */, - DFE477ED0D81F4E900B6D1FB /* mpu401.cpp */, - DFE477EE0D81F4E900B6D1FB /* mpu401.h */, - DF842A6F0E7BBDB200F5680E /* musicplugin.cpp */, - DF842A700E7BBDB200F5680E /* musicplugin.h */, - DFE477EF0D81F4E900B6D1FB /* null.cpp */, - DFE477F00D81F4E900B6D1FB /* rate.cpp */, - DFE477F10D81F4E900B6D1FB /* rate.h */, - DFE477F60D81F4E900B6D1FB /* softsynth */, - DF89C2B80F62D91000D756B6 /* timestamp.cpp */, - DF89C2B90F62D91000D756B6 /* timestamp.h */, - ); - name = sound; - path = ../../sound; - sourceTree = SOURCE_ROOT; + F92B4DD7139DDC92000D1BF1 /* macosx-main.cpp */, + F92B4DD8139DDC92000D1BF1 /* macosx.cpp */, + F92B4DD9139DDC92000D1BF1 /* macosx.h */, + ); + name = macosx; + sourceTree = ""; }; - DFE477DD0D81F4E900B6D1FB /* mods */ = { + F9946D79139E1A260072D195 /* codecs */ = { isa = PBXGroup; children = ( - DFE477DE0D81F4E900B6D1FB /* infogrames.cpp */, - DFE477DF0D81F4E900B6D1FB /* infogrames.h */, - DF6BF50210529F540069811F /* maxtrax.cpp */, - DF6BF50310529F540069811F /* maxtrax.h */, - DFE477E00D81F4E900B6D1FB /* module.cpp */, - DFE477E10D81F4E900B6D1FB /* module.h */, - DFE477E20D81F4E900B6D1FB /* paula.cpp */, - DFE477E30D81F4E900B6D1FB /* paula.h */, - DFE477E40D81F4E900B6D1FB /* protracker.cpp */, - DFE477E50D81F4E900B6D1FB /* protracker.h */, - DFE477E60D81F4E900B6D1FB /* rjp1.cpp */, - DFE477E70D81F4E900B6D1FB /* rjp1.h */, - DFE477E80D81F4E900B6D1FB /* soundfx.cpp */, - DFE477E90D81F4E900B6D1FB /* soundfx.h */, - DF6BF50410529F540069811F /* tfmx.cpp */, - DF6BF50510529F540069811F /* tfmx.h */, - ); - path = mods; + F9946D7A139E1A260072D195 /* cdtoons.cpp */, + F9946D7B139E1A260072D195 /* cdtoons.h */, + F9946D7C139E1A260072D195 /* cinepak.cpp */, + F9946D7D139E1A260072D195 /* cinepak.h */, + F9946D7E139E1A260072D195 /* codec.h */, + F9946D7F139E1A260072D195 /* indeo3.cpp */, + F9946D80139E1A260072D195 /* indeo3.h */, + F9946D81139E1A260072D195 /* mjpeg.cpp */, + F9946D82139E1A260072D195 /* mjpeg.h */, + F9946D83139E1A260072D195 /* msrle.cpp */, + F9946D84139E1A260072D195 /* msrle.h */, + F9946D85139E1A260072D195 /* msvideo1.cpp */, + F9946D86139E1A260072D195 /* msvideo1.h */, + F9946D87139E1A260072D195 /* qtrle.cpp */, + F9946D88139E1A260072D195 /* qtrle.h */, + F9946D89139E1A260072D195 /* rpza.cpp */, + F9946D8A139E1A260072D195 /* rpza.h */, + F9946D8B139E1A260072D195 /* smc.cpp */, + F9946D8C139E1A260072D195 /* smc.h */, + F9946D8D139E1A260072D195 /* truemotion1.cpp */, + F9946D8E139E1A260072D195 /* truemotion1.h */, + F9946D8F139E1A260072D195 /* truemotion1data.h */, + ); + name = codecs; + path = ../../video/codecs; sourceTree = ""; }; - DFE477F60D81F4E900B6D1FB /* softsynth */ = { + F9946DCD139E1A9A0072D195 /* mt32 */ = { isa = PBXGroup; children = ( - DFE477F70D81F4E900B6D1FB /* adlib.cpp */, - DF895C08124C24B50077F6E8 /* appleiigs.cpp */, - DF0E303F1252C6090082D593 /* cms.cpp */, - DF0E30401252C6090082D593 /* cms.h */, - DFE477F80D81F4E900B6D1FB /* emumidi.h */, - DFE477F90D81F4E900B6D1FB /* fluidsynth.cpp */, - DF895C0C124C24C00077F6E8 /* fmtowns_pc98 */, - DFF958A80FB222F300A3EC78 /* opl */, - DFE478210D81F4E900B6D1FB /* pcspk.cpp */, - DFE478220D81F4E900B6D1FB /* pcspk.h */, - DF2EC51010E64E3100765801 /* sid.cpp */, - DF2EC51110E64E3100765801 /* sid.h */, - DF2EC51710E64EE600765801 /* wave6581.cpp */, - DFE478230D81F4E900B6D1FB /* ym2612.cpp */, - DFE478240D81F4E900B6D1FB /* ym2612.h */, - ); - path = softsynth; + F9946DA3139E1A880072D195 /* freeverb.cpp */, + F9946DA4139E1A880072D195 /* freeverb.h */, + F9946DA5139E1A880072D195 /* i386.cpp */, + F9946DA6139E1A880072D195 /* i386.h */, + F9946DA7139E1A880072D195 /* mt32_file.cpp */, + F9946DA8139E1A880072D195 /* mt32_file.h */, + F9946DA9139E1A880072D195 /* mt32emu.h */, + F9946DAA139E1A880072D195 /* part.cpp */, + F9946DAB139E1A880072D195 /* part.h */, + F9946DAC139E1A880072D195 /* partial.cpp */, + F9946DAD139E1A880072D195 /* partial.h */, + F9946DAE139E1A880072D195 /* partialManager.cpp */, + F9946DAF139E1A880072D195 /* partialManager.h */, + F9946DB0139E1A880072D195 /* structures.h */, + F9946DB1139E1A880072D195 /* synth.cpp */, + F9946DB2139E1A880072D195 /* synth.h */, + F9946DB3139E1A880072D195 /* tables.cpp */, + F9946DB4139E1A880072D195 /* tables.h */, + ); + name = mt32; sourceTree = ""; }; - DFF958A80FB222F300A3EC78 /* opl */ = { + F9946DDF139E1B180072D195 /* posix */ = { isa = PBXGroup; children = ( - DFEC5D3D1166C6B400C90552 /* dbopl.cpp */, - DFEC5D3E1166C6B400C90552 /* dbopl.h */, - DFF958A90FB222F300A3EC78 /* dosbox.cpp */, - DFF958AA0FB222F300A3EC78 /* dosbox.h */, - DF6118CF0FE3AB560042AD3F /* mame.cpp */, - DF6118D00FE3AB560042AD3F /* mame.h */, - ); - path = opl; + F9946DE0139E1B180072D195 /* posix-main.cpp */, + F9946DE1139E1B180072D195 /* posix.cpp */, + F9946DE2139E1B180072D195 /* posix.h */, + ); + path = posix; + sourceTree = ""; + }; + F9946DF4139E1BBF0072D195 /* sdl */ = { + isa = PBXGroup; + children = ( + F9946DF5139E1BBF0072D195 /* sdl-mixer.cpp */, + F9946DF6139E1BBF0072D195 /* sdl-mixer.h */, + ); + name = sdl; + path = mixer/sdl; + sourceTree = ""; + }; + F9946DFA139E1BCB0072D195 /* mixer */ = { + isa = PBXGroup; + children = ( + F9946DFB139E1BEB0072D195 /* doublebuffersdl */, + F9946DF4139E1BBF0072D195 /* sdl */, + ); + name = mixer; + sourceTree = ""; + }; + F9946DFB139E1BEB0072D195 /* doublebuffersdl */ = { + isa = PBXGroup; + children = ( + F9946DFC139E1BEB0072D195 /* doublebuffersdl-mixer.cpp */, + F9946DFD139E1BEB0072D195 /* doublebuffersdl-mixer.h */, + ); + name = doublebuffersdl; + path = mixer/doublebuffersdl; + sourceTree = ""; + }; + F9946E01139E1C390072D195 /* sdl */ = { + isa = PBXGroup; + children = ( + F9946E02139E1C390072D195 /* sdl-graphics.cpp */, + F9946E03139E1C390072D195 /* sdl-graphics.h */, + ); + name = sdl; + path = graphics/sdl; + sourceTree = ""; + }; + F9946E07139E1C3E0072D195 /* graphics */ = { + isa = PBXGroup; + children = ( + F9946E01139E1C390072D195 /* sdl */, + ); + name = graphics; sourceTree = ""; }; /* End PBXGroup section */ @@ -7765,7 +8492,6 @@ DFE47BFF0D81F4E900B6D1FB /* consolefont.cpp in Sources */, DFE47C000D81F4E900B6D1FB /* newfont.cpp in Sources */, DFE47C010D81F4E900B6D1FB /* newfont_big.cpp in Sources */, - DFE47C020D81F4E900B6D1FB /* scummfont.cpp in Sources */, DFE47C030D81F4E900B6D1FB /* iff.cpp in Sources */, DFE47C040D81F4E900B6D1FB /* imagedec.cpp in Sources */, DFE47C080D81F4E900B6D1FB /* primitives.cpp in Sources */, @@ -7777,49 +8503,20 @@ DFE47C200D81F4E900B6D1FB /* console.cpp in Sources */, DFE47C210D81F4E900B6D1FB /* debugger.cpp in Sources */, DFE47C220D81F4E900B6D1FB /* dialog.cpp in Sources */, - DFE47C230D81F4E900B6D1FB /* editable.cpp in Sources */, - DFE47C240D81F4E900B6D1FB /* EditTextWidget.cpp in Sources */, DFE47C260D81F4E900B6D1FB /* Key.cpp in Sources */, DFE47C280D81F4E900B6D1FB /* launcher.cpp in Sources */, - DFE47C290D81F4E900B6D1FB /* ListWidget.cpp in Sources */, DFE47C2A0D81F4E900B6D1FB /* massadd.cpp in Sources */, DFE47C2B0D81F4E900B6D1FB /* message.cpp in Sources */, DFE47C2E0D81F4E900B6D1FB /* object.cpp in Sources */, DFE47C2F0D81F4E900B6D1FB /* options.cpp in Sources */, - DFE47C300D81F4E900B6D1FB /* PopUpWidget.cpp in Sources */, - DFE47C310D81F4E900B6D1FB /* ScrollBarWidget.cpp in Sources */, - DFE47C320D81F4E900B6D1FB /* TabWidget.cpp in Sources */, DFE47C350D81F4E900B6D1FB /* themebrowser.cpp in Sources */, DFE47C3B0D81F4E900B6D1FB /* widget.cpp in Sources */, - DFE47C3E0D81F4E900B6D1FB /* audiocd.cpp in Sources */, - DFE47C3F0D81F4E900B6D1FB /* audiostream.cpp in Sources */, - DFE47C410D81F4E900B6D1FB /* fmopl.cpp in Sources */, - DFE47C430D81F4E900B6D1FB /* mididrv.cpp in Sources */, - DFE47C440D81F4E900B6D1FB /* midiparser.cpp in Sources */, - DFE47C450D81F4E900B6D1FB /* midiparser_smf.cpp in Sources */, - DFE47C460D81F4E900B6D1FB /* midiparser_xmidi.cpp in Sources */, - DFE47C470D81F4E900B6D1FB /* mixer.cpp in Sources */, - DFE47C480D81F4E900B6D1FB /* infogrames.cpp in Sources */, - DFE47C490D81F4E900B6D1FB /* module.cpp in Sources */, - DFE47C4A0D81F4E900B6D1FB /* paula.cpp in Sources */, - DFE47C4B0D81F4E900B6D1FB /* protracker.cpp in Sources */, - DFE47C4C0D81F4E900B6D1FB /* rjp1.cpp in Sources */, - DFE47C4D0D81F4E900B6D1FB /* soundfx.cpp in Sources */, - DFE47C500D81F4E900B6D1FB /* mpu401.cpp in Sources */, - DFE47C510D81F4E900B6D1FB /* null.cpp in Sources */, - DFE47C520D81F4E900B6D1FB /* rate.cpp in Sources */, - DFE47C570D81F4E900B6D1FB /* adlib.cpp in Sources */, - DFE47C580D81F4E900B6D1FB /* fluidsynth.cpp in Sources */, - DFE47C740D81F4E900B6D1FB /* pcspk.cpp in Sources */, - DFE47C750D81F4E900B6D1FB /* ym2612.cpp in Sources */, DFD511480DF3383500854012 /* memorypool.cpp in Sources */, DFD517E20DF33CAC00854012 /* seq.cpp in Sources */, DFD5183D0DF3411800854012 /* scaler.cpp in Sources */, DFD518A20DF34B2500854012 /* scalebit.cpp in Sources */, DFD518BC0DF34BA600854012 /* 2xsai.cpp in Sources */, DFD518BD0DF34BA600854012 /* aspect.cpp in Sources */, - DFD518BF0DF34BA600854012 /* hq2x.cpp in Sources */, - DFD518C20DF34BA600854012 /* hq3x.cpp in Sources */, DFD518C50DF34BA600854012 /* scale2x.cpp in Sources */, DFD518C70DF34BA600854012 /* scale3x.cpp in Sources */, DF841FDD0E7BA61800F5680E /* iphone_keyboard.m in Sources */, @@ -8442,7 +9139,6 @@ DF842A470E7BBBB400F5680E /* archive.cpp in Sources */, DF842A490E7BBBB400F5680E /* unarj.cpp in Sources */, DF842A6D0E7BBD5700F5680E /* stdiostream.cpp in Sources */, - DF842A710E7BBDB200F5680E /* musicplugin.cpp in Sources */, DF7E8BFD0ED5FC77001CB19F /* saveload.cpp in Sources */, DF7E8BFF0ED5FC77001CB19F /* ThemeEngine.cpp in Sources */, DF7E8C000ED5FC77001CB19F /* ThemeEval.cpp in Sources */, @@ -8459,7 +9155,6 @@ DFAAB0020F011392003E9390 /* thumbnail_intern.cpp in Sources */, DF2FFB930F485D890006E566 /* dither.cpp in Sources */, DF2FFBD30F485DFB0006E566 /* debug.cpp in Sources */, - DF2FFBD90F485E360006E566 /* gui-manager.hcpp in Sources */, DF2FFBFC0F4860A60006E566 /* posix-saves.cpp in Sources */, DF2FFC290F4862520006E566 /* bmv.cpp in Sources */, DF2FFC2A0F4862520006E566 /* dialogs.cpp in Sources */, @@ -8531,7 +9226,6 @@ DF573CBE0F5A85E100961A72 /* timer_lol.cpp in Sources */, DF89C2880F62D55C00D756B6 /* sprites_lol.cpp in Sources */, DF89C2A40F62D79E00D756B6 /* script.cpp in Sources */, - DF89C2BB0F62D91000D756B6 /* timestamp.cpp in Sources */, DF093E5F0F63CAD4002D821E /* pn.cpp in Sources */, DF093E600F63CAD4002D821E /* script_pn.cpp in Sources */, DF093E610F63CAD4002D821E /* vga_pn.cpp in Sources */, @@ -8546,20 +9240,15 @@ DF09CC1B0FAC4E1900A5AFD7 /* inter_fascin.cpp in Sources */, DF09CC2A0FAC4EAB00A5AFD7 /* script_v3.cpp in Sources */, DF09CC2B0FAC4EAB00A5AFD7 /* script_v4.cpp in Sources */, - DFF958B20FB222F300A3EC78 /* dosbox.cpp in Sources */, DF61183E0FE3A8080042AD3F /* kmisc.cpp in Sources */, DF61183F0FE3A8080042AD3F /* segment.cpp in Sources */, DF61184C0FE3A8250042AD3F /* decompressor.cpp in Sources */, DF61184D0FE3A8250042AD3F /* resource.cpp in Sources */, DF6118560FE3A8990042AD3F /* disk.cpp in Sources */, - DF61186D0FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, - DF61186E0FE3A9410042AD3F /* flic_decoder.cpp in Sources */, - DF61186F0FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118950FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF6118960FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF6118970FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF6118980FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, - DF6118990FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF61189A0FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF61189B0FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF61189C0FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -8573,7 +9262,6 @@ DF6118BE0FE3AA280042AD3F /* sound_pcspk.cpp in Sources */, DF6118BF0FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C80FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, - DF6118D30FE3AB560042AD3F /* mame.cpp in Sources */, DF7585DA100CB66E00CC3324 /* expression.cpp in Sources */, DF7585DB100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585DC100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -8598,31 +9286,15 @@ DF6BF4F410529EE40069811F /* player_v4a.cpp in Sources */, DF6BF4FE10529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF4FF10529F140069811F /* EventRecorder.cpp in Sources */, - DF6BF50810529F540069811F /* maxtrax.cpp in Sources */, - DF6BF50910529F540069811F /* tfmx.cpp in Sources */, DF90E9C310AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA610B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAF10B0236F00C8F93F /* staticres.cpp in Sources */, - DF90EABA10B023D100C8F93F /* avi_decoder.cpp in Sources */, - DF90EAC510B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3F910E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC3FF10E64C4300765801 /* animator_tim.cpp in Sources */, DF2EC40610E64C8000765801 /* event.cpp in Sources */, DF2EC50310E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50410E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50C10E64DB300765801 /* textconsole.cpp in Sources */, - DF2EC51310E64E3100765801 /* sid.cpp in Sources */, - DF2EC51910E64EE600765801 /* wave6581.cpp in Sources */, - DF45B11F116627DA009B85CC /* adpcm.cpp in Sources */, - DF45B121116627DA009B85CC /* aiff.cpp in Sources */, - DF45B123116627DA009B85CC /* flac.cpp in Sources */, - DF45B125116627DA009B85CC /* iff_sound.cpp in Sources */, - DF45B127116627DA009B85CC /* mp3.cpp in Sources */, - DF45B129116627DA009B85CC /* raw.cpp in Sources */, - DF45B12B116627DA009B85CC /* vag.cpp in Sources */, - DF45B12D116627DA009B85CC /* voc.cpp in Sources */, - DF45B12F116627DA009B85CC /* vorbis.cpp in Sources */, - DF45B131116627DA009B85CC /* wave.cpp in Sources */, DF45B1CA116628A5009B85CC /* animate.cpp in Sources */, DF45B1CB116628A5009B85CC /* cache.cpp in Sources */, DF45B1CC116628A5009B85CC /* compare.cpp in Sources */, @@ -8656,24 +9328,19 @@ DFCDC6D9116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DA116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F711662AAB00A7D2A0 /* resource.cpp in Sources */, - DFCDC6FE11662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70411662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70B11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D121166C5CF00C90552 /* random.cpp in Sources */, DFEC5D131166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D371166C67300C90552 /* savestate.cpp in Sources */, - DFEC5D401166C6B400C90552 /* dbopl.cpp in Sources */, DF9B9249118E46730069C19D /* error.cpp in Sources */, DF9B9254118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9263118E46FE0069C19D /* error.cpp in Sources */, - DFB0576C11B753AF0015AE65 /* qt_decoder.cpp in Sources */, - DFB0576D11B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577711B753DA0015AE65 /* rational.cpp in Sources */, DFB0578211B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578311B7541F0015AE65 /* util.cpp in Sources */, DFB0578B11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579211B7547D0015AE65 /* pict.cpp in Sources */, - DFB0579911B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286211FF23D500159131 /* amigamac.cpp in Sources */, DF7F286911FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286A11FF23EF00159131 /* workarounds.cpp in Sources */, @@ -8684,25 +9351,11 @@ DF7F288311FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288C11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289511FF247300159131 /* translation.cpp in Sources */, - DF7F28A111FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A611FF24C400159131 /* console.cpp in Sources */, - DF895BFE124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C03124C24680077F6E8 /* player_towns.cpp in Sources */, - DF895C09124C24B60077F6E8 /* appleiigs.cpp in Sources */, - DF895C15124C24C10077F6E8 /* towns_audio.cpp in Sources */, - DF895C16124C24C10077F6E8 /* towns_euphony.cpp in Sources */, - DF895C17124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, - DF895C18124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C25124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2A124C25350077F6E8 /* script_patches.cpp in Sources */, - DF895CB8124E58980077F6E8 /* indeo3.cpp in Sources */, - DF895CB9124E58980077F6E8 /* mjpeg.cpp in Sources */, - DF895CBA124E58980077F6E8 /* qdm2.cpp in Sources */, - DF895CBB124E58980077F6E8 /* qtrle.cpp in Sources */, - DF895CBC124E58980077F6E8 /* rpza.cpp in Sources */, - DF895CBD124E58990077F6E8 /* smc.cpp in Sources */, DF0E303B1252C5BD0082D593 /* cms.cpp in Sources */, - DF0E30421252C6090082D593 /* cms.cpp in Sources */, 8CB5A9CB1253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9CC1253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9CD1253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -8710,7 +9363,6 @@ 8CB5A9CF1253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED53126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED54126202AB00FA198C /* display.cpp in Sources */, - 8CD1ED55126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED56126202AB00FA198C /* file.cpp in Sources */, 8CD1ED57126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED58126202AB00FA198C /* intro.cpp in Sources */, @@ -8759,6 +9411,164 @@ 8CD80D13126272A0001C6C87 /* surface.cpp in Sources */, 8CD80D14126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80D15126272A0001C6C87 /* teenagent.cpp in Sources */, + DF203F481380C06E0056300A /* gui-manager.cpp in Sources */, + DF203F6B1380C2750056300A /* avi_decoder.cpp in Sources */, + DF203F6C1380C2750056300A /* coktel_decoder.cpp in Sources */, + DF203F6D1380C2750056300A /* dxa_decoder.cpp in Sources */, + DF203F6E1380C2750056300A /* flic_decoder.cpp in Sources */, + DF203F701380C2750056300A /* qt_decoder.cpp in Sources */, + DF203F711380C2750056300A /* smk_decoder.cpp in Sources */, + DF203F721380C2750056300A /* video_decoder.cpp in Sources */, + DF203FA01380C2920056300A /* cdtoons.cpp in Sources */, + DF203FA11380C2920056300A /* cinepak.cpp in Sources */, + DF203FA21380C2920056300A /* indeo3.cpp in Sources */, + DF203FA31380C2920056300A /* mjpeg.cpp in Sources */, + DF203FA41380C2920056300A /* msrle.cpp in Sources */, + DF203FA51380C2920056300A /* msvideo1.cpp in Sources */, + DF203FA71380C2920056300A /* qtrle.cpp in Sources */, + DF203FA81380C2920056300A /* rpza.cpp in Sources */, + DF203FA91380C2920056300A /* smc.cpp in Sources */, + DF203FAA1380C2920056300A /* truemotion1.cpp in Sources */, + DF203FE61380C3BC0056300A /* console.cpp in Sources */, + DF203FE71380C3BC0056300A /* dialogs.cpp in Sources */, + DF203FE81380C3BC0056300A /* file_v1d.cpp in Sources */, + DF203FE91380C3BC0056300A /* file_v1w.cpp in Sources */, + DF203FEA1380C3BC0056300A /* file_v2d.cpp in Sources */, + DF203FEB1380C3BC0056300A /* file_v2w.cpp in Sources */, + DF203FEC1380C3BC0056300A /* file_v3d.cpp in Sources */, + DF203FED1380C3BC0056300A /* object_v1d.cpp in Sources */, + DF203FEE1380C3BC0056300A /* object_v1w.cpp in Sources */, + DF203FEF1380C3BC0056300A /* object_v2d.cpp in Sources */, + DF203FF01380C3BC0056300A /* object_v3d.cpp in Sources */, + DF203FF11380C3BC0056300A /* object.cpp in Sources */, + DF203FF21380C3BC0056300A /* parser_v1d.cpp in Sources */, + DF203FF31380C3BC0056300A /* parser_v1w.cpp in Sources */, + DF203FF41380C3BC0056300A /* parser_v2d.cpp in Sources */, + DF203FF51380C3BC0056300A /* parser_v3d.cpp in Sources */, + DF203FF61380C3BC0056300A /* text.cpp in Sources */, + DF2040341380C8B70056300A /* editable.cpp in Sources */, + DF2040351380C8B70056300A /* edittext.cpp in Sources */, + DF2040361380C8B70056300A /* list.cpp in Sources */, + DF2040371380C8B70056300A /* popup.cpp in Sources */, + DF2040381380C8B70056300A /* scrollbar.cpp in Sources */, + DF2040391380C8B70056300A /* tab.cpp in Sources */, + DF20406A1380CA230056300A /* audiostream.cpp in Sources */, + DF20406B1380CA230056300A /* fmopl.cpp in Sources */, + DF20406C1380CA230056300A /* mididrv.cpp in Sources */, + DF20406D1380CA230056300A /* midiparser_smf.cpp in Sources */, + DF20406E1380CA230056300A /* midiparser_xmidi.cpp in Sources */, + DF20406F1380CA230056300A /* midiparser.cpp in Sources */, + DF2040701380CA230056300A /* midiplayer.cpp in Sources */, + DF2040711380CA230056300A /* mixer.cpp in Sources */, + DF2040721380CA230056300A /* mpu401.cpp in Sources */, + DF2040731380CA230056300A /* musicplugin.cpp in Sources */, + DF2040741380CA230056300A /* rate.cpp in Sources */, + DF2040751380CA230056300A /* timestamp.cpp in Sources */, + DF2040A51380CA400056300A /* adpcm.cpp in Sources */, + DF2040A61380CA400056300A /* aiff.cpp in Sources */, + DF2040A71380CA400056300A /* flac.cpp in Sources */, + DF2040A81380CA400056300A /* iff_sound.cpp in Sources */, + DF2040A91380CA400056300A /* mac_snd.cpp in Sources */, + DF2040AA1380CA400056300A /* mp3.cpp in Sources */, + DF2040AB1380CA400056300A /* raw.cpp in Sources */, + DF2040AC1380CA400056300A /* vag.cpp in Sources */, + DF2040AD1380CA400056300A /* voc.cpp in Sources */, + DF2040AE1380CA400056300A /* vorbis.cpp in Sources */, + DF2040AF1380CA400056300A /* wave.cpp in Sources */, + DF2040D41380CA810056300A /* infogrames.cpp in Sources */, + DF2040D51380CA810056300A /* maxtrax.cpp in Sources */, + DF2040D61380CA810056300A /* module.cpp in Sources */, + DF2040D71380CA810056300A /* paula.cpp in Sources */, + DF2040D81380CA810056300A /* protracker.cpp in Sources */, + DF2040D91380CA810056300A /* rjp1.cpp in Sources */, + DF2040DA1380CA810056300A /* soundfx.cpp in Sources */, + DF2040DB1380CA810056300A /* tfmx.cpp in Sources */, + DF2040FE1380CAA40056300A /* adlib.cpp in Sources */, + DF2040FF1380CAA40056300A /* appleiigs.cpp in Sources */, + DF2041001380CAA40056300A /* cms.cpp in Sources */, + DF2041011380CAA40056300A /* eas.cpp in Sources */, + DF2041021380CAA40056300A /* fluidsynth.cpp in Sources */, + DF2041031380CAA40056300A /* mt32.cpp in Sources */, + DF2041041380CAA40056300A /* pcspk.cpp in Sources */, + DF2041051380CAA40056300A /* sid.cpp in Sources */, + DF2041061380CAA40056300A /* wave6581.cpp in Sources */, + DF46B6F41381E18900D08723 /* coroutine.cpp in Sources */, + DF46B7031381E1FF00D08723 /* towns_audio.cpp in Sources */, + DF46B7041381E1FF00D08723 /* towns_euphony.cpp in Sources */, + DF46B7051381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, + DF46B7061381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, + DF46B71F1381E27000D08723 /* console.cpp in Sources */, + DF46B7201381E27000D08723 /* databases.cpp in Sources */, + DF46B7211381E27000D08723 /* dbase.cpp in Sources */, + DF46B7221381E27000D08723 /* iniconfig.cpp in Sources */, + DF46B7231381E27000D08723 /* init_v7.cpp in Sources */, + DF46B7241381E27000D08723 /* inter_inca2.cpp in Sources */, + DF46B7451381E40500D08723 /* log.cpp in Sources */, + DF46B74A1381E40F00D08723 /* modular-backend.cpp in Sources */, + DF46B7551381E46700D08723 /* player_v2base.cpp in Sources */, + DF46B75F1381E4A400D08723 /* console.cpp in Sources */, + DF46B7641381E4D400D08723 /* robot_decoder.cpp in Sources */, + DF46B7681381E4E400D08723 /* vm_types.cpp in Sources */, + DF46B7801381E54200D08723 /* dcl.cpp in Sources */, + DF46B7811381E54200D08723 /* iff_container.cpp in Sources */, + DF46B7821381E54200D08723 /* winexe_ne.cpp in Sources */, + DF46B7831381E54200D08723 /* winexe_pe.cpp in Sources */, + DF46B7841381E54200D08723 /* winexe.cpp in Sources */, + DF46B7951381E58000D08723 /* png.cpp in Sources */, + DF46B7961381E58000D08723 /* wincursor.cpp in Sources */, + DF46B7A01381E5B500D08723 /* winfont.cpp in Sources */, + DF46B7AA1381E5F100D08723 /* header.cpp in Sources */, + DF46B7B51381E67800D08723 /* sdl-mutex.cpp in Sources */, + DF46B7BE1381E6C000D08723 /* object.cpp in Sources */, + DF46B7C91381E72500D08723 /* console.cpp in Sources */, + DF46B7D71381E7C600D08723 /* console.cpp in Sources */, + DF46B83D1381F13500D08723 /* saveload_v7.cpp in Sources */, + DF46B8451381F35500D08723 /* saveload_inca2.cpp in Sources */, + DF46B8491381F38700D08723 /* inter_v7.cpp in Sources */, + DF46B84E1381F39E00D08723 /* console.cpp in Sources */, + DF46B8531381F3B400D08723 /* console.cpp in Sources */, + DF46B8631381F44E00D08723 /* dbopl.cpp in Sources */, + DF46B8641381F44E00D08723 /* dosbox.cpp in Sources */, + DF46B8651381F44E00D08723 /* mame.cpp in Sources */, + DF46B8721381F4A200D08723 /* sdl-audiocd.cpp in Sources */, + DF46B87E1381F4F200D08723 /* default-audiocd.cpp in Sources */, + DF46B88A1381F5D800D08723 /* sdl-provider.cpp in Sources */, + DF46B8931381F62B00D08723 /* adpcm.cpp in Sources */, + DF46B89C1381F6C400D08723 /* null.cpp in Sources */, + DFADEBB413820DF500C46364 /* maccursor.cpp in Sources */, + DFADEBB813820E0C00C46364 /* posix-fs.cpp in Sources */, + F92B4DCE139DD428000D1BF1 /* quicktime.cpp in Sources */, + F92B4DD3139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */, + F9946D90139E1A260072D195 /* cdtoons.cpp in Sources */, + F9946D91139E1A260072D195 /* cinepak.cpp in Sources */, + F9946D92139E1A260072D195 /* indeo3.cpp in Sources */, + F9946D93139E1A260072D195 /* mjpeg.cpp in Sources */, + F9946D94139E1A260072D195 /* msrle.cpp in Sources */, + F9946D95139E1A260072D195 /* msvideo1.cpp in Sources */, + F9946D96139E1A260072D195 /* qtrle.cpp in Sources */, + F9946D97139E1A260072D195 /* rpza.cpp in Sources */, + F9946D98139E1A260072D195 /* smc.cpp in Sources */, + F9946D99139E1A260072D195 /* truemotion1.cpp in Sources */, + F9946D9D139E1A560072D195 /* towns_midi.cpp in Sources */, + F9946DA0139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */, + F9946DB5139E1A880072D195 /* freeverb.cpp in Sources */, + F9946DB8139E1A880072D195 /* i386.cpp in Sources */, + F9946DBB139E1A880072D195 /* mt32_file.cpp in Sources */, + F9946DBE139E1A880072D195 /* part.cpp in Sources */, + F9946DC1139E1A880072D195 /* partial.cpp in Sources */, + F9946DC4139E1A880072D195 /* partialManager.cpp in Sources */, + F9946DC7139E1A880072D195 /* synth.cpp in Sources */, + F9946DCA139E1A880072D195 /* tables.cpp in Sources */, + F9946DD6139E1AD30072D195 /* aac.cpp in Sources */, + F9946DD9139E1AD30072D195 /* qdm2.cpp in Sources */, + F9946DDC139E1AD30072D195 /* quicktime.cpp in Sources */, + F9946DE3139E1B180072D195 /* posix-main.cpp in Sources */, + F9946DE6139E1B180072D195 /* posix.cpp in Sources */, + F9946DEC139E1B6F0072D195 /* downscaler.cpp in Sources */, + F9946DF1139E1BA00072D195 /* console.cpp in Sources */, + F9946DF7139E1BBF0072D195 /* sdl-mixer.cpp in Sources */, + F9946DFE139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */, + F9946E04139E1C390072D195 /* sdl-graphics.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -8794,7 +9604,6 @@ DF093E9C0F63CB26002D821E /* consolefont.cpp in Sources */, DF093E9D0F63CB26002D821E /* newfont.cpp in Sources */, DF093E9E0F63CB26002D821E /* newfont_big.cpp in Sources */, - DF093E9F0F63CB26002D821E /* scummfont.cpp in Sources */, DF093EA00F63CB26002D821E /* iff.cpp in Sources */, DF093EA10F63CB26002D821E /* imagedec.cpp in Sources */, DF093EA20F63CB26002D821E /* primitives.cpp in Sources */, @@ -8805,49 +9614,20 @@ DF093EA80F63CB26002D821E /* console.cpp in Sources */, DF093EA90F63CB26002D821E /* debugger.cpp in Sources */, DF093EAA0F63CB26002D821E /* dialog.cpp in Sources */, - DF093EAB0F63CB26002D821E /* editable.cpp in Sources */, - DF093EAC0F63CB26002D821E /* EditTextWidget.cpp in Sources */, DF093EAD0F63CB26002D821E /* Key.cpp in Sources */, DF093EAE0F63CB26002D821E /* launcher.cpp in Sources */, - DF093EAF0F63CB26002D821E /* ListWidget.cpp in Sources */, DF093EB00F63CB26002D821E /* massadd.cpp in Sources */, DF093EB10F63CB26002D821E /* message.cpp in Sources */, DF093EB20F63CB26002D821E /* object.cpp in Sources */, DF093EB30F63CB26002D821E /* options.cpp in Sources */, - DF093EB40F63CB26002D821E /* PopUpWidget.cpp in Sources */, - DF093EB50F63CB26002D821E /* ScrollBarWidget.cpp in Sources */, - DF093EB60F63CB26002D821E /* TabWidget.cpp in Sources */, DF093EB70F63CB26002D821E /* themebrowser.cpp in Sources */, DF093EB80F63CB26002D821E /* widget.cpp in Sources */, - DF093EBB0F63CB26002D821E /* audiocd.cpp in Sources */, - DF093EBC0F63CB26002D821E /* audiostream.cpp in Sources */, - DF093EBE0F63CB26002D821E /* fmopl.cpp in Sources */, - DF093EC00F63CB26002D821E /* mididrv.cpp in Sources */, - DF093EC10F63CB26002D821E /* midiparser.cpp in Sources */, - DF093EC20F63CB26002D821E /* midiparser_smf.cpp in Sources */, - DF093EC30F63CB26002D821E /* midiparser_xmidi.cpp in Sources */, - DF093EC40F63CB26002D821E /* mixer.cpp in Sources */, - DF093EC50F63CB26002D821E /* infogrames.cpp in Sources */, - DF093EC60F63CB26002D821E /* module.cpp in Sources */, - DF093EC70F63CB26002D821E /* paula.cpp in Sources */, - DF093EC80F63CB26002D821E /* protracker.cpp in Sources */, - DF093EC90F63CB26002D821E /* rjp1.cpp in Sources */, - DF093ECA0F63CB26002D821E /* soundfx.cpp in Sources */, - DF093ECC0F63CB26002D821E /* mpu401.cpp in Sources */, - DF093ECD0F63CB26002D821E /* null.cpp in Sources */, - DF093ECE0F63CB26002D821E /* rate.cpp in Sources */, - DF093ECF0F63CB26002D821E /* adlib.cpp in Sources */, - DF093ED00F63CB26002D821E /* fluidsynth.cpp in Sources */, - DF093ED10F63CB26002D821E /* pcspk.cpp in Sources */, - DF093ED20F63CB26002D821E /* ym2612.cpp in Sources */, DF093ED60F63CB26002D821E /* memorypool.cpp in Sources */, DF093ED70F63CB26002D821E /* seq.cpp in Sources */, DF093ED80F63CB26002D821E /* scaler.cpp in Sources */, DF093ED90F63CB26002D821E /* scalebit.cpp in Sources */, DF093EDA0F63CB26002D821E /* 2xsai.cpp in Sources */, DF093EDB0F63CB26002D821E /* aspect.cpp in Sources */, - DF093EDC0F63CB26002D821E /* hq2x.cpp in Sources */, - DF093EDD0F63CB26002D821E /* hq3x.cpp in Sources */, DF093EDE0F63CB26002D821E /* scale2x.cpp in Sources */, DF093EDF0F63CB26002D821E /* scale3x.cpp in Sources */, DF093EE20F63CB26002D821E /* agi.cpp in Sources */, @@ -9467,7 +10247,6 @@ DF09417A0F63CB26002D821E /* archive.cpp in Sources */, DF09417B0F63CB26002D821E /* unarj.cpp in Sources */, DF09417C0F63CB26002D821E /* stdiostream.cpp in Sources */, - DF09417D0F63CB26002D821E /* musicplugin.cpp in Sources */, DF09417E0F63CB26002D821E /* saveload.cpp in Sources */, DF09417F0F63CB26002D821E /* ThemeEngine.cpp in Sources */, DF0941800F63CB26002D821E /* ThemeEval.cpp in Sources */, @@ -9484,7 +10263,6 @@ DF09418B0F63CB26002D821E /* thumbnail_intern.cpp in Sources */, DF09418C0F63CB26002D821E /* dither.cpp in Sources */, DF0941920F63CB26002D821E /* debug.cpp in Sources */, - DF0941930F63CB26002D821E /* gui-manager.hcpp in Sources */, DF0941940F63CB26002D821E /* posix-saves.cpp in Sources */, DF0941950F63CB26002D821E /* bmv.cpp in Sources */, DF0941960F63CB26002D821E /* dialogs.cpp in Sources */, @@ -9556,12 +10334,9 @@ DF09420D0F63CB26002D821E /* timer_lol.cpp in Sources */, DF0942100F63CB26002D821E /* sprites_lol.cpp in Sources */, DF0942110F63CB26002D821E /* script.cpp in Sources */, - DF0942140F63CB26002D821E /* timestamp.cpp in Sources */, DF0942150F63CB26002D821E /* pn.cpp in Sources */, DF0942160F63CB26002D821E /* script_pn.cpp in Sources */, DF0942170F63CB26002D821E /* vga_pn.cpp in Sources */, - DF0942430F63CB9A002D821E /* events.cpp in Sources */, - DF0942450F63CB9A002D821E /* graphics.cpp in Sources */, DF0942470F63CB9A002D821E /* main.cpp in Sources */, DF09424A0F63CB9A002D821E /* sdl.cpp in Sources */, DF0944330F63FBB3002D821E /* coreaudio.cpp in Sources */, @@ -9577,20 +10352,15 @@ DF09CC150FAC4E1900A5AFD7 /* inter_fascin.cpp in Sources */, DF09CC280FAC4EAB00A5AFD7 /* script_v3.cpp in Sources */, DF09CC290FAC4EAB00A5AFD7 /* script_v4.cpp in Sources */, - DFF958AF0FB222F300A3EC78 /* dosbox.cpp in Sources */, DF61183C0FE3A8080042AD3F /* kmisc.cpp in Sources */, DF61183D0FE3A8080042AD3F /* segment.cpp in Sources */, DF6118490FE3A8250042AD3F /* decompressor.cpp in Sources */, DF61184A0FE3A8250042AD3F /* resource.cpp in Sources */, DF6118550FE3A8990042AD3F /* disk.cpp in Sources */, - DF6118680FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, - DF6118690FE3A9410042AD3F /* flic_decoder.cpp in Sources */, - DF61186A0FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118890FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF61188A0FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF61188B0FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF61188C0FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, - DF61188D0FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF61188E0FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF61188F0FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF6118900FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -9605,7 +10375,6 @@ DF6118BB0FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C70FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, DF6118CC0FE3AAFD0042AD3F /* hardwarekeys.cpp in Sources */, - DF6118D10FE3AB560042AD3F /* mame.cpp in Sources */, DF7585CE100CB66E00CC3324 /* expression.cpp in Sources */, DF7585CF100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585D0100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -9626,13 +10395,9 @@ DF6BF4F510529EE40069811F /* player_v4a.cpp in Sources */, DF6BF50010529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF50110529F140069811F /* EventRecorder.cpp in Sources */, - DF6BF50A10529F540069811F /* maxtrax.cpp in Sources */, - DF6BF50B10529F540069811F /* tfmx.cpp in Sources */, DF90E9BF10AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA410B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAD10B0236F00C8F93F /* staticres.cpp in Sources */, - DF90EAB810B023D100C8F93F /* avi_decoder.cpp in Sources */, - DF90EAC310B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3E510E6490800765801 /* browser_osx.mm in Sources */, DF2EC3F810E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC3FE10E64C4300765801 /* animator_tim.cpp in Sources */, @@ -9640,18 +10405,6 @@ DF2EC50110E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50210E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50B10E64DB300765801 /* textconsole.cpp in Sources */, - DF2EC51210E64E3100765801 /* sid.cpp in Sources */, - DF2EC51810E64EE600765801 /* wave6581.cpp in Sources */, - DF45B13D116627DA009B85CC /* adpcm.cpp in Sources */, - DF45B13F116627DA009B85CC /* aiff.cpp in Sources */, - DF45B141116627DA009B85CC /* flac.cpp in Sources */, - DF45B143116627DA009B85CC /* iff_sound.cpp in Sources */, - DF45B145116627DA009B85CC /* mp3.cpp in Sources */, - DF45B147116627DA009B85CC /* raw.cpp in Sources */, - DF45B149116627DA009B85CC /* vag.cpp in Sources */, - DF45B14B116627DA009B85CC /* voc.cpp in Sources */, - DF45B14D116627DA009B85CC /* vorbis.cpp in Sources */, - DF45B14F116627DA009B85CC /* wave.cpp in Sources */, DF45B1F4116628A5009B85CC /* animate.cpp in Sources */, DF45B1F5116628A5009B85CC /* cache.cpp in Sources */, DF45B1F6116628A5009B85CC /* compare.cpp in Sources */, @@ -9685,24 +10438,19 @@ DFCDC6DB116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DC116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F811662AAB00A7D2A0 /* resource.cpp in Sources */, - DFCDC6FF11662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70511662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70C11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D141166C5CF00C90552 /* random.cpp in Sources */, DFEC5D151166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D381166C67300C90552 /* savestate.cpp in Sources */, - DFEC5D411166C6B400C90552 /* dbopl.cpp in Sources */, DF9B924A118E46730069C19D /* error.cpp in Sources */, DF9B9256118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9264118E46FE0069C19D /* error.cpp in Sources */, - DFB0576F11B753AF0015AE65 /* qt_decoder.cpp in Sources */, - DFB0577011B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577811B753DA0015AE65 /* rational.cpp in Sources */, DFB0578411B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578511B7541F0015AE65 /* util.cpp in Sources */, DFB0578C11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579311B7547D0015AE65 /* pict.cpp in Sources */, - DFB0579A11B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286311FF23D500159131 /* amigamac.cpp in Sources */, DF7F286B11FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286C11FF23EF00159131 /* workarounds.cpp in Sources */, @@ -9713,25 +10461,11 @@ DF7F288811FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288D11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289711FF247300159131 /* translation.cpp in Sources */, - DF7F28A211FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A711FF24C400159131 /* console.cpp in Sources */, - DF895BFF124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C04124C24680077F6E8 /* player_towns.cpp in Sources */, - DF895C0A124C24B60077F6E8 /* appleiigs.cpp in Sources */, - DF895C19124C24C10077F6E8 /* towns_audio.cpp in Sources */, - DF895C1A124C24C10077F6E8 /* towns_euphony.cpp in Sources */, - DF895C1B124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, - DF895C1C124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C26124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2B124C25350077F6E8 /* script_patches.cpp in Sources */, - DF895CBE124E58990077F6E8 /* indeo3.cpp in Sources */, - DF895CBF124E58990077F6E8 /* mjpeg.cpp in Sources */, - DF895CC0124E58990077F6E8 /* qdm2.cpp in Sources */, - DF895CC1124E58990077F6E8 /* qtrle.cpp in Sources */, - DF895CC2124E58990077F6E8 /* rpza.cpp in Sources */, - DF895CC3124E58990077F6E8 /* smc.cpp in Sources */, DF0E303C1252C5BD0082D593 /* cms.cpp in Sources */, - DF0E30431252C6090082D593 /* cms.cpp in Sources */, 8CB5A9C61253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9C71253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9C81253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -9739,7 +10473,6 @@ 8CB5A9CA1253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED2F126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED30126202AB00FA198C /* display.cpp in Sources */, - 8CD1ED31126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED32126202AB00FA198C /* file.cpp in Sources */, 8CD1ED33126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED34126202AB00FA198C /* intro.cpp in Sources */, @@ -9788,6 +10521,158 @@ 8CD80D01126272A0001C6C87 /* surface.cpp in Sources */, 8CD80D02126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80D03126272A0001C6C87 /* teenagent.cpp in Sources */, + DF203F471380C06E0056300A /* gui-manager.cpp in Sources */, + DF203F631380C2750056300A /* avi_decoder.cpp in Sources */, + DF203F641380C2750056300A /* coktel_decoder.cpp in Sources */, + DF203F651380C2750056300A /* dxa_decoder.cpp in Sources */, + DF203F661380C2750056300A /* flic_decoder.cpp in Sources */, + DF203F681380C2750056300A /* qt_decoder.cpp in Sources */, + DF203F691380C2750056300A /* smk_decoder.cpp in Sources */, + DF203F6A1380C2750056300A /* video_decoder.cpp in Sources */, + DF203F951380C2920056300A /* cdtoons.cpp in Sources */, + DF203F961380C2920056300A /* cinepak.cpp in Sources */, + DF203F971380C2920056300A /* indeo3.cpp in Sources */, + DF203F981380C2920056300A /* mjpeg.cpp in Sources */, + DF203F991380C2920056300A /* msrle.cpp in Sources */, + DF203F9A1380C2920056300A /* msvideo1.cpp in Sources */, + DF203F9C1380C2920056300A /* qtrle.cpp in Sources */, + DF203F9D1380C2920056300A /* rpza.cpp in Sources */, + DF203F9E1380C2920056300A /* smc.cpp in Sources */, + DF203F9F1380C2920056300A /* truemotion1.cpp in Sources */, + DF203FD51380C3BC0056300A /* console.cpp in Sources */, + DF203FD61380C3BC0056300A /* dialogs.cpp in Sources */, + DF203FD71380C3BC0056300A /* file_v1d.cpp in Sources */, + DF203FD81380C3BC0056300A /* file_v1w.cpp in Sources */, + DF203FD91380C3BC0056300A /* file_v2d.cpp in Sources */, + DF203FDA1380C3BC0056300A /* file_v2w.cpp in Sources */, + DF203FDB1380C3BC0056300A /* file_v3d.cpp in Sources */, + DF203FDC1380C3BC0056300A /* object_v1d.cpp in Sources */, + DF203FDD1380C3BC0056300A /* object_v1w.cpp in Sources */, + DF203FDE1380C3BC0056300A /* object_v2d.cpp in Sources */, + DF203FDF1380C3BC0056300A /* object_v3d.cpp in Sources */, + DF203FE01380C3BC0056300A /* object.cpp in Sources */, + DF203FE11380C3BC0056300A /* parser_v1d.cpp in Sources */, + DF203FE21380C3BC0056300A /* parser_v1w.cpp in Sources */, + DF203FE31380C3BC0056300A /* parser_v2d.cpp in Sources */, + DF203FE41380C3BC0056300A /* parser_v3d.cpp in Sources */, + DF203FE51380C3BC0056300A /* text.cpp in Sources */, + DF20402E1380C8B70056300A /* editable.cpp in Sources */, + DF20402F1380C8B70056300A /* edittext.cpp in Sources */, + DF2040301380C8B70056300A /* list.cpp in Sources */, + DF2040311380C8B70056300A /* popup.cpp in Sources */, + DF2040321380C8B70056300A /* scrollbar.cpp in Sources */, + DF2040331380C8B70056300A /* tab.cpp in Sources */, + DF20405E1380CA230056300A /* audiostream.cpp in Sources */, + DF20405F1380CA230056300A /* fmopl.cpp in Sources */, + DF2040601380CA230056300A /* mididrv.cpp in Sources */, + DF2040611380CA230056300A /* midiparser_smf.cpp in Sources */, + DF2040621380CA230056300A /* midiparser_xmidi.cpp in Sources */, + DF2040631380CA230056300A /* midiparser.cpp in Sources */, + DF2040641380CA230056300A /* midiplayer.cpp in Sources */, + DF2040651380CA230056300A /* mixer.cpp in Sources */, + DF2040661380CA230056300A /* mpu401.cpp in Sources */, + DF2040671380CA230056300A /* musicplugin.cpp in Sources */, + DF2040681380CA230056300A /* rate.cpp in Sources */, + DF2040691380CA230056300A /* timestamp.cpp in Sources */, + DF20409A1380CA400056300A /* adpcm.cpp in Sources */, + DF20409B1380CA400056300A /* aiff.cpp in Sources */, + DF20409C1380CA400056300A /* flac.cpp in Sources */, + DF20409D1380CA400056300A /* iff_sound.cpp in Sources */, + DF20409E1380CA400056300A /* mac_snd.cpp in Sources */, + DF20409F1380CA400056300A /* mp3.cpp in Sources */, + DF2040A01380CA400056300A /* raw.cpp in Sources */, + DF2040A11380CA400056300A /* vag.cpp in Sources */, + DF2040A21380CA400056300A /* voc.cpp in Sources */, + DF2040A31380CA400056300A /* vorbis.cpp in Sources */, + DF2040A41380CA400056300A /* wave.cpp in Sources */, + DF2040CC1380CA810056300A /* infogrames.cpp in Sources */, + DF2040CD1380CA810056300A /* maxtrax.cpp in Sources */, + DF2040CE1380CA810056300A /* module.cpp in Sources */, + DF2040CF1380CA810056300A /* paula.cpp in Sources */, + DF2040D01380CA810056300A /* protracker.cpp in Sources */, + DF2040D11380CA810056300A /* rjp1.cpp in Sources */, + DF2040D21380CA810056300A /* soundfx.cpp in Sources */, + DF2040D31380CA810056300A /* tfmx.cpp in Sources */, + DF2040F41380CAA40056300A /* adlib.cpp in Sources */, + DF2040F51380CAA40056300A /* appleiigs.cpp in Sources */, + DF2040F61380CAA40056300A /* cms.cpp in Sources */, + DF2040F71380CAA40056300A /* eas.cpp in Sources */, + DF2040F81380CAA40056300A /* fluidsynth.cpp in Sources */, + DF2040F91380CAA40056300A /* mt32.cpp in Sources */, + DF2040FA1380CAA40056300A /* pcspk.cpp in Sources */, + DF2040FB1380CAA40056300A /* sid.cpp in Sources */, + DF2040FC1380CAA40056300A /* wave6581.cpp in Sources */, + DF46B6F31381E18900D08723 /* coroutine.cpp in Sources */, + DF46B6FF1381E1FF00D08723 /* towns_audio.cpp in Sources */, + DF46B7001381E1FF00D08723 /* towns_euphony.cpp in Sources */, + DF46B7011381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, + DF46B7021381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, + DF46B7191381E27000D08723 /* console.cpp in Sources */, + DF46B71A1381E27000D08723 /* databases.cpp in Sources */, + DF46B71B1381E27000D08723 /* dbase.cpp in Sources */, + DF46B71C1381E27000D08723 /* iniconfig.cpp in Sources */, + DF46B71D1381E27000D08723 /* init_v7.cpp in Sources */, + DF46B71E1381E27000D08723 /* inter_inca2.cpp in Sources */, + DF46B7441381E40500D08723 /* log.cpp in Sources */, + DF46B7491381E40F00D08723 /* modular-backend.cpp in Sources */, + DF46B7541381E46700D08723 /* player_v2base.cpp in Sources */, + DF46B75E1381E4A400D08723 /* console.cpp in Sources */, + DF46B7631381E4D400D08723 /* robot_decoder.cpp in Sources */, + DF46B7671381E4E400D08723 /* vm_types.cpp in Sources */, + DF46B77B1381E54200D08723 /* dcl.cpp in Sources */, + DF46B77C1381E54200D08723 /* iff_container.cpp in Sources */, + DF46B77D1381E54200D08723 /* winexe_ne.cpp in Sources */, + DF46B77E1381E54200D08723 /* winexe_pe.cpp in Sources */, + DF46B77F1381E54200D08723 /* winexe.cpp in Sources */, + DF46B7931381E58000D08723 /* png.cpp in Sources */, + DF46B7941381E58000D08723 /* wincursor.cpp in Sources */, + DF46B79F1381E5B500D08723 /* winfont.cpp in Sources */, + DF46B7A51381E5D900D08723 /* sdl-timer.cpp in Sources */, + DF46B7A91381E5F100D08723 /* header.cpp in Sources */, + DF46B7B41381E67800D08723 /* sdl-mutex.cpp in Sources */, + DF46B7BD1381E6C000D08723 /* object.cpp in Sources */, + DF46B7C81381E72500D08723 /* console.cpp in Sources */, + DF46B7CF1381E76300D08723 /* sdl-events.cpp in Sources */, + DF46B7D61381E7C600D08723 /* console.cpp in Sources */, + DF46B83C1381F13500D08723 /* saveload_v7.cpp in Sources */, + DF46B8441381F35500D08723 /* saveload_inca2.cpp in Sources */, + DF46B8481381F38700D08723 /* inter_v7.cpp in Sources */, + DF46B84D1381F39E00D08723 /* console.cpp in Sources */, + DF46B8521381F3B400D08723 /* console.cpp in Sources */, + DF46B8601381F44E00D08723 /* dbopl.cpp in Sources */, + DF46B8611381F44E00D08723 /* dosbox.cpp in Sources */, + DF46B8621381F44E00D08723 /* mame.cpp in Sources */, + DF46B8711381F4A200D08723 /* sdl-audiocd.cpp in Sources */, + DF46B87D1381F4F200D08723 /* default-audiocd.cpp in Sources */, + DF46B8891381F5D800D08723 /* sdl-provider.cpp in Sources */, + DF46B8921381F62B00D08723 /* adpcm.cpp in Sources */, + DF46B89B1381F6C400D08723 /* null.cpp in Sources */, + DFADEBB313820DF500C46364 /* maccursor.cpp in Sources */, + DFADEBB713820E0C00C46364 /* posix-fs.cpp in Sources */, + F92B4DCF139DD428000D1BF1 /* quicktime.cpp in Sources */, + F92B4DD4139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */, + F92B4DDA139DDC92000D1BF1 /* macosx-main.cpp in Sources */, + F92B4DDB139DDC92000D1BF1 /* macosx.cpp in Sources */, + F9946D9E139E1A560072D195 /* towns_midi.cpp in Sources */, + F9946DA1139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */, + F9946DB6139E1A880072D195 /* freeverb.cpp in Sources */, + F9946DB9139E1A880072D195 /* i386.cpp in Sources */, + F9946DBC139E1A880072D195 /* mt32_file.cpp in Sources */, + F9946DBF139E1A880072D195 /* part.cpp in Sources */, + F9946DC2139E1A880072D195 /* partial.cpp in Sources */, + F9946DC5139E1A880072D195 /* partialManager.cpp in Sources */, + F9946DC8139E1A880072D195 /* synth.cpp in Sources */, + F9946DCB139E1A880072D195 /* tables.cpp in Sources */, + F9946DD7139E1AD30072D195 /* aac.cpp in Sources */, + F9946DDA139E1AD30072D195 /* qdm2.cpp in Sources */, + F9946DDD139E1AD30072D195 /* quicktime.cpp in Sources */, + F9946DE4139E1B180072D195 /* posix-main.cpp in Sources */, + F9946DE7139E1B180072D195 /* posix.cpp in Sources */, + F9946DED139E1B6F0072D195 /* downscaler.cpp in Sources */, + F9946DF2139E1BA00072D195 /* console.cpp in Sources */, + F9946DF8139E1BBF0072D195 /* sdl-mixer.cpp in Sources */, + F9946DFF139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */, + F9946E05139E1C390072D195 /* sdl-graphics.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -9824,7 +10709,6 @@ DFF959320FB22D5700A3EC78 /* consolefont.cpp in Sources */, DFF959330FB22D5700A3EC78 /* newfont.cpp in Sources */, DFF959340FB22D5700A3EC78 /* newfont_big.cpp in Sources */, - DFF959350FB22D5700A3EC78 /* scummfont.cpp in Sources */, DFF959360FB22D5700A3EC78 /* iff.cpp in Sources */, DFF959370FB22D5700A3EC78 /* imagedec.cpp in Sources */, DFF959380FB22D5700A3EC78 /* primitives.cpp in Sources */, @@ -9836,49 +10720,20 @@ DFF9593E0FB22D5700A3EC78 /* console.cpp in Sources */, DFF9593F0FB22D5700A3EC78 /* debugger.cpp in Sources */, DFF959400FB22D5700A3EC78 /* dialog.cpp in Sources */, - DFF959410FB22D5700A3EC78 /* editable.cpp in Sources */, - DFF959420FB22D5700A3EC78 /* EditTextWidget.cpp in Sources */, DFF959430FB22D5700A3EC78 /* Key.cpp in Sources */, DFF959440FB22D5700A3EC78 /* launcher.cpp in Sources */, - DFF959450FB22D5700A3EC78 /* ListWidget.cpp in Sources */, DFF959460FB22D5700A3EC78 /* massadd.cpp in Sources */, DFF959470FB22D5700A3EC78 /* message.cpp in Sources */, DFF959480FB22D5700A3EC78 /* object.cpp in Sources */, DFF959490FB22D5700A3EC78 /* options.cpp in Sources */, - DFF9594A0FB22D5700A3EC78 /* PopUpWidget.cpp in Sources */, - DFF9594B0FB22D5700A3EC78 /* ScrollBarWidget.cpp in Sources */, - DFF9594C0FB22D5700A3EC78 /* TabWidget.cpp in Sources */, DFF9594D0FB22D5700A3EC78 /* themebrowser.cpp in Sources */, DFF9594E0FB22D5700A3EC78 /* widget.cpp in Sources */, - DFF959510FB22D5700A3EC78 /* audiocd.cpp in Sources */, - DFF959520FB22D5700A3EC78 /* audiostream.cpp in Sources */, - DFF959540FB22D5700A3EC78 /* fmopl.cpp in Sources */, - DFF959560FB22D5700A3EC78 /* mididrv.cpp in Sources */, - DFF959570FB22D5700A3EC78 /* midiparser.cpp in Sources */, - DFF959580FB22D5700A3EC78 /* midiparser_smf.cpp in Sources */, - DFF959590FB22D5700A3EC78 /* midiparser_xmidi.cpp in Sources */, - DFF9595A0FB22D5700A3EC78 /* mixer.cpp in Sources */, - DFF9595B0FB22D5700A3EC78 /* infogrames.cpp in Sources */, - DFF9595C0FB22D5700A3EC78 /* module.cpp in Sources */, - DFF9595D0FB22D5700A3EC78 /* paula.cpp in Sources */, - DFF9595E0FB22D5700A3EC78 /* protracker.cpp in Sources */, - DFF9595F0FB22D5700A3EC78 /* rjp1.cpp in Sources */, - DFF959600FB22D5700A3EC78 /* soundfx.cpp in Sources */, - DFF959620FB22D5700A3EC78 /* mpu401.cpp in Sources */, - DFF959630FB22D5700A3EC78 /* null.cpp in Sources */, - DFF959640FB22D5700A3EC78 /* rate.cpp in Sources */, - DFF959650FB22D5700A3EC78 /* adlib.cpp in Sources */, - DFF959660FB22D5700A3EC78 /* fluidsynth.cpp in Sources */, - DFF959670FB22D5700A3EC78 /* pcspk.cpp in Sources */, - DFF959680FB22D5700A3EC78 /* ym2612.cpp in Sources */, DFF9596C0FB22D5700A3EC78 /* memorypool.cpp in Sources */, DFF9596D0FB22D5700A3EC78 /* seq.cpp in Sources */, DFF9596E0FB22D5700A3EC78 /* scaler.cpp in Sources */, DFF9596F0FB22D5700A3EC78 /* scalebit.cpp in Sources */, DFF959700FB22D5700A3EC78 /* 2xsai.cpp in Sources */, DFF959710FB22D5700A3EC78 /* aspect.cpp in Sources */, - DFF959720FB22D5700A3EC78 /* hq2x.cpp in Sources */, - DFF959730FB22D5700A3EC78 /* hq3x.cpp in Sources */, DFF959740FB22D5700A3EC78 /* scale2x.cpp in Sources */, DFF959750FB22D5700A3EC78 /* scale3x.cpp in Sources */, DFF959760FB22D5700A3EC78 /* iphone_keyboard.m in Sources */, @@ -10501,7 +11356,6 @@ DFF95C0F0FB22D5700A3EC78 /* archive.cpp in Sources */, DFF95C100FB22D5700A3EC78 /* unarj.cpp in Sources */, DFF95C110FB22D5700A3EC78 /* stdiostream.cpp in Sources */, - DFF95C120FB22D5700A3EC78 /* musicplugin.cpp in Sources */, DFF95C130FB22D5700A3EC78 /* saveload.cpp in Sources */, DFF95C140FB22D5700A3EC78 /* ThemeEngine.cpp in Sources */, DFF95C150FB22D5700A3EC78 /* ThemeEval.cpp in Sources */, @@ -10518,7 +11372,6 @@ DFF95C200FB22D5700A3EC78 /* thumbnail_intern.cpp in Sources */, DFF95C210FB22D5700A3EC78 /* dither.cpp in Sources */, DFF95C270FB22D5700A3EC78 /* debug.cpp in Sources */, - DFF95C280FB22D5700A3EC78 /* gui-manager.hcpp in Sources */, DFF95C290FB22D5700A3EC78 /* posix-saves.cpp in Sources */, DFF95C2A0FB22D5700A3EC78 /* bmv.cpp in Sources */, DFF95C2B0FB22D5700A3EC78 /* dialogs.cpp in Sources */, @@ -10590,7 +11443,6 @@ DFF95C920FB22D5700A3EC78 /* timer_lol.cpp in Sources */, DFF95C940FB22D5700A3EC78 /* sprites_lol.cpp in Sources */, DFF95C950FB22D5700A3EC78 /* script.cpp in Sources */, - DFF95C980FB22D5700A3EC78 /* timestamp.cpp in Sources */, DFF95C990FB22D5700A3EC78 /* pn.cpp in Sources */, DFF95C9A0FB22D5700A3EC78 /* script_pn.cpp in Sources */, DFF95C9B0FB22D5700A3EC78 /* vga_pn.cpp in Sources */, @@ -10605,20 +11457,15 @@ DFF95CB30FB22D5700A3EC78 /* inter_fascin.cpp in Sources */, DFF95CB40FB22D5700A3EC78 /* script_v3.cpp in Sources */, DFF95CB50FB22D5700A3EC78 /* script_v4.cpp in Sources */, - DFF95CB70FB22D5700A3EC78 /* dosbox.cpp in Sources */, DF6118400FE3A8080042AD3F /* kmisc.cpp in Sources */, DF6118410FE3A8080042AD3F /* segment.cpp in Sources */, DF61184F0FE3A8250042AD3F /* decompressor.cpp in Sources */, DF6118500FE3A8250042AD3F /* resource.cpp in Sources */, DF6118570FE3A8990042AD3F /* disk.cpp in Sources */, - DF6118720FE3A9410042AD3F /* dxa_decoder.cpp in Sources */, - DF6118730FE3A9410042AD3F /* flic_decoder.cpp in Sources */, - DF6118740FE3A9410042AD3F /* smk_decoder.cpp in Sources */, DF6118A10FE3A9AA0042AD3F /* saveconverter.cpp in Sources */, DF6118A20FE3A9AA0042AD3F /* saveconverter_v2.cpp in Sources */, DF6118A30FE3A9AA0042AD3F /* saveconverter_v3.cpp in Sources */, DF6118A40FE3A9AA0042AD3F /* saveconverter_v4.cpp in Sources */, - DF6118A50FE3A9AA0042AD3F /* saveconverter_v6.cpp in Sources */, DF6118A60FE3A9AA0042AD3F /* savefile.cpp in Sources */, DF6118A70FE3A9AA0042AD3F /* savehandler.cpp in Sources */, DF6118A80FE3A9AA0042AD3F /* saveload.cpp in Sources */, @@ -10632,7 +11479,6 @@ DF6118C20FE3AA280042AD3F /* sound_pcspk.cpp in Sources */, DF6118C30FE3AA280042AD3F /* text_lol.cpp in Sources */, DF6118C90FE3AABD0042AD3F /* player_v2cms.cpp in Sources */, - DF6118D20FE3AB560042AD3F /* mame.cpp in Sources */, DF7585D4100CB66E00CC3324 /* expression.cpp in Sources */, DF7585D5100CB66E00CC3324 /* hotspots.cpp in Sources */, DF7585D6100CB66E00CC3324 /* init_v6.cpp in Sources */, @@ -10657,31 +11503,15 @@ DF6BF4F310529EE40069811F /* player_v4a.cpp in Sources */, DF6BF4FC10529F140069811F /* EventDispatcher.cpp in Sources */, DF6BF4FD10529F140069811F /* EventRecorder.cpp in Sources */, - DF6BF50610529F540069811F /* maxtrax.cpp in Sources */, - DF6BF50710529F540069811F /* tfmx.cpp in Sources */, DF90E9C110AEDA9B00C8F93F /* selector.cpp in Sources */, DF90EAA510B0234300C8F93F /* draw_playtoons.cpp in Sources */, DF90EAAE10B0236F00C8F93F /* staticres.cpp in Sources */, - DF90EAB910B023D100C8F93F /* avi_decoder.cpp in Sources */, - DF90EAC410B023F400C8F93F /* msvideo1.cpp in Sources */, DF2EC3FA10E64C0C00765801 /* dialogs.cpp in Sources */, DF2EC40010E64C4300765801 /* animator_tim.cpp in Sources */, DF2EC40710E64C8000765801 /* event.cpp in Sources */, DF2EC50510E64D7C00765801 /* player_pce.cpp in Sources */, DF2EC50610E64D7C00765801 /* player_sid.cpp in Sources */, DF2EC50D10E64DB300765801 /* textconsole.cpp in Sources */, - DF2EC51410E64E3100765801 /* sid.cpp in Sources */, - DF2EC51A10E64EE600765801 /* wave6581.cpp in Sources */, - DF45B15B116627DA009B85CC /* adpcm.cpp in Sources */, - DF45B15D116627DA009B85CC /* aiff.cpp in Sources */, - DF45B15F116627DA009B85CC /* flac.cpp in Sources */, - DF45B161116627DA009B85CC /* iff_sound.cpp in Sources */, - DF45B163116627DA009B85CC /* mp3.cpp in Sources */, - DF45B165116627DA009B85CC /* raw.cpp in Sources */, - DF45B167116627DA009B85CC /* vag.cpp in Sources */, - DF45B169116627DA009B85CC /* voc.cpp in Sources */, - DF45B16B116627DA009B85CC /* vorbis.cpp in Sources */, - DF45B16D116627DA009B85CC /* wave.cpp in Sources */, DF45B21E116628A5009B85CC /* animate.cpp in Sources */, DF45B21F116628A5009B85CC /* cache.cpp in Sources */, DF45B220116628A5009B85CC /* compare.cpp in Sources */, @@ -10715,24 +11545,19 @@ DFCDC6DD116629CE00A7D2A0 /* features.cpp in Sources */, DFCDC6DE116629CE00A7D2A0 /* kparse.cpp in Sources */, DFCDC6F911662AAB00A7D2A0 /* resource.cpp in Sources */, - DFCDC70011662AD700A7D2A0 /* msrle.cpp in Sources */, DFCDC70611662B0200A7D2A0 /* saveload_fascin.cpp in Sources */, DFCDC70D11662B6B00A7D2A0 /* macresman.cpp in Sources */, DFEC5D101166C5CF00C90552 /* random.cpp in Sources */, DFEC5D111166C5CF00C90552 /* tokenizer.cpp in Sources */, DFEC5D361166C67300C90552 /* savestate.cpp in Sources */, - DFEC5D3F1166C6B400C90552 /* dbopl.cpp in Sources */, DF9B9248118E46730069C19D /* error.cpp in Sources */, DF9B9252118E46A00069C19D /* fontsjis.cpp in Sources */, DF9B9262118E46FE0069C19D /* error.cpp in Sources */, - DFB0576911B753AF0015AE65 /* qt_decoder.cpp in Sources */, - DFB0576A11B753AF0015AE65 /* video_decoder.cpp in Sources */, DFB0577611B753DA0015AE65 /* rational.cpp in Sources */, DFB0578011B7541F0015AE65 /* resource_audio.cpp in Sources */, DFB0578111B7541F0015AE65 /* util.cpp in Sources */, DFB0578A11B754570015AE65 /* maciconbar.cpp in Sources */, DFB0579111B7547D0015AE65 /* pict.cpp in Sources */, - DFB0579811B7549C0015AE65 /* cinepak.cpp in Sources */, DF7F286111FF23D500159131 /* amigamac.cpp in Sources */, DF7F286711FF23EF00159131 /* kvideo.cpp in Sources */, DF7F286811FF23EF00159131 /* workarounds.cpp in Sources */, @@ -10743,25 +11568,11 @@ DF7F287E11FF243B00159131 /* sound_sarien.cpp in Sources */, DF7F288B11FF244F00159131 /* Tooltip.cpp in Sources */, DF7F289311FF247300159131 /* translation.cpp in Sources */, - DF7F28A011FF24B000159131 /* mac_snd.cpp in Sources */, DF7F28A511FF24C400159131 /* console.cpp in Sources */, - DF895C00124C24350077F6E8 /* coktel_decoder.cpp in Sources */, DF895C05124C24680077F6E8 /* player_towns.cpp in Sources */, - DF895C0B124C24B60077F6E8 /* appleiigs.cpp in Sources */, - DF895C1D124C24C10077F6E8 /* towns_audio.cpp in Sources */, - DF895C1E124C24C10077F6E8 /* towns_euphony.cpp in Sources */, - DF895C1F124C24C10077F6E8 /* towns_pc98_driver.cpp in Sources */, - DF895C20124C24C10077F6E8 /* towns_pc98_fmsynth.cpp in Sources */, DF895C27124C25150077F6E8 /* init_fascin.cpp in Sources */, DF895C2C124C25350077F6E8 /* script_patches.cpp in Sources */, - DF895CC4124E58990077F6E8 /* indeo3.cpp in Sources */, - DF895CC5124E58990077F6E8 /* mjpeg.cpp in Sources */, - DF895CC6124E58990077F6E8 /* qdm2.cpp in Sources */, - DF895CC7124E58990077F6E8 /* qtrle.cpp in Sources */, - DF895CC8124E58990077F6E8 /* rpza.cpp in Sources */, - DF895CC9124E58990077F6E8 /* smc.cpp in Sources */, DF0E303A1252C5BD0082D593 /* cms.cpp in Sources */, - DF0E30411252C6090082D593 /* cms.cpp in Sources */, 8CB5A9C11253FD6900CB6BC7 /* m4_scene.cpp in Sources */, 8CB5A9C21253FD6900CB6BC7 /* mads_logic.cpp in Sources */, 8CB5A9C31253FD6900CB6BC7 /* mads_player.cpp in Sources */, @@ -10769,7 +11580,6 @@ 8CB5A9C51253FD6900CB6BC7 /* mads_views.cpp in Sources */, 8CD1ED0B126202AB00FA198C /* detection.cpp in Sources */, 8CD1ED0C126202AB00FA198C /* display.cpp in Sources */, - 8CD1ED0D126202AB00FA198C /* engine.cpp in Sources */, 8CD1ED0E126202AB00FA198C /* file.cpp in Sources */, 8CD1ED0F126202AB00FA198C /* hugo.cpp in Sources */, 8CD1ED10126202AB00FA198C /* intro.cpp in Sources */, @@ -10818,6 +11628,154 @@ 8CD80CEF126272A0001C6C87 /* surface.cpp in Sources */, 8CD80CF0126272A0001C6C87 /* surface_list.cpp in Sources */, 8CD80CF1126272A0001C6C87 /* teenagent.cpp in Sources */, + DF203F491380C06E0056300A /* gui-manager.cpp in Sources */, + DF203F731380C2750056300A /* avi_decoder.cpp in Sources */, + DF203F741380C2750056300A /* coktel_decoder.cpp in Sources */, + DF203F751380C2750056300A /* dxa_decoder.cpp in Sources */, + DF203F761380C2750056300A /* flic_decoder.cpp in Sources */, + DF203F781380C2750056300A /* qt_decoder.cpp in Sources */, + DF203F791380C2750056300A /* smk_decoder.cpp in Sources */, + DF203F7A1380C2750056300A /* video_decoder.cpp in Sources */, + DF203FAB1380C2920056300A /* cdtoons.cpp in Sources */, + DF203FAC1380C2920056300A /* cinepak.cpp in Sources */, + DF203FAD1380C2920056300A /* indeo3.cpp in Sources */, + DF203FAE1380C2920056300A /* mjpeg.cpp in Sources */, + DF203FAF1380C2920056300A /* msrle.cpp in Sources */, + DF203FB01380C2920056300A /* msvideo1.cpp in Sources */, + DF203FB21380C2920056300A /* qtrle.cpp in Sources */, + DF203FB31380C2920056300A /* rpza.cpp in Sources */, + DF203FB41380C2920056300A /* smc.cpp in Sources */, + DF203FB51380C2920056300A /* truemotion1.cpp in Sources */, + DF203FF71380C3BC0056300A /* console.cpp in Sources */, + DF203FF81380C3BC0056300A /* dialogs.cpp in Sources */, + DF203FF91380C3BC0056300A /* file_v1d.cpp in Sources */, + DF203FFA1380C3BC0056300A /* file_v1w.cpp in Sources */, + DF203FFB1380C3BC0056300A /* file_v2d.cpp in Sources */, + DF203FFC1380C3BC0056300A /* file_v2w.cpp in Sources */, + DF203FFD1380C3BC0056300A /* file_v3d.cpp in Sources */, + DF203FFE1380C3BC0056300A /* object_v1d.cpp in Sources */, + DF203FFF1380C3BC0056300A /* object_v1w.cpp in Sources */, + DF2040001380C3BC0056300A /* object_v2d.cpp in Sources */, + DF2040011380C3BC0056300A /* object_v3d.cpp in Sources */, + DF2040021380C3BC0056300A /* object.cpp in Sources */, + DF2040031380C3BC0056300A /* parser_v1d.cpp in Sources */, + DF2040041380C3BC0056300A /* parser_v1w.cpp in Sources */, + DF2040051380C3BC0056300A /* parser_v2d.cpp in Sources */, + DF2040061380C3BC0056300A /* parser_v3d.cpp in Sources */, + DF2040071380C3BC0056300A /* text.cpp in Sources */, + DF20403A1380C8B70056300A /* editable.cpp in Sources */, + DF20403B1380C8B70056300A /* edittext.cpp in Sources */, + DF20403C1380C8B70056300A /* list.cpp in Sources */, + DF20403D1380C8B70056300A /* popup.cpp in Sources */, + DF20403E1380C8B70056300A /* scrollbar.cpp in Sources */, + DF20403F1380C8B70056300A /* tab.cpp in Sources */, + DF2040761380CA230056300A /* audiostream.cpp in Sources */, + DF2040771380CA230056300A /* fmopl.cpp in Sources */, + DF2040781380CA230056300A /* mididrv.cpp in Sources */, + DF2040791380CA230056300A /* midiparser_smf.cpp in Sources */, + DF20407A1380CA230056300A /* midiparser_xmidi.cpp in Sources */, + DF20407B1380CA230056300A /* midiparser.cpp in Sources */, + DF20407C1380CA230056300A /* midiplayer.cpp in Sources */, + DF20407D1380CA230056300A /* mixer.cpp in Sources */, + DF20407E1380CA230056300A /* mpu401.cpp in Sources */, + DF20407F1380CA230056300A /* musicplugin.cpp in Sources */, + DF2040801380CA230056300A /* rate.cpp in Sources */, + DF2040811380CA230056300A /* timestamp.cpp in Sources */, + DF2040B01380CA400056300A /* adpcm.cpp in Sources */, + DF2040B11380CA400056300A /* aiff.cpp in Sources */, + DF2040B21380CA400056300A /* flac.cpp in Sources */, + DF2040B31380CA400056300A /* iff_sound.cpp in Sources */, + DF2040B41380CA400056300A /* mac_snd.cpp in Sources */, + DF2040B51380CA400056300A /* mp3.cpp in Sources */, + DF2040B61380CA400056300A /* raw.cpp in Sources */, + DF2040B71380CA400056300A /* vag.cpp in Sources */, + DF2040B81380CA400056300A /* voc.cpp in Sources */, + DF2040B91380CA400056300A /* vorbis.cpp in Sources */, + DF2040BA1380CA400056300A /* wave.cpp in Sources */, + DF2040DC1380CA810056300A /* infogrames.cpp in Sources */, + DF2040DD1380CA810056300A /* maxtrax.cpp in Sources */, + DF2040DE1380CA810056300A /* module.cpp in Sources */, + DF2040DF1380CA810056300A /* paula.cpp in Sources */, + DF2040E01380CA810056300A /* protracker.cpp in Sources */, + DF2040E11380CA810056300A /* rjp1.cpp in Sources */, + DF2040E21380CA810056300A /* soundfx.cpp in Sources */, + DF2040E31380CA810056300A /* tfmx.cpp in Sources */, + DF2041081380CAA40056300A /* adlib.cpp in Sources */, + DF2041091380CAA40056300A /* appleiigs.cpp in Sources */, + DF20410A1380CAA40056300A /* cms.cpp in Sources */, + DF20410B1380CAA40056300A /* eas.cpp in Sources */, + DF20410C1380CAA40056300A /* fluidsynth.cpp in Sources */, + DF20410D1380CAA40056300A /* mt32.cpp in Sources */, + DF20410E1380CAA40056300A /* pcspk.cpp in Sources */, + DF20410F1380CAA40056300A /* sid.cpp in Sources */, + DF2041101380CAA40056300A /* wave6581.cpp in Sources */, + DF46B6F51381E18900D08723 /* coroutine.cpp in Sources */, + DF46B7071381E1FF00D08723 /* towns_audio.cpp in Sources */, + DF46B7081381E1FF00D08723 /* towns_euphony.cpp in Sources */, + DF46B7091381E1FF00D08723 /* towns_pc98_driver.cpp in Sources */, + DF46B70A1381E1FF00D08723 /* towns_pc98_fmsynth.cpp in Sources */, + DF46B7251381E27000D08723 /* console.cpp in Sources */, + DF46B7261381E27000D08723 /* databases.cpp in Sources */, + DF46B7271381E27000D08723 /* dbase.cpp in Sources */, + DF46B7281381E27000D08723 /* iniconfig.cpp in Sources */, + DF46B7291381E27000D08723 /* init_v7.cpp in Sources */, + DF46B72A1381E27000D08723 /* inter_inca2.cpp in Sources */, + DF46B7461381E40500D08723 /* log.cpp in Sources */, + DF46B74B1381E40F00D08723 /* modular-backend.cpp in Sources */, + DF46B7561381E46700D08723 /* player_v2base.cpp in Sources */, + DF46B7601381E4A400D08723 /* console.cpp in Sources */, + DF46B7651381E4D400D08723 /* robot_decoder.cpp in Sources */, + DF46B7691381E4E400D08723 /* vm_types.cpp in Sources */, + DF46B7851381E54200D08723 /* dcl.cpp in Sources */, + DF46B7861381E54200D08723 /* iff_container.cpp in Sources */, + DF46B7871381E54200D08723 /* winexe_ne.cpp in Sources */, + DF46B7881381E54200D08723 /* winexe_pe.cpp in Sources */, + DF46B7891381E54200D08723 /* winexe.cpp in Sources */, + DF46B7971381E58000D08723 /* png.cpp in Sources */, + DF46B7981381E58000D08723 /* wincursor.cpp in Sources */, + DF46B7A11381E5B500D08723 /* winfont.cpp in Sources */, + DF46B7AB1381E5F100D08723 /* header.cpp in Sources */, + DF46B7B61381E67800D08723 /* sdl-mutex.cpp in Sources */, + DF46B7BF1381E6C000D08723 /* object.cpp in Sources */, + DF46B7CA1381E72500D08723 /* console.cpp in Sources */, + DF46B7D81381E7C600D08723 /* console.cpp in Sources */, + DF46B83E1381F13500D08723 /* saveload_v7.cpp in Sources */, + DF46B8461381F35500D08723 /* saveload_inca2.cpp in Sources */, + DF46B84A1381F38700D08723 /* inter_v7.cpp in Sources */, + DF46B84F1381F39E00D08723 /* console.cpp in Sources */, + DF46B8541381F3B400D08723 /* console.cpp in Sources */, + DF46B8661381F44E00D08723 /* dbopl.cpp in Sources */, + DF46B8671381F44E00D08723 /* dosbox.cpp in Sources */, + DF46B8681381F44E00D08723 /* mame.cpp in Sources */, + DF46B8731381F4A200D08723 /* sdl-audiocd.cpp in Sources */, + DF46B87F1381F4F200D08723 /* default-audiocd.cpp in Sources */, + DF46B88B1381F5D800D08723 /* sdl-provider.cpp in Sources */, + DF46B8941381F62B00D08723 /* adpcm.cpp in Sources */, + DF46B89D1381F6C400D08723 /* null.cpp in Sources */, + DFADEBB513820DF500C46364 /* maccursor.cpp in Sources */, + DFADEBB913820E0C00C46364 /* posix-fs.cpp in Sources */, + F92B4DD0139DD428000D1BF1 /* quicktime.cpp in Sources */, + F92B4DD5139DD449000D1BF1 /* yuv_to_rgb.cpp in Sources */, + F9946D9F139E1A560072D195 /* towns_midi.cpp in Sources */, + F9946DA2139E1A560072D195 /* towns_pc98_plugins.cpp in Sources */, + F9946DB7139E1A880072D195 /* freeverb.cpp in Sources */, + F9946DBA139E1A880072D195 /* i386.cpp in Sources */, + F9946DBD139E1A880072D195 /* mt32_file.cpp in Sources */, + F9946DC0139E1A880072D195 /* part.cpp in Sources */, + F9946DC3139E1A880072D195 /* partial.cpp in Sources */, + F9946DC6139E1A880072D195 /* partialManager.cpp in Sources */, + F9946DC9139E1A880072D195 /* synth.cpp in Sources */, + F9946DCC139E1A880072D195 /* tables.cpp in Sources */, + F9946DD8139E1AD30072D195 /* aac.cpp in Sources */, + F9946DDB139E1AD30072D195 /* qdm2.cpp in Sources */, + F9946DDE139E1AD30072D195 /* quicktime.cpp in Sources */, + F9946DE5139E1B180072D195 /* posix-main.cpp in Sources */, + F9946DE8139E1B180072D195 /* posix.cpp in Sources */, + F9946DEE139E1B6F0072D195 /* downscaler.cpp in Sources */, + F9946DF3139E1BA00072D195 /* console.cpp in Sources */, + F9946DF9139E1BBF0072D195 /* sdl-mixer.cpp in Sources */, + F9946E00139E1BEB0072D195 /* doublebuffersdl-mixer.cpp in Sources */, + F9946E06139E1C3A0072D195 /* sdl-graphics.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -10843,6 +11801,44 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + IPHONE_OFFICIAL, + IPHONE, + POSIX, + ENABLE_SCUMM, + ENABLE_SCUMM_7_8, + ENABLE_HE, + ENABLE_AGI, + ENABLE_AGOS, + ENABLE_CINE, + ENABLE_CRUISE, + ENABLE_DRASCULA, + ENABLE_GOB, + ENABLE_GROOVIE, + ENABLE_IGOR, + ENABLE_KYRA, + ENABLE_LURE, + ENABLE_MADE, + ENABLE_PARALLACTION, + ENABLE_QUEEN, + ENABLE_SAGA, + ENABLE_IHNM, + ENABLE_SCI, + ENABLE_SKY, + ENABLE_SWORD1, + ENABLE_SWORD2, + ENABLE_TEENAGENT, + ENABLE_TINSEL, + ENABLE_TOUCHE, + ENABLE_TUCKER, + USE_FLAC, + USE_MAD, + USE_TREMOR, + USE_VORBIS, + USE_ZLIB, + USE_TREMOR, + USE_TRANSLATION, + ); GCC_THUMB_SUPPORT = NO; GCC_UNROLL_LOOPS = YES; HEADER_SEARCH_PATHS = ( @@ -10851,6 +11847,7 @@ include/, ); INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/lib\"", @@ -10858,10 +11855,11 @@ ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; PRODUCT_NAME = ScummVM; - PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; + PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos4.0; + SDKROOT = iphoneos4.2; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv6 armv7"; }; name = Debug; }; @@ -10883,49 +11881,10 @@ GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; - GCC_THUMB_SUPPORT = NO; - GCC_UNROLL_LOOPS = YES; - HEADER_SEARCH_PATHS = ( - ../../engines/, - ../../, - include/, - ); - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/lib\"", - ); - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - PRODUCT_NAME = ScummVM; - PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos3.2; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = ""; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_INPUT_FILETYPE = automatic; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - CONFIG_H, IPHONE_OFFICIAL, IPHONE, POSIX, - SCUMM_LITTLE_ENDIAN, - SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -10957,7 +11916,48 @@ USE_TREMOR, USE_VORBIS, USE_ZLIB, + USE_TREMOR, + USE_TRANSLATION, + ); + GCC_THUMB_SUPPORT = NO; + GCC_UNROLL_LOOPS = YES; + HEADER_SEARCH_PATHS = ( + ../../engines/, + ../../, + include/, ); + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 3.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/lib\"", + ); + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + PRODUCT_NAME = ScummVM; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv6 armv7"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CODE_SIGN_IDENTITY = "Don't Code Sign"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_CPP_EXCEPTIONS = NO; + GCC_ENABLE_CPP_RTTI = NO; + GCC_INPUT_FILETYPE = automatic; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_THUMB_SUPPORT = NO; GCC_USE_GCC3_PFE_SUPPORT = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -10966,16 +11966,16 @@ ../../engines/, ../../, ); + IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ""; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-lz"; PREBINDING = NO; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphoneos4.0; + SDKROOT = ""; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64 armv6 armv7"; + VALID_ARCHS = "i386 ppc ppc64 x86_64 armv6 armv7"; + WARNING_CFLAGS = "-Wno-multichar"; }; name = Debug; }; @@ -10983,91 +11983,40 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CODE_SIGN_IDENTITY = "Don't Code Sign"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_EXCEPTIONS = NO; GCC_INPUT_FILETYPE = automatic; - GCC_PREPROCESSOR_DEFINITIONS = ( - CONFIG_H, - IPHONE_OFFICIAL, - IPHONE, - POSIX, - SCUMM_LITTLE_ENDIAN, - SCUMM_NEED_ALIGNMENT, - ENABLE_SCUMM, - ENABLE_SCUMM_7_8, - ENABLE_HE, - ENABLE_AGI, - ENABLE_AGOS, - ENABLE_CINE, - ENABLE_CRUISE, - ENABLE_DRASCULA, - ENABLE_GOB, - ENABLE_GROOVIE, - ENABLE_IGOR, - ENABLE_KYRA, - ENABLE_LURE, - ENABLE_MADE, - ENABLE_PARALLACTION, - ENABLE_QUEEN, - ENABLE_SAGA, - ENABLE_IHNM, - ENABLE_SCI, - ENABLE_SKY, - ENABLE_SWORD1, - ENABLE_SWORD2, - ENABLE_TEENAGENT, - ENABLE_TINSEL, - ENABLE_TOUCHE, - ENABLE_TUCKER, - USE_FLAC, - USE_MAD, - USE_TREMOR, - USE_VORBIS, - USE_ZLIB, - ); + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_THUMB_SUPPORT = NO; GCC_USE_GCC3_PFE_SUPPORT = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; HEADER_SEARCH_PATHS = ( - /opt/local/include/SDL, - /opt/local/include, - /sw/include/SDL, - /sw/include, ../../engines/, ../../, ); + IPHONEOS_DEPLOYMENT_TARGET = 3.0; LIBRARY_SEARCH_PATHS = ""; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lSDLmain", - "-logg", - "-lvorbisfile", - "-lvorbis", - "-lmad", - "-lFLAC", - "-lSDL", - "-lz", - ); + OTHER_LDFLAGS = ""; PREBINDING = NO; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphonesimulator3.2; + SDKROOT = ""; TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64 armv6 armv7"; + VALID_ARCHS = "i386 ppc ppc64 x86_64 armv6 armv7"; + WARNING_CFLAGS = "-Wno-multichar"; }; name = Release; }; DF0942280F63CB26002D821E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -11078,12 +12027,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( - CONFIG_H, MACOSX, SDL_BACKEND, POSIX, - SCUMM_LITTLE_ENDIAN, - SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -11112,9 +12058,9 @@ ENABLE_TUCKER, USE_FLAC, USE_MAD, - USE_TREMOR, USE_VORBIS, USE_ZLIB, + USE_TRANSLATION, ); GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( @@ -11122,7 +12068,6 @@ /opt/local/include, /sw/include/SDL, /sw/include, - include/, ../../engines/, ../../, ); @@ -11132,7 +12077,8 @@ /opt/local/lib, "$(inherited)", ); - ONLY_ACTIVE_ARCH = NO; + MACOSX_DEPLOYMENT_TARGET = 10.4; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-lSDLmain", @@ -11146,15 +12092,16 @@ ); PREBINDING = NO; PRODUCT_NAME = ScummVM; - SDKROOT = macosx10.6; - VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; + SDKROOT = ""; + VALID_ARCHS = "i386 ppc ppc64 x86_64"; + WARNING_CFLAGS = "-Wno-multichar"; }; name = Debug; }; DF0942290F63CB26002D821E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -11163,12 +12110,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( - CONFIG_H, MACOSX, SDL_BACKEND, POSIX, - SCUMM_LITTLE_ENDIAN, - SCUMM_NEED_ALIGNMENT, ENABLE_SCUMM, ENABLE_SCUMM_7_8, ENABLE_HE, @@ -11197,9 +12141,9 @@ ENABLE_TUCKER, USE_FLAC, USE_MAD, - USE_TREMOR, USE_VORBIS, USE_ZLIB, + USE_TRANSLATION, ); GCC_VERSION = ""; HEADER_SEARCH_PATHS = ( @@ -11216,7 +12160,8 @@ /opt/local/lib, "$(inherited)", ); - ONLY_ACTIVE_ARCH = NO; + MACOSX_DEPLOYMENT_TARGET = 10.4; + ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-lSDLmain", @@ -11230,8 +12175,9 @@ ); PREBINDING = NO; PRODUCT_NAME = ScummVM; - SDKROOT = macosx10.6; - VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; + SDKROOT = ""; + VALID_ARCHS = "i386 ppc ppc64 x86_64"; + WARNING_CFLAGS = "-Wno-multichar"; WRAPPER_EXTENSION = app; }; name = Release; @@ -11239,6 +12185,7 @@ DFF95CC80FB22D5700A3EC78 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COMPRESS_PNG_FILES = NO; @@ -11267,6 +12214,7 @@ /opt/local/lib, "$(inherited)", ); + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lSDLmain", "-logg", @@ -11281,13 +12229,15 @@ PRODUCT_NAME = ScummVM; PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphonesimulator3.2; + SDKROOT = iphoneos; + VALID_ARCHS = "i386 x86_64"; }; name = Debug; }; DFF95CC90FB22D5700A3EC78 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COMPRESS_PNG_FILES = NO; @@ -11315,6 +12265,7 @@ /opt/local/lib, "$(inherited)", ); + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lSDLmain", "-logg", @@ -11329,7 +12280,8 @@ PRODUCT_NAME = ScummVM; PROVISIONING_PROFILE = "EF590570-5FAC-4346-9071-D609DE2B28D8"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - SDKROOT = iphonesimulator3.2; + SDKROOT = iphoneos; + VALID_ARCHS = "i386 x86_64"; WRAPPER_EXTENSION = app; }; name = Release; -- cgit v1.2.3 From ae4f63a256f333b87b560a1a187af7447307c0d9 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Tue, 7 Jun 2011 13:34:29 +0200 Subject: SCI: Add more debug output to AmigaMac sound driver --- engines/sci/sound/drivers/amigamac.cpp | 46 ++++++++++++++++------------------ 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 2f159c23ee..1436ca45a7 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -24,6 +24,7 @@ #include "sci/sound/drivers/mididriver.h" #include "sci/resource.h" +#include "common/debug-channels.h" #include "common/file.h" #include "common/frac.h" #include "common/memstream.h" @@ -460,9 +461,9 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C instrument->fixedNote = 101; instrument->mode = header[33]; - instrument->transpose = (int8) header[34]; + instrument->transpose = (int8)header[34]; for (int i = 0; i < 4; i++) { - int length = (int8) header[49 + i]; + int length = (int8)header[49 + i]; if (length == 0 && i > 0) length = 256; @@ -482,13 +483,18 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C strncpy(instrument->name, (char *) header + 2, 29); instrument->name[29] = 0; - debugC(kDebugLevelSound, "Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)", - *id, instrument->name, size); - debugC(kDebugLevelSound, " Mode: %02x", instrument->mode); - debugC(kDebugLevelSound, " Looping: %s", instrument->mode & kModeLoop ? "on" : "off"); - debugC(kDebugLevelSound, " Pitch changes: %s", instrument->mode & kModePitch ? "on" : "off"); - debugC(kDebugLevelSound, " Segment sizes: %i %i %i", seg_size[0], seg_size[1], seg_size[2]); - debugC(kDebugLevelSound, " Segment offsets: 0 %i %i", loop_offset, (int32)READ_BE_UINT32(header + 43)); + if (DebugMan.isDebugChannelEnabled(kDebugLevelSound)) { + debug("Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)", + *id, instrument->name, size); + debugN(" Mode: %02x (", header[33]); + debugN("looping: %s, ", header[33] & kModeLoop ? "on" : "off"); + debug("pitch changes: %s)", header[33] & kModePitch ? "on" : "off"); + debug(" Transpose: %i", (int8)header[34]); + for (uint i = 0; i < 3; i++) + debug(" Segment %i: %i words @ offset %i", i, (int16)READ_BE_UINT16(header + 35 + 6 * i), (i == 0 ? 0 : (int32)READ_BE_UINT32(header + 31 + 6 * i))); + for (uint i = 0; i < 4; i++) + debug(" Envelope %i: period %i / delta %i / target %i", i, header[49 + i], (int8)header[53 + i], header[57 + i]); + } instrument->samples = (int8 *) malloc(size + 1); if (file.read(instrument->samples, size) < (unsigned int)size) { @@ -503,10 +509,8 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C if (instrument->mode & kModeLoop) { if (loop_offset + seg_size[1] > size) { -#ifdef DEBUG - warning("Amiga/Mac driver: looping samples extend %i bytes past end of sample block", - loop_offset + seg_size[1] - size); -#endif + debugC(kDebugLevelSound, "Amiga/Mac driver: looping samples extend %i bytes past end of sample block", + loop_offset + seg_size[1] - size); seg_size[1] = size - loop_offset; } @@ -667,15 +671,11 @@ void MidiDriver_AmigaMac::send(uint32 b) { break; case 0x0a: // pan // TODO -#ifdef DEBUG - warning("Amiga/Mac driver: ignoring pan 0x%02x event for channel %i", op2, channel); -#endif + debugC(1, kDebugLevelSound, "Amiga/Mac driver: ignoring pan 0x%02x event for channel %i", op2, channel); break; case 0x40: // hold // TODO -#ifdef DEBUG - warning("Amiga/Mac driver: ignoring hold 0x%02x event for channel %i", op2, channel); -#endif + debugC(1, kDebugLevelSound, "Amiga/Mac driver: ignoring hold 0x%02x event for channel %i", op2, channel); break; case 0x4b: // voice mapping break; @@ -760,9 +760,7 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0(Common::File &file) { _bank.size = READ_BE_UINT16(header + 38); strncpy(_bank.name, (char *) header + 8, 29); _bank.name[29] = 0; -#ifdef DEBUG - debugN("Amiga/Mac driver: Reading %i instruments from bank \"%s\"\n", _bank.size, _bank.name); -#endif + debugC(kDebugLevelSound, "Amiga/Mac driver: Reading %i instruments from bank \"%s\"", _bank.size, _bank.name); for (uint i = 0; i < _bank.size; i++) { int id; @@ -799,9 +797,7 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0Mac(Common::SeekableReadStream &fil _bank.size = 128; strncpy(_bank.name, (char *) header + 8, 29); _bank.name[29] = 0; -#ifdef DEBUG - debugN("Amiga/Mac driver: Reading %i instruments from bank \"%s\"\n", _bank.size, _bank.name); -#endif + debugC(kDebugLevelSound, "Amiga/Mac driver: Reading %i instruments from bank \"%s\"", _bank.size, _bank.name); Common::Array instrumentOffsets; instrumentOffsets.resize(_bank.size); -- cgit v1.2.3 From 4b35006abad97c709f25028c00c3e7770e8426e7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 7 Jun 2011 21:48:53 +1000 Subject: TSAGE: Implemented the rest of the support methods for _soServiceTrackType0 --- engines/tsage/sound.cpp | 170 ++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 14 +++- 2 files changed, 163 insertions(+), 21 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index db1532253a..c5ede4695f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1152,7 +1152,6 @@ void Sound::release() { _hold = -1; } - void Sound::_soPrimeSound(bool queueFlag) { if (!queueFlag) { _priority = (_fixedPriority != -1) ? _fixedPriority : _sndResPriority; @@ -1371,9 +1370,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (voiceType == VOICETYPE_1) { // TODO: sub_25E32/sub_25DD8 if (chFlags & 0x10) - error("TODO: sub_25E32"); + _soProc42(vtStruct, channelNum, chVoiceType, v); else - error("TODO: sub_25DD8"); + _soProc32(vtStruct, channelNum, chVoiceType, v); } else if (voiceNum != -1) { assert(driver); driver->proc20(voiceNum, chVoiceType); @@ -1417,7 +1416,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (!_soundManager->_soTimeIndexFlag) { if (voiceType != VOICETYPE_0) { - error("sub_25F0E"); + _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, v); } else if (voiceNum != -1) { assert(driver); driver->setVolume0(voiceNum, chVoiceType, cmdVal, b); @@ -1448,7 +1447,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (!_soundManager->_soTimeIndexFlag) { if (voiceType != VOICETYPE_0) { - error("sub_25F0E"); + _soProc38(vtStruct, channelNum, chVoiceType, cmd, value); } else if (voiceNum != -1) { assert(driver); driver->setVolume0(voiceNum, chVoiceType, cmd, value); @@ -1468,7 +1467,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _chPitchBlend[channel] = pitchBlend; if (voiceType != VOICETYPE_0) { - error("sub_25FD0"); + _soProc40(vtStruct, channelNum); } else if (voiceNum != -1) { assert(driver); driver->setPitchBlend(channel, pitchBlend); @@ -1492,7 +1491,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } } } else { - error("sub_260C3"); + _soSetTrackPos(trackIndex, pData - channelData, program); } } else { @@ -1537,19 +1536,84 @@ void Sound::_soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceTyp } } -void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { - if (_soundManager->_soTimeIndexFlag || !_trkState[trackIndex]) - return; +void Sound::_soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0) { + int entryIndex = _soFindSound(vtStruct, channelNum); + if (entryIndex != -1) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); - int channel = _trkChannel[trackIndex]; - if (channel == -1) - _trkState[trackIndex] = 0; - else { - VoiceTypeStruct *voiceType = _soundManager->_voiceTypeStructPtrs[_chVoiceType[channel]]; - if (!voiceType) - _trkState[trackIndex] = 0; - else { - + vtStruct->_entries[entryIndex]._type1._field6 = 0; + vtStruct->_entries[entryIndex]._type1._field4 = v0; + vtStruct->_entries[entryIndex]._type1._field5 = 0; + + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, _chProgram[channelNum]); + } +} + +void Sound::_soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0) { + for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { + const byte *instrument = _channelData[trackCtr]; + if ((*(instrument + 13) == v0) && (*instrument == 1)) { + int entryIndex = _soFindSound(vtStruct, channelNum); + + if (entryIndex != -1) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); + + vtStruct->_entries[entryIndex]._type1._field6 = 0; + vtStruct->_entries[entryIndex]._type1._field4 = v0; + vtStruct->_entries[entryIndex]._type1._field5 = 0; + + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, voiceType, + _channelData[trackCtr], this, 0x7f, 0xff, 0xE); + driver->proc42(vtStruct->_entries[entryIndex]._voiceNum, voiceType, 0); + } + break; + } + } +} + +void Sound::_soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value) { + if (cmd == 64) { + if (value == 0) { + for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) { + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + + if ((vte._sound == this) && (vte._channelNum == channelNum) && (vte._field5 != 0)) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); + + vte._field4 = -1; + vte._field5 = 0; + driver->updateVoice(vtStruct->_entries[entryIndex]._voiceNum); + } + } + } + } else if (cmd == 75) { + _soundManager->_needToRethink = true; + } else { + for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) { + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + + if ((vte._sound == this) && (vte._channelNum == channelNum)) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); + + driver->proc38(vtStruct->_entries[entryIndex]._voiceNum); + } + } + } +} + +void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum) { + for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) { + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + + if ((vte._sound == this) && (vte._channelNum == channelNum)) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); + + driver->proc40(vtStruct->_entries[entryIndex]._voiceNum); } } } @@ -1588,6 +1652,74 @@ bool Sound::_soDoUpdateTracks(int command, int value) { return true; } +void Sound::_soSetTrackPos(int trackIndex, int trackPos, int cueValue) { + _trkIndex[trackIndex] = trackPos; + if (cueValue == 127) { + if (!_soundManager->_soTimeIndexFlag) + _cueValue = cueValue; + } else { + for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { + _trkLoopState[idx] = _trkState[idx]; + _trkLoopRest[idx] = _trkRest[idx]; + _trkLoopIndex[idx] = _trkIndex[idx]; + } + + _loopTimer = _timer; + } +} + +void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { + if (_soundManager->_soTimeIndexFlag || !_trkState[trackIndex]) + return; + + int channel = _trkChannel[trackIndex]; + if (channel == -1) + _trkState[trackIndex] = 0; + else { + VoiceTypeStruct *voiceType = _soundManager->_voiceTypeStructPtrs[_chVoiceType[channel]]; + if (!voiceType) + _trkState[trackIndex] = 0; + else { + + } + } +} + +int Sound::_soFindSound(VoiceTypeStruct *vtStruct, int channelNum) { + int entryIndex = -1, entry2Index = -1; + int v6 = 0, v8 = 0; + + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if ((vte._channelNum == channelNum) && (vte._sound == this)) { + int v = vte._field6; + if (vte._field4 != -1) { + if (v8 <= v) { + v8 = v; + entry2Index = idx; + } + } else { + if (v6 <= v) { + v6 = v; + entryIndex = idx; + } + } + } + } + + if (entryIndex != -1) + return entryIndex; + else if ((entryIndex == -1) && (entry2Index == -1)) + return -1; + else { + SoundDriver *driver = vtStruct->_entries[entry2Index]._driver; + assert(driver); + driver->updateVoice(vtStruct->_entries[entry2Index]._voiceNum); + + return entry2Index; + } +} + /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 1158ce3c87..65f13a1650 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -91,6 +91,10 @@ public: virtual void setProgram(int channel, int program) {} virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void setPitchBlend(int channel, int pitchBlend) {} + virtual void proc32(int voiceNum, int program, ...) {} // TODO: Determine params + virtual void proc38(int voiceNum) {} + virtual void proc40(int voiceNum) {} + virtual void proc42(int voiceNum, ...) {} // TODO: Determine params virtual void updateVoice(int voiceNum) {} }; @@ -329,10 +333,16 @@ public: void _soRemoteReceive(); void _soServiceTrackType0(int trackIndex, const byte *channelData); void _soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0); - - void _soServiceTrackType1(int trackIndex, const byte *channelData); + void _soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); + void _soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); + void _soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value); + void _soProc40(VoiceTypeStruct *vtStruct, int channelNum); void _soDoTrackCommand(int channelNum, int command, int value); bool _soDoUpdateTracks(int command, int value); + void _soSetTrackPos(int trackIndex, int trackPos, int cueValue); + + void _soServiceTrackType1(int trackIndex, const byte *channelData); + int _soFindSound(VoiceTypeStruct *vtStruct, int channelNum); }; class ASound: public EventHandler { -- cgit v1.2.3 From 6c1178aecaa94d5f6828339eee36fffec5486e73 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 7 Jun 2011 22:22:11 +1000 Subject: TSAGE: Completed implementing _so methods --- engines/tsage/sound.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c5ede4695f..69d2656baa 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1676,11 +1676,30 @@ void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { if (channel == -1) _trkState[trackIndex] = 0; else { - VoiceTypeStruct *voiceType = _soundManager->_voiceTypeStructPtrs[_chVoiceType[channel]]; - if (!voiceType) + int voiceType = _chVoiceType[channel]; + VoiceTypeStruct *vtStruct = _soundManager->_voiceTypeStructPtrs[voiceType]; + + if (!vtStruct) _trkState[trackIndex] = 0; else { - + if (vtStruct->_voiceType != VOICETYPE_0) { + if (_trkState[trackIndex] == 1) { + int entryIndex = _soFindSound(vtStruct, *(channelData + 1)); + if (entryIndex != -1) { + SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + assert(driver); + + vtStruct->_entries[entryIndex]._type1._field6 = 0; + vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1); + vtStruct->_entries[entryIndex]._type1._field5 = 0; + + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, voiceType, + _channelData[trackIndex], this, 0x7f, 0xff, 0xE); + } + } else { + + } + } } } } -- cgit v1.2.3 From b7be24b83515eb3266d1f1d20601dd7cf43d0755 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:49:26 +0200 Subject: OPENPANDORA: Remove some dead code --- backends/platform/openpandora/op-backend.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp index 4c29636e40..6bac4ea7d7 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -177,26 +177,6 @@ void OSystem_OP::initBackend() { _inited = true; } - - - // enable joystick -// if (joystick_num > -1 && SDL_NumJoysticks() > 0) { -// printf("Using joystick: %s\n", SDL_JoystickName(0)); -// _joystick = SDL_JoystickOpen(joystick_num); -// } -// -// setupMixer(); - - // Note: We could implement a custom SDLTimerManager by using - // SDL_AddTimer. That might yield better timer resolution, but it would - // also change the semantics of a timer: Right now, ScummVM timers - // *never* run in parallel, due to the way they are implemented. If we - // switched to SDL_AddTimer, each timer might run in a separate thread. - // However, not all our code is prepared for that, so we can't just - // switch. Still, it's a potential future change to keep in mind. -// _timer = new DefaultTimerManager(); -// _timerID = SDL_AddTimer(10, &timer_handler, _timer); - void OSystem_OP::initSDL() { // Check if SDL has not been initialized if (!_initedSDL) { -- cgit v1.2.3 From 04afdf7c7d2c70e4c31b65741d22545a8979367e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 23:25:37 +0200 Subject: BACKENDS: Move more 'manager slots' from ModularBackend to OSystem --- backends/modular-backend.cpp | 26 ++------------ backends/modular-backend.h | 8 ----- common/system.cpp | 43 ++++++++++++++++++++--- common/system.h | 81 +++++++++++++++++++++++++++++++------------- 4 files changed, 97 insertions(+), 61 deletions(-) diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index bbf6a6c1ed..e36348abd5 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -30,14 +30,13 @@ #include "audio/mixer.h" #include "common/events.h" +#include "common/timer.h" +#include "common/savefile.h" #include "gui/message.h" #include "graphics/pixelformat.h" ModularBackend::ModularBackend() : - _fsFactory(0), - _savefileManager(0), - _timerManager(0), _mutexManager(0), _graphicsManager(0), _mixer(0) { @@ -45,16 +44,10 @@ ModularBackend::ModularBackend() } ModularBackend::~ModularBackend() { - delete _fsFactory; - _fsFactory = 0; delete _graphicsManager; _graphicsManager = 0; delete _mixer; _mixer = 0; - delete _savefileManager; - _savefileManager = 0; - delete _timerManager; - _timerManager = 0; delete _mutexManager; _mutexManager = 0; } @@ -215,11 +208,6 @@ void ModularBackend::setCursorPalette(const byte *colors, uint start, uint num) _graphicsManager->setCursorPalette(colors, start, num); } -Common::TimerManager *ModularBackend::getTimerManager() { - assert(_timerManager); - return _timerManager; -} - OSystem::MutexRef ModularBackend::createMutex() { assert(_mutexManager); return _mutexManager->createMutex(); @@ -249,16 +237,6 @@ void ModularBackend::displayMessageOnOSD(const char *msg) { _graphicsManager->displayMessageOnOSD(msg); } -Common::SaveFileManager *ModularBackend::getSavefileManager() { - assert(_savefileManager); - return _savefileManager; -} - -FilesystemFactory *ModularBackend::getFilesystemFactory() { - assert(_fsFactory); - return _fsFactory; -} - void ModularBackend::quit() { exit(0); } diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 42bd0ed73a..d2c3ce2067 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -24,8 +24,6 @@ #define BACKENDS_MODULAR_BACKEND_H #include "common/system.h" -#include "common/timer.h" -#include "common/savefile.h" class GraphicsManager; class MutexManager; @@ -110,7 +108,6 @@ public: /** @name Events and Time */ //@{ - virtual Common::TimerManager *getTimerManager(); virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; } //@} @@ -135,8 +132,6 @@ public: /** @name Miscellaneous */ //@{ - virtual Common::SaveFileManager *getSavefileManager(); - virtual FilesystemFactory *getFilesystemFactory(); virtual void quit(); virtual void displayMessageOnOSD(const char *msg); @@ -146,9 +141,6 @@ protected: /** @name Managers variables */ //@{ - FilesystemFactory *_fsFactory; - Common::SaveFileManager *_savefileManager; - Common::TimerManager *_timerManager; MutexManager *_mutexManager; GraphicsManager *_graphicsManager; Audio::Mixer *_mixer; diff --git a/common/system.cpp b/common/system.cpp index cd6ee46335..e34aeb54d6 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -34,12 +34,16 @@ #include "common/textconsole.h" #include "backends/audiocd/default/default-audiocd.h" +#include "backends/timer/default/default-timer.h" OSystem *g_system = 0; OSystem::OSystem() { _audiocdManager = 0; _eventManager = 0; + _timerManager = 0; + _savefileManager = 0; + _fsFactory = 0; } OSystem::~OSystem() { @@ -48,20 +52,35 @@ OSystem::~OSystem() { delete _eventManager; _eventManager = 0; + + delete _timerManager; + _timerManager = 0; + + delete _savefileManager; + _savefileManager = 0; + + delete _fsFactory; + _fsFactory = 0; } void OSystem::initBackend() { - // Init AudioCD manager + // Init audio CD manager #ifndef DISABLE_DEFAULT_AUDIOCD_MANAGER if (!_audiocdManager) _audiocdManager = new DefaultAudioCDManager(); #endif - if (!_audiocdManager) - error("Backend failed to instantiate AudioCD manager"); - // Verify Event manager has been set + // Verify all managers has been set + if (!_audiocdManager) + error("Backend failed to instantiate audio CD manager"); if (!_eventManager) - error("Backend failed to instantiate Event manager"); + error("Backend failed to instantiate event manager"); + if (!_timerManager) + error("Backend failed to instantiate timer manager"); +// if (!_savefileManager) +// error("Backend failed to instantiate savefile manager"); +// if (!_fsFactory) +// error("Backend failed to instantiate fs factory"); } bool OSystem::setGraphicsMode(const char *name) { @@ -90,6 +109,20 @@ void OSystem::fatalError() { exit(1); } +Common::TimerManager *OSystem::getTimerManager() { + return _timerManager; +} + +Common::SaveFileManager *OSystem::getSavefileManager() { + assert(_savefileManager); + return _savefileManager; +} + +FilesystemFactory *OSystem::getFilesystemFactory() { + assert(_fsFactory); + return _fsFactory; +} + Common::SeekableReadStream *OSystem::createConfigReadStream() { Common::FSNode file(getDefaultConfigFileName()); return file.createReadStream(); diff --git a/common/system.h b/common/system.h index 780e5fcc7d..9036dcd6e1 100644 --- a/common/system.h +++ b/common/system.h @@ -98,36 +98,69 @@ protected: protected: /** - * For backend authors only, this pointer may be set by OSystem - * subclasses to an AudioCDManager instance. This is only useful - * if your backend does not want to use the DefaultAudioCDManager. + * @name Module slots * - * This instance is returned by OSystem::getAudioCDManager(), - * and it is deleted by the OSystem destructor. + * For backend authors only, the following pointers (= "slots) to various + * subsystem managers / factories / etc. can and should be set to + * a suitable instance of the respective type. * - * A backend may set this pointer in its initBackend() method, - * its constructor or somewhere in between; but it must - * set it no later than in its initBackend() implementation, because - * OSystem::initBackend() will by default create a DefaultAudioCDManager - * instance if _audiocdManager has not yet been set. + * For some of the slots, a default instance is set if your backend + * does not do so. For details, please look at the documentation of + * each slot. + * + * A backend may setup slot values in its initBackend() method, + * its constructor or somewhere in between. But it must a slot's value + * no later than in its initBackend() implementation, because + * OSystem::initBackend() will create any default instances if + * none has been set yet (and for other slots, will verify that + * one has been set; if not, an error may be generated). */ - AudioCDManager *_audiocdManager; + //@{ /** - * For backend authors only, this pointer may be set by OSystem - * subclasses to an EventManager instance. This is only useful - * if your backend does not want to use the DefaultEventManager. + * If no value is provided for this slot, then OSystem::initBackend() + * will populate it with a DefaultAudioCDManager instance. * - * This instance is returned by OSystem::getEventManager(), - * and it is deleted by the OSystem destructor. + * @note _audiocdManager is deleted by the OSystem destructor. + */ + AudioCDManager *_audiocdManager; + + /** + * No default value is provided for _eventManager by OSystem. + * However, BaseBackend::initBackend() does set a default value + * if none has been set before. * - * A backend may set this pointer in its initBackend() method, - * its constructor or somewhere in between; but it must - * set it no later than in its initBackend() implementation, because - * OSystem::initBackend() will by default create a DefaultEventManager - * instance if _eventManager has not yet been set. + * @note _eventManager is deleted by the OSystem destructor. */ Common::EventManager *_eventManager; + + /** + * No default value is provided for _timerManager by OSystem. + * + * @note _timerManager is deleted by the OSystem destructor. + */ + Common::TimerManager *_timerManager; + + /** + * No default value is provided for _savefileManager by OSystem. + * + * @note _savefileManager is deleted by the OSystem destructor. + */ + Common::SaveFileManager *_savefileManager; + + /** + * No default value is provided for _fsFactory by OSystem. + * + * Note that _fsFactory is typically required very early on, + * so it usually should be set in the backends constructor or shortly + * thereafter, and before initBackend() is called. + * + * @note _fsFactory is deleted by the OSystem destructor. + */ + FilesystemFactory *_fsFactory; + + //@} + public: /** @@ -857,7 +890,7 @@ public: * Return the timer manager singleton. For more information, refer * to the TimerManager documentation. */ - virtual Common::TimerManager *getTimerManager() = 0; + virtual Common::TimerManager *getTimerManager(); /** * Return the event manager singleton. For more information, refer @@ -1007,14 +1040,14 @@ public: * and other modifiable persistent game data. For more information, * refer to the SaveFileManager documentation. */ - virtual Common::SaveFileManager *getSavefileManager() = 0; + virtual Common::SaveFileManager *getSavefileManager(); /** * Returns the FilesystemFactory object, depending on the current architecture. * * @return the FSNode factory for the current architecture */ - virtual FilesystemFactory *getFilesystemFactory() = 0; + virtual FilesystemFactory *getFilesystemFactory(); /** * Add system specific Common::Archive objects to the given SearchSet. -- cgit v1.2.3 From c30018ef37140a4f638b83b7aedeade6f367c61e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 23:26:09 +0200 Subject: DC: Use OSystem's 'slots' for timer/savefile manager & fsFactory --- backends/platform/dc/dc.h | 5 ----- backends/platform/dc/dcmain.cpp | 7 ++++--- backends/platform/dc/input.cpp | 4 ++-- backends/platform/dc/time.cpp | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index c7659e8292..84fdd58168 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -185,24 +185,19 @@ public: void setWindowCaption(const char *caption); // Modulatized backend - Common::SaveFileManager *getSavefileManager() { return _savefile; } Audio::Mixer *getMixer() { return _mixer; } - Common::TimerManager *getTimerManager() { return _timer; } // Extra SoftKbd support void mouseToSoftKbd(int x, int y, int &rx, int &ry) const; // Filesystem - FilesystemFactory *getFilesystemFactory() { return this; } AbstractFSNode *makeRootFileNode() const; AbstractFSNode *makeCurrentDirectoryFileNode() const; AbstractFSNode *makeFileNodePath(const Common::String &path) const; private: - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - DefaultTimerManager *_timer; SoftKeyboard _softkbd; int _ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_old_x, _ms_old_y; diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index 47bfb0c15d..d1fcdd4a05 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -41,20 +41,21 @@ const char *gGameName; OSystem_Dreamcast::OSystem_Dreamcast() : _devpoll(0), screen(NULL), mouse(NULL), overlay(NULL), _softkbd(this), - _ms_buf(NULL), _timer(NULL), _mixer(NULL), _savefile(NULL), + _ms_buf(NULL), _mixer(NULL), _current_shake_pos(0), _aspect_stretch(false), _softkbd_on(false), _softkbd_motion(0), _enable_cursor_palette(false), _screenFormat(0) { memset(screen_tx, 0, sizeof(screen_tx)); memset(mouse_tx, 0, sizeof(mouse_tx)); memset(ovl_tx, 0, sizeof(ovl_tx)); + _fsFactory = this; } void OSystem_Dreamcast::initBackend() { ConfMan.setInt("autosave_period", 0); - _savefile = createSavefileManager(); - _timer = new DefaultTimerManager(); + _savefileManager = createSavefileManager(); + _timerManager = new DefaultTimerManager(); uint sampleRate = initSound(); _mixer = new Audio::MixerImpl(this, sampleRate); diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp index 7054ad196e..3759eec6df 100644 --- a/backends/platform/dc/input.cpp +++ b/backends/platform/dc/input.cpp @@ -192,8 +192,8 @@ bool OSystem_Dreamcast::pollEvent(Common::Event &event) { unsigned int t = Timer(); - if (_timer != NULL) - _timer->handler(); + if (_timerManager != NULL) + ((DefaultTimerManager *)_timerManager)->handler(); if (((int)(t-_devpoll))<0) return false; diff --git a/backends/platform/dc/time.cpp b/backends/platform/dc/time.cpp index c343852321..8cc3a71e8d 100644 --- a/backends/platform/dc/time.cpp +++ b/backends/platform/dc/time.cpp @@ -48,8 +48,8 @@ void OSystem_Dreamcast::delayMillis(uint msecs) unsigned int t, start = Timer(); int time = (((unsigned int)msecs)*3125U)>>6; while (((int)((t = Timer())-start))handler(); + if (_timerManager != NULL) + ((DefaultTimerManager *)_timerManager)->handler(); checkSound(); } getMillis(); -- cgit v1.2.3 From 896e7e23b44e5c21e98772c6c193bfe150f8499b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:50:57 +0200 Subject: ANDROID: Use OSystem's 'slots' for timer/savefile manager & fsfactory --- backends/platform/android/android.cpp | 30 ++++++++---------------------- backends/platform/android/android.h | 6 ------ 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index a67ee51b4d..1acb080a60 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -132,10 +132,7 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) : _show_mouse(false), _show_overlay(false), _enable_zoning(false), - _savefile(0), _mixer(0), - _timer(0), - _fsFactory(new POSIXFilesystemFactory()), _shake_offset(0), _event_queue_lock(createMutex()), _touch_pt_down(), @@ -149,6 +146,9 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) : _dpad_scale(4), _fingersDown(0), _trackball_scale(2) { + + _fsFactory = new POSIXFilesystemFactory(); + Common::String mf = getSystemProperty("ro.product.manufacturer"); LOGI("Running on: [%s] [%s] [%s] [%s] [%s] SDK:%s ABI:%s", @@ -170,17 +170,17 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) : OSystem_Android::~OSystem_Android() { ENTER(); - delete _savefile; - delete _timer; delete _mixer; + _mixer = 0; delete _fsFactory; + _fsFactory = 0; deleteMutex(_event_queue_lock); } void *OSystem_Android::timerThreadFunc(void *arg) { OSystem_Android *system = (OSystem_Android *)arg; - DefaultTimerManager *timer = (DefaultTimerManager *)(system->_timer); + DefaultTimerManager *timer = (DefaultTimerManager *)(system->_timerManager); // renice this thread to boost the audio thread if (setpriority(PRIO_PROCESS, 0, 19) < 0) @@ -359,8 +359,8 @@ void OSystem_Android::initBackend() { // BUG: "transient" ConfMan settings get nuked by the options // screen. Passing the savepath in this way makes it stick // (via ConfMan.registerDefault) - _savefile = new DefaultSaveFileManager(ConfMan.get("savepath")); - _timer = new DefaultTimerManager(); + _savefileManager = new DefaultSaveFileManager(ConfMan.get("savepath")); + _timerManager = new DefaultTimerManager(); gettimeofday(&_startTime, 0); @@ -535,21 +535,11 @@ void OSystem_Android::showVirtualKeyboard(bool enable) { JNI::showVirtualKeyboard(enable); } -Common::SaveFileManager *OSystem_Android::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_Android::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_Android::getTimerManager() { - assert(_timer); - return _timer; -} - void OSystem_Android::getTimeAndDate(TimeDate &td) const { struct tm tm; const time_t curTime = time(0); @@ -563,10 +553,6 @@ void OSystem_Android::getTimeAndDate(TimeDate &td) const { td.tm_year = tm.tm_year; } -FilesystemFactory *OSystem_Android::getFilesystemFactory() { - return _fsFactory; -} - void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { ENTER(""); diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index b70fdb7c30..cd7ad5f8f0 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -152,10 +152,7 @@ private: bool _enable_zoning; bool _virtkeybd_on; - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - Common::TimerManager *_timer; - FilesystemFactory *_fsFactory; timeval _startTime; Common::String getSystemProperty(const char *name) const; @@ -289,11 +286,8 @@ public: virtual void displayMessageOnOSD(const char *msg); virtual void showVirtualKeyboard(bool enable); - virtual Common::SaveFileManager *getSavefileManager(); virtual Audio::Mixer *getMixer(); virtual void getTimeAndDate(TimeDate &t) const; - virtual Common::TimerManager *getTimerManager(); - virtual FilesystemFactory *getFilesystemFactory(); virtual void logMessage(LogMessageType::Type type, const char *message); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); -- cgit v1.2.3 From 886c4e54175317e57880e59eafbbe835ea77f754 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:52:04 +0200 Subject: DS: Use OSystem's 'slot' for timer manager --- backends/platform/ds/arm9/source/osystem_ds.cpp | 7 +++---- backends/platform/ds/arm9/source/osystem_ds.h | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index eab9fd6a33..6cc76f51a5 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -42,6 +42,7 @@ #include "backends/fs/ds/ds-fs-factory.h" #include "backends/audiocd/default/default-audiocd.h" +#include "backends/timer/default/default-timer.h" #ifdef ENABLE_AGI #include "wordcompletion.h" @@ -81,7 +82,7 @@ OSystem_DS *OSystem_DS::_instance = NULL; OSystem_DS::OSystem_DS() - : eventNum(0), lastPenFrame(0), queuePos(0), _mixer(NULL), _timer(NULL), _frameBufferExists(false), + : eventNum(0), lastPenFrame(0), queuePos(0), _mixer(NULL), _frameBufferExists(false), _disableCursorPalette(true), _graphicsEnable(true), _gammaValue(0) { // eventNum = 0; @@ -89,13 +90,11 @@ OSystem_DS::OSystem_DS() // queuePos = 0; _instance = this; // _mixer = NULL; - // _timer = NULL; //_frameBufferExists = false; } OSystem_DS::~OSystem_DS() { delete _mixer; - delete _timer; } int OSystem_DS::timerHandler(int t) { @@ -108,7 +107,7 @@ void OSystem_DS::initBackend() { ConfMan.setInt("autosave_period", 0); ConfMan.setBool("FM_medium_quality", true); - _timer = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); DS::setTimerCallback(&OSystem_DS::timerHandler, 10); if (ConfMan.hasKey("22khzaudio", "ds") && ConfMan.getBool("22khzaudio", "ds")) { diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 1e032ba2cf..ad306b5e3b 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -29,7 +29,6 @@ #include "nds.h" #include "gbampsave.h" #include "backends/saves/default/default-saves.h" -#include "backends/timer/default/default-timer.h" #include "audio/mixer_intern.h" #include "graphics/surface.h" #include "graphics/colormasks.h" @@ -46,7 +45,6 @@ protected: GBAMPSaveFileManager mpSaveManager; Audio::MixerImpl *_mixer; - DefaultTimerManager *_timer; Graphics::Surface _framebuffer; bool _frameBufferExists; bool _graphicsEnable; @@ -159,7 +157,6 @@ public: virtual Audio::Mixer *getMixer() { return _mixer; } Audio::MixerImpl *getMixerImpl() { return _mixer; } - virtual Common::TimerManager *getTimerManager() { return _timer; } static int timerHandler(int t); -- cgit v1.2.3 From 14f0a0c6823dc899a78e3a627200ad1337181b1a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:53:50 +0200 Subject: IPHONE: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/iphone/osys_main.cpp | 20 ++++---------------- backends/platform/iphone/osys_main.h | 4 ---- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 9007f006f8..4e5f860f20 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -53,7 +53,7 @@ SoundProc OSystem_IPHONE::s_soundCallback = NULL; void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : - _savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL), + _mixer(NULL), _offscreen(NULL), _overlayVisible(false), _fullscreen(NULL), _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), _secondaryTapped(false), _lastSecondaryTap(0), @@ -73,9 +73,7 @@ OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); delete _fsFactory; - delete _savefile; delete _mixer; - delete _timer; delete _offscreen; delete _fullscreen; } @@ -88,12 +86,12 @@ int OSystem_IPHONE::timerHandler(int t) { void OSystem_IPHONE::initBackend() { #ifdef IPHONE_OFFICIAL - _savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir()); + _savefileManager = new DefaultSaveFileManager(iPhone_getDocumentsDir()); #else - _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); + _savefileManager = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); #endif - _timer = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); gettimeofday(&_startTime, NULL); @@ -210,21 +208,11 @@ void OSystem_IPHONE::getTimeAndDate(TimeDate &td) const { td.tm_year = t.tm_year; } -Common::SaveFileManager *OSystem_IPHONE::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_IPHONE::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_IPHONE::getTimerManager() { - assert(_timer); - return _timer; -} - OSystem *OSystem_IPHONE_create() { return new OSystem_IPHONE(); } diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 36b4b7356b..03d7cc1f79 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -57,9 +57,7 @@ protected: static SoundProc s_soundCallback; static void *s_soundParam; - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - Common::TimerManager *_timer; Graphics::Surface _framebuffer; byte *_offscreen; @@ -177,9 +175,7 @@ public: virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual void getTimeAndDate(TimeDate &t) const; - virtual Common::SaveFileManager *getSavefileManager(); virtual Audio::Mixer *getMixer(); - virtual Common::TimerManager *getTimerManager(); void startSoundsystem(); void stopSoundsystem(); -- cgit v1.2.3 From 9e1ed9ee6a3a6d3bd788fe16b93b5a9392330f2e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:55:58 +0200 Subject: N64: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/n64/osys_n64.h | 6 ------ backends/platform/n64/osys_n64_base.cpp | 22 +++++----------------- backends/platform/n64/osys_n64_utilities.cpp | 1 + 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index f22b221ccc..b338887e56 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -27,8 +27,6 @@ #include "common/config-manager.h" #include "backends/base-backend.h" -#include "backends/saves/default/default-saves.h" -#include "backends/timer/default/default-timer.h" #include "base/main.h" @@ -75,9 +73,7 @@ enum GraphicModeID { class OSystem_N64 : public BaseBackend, public PaletteManager { protected: - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - Common::TimerManager *_timer; FilesystemFactory *_fsFactory; struct display_context * _dc; // Display context for N64 on screen buffer switching @@ -201,10 +197,8 @@ public: virtual void quit(); - virtual Common::SaveFileManager *getSavefileManager(); virtual Audio::Mixer *getMixer(); virtual void getTimeAndDate(TimeDate &t) const; - virtual Common::TimerManager *getTimerManager(); virtual void setTimerCallback(TimerProc callback, int interval); FilesystemFactory *getFilesystemFactory(); diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 62fe145bcc..8a2d415d75 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -30,6 +30,8 @@ #include "pakfs_save_manager.h" #include "framfs_save_manager.h" #include "backends/fs/n64/n64-fs-factory.h" +#include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h" typedef unsigned long long uint64; @@ -137,9 +139,7 @@ OSystem_N64::OSystem_N64() { _mouseMaxX = _overlayWidth; _mouseMaxY = _overlayHeight; - _savefile = 0; _mixer = 0; - _timer = 0; _dirtyOffscreen = false; @@ -154,9 +154,7 @@ OSystem_N64::OSystem_N64() { } OSystem_N64::~OSystem_N64() { - delete _savefile; delete _mixer; - delete _timer; delete _fsFactory; } @@ -170,7 +168,7 @@ void OSystem_N64::initBackend() { if (FRAM_Detect()) { // Use FlashRAM initFramFS(); - _savefile = new FRAMSaveManager(); + _savefileManager = new FRAMSaveManager(); } else { // Use PakFS // Init Controller Pak initPakFs(); @@ -185,10 +183,10 @@ void OSystem_N64::initBackend() { } } - _savefile = new PAKSaveManager(); + _savefileManager = new PAKSaveManager(); } - _timer = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); setTimerCallback(&timer_handler, 10); @@ -851,21 +849,11 @@ void OSystem_N64::quit() { return; } -Common::SaveFileManager *OSystem_N64::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_N64::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_N64::getTimerManager() { - assert(_timer); - return _timer; -} - void OSystem_N64::getTimeAndDate(TimeDate &t) const { // No RTC inside the N64, read mips timer to simulate // passing of time, not a perfect solution, but can't think diff --git a/backends/platform/n64/osys_n64_utilities.cpp b/backends/platform/n64/osys_n64_utilities.cpp index 8d9f0471d3..0622e6423d 100644 --- a/backends/platform/n64/osys_n64_utilities.cpp +++ b/backends/platform/n64/osys_n64_utilities.cpp @@ -21,6 +21,7 @@ */ #include "osys_n64.h" +#include "backends/timer/default/default-timer.h" void checkTimers(void) { OSystem_N64 *osys = (OSystem_N64 *)g_system; -- cgit v1.2.3 From 8ac63a37a8a0e995b9228c90b24d4fbdffcf940d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:57:24 +0200 Subject: PS2: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/ps2/systemps2.cpp | 19 +++++-------------- backends/platform/ps2/systemps2.h | 14 -------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 728a67fbad..d3acd06089 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -60,7 +60,6 @@ #include "backends/fs/ps2/ps2-fs-factory.h" #include "backends/plugins/ps2/ps2-provider.h" -#include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" #include "audio/mixer_intern.h" @@ -348,14 +347,14 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { void OSystem_PS2::init(void) { sioprintf("Timer...\n"); - _scummTimerManager = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); _scummMixer = new Audio::MixerImpl(this, 48000); _scummMixer->setReady(true); initTimer(); sioprintf("Starting SavefileManager\n"); - _saveManager = new Ps2SaveFileManager(this, _screen); + _savefileManager = new Ps2SaveFileManager(this, _screen); sioprintf("Initializing ps2Input\n"); _input = new Ps2Input(this, _useMouse, _useKbd); @@ -430,7 +429,7 @@ void OSystem_PS2::initTimer(void) { void OSystem_PS2::timerThreadCallback(void) { while (!_systemQuit) { WaitSema(g_TimerThreadSema); - _scummTimerManager->handler(); + ((DefaultTimerManager *)_timerManager)->handler(); } ExitThread(); } @@ -600,18 +599,10 @@ void OSystem_PS2::delayMillis(uint msecs) { } } -Common::TimerManager *OSystem_PS2::getTimerManager() { - return _scummTimerManager; -} - Audio::Mixer *OSystem_PS2::getMixer() { return _scummMixer; } -Common::SaveFileManager *OSystem_PS2::getSavefileManager(void) { - return _saveManager; -} - FilesystemFactory *OSystem_PS2::getFilesystemFactory() { return &Ps2FilesystemFactory::instance(); } @@ -770,7 +761,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) { void OSystem_PS2::powerOffCallback(void) { sioprintf("powerOffCallback\n"); - // _saveManager->quit(); // romeo + // _savefileManager->quit(); // romeo if (_useHdd) { sioprintf("umount\n"); fio.umount("pfs0:"); @@ -810,7 +801,7 @@ void OSystem_PS2::quit(void) { DisableIntc(INT_TIMER0); RemoveIntcHandler(INT_TIMER0, _intrId); - // _saveManager->quit(); // romeo + // _savefileManager->quit(); // romeo _screen->quit(); padEnd(); // stop pad library diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index cc9c489827..d12d02b104 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -27,12 +27,8 @@ #include "backends/base-backend.h" #include "graphics/palette.h" -class DefaultTimerManager; -class DefaultSaveFileManager; - class Gs2dScreen; class Ps2Input; -class Ps2SaveFileManager; // class Ps2FilesystemFactory; struct IrxReference; @@ -44,10 +40,6 @@ struct Ps2Mutex { int count; }; -namespace Common { -class TimerManager; -}; - namespace Audio { class MixerImpl; }; @@ -93,7 +85,6 @@ public: virtual uint32 getMillis(); virtual void delayMillis(uint msecs); - virtual Common::TimerManager *getTimerManager(); virtual bool pollEvent(Common::Event &event); virtual Audio::Mixer *getMixer(); @@ -116,7 +107,6 @@ public: virtual void logMessage(LogMessageType::Type type, const char *message); virtual Graphics::PixelFormat getOverlayFormat() const; - virtual Common::SaveFileManager *getSavefileManager(); virtual FilesystemFactory *getFilesystemFactory(); virtual void getTimeAndDate(TimeDate &t) const; @@ -144,15 +134,11 @@ private: void initTimer(void); void readRtcTime(void); - DefaultTimerManager *_scummTimerManager; Audio::MixerImpl *_scummMixer; bool _mouseVisible; bool _useMouse, _useKbd, _useHdd, _usbMassLoaded, _useNet; - Ps2SaveFileManager *_saveManager; - // DefaultSaveFileManager *_saveManager; - Gs2dScreen *_screen; Ps2Input *_input; uint16 _oldMouseX, _oldMouseY; -- cgit v1.2.3 From 0b859e026d4f2b4631afa76779976fae1f0c6878 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:58:20 +0200 Subject: PSP: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/psp/osys_psp.cpp | 4 ++-- backends/platform/psp/osys_psp.h | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 4408cbf481..12916f8725 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -89,9 +89,9 @@ void OSystem_PSP::initBackend() { _imageViewer.setInputHandler(&_inputHandler); _imageViewer.setDisplayManager(&_displayManager); - _savefile = new PSPSaveFileManager; + _savefileManager = new PSPSaveFileManager; - _timer = new DefaultTimerManager(); + _timerManager = new DefaultTimerManager(); PSP_DEBUG_PRINT("calling keyboard.load()\n"); _keyboard.load(); // Load virtual keyboard files into memory diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 4f1d6f2fa7..8ca09924ad 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -45,9 +45,7 @@ class OSystem_PSP : public BaseBackend, public PaletteManager { private: - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - Common::TimerManager *_timer; bool _pendingUpdate; // save an update we couldn't perform uint32 _pendingUpdateCounter; // prevent checking for pending update too often, in a cheap way @@ -63,7 +61,7 @@ private: ImageViewer _imageViewer; public: - OSystem_PSP() : _savefile(0), _mixer(0), _timer(0), _pendingUpdate(false), _pendingUpdateCounter(0) {} + OSystem_PSP() : _mixer(0), _pendingUpdate(false), _pendingUpdateCounter(0) {} ~OSystem_PSP(); static OSystem *instance(); @@ -133,7 +131,6 @@ public: // Timer typedef int (*TimerProc)(int interval); void setTimerCallback(TimerProc callback, int interval); - Common::TimerManager *getTimerManager() { return _timer; } // Mutex MutexRef createMutex(void); @@ -147,7 +144,6 @@ public: Audio::Mixer *getMixer() { return _mixer; } // Misc - Common::SaveFileManager *getSavefileManager() { return _savefile; } FilesystemFactory *getFilesystemFactory() { return &PSPFilesystemFactory::instance(); } void getTimeAndDate(TimeDate &t) const; virtual void engineDone(); -- cgit v1.2.3 From ff2ada1a0505321d085054d39651a1fb7928251c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 10:59:40 +0200 Subject: WII: Use OSystem's 'slots' for timer/savefile manager --- backends/platform/wii/osystem.cpp | 26 +++++--------------------- backends/platform/wii/osystem.h | 6 ------ backends/platform/wii/osystem_events.cpp | 1 + 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index c16578d9b3..a981c61aea 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -34,6 +34,8 @@ #include "common/config-manager.h" #include "common/textconsole.h" #include "backends/fs/wii/wii-fs-factory.h" +#include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h" #include "osystem.h" #include "options.h" @@ -96,20 +98,12 @@ OSystem_Wii::OSystem_Wii() : _padSensitivity(16), _padAcceleration(4), - _savefile(NULL), - _mixer(NULL), - _timer(NULL) { + _mixer(NULL) { } OSystem_Wii::~OSystem_Wii() { - delete _savefile; - _savefile = NULL; - delete _mixer; _mixer = NULL; - - delete _timer; - _timer = NULL; } void OSystem_Wii::initBackend() { @@ -143,8 +137,8 @@ void OSystem_Wii::initBackend() { if (!getcwd(buf, MAXPATHLEN)) strcpy(buf, "/"); - _savefile = new DefaultSaveFileManager(buf); - _timer = new DefaultTimerManager(); + _savefileManager = new DefaultSaveFileManager(buf); + _timerManager = new DefaultTimerManager(); initGfx(); initSfx(); @@ -261,21 +255,11 @@ void OSystem_Wii::setWindowCaption(const char *caption) { printf("window caption: %s\n", caption); } -Common::SaveFileManager *OSystem_Wii::getSavefileManager() { - assert(_savefile); - return _savefile; -} - Audio::Mixer *OSystem_Wii::getMixer() { assert(_mixer); return _mixer; } -Common::TimerManager *OSystem_Wii::getTimerManager() { - assert(_timer); - return _timer; -} - FilesystemFactory *OSystem_Wii::getFilesystemFactory() { return &WiiFilesystemFactory::instance(); } diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 981b25f69c..fe214a95cd 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -32,8 +32,6 @@ #include "common/rect.h" #include "common/events.h" #include "backends/base-backend.h" -#include "backends/saves/default/default-saves.h" -#include "backends/timer/default/default-timer.h" #include "graphics/colormasks.h" #include "graphics/palette.h" #include "graphics/surface.h" @@ -130,9 +128,7 @@ private: void showOptionsDialog(); protected: - Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; - DefaultTimerManager *_timer; public: enum { @@ -211,9 +207,7 @@ public: virtual void setWindowCaption(const char *caption); - virtual Common::SaveFileManager *getSavefileManager(); virtual Audio::Mixer *getMixer(); - virtual Common::TimerManager *getTimerManager(); virtual FilesystemFactory *getFilesystemFactory(); virtual void getTimeAndDate(TimeDate &t) const; diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp index 8e51bbc673..389d3823e7 100644 --- a/backends/platform/wii/osystem_events.cpp +++ b/backends/platform/wii/osystem_events.cpp @@ -35,6 +35,7 @@ #endif #include "common/config-manager.h" +#include "backends/timer/default/default-timer.h" #define TIMER_THREAD_STACKSIZE (1024 * 32) #define TIMER_THREAD_PRIO 64 -- cgit v1.2.3 From 4ebe2065b62909b1e7bb5e2b1458818fd60595f3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 11:46:33 +0200 Subject: WINCE: Add FIXME for timer code (maintainer notified) --- backends/platform/wince/wince-sdl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index a53bc41667..5b45e17973 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -379,6 +379,13 @@ void OSystem_WINCE3::initBackend() { ((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager); + + // FIXME: This timer manager is *not accesible* from the outside. + // Instead the timer manager setup by OSystem_SDL is visible on the outside. + // Since the WinCE backend actually seems to work, my guess is that + // SDL_AddTimer works after all and the following code is redundant. + // However it may be, this must be resolved one way or another. + // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). // We work around this by using the SetTimer function, since we only use // one timer in scummvm (for the time being) -- cgit v1.2.3 From f13e6717598efe32b15dab79389c6f21b9e2294a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 11:58:40 +0200 Subject: BACKENDS: All backends use _timerManager now, adapt OSystem accordingly --- common/system.cpp | 4 ---- common/system.h | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/system.cpp b/common/system.cpp index e34aeb54d6..6be7775b05 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -109,10 +109,6 @@ void OSystem::fatalError() { exit(1); } -Common::TimerManager *OSystem::getTimerManager() { - return _timerManager; -} - Common::SaveFileManager *OSystem::getSavefileManager() { assert(_savefileManager); return _savefileManager; diff --git a/common/system.h b/common/system.h index 9036dcd6e1..6b21ae4b82 100644 --- a/common/system.h +++ b/common/system.h @@ -890,7 +890,9 @@ public: * Return the timer manager singleton. For more information, refer * to the TimerManager documentation. */ - virtual Common::TimerManager *getTimerManager(); + inline Common::TimerManager *getTimerManager() { + return _timerManager; + } /** * Return the event manager singleton. For more information, refer -- cgit v1.2.3 From 98db614cd81c44f04345e697912b5904ebaa9af4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:03:55 +0200 Subject: DS: Use OSystem::_savefileManager slot --- backends/platform/ds/arm9/source/osystem_ds.cpp | 12 ++++-------- backends/platform/ds/arm9/source/osystem_ds.h | 2 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 6cc76f51a5..8fbe5ac934 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -107,6 +107,10 @@ void OSystem_DS::initBackend() { ConfMan.setInt("autosave_period", 0); ConfMan.setBool("FM_medium_quality", true); + if (DS::isGBAMPAvailable()) { + _savefileManager = &mpSaveManager; + } + _timerManager = new DefaultTimerManager(); DS::setTimerCallback(&OSystem_DS::timerHandler, 10); @@ -746,14 +750,6 @@ void OSystem_DS::quit() { swiSoftReset();*/ } -Common::SaveFileManager *OSystem_DS::getSavefileManager() { - if (DS::isGBAMPAvailable()) { - return &mpSaveManager; - } - return NULL; -} - - Graphics::Surface *OSystem_DS::createTempFrameBuffer() { // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index ad306b5e3b..b8a12a5808 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -138,8 +138,6 @@ public: virtual void quit(); - virtual Common::SaveFileManager *getSavefileManager(); - void addEvent(const Common::Event& e); bool isEventQueueEmpty() const { return queuePos == 0; } -- cgit v1.2.3 From 997f0a190083d9fcca743c95e8aca03e261b0f1c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:06:21 +0200 Subject: BACKENDS: All backends use _savefileManager now, adapt OSystem accordingly --- common/system.cpp | 13 ++++++++----- common/system.h | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/common/system.cpp b/common/system.cpp index 6be7775b05..27baea59f9 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -77,8 +77,16 @@ void OSystem::initBackend() { error("Backend failed to instantiate event manager"); if (!_timerManager) error("Backend failed to instantiate timer manager"); + + // TODO: We currently don't check _savefileManager, because at least + // on the Nintendo DS, it is possible that none is set. That should + // probably be treated as "saving is not possible". Or else the NDS + // port needs to be changed to always set a _savefileManager // if (!_savefileManager) // error("Backend failed to instantiate savefile manager"); + + // TODO: We currently don't check _fsFactory because not all ports + // set it. // if (!_fsFactory) // error("Backend failed to instantiate fs factory"); } @@ -109,11 +117,6 @@ void OSystem::fatalError() { exit(1); } -Common::SaveFileManager *OSystem::getSavefileManager() { - assert(_savefileManager); - return _savefileManager; -} - FilesystemFactory *OSystem::getFilesystemFactory() { assert(_fsFactory); return _fsFactory; diff --git a/common/system.h b/common/system.h index 6b21ae4b82..0d0ffda1e0 100644 --- a/common/system.h +++ b/common/system.h @@ -1042,7 +1042,9 @@ public: * and other modifiable persistent game data. For more information, * refer to the SaveFileManager documentation. */ - virtual Common::SaveFileManager *getSavefileManager(); + inline Common::SaveFileManager *getSavefileManager() { + return _savefileManager; + } /** * Returns the FilesystemFactory object, depending on the current architecture. -- cgit v1.2.3 From 1fafb97d01bba33edf02446080c1f9ab2faddf2a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:08:13 +0200 Subject: WINCE: Remove dead code --- backends/platform/wince/wince-sdl.cpp | 2 +- backends/platform/wince/wince-sdl.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 5b45e17973..9658720edc 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -389,7 +389,7 @@ void OSystem_WINCE3::initBackend() { // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). // We work around this by using the SetTimer function, since we only use // one timer in scummvm (for the time being) - _timer = _int_timer = new DefaultTimerManager(); + _int_timer = new DefaultTimerManager(); //_timerID = NULL; // OSystem_SDL will call removetimer with this, it's ok SDL_SetTimer(10, &timer_handler_wrapper); diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index a1e46081f9..cf365284ac 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -73,7 +73,6 @@ public: protected: void initSDL(); Audio::MixerImpl *_mixer; - DefaultTimerManager *_timer; FilesystemFactory *_fsFactory; private: -- cgit v1.2.3 From c74c8a59d9e8cfb0ae48eac91337451fd7599ce4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:09:35 +0200 Subject: WINCE: Use OSystem's _fsFactory slot --- backends/platform/wince/wince-sdl.cpp | 5 ----- backends/platform/wince/wince-sdl.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 9658720edc..d5f5c203d2 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -450,14 +450,9 @@ OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), } OSystem_WINCE3::~OSystem_WINCE3() { - delete _fsFactory; delete _mixer; } -FilesystemFactory *OSystem_WINCE3::getFilesystemFactory() { - return _fsFactory; -} - void OSystem_WINCE3::swap_sound_master() { _soundMaster = !_soundMaster; diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index cf365284ac..adb63eb936 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -58,7 +58,6 @@ public: void getTimeAndDate(TimeDate &t) const; virtual Common::String getDefaultConfigFileName(); - virtual FilesystemFactory *getFilesystemFactory(); void swap_sound_master(); @@ -73,7 +72,6 @@ public: protected: void initSDL(); Audio::MixerImpl *_mixer; - FilesystemFactory *_fsFactory; private: void check_mappings(); -- cgit v1.2.3 From 0a0c6ac07dd6ded3c0b90edd8c8ac3f9518c8a9d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:10:32 +0200 Subject: IPHONE: Use OSystem's _fsFactory slot --- backends/platform/iphone/osys_main.cpp | 1 - backends/platform/iphone/osys_main.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 4e5f860f20..5f27091108 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -72,7 +72,6 @@ OSystem_IPHONE::OSystem_IPHONE() : OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); - delete _fsFactory; delete _mixer; delete _offscreen; delete _fullscreen; diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 03d7cc1f79..e5ec22f19f 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -108,7 +108,6 @@ protected: bool _fullScreenIsDirty; bool _fullScreenOverlayIsDirty; int _screenChangeCount; - FilesystemFactory *_fsFactory; public: @@ -171,7 +170,6 @@ public: virtual int getScreenChangeID() const { return _screenChangeCount; } virtual void quit(); - FilesystemFactory *getFilesystemFactory() { return _fsFactory; } virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual void getTimeAndDate(TimeDate &t) const; -- cgit v1.2.3 From c701bdb708512cc929f4519b90f4e51cd4ccf5ae Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 7 Jun 2011 13:11:44 +0200 Subject: N64: Use OSystem's _fsFactory slot --- backends/platform/n64/osys_n64.h | 2 -- backends/platform/n64/osys_n64_base.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index b338887e56..2c908c7fc3 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -74,7 +74,6 @@ enum GraphicModeID { class OSystem_N64 : public BaseBackend, public PaletteManager { protected: Audio::MixerImpl *_mixer; - FilesystemFactory *_fsFactory; struct display_context * _dc; // Display context for N64 on screen buffer switching @@ -200,7 +199,6 @@ public: virtual Audio::Mixer *getMixer(); virtual void getTimeAndDate(TimeDate &t) const; virtual void setTimerCallback(TimerProc callback, int interval); - FilesystemFactory *getFilesystemFactory(); void rebuildOffscreenGameBuffer(void); void rebuildOffscreenMouseBuffer(void); diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 8a2d415d75..68a1a48607 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -155,7 +155,6 @@ OSystem_N64::OSystem_N64() { OSystem_N64::~OSystem_N64() { delete _mixer; - delete _fsFactory; } void OSystem_N64::initBackend() { @@ -871,10 +870,6 @@ void OSystem_N64::getTimeAndDate(TimeDate &t) const { return; } -FilesystemFactory *OSystem_N64::getFilesystemFactory() { - return _fsFactory; -} - void OSystem_N64::setTimerCallback(TimerProc callback, int interval) { assert (interval > 0); -- cgit v1.2.3 From 41e332a80df0195050db773a87d35ac80ec0fec3 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 7 Jun 2011 09:52:42 -0400 Subject: AUDIO: Clarify makeAACStream() usage So we don't have anyone calling the function or attempting to make the AAC code seekable or anything crazy like that. --- audio/decoders/aac.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/audio/decoders/aac.h b/audio/decoders/aac.h index f14fa9488b..efcbcc6f42 100644 --- a/audio/decoders/aac.h +++ b/audio/decoders/aac.h @@ -46,13 +46,16 @@ namespace Audio { class AudioStream; /** - * Create a new AudioStream from the AAC data in the given stream. + * Create a new AudioStream from the AAC data of an MPEG-4 file in the given stream. * - * @param stream the SeekableReadStream from which to read the AAC data + * @note This should *only* be called by our QuickTime/MPEG-4 decoder since it relies + * on the MPEG-4 extra data. If you want to decode a file using AAC, go use + * makeQuickTimeStream() instead! + * @param stream the SeekableReadStream from which to read the AAC data * @param disposeStream whether to delete the stream after use * @param extraData the SeekableReadStream from which to read the AAC extra data * @param disposeExtraData whether to delete the extra data stream after use - * @return a new AudioStream, or NULL, if an error occurred + * @return a new AudioStream, or NULL, if an error occurred */ AudioStream *makeAACStream( Common::SeekableReadStream *stream, -- cgit v1.2.3 From b6a9901e0a40ac838822fc2bc959801a6f2d62fa Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 7 Jun 2011 10:09:16 -0400 Subject: AUDIO: Remove tabs from comment spacing --- audio/decoders/quicktime.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h index ff81ec9390..413f527221 100644 --- a/audio/decoders/quicktime.h +++ b/audio/decoders/quicktime.h @@ -50,8 +50,8 @@ class SeekableAudioStream; * Try to load a QuickTime sound file from the given file name and create a SeekableAudioStream * from that data. * - * @param filename the filename of the file from which to read the data - * @return a new SeekableAudioStream, or NULL, if an error occurred + * @param filename the filename of the file from which to read the data + * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeQuickTimeStream(const Common::String &filename); @@ -59,9 +59,9 @@ SeekableAudioStream *makeQuickTimeStream(const Common::String &filename); * Try to load a QuickTime sound file from the given seekable stream and create a SeekableAudioStream * from that data. * - * @param stream the SeekableReadStream from which to read the data - * @param disposeAfterUse whether to delete the stream after use - * @return a new SeekableAudioStream, or NULL, if an error occurred + * @param stream the SeekableReadStream from which to read the data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeQuickTimeStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); -- cgit v1.2.3 From d6e23ac67b23b850147f519a88b9230997d9c877 Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 7 Jun 2011 18:27:13 +0200 Subject: AUDIO: improved warnings in detectDevice() Silent fallback would occur if the user expressly selected a formerly available audio device which now has become unavailable (switched off, disconnected, no longer compiled in, etc.). A warning dialogue will now be displayed, before the fallback takes place. --- audio/mididrv.cpp | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp index 22d473a518..80981eeccb 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -190,20 +190,30 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { case MT_NULL: reslt = hdl; + break; default: break; } Common::String failedDevStr; + if (getMusicType(hdl) == MT_INVALID) { + // If the expressly selected driver or device cannot be found (no longer compiled in, turned off, etc.) + // we display a warning and continue. + failedDevStr = ConfMan.get("music_driver"); + Common::String warningMsg = Common::String::format(_("The selected audio device '%s' was not found (e.g. might be turned off or disconnected). Attempting to fall back to the next available device..."), failedDevStr.c_str()); + GUI::MessageDialog dialog(warningMsg); + dialog.runModal(); + } + MusicType tp = getMusicType(reslt); if (tp != MT_INVALID && tp != MT_AUTO) { if (checkDevice(reslt)) { return reslt; } else { - // If the expressly selected device is unavailable we display a warning and continue. + // If the expressly selected device cannot be used we display a warning and continue. failedDevStr = getDeviceString(hdl, MidiDriver::kDeviceName); - Common::String warningMsg = Common::String::format(_("Failed to detect the selected audio device '%s'. See log file for more information. Attempting to fall back to the next available device..."), failedDevStr.c_str()); + Common::String warningMsg = Common::String::format(_("The selected audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), failedDevStr.c_str()); GUI::MessageDialog dialog(warningMsg); dialog.runModal(); } @@ -220,30 +230,41 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { while (flags != MDT_NONE) { if ((flags & MDT_MIDI) && !skipMidi) { // If a preferred MT32 or GM device has been selected that device gets returned if available. - if (flags & MDT_PREFER_MT32) - hdl = getDeviceHandle(ConfMan.get("mt32_device")); + Common::String devStr; + if (flags & MDT_PREFER_MT32) + devStr = ConfMan.get("mt32_device"); else if (flags & MDT_PREFER_GM) - hdl = getDeviceHandle(ConfMan.get("gm_device")); + devStr = ConfMan.get("gm_device"); else - hdl = getDeviceHandle("auto"); + devStr = "auto"; + hdl = getDeviceHandle(devStr); const MusicType type = getMusicType(hdl); // If we have a "Don't use GM/MT-32" setting we skip this part and jump // to AdLib, PC Speaker etc. detection right away. if (type != MT_NULL) { - if (type != MT_AUTO && type != MT_INVALID) { + if (type == MT_INVALID) { + // If the preferred (expressly requested) selected driver or device cannot be found (no longer compiled in, turned off, etc.) + // we display a warning and continue. Don't warn about the missing device if we did already (this becomes relevant if the + // missing device is selected as preferred device and also as GM or MT-32 device). + if (failedDevStr != devStr) { + Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' was not found (e.g. might be turned off or disconnected). Attempting to fall back to the next available device..."), devStr.c_str()); + GUI::MessageDialog dialog(warningMsg); + dialog.runModal(); + } + } else if (type != MT_AUTO) { if (checkDevice(hdl)) { if (flags & MDT_PREFER_MT32) // If we have a preferred MT32 device we disable the gm/mt32 mapping (more about this in mididrv.h). _forceTypeMT32 = true; return hdl; } else { - // If the preferred (expressly requested) device is unavailable we display a warning and continue. - // Don't warn about the missing device if we did already (this becomes relevant if the failing + // If the preferred (expressly requested) device cannot be used we display a warning and continue. + // Don't warn about the failing device if we did already (this becomes relevant if the failing // device is selected as preferred device and also as GM or MT-32 device). if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) { - Common::String warningMsg = Common::String::format(_("Failed to detect the preferred device '%s'. See log file for more information. Attempting to fall back to the next available device..."), getDeviceString(hdl, MidiDriver::kDeviceName).c_str()); + Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), getDeviceString(hdl, MidiDriver::kDeviceName).c_str()); GUI::MessageDialog dialog(warningMsg); dialog.runModal(); } -- cgit v1.2.3 From dbaf9e49c7358a2cdcee396bfe3381fd5571a30c Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 8 Jun 2011 03:13:13 +0100 Subject: AGI: Fix Broken Predictive Text Input. This was a regression introduced by 4b2f92b5e56a1fc273c8c8d2e69b747f938ea92f (r55135) --- engines/agi/predictive.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 80e89f410b..e45a5a8209 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -573,8 +573,10 @@ bool AgiEngine::matchWord() { hi = line - 1; else if (cmpVal < 0) lo = line + 1; - else + else { hi = line; + break; + } } _currentWord.clear(); -- cgit v1.2.3 From e3a409b9a42af315e8e9fb23c755bdc8357ddcf9 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 8 Jun 2011 03:38:52 +0100 Subject: AGI: Fix Engine Exit While Predictive Dialog Is Open. --- engines/agi/predictive.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index e45a5a8209..edfe83b1cb 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -190,7 +190,7 @@ bool AgiEngine::predictiveDialog() { bool needRefresh = true; - for (;;) { + while (!shouldQuit()) { if (needRefresh) { for (int i = 0; buttons[i]; i++) { int color1 = colors[i * 2]; -- cgit v1.2.3 From b5bb4125690e6277e001d0a1356ff50b2e361578 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 8 Jun 2011 04:16:54 +0100 Subject: AGI: Numeric Keypad Control in Predictive Dialog (Bug #3309376) In AGI games, the numeric keypad is used as an alias for cursor keys to allow stationary and 8 directional input, but while the predictive dialog is open, this is more sensibly mapped to numeric input to allow use of the predictive input on desktop ports. --- engines/agi/agi.cpp | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 78316588b0..811a58f45d 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -131,46 +131,65 @@ void AgiEngine::processEvents() { switch (key = event.kbd.keycode) { case Common::KEYCODE_LEFT: case Common::KEYCODE_KP4: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP4) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_LEFT; break; case Common::KEYCODE_RIGHT: case Common::KEYCODE_KP6: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP6) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_RIGHT; break; case Common::KEYCODE_UP: case Common::KEYCODE_KP8: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP8) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP; break; case Common::KEYCODE_DOWN: case Common::KEYCODE_KP2: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP2) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN; break; case Common::KEYCODE_PAGEUP: case Common::KEYCODE_KP9: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP9) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP_RIGHT; break; case Common::KEYCODE_PAGEDOWN: case Common::KEYCODE_KP3: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP3) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN_RIGHT; break; case Common::KEYCODE_HOME: case Common::KEYCODE_KP7: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP7) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_UP_LEFT; break; case Common::KEYCODE_END: case Common::KEYCODE_KP1: - if (_allowSynthetic || !event.synthetic) + if (_predictiveDialogRunning && key == Common::KEYCODE_KP1) + key = event.kbd.ascii; + else if (_allowSynthetic || !event.synthetic) key = KEY_DOWN_LEFT; break; case Common::KEYCODE_KP5: - key = KEY_STATIONARY; + if (_predictiveDialogRunning) + key = event.kbd.ascii; + else + key = KEY_STATIONARY; break; case Common::KEYCODE_PLUS: key = '+'; -- cgit v1.2.3 From bdd5256e1536b8a954e9000161fcdbd730a35bbe Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 8 Jun 2011 11:44:08 +0200 Subject: COMMON: Add headers needed for delete calls. --- common/system.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/system.cpp b/common/system.cpp index 27baea59f9..286ec419f2 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -30,10 +30,12 @@ #include "common/system.h" #include "common/events.h" #include "common/fs.h" +#include "common/savefile.h" #include "common/str.h" #include "common/textconsole.h" #include "backends/audiocd/default/default-audiocd.h" +#include "backends/fs/fs-factory.h" #include "backends/timer/default/default-timer.h" OSystem *g_system = 0; -- cgit v1.2.3 From 0b7f475e3506e69ed7ad8904ea0be28fd030726a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 12:10:14 +0200 Subject: BACKENDS: Add OSystem::resetGraphicsScale() default implementation --- backends/base-backend.cpp | 3 --- backends/base-backend.h | 2 -- common/system.h | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp index 156871eec5..a1027e098d 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -51,6 +51,3 @@ void BaseBackend::fillScreen(uint32 col) { memset(screen->pixels, col, screen->h * screen->pitch); unlockScreen(); } - -void BaseBackend::resetGraphicsScale() { -} diff --git a/backends/base-backend.h b/backends/base-backend.h index 6b19b7a9cb..bae77d4666 100644 --- a/backends/base-backend.h +++ b/backends/base-backend.h @@ -32,8 +32,6 @@ public: virtual void displayMessageOnOSD(const char *msg); virtual void fillScreen(uint32 col); - - virtual void resetGraphicsScale(); }; diff --git a/common/system.h b/common/system.h index 0d0ffda1e0..bea463410a 100644 --- a/common/system.h +++ b/common/system.h @@ -456,7 +456,7 @@ public: * reset the scale to x1 so the screen will not be too big when starting * the game. */ - virtual void resetGraphicsScale() = 0; + virtual void resetGraphicsScale() {} #ifdef USE_RGB_COLOR /** -- cgit v1.2.3 From 83f8f33c409aefd4fcae3fef5075a04f5a7eb74d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 12:13:10 +0200 Subject: BACKENDS: cleanup --- backends/base-backend.h | 2 +- backends/modular-backend.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backends/base-backend.h b/backends/base-backend.h index bae77d4666..b0dddf93bf 100644 --- a/backends/base-backend.h +++ b/backends/base-backend.h @@ -24,7 +24,7 @@ #define BACKENDS_BASE_BACKEND_H #include "common/system.h" -#include "backends/events/default/default-events.h" +#include "common/events.h" class BaseBackend : public OSystem, Common::EventSource { public: diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index e36348abd5..525170d685 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -24,15 +24,10 @@ #include "backends/modular-backend.h" -#include "backends/fs/fs-factory.h" #include "backends/graphics/graphics.h" #include "backends/mutex/mutex.h" #include "audio/mixer.h" -#include "common/events.h" -#include "common/timer.h" -#include "common/savefile.h" -#include "gui/message.h" #include "graphics/pixelformat.h" ModularBackend::ModularBackend() -- cgit v1.2.3 From 8e9e25c786c8100a9a5a5955b7153e0b6e27c8eb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 8 Jun 2011 21:23:25 +1000 Subject: TSAGE: Finished implementing voice type 0 post-processing for _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 119 ++++++++++++++++++++++++++++++++++++++++++++++-- engines/tsage/sound.h | 4 +- 2 files changed, 117 insertions(+), 6 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 69d2656baa..62f8787ace 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -669,6 +669,7 @@ void SoundManager::_sfRethinkVoiceTypes() { } } //TODO: Lots of this method + // Post-processing for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; @@ -677,6 +678,118 @@ void SoundManager::_sfRethinkVoiceTypes() { if (vs->_voiceType == VOICETYPE_0) { // Type 0 + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType0 &vse = vs->_entries[idx]._type0; + SoundDriver *driver = vs->_entries[idx]._driver; + assert(driver); + + if (vse._field12) { + int total = 0; + vse._sound = vse._sound2; + if (vse._sound3 != vse._sound) + ++total; + + vse._channelNum = vse._channelNum2; + if (vse._channelNum3 != vse._channelNum) + ++total; + + vse._field9 = vse._field11; + vse._fieldA = 1; + vse._sound2 = NULL; + + if (total) { + driver->proc24(vse._channelNum, idx, vse._sound, 123, 0); + driver->proc24(vse._channelNum, idx, vse._sound, 1, vse._sound->_chModulation[vse._channelNum]); + driver->proc24(vse._channelNum, idx, vse._sound, 7, + vse._sound->_chVolume[vse._channelNum] * vse._sound->_volume / 127); + driver->proc24(vse._channelNum, idx, vse._sound, 10, vse._sound->_chPan[vse._channelNum]); + driver->proc24(vse._channelNum, idx, vse._sound, 64, vse._sound->_chDamper[vse._channelNum]); + + driver->setProgram(vse._channelNum, vse._sound->_chProgram[vse._channelNum]); + driver->setPitchBlend(vse._channelNum, vse._sound->_chPitchBlend[vse._channelNum]); + + vse._sound3 = NULL; + } + } else { + vse._sound = NULL; + vse._channelNum = 0; + vse._field9 = 0; + vse._fieldA = 0; + } + } + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType0 &vse = vs->_entries[idx]._type0; + Sound *sound = vse._sound2; + int channelNum = vse._channelNum2; + + if (!sound) + continue; + + for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { + if ((vs->_entries[entryIndex]._type0._sound3 != sound) || + (vs->_entries[entryIndex]._type0._channelNum3 != channelNum)) { + // Found match + vs->_entries[entryIndex]._type0._sound = sound; + vs->_entries[entryIndex]._type0._channelNum = channelNum; + vs->_entries[entryIndex]._type0._field9 = vse._field11; + vs->_entries[entryIndex]._type0._fieldA = 0; + vse._sound2 = NULL; + break; + } + } + } + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType0 &vse = vs->_entries[idx]._type0; + Sound *sound = vse._sound2; + if (!sound) + continue; + + int voiceNum = 0, foundIndex = -1; + for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { + if ((vs->_entries[entryIndex]._field1) && !vs->_entries[entryIndex]._type0._sound) { + int tempVoice = vs->_entries[entryIndex]._voiceNum; + + if (voiceNum <= tempVoice) { + voiceNum = tempVoice; + foundIndex = entryIndex; + } + } + } + assert(foundIndex != -1); + + VoiceStructEntryType0 &vseFound = vs->_entries[foundIndex]._type0; + + vseFound._sound = vse._sound2; + vseFound._channelNum = vse._channelNum2; + vseFound._field9 = vse._field11; + vseFound._fieldA = 0; + + SoundDriver *driver = vs->_entries[foundIndex]._driver; + assert(driver); + + driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, 123, 0); + driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, + 1, vseFound._sound->_chModulation[vseFound._channelNum]); + driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, + 7, vseFound._sound->_chVolume[vseFound._channelNum] * vseFound._sound->_volume / 127); + driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, + 10, vseFound._sound->_chPan[vseFound._channelNum]); + driver->setProgram(vseFound._channelNum, vseFound._sound->_chProgram[vseFound._channelNum]); + driver->setPitchBlend(vseFound._channelNum, vseFound._sound->_chPitchBlend[vseFound._channelNum]); + } + + // Final loop + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType0 &vse = vs->_entries[idx]._type0; + + if (!vse._sound && (vse._sound3)) { + SoundDriver *driver = vs->_entries[idx]._driver; + assert(driver); + driver->proc24(vs->_entries[idx]._voiceNum, voiceIndex, vse._sound3, 123, 0); + } + } } else { // Type 1 @@ -863,7 +976,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { if (vs->_voiceType == VOICETYPE_0) { if (!vse._type0._sound) { int vol = sound->_volume * sound->_chVolume[vse._type0._channelNum] / 127; - driver->setVolume0(voiceIndex, vse._voiceNum, 7, vol); + driver->proc24(voiceIndex, vse._voiceNum, sound, 7, vol); } } else { if (!vse._type1._sound) { @@ -1419,7 +1532,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, v); } else if (voiceNum != -1) { assert(driver); - driver->setVolume0(voiceNum, chVoiceType, cmdVal, b); + driver->proc24(voiceNum, chVoiceType, this, cmdVal, b); } } } @@ -1450,7 +1563,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _soProc38(vtStruct, channelNum, chVoiceType, cmd, value); } else if (voiceNum != -1) { assert(driver); - driver->setVolume0(voiceNum, chVoiceType, cmd, value); + driver->proc24(voiceNum, chVoiceType, this, cmd, value); } } } else if (_soDoUpdateTracks(cmd, value)) { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 65f13a1650..30e2233f77 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -87,7 +87,7 @@ public: virtual void proc18(int al, VoiceType voiceType) {} virtual void proc20(int al, VoiceType voiceType) {} virtual void proc22(int al, VoiceType voiceType, int v3) {} - virtual void setVolume0(int channel, int v2, int v3, int volume) {} + virtual void proc24(int channel, int voiceIndex, Sound *sound, int v1, int v2) {} virtual void setProgram(int channel, int program) {} virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void setPitchBlend(int channel, int pitchBlend) {} @@ -107,9 +107,7 @@ struct VoiceStructEntryType0 { int _channelNum2; int _field11; int _field12; - int _field13; Sound *_sound3; - int _field16; int _channelNum3; int _field19; int _field1A; -- cgit v1.2.3 From 9f40bdcd2c355115ad1da29ad35e19840c619d54 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:14:54 +0200 Subject: DS: Prevent OSystem destructor from deleting _savefileManager --- backends/platform/ds/arm9/source/osystem_ds.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 8fbe5ac934..47e93cf31a 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -95,6 +95,12 @@ OSystem_DS::OSystem_DS() OSystem_DS::~OSystem_DS() { delete _mixer; + _mixer = 0; + + // If _savefileManager is not 0, then it points to the OSystem_DS + // member variable mpSaveManager. Hence we set _savefileManager to + // 0, to prevent the OSystem destructor from trying to delete it. + _savefileManager = 0; } int OSystem_DS::timerHandler(int t) { -- cgit v1.2.3 From d670b4bb561bdb935c6e574df2ed1ac478375878 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:22:00 +0200 Subject: BACKENDS: Fix BaseBackend::initBackend() (ouch) --- backends/base-backend.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp index a1027e098d..b5c1852b7d 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -43,6 +43,8 @@ void BaseBackend::initBackend() { if (!_eventManager) _eventManager = new DefaultEventManager(this); #endif + + OSystem::initBackend(); } void BaseBackend::fillScreen(uint32 col) { -- cgit v1.2.3 From fce7f90a94165158ea93d5969d795ad5a565847c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:29:22 +0200 Subject: BACKENDS: Shuffle backends class hierarchy and module initialization --- backends/base-backend.cpp | 13 ++++++++++++- backends/base-backend.h | 10 +++++++++- backends/modular-backend.h | 4 ++-- backends/platform/android/android.cpp | 2 +- backends/platform/android/android.h | 2 +- backends/platform/dc/dc.h | 2 +- backends/platform/dc/dcmain.cpp | 2 +- backends/platform/ds/arm9/source/osystem_ds.cpp | 2 +- backends/platform/ds/arm9/source/osystem_ds.h | 2 +- backends/platform/iphone/osys_main.cpp | 2 +- backends/platform/iphone/osys_main.h | 2 +- backends/platform/n64/osys_n64.h | 2 +- backends/platform/n64/osys_n64_base.cpp | 2 +- backends/platform/ps2/systemps2.h | 2 +- backends/platform/psp/osys_psp.cpp | 4 ++-- backends/platform/psp/osys_psp.h | 2 +- backends/platform/sdl/sdl.h | 2 ++ backends/platform/wii/osystem.cpp | 4 ++-- backends/platform/wii/osystem.h | 2 +- common/system.cpp | 6 ------ 20 files changed, 42 insertions(+), 27 deletions(-) diff --git a/backends/base-backend.cpp b/backends/base-backend.cpp index b5c1852b7d..8d22ab732d 100644 --- a/backends/base-backend.cpp +++ b/backends/base-backend.cpp @@ -29,6 +29,11 @@ #include "backends/events/default/default-events.h" #endif +#ifndef DISABLE_DEFAULT_AUDIOCD_MANAGER +#include "backends/audiocd/default/default-audiocd.h" +#endif + + #include "gui/message.h" void BaseBackend::displayMessageOnOSD(const char *msg) { @@ -41,7 +46,13 @@ void BaseBackend::initBackend() { // Init Event manager #ifndef DISABLE_DEFAULT_EVENT_MANAGER if (!_eventManager) - _eventManager = new DefaultEventManager(this); + _eventManager = new DefaultEventManager(getDefaultEventSource()); +#endif + + // Init audio CD manager +#ifndef DISABLE_DEFAULT_AUDIOCD_MANAGER + if (!_audiocdManager) + _audiocdManager = new DefaultAudioCDManager(); #endif OSystem::initBackend(); diff --git a/backends/base-backend.h b/backends/base-backend.h index b0dddf93bf..c797e831a8 100644 --- a/backends/base-backend.h +++ b/backends/base-backend.h @@ -26,7 +26,9 @@ #include "common/system.h" #include "common/events.h" -class BaseBackend : public OSystem, Common::EventSource { +class BaseBackend : public OSystem { +protected: + virtual Common::EventSource *getDefaultEventSource() = 0; public: virtual void initBackend(); @@ -34,5 +36,11 @@ public: virtual void fillScreen(uint32 col); }; +class EventsBaseBackend : public BaseBackend, Common::EventSource { +protected: + virtual Common::EventSource *getDefaultEventSource() { return this; } +public: +}; + #endif diff --git a/backends/modular-backend.h b/backends/modular-backend.h index d2c3ce2067..3593130bf5 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -23,7 +23,7 @@ #ifndef BACKENDS_MODULAR_BACKEND_H #define BACKENDS_MODULAR_BACKEND_H -#include "common/system.h" +#include "backends/base-backend.h" class GraphicsManager; class MutexManager; @@ -44,7 +44,7 @@ class MutexManager; * And, it should also initialize all the managers variables * declared in this class, or override their related functions. */ -class ModularBackend : public OSystem { +class ModularBackend : public BaseBackend { public: ModularBackend(); virtual ~ModularBackend(); diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 1acb080a60..90660cf82c 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -389,7 +389,7 @@ void OSystem_Android::initBackend() { JNI::setReadyForEvents(true); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } void OSystem_Android::addPluginDirectories(Common::FSList &dirs) const { diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index cd7ad5f8f0..c2ada2ab77 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -103,7 +103,7 @@ protected: }; #endif -class OSystem_Android : public BaseBackend, public PaletteManager { +class OSystem_Android : public EventsBaseBackend, public PaletteManager { private: // passed from the dark side int _audio_sample_rate; diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 84fdd58168..bde50daa2d 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -70,7 +70,7 @@ class DCCDManager : public DefaultAudioCDManager { void updateCD(); }; -class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory +class OSystem_Dreamcast : private DCHardware, public EventsBaseBackend, public PaletteManager, public FilesystemFactory #ifdef DYNAMIC_MODULES , public FilePluginProvider #endif diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index d1fcdd4a05..3faf0185ad 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -63,7 +63,7 @@ void OSystem_Dreamcast::initBackend() _audiocdManager = new DCCDManager(); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 47e93cf31a..b157a3a87a 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -134,7 +134,7 @@ void OSystem_DS::initBackend() { _audiocdManager = new DSAudioCDManager(); */ - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } bool OSystem_DS::hasFeature(Feature f) { diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index b8a12a5808..b1222a152d 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -34,7 +34,7 @@ #include "graphics/colormasks.h" #include "graphics/palette.h" -class OSystem_DS : public BaseBackend, public PaletteManager { +class OSystem_DS : public EventsBaseBackend, public PaletteManager { protected: int eventNum; diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 5f27091108..9325ed50bf 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -98,7 +98,7 @@ void OSystem_IPHONE::initBackend() { setTimerCallback(&OSystem_IPHONE::timerHandler, 10); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } bool OSystem_IPHONE::hasFeature(Feature f) { diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index e5ec22f19f..14325f8090 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -49,7 +49,7 @@ typedef struct AQCallbackStruct { AudioStreamBasicDescription dataFormat; } AQCallbackStruct; -class OSystem_IPHONE : public BaseBackend, public PaletteManager { +class OSystem_IPHONE : public EventsBaseBackend, public PaletteManager { protected: static const OSystem::GraphicsMode s_supportedGraphicsModes[]; diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index 2c908c7fc3..dfa8f58cce 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -71,7 +71,7 @@ enum GraphicModeID { OVERS_MPAL_340X240 }; -class OSystem_N64 : public BaseBackend, public PaletteManager { +class OSystem_N64 : public EventsBaseBackend, public PaletteManager { protected: Audio::MixerImpl *_mixer; diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 68a1a48607..69e8da3526 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -191,7 +191,7 @@ void OSystem_N64::initBackend() { setupMixer(); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } bool OSystem_N64::hasFeature(Feature f) { diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index d12d02b104..35ceaf829e 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -44,7 +44,7 @@ namespace Audio { class MixerImpl; }; -class OSystem_PS2 : public BaseBackend, public PaletteManager { +class OSystem_PS2 : public EventsBaseBackend, public PaletteManager { public: OSystem_PS2(const char *elfPath); virtual ~OSystem_PS2(void); diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 12916f8725..01124b420e 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -100,7 +100,7 @@ void OSystem_PSP::initBackend() { setupMixer(); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } // Let's us know an engine @@ -422,7 +422,7 @@ void OSystem_PSP::quit() { } void OSystem_PSP::logMessage(LogMessageType::Type type, const char *message) { - BaseBackend::logMessage(type, message); + EventsBaseBackend::logMessage(type, message); if (type == LogMessageType::kError) PspDebugTrace(false, "%s", message); // write to file diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 8ca09924ad..e6b445e232 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -42,7 +42,7 @@ #include "backends/timer/psp/timer.h" #include "backends/platform/psp/thread.h" -class OSystem_PSP : public BaseBackend, public PaletteManager { +class OSystem_PSP : public EventsBaseBackend, public PaletteManager { private: Audio::MixerImpl *_mixer; diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 917fac5558..9c08752054 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -91,6 +91,8 @@ protected: */ SdlEventSource *_eventSource; + virtual Common::EventSource *getDefaultEventSource() { return _eventSource; } + /** * Initialze the SDL library. */ diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index a981c61aea..c6b23783b8 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -144,7 +144,7 @@ void OSystem_Wii::initBackend() { initSfx(); initEvents(); - BaseBackend::initBackend(); + EventsBaseBackend::initBackend(); } void OSystem_Wii::quit() { @@ -361,7 +361,7 @@ Common::String OSystem_Wii::getSystemLanguage() const { } else { // This will only happen when new languages are added to the API. warning("WII: Unknown system language: %d", langID); - return BaseBackend::getSystemLanguage(); + return EventsBaseBackend::getSystemLanguage(); } } #endif // !GAMECUBE diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index fe214a95cd..6863a6840e 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -52,7 +52,7 @@ extern void wii_memstats(void); } #endif -class OSystem_Wii : public BaseBackend, public PaletteManager { +class OSystem_Wii : public EventsBaseBackend, public PaletteManager { private: s64 _startup_time; diff --git a/common/system.cpp b/common/system.cpp index 286ec419f2..fae7a3ef34 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -66,12 +66,6 @@ OSystem::~OSystem() { } void OSystem::initBackend() { - // Init audio CD manager -#ifndef DISABLE_DEFAULT_AUDIOCD_MANAGER - if (!_audiocdManager) - _audiocdManager = new DefaultAudioCDManager(); -#endif - // Verify all managers has been set if (!_audiocdManager) error("Backend failed to instantiate audio CD manager"); -- cgit v1.2.3 From 28c5d298f592e14468b722a781024298c3c8fa7b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:39:30 +0200 Subject: COMMON: Fix OSystem docs --- common/system.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/system.h b/common/system.h index bea463410a..d26bc593aa 100644 --- a/common/system.h +++ b/common/system.h @@ -118,8 +118,9 @@ protected: //@{ /** - * If no value is provided for this slot, then OSystem::initBackend() - * will populate it with a DefaultAudioCDManager instance. + * No default value is provided for _audiocdManager by OSystem. + * However, BaseBackend::initBackend() does set a default value + * if none has been set before. * * @note _audiocdManager is deleted by the OSystem destructor. */ -- cgit v1.2.3 From 8db8a0b3fc597c5c57f17ff4dd940bfd7baa216e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:58:53 +0200 Subject: TEST: Remove backends hack again --- test/module.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/module.mk b/test/module.mk index bed2dff04f..4e5cbf62e1 100644 --- a/test/module.mk +++ b/test/module.mk @@ -6,7 +6,7 @@ ###################################################################### TESTS := $(srcdir)/test/common/*.h $(srcdir)/test/audio/*.h -TEST_LIBS := backends/libbackends.a audio/libaudio.a common/libcommon.a +TEST_LIBS := audio/libaudio.a common/libcommon.a # TEST_FLAGS := --runner=StdioPrinter --no-std --no-eh -- cgit v1.2.3 From b0372e42100012d8a9e6ab949940c960ced7fee5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 8 Jun 2011 23:23:57 +1000 Subject: TSAGE: Finished implementing voice type 1 post processing for _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 6 ++--- 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 62f8787ace..ff8b87eb83 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -801,10 +801,66 @@ void SoundManager::_sfRethinkVoiceTypes() { } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - if (vse._type1._sound2) { - //dx/ax = vse._sound2; - //si = 0; + VoiceStructEntryType1 &vse = vs->_entries[idx]._type1; + Sound *sound = vse._sound2; + int channelNum = vse._channelNum2; + + if (!sound) + continue; + + for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { + VoiceStructEntryType1 &vse2 = vs->_entries[entryIndex]._type1; + if (!vse2._sound && (vse._sound3 == sound) && (vse._channelNum3 == channelNum)) { + vse2._sound = sound; + vse2._channelNum = channelNum; + vse._channelNum = vse2._channelNum2; + vse._fieldD = vse2._field13; + vse._sound2 = NULL; + break; + } + } + } + + uint idx2 = 0; + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType1 &vse = vs->_entries[idx]._type1; + Sound *sound = vse._sound2; + if (!sound) + continue; + + while (vs->_entries[idx2]._type1._sound) + ++idx2; + + VoiceStructEntryType1 &vse2 = vs->_entries[idx2]._type1; + vse2._sound = sound; + vse2._channelNum = vse._channelNum; + vse2._fieldD = vse._field13; + vse._field4 = -1; + vse2._field5 = 0; + vse2._field6 = 0; + + SoundDriver *driver = vs->_entries[idx2]._driver; + assert(driver); + + driver->updateVoice(vs->_entries[idx2]._voiceNum); + driver->proc38(vs->_entries[idx2]._voiceNum, 1, vse2._sound->_chModulation[vse2._channelNum]); + driver->proc38(vs->_entries[idx2]._voiceNum, 7, + vse2._sound->_chVolume[vse2._channelNum] * vse2._sound->_volume / 127); + driver->proc38(vs->_entries[idx2]._voiceNum, 10, vse2._sound->_chPan[vse2._channelNum]); + driver->proc40(vs->_entries[idx2]._voiceNum, vse2._sound->_chPitchBlend[vse2._channelNum]); + } + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntryType1 &vse = vs->_entries[idx]._type1; + + if (!vse._sound && (vse._sound3)) { + vse._field4 = -1; + vse._field5 = 0; + vse._field6 = 0; + + SoundDriver *driver = vs->_entries[idx]._driver; + assert(driver); + driver->updateVoice(voiceIndex); } } } @@ -1580,7 +1636,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _chPitchBlend[channel] = pitchBlend; if (voiceType != VOICETYPE_0) { - _soProc40(vtStruct, channelNum); + _soProc40(vtStruct, channelNum, pitchBlend); } else if (voiceNum != -1) { assert(driver); driver->setPitchBlend(channel, pitchBlend); @@ -1712,13 +1768,13 @@ void Sound::_soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voice SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - driver->proc38(vtStruct->_entries[entryIndex]._voiceNum); + driver->proc38(vtStruct->_entries[entryIndex]._voiceNum, cmd, value); } } } } -void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum) { +void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend) { for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) { VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; @@ -1726,7 +1782,7 @@ void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum) { SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - driver->proc40(vtStruct->_entries[entryIndex]._voiceNum); + driver->proc40(vtStruct->_entries[entryIndex]._voiceNum, pitchBlend); } } } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 30e2233f77..2f634a9a21 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -92,8 +92,8 @@ public: virtual void setVolume1(int channel, int v2, int v3, int volume) {} virtual void setPitchBlend(int channel, int pitchBlend) {} virtual void proc32(int voiceNum, int program, ...) {} // TODO: Determine params - virtual void proc38(int voiceNum) {} - virtual void proc40(int voiceNum) {} + virtual void proc38(int voiceNum, int cmd, int value) {} + virtual void proc40(int voiceNum, int pitchBlend) {} virtual void proc42(int voiceNum, ...) {} // TODO: Determine params virtual void updateVoice(int voiceNum) {} }; @@ -334,7 +334,7 @@ public: void _soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); void _soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); void _soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value); - void _soProc40(VoiceTypeStruct *vtStruct, int channelNum); + void _soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend); void _soDoTrackCommand(int channelNum, int command, int value); bool _soDoUpdateTracks(int command, int value); void _soSetTrackPos(int trackIndex, int trackPos, int cueValue); -- cgit v1.2.3 From 799ac4040f7f1bb657b6d61af3eedc58a1bf6c3b Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 8 Jun 2011 18:54:03 +0200 Subject: TSAGE: Comment/clarify some pathfinding code. --- engines/tsage/core.cpp | 48 ++++++++++++++++++++++++++++++------------------ engines/tsage/core.h | 2 +- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index b929beec23..aaec72ef35 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -521,9 +521,10 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo break; } - int var6; - proc1(routeRegions, srcRegion, destRegion, var6); + bool tempVar; // This is used only as internal state for the function. + calculateRestOfRoute(routeRegions, srcRegion, destRegion, tempVar); + // Empty route? if (!routeRegions[0]) { regionIndexes.push_back(destRegion); continue; @@ -539,6 +540,7 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo int endIndex = 0; int idx = 1; + // Find the indexes for each entry in the found route. do { int breakEntry = routeRegions[idx]; int breakEntry2 = routeRegions[idx + 1]; @@ -771,9 +773,10 @@ void PlayerMover::checkMovement2(const Common::Point &srcPos, const Common::Poin _sceneObject->_mover = this; } -int PlayerMover::proc1(int *routeList, int srcRegion, int destRegion, int &v) { +int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute) { + // Make a copy of the provided route. The first entry is the size. int tempList[REGION_LIST_SIZE + 1]; - v = 0; + foundRoute = false; for (int idx = 0; idx <= *routeList; ++idx) tempList[idx] = routeList[idx]; @@ -791,24 +794,28 @@ int PlayerMover::proc1(int *routeList, int srcRegion, int destRegion, int &v) { WalkRegion &srcWalkRegion = _globals->_walkRegions[srcRegion]; int distance; if (!routeList[0]) { - // No route + // The route is empty (new route). distance = 0; } else { + // Find the distance from the last region in the route. WalkRegion ®ion = _globals->_walkRegions[routeList[*routeList]]; distance = findDistance(srcWalkRegion._pt, region._pt); } + // Add the srcRegion to the end of the route. tempList[++*tempList] = srcRegion; - int newIndex = *tempList; + int ourListSize = *tempList; if (srcRegion == destRegion) { - v = 1; - for (int idx = newIndex; idx <= *tempList; ++idx) { + // We made a route to the destination; copy that route and return. + foundRoute = true; + for (int idx = ourListSize; idx <= *tempList; ++idx) { routeList[idx] = tempList[idx]; ++*routeList; } return distance; } else { + // Find the first connected region leading to our destination. int foundIndex = 0; int idx = 0; int currDest; @@ -821,27 +828,32 @@ int PlayerMover::proc1(int *routeList, int srcRegion, int destRegion, int &v) { ++idx; } - int resultOffset = 31990; - while (((currDest = _globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + foundIndex]) != 0) && (v == 0)) { - int newDistance = proc1(tempList, currDest, destRegion, v); + // Check every connected region until we find a route to the destination (or we have no more to check). + int bestDistance = 31990; + while (((currDest = _globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + foundIndex]) != 0) && (!foundRoute)) { + int newDistance = calculateRestOfRoute(tempList, currDest, destRegion, foundRoute); - if ((newDistance <= resultOffset) || v) { - routeList[0] = newIndex - 1; + if ((newDistance <= bestDistance) || foundRoute) { + // We found a shorter possible route, or one leading to the destination. - for (int i = newIndex; i <= tempList[0]; ++i) { + // Overwrite the route with this new one. + routeList[0] = ourListSize - 1; + + for (int i = ourListSize; i <= tempList[0]; ++i) { routeList[i] = tempList[i]; ++routeList[0]; } - resultOffset = newDistance; + bestDistance = newDistance; } - tempList[0] = newIndex; + // Truncate our local list to the size it was before the call. + tempList[0] = ourListSize; ++foundIndex; } - v = 0; - return resultOffset + distance; + foundRoute = false; + return bestDistance + distance; } } diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 71130e5b0b..1bdd49f26b 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -230,7 +230,7 @@ protected: int findClosestRegion(Common::Point &pt, const Common::List &indexList); int checkMover(Common::Point &srcPos, const Common::Point &destPos); void checkMovement2(const Common::Point &pt1, const Common::Point &pt2, int numSteps, Common::Point &ptOut); - int proc1(int *routeList, int srcRegion, int destRegion, int &v); + int calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute); static Common::Point *findLinePoint(RouteEnds *routeEnds, Common::Point *objPos, int length, Common::Point *outPos); static int findDistance(const Common::Point &pt1, const Common::Point &pt2); -- cgit v1.2.3 From 15292870822ce469963077db32528a1a03cd6bff Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 8 Jun 2011 19:30:22 +0200 Subject: GRAPHICS: Move comment to the right function. --- graphics/scaler/aspect.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp index 64a1cd1534..943395aff3 100644 --- a/graphics/scaler/aspect.cpp +++ b/graphics/scaler/aspect.cpp @@ -57,19 +57,6 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1 template static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width) { - // For efficiency reasons we blit two pixels at a time, so it is important - // that makeRectStretchable() guarantees that the width is even and that - // the rect starts on a well-aligned address. (Even where unaligned memory - // access is allowed there may be a speed penalty for it.) - - // These asserts are disabled for maximal speed; but I leave them in here - // in case other people want to test if the memory alignment (to an - // address divisible by 4) is really working properly. - //assert(((int)dst & 3) == 0); - //assert(((int)srcA & 3) == 0); - //assert(((int)srcB & 3) == 0); - //assert((width & 1) == 0); - if (scale == 1) { while (width--) { *dst++ = interpolate16_7_1(*srcB++, *srcA++); @@ -86,6 +73,18 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1 template static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width) { + // For efficiency reasons we blit two pixels at a time, so it is important + // that makeRectStretchable() guarantees that the width is even and that + // the rect starts on a well-aligned address. (Even where unaligned memory + // access is allowed there may be a speed penalty for it.) + + // These asserts are disabled for maximal speed; but I leave them in here + // in case other people want to test if the memory alignment (to an + // address divisible by 4) is really working properly. + //assert(((int)dst & 3) == 0); + //assert(((int)srcA & 3) == 0); + //assert(((int)srcB & 3) == 0); + //assert((width & 1) == 0); width /= 2; const uint32 *sA = (const uint32 *)srcA; -- cgit v1.2.3 From 89ed49d7e91c8177b92805e4bc76982fd2371baa Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 8 Jun 2011 23:16:57 +0200 Subject: TSAGE: Try to clarify more pathfinding code. --- engines/tsage/core.cpp | 164 ++++++++++++++++++++++++------------------------- engines/tsage/core.h | 4 +- 2 files changed, 83 insertions(+), 85 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index aaec72ef35..ed2b03ebc4 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -530,10 +530,14 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo continue; } - _globals->_walkRegions._field18[0]._pt1 = srcPos; - _globals->_walkRegions._field18[0]._pt2 = srcPos; - _globals->_walkRegions._field18[1]._pt1 = destPos; - _globals->_walkRegions._field18[1]._pt2 = destPos; + // field 0 holds the start, and field 1 holds the destination + WRField18 &currSrcField = _globals->_walkRegions._field18[0]; + WRField18 &currDestField = _globals->_walkRegions._field18[1]; + + currSrcField._pt1 = srcPos; + currSrcField._pt2 = srcPos; + currDestField._pt1 = destPos; + currDestField._pt2 = destPos; int tempList[REGION_LIST_SIZE]; tempList[0] = 0; @@ -558,49 +562,52 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo tempList[idx] = 1; for (int listIndex = 1; listIndex <= endIndex; ++listIndex) { - int var10 = tempList[listIndex]; - int var12 = tempList[listIndex + 1]; + int thisIdx = tempList[listIndex]; + int nextIdx = tempList[listIndex + 1]; + + WRField18 &thisField = _globals->_walkRegions._field18[thisIdx]; + WRField18 &nextField = _globals->_walkRegions._field18[nextIdx]; - if (sub_F8E5(_globals->_walkRegions._field18[0]._pt1, _globals->_walkRegions._field18[var12]._pt1, - _globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[var10]._pt2) && - sub_F8E5(_globals->_walkRegions._field18[0]._pt1, _globals->_walkRegions._field18[var12]._pt2, - _globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[var10]._pt2)) + if (sub_F8E5_calculatePoint(currSrcField._pt1, nextField._pt1, + thisField._pt1, thisField._pt2) && + sub_F8E5_calculatePoint(currSrcField._pt1, nextField._pt2, + thisField._pt1, thisField._pt2)) continue; Common::Point tempPt; - if (sub_F8E5(_globals->_walkRegions._field18[0]._pt1, _globals->_walkRegions._field18[1]._pt1, - _globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[var10]._pt2, &tempPt)) { + if (sub_F8E5_calculatePoint(currSrcField._pt1, currDestField._pt1, + thisField._pt1, thisField._pt2, &tempPt)) { // Add point to the route list - _globals->_walkRegions._field18[0]._pt1 = tempPt; + currSrcField._pt1 = tempPt; *routeList++ = tempPt; } else { - int v16 = - (findDistance(_globals->_walkRegions._field18[0]._pt1, _globals->_walkRegions._field18[var10]._pt1) << 1) + - (findDistance(_globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[1]._pt1) << 1) + - findDistance(_globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[var12]._pt1) + - findDistance(_globals->_walkRegions._field18[var10]._pt1, _globals->_walkRegions._field18[var12]._pt2); - - int v1A = - (findDistance(_globals->_walkRegions._field18[0]._pt1, _globals->_walkRegions._field18[var10]._pt2) << 1) + - (findDistance(_globals->_walkRegions._field18[var10]._pt2, _globals->_walkRegions._field18[1]._pt2) << 1) + - findDistance(_globals->_walkRegions._field18[var10]._pt2, _globals->_walkRegions._field18[var12]._pt1) + - findDistance(_globals->_walkRegions._field18[var10]._pt2, _globals->_walkRegions._field18[var12]._pt2); - - if (v16 < v1A) { - checkMovement2(_globals->_walkRegions._field18[var10]._pt1, - _globals->_walkRegions._field18[var10]._pt2, 1, objPos); + int dist1 = + (findDistance(currSrcField._pt1, thisField._pt1) << 1) + + (findDistance(thisField._pt1, currDestField._pt1) << 1) + + findDistance(thisField._pt1, nextField._pt1) + + findDistance(thisField._pt1, nextField._pt2); + + int dist2 = + (findDistance(currSrcField._pt1, thisField._pt2) << 1) + + (findDistance(thisField._pt2, currDestField._pt2) << 1) + + findDistance(thisField._pt2, nextField._pt1) + + findDistance(thisField._pt2, nextField._pt2); + + // Do 1 step of movement, storing the new position in objPos. + if (dist1 < dist2) { + doStepsOfNpcMovement(thisField._pt1, thisField._pt2, 1, objPos); } else { - checkMovement2(_globals->_walkRegions._field18[var10]._pt2, - _globals->_walkRegions._field18[var10]._pt1, 1, objPos); + doStepsOfNpcMovement(thisField._pt2, thisField._pt1, 1, objPos); } - _globals->_walkRegions._field18[0]._pt1 = objPos; + // Update the current position. + currSrcField._pt1 = objPos; *routeList++ = objPos; } } // Add in the route entry - *routeList++ = _globals->_walkRegions._field18[1]._pt1; + *routeList++ = currDestField._pt1; } // Mark the end of the path @@ -748,7 +755,7 @@ int PlayerMover::checkMover(Common::Point &srcPos, const Common::Point &destPos) return regionIndex; } -void PlayerMover::checkMovement2(const Common::Point &srcPos, const Common::Point &destPos, int numSteps, Common::Point &ptOut) { +void PlayerMover::doStepsOfNpcMovement(const Common::Point &srcPos, const Common::Point &destPos, int numSteps, Common::Point &ptOut) { Common::Point objPos = _sceneObject->_position; _sceneObject->_position = srcPos; uint32 regionBitList = _sceneObject->_regionBitList; @@ -867,71 +874,62 @@ int PlayerMover::findDistance(const Common::Point &pt1, const Common::Point &pt2 return (int)sqrt(xx + yy); } -bool PlayerMover::sub_F8E5(const Common::Point &pt1, const Common::Point &pt2, const Common::Point &pt3, +bool PlayerMover::sub_F8E5_calculatePoint(const Common::Point &pt1, const Common::Point &pt2, const Common::Point &pt3, const Common::Point &pt4, Common::Point *ptOut) { - double diff1 = pt2.x - pt1.x; - double diff2 = pt2.y - pt1.y; - double diff3 = pt4.x - pt3.x; - double diff4 = pt4.y - pt3.y; - double var10 = 0.0, var8 = 0.0; - double var18 = 0.0, var20 = 0.0; + double diffX1 = pt2.x - pt1.x; + double diffY1 = pt2.y - pt1.y; + double diffX2 = pt4.x - pt3.x; + double diffY2 = pt4.y - pt3.y; + double ratio1 = 0.0, ratio2 = 0.0; + double adjustedY1 = 0.0, adjustedY2 = 0.0; - if (diff1 != 0.0) { - var8 = diff2 / diff1; - var18 = pt1.y - (pt1.x * var8); + // Calculate the ratios between the X and Y points. + if (diffX1 != 0.0) { + ratio1 = diffY1 / diffX1; + adjustedY1 = pt1.y - (pt1.x * ratio1); } - if (diff3 != 0.0) { - var10 = diff4 / diff3; - var20 = pt3.y - (pt3.x * var10); + if (diffX2 != 0.0) { + ratio2 = diffY2 / diffX2; + adjustedY2 = pt3.y - (pt3.x * ratio2); } - if (var8 == var10) + if (ratio1 == ratio2) return false; - double var48, var50; - if (diff1 == 0) { - if (diff3 == 0) + double xPos, yPos; + if (diffX1 == 0) { + if (diffX2 == 0) return false; - var48 = pt1.x; - var50 = var10 * var48 + var20; + xPos = pt1.x; + yPos = ratio2 * xPos + adjustedY2; } else { - var48 = (diff3 == 0) ? pt3.x : (var20 - var18) / (var8 - var10); - var50 = var8 * var48 + var18; + xPos = (diffX2 == 0) ? pt3.x : (adjustedY2 - adjustedY1) / (ratio1 - ratio2); + yPos = ratio1 * xPos + adjustedY1; } - bool var52 = false, var56 = false, var54 = false, var58 = false; - Common::Point tempPt((int)(var48 + 0.5), (int)(var50 + 0.5)); - - if ((tempPt.x >= pt3.x) && (tempPt.x <= pt4.x)) - var56 = true; - else if ((tempPt.x >= pt4.x) && (tempPt.x <= pt3.x)) - var56 = true; - if (var56) { - if ((tempPt.y >= pt3.y) && (tempPt.y <= pt4.y)) - var58 = true; - else if ((tempPt.y >= pt4.y) && (tempPt.y <= pt3.y)) - var58 = true; - } + // This is our candidate point, which we must check for validity. + Common::Point tempPt((int)(xPos + 0.5), (int)(yPos + 0.5)); - if ((tempPt.x >= pt1.x) && (tempPt.x <= pt2.x)) - var52 = true; - else if ((tempPt.x >= pt2.x) && (tempPt.x <= pt1.x)) - var52 = true; - if (var52) { - if ((tempPt.y >= pt1.y) && (tempPt.y <= pt2.y)) - var54 = true; - else if ((tempPt.y >= pt2.y) && (tempPt.y <= pt1.y)) - var54 = true; - } + // Is tempPt inside the second bounds? + if (!((tempPt.x >= pt3.x) && (tempPt.x <= pt4.x))) + if (!((tempPt.x >= pt4.x) && (tempPt.x <= pt3.x))) + return false; + if (!((tempPt.y >= pt3.y) && (tempPt.y <= pt4.y))) + if (!((tempPt.y >= pt4.y) && (tempPt.y <= pt3.y))) + return false; - if (var52 && var54 && var56 && var58) { - if (ptOut) - *ptOut = tempPt; - return true; - } + // Is tempPt inside the first bounds? + if (!((tempPt.x >= pt1.x) && (tempPt.x <= pt2.x))) + if (!((tempPt.x >= pt2.x) && (tempPt.x <= pt1.x))) + return false; + if (!((tempPt.y >= pt1.y) && (tempPt.y <= pt2.y))) + if (!((tempPt.y >= pt2.y) && (tempPt.y <= pt1.y))) + return false; - return false; + if (ptOut) + *ptOut = tempPt; + return true; } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 1bdd49f26b..92907addbc 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -229,12 +229,12 @@ protected: int regionIndexOf(int xp, int yp) { return regionIndexOf(Common::Point(xp, yp)); } int findClosestRegion(Common::Point &pt, const Common::List &indexList); int checkMover(Common::Point &srcPos, const Common::Point &destPos); - void checkMovement2(const Common::Point &pt1, const Common::Point &pt2, int numSteps, Common::Point &ptOut); + void doStepsOfNpcMovement(const Common::Point &pt1, const Common::Point &pt2, int numSteps, Common::Point &ptOut); int calculateRestOfRoute(int *routeList, int srcRegion, int destRegion, bool &foundRoute); static Common::Point *findLinePoint(RouteEnds *routeEnds, Common::Point *objPos, int length, Common::Point *outPos); static int findDistance(const Common::Point &pt1, const Common::Point &pt2); - static bool sub_F8E5(const Common::Point &pt1, const Common::Point &pt2, const Common::Point &pt3, + static bool sub_F8E5_calculatePoint(const Common::Point &pt1, const Common::Point &pt2, const Common::Point &pt3, const Common::Point &pt4, Common::Point *ptOut = NULL); public: Common::Point _finalDest; -- cgit v1.2.3 From 8795871ba1dec3620ecd76008ba2cd8811c6642a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 9 Jun 2011 22:50:00 +1000 Subject: TSAGE: Started work on main area of _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 162 +++++++++++++++++++++++++++++++++++++++++++++--- engines/tsage/sound.h | 9 +-- 2 files changed, 158 insertions(+), 13 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ff8b87eb83..d7a8741c77 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -442,12 +442,34 @@ void SoundManager::_sfUpdateVoiceStructs() { } else { vse._type1._sound = vse._type1._sound2; vse._type1._channelNum = vse._type1._channelNum2; - vse._type1._fieldD = vse._type1._field13; + vse._type1._priority = vse._type1._priority2; } } } } +void SoundManager::_sfUpdateVoiceStructs2() { + for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { + VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[voiceIndex]; + + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + + if (vtStruct->_voiceType == VOICETYPE_0) { + VoiceStructEntryType0 &vse = vtStruct->_entries[idx]._type0; + vse._sound2 = vse._sound; + vse._channelNum2 = vse._channelNum; + vse._field11 = vse._field9; + vse._field12 = vse._fieldA; + } else { + VoiceStructEntryType1 &vse = vtStruct->_entries[idx]._type1; + vse._sound2 = vse._sound; + vse._channelNum2 = vse._channelNum; + vse._priority2 = vse._priority; + } + } + } +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -573,7 +595,7 @@ void SoundManager::_sfRethinkSoundDrivers() { vs->_field1 = total; } else { vs->_voiceType = VOICETYPE_1; - vs->_field1 = vs->_field2 = total; + vs->_field1 = vs->_numVoices = total; } for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -611,7 +633,7 @@ void SoundManager::_sfRethinkSoundDrivers() { ve._type1._field6 = 0; ve._type1._sound = NULL; ve._type1._channelNum = 0; - ve._type1._fieldD = 0; + ve._type1._priority = 0; vs->_entries.push_back(ve); } @@ -659,16 +681,138 @@ void SoundManager::_sfRethinkVoiceTypes() { VoiceStructEntry &vse = vs->_entries[idx]; vse._type1._sound3 = vse._type1._sound; vse._type1._channelNum3 = vse._type1._channelNum; - vse._type1._field19 = vse._type1._fieldD; + vse._type1._priority3 = vse._type1._priority; vse._type1._sound = NULL; vse._type1._channelNum = 0; - vse._type1._fieldD = 0; + vse._type1._priority = 0; vse._type1._sound2 = NULL; vse._type1._channelNum2 = 0; } } } -//TODO: Lots of this method + + // Main processing loop + int priorityOffset = 0; + for (Common::List::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i, priorityOffset += 16) { + Sound *sound = *i; + if ((sound->_mutedCount != 0) || (sound->_pausedCount != 0)) + continue; + + _sfUpdateVoiceStructs(); + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) + sound->_chWork[idx] = 0; + + for (;;) { + // Scan for sub priority + int foundIndex = -1, foundPriority = 0; + for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + if (!(sound->_chFlags[idx] & 0x8000) & !sound->_chWork[idx]) { + int subPriority = sound->_chSubPriority[idx]; + if (subPriority) + subPriority = 16 - subPriority + priorityOffset; + + if (foundIndex != -1) { + if (subPriority < foundPriority) { + foundIndex = idx; + foundPriority = subPriority; + } + } else { + foundIndex = idx; + foundPriority = subPriority; + } + } + } + if (foundIndex == -1) + break; + + int chNumVoices = sound->_chNumVoices[foundIndex]; + sound->_chWork[foundIndex] = 1; + + VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[sound->_chVoiceType[foundIndex]]; + if (!vtStruct) { + if (foundPriority) + continue; + + _sfUpdateVoiceStructs2(); + break; + } + + if (vtStruct->_voiceType != VOICETYPE_0) { + // Type 1 + int numVoices = vtStruct->_numVoices; + + if (numVoices >= chNumVoices) { + int channelCount = chNumVoices, idx = 0; + while (channelCount > 0) { + if (!vtStruct->_entries[idx]._type1._sound2) { + vtStruct->_entries[idx]._type1._sound2 = sound; + vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; + vtStruct->_entries[idx]._type1._priority2 = foundPriority; + --channelCount; + } + ++idx; + } + + vtStruct->_numVoices = numVoices; + continue; + } else if (!foundPriority) { + do { + int maxPriority = 0; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) + maxPriority = MAX(maxPriority, vtStruct->_entries[idx]._type1._priority2); + if (!maxPriority) { + _sfUpdateVoiceStructs2(); + break; + } + + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (vtStruct->_entries[idx]._type1._priority2 == maxPriority) { + vtStruct->_entries[idx]._type1._sound2 = NULL; + vtStruct->_entries[idx]._type1._channelNum2 = 0; + vtStruct->_entries[idx]._type1._priority2 = 0; + ++numVoices; + } + } + } while (chNumVoices > numVoices); + + int voicesCtr = numVoices; + for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) { + if (!vtStruct->_entries[idx]._type1._sound2) { + vtStruct->_entries[idx]._type1._sound2 = sound; + vtStruct->_entries[idx]._type1._channelNum2 = idx; + vtStruct->_entries[idx]._type1._priority2 = foundPriority; + --voicesCtr; + } + } + + numVoices -= chNumVoices; + vtStruct->_numVoices = numVoices; + continue; + } else if (!numVoices) { + break; + } + continue; + } else { + // Type 0 + if (sound->_isEmpty) { + uint idx = 0; + while ((idx < vtStruct->_entries.size()) && + (vtStruct->_entries[idx]._voiceNum == foundIndex)) + ++idx; + if (idx == vtStruct->_entries.size()) + continue; + } + + int flagsVal = sound->_chFlags[foundIndex] & 3; + if (flagsVal == 1) { + //int entryIndex = -1; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + + } + } + } + } + } // Post-processing for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { @@ -797,7 +941,7 @@ void SoundManager::_sfRethinkVoiceTypes() { VoiceStructEntry &vse = vs->_entries[idx]; vse._type1._sound = NULL; vse._type1._channelNum = 0; - vse._type1._fieldD = 0; + vse._type1._priority = 0; } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { @@ -814,7 +958,7 @@ void SoundManager::_sfRethinkVoiceTypes() { vse2._sound = sound; vse2._channelNum = channelNum; vse._channelNum = vse2._channelNum2; - vse._fieldD = vse2._field13; + vse._priority = vse2._priority2; vse._sound2 = NULL; break; } @@ -834,7 +978,7 @@ void SoundManager::_sfRethinkVoiceTypes() { VoiceStructEntryType1 &vse2 = vs->_entries[idx2]._type1; vse2._sound = sound; vse2._channelNum = vse._channelNum; - vse2._fieldD = vse._field13; + vse2._priority = vse._priority2; vse._field4 = -1; vse2._field5 = 0; vse2._field6 = 0; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 2f634a9a21..8115d034a1 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -120,13 +120,13 @@ struct VoiceStructEntryType1 { int _field6; Sound *_sound; int _channelNum; - int _fieldD; + int _priority; Sound *_sound2; int _channelNum2; - int _field13; + int _priority2; Sound *_sound3; int _channelNum3; - int _field19; + int _priority3; }; struct VoiceStructEntry { @@ -142,7 +142,7 @@ class VoiceTypeStruct { public: VoiceType _voiceType; int _field1; - int _field2; + int _numVoices; int _field3; Common::Array _entries; @@ -237,6 +237,7 @@ public: static void _sfSoundServer(); static void _sfProcessFading(); static void _sfUpdateVoiceStructs(); + static void _sfUpdateVoiceStructs2(); }; class Sound: public EventHandler { -- cgit v1.2.3 From 80d0bc0c85c45f76633a55cf56f504eaae83b2d0 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 9 Jun 2011 19:09:54 +0200 Subject: KYRA: Get rid of most snprintf usages. Thanks to digitall for his initial patch, which I only altered slightly. --- engines/kyra/animator_mr.cpp | 7 +++--- engines/kyra/gui_lol.cpp | 14 +++++------ engines/kyra/gui_mr.cpp | 20 +++++++-------- engines/kyra/kyra_mr.cpp | 33 +++++++----------------- engines/kyra/kyra_mr.h | 2 -- engines/kyra/lol.cpp | 57 +++++++++++++++++------------------------- engines/kyra/scene_lol.cpp | 42 +++++++++++++------------------ engines/kyra/script_lol.cpp | 10 +++----- engines/kyra/script_tim.cpp | 26 +++++++++---------- engines/kyra/sequences_lol.cpp | 5 ++-- engines/kyra/sound_lok.cpp | 5 ++-- engines/kyra/sound_lol.cpp | 40 +++++++++++++---------------- engines/kyra/text_hof.cpp | 9 ++++--- engines/kyra/text_mr.cpp | 12 +++------ 14 files changed, 117 insertions(+), 165 deletions(-) diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index 6db2e45b0e..84bda3f3fd 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -449,11 +449,10 @@ void KyraEngine_MR::showIdleAnim() { "A", "R", "R", "FR", "FX", "FL", "L", "L" }; - char filename[14]; - snprintf(filename, 14, "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _characterShapeFile); + Common::String filename = Common::String::format( "MI0%s%.02d.EMC", facingTable[_mainCharacter.facing], _characterShapeFile); - if (_res->exists(filename)) - runAnimationScript(filename, 1, 1, 1, 1); + if (_res->exists(filename.c_str())) + runAnimationScript(filename.c_str(), 1, 1, 1, 1); } _nextIdleType = !_nextIdleType; diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 4c4dc50503..80eacb3f87 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -2806,16 +2806,16 @@ int GUI_LoL::clickedOptionsMenu(Button *button) { case 0xfff3: _vm->_configVoice ^= 3; break; - case 0x4072: - char filename[13]; - snprintf(filename, sizeof(filename), "LEVEL%02d.%s", _vm->_currentLevel, _vm->_languageExt[_vm->_lang]); + case 0x4072: { + Common::String filename; + filename = Common::String::format("LEVEL%02d.%s", _vm->_currentLevel, _vm->_languageExt[_vm->_lang]); delete[] _vm->_levelLangFile; - _vm->_levelLangFile = _vm->resource()->fileData(filename, 0); - snprintf(filename, sizeof(filename), "LANDS.%s", _vm->_languageExt[_vm->_lang]); + _vm->_levelLangFile = _vm->resource()->fileData(filename.c_str(), 0); + filename = Common::String::format("LANDS.%s", _vm->_languageExt[_vm->_lang]); delete[] _vm->_landsFile; - _vm->_landsFile = _vm->resource()->fileData(filename, 0); + _vm->_landsFile = _vm->resource()->fileData(filename.c_str(), 0); _newMenu = _lastMenu; - break; + } break; } return 1; diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 25a77c6cc8..32eb02e06d 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -717,25 +717,25 @@ void KyraEngine_MR::showAlbum() { } void KyraEngine_MR::loadAlbumPage() { - char filename[16]; + Common::String filename; int num = _album.curPage / 2; if (num == 0) { - strcpy(filename, "ALBUM0.CPS"); + filename = "ALBUM0.CPS"; } else if (num >= 1 && num <= 6) { --num; num %= 2; - snprintf(filename, 16, "ALBUM%d.CPS", num+1); + filename = Common::String::format("ALBUM%d.CPS", num+1); } else { - strcpy(filename, "ALBUM3.CPS"); + filename = "ALBUM3.CPS"; } _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 4, Screen::CR_NO_P_CHECK); - _screen->loadBitmap(filename, 3, 3, 0); + _screen->loadBitmap(filename.c_str(), 3, 3, 0); } void KyraEngine_MR::loadAlbumPageWSA() { - char filename[16]; + Common::String filename; _album.leftPage.curFrame = 0; _album.leftPage.maxFrame = 0; @@ -746,14 +746,14 @@ void KyraEngine_MR::loadAlbumPageWSA() { _album.rightPage.wsa->close(); if (_album.curPage) { - snprintf(filename, 16, "PAGE%x.WSA", _album.curPage); - _album.leftPage.wsa->open(filename, 1, 0); + filename = Common::String::format("PAGE%x.WSA", _album.curPage); + _album.leftPage.wsa->open(filename.c_str(), 1, 0); _album.leftPage.maxFrame = _album.leftPage.wsa->frames()-1; } if (_album.curPage != 14) { - snprintf(filename, 16, "PAGE%x.WSA", _album.curPage+1); - _album.rightPage.wsa->open(filename, 1, 0); + filename = Common::String::format("PAGE%x.WSA", _album.curPage+1); + _album.rightPage.wsa->open(filename.c_str(), 1, 0); _album.rightPage.maxFrame = _album.leftPage.wsa->frames()-1; } } diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 4ce5c5b2cf..973ab25088 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -366,10 +366,9 @@ void KyraEngine_MR::uninitMainMenu() { void KyraEngine_MR::playVQA(const char *name) { VQAMovie vqa(this, _system); - char filename[20]; - snprintf(filename, sizeof(filename), "%s%d.VQA", name, _configVQAQuality); + Common::String filename = Common::String::format("%s%d.VQA", name, _configVQAQuality); - if (vqa.open(filename)) { + if (vqa.open(filename.c_str())) { for (int i = 0; i < 4; ++i) { if (i != _musicSoundChannel) _soundDigital->stopSound(i); @@ -444,12 +443,11 @@ void KyraEngine_MR::fadeOutMusic(int ticks) { void KyraEngine_MR::snd_playSoundEffect(int item, int volume) { if (_sfxFileMap[item*2+0] != 0xFF) { - char filename[16]; assert(_sfxFileMap[item*2+0] < _sfxFileListSize); - snprintf(filename, 16, "%s", _sfxFileList[_sfxFileMap[item*2+0]]); + Common::String filename = Common::String::format("%s", _sfxFileList[_sfxFileMap[item*2+0]]); uint8 priority = _sfxFileMap[item*2+1]; - _soundDigital->playSound(filename, priority, Audio::Mixer::kSFXSoundType, volume); + _soundDigital->playSound(filename.c_str(), priority, Audio::Mixer::kSFXSoundType, volume); } } @@ -458,11 +456,10 @@ void KyraEngine_MR::playVoice(int high, int low) { } void KyraEngine_MR::snd_playVoiceFile(int file) { - char filename[16]; - snprintf(filename, 16, "%.08u", (uint)file); + Common::String filename = Common::String::format("%.08u", (uint)file); if (speechEnabled()) - _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255); + _voiceSoundChannel = _soundDigital->playSound(filename.c_str(), 0xFE, Audio::Mixer::kSpeechSoundType, 255); } bool KyraEngine_MR::snd_voiceIsPlaying() { @@ -1242,26 +1239,14 @@ void KyraEngine_MR::restoreGfxRect32x32(int x, int y) { #pragma mark - -char *KyraEngine_MR::appendLanguage(char *buf, int lang, int bufSize) { - assert(lang < _languageExtensionSize); - - const int size = Common::strlcat(buf, _languageExtension[lang], bufSize); - if (size >= bufSize) { - warning("buffer too small to append language extension"); - return 0; - } - - return buf; -} - int KyraEngine_MR::loadLanguageFile(const char *file, uint8 *&buffer) { delete[] buffer; buffer = 0; uint32 size = 0; - char nBuf[32]; - Common::strlcpy(nBuf, file, sizeof(nBuf)); - buffer = _res->fileData(appendLanguage(nBuf, _lang, sizeof(nBuf)), &size); + Common::String nBuf = file; + nBuf += _languageExtension[_lang]; + buffer = _res->fileData(nBuf.c_str(), &size); return buffer ? size : 0; } diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index 0d9d66ce95..b762648d29 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -662,8 +662,6 @@ private: static const char *_languageExtension[]; static const int _languageExtensionSize; - char *appendLanguage(char *buf, int lang, int bufSize); - int loadLanguageFile(const char *file, uint8 *&buffer); }; diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 3a8a332840..0d4eb0056c 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -611,11 +611,11 @@ void LoLEngine::preInit() { loadTalkFile(0); - char filename[32]; - snprintf(filename, sizeof(filename), "LANDS.%s", _languageExt[_lang]); - _res->exists(filename, true); + Common::String filename; + filename = Common::String::format("LANDS.%s", _languageExt[_lang]); + _res->exists(filename.c_str(), true); delete[] _landsFile; - _landsFile = _res->fileData(filename, 0); + _landsFile = _res->fileData(filename.c_str(), 0); loadItemIconShapes(); } @@ -1161,9 +1161,8 @@ void LoLEngine::loadCharFaceShapes(int charNum, int id) { if (id < 0) id = -id; - char file[13]; - snprintf(file, sizeof(file), "FACE%02d.SHP", id); - _screen->loadBitmap(file, 3, 3, 0); + Common::String file = Common::String::format("FACE%02d.SHP", id); + _screen->loadBitmap(file.c_str(), 3, 3, 0); const uint8 *p = _screen->getCPagePtr(3); for (int i = 0; i < 40; i++) { @@ -1819,21 +1818,16 @@ void LoLEngine::updateSequenceBackgroundAnimations() { } void LoLEngine::loadTalkFile(int index) { - char file[8]; - if (index == _curTlkFile) return; - if (_curTlkFile > 0 && index > 0) { - snprintf(file, sizeof(file), "%02d.TLK", _curTlkFile); - _res->unloadPakFile(file); - } + if (_curTlkFile > 0 && index > 0) + _res->unloadPakFile(Common::String::format("%02d.TLK", _curTlkFile)); if (index > 0) _curTlkFile = index; - snprintf(file, sizeof(file), "%02d.TLK", index); - _res->loadPakFile(file); + _res->loadPakFile(Common::String::format("%02d.TLK", index)); } int LoLEngine::characterSays(int track, int charId, bool redraw) { @@ -2702,12 +2696,11 @@ int LoLEngine::processMagicMistOfDoom(int charNum, int spellLevel) { snd_playSoundEffect(155, -1); - char wsafile[13]; - snprintf(wsafile, 13, "mists%0d.wsa", spellLevel + 1); + Common::String wsafile = Common::String::format("mists%0d.wsa", spellLevel + 1); WSAMovie_v2 *mov = new WSAMovie_v2(this); - mov->open(wsafile, 1, 0); + mov->open(wsafile.c_str(), 1, 0); if (!mov->opened()) - error("Mist: Unable to load mists.wsa"); + error("Mist: Unable to load %s", wsafile.c_str()); snd_playSoundEffect(_mistAnimData[spellLevel].sound, -1); playSpellAnimation(mov, _mistAnimData[spellLevel].part1First, _mistAnimData[spellLevel].part1Last, 7, 112, 0, 0, 0, 0, 0, false); @@ -2734,12 +2727,11 @@ int LoLEngine::processMagicLightning(int charNum, int spellLevel) { _lightningDiv = _lightningProps[spellLevel].frameDiv; _lightningFirstSfx = 0; - char wsafile[13]; - snprintf(wsafile, 13, "litning%d.wsa", spellLevel + 1); + Common::String wsafile = Common::String::format("litning%d.wsa", spellLevel + 1); WSAMovie_v2 *mov = new WSAMovie_v2(this); - mov->open(wsafile, 1, 0); + mov->open(wsafile.c_str(), 1, 0); if (!mov->opened()) - error("Litning: Unable to load litning.wsa"); + error("Litning: Unable to load %s", wsafile.c_str()); for (int i = 0; i < 4; i++) playSpellAnimation(mov, 0, _lightningProps[spellLevel].lastFrame, 3, 93, 0, &LoLEngine::callbackProcessMagicLightning, 0, 0, 0, false); @@ -3139,11 +3131,10 @@ void LoLEngine::transferSpellToScollAnimation(int charNum, int spell, int slot) int vX = _updateSpellBookCoords[slot << 1] + 32; int vY = _updateSpellBookCoords[(slot << 1) + 1] + 5; - char wsaFile[13]; + Common::String wsaFile = Common::String::format("write%0d", spell); if (_flags.isTalkie) - snprintf(wsaFile, 13, "write%0d%c.wsa", spell, (_lang == 1) ? 'f' : (_lang == 0 ? 'e' : 'g')); - else - snprintf(wsaFile, 13, "write%0d.wsa", spell); + wsaFile += (_lang == 1) ? 'f' : (_lang == 0 ? 'e' : 'g'); + wsaFile += ".wsa"; snd_playSoundEffect(_updateSpellBookAnimData[(spell << 2) + 3], -1); snd_playSoundEffect(95, -1); @@ -3187,7 +3178,7 @@ void LoLEngine::transferSpellToScollAnimation(int charNum, int spell, int slot) playSpellAnimation(mov, 0, 6, 5, _updateSpellBookCoords[slot << 1], _updateSpellBookCoords[(slot << 1) + 1], 0, 0, 0, 0, false); mov->close(); - mov->open(wsaFile, 0, 0); + mov->open(wsaFile.c_str(), 0, 0); if (!mov->opened()) error("SpellBook: Unable to load spellbook anim"); snd_playSoundEffect(_updateSpellBookAnimData[(spell << 2) + 3], -1); @@ -4160,10 +4151,9 @@ void LoLEngine::loadMapLegendData(int level) { legendData[i * 6 + 5] = 0xffff; } - char file[13]; + Common::String file = Common::String::format("level%d.xxx", level); uint32 size = 0; - snprintf(file, 12, "level%d.xxx", level); - uint8 *data = _res->fileData(file, &size); + uint8 *data = _res->fileData(file.c_str(), &size); uint8 *pos = data; size = MIN(size / 12, 32); @@ -4531,10 +4521,9 @@ void LoLEngine::generateTempData() { _lvlTempData[l]->monsters = new MonsterInPlay[30]; _lvlTempData[l]->flyingObjects = new FlyingObject[8]; - char filename[13]; - snprintf(filename, sizeof(filename), "LEVEL%d.CMZ", _currentLevel); + Common::String filename = Common::String::format("LEVEL%d.CMZ", _currentLevel); - _screen->loadBitmap(filename, 15, 15, 0); + _screen->loadBitmap(filename.c_str(), 15, 15, 0); const uint8 *p = _screen->getCPagePtr(14); uint16 len = READ_LE_UINT16(p + 4); p += 6; diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 305036fc51..165919dff2 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -67,18 +67,17 @@ void LoLEngine::loadLevel(int index) { loadLevelWallData(index, true); _loadLevelFlag = 1; - char filename[13]; - snprintf(filename, sizeof(filename), "LEVEL%d.INI", index); + Common::String filename = Common::String::format("LEVEL%d.INI", index); int f = _hasTempDataFlags & (1 << (index - 1)); - runInitScript(filename, f ? 0 : 1); + runInitScript(filename.c_str(), f ? 0 : 1); if (f) restoreBlockTempData(index); - snprintf(filename, sizeof(filename), "LEVEL%d.INF", index); - runInfScript(filename); + filename = Common::String::format("LEVEL%d.INF", index); + runInfScript(filename.c_str()); addLevelItems(); deleteMonstersFromBlock(_currentBlock); @@ -142,11 +141,10 @@ void LoLEngine::assignBlockObject(LevelBlockProperty *l, uint16 item) { } void LoLEngine::loadLevelWallData(int index, bool mapShapes) { - char filename[13]; - snprintf(filename, sizeof(filename), "LEVEL%d.WLL", index); + Common::String filename = Common::String::format("LEVEL%d.WLL", index); uint32 size; - uint8 *file = _res->fileData(filename, &size); + uint8 *file = _res->fileData(filename.c_str(), &size); uint16 c = READ_LE_UINT16(file); loadLevelShpDat(_levelShpList[c], _levelDatList[c], false); @@ -241,10 +239,9 @@ void LoLEngine::restoreBlockTempData(int index) { memcpy(_monsters, _lvlTempData[l]->monsters, sizeof(MonsterInPlay) * 30); memcpy(_flyingObjects, _lvlTempData[l]->flyingObjects, sizeof(FlyingObject) * 8); - char filename[13]; - snprintf(filename, sizeof(filename), "LEVEL%d.CMZ", index); + Common::String filename = Common::String::format("LEVEL%d.CMZ", index); - _screen->loadBitmap(filename, 3, 3, 0); + _screen->loadBitmap(filename.c_str(), 3, 3, 0); const uint8 *p = _screen->getCPagePtr(2); uint16 len = READ_LE_UINT16(p + 4); p += 6; @@ -366,13 +363,13 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight _lastSpecialColor = 0x44; } - char fname[13]; + Common::String fname; const uint8 *v = 0; int tlen = 0; if (_flags.use16ColorMode) { - snprintf(fname, sizeof(fname), "%s.VCF", _lastBlockDataFile); - _screen->loadBitmap(fname, 3, 3, 0); + fname = Common::String::format("%s.VCF", _lastBlockDataFile); + _screen->loadBitmap(fname.c_str(), 3, 3, 0); v = _screen->getCPagePtr(2); tlen = READ_LE_UINT16(v) << 5; v += 2; @@ -383,8 +380,8 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight memcpy(_vcfBlocks, v, tlen); } - snprintf(fname, sizeof(fname), "%s.VCN", _lastBlockDataFile); - _screen->loadBitmap(fname, 3, 3, 0); + fname = Common::String::format("%s.VCN", _lastBlockDataFile); + _screen->loadBitmap(fname.c_str(), 3, 3, 0); v = _screen->getCPagePtr(2); tlen = READ_LE_UINT16(v); v += 2; @@ -434,8 +431,8 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight memcpy(_vcnBlocks, v, vcnLen); v += vcnLen; - snprintf(fname, sizeof(fname), "%s.VMP", _lastBlockDataFile); - _screen->loadBitmap(fname, 3, 3, 0); + fname = Common::String::format("%s.VMP", _lastBlockDataFile); + _screen->loadBitmap(fname.c_str(), 3, 3, 0); v = _screen->getCPagePtr(2); if (vmpLen == -1) @@ -503,9 +500,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight generateBrightnessPalette(_screen->getPalette(0), _screen->getPalette(1), _brightness, _lampEffect); if (_flags.isTalkie) { - char tname[13]; - snprintf(tname, sizeof(tname), "LEVEL%.02d.TLC", _currentLevel); - Common::SeekableReadStream *s = _res->createReadStream(tname); + Common::SeekableReadStream *s = _res->createReadStream(Common::String::format("LEVEL%.02d.TLC", _currentLevel)); s->read(_transparencyTable1, 256); s->read(_transparencyTable2, 5120); delete s; @@ -1375,9 +1370,8 @@ void LoLEngine::processGasExplosion(int soundId) { if (dist) { WSAMovie_v2 *mov = new WSAMovie_v2(this); - char file[13]; - snprintf(file, 13, "gasexp%0d.wsa", dist); - mov->open(file, 1, 0); + Common::String file = Common::String::format("gasexp%0d.wsa", dist); + mov->open(file.c_str(), 1, 0); if (!mov->opened()) error("Gas: Unable to load gasexp.wsa"); diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index a875e67a68..695528b8d1 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -1136,9 +1136,8 @@ int LoLEngine::olol_loadTimScript(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_loadTimScript(%p) (%d, %s)", (const void *)script, stackPos(0), stackPosString(1)); if (_activeTim[stackPos(0)]) return 1; - char file[13]; - snprintf(file, sizeof(file), "%s.TIM", stackPosString(1)); - _activeTim[stackPos(0)] = _tim->load(file, &_timIngameOpcodes); + Common::String file = Common::String::format("%s.TIM", stackPosString(1)); + _activeTim[stackPos(0)] = _tim->load(file.c_str(), &_timIngameOpcodes); return 1; } @@ -1185,10 +1184,9 @@ int LoLEngine::olol_giveItemToMonster(EMCState *script) { int LoLEngine::olol_loadLangFile(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_loadLangFile(%p) (%s)", (const void *)script, stackPosString(0)); - char filename[13]; - snprintf(filename, sizeof(filename), "%s.%s", stackPosString(0), _languageExt[_lang]); + Common::String filename = Common::String::format("%s.%s", stackPosString(0), _languageExt[_lang]); delete[] _levelLangFile; - _levelLangFile = _res->fileData(filename, 0); + _levelLangFile = _res->fileData(filename.c_str(), 0); return 1; } diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 501ae2defd..6f0f0ab083 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -482,17 +482,16 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y wsaOpenFlags = 1; } - char file[32]; - snprintf(file, 32, "%s.WSA", filename); + Common::String file = Common::String::format("%s.WSA", filename); - if (_vm->resource()->exists(file)) { + if (_vm->resource()->exists(file.c_str())) { if (isLoLDemo) wsa = new WSAMovie_v1(_vm); else wsa = new WSAMovie_v2(_vm); assert(wsa); - wsa->open(file, wsaOpenFlags, (index == 1) ? &_screen->getPalette(0) : 0); + wsa->open(file.c_str(), wsaOpenFlags, (index == 1) ? &_screen->getPalette(0) : 0); } if (wsa && wsa->opened()) { @@ -526,10 +525,10 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y } if (wsaFlags & 4) { - snprintf(file, 32, "%s.CPS", filename); + file = Common::String::format("%s.CPS", filename); - if (_vm->resource()->exists(file)) { - _screen->loadBitmap(file, 3, 3, &_screen->getPalette(0)); + if (_vm->resource()->exists(file.c_str())) { + _screen->loadBitmap(file.c_str(), 3, 3, &_screen->getPalette(0)); _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, _drawPage2, Screen::CR_NO_P_CHECK); if (_drawPage2) _screen->checkedPageUpdate(8, 4); @@ -550,10 +549,10 @@ int TIMInterpreter::initAnimStruct(int index, const char *filename, int x, int y _screen->updateScreen(); } - snprintf(file, 32, "%s.CPS", filename); + file = Common::String::format("%s.CPS", filename); - if (_vm->resource()->exists(file)) { - _screen->loadBitmap(file, 3, 3, &_screen->getPalette(0)); + if (_vm->resource()->exists(file.c_str())) { + _screen->loadBitmap(file.c_str(), 3, 3, &_screen->getPalette(0)); _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, _drawPage2, Screen::CR_NO_P_CHECK); if (_drawPage2) _screen->checkedPageUpdate(8, 4); @@ -922,13 +921,12 @@ int TIMInterpreter_LoL::initAnimStruct(int index, const char *filename, int x, i if (wsaFlags & 8) wsaOpenFlags |= 1; - char file[32]; - snprintf(file, 32, "%s.WSA", filename); + Common::String file = Common::String::format("%s.WSA", filename); - if (_vm->resource()->exists(file)) { + if (_vm->resource()->exists(file.c_str())) { wsa = new WSAMovie_v2(_vm); assert(wsa); - wsa->open(file, wsaOpenFlags, &_screen->getPalette(3)); + wsa->open(file.c_str(), wsaOpenFlags, &_screen->getPalette(3)); } if (!_vm->_flags.use16ColorMode) { diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 9a47016f2b..01bf3c5e26 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -306,9 +306,8 @@ int LoLEngine::chooseCharacter() { Screen::FontId old = _screen->setFont(Screen::FID_SJIS_FNT); for (int j = 0; j < 3; ++j) { - char buffer[3]; - snprintf(buffer, sizeof(buffer), "%2d", _charPreviews[i].attrib[j]); - _screen->printText(buffer, _charPosXPC98[i] + 16, 176 + j * 8, 0x81, 0x00); + Common::String attribString = Common::String::format("%2d", _charPreviews[i].attrib[j]); + _screen->printText(attribString.c_str(), _charPosXPC98[i] + 16, 176 + j * 8, 0x81, 0x00); } _screen->setFont(old); } diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index 95a632c08c..b2a9c2fd93 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -74,9 +74,8 @@ void KyraEngine_LoK::snd_playWanderScoreViaMap(int command, int restart) { } void KyraEngine_LoK::snd_playVoiceFile(int id) { - char vocFile[9]; - snprintf(vocFile, sizeof(vocFile), "%03d", id); - _speechPlayTime = _sound->voicePlay(vocFile, &_speechHandle); + Common::String vocFile = Common::String::format("%03d", id); + _speechPlayTime = _sound->voicePlay(vocFile.c_str(), &_speechHandle); } void KyraEngine_LoK::snd_voiceWaitForFinish(bool ingame) { diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index a7776f0ab6..7262635728 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -50,36 +50,34 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) { _lastSpeaker = speaker; _nextSpeechId = _nextSpeaker = -1; - char pattern1[8]; - char pattern2[5]; - char file1[13]; - char file2[13]; - char file3[13]; - file3[0] = 0; + Common::String pattern1; + Common::String file1; + Common::String file2; + Common::String file3; SpeechList newSpeechList; - snprintf(pattern2, sizeof(pattern2), "%02d", id & 0x4000 ? 0 : _curTlkFile); + Common::String pattern2 = Common::String::format("%02d", id & 0x4000 ? 0 : _curTlkFile); if (id & 0x4000) { - snprintf(pattern1, sizeof(pattern1), "%03X", id & 0x3fff); + pattern1 = Common::String::format("%03X", id & 0x3fff); } else if (id < 1000) { - snprintf(pattern1, sizeof(pattern1), "%03d", id); + pattern1 = Common::String::format("%03d", id); } else { - snprintf(file3, sizeof(file3), "@%04d%c.%s", id - 1000, (char)speaker, pattern2); - if (_sound->isVoicePresent(file3)) - newSpeechList.push_back(_sound->getVoiceStream(file3)); + file3 = Common::String::format("@%04d%c.%s", id - 1000, (char)speaker, pattern2.c_str()); + if (_sound->isVoicePresent(file3.c_str())) + newSpeechList.push_back(_sound->getVoiceStream(file3.c_str())); } - if (!file3[0]) { + if (file3.empty()) { for (char i = 0; ; i++) { char symbol = '0' + i; - snprintf(file1, sizeof(file1), "%s%c%c.%s", pattern1, (char)speaker, symbol, pattern2); - snprintf(file2, sizeof(file2), "%s%c%c.%s", pattern1, '_', symbol, pattern2); - if (_sound->isVoicePresent(file1)) - newSpeechList.push_back(_sound->getVoiceStream(file1)); - else if (_sound->isVoicePresent(file2)) - newSpeechList.push_back(_sound->getVoiceStream(file2)); + file1 = Common::String::format("%s%c%c.%s", pattern1.c_str(), (char)speaker, symbol, pattern2.c_str()); + file2 = Common::String::format("%s%c%c.%s", pattern1.c_str(), '_', symbol, pattern2.c_str()); + if (_sound->isVoicePresent(file1.c_str())) + newSpeechList.push_back(_sound->getVoiceStream(file1.c_str())); + else if (_sound->isVoicePresent(file2.c_str())) + newSpeechList.push_back(_sound->getVoiceStream(file2.c_str())); else break; } @@ -260,9 +258,7 @@ void LoLEngine::snd_loadSoundFile(int track) { int t = (track - 250) * 3; if (_curMusicFileIndex != _musicTrackMap[t] || _curMusicFileExt != (char)_musicTrackMap[t + 1]) { snd_stopMusic(); - char filename[13]; - snprintf(filename, sizeof(filename), "LORE%02d%c", _musicTrackMap[t], (char)_musicTrackMap[t + 1]); - _sound->loadSoundFile(filename); + _sound->loadSoundFile(Common::String::format("LORE%02d%c", _musicTrackMap[t], (char)_musicTrackMap[t + 1])); _curMusicFileIndex = _musicTrackMap[t]; _curMusicFileExt = (char)_musicTrackMap[t + 1]; } else { diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index 393fa8d11f..4406f3ec41 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -436,15 +436,16 @@ void KyraEngine_HoF::updateDlgBuffer() { _npcTalkChpIndex = _currentChapter; _npcTalkDlgIndex = _mainCharacter.dlgIndex; - char filename[13]; - snprintf(filename, 13, "CH%.02d-S%.02d.DLG", _currentChapter, _npcTalkDlgIndex); + Common::String filename = Common::String::format("CH%.02d-S%.02d.DL", _currentChapter, _npcTalkDlgIndex); const char *suffix = _flags.isTalkie ? suffixTalkie : suffixTowns; if (_flags.platform != Common::kPlatformPC || _flags.isTalkie) - filename[11] = suffix[_lang]; + filename += suffix[_lang]; + else + filename += 'G'; delete[] _dlgBuffer; - _dlgBuffer = _res->fileData(filename, 0); + _dlgBuffer = _res->fileData(filename.c_str(), 0); } void KyraEngine_HoF::loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2) { diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index 2cb752fdb3..d690b70266 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -625,24 +625,20 @@ void KyraEngine_MR::malcolmSceneStartupChat() { } void KyraEngine_MR::updateDlgBuffer() { - char dlgFile[16]; - char cnvFile[16]; - if (_cnvFile) _cnvFile->seek(0, SEEK_SET); if (_curDlgIndex == _mainCharacter.dlgIndex && _curDlgChapter == _currentChapter && _curDlgLang == _lang) return; - snprintf(dlgFile, 16, "CH%.02d-S%.02d.", _currentChapter, _mainCharacter.dlgIndex); - appendLanguage(dlgFile, _lang, 16); - snprintf(cnvFile, 16, "CH%.02d-S%.02d.CNV", _currentChapter, _mainCharacter.dlgIndex); + Common::String dlgFile = Common::String::format("CH%.02d-S%.02d.%s", _currentChapter, _mainCharacter.dlgIndex, _languageExtension[_lang]); + Common::String cnvFile = Common::String::format("CH%.02d-S%.02d.CNV", _currentChapter, _mainCharacter.dlgIndex); delete _cnvFile; delete _dlgBuffer; - _res->exists(cnvFile, true); - _res->exists(dlgFile, true); + _res->exists(cnvFile.c_str(), true); + _res->exists(dlgFile.c_str(), true); _cnvFile = _res->createReadStream(cnvFile); _dlgBuffer = _res->createReadStream(dlgFile); assert(_cnvFile); -- cgit v1.2.3 From f13143ef7db6ca572652f8febb062f348b314175 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 9 Jun 2011 19:13:30 +0200 Subject: KYRA: Add a default case to a switch statement. This includes a TODO, about what to do if we ever hit this case. --- engines/kyra/gui_lol.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 80eacb3f87..fb11040168 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -2816,6 +2816,9 @@ int GUI_LoL::clickedOptionsMenu(Button *button) { _vm->_landsFile = _vm->resource()->fileData(filename.c_str(), 0); _newMenu = _lastMenu; } break; + default: + // TODO: Is there anything we should do if we hit this case? + break; } return 1; -- cgit v1.2.3 From ca825e1dba5dedabd3505892a1001be7e13cf6ca Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 9 Jun 2011 00:58:39 +0300 Subject: SWORD25: Unstub SoundEngine::set/getVolume --- engines/sword25/sfx/soundengine.cpp | 41 ++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 20622b2098..13ee3fd1d0 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -37,6 +37,7 @@ #include "audio/decoders/vorbis.h" #include "common/system.h" +#include "common/config-manager.h" namespace Sword25 { @@ -65,8 +66,6 @@ SoundEngine::SoundEngine(Kernel *pKernel) : ResourceService(pKernel) { } bool SoundEngine::init(uint sampleRate, uint channels) { - warning("STUB: SoundEngine::init(%d, %d)", sampleRate, channels); - return true; } @@ -74,12 +73,44 @@ void SoundEngine::update() { } void SoundEngine::setVolume(float volume, SOUND_TYPES type) { - warning("STUB: SoundEngine::setVolume(%f, %d)", volume, type); + int val = 255 * volume; + + switch (type) { + case SoundEngine::MUSIC: + ConfMan.setInt("music_volume", val); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, val); + break; + case SoundEngine::SPEECH: + ConfMan.setInt("speech_volume", val); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, val); + break; + case SoundEngine::SFX: + ConfMan.setInt("sfx_volume", val); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, val); + break; + default: + error("Unknown SOUND_TYPE"); + } } float SoundEngine::getVolume(SOUND_TYPES type) { - warning("STUB: SoundEngine::getVolume(%d)", type); - return 0; + int val = 0; + + switch (type) { + case SoundEngine::MUSIC: + val = ConfMan.getInt("music_volume"); + break; + case SoundEngine::SPEECH: + val = ConfMan.getInt("speech_volume"); + break; + case SoundEngine::SFX: + val = ConfMan.getInt("sfx_volume"); + break; + default: + error("Unknown SOUND_TYPE"); + } + + return (float)val / 255.0; } void SoundEngine::pauseAll() { -- cgit v1.2.3 From dc1c9224abb9b2ac1e79e8512d98ceba2436a889 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 10 Jun 2011 23:17:12 +1000 Subject: TSAGE: Finished implementing _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 188 ++++++++++++++++++++++++++++++++++++++++++++---- engines/tsage/sound.h | 6 +- 2 files changed, 178 insertions(+), 16 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index d7a8741c77..ac7217a753 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -437,7 +437,7 @@ void SoundManager::_sfUpdateVoiceStructs() { if (vs->_voiceType == VOICETYPE_0) { vse._type0._sound = vse._type0._sound2; vse._type0._channelNum = vse._type0._channelNum2; - vse._type0._field9 = vse._type0._field11; + vse._type0._priority = vse._type0._priority2; vse._type0._fieldA = vse._type0._field12; } else { vse._type1._sound = vse._type1._sound2; @@ -458,7 +458,7 @@ void SoundManager::_sfUpdateVoiceStructs2() { VoiceStructEntryType0 &vse = vtStruct->_entries[idx]._type0; vse._sound2 = vse._sound; vse._channelNum2 = vse._channelNum; - vse._field11 = vse._field9; + vse._priority2 = vse._priority; vse._field12 = vse._fieldA; } else { VoiceStructEntryType1 &vse = vtStruct->_entries[idx]._type1; @@ -615,7 +615,7 @@ void SoundManager::_sfRethinkSoundDrivers() { ve._driver = driver; ve._type0._sound = NULL; ve._type0._channelNum = 0; - ve._type0._field9 = 0; + ve._type0._priority = 0; ve._type0._fieldA = 0; vs->_entries.push_back(ve); @@ -665,15 +665,15 @@ void SoundManager::_sfRethinkVoiceTypes() { VoiceStructEntry &vse = vs->_entries[idx]; vse._type0._sound3 = vse._type0._sound; vse._type0._channelNum3 = vse._type0._channelNum; - vse._type0._field19 = vse._type0._field9; + vse._type0._priority3 = vse._type0._priority; vse._type0._field1A = vse._type0._fieldA; vse._type0._sound = NULL; vse._type0._channelNum = 0; - vse._type0._field9 = 0; + vse._type0._priority = 0; vse._type0._fieldA = 0; vse._type0._sound2 = NULL; vse._type0._channelNum2 = 0; - vse._type0._field11 = 0; + vse._type0._priority2 = 0; vse._type0._field12 = 0; } } else { @@ -804,11 +804,173 @@ void SoundManager::_sfRethinkVoiceTypes() { } int flagsVal = sound->_chFlags[foundIndex] & 3; - if (flagsVal == 1) { - //int entryIndex = -1; + if (flagsVal != 1) { + // All modes except mode 1 (loc_23EDF) + int entryIndex = -1, maxVoiceNum = 0; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - + if (!vtStruct->_entries[idx]._type0._sound2 && (vtStruct->_entries[idx]._field1 != 0) && + (vtStruct->_entries[idx]._voiceNum > maxVoiceNum)) { + maxVoiceNum = vtStruct->_entries[idx]._voiceNum; + entryIndex = idx; + } + } + + if (entryIndex != -1) { + vtStruct->_entries[entryIndex]._type0._sound2 = sound; + vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; + vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; + vtStruct->_entries[entryIndex]._type0._field12 = 0; + continue; + } + + if (foundPriority != 0) + continue; + + int maxPriority = 0; + entryIndex = -1; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if ((vtStruct->_entries[idx]._field1 != 0) && + (vtStruct->_entries[idx]._type0._priority2 > maxVoiceNum)) { + maxPriority = vtStruct->_entries[idx]._type0._priority2; + entryIndex = idx; + } + } + + if (entryIndex != -1) { + vtStruct->_entries[entryIndex]._type0._sound2 = sound; + vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; + vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; + vtStruct->_entries[entryIndex]._type0._field12 = 0; + continue; } + + _sfUpdateVoiceStructs2(); + break; + } else { + // Channel mode 1 handling (loc_23FAC) + + bool foundMatch = false; + int entryIndex = -1; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (vtStruct->_entries[idx]._voiceNum == foundIndex) { + foundIndex = true; + if (!vtStruct->_entries[idx]._type0._sound2) { + entryIndex = idx; + break; + } + } + } + + if (entryIndex != -1) { + vtStruct->_entries[entryIndex]._type0._sound2 = sound; + vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; + vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; + vtStruct->_entries[entryIndex]._type0._field12 = 0; + continue; + } + + if (!foundMatch) { + if (foundPriority) + continue; + if (entryIndex == -1) { + _sfUpdateVoiceStructs2(); + break; + } + } + + // Find the entry with the highest priority + int maxPriority = 0; + foundMatch = false; + entryIndex = -1; + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (vtStruct->_entries[idx]._voiceNum != foundIndex) + continue; + if (!vtStruct->_entries[idx]._type0._field12) { + foundMatch = true; + break; + } + + if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) { + maxPriority = vtStruct->_entries[idx]._type0._priority2; + entryIndex = -1; + } + } + + if (!foundMatch) { + if (foundPriority) + continue; + + if (entryIndex != -1) { + vtStruct->_entries[entryIndex]._type0._sound2 = sound; + vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; + vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; + vtStruct->_entries[entryIndex]._type0._field12 = 1; + continue; + } + + _sfUpdateVoiceStructs2(); + break; + } + + // Found a match (loc_24061) + maxPriority = 0; + int maxVoiceNum = 0; + int priorityIndex = -1, voiceIndex = -1; + + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (vtStruct->_entries[idx]._field1) { + if (!vtStruct->_entries[idx]._type0._sound2) { + if (vtStruct->_entries[idx]._voiceNum > maxVoiceNum) { + maxVoiceNum = vtStruct->_entries[idx]._voiceNum; + voiceIndex = idx; + } + } else { + if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) { + maxPriority = vtStruct->_entries[idx]._type0._priority2; + priorityIndex = idx; + } + } + } + } + + if (voiceIndex != -1) { + VoiceStructEntryType0 &vteSrc = vtStruct->_entries[foundIndex]._type0; + VoiceStructEntryType0 &vteDest = vtStruct->_entries[voiceIndex]._type0; + + vteDest._sound2 = vteSrc._sound2; + vteDest._channelNum2 = vteSrc._channelNum2; + vteDest._priority2 = vteSrc._priority2; + + vteSrc._sound2 = sound; + vteSrc._channelNum2 = foundIndex; + vteSrc._priority2 = foundPriority; + vteSrc._field12 = 1; + continue; + } + + if (!foundPriority) + continue; + if (priorityIndex == -1) { + _sfUpdateVoiceStructs2(); + break; + } + + VoiceStructEntryType0 &vteSrc = vtStruct->_entries[foundIndex]._type0; + VoiceStructEntryType0 &vteDest = vtStruct->_entries[priorityIndex]._type0; + + if (priorityIndex != foundIndex) { + vteDest._sound2 = vteSrc._sound2; + vteDest._channelNum2 = vteSrc._channelNum2; + vteDest._priority2 = vteSrc._priority2; + vteDest._field12 = vteSrc._field12; + } + + vteSrc._sound2 = sound; + vteSrc._channelNum2 = foundIndex; + vteSrc._priority2 = foundPriority; + vteSrc._field12 = 1; + continue; } } } @@ -837,7 +999,7 @@ void SoundManager::_sfRethinkVoiceTypes() { if (vse._channelNum3 != vse._channelNum) ++total; - vse._field9 = vse._field11; + vse._priority = vse._priority2; vse._fieldA = 1; vse._sound2 = NULL; @@ -857,7 +1019,7 @@ void SoundManager::_sfRethinkVoiceTypes() { } else { vse._sound = NULL; vse._channelNum = 0; - vse._field9 = 0; + vse._priority = 0; vse._fieldA = 0; } } @@ -876,7 +1038,7 @@ void SoundManager::_sfRethinkVoiceTypes() { // Found match vs->_entries[entryIndex]._type0._sound = sound; vs->_entries[entryIndex]._type0._channelNum = channelNum; - vs->_entries[entryIndex]._type0._field9 = vse._field11; + vs->_entries[entryIndex]._type0._priority = vse._priority2; vs->_entries[entryIndex]._type0._fieldA = 0; vse._sound2 = NULL; break; @@ -907,7 +1069,7 @@ void SoundManager::_sfRethinkVoiceTypes() { vseFound._sound = vse._sound2; vseFound._channelNum = vse._channelNum2; - vseFound._field9 = vse._field11; + vseFound._priority = vse._priority2; vseFound._fieldA = 0; SoundDriver *driver = vs->_entries[foundIndex]._driver; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 8115d034a1..1dc40b2e4c 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -101,15 +101,15 @@ public: struct VoiceStructEntryType0 { Sound *_sound; int _channelNum; - int _field9; + int _priority; int _fieldA; Sound *_sound2; int _channelNum2; - int _field11; + int _priority2; int _field12; Sound *_sound3; int _channelNum3; - int _field19; + int _priority3; int _field1A; int _field1B; }; -- cgit v1.2.3 From 0c1665820bf91aba10adf9abd7bca286b7c17982 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Fri, 10 Jun 2011 19:41:31 +0200 Subject: AGI: Experimental fix for bug #3292778 ("SQ2: Music missing notes") The idea here is that if two voices are generating the same tone, the square wave generator should be in sync so that the wave forms amplify each other, rather than cancelling each other out. --- engines/agi/sound_pcjr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp index 319b7049ed..fdebf16b1a 100644 --- a/engines/agi/sound_pcjr.cpp +++ b/engines/agi/sound_pcjr.cpp @@ -219,6 +219,7 @@ int SoundGenPCJr::volumeCalc(SndGenChan *chan) { // return 0 if it's passing more data // return -1 if it's passing nothing (end of data) int SoundGenPCJr::getNextNote(int ch, Tone *tone) { + ToneChan *tpcm; SndGenChan *chan; const byte *data; @@ -228,6 +229,7 @@ int SoundGenPCJr::getNextNote(int ch, Tone *tone) { if (!_vm->getflag(fSoundOn)) return -1; + tpcm = &_tchannel[ch]; chan = &_channel[ch]; if (!chan->avail) return -1; @@ -241,6 +243,9 @@ int SoundGenPCJr::getNextNote(int ch, Tone *tone) { // if it's 0 then it's not going to be played // if it's 0xFFFF then the channel data has finished. if ((chan->duration != 0) && (chan->duration != 0xFFFF)) { + tpcm->genTypePrev = -1; + tpcm->freqCountPrev = -1; + // only tone channels dissolve if ((ch != 3) && (_dissolveMethod != 0)) // != noise?? chan->dissolveCount = 0; -- cgit v1.2.3 From 9034bee98e3173bcd0a578c7e868e6a437a18620 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Wed, 18 May 2011 00:53:20 +0200 Subject: COMMON: Add (another) Eclipse project file to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ef404048c0..6294cb451d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ lib*.a /.project /.cproject /.settings +/.autotools /Icon.* /build -- cgit v1.2.3 From ef3484646a837ff898fe1e4e2d203f8c0ce4b6af Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Fri, 10 Jun 2011 00:37:51 +0200 Subject: SCALERS: Fix for compiling for ARM without using ASM scalers --- graphics/scaler/downscaler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/scaler/downscaler.cpp b/graphics/scaler/downscaler.cpp index fa17490475..65400ccd46 100644 --- a/graphics/scaler/downscaler.cpp +++ b/graphics/scaler/downscaler.cpp @@ -22,7 +22,7 @@ #include "graphics/scaler/downscaler.h" #include "graphics/scaler/intern.h" -#ifdef ARM +#ifdef USE_ARM_SCALER_ASM extern "C" { void DownscaleAllByHalfARM(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int mask, int round); } -- cgit v1.2.3 From a1f12c25cae2dbcc8a904d628827dd4789b738cc Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 10 Jun 2011 20:30:49 +0200 Subject: ARM: Fix normal2x scaler for width % 4 != 0 The first jump to 'thin:' didn't leave r14 (remaining width) in the right state. --- graphics/scaler/Normal2xARM.s | 1 + 1 file changed, 1 insertion(+) diff --git a/graphics/scaler/Normal2xARM.s b/graphics/scaler/Normal2xARM.s index 9afe3f34f0..e3592295e0 100644 --- a/graphics/scaler/Normal2xARM.s +++ b/graphics/scaler/Normal2xARM.s @@ -44,6 +44,7 @@ Normal2xARM: ADD r3, r3, r6 yloop: SUBS r14,r4, #4 + ADDLT r14,r14, #4 BLT thin xloop: LDRH r6, [r0], #2 -- cgit v1.2.3 From bdad493f3f01768f5693cc379609c2c89d6b2200 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 Jun 2011 18:15:55 +0200 Subject: AUDIO: Remove dead code --- audio/mididrv.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp index 80981eeccb..0ca70b24f8 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -219,8 +219,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { } } - reslt = 0; - // If the selected driver did not match the flags setting, // we try to determine a suitable and "optimal" music driver. const MusicPlugin::List p = MusicMan.getPlugins(); @@ -268,7 +266,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { GUI::MessageDialog dialog(warningMsg); dialog.runModal(); } - hdl = 0; } } @@ -283,9 +280,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { hdl = d->getHandle(); if (checkDevice(hdl)) return hdl; - else - // No warning here, since the user hasn't expressly requested anything. - hdl = 0; } } } @@ -301,9 +295,6 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { hdl = d->getHandle(); if (checkDevice(hdl)) return hdl; - else - // No warning here, since the user hasn't expressly requested anything. - hdl = 0; } } } @@ -357,15 +348,12 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { hdl = d->getHandle(); if (checkDevice(hdl)) return hdl; - else - // No warning here, since the user hasn't expressly requested anything. - hdl = 0; } } } } - return reslt; + return 0; } MidiDriver *MidiDriver::createMidi(MidiDriver::DeviceHandle handle) { -- cgit v1.2.3 From 55e1b08e22b737f6a64ae0505b4bdd190c9e08eb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 Jun 2011 18:16:14 +0200 Subject: AUDIO: Small cleanup in MidiParser_XMIDI::loadMusic --- audio/midiparser_xmidi.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp index 7c3cf102d1..85491faaf8 100644 --- a/audio/midiparser_xmidi.cpp +++ b/audio/midiparser_xmidi.cpp @@ -256,26 +256,25 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) { // Add eight bytes i += 8; - if (memcmp(buf, "INFO", 4)) { - // Must align - pos += (chunk_len + 1) & ~1; - i += (chunk_len + 1) & ~1; - continue; - } - - // Must be at least 2 bytes long - if (chunk_len < 2) { - warning("Invalid chunk length %d for 'INFO' block", (int)chunk_len); - return false; - } + if (memcmp(buf, "INFO", 4) == 0) { + // Must be at least 2 bytes long + if (chunk_len < 2) { + warning("Invalid chunk length %d for 'INFO' block", (int)chunk_len); + return false; + } - _num_tracks = (byte)read2low(pos); + _num_tracks = (byte)read2low(pos); - if (chunk_len > 2) { - warning("Chunk length %d is greater than 2", (int)chunk_len); - pos += chunk_len - 2; + if (chunk_len > 2) { + warning("Chunk length %d is greater than 2", (int)chunk_len); + //pos += chunk_len - 2; + } + break; } - break; + + // Must align + pos += (chunk_len + 1) & ~1; + i += (chunk_len + 1) & ~1; } // Didn't get to fill the header -- cgit v1.2.3 From 252a505db2660ac1b022818f9883a8ba7e2dd405 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 Jun 2011 18:16:39 +0200 Subject: DETECTOR: Allocate MacResManager on the stack --- engines/advancedDetector.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 2ee32b2f86..d81906eda6 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -456,16 +456,14 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p // file and as one with resource fork. if (g->flags & ADGF_MACRESFORK) { - Common::MacResManager *macResMan = new Common::MacResManager(); + Common::MacResManager macResMan; - if (macResMan->open(parent, fname)) { - tmp.md5 = macResMan->computeResForkMD5AsString(params.md5Bytes); - tmp.size = macResMan->getResForkDataSize(); + if (macResMan.open(parent, fname)) { + tmp.md5 = macResMan.computeResForkMD5AsString(params.md5Bytes); + tmp.size = macResMan.getResForkDataSize(); debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5.c_str()); filesSizeMD5[fname] = tmp; } - - delete macResMan; } else { if (allFiles.contains(fname)) { debug(3, "+ %s", fname.c_str()); -- cgit v1.2.3 From 4827cc914a128b956d88ea3eae66d8866d9cd40e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 00:30:48 +0200 Subject: ENGINES: Change incorrect use of 'target' to 'gameid' --- engines/agi/detection.cpp | 4 ++-- engines/agos/detection.cpp | 4 ++-- engines/cine/detection.cpp | 4 ++-- engines/cruise/detection.cpp | 4 ++-- engines/draci/detection.cpp | 4 ++-- engines/drascula/detection.cpp | 4 ++-- engines/gob/detection.cpp | 4 ++-- engines/groovie/detection.cpp | 4 ++-- engines/hugo/detection.cpp | 4 ++-- engines/kyra/detection.cpp | 4 ++-- engines/lastexpress/detection.cpp | 4 ++-- engines/lure/detection.cpp | 4 ++-- engines/m4/detection.cpp | 4 ++-- engines/made/detection.cpp | 4 ++-- engines/mohawk/detection.cpp | 4 ++-- engines/parallaction/detection.cpp | 4 ++-- engines/saga/detection.cpp | 4 ++-- engines/sci/detection.cpp | 4 ++-- engines/sword25/detection.cpp | 4 ++-- engines/teenagent/detection.cpp | 4 ++-- engines/testbed/detection.cpp | 4 ++-- engines/tinsel/detection.cpp | 6 +++--- engines/toon/detection.cpp | 4 ++-- engines/touche/detection.cpp | 4 ++-- engines/tucker/detection.cpp | 4 ++-- 25 files changed, 51 insertions(+), 51 deletions(-) diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 22d8adf92d..1d0f6c3fd3 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -136,9 +136,9 @@ static const ADParams detectionParams = { sizeof(Agi::AGIGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid agiGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "agi", diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 629a5d63fc..abd95cf2ae 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -94,9 +94,9 @@ static const ADParams detectionParams = { sizeof(AGOS::AGOSGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid simonGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids obsoleteGameIDsTable, // Name of single gameid (optional) 0, diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 738366124c..2e6e285df0 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -67,9 +67,9 @@ static const ADParams detectionParams = { sizeof(Cine::CINEGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid cineGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids obsoleteGameIDsTable, // Name of single gameid (optional) "cine", diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 3bd0c1f76f..cc058b14ed 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -224,9 +224,9 @@ static const ADParams detectionParams = { sizeof(Cruise::CRUISEGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid cruiseGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "cruise", diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index d3483eb5a4..0b2a0bd7e9 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -90,9 +90,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid draciGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "draci", diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 5a8903db9d..853c4c7dcb 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -273,9 +273,9 @@ static const ADParams detectionParams = { sizeof(Drascula::DrasculaGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid drasculaGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "drascula", diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index be44c05bfb..fc0915e095 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -93,9 +93,9 @@ static const ADParams detectionParams = { sizeof(Gob::GOBGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid gobGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids obsoleteGameIDsTable, // Name of single gameid (optional) "gob", diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 0dd510abca..6f1b5e1bd4 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -209,9 +209,9 @@ static const ADParams detectionParams = { sizeof(GroovieGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid groovieGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "groovie", diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 25b8b16084..29f5d9e6f2 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -138,9 +138,9 @@ static const ADParams detectionParams = { sizeof(HugoGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid hugoGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) 0, diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 47a086e08c..6f2dcb52d7 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -54,9 +54,9 @@ static const ADParams detectionParams = { sizeof(KYRAGameDescription), // Number of bytes to compute MD5 sum for 1024 * 1024, - // List of all engine targets + // List of all engine gameid gameList, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) 0, diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index 7c7c6b0a36..e85ec41420 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -183,9 +183,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid lastExpressGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "lastexpress", diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index ced0be0cfb..69bc7d551a 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -182,9 +182,9 @@ static const ADParams detectionParams = { sizeof(Lure::LureGameDescription), // Number of bytes to compute MD5 sum for 1024, - // List of all engine targets + // List of all engine gameid lureGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "lure", diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index 1aefe3d02d..49a38d2f00 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -391,9 +391,9 @@ static const ADParams detectionParams = { sizeof(M4::M4GameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid m4Games, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "m4", diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 4576e2b5ce..d27823faf0 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -532,9 +532,9 @@ static const ADParams detectionParams = { sizeof(Made::MadeGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid madeGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "made", diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index 6a73b28246..551c369d54 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -165,9 +165,9 @@ static const ADParams detectionParams = { sizeof(Mohawk::MohawkGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid mohawkGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "mohawk", diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index c3719bcd51..006ebacf14 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -227,9 +227,9 @@ static const ADParams detectionParams = { sizeof(Parallaction::PARALLACTIONGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid parallactionGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) 0, diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 23bdc73666..4d1c89b0ec 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -108,9 +108,9 @@ static const ADParams detectionParams = { sizeof(Saga::SAGAGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid sagaGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids obsoleteGameIDsTable, // Name of single gameid (optional) "saga", diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 100b71efa7..6fb28fcff9 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -379,9 +379,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid s_sciGameTitles, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "sci", diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index edb8c30545..6e639965e9 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -48,9 +48,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid Sword25Game, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) NULL, diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index 5012e6af65..5eb332f97b 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -86,9 +86,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid teenAgentGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "teenagent", diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 13af0f1584..6a40b24858 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -52,9 +52,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 512, - // List of all engine targets + // List of all engine gameid testbed_setting, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "testbed", diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 0f0e3cd1ef..0d283f2ceb 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -63,7 +63,7 @@ uint16 TinselEngine::getVersion() const { return _gameDescription->version; } -} +} // End of namespace Tinsel static const PlainGameDescriptor tinselGames[] = { {"tinsel", "Tinsel engine game"}, @@ -81,9 +81,9 @@ static const ADParams detectionParams = { sizeof(Tinsel::TinselGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid tinselGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "tinsel", diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index 1056f6ec0d..be47d24c29 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -124,9 +124,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 5000, - // List of all engine targets + // List of all engine gameid ToonGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "toon", diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index b7f9c092aa..4ffad35ada 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -133,9 +133,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 4096, - // List of all engine targets + // List of all engine gameid toucheGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "touche", diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 31d9caef73..fe7cb4779a 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -109,9 +109,9 @@ static const ADParams detectionParams = { sizeof(ADGameDescription), // Number of bytes to compute MD5 sum for 512, - // List of all engine targets + // List of all engine gameid tuckerGames, - // Structure for autoupgrading obsolete targets + // Structure for autoupgrading obsolete gameids 0, // Name of single gameid (optional) "tucker", -- cgit v1.2.3 From b7d9e433bfd93dbc91caa6759eafd3615d615b2e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:46:36 +0200 Subject: DETECTOR: Add AdvancedMetaEngine constructor which works without ADParams --- engines/advancedDetector.cpp | 34 ++++++++++++++++++++++++---------- engines/advancedDetector.h | 6 ++++-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index d81906eda6..c715d1e96d 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -62,7 +62,7 @@ static GameList gameIDList(const ADParams ¶ms) { if (params.singleid != NULL) { GameList gl; - const PlainGameDescriptor *g = params.list; + const PlainGameDescriptor *g = params.gameDescriptors; while (g->gameid) { if (0 == scumm_stricmp(params.singleid, g->gameid)) { gl.push_back(GameDescriptor(g->gameid, g->description)); @@ -74,7 +74,7 @@ static GameList gameIDList(const ADParams ¶ms) { error("Engine %s doesn't have its singleid specified in ids list", params.singleid); } - return GameList(params.list); + return GameList(params.gameDescriptors); } static void upgradeTargetIfNecessary(const ADParams ¶ms) { @@ -109,11 +109,11 @@ namespace AdvancedDetector { GameDescriptor findGameID( const char *gameid, - const PlainGameDescriptor *list, + const PlainGameDescriptor *gameDescriptors, const ADObsoleteGameID *obsoleteList ) { - // First search the list of supported game IDs for a match. - const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, list); + // First search the list of supported gameids for a match. + const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameDescriptors); if (g) return GameDescriptor(*g); @@ -123,7 +123,7 @@ GameDescriptor findGameID( const ADObsoleteGameID *o = obsoleteList; while (o->from) { if (0 == scumm_stricmp(gameid, o->from)) { - g = findPlainGameDescriptor(o->to, list); + g = findPlainGameDescriptor(o->to, gameDescriptors); if (g && g->description) return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")"); else @@ -244,14 +244,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { // Use fallback detector if there were no matches by other means const ADGameDescription *fallbackDesc = fallbackDetect(fslist); if (fallbackDesc != 0) { - GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.list)); + GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors)); updateGameDescriptor(desc, fallbackDesc, params); detectedGames.push_back(desc); } } else { // Otherwise use the found matches for (uint i = 0; i < matches.size(); i++) { - GameDescriptor desc(toGameDescriptor(*matches[i], params.list)); + GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors)); updateGameDescriptor(desc, matches[i], params); detectedGames.push_back(desc); } @@ -344,7 +344,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions, lang); - debug(2, "Running %s", toGameDescriptor(*agdDesc, params.list).description().c_str()); + debug(2, "Running %s", toGameDescriptor(*agdDesc, params.gameDescriptors).description().c_str()); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else @@ -645,5 +645,19 @@ GameList AdvancedMetaEngine::getSupportedGames() const { return gameIDList(params); } GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const { - return AdvancedDetector::findGameID(gameid, params.list, params.obsoleteList); + return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList); +} + +AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors) { + params.descs = (const byte *)descs; + params.descItemSize = descItemSize; + params.md5Bytes = 5000; + params.gameDescriptors = gameDescriptors; + params.obsoleteList = NULL; + params.singleid = NULL; + params.fileBasedFallback = NULL; + params.flags = 0; + params.guioptions = Common::GUIO_NONE; + params.depth = 1; + params.directoryGlobs = NULL; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 408c46556d..f3eac203da 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -148,7 +148,7 @@ struct ADParams { * A list of all gameids (and their corresponding descriptions) supported * by this engine. */ - const PlainGameDescriptor *list; + const PlainGameDescriptor *gameDescriptors; /** * Structure for autoupgrading obsolete targets (optional). @@ -224,9 +224,11 @@ GameDescriptor findGameID( * A MetaEngine implementation based around the advanced detector code. */ class AdvancedMetaEngine : public MetaEngine { - const ADParams ¶ms; +protected: + ADParams params; public: AdvancedMetaEngine(const ADParams &dp) : params(dp) {} + AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors); virtual GameList getSupportedGames() const; virtual GameDescriptor findGame(const char *gameid) const; -- cgit v1.2.3 From a9b49fbc66d4420e252500ac8316e632f53d2075 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:50 +0200 Subject: AGI: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/agi/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 1d0f6c3fd3..b0e055edcc 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -129,31 +129,6 @@ static const PlainGameDescriptor agiGames[] = { #include "agi/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Agi::gameDescriptions, - // Size of that superset structure - sizeof(Agi::AGIGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - agiGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "agi", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOSPEECH, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - using namespace Agi; class AgiMetaEngine : public AdvancedMetaEngine { @@ -161,7 +136,10 @@ class AgiMetaEngine : public AdvancedMetaEngine { mutable Common::String _extra; public: - AgiMetaEngine() : AdvancedMetaEngine(detectionParams) {} + AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames) { + params.singleid = "agi"; + params.guioptions = Common::GUIO_NOSPEECH; + } virtual const char *getName() const { return "AGI preAGI + v2 + v3"; -- cgit v1.2.3 From 58c36801f4a59d8da05c8702637b1cc294625f5b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:51 +0200 Subject: AGOS: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/agos/detection.cpp | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index abd95cf2ae..dbd1743304 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -63,7 +63,7 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { {0, 0, Common::kPlatformUnknown} }; -static const PlainGameDescriptor simonGames[] = { +static const PlainGameDescriptor agosGames[] = { {"pn", "Personal Nightmare"}, {"elvira1", "Elvira - Mistress of the Dark"}, {"elvira2", "Elvira II - The Jaws of Cerberus"}, @@ -87,36 +87,16 @@ static const char *directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)AGOS::gameDescriptions, - // Size of that superset structure - sizeof(AGOS::AGOSGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - simonGames, - // Structure for autoupgrading obsolete gameids - obsoleteGameIDsTable, - // Name of single gameid (optional) - 0, - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOLAUNCHLOAD, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - using namespace AGOS; class AgosMetaEngine : public AdvancedMetaEngine { public: - AgosMetaEngine() : AdvancedMetaEngine(detectionParams) {} + AgosMetaEngine() : AdvancedMetaEngine(AGOS::gameDescriptions, sizeof(AGOS::AGOSGameDescription), agosGames) { + params.obsoleteList = obsoleteGameIDsTable; + params.guioptions = Common::GUIO_NOLAUNCHLOAD; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "AGOS"; -- cgit v1.2.3 From 3c837a39f0e2b45cf357c22a40cd3592f6ab760f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:51 +0200 Subject: CINE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/cine/detection.cpp | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 2e6e285df0..89c81c2599 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -60,34 +60,13 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { #include "cine/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Cine::gameDescriptions, - // Size of that superset structure - sizeof(Cine::CINEGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - cineGames, - // Structure for autoupgrading obsolete gameids - obsoleteGameIDsTable, - // Name of single gameid (optional) - "cine", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class CineMetaEngine : public AdvancedMetaEngine { public: - CineMetaEngine() : AdvancedMetaEngine(detectionParams) {} + CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) { + params.obsoleteList = obsoleteGameIDsTable; + params.singleid = "cine"; + params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + } virtual const char *getName() const { return "Cine"; -- cgit v1.2.3 From 446e6028409259f55691146c80070fb6a57a8640 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:51 +0200 Subject: CRUISE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/cruise/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index cc058b14ed..f6f8db4f3a 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -217,34 +217,12 @@ static const CRUISEGameDescription gameDescriptions[] = { } -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Cruise::gameDescriptions, - // Size of that superset structure - sizeof(Cruise::CRUISEGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - cruiseGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "cruise", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class CruiseMetaEngine : public AdvancedMetaEngine { public: - CruiseMetaEngine() : AdvancedMetaEngine(detectionParams) {} + CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) { + params.singleid = "cruise"; + params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + } virtual const char *getName() const { return "CruisE"; -- cgit v1.2.3 From 8174f7d5215cc7b2d85f66fde56803d25f25796a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:52 +0200 Subject: DRACI: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/draci/detection.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 0b2a0bd7e9..cf0413ffa9 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -83,34 +83,11 @@ const ADGameDescription gameDescriptions[] = { } // End of namespace Draci -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Draci::gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - draciGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "draci", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class DraciMetaEngine : public AdvancedMetaEngine { public: - DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {} + DraciMetaEngine() : AdvancedMetaEngine(Draci::gameDescriptions, sizeof(ADGameDescription), draciGames) { + params.singleid = "draci"; + } virtual const char *getName() const { return "Draci"; -- cgit v1.2.3 From ae75b9780c30d641591517862f6b2d60ff51f686 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:52 +0200 Subject: DRASCULA: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/drascula/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 853c4c7dcb..9494bfa66b 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -266,34 +266,12 @@ static const DrasculaGameDescription gameDescriptions[] = { } // End of namespace Drascula -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Drascula::gameDescriptions, - // Size of that superset structure - sizeof(Drascula::DrasculaGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - drasculaGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "drascula", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class DrasculaMetaEngine : public AdvancedMetaEngine { public: - DrasculaMetaEngine() : AdvancedMetaEngine(detectionParams) {} + DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) { + params.singleid = "drascula"; + params.guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; + } virtual const char *getName() const { return "Drascula"; -- cgit v1.2.3 From a89f9ca31cf913125f0310f09f48b1264e51be7b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:52 +0200 Subject: GOB: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/gob/detection.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index fc0915e095..2ecd6b741e 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -86,34 +86,14 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { #include "gob/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Gob::gameDescriptions, - // Size of that superset structure - sizeof(Gob::GOBGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - gobGames, - // Structure for autoupgrading obsolete gameids - obsoleteGameIDsTable, - // Name of single gameid (optional) - "gob", - // List of files for file-based fallback detection (optional) - Gob::fileBased, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOLAUNCHLOAD, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class GobMetaEngine : public AdvancedMetaEngine { public: - GobMetaEngine() : AdvancedMetaEngine(detectionParams) {} + GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) { + params.obsoleteList = obsoleteGameIDsTable; + params.singleid = "gob"; + params.fileBasedFallback = Gob::fileBased; + params.guioptions = Common::GUIO_NOLAUNCHLOAD; + } virtual const char *getName() const { return "Gob"; -- cgit v1.2.3 From 0d581ba46dcbb8ef616a450ca0cf09d9072b9183 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:52 +0200 Subject: GROOVIE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/groovie/detection.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 6f1b5e1bd4..62ee65d74a 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -202,35 +202,13 @@ static const GroovieGameDescription gameDescriptions[] = { {AD_TABLE_END_MARKER, kGroovieT7G, 0} }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)gameDescriptions, - // Size of that superset structure - sizeof(GroovieGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - groovieGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "groovie", - // List of files for file-based fallback detection (optional) - 0, - // Flags - kADFlagUseExtraAsHint, - // Additional GUI options (for every game} - Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - - class GroovieMetaEngine : public AdvancedMetaEngine { public: - GroovieMetaEngine() : AdvancedMetaEngine(detectionParams) {} + GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames) { + params.singleid = "groovie"; + params.flags = kADFlagUseExtraAsHint; + params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + } const char *getName() const { return "Groovie"; -- cgit v1.2.3 From 39aa627083ef0a6654909930e42bc1f8f6de4a28 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:53 +0200 Subject: HUGO: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/hugo/detection.cpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 29f5d9e6f2..f70a21aa8f 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -131,34 +131,10 @@ static const HugoGameDescription gameDescriptions[] = { {AD_TABLE_END_MARKER, kGameTypeNone} }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)gameDescriptions, - // Size of that superset structure - sizeof(HugoGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - hugoGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - 0, - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class HugoMetaEngine : public AdvancedMetaEngine { public: - HugoMetaEngine() : AdvancedMetaEngine(detectionParams) {} + HugoMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(HugoGameDescription), hugoGames) { + } const char *getName() const { return "Hugo"; -- cgit v1.2.3 From a29bc37eee030533bafbae32a253f2ad8dabadde Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:53 +0200 Subject: KYRA: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/kyra/detection.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 6f2dcb52d7..6589c2b45b 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -47,37 +47,15 @@ const char * const directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)adGameDescs, - // Size of that superset structure - sizeof(KYRAGameDescription), - // Number of bytes to compute MD5 sum for - 1024 * 1024, - // List of all engine gameid - gameList, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - 0, - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - } // End of anonymous namespace class KyraMetaEngine : public AdvancedMetaEngine { public: - KyraMetaEngine() : AdvancedMetaEngine(detectionParams) {} - + KyraMetaEngine() : AdvancedMetaEngine(adGameDescs, sizeof(KYRAGameDescription), gameList) { + params.md5Bytes = 1024 * 1024; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } const char *getName() const { return "Kyra"; } -- cgit v1.2.3 From 2bbaf0339e0f9ac4f592b1f9c414516057859015 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:53 +0200 Subject: LASTEXPRESS: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/lastexpress/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index e85ec41420..d8b98bbbf2 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -176,35 +176,13 @@ static const ADGameDescription gameDescriptions[] = { AD_TABLE_END_MARKER }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - lastExpressGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "lastexpress", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class LastExpressMetaEngine : public AdvancedMetaEngine { public: - LastExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {} + LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) { + params.singleid = "lastexpress"; + params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + } const char *getName() const { return "Lastexpress"; -- cgit v1.2.3 From 3491bf5b789f8fdc824e4aae346c7824550e841c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:53 +0200 Subject: LURE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/lure/detection.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 69bc7d551a..83ede92569 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -175,34 +175,14 @@ static const LureGameDescription gameDescriptions[] = { } // End of namespace Lure -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Lure::gameDescriptions, - // Size of that superset structure - sizeof(Lure::LureGameDescription), - // Number of bytes to compute MD5 sum for - 1024, - // List of all engine gameid - lureGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "lure", - // List of files for file-based fallback detection (optional) - 0, - // Flags - kADFlagUseExtraAsHint, - // Additional GUI options (for every game} - Common::GUIO_NOSPEECH, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class LureMetaEngine : public AdvancedMetaEngine { public: - LureMetaEngine() : AdvancedMetaEngine(detectionParams) {} + LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) { + params.md5Bytes = 1024; + params.singleid = "lure"; + params.flags = kADFlagUseExtraAsHint; + params.guioptions = Common::GUIO_NOSPEECH; + } virtual const char *getName() const { return "Lure"; -- cgit v1.2.3 From dec7df0f16c0615482f6ae2830cfee1690afe5fc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:54 +0200 Subject: M4: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/m4/detection.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index 49a38d2f00..bab17d9e1d 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -384,34 +384,14 @@ static const char *directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)M4::gameDescriptions, - // Size of that superset structure - sizeof(M4::M4GameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - m4Games, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "m4", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOMIDI, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - class M4MetaEngine : public AdvancedMetaEngine { public: - M4MetaEngine() : AdvancedMetaEngine(detectionParams) {} + M4MetaEngine() : AdvancedMetaEngine(M4::gameDescriptions, sizeof(M4::M4GameDescription), m4Games) { + params.singleid = "m4"; + params.guioptions = Common::GUIO_NOMIDI; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "MADS/M4"; -- cgit v1.2.3 From 97f82b5a93848ceeaa0701dd0f6038ba30f50ea3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:54 +0200 Subject: MADE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/made/detection.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index d27823faf0..a0576a458e 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -525,34 +525,11 @@ static MadeGameDescription g_fallbackDesc = { } // End of namespace Made -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Made::gameDescriptions, - // Size of that superset structure - sizeof(Made::MadeGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - madeGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "made", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class MadeMetaEngine : public AdvancedMetaEngine { public: - MadeMetaEngine() : AdvancedMetaEngine(detectionParams) {} + MadeMetaEngine() : AdvancedMetaEngine(Made::gameDescriptions, sizeof(Made::MadeGameDescription), madeGames) { + params.singleid = "made"; + } virtual const char *getName() const { return "MADE"; -- cgit v1.2.3 From b1965f9a3f48a40cb84ff22b76a95a1cfc4eef38 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:54 +0200 Subject: MOHAWK: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/mohawk/detection.cpp | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index 551c369d54..a7442729d2 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -158,35 +158,14 @@ static const char *directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Mohawk::gameDescriptions, - // Size of that superset structure - sizeof(Mohawk::MohawkGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - mohawkGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "mohawk", - // List of files for file-based fallback detection (optional) - Mohawk::fileBased, - // Flags - 0, - // Additional GUI options (for every game) - Common::GUIO_NONE, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - class MohawkMetaEngine : public AdvancedMetaEngine { public: - MohawkMetaEngine() : AdvancedMetaEngine(detectionParams) {} - + MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) { + params.singleid = "mohawk"; + params.fileBasedFallback = Mohawk::fileBased; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "Mohawk"; } -- cgit v1.2.3 From 289ad6b541a3f83f0283dc68510d2aedde9e4c38 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:55 +0200 Subject: PARALLACTION: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/parallaction/detection.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 006ebacf14..09f6fa5e2e 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -220,34 +220,11 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { } -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Parallaction::gameDescriptions, - // Size of that superset structure - sizeof(Parallaction::PARALLACTIONGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - parallactionGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - 0, - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOLAUNCHLOAD, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class ParallactionMetaEngine : public AdvancedMetaEngine { public: - ParallactionMetaEngine() : AdvancedMetaEngine(detectionParams) {} + ParallactionMetaEngine() : AdvancedMetaEngine(Parallaction::gameDescriptions, sizeof(Parallaction::PARALLACTIONGameDescription), parallactionGames) { + params.guioptions = Common::GUIO_NOLAUNCHLOAD; + } virtual const char *getName() const { return "Parallaction"; -- cgit v1.2.3 From 6fb0d6e8e970c59b5f3cffaf12b2560d2687fdff Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:55 +0200 Subject: SAGA: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/saga/detection.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 4d1c89b0ec..ece90855b7 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -101,34 +101,12 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { #include "saga/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Saga::gameDescriptions, - // Size of that superset structure - sizeof(Saga::SAGAGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - sagaGames, - // Structure for autoupgrading obsolete gameids - obsoleteGameIDsTable, - // Name of single gameid (optional) - "saga", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class SagaMetaEngine : public AdvancedMetaEngine { public: - SagaMetaEngine() : AdvancedMetaEngine(detectionParams) {} + SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) { + params.obsoleteList = obsoleteGameIDsTable; + params.singleid = "saga"; + } virtual const char *getName() const { return "SAGA [" -- cgit v1.2.3 From b99d76acdbc990f24fc34c2b3f5f0ff6ab68422c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:55 +0200 Subject: SCI: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/sci/detection.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 6fb28fcff9..302ba13247 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -371,35 +371,11 @@ static ADGameDescription s_fallbackDesc = { static char s_fallbackGameIdBuf[256]; - -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Sci::SciGameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - s_sciGameTitles, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "sci", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class SciMetaEngine : public AdvancedMetaEngine { public: - SciMetaEngine() : AdvancedMetaEngine(detectionParams) {} + SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles) { + params.singleid = "sci"; + } virtual const char *getName() const { return "SCI [SCI0, SCI01, SCI10, SCI11" -- cgit v1.2.3 From 43f301d4c76cf1d303c71f3114d0f66e39264a95 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:55 +0200 Subject: SWORD25: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/sword25/detection.cpp | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index 6e639965e9..c704b3e833 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -31,7 +31,7 @@ namespace Sword25 { uint32 Sword25Engine::getGameFlags() const { return _gameDescription->flags; } } -static const PlainGameDescriptor Sword25Game[] = { +static const PlainGameDescriptor sword25Game[] = { {"sword25", "Broken Sword 2.5"}, {0, 0} }; @@ -41,35 +41,13 @@ static const char *directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Sword25::gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - Sword25Game, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - NULL, - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOMIDI, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - class Sword25MetaEngine : public AdvancedMetaEngine { public: - Sword25MetaEngine() : AdvancedMetaEngine(detectionParams) {} - + Sword25MetaEngine() : AdvancedMetaEngine(Sword25::gameDescriptions, sizeof(ADGameDescription), sword25Game) { + params.guioptions = Common::GUIO_NOMIDI; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "Sword25"; } -- cgit v1.2.3 From fc555635cf2a64e6ac274550734949bb551b239f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:56 +0200 Subject: TEENAGENT: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/teenagent/detection.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index 5eb332f97b..b684560bc7 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -79,37 +79,14 @@ static const ADGameDescription teenAgentGameDescriptions[] = { AD_TABLE_END_MARKER, }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)teenAgentGameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - teenAgentGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "teenagent", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 +enum { + MAX_SAVES = 20 }; -#define MAX_SAVES 20 - - class TeenAgentMetaEngine : public AdvancedMetaEngine { public: - TeenAgentMetaEngine() : AdvancedMetaEngine(detectionParams) { + TeenAgentMetaEngine() : AdvancedMetaEngine(teenAgentGameDescriptions, sizeof(ADGameDescription), teenAgentGames) { + params.singleid = "teenagent"; } virtual const char *getName() const { -- cgit v1.2.3 From 3c0c14b4b50d253d8f318335c8fa99cfbb3e013b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:56 +0200 Subject: TESTBED: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/testbed/detection.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 6a40b24858..2c3d5b43c5 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -45,34 +45,11 @@ static const ADGameDescription testbedDescriptions[] = { AD_TABLE_END_MARKER }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)testbedDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 512, - // List of all engine gameid - testbed_setting, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "testbed", - // List of files for file-based fallback detection (optional) - 0, - // Flags - ADGF_NO_FLAGS, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class TestbedMetaEngine : public AdvancedMetaEngine { public: - TestbedMetaEngine() : AdvancedMetaEngine(detectionParams) { + TestbedMetaEngine() : AdvancedMetaEngine(testbedDescriptions, sizeof(ADGameDescription), testbed_setting) { + params.md5Bytes = 512; + params.singleid = "testbed"; } virtual const char *getName() const { -- cgit v1.2.3 From ce1a8576694ede9434d4e44babc4dead9f6b44d7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:56 +0200 Subject: TINSEL: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/tinsel/detection.cpp | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 0d283f2ceb..59a567bc63 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -74,34 +74,11 @@ static const PlainGameDescriptor tinselGames[] = { #include "tinsel/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Tinsel::gameDescriptions, - // Size of that superset structure - sizeof(Tinsel::TinselGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - tinselGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "tinsel", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class TinselMetaEngine : public AdvancedMetaEngine { public: - TinselMetaEngine() : AdvancedMetaEngine(detectionParams) {} + TinselMetaEngine() : AdvancedMetaEngine(Tinsel::gameDescriptions, sizeof(Tinsel::TinselGameDescription), tinselGames) { + params.singleid = "tinsel"; + } virtual const char *getName() const { return "Tinsel"; @@ -265,7 +242,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - tmp.md5 = computeStreamMD5AsString(testFile, detectionParams.md5Bytes); + tmp.md5 = computeStreamMD5AsString(testFile, params.md5Bytes); } else { tmp.size = -1; } @@ -285,7 +262,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & bool fileMissing = false; - if ((detectionParams.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra) + if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra) continue; bool allFilesPresent = true; -- cgit v1.2.3 From 5e9039369790379362c29619453327d2b3be4170 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:57 +0200 Subject: TOON: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/toon/detection.cpp | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index be47d24c29..8ddfcd4fed 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -28,7 +28,7 @@ #include "graphics/thumbnail.h" #include "toon/toon.h" -static const PlainGameDescriptor ToonGames[] = { +static const PlainGameDescriptor toonGames[] = { { "toon", "Toonstruck" }, { 0, 0 } }; @@ -117,35 +117,14 @@ static const char * const directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Toon::gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine gameid - ToonGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "toon", - // List of files for file-based fallback detection (optional) - Toon::fileBasedFallback, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 3, - // List of directory globs - directoryGlobs -}; - class ToonMetaEngine : public AdvancedMetaEngine { public: - ToonMetaEngine() : AdvancedMetaEngine(detectionParams) {} - + ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) { + params.singleid = "toon"; + params.fileBasedFallback = Toon::fileBasedFallback; + params.depth = 3; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "Toon"; } -- cgit v1.2.3 From 3b6610927b5591a3909c4e0daea3d7232400fc32 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:57 +0200 Subject: TOUCHE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/touche/detection.cpp | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 4ffad35ada..3e324b5685 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -126,35 +126,16 @@ static const char *directoryGlobs[] = { 0 }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Touche::gameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 4096, - // List of all engine gameid - toucheGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "touche", - // List of files for file-based fallback detection (optional) - Touche::fileBasedFallback, - // Flags - kADFlagPrintWarningOnFileBasedFallback, - // Additional GUI options (for every game} - Common::GUIO_NONE, - // Maximum directory depth - 2, - // List of directory globs - directoryGlobs -}; - class ToucheMetaEngine : public AdvancedMetaEngine { public: - ToucheMetaEngine() : AdvancedMetaEngine(detectionParams) {} - + ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { + params.md5Bytes = 4096; + params.singleid = "touche"; + params.fileBasedFallback = Touche::fileBasedFallback; + params.flags = kADFlagPrintWarningOnFileBasedFallback; + params.depth = 2; + params.directoryGlobs = directoryGlobs; + } virtual const char *getName() const { return "Touche"; } -- cgit v1.2.3 From 0031e0834911ad3b4dbec262aec0dd30858e96fc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:58 +0200 Subject: TSAGE: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/tsage/detection.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 20c2002257..57ba9970d6 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -66,25 +66,17 @@ static const PlainGameDescriptor tSageGameTitles[] = { #include "engines/tsage/detection_tables.h" -static const ADParams detectionParams = { - (const byte *)tSage::gameDescriptions, - sizeof(tSage::tSageGameDescription), - 0, - tSageGameTitles, - 0, - "tsage", - NULL, - 0, - Common::GUIO_NONE, - 0, - NULL +enum { + MAX_SAVES = 100 }; -#define MAX_SAVES 100 - class TSageMetaEngine : public AdvancedMetaEngine { public: - TSageMetaEngine() : AdvancedMetaEngine(detectionParams) { + TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) { + params.md5Bytes = 0; // FIXME ???? + params.singleid = "tsage"; + params.guioptions = Common::GUIO_NOSPEECH; + params.depth = 0; // FIXME ???? } virtual const char *getName() const { -- cgit v1.2.3 From 59d56b66878ce9a5119c2278262fd37289685b4f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:53:58 +0200 Subject: TUCKER: Switch to alternate AdvancedMetaEngine, avoid ADParams --- engines/tucker/detection.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index fe7cb4779a..3eb3973371 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -102,31 +102,6 @@ static const ADGameDescription tuckerGameDescriptions[] = { AD_TABLE_END_MARKER }; -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)tuckerGameDescriptions, - // Size of that superset structure - sizeof(ADGameDescription), - // Number of bytes to compute MD5 sum for - 512, - // List of all engine gameid - tuckerGames, - // Structure for autoupgrading obsolete gameids - 0, - // Name of single gameid (optional) - "tucker", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game) - Common::GUIO_NONE, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - static const ADGameDescription tuckerDemoGameDescription = { "tucker", "Non-Interactive Demo", @@ -139,7 +114,9 @@ static const ADGameDescription tuckerDemoGameDescription = { class TuckerMetaEngine : public AdvancedMetaEngine { public: - TuckerMetaEngine() : AdvancedMetaEngine(detectionParams) { + TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) { + params.md5Bytes = 512; + params.singleid = "tucker"; } virtual const char *getName() const { -- cgit v1.2.3 From d46bfff0660042de52732eb4176e23b73a45e2d6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 15:56:56 +0200 Subject: DETECTOR: Make updateGameDescriptor a method of AdvancedMetaEngine --- engines/advancedDetector.cpp | 2 +- engines/advancedDetector.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index c715d1e96d..06f6c79db6 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -189,7 +189,7 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD return res; } -static void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc, const ADParams ¶ms) { +static void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) { if (params.singleid != NULL) { desc["preferredtarget"] = desc["gameid"]; desc["gameid"] = params.singleid; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index f3eac203da..e3a408701c 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -246,6 +246,9 @@ public: virtual const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const { return 0; } + +protected: + void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc); }; #endif -- cgit v1.2.3 From a0cba0a76032129d0197fa6413ea6ae6068ba073 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 20:18:44 +0200 Subject: SWORD25: Fix warning --- engines/sword25/sfx/soundengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 13ee3fd1d0..e650ae6945 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -73,7 +73,7 @@ void SoundEngine::update() { } void SoundEngine::setVolume(float volume, SOUND_TYPES type) { - int val = 255 * volume; + int val = (int)(255 * volume); switch (type) { case SoundEngine::MUSIC: -- cgit v1.2.3 From 8878be7b11e48541666a9a42a3d72122ad7c99f5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 20:19:18 +0200 Subject: LASTEXPRESS: Reduce header dependencies --- engines/lastexpress/detection.cpp | 5 +++++ engines/lastexpress/lastexpress.cpp | 2 ++ engines/lastexpress/lastexpress.h | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index d8b98bbbf2..bf575b63f8 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -21,6 +21,7 @@ */ #include "lastexpress/lastexpress.h" +#include "engines/advancedDetector.h" namespace LastExpress { @@ -202,6 +203,10 @@ bool LastExpressMetaEngine::createInstance(OSystem *syst, Engine **engine, const return gd != 0; } +bool LastExpressEngine::isDemo() const { + return (bool)(_gameDescription->flags & ADGF_DEMO); +} + } // End of namespace LastExpress #if PLUGIN_ENABLED_DYNAMIC(LASTEXPRESS) diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 6fdd18413b..e162998719 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -37,6 +37,8 @@ #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/error.h" +#include "common/fs.h" #include "engines/util.h" diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h index d78bba36f0..f8f38788a0 100644 --- a/engines/lastexpress/lastexpress.h +++ b/engines/lastexpress/lastexpress.h @@ -29,11 +29,12 @@ #include "common/random.h" #include "common/timer.h" -#include "engines/advancedDetector.h" #include "engines/engine.h" #include "graphics/pixelformat.h" +struct ADGameDescription; + /** * This is the namespace of the LastExpress engine. * @@ -101,7 +102,7 @@ public: void restoreEventHandlers(); void setEventHandlers(EventHandler::EventFunction *eventMouse, EventHandler::EventFunction *eventTick); - bool isDemo() const { return (bool)(_gameDescription->flags & ADGF_DEMO); } + bool isDemo() const; // Frame Counter uint32 getFrameCounter() { return _frameCounter; } -- cgit v1.2.3 From 95bfa811682bb620097e700c043ce5bd6ddfd562 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 21:55:01 +0200 Subject: TOON: Reduce header dependencies --- engines/toon/toon.cpp | 1 + engines/toon/toon.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 93da20fb47..0e0978b3d6 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -28,6 +28,7 @@ #include "common/savefile.h" #include "common/memstream.h" +#include "engines/advancedDetector.h" #include "engines/util.h" #include "graphics/palette.h" #include "graphics/surface.h" diff --git a/engines/toon/toon.h b/engines/toon/toon.h index 02828f26d1..65c6ba0234 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -23,7 +23,6 @@ #ifndef TOON_TOON_H #define TOON_TOON_H -#include "engines/advancedDetector.h" #include "engines/engine.h" #include "graphics/surface.h" #include "common/random.h" @@ -44,6 +43,8 @@ namespace Common { class MemoryWriteStreamDynamic; } +struct ADGameDescription; + #define TOON_DAT_VER_MAJ 0 // 1 byte #define TOON_DAT_VER_MIN 3 // 1 byte #define TOON_SAVEGAME_VERSION 4 -- cgit v1.2.3 From 5d584bc7826317acacf1ca53afcc807b9545541e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 21:55:12 +0200 Subject: TSAGE: Reduce header dependencies --- engines/tsage/tsage.h | 1 - 1 file changed, 1 deletion(-) diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index 563fdfcc21..5db45f24ab 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -23,7 +23,6 @@ #ifndef TSAGE_H #define TSAGE_H -#include "engines/advancedDetector.h" #include "engines/engine.h" #include "common/rect.h" #include "audio/mixer.h" -- cgit v1.2.3 From eea6f69b595be9c95f7af0f79086e0cb05fb8fa4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 22:13:51 +0200 Subject: DETECTOR: Turn some internal func of AdvancedMetaEngine into methods The eventual goal here is to make it easier (well, *possible*) for subclasses to modify the detector behavior, e.g. to implement custom fallback detection. One immediate goal could be to move the filebased fallback detector into a subclass. --- engines/advancedDetector.cpp | 104 +++++++++++++------------------------------ engines/advancedDetector.h | 50 +++++++++++++++++++-- 2 files changed, 79 insertions(+), 75 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 06f6c79db6..b0a304aad9 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -33,51 +33,7 @@ #include "engines/advancedDetector.h" -/** - * A list of pointers to ADGameDescription structs (or subclasses thereof). - */ -typedef Common::Array ADGameDescList; - - -/** - * Detect games in specified directory. - * Parameters language and platform are used to pass on values - * specified by the user. I.e. this is used to restrict search scope. - * - * @param fslist FSList to scan or NULL for scanning all specified - * default directories. - * @param params a ADParams struct containing various parameters - * @param language restrict results to specified language only - * @param platform restrict results to specified platform only - * @return list of ADGameDescription (or subclass) pointers corresponding to matched games - */ -static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams ¶ms, Common::Language language, Common::Platform platform, const Common::String &extra); - - -/** - * Returns list of targets supported by the engine. - * Distinguishes engines with single ID - */ -static GameList gameIDList(const ADParams ¶ms) { - if (params.singleid != NULL) { - GameList gl; - - const PlainGameDescriptor *g = params.gameDescriptors; - while (g->gameid) { - if (0 == scumm_stricmp(params.singleid, g->gameid)) { - gl.push_back(GameDescriptor(g->gameid, g->description)); - - return gl; - } - g++; - } - error("Engine %s doesn't have its singleid specified in ids list", params.singleid); - } - - return GameList(params.gameDescriptors); -} - -static void upgradeTargetIfNecessary(const ADParams ¶ms) { +void AdvancedMetaEngine::upgradeTargetIfNecessary() const { if (params.obsoleteList == 0) return; @@ -189,7 +145,7 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD return res; } -static void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) { +void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const { if (params.singleid != NULL) { desc["preferredtarget"] = desc["gameid"]; desc["gameid"] = params.singleid; @@ -234,7 +190,7 @@ bool cleanupPirated(ADGameDescList &matched) { GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { - ADGameDescList matches = detectGame(fslist, params, Common::UNK_LANG, Common::kPlatformUnknown, ""); + ADGameDescList matches = detectGame(fslist, Common::UNK_LANG, Common::kPlatformUnknown, ""); GameList detectedGames; if (cleanupPirated(matches)) @@ -245,14 +201,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { const ADGameDescription *fallbackDesc = fallbackDetect(fslist); if (fallbackDesc != 0) { GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors)); - updateGameDescriptor(desc, fallbackDesc, params); + updateGameDescriptor(desc, fallbackDesc); detectedGames.push_back(desc); } } else { // Otherwise use the found matches for (uint i = 0; i < matches.size(); i++) { GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors)); - updateGameDescriptor(desc, matches[i], params); + updateGameDescriptor(desc, matches[i]); detectedGames.push_back(desc); } } @@ -262,7 +218,7 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); - upgradeTargetIfNecessary(params); + upgradeTargetIfNecessary(); const ADGameDescription *agdDesc = 0; Common::Language language = Common::UNK_LANG; @@ -305,7 +261,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) return Common::kNoGameDataFoundError; } - ADGameDescList matches = detectGame(files, params, language, platform, extra); + ADGameDescList matches = detectGame(files, language, platform, extra); if (cleanupPirated(matches)) return Common::kNoGameDataFoundError; @@ -357,7 +313,6 @@ struct SizeMD5 { }; typedef Common::HashMap SizeMD5Map; -typedef Common::HashMap FileMap; static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSizeMD5) { // TODO: This message should be cleaned up / made more specific. @@ -379,26 +334,22 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz g_system->logMessage(LogMessageType::kInfo, report.c_str()); } -static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms); - -static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth, const char * const *directoryGlobs) { +void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const { if (depth <= 0) return; if (fslist.empty()) return; - // First we compose a hashmap of all files in fslist. - // Includes nifty stuff like removing trailing dots and ignoring case. for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (file->isDirectory()) { Common::FSList files; - if (!directoryGlobs) + if (!params.directoryGlobs) continue; bool matched = false; - for (const char * const *glob = directoryGlobs; *glob; glob++) + for (const char * const *glob = params.directoryGlobs; *glob; glob++) if (file->getName().matchString(*glob, true)) { matched = true; break; @@ -410,7 +361,7 @@ static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, if (!file->getChildren(files, Common::FSNode::kListAll)) continue; - composeFileHashMap(files, allFiles, depth - 1, directoryGlobs); + composeFileHashMap(files, allFiles, depth - 1); } Common::String tstr = file->getName(); @@ -423,7 +374,7 @@ static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, } } -static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams ¶ms, Common::Language language, Common::Platform platform, const Common::String &extra) { +ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const { FileMap allFiles; SizeMD5Map filesSizeMD5; @@ -437,8 +388,7 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p debug(3, "Starting detection in dir '%s'", parent.getPath().c_str()); // First we compose a hashmap of all files in fslist. - // Includes nifty stuff like removing trailing dots and ignoring case. - composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth), params.directoryGlobs); + composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth)); // Check which files are included in some ADGameDescription *and* present // in fslist. Compute MD5s and file sizes for these files. @@ -576,19 +526,13 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p // Filename based fallback if (params.fileBasedFallback != 0) - matched = detectGameFilebased(allFiles, params); + matched = detectGameFilebased(allFiles); } return matched; } -/** - * Check for each ADFileBasedFallback record whether all files listed - * in it are present. If multiple pass this test, we pick the one with - * the maximal number of matching files. In case of a tie, the entry - * coming first in the list is chosen. - */ -static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms) { +ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) const { const ADFileBasedFallback *ptr; const char* const* filenames; @@ -642,8 +586,24 @@ static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParam } GameList AdvancedMetaEngine::getSupportedGames() const { - return gameIDList(params); + if (params.singleid != NULL) { + GameList gl; + + const PlainGameDescriptor *g = params.gameDescriptors; + while (g->gameid) { + if (0 == scumm_stricmp(params.singleid, g->gameid)) { + gl.push_back(GameDescriptor(g->gameid, g->description)); + + return gl; + } + g++; + } + error("Engine %s doesn't have its singleid specified in ids list", params.singleid); + } + + return GameList(params.gameDescriptors); } + GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const { return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList); } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index e3a408701c..e5922bea4a 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -70,6 +70,11 @@ struct ADGameDescription { uint32 guioptions; }; +/** + * A list of pointers to ADGameDescription structs (or subclasses thereof). + */ +typedef Common::Array ADGameDescList; + /** * End marker for a table of ADGameDescription structs. Use this to * terminate a list to be passed to the AdvancedDetector API. @@ -214,7 +219,7 @@ namespace AdvancedDetector { */ GameDescriptor findGameID( const char *gameid, - const PlainGameDescriptor *list, + const PlainGameDescriptor *gameDescriptors, const ADObsoleteGameID *obsoleteList = 0 ); @@ -230,12 +235,20 @@ public: AdvancedMetaEngine(const ADParams &dp) : params(dp) {} AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors); + /** + * Returns list of targets supported by the engine. + * Distinguishes engines with single ID + */ virtual GameList getSupportedGames() const; + virtual GameDescriptor findGame(const char *gameid) const; + virtual GameList detectGames(const Common::FSList &fslist) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; - // To be provided by subclasses +protected: + // To be implemented by subclasses virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const = 0; /** @@ -248,7 +261,38 @@ public: } protected: - void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc); + typedef Common::HashMap FileMap; + + /** + * Detect games in specified directory. + * Parameters language and platform are used to pass on values + * specified by the user. I.e. this is used to restrict search scope. + * + * @param fslist FSList to scan or NULL for scanning all specified + * default directories. + * @param language restrict results to specified language only + * @param platform restrict results to specified platform only + * @return list of ADGameDescription (or subclass) pointers corresponding to matched games + */ + ADGameDescList detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const; + + /** + * Check for each ADFileBasedFallback record whether all files listed + * in it are present. If multiple pass this test, we pick the one with + * the maximal number of matching files. In case of a tie, the entry + * coming first in the list is chosen. + */ + ADGameDescList detectGameFilebased(const FileMap &allFiles) const; + + void upgradeTargetIfNecessary() const; + + void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const; + + /** + * Compose a hashmap of all files in fslist. + * Includes nifty stuff like removing trailing dots and ignoring case. + */ + void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const; }; #endif -- cgit v1.2.3 From 7ab553d72a14c04be1aa7e787eeef360be7bb619 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 22:30:03 +0200 Subject: COMMON: Do not try to read from res forks of non-existant files --- common/macresman.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/common/macresman.cpp b/common/macresman.cpp index 6cbc08da19..c1cab8b96a 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -107,14 +107,17 @@ bool MacResManager::open(String filename) { #ifdef MACOSX // Check the actual fork on a Mac computer String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc"; - SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream();; + FSNode resFsNode = FSNode(fullPath); + if (resFsNode.exists()) { + SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();; - if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) { - _baseFileName = filename; - return true; - } + if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) { + _baseFileName = filename; + return true; + } - delete macResForkRawStream; + delete macResForkRawStream; + } #endif File *file = new File(); @@ -167,14 +170,17 @@ bool MacResManager::open(FSNode path, String filename) { #ifdef MACOSX // Check the actual fork on a Mac computer String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc"; - SeekableReadStream *macResForkRawStream = FSNode(fullPath).createReadStream(); + FSNode resFsNode = FSNode(fullPath); + if (resFsNode.exists()) { + SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();; - if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) { - _baseFileName = filename; - return true; - } + if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) { + _baseFileName = filename; + return true; + } - delete macResForkRawStream; + delete macResForkRawStream; + } #endif // First, let's try to see if the Mac converted name exists -- cgit v1.2.3 From 6a6b9aabeaca1737000401c6099fd39b00eb351e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 10 Jun 2011 22:39:23 +0200 Subject: TSAGE: Elaborate on one FIXME I previously added, resolve another Turns out params.depth == 0 is the same as == 1 --- engines/tsage/detection.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 57ba9970d6..8aae6aac8e 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -73,10 +73,19 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) { - params.md5Bytes = 0; // FIXME ???? + // FIXME: Using 0 for md5Bytes means that the whole file will checked. + // this is usually a bad idea, as it can cause terribly slowdowns + // (remember, the MD5 is recomputed whenever the game starts, and also + // for many, many files when doing a "Mass Add" from the launcher. Even + // if the files you currently use for detection are all just a few + // kilobytes, you should still set a value here, just in case in the + // future you'll end up detecting with somewhat bigger files. + // I recommend using the default of 5000 here; if this is not possible, + // try a value like 10000 or 1024*1024, but be prepared to here from + // some suffering users ;) + params.md5Bytes = 0; params.singleid = "tsage"; params.guioptions = Common::GUIO_NOSPEECH; - params.depth = 0; // FIXME ???? } virtual const char *getName() const { -- cgit v1.2.3 From afbfb056f7e93dab083b0fed56aa0723ce825604 Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 10 Jun 2011 22:19:43 +0200 Subject: LOL: fix so-called bug #3313950 (LoL support for Italian fan translation) --- engines/kyra/detection_tables.h | 53 +++++++++++++++++++++++++++++++++++++++++ engines/kyra/kyra_v1.h | 2 +- engines/kyra/lol.cpp | 7 +++++- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 8a948eff00..e4815ab751 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -47,6 +47,7 @@ namespace { #define KYRA3_CD_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, true, false, false, true, false, Kyra::GI_KYRA3) #define LOL_CD_FLAGS FLAGS(false, false, true, false, false, false, false, Kyra::GI_LOL) +#define LOL_CD_FAN_FLAGS(x, y) FLAGS_FAN(x, y, false, false, true, false, false, false, false, Kyra::GI_LOL) #define LOL_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_LOL) #define LOL_FLOPPY_CMP_FLAGS FLAGS(false, false, false, false, false, false, true, Kyra::GI_LOL) #define LOL_PC98_SJIS_FLAGS FLAGS(false, false, false, true, true, false, false, Kyra::GI_LOL) @@ -1056,6 +1057,58 @@ const KYRAGameDescription adGameDescs[] = { LOL_CD_FLAGS }, + // Italian fan translation + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "05a4f588fb81dc9c0ef1f2ec20d89e24", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::IT_ITA, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "05a4f588fb81dc9c0ef1f2ec20d89e24", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "05a4f588fb81dc9c0ef1f2ec20d89e24", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::FR_FRA, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + { { "lol", diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index cf15b189ac..5b4f3385a4 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -99,7 +99,7 @@ class KyraMetaEngine; * - The Legend of Kyrandia (fully supported, except for Macintosh port, which lacks sound) * - (The) Hand of Fate (fully supported) * - Malcolm's Revenge (fully supported) - * - Lands of Lore: The Throne of Chaos (completable, still work in progress) + * - Lands of Lore: The Throne of Chaos (fully supported) */ namespace Kyra { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 0d4eb0056c..c567cbb037 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -43,7 +43,12 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy _txt = 0; _tim = 0; - switch (_flags.lang) { + _lang = 0; + Common::Language lang = Common::parseLanguage(ConfMan.get("language")); + if (lang == _flags.fanLang && _flags.replacedLang != Common::UNK_LANG) + lang = _flags.replacedLang; + + switch (lang) { case Common::EN_ANY: case Common::EN_USA: case Common::EN_GRB: -- cgit v1.2.3 From 6183658555b95c54eba29a3dc73bd63937dce2cd Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Jun 2011 23:33:42 +0200 Subject: TSAGE: Detect using MD5 based on 5000 bytes instead of unlimited --- engines/tsage/detection.cpp | 12 +----------- engines/tsage/detection_tables.h | 38 ++++++++++++++------------------------ 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 8aae6aac8e..e9e80312b9 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -73,17 +73,7 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) { - // FIXME: Using 0 for md5Bytes means that the whole file will checked. - // this is usually a bad idea, as it can cause terribly slowdowns - // (remember, the MD5 is recomputed whenever the game starts, and also - // for many, many files when doing a "Mass Add" from the launcher. Even - // if the files you currently use for detection are all just a few - // kilobytes, you should still set a value here, just in case in the - // future you'll end up detecting with somewhat bigger files. - // I recommend using the default of 5000 here; if this is not possible, - // try a value like 10000 or 1024*1024, but be prepared to here from - // some suffering users ;) - params.md5Bytes = 0; + params.md5Bytes = 5000; params.singleid = "tsage"; params.guioptions = Common::GUIO_NOSPEECH; } diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index dc55f2a66d..bf163b7c9c 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -24,7 +24,7 @@ namespace tSage { static const tSageGameDescription gameDescriptions[] = { - // Ringworld English CD version + // Ringworld CD and First Wave versions { { "ring", @@ -38,26 +38,12 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_CD | GF_ALT_REGIONS }, - // Ringworld First Wave English CD version - { - { - "ring", - "CD", - AD_ENTRY1s("ring.rlb", "0a25b4ee58d44a54425c0b47e5096bbc", 37847618), - Common::EN_ANY, - Common::kPlatformPC, - ADGF_NO_FLAGS, - Common::GUIO_NONE - }, - GType_Ringworld, - GF_CD | GF_ALT_REGIONS - }, // Ringworld English Floppy version { { "ring", "Floppy", - AD_ENTRY1s("ring.rlb", "61f78f68a56832ae95fe06748c403234", 8438770), + AD_ENTRY1s("ring.rlb", "7b7f0c5b37b58fa5ec06ebb2ca0d0d9d", 8438770), Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, @@ -66,6 +52,8 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY }, +#if 0 + // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) // Ringworld English Floppy Demo #1 version { { @@ -80,6 +68,7 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY | GF_DEMO }, + // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) // Ringworld English Floppy Demo #2 version { { @@ -94,13 +83,13 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY | GF_DEMO | GF_ALT_REGIONS }, - - // Blue Force + // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) + // Blue Force floppy { { "blueforce", - "", - AD_ENTRY1s("blue.rlb", "467da43c848cc0e800b547c59d84ccb1", 10032614), + "Floppy", + AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508), Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, @@ -109,12 +98,13 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_FLOPPY }, - // Blue Force floppy +#endif + // Blue Force { { "blueforce", - "Floppy", - AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508), + "", + AD_ENTRY1s("blue.rlb", "17eabb456cb1546c66baf1aff387ba6a", 10032614), Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, @@ -128,7 +118,7 @@ static const tSageGameDescription gameDescriptions[] = { { "blueforce", "CD", - AD_ENTRY1s("blue.rlb", "ac29f38184cb3b874ea18523059872ba", 63863322), + AD_ENTRY1s("blue.rlb", "99983f48cb218f1f3760cf2f9a7ef11d", 63863322), Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, -- cgit v1.2.3 From 154316b198fcf9fb06ce14e8cc922021c75bc0fb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Jun 2011 23:57:38 +0200 Subject: TSAGE: Update MD5 for ringworld demo #1 --- engines/tsage/detection_tables.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index bf163b7c9c..fb97e40449 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -52,14 +52,12 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY }, -#if 0 - // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) // Ringworld English Floppy Demo #1 version { { "ring", "Floppy Demo", - AD_ENTRY1s("tsage.rlb", "bf4e8525d0cab84b08b57126092eeacd", 833453), + AD_ENTRY1s("tsage.rlb", "3b3604a97c06c91f3735d3e9d341f63f", 833453), Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, @@ -68,6 +66,7 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY | GF_DEMO }, +#if 0 // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) // Ringworld English Floppy Demo #2 version { -- cgit v1.2.3 From eea48434f55bd7a85e47303b2d20de77b748fcf8 Mon Sep 17 00:00:00 2001 From: md5 Date: Sat, 11 Jun 2011 14:00:02 +0300 Subject: SCI: Changed order of script and room in error messages This matches the order in which workarounds are stored in workarounds.cpp --- engines/sci/engine/vm.cpp | 24 ++++++++++++------------ engines/sci/engine/vm_types.cpp | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 499574957e..1517355365 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -130,16 +130,16 @@ static reg_t read_var(EngineState *s, int type, int index) { if (solution.type == WORKAROUND_NONE) { #ifdef RELEASE_BUILD // If we are running an official ScummVM release -> fake 0 in unknown cases - warning("Uninitialized read for temp %d from method %s::%s (script %d, room %d, localCall %x)", - index, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, - g_sci->getEngineState()->currentRoomNumber(), originReply.localCallOffset); + warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), + originReply.scriptNr, originReply.localCallOffset); s->variables[type][index] = NULL_REG; break; #else - error("Uninitialized read for temp %d from method %s::%s (script %d, room %d, localCall %x)", - index, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, - g_sci->getEngineState()->currentRoomNumber(), originReply.localCallOffset); + error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), + originReply.scriptNr, originReply.localCallOffset); #endif } assert(solution.type == WORKAROUND_FAKE); @@ -366,9 +366,9 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { switch (solution.type) { case WORKAROUND_NONE: kernel->signatureDebug(kernelCall.signature, argc, argv); - error("[VM] k%s[%x]: signature mismatch via method %s::%s (script %d, room %d, localCall 0x%x)", + error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)", kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), - originReply.scriptNr, s->currentRoomNumber(), originReply.localCallOffset); + s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; case WORKAROUND_IGNORE: // don't do kernel call, leave acc alone return; @@ -418,13 +418,13 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { int callNameLen = strlen(kernelCall.name); if (strncmp(kernelCall.name, kernelSubCall.name, callNameLen) == 0) { const char *subCallName = kernelSubCall.name + callNameLen; - error("[VM] k%s(%s): signature mismatch via method %s::%s (script %d, room %d, localCall %x)", + error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)", kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(), - originReply.scriptNr, s->currentRoomNumber(), originReply.localCallOffset); + s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); } - error("[VM] k%s: signature mismatch via method %s::%s (script %d, room %d, localCall %x)", + error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)", kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), - originReply.scriptNr, s->currentRoomNumber(), originReply.localCallOffset); + s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; } case WORKAROUND_IGNORE: // don't do kernel call, leave acc alone diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp index 71a28a9761..e39c7708ad 100644 --- a/engines/sci/engine/vm_types.cpp +++ b/engines/sci/engine/vm_types.cpp @@ -32,9 +32,9 @@ reg_t reg_t::lookForWorkaround(const reg_t right) const { SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, arithmeticWorkarounds, &originReply); if (solution.type == WORKAROUND_NONE) - error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (script %d, room %d, localCall %x)", + error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)", PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(), - originReply.methodName.c_str(), originReply.scriptNr, g_sci->getEngineState()->currentRoomNumber(), + originReply.methodName.c_str(), g_sci->getEngineState()->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); assert(solution.type == WORKAROUND_FAKE); return make_reg(0, solution.value); -- cgit v1.2.3 From eb13803709ad90df75c38eea4ff1b6c55316ca9b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 11 Jun 2011 14:08:21 +0300 Subject: AUDIO: Add complementary functions for getting channel volume and balance --- audio/mixer.cpp | 38 ++++++++++++++++++++++++++++++++++++++ audio/mixer.h | 16 ++++++++++++++++ audio/mixer_intern.h | 2 ++ 3 files changed, 56 insertions(+) diff --git a/audio/mixer.cpp b/audio/mixer.cpp index fb4fffb8d8..128224ae85 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -93,6 +93,13 @@ public: */ void setVolume(const byte volume); + /** + * Gets the channel's own volume. + * + * @return volume + */ + byte getVolume(); + /** * Sets the channel's balance setting. * @@ -100,6 +107,13 @@ public: */ void setBalance(const int8 balance); + /** + * Gets the channel's balance setting. + * + * @return balance + */ + int8 getBalance(); + /** * Notifies the channel that the global sound type * volume settings changed. @@ -342,6 +356,14 @@ void MixerImpl::setChannelVolume(SoundHandle handle, byte volume) { _channels[index]->setVolume(volume); } +byte MixerImpl::getChannelVolume(SoundHandle handle) { + const int index = handle._val % NUM_CHANNELS; + if (!_channels[index] || _channels[index]->getHandle()._val != handle._val) + return 0; + + return _channels[index]->getVolume(); +} + void MixerImpl::setChannelBalance(SoundHandle handle, int8 balance) { Common::StackLock lock(_mutex); @@ -352,6 +374,14 @@ void MixerImpl::setChannelBalance(SoundHandle handle, int8 balance) { _channels[index]->setBalance(balance); } +int8 MixerImpl::getChannelBalance(SoundHandle handle) { + const int index = handle._val % NUM_CHANNELS; + if (!_channels[index] || _channels[index]->getHandle()._val != handle._val) + return 0; + + return _channels[index]->getBalance(); +} + uint32 MixerImpl::getSoundElapsedTime(SoundHandle handle) { return getElapsedTime(handle).msecs(); } @@ -482,11 +512,19 @@ void Channel::setVolume(const byte volume) { updateChannelVolumes(); } +byte Channel::getVolume() { + return _volume; +} + void Channel::setBalance(const int8 balance) { _balance = balance; updateChannelVolumes(); } +int8 Channel::getBalance() { + return _balance; +} + void Channel::updateChannelVolumes() { // From the channel balance/volume and the global volume, we compute // the effective volume for the left and right channel. Note the diff --git a/audio/mixer.h b/audio/mixer.h index 1fbe265488..de709e13fe 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -210,6 +210,14 @@ public: */ virtual void setChannelVolume(SoundHandle handle, byte volume) = 0; + /** + * Get the channel volume for the given handle. + * + * @param handle the sound to affect + * @return channel volume + */ + virtual byte getChannelVolume(SoundHandle handle) = 0; + /** * Set the channel balance for the given handle. * @@ -219,6 +227,14 @@ public: */ virtual void setChannelBalance(SoundHandle handle, int8 balance) = 0; + /** + * Get the channel balance for the given handle. + * + * @param handle the sound to affect + * @return channel balance + */ + virtual int8 getChannelBalance(SoundHandle handle) = 0; + /** * Get approximation of for how long the channel has been playing. */ diff --git a/audio/mixer_intern.h b/audio/mixer_intern.h index a04eb55c5b..dc361ce560 100644 --- a/audio/mixer_intern.h +++ b/audio/mixer_intern.h @@ -105,7 +105,9 @@ public: virtual bool isSoundTypeMuted(SoundType type) const; virtual void setChannelVolume(SoundHandle handle, byte volume); + virtual byte getChannelVolume(SoundHandle handle); virtual void setChannelBalance(SoundHandle handle, int8 balance); + virtual int8 getChannelBalance(SoundHandle handle); virtual uint32 getSoundElapsedTime(SoundHandle handle); virtual Timestamp getElapsedTime(SoundHandle handle); -- cgit v1.2.3 From eb9b492ce7444400246525a66a316b50f1de2bde Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 11 Jun 2011 14:09:03 +0300 Subject: SWORD25: Unstub more sound-related functions --- engines/sword25/sfx/soundengine.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index e650ae6945..9244137c25 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -126,11 +126,15 @@ void SoundEngine::resumeAll() { } void SoundEngine::pauseLayer(uint layer) { - warning("STUB: SoundEngine::pauseLayer(%d)", layer); + // Not used in the game + + warning("SoundEngine::pauseLayer(%d)", layer); } void SoundEngine::resumeLayer(uint layer) { - warning("STUB: SoundEngine::resumeLayer(%d)", layer); + // Not used in the game + + warning("SoundEngine::resumeLayer(%d)", layer); } SndHandle *SoundEngine::getHandle(uint *id) { @@ -238,7 +242,9 @@ void SoundEngine::stopSound(uint handle) { } bool SoundEngine::isSoundPaused(uint handle) { - warning("STUB: SoundEngine::isSoundPaused(%d)", handle); + // Not used in the game + + warning("SoundEngine::isSoundPaused(%d)", handle); return false; } @@ -252,20 +258,18 @@ bool SoundEngine::isSoundPlaying(uint handle) { } float SoundEngine::getSoundVolume(uint handle) { - warning("STUB: SoundEngine::getSoundVolume(%d)", handle); + debugC(1, kDebugSound, "SoundEngine::getSoundVolume(%d)", handle); - return 0; + return (float)_mixer->getChannelVolume(_handles[handle].handle) / 255.0; } float SoundEngine::getSoundPanning(uint handle) { - warning("STUB: SoundEngine::getSoundPanning(%d)", handle); + debugC(1, kDebugSound, "SoundEngine::getSoundPanning(%d)", handle); - return 0; + return (float)_mixer->getChannelBalance(_handles[handle].handle) / 127.0; } Resource *SoundEngine::loadResource(const Common::String &fileName) { - warning("STUB: SoundEngine::loadResource(%s)", fileName.c_str()); - return new SoundResource(fileName); } -- cgit v1.2.3 From 1f0f0595c46cc083dc2c6f00be1abf7f55a7b175 Mon Sep 17 00:00:00 2001 From: md5 Date: Sat, 11 Jun 2011 14:33:06 +0300 Subject: SCI: Added the Spanish version of EcoQuest 2 (bug #3313962) --- engines/sci/detection_tables.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index d56d8f03cd..def3879945 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -503,6 +503,14 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + // Eco Quest 2 - Spanish DOS Floppy (supplied by umbrio in bug report #3313962) + {"ecoquest2", "Floppy", { + {"resource.map", 0, "a6b271b934afa7e84d03816a4fefa67b", 5593}, + {"resource.000", 0, "1c4093f7248240329121fdf8c0d59152", 4209150}, + {"resource.msg", 0, "eff8be1925d42288de55e405983e9314", 117810}, + AD_LISTEND}, + Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + // Freddy Pharkas - English DOS demo (from FRG) // SCI interpreter version 1.001.069 {"freddypharkas", "Demo", { -- cgit v1.2.3 From ece449298d5c34db763ae78b370842de17af17ef Mon Sep 17 00:00:00 2001 From: md5 Date: Sat, 11 Jun 2011 14:34:47 +0300 Subject: SCI: Fixed script bug #3313962 - "ECOQUEST2 Spanish: Crash near beginning" --- engines/sci/engine/workarounds.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 8bf90ff53d..464b4d8d5b 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -34,6 +34,7 @@ namespace Sci { const SciWorkaroundEntry arithmeticWorkarounds[] = { { GID_CAMELOT, 92, 92, 0, "endingCartoon2", "changeState", 0x20d, 0, { WORKAROUND_FAKE, 0 } }, // op_lai: during the ending, sub gets called with no parameters, uses parameter 1 which is theGrail in this case - bug #3044734 { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xcc6, 0, { WORKAROUND_FAKE, 0 } }, // op_or: when giving the papers to the customs officer, gets called against a pointer instead of a number - bug #3034464 + { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xce0, 0, { WORKAROUND_FAKE, 0 } }, // Same as above, for the Spanish version - bug #3313962 { GID_FANMADE, 516, 983, 0, "Wander", "setTarget", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #3038913 { GID_ICEMAN, 199, 977, 0, "Grooper", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_add: While dancing with the girl { GID_MOTHERGOOSE256, -1, 999, 0, "Event", "new", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_and: constantly during the game (SCI1 version) -- cgit v1.2.3 From 4338c4dccf7a2ef6eb1c30b9e41293a8ff42fbe4 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 11 Jun 2011 16:27:25 +0200 Subject: LOL: update kyra.dat for italian fan translation --- devtools/create_kyradat/create_kyradat.cpp | 2 +- devtools/create_kyradat/games.cpp | 2 +- dists/engine-data/kyra.dat | Bin 355898 -> 356433 bytes engines/kyra/staticres.cpp | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index 6a8e6a0fbe..e4686cc66c 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -45,7 +45,7 @@ #include enum { - kKyraDatVersion = 73 + kKyraDatVersion = 74 }; const ExtractFilename extractFilenames[] = { diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp index f65ff14e1e..76d5d70186 100644 --- a/devtools/create_kyradat/games.cpp +++ b/devtools/create_kyradat/games.cpp @@ -107,7 +107,7 @@ const Game lolGames[] = { // DOS CD (multi language version, with no language specific strings) { kLol, { EN_ANY, FR_FRA, DE_DEU }, kPlatformPC, kTalkieVersion, { "9d1778314de80598c0b0d032e2a1a1cf", "263998ec600afca1cc7b935c473df670" } }, - + { kLol, { IT_ITA, FR_FRA, DE_DEU }, kPlatformPC, kTalkieVersion, { "9d1778314de80598c0b0d032e2a1a1cf", "f2af366e00f79dbf832fa19701d71ed9" } }, // Italian fan translation GAME_DUMMY_ENTRY }; diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat index 23e866c62e..1d79ceddfd 100644 Binary files a/dists/engine-data/kyra.dat and b/dists/engine-data/kyra.dat differ diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 499cc6f301..d56abc5d47 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -38,7 +38,7 @@ namespace Kyra { -#define RESFILE_VERSION 73 +#define RESFILE_VERSION 74 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { -- cgit v1.2.3 From 045ee136b599b21edefbd53ba9842d4da630d70d Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 8 May 2011 22:32:31 +0100 Subject: GPH: Update launch script for the GP2X build to match other GPH devices. --- backends/platform/gph/devices/gp2x/scummvm.gpe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/platform/gph/devices/gp2x/scummvm.gpe b/backends/platform/gph/devices/gp2x/scummvm.gpe index e8983aa2ce..51a49f7560 100644 --- a/backends/platform/gph/devices/gp2x/scummvm.gpe +++ b/backends/platform/gph/devices/gp2x/scummvm.gpe @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Remount SD with forced Sync, does this really work? mount -o sync,remount /dev/mmcsd/disc0/part1 /mnt/sd/ @@ -8,7 +8,7 @@ mount -o sync,remount /dev/mmcsd/disc0/part1 /mnt/sd/ export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH # Run ScummVM, important this bit. -./scummvm.gph +./scummvm.gph --fullscreen --gfx-mode=1x --config=$(pwd)/.scummvmrc # Sync the SD card to check that everything is written. sync -- cgit v1.2.3 From 181ea053f47420089b8aada5a2fdbc7b5e292bc8 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 8 May 2011 22:40:19 +0100 Subject: GPH: Make helper script produce a non-plugin build for the GP2X. * Plugins are acting up on the old GP2X so disable for now until I get a chance to work on them some more. --- backends/platform/gph/build/gp2x-config.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backends/platform/gph/build/gp2x-config.sh b/backends/platform/gph/build/gp2x-config.sh index f474c4d0d4..a9b28b2fd0 100644 --- a/backends/platform/gph/build/gp2x-config.sh +++ b/backends/platform/gph/build/gp2x-config.sh @@ -23,8 +23,9 @@ cd ../../../.. --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 \ - --enable-vkeybd --enable-plugins --default-dynamic -# --disable-release --enable-debug + --enable-vkeybd + # --enable-plugins --default-dynamic +# --disable-release --enable-debug echo Generating config for GP2X complete. Check for errors. -- cgit v1.2.3 From 64b8587507ee3cec2c38d505d2310f81b0b97ff0 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 8 May 2011 22:43:09 +0100 Subject: GPH: Cleanup and some WIP refactoring. --- backends/events/gph/gph-events.cpp | 1 - backends/graphics/gph/gph-graphics.cpp | 95 ++++++++++++++++++++++++++++------ backends/graphics/gph/gph-graphics.h | 4 +- backends/platform/gph/gph-backend.cpp | 20 ++++--- backends/platform/gph/gph-main.cpp | 4 +- backends/platform/gph/gph-sdl.h | 4 +- 6 files changed, 99 insertions(+), 29 deletions(-) diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp index 8bb3a3b183..b461f85fbb 100644 --- a/backends/events/gph/gph-events.cpp +++ b/backends/events/gph/gph-events.cpp @@ -187,7 +187,6 @@ GPHEventSource::GPHEventSource() // } //} - void GPHEventSource::moveStick() { bool stickBtn[32]; diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index b65028920f..eb748f2fc2 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -35,8 +35,8 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { {0, 0, 0} }; -GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *boss) - : SdlGraphicsManager(boss) { +GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *sdlEventSource) + : SdlGraphicsManager(sdlEventSource) { } const OSystem::GraphicsMode *GPHGraphicsManager::getSupportedGraphicsModes() const { @@ -110,21 +110,43 @@ void GPHGraphicsManager::setGraphicsModeIntern() { blitCursor(); } -void GPHGraphicsManager::initSize(uint w, uint h) { +void GPHGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) { assert(_transactionMode == kTransactionActive); +#ifdef USE_RGB_COLOR + // Avoid redundant format changes + Graphics::PixelFormat newFormat; + if (!format) + newFormat = Graphics::PixelFormat::createFormatCLUT8(); + else + newFormat = *format; + + assert(newFormat.bytesPerPixel > 0); + + if (newFormat != _videoMode.format) { + _videoMode.format = newFormat; + _transactionDetails.formatChanged = true; + _screenFormat = newFormat; + } +#endif + + // Avoid redundant res changes if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) return; _videoMode.screenWidth = w; _videoMode.screenHeight = h; + if (w > 320 || h > 240){ setGraphicsMode(GFX_HALF); setGraphicsModeIntern(); _sdlEventSource->toggleMouseGrab(); } + _videoMode.overlayWidth = 320; + _videoMode.overlayHeight = 240; + _transactionDetails.sizeChanged = true; } @@ -433,26 +455,65 @@ void GPHGraphicsManager::hideOverlay() { } -bool GPHGraphicsManager::loadGFXMode() { - - /* Forcefully disable aspect ratio correction for games - that start with a native 240px height resolution - This corrects games with non-standard resolutions - such as MM Nes (256x240). - */ +//bool GPHGraphicsManager::loadGFXMode() { + + +// _videoMode.overlayWidth = 320; +// _videoMode.overlayHeight = 240; +// _videoMode.fullscreen = true; +// +// /* Forcefully disable aspect ratio correction for games +// that start with a native 240px height resolution +// This corrects games with non-standard resolutions +// such as MM Nes (256x240). +// */ +// if(_videoMode.screenHeight == 240) { +// _videoMode.aspectRatioCorrection = false; +// } + +// debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight); +// if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) { +// _videoMode.aspectRatioCorrection = false; +// setGraphicsMode(GFX_HALF); +// debug("GraphicsMode set to HALF"); +// } else { +// setGraphicsMode(GFX_NORMAL); +// debug("GraphicsMode set to NORMAL"); +// } + + +// if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) { +// //_videoMode.overlayWidth = _videoMode.screenWidth / 2; +// //_videoMode.overlayHeight = _videoMode.screenHeight / 2; +// _videoMode.overlayWidth = 320; +// _videoMode.overlayHeight = 240; +// _videoMode.fullscreen = true; +// } else { +// +// _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; +// _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; +// +// if (_videoMode.aspectRatioCorrection) +// _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); +// +// //_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; +// //_videoMode.hardwareHeight = effectiveScreenHeight(); +// _videoMode.hardwareWidth = 320; +// _videoMode.hardwareHeight = 240; +// +// } + +// return SdlGraphicsManager::loadGFXMode(); +//} - if(_videoMode.screenHeight == 240) { - _videoMode.aspectRatioCorrection = false; - } - - debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight); +bool GPHGraphicsManager::loadGFXMode() { if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) { _videoMode.aspectRatioCorrection = false; setGraphicsMode(GFX_HALF); - debug("GraphicsMode set to HALF"); +// printf("GFX_HALF\n"); } else { setGraphicsMode(GFX_NORMAL); - debug("GraphicsMode set to NORMAL"); +// printf("GFX_NORMAL\n"); } if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) { diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h index 6ba2b344a6..fc3dc5730d 100644 --- a/backends/graphics/gph/gph-graphics.h +++ b/backends/graphics/gph/gph-graphics.h @@ -24,7 +24,7 @@ #define BACKENDS_GRAPHICS_GPH_H #include "backends/graphics/sdl/sdl-graphics.h" -#include "graphics/scaler/aspect.h" // for aspect2Real +#include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" enum { @@ -40,7 +40,7 @@ public: bool getFeatureState(OSystem::Feature f); int getDefaultGraphicsMode() const; - void initSize(uint w, uint h); + void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL); const OSystem::GraphicsMode *getSupportedGraphicsModes() const; bool setGraphicsMode(const char *name); bool setGraphicsMode(int mode); diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index cb52da441d..ae3466b836 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -56,8 +56,15 @@ /* Dump console info to files. */ #define DUMP_STDOUT +OSystem_GPH::OSystem_GPH() + : + OSystem_POSIX() { +} + void OSystem_GPH::initBackend() { + assert(!_inited); + // Create the events manager if (_eventSource == 0) _eventSource = new GPHEventSource(); @@ -81,7 +88,7 @@ void OSystem_GPH::initBackend() { char workDirName[PATH_MAX+1]; if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Could not obtain current working directory"); + error("Could not obtain current working directory."); } else { printf("Current working directory: %s\n", workDirName); } @@ -155,7 +162,8 @@ void OSystem_GPH::initBackend() { /* Trigger autosave every 4 minutes - On low batts 5 mins is about your warning time. */ ConfMan.registerDefault("autosave_period", 4 * 60); - /* Make sure that aspect ratio correction is enabled on the 1st run to stop users asking me what the 'wasted space' is ;-). */ + /* Make sure that aspect ratio correction is enabled on the 1st run to stop + users asking me what the 'wasted space' at the bottom is ;-). */ ConfMan.registerDefault("aspect_ratio", true); /* Make sure SDL knows that we have a joystick we want to use. */ @@ -164,10 +172,10 @@ void OSystem_GPH::initBackend() { /* Now setup any device specific user options (Left handed mode, that sort of thing). */ // GPH::setOptions(); - printf("%s\n", "Passing to OSystem::SDL initBackend."); - /* Pass to POSIX method to do the heavy lifting */ OSystem_POSIX::initBackend(); + + _inited = true; } void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { @@ -176,7 +184,7 @@ void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) char workDirName[PATH_MAX+1]; if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Error: Could not obtain current working directory"); + error("Error: Could not obtain current working directory."); } Common::FSNode workdirNode(workDirName); @@ -215,5 +223,5 @@ void OSystem_GPH::quit() { fclose(stderr); #endif /* DUMP_STDOUT */ - OSystem_SDL::quit(); + OSystem_POSIX::quit(); } diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp index f91ec8f478..1a8c6686ca 100644 --- a/backends/platform/gph/gph-main.cpp +++ b/backends/platform/gph/gph-main.cpp @@ -21,7 +21,7 @@ */ #include "backends/platform/gph/gph-sdl.h" -#include "backends/plugins/sdl/sdl-provider.h" +#include "backends/plugins/posix/posix-provider.h" #include "base/main.h" #if defined(GPH_DEVICE) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { ((OSystem_GPH *)g_system)->init(); #ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new SDLPluginProvider()); + PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); #endif // Invoke the actual ScummVM main entry point: diff --git a/backends/platform/gph/gph-sdl.h b/backends/platform/gph/gph-sdl.h index 68a641eed7..8b943f98f3 100644 --- a/backends/platform/gph/gph-sdl.h +++ b/backends/platform/gph/gph-sdl.h @@ -28,8 +28,8 @@ #include "backends/base-backend.h" #include "backends/platform/sdl/sdl.h" #include "backends/platform/sdl/posix/posix.h" -#include "backends/graphics/gph/gph-graphics.h" #include "backends/events/gph/gph-events.h" +#include "backends/graphics/gph/gph-graphics.h" #define __GP2XWIZ__ @@ -39,6 +39,8 @@ class OSystem_GPH : public OSystem_POSIX { public: + OSystem_GPH(); + /* Platform Setup Stuff */ void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); void initBackend(); -- cgit v1.2.3 From f759ff17046be2ef2bcc0c068d1ae2cfbed3e520 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 8 May 2011 22:37:33 +0100 Subject: BACKENDS: Remove stale GP2X code references. --- backends/module.mk | 8 -------- 1 file changed, 8 deletions(-) diff --git a/backends/module.mk b/backends/module.mk index 27058bef88..d1feae4317 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -118,14 +118,6 @@ MODULE_OBJS += \ graphics/gph/gph-graphics.o endif -# TODO/FIXME: The gp2xsdl files are only compiled if GP2X_OLD is defined, -# which currently is never the case (unless the user manually requests it). -# ifeq ($(BACKEND),gp2x) -# MODULE_OBJS += \ -# events/gp2xsdl/gp2xsdl-events.o \ -# graphics/gp2xsdl/gp2xsdl-graphics.o -# endif - ifeq ($(BACKEND),linuxmoto) MODULE_OBJS += \ events/linuxmotosdl/linuxmotosdl-events.o \ -- cgit v1.2.3 From 7878c1ec4933dcedf20ab20e15a671a2209c4838 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Thu, 26 May 2011 14:08:04 +0100 Subject: GP2X: Remove remnants of the old GP2X backend. The GP2X is now folded into the GPH backend (as the GP2X device). --- backends/events/gp2xsdl/gp2xsdl-events.cpp | 465 ------------------------- backends/events/gp2xsdl/gp2xsdl-events.h | 56 --- backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp | 180 ---------- backends/graphics/gp2xsdl/gp2xsdl-graphics.h | 46 --- backends/platform/gp2x/build/clean.sh | 17 - backends/platform/gp2x/gp2x-common.h | 49 --- backends/platform/gp2x/gp2x-hw.cpp | 228 ------------ backends/platform/gp2x/gp2x-hw.h | 62 ---- backends/platform/gp2x/gp2x-main.cpp | 50 --- backends/platform/gp2x/gp2x-mem.cpp | 84 ----- backends/platform/gp2x/gp2x-mem.h | 51 --- backends/platform/gp2x/gp2x.cpp | 208 ----------- backends/platform/gp2x/module.mk | 15 - 13 files changed, 1511 deletions(-) delete mode 100644 backends/events/gp2xsdl/gp2xsdl-events.cpp delete mode 100644 backends/events/gp2xsdl/gp2xsdl-events.h delete mode 100644 backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp delete mode 100644 backends/graphics/gp2xsdl/gp2xsdl-graphics.h delete mode 100755 backends/platform/gp2x/build/clean.sh delete mode 100644 backends/platform/gp2x/gp2x-common.h delete mode 100644 backends/platform/gp2x/gp2x-hw.cpp delete mode 100644 backends/platform/gp2x/gp2x-hw.h delete mode 100644 backends/platform/gp2x/gp2x-main.cpp delete mode 100644 backends/platform/gp2x/gp2x-mem.cpp delete mode 100644 backends/platform/gp2x/gp2x-mem.h delete mode 100644 backends/platform/gp2x/gp2x.cpp delete mode 100644 backends/platform/gp2x/module.mk diff --git a/backends/events/gp2xsdl/gp2xsdl-events.cpp b/backends/events/gp2xsdl/gp2xsdl-events.cpp deleted file mode 100644 index 5f5ff66319..0000000000 --- a/backends/events/gp2xsdl/gp2xsdl-events.cpp +++ /dev/null @@ -1,465 +0,0 @@ -/* 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 "common/scummsys.h" - -#if defined(GP2X_OLD) - -#include "backends/events/gp2xsdl/gp2xsdl-events.h" -#include "backends/platform/gp2x/gp2x-hw.h" -#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" - -#include "backends/platform/sdl/sdl.h" - -#include "common/translation.h" - -// FIXME move joystick defines out and replace with confile file options -// we should really allow users to map any key to a joystick button using the keymapper. -#define JOY_DEADZONE 2200 - -#define JOY_XAXIS 0 -#define JOY_YAXIS 1 - -/* Quick default button states for modifiers. */ -int BUTTON_STATE_L = false; - -enum { - /* DPAD/Stick */ - BUTTON_UP = 0, - BUTTON_UPLEFT = 1, - BUTTON_LEFT = 2, - BUTTON_DOWNLEFT = 3, - BUTTON_DOWN = 4, - BUTTON_DOWNRIGHT = 5, - BUTTON_RIGHT = 6, - BUTTON_UPRIGHT = 7, - /* Joystick Buttons */ - BUTTON_MENU = 8, // Start on F100 GP2X - BUTTON_SELECT = 9, - BUTTON_L = 10, - BUTTON_R = 11, - BUTTON_A = 12, - BUTTON_B = 13, - BUTTON_X = 14, - BUTTON_Y = 15, - BUTTON_VOLUP = 16, - BUTTON_VOLDOWN = 17, - BUTTON_CLICK = 18 -}; - -enum { - /* Unused Joystick Buttons on the GP2X */ - BUTTON_HOME = 51, - BUTTON_HOLD = 52, - BUTTON_HELP = 53, - BUTTON_HELP2 = 54 -}; - -enum { - /* Touchscreen TapMode */ - TAPMODE_LEFT = 0, - TAPMODE_RIGHT = 1, - TAPMODE_HOVER = 2 -}; - -GP2XSdlEventSource::GP2XSdlEventSource() - : _buttonStateL(false){ -} - -void GP2XSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event) { - event.kbd.flags = 0; - - if (mod & KMOD_SHIFT) - event.kbd.flags |= Common::KBD_SHIFT; - if (mod & KMOD_ALT) - event.kbd.flags |= Common::KBD_ALT; - if (mod & KMOD_CTRL) - event.kbd.flags |= Common::KBD_CTRL; - - // Sticky flags - if (mod & KMOD_NUM) - event.kbd.flags |= Common::KBD_NUM; - if (mod & KMOD_CAPS) - event.kbd.flags |= Common::KBD_CAPS; -} - -void GP2XSdlEventSource::moveStick() { - bool stickBtn[32]; - - memcpy(stickBtn, _stickBtn, sizeof(stickBtn)); - - if ((stickBtn[0])||(stickBtn[2])||(stickBtn[4])||(stickBtn[6])) - stickBtn[1] = stickBtn[3] = stickBtn[5] = stickBtn[7] = 0; - - if ((stickBtn[1])||(stickBtn[2])||(stickBtn[3])) { - if (_km.x_down_count!=2) { - _km.x_vel = -1; - _km.x_down_count = 1; - } else - _km.x_vel = -4; - } else if ((stickBtn[5])||(stickBtn[6])||(stickBtn[7])) { - if (_km.x_down_count!=2) { - _km.x_vel = 1; - _km.x_down_count = 1; - } else - _km.x_vel = 4; - } else { - _km.x_vel = 0; - _km.x_down_count = 0; - } - - if ((stickBtn[0])||(stickBtn[1])||(stickBtn[7])) { - if (_km.y_down_count!=2) { - _km.y_vel = -1; - _km.y_down_count = 1; - } else - _km.y_vel = -4; - } else if ((stickBtn[3])||(stickBtn[4])||(stickBtn[5])) { - if (_km.y_down_count!=2) { - _km.y_vel = 1; - _km.y_down_count = 1; - } else - _km.y_vel = 4; - } else { - _km.y_vel = 0; - _km.y_down_count = 0; - } -} - -/* GP2X Input mappings. -Single Button - -Movement: - -GP2X_BUTTON_UP Cursor Up -GP2X_BUTTON_DOWN Cursor Down -GP2X_BUTTON_LEFT Cursor Left -GP2X_BUTTON_RIGHT Cursor Right - -GP2X_BUTTON_UPLEFT Cursor Up Left -GP2X_BUTTON_UPRIGHT Cursor Up Right -GP2X_BUTTON_DOWNLEFT Cursor Down Left -GP2X_BUTTON_DOWNRIGHT Cursor Down Right - -Button Emulation: - -GP2X_BUTTON_CLICK Left Mouse Click (GP2X only) -GP2X_BUTTON_A . (Period) -GP2X_BUTTON_B Left Mouse Click -GP2X_BUTTON_Y Space Bar -GP2X_BUTTON_X Right Mouse Click -GP2X_BUTTON_L Combo Modifier (Left Trigger) -GP2X_BUTTON_R Return (Right Trigger) -GP2X_BUTTON_MENU F5 (Game Menu) -GP2X_BUTTON_SELECT Escape -GP2X_BUTTON_VOLUP /dev/mixer Global Volume Up -GP2X_BUTTON_VOLDOWN /dev/mixer Global Volume Down - -Combos: - -GP2X_BUTTON_VOLUP & GP2X_BUTTON_VOLDOWN 0 (For Monkey 2 CP) or Virtual Keyboard if enabled -GP2X_BUTTON_L & GP2X_BUTTON_SELECT Common::EVENT_QUIT (Calls Sync() to make sure SD is flushed) -GP2X_BUTTON_L & GP2X_BUTTON_MENU Common::EVENT_MAINMENU (ScummVM Global Main Menu) -GP2X_BUTTON_L & GP2X_BUTTON_A Common::EVENT_PREDICTIVE_DIALOG for predictive text entry box (AGI games) -GP2X_BUTTON_L & GP2X_BUTTON_Y Toggles setZoomOnMouse() for larger then 320*240 games to scale to the point + raduis. (GP2X only) -*/ - -bool GP2XSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { - SDLModToOSystemKeyFlags(SDL_GetModState(), event); - - if (remapKey(ev, event)) - return true; - - event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; - event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - - return true; -} - -bool GP2XSdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { - - _stickBtn[ev.jbutton.button] = 1; - event.kbd.flags = 0; - - switch (ev.jbutton.button) { - case BUTTON_UP: - case BUTTON_UPLEFT: - case BUTTON_LEFT: - case BUTTON_DOWNLEFT: - case BUTTON_DOWN: - case BUTTON_DOWNRIGHT: - case BUTTON_RIGHT: - case BUTTON_UPRIGHT: - moveStick(); - event.type = Common::EVENT_MOUSEMOVE; - fillMouseEvent(event, _km.x, _km.y); - break; - case BUTTON_B: - case BUTTON_CLICK: - if (BUTTON_STATE_L == true) { - ((GP2XSdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->toggleZoomOnMouse(); - fillMouseEvent(event, _km.x, _km.y); - } else { - event.type = Common::EVENT_LBUTTONDOWN; - fillMouseEvent(event, _km.x, _km.y); - } - break; - case BUTTON_X: - event.type = Common::EVENT_RBUTTONDOWN; - fillMouseEvent(event, _km.x, _km.y); - break; - case BUTTON_L: - BUTTON_STATE_L = true; - break; - case BUTTON_R: - event.type = Common::EVENT_KEYDOWN; - if (BUTTON_STATE_L == true) { -#ifdef ENABLE_VKEYBD - event.kbd.keycode = Common::KEYCODE_F7; - event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0); -#else - event.kbd.keycode = Common::KEYCODE_0; - event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0); -#endif - } else { - event.kbd.keycode = Common::KEYCODE_RETURN; - event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0); - } - break; - case BUTTON_SELECT: - case BUTTON_HOME: - event.type = Common::EVENT_KEYDOWN; - if (BUTTON_STATE_L == true) { - event.type = Common::EVENT_QUIT; - } else { - event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); - } - break; - case BUTTON_A: - event.type = Common::EVENT_KEYDOWN; - if (BUTTON_STATE_L == true) { - event.type = Common::EVENT_PREDICTIVE_DIALOG; - } else { - event.kbd.keycode = Common::KEYCODE_PERIOD; - event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); - } - break; - case BUTTON_Y: - event.type = Common::EVENT_KEYDOWN; - if (BUTTON_STATE_L == true) { - GPH::ToggleTapMode(); - if (GPH::tapmodeLevel == TAPMODE_LEFT) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click")); - } else if (GPH::tapmodeLevel == TAPMODE_RIGHT) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click")); - } else if (GPH::tapmodeLevel == TAPMODE_HOVER) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)")); - } - } else { - event.kbd.keycode = Common::KEYCODE_SPACE; - event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); - } - break; - case BUTTON_MENU: - case BUTTON_HELP: - event.type = Common::EVENT_KEYDOWN; - if (BUTTON_STATE_L == true) { - event.type = Common::EVENT_MAINMENU; - } else { - event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); - } - break; - case BUTTON_VOLUP: - GP2X_HW::mixerMoveVolume(2); - if (GP2X_HW::volumeLevel == 100) { - g_system->displayMessageOnOSD(_("Maximum Volume")); - } else { - g_system->displayMessageOnOSD(_("Increasing Volume")); - } - break; - - case BUTTON_VOLDOWN: - GP2X_HW::mixerMoveVolume(1); - if (GP2X_HW::volumeLevel == 0) { - g_system->displayMessageOnOSD(_("Minimal Volume")); - } else { - g_system->displayMessageOnOSD(_("Decreasing Volume")); - } - break; - case BUTTON_HOLD: - event.type = Common::EVENT_QUIT; - break; - case BUTTON_HELP2: - GPH::ToggleTapMode(); - if (GPH::tapmodeLevel == TAPMODE_LEFT) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click")); - } else if (GPH::tapmodeLevel == TAPMODE_RIGHT) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Right Click")); - } else if (GPH::tapmodeLevel == TAPMODE_HOVER) { - g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Hover (No Click)")); - } - break; - } - return true; -} - -bool GP2XSdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { - _stickBtn[ev.jbutton.button] = 0; - event.kbd.flags = 0; - - switch (ev.jbutton.button) { - case BUTTON_UP: - case BUTTON_UPLEFT: - case BUTTON_LEFT: - case BUTTON_DOWNLEFT: - case BUTTON_DOWN: - case BUTTON_DOWNRIGHT: - case BUTTON_RIGHT: - case BUTTON_UPRIGHT: - moveStick(); - event.type = Common::EVENT_MOUSEMOVE; - fillMouseEvent(event, _km.x, _km.y); - break; - case BUTTON_B: - case BUTTON_CLICK: - if (BUTTON_STATE_L == true) { - break; - } else { - event.type = Common::EVENT_LBUTTONUP; - fillMouseEvent(event, _km.x, _km.y); - } - break; - case BUTTON_X: - event.type = Common::EVENT_RBUTTONUP; - fillMouseEvent(event, _km.x, _km.y); - break; - case BUTTON_L: - BUTTON_STATE_L = false; - break; - case BUTTON_SELECT: - case BUTTON_HOME: - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); - break; - case BUTTON_A: - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = Common::KEYCODE_PERIOD; - event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); - break; - case BUTTON_Y: - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = Common::KEYCODE_SPACE; - event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); - break; - case BUTTON_MENU: - case BUTTON_HELP: - event.type = Common::EVENT_KEYUP; - if (BUTTON_STATE_L == true) { - event.type = Common::EVENT_MAINMENU; - } else { - event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); - } - break; - case BUTTON_R: - event.type = Common::EVENT_KEYUP; - if (BUTTON_STATE_L == true) { -#ifdef ENABLE_VKEYBD - event.kbd.keycode = Common::KEYCODE_F7; - event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0); -#else - event.kbd.keycode = Common::KEYCODE_0; - event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0); -#endif - } else { - event.kbd.keycode = Common::KEYCODE_RETURN; - event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0); - } - break; - case BUTTON_VOLUP: - break; - case BUTTON_VOLDOWN: - break; - case BUTTON_HOLD: - break; - case BUTTON_HELP2: - break; - } - return true; -} - -bool GP2XSdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) { - int axis = ev.jaxis.value; - if ( axis > JOY_DEADZONE) { - axis -= JOY_DEADZONE; - event.type = Common::EVENT_MOUSEMOVE; - } else if ( axis < -JOY_DEADZONE ) { - axis += JOY_DEADZONE; - event.type = Common::EVENT_MOUSEMOVE; - } else - axis = 0; - - if ( ev.jaxis.axis == JOY_XAXIS) { -#ifdef JOY_ANALOG - _km.x_vel = axis/2000; - _km.x_down_count = 0; -#else - if (axis != 0) { - _km.x_vel = (axis > 0) ? 1:-1; - _km.x_down_count = 1; - } else { - _km.x_vel = 0; - _km.x_down_count = 0; - } -#endif - - } else if (ev.jaxis.axis == JOY_YAXIS) { -#ifndef JOY_INVERT_Y - axis = -axis; -#endif -#ifdef JOY_ANALOG - _km.y_vel = -axis / 2000; - _km.y_down_count = 0; -#else - if (axis != 0) { - _km.y_vel = (-axis > 0) ? 1: -1; - _km.y_down_count = 1; - } else { - _km.y_vel = 0; - _km.y_down_count = 0; - } -#endif - } - - fillMouseEvent(event, _km.x, _km.y); - return true; -} - -bool GP2XSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { - return false; -} - -#endif diff --git a/backends/events/gp2xsdl/gp2xsdl-events.h b/backends/events/gp2xsdl/gp2xsdl-events.h deleted file mode 100644 index 0d74c1bcac..0000000000 --- a/backends/events/gp2xsdl/gp2xsdl-events.h +++ /dev/null @@ -1,56 +0,0 @@ -/* 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. - * - */ - -#if !defined(BACKEND_EVENTS_SDL_GP2X_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) -#define BACKEND_EVENTS_SDL_GP2X_H - -#include "backends/events/sdl/sdl-events.h" - -/** - * SDL events manager for GP2X - */ -class GP2XSdlEventSource : public SdlEventSource { -public: - GP2XSdlEventSource(); - -protected: - bool _stickBtn[32]; - - /** Button state for L button modifier */ - bool _buttonStateL; - - /** - * Handles the stick movement - */ - void moveStick(); - - virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event); - virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); - virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); - virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event); - - virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event); - - virtual bool remapKey(SDL_Event &ev, Common::Event &event); -}; - -#endif diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp b/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp deleted file mode 100644 index 6e5a35a1b1..0000000000 --- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* 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 "common/scummsys.h" - -#if defined(GP2X_OLD) - -#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" -#include "graphics/scaler/aspect.h" -#include - -static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { - {"Fullscreen", "1x", GFX_NORMAL}, - {0, 0, 0} -}; - -GP2XSdlGraphicsManager::GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource), _adjustZoomOnMouse(false) { -} - -const OSystem::GraphicsMode *GP2XSdlGraphicsManager::getSupportedGraphicsModes() const { - return s_supportedGraphicsModes; -} - -int GP2XSdlGraphicsManager::getDefaultGraphicsMode() const { - return GFX_NORMAL; -} - - -bool GP2XSdlGraphicsManager::hasFeature(OSystem::Feature f) { - if (f == OSystem::kFeatureIconifyWindow) - return false; - - return SdlGraphicsManager::hasFeature(f); -} - -void GP2XSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { - if (f != OSystem::kFeatureIconifyWindow) - SdlGraphicsManager::setFeatureState(f, enable); -} - -void GP2XSdlGraphicsManager::drawMouse() { - if (!_mouseVisible || !_mouseSurface) { - _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0; - return; - } - - SDL_Rect zoomdst; - SDL_Rect dst; - int scale; - int hotX, hotY; - int tmpScreenWidth, tmpScreenHeight; - - // Temp vars to ensure we zoom to the LCD resolution or greater. - tmpScreenWidth = _videoMode.screenWidth; - tmpScreenHeight = _videoMode.screenHeight; - - if (_videoMode.screenHeight <= 240) { - tmpScreenHeight = 240; - } - - if (_videoMode.screenWidth <= 320) { - tmpScreenWidth = 320; - } - - dst.x = _mouseCurState.x; - dst.y = _mouseCurState.y; - - if (!_overlayVisible) { - scale = _videoMode.scaleFactor; - dst.w = _mouseCurState.vW; - dst.h = _mouseCurState.vH; - hotX = _mouseCurState.vHotX; - hotY = _mouseCurState.vHotY; - } else { - scale = 1; - dst.w = _mouseCurState.rW; - dst.h = _mouseCurState.rH; - hotX = _mouseCurState.rHotX; - hotY = _mouseCurState.rHotY; - } - - // The mouse is undrawn using virtual coordinates, i.e. they may be - // scaled and aspect-ratio corrected. - - _mouseBackup.x = dst.x - hotX; - _mouseBackup.y = dst.y - hotY; - _mouseBackup.w = dst.w; - _mouseBackup.h = dst.h; - - // We draw the pre-scaled cursor image, so now we need to adjust for - // scaling, shake position and aspect ratio correction manually. - - if (!_overlayVisible) { - dst.y += _currentShakePos; - } - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - dst.y = real2Aspect(dst.y); - - dst.x = scale * dst.x - _mouseCurState.rHotX; - dst.y = scale * dst.y - _mouseCurState.rHotY; - dst.w = _mouseCurState.rW; - dst.h = _mouseCurState.rH; - - // Hacking about with the zoom around mouse pointer stuff. - if (_adjustZoomOnMouse){ - - zoomdst.w = (tmpScreenWidth / 2); - zoomdst.h = (tmpScreenHeight / 2); - - // Create a zoomed rect centered on the mouse pointer. - // Will pan 1/4 of the screen. - - if (dst.x > ((tmpScreenWidth / 4) * 3)) { - zoomdst.x = (tmpScreenWidth / 2); - } else { - zoomdst.x = (dst.x - (tmpScreenWidth / 4)); - if (zoomdst.x < 0) { - zoomdst.x = 0; - } - } - - if (dst.y > ((tmpScreenHeight / 4) * 3)) { - zoomdst.y = (tmpScreenHeight / 2); - } else { - zoomdst.y = (dst.y - (tmpScreenHeight / 4)); - if (zoomdst.y < 0) { - zoomdst.y = 0; - } - } - SDL_GP2X_Display(&zoomdst); - } else { - - // Make sure we are looking at the whole screen otherwise. - - zoomdst.x = 0; - zoomdst.y = 0; - zoomdst.w = (tmpScreenWidth); - zoomdst.h = (tmpScreenHeight); - - SDL_GP2X_Display(&zoomdst); - }; - - // Note that SDL_BlitSurface() and addDirtyRect() will both perform any - // clipping necessary - - if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - - // The screen will be updated using real surface coordinates, i.e. - // they will not be scaled or aspect-ratio corrected. - - addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); -} - -void GP2XSdlGraphicsManager::toggleZoomOnMouse() { - _adjustZoomOnMouse = !_adjustZoomOnMouse; -} - -#endif diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h deleted file mode 100644 index 341b913acd..0000000000 --- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h +++ /dev/null @@ -1,46 +0,0 @@ -/* 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 BACKENDS_GRAPHICS_SDL_GP2X_H -#define BACKENDS_GRAPHICS_SDL_GP2X_H - -#include "backends/graphics/sdl/sdl-graphics.h" - -class GP2XSdlGraphicsManager : public SdlGraphicsManager { -public: - GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource); - - virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; - virtual int getDefaultGraphicsMode() const; - virtual void drawMouse(); - - virtual bool hasFeature(OSystem::Feature f); - virtual void setFeatureState(OSystem::Feature f, bool enable); - - // Toggles zoom adjust on mouse - void toggleZoomOnMouse(); - -protected: - bool _adjustZoomOnMouse; -}; - -#endif diff --git a/backends/platform/gp2x/build/clean.sh b/backends/platform/gp2x/build/clean.sh deleted file mode 100755 index 0979f6c7d6..0000000000 --- a/backends/platform/gp2x/build/clean.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -echo Quick script to make building all the time less painful. - -# Set the paths up here to support the build. - -export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin:$PATH -export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin:$PATH -export CXX=arm-open2x-linux-g++ -export CC=arm-open2x-linux-gcc -export CXXFLAGS=-march=armv4t -export LDFLAGS=-static - -cd ../../../.. - -echo Cleaning ScummVM for GP2X. -make clean diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h deleted file mode 100644 index 7efdd7164c..0000000000 --- a/backends/platform/gp2x/gp2x-common.h +++ /dev/null @@ -1,49 +0,0 @@ -/* 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 PLATFORM_SDL_GP2X_H -#define PLATFORM_SDL_GP2X_H - -#include "backends/base-backend.h" -#include "backends/platform/sdl/sdl.h" -#include "backends/platform/sdl/posix/posix.h" -#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" -#include "backends/events/gp2xsdl/gp2xsdl-events.h" - -#ifndef PATH_MAX - #define PATH_MAX 255 -#endif - -class OSystem_GP2X : public OSystem_POSIX { -public: - OSystem_GP2X() {} - - void initBackend(); - void quit(); - void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); - void initSDL(); - -protected: - -}; - -#endif diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp deleted file mode 100644 index 074c668b5f..0000000000 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* 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. - * - */ - -/* - * GP2X: Hardware Stuff. - * Thanks to Rlyeh, Snaff, Squidge, Hermes, PS2Reality and RobBrown - * for there help with us all getting to grips with this. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "gp2x-common.h" - -#include "gp2x-hw.h" -#include "gp2x-mem.h" - -// Linux includes to let us goof about with the system in a 'standard' way. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern "C" { -static unsigned long gp2x_dev[8]={0,0,0,0,0,0,0,0};//, gp2x_ticks_per_second; -} - -namespace GP2X_HW { - -enum { - VOLUME_NOCHG = 0, - VOLUME_DOWN = 1, - VOLUME_UP = 2, - VOLUME_CHANGE_RATE = 8, - VOLUME_MIN = 0, - VOLUME_INITIAL = 60, - VOLUME_MAX = 100 -}; - -int volumeLevel = VOLUME_INITIAL; - -/* system registers */ -static struct -{ - unsigned short SYSCLKENREG,SYSCSETREG,FPLLVSETREG,DUALINT920,DUALINT940,DUALCTRL940; -} -system_reg; - -static unsigned short dispclockdiv; - -static volatile unsigned short *MEM_REG; - -#define SYS_CLK_FREQ 7372800 - -void deviceInit() { - // Open devices - if (!gp2x_dev[0]) gp2x_dev[0] = open("/dev/mixer", O_RDWR); - if (!gp2x_dev[1]) gp2x_dev[1] = open("/dev/batt", O_RDONLY); - if (!gp2x_dev[2]) gp2x_dev[2] = open("/dev/mem", O_RDWR); -} - -void deviceDeinit() { - // Close devices - { - int i; - for (i=0;i<8;i++) - { - if (gp2x_dev[i]) - { - close(gp2x_dev[i]); - } - } - } - - MEM_REG[0x91c>>1] = system_reg.SYSCSETREG; - MEM_REG[0x910>>1] = system_reg.FPLLVSETREG; - MEM_REG[0x3B40>>1] = system_reg.DUALINT920; - MEM_REG[0x3B42>>1] = system_reg.DUALINT940; - MEM_REG[0x3B48>>1] = system_reg.DUALCTRL940; - MEM_REG[0x904>>1] = system_reg.SYSCLKENREG; - MEM_REG[0x924>>1] = dispclockdiv; - - unpatchMMU(); -} - -void mixerMoveVolume(int direction) { - if (volumeLevel <= 10) { - if (direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE/2; - if (direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE/2; - } else { - if(direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE; - if(direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE; - } - - if (volumeLevel < VOLUME_MIN) volumeLevel = VOLUME_MIN; - if (volumeLevel > VOLUME_MAX) volumeLevel = VOLUME_MAX; - - unsigned long soundDev = open("/dev/mixer", O_RDWR); - - if(soundDev) { - int vol = ((volumeLevel << 8) | volumeLevel); - ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol); - close(soundDev); - } -} - -void setCpuspeed(unsigned int mhz) -{ - set_FCLK(mhz); - set_DCLK_Div(0); - set_920_Div(0); -} - -int getBattLevel() { - int devbatt; - unsigned short currentval=0; - devbatt = open("/dev/batt", O_RDONLY); - read (devbatt, ¤tval, 2); - close (devbatt); - return (currentval); -} - -void set_display_clock_div(unsigned div) -{ - div=((div & 63) | 64)<<8; - MEM_REG[0x924>>1]=(MEM_REG[0x924>>1] & ~(255<<8)) | div; -} - - -void set_FCLK(unsigned MHZ) -{ - unsigned v; - unsigned mdiv,pdiv=3,scale=0; - MHZ*=1000000; - mdiv=(MHZ*pdiv)/SYS_CLK_FREQ; - mdiv=((mdiv-8)<<8) & 0xff00; - pdiv=((pdiv-2)<<2) & 0xfc; - scale&=3; - v=mdiv | pdiv | scale; - MEM_REG[0x910>>1]=v; -} - - -void set_920_Div(unsigned short div) -{ - unsigned short v; - v = MEM_REG[0x91c>>1] & (~0x3); - MEM_REG[0x91c>>1] = (div & 0x7) | v; -} - - -void set_DCLK_Div( unsigned short div ) -{ - unsigned short v; - v = (unsigned short)( MEM_REG[0x91c>>1] & (~(0x7 << 6)) ); - MEM_REG[0x91c>>1] = ((div & 0x7) << 6) | v; -} - - -void Disable_940(void) -{ - MEM_REG[0x3B42>>1]; - MEM_REG[0x3B42>>1]=0; - MEM_REG[0x3B46>>1]=0xffff; - MEM_REG[0x3B48>>1]|= (1 << 7); - MEM_REG[0x904>>1]&=0xfffe; -} - -void gp2x_video_wait_vsync(void) -{ - MEM_REG[0x2846>>1]=(MEM_REG[0x2846>>1] | 0x20) & ~2; - while (!(MEM_REG[0x2846>>1] & 2)); -} - -} /* namespace GP2X_HW */ - -namespace GPH { - -enum { - /* Touchscreen TapMode */ - TAPMODE_LEFT = 0, - TAPMODE_RIGHT = 1, - TAPMODE_HOVER = 2 -}; - -int tapmodeLevel = TAPMODE_LEFT; - -void ToggleTapMode() { - if (tapmodeLevel == TAPMODE_LEFT) { - tapmodeLevel = TAPMODE_RIGHT; - } else if (tapmodeLevel == TAPMODE_RIGHT) { - tapmodeLevel = TAPMODE_HOVER; - } else if (tapmodeLevel == TAPMODE_HOVER) { - tapmodeLevel = TAPMODE_LEFT; - } else { - tapmodeLevel = TAPMODE_LEFT; - } -} - - -} /* namespace GPH */ diff --git a/backends/platform/gp2x/gp2x-hw.h b/backends/platform/gp2x/gp2x-hw.h deleted file mode 100644 index 3c66400124..0000000000 --- a/backends/platform/gp2x/gp2x-hw.h +++ /dev/null @@ -1,62 +0,0 @@ -/* 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. - * - */ - -/* - * GP2X: Hardware Stuff. - * - */ - -#ifndef GP2X_HW_H -#define GP2X_HW_H - -namespace GP2X_HW { - -#define GP2X_MAXVOL 100 // Highest level permitted by GP2X's mixer -#define SYS_CLK_FREQ 7372800 // Clock Frequency - -extern int volumeLevel; - -extern void deviceInit(); -extern void deviceDeinit(); -extern void mixerMoveVolume(int); -extern void setCpuspeed(unsigned int cpuspeed); -extern int getBattLevel(); - -extern void save_system_regs(void); /* save some registers */ -extern void set_display_clock_div(unsigned div); -extern void set_FCLK(unsigned MHZ); /* adjust the clock frequency (in Mhz units) */ -extern void set_920_Div(unsigned short div); /* 0 to 7 divider (freq=FCLK/(1+div)) */ -extern void set_DCLK_Div(unsigned short div); /* 0 to 7 divider (freq=FCLK/(1+div)) */ -extern void Disable_940(void); /* 940t down */ -extern void gp2x_video_wait_vsync(void); - -} /* namespace GP2X_HW */ - -namespace GPH { - -extern int tapmodeLevel; - -extern void ToggleTapMode(); - -} /* namespace GPH */ - -#endif //GP2X_HW_H diff --git a/backends/platform/gp2x/gp2x-main.cpp b/backends/platform/gp2x/gp2x-main.cpp deleted file mode 100644 index f1ee5ed5f3..0000000000 --- a/backends/platform/gp2x/gp2x-main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* 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 "backends/platform/gp2x/gp2x-common.h" -#include "backends/plugins/sdl/sdl-provider.h" -#include "base/main.h" - -#if defined(GP2X) -int main(int argc, char *argv[]) { - - // Create our OSystem instance - g_system = new OSystem_GP2X(); - assert(g_system); - - // Pre initialize the backend - ((OSystem_GP2X *)g_system)->init(); - -#ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new SDLPluginProvider()); -#endif - - // Invoke the actual ScummVM main entry point: - int res = scummvm_main(argc, argv); - - // Free OSystem - delete (OSystem_GP2X *)g_system; - - return res; -} - -#endif diff --git a/backends/platform/gp2x/gp2x-mem.cpp b/backends/platform/gp2x/gp2x-mem.cpp deleted file mode 100644 index 8d22bf8130..0000000000 --- a/backends/platform/gp2x/gp2x-mem.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* 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. - * - */ - -/* - * GP2X: Memory tweaking stuff. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "backends/platform/gp2x/gp2x-mem.h" - -extern "C" { -static volatile unsigned short *gp2x_memregs; -} - -void SetClock (unsigned c) { - unsigned v; - unsigned mdiv,pdiv=3,scale=0; - - // Set ARM920t clock - c *= 1000000; - mdiv = (c*pdiv) / SYS_CLK_FREQ; - mdiv = ((mdiv-8)<<8) & 0xff00; - pdiv = ((pdiv-2)<<2) & 0xfc; - scale &= 3; - v = mdiv | pdiv | scale; - gp2x_memregs[0x910>>1] = v; -} - -void patchMMU (void) { - //volatile unsigned int *secbuf = (unsigned int *)malloc (204800); - - printf ("Reconfiguring cached memory regions...\n"); - - //hackpgtable(); - //printf ("Sucess...\n"); - - system("/sbin/rmmod mmuhack"); - system("/sbin/insmod -f mmuhack.o"); - - int mmufd = open("/dev/mmuhack", O_RDWR); - - if(mmufd < 0) { - printf ("Upper memory uncached (attempt failed, access to upper memory will be slower)...\n"); - } else { - printf ("Upper memory cached...\n"); - close(mmufd); - } -} - -void unpatchMMU (void) { - printf ("Restoreing cached memory regions...\n"); - system("/sbin/rmmod mmuhack"); -} diff --git a/backends/platform/gp2x/gp2x-mem.h b/backends/platform/gp2x/gp2x-mem.h deleted file mode 100644 index b2cd00a587..0000000000 --- a/backends/platform/gp2x/gp2x-mem.h +++ /dev/null @@ -1,51 +0,0 @@ -/* 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. - * - */ - -/* - * GP2X: Memory Stuff. - * - */ - -#ifndef GP2X_MEM_H -#define GP2X_MEM_H - -#ifdef __cplusplus -extern "C" { -#endif - -// Use Squidge's MMU patch rather then myown (his is neater). -// The effect if not that great but cacheing the upper RAM is no bad thing (tm) ;). - -//extern void InitRam (void); -//extern void CloseRam (void); -// Set ARM920t clock frequency -extern void SetClock (unsigned c); -extern void patchMMU (void); -extern void unpatchMMU (void); - -#define SYS_CLK_FREQ 7372800 - -#ifdef __cplusplus - } -#endif - -#endif //GP2X_MEM_H diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp deleted file mode 100644 index 0e28a6b738..0000000000 --- a/backends/platform/gp2x/gp2x.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* 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. - * - */ - -/* - * GP2X: Main backend. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "backends/platform/sdl/sdl-sys.h" -#include "backends/platform/gp2x/gp2x-common.h" -#include "backends/platform/gp2x/gp2x-hw.h" -#include "backends/platform/gp2x/gp2x-mem.h" - -#include "backends/saves/default/default-saves.h" - -#include "common/config-manager.h" -#include "common/debug.h" - -// Disable for normal serial logging. -#define DUMP_STDOUT - -#include -#include -#include -#include -#include -#include - -void OSystem_GP2X::initBackend() { - // Setup default save path to be workingdir/saves - char savePath[PATH_MAX + 1]; - char workDirName[PATH_MAX + 1]; - - if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Could not obtain current working directory"); - } else { - printf("Current working directory: %s\n", workDirName); - } - - strcpy(savePath, workDirName); - strcat(savePath, "/saves"); - printf("Current save directory: %s\n", savePath); - struct stat sb; - if (stat(savePath, &sb) == -1) - if (errno == ENOENT) // Create the dir if it does not exist - if (mkdir(savePath, 0755) != 0) - warning("mkdir for '%s' failed", savePath); - - ConfMan.registerDefault("savepath", savePath); - - #ifdef DUMP_STDOUT - // The GP2X has a serial console but most users do not use this so we - // output all our STDOUT and STDERR to files for debug purposes. - char STDOUT_FILE[PATH_MAX + 1]; - char STDERR_FILE[PATH_MAX + 1]; - - strcpy(STDOUT_FILE, workDirName); - strcpy(STDERR_FILE, workDirName); - strcat(STDOUT_FILE, "/scummvm.stdout.txt"); - strcat(STDERR_FILE, "/scummvm.stderr.txt"); - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* Redirect standard input and standard output */ - FILE *newfp = freopen(STDOUT_FILE, "w", stdout); - if (newfp == NULL) { - #if !defined(stdout) - stdout = fopen(STDOUT_FILE, "w"); - #else - newfp = fopen(STDOUT_FILE, "w"); - if (newfp) { - *stdout = *newfp; - } - #endif - } - - newfp = freopen(STDERR_FILE, "w", stderr); - if (newfp == NULL) { - #if !defined(stderr) - stderr = fopen(STDERR_FILE, "w"); - #else - newfp = fopen(STDERR_FILE, "w"); - if (newfp) { - *stderr = *newfp; - } - #endif - } - - setbuf(stderr, NULL); - printf("%s\n", "Debug: STDOUT and STDERR redirected to text files."); - #endif /* DUMP_STDOUT */ - - // Setup other defaults. - ConfMan.registerDefault("aspect_ratio", true); - - /* Up default volume values as we use a seperate system level volume anyway. */ - ConfMan.registerDefault("music_volume", 192); - ConfMan.registerDefault("sfx_volume", 192); - ConfMan.registerDefault("speech_volume", 192); - ConfMan.registerDefault("autosave_period", 3 * 60); // Trigger autosave every 3 minutes - On low batts 4 mins is about your warning time. - - ConfMan.setBool("FM_low_quality", true); - - /* Initialize any GP2X specific stuff we may want (Batt Status, scaler etc.) */ - GP2X_HW::deviceInit(); - - /* Set Default hardware mixer volume to a preset level (VOLUME_INITIAL). This is done to 'reset' volume level if set by other apps. */ - GP2X_HW::mixerMoveVolume(0); - - // Create the events manager - if (_eventSource == 0) - _eventSource = new GP2XSdlEventSource(); - - // Create the graphics manager - if (_graphicsManager == 0) - _graphicsManager = new GP2XSdlGraphicsManager(_eventSource); - - /* Pass to POSIX method to do the heavy lifting */ - OSystem_POSIX::initBackend(); -} - -void OSystem_GP2X::initSDL() { - // Check if SDL has not been initialized - if (!_initedSDL) { - uint32 sdlFlags = SDL_INIT_EVENTTHREAD; - if (ConfMan.hasKey("disable_sdl_parachute")) - sdlFlags |= SDL_INIT_NOPARACHUTE; - - // Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers) - if (SDL_Init(sdlFlags) == -1) - error("Could not initialize SDL: %s", SDL_GetError()); - - // Enable unicode support if possible - SDL_EnableUNICODE(1); - - _initedSDL = true; - } -} - -void OSystem_GP2X::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { - /* Setup default extra data paths for engine data files and plugins */ - char workDirName[PATH_MAX + 1]; - - if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Error: Could not obtain current working directory"); - } - - Common::FSNode workdirNode(workDirName); - if (workdirNode.exists() && workdirNode.isDirectory()) { - s.add("__GP2X_WORKDIR__", new Common::FSDirectory(workDirName), priority); - } - - char enginedataPath[PATH_MAX+1]; - - strcpy(enginedataPath, workDirName); - strcat(enginedataPath, "/engine-data"); - - Common::FSNode engineNode(enginedataPath); - if (engineNode.exists() && engineNode.isDirectory()) { - s.add("__GP2X_ENGDATA__", new Common::FSDirectory(enginedataPath), priority); - } - - char pluginsPath[PATH_MAX+1]; - - strcpy(pluginsPath, workDirName); - strcat(pluginsPath, "/plugins"); - - Common::FSNode pluginsNode(pluginsPath); - if (pluginsNode.exists() && pluginsNode.isDirectory()) { - s.add("__GP2X_PLUGINS__", new Common::FSDirectory(pluginsPath), priority); - } -} - -void OSystem_GP2X::quit() { - GP2X_HW::deviceDeinit(); - - #ifdef DUMP_STDOUT - printf("%s\n", "Debug: STDOUT and STDERR text files closed."); - fclose(stdout); - fclose(stderr); - #endif /* DUMP_STDOUT */ - - OSystem_POSIX::quit(); -} diff --git a/backends/platform/gp2x/module.mk b/backends/platform/gp2x/module.mk deleted file mode 100644 index 4846f162cb..0000000000 --- a/backends/platform/gp2x/module.mk +++ /dev/null @@ -1,15 +0,0 @@ -MODULE := backends/platform/gp2x - -MODULE_OBJS := \ - gp2x-hw.o \ - gp2x-main.o \ - gp2x-mem.o \ - gp2x.o - -# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. -MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) -OBJS := $(MODULE_OBJS) $(OBJS) -MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) - -# Hack to ensure the SDL backend is built so we can use OSystem_SDL. --include $(srcdir)/backends/platform/sdl/module.mk -- cgit v1.2.3 From 4fcd65d885f14b88d3ef3cbdf1bbedd5884c72a7 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 8 May 2011 22:31:17 +0100 Subject: OPENPANDORA: Start to cleanup the backend and move controls into remapkey. * Work in progress. --- backends/events/openpandora/op-events.cpp | 126 +++++++++++++------------- backends/events/openpandora/op-events.h | 9 +- backends/graphics/openpandora/op-graphics.cpp | 12 +-- backends/graphics/openpandora/op-graphics.h | 42 ++++----- backends/platform/openpandora/op-backend.cpp | 71 +++++++++++---- backends/platform/openpandora/op-main.cpp | 4 +- backends/platform/openpandora/op-sdl.h | 16 +++- 7 files changed, 160 insertions(+), 120 deletions(-) diff --git a/backends/events/openpandora/op-events.cpp b/backends/events/openpandora/op-events.cpp index 4b67cbf432..72bc56c95d 100644 --- a/backends/events/openpandora/op-events.cpp +++ b/backends/events/openpandora/op-events.cpp @@ -24,7 +24,6 @@ /* * OpenPandora: Device Specific Event Handling. - * */ #if defined(OPENPANDORA) @@ -35,6 +34,8 @@ #include "backends/platform/openpandora/op-options.h" #include "common/translation.h" +#include "common/util.h" +#include "common/events.h" /* Quick default button states for modifiers. */ int BUTTON_STATE_L = false; @@ -50,6 +51,68 @@ OPEventSource::OPEventSource() : _buttonStateL(false){ } +/* Custom handleMouseButtonDown/handleMouseButtonUp to deal with 'Tap Mode' for the touchscreen */ + +bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { + if (ev.button.button == SDL_BUTTON_LEFT){ + if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */ + event.type = Common::EVENT_RBUTTONDOWN; + else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */ + event.type = Common::EVENT_LBUTTONDOWN; + else if (OP::tapmodeLevel == TAPMODE_RIGHT) /* TAPMODE_RIGHT = Right Click Tap Mode */ + event.type = Common::EVENT_RBUTTONDOWN; + else if (OP::tapmodeLevel == TAPMODE_HOVER) /* TAPMODE_HOVER = Hover (No Click) Tap Mode */ + event.type = Common::EVENT_MOUSEMOVE; + else + event.type = Common::EVENT_LBUTTONDOWN; /* For normal mice etc. */ + } + else if (ev.button.button == SDL_BUTTON_RIGHT) + event.type = Common::EVENT_RBUTTONDOWN; +#if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN) + else if (ev.button.button == SDL_BUTTON_WHEELUP) + event.type = Common::EVENT_WHEELUP; + else if (ev.button.button == SDL_BUTTON_WHEELDOWN) + event.type = Common::EVENT_WHEELDOWN; +#endif +#if defined(SDL_BUTTON_MIDDLE) + else if (ev.button.button == SDL_BUTTON_MIDDLE) + event.type = Common::EVENT_MBUTTONDOWN; +#endif + else + return false; + + fillMouseEvent(event, ev.button.x, ev.button.y); + + return true; +} + +bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { + if (ev.button.button == SDL_BUTTON_LEFT){ + if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */ + event.type = Common::EVENT_RBUTTONUP; + else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */ + event.type = Common::EVENT_LBUTTONUP; + else if (OP::tapmodeLevel == TAPMODE_RIGHT) /* TAPMODE_RIGHT = Right Click Tap Mode */ + event.type = Common::EVENT_RBUTTONUP; + else if (OP::tapmodeLevel == TAPMODE_HOVER) /* TAPMODE_HOVER = Hover (No Click) Tap Mode */ + event.type = Common::EVENT_MOUSEMOVE; + else + event.type = Common::EVENT_LBUTTONUP; /* For normal mice etc. */ + } + else if (ev.button.button == SDL_BUTTON_RIGHT) + event.type = Common::EVENT_RBUTTONUP; +#if defined(SDL_BUTTON_MIDDLE) + else if (ev.button.button == SDL_BUTTON_MIDDLE) + event.type = Common::EVENT_MBUTTONUP; +#endif + else + return false; + + fillMouseEvent(event, ev.button.x, ev.button.y); + + return true; +} + /* On the OpenPandora by default the ABXY and L/R Trigger buttons are returned by SDL as (A): SDLK_HOME (B): SDLK_END (X): SDLK_PAGEDOWN (Y): SDLK_PAGEUP (L): SDLK_RSHIFT (R): SDLK_RCTRL */ @@ -124,65 +187,4 @@ bool OPEventSource::remapKey(SDL_Event &ev, Common::Event &event) { return false; } -/* Custom handleMouseButtonDown/handleMouseButtonUp to deal with 'Tap Mode' for the touchscreen */ - -bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { - if (ev.button.button == SDL_BUTTON_LEFT){ - if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */ - event.type = Common::EVENT_RBUTTONDOWN; - else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */ - event.type = Common::EVENT_LBUTTONDOWN; - else if (OP::tapmodeLevel == TAPMODE_RIGHT) /* TAPMODE_RIGHT = Right Click Tap Mode */ - event.type = Common::EVENT_RBUTTONDOWN; - else if (OP::tapmodeLevel == TAPMODE_HOVER) /* TAPMODE_HOVER = Hover (No Click) Tap Mode */ - event.type = Common::EVENT_MOUSEMOVE; - else - event.type = Common::EVENT_LBUTTONDOWN; /* For normal mice etc. */ - } - else if (ev.button.button == SDL_BUTTON_RIGHT) - event.type = Common::EVENT_RBUTTONDOWN; -#if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN) - else if (ev.button.button == SDL_BUTTON_WHEELUP) - event.type = Common::EVENT_WHEELUP; - else if (ev.button.button == SDL_BUTTON_WHEELDOWN) - event.type = Common::EVENT_WHEELDOWN; -#endif -#if defined(SDL_BUTTON_MIDDLE) - else if (ev.button.button == SDL_BUTTON_MIDDLE) - event.type = Common::EVENT_MBUTTONDOWN; -#endif - else - return false; - - fillMouseEvent(event, ev.button.x, ev.button.y); - - return true; -} - -bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { - if (ev.button.button == SDL_BUTTON_LEFT){ - if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */ - event.type = Common::EVENT_RBUTTONUP; - else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */ - event.type = Common::EVENT_LBUTTONUP; - else if (OP::tapmodeLevel == TAPMODE_RIGHT) /* TAPMODE_RIGHT = Right Click Tap Mode */ - event.type = Common::EVENT_RBUTTONUP; - else if (OP::tapmodeLevel == TAPMODE_HOVER) /* TAPMODE_HOVER = Hover (No Click) Tap Mode */ - event.type = Common::EVENT_MOUSEMOVE; - else - event.type = Common::EVENT_LBUTTONUP; /* For normal mice etc. */ - } - else if (ev.button.button == SDL_BUTTON_RIGHT) - event.type = Common::EVENT_RBUTTONUP; -#if defined(SDL_BUTTON_MIDDLE) - else if (ev.button.button == SDL_BUTTON_MIDDLE) - event.type = Common::EVENT_MBUTTONUP; -#endif - else - return false; - - fillMouseEvent(event, ev.button.x, ev.button.y); - - return true; -} #endif diff --git a/backends/events/openpandora/op-events.h b/backends/events/openpandora/op-events.h index 9aa637992a..25f79e68d7 100644 --- a/backends/events/openpandora/op-events.h +++ b/backends/events/openpandora/op-events.h @@ -28,17 +28,22 @@ /** * Events manager for the OpenPandora. */ + class OPEventSource : public SdlEventSource { public: OPEventSource(); protected: - /** Button state for L button modifier */ + + /** + * Button state for L button modifier + */ bool _buttonStateL; - bool remapKey(SDL_Event &ev, Common::Event &event); + bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); + bool remapKey(SDL_Event &ev, Common::Event &event); }; #endif /* BACKEND_EVENTS_OP_H */ diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp index 20ee5dfc36..c8617635a5 100644 --- a/backends/graphics/openpandora/op-graphics.cpp +++ b/backends/graphics/openpandora/op-graphics.cpp @@ -26,15 +26,13 @@ #include "backends/graphics/openpandora/op-graphics.h" #include "backends/events/openpandora/op-events.h" -#include "backends/platform/openpandora/op-sdl.h" -#include "common/mutex.h" -#include "common/util.h" - +//#include "backends/platform/openpandora/op-sdl.h" #include "graphics/scaler/aspect.h" -#include "graphics/surface.h" +#include "common/mutex.h" +#include "common/textconsole.h" -OPGraphicsManager::OPGraphicsManager(SdlEventSource *boss) - : SdlGraphicsManager(boss) { +OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource) + : SdlGraphicsManager(sdlEventSource) { } bool OPGraphicsManager::loadGFXMode() { diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h index b0d4298620..4bb89ca1e6 100644 --- a/backends/graphics/openpandora/op-graphics.h +++ b/backends/graphics/openpandora/op-graphics.h @@ -33,30 +33,30 @@ enum { class OPGraphicsManager : public SdlGraphicsManager { public: - OPGraphicsManager(SdlEventSource *boss); - - bool hasFeature(OSystem::Feature f); - void setFeatureState(OSystem::Feature f, bool enable); - bool getFeatureState(OSystem::Feature f); - int getDefaultGraphicsMode() const; - - void initSize(uint w, uint h); - const OSystem::GraphicsMode *getSupportedGraphicsModes() const; - bool setGraphicsMode(const char *name); - bool setGraphicsMode(int mode); - void setGraphicsModeIntern(); - void internUpdateScreen(); - void showOverlay(); - void hideOverlay(); + OPGraphicsManager(SdlEventSource *sdlEventSource); + +// bool hasFeature(OSystem::Feature f); +// void setFeatureState(OSystem::Feature f, bool enable); +// bool getFeatureState(OSystem::Feature f); +// int getDefaultGraphicsMode() const; + +// void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL); +// const OSystem::GraphicsMode *getSupportedGraphicsModes() const; +// bool setGraphicsMode(const char *name); +// bool setGraphicsMode(int mode); +// void setGraphicsModeIntern(); +// void internUpdateScreen(); +// void showOverlay(); +// void hideOverlay(); bool loadGFXMode(); - void drawMouse(); - void undrawMouse(); - virtual void warpMouse(int x, int y); +// void drawMouse(); +// void undrawMouse(); +// virtual void warpMouse(int x, int y); - SdlGraphicsManager::MousePos *getMouseCurState(); - SdlGraphicsManager::VideoState *getVideoMode(); +// SdlGraphicsManager::MousePos *getMouseCurState(); +// SdlGraphicsManager::VideoState *getVideoMode(); - virtual void adjustMouseEvent(const Common::Event &event); +// virtual void adjustMouseEvent(const Common::Event &event); }; #endif /* BACKENDS_GRAPHICS_OP_H */ diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp index 6bac4ea7d7..5231e9790d 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -20,13 +20,16 @@ * */ +#if defined(OPENPANDORA) + // Disable symbol overrides so that we can use system headers. #define FORBIDDEN_SYMBOL_ALLOW_ALL -#include "backends/platform/openpandora/op-sdl.h" -#include "base/main.h" +#include "backends/platform/sdl/sdl-sys.h" #include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h" +#include "backends/platform/openpandora/op-sdl.h" +#include "backends/plugins/posix/posix-provider.h" #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" @@ -35,6 +38,7 @@ #include "common/debug.h" #include "common/events.h" #include "common/file.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/mixer_intern.h" @@ -52,15 +56,29 @@ static SDL_Cursor *hiddenCursor; -static Uint32 timer_handler(Uint32 interval, void *param) { - ((DefaultTimerManager *)param)->handler(); - return interval; +OSystem_OP::OSystem_OP() + : + OSystem_POSIX() { } +//static Uint32 timer_handler(Uint32 interval, void *param) { +// ((DefaultTimerManager *)param)->handler(); +// return interval; +//} + void OSystem_OP::initBackend() { assert(!_inited); + // Create the events manager + if (_eventSource == 0) + _eventSource = new OPEventSource(); + + // Create the graphics manager + if (_graphicsManager == 0) { + _graphicsManager = new OPGraphicsManager(_eventSource); + } + // int joystick_num = ConfMan.getInt("joystick_num"); // uint32 sdlFlags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; // @@ -76,12 +94,12 @@ void OSystem_OP::initBackend() { // // Create the mixer manager - if (_mixer == 0) { - _mixerManager = new DoubleBufferSDLMixerManager(); +// if (_mixer == 0) { +// _mixerManager = new DoubleBufferSDLMixerManager(); // Setup and start mixer - _mixerManager->init(); - } +// _mixerManager->init(); +// } /* Setup default save path to be workingdir/saves */ @@ -103,7 +121,7 @@ void OSystem_OP::initBackend() { if (mkdir(savePath, 0755) != 0) warning("mkdir for '%s' failed!", savePath); -// _savefileManager = new DefaultSaveFileManager(savePath); + _savefileManager = new DefaultSaveFileManager(savePath); #ifdef DUMP_STDOUT // The OpenPandora has a serial console on the EXT connection but most users do not use this so we @@ -161,22 +179,32 @@ void OSystem_OP::initBackend() { /* Make sure SDL knows that we have a joystick we want to use. */ ConfMan.setInt("joystick_num", 0); - // Create the events manager - if (_eventSource == 0) - _eventSource = new OPEventSource(); - - // Create the graphics manager - if (_graphicsManager == 0) - _graphicsManager = new OPGraphicsManager(_eventSource); - // _graphicsMutex = createMutex(); - // Invoke parent implementation of this method + /* Pass to POSIX method to do the heavy lifting */ OSystem_POSIX::initBackend(); _inited = true; } + // enable joystick +// if (joystick_num > -1 && SDL_NumJoysticks() > 0) { +// printf("Using joystick: %s\n", SDL_JoystickName(0)); +// _joystick = SDL_JoystickOpen(joystick_num); +// } +// +// setupMixer(); + + // Note: We could implement a custom SDLTimerManager by using + // SDL_AddTimer. That might yield better timer resolution, but it would + // also change the semantics of a timer: Right now, ScummVM timers + // *never* run in parallel, due to the way they are implemented. If we + // switched to SDL_AddTimer, each timer might run in a separate thread. + // However, not all our code is prepared for that, so we can't just + // switch. Still, it's a potential future change to keep in mind. +// _timer = new DefaultTimerManager(); +// _timerID = SDL_AddTimer(10, &timer_handler, _timer); + void OSystem_OP::initSDL() { // Check if SDL has not been initialized if (!_initedSDL) { @@ -219,13 +247,14 @@ void OSystem_OP::initSDL() { // _videoMode.fullscreen = true; _initedSDL = true; + +// OSystem_POSIX::initSDL(); } } void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { /* Setup default extra data paths for engine data files and plugins */ - char workDirName[PATH_MAX+1]; if (getcwd(workDirName, PATH_MAX) == NULL) { @@ -256,3 +285,5 @@ void OSystem_OP::quit() { OSystem_POSIX::quit(); } + +#endif diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp index ab777fec8f..ae9d288e26 100644 --- a/backends/platform/openpandora/op-main.cpp +++ b/backends/platform/openpandora/op-main.cpp @@ -20,8 +20,6 @@ * */ - -#include "backends/platform/sdl/sdl-sys.h" #include "backends/platform/openpandora/op-sdl.h" #include "backends/plugins/posix/posix-provider.h" #include "base/main.h" @@ -35,7 +33,7 @@ int main(int argc, char *argv[]) { assert(g_system); // Pre initialize the backend - //((OSystem_OP *)g_system)->init(); + ((OSystem_OP *)g_system)->init(); #ifdef DYNAMIC_MODULES PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h index 9d92472b17..d493c3957c 100644 --- a/backends/platform/openpandora/op-sdl.h +++ b/backends/platform/openpandora/op-sdl.h @@ -26,12 +26,12 @@ #if defined(OPENPANDORA) #include "backends/base-backend.h" -#include "backends/platform/sdl/sdl.h" +#include "backends/platform/sdl/sdl-sys.h" #include "backends/platform/sdl/posix/posix.h" #include "backends/events/openpandora/op-events.h" #include "backends/graphics/openpandora/op-graphics.h" -#define __OPENPANDORA__ +//#define MIXER_DOUBLE_BUFFERING 1 #ifndef PATH_MAX #define PATH_MAX 255 @@ -39,16 +39,22 @@ class OSystem_OP : public OSystem_POSIX { public: - OSystem_OP() {} + OSystem_OP(); /* Platform Setup Stuff */ void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); void initBackend(); - void initSDL(); void quit(); protected: - + bool _inited; + bool _initedSDL; + + /** + * Initialse the SDL library + * with an OpenPandora workaround. + */ + virtual void initSDL(); }; #endif #endif //OP_SDL_H -- cgit v1.2.3 From 1c1786b16f34e4e998a5e1677427bdc75d318a93 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Thu, 26 May 2011 14:33:34 +0100 Subject: OPENPANDORA: Use the SDL plugin provider not the main POSIX one. --- backends/platform/openpandora/op-main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp index ae9d288e26..bb359e7204 100644 --- a/backends/platform/openpandora/op-main.cpp +++ b/backends/platform/openpandora/op-main.cpp @@ -21,7 +21,7 @@ */ #include "backends/platform/openpandora/op-sdl.h" -#include "backends/plugins/posix/posix-provider.h" +#include "backends/plugins/sdl/sdl-provider.h" #include "base/main.h" #if defined(OPENPANDORA) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { ((OSystem_OP *)g_system)->init(); #ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); + PluginManager::instance().addPluginProvider(new SDLPluginProvider()); #endif // Invoke the actual ScummVM main entry point: -- cgit v1.2.3 From 781132aabcfd38cb14d517d1d4b2598d4bd5f791 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Sat, 11 Jun 2011 01:07:46 +0200 Subject: WINCE: Some cleanup (public vs. private scopes), fix freelook --- backends/events/wincesdl/wincesdl-events.cpp | 11 +++--- backends/events/wincesdl/wincesdl-events.h | 4 --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 13 +++++-- backends/graphics/wincesdl/wincesdl-graphics.h | 19 +++++----- backends/platform/wince/CEActionsPocket.cpp | 45 +++++++++--------------- backends/platform/wince/CEActionsPocket.h | 2 ++ backends/platform/wince/CEActionsSmartphone.cpp | 35 +++++++----------- backends/platform/wince/CEActionsSmartphone.h | 2 ++ backends/platform/wince/wince-sdl.cpp | 2 +- 9 files changed, 59 insertions(+), 74 deletions(-) diff --git a/backends/events/wincesdl/wincesdl-events.cpp b/backends/events/wincesdl/wincesdl-events.cpp index f15a416b76..4fab47a58e 100644 --- a/backends/events/wincesdl/wincesdl-events.cpp +++ b/backends/events/wincesdl/wincesdl-events.cpp @@ -35,7 +35,7 @@ WINCESdlEventSource::WINCESdlEventSource() : _tapTime(0), _closeClick(false), _rbutton(false), - _freeLook(false), _graphicsMan(0) { + _graphicsMan(0) { } void WINCESdlEventSource::init(WINCESdlGraphicsManager *graphicsMan) { @@ -64,6 +64,7 @@ bool WINCESdlEventSource::pollEvent(Common::Event &event) { ev.type = SDL_NOEVENT; DWORD currentTime; bool keyEvent = false; + bool freeLookActive = _graphicsMan->getFreeLookState(); int deltaX, deltaY; memset(&event, 0, sizeof(Common::Event)); @@ -199,7 +200,7 @@ bool WINCESdlEventSource::pollEvent(Common::Event &event) { } } - if (_freeLook && !_closeClick) { + if (freeLookActive && !_closeClick) { _rbutton = false; _tapTime = 0; _tapX = event.mouse.x; @@ -241,7 +242,7 @@ bool WINCESdlEventSource::pollEvent(Common::Event &event) { fillMouseEvent(event, ev.button.x, ev.button.y); - if (_freeLook && !_closeClick) { + if (freeLookActive && !_closeClick) { _tapX = event.mouse.x; _tapY = event.mouse.y; event.type = Common::EVENT_MOUSEMOVE; @@ -322,8 +323,4 @@ int WINCESdlEventSource::mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool u return key; } -void WINCESdlEventSource::swap_freeLook() { - _freeLook = !_freeLook; -} - #endif /* _WIN32_WCE */ diff --git a/backends/events/wincesdl/wincesdl-events.h b/backends/events/wincesdl/wincesdl-events.h index 734cc899c0..deeee6196c 100644 --- a/backends/events/wincesdl/wincesdl-events.h +++ b/backends/events/wincesdl/wincesdl-events.h @@ -45,8 +45,6 @@ public: // Overloaded from SDL backend (mouse and new scaler handling) void fillMouseEvent(Common::Event &event, int x, int y); - void swap_freeLook(); - protected: private: @@ -61,8 +59,6 @@ private: bool _closeClick; // flag when taps are spatially close together bool _rbutton; // double tap -> right button simulation - bool _freeLook; // freeLook mode (do not send mouse button events) - }; #endif diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 80b04ca56d..8ba7b5821d 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -49,8 +49,8 @@ WINCESdlGraphicsManager::WINCESdlGraphicsManager(SdlEventSource *sdlEventSource) _panelVisible(true), _saveActiveToolbar(NAME_MAIN_PANEL), _panelStateForced(false), _canBeAspectScaled(false), _scalersChanged(false), _saveToolbarState(false), _mouseBackupOld(NULL), _mouseBackupDim(0), _mouseBackupToolbar(NULL), - _usesEmulatedMouse(false), _forceHideMouse(false), _hasfocus(true), - _zoomUp(false), _zoomDown(false) { + _usesEmulatedMouse(false), _forceHideMouse(false), _freeLook(false), + _hasfocus(true), _zoomUp(false), _zoomDown(false) { memset(&_mouseCurState, 0, sizeof(_mouseCurState)); if (_isSmartphone) { _mouseCurState.x = 20; @@ -444,7 +444,6 @@ void WINCESdlGraphicsManager::update_game_settings() { // Skip panel->add(NAME_ITEM_SKIP, new CEGUI::ItemAction(ITEM_SKIP, POCKET_ACTION_SKIP)); // sound -//__XXX__ panel->add(NAME_ITEM_SOUND, new CEGUI::ItemSwitch(ITEM_SOUND_OFF, ITEM_SOUND_ON, &_soundMaster)); panel->add(NAME_ITEM_SOUND, new CEGUI::ItemSwitch(ITEM_SOUND_OFF, ITEM_SOUND_ON, &OSystem_WINCE3::_soundMaster)); // bind keys @@ -1627,6 +1626,14 @@ void WINCESdlGraphicsManager::create_toolbar() { _toolbarHandler.setVisible(false); } +void WINCESdlGraphicsManager::swap_freeLook() { + _freeLook = !_freeLook; +} + +bool WINCESdlGraphicsManager::getFreeLookState() { + return _freeLook; +} + WINCESdlGraphicsManager::zoneDesc WINCESdlGraphicsManager::_zones[TOTAL_ZONES] = { { 0, 0, 320, 145 }, { 0, 145, 150, 55 }, diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index b3a8d66f51..2727bc0d27 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -56,6 +56,8 @@ public: void unloadGFXMode(); bool hotswapGFXMode(); + void update_game_settings(); + // Overloaded from SDL backend (toolbar handling) void drawMouse(); // Overloaded from SDL backend (new scaler handling) @@ -88,7 +90,8 @@ public: void swap_zoom_up(); void swap_zoom_down(); void swap_mouse_visibility(); - + void swap_freeLook(); + bool getFreeLookState(); //#ifdef WIN32_PLATFORM_WFSP void move_cursor_up(); @@ -96,7 +99,6 @@ public: void move_cursor_left(); void move_cursor_right(); - void retrieve_mouse_location(int &x, int &y); void switch_zone(); void add_right_click(bool pushed); @@ -106,6 +108,11 @@ public: void smartphone_rotate_display(); //#endif + bool hasPocketPCResolution(); + bool hasDesktopResolution(); + bool hasSquareQVGAResolution(); + bool hasWideResolution() const; + bool _panelInitialized; // only initialize the toolbar once bool _noDoubleTapRMB; // disable double tap -> rmb click @@ -122,11 +129,6 @@ public: bool _hasfocus; // scummvm has the top window - bool hasPocketPCResolution(); - bool hasDesktopResolution(); - bool hasSquareQVGAResolution(); - bool hasWideResolution() const; - MousePos _mouseCurState; bool _zoomUp; // zooming up mode @@ -158,8 +160,8 @@ protected: private: bool update_scalers(); - void update_game_settings(); void drawToolbarMouse(SDL_Surface *surf, bool draw); + void retrieve_mouse_location(int &x, int &y); void create_toolbar(); bool _panelVisible; // panel visibility @@ -186,6 +188,7 @@ private: uint16 _mouseBackupDim; bool _forceHideMouse; // force invisible mouse cursor + bool _freeLook; // freeLook mode (do not send mouse button events) // Smartphone specific variables void loadDeviceConfigurationElement(Common::String element, int &value, int defaultValue); diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index f2c461fcf9..a4786d330d 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -233,15 +233,15 @@ CEActionsPocket::~CEActionsPocket() { bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { static bool keydialogrunning = false, quitdialog = false; + _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager()); + if (!pushed) { switch (action) { case POCKET_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(false); + _graphicsMan->add_right_click(false); return true; case POCKET_ACTION_LEFTCLICK: - //_CESystem->add_left_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(false); + _graphicsMan->add_left_click(false); return true; case POCKET_ACTION_PAUSE: case POCKET_ACTION_SAVE: @@ -249,7 +249,6 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { case POCKET_ACTION_MULTI: EventsBuffer::simulateKey(&_key_action[action], false); return true; - } return false; } @@ -271,55 +270,43 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { EventsBuffer::simulateKey(&_key_action[action], true); return true; case POCKET_ACTION_KEYBOARD: - //_CESystem->swap_panel(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_panel(); + _graphicsMan->swap_panel(); return true; case POCKET_ACTION_HIDE: - //_CESystem->swap_panel_visibility(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_panel_visibility(); + _graphicsMan->swap_panel_visibility(); return true; case POCKET_ACTION_SOUND: _CESystem->swap_sound_master(); return true; case POCKET_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(true); + _graphicsMan->add_right_click(true); return true; case POCKET_ACTION_CURSOR: - //_CESystem->swap_mouse_visibility(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_mouse_visibility(); + _graphicsMan->swap_mouse_visibility(); return true; case POCKET_ACTION_FREELOOK: - //_CESystem->swap_freeLook(); - ((WINCESdlEventSource *)((OSystem_SDL *)g_system)->getEventManager())->swap_freeLook(); + _graphicsMan->swap_freeLook(); return true; case POCKET_ACTION_ZOOM_UP: - //_CESystem->swap_zoom_up(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_zoom_up(); + _graphicsMan->swap_zoom_up(); return true; case POCKET_ACTION_ZOOM_DOWN: - //_CESystem->swap_zoom_down(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_zoom_down(); + _graphicsMan->swap_zoom_down(); return true; case POCKET_ACTION_LEFTCLICK: - //_CESystem->add_left_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(true); + _graphicsMan->add_left_click(true); return true; case POCKET_ACTION_UP: - //_CESystem->move_cursor_up(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_up(); + _graphicsMan->move_cursor_up(); return true; case POCKET_ACTION_DOWN: - //_CESystem->move_cursor_down(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_down(); + _graphicsMan->move_cursor_down(); return true; case POCKET_ACTION_LEFT: - //_CESystem->move_cursor_left(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_left(); + _graphicsMan->move_cursor_left(); return true; case POCKET_ACTION_RIGHT: - //_CESystem->move_cursor_right(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_right(); + _graphicsMan->move_cursor_right(); return true; case POCKET_ACTION_QUIT: if (!quitdialog) { diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h index fd97c0b1df..e1f52b6b88 100644 --- a/backends/platform/wince/CEActionsPocket.h +++ b/backends/platform/wince/CEActionsPocket.h @@ -28,6 +28,7 @@ #include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" +#include "backends/graphics/wincesdl/wincesdl-graphics.h" #define POCKET_ACTION_VERSION 5 @@ -80,6 +81,7 @@ public: ~CEActionsPocket(); private: CEActionsPocket(const Common::String &gameid); + WINCESdlGraphicsManager *_graphicsMan; bool _right_click_needed; bool _hide_toolbar_needed; bool _zoom_needed; diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index fdd52cfc26..b12dadabb6 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -199,15 +199,15 @@ CEActionsSmartphone::~CEActionsSmartphone() { bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { static bool keydialogrunning = false, quitdialog = false; + _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager()); + if (!pushed) { switch (action) { case SMARTPHONE_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(false); + _graphicsMan->add_right_click(false); return true; case SMARTPHONE_ACTION_LEFTCLICK: - //_CESystem->add_left_click(false); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(false); + _graphicsMan->add_left_click(false); return true; case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: @@ -234,32 +234,25 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { EventsBuffer::simulateKey(&_key_action[action], true); return true; case SMARTPHONE_ACTION_RIGHTCLICK: - //_CESystem->add_right_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_right_click(true); + _graphicsMan->add_right_click(true); return true; case SMARTPHONE_ACTION_LEFTCLICK: - //_CESystem->add_left_click(true); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->add_left_click(true); + _graphicsMan->add_left_click(true); return true; case SMARTPHONE_ACTION_UP: - //_CESystem->move_cursor_up(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_up(); + _graphicsMan->move_cursor_up(); return true; case SMARTPHONE_ACTION_DOWN: - //_CESystem->move_cursor_down(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_down(); + _graphicsMan->move_cursor_down(); return true; case SMARTPHONE_ACTION_LEFT: - //_CESystem->move_cursor_left(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_left(); + _graphicsMan->move_cursor_left(); return true; case SMARTPHONE_ACTION_RIGHT: - //_CESystem->move_cursor_right(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->move_cursor_right(); + _graphicsMan->move_cursor_right(); return true; case SMARTPHONE_ACTION_ZONE: - //_CESystem->switch_zone(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->switch_zone(); + _graphicsMan->switch_zone(); return true; case SMARTPHONE_ACTION_BINDKEYS: if (!keydialogrunning) { @@ -271,12 +264,10 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { } return true; case SMARTPHONE_ACTION_KEYBOARD: - //_CESystem->swap_smartphone_keyboard(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->swap_smartphone_keyboard(); + _graphicsMan->swap_smartphone_keyboard(); return true; case SMARTPHONE_ACTION_ROTATE: - //_CESystem->smartphone_rotate_display(); - ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->smartphone_rotate_display(); + _graphicsMan->smartphone_rotate_display(); return true; case SMARTPHONE_ACTION_QUIT: if (!quitdialog) { diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h index 5535ce1350..3da46d3923 100644 --- a/backends/platform/wince/CEActionsSmartphone.h +++ b/backends/platform/wince/CEActionsSmartphone.h @@ -28,6 +28,7 @@ #include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" +#include "backends/graphics/wincesdl/wincesdl-graphics.h" #define SMARTPHONE_ACTION_VERSION 5 @@ -68,6 +69,7 @@ public: ~CEActionsSmartphone(); private: CEActionsSmartphone(); + WINCESdlGraphicsManager *_graphicsMan; bool _right_click_needed; OSystem_WINCE3 *_CESystem; }; diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index d5f5c203d2..3ab9dc8aa4 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -466,7 +466,7 @@ void OSystem_WINCE3::swap_sound_master() { void OSystem_WINCE3::engineInit() { check_mappings(); // called here to initialize virtual keys handling - //update_game_settings(); + ((WINCESdlGraphicsManager *)_graphicsManager)->update_game_settings(); // finalize mixer init _mixerManager->init(); } -- cgit v1.2.3 From 50176e7c5fca547c3a1e3043d04091484b979f31 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 11 Jun 2011 22:40:56 +0200 Subject: SCI: Add saved_bits/show_saved_bits console commands --- engines/sci/console.cpp | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ engines/sci/console.h | 2 + 2 files changed, 163 insertions(+) diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index af945247ba..55e820ace1 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -131,6 +131,8 @@ Console::Console(SciEngine *engine) : GUI::Debugger(), DCmd_Register("al", WRAP_METHOD(Console, cmdAnimateList)); // alias DCmd_Register("window_list", WRAP_METHOD(Console, cmdWindowList)); DCmd_Register("wl", WRAP_METHOD(Console, cmdWindowList)); // alias + DCmd_Register("saved_bits", WRAP_METHOD(Console, cmdSavedBits)); + DCmd_Register("show_saved_bits", WRAP_METHOD(Console, cmdShowSavedBits)); // Segments DCmd_Register("segment_table", WRAP_METHOD(Console, cmdPrintSegmentTable)); DCmd_Register("segtable", WRAP_METHOD(Console, cmdPrintSegmentTable)); // alias @@ -364,6 +366,8 @@ bool Console::cmdHelp(int argc, const char **argv) { DebugPrintf(" undither - Enable/disable undithering\n"); DebugPrintf(" play_video - Plays a SEQ, AVI, VMD, RBT or DUK video\n"); DebugPrintf(" animate_object_list / al - Shows the current list of objects in kAnimate's draw list\n"); + DebugPrintf(" saved_bits - List saved bits on the hunk\n"); + DebugPrintf(" show_saved_bits - Display saved bits\n"); DebugPrintf("\n"); DebugPrintf("Segments:\n"); DebugPrintf(" segment_table / segtable - Lists all segments\n"); @@ -1600,6 +1604,163 @@ bool Console::cmdWindowList(int argc, const char **argv) { return true; } + +bool Console::cmdSavedBits(int argc, const char **argv) { + SegManager *segman = _engine->_gamestate->_segMan; + SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); + HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + if (!hunks) { + DebugPrintf("No hunk segment found.\n"); + return true; + } + + Common::Array entries = hunks->listAllDeallocatable(id); + + for (uint i = 0; i < entries.size(); ++i) { + uint16 offset = entries[i].offset; + const Hunk& h = hunks->_table[offset]; + if (strcmp(h.type, "SaveBits()") == 0) { + byte* memoryPtr = (byte*)h.mem; + + if (memoryPtr) { + DebugPrintf("%04x:%04x:", PRINT_REG(entries[i])); + + Common::Rect rect; + byte mask; + assert(h.size >= sizeof(rect) + sizeof(mask)); + + memcpy((void *)&rect, memoryPtr, sizeof(rect)); + memcpy((void *)&mask, memoryPtr + sizeof(rect), sizeof(mask)); + + DebugPrintf(" %d,%d - %d,%d", rect.top, rect.left, + rect.bottom, rect.right); + if (mask & GFX_SCREEN_MASK_VISUAL) + DebugPrintf(" visual"); + if (mask & GFX_SCREEN_MASK_PRIORITY) + DebugPrintf(" priority"); + if (mask & GFX_SCREEN_MASK_CONTROL) + DebugPrintf(" control"); + if (mask & GFX_SCREEN_MASK_DISPLAY) + DebugPrintf(" display"); + DebugPrintf("\n"); + } + } + } + + + return true; +} + +bool Console::cmdShowSavedBits(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Display saved bits.\n"); + DebugPrintf("Usage: %s
\n", argv[0]); + DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); + return true; + } + + reg_t memoryHandle = NULL_REG; + + if (parse_reg_t(_engine->_gamestate, argv[1], &memoryHandle, false)) { + DebugPrintf("Invalid address passed.\n"); + DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); + return true; + } + + if (memoryHandle.isNull()) { + DebugPrintf("Invalid address.\n"); + return true; + } + + SegManager *segman = _engine->_gamestate->_segMan; + SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); + HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + if (!hunks) { + DebugPrintf("No hunk segment found.\n"); + return true; + } + + if (memoryHandle.segment != id || !hunks->isValidOffset(memoryHandle.offset)) { + DebugPrintf("Invalid address.\n"); + return true; + } + + const Hunk& h = hunks->_table[memoryHandle.offset]; + + if (strcmp(h.type, "SaveBits()") != 0) { + DebugPrintf("Invalid address.\n"); + return true; + } + + byte *memoryPtr = segman->getHunkPointer(memoryHandle); + + if (!memoryPtr) { + DebugPrintf("Invalid or freed bits.\n"); + return true; + } + + // Now we _finally_ know these are valid saved bits + + Common::Rect rect; + byte mask; + assert(h.size >= sizeof(rect) + sizeof(mask)); + + memcpy((void *)&rect, memoryPtr, sizeof(rect)); + memcpy((void *)&mask, memoryPtr + sizeof(rect), sizeof(mask)); + + Common::Point tl(rect.left, rect.top); + Common::Point tr(rect.right-1, rect.top); + Common::Point bl(rect.left, rect.bottom-1); + Common::Point br(rect.right-1, rect.bottom-1); + + DebugPrintf(" %d,%d - %d,%d", rect.top, rect.left, + rect.bottom, rect.right); + if (mask & GFX_SCREEN_MASK_VISUAL) + DebugPrintf(" visual"); + if (mask & GFX_SCREEN_MASK_PRIORITY) + DebugPrintf(" priority"); + if (mask & GFX_SCREEN_MASK_CONTROL) + DebugPrintf(" control"); + if (mask & GFX_SCREEN_MASK_DISPLAY) + DebugPrintf(" display"); + DebugPrintf("\n"); + + if (!_engine->_gfxPaint16 || !_engine->_gfxScreen) + return true; + + // We backup all planes, and then flash the saved bits + // FIXME: This probably won't work well with hi-res games + + byte bakMask = GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY | GFX_SCREEN_MASK_CONTROL; + int bakSize = _engine->_gfxScreen->bitsGetDataSize(rect, bakMask); + reg_t bakScreen = segman->allocateHunkEntry("show_saved_bits backup", bakSize); + byte* bakMemory = segman->getHunkPointer(bakScreen); + assert(bakMemory); + _engine->_gfxScreen->bitsSave(rect, bakMask, bakMemory); + + const int paintCount = 3; + for (int i = 0; i < paintCount; ++i) { + _engine->_gfxScreen->bitsRestore(memoryPtr); + _engine->_gfxScreen->drawLine(tl, tr, 0, 255, 255); + _engine->_gfxScreen->drawLine(tr, br, 0, 255, 255); + _engine->_gfxScreen->drawLine(br, bl, 0, 255, 255); + _engine->_gfxScreen->drawLine(bl, tl, 0, 255, 255); + _engine->_gfxScreen->copyRectToScreen(rect); + g_system->updateScreen(); + g_sci->sleep(500); + _engine->_gfxScreen->bitsRestore(bakMemory); + _engine->_gfxScreen->copyRectToScreen(rect); + g_system->updateScreen(); + if (i < paintCount - 1) + g_sci->sleep(500); + } + + _engine->_gfxPaint16->bitsFree(bakScreen); + + return true; +} + + bool Console::cmdParseGrammar(int argc, const char **argv) { DebugPrintf("Parse grammar, in strict GNF:\n"); diff --git a/engines/sci/console.h b/engines/sci/console.h index 1e2ebe4ba2..d943923ba1 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -94,6 +94,8 @@ private: bool cmdPlayVideo(int argc, const char **argv); bool cmdAnimateList(int argc, const char **argv); bool cmdWindowList(int argc, const char **argv); + bool cmdSavedBits(int argc, const char **argv); + bool cmdShowSavedBits(int argc, const char **argv); // Segments bool cmdPrintSegmentTable(int argc, const char **argv); bool cmdSegmentInfo(int argc, const char **argv); -- cgit v1.2.3 From 4296ac6d15e163b0c6b4fff5665e7add444ba310 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 12 Jun 2011 01:11:42 +0200 Subject: SCI: Fix sign in disasm of relative jumps --- engines/sci/engine/scriptdebug.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 16098ab275..957930784b 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -174,13 +174,15 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode break; case Script_SRelative: - if (opsize) - param_value = scr[retval.offset++]; + if (opsize) { + int8 offset = (int8)scr[retval.offset++]; + debugN(" %02x [%04x]", 0xff & offset, 0xffff & (retval.offset + offset)); + } else { - param_value = READ_SCI11ENDIAN_UINT16(&scr[retval.offset]); + int16 offset = (int16)READ_SCI11ENDIAN_UINT16(&scr[retval.offset]); retval.offset += 2; + debugN(" %04x [%04x]", 0xffff & offset, 0xffff & (retval.offset + offset)); } - debugN(opsize ? " %02x [%04x]" : " %04x [%04x]", param_value, (0xffff) & (retval.offset + param_value)); break; case Script_End: -- cgit v1.2.3 From 4ec20f857fd9d7d741233678c9574aa3f9e28eba Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 12 Jun 2011 02:02:06 +0200 Subject: SCI: Add FIXME for bug #3051136 --- engines/sci/graphics/transitions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index 1256db8969..dba263c9bf 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -193,6 +193,8 @@ void GfxTransitions::doit(Common::Rect picRect) { // TODO: this is a workaround for lsl6 not showing menubar when playing // There is some new code in the sierra sci in ShowPic that seems to do // something similar to this + // FIXME: Having this code here also causes bug #3051136 in + // the SCI1.1 version of Mother Goose. _screen->copyToScreen(); g_system->updateScreen(); } -- cgit v1.2.3 From 7ab6dfc00e9392e2a1560de05f1d717ec0c79a72 Mon Sep 17 00:00:00 2001 From: md5 Date: Sun, 12 Jun 2011 15:07:42 +0300 Subject: SCI: Fixed the show_saved_bits console command This is achieved by hiding the graphical debugger overlay temporarily in order to show the command's results --- engines/sci/console.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 55e820ace1..32cb5459f6 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1738,6 +1738,12 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { assert(bakMemory); _engine->_gfxScreen->bitsSave(rect, bakMask, bakMemory); +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER + // If a graphical debugger overlay is used, hide it here, so that the + // results can be drawn. + g_system->hideOverlay(); +#endif + const int paintCount = 3; for (int i = 0; i < paintCount; ++i) { _engine->_gfxScreen->bitsRestore(memoryPtr); @@ -1757,6 +1763,11 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { _engine->_gfxPaint16->bitsFree(bakScreen); +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER + // Show the graphical debugger overlay + g_system->showOverlay(); +#endif + return true; } -- cgit v1.2.3 From c5610182a69c60749014fa4175a3365e4b44426c Mon Sep 17 00:00:00 2001 From: md5 Date: Sun, 12 Jun 2011 15:36:08 +0300 Subject: SCI: Some fixes for the find_callk command --- engines/sci/console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 32cb5459f6..b1b5f81995 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -2954,7 +2954,7 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) { uint16 argc2 = opparams[1]; if (kFuncNum == kernelFuncNum) { - DebugPrintf("Called from script %d, object %s, method %s(%d) with %d parameters\n", + DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n", itr->getNumber(), objName, _engine->getKernel()->getSelectorName(obj->getFuncSelector(i)).c_str(), i, argc2); } @@ -2971,7 +2971,7 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) { // Check for end of function/script if (offset >= script->getBufSize()) break; - if (opcode == op_ret)// && offset >= maxJmpOffset) + if (opcode == op_ret && offset >= maxJmpOffset) break; } // while (true) } // for (uint16 i = 0; i < obj->getMethodCount(); i++) -- cgit v1.2.3 From 44f604068e39a2da55ce595191587625d8920538 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 12 Jun 2011 13:46:43 +0100 Subject: I18N: Update Czech translation from patch #3313204 --- po/cs_CZ.po | 94 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 44 insertions(+), 50 deletions(-) diff --git a/po/cs_CZ.po b/po/cs_CZ.po index ee3d872de3..6184e3686b 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-06 23:15+0100\n" -"PO-Revision-Date: 2011-04-23 10:55+0100\n" +"PO-Revision-Date: 2011-06-07 16:23+0100\n" "Last-Translator: Zbynìk Schwarz \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -509,7 +509,7 @@ msgstr "Hled #: gui/massadd.cpp:246 #, c-format msgid "Discovered %d new games, ignored %d previously added games." -msgstr "" +msgstr "Objeveno %d nových her, ignorováno %d døíve pøidaných her." #: gui/massadd.cpp:250 #, c-format @@ -517,9 +517,9 @@ msgid "Scanned %d directories ..." msgstr "Prohledáno %d adresáøù..." #: gui/massadd.cpp:253 -#, fuzzy, c-format +#, c-format msgid "Discovered %d new games, ignored %d previously added games ..." -msgstr "Objeveno %d nových her..." +msgstr "Objeveno %d nových her, ignorováno %d døíve pøidaných her ..." #: gui/options.cpp:72 msgid "Never" @@ -569,19 +569,19 @@ msgstr " #: gui/options.cpp:372 msgid "Failed to apply some of the graphic options changes:" -msgstr "" +msgstr "Nelze pou¾ít nìkteré zmìny mo¾ností grafiky:" #: gui/options.cpp:384 msgid "the video mode could not be changed." -msgstr "" +msgstr "re¾im obrazu nemohl být zmìnìn." #: gui/options.cpp:390 msgid "the fullscreen setting could not be changed" -msgstr "" +msgstr "nastavení celé obrazovky nemohlo být zmìnìno" #: gui/options.cpp:396 msgid "the aspect ratio setting could not be changed" -msgstr "" +msgstr "nastavení pomìru stran nemohlo být zmìnìno" #: gui/options.cpp:705 msgid "Graphics mode:" @@ -885,9 +885,8 @@ msgid "Language of ScummVM GUI" msgstr "Jazyk GUI ScummVM" #: gui/options.cpp:1295 -#, fuzzy msgid "You have to restart ScummVM before your changes will take effect." -msgstr "Pro pou¾ití tìchto nastavení musíte restartovat ScummVM" +msgstr "Pro pou¾ití tìchto nastavení musíte restartovat ScummVM." #: gui/options.cpp:1308 msgid "Select directory for savegames" @@ -1095,15 +1094,15 @@ msgstr "Hercules Jantarov #: engines/advancedDetector.cpp:368 #, c-format msgid "The game in '%s' seems to be unknown." -msgstr "" +msgstr "Hra v '%s' se zdá být neznámá." #: engines/advancedDetector.cpp:369 msgid "Please, report the following data to the ScummVM team along with name" -msgstr "" +msgstr "Prosím nahlaste následující data týmu ScummVM spolu se jménem" #: engines/advancedDetector.cpp:371 msgid "of the game you tried to add and its version/language/etc.:" -msgstr "" +msgstr "hry, kterou jste se pokusili pøidat a její verzi/jazyk/atd.:" #: engines/advancedDetector.cpp:632 #, c-format @@ -1111,14 +1110,16 @@ msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" +"Bylo zji¹tìno, ¾e Va¹e verze hry pou¾ívá jméno souboru shodující se s " +"variantou %s." #: engines/advancedDetector.cpp:635 msgid "If this is an original and unmodified version, please report any" -msgstr "" +msgstr "Pokud je toto pùvodní a nezmìnìná verze, ohlaste prosím jakékoli" #: engines/advancedDetector.cpp:637 msgid "information previously printed by ScummVM to the team." -msgstr "" +msgstr "pøede¹le vypsané informace od ScummVM zpátky týmu." #: engines/dialogs.cpp:84 msgid "~R~esume" @@ -1333,9 +1334,8 @@ msgid " since they may cause crashes" msgstr "jeliko¾ mù¾ou zpùsobit pád" #: engines/scumm/help.cpp:110 -#, fuzzy msgid " or incorrect game behavior." -msgstr "nebo nesprávné chování hry" +msgstr " nebo nesprávné chování hry." #: engines/scumm/help.cpp:114 msgid "Spinning drafts on the keyboard:" @@ -1743,7 +1743,7 @@ msgid "" "\n" "%s" msgstr "" -"Stav hry úspe¹nì ulo¾en do:\n" +"Stav hry úspì¹nì ulo¾en do:\n" "\n" "%s" @@ -1767,11 +1767,11 @@ msgstr "~P~ #: engines/mohawk/dialogs.cpp:92 msgid "~D~rop Page" -msgstr "" +msgstr "~Z~ahodit Stránku" #: engines/mohawk/dialogs.cpp:96 msgid "~S~how Map" -msgstr "" +msgstr "~Z~obrazit Mapu" #: engines/mohawk/dialogs.cpp:150 msgid "~W~ater Effect Enabled" @@ -1799,6 +1799,8 @@ msgid "" "Failed to detect the selected audio device '%s'. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"Nelze zjistit zvolené zvukové zaøízení '%s'. Podívejte se na záznam pro více " +"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/mididrv.cpp:246 #, c-format @@ -1806,6 +1808,8 @@ msgid "" "Failed to detect the preferred device '%s'. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"Nelze zjistit upøednostòované zaøízení '%s'. Podívejte se na záznam pro více " +"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/null.h:43 msgid "No music" @@ -1828,9 +1832,8 @@ msgid "C64 Audio Emulator" msgstr "Emulátor zvuku C64" #: audio/softsynth/mt32.cpp:329 -#, fuzzy msgid "Initializing MT-32 Emulator" -msgstr "Spou¹tím MT-32 Emulátor" +msgstr "Zavádím MT-32 Emulátor" #: audio/softsynth/mt32.cpp:543 msgid "MT-32 Emulator" @@ -1955,26 +1958,22 @@ msgstr "Norm #: backends/graphics/sdl/sdl-graphics.cpp:2137 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 -#, fuzzy msgid "Enabled aspect ratio correction" -msgstr "Povolit korekci pomìru stran" +msgstr "Povolena korekce pomìru stran" #: backends/graphics/sdl/sdl-graphics.cpp:2143 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 -#, fuzzy msgid "Disabled aspect ratio correction" -msgstr "Povolit korekci pomìru stran" +msgstr "Zakázána korekce pomìru stran" #: backends/graphics/sdl/sdl-graphics.cpp:2198 -#, fuzzy msgid "Active graphics filter:" -msgstr "Pøepínat mezi grafickými filtry" +msgstr "Aktivní grafický filtr:" #: backends/graphics/sdl/sdl-graphics.cpp:2254 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 -#, fuzzy msgid "Windowed mode" -msgstr "Re¾im vykreslení:" +msgstr "Re¾im do okna" #: backends/graphics/opengl/opengl-graphics.cpp:139 msgid "OpenGL Normal" @@ -1989,21 +1988,20 @@ msgid "OpenGL Original" msgstr "OpenGL Pùvodní" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 -#, fuzzy msgid "Current display mode" -msgstr "Souèasný re¾im obrazu:" +msgstr "Souèasný re¾im obrazu" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 msgid "Current scale" -msgstr "" +msgstr "Souèasná velikost" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 msgid "Active filter mode: Linear" -msgstr "" +msgstr "Aktivní re¾im filtru: Lineární" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 msgid "Active filter mode: Nearest" -msgstr "" +msgstr "Aktivní re¾im filtru: Nejbli¾¹í" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2196,19 +2194,17 @@ msgid "Network down" msgstr "Sí» je nedostupná" #: backends/platform/wii/options.cpp:178 -#, fuzzy msgid "Initializing network" -msgstr "Spou¹tím sí»" +msgstr "Zavádím sí»" #: backends/platform/wii/options.cpp:182 -#, fuzzy msgid "Timeout while initializing network" -msgstr "Pøi spou¹tìní sítì vypr¹el limit" +msgstr "Pøi zavádìní sítì vypr¹el limit" #: backends/platform/wii/options.cpp:186 -#, fuzzy, c-format +#, c-format msgid "Network not initialized (%d)" -msgstr "Sí» není zapnuta (%d)" +msgstr "Sí» není zavedena (%d)" #: backends/platform/wince/CEActionsPocket.cpp:46 msgid "Hide Toolbar" @@ -2334,7 +2330,7 @@ msgstr "" #: backends/events/gph/gph-events.cpp:410 #: backends/events/openpandora/op-events.cpp:78 msgid "Touchscreen 'Tap Mode' - Left Click" -msgstr "" +msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Levé Kliknutí" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 #: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 @@ -2342,7 +2338,7 @@ msgstr "" #: backends/events/gph/gph-events.cpp:412 #: backends/events/openpandora/op-events.cpp:80 msgid "Touchscreen 'Tap Mode' - Right Click" -msgstr "" +msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Pravé Kliknutí" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 #: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 @@ -2350,29 +2346,27 @@ msgstr "" #: backends/events/gph/gph-events.cpp:414 #: backends/events/openpandora/op-events.cpp:82 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" -msgstr "" +msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Najetí (Bez Kliknutí)" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 #: backends/events/gph/gph-events.cpp:391 -#, fuzzy msgid "Maximum Volume" -msgstr "Hlasitost" +msgstr "Maximální Hlasitost" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 #: backends/events/gph/gph-events.cpp:393 msgid "Increasing Volume" -msgstr "" +msgstr "Zvy¹uji Hlasitost" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 #: backends/events/gph/gph-events.cpp:399 -#, fuzzy msgid "Minimal Volume" -msgstr "Hlasitost" +msgstr "Minimální Hlasitost" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 #: backends/events/gph/gph-events.cpp:401 msgid "Decreasing Volume" -msgstr "" +msgstr "Sni¾uji Hlasitost" #~ msgid "Discovered %d new games." #~ msgstr "Objeveno %d nových her." -- cgit v1.2.3 From 9200289bdea2fc33d68e21b0d502a175dad61447 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 12 Jun 2011 13:47:58 +0100 Subject: I18N: Update Hungarian translation from patch #3315326 --- po/hu_HU.po | 90 ++++++++++++++++++++++++++++--------------------------------- 1 file changed, 41 insertions(+), 49 deletions(-) diff --git a/po/hu_HU.po b/po/hu_HU.po index b55e0b12e9..d3ee99d0fc 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-06 23:15+0100\n" -"PO-Revision-Date: 2011-04-23 15:38+0100\n" +"PO-Revision-Date: 2011-06-12 07:17+0100\n" "Last-Translator: Gruby \n" "Language-Team: Hungarian\n" "MIME-Version: 1.0\n" @@ -510,7 +510,7 @@ msgstr "Vizsg #: gui/massadd.cpp:246 #, c-format msgid "Discovered %d new games, ignored %d previously added games." -msgstr "" +msgstr "%d új játékot találtam, %d elõzõleg hozzáadott játék kihagyva..." #: gui/massadd.cpp:250 #, c-format @@ -518,9 +518,9 @@ msgid "Scanned %d directories ..." msgstr "%d Mappa átvizsgálva..." #: gui/massadd.cpp:253 -#, fuzzy, c-format +#, c-format msgid "Discovered %d new games, ignored %d previously added games ..." -msgstr "%d Új játékot találtam." +msgstr "%d új játékot találtam, %d elõzõleg hozzáadott játék kihagyva..." #: gui/options.cpp:72 msgid "Never" @@ -570,19 +570,19 @@ msgstr "Nincs" #: gui/options.cpp:372 msgid "Failed to apply some of the graphic options changes:" -msgstr "" +msgstr "Néhány grafikus opció változtatása sikertelen:" #: gui/options.cpp:384 msgid "the video mode could not be changed." -msgstr "" +msgstr "a videómód nem változott." #: gui/options.cpp:390 msgid "the fullscreen setting could not be changed" -msgstr "" +msgstr "a teljesképernyõs beállítás nem változott" #: gui/options.cpp:396 msgid "the aspect ratio setting could not be changed" -msgstr "" +msgstr "a képméretarány beállítások nem változtak" #: gui/options.cpp:705 msgid "Graphics mode:" @@ -884,7 +884,6 @@ msgid "Language of ScummVM GUI" msgstr "A ScummVM GUI nyelve" #: gui/options.cpp:1295 -#, fuzzy msgid "You have to restart ScummVM before your changes will take effect." msgstr "Indítsd újra a ScummVM-et a változások érvényesítéséhez." @@ -1094,30 +1093,30 @@ msgstr "Hercules S #: engines/advancedDetector.cpp:368 #, c-format msgid "The game in '%s' seems to be unknown." -msgstr "" +msgstr "A '%s' játék ismeretlennek tûnik." #: engines/advancedDetector.cpp:369 msgid "Please, report the following data to the ScummVM team along with name" -msgstr "" +msgstr "Kérlek jelezd a ScummVM csapatnak a következõ adatokat, együtt a játék" #: engines/advancedDetector.cpp:371 msgid "of the game you tried to add and its version/language/etc.:" -msgstr "" +msgstr "címével és megbízható adataival játékverzió/nyelv(ek)/stb.:" #: engines/advancedDetector.cpp:632 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." -msgstr "" +msgstr "A felismert játékverziód a használt fájlnévvel a %s egy változata." #: engines/advancedDetector.cpp:635 msgid "If this is an original and unmodified version, please report any" -msgstr "" +msgstr "Ha ez egy eredeti nem változtatott verzió, kérlek jelezd minden" #: engines/advancedDetector.cpp:637 msgid "information previously printed by ScummVM to the team." -msgstr "" +msgstr "elõzõleg kiírt információt a ScummVM csapatnak." #: engines/dialogs.cpp:84 msgid "~R~esume" @@ -1332,9 +1331,8 @@ msgid " since they may cause crashes" msgstr " mert rendszerösszeomlást vagy" #: engines/scumm/help.cpp:110 -#, fuzzy msgid " or incorrect game behavior." -msgstr " hibás mûködést eredményezhet." +msgstr " vagy hibás játékmûködést okoz." #: engines/scumm/help.cpp:114 msgid "Spinning drafts on the keyboard:" @@ -1766,11 +1764,11 @@ msgstr " #: engines/mohawk/dialogs.cpp:92 msgid "~D~rop Page" -msgstr "" +msgstr "Oldal~D~obás" #: engines/mohawk/dialogs.cpp:96 msgid "~S~how Map" -msgstr "" +msgstr "~S~ Térkép" #: engines/mohawk/dialogs.cpp:150 msgid "~W~ater Effect Enabled" @@ -1798,6 +1796,8 @@ msgid "" "Failed to detect the selected audio device '%s'. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"A '%s' kiválasztott hangeszköz nem elérhetõ. Bõvebb információ a " +"naplófájlban. Következõ elérhetõ eszköz keresése..." #: audio/mididrv.cpp:246 #, c-format @@ -1805,6 +1805,8 @@ msgid "" "Failed to detect the preferred device '%s'. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"A '%s' elsõdleges hangeszköz nem elérhetõ. Bõvebb információ a naplófájlban. " +"Következõ elérhetõ eszköz keresése..." #: audio/null.h:43 msgid "No music" @@ -1827,9 +1829,8 @@ msgid "C64 Audio Emulator" msgstr "C64 Audio Emulátor" #: audio/softsynth/mt32.cpp:329 -#, fuzzy msgid "Initializing MT-32 Emulator" -msgstr "MT-32 Emulátor inicializálás" +msgstr "MT-32 Emulátor inicializálása" #: audio/softsynth/mt32.cpp:543 msgid "MT-32 Emulator" @@ -1954,26 +1955,22 @@ msgstr "Norm #: backends/graphics/sdl/sdl-graphics.cpp:2137 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 -#, fuzzy msgid "Enabled aspect ratio correction" -msgstr "Méretarány korrekció kapcsoló" +msgstr "Méretarány korrekció engedélyezve" #: backends/graphics/sdl/sdl-graphics.cpp:2143 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 -#, fuzzy msgid "Disabled aspect ratio correction" -msgstr "Méretarány korrekció kapcsoló" +msgstr "Méretarány korrekció letiltva" #: backends/graphics/sdl/sdl-graphics.cpp:2198 -#, fuzzy msgid "Active graphics filter:" -msgstr "Kapcsolás grafikus szûrõk között" +msgstr "Aktív grafikus szûrõk:" #: backends/graphics/sdl/sdl-graphics.cpp:2254 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 -#, fuzzy msgid "Windowed mode" -msgstr "Kirajzolás mód:" +msgstr "Ablakos mód" #: backends/graphics/opengl/opengl-graphics.cpp:139 msgid "OpenGL Normal" @@ -1988,21 +1985,20 @@ msgid "OpenGL Original" msgstr "OpenGL Eredeti" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 -#, fuzzy msgid "Current display mode" -msgstr "Jelenlegi videómód:" +msgstr "Jelenlegi videómód" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 msgid "Current scale" -msgstr "" +msgstr "Aktuális méretezés" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 msgid "Active filter mode: Linear" -msgstr "" +msgstr "Aktív filter mód: Lineáris" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 msgid "Active filter mode: Nearest" -msgstr "" +msgstr "Aktív filter mód: Közelítõ" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2195,19 +2191,17 @@ msgid "Network down" msgstr "Nincs hálózat" #: backends/platform/wii/options.cpp:178 -#, fuzzy msgid "Initializing network" -msgstr "Hálózat inicializálás" +msgstr "Hálózat inicializálása" #: backends/platform/wii/options.cpp:182 -#, fuzzy msgid "Timeout while initializing network" -msgstr "Idõtúllépés a hálózat inicializálásnál" +msgstr "Idõtúllépés a hálózat inicializálásakor" #: backends/platform/wii/options.cpp:186 -#, fuzzy, c-format +#, c-format msgid "Network not initialized (%d)" -msgstr "Hálózat nincs inicializálva (%d)" +msgstr "(%d) Hálózat nincs inicializálva" #: backends/platform/wince/CEActionsPocket.cpp:46 msgid "Hide Toolbar" @@ -2329,7 +2323,7 @@ msgstr "" #: backends/events/gph/gph-events.cpp:410 #: backends/events/openpandora/op-events.cpp:78 msgid "Touchscreen 'Tap Mode' - Left Click" -msgstr "" +msgstr "Érintõképernyõ 'Tap Mód' - Bal katt" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 #: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 @@ -2337,7 +2331,7 @@ msgstr "" #: backends/events/gph/gph-events.cpp:412 #: backends/events/openpandora/op-events.cpp:80 msgid "Touchscreen 'Tap Mode' - Right Click" -msgstr "" +msgstr "Érintõképernyõ 'Tap Mód' - Jobb katt" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 #: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 @@ -2345,29 +2339,27 @@ msgstr "" #: backends/events/gph/gph-events.cpp:414 #: backends/events/openpandora/op-events.cpp:82 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" -msgstr "" +msgstr "Érintõképernyõ 'Tap Mód' - Lebegõ (Nincs katt)" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 #: backends/events/gph/gph-events.cpp:391 -#, fuzzy msgid "Maximum Volume" -msgstr "Hangerõ" +msgstr "Maximum Hangerõ" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 #: backends/events/gph/gph-events.cpp:393 msgid "Increasing Volume" -msgstr "" +msgstr "Hangerõ növelése" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 #: backends/events/gph/gph-events.cpp:399 -#, fuzzy msgid "Minimal Volume" -msgstr "Hangerõ" +msgstr "Minimum Hangerõ" #: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 #: backends/events/gph/gph-events.cpp:401 msgid "Decreasing Volume" -msgstr "" +msgstr "Hangerõ csökkentése" #~ msgid "Discovered %d new games." #~ msgstr "%d Új játékot találtam." -- cgit v1.2.3 From 6d952b3e5886d03b7a563b3ce281f63ddf4723f4 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 12 Jun 2011 13:48:26 +0100 Subject: I18N: Regenerate translations data file --- gui/themes/translations.dat | Bin 201273 -> 206325 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index e8823fda8f..eb6cf3223f 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3 From aeff4b623eb3be6759eb8e4f81b7f4d7b9bd1c54 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 12 Jun 2011 00:43:52 +0200 Subject: LOL: add another detection entry for Italian fan translation (this detection entry applies if the game has been patched with the official 1.02 patch before using the translation patch) --- engines/kyra/detection_tables.h | 126 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index e4815ab751..7bad98732f 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -54,6 +54,9 @@ namespace { #define LOL_DEMO_FLAGS FLAGS(true, true, false, false, false, false, false, Kyra::GI_LOL) #define LOL_KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, false, false, Kyra::GI_KYRA2) +#define EOB_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_EOB1) +#define EOB2_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_EOB2) + const KYRAGameDescription adGameDescs[] = { /* disable these targets until they get supported { @@ -1058,7 +1061,7 @@ const KYRAGameDescription adGameDescs[] = { }, // Italian fan translation - { + { { "lol", "CD", @@ -1109,6 +1112,57 @@ const KYRAGameDescription adGameDescs[] = { LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) }, + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::IT_ITA, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + + { + { + "lol", + "CD", + { + { "GENERAL.PAK", 0, "9e4bab499b7ea9337b91ac29fcba6d13", -1 }, + { "L01.PAK", 0, "898485c0eb7bb4403fdd63bf5191f37e", -1 }, + { 0, 0, 0, 0 } + }, + Common::FR_FRA, + Common::kPlatformPC, + ADGF_DROPLANGUAGE | ADGF_CD, + Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM | Common::GUIO_MIDIPCSPK + }, + LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY) + }, + { { "lol", @@ -1275,6 +1329,72 @@ const KYRAGameDescription adGameDescs[] = { LOL_KYRA2_DEMO_FLAGS }, #endif // ENABLE_LOL +#ifdef ENABLE_EOB + + { + { + "eob", + 0, + { + { "EOBDATA2.PAK", 0, "feaf0345086b3a1d931352f4b0ad8feb", -1 }, + { 0, 0, 0, 0 } + }, + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK + }, + EOB_FLAGS + }, + + { + { + "eob", + 0, + { + { "SHINDIA.CPS", 0, "383b0c7ba0903eae5d04cad28ce90aaf", -1 }, + { 0, 0, 0, 0 } + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK + }, + EOB_FLAGS + }, + + { + { + "eob2", + 0, + { + { "LEVEL15.INF", 0, "10f19eab75c73d0476dc58bcf70fff7a", -1 }, + { 0, 0, 0, 0 } + }, + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK + }, + EOB2_FLAGS + }, + + { + { + "eob2", + 0, + { + { "LEVEL15.INF", 0, "ce54243ad1ca4447f521340428da2c91", -1 }, + { 0, 0, 0, 0 } + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_NO_FLAGS, + Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK + }, + EOB2_FLAGS + }, +#endif // ENABLE_EOB { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0, 0, 0) } }; @@ -1286,6 +1406,10 @@ const PlainGameDescriptor gameList[] = { #ifdef ENABLE_LOL { "lol", "Lands of Lore: The Throne of Chaos" }, #endif // ENABLE_LOL +#ifdef ENABLE_EOB + { "eob", "Eye of the Beholder" }, + { "eob2", "Eye of the Beholder II: The Legend of Darkmoon" }, +#endif // ENABLE_EOB { 0, 0 } }; -- cgit v1.2.3 From d9dcb5725af996b3ee0fa74c6d0d0aa9faa4a0e3 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 12 Jun 2011 16:46:08 +0200 Subject: LOL: fix typo --- engines/kyra/detection_tables.h | 74 ----------------------------------------- 1 file changed, 74 deletions(-) diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h index 7bad98732f..47a3c4362a 100644 --- a/engines/kyra/detection_tables.h +++ b/engines/kyra/detection_tables.h @@ -54,9 +54,6 @@ namespace { #define LOL_DEMO_FLAGS FLAGS(true, true, false, false, false, false, false, Kyra::GI_LOL) #define LOL_KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, false, false, Kyra::GI_KYRA2) -#define EOB_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_EOB1) -#define EOB2_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_EOB2) - const KYRAGameDescription adGameDescs[] = { /* disable these targets until they get supported { @@ -1329,73 +1326,6 @@ const KYRAGameDescription adGameDescs[] = { LOL_KYRA2_DEMO_FLAGS }, #endif // ENABLE_LOL -#ifdef ENABLE_EOB - - { - { - "eob", - 0, - { - { "EOBDATA2.PAK", 0, "feaf0345086b3a1d931352f4b0ad8feb", -1 }, - { 0, 0, 0, 0 } - }, - Common::EN_ANY, - Common::kPlatformPC, - ADGF_NO_FLAGS, - Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK - }, - EOB_FLAGS - }, - - { - { - "eob", - 0, - { - { "SHINDIA.CPS", 0, "383b0c7ba0903eae5d04cad28ce90aaf", -1 }, - { 0, 0, 0, 0 } - }, - Common::DE_DEU, - Common::kPlatformPC, - ADGF_NO_FLAGS, - Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK - }, - EOB_FLAGS - }, - - { - { - "eob2", - 0, - { - { "LEVEL15.INF", 0, "10f19eab75c73d0476dc58bcf70fff7a", -1 }, - { 0, 0, 0, 0 } - }, - Common::EN_ANY, - Common::kPlatformPC, - ADGF_NO_FLAGS, - Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK - }, - EOB2_FLAGS - }, - - { - { - "eob2", - 0, - { - { "LEVEL15.INF", 0, "ce54243ad1ca4447f521340428da2c91", -1 }, - { 0, 0, 0, 0 } - }, - Common::DE_DEU, - Common::kPlatformPC, - ADGF_NO_FLAGS, - Common::GUIO_NOSPEECH | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIPCSPK - }, - EOB2_FLAGS - }, -#endif // ENABLE_EOB - { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0, 0, 0) } }; @@ -1406,10 +1336,6 @@ const PlainGameDescriptor gameList[] = { #ifdef ENABLE_LOL { "lol", "Lands of Lore: The Throne of Chaos" }, #endif // ENABLE_LOL -#ifdef ENABLE_EOB - { "eob", "Eye of the Beholder" }, - { "eob2", "Eye of the Beholder II: The Legend of Darkmoon" }, -#endif // ENABLE_EOB { 0, 0 } }; -- cgit v1.2.3 From 60943efafd15b0e9bb8bbf533714cac7779b5dba Mon Sep 17 00:00:00 2001 From: md5 Date: Sun, 12 Jun 2011 17:58:25 +0300 Subject: SCI: Fixed bug #3295931 - "SCI: JONES: Disabled commands are available using shortcuts" --- engines/sci/graphics/menu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 9d4ab3f589..913f680e99 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -423,7 +423,9 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { default: while (itemIterator != itemEnd) { itemEntry = *itemIterator; - if ((itemEntry->keyPress == keyPress) && (itemEntry->keyModifier == keyModifier)) + if (itemEntry->keyPress == keyPress && + itemEntry->keyModifier == keyModifier && + itemEntry->enabled) break; itemIterator++; } -- cgit v1.2.3 From 9e2c7f26d2e6c6081489365cbc07cd6edec362ad Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 12 Jun 2011 20:13:20 +0200 Subject: SCI: Treat all priorities above 15 as none Before only 255 was treated this way. This fixes part of the broken dialog boxes in Jones CD (bug #3297111) which use priority 254, and matches Jones CD disassembly. --- engines/sci/graphics/picture.cpp | 2 +- engines/sci/graphics/view.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 6529a6ae64..ce69ba8922 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -330,7 +330,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos if (!_addToFlag && _resourceType != SCI_PICTURE_TYPE_SCI32) clearColor = _screen->getColorWhite(); - byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY; + byte drawMask = priority > 15 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY; ptr = celBitmap; ptr += skipCelBitmapPixels; diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 5c8e9c3d2e..afb4c184e8 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -692,7 +692,7 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const const int16 celHeight = celInfo->height; const int16 celWidth = celInfo->width; const byte clearKey = celInfo->clearKey; - const byte drawMask = (priority == 255) ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; + const byte drawMask = priority > 15 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; int x, y; if (_embeddedPal) @@ -753,7 +753,7 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, const int16 celHeight = celInfo->height; const int16 celWidth = celInfo->width; const byte clearKey = celInfo->clearKey; - const byte drawMask = (priority == 255) ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; + const byte drawMask = priority > 15 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; uint16 scalingX[640]; uint16 scalingY[480]; int16 scaledWidth, scaledHeight; -- cgit v1.2.3 From 8e2f2e3730c27fd9ac6172eb8007fb362a198678 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 12 Jun 2011 20:21:52 +0200 Subject: SCI: Remove workaround that caused graphics corruption This fixes coins disappearing in Mother Goose SCI1.1 (bug #3051136). Filippos has confirmed the workaround is no longer necessary for the menubar in LSL6 for which it was added. --- engines/sci/graphics/transitions.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index dba263c9bf..d047eb10a1 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -189,16 +189,6 @@ void GfxTransitions::doit(Common::Rect picRect) { // Now we do the actual transition to the new screen doTransition(_number, false); - if (picRect.bottom != _screen->getHeight()) { - // TODO: this is a workaround for lsl6 not showing menubar when playing - // There is some new code in the sierra sci in ShowPic that seems to do - // something similar to this - // FIXME: Having this code here also causes bug #3051136 in - // the SCI1.1 version of Mother Goose. - _screen->copyToScreen(); - g_system->updateScreen(); - } - _screen->_picNotValid = 0; } -- cgit v1.2.3 From 259bb8417497170a81c3226d23ba7f2454edce60 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 12 Jun 2011 22:24:33 +0300 Subject: SWORD25: Removed leftover dead code --- engines/sword25/fmv/theora_decoder.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index be6d940d23..098bd2c6b9 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -479,12 +479,6 @@ void TheoraDecoder::reset() { if (_fileStream) _fileStream->seek(0); -#if ENABLE_THEORA_SEEKING - _videobufGranulePos = -1; - _audiobufGranulePos = 0; - _videobufTime = 0; -#endif - _audiobufFill = 0; _audiobufReady = false; -- cgit v1.2.3 From 4c70d399330503e39841d6047435e26da2f189f2 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 13 Jun 2011 01:24:28 +0200 Subject: SCI: Shrink rectangle updated by DrawControl(Text) This fixes dialogs in Jones CD (bug #3297111) together with 9e2c7f26d2e6c6081489365cbc07cd6edec362ad. This grow was probably accidentally added in 6fda9a5067ca642ccf569a0845e170a6a74ce442. Assembly of KQ5CD and JonesCD confirms it shouldn't be there. --- engines/sci/graphics/controls.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp index 0289735c0a..8d4712a969 100644 --- a/engines/sci/graphics/controls.cpp +++ b/engines/sci/graphics/controls.cpp @@ -329,7 +329,6 @@ void GfxControls::kernelDrawText(Common::Rect rect, reg_t obj, const char *text, if (style & SCI_CONTROLS_STYLE_SELECTED) { _paint16->frameRect(rect); } - rect.grow(1); if (!getPicNotValid()) _paint16->bitsShow(rect); } else { -- cgit v1.2.3 From afb1b3d8d38c32f4a50c1033cec00cc859917463 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 13 Jun 2011 03:00:03 +0200 Subject: SCUMM: fix engine destructor (This is relevant for cases where the engine errors out early, before certain arrays get initialized). --- engines/scumm/scumm.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 36caff452d..dd26e23b4d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -162,7 +162,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _pauseDialog = NULL; _versionDialog = NULL; _fastMode = 0; - _actors = NULL; + _actors = _sortedActors = NULL; _arraySlot = NULL; _inventory = NULL; _newNames = NULL; @@ -584,9 +584,12 @@ ScummEngine::~ScummEngine() { _mixer->stopAll(); - for (int i = 0; i < _numActors; ++i) - delete _actors[i]; - delete[] _actors; + if (_actors) { + for (int i = 0; i < _numActors; ++i) + delete _actors[i]; + delete[] _actors; + } + delete[] _sortedActors; delete[] _2byteFontPtr; @@ -1361,6 +1364,7 @@ void ScummEngine::resetScumm() { #ifdef USE_RGB_COLOR if (_game.features & GF_16BIT_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE + || _game.platform == Common::kPlatformFMTowns #endif ) -- cgit v1.2.3 From 34fd272841c0dc80e3de2dd66b671eb84fe78aba Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 13 Jun 2011 16:31:35 +1000 Subject: TSAGE: Completed initial implementation of _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 326 ++++++++++++++++++++++++++++++++++++++++++++---- engines/tsage/sound.h | 81 ++++++++---- 2 files changed, 361 insertions(+), 46 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ac7217a753..1976013946 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -358,7 +358,6 @@ void SoundManager::_sfSoundServer() { do { _sfProcessFading(); } while (sfManager()._serverSuspendedCount > 0); - sfManager()._serverSuspendedCount = 0; // Poll all sound drivers in case they need it for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -416,12 +415,14 @@ void SoundManager::_sfProcessFading() { // Loop through the voiceType list for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { - VoiceTypeStruct &voiceType = *sfManager()._voiceTypeStructPtrs[voiceIndex]; + VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[voiceIndex]; + if (!vtStruct) + continue; - if (voiceType._voiceType == VOICETYPE_1) { - for (uint idx = 0; idx < voiceType._entries.size(); ++idx) { - if (voiceType._entries[idx]._type1._field6 >= -1) - ++voiceType._entries[idx]._type1._field6; + if (vtStruct->_voiceType == VOICETYPE_1) { + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { + if (vtStruct->_entries[idx]._type1._field6 >= -1) + ++vtStruct->_entries[idx]._type1._field6; } } } @@ -430,6 +431,8 @@ void SoundManager::_sfProcessFading() { void SoundManager::_sfUpdateVoiceStructs() { for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; + if (!vs) + continue; for (uint idx = 0; idx < vs->_entries.size(); ++idx) { VoiceStructEntry &vse = vs->_entries[idx]; @@ -496,6 +499,7 @@ void SoundManager::listenerSynchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ SoundManager &SoundManager::sfManager() { + assert(_soundManager); return *_soundManager; } @@ -584,18 +588,15 @@ void SoundManager::_sfRethinkSoundDrivers() { } if (total) { - int dataSize = !flag ? total * 28 + 30 : total * 26 + 30; - debugC(9, ktSageSound, "data Size = %d\n", dataSize); - VoiceTypeStruct *vs = new VoiceTypeStruct(); sfManager()._voiceTypeStructPtrs[idx] = vs; if (!flag) { vs->_voiceType = VOICETYPE_0; - vs->_field1 = total; + vs->_total = total; } else { vs->_voiceType = VOICETYPE_1; - vs->_field1 = vs->_numVoices = total; + vs->_total = vs->_numVoices = total; } for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -608,6 +609,8 @@ void SoundManager::_sfRethinkSoundDrivers() { byte byteVal = *groupData++; if (byteVal == idx) { + ++groupData; + if (!flag) { while ((byteVal = *groupData++) != 0xff) { VoiceStructEntry ve; @@ -628,7 +631,7 @@ void SoundManager::_sfRethinkSoundDrivers() { VoiceStructEntry ve; ve._voiceNum = idx; ve._driver = driver; - ve._type1._field4 = 0xff; + ve._type1._field4 = -1; ve._type1._field5 = 0; ve._type1._field6 = 0; ve._type1._sound = NULL; @@ -642,6 +645,8 @@ void SoundManager::_sfRethinkSoundDrivers() { if (*groupData++ != 0) { while (*groupData != 0xff) ++groupData; + } else { + groupData += 2; } } } @@ -1171,6 +1176,8 @@ void SoundManager::_sfRethinkVoiceTypes() { } } } + + --sfManager()._serverSuspendedCount; } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -1287,7 +1294,7 @@ void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { } void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) { - driver->installPatchBank(bankData); + driver->installPatch(bankData); } /** @@ -1392,7 +1399,6 @@ void Sound::play(int soundNum) { } void Sound::stop() { - _soundManager->removeFromPlayList(this); _unPrime(); } @@ -1458,7 +1464,8 @@ void Sound::_unPrime() { } _trackInfo._numTracks = 0; - _soundManager->removeFromSoundList(this); + if (_soundManager) + _soundManager->removeFromSoundList(this); _primed = false; _stoppedAsynchronously = false; @@ -1738,7 +1745,8 @@ void Sound::_soPrimeChannelData() { int mode = *d; int channelNum = (int8)*(d + 1); assert((channelNum >= 0) && (channelNum < 16)); - + + _trkChannel[idx] = channelNum; _chProgram[idx] = *(d + 10); _chModulation[idx] = 0; _chVolume[idx] = *(d + 11); @@ -1784,6 +1792,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { return; int channelNum = _trkChannel[trackIndex]; + assert((channelNum >= 0) && (channelNum < SOUND_ARR_SIZE)); int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum]; int voiceNum = -1; SoundDriver *driver = NULL; @@ -1847,7 +1856,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (chFlags & 0x10) _soProc42(vtStruct, channelNum, chVoiceType, v); else - _soProc32(vtStruct, channelNum, chVoiceType, v); + _soProc32(vtStruct, channelNum, chVoiceType, v, b); } else if (voiceNum != -1) { assert(driver); driver->proc20(voiceNum, chVoiceType); @@ -2011,7 +2020,7 @@ void Sound::_soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceTyp } } -void Sound::_soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0) { +void Sound::_soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0, int v1) { int entryIndex = _soFindSound(vtStruct, channelNum); if (entryIndex != -1) { SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; @@ -2021,7 +2030,7 @@ void Sound::_soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voice vtStruct->_entries[entryIndex]._type1._field4 = v0; vtStruct->_entries[entryIndex]._type1._field5 = 0; - driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, _chProgram[channelNum]); + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, _chProgram[channelNum], v0, v1); } } @@ -2039,8 +2048,7 @@ void Sound::_soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voice vtStruct->_entries[entryIndex]._type1._field4 = v0; vtStruct->_entries[entryIndex]._type1._field5 = 0; - driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, voiceType, - _channelData[trackCtr], this, 0x7f, 0xff, 0xE); + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, v0, 0x7F); driver->proc42(vtStruct->_entries[entryIndex]._voiceNum, voiceType, 0); } break; @@ -2168,8 +2176,7 @@ void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1); vtStruct->_entries[entryIndex]._type1._field5 = 0; - driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, voiceType, - _channelData[trackIndex], this, 0x7f, 0xff, 0xE); + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, *(channelData + 1), 0x7f); } } else { @@ -2295,9 +2302,34 @@ SoundDriver::SoundDriver() { const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff }; -AdlibSoundDriver::AdlibSoundDriver() { +const byte v440B0[9] = { 0, 1, 2, 6, 7, 8, 12, 13, 14 }; + +const byte v440B9[9] = { 3, 4, 5, 9, 10, 11, 15, 16, 17 }; + +const byte v440C2[18] = { + 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 +}; + +const byte v44134[64] = { + 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, + 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, + 61, 62, 62, 62, 62, 63, 63, 63 +}; + +const int v440D4[48] = { + 343, 348, 353, 358, 363, 369, 374, 379, 385, 391, 396, + 402, 408, 414, 420, 426, 432, 438, 445, 451, 458, 465, + 471, 478, 485, 492, 499, 507, 514, 521, 529, 537, 544, + 552, 560, 569, 577, 585, 594, 602, 611, 620, 629, 638, + 647, 657, 666, 676 +}; + +AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _minVersion = 0x102; _maxVersion = 0x10A; + _masterVolume = 0; _groupData.groupMask = 9; _groupData.v1 = 0x46; @@ -2305,6 +2337,252 @@ AdlibSoundDriver::AdlibSoundDriver() { _groupData.pData = &adlib_group_data[0]; _mixer = _vm->_mixer; + _sampleRate = _mixer->getOutputRate(); + _opl = makeAdLibOPL(_sampleRate); + + memset(_channelVoiced, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44070, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + _v44082[ADLIB_CHANNEL_COUNT] = 0x90; + Common::set_to(_v4408C, _v4408C + ADLIB_CHANNEL_COUNT, 0x2000); + memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); +} + +AdlibSoundDriver::~AdlibSoundDriver() { + DEALLOCATE(_patchData); +} + +bool AdlibSoundDriver::open() { + write(1, 0x20); + if (!reset()) + return false; + + write(8, 0); + for (int idx = 0x20; idx < 0xF6; ++idx) + write(idx, 0); + + write(0xBD, 0); + return true; +} + +void AdlibSoundDriver::close() { + for (int idx = 0xB0; idx < 0xB8; ++idx) + write(idx, _portContents[idx] & 0xDF); + for (int idx = 0x40; idx < 0x55; ++idx) + write(idx, 0x3F); + reset(); +} + +bool AdlibSoundDriver::reset() { + write(1, 0x20); + write(4, 0x80); +/* + * code fragment originally part of testing Adlib timer speed + write(2, 1); + write(4, 1); +*/ + return true; +} + +const GroupData *AdlibSoundDriver::getGroupData() { + return &_groupData; +} + +void AdlibSoundDriver::installPatch(const byte *data) { + _patchData = data; +} + +int AdlibSoundDriver::setMasterVolume(int volume) { + int oldVolume = _masterVolume; + _masterVolume = volume; + + for (int channelNum = 0; channelNum < ADLIB_CHANNEL_COUNT; ++channelNum) + updateChannelVolume(channelNum); + + return oldVolume; +} + +void AdlibSoundDriver::proc32(int channel, int program, int v0, int v1) { + if (program == -1) + return; + + int offset = READ_LE_UINT16(_patchData + program * 2); + if (offset) { + const byte *dataP = _patchData + offset; + + for (int offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) { + if ((dataP[offset] <= v0) && (dataP[offset + 1] >= v0)) { + if (dataP[offset + 2] != 0xff) + v0 = dataP[offset + 2]; + + // Set sustain/release + int portNum = v440C2[v440B0[channel]] + 0x80; + write(portNum, (_portContents[portNum] & 0xF0) | 0xF); + + portNum = v440C2[v440B9[channel]] + 0x80; + write(portNum, (_portContents[portNum] & 0xF0) | 0xF); + + if (_channelVoiced[channel]) + clearVoice(channel); + + _v44067[channel] = v0; + _v4405E[channel] = v1; + + updateChannel(channel); + setFrequency(channel); + updateChannelVolume(channel); + setVoice(channel); + break; + } + } + } +} + +void AdlibSoundDriver::updateVoice(int channel) { + if (_channelVoiced[channel]) + clearVoice(channel); +} + +void AdlibSoundDriver::proc38(int channel, int cmd, int value) { + if (cmd == 7) { + // Set channel volume + _channelVolume[channel] = value; + updateChannelVolume(channel); + } +} + +void AdlibSoundDriver::proc40(int channel, int pitchBlend) { + _v4408C[channel] = pitchBlend; + setFrequency(channel); +} + +void AdlibSoundDriver::write(byte reg, byte value) { +static int num = 0; +debug("%d [%x]=%x", ++num, reg, value);//***DEBUG**** + _portContents[reg] = value; + OPLWriteReg(_opl, reg, value); +} + +void AdlibSoundDriver::updateChannelVolume(int channelNum) { + int volume = (_masterVolume * _channelVolume[channelNum] / 127 * _v4405E[channelNum] / 127) / 2; + int level2 = 63 - v44134[volume * _v44079[channelNum] / 63]; + int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] : + 63 - v44134[volume * _v44070[channelNum] / 63]; + + int portNum = v440C2[v440B0[channelNum]] + 0x40; + write(portNum, (_portContents[portNum] & 0x80) | level1); + + portNum = v440C2[v440B9[channelNum]] + 0x40; + write(portNum, (_portContents[portNum] & 0x80) | level2); +} + +void AdlibSoundDriver::setVoice(int channel) { + int portNum = 0xB0 + channel; + write(portNum, _portContents[portNum] | 0x20); + _channelVoiced[channel] = true; +} + +void AdlibSoundDriver::clearVoice(int channel) { + write(0xB0 + channel, _portContents[0xB0 + channel] & ~0x20); + _channelVoiced[channel] = false; +} + +void AdlibSoundDriver::updateChannel(int channel) { + const byte *dataP = _patchData + _v4409E[channel]; + int portOffset = v440C2[v440B0[channel]]; + + int portNum = portOffset + 0x20; + int portValue = 0; + if (*(dataP + 4)) + portValue |= 0x80; + if (*(dataP + 5)) + portValue |= 0x40; + if (*(dataP + 8)) + portValue |= 0x20; + if (*(dataP + 6)) + portValue |= 0x10; + portValue |= *(dataP + 7); + write(portNum, portValue); + + portValue = (_portContents[0x40 + portOffset] & 0x3F) | (*(dataP + 9) << 6); + write(0x40 + portOffset, portValue); + + _v44070[channel] = 63 - *(dataP + 10); + write(0x60 + portOffset, *(dataP + 12) | (*(dataP + 11) << 4)); + write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4)); + write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15)); + + portNum = portOffset + 0x20; + portValue = 0; + if (*(dataP + 17)) + portValue |= 0x80; + if (*(dataP + 18)) + portValue |= 0x40; + if (*(dataP + 21)) + portValue |= 0x20; + if (*(dataP + 19)) + portValue |= 0x10; + portValue |= *(dataP + 20); + write(portNum, portValue); + + write(0x40 + portOffset, (_portContents[0x40 + portOffset] & 0x3f) | (*(dataP + 22) << 6)); + _v44079[channel] = *(dataP + 23); + write(0x60 + portOffset, *(dataP + 25) | (*(dataP + 24) << 4)); + write(0x80 + portOffset, *(dataP + 27) | (*(dataP + 26) << 4)); + write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 28)); + write(0xC0 + portOffset, (_portContents[0xE0 + portOffset] & 0xF0) + | (*(dataP + 16) << 1) | *(dataP + 3)); + + _v44082[channel] = *(dataP + 3); +} + +void AdlibSoundDriver::setFrequency(int channel) { + int offset, ch; + + int v = _v4408C[channel]; + if (v == 0x2000) { + offset = 0; + ch = _v44067[channel]; + } else if (v > 0x2000) { + ch = _v44067[channel]; + v -= 0x2000; + if (v == 0x1fff) + v = 0x2000; + + offset = (v / 170) & 3; + ch += (v / 170) >> 2; + + if (ch >= 128) + ch = 127; + } else { + ch = _v44067[channel]; + int tempVal = (0x2000 - v) / 170; + int tempVal2 = 4 - (tempVal & 3); + + if (tempVal2 == 4) + offset = 0; + else { + offset = tempVal2; + --ch; + } + + ch -= tempVal >> 2; + if (ch >= 128) + ch = 0; + } + + int var2 = ch / 12; + if (var2) + --var2; + + int dataWord = v440D4[((ch % 12) << 2) + offset]; + write(0xA0 + channel, dataWord & 0xff); + write(0xB0 + channel, (_portContents[0xB0 + channel] & 0xE0) | + ((dataWord >> 8) & 3) | (var2 << 2)); } } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 1dc40b2e4c..fec065e0d2 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -78,24 +78,28 @@ public: const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } - virtual bool open() { return true; } - virtual void close() {} - virtual const GroupData *getGroupData() = 0; - virtual void installPatchBank(const byte *data) {} - virtual void poll() {} - virtual void setMasterVolume(int volume) {} - virtual void proc18(int al, VoiceType voiceType) {} - virtual void proc20(int al, VoiceType voiceType) {} - virtual void proc22(int al, VoiceType voiceType, int v3) {} + virtual bool open() { return true; } // Method #0 + virtual void close() {} // Method #1 + virtual bool reset() { return true; } // Method #2 + virtual const GroupData *getGroupData() { return NULL; } // Method #3 + virtual void installPatch(const byte *data) {} // Method #4 + virtual void poll() {} // Method #5 + virtual void proc12() {} // Method #6 + virtual int setMasterVolume(int volume) { return 0; } // Method #7 + virtual void proc16() {} // Method #8 + virtual void proc18(int al, VoiceType voiceType) {} // Method #9 + virtual void proc20(int al, VoiceType voiceType) {} // Method #10 + virtual void proc22(int al, VoiceType voiceType, int v3) {} // Method #11 virtual void proc24(int channel, int voiceIndex, Sound *sound, int v1, int v2) {} - virtual void setProgram(int channel, int program) {} + virtual void setProgram(int channel, int program) {} // Method #13 virtual void setVolume1(int channel, int v2, int v3, int volume) {} - virtual void setPitchBlend(int channel, int pitchBlend) {} - virtual void proc32(int voiceNum, int program, ...) {} // TODO: Determine params - virtual void proc38(int voiceNum, int cmd, int value) {} - virtual void proc40(int voiceNum, int pitchBlend) {} - virtual void proc42(int voiceNum, ...) {} // TODO: Determine params - virtual void updateVoice(int voiceNum) {} + virtual void setPitchBlend(int channel, int pitchBlend) {} // Method #15 + virtual void proc32(int channel, int program, int v0, int v1) {}// Method #16 + virtual void updateVoice(int channel) {} // Method #17 + virtual void proc36() {} // Method #18 + virtual void proc38(int channel, int cmd, int value) {} // Method #19 + virtual void proc40(int channel, int pitchBlend) {} // Method #20 + virtual void proc42(int channel, int v0, int v1) {} // Method #21 }; struct VoiceStructEntryType0 { @@ -141,7 +145,7 @@ struct VoiceStructEntry { class VoiceTypeStruct { public: VoiceType _voiceType; - int _field1; + int _total; int _numVoices; int _field3; @@ -332,7 +336,7 @@ public: void _soRemoteReceive(); void _soServiceTrackType0(int trackIndex, const byte *channelData); void _soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0); - void _soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); + void _soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0, int v1); void _soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0); void _soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value); void _soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend); @@ -381,16 +385,49 @@ public: void release() { _sound.release(); } }; +#define ADLIB_CHANNEL_COUNT 9 + class AdlibSoundDriver: public SoundDriver { private: GroupData _groupData; Audio::Mixer *_mixer; + FM_OPL *_opl; + int _sampleRate; + byte _portContents[256]; + const byte *_patchData; + int _masterVolume; + + bool _channelVoiced[ADLIB_CHANNEL_COUNT]; + int _channelVolume[ADLIB_CHANNEL_COUNT]; + int _v4405E[ADLIB_CHANNEL_COUNT]; + int _v44067[ADLIB_CHANNEL_COUNT]; + int _v44070[ADLIB_CHANNEL_COUNT]; + int _v44079[ADLIB_CHANNEL_COUNT]; + int _v44082[ADLIB_CHANNEL_COUNT + 1]; + int _v4408C[ADLIB_CHANNEL_COUNT]; + int _v4409E[ADLIB_CHANNEL_COUNT]; + + + void write(byte reg, byte value); + void updateChannelVolume(int channel); + void setVoice(int channel); + void clearVoice(int channel); + void updateChannel(int channel); + void setFrequency(int channel); public: AdlibSoundDriver(); - - virtual void setVolume(int volume) {} - virtual void installPatchBank(const byte *data) {} - virtual const GroupData *getGroupData() { return &_groupData; } + ~AdlibSoundDriver(); + + virtual bool open(); + virtual void close(); + virtual bool reset(); + virtual const GroupData *getGroupData(); + virtual void installPatch(const byte *data); + virtual int setMasterVolume(int volume); + virtual void proc32(int channel, int program, int v0, int v1); + virtual void updateVoice(int channel); + virtual void proc38(int channel, int cmd, int value); + void proc40(int channel, int pitchBlend); }; } // End of namespace tSage -- cgit v1.2.3 From 57bae5ecd6086e024303227446af5d2c115be1fc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 13 Jun 2011 17:50:36 +1000 Subject: TSAGE: Bugfixes for priming channel data --- engines/tsage/sound.cpp | 72 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 1976013946..30efc49e5b 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -434,15 +434,21 @@ void SoundManager::_sfUpdateVoiceStructs() { if (!vs) continue; - for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; + if (vs->_voiceType == VOICETYPE_0) { + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; - if (vs->_voiceType == VOICETYPE_0) { vse._type0._sound = vse._type0._sound2; vse._type0._channelNum = vse._type0._channelNum2; vse._type0._priority = vse._type0._priority2; vse._type0._fieldA = vse._type0._field12; - } else { + } + } else { + vs->_field3 = vs->_numVoices; + + for (uint idx = 0; idx < vs->_entries.size(); ++idx) { + VoiceStructEntry &vse = vs->_entries[idx]; + vse._type1._sound = vse._type1._sound2; vse._type1._channelNum = vse._type1._channelNum2; vse._type1._priority = vse._type1._priority2; @@ -593,12 +599,13 @@ void SoundManager::_sfRethinkSoundDrivers() { if (!flag) { vs->_voiceType = VOICETYPE_0; - vs->_total = total; } else { vs->_voiceType = VOICETYPE_1; - vs->_total = vs->_numVoices = total; } + vs->_total = vs->_numVoices = total; + vs->_field3 = 0; + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); i != sfManager()._installedDrivers.end(); ++i) { // Process the group data for each sound driver @@ -614,6 +621,8 @@ void SoundManager::_sfRethinkSoundDrivers() { if (!flag) { while ((byteVal = *groupData++) != 0xff) { VoiceStructEntry ve; + memset(&ve, 0, sizeof(VoiceStructEntry)); + ve._field1 = (byteVal & 0x80) ? 0 : 1; ve._driver = driver; ve._type0._sound = NULL; @@ -629,6 +638,8 @@ void SoundManager::_sfRethinkSoundDrivers() { for (int idx = 0; idx < byteVal; ++idx) { VoiceStructEntry ve; + memset(&ve, 0, sizeof(VoiceStructEntry)); + ve._voiceNum = idx; ve._driver = driver; ve._type1._field4 = -1; @@ -692,6 +703,7 @@ void SoundManager::_sfRethinkVoiceTypes() { vse._type1._priority = 0; vse._type1._sound2 = NULL; vse._type1._channelNum2 = 0; + vse._type1._priority2 = 0; } } } @@ -1387,6 +1399,27 @@ Sound::Sound() { _primed = false; _isEmpty = false; _remoteReceiver = NULL; + + + memset(_chProgram, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chModulation, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chVolume, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chPan, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chDamper, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chPitchBlend, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chVoiceType, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chNumVoices, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chSubPriority, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chFlags, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_chWork, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_channelData, 0, SOUND_ARR_SIZE * sizeof(byte *)); + memset(_trkChannel, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkState, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkLoopState, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkIndex, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkLoopIndex, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkRest, 0, SOUND_ARR_SIZE * sizeof(int)); + memset(_trkLoopRest, 0, SOUND_ARR_SIZE * sizeof(int)); } Sound::~Sound() { @@ -1744,19 +1777,22 @@ void Sound::_soPrimeChannelData() { byte *d = _channelData[idx]; int mode = *d; int channelNum = (int8)*(d + 1); - assert((channelNum >= 0) && (channelNum < 16)); - + _trkChannel[idx] = channelNum; - _chProgram[idx] = *(d + 10); - _chModulation[idx] = 0; - _chVolume[idx] = *(d + 11); - _chPan[idx] = *(d + 12); - _chDamper[idx] = 0; - _chVoiceType[idx] = _trackInfo._voiceTypes[idx]; - _chNumVoices[idx] = *(d + 6); - _chSubPriority[idx] = *(d + 7); - _chPitchBlend[idx] = 0x2000; - _chFlags[idx] = READ_LE_UINT16(d + 8); + assert((channelNum >= -1) && (channelNum < 16)); + + if (channelNum >= 0) { + _chProgram[channelNum] = *(d + 10); + _chModulation[channelNum] = 0; + _chVolume[channelNum] = *(d + 11); + _chPan[channelNum] = *(d + 12); + _chDamper[channelNum] = 0; + _chVoiceType[channelNum] = _trackInfo._voiceTypes[idx]; + _chNumVoices[channelNum] = *(d + 6); + _chSubPriority[channelNum] = *(d + 7); + _chPitchBlend[channelNum] = 0x2000; + _chFlags[channelNum] = READ_LE_UINT16(d + 8); + } if (mode == 0) { _trkState[idx] = 1; -- cgit v1.2.3 From 3e6f031fc56b982331e940a1eb7c5496d030ac1d Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 13 Jun 2011 12:39:15 +0200 Subject: SCUMM: some cleanup in gfx_towns.cpp --- engines/scumm/gfx_towns.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 82bb32cdfb..10d6ee0082 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -248,7 +248,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->palette = (uint8*)pal; if (l->palette && _bpp == 1) - warning("TownsScreen::setupLayer(): Layer palette usage requires 15 bit graphics setting.\nLayer palette will be ignored."); + warning("TownsScreen::setupLayer(): Layer palette usage requires 16 bit graphics setting.\nLayer palette will be ignored."); delete[] l->pixels; l->pixels = new uint8[l->pitch * l->height]; @@ -270,7 +270,8 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->bltTmpPal = (l->bpp == 1 && _bpp == 2) ? new uint16[l->numCol] : 0; l->enabled = true; - l->onBottom = (!layer || !_layers[0].enabled); + _layers[0].onBottom = true; + _layers[1].onBottom = _layers[0].enabled ? false : true; l->ready = true; } @@ -420,10 +421,10 @@ void TownsScreen::toggleLayers(int flag) { if (flag < 0 || flag > 3) return; - for (int i = 0; i < 2; ++i) { - _layers[i].enabled = (flag & (i + 1)) ? true : false; - _layers[i].onBottom = (!i || !_layers[0].enabled); - } + _layers[0].enabled = (flag & 1) ? true : false; + _layers[0].onBottom = true; + _layers[1].enabled = (flag & 2) ? true : false; + _layers[1].onBottom = _layers[0].enabled ? false : true; _dirtyRects.clear(); _dirtyRects.push_back(Common::Rect(_width - 1, _height - 1)); @@ -458,12 +459,12 @@ void TownsScreen::updateOutputBuffer() { for (int y = r->top; y <= r->bottom; ++y) { if (l->bpp == _bpp && l->scaleW == 1 && l->onBottom) { - memcpy(dst, l->bltInternY[y] + l->bltInternX[r->left], (r->right + 1 - r->left) * _bpp); + memcpy(dst, &l->bltInternY[y][l->bltInternX[r->left]], (r->right + 1 - r->left) * _bpp); dst += _pitch; } else if (_bpp == 2) { for (int x = r->left; x <= r->right; ++x) { - uint8 *src = l->bltInternY[y] + l->bltInternX[x]; + uint8 *src = &l->bltInternY[y][l->bltInternX[x]]; if (l->bpp == 1) { uint8 col = *src; if (col || l->onBottom) { @@ -480,7 +481,7 @@ void TownsScreen::updateOutputBuffer() { } else { for (int x = r->left; x <= r->right; ++x) { - uint8 col = *(l->bltInternY[y] + l->bltInternX[x]); + uint8 col = l->bltInternY[y][l->bltInternX[x]]; if (col || l->onBottom) { if (l->numCol == 16) col = (col >> 4) & (col & 0x0f); -- cgit v1.2.3 From bfa26ffc44f80e4eb3d8590f5f865cda6a5188b7 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 13 Jun 2011 16:43:04 +0300 Subject: SCI: Reverted commit db7dea3 The original check was correct, and the associated MG bug (#3049515) has actually been fixed with another commit. Fixes bug (regression) #3315639 - "Character Glitches in KQ4 SCI". Many thanks to waltervn and wjp for their help on this --- engines/sci/graphics/compare.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index 1dbe279f8a..3183ffa2b9 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -84,7 +84,14 @@ reg_t GfxCompare::canBeHereCheckRectList(reg_t checkObject, const Common::Rect & curRect.right = readSelectorValue(_segMan, curObject, SELECTOR(brRight)); curRect.bottom = readSelectorValue(_segMan, curObject, SELECTOR(brBottom)); // Check if curRect is within checkRect - if (checkRect.contains(curRect)) + // This behavior is slightly odd, but it's how the original SCI + // engine did it: a rect cannot be contained within itself + // (there is no equality). Do NOT change this to contains(), as + // it breaks KQ4 early (bug #3315639). + if (curRect.right > checkRect.left && + curRect.left < checkRect.right && + curRect.bottom > checkRect.top && + curRect.top < checkRect.bottom) return curObject; } } -- cgit v1.2.3 From 724b22e5c7cbd0ebf3f605adff7a08242dba3a13 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 13 Jun 2011 22:35:01 +0200 Subject: SCUMM FM-TOWNS: add number of color check in TownsScreen::updateOutputBuffer() Although the 16 color surface is normally not on bottom, there could (theoretically?) be cases in 8bit fallback mode where this becomes relevant. --- engines/scumm/gfx_towns.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 10d6ee0082..cdccd3e193 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -458,7 +458,7 @@ void TownsScreen::updateOutputBuffer() { } for (int y = r->top; y <= r->bottom; ++y) { - if (l->bpp == _bpp && l->scaleW == 1 && l->onBottom) { + if (l->bpp == _bpp && l->scaleW == 1 && l->onBottom && l->numCol & 0xff00) { memcpy(dst, &l->bltInternY[y][l->bltInternX[r->left]], (r->right + 1 - r->left) * _bpp); dst += _pitch; -- cgit v1.2.3 From ba758710f5b4e700d5e18461bd0939876fbf4499 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 Jun 2011 22:08:47 +0100 Subject: I18N: Update list of files used to generate translation template This fixes an error due to a file that had been deleted a few weeks ago. --- po/POTFILES | 1 - 1 file changed, 1 deletion(-) diff --git a/po/POTFILES b/po/POTFILES index fd70319f07..3d8c268335 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -58,6 +58,5 @@ backends/platform/wince/CEActionsPocket.cpp backends/platform/wince/CEActionsSmartphone.cpp backends/platform/wince/CELauncherDialog.cpp backends/platform/wince/wince-sdl.cpp -backends/events/gp2xsdl/gp2xsdl-events.cpp backends/events/gph/gph-events.cpp backends/events/openpandora/op-events.cpp -- cgit v1.2.3 From 06bbb57ad71103ac34e607c04798efae78a28880 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 Jun 2011 22:19:18 +0100 Subject: I18N: Make many more GUI MessageDialog strings translatable --- backends/events/default/default-events.cpp | 5 +++-- backends/platform/iphone/osys_events.cpp | 4 ++-- engines/agos/animation.cpp | 7 +++---- engines/dialogs.cpp | 4 ++-- engines/engine.cpp | 17 +++++++++-------- engines/gob/inter_playtoons.cpp | 3 ++- engines/gob/inter_v2.cpp | 5 +++-- engines/gob/inter_v5.cpp | 4 +++- engines/groovie/script.cpp | 3 ++- engines/kyra/sound_midi.cpp | 5 +++-- engines/m4/m4_menus.cpp | 3 ++- engines/parallaction/saveload.cpp | 19 +++++++++---------- engines/scumm/scumm.cpp | 6 ++++-- engines/sky/compact.cpp | 7 ++++--- engines/sword1/animation.cpp | 10 +++++----- engines/sword1/control.cpp | 12 ++++++------ engines/sword1/logic.cpp | 3 ++- engines/sword2/animation.cpp | 10 +++++----- engines/tinsel/saveload.cpp | 5 +++-- po/POTFILES | 17 +++++++++++++++++ 20 files changed, 89 insertions(+), 60 deletions(-) diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index bb74933596..78072b0021 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -26,6 +26,7 @@ #include "common/system.h" #include "common/config-manager.h" +#include "common/translation.h" #include "backends/events/default/default-events.h" #include "backends/keymapper/keymapper.h" #include "backends/keymapper/remap-dialog.h" @@ -218,7 +219,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { if (ConfMan.getBool("confirm_exit")) { if (g_engine) g_engine->pauseEngine(true); - GUI::MessageDialog alert("Do you really want to return to the Launcher?", "Launcher", "Cancel"); + GUI::MessageDialog alert(_("Do you really want to return to the Launcher?"), _("Launcher"), _("Cancel")); result = _shouldRTL = (alert.runModal() == GUI::kMessageOK); if (g_engine) g_engine->pauseEngine(false); @@ -240,7 +241,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { _confirmExitDialogActive = true; if (g_engine) g_engine->pauseEngine(true); - GUI::MessageDialog alert("Do you really want to quit?", "Quit", "Cancel"); + GUI::MessageDialog alert(_("Do you really want to quit?"), _("Quit"), _("Cancel")); result = _shouldQuit = (alert.runModal() == GUI::kMessageOK); if (g_engine) g_engine->pauseEngine(false); diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp index 6e2a4b7e1e..1ab1db0f27 100644 --- a/backends/platform/iphone/osys_events.cpp +++ b/backends/platform/iphone/osys_events.cpp @@ -335,9 +335,9 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, const char *dialogMsg; if (_mouseClickAndDragEnabled) { _touchpadModeEnabled = false; - dialogMsg = "Mouse-click-and-drag mode enabled."; + dialogMsg = _("Mouse-click-and-drag mode enabled."); } else - dialogMsg = "Mouse-click-and-drag mode disabled."; + dialogMsg = _("Mouse-click-and-drag mode disabled."); GUI::TimedMessageDialog dialog(dialogMsg, 1500); dialog.runModal(); return false; diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index eb78ca3d9b..d9a585bd05 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -29,6 +29,7 @@ #include "common/file.h" #include "common/system.h" #include "common/textconsole.h" +#include "common/translation.h" #include "graphics/cursorman.h" #include "graphics/palette.h" @@ -540,10 +541,8 @@ MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name) { return new MoviePlayerSMK(vm, baseName); } - char buf[60]; - - sprintf(buf, "Cutscene file '%s' not found!", baseName); - GUI::MessageDialog dialog(buf, "OK"); + Common::String buf = Common::String::format(_("Cutscene file '%s' not found!"), baseName); + GUI::MessageDialog dialog(buf, _("OK")); dialog.runModal(); return NULL; diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 3fd8671e55..531cf32dbc 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -143,9 +143,9 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3 break; case kHelpCmd: { GUI::MessageDialog dialog( - "Sorry, this engine does not currently provide in-game help. " + _("Sorry, this engine does not currently provide in-game help. " "Please consult the README for basic information, and for " - "instructions on how to obtain further assistance."); + "instructions on how to obtain further assistance.")); dialog.runModal(); } break; diff --git a/engines/engine.cpp b/engines/engine.cpp index 210b0b46a3..dc30b4bd0d 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -42,6 +42,7 @@ #include "common/list_intern.h" #include "common/scummsys.h" #include "common/textconsole.h" +#include "common/translation.h" #include "gui/debugger.h" #include "gui/dialog.h" @@ -216,7 +217,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics: // Just show warnings then these occur: #ifdef USE_RGB_COLOR if (gfxError & OSystem::kTransactionFormatNotSupported) { - Common::String message = "Could not initialize color format."; + Common::String message = _("Could not initialize color format."); GUI::MessageDialog dialog(message); dialog.runModal(); @@ -224,7 +225,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics: #endif if (gfxError & OSystem::kTransactionModeSwitchFailed) { - Common::String message = "Could not switch to video mode: '"; + Common::String message = _("Could not switch to video mode: '"); message += ConfMan.get("gfx_mode"); message += "'."; @@ -233,12 +234,12 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics: } if (gfxError & OSystem::kTransactionAspectRatioFailed) { - GUI::MessageDialog dialog("Could not apply aspect ratio setting."); + GUI::MessageDialog dialog(_("Could not apply aspect ratio setting.")); dialog.runModal(); } if (gfxError & OSystem::kTransactionFullscreenFailed) { - GUI::MessageDialog dialog("Could not apply fullscreen setting."); + GUI::MessageDialog dialog(_("Could not apply fullscreen setting.")); dialog.runModal(); } } @@ -338,22 +339,22 @@ void Engine::checkCD() { if (GetDriveType(buffer) == DRIVE_CDROM) { GUI::MessageDialog dialog( - "You appear to be playing this game directly\n" + _("You appear to be playing this game directly\n" "from the CD. This is known to cause problems,\n" "and it is therefore recommended that you copy\n" "the data files to your hard disk instead.\n" - "See the README file for details.", "OK"); + "See the README file for details."), _("OK")); dialog.runModal(); } else { // If we reached here, the game has audio tracks, // it's not ran from the CD and the tracks have not // been ripped. GUI::MessageDialog dialog( - "This game has audio tracks in its disk. These\n" + _("This game has audio tracks in its disk. These\n" "tracks need to be ripped from the disk using\n" "an appropriate CD audio extracting tool in\n" "order to listen to the game's music.\n" - "See the README file for details.", "OK"); + "See the README file for details."), _("OK")); dialog.runModal(); } #endif diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp index d57d2f354b..e05cae354c 100644 --- a/engines/gob/inter_playtoons.cpp +++ b/engines/gob/inter_playtoons.cpp @@ -22,6 +22,7 @@ #include "common/endian.h" #include "common/str.h" +#include "common/translation.h" #include "gui/message.h" @@ -252,7 +253,7 @@ void Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) { WRITE_VAR(1, 1); if (!_vm->_saveLoad->load(file.c_str(), dataVar, size, offset)) { - GUI::MessageDialog dialog("Failed to load game state from file."); + GUI::MessageDialog dialog(_("Failed to load game state from file.")); dialog.runModal(); } else WRITE_VAR(1, 0); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 84cae3b380..2fea18343d 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -22,6 +22,7 @@ #include "common/endian.h" #include "common/str.h" +#include "common/translation.h" #include "gui/message.h" @@ -1279,7 +1280,7 @@ void Inter_v2::o2_readData(OpFuncParams ¶ms) { if (!_vm->_saveLoad->load(file, dataVar, size, offset)) { - GUI::MessageDialog dialog("Failed to load game state from file."); + GUI::MessageDialog dialog(_("Failed to load game state from file.")); dialog.runModal(); } else @@ -1349,7 +1350,7 @@ void Inter_v2::o2_writeData(OpFuncParams ¶ms) { if (!_vm->_saveLoad->save(file, dataVar, size, offset)) { - GUI::MessageDialog dialog("Failed to save game state to file."); + GUI::MessageDialog dialog(_("Failed to save game state to file.")); dialog.runModal(); } else diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index ed371737bd..c0e8978afd 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -20,6 +20,8 @@ * */ +#include "common/translation.h" + #include "gui/message.h" #include "gob/gob.h" @@ -102,7 +104,7 @@ void Inter_v5::o5_deleteFile() { if (mode == SaveLoad::kSaveModeSave) { if (!_vm->_saveLoad->deleteFile(file)) { - GUI::MessageDialog dialog("Failed to delete file."); + GUI::MessageDialog dialog(_("Failed to delete file.")); dialog.runModal(); } diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index b52a8723fc..f87e6bb91b 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -36,6 +36,7 @@ #include "common/events.h" #include "common/file.h" #include "common/macresman.h" +#include "common/translation.h" #include "gui/message.h" @@ -413,7 +414,7 @@ void Script::savegame(uint slot) { if (!file) { debugC(9, kGroovieDebugScript, "Save file pointer is null"); - GUI::MessageDialog dialog("Failed to save game", "OK"); + GUI::MessageDialog dialog(_("Failed to save game"), _("OK")); dialog.runModal(); return; } diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 6c003d0a11..dc0f8c11ec 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "common/config-manager.h" +#include "common/translation.h" #include "gui/message.h" @@ -471,11 +472,11 @@ SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *dri // (This will only happen in The Legend of Kyrandia 1 though, all other // supported games include special General MIDI tracks). if (_type == kMidiMT32 && !_nativeMT32) { - ::GUI::MessageDialog dialog("You appear to be using a General MIDI device,\n" + ::GUI::MessageDialog dialog(_("You appear to be using a General MIDI device,\n" "but your game only supports Roland MT32 MIDI.\n" "We try to map the Roland MT32 instruments to\n" "General MIDI ones. After all it might happen\n" - "that a few tracks will not be correctly played."); + "that a few tracks will not be correctly played.")); dialog.runModal(); } } diff --git a/engines/m4/m4_menus.cpp b/engines/m4/m4_menus.cpp index 787d8666f6..3384a82c8b 100644 --- a/engines/m4/m4_menus.cpp +++ b/engines/m4/m4_menus.cpp @@ -22,6 +22,7 @@ #include "common/algorithm.h" // for find() #include "common/textconsole.h" +#include "common/translation.h" #include "gui/dialog.h" #include "gui/message.h" @@ -134,7 +135,7 @@ void OrionCallbacks::saveLoadSaveFn(DialogView *view, MenuObject *item) { bool succeeded = view->vm()->_saveLoad->save(view->_selectedSlot + 1, textItem->getText()); if (!succeeded) { - GUI::MessageDialog dialog("Save game failed!"); + GUI::MessageDialog dialog(_("Save game failed!")); dialog.runModal(); } diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 673c613485..5a1daa256b 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -23,6 +23,7 @@ #include "common/savefile.h" #include "common/config-manager.h" #include "common/textconsole.h" +#include "common/translation.h" #include "gui/dialog.h" #include "gui/saveload.h" @@ -129,8 +130,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) { void SaveLoad_ns::doSaveGame(uint16 slot, const char* name) { Common::OutSaveFile *f = getOutSaveFile(slot); if (f == 0) { - char buf[32]; - sprintf(buf, "Can't save game in slot %i\n\n", slot); + Common::String buf = Common::String::format(_("Can't save game in slot %i\n\n"), slot); GUI::MessageDialog dialog(buf); dialog.runModal(); return; @@ -208,7 +208,7 @@ bool SaveLoad::loadGame() { doLoadGame(_di); - GUI::TimedMessageDialog dialog("Loading game...", 1500); + GUI::TimedMessageDialog dialog(_("Loading game..."), 1500); dialog.runModal(); return true; @@ -223,7 +223,7 @@ bool SaveLoad::saveGame() { doSaveGame(slot, saveName.c_str()); - GUI::TimedMessageDialog dialog("Saving game...", 1500); + GUI::TimedMessageDialog dialog(_("Saving game..."), 1500); dialog.runModal(); return true; @@ -276,9 +276,9 @@ void SaveLoad_ns::getGamePartProgress(bool *complete, int size) { static bool askRenameOldSavefiles() { GUI::MessageDialog dialog0( - "ScummVM found that you have old savefiles for Nippon Safes that should be renamed.\n" + _("ScummVM found that you have old savefiles for Nippon Safes that should be renamed.\n" "The old names are no longer supported, so you will not be able to load your games if you don't convert them.\n\n" - "Press OK to convert them now, otherwise you will be asked next time.\n", "OK", "Cancel"); + "Press OK to convert them now, otherwise you will be asked next time.\n"), _("OK"), _("Cancel")); return (dialog0.runModal() != 0); } @@ -321,12 +321,11 @@ void SaveLoad_ns::renameOldSavefiles() { return; } - char msg[200]; + Common::String msg; if (success == numOldSaves) { - sprintf(msg, "ScummVM successfully converted all your savefiles."); + msg = _("ScummVM successfully converted all your savefiles."); } else { - sprintf(msg, - "ScummVM printed some warnings in your console window and can't guarantee all your files have been converted.\n\n" + msg = _("ScummVM printed some warnings in your console window and can't guarantee all your files have been converted.\n\n" "Please report to the team."); } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index dd26e23b4d..51888de574 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1766,8 +1766,10 @@ void ScummEngine::setupMusic(int midi) { if (missingFile) { GUI::MessageDialog dialog( - "Native MIDI support requires the Roland Upgrade from LucasArts,\n" - "but " + fileName + " is missing. Using AdLib instead.", "Ok"); + Common::String::format( + _("Native MIDI support requires the Roland Upgrade from LucasArts,\n" + "but %s is missing. Using AdLib instead."), fileName.c_str()), + _("Ok")); dialog.runModal(); _musicType = MDT_ADLIB; } diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index 66ce92f8fc..84609d5500 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" #include "common/file.h" #include "common/textconsole.h" +#include "common/translation.h" #include "sky/compact.h" #include "gui/message.h" #include // for ptrdiff_t @@ -126,8 +127,8 @@ static const uint32 turnTableOffsets[] = { SkyCompact::SkyCompact() { _cptFile = new Common::File(); if (!_cptFile->open("sky.cpt")) { - GUI::MessageDialog dialog("Unable to find \"sky.cpt\" file!\n" - "Please download it from www.scummvm.org", "OK", NULL); + GUI::MessageDialog dialog(_("Unable to find \"sky.cpt\" file!\n" + "Please download it from www.scummvm.org"), _("OK"), NULL); dialog.runModal(); error("Unable to find \"sky.cpt\" file\nPlease download it from www.scummvm.org"); } @@ -137,7 +138,7 @@ SkyCompact::SkyCompact() { error("unknown \"sky.cpt\" version"); if (SKY_CPT_SIZE != _cptFile->size()) { - GUI::MessageDialog dialog("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org", "OK", NULL); + GUI::MessageDialog dialog(_("The \"sky.cpt\" file has an incorrect size.\nPlease (re)download it from www.scummvm.org"), _("OK"), NULL); dialog.runModal(); error("Incorrect sky.cpt size (%d, expected: %d)", _cptFile->size(), SKY_CPT_SIZE); } diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 7e9d1142be..cb86264eeb 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -24,6 +24,7 @@ #include "common/events.h" #include "common/keyboard.h" #include "common/textconsole.h" +#include "common/translation.h" #include "sword1/sword1.h" #include "sword1/animation.h" #include "sword1/text.h" @@ -324,7 +325,6 @@ uint32 DXADecoderWithSound::getElapsedTime() const { MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::Mixer *snd, OSystem *system) { Common::String filename; - char buf[60]; Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle; filename = Common::String::format("%s.smk", sequenceList[id]); @@ -341,7 +341,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::M DXADecoderWithSound *dxaDecoder = new DXADecoderWithSound(snd, bgSoundHandle); return new MoviePlayer(vm, textMan, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA); #else - GUI::MessageDialog dialog("DXA cutscenes found but ScummVM has been built without zlib support", "OK"); + GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib support"), _("OK")); dialog.runModal(); return NULL; #endif @@ -351,13 +351,13 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::M filename = Common::String::format("%s.mp2", sequenceList[id]); if (Common::File::exists(filename)) { - GUI::MessageDialog dialog("MPEG2 cutscenes are no longer supported", "OK"); + GUI::MessageDialog dialog(_("MPEG2 cutscenes are no longer supported"), _("OK")); dialog.runModal(); return NULL; } - sprintf(buf, "Cutscene '%s' not found", sequenceList[id]); - GUI::MessageDialog dialog(buf, "OK"); + Common::String buf = Common::String::format(_("Cutscene '%s' not found"), sequenceList[id]); + GUI::MessageDialog dialog(buf, _("OK")); dialog.runModal(); return NULL; diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 86947db8ae..36d5a24e99 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -27,6 +27,7 @@ #include "common/system.h" #include "common/config-manager.h" #include "common/textconsole.h" +#include "common/translation.h" #include "graphics/palette.h" #include "graphics/thumbnail.h" @@ -859,9 +860,9 @@ void Control::checkForOldSaveGames() { } GUI::MessageDialog dialog0( - "ScummVM found that you have old savefiles for Broken Sword 1 that should be converted.\n" + _("ScummVM found that you have old savefiles for Broken Sword 1 that should be converted.\n" "The old save game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n" - "Press OK to convert them now, otherwise you will be asked again the next time you start the game.\n", "OK", "Cancel"); + "Press OK to convert them now, otherwise you will be asked again the next time you start the game.\n"), _("OK"), _("Cancel")); int choice = dialog0.runModal(); if (choice == GUI::kMessageCancel) { @@ -1228,11 +1229,10 @@ bool Control::convertSaveGame(uint8 slot, char* desc) { if (testSave) { delete testSave; - char msg[200]; - sprintf(msg, "Target new save game already exists!\n" - "Would you like to keep the old save game (%s) or the new one (%s)?\n", + Common::String msg = Common::String::format(_("Target new save game already exists!\n" + "Would you like to keep the old save game (%s) or the new one (%s)?\n"), oldFileName, newFileName); - GUI::MessageDialog dialog0(msg, "Keep the old one", "Keep the new one"); + GUI::MessageDialog dialog0(msg, _("Keep the old one"), _("Keep the new one")); int choice = dialog0.runModal(); if (choice == GUI::kMessageCancel) { diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 00f7112c05..5b42c9340e 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -23,6 +23,7 @@ #include "common/endian.h" #include "common/util.h" #include "common/textconsole.h" +#include "common/translation.h" #include "sword1/logic.h" #include "sword1/text.h" @@ -1629,7 +1630,7 @@ int Logic::fnRestartGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) { if (SwordEngine::_systemVars.isDemo) { - GUI::MessageDialog dialog("This is the end of the Broken Sword 1 Demo", "OK", NULL); + GUI::MessageDialog dialog(_("This is the end of the Broken Sword 1 Demo"), _("OK"), NULL); dialog.runModal(); Engine::quitGame(); } else diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 11ee4a98fd..133abf165e 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -26,6 +26,7 @@ #include "common/mutex.h" #include "common/system.h" #include "common/textconsole.h" +#include "common/translation.h" #include "sword2/sword2.h" #include "sword2/defs.h" @@ -359,7 +360,6 @@ uint32 DXADecoderWithSound::getElapsedTime() const { MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *snd, OSystem *system) { Common::String filename; - char buf[60]; Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle; filename = Common::String::format("%s.smk", name); @@ -376,7 +376,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s DXADecoderWithSound *dxaDecoder = new DXADecoderWithSound(snd, bgSoundHandle); return new MoviePlayer(vm, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA); #else - GUI::MessageDialog dialog("DXA cutscenes found but ScummVM has been built without zlib support", "OK"); + GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib support"), _("OK")); dialog.runModal(); return NULL; #endif @@ -386,7 +386,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s filename = Common::String::format("%s.mp2", name); if (Common::File::exists(filename)) { - GUI::MessageDialog dialog("MPEG2 cutscenes are no longer supported", "OK"); + GUI::MessageDialog dialog(_("MPEG2 cutscenes are no longer supported"), _("OK")); dialog.runModal(); return NULL; } @@ -394,8 +394,8 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s // The demo tries to play some cutscenes that aren't there, so make those warnings more discreet. // In addition, some of the later re-releases of the game don't have the "eye" Virgin logo movie. if (!vm->_logic->readVar(DEMO) && strcmp(name, "eye") != 0) { - sprintf(buf, "Cutscene '%s' not found", name); - GUI::MessageDialog dialog(buf, "OK"); + Common::String buf = Common::String::format(_("Cutscene '%s' not found"), name); + GUI::MessageDialog dialog(buf, _("OK")); dialog.runModal(); } else warning("Cutscene '%s' not found", name); diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index caaf9a13f8..1244168a21 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -34,6 +34,7 @@ #include "common/serializer.h" #include "common/savefile.h" #include "common/textconsole.h" +#include "common/translation.h" #include "gui/message.h" @@ -464,7 +465,7 @@ static bool DoRestore() { delete f; if (failed) { - GUI::MessageDialog dialog("Failed to load game state from file."); + GUI::MessageDialog dialog(_("Failed to load game state from file.")); dialog.runModal(); } @@ -542,7 +543,7 @@ save_failure: _vm->getSaveFileMan()->removeSavefile(SaveSceneName); SaveSceneName = NULL; // Invalidate save name } - GUI::MessageDialog dialog("Failed to save game state to file."); + GUI::MessageDialog dialog(_("Failed to save game state to file.")); dialog.runModal(); } diff --git a/po/POTFILES b/po/POTFILES index 3d8c268335..323e50e8e4 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -21,6 +21,7 @@ common/util.cpp engines/advancedDetector.cpp engines/dialogs.cpp +engines/engine.cpp engines/scumm/dialogs.cpp engines/scumm/help.cpp engines/scumm/scumm.cpp @@ -30,6 +31,21 @@ engines/mohawk/riven.cpp engines/cruise/menu.cpp engines/sci/engine/kfile.cpp engines/agos/saveload.cpp +engines/agos/animation.cpp +engines/gob/inter_playtoons.cpp +engines/gob/inter_v2.cpp +engines/gob/inter_v5.cpp +engines/groovie/script.cpp +engines/kyra/sound_midi.cpp +engines/m4/m4_menus.cpp +engines/sky/compact.cpp +engines/sword1/animation.cpp +engines/sword1/control.cpp +engines/sword1/logic.cpp +engines/sword1/sword1.cpp +engines/sword2/animation.cpp +engines/tinsel/saveload.cpp +engines/parallaction/saveload.cpp audio/fmopl.cpp audio/mididrv.cpp @@ -58,5 +74,6 @@ backends/platform/wince/CEActionsPocket.cpp backends/platform/wince/CEActionsSmartphone.cpp backends/platform/wince/CELauncherDialog.cpp backends/platform/wince/wince-sdl.cpp +backends/events/default/default-events.cpp backends/events/gph/gph-events.cpp backends/events/openpandora/op-events.cpp -- cgit v1.2.3 From c01141a144e5426288a39dfe0f1c0b3fb9882412 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 Jun 2011 22:21:43 +0100 Subject: SCUMM: Change MessageDialog button label for consistency Everywhere else the 'OK' button label is all upper case and here was the only place where it was not (it was 'Ok'). --- engines/scumm/scumm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 51888de574..0a5338374e 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1769,7 +1769,7 @@ void ScummEngine::setupMusic(int midi) { Common::String::format( _("Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead."), fileName.c_str()), - _("Ok")); + _("OK")); dialog.runModal(); _musicType = MDT_ADLIB; } -- cgit v1.2.3 From 2d3a915994d5a48eb87d25897a42d35fced68e90 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 Jun 2011 22:39:30 +0100 Subject: I18N: Update translation template file from source code --- po/scummvm.pot | 320 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 265 insertions(+), 55 deletions(-) diff --git a/po/scummvm.pot b/po/scummvm.pot index 5c0f98e3ce..39c80538d8 100644 --- a/po/scummvm.pot +++ b/po/scummvm.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.4.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,10 @@ msgstr "" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "" @@ -82,7 +85,14 @@ msgstr "" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "" @@ -421,7 +431,7 @@ msgstr "" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "" @@ -434,16 +444,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "" @@ -1075,31 +1085,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1145,12 +1155,19 @@ msgstr "" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1165,6 +1182,40 @@ msgstr "" msgid "~K~eys" msgstr "" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +msgid "Could not switch to video mode: '" +msgstr "" + +#: engines/engine.cpp:237 +msgid "Could not apply aspect ratio setting." +msgstr "" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "" @@ -1232,6 +1283,7 @@ msgstr "" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "" @@ -1696,7 +1748,14 @@ msgstr "" msgid "Fly to lower right" msgstr "" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1704,7 +1763,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1712,7 +1771,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1720,7 +1779,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1755,6 +1814,133 @@ msgstr "" msgid "Restore" msgstr "" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +msgid "Failed to load game state from file." +msgstr "" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +msgid "Failed to save game state to file." +msgstr "" + +#: engines/gob/inter_v5.cpp:107 +msgid "Failed to delete file." +msgstr "" + +#: engines/groovie/script.cpp:417 +msgid "Failed to save game" +msgstr "" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +msgid "Save game failed!" +msgstr "" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +msgid "Loading game..." +msgstr "" + +#: engines/parallaction/saveload.cpp:226 +msgid "Saving game..." +msgstr "" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "" @@ -1763,17 +1949,31 @@ msgstr "" msgid "DOSBox OPL emulator" msgstr "" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 +#, c-format +msgid "" +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1905,6 +2105,14 @@ msgstr "" msgid "Disable power off" msgstr "" +#: backends/platform/iphone/osys_events.cpp:338 +msgid "Mouse-click-and-drag mode enabled." +msgstr "" + +#: backends/platform/iphone/osys_events.cpp:340 +msgid "Mouse-click-and-drag mode disabled." +msgstr "" + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "" @@ -2225,13 +2433,13 @@ msgstr "" msgid "Cursor Right" msgstr "" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr "" @@ -2255,75 +2463,77 @@ msgstr "" msgid "Do you want to perform an automatic scan ?" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +msgid "Do you really want to return to the Launcher?" +msgstr "" + +#: backends/events/default/default-events.cpp:222 +msgid "Launcher" +msgstr "" + +#: backends/events/default/default-events.cpp:244 +msgid "Do you really want to quit?" +msgstr "" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 msgid "Maximum Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 msgid "Minimal Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" -- cgit v1.2.3 From f932a11587ca9abdb100972e3f9db0fc18a08819 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 13 Jun 2011 22:39:59 +0100 Subject: I18N: Update translation files from template --- po/ca_ES.po | 345 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/cs_CZ.po | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- po/da_DA.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/de_DE.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/es_ES.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/fr_FR.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/hu_HU.po | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- po/it_IT.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/nb_NO.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/nn_NO.po | 329 +++++++++++++++++++++++++++++++++++++++++++++---------- po/pl_PL.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/pt_BR.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/ru_RU.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/se_SE.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- po/uk_UA.po | 346 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 15 files changed, 4359 insertions(+), 829 deletions(-) diff --git a/po/ca_ES.po b/po/ca_ES.po index a6c2188e85..ce4c1db140 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2010-09-21 23:12+0100\n" "Last-Translator: Jordi Vilalta Prat \n" "Language-Team: Catalan \n" @@ -45,7 +45,10 @@ msgstr "Amunt" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Cancel·la" @@ -82,7 +85,14 @@ msgstr "Mapeja" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "D'acord" @@ -428,7 +438,7 @@ msgstr "Carrega partida:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Carrega" @@ -443,16 +453,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Sí" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "No" @@ -1109,31 +1119,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Àmbar" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1179,12 +1189,19 @@ msgstr "Desa la partida:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Desa" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1199,6 +1216,42 @@ msgstr "~C~ancel msgid "~K~eys" msgstr "~T~ecles" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Mode de vídeo actual:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Correcció de la relació d'aspecte" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1272,6 +1325,7 @@ msgstr "Desa la partida:" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Surt" @@ -1750,7 +1804,14 @@ msgstr "" msgid "Fly to lower right" msgstr "" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1761,7 +1822,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1772,7 +1833,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1783,7 +1844,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1818,6 +1879,152 @@ msgstr "Desa la partida:" msgid "Restore" msgstr "Restaura" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"No s'ha pogut carregar l'estat del joc del fitxer:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"No s'ha pogut desar l'estat del joc al fitxer:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"No s'ha pogut desar l'estat del joc al fitxer:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"No s'ha pogut desar l'estat del joc al fitxer:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Desa la partida:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Carrega partida:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Desa la partida:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Emulador OPL de MAME" @@ -1826,17 +2033,31 @@ msgstr "Emulador OPL de MAME" msgid "DOSBox OPL emulator" msgstr "Emulador OPL DOSBox" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 +#, c-format +msgid "" +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 +#, c-format +msgid "" +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1969,6 +2190,16 @@ msgstr "Alta qualitat d' msgid "Disable power off" msgstr "Desactiva l'apagat automàtic" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Mode Touchpad activat." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Mode Touchpad desactivat." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Mode Touchpad activat." @@ -2295,13 +2526,13 @@ msgstr "Cursor Esquerra" msgid "Cursor Right" msgstr "Cursor Dreta" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Voleu carregar o desar el joc?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Esteu segur de voler sortir? " @@ -2325,78 +2556,82 @@ msgstr "Pantalla " msgid "Do you want to perform an automatic scan ?" msgstr "Voleu fer una cerca automàtica?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Realment voleu suprimir aquesta partida?" + +#: backends/events/default/default-events.cpp:222 +msgid "Launcher" +msgstr "" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Vols sortir?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index 6184e3686b..b87fe54a2f 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-06-07 16:23+0100\n" "Last-Translator: Zbynìk Schwarz \n" "Language-Team: \n" @@ -49,7 +49,10 @@ msgstr "J #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Zru¹it" @@ -86,7 +89,14 @@ msgstr "Mapovat" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -427,7 +437,7 @@ msgstr "Nahr #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Nahrát" @@ -442,16 +452,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ano" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Ne" @@ -1091,20 +1101,20 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Jantarová" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "Hra v '%s' se zdá být neznámá." -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "Prosím nahlaste následující data týmu ScummVM spolu se jménem" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "hry, kterou jste se pokusili pøidat a její verzi/jazyk/atd.:" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" @@ -1113,11 +1123,11 @@ msgstr "" "Bylo zji¹tìno, ¾e Va¹e verze hry pou¾ívá jméno souboru shodující se s " "variantou %s." -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "Pokud je toto pùvodní a nezmìnìná verze, ohlaste prosím jakékoli" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "pøede¹le vypsané informace od ScummVM zpátky týmu." @@ -1163,12 +1173,19 @@ msgstr "Ulo #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Ulo¾it" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1183,6 +1200,42 @@ msgstr "~Z~ru msgid "~K~eys" msgstr "~K~lávesy" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Souèasný re¾im obrazu:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Povolena korekce pomìru stran" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~øedchozí" @@ -1250,6 +1303,7 @@ msgstr "Ulo #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Ukonèit" @@ -1714,7 +1768,14 @@ msgstr "Let msgid "Fly to lower right" msgstr "Letìt doprava dolù" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1725,7 +1786,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1736,7 +1797,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1747,7 +1808,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1785,6 +1846,152 @@ msgstr "Obnovit hru" msgid "Restore" msgstr "Obnovit" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Nahrání stavu hry selhalo ze souboru:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Ulo¾ení stavu hry selhalo do souboru:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Ulo¾ení stavu hry selhalo do souboru:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Ulo¾ení stavu hry selhalo do souboru:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Ulo¾it hru:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Nahrát hru:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Ulo¾it hru:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL Emulátor" @@ -1793,19 +2000,37 @@ msgstr "MAME OPL Emul msgid "DOSBox OPL emulator" msgstr "DOSBox OPL Emulátor" -#: audio/mididrv.cpp:206 -#, c-format +#: audio/mididrv.cpp:204 +#, fuzzy, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" +"Nelze zjistit zvolené zvukové zaøízení '%s'. Podívejte se na záznam pro více " +"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." + +#: audio/mididrv.cpp:216 +#, fuzzy, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" "Nelze zjistit zvolené zvukové zaøízení '%s'. Podívejte se na záznam pro více " "informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." -#: audio/mididrv.cpp:246 -#, c-format +#: audio/mididrv.cpp:250 +#, fuzzy, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" +"Nelze zjistit upøednostòované zaøízení '%s'. Podívejte se na záznam pro více " +"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." + +#: audio/mididrv.cpp:265 +#, fuzzy, c-format +msgid "" +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" "Nelze zjistit upøednostòované zaøízení '%s'. Podívejte se na záznam pro více " @@ -1939,6 +2164,16 @@ msgstr "Vysok msgid "Disable power off" msgstr "Zakázat vypnutí" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Touchpad re¾im zapnut" + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Touchpad re¾im vypnut" + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Touchpad re¾im zapnut" @@ -2259,13 +2494,13 @@ msgstr " msgid "Cursor Right" msgstr "©ipka Doprava" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Chcete hru nahrát nebo ulo¾it?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Jste si jisti, ¾e chcete odejít ? " @@ -2289,82 +2524,87 @@ msgstr "Displej" msgid "Do you want to perform an automatic scan ?" msgstr "Chcete provést automatické hledání?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Mapovat èinnost pravé kliknutí" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Musíte namapovat klávesu pro èinnost 'Pravé Kliknutí', abyste tuto hru mohli " "hrát" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Mapovat èinnost skrýt panel nástrojù" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Musíte namapovat klávesu pro èinnost 'Skrýt Panel nástrojù', abyste tuto hru " "mohli hrát" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Namapovat èinnost Pøiblí¾it Nahoru (nepovinné)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Namapovat èinnost Pøiblí¾it Dolù (nepovinné)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Nezapomeòte namapovat klávesu k èinnosti 'Skrýt Panel Nástrojù, abyste " "vidìli celý inventáø" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Opravdu chcete tuto ulo¾enou hru vymazat" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Udeøit" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Chcete ukonèit?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Levé Kliknutí" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Pravé Kliknutí" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "'Re¾im «uknutí' Dotykové Obrazovky - Najetí (Bez Kliknutí)" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 msgid "Maximum Volume" msgstr "Maximální Hlasitost" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "Zvy¹uji Hlasitost" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 msgid "Minimal Volume" msgstr "Minimální Hlasitost" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "Sni¾uji Hlasitost" diff --git a/po/da_DA.po b/po/da_DA.po index 3c5d8c98ef..1d9acf76f5 100644 --- a/po/da_DA.po +++ b/po/da_DA.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-01-08 22:53+0100\n" "Last-Translator: Steffen Nyeland \n" "Language-Team: Steffen Nyeland \n" @@ -45,7 +45,10 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Fortryd" @@ -82,7 +85,14 @@ msgstr "Kortl #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -425,7 +435,7 @@ msgstr "Indl #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Indlæs" @@ -440,16 +450,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ja" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nej" @@ -1096,31 +1106,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules brun" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1166,12 +1176,19 @@ msgstr "Gemmer:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Gem" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1186,6 +1203,42 @@ msgstr "~F~ortryd" msgid "~K~eys" msgstr "~T~aster" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Aktuel videotilstand:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Skift billedformat korrektion" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "Fo~r~rige" @@ -1253,6 +1306,7 @@ msgstr "Gem spil tilstand 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Afslut" @@ -1718,7 +1772,14 @@ msgstr "Flyv til h msgid "Fly to lower right" msgstr "Flyv nederst til højre" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1729,7 +1790,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1740,7 +1801,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1751,7 +1812,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1786,6 +1847,152 @@ msgstr "Gendan spil:" msgid "Restore" msgstr "Gendan" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Mislykkedes at hente spil tilstand fra fil:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Mislykkedes at gemme spil tilstand til fil:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Mislykkedes at gemme spil tilstand til fil:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Mislykkedes at gemme spil tilstand til fil:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Gemmer:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Indlæs spil:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Gemmer:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL emulator" @@ -1794,17 +2001,31 @@ msgstr "MAME OPL emulator" msgid "DOSBox OPL emulator" msgstr "DOSBox OPL emulator" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1937,6 +2158,16 @@ msgstr "H msgid "Disable power off" msgstr "Deaktiver slukning" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Pegeplade tilstand aktiveret." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Pegeplade tilstand deaktiveret." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Pegeplade tilstand aktiveret." @@ -2264,13 +2495,13 @@ msgstr "Pil til venstre" msgid "Cursor Right" msgstr "Pil til højre" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Vil du hente eller gemme spillet?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Er du sikker på at du vil afslutte ? " @@ -2294,83 +2525,88 @@ msgstr "Vis" msgid "Do you want to perform an automatic scan ?" msgstr "Vil du udføre en automatisk skanning ?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Tildel højreklikshandling" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Du skal tildele en tast til 'Højreklik' handlingen for at spille dette spil" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Tildel \"skjul værktøjslinje\" handling" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Du skal tildele en tast til 'Skjul værktøjslinje' handlingen for at spille " "dette spil" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Tildel Formindsk handling (valgfri)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Tildel Forstør handling (valgfri)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Glem ikke at tildele en tast til 'Skjul værktøjslinje' handling for at se " "hele oversigten" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Vil du virkelig slette denne gemmer?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Slag" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Vil du afslutte?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Lydstyrke" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Lydstyrke" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/de_DE.po b/po/de_DE.po index 79e1d2d0c3..154c529984 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-04-24 12:35+0100\n" "Last-Translator: Simon Sawatzki \n" "Language-Team: Lothar Serra Mari & Simon Sawatzki " @@ -47,7 +47,10 @@ msgstr "Pfad hoch" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Abbrechen" @@ -84,7 +87,14 @@ msgstr "Zuweisen" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -429,7 +439,7 @@ msgstr "Spiel laden:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Laden" @@ -444,16 +454,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ja" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nein" @@ -1106,31 +1116,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules-Gelb" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1176,12 +1186,19 @@ msgstr "Speichern:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Speichern" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1196,6 +1213,42 @@ msgstr "~A~bbrechen" msgid "~K~eys" msgstr "~T~asten" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Aktueller Videomodus:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Seitenverhältnis anpassen: an/aus" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~Z~urück" @@ -1263,6 +1316,7 @@ msgstr "Spielstand 1-10 speichern" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Beenden" @@ -1728,7 +1782,14 @@ msgstr "Nach rechts fliegen" msgid "Fly to lower right" msgstr "Nach unten rechts fliegen" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1739,7 +1800,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1750,7 +1811,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1761,7 +1822,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1800,6 +1861,152 @@ msgstr "Spiel laden:" msgid "Restore" msgstr "Laden" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Konnte Spielstand nicht aus folgender Datei laden:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Konnte Spielstand nicht in folgender Datei speichern:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Konnte Spielstand nicht in folgender Datei speichern:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Konnte Spielstand nicht in folgender Datei speichern:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Speichern:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Spiel laden:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Speichern:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME-OPL-Emulator" @@ -1808,17 +2015,31 @@ msgstr "MAME-OPL-Emulator" msgid "DOSBox OPL emulator" msgstr "DOSBox-OPL-Emulator" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1951,6 +2172,16 @@ msgstr "Hohe Audioqualit msgid "Disable power off" msgstr "Stromsparmodus abschalten" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Touchpad-Modus aktiviert." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Touchpad-Modus ausgeschaltet." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Touchpad-Modus aktiviert." @@ -2278,13 +2509,13 @@ msgstr "Zeiger nach links" msgid "Cursor Right" msgstr "Zeiger nach rechts" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Möchten Sie ein Spiel laden oder speichern?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Möchten Sie wirklich beenden? " @@ -2308,84 +2539,89 @@ msgstr "Anzeige " msgid "Do you want to perform an automatic scan ?" msgstr "Möchten Sie eine automatische Suche durchführen?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Aktion \"Rechtsklick\" zuweisen" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Sie müssen der Aktion \"Rechtsklick\" eine Taste zuweisen, um dieses Spiel " "spielen zu können." -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Aktion \"Werkzeugleiste verbergen\" zuweisen" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Sie müssen der Aktion \"Werkzeugleiste verbergen\" eine Taste zuweisen, um " "dieses Spiel spielen zu können." -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Aktion \"Herauszoomen\" zuweisen (optional)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Aktion \"Hineinzoomen\" zuweisen (optional)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Vergessen Sie nicht, der Aktion \"Werkzeugleiste verbergen\" eine Taste " "zuzuweisen, um das ganze Inventar sehen zu können." -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Diesen Spielstand wirklich löschen?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Schlage" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Möchten Sie beenden?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Lautstärke" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Lautstärke" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index b19a25a48f..0f76d38917 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-05-08 13:31+0100\n" "Last-Translator: Tomás Maidagan\n" "Language-Team: \n" @@ -45,7 +45,10 @@ msgstr "Arriba" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Cancelar" @@ -82,7 +85,14 @@ msgstr "Asignar" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "Aceptar" @@ -425,7 +435,7 @@ msgstr "Cargar juego:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Cargar" @@ -440,16 +450,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Sí" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "No" @@ -1097,31 +1107,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ámbar" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1167,12 +1177,19 @@ msgstr "Guardar partida" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Guardar" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1187,6 +1204,42 @@ msgstr "~C~ancelar" msgid "~K~eys" msgstr "~T~eclas" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Modo de vídeo actual:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Corrección de aspecto" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1254,6 +1307,7 @@ msgstr "Guardar partida 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Salir" @@ -1719,7 +1773,14 @@ msgstr "Volar a la derecha" msgid "Fly to lower right" msgstr "Volar abajo y a la derecha" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1730,7 +1791,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1741,7 +1802,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1752,7 +1813,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1790,6 +1851,152 @@ msgstr "Cargar partida:" msgid "Restore" msgstr "Cargar" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Fallo al cargar desde el archivo:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Fallo al guardar en el archivo:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Fallo al guardar en el archivo:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Fallo al guardar en el archivo:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Guardar partida" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Cargar juego:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Guardar partida" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Emulador OPL de MAME" @@ -1798,17 +2005,31 @@ msgstr "Emulador OPL de MAME" msgid "DOSBox OPL emulator" msgstr "Emulador OPL de DOSBox" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1941,6 +2162,16 @@ msgstr "Sonido de alta calidad (m msgid "Disable power off" msgstr "Desactivar apagado" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Modo Touchpad activado." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Modo Touchpad desactivado." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Modo Touchpad activado." @@ -2268,13 +2499,13 @@ msgstr "Izquierda" msgid "Cursor Right" msgstr "Derecha" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "¿Quieres cargar o guardar el juego?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr "¿Seguro que quieres salir?" @@ -2298,83 +2529,88 @@ msgstr "Pantalla" msgid "Do you want to perform an automatic scan ?" msgstr "¿Quieres realizar una búsqueda automática?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Asignar acción 'Clic derecho'" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Debes asignar una tecla a la acción 'Clic derecho' para jugar a este juego" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Asignar acción 'Ocultar barra de tareas'" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Debes asignar una tecla a la acción 'Ocultar barra de tareas' para jugar a " "este juego" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Asignar acción 'Zoom' (opcional)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Asignar acción 'Disminuir zoom' (opcional)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "No olvides asignar una tecla a la acción 'Ocultar barra de tareas' para ver " "todo el inventario" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "¿Seguro que quieres borrar esta partida?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Puñetazo" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "¿Quieres salir?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volumen" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volumen" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/fr_FR.po b/po/fr_FR.po index a1274a2cf9..1dca127df8 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-05-02 19:50+0100\n" "Last-Translator: Thierry Crozat \n" "Language-Team: French \n" @@ -46,7 +46,10 @@ msgstr "Remonter" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Annuler" @@ -83,7 +86,14 @@ msgstr "Affecter" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -427,7 +437,7 @@ msgstr "Charger le jeu:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Charger" @@ -442,16 +452,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Oui" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Non" @@ -1102,31 +1112,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Ambre" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1172,12 +1182,19 @@ msgstr "Sauvegarde:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Sauver" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1192,6 +1209,42 @@ msgstr "~A~nnuler" msgid "~K~eys" msgstr "~T~ouches" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Mode vidéo actuel" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Changer correction du rapport d'aspect" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~récédent" @@ -1259,6 +1312,7 @@ msgstr " #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Quitter" @@ -1724,7 +1778,14 @@ msgstr "Voler vers la droite" msgid "Fly to lower right" msgstr "Voler vers la bas à droite" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1735,7 +1796,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1746,7 +1807,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1757,7 +1818,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1796,6 +1857,152 @@ msgstr "Charger le jeu:" msgid "Restore" msgstr "Charger" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Échec du chargement de l'état du jeu depuis le fichier:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Échec de l'enregistrement de l'état du jeu dans le fichier:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Échec de l'enregistrement de l'état du jeu dans le fichier:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Échec de l'enregistrement de l'état du jeu dans le fichier:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Sauvegarde:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Charger le jeu:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Sauvegarde:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Émulateur MAME OPL" @@ -1804,17 +2011,31 @@ msgstr " msgid "DOSBox OPL emulator" msgstr "Émulateur DOSBox OPL" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1947,6 +2168,16 @@ msgstr "Audio haute qualit msgid "Disable power off" msgstr "Désactivé l'extinction" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Mode touchpad activé" + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Mode touchpad désactivé" + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Mode touchpad activé" @@ -2274,13 +2505,13 @@ msgstr "Gauche" msgid "Cursor Right" msgstr "Droit" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Voulez-vous charger ou enregistrer le jeu?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr "Voulez-vous vraiment quitter?" @@ -2304,84 +2535,89 @@ msgstr "Affichage" msgid "Do you want to perform an automatic scan ?" msgstr "Voulez-vous exécuter une recherche automatique?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Affecter l'action 'Clic Droit'" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Vous devez affecter une touche à l'action de 'Clic Droit' pour pouvoir jouer " "à ce jeu" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Affecter l'action 'Cacher Bar d'Outils'" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Vous devez affecter une touche à l'action 'Cacher Bar d'Outils' pour pouvoir " "jouer à ce jeu" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Affecter l'action 'Dézoomer' (optionnelle)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Affecter l'action 'Zoomer' (optionnelle)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Noubliez pas d'affecter une touche à l'action 'Cacher Bar d'Outils' pour " "pouvoir voir entièrement l'inventaire" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Voulez-vous vraiment supprimer cette sauvegarde?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Frapper" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Voulez-vous quitter?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/hu_HU.po b/po/hu_HU.po index d3ee99d0fc..d392369220 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-06-12 07:17+0100\n" "Last-Translator: Gruby \n" "Language-Team: Hungarian\n" @@ -49,7 +49,10 @@ msgstr "Feljebb" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Mégse" @@ -86,7 +89,14 @@ msgstr "Kioszt #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -427,7 +437,7 @@ msgstr "J #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Betöltés" @@ -442,16 +452,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Igen" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nem" @@ -1090,31 +1100,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Sárga" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "A '%s' játék ismeretlennek tûnik." -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "Kérlek jelezd a ScummVM csapatnak a következõ adatokat, együtt a játék" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "címével és megbízható adataival játékverzió/nyelv(ek)/stb.:" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "A felismert játékverziód a használt fájlnévvel a %s egy változata." -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "Ha ez egy eredeti nem változtatott verzió, kérlek jelezd minden" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "elõzõleg kiírt információt a ScummVM csapatnak." @@ -1160,12 +1170,19 @@ msgstr "J #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Mentés" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1180,6 +1197,42 @@ msgstr "M msgid "~K~eys" msgstr "Billentyük" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Jelenlegi videómód:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Méretarány korrekció engedélyezve" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "Elõzõ" @@ -1247,6 +1300,7 @@ msgstr "1-10 J #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Kilépés" @@ -1711,7 +1765,14 @@ msgstr "Jobbra rep msgid "Fly to lower right" msgstr "Jobbra le repülés" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1722,7 +1783,7 @@ msgstr "" "\n" "%s fájlba nem sikerült" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1733,7 +1794,7 @@ msgstr "" "\n" "%s fájlból nem sikerült" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1744,7 +1805,7 @@ msgstr "" "\n" "%s fájlba elkészült" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1782,6 +1843,152 @@ msgstr "J msgid "Restore" msgstr "Visszaállítás" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Játékállás betöltése:\n" +"\n" +"%s fájlból nem sikerült" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Játékállás mentése:\n" +"\n" +"%s fájlba nem sikerült" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Játékállás mentése:\n" +"\n" +"%s fájlba nem sikerült" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Játékállás mentése:\n" +"\n" +"%s fájlba nem sikerült" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Játék mentése:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Játék betöltése:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Játék mentése:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL emulátor" @@ -1790,19 +1997,37 @@ msgstr "MAME OPL emul msgid "DOSBox OPL emulator" msgstr "DOSBox OPL emulátor" -#: audio/mididrv.cpp:206 -#, c-format +#: audio/mididrv.cpp:204 +#, fuzzy, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" +"A '%s' kiválasztott hangeszköz nem elérhetõ. Bõvebb információ a " +"naplófájlban. Következõ elérhetõ eszköz keresése..." + +#: audio/mididrv.cpp:216 +#, fuzzy, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" "A '%s' kiválasztott hangeszköz nem elérhetõ. Bõvebb információ a " "naplófájlban. Következõ elérhetõ eszköz keresése..." -#: audio/mididrv.cpp:246 -#, c-format +#: audio/mididrv.cpp:250 +#, fuzzy, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" +"A '%s' elsõdleges hangeszköz nem elérhetõ. Bõvebb információ a naplófájlban. " +"Következõ elérhetõ eszköz keresése..." + +#: audio/mididrv.cpp:265 +#, fuzzy, c-format +msgid "" +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" "A '%s' elsõdleges hangeszköz nem elérhetõ. Bõvebb információ a naplófájlban. " @@ -1936,6 +2161,16 @@ msgstr "J msgid "Disable power off" msgstr "Leállítás tiltva" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Touchpad mód engedélyezve." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Touchpad mód letiltva." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Touchpad mód engedélyezve." @@ -2256,13 +2491,13 @@ msgstr "Kurzor Bal" msgid "Cursor Right" msgstr "Kurzor Jobb" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Játékállás betöltése vagy mentése?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Biztos hogy ki akarsz lépni ? " @@ -2286,78 +2521,83 @@ msgstr "Kijelz msgid "Do you want to perform an automatic scan ?" msgstr "El akarod kezdeni az automatikus vizsgálatot ?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Jobbkatt mûvelet gomb" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "Válassz egy billentyût a 'Jobbkatt' mûvelethez" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Eszköztár rejtés gomb" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "Válassz egy billentyût az 'Eszköztár rejtés' mûvelethez" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Nagyítás mûvelet (opcionális)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Kicsinyítés mûvelet (opcionális)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Ne felejts billentyût társítani az 'Eszköztár rejtés' mûvelethez, hogy lásd " "a teljes listát" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Biztos hogy törölni akarod ezt a játékállást?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Megüt" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Ki akarsz lépni ?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "Érintõképernyõ 'Tap Mód' - Bal katt" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "Érintõképernyõ 'Tap Mód' - Jobb katt" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "Érintõképernyõ 'Tap Mód' - Lebegõ (Nincs katt)" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 msgid "Maximum Volume" msgstr "Maximum Hangerõ" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "Hangerõ növelése" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 msgid "Minimal Volume" msgstr "Minimum Hangerõ" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "Hangerõ csökkentése" diff --git a/po/it_IT.po b/po/it_IT.po index 2d31e1ab6a..24f09e349f 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-04-24 14:46+0100\n" "Last-Translator: Matteo 'Maff' Angelino \n" "Language-Team: Italian\n" @@ -45,7 +45,10 @@ msgstr "Su" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Annulla" @@ -82,7 +85,14 @@ msgstr "Mappa" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -424,7 +434,7 @@ msgstr "Carica gioco:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Carica" @@ -439,16 +449,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Sì" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "No" @@ -1098,31 +1108,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ambra" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1168,12 +1178,19 @@ msgstr "Salva gioco:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Salva" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1188,6 +1205,42 @@ msgstr "~A~nnulla" msgid "~K~eys" msgstr "~T~asti" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Modalità video attuale:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Cambia correzione proporzioni" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~recedenti" @@ -1255,6 +1308,7 @@ msgstr "Salva nella posizione 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Esci" @@ -1720,7 +1774,14 @@ msgstr "Vola a destra" msgid "Fly to lower right" msgstr "Vola in basso a destra" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1731,7 +1792,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1742,7 +1803,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1753,7 +1814,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1792,6 +1853,152 @@ msgstr "Ripristina gioco:" msgid "Restore" msgstr "Ripristina" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Impossibile caricare il gioco dal file:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Impossibile salvare il gioco nel file:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Impossibile salvare il gioco nel file:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Impossibile salvare il gioco nel file:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Salva gioco:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Carica gioco:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Salva gioco:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Emulatore OPL MAME" @@ -1800,17 +2007,31 @@ msgstr "Emulatore OPL MAME" msgid "DOSBox OPL emulator" msgstr "Emulatore OPL DOSBox" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1943,6 +2164,16 @@ msgstr "Audio ad alta qualit msgid "Disable power off" msgstr "Disattiva spegnimento in chiusura" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Modalità touchpad attivata." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Modalità touchpad disattivata." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Modalità touchpad attivata." @@ -2270,13 +2501,13 @@ msgstr "Cursore a sinistra" msgid "Cursor Right" msgstr "Cursore a destra" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Vuoi caricare o salvare il gioco?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Sei sicuro di voler uscire? " @@ -2300,82 +2531,87 @@ msgstr "Visualizza " msgid "Do you want to perform an automatic scan ?" msgstr "Vuoi eseguire una scansione automatica?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Mappa l'azione del tasto destro" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "Devi mappare un tasto per l'azione \"Tasto destro\" per giocare" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Mappa l'azione nascondi barra degli strumenti" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Devi mappare un tasto per l'azione \"Nascondi barra degli strumenti\" per " "giocare" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Mappa l'azione Zoom Up (opzionale)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Mappa l'azione Zoom Down (opzionale)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Non dimenticare di mappare un tasto per l'azione \"Nascondi barra degli " "strumenti\" per vedere l'intero inventario" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Sei sicuro di voler eliminare questo salvataggio?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Pugno" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Sei sicuro di voler uscire?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index fcecbed832..3afebc96d9 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-04-25 22:56+0100\n" "Last-Translator: Einar Johan T. Sømåen \n" "Language-Team: somaen \n" @@ -49,7 +49,10 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Avbryt" @@ -86,7 +89,14 @@ msgstr "Koble" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -429,7 +439,7 @@ msgstr " #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Åpne" @@ -444,16 +454,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ja" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nei" @@ -1093,31 +1103,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Oransje" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1163,12 +1173,19 @@ msgstr "Lagret spill:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Lagre" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1183,6 +1200,42 @@ msgstr "~A~vbryt" msgid "~K~eys" msgstr "~T~aster" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Nåværende videomodus:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Veksle aspekt-rate korrigering" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~orrige" @@ -1250,6 +1303,7 @@ msgstr "Lagre spilltilstand 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Avslutt" @@ -1715,7 +1769,14 @@ msgstr "Fly til h msgid "Fly to lower right" msgstr "Fly til nedre høyre" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1726,7 +1787,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1737,7 +1798,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1748,7 +1809,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1786,6 +1847,152 @@ msgstr "Gjennopprett spill:" msgid "Restore" msgstr "Gjenopprett" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Klarte ikke åpne spilltilstand fra fil:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Klarte ikke lagre spilltilstand til fil:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Klarte ikke lagre spilltilstand til fil:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Klarte ikke lagre spilltilstand til fil:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Lagret spill:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Åpne spill:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Lagret spill:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL emulator" @@ -1794,17 +2001,31 @@ msgstr "MAME OPL emulator" msgid "DOSBox OPL emulator" msgstr "DOSBox OPL emulator" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1937,6 +2158,16 @@ msgstr "H msgid "Disable power off" msgstr "Deaktiver strømsparing" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Touchpad-modus aktivert." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Touchpad-modus deaktivert." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Touchpad-modus aktivert." @@ -2265,13 +2496,13 @@ msgstr "Peker venstre" msgid "Cursor Right" msgstr "Peker høyre" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Vil du åpne eller lagre spillet?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Er du sikker på at du vil avslutte ?" @@ -2295,83 +2526,88 @@ msgstr "Skjerm" msgid "Do you want to perform an automatic scan ?" msgstr "Vil du utføre et automatisk søk?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Koble handling til høyreklikk" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Du må koble en tast til handlingen 'Høyreklikk' for å spille dette spillet" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Koble skjul-verktøylinje-handlingen" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Du må koble en tast til 'Skjul verktøylinje'-handlingen for å spille dette " "spillet" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Koble handlingen Zoom Opp (valgfritt)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Koble handlingen Zoom Ned (valgfritt)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Ikke glem å koble en tast til handlingen 'Skjul verktøylinje' for å se hele " "inventaret" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Vil du virkelig slette dette lagrede spillet?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Slå" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Vil du avslutte?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/nn_NO.po b/po/nn_NO.po index 5e1083f93d..9eecf8b6b5 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-04-25 23:07+0100\n" "Last-Translator: Einar Johan T. Sømåen \n" "Language-Team: somaen \n" @@ -49,7 +49,10 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Avbryt" @@ -86,7 +89,14 @@ msgstr "Kople" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -429,7 +439,7 @@ msgstr " #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Åpne" @@ -442,16 +452,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ja" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nei" @@ -1091,31 +1101,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Raudgul" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1163,12 +1173,19 @@ msgstr "Lagra spel:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Lagre" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1183,6 +1200,42 @@ msgstr "~A~vbryt" msgid "~K~eys" msgstr "~T~astar" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Gjeldende videomodus:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Veksle aspekt-korrigering" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~orrige" @@ -1250,6 +1303,7 @@ msgstr "Lagre speltilstand 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Avslutt" @@ -1715,7 +1769,14 @@ msgstr "Fly til h msgid "Fly to lower right" msgstr "Fly til nedre høgre" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1723,7 +1784,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1731,7 +1792,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1739,7 +1800,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1777,6 +1838,137 @@ msgstr "Gjenopprett spel:" msgid "Restore" msgstr "Gjenopprett" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +msgid "Failed to load game state from file." +msgstr "" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +msgid "Failed to save game state to file." +msgstr "" + +#: engines/gob/inter_v5.cpp:107 +msgid "Failed to delete file." +msgstr "" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "Full speltittel:" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Lagra spel:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Åpne spel:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Lagra spel:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL emulator" @@ -1785,17 +1977,31 @@ msgstr "MAME OPL emulator" msgid "DOSBox OPL emulator" msgstr "DOSBox OPL emulator" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 +#, c-format +msgid "" +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1928,6 +2134,14 @@ msgstr "" msgid "Disable power off" msgstr "Deaktiver strømsparing" +#: backends/platform/iphone/osys_events.cpp:338 +msgid "Mouse-click-and-drag mode enabled." +msgstr "" + +#: backends/platform/iphone/osys_events.cpp:340 +msgid "Mouse-click-and-drag mode disabled." +msgstr "" + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "" @@ -2255,13 +2469,13 @@ msgstr "Peikar venstre" msgid "Cursor Right" msgstr "Peikar høgre" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Vil du åpne eller lagre spelet?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr "Er du sikker på at du vil avslutte?" @@ -2285,81 +2499,86 @@ msgstr "Skjerm" msgid "Do you want to perform an automatic scan ?" msgstr "Vil du utføre eit automatisk søk?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Kople høgreklikkshandling" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Du må kople ein tast til 'Høgreklikk'-handlinga for å spele dette spelet" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Kople skjul-verktøylinje-handlinga" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "Du må kople ein tast til 'Skjul verktøylinje' for å spele dette spelet" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Kople Zoom Opp-handling (valfri)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Kople Zoom Ned-handling (valfri)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Ikkje gløym å kople ein tast til 'Skjul verktøylinje' for å se heile " "inventaret" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Vil du verkeleg slette det lagra spelet?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Slå" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Vil du avslutte?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volum" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/pl_PL.po b/po/pl_PL.po index 62a49070d1..f591d0065a 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-05-02 12:09+0100\n" "Last-Translator: \n" "Language-Team: Grajpopolsku.pl \n" @@ -49,7 +49,10 @@ msgstr "W g #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Anuluj" @@ -86,7 +89,14 @@ msgstr "Przypisz" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -427,7 +437,7 @@ msgstr "Wczytaj gr #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Wczytaj" @@ -441,16 +451,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Tak" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nie" @@ -1093,31 +1103,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Bursztynowy Hercules" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1163,12 +1173,19 @@ msgstr "Zapis:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Zapisz" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1183,6 +1200,42 @@ msgstr "~A~nuluj" msgid "~K~eys" msgstr "~K~lawisze" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Obecny tryb wideo:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "W³±cz/wy³±cz korekcjê formatu obrazu" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~oprzedni" @@ -1250,6 +1303,7 @@ msgstr "Zapisz stan gry 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Zakoñcz" @@ -1715,7 +1769,14 @@ msgstr "Le msgid "Fly to lower right" msgstr "Leæ w dó³, w prawo" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1726,7 +1787,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1737,7 +1798,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1748,7 +1809,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1786,6 +1847,152 @@ msgstr "Wzn msgid "Restore" msgstr "Wznów" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Nie uda³o siê wczytaæ stanu gry z pliku:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Nie uda³o siê zapisaæ stanu gry do pliku:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Nie uda³o siê zapisaæ stanu gry do pliku:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Nie uda³o siê zapisaæ stanu gry do pliku:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Zapis:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Wczytaj grê:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Zapis:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Emulator OPL MAME" @@ -1794,17 +2001,31 @@ msgstr "Emulator OPL MAME" msgid "DOSBox OPL emulator" msgstr "Emulator OPL DOSBox" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1937,6 +2158,16 @@ msgstr "D msgid "Disable power off" msgstr "Nie wy³±czaj zasilania" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Tryb touchpada w³±czony." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Tryb touchpada wy³±czony." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Tryb touchpada w³±czony." @@ -2264,13 +2495,13 @@ msgstr "Kursor w lewo" msgid "Cursor Right" msgstr "Kursor w prawo" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Chcesz wczytaæ b±d¼ zapisaæ grê?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Na pewno chcesz wyj¶æ? " @@ -2294,80 +2525,85 @@ msgstr "Obraz " msgid "Do you want to perform an automatic scan ?" msgstr "Wykonaæ automatyczne skanowanie?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Przypisz dzia³anie PPM" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "Musisz przypisaæ klawisz do 'PPM', by zagraæ w tê grê" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Przypisz chowanie paska narzêdzi" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "Musisz przypisaæ przycisk 'Schowaj pasek narzêdzi', by zagraæ w tê grê" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Przypisz Przybli¿anie (opcjonalne)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Przypisz Oddalenie (opcjonalne)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Nie zapomnij przypisaæ klawisza 'Ukryj pasek narzêdzi', by widzieæ ca³y " "ekwipunek" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Na pewno chcesz skasowaæ ten zapis?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Piê¶æ" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Chcesz wyj¶æ?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "G³o¶no¶æ" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "G³o¶no¶æ" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 491bc286da..a9a0d1412d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-05-03 19:11-0300\n" "Last-Translator: Saulo Benigno \n" "Language-Team: ScummBR (www.scummbr.com) \n" @@ -49,7 +49,10 @@ msgstr "Acima" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Cancelar" @@ -86,7 +89,14 @@ msgstr "Mapear" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -428,7 +438,7 @@ msgstr "Carregar jogo:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Carregar" @@ -443,16 +453,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Sim" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Não" @@ -1100,31 +1110,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Amber" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1170,12 +1180,19 @@ msgstr "Salvar jogo:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Salvar" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1190,6 +1207,42 @@ msgstr "~C~ancelar" msgid "~K~eys" msgstr "~T~eclas" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Modo de vídeo atual:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Habilita correção de proporção" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1257,6 +1310,7 @@ msgstr "Salvar estado do jogo 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Sair" @@ -1722,7 +1776,14 @@ msgstr "Voar para direita" msgid "Fly to lower right" msgstr "Voar para direita inferior" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1733,7 +1794,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1744,7 +1805,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1755,7 +1816,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1794,6 +1855,152 @@ msgstr "Restaurar jogo:" msgid "Restore" msgstr "Restaurar" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Falha ao carregar o estado do jogo a partir do arquivo:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Falha ao salvar o estado do jogo para o arquivo:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Falha ao salvar o estado do jogo para o arquivo:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Falha ao salvar o estado do jogo para o arquivo:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Salvar jogo:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Carregar jogo:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Salvar jogo:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "Emulador MAME OPL" @@ -1802,17 +2009,31 @@ msgstr "Emulador MAME OPL" msgid "DOSBox OPL emulator" msgstr "Emulador DOSBox OPL" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1945,6 +2166,16 @@ msgstr "Som de alta qualidade (mais lento) (reiniciar)" msgid "Disable power off" msgstr "Desativar desligamento" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Modo Touchpad ligado." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Modo Touchpad desligado." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Modo Touchpad ligado." @@ -2272,13 +2503,13 @@ msgstr "Cursor para a esquerda" msgid "Cursor Right" msgstr "Cursor para a direita" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Você deseja carregar ou salvar o jogo?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " Tem certeza de que deseja sair? " @@ -2302,83 +2533,88 @@ msgstr "Tela" msgid "Do you want to perform an automatic scan ?" msgstr "Você quer executar uma busca automática?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Mapear ação \"Clique da Direita\"" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Você precisa mapear uma tecla para ação do \"Clique da Direita\" nesse jogo" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Mapear \"Ocultar barra de ferramentas\"" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Você precisa mapear uma tecla para ação do \"Ocultar barra de ferramentas\" " "nesse jogo" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Mapear Zoom para Cima (opcional)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Mapear Zoom para Baixo (opcional)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Não se esqueça de mapear uma tecla para \"Ocultar a barra de ferramentas\" " "para ver todo o seu inventário" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Você realmente quer excluir este jogo salvo?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Soco" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Você deseja sair ?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volume" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/ru_RU.po b/po/ru_RU.po index 6755a68f2a..9600a810ea 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2010-06-13 20:55+0300\n" "Last-Translator: Eugene Sandulenko \n" "Language-Team: Russian\n" @@ -47,7 +47,10 @@ msgstr " #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "¾âÜÕÝÐ" @@ -84,7 +87,14 @@ msgstr " #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -427,7 +437,7 @@ msgstr " #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "·ÐÓàã×Øâì" @@ -442,16 +452,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "´Ð" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "½Õâ" @@ -1100,31 +1110,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ÏÝâÐàÝëÙ" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1170,12 +1180,19 @@ msgstr " #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "ÁÞåàÐÝØâì" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1190,6 +1207,42 @@ msgstr " msgid "~K~eys" msgstr "~º~ÛÐÒØèØ" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "ÂÕÚãéØÙ ÒØÔÕÞàÕÖØÜ:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~¿~àÕÔ" @@ -1257,6 +1310,7 @@ msgstr " #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "²ëåÞÔ" @@ -1722,7 +1776,14 @@ msgstr " msgid "Fly to lower right" msgstr "»ÕâÕâì ÒßàÐÒÞ-ÒÝØ×" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1733,7 +1794,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1744,7 +1805,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1755,7 +1816,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1793,6 +1854,152 @@ msgstr " msgid "Restore" msgstr "²ÞááâÒÝÞÒØâì" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"½Õ ãÔÐÛÞáì ×ÐÓàã×Øâì ØÓàã Ø× äÐÙÛÐ:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "ÁÞåàÐÝØâì ØÓàã:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "·ÐÓàã×Øâì ØÓàã:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "ÁÞåàÐÝØâì ØÓàã:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "ÍÜãÛïâÞà MAME OPL" @@ -1801,17 +2008,31 @@ msgstr " msgid "DOSBox OPL emulator" msgstr "ÍÜãÛïâÞà DOSBox OPL" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1944,6 +2165,16 @@ msgstr " msgid "Disable power off" msgstr "·ÐßàÕâØâì ÒëÚÛîçÕÝØÕ" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒÚÛîçÕÝ." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒëÚÛîçÕÝ." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒÚÛîçÕÝ." @@ -2271,13 +2502,13 @@ msgstr " msgid "Cursor Right" msgstr "ºãàáÞà ÒßàÐÒÞ" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "²ë åÞâØâÕ ×ÐÓàã×Øâì ÛØÑÞ áÞåàÐÝØâì ØÓàã?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " ²ë ãÒÕàÕÝë, çâÞ åÞâØâÕ ÒëÙâØ? " @@ -2301,80 +2532,85 @@ msgstr " msgid "Do you want to perform an automatic scan ?" msgstr "²ë åÞâØâÕ ßàÞØ×ÒÕáâØ ÐÒâÞÜÐâØçÕáÚØÙ ßÞØáÚ?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "½Ð×ÝÐçØâì ÔÕÙáâÒØÕ ßÞ ßàÐÒÞÜã éÕÛçÚã" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "²ë ÔÞÛÖÝë ÝÐ×ÝÐçØâì ÚÛÐÒØèã ÝÐ ÔÕÙáâÒØÕ 'Right Click' ÔÛï íâÞÙ ØÓàë" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "½Ð×ÝÐçØâì ÔÕÙáâÒØÕ 'áßàïâÐâì ßÐÝÕÛì ØÝáâàãÜÕÝâÞÒ'" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "²ë ÔÞÛÖÝë ÝÐ×ÝÐçØâì ÚÛÐÒØèã ÝÐ ÔÕÙâáâÒØÕ 'Hide toolbar' ÔÛï íâÞÙ ØÓàë" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "½Ð×ÝÐçØâì ÔÕÙáâÒØÕ ÃÒÕÛØçØâì ¼ÐáèâÐÑ (ÝÕÞÑï×ÐâÕÛìÝÞ)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "½Ð×ÝÐçØâì ÔÕÙáâÒØÕ ÃÜÕÝìèØâì ¼ÐáèâÐÑ (ÝÕÞÑï×ÐâÕÛìÝÞ)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "½Õ ×ÐÑãÔìâÕ ÝÐ×ÝÐçØâì ÚÛÐÒØèã ÔÛï ÔÕÙáâÒØï 'Hide Toolbar' çâÞÑë ãÒØÔÕâì ÒÕáì " "ØÝÒÕÝâÐàì Ò ØÓàÕ" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "²ë ÔÕÙáâÒØâÕÛìÝÞ åÞâØâÕ ãÔÐÛØâì íâÞ áÞåàÐÝÕÝØÕ?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "ÃÔÐà" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "²ë åÞâØâÕ ÒëÙâØ?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "³àÞÜÚÞáâì" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "³àÞÜÚÞáâì" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/se_SE.po b/po/se_SE.po index 2539c8ece8..ccb12b159f 100644 --- a/po/se_SE.po +++ b/po/se_SE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-05-02 13:07+0100\n" "Last-Translator: Hampus Flink \n" "Language-Team: \n" @@ -50,7 +50,10 @@ msgstr "Upp #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "Avbryt" @@ -87,7 +90,14 @@ msgstr "St #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -430,7 +440,7 @@ msgstr "Ladda spel:" #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "Ladda" @@ -445,16 +455,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "Ja" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "Nej" @@ -1101,31 +1111,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Herkules bärnsten" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1171,12 +1181,19 @@ msgstr "Spara spelet:" #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "Spara" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1191,6 +1208,42 @@ msgstr "A~v~bryt" msgid "~K~eys" msgstr "~T~angenter" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "Aktivt videoläge:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "Korrektion av bildförhållande på/av" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~öregående" @@ -1258,6 +1311,7 @@ msgstr "Spara speldata 1-10" #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "Avsluta" @@ -1723,7 +1777,14 @@ msgstr "Flyg msgid "Fly to lower right" msgstr "Flyg åt nedre höger" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1734,7 +1795,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1745,7 +1806,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1756,7 +1817,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1794,6 +1855,152 @@ msgstr " msgid "Restore" msgstr "Återställ" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"Kunde inte läsa spardata från file:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"Kunde inte skriva spardata till file:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"Kunde inte skriva spardata till file:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"Kunde inte skriva spardata till file:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "Spara spelet:" + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "Ladda spel:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "Spara spelet:" + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "MAME OPL-emulator" @@ -1802,17 +2009,31 @@ msgstr "MAME OPL-emulator" msgid "DOSBox OPL emulator" msgstr "DOSBox OPL-emulator" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1945,6 +2166,16 @@ msgstr "H msgid "Disable power off" msgstr "Inaktivera strömsparning" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "Touchpad-läge aktiverat." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "Touchpad-läge inaktiverat." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "Touchpad-läge aktiverat." @@ -2272,13 +2503,13 @@ msgstr "Pekare v msgid "Cursor Right" msgstr "Pekare höger" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "Vill du ladda eller spara spelet?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr "Är du säker på att du vill avsluta?" @@ -2302,83 +2533,88 @@ msgstr "Sk msgid "Do you want to perform an automatic scan ?" msgstr "Vill du utföra en automatisk scan?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "Ställ in högerklick" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "" "Du måste välja en tangent för \"Högerklick\" för att spela det här spelet" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "Ställ in göm verktygsrad" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "Du måste välja en tangent för \"Göm verktygsrad\" för att spela det här " "spelet" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "Ställ in Zooma up (valfritt)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "Ställ in Zooma ned (valfritt)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "Glöm inte att välja en tangent för \"Göm verktygsrad\" för att se hela " "inventariet" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "Vill du verkligen radera den här spardatan?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "Slå" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "Vill du avsluta?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "Volym" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "Volym" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" diff --git a/po/uk_UA.po b/po/uk_UA.po index 32c7132ff6..dfacf84fa7 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-06 23:15+0100\n" +"POT-Creation-Date: 2011-06-13 22:20+0100\n" "PO-Revision-Date: 2011-03-26 22:38+0200\n" "Last-Translator: Lubomyr Lisen\n" "Language-Team: Ukrainian\n" @@ -47,7 +47,10 @@ msgstr " #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 +#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 #: backends/platform/wii/options.cpp:48 +#: backends/events/default/default-events.cpp:222 +#: backends/events/default/default-events.cpp:244 msgid "Cancel" msgstr "²öÔÜöÝÐ" @@ -84,7 +87,14 @@ msgstr " #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: backends/platform/wii/options.cpp:47 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 +#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 +#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 +#: engines/sword1/animation.cpp:360 engines/sword1/control.cpp:865 +#: engines/sword1/logic.cpp:1633 engines/sword2/animation.cpp:379 +#: engines/sword2/animation.cpp:389 engines/sword2/animation.cpp:398 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:47 #: backends/platform/wince/CELauncherDialog.cpp:52 msgid "OK" msgstr "OK" @@ -426,7 +436,7 @@ msgstr " #: gui/launcher.cpp:615 engines/dialogs.cpp:114 engines/mohawk/myst.cpp:255 #: engines/mohawk/riven.cpp:711 engines/cruise/menu.cpp:216 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Load" msgstr "·ÐÒÐÝâÐÖØâØ" @@ -441,16 +451,16 @@ msgstr "" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Yes" msgstr "ÂÐÚ" #: gui/launcher.cpp:724 gui/launcher.cpp:872 #: backends/events/symbiansdl/symbiansdl-events.cpp:184 -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "No" msgstr "½ö" @@ -1095,31 +1105,31 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ÏÝâÐàÝØÙ" -#: engines/advancedDetector.cpp:368 +#: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:369 +#: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:371 +#: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:632 +#: engines/advancedDetector.cpp:574 #, c-format msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" -#: engines/advancedDetector.cpp:635 +#: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" msgstr "" -#: engines/advancedDetector.cpp:637 +#: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" @@ -1165,12 +1175,19 @@ msgstr " #: engines/sci/engine/kfile.cpp:575 #: backends/platform/symbian/src/SymbianActions.cpp:44 #: backends/platform/wince/CEActionsPocket.cpp:43 -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:45 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Save" msgstr "·ÐßØáÐâØ" +#: engines/dialogs.cpp:146 +msgid "" +"Sorry, this engine does not currently provide in-game help. Please consult " +"the README for basic information, and for instructions on how to obtain " +"further assistance." +msgstr "" + #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 msgid "~O~K" @@ -1185,6 +1202,42 @@ msgstr " msgid "~K~eys" msgstr "~º~ÛÐÒöèö" +#: engines/engine.cpp:220 +msgid "Could not initialize color format." +msgstr "" + +#: engines/engine.cpp:228 +#, fuzzy +msgid "Could not switch to video mode: '" +msgstr "¿ÞâÞçÝØÙ ÒöÔÕÞàÕÖØÜ:" + +#: engines/engine.cpp:237 +#, fuzzy +msgid "Could not apply aspect ratio setting." +msgstr "ºÞàÕÚæöï áßöÒÒöÔÝÞèÕÝÝï áâÞàöÝ" + +#: engines/engine.cpp:242 +msgid "Could not apply fullscreen setting." +msgstr "" + +#: engines/engine.cpp:342 +msgid "" +"You appear to be playing this game directly\n" +"from the CD. This is known to cause problems,\n" +"and it is therefore recommended that you copy\n" +"the data files to your hard disk instead.\n" +"See the README file for details." +msgstr "" + +#: engines/engine.cpp:353 +msgid "" +"This game has audio tracks in its disk. These\n" +"tracks need to be ripped from the disk using\n" +"an appropriate CD audio extracting tool in\n" +"order to listen to the game's music.\n" +"See the README file for details." +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~¿~ÞßÕà" @@ -1252,6 +1305,7 @@ msgstr " #: backends/platform/symbian/src/SymbianActions.cpp:52 #: backends/platform/wince/CEActionsPocket.cpp:44 #: backends/platform/wince/CEActionsSmartphone.cpp:52 +#: backends/events/default/default-events.cpp:244 msgid "Quit" msgstr "²ØåöÔ" @@ -1717,7 +1771,14 @@ msgstr " msgid "Fly to lower right" msgstr "»ÕâöâØ ÔÞÝØ×ã ÝÐßàÐÒÞ" -#: engines/scumm/scumm.cpp:2250 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:1770 +#, c-format +msgid "" +"Native MIDI support requires the Roland Upgrade from LucasArts,\n" +"but %s is missing. Using AdLib instead." +msgstr "" + +#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1728,7 +1789,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2257 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1739,7 +1800,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2269 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1750,7 +1811,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2484 +#: engines/scumm/scumm.cpp:2490 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1788,6 +1849,152 @@ msgstr " msgid "Restore" msgstr "²öÔÝÞÒØâØ" +#: engines/agos/animation.cpp:544 +#, c-format +msgid "Cutscene file '%s' not found!" +msgstr "" + +#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 +#: engines/tinsel/saveload.cpp:468 +#, fuzzy +msgid "Failed to load game state from file." +msgstr "" +"½Õ ÒÔÐÛÞáï ×ÐÒÐÝâÐÖØâØ áâÐÝ ÓàØ × äÐÙÛã:\n" +"\n" +"%s" + +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 +#, fuzzy +msgid "Failed to save game state to file." +msgstr "" +"½Õ ÒÔÐÛÞáï ×ÑÕàÕÓâØ áâÐÝ ÓàØ ã äÐÙÛ:\n" +"\n" +"%s" + +#: engines/gob/inter_v5.cpp:107 +#, fuzzy +msgid "Failed to delete file." +msgstr "" +"½Õ ÒÔÐÛÞáï ×ÑÕàÕÓâØ áâÐÝ ÓàØ ã äÐÙÛ:\n" +"\n" +"%s" + +#: engines/groovie/script.cpp:417 +#, fuzzy +msgid "Failed to save game" +msgstr "" +"½Õ ÒÔÐÛÞáï ×ÑÕàÕÓâØ áâÐÝ ÓàØ ã äÐÙÛ:\n" +"\n" +"%s" + +#: engines/kyra/sound_midi.cpp:475 +msgid "" +"You appear to be using a General MIDI device,\n" +"but your game only supports Roland MT32 MIDI.\n" +"We try to map the Roland MT32 instruments to\n" +"General MIDI ones. After all it might happen\n" +"that a few tracks will not be correctly played." +msgstr "" + +#: engines/m4/m4_menus.cpp:138 +#, fuzzy +msgid "Save game failed!" +msgstr "·ÑÕàÕÓâØ Óàã: " + +#: engines/sky/compact.cpp:130 +msgid "" +"Unable to find \"sky.cpt\" file!\n" +"Please download it from www.scummvm.org" +msgstr "" + +#: engines/sky/compact.cpp:141 +msgid "" +"The \"sky.cpt\" file has an incorrect size.\n" +"Please (re)download it from www.scummvm.org" +msgstr "" + +#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 +msgid "DXA cutscenes found but ScummVM has been built without zlib support" +msgstr "" + +#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 +msgid "MPEG2 cutscenes are no longer supported" +msgstr "" + +#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 +#, c-format +msgid "Cutscene '%s' not found" +msgstr "" + +#: engines/sword1/control.cpp:863 +msgid "" +"ScummVM found that you have old savefiles for Broken Sword 1 that should be " +"converted.\n" +"The old save game format is no longer supported, so you will not be able to " +"load your games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked again the next " +"time you start the game.\n" +msgstr "" + +#: engines/sword1/control.cpp:1232 +#, c-format +msgid "" +"Target new save game already exists!\n" +"Would you like to keep the old save game (%s) or the new one (%s)?\n" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the old one" +msgstr "" + +#: engines/sword1/control.cpp:1235 +msgid "Keep the new one" +msgstr "" + +#: engines/sword1/logic.cpp:1633 +msgid "This is the end of the Broken Sword 1 Demo" +msgstr "" + +#: engines/parallaction/saveload.cpp:133 +#, c-format +msgid "" +"Can't save game in slot %i\n" +"\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:211 +#, fuzzy +msgid "Loading game..." +msgstr "·ÐÒÐÝâÐÖØâØ Óàã:" + +#: engines/parallaction/saveload.cpp:226 +#, fuzzy +msgid "Saving game..." +msgstr "·ÑÕàÕÓâØ Óàã: " + +#: engines/parallaction/saveload.cpp:279 +msgid "" +"ScummVM found that you have old savefiles for Nippon Safes that should be " +"renamed.\n" +"The old names are no longer supported, so you will not be able to load your " +"games if you don't convert them.\n" +"\n" +"Press OK to convert them now, otherwise you will be asked next time.\n" +msgstr "" + +#: engines/parallaction/saveload.cpp:326 +msgid "ScummVM successfully converted all your savefiles." +msgstr "" + +#: engines/parallaction/saveload.cpp:328 +msgid "" +"ScummVM printed some warnings in your console window and can't guarantee all " +"your files have been converted.\n" +"\n" +"Please report to the team." +msgstr "" + #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" msgstr "µÜãÛïâÞà MAME OPL:" @@ -1796,17 +2003,31 @@ msgstr " msgid "DOSBox OPL emulator" msgstr "µÜãÛïâÞà DOSBox OPL" -#: audio/mididrv.cpp:206 +#: audio/mididrv.cpp:204 #, c-format msgid "" -"Failed to detect the selected audio device '%s'. See log file for more " +"The selected audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:216 +#, c-format +msgid "" +"The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -#: audio/mididrv.cpp:246 +#: audio/mididrv.cpp:250 +#, c-format +msgid "" +"The preferred audio device '%s' was not found (e.g. might be turned off or " +"disconnected). Attempting to fall back to the next available device..." +msgstr "" + +#: audio/mididrv.cpp:265 #, c-format msgid "" -"Failed to detect the preferred device '%s'. See log file for more " +"The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" @@ -1939,6 +2160,16 @@ msgstr " msgid "Disable power off" msgstr "·ÐÑÞàÞÝØâØ ÒØÜÚÝÕÝÝï" +#: backends/platform/iphone/osys_events.cpp:338 +#, fuzzy +msgid "Mouse-click-and-drag mode enabled." +msgstr "ÀÕÖØÜ âÐçßÐÔã ãÒöÜÚÝÕÝÞ." + +#: backends/platform/iphone/osys_events.cpp:340 +#, fuzzy +msgid "Mouse-click-and-drag mode disabled." +msgstr "ÀÕÖØÜ âÐçßÐÔã ÒØÜÚÝÕÝÞ." + #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." msgstr "ÀÕÖØÜ âÐçßÐÔã ãÒöÜÚÝÕÝÞ." @@ -2266,13 +2497,13 @@ msgstr " msgid "Cursor Right" msgstr "ºãàáÞà ÝÐßàÐÒÞ" -#: backends/platform/wince/CEActionsPocket.cpp:265 +#: backends/platform/wince/CEActionsPocket.cpp:264 #: backends/platform/wince/CEActionsSmartphone.cpp:228 msgid "Do you want to load or save the game?" msgstr "²Ø åÞçÕâÕ ×ÐÒÐÝâÐÖØâØ ÐÑÞ ×ÑÕàÕÓâØ Óàã?" -#: backends/platform/wince/CEActionsPocket.cpp:327 -#: backends/platform/wince/CEActionsSmartphone.cpp:284 +#: backends/platform/wince/CEActionsPocket.cpp:314 +#: backends/platform/wince/CEActionsSmartphone.cpp:275 msgid " Are you sure you want to quit ? " msgstr " ²Ø ãßÕÒÝÕÝö, éÞ åÞçÕâÕ ÒØÙâØ? " @@ -2296,82 +2527,87 @@ msgstr " msgid "Do you want to perform an automatic scan ?" msgstr "²Ø åÞçÕâÕ ×ÔöÙáÝØâØ ÐÒâÞÜÐâØçÝØÙ ßÞèãÚ?" -#: backends/platform/wince/wince-sdl.cpp:485 +#: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" msgstr "¿ÕàÕßàØ×ÝÐçÕÝÝï ßàÐÒÞÓÞ ÚÛöÚã" -#: backends/platform/wince/wince-sdl.cpp:489 +#: backends/platform/wince/wince-sdl.cpp:491 msgid "You must map a key to the 'Right Click' action to play this game" msgstr "²Ø ßÞÒØÝÝö ßàØ×ÝÐçØâØ ÚÝÞßÚã ÔÞ Ôö÷ '¿àÐÒØÙ ÚÛöÚ', éÞÑ ÓàÐâØ ã æî Óàã" -#: backends/platform/wince/wince-sdl.cpp:498 +#: backends/platform/wince/wince-sdl.cpp:500 msgid "Map hide toolbar action" msgstr "¿ÕàÕßàØ×ÝÐçØâØ Ôöî 'ÁåÞÒÐâØ ¿ÐÝÕÛì öÝáâà.'" -#: backends/platform/wince/wince-sdl.cpp:502 +#: backends/platform/wince/wince-sdl.cpp:504 msgid "You must map a key to the 'Hide toolbar' action to play this game" msgstr "" "²Ø ßÞÒØÝÝö ßÕàÕßàØ×ÝÐçØâØ ÚÝÞßÚã ÔÛï Ôö÷ 'ÁåÞÒÐâØ ¿ÐÝÕÛì öÝáâà.', éÞÑ ÓàÐâØ " "Ò æî Óàã" -#: backends/platform/wince/wince-sdl.cpp:511 +#: backends/platform/wince/wince-sdl.cpp:513 msgid "Map Zoom Up action (optional)" msgstr "¿ÕàÕßàØ×ÝÐçØâØ Ôöî ·ÑöÛìèÕÝÝï (ÝÕÞÑÞÒï×ÚÞÒÞ)" -#: backends/platform/wince/wince-sdl.cpp:514 +#: backends/platform/wince/wince-sdl.cpp:516 msgid "Map Zoom Down action (optional)" msgstr "¿ÕàÕßàØ×ÝÐçØâØ Ôöî ·ÜÕÝèÕÝÝï (ÝÕÞÑÞÒï×ÚÞÒÞ)" -#: backends/platform/wince/wince-sdl.cpp:522 +#: backends/platform/wince/wince-sdl.cpp:524 msgid "" "Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory" msgstr "" "½Õ ×ÐÑãÔìâÕ ßÕàÕßàØ×ÝÐçØâØ ÚÝÞßÚã ÔÛï Ôö÷ 'ÁåÞÒÐâØ ¿ÐÝÕÛì öÝáâà.' éÞÑ " "ßÞÑÐçØâØ ÒÕáì öÝÒÕÝâÐà" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:273 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:317 -#: backends/events/gph/gph-events.cpp:367 -#: backends/events/gph/gph-events.cpp:410 -#: backends/events/openpandora/op-events.cpp:78 +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Do you really want to return to the Launcher?" +msgstr "²Ø ÔöÙáÝÞ åÞçÕâÕ ÒØÔÐÛØâØ æÕ ×ÑÕàÕÖÕÝÝï?" + +#: backends/events/default/default-events.cpp:222 +#, fuzzy +msgid "Launcher" +msgstr "²ÔÐàØâØ ÚãÛÐÚÞÜ" + +#: backends/events/default/default-events.cpp:244 +#, fuzzy +msgid "Do you really want to quit?" +msgstr "²Ø åÞçÕâÕ ÒØÙâØ?" + +#: backends/events/gph/gph-events.cpp:366 +#: backends/events/gph/gph-events.cpp:409 +#: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:275 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:319 -#: backends/events/gph/gph-events.cpp:369 -#: backends/events/gph/gph-events.cpp:412 -#: backends/events/openpandora/op-events.cpp:80 +#: backends/events/gph/gph-events.cpp:368 +#: backends/events/gph/gph-events.cpp:411 +#: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:277 -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:321 -#: backends/events/gph/gph-events.cpp:371 -#: backends/events/gph/gph-events.cpp:414 -#: backends/events/openpandora/op-events.cpp:82 +#: backends/events/gph/gph-events.cpp:370 +#: backends/events/gph/gph-events.cpp:413 +#: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:297 -#: backends/events/gph/gph-events.cpp:391 +#: backends/events/gph/gph-events.cpp:390 #, fuzzy msgid "Maximum Volume" msgstr "³ãçÝöáâì" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:299 -#: backends/events/gph/gph-events.cpp:393 +#: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" msgstr "" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:306 -#: backends/events/gph/gph-events.cpp:399 +#: backends/events/gph/gph-events.cpp:398 #, fuzzy msgid "Minimal Volume" msgstr "³ãçÝöáâì" -#: backends/events/gp2xsdl/gp2xsdl-events.cpp:308 -#: backends/events/gph/gph-events.cpp:401 +#: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" msgstr "" -- cgit v1.2.3 From 8c485fe2dad12e00848673729b9ec9b24a72118c Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 14 Jun 2011 00:15:50 +0100 Subject: BACKENDS: Improve SDL Mixer Output Format Checks and Reporting. This commit corrects a number of minor issues and adds warnings for when the desired output parameters given to SDL_OpenAudio() don't match the obtained. --- backends/mixer/sdl/sdl-mixer.cpp | 26 +++++++++++++++++++++----- backends/mixer/sdl/sdl-mixer.h | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 16e7f22db5..f0b0885dd7 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -61,18 +61,34 @@ void SdlMixerManager::init() { // Get the desired audio specs SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC); + // Needed as SDL_OpenAudio as of SDL-1.2.14 mutates fields in + // "desired" if used directly. + SDL_AudioSpec fmt = desired; + // Start SDL audio with the desired specs - if (SDL_OpenAudio(&desired, &_obtainedRate) != 0) { + if (SDL_OpenAudio(&fmt, &_obtained) != 0) { warning("Could not open audio device: %s", SDL_GetError()); _mixer = new Audio::MixerImpl(g_system, desired.freq); assert(_mixer); _mixer->setReady(false); } else { - debug(1, "Output sample rate: %d Hz", _obtainedRate.freq); + debug(1, "Output sample rate: %d Hz", _obtained.freq); + if (_obtained.freq != desired.freq) + warning("SDL mixer output sample rate: %d differs from desired: %d", _obtained.freq, desired.freq); - _mixer = new Audio::MixerImpl(g_system, _obtainedRate.freq); - assert(_mixer); + debug(1, "Output buffer size: %d samples", _obtained.samples); + if (_obtained.samples != desired.samples) + warning("SDL mixer output buffer size: %d differs from desired: %d", _obtained.samples, desired.samples); + + if (_obtained.format != desired.format) + warning("SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format); + + if (_obtained.channels != 2) + error("SDL mixer output requires stereo output device"); + + _mixer = new Audio::MixerImpl(g_system, _obtained.freq); + assert(_mixer); _mixer->setReady(true); startAudio(); @@ -133,7 +149,7 @@ void SdlMixerManager::suspendAudio() { int SdlMixerManager::resumeAudio() { if (!_audioSuspended) return -2; - if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){ + if (SDL_OpenAudio(&_obtained, NULL) < 0){ return -1; } SDL_PauseAudio(0); diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h index 5590c90ab3..82ffa4f901 100644 --- a/backends/mixer/sdl/sdl-mixer.h +++ b/backends/mixer/sdl/sdl-mixer.h @@ -67,7 +67,7 @@ protected: * The obtained audio specification after opening the * audio system. */ - SDL_AudioSpec _obtainedRate; + SDL_AudioSpec _obtained; /** State of the audio system */ bool _audioSuspended; -- cgit v1.2.3 From de96474672cc8c18fe189dda2958c505692f9389 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 14 Jun 2011 00:48:59 +0100 Subject: BACKENDS: Fix Compilation. --- backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp | 2 +- backends/mixer/symbiansdl/symbiansdl-mixer.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp index 526a01d1bf..001389b1c0 100644 --- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp +++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp @@ -45,7 +45,7 @@ void DoubleBufferSDLMixerManager::startAudio() { // Create two sound buffers _activeSoundBuf = 0; - uint bufSize = _obtainedRate.samples * 4; + uint bufSize = _obtained.samples * 4; _soundBufSize = bufSize; _soundBuffers[0] = (byte *)calloc(1, bufSize); _soundBuffers[1] = (byte *)calloc(1, bufSize); diff --git a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp index b2462a1cdf..c911a99b61 100644 --- a/backends/mixer/symbiansdl/symbiansdl-mixer.cpp +++ b/backends/mixer/symbiansdl/symbiansdl-mixer.cpp @@ -43,8 +43,8 @@ SymbianSdlMixerManager::~SymbianSdlMixerManager() { void SymbianSdlMixerManager::startAudio() { // Need to create mixbuffer for stereo mix to downmix - if (_obtainedRate.channels != 2) { - _stereoMixBuffer = new byte [_obtainedRate.size * 2]; // * 2 for stereo values + if (_obtained.channels != 2) { + _stereoMixBuffer = new byte [_obtained.size * 2]; // * 2 for stereo values } SdlMixerManager::startAudio(); @@ -54,7 +54,7 @@ void SymbianSdlMixerManager::callbackHandler(byte *samples, int len) { assert(_mixer); #if defined (S60) && !defined(S60V3) // If not stereo then we need to downmix - if (_obtainedRate.channels != 2) { + if (_obtained.channels != 2) { _mixer->mixCallback(_stereoMixBuffer, len * 2); int16 *bitmixDst = (int16 *)samples; -- cgit v1.2.3 From 8ed74c61f640c368fa9ef59addbb78a8b1f97fac Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Jun 2011 21:27:54 +1000 Subject: TSAGE: Bugfixes for sound channel updates --- engines/tsage/events.cpp | 5 +++++ engines/tsage/sound.cpp | 35 ++++++++++++++++++++--------------- engines/tsage/sound.h | 8 ++++---- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index e889c56c4d..6149ce301d 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -48,7 +48,9 @@ bool EventsClass::pollEvent() { _priorFrameTime = milli; ++_frameNumber; + // Update screen and allow the sound manager to process pending sounds g_system->updateScreen(); + SoundManager::_sfSoundServer(); } if (!g_system->getEventManager()->pollEvent(_event)) return false; @@ -297,6 +299,9 @@ void EventsClass::delay(int numFrames) { ++_frameNumber; _priorFrameTime = g_system->getMillis(); + + // Allow pending sounds to be processed + SoundManager::_sfSoundServer(); } g_system->updateScreen(); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 30efc49e5b..878d27edba 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -460,6 +460,8 @@ void SoundManager::_sfUpdateVoiceStructs() { void SoundManager::_sfUpdateVoiceStructs2() { for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[voiceIndex]; + if (!vtStruct) + continue; for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { @@ -716,8 +718,7 @@ void SoundManager::_sfRethinkVoiceTypes() { continue; _sfUpdateVoiceStructs(); - for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) - sound->_chWork[idx] = 0; + Common::set_to(sound->_chWork, sound->_chWork + SOUND_ARR_SIZE, false); for (;;) { // Scan for sub priority @@ -743,7 +744,7 @@ void SoundManager::_sfRethinkVoiceTypes() { break; int chNumVoices = sound->_chNumVoices[foundIndex]; - sound->_chWork[foundIndex] = 1; + sound->_chWork[foundIndex] = true; VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[sound->_chVoiceType[foundIndex]]; if (!vtStruct) { @@ -770,7 +771,7 @@ void SoundManager::_sfRethinkVoiceTypes() { ++idx; } - vtStruct->_numVoices = numVoices; + vtStruct->_numVoices -= chNumVoices; continue; } else if (!foundPriority) { do { @@ -1133,7 +1134,7 @@ void SoundManager::_sfRethinkVoiceTypes() { for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { VoiceStructEntryType1 &vse2 = vs->_entries[entryIndex]._type1; - if (!vse2._sound && (vse._sound3 == sound) && (vse._channelNum3 == channelNum)) { + if (!vse2._sound && (vse2._sound3 == sound) && (vse2._channelNum3 == channelNum)) { vse2._sound = sound; vse2._channelNum = channelNum; vse._channelNum = vse2._channelNum2; @@ -1170,7 +1171,7 @@ void SoundManager::_sfRethinkVoiceTypes() { driver->proc38(vs->_entries[idx2]._voiceNum, 7, vse2._sound->_chVolume[vse2._channelNum] * vse2._sound->_volume / 127); driver->proc38(vs->_entries[idx2]._voiceNum, 10, vse2._sound->_chPan[vse2._channelNum]); - driver->proc40(vs->_entries[idx2]._voiceNum, vse2._sound->_chPitchBlend[vse2._channelNum]); + driver->setPitch(vs->_entries[idx2]._voiceNum, vse2._sound->_chPitchBlend[vse2._channelNum]); } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { @@ -1411,7 +1412,7 @@ Sound::Sound() { memset(_chNumVoices, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chSubPriority, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chFlags, 0, SOUND_ARR_SIZE * sizeof(int)); - memset(_chWork, 0, SOUND_ARR_SIZE * sizeof(int)); + Common::set_to(_chWork, _chWork + SOUND_ARR_SIZE, false); memset(_channelData, 0, SOUND_ARR_SIZE * sizeof(byte *)); memset(_trkChannel, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_trkState, 0, SOUND_ARR_SIZE * sizeof(int)); @@ -1733,6 +1734,7 @@ bool Sound::_soServiceTracks() { flag = false; } + ++_timer; if (!flag) return false; else if ((_loop > 0) && (--_loop == 0)) @@ -1841,7 +1843,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { voiceType = VOICETYPE_0; } else { chVoiceType = (VoiceType)_chVoiceType[channelNum]; - vtStruct = _soundManager->_voiceTypeStructPtrs[channelNum]; + vtStruct = _soundManager->_voiceTypeStructPtrs[(int)chVoiceType]; if (vtStruct) { voiceType = vtStruct->_voiceType; @@ -1912,7 +1914,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { trkRest = (trkRest << 5) | (b & 0x1f); } - _trkRest[trackIndex] = trkRest; + _trkRest[trackIndex] = trkRest - 1; _trkIndex[trackIndex] = pData - channelData; return; } else if (!(v & 0x10)) { @@ -1935,6 +1937,9 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { _soDoTrackCommand(_trkChannel[trackIndex], cmdVal, b); if (!_soundManager->_soTimeIndexFlag) { + if (cmdVal == 7) + b = static_cast(_volume * (int)b / 127); + if (voiceType != VOICETYPE_0) { _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, v); } else if (voiceNum != -1) { @@ -1979,7 +1984,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } else if (!(v & 0x2)) { // Area #7 if (!_soundManager->_soTimeIndexFlag) { - int pitchBlend = READ_LE_UINT16(pData); + int pitchBlend = READ_BE_UINT16(pData); pData += 2; if (channelNum != -1) { @@ -2132,7 +2137,7 @@ void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend) SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - driver->proc40(vtStruct->_entries[entryIndex]._voiceNum, pitchBlend); + driver->setPitch(vtStruct->_entries[entryIndex]._voiceNum, pitchBlend); } } } @@ -2384,7 +2389,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); _v44082[ADLIB_CHANNEL_COUNT] = 0x90; - Common::set_to(_v4408C, _v4408C + ADLIB_CHANNEL_COUNT, 0x2000); + Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000); memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); } @@ -2491,8 +2496,8 @@ void AdlibSoundDriver::proc38(int channel, int cmd, int value) { } } -void AdlibSoundDriver::proc40(int channel, int pitchBlend) { - _v4408C[channel] = pitchBlend; +void AdlibSoundDriver::setPitch(int channel, int pitchBlend) { + _pitchBlend[channel] = pitchBlend; setFrequency(channel); } @@ -2579,7 +2584,7 @@ void AdlibSoundDriver::updateChannel(int channel) { void AdlibSoundDriver::setFrequency(int channel) { int offset, ch; - int v = _v4408C[channel]; + int v = _pitchBlend[channel]; if (v == 0x2000) { offset = 0; ch = _v44067[channel]; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index fec065e0d2..77208c16e4 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -98,7 +98,7 @@ public: virtual void updateVoice(int channel) {} // Method #17 virtual void proc36() {} // Method #18 virtual void proc38(int channel, int cmd, int value) {} // Method #19 - virtual void proc40(int channel, int pitchBlend) {} // Method #20 + virtual void setPitch(int channel, int pitchBlend) {} // Method #20 virtual void proc42(int channel, int v0, int v1) {} // Method #21 }; @@ -282,7 +282,7 @@ public: int _chNumVoices[SOUND_ARR_SIZE]; int _chSubPriority[SOUND_ARR_SIZE]; int _chFlags[SOUND_ARR_SIZE]; - int _chWork[SOUND_ARR_SIZE]; + bool _chWork[SOUND_ARR_SIZE]; trackInfoStruct _trackInfo; byte *_channelData[SOUND_ARR_SIZE]; int _trkChannel[SOUND_ARR_SIZE]; @@ -404,7 +404,7 @@ private: int _v44070[ADLIB_CHANNEL_COUNT]; int _v44079[ADLIB_CHANNEL_COUNT]; int _v44082[ADLIB_CHANNEL_COUNT + 1]; - int _v4408C[ADLIB_CHANNEL_COUNT]; + int _pitchBlend[ADLIB_CHANNEL_COUNT]; int _v4409E[ADLIB_CHANNEL_COUNT]; @@ -427,7 +427,7 @@ public: virtual void proc32(int channel, int program, int v0, int v1); virtual void updateVoice(int channel); virtual void proc38(int channel, int cmd, int value); - void proc40(int channel, int pitchBlend); + virtual void setPitch(int channel, int pitchBlend); }; } // End of namespace tSage -- cgit v1.2.3 From f47b25810a3e49adb0d95af5e3ec074e02606c54 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Jun 2011 23:02:25 +1000 Subject: TSAGE: Fix channel field copy in _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 18 +++++++++--------- engines/tsage/sound.h | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 878d27edba..97c7f7133f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1156,8 +1156,8 @@ void SoundManager::_sfRethinkVoiceTypes() { ++idx2; VoiceStructEntryType1 &vse2 = vs->_entries[idx2]._type1; - vse2._sound = sound; - vse2._channelNum = vse._channelNum; + vse2._sound = vse._sound2; + vse2._channelNum = vse._channelNum2; vse2._priority = vse._priority2; vse._field4 = -1; vse2._field5 = 0; @@ -1941,7 +1941,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { b = static_cast(_volume * (int)b / 127); if (voiceType != VOICETYPE_0) { - _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, v); + _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, b); } else if (voiceNum != -1) { assert(driver); driver->proc24(voiceNum, chVoiceType, this, cmdVal, b); @@ -2117,13 +2117,13 @@ void Sound::_soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voice _soundManager->_needToRethink = true; } else { for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) { - VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + VoiceStructEntry &vte = vtStruct->_entries[entryIndex]; - if ((vte._sound == this) && (vte._channelNum == channelNum)) { - SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; + if ((vte._type1._sound == this) && (vte._type1._channelNum == channelNum)) { + SoundDriver *driver = vte._driver; assert(driver); - driver->proc38(vtStruct->_entries[entryIndex]._voiceNum, cmd, value); + driver->proc38(vte._voiceNum, cmd, value); } } } @@ -2502,8 +2502,8 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) { } void AdlibSoundDriver::write(byte reg, byte value) { -static int num = 0; -debug("%d [%x]=%x", ++num, reg, value);//***DEBUG**** +static int num = 1; +debug("%d [%x]=%x", num++, reg, value);//***DEBUG**** _portContents[reg] = value; OPLWriteReg(_opl, reg, value); } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 77208c16e4..de67044cd1 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -250,7 +250,6 @@ private: void _unPrime(); void orientAfterRestore(); public: - int _field0; bool _stoppedAsynchronously; int _soundResID; int _group; -- cgit v1.2.3 From c18172565b2d3589d37784b34350c05ebcbe836b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 15 Jun 2011 00:08:40 +1000 Subject: TSAGE: Bugfix for correctly persisting patch data --- engines/tsage/sound.cpp | 11 +++++++---- engines/tsage/sound.h | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 97c7f7133f..b067898a64 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1307,7 +1307,7 @@ void SoundManager::_sfUnInstallDriver(SoundDriver *driver) { } void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) { - driver->installPatch(bankData); + driver->installPatch(bankData, _vm->_memoryManager.getSize(bankData)); } /** @@ -2391,6 +2391,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _v44082[ADLIB_CHANNEL_COUNT] = 0x90; Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000); memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + _patchData = NULL; } AdlibSoundDriver::~AdlibSoundDriver() { @@ -2433,8 +2434,10 @@ const GroupData *AdlibSoundDriver::getGroupData() { return &_groupData; } -void AdlibSoundDriver::installPatch(const byte *data) { - _patchData = data; +void AdlibSoundDriver::installPatch(const byte *data, int size) { + byte *patchData = ALLOCATE(size); + Common::copy(data, data + size, patchData); + _patchData = patchData; } int AdlibSoundDriver::setMasterVolume(int volume) { @@ -2612,7 +2615,7 @@ void AdlibSoundDriver::setFrequency(int channel) { } ch -= tempVal >> 2; - if (ch >= 128) + if (ch < 0) ch = 0; } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index de67044cd1..4bef27d2c9 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -82,7 +82,7 @@ public: virtual void close() {} // Method #1 virtual bool reset() { return true; } // Method #2 virtual const GroupData *getGroupData() { return NULL; } // Method #3 - virtual void installPatch(const byte *data) {} // Method #4 + virtual void installPatch(const byte *data, int size) {} // Method #4 virtual void poll() {} // Method #5 virtual void proc12() {} // Method #6 virtual int setMasterVolume(int volume) { return 0; } // Method #7 @@ -421,7 +421,7 @@ public: virtual void close(); virtual bool reset(); virtual const GroupData *getGroupData(); - virtual void installPatch(const byte *data); + virtual void installPatch(const byte *data, int size); virtual int setMasterVolume(int volume); virtual void proc32(int channel, int program, int v0, int v1); virtual void updateVoice(int channel); -- cgit v1.2.3 From 2fe865c89142d3ef528a6ab3d43180cc95dd99bb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 15 Jun 2011 00:25:41 +1000 Subject: TSAGE: Bugfix to load correct patch bank for Adlib --- engines/tsage/sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index b067898a64..bc1e87d30a 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -193,7 +193,7 @@ void SoundManager::installDriver(int driverNum) { case ROLAND_DRIVER_NUM: case ADLIB_DRIVER_NUM: { // Handle loading bank infomation - byte *bankData = _resourceManager->getResource(RES_BANK, ROLAND_DRIVER_NUM, 0, true); + byte *bankData = _resourceManager->getResource(RES_BANK, driverNum, 0, true); if (bankData) { // Install the patch bank data _sfInstallPatchBank(driver, bankData); @@ -2463,6 +2463,8 @@ void AdlibSoundDriver::proc32(int channel, int program, int v0, int v1) { if (dataP[offset + 2] != 0xff) v0 = dataP[offset + 2]; + _v4409E[channel] = dataP + offset - _patchData; + // Set sustain/release int portNum = v440C2[v440B0[channel]] + 0x80; write(portNum, (_portContents[portNum] & 0xF0) | 0xF); -- cgit v1.2.3 From 5174832e314b4c63ac2a7fd89c09f48fafc68a69 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 14 Jun 2011 10:35:58 -0400 Subject: MOHAWK: Finish implementation of Riven's storeMovieOpcode opcode --- engines/mohawk/mohawk.h | 7 ++++++- engines/mohawk/riven.cpp | 13 +++++++++++++ engines/mohawk/riven.h | 2 ++ engines/mohawk/riven_scripts.cpp | 26 ++++++++++---------------- engines/mohawk/riven_scripts.h | 4 +++- engines/mohawk/video.cpp | 12 +++++++++++- 6 files changed, 45 insertions(+), 19 deletions(-) diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index b189f82040..f0618f7374 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -28,6 +28,8 @@ #include "engines/engine.h" +#include "mohawk/video.h" + class OSystem; namespace Common { @@ -76,7 +78,6 @@ struct MohawkGameDescription; class Sound; class PauseDialog; class MohawkArchive; -class VideoManager; class CursorManager; class MohawkEngine : public ::Engine { @@ -112,6 +113,10 @@ public: void pauseGame(); + // Check if events should be done based on a video's current time + // (currently only used for Riven's storeMovieOpcode function) + virtual void doVideoTimer(VideoHandle handle, bool force) {} + private: PauseDialog *_pauseDialog; void pauseEngineIntern(bool); diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 57a0ac717d..3514afdb61 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -833,6 +833,19 @@ void MohawkEngine_Riven::installCardTimer() { } } +void MohawkEngine_Riven::doVideoTimer(VideoHandle handle, bool force) { + assert(handle != NULL_VID_HANDLE); + + uint16 id = _scriptMan->getStoredMovieOpcodeID(); + + if (handle != _video->findVideoHandleRiven(id)) // Check if we've got a video match + return; + + // Run the opcode if we can at this point + if (force || _video->getElapsedTime(handle) >= _scriptMan->getStoredMovieOpcodeTime()) + _scriptMan->runStoredMovieOpcode(); +} + bool ZipMode::operator== (const ZipMode &z) const { return z.name == name && z.id == id; } diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index c80f497e37..c7d36e585d 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -131,6 +131,8 @@ public: typedef void (*TimerProc)(MohawkEngine_Riven *vm); + void doVideoTimer(VideoHandle handle, bool force); + private: MohawkArchive *_extrasFile; // We need a separate handle for the extra data RivenConsole *_console; diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index b3d5369a84..8abce10f3b 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -536,6 +536,10 @@ void RivenScript::fadeAmbientSounds(uint16 op, uint16 argc, uint16 *argv) { // Command 38: Store an opcode for use when playing a movie (movie id, time high, time low, opcode, arguments...) void RivenScript::storeMovieOpcode(uint16 op, uint16 argc, uint16 *argv) { + // This opcode is used to delay an opcode's usage based on the elapsed + // time of a specified movie. However, every use in the game is for + // delaying an activateSLST opcode. + uint32 scriptSize = 6 + (argc - 4) * 2; // Create our dummy script @@ -557,13 +561,11 @@ void RivenScript::storeMovieOpcode(uint16 op, uint16 argc, uint16 *argv) { // Store the script RivenScriptManager::StoredMovieOpcode storedOp; storedOp.script = script; - storedOp.time = delayTime + _vm->getTotalPlayTime(); + storedOp.time = delayTime; storedOp.id = argv[0]; - // TODO: Actually store the movie and call it in our movie loop - // For now, just delete the script and move on - //_vm->_scriptMan->setStoredMovieOpcode(storedOp); - delete script; + // Store the opcode for later + _vm->_scriptMan->setStoredMovieOpcode(storedOp); } else { // Run immediately if we have no delay script->runScript(); @@ -716,18 +718,10 @@ void RivenScriptManager::setStoredMovieOpcode(const StoredMovieOpcode &op) { _storedMovieOpcode.time = op.time; } -void RivenScriptManager::runStoredMovieOpcode(uint16 id) { +void RivenScriptManager::runStoredMovieOpcode() { if (_storedMovieOpcode.script) { - if (_storedMovieOpcode.id == id) { - // If we've passed the time, run our script - if (_vm->getTotalPlayTime() >= _storedMovieOpcode.time) { - _storedMovieOpcode.script->runScript(); - clearStoredMovieOpcode(); - } - } else { - // We're on a completely different video, kill off any remaining opcode - clearStoredMovieOpcode(); - } + _storedMovieOpcode.script->runScript(); + clearStoredMovieOpcode(); } } diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 75d4592e55..2932ba5939 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -141,8 +141,10 @@ public: uint16 id; }; + uint16 getStoredMovieOpcodeID() { return _storedMovieOpcode.id; } + uint32 getStoredMovieOpcodeTime() { return _storedMovieOpcode.time; } void setStoredMovieOpcode(const StoredMovieOpcode &op); - void runStoredMovieOpcode(uint16 id); + void runStoredMovieOpcode(); void clearStoredMovieOpcode(); private: diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 0a74d058c9..eec6256276 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -133,6 +133,7 @@ void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) { break; case Common::KEYCODE_ESCAPE: continuePlaying = false; + _vm->doVideoTimer(videoHandle, true); break; default: break; @@ -208,14 +209,20 @@ bool VideoManager::updateMovies() { if (_videoStreams[i].loop) { _videoStreams[i]->seekToTime(_videoStreams[i].start); } else { + // Check the video time one last time before deleting it + _vm->doVideoTimer(i, true); delete _videoStreams[i].video; _videoStreams[i].clear(); continue; } } + // Nothing more to do if we're paused + if (_videoStreams[i]->isPaused()) + continue; + // Check if we need to draw a frame - if (!_videoStreams[i]->isPaused() && _videoStreams[i]->needsUpdate()) { + if (_videoStreams[i]->needsUpdate()) { const Graphics::Surface *frame = _videoStreams[i]->decodeNextFrame(); Graphics::Surface *convertedFrame = 0; @@ -266,6 +273,9 @@ bool VideoManager::updateMovies() { } } } + + // Check the video time + _vm->doVideoTimer(i, false); } // Return true if we need to update the screen -- cgit v1.2.3 From a495632e07e13ab0aaa2251681451393030c00ca Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 14 Jun 2011 10:46:48 -0400 Subject: MOHAWK: Finish implementation of Riven's stopSound() opcode --- engines/mohawk/riven_scripts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 8abce10f3b..161acb665f 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -407,14 +407,14 @@ void RivenScript::stopSound(uint16 op, uint16 argc, uint16 *argv) { return; // The argument is a bitflag for the setting. - // bit 0 is normal sound stopping (unused) + // bit 0 is normal sound stopping // bit 1 is ambient sound stopping // Having no flags set means clear all if (argv[0] & 2 || argv[0] == 0) _vm->_sound->stopAllSLST(); - if (argv[0] & 1) - warning("Unhandled stopSound() flag"); + if (argv[0] & 1 || argv[0] == 0) + _vm->_sound->stopSound(); } // Command 13: set mouse cursor (cursor_id) -- cgit v1.2.3 From 28e236dc6867036f7de2c6de6c8bb6ec8cef430d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 15 Jun 2011 01:17:47 +1000 Subject: TSAGE: Bugfixes for sound channel updates --- engines/tsage/sound.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index bc1e87d30a..ad39f72364 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2562,6 +2562,7 @@ void AdlibSoundDriver::updateChannel(int channel) { write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4)); write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15)); + portOffset = v440C2[v440B9[channel]]; portNum = portOffset + 0x20; portValue = 0; if (*(dataP + 17)) @@ -2576,11 +2577,12 @@ void AdlibSoundDriver::updateChannel(int channel) { write(portNum, portValue); write(0x40 + portOffset, (_portContents[0x40 + portOffset] & 0x3f) | (*(dataP + 22) << 6)); - _v44079[channel] = *(dataP + 23); + _v44079[channel] = 0x3F - *(dataP + 23); write(0x60 + portOffset, *(dataP + 25) | (*(dataP + 24) << 4)); write(0x80 + portOffset, *(dataP + 27) | (*(dataP + 26) << 4)); write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 28)); - write(0xC0 + portOffset, (_portContents[0xE0 + portOffset] & 0xF0) + + write(0xC0 + channel, (_portContents[0xC0 + channel] & 0xF0) | (*(dataP + 16) << 1) | *(dataP + 3)); _v44082[channel] = *(dataP + 3); -- cgit v1.2.3 From a7ee13a1ec6fab12374b784bd7b0c8335e184ea5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 15 Jun 2011 01:26:01 +1000 Subject: TSAGE: Properly destroy OPL instance on shutdown --- engines/tsage/sound.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index ad39f72364..f8f0cf6019 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2396,6 +2396,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { AdlibSoundDriver::~AdlibSoundDriver() { DEALLOCATE(_patchData); + OPLDestroy(_opl); } bool AdlibSoundDriver::open() { -- cgit v1.2.3 From 929e7ba4a50876cd065d4d09347f44f0a62b27e1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Jun 2011 17:32:58 +0200 Subject: SWORD1: Replace some sprintf uses --- engines/sword1/music.cpp | 21 +++++++-------------- engines/sword1/music.h | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index a291d80f85..265bebb000 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -47,8 +47,7 @@ namespace Sword1 { // These functions are only called from Music, so I'm just going to // assume that if locking is needed it has already been taken care of. -bool MusicHandle::play(const char *fileBase, bool loop) { - char fileName[30]; +bool MusicHandle::play(const Common::String &filename, bool loop) { stop(); // FIXME: How about using AudioStream::openStreamFile instead of the code below? @@ -57,8 +56,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { #ifdef USE_FLAC if (!_audioSource) { - sprintf(fileName, "%s.flac", fileBase); - if (_file.open(fileName)) { + if (_file.open(filename + ".flac")) { _audioSource = Audio::makeLoopingAudioStream(Audio::makeFLACStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); if (!_audioSource) _file.close(); @@ -66,8 +64,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { } if (!_audioSource) { - sprintf(fileName, "%s.fla", fileBase); - if (_file.open(fileName)) { + if (_file.open(filename + ".fla")) { _audioSource = Audio::makeLoopingAudioStream(Audio::makeFLACStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); if (!_audioSource) _file.close(); @@ -76,8 +73,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { #endif #ifdef USE_VORBIS if (!_audioSource) { - sprintf(fileName, "%s.ogg", fileBase); - if (_file.open(fileName)) { + if (_file.open(filename + ".ogg")) { _audioSource = Audio::makeLoopingAudioStream(Audio::makeVorbisStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); if (!_audioSource) _file.close(); @@ -86,8 +82,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) { #endif #ifdef USE_MAD if (!_audioSource) { - sprintf(fileName, "%s.mp3", fileBase); - if (_file.open(fileName)) { + if (_file.open(filename + ".mp3")) { _audioSource = Audio::makeLoopingAudioStream(Audio::makeMP3Stream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); if (!_audioSource) _file.close(); @@ -95,14 +90,12 @@ bool MusicHandle::play(const char *fileBase, bool loop) { } #endif if (!_audioSource) { - sprintf(fileName, "%s.wav", fileBase); - if (_file.open(fileName)) + if (_file.open(filename + ".wav")) _audioSource = Audio::makeLoopingAudioStream(Audio::makeWAVStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); } if (!_audioSource) { - sprintf(fileName, "%s.aif", fileBase); - if (_file.open(fileName)) + if (_file.open(filename + ".aif")) _audioSource = Audio::makeLoopingAudioStream(Audio::makeAIFFStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); } diff --git a/engines/sword1/music.h b/engines/sword1/music.h index 104bc1c536..4207019c13 100644 --- a/engines/sword1/music.h +++ b/engines/sword1/music.h @@ -43,7 +43,7 @@ private: public: MusicHandle() : _fading(0), _audioSource(NULL) {} virtual int readBuffer(int16 *buffer, const int numSamples); - bool play(const char *filename, bool loop); + bool play(const Common::String &filename, bool loop); bool playPSX(uint16 id, bool loop); void stop(); void fadeUp(); -- cgit v1.2.3 From e4a4aa30f743395342a4ce9cbd6bf6f3f81d6172 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Jun 2011 17:37:51 +0200 Subject: SWORD1: Cleanup music stream initialization --- engines/sword1/music.cpp | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 265bebb000..b4656ff89f 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -54,54 +54,58 @@ bool MusicHandle::play(const Common::String &filename, bool loop) { // I.e.: //_audioSource = Audio::AudioStream::openStreamFile(fileBase, 0, 0, loop ? 0 : 1); + Audio::RewindableAudioStream *stream = 0; + #ifdef USE_FLAC - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".flac")) { - _audioSource = Audio::makeLoopingAudioStream(Audio::makeFLACStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); - if (!_audioSource) + stream = Audio::makeFLACStream(&_file, DisposeAfterUse::NO); + if (!stream) _file.close(); } } - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".fla")) { - _audioSource = Audio::makeLoopingAudioStream(Audio::makeFLACStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); - if (!_audioSource) + stream = Audio::makeFLACStream(&_file, DisposeAfterUse::NO); + if (!stream) _file.close(); } } #endif #ifdef USE_VORBIS - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".ogg")) { - _audioSource = Audio::makeLoopingAudioStream(Audio::makeVorbisStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); - if (!_audioSource) + stream = Audio::makeVorbisStream(&_file, DisposeAfterUse::NO); + if (!stream) _file.close(); } } #endif #ifdef USE_MAD - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".mp3")) { - _audioSource = Audio::makeLoopingAudioStream(Audio::makeMP3Stream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); - if (!_audioSource) + stream = Audio::makeMP3Stream(&_file, DisposeAfterUse::NO); + if (!stream) _file.close(); } } #endif - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".wav")) - _audioSource = Audio::makeLoopingAudioStream(Audio::makeWAVStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); + stream = Audio::makeWAVStream(&_file, DisposeAfterUse::NO); } - if (!_audioSource) { + if (!stream) { if (_file.open(filename + ".aif")) - _audioSource = Audio::makeLoopingAudioStream(Audio::makeAIFFStream(&_file, DisposeAfterUse::NO), loop ? 0 : 1); + stream = Audio::makeAIFFStream(&_file, DisposeAfterUse::NO); } - if (!_audioSource) + if (!stream) return false; + _audioSource = Audio::makeLoopingAudioStream(stream, loop ? 0 : 1); + fadeUp(); return true; } @@ -212,12 +216,9 @@ int MusicHandle::readBuffer(int16 *buffer, const int numSamples) { } void MusicHandle::stop() { - if (_audioSource) { - delete _audioSource; - _audioSource = NULL; - } - if (_file.isOpen()) - _file.close(); + delete _audioSource; + _audioSource = NULL; + _file.close(); _fading = 0; } -- cgit v1.2.3 From 7c992d6598743fce09e6666f2c9a0f550ac5e870 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Jun 2011 17:52:32 +0200 Subject: DETECTOR: Merge ADParams into AdvancedMetaEngine --- engines/advancedDetector.cpp | 89 +++++++++++++++++++------------------- engines/advancedDetector.h | 76 ++++++++++++++------------------ engines/agi/detection.cpp | 4 +- engines/agos/detection.cpp | 8 ++-- engines/cine/detection.cpp | 6 +-- engines/cruise/detection.cpp | 4 +- engines/draci/detection.cpp | 2 +- engines/drascula/detection.cpp | 4 +- engines/gob/detection.cpp | 8 ++-- engines/groovie/detection.cpp | 6 +-- engines/kyra/detection.cpp | 6 +-- engines/lastexpress/detection.cpp | 4 +- engines/lure/detection.cpp | 8 ++-- engines/m4/detection.cpp | 8 ++-- engines/made/detection.cpp | 2 +- engines/mohawk/detection.cpp | 8 ++-- engines/parallaction/detection.cpp | 2 +- engines/saga/detection.cpp | 4 +- engines/sci/detection.cpp | 2 +- engines/sword25/detection.cpp | 6 +-- engines/teenagent/detection.cpp | 2 +- engines/testbed/detection.cpp | 4 +- engines/tinsel/detection.cpp | 10 +---- engines/toon/detection.cpp | 8 ++-- engines/touche/detection.cpp | 12 ++--- engines/tsage/detection.cpp | 6 +-- engines/tucker/detection.cpp | 4 +- 27 files changed, 143 insertions(+), 160 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index b0a304aad9..5a4c493bf7 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -34,12 +34,12 @@ #include "engines/advancedDetector.h" void AdvancedMetaEngine::upgradeTargetIfNecessary() const { - if (params.obsoleteList == 0) + if (_obsoleteList == 0) return; Common::String gameid = ConfMan.get("gameid"); - for (const ADObsoleteGameID *o = params.obsoleteList; o->from; ++o) { + for (const ADObsoleteGameID *o = _obsoleteList; o->from; ++o) { if (gameid.equalsIgnoreCase(o->from)) { gameid = o->to; ConfMan.set("gameid", gameid); @@ -65,11 +65,11 @@ namespace AdvancedDetector { GameDescriptor findGameID( const char *gameid, - const PlainGameDescriptor *gameDescriptors, + const PlainGameDescriptor *gameids, const ADObsoleteGameID *obsoleteList ) { // First search the list of supported gameids for a match. - const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameDescriptors); + const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids); if (g) return GameDescriptor(*g); @@ -79,7 +79,7 @@ GameDescriptor findGameID( const ADObsoleteGameID *o = obsoleteList; while (o->from) { if (0 == scumm_stricmp(gameid, o->from)) { - g = findPlainGameDescriptor(o->to, gameDescriptors); + g = findPlainGameDescriptor(o->to, gameids); if (g && g->description) return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")"); else @@ -146,9 +146,9 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD } void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const { - if (params.singleid != NULL) { + if (_singleid != NULL) { desc["preferredtarget"] = desc["gameid"]; - desc["gameid"] = params.singleid; + desc["gameid"] = _singleid; } if (!desc.contains("preferredtarget")) @@ -156,10 +156,10 @@ void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGame desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc); - if (params.flags & kADFlagUseExtraAsHint) + if (_flags & kADFlagUseExtraAsHint) desc["extra"] = realDesc->extra; - desc.setGUIOptions(realDesc->guioptions | params.guioptions); + desc.setGUIOptions(realDesc->guioptions | _guioptions); desc.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(realDesc->language)); if (realDesc->flags & ADGF_ADDENGLISH) @@ -200,14 +200,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { // Use fallback detector if there were no matches by other means const ADGameDescription *fallbackDesc = fallbackDetect(fslist); if (fallbackDesc != 0) { - GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors)); + GameDescriptor desc(toGameDescriptor(*fallbackDesc, _gameids)); updateGameDescriptor(desc, fallbackDesc); detectedGames.push_back(desc); } } else { // Otherwise use the found matches for (uint i = 0; i < matches.size(); i++) { - GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors)); + GameDescriptor desc(toGameDescriptor(*matches[i], _gameids)); updateGameDescriptor(desc, matches[i]); detectedGames.push_back(desc); } @@ -229,7 +229,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) language = Common::parseLanguage(ConfMan.get("language")); if (ConfMan.hasKey("platform")) platform = Common::parsePlatform(ConfMan.get("platform")); - if (params.flags & kADFlagUseExtraAsHint) + if (_flags & kADFlagUseExtraAsHint) if (ConfMan.hasKey("extra")) extra = ConfMan.get("extra"); @@ -266,7 +266,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (cleanupPirated(matches)) return Common::kNoGameDataFoundError; - if (params.singleid == NULL) { + if (_singleid == NULL) { for (uint i = 0; i < matches.size(); i++) { if (matches[i]->gameid == gameid) { agdDesc = matches[i]; @@ -283,7 +283,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (agdDesc != 0) { // Seems we found a fallback match. But first perform a basic // sanity check: the gameid must match. - if (params.singleid == NULL && agdDesc->gameid != gameid) + if (_singleid == NULL && agdDesc->gameid != gameid) agdDesc = 0; } } @@ -297,10 +297,10 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (agdDesc->flags & ADGF_ADDENGLISH) lang += " " + getGameGUIOptionsDescriptionLanguage(Common::EN_ANY); - Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions, lang); + Common::updateGameGUIOptions(agdDesc->guioptions | _guioptions, lang); - debug(2, "Running %s", toGameDescriptor(*agdDesc, params.gameDescriptors).description().c_str()); + debug(2, "Running %s", toGameDescriptor(*agdDesc, _gameids).description().c_str()); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else @@ -345,11 +345,11 @@ void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMa if (file->isDirectory()) { Common::FSList files; - if (!params.directoryGlobs) + if (!_directoryGlobs) continue; bool matched = false; - for (const char * const *glob = params.directoryGlobs; *glob; glob++) + for (const char * const *glob = _directoryGlobs; *glob; glob++) if (file->getName().matchString(*glob, true)) { matched = true; break; @@ -388,11 +388,11 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm debug(3, "Starting detection in dir '%s'", parent.getPath().c_str()); // First we compose a hashmap of all files in fslist. - composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth)); + composeFileHashMap(fslist, allFiles, (_maxScanDepth == 0 ? 1 : _maxScanDepth)); // Check which files are included in some ADGameDescription *and* present // in fslist. Compute MD5s and file sizes for these files. - for (descPtr = params.descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += params.descItemSize) { + for (descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize) { g = (const ADGameDescription *)descPtr; for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) { @@ -409,7 +409,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm Common::MacResManager macResMan; if (macResMan.open(parent, fname)) { - tmp.md5 = macResMan.computeResForkMD5AsString(params.md5Bytes); + tmp.md5 = macResMan.computeResForkMD5AsString(_md5Bytes); tmp.size = macResMan.getResForkDataSize(); debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5.c_str()); filesSizeMD5[fname] = tmp; @@ -422,7 +422,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - tmp.md5 = Common::computeStreamMD5AsString(testFile, params.md5Bytes); + tmp.md5 = Common::computeStreamMD5AsString(testFile, _md5Bytes); } else { tmp.size = -1; } @@ -440,7 +440,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm // MD5 based matching uint i; - for (i = 0, descPtr = params.descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += params.descItemSize, ++i) { + for (i = 0, descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize, ++i) { g = (const ADGameDescription *)descPtr; bool fileMissing = false; @@ -452,7 +452,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm continue; } - if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra) + if ((_flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra) continue; bool allFilesPresent = true; @@ -525,7 +525,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm } // Filename based fallback - if (params.fileBasedFallback != 0) + if (_fileBasedFallback != 0) matched = detectGameFilebased(allFiles); } @@ -539,7 +539,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) int maxNumMatchedFiles = 0; const ADGameDescription *matchedDesc = 0; - for (ptr = params.fileBasedFallback; ptr->desc; ++ptr) { + for (ptr = _fileBasedFallback; ptr->desc; ++ptr) { const ADGameDescription *agdesc = (const ADGameDescription *)ptr->desc; int numMatchedFiles = 0; bool fileMissing = false; @@ -570,7 +570,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) if (matchedDesc) { // We got a match matched.push_back(matchedDesc); - if (params.flags & kADFlagPrintWarningOnFileBasedFallback) { + if (_flags & kADFlagPrintWarningOnFileBasedFallback) { Common::String report = Common::String::format(_("Your game version has been detected using " "filename matching as a variant of %s."), matchedDesc->gameid); report += "\n"; @@ -586,38 +586,37 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) } GameList AdvancedMetaEngine::getSupportedGames() const { - if (params.singleid != NULL) { + if (_singleid != NULL) { GameList gl; - const PlainGameDescriptor *g = params.gameDescriptors; + const PlainGameDescriptor *g = _gameids; while (g->gameid) { - if (0 == scumm_stricmp(params.singleid, g->gameid)) { + if (0 == scumm_stricmp(_singleid, g->gameid)) { gl.push_back(GameDescriptor(g->gameid, g->description)); return gl; } g++; } - error("Engine %s doesn't have its singleid specified in ids list", params.singleid); + error("Engine %s doesn't have its singleid specified in ids list", _singleid); } - return GameList(params.gameDescriptors); + return GameList(_gameids); } GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const { - return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList); + return AdvancedDetector::findGameID(gameid, _gameids, _obsoleteList); } -AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors) { - params.descs = (const byte *)descs; - params.descItemSize = descItemSize; - params.md5Bytes = 5000; - params.gameDescriptors = gameDescriptors; - params.obsoleteList = NULL; - params.singleid = NULL; - params.fileBasedFallback = NULL; - params.flags = 0; - params.guioptions = Common::GUIO_NONE; - params.depth = 1; - params.directoryGlobs = NULL; +AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids) + : _gameDescriptors((const byte *)descs), _descItemSize(descItemSize), _gameids(gameids) { + + _md5Bytes = 5000; + _obsoleteList = NULL; + _singleid = NULL; + _fileBasedFallback = NULL; + _flags = 0; + _guioptions = Common::GUIO_NONE; + _maxScanDepth = 1; + _directoryGlobs = NULL; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index e5922bea4a..8eb215ef18 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -118,26 +118,40 @@ enum ADFlags { kADFlagUseExtraAsHint = (1 << 2) }; + +namespace AdvancedDetector { + /** - * A structure containing all parameters for the AdvancedDetector. - * Typically, an engine will have a single instance of this which is - * used by its AdvancedMetaEngine subclass as a parameter to the - * primary AdvancedMetaEngine constructor. + * Scan through the game descriptors specified in params and search for + * 'gameid' in there. If a match is found, returns a GameDescriptor + * with gameid and description set. */ -struct ADParams { +GameDescriptor findGameID( + const char *gameid, + const PlainGameDescriptor *gameids, + const ADObsoleteGameID *obsoleteList = 0 + ); + +} // End of namespace AdvancedDetector + +/** + * A MetaEngine implementation based around the advanced detector code. + */ +class AdvancedMetaEngine : public MetaEngine { +protected: /** * Pointer to an array of objects which are either ADGameDescription * or superset structures (i.e. start with an ADGameDescription member. * The list is terminated by an entry with a gameid equal to 0 * (see AD_TABLE_END_MARKER). */ - const byte *descs; + const byte *_gameDescriptors; /** * The size of a single entry of the above descs array. Always * must be >= sizeof(ADGameDescription). */ - uint descItemSize; + uint _descItemSize; /** * The number of bytes to compute MD5 sum for. The AdvancedDetector @@ -147,27 +161,27 @@ struct ADParams { * Typically this will be set to something between 5 and 50 kilobyte, * but arbitrary non-zero values are possible. */ - uint md5Bytes; + uint _md5Bytes; /** * A list of all gameids (and their corresponding descriptions) supported * by this engine. */ - const PlainGameDescriptor *gameDescriptors; + const PlainGameDescriptor *_gameids; /** * Structure for autoupgrading obsolete targets (optional). * * @todo Properly explain this. */ - const ADObsoleteGameID *obsoleteList; + const ADObsoleteGameID *_obsoleteList; /** * Name of single gameid (optional). * * @todo Properly explain this -- what does it do? */ - const char *singleid; + const char *_singleid; /** * List of files for file-based fallback detection (optional). @@ -177,63 +191,39 @@ struct ADParams { * * @todo Properly explain this */ - const ADFileBasedFallback *fileBasedFallback; + const ADFileBasedFallback *_fileBasedFallback; /** * A bitmask of flags which can be used to configure the behavior * of the AdvancedDetector. Refer to ADFlags for a list of flags * that can be ORed together and passed here. */ - uint32 flags; + uint32 _flags; /** * A bitmask of game GUI options which will be added to each * entry in addition to per-game options. Refer to GameGUIOption * enum for the list. */ - uint32 guioptions; + uint32 _guioptions; /** - * Maximum depth of directories to look up + * Maximum depth of directories to look up. * If set to 0, the depth is 1 level */ - uint32 depth; + uint32 _maxScanDepth; /** * Case-insensitive list of directory globs which could be used for - * going deeper int directory structure. + * going deeper into the directory structure. * @see String::matchString() method for format description. * * @note Last item must be 0 */ - const char * const *directoryGlobs; -}; + const char * const *_directoryGlobs; - -namespace AdvancedDetector { - -/** - * Scan through the game descriptors specified in params and search for - * 'gameid' in there. If a match is found, returns a GameDescriptor - * with gameid and description set. - */ -GameDescriptor findGameID( - const char *gameid, - const PlainGameDescriptor *gameDescriptors, - const ADObsoleteGameID *obsoleteList = 0 - ); - -} // End of namespace AdvancedDetector - -/** - * A MetaEngine implementation based around the advanced detector code. - */ -class AdvancedMetaEngine : public MetaEngine { -protected: - ADParams params; public: - AdvancedMetaEngine(const ADParams &dp) : params(dp) {} - AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors); + AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids); /** * Returns list of targets supported by the engine. diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index b0e055edcc..427ffef1ad 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -137,8 +137,8 @@ class AgiMetaEngine : public AdvancedMetaEngine { public: AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames) { - params.singleid = "agi"; - params.guioptions = Common::GUIO_NOSPEECH; + _singleid = "agi"; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index dbd1743304..06606e71b3 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -92,10 +92,10 @@ using namespace AGOS; class AgosMetaEngine : public AdvancedMetaEngine { public: AgosMetaEngine() : AdvancedMetaEngine(AGOS::gameDescriptions, sizeof(AGOS::AGOSGameDescription), agosGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.guioptions = Common::GUIO_NOLAUNCHLOAD; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _obsoleteList = obsoleteGameIDsTable; + _guioptions = Common::GUIO_NOLAUNCHLOAD; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 89c81c2599..691acea2b3 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -63,9 +63,9 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class CineMetaEngine : public AdvancedMetaEngine { public: CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "cine"; - params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "cine"; + _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; } virtual const char *getName() const { diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index f6f8db4f3a..5be2fdeeea 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -220,8 +220,8 @@ static const CRUISEGameDescription gameDescriptions[] = { class CruiseMetaEngine : public AdvancedMetaEngine { public: CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) { - params.singleid = "cruise"; - params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + _singleid = "cruise"; + _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; } virtual const char *getName() const { diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index cf0413ffa9..b7e83e1edb 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -86,7 +86,7 @@ const ADGameDescription gameDescriptions[] = { class DraciMetaEngine : public AdvancedMetaEngine { public: DraciMetaEngine() : AdvancedMetaEngine(Draci::gameDescriptions, sizeof(ADGameDescription), draciGames) { - params.singleid = "draci"; + _singleid = "draci"; } virtual const char *getName() const { diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 9494bfa66b..2249a49e4d 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -269,8 +269,8 @@ static const DrasculaGameDescription gameDescriptions[] = { class DrasculaMetaEngine : public AdvancedMetaEngine { public: DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) { - params.singleid = "drascula"; - params.guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; + _singleid = "drascula"; + _guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 2ecd6b741e..e30380a5a5 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -89,10 +89,10 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class GobMetaEngine : public AdvancedMetaEngine { public: GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "gob"; - params.fileBasedFallback = Gob::fileBased; - params.guioptions = Common::GUIO_NOLAUNCHLOAD; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "gob"; + _fileBasedFallback = Gob::fileBased; + _guioptions = Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 62ee65d74a..cb0f2296fb 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -205,9 +205,9 @@ static const GroovieGameDescription gameDescriptions[] = { class GroovieMetaEngine : public AdvancedMetaEngine { public: GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames) { - params.singleid = "groovie"; - params.flags = kADFlagUseExtraAsHint; - params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + _singleid = "groovie"; + _flags = kADFlagUseExtraAsHint; + _guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; } const char *getName() const { diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 6589c2b45b..a6af584fb8 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -52,9 +52,9 @@ const char * const directoryGlobs[] = { class KyraMetaEngine : public AdvancedMetaEngine { public: KyraMetaEngine() : AdvancedMetaEngine(adGameDescs, sizeof(KYRAGameDescription), gameList) { - params.md5Bytes = 1024 * 1024; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _md5Bytes = 1024 * 1024; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } const char *getName() const { return "Kyra"; diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index bf575b63f8..369d815543 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -181,8 +181,8 @@ static const ADGameDescription gameDescriptions[] = { class LastExpressMetaEngine : public AdvancedMetaEngine { public: LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) { - params.singleid = "lastexpress"; - params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + _singleid = "lastexpress"; + _guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; } const char *getName() const { diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 83ede92569..397d965396 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -178,10 +178,10 @@ static const LureGameDescription gameDescriptions[] = { class LureMetaEngine : public AdvancedMetaEngine { public: LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) { - params.md5Bytes = 1024; - params.singleid = "lure"; - params.flags = kADFlagUseExtraAsHint; - params.guioptions = Common::GUIO_NOSPEECH; + _md5Bytes = 1024; + _singleid = "lure"; + _flags = kADFlagUseExtraAsHint; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index bab17d9e1d..02ed967777 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -387,10 +387,10 @@ static const char *directoryGlobs[] = { class M4MetaEngine : public AdvancedMetaEngine { public: M4MetaEngine() : AdvancedMetaEngine(M4::gameDescriptions, sizeof(M4::M4GameDescription), m4Games) { - params.singleid = "m4"; - params.guioptions = Common::GUIO_NOMIDI; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _singleid = "m4"; + _guioptions = Common::GUIO_NOMIDI; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index a0576a458e..fcbee9cb32 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -528,7 +528,7 @@ static MadeGameDescription g_fallbackDesc = { class MadeMetaEngine : public AdvancedMetaEngine { public: MadeMetaEngine() : AdvancedMetaEngine(Made::gameDescriptions, sizeof(Made::MadeGameDescription), madeGames) { - params.singleid = "made"; + _singleid = "made"; } virtual const char *getName() const { diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index a7442729d2..e6f60e3cb5 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -161,10 +161,10 @@ static const char *directoryGlobs[] = { class MohawkMetaEngine : public AdvancedMetaEngine { public: MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) { - params.singleid = "mohawk"; - params.fileBasedFallback = Mohawk::fileBased; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _singleid = "mohawk"; + _fileBasedFallback = Mohawk::fileBased; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Mohawk"; diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 09f6fa5e2e..d0610f7a29 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -223,7 +223,7 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { class ParallactionMetaEngine : public AdvancedMetaEngine { public: ParallactionMetaEngine() : AdvancedMetaEngine(Parallaction::gameDescriptions, sizeof(Parallaction::PARALLACTIONGameDescription), parallactionGames) { - params.guioptions = Common::GUIO_NOLAUNCHLOAD; + _guioptions = Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index ece90855b7..2bfa04c30a 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -104,8 +104,8 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class SagaMetaEngine : public AdvancedMetaEngine { public: SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "saga"; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "saga"; } virtual const char *getName() const { diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 302ba13247..8d53ce9937 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -374,7 +374,7 @@ static char s_fallbackGameIdBuf[256]; class SciMetaEngine : public AdvancedMetaEngine { public: SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles) { - params.singleid = "sci"; + _singleid = "sci"; } virtual const char *getName() const { diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index c704b3e833..b2f5795663 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -44,9 +44,9 @@ static const char *directoryGlobs[] = { class Sword25MetaEngine : public AdvancedMetaEngine { public: Sword25MetaEngine() : AdvancedMetaEngine(Sword25::gameDescriptions, sizeof(ADGameDescription), sword25Game) { - params.guioptions = Common::GUIO_NOMIDI; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _guioptions = Common::GUIO_NOMIDI; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Sword25"; diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index b684560bc7..b965e616f1 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -86,7 +86,7 @@ enum { class TeenAgentMetaEngine : public AdvancedMetaEngine { public: TeenAgentMetaEngine() : AdvancedMetaEngine(teenAgentGameDescriptions, sizeof(ADGameDescription), teenAgentGames) { - params.singleid = "teenagent"; + _singleid = "teenagent"; } virtual const char *getName() const { diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 2c3d5b43c5..b869bb8ebb 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -48,8 +48,8 @@ static const ADGameDescription testbedDescriptions[] = { class TestbedMetaEngine : public AdvancedMetaEngine { public: TestbedMetaEngine() : AdvancedMetaEngine(testbedDescriptions, sizeof(ADGameDescription), testbed_setting) { - params.md5Bytes = 512; - params.singleid = "testbed"; + _md5Bytes = 512; + _singleid = "testbed"; } virtual const char *getName() const { diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 59a567bc63..6a221da0eb 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -77,7 +77,7 @@ static const PlainGameDescriptor tinselGames[] = { class TinselMetaEngine : public AdvancedMetaEngine { public: TinselMetaEngine() : AdvancedMetaEngine(Tinsel::gameDescriptions, sizeof(Tinsel::TinselGameDescription), tinselGames) { - params.singleid = "tinsel"; + _singleid = "tinsel"; } virtual const char *getName() const { @@ -242,7 +242,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - tmp.md5 = computeStreamMD5AsString(testFile, params.md5Bytes); + tmp.md5 = computeStreamMD5AsString(testFile, _md5Bytes); } else { tmp.size = -1; } @@ -262,11 +262,6 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & bool fileMissing = false; - if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra) - continue; - - bool allFilesPresent = true; - // Try to match all files for this game for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) { // Get the next filename, stripping off any '1' suffix character @@ -284,7 +279,6 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (!filesSizeMD5.contains(tstr)) { fileMissing = true; - allFilesPresent = false; break; } diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index 8ddfcd4fed..e72c61ac68 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -120,10 +120,10 @@ static const char * const directoryGlobs[] = { class ToonMetaEngine : public AdvancedMetaEngine { public: ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) { - params.singleid = "toon"; - params.fileBasedFallback = Toon::fileBasedFallback; - params.depth = 3; - params.directoryGlobs = directoryGlobs; + _singleid = "toon"; + _fileBasedFallback = Toon::fileBasedFallback; + _maxScanDepth = 3; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Toon"; diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 3e324b5685..d1dde96f59 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -129,12 +129,12 @@ static const char *directoryGlobs[] = { class ToucheMetaEngine : public AdvancedMetaEngine { public: ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { - params.md5Bytes = 4096; - params.singleid = "touche"; - params.fileBasedFallback = Touche::fileBasedFallback; - params.flags = kADFlagPrintWarningOnFileBasedFallback; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _md5Bytes = 4096; + _singleid = "touche"; + _fileBasedFallback = Touche::fileBasedFallback; + _flags = kADFlagPrintWarningOnFileBasedFallback; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Touche"; diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index e9e80312b9..aaa9030a04 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -73,9 +73,9 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) { - params.md5Bytes = 5000; - params.singleid = "tsage"; - params.guioptions = Common::GUIO_NOSPEECH; + _md5Bytes = 5000; + _singleid = "tsage"; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 3eb3973371..d7d829e1da 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -115,8 +115,8 @@ static const ADGameDescription tuckerDemoGameDescription = { class TuckerMetaEngine : public AdvancedMetaEngine { public: TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) { - params.md5Bytes = 512; - params.singleid = "tucker"; + _md5Bytes = 512; + _singleid = "tucker"; } virtual const char *getName() const { -- cgit v1.2.3 From 01c4d900168c5521fa9b8342f919eb12570fac0f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Jun 2011 17:57:16 +0200 Subject: ENGINES: cleanup --- engines/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/game.h b/engines/game.h index f9988c2965..0d0fc853a3 100644 --- a/engines/game.h +++ b/engines/game.h @@ -53,7 +53,7 @@ struct PlainGameDescriptorGUIOpts { /** * Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor * matching the given gameid. If not match is found return 0. - * The end of the list must marked by a PlainGameDescriptor with gameid equal to 0. + * The end of the list must be marked by an entry with gameid 0. */ const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list); -- cgit v1.2.3 From 6412d091268d299f7f4d31382b0e4e9e4e352ad9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 13 Jun 2011 01:25:53 +0200 Subject: DETECTOR: Remove PlainGameDescriptorGUIOpts --- engines/game.cpp | 11 +++------- engines/game.h | 16 ++------------- engines/sword1/detection.cpp | 48 ++++++++++++++++++++++---------------------- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git a/engines/game.cpp b/engines/game.cpp index a14edb8af4..c6d9905b52 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -38,17 +38,12 @@ GameDescriptor::GameDescriptor() { setVal("description", ""); } -GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd) { - setVal("gameid", pgd.gameid); - setVal("description", pgd.description); -} - -GameDescriptor::GameDescriptor(const PlainGameDescriptorGUIOpts &pgd) { +GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd, uint32 guioptions) { setVal("gameid", pgd.gameid); setVal("description", pgd.description); - if (pgd.guioptions != 0) - setVal("guioptions", Common::getGameGUIOptionsDescription(pgd.guioptions)); + if (guioptions != 0) + setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions)); } GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions) { diff --git a/engines/game.h b/engines/game.h index 0d0fc853a3..3216cfb628 100644 --- a/engines/game.h +++ b/engines/game.h @@ -39,17 +39,6 @@ struct PlainGameDescriptor { const char *description; }; -/** - * Same as PlainGameDsscriptor except it adds Game GUI options parameter - * This is a plain struct to make it possible to declare NULL-terminated C arrays - * consisting of PlainGameDescriptors. - */ -struct PlainGameDescriptorGUIOpts { - const char *gameid; - const char *description; - uint32 guioptions; -}; - /** * Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor * matching the given gameid. If not match is found return 0. @@ -67,8 +56,7 @@ const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const Pla class GameDescriptor : public Common::StringMap { public: GameDescriptor(); - GameDescriptor(const PlainGameDescriptor &pgd); - GameDescriptor(const PlainGameDescriptorGUIOpts &pgd); + GameDescriptor(const PlainGameDescriptor &pgd, uint32 guioptions = 0); GameDescriptor(const Common::String &gameid, const Common::String &description, Common::Language language = Common::UNK_LANG, @@ -102,7 +90,7 @@ public: GameList(const GameList &list) : Common::Array(list) {} GameList(const PlainGameDescriptor *g) { while (g->gameid) { - push_back(GameDescriptor(g->gameid, g->description)); + push_back(GameDescriptor(*g)); g++; } } diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 48c3a0d14d..0c1e74082f 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -33,18 +33,18 @@ #include "engines/metaengine.h" /* Broken Sword */ -static const PlainGameDescriptorGUIOpts sword1FullSettings = - {"sword1", "Broken Sword: The Shadow of the Templars", Common::GUIO_NOMIDI}; -static const PlainGameDescriptorGUIOpts sword1DemoSettings = - {"sword1demo", "Broken Sword: The Shadow of the Templars (Demo)", Common::GUIO_NOMIDI}; -static const PlainGameDescriptorGUIOpts sword1MacFullSettings = - {"sword1mac", "Broken Sword: The Shadow of the Templars (Mac)", Common::GUIO_NOMIDI}; -static const PlainGameDescriptorGUIOpts sword1MacDemoSettings = - {"sword1macdemo", "Broken Sword: The Shadow of the Templars (Mac demo)", Common::GUIO_NOMIDI}; -static const PlainGameDescriptorGUIOpts sword1PSXSettings = - {"sword1psx", "Broken Sword: The Shadow of the Templars (PlayStation)", Common::GUIO_NOMIDI}; -static const PlainGameDescriptorGUIOpts sword1PSXDemoSettings = - {"sword1psxdemo", "Broken Sword: The Shadow of the Templars (PlayStation demo)", Common::GUIO_NOMIDI}; +static const PlainGameDescriptor sword1FullSettings = + {"sword1", "Broken Sword: The Shadow of the Templars"}; +static const PlainGameDescriptor sword1DemoSettings = + {"sword1demo", "Broken Sword: The Shadow of the Templars (Demo)"}; +static const PlainGameDescriptor sword1MacFullSettings = + {"sword1mac", "Broken Sword: The Shadow of the Templars (Mac)"}; +static const PlainGameDescriptor sword1MacDemoSettings = + {"sword1macdemo", "Broken Sword: The Shadow of the Templars (Mac demo)"}; +static const PlainGameDescriptor sword1PSXSettings = + {"sword1psx", "Broken Sword: The Shadow of the Templars (PlayStation)"}; +static const PlainGameDescriptor sword1PSXDemoSettings = + {"sword1psxdemo", "Broken Sword: The Shadow of the Templars (PlayStation demo)"}; // check these subdirectories (if present) @@ -117,12 +117,12 @@ bool Sword1::SwordEngine::hasFeature(EngineFeature f) const { GameList SwordMetaEngine::getSupportedGames() const { GameList games; - games.push_back(sword1FullSettings); - games.push_back(sword1DemoSettings); - games.push_back(sword1MacFullSettings); - games.push_back(sword1MacDemoSettings); - games.push_back(sword1PSXSettings); - games.push_back(sword1PSXDemoSettings); + games.push_back(GameDescriptor(sword1FullSettings, Common::GUIO_NOMIDI)); + games.push_back(GameDescriptor(sword1DemoSettings, Common::GUIO_NOMIDI)); + games.push_back(GameDescriptor(sword1MacFullSettings, Common::GUIO_NOMIDI)); + games.push_back(GameDescriptor(sword1MacDemoSettings, Common::GUIO_NOMIDI)); + games.push_back(GameDescriptor(sword1PSXSettings, Common::GUIO_NOMIDI)); + games.push_back(GameDescriptor(sword1PSXDemoSettings, Common::GUIO_NOMIDI)); return games; } @@ -198,17 +198,17 @@ GameList SwordMetaEngine::detectGames(const Common::FSList &fslist) const { psxDemoFilesFound = false; if (mainFilesFound && pcFilesFound && demoFilesFound) - detectedGames.push_back(sword1DemoSettings); + detectedGames.push_back(GameDescriptor(sword1DemoSettings, Common::GUIO_NOMIDI)); else if (mainFilesFound && pcFilesFound && psxFilesFound) - detectedGames.push_back(sword1PSXSettings); + detectedGames.push_back(GameDescriptor(sword1PSXSettings, Common::GUIO_NOMIDI)); else if (mainFilesFound && pcFilesFound && psxDemoFilesFound) - detectedGames.push_back(sword1PSXDemoSettings); + detectedGames.push_back(GameDescriptor(sword1PSXDemoSettings, Common::GUIO_NOMIDI)); else if (mainFilesFound && pcFilesFound && !psxFilesFound) - detectedGames.push_back(sword1FullSettings); + detectedGames.push_back(GameDescriptor(sword1FullSettings, Common::GUIO_NOMIDI)); else if (mainFilesFound && macFilesFound) - detectedGames.push_back(sword1MacFullSettings); + detectedGames.push_back(GameDescriptor(sword1MacFullSettings, Common::GUIO_NOMIDI)); else if (mainFilesFound && macDemoFilesFound) - detectedGames.push_back(sword1MacDemoSettings); + detectedGames.push_back(GameDescriptor(sword1MacDemoSettings, Common::GUIO_NOMIDI)); return detectedGames; } -- cgit v1.2.3 From 593b929047434eefa9b6dfb73730f7d502c4ff10 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 15:25:33 +0200 Subject: DETECTOR: Separate code for handling obsolete gameids from advanced detector This includes a renaming of ADObsoleteGameID to Engine::ObsoleteGameID, and AdvancedDetector::findGameID now is Engines::findGameID. Doxygen comments were added or improved --- engines/advancedDetector.cpp | 73 ++++----------------------------- engines/advancedDetector.h | 35 ++-------------- engines/agos/detection.cpp | 14 ++++++- engines/cine/detection.cpp | 13 +++++- engines/gob/detection.cpp | 13 +++++- engines/module.mk | 1 + engines/obsolete.cpp | 88 ++++++++++++++++++++++++++++++++++++++++ engines/obsolete.h | 78 +++++++++++++++++++++++++++++++++++ engines/saga/detection.cpp | 14 ++++++- engines/scumm/detection.cpp | 17 +------- engines/scumm/detection_tables.h | 4 +- 11 files changed, 228 insertions(+), 122 deletions(-) create mode 100644 engines/obsolete.cpp create mode 100644 engines/obsolete.h diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 5a4c493bf7..21807cb5f9 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -32,68 +32,7 @@ #include "common/translation.h" #include "engines/advancedDetector.h" - -void AdvancedMetaEngine::upgradeTargetIfNecessary() const { - if (_obsoleteList == 0) - return; - - Common::String gameid = ConfMan.get("gameid"); - - for (const ADObsoleteGameID *o = _obsoleteList; o->from; ++o) { - if (gameid.equalsIgnoreCase(o->from)) { - gameid = o->to; - ConfMan.set("gameid", gameid); - - if (o->platform != Common::kPlatformUnknown) - ConfMan.set("platform", Common::getPlatformCode(o->platform)); - - warning("Target upgraded from %s to %s", o->from, o->to); - - // WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching - // undefined target adds launcher entry" - if (ConfMan.hasKey("id_came_from_command_line")) { - warning("Target came from command line. Skipping save"); - } else { - ConfMan.flushToDisk(); - } - break; - } - } -} - -namespace AdvancedDetector { - -GameDescriptor findGameID( - const char *gameid, - const PlainGameDescriptor *gameids, - const ADObsoleteGameID *obsoleteList - ) { - // First search the list of supported gameids for a match. - const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids); - if (g) - return GameDescriptor(*g); - - // If we didn't find the gameid in the main list, check if it - // is an obsolete game id. - if (obsoleteList != 0) { - const ADObsoleteGameID *o = obsoleteList; - while (o->from) { - if (0 == scumm_stricmp(gameid, o->from)) { - g = findPlainGameDescriptor(o->to, gameids); - if (g && g->description) - return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")"); - else - return GameDescriptor(gameid, "Obsolete game ID"); - } - o++; - } - } - - // No match found - return GameDescriptor(); -} - -} // End of namespace AdvancedDetector +#include "engines/obsolete.h" static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGameDescriptor *sg) { const char *title = 0; @@ -218,7 +157,6 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); - upgradeTargetIfNecessary(); const ADGameDescription *agdDesc = 0; Common::Language language = Common::UNK_LANG; @@ -605,14 +543,19 @@ GameList AdvancedMetaEngine::getSupportedGames() const { } GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const { - return AdvancedDetector::findGameID(gameid, _gameids, _obsoleteList); + // First search the list of supported gameids for a match. + const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, _gameids); + if (g) + return GameDescriptor(*g); + + // No match found + return GameDescriptor(); } AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids) : _gameDescriptors((const byte *)descs), _descItemSize(descItemSize), _gameids(gameids) { _md5Bytes = 5000; - _obsoleteList = NULL; _singleid = NULL; _fileBasedFallback = NULL; _flags = 0; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 8eb215ef18..5f7bfa401c 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ + #ifndef ENGINES_ADVANCED_DETECTOR_H #define ENGINES_ADVANCED_DETECTOR_H @@ -73,7 +74,7 @@ struct ADGameDescription { /** * A list of pointers to ADGameDescription structs (or subclasses thereof). */ -typedef Common::Array ADGameDescList; +typedef Common::Array ADGameDescList; /** * End marker for a table of ADGameDescription structs. Use this to @@ -82,13 +83,6 @@ typedef Common::Array ADGameDescList; #define AD_TABLE_END_MARKER \ { NULL, NULL, { { NULL, 0, NULL, 0 } }, Common::UNK_LANG, Common::kPlatformUnknown, ADGF_NO_FLAGS, Common::GUIO_NONE } - -struct ADObsoleteGameID { - const char *from; - const char *to; - Common::Platform platform; -}; - struct ADFileBasedFallback { /** * Pointer to an ADGameDescription or subclass thereof which will get @@ -119,21 +113,6 @@ enum ADFlags { }; -namespace AdvancedDetector { - -/** - * Scan through the game descriptors specified in params and search for - * 'gameid' in there. If a match is found, returns a GameDescriptor - * with gameid and description set. - */ -GameDescriptor findGameID( - const char *gameid, - const PlainGameDescriptor *gameids, - const ADObsoleteGameID *obsoleteList = 0 - ); - -} // End of namespace AdvancedDetector - /** * A MetaEngine implementation based around the advanced detector code. */ @@ -169,13 +148,6 @@ protected: */ const PlainGameDescriptor *_gameids; - /** - * Structure for autoupgrading obsolete targets (optional). - * - * @todo Properly explain this. - */ - const ADObsoleteGameID *_obsoleteList; - /** * Name of single gameid (optional). * @@ -274,8 +246,7 @@ protected: */ ADGameDescList detectGameFilebased(const FileMap &allFiles) const; - void upgradeTargetIfNecessary() const; - + // TODO void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const; /** diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 06606e71b3..2be888b92a 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -23,6 +23,7 @@ #include "base/plugins.h" #include "engines/advancedDetector.h" +#include "engines/obsolete.h" #include "common/config-manager.h" #include "common/savefile.h" #include "common/system.h" @@ -48,7 +49,7 @@ struct AGOSGameDescription { * corresponding new target and platform combination. * */ -static const ADObsoleteGameID obsoleteGameIDsTable[] = { +static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"simon1acorn", "simon1", Common::kPlatformAcorn}, {"simon1amiga", "simon1", Common::kPlatformAmiga}, {"simon1cd32", "simon1", Common::kPlatformAmiga}, @@ -92,12 +93,15 @@ using namespace AGOS; class AgosMetaEngine : public AdvancedMetaEngine { public: AgosMetaEngine() : AdvancedMetaEngine(AGOS::gameDescriptions, sizeof(AGOS::AGOSGameDescription), agosGames) { - _obsoleteList = obsoleteGameIDsTable; _guioptions = Common::GUIO_NOLAUNCHLOAD; _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } + virtual GameDescriptor findGame(const char *gameid) const { + return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable); + } + virtual const char *getName() const { return "AGOS"; } @@ -107,7 +111,13 @@ public: } virtual bool hasFeature(MetaEngineFeature f) const; + + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const { + Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable); + return AdvancedMetaEngine::createInstance(syst, engine); + } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; + virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; }; diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 691acea2b3..cffeb29418 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -23,6 +23,7 @@ #include "base/plugins.h" #include "engines/advancedDetector.h" +#include "engines/obsolete.h" #include "common/system.h" #include "common/textconsole.h" @@ -52,7 +53,7 @@ static const PlainGameDescriptor cineGames[] = { {0, 0} }; -static const ADObsoleteGameID obsoleteGameIDsTable[] = { +static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"fw", "cine", Common::kPlatformUnknown}, {"os", "cine", Common::kPlatformUnknown}, {0, 0, Common::kPlatformUnknown} @@ -63,11 +64,14 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class CineMetaEngine : public AdvancedMetaEngine { public: CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) { - _obsoleteList = obsoleteGameIDsTable; _singleid = "cine"; _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; } + virtual GameDescriptor findGame(const char *gameid) const { + return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable); + } + virtual const char *getName() const { return "Cine"; } @@ -76,7 +80,12 @@ public: return "Future Wars & Operation Stealth (C) Delphine Software"; } + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const { + Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable); + return AdvancedMetaEngine::createInstance(syst, engine); + } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; + virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index e30380a5a5..2050539d60 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -22,6 +22,7 @@ #include "base/plugins.h" #include "engines/advancedDetector.h" +#include "engines/obsolete.h" #include "gob/gob.h" @@ -78,7 +79,7 @@ static const PlainGameDescriptor gobGames[] = { {0, 0} }; -static const ADObsoleteGameID obsoleteGameIDsTable[] = { +static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"gob1", "gob", kPlatformUnknown}, {"gob2", "gob", kPlatformUnknown}, {0, 0, kPlatformUnknown} @@ -89,12 +90,15 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class GobMetaEngine : public AdvancedMetaEngine { public: GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) { - _obsoleteList = obsoleteGameIDsTable; _singleid = "gob"; _fileBasedFallback = Gob::fileBased; _guioptions = Common::GUIO_NOLAUNCHLOAD; } + virtual GameDescriptor findGame(const char *gameid) const { + return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable); + } + virtual const char *getName() const { return "Gob"; } @@ -104,6 +108,11 @@ public: } virtual bool hasFeature(MetaEngineFeature f) const; + + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const { + Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable); + return AdvancedMetaEngine::createInstance(syst, engine); + } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; }; diff --git a/engines/module.mk b/engines/module.mk index 643310002f..7849c2ff25 100644 --- a/engines/module.mk +++ b/engines/module.mk @@ -5,6 +5,7 @@ MODULE_OBJS := \ dialogs.o \ engine.o \ game.o \ + obsolete.o \ savestate.o # Include common rules diff --git a/engines/obsolete.cpp b/engines/obsolete.cpp new file mode 100644 index 0000000000..6733a384be --- /dev/null +++ b/engines/obsolete.cpp @@ -0,0 +1,88 @@ +/* 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 "engines/obsolete.h" + +#include "common/config-manager.h" + + +namespace Engines { + +void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList) { + if (obsoleteList == 0) + return; + + Common::String gameid = ConfMan.get("gameid"); + + for (const ObsoleteGameID *o = obsoleteList; o->from; ++o) { + if (gameid.equalsIgnoreCase(o->from)) { + gameid = o->to; + ConfMan.set("gameid", gameid); + + if (o->platform != Common::kPlatformUnknown) + ConfMan.set("platform", Common::getPlatformCode(o->platform)); + + warning("Target upgraded from %s to %s", o->from, o->to); + + // WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching + // undefined target adds launcher entry" + if (ConfMan.hasKey("id_came_from_command_line")) { + warning("Target came from command line. Skipping save"); + } else { + ConfMan.flushToDisk(); + } + break; + } + } +} + +GameDescriptor findGameID( + const char *gameid, + const PlainGameDescriptor *gameids, + const ObsoleteGameID *obsoleteList + ) { + // First search the list of supported gameids for a match. + const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids); + if (g) + return GameDescriptor(*g); + + // If we didn't find the gameid in the main list, check if it + // is an obsolete game id. + if (obsoleteList != 0) { + const ObsoleteGameID *o = obsoleteList; + while (o->from) { + if (0 == scumm_stricmp(gameid, o->from)) { + g = findPlainGameDescriptor(o->to, gameids); + if (g && g->description) + return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")"); + else + return GameDescriptor(gameid, "Obsolete game ID"); + } + o++; + } + } + + // No match found + return GameDescriptor(); +} + +} // End of namespace Engines diff --git a/engines/obsolete.h b/engines/obsolete.h new file mode 100644 index 0000000000..97bc7524a6 --- /dev/null +++ b/engines/obsolete.h @@ -0,0 +1,78 @@ +/* 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 ENGINES_OBSOLETE_H +#define ENGINES_OBSOLETE_H + +#include "engines/game.h" + +namespace Engines { + +/** + * Structure for autoupgrading targets using an obsolete gameid + * to the correct new gameid. + */ +struct ObsoleteGameID { + + /** Name of the obsolete gameid. */ + const char *from; + + /** Name of the corresponding new gameid. */ + const char *to; + + /** + * If platform is set to a value different from Common::kPlatformUnknown, + * then upgradeTargetIfNecessary() will use this value to set the platform + * attribute of any target it updates using this ObsoleteGameID record. + * This is useful when the old gameid encoded the target platform (e.g. + * "zakTowns" for FM-TOWNS) while the new gameid does not (e.g. "zak"). + */ + Common::Platform platform; +}; + +/** + * Check if the currently active game target has an obsolete gameid; + * if so, replace it by the correct new gameid. + * This function is typically invoked by a MetaEngine::createInstance + * implementation. + */ +void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList); + + +/** + * Scan through the given list of plain game descriptors specified and search + * for 'gameid' in there. If a match is found, returns a GameDescriptor + * with gameid and description set. + * + * Optionally can take a list of obsolete game ids into account in order + * to support obsolete gameids. + */ +GameDescriptor findGameID( + const char *gameid, + const PlainGameDescriptor *gameids, + const ObsoleteGameID *obsoleteList = 0 + ); + + +} // End of namespace Engines + +#endif diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 2bfa04c30a..7a98fe4164 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -28,6 +28,7 @@ #include "common/config-manager.h" #include "engines/advancedDetector.h" +#include "engines/obsolete.h" #include "common/system.h" #include "graphics/thumbnail.h" @@ -91,7 +92,7 @@ static const PlainGameDescriptor sagaGames[] = { {0, 0} }; -static const ADObsoleteGameID obsoleteGameIDsTable[] = { +static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"ite", "saga", Common::kPlatformUnknown}, {"ihnm", "saga", Common::kPlatformUnknown}, {"dino", "saga", Common::kPlatformUnknown}, @@ -104,10 +105,13 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class SagaMetaEngine : public AdvancedMetaEngine { public: SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) { - _obsoleteList = obsoleteGameIDsTable; _singleid = "saga"; } + virtual GameDescriptor findGame(const char *gameid) const { + return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable); + } + virtual const char *getName() const { return "SAGA [" @@ -135,7 +139,13 @@ public: } virtual bool hasFeature(MetaEngineFeature f) const; + + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const { + Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable); + return AdvancedMetaEngine::createInstance(syst, engine); + } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; + virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index aecd13db5a..4b673ad8ff 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -882,7 +882,7 @@ GameList ScummMetaEngine::getSupportedGames() const { } GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { - return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); + return Engines::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } static Common::String generatePreferredTarget(const DetectorResult &x) { @@ -975,20 +975,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co // We start by checking whether the specified game ID is obsolete. // If that is the case, we automatically upgrade the target to use // the correct new game ID (and platform, if specified). - for (const ADObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) { - if (!scumm_stricmp(gameid, o->from)) { - // Match found, perform upgrade - gameid = o->to; - ConfMan.set("gameid", o->to); - - if (o->platform != Common::kPlatformUnknown) - ConfMan.set("platform", Common::getPlatformCode(o->platform)); - - warning("Target upgraded from game ID %s to %s", o->from, o->to); - ConfMan.flushToDisk(); - break; - } - } + Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable); // Fetch the list of files in the current directory Common::FSList fslist; diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 7eb1e80132..e510c46cf2 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -23,7 +23,7 @@ #ifndef SCUMM_DETECTION_TABLES_H #define SCUMM_DETECTION_TABLES_H -#include "engines/advancedDetector.h" +#include "engines/obsolete.h" #include "common/rect.h" #include "common/util.h" @@ -145,7 +145,7 @@ static const PlainGameDescriptor gameDescriptions[] = { * Conversion table mapping old obsolete game IDs to the * corresponding new game ID and platform combination. */ -static const ADObsoleteGameID obsoleteGameIDsTable[] = { +static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"bluesabctimedemo", "bluesabctime", UNK}, {"BluesBirthdayDemo", "BluesBirthday", UNK}, {"comidemo", "comi", UNK}, -- cgit v1.2.3 From e6f6d67bddd2a3f258616d00049ca12823bc4f74 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 16:26:54 +0200 Subject: TOUCHE: cleanup --- engines/touche/touche.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 7e1aa3ac44..cbb3fec7aa 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -385,8 +385,6 @@ public: protected: - bool detectGame(); - void restart(); void readConfigurationSettings(); void writeConfigurationSettings(); -- cgit v1.2.3 From 7e7748d69257d0cc24cfccd51c0d6b7d9213a986 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 16:36:54 +0200 Subject: LURE: Add a comment explaining why kADFlagUseExtraAsHint is used For the records, this was introduced by Eugene in SVN revision 30106, corresponding to git commit b87b0f21 --- engines/lure/detection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 397d965396..081625863d 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -180,6 +180,9 @@ public: LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) { _md5Bytes = 1024; _singleid = "lure"; + + // Use kADFlagUseExtraAsHint to distinguish between EGA and VGA versions + // of italian Lure when their datafiles sit in the same directory. _flags = kADFlagUseExtraAsHint; _guioptions = Common::GUIO_NOSPEECH; } -- cgit v1.2.3 From 3b5863834bbd97de521af3d6ee2441ea2d609d14 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 16:48:45 +0200 Subject: GROOVIE: Document why I *think* kADFlagUseExtraAsHint is used --- engines/groovie/detection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index cb0f2296fb..2065307ca9 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -206,6 +206,15 @@ class GroovieMetaEngine : public AdvancedMetaEngine { public: GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames) { _singleid = "groovie"; + + // Use kADFlagUseExtraAsHint in order to distinguish the 11th hour from + // its "Making of" as well as the Clandestiny Trailer; they all share + // the same MD5. + // TODO: Is this the only reason, or are there others (like the three + // potentially sharing a single directory) ? In the former case, then + // perhaps a better solution would be to add additional files + // to the detection entries. In the latter case, this TODO should be + // replaced with an according explanation. _flags = kADFlagUseExtraAsHint; _guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; } -- cgit v1.2.3 From ee9276b816c67d3423e260c4460f1030668270d4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 17:08:08 +0200 Subject: SCUMM: Fix doxygen comments --- engines/scumm/resource.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/scumm/resource.h b/engines/scumm/resource.h index e8b0c1eaae..2e8960717f 100644 --- a/engines/scumm/resource.h +++ b/engines/scumm/resource.h @@ -63,9 +63,9 @@ class ScummEngine; * marked in this way. */ enum ResTypeMode { - kDynamicResTypeMode = 0, ///!< Resource is generated during runtime and may change - kStaticResTypeMode = 1, ///!< Resource comes from data files, does not change - kSoundResTypeMode = 2 ///!< Resource comes from data files, but may change + kDynamicResTypeMode = 0, ///< Resource is generated during runtime and may change + kStaticResTypeMode = 1, ///< Resource comes from data files, does not change + kSoundResTypeMode = 2 ///< Resource comes from data files, but may change }; /** -- cgit v1.2.3 From 49a1ea17892eaeca56fb7913a14f66dca652831d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 17:13:02 +0200 Subject: DETECTOR: Cleanup, extend doxygen comments --- engines/advancedDetector.cpp | 4 ++- engines/advancedDetector.h | 66 ++++++++++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 21807cb5f9..5d13fb313a 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -167,9 +167,10 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) language = Common::parseLanguage(ConfMan.get("language")); if (ConfMan.hasKey("platform")) platform = Common::parsePlatform(ConfMan.get("platform")); - if (_flags & kADFlagUseExtraAsHint) + if (_flags & kADFlagUseExtraAsHint) { if (ConfMan.hasKey("extra")) extra = ConfMan.get("extra"); + } Common::String gameid = ConfMan.get("gameid"); @@ -205,6 +206,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) return Common::kNoGameDataFoundError; if (_singleid == NULL) { + // Find the first match with correct gameid. for (uint i = 0; i < matches.size(); i++) { if (matches[i]->gameid == gameid) { agdDesc = matches[i]; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 5f7bfa401c..00a3faf58f 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -30,28 +30,45 @@ class Error; class FSList; } - +/** + * A record describing a file to be matched for detecting a specific game + * variant. A list of such records is used inside every ADGameDescription to + * enable detection. + */ struct ADGameFileDescription { - const char *fileName; - uint16 fileType; // Optional. Not used during detection, only by engines. - const char *md5; // Optional. May be NULL. - int32 fileSize; // Optional. Set to -1 to ignore. + const char *fileName; ///< Name of described file. + uint16 fileType; ///< Optional. Not used during detection, only by engines. + const char *md5; ///< MD5 of (the beginning of) the described file. Optional. Set to NULL to ignore. + int32 fileSize; ///< Size of the described file. Set to -1 to ignore. }; +/** + * A shortcut to produce an empty ADGameFileDescription record. Used to mark + * the end of a list of these. + */ #define AD_LISTEND {NULL, 0, NULL, 0} +/** + * A shortcut to produce a list of ADGameFileDescription records with only one + * record that contains just a filename with an MD5, and no file size. + */ #define AD_ENTRY1(f, x) {{ f, 0, x, -1}, AD_LISTEND} + +/** + * A shortcut to produce a list of ADGameFileDescription records with only one + * record that contains just a filename with an MD5, plus a file size. + */ #define AD_ENTRY1s(f, x, s) {{ f, 0, x, s}, AD_LISTEND} enum ADGameFlags { ADGF_NO_FLAGS = 0, - ADGF_PIRATED = (1 << 23), // flag to designate well known pirated versions with cracks - ADGF_ADDENGLISH = (1 << 24), // always add English as language option - ADGF_MACRESFORK = (1 << 25), // the md5 for this entry will be calculated from the resource fork - ADGF_USEEXTRAASTITLE = (1 << 26), // Extra field value will be used as main game title, not gameid - ADGF_DROPLANGUAGE = (1 << 28), // don't add language to gameid - ADGF_CD = (1 << 29), // add "-cd" to gameid - ADGF_DEMO = (1 << 30) // add "-demo" to gameid + ADGF_PIRATED = (1 << 23), ///< flag to designate well known pirated versions with cracks + ADGF_ADDENGLISH = (1 << 24), ///< always add English as language option + ADGF_MACRESFORK = (1 << 25), ///< the md5 for this entry will be calculated from the resource fork + ADGF_USEEXTRAASTITLE = (1 << 26), ///< Extra field value will be used as main game title, not gameid + ADGF_DROPLANGUAGE = (1 << 28), ///< don't add language to gameid + ADGF_CD = (1 << 29), ///< add "-cd" to gameid + ADGF_DEMO = (1 << 30) ///< add "-demo" to gameid }; struct ADGameDescription { @@ -130,7 +147,13 @@ protected: * The size of a single entry of the above descs array. Always * must be >= sizeof(ADGameDescription). */ - uint _descItemSize; + const uint _descItemSize; + + /** + * A list of all gameids (and their corresponding descriptions) supported + * by this engine. + */ + const PlainGameDescriptor *_gameids; /** * The number of bytes to compute MD5 sum for. The AdvancedDetector @@ -138,16 +161,10 @@ protected: * Since doing that for large files can be slow, it can be restricted * to a subset of all files. * Typically this will be set to something between 5 and 50 kilobyte, - * but arbitrary non-zero values are possible. + * but arbitrary non-zero values are possible. The default is 5000. */ uint _md5Bytes; - /** - * A list of all gameids (and their corresponding descriptions) supported - * by this engine. - */ - const PlainGameDescriptor *_gameids; - /** * Name of single gameid (optional). * @@ -228,13 +245,14 @@ protected: /** * Detect games in specified directory. * Parameters language and platform are used to pass on values - * specified by the user. I.e. this is used to restrict search scope. + * specified by the user. This is used to restrict search scope. * * @param fslist FSList to scan or NULL for scanning all specified * default directories. - * @param language restrict results to specified language only - * @param platform restrict results to specified platform only - * @return list of ADGameDescription (or subclass) pointers corresponding to matched games + * @param language restrict results to specified language + * @param platform restrict results to specified platform + * @param extra restrict results to specified extra string (only if kADFlagUseExtraAsHint is set) + * @return list of ADGameDescription pointers corresponding to matched games */ ADGameDescList detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const; -- cgit v1.2.3 From 068620479202f93c3057bc24f33a8c6f3da5a68d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 17:26:55 +0200 Subject: DETECTOR: cleanup --- engines/advancedDetector.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 5d13fb313a..cd94ce48e4 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -106,7 +106,7 @@ void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGame } bool cleanupPirated(ADGameDescList &matched) { - // OKay, now let's sense presense of pirated games + // OKay, now let's sense presence of pirated games if (!matched.empty()) { for (uint j = 0; j < matched.size();) { if (matched[j]->flags & ADGF_PIRATED) @@ -117,9 +117,7 @@ bool cleanupPirated(ADGameDescList &matched) { // We ruled out all variants and now have nothing if (matched.empty()) { - warning("Illegitimate game copy detected. We give no support in such cases %d", matched.size()); - return true; } } @@ -132,9 +130,6 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { ADGameDescList matches = detectGame(fslist, Common::UNK_LANG, Common::kPlatformUnknown, ""); GameList detectedGames; - if (cleanupPirated(matches)) - return detectedGames; - if (matches.empty()) { // Use fallback detector if there were no matches by other means const ADGameDescription *fallbackDesc = fallbackDetect(fslist); @@ -145,6 +140,7 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { } } else { // Otherwise use the found matches + cleanupPirated(matches); for (uint i = 0; i < matches.size(); i++) { GameDescriptor desc(toGameDescriptor(*matches[i], _gameids)); updateGameDescriptor(desc, matches[i]); -- cgit v1.2.3 From 64e523141fa619c1632dcb2b215cfd85c41ef5a1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 17:32:13 +0200 Subject: DETECTOR: Change detectGameFilebased return value --- engines/advancedDetector.cpp | 14 +++++++------- engines/advancedDetector.h | 14 +++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index cd94ce48e4..9a05e8513d 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -461,14 +461,17 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm } // Filename based fallback - if (_fileBasedFallback != 0) - matched = detectGameFilebased(allFiles); + if (_fileBasedFallback != 0) { + g = detectGameFilebased(allFiles); + if (g) + matched.push_back(g); + } } return matched; } -ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) const { +const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) const { const ADFileBasedFallback *ptr; const char* const* filenames; @@ -502,10 +505,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) } } - ADGameDescList matched; - if (matchedDesc) { // We got a match - matched.push_back(matchedDesc); if (_flags & kADFlagPrintWarningOnFileBasedFallback) { Common::String report = Common::String::format(_("Your game version has been detected using " "filename matching as a variant of %s."), matchedDesc->gameid); @@ -518,7 +518,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) } } - return matched; + return matchedDesc; } GameList AdvancedMetaEngine::getSupportedGames() const { diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 00a3faf58f..976f17ce35 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -257,12 +257,16 @@ protected: ADGameDescList detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const; /** - * Check for each ADFileBasedFallback record whether all files listed - * in it are present. If multiple pass this test, we pick the one with - * the maximal number of matching files. In case of a tie, the entry - * coming first in the list is chosen. + * Iterates over all ADFileBasedFallback records inside _fileBasedFallback. + * This then returns the record (or rather, the ADGameDescription + * contained in it) for which all files described by it are present, and + * among those the one with the maximal number of matching files. + * In case of a tie, the entry coming first in the list is chosen. + * + * @param allFiles a map describing all present files + * @param fileBasedFallback a list of ADFileBasedFallback records, zero-terminated */ - ADGameDescList detectGameFilebased(const FileMap &allFiles) const; + const ADGameDescription *detectGameFilebased(const FileMap &allFiles) const; // TODO void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const; -- cgit v1.2.3 From 879c3c78177ee2ff95c0d22f82d3448877d6fa98 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 18:02:09 +0200 Subject: DETECTOR: Pass allFiles to AdvancedMetaEngine::fallbackDetect() Also reorder the parameters of composeFileHashMap, placing the "return value" first. --- engines/advancedDetector.cpp | 43 ++++++++++++++++++++++++++--------------- engines/advancedDetector.h | 13 ++++++------- engines/agi/detection.cpp | 4 ++-- engines/made/detection.cpp | 4 ++-- engines/sci/detection.cpp | 5 +++-- engines/scumm/detection.cpp | 7 +++---- engines/teenagent/detection.cpp | 4 ---- engines/tinsel/detection.cpp | 4 ++-- engines/tucker/detection.cpp | 2 +- 9 files changed, 46 insertions(+), 40 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 9a05e8513d..c9f4f38b77 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -127,12 +127,22 @@ bool cleanupPirated(ADGameDescList &matched) { GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { - ADGameDescList matches = detectGame(fslist, Common::UNK_LANG, Common::kPlatformUnknown, ""); + ADGameDescList matches; GameList detectedGames; + FileMap allFiles; + + if (fslist.empty()) + return detectedGames; + + // Compose a hashmap of all files in fslist. + composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth)); + + // Run the detector on this + matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, ""); if (matches.empty()) { // Use fallback detector if there were no matches by other means - const ADGameDescription *fallbackDesc = fallbackDetect(fslist); + const ADGameDescription *fallbackDesc = fallbackDetect(allFiles, fslist); if (fallbackDesc != 0) { GameDescriptor desc(toGameDescriptor(*fallbackDesc, _gameids)); updateGameDescriptor(desc, fallbackDesc); @@ -196,7 +206,15 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) return Common::kNoGameDataFoundError; } - ADGameDescList matches = detectGame(files, language, platform, extra); + if (files.empty()) + return Common::kNoGameDataFoundError; + + // Compose a hashmap of all files in fslist. + FileMap allFiles; + composeFileHashMap(allFiles, files, (_maxScanDepth == 0 ? 1 : _maxScanDepth)); + + // Run the detector on this + ADGameDescList matches = detectGame(files.begin()->getParent(), allFiles, language, platform, extra); if (cleanupPirated(matches)) return Common::kNoGameDataFoundError; @@ -215,7 +233,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (agdDesc == 0) { // Use fallback detector if there were no matches by other means - agdDesc = fallbackDetect(files); + agdDesc = fallbackDetect(allFiles, files); if (agdDesc != 0) { // Seems we found a fallback match. But first perform a basic // sanity check: the gameid must match. @@ -270,7 +288,7 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz g_system->logMessage(LogMessageType::kInfo, report.c_str()); } -void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const { +void AdvancedMetaEngine::composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth) const { if (depth <= 0) return; @@ -297,7 +315,7 @@ void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMa if (!file->getChildren(files, Common::FSNode::kListAll)) continue; - composeFileHashMap(files, allFiles, depth - 1); + composeFileHashMap(allFiles, files, depth - 1); } Common::String tstr = file->getName(); @@ -310,24 +328,17 @@ void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMa } } -ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const { - FileMap allFiles; +ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const { SizeMD5Map filesSizeMD5; const ADGameFileDescription *fileDesc; const ADGameDescription *g; const byte *descPtr; - if (fslist.empty()) - return ADGameDescList(); - Common::FSNode parent = fslist.begin()->getParent(); debug(3, "Starting detection in dir '%s'", parent.getPath().c_str()); - // First we compose a hashmap of all files in fslist. - composeFileHashMap(fslist, allFiles, (_maxScanDepth == 0 ? 1 : _maxScanDepth)); - - // Check which files are included in some ADGameDescription *and* present - // in fslist. Compute MD5s and file sizes for these files. + // Check which files are included in some ADGameDescription *and* are present. + // Compute MD5s and file sizes for these files. for (descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize) { g = (const ADGameDescription *)descPtr; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 976f17ce35..c48e4a9815 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -230,31 +230,30 @@ protected: // To be implemented by subclasses virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const = 0; + typedef Common::HashMap FileMap; + /** * An (optional) generic fallback detect function which is invoked * if both the regular MD5 based detection as well as the file * based fallback failed to detect anything. */ - virtual const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const { + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { return 0; } protected: - typedef Common::HashMap FileMap; - /** * Detect games in specified directory. * Parameters language and platform are used to pass on values * specified by the user. This is used to restrict search scope. * - * @param fslist FSList to scan or NULL for scanning all specified - * default directories. + * @param allFiles list of all present files, as computed by composeFileHashMap * @param language restrict results to specified language * @param platform restrict results to specified platform * @param extra restrict results to specified extra string (only if kADFlagUseExtraAsHint is set) * @return list of ADGameDescription pointers corresponding to matched games */ - ADGameDescList detectGame(const Common::FSList &fslist, Common::Language language, Common::Platform platform, const Common::String &extra) const; + ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const; /** * Iterates over all ADFileBasedFallback records inside _fileBasedFallback. @@ -275,7 +274,7 @@ protected: * Compose a hashmap of all files in fslist. * Includes nifty stuff like removing trailing dots and ignoring case. */ - void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) const; + void composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth) const; }; #endif diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 427ffef1ad..21ff5deb2c 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -155,7 +155,7 @@ public: virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; - const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const; + const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; }; bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -293,7 +293,7 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl return SaveStateDescriptor(); } -const ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSList &fslist) const { +const ADGameDescription *AgiMetaEngine::fallbackDetect(const FileMap &allFilesXXX, const Common::FSList &fslist) const { typedef Common::HashMap IntMap; IntMap allFiles; bool matchedUsingFilenames = false; diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index fcbee9cb32..e8c948af4e 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -542,7 +542,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; - const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const; + const ADGameDescription *fallbackDetect(const Common::FSList &fslist, const FileMap &allFiles) const; }; @@ -564,7 +564,7 @@ bool MadeMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame return gd != 0; } -const ADGameDescription *MadeMetaEngine::fallbackDetect(const Common::FSList &fslist) const { +const ADGameDescription *MadeMetaEngine::fallbackDetect(const Common::FSList &fslist, const FileMap &allFiles) const { // Set the default values for the fallback descriptor's ADGameDescription part. Made::g_fallbackDesc.desc.language = Common::UNK_LANG; Made::g_fallbackDesc.desc.platform = Common::kPlatformPC; diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 8d53ce9937..7bc9699e9b 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -390,7 +390,7 @@ public: } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const; - const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const; + const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; @@ -418,7 +418,7 @@ Common::Language charToScummVMLanguage(const char c) { } } -const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fslist) const { +const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { bool foundResMap = false; bool foundRes000 = false; @@ -430,6 +430,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl s_fallbackDesc.gameid = "sci"; // First grab all filenames + // TODO: Consider using allFiles instead of fslist for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (file->isDirectory()) continue; diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 4b673ad8ff..e5c5906404 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -431,7 +431,7 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF } } -static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map, int depth, const char **globs) { +static void composeFileHashMap(DescMap &fileMD5Map, const Common::FSList &fslist, int depth, const char **globs) { if (depth <= 0) return; @@ -459,9 +459,8 @@ static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map continue; Common::FSList files; - if (file->getChildren(files, Common::FSNode::kListAll)) { - composeFileHashMap(files, fileMD5Map, depth - 1, globs); + composeFileHashMap(fileMD5Map, files, depth - 1, globs); } } } @@ -472,7 +471,7 @@ static void detectGames(const Common::FSList &fslist, Common::Listgameid; ++gfp) { diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index b965e616f1..72a338664b 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -117,10 +117,6 @@ public: return desc != 0; } -// virtual const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const { -// return 0; -// } - static Common::String generateGameStateFileName(const char *target, int slot) { return Common::String::format("%s.%02d", target, slot); } diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 6a221da0eb..9c52305a1c 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -89,7 +89,7 @@ public: } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; - const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const; + const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; @@ -175,7 +175,7 @@ typedef Common::Array ADGameDescList; * Fallback detection scans the list of Discworld 2 targets to see if it can detect an installation * where the files haven't been renamed (i.e. don't have the '1' just before the extension) */ -const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList &fslist) const { +const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFilesXXX, const Common::FSList &fslist) const { Common::String extra; FileMap allFiles; SizeMD5Map filesSizeMD5; diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index d7d829e1da..4a3313e3f7 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -145,7 +145,7 @@ public: return desc != 0; } - virtual const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const { + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { for (Common::FSList::const_iterator d = fslist.begin(); d != fslist.end(); ++d) { Common::FSList audiofslist; if (d->isDirectory() && d->getName().equalsIgnoreCase("audio") && d->getChildren(audiofslist, Common::FSNode::kListFilesOnly)) { -- cgit v1.2.3 From 01f806c2dbd06d42c8e56b0a46493cf5d5a68a11 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 18:11:14 +0200 Subject: DETECTOR: Treat file based fallback like any other fallback method --- engines/advancedDetector.cpp | 10 ++-------- engines/advancedDetector.h | 17 +++-------------- engines/gob/detection.cpp | 5 ++++- engines/mohawk/detection.cpp | 6 +++++- engines/toon/detection.cpp | 6 +++++- engines/touche/detection.cpp | 6 +++++- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index c9f4f38b77..82efb0d840 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -472,24 +472,19 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons } // Filename based fallback - if (_fileBasedFallback != 0) { - g = detectGameFilebased(allFiles); - if (g) - matched.push_back(g); - } } return matched; } -const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) const { +const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const { const ADFileBasedFallback *ptr; const char* const* filenames; int maxNumMatchedFiles = 0; const ADGameDescription *matchedDesc = 0; - for (ptr = _fileBasedFallback; ptr->desc; ++ptr) { + for (ptr = fileBasedFallback; ptr->desc; ++ptr) { const ADGameDescription *agdesc = (const ADGameDescription *)ptr->desc; int numMatchedFiles = 0; bool fileMissing = false; @@ -566,7 +561,6 @@ AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, con _md5Bytes = 5000; _singleid = NULL; - _fileBasedFallback = NULL; _flags = 0; _guioptions = Common::GUIO_NONE; _maxScanDepth = 1; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index c48e4a9815..300ce7bbb5 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -172,16 +172,6 @@ protected: */ const char *_singleid; - /** - * List of files for file-based fallback detection (optional). - * This is used if the regular MD5 based detection failed to - * detect anything. - * As usual this list is terminated by an all-zero entry. - * - * @todo Properly explain this - */ - const ADFileBasedFallback *_fileBasedFallback; - /** * A bitmask of flags which can be used to configure the behavior * of the AdvancedDetector. Refer to ADFlags for a list of flags @@ -234,8 +224,7 @@ protected: /** * An (optional) generic fallback detect function which is invoked - * if both the regular MD5 based detection as well as the file - * based fallback failed to detect anything. + * if the regular MD5 based detection failed to detect anything. */ virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { return 0; @@ -256,7 +245,7 @@ protected: ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const; /** - * Iterates over all ADFileBasedFallback records inside _fileBasedFallback. + * Iterates over all ADFileBasedFallback records inside fileBasedFallback. * This then returns the record (or rather, the ADGameDescription * contained in it) for which all files described by it are present, and * among those the one with the maximal number of matching files. @@ -265,7 +254,7 @@ protected: * @param allFiles a map describing all present files * @param fileBasedFallback a list of ADFileBasedFallback records, zero-terminated */ - const ADGameDescription *detectGameFilebased(const FileMap &allFiles) const; + const ADGameDescription *detectGameFilebased(const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const; // TODO void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const; diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 2050539d60..9a554b5429 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -91,7 +91,6 @@ class GobMetaEngine : public AdvancedMetaEngine { public: GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) { _singleid = "gob"; - _fileBasedFallback = Gob::fileBased; _guioptions = Common::GUIO_NOLAUNCHLOAD; } @@ -99,6 +98,10 @@ public: return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable); } + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { + return detectGameFilebased(allFiles, Gob::fileBased); + } + virtual const char *getName() const { return "Gob"; } diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index e6f60e3cb5..f0c657897d 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -162,10 +162,14 @@ class MohawkMetaEngine : public AdvancedMetaEngine { public: MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) { _singleid = "mohawk"; - _fileBasedFallback = Mohawk::fileBased; _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } + + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { + return detectGameFilebased(allFiles, Mohawk::fileBased); + } + virtual const char *getName() const { return "Mohawk"; } diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index e72c61ac68..810a37720a 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -121,10 +121,14 @@ class ToonMetaEngine : public AdvancedMetaEngine { public: ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) { _singleid = "toon"; - _fileBasedFallback = Toon::fileBasedFallback; _maxScanDepth = 3; _directoryGlobs = directoryGlobs; } + + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { + return detectGameFilebased(allFiles, Toon::fileBasedFallback); + } + virtual const char *getName() const { return "Toon"; } diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index d1dde96f59..723fecec3a 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -131,11 +131,15 @@ public: ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { _md5Bytes = 4096; _singleid = "touche"; - _fileBasedFallback = Touche::fileBasedFallback; _flags = kADFlagPrintWarningOnFileBasedFallback; _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } + + virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { + return detectGameFilebased(allFiles, Touche::fileBasedFallback); + } + virtual const char *getName() const { return "Touche"; } -- cgit v1.2.3 From 5016645345630e485be55d005ba4bb7cd1e4b589 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 18:15:47 +0200 Subject: DETECTOR: Remove kADFlagPrintWarningOnFileBasedFallback --- engines/advancedDetector.cpp | 13 ------------- engines/advancedDetector.h | 8 +++----- engines/touche/detection.cpp | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 82efb0d840..db2f404f5f 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -511,19 +511,6 @@ const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap & } } - if (matchedDesc) { // We got a match - if (_flags & kADFlagPrintWarningOnFileBasedFallback) { - Common::String report = Common::String::format(_("Your game version has been detected using " - "filename matching as a variant of %s."), matchedDesc->gameid); - report += "\n"; - report += _("If this is an original and unmodified version, please report any"); - report += "\n"; - report += _("information previously printed by ScummVM to the team."); - report += "\n"; - g_system->logMessage(LogMessageType::kInfo, report.c_str()); - } - } - return matchedDesc; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 300ce7bbb5..13fb4b3fb6 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -116,17 +116,15 @@ struct ADFileBasedFallback { enum ADFlags { - /** - * Warn user about new variant if his version was detected with fallback - */ - kADFlagPrintWarningOnFileBasedFallback = (1 << 1), /** * Store value of extra field in config file, and use it as a hint * on subsequent runs. Could be used when there is no way to autodetect * game (when more than one game sits in same directory), and user picks * up a variant manually. + * In addition, this is useful if two variants of a game sharing the same + * gameid are contained in a single directory. */ - kADFlagUseExtraAsHint = (1 << 2) + kADFlagUseExtraAsHint = (1 << 0) }; diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 723fecec3a..0684144473 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -24,6 +24,7 @@ #include "engines/advancedDetector.h" #include "common/savefile.h" #include "common/system.h" +#include "common/translation.h" #include "base/plugins.h" @@ -131,13 +132,25 @@ public: ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { _md5Bytes = 4096; _singleid = "touche"; - _flags = kADFlagPrintWarningOnFileBasedFallback; _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { - return detectGameFilebased(allFiles, Touche::fileBasedFallback); + const ADGameDescription *matchedDesc = detectGameFilebased(allFiles, Touche::fileBasedFallback); + + if (matchedDesc) { // We got a match + Common::String report = Common::String::format(_("Your game version has been detected using " + "filename matching as a variant of %s."), matchedDesc->gameid); + report += "\n"; + report += _("If this is an original and unmodified version, please report any"); + report += "\n"; + report += _("information previously printed by ScummVM to the team."); + report += "\n"; + g_system->logMessage(LogMessageType::kInfo, report.c_str()); + } + + return matchedDesc; } virtual const char *getName() const { -- cgit v1.2.3 From d9a996e6ef9cc9ae493075b02bc7c2ddbd918fdc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 18:21:44 +0200 Subject: DETECTOR: Change ADFileBasedFallback::desc to ADGameDescription pointer --- engines/advancedDetector.cpp | 2 +- engines/advancedDetector.h | 2 +- engines/gob/detection_tables.h | 52 +++++++++++++++++++-------------------- engines/mohawk/detection_tables.h | 10 ++++---- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index db2f404f5f..7ae4d7718a 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -485,7 +485,7 @@ const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap & const ADGameDescription *matchedDesc = 0; for (ptr = fileBasedFallback; ptr->desc; ++ptr) { - const ADGameDescription *agdesc = (const ADGameDescription *)ptr->desc; + const ADGameDescription *agdesc = ptr->desc; int numMatchedFiles = 0; bool fileMissing = false; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 13fb4b3fb6..5360d23ac1 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -105,7 +105,7 @@ struct ADFileBasedFallback { * Pointer to an ADGameDescription or subclass thereof which will get * returned if there's a detection match. */ - const void *desc; + const ADGameDescription *desc; /** * A zero-terminated list of filenames used for matching. All files in diff --git a/engines/gob/detection_tables.h b/engines/gob/detection_tables.h index 11cca2b65e..1c9811fe9e 100644 --- a/engines/gob/detection_tables.h +++ b/engines/gob/detection_tables.h @@ -5202,32 +5202,32 @@ static const GOBGameDescription fallbackDescs[] = { }; static const ADFileBasedFallback fileBased[] = { - { &fallbackDescs[ 0], { "intro.stk", "disk1.stk", "disk2.stk", "disk3.stk", "disk4.stk", 0 } }, - { &fallbackDescs[ 1], { "intro.stk", "gob.lic", 0 } }, - { &fallbackDescs[ 2], { "intro.stk", 0 } }, - { &fallbackDescs[ 2], { "intro.stk", "disk2.stk", "disk3.stk", 0 } }, - { &fallbackDescs[ 3], { "intro.stk", "disk2.stk", "disk3.stk", "musmac1.mid", 0 } }, - { &fallbackDescs[ 4], { "intro.stk", "gobnew.lic", 0 } }, - { &fallbackDescs[ 5], { "intro.stk", "scaa.imd", "scba.imd", "scbf.imd", 0 } }, - { &fallbackDescs[ 6], { "intro.stk", "imd.itk", 0 } }, - { &fallbackDescs[ 7], { "intro.stk", "mus_gob3.lic", 0 } }, - { &fallbackDescs[ 8], { "intro.stk", "woodruff.itk", 0 } }, - { &fallbackDescs[ 9], { "intro.stk", "commun1.itk", 0 } }, - { &fallbackDescs[10], { "intro.stk", "commun1.itk", "musmac1.mid", 0 } }, - { &fallbackDescs[11], { "intro.stk", "commun1.itk", "lost.lic", 0 } }, - { &fallbackDescs[12], { "intro.stk", "cd1.itk", "objet1.itk", 0 } }, - { &fallbackDescs[13], { "playtoon.stk", "archi.stk", 0 } }, - { &fallbackDescs[14], { "playtoon.stk", "spirou.stk", 0 } }, - { &fallbackDescs[15], { "playtoon.stk", "chato.stk", 0 } }, - { &fallbackDescs[16], { "playtoon.stk", "manda.stk", 0 } }, - { &fallbackDescs[17], { "playtoon.stk", "wakan.stk", 0 } }, - { &fallbackDescs[18], { "playtoon.stk", "dan.itk" } }, - { &fallbackDescs[19], { "intro.stk", "bambou.itk", 0 } }, - { &fallbackDescs[20], { "disk0.stk", "disk1.stk", "disk2.stk", "disk3.stk", 0 } }, - { &fallbackDescs[21], { "disk1.stk", "disk2.stk", "disk3.stk", 0 } }, - { &fallbackDescs[22], { "adi2.stk", 0 } }, - { &fallbackDescs[23], { "adif41.stk", "adim41.stk", 0 } }, - { &fallbackDescs[24], { "coktelplayer.scn", 0 } }, + { &fallbackDescs[ 0].desc, { "intro.stk", "disk1.stk", "disk2.stk", "disk3.stk", "disk4.stk", 0 } }, + { &fallbackDescs[ 1].desc, { "intro.stk", "gob.lic", 0 } }, + { &fallbackDescs[ 2].desc, { "intro.stk", 0 } }, + { &fallbackDescs[ 2].desc, { "intro.stk", "disk2.stk", "disk3.stk", 0 } }, + { &fallbackDescs[ 3].desc, { "intro.stk", "disk2.stk", "disk3.stk", "musmac1.mid", 0 } }, + { &fallbackDescs[ 4].desc, { "intro.stk", "gobnew.lic", 0 } }, + { &fallbackDescs[ 5].desc, { "intro.stk", "scaa.imd", "scba.imd", "scbf.imd", 0 } }, + { &fallbackDescs[ 6].desc, { "intro.stk", "imd.itk", 0 } }, + { &fallbackDescs[ 7].desc, { "intro.stk", "mus_gob3.lic", 0 } }, + { &fallbackDescs[ 8].desc, { "intro.stk", "woodruff.itk", 0 } }, + { &fallbackDescs[ 9].desc, { "intro.stk", "commun1.itk", 0 } }, + { &fallbackDescs[10].desc, { "intro.stk", "commun1.itk", "musmac1.mid", 0 } }, + { &fallbackDescs[11].desc, { "intro.stk", "commun1.itk", "lost.lic", 0 } }, + { &fallbackDescs[12].desc, { "intro.stk", "cd1.itk", "objet1.itk", 0 } }, + { &fallbackDescs[13].desc, { "playtoon.stk", "archi.stk", 0 } }, + { &fallbackDescs[14].desc, { "playtoon.stk", "spirou.stk", 0 } }, + { &fallbackDescs[15].desc, { "playtoon.stk", "chato.stk", 0 } }, + { &fallbackDescs[16].desc, { "playtoon.stk", "manda.stk", 0 } }, + { &fallbackDescs[17].desc, { "playtoon.stk", "wakan.stk", 0 } }, + { &fallbackDescs[18].desc, { "playtoon.stk", "dan.itk" } }, + { &fallbackDescs[19].desc, { "intro.stk", "bambou.itk", 0 } }, + { &fallbackDescs[20].desc, { "disk0.stk", "disk1.stk", "disk2.stk", "disk3.stk", 0 } }, + { &fallbackDescs[21].desc, { "disk1.stk", "disk2.stk", "disk3.stk", 0 } }, + { &fallbackDescs[22].desc, { "adi2.stk", 0 } }, + { &fallbackDescs[23].desc, { "adif41.stk", "adim41.stk", 0 } }, + { &fallbackDescs[24].desc, { "coktelplayer.scn", 0 } }, { 0, { 0 } } }; diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index df66c3dc1c..2cf80377f6 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -2220,11 +2220,11 @@ static const MohawkGameDescription fallbackDescs[] = { }; static const ADFileBasedFallback fileBased[] = { - { &fallbackDescs[0], { "MYST.DAT", 0 } }, - { &fallbackDescs[1], { "MAKING.DAT", 0 } }, - { &fallbackDescs[2], { "MYST.DAT", "Help.dat", 0 } }, // Help system doesn't exist in original - { &fallbackDescs[3], { "a_Data.MHK", 0 } }, - { &fallbackDescs[4], { "a_Data.MHK", "t_Data1.MHK" , 0 } }, + { &fallbackDescs[0].desc, { "MYST.DAT", 0 } }, + { &fallbackDescs[1].desc, { "MAKING.DAT", 0 } }, + { &fallbackDescs[2].desc, { "MYST.DAT", "Help.dat", 0 } }, // Help system doesn't exist in original + { &fallbackDescs[3].desc, { "a_Data.MHK", 0 } }, + { &fallbackDescs[4].desc, { "a_Data.MHK", "t_Data1.MHK" , 0 } }, { 0, { 0 } } }; -- cgit v1.2.3 From e826aaab39f02360c5fa8f249ec6b788a903b948 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 14 Jun 2011 21:10:35 +0100 Subject: I18N: Update Czech translation from patch #3316238 --- gui/themes/translations.dat | Bin 206325 -> 212190 bytes po/cs_CZ.po | 145 +++++++++++++++++++++++++------------------- 2 files changed, 82 insertions(+), 63 deletions(-) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index eb6cf3223f..9e5c0465d9 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ diff --git a/po/cs_CZ.po b/po/cs_CZ.po index b87fe54a2f..6a570b81c2 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-13 22:20+0100\n" -"PO-Revision-Date: 2011-06-07 16:23+0100\n" +"PO-Revision-Date: 2011-06-14 15:04+0100\n" "Last-Translator: Zbynìk Schwarz \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -1185,6 +1185,9 @@ msgid "" "the README for basic information, and for instructions on how to obtain " "further assistance." msgstr "" +"Je nám líto, ale toto jádro v souèasnosti nepodporuje herní nápovìdu. Prosím " +"prohlédnìte si README pro základní informace a pro instrukce jak získat " +"dal¹í pomoc." #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 @@ -1202,21 +1205,19 @@ msgstr "~K~l #: engines/engine.cpp:220 msgid "Could not initialize color format." -msgstr "" +msgstr "Nelze zavést barevný formát." #: engines/engine.cpp:228 -#, fuzzy msgid "Could not switch to video mode: '" -msgstr "Souèasný re¾im obrazu:" +msgstr "Nelze pøepnout na re¾im obrazu: '" #: engines/engine.cpp:237 -#, fuzzy msgid "Could not apply aspect ratio setting." -msgstr "Povolena korekce pomìru stran" +msgstr "Nelze pou¾ít nastavení pomìru stran." #: engines/engine.cpp:242 msgid "Could not apply fullscreen setting." -msgstr "" +msgstr "Nelze pou¾ít nastavení celé obrazovky." #: engines/engine.cpp:342 msgid "" @@ -1226,6 +1227,11 @@ msgid "" "the data files to your hard disk instead.\n" "See the README file for details." msgstr "" +"Vypadá to, ¾e tuto hru hrajete pøímo z\n" +" CD. Je známo, ¾e toto zpùsobuje problémy\n" +" a je tedy doporuèeno, a» místo toho zkopírujete\n" +"datové soubory na Vá¹ pevný disk.\n" +"Pro podrobnosti si pøeètìte README." #: engines/engine.cpp:353 msgid "" @@ -1235,6 +1241,11 @@ msgid "" "order to listen to the game's music.\n" "See the README file for details." msgstr "" +"Tato hra má na svém disku zvukové stopy. Tyto\n" +"stopy musí být z disku zkopírovány pou¾itím\n" +"vhodného nástroje pro extrakci zvuku z CD,\n" +"abyste mohli poslouchat hudbu ve høe.\n" +"Pro podrobnosti si pøeètìte README." #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" @@ -1774,6 +1785,8 @@ msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" +"Pøirozená podpora MIDI vy¾aduje Aktualizaci Roland od LucasArts,\n" +"ale %s chybí. Místo toho je pou¾it AdLib." #: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format @@ -1849,40 +1862,24 @@ msgstr "Obnovit" #: engines/agos/animation.cpp:544 #, c-format msgid "Cutscene file '%s' not found!" -msgstr "" +msgstr "Soubor videa '%s' nenalezen'" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 #: engines/tinsel/saveload.cpp:468 -#, fuzzy msgid "Failed to load game state from file." -msgstr "" -"Nahrání stavu hry selhalo ze souboru:\n" -"\n" -"%s" +msgstr "Nelze naèíst stav hry ze souboru." #: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 -#, fuzzy msgid "Failed to save game state to file." -msgstr "" -"Ulo¾ení stavu hry selhalo do souboru:\n" -"\n" -"%s" +msgstr "Nelze ulo¾it stav hry do souboru." #: engines/gob/inter_v5.cpp:107 -#, fuzzy msgid "Failed to delete file." -msgstr "" -"Ulo¾ení stavu hry selhalo do souboru:\n" -"\n" -"%s" +msgstr "Nelze smazat soubor." #: engines/groovie/script.cpp:417 -#, fuzzy msgid "Failed to save game" -msgstr "" -"Ulo¾ení stavu hry selhalo do souboru:\n" -"\n" -"%s" +msgstr "Nelze ulo¾it hru." #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -1892,36 +1889,44 @@ msgid "" "General MIDI ones. After all it might happen\n" "that a few tracks will not be correctly played." msgstr "" +"Zdá se, ¾e pou¾íváte zaøízení General MIDI,\n" +"ale Va¹e hra podporuje pouze Roland MT32 MIDI.\n" +"Sna¾íme se mapovat nástroje Roland MT32 na\n" +"ty od General MIDI. Po tomto se mù¾e stát,\n" +"¾e pár stop nebude správnì pøehráno." #: engines/m4/m4_menus.cpp:138 -#, fuzzy msgid "Save game failed!" -msgstr "Ulo¾it hru:" +msgstr "Ukládání hry selhalo!" #: engines/sky/compact.cpp:130 msgid "" "Unable to find \"sky.cpt\" file!\n" "Please download it from www.scummvm.org" msgstr "" +"Nelze nalézt soubor \"sky.cpt\"!\n" +"Stáhnìte si ho, prosím z www.scummvm.org" #: engines/sky/compact.cpp:141 msgid "" "The \"sky.cpt\" file has an incorrect size.\n" "Please (re)download it from www.scummvm.org" msgstr "" +"Soubor \"sky.cpt\" má nesprávnou velikost.\n" +"Stáhnìte si ho, prosím, (znovu) z www.scummvm.org" #: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 msgid "DXA cutscenes found but ScummVM has been built without zlib support" -msgstr "" +msgstr "Videa DXA nalezena, ale ScummVM byl sestaven bez podpory zlib" #: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 msgid "MPEG2 cutscenes are no longer supported" -msgstr "" +msgstr "Videa MPGE2 ji¾ nejsou podporována" #: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 #, c-format msgid "Cutscene '%s' not found" -msgstr "" +msgstr "Video '%s' nenalezeno" #: engines/sword1/control.cpp:863 msgid "" @@ -1933,6 +1938,13 @@ msgid "" "Press OK to convert them now, otherwise you will be asked again the next " "time you start the game.\n" msgstr "" +"ScummVM zjistil, ¾e máte staré ulo¾ené pozice pro Broken Sword 1, které by " +"mìly být pøevedeny.\n" +"Starý formát ulo¾ených her ji¾ není podporován, tak¾e pokud je nepøevedete, " +"nebudete moci Va¹e hry naèíst.\n" +"\n" +"Stisknìte OK, abyste je pøevedli teï, jinak budete po¾ádáni znovu, pøi " +"spu¹tìní této hry.\n" #: engines/sword1/control.cpp:1232 #, c-format @@ -1940,18 +1952,20 @@ msgid "" "Target new save game already exists!\n" "Would you like to keep the old save game (%s) or the new one (%s)?\n" msgstr "" +"Nová cílová ulo¾ená hra ji¾ existuje!\n" +"Chtìli byste ponechat starou ulo¾enou hru (%s), nebo novou (%s)?\n" #: engines/sword1/control.cpp:1235 msgid "Keep the old one" -msgstr "" +msgstr "Ponechat starou" #: engines/sword1/control.cpp:1235 msgid "Keep the new one" -msgstr "" +msgstr "Ponechat novou" #: engines/sword1/logic.cpp:1633 msgid "This is the end of the Broken Sword 1 Demo" -msgstr "" +msgstr "Toto je konec Dema Broken Sword 1" #: engines/parallaction/saveload.cpp:133 #, c-format @@ -1959,16 +1973,16 @@ msgid "" "Can't save game in slot %i\n" "\n" msgstr "" +"Nelze ulo¾it hru do pozice %i\n" +"\n" #: engines/parallaction/saveload.cpp:211 -#, fuzzy msgid "Loading game..." -msgstr "Nahrát hru:" +msgstr "Nahrávání hry..." #: engines/parallaction/saveload.cpp:226 -#, fuzzy msgid "Saving game..." -msgstr "Ulo¾it hru:" +msgstr "Ukládání hry..." #: engines/parallaction/saveload.cpp:279 msgid "" @@ -1979,10 +1993,16 @@ msgid "" "\n" "Press OK to convert them now, otherwise you will be asked next time.\n" msgstr "" +"ScummVM zjistil, ¾e máte staré ulo¾ené pozice pro Nippon Safes, které by " +"mìly být pøejmenovány.\n" +"Staré názvy ji¾ nejsou podporovány, tak¾e pokud je nepøevedete, nebudete " +"moci Va¹e hry naèíst.\n" +"\n" +"Stisknìte OK, abyste je pøevedli teï, jinak budete po¾ádáni pøí¹tì.\n" #: engines/parallaction/saveload.cpp:326 msgid "ScummVM successfully converted all your savefiles." -msgstr "" +msgstr "ScummVM úspì¹nì pøevedl v¹echny Va¹e ulo¾ené pozice. " #: engines/parallaction/saveload.cpp:328 msgid "" @@ -1991,6 +2011,10 @@ msgid "" "\n" "Please report to the team." msgstr "" +"ScummVM vytiskl nìkterá varování ve Va¹em oknì konzole a nemù¾e zaruèit, ¾e " +"v¹echny Va¹e soubory byly pøevedeny.\n" +"\n" +"Prosím nahlaste to týmu" #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" @@ -2001,39 +2025,39 @@ msgid "DOSBox OPL emulator" msgstr "DOSBox OPL Emulátor" #: audio/mididrv.cpp:204 -#, fuzzy, c-format +#, c-format msgid "" "The selected audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" -"Nelze zjistit zvolené zvukové zaøízení '%s'. Podívejte se na záznam pro více " -"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." +"Zvolené zaøízení '%s' nebylo nalezeno (napø. mù¾e být vypnuto nebo " +"odpojeno). Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/mididrv.cpp:216 -#, fuzzy, c-format +#, c-format msgid "" "The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -"Nelze zjistit zvolené zvukové zaøízení '%s'. Podívejte se na záznam pro více " +"Zvolené zaøízení '%s' nelze pou¾ít.. Podívejte se na záznam pro více " "informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/mididrv.cpp:250 -#, fuzzy, c-format +#, c-format msgid "" "The preferred audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" -"Nelze zjistit upøednostòované zaøízení '%s'. Podívejte se na záznam pro více " -"informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." +"Upøednostòované zaøízení '%s' nebylo nalezeno (napø. mù¾e být vypnuto nebo " +"odpojeno). Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/mididrv.cpp:265 -#, fuzzy, c-format +#, c-format msgid "" "The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -"Nelze zjistit upøednostòované zaøízení '%s'. Podívejte se na záznam pro více " +"Upøednostòované zaøízení '%s' nelze pou¾ít. Podívejte se na záznam pro více " "informací. Pokus o navrácení na nejbli¾¹í dostupné zaøízení..." #: audio/null.h:43 @@ -2165,14 +2189,12 @@ msgid "Disable power off" msgstr "Zakázat vypnutí" #: backends/platform/iphone/osys_events.cpp:338 -#, fuzzy msgid "Mouse-click-and-drag mode enabled." -msgstr "Touchpad re¾im zapnut" +msgstr "Re¾im pøetáhnutí my¹i zapnut." #: backends/platform/iphone/osys_events.cpp:340 -#, fuzzy msgid "Mouse-click-and-drag mode disabled." -msgstr "Touchpad re¾im vypnut" +msgstr "Re¾im pøetáhnutí my¹i vypnut." #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." @@ -2310,7 +2332,7 @@ msgstr "Mapova #: backends/events/symbiansdl/symbiansdl-events.cpp:184 msgid "Do you want to quit ?" -msgstr "Chcete ukonèit?" +msgstr "Chcete ukonèit ?" #: backends/platform/wii/options.cpp:51 msgid "Video" @@ -2522,7 +2544,7 @@ msgstr "Displej" #: backends/platform/wince/CELauncherDialog.cpp:77 msgid "Do you want to perform an automatic scan ?" -msgstr "Chcete provést automatické hledání?" +msgstr "Chcete provést automatické hledání ?" #: backends/platform/wince/wince-sdl.cpp:487 msgid "Map right click action" @@ -2560,19 +2582,16 @@ msgstr "" "vidìli celý inventáø" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Do you really want to return to the Launcher?" -msgstr "Opravdu chcete tuto ulo¾enou hru vymazat" +msgstr "Opravdu se chcete vrátit tuto do Spou¹tìèe?" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Launcher" -msgstr "Udeøit" +msgstr "Spou¹tìè" #: backends/events/default/default-events.cpp:244 -#, fuzzy msgid "Do you really want to quit?" -msgstr "Chcete ukonèit?" +msgstr "Opravdu chcete skonèit?" #: backends/events/gph/gph-events.cpp:366 #: backends/events/gph/gph-events.cpp:409 -- cgit v1.2.3 From 2ff4380c55d67668e743edd0a17737a0dc17402e Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Mon, 13 Jun 2011 04:39:38 +0200 Subject: WINCE: Add support for language auto-detection in WinCE --- backends/platform/sdl/sdl.cpp | 2 +- backends/platform/wince/wince-sdl.cpp | 67 +++++++++++++++++++++++++++++++++++ backends/platform/wince/wince-sdl.h | 2 ++ configure | 9 +++-- 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index afc6c850d9..fd27c82797 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -301,7 +301,7 @@ void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) { } Common::String OSystem_SDL::getSystemLanguage() const { -#ifdef USE_DETECTLANG +#if defined(USE_DETECTLANG) && !defined(_WIN32_WCE) #ifdef WIN32 // We can not use "setlocale" (at least not for MSVC builds), since it // will return locales like: "English_USA.1252", thus we need a special diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 3ab9dc8aa4..54fa71cfd2 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -578,6 +578,73 @@ void OSystem_WINCE3::getTimeAndDate(TimeDate &t) const { t.tm_sec = systime.wSecond; } +Common::String OSystem_WINCE3::getSystemLanguage() const { +#ifdef USE_DETECTLANG + // We can not use "setlocale" (at least not for MSVC builds), since it + // will return locales like: "English_USA.1252", thus we need a special + // way to determine the locale string for Win32. + char langName[9]; + char ctryName[9]; + TCHAR langNameW[32]; + TCHAR ctryNameW[32]; + int i = 0; + bool localeFound = false; + Common::String localeName; + + // Really not nice, but the only way to map Windows CE language/country codes to posix NLS names, + // because Windows CE doesn't support LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME, + // according to this: http://msdn.microsoft.com/en-us/library/aa912934.aspx + // + // See http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx for a translation table + // This table has to be updated manually when new translations are added + const char *posixMappingTable[][3] = { + {"CAT", "ESP", "ca_ES"}, + {"CSY", "CZE", "cs_CZ"}, + {"DAN", "DNK", "da_DA"}, + {"DEU", "DEU", "de_DE"}, + {"ESN", "ESP", "es_ES"}, + {"ESP", "ESP", "es_ES"}, + {"FRA", "FRA", "fr_FR"}, + {"HUN", "HUN", "hu_HU"}, + {"ITA", "ITA", "it_IT"}, + {"NOR", "NOR", "nb_NO"}, + {"NON", "NOR", "nn_NO"}, + {"PLK", "POL", "pl_PL"}, + {"PTB", "BRA", "pt_BR"}, + {"RUS", "RUS", "ru_RU"}, + {"SVE", "SWE", "se_SE"}, + {"UKR", "UKR", "uk_UA"}, + {NULL, NULL, NULL} + }; + + if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, langNameW, sizeof(langNameW)) != 0 && + GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, ctryNameW, sizeof(ctryNameW)) != 0) { + WideCharToMultiByte(CP_ACP, 0, langNameW, -1, langName, (wcslen(langNameW) + 1), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, ctryNameW, -1, ctryName, (wcslen(ctryNameW) + 1), NULL, NULL); + + debug(1, "Trying to find posix locale name for %s_%s", langName, ctryName); + while (posixMappingTable[i][0] && !localeFound) { + if ( (!strcmp(posixMappingTable[i][0], langName) || !strcmp(posixMappingTable[i][0], "*")) && + (!strcmp(posixMappingTable[i][1], ctryName) || !strcmp(posixMappingTable[i][0], "*")) ) { + localeFound = true; + localeName = posixMappingTable[i][2]; + } + i++; + } + if (!localeFound) warning("No posix locale name found for %s_%s", langName, ctryName); + } + + if (localeFound) { + debug(1, "Found posix locale name: %s", localeName.c_str()); + return localeName; + } else { + return ModularBackend::getSystemLanguage(); + } +#else // USE_DETECTLANG + return ModularBackend::getSystemLanguage(); +#endif // USE_DETECTLANG +} + int OSystem_WINCE3::_platformScreenWidth; int OSystem_WINCE3::_platformScreenHeight; bool OSystem_WINCE3::_isOzone; diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index adb63eb936..481956c19a 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -53,6 +53,8 @@ public: // Overloaded from SDL backend void quit(); + virtual Common::String getSystemLanguage() const; + // Overloaded from OSystem void engineInit(); void getTimeAndDate(TimeDate &t) const; diff --git a/configure b/configure index b436a3822d..b012ccc7bd 100755 --- a/configure +++ b/configure @@ -2192,6 +2192,7 @@ if test -n "$_host"; then LDFLAGS="$LDFLAGS -Wl,--stack,65536" _tremolo=yes _backend="wince" + _detectlang=yes _mt32emu=no _port_mk="backends/platform/wince/wince.mk" ;; @@ -3083,12 +3084,14 @@ if test "$_translation" = no ; then else echo_n "yes (" - cat > $TMPC << EOF + if test "$_detectlang" != yes ; then + cat > $TMPC << EOF #include int main(void) { setlocale(LC_ALL, ""); return 0; } EOF - _detectlang=no - cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes + _detectlang=no + cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes + fi define_in_config_h_if_yes $_detectlang 'USE_DETECTLANG' if test "$_detectlang" = yes ; then -- cgit v1.2.3 From d809756c8dda738843797d70f07aaa31d10509bf Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Tue, 14 Jun 2011 22:19:48 +0200 Subject: SCALERS: Fix Normal1xAspect scaler bug reported in bug #3313709 --- graphics/scaler/aspect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp index 943395aff3..b12fac418b 100644 --- a/graphics/scaler/aspect.cpp +++ b/graphics/scaler/aspect.cpp @@ -201,7 +201,7 @@ int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, i template void Normal1xAspectTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { - for (int y = 0; y < height; ++y) { + for (int y = 0; y < (height * 6 / 5); ++y) { #if ASPECT_MODE == kSuperFastAndUglyAspectMode if ((y % 6) == 5) -- cgit v1.2.3 From b6dd53072446fa967edb03d34044a9054ea1fa56 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Tue, 14 Jun 2011 23:55:57 +0200 Subject: SCUMM: Fix noisy Valgrind warning. --- engines/scumm/resource.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index 0448f60593..10301da3e3 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -822,11 +822,12 @@ byte *ResourceManager::createResource(ResType type, ResId idx, uint32 size) { expireResources(size); - byte *ptr = (byte *)calloc(size + SAFETY_AREA, 1); + byte *ptr = new byte[size + SAFETY_AREA]; if (ptr == NULL) { error("createResource(%s,%d): Out of memory while allocating %d", nameOfResType(type), idx, size); } + memset(ptr, 0, size + SAFETY_AREA); _allocatedSize += size; _types[type][idx]._address = ptr; @@ -845,12 +846,12 @@ ResourceManager::Resource::Resource() { } ResourceManager::Resource::~Resource() { - delete _address; + delete[] _address; _address = 0; } void ResourceManager::Resource::nuke() { - delete _address; + delete[] _address; _address = 0; _size = 0; _flags = 0; -- cgit v1.2.3 From 1ca44c076c261dedc605401d39b51603fc0282af Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 15 Jun 2011 00:09:32 +0200 Subject: SCUMM: fix possible portability issue --- engines/scumm/imuse/imuse.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 7d971f5ca4..6813566144 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -26,6 +26,7 @@ #include "common/util.h" #include "common/system.h" +#include "common/endian.h" #include "scumm/imuse/imuse.h" #include "scumm/imuse/imuse_internal.h" @@ -101,8 +102,14 @@ IMuseInternal::~IMuseInternal() { byte *IMuseInternal::findStartOfSound(int sound, int ct) { int32 size, pos; - static uint32 id[] = { 'MThd', 'FORM', 'MDhd', 'MDpg' }; - + + static const uint32 id[] = { + MKTAG('M', 'T', 'h', 'd'), + MKTAG('F', 'O', 'R', 'M'), + MKTAG('M', 'D', 'h', 'd'), + MKTAG('M', 'D', 'p', 'g') + }; + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) { -- cgit v1.2.3 From 38c99889382c7142b3cb94a5a5bae5266f4ab7a3 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 14 Jun 2011 23:15:30 +0100 Subject: COMMON: Fix crash in TranslationManager when reading long strings It was writing data beyond the end of a buffer. This change makes sure this does not happen. It only changes reading of the messages since the language codes, charset names and contexts are always much smaller than the buffer. --- common/translation.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/common/translation.cpp b/common/translation.cpp index dc71ddc52f..526bebcec6 100644 --- a/common/translation.cpp +++ b/common/translation.cpp @@ -302,8 +302,13 @@ void TranslationManager::loadTranslationsInfoDat() { _messageIds.resize(numMessages); for (int i = 0; i < numMessages; ++i) { len = in.readUint16BE(); - in.read(buf, len); - _messageIds[i] = String(buf, len - 1); + String msg; + while (len > 0) { + in.read(buf, len > 256 ? 256 : len); + msg += String(buf, len > 256 ? 256 : len - 1); + len -= 256; + } + _messageIds[i] = msg; } } @@ -357,8 +362,13 @@ void TranslationManager::loadLanguageDat(int index) { for (int i = 0; i < nbMessages; ++i) { _currentTranslationMessages[i].msgid = in.readUint16BE(); len = in.readUint16BE(); - in.read(buf, len); - _currentTranslationMessages[i].msgstr = String(buf, len - 1); + String msg; + while (len > 0) { + in.read(buf, len > 256 ? 256 : len); + msg += String(buf, len > 256 ? 256 : len - 1); + len -= 256; + } + _currentTranslationMessages[i].msgstr = msg; len = in.readUint16BE(); if (len > 0) { in.read(buf, len); -- cgit v1.2.3 From 5b7754e3f095eb8a469dd4b7de5a6379f8e13c27 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 15 Jun 2011 17:12:17 +0200 Subject: SCUMM: fix bug #3316738 This provides fallback to 8bit color mode for SCUMM3 FM-TOWNS games on platforms which set the USE_RGB_COLOR define even though that color mode is not being fully implemented for that platform. --- engines/scumm/cursor.cpp | 18 +++++++++++------- engines/scumm/palette.cpp | 14 ++++++++------ engines/scumm/scumm.cpp | 14 ++++++++++---- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index e9b5260eca..8676c857ea 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -114,17 +114,21 @@ void ScummEngine_v6::setCursorTransparency(int a) { void ScummEngine::updateCursor() { int transColor = (_game.heversion >= 80) ? 5 : 255; #ifdef USE_RGB_COLOR - Graphics::PixelFormat format = _system->getScreenFormat(); - CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, - _cursor.hotspotX, _cursor.hotspotY, - (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), - (_game.heversion == 70 ? 2 : 1), - &format); -#else + if (_bytesPerPixelOutput == 2) { + Graphics::PixelFormat format = _system->getScreenFormat(); + CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, + _cursor.hotspotX, _cursor.hotspotY, + (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), + (_game.heversion == 70 ? 2 : 1), + &format); + } else { +#endif CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, _cursor.hotspotX, _cursor.hotspotY, (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), (_game.heversion == 70 ? 2 : 1)); +#ifdef USE_RGB_COLOR + } #endif } diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index ba13ff46d9..3e8c35cfd8 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -222,10 +222,12 @@ void ScummEngine::resetPalette() { if (_game.id == GID_INDY4 || _game.id == GID_MONKEY2) _townsClearLayerFlag = 0; #ifdef USE_RGB_COLOR - else if (_game.id == GID_LOOM) - towns_setTextPaletteFromPtr(tableTownsLoomPalette); - else if (_game.version == 3) - towns_setTextPaletteFromPtr(tableTownsV3Palette); + else if (_bytesPerPixelOutput == 2) { + if (_game.id == GID_LOOM) + towns_setTextPaletteFromPtr(tableTownsLoomPalette); + else if (_game.version == 3) + towns_setTextPaletteFromPtr(tableTownsV3Palette); + } #endif _townsScreen->toggleLayers(_townsActiveLayerFlags); @@ -1014,7 +1016,7 @@ void ScummEngine::setCurrentPalette(int palindex) { setPCEPaletteFromPtr(pals); #ifdef USE_RGB_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - } else if (_game.platform == Common::kPlatformFMTowns) { + } else if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) { towns_setPaletteFromPtr(pals); #endif #endif @@ -1117,7 +1119,7 @@ void ScummEngine::updatePalette() { #ifdef USE_RGB_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - if (_game.platform == Common::kPlatformFMTowns) { + if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) { p = palette_colors; for (i = first; i < first + num; ++i) { _16BitPalette[i] = get16BitColor(p[0], p[1], p[2]); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 0a5338374e..97dd68af7c 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1156,8 +1156,15 @@ Common::Error ScummEngine::init() { #ifdef USE_RGB_COLOR Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); initGraphics(screenWidth, screenHeight, screenWidth > 320, &format); - if (format != _system->getScreenFormat()) - return Common::kUnsupportedColorMode; + if (format != _system->getScreenFormat()) { + if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { + warning("Your ScummVM build does not support the type of 16bit color mode required by this target.\nStarting game in 8bit color mode...\nYou may experience color glitches"); + _bytesPerPixelOutput = 1; + initGraphics(screenWidth, screenHeight, (screenWidth > 320)); + } else { + return Common::kUnsupportedColorMode; + } + } #else if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { warning("Starting game without the required 16bit color support.\nYou may experience color glitches"); @@ -1364,8 +1371,7 @@ void ScummEngine::resetScumm() { #ifdef USE_RGB_COLOR if (_game.features & GF_16BIT_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - - || _game.platform == Common::kPlatformFMTowns + || (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) #endif ) _16BitPalette = (uint16 *)calloc(512, sizeof(uint16)); -- cgit v1.2.3 From 52a89174abc27a8f6256d401e5dde6ea904a4afd Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 5 Jun 2011 13:38:05 +0400 Subject: DREAMWEB: added autogenerated source --- base/plugins.cpp | 3 + configure | 1 + engines/dreamweb/console.cpp | 36 + engines/dreamweb/console.h | 46 + engines/dreamweb/detection.cpp | 148 + engines/dreamweb/detection_tables.h | 51 + engines/dreamweb/dreamgen.cpp | 22062 ++++++++++++++++++++++++++++++++++ engines/dreamweb/dreamgen.h | 78 + engines/dreamweb/dreamweb.cpp | 131 + engines/dreamweb/dreamweb.h | 83 + engines/dreamweb/module.mk | 15 + engines/dreamweb/runtime.h | 330 + engines/engines.mk | 5 + 13 files changed, 22989 insertions(+) create mode 100644 engines/dreamweb/console.cpp create mode 100644 engines/dreamweb/console.h create mode 100644 engines/dreamweb/detection.cpp create mode 100644 engines/dreamweb/detection_tables.h create mode 100644 engines/dreamweb/dreamgen.cpp create mode 100644 engines/dreamweb/dreamgen.h create mode 100644 engines/dreamweb/dreamweb.cpp create mode 100644 engines/dreamweb/dreamweb.h create mode 100644 engines/dreamweb/module.mk create mode 100644 engines/dreamweb/runtime.h diff --git a/base/plugins.cpp b/base/plugins.cpp index 4a3b201714..8ce7b53254 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -106,6 +106,9 @@ public: #if PLUGIN_ENABLED_STATIC(DRASCULA) LINK_PLUGIN(DRASCULA) #endif + #if PLUGIN_ENABLED_STATIC(DREAMWEB) + LINK_PLUGIN(DREAMWEB) + #endif #if PLUGIN_ENABLED_STATIC(GOB) LINK_PLUGIN(GOB) #endif diff --git a/configure b/configure index b012ccc7bd..e7a4335a52 100755 --- a/configure +++ b/configure @@ -83,6 +83,7 @@ add_engine cine "Cinematique evo 1" yes add_engine cruise "Cinematique evo 2" yes add_engine draci "Dragon History" yes add_engine drascula "Drascula: The Vampire Strikes Back" yes +add_engine dreamweb "Dreamweb" no add_engine gob "Gobli*ns" yes add_engine groovie "Groovie" yes "groovie2" add_engine groovie2 "Groovie 2 games" no diff --git a/engines/dreamweb/console.cpp b/engines/dreamweb/console.cpp new file mode 100644 index 0000000000..e004746d8a --- /dev/null +++ b/engines/dreamweb/console.cpp @@ -0,0 +1,36 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/console.cpp $ + * $Id: console.cpp 70 2011-01-26 05:36:55Z digitall $ + * + */ + +#include "dreamweb/console.h" + +namespace DreamWeb { + +DreamWebConsole::DreamWebConsole(DreamWebEngine *vm) : GUI::Debugger(), _vm(vm) { +} + +DreamWebConsole::~DreamWebConsole() { +} + +} // End of namespace DreamWeb diff --git a/engines/dreamweb/console.h b/engines/dreamweb/console.h new file mode 100644 index 0000000000..58c8467b34 --- /dev/null +++ b/engines/dreamweb/console.h @@ -0,0 +1,46 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/console.h $ + * $Id: console.h 70 2011-01-26 05:36:55Z digitall $ + * + */ + +#ifndef DREAMWEB_CONSOLE_H +#define DREAMWEB_CONSOLE_H + +#include "gui/debugger.h" + +namespace DreamWeb { + +class DreamWebEngine; + +class DreamWebConsole : public GUI::Debugger { +public: + DreamWebConsole(DreamWebEngine *vm); + virtual ~DreamWebConsole(void); + +private: + DreamWebEngine *_vm; +}; + +} // End of namespace DreamWeb + +#endif diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp new file mode 100644 index 0000000000..f0d0f9e840 --- /dev/null +++ b/engines/dreamweb/detection.cpp @@ -0,0 +1,148 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/detection.cpp $ + * $Id: detection.cpp 3 2010-09-16 19:32:18Z megath $ + * + */ + +#include "base/plugins.h" + +#include "engines/advancedDetector.h" +#include "common/system.h" + +#include "dreamweb/dreamweb.h" + +namespace DreamWeb { + +struct DreamWebGameDescription { + ADGameDescription desc; +}; + +} // End of namespace DreamWeb + +static const PlainGameDescriptor dreamWebGames[] = { + { "dreamweb", "DreamWeb" }, + { 0, 0 } +}; + +static const ADObsoleteGameID obsoleteGameIDsTable[] = { + { 0, 0, Common::kPlatformUnknown } +}; + +#include "dreamweb/detection_tables.h" + +static const ADParams detectionParams = { + // Pointer to ADGameDescription or its superset structure + (const byte *)DreamWeb::gameDescriptions, + // Size of that superset structure + sizeof(DreamWeb::DreamWebGameDescription), + // Number of bytes to compute MD5 sum for + 5000, + // List of all engine targets + dreamWebGames, + // Structure for autoupgrading obsolete targets + obsoleteGameIDsTable, + // Name of single gameid (optional) + "dreamweb", + // List of files for file-based fallback detection (optional) + 0, + // Flags + 0, + // Additional GUI options (for every game} + Common::GUIO_NOMIDI, + // Maximum directory depth + 1, + // List of directory globs + 0 +}; + +class DreamWebMetaEngine : public AdvancedMetaEngine { +public: + DreamWebMetaEngine() : AdvancedMetaEngine(detectionParams) {} + + virtual const char *getName() const { + return "DreamWeb engine"; + } + + virtual const char *getOriginalCopyright() const { + return "DreamWeb (C) Creative Reality"; + } + + virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; + virtual bool hasFeature(MetaEngineFeature f) const; + virtual SaveStateList listSaves(const char *target) const; + virtual int getMaximumSaveSlot() const; + virtual void removeSaveState(const char *target, int slot) const; +}; + +bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { + return false; +} + +bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const { + return false; +} + +bool DreamWebMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { + const DreamWeb::DreamWebGameDescription *gd = (const DreamWeb::DreamWebGameDescription *)desc; + if (gd) { + *engine = new DreamWeb::DreamWebEngine(syst, gd); + } + return gd != 0; +} + +SaveStateList DreamWebMetaEngine::listSaves(const char *target) const { + //Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); + SaveStateList saveList; + + return saveList; +} + +int DreamWebMetaEngine::getMaximumSaveSlot() const { return 99; } + +void DreamWebMetaEngine::removeSaveState(const char *target, int slot) const { +} + +#if PLUGIN_ENABLED_DYNAMIC(DREAMWEB) + REGISTER_PLUGIN_DYNAMIC(DREAMWEB, PLUGIN_TYPE_ENGINE, DreamWebMetaEngine); +#else + REGISTER_PLUGIN_STATIC(DREAMWEB, PLUGIN_TYPE_ENGINE, DreamWebMetaEngine); +#endif + +namespace DreamWeb { + +Common::Error DreamWebEngine::loadGameState(int slot) { + return Common::kNoError; +} + +Common::Error DreamWebEngine::saveGameState(int slot, const char *desc) { + return Common::kNoError; +} + +bool DreamWebEngine::canLoadGameStateCurrently() { + return false; +} + +bool DreamWebEngine::canSaveGameStateCurrently() { + return false; +} + +} // End of namespace DreamWeb diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h new file mode 100644 index 0000000000..394236a72a --- /dev/null +++ b/engines/dreamweb/detection_tables.h @@ -0,0 +1,51 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/detection_tables.h $ + * $Id: detection_tables.h 66 2010-11-07 08:31:21Z eriktorbjorn $ + * + */ + +#ifndef DREAMWEB_DETECTION_TABLES_H +#define DREAMWEB_DETECTION_TABLES_H + +namespace DreamWeb { + +using Common::GUIO_NONE; + +static const DreamWebGameDescription gameDescriptions[] = { + { + { + "dreamweb", + "", + AD_ENTRY1s("dreamweb.r00", "3b5c87717fc40cc5a5ae19c155662ee3", 152918), + Common::EN_ANY, + Common::kPlatformPC, + ADGF_NO_FLAGS, + GUIO_NONE + }, + }, + + { AD_TABLE_END_MARKER } +}; + +} // End of namespace DreamWeb + +#endif diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp new file mode 100644 index 0000000000..ec243cc81a --- /dev/null +++ b/engines/dreamweb/dreamgen.cpp @@ -0,0 +1,22062 @@ +#include "dreamgen.h" + +namespace dreamgen { + +static inline void allocatebuffers(Context &context); +static inline void clearbuffers(Context &context); +static inline void clearpalette(Context &context); +static inline void readsetdata(Context &context); +static inline void loadpalfromiff(Context &context); +static inline void titles(Context &context); +static inline void credits(Context &context); +static inline void cls(Context &context); +static inline void decide(Context &context); +static inline void clearchanges(Context &context); +static inline void loadroom(Context &context); +static inline void clearsprites(Context &context); +static inline void initman(Context &context); +static inline void entrytexts(Context &context); +static inline void entryanims(Context &context); +static inline void initialinv(Context &context); +static inline void startup1(Context &context); +static inline void clearbeforeload(Context &context); +static inline void startup(Context &context); +static inline void worktoscreenm(Context &context); +static inline void screenupdate(Context &context); +static inline void showgun(Context &context); +static inline void fadescreendown(Context &context); +static inline void hangon(Context &context); +static inline void fadescreendowns(Context &context); +static inline void endgame(Context &context); +static inline void loadtemptext(Context &context); +static inline void monkspeaking(Context &context); +static inline void gettingshot(Context &context); +static inline void getridoftemptext(Context &context); +static inline void loadintroroom(Context &context); +static inline void fadescreenups(Context &context); +static inline void runendseq(Context &context); +static inline void atmospheres(Context &context); +static inline void spriteupdate(Context &context); +static inline void deleverything(Context &context); +static inline void printsprites(Context &context); +static inline void reelsonscreen(Context &context); +static inline void afterintroroom(Context &context); +static inline void usetimedtext(Context &context); +static inline void dumpmap(Context &context); +static inline void dumptimedtext(Context &context); +static inline void multidump(Context &context); +static inline void getundertimed(Context &context); +static inline void printdirect(Context &context); +static inline void putundertimed(Context &context); +static inline void multiput(Context &context); +static inline void getnumber(Context &context); +static inline void modifychar(Context &context); +static inline void printchar(Context &context); +static inline void showframe(Context &context); +static inline void kernchars(Context &context); +static inline void frameoutfx(Context &context); +static inline void frameoutnm(Context &context); +static inline void frameoutbh(Context &context); +static inline void frameoutv(Context &context); +static inline void getnextword(Context &context); +static inline void multiget(Context &context); +static inline void clearwork(Context &context); +static inline void findroominloc(Context &context); +static inline void drawfloor(Context &context); +static inline void worktoscreen(Context &context); +static inline void width160(Context &context); +static inline void eraseoldobs(Context &context); +static inline void drawflags(Context &context); +static inline void calcmapad(Context &context); +static inline void doblocks(Context &context); +static inline void showallobs(Context &context); +static inline void showallfree(Context &context); +static inline void showallex(Context &context); +static inline void paneltomap(Context &context); +static inline void initrain(Context &context); +static inline void splitintolines(Context &context); +static inline void getblockofpixel(Context &context); +static inline void checkone(Context &context); +static inline void getmapad(Context &context); +static inline void calcfrframe(Context &context); +static inline void finalframe(Context &context); +static inline void getxad(Context &context); +static inline void getyad(Context &context); +static inline void makebackob(Context &context); +static inline void makesprite(Context &context); +static inline void getdimension(Context &context); +static inline void addalong(Context &context); +static inline void addlength(Context &context); +static inline void reconstruct(Context &context); +static inline void updatepeople(Context &context); +static inline void watchreel(Context &context); +static inline void showrain(Context &context); +static inline void randomnum1(Context &context); +static inline void playchannel1(Context &context); +static inline void plotreel(Context &context); +static inline void checkforshake(Context &context); +static inline void autosetwalk(Context &context); +static inline void getroomspaths(Context &context); +static inline void checkdest(Context &context); +static inline void bresenhams(Context &context); +static inline void workoutframes(Context &context); +static inline void getreelstart(Context &context); +static inline void dealwithspecial(Context &context); +static inline void showreelframe(Context &context); +static inline void soundonreels(Context &context); +static inline void playchannel0(Context &context); +static inline void findsource(Context &context); +static inline void placesetobject(Context &context); +static inline void removesetobject(Context &context); +static inline void placefreeobject(Context &context); +static inline void removefreeobject(Context &context); +static inline void switchryanoff(Context &context); +static inline void switchryanon(Context &context); +static inline void movemap(Context &context); +static inline void getfreead(Context &context); +static inline void findormake(Context &context); +static inline void getsetad(Context &context); +static inline void undertextline(Context &context); +static inline void printasprite(Context &context); +static inline void maptopanel(Context &context); +static inline void cancelch0(Context &context); +static inline void clearstartpal(Context &context); +static inline void paltoendpal(Context &context); +static inline void loadroomssample(Context &context); +static inline void loadintotemp(Context &context); +static inline void showmonk(Context &context); +static inline void getridoftemp(Context &context); +static inline void standardload(Context &context); +static inline void readheader(Context &context); +static inline void twodigitnum(Context &context); +static inline void cancelch1(Context &context); +static inline void paltostartpal(Context &context); +static inline void clearendpal(Context &context); +static inline void greyscalesum(Context &context); +static inline void endpaltostart(Context &context); +static inline void createpanel2(Context &context); +static inline void fadescreenup(Context &context); +static inline void rollendcredits2(Context &context); +static inline void rollem(Context &context); +static inline void hangone(Context &context); +static inline void createpanel(Context &context); +static inline void newplace(Context &context); +static inline void mainscreen(Context &context); +static inline void animpointer(Context &context); +static inline void showpointer(Context &context); +static inline void readmouse1(Context &context); +static inline void dumppointer(Context &context); +static inline void dumptextline(Context &context); +static inline void delpointer(Context &context); +static inline void autolook(Context &context); +static inline void watchcount(Context &context); +static inline void zoom(Context &context); +static inline void readmouse2(Context &context); +static inline void dumpzoom(Context &context); +static inline void afternewroom(Context &context); +static inline void readmouse3(Context &context); +static inline void readmouse4(Context &context); +static inline void dumpwatch(Context &context); +static inline void findpathofpoint(Context &context); +static inline void findxyfrompath(Context &context); +static inline void showicon(Context &context); +static inline void getunderzoom(Context &context); +static inline void walkintoroom(Context &context); +static inline void reminders(Context &context); +static inline void isryanholding(Context &context); +static inline void findexobject(Context &context); +static inline void compare(Context &context); +static inline void setuptimeduse(Context &context); +static inline void getanyaddir(Context &context); +static inline void getexad(Context &context); +static inline void showpanel(Context &context); +static inline void showman(Context &context); +static inline void roomname(Context &context); +static inline void panelicons1(Context &context); +static inline void zoomicon(Context &context); +static inline void middlepanel(Context &context); +static inline void showwatch(Context &context); +static inline void showtime(Context &context); +static inline void printmessage(Context &context); +static inline void usecharset1(Context &context); +static inline void putunderzoom(Context &context); +static inline void crosshair(Context &context); +static inline void dolook(Context &context); +static inline void findnextcolon(Context &context); +static inline void printslow(Context &context); +static inline void hangonp(Context &context); +static inline void redrawmainscrn(Context &context); +static inline void readmouse(Context &context); +static inline void printboth(Context &context); +static inline void waitframes(Context &context); +static inline void dumpblink(Context &context); +static inline void showblink(Context &context); +static inline void getflagunderp(Context &context); +static inline void checkcoords(Context &context); +static inline void walkandexamine(Context &context); +static inline void finishedwalking(Context &context); +static inline void examineob(Context &context); +static inline void setwalk(Context &context); +static inline void examineobtext(Context &context); +static inline void blocknametext(Context &context); +static inline void personnametext(Context &context); +static inline void walktotext(Context &context); +static inline void commandwithob(Context &context); +static inline void deltextline(Context &context); +static inline void copyname(Context &context); +static inline void findobname(Context &context); +static inline void facerightway(Context &context); +static inline void showexit(Context &context); +static inline void obicons(Context &context); +static inline void obpicture(Context &context); +static inline void describeob(Context &context); +static inline void makemainscreen(Context &context); +static inline void getobtextstart(Context &context); +static inline void obsthatdothings(Context &context); +static inline void additionaltext(Context &context); +static inline void findpuztext(Context &context); +static inline void getlocation(Context &context); +static inline void setlocation(Context &context); +static inline void lookatcard(Context &context); +static inline void getridofreels(Context &context); +static inline void loadkeypad(Context &context); +static inline void hangonw(Context &context); +static inline void restorereels(Context &context); +static inline void putbackobstuff(Context &context); +static inline void getroomdata(Context &context); +static inline void allocateload(Context &context); +static inline void searchforsame(Context &context); +static inline void getanyad(Context &context); +static inline void selectlocation(Context &context); +static inline void readcitypic(Context &context); +static inline void showcity(Context &context); +static inline void readdesticon(Context &context); +static inline void loadtraveltext(Context &context); +static inline void showarrows(Context &context); +static inline void locationpic(Context &context); +static inline void getridoftemp2(Context &context); +static inline void getridoftemp3(Context &context); +static inline void getdestinfo(Context &context); +static inline void loadintotemp2(Context &context); +static inline void loadintotemp3(Context &context); +static inline void clearreels(Context &context); +static inline void clearrest(Context &context); +static inline void pickupob(Context &context); +static inline void transfertoex(Context &context); +static inline void emergencypurge(Context &context); +static inline void getexpos(Context &context); +static inline void transfermap(Context &context); +static inline void transferinv(Context &context); +static inline void transfertext(Context &context); +static inline void pickupconts(Context &context); +static inline void transfercontoex(Context &context); +static inline void purgeanitem(Context &context); +static inline void deleteexobject(Context &context); +static inline void deleteexframe(Context &context); +static inline void deleteextext(Context &context); +static inline void resetlocation(Context &context); +static inline void checkifpathison(Context &context); +static inline void turnpathon(Context &context); +static inline void turnanypathon(Context &context); +static inline void purgealocation(Context &context); +static inline void startloading(Context &context); +static inline void fillspace(Context &context); +static inline void sortoutmap(Context &context); +static inline void deletetaken(Context &context); +static inline void setallchanges(Context &context); +static inline void autoappear(Context &context); +static inline void dochange(Context &context); +static inline void loadsavebox(Context &context); +static inline void showdecisions(Context &context); +static inline void showopbox(Context &context); +static inline void realcredits(Context &context); +static inline void allpalette(Context &context); +static inline void dumpcurrent(Context &context); +static inline void biblequote(Context &context); +static inline void intro(Context &context); +static inline void runintroseq(Context &context); +static inline void trysoundalloc(Context &context); +static inline void allocatework(Context &context); +static inline void checkforemm(Context &context); +static inline void printcurs(Context &context); +static inline void delcurs(Context &context); +static inline void commandonly(Context &context); +static inline void talk(Context &context); +static inline void obname(Context &context); +static inline void pixelcheckset(Context &context); +static inline void isitdescribed(Context &context); +static inline void getreelframeax(Context &context); +static inline void blank(Context &context); +static inline void findfirstpath(Context &context); +static inline void checkifex(Context &context); +static inline void checkiffree(Context &context); +static inline void checkifperson(Context &context); +static inline void checkifset(Context &context); +static inline void identifyob(Context &context); +static inline void convnum(Context &context); +static inline void onedigit(Context &context); +static inline void parseblaster(Context &context); +static inline void volumeadjust(Context &context); +static inline void loopchannel0(Context &context); +static inline void createname(Context &context); +static inline void doload(Context &context); +static inline void showloadops(Context &context); +static inline void showslots(Context &context); +static inline void shownames(Context &context); +static inline void namestoold(Context &context); +static inline void storeit(Context &context); +static inline void makeheader(Context &context); +static inline void oldtonames(Context &context); +static inline void showsaveops(Context &context); +static inline void readkey(Context &context); +static inline void getnamepos(Context &context); +static inline void selectslot(Context &context); +static inline void restoreall(Context &context); +static inline void checkinput(Context &context); +static inline void showdiscops(Context &context); +static inline void getback1(Context &context); +static inline void getridofall(Context &context); +static inline void showmainops(Context &context); +static inline void dosaveload(Context &context); +static inline void findtext1(Context &context); +static inline void usetempcharset(Context &context); +static inline void showdiary(Context &context); +static inline void showdiarypage(Context &context); +static inline void loadtempcharset(Context &context); +static inline void showdiarykeys(Context &context); +static inline void dumpdiarykeys(Context &context); +static inline void getridoftempcharset(Context &context); +static inline void nextsymbol(Context &context); +static inline void showsymbol(Context &context); +static inline void updatesymboltop(Context &context); +static inline void updatesymbolbot(Context &context); +static inline void dumpsymbol(Context &context); +static inline void turnanypathoff(Context &context); +static inline void folderexit(Context &context); +static inline void showleftpage(Context &context); +static inline void showrightpage(Context &context); +static inline void showfolder(Context &context); +static inline void folderhints(Context &context); +static inline void loadfolder(Context &context); +static inline void loadmenu(Context &context); +static inline void getundermenu(Context &context); +static inline void putundermenu(Context &context); +static inline void showmenu(Context &context); +static inline void dumpmenu(Context &context); +static inline void singlekey(Context &context); +static inline void buttonpress(Context &context); +static inline void showouterpad(Context &context); +static inline void showkeypad(Context &context); +static inline void dumpkeypad(Context &context); +static inline void addtopresslist(Context &context); +static inline void isitright(Context &context); +static inline void checkinside(Context &context); +static inline void showfirstuse(Context &context); +static inline void withwhat(Context &context); +static inline void showpuztext(Context &context); +static inline void issetobonmap(Context &context); +static inline void showseconduse(Context &context); +static inline void removeobfrominv(Context &context); +static inline void turnpathoff(Context &context); +static inline void findinvpos(Context &context); +static inline void useroutine(Context &context); +static inline void printmessage2(Context &context); +static inline void fillryan(Context &context); +static inline void findsetobject(Context &context); +static inline void usetext(Context &context); +static inline void moneypoke(Context &context); +static inline void nextcolon(Context &context); +static inline void entercode(Context &context); +static inline void makeworn(Context &context); +static inline void nothelderror(Context &context); +static inline void triggermessage(Context &context); +static inline void monprint(Context &context); +static inline void showcurrentfile(Context &context); +static inline void printlogo(Context &context); +static inline void printundermon(Context &context); +static inline void randomaccess(Context &context); +static inline void locklighton(Context &context); +static inline void locklightoff(Context &context); +static inline void makecaps(Context &context); +static inline void monmessage(Context &context); +static inline void scrollmonitor(Context &context); +static inline void searchforstring(Context &context); +static inline void getkeyandlogo(Context &context); +static inline void monitorlogo(Context &context); +static inline void parser(Context &context); +static inline void neterror(Context &context); +static inline void processtrigger(Context &context); +static inline void input(Context &context); +static inline void dirfile(Context &context); +static inline void searchforfiles(Context &context); +static inline void dircom(Context &context); +static inline void signon(Context &context); +static inline void read(Context &context); +static inline void showkeys(Context &context); +static inline void delchar(Context &context); +static inline void accesslighton(Context &context); +static inline void accesslightoff(Context &context); +static inline void powerlighton(Context &context); +static inline void powerlightoff(Context &context); +static inline void lookininterface(Context &context); +static inline void loadpersonal(Context &context); +static inline void loadnews(Context &context); +static inline void loadcart(Context &context); +static inline void printoutermon(Context &context); +static inline void initialmoncols(Context &context); +static inline void turnonpower(Context &context); +static inline void fadeupyellows(Context &context); +static inline void fadeupmonfirst(Context &context); +static inline void hangoncurs(Context &context); +static inline void execcommand(Context &context); +static inline void getundercentre(Context &context); +static inline void putundercentre(Context &context); +static inline void convicons(Context &context); +static inline void starttalk(Context &context); +static inline void hangonpq(Context &context); +static inline void redes(Context &context); +static inline void dosometalk(Context &context); +static inline void getpersontext(Context &context); +static inline void getpersframe(Context &context); +static inline void findopenpos(Context &context); +static inline void reexfromopen(Context &context); +static inline void geteitherad(Context &context); +static inline void fillopen(Context &context); +static inline void useopened(Context &context); +static inline void getopenedsize(Context &context); +static inline void errormessage3(Context &context); +static inline void errormessage2(Context &context); +static inline void examicon(Context &context); +static inline void outofopen(Context &context); +static inline void swapwithopen(Context &context); +static inline void isitworn(Context &context); +static inline void wornerror(Context &context); +static inline void errormessage1(Context &context); +static inline void checkobjectsize(Context &context); +static inline void openinv(Context &context); +static inline void openob(Context &context); +static inline void droperror(Context &context); +static inline void cantdrop(Context &context); +static inline void reexfrominv(Context &context); +static inline void intoinv(Context &context); +static inline void outofinv(Context &context); +static inline void swapwithinv(Context &context); +static inline void findallopen(Context &context); +static inline void obtoinv(Context &context); +static inline void findallryan(Context &context); +static inline void showryanpage(Context &context); +static inline void lockmon(Context &context); +static inline void fadecalculation(Context &context); +static inline void dodoor(Context &context); +static inline void liftnoise(Context &context); +static inline void widedoor(Context &context); +static inline void random(Context &context); +static inline void lockeddoorway(Context &context); +static inline void liftsprite(Context &context); +static inline void doorway(Context &context); +static inline void constant(Context &context); +static inline void steady(Context &context); +static inline void adjustleft(Context &context); +static inline void adjustright(Context &context); +static inline void adjustdown(Context &context); +static inline void adjustup(Context &context); +static inline void aboutturn(Context &context); +static inline void checkforexit(Context &context); +static inline void walking(Context &context); +static inline void showgamereel(Context &context); +static inline void checkspeed(Context &context); +static inline void addtopeoplelist(Context &context); +static inline void setuptimedtemp(Context &context); +static inline void madmantext(Context &context); +static inline void madmode(Context &context); +static inline void priesttext(Context &context); +static inline void fadescreenuphalf(Context &context); +static inline void textforend(Context &context); +static inline void fadescreendownhalf(Context &context); +static inline void rollendcredits(Context &context); +static inline void textformonk(Context &context); +static inline void monks2text(Context &context); +static inline void intro2text(Context &context); +static inline void intro3text(Context &context); +static inline void intro1text(Context &context); + +static inline void alleybarksound(Context & context) { + context.ax = context.data.word(context.bx+3); + context._sub(context.ax, 1); + context._cmp(context.ax, 0); + if (!context.flags.z()) goto nobark; + context.push(context.bx); + context.push(context.es); + context.al = 14; + playchannel1(context); + context.es = context.pop(); + context.bx = context.pop(); + context.ax = 1000; +nobark: + context.data.word(context.bx+3) = context.ax; + return; +} + +static inline void intromusic(Context & context) { + return; +} + +static inline void foghornsound(Context & context) { + randomnumber(context); + context._cmp(context.al, 198); + if (!context.flags.z()) goto nofog; + context.al = 13; + playchannel1(context); +nofog: + return; +} + +static inline void receptionist(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto gotrecep; + context._cmp(context.data.byte(52), 1); + if (!context.flags.z()) goto notsetcard; + context._add(context.data.byte(52), 1); + context.data.byte(context.bx+7) = 1; + context.data.word(context.bx+3) = 64; +notsetcard: + context._cmp(context.data.word(context.bx+3), 58); + if (!context.flags.z()) goto notdes1; + randomnumber(context); + context._cmp(context.al, 30); + if (context.flags.c()) goto notdes2; + context.data.word(context.bx+3) = 55; + goto gotrecep; +notdes1: + context._cmp(context.data.word(context.bx+3), 60); + if (!context.flags.z()) goto notdes2; + randomnumber(context); + context._cmp(context.al, 240); + if (context.flags.c()) goto gotrecep; + context.data.word(context.bx+3) = 53; + goto gotrecep; +notdes2: + context._cmp(context.data.word(context.bx+3), 88); + if (!context.flags.z()) goto notendcard; + context.data.word(context.bx+3) = 53; + goto gotrecep; +notendcard: + context._add(context.data.word(context.bx+3), 1); +gotrecep: + showgamereel(context); + addtopeoplelist(context); + context.al = context.data.byte(context.bx+7); + context._and(context.al, 128); + if (context.flags.z()) goto nottalkedrecep; + context.data.byte(51) = 1; +nottalkedrecep: + return; +} + +static inline void smokebloke(Context & context) { + context._cmp(context.data.byte(41), 0); + if (!context.flags.z()) goto notspokento; + context.al = context.data.byte(context.bx+7); + context._and(context.al, 128); + if (context.flags.z()) goto notspokento; + context.push(context.es); + context.push(context.bx); + context.al = 5; + setlocation(context); + context.bx = context.pop(); + context.es = context.pop(); +notspokento: + checkspeed(context); + if (!context.flags.z()) goto gotsmokeb; + context._cmp(context.data.word(context.bx+3), 100); + if (!context.flags.z()) goto notsmokeb1; + randomnumber(context); + context._cmp(context.al, 30); + if (context.flags.c()) goto notsmokeb2; + context.data.word(context.bx+3) = 96; + goto gotsmokeb; +notsmokeb1: + context._cmp(context.data.word(context.bx+3), 117); + if (!context.flags.z()) goto notsmokeb2; + context.data.word(context.bx+3) = 96; + goto gotsmokeb; +notsmokeb2: + context._add(context.data.word(context.bx+3), 1); +gotsmokeb: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void attendant(Context & context) { + showgamereel(context); + addtopeoplelist(context); + context.al = context.data.byte(context.bx+7); + context._and(context.al, 128); + if (context.flags.z()) goto nottalked; + context.data.byte(48) = 1; +nottalked: + return; +} + +static inline void manasleep(Context & context) { + context.al = context.data.byte(context.bx+7); + context._and(context.al, 127); + context.data.byte(context.bx+7) = context.al; + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void eden(Context & context) { + context._cmp(context.data.byte(42), 0); + if (!context.flags.z()) goto notinbed; + showgamereel(context); + addtopeoplelist(context); +notinbed: + return; +} + +static inline void edeninbath(Context & context) { + context._cmp(context.data.byte(42), 0); + if (context.flags.z()) goto notinbed; + context._cmp(context.data.byte(43), 0); + if (!context.flags.z()) goto notinbath; + showgamereel(context); + addtopeoplelist(context); +notinbath: + return; +/*continuing to unbounded code: notinbed from eden:5-6*/ +notinbed: + return; + return; +} + +static inline void malefan(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void femalefan(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void louis(Context & context) { + context._cmp(context.data.byte(41), 0); + if (!context.flags.z()) goto notlouis1; + showgamereel(context); + addtopeoplelist(context); +notlouis1: + return; +} + +static inline void louischair(Context & context) { + context._cmp(context.data.byte(41), 0); + if (context.flags.z()) goto notlouis2; + checkspeed(context); + if (!context.flags.z()) goto notlouisanim; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 191); + if (context.flags.z()) goto restartlouis; + context._cmp(context.ax, 185); + if (context.flags.z()) goto randomlouis; + context.data.word(context.bx+3) = context.ax; + goto notlouisanim; +randomlouis: + context.data.word(context.bx+3) = context.ax; + randomnumber(context); + context._cmp(context.al, 245); + if (!context.flags.c()) goto notlouisanim; +restartlouis: + context.ax = 182; + context.data.word(context.bx+3) = context.ax; +notlouisanim: + showgamereel(context); + addtopeoplelist(context); +notlouis2: + return; +} + +static inline void manasleep2(Context & context) { + context.al = context.data.byte(context.bx+7); + context._and(context.al, 127); + context.data.byte(context.bx+7) = context.al; + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void mansatstill(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void tattooman(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void drinker(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto gotdrinker; + context._add(context.data.word(context.bx+3), 1); + context._cmp(context.data.word(context.bx+3), 115); + if (!context.flags.z()) goto notdrinker1; + context.data.word(context.bx+3) = 105; + goto gotdrinker; +notdrinker1: + context._cmp(context.data.word(context.bx+3), 106); + if (!context.flags.z()) goto gotdrinker; + randomnumber(context); + context._cmp(context.al, 3); + if (context.flags.c()) goto gotdrinker; + context.data.word(context.bx+3) = 105; +gotdrinker: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void bartender(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto gotsmoket; + context._cmp(context.data.word(context.bx+3), 86); + if (!context.flags.z()) goto notsmoket1; + randomnumber(context); + context._cmp(context.al, 18); + if (context.flags.c()) goto notsmoket2; + context.data.word(context.bx+3) = 81; + goto gotsmoket; +notsmoket1: + context._cmp(context.data.word(context.bx+3), 103); + if (!context.flags.z()) goto notsmoket2; + context.data.word(context.bx+3) = 81; + goto gotsmoket; +notsmoket2: + context._add(context.data.word(context.bx+3), 1); +gotsmoket: + showgamereel(context); + context._cmp(context.data.byte(46), 1); + if (!context.flags.z()) goto notgotgun; + context.data.byte(context.bx+7) = 9; +notgotgun: + addtopeoplelist(context); + return; +} + +static inline void othersmoker(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void barwoman(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void interviewer(Context & context) { + context._cmp(context.data.word(23), 68); + if (!context.flags.z()) goto notgeneralstart; + context._add(context.data.word(context.bx+3), 1); +notgeneralstart: + context._cmp(context.data.word(context.bx+3), 250); + if (context.flags.z()) goto talking; + checkspeed(context); + if (!context.flags.z()) goto talking; + context._cmp(context.data.word(context.bx+3), 259); + if (context.flags.z()) goto talking; + context._add(context.data.word(context.bx+3), 1); +talking: + showgamereel(context); + return; +} + +static inline void soldier1(Context & context) { + context._cmp(context.data.word(context.bx+3), 0); + if (context.flags.z()) goto soldierwait; + context.data.word(21) = 10; + context._cmp(context.data.word(context.bx+3), 30); + if (!context.flags.z()) goto notaftersshot; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); + if (!context.flags.z()) goto gotsoldframe; + context.data.byte(56) = 2; + goto gotsoldframe; +notaftersshot: + checkspeed(context); + if (!context.flags.z()) goto gotsoldframe; + context._add(context.data.word(context.bx+3), 1); + goto gotsoldframe; +soldierwait: + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto gotsoldframe; + context.data.word(21) = 10; + context._cmp(context.data.byte(475), 2); + if (!context.flags.z()) goto gotsoldframe; + context._cmp(context.data.byte(133), 4); + if (!context.flags.z()) goto gotsoldframe; + context._add(context.data.word(context.bx+3), 1); + context.data.byte(65) = -1; + context.data.byte(64) = 0; +gotsoldframe: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void rockstar(Context & context) { + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 303); + if (context.flags.z()) goto rockcombatend; + context._cmp(context.ax, 118); + if (context.flags.z()) goto rockcombatend; + checkspeed(context); + if (!context.flags.z()) goto rockspeed; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 118); + if (!context.flags.z()) goto notbeforedead; + context.data.byte(56) = 2; + goto gotrockframe; +notbeforedead: + context._cmp(context.ax, 79); + if (!context.flags.z()) goto gotrockframe; + context._sub(context.ax, 1); + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto notgunonrock; + context.data.byte(65) = -1; + context.ax = 123; + goto gotrockframe; +notgunonrock: + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); + if (!context.flags.z()) goto gotrockframe; + context.data.byte(64) = 0; + context.ax = 79; +gotrockframe: + context.data.word(context.bx+3) = context.ax; +rockspeed: + showgamereel(context); + context._cmp(context.data.word(context.bx+3), 78); + if (!context.flags.z()) goto notalkrock; + addtopeoplelist(context); + context.data.byte(234) = 2; + context.data.word(21) = 0; + return; +notalkrock: + context.data.word(21) = 2; + context.data.byte(234) = 0; + context.al = context.data.byte(149); + context.data.byte(context.bx+2) = context.al; + return; +rockcombatend: + context.data.byte(188) = 45; + showgamereel(context); + return; +} + +static inline void helicopter(Context & context) { + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 203); + if (context.flags.z()) goto heliwon; + checkspeed(context); + if (!context.flags.z()) goto helispeed; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 53); + if (!context.flags.z()) goto notbeforehdead; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 8); + if (context.flags.c()) goto waitabit; + context.data.byte(56) = 2; +waitabit: + context.ax = 49; + goto gotheliframe; +notbeforehdead: + context._cmp(context.ax, 9); + if (!context.flags.z()) goto gotheliframe; + context._sub(context.ax, 1); + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto notgunonheli; + context.data.byte(65) = -1; + context.ax = 55; + goto gotheliframe; +notgunonheli: + context.ax = 5; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 20); + if (!context.flags.z()) goto gotheliframe; + context.data.byte(64) = 0; + context.ax = 9; +gotheliframe: + context.data.word(context.bx+3) = context.ax; +helispeed: + showgamereel(context); + context.al = context.data.byte(148); + context.data.byte(context.bx+1) = context.al; +helicombatend: + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 9); + if (!context.flags.c()) goto notwaitingheli; + context._cmp(context.data.byte(64), 7); + if (context.flags.c()) goto notwaitingheli; + context.data.byte(234) = 2; + context.data.word(21) = 0; + return; +notwaitingheli: + context.data.byte(234) = 0; + context.data.word(21) = 2; + return; +heliwon: + context.data.byte(234) = 0; + return; +} + +static inline void mugger(Context & context) { + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 138); + if (context.flags.z()) goto endmugger1; + context._cmp(context.ax, 176); + if (context.flags.z()) goto endmugger2; + context._cmp(context.ax, 2); + if (!context.flags.z()) goto havesetwatch; + context.data.word(21) = 175*2; +havesetwatch: + checkspeed(context); + if (!context.flags.z()) goto notmugger; + context._add(context.data.word(context.bx+3), 1); +notmugger: + showgamereel(context); + context.al = context.data.byte(148); + context.data.byte(context.bx+1) = context.al; + return; +endmugger1: + context.push(context.es); + context.push(context.bx); + createpanel2(context); + showicon(context); + context.al = 41; + findpuztext(context); + context.di = 33+20; + context.bx = 104; + context.dl = 241; + context.ah = 0; + printdirect(context); + worktoscreen(context); + context.cx = 300; + hangon(context); + context.bx = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.bx); + context.data.word(context.bx+3) = 140; + context.data.byte(475) = 2; + context.data.byte(477) = 2; + findxyfrompath(context); + context.data.byte(187) = 1; + context.al = 'W'; + context.ah = 'E'; + context.cl = 'T'; + context.ch = 'A'; + findexobject(context); + context.data.byte(99) = context.al; + context.data.byte(102) = 4; + removeobfrominv(context); + context.al = 'W'; + context.ah = 'E'; + context.cl = 'T'; + context.ch = 'B'; + findexobject(context); + context.data.byte(99) = context.al; + context.data.byte(102) = 4; + removeobfrominv(context); + makemainscreen(context); + context.al = 48; + context.bl = 68-32; + context.bh = 54+64; + context.cx = 70; + context.dx = 10; + setuptimeduse(context); + context.data.byte(45) = 1; + context.bx = context.pop(); + context.es = context.pop(); + return; +endmugger2: + return; +} + +static inline void aide(Context & context) { + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void businessman(Context & context) { + context.data.byte(234) = 0; + context.data.word(21) = 2; + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 2); + if (!context.flags.z()) goto notfirstbiz; + context.push(context.ax); + context.push(context.bx); + context.push(context.es); + context.al = 49; + context.cx = 30; + context.dx = 1; + context.bl = 68; + context.bh = 174; + setuptimeduse(context); + context.es = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); +notfirstbiz: + context._cmp(context.ax, 95); + if (context.flags.z()) goto buscombatwonend; + context._cmp(context.ax, 49); + if (context.flags.z()) goto buscombatend; + checkspeed(context); + if (!context.flags.z()) goto busspeed; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 48); + if (!context.flags.z()) goto notbeforedeadb; + context.data.byte(56) = 2; + goto gotbusframe; +notbeforedeadb: + context._cmp(context.ax, 15); + if (!context.flags.z()) goto buscombatwon; + context._sub(context.ax, 1); + context._cmp(context.data.byte(65), 3); + if (!context.flags.z()) goto notshieldonbus; + context.data.byte(65) = -1; + context.data.byte(64) = 0; + context.ax = 51; + goto gotbusframe; +notshieldonbus: + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 20); + if (!context.flags.z()) goto gotbusframe; + context.data.byte(64) = 0; + context.ax = 15; + goto gotbusframe; +buscombatwon: + context._cmp(context.ax, 91); + if (!context.flags.z()) goto gotbusframe; + context.push(context.bx); + context.push(context.es); + context.al = 0; + turnpathon(context); + context.al = 1; + turnpathon(context); + context.al = 2; + turnpathon(context); + context.al = 3; + turnpathoff(context); + context.data.byte(475) = 5; + context.data.byte(477) = 5; + findxyfrompath(context); + context.data.byte(187) = 1; + context.es = context.pop(); + context.bx = context.pop(); + context.ax = 92; + goto gotbusframe; +gotbusframe: + context.data.word(context.bx+3) = context.ax; +busspeed: + showgamereel(context); + context.al = context.data.byte(149); + context.data.byte(context.bx+2) = context.al; + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 14); + if (!context.flags.z()) goto buscombatend; + context.data.word(21) = 0; + context.data.byte(234) = 2; + return; +buscombatend: + return; +buscombatwonend: + context.data.byte(234) = 0; + context.data.word(21) = 0; + return; +} + +static inline void poolguard(Context & context) { + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 214); + if (context.flags.z()) goto combatover2; + context._cmp(context.ax, 258); + if (context.flags.z()) goto combatover2; + context._cmp(context.ax, 185); + if (context.flags.z()) goto combatover1; + context._cmp(context.ax, 0); + if (!context.flags.z()) goto notfirstpool; + context.al = 0; + turnpathon(context); +notfirstpool: + checkspeed(context); + if (!context.flags.z()) goto guardspeed; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 122); + if (!context.flags.z()) goto notendguard1; + context._sub(context.ax, 1); + context._cmp(context.data.byte(65), 2); + if (!context.flags.z()) goto notaxeonpool; + context.data.byte(65) = -1; + context.ax = 122; + goto gotguardframe; +notaxeonpool: + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); + if (!context.flags.z()) goto gotguardframe; + context.data.byte(64) = 0; + context.ax = 195; + goto gotguardframe; +notendguard1: + context._cmp(context.ax, 147); + if (!context.flags.z()) goto gotguardframe; + context._sub(context.ax, 1); + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto notgunonpool; + context.data.byte(65) = -1; + context.ax = 147; + goto gotguardframe; +notgunonpool: + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); + if (!context.flags.z()) goto gotguardframe; + context.data.byte(64) = 0; + context.ax = 220; +gotguardframe: + context.data.word(context.bx+3) = context.ax; +guardspeed: + showgamereel(context); + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 121); + if (context.flags.z()) goto iswaitingpool; + context._cmp(context.ax, 146); + if (context.flags.z()) goto iswaitingpool; + context.data.byte(234) = 0; + context.data.word(21) = 2; + return; +iswaitingpool: + context.data.byte(234) = 2; + context.data.word(21) = 0; + return; +combatover1: + context.data.word(21) = 0; + context.data.byte(234) = 0; + context.al = 0; + turnpathon(context); + context.al = 1; + turnpathoff(context); + return; +combatover2: + showgamereel(context); + context.data.word(21) = 2; + context.data.byte(234) = 0; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 100); + if (context.flags.c()) goto doneover2; + context.data.word(21) = 0; + context.data.byte(56) = 2; +doneover2: + return; +} + +static inline void security(Context & context) { + context._cmp(context.data.word(context.bx+3), 32); + if (context.flags.z()) goto securwait; + context._cmp(context.data.word(context.bx+3), 69); + if (!context.flags.z()) goto notaftersec; + return; +notaftersec: + context.data.word(21) = 10; + checkspeed(context); + if (!context.flags.z()) goto gotsecurframe; + context._add(context.data.word(context.bx+3), 1); + goto gotsecurframe; +securwait: + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto gotsecurframe; + context.data.word(21) = 10; + context._cmp(context.data.byte(475), 9); + if (!context.flags.z()) goto gotsecurframe; + context._cmp(context.data.byte(133), 0); + if (!context.flags.z()) goto gotsecurframe; + context.data.byte(65) = -1; + context._add(context.data.word(context.bx+3), 1); +gotsecurframe: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void heavy(Context & context) { + context.al = context.data.byte(context.bx+7); + context._and(context.al, 127); + context.data.byte(context.bx+7) = context.al; + context._cmp(context.data.word(context.bx+3), 43); + if (context.flags.z()) goto heavywait; + context.data.word(21) = 10; + context._cmp(context.data.word(context.bx+3), 70); + if (!context.flags.z()) goto notafterhshot; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 80); + if (!context.flags.z()) goto gotheavyframe; + context.data.byte(56) = 2; + goto gotheavyframe; +notafterhshot: + checkspeed(context); + if (!context.flags.z()) goto gotheavyframe; + context._add(context.data.word(context.bx+3), 1); + goto gotheavyframe; +heavywait: + context._cmp(context.data.byte(65), 1); + if (!context.flags.z()) goto gotheavyframe; + context._cmp(context.data.byte(475), 5); + if (!context.flags.z()) goto gotheavyframe; + context._cmp(context.data.byte(133), 4); + if (!context.flags.z()) goto gotheavyframe; + context.data.byte(65) = -1; + context._add(context.data.word(context.bx+3), 1); + context.data.byte(64) = 0; +gotheavyframe: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void bossman(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto notboss; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 4); + if (context.flags.z()) goto firstdes; + context._cmp(context.ax, 20); + if (context.flags.z()) goto secdes; + context._cmp(context.ax, 41); + if (!context.flags.z()) goto gotallboss; + context.ax = 0; + context._add(context.data.byte(46), 1); + context.data.byte(context.bx+7) = 10; + goto gotallboss; +firstdes: + context._cmp(context.data.byte(46), 1); + if (context.flags.z()) goto gotallboss; + context.push(context.ax); + randomnumber(context); + context.cl = context.al; + context.ax = context.pop(); + context._cmp(context.cl, 10); + if (context.flags.c()) goto gotallboss; + context.ax = 0; + goto gotallboss; +secdes: + context._cmp(context.data.byte(46), 1); + if (context.flags.z()) goto gotallboss; + context.ax = 0; +gotallboss: + context.data.word(context.bx+3) = context.ax; +notboss: + showgamereel(context); + addtopeoplelist(context); + context.al = context.data.byte(context.bx+7); + context._and(context.al, 128); + if (context.flags.z()) goto nottalkedboss; + context.data.byte(50) = 1; +nottalkedboss: + return; +} + +static inline void gamer(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto gamerfin; +gameragain: + randomnum1(context); + context._and(context.al, 7); + context._cmp(context.al, 5); + if (!context.flags.c()) goto gameragain; + context._add(context.al, 20); + context._cmp(context.al, context.data.byte(context.bx+3)); + if (context.flags.z()) goto gameragain; + context.ah = 0; + context.data.word(context.bx+3) = context.ax; +gamerfin: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void sparkydrip(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto cantdrip; + context.al = 14; + context.ah = 0; + playchannel0(context); +cantdrip: + return; +} + +static inline void carparkdrip(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto cantdrip2; + context.al = 14; + playchannel1(context); +cantdrip2: + return; +} + +static inline void keeper(Context & context) { + context._cmp(context.data.byte(54), 0); + if (!context.flags.z()) goto notwaiting; + context._cmp(context.data.word(23), 190); + if (context.flags.c()) goto waiting; + context._add(context.data.byte(54), 1); + context.ah = context.data.byte(context.bx+7); + context._and(context.ah, 127); + context._cmp(context.ah, context.data.byte(66)); + if (context.flags.z()) goto notdiff; + context.al = context.data.byte(66); + context.data.byte(context.bx+7) = context.al; +notdiff: + return; +notwaiting: + addtopeoplelist(context); + showgamereel(context); +waiting: + return; +} + +static inline void candles1(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto candle1; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 44); + if (!context.flags.z()) goto notendcandle1; + context.ax = 39; +notendcandle1: + context.data.word(context.bx+3) = context.ax; +candle1: + showgamereel(context); + return; +} + +static inline void smallcandle(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto smallcandlef; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 37); + if (!context.flags.z()) goto notendsmallcandle; + context.ax = 25; +notendsmallcandle: + context.data.word(context.bx+3) = context.ax; +smallcandlef: + showgamereel(context); + return; +} + +static inline void intromagic1(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto introm1fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 145); + if (!context.flags.z()) goto gotintrom1; + context.ax = 121; +gotintrom1: + context.data.word(context.bx+3) = context.ax; + context._cmp(context.ax, 121); + if (!context.flags.z()) goto introm1fin; + context._add(context.data.byte(139), 1); + context.push(context.es); + context.push(context.bx); + intro1text(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(139), 8); + if (!context.flags.z()) goto introm1fin; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; +introm1fin: + showgamereel(context); + return; +} + +static inline void candles(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto candlesfin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 167); + if (!context.flags.z()) goto gotcandles; + context.ax = 162; +gotcandles: + context.data.word(context.bx+3) = context.ax; +candlesfin: + showgamereel(context); + return; +} + +static inline void candles2(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto candles2fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 238); + if (!context.flags.z()) goto gotcandles2; + context.ax = 233; +gotcandles2: + context.data.word(context.bx+3) = context.ax; +candles2fin: + showgamereel(context); + return; +} + +static inline void gates(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto gatesfin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 116); + if (!context.flags.z()) goto notbang; + context.push(context.ax); + context.push(context.bx); + context.push(context.es); + context.al = 17; + playchannel1(context); + context.es = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); +notbang: + context._cmp(context.ax, 110); + if (context.flags.c()) goto slowgates; + context.data.byte(context.bx+5) = 2; +slowgates: + context._cmp(context.ax, 120); + if (!context.flags.z()) goto gotgates; + context.data.byte(103) = 1; + context.ax = 119; +gotgates: + context.data.word(context.bx+3) = context.ax; + context.push(context.es); + context.push(context.bx); + intro3text(context); + context.bx = context.pop(); + context.es = context.pop(); +gatesfin: + showgamereel(context); + return; +} + +static inline void intromagic2(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto introm2fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 216); + if (!context.flags.z()) goto gotintrom2; + context.ax = 192; +gotintrom2: + context.data.word(context.bx+3) = context.ax; +introm2fin: + showgamereel(context); + return; +} + +static inline void intromagic3(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto introm3fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 218); + if (!context.flags.z()) goto gotintrom3; + context.data.byte(103) = 1; +gotintrom3: + context.data.word(context.bx+3) = context.ax; +introm3fin: + showgamereel(context); + context.al = context.data.byte(148); + context.data.byte(context.bx+1) = context.al; + return; +} + +static inline void intromonks1(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto intromonk1fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 80); + if (!context.flags.z()) goto notendmonk1; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; + showgamereel(context); + return; +notendmonk1: + context._cmp(context.ax, 30); + if (!context.flags.z()) goto gotintromonk1; + context._sub(context.data.byte(149), 10); + context.data.byte(186) = 1; + context.ax = 51; +gotintromonk1: + context.data.word(context.bx+3) = context.ax; + context._cmp(context.ax, 5); + if (context.flags.z()) goto waitstep; + context._cmp(context.ax, 15); + if (context.flags.z()) goto waitstep; + context._cmp(context.ax, 25); + if (context.flags.z()) goto waitstep; + context._cmp(context.ax, 61); + if (context.flags.z()) goto waitstep; + context._cmp(context.ax, 71); + if (context.flags.z()) goto waitstep; + goto intromonk1fin; +waitstep: + context.push(context.es); + context.push(context.bx); + intro2text(context); + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(context.bx+6) = -20; +intromonk1fin: + showgamereel(context); + context.al = context.data.byte(149); + context.data.byte(context.bx+2) = context.al; + return; +} + +static inline void intromonks2(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto intromonk2fin; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 87); + if (!context.flags.z()) goto nottalk1; + context._add(context.data.byte(139), 1); + context.push(context.es); + context.push(context.bx); + monks2text(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(139), 19); + if (!context.flags.z()) goto notlasttalk1; + context.ax = 87; + goto gotintromonk2; +notlasttalk1: + context.ax = 74; + goto gotintromonk2; +nottalk1: + context._cmp(context.ax, 110); + if (!context.flags.z()) goto notraisearm; + context._add(context.data.byte(139), 1); + context.push(context.es); + context.push(context.bx); + monks2text(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(139), 35); + if (!context.flags.z()) goto notlastraise; + context.ax = 111; + goto gotintromonk2; +notlastraise: + context.ax = 98; + goto gotintromonk2; +notraisearm: + context._cmp(context.ax, 176); + if (!context.flags.z()) goto notendmonk2; + context.data.byte(103) = 1; + goto gotintromonk2; +notendmonk2: + context._cmp(context.ax, 125); + if (!context.flags.z()) goto gotintromonk2; + context.ax = 140; +gotintromonk2: + context.data.word(context.bx+3) = context.ax; +intromonk2fin: + showgamereel(context); + return; +} + +static inline void handclap(Context & context) { + return; +} + +static inline void monks2text(Context & context) { + context._cmp(context.data.byte(139), 1); + if (!context.flags.z()) goto notmonk2text1; + context.al = 8; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text1: + context._cmp(context.data.byte(139), 4); + if (!context.flags.z()) goto notmonk2text2; + context.al = 9; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text2: + context._cmp(context.data.byte(139), 7); + if (!context.flags.z()) goto notmonk2text3; + context.al = 10; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text3: + context._cmp(context.data.byte(139), 10); + if (!context.flags.z()) goto notmonk2text4; + context.al = 11; + context.bl = 0; + context.bh = 105; + context.cx = 100; + goto gotmonks2text; +notmonk2text4: + context._cmp(context.data.byte(139), 13); + if (!context.flags.z()) goto notmonk2text5; + context.al = 12; + context.bl = 0; + context.bh = 120; + context.cx = 100; + goto gotmonks2text; +notmonk2text5: + context._cmp(context.data.byte(139), 16); + if (!context.flags.z()) goto notmonk2text6; + context.al = 13; + context.bl = 0; + context.bh = 135; + context.cx = 100; + goto gotmonks2text; +notmonk2text6: + context._cmp(context.data.byte(139), 19); + if (!context.flags.z()) goto notmonk2text7; + context.al = 14; + context.bl = 36; + context.bh = 160; + context.cx = 100; + context.dx = 1; + context.ah = 82; + { setuptimedtemp(context); return; }; +notmonk2text7: + context._cmp(context.data.byte(139), 22); + if (!context.flags.z()) goto notmonk2text8; + context.al = 15; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text8: + context._cmp(context.data.byte(139), 25); + if (!context.flags.z()) goto notmonk2text9; + context.al = 16; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text9: + context._cmp(context.data.byte(139), 28); + if (!context.flags.z()) goto notmonk2text10; + context.al = 17; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text10: + context._cmp(context.data.byte(139), 31); + if (!context.flags.z()) goto notmonk2text11; + context.al = 18; + context.bl = 36; + context.bh = 160; + context.cx = 100; + goto gotmonks2text; +notmonk2text11: + return; +gotmonks2text: + context.dx = 1; + context.cx = 120; + context.ah = 82; + setuptimedtemp(context); + return; +} + +static inline void intro1text(Context & context) { + context._cmp(context.data.byte(139), 2); + if (!context.flags.z()) goto notintro1text1; + context.al = 40; + context.bl = 34; + context.bh = 130; + context.cx = 90; + goto gotintro1text; +notintro1text1: + context._cmp(context.data.byte(139), 4); + if (!context.flags.z()) goto notintro1text2; + context.al = 41; + context.bl = 34; + context.bh = 130; + context.cx = 90; + goto gotintro1text; +notintro1text2: + context._cmp(context.data.byte(139), 6); + if (!context.flags.z()) goto notintro1text3; + context.al = 42; + context.bl = 34; + context.bh = 130; + context.cx = 90; + goto gotintro1text; +notintro1text3: + return; +gotintro1text: + context.dx = 1; + context.ah = 82; +oktalk2: + setuptimedtemp(context); + return; +} + +static inline void intro2text(Context & context) { + context._cmp(context.ax, 5); + if (!context.flags.z()) goto notintro2text1; + context.al = 43; + context.bl = 34; + context.bh = 40; + context.cx = 90; + goto gotintro2text; +notintro2text1: + context._cmp(context.ax, 15); + if (!context.flags.z()) goto notintro2text2; + context.al = 44; + context.bl = 34; + context.bh = 40; + context.cx = 90; + goto gotintro2text; +notintro2text2: + return; +gotintro2text: + context.dx = 1; + context.ah = 82; + setuptimedtemp(context); + return; +} + +static inline void intro3text(Context & context) { + context._cmp(context.ax, 107); + if (!context.flags.z()) goto notintro3text1; + context.al = 45; + context.bl = 36; + context.bh = 56; + context.cx = 100; + goto gotintro3text; +notintro3text1: + context._cmp(context.ax, 109); + if (!context.flags.z()) goto notintro3text2; + context.al = 46; + context.bl = 36; + context.bh = 56; + context.cx = 100; + goto gotintro3text; +notintro3text2: + return; +gotintro3text: + context.dx = 1; + context.ah = 82; + setuptimedtemp(context); + return; +} + +static inline void monkandryan(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto notmonkryan; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 83); + if (!context.flags.z()) goto gotmonkryan; + context._add(context.data.byte(139), 1); + context.push(context.es); + context.push(context.bx); + textformonk(context); + context.bx = context.pop(); + context.es = context.pop(); + context.ax = 77; + context._cmp(context.data.byte(139), 57); + if (!context.flags.z()) goto gotmonkryan; + context.data.byte(103) = 1; + return; +gotmonkryan: + context.data.word(context.bx+3) = context.ax; +notmonkryan: + showgamereel(context); + return; +} + +static inline void endgameseq(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto notendseq; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 51); + if (!context.flags.z()) goto gotendseq; + context._cmp(context.data.byte(139), 140); + if (context.flags.z()) goto gotendseq; + context._add(context.data.byte(139), 1); + context.push(context.es); + context.push(context.bx); + textforend(context); + context.bx = context.pop(); + context.es = context.pop(); + context.ax = 50; +gotendseq: + context.data.word(context.bx+3) = context.ax; + context._cmp(context.ax, 134); + if (!context.flags.z()) goto notfadedown; + context.push(context.es); + context.push(context.bx); + context.push(context.ax); + fadescreendownhalf(context); + context.ax = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + goto notendseq; +notfadedown: + context._cmp(context.ax, 324); + if (!context.flags.z()) goto notfadeend; + context.push(context.es); + context.push(context.bx); + context.push(context.ax); + fadescreendowns(context); + context.data.byte(387) = 7; + context.data.byte(388) = 1; + context.ax = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); +notfadeend: + context._cmp(context.ax, 340); + if (!context.flags.z()) goto notendseq; + context.data.byte(103) = 1; +notendseq: + showgamereel(context); + context.al = context.data.byte(149); + context.data.byte(context.bx+2) = context.al; + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 145); + if (!context.flags.z()) goto notendcreds; + context.data.word(context.bx+3) = 146; + rollendcredits(context); +notendcreds: + return; +} + +static inline void rollendcredits(Context & context) { + context.al = 16; + context.ah = 255; + playchannel0(context); + context.data.byte(386) = 7; + context.data.byte(387) = 0; + context.data.byte(388) = -1; + context.cl = 160; + context.ch = 160; + context.di = 75; + context.bx = 20; + context.ds = context.data.word(402); + context.si = 0; + multiget(context); + context.es = context.data.word(466); + context.si = 3*2; + context.ax = context.data.word(context.si); + context.si = context.ax; + context._add(context.si, 66*2); + context.cx = 254; +endcredits1: + context.push(context.cx); + context.bx = 10; + context.cx = context.data.word(77); +endcredits2: + context.push(context.cx); + context.push(context.si); + context.push(context.di); + context.push(context.es); + context.push(context.bx); + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 75; + context.bx = 20; + context.ds = context.data.word(402); + context.si = 0; + multiput(context); + vsync(context); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + context.push(context.si); + context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.cx = 18; +onelot: + context.push(context.cx); + context.di = 75; + context.dx = 161; + context.ax = 0; + printdirect(context); + context._add(context.bx, context.data.word(77)); + context.cx = context.pop(); + if (--context.cx) goto onelot; + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 75; + context.bx = 20; + multidump(context); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._sub(context.bx, 1); + if (--context.cx) goto endcredits2; + context.cx = context.pop(); +looknext: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto gotnext; + context._cmp(context.al, 0); + if (context.flags.z()) goto gotnext; + goto looknext; +gotnext: + if (--context.cx) goto endcredits1; + context.cx = 100; + hangon(context); + paneltomap(context); + fadescreenuphalf(context); + return; +} + +static inline void priest(Context & context) { + context._cmp(context.data.word(context.bx+3), 8); + if (context.flags.z()) goto priestspoken; + context.data.byte(234) = 0; + context.data.word(21) = 2; + checkspeed(context); + if (!context.flags.z()) goto priestwait; + context._add(context.data.word(context.bx+3), 1); + context.push(context.es); + context.push(context.bx); + priesttext(context); + context.bx = context.pop(); + context.es = context.pop(); +priestwait: + return; +priestspoken: + return; +} + +static inline void madmanstelly(Context & context) { + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 307); + if (!context.flags.z()) goto notendtelly; + context.ax = 300; +notendtelly: + context.data.word(context.bx+3) = context.ax; + showgamereel(context); + return; +} + +static inline void madman(Context & context) { + context.data.word(21) = 2; + checkspeed(context); + if (!context.flags.z()) goto nomadspeed; + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 364); + if (!context.flags.c()) goto ryansded; + context._cmp(context.ax, 10); + if (!context.flags.z()) goto notfirstmad; + context.push(context.es); + context.push(context.bx); + context.push(context.ax); + context.dx = 2260; + loadtemptext(context); + context.ax = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(64) = -1; + context.data.byte(69) = 0; +notfirstmad: + context._add(context.ax, 1); + context._cmp(context.ax, 294); + if (context.flags.z()) goto madmanspoken; + context._cmp(context.ax, 66); + if (!context.flags.z()) goto nomadspeak; + context._add(context.data.byte(64), 1); + context.push(context.es); + context.push(context.bx); + madmantext(context); + context.bx = context.pop(); + context.es = context.pop(); + context.ax = 53; + context._cmp(context.data.byte(64), 62); + if (context.flags.c()) goto nomadspeak; + context._cmp(context.data.byte(64), 68); + if (context.flags.z()) goto killryan; + context._cmp(context.data.byte(65), 8); + if (!context.flags.z()) goto nomadspeak; + context.data.byte(64) = 70; + context.data.byte(65) = -1; + context.data.byte(53) = 1; + context.ax = 67; + goto nomadspeak; +killryan: + context.ax = 310; +nomadspeak: + context.data.word(context.bx+3) = context.ax; +nomadspeed: + showgamereel(context); + context.al = context.data.byte(148); + context.data.byte(context.bx+1) = context.al; + madmode(context); + return; +madmanspoken: + context._cmp(context.data.byte(391), 1); + if (context.flags.z()) goto alreadywon; + context.data.byte(391) = 1; + context.push(context.es); + context.push(context.bx); + getridoftemptext(context); + context.bx = context.pop(); + context.es = context.pop(); +alreadywon: + return; +ryansded: + context.data.byte(56) = 2; + showgamereel(context); + return; +} + +static inline void madmantext(Context & context) { + context._cmp(context.data.byte(64), 61); + if (!context.flags.c()) goto nomadtext; + context.al = context.data.byte(64); + context._and(context.al, 3); + if (!context.flags.z()) goto nomadtext; + context.al = context.data.byte(64); + context._shr(context.al, 1); + context._shr(context.al, 1); + context._add(context.al, 47); + context.bl = 72; + context.bh = 80; + context.cx = 90; + context.dx = 1; + context.ah = 82; + setuptimedtemp(context); +nomadtext: + return; +} + +static inline void madmode(Context & context) { + context.data.word(21) = 2; + context.data.byte(234) = 0; + context._cmp(context.data.byte(64), 63); + if (context.flags.c()) goto iswatchmad; + context._cmp(context.data.byte(64), 68); + if (!context.flags.c()) goto iswatchmad; + context.data.byte(234) = 2; +iswatchmad: + return; +} + +static inline void priesttext(Context & context) { + context._cmp(context.data.word(context.bx+3), 2); + if (context.flags.c()) goto nopriesttext; + context._cmp(context.data.word(context.bx+3), 7); + if (!context.flags.c()) goto nopriesttext; + context.al = context.data.byte(context.bx+3); + context._and(context.al, 1); + if (!context.flags.z()) goto nopriesttext; + context.al = context.data.byte(context.bx+3); + context._shr(context.al, 1); + context._add(context.al, 50); + context.bl = 72; + context.bh = 80; + context.cx = 54; + context.dx = 1; + setuptimeduse(context); +nopriesttext: + return; +} + +static inline void textforend(Context & context) { + context._cmp(context.data.byte(139), 20); + if (!context.flags.z()) goto notendtext1; + context.al = 0; + context.bl = 34; + context.bh = 20; + context.cx = 60; + goto gotendtext; +notendtext1: + context._cmp(context.data.byte(139), 65); + if (!context.flags.z()) goto notendtext2; + context.al = 1; + context.bl = 34; + context.bh = 20; + context.cx = 60; + goto gotendtext; +notendtext2: + context._cmp(context.data.byte(139), 110); + if (!context.flags.z()) goto notendtext3; + context.al = 2; + context.bl = 34; + context.bh = 20; + context.cx = 60; + goto gotendtext; +notendtext3: + return; +gotendtext: + context.dx = 1; + context.ah = 83; + setuptimedtemp(context); + return; +} + +static inline void textformonk(Context & context) { + context._cmp(context.data.byte(139), 1); + if (!context.flags.z()) goto notmonktext1; + context.al = 19; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext1: + context._cmp(context.data.byte(139), 5); + if (!context.flags.z()) goto notmonktext2; + context.al = 20; + context.bl = 68; + context.bh = 38; + context.cx = 120; + goto gotmonktext; +notmonktext2: + context._cmp(context.data.byte(139), 9); + if (!context.flags.z()) goto notmonktext3; + context.al = 21; + context.bl = 48; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext3: + context._cmp(context.data.byte(139), 13); + if (!context.flags.z()) goto notmonktext4; + context.al = 22; + context.bl = 68; + context.bh = 38; + context.cx = 120; + goto gotmonktext; +notmonktext4: + context._cmp(context.data.byte(139), 17); + if (!context.flags.z()) goto notmonktext5; + context.al = 23; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext5: + context._cmp(context.data.byte(139), 21); + if (!context.flags.z()) goto notmonktext6; + context.al = 24; + context.bl = 68; + context.bh = 38; + context.cx = 120; + goto gotmonktext; +notmonktext6: + context._cmp(context.data.byte(139), 25); + if (!context.flags.z()) goto notmonktext7; + context.al = 25; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext7: + context._cmp(context.data.byte(139), 29); + if (!context.flags.z()) goto notmonktext8; + context.al = 26; + context.bl = 68; + context.bh = 38; + context.cx = 120; + goto gotmonktext; +notmonktext8: + context._cmp(context.data.byte(139), 33); + if (!context.flags.z()) goto notmonktext9; + context.al = 27; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext9: + context._cmp(context.data.byte(139), 37); + if (!context.flags.z()) goto notmonktext10; + context.al = 28; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext10: + context._cmp(context.data.byte(139), 41); + if (!context.flags.z()) goto notmonktext11; + context.al = 29; + context.bl = 68; + context.bh = 38; + context.cx = 120; + goto gotmonktext; +notmonktext11: + context._cmp(context.data.byte(139), 45); + if (!context.flags.z()) goto notmonktext12; + context.al = 30; + context.bl = 68; + context.bh = 154; + context.cx = 120; + goto gotmonktext; +notmonktext12: + context._cmp(context.data.byte(139), 49); + if (!context.flags.z()) goto notmonktext13; + context.al = 31; + context.bl = 68; + context.bh = 154; + context.cx = 220; + goto gotmonktext; +notmonktext13: + context._cmp(context.data.byte(139), 53); + if (!context.flags.z()) goto notendtitles; + fadescreendowns(context); +notendtitles: + return; +gotmonktext: + context.dx = 1; + context.ah = 82; +oktalk: + setuptimedtemp(context); + return; +} + +static inline void drunk(Context & context) { + context._cmp(context.data.byte(42), 0); + if (!context.flags.z()) goto trampgone; + context.al = context.data.byte(context.bx+7); + context._and(context.al, 127); + context.data.byte(context.bx+7) = context.al; + showgamereel(context); + addtopeoplelist(context); +trampgone: + return; +} + +static inline void advisor(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto noadvisor; + goto noadvisor; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 123); + if (!context.flags.z()) goto notendadvis; + context.ax = 106; + goto gotadvframe; +notendadvis: + context._cmp(context.ax, 108); + if (!context.flags.z()) goto gotadvframe; + context.push(context.ax); + randomnumber(context); + context.cl = context.al; + context.ax = context.pop(); + context._cmp(context.cl, 3); + if (context.flags.c()) goto gotadvframe; + context.ax = 106; +gotadvframe: + context.data.word(context.bx+3) = context.ax; +noadvisor: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void copper(Context & context) { + checkspeed(context); + if (!context.flags.z()) goto nocopper; + context.ax = context.data.word(context.bx+3); + context._add(context.ax, 1); + context._cmp(context.ax, 94); + if (!context.flags.z()) goto notendcopper; + context.ax = 64; + goto gotcopframe; +notendcopper: + context._cmp(context.ax, 81); + if (context.flags.z()) goto mightwait; + context._cmp(context.ax, 66); + if (!context.flags.z()) goto gotcopframe; +mightwait: + context.push(context.ax); + randomnumber(context); + context.cl = context.al; + context.ax = context.pop(); + context._cmp(context.cl, 7); + if (context.flags.c()) goto gotcopframe; + context._sub(context.ax, 1); +gotcopframe: + context.data.word(context.bx+3) = context.ax; +nocopper: + showgamereel(context); + addtopeoplelist(context); + return; +} + +static inline void sparky(Context & context) { + context._cmp(context.data.word(16), 0); + if (context.flags.z()) goto animsparky; + context.data.byte(context.bx+7) = 3; + goto animsparky; +animsparky: + checkspeed(context); + if (!context.flags.z()) goto finishsparky; + context._cmp(context.data.word(context.bx+3), 34); + if (!context.flags.z()) goto notsparky1; + randomnumber(context); + context._cmp(context.al, 30); + if (context.flags.c()) goto dosparky; + context.data.word(context.bx+3) = 27; + goto finishsparky; +notsparky1: + context._cmp(context.data.word(context.bx+3), 48); + if (!context.flags.z()) goto dosparky; + context.data.word(context.bx+3) = 27; + goto finishsparky; +dosparky: + context._add(context.data.word(context.bx+3), 1); +finishsparky: + showgamereel(context); + addtopeoplelist(context); + context.al = context.data.byte(context.bx+7); + context._and(context.al, 128); + if (context.flags.z()) goto nottalkedsparky; + context.data.byte(49) = 1; +nottalkedsparky: + return; +} + +static inline void train(Context & context) { + return; + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 21); + if (!context.flags.c()) goto notrainyet; + context._add(context.ax, 1); + goto gottrainframe; +notrainyet: + randomnumber(context); + context._cmp(context.al, 253); + if (context.flags.c()) goto notrainatall; + context._cmp(context.data.byte(475), 5); + if (!context.flags.z()) goto notrainatall; + context._cmp(context.data.byte(477), 5); + if (!context.flags.z()) goto notrainatall; + context.ax = 5; +gottrainframe: + context.data.word(context.bx+3) = context.ax; + showgamereel(context); +notrainatall: + return; +} + +static inline void addtopeoplelist(Context & context) { + context.push(context.es); + context.push(context.bx); + context.push(context.bx); + context.cl = context.data.byte(context.bx+7); + context.ax = context.data.word(context.bx+3); + context.bx = context.data.word(18); + context.es = context.data.word(412); + context.data.word(context.bx) = context.ax; + context.ax = context.pop(); + context.data.word(context.bx+2) = context.ax; + context.data.byte(context.bx+4) = context.cl; + context.bx = context.pop(); + context.es = context.pop(); + context._add(context.data.word(18), 5); + return; +} + +static inline void showgamereel(Context & context) { + context.ax = context.data.word(context.bx+3); + context._cmp(context.ax, 512); + if (!context.flags.c()) goto noshow; + context.data.word(239) = context.ax; + context.push(context.es); + context.push(context.bx); + plotreel(context); + context.bx = context.pop(); + context.es = context.pop(); + context.ax = context.data.word(239); + context.data.word(context.bx+3) = context.ax; +noshow: + return; +} + +static inline void checkspeed(Context & context) { + context._cmp(context.data.byte(65), -1); + if (!context.flags.z()) goto forcenext; + context._add(context.data.byte(context.bx+6), 1); + context.al = context.data.byte(context.bx+6); + context._cmp(context.al, context.data.byte(context.bx+5)); + if (!context.flags.z()) goto notspeed; + context.al = 0; + context.data.byte(context.bx+6) = context.al; + context._cmp(context.al, context.al); +notspeed: + return; +forcenext: + context._cmp(context.al, context.al); + return; +} + +static inline void delsprite(Context & context) { + context.di = context.bx; + context.cx = 32; + context.al = 255; + while(--context.cx) context._stosb(); + return; +} + +static inline void mainman(Context & context) { + context._cmp(context.data.byte(187), 1); + if (!context.flags.z()) goto notinnewroom; + context.data.byte(187) = 0; + context.al = context.data.byte(151); + context.ah = context.data.byte(152); + context.data.word(context.bx+10) = context.ax; + context.data.byte(context.bx+29) = 0; + goto executewalk; +notinnewroom: + context._sub(context.data.byte(context.bx+22), 1); + context._cmp(context.data.byte(context.bx+22), -1); + if (context.flags.z()) goto executewalk; + return; +executewalk: + context.data.byte(context.bx+22) = 0; + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); + if (context.flags.z()) goto facingok; + aboutturn(context); + goto notwalk; +facingok: + context._cmp(context.data.byte(136), 0); + if (context.flags.z()) goto alreadyturned; + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto alreadyturned; + context.data.byte(473) = 1; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(134)); + if (!context.flags.z()) goto alreadyturned; + checkforexit(context); +alreadyturned: + context.data.byte(136) = 0; + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto walkman; + context.data.byte(context.bx+29) = 0; + goto notwalk; +walkman: + context.al = context.data.byte(context.bx+29); + context._add(context.al, 1); + context._cmp(context.al, 11); + if (!context.flags.z()) goto notanimend1; + context.al = 1; +notanimend1: + context.data.byte(context.bx+29) = context.al; + walking(context); + context._cmp(context.data.byte(492), 254); + if (context.flags.z()) goto afterwalk; + context.al = context.data.byte(133); + context._and(context.al, 1); + if (context.flags.z()) goto isdouble; + context.al = context.data.byte(context.bx+29); + context._cmp(context.al, 2); + if (context.flags.z()) goto afterwalk; + context._cmp(context.al, 7); + if (context.flags.z()) goto afterwalk; +isdouble: + walking(context); +afterwalk: + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto notwalk; + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); + if (!context.flags.z()) goto notwalk; + context.data.byte(473) = 1; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(134)); + if (!context.flags.z()) goto notwalk; + checkforexit(context); +notwalk: + context.al = context.data.byte(133); + context.ah = 0; + context.di = 1105; + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + context._add(context.al, context.data.byte(context.bx+29)); + context.data.byte(context.bx+15) = context.al; + context.ax = context.data.word(context.bx+10); + context.data.byte(151) = context.al; + context.data.byte(152) = context.ah; + return; +} + +static inline void aboutturn(Context & context) { + context._cmp(context.data.byte(136), 1); + if (context.flags.z()) goto incdir; + context._cmp(context.data.byte(136), -1); + if (context.flags.z()) goto decdir; + context.al = context.data.byte(133); + context._sub(context.al, context.data.byte(135)); + if (!context.flags.c()) goto higher; + context._neg(context.al); + context._cmp(context.al, 4); + if (!context.flags.c()) goto decdir; + goto incdir; +higher: + context._cmp(context.al, 4); + if (!context.flags.c()) goto incdir; + goto decdir; +incdir: + context.data.byte(136) = 1; + context.al = context.data.byte(133); + context._add(context.al, 1); + context._and(context.al, 7); + context.data.byte(133) = context.al; + context.data.byte(context.bx+29) = 0; + return; +decdir: + context.data.byte(136) = -1; + context.al = context.data.byte(133); + context._sub(context.al, 1); + context._and(context.al, 7); + context.data.byte(133) = context.al; + context.data.byte(context.bx+29) = 0; + return; +} + +static inline void walking(Context & context) { + context._cmp(context.data.byte(493), 0); + if (context.flags.z()) goto normalwalk; + context.al = context.data.byte(492); + context._sub(context.al, 1); + context.data.byte(492) = context.al; + context._cmp(context.al, 200); + if (!context.flags.c()) goto endofline; + goto continuewalk; +normalwalk: + context.al = context.data.byte(492); + context._add(context.al, 1); + context.data.byte(492) = context.al; + context._cmp(context.al, context.data.byte(494)); + if (!context.flags.c()) goto endofline; +continuewalk: + context.ah = 0; + context._add(context.ax, context.ax); + context.push(context.es); + context.push(context.bx); + context.dx = context.ds; + context.es = context.dx; + context.bx = 8344; + context._add(context.bx, context.ax); + context.ax = context.data.word(context.bx); + context.bx = context.pop(); + context.es = context.pop(); +stillline: + context.data.word(context.bx+10) = context.ax; + return; +endofline: + context.data.byte(492) = 254; + context.al = context.data.byte(478); + context.data.byte(475) = context.al; + context._cmp(context.al, context.data.byte(477)); + if (context.flags.z()) goto finishedwalk; + context.al = context.data.byte(477); + context.data.byte(478) = context.al; + context.push(context.es); + context.push(context.bx); + autosetwalk(context); + context.bx = context.pop(); + context.es = context.pop(); + return; +finishedwalk: + facerightway(context); + return; +} + +static inline void checkforexit(Context & context) { + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context.data.byte(153) = context.cl; + context.data.byte(154) = context.ch; + context.data.byte(155) = context.dl; + context.data.byte(156) = context.dh; + context.al = context.data.byte(153); + context._test(context.al, 64); + if (context.flags.z()) goto notnewdirect; + context.al = context.data.byte(154); + context.data.byte(189) = context.al; + return; +notnewdirect: + context._test(context.al, 32); + if (context.flags.z()) goto notleave; + context.push(context.es); + context.push(context.bx); + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notlouis; + context.bl = 0; + context.push(context.bx); + context.al = 'W'; + context.ah = 'E'; + context.cl = 'T'; + context.ch = 'A'; + isryanholding(context); + context.bx = context.pop(); + if (context.flags.z()) goto noshoe1; + context._add(context.bl, 1); +noshoe1: + context.push(context.bx); + context.al = 'W'; + context.ah = 'E'; + context.cl = 'T'; + context.ch = 'B'; + isryanholding(context); + context.bx = context.pop(); + if (context.flags.z()) goto noshoe2; + context._add(context.bl, 1); +noshoe2: + context._cmp(context.bl, 2); + if (context.flags.z()) goto notlouis; + context.al = 42; + context._cmp(context.bl, 0); + if (context.flags.z()) goto notravmessage; + context._add(context.al, 1); +notravmessage: + context.cx = 80; + context.dx = 10; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + context.al = context.data.byte(133); + context._add(context.al, 4); + context._and(context.al, 7); + context.data.byte(135) = context.al; + context.bx = context.pop(); + context.es = context.pop(); + return; +notlouis: + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(60) = 1; + return; +notleave: + context._test(context.al, 4); + if (context.flags.z()) goto notaleft; + adjustleft(context); + return; +notaleft: + context._test(context.al, 2); + if (context.flags.z()) goto notaright; + adjustright(context); + return; +notaright: + context._test(context.al, 8); + if (context.flags.z()) goto notadown; + adjustdown(context); + return; +notadown: + context._test(context.al, 16); + if (context.flags.z()) goto notanup; + adjustup(context); + return; +notanup: + return; +} + +static inline void adjustdown(Context & context) { + context.push(context.es); + context.push(context.bx); + context._add(context.data.byte(149), 10); + context.al = context.data.byte(154); + context.cl = 16; + context._mul(context.cl); + context.data.byte(context.bx+11) = context.al; + context.data.byte(186) = 1; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void adjustup(Context & context) { + context.push(context.es); + context.push(context.bx); + context._sub(context.data.byte(149), 10); + context.al = context.data.byte(154); + context.cl = 16; + context._mul(context.cl); + context.data.byte(context.bx+11) = context.al; + context.data.byte(186) = 1; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void adjustleft(Context & context) { + context.push(context.es); + context.push(context.bx); + context.data.byte(153) = 0; + context._sub(context.data.byte(148), 11); + context.al = context.data.byte(154); + context.cl = 16; + context._mul(context.cl); + context.data.byte(context.bx+10) = context.al; + context.data.byte(186) = 1; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void adjustright(Context & context) { + context.push(context.es); + context.push(context.bx); + context._add(context.data.byte(148), 11); + context.al = context.data.byte(154); + context.cl = 16; + context._mul(context.cl); + context._sub(context.al, 2); + context.data.byte(context.bx+10) = context.al; + context.data.byte(186) = 1; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void backobject(Context & context) { + context.ds = context.data.word(428); + context.di = context.data.word(context.bx+20); + context.al = context.data.byte(context.bx+18); + context._cmp(context.al, 0); + if (context.flags.z()) goto _tmp48z; + context._sub(context.al, 1); + context.data.byte(context.bx+18) = context.al; + goto finishback; +_tmp48z: + context.al = context.data.byte(context.di+7); + context.data.byte(context.bx+18) = context.al; + context.al = context.data.byte(context.di+8); + context._cmp(context.al, 6); + if (!context.flags.z()) goto notwidedoor; + widedoor(context); + goto finishback; +notwidedoor: + context._cmp(context.al, 5); + if (!context.flags.z()) goto notrandom; + random(context); + goto finishback; +notrandom: + context._cmp(context.al, 4); + if (!context.flags.z()) goto notlockdoor; + lockeddoorway(context); + goto finishback; +notlockdoor: + context._cmp(context.al, 3); + if (!context.flags.z()) goto notlift; + liftsprite(context); + goto finishback; +notlift: + context._cmp(context.al, 2); + if (!context.flags.z()) goto notdoor; + doorway(context); + goto finishback; +notdoor: + context._cmp(context.al, 1); + if (!context.flags.z()) goto steadyob; + constant(context); + goto finishback; +steadyob: + steady(context); +finishback: + return; +} + +static inline void liftsprite(Context & context) { + context.al = context.data.byte(35); + context._cmp(context.al, 0); + if (context.flags.z()) goto liftclosed; + context._cmp(context.al, 1); + if (context.flags.z()) goto liftopen; + context._cmp(context.al, 3); + if (context.flags.z()) goto openlift; + context.al = context.data.byte(context.bx+19); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishclose; + context._sub(context.al, 1); + context._cmp(context.al, 11); + if (!context.flags.z()) goto pokelift; + context.push(context.ax); + context.al = 3; + liftnoise(context); + context.ax = context.pop(); + goto pokelift; +finishclose: + context.data.byte(35) = 0; + return; +openlift: + context.al = context.data.byte(context.bx+19); + context._cmp(context.al, 12); + if (context.flags.z()) goto endoflist; + context._add(context.al, 1); + context._cmp(context.al, 1); + if (!context.flags.z()) goto pokelift; + context.push(context.ax); + context.al = 2; + liftnoise(context); + context.ax = context.pop(); +pokelift: + context.data.byte(context.bx+19) = context.al; + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + return; +endoflist: + context.data.byte(35) = 1; + return; +liftopen: + context.al = context.data.byte(36); + context.push(context.es); + context.push(context.bx); + turnpathon(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(40), 0); + if (context.flags.z()) goto nocountclose; + context._sub(context.data.byte(40), 1); + context._cmp(context.data.byte(40), 0); + if (!context.flags.z()) goto nocountclose; + context.data.byte(35) = 2; +nocountclose: + context.al = 12; + goto pokelift; +liftclosed: + context.al = context.data.byte(36); + context.push(context.es); + context.push(context.bx); + turnpathoff(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(39), 0); + if (context.flags.z()) goto nocountopen; + context._sub(context.data.byte(39), 1); + context._cmp(context.data.byte(39), 0); + if (!context.flags.z()) goto nocountopen; + context.data.byte(35) = 3; +nocountopen: + context.al = 0; + goto pokelift; +} + +static inline void liftnoise(Context & context) { + context._cmp(context.data.byte(184), 5); + if (context.flags.z()) goto hissnoise; + context._cmp(context.data.byte(184), 21); + if (context.flags.z()) goto hissnoise; + playchannel1(context); + return; +hissnoise: + context.al = 13; + playchannel1(context); + return; +} + +static inline void random(Context & context) { + randomnum1(context); + context.push(context.di); + context._and(context.ax, 7); + context._add(context.di, 18); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + return; +} + +static inline void steady(Context & context) { + context.al = context.data.byte(context.di+18); + context.data.byte(context.di+17) = context.al; + context.data.byte(context.bx+15) = context.al; + return; +} + +static inline void constant(Context & context) { + context._add(context.data.byte(context.bx+19), 1); + context.cl = context.data.byte(context.bx+19); + context.ch = 0; + context._add(context.di, context.cx); + context._cmp(context.data.byte(context.di+18), 255); + if (!context.flags.z()) goto gotconst; + context._sub(context.di, context.cx); + context.cx = 0; + context.data.byte(context.bx+19) = context.cl; +gotconst: + context.al = context.data.byte(context.di+18); + context._sub(context.di, context.cx); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + return; +} + +static inline void doorway(Context & context) { + context.data.byte(193) = -24; + context.data.byte(194) = 10; + context.data.byte(195) = -30; + context.data.byte(196) = 10; + dodoor(context); + return; +} + +static inline void widedoor(Context & context) { + context.data.byte(193) = -24; + context.data.byte(194) = 24; + context.data.byte(195) = -30; + context.data.byte(196) = 24; + dodoor(context); + return; +} + +static inline void dodoor(Context & context) { + context.al = context.data.byte(151); + context.ah = context.data.byte(152); + context.cl = context.data.byte(context.bx+10); + context.ch = context.data.byte(context.bx+11); + context._cmp(context.al, context.cl); + if (!context.flags.c()) goto rtofdoor; + context._sub(context.al, context.cl); + context._cmp(context.al, context.data.byte(193)); + if (!context.flags.c()) goto upordown; + goto shutdoor; +rtofdoor: + context._sub(context.al, context.cl); + context._cmp(context.al, context.data.byte(194)); + if (!context.flags.c()) goto shutdoor; +upordown: + context._cmp(context.ah, context.ch); + if (!context.flags.c()) goto botofdoor; + context._sub(context.ah, context.ch); + context._cmp(context.ah, context.data.byte(195)); + if (context.flags.c()) goto shutdoor; + goto opendoor; +botofdoor: + context._sub(context.ah, context.ch); + context._cmp(context.ah, context.data.byte(196)); + if (!context.flags.c()) goto shutdoor; +opendoor: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.data.byte(61), 1); + if (!context.flags.z()) goto notthrough; + context._cmp(context.cl, 0); + if (!context.flags.z()) goto notthrough; + context.cl = 6; +notthrough: + context._add(context.cl, 1); + context._cmp(context.cl, 1); + if (!context.flags.z()) goto notdoorsound2; + context.al = 0; + context._cmp(context.data.byte(184), 5); + if (!context.flags.z()) goto nothoteldoor2; + context.al = 13; +nothoteldoor2: + playchannel1(context); +notdoorsound2: + context.ch = 0; + context.push(context.di); + context._add(context.di, context.cx); + context.al = context.data.byte(context.di+18); + context._cmp(context.al, 255); + if (!context.flags.z()) goto atlast1; + context._sub(context.di, 1); + context._sub(context.cl, 1); +atlast1: + context.data.byte(context.bx+19) = context.cl; + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + context.data.byte(61) = 1; + return; +shutdoor: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.cl, 5); + if (!context.flags.z()) goto notdoorsound1; + context.al = 1; + context._cmp(context.data.byte(184), 5); + if (!context.flags.z()) goto nothoteldoor1; + context.al = 13; +nothoteldoor1: + playchannel1(context); +notdoorsound1: + context._cmp(context.cl, 0); + if (context.flags.z()) goto atlast2; + context._sub(context.cl, 1); + context.data.byte(context.bx+19) = context.cl; +atlast2: + context.ch = 0; + context.push(context.di); + context._add(context.di, context.cx); + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + context._cmp(context.cl, 5); + if (!context.flags.z()) goto notnearly; + context.data.byte(61) = 0; +notnearly: + return; +} + +static inline void lockeddoorway(Context & context) { + context.al = context.data.byte(151); + context.ah = context.data.byte(152); + context.cl = context.data.byte(context.bx+10); + context.ch = context.data.byte(context.bx+11); + context._cmp(context.al, context.cl); + if (!context.flags.c()) goto rtofdoor2; + context._sub(context.al, context.cl); + context._cmp(context.al, -24); + if (!context.flags.c()) goto upordown2; + goto shutdoor2; +rtofdoor2: + context._sub(context.al, context.cl); + context._cmp(context.al, 10); + if (!context.flags.c()) goto shutdoor2; +upordown2: + context._cmp(context.ah, context.ch); + if (!context.flags.c()) goto botofdoor2; + context._sub(context.ah, context.ch); + context._cmp(context.ah, -30); + if (context.flags.c()) goto shutdoor2; + goto opendoor2; +botofdoor2: + context._sub(context.ah, context.ch); + context._cmp(context.ah, 12); + if (!context.flags.c()) goto shutdoor2; +opendoor2: + context._cmp(context.data.byte(61), 1); + if (context.flags.z()) goto mustbeopen; + context._cmp(context.data.byte(37), 1); + if (context.flags.z()) goto shutdoor; +mustbeopen: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.cl, 1); + if (!context.flags.z()) goto notdoorsound4; + context.al = 0; + playchannel1(context); +notdoorsound4: + context._cmp(context.cl, 6); + if (!context.flags.z()) goto noturnonyet; + context.al = context.data.byte(38); + context.push(context.es); + context.push(context.bx); + turnpathon(context); + context.bx = context.pop(); + context.es = context.pop(); +noturnonyet: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.data.byte(61), 1); + if (!context.flags.z()) goto notthrough2; + context._cmp(context.cl, 0); + if (!context.flags.z()) goto notthrough2; + context.cl = 6; +notthrough2: + context._add(context.cl, 1); + context.ch = 0; + context.push(context.di); + context._add(context.di, context.cx); + context.al = context.data.byte(context.di+18); + context._cmp(context.al, 255); + if (!context.flags.z()) goto atlast3; + context._sub(context.di, 1); + context._sub(context.cl, 1); +atlast3: + context.data.byte(context.bx+19) = context.cl; + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + context._cmp(context.cl, 5); + if (!context.flags.z()) goto justshutting; + context.data.byte(61) = 1; +justshutting: + return; +shutdoor2: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.cl, 5); + if (!context.flags.z()) goto notdoorsound3; + context.al = 1; + playchannel1(context); +notdoorsound3: + context._cmp(context.cl, 0); + if (context.flags.z()) goto atlast4; + context._sub(context.cl, 1); + context.data.byte(context.bx+19) = context.cl; +atlast4: + context.ch = 0; + context.data.byte(61) = 0; + context.push(context.di); + context._add(context.di, context.cx); + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + context._cmp(context.cl, 0); + if (!context.flags.z()) goto notlocky; + context.al = context.data.byte(38); + context.push(context.es); + context.push(context.bx); + turnpathoff(context); + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(37) = 1; +notlocky: + return; +/*continuing to unbounded code: shutdoor from dodoor:60-87*/ +shutdoor: + context.cl = context.data.byte(context.bx+19); + context._cmp(context.cl, 5); + if (!context.flags.z()) goto notdoorsound1; + context.al = 1; + context._cmp(context.data.byte(184), 5); + if (!context.flags.z()) goto nothoteldoor1; + context.al = 13; +nothoteldoor1: + playchannel1(context); +notdoorsound1: + context._cmp(context.cl, 0); + if (context.flags.z()) goto atlast2; + context._sub(context.cl, 1); + context.data.byte(context.bx+19) = context.cl; +atlast2: + context.ch = 0; + context.push(context.di); + context._add(context.di, context.cx); + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + context._cmp(context.cl, 5); + if (!context.flags.z()) goto notnearly; + context.data.byte(61) = 0; +notnearly: + return; + return; +} + +static inline void getreelframeax(Context & context) { + context.push(context.ds); + context.data.word(160) = context.ax; + findsource(context); + context.es = context.ds; + context.ds = context.pop(); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context._add(context.ax, context.ax); + context.cx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.cx); + context.bx = context.ax; + return; +} + +static inline void dumpeverything(Context & context) { + context.es = context.data.word(412); + context.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); +dumpevery1: + context.ax = context.data.word(context.bx); + context.cx = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto finishevery1; + context._cmp(context.ax, context.data.word(context.bx+(40*5))); + if (!context.flags.z()) goto notskip1; + context._cmp(context.cx, context.data.word(context.bx+(40*5)+2)); + if (context.flags.z()) goto skip1; +notskip1: + context.push(context.bx); + context.push(context.es); + context.push(context.ds); + context.bl = context.ah; + context.bh = 0; + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + multidump(context); + context.ds = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); +skip1: + context._add(context.bx, 5); + goto dumpevery1; +finishevery1: + context.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)+(40*5); +dumpevery2: + context.ax = context.data.word(context.bx); + context.cx = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto finishevery2; + context.push(context.bx); + context.push(context.es); + context.push(context.ds); + context.bl = context.ah; + context.bh = 0; + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + multidump(context); + context.ds = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 5); + goto dumpevery2; +finishevery2: + return; +} + +static inline void readabyte(Context & context) { + context._cmp(context.si, 30000); + if (!context.flags.z()) goto notendblock; + context.push(context.bx); + context.push(context.es); + context.push(context.di); + context.push(context.ds); + context.push(context.si); + readoneblock(context); + context.si = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context.si = 0; +notendblock: + context._lodsb(); + return; +} + +static inline void printundermon(Context & context) { + context.si = (320*43)+76; + context.di = context.si; + context.es = context.data.word(400); + context._add(context.si, 8*320); + context.dx = 0x0a000; + context.ds = context.dx; + context.cx = 104; +scrollmonloop1: + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.cx = 170; +scrollmonloop2: + context._lodsb(); + context._cmp(context.al, 231); + if (!context.flags.c()) goto dontplace; +placeit: + context._stosb(); + if (--context.cx) goto scrollmonloop2; + goto finmonscroll; +dontplace: + context._add(context.di, 1); + if (--context.cx) goto scrollmonloop2; +finmonscroll: + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.si, 320); + context._add(context.di, 320); + if (--context.cx) goto scrollmonloop1; + return; +} + +static inline void pixelcheckset(Context & context) { + context.push(context.ax); + context._sub(context.al, context.data.byte(context.bx)); + context._sub(context.ah, context.data.byte(context.bx+1)); + context.push(context.es); + context.push(context.bx); + context.push(context.cx); + context.push(context.ax); + context.al = context.data.byte(context.bx+4); + getsetad(context); + context.al = context.data.byte(context.bx+17); + context.es = context.data.word(444); + context.bx = 0; + context.ah = 0; + context.cx = 6; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.ax = context.pop(); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context.cl = context.data.byte(context.bx); + context.ch = 0; + context._mul(context.cx); + context.cx = context.pop(); + context.ch = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.data.word(context.bx+2)); + context.bx = context.ax; + context._add(context.bx, 0+2080); + context.al = context.data.byte(context.bx); + context.dl = context.al; + context.cx = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.ax = context.pop(); + context._cmp(context.dl, 0); + return; +} + +static inline void delthisone(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, context.data.word(119)); + context.bx = 320; + context._mul(context.bx); + context.bx = context.pop(); + context.bh = 0; + context._add(context.bx, context.data.word(117)); + context._add(context.ax, context.bx); + context.di = context.ax; + context.ax = context.pop(); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context.bx = 22*8; + context._mul(context.bx); + context.bx = context.pop(); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = context.ax; + context.es = context.data.word(400); + context.ds = context.data.word(402); + context.dl = context.cl; + context.dh = 0; + context.ax = 320; + context._sub(context.ax, context.dx); + context._neg(context.dx); + context._add(context.dx, 22*8); +deloneloop: + context.push(context.cx); + context.ch = 0; + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context._add(context.di, context.ax); + context._add(context.si, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto deloneloop; + return; +} + +static inline void dofade(Context & context) { + context._cmp(context.data.byte(344), 0); + if (context.flags.z()) goto finishfade; + context.cl = context.data.byte(345); + context.ch = 0; + context.al = context.data.byte(343); + context.ah = 0; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context._add(context.si, context.ax); + context._add(context.si, context.ax); + context._add(context.si, context.ax); + showgroup(context); + context.al = context.data.byte(345); + context._add(context.al, context.data.byte(343)); + context.data.byte(343) = context.al; + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishfade; + fadecalculation(context); +finishfade: + return; +} + +static inline void fadetowhite(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; + context.al = 63; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.al = 0; + context._stosb(); + context._stosb(); + context._stosb(); + paltostartpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static inline void fadefromwhite(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768; + context.al = 63; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.al = 0; + context._stosb(); + context._stosb(); + context._stosb(); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static inline void fadescreendownhalf(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.cx = 768; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; +halfend: + context.al = context.data.byte(context.bx); + context._shr(context.al, 1); + context.data.byte(context.bx) = context.al; + context._add(context.bx, 1); + if (--context.cx) goto halfend; + context.ds = context.data.word(412); + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); + context.cx = 3*5; + while(--context.cx) context._movsb(); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(77*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); + context.cx = 3*2; + while(--context.cx) context._movsb(); + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; + return; +} + +static inline void fadescreenuphalf(Context & context) { + endpaltostart(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; + return; +} + +static inline void fadecalculation(Context & context) { + context._cmp(context.data.byte(346), 0); + if (context.flags.z()) goto nomorefading; + context.bl = context.data.byte(346); + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; +fadecolloop: + context.al = context.data.byte(context.si); + context.ah = context.data.byte(context.di); + context._cmp(context.al, context.ah); + if (context.flags.z()) goto gotthere; + if (context.flags.c()) goto lesscolour; + context._sub(context.data.byte(context.si), 1); + goto gotthere; +lesscolour: + context._cmp(context.bl, context.ah); + if (context.flags.z()) goto withit; + if (!context.flags.c()) goto gotthere; +withit: + context._add(context.data.byte(context.si), 1); +gotthere: + context._add(context.si, 1); + context._add(context.di, 1); + if (--context.cx) goto fadecolloop; + context._sub(context.data.byte(346), 1); + return; +nomorefading: + context.data.byte(344) = 0; + return; +} + +static inline void startpaltoend(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static inline void fadedownmon(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 64; + hangon(context); + return; +} + +static inline void fadeupmon(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 128; + hangon(context); + return; +} + +static inline void fadeupmonfirst(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 64; + hangon(context); + context.al = 26; + playchannel1(context); + context.cx = 64; + hangon(context); + return; +} + +static inline void fadeupyellows(Context & context) { + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 128; + hangon(context); + return; +} + +static inline void initialmoncols(Context & context) { + paltostartpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.cx = 3*9; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.al = 230; + context.cx = 18; + showgroup(context); + return; +} + +static inline void monprint(Context & context) { + context.data.byte(72) = 1; + context.si = context.bx; + context.dl = 166; + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); +printloop8: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloop7: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishmon2; + context._cmp(context.al, 0); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, 34); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, '='); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, '%'); + if (!context.flags.z()) goto nottrigger; + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._add(context.si, 1); + goto finishmon; +nottrigger: + context.push(context.cx); + context.push(context.es); + modifychar(context); + printchar(context); + context.data.word(312) = context.di; + context.data.word(314) = context.bx; + context.data.word(138) = 1; + printcurs(context); + vsync(context); + context.push(context.si); + context.push(context.dx); + context.push(context.ds); + context.push(context.es); + context.push(context.bx); + context.push(context.di); + lockmon(context); + context.di = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.dx = context.pop(); + context.si = context.pop(); + delcurs(context); + context.es = context.pop(); + context.cx = context.pop(); + if (--context.cx) goto printloop7; +finishmon2: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + scrollmonitor(context); + context.data.word(312) = context.di; + goto printloop8; +finishmon: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._cmp(context.al, '%'); + if (!context.flags.z()) goto nottrigger2; + context.data.byte(55) = context.ah; +nottrigger2: + context.data.word(312) = context.di; + scrollmonitor(context); + context.bx = context.si; + context.data.byte(72) = 0; + return; +} + +static inline void fillryan(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32; + findallryan(context); + context.si = 0+(228*13)+32; + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 20; + context._mul(context.cx); + context._add(context.si, context.ax); + context.di = 80; + context.bx = 58; + context.cx = 2; +ryanloop2: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.cx = 5; +ryanloop1: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.ax = context.data.word(context.si); + context._add(context.si, 2); + context.push(context.si); + context.push(context.es); + obtoinv(context); + context.es = context.pop(); + context.si = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 44); + if (--context.cx) goto ryanloop1; + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 44); + if (--context.cx) goto ryanloop2; + showryanpage(context); + return; +} + +static inline void fillopen(Context & context) { + deltextline(context); + getopenedsize(context); + context._cmp(context.ah, 4); + if (context.flags.c()) goto lessthanapage; + context.ah = 4; +lessthanapage: + context.al = 1; + context.push(context.ax); + context.es = context.data.word(412); + context.di = 0+(228*13); + findallopen(context); + context.si = 0+(228*13); + context.di = 80; + context.bx = 58+96; + context.cx = context.pop(); +openloop1: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.ax = context.data.word(context.si); + context._add(context.si, 2); + context.push(context.si); + context.push(context.es); + context._cmp(context.ch, context.cl); + if (context.flags.c()) goto nextopenslot; + obtoinv(context); +nextopenslot: + context.es = context.pop(); + context.si = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 44); + context._add(context.cl, 1); + context._cmp(context.cl, 5); + if (!context.flags.z()) goto openloop1; + undertextline(context); + return; +} + +static inline void findallryan(Context & context) { + context.push(context.di); + context.cx = 30; + context.ax = 0x0ffff; + while(--context.cx) context._stosw(); + context.di = context.pop(); + context.cl = 4; + context.ds = context.data.word(398); + context.bx = 0+2080+30000; + context.ch = 0; +findryanloop: + context._cmp(context.data.byte(context.bx+2), context.cl); + if (!context.flags.z()) goto notinryaninv; + context._cmp(context.data.byte(context.bx+3), 255); + if (!context.flags.z()) goto notinryaninv; + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 4; + context._stosw(); + context.di = context.pop(); +notinryaninv: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 114); + if (!context.flags.z()) goto findryanloop; + return; +} + +static inline void findallopen(Context & context) { + context.push(context.di); + context.cx = 16; + context.ax = 0x0ffff; + while(--context.cx) context._stosw(); + context.di = context.pop(); + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); + context.ds = context.data.word(398); + context.bx = 0+2080+30000; + context.ch = 0; +findopen1: + context._cmp(context.data.byte(context.bx+3), context.cl); + if (!context.flags.z()) goto findopen2; + context._cmp(context.data.byte(context.bx+2), context.dl); + if (!context.flags.z()) goto findopen2; + context._cmp(context.data.byte(111), 4); + if (context.flags.z()) goto noloccheck; + context.al = context.data.byte(context.bx+5); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto findopen2; +noloccheck: + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 4; + context._stosw(); + context.di = context.pop(); +findopen2: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 114); + if (!context.flags.z()) goto findopen1; + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); + context.push(context.dx); + context.ds = context.data.word(426); + context.dx = context.pop(); + context.bx = 0; + context.ch = 0; +findopen1a: + context._cmp(context.data.byte(context.bx+3), context.cl); + if (!context.flags.z()) goto findopen2a; + context._cmp(context.data.byte(context.bx+2), context.dl); + if (!context.flags.z()) goto findopen2a; + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 2; + context._stosw(); + context.di = context.pop(); +findopen2a: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 80); + if (!context.flags.z()) goto findopen1a; + return; +} + +static inline void obtoinv(Context & context) { + context.push(context.bx); + context.push(context.es); + context.push(context.si); + context.push(context.ax); + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.ds = context.data.word(408); + context._sub(context.di, 2); + context._sub(context.bx, 1); + context.al = 10; + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto finishfill; + context.push(context.bx); + context.push(context.di); + context.push(context.ax); + context.ds = context.data.word(398); + context._cmp(context.ah, 4); + if (context.flags.z()) goto isanextra; + context.ds = context.data.word(446); +isanextra: + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + context._add(context.bx, 19); + context._add(context.di, 18); + showframe(context); + context.ax = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.push(context.bx); + getanyaddir(context); + isitworn(context); + context.bx = context.pop(); + if (!context.flags.z()) goto finishfill; + context.ds = context.data.word(408); + context._sub(context.di, 3); + context._sub(context.bx, 2); + context.al = 7; + context.ah = 0; + showframe(context); +finishfill: + context.ax = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + return; +} + +static inline void isitworn(Context & context) { + context.al = context.data.byte(context.bx+12); + context._cmp(context.al, 'W'-'A'); + if (!context.flags.z()) goto notworn; + context.al = context.data.byte(context.bx+13); + context._cmp(context.al, 'E'-'A'); +notworn: + return; +} + +static inline void makeworn(Context & context) { + context.data.byte(context.bx+12) = 'W'-'A'; + context.data.byte(context.bx+13) = 'E'-'A'; + return; +} + +static inline void getbackfromob(Context & context) { + context._cmp(context.data.byte(106), 1); + if (!context.flags.z()) goto notheldob; + blank(context); + return; +notheldob: + getback1(context); + return; +} + +static inline void incryanpage(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyincryan; + context.data.byte(100) = 222; + context.al = 31; + commandonly(context); +alreadyincryan: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noincryan; + context._and(context.ax, 1); + if (!context.flags.z()) goto doincryan; +noincryan: + return; +doincryan: + context.ax = context.data.word(198); + context._sub(context.ax, 80+167); + context.data.byte(19) = -1; +findnewpage: + context._add(context.data.byte(19), 1); + context._sub(context.ax, 18); + if (!context.flags.c()) goto findnewpage; + delpointer(context); + fillryan(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void openinv(Context & context) { + context.data.byte(104) = 1; + context.al = 61; + context.di = 80; + context.bx = 58-10; + context.dl = 240; + printmessage(context); + fillryan(context); + context.data.byte(100) = 255; + return; +} + +static inline void showryanpage(Context & context) { + context.ds = context.data.word(408); + context.di = 80+167; + context.bx = 58-12; + context.al = 12; + context.ah = 0; + showframe(context); + context.al = 13; + context._add(context.al, context.data.byte(19)); + context.push(context.ax); + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 18; + context._mul(context.cx); + context.ds = context.data.word(408); + context.di = 80+167; + context._add(context.di, context.ax); + context.bx = 58-12; + context.ax = context.pop(); + context.ah = 0; + showframe(context); + return; +} + +static inline void openob(Context & context) { + context.al = context.data.byte(110); + context.ah = context.data.byte(111); + context.di = 5674; + copyname(context); + context.di = 80; + context.bx = 58+86; + context.al = 62; + context.dl = 240; + printmessage(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 58+86; + context.es = context.cs; + context.si = 5674; + context.dl = 220; + context.al = 0; + context.ah = 0; + printdirect(context); + fillopen(context); + getopenedsize(context); + context.al = context.ah; + context.ah = 0; + context.cx = 44; + context._mul(context.cx); + context._add(context.ax, 80); + context.bx = 2588; + context.data.word(context.bx) = context.ax; + return; +} + +static inline void examicon(Context & context) { + context.ds = context.data.word(410); + context.di = 254; + context.bx = 5; + context.al = 3; + context.ah = 0; + showframe(context); + return; +} + +static inline void inventory(Context & context) { + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto iswatchinv; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatchinv; +iswatchinv: + blank(context); + return; +notwatchinv: + context._cmp(context.data.byte(100), 239); + if (context.flags.z()) goto alreadyopinv; + context.data.byte(100) = 239; + context.al = 32; + commandonly(context); +alreadyopinv: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantopinv; + context._and(context.ax, 1); + if (!context.flags.z()) goto doopeninv; +cantopinv: + return; +doopeninv: + context.data.word(328) = 0; + context.data.byte(234) = 0; + context.data.byte(237) = 0; + animpointer(context); + createpanel(context); + showpanel(context); + examicon(context); + showman(context); + showexit(context); + undertextline(context); + context.data.byte(106) = 0; + context.data.byte(104) = 2; + openinv(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(110) = 255; + goto waitexam; +/*continuing to unbounded code: examineagain from examineob:3-62*/ +examineagain: + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +waitexam: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.data.byte(103) = 0; + context.bx = 2494; + context._cmp(context.data.byte(104), 0); + if (context.flags.z()) goto notuseinv; + context.bx = 2556; + context._cmp(context.data.byte(104), 1); + if (context.flags.z()) goto notuseinv; + context.bx = 2618; +notuseinv: + checkcoords(context); + context._cmp(context.data.byte(108), 0); + if (context.flags.z()) goto norex; + goto examineagain; +norex: + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitexam; + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatching; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto justgetback; +iswatching: + makemainscreen(context); + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; +justgetback: + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; + return; +} + +static inline void setpickup(Context & context) { + context._cmp(context.data.byte(102), 1); + if (context.flags.z()) goto cantpick; + context._cmp(context.data.byte(102), 3); + if (context.flags.z()) goto cantpick; + getanyad(context); + context.al = context.data.byte(context.bx+2); + context._cmp(context.al, 4); + if (!context.flags.z()) goto canpick; +cantpick: + blank(context); + return; +canpick: + context._cmp(context.data.byte(100), 209); + if (context.flags.z()) goto alreadysp; + context.data.byte(100) = 209; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 33; + commandwithob(context); +alreadysp: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto nosetpick; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto dosetpick; +nosetpick: + return; +dosetpick: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + examicon(context); + context.data.byte(106) = 1; + context.data.byte(104) = 2; + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto pickupexob; + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + openinv(context); + worktoscreenm(context); + return; +pickupexob: + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; + openinv(context); + worktoscreenm(context); + return; +} + +static inline void examinventory(Context & context) { + context._cmp(context.data.byte(100), 249); + if (context.flags.z()) goto alreadyexinv; + context.data.byte(100) = 249; + context.al = 32; + commandonly(context); +alreadyexinv: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (!context.flags.z()) goto doexinv; + return; +doexinv: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + examicon(context); + context.data.byte(106) = 0; + context.data.byte(104) = 2; + openinv(context); + worktoscreenm(context); + return; +} + +static inline void reexfrominv(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; + return; +} + +static inline void reexfromopen(Context & context) { + return; + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; + return; +} + +static inline void swapwithinv(Context & context) { + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub7; + context._cmp(context.data.byte(100), 243); + if (context.flags.z()) goto alreadyswap1; + context.data.byte(100) = 243; +difsub7: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 34; + commandwithob(context); +alreadyswap1: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantswap1; + context._and(context.ax, 1); + if (!context.flags.z()) goto doswap1; +cantswap1: + return; +doswap1: + context.ah = context.data.byte(102); + context.al = context.data.byte(89); + context.push(context.ax); + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.push(context.bx); + findinvpos(context); + delpointer(context); + context.al = context.data.byte(89); + geteitherad(context); + context.data.byte(context.bx+2) = 4; + context.data.byte(context.bx+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + fillryan(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void swapwithopen(Context & context) { + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub8; + context._cmp(context.data.byte(100), 242); + if (context.flags.z()) goto alreadyswap2; + context.data.byte(100) = 242; +difsub8: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 34; + commandwithob(context); +alreadyswap2: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantswap2; + context._and(context.ax, 1); + if (!context.flags.z()) goto doswap2; +cantswap2: + return; +doswap2: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto notwornswap; + wornerror(context); + return; +notwornswap: + delpointer(context); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); + if (!context.flags.z()) goto isntsame2; + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); + if (!context.flags.z()) goto isntsame2; + errormessage1(context); + return; +isntsame2: + checkobjectsize(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto sizeok2; + return; +sizeok2: + context.ah = context.data.byte(102); + context.al = context.data.byte(89); + context.push(context.ax); + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + context._cmp(context.ah, 4); + if (!context.flags.z()) goto makeswapex; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + goto actuallyswap; +makeswapex: + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; +actuallyswap: + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.push(context.bx); + findopenpos(context); + geteitherad(context); + context.al = context.data.byte(111); + context.data.byte(context.bx+2) = context.al; + context.al = context.data.byte(110); + context.data.byte(context.bx+3) = context.al; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.al = context.data.byte(184); + context.data.byte(context.bx+5) = context.al; + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + fillopen(context); + fillryan(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void intoinv(Context & context) { + context._cmp(context.data.byte(106), 0); + if (!context.flags.z()) goto notout; + outofinv(context); + return; +notout: + findinvpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto canplace1; + swapwithinv(context); + return; +canplace1: + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub1; + context._cmp(context.data.byte(100), 220); + if (context.flags.z()) goto alreadyplce; + context.data.byte(100) = 220; +difsub1: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 35; + commandwithob(context); +alreadyplce: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo2; + context._and(context.ax, 1); + if (!context.flags.z()) goto doplace; +notletgo2: + return; +doplace: + delpointer(context); + context.al = context.data.byte(89); + getexad(context); + context.data.byte(context.bx+2) = 4; + context.data.byte(context.bx+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.data.byte(106) = 0; + fillryan(context); + readmouse(context); + showpointer(context); + outofinv(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void outofinv(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (!context.flags.z()) goto canpick2; + blank(context); + return; +canpick2: + context.bx = context.data.word(202); + context._cmp(context.bx, 2); + if (!context.flags.z()) goto canpick2a; + reexfrominv(context); + return; +canpick2a: + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub3; + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadygrab; + context.data.byte(100) = 221; +difsub3: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 36; + commandwithob(context); +alreadygrab: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo; + context._and(context.ax, 1); + if (!context.flags.z()) goto dograb; +notletgo: + return; +dograb: + delpointer(context); + context.data.byte(106) = 1; + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + getexad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + fillryan(context); + readmouse(context); + showpointer(context); + intoinv(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void geteitherad(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto isinexlist; + context.al = context.data.byte(89); + getfreead(context); + return; +isinexlist: + context.al = context.data.byte(89); + getexad(context); + return; +} + +static inline void getopenedsize(Context & context) { + context._cmp(context.data.byte(111), 4); + if (context.flags.z()) goto isex2; + context._cmp(context.data.byte(111), 2); + if (context.flags.z()) goto isfree2; + context.al = context.data.byte(110); + getsetad(context); + context.ax = context.data.word(context.bx+3); + return; +isfree2: + context.al = context.data.byte(110); + getfreead(context); + context.ax = context.data.word(context.bx+7); + return; +isex2: + context.al = context.data.byte(110); + getexad(context); + context.ax = context.data.word(context.bx+7); + return; +} + +static inline void findinvpos(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, 80); + context.bx = -1; +findinv1: + context._add(context.bx, 1); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findinv1; + context.cx = context.data.word(200); + context._sub(context.cx, 58); + context._sub(context.bx, 5); +findinv2: + context._add(context.bx, 5); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findinv2; + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 10; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.bl; + context.data.byte(107) = context.al; + context._add(context.bx, context.bx); + context.es = context.data.word(412); + context._add(context.bx, 0+(228*13)+32); + return; +} + +static inline void findopenpos(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, 80); + context.bx = -1; +findopenp1: + context._add(context.bx, 1); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findopenp1; + context.al = context.bl; + context.data.byte(107) = context.al; + context._add(context.bx, context.bx); + context.es = context.data.word(412); + context._add(context.bx, 0+(228*13)); + return; +} + +static inline void dropobject(Context & context) { + context._cmp(context.data.byte(100), 223); + if (context.flags.z()) goto alreadydrop; + context.data.byte(100) = 223; + context._cmp(context.data.byte(106), 0); + if (context.flags.z()) { blank(context); return; }; + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.al = 37; + commandwithob(context); +alreadydrop: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodrop; + context._and(context.ax, 1); + if (!context.flags.z()) goto dodrop; +nodrop: + return; +dodrop: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto nowornerror; + wornerror(context); + return; +nowornerror: + context._cmp(context.data.byte(184), 47); + if (context.flags.z()) goto nodrop2; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto nodroperror; +nodrop2: + droperror(context); + return; +nodroperror: + context._cmp(context.data.byte(128), 64); + if (!context.flags.z()) goto notinlift; + context._cmp(context.data.byte(129), 64); + if (!context.flags.z()) goto notinlift; + droperror(context); + return; +notinlift: + context.al = context.data.byte(89); + context.ah = 4; + context.cl = 'G'; + context.ch = 'U'; + context.dl = 'N'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) { cantdrop(context); return; }; + context.al = context.data.byte(89); + context.ah = 4; + context.cl = 'S'; + context.ch = 'H'; + context.dl = 'L'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) { cantdrop(context); return; }; + context.data.byte(102) = 4; + context.al = context.data.byte(89); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(151); + context._add(context.al, 4); + context.cl = 4; + context._shr(context.al, context.cl); + context._add(context.al, context.data.byte(148)); + context.ah = context.data.byte(152); + context._add(context.ah, 8); + context.cl = 4; + context._shr(context.ah, context.cl); + context._add(context.ah, context.data.byte(149)); + context.data.byte(context.bx+3) = context.al; + context.data.byte(context.bx+5) = context.ah; + context.al = context.data.byte(151); + context._add(context.al, 4); + context._and(context.al, 15); + context.ah = context.data.byte(152); + context._add(context.ah, 8); + context._and(context.ah, 15); + context.data.byte(context.bx+4) = context.al; + context.data.byte(context.bx+6) = context.ah; + context.data.byte(106) = 0; + context.al = context.data.byte(184); + context.data.byte(context.bx) = context.al; + return; +} + +static inline void droperror(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 56; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); + return; +} + +static inline void cantdrop(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 24; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); + return; +} + +static inline void wornerror(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 57; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); + return; +} + +static inline void removeobfrominv(Context & context) { + context._cmp(context.data.byte(99), 100); + if (context.flags.z()) goto obnotexist; + getanyad(context); + context.di = context.bx; + context.cl = context.data.byte(99); + context.ch = 0; + deleteexobject(context); +obnotexist: + return; +} + +static inline void selectopenob(Context & context) { + context.al = context.data.byte(99); + getanyad(context); + context._cmp(context.al, 255); + if (!context.flags.z()) goto canopenit1; + blank(context); + return; +canopenit1: + context._cmp(context.data.byte(100), 224); + if (context.flags.z()) goto alreadyopob; + context.data.byte(100) = 224; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 38; + commandwithob(context); +alreadyopob: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noopenob; + context._and(context.ax, 1); + if (!context.flags.z()) goto doopenob; +noopenob: + return; +doopenob: + context.al = context.data.byte(99); + context.data.byte(110) = context.al; + context.al = context.data.byte(102); + context.data.byte(111) = context.al; + createpanel(context); + showpanel(context); + showman(context); + examicon(context); + showexit(context); + openinv(context); + openob(context); + undertextline(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void useopened(Context & context) { + context._cmp(context.data.byte(110), 255); + if (context.flags.z()) goto cannotuseopen; + context._cmp(context.data.byte(106), 0); + if (!context.flags.z()) goto notout2; + outofopen(context); + return; +notout2: + findopenpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto canplace3; + swapwithopen(context); +cannotuseopen: + return; +canplace3: + context._cmp(context.data.byte(106), 1); + if (context.flags.z()) goto intoopen; + blank(context); + return; +intoopen: + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub2; + context._cmp(context.data.byte(100), 227); + if (context.flags.z()) goto alreadyplc2; + context.data.byte(100) = 227; +difsub2: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 35; + commandwithob(context); +alreadyplc2: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo3; + context._cmp(context.ax, 1); + if (context.flags.z()) goto doplace2; +notletgo3: + return; +doplace2: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto notworntoopen; + wornerror(context); + return; +notworntoopen: + delpointer(context); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); + if (!context.flags.z()) goto isntsame; + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); + if (!context.flags.z()) goto isntsame; + errormessage1(context); + return; +isntsame: + checkobjectsize(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto sizeok1; + return; +sizeok1: + context.data.byte(106) = 0; + context.al = context.data.byte(89); + geteitherad(context); + context.al = context.data.byte(111); + context.data.byte(context.bx+2) = context.al; + context.al = context.data.byte(110); + context.data.byte(context.bx+3) = context.al; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.al = context.data.byte(184); + context.data.byte(context.bx+5) = context.al; + fillopen(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void errormessage1(Context & context) { + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 58; + context.dl = 240; + printmessage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void errormessage2(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 59; + context.dl = 240; + printmessage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void errormessage3(Context & context) { + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 60; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void checkobjectsize(Context & context) { + getopenedsize(context); + context.push(context.ax); + context.al = context.data.byte(89); + geteitherad(context); + context.al = context.data.byte(context.bx+9); + context.cx = context.pop(); + context._cmp(context.al, 255); + if (!context.flags.z()) goto notunsized; + context.al = 6; +notunsized: + context._cmp(context.al, 100); + if (!context.flags.c()) goto specialcase; + context._cmp(context.cl, 100); + if (context.flags.c()) goto isntspecial; + errormessage3(context); + goto sizewrong; +isntspecial: + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto sizeok; +specialcase: + context._sub(context.al, 100); + context._cmp(context.cl, 100); + if (!context.flags.c()) goto bothspecial; + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto sizeok; + errormessage2(context); + goto sizewrong; +bothspecial: + context._sub(context.cl, 100); + context._cmp(context.al, context.cl); + if (context.flags.z()) goto sizeok; + errormessage3(context); +sizewrong: + context.al = 1; + return; +sizeok: + context.al = 0; + return; +} + +static inline void outofopen(Context & context) { + context._cmp(context.data.byte(110), 255); + if (context.flags.z()) goto cantuseopen; + findopenpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (!context.flags.z()) goto canpick4; +cantuseopen: + blank(context); + return; +canpick4: + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub4; + context._cmp(context.data.byte(100), 228); + if (context.flags.z()) goto alreadygrb; + context.data.byte(100) = 228; +difsub4: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 36; + commandwithob(context); +alreadygrb: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo4; + context._cmp(context.ax, 1); + if (context.flags.z()) goto dogrb; + context._cmp(context.ax, 2); + if (!context.flags.z()) goto notletgo4; + reexfromopen(context); +notletgo4: + return; +dogrb: + delpointer(context); + context.data.byte(106) = 1; + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + context._cmp(context.ah, 4); + if (!context.flags.z()) goto makeintoex; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + goto actuallyout; +makeintoex: + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; +actuallyout: + fillopen(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void blockget(Context & context) { + context.ah = context.al; + context.al = 0; + context.ds = context.data.word(416); + context.si = 0+192; + context._add(context.si, context.ax); + return; +} + +static inline void adjustlen(Context & context) { + context.ah = context.al; + context._add(context.al, context.ch); + context._cmp(context.al, 100); + if (context.flags.c()) goto over242; + context.al = 224; + context._sub(context.al, context.ch); + context.ch = context.al; +over242: + return; +} + +static inline void look(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 241); + if (context.flags.z()) goto alreadylook; + context.data.byte(100) = 241; + context.al = 25; + commandonly(context); +alreadylook: + context._cmp(context.data.word(202), 1); + if (!context.flags.z()) goto nolook; + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nolook; + dolook(context); +nolook: + return; +} + +static inline void getback1(Context & context) { + context._cmp(context.data.byte(106), 0); + if (context.flags.z()) goto notgotobject; + blank(context); + return; +notgotobject: + context._cmp(context.data.byte(100), 202); + if (context.flags.z()) goto alreadyget; + context.data.byte(100) = 202; + context.al = 26; + commandonly(context); +alreadyget: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nogetback; + context._and(context.ax, 1); + if (!context.flags.z()) goto dogetback; +nogetback: + return; +dogetback: + context.data.byte(103) = 1; + context.data.byte(106) = 0; + return; +} + +static inline void talk(Context & context) { + context.data.byte(246) = 0; + context.data.byte(237) = 0; + context.al = context.data.byte(99); + context.data.byte(247) = context.al; + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + undertextline(context); + convicons(context); + starttalk(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); +waittalk: + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.data.byte(103) = 0; + context.bx = 2660; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waittalk; +finishtalk: + context.bx = context.data.word(249); + context.es = context.cs; + context._cmp(context.data.byte(246), 4); + if (context.flags.c()) goto notnexttalk; + context.al = context.data.byte(context.bx+7); + context._or(context.al, 128); + context.data.byte(context.bx+7) = context.al; +notnexttalk: + redrawmainscrn(context); + worktoscreenm(context); + context._cmp(context.data.byte(383), 1); + if (!context.flags.z()) goto nospeech; + cancelch1(context); + context.data.byte(388) = -1; + context.data.byte(387) = 0; +nospeech: + return; +} + +static inline void convicons(Context & context) { + context.al = context.data.byte(247); + context._and(context.al, 127); + getpersframe(context); + context.di = 234; + context.bx = 2; + context.data.word(160) = context.ax; + findsource(context); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context.ah = 0; + showframe(context); + return; +} + +static inline void getpersframe(Context & context) { + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(448); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + return; +} + +static inline void starttalk(Context & context) { + context.data.byte(245) = 0; + context.al = context.data.byte(247); + context._and(context.al, 127); + getpersontext(context); + context.data.word(71) = 91+91; + context.di = 66; + context.bx = 64; + context.dl = 241; + context.al = 0; + context.ah = 79; + printdirect(context); + context.data.word(71) = 0; + context.di = 66; + context.bx = 80; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); +nospeech1: + return; +} + +static inline void getpersontext(Context & context) { + context.ah = 0; + context.cx = 64*2; + context._mul(context.cx); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + return; +} + +static inline void moretalk(Context & context) { + context._cmp(context.data.byte(245), 0); + if (context.flags.z()) goto canmore; + redes(context); + return; +canmore: + context._cmp(context.data.byte(100), 215); + if (context.flags.z()) goto alreadymore; + context.data.byte(100) = 215; + context.al = 49; + commandonly(context); +alreadymore: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nomore; + context._and(context.ax, 1); + if (!context.flags.z()) goto domoretalk; +nomore: + return; +domoretalk: + context.data.byte(245) = 2; + context.data.byte(246) = 4; + context._cmp(context.data.byte(247), 100); + if (context.flags.c()) goto notsecondpart; + context.data.byte(246) = 48; +notsecondpart: + dosometalk(context); + return; +} + +static inline void dosometalk(Context & context) { +watchtalk: + context.al = context.data.byte(246); + context.al = context.data.byte(247); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cx = context.ax; + context.al = context.data.byte(246); + context.ah = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.ax); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto endwatchtalk; + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 164; + context.bx = 64; + context.dl = 144; + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(234) = 3; + worktoscreenm(context); + context.cx = 180; + hangonpq(context); + context._add(context.data.byte(246), 1); + context.al = context.data.byte(246); + context.al = context.data.byte(247); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cx = context.ax; + context.al = context.data.byte(246); + context.ah = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.ax); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto endwatchtalk; + context._cmp(context.data.byte(context.si), ':'); + if (context.flags.z()) goto skiptalk; + context._cmp(context.data.byte(context.si), 32); + if (context.flags.z()) goto skiptalk; + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 48; + context.bx = 128; + context.dl = 144; + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(234) = 3; + worktoscreenm(context); + context.cx = 180; + hangonpq(context); +skiptalk: + context._add(context.data.byte(246), 1); + goto watchtalk; +endwatchtalk: + context.data.byte(234) = 0; + return; +} + +static inline void hangonpq(Context & context) { + context.data.byte(103) = 0; + context.bx = 0; +hangloopq: + context.push(context.cx); + context.push(context.bx); + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 2692; + checkcoords(context); + context.bx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto quitconv; + context._cmp(context.data.byte(383), 1); + if (!context.flags.z()) goto notspeaking; + context._cmp(context.data.byte(515), 255); + if (!context.flags.z()) goto notspeaking; + context._add(context.bx, 1); + context._cmp(context.bx, 40); + if (context.flags.z()) goto finishconv; +notspeaking: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto hangloopq; + context._cmp(context.data.word(212), 0); + if (!context.flags.z()) goto hangloopq; +finishconv: + delpointer(context); + context.data.byte(234) = 0; + return; +quitconv: + delpointer(context); + context.data.byte(234) = 0; + context.ax = context.pop(); + cancelch1(context); + return; +} + +static inline void redes(Context & context) { + context._cmp(context.data.byte(515), 255); + if (!context.flags.z()) goto cantredes; + context._cmp(context.data.byte(245), 2); + if (context.flags.z()) goto canredes; +cantredes: + blank(context); + return; +canredes: + context._cmp(context.data.byte(100), 217); + if (context.flags.z()) goto alreadyreds; + context.data.byte(100) = 217; + context.al = 50; + commandonly(context); +alreadyreds: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (!context.flags.z()) goto doredes; + return; +doredes: + delpointer(context); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + starttalk(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void lookatplace(Context & context) { + context._cmp(context.data.byte(100), 224); + if (context.flags.z()) goto alreadyinfo; + context.data.byte(100) = 224; + context.al = 27; + commandonly(context); +alreadyinfo: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noinfo; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noinfo; + context.bl = context.data.byte(183); + context._cmp(context.bl, 15); + if (!context.flags.c()) goto noinfo; + context.push(context.bx); + delpointer(context); + deltextline(context); + getundercentre(context); + context.ds = context.data.word(462); + context.al = 0; + context.ah = 0; + context.di = 60; + context.bx = 72; + showframe(context); + context.al = 4; + context.ah = 0; + context.di = 60; + context.bx = 72+55; + showframe(context); + context.al = 4; + context.ah = 0; + context.di = 60; + context.bx = 72+55+21; + showframe(context); + context.bx = context.pop(); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(456); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + findnextcolon(context); + context.di = 63; + context.bx = 84+4; + context.dl = 191; + context.al = 0; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = 500; + hangonp(context); +afterinfo: + context.data.byte(234) = 0; + context.data.byte(231) = 0; + putundercentre(context); + worktoscreenm(context); +noinfo: + return; +} + +static inline void getundercentre(Context & context) { + context.di = 58; + context.bx = 72; + context.ds = context.data.word(402); + context.si = 0; + context.cl = 254; + context.ch = 110; + multiget(context); + return; +} + +static inline void putundercentre(Context & context) { + context.di = 58; + context.bx = 72; + context.ds = context.data.word(402); + context.si = 0; + context.cl = 254; + context.ch = 110; + multiput(context); + return; +} + +static inline void nextdest(Context & context) { +duok: + context._cmp(context.data.byte(100), 218); + if (context.flags.z()) goto alreadydu; + context.data.byte(100) = 218; + context.al = 28; + commandonly(context); +alreadydu: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto nodu; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodu; +searchdestup: + context._add(context.data.byte(183), 1); + context._cmp(context.data.byte(183), 15); + if (!context.flags.z()) goto notlastdest; + context.data.byte(183) = 0; +notlastdest: + getdestinfo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto searchdestup; + context.data.byte(109) = 1; + deltextline(context); + delpointer(context); + showpanel(context); + showman(context); + showarrows(context); + locationpic(context); + undertextline(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +nodu: + return; +} + +static inline void lastdest(Context & context) { +ddok: + context._cmp(context.data.byte(100), 219); + if (context.flags.z()) goto alreadydd; + context.data.byte(100) = 219; + context.al = 29; + commandonly(context); +alreadydd: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto nodd; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodd; +searchdestdown: + context._sub(context.data.byte(183), 1); + context._cmp(context.data.byte(183), -1); + if (!context.flags.z()) goto notfirstdest; + context.data.byte(183) = 15; +notfirstdest: + getdestinfo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto searchdestdown; + context.data.byte(109) = 1; + deltextline(context); + delpointer(context); + showpanel(context); + showman(context); + showarrows(context); + locationpic(context); + undertextline(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +nodd: + return; +} + +static inline void destselect(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadytrav; + context.data.byte(100) = 222; + context.al = 30; + commandonly(context); +alreadytrav: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto notrav; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notrav; + getdestinfo(context); + context.al = context.data.byte(183); + context.data.byte(188) = context.al; +notrav: + return; +} + +static inline void usemon(Context & context) { + context.data.byte(55) = 0; + context.es = context.cs; + context.di = 2895+1; + context.cx = 12; + context.al = 32; + while(--context.cx) context._stosb(); + context.es = context.cs; + context.di = 2883+1; + context.cx = 12; + context.al = 32; + while(--context.cx) context._stosb(); + context.es = context.cs; + context.di = 2807; + context.data.byte(context.di) = 1; + context._add(context.di, 26); + context.cx = 3; +keyloop: + context.data.byte(context.di) = 0; + context._add(context.di, 26); + if (--context.cx) goto keyloop; + createpanel(context); + showpanel(context); + showicon(context); + drawfloor(context); + getridofall(context); + context.dx = 1987; + loadintotemp(context); + loadpersonal(context); + loadnews(context); + loadcart(context); + context.dx = 1883; + loadtempcharset(context); + printoutermon(context); + initialmoncols(context); + printlogo(context); + worktoscreen(context); + turnonpower(context); + fadeupyellows(context); + fadeupmonfirst(context); + context.data.word(318) = 76; + context.data.word(320) = 141; + context.al = 1; + monmessage(context); + context.cx = 120; + hangoncurs(context); + context.al = 2; + monmessage(context); + context.cx = 60; + randomaccess(context); + context.al = 3; + monmessage(context); + context.cx = 100; + hangoncurs(context); + printlogo(context); + scrollmonitor(context); + context.data.word(394) = 0; + context.data.word(396) = 0; +moreinput: + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.push(context.di); + context.push(context.bx); + input(context); + context.bx = context.pop(); + context.di = context.pop(); + context.data.word(318) = context.di; + context.data.word(320) = context.bx; + execcommand(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto moreinput; +endmon: + getridoftemp(context); + getridoftempcharset(context); + context.es = context.data.word(466); + deallocatemem(context); + context.es = context.data.word(468); + deallocatemem(context); + context.es = context.data.word(470); + deallocatemem(context); + context.data.byte(103) = 1; + context.al = 26; + playchannel1(context); + context.data.byte(131) = 0; + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); + return; +} + +static inline void printoutermon(Context & context) { + context.di = 40; + context.bx = 32; + context.ds = context.data.word(458); + context.al = 1; + context.ah = 0; + showframe(context); + context.di = 264; + context.bx = 32; + context.ds = context.data.word(458); + context.al = 2; + context.ah = 0; + showframe(context); + context.di = 40; + context.bx = 12; + context.ds = context.data.word(458); + context.al = 3; + context.ah = 0; + showframe(context); + context.di = 40; + context.bx = 164; + context.ds = context.data.word(458); + context.al = 4; + context.ah = 0; + showframe(context); + return; +} + +static inline void loadpersonal(Context & context) { + context.al = context.data.byte(9); + context.dx = 2065; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundpersonal; + context._cmp(context.al, 42); + if (context.flags.z()) goto foundpersonal; + context.dx = 2078; + context._cmp(context.al, 2); + if (context.flags.z()) goto foundpersonal; +foundpersonal: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(466) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); + return; +} + +static inline void loadnews(Context & context) { + context.al = context.data.byte(34); + context.dx = 2091; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundnews; + context.dx = 2104; + context._cmp(context.al, 1); + if (context.flags.z()) goto foundnews; + context.dx = 2117; + context._cmp(context.al, 2); + if (context.flags.z()) goto foundnews; + context.dx = 2130; +foundnews: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(468) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); + return; +} + +static inline void loadcart(Context & context) { + lookininterface(context); + context.dx = 2143; + context._cmp(context.al, 0); + if (context.flags.z()) goto gotcart; + context.dx = 2156; + context._cmp(context.al, 1); + if (context.flags.z()) goto gotcart; + context.dx = 2169; + context._cmp(context.al, 2); + if (context.flags.z()) goto gotcart; + context.dx = 2182; + context._cmp(context.al, 3); + if (context.flags.z()) goto gotcart; + context.dx = 2195; +gotcart: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(470) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); + return; +} + +static inline void lookininterface(Context & context) { + context.al = 'I'; + context.ah = 'N'; + context.cl = 'T'; + context.ch = 'F'; + findsetobject(context); + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (context.flags.z()) goto emptyinterface; + context.al = context.data.byte(context.bx+15); + context._add(context.al, 1); + return; +emptyinterface: + context.al = 0; + return; +} + +static inline void turnonpower(Context & context) { + context.cx = 3; +powerloop: + context.push(context.cx); + powerlighton(context); + context.cx = 30; + hangon(context); + powerlightoff(context); + context.cx = 30; + hangon(context); + context.cx = context.pop(); + if (--context.cx) goto powerloop; + powerlighton(context); + return; +} + +static inline void randomaccess(Context & context) { +accessloop: + context.push(context.cx); + vsync(context); + vsync(context); + randomnum1(context); + context._and(context.al, 15); + context._cmp(context.al, 10); + if (context.flags.c()) goto off; + accesslighton(context); + goto chosenaccess; +off: + accesslightoff(context); +chosenaccess: + context.cx = context.pop(); + if (--context.cx) goto accessloop; + accesslightoff(context); + return; +} + +static inline void powerlighton(Context & context) { + context.di = 257+4; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 6; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void powerlightoff(Context & context) { + context.di = 257+4; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 5; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void accesslighton(Context & context) { + context.di = 74; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 8; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void accesslightoff(Context & context) { + context.di = 74; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 7; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void locklighton(Context & context) { + context.di = 56; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 10; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void locklightoff(Context & context) { + context.di = 56; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 9; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); + return; +} + +static inline void input(Context & context) { + context.es = context.cs; + context.di = 7944; + context.cx = 64; + context.al = 0; + while(--context.cx) context._stosb(); + context.data.word(316) = 0; + context.al = '>'; + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); + context.ah = 0; + printchar(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.cl = 6; + context.ch = 8; + multidump(context); + context._add(context.data.word(318), 6); + context.ax = context.data.word(318); + context.data.word(312) = context.ax; + context.ax = context.data.word(320); + context.data.word(314) = context.ax; +waitkey: + printcurs(context); + vsync(context); + delcurs(context); + readkey(context); + context.al = context.data.byte(142); + context._cmp(context.al, 0); + if (context.flags.z()) goto waitkey; + context._cmp(context.al, 13); + if (context.flags.z()) goto endofinput; + context._cmp(context.al, 8); + if (!context.flags.z()) goto notdel; + context._cmp(context.data.word(316), 0); + if (context.flags.z()) goto waitkey; + delchar(context); + goto waitkey; +notdel: + context._cmp(context.data.word(316), 28); + if (context.flags.z()) goto waitkey; + context._cmp(context.data.byte(142), 32); + if (!context.flags.z()) goto notleadingspace; + context._cmp(context.data.word(316), 0); + if (context.flags.z()) goto waitkey; +notleadingspace: + makecaps(context); + context.es = context.cs; + context.si = context.data.word(316); + context._add(context.si, context.si); + context._add(context.si, 7944); + context.data.byte(context.si) = context.al; + context._cmp(context.al, 'Z'+1); + if (!context.flags.c()) goto waitkey; + context.push(context.ax); + context.push(context.es); + context.push(context.si); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); + context._xchg(context.al, context.ah); + context.si = context.ax; + context.cl = 8; + context.ch = 8; + multiget(context); + context.si = context.pop(); + context.es = context.pop(); + context.ax = context.pop(); + context.push(context.es); + context.push(context.si); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); + context.ah = 0; + printchar(context); + context.si = context.pop(); + context.es = context.pop(); + context.data.byte(context.si+1) = context.cl; + context.ch = 0; + context._add(context.data.word(318), context.cx); + context._add(context.data.word(316), 1); + context._add(context.data.word(312), context.cx); + goto waitkey; +endofinput: + return; +} + +static inline void makecaps(Context & context) { + context._cmp(context.al, 'a'); + if (context.flags.c()) goto notupperc; + context._sub(context.al, 32); +notupperc: + return; +} + +static inline void delchar(Context & context) { + context._sub(context.data.word(316), 1); + context.si = context.data.word(316); + context._add(context.si, context.si); + context.es = context.cs; + context._add(context.si, 7944); + context.data.byte(context.si) = 0; + context.al = context.data.byte(context.si+1); + context.ah = 0; + context._sub(context.data.word(318), context.ax); + context._sub(context.data.word(312), context.ax); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); + context._xchg(context.al, context.ah); + context.si = context.ax; + context.cl = 8; + context.ch = 8; + multiput(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.cl = context.al; + context.ch = 8; + multidump(context); + return; +} + +static inline void execcommand(Context & context) { + context.es = context.cs; + context.bx = 2776; + context.ds = context.cs; + context.si = 7944; + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (!context.flags.z()) goto notblankinp; + scrollmonitor(context); + return; +notblankinp: + context.cl = 0; +comloop: + context.push(context.bx); + context.push(context.si); +comloop2: + context.al = context.data.byte(context.si); + context._add(context.si, 2); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.ah, 32); + if (context.flags.z()) goto foundcom; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto comloop2; + context.si = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 6); + if (!context.flags.z()) goto comloop; + neterror(context); + context.al = 0; + return; +foundcom: + context.si = context.pop(); + context.bx = context.pop(); + context._cmp(context.cl, 1); + if (context.flags.z()) goto testcom; + context._cmp(context.cl, 2); + if (context.flags.z()) goto directory; + context._cmp(context.cl, 3); + if (context.flags.z()) goto accesscom; + context._cmp(context.cl, 4); + if (context.flags.z()) goto signoncom; + context._cmp(context.cl, 5); + if (context.flags.z()) goto keyscom; + goto quitcom; +directory: + dircom(context); + context.al = 0; + return; +signoncom: + signon(context); + context.al = 0; + return; +accesscom: + read(context); + context.al = 0; + return; +keyscom: + showkeys(context); + context.al = 0; + return; +testcom: + context.al = 6; + monmessage(context); + context.al = 0; + return; +quitcom: + context.al = 1; + return; +} + +static inline void neterror(Context & context) { + context.al = 5; + monmessage(context); + scrollmonitor(context); + return; +} + +static inline void dircom(Context & context) { + context.cx = 30; + randomaccess(context); + parser(context); + context._cmp(context.data.byte(context.di+1), 0); + if (context.flags.z()) goto dirroot; + dirfile(context); + return; +dirroot: + context.data.byte(269) = 0; + context.ds = context.cs; + context.si = 2885; + context._add(context.si, 1); + context.es = context.cs; + context.di = 2895; + context._add(context.di, 1); + context.cx = 12; + while(--context.cx) context._movsb(); + monitorlogo(context); + scrollmonitor(context); + context.al = 9; + monmessage(context); + context.es = context.data.word(466); + searchforfiles(context); + context.es = context.data.word(468); + searchforfiles(context); + context.es = context.data.word(470); + searchforfiles(context); + scrollmonitor(context); + return; +} + +static inline void searchforfiles(Context & context) { + context.bx = 66*2; +directloop1: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, '*'); + if (context.flags.z()) goto endofdir; + context._cmp(context.al, 34); + if (!context.flags.z()) goto directloop1; + monprint(context); + goto directloop1; +endofdir: + return; +} + +static inline void signon(Context & context) { + parser(context); + context._add(context.di, 1); + context.ds = context.cs; + context.si = 2807; + context.cx = 4; +signonloop: + context.push(context.cx); + context.push(context.si); + context.push(context.di); + context._add(context.si, 14); + context.cx = 11; +signonloop2: + context._lodsb(); + context._cmp(context.al, 32); + if (context.flags.z()) goto foundsign; + makecaps(context); + context.ah = context.data.byte(context.di); + context._add(context.di, 1); + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto nomatch; + if (--context.cx) goto signonloop2; +nomatch: + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 26); + if (--context.cx) goto signonloop; + context.al = 13; + monmessage(context); + return; +foundsign: + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context.bx = context.si; + context.es = context.ds; + context._cmp(context.data.byte(context.bx), 0); + if (context.flags.z()) goto notyetassigned; + context.al = 17; + monmessage(context); + return; +notyetassigned: + context.push(context.es); + context.push(context.bx); + scrollmonitor(context); + context.al = 15; + monmessage(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.push(context.di); + context.push(context.bx); + input(context); + context.bx = context.pop(); + context.di = context.pop(); + context.data.word(318) = context.di; + context.data.word(320) = context.bx; + context.bx = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.bx); + context._add(context.bx, 2); + context.ds = context.cs; + context.si = 7944; +checkpass: + context._lodsw(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.ah, 32); + if (context.flags.z()) goto passpassed; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto checkpass; +passerror: + context.bx = context.pop(); + context.es = context.pop(); + scrollmonitor(context); + context.al = 16; + monmessage(context); + return; +passpassed: + context.al = 14; + monmessage(context); + context.bx = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.bx); + context._add(context.bx, 14); + monprint(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(context.bx) = 1; + return; +} + +static inline void showkeys(Context & context) { + context.cx = 10; + randomaccess(context); + scrollmonitor(context); + context.al = 18; + monmessage(context); + context.es = context.cs; + context.bx = 2807; + context.cx = 4; +keysloop: + context.push(context.cx); + context.push(context.bx); + context._cmp(context.data.byte(context.bx), 0); + if (context.flags.z()) goto notheld; + context._add(context.bx, 14); + monprint(context); +notheld: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 26); + if (--context.cx) goto keysloop; + scrollmonitor(context); + return; +} + +static inline void read(Context & context) { + context.cx = 40; + randomaccess(context); + parser(context); + context._cmp(context.data.byte(context.di+1), 0); + if (!context.flags.z()) goto okcom; + neterror(context); + return; +okcom: + context.es = context.cs; + context.di = 2895; + context.ax = context.data.word(466); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.ax = context.data.word(468); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.ax = context.data.word(470); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.al = 7; + monmessage(context); + return; +foundfile2: + getkeyandlogo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto keyok1; + return; +keyok1: + context.es = context.cs; + context.di = 2883; + context.ds = context.data.word(324); + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto findtopictext; + context.al = context.data.byte(270); + context.data.byte(269) = context.al; + context.al = 11; + monmessage(context); + return; +findtopictext: + context._add(context.bx, 1); + context.push(context.es); + context.push(context.bx); + monitorlogo(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); +moretopic: + monprint(context); + context.al = context.data.byte(context.bx); + context._cmp(context.al, 34); + if (context.flags.z()) goto endoftopic; + context._cmp(context.al, '='); + if (context.flags.z()) goto endoftopic; + context._cmp(context.al, '*'); + if (context.flags.z()) goto endoftopic; + context.push(context.es); + context.push(context.bx); + processtrigger(context); + context.cx = 24; + randomaccess(context); + context.bx = context.pop(); + context.es = context.pop(); + goto moretopic; +endoftopic: + scrollmonitor(context); + return; +} + +static inline void dirfile(Context & context) { + context.al = 34; + context.data.byte(context.di) = context.al; + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(466); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(468); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(470); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.al = 7; + monmessage(context); + return; +foundfile: + context.ax = context.pop(); + context.ax = context.pop(); + getkeyandlogo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto keyok2; + return; +keyok2: + context.push(context.es); + context.push(context.bx); + context.ds = context.cs; + context.si = 2883+1; + context.es = context.cs; + context.di = 2895+1; + context.cx = 12; + while(--context.cx) context._movsb(); + monitorlogo(context); + scrollmonitor(context); + context.al = 10; + monmessage(context); + context.bx = context.pop(); + context.es = context.pop(); +directloop2: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, 34); + if (context.flags.z()) goto endofdir2; + context._cmp(context.al, '*'); + if (context.flags.z()) goto endofdir2; + context._cmp(context.al, '='); + if (!context.flags.z()) goto directloop2; + monprint(context); + goto directloop2; +endofdir2: + scrollmonitor(context); + return; +} + +static inline void getkeyandlogo(Context & context) { + context._add(context.bx, 1); + context.al = context.data.byte(context.bx); + context._sub(context.al, 48); + context.data.byte(271) = context.al; + context._add(context.bx, 2); + context.al = context.data.byte(context.bx); + context._sub(context.al, 48); + context.data.byte(276) = context.al; + context._add(context.bx, 1); + context.push(context.es); + context.push(context.bx); + context.al = context.data.byte(276); + context.ah = 0; + context.cx = 26; + context._mul(context.cx); + context.es = context.cs; + context.bx = 2807; + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context._cmp(context.al, 1); + if (context.flags.z()) goto keyok; + context.push(context.bx); + context.push(context.es); + context.al = 12; + monmessage(context); + context.es = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 14); + monprint(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); + context.al = 1; + return; +keyok: + context.bx = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(271); + context.data.byte(269) = context.al; + context.al = 0; + return; +} + +static inline void searchforstring(Context & context) { + context.dl = context.data.byte(context.di); + context.cx = context.di; +restartlook: + context.di = context.cx; + context.bx = context.si; + context.dh = 0; +keeplooking: + context._lodsb(); + makecaps(context); + context._cmp(context.al, '*'); + if (context.flags.z()) goto notfound; + context._cmp(context.dl, '='); + if (!context.flags.z()) goto nofindingtopic; + context._cmp(context.al, 34); + if (context.flags.z()) goto notfound; +nofindingtopic: + context.ah = context.data.byte(context.di); + context._cmp(context.al, context.dl); + if (!context.flags.z()) goto notbracket; + context._add(context.dh, 1); + context._cmp(context.dh, 2); + if (context.flags.z()) goto complete; +notbracket: + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto restartlook; + context._add(context.di, 1); + goto keeplooking; +complete: + context.es = context.ds; + context.al = 0; + context.bx = context.si; + return; +notfound: + context.al = 1; + return; +} + +static inline void parser(Context & context) { + context.es = context.cs; + context.di = 2883; + context.cx = 13; + context.al = 0; + while(--context.cx) context._stosb(); + context.di = 2883; + context.al = '='; + context._stosb(); + context.ds = context.cs; + context.si = 7944; +notspace1: + context._lodsw(); + context._cmp(context.al, 32); + if (context.flags.z()) goto stillspace1; + context._cmp(context.al, 0); + if (!context.flags.z()) goto notspace1; + goto finishpars; +stillspace1: + context._lodsw(); + context._cmp(context.al, 32); + if (context.flags.z()) goto stillspace1; +copyin1: + context._stosb(); + context._lodsw(); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishpars; + context._cmp(context.al, 32); + if (!context.flags.z()) goto copyin1; +finishpars: + context.di = 2883; + return; +} + +static inline void scrollmonitor(Context & context) { + context.push(context.ax); + context.push(context.bx); + context.push(context.cx); + context.push(context.dx); + context.push(context.di); + context.push(context.si); + context.push(context.es); + context.push(context.ds); + printlogo(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + printundermon(context); + context.ax = context.data.word(320); + worktoscreen(context); + context.al = 25; + playchannel1(context); + context.ds = context.pop(); + context.es = context.pop(); + context.si = context.pop(); + context.di = context.pop(); + context.dx = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + return; +} + +static inline void lockmon(Context & context) { + context._cmp(context.data.byte(392), 57); + if (!context.flags.z()) goto notlock; + locklighton(context); +lockloop: + context._cmp(context.data.byte(392), 57); + if (context.flags.z()) goto lockloop; + locklightoff(context); +notlock: + return; +} + +static inline void monitorlogo(Context & context) { + context.al = context.data.byte(269); + context._cmp(context.al, context.data.byte(270)); + if (context.flags.z()) goto notnewlogo; + context.data.byte(270) = context.al; + printlogo(context); + printundermon(context); + worktoscreen(context); + printlogo(context); + printlogo(context); + context.al = 26; + playchannel1(context); + context.cx = 20; + randomaccess(context); + return; +notnewlogo: + printlogo(context); + return; +} + +static inline void printlogo(Context & context) { + context.di = 56; + context.bx = 32; + context.ds = context.data.word(458); + context.al = 0; + context.ah = 0; + showframe(context); + showcurrentfile(context); + return; +} + +static inline void showcurrentfile(Context & context) { + context.di = 178; + context.bx = 37; + context.si = 2895+1; +curfileloop: + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishfile; + context._add(context.si, 1); + context.push(context.si); + modifychar(context); + context.ds = context.data.word(406); + context.ah = 0; + printchar(context); + context.si = context.pop(); + goto curfileloop; +finishfile: + return; +} + +static inline void monmessage(Context & context) { + context.es = context.data.word(466); + context.bx = 66*2; + context.cl = context.al; + context.ch = 0; +monmessageloop: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, '+'); + if (!context.flags.z()) goto monmessageloop; + if (--context.cx) goto monmessageloop; + monprint(context); + return; +} + +static inline void processtrigger(Context & context) { + context._cmp(context.data.byte(55), '1'); + if (!context.flags.z()) goto notfirsttrigger; + context.al = 8; + setlocation(context); + context.al = 45; + triggermessage(context); + return; +notfirsttrigger: + context._cmp(context.data.byte(55), '2'); + if (!context.flags.z()) goto notsecondtrigger; + context.al = 9; + setlocation(context); + context.al = 55; + triggermessage(context); + return; +notsecondtrigger: + context._cmp(context.data.byte(55), '3'); + if (!context.flags.z()) goto notthirdtrigger; + context.al = 2; + setlocation(context); + context.al = 59; + triggermessage(context); +notthirdtrigger: + return; +} + +static inline void triggermessage(Context & context) { + context.push(context.ax); + context.di = 174; + context.bx = 153; + context.cl = 200; + context.ch = 63; + context.ds = context.data.word(402); + context.si = 0; + multiget(context); + context.ax = context.pop(); + findpuztext(context); + context.di = 174; + context.bx = 156; + context.dl = 141; + context.ah = 16; + printdirect(context); + context.cx = 140; + hangon(context); + worktoscreen(context); + context.cx = 340; + hangon(context); + context.di = 174; + context.bx = 153; + context.cl = 200; + context.ch = 63; + context.ds = context.data.word(402); + context.si = 0; + multiput(context); + worktoscreen(context); + context.data.byte(55) = 0; + return; +} + +static inline void printcurs(Context & context) { + context.push(context.si); + context.push(context.di); + context.push(context.ds); + context.push(context.dx); + context.push(context.bx); + context.push(context.es); + context.di = context.data.word(312); + context.bx = context.data.word(314); + context.cl = 6; + context.ch = 8; + context._sub(context.bx, 3); + context.ch = 11; + context.ds = context.data.word(412); + context.si = 0; + context.push(context.di); + context.push(context.bx); + multiget(context); + context.bx = context.pop(); + context.di = context.pop(); + context.push(context.bx); + context.push(context.di); + context._add(context.data.word(138), 1); + context.ax = context.data.word(138); + context._and(context.al, 16); + if (!context.flags.z()) goto flashcurs; + context.al = '/'; + context._sub(context.al, 32); + context.ah = 0; + context.ds = context.data.word(406); + showframe(context); +flashcurs: + context.di = context.pop(); + context.bx = context.pop(); + context._sub(context.di, 6); + context.cl = 12; + context.ch = 11; + multidump(context); + context.es = context.pop(); + context.bx = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + return; +} + +static inline void delcurs(Context & context) { + context.push(context.es); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.push(context.dx); + context.push(context.si); + context.di = context.data.word(312); + context.bx = context.data.word(314); + context.cl = 6; + context.ch = 8; + context._sub(context.bx, 3); + context.ch = 11; + context.push(context.di); + context.push(context.bx); + context.push(context.cx); + context.ds = context.data.word(412); + context.si = 0; + multiput(context); + context.cx = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + multidump(context); +finishcurdel: + context.si = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void useobject(Context & context) { + context.data.byte(95) = 255; + context._cmp(context.data.byte(100), 229); + if (context.flags.z()) goto alreadyuse; + context.data.byte(100) = 229; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 51; + commandwithob(context); +alreadyuse: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nouse; + context._and(context.ax, 1); + if (!context.flags.z()) goto douse; +nouse: + return; +douse: + useroutine(context); + return; +} + +static inline void useroutine(Context & context) { + context._cmp(context.data.byte(184), 50); + if (context.flags.c()) goto nodream7; + context._cmp(context.data.byte(232), 0); + if (!context.flags.z()) goto powerok; + return; +powerok: + context.data.byte(232) = 0; +nodream7: + getanyad(context); + context.dx = context.ds; + context.ds = context.dx; + context.si = 2895; +checkuselist: + context.push(context.si); + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto failed; + context._lodsw(); + context.si = context.pop(); + __dispatch_call(context, context.ax); + return; +failed: + context.si = context.pop(); + context._add(context.si, 6); + context._cmp(context.data.byte(context.si), 140); + if (!context.flags.z()) goto checkuselist; + delpointer(context); + getobtextstart(context); + findnextcolon(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + findnextcolon(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + usetext(context); + context.cx = 400; + hangonp(context); + putbackobstuff(context); + return; +cantuse2: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.di = 33; + context.bx = 100; + context.al = 63; + context.dl = 241; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + putbackobstuff(context); + context.data.byte(100) = 255; + return; +} + +static inline void wheelsound(Context & context) { + context.al = 17; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void runtap(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto tapwith; + withwhat(context); + return; +tapwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto fillcupfromtap; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto cupfromtapfull; + context.cx = 300; + context.al = 56; + showpuztext(context); + putbackobstuff(context); + return; +fillcupfromtap: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'F'-'A'; + context.al = 8; + playchannel1(context); + context.cx = 300; + context.al = 57; + showpuztext(context); + putbackobstuff(context); + return; +cupfromtapfull: + context.cx = 300; + context.al = 58; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void playguitar(Context & context) { + context.al = 14; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void hotelcontrol(Context & context) { + context._cmp(context.data.byte(184), 21); + if (!context.flags.z()) goto notrightcont; + context._cmp(context.data.byte(148), 33); + if (!context.flags.z()) goto notrightcont; + showfirstuse(context); + putbackobstuff(context); + return; +notrightcont: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void hotelbell(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void opentomb(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 35*2; + context.data.word(23) = 1; + context.data.word(25) = 33; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void usetrainer(Context & context) { + getanyad(context); + context._cmp(context.data.byte(context.bx+2), 4); + if (!context.flags.z()) goto notheldtrainer; + context._add(context.data.byte(2), 1); + makeworn(context); + showseconduse(context); + putbackobstuff(context); + return; +notheldtrainer: + nothelderror(context); + return; +} + +static inline void nothelderror(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.di = 64; + context.bx = 100; + context.al = 63; + context.ah = 1; + context.dl = 201; + printmessage2(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + putbackobstuff(context); + return; +} + +static inline void usepipe(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto pipewith; + withwhat(context); + return; +pipewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto fillcup; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto alreadyfull; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +fillcup: + context.cx = 300; + context.al = 36; + showpuztext(context); + putbackobstuff(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'F'-'A'; + return; +alreadyfull: + context.cx = 300; + context.al = 35; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void usefullcart(Context & context) { + context._add(context.data.byte(2), 1); + context.al = 2; + context.ah = context.data.byte(185); + context._add(context.ah, 6); + turnanypathon(context); + context.data.byte(475) = 4; + context.data.byte(133) = 4; + context.data.byte(135) = 4; + context.data.byte(477) = 4; + findxyfrompath(context); + context.data.byte(187) = 1; + showfirstuse(context); + context.data.word(21) = 72*2; + context.data.word(23) = 58; + context.data.word(25) = 142; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void useplinth(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto plinthwith; + withwhat(context); + return; +plinthwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'D'; + context.ch = 'K'; + context.dl = 'E'; + context.dh = 'Y'; + compare(context); + if (context.flags.z()) goto isrightkey; + showfirstuse(context); + putbackobstuff(context); + return; +isrightkey: + context._add(context.data.byte(2), 1); + showseconduse(context); + context.data.word(21) = 220; + context.data.word(23) = 0; + context.data.word(25) = 104; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = context.data.byte(67); + context.data.byte(188) = context.al; + return; +} + +static inline void chewy(Context & context) { + showfirstuse(context); + getanyad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(103) = 1; + return; +} + +static inline void useladder(Context & context) { + showfirstuse(context); + context._sub(context.data.byte(148), 11); + findroominloc(context); + context.data.byte(133) = 6; + context.data.byte(135) = 6; + context.data.byte(475) = 0; + context.data.byte(478) = 0; + context.data.byte(477) = 0; + findxyfrompath(context); + context.data.byte(187) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void useladderb(Context & context) { + showfirstuse(context); + context._add(context.data.byte(148), 11); + findroominloc(context); + context.data.byte(133) = 2; + context.data.byte(135) = 2; + context.data.byte(475) = 1; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + findxyfrompath(context); + context.data.byte(187) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void slabdoora(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 13; + context._cmp(context.data.byte(66), 3); + if (!context.flags.z()) goto slabawrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 42; + context.data.byte(188) = 47; + return; +slabawrong: + context.data.word(21) = 40; + context.data.word(25) = 34; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void slabdoorb(Context & context) { + context._cmp(context.data.byte(66), 1); + if (!context.flags.z()) goto slabbwrong; + context.al = 'S'; + context.ah = 'H'; + context.cl = 'L'; + context.ch = 'D'; + isryanholding(context); + if (!context.flags.z()) goto gotcrystal; + context.al = 44; + context.cx = 200; + showpuztext(context); + putbackobstuff(context); + return; +gotcrystal: + showfirstuse(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 60; + context.data.word(25) = 71; + context.data.byte(188) = 47; + return; +slabbwrong: + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 40; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void slabdoord(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 75; + context._cmp(context.data.byte(66), 0); + if (!context.flags.z()) goto slabcwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 102; + context.data.byte(188) = 47; + return; +slabcwrong: + context.data.word(21) = 40; + context.data.word(25) = 94; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void slabdoorc(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 108; + context._cmp(context.data.byte(66), 4); + if (!context.flags.z()) goto slabdwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 135; + context.data.byte(188) = 47; + return; +slabdwrong: + context.data.word(21) = 40; + context.data.word(25) = 127; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void slabdoore(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 141; + context._cmp(context.data.byte(66), 5); + if (!context.flags.z()) goto slabewrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 168; + context.data.byte(188) = 47; + return; +slabewrong: + context.data.word(21) = 40; + context.data.word(25) = 160; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void slabdoorf(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 171; + context._cmp(context.data.byte(66), 2); + if (!context.flags.z()) goto slabfwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 197; + context.data.byte(188) = 47; + return; +slabfwrong: + context.data.word(21) = 40; + context.data.word(25) = 189; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void useslab(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto slabwith; + withwhat(context); + return; +slabwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'J'; + context.ch = 'E'; + context.dl = 'W'; + context.dh = 'L'; + compare(context); + if (context.flags.z()) goto nextslab; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +nextslab: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(99); + context.push(context.ax); + removesetobject(context); + context.ax = context.pop(); + context._add(context.al, 1); + context.push(context.ax); + placesetobject(context); + context.ax = context.pop(); + context._cmp(context.al, 54); + if (!context.flags.z()) goto notlastslab; + context.al = 0; + turnpathon(context); + context.data.word(21) = 22; + context.data.word(23) = 35; + context.data.word(25) = 48; + context.data.byte(27) = 1; + context.data.byte(26) = 1; +notlastslab: + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.byte(103) = 1; + return; +} + +static inline void usecart(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto cartwith; + withwhat(context); + return; +cartwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'R'; + context.ch = 'O'; + context.dl = 'C'; + context.dh = 'K'; + compare(context); + if (context.flags.z()) goto nextcart; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +nextcart: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(99); + context.push(context.ax); + removesetobject(context); + context.ax = context.pop(); + context._add(context.al, 1); + placesetobject(context); + context._add(context.data.byte(2), 1); + context.al = 17; + playchannel1(context); + showfirstuse(context); + context.data.byte(103) = 1; + return; +} + +static inline void useclearbox(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto clearboxwith; + withwhat(context); + return; +clearboxwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'R'; + context.ch = 'A'; + context.dl = 'I'; + context.dh = 'L'; + compare(context); + if (context.flags.z()) goto openbox; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +openbox: + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 80; + context.data.word(23) = 67; + context.data.word(25) = 105; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void usecoveredbox(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 50; + context.data.word(23) = 41; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void userailing(Context & context) { + showfirstuse(context); + context.data.word(21) = 80; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.data.byte(56) = 4; + return; +} + +static inline void useopenbox(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto openboxwith; + withwhat(context); + return; +openboxwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto destoryopenbox; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto openboxwrong; + showfirstuse(context); + return; +destoryopenbox: + context._add(context.data.byte(2), 1); + context.cx = 300; + context.al = 37; + showpuztext(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'E'-'A'; + context.data.word(21) = 140; + context.data.word(23) = 105; + context.data.word(25) = 181; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.al = 4; + turnpathon(context); + context.data.byte(103) = 1; + return; +openboxwrong: + context.cx = 300; + context.al = 38; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void wearwatch(Context & context) { + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto wearingwatch; + showfirstuse(context); + context.data.byte(3) = 1; + context.data.byte(103) = 1; + getanyad(context); + makeworn(context); + return; +wearingwatch: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void wearshades(Context & context) { + context._cmp(context.data.byte(4), 1); + if (context.flags.z()) goto wearingshades; + context.data.byte(4) = 1; + showfirstuse(context); + context.data.byte(103) = 1; + getanyad(context); + makeworn(context); + return; +wearingshades: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void sitdowninbar(Context & context) { + context._cmp(context.data.byte(32), -1); + if (!context.flags.z()) goto satdown; + showfirstuse(context); + context.data.word(21) = 50; + context.data.word(23) = 55; + context.data.word(25) = 71; + context.data.word(29) = 73; + context.data.word(31) = 83; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +satdown: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void usechurchhole(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.word(21) = 28; + context.data.word(23) = 13; + context.data.word(25) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static inline void usehole(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto holewith; + withwhat(context); + return; +holewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'H'; + context.ch = 'N'; + context.dl = 'D'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto righthand; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +righthand: + showfirstuse(context); + context.al = 86; + removesetobject(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(47) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void usealtar(Context & context) { + context.al = 'C'; + context.ah = 'N'; + context.cl = 'D'; + context.ch = 'A'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto thingsonaltar; + context.al = 'C'; + context.ah = 'N'; + context.cl = 'D'; + context.ch = 'B'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto thingsonaltar; + context._cmp(context.data.byte(47), 1); + if (context.flags.z()) goto movealtar; + context.cx = 300; + context.al = 23; + showpuztext(context); + context.data.byte(103) = 1; + return; +movealtar: + context._add(context.data.byte(2), 1); + showseconduse(context); + context.data.word(21) = 160; + context.data.word(23) = 81; + context.data.word(25) = 174; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.al = 47; + context.bl = 52; + context.bh = 76; + context.cx = 32; + context.dx = 98; + setuptimeduse(context); + context.data.byte(103) = 1; + return; +thingsonaltar: + showfirstuse(context); + context.data.byte(103) = 1; + return; +} + +static inline void opentvdoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto tvdoorwith; + withwhat(context); + return; +tvdoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'U'; + context.ch = 'L'; + context.dl = 'O'; + context.dh = 'K'; + compare(context); + if (context.flags.z()) goto keyontv; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +keyontv: + showfirstuse(context); + context.data.byte(37) = 0; + context.data.byte(103) = 1; + return; +} + +static inline void usedryer(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + context.data.byte(103) = 1; + return; +} + +static inline void openlouis(Context & context) { + context.al = 5; + context.ah = 2; + context.cl = 3; + context.ch = 8; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void nextcolon(Context & context) { +lookcolon: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (!context.flags.z()) goto lookcolon; + return; +} + +static inline void openyourneighbour(Context & context) { + context.al = 255; + context.ah = 255; + context.cl = 255; + context.ch = 255; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void usewindow(Context & context) { + context._cmp(context.data.byte(475), 6); + if (!context.flags.z()) goto notonbalc; + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.byte(188) = 29; + context.data.byte(103) = 1; + return; +notonbalc: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void usebalcony(Context & context) { + showfirstuse(context); + context.al = 6; + turnpathon(context); + context.al = 0; + turnpathoff(context); + context.al = 1; + turnpathoff(context); + context.al = 2; + turnpathoff(context); + context.al = 3; + turnpathoff(context); + context.al = 4; + turnpathoff(context); + context.al = 5; + turnpathoff(context); + context._add(context.data.byte(2), 1); + context.data.byte(475) = 6; + context.data.byte(478) = 6; + context.data.byte(477) = 6; + findxyfrompath(context); + switchryanoff(context); + context.data.byte(187) = 1; + context.data.word(21) = 30*2; + context.data.word(23) = 183; + context.data.word(25) = 212; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void openryan(Context & context) { + context.al = 5; + context.ah = 1; + context.cl = 0; + context.ch = 6; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void openpoolboss(Context & context) { + context.al = 5; + context.ah = 2; + context.cl = 2; + context.ch = 2; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void openeden(Context & context) { + context.al = 2; + context.ah = 8; + context.cl = 6; + context.ch = 5; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void opensarters(Context & context) { + context.al = 7; + context.ah = 8; + context.cl = 3; + context.ch = 3; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static inline void isitright(Context & context) { + context.bx = context.ds; + context.es = context.bx; + context.bx = 8350; + context._cmp(context.data.byte(context.bx+0), context.al); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+1), context.ah); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+2), context.cl); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+3), context.ch); +notright: + return; +} + +static inline void drawitall(Context & context) { + createpanel(context); + drawfloor(context); + printsprites(context); + showicon(context); + return; +} + +static inline void openhoteldoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto hoteldoorwith; + withwhat(context); + return; +hoteldoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto keyonhotel1; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +keyonhotel1: + context.al = 16; + playchannel1(context); + showfirstuse(context); + context.data.byte(37) = 0; + context.data.byte(103) = 1; + return; +} + +static inline void openhoteldoor2(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto hoteldoorwith2; + withwhat(context); + return; +hoteldoorwith2: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto keyonhotel2; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +keyonhotel2: + context.al = 16; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void grafittidoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto grafwith; + withwhat(context); + return; +grafwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'P'; + context.dl = 'E'; + context.dh = 'N'; + compare(context); + if (context.flags.z()) goto dograf; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +dograf: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void trapdoor(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + switchryanoff(context); + context.data.word(21) = 20*2; + context.data.word(23) = 181; + context.data.word(25) = 197; + context.data.byte(188) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void callhotellift(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.data.byte(478) = 5; + context.data.byte(477) = 5; + autosetwalk(context); + context.al = 4; + turnpathon(context); + return; +} + +static inline void calledenslift(Context & context) { + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.al = 2; + turnpathon(context); + return; +} + +static inline void calledensdlift(Context & context) { + context._cmp(context.data.byte(35), 1); + if (context.flags.z()) goto edensdhere; + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.al = 2; + turnpathon(context); + return; +edensdhere: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void usepoolreader(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto poolwith; + withwhat(context); + return; +poolwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'M'; + context.ch = 'E'; + context.dl = 'M'; + context.dh = 'B'; + compare(context); + if (context.flags.z()) goto openpool; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +openpool: + context._cmp(context.data.byte(48), 1); + if (context.flags.z()) goto canopenpool; + showseconduse(context); + putbackobstuff(context); + return; +canopenpool: + context.al = 17; + playchannel1(context); + showfirstuse(context); + context.data.byte(39) = 6; + context.data.byte(103) = 1; + return; +} + +static inline void uselighter(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotlighterwith; + withwhat(context); + return; +gotlighterwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'S'; + context.ch = 'M'; + context.dl = 'K'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto cigarette; + showfirstuse(context); + putbackobstuff(context); + return; +cigarette: + context.cx = 300; + context.al = 9; + showpuztext(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(103) = 1; + return; +} + +static inline void showseconduse(Context & context) { + getobtextstart(context); + nextcolon(context); + nextcolon(context); + nextcolon(context); + usetext(context); + context.cx = 400; + hangonp(context); + return; +} + +static inline void usecardreader1(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader1with; + withwhat(context); + return; +gotreader1with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto correctcard; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +correctcard: + context._cmp(context.data.byte(49), 0); + if (context.flags.z()) goto notyet; + context._cmp(context.data.word(16), 0); + if (context.flags.z()) goto getscash; + context.cx = 300; + context.al = 17; + showpuztext(context); + putbackobstuff(context); + return; +getscash: + context.al = 16; + playchannel1(context); + context.cx = 300; + context.al = 18; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(16) = 12432; + context.data.byte(103) = 1; + return; +notyet: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void usecardreader2(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader2with; + withwhat(context); + return; +gotreader2with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto correctcard2; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +correctcard2: + context._cmp(context.data.byte(50), 0); + if (context.flags.z()) goto notyetboss; + context._cmp(context.data.word(16), 0); + if (context.flags.z()) goto nocash; + context._cmp(context.data.byte(46), 2); + if (context.flags.z()) goto alreadygotnew; + context.al = 18; + playchannel1(context); + context.cx = 300; + context.al = 19; + showpuztext(context); + context.al = 94; + placesetobject(context); + context.data.byte(46) = 1; + context._sub(context.data.word(16), 2000); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +nocash: + context.cx = 300; + context.al = 20; + showpuztext(context); + putbackobstuff(context); + return; +alreadygotnew: + context.cx = 300; + context.al = 22; + showpuztext(context); + putbackobstuff(context); + return; +notyetboss: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void usecardreader3(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader3with; + withwhat(context); + return; +gotreader3with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto rightcard; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +rightcard: + context._cmp(context.data.byte(51), 0); + if (context.flags.z()) goto notyetrecep; + context._cmp(context.data.byte(52), 0); + if (!context.flags.z()) goto alreadyusedit; + context.al = 16; + playchannel1(context); + context.cx = 300; + context.al = 25; + showpuztext(context); + context._add(context.data.byte(2), 1); + context._sub(context.data.word(16), 8300); + context.data.byte(52) = 1; + context.data.byte(103) = 1; + return; +alreadyusedit: + context.cx = 300; + context.al = 26; + showpuztext(context); + putbackobstuff(context); + return; +notyetrecep: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void usecashcard(Context & context) { + getridofreels(context); + loadkeypad(context); + createpanel(context); + showpanel(context); + showexit(context); + showman(context); + context.di = 114; + context.bx = 120-3; + context.ds = context.data.word(458); + context.al = 39; + context.ah = 0; + showframe(context); + context.ax = context.data.word(16); + moneypoke(context); + getobtextstart(context); + nextcolon(context); + nextcolon(context); + context.di = 36; + context.bx = 98; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + context.di = 160; + context.bx = 155; + context.es = context.cs; + context.si = 3385; + context.data.word(71) = 91*2+75; + context.al = 0; + context.ah = 0; + context.dl = 240; + printdirect(context); + context.di = 187; + context.bx = 155; + context.es = context.cs; + context.si = 3390; + context.data.word(71) = 91*2+85; + context.al = 0; + context.ah = 0; + context.dl = 240; + printdirect(context); + context.data.word(71) = 0; + worktoscreenm(context); + context.cx = 400; + hangonp(context); + getridoftemp(context); + restorereels(context); + putbackobstuff(context); + return; +} + +static inline void moneypoke(Context & context) { + context.bx = 3385; + context.cl = 48-1; +numberpoke0: + context._add(context.cl, 1); + context._sub(context.ax, 10000); + if (!context.flags.c()) goto numberpoke0; + context._add(context.ax, 10000); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke1: + context._add(context.cl, 1); + context._sub(context.ax, 1000); + if (!context.flags.c()) goto numberpoke1; + context._add(context.ax, 1000); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke2: + context._add(context.cl, 1); + context._sub(context.ax, 100); + if (!context.flags.c()) goto numberpoke2; + context._add(context.ax, 100); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke3: + context._add(context.cl, 1); + context._sub(context.ax, 10); + if (!context.flags.c()) goto numberpoke3; + context._add(context.ax, 10); + context.data.byte(context.bx) = context.cl; + context.bx = 3390; + context._add(context.al, 48); + context.data.byte(context.bx) = context.al; + return; +} + +static inline void usecontrol(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotcontrolwith; + withwhat(context); + return; +gotcontrolwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto rightkey; + context._cmp(context.data.byte(184), 21); + if (!context.flags.z()) goto balls; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto jimmycontrols; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto axeoncontrols; +balls: + showfirstuse(context); + putbackobstuff(context); + return; +rightkey: + context.al = 16; + playchannel1(context); + context._cmp(context.data.byte(9), 21); + if (context.flags.z()) goto goingdown; + context.cx = 300; + context.al = 0; + showpuztext(context); + context.data.byte(188) = 21; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +goingdown: + context.cx = 300; + context.al = 3; + showpuztext(context); + context.data.byte(188) = 30; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +jimmycontrols: + context.al = 50; + placesetobject(context); + context.al = 51; + placesetobject(context); + context.al = 26; + placesetobject(context); + context.al = 30; + placesetobject(context); + context.al = 16; + removesetobject(context); + context.al = 17; + removesetobject(context); + context.al = 14; + playchannel1(context); + context.cx = 300; + context.al = 10; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +axeoncontrols: + context.cx = 300; + context.al = 16; + showpuztext(context); + context._add(context.data.byte(2), 1); + putbackobstuff(context); + return; +} + +static inline void usehatch(Context & context) { + showfirstuse(context); + context.data.byte(188) = 40; + context.data.byte(103) = 1; + return; +} + +static inline void usewire(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotwirewith; + withwhat(context); + return; +gotwirewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto wireknife; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto wireaxe; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +wireaxe: + context.cx = 300; + context.al = 16; + showpuztext(context); + putbackobstuff(context); + return; +wireknife: + context.al = 51; + removesetobject(context); + context.al = 52; + placesetobject(context); + context.cx = 300; + context.al = 11; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +} + +static inline void usehandle(Context & context) { + context.al = 'C'; + context.ah = 'U'; + context.cl = 'T'; + context.ch = 'W'; + findsetobject(context); + context.al = context.data.byte(context.bx+58); + context._cmp(context.al, 255); + if (!context.flags.z()) goto havecutwire; + context.cx = 300; + context.al = 12; + showpuztext(context); + context.data.byte(103) = 1; + return; +havecutwire: + context.cx = 300; + context.al = 13; + showpuztext(context); + context.data.byte(188) = 22; + context.data.byte(103) = 1; + return; +} + +static inline void useelevator1(Context & context) { + showfirstuse(context); + selectlocation(context); + context.data.byte(103) = 1; + return; +} + +static inline void showfirstuse(Context & context) { + getobtextstart(context); + findnextcolon(context); + findnextcolon(context); + usetext(context); + context.cx = 400; + hangonp(context); + return; +} + +static inline void useelevator3(Context & context) { + showfirstuse(context); + context.data.byte(40) = 20; + context.data.byte(188) = 34; + context.data.word(23) = 46; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +} + +static inline void useelevator4(Context & context) { + showfirstuse(context); + context.data.word(23) = 0; + context.data.word(25) = 11; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(40) = 20; + context.data.word(21) = 80; + context.data.byte(103) = 1; + context.data.byte(188) = 24; + return; +} + +static inline void useelevator2(Context & context) { + context._cmp(context.data.byte(9), 23); + if (context.flags.z()) goto inpoolhall; + showfirstuse(context); + context.data.byte(188) = 23; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +inpoolhall: + showfirstuse(context); + context.data.byte(188) = 31; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +} + +static inline void useelevator5(Context & context) { + context.al = 4; + placesetobject(context); + context.al = 0; + removesetobject(context); + context.data.byte(188) = 20; + context.data.word(21) = 80; + context.data.byte(35) = 1; + context.data.byte(40) = 8; + context.data.byte(103) = 1; + return; +} + +static inline void usekey(Context & context) { + context._cmp(context.data.byte(9), 5); + if (context.flags.z()) goto usekey1; + context._cmp(context.data.byte(9), 30); + if (context.flags.z()) goto usekey1; + context._cmp(context.data.byte(9), 21); + if (context.flags.z()) goto usekey2; + context.cx = 200; + context.al = 1; + showpuztext(context); + putbackobstuff(context); + return; +usekey1: + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto wrongroom1; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto wrongroom1; + context.cx = 300; + context.al = 0; + showpuztext(context); + context.data.byte(40) = 100; + context.data.byte(103) = 1; + return; +usekey2: + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto wrongroom1; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto wrongroom1; + context.cx = 300; + context.al = 3; + showpuztext(context); + context.data.byte(188) = 30; + context.al = 2; + fadescreendown(context); + showfirstuse(context); + putbackobstuff(context); + return; +wrongroom1: + context.cx = 200; + context.al = 2; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void usestereo(Context & context) { + context._cmp(context.data.byte(9), 0); + if (context.flags.z()) goto stereook; + context.cx = 400; + context.al = 4; + showpuztext(context); + putbackobstuff(context); + return; +stereook: + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto stereonotok; + context._cmp(context.data.byte(149), 0); + if (context.flags.z()) goto stereook2; +stereonotok: + context.cx = 400; + context.al = 5; + showpuztext(context); + putbackobstuff(context); + return; +stereook2: + context.al = 'C'; + context.ah = 'D'; + context.cl = 'P'; + context.ch = 'L'; + findsetobject(context); + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto cdinside; + context.al = 6; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); + getanyad(context); + context.al = 255; + context.data.byte(context.bx+10) = context.al; + return; +cdinside: + getanyad(context); + context.al = context.data.byte(context.bx+10); + context._xor(context.al, 1); + context.data.byte(context.bx+10) = context.al; + context._cmp(context.al, 255); + if (context.flags.z()) goto stereoon; + context.al = 7; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); + return; +stereoon: + context.al = 8; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void usecooker(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + checkinside(context); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto foodinside; + showfirstuse(context); + putbackobstuff(context); + return; +foodinside: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void useaxe(Context & context) { + context._cmp(context.data.byte(184), 22); + if (!context.flags.z()) goto notinpool; + context._cmp(context.data.byte(149), 10); + if (context.flags.z()) goto axeondoor; + showseconduse(context); + context._add(context.data.byte(2), 1); + context.data.byte(65) = 2; + context.data.byte(103) = 1; + removeobfrominv(context); + return; +notinpool: + showfirstuse(context); + return; +/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ +axeondoor: + context.al = 15; + context.cx = 300; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; + return; +} + +static inline void useelvdoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotdoorwith; + withwhat(context); + return; +gotdoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto axeondoor; + context.al = 14; + context.cx = 300; + showpuztext(context); + putbackobstuff(context); + return; +axeondoor: + context.al = 15; + context.cx = 300; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void withwhat(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.es = context.cs; + context.di = 5674; + copyname(context); + context.di = 100; + context.bx = 21; + context.dl = 200; + context.al = 63; + context.ah = 2; + printmessage2(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 21; + context.es = context.cs; + context.si = 5674; + context.dl = 220; + context.al = 0; + context.ah = 0; + printdirect(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 21; + context.dl = 200; + context.al = 63; + context.ah = 3; + printmessage2(context); + fillryan(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(104) = 2; + return; +} + +static inline void selectob(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (!context.flags.z()) goto canselectob; + blank(context); + return; +canselectob: + context.data.byte(95) = context.al; + context.data.byte(96) = context.ah; + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto diffsub3; + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadyselob; + context.data.byte(100) = 221; +diffsub3: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 0; + commandwithob(context); +alreadyselob: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notselob; + context._and(context.ax, 1); + if (!context.flags.z()) goto doselob; +notselob: + return; +doselob: + delpointer(context); + context.data.byte(104) = 0; + useroutine(context); + return; +} + +static inline void findsetobject(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(428); + context.bx = 0; + context.dl = 0; +findsetloop: + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofind; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofind; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofind; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofind; + context.al = context.dl; + return; +nofind: + context._add(context.bx, 64); + context._add(context.dl, 1); + context._cmp(context.dl, 128); + if (!context.flags.z()) goto findsetloop; + context.al = context.dl; + return; +} + +static inline void checkinside(Context & context) { + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.cl = 0; +insideloop: + context._cmp(context.al, context.data.byte(context.bx+3)); + if (!context.flags.z()) goto notfoundinside; + context._cmp(context.ah, context.data.byte(context.bx+2)); + if (!context.flags.z()) goto notfoundinside; + return; +notfoundinside: + context._add(context.bx, 16); + context._add(context.cl, 1); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto insideloop; + return; +} + +static inline void usetext(Context & context) { + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 36; + context.bx = 104; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + return; +} + +static inline void showpuztext(Context & context) { + context.push(context.cx); + findpuztext(context); + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 36; + context.bx = 104; + context.dl = 241; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = context.pop(); + hangonp(context); + return; +} + +static inline void issetobonmap(Context & context) { + context.push(context.es); + context.push(context.bx); + getsetad(context); + context.al = context.data.byte(context.bx+58); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.al, 0); + return; +} + +static inline void setuptimedtemp(Context & context) { + context._cmp(context.data.word(328), 0); + if (!context.flags.z()) goto cantsetup2; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; + context._add(context.dx, context.cx); + context.data.word(328) = context.dx; + context.bl = context.al; + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.cx = 66*2; + context.ax = context.data.word(context.bx); + context._add(context.ax, context.cx); + context.bx = context.ax; + context.data.word(332) = context.es; + context.data.word(334) = context.bx; +cantsetup2: + return; +} + +static inline void edenscdplayer(Context & context) { + showfirstuse(context); + context.data.word(21) = 18*2; + context.data.word(23) = 25; + context.data.word(25) = 42; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static inline void usewall(Context & context) { + showfirstuse(context); + context._cmp(context.data.byte(475), 3); + if (context.flags.z()) goto gobackover; + context.data.word(21) = 30*2; + context.data.word(23) = 2; + context.data.word(25) = 31; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = 3; + turnpathon(context); + context.al = 4; + turnpathon(context); + context.al = 0; + turnpathoff(context); + context.al = 1; + turnpathoff(context); + context.al = 2; + turnpathoff(context); + context.al = 5; + turnpathoff(context); + context.data.byte(475) = 3; + context.data.byte(477) = 3; + findxyfrompath(context); + context.data.byte(187) = 1; + switchryanoff(context); + return; +gobackover: + context.data.word(21) = 30*2; + context.data.word(23) = 34; + context.data.word(25) = 60; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = 3; + turnpathoff(context); + context.al = 4; + turnpathoff(context); + context.al = 0; + turnpathon(context); + context.al = 1; + turnpathon(context); + context.al = 2; + turnpathon(context); + context.al = 5; + turnpathon(context); + context.data.byte(475) = 5; + context.data.byte(477) = 5; + findxyfrompath(context); + context.data.byte(187) = 1; + switchryanoff(context); + return; +} + +static inline void usechurchgate(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gatewith; + withwhat(context); + return; +gatewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'T'; + context.dh = 'T'; + compare(context); + if (context.flags.z()) goto cutgate; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +cutgate: + showfirstuse(context); + context.data.word(21) = 64*2; + context.data.word(23) = 4; + context.data.word(25) = 70; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.al = 3; + turnpathon(context); + context._cmp(context.data.byte(44), 0); + if (context.flags.z()) goto notopenchurch; + context.al = 2; + turnpathon(context); +notopenchurch: + return; +} + +static inline void usegun(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto istakengun; + showseconduse(context); + putbackobstuff(context); + return; +istakengun: + context._cmp(context.data.byte(184), 22); + if (!context.flags.z()) goto notinpoolroom; + context.cx = 300; + context.al = 34; + showpuztext(context); + context.data.byte(65) = 1; + context.data.byte(64) = 39; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notinpoolroom: + context._cmp(context.data.byte(184), 25); + if (!context.flags.z()) goto nothelicopter; + context.cx = 300; + context.al = 34; + showpuztext(context); + context.data.byte(65) = 1; + context.data.byte(64) = 19; + context.data.byte(103) = 1; + context.data.byte(66) = 2; + context.data.byte(67) = 38; + context.data.byte(43) = 1; + context._add(context.data.byte(2), 1); + return; +nothelicopter: + context._cmp(context.data.byte(184), 27); + if (!context.flags.z()) goto notinrockroom; + context.cx = 300; + context.al = 46; + showpuztext(context); + context.data.byte(234) = 2; + context.data.byte(41) = 1; + context.data.byte(65) = 1; + context.data.byte(34) = 1; + context.data.byte(103) = 1; + context.data.byte(67) = 32; + context.data.byte(66) = 0; + context._add(context.data.byte(2), 1); + return; +notinrockroom: + context._cmp(context.data.byte(184), 8); + if (!context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(149), 40); + if (!context.flags.z()) goto notbystudio; + context.al = 92; + issetobonmap(context); + if (context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(475), 9); + if (context.flags.z()) goto notbystudio; + context.data.byte(478) = 9; + context.data.byte(477) = 9; + autosetwalk(context); + context.data.byte(65) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notbystudio: + context._cmp(context.data.byte(184), 6); + if (!context.flags.z()) goto notsarters; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto notsarters; + context._cmp(context.data.byte(149), 20); + if (!context.flags.z()) goto notsarters; + context.al = 5; + issetobonmap(context); + if (!context.flags.z()) goto notsarters; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + autosetwalk(context); + context.al = 5; + removesetobject(context); + context.al = 6; + placesetobject(context); + context.al = 1; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); + context.data.byte(35) = 1; + context.data.word(21) = 40*2; + context.data.word(23) = 4; + context.data.word(25) = 43; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notsarters: + context._cmp(context.data.byte(184), 29); + if (!context.flags.z()) goto notaide; + context.data.byte(103) = 1; + context.al = 13; + resetlocation(context); + context.al = 12; + setlocation(context); + context.data.byte(183) = 12; + context.data.byte(478) = 2; + context.data.byte(477) = 2; + autosetwalk(context); + context.data.word(21) = 164*2; + context.data.word(23) = 3; + context.data.word(25) = 164; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(44) = 1; + context.data.byte(66) = 3; + context.data.byte(67) = 33; + context._add(context.data.byte(2), 1); + return; +notaide: + context._cmp(context.data.byte(184), 23); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(148), 0); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(149), 50); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(475), 5); + if (context.flags.z()) goto pathokboss; + context.data.byte(478) = 5; + context.data.byte(477) = 5; + autosetwalk(context); +pathokboss: + context.data.byte(65) = 1; + context.data.byte(103) = 1; + return; +notwithboss: + context._cmp(context.data.byte(184), 8); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(475), 2); + if (context.flags.z()) goto pathoktv; + context.data.byte(478) = 2; + context.data.byte(477) = 2; + autosetwalk(context); +pathoktv: + context.data.byte(65) = 1; + context.data.byte(103) = 1; + return; +nottvsoldier: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void useshield(Context & context) { + context._cmp(context.data.byte(184), 20); + if (!context.flags.z()) goto notinsartroom; + context._cmp(context.data.byte(64), 0); + if (context.flags.z()) goto notinsartroom; + context.data.byte(65) = 3; + showseconduse(context); + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + removeobfrominv(context); + return; +notinsartroom: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void usebuttona(Context & context) { + context.al = 95; + issetobonmap(context); + if (context.flags.z()) goto donethisbit; + showfirstuse(context); + context.al = 0; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); + context.al = 9; + removesetobject(context); + context.al = 95; + placesetobject(context); + context.data.word(21) = 15*2; + context.data.word(23) = 71; + context.data.word(25) = 85; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +donethisbit: + showseconduse(context); + putbackobstuff(context); + return; +} + +static inline void useplate(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto platewith; + withwhat(context); + return; +platewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'S'; + context.ch = 'C'; + context.dl = 'R'; + context.dh = 'W'; + compare(context); + if (context.flags.z()) goto unscrewplate; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto triedknife; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +unscrewplate: + context.al = 20; + playchannel1(context); + showfirstuse(context); + context.al = 28; + placesetobject(context); + context.al = 24; + placesetobject(context); + context.al = 25; + removesetobject(context); + context.al = 0; + placefreeobject(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +triedknife: + context.cx = 300; + context.al = 54; + showpuztext(context); + putbackobstuff(context); + return; +} + +static inline void usewinch(Context & context) { + context.al = 40; + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (context.flags.z()) goto nowinch; + context.al = context.cl; + context.ah = 4; + context.cl = 'F'; + context.ch = 'U'; + context.dl = 'S'; + context.dh = 'E'; + compare(context); + if (!context.flags.z()) goto nowinch; + context.data.word(21) = 217*2; + context.data.word(23) = 0; + context.data.word(25) = 217; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(183) = 1; + context.data.byte(188) = 45; + context.data.byte(66) = 1; + context.data.byte(67) = 44; + context.data.byte(42) = 1; + context.data.byte(34) = 2; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +nowinch: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static inline void entercode(Context & context) { + context.data.word(284) = context.ax; + context.data.word(286) = context.cx; + getridofreels(context); + loadkeypad(context); + createpanel(context); + showicon(context); + showouterpad(context); + showkeypad(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.word(280) = 0; + context.data.byte(103) = 0; +keypadloop: + delpointer(context); + readmouse(context); + showkeypad(context); + showpointer(context); + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nopresses; + context._sub(context.data.byte(282), 1); + goto afterpress; +nopresses: + context.data.byte(278) = 255; + context.data.byte(281) = 255; + vsync(context); +afterpress: + dumppointer(context); + dumpkeypad(context); + dumptextline(context); + context.bx = 3393; + checkcoords(context); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto numberright; + context._cmp(context.data.byte(287), 1); + if (!context.flags.z()) goto notendkey; + context._cmp(context.data.byte(37), 0); + if (context.flags.z()) goto numberright; + goto keypadloop; +notendkey: + context._cmp(context.data.byte(282), 40); + if (!context.flags.z()) goto keypadloop; + addtopresslist(context); + context._cmp(context.data.byte(278), 11); + if (!context.flags.z()) goto keypadloop; + context.ax = context.data.word(284); + context.cx = context.data.word(286); + isitright(context); + if (!context.flags.z()) goto incorrect; + context.data.byte(37) = 0; + context.al = 11; + playchannel1(context); + context.data.byte(287) = 120; + context.data.word(280) = 0; + goto keypadloop; +incorrect: + context.al = 11; + playchannel1(context); + context.data.byte(287) = 120; + context.data.word(280) = 0; + goto keypadloop; +numberright: + context.data.byte(131) = 0; + getridoftemp(context); + restorereels(context); + redrawmainscrn(context); + worktoscreenm(context); + return; +} + +static inline void quitkey(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyqk; + context.data.byte(100) = 222; + context.al = 4; + commandonly(context); +alreadyqk: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notqk; + context._and(context.ax, 1); + if (!context.flags.z()) goto doqk; +notqk: + return; +doqk: + context.data.byte(103) = 1; + return; +} + +static inline void addtopresslist(Context & context) { + context._cmp(context.data.word(280), 5); + if (context.flags.z()) goto nomorekeys; + context.al = context.data.byte(278); + context._cmp(context.al, 10); + if (!context.flags.z()) goto not10; + context.al = 0; +not10: + context.bx = context.data.word(280); + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 8350); + context.data.byte(context.bx) = context.al; + context._add(context.data.word(280), 1); +nomorekeys: + return; +} + +static inline void buttonone(Context & context) { + context.cl = 1; + buttonpress(context); + return; +} + +static inline void buttontwo(Context & context) { + context.cl = 2; + buttonpress(context); + return; +} + +static inline void buttonthree(Context & context) { + context.cl = 3; + buttonpress(context); + return; +} + +static inline void buttonfour(Context & context) { + context.cl = 4; + buttonpress(context); + return; +} + +static inline void buttonfive(Context & context) { + context.cl = 5; + buttonpress(context); + return; +} + +static inline void buttonsix(Context & context) { + context.cl = 6; + buttonpress(context); + return; +} + +static inline void buttonseven(Context & context) { + context.cl = 7; + buttonpress(context); + return; +} + +static inline void buttoneight(Context & context) { + context.cl = 8; + buttonpress(context); + return; +} + +static inline void buttonnine(Context & context) { + context.cl = 9; + buttonpress(context); + return; +} + +static inline void buttonnought(Context & context) { + context.cl = 10; + buttonpress(context); + return; +} + +static inline void buttonenter(Context & context) { + context.cl = 11; + buttonpress(context); + return; +} + +static inline void buttonpress(Context & context) { + context.ch = context.cl; + context._add(context.ch, 100); + context._cmp(context.data.byte(100), context.ch); + if (context.flags.z()) goto alreadyb; + context.data.byte(100) = context.ch; + context.al = context.cl; + context._add(context.al, 4); + context.push(context.cx); + commandonly(context); + context.cx = context.pop(); +alreadyb: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notb; + context._and(context.ax, 1); + if (!context.flags.z()) goto dob; +notb: + return; +dob: + context.data.byte(278) = context.cl; + context._add(context.cl, 21); + context.data.byte(281) = context.cl; + context.data.byte(282) = 40; + context._cmp(context.cl, 32); + if (context.flags.z()) goto nonoise; + context.al = 10; + playchannel1(context); +nonoise: + return; +} + +static inline void showouterpad(Context & context) { + context.di = 36+112-3; + context.bx = 72-4; + context.ds = context.data.word(458); + context.al = 1; + context.ah = 0; + showframe(context); + context.di = 36+112+74; + context.bx = 72+76; + context.ds = context.data.word(458); + context.al = 37; + context.ah = 0; + showframe(context); + return; +} + +static inline void showkeypad(Context & context) { + context.al = 22; + context.di = 36+112+9; + context.bx = 72+5; + singlekey(context); + context.al = 23; + context.di = 36+112+31; + context.bx = 72+5; + singlekey(context); + context.al = 24; + context.di = 36+112+53; + context.bx = 72+5; + singlekey(context); + context.al = 25; + context.di = 36+112+9; + context.bx = 72+23; + singlekey(context); + context.al = 26; + context.di = 36+112+31; + context.bx = 72+23; + singlekey(context); + context.al = 27; + context.di = 36+112+53; + context.bx = 72+23; + singlekey(context); + context.al = 28; + context.di = 36+112+9; + context.bx = 72+41; + singlekey(context); + context.al = 29; + context.di = 36+112+31; + context.bx = 72+41; + singlekey(context); + context.al = 30; + context.di = 36+112+53; + context.bx = 72+41; + singlekey(context); + context.al = 31; + context.di = 36+112+9; + context.bx = 72+59; + singlekey(context); + context.al = 32; + context.di = 36+112+31; + context.bx = 72+59; + singlekey(context); + context._cmp(context.data.byte(287), 0); + if (context.flags.z()) goto notenter; + context._sub(context.data.byte(287), 1); + context.al = 36; + context.bx = 72-1+63; + context._cmp(context.data.byte(37), 0); + if (!context.flags.z()) goto changelight; + context.al = 41; + context.bx = 72+4+63; +changelight: + context._cmp(context.data.byte(287), 60); + if (context.flags.c()) goto gotlight; + context._cmp(context.data.byte(287), 100); + if (!context.flags.c()) goto gotlight; + context._sub(context.al, 1); +gotlight: + context.ds = context.data.word(458); + context.ah = 0; + context.di = 36+112+60; + showframe(context); +notenter: + return; +} + +static inline void singlekey(Context & context) { + context._cmp(context.data.byte(281), context.al); + if (!context.flags.z()) goto gotkey; + context._add(context.al, 11); + context._cmp(context.data.byte(282), 8); + if (!context.flags.c()) goto gotkey; + context._sub(context.al, 11); +gotkey: + context.ds = context.data.word(458); + context._sub(context.al, 20); + context.ah = 0; + showframe(context); + return; +} + +static inline void dumpkeypad(Context & context) { + context.di = 36+112-3; + context.bx = 72-4; + context.cl = 120; + context.ch = 90; + multidump(context); + return; +} + +static inline void usemenu(Context & context) { + getridofreels(context); + loadmenu(context); + createpanel(context); + showpanel(context); + showicon(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + context.al = 4; + context.ah = 0; + context.di = 80+40-48; + context.bx = 60-4; + context.ds = context.data.word(460); + showframe(context); + getundermenu(context); + context.al = 5; + context.ah = 0; + context.di = 80+40+54; + context.bx = 60+72; + context.ds = context.data.word(460); + showframe(context); + worktoscreenm(context); + context.data.byte(103) = 0; +menuloop: + delpointer(context); + putundermenu(context); + showmenu(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumpmenu(context); + dumptextline(context); + context.bx = 3525; + checkcoords(context); + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto menuloop; + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + getridoftemp2(context); + restorereels(context); + worktoscreenm(context); + return; +menulist: + return; +} + +static inline void dumpmenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + multidump(context); + return; +} + +static inline void getundermenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static inline void putundermenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static inline void showoutermenu(Context & context) { + context.al = 40; + context.ah = 0; + context.di = 80+40-34; + context.bx = 60-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 41; + context.ah = 0; + context.di = 80+40+64-34; + context.bx = 60-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 42; + context.ah = 0; + context.di = 80+40-26; + context.bx = 60+57-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 43; + context.ah = 0; + context.di = 80+40+64-26; + context.bx = 60+57-40; + context.ds = context.data.word(458); + showframe(context); + return; +} + +static inline void showmenu(Context & context) { + context._add(context.data.byte(290), 1); + context._cmp(context.data.byte(290), 37*2); + if (!context.flags.z()) goto menuframeok; + context.data.byte(290) = 0; +menuframeok: + context.al = context.data.byte(290); + context._shr(context.al, 1); + context.ah = 0; + context.di = 80+40; + context.bx = 60; + context.ds = context.data.word(458); + showframe(context); + return; +} + +static inline void loadmenu(Context & context) { + context.dx = 1845; + loadintotemp(context); + context.dx = 2000; + loadintotemp2(context); + return; +} + +static inline void viewfolder(Context & context) { + context.data.byte(131) = 1; + getridofall(context); + loadfolder(context); + context.data.byte(288) = 0; + showfolder(context); + worktoscreenm(context); + context.data.byte(103) = 0; +folderloop: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3547; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto folderloop; + context.data.byte(131) = 0; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + getridoftempcharset(context); + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); + return; +} + +static inline void nextfolder(Context & context) { + context._cmp(context.data.byte(288), 12); + if (!context.flags.z()) goto cannextf; + blank(context); + return; +cannextf: + context._cmp(context.data.byte(100), 201); + if (context.flags.z()) goto alreadynextf; + context.data.byte(100) = 201; + context.al = 16; + commandonly(context); +alreadynextf: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notnextf; + context._cmp(context.ax, 1); + if (context.flags.z()) goto donextf; +notnextf: + return; +donextf: + context._add(context.data.byte(288), 1); + folderhints(context); + delpointer(context); + showfolder(context); + context.data.word(202) = 0; + context.bx = 3547; + checkcoords(context); + worktoscreenm(context); + return; +} + +static inline void folderhints(Context & context) { + context._cmp(context.data.byte(288), 5); + if (!context.flags.z()) goto notaideadd; + context._cmp(context.data.byte(44), 1); + if (context.flags.z()) goto notaideadd; + context.al = 13; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notaideadd; + context.al = 13; + setlocation(context); + showfolder(context); + context.al = 30; + findtext1(context); + context.di = 0; + context.bx = 86; + context.dl = 141; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); + return; +notaideadd: + context._cmp(context.data.byte(288), 9); + if (!context.flags.z()) goto notaristoadd; + context.al = 7; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notaristoadd; + context.al = 7; + setlocation(context); + showfolder(context); + context.al = 31; + findtext1(context); + context.di = 0; + context.bx = 86; + context.dl = 141; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); +notaristoadd: + return; +} + +static inline void lastfolder(Context & context) { + context._cmp(context.data.byte(288), 0); + if (!context.flags.z()) goto canlastf; + blank(context); + return; +canlastf: + context._cmp(context.data.byte(100), 202); + if (context.flags.z()) goto alreadylastf; + context.data.byte(100) = 202; + context.al = 17; + commandonly(context); +alreadylastf: + context._cmp(context.data.byte(288), 0); + if (context.flags.z()) goto notlastf; + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notlastf; + context._cmp(context.ax, 1); + if (context.flags.z()) goto dolastf; +notlastf: + return; +dolastf: + context._sub(context.data.byte(288), 1); + delpointer(context); + showfolder(context); + context.data.word(202) = 0; + context.bx = 3547; + checkcoords(context); + worktoscreenm(context); + return; +} + +static inline void loadfolder(Context & context) { + context.dx = 2312; + loadintotemp(context); + context.dx = 2325; + loadintotemp2(context); + context.dx = 2338; + loadintotemp3(context); + context.dx = 1896; + loadtempcharset(context); + context.dx = 2208; + loadtemptext(context); + return; +} + +static inline void showfolder(Context & context) { + context.data.byte(100) = 255; + context._cmp(context.data.byte(288), 0); + if (context.flags.z()) goto closedfolder; + usetempcharset(context); + createpanel2(context); + context.ds = context.data.word(458); + context.di = 0; + context.bx = 0; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 143; + context.bx = 0; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 0; + context.bx = 92; + context.al = 2; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 143; + context.bx = 92; + context.al = 3; + context.ah = 0; + showframe(context); + folderexit(context); + context._cmp(context.data.byte(288), 1); + if (context.flags.z()) goto noleftpage; + showleftpage(context); +noleftpage: + context._cmp(context.data.byte(288), 12); + if (context.flags.z()) goto norightpage; + showrightpage(context); +norightpage: + usecharset1(context); + undertextline(context); + return; +closedfolder: + createpanel2(context); + context.ds = context.data.word(462); + context.di = 143-28; + context.bx = 0; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(462); + context.di = 143-28; + context.bx = 92; + context.al = 1; + context.ah = 0; + showframe(context); + folderexit(context); + undertextline(context); + return; +} + +static inline void folderexit(Context & context) { + context.ds = context.data.word(460); + context.di = 296; + context.bx = 178; + context.al = 6; + context.ah = 0; + showframe(context); + return; +} + +static inline void showleftpage(Context & context) { + context.ds = context.data.word(460); + context.di = 0; + context.bx = 12; + context.al = 3; + context.ah = 0; + showframe(context); + context.bx = 12+5; + context.cx = 9; +leftpageloop: + context.push(context.cx); + context.push(context.bx); + context.ds = context.data.word(460); + context.di = 0; + context.al = 4; + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 16); + if (--context.cx) goto leftpageloop; + context.ds = context.data.word(460); + context.di = 0; + context.al = 5; + context.ah = 0; + showframe(context); + context.data.word(77) = 8; + context.data.word(71) = 91; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); + context._sub(context.bl, 1); + context._sub(context.bl, 1); + context._add(context.bl, context.bl); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + context.di = 2; + context.bx = 48; + context.dl = 140; + context.cx = 2; +twolotsleft: + context.push(context.cx); +contleftpage: + printdirect(context); + context._add(context.bx, context.data.word(77)); + context._cmp(context.al, 0); + if (!context.flags.z()) goto contleftpage; + context.cx = context.pop(); + if (--context.cx) goto twolotsleft; + context.data.byte(72) = 0; + context.data.word(71) = 0; + context.data.word(77) = 10; + context.es = context.data.word(400); + context.ds = context.data.word(400); + context.di = (48*320)+2; + context.si = (48*320)+2+130; + context.cx = 120; +flipfolder: + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.cx = 65; +flipfolderline: + context.al = context.data.byte(context.di); + context.ah = context.data.byte(context.si); + context.data.byte(context.di) = context.ah; + context.data.byte(context.si) = context.al; + context._sub(context.si, 1); + context._add(context.di, 1); + if (--context.cx) goto flipfolderline; + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.si, 320); + context._add(context.di, 320); + if (--context.cx) goto flipfolder; + return; +} + +static inline void showrightpage(Context & context) { + context.ds = context.data.word(460); + context.di = 143; + context.bx = 12; + context.al = 0; + context.ah = 0; + showframe(context); + context.bx = 12+37; + context.cx = 7; +rightpageloop: + context.push(context.cx); + context.push(context.bx); + context.ds = context.data.word(460); + context.di = 143; + context.al = 1; + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 16); + if (--context.cx) goto rightpageloop; + context.ds = context.data.word(460); + context.di = 143; + context.al = 2; + context.ah = 0; + showframe(context); + context.data.word(77) = 8; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); + context._sub(context.bl, 1); + context._add(context.bl, context.bl); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + context.di = 152; + context.bx = 48; + context.dl = 140; + context.cx = 2; +twolotsright: + context.push(context.cx); +contrightpage: + printdirect(context); + context._add(context.bx, context.data.word(77)); + context._cmp(context.al, 0); + if (!context.flags.z()) goto contrightpage; + context.cx = context.pop(); + if (--context.cx) goto twolotsright; + context.data.byte(72) = 0; + context.data.word(77) = 10; + return; +} + +static inline void entersymbol(Context & context) { + context.data.byte(131) = 1; + getridofreels(context); + context.dx = 2351; + loadintotemp(context); + context.data.byte(291) = 24; + context.data.byte(293) = 0; + context.data.byte(294) = 24; + context.data.byte(296) = 0; + redrawmainscrn(context); + showsymbol(context); + undertextline(context); + worktoscreenm(context); + context.data.byte(103) = 0; +symbolloop: + delpointer(context); + updatesymboltop(context); + updatesymbolbot(context); + showsymbol(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + dumpsymbol(context); + context.bx = 3589; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto symbolloop; + context._cmp(context.data.byte(295), 3); + if (!context.flags.z()) goto symbolwrong; + context._cmp(context.data.byte(292), 5); + if (!context.flags.z()) goto symbolwrong; + context.al = 43; + removesetobject(context); + context.al = 46; + placesetobject(context); + context.ah = context.data.byte(185); + context._add(context.ah, 12); + context.al = 0; + turnanypathon(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + restorereels(context); + worktoscreenm(context); + context.al = 13; + playchannel1(context); + return; +symbolwrong: + context.al = 46; + removesetobject(context); + context.al = 43; + placesetobject(context); + context.ah = context.data.byte(185); + context._add(context.ah, 12); + context.al = 0; + turnanypathoff(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + restorereels(context); + worktoscreenm(context); + return; +} + +static inline void quitsymbol(Context & context) { + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyqs; + context.data.byte(100) = 222; + context.al = 18; + commandonly(context); +alreadyqs: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notqs; + context._and(context.ax, 1); + if (!context.flags.z()) goto doqs; +notqs: + return; +doqs: + context.data.byte(103) = 1; + return; +} + +static inline void settopleft(Context & context) { + context._cmp(context.data.byte(293), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 210); + if (context.flags.z()) goto alreadytopl; + context.data.byte(100) = 210; + context.al = 19; + commandonly(context); +alreadytopl: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notopleft; + context.data.byte(293) = -1; +notopleft: + return; +} + +static inline void settopright(Context & context) { + context._cmp(context.data.byte(293), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 211); + if (context.flags.z()) goto alreadytopr; + context.data.byte(100) = 211; + context.al = 20; + commandonly(context); +alreadytopr: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notopright; + context.data.byte(293) = 1; +notopright: + return; +} + +static inline void setbotleft(Context & context) { + context._cmp(context.data.byte(296), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 212); + if (context.flags.z()) goto alreadybotl; + context.data.byte(100) = 212; + context.al = 21; + commandonly(context); +alreadybotl: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto nobotleft; + context.data.byte(296) = -1; +nobotleft: + return; +} + +static inline void setbotright(Context & context) { + context._cmp(context.data.byte(296), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 213); + if (context.flags.z()) goto alreadybotr; + context.data.byte(100) = 213; + context.al = 22; + commandonly(context); +alreadybotr: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto nobotright; + context.data.byte(296) = 1; +nobotright: + return; +} + +static inline void dumpsymbol(Context & context) { + context.data.byte(109) = 0; + context.di = 64; + context.bx = 56+20; + context.cl = 104; + context.ch = 60; + multidump(context); + return; +} + +static inline void showsymbol(Context & context) { + context.al = 12; + context.ah = 0; + context.di = 64; + context.bx = 56; + context.ds = context.data.word(458); + showframe(context); + context.al = context.data.byte(291); + context.ah = 0; + context.di = context.ax; + context._add(context.di, 64-44); + context.al = context.data.byte(292); + context.bx = 56+20; + context.ds = context.data.word(458); + context.ah = 32; + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + showframe(context); + context.al = context.data.byte(294); + context.ah = 0; + context.di = context.ax; + context._add(context.di, 64-44); + context.al = context.data.byte(295); + context._add(context.al, 6); + context.bx = 56+49; + context.ds = context.data.word(458); + context.ah = 32; + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + showframe(context); + return; +} + +static inline void nextsymbol(Context & context) { + context._add(context.al, 1); + context._cmp(context.al, 6); + if (context.flags.z()) goto topwrap; + context._cmp(context.al, 12); + if (context.flags.z()) goto botwrap; + return; +topwrap: + context.al = 0; + return; +botwrap: + context.al = 6; + return; +} + +static inline void updatesymboltop(Context & context) { + context._cmp(context.data.byte(293), 0); + if (context.flags.z()) goto topfinished; + context._cmp(context.data.byte(293), -1); + if (context.flags.z()) goto backwards; + context._add(context.data.byte(291), 1); + context._cmp(context.data.byte(291), 49); + if (!context.flags.z()) goto notwrapfor; + context.data.byte(291) = 0; + context._sub(context.data.byte(292), 1); + context._cmp(context.data.byte(292), -1); + if (!context.flags.z()) goto topfinished; + context.data.byte(292) = 5; + return; +notwrapfor: + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) goto topfinished; + context.data.byte(293) = 0; + return; +backwards: + context._sub(context.data.byte(291), 1); + context._cmp(context.data.byte(291), -1); + if (!context.flags.z()) goto notwrapback; + context.data.byte(291) = 48; + context._add(context.data.byte(292), 1); + context._cmp(context.data.byte(292), 6); + if (!context.flags.z()) goto topfinished; + context.data.byte(292) = 0; + return; +notwrapback: + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) goto topfinished; + context.data.byte(293) = 0; +topfinished: + return; +} + +static inline void updatesymbolbot(Context & context) { + context._cmp(context.data.byte(296), 0); + if (context.flags.z()) goto botfinished; + context._cmp(context.data.byte(296), -1); + if (context.flags.z()) goto backwardsbot; + context._add(context.data.byte(294), 1); + context._cmp(context.data.byte(294), 49); + if (!context.flags.z()) goto notwrapforb; + context.data.byte(294) = 0; + context._sub(context.data.byte(295), 1); + context._cmp(context.data.byte(295), -1); + if (!context.flags.z()) goto botfinished; + context.data.byte(295) = 5; + return; +notwrapforb: + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) goto botfinished; + context.data.byte(296) = 0; + return; +backwardsbot: + context._sub(context.data.byte(294), 1); + context._cmp(context.data.byte(294), -1); + if (!context.flags.z()) goto notwrapbackb; + context.data.byte(294) = 48; + context._add(context.data.byte(295), 1); + context._cmp(context.data.byte(295), 6); + if (!context.flags.z()) goto botfinished; + context.data.byte(295) = 0; + return; +notwrapbackb: + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) goto botfinished; + context.data.byte(296) = 0; +botfinished: + return; +} + +static inline void dumpsymbox(Context & context) { + context._cmp(context.data.word(303), -1); + if (context.flags.z()) goto nodumpsym; + context.di = context.data.word(303); + context.bx = context.data.word(305); + context.cl = 30; + context.ch = 77; + multidump(context); + context.data.word(303) = -1; +nodumpsym: + return; +} + +static inline void usediary(Context & context) { + getridofreels(context); + context.dx = 2052; + loadintotemp(context); + context.dx = 2221; + loadtemptext(context); + context.dx = 1896; + loadtempcharset(context); + createpanel(context); + showicon(context); + showdiary(context); + undertextline(context); + showdiarypage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(103) = 0; +diaryloop: + delpointer(context); + readmouse(context); + showdiarykeys(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumpdiarykeys(context); + dumptextline(context); + context.bx = 3651; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto diaryloop; + getridoftemp(context); + getridoftemptext(context); + getridoftempcharset(context); + restorereels(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + worktoscreenm(context); + return; +diarylist: + return; +} + +static inline void showdiary(Context & context) { + context.al = 1; + context.ah = 0; + context.di = 68+24; + context.bx = 48+12+37; + context.ds = context.data.word(458); + showframe(context); + context.al = 2; + context.ah = 0; + context.di = 68+24+176; + context.bx = 48+12+108; + context.ds = context.data.word(458); + showframe(context); + return; +} + +static inline void showdiarykeys(Context & context) { + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nokeyatall; + context._sub(context.data.byte(282), 1); + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nokeyatall; + context._cmp(context.data.byte(278), 'N'); + if (!context.flags.z()) goto nokeyn; + context.al = 3; + context._cmp(context.data.byte(282), 1); + if (context.flags.z()) goto gotkeyn; + context.al = 4; +gotkeyn: + context.ah = 0; + context.di = 68+24+94; + context.bx = 48+12+97; + context.ds = context.data.word(458); + showframe(context); + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notshown; + showdiarypage(context); +notshown: + return; +nokeyn: + context.al = 5; + context._cmp(context.data.byte(282), 1); + if (context.flags.z()) goto gotkeyp; + context.al = 6; +gotkeyp: + context.ah = 0; + context.di = 68+24+151; + context.bx = 48+12+71; + context.ds = context.data.word(458); + showframe(context); + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notshowp; + showdiarypage(context); +notshowp: + return; +nokeyatall: + return; +} + +static inline void dumpdiarykeys(Context & context) { + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notdumpdiary; + context._cmp(context.data.byte(43), 1); + if (context.flags.z()) goto notsartadd; + context._cmp(context.data.byte(289), 5); + if (!context.flags.z()) goto notsartadd; + context._cmp(context.data.byte(289), 5); + if (!context.flags.z()) goto notsartadd; + context.al = 6; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notsartadd; + context.al = 6; + setlocation(context); + delpointer(context); + context.al = 12; + findtext1(context); + context.di = 70; + context.bx = 106; + context.dl = 241; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); + createpanel(context); + showicon(context); + showdiary(context); + showdiarypage(context); + worktoscreenm(context); + showpointer(context); + return; +notsartadd: + context.di = 68+24+48; + context.bx = 48+12+15; + context.cl = 200; + context.ch = 16; + multidump(context); +notdumpdiary: + context.di = 68+24+94; + context.bx = 48+12+97; + context.cl = 16; + context.ch = 16; + multidump(context); + context.di = 68+24+151; + context.bx = 48+12+71; + context.cl = 16; + context.ch = 16; + multidump(context); + return; +} + +static inline void diarykeyp(Context & context) { + context._cmp(context.data.byte(100), 214); + if (context.flags.z()) goto alreadykeyp; + context.data.byte(100) = 214; + context.al = 23; + commandonly(context); +alreadykeyp: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notkeyp; + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); + if (context.flags.z()) goto notkeyp; + context._cmp(context.data.byte(282), 0); + if (!context.flags.z()) goto notkeyp; + context.al = 16; + playchannel1(context); + context.data.byte(282) = 12; + context.data.byte(278) = 'P'; + context._sub(context.data.byte(289), 1); + context._cmp(context.data.byte(289), -1); + if (!context.flags.z()) goto notkeyp; + context.data.byte(289) = 11; +notkeyp: + return; +} + +static inline void diarykeyn(Context & context) { + context._cmp(context.data.byte(100), 213); + if (context.flags.z()) goto alreadykeyn; + context.data.byte(100) = 213; + context.al = 23; + commandonly(context); +alreadykeyn: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notkeyn; + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); + if (context.flags.z()) goto notkeyn; + context._cmp(context.data.byte(282), 0); + if (!context.flags.z()) goto notkeyn; + context.al = 16; + playchannel1(context); + context.data.byte(282) = 12; + context.data.byte(278) = 'N'; + context._add(context.data.byte(289), 1); + context._cmp(context.data.byte(289), 12); + if (!context.flags.z()) goto notkeyn; + context.data.byte(289) = 0; +notkeyn: + return; +} + +static inline void showdiarypage(Context & context) { + context.al = 0; + context.ah = 0; + context.di = 68+24; + context.bx = 48+12; + context.ds = context.data.word(458); + showframe(context); + context.al = context.data.byte(289); + findtext1(context); + context.data.byte(72) = 1; + usetempcharset(context); + context.di = 68+24+48; + context.bx = 48+12+16; + context.dl = 240; + context.ah = 16; + context.data.word(71) = 91+91; + printdirect(context); + context.di = 68+24+129; + context.bx = 48+12+16; + context.dl = 240; + context.ah = 16; + printdirect(context); + context.di = 68+24+48; + context.bx = 48+12+23; + context.dl = 240; + context.ah = 16; + printdirect(context); + context.data.byte(72) = 0; + context.data.word(71) = 0; + usecharset1(context); + return; +} + +static inline void findtext1(Context & context) { + context.ah = 0; + context.si = context.ax; + context._add(context.si, context.si); + context.es = context.data.word(466); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; + return; +} + +static inline void zoomonoff(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyonoff; + context.data.byte(100) = 222; + context.al = 39; + commandonly(context); +alreadyonoff: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nozoomonoff; + context._and(context.ax, 1); + if (!context.flags.z()) goto dozoomonoff; +nozoomonoff: + return; +dozoomonoff: + context.al = context.data.byte(8); + context._xor(context.al, 1); + context.data.byte(8) = context.al; + createpanel(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + context.al = 39; + commandonly(context); + readmouse(context); + worktoscreenm(context); + return; +} + +static inline void saveload(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 253); + if (context.flags.z()) goto alreadyops; + context.data.byte(100) = 253; + context.al = 43; + commandonly(context); +alreadyops: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noops; + context._and(context.ax, 1); + if (context.flags.z()) goto noops; + dosaveload(context); +noops: + return; +} + +static inline void dosaveload(Context & context) { + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; + clearwork(context); + createpanel2(context); + undertextline(context); + getridofall(context); + loadsavebox(context); + showopbox(context); + showmainops(context); + worktoscreen(context); + goto donefirstops; +restartops: + showopbox(context); + showmainops(context); + worktoscreenm(context); +donefirstops: + context.data.byte(103) = 0; +waitops: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.bx = 3693; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto restartops; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto justret; + getridoftemp(context); + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); + context.data.byte(100) = 200; +justret: + context.data.byte(131) = 0; + return; +} + +static inline void getbackfromops(Context & context) { + context._cmp(context.data.byte(56), 2); + if (context.flags.z()) goto opsblock1; + getback1(context); + return; +opsblock1: + blank(context); + return; +} + +static inline void showmainops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+10; + context.bx = 52+10; + context.al = 8; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+59; + context.bx = 52+30; + context.al = 7; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + return; +} + +static inline void showdiscops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+10; + context.bx = 52+10; + context.al = 9; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+59; + context.bx = 52+30; + context.al = 10; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); + return; +} + +static inline void loadgame(Context & context) { + context._cmp(context.data.byte(100), 246); + if (context.flags.z()) goto alreadyload; + context.data.byte(100) = 246; + context.al = 41; + commandonly(context); +alreadyload: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noload; + context._cmp(context.ax, 1); + if (context.flags.z()) goto doload; +noload: + return; +doload: + context.data.byte(340) = 1; + showopbox(context); + showloadops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + context.data.byte(231) = 0; + worktoscreenm(context); + namestoold(context); + context.data.byte(103) = 0; +loadops: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3735; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto loadops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto quitloaded; + getridoftemp(context); + context.dx = context.ds; + context.es = context.dx; + context.bx = 7782; + startloading(context); + loadroomssample(context); + context.data.byte(74) = 1; + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + initrain(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + startup(context); + worktoscreen(context); + context.data.byte(103) = 4; +quitloaded: + return; +} + +static inline void getbacktoops(Context & context) { + context._cmp(context.data.byte(100), 201); + if (context.flags.z()) goto alreadygetops; + context.data.byte(100) = 201; + context.al = 42; + commandonly(context); +alreadygetops: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nogetbackops; + context._and(context.ax, 1); + if (!context.flags.z()) goto dogetbackops; +nogetbackops: + return; +dogetbackops: + oldtonames(context); + context.data.byte(103) = 2; + return; +} + +static inline void discops(Context & context) { + context._cmp(context.data.byte(100), 249); + if (context.flags.z()) goto alreadydiscops; + context.data.byte(100) = 249; + context.al = 43; + commandonly(context); +alreadydiscops: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodiscops; + context._and(context.ax, 1); + if (!context.flags.z()) goto dodiscops; +nodiscops: + return; +dodiscops: + scanfornames(context); + context.data.byte(340) = 2; + showopbox(context); + showdiscops(context); + context.data.byte(341) = 0; + worktoscreenm(context); + context.data.byte(103) = 0; +discopsloop: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3777; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto discopsloop; + return; +} + +static inline void savegame(Context & context) { + context._cmp(context.data.byte(56), 2); + if (!context.flags.z()) goto cansaveok; + blank(context); + return; +cansaveok: + context._cmp(context.data.byte(100), 247); + if (context.flags.z()) goto alreadysave; + context.data.byte(100) = 247; + context.al = 44; + commandonly(context); +alreadysave: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (!context.flags.z()) goto dosave; + return; +dosave: + context.data.byte(340) = 2; + showopbox(context); + showsaveops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + worktoscreenm(context); + namestoold(context); + context.data.word(394) = 0; + context.data.word(396) = 0; + context.data.byte(103) = 0; +saveops: + delpointer(context); + checkinput(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3819; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto saveops; + return; +} + +static inline void actualsave(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyactsave; + context.data.byte(100) = 222; + context.al = 44; + commandonly(context); +alreadyactsave: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noactsave; + context.dx = context.ds; + context.ds = context.dx; + context.si = 8367; + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; + context._mul(context.cx); + context._add(context.si, context.ax); + context._add(context.si, 1); + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto noactsave; + context.al = context.data.byte(9); + context.ah = 0; + context.cx = 32; + context._mul(context.cx); + context.ds = context.cs; + context.si = 5971; + context._add(context.si, context.ax); + context.di = 7782; + context.bx = context.di; + context.es = context.cs; + context.cx = 16; + while(--context.cx) context._movsw(); + context.al = context.data.byte(531); + context.data.byte(context.bx+13) = context.al; + context.al = context.data.byte(148); + context.data.byte(context.bx+15) = context.al; + context.al = context.data.byte(149); + context.data.byte(context.bx+16) = context.al; + context.al = context.data.byte(35); + context.data.byte(context.bx+20) = context.al; + context.al = context.data.byte(475); + context.data.byte(context.bx+21) = context.al; + context.al = context.data.byte(133); + context.data.byte(context.bx+22) = context.al; + context.al = 255; + context.data.byte(context.bx+27) = context.al; + saveposition(context); + getridoftemp(context); + restoreall(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + redrawmainscrn(context); + worktoscreenm(context); + context.data.byte(103) = 4; +noactsave: + return; +} + +static inline void actualload(Context & context) { + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadyactload; + context.data.byte(100) = 221; + context.al = 41; + commandonly(context); +alreadyactload: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notactload; + context._cmp(context.ax, 1); + if (!context.flags.z()) goto notactload; + context.dx = context.ds; + context.ds = context.dx; + context.si = 8367; + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; + context._mul(context.cx); + context._add(context.si, context.ax); + context._add(context.si, 1); + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto notactload; + loadposition(context); + context.data.byte(103) = 1; +notactload: + return; +} + +static inline void selectslot2(Context & context) { + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto noselslot2; + context.data.byte(340) = 2; +noselslot2: + selectslot(context); + return; +} + +static inline void checkinput(Context & context) { + context._cmp(context.data.byte(340), 3); + if (context.flags.z()) goto nokeypress; + readkey(context); + context.al = context.data.byte(142); + context._cmp(context.al, 0); + if (context.flags.z()) goto nokeypress; + context._cmp(context.al, 13); + if (!context.flags.z()) goto notret; + context.data.byte(340) = 3; + goto afterkey; +notret: + context._cmp(context.al, 8); + if (!context.flags.z()) goto nodel2; + context._cmp(context.data.byte(342), 0); + if (context.flags.z()) goto nokeypress; + getnamepos(context); + context._sub(context.data.byte(342), 1); + context.data.byte(context.bx) = 0; + context.data.byte(context.bx+1) = 1; + goto afterkey; +nodel2: +spacepress: + context._cmp(context.data.byte(342), 14); + if (context.flags.z()) goto nokeypress; + getnamepos(context); + context._add(context.data.byte(342), 1); + context.al = context.data.byte(142); + context.data.byte(context.bx+1) = context.al; + context.data.byte(context.bx+2) = 0; + context.data.byte(context.bx+3) = 1; + goto afterkey; +nokeypress: + return; +afterkey: + showopbox(context); + shownames(context); + showslots(context); + showsaveops(context); + worktoscreenm(context); + return; +} + +static inline void getnamepos(Context & context) { + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; + context._mul(context.cx); + context.dx = context.ds; + context.es = context.dx; + context.bx = 8367; + context._add(context.bx, context.ax); + context.al = context.data.byte(342); + context.ah = 0; + context._add(context.bx, context.ax); + return; +} + +static inline void showloadops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); + context.di = 60+104; + context.bx = 52+14; + context.al = 55; + context.dl = 101; + printmessage(context); + return; +} + +static inline void showsaveops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); + context.di = 60+104; + context.bx = 52+14; + context.al = 54; + context.dl = 101; + printmessage(context); + return; +} + +static inline void selectslot(Context & context) { + context._cmp(context.data.byte(100), 244); + if (context.flags.z()) goto alreadysel; + context.data.byte(100) = 244; + context.al = 45; + commandonly(context); +alreadysel: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto noselslot; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noselslot; + context._cmp(context.data.byte(340), 3); + if (!context.flags.z()) goto notnocurs; + context._sub(context.data.byte(340), 1); +notnocurs: + oldtonames(context); + context.ax = context.data.word(200); + context._sub(context.ax, 52+4); + context.cl = -1; +getslotnum: + context._add(context.cl, 1); + context._sub(context.ax, 11); + if (!context.flags.c()) goto getslotnum; + context.data.byte(341) = context.cl; + delpointer(context); + showopbox(context); + showslots(context); + shownames(context); + context._cmp(context.data.byte(340), 1); + if (context.flags.z()) goto isloadmode; + showsaveops(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +isloadmode: + showloadops(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +noselslot: + return; +} + +static inline void showslots(Context & context) { + context.di = 60+7; + context.bx = 52+8; + context.al = 2; + context.ds = context.data.word(458); + context.ah = 0; + showframe(context); + context.di = 60+10; + context.bx = 52+11; + context.cl = 0; +slotloop: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context._cmp(context.cl, context.data.byte(341)); + if (!context.flags.z()) goto nomatchslot; + context.al = 3; + context.ds = context.data.word(458); + context.ah = 0; + showframe(context); +nomatchslot: + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 7); + if (!context.flags.z()) goto slotloop; + return; +} + +static inline void shownames(Context & context) { + context.dx = context.ds; + context.es = context.dx; + context.si = 8367+1; + context.di = 60+21; + context.bx = 52+10; + context.cl = 0; +shownameloop: + context.push(context.cx); + context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.push(context.si); + context.al = 4; + context._cmp(context.cl, context.data.byte(341)); + if (!context.flags.z()) goto nomatchslot2; + context._cmp(context.data.byte(340), 2); + if (!context.flags.z()) goto loadmode; + context.dx = context.si; + context.cx = 15; + context._add(context.si, 15); +zerostill: + context._sub(context.si, 1); + context._sub(context.cl, 1); + context._cmp(context.data.byte(context.si), 1); + if (!context.flags.z()) goto foundcharacter; + goto zerostill; +foundcharacter: + context.data.byte(342) = context.cl; + context.data.byte(context.si) = '/'; + context.data.byte(context.si+1) = 0; + context.push(context.si); + context.si = context.dx; + context.dl = 200; + context.ah = 0; + printdirect(context); + context.si = context.pop(); + context.data.byte(context.si) = 0; + context.data.byte(context.si+1) = 1; + goto afterprintname; +loadmode: + context.al = 0; + context.dl = 200; + context.ah = 0; + context.data.word(71) = 91; + printdirect(context); + context.data.word(71) = 0; + goto afterprintname; +nomatchslot2: + context.dl = 200; + context.ah = 0; + printdirect(context); +afterprintname: + context.si = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.si, 17); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 7); + if (!context.flags.z()) goto shownameloop; + return; +} + +static inline void namestoold(Context & context) { + context.ds = context.cs; + context.si = 8367; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.es = context.data.word(412); + context.cx = 17*4; + while(--context.cx) context._movsb(); + return; +} + +static inline void oldtonames(Context & context) { + context.es = context.cs; + context.di = 8367; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.ds = context.data.word(412); + context.cx = 17*4; + while(--context.cx) context._movsb(); + return; +} + +static inline void makeheader(Context & context) { + context.dx = context.ds; + context.es = context.dx; + context.di = 5952; + context.ax = 17; + storeit(context); + context.ax = 68-context.data.byte(1); + storeit(context); + context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; + storeit(context); + context.ax = 250*4; + storeit(context); + context.ax = 48; + storeit(context); + context.ax = 991-context.data.byte(537); + storeit(context); + return; +} + +static inline void storeit(Context & context) { + context._cmp(context.ax, 0); + if (!context.flags.z()) goto isntblank; + context._add(context.ax, 1); +isntblank: + context._stosw(); + return; +} + +static inline void findlen(Context & context) { + context._sub(context.bx, 1); + context._add(context.bx, context.ax); +nextone: + context._cmp(context.cl, context.data.byte(context.bx)); + if (!context.flags.z()) goto foundlen; + context._sub(context.bx, 1); + context._sub(context.ax, 1); + context._cmp(context.ax, 0); + if (!context.flags.z()) goto nextone; +foundlen: + return; +} + +static inline void newgame(Context & context) { + context._cmp(context.data.byte(100), 251); + if (context.flags.z()) goto alreadynewgame; + context.data.byte(100) = 251; + context.al = 47; + commandonly(context); +alreadynewgame: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto nonewgame; + context.data.byte(103) = 3; +nonewgame: + return; +} + +static inline void doload(Context & context) { + context.data.byte(340) = 1; + showopbox(context); + showloadops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + context.data.byte(231) = 0; + worktoscreenm(context); + namestoold(context); + context.data.byte(103) = 0; +loadops: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3735; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto loadops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto quitloaded; + getridoftemp(context); + context.dx = context.ds; + context.es = context.dx; + context.bx = 7782; + startloading(context); + loadroomssample(context); + context.data.byte(74) = 1; + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + initrain(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + startup(context); + worktoscreen(context); + context.data.byte(103) = 4; +quitloaded: + return; +} + +static inline void loadold(Context & context) { + context._cmp(context.data.byte(100), 252); + if (context.flags.z()) goto alreadyloadold; + context.data.byte(100) = 252; + context.al = 48; + commandonly(context); +alreadyloadold: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noloadold; + doload(context); + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto noloadold; + showdecisions(context); + worktoscreenm(context); + context.data.byte(103) = 0; +noloadold: + return; +} + +static inline void createname(Context & context) { + context.push(context.ax); + context.di = 4932; + context.data.byte(context.di+0) = context.dl; + context.data.byte(context.di+3) = context.cl; + context.al = context.dh; + context.ah = '0'-1; +findten: + context._add(context.ah, 1); + context._sub(context.al, 10); + if (!context.flags.c()) goto findten; + context.data.byte(context.di+1) = context.ah; + context._add(context.al, 10+'0'); + context.data.byte(context.di+2) = context.al; + context.ax = context.pop(); + context.cl = '0'-1; +thousandsc: + context._add(context.cl, 1); + context._sub(context.ax, 1000); + if (!context.flags.c()) goto thousandsc; + context._add(context.ax, 1000); + context.data.byte(context.di+4) = context.cl; + context.cl = '0'-1; +hundredsc: + context._add(context.cl, 1); + context._sub(context.ax, 100); + if (!context.flags.c()) goto hundredsc; + context._add(context.ax, 100); + context.data.byte(context.di+5) = context.cl; + context.cl = '0'-1; +tensc: + context._add(context.cl, 1); + context._sub(context.ax, 10); + if (!context.flags.c()) goto tensc; + context._add(context.ax, 10); + context.data.byte(context.di+6) = context.cl; + context._add(context.al, '0'); + context.data.byte(context.di+7) = context.al; + return; +} + +static inline void makenextblock(Context & context) { + volumeadjust(context); + loopchannel0(context); + context._cmp(context.data.word(521), 0); + if (context.flags.z()) goto mightbeonlych0; + context._cmp(context.data.word(506), 0); + if (context.flags.z()) goto mightbeonlych1; + context._sub(context.data.word(506), 1); + context._sub(context.data.word(521), 1); + bothchannels(context); + return; +mightbeonlych1: + context.data.byte(507) = 255; + context._cmp(context.data.word(521), 0); + if (context.flags.z()) goto notch1only; + context._sub(context.data.word(521), 1); + channel1only(context); +notch1only: + return; +mightbeonlych0: + context.data.byte(515) = 255; + context._cmp(context.data.word(506), 0); + if (context.flags.z()) goto notch0only; + context._sub(context.data.word(506), 1); + channel0only(context); + return; +notch0only: + context.es = context.data.word(353); + context.di = context.data.word(525); + context.cx = 1024; + context.ax = 0x7f7f; + while(--context.cx) context._stosw(); + context._and(context.di, 16384-1); + context.data.word(525) = context.di; + return; +} + +static inline void volumeadjust(Context & context) { + context.al = context.data.byte(388); + context._cmp(context.al, 0); + if (context.flags.z()) goto volok; + context.al = context.data.byte(386); + context._cmp(context.al, context.data.byte(387)); + if (context.flags.z()) goto volfinish; + context._add(context.data.byte(389), 64); + if (!context.flags.z()) goto volok; + context.al = context.data.byte(386); + context._add(context.al, context.data.byte(388)); + context.data.byte(386) = context.al; + return; +volfinish: + context.data.byte(388) = 0; +volok: + return; +} + +static inline void loopchannel0(Context & context) { + context._cmp(context.data.word(506), 0); + if (!context.flags.z()) goto notloop; + context._cmp(context.data.byte(508), 0); + if (context.flags.z()) goto notloop; + context._cmp(context.data.byte(508), 255); + if (context.flags.z()) goto endlessloop; + context._sub(context.data.byte(508), 1); +endlessloop: + context.ax = context.data.word(510); + context.data.word(502) = context.ax; + context.ax = context.data.word(512); + context.data.word(504) = context.ax; + context.ax = context.data.word(506); + context._add(context.ax, context.data.word(514)); + context.data.word(506) = context.ax; + return; +notloop: + return; +} + +static inline void channel0tran(Context & context) { + context._cmp(context.data.byte(386), 0); + if (!context.flags.z()) goto lowvolumetran; + context.cx = 1024; + while(--context.cx) context._movsw(); + return; +lowvolumetran: + context.cx = 1024; + context.bh = context.data.byte(386); + context.bl = 0; + context._add(context.bx, 16384-256); +volloop: + context._lodsw(); + context.bl = context.al; + context.al = context.data.byte(context.bx); + context.bl = context.ah; + context.ah = context.data.byte(context.bx); + context._stosw(); + if (--context.cx) goto volloop; + return; +} + +static inline void domix(Context & context) { + context._cmp(context.data.byte(386), 0); + if (!context.flags.z()) goto lowvolumemix; +slow: + context._lodsb(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, context.dh); + if (!context.flags.c()) goto toplot; +botlot: + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto nodistort; + context._add(context.al, context.ah); + if (context.flags.s()) goto botok; + context._xor(context.al, context.al); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +botok: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +toplot: + context._cmp(context.ah, context.dh); + if (context.flags.c()) goto nodistort; + context._add(context.al, context.ah); + if (!context.flags.s()) goto topok; + context.al = context.dl; + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +topok: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +nodistort: + context._add(context.al, context.ah); + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +lowvolumemix: + context._lodsb(); + context.push(context.bx); + context.bh = context.data.byte(386); + context._add(context.bh, 63); + context.bl = context.al; + context.al = context.data.byte(context.bx); + context.bx = context.pop(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, context.dh); + if (!context.flags.c()) goto toplotv; +botlotv: + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto nodistortv; + context._add(context.al, context.ah); + if (context.flags.s()) goto botokv; + context._xor(context.al, context.al); + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +botokv: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +toplotv: + context._cmp(context.ah, context.dh); + if (context.flags.c()) goto nodistortv; + context._add(context.al, context.ah); + if (!context.flags.s()) goto topokv; + context.al = context.dl; + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +topokv: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +nodistortv: + context._add(context.al, context.ah); + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto lowvolumemix; +doneit: + return; +} + +static inline void seecommandtail(Context & context) { + context.data.word(372) = 0x220; + context.data.byte(378) = 5; + context.data.byte(379) = 1; + context.data.byte(73) = 0; + context.bx = 2; + context.ax = context.data.word(context.bx); + context.dx = context.es; + context._sub(context.ax, context.dx); + context.data.word(534) = context.ax; + context.bx = 0x02c; + context.ax = context.data.word(context.bx); + context.push(context.es); + context.push(context.bx); + context.es = context.ax; + context.bx = 0; +findblaster: + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0); + if (context.flags.z()) goto endofenvironment; + context._cmp(context.al, 'B'); + if (!context.flags.z()) goto notblast; + context._cmp(context.ah, 'L'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+2), 'A'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+3), 'S'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+4), 'T'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+5), 'E'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+6), 'R'); + if (!context.flags.z()) goto notblast; + context._add(context.bx, 7); + parseblaster(context); + goto endofenvironment; +notblast: + context._add(context.bx, 1); + goto findblaster; +endofenvironment: + context.bx = context.pop(); + context.es = context.pop(); + context.bx = 0x81; + parseblaster(context); + return; +} + +static inline void parseblaster(Context & context) { +lookattail: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 0); + if (context.flags.z()) goto endtail; + context._cmp(context.al, 13); + if (context.flags.z()) goto endtail; + context._cmp(context.al, 'i'); + if (context.flags.z()) goto issoundint; + context._cmp(context.al, 'I'); + if (context.flags.z()) goto issoundint; + context._cmp(context.al, 'b'); + if (context.flags.z()) goto isbright; + context._cmp(context.al, 'B'); + if (context.flags.z()) goto isbright; + context._cmp(context.al, 'a'); + if (context.flags.z()) goto isbaseadd; + context._cmp(context.al, 'A'); + if (context.flags.z()) goto isbaseadd; + context._cmp(context.al, 'n'); + if (context.flags.z()) goto isnosound; + context._cmp(context.al, 'N'); + if (context.flags.z()) goto isnosound; + context._cmp(context.al, 'd'); + if (context.flags.z()) goto isdma; + context._cmp(context.al, 'D'); + if (context.flags.z()) goto isdma; + context._add(context.bx, 1); + if (--context.cx) goto lookattail; + return; +issoundint: + context.al = context.data.byte(context.bx+1); + context._sub(context.al, '0'); + context.data.byte(378) = context.al; + context._add(context.bx, 1); + goto lookattail; +isdma: + context.al = context.data.byte(context.bx+1); + context._sub(context.al, '0'); + context.data.byte(379) = context.al; + context._add(context.bx, 1); + goto lookattail; +isbaseadd: + context.push(context.cx); + context.al = context.data.byte(context.bx+2); + context._sub(context.al, '0'); + context.ah = 0; + context.cl = 4; + context._shl(context.ax, context.cl); + context._add(context.ax, 0x200); + context.data.word(372) = context.ax; + context.cx = context.pop(); + context._add(context.bx, 1); + goto lookattail; +isbright: + context.data.byte(73) = 1; + context._add(context.bx, 1); + goto lookattail; +isnosound: + context.data.byte(378) = 255; + context._add(context.bx, 1); + goto lookattail; +endtail: + return; +} + +static inline void showbyte(Context & context) { + context.dl = context.al; + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + onedigit(context); + context.data.byte(context.di) = context.dl; + context.dl = context.al; + context._and(context.dl, 15); + onedigit(context); + context.data.byte(context.di+1) = context.dl; + context._add(context.di, 3); + return; +} + +static inline void onedigit(Context & context) { + context._cmp(context.dl, 10); + if (!context.flags.c()) goto morethan10; + context._add(context.dl, '0'); + return; +morethan10: + context._sub(context.dl, 10); + context._add(context.dl, 'A'); + return; +} + +static inline void showword(Context & context) { + context.ch = 0; + context.bx = 10000; + context.cl = 47; +word1: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word1; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di) = context.cl; + context.bx = 1000; + context.cl = 47; +word2: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word2; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+1) = context.cl; + context.bx = 100; + context.cl = 47; +word3: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word3; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+2) = context.cl; + context.bx = 10; + context.cl = 47; +word4: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word4; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+3) = context.cl; + context._add(context.al, 48); + context.cl = context.al; + convnum(context); + context.data.byte(context.di+4) = context.cl; + return; +} + +static inline void convnum(Context & context) { + context._cmp(context.ch, 0); + if (!context.flags.z()) goto noconvnum; + context._cmp(context.cl, '0'); + if (!context.flags.z()) goto notzeronum; + context.cl = 32; + goto noconvnum; +notzeronum: + context.ch = 1; +noconvnum: + return; +} + +static inline void madmanrun(Context & context) { + context._cmp(context.data.byte(9), 14); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(234), 2); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(53), 0); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(100), 211); + if (context.flags.z()) goto alreadyrun; + context.data.byte(100) = 211; + context.al = 52; + commandonly(context); +alreadyrun: + context._cmp(context.data.word(202), 1); + if (!context.flags.z()) goto norun; + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto norun; + context.data.byte(65) = 8; +norun: + return; +} + +static inline void identifyob(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); + context._cmp(context.ax, 22*8); + if (context.flags.c()) goto notover1; + blank(context); + return; +notover1: + context.bx = context.data.word(200); + context._sub(context.bx, context.data.word(119)); + context._cmp(context.bx, 20*8); + if (context.flags.c()) goto notover2; + blank(context); + return; +notover2: + context.data.byte(237) = 1; + context.ah = context.bl; + context.push(context.ax); + findpathofpoint(context); + context.data.byte(474) = context.dl; + context.ax = context.pop(); + context.push(context.ax); + findfirstpath(context); + context.data.byte(476) = context.al; + context.ax = context.pop(); + checkifex(context); + if (!context.flags.z()) goto finishidentify; + checkiffree(context); + if (!context.flags.z()) goto finishidentify; + checkifperson(context); + if (!context.flags.z()) goto finishidentify; + checkifset(context); + if (!context.flags.z()) goto finishidentify; + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); + context.cl = context.al; + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); + context.ch = context.al; + checkone(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto nothingund; + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto nothingund; + context.ah = 3; + obname(context); +finishidentify: + return; +nothingund: + blank(context); + return; +} + +static inline void checkifperson(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.cx = 12; +identifyreel: + context.push(context.cx); + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notareelid; + context.push(context.es); + context.push(context.bx); + context.push(context.ax); + context.ax = context.data.word(context.bx+0); + context.data.word(239) = context.ax; + getreelstart(context); + context._cmp(context.data.word(context.si+2), 0x0ffff); + if (!context.flags.z()) goto notblankpers; + context._add(context.si, 5); +notblankpers: + context.cx = context.data.word(context.si+2); + context.ax = context.data.word(context.si+0); + context.push(context.cx); + getreelframeax(context); + context.cx = context.pop(); + context._add(context.cl, context.data.byte(context.bx+4)); + context._add(context.ch, context.data.byte(context.bx+5)); + context.dx = context.cx; + context._add(context.dl, context.data.byte(context.bx+0)); + context._add(context.dh, context.data.byte(context.bx+1)); + context.ax = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.al, context.cl); + if (context.flags.c()) goto notareelid; + context._cmp(context.ah, context.ch); + if (context.flags.c()) goto notareelid; + context._cmp(context.al, context.dl); + if (!context.flags.c()) goto notareelid; + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto notareelid; + context.cx = context.pop(); + context.ax = context.data.word(context.bx+2); + context.data.word(249) = context.ax; + context.al = context.data.byte(context.bx+4); + context.ah = 5; + obname(context); + context.al = 0; + context._cmp(context.al, 1); + return; +notareelid: + context.cx = context.pop(); + context._add(context.bx, 5); + context._sub(context.cx, 1); + if (!context.flags.z()) goto identifyreel; + return; +} + +static inline void checkifset(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); + context.cx = 127; +identifyset: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notasetid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notasetid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notasetid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notasetid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notasetid; + pixelcheckset(context); + if (context.flags.z()) goto notasetid; + isitdescribed(context); + if (context.flags.z()) goto notasetid; + context.al = context.data.byte(context.bx+4); + context.ah = 1; + obname(context); + context.al = 0; + context._cmp(context.al, 1); + return; +notasetid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyset; + return; +} + +static inline void checkifex(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); + context.cx = 99; +identifyex: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notanexid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notanexid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notanexid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notanexid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notanexid; + context.al = context.data.byte(context.bx+4); + context.ah = 4; + obname(context); + context.al = 1; + context._cmp(context.al, 0); + return; +notanexid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyex; + return; +} + +static inline void checkiffree(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); + context.cx = 79; +identifyfree: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notafreeid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notafreeid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notafreeid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notafreeid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notafreeid; + context.al = context.data.byte(context.bx+4); + context.ah = 2; + obname(context); + context.al = 0; + context._cmp(context.al, 1); + return; +notafreeid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyfree; + return; +} + +static inline void isitdescribed(Context & context) { + context.push(context.ax); + context.push(context.cx); + context.push(context.es); + context.push(context.bx); + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(440); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(130*2)); + context.bx = context.ax; + context.dl = context.data.byte(context.bx); + context.bx = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.ax = context.pop(); + context._cmp(context.dl, 0); + return; +} + +static inline void findfirstpath(Context & context) { + context.push(context.ax); + context.bx = 0; + context.es = context.data.word(450); + context.al = context.data.byte(185); + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.cx = context.pop(); + context.dl = 0; +fpathloop: + context.ax = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nofirst; + context._cmp(context.cl, context.al); + if (context.flags.c()) goto nofirst; + context._cmp(context.ch, context.ah); + if (context.flags.c()) goto nofirst; + context.ax = context.data.word(context.bx+4); + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto nofirst; + context._cmp(context.ch, context.ah); + if (!context.flags.c()) goto nofirst; + goto gotfirst; +nofirst: + context._add(context.bx, 8); + context._add(context.dl, 1); + context._cmp(context.dl, 12); + if (!context.flags.z()) goto fpathloop; + context.al = 0; + return; +gotfirst: + context.al = context.data.byte(context.bx+6); + return; +} + +static inline void turnpathoff(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 0; + context.ch = context.data.byte(185); + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + getroomspaths(context); + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto nopathoff; + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; +nopathoff: + return; +} + +static inline void turnanypathoff(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 0; + context.ch = context.ah; + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + context.al = context.ah; + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; + return; +} + +static inline void obname(Context & context) { + context._cmp(context.data.byte(473), 0); + if (context.flags.z()) goto notnewpath; + context.data.byte(473) = 0; + goto diff; +notnewpath: + context._cmp(context.ah, context.data.byte(100)); + if (context.flags.z()) goto notdiffob; + goto diff; +notdiffob: + context._cmp(context.al, context.data.byte(99)); + if (!context.flags.z()) goto diff; + context._cmp(context.data.byte(306), 1); + if (context.flags.z()) goto walkandexamine; + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto noobselect; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto isntblock; + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto noobselect; +isntblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto wantstowalk; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto wantstowalk; + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto wantstotalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto noobselect; + examineob(context); + return; +wantstotalk: + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto noobselect; + talk(context); + return; +walkandexamine: + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto noobselect; + examineob(context); + return; +wantstowalk: + setwalk(context); + context.data.byte(473) = 1; +noobselect: + return; +diff: + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; +diff2: + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto middleofwalk; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto notblock; + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto dontcheck; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto isblock; +dontcheck: + getflagunderp(context); + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto isblock; + context._cmp(context.data.byte(153), 128); + if (!context.flags.c()) goto isblock; + goto toofaraway; +notblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto toofaraway; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto isblock; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto isaperson; + examineobtext(context); + return; +middleofwalk: + blocknametext(context); + return; +isblock: + blocknametext(context); + return; +isaperson: + personnametext(context); + return; +toofaraway: + walktotext(context); + return; +} + +static inline void commandonly(Context & context) { + context.push(context.ax); + context.push(context.bx); + context.push(context.cx); + context.push(context.dx); + context.push(context.es); + context.push(context.ds); + context.push(context.si); + context.push(context.di); + deltextline(context); + context.di = context.pop(); + context.si = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(109) = 1; + return; +} + +static inline void printmessage2(Context & context) { + context.push(context.dx); + context.push(context.bx); + context.push(context.di); + context.push(context.ax); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.ax = context.pop(); +searchmess: + context.push(context.ax); + findnextcolon(context); + context.ax = context.pop(); + context._sub(context.ah, 1); + if (!context.flags.z()) goto searchmess; + context.di = context.pop(); + context.bx = context.pop(); + context.dx = context.pop(); + context.al = 0; + context.ah = 0; + printdirect(context); + return; +} + +static inline void usetempcharset(Context & context) { + context.ax = context.data.word(406); + context.data.word(268) = context.ax; + return; +} + +static inline void blank(Context & context) { + context._cmp(context.data.byte(100), 199); + if (context.flags.z()) goto alreadyblnk; + context.data.byte(100) = 199; + context.al = 0; + commandonly(context); +alreadyblnk: + return; +} + +static inline void allpointer(Context & context) { + readmouse(context); + showpointer(context); + dumppointer(context); + return; +} + +static inline void hangoncurs(Context & context) { +monloop1: + context.push(context.cx); + printcurs(context); + vsync(context); + delcurs(context); + context.cx = context.pop(); + if (--context.cx) goto monloop1; + return; +} + +static inline void readkey(Context & context) { + context.bx = context.data.word(396); + context._cmp(context.bx, context.data.word(394)); + if (context.flags.z()) goto nokey; + context._add(context.bx, 1); + context._and(context.bx, 15); + context.data.word(396) = context.bx; + context.di = 5715; + context._add(context.di, context.bx); + context.al = context.data.byte(context.di); + context.data.byte(142) = context.al; + return; +nokey: + context.data.byte(142) = 0; + return; +} + +static inline void convertkey(Context & context) { + context._and(context.al, 127); + context.ah = 0; + context.di = 5731; + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + return; +} + +static inline void randomnum2(Context & context) { + context.push(context.ds); + context.push(context.es); + context.push(context.di); + context.push(context.bx); + context.push(context.ax); + randomnumber(context); + context.cl = context.al; + context.ax = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + return; +} + +static inline void loadtempcharset(Context & context) { + standardload(context); + context.data.word(406) = context.ax; + return; +} + +static inline void getridofall(Context & context) { + context.es = context.data.word(416); + deallocatemem(context); + context.es = context.data.word(444); + deallocatemem(context); + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); + context.es = context.data.word(450); + deallocatemem(context); + context.es = context.data.word(448); + deallocatemem(context); + context.es = context.data.word(440); + deallocatemem(context); + context.es = context.data.word(442); + deallocatemem(context); + context.es = context.data.word(436); + deallocatemem(context); + context.es = context.data.word(446); + deallocatemem(context); + context.es = context.data.word(438); + deallocatemem(context); + return; +} + +static inline void restoreall(Context & context) { + context.al = context.data.byte(9); + getroomdata(context); + context.dx = context.bx; + openfile(context); + readheader(context); + allocateload(context); + context.ds = context.ax; + context.data.word(416) = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(400); + context.dx = 0; + context.cx = 132*66; + context.al = 0; + fillspace(context); + loadseg(context); + sortoutmap(context); + allocateload(context); + context.data.word(444) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(450) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(448) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(440) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(442) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(436) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(446) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(438) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); + setallchanges(context); + return; +} + +static inline void disablepath(Context & context) { + context.push(context.cx); + context._xchg(context.al, context.ah); + context.cx = -6; +looky2: + context._add(context.cx, 6); + context._sub(context.al, 10); + if (!context.flags.c()) goto looky2; + context.al = context.ah; + context._sub(context.cx, 1); +lookx2: + context._add(context.cx, 1); + context._sub(context.al, 11); + if (!context.flags.c()) goto lookx2; + context.al = context.cl; + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; + return; +} + +static inline void getridoftempcharset(Context & context) { + context.es = context.data.word(406); + deallocatemem(context); + return; +} + +static inline void getridoftempsp(Context & context) { + context.es = context.data.word(464); + deallocatemem(context); + return; +} + +static inline void checkforemm(Context & context) { + return; +} + +static inline void trysoundalloc(Context & context) { + context._cmp(context.data.byte(358), 1); + if (context.flags.z()) goto gotsoundbuff; + context._add(context.data.byte(357), 1); + context.bx = (16384+2048)/16; + allocatemem(context); + context.data.word(353) = context.ax; + context.push(context.ax); + context.al = context.ah; + context.cl = 4; + context._shr(context.al, context.cl); + context.data.byte(356) = context.al; + context.ax = context.pop(); + context.cl = 4; + context._shl(context.ax, context.cl); + context.data.word(355) = context.ax; + context._cmp(context.ax, 0x0b7ff); + if (!context.flags.c()) goto soundfail; + context.es = context.data.word(353); + context.di = 0; + context.cx = 16384/2; + context.ax = 0x7f7f; + while(--context.cx) context._stosw(); + context.data.byte(358) = 1; + return; +soundfail: + context.es = context.data.word(353); + deallocatemem(context); +gotsoundbuff: + return; +} + +static inline void allocatework(Context & context) { + context.bx = 0x1000; + allocatemem(context); + context.data.word(400) = context.ax; + return; +} + +static inline void allocatebuffers(Context & context) { + context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; + allocatemem(context); + context.data.word(398) = context.ax; + trysoundalloc(context); + context.bx = 0+(66*60)/16; + allocatemem(context); + context.data.word(418) = context.ax; + trysoundalloc(context); + context.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-context.data.byte(537)+68-context.data.byte(1)/16; + allocatemem(context); + context.data.word(412) = context.ax; + trysoundalloc(context); + context.bx = 16*80/16; + allocatemem(context); + context.data.word(426) = context.ax; + trysoundalloc(context); + context.bx = 64*128/16; + allocatemem(context); + context.data.word(428) = context.ax; + trysoundalloc(context); + context.bx = 22*8*20*8/16; + allocatemem(context); + context.data.word(402) = context.ax; + allocatework(context); + context.bx = 2048/16; + allocatemem(context); + context.data.word(420) = context.ax; + context.bx = 2048/16; + allocatemem(context); + context.data.word(422) = context.ax; + return; +} + +static inline void clearbuffers(Context & context) { + context.es = context.data.word(412); + context.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-context.data.byte(537)+68-context.data.byte(1)/2; + context.ax = 0; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(398); + context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.ax = 0x0ffff; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(412); + context.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); + context.ds = context.cs; + context.si = 537; + context.cx = 991-context.data.byte(537); + while(--context.cx) context._movsb(); + context.es = context.data.word(412); + context.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-context.data.byte(537); + context.ds = context.cs; + context.si = 1; + context.cx = 68-context.data.byte(1); + while(--context.cx) context._movsb(); + clearchanges(context); + return; +} + +static inline void clearpalette(Context & context) { + context.data.byte(344) = 0; + clearstartpal(context); + dumpcurrent(context); + return; +} + +static inline void readsetdata(Context & context) { + context.dx = 1870; + standardload(context); + context.data.word(404) = context.ax; + context.dx = 1935; + standardload(context); + context.data.word(408) = context.ax; + context.dx = 1948; + standardload(context); + context.data.word(410) = context.ax; + context.dx = 1832; + standardload(context); + context.data.word(414) = context.ax; + context.dx = 2234; + standardload(context); + context.data.word(454) = context.ax; + context.dx = 2286; + standardload(context); + context.data.word(452) = context.ax; + context.ax = context.data.word(404); + context.data.word(268) = context.ax; + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto novolumeload; + context.dx = 2299; + openfile(context); + context.cx = 2048-256; + context.ds = context.data.word(353); + context.dx = 16384; + readfromfile(context); + closefile(context); +novolumeload: + return; +} + +static inline void loadpalfromiff(Context & context) { + context.dx = 2494; + openfile(context); + context.cx = 2000; + context.ds = context.data.word(402); + context.dx = 0; + readfromfile(context); + closefile(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.ds = context.data.word(402); + context.si = 0x30; + context.cx = 768; +palloop: + context._lodsb(); + context._shr(context.al, 1); + context._shr(context.al, 1); + context._cmp(context.data.byte(73), 1); + if (!context.flags.z()) goto nought; + context._cmp(context.al, 0); + if (context.flags.z()) goto nought; + context.ah = context.al; + context._shr(context.ah, 1); + context._add(context.al, context.ah); + context._shr(context.ah, 1); + context._add(context.al, context.ah); + context._cmp(context.al, 64); + if (context.flags.c()) goto nought; + context.al = 63; +nought: + context._stosb(); + if (--context.cx) goto palloop; + return; +} + +static inline void biblequote(Context & context) { + mode640x480(context); + context.dx = 2390; + showpcx(context); + fadescreenups(context); + context.cx = 80; + hangone(context); + context.cx = 560; + hangone(context); + fadescreendowns(context); + context.cx = 200; + hangone(context); + cancelch0(context); + return; +} + +static inline void runintroseq(Context & context) { + context.data.byte(103) = 0; +moreintroseq: + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + spriteupdate(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + deleverything(context); + printsprites(context); + reelsonscreen(context); + afterintroroom(context); + usetimedtext(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + dumpmap(context); + dumptimedtext(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto moreintroseq; + return; +earlyendrun: + context.ax = context.pop(); + context.ax = context.pop(); + getridoftemptext(context); + clearbeforeload(context); + return; +} + +static inline void intro(Context & context) { + context.dx = 2260; + loadtemptext(context); + loadpalfromiff(context); + setmode(context); + context.data.byte(188) = 50; + clearpalette(context); + loadintroroom(context); + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; + context.al = 12; + context.ah = 255; + playchannel0(context); + fadescreenups(context); + runintroseq(context); + clearbeforeload(context); + context.data.byte(188) = 52; + loadintroroom(context); + runintroseq(context); + clearbeforeload(context); + context.data.byte(188) = 53; + loadintroroom(context); + runintroseq(context); + clearbeforeload(context); + allpalette(context); + context.data.byte(188) = 54; + loadintroroom(context); + runintroseq(context); + getridoftemptext(context); + clearbeforeload(context); + return; +} + +static inline void titles(Context & context) { + clearpalette(context); + biblequote(context); + intro(context); + return; +} + +static inline void dumpcurrent(Context & context) { + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.ds = context.data.word(412); + vsync(context); + context.al = 0; + context.cx = 128; + showgroup(context); + vsync(context); + context.al = 128; + context.cx = 128; + showgroup(context); + return; +} + +static inline void allpalette(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.cx = 768/2; + while(--context.cx) context._movsw(); + dumpcurrent(context); + return; +} + +static inline void realcredits(Context & context) { + context.data.byte(531) = 33; + loadroomssample(context); + context.data.byte(386) = 0; + mode640x480(context); + context.cx = 35; + hangon(context); + context.dx = 2403; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2416; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2429; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2442; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2455; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2468; + showpcx(context); + fadescreenups(context); + context.cx = 60; + hangone(context); + context.al = 13; + context.ah = 0; + playchannel0(context); + context.cx = 350; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + return; +} + +static inline void credits(Context & context) { + clearpalette(context); + realcredits(context); + return; +} + +static inline void cls(Context & context) { + context.ax = 0x0a000; + context.es = context.ax; + context.di = 0; + context.cx = 0x7fff; + context.ax = 0; + while(--context.cx) context._stosw(); + return; +} + +static inline void loadsavebox(Context & context) { + context.dx = 1974; + loadintotemp(context); + return; +} + +static inline void showopbox(Context & context) { + context.ds = context.data.word(458); + context.di = 60; + context.bx = 52; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60; + context.bx = 52+55; + context.al = 4; + context.ah = 0; + showframe(context); + return; +} + +static inline void showdecisions(Context & context) { + createpanel2(context); + showopbox(context); + context.ds = context.data.word(458); + context.di = 60+17; + context.bx = 52+13; + context.al = 6; + context.ah = 0; + showframe(context); + undertextline(context); + return; +} + +static inline void decide(Context & context) { + setmode(context); + loadpalfromiff(context); + clearpalette(context); + context.data.byte(234) = 0; + context.data.word(21) = 0; + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; + loadsavebox(context); + showdecisions(context); + worktoscreen(context); + fadescreenup(context); + context.data.byte(103) = 0; +waitdecide: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.bx = 4884; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitdecide; + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto hasloadedroom; + getridoftemp(context); +hasloadedroom: + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + return; +} + +static inline void clearchanges(Context & context) { + context.es = context.data.word(412); + context.cx = 250*2; + context.ax = 0x0ffff; + context.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); + while(--context.cx) context._stosw(); + context.ds = context.data.word(412); + context.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); + context.es = context.cs; + context.di = 537; + context.cx = 991-context.data.byte(537); + while(--context.cx) context._movsb(); + context.ds = context.data.word(412); + context.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-context.data.byte(537); + context.es = context.cs; + context.di = 1; + context.cx = 68-context.data.byte(1); + while(--context.cx) context._movsb(); + context.data.byte(10) = 0; + context.data.word(12) = 0; + context.data.word(14) = 0; + context.es = context.data.word(398); + context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.ax = 0x0ffff; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.cs; + context.di = 7798; + context.al = 1; + context._stosb(); + context._stosb(); + context.al = 0; + context._stosb(); + context.al = 1; + context._stosb(); + context.ax = 0; + context.cx = 6; + while(--context.cx) context._stosw(); + return; +} + +static inline void fillspace(Context & context) { + context.push(context.es); + context.push(context.ds); + context.push(context.dx); + context.push(context.di); + context.push(context.bx); + context.di = context.dx; + context.es = context.ds; + while(--context.cx) context._stosb(); + context.bx = context.pop(); + context.di = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); + return; +} + +static inline void sortoutmap(Context & context) { + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(400); + context.si = 0; + context.es = context.data.word(418); + context.di = 0; + context.cx = 60; +blimey: + context.push(context.cx); + context.push(context.si); + context.cx = 66; + while(--context.cx) context._movsb(); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 132); + if (--context.cx) goto blimey; + context.di = context.pop(); + context.es = context.pop(); + return; +} + +static inline void deletetaken(Context & context) { + context.es = context.data.word(426); + context.ah = context.data.byte(184); + context.ds = context.data.word(398); + context.si = 0+2080+30000; + context.cx = 114; +takenloop: + context.al = context.data.byte(context.si+11); + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto notinhere; + context.bl = context.data.byte(context.si+1); + context.bh = 0; + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context.data.byte(context.bx+2) = 254; +notinhere: + context._add(context.si, 16); + if (--context.cx) goto takenloop; + return; +} + +static inline void dochange(Context & context) { + context._cmp(context.ch, 0); + if (context.flags.z()) goto object; + context._cmp(context.ch, 1); + if (context.flags.z()) goto freeobject; +path: + context.push(context.cx); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context.push(context.ax); + context.al = context.ch; + context._sub(context.al, 100); + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.bx = context.pop(); + context._add(context.bx, context.ax); + context._add(context.bx, 0); + context.es = context.data.word(450); + context.cx = context.pop(); + context.data.byte(context.bx+6) = context.cl; +nopath: + return; +object: + context.push(context.cx); + getsetad(context); + context.cx = context.pop(); + context.data.byte(context.bx+58) = context.cl; + return; +freeobject: + context.push(context.cx); + getfreead(context); + context.cx = context.pop(); + context._cmp(context.data.byte(context.bx+2), 255); + if (!context.flags.z()) goto beenpickedup; + context.data.byte(context.bx+2) = context.cl; +beenpickedup: + return; +} + +static inline void setallchanges(Context & context) { + context.es = context.data.word(412); + context.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); +setallloop: + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto endsetloop; + context.cx = context.data.word(context.bx+2); + context._add(context.bx, 4); + context._cmp(context.ah, context.data.byte(184)); + if (!context.flags.z()) goto setallloop; + context.push(context.es); + context.push(context.bx); + dochange(context); + context.bx = context.pop(); + context.es = context.pop(); + goto setallloop; +endsetloop: + return; +} + +static inline void autoappear(Context & context) { + context._cmp(context.data.byte(9), 32); + if (!context.flags.z()) goto notinalley; + context.al = 5; + resetlocation(context); + context.al = 10; + setlocation(context); + context.data.byte(183) = 10; + return; +notinalley: + context._cmp(context.data.byte(184), 24); + if (!context.flags.z()) goto notinedens; + context._cmp(context.data.byte(42), 1); + if (!context.flags.z()) goto edenspart2; + context._add(context.data.byte(42), 1); + context.al = 44; + placesetobject(context); + context.al = 18; + placesetobject(context); + context.al = 93; + placesetobject(context); + context.al = 92; + removesetobject(context); + context.al = 55; + removesetobject(context); + context.al = 75; + removesetobject(context); + context.al = 84; + removesetobject(context); + context.al = 85; + removesetobject(context); + return; +edenspart2: + context._cmp(context.data.byte(43), 1); + if (!context.flags.z()) goto notedens2; + context.al = 44; + removesetobject(context); + context.al = 93; + removesetobject(context); + context.al = 55; + placesetobject(context); + context._add(context.data.byte(43), 1); +notedens2: + return; +notinedens: + context._cmp(context.data.byte(184), 25); + if (!context.flags.z()) goto notonsartroof; + context.data.byte(34) = 3; + context.al = 6; + resetlocation(context); + context.al = 11; + setlocation(context); + context.data.byte(183) = 11; + return; +notonsartroof: + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notinlouiss; + context._cmp(context.data.byte(41), 0); + if (context.flags.z()) goto notinlouiss; + context.al = 23; + placesetobject(context); +notinlouiss: + return; +} + +static inline void startloading(Context & context) { + context.data.byte(64) = 0; + context.al = context.data.byte(context.bx+13); + context.data.byte(531) = context.al; + context.al = context.data.byte(context.bx+15); + context.data.byte(148) = context.al; + context.al = context.data.byte(context.bx+16); + context.data.byte(149) = context.al; + context.al = context.data.byte(context.bx+20); + context.data.byte(35) = context.al; + context.al = context.data.byte(context.bx+21); + context.data.byte(475) = context.al; + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + context.al = context.data.byte(context.bx+22); + context.data.byte(133) = context.al; + context.data.byte(135) = context.al; + context.al = context.data.byte(context.bx+23); + context.data.byte(39) = context.al; + context.al = context.data.byte(context.bx+24); + context.data.byte(36) = context.al; + context.al = context.data.byte(context.bx+25); + context.data.byte(38) = context.al; + context.data.byte(65) = -1; + context.al = context.data.byte(context.bx+27); + context.push(context.ax); + context.al = context.data.byte(context.bx+31); + context.ah = context.data.byte(184); + context.data.byte(184) = context.al; + context.dx = context.bx; + openfile(context); + readheader(context); + allocateload(context); + context.ds = context.ax; + context.data.word(416) = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(400); + context.dx = 0; + context.cx = 132*66; + context.al = 0; + fillspace(context); + loadseg(context); + sortoutmap(context); + allocateload(context); + context.data.word(444) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(428); + context.dx = 0; + context.cx = 64*128; + context.al = 255; + fillspace(context); + loadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(450) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(448) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(440) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(442) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(436) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(446) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(426); + context.dx = 0; + context.cx = 16*80; + context.al = 255; + fillspace(context); + loadseg(context); + allocateload(context); + context.data.word(438) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); + findroominloc(context); + deletetaken(context); + setallchanges(context); + autoappear(context); + context.al = context.data.byte(188); + getroomdata(context); + context.data.byte(65) = -1; + context.data.byte(56) = 0; + context.data.word(98) = 160; + context.data.byte(188) = 255; + context.data.byte(492) = 254; + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto dontwalkin; + context.data.byte(475) = context.al; + context.push(context.bx); + autosetwalk(context); + context.bx = context.pop(); +dontwalkin: + findxyfrompath(context); + return; +} + +static inline void loadroom(Context & context) { + context.data.byte(74) = 1; + context.data.word(328) = 0; + context.data.word(138) = 0; + context.data.word(121) = 104; + context.data.word(123) = 38; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context.al = context.data.byte(188); + context.data.byte(9) = context.al; + getroomdata(context); + startloading(context); + loadroomssample(context); + switchryanon(context); + drawflags(context); + getdimension(context); + return; +} + +static inline void clearsprites(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.al = 255; + context.cx = 32*16; + while(--context.cx) context._stosb(); + return; +} + +static inline void initman(Context & context) { + context.al = context.data.byte(151); + context.ah = context.data.byte(152); + context.si = context.ax; + context.cx = 49464; + context.dx = context.data.word(414); + context.di = 0; + makesprite(context); + context.data.byte(context.bx+23) = 4; + context.data.byte(context.bx+22) = 0; + context.data.byte(context.bx+29) = 0; + return; +} + +static inline void entrytexts(Context & context) { + context._cmp(context.data.byte(9), 21); + if (!context.flags.z()) goto notloc15; + context.al = 28; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc15: + context._cmp(context.data.byte(9), 30); + if (!context.flags.z()) goto notloc43; + context.al = 27; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc43: + context._cmp(context.data.byte(9), 23); + if (!context.flags.z()) goto notloc23; + context.al = 29; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc23: + context._cmp(context.data.byte(9), 31); + if (!context.flags.z()) goto notloc44; + context.al = 30; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc44: + context._cmp(context.data.byte(9), 20); + if (!context.flags.z()) goto notsarters2; + context.al = 31; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notsarters2: + context._cmp(context.data.byte(9), 24); + if (!context.flags.z()) goto notedenlob; + context.al = 32; + context.cx = 60; + context.dx = 3; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notedenlob: + context._cmp(context.data.byte(9), 34); + if (!context.flags.z()) goto noteden2; + context.al = 33; + context.cx = 60; + context.dx = 3; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +noteden2: + return; +} + +static inline void purgealocation(Context & context) { + context.push(context.ax); + context.es = context.data.word(398); + context.di = 0+2080+30000; + context.bx = context.pop(); + context.cx = 0; +purgeloc: + context._cmp(context.bl, context.data.byte(context.di+0)); + if (!context.flags.z()) goto dontpurge; + context._cmp(context.data.byte(context.di+2), 0); + if (!context.flags.z()) goto dontpurge; + context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.push(context.cx); + deleteexobject(context); + context.cx = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); +dontpurge: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto purgeloc; + return; +} + +static inline void resetlocation(Context & context) { + context.push(context.ax); + context._cmp(context.al, 5); + if (!context.flags.z()) goto notdelhotel; + purgealocation(context); + context.al = 21; + purgealocation(context); + context.al = 22; + purgealocation(context); + context.al = 27; + purgealocation(context); + goto clearedlocations; +notdelhotel: + context._cmp(context.al, 8); + if (!context.flags.z()) goto notdeltvstud; + purgealocation(context); + context.al = 28; + purgealocation(context); + goto clearedlocations; +notdeltvstud: + context._cmp(context.al, 6); + if (!context.flags.z()) goto notdelsarters; + purgealocation(context); + context.al = 20; + purgealocation(context); + context.al = 25; + purgealocation(context); + goto clearedlocations; +notdelsarters: + context._cmp(context.al, 13); + if (!context.flags.z()) goto notdelboathouse; + purgealocation(context); + context.al = 29; + purgealocation(context); + goto clearedlocations; +notdelboathouse: +clearedlocations: + context.ax = context.pop(); + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.data.byte(context.bx) = 0; + return; +} + +static inline void checkifpathison(Context & context) { + context.push(context.ax); + getroomspaths(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx+6); + context._cmp(context.al, 255); + return; +} + +static inline void turnpathon(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 255; + context.ch = context.data.byte(185); + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + getroomspaths(context); + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto nopathon; + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 255; + context.data.byte(context.bx+6) = context.al; +nopathon: + return; +} + +static inline void turnanypathon(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 255; + context.ch = context.ah; + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + context.al = context.ah; + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 255; + context.data.byte(context.bx+6) = context.al; + return; +} + +static inline void entryanims(Context & context) { + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.byte(9), 33); + if (!context.flags.z()) goto notinthebeach; + switchryanoff(context); + context.data.word(21) = 76*2; + context.data.word(23) = 0; + context.data.word(25) = 76; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +notinthebeach: + context._cmp(context.data.byte(9), 44); + if (!context.flags.z()) goto notsparkys; + context.al = 8; + resetlocation(context); + context.data.word(21) = 50*2; + context.data.word(23) = 247; + context.data.word(25) = 297; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notsparkys: + context._cmp(context.data.byte(9), 22); + if (!context.flags.z()) goto notinthelift; + context.data.word(21) = 31*2; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notinthelift: + context._cmp(context.data.byte(9), 26); + if (!context.flags.z()) goto notunderchurch; + context.data.byte(292) = 2; + context.data.byte(295) = 1; + return; +notunderchurch: + context._cmp(context.data.byte(9), 45); + if (!context.flags.z()) goto notenterdream; + context.data.byte(54) = 0; + context.data.word(21) = 296; + context.data.word(23) = 45; + context.data.word(25) = 198; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notenterdream: + context._cmp(context.data.byte(184), 46); + if (!context.flags.z()) goto notcrystal; + context._cmp(context.data.byte(43), 1); + if (!context.flags.z()) goto notcrystal; + context.al = 0; + removefreeobject(context); + return; +notcrystal: + context._cmp(context.data.byte(9), 9); + if (!context.flags.z()) goto nottopchurch; + context.al = 2; + checkifpathison(context); + if (context.flags.z()) goto nottopchurch; + context._cmp(context.data.byte(44), 0); + if (context.flags.z()) goto nottopchurch; + context.al = 3; + checkifpathison(context); + if (!context.flags.z()) goto makedoorsopen; + context.al = 2; + turnpathon(context); +makedoorsopen: + context.al = 4; + removesetobject(context); + context.al = 5; + placesetobject(context); + return; +nottopchurch: + context._cmp(context.data.byte(9), 47); + if (!context.flags.z()) goto notdreamcentre; + context.al = 4; + placesetobject(context); + context.al = 5; + placesetobject(context); + return; +notdreamcentre: + context._cmp(context.data.byte(9), 38); + if (!context.flags.z()) goto notcarpark; + context.data.word(21) = 57*2; + context.data.word(23) = 4; + context.data.word(25) = 57; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notcarpark: + context._cmp(context.data.byte(9), 32); + if (!context.flags.z()) goto notalley; + context.data.word(21) = 66*2; + context.data.word(23) = 0; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notalley: + context._cmp(context.data.byte(9), 24); + if (!context.flags.z()) goto notedensagain; + context.al = 2; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); +notedensagain: + return; +} + +static inline void deleteexframe(Context & context) { + context.di = 0; + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + context.ah = 0; + context.cl = context.data.byte(context.di+1); + context.ch = 0; + context._mul(context.cx); + context.si = context.data.word(context.di+2); + context.push(context.si); + context._add(context.si, 0+2080); + context.cx = 30000; + context._sub(context.cx, context.data.word(context.di+2)); + context.di = context.si; + context._add(context.si, context.ax); + context.push(context.ax); + context.ds = context.es; + while(--context.cx) context._movsb(); + context.bx = context.pop(); + context._sub(context.data.word(12), context.bx); + context.si = context.pop(); + context.cx = 114*3; + context.di = 0; +shuffleadsdown: + context.ax = context.data.word(context.di+2); + context._cmp(context.ax, context.si); + if (context.flags.c()) goto beforethisone; + context._sub(context.ax, context.bx); +beforethisone: + context.data.word(context.di+2) = context.ax; + context._add(context.di, 6); + if (--context.cx) goto shuffleadsdown; + return; +} + +static inline void deleteextext(Context & context) { + context.di = 0+2080+30000+(16*114); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context.ax = context.data.word(context.di); + context.si = context.ax; + context.di = context.ax; + context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context.ax = 0; +findlenextext: + context.cl = context.data.byte(context.si); + context._add(context.ax, 1); + context._add(context.si, 1); + context._cmp(context.cl, 0); + if (!context.flags.z()) goto findlenextext; + context.cx = 18000; + context.bx = context.si; + context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2)); + context.push(context.bx); + context.push(context.ax); + context._sub(context.cx, context.bx); + while(--context.cx) context._movsb(); + context.bx = context.pop(); + context._sub(context.data.word(14), context.bx); + context.si = context.pop(); + context.cx = 114; + context.di = 0+2080+30000+(16*114); +shuffletextads: + context.ax = context.data.word(context.di); + context._cmp(context.ax, context.si); + if (context.flags.c()) goto beforethistext; + context._sub(context.ax, context.bx); +beforethistext: + context.data.word(context.di) = context.ax; + context._add(context.di, 2); + if (--context.cx) goto shuffletextads; + return; +} + +static inline void deleteexobject(Context & context) { + context.push(context.cx); + context.push(context.cx); + context.push(context.cx); + context.push(context.cx); + context.al = 255; + context.cx = 16; + while(--context.cx) context._stosb(); + context.ax = context.pop(); + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + deleteexframe(context); + context.ax = context.pop(); + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + deleteexframe(context); + context.ax = context.pop(); + deleteextext(context); + context.bx = context.pop(); + context.bh = context.bl; + context.bl = 4; + context.di = 0+2080+30000; + context.cx = 0; +deleteconts: + context._cmp(context.data.word(context.di+2), context.bx); + if (!context.flags.z()) goto notinsideex; + context.push(context.bx); + context.push(context.cx); + context.push(context.di); + deleteexobject(context); + context.di = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); +notinsideex: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto deleteconts; + return; +} + +static inline void purgeanitem(Context & context) { + context.es = context.data.word(398); + context.di = 0+2080+30000; + context.bl = context.data.byte(184); + context.cx = 0; +lookforpurge: + context.al = context.data.byte(context.di+2); + context._cmp(context.al, 0); + if (!context.flags.z()) goto cantpurge; + context._cmp(context.data.byte(context.di+12), 2); + if (context.flags.z()) goto iscup; + context._cmp(context.data.byte(context.di+12), 255); + if (!context.flags.z()) goto cantpurge; +iscup: + context._cmp(context.data.byte(context.di+11), context.bl); + if (context.flags.z()) goto cantpurge; + deleteexobject(context); + return; +cantpurge: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto lookforpurge; + context.di = 0+2080+30000; + context.bl = context.data.byte(184); + context.cx = 0; +lookforpurge2: + context.al = context.data.byte(context.di+2); + context._cmp(context.al, 0); + if (!context.flags.z()) goto cantpurge2; + context._cmp(context.data.byte(context.di+12), 255); + if (!context.flags.z()) goto cantpurge2; + deleteexobject(context); + return; +cantpurge2: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto lookforpurge2; + return; +} + +static inline void emergencypurge(Context & context) { +checkpurgeagain: + context.ax = context.data.word(12); + context._add(context.ax, 4000); + context._cmp(context.ax, 30000); + if (context.flags.c()) goto notnearframeend; + purgeanitem(context); + goto checkpurgeagain; +notnearframeend: + context.ax = context.data.word(14); + context._add(context.ax, 400); + context._cmp(context.ax, 18000); + if (context.flags.c()) goto notneartextend; + purgeanitem(context); + goto checkpurgeagain; +notneartextend: + return; +} + +static inline void getexpos(Context & context) { + context.es = context.data.word(398); + context.al = 0; + context.di = 0+2080+30000; +tryanotherex: + context._cmp(context.data.byte(context.di+2), 255); + if (context.flags.z()) goto foundnewex; + context._add(context.di, 16); + context._add(context.al, 1); + context._cmp(context.al, 114); + if (!context.flags.z()) goto tryanotherex; +foundnewex: + context.data.byte(10) = context.al; + return; +} + +static inline void transfermap(Context & context) { + context.di = context.data.word(12); + context.push(context.di); + context.al = context.data.byte(10); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context.cx = 6; + context._mul(context.cx); + context.es = context.data.word(398); + context.bx = 0; + context._add(context.bx, context.ax); + context._add(context.di, 0+2080); + context.push(context.bx); + context.al = context.data.byte(90); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context.cx = 6; + context._mul(context.cx); + context.ds = context.data.word(446); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+2080; + context.al = context.data.byte(context.bx); + context.ah = 0; + context.cl = context.data.byte(context.bx+1); + context.ch = 0; + context._add(context.si, context.data.word(context.bx+2)); + context.dx = context.data.word(context.bx+4); + context.bx = context.pop(); + context.data.byte(context.bx+0) = context.al; + context.data.byte(context.bx+1) = context.cl; + context.data.word(context.bx+4) = context.dx; + context._mul(context.cx); + context.cx = context.ax; + context.push(context.cx); + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context.ax = context.pop(); + context.data.word(context.bx+2) = context.ax; + context._add(context.data.word(12), context.cx); + return; +} + +static inline void transferinv(Context & context) { + context.di = context.data.word(12); + context.push(context.di); + context.al = context.data.byte(10); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context._add(context.ax, 1); + context.cx = 6; + context._mul(context.cx); + context.es = context.data.word(398); + context.bx = 0; + context._add(context.bx, context.ax); + context._add(context.di, 0+2080); + context.push(context.bx); + context.al = context.data.byte(90); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context._add(context.ax, 1); + context.cx = 6; + context._mul(context.cx); + context.ds = context.data.word(446); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+2080; + context.al = context.data.byte(context.bx); + context.ah = 0; + context.cl = context.data.byte(context.bx+1); + context.ch = 0; + context._add(context.si, context.data.word(context.bx+2)); + context.dx = context.data.word(context.bx+4); + context.bx = context.pop(); + context.data.byte(context.bx+0) = context.al; + context.data.byte(context.bx+1) = context.cl; + context.data.word(context.bx+4) = context.dx; + context._mul(context.cx); + context.cx = context.ax; + context.push(context.cx); + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context.ax = context.pop(); + context.data.word(context.bx+2) = context.ax; + context._add(context.data.word(12), context.cx); + return; +} + +static inline void transfertext(Context & context) { + context.es = context.data.word(398); + context.al = context.data.byte(10); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = 0+2080+30000+(16*114); + context._add(context.bx, context.ax); + context.di = context.data.word(14); + context.data.word(context.bx) = context.di; + context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context.al = context.data.byte(90); + context.ah = 0; + context._add(context.ax, context.ax); + context.ds = context.data.word(438); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+(82*2); + context.ax = context.data.word(context.bx); + context._add(context.si, context.ax); +moretext: + context._lodsb(); + context._stosb(); + context._add(context.data.word(14), 1); + context._cmp(context.al, 0); + if (!context.flags.z()) goto moretext; + return; +} + +static inline void transfercontoex(Context & context) { + context.push(context.es); + context.push(context.bx); + context.push(context.dx); + context.push(context.es); + context.push(context.bx); + getexpos(context); + context.si = context.pop(); + context.ds = context.pop(); + context.push(context.di); + context.cx = 8; + while(--context.cx) context._movsw(); + context.di = context.pop(); + context.dx = context.pop(); + context.al = context.data.byte(184); + context.data.byte(context.di) = context.al; + context.data.byte(context.di+11) = context.al; + context.al = context.data.byte(90); + context.data.byte(context.di+1) = context.al; + context.data.byte(context.di+3) = context.dl; + context.data.byte(context.di+2) = 4; + transfermap(context); + transferinv(context); + transfertext(context); + context.si = context.pop(); + context.ds = context.pop(); + context.data.byte(context.si+2) = 255; + return; +} + +static inline void pickupconts(Context & context) { + context.al = context.data.byte(context.si+7); + context._cmp(context.al, 255); + if (context.flags.z()) goto notopenable; + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context.dl = context.data.byte(10); + context.es = context.data.word(426); + context.bx = 0; + context.cx = 0; +pickupcontloop: + context.push(context.cx); + context.push(context.es); + context.push(context.bx); + context.push(context.dx); + context.push(context.ax); + context._cmp(context.data.byte(context.bx+2), context.ah); + if (!context.flags.z()) goto notinsidethis; + context._cmp(context.data.byte(context.bx+3), context.al); + if (!context.flags.z()) goto notinsidethis; + context.data.byte(90) = context.cl; + transfercontoex(context); +notinsidethis: + context.ax = context.pop(); + context.dx = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 80); + if (!context.flags.z()) goto pickupcontloop; +notopenable: + return; +} + +static inline void transfertoex(Context & context) { + emergencypurge(context); + getexpos(context); + context.al = context.data.byte(10); + context.push(context.ax); + context.push(context.di); + context.al = context.data.byte(89); + context.ah = 0; + context.bx = 16; + context._mul(context.bx); + context.ds = context.data.word(426); + context.si = context.ax; + context.cx = 8; + while(--context.cx) context._movsw(); + context.di = context.pop(); + context.al = context.data.byte(184); + context.data.byte(context.di) = context.al; + context.data.byte(context.di+11) = context.al; + context.al = context.data.byte(89); + context.data.byte(context.di+1) = context.al; + context.data.byte(context.di+2) = 4; + context.data.byte(context.di+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.di+4) = context.al; + context.al = context.data.byte(89); + context.data.byte(90) = context.al; + transfermap(context); + transferinv(context); + transfertext(context); + context.al = context.data.byte(89); + context.ah = 0; + context.bx = 16; + context._mul(context.bx); + context.ds = context.data.word(426); + context.si = context.ax; + context.data.byte(context.si+2) = 254; + pickupconts(context); + context.ax = context.pop(); + return; +} + +static inline void pickupob(Context & context) { + context.data.byte(107) = context.ah; + context.data.byte(102) = 2; + context.data.byte(89) = context.al; + context.data.byte(99) = context.al; + getanyad(context); + transfertoex(context); + return; +} + +static inline void initialinv(Context & context) { + context._cmp(context.data.byte(184), 24); + if (context.flags.z()) goto isedens; + return; +isedens: + context.al = 11; + context.ah = 5; + pickupob(context); + context.al = 12; + context.ah = 6; + pickupob(context); + context.al = 13; + context.ah = 7; + pickupob(context); + context.al = 14; + context.ah = 8; + pickupob(context); + context.al = 18; + context.al = 18; + context.ah = 0; + pickupob(context); + context.al = 19; + context.ah = 1; + pickupob(context); + context.al = 20; + context.ah = 9; + pickupob(context); + context.al = 16; + context.ah = 2; + pickupob(context); + context.data.byte(32) = 1; + context.data.word(29) = 0; + context.data.word(31) = 6; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +} + +static inline void startup1(Context & context) { + clearpalette(context); + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + showicon(context); + getunderzoom(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + atmospheres(context); + worktoscreen(context); + fadescreenup(context); + return; +} + +static inline void clearreels(Context & context) { + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); + return; +} + +static inline void clearrest(Context & context) { + context.es = context.data.word(418); + context.cx = 66*60/2; + context.ax = 0; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(416); + deallocatemem(context); + context.es = context.data.word(444); + deallocatemem(context); + context.es = context.data.word(450); + deallocatemem(context); + context.es = context.data.word(448); + deallocatemem(context); + context.es = context.data.word(440); + deallocatemem(context); + context.es = context.data.word(442); + deallocatemem(context); + context.es = context.data.word(436); + deallocatemem(context); + context.es = context.data.word(446); + deallocatemem(context); + context.es = context.data.word(438); + deallocatemem(context); + return; +} + +static inline void clearbeforeload(Context & context) { + context._cmp(context.data.byte(74), 1); + if (!context.flags.z()) goto noclear; + clearreels(context); + clearrest(context); + context.data.byte(74) = 0; +noclear: + return; +} + +static inline void startup(Context & context) { + context.data.byte(142) = 0; + context.data.byte(105) = 0; + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + showicon(context); + getunderzoom(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + atmospheres(context); + return; +} + +static inline void worktoscreenm(Context & context) { + animpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void readcitypic(Context & context) { + context.dx = 2013; + loadintotemp(context); + return; +} + +static inline void showcity(Context & context) { + clearwork(context); + context.ds = context.data.word(458); + context.di = 57; + context.bx = 32; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 120+57; + context.bx = 32; + context.al = 1; + context.ah = 0; + showframe(context); + return; +} + +static inline void loadintotemp2(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(460) = context.ax; + return; +} + +static inline void loadintotemp3(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(462) = context.ax; + return; +} + +static inline void readdesticon(Context & context) { + context.dx = 2026; + loadintotemp(context); + context.dx = 2039; + loadintotemp2(context); + context.dx = 1974; + loadintotemp3(context); + return; +} + +static inline void loadtraveltext(Context & context) { + context.dx = 2247; + standardload(context); + context.data.word(456) = context.ax; + return; +} + +static inline void showarrows(Context & context) { + context.di = 116-12; + context.bx = 16; + context.ds = context.data.word(458); + context.al = 0; + context.ah = 0; + showframe(context); + context.di = 226+12; + context.bx = 16; + context.ds = context.data.word(458); + context.al = 1; + context.ah = 0; + showframe(context); + context.di = 280; + context.bx = 14; + context.ds = context.data.word(458); + context.al = 2; + context.ah = 0; + showframe(context); + return; +} + +static inline void getdestinfo(Context & context) { + context.al = context.data.byte(183); + context.ah = 0; + context.push(context.ax); + context.dx = context.ds; + context.es = context.dx; + context.si = 7798; + context._add(context.si, context.ax); + context.cl = context.data.byte(context.si); + context.ax = context.pop(); + context.push(context.cx); + context.dx = context.ds; + context.es = context.dx; + context.si = 7813; + context._add(context.si, context.ax); + context.ax = context.pop(); + return; +} + +static inline void locationpic(Context & context) { + getdestinfo(context); + context.al = context.data.byte(context.si); + context.push(context.es); + context.push(context.si); + context.di = 0; + context._cmp(context.al, 6); + if (!context.flags.c()) goto secondlot; + context.ds = context.data.word(458); + context._add(context.al, 4); + goto gotgraphic; +secondlot: + context._sub(context.al, 6); + context.ds = context.data.word(460); +gotgraphic: + context._add(context.di, 104); + context.bx = 138+14; + context.ah = 0; + showframe(context); + context.si = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(183); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinthisone; + context.al = 3; + context.di = 104; + context.bx = 140+14; + context.ds = context.data.word(458); + context.ah = 0; + showframe(context); +notinthisone: + context.bl = context.data.byte(183); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(456); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + context.di = 50; + context.bx = 20; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + return; +} + +static inline void getridoftemp2(Context & context) { + context.es = context.data.word(460); + deallocatemem(context); + return; +} + +static inline void getridoftemp3(Context & context) { + context.es = context.data.word(462); + deallocatemem(context); + return; +} + +static inline void selectlocation(Context & context) { + context.data.byte(237) = 0; + clearbeforeload(context); + context.data.byte(103) = 0; + context.data.byte(231) = 22; + readcitypic(context); + showcity(context); + getridoftemp(context); + readdesticon(context); + loadtraveltext(context); + showpanel(context); + showman(context); + showarrows(context); + showexit(context); + locationpic(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + context.data.byte(231) = 0; + showpointer(context); + worktoscreen(context); + context.al = 9; + context.ah = 255; + playchannel0(context); + context.data.byte(188) = 255; +select: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto quittravel; + context.bx = 2714; + checkcoords(context); + context._cmp(context.data.byte(188), 255); + if (context.flags.z()) goto select; + context.al = context.data.byte(188); + context._cmp(context.al, context.data.byte(9)); + if (context.flags.z()) goto quittravel; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + context.es = context.data.word(456); + deallocatemem(context); + return; +quittravel: + context.al = context.data.byte(184); + context.data.byte(188) = context.al; + context.data.byte(103) = 0; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + context.es = context.data.word(456); + deallocatemem(context); + return; +} + +static inline void newplace(Context & context) { + context._cmp(context.data.byte(60), 1); + if (context.flags.z()) goto istravel; + context._cmp(context.data.byte(189), -1); + if (!context.flags.z()) goto isautoloc; + return; +isautoloc: + context.al = context.data.byte(189); + context.data.byte(188) = context.al; + context.data.byte(189) = -1; + return; +istravel: + context.data.byte(60) = 0; + selectlocation(context); + return; +} + +static inline void checkcoords(Context & context) { +loop048: + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nonefound; + context.push(context.bx); + context._cmp(context.data.word(198), context.ax); + if (context.flags.l()) goto over045; + context.ax = context.data.word(context.bx+2); + context._cmp(context.data.word(198), context.ax); + if (!context.flags.ge()) goto over045; + context.ax = context.data.word(context.bx+4); + context._cmp(context.data.word(200), context.ax); + if (context.flags.l()) goto over045; + context.ax = context.data.word(context.bx+6); + context._cmp(context.data.word(200), context.ax); + if (!context.flags.ge()) goto over045; + context.ax = context.data.word(context.bx+8); + __dispatch_call(context, context.ax); +finished: + context.ax = context.pop(); + return; +over045: + context.bx = context.pop(); + context._add(context.bx, 10); + goto loop048; +nonefound: + return; +} + +static inline void finishedwalking(Context & context) { + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto iswalking; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); +iswalking: + return; +} + +static inline void showexit(Context & context) { + context.ds = context.data.word(408); + context.di = 274; + context.bx = 154; + context.al = 11; + context.ah = 0; + showframe(context); + return; +} + +static inline void getanyad(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto isex; + context._cmp(context.data.byte(102), 2); + if (context.flags.z()) goto isfree; + context.al = context.data.byte(99); + getsetad(context); + context.ax = context.data.word(context.bx+4); + return; +isfree: + context.al = context.data.byte(99); + getfreead(context); + context.ax = context.data.word(context.bx+7); + return; +isex: + context.al = context.data.byte(99); + getexad(context); + context.ax = context.data.word(context.bx+7); + return; +} + +static inline void obicons(Context & context) { + context.al = context.data.byte(99); + getanyad(context); + context._cmp(context.al, 255); + if (context.flags.z()) goto cantopenit; + context.ds = context.data.word(410); + context.di = 210; + context.bx = 1; + context.al = 4; + context.ah = 0; + showframe(context); +cantopenit: + context.ds = context.data.word(410); + context.di = 260; + context.bx = 1; + context.al = 1; + context.ah = 0; + showframe(context); + return; +} + +static inline void obpicture(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context._cmp(context.ah, 1); + if (context.flags.z()) goto setframe; + context._cmp(context.ah, 4); + if (context.flags.z()) goto exframe; + context.ds = context.data.word(446); + context.di = 160; + context.bx = 68; + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + showframe(context); + return; +setframe: + return; +exframe: + context.ds = context.data.word(398); + context.di = 160; + context.bx = 68; + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + showframe(context); + return; +} + +static inline void searchforsame(Context & context) { + context.si = context.cx; +searchagain: + context._add(context.si, 1); + context.al = context.data.byte(context.bx); +search: + context._cmp(context.data.byte(context.si), context.al); + if (context.flags.z()) goto gotstartletter; + context._add(context.cx, 1); + context._add(context.si, 1); + context._cmp(context.si, 8000); + if (context.flags.c()) goto search; + context.si = context.bx; + context.ax = context.pop(); + return; +gotstartletter: + context.push(context.bx); + context.push(context.si); +keepchecking: + context._add(context.si, 1); + context._add(context.bx, 1); + context.al = context.data.byte(context.bx); + context.ah = context.data.byte(context.si); + context._cmp(context.al, ':'); + if (context.flags.z()) goto foundmatch; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundmatch; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto keepchecking; + context.si = context.pop(); + context.bx = context.pop(); + goto searchagain; +foundmatch: + context.si = context.pop(); + context.bx = context.pop(); + return; +} + +static inline void getobtextstart(Context & context) { + context.es = context.data.word(438); + context.si = 0; + context.cx = 0+(82*2); + context._cmp(context.data.byte(102), 2); + if (context.flags.z()) goto describe; + context.es = context.data.word(440); + context.si = 0; + context.cx = 0+(130*2); + context._cmp(context.data.byte(102), 1); + if (context.flags.z()) goto describe; + context.es = context.data.word(398); + context.si = 0+2080+30000+(16*114); + context.cx = 0+2080+30000+(16*114)+((114+2)*2); +describe: + context.al = context.data.byte(99); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context.bx = context.ax; +tryagain: + context.push(context.si); + findnextcolon(context); + context.al = context.data.byte(context.si); + context.cx = context.si; + context.si = context.pop(); + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto cantmakeoneup; + context._cmp(context.al, 0); + if (context.flags.z()) goto findsometext; + context._cmp(context.al, ':'); + if (context.flags.z()) goto findsometext; +cantmakeoneup: + return; +findsometext: + searchforsame(context); + goto tryagain; + return; +} + +static inline void getlocation(Context & context) { + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.al = context.data.byte(context.bx); + return; +} + +static inline void setlocation(Context & context) { + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.data.byte(context.bx) = 1; + return; +} + +static inline void getridofreels(Context & context) { + context._cmp(context.data.byte(74), 0); + if (context.flags.z()) goto dontgetrid; + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); +dontgetrid: + return; +} + +static inline void loadkeypad(Context & context) { + context.dx = 1961; + loadintotemp(context); + return; +} + +static inline void hangonw(Context & context) { +hangloopw: + context.push(context.cx); + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + context.cx = context.pop(); + if (--context.cx) goto hangloopw; + return; +} + +static inline void getroomdata(Context & context) { + context.ah = 0; + context.cx = 32; + context._mul(context.cx); + context.bx = 5971; + context._add(context.bx, context.ax); + return; +} + +static inline void allocateload(Context & context) { + context.push(context.es); + context.push(context.di); + context.bx = context.data.word(context.di); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.di = context.pop(); + context.es = context.pop(); + return; +} + +static inline void restorereels(Context & context) { + context._cmp(context.data.byte(74), 0); + if (context.flags.z()) goto dontrestore; + context.al = context.data.byte(184); + getroomdata(context); + context.dx = context.bx; + openfile(context); + readheader(context); + dontloadseg(context); + dontloadseg(context); + dontloadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); +dontrestore: + return; +} + +static inline void putbackobstuff(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + obicons(context); + showexit(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static inline void lookatcard(Context & context) { + context.data.byte(131) = 1; + getridofreels(context); + loadkeypad(context); + createpanel2(context); + context.di = 160; + context.bx = 80; + context.ds = context.data.word(458); + context.al = 42; + context.ah = 128; + showframe(context); + getobtextstart(context); + findnextcolon(context); + findnextcolon(context); + findnextcolon(context); + context.di = 36; + context.bx = 124; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + context.push(context.es); + context.push(context.si); + worktoscreenm(context); + context.cx = 280; + hangonw(context); + createpanel2(context); + context.di = 160; + context.bx = 80; + context.ds = context.data.word(458); + context.al = 42; + context.ah = 128; + showframe(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 36; + context.bx = 130; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonw(context); + context.data.byte(131) = 0; + getridoftemp(context); + restorereels(context); + putbackobstuff(context); + return; +} + +static inline void obsthatdothings(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'M'; + context.ch = 'E'; + context.dl = 'M'; + context.dh = 'B'; + compare(context); + if (!context.flags.z()) goto notlouiscard; + context.al = 4; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto seencard; + context.al = 4; + setlocation(context); + lookatcard(context); +seencard: + return; +notlouiscard: + return; +} + +static inline void findpuztext(Context & context) { + context.ah = 0; + context.si = context.ax; + context._add(context.si, context.si); + context.es = context.data.word(454); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; + return; +} + +static inline void additionaltext(Context & context) { + context._add(context.bx, 10); + context.push(context.bx); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto emptycup; + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto fullcup; + context.bx = context.pop(); + return; +emptycup: + context.al = 40; + findpuztext(context); + context.bx = context.pop(); + context.di = 36; + context.dl = 241; + context.ah = 0; + printdirect(context); + return; +fullcup: + context.al = 39; + findpuztext(context); + context.bx = context.pop(); + context.di = 36; + context.dl = 241; + context.ah = 0; + printdirect(context); + return; +} + +static inline void describeob(Context & context) { + getobtextstart(context); + context.di = 33; + context.bx = 92; + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto notsetd; + context.bx = 82; +notsetd: + context.dl = 241; + context.ah = 16; + context.data.word(71) = 91+91; + printdirect(context); + context.data.word(71) = 0; + context.di = 36; + context.bx = 104; + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto notsetd2; + context.bx = 94; +notsetd2: + context.dl = 241; + context.ah = 0; + printdirect(context); + context.push(context.bx); + obsthatdothings(context); + context.bx = context.pop(); + additionaltext(context); + return; +} + +static inline void makemainscreen(Context & context) { + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + spriteupdate(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + context.data.byte(100) = 255; + animpointer(context); + worktoscreenm(context); + context.data.byte(100) = 200; + context.data.byte(131) = 0; + return; +} + +static inline void examineob(Context & context) { + context.data.byte(234) = 0; + context.data.word(328) = 0; +examineagain: + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +waitexam: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.data.byte(103) = 0; + context.bx = 2494; + context._cmp(context.data.byte(104), 0); + if (context.flags.z()) goto notuseinv; + context.bx = 2556; + context._cmp(context.data.byte(104), 1); + if (context.flags.z()) goto notuseinv; + context.bx = 2618; +notuseinv: + checkcoords(context); + context._cmp(context.data.byte(108), 0); + if (context.flags.z()) goto norex; + goto examineagain; +norex: + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitexam; + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatching; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto justgetback; +iswatching: + makemainscreen(context); + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; +justgetback: + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; +} + +static inline void facerightway(Context & context) { + context.push(context.es); + context.push(context.bx); + getroomspaths(context); + context.al = context.data.byte(475); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx+7); + context.data.byte(135) = context.al; + context.data.byte(134) = context.al; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void setwalk(Context & context) { + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto alreadywalking; + context.al = context.data.byte(474); + context._cmp(context.al, context.data.byte(475)); + if (context.flags.z()) goto cantwalk2; + context._cmp(context.data.byte(32), 1); + if (context.flags.z()) goto holdingreel; + context._cmp(context.data.byte(32), 2); + if (context.flags.z()) goto cantwalk; + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + context._cmp(context.data.word(202), 2); + if (!context.flags.z()) goto notwalkandexam; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto notwalkandexam; + context.data.byte(306) = 1; + context.al = context.data.byte(100); + context.data.byte(307) = context.al; + context.al = context.data.byte(99); + context.data.byte(308) = context.al; +notwalkandexam: + autosetwalk(context); +cantwalk: + return; +cantwalk2: + facerightway(context); + return; +alreadywalking: + context.al = context.data.byte(474); + context.data.byte(477) = context.al; + return; +holdingreel: + context.data.byte(33) = context.al; + context.data.byte(32) = 2; + return; +} + +static inline void examineobtext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 1; + commandwithob(context); + return; +} + +static inline void blocknametext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 0; + commandwithob(context); + return; +} + +static inline void personnametext(Context & context) { + context.bl = context.data.byte(99); + context._and(context.bl, 127); + context.bh = context.data.byte(100); + context.al = 2; + commandwithob(context); + return; +} + +static inline void deltextline(Context & context) { + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.ds = context.data.word(412); + context.si = 0; + context.cl = 228; + context.ch = 13; + multiput(context); + return; +} + +static inline void findobname(Context & context) { + context.push(context.ax); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.ax = context.pop(); + context._cmp(context.ah, 5); + if (!context.flags.z()) goto notpersonname; + context.push(context.ax); + context._and(context.al, 127); + context.ah = 0; + context.bx = 64*2; + context._mul(context.bx); + context.si = context.ax; + context.ds = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context.ax = context.pop(); + return; +notpersonname: + context._cmp(context.ah, 4); + if (!context.flags.z()) goto notextraname; + context.ds = context.data.word(398); + context._add(context.bx, 0+2080+30000+(16*114)); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); + context.si = context.ax; + return; +notextraname: + context._cmp(context.ah, 2); + if (!context.flags.z()) goto notfreename; + context.ds = context.data.word(438); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(82*2)); + context.si = context.ax; + return; +notfreename: + context._cmp(context.ah, 1); + if (!context.flags.z()) goto notsetname; + context.ds = context.data.word(440); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(130*2)); + context.si = context.ax; + return; +notsetname: + context.ds = context.data.word(442); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(98*2)); + context.si = context.ax; + return; +} + +static inline void copyname(Context & context) { + context.push(context.di); + findobname(context); + context.di = context.pop(); + context.es = context.cs; +copytext: + context.cx = 28; +make: + context._lodsb(); + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishmakename; + context._cmp(context.al, 0); + if (context.flags.z()) goto finishmakename; + context._stosb(); + if (--context.cx) goto make; +finishmakename: + context._add(context.cx, 1); + context.al = 0; + context._stosb(); + return; + context.al = 255; + while(--context.cx) context._stosb(); + return; +} + +static inline void commandwithob(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.push(context.bx); + context.push(context.cx); + context.push(context.dx); + context.push(context.es); + context.push(context.ds); + context.push(context.si); + context.push(context.di); + deltextline(context); + context.di = context.pop(); + context.si = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.push(context.bx); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.ax = context.pop(); + context.di = 5674; + copyname(context); + context.ax = context.pop(); + context.di = context.data.word(84); + context._cmp(context.al, 0); + if (context.flags.z()) goto noadd; + context._add(context.di, 5); +noadd: + context.bx = context.data.word(81); + context.es = context.cs; + context.si = 5674; + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(109) = 1; + return; +} + +static inline void walktotext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 3; + commandwithob(context); + return; +} + +static inline void walkandexamine(Context & context) { + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto noobselect; + examineob(context); + return; +wantstowalk: + setwalk(context); + context.data.byte(473) = 1; +noobselect: + return; +diff: + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; +diff2: + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto middleofwalk; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto notblock; + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto dontcheck; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto isblock; +dontcheck: + getflagunderp(context); + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto isblock; + context._cmp(context.data.byte(153), 128); + if (!context.flags.c()) goto isblock; + goto toofaraway; +notblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto toofaraway; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto isblock; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto isaperson; + examineobtext(context); + return; +middleofwalk: + blocknametext(context); + return; +isblock: + blocknametext(context); + return; +isaperson: + personnametext(context); + return; +toofaraway: + walktotext(context); + return; +} + +static inline void mainscreen(Context & context) { + context.data.byte(237) = 0; + context.bx = 4949; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto checkmain; + context.bx = 5011; +checkmain: + checkcoords(context); + context._cmp(context.data.byte(306), 0); + if (context.flags.z()) goto finishmain; + walkandexamine(context); +finishmain: + return; +} + +static inline void getflagunderp(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, context.data.word(117)); + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); + context.ch = context.al; + checkone(context); + context.data.byte(153) = context.cl; + context.data.byte(154) = context.ch; + return; +} + +static inline void animpointer(Context & context) { + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) goto combathand; + context._cmp(context.data.byte(234), 3); + if (context.flags.z()) goto mousehand; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatchpoint; + context.data.byte(231) = 11; + return; +notwatchpoint: + context.data.byte(231) = 0; + context._cmp(context.data.byte(237), 0); + if (context.flags.z()) goto gothand; + context._cmp(context.data.byte(476), 0); + if (context.flags.z()) goto gothand; +arrow: + getflagunderp(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto gothand; + context._cmp(context.cl, 128); + if (!context.flags.c()) goto gothand; + context.data.byte(231) = 3; + context._test(context.cl, 4); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 4; + context._test(context.cl, 16); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 5; + context._test(context.cl, 2); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 6; + context._test(context.cl, 8); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 8; +gothand: + return; +mousehand: + context._cmp(context.data.byte(235), 0); + if (context.flags.z()) goto rightspeed3; + context._sub(context.data.byte(235), 1); + goto finflashmouse; +rightspeed3: + context.data.byte(235) = 5; + context._add(context.data.byte(236), 1); + context._cmp(context.data.byte(236), 16); + if (!context.flags.z()) goto finflashmouse; + context.data.byte(236) = 0; +finflashmouse: + context.al = context.data.byte(236); + context.ah = 0; + context.bx = 5698; + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.data.byte(231) = context.al; + return; +combathand: + context.data.byte(231) = 0; + context._cmp(context.data.byte(184), 14); + if (!context.flags.z()) goto notarrow; + context._cmp(context.data.byte(100), 211); + if (!context.flags.z()) goto notarrow; + context.data.byte(231) = 5; +notarrow: + return; +} + +static inline void showblink(Context & context) { + context._cmp(context.data.byte(131), 1); + if (context.flags.z()) goto finblink1; + context._add(context.data.byte(472), 1); + context._cmp(context.data.byte(4), 0); + if (!context.flags.z()) goto finblink1; + context._cmp(context.data.byte(184), 50); + if (!context.flags.c()) goto eyesshut; + context.al = context.data.byte(472); + context._cmp(context.al, 3); + if (!context.flags.z()) goto finblink1; + context.data.byte(472) = 0; + context.al = context.data.byte(471); + context._add(context.al, 1); + context.data.byte(471) = context.al; + context._cmp(context.al, 6); + if (context.flags.c()) goto nomorethan6; + context.al = 6; +nomorethan6: + context.ah = 0; + context.bx = 5691; + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ds = context.data.word(408); + context.di = 44; + context.bx = 32; + context.ah = 0; + showframe(context); +finblink1: + return; +eyesshut: + return; +} + +static inline void showpointer(Context & context) { + showblink(context); + context.di = context.data.word(198); + context.data.word(220) = context.di; + context.bx = context.data.word(200); + context.data.word(222) = context.bx; + context._cmp(context.data.byte(106), 1); + if (context.flags.z()) goto itsanobject; + context.push(context.bx); + context.push(context.di); + context.ds = context.data.word(408); + context.al = context.data.byte(231); + context._add(context.al, 20); + context.ah = 0; + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.cx = context.data.word(context.si); + context._cmp(context.cl, 12); + if (!context.flags.c()) goto notsmallx; + context.cl = 12; +notsmallx: + context._cmp(context.ch, 12); + if (!context.flags.c()) goto notsmally; + context.ch = 12; +notsmally: + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; + context.push(context.ds); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + multiget(context); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.push(context.di); + context.push(context.bx); + context.al = context.data.byte(231); + context._add(context.al, 20); + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + return; +itsanobject: + context.al = context.data.byte(89); + context.ds = context.data.word(398); + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto itsfrominv; + context.ds = context.data.word(446); +itsfrominv: + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 0; + context.push(context.ax); + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.ax = 2080; + context.cx = context.data.word(context.si); + context._cmp(context.cl, 12); + if (!context.flags.c()) goto notsmallx2; + context.cl = 12; +notsmallx2: + context._cmp(context.ch, 12); + if (!context.flags.c()) goto notsmally2; + context.ch = 12; +notsmally2: + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; + context.ax = context.pop(); + context.push(context.di); + context.push(context.bx); + context.push(context.ax); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.al = context.cl; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.data.word(220), context.ax); + context._sub(context.di, context.ax); + context.al = context.ch; + context._shr(context.ax, 1); + context._sub(context.data.word(222), context.ax); + context._sub(context.bx, context.ax); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + multiget(context); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.ah = 128; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.ds = context.data.word(408); + context.al = 3; + context.ah = 128; + showframe(context); + return; +} + +static inline void readmouse1(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(204) = context.bx; + return; +} + +static inline void dumpblink(Context & context) { + context._cmp(context.data.byte(4), 0); + if (!context.flags.z()) goto nodumpeye; + context._cmp(context.data.byte(472), 0); + if (!context.flags.z()) goto nodumpeye; + context.al = context.data.byte(471); + context._cmp(context.al, 6); + if (!context.flags.c()) goto nodumpeye; + context.push(context.ds); + context.di = 44; + context.bx = 32; + context.cl = 16; + context.ch = 12; + multidump(context); + context.ds = context.pop(); +nodumpeye: + return; +} + +static inline void dumppointer(Context & context) { + dumpblink(context); + context.cl = context.data.byte(229); + context.ch = context.data.byte(230); + context.di = context.data.word(224); + context.bx = context.data.word(226); + multidump(context); + context.bx = context.data.word(222); + context.di = context.data.word(220); + context._cmp(context.di, context.data.word(224)); + if (!context.flags.z()) goto difffound; + context._cmp(context.bx, context.data.word(226)); + if (context.flags.z()) goto notboth; +difffound: + context.cl = context.data.byte(227); + context.ch = context.data.byte(228); + multidump(context); +notboth: + return; +} + +static inline void dumptextline(Context & context) { + context._cmp(context.data.byte(109), 1); + if (!context.flags.z()) goto nodumptextline; + context.data.byte(109) = 0; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.cl = 228; + context.ch = 13; + multidump(context); +nodumptextline: + return; +} + +static inline void delpointer(Context & context) { + context.ax = context.data.word(220); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nevershown; + context.data.word(224) = context.ax; + context.ax = context.data.word(222); + context.data.word(226) = context.ax; + context.cl = context.data.byte(227); + context.data.byte(229) = context.cl; + context.ch = context.data.byte(228); + context.data.byte(230) = context.ch; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + context.di = context.data.word(224); + context.bx = context.data.word(226); + multiput(context); +nevershown: + return; +} + +static inline void findnextcolon(Context & context) { +isntcolon: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto endofcolon; + context._cmp(context.al, ':'); + if (!context.flags.z()) goto isntcolon; +endofcolon: + return; +} + +static inline void printboth(Context & context) { + context.push(context.ax); + context.push(context.cx); + context.push(context.bx); + context.push(context.di); + printchar(context); + context.ax = context.pop(); + context.push(context.di); + context.di = context.ax; + multidump(context); + context.di = context.pop(); + context.bx = context.pop(); + context.cx = context.pop(); + context.ax = context.pop(); + return; +} + +static inline void waitframes(Context & context) { + context.push(context.di); + context.push(context.bx); + context.push(context.es); + context.push(context.si); + context.push(context.ds); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + delpointer(context); + context.ax = context.data.word(202); + context.ds = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + return; +} + +static inline void printslow(Context & context) { + context.data.byte(231) = 1; + context.data.byte(234) = 3; + context.ds = context.data.word(404); +printloopslow6: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloopslow5: + context.push(context.cx); + context.push(context.si); + context.push(context.es); + context.ax = context.data.word(context.si); + context.push(context.bx); + context.push(context.cx); + context.push(context.es); + context.push(context.si); + context.push(context.ds); + modifychar(context); + printboth(context); + context.ds = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.data.word(context.si+1); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishslow; + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishslow; + context._cmp(context.cl, 1); + if (context.flags.z()) goto afterslow; + context.push(context.di); + context.push(context.ds); + context.push(context.bx); + context.push(context.cx); + context.push(context.es); + context.push(context.si); + modifychar(context); + context.data.word(71) = 91; + printboth(context); + context.data.word(71) = 0; + context.si = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + waitframes(context); + context._cmp(context.ax, 0); + if (context.flags.z()) goto keepgoing; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto finishslow2; +keepgoing: + waitframes(context); +noslow: + context._cmp(context.ax, 0); + if (context.flags.z()) goto afterslow; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto finishslow2; +afterslow: + context.es = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 1); + if (--context.cx) goto printloopslow5; + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 10); + goto printloopslow6; +finishslow: + context.cx = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.al = 0; + return; +finishslow2: + context.cx = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.al = 1; + return; +} + +static inline void hangonp(Context & context) { + context.push(context.cx); + context._add(context.cx, context.cx); + context.ax = context.pop(); + context._add(context.cx, context.ax); + context.data.word(138) = 0; + context.al = context.data.byte(231); + context.ah = context.data.byte(106); + context.push(context.ax); + context.data.byte(234) = 3; + context.data.byte(106) = 0; + context.push(context.cx); + context.data.byte(100) = 255; + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + context.cx = context.pop(); +hangloop: + context.push(context.cx); + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + context.cx = context.pop(); + context.ax = context.data.word(202); + context._cmp(context.ax, 0); + if (context.flags.z()) goto notpressed; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto getoutofit; +notpressed: + if (--context.cx) goto hangloop; +getoutofit: + delpointer(context); + context.ax = context.pop(); + context.data.byte(231) = context.al; + context.data.byte(106) = context.ah; + context.data.byte(234) = 0; + return; +} + +static inline void readmouse(Context & context) { + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(202) = context.bx; + return; +} + +static inline void redrawmainscrn(Context & context) { + context.data.word(328) = 0; + createpanel(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + readmouse(context); + context.data.byte(100) = 255; + return; +} + +static inline void dolook(Context & context) { + createpanel(context); + showicon(context); + undertextline(context); + worktoscreenm(context); + context.data.byte(100) = 255; + dumptextline(context); + context.bl = context.data.byte(185); + context._and(context.bl, 31); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(436); + context._add(context.bx, 0); + context.si = context.data.word(context.bx); + context._add(context.si, 0+(38*2)); + findnextcolon(context); + context.di = 66; + context._cmp(context.data.byte(184), 50); + if (context.flags.c()) goto notdream3; + context.di = 40; +notdream3: + context.bx = 80; + context.dl = 241; + printslow(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto afterlook; + context.cx = 400; + hangonp(context); +afterlook: + context.data.byte(234) = 0; + context.data.byte(100) = 0; + redrawmainscrn(context); + worktoscreenm(context); + return; +} + +static inline void autolook(Context & context) { + context.ax = context.data.word(198); + context._cmp(context.ax, context.data.word(214)); + if (!context.flags.z()) goto diffmouse; + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(216)); + if (!context.flags.z()) goto diffmouse; + context._sub(context.data.word(98), 1); + context._cmp(context.data.word(98), 0); + if (!context.flags.z()) goto noautolook; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto noautolook; + dolook(context); +noautolook: + return; +diffmouse: + context.data.word(98) = 1000; + return; +} + +static inline void watchcount(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowatchworn; + context._add(context.data.byte(146), 1); + context._cmp(context.data.byte(146), 9); + if (context.flags.z()) goto flashdots; + context._cmp(context.data.byte(146), 18); + if (context.flags.z()) goto uptime; +nowatchworn: + return; +flashdots: + context.ax = 91*3+21; + context.di = 268+4; + context.bx = 21; + context.ds = context.data.word(404); + showframe(context); + goto finishwatch; +uptime: + context.data.byte(146) = 0; + context._add(context.data.byte(5), 1); + context._cmp(context.data.byte(5), 60); + if (!context.flags.z()) goto finishtime; + context.data.byte(5) = 0; + context._add(context.data.byte(6), 1); + context._cmp(context.data.byte(6), 60); + if (!context.flags.z()) goto finishtime; + context.data.byte(6) = 0; + context._add(context.data.byte(7), 1); + context._cmp(context.data.byte(7), 24); + if (!context.flags.z()) goto finishtime; + context.data.byte(7) = 0; +finishtime: + showtime(context); +finishwatch: + context.data.byte(266) = 1; + return; +} + +static inline void putunderzoom(Context & context) { + context.di = 8+5; + context.bx = 132+4; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.cl = 46; + context.ch = 40; + multiput(context); + return; +} + +static inline void crosshair(Context & context) { + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto nocross; + context._cmp(context.data.byte(100), 10); + if (!context.flags.c()) goto nocross; + context.es = context.data.word(400); + context.ds = context.data.word(408); + context.di = 8+24; + context.bx = 132+19; + context.al = 9; + context.ah = 0; + showframe(context); + return; +nocross: + context.es = context.data.word(400); + context.ds = context.data.word(408); + context.di = 8+24; + context.bx = 132+19; + context.al = 29; + context.ah = 0; + showframe(context); + return; +} + +static inline void zoom(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto inwatching; + context._cmp(context.data.byte(8), 1); + if (context.flags.z()) goto zoomswitch; +inwatching: + return; +zoomswitch: + context._cmp(context.data.byte(100), 199); + if (context.flags.c()) goto zoomit; +cantzoom: + putunderzoom(context); + return; +zoomit: + context.ax = context.data.word(222); + context._sub(context.ax, 9); + context.cx = 320; + context._mul(context.cx); + context._add(context.ax, context.data.word(220)); + context._sub(context.ax, 11); + context.si = context.ax; + context.ax = 132+4; + context.cx = 320; + context._mul(context.cx); + context._add(context.ax, 8+5); + context.di = context.ax; + context.es = context.data.word(400); + context.ds = context.data.word(400); + context.cx = 20; +zoomloop: + context.push(context.cx); + context.cx = 23; +zoomloop2: + context._lodsb(); + context.ah = context.al; + context._stosw(); + context.data.word(context.di+320-2) = context.ax; + if (--context.cx) goto zoomloop2; + context._add(context.si, 320-23); + context._add(context.di, 320-46+320); + context.cx = context.pop(); + if (--context.cx) goto zoomloop; + crosshair(context); + context.data.byte(75) = 1; + return; +} + +static inline void readmouse2(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(206) = context.bx; + return; +} + +static inline void dumpzoom(Context & context) { + context._cmp(context.data.byte(8), 1); + if (!context.flags.z()) goto notzoomon; + context.di = 8+5; + context.bx = 132+4; + context.cl = 46; + context.ch = 40; + multidump(context); +notzoomon: + return; +} + +static inline void findpathofpoint(Context & context) { + context.push(context.ax); + context.bx = 0; + context.es = context.data.word(450); + context.al = context.data.byte(185); + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.cx = context.pop(); + context.dl = 0; +pathloop: + context.al = context.data.byte(context.bx+6); + context._cmp(context.al, 255); + if (!context.flags.z()) goto flunkedit; + context.ax = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto flunkedit; + context._cmp(context.cl, context.al); + if (context.flags.c()) goto flunkedit; + context._cmp(context.ch, context.ah); + if (context.flags.c()) goto flunkedit; + context.ax = context.data.word(context.bx+4); + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto flunkedit; + context._cmp(context.ch, context.ah); + if (!context.flags.c()) goto flunkedit; + goto gotvalidpath; +flunkedit: + context._add(context.bx, 8); + context._add(context.dl, 1); + context._cmp(context.dl, 12); + if (!context.flags.z()) goto pathloop; + context.dl = 255; +gotvalidpath: + return; +} + +static inline void findxyfrompath(Context & context) { + getroomspaths(context); + context.al = context.data.byte(475); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.ax = context.data.word(context.bx); + context._sub(context.al, 12); + context._sub(context.ah, 12); + context.data.byte(151) = context.al; + context.data.byte(152) = context.ah; + return; +} + +static inline void showpanel(Context & context) { + context.ds = context.data.word(408); + context.di = 72; + context.bx = 0; + context.al = 19; + context.ah = 0; + showframe(context); + context.ds = context.data.word(408); + context.di = 192; + context.bx = 0; + context.al = 19; + context.ah = 0; + showframe(context); + return; +} + +static inline void showman(Context & context) { + context.ds = context.data.word(408); + context.di = 0; + context.bx = 0; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(408); + context.di = 0; + context.bx = 114; + context.al = 1; + context.ah = 0; + showframe(context); + context._cmp(context.data.byte(4), 0); + if (context.flags.z()) goto notverycool; + context.ds = context.data.word(408); + context.di = 28; + context.bx = 25; + context.al = 2; + context.ah = 0; + showframe(context); +notverycool: + return; +} + +static inline void printmessage(Context & context) { + context.push(context.dx); + context.push(context.bx); + context.push(context.di); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.di = context.pop(); + context.bx = context.pop(); + context.dx = context.pop(); + context.al = 0; + context.ah = 0; + printdirect(context); + return; +} + +static inline void usecharset1(Context & context) { + context.ax = context.data.word(404); + context.data.word(268) = context.ax; + return; +} + +static inline void roomname(Context & context) { + context.di = 88; + context.bx = 18; + context.al = 53; + context.dl = 240; + printmessage(context); + context.bl = context.data.byte(185); + context._cmp(context.bl, 32); + if (context.flags.c()) goto notover32; + context._sub(context.bl, 32); +notover32: + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(436); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(38*2)); + context.si = context.ax; + context.data.word(77) = 7; + context.di = 88; + context.bx = 25; + context.dl = 120; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto gotpl; + context.dl = 160; +gotpl: + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.word(77) = 10; + usecharset1(context); + return; +} + +static inline void showtime(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowatch; + context.al = context.data.byte(5); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3+10); + context.ds = context.data.word(404); + context.di = 282+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3+10); + context.ds = context.data.word(404); + context.di = 282+9; + context.bx = 21; + showframe(context); + context.al = context.data.byte(6); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 270+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 270+11; + context.bx = 21; + showframe(context); + context.al = context.data.byte(7); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 256+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 256+11; + context.bx = 21; + showframe(context); + context.ax = 91*3+20; + context.ds = context.data.word(404); + context.di = 267+5; + context.bx = 21; + showframe(context); +nowatch: + return; +} + +static inline void showwatch(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowristwatch; + context.ds = context.data.word(408); + context.di = 250; + context.bx = 1; + context.al = 6; + context.ah = 0; + showframe(context); + showtime(context); +nowristwatch: + return; +} + +static inline void panelicons1(Context & context) { + context.di = 0; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto watchison; + context.di = 48; +watchison: + context.push(context.di); + context.ds = context.data.word(410); + context._add(context.di, 204); + context.bx = 4; + context.al = 2; + context.ah = 0; + showframe(context); + context.di = context.pop(); + context.push(context.di); + context._cmp(context.data.byte(8), 1); + if (context.flags.z()) goto zoomisoff; + context.ds = context.data.word(408); + context._add(context.di, 228); + context.bx = 8; + context.al = 5; + context.ah = 0; + showframe(context); +zoomisoff: + context.di = context.pop(); + showwatch(context); + return; +} + +static inline void zoomicon(Context & context) { + context._cmp(context.data.byte(8), 0); + if (context.flags.z()) goto nozoom1; + context.ds = context.data.word(408); + context.di = 8; + context.bx = 132-1; + context.al = 8; + context.ah = 0; + showframe(context); +nozoom1: + return; +} + +static inline void middlepanel(Context & context) { + context.ds = context.data.word(464); + context.di = 72+47+20; + context.bx = 0; + context.al = 48; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 72+19; + context.bx = 21; + context.al = 47; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+23; + context.bx = 0; + context.al = 48; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+71; + context.bx = 21; + context.al = 47; + context.ah = 4; + showframe(context); + return; +} + +static inline void showicon(Context & context) { + context._cmp(context.data.byte(184), 50); + if (!context.flags.c()) goto isdream1; + showpanel(context); + showman(context); + roomname(context); + panelicons1(context); + zoomicon(context); + return; +isdream1: + context.ds = context.data.word(464); + context.di = 72; + context.bx = 2; + context.al = 45; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 72+47; + context.bx = 2; + context.al = 46; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 69-10; + context.bx = 21; + context.al = 49; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+88; + context.bx = 2; + context.al = 45; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+43; + context.bx = 2; + context.al = 46; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+101; + context.bx = 21; + context.al = 49; + context.ah = 4; + showframe(context); + middlepanel(context); + return; +} + +static inline void getunderzoom(Context & context) { + context.di = 8+5; + context.bx = 132+4; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.cl = 46; + context.ch = 40; + multiget(context); + return; +} + +static inline void walkintoroom(Context & context) { + context._cmp(context.data.byte(9), 14); + if (!context.flags.z()) goto notlair; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notlair; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + autosetwalk(context); +notlair: + return; +} + +static inline void isryanholding(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.dl = 0; +searchinv: + context._cmp(context.data.byte(context.bx+2), 4); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofindininv; + context.al = context.dl; + context._cmp(context.al, 114); + return; +nofindininv: + context._add(context.bx, 16); + context._add(context.dl, 1); + context._cmp(context.dl, 114); + if (!context.flags.z()) goto searchinv; + context.al = context.dl; + context._cmp(context.al, 114); + return; +} + +static inline void findexobject(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.dl = 0; +findexloop: + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofindex; + context.al = context.dl; + return; +nofindex: + context._add(context.bx, 16); + context._add(context.dl, 1); + context._cmp(context.dl, 114); + if (!context.flags.z()) goto findexloop; + context.al = context.dl; + return; +} + +static inline void getexad(Context & context) { + context.ah = 0; + context.bx = 16; + context._mul(context.bx); + context.bx = context.ax; + context.es = context.data.word(398); + context._add(context.bx, 0+2080+30000); + return; +} + +static inline void getanyaddir(Context & context) { + context._cmp(context.ah, 4); + if (context.flags.z()) goto isex3; + context._cmp(context.ah, 2); + if (context.flags.z()) goto isfree3; + getsetad(context); + return; +isfree3: + getfreead(context); + return; +isex3: + getexad(context); + return; +} + +static inline void compare(Context & context) { + context._sub(context.dl, 'A'); + context._sub(context.dh, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.push(context.cx); + context.push(context.dx); + getanyaddir(context); + context.dx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.word(context.bx+12), context.cx); + if (!context.flags.z()) goto comparefin; + context._cmp(context.data.word(context.bx+14), context.dx); +comparefin: + return; +} + +static inline void setuptimeduse(Context & context) { + context._cmp(context.data.word(328), 0); + if (!context.flags.z()) goto cantsetup; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; + context._add(context.dx, context.cx); + context.data.word(328) = context.dx; + context.bl = context.al; + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(454); + context.cx = 66*2; + context.ax = context.data.word(context.bx); + context._add(context.ax, context.cx); + context.bx = context.ax; + context.data.word(332) = context.es; + context.data.word(334) = context.bx; +cantsetup: + return; +} + +static inline void reminders(Context & context) { + context._cmp(context.data.byte(184), 24); + if (!context.flags.z()) goto notinedenslift; + context._cmp(context.data.byte(148), 44); + if (!context.flags.z()) goto notinedenslift; + context._cmp(context.data.byte(2), 0); + if (!context.flags.z()) goto notfirst; + context.al = 'D'; + context.ah = 'K'; + context.cl = 'E'; + context.ch = 'Y'; + isryanholding(context); + if (context.flags.z()) goto forgotone; + context.al = 'C'; + context.ah = 'S'; + context.cl = 'H'; + context.ch = 'R'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto forgotone; + context.ax = context.data.word(context.bx+2); + context._cmp(context.al, 4); + if (!context.flags.z()) goto forgotone; + context._cmp(context.ah, 255); + if (context.flags.z()) goto havegotcard; + context.cl = 'P'; + context.ch = 'U'; + context.dl = 'R'; + context.dh = 'S'; + context._xchg(context.al, context.ah); + compare(context); + if (!context.flags.z()) goto forgotone; +havegotcard: + context._add(context.data.byte(2), 1); +notfirst: + return; +forgotone: + context.al = 50; + context.bl = 54; + context.bh = 70; + context.cx = 48; + context.dx = 8; + setuptimeduse(context); + return; +notinedenslift: + return; +} + +static inline void afternewroom(Context & context) { + context._cmp(context.data.byte(186), 0); + if (context.flags.z()) goto notnew; + context.data.word(328) = 0; + createpanel(context); + context.data.byte(100) = 0; + findroominloc(context); + context._cmp(context.data.byte(63), 1); + if (context.flags.z()) goto ryansoff; + context.al = context.data.byte(151); + context._add(context.al, 12); + context.ah = context.data.byte(152); + context._add(context.ah, 12); + findpathofpoint(context); + context.data.byte(475) = context.dl; + findxyfrompath(context); + context.data.byte(187) = 1; +ryansoff: + context.data.byte(62) = 1; + drawfloor(context); + context.data.word(98) = 160; + context.data.byte(186) = 0; + showicon(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + mainscreen(context); + getunderzoom(context); + zoom(context); + worktoscreenm(context); + walkintoroom(context); + reminders(context); + atmospheres(context); +notnew: + return; +} + +static inline void readmouse3(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(208) = context.bx; + return; +} + +static inline void readmouse4(Context & context) { + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.ax = context.data.word(204); + context._or(context.ax, context.data.word(206)); + context._or(context.ax, context.data.word(208)); + context._or(context.bx, context.ax); + context.data.word(202) = context.bx; + return; +} + +static inline void dumpwatch(Context & context) { + context._cmp(context.data.byte(266), 1); + if (!context.flags.z()) goto nodumpwatch; + context.di = 256; + context.bx = 21; + context.cl = 40; + context.ch = 12; + multidump(context); + context.data.byte(266) = 0; +nodumpwatch: + return; +} + +static inline void screenupdate(Context & context) { + newplace(context); + mainscreen(context); + animpointer(context); + showpointer(context); + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatchingmode; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto finishearly; +iswatchingmode: + vsync(context); + readmouse1(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + autolook(context); + spriteupdate(context); + watchcount(context); + zoom(context); + showpointer(context); + context._cmp(context.data.byte(391), 0); + if (!context.flags.z()) goto finishearly; + vsync(context); + readmouse2(context); + dumppointer(context); + dumpzoom(context); + delpointer(context); + deleverything(context); + printsprites(context); + reelsonscreen(context); + afternewroom(context); + showpointer(context); + vsync(context); + readmouse3(context); + dumppointer(context); + dumpmap(context); + dumptimedtext(context); + delpointer(context); + showpointer(context); + vsync(context); + readmouse4(context); + dumppointer(context); + dumpwatch(context); + delpointer(context); +finishearly: + return; +} + +static inline void greyscalesum(Context & context) { + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 256; +greysumloop1: + context.push(context.cx); + context.bx = 0; + context.al = context.data.byte(context.si); + context.ah = 0; + context.cx = 20; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.si+1); + context.ah = 0; + context.cx = 59; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.si+2); + context.ah = 0; + context.cx = 11; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = -1; +greysumloop2: + context._add(context.al, 1); + context._sub(context.bx, 100); + if (!context.flags.c()) goto greysumloop2; + context.bl = context.al; + context.al = context.bl; + context.ah = context.data.byte(348); + context._cmp(context.al, 0); + context._add(context.al, context.ah); +noaddr: + context._stosb(); + context.ah = context.data.byte(347); + context.al = context.bl; + context._cmp(context.al, 0); + if (context.flags.z()) goto noaddg; + context._add(context.al, context.ah); +noaddg: + context._stosb(); + context.ah = context.data.byte(349); + context.al = context.bl; + context._cmp(context.al, 0); + if (context.flags.z()) goto noaddb; + context._add(context.al, context.ah); +noaddb: + context._stosb(); + context._add(context.si, 3); + context.cx = context.pop(); + if (--context.cx) goto greysumloop1; + return; +} + +static inline void endpaltostart(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static inline void createpanel(Context & context) { + context.di = 0; + context.bx = 8; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 8; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 0; + context.bx = 104; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 104; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + return; +} + +static inline void createpanel2(Context & context) { + createpanel(context); + context.di = 0; + context.bx = 0; + context.ds = context.data.word(410); + context.al = 5; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 0; + context.ds = context.data.word(410); + context.al = 5; + context.ah = 2; + showframe(context); + return; +} + +static inline void fadescreenup(Context & context) { + clearstartpal(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static inline void hangone(Context & context) { +hangonloope: + context.push(context.cx); + vsync(context); + context.cx = context.pop(); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto hangonearly; + if (--context.cx) goto hangonloope; + return; +hangonearly: + context.ax = context.pop(); + context.ax = context.pop(); + return; +} + +static inline void rollem(Context & context) { + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; + context.ds = context.data.word(402); + context.si = 0; + multiget(context); + context.es = context.data.word(466); + context.si = 49*2; + context.ax = context.data.word(context.si); + context.si = context.ax; + context._add(context.si, 66*2); + context.cx = 80; +endcredits21: + context.push(context.cx); + context.bx = 10; + context.cx = context.data.word(77); +endcredits22: + context.push(context.cx); + context.push(context.si); + context.push(context.di); + context.push(context.es); + context.push(context.bx); + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; + context.ds = context.data.word(402); + context.si = 0; + multiput(context); + vsync(context); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + context.push(context.si); + context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.cx = 18; +onelot2: + context.push(context.cx); + context.di = 25; + context.dx = 161; + context.ax = 0; + printdirect(context); + context._add(context.bx, context.data.word(77)); + context.cx = context.pop(); + if (--context.cx) goto onelot2; + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; + multidump(context); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto endearly2; + context._sub(context.bx, 1); + if (--context.cx) goto endcredits22; + context.cx = context.pop(); +looknext2: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto gotnext2; + context._cmp(context.al, 0); + if (context.flags.z()) goto gotnext2; + goto looknext2; +gotnext2: + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto endearly; + if (--context.cx) goto endcredits21; + context.cx = 120; + hangone(context); + return; +endearly2: + context.cx = context.pop(); +endearly: + return; +} + +static inline void rollendcredits2(Context & context) { + rollem(context); + return; +} + +static inline void showgun(Context & context) { + context.data.byte(348) = 0; + context.data.byte(347) = 0; + context.data.byte(349) = 0; + paltostartpal(context); + paltoendpal(context); + greyscalesum(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 130; + hangon(context); + endpaltostart(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 200; + hangon(context); + context.data.byte(531) = 34; + loadroomssample(context); + context.data.byte(386) = 0; + context.dx = 2364; + loadintotemp(context); + createpanel2(context); + context.ds = context.data.word(458); + context.al = 0; + context.ah = 0; + context.di = 100; + context.bx = 4; + showframe(context); + context.ds = context.data.word(458); + context.al = 1; + context.ah = 0; + context.di = 158; + context.bx = 106; + showframe(context); + worktoscreen(context); + getridoftemp(context); + fadescreenup(context); + context.cx = 160; + hangon(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.dx = 2273; + loadtemptext(context); + rollendcredits2(context); + getridoftemptext(context); + return; +} + +static inline void fadescreendown(Context & context) { + paltostartpal(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static inline void hangon(Context & context) { +hangonloop: + context.push(context.cx); + vsync(context); + context.cx = context.pop(); + if (--context.cx) goto hangonloop; + return; +} + +static inline void paltostartpal(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static inline void clearendpal(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; + context.al = 0; + while(--context.cx) context._stosb(); + return; +} + +static inline void fadescreendowns(Context & context) { + paltostartpal(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; + return; +} + +static inline void loadtemptext(Context & context) { + standardload(context); + context.data.word(466) = context.ax; + return; +} + +static inline void twodigitnum(Context & context) { + context.ah = context.cl; + context._sub(context.ah, 1); +numloop1: + context._add(context.ah, 1); + context._sub(context.al, 10); + if (!context.flags.c()) goto numloop1; + context._add(context.al, 10); + context._add(context.al, context.cl); + return; +} + +static inline void cancelch1(Context & context) { + context.data.word(521) = 0; + context.data.byte(515) = 255; + return; +} + +static inline void loadroomssample(Context & context) { + context.al = context.data.byte(531); + context._cmp(context.al, 255); + if (context.flags.z()) goto loadedalready; + context._cmp(context.al, context.data.byte(530)); + if (context.flags.z()) goto loadedalready; + context.data.byte(530) = context.al; + context.al = context.data.byte(530); + context.cl = '0'; + twodigitnum(context); + context.di = 1909; + context._xchg(context.al, context.ah); + context.data.word(context.di+10) = context.ax; + context.dx = context.di; + loadsecondsample(context); +loadedalready: + return; +} + +static inline void readheader(Context & context) { + context.ds = context.cs; + context.dx = 5881; + context.cx = 5958-context.data.byte(5881); + readfromfile(context); + context.es = context.cs; + context.di = 5952; + return; +} + +static inline void standardload(Context & context) { + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.ds = context.ax; + context.cx = context.pop(); + context.push(context.ax); + context.dx = 0; + readfromfile(context); + closefile(context); + context.ax = context.pop(); + return; +} + +static inline void loadintotemp(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(458) = context.ax; + return; +} + +static inline void showmonk(Context & context) { + context.al = 0; + context.ah = 128; + context.di = 160; + context.bx = 72; + context.ds = context.data.word(458); + showframe(context); + return; +} + +static inline void getridoftemp(Context & context) { + context.es = context.data.word(458); + deallocatemem(context); + return; +} + +static inline void monkspeaking(Context & context) { + context.data.byte(531) = 35; + loadroomssample(context); + context.dx = 2377; + loadintotemp(context); + clearwork(context); + showmonk(context); + worktoscreen(context); + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; + context.al = 12; + context.ah = 255; + playchannel0(context); + fadescreenups(context); + context.cx = 300; + hangon(context); + context.al = 40; +nextmonkspeak: + context.push(context.ax); + context.ah = 0; + context.si = context.ax; + context._add(context.si, context.si); + context.es = context.data.word(466); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; +nextbit: + context.di = 36; + context.bx = 140; + context.dl = 239; + printdirect(context); + context.push(context.ax); + context.push(context.si); + context.push(context.es); + worktoscreen(context); + clearwork(context); + showmonk(context); + context.cx = 240; + hangon(context); + context.es = context.pop(); + context.si = context.pop(); + context.ax = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto nextbit; + context.ax = context.pop(); + context._add(context.al, 1); + context._cmp(context.al, 44); + if (!context.flags.z()) goto nextmonkspeak; + context.data.byte(388) = 1; + context.data.byte(387) = 7; + fadescreendowns(context); + context.cx = 300; + hangon(context); + getridoftemp(context); + return; +} + +static inline void loadintroroom(Context & context) { + context.data.byte(139) = 0; + context.data.byte(9) = 255; + loadroom(context); + context.data.word(121) = 72; + context.data.word(123) = 16; + clearsprites(context); + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; + clearwork(context); + context.data.byte(62) = 1; + drawfloor(context); + reelsonscreen(context); + spriteupdate(context); + printsprites(context); + worktoscreen(context); + return; +} + +static inline void clearstartpal(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 256; +wholeloop1: + context.ax = 0; + context._stosw(); + context.al = 0; + context._stosb(); + if (--context.cx) goto wholeloop1; + return; +} + +static inline void paltoendpal(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static inline void fadescreenups(Context & context) { + clearstartpal(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; + return; +} + +static inline void playchannel0(Context & context) { + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto dontbother4; + context.push(context.es); + context.push(context.ds); + context.push(context.bx); + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.data.byte(507) = context.al; + context.es = context.data.word(420); + context._cmp(context.al, 12); + if (context.flags.c()) goto notsecondbank; + context.es = context.data.word(422); + context._sub(context.al, 12); +notsecondbank: + context.data.byte(508) = context.ah; + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context.data.word(502) = context.ax; + context.ax = context.data.word(context.bx+1); + context.data.word(504) = context.ax; + context.ax = context.data.word(context.bx+3); + context.data.word(506) = context.ax; + context._cmp(context.data.byte(508), 0); + if (context.flags.z()) goto nosetloop; + context.ax = context.data.word(502); + context.data.word(510) = context.ax; + context.ax = context.data.word(504); + context.data.word(512) = context.ax; + context.ax = context.data.word(506); + context.data.word(514) = context.ax; +nosetloop: + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); +dontbother4: + return; +} + +static inline void cancelch0(Context & context) { + context.data.byte(508) = 0; + context.data.word(506) = 0; + context.data.byte(507) = 255; + return; +} + +static inline void atmospheres(Context & context) { + context.cl = context.data.byte(148); + context.ch = context.data.byte(149); + context.bx = 5073; +nextatmos: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto nomoreatmos; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto wrongatmos; + context.ax = context.data.word(context.bx+1); + context._cmp(context.ax, context.cx); + if (!context.flags.z()) goto wrongatmos; + context.ax = context.data.word(context.bx+3); + context._cmp(context.al, context.data.byte(507)); + if (context.flags.z()) goto playingalready; + context._cmp(context.data.byte(9), 45); + if (!context.flags.z()) goto notweb; + context._cmp(context.data.word(23), 45); + if (context.flags.z()) goto wrongatmos; +notweb: + playchannel0(context); + context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(149), 0); + if (context.flags.z()) goto fullvol; + if (!context.flags.z()) goto notlouisvol; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto notlouisvol; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notlouisvol; + context.data.byte(386) = 5; +notlouisvol: +playingalready: + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notlouisvol2; + context._cmp(context.data.byte(148), 22); + if (context.flags.z()) goto louisvol; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto notlouisvol2; +fullvol: + context.data.byte(386) = 0; +notlouisvol2: + return; +louisvol: + context.data.byte(386) = 5; + return; +wrongatmos: + context._add(context.bx, 5); + goto nextatmos; +nomoreatmos: + cancelch0(context); + return; +} + +static inline void spriteupdate(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.al = context.data.byte(63); + context.data.byte(context.bx+31) = context.al; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +_tmp18: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto _tmp18a; + context.push(context.es); + context.push(context.ds); + context.cx = context.data.word(context.bx+2); + context.data.word(context.bx+24) = context.cx; + __dispatch_call(context, context.ax); + context.ds = context.pop(); + context.es = context.pop(); +_tmp18a: + context.bx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(186), 1); + if (context.flags.z()) goto _tmp18b; + context._add(context.bx, 32); + if (--context.cx) goto _tmp18; +_tmp18b: + return; +} + +static inline void maptopanel(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); + context.si = 0; + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multiput(context); + return; +} + +static inline void deleverything(Context & context) { + context.al = context.data.byte(129); + context.ah = 0; + context._add(context.ax, context.data.word(123)); + context._cmp(context.ax, 182); + if (!context.flags.c()) goto bigroom; + maptopanel(context); + return; +bigroom: + context._sub(context.data.byte(129), 8); + maptopanel(context); + context._add(context.data.byte(129), 8); + return; +} + +static inline void printasprite(Context & context) { + context.push(context.es); + context.push(context.bx); + context.si = context.bx; + context.ds = context.data.word(context.si+6); + context.al = context.data.byte(context.si+11); + context.ah = 0; + context._cmp(context.al, 220); + if (context.flags.c()) goto notnegative1; + context.ah = 255; +notnegative1: + context.bx = context.ax; + context._add(context.bx, context.data.word(119)); + context.al = context.data.byte(context.si+10); + context.ah = 0; + context._cmp(context.al, 220); + if (context.flags.c()) goto notnegative2; + context.ah = 255; +notnegative2: + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context.al = context.data.byte(context.si+15); + context.ah = 0; + context._cmp(context.data.byte(context.si+30), 0); + if (context.flags.z()) goto steadyframe; + context.ah = 8; +steadyframe: + context._cmp(context.data.byte(182), 6); + if (!context.flags.z()) goto notquickp; +notquickp: + showframe(context); + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void printsprites(Context & context) { + context.es = context.data.word(412); + context.cx = 0; +priorityloop: + context.push(context.cx); + context.data.byte(182) = context.cl; + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +prtspriteloop: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto skipsprite; + context.al = context.data.byte(182); + context._cmp(context.al, context.data.byte(context.bx+23)); + if (!context.flags.z()) goto skipsprite; + context._cmp(context.data.byte(context.bx+31), 1); + if (context.flags.z()) goto skipsprite; + printasprite(context); +skipsprite: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 32); + if (--context.cx) goto prtspriteloop; + context.cx = context.pop(); + context._add(context.cx, 1); + context._cmp(context.cx, 7); + if (!context.flags.z()) goto priorityloop; + return; +} + +static inline void undertextline(Context & context) { + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.ds = context.data.word(412); + context.si = 0; + context.cl = 228; + context.ch = 13; + multiget(context); + return; +} + +static inline void reconstruct(Context & context) { + context._cmp(context.data.byte(130), 0); + if (context.flags.z()) goto noneedtorecon; + context.data.byte(62) = 1; + drawfloor(context); + spriteupdate(context); + printsprites(context); + context._cmp(context.data.byte(184), 20); + if (!context.flags.z()) goto notfudge; + undertextline(context); +notfudge: + context.data.byte(130) = 0; +noneedtorecon: + return; +} + +static inline void updatepeople(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.data.word(18) = context.di; + context.cx = 12*5; + context.al = 255; + while(--context.cx) context._stosb(); + context._add(context.data.word(138), 1); + context.es = context.cs; + context.bx = 537; + context.di = 1003; +updateloop: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto endupdate; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinthisroom; + context.cx = context.data.word(context.bx+1); + context._cmp(context.cl, context.data.byte(148)); + if (!context.flags.z()) goto notinthisroom; + context._cmp(context.ch, context.data.byte(149)); + if (!context.flags.z()) goto notinthisroom; + context.push(context.di); + context.ax = context.data.word(context.di); + __dispatch_call(context, context.ax); + context.di = context.pop(); +notinthisroom: + context._add(context.bx, 8); + context._add(context.di, 2); + goto updateloop; +endupdate: + return; +} + +static inline void getreelstart(Context & context) { + context.ax = context.data.word(239); + context.cx = 40; + context._mul(context.cx); + context.es = context.data.word(450); + context.si = context.ax; + context._add(context.si, 0+(36*144)); + return; +} + +static inline void placesetobject(Context & context) { + context.push(context.es); + context.push(context.bx); + context.cl = 0; + context.ch = 0; + findormake(context); + getsetad(context); + context.data.byte(context.bx+58) = 0; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void getsetad(Context & context) { + context.ah = 0; + context.bx = 64; + context._mul(context.bx); + context.bx = context.ax; + context.es = context.data.word(428); + return; +} + +static inline void removesetobject(Context & context) { + context.push(context.es); + context.push(context.bx); + context.cl = 255; + context.ch = 0; + findormake(context); + getsetad(context); + context.data.byte(context.bx+58) = 255; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void findormake(Context & context) { + context.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); + context.push(context.ax); + context.es = context.data.word(412); + context.ah = context.data.byte(184); +changeloop: + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto haventfound; + context._cmp(context.ax, context.data.word(context.bx)); + if (!context.flags.z()) goto nofoundchange; + context._cmp(context.ch, context.data.byte(context.bx+3)); + if (context.flags.z()) goto foundchange; +nofoundchange: + context._add(context.bx, 4); + goto changeloop; +foundchange: + context.ax = context.pop(); + context.data.byte(context.bx+2) = context.cl; + return; +haventfound: + context.data.word(context.bx) = context.ax; + context.data.word(context.bx+2) = context.cx; + context.ax = context.pop(); + return; +} + +static inline void placefreeobject(Context & context) { + context.push(context.es); + context.push(context.bx); + context.cl = 0; + context.ch = 1; + findormake(context); + getfreead(context); + context.data.byte(context.bx+2) = 0; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void getfreead(Context & context) { + context.ah = 0; + context.cl = 4; + context._shl(context.ax, context.cl); + context.bx = context.ax; + context.es = context.data.word(426); + return; +} + +static inline void removefreeobject(Context & context) { + context.push(context.es); + context.push(context.bx); + getfreead(context); + context.data.byte(context.bx+2) = 255; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void switchryanoff(Context & context) { + context.data.byte(63) = 1; + return; +} + +static inline void switchryanon(Context & context) { + context.data.byte(63) = 255; + return; +} + +static inline void movemap(Context & context) { + context._cmp(context.ah, 32); + if (!context.flags.z()) goto notmapup2; + context._sub(context.data.byte(149), 20); + context.data.byte(186) = 1; + return; +notmapup2: + context._cmp(context.ah, 16); + if (!context.flags.z()) goto notmapupspec; + context._sub(context.data.byte(149), 10); + context.data.byte(186) = 1; + return; +notmapupspec: + context._cmp(context.ah, 8); + if (!context.flags.z()) goto notmapdownspec; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; + return; +notmapdownspec: + context._cmp(context.ah, 2); + if (!context.flags.z()) goto notmaprightspec; + context._add(context.data.byte(148), 11); + context.data.byte(186) = 1; + return; +notmaprightspec: + context._sub(context.data.byte(148), 11); + context.data.byte(186) = 1; + return; +} + +static inline void dealwithspecial(Context & context) { + context._sub(context.al, 220); + context._cmp(context.al, 0); + if (!context.flags.z()) goto notplset; + context.al = context.ah; + placesetobject(context); + context.data.byte(130) = 1; + return; +notplset: + context._cmp(context.al, 1); + if (!context.flags.z()) goto notremset; + context.al = context.ah; + removesetobject(context); + context.data.byte(130) = 1; + return; +notremset: + context._cmp(context.al, 2); + if (!context.flags.z()) goto notplfree; + context.al = context.ah; + placefreeobject(context); + context.data.byte(130) = 1; + return; +notplfree: + context._cmp(context.al, 3); + if (!context.flags.z()) goto notremfree; + context.al = context.ah; + removefreeobject(context); + context.data.byte(130) = 1; + return; +notremfree: + context._cmp(context.al, 4); + if (!context.flags.z()) goto notryanoff; + switchryanoff(context); + return; +notryanoff: + context._cmp(context.al, 5); + if (!context.flags.z()) goto notryanon; + context.data.byte(135) = context.ah; + context.data.byte(133) = context.ah; + switchryanon(context); + return; +notryanon: + context._cmp(context.al, 6); + if (!context.flags.z()) goto notchangeloc; + context.data.byte(188) = context.ah; + return; +notchangeloc: + movemap(context); + return; +} + +static inline void findsource(Context & context) { + context.ax = context.data.word(160); + context._cmp(context.ax, 160); + if (!context.flags.c()) goto over1000; + context.ds = context.data.word(430); + context.data.word(244) = 0; + return; +over1000: + context._cmp(context.ax, 320); + if (!context.flags.c()) goto over1001; + context.ds = context.data.word(432); + context.data.word(244) = 160; + return; +over1001: + context.ds = context.data.word(434); + context.data.word(244) = 320; + return; +} + +static inline void showreelframe(Context & context) { + context.al = context.data.byte(context.si+2); + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context.al = context.data.byte(context.si+3); + context.bx = context.ax; + context._add(context.bx, context.data.word(119)); + context.ax = context.data.word(context.si); + context.data.word(160) = context.ax; + findsource(context); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context.ah = 8; + showframe(context); + return; +} + +static inline void soundonreels(Context & context) { + context.bl = context.data.byte(184); + context._add(context.bl, context.bl); + context._xor(context.bh, context.bh); + context._add(context.bx, 1254); + context.si = context.data.word(context.bx); +reelsoundloop: + context.al = context.data.byte(context.si); + context._cmp(context.al, 255); + if (context.flags.z()) goto endreelsound; + context.ax = context.data.word(context.si+1); + context._cmp(context.ax, context.data.word(239)); + if (!context.flags.z()) goto skipreelsound; + context._cmp(context.ax, context.data.word(351)); + if (context.flags.z()) goto skipreelsound; + context.data.word(351) = context.ax; + context.al = context.data.byte(context.si); + context._cmp(context.al, 64); + if (context.flags.c()) { playchannel1(context); return; }; + context._cmp(context.al, 128); + if (context.flags.c()) goto channel0once; + context._and(context.al, 63); + context.ah = 255; + { playchannel0(context); return; }; +channel0once: + context._and(context.al, 63); + context.ah = 0; + { playchannel0(context); return; }; +skipreelsound: + context._add(context.si, 3); + goto reelsoundloop; +endreelsound: + context.ax = context.data.word(351); + context._cmp(context.ax, context.data.word(239)); + if (context.flags.z()) goto nochange2; + context.data.word(351) = -1; +nochange2: + return; +} + +static inline void plotreel(Context & context) { + getreelstart(context); +retryreel: + context.push(context.es); + context.push(context.si); + context.ax = context.data.word(context.si+2); + context._cmp(context.al, 220); + if (context.flags.c()) goto normalreel; + context._cmp(context.al, 255); + if (context.flags.z()) goto normalreel; + dealwithspecial(context); + context._add(context.data.word(239), 1); + context.si = context.pop(); + context.es = context.pop(); + context._add(context.si, 40); + goto retryreel; +normalreel: + context.cx = 8; +plotloop: + context.push(context.cx); + context.push(context.es); + context.push(context.si); + context.ax = context.data.word(context.si); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto notplot; + showreelframe(context); +notplot: + context.si = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context._add(context.si, 5); + if (--context.cx) goto plotloop; + soundonreels(context); + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void checkforshake(Context & context) { + context._cmp(context.data.byte(184), 26); + if (!context.flags.z()) goto notstartshake; + context._cmp(context.ax, 104); + if (!context.flags.z()) goto notstartshake; + context.data.byte(68) = -1; +notstartshake: + return; +} + +static inline void getroomspaths(Context & context) { + context.al = context.data.byte(185); + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); + return; +} + +static inline void checkdest(Context & context) { + context.push(context.bx); + context._add(context.bx, 12*8); + context.ah = context.data.byte(475); + context.cl = 4; + context._shl(context.ah, context.cl); + context.al = context.data.byte(478); + context.cl = 24; + context.ch = context.data.byte(478); +checkdestloop: + context.dh = context.data.byte(context.bx); + context._and(context.dh, 0b11110000); + context.dl = context.data.byte(context.bx); + context._and(context.dl, 0b00001111); + context._cmp(context.ax, context.dx); + if (!context.flags.z()) goto nextcheck; + context.al = context.data.byte(context.bx+1); + context._and(context.al, 15); + context.data.byte(478) = context.al; + context.bx = context.pop(); + return; +nextcheck: + context.dl = context.data.byte(context.bx); + context._and(context.dl, 0b11110000); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context.dh = context.data.byte(context.bx); + context._and(context.dh, 0b00001111); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._cmp(context.ax, context.dx); + if (!context.flags.z()) goto nextcheck2; + context.ch = context.data.byte(context.bx+1); + context._and(context.ch, 15); +nextcheck2: + context._add(context.bx, 2); + context._sub(context.cl, 1); + if (!context.flags.z()) goto checkdestloop; + context.data.byte(478) = context.ch; + context.bx = context.pop(); + return; +} + +static inline void workoutframes(Context & context) { + context.bx = context.data.word(480); + context._add(context.bx, 32); + context.ax = context.data.word(484); + context._add(context.ax, 32); + context._sub(context.bx, context.ax); + if (!context.flags.c()) goto notneg1; + context._neg(context.bx); +notneg1: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto notneg2; + context._neg(context.cx); +notneg2: + context._cmp(context.bx, context.cx); + if (!context.flags.c()) goto tendstohoriz; + context.dl = 2; + context.ax = context.cx; + context._shr(context.ax, 1); + context._cmp(context.bx, context.ax); + if (context.flags.c()) goto gotquad; + context.dl = 1; + goto gotquad; +tendstohoriz: + context.dl = 0; + context.ax = context.bx; + context._shr(context.ax, 1); + context._cmp(context.cx, context.ax); + if (context.flags.c()) goto gotquad; + context.dl = 1; + goto gotquad; +gotquad: + context.bx = context.data.word(480); + context._add(context.bx, 32); + context.ax = context.data.word(484); + context._add(context.ax, 32); + context._sub(context.bx, context.ax); + if (context.flags.c()) goto isinright; +isinleft: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto topleft; + context._cmp(context.dl, 1); + if (context.flags.z()) goto noswap1; + context._xor(context.dl, 2); +noswap1: + context._add(context.dl, 4); + goto success; +topleft: + context._add(context.dl, 6); + goto success; +isinright: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto botright; + context._add(context.dl, 2); + goto success; +botright: + context._cmp(context.dl, 1); + if (context.flags.z()) goto noswap2; + context._xor(context.dl, 2); +noswap2: +success: + context._and(context.dl, 7); + context.data.byte(135) = context.dl; + context.data.byte(136) = 0; + return; +} + +static inline void bresenhams(Context & context) { + workoutframes(context); + context.dx = context.ds; + context.es = context.dx; + context.di = 8344; + context.si = 1; + context.data.byte(493) = 0; + context.cx = context.data.word(484); + context._sub(context.cx, context.data.word(480)); + if (context.flags.z()) goto vertline; + if (!context.flags.s()) goto line1; + context._neg(context.cx); + context.bx = context.data.word(484); + context._xchg(context.bx, context.data.word(480)); + context.data.word(484) = context.bx; + context.bx = context.data.word(486); + context._xchg(context.bx, context.data.word(482)); + context.data.word(486) = context.bx; + context.data.byte(493) = 1; +line1: + context.bx = context.data.word(486); + context._sub(context.bx, context.data.word(482)); + if (context.flags.z()) goto horizline; + if (!context.flags.s()) goto line3; + context._neg(context.bx); + context._neg(context.si); +line3: + context.push(context.si); + context.data.byte(491) = 0; + context._cmp(context.bx, context.cx); + if (context.flags.le()) goto line4; + context.data.byte(491) = 1; + context._xchg(context.bx, context.cx); +line4: + context._shl(context.bx, 1); + context.data.word(488) = context.bx; + context._sub(context.bx, context.cx); + context.si = context.bx; + context._sub(context.bx, context.cx); + context.data.word(490) = context.bx; + context.ax = context.data.word(480); + context.bx = context.data.word(482); + context.ah = context.bl; + context._add(context.cx, 1); + context.bx = context.pop(); + context._cmp(context.data.byte(491), 1); + if (context.flags.z()) goto hislope; + goto loslope; +vertline: + context.ax = context.data.word(482); + context.bx = context.data.word(486); + context.cx = context.bx; + context._sub(context.cx, context.ax); + if (!context.flags.ge()) goto line31; + context._neg(context.cx); + context.ax = context.bx; + context.data.byte(493) = 1; +line31: + context._add(context.cx, 1); + context.bx = context.data.word(480); + context._xchg(context.ax, context.bx); + context.ah = context.bl; + context.bx = context.si; +line32: + context._stosw(); + context._add(context.ah, context.bl); + if (--context.cx) goto line32; + goto lineexit; +horizline: + context.ax = context.data.word(480); + context.bx = context.data.word(482); + context.ah = context.bl; + context._add(context.cx, 1); +horizloop: + context._stosw(); + context._add(context.al, 1); + if (--context.cx) goto horizloop; + goto lineexit; +loslope: +loloop: + context._stosw(); + context._add(context.al, 1); + context._or(context.si, context.si); + if (!context.flags.s()) goto line12; + context._add(context.si, context.data.word(488)); + if (--context.cx) goto loloop; + goto lineexit; +line12: + context._add(context.si, context.data.word(490)); + context._add(context.ah, context.bl); + if (--context.cx) goto loloop; + goto lineexit; +hislope: +hiloop: + context._stosw(); + context._add(context.ah, context.bl); + context._or(context.si, context.si); + if (!context.flags.s()) goto line23; + context._add(context.si, context.data.word(488)); + if (--context.cx) goto hiloop; + goto lineexit; +line23: + context._add(context.si, context.data.word(490)); + context._add(context.al, 1); + if (--context.cx) goto hiloop; +lineexit: + context._sub(context.di, 8344); + context.ax = context.di; + context._shr(context.ax, 1); + context.data.byte(494) = context.al; + return; +} + +static inline void autosetwalk(Context & context) { + context.al = context.data.byte(475); + context._cmp(context.data.byte(477), context.al); + if (!context.flags.z()) goto notsamealready; + return; +notsamealready: + getroomspaths(context); + checkdest(context); + context.push(context.bx); + context.al = context.data.byte(475); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(480) = context.ax; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(482) = context.ax; + context.bx = context.pop(); + context.al = context.data.byte(478); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(484) = context.ax; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(486) = context.ax; + bresenhams(context); + context._cmp(context.data.byte(493), 0); + if (context.flags.z()) goto normalline; + context.al = context.data.byte(494); + context._sub(context.al, 1); + context.data.byte(492) = context.al; + context.data.byte(493) = 1; + return; +normalline: + context.data.byte(492) = 0; + return; +} + +static inline void watchreel(Context & context) { + context._cmp(context.data.word(23), -1); + if (context.flags.z()) goto notplayingreel; + context.al = context.data.byte(475); + context._cmp(context.al, context.data.byte(477)); + if (!context.flags.z()) goto waitstopwalk; + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); + if (context.flags.z()) goto notwatchpath; +waitstopwalk: + return; +notwatchpath: + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); + if (!context.flags.z()) goto showwatchreel; + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context.ax = context.data.word(23); + context._cmp(context.ax, context.data.word(25)); + if (!context.flags.z()) goto ismorereel; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto showwatchreel; + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.word(29), -1); + if (context.flags.z()) goto nomorereel; + context.data.byte(32) = 1; + goto notplayingreel; +ismorereel: + context._add(context.data.word(23), 1); +showwatchreel: + context.ax = context.data.word(23); + context.data.word(239) = context.ax; + plotreel(context); + context.ax = context.data.word(239); + context.data.word(23) = context.ax; + checkforshake(context); +nomorereel: + return; +notplayingreel: + context._cmp(context.data.byte(32), 1); + if (!context.flags.z()) goto notholdingreel; + context.ax = context.data.word(29); + context.data.word(239) = context.ax; + plotreel(context); + return; +notholdingreel: + context._cmp(context.data.byte(32), 2); + if (!context.flags.z()) goto notreleasehold; + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); + if (!context.flags.z()) goto notlastspeed2; + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context._add(context.data.word(29), 1); +notlastspeed2: + context.ax = context.data.word(29); + context._cmp(context.ax, context.data.word(31)); + if (!context.flags.z()) goto ismorereel2; + context.data.word(29) = -1; + context.data.byte(32) = -1; + context.al = context.data.byte(33); + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + autosetwalk(context); + return; +ismorereel2: + context.ax = context.data.word(29); + context.data.word(239) = context.ax; + plotreel(context); + return; +notreleasehold: + return; +} + +static inline void randomnum1(Context & context) { + context.push(context.ds); + context.push(context.es); + context.push(context.di); + context.push(context.bx); + context.push(context.cx); + randomnumber(context); + context.cx = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + return; +} + +static inline void playchannel1(Context & context) { + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto dontbother5; + context._cmp(context.data.byte(515), 7); + if (context.flags.z()) goto dontbother5; + context.push(context.es); + context.push(context.ds); + context.push(context.bx); + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.data.byte(515) = context.al; + context.es = context.data.word(420); + context._cmp(context.al, 12); + if (context.flags.c()) goto notsecondbank1; + context.es = context.data.word(422); + context._sub(context.al, 12); +notsecondbank1: + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context.data.word(517) = context.ax; + context.ax = context.data.word(context.bx+1); + context.data.word(519) = context.ax; + context.ax = context.data.word(context.bx+3); + context.data.word(521) = context.ax; + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); +dontbother5: + return; +} + +static inline void showrain(Context & context) { + context.ds = context.data.word(414); + context.si = 6*58; + context.ax = context.data.word(context.si+2); + context.si = context.ax; + context._add(context.si, 2080); + context.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); + context.es = context.data.word(412); + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto nothunder; +morerain: + context.es = context.data.word(412); + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto finishrain; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._add(context.ax, context.data.word(119)); + context._add(context.ax, context.data.word(127)); + context.cx = 320; + context._mul(context.cx); + context.cl = context.data.byte(context.bx); + context.ch = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.data.word(117)); + context._add(context.ax, context.data.word(125)); + context.di = context.ax; + context.cl = context.data.byte(context.bx+2); + context.ch = 0; + context.ax = context.data.word(context.bx+3); + context.dl = context.data.byte(context.bx+5); + context.dh = 0; + context._sub(context.ax, context.dx); + context._and(context.ax, 511); + context.data.word(context.bx+3) = context.ax; + context._add(context.bx, 6); + context.push(context.si); + context._add(context.si, context.ax); + context.es = context.data.word(400); + context.ah = 0; + context.dx = 320-2; +rainloop: + context._lodsb(); + context._cmp(context.al, context.ah); + if (context.flags.z()) goto noplot; + context._stosb(); + context._add(context.di, context.dx); + if (--context.cx) goto rainloop; + context.si = context.pop(); + goto morerain; +noplot: + context._add(context.di, 320-1); + if (--context.cx) goto rainloop; + context.si = context.pop(); + goto morerain; +finishrain: + context._cmp(context.data.word(521), 0); + if (!context.flags.z()) goto nothunder; + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notlouisthund; + context._cmp(context.data.byte(45), 1); + if (!context.flags.z()) goto nothunder; +notlouisthund: + context._cmp(context.data.byte(184), 55); + if (context.flags.z()) goto nothunder; + randomnum1(context); + context._cmp(context.al, 1); + if (!context.flags.c()) goto nothunder; + context.al = 7; + context._cmp(context.data.byte(507), 6); + if (context.flags.z()) goto isthunder1; + context.al = 4; +isthunder1: + playchannel1(context); +nothunder: + return; +} + +static inline void reelsonscreen(Context & context) { + reconstruct(context); + updatepeople(context); + watchreel(context); + showrain(context); + usetimedtext(context); + return; +} + +static inline void clearwork(Context & context) { + context.ax = 0x0; + context.es = context.data.word(400); + context.di = 0; + context.cx = (200*320)/64; +clearloop: + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + if (--context.cx) goto clearloop; + return; +} + +static inline void findroominloc(Context & context) { + context.al = context.data.byte(149); + context.cx = -6; +looky: + context._add(context.cx, 6); + context._sub(context.al, 10); + if (!context.flags.c()) goto looky; + context.al = context.data.byte(148); + context._sub(context.cx, 1); +lookx: + context._add(context.cx, 1); + context._sub(context.al, 11); + if (!context.flags.c()) goto lookx; + context.data.byte(185) = context.cl; + return; +} + +static inline void eraseoldobs(Context & context) { + context._cmp(context.data.byte(62), 0); + if (context.flags.z()) goto donterase; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +oberase: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx+20); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto notthisob; + context.di = context.bx; + context.al = 255; + context.cx = 32; + while(--context.cx) context._stosb(); +notthisob: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 32); + if (--context.cx) goto oberase; +donterase: + return; +} + +static inline void drawflags(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32); + context.al = context.data.byte(149); + context.ah = 0; + context.cx = 66; + context._mul(context.cx); + context.bl = context.data.byte(148); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = 0; + context._add(context.si, context.ax); + context.cx = 10; +_tmp28: + context.push(context.cx); + context.cx = 11; +_tmp28a: + context.ds = context.data.word(418); + context._lodsb(); + context.ds = context.data.word(416); + context.push(context.si); + context.push(context.ax); + context.ah = 0; + context._add(context.ax, context.ax); + context.si = 0; + context._add(context.si, context.ax); + context._movsw(); + context.ax = context.pop(); + context._stosb(); + context.si = context.pop(); + if (--context.cx) goto _tmp28a; + context._add(context.si, 66-11); + context.cx = context.pop(); + if (--context.cx) goto _tmp28; + return; +} + +static inline void addalong(Context & context) { + context.ah = 11; +addloop: + context._cmp(context.data.byte(context.bx), 0); + if (!context.flags.z()) goto gotalong; + context._add(context.bx, 3); + context._sub(context.ah, 1); + if (!context.flags.z()) goto addloop; + context.al = 0; + return; +gotalong: + context.al = 1; + return; +} + +static inline void addlength(Context & context) { + context.ah = 10; +addloop2: + context._cmp(context.data.byte(context.bx), 0); + if (!context.flags.z()) goto gotlength; + context._add(context.bx, 3*11); + context._sub(context.ah, 1); + if (!context.flags.z()) goto addloop2; + context.al = 0; + return; +gotlength: + context.al = 1; + return; +} + +static inline void getdimension(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32); + context.ch = 0; +dimloop1: + addalong(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim1; + context._add(context.ch, 1); + goto dimloop1; +finishdim1: + context.bx = 0+(228*13)+32+60+(32*32); + context.cl = 0; +dimloop2: + context.push(context.bx); + addlength(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim2; + context._add(context.cl, 1); + context._add(context.bx, 3); + goto dimloop2; +finishdim2: + context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9); + context.dh = 10; +dimloop3: + context.push(context.bx); + addalong(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim3; + context._sub(context.dh, 1); + context._sub(context.bx, 11*3); + goto dimloop3; +finishdim3: + context.bx = 0+(228*13)+32+60+(32*32)+(3*10); + context.dl = 11; +dimloop4: + context.push(context.bx); + addlength(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim4; + context._sub(context.dl, 1); + context._sub(context.bx, 3); + goto dimloop4; +finishdim4: + context.al = context.cl; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.word(125) = context.ax; + context.al = context.ch; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.word(127) = context.ax; + context._sub(context.dl, context.cl); + context._sub(context.dh, context.ch); + context.al = context.dl; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.byte(128) = context.al; + context.al = context.dh; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.byte(129) = context.al; + return; +} + +static inline void calcmapad(Context & context) { + getdimension(context); + context.push(context.cx); + context.push(context.dx); + context.al = 11; + context._sub(context.al, context.dl); + context._sub(context.al, context.cl); + context._sub(context.al, context.cl); + context.ax.cbw(); + context.bx = 8; + context._mul(context.bx); + context._add(context.ax, context.data.word(121)); + context.data.word(117) = context.ax; + context.dx = context.pop(); + context.cx = context.pop(); + context.al = 10; + context._sub(context.al, context.dh); + context._sub(context.al, context.ch); + context._sub(context.al, context.ch); + context.ax.cbw(); + context.bx = 8; + context._mul(context.bx); + context._add(context.ax, context.data.word(123)); + context.data.word(119) = context.ax; + return; +} + +static inline void doblocks(Context & context) { + context.es = context.data.word(400); + context.ax = context.data.word(119); + context.cx = 320; + context._mul(context.cx); + context.di = context.data.word(117); + context._add(context.di, context.ax); + context.al = context.data.byte(149); + context.ah = 0; + context.bx = 66; + context._mul(context.bx); + context.bl = context.data.byte(148); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = 0; + context._add(context.si, context.ax); + context.cx = 10; +loop120: + context.push(context.di); + context.push(context.cx); + context.cx = 11; +loop124: + context.push(context.cx); + context.push(context.di); + context.ds = context.data.word(418); + context._lodsb(); + context.ds = context.data.word(416); + context.push(context.si); + context._cmp(context.al, 0); + if (context.flags.z()) goto zeroblock; + context.ah = context.al; + context.al = 0; + context.si = 0+192; + context._add(context.si, context.ax); + context.bh = 14; + context.bh = 4; +firstbitofblock: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._add(context.di, 320-16); + context._sub(context.bh, 1); + if (!context.flags.z()) goto firstbitofblock; + context.bh = 12; +loop125: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context.ax = 0x0dfdf; + context._stosw(); + context._stosw(); + context._add(context.di, 320-20); + context._sub(context.bh, 1); + if (!context.flags.z()) goto loop125; + context._add(context.di, 4); + context.ax = 0x0dfdf; + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); +zeroblock: + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 16); + if (--context.cx) goto loop124; + context._add(context.si, 66-11); + context.cx = context.pop(); + context.di = context.pop(); + context._add(context.di, 320*16); + if (--context.cx) goto loop120; + return; +} + +static inline void makesprite(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; +_tmp17: + context._cmp(context.data.byte(context.bx+15), 255); + if (context.flags.z()) goto _tmp17a; + context._add(context.bx, 32); + goto _tmp17; +_tmp17a: + context.data.word(context.bx) = context.cx; + context.data.word(context.bx+10) = context.si; + context.data.word(context.bx+6) = context.dx; + context.data.word(context.bx+8) = context.di; + context.data.word(context.bx+2) = 0x0ffff; + context.data.byte(context.bx+15) = 0; + context.data.byte(context.bx+18) = 0; + return; +} + +static inline void makebackob(Context & context) { + context._cmp(context.data.byte(62), 0); + if (context.flags.z()) goto nomake; + context.al = context.data.byte(context.si+5); + context.ah = context.data.byte(context.si+8); + context.push(context.si); + context.push(context.ax); + context.push(context.si); + context.ax = context.data.word(168); + context.bx = context.data.word(170); + context.ah = context.bl; + context.si = context.ax; + context.cx = 49520; + context.dx = context.data.word(444); + context.di = 0; + makesprite(context); + context.ax = context.pop(); + context.data.word(context.bx+20) = context.ax; + context.ax = context.pop(); + context._cmp(context.al, 255); + if (!context.flags.z()) goto usedpriority; + context.al = 0; +usedpriority: + context.data.byte(context.bx+23) = context.al; + context.data.byte(context.bx+30) = context.ah; + context.data.byte(context.bx+16) = 0; + context.data.byte(context.bx+18) = 0; + context.data.byte(context.bx+19) = 0; + context.si = context.pop(); +nomake: + return; +} + +static inline void showallobs(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); + context.data.word(18) = context.bx; + context.di = context.bx; + context.cx = 128*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(444); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.data.byte(181) = 0; + context.ds = context.data.word(428); + context.si = 0; + context.cx = 128; +showobsloop: + context.push(context.cx); + context.push(context.si); + context.push(context.si); + context._add(context.si, 58); + context.es = context.data.word(428); + getmapad(context); + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto blankframe; + context.al = context.data.byte(context.si+18); + context.ah = 0; + context.data.word(160) = context.ax; + context._cmp(context.al, 255); + if (context.flags.z()) goto blankframe; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(context.si+18); + context.data.byte(context.si+17) = context.al; + context._cmp(context.data.byte(context.si+8), 0); + if (!context.flags.z()) goto animating; + context._cmp(context.data.byte(context.si+5), 5); + if (context.flags.z()) goto animating; + context._cmp(context.data.byte(context.si+5), 6); + if (context.flags.z()) goto animating; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + goto drawnsetob; +animating: + makebackob(context); +drawnsetob: + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.al = context.data.byte(181); + context.data.byte(context.si+4) = context.al; + context._add(context.si, 5); + context.data.word(18) = context.si; +blankframe: + context._add(context.data.byte(181), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 64); + context._sub(context.cx, 1); + if (context.flags.z()) goto finishedsetobs; + goto showobsloop; +finishedsetobs: + return; +} + +static inline void showallfree(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.data.word(18) = context.bx; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.cx = 80*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(446); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.al = 0; + context.data.byte(158) = context.al; + context.ds = context.data.word(426); + context.si = 2; + context.cx = 0; +loop127: + context.push(context.cx); + context.push(context.si); + context.push(context.si); + context.es = context.data.word(426); + getmapad(context); + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over138; + context.al = context.data.byte(158); + context.ah = 0; + context.dx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.dx); + context.data.word(160) = context.ax; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + context.es = context.data.word(402); + context.ds = context.data.word(166); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context._cmp(context.cx, 0); + if (context.flags.z()) goto over138; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.ax = context.pop(); + context.cx = context.pop(); + context.push(context.cx); + context.push(context.ax); + context.data.byte(context.si+4) = context.cl; + context._add(context.si, 5); + context.data.word(18) = context.si; +over138: + context._add(context.data.byte(158), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 80); + if (context.flags.z()) goto finfree; + goto loop127; +finfree: + return; +} + +static inline void getxad(Context & context) { + context.cl = context.data.byte(context.si); + context._add(context.si, 1); + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.cl, 0); + if (!context.flags.z()) goto over148; + context._sub(context.al, context.data.byte(148)); + if (context.flags.c()) goto over148; + context._cmp(context.al, 11); + if (!context.flags.c()) goto over148; + context.cl = 4; + context._shl(context.al, context.cl); + context._or(context.al, context.ah); + context.ah = 0; + context.ch = 1; + return; +over148: + context.ch = 0; + return; +} + +static inline void getyad(Context & context) { + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._sub(context.al, context.data.byte(149)); + if (context.flags.c()) goto over147; + context._cmp(context.al, 10); + if (!context.flags.c()) goto over147; + context.cl = 4; + context._shl(context.al, context.cl); + context._or(context.al, context.ah); + context.ah = 0; + context.ch = 1; + return; +over147: + context.ch = 0; + return; +} + +static inline void getmapad(Context & context) { + getxad(context); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over146; + context.data.word(168) = context.ax; + getyad(context); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over146; + context.data.word(170) = context.ax; + context.ch = 1; +over146: + return; +} + +static inline void calcfrframe(Context & context) { + context.dx = context.data.word(166); + context.ax = context.data.word(162); + context.push(context.ax); + context.cx = context.data.word(164); + context.ax = context.data.word(160); + context.ds = context.dx; + context.bx = 6; + context._mul(context.bx); + context._add(context.ax, context.cx); + context.bx = context.ax; + context.cx = context.data.word(context.bx); + context.ax = context.data.word(context.bx+2); + context.dx = context.data.word(context.bx+4); + context.bx = context.pop(); + context.push(context.dx); + context._add(context.ax, context.bx); + context.data.word(178) = context.ax; + context.data.word(176) = context.cx; + context.ax = context.pop(); + context.push(context.ax); + context.ah = 0; + context.data.word(172) = context.ax; + context.ax = context.pop(); + context.al = context.ah; + context.ah = 0; + context.data.word(174) = context.ax; + return; +nullframe: + context.ax = context.pop(); + context.cx = 0; + context.data.word(176) = context.cx; + return; +} + +static inline void finalframe(Context & context) { + context.ax = context.data.word(170); + context._add(context.ax, context.data.word(174)); + context.bx = context.data.word(168); + context._add(context.bx, context.data.word(172)); + context.data.byte(179) = context.bl; + context.data.byte(180) = context.al; + context.di = context.data.word(168); + context.bx = context.data.word(170); + return; +} + +static inline void showallex(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.data.word(18) = context.bx; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.cx = 100*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(398); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.data.byte(157) = 0; + context.si = 0+2080+30000+2; + context.cx = 0; +exloop: + context.push(context.cx); + context.push(context.si); + context.es = context.data.word(398); + context.push(context.si); + context.ch = 0; + context._cmp(context.data.byte(context.si), 255); + if (context.flags.z()) goto notinroom; + context.al = context.data.byte(context.si-2); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinroom; + getmapad(context); +notinroom: + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto blankex; + context.al = context.data.byte(157); + context.ah = 0; + context.dx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.dx); + context.data.word(160) = context.ax; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + context.es = context.data.word(402); + context.ds = context.data.word(166); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context._cmp(context.cx, 0); + if (context.flags.z()) goto blankex; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.ax = context.pop(); + context.cx = context.pop(); + context.push(context.cx); + context.push(context.ax); + context.data.byte(context.si+4) = context.cl; + context._add(context.si, 5); + context.data.word(18) = context.si; +blankex: + context._add(context.data.byte(157), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 100); + if (context.flags.z()) goto finex; + goto exloop; +finex: + return; +} + +static inline void paneltomap(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); + context.si = 0; + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multiget(context); + return; +} + +static inline void checkone(Context & context) { + context.push(context.cx); + context.al = context.ch; + context.ah = 0; + context.cl = 4; + context._shr(context.ax, context.cl); + context.dl = context.al; + context.cx = context.pop(); + context.al = context.cl; + context.ah = 0; + context.cl = 4; + context._shr(context.ax, context.cl); + context.ah = context.dl; + context.push(context.ax); + context.ch = 0; + context.cl = context.al; + context.push(context.cx); + context.al = context.ah; + context.ah = 0; + context.cx = 11; + context._mul(context.cx); + context.cx = context.pop(); + context._add(context.ax, context.cx); + context.cx = 3; + context._mul(context.cx); + context.si = context.ax; + context.ds = context.data.word(412); + context._add(context.si, 0+(228*13)+32+60+(32*32)); + context._lodsw(); + context.cx = context.ax; + context._lodsb(); + context.dx = context.pop(); + return; +} + +static inline void getblockofpixel(Context & context) { + context.push(context.cx); + context.push(context.es); + context.push(context.di); + context.ax = context.data.word(125); + context._add(context.cl, context.al); + context.ax = context.data.word(127); + context._add(context.ch, context.al); + checkone(context); + context._and(context.cl, 1); + if (!context.flags.z()) goto failrain; + context.di = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + return; +failrain: + context.di = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.al = 0; + return; +} + +static inline void splitintolines(Context & context) { +lookforlinestart: + getblockofpixel(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto foundlinestart; + context._sub(context.cl, 1); + context._add(context.ch, 1); + context._cmp(context.cl, 0); + if (context.flags.z()) goto endofthisline; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto endofthisline; + goto lookforlinestart; +foundlinestart: + context.data.word(context.di) = context.cx; + context.bh = 1; +lookforlineend: + getblockofpixel(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundlineend; + context._sub(context.cl, 1); + context._add(context.ch, 1); + context._cmp(context.cl, 0); + if (context.flags.z()) goto foundlineend; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto foundlineend; + context._add(context.bh, 1); + goto lookforlineend; +foundlineend: + context.push(context.cx); + context.data.byte(context.di+2) = context.bh; + randomnumber(context); + context.data.byte(context.di+3) = context.al; + randomnumber(context); + context.data.byte(context.di+4) = context.al; + randomnumber(context); + context._and(context.al, 3); + context._add(context.al, 4); + context.data.byte(context.di+5) = context.al; + context._add(context.di, 6); + context.cx = context.pop(); + context._cmp(context.cl, 0); + if (context.flags.z()) goto endofthisline; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto endofthisline; + goto lookforlinestart; +endofthisline: + return; +} + +static inline void initrain(Context & context) { + context.es = context.data.word(412); + context.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); + context.bx = 1113; +checkmorerain: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto finishinitrain; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+1); + context._cmp(context.al, context.data.byte(148)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+2); + context._cmp(context.al, context.data.byte(149)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+3); + context.data.byte(132) = context.al; + goto dorain; +checkrain: + context._add(context.bx, 4); + goto checkmorerain; +dorain: + context.cx = 4; +initraintop: + randomnumber(context); + context._and(context.al, 31); + context._add(context.al, 3); + context._cmp(context.al, context.data.byte(132)); + if (!context.flags.c()) goto initraintop; + context._add(context.cl, context.al); + context._cmp(context.cl, context.data.byte(128)); + if (!context.flags.c()) goto initrainside; + context.push(context.cx); + splitintolines(context); + context.cx = context.pop(); + goto initraintop; +initrainside: + context.cl = context.data.byte(128); + context._sub(context.cl, 1); +initrainside2: + randomnumber(context); + context._and(context.al, 31); + context._add(context.al, 3); + context._cmp(context.al, context.data.byte(132)); + if (!context.flags.c()) goto initrainside2; + context._add(context.ch, context.al); + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto finishinitrain; + context.push(context.cx); + splitintolines(context); + context.cx = context.pop(); + goto initrainside2; +finishinitrain: + context.al = 255; + context._stosb(); + return; +} + +static inline void drawfloor(Context & context) { + context.push(context.es); + context.push(context.bx); + eraseoldobs(context); + drawflags(context); + calcmapad(context); + doblocks(context); + showallobs(context); + showallfree(context); + showallex(context); + paneltomap(context); + initrain(context); + context.data.byte(62) = 0; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static inline void width160(Context & context) { + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width128: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width110: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width88: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width80: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width63: + context._movsw(); + width62: + context._movsw(); + width61: + context._movsw(); + width60: + context._movsw(); + width59: + context._movsw(); + width58: + context._movsw(); + width57: + context._movsw(); + width56: + context._movsw(); + width55: + context._movsw(); + width54: + context._movsw(); + width53: + context._movsw(); + width52: + context._movsw(); + width51: + context._movsw(); + width50: + context._movsw(); + width49: + context._movsw(); + width48: + context._movsw(); + width47: + context._movsw(); + width46: + context._movsw(); + width45: + context._movsw(); + width44: + context._movsw(); + width43: + context._movsw(); + width42: + context._movsw(); + width41: + context._movsw(); + width40: + context._movsw(); + width39: + context._movsw(); + width38: + context._movsw(); + width37: + context._movsw(); + width36: + context._movsw(); + width35: + context._movsw(); + width34: + context._movsw(); + width33: + context._movsw(); + width32: + context._movsw(); + width31: + context._movsw(); + width30: + context._movsw(); + width29: + context._movsw(); + width28: + context._movsw(); + width27: + context._movsw(); + width26: + context._movsw(); + width25: + context._movsw(); + width24: + context._movsw(); + width23: + context._movsw(); + width22: + context._movsw(); + width21: + context._movsw(); + width20: + context._movsw(); + width19: + context._movsw(); + width18: + context._movsw(); + width17: + context._movsw(); + width16: + context._movsw(); + width15: + context._movsw(); + width14: + context._movsw(); + width13: + context._movsw(); + width12: + context._movsw(); + width11: + context._movsw(); + width10: + context._movsw(); + width9: + context._movsw(); + width8: + context._movsw(); + width7: + context._movsw(); + width6: + context._movsw(); + width5: + context._movsw(); + width4: + context._movsw(); + width3: + context._movsw(); + width2: + context._movsw(); + width1: + context._movsw(); + width0: + return; +} + +static inline void worktoscreen(Context & context) { + vsync(context); + context.si = 0; + context.di = 0; + context.cx = 25; + context.ds = context.data.word(400); + context.dx = 0x0a000; + context.es = context.dx; +dumpallloop: + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + if (--context.cx) goto dumpallloop; + return; +} + +static inline void afterintroroom(Context & context) { + context._cmp(context.data.byte(186), 0); + if (context.flags.z()) goto notnewintro; + clearwork(context); + findroominloc(context); + context.data.byte(62) = 1; + drawfloor(context); + reelsonscreen(context); + spriteupdate(context); + printsprites(context); + worktoscreen(context); + context.data.byte(186) = 0; +notnewintro: + return; +} + +static inline void multiget(Context & context) { + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.es = context.data.word(400); + context.es = context.ds; + context.ds = context.es; + context._xchg(context.di, context.si); + context.al = context.cl; + context.ah = 0; + context.dx = 320; + context._sub(context.dx, context.ax); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth2; + context.bl = context.cl; + context.bh = 0; + context.ax = 1819; + context._shr(context.bx, 1); + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop3: + __dispatch_call(context, context.ax); + context._add(context.si, context.dx); + if (--context.cx) goto multiloop3; + return; +oddwidth2: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop4: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.si, context.dx); + if (--context.cx) goto multiloop4; + return; +} + +static inline void getundertimed(Context & context) { + context.al = context.data.byte(335); + context._sub(context.al, 3); + context.ah = 0; + context.bx = context.ax; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.ch = 30; + context.cl = 240; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static inline void getnextword(Context & context) { + context.bx = 0; +getloop: + context.ax = context.data.word(context.di); + context._add(context.di, 1); + context._add(context.bh, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto endall; + context._cmp(context.al, 0); + if (context.flags.z()) goto endall; + context._cmp(context.al, 32); + if (context.flags.z()) goto endword; + modifychar(context); + context._cmp(context.al, 255); + if (context.flags.z()) goto getloop; + context.push(context.ax); + context._sub(context.al, 32); + context.ah = 0; + context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.cl = context.data.byte(context.si+0); + context.ax = context.pop(); + kernchars(context); + context._add(context.bl, context.cl); + goto getloop; +endword: + context._add(context.bl, 6); + context.al = 0; + return; +endall: + context._add(context.bl, 6); + context.al = 1; + return; +} + +static inline void getnumber(Context & context) { + context.cx = 0; + context.push(context.si); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.push(context.es); + context.di = context.si; +wordloop: + context.push(context.cx); + context.push(context.dx); + getnextword(context); + context.dx = context.pop(); + context.cx = context.pop(); + context._cmp(context.al, 1); + if (context.flags.z()) goto endoftext; + context.al = context.cl; + context.ah = 0; + context.push(context.bx); + context.bh = 0; + context._add(context.ax, context.bx); + context.bx = context.pop(); + context._sub(context.ax, 10); + context.dh = 0; + context._cmp(context.ax, context.dx); + if (!context.flags.c()) goto gotoverend; + context._add(context.cl, context.bl); + context._add(context.ch, context.bh); + goto wordloop; +gotoverend: + context.al = context.dl; + context._and(context.al, 1); + if (context.flags.z()) goto notcentre; + context.push(context.cx); + context.al = context.dl; + context._and(context.al, 0b11111110); + context.ah = 0; + context.ch = 0; + context._sub(context.ax, context.cx); + context._add(context.ax, 20); + context._shr(context.ax, 1); + context.cx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._add(context.di, context.ax); + context.cl = context.ch; + return; +notcentre: + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context.cl = context.ch; + return; +endoftext: + context.al = context.cl; + context.ah = 0; + context.push(context.bx); + context.bh = 0; + context._add(context.ax, context.bx); + context.bx = context.pop(); + context._sub(context.ax, 10); + context.dh = 0; + context._cmp(context.ax, context.dx); + if (!context.flags.c()) goto gotoverend2; + context._add(context.cl, context.bl); + context._add(context.ch, context.bh); +gotoverend2: + context.al = context.dl; + context._and(context.al, 1); + if (context.flags.z()) goto notcent2; + context.push(context.cx); + context.al = context.dl; + context._and(context.al, 0b11111110); + context._add(context.al, 2); + context.ah = 0; + context.ch = 0; + context._add(context.ax, 20); + context._sub(context.ax, context.cx); + context._shr(context.ax, 1); + context.cx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._add(context.di, context.ax); + context.cl = context.ch; + return; +notcent2: + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context.cl = context.ch; + return; +} + +static inline void modifychar(Context & context) { + context._cmp(context.al, 128); + if (context.flags.c()) goto nomod; + context._cmp(context.al, 160); + if (!context.flags.z()) goto not160; + context.al = 'Z'+1; + return; +not160: + context._cmp(context.al, 130); + if (!context.flags.z()) goto not130; + context.al = 'Z'+2; + return; +not130: + context._cmp(context.al, 161); + if (!context.flags.z()) goto not161; + context.al = 'Z'+3; + return; +not161: + context._cmp(context.al, 162); + if (!context.flags.z()) goto not162; + context.al = 'Z'+4; + return; +not162: + context._cmp(context.al, 163); + if (!context.flags.z()) goto not163; + context.al = 'Z'+5; + return; +not163: + context._cmp(context.al, 164); + if (!context.flags.z()) goto not164; + context.al = 'Z'+6; + return; +not164: + context._cmp(context.al, 165); + if (!context.flags.z()) goto not165; + context.al = ','-1; + return; +not165: + context._cmp(context.al, 168); + if (!context.flags.z()) goto not168; + context.al = 'A'-1; + return; +not168: + context._cmp(context.al, 173); + if (!context.flags.z()) goto not173; + context.al = 'A'-4; + return; +not173: + context._cmp(context.al, 129); + if (!context.flags.z()) goto not129; + context.al = 'A'-5; +not129: + return; +nomod: + return; +} + +static inline void frameoutfx(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._add(context.dx, context.cx); + context.cx = context.pop(); +frameloopfx1: + context.push(context.cx); + context.ch = 0; +frameloopfx2: + context._lodsb(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto backtosolidfx; +backtootherfx: + context._sub(context.di, 1); + if (--context.cx) goto frameloopfx2; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloopfx1; + return; +frameloopfx3: + context._lodsb(); + context._cmp(context.al, 0); + if (context.flags.z()) goto backtootherfx; +backtosolidfx: + context.data.byte(context.di) = context.al; + context._sub(context.di, 1); + if (--context.cx) goto frameloopfx3; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloopfx1; + return; +} + +static inline void frameoutnm(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._sub(context.dx, context.cx); + context.cx = context.pop(); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidthframe; + context.bl = context.cl; + context.bh = 0; + context.ax = 1819; + context._shr(context.bx, 1); + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +nmloop1: + __dispatch_call(context, context.ax); + context._add(context.di, context.dx); + if (--context.cx) goto nmloop1; + return; +oddwidthframe: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +nmloop2: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.dx); + if (--context.cx) goto nmloop2; + return; +} + +static inline void frameoutbh(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._sub(context.dx, context.cx); + context.cx = context.pop(); +bhloop2: + context.push(context.cx); + context.ch = 0; + context.ah = 255; +bhloop1: + context._cmp(context.data.byte(context.di), context.ah); + if (!context.flags.z()) goto nofill; + context._movsb(); + if (--context.cx) goto bhloop1; + goto nextline; +nofill: + context._add(context.di, 1); + context._add(context.si, 1); + if (--context.cx) goto bhloop1; +nextline: + context._add(context.di, context.dx); + context.cx = context.pop(); + context._sub(context.ch, 1); + if (!context.flags.z()) goto bhloop2; + return; +} + +static inline void frameoutv(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._sub(context.dx, context.cx); + context.cx = context.pop(); +frameloop1: + context.push(context.cx); + context.ch = 0; +frameloop2: + context._lodsb(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto backtosolid; +backtoother: + context._add(context.di, 1); + if (--context.cx) goto frameloop2; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloop1; + return; +frameloop3: + context._lodsb(); + context._cmp(context.al, 0); + if (context.flags.z()) goto backtoother; +backtosolid: + context._stosb(); + if (--context.cx) goto frameloop3; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloop1; + return; +} + +static inline void showframe(Context & context) { + context.push(context.dx); + context.push(context.ax); + context.cx = context.ax; + context._and(context.cx, 511); + context._add(context.cx, context.cx); + context.si = context.cx; + context._add(context.cx, context.cx); + context._add(context.si, context.cx); + context._cmp(context.data.word(context.si), 0); + if (!context.flags.z()) goto notblankshow; + context.cx = 0; + return; +notblankshow: + context._test(context.ah, 128); + if (!context.flags.z()) goto skipoffsets; + context.al = context.data.byte(context.si+4); + context.ah = 0; + context._add(context.di, context.ax); + context.al = context.data.byte(context.si+5); + context.ah = 0; + context._add(context.bx, context.ax); +skipoffsets: + context.cx = context.data.word(context.si+0); + context.ax = context.data.word(context.si+2); + context._add(context.ax, 2080); + context.si = context.ax; + context.ax = context.pop(); + context.dx = context.pop(); + context._cmp(context.ah, 0); + if (context.flags.z()) goto noeffects; + context._test(context.ah, 128); + if (context.flags.z()) goto notcentred; + context.push(context.ax); + context.al = context.cl; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.di, context.ax); + context.al = context.ch; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.bx, context.ax); + context.ax = context.pop(); +notcentred: + context._test(context.ah, 64); + if (context.flags.z()) goto notdiffdest; + context.push(context.cx); + frameoutfx(context); + context.cx = context.pop(); + return; +notdiffdest: + context._test(context.ah, 8); + if (context.flags.z()) goto notprintlist; + context.push(context.ax); + context.ax = context.di; + context._sub(context.ax, context.data.word(117)); + context.push(context.bx); + context._sub(context.bx, context.data.word(119)); + context.ah = context.bl; + context.bx = context.pop(); + context.ax = context.pop(); +notprintlist: + context._test(context.ah, 4); + if (context.flags.z()) goto notflippedx; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutfx(context); + context.cx = context.pop(); + return; +notflippedx: + context._test(context.ah, 2); + if (context.flags.z()) goto notnomask; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutnm(context); + context.cx = context.pop(); + return; +notnomask: + context._test(context.ah, 32); + if (context.flags.z()) goto noeffects; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutbh(context); + context.cx = context.pop(); + return; +noeffects: + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutv(context); + context.cx = context.pop(); + return; +} + +static inline void kernchars(Context & context) { + context._cmp(context.al, 'a'); + if (context.flags.z()) goto iskern; + context._cmp(context.al, 'u'); + if (context.flags.z()) goto iskern; + return; +iskern: + context._cmp(context.ah, 'n'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 't'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'r'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'i'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'l'); + if (context.flags.z()) goto kernit; + return; +kernit: + context._sub(context.cl, 1); + return; +} + +static inline void printchar(Context & context) { + context._cmp(context.al, 255); + if (context.flags.z()) goto ignoreit; + context.push(context.si); + context.push(context.bx); + context.push(context.di); + context._sub(context.bx, 3); + context.push(context.ax); + context._sub(context.al, 32); + context.ah = 0; + context._add(context.ax, context.data.word(71)); + showframe(context); + context.ax = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._cmp(context.data.byte(72), 0); + if (!context.flags.z()) goto nokern; + kernchars(context); +nokern: + context.push(context.cx); + context.ch = 0; + context._add(context.di, context.cx); + context.cx = context.pop(); +ignoreit: + return; +} + +static inline void printdirect(Context & context) { + context.data.word(84) = context.di; + context.ds = context.data.word(268); +printloop6: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloop5: + context.ax = context.data.word(context.si); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishdirct; + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishdirct; + context.push(context.cx); + context.push(context.es); + modifychar(context); + printchar(context); + context.data.word(84) = context.di; + context.es = context.pop(); + context.cx = context.pop(); + if (--context.cx) goto printloop5; + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._add(context.bx, context.data.word(77)); + goto printloop6; +finishdirct: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + return; +} + +static inline void multiput(Context & context) { + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.es = context.data.word(400); + context.al = context.cl; + context.ah = 0; + context.dx = 320; + context._sub(context.dx, context.ax); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth3; + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop5: + __dispatch_call(context, context.ax); + context._add(context.di, context.dx); + if (--context.cx) goto multiloop5; + return; +oddwidth3: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop6: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.dx); + if (--context.cx) goto multiloop6; + return; +} + +static inline void putundertimed(Context & context) { + context.al = context.data.byte(335); + context._sub(context.al, 3); + context.ah = 0; + context.bx = context.ax; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.ch = 30; + context.cl = 240; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static inline void usetimedtext(Context & context) { + context._cmp(context.data.word(328), 0); + if (context.flags.z()) goto notext; + context._sub(context.data.word(328), 1); + context._cmp(context.data.word(328), 0); + if (context.flags.z()) goto deltimedtext; + context.ax = context.data.word(328); + context._cmp(context.ax, context.data.word(330)); + if (context.flags.z()) goto firsttimed; + if (!context.flags.c()) goto notext; + goto notfirsttimed; +firsttimed: + getundertimed(context); +notfirsttimed: + context.bl = context.data.byte(335); + context.bh = 0; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.es = context.data.word(332); + context.si = context.data.word(334); + context.dl = 237; + context.ah = 0; + printdirect(context); + context.data.byte(337) = 1; +notext: + return; +deltimedtext: + putundertimed(context); + context.data.byte(337) = 1; + return; +} + +static inline void dumpmap(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multidump(context); + return; +} + +static inline void multidump(Context & context) { + context.dx = 0x0a000; + context.es = context.dx; + context.ds = context.data.word(400); + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = 320; + context.si = context.di; + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth; + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.bl = context.cl; + context.bh = 0; + context._neg(context.bx); + context._add(context.bx, context.dx); + context.cl = context.ch; + context.ch = 0; +multiloop1: + __dispatch_call(context, context.ax); + context._add(context.di, context.bx); + context._add(context.si, context.bx); + if (--context.cx) goto multiloop1; + return; +oddwidth: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.bl = context.cl; + context.bh = 0; + context._neg(context.bx); + context._add(context.bx, 320); + context.cl = context.ch; + context.ch = 0; +multiloop2: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.bx); + context._add(context.si, context.bx); + if (--context.cx) goto multiloop2; + return; +} + +static inline void dumptimedtext(Context & context) { + context._cmp(context.data.byte(337), 1); + if (!context.flags.z()) goto nodumptimed; + context.al = context.data.byte(335); + context._sub(context.al, 3); + context.ah = 0; + context.bx = context.ax; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.cl = 240; + context.ch = 30; + multidump(context); + context.data.byte(337) = 0; +nodumptimed: + return; +} + +static inline void runendseq(Context & context) { + atmospheres(context); + context.data.byte(103) = 0; +moreendseq: + vsync(context); + spriteupdate(context); + vsync(context); + deleverything(context); + printsprites(context); + reelsonscreen(context); + afterintroroom(context); + usetimedtext(context); + vsync(context); + dumpmap(context); + dumptimedtext(context); + vsync(context); + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto moreendseq; + return; +} + +static inline void gettingshot(Context & context) { + context.data.byte(188) = 55; + clearpalette(context); + loadintroroom(context); + fadescreenups(context); + context.data.byte(387) = 0; + context.data.byte(388) = -1; + runendseq(context); + clearbeforeload(context); + return; +} + +static inline void getridoftemptext(Context & context) { + context.es = context.data.word(466); + deallocatemem(context); + return; +} + +static inline void endgame(Context & context) { + context.dx = 2273; + loadtemptext(context); + monkspeaking(context); + gettingshot(context); + getridoftemptext(context); + context.data.byte(387) = 7; + context.data.byte(388) = 1; + context.cx = 200; + hangon(context); + return; +} + + +Data::Data() { + static const uint8 src[] = { + 0, 0, 0, 0, 0, 30, 19, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 255, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 255, 0, + 255, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 10, 0, 13, 0, 182, + 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, 104, 0, 38, 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, 255, 255, 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, 32, 32, 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, + 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, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 255, 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, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 23, 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, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 255, 0, 0, 0, 0, 1, 44, 0, 20, 0, 2, 0, 1, 1, 55, + 0, 0, 0, 50, 20, 0, 24, 22, 0, 74, 0, 1, 0, 0, 24, 33, + 10, 75, 0, 1, 0, 1, 1, 44, 0, 27, 0, 2, 0, 2, 1, 44, + 0, 96, 0, 3, 0, 4, 1, 44, 0, 118, 0, 2, 0, 5, 1, 44, + 10, 0, 0, 2, 0, 0, 5, 22, 20, 53, 0, 3, 0, 0, 5, 22, + 20, 40, 0, 1, 0, 2, 5, 22, 20, 50, 0, 1, 0, 3, 2, 11, + 10, 192, 0, 1, 0, 0, 2, 11, 10, 182, 0, 2, 0, 1, 8, 11, + 10, 0, 0, 2, 0, 1, 23, 0, 50, 0, 0, 3, 0, 0, 28, 11, + 20, 250, 0, 4, 0, 0, 23, 0, 50, 43, 0, 2, 0, 8, 23, 11, + 40, 130, 0, 2, 0, 1, 23, 22, 40, 122, 0, 2, 0, 2, 23, 22, + 40, 105, 0, 2, 0, 3, 23, 22, 40, 81, 0, 2, 0, 4, 23, 11, + 40, 135, 0, 2, 0, 5, 23, 22, 40, 145, 0, 2, 0, 6, 4, 22, + 30, 0, 0, 2, 0, 0, 45, 22, 30, 200, 0, 0, 0, 20, 45, 22, + 30, 39, 0, 2, 0, 0, 45, 22, 30, 25, 0, 2, 0, 0, 8, 22, + 40, 32, 0, 2, 0, 0, 7, 11, 20, 64, 0, 2, 0, 0, 22, 22, + 20, 82, 0, 2, 0, 0, 27, 11, 30, 0, 0, 2, 0, 0, 20, 0, + 30, 0, 0, 2, 0, 0, 14, 33, 40, 21, 0, 1, 0, 0, 29, 11, + 10, 0, 0, 1, 0, 0, 2, 22, 0, 2, 0, 2, 0, 0, 25, 0, + 50, 4, 0, 2, 0, 0, 50, 22, 30, 121, 0, 2, 0, 0, 50, 22, + 30, 0, 0, 20, 0, 0, 52, 22, 30, 192, 0, 2, 0, 0, 52, 22, + 30, 233, 0, 2, 0, 0, 50, 22, 40, 104, 0, 55, 0, 0, 53, 33, + 0, 99, 0, 2, 0, 0, 50, 22, 40, 0, 0, 3, 0, 0, 50, 22, + 30, 162, 0, 2, 0, 0, 52, 22, 30, 57, 0, 2, 0, 0, 52, 22, + 30, 0, 0, 2, 0, 0, 54, 0, 0, 72, 0, 3, 0, 0, 55, 44, + 0, 0, 0, 2, 0, 0, 19, 0, 0, 0, 0, 28, 0, 0, 14, 22, + 0, 2, 0, 2, 0, 0, 14, 22, 0, 44, 1, 1, 0, 0, 10, 22, + 30, 174, 0, 0, 0, 0, 12, 22, 20, 0, 0, 1, 0, 0, 11, 11, + 20, 0, 0, 50, 20, 0, 11, 11, 30, 0, 0, 50, 20, 0, 11, 22, + 20, 0, 0, 50, 20, 0, 14, 33, 40, 0, 0, 50, 20, 0, 255, 124, + 192, 128, 192, 28, 192, 32, 192, 0, 193, 16, 192, 24, 192, 244, 192, 12, + 192, 36, 192, 40, 192, 44, 192, 48, 192, 84, 192, 120, 192, 80, 192, 116, + 192, 52, 192, 56, 192, 64, 192, 68, 192, 72, 192, 60, 192, 20, 192, 136, + 192, 140, 192, 144, 192, 112, 192, 252, 192, 108, 192, 88, 192, 104, 192, 4, + 193, 100, 192, 96, 192, 92, 192, 148, 192, 4, 192, 164, 192, 156, 192, 160, + 192, 168, 192, 172, 192, 152, 192, 176, 192, 180, 192, 200, 192, 204, 192, 212, + 192, 220, 192, 216, 192, 0, 192, 8, 192, 132, 192, 132, 192, 132, 192, 132, + 192, 0, 60, 33, 71, 11, 82, 22, 93, 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, 47, 5, + 48, 5, 52, 5, 47, 5, 47, 5, 47, 5, 71, 5, 47, 5, 78, 5, + 94, 5, 101, 5, 105, 5, 109, 5, 113, 5, 126, 5, 47, 5, 47, 5, + 47, 5, 47, 5, 47, 5, 160, 5, 47, 5, 182, 5, 213, 5, 47, 5, + 226, 5, 248, 5, 14, 6, 39, 6, 58, 6, 47, 5, 47, 5, 47, 5, + 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, + 47, 5, 47, 5, 47, 5, 47, 5, 74, 6, 81, 6, 118, 6, 47, 5, + 47, 5, 47, 5, 47, 5, 131, 6, 135, 6, 47, 5, 142, 6, 255, 15, + 1, 1, 255, 12, 5, 0, 13, 21, 0, 15, 35, 0, 17, 50, 0, 18, + 103, 0, 19, 108, 0, 255, 18, 19, 0, 19, 23, 0, 255, 12, 51, 0, + 13, 53, 0, 14, 14, 0, 15, 20, 0, 0, 78, 0, 255, 12, 119, 0, + 12, 145, 0, 255, 13, 16, 0, 255, 13, 20, 0, 255, 14, 16, 0, 255, + 15, 4, 0, 16, 8, 0, 17, 134, 0, 18, 153, 0, 255, 13, 108, 0, + 15, 70, 1, 15, 75, 1, 15, 80, 1, 15, 86, 1, 15, 92, 1, 15, + 98, 1, 18, 159, 0, 18, 178, 0, 147, 217, 0, 84, 228, 0, 255, 13, + 20, 0, 13, 21, 0, 15, 34, 0, 13, 52, 0, 13, 55, 0, 25, 57, + 0, 21, 73, 0, 255, 13, 196, 0, 13, 234, 0, 13, 156, 0, 14, 129, + 0, 13, 124, 0, 15, 162, 0, 15, 200, 0, 15, 239, 0, 17, 99, 0, + 12, 52, 0, 255, 15, 56, 0, 16, 64, 0, 19, 22, 0, 20, 33, 0, + 255, 20, 11, 0, 20, 15, 0, 15, 28, 0, 13, 80, 0, 21, 82, 0, + 147, 87, 0, 87, 128, 0, 255, 12, 13, 0, 14, 39, 0, 12, 67, 0, + 12, 75, 0, 12, 83, 0, 12, 91, 0, 15, 102, 0, 255, 22, 36, 0, + 13, 125, 0, 18, 88, 0, 15, 107, 0, 14, 127, 0, 14, 154, 0, 147, + 170, 0, 87, 232, 0, 255, 21, 16, 0, 21, 72, 0, 21, 205, 0, 22, + 63, 0, 151, 99, 0, 88, 158, 0, 255, 13, 21, 0, 14, 24, 0, 147, + 50, 0, 87, 75, 0, 24, 128, 0, 255, 83, 46, 0, 16, 167, 0, 255, + 16, 19, 0, 14, 36, 0, 16, 50, 0, 14, 65, 0, 16, 81, 0, 14, + 96, 0, 16, 114, 0, 14, 129, 0, 16, 147, 0, 14, 162, 0, 16, 177, + 0, 14, 191, 0, 255, 13, 48, 0, 14, 41, 0, 15, 78, 0, 16, 92, + 0, 255, 16, 115, 0, 255, 21, 103, 0, 20, 199, 0, 255, 17, 53, 0, + 17, 54, 0, 17, 55, 0, 17, 56, 0, 17, 57, 0, 17, 58, 0, 17, + 59, 0, 17, 61, 0, 17, 63, 0, 17, 64, 0, 17, 65, 0, 255, 156, + 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, + 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, + 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, + 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, + 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, + 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, + 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 156, 68, 82, 69, 65, 77, + 87, 69, 66, 46, 83, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, + 46, 83, 48, 50, 0, 73, 78, 83, 84, 65, 76, 76, 46, 68, 65, 84, + 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 67, 48, 48, 0, 68, 82, + 69, 65, 77, 87, 69, 66, 46, 67, 48, 49, 0, 68, 82, 69, 65, 77, + 87, 69, 66, 46, 67, 48, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, + 46, 86, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 86, 57, + 57, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 48, 0, 68, + 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 49, 0, 68, 82, 69, 65, + 77, 87, 69, 66, 46, 71, 48, 50, 0, 68, 82, 69, 65, 77, 87, 69, + 66, 46, 71, 48, 56, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, + 48, 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 55, 0, + 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 52, 0, 68, 82, 69, + 65, 77, 87, 69, 66, 46, 71, 48, 53, 0, 68, 82, 69, 65, 77, 87, + 69, 66, 46, 71, 48, 54, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, + 71, 49, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 48, 49, + 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 48, 50, 0, 68, 82, + 69, 65, 77, 87, 69, 66, 46, 84, 49, 48, 0, 68, 82, 69, 65, 77, + 87, 69, 66, 46, 84, 49, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, + 46, 84, 49, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 49, + 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 50, 48, 0, 68, + 82, 69, 65, 77, 87, 69, 66, 46, 84, 50, 49, 0, 68, 82, 69, 65, + 77, 87, 69, 66, 46, 84, 50, 50, 0, 68, 82, 69, 65, 77, 87, 69, + 66, 46, 84, 50, 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, + 50, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 53, 48, 0, + 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 53, 49, 0, 68, 82, 69, + 65, 77, 87, 69, 66, 46, 84, 56, 48, 0, 68, 82, 69, 65, 77, 87, + 69, 66, 46, 84, 56, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, + 84, 56, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 56, 51, + 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 56, 52, 0, 68, 82, + 69, 65, 77, 87, 69, 66, 46, 86, 79, 76, 0, 68, 82, 69, 65, 77, + 87, 69, 66, 46, 71, 48, 57, 0, 68, 82, 69, 65, 77, 87, 69, 66, + 46, 71, 49, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, + 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, 50, 0, 68, + 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, 51, 0, 68, 82, 69, 65, + 77, 87, 69, 66, 46, 71, 49, 53, 0, 68, 82, 69, 65, 77, 87, 69, + 66, 46, 73, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, + 48, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 50, 0, + 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 51, 0, 68, 82, 69, + 65, 77, 87, 69, 66, 46, 73, 48, 52, 0, 68, 82, 69, 65, 77, 87, + 69, 66, 46, 73, 48, 53, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, + 73, 48, 54, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 55, + 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 80, 65, 76, 0, 17, 1, + 64, 1, 157, 0, 198, 0, 72, 195, 4, 1, 44, 1, 0, 0, 44, 0, + 132, 197, 210, 0, 254, 0, 0, 0, 44, 0, 224, 195, 144, 0, 176, 0, + 64, 0, 96, 0, 132, 195, 0, 0, 50, 0, 50, 0, 200, 0, 136, 195, + 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 17, 1, 64, 1, + 157, 0, 198, 0, 72, 195, 255, 0, 38, 1, 0, 0, 24, 0, 204, 195, + 247, 0, 45, 1, 40, 0, 56, 0, 76, 195, 80, 0, 0, 1, 158, 0, + 202, 0, 228, 195, 80, 0, 44, 1, 58, 0, 146, 0, 156, 195, 0, 0, + 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, + 198, 0, 72, 195, 247, 0, 45, 1, 40, 0, 56, 0, 76, 195, 80, 0, + 44, 1, 58, 0, 146, 0, 192, 198, 0, 0, 64, 1, 0, 0, 200, 0, + 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 240, 0, + 34, 1, 2, 0, 44, 0, 152, 196, 0, 0, 64, 1, 0, 0, 200, 0, + 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 0, 0, + 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 238, 0, 2, 1, 4, 0, + 44, 0, 204, 196, 104, 0, 124, 0, 4, 0, 44, 0, 208, 196, 24, 1, + 52, 1, 4, 0, 44, 0, 180, 196, 104, 0, 216, 0, 138, 0, 192, 0, + 212, 196, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 0, 0, 64, 1, + 0, 0, 200, 0, 156, 202, 255, 255, 69, 88, 73, 84, 32, 72, 69, 76, + 80, 32, 76, 73, 83, 84, 32, 82, 69, 65, 68, 32, 76, 79, 71, 79, + 78, 32, 75, 69, 89, 83, 32, 1, 0, 80, 85, 66, 76, 73, 67, 32, + 80, 85, 66, 76, 73, 67, 32, 0, 0, 0, 66, 76, 65, 67, 75, 68, + 82, 65, 71, 79, 78, 32, 82, 89, 65, 78, 32, 0, 0, 0, 72, 69, + 78, 68, 82, 73, 88, 32, 76, 79, 85, 73, 83, 32, 0, 0, 0, 83, + 69, 80, 84, 73, 77, 85, 83, 32, 66, 69, 67, 75, 69, 84, 84, 32, + 0, 255, 255, 32, 0, 34, 82, 79, 79, 84, 32, 0, 34, 32, 0, 78, + 69, 84, 87, 236, 196, 69, 76, 86, 65, 144, 198, 69, 76, 86, 66, 160, + 198, 69, 76, 86, 67, 152, 198, 69, 76, 86, 69, 156, 198, 69, 76, 86, + 70, 164, 198, 67, 71, 65, 84, 52, 199, 82, 69, 77, 79, 172, 198, 66, + 85, 84, 65, 64, 199, 67, 66, 79, 88, 72, 199, 76, 73, 84, 69, 96, + 198, 80, 76, 65, 84, 68, 199, 76, 73, 70, 84, 128, 198, 87, 73, 82, + 69, 136, 198, 72, 78, 68, 76, 140, 198, 72, 65, 67, 72, 132, 198, 68, + 79, 79, 82, 184, 198, 67, 83, 72, 82, 116, 198, 71, 85, 78, 65, 56, + 199, 67, 82, 65, 65, 104, 198, 67, 82, 66, 66, 108, 198, 67, 82, 67, + 67, 112, 198, 83, 69, 65, 84, 252, 197, 77, 69, 78, 85, 156, 199, 67, + 79, 79, 75, 176, 198, 69, 76, 67, 65, 80, 198, 69, 68, 67, 65, 84, + 198, 68, 68, 67, 65, 88, 198, 65, 76, 84, 82, 8, 198, 76, 79, 75, + 65, 64, 198, 76, 79, 75, 66, 68, 198, 69, 78, 84, 65, 20, 198, 69, + 78, 84, 66, 40, 198, 69, 78, 84, 69, 44, 198, 69, 78, 84, 67, 28, + 198, 69, 78, 84, 68, 48, 198, 69, 78, 84, 72, 52, 198, 87, 87, 65, + 84, 244, 197, 80, 79, 79, 76, 92, 198, 87, 83, 72, 68, 248, 197, 71, + 82, 65, 70, 72, 198, 84, 82, 65, 80, 76, 198, 67, 68, 80, 69, 44, + 199, 68, 76, 79, 75, 12, 198, 72, 79, 76, 69, 4, 198, 68, 82, 89, + 82, 16, 198, 72, 79, 76, 89, 0, 198, 87, 65, 76, 76, 48, 199, 66, + 79, 79, 75, 12, 200, 65, 88, 69, 68, 180, 198, 83, 72, 76, 68, 60, + 199, 66, 67, 78, 89, 236, 197, 76, 73, 68, 67, 232, 197, 76, 73, 68, + 85, 228, 197, 76, 73, 68, 79, 240, 197, 80, 73, 80, 69, 172, 197, 66, + 65, 76, 67, 36, 198, 87, 73, 78, 68, 32, 198, 80, 65, 80, 82, 184, + 199, 85, 87, 84, 65, 164, 197, 85, 87, 84, 66, 164, 197, 83, 84, 65, + 84, 220, 199, 84, 76, 73, 68, 160, 197, 83, 76, 65, 66, 220, 197, 67, + 65, 82, 84, 224, 197, 70, 67, 65, 82, 176, 197, 83, 76, 66, 65, 196, + 197, 83, 76, 66, 66, 200, 197, 83, 76, 66, 67, 208, 197, 83, 76, 66, + 68, 204, 197, 83, 76, 66, 69, 212, 197, 83, 76, 66, 70, 216, 197, 80, + 76, 73, 78, 180, 197, 76, 65, 68, 68, 188, 197, 76, 65, 68, 66, 192, + 197, 71, 85, 77, 65, 184, 197, 83, 81, 69, 69, 140, 197, 84, 65, 80, + 80, 144, 197, 71, 85, 73, 84, 148, 197, 67, 79, 78, 84, 152, 197, 66, + 69, 76, 76, 156, 197, 140, 140, 140, 140, 48, 48, 48, 48, 0, 48, 48, + 0, 157, 0, 178, 0, 81, 0, 94, 0, 92, 199, 179, 0, 200, 0, 81, + 0, 94, 0, 96, 199, 201, 0, 222, 0, 81, 0, 94, 0, 100, 199, 157, + 0, 178, 0, 95, 0, 112, 0, 104, 199, 179, 0, 200, 0, 95, 0, 112, + 0, 108, 199, 201, 0, 222, 0, 95, 0, 112, 0, 112, 199, 157, 0, 178, + 0, 113, 0, 130, 0, 116, 199, 179, 0, 200, 0, 113, 0, 130, 0, 120, + 199, 201, 0, 222, 0, 113, 0, 130, 0, 124, 199, 157, 0, 178, 0, 131, + 0, 145, 0, 128, 199, 179, 0, 222, 0, 131, 0, 145, 0, 132, 199, 220, + 0, 234, 0, 152, 0, 166, 0, 84, 199, 0, 0, 64, 1, 0, 0, 200, + 0, 156, 202, 255, 255, 174, 0, 188, 0, 132, 0, 148, 0, 84, 199, 0, + 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 24, 1, 64, 1, 160, + 0, 200, 0, 84, 199, 143, 0, 44, 1, 6, 0, 194, 0, 188, 199, 0, + 0, 143, 0, 6, 0, 194, 0, 196, 199, 0, 0, 64, 1, 0, 0, 200, + 0, 156, 202, 255, 255, 104, 0, 128, 0, 58, 0, 72, 0, 224, 199, 64, + 0, 116, 0, 76, 0, 106, 0, 228, 199, 116, 0, 168, 0, 76, 0, 106, + 0, 232, 199, 64, 0, 116, 0, 106, 0, 136, 0, 236, 199, 116, 0, 168, + 0, 106, 0, 136, 0, 240, 199, 0, 0, 64, 1, 0, 0, 200, 0, 156, + 202, 255, 255, 186, 0, 202, 0, 157, 0, 173, 0, 32, 200, 243, 0, 3, + 1, 131, 0, 147, 0, 28, 200, 12, 1, 28, 1, 168, 0, 184, 0, 84, + 199, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 119, 0, 174, + 0, 82, 0, 128, 0, 56, 200, 70, 0, 137, 0, 62, 0, 111, 0, 132, + 200, 188, 0, 250, 0, 68, 0, 152, 0, 80, 200, 0, 0, 64, 1, 0, + 0, 200, 0, 156, 202, 255, 255, 236, 0, 252, 0, 112, 0, 128, 0, 76, + 200, 188, 0, 250, 0, 64, 0, 152, 0, 92, 200, 62, 0, 152, 0, 56, + 0, 133, 0, 120, 200, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, + 255, 119, 0, 174, 0, 82, 0, 128, 0, 72, 200, 70, 0, 139, 0, 62, + 0, 111, 0, 84, 200, 236, 0, 252, 0, 112, 0, 128, 0, 76, 200, 0, + 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 236, 0, 252, 0, 112, + 0, 128, 0, 76, 200, 188, 0, 250, 0, 64, 0, 152, 0, 88, 200, 62, + 0, 152, 0, 56, 0, 133, 0, 120, 200, 0, 0, 64, 1, 0, 0, 200, + 0, 156, 202, 255, 255, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, 101, + 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, 13, + 10, 85, 110, 97, 98, 108, 101, 32, 116, 111, 32, 97, 108, 108, 111, 99, + 97, 116, 101, 32, 69, 120, 112, 97, 110, 100, 101, 100, 32, 77, 101, 109, + 111, 114, 121, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, + 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, + 111, 114, 58, 13, 10, 83, 111, 117, 110, 100, 32, 66, 108, 97, 115, 116, + 101, 114, 32, 99, 97, 114, 100, 32, 110, 111, 116, 32, 102, 111, 117, 110, + 100, 32, 97, 116, 32, 97, 100, 100, 114, 101, 115, 115, 32, 50, 50, 48, + 32, 72, 101, 120, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, + 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, + 114, 111, 114, 58, 13, 10, 79, 117, 116, 32, 111, 102, 32, 66, 97, 115, + 101, 32, 77, 101, 109, 111, 114, 121, 46, 13, 10, 13, 10, 36, 13, 10, + 13, 10, 68, 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, + 110, 32, 69, 114, 114, 111, 114, 58, 13, 10, 77, 101, 109, 111, 114, 121, + 32, 68, 101, 97, 108, 108, 111, 99, 97, 116, 105, 111, 110, 32, 112, 114, + 111, 98, 108, 101, 109, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, + 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, + 114, 114, 111, 114, 58, 13, 10, 65, 116, 32, 108, 101, 97, 115, 116, 32, + 53, 57, 48, 75, 32, 111, 102, 32, 98, 97, 115, 101, 32, 109, 101, 109, + 111, 114, 121, 32, 105, 115, 32, 114, 101, 113, 117, 105, 114, 101, 100, 46, + 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, 101, + 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, 13, + 10, 83, 111, 117, 110, 100, 32, 66, 108, 97, 115, 116, 101, 114, 32, 110, + 111, 116, 32, 102, 111, 117, 110, 100, 32, 111, 110, 32, 105, 110, 116, 101, + 114, 117, 112, 116, 32, 48, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, + 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, + 114, 114, 111, 114, 58, 13, 10, 85, 110, 97, 98, 108, 101, 32, 116, 111, + 32, 115, 101, 108, 101, 99, 116, 32, 69, 77, 77, 32, 112, 97, 103, 101, + 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, + 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, + 13, 10, 70, 105, 108, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, + 46, 99, 13, 10, 13, 10, 36, 68, 114, 101, 97, 109, 119, 101, 98, 32, + 108, 111, 111, 107, 115, 32, 102, 111, 114, 32, 83, 111, 117, 110, 100, 32, + 66, 108, 97, 115, 116, 101, 114, 32, 105, 110, 102, 111, 114, 109, 97, 116, + 105, 111, 110, 32, 105, 110, 13, 10, 116, 104, 101, 32, 66, 76, 65, 83, + 84, 69, 82, 32, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 32, + 118, 97, 114, 105, 97, 98, 108, 101, 32, 40, 105, 110, 32, 121, 111, 117, + 114, 32, 65, 85, 84, 79, 69, 88, 69, 67, 46, 66, 65, 84, 41, 13, + 10, 13, 10, 73, 102, 32, 116, 104, 105, 115, 32, 105, 115, 32, 110, 111, + 116, 32, 102, 111, 117, 110, 100, 32, 116, 104, 101, 110, 32, 73, 82, 81, + 32, 55, 44, 32, 68, 77, 65, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 49, 32, 97, 110, 100, 32, 98, 97, 115, 101, 13, 10, 97, 100, 100, 114, + 101, 115, 115, 32, 50, 50, 48, 104, 32, 97, 114, 101, 32, 97, 115, 115, + 117, 109, 101, 100, 46, 13, 10, 13, 10, 84, 111, 32, 97, 108, 116, 101, + 114, 32, 97, 110, 121, 32, 111, 114, 32, 97, 108, 108, 32, 111, 102, 32, + 116, 104, 101, 115, 101, 32, 115, 101, 116, 116, 105, 110, 103, 115, 32, 121, + 111, 117, 32, 99, 97, 110, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, + 104, 101, 109, 13, 10, 111, 110, 32, 116, 104, 101, 32, 99, 111, 109, 109, + 97, 110, 100, 32, 108, 105, 110, 101, 46, 32, 70, 111, 114, 32, 101, 120, + 97, 109, 112, 108, 101, 58, 13, 10, 13, 10, 84, 121, 112, 101, 32, 68, + 82, 69, 65, 77, 87, 69, 66, 32, 73, 55, 32, 65, 50, 50, 48, 32, + 68, 49, 32, 116, 111, 32, 114, 117, 110, 32, 68, 114, 101, 97, 109, 119, + 101, 98, 32, 111, 110, 32, 73, 82, 81, 32, 55, 44, 32, 68, 77, 65, + 13, 10, 32, 99, 104, 97, 110, 110, 101, 108, 32, 49, 32, 97, 110, 100, + 32, 98, 97, 115, 101, 32, 97, 100, 100, 114, 101, 115, 115, 32, 50, 50, + 48, 104, 13, 10, 32, 68, 82, 69, 65, 77, 87, 69, 66, 32, 73, 53, + 32, 116, 111, 32, 114, 117, 110, 32, 68, 114, 101, 97, 109, 119, 101, 98, + 32, 111, 110, 32, 73, 82, 81, 32, 53, 32, 97, 110, 100, 13, 10, 32, + 100, 101, 102, 97, 117, 108, 116, 32, 97, 100, 100, 114, 101, 115, 115, 32, + 111, 102, 32, 50, 50, 48, 104, 44, 32, 68, 77, 65, 32, 49, 13, 10, + 13, 10, 36, 13, 10, 13, 10, 84, 114, 121, 32, 116, 104, 101, 32, 68, + 114, 101, 97, 109, 119, 101, 98, 32, 67, 68, 32, 105, 110, 32, 121, 111, + 117, 114, 32, 115, 116, 101, 114, 101, 111, 46, 46, 46, 46, 13, 10, 13, + 10, 13, 10, 36, 129, 0, 184, 0, 82, 0, 128, 0, 188, 200, 80, 0, + 147, 0, 62, 0, 111, 0, 132, 200, 183, 0, 250, 0, 62, 0, 111, 0, + 192, 200, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 83, 80, + 69, 69, 67, 72, 82, 50, 52, 67, 48, 48, 48, 53, 46, 82, 65, 87, + 0, 135, 131, 129, 130, 44, 0, 70, 0, 32, 0, 46, 0, 116, 196, 0, + 0, 50, 0, 0, 0, 180, 0, 128, 195, 226, 0, 244, 0, 10, 0, 26, + 0, 44, 200, 226, 0, 244, 0, 26, 0, 40, 0, 48, 200, 240, 0, 4, + 1, 100, 0, 124, 0, 200, 201, 0, 0, 64, 1, 0, 0, 200, 0, 208, + 201, 255, 255, 44, 0, 70, 0, 32, 0, 46, 0, 116, 196, 0, 0, 50, + 0, 0, 0, 180, 0, 128, 195, 18, 1, 36, 1, 10, 0, 26, 0, 44, + 200, 18, 1, 36, 1, 26, 0, 40, 0, 48, 200, 240, 0, 4, 1, 100, + 0, 124, 0, 200, 201, 0, 0, 64, 1, 0, 0, 200, 0, 208, 201, 255, + 255, 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, 5, 22, 10, 15, 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, 21, 11, 20, 15, 255, 21, 0, + 20, 15, 255, 21, 22, 20, 15, 255, 21, 33, 20, 15, 255, 21, 44, 20, + 15, 255, 21, 44, 10, 15, 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, 79, 66, 74, 69, 67, 84, + 32, 78, 65, 77, 69, 32, 79, 78, 69, 32, 0, 16, 18, 18, 17, 16, + 16, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, + 0, 8, 0, 81, 87, 69, 82, 84, 89, 85, 73, 79, 80, 0, 0, 13, + 0, 65, 83, 68, 70, 71, 72, 74, 75, 76, 0, 0, 0, 0, 0, 90, + 88, 67, 86, 66, 78, 77, 0, 0, 0, 0, 0, 0, 32, 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, 68, 82, 69, 65, 77, 87, 69, 66, 32, 68, + 65, 84, 65, 32, 70, 73, 76, 69, 32, 67, 79, 80, 89, 82, 73, 71, + 72, 84, 32, 49, 57, 57, 50, 32, 67, 82, 69, 65, 84, 73, 86, 69, + 32, 82, 69, 65, 76, 73, 84, 89, 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, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 48, 0, 5, 255, 33, 10, 255, 255, 255, 0, 1, 6, 2, 255, 3, + 255, 255, 255, 255, 255, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 49, 0, 1, 255, 44, 10, 255, 255, 255, 0, 7, 2, 255, 255, 255, + 255, 6, 255, 255, 255, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 50, 0, 2, 255, 33, 0, 255, 255, 255, 0, 1, 0, 255, 255, 1, + 255, 3, 255, 255, 255, 2, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 51, 0, 5, 255, 33, 10, 255, 255, 255, 0, 2, 2, 0, 2, 4, + 255, 0, 255, 255, 255, 3, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 52, 0, 23, 255, 11, 30, 255, 255, 255, 0, 1, 4, 0, 5, 255, + 255, 3, 255, 255, 255, 4, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 53, 0, 5, 255, 22, 30, 255, 255, 255, 0, 1, 2, 0, 4, 255, + 255, 3, 255, 255, 255, 5, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 54, 0, 5, 255, 11, 30, 255, 255, 255, 0, 1, 0, 0, 1, 2, + 255, 0, 255, 255, 255, 6, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 55, 0, 255, 255, 0, 20, 255, 255, 255, 0, 2, 2, 255, 255, 255, + 255, 0, 255, 255, 255, 7, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 56, 0, 8, 255, 0, 10, 255, 255, 255, 0, 1, 2, 255, 255, 255, + 255, 0, 11, 40, 0, 8, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 57, 0, 9, 255, 22, 10, 255, 255, 255, 0, 4, 6, 255, 255, 255, + 255, 0, 255, 255, 255, 9, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 48, 0, 10, 255, 33, 30, 255, 255, 255, 0, 2, 0, 255, 255, 2, + 2, 4, 22, 30, 255, 10, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 49, 0, 11, 255, 11, 20, 255, 255, 255, 0, 0, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 11, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 50, 0, 12, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 12, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 51, 0, 12, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 13, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 52, 0, 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, 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, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 57, 0, 19, 255, 0, 0, 255, 255, 255, 0, 0, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 19, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 48, 0, 22, 255, 0, 20, 255, 255, 255, 0, 1, 4, 2, 15, 255, + 255, 255, 255, 255, 255, 20, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 49, 0, 5, 255, 11, 10, 255, 255, 255, 0, 1, 4, 2, 15, 1, + 255, 255, 255, 255, 255, 21, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 50, 0, 22, 255, 22, 10, 255, 255, 255, 0, 0, 4, 255, 255, 1, + 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 51, 0, 23, 255, 22, 30, 255, 255, 255, 0, 1, 4, 2, 15, 3, + 255, 255, 255, 255, 255, 23, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 52, 0, 5, 255, 44, 0, 255, 255, 255, 0, 1, 6, 2, 15, 255, + 255, 255, 255, 255, 255, 24, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 53, 0, 22, 255, 11, 40, 255, 255, 255, 0, 1, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 25, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 54, 0, 9, 255, 22, 20, 255, 255, 255, 0, 4, 2, 255, 255, 255, + 255, 255, 255, 255, 255, 26, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 55, 0, 22, 255, 11, 20, 255, 255, 255, 0, 0, 6, 255, 255, 255, + 255, 255, 255, 255, 255, 27, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 56, 0, 5, 255, 11, 30, 255, 255, 255, 0, 0, 0, 255, 255, 2, + 255, 255, 255, 255, 255, 28, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 57, 0, 22, 255, 11, 10, 255, 255, 255, 0, 0, 2, 255, 255, 255, + 255, 255, 255, 255, 255, 29, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 53, 0, 5, 255, 22, 10, 255, 255, 255, 0, 1, 4, 1, 15, 255, + 255, 255, 255, 255, 255, 5, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 52, 0, 23, 255, 22, 20, 255, 255, 255, 0, 1, 4, 2, 15, 255, + 255, 255, 255, 255, 255, 4, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 48, 0, 10, 255, 22, 30, 255, 255, 255, 0, 3, 6, 255, 255, 255, + 255, 255, 255, 255, 255, 10, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 50, 0, 12, 255, 22, 20, 255, 255, 255, 0, 0, 2, 255, 255, 255, + 255, 255, 255, 255, 255, 12, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 51, 0, 5, 255, 44, 0, 255, 255, 255, 0, 1, 6, 2, 255, 4, + 255, 255, 255, 255, 255, 3, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 52, 0, 5, 255, 22, 0, 255, 255, 255, 0, 3, 6, 0, 255, 255, + 255, 255, 33, 0, 3, 24, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 50, 0, 22, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 50, 0, 22, 255, 22, 20, 255, 255, 255, 0, 0, 2, 255, 255, 255, + 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 49, 0, 11, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 11, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 56, 0, 5, 255, 11, 20, 255, 255, 255, 0, 0, 6, 255, 255, 2, + 255, 255, 255, 255, 255, 28, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 49, 0, 5, 255, 11, 10, 255, 255, 255, 0, 1, 4, 2, 15, 1, + 255, 255, 255, 255, 255, 21, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 50, 54, 0, 9, 255, 0, 40, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 26, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 49, 57, 0, 19, 255, 0, 0, 255, 255, 255, 0, 2, 2, 255, 255, 255, + 255, 255, 255, 255, 255, 19, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 56, 0, 8, 255, 11, 40, 255, 255, 255, 0, 0, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 8, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 48, 49, 0, 1, 255, 44, 10, 255, 255, 255, 0, 3, 6, 255, 255, 255, + 255, 255, 255, 255, 255, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 52, 53, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 6, 255, 255, 255, + 255, 255, 255, 255, 255, 45, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 52, 54, 0, 35, 255, 22, 40, 255, 255, 255, 0, 0, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 46, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 52, 55, 0, 35, 255, 0, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 47, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 52, 53, 0, 35, 255, 22, 30, 255, 255, 255, 0, 4, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 45, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 52, 54, 0, 35, 255, 22, 50, 255, 255, 255, 0, 0, 4, 255, 255, 255, + 255, 255, 255, 255, 255, 46, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 48, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 50, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 49, 0, 35, 255, 11, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 51, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 50, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 52, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 51, 0, 35, 255, 33, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 53, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 52, 0, 35, 255, 0, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 54, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, + 53, 53, 0, 14, 255, 44, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, + 255, 255, 255, 255, 255, 55, 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, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 5, 0, 3, 2, 4, 1, 10, 9, 8, 6, + 11, 4, 7, 7, 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, + 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, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 2, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, + 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 49, 0, 68, + 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 50, 0, 68, 82, 69, 65, + 77, 87, 69, 66, 46, 68, 48, 51, 0, 68, 82, 69, 65, 77, 87, 69, + 66, 46, 68, 48, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, + 48, 53, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 54, 0, + 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 69, 77, 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, 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, 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, + 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, }; +data.assign(src, src + sizeof(src)); + }; + + +void __dispatch_call(Context &context, unsigned addr) { + switch(addr) { + case 0xc000: alleybarksound(context); break; + case 0xc004: intromusic(context); break; + case 0xc008: foghornsound(context); break; + case 0xc00c: receptionist(context); break; + case 0xc010: smokebloke(context); break; + case 0xc014: attendant(context); break; + case 0xc018: manasleep(context); break; + case 0xc01c: eden(context); break; + case 0xc020: edeninbath(context); break; + case 0xc024: malefan(context); break; + case 0xc028: femalefan(context); break; + case 0xc02c: louis(context); break; + case 0xc030: louischair(context); break; + case 0xc034: manasleep2(context); break; + case 0xc038: mansatstill(context); break; + case 0xc03c: tattooman(context); break; + case 0xc040: drinker(context); break; + case 0xc044: bartender(context); break; + case 0xc048: othersmoker(context); break; + case 0xc04c: barwoman(context); break; + case 0xc050: interviewer(context); break; + case 0xc054: soldier1(context); break; + case 0xc058: rockstar(context); break; + case 0xc05c: helicopter(context); break; + case 0xc060: mugger(context); break; + case 0xc064: aide(context); break; + case 0xc068: businessman(context); break; + case 0xc06c: poolguard(context); break; + case 0xc070: security(context); break; + case 0xc074: heavy(context); break; + case 0xc078: bossman(context); break; + case 0xc07c: gamer(context); break; + case 0xc080: sparkydrip(context); break; + case 0xc084: carparkdrip(context); break; + case 0xc088: keeper(context); break; + case 0xc08c: candles1(context); break; + case 0xc090: smallcandle(context); break; + case 0xc094: intromagic1(context); break; + case 0xc098: candles(context); break; + case 0xc09c: candles2(context); break; + case 0xc0a0: gates(context); break; + case 0xc0a4: intromagic2(context); break; + case 0xc0a8: intromagic3(context); break; + case 0xc0ac: intromonks1(context); break; + case 0xc0b0: intromonks2(context); break; + case 0xc0b4: handclap(context); break; + case 0xc0b8: monks2text(context); break; + case 0xc0bc: intro1text(context); break; + case 0xc0c0: intro2text(context); break; + case 0xc0c4: intro3text(context); break; + case 0xc0c8: monkandryan(context); break; + case 0xc0cc: endgameseq(context); break; + case 0xc0d0: rollendcredits(context); break; + case 0xc0d4: priest(context); break; + case 0xc0d8: madmanstelly(context); break; + case 0xc0dc: madman(context); break; + case 0xc0e0: madmantext(context); break; + case 0xc0e4: madmode(context); break; + case 0xc0e8: priesttext(context); break; + case 0xc0ec: textforend(context); break; + case 0xc0f0: textformonk(context); break; + case 0xc0f4: drunk(context); break; + case 0xc0f8: advisor(context); break; + case 0xc0fc: copper(context); break; + case 0xc100: sparky(context); break; + case 0xc104: train(context); break; + case 0xc108: addtopeoplelist(context); break; + case 0xc10c: showgamereel(context); break; + case 0xc110: checkspeed(context); break; + case 0xc114: clearsprites(context); break; + case 0xc118: makesprite(context); break; + case 0xc11c: delsprite(context); break; + case 0xc120: spriteupdate(context); break; + case 0xc124: printsprites(context); break; + case 0xc128: printasprite(context); break; + case 0xc12c: checkone(context); break; + case 0xc130: findsource(context); break; + case 0xc134: initman(context); break; + case 0xc138: mainman(context); break; + case 0xc13c: aboutturn(context); break; + case 0xc140: walking(context); break; + case 0xc144: facerightway(context); break; + case 0xc148: checkforexit(context); break; + case 0xc14c: adjustdown(context); break; + case 0xc150: adjustup(context); break; + case 0xc154: adjustleft(context); break; + case 0xc158: adjustright(context); break; + case 0xc15c: reminders(context); break; + case 0xc160: initrain(context); break; + case 0xc164: splitintolines(context); break; + case 0xc168: getblockofpixel(context); break; + case 0xc16c: showrain(context); break; + case 0xc170: backobject(context); break; + case 0xc174: liftsprite(context); break; + case 0xc178: liftnoise(context); break; + case 0xc17c: random(context); break; + case 0xc180: steady(context); break; + case 0xc184: constant(context); break; + case 0xc188: doorway(context); break; + case 0xc18c: widedoor(context); break; + case 0xc190: dodoor(context); break; + case 0xc194: lockeddoorway(context); break; + case 0xc198: updatepeople(context); break; + case 0xc19c: getreelframeax(context); break; + case 0xc1a0: reelsonscreen(context); break; + case 0xc1a4: plotreel(context); break; + case 0xc1a8: soundonreels(context); break; + case 0xc1ac: reconstruct(context); break; + case 0xc1b0: dealwithspecial(context); break; + case 0xc1b4: movemap(context); break; + case 0xc1b8: getreelstart(context); break; + case 0xc1bc: showreelframe(context); break; + case 0xc1c0: deleverything(context); break; + case 0xc1c4: dumpeverything(context); break; + case 0xc1c8: allocatework(context); break; + case 0xc1cc: showpcx(context); break; + case 0xc1d0: readabyte(context); break; + case 0xc1d4: readoneblock(context); break; + case 0xc1d8: loadpalfromiff(context); break; + case 0xc1dc: setmode(context); break; + case 0xc1e0: cls(context); break; + case 0xc1e4: printundermon(context); break; + case 0xc1e8: worktoscreen(context); break; + case 0xc1ec: paneltomap(context); break; + case 0xc1f0: maptopanel(context); break; + case 0xc1f4: dumpmap(context); break; + case 0xc1f8: pixelcheckset(context); break; + case 0xc1fc: createpanel(context); break; + case 0xc200: createpanel2(context); break; + case 0xc204: clearwork(context); break; + case 0xc208: vsync(context); break; + case 0xc20c: doshake(context); break; + case 0xc210: zoom(context); break; + case 0xc214: delthisone(context); break; + case 0xc218: multiget(context); break; + case 0xc21c: multiput(context); break; + case 0xc220: multidump(context); break; + case 0xc224: width160(context); break; + case 0xc228: doblocks(context); break; + case 0xc22c: showframe(context); break; + case 0xc230: frameoutv(context); break; + case 0xc234: frameoutnm(context); break; + case 0xc238: frameoutbh(context); break; + case 0xc23c: frameoutfx(context); break; + case 0xc240: transferinv(context); break; + case 0xc244: transfermap(context); break; + case 0xc248: fadedos(context); break; + case 0xc24c: dofade(context); break; + case 0xc250: clearendpal(context); break; + case 0xc254: clearpalette(context); break; + case 0xc258: fadescreenup(context); break; + case 0xc25c: fadetowhite(context); break; + case 0xc260: fadefromwhite(context); break; + case 0xc264: fadescreenups(context); break; + case 0xc268: fadescreendownhalf(context); break; + case 0xc26c: fadescreenuphalf(context); break; + case 0xc270: fadescreendown(context); break; + case 0xc274: fadescreendowns(context); break; + case 0xc278: clearstartpal(context); break; + case 0xc27c: showgun(context); break; + case 0xc280: rollendcredits2(context); break; + case 0xc284: rollem(context); break; + case 0xc288: fadecalculation(context); break; + case 0xc28c: greyscalesum(context); break; + case 0xc290: showgroup(context); break; + case 0xc294: paltostartpal(context); break; + case 0xc298: endpaltostart(context); break; + case 0xc29c: startpaltoend(context); break; + case 0xc2a0: paltoendpal(context); break; + case 0xc2a4: allpalette(context); break; + case 0xc2a8: dumpcurrent(context); break; + case 0xc2ac: fadedownmon(context); break; + case 0xc2b0: fadeupmon(context); break; + case 0xc2b4: fadeupmonfirst(context); break; + case 0xc2b8: fadeupyellows(context); break; + case 0xc2bc: initialmoncols(context); break; + case 0xc2c0: titles(context); break; + case 0xc2c4: endgame(context); break; + case 0xc2c8: monkspeaking(context); break; + case 0xc2cc: showmonk(context); break; + case 0xc2d0: gettingshot(context); break; + case 0xc2d4: credits(context); break; + case 0xc2d8: biblequote(context); break; + case 0xc2dc: hangone(context); break; + case 0xc2e0: intro(context); break; + case 0xc2e4: runintroseq(context); break; + case 0xc2e8: runendseq(context); break; + case 0xc2ec: loadintroroom(context); break; + case 0xc2f0: mode640x480(context); break; + case 0xc2f4: set16colpalette(context); break; + case 0xc2f8: realcredits(context); break; + case 0xc2fc: printchar(context); break; + case 0xc300: kernchars(context); break; + case 0xc304: printslow(context); break; + case 0xc308: waitframes(context); break; + case 0xc30c: printboth(context); break; + case 0xc310: printdirect(context); break; + case 0xc314: monprint(context); break; + case 0xc318: getnumber(context); break; + case 0xc31c: getnextword(context); break; + case 0xc320: modifychar(context); break; + case 0xc324: fillryan(context); break; + case 0xc328: fillopen(context); break; + case 0xc32c: findallryan(context); break; + case 0xc330: findallopen(context); break; + case 0xc334: obtoinv(context); break; + case 0xc338: isitworn(context); break; + case 0xc33c: makeworn(context); break; + case 0xc340: examineob(context); break; + case 0xc344: makemainscreen(context); break; + case 0xc348: getbackfromob(context); break; + case 0xc34c: incryanpage(context); break; + case 0xc350: openinv(context); break; + case 0xc354: showryanpage(context); break; + case 0xc358: openob(context); break; + case 0xc35c: obicons(context); break; + case 0xc360: examicon(context); break; + case 0xc364: obpicture(context); break; + case 0xc368: describeob(context); break; + case 0xc36c: additionaltext(context); break; + case 0xc370: obsthatdothings(context); break; + case 0xc374: getobtextstart(context); break; + case 0xc378: searchforsame(context); break; + case 0xc37c: findnextcolon(context); break; + case 0xc380: inventory(context); break; + case 0xc384: setpickup(context); break; + case 0xc388: examinventory(context); break; + case 0xc38c: reexfrominv(context); break; + case 0xc390: reexfromopen(context); break; + case 0xc394: swapwithinv(context); break; + case 0xc398: swapwithopen(context); break; + case 0xc39c: intoinv(context); break; + case 0xc3a0: deletetaken(context); break; + case 0xc3a4: outofinv(context); break; + case 0xc3a8: getfreead(context); break; + case 0xc3ac: getexad(context); break; + case 0xc3b0: geteitherad(context); break; + case 0xc3b4: getanyad(context); break; + case 0xc3b8: getanyaddir(context); break; + case 0xc3bc: getopenedsize(context); break; + case 0xc3c0: getsetad(context); break; + case 0xc3c4: findinvpos(context); break; + case 0xc3c8: findopenpos(context); break; + case 0xc3cc: dropobject(context); break; + case 0xc3d0: droperror(context); break; + case 0xc3d4: cantdrop(context); break; + case 0xc3d8: wornerror(context); break; + case 0xc3dc: removeobfrominv(context); break; + case 0xc3e0: selectopenob(context); break; + case 0xc3e4: useopened(context); break; + case 0xc3e8: errormessage1(context); break; + case 0xc3ec: errormessage2(context); break; + case 0xc3f0: errormessage3(context); break; + case 0xc3f4: checkobjectsize(context); break; + case 0xc3f8: outofopen(context); break; + case 0xc3fc: transfertoex(context); break; + case 0xc400: pickupconts(context); break; + case 0xc404: transfercontoex(context); break; + case 0xc408: transfertext(context); break; + case 0xc40c: getexpos(context); break; + case 0xc410: purgealocation(context); break; + case 0xc414: emergencypurge(context); break; + case 0xc418: purgeanitem(context); break; + case 0xc41c: deleteexobject(context); break; + case 0xc420: deleteexframe(context); break; + case 0xc424: deleteextext(context); break; + case 0xc428: blockget(context); break; + case 0xc42c: drawfloor(context); break; + case 0xc430: calcmapad(context); break; + case 0xc434: getdimension(context); break; + case 0xc438: addalong(context); break; + case 0xc43c: addlength(context); break; + case 0xc440: drawflags(context); break; + case 0xc444: eraseoldobs(context); break; + case 0xc448: showallobs(context); break; + case 0xc44c: makebackob(context); break; + case 0xc450: showallfree(context); break; + case 0xc454: showallex(context); break; + case 0xc458: calcfrframe(context); break; + case 0xc45c: finalframe(context); break; + case 0xc460: adjustlen(context); break; + case 0xc464: getmapad(context); break; + case 0xc468: getxad(context); break; + case 0xc46c: getyad(context); break; + case 0xc470: autolook(context); break; + case 0xc474: look(context); break; + case 0xc478: dolook(context); break; + case 0xc47c: redrawmainscrn(context); break; + case 0xc480: getback1(context); break; + case 0xc484: talk(context); break; + case 0xc488: convicons(context); break; + case 0xc48c: getpersframe(context); break; + case 0xc490: starttalk(context); break; + case 0xc494: getpersontext(context); break; + case 0xc498: moretalk(context); break; + case 0xc49c: dosometalk(context); break; + case 0xc4a0: hangonpq(context); break; + case 0xc4a4: redes(context); break; + case 0xc4a8: newplace(context); break; + case 0xc4ac: selectlocation(context); break; + case 0xc4b0: showcity(context); break; + case 0xc4b4: lookatplace(context); break; + case 0xc4b8: getundercentre(context); break; + case 0xc4bc: putundercentre(context); break; + case 0xc4c0: locationpic(context); break; + case 0xc4c4: getdestinfo(context); break; + case 0xc4c8: showarrows(context); break; + case 0xc4cc: nextdest(context); break; + case 0xc4d0: lastdest(context); break; + case 0xc4d4: destselect(context); break; + case 0xc4d8: getlocation(context); break; + case 0xc4dc: setlocation(context); break; + case 0xc4e0: resetlocation(context); break; + case 0xc4e4: readdesticon(context); break; + case 0xc4e8: readcitypic(context); break; + case 0xc4ec: usemon(context); break; + case 0xc4f0: printoutermon(context); break; + case 0xc4f4: loadpersonal(context); break; + case 0xc4f8: loadnews(context); break; + case 0xc4fc: loadcart(context); break; + case 0xc500: lookininterface(context); break; + case 0xc504: turnonpower(context); break; + case 0xc508: randomaccess(context); break; + case 0xc50c: powerlighton(context); break; + case 0xc510: powerlightoff(context); break; + case 0xc514: accesslighton(context); break; + case 0xc518: accesslightoff(context); break; + case 0xc51c: locklighton(context); break; + case 0xc520: locklightoff(context); break; + case 0xc524: input(context); break; + case 0xc528: makecaps(context); break; + case 0xc52c: delchar(context); break; + case 0xc530: execcommand(context); break; + case 0xc534: neterror(context); break; + case 0xc538: dircom(context); break; + case 0xc53c: searchforfiles(context); break; + case 0xc540: signon(context); break; + case 0xc544: showkeys(context); break; + case 0xc548: read(context); break; + case 0xc54c: dirfile(context); break; + case 0xc550: getkeyandlogo(context); break; + case 0xc554: searchforstring(context); break; + case 0xc558: parser(context); break; + case 0xc55c: scrollmonitor(context); break; + case 0xc560: lockmon(context); break; + case 0xc564: monitorlogo(context); break; + case 0xc568: printlogo(context); break; + case 0xc56c: showcurrentfile(context); break; + case 0xc570: monmessage(context); break; + case 0xc574: processtrigger(context); break; + case 0xc578: triggermessage(context); break; + case 0xc57c: printcurs(context); break; + case 0xc580: delcurs(context); break; + case 0xc584: useobject(context); break; + case 0xc588: useroutine(context); break; + case 0xc58c: wheelsound(context); break; + case 0xc590: runtap(context); break; + case 0xc594: playguitar(context); break; + case 0xc598: hotelcontrol(context); break; + case 0xc59c: hotelbell(context); break; + case 0xc5a0: opentomb(context); break; + case 0xc5a4: usetrainer(context); break; + case 0xc5a8: nothelderror(context); break; + case 0xc5ac: usepipe(context); break; + case 0xc5b0: usefullcart(context); break; + case 0xc5b4: useplinth(context); break; + case 0xc5b8: chewy(context); break; + case 0xc5bc: useladder(context); break; + case 0xc5c0: useladderb(context); break; + case 0xc5c4: slabdoora(context); break; + case 0xc5c8: slabdoorb(context); break; + case 0xc5cc: slabdoord(context); break; + case 0xc5d0: slabdoorc(context); break; + case 0xc5d4: slabdoore(context); break; + case 0xc5d8: slabdoorf(context); break; + case 0xc5dc: useslab(context); break; + case 0xc5e0: usecart(context); break; + case 0xc5e4: useclearbox(context); break; + case 0xc5e8: usecoveredbox(context); break; + case 0xc5ec: userailing(context); break; + case 0xc5f0: useopenbox(context); break; + case 0xc5f4: wearwatch(context); break; + case 0xc5f8: wearshades(context); break; + case 0xc5fc: sitdowninbar(context); break; + case 0xc600: usechurchhole(context); break; + case 0xc604: usehole(context); break; + case 0xc608: usealtar(context); break; + case 0xc60c: opentvdoor(context); break; + case 0xc610: usedryer(context); break; + case 0xc614: openlouis(context); break; + case 0xc618: nextcolon(context); break; + case 0xc61c: openyourneighbour(context); break; + case 0xc620: usewindow(context); break; + case 0xc624: usebalcony(context); break; + case 0xc628: openryan(context); break; + case 0xc62c: openpoolboss(context); break; + case 0xc630: openeden(context); break; + case 0xc634: opensarters(context); break; + case 0xc638: isitright(context); break; + case 0xc63c: drawitall(context); break; + case 0xc640: openhoteldoor(context); break; + case 0xc644: openhoteldoor2(context); break; + case 0xc648: grafittidoor(context); break; + case 0xc64c: trapdoor(context); break; + case 0xc650: callhotellift(context); break; + case 0xc654: calledenslift(context); break; + case 0xc658: calledensdlift(context); break; + case 0xc65c: usepoolreader(context); break; + case 0xc660: uselighter(context); break; + case 0xc664: showseconduse(context); break; + case 0xc668: usecardreader1(context); break; + case 0xc66c: usecardreader2(context); break; + case 0xc670: usecardreader3(context); break; + case 0xc674: usecashcard(context); break; + case 0xc678: lookatcard(context); break; + case 0xc67c: moneypoke(context); break; + case 0xc680: usecontrol(context); break; + case 0xc684: usehatch(context); break; + case 0xc688: usewire(context); break; + case 0xc68c: usehandle(context); break; + case 0xc690: useelevator1(context); break; + case 0xc694: showfirstuse(context); break; + case 0xc698: useelevator3(context); break; + case 0xc69c: useelevator4(context); break; + case 0xc6a0: useelevator2(context); break; + case 0xc6a4: useelevator5(context); break; + case 0xc6a8: usekey(context); break; + case 0xc6ac: usestereo(context); break; + case 0xc6b0: usecooker(context); break; + case 0xc6b4: useaxe(context); break; + case 0xc6b8: useelvdoor(context); break; + case 0xc6bc: withwhat(context); break; + case 0xc6c0: selectob(context); break; + case 0xc6c4: compare(context); break; + case 0xc6c8: findsetobject(context); break; + case 0xc6cc: findexobject(context); break; + case 0xc6d0: isryanholding(context); break; + case 0xc6d4: checkinside(context); break; + case 0xc6d8: usetext(context); break; + case 0xc6dc: putbackobstuff(context); break; + case 0xc6e0: showpuztext(context); break; + case 0xc6e4: findpuztext(context); break; + case 0xc6e8: placesetobject(context); break; + case 0xc6ec: removesetobject(context); break; + case 0xc6f0: issetobonmap(context); break; + case 0xc6f4: placefreeobject(context); break; + case 0xc6f8: removefreeobject(context); break; + case 0xc6fc: findormake(context); break; + case 0xc700: switchryanon(context); break; + case 0xc704: switchryanoff(context); break; + case 0xc708: setallchanges(context); break; + case 0xc70c: dochange(context); break; + case 0xc710: autoappear(context); break; + case 0xc714: getundertimed(context); break; + case 0xc718: putundertimed(context); break; + case 0xc71c: dumptimedtext(context); break; + case 0xc720: setuptimeduse(context); break; + case 0xc724: setuptimedtemp(context); break; + case 0xc728: usetimedtext(context); break; + case 0xc72c: edenscdplayer(context); break; + case 0xc730: usewall(context); break; + case 0xc734: usechurchgate(context); break; + case 0xc738: usegun(context); break; + case 0xc73c: useshield(context); break; + case 0xc740: usebuttona(context); break; + case 0xc744: useplate(context); break; + case 0xc748: usewinch(context); break; + case 0xc74c: entercode(context); break; + case 0xc750: loadkeypad(context); break; + case 0xc754: quitkey(context); break; + case 0xc758: addtopresslist(context); break; + case 0xc75c: buttonone(context); break; + case 0xc760: buttontwo(context); break; + case 0xc764: buttonthree(context); break; + case 0xc768: buttonfour(context); break; + case 0xc76c: buttonfive(context); break; + case 0xc770: buttonsix(context); break; + case 0xc774: buttonseven(context); break; + case 0xc778: buttoneight(context); break; + case 0xc77c: buttonnine(context); break; + case 0xc780: buttonnought(context); break; + case 0xc784: buttonenter(context); break; + case 0xc788: buttonpress(context); break; + case 0xc78c: showouterpad(context); break; + case 0xc790: showkeypad(context); break; + case 0xc794: singlekey(context); break; + case 0xc798: dumpkeypad(context); break; + case 0xc79c: usemenu(context); break; + case 0xc7a0: dumpmenu(context); break; + case 0xc7a4: getundermenu(context); break; + case 0xc7a8: putundermenu(context); break; + case 0xc7ac: showoutermenu(context); break; + case 0xc7b0: showmenu(context); break; + case 0xc7b4: loadmenu(context); break; + case 0xc7b8: viewfolder(context); break; + case 0xc7bc: nextfolder(context); break; + case 0xc7c0: folderhints(context); break; + case 0xc7c4: lastfolder(context); break; + case 0xc7c8: loadfolder(context); break; + case 0xc7cc: showfolder(context); break; + case 0xc7d0: folderexit(context); break; + case 0xc7d4: showleftpage(context); break; + case 0xc7d8: showrightpage(context); break; + case 0xc7dc: entersymbol(context); break; + case 0xc7e0: quitsymbol(context); break; + case 0xc7e4: settopleft(context); break; + case 0xc7e8: settopright(context); break; + case 0xc7ec: setbotleft(context); break; + case 0xc7f0: setbotright(context); break; + case 0xc7f4: dumpsymbol(context); break; + case 0xc7f8: showsymbol(context); break; + case 0xc7fc: nextsymbol(context); break; + case 0xc800: updatesymboltop(context); break; + case 0xc804: updatesymbolbot(context); break; + case 0xc808: dumpsymbox(context); break; + case 0xc80c: usediary(context); break; + case 0xc810: showdiary(context); break; + case 0xc814: showdiarykeys(context); break; + case 0xc818: dumpdiarykeys(context); break; + case 0xc81c: diarykeyp(context); break; + case 0xc820: diarykeyn(context); break; + case 0xc824: showdiarypage(context); break; + case 0xc828: findtext1(context); break; + case 0xc82c: zoomonoff(context); break; + case 0xc830: saveload(context); break; + case 0xc834: dosaveload(context); break; + case 0xc838: getbackfromops(context); break; + case 0xc83c: showmainops(context); break; + case 0xc840: showdiscops(context); break; + case 0xc844: loadsavebox(context); break; + case 0xc848: loadgame(context); break; + case 0xc84c: getbacktoops(context); break; + case 0xc850: discops(context); break; + case 0xc854: savegame(context); break; + case 0xc858: actualsave(context); break; + case 0xc85c: actualload(context); break; + case 0xc860: selectslot2(context); break; + case 0xc864: checkinput(context); break; + case 0xc868: getnamepos(context); break; + case 0xc86c: showopbox(context); break; + case 0xc870: showloadops(context); break; + case 0xc874: showsaveops(context); break; + case 0xc878: selectslot(context); break; + case 0xc87c: showslots(context); break; + case 0xc880: shownames(context); break; + case 0xc884: dosreturn(context); break; + case 0xc888: error(context); break; + case 0xc88c: namestoold(context); break; + case 0xc890: oldtonames(context); break; + case 0xc894: saveposition(context); break; + case 0xc898: loadposition(context); break; + case 0xc89c: loadseg(context); break; + case 0xc8a0: makeheader(context); break; + case 0xc8a4: storeit(context); break; + case 0xc8a8: saveseg(context); break; + case 0xc8ac: findlen(context); break; + case 0xc8b0: scanfornames(context); break; + case 0xc8b4: decide(context); break; + case 0xc8b8: showdecisions(context); break; + case 0xc8bc: newgame(context); break; + case 0xc8c0: loadold(context); break; + case 0xc8c4: loadspeech(context); break; + case 0xc8c8: createname(context); break; + case 0xc8cc: loadsample(context); break; + case 0xc8d0: loadsecondsample(context); break; + case 0xc8d4: soundstartup(context); break; + case 0xc8d8: trysoundalloc(context); break; + case 0xc8dc: setsoundoff(context); break; + case 0xc8e0: checksoundint(context); break; + case 0xc8e4: enablesoundint(context); break; + case 0xc8e8: disablesoundint(context); break; + case 0xc8ec: interupttest(context); break; + case 0xc8f0: soundend(context); break; + case 0xc8f4: out22c(context); break; + case 0xc8f8: playchannel0(context); break; + case 0xc8fc: playchannel1(context); break; + case 0xc900: makenextblock(context); break; + case 0xc904: volumeadjust(context); break; + case 0xc908: loopchannel0(context); break; + case 0xc90c: cancelch0(context); break; + case 0xc910: cancelch1(context); break; + case 0xc914: channel0only(context); break; + case 0xc918: channel1only(context); break; + case 0xc91c: channel0tran(context); break; + case 0xc920: bothchannels(context); break; + case 0xc924: saveems(context); break; + case 0xc928: restoreems(context); break; + case 0xc92c: domix(context); break; + case 0xc930: dmaend(context); break; + case 0xc934: startdmablock(context); break; + case 0xc938: setuppit(context); break; + case 0xc93c: getridofpit(context); break; + case 0xc940: pitinterupt(context); break; + case 0xc944: dreamweb(context); break; + case 0xc948: entrytexts(context); break; + case 0xc94c: entryanims(context); break; + case 0xc950: initialinv(context); break; + case 0xc954: pickupob(context); break; + case 0xc958: setupemm(context); break; + case 0xc95c: removeemm(context); break; + case 0xc960: checkforemm(context); break; + case 0xc964: checkbasemem(context); break; + case 0xc968: allocatebuffers(context); break; + case 0xc96c: clearbuffers(context); break; + case 0xc970: clearchanges(context); break; + case 0xc974: clearbeforeload(context); break; + case 0xc978: clearreels(context); break; + case 0xc97c: clearrest(context); break; + case 0xc980: deallocatemem(context); break; + case 0xc984: allocatemem(context); break; + case 0xc988: seecommandtail(context); break; + case 0xc98c: parseblaster(context); break; + case 0xc990: startup(context); break; + case 0xc994: startup1(context); break; + case 0xc998: screenupdate(context); break; + case 0xc99c: watchreel(context); break; + case 0xc9a0: checkforshake(context); break; + case 0xc9a4: watchcount(context); break; + case 0xc9a8: showtime(context); break; + case 0xc9ac: dumpwatch(context); break; + case 0xc9b0: showbyte(context); break; + case 0xc9b4: onedigit(context); break; + case 0xc9b8: twodigitnum(context); break; + case 0xc9bc: showword(context); break; + case 0xc9c0: convnum(context); break; + case 0xc9c4: mainscreen(context); break; + case 0xc9c8: madmanrun(context); break; + case 0xc9cc: checkcoords(context); break; + case 0xc9d0: identifyob(context); break; + case 0xc9d4: checkifperson(context); break; + case 0xc9d8: checkifset(context); break; + case 0xc9dc: checkifex(context); break; + case 0xc9e0: checkiffree(context); break; + case 0xc9e4: isitdescribed(context); break; + case 0xc9e8: findpathofpoint(context); break; + case 0xc9ec: findfirstpath(context); break; + case 0xc9f0: turnpathon(context); break; + case 0xc9f4: turnpathoff(context); break; + case 0xc9f8: turnanypathon(context); break; + case 0xc9fc: turnanypathoff(context); break; + case 0xca00: checkifpathison(context); break; + case 0xca04: afternewroom(context); break; + case 0xca08: atmospheres(context); break; + case 0xca0c: walkintoroom(context); break; + case 0xca10: afterintroroom(context); break; + case 0xca14: obname(context); break; + case 0xca18: finishedwalking(context); break; + case 0xca1c: examineobtext(context); break; + case 0xca20: commandwithob(context); break; + case 0xca24: commandonly(context); break; + case 0xca28: printmessage(context); break; + case 0xca2c: printmessage2(context); break; + case 0xca30: blocknametext(context); break; + case 0xca34: personnametext(context); break; + case 0xca38: walktotext(context); break; + case 0xca3c: getflagunderp(context); break; + case 0xca40: setwalk(context); break; + case 0xca44: autosetwalk(context); break; + case 0xca48: checkdest(context); break; + case 0xca4c: bresenhams(context); break; + case 0xca50: workoutframes(context); break; + case 0xca54: getroomspaths(context); break; + case 0xca58: copyname(context); break; + case 0xca5c: findobname(context); break; + case 0xca60: showicon(context); break; + case 0xca64: middlepanel(context); break; + case 0xca68: showman(context); break; + case 0xca6c: showpanel(context); break; + case 0xca70: roomname(context); break; + case 0xca74: usecharset1(context); break; + case 0xca78: usetempcharset(context); break; + case 0xca7c: showexit(context); break; + case 0xca80: panelicons1(context); break; + case 0xca84: showwatch(context); break; + case 0xca88: gettime(context); break; + case 0xca8c: zoomicon(context); break; + case 0xca90: showblink(context); break; + case 0xca94: dumpblink(context); break; + case 0xca98: worktoscreenm(context); break; + case 0xca9c: blank(context); break; + case 0xcaa0: allpointer(context); break; + case 0xcaa4: hangonp(context); break; + case 0xcaa8: hangonw(context); break; + case 0xcaac: hangoncurs(context); break; + case 0xcab0: getunderzoom(context); break; + case 0xcab4: dumpzoom(context); break; + case 0xcab8: putunderzoom(context); break; + case 0xcabc: crosshair(context); break; + case 0xcac0: showpointer(context); break; + case 0xcac4: delpointer(context); break; + case 0xcac8: dumppointer(context); break; + case 0xcacc: undertextline(context); break; + case 0xcad0: deltextline(context); break; + case 0xcad4: dumptextline(context); break; + case 0xcad8: animpointer(context); break; + case 0xcadc: setmouse(context); break; + case 0xcae0: readmouse(context); break; + case 0xcae4: mousecall(context); break; + case 0xcae8: readmouse1(context); break; + case 0xcaec: readmouse2(context); break; + case 0xcaf0: readmouse3(context); break; + case 0xcaf4: readmouse4(context); break; + case 0xcaf8: readkey(context); break; + case 0xcafc: convertkey(context); break; + case 0xcb00: randomnum1(context); break; + case 0xcb04: randomnum2(context); break; + case 0xcb0c: hangon(context); break; + case 0xcb10: loadtraveltext(context); break; + case 0xcb14: loadintotemp(context); break; + case 0xcb18: loadintotemp2(context); break; + case 0xcb1c: loadintotemp3(context); break; + case 0xcb20: loadtempcharset(context); break; + case 0xcb24: standardload(context); break; + case 0xcb28: loadtemptext(context); break; + case 0xcb2c: loadroom(context); break; + case 0xcb30: loadroomssample(context); break; + case 0xcb34: getridofreels(context); break; + case 0xcb38: getridofall(context); break; + case 0xcb3c: restorereels(context); break; + case 0xcb40: restoreall(context); break; + case 0xcb44: sortoutmap(context); break; + case 0xcb48: startloading(context); break; + case 0xcb4c: disablepath(context); break; + case 0xcb50: findxyfrompath(context); break; + case 0xcb54: findroominloc(context); break; + case 0xcb58: getroomdata(context); break; + case 0xcb5c: readheader(context); break; + case 0xcb60: dontloadseg(context); break; + case 0xcb64: allocateload(context); break; + case 0xcb68: fillspace(context); break; + case 0xcb6c: getridoftemp(context); break; + case 0xcb70: getridoftemptext(context); break; + case 0xcb74: getridoftemp2(context); break; + case 0xcb78: getridoftemp3(context); break; + case 0xcb7c: getridoftempcharset(context); break; + case 0xcb80: getridoftempsp(context); break; + case 0xcb84: readsetdata(context); break; + case 0xcb88: createfile(context); break; + case 0xcb8c: openfile(context); break; + case 0xcb90: openfilenocheck(context); break; + case 0xcb94: openforsave(context); break; + case 0xcb98: closefile(context); break; + case 0xcb9c: readfromfile(context); break; + case 0xcba0: setkeyboardint(context); break; + case 0xcba4: resetkeyboard(context); break; + case 0xcba8: keyboardread(context); break; + case 0xcbac: walkandexamine(context); break; + case 0xcbb0: doload(context); break; + case 0xcbb4: generalerror(context); break; + + } +} + +} /*namespace*/ diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h new file mode 100644 index 0000000000..6f20136252 --- /dev/null +++ b/engines/dreamweb/dreamgen.h @@ -0,0 +1,78 @@ +#ifndef TASMRECOVER_DREAMGEN_STUBS_H__ +#define TASMRECOVER_DREAMGEN_STUBS_H__ + +# include "runtime.h" + +namespace dreamgen { + + struct Data : public Segment { + Data(); + }; + + + typedef RegisterContext Context; + + void __dispatch_call(Context &context, unsigned addr); + + void randomnumber(Context &context); + void dreamweb(Context &context); + void resetkeyboard(Context &context); + void removeemm(Context &context); + void soundend(Context &context); + void disablesoundint(Context &context); + void out22c(Context &context); + void getridofpit(Context &context); + void deallocatemem(Context &context); + void vsync(Context &context); + void closefile(Context &context); + void readfromfile(Context &context); + void allocatemem(Context &context); + void openfile(Context &context); + void loadsecondsample(Context &context); + void mousecall(Context &context); + void loadseg(Context &context); + void dontloadseg(Context &context); + void showgroup(Context &context); + void showpcx(Context &context); + void mode640x480(Context &context); + void setmode(Context &context); + void scanfornames(Context &context); + void openfilenocheck(Context &context); + void setsoundoff(Context &context); + void loadsample(Context &context); + void set16colpalette(Context &context); + void gettime(Context &context); + void fadedos(Context &context); + void setmouse(Context &context); + void setupemm(Context &context); + void setkeyboardint(Context &context); + void soundstartup(Context &context); + void checkbasemem(Context &context); + void keyboardread(Context &context); + void openforsave(Context &context); + void createfile(Context &context); + void pitinterupt(Context &context); + void setuppit(Context &context); + void startdmablock(Context &context); + void dmaend(Context &context); + void restoreems(Context &context); + void saveems(Context &context); + void bothchannels(Context &context); + void channel1only(Context &context); + void channel0only(Context &context); + void interupttest(Context &context); + void enablesoundint(Context &context); + void checksoundint(Context &context); + void loadspeech(Context &context); + void saveseg(Context &context); + void loadposition(Context &context); + void saveposition(Context &context); + void error(Context &context); + void generalerror(Context &context); + void dosreturn(Context &context); + void doshake(Context &context); + void readoneblock(Context &context); + +} + +#endif diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp new file mode 100644 index 0000000000..ec3c9992a3 --- /dev/null +++ b/engines/dreamweb/dreamweb.cpp @@ -0,0 +1,131 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/dreamweb.cpp $ + * $Id: dreamweb.cpp 79 2011-06-05 08:26:54Z eriktorbjorn $ + * + */ + +#include "common/config-manager.h" +#include "common/debug-channels.h" +#include "common/events.h" +#include "common/EventRecorder.h" +#include "common/file.h" +#include "common/func.h" +#include "common/iff_container.h" +#include "common/system.h" +#include "common/timer.h" + +#include "engines/util.h" + +#include "audio/mixer.h" + +#include "graphics/palette.h" + +#include "dreamweb/dreamweb.h" + +namespace DreamWeb { + +DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { + // Setup mixer + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); + + _rnd = new Common::RandomSource("dreamweb"); + + _vSyncInterrupt = false; + + _console = 0; + DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); + DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); +} + +DreamWebEngine::~DreamWebEngine() { + DebugMan.clearAllDebugChannels(); + delete _console; + delete _rnd; +} + +// Let's see if it's a good idea to emulate VSYNC interrupts with a timer like +// this. There's a chance we'll miss interrupts, which could be countered by +// counting them instead of just flagging them, but we'll see... + +static void vSyncInterrupt(void *refCon) { + DreamWebEngine *vm = (DreamWebEngine *)refCon; + + if (!vm->isPaused()) { + vm->setVSyncInterrupt(true); + } +} + +void DreamWebEngine::setVSyncInterrupt(bool flag) { + _vSyncInterrupt = flag; +} + +void DreamWebEngine::waitForVSync() { + while (!_vSyncInterrupt) { + _system->delayMillis(10); + } + setVSyncInterrupt(false); + // doshake + // dofade +} + +Common::Error DreamWebEngine::run() { + _console = new DreamWebConsole(this); + + Common::EventManager *event_manager = _system->getEventManager(); + getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this); + + do { + uint32 frame_time = _system->getMillis(); + Common::Event event; + while (event_manager->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_RTL: + return Common::kNoError; + case Common::EVENT_MOUSEMOVE: + _mouse = event.mouse; + break; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_d: + if (event.kbd.flags & Common::KBD_CTRL) { + _console->attach(); + _console->onFrame(); + } + break; + default: + break; + } + break; + default: + debug(0, "skipped event type %d", event.type); + } + } + } while (!shouldQuit()); + + getTimerManager()->removeTimerProc(vSyncInterrupt); + + return Common::kNoError; +} + +} // End of namespace DreamWeb diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h new file mode 100644 index 0000000000..2bff384f18 --- /dev/null +++ b/engines/dreamweb/dreamweb.h @@ -0,0 +1,83 @@ +/* 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. + * + * $URL: https://svn.scummvm.org:4444/svn/dreamweb/dreamweb.h $ + * $Id: dreamweb.h 77 2011-05-18 14:26:43Z digitall $ + * + */ + +#ifndef DREAMWEB_H +#define DREAMWEB_H + +#include "common/scummsys.h" +#include "common/random.h" +#include "common/rect.h" +#include "common/error.h" + +#include "engines/engine.h" +#include "dreamweb/console.h" + +namespace Graphics { + class Surface; +} + +namespace DreamWeb { + +// Engine Debug Flags +enum { + kDebugAnimation = (1 << 0), + kDebugSaveLoad = (1 << 1) +}; + +struct DreamWebGameDescription; + +class DreamWebEngine : public Engine { +private: + DreamWebConsole *_console; + bool _vSyncInterrupt; + +protected: + // Engine APIs + virtual Common::Error run(); + virtual bool hasFeature(EngineFeature f) const; + +public: + DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc); + virtual ~DreamWebEngine(); + + void setVSyncInterrupt(bool flag); + void waitForVSync(); + + Common::Error loadGameState(int slot); + Common::Error saveGameState(int slot, const char *desc); + + bool canLoadGameStateCurrently(); + bool canSaveGameStateCurrently(); + + const DreamWebGameDescription *_gameDescription; + + Common::RandomSource *_rnd; + + Common::Point _mouse; +}; + +} // End of namespace DreamWeb + +#endif diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk new file mode 100644 index 0000000000..d39270bde6 --- /dev/null +++ b/engines/dreamweb/module.mk @@ -0,0 +1,15 @@ +MODULE := engines/dreamweb + +MODULE_OBJS := \ + console.o \ + detection.o \ + dreamweb.o \ + dreamgen.o + +# This module can be built as a plugin +ifeq ($(ENABLE_DREAMWEB), DYNAMIC_PLUGIN) +PLUGIN := 1 +endif + +# Include common rules +include $(srcdir)/rules.mk diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h new file mode 100644 index 0000000000..5824728283 --- /dev/null +++ b/engines/dreamweb/runtime.h @@ -0,0 +1,330 @@ +#ifndef TASM_RECOVER_H__ +#define TASM_RECOVER_H__ + +#include +#include +#include + +typedef uint16_t uint16; +typedef uint8_t uint8; +typedef int16_t int16; +typedef int8_t int8; + +//little endian +#define REG_LOW 0 +#define REG_HIGH 1 + +struct Register { + union { + uint16 _value; + uint8 _part[2]; + }; + inline Register(): _value() {} + inline Register& operator=(uint16_t v) { _value = v; return *this; } + inline operator uint16&() { return _value; } + inline void cbw() { + if (_value & 0x80) + _value |= 0xff00; + else + _value &= 0xff; + } +}; + +template +struct RegisterPart { + uint8_t &_part; + + inline RegisterPart(Register ®) : _part(reg._part[PART]) {} + + inline operator uint8&() { + return _part; + } + inline RegisterPart& operator=(const RegisterPart& o) { + _part = o._part; + return *this; + } + inline RegisterPart& operator=(uint8_t v) { + _part = v; + return *this; + } +}; + +struct WordRef { + std::vector &data; + unsigned index; + bool changed; + uint16_t value; + + inline WordRef(std::vector &data, unsigned index) : data(data), index(index), changed(false) { + assert(index + 1 < data.size()); + value = data[index] | (data[index + 1] << 8); + } + inline WordRef& operator=(const WordRef &ref) { + changed = true; + value = ref.value; + return *this; + } + inline WordRef& operator=(uint16_t v) { + changed = true; + value = v; + return *this; + } + inline operator uint16_t() const { + return value; + } + inline operator uint16_t&() { + return value; + } + inline ~WordRef() { + if (changed) { + data[index] = value & 0xff; + data[index + 1] = value >> 8; + } + } +}; + +struct Segment { + std::vector data; + inline uint8_t &byte(unsigned index) { + assert(index < data.size()); + return data[index]; + } + inline uint16_t word(unsigned index) const { + assert(index + 1 < data.size()); + return data[index] | (data[index + 1] << 8); + } + + inline WordRef word(unsigned index) { + return WordRef(data, index); + } +}; + + +struct SegmentRef { + public: + uint16_t value; + std::vector *data; + inline SegmentRef& operator=(const SegmentRef &o) { + data = o.data; + return *this; + } + inline SegmentRef& operator=(const uint16_t id) { + return *this; + } + inline uint8_t &byte(unsigned index) { + assert(index < data->size()); + return (*data)[index]; + } + inline uint16_t word(unsigned index) const { + assert(index + 1 < data->size()); + return (*data)[index] | ((*data)[index + 1] << 8); + } + + inline operator uint16_t() const { + return value; + } + + inline WordRef word(unsigned index) { + return WordRef(*data, index); + } +}; + +struct Flags { + bool _z, _c, _s, _o; + inline Flags(): _z(true), _c(false), _s(false), _o(false) {} + + inline bool z() const { return _z; } + inline bool c() const { return _c; } + inline bool s() const { return _s; } + //complex flags: + inline bool g() const { return !_z && _s == _o; } + inline bool ge() const { return _z || _s == _o; } + inline bool l() const { return !_z && _s != _o; } + inline bool le() const { return _z || _s != _o; } + + inline void update_sign(uint8 v) { + bool s = v & 0x80; + _o = s != _s; + _s = s; + _z = v == 0; + } + + inline void update(uint16 v) { + bool s = v & 0x8000; + _o = s != _s; + _s = s; + _z = v == 0; + } +}; + +template +struct RegisterContext { + Register ax, dx, bx, cx, si, di; + RegisterPart al; + RegisterPart ah; + RegisterPart bl; + RegisterPart bh; + RegisterPart cl; + RegisterPart ch; + RegisterPart dl; + RegisterPart dh; + + SegmentRef cs, ds, es; + Flags flags; + + inline RegisterContext(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx) {} + + inline void _cmp(uint8 a, uint8 b) { + uint8 x = a; + _sub(x, b); + } + inline void _cmp(uint16 a, uint16 b) { + uint16 x = a; + _sub(x, b); + } + inline void _test(uint8 a, uint8 b) { + uint8 x = a; + _and(x, b); + } + inline void _test(uint16 a, uint16 b) { + uint16 x = a; + _and(x, b); + } + + inline void _add(uint8 &dst, uint8 src) { + flags._c = dst + src < dst; + dst += src; + flags.update(dst); + } + inline void _add(uint16 &dst, uint16 src) { + flags._c = dst + src < dst; + dst += src; + flags.update(dst); + } + inline void _sub(uint8 &dst, uint8 src) { + flags._c = dst < src; + dst -= src; + flags.update(dst); + } + inline void _sub(uint16 &dst, uint16 src) { + flags._c = dst < src; + dst -= src; + flags.update(dst); + } + + inline void _and(uint8 &dst, uint8 src) { + dst &= src; + flags._c = false; + flags.update(dst); + } + inline void _and(uint16 &dst, uint16 src) { + dst &= src; + flags._c = false; + flags.update(dst); + } + inline void _or(uint8 &dst, uint8 src) { + dst |= src; + flags._c = false; + flags.update(dst); + } + inline void _or(uint16 &dst, uint16 src) { + dst |= src; + flags._c = false; + flags.update(dst); + } + + inline void _xor(uint8 &dst, uint8 src) { + dst ^= src; + flags._c = false; + flags.update(dst); + } + inline void _xor(uint16 &dst, uint16 src) { + dst ^= src; + flags._c = false; + flags.update(dst); + } + + inline void _shr(uint8 &dst, uint8 src) {} + inline void _shr(uint16 &dst, uint8 src) {} + inline void _shl(uint8 &dst, uint8 src) {} + inline void _shl(uint16 &dst, uint8 src) {} + inline void _mul(uint8 src) { + unsigned r = unsigned(al) * src; + ax = (uint16)r; + flags._c = r >= 0x10000; + flags._z = r == 0; + bool s = r & 0x8000; + flags._o = s != flags._s; + flags._s = s; + } + inline void _mul(uint16 src) { + unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits + dx = (r >> 16) & 0xffff; + ax = r & 0xffff; + flags._c = false;//fixme + flags._z = r == 0; + bool s = r & 0x80000000; + flags._o = s != flags._s; + flags._s = s; + } + inline void _neg(uint8 &src) { + src = ~src; + flags._c = false; + flags.update(src); + } + inline void _neg(uint16 &src) { + src = ~src; + flags._c = false; + flags.update(src); + } + + inline void _movsb() { + es.byte(di++) = ds.byte(si++); + } + inline void _movsw() { + es.word(di) = ds.word(si); + di += 2; + si += 2; + } + inline void _lodsb() { + al = ds.byte(si++); + } + inline void _lodsw() { + ax = ds.word(si); + si += 2; + } + inline void _stosb() { + es.byte(di++) = al; + } + inline void _stosw() { + es.word(di) = al; + di += 2; + } + + inline void _xchg(uint16 &a, uint16 &b) { + uint16 x = a; + a = b; + b = x; + } + + inline void _xchg(uint8 &a, uint8 &b) { + uint8 t = a; + a = b; + b = t; + } + + std::vector stack; + inline void push(uint16 v) { + stack.push_back(v); + } + inline uint16 pop() { + uint16 v = stack.back(); + stack.pop_back(); + return v; + } + + Data data; +}; + +#endif + diff --git a/engines/engines.mk b/engines/engines.mk index f8ff823c13..dc09fbd54e 100644 --- a/engines/engines.mk +++ b/engines/engines.mk @@ -46,6 +46,11 @@ DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA) MODULES += engines/drascula endif +ifdef ENABLE_DREAMWEB +DEFINES += -DENABLE_DREAMWEB=$(ENABLE_DREAMWEB) +MODULES += engines/dreamweb +endif + ifdef ENABLE_GOB DEFINES += -DENABLE_GOB=$(ENABLE_GOB) MODULES += engines/gob -- cgit v1.2.3 From 51f44779ca432809a21ac867b87d20e85fcc807f Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 5 Jun 2011 14:09:44 +0400 Subject: DREAMWEB: regenerate sources --- engines/dreamweb/dreamgen.cpp | 327 ++++++++++++++++++++++++++++++++++++------ engines/dreamweb/dreamgen.h | 16 +-- 2 files changed, 288 insertions(+), 55 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index ec243cc81a..06aed609af 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2,6 +2,8 @@ namespace dreamgen { +static inline void seecommandtail(Context &context); +static inline void checkbasemem(Context &context); static inline void allocatebuffers(Context &context); static inline void clearbuffers(Context &context); static inline void clearpalette(Context &context); @@ -278,6 +280,7 @@ static inline void runintroseq(Context &context); static inline void trysoundalloc(Context &context); static inline void allocatework(Context &context); static inline void checkforemm(Context &context); +static inline void parseblaster(Context &context); static inline void printcurs(Context &context); static inline void delcurs(Context &context); static inline void commandonly(Context &context); @@ -295,7 +298,6 @@ static inline void checkifset(Context &context); static inline void identifyob(Context &context); static inline void convnum(Context &context); static inline void onedigit(Context &context); -static inline void parseblaster(Context &context); static inline void volumeadjust(Context &context); static inline void loopchannel0(Context &context); static inline void createname(Context &context); @@ -11771,52 +11773,114 @@ doneit: return; } -static inline void seecommandtail(Context & context) { - context.data.word(372) = 0x220; - context.data.byte(378) = 5; - context.data.byte(379) = 1; - context.data.byte(73) = 0; - context.bx = 2; - context.ax = context.data.word(context.bx); - context.dx = context.es; - context._sub(context.ax, context.dx); - context.data.word(534) = context.ax; - context.bx = 0x02c; - context.ax = context.data.word(context.bx); - context.push(context.es); - context.push(context.bx); - context.es = context.ax; - context.bx = 0; -findblaster: - context.ax = context.data.word(context.bx); - context._cmp(context.ax, 0); - if (context.flags.z()) goto endofenvironment; - context._cmp(context.al, 'B'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ah, 'L'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+2), 'A'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+3), 'S'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+4), 'T'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+5), 'E'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+6), 'R'); - if (!context.flags.z()) goto notblast; - context._add(context.bx, 7); - parseblaster(context); - goto endofenvironment; -notblast: - context._add(context.bx, 1); - goto findblaster; -endofenvironment: - context.bx = context.pop(); - context.es = context.pop(); - context.bx = 0x81; - parseblaster(context); - return; +static inline void dreamweb(Context & context) { + seecommandtail(context); + checkbasemem(context); + soundstartup(context); + setkeyboardint(context); + setupemm(context); + allocatebuffers(context); + setmouse(context); + fadedos(context); + gettime(context); + clearbuffers(context); + clearpalette(context); + set16colpalette(context); + readsetdata(context); + context.data.byte(391) = 0; + context.dx = 1922; + loadsample(context); + setsoundoff(context); + scanfornames(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto dodecisions; + setmode(context); + loadpalfromiff(context); + titles(context); + credits(context); + goto playgame; +dodecisions: + cls(context); + setmode(context); + decide(context); + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto mainloop; + titles(context); + credits(context); +playgame: + clearchanges(context); + setmode(context); + loadpalfromiff(context); + context.data.byte(9) = 255; + context.data.byte(67) = 1; + context.data.byte(188) = 35; + context.data.byte(386) = 7; + loadroom(context); + clearsprites(context); + initman(context); + entrytexts(context); + entryanims(context); + context.data.byte(183) = 3; + initialinv(context); + context.data.byte(153) = 32; + startup1(context); + context.data.byte(387) = 0; + context.data.byte(388) = -1; + context.data.byte(100) = 255; + goto mainloop; +loadnew: + clearbeforeload(context); + loadroom(context); + clearsprites(context); + initman(context); + entrytexts(context); + entryanims(context); + context.data.byte(188) = 255; + startup(context); + context.data.byte(100) = 255; + worktoscreenm(context); + goto mainloop; +alreadyloaded: + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + startup(context); + context.data.byte(100) = 255; +mainloop: + screenupdate(context); + context._cmp(context.data.byte(391), 0); + if (!context.flags.z()) goto endofgame; + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto gameover; + context._cmp(context.data.byte(56), 2); + if (context.flags.z()) goto gameover; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatching; + context.al = context.data.byte(477); + context._cmp(context.al, context.data.byte(475)); + if (!context.flags.z()) goto mainloop; + context._sub(context.data.word(21), 1); + if (!context.flags.z()) goto mainloop; +notwatching: + context._cmp(context.data.byte(56), 4); + if (context.flags.z()) goto gameover; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto loadnew; + goto mainloop; +gameover: + clearbeforeload(context); + showgun(context); + fadescreendown(context); + context.cx = 100; + hangon(context); + goto dodecisions; +endofgame: + clearbeforeload(context); + fadescreendowns(context); + context.cx = 200; + hangon(context); + endgame(context); + { quickquit2(context); return; }; } static inline void parseblaster(Context & context) { @@ -12713,6 +12777,64 @@ static inline void getridoftempsp(Context & context) { return; } +static inline void seecommandtail(Context & context) { + context.data.word(372) = 0x220; + context.data.byte(378) = 5; + context.data.byte(379) = 1; + context.data.byte(73) = 0; + context.bx = 2; + context.ax = context.data.word(context.bx); + context.dx = context.es; + context._sub(context.ax, context.dx); + context.data.word(534) = context.ax; + context.bx = 0x02c; + context.ax = context.data.word(context.bx); + context.push(context.es); + context.push(context.bx); + context.es = context.ax; + context.bx = 0; +findblaster: + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0); + if (context.flags.z()) goto endofenvironment; + context._cmp(context.al, 'B'); + if (!context.flags.z()) goto notblast; + context._cmp(context.ah, 'L'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+2), 'A'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+3), 'S'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+4), 'T'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+5), 'E'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+6), 'R'); + if (!context.flags.z()) goto notblast; + context._add(context.bx, 7); + parseblaster(context); + goto endofenvironment; +notblast: + context._add(context.bx, 1); + goto findblaster; +endofenvironment: + context.bx = context.pop(); + context.es = context.pop(); + context.bx = 0x81; + parseblaster(context); + return; +} + +static inline void checkbasemem(Context & context) { + context.bx = context.data.word(534); + context._cmp(context.bx, 0x9360); + if (!context.flags.c()) goto enoughmem; + context.data.byte(532) = 5; + { quickquit(context); return; }; +enoughmem: + return; +} + static inline void checkforemm(Context & context) { return; } @@ -20745,6 +20867,116 @@ static inline void endgame(Context & context) { return; } +static inline void dreamweb(Context & context) { + seecommandtail(context); + checkbasemem(context); + soundstartup(context); + setkeyboardint(context); + setupemm(context); + allocatebuffers(context); + setmouse(context); + fadedos(context); + gettime(context); + clearbuffers(context); + clearpalette(context); + set16colpalette(context); + readsetdata(context); + context.data.byte(391) = 0; + context.dx = 1922; + loadsample(context); + setsoundoff(context); + scanfornames(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto dodecisions; + setmode(context); + loadpalfromiff(context); + titles(context); + credits(context); + goto playgame; +dodecisions: + cls(context); + setmode(context); + decide(context); + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto mainloop; + titles(context); + credits(context); +playgame: + clearchanges(context); + setmode(context); + loadpalfromiff(context); + context.data.byte(9) = 255; + context.data.byte(67) = 1; + context.data.byte(188) = 35; + context.data.byte(386) = 7; + loadroom(context); + clearsprites(context); + initman(context); + entrytexts(context); + entryanims(context); + context.data.byte(183) = 3; + initialinv(context); + context.data.byte(153) = 32; + startup1(context); + context.data.byte(387) = 0; + context.data.byte(388) = -1; + context.data.byte(100) = 255; + goto mainloop; +loadnew: + clearbeforeload(context); + loadroom(context); + clearsprites(context); + initman(context); + entrytexts(context); + entryanims(context); + context.data.byte(188) = 255; + startup(context); + context.data.byte(100) = 255; + worktoscreenm(context); + goto mainloop; +alreadyloaded: + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + startup(context); + context.data.byte(100) = 255; +mainloop: + screenupdate(context); + context._cmp(context.data.byte(391), 0); + if (!context.flags.z()) goto endofgame; + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto gameover; + context._cmp(context.data.byte(56), 2); + if (context.flags.z()) goto gameover; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatching; + context.al = context.data.byte(477); + context._cmp(context.al, context.data.byte(475)); + if (!context.flags.z()) goto mainloop; + context._sub(context.data.word(21), 1); + if (!context.flags.z()) goto mainloop; +notwatching: + context._cmp(context.data.byte(56), 4); + if (context.flags.z()) goto gameover; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto loadnew; + goto mainloop; +gameover: + clearbeforeload(context); + showgun(context); + fadescreendown(context); + context.cx = 100; + hangon(context); + goto dodecisions; +endofgame: + clearbeforeload(context); + fadescreendowns(context); + context.cx = 200; + hangon(context); + endgame(context); + { quickquit2(context); return; }; +} + Data::Data() { static const uint8 src[] = { @@ -21900,6 +22132,7 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc93c: getridofpit(context); break; case 0xc940: pitinterupt(context); break; case 0xc944: dreamweb(context); break; + case 0xc944: dreamweb(context); break; case 0xc948: entrytexts(context); break; case 0xc94c: entryanims(context); break; case 0xc950: initialinv(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 6f20136252..7cad64ee2e 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -15,13 +15,8 @@ namespace dreamgen { void __dispatch_call(Context &context, unsigned addr); void randomnumber(Context &context); - void dreamweb(Context &context); - void resetkeyboard(Context &context); - void removeemm(Context &context); - void soundend(Context &context); - void disablesoundint(Context &context); - void out22c(Context &context); - void getridofpit(Context &context); + void quickquit(Context &context); + void quickquit2(Context &context); void deallocatemem(Context &context); void vsync(Context &context); void closefile(Context &context); @@ -47,11 +42,13 @@ namespace dreamgen { void setupemm(Context &context); void setkeyboardint(Context &context); void soundstartup(Context &context); - void checkbasemem(Context &context); void keyboardread(Context &context); + void resetkeyboard(Context &context); void openforsave(Context &context); void createfile(Context &context); + void removeemm(Context &context); void pitinterupt(Context &context); + void getridofpit(Context &context); void setuppit(Context &context); void startdmablock(Context &context); void dmaend(Context &context); @@ -60,7 +57,10 @@ namespace dreamgen { void bothchannels(Context &context); void channel1only(Context &context); void channel0only(Context &context); + void out22c(Context &context); + void soundend(Context &context); void interupttest(Context &context); + void disablesoundint(Context &context); void enablesoundint(Context &context); void checksoundint(Context &context); void loadspeech(Context &context); -- cgit v1.2.3 From 181428e65e0039179b08986c4026ab6ba54cd01c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 5 Jun 2011 14:49:56 +0400 Subject: DREAMWEB: started integration of stubs --- engines/dreamweb/dreamgen.cpp | 32627 ++++++++++++++++++++-------------------- engines/dreamweb/dreamgen.h | 51 +- engines/dreamweb/dreamweb.cpp | 4 + 3 files changed, 16291 insertions(+), 16391 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 06aed609af..5b075a14fe 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2,487 +2,487 @@ namespace dreamgen { -static inline void seecommandtail(Context &context); -static inline void checkbasemem(Context &context); -static inline void allocatebuffers(Context &context); -static inline void clearbuffers(Context &context); -static inline void clearpalette(Context &context); -static inline void readsetdata(Context &context); -static inline void loadpalfromiff(Context &context); -static inline void titles(Context &context); -static inline void credits(Context &context); -static inline void cls(Context &context); -static inline void decide(Context &context); -static inline void clearchanges(Context &context); -static inline void loadroom(Context &context); -static inline void clearsprites(Context &context); -static inline void initman(Context &context); -static inline void entrytexts(Context &context); -static inline void entryanims(Context &context); -static inline void initialinv(Context &context); -static inline void startup1(Context &context); -static inline void clearbeforeload(Context &context); -static inline void startup(Context &context); -static inline void worktoscreenm(Context &context); -static inline void screenupdate(Context &context); -static inline void showgun(Context &context); -static inline void fadescreendown(Context &context); -static inline void hangon(Context &context); -static inline void fadescreendowns(Context &context); -static inline void endgame(Context &context); -static inline void loadtemptext(Context &context); -static inline void monkspeaking(Context &context); -static inline void gettingshot(Context &context); -static inline void getridoftemptext(Context &context); -static inline void loadintroroom(Context &context); -static inline void fadescreenups(Context &context); -static inline void runendseq(Context &context); -static inline void atmospheres(Context &context); -static inline void spriteupdate(Context &context); -static inline void deleverything(Context &context); -static inline void printsprites(Context &context); -static inline void reelsonscreen(Context &context); -static inline void afterintroroom(Context &context); -static inline void usetimedtext(Context &context); -static inline void dumpmap(Context &context); -static inline void dumptimedtext(Context &context); -static inline void multidump(Context &context); -static inline void getundertimed(Context &context); -static inline void printdirect(Context &context); -static inline void putundertimed(Context &context); -static inline void multiput(Context &context); -static inline void getnumber(Context &context); -static inline void modifychar(Context &context); -static inline void printchar(Context &context); -static inline void showframe(Context &context); -static inline void kernchars(Context &context); -static inline void frameoutfx(Context &context); -static inline void frameoutnm(Context &context); -static inline void frameoutbh(Context &context); -static inline void frameoutv(Context &context); -static inline void getnextword(Context &context); -static inline void multiget(Context &context); -static inline void clearwork(Context &context); -static inline void findroominloc(Context &context); -static inline void drawfloor(Context &context); -static inline void worktoscreen(Context &context); -static inline void width160(Context &context); -static inline void eraseoldobs(Context &context); -static inline void drawflags(Context &context); -static inline void calcmapad(Context &context); -static inline void doblocks(Context &context); -static inline void showallobs(Context &context); -static inline void showallfree(Context &context); -static inline void showallex(Context &context); -static inline void paneltomap(Context &context); -static inline void initrain(Context &context); -static inline void splitintolines(Context &context); -static inline void getblockofpixel(Context &context); -static inline void checkone(Context &context); -static inline void getmapad(Context &context); -static inline void calcfrframe(Context &context); -static inline void finalframe(Context &context); -static inline void getxad(Context &context); -static inline void getyad(Context &context); -static inline void makebackob(Context &context); -static inline void makesprite(Context &context); -static inline void getdimension(Context &context); -static inline void addalong(Context &context); -static inline void addlength(Context &context); -static inline void reconstruct(Context &context); -static inline void updatepeople(Context &context); -static inline void watchreel(Context &context); -static inline void showrain(Context &context); -static inline void randomnum1(Context &context); -static inline void playchannel1(Context &context); -static inline void plotreel(Context &context); -static inline void checkforshake(Context &context); -static inline void autosetwalk(Context &context); -static inline void getroomspaths(Context &context); -static inline void checkdest(Context &context); -static inline void bresenhams(Context &context); -static inline void workoutframes(Context &context); -static inline void getreelstart(Context &context); -static inline void dealwithspecial(Context &context); -static inline void showreelframe(Context &context); -static inline void soundonreels(Context &context); -static inline void playchannel0(Context &context); -static inline void findsource(Context &context); -static inline void placesetobject(Context &context); -static inline void removesetobject(Context &context); -static inline void placefreeobject(Context &context); -static inline void removefreeobject(Context &context); -static inline void switchryanoff(Context &context); -static inline void switchryanon(Context &context); -static inline void movemap(Context &context); -static inline void getfreead(Context &context); -static inline void findormake(Context &context); -static inline void getsetad(Context &context); -static inline void undertextline(Context &context); -static inline void printasprite(Context &context); -static inline void maptopanel(Context &context); -static inline void cancelch0(Context &context); -static inline void clearstartpal(Context &context); -static inline void paltoendpal(Context &context); -static inline void loadroomssample(Context &context); -static inline void loadintotemp(Context &context); -static inline void showmonk(Context &context); -static inline void getridoftemp(Context &context); -static inline void standardload(Context &context); -static inline void readheader(Context &context); -static inline void twodigitnum(Context &context); -static inline void cancelch1(Context &context); -static inline void paltostartpal(Context &context); -static inline void clearendpal(Context &context); -static inline void greyscalesum(Context &context); -static inline void endpaltostart(Context &context); -static inline void createpanel2(Context &context); -static inline void fadescreenup(Context &context); -static inline void rollendcredits2(Context &context); -static inline void rollem(Context &context); -static inline void hangone(Context &context); -static inline void createpanel(Context &context); -static inline void newplace(Context &context); -static inline void mainscreen(Context &context); -static inline void animpointer(Context &context); -static inline void showpointer(Context &context); -static inline void readmouse1(Context &context); -static inline void dumppointer(Context &context); -static inline void dumptextline(Context &context); -static inline void delpointer(Context &context); -static inline void autolook(Context &context); -static inline void watchcount(Context &context); -static inline void zoom(Context &context); -static inline void readmouse2(Context &context); -static inline void dumpzoom(Context &context); -static inline void afternewroom(Context &context); -static inline void readmouse3(Context &context); -static inline void readmouse4(Context &context); -static inline void dumpwatch(Context &context); -static inline void findpathofpoint(Context &context); -static inline void findxyfrompath(Context &context); -static inline void showicon(Context &context); -static inline void getunderzoom(Context &context); -static inline void walkintoroom(Context &context); -static inline void reminders(Context &context); -static inline void isryanholding(Context &context); -static inline void findexobject(Context &context); -static inline void compare(Context &context); -static inline void setuptimeduse(Context &context); -static inline void getanyaddir(Context &context); -static inline void getexad(Context &context); -static inline void showpanel(Context &context); -static inline void showman(Context &context); -static inline void roomname(Context &context); -static inline void panelicons1(Context &context); -static inline void zoomicon(Context &context); -static inline void middlepanel(Context &context); -static inline void showwatch(Context &context); -static inline void showtime(Context &context); -static inline void printmessage(Context &context); -static inline void usecharset1(Context &context); -static inline void putunderzoom(Context &context); -static inline void crosshair(Context &context); -static inline void dolook(Context &context); -static inline void findnextcolon(Context &context); -static inline void printslow(Context &context); -static inline void hangonp(Context &context); -static inline void redrawmainscrn(Context &context); -static inline void readmouse(Context &context); -static inline void printboth(Context &context); -static inline void waitframes(Context &context); -static inline void dumpblink(Context &context); -static inline void showblink(Context &context); -static inline void getflagunderp(Context &context); -static inline void checkcoords(Context &context); -static inline void walkandexamine(Context &context); -static inline void finishedwalking(Context &context); -static inline void examineob(Context &context); -static inline void setwalk(Context &context); -static inline void examineobtext(Context &context); -static inline void blocknametext(Context &context); -static inline void personnametext(Context &context); -static inline void walktotext(Context &context); -static inline void commandwithob(Context &context); -static inline void deltextline(Context &context); -static inline void copyname(Context &context); -static inline void findobname(Context &context); -static inline void facerightway(Context &context); -static inline void showexit(Context &context); -static inline void obicons(Context &context); -static inline void obpicture(Context &context); -static inline void describeob(Context &context); -static inline void makemainscreen(Context &context); -static inline void getobtextstart(Context &context); -static inline void obsthatdothings(Context &context); -static inline void additionaltext(Context &context); -static inline void findpuztext(Context &context); -static inline void getlocation(Context &context); -static inline void setlocation(Context &context); -static inline void lookatcard(Context &context); -static inline void getridofreels(Context &context); -static inline void loadkeypad(Context &context); -static inline void hangonw(Context &context); -static inline void restorereels(Context &context); -static inline void putbackobstuff(Context &context); -static inline void getroomdata(Context &context); -static inline void allocateload(Context &context); -static inline void searchforsame(Context &context); -static inline void getanyad(Context &context); -static inline void selectlocation(Context &context); -static inline void readcitypic(Context &context); -static inline void showcity(Context &context); -static inline void readdesticon(Context &context); -static inline void loadtraveltext(Context &context); -static inline void showarrows(Context &context); -static inline void locationpic(Context &context); -static inline void getridoftemp2(Context &context); -static inline void getridoftemp3(Context &context); -static inline void getdestinfo(Context &context); -static inline void loadintotemp2(Context &context); -static inline void loadintotemp3(Context &context); -static inline void clearreels(Context &context); -static inline void clearrest(Context &context); -static inline void pickupob(Context &context); -static inline void transfertoex(Context &context); -static inline void emergencypurge(Context &context); -static inline void getexpos(Context &context); -static inline void transfermap(Context &context); -static inline void transferinv(Context &context); -static inline void transfertext(Context &context); -static inline void pickupconts(Context &context); -static inline void transfercontoex(Context &context); -static inline void purgeanitem(Context &context); -static inline void deleteexobject(Context &context); -static inline void deleteexframe(Context &context); -static inline void deleteextext(Context &context); -static inline void resetlocation(Context &context); -static inline void checkifpathison(Context &context); -static inline void turnpathon(Context &context); -static inline void turnanypathon(Context &context); -static inline void purgealocation(Context &context); -static inline void startloading(Context &context); -static inline void fillspace(Context &context); -static inline void sortoutmap(Context &context); -static inline void deletetaken(Context &context); -static inline void setallchanges(Context &context); -static inline void autoappear(Context &context); -static inline void dochange(Context &context); -static inline void loadsavebox(Context &context); -static inline void showdecisions(Context &context); -static inline void showopbox(Context &context); -static inline void realcredits(Context &context); -static inline void allpalette(Context &context); -static inline void dumpcurrent(Context &context); -static inline void biblequote(Context &context); -static inline void intro(Context &context); -static inline void runintroseq(Context &context); -static inline void trysoundalloc(Context &context); -static inline void allocatework(Context &context); -static inline void checkforemm(Context &context); -static inline void parseblaster(Context &context); -static inline void printcurs(Context &context); -static inline void delcurs(Context &context); -static inline void commandonly(Context &context); -static inline void talk(Context &context); -static inline void obname(Context &context); -static inline void pixelcheckset(Context &context); -static inline void isitdescribed(Context &context); -static inline void getreelframeax(Context &context); -static inline void blank(Context &context); -static inline void findfirstpath(Context &context); -static inline void checkifex(Context &context); -static inline void checkiffree(Context &context); -static inline void checkifperson(Context &context); -static inline void checkifset(Context &context); -static inline void identifyob(Context &context); -static inline void convnum(Context &context); -static inline void onedigit(Context &context); -static inline void volumeadjust(Context &context); -static inline void loopchannel0(Context &context); -static inline void createname(Context &context); -static inline void doload(Context &context); -static inline void showloadops(Context &context); -static inline void showslots(Context &context); -static inline void shownames(Context &context); -static inline void namestoold(Context &context); -static inline void storeit(Context &context); -static inline void makeheader(Context &context); -static inline void oldtonames(Context &context); -static inline void showsaveops(Context &context); -static inline void readkey(Context &context); -static inline void getnamepos(Context &context); -static inline void selectslot(Context &context); -static inline void restoreall(Context &context); -static inline void checkinput(Context &context); -static inline void showdiscops(Context &context); -static inline void getback1(Context &context); -static inline void getridofall(Context &context); -static inline void showmainops(Context &context); -static inline void dosaveload(Context &context); -static inline void findtext1(Context &context); -static inline void usetempcharset(Context &context); -static inline void showdiary(Context &context); -static inline void showdiarypage(Context &context); -static inline void loadtempcharset(Context &context); -static inline void showdiarykeys(Context &context); -static inline void dumpdiarykeys(Context &context); -static inline void getridoftempcharset(Context &context); -static inline void nextsymbol(Context &context); -static inline void showsymbol(Context &context); -static inline void updatesymboltop(Context &context); -static inline void updatesymbolbot(Context &context); -static inline void dumpsymbol(Context &context); -static inline void turnanypathoff(Context &context); -static inline void folderexit(Context &context); -static inline void showleftpage(Context &context); -static inline void showrightpage(Context &context); -static inline void showfolder(Context &context); -static inline void folderhints(Context &context); -static inline void loadfolder(Context &context); -static inline void loadmenu(Context &context); -static inline void getundermenu(Context &context); -static inline void putundermenu(Context &context); -static inline void showmenu(Context &context); -static inline void dumpmenu(Context &context); -static inline void singlekey(Context &context); -static inline void buttonpress(Context &context); -static inline void showouterpad(Context &context); -static inline void showkeypad(Context &context); -static inline void dumpkeypad(Context &context); -static inline void addtopresslist(Context &context); -static inline void isitright(Context &context); -static inline void checkinside(Context &context); -static inline void showfirstuse(Context &context); -static inline void withwhat(Context &context); -static inline void showpuztext(Context &context); -static inline void issetobonmap(Context &context); -static inline void showseconduse(Context &context); -static inline void removeobfrominv(Context &context); -static inline void turnpathoff(Context &context); -static inline void findinvpos(Context &context); -static inline void useroutine(Context &context); -static inline void printmessage2(Context &context); -static inline void fillryan(Context &context); -static inline void findsetobject(Context &context); -static inline void usetext(Context &context); -static inline void moneypoke(Context &context); -static inline void nextcolon(Context &context); -static inline void entercode(Context &context); -static inline void makeworn(Context &context); -static inline void nothelderror(Context &context); -static inline void triggermessage(Context &context); -static inline void monprint(Context &context); -static inline void showcurrentfile(Context &context); -static inline void printlogo(Context &context); -static inline void printundermon(Context &context); -static inline void randomaccess(Context &context); -static inline void locklighton(Context &context); -static inline void locklightoff(Context &context); -static inline void makecaps(Context &context); -static inline void monmessage(Context &context); -static inline void scrollmonitor(Context &context); -static inline void searchforstring(Context &context); -static inline void getkeyandlogo(Context &context); -static inline void monitorlogo(Context &context); -static inline void parser(Context &context); -static inline void neterror(Context &context); -static inline void processtrigger(Context &context); -static inline void input(Context &context); -static inline void dirfile(Context &context); -static inline void searchforfiles(Context &context); -static inline void dircom(Context &context); -static inline void signon(Context &context); -static inline void read(Context &context); -static inline void showkeys(Context &context); -static inline void delchar(Context &context); -static inline void accesslighton(Context &context); -static inline void accesslightoff(Context &context); -static inline void powerlighton(Context &context); -static inline void powerlightoff(Context &context); -static inline void lookininterface(Context &context); -static inline void loadpersonal(Context &context); -static inline void loadnews(Context &context); -static inline void loadcart(Context &context); -static inline void printoutermon(Context &context); -static inline void initialmoncols(Context &context); -static inline void turnonpower(Context &context); -static inline void fadeupyellows(Context &context); -static inline void fadeupmonfirst(Context &context); -static inline void hangoncurs(Context &context); -static inline void execcommand(Context &context); -static inline void getundercentre(Context &context); -static inline void putundercentre(Context &context); -static inline void convicons(Context &context); -static inline void starttalk(Context &context); -static inline void hangonpq(Context &context); -static inline void redes(Context &context); -static inline void dosometalk(Context &context); -static inline void getpersontext(Context &context); -static inline void getpersframe(Context &context); -static inline void findopenpos(Context &context); -static inline void reexfromopen(Context &context); -static inline void geteitherad(Context &context); -static inline void fillopen(Context &context); -static inline void useopened(Context &context); -static inline void getopenedsize(Context &context); -static inline void errormessage3(Context &context); -static inline void errormessage2(Context &context); -static inline void examicon(Context &context); -static inline void outofopen(Context &context); -static inline void swapwithopen(Context &context); -static inline void isitworn(Context &context); -static inline void wornerror(Context &context); -static inline void errormessage1(Context &context); -static inline void checkobjectsize(Context &context); -static inline void openinv(Context &context); -static inline void openob(Context &context); -static inline void droperror(Context &context); -static inline void cantdrop(Context &context); -static inline void reexfrominv(Context &context); -static inline void intoinv(Context &context); -static inline void outofinv(Context &context); -static inline void swapwithinv(Context &context); -static inline void findallopen(Context &context); -static inline void obtoinv(Context &context); -static inline void findallryan(Context &context); -static inline void showryanpage(Context &context); -static inline void lockmon(Context &context); -static inline void fadecalculation(Context &context); -static inline void dodoor(Context &context); -static inline void liftnoise(Context &context); -static inline void widedoor(Context &context); -static inline void random(Context &context); -static inline void lockeddoorway(Context &context); -static inline void liftsprite(Context &context); -static inline void doorway(Context &context); -static inline void constant(Context &context); -static inline void steady(Context &context); -static inline void adjustleft(Context &context); -static inline void adjustright(Context &context); -static inline void adjustdown(Context &context); -static inline void adjustup(Context &context); -static inline void aboutturn(Context &context); -static inline void checkforexit(Context &context); -static inline void walking(Context &context); -static inline void showgamereel(Context &context); -static inline void checkspeed(Context &context); -static inline void addtopeoplelist(Context &context); -static inline void setuptimedtemp(Context &context); -static inline void madmantext(Context &context); -static inline void madmode(Context &context); -static inline void priesttext(Context &context); -static inline void fadescreenuphalf(Context &context); -static inline void textforend(Context &context); -static inline void fadescreendownhalf(Context &context); -static inline void rollendcredits(Context &context); -static inline void textformonk(Context &context); -static inline void monks2text(Context &context); -static inline void intro2text(Context &context); -static inline void intro3text(Context &context); -static inline void intro1text(Context &context); - -static inline void alleybarksound(Context & context) { +static void seecommandtail(Context &context); +static void checkbasemem(Context &context); +static void allocatebuffers(Context &context); +static void clearbuffers(Context &context); +static void clearpalette(Context &context); +static void readsetdata(Context &context); +static void loadpalfromiff(Context &context); +static void titles(Context &context); +static void credits(Context &context); +static void cls(Context &context); +static void decide(Context &context); +static void clearchanges(Context &context); +static void loadroom(Context &context); +static void clearsprites(Context &context); +static void initman(Context &context); +static void entrytexts(Context &context); +static void entryanims(Context &context); +static void initialinv(Context &context); +static void startup1(Context &context); +static void clearbeforeload(Context &context); +static void startup(Context &context); +static void worktoscreenm(Context &context); +static void screenupdate(Context &context); +static void showgun(Context &context); +static void fadescreendown(Context &context); +static void hangon(Context &context); +static void fadescreendowns(Context &context); +static void endgame(Context &context); +static void standardload(Context &context); +static void getroomspaths(Context &context); +static void readheader(Context &context); +static void allocateload(Context &context); +static void fillspace(Context &context); +static void sortoutmap(Context &context); +static void findroominloc(Context &context); +static void deletetaken(Context &context); +static void setallchanges(Context &context); +static void autoappear(Context &context); +static void getroomdata(Context &context); +static void autosetwalk(Context &context); +static void findxyfrompath(Context &context); +static void twodigitnum(Context &context); +static void startloading(Context &context); +static void loadroomssample(Context &context); +static void switchryanon(Context &context); +static void drawflags(Context &context); +static void getdimension(Context &context); +static void getflagunderp(Context &context); +static void multidump(Context &context); +static void multiput(Context &context); +static void multiget(Context &context); +static void dumpblink(Context &context); +static void showblink(Context &context); +static void showframe(Context &context); +static void printcurs(Context &context); +static void delcurs(Context &context); +static void delpointer(Context &context); +static void readmouse(Context &context); +static void animpointer(Context &context); +static void showpointer(Context &context); +static void dumppointer(Context &context); +static void commandonly(Context &context); +static void worktoscreen(Context &context); +static void showtime(Context &context); +static void showwatch(Context &context); +static void printmessage(Context &context); +static void printdirect(Context &context); +static void usecharset1(Context &context); +static void showpanel(Context &context); +static void showman(Context &context); +static void roomname(Context &context); +static void panelicons1(Context &context); +static void zoomicon(Context &context); +static void middlepanel(Context &context); +static void findobname(Context &context); +static void workoutframes(Context &context); +static void checkdest(Context &context); +static void bresenhams(Context &context); +static void facerightway(Context &context); +static void checkone(Context &context); +static void commandwithob(Context &context); +static void findnextcolon(Context &context); +static void deltextline(Context &context); +static void copyname(Context &context); +static void finishedwalking(Context &context); +static void examineob(Context &context); +static void talk(Context &context); +static void setwalk(Context &context); +static void examineobtext(Context &context); +static void blocknametext(Context &context); +static void personnametext(Context &context); +static void walktotext(Context &context); +static void clearwork(Context &context); +static void drawfloor(Context &context); +static void reelsonscreen(Context &context); +static void spriteupdate(Context &context); +static void printsprites(Context &context); +static void playchannel0(Context &context); +static void cancelch0(Context &context); +static void createpanel(Context &context); +static void findpathofpoint(Context &context); +static void showicon(Context &context); +static void undertextline(Context &context); +static void mainscreen(Context &context); +static void getunderzoom(Context &context); +static void zoom(Context &context); +static void walkintoroom(Context &context); +static void reminders(Context &context); +static void atmospheres(Context &context); +static void findormake(Context &context); +static void obname(Context &context); +static void pixelcheckset(Context &context); +static void isitdescribed(Context &context); +static void getreelstart(Context &context); +static void getreelframeax(Context &context); +static void blank(Context &context); +static void findfirstpath(Context &context); +static void checkifex(Context &context); +static void checkiffree(Context &context); +static void checkifperson(Context &context); +static void checkifset(Context &context); +static void identifyob(Context &context); +static void checkcoords(Context &context); +static void walkandexamine(Context &context); +static void convnum(Context &context); +static void onedigit(Context &context); +static void plotreel(Context &context); +static void checkforshake(Context &context); +static void newplace(Context &context); +static void readmouse1(Context &context); +static void dumptextline(Context &context); +static void autolook(Context &context); +static void watchcount(Context &context); +static void readmouse2(Context &context); +static void dumpzoom(Context &context); +static void deleverything(Context &context); +static void afternewroom(Context &context); +static void readmouse3(Context &context); +static void dumpmap(Context &context); +static void dumptimedtext(Context &context); +static void readmouse4(Context &context); +static void dumpwatch(Context &context); +static void fadescreenup(Context &context); +static void parseblaster(Context &context); +static void clearreels(Context &context); +static void clearrest(Context &context); +static void trysoundalloc(Context &context); +static void allocatework(Context &context); +static void checkforemm(Context &context); +static void getanyad(Context &context); +static void transfertoex(Context &context); +static void pickupob(Context &context); +static void switchryanoff(Context &context); +static void resetlocation(Context &context); +static void removefreeobject(Context &context); +static void checkifpathison(Context &context); +static void turnpathon(Context &context); +static void removesetobject(Context &context); +static void placesetobject(Context &context); +static void turnanypathon(Context &context); +static void setuptimeduse(Context &context); +static void volumeadjust(Context &context); +static void loopchannel0(Context &context); +static void cancelch1(Context &context); +static void createname(Context &context); +static void doload(Context &context); +static void showdecisions(Context &context); +static void showopbox(Context &context); +static void showloadops(Context &context); +static void showslots(Context &context); +static void shownames(Context &context); +static void namestoold(Context &context); +static void getridoftemp(Context &context); +static void initrain(Context &context); +static void createpanel2(Context &context); +static void loadsavebox(Context &context); +static void storeit(Context &context); +static void makeheader(Context &context); +static void oldtonames(Context &context); +static void showsaveops(Context &context); +static void readkey(Context &context); +static void getnamepos(Context &context); +static void selectslot(Context &context); +static void restoreall(Context &context); +static void redrawmainscrn(Context &context); +static void checkinput(Context &context); +static void showdiscops(Context &context); +static void loadintotemp(Context &context); +static void getback1(Context &context); +static void getridofall(Context &context); +static void showmainops(Context &context); +static void dosaveload(Context &context); +static void findtext1(Context &context); +static void usetempcharset(Context &context); +static void playchannel1(Context &context); +static void getlocation(Context &context); +static void setlocation(Context &context); +static void hangonp(Context &context); +static void showdiary(Context &context); +static void showdiarypage(Context &context); +static void getridofreels(Context &context); +static void loadtemptext(Context &context); +static void loadtempcharset(Context &context); +static void showdiarykeys(Context &context); +static void dumpdiarykeys(Context &context); +static void getridoftemptext(Context &context); +static void getridoftempcharset(Context &context); +static void restorereels(Context &context); +static void nextsymbol(Context &context); +static void showsymbol(Context &context); +static void updatesymboltop(Context &context); +static void updatesymbolbot(Context &context); +static void dumpsymbol(Context &context); +static void turnanypathoff(Context &context); +static void folderexit(Context &context); +static void showleftpage(Context &context); +static void showrightpage(Context &context); +static void loadintotemp2(Context &context); +static void loadintotemp3(Context &context); +static void showfolder(Context &context); +static void folderhints(Context &context); +static void loadfolder(Context &context); +static void getridoftemp2(Context &context); +static void getridoftemp3(Context &context); +static void loadmenu(Context &context); +static void getundermenu(Context &context); +static void putundermenu(Context &context); +static void showmenu(Context &context); +static void dumpmenu(Context &context); +static void singlekey(Context &context); +static void buttonpress(Context &context); +static void loadkeypad(Context &context); +static void showouterpad(Context &context); +static void showkeypad(Context &context); +static void dumpkeypad(Context &context); +static void addtopresslist(Context &context); +static void isitright(Context &context); +static void checkinside(Context &context); +static void compare(Context &context); +static void showfirstuse(Context &context); +static void putbackobstuff(Context &context); +static void withwhat(Context &context); +static void showpuztext(Context &context); +static void placefreeobject(Context &context); +static void issetobonmap(Context &context); +static void showseconduse(Context &context); +static void removeobfrominv(Context &context); +static void turnpathoff(Context &context); +static void getundertimed(Context &context); +static void putundertimed(Context &context); +static void getsetad(Context &context); +static void getfreead(Context &context); +static void dochange(Context &context); +static void findpuztext(Context &context); +static void showexit(Context &context); +static void obicons(Context &context); +static void obpicture(Context &context); +static void describeob(Context &context); +static void getanyaddir(Context &context); +static void findinvpos(Context &context); +static void useroutine(Context &context); +static void printmessage2(Context &context); +static void fillryan(Context &context); +static void findsetobject(Context &context); +static void getobtextstart(Context &context); +static void usetext(Context &context); +static void selectlocation(Context &context); +static void hangonw(Context &context); +static void moneypoke(Context &context); +static void nextcolon(Context &context); +static void getexad(Context &context); +static void entercode(Context &context); +static void findexobject(Context &context); +static void makeworn(Context &context); +static void isryanholding(Context &context); +static void nothelderror(Context &context); +static void triggermessage(Context &context); +static void monprint(Context &context); +static void modifychar(Context &context); +static void printchar(Context &context); +static void showcurrentfile(Context &context); +static void printlogo(Context &context); +static void printundermon(Context &context); +static void randomaccess(Context &context); +static void locklighton(Context &context); +static void locklightoff(Context &context); +static void makecaps(Context &context); +static void monmessage(Context &context); +static void scrollmonitor(Context &context); +static void searchforstring(Context &context); +static void getkeyandlogo(Context &context); +static void monitorlogo(Context &context); +static void parser(Context &context); +static void neterror(Context &context); +static void processtrigger(Context &context); +static void input(Context &context); +static void dirfile(Context &context); +static void searchforfiles(Context &context); +static void dircom(Context &context); +static void signon(Context &context); +static void read(Context &context); +static void showkeys(Context &context); +static void delchar(Context &context); +static void randomnum1(Context &context); +static void accesslighton(Context &context); +static void accesslightoff(Context &context); +static void powerlighton(Context &context); +static void powerlightoff(Context &context); +static void lookininterface(Context &context); +static void loadpersonal(Context &context); +static void loadnews(Context &context); +static void loadcart(Context &context); +static void printoutermon(Context &context); +static void initialmoncols(Context &context); +static void turnonpower(Context &context); +static void fadeupyellows(Context &context); +static void fadeupmonfirst(Context &context); +static void hangoncurs(Context &context); +static void execcommand(Context &context); +static void purgealocation(Context &context); +static void getdestinfo(Context &context); +static void showarrows(Context &context); +static void locationpic(Context &context); +static void getundercentre(Context &context); +static void putundercentre(Context &context); +static void readcitypic(Context &context); +static void showcity(Context &context); +static void readdesticon(Context &context); +static void loadtraveltext(Context &context); +static void convicons(Context &context); +static void starttalk(Context &context); +static void hangonpq(Context &context); +static void redes(Context &context); +static void dosometalk(Context &context); +static void getpersontext(Context &context); +static void getpersframe(Context &context); +static void findsource(Context &context); +static void printslow(Context &context); +static void dolook(Context &context); +static void getxad(Context &context); +static void getyad(Context &context); +static void getmapad(Context &context); +static void calcfrframe(Context &context); +static void finalframe(Context &context); +static void makesprite(Context &context); +static void makebackob(Context &context); +static void addalong(Context &context); +static void addlength(Context &context); +static void eraseoldobs(Context &context); +static void calcmapad(Context &context); +static void doblocks(Context &context); +static void showallobs(Context &context); +static void showallfree(Context &context); +static void showallex(Context &context); +static void paneltomap(Context &context); +static void deleteexframe(Context &context); +static void deleteextext(Context &context); +static void deleteexobject(Context &context); +static void purgeanitem(Context &context); +static void getexpos(Context &context); +static void transfermap(Context &context); +static void transferinv(Context &context); +static void transfertext(Context &context); +static void transfercontoex(Context &context); +static void emergencypurge(Context &context); +static void pickupconts(Context &context); +static void findopenpos(Context &context); +static void reexfromopen(Context &context); +static void geteitherad(Context &context); +static void fillopen(Context &context); +static void useopened(Context &context); +static void getopenedsize(Context &context); +static void errormessage3(Context &context); +static void errormessage2(Context &context); +static void examicon(Context &context); +static void outofopen(Context &context); +static void swapwithopen(Context &context); +static void isitworn(Context &context); +static void wornerror(Context &context); +static void errormessage1(Context &context); +static void checkobjectsize(Context &context); +static void openinv(Context &context); +static void openob(Context &context); +static void droperror(Context &context); +static void cantdrop(Context &context); +static void reexfrominv(Context &context); +static void intoinv(Context &context); +static void outofinv(Context &context); +static void swapwithinv(Context &context); +static void makemainscreen(Context &context); +static void searchforsame(Context &context); +static void lookatcard(Context &context); +static void obsthatdothings(Context &context); +static void additionaltext(Context &context); +static void findallopen(Context &context); +static void obtoinv(Context &context); +static void findallryan(Context &context); +static void showryanpage(Context &context); +static void kernchars(Context &context); +static void getnextword(Context &context); +static void getnumber(Context &context); +static void lockmon(Context &context); +static void printboth(Context &context); +static void waitframes(Context &context); +static void hangone(Context &context); +static void allpalette(Context &context); +static void fadescreenups(Context &context); +static void afterintroroom(Context &context); +static void usetimedtext(Context &context); +static void loadintroroom(Context &context); +static void runintroseq(Context &context); +static void realcredits(Context &context); +static void runendseq(Context &context); +static void showmonk(Context &context); +static void monkspeaking(Context &context); +static void gettingshot(Context &context); +static void biblequote(Context &context); +static void intro(Context &context); +static void paltostartpal(Context &context); +static void paltoendpal(Context &context); +static void dumpcurrent(Context &context); +static void rollem(Context &context); +static void greyscalesum(Context &context); +static void endpaltostart(Context &context); +static void clearendpal(Context &context); +static void rollendcredits2(Context &context); +static void clearstartpal(Context &context); +static void fadecalculation(Context &context); +static void frameoutfx(Context &context); +static void frameoutnm(Context &context); +static void frameoutbh(Context &context); +static void frameoutv(Context &context); +static void putunderzoom(Context &context); +static void crosshair(Context &context); +static void width160(Context &context); +static void maptopanel(Context &context); +static void movemap(Context &context); +static void dealwithspecial(Context &context); +static void showreelframe(Context &context); +static void soundonreels(Context &context); +static void reconstruct(Context &context); +static void updatepeople(Context &context); +static void watchreel(Context &context); +static void showrain(Context &context); +static void dodoor(Context &context); +static void liftnoise(Context &context); +static void widedoor(Context &context); +static void random(Context &context); +static void lockeddoorway(Context &context); +static void liftsprite(Context &context); +static void doorway(Context &context); +static void constant(Context &context); +static void steady(Context &context); +static void getblockofpixel(Context &context); +static void splitintolines(Context &context); +static void adjustleft(Context &context); +static void adjustright(Context &context); +static void adjustdown(Context &context); +static void adjustup(Context &context); +static void aboutturn(Context &context); +static void checkforexit(Context &context); +static void walking(Context &context); +static void printasprite(Context &context); +static void showgamereel(Context &context); +static void checkspeed(Context &context); +static void addtopeoplelist(Context &context); +static void setuptimedtemp(Context &context); +static void madmantext(Context &context); +static void madmode(Context &context); +static void priesttext(Context &context); +static void fadescreenuphalf(Context &context); +static void textforend(Context &context); +static void fadescreendownhalf(Context &context); +static void rollendcredits(Context &context); +static void textformonk(Context &context); +static void monks2text(Context &context); +static void intro2text(Context &context); +static void intro3text(Context &context); +static void intro1text(Context &context); + +static void alleybarksound(Context & context) { context.ax = context.data.word(context.bx+3); context._sub(context.ax, 1); context._cmp(context.ax, 0); @@ -499,11 +499,11 @@ nobark: return; } -static inline void intromusic(Context & context) { +static void intromusic(Context & context) { return; } -static inline void foghornsound(Context & context) { +static void foghornsound(Context & context) { randomnumber(context); context._cmp(context.al, 198); if (!context.flags.z()) goto nofog; @@ -513,7 +513,7 @@ nofog: return; } -static inline void receptionist(Context & context) { +static void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; context._cmp(context.data.byte(52), 1); @@ -555,7 +555,7 @@ nottalkedrecep: return; } -static inline void smokebloke(Context & context) { +static void smokebloke(Context & context) { context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notspokento; context.al = context.data.byte(context.bx+7); @@ -590,7 +590,7 @@ gotsmokeb: return; } -static inline void attendant(Context & context) { +static void attendant(Context & context) { showgamereel(context); addtopeoplelist(context); context.al = context.data.byte(context.bx+7); @@ -601,7 +601,7 @@ nottalked: return; } -static inline void manasleep(Context & context) { +static void manasleep(Context & context) { context.al = context.data.byte(context.bx+7); context._and(context.al, 127); context.data.byte(context.bx+7) = context.al; @@ -610,7 +610,7 @@ static inline void manasleep(Context & context) { return; } -static inline void eden(Context & context) { +static void eden(Context & context) { context._cmp(context.data.byte(42), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); @@ -619,7 +619,7 @@ notinbed: return; } -static inline void edeninbath(Context & context) { +static void edeninbath(Context & context) { context._cmp(context.data.byte(42), 0); if (context.flags.z()) goto notinbed; context._cmp(context.data.byte(43), 0); @@ -634,19 +634,19 @@ notinbed: return; } -static inline void malefan(Context & context) { +static void malefan(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void femalefan(Context & context) { +static void femalefan(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void louis(Context & context) { +static void louis(Context & context) { context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); @@ -655,7 +655,7 @@ notlouis1: return; } -static inline void louischair(Context & context) { +static void louischair(Context & context) { context._cmp(context.data.byte(41), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); @@ -683,7 +683,7 @@ notlouis2: return; } -static inline void manasleep2(Context & context) { +static void manasleep2(Context & context) { context.al = context.data.byte(context.bx+7); context._and(context.al, 127); context.data.byte(context.bx+7) = context.al; @@ -692,19 +692,19 @@ static inline void manasleep2(Context & context) { return; } -static inline void mansatstill(Context & context) { +static void mansatstill(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void tattooman(Context & context) { +static void tattooman(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void drinker(Context & context) { +static void drinker(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotdrinker; context._add(context.data.word(context.bx+3), 1); @@ -725,7 +725,7 @@ gotdrinker: return; } -static inline void bartender(Context & context) { +static void bartender(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotsmoket; context._cmp(context.data.word(context.bx+3), 86); @@ -752,19 +752,19 @@ notgotgun: return; } -static inline void othersmoker(Context & context) { +static void othersmoker(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void barwoman(Context & context) { +static void barwoman(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void interviewer(Context & context) { +static void interviewer(Context & context) { context._cmp(context.data.word(23), 68); if (!context.flags.z()) goto notgeneralstart; context._add(context.data.word(context.bx+3), 1); @@ -781,7 +781,7 @@ talking: return; } -static inline void soldier1(Context & context) { +static void soldier1(Context & context) { context._cmp(context.data.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; context.data.word(21) = 10; @@ -814,7 +814,7 @@ gotsoldframe: return; } -static inline void rockstar(Context & context) { +static void rockstar(Context & context) { context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; @@ -865,7 +865,7 @@ rockcombatend: return; } -static inline void helicopter(Context & context) { +static void helicopter(Context & context) { context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; @@ -922,7 +922,7 @@ heliwon: return; } -static inline void mugger(Context & context) { +static void mugger(Context & context) { context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; @@ -995,13 +995,13 @@ endmugger2: return; } -static inline void aide(Context & context) { +static void aide(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static inline void businessman(Context & context) { +static void businessman(Context & context) { context.data.byte(234) = 0; context.data.word(21) = 2; context.ax = context.data.word(context.bx+3); @@ -1090,7 +1090,7 @@ buscombatwonend: return; } -static inline void poolguard(Context & context) { +static void poolguard(Context & context) { context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; @@ -1174,7 +1174,7 @@ doneover2: return; } -static inline void security(Context & context) { +static void security(Context & context) { context._cmp(context.data.word(context.bx+3), 32); if (context.flags.z()) goto securwait; context._cmp(context.data.word(context.bx+3), 69); @@ -1202,7 +1202,7 @@ gotsecurframe: return; } -static inline void heavy(Context & context) { +static void heavy(Context & context) { context.al = context.data.byte(context.bx+7); context._and(context.al, 127); context.data.byte(context.bx+7) = context.al; @@ -1237,7 +1237,7 @@ gotheavyframe: return; } -static inline void bossman(Context & context) { +static void bossman(Context & context) { checkspeed(context); if (!context.flags.z()) goto notboss; context.ax = context.data.word(context.bx+3); @@ -1280,7 +1280,7 @@ nottalkedboss: return; } -static inline void gamer(Context & context) { +static void gamer(Context & context) { checkspeed(context); if (!context.flags.z()) goto gamerfin; gameragain: @@ -1299,7 +1299,7 @@ gamerfin: return; } -static inline void sparkydrip(Context & context) { +static void sparkydrip(Context & context) { checkspeed(context); if (!context.flags.z()) goto cantdrip; context.al = 14; @@ -1309,7 +1309,7 @@ cantdrip: return; } -static inline void carparkdrip(Context & context) { +static void carparkdrip(Context & context) { checkspeed(context); if (!context.flags.z()) goto cantdrip2; context.al = 14; @@ -1318,7 +1318,7 @@ cantdrip2: return; } -static inline void keeper(Context & context) { +static void keeper(Context & context) { context._cmp(context.data.byte(54), 0); if (!context.flags.z()) goto notwaiting; context._cmp(context.data.word(23), 190); @@ -1339,7 +1339,7 @@ waiting: return; } -static inline void candles1(Context & context) { +static void candles1(Context & context) { checkspeed(context); if (!context.flags.z()) goto candle1; context.ax = context.data.word(context.bx+3); @@ -1354,7 +1354,7 @@ candle1: return; } -static inline void smallcandle(Context & context) { +static void smallcandle(Context & context) { checkspeed(context); if (!context.flags.z()) goto smallcandlef; context.ax = context.data.word(context.bx+3); @@ -1369,7 +1369,7 @@ smallcandlef: return; } -static inline void intromagic1(Context & context) { +static void intromagic1(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm1fin; context.ax = context.data.word(context.bx+3); @@ -1396,7 +1396,7 @@ introm1fin: return; } -static inline void candles(Context & context) { +static void candles(Context & context) { checkspeed(context); if (!context.flags.z()) goto candlesfin; context.ax = context.data.word(context.bx+3); @@ -1411,7 +1411,7 @@ candlesfin: return; } -static inline void candles2(Context & context) { +static void candles2(Context & context) { checkspeed(context); if (!context.flags.z()) goto candles2fin; context.ax = context.data.word(context.bx+3); @@ -1426,7 +1426,7 @@ candles2fin: return; } -static inline void gates(Context & context) { +static void gates(Context & context) { checkspeed(context); if (!context.flags.z()) goto gatesfin; context.ax = context.data.word(context.bx+3); @@ -1462,7 +1462,7 @@ gatesfin: return; } -static inline void intromagic2(Context & context) { +static void intromagic2(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm2fin; context.ax = context.data.word(context.bx+3); @@ -1477,7 +1477,7 @@ introm2fin: return; } -static inline void intromagic3(Context & context) { +static void intromagic3(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm3fin; context.ax = context.data.word(context.bx+3); @@ -1494,7 +1494,7 @@ introm3fin: return; } -static inline void intromonks1(Context & context) { +static void intromonks1(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk1fin; context.ax = context.data.word(context.bx+3); @@ -1538,7 +1538,7 @@ intromonk1fin: return; } -static inline void intromonks2(Context & context) { +static void intromonks2(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk2fin; context.ax = context.data.word(context.bx+3); @@ -1590,11 +1590,11 @@ intromonk2fin: return; } -static inline void handclap(Context & context) { +static void handclap(Context & context) { return; } -static inline void monks2text(Context & context) { +static void monks2text(Context & context) { context._cmp(context.data.byte(139), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; @@ -1694,7 +1694,7 @@ gotmonks2text: return; } -static inline void intro1text(Context & context) { +static void intro1text(Context & context) { context._cmp(context.data.byte(139), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; @@ -1728,7 +1728,7 @@ oktalk2: return; } -static inline void intro2text(Context & context) { +static void intro2text(Context & context) { context._cmp(context.ax, 5); if (!context.flags.z()) goto notintro2text1; context.al = 43; @@ -1753,7 +1753,7 @@ gotintro2text: return; } -static inline void intro3text(Context & context) { +static void intro3text(Context & context) { context._cmp(context.ax, 107); if (!context.flags.z()) goto notintro3text1; context.al = 45; @@ -1778,7 +1778,7 @@ gotintro3text: return; } -static inline void monkandryan(Context & context) { +static void monkandryan(Context & context) { checkspeed(context); if (!context.flags.z()) goto notmonkryan; context.ax = context.data.word(context.bx+3); @@ -1803,7 +1803,7 @@ notmonkryan: return; } -static inline void endgameseq(Context & context) { +static void endgameseq(Context & context) { checkspeed(context); if (!context.flags.z()) goto notendseq; context.ax = context.data.word(context.bx+3); @@ -1860,7 +1860,7 @@ notendcreds: return; } -static inline void rollendcredits(Context & context) { +static void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); @@ -1948,7 +1948,7 @@ gotnext: return; } -static inline void priest(Context & context) { +static void priest(Context & context) { context._cmp(context.data.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; context.data.byte(234) = 0; @@ -1967,7 +1967,7 @@ priestspoken: return; } -static inline void madmanstelly(Context & context) { +static void madmanstelly(Context & context) { context.ax = context.data.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 307); @@ -1979,7 +1979,7 @@ notendtelly: return; } -static inline void madman(Context & context) { +static void madman(Context & context) { context.data.word(21) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; @@ -2049,7 +2049,7 @@ ryansded: return; } -static inline void madmantext(Context & context) { +static void madmantext(Context & context) { context._cmp(context.data.byte(64), 61); if (!context.flags.c()) goto nomadtext; context.al = context.data.byte(64); @@ -2069,7 +2069,7 @@ nomadtext: return; } -static inline void madmode(Context & context) { +static void madmode(Context & context) { context.data.word(21) = 2; context.data.byte(234) = 0; context._cmp(context.data.byte(64), 63); @@ -2081,7 +2081,7 @@ iswatchmad: return; } -static inline void priesttext(Context & context) { +static void priesttext(Context & context) { context._cmp(context.data.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; context._cmp(context.data.word(context.bx+3), 7); @@ -2101,7 +2101,7 @@ nopriesttext: return; } -static inline void textforend(Context & context) { +static void textforend(Context & context) { context._cmp(context.data.byte(139), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; @@ -2134,7 +2134,7 @@ gotendtext: return; } -static inline void textformonk(Context & context) { +static void textformonk(Context & context) { context._cmp(context.data.byte(139), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; @@ -2252,7 +2252,7 @@ oktalk: return; } -static inline void drunk(Context & context) { +static void drunk(Context & context) { context._cmp(context.data.byte(42), 0); if (!context.flags.z()) goto trampgone; context.al = context.data.byte(context.bx+7); @@ -2264,7 +2264,7 @@ trampgone: return; } -static inline void advisor(Context & context) { +static void advisor(Context & context) { checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; @@ -2292,7 +2292,7 @@ noadvisor: return; } -static inline void copper(Context & context) { +static void copper(Context & context) { checkspeed(context); if (!context.flags.z()) goto nocopper; context.ax = context.data.word(context.bx+3); @@ -2322,7 +2322,7 @@ nocopper: return; } -static inline void sparky(Context & context) { +static void sparky(Context & context) { context._cmp(context.data.word(16), 0); if (context.flags.z()) goto animsparky; context.data.byte(context.bx+7) = 3; @@ -2355,7 +2355,7 @@ nottalkedsparky: return; } -static inline void train(Context & context) { +static void train(Context & context) { return; context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 21); @@ -2378,7 +2378,7 @@ notrainatall: return; } -static inline void addtopeoplelist(Context & context) { +static void addtopeoplelist(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.bx); @@ -2396,7 +2396,7 @@ static inline void addtopeoplelist(Context & context) { return; } -static inline void showgamereel(Context & context) { +static void showgamereel(Context & context) { context.ax = context.data.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; @@ -2412,7 +2412,7 @@ noshow: return; } -static inline void checkspeed(Context & context) { +static void checkspeed(Context & context) { context._cmp(context.data.byte(65), -1); if (!context.flags.z()) goto forcenext; context._add(context.data.byte(context.bx+6), 1); @@ -2429,7 +2429,35 @@ forcenext: return; } -static inline void delsprite(Context & context) { +static void clearsprites(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.al = 255; + context.cx = 32*16; + while(--context.cx) context._stosb(); + return; +} + +static void makesprite(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; +_tmp17: + context._cmp(context.data.byte(context.bx+15), 255); + if (context.flags.z()) goto _tmp17a; + context._add(context.bx, 32); + goto _tmp17; +_tmp17a: + context.data.word(context.bx) = context.cx; + context.data.word(context.bx+10) = context.si; + context.data.word(context.bx+6) = context.dx; + context.data.word(context.bx+8) = context.di; + context.data.word(context.bx+2) = 0x0ffff; + context.data.byte(context.bx+15) = 0; + context.data.byte(context.bx+18) = 0; + return; +} + +static void delsprite(Context & context) { context.di = context.bx; context.cx = 32; context.al = 255; @@ -2437,7 +2465,175 @@ static inline void delsprite(Context & context) { return; } -static inline void mainman(Context & context) { +static void spriteupdate(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.al = context.data.byte(63); + context.data.byte(context.bx+31) = context.al; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +_tmp18: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto _tmp18a; + context.push(context.es); + context.push(context.ds); + context.cx = context.data.word(context.bx+2); + context.data.word(context.bx+24) = context.cx; + __dispatch_call(context, context.ax); + context.ds = context.pop(); + context.es = context.pop(); +_tmp18a: + context.bx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(186), 1); + if (context.flags.z()) goto _tmp18b; + context._add(context.bx, 32); + if (--context.cx) goto _tmp18; +_tmp18b: + return; +} + +static void printsprites(Context & context) { + context.es = context.data.word(412); + context.cx = 0; +priorityloop: + context.push(context.cx); + context.data.byte(182) = context.cl; + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +prtspriteloop: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto skipsprite; + context.al = context.data.byte(182); + context._cmp(context.al, context.data.byte(context.bx+23)); + if (!context.flags.z()) goto skipsprite; + context._cmp(context.data.byte(context.bx+31), 1); + if (context.flags.z()) goto skipsprite; + printasprite(context); +skipsprite: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 32); + if (--context.cx) goto prtspriteloop; + context.cx = context.pop(); + context._add(context.cx, 1); + context._cmp(context.cx, 7); + if (!context.flags.z()) goto priorityloop; + return; +} + +static void printasprite(Context & context) { + context.push(context.es); + context.push(context.bx); + context.si = context.bx; + context.ds = context.data.word(context.si+6); + context.al = context.data.byte(context.si+11); + context.ah = 0; + context._cmp(context.al, 220); + if (context.flags.c()) goto notnegative1; + context.ah = 255; +notnegative1: + context.bx = context.ax; + context._add(context.bx, context.data.word(119)); + context.al = context.data.byte(context.si+10); + context.ah = 0; + context._cmp(context.al, 220); + if (context.flags.c()) goto notnegative2; + context.ah = 255; +notnegative2: + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context.al = context.data.byte(context.si+15); + context.ah = 0; + context._cmp(context.data.byte(context.si+30), 0); + if (context.flags.z()) goto steadyframe; + context.ah = 8; +steadyframe: + context._cmp(context.data.byte(182), 6); + if (!context.flags.z()) goto notquickp; +notquickp: + showframe(context); + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static void checkone(Context & context) { + context.push(context.cx); + context.al = context.ch; + context.ah = 0; + context.cl = 4; + context._shr(context.ax, context.cl); + context.dl = context.al; + context.cx = context.pop(); + context.al = context.cl; + context.ah = 0; + context.cl = 4; + context._shr(context.ax, context.cl); + context.ah = context.dl; + context.push(context.ax); + context.ch = 0; + context.cl = context.al; + context.push(context.cx); + context.al = context.ah; + context.ah = 0; + context.cx = 11; + context._mul(context.cx); + context.cx = context.pop(); + context._add(context.ax, context.cx); + context.cx = 3; + context._mul(context.cx); + context.si = context.ax; + context.ds = context.data.word(412); + context._add(context.si, 0+(228*13)+32+60+(32*32)); + context._lodsw(); + context.cx = context.ax; + context._lodsb(); + context.dx = context.pop(); + return; +} + +static void findsource(Context & context) { + context.ax = context.data.word(160); + context._cmp(context.ax, 160); + if (!context.flags.c()) goto over1000; + context.ds = context.data.word(430); + context.data.word(244) = 0; + return; +over1000: + context._cmp(context.ax, 320); + if (!context.flags.c()) goto over1001; + context.ds = context.data.word(432); + context.data.word(244) = 160; + return; +over1001: + context.ds = context.data.word(434); + context.data.word(244) = 320; + return; +} + +static void initman(Context & context) { + context.al = context.data.byte(151); + context.ah = context.data.byte(152); + context.si = context.ax; + context.cx = 49464; + context.dx = context.data.word(414); + context.di = 0; + makesprite(context); + context.data.byte(context.bx+23) = 4; + context.data.byte(context.bx+22) = 0; + context.data.byte(context.bx+29) = 0; + return; +} + +static void mainman(Context & context) { context._cmp(context.data.byte(187), 1); if (!context.flags.z()) goto notinnewroom; context.data.byte(187) = 0; @@ -2520,7 +2716,7 @@ notwalk: return; } -static inline void aboutturn(Context & context) { +static void aboutturn(Context & context) { context._cmp(context.data.byte(136), 1); if (context.flags.z()) goto incdir; context._cmp(context.data.byte(136), -1); @@ -2554,7 +2750,7 @@ decdir: return; } -static inline void walking(Context & context) { +static void walking(Context & context) { context._cmp(context.data.byte(493), 0); if (context.flags.z()) goto normalwalk; context.al = context.data.byte(492); @@ -2603,7 +2799,25 @@ finishedwalk: return; } -static inline void checkforexit(Context & context) { +static void facerightway(Context & context) { + context.push(context.es); + context.push(context.bx); + getroomspaths(context); + context.al = context.data.byte(475); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx+7); + context.data.byte(135) = context.al; + context.data.byte(134) = context.al; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static void checkforexit(Context & context) { context.cl = context.data.byte(151); context._add(context.cl, 12); context.ch = context.data.byte(152); @@ -2695,7 +2909,7 @@ notanup: return; } -static inline void adjustdown(Context & context) { +static void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); context._add(context.data.byte(149), 10); @@ -2709,7 +2923,7 @@ static inline void adjustdown(Context & context) { return; } -static inline void adjustup(Context & context) { +static void adjustup(Context & context) { context.push(context.es); context.push(context.bx); context._sub(context.data.byte(149), 10); @@ -2723,7 +2937,7 @@ static inline void adjustup(Context & context) { return; } -static inline void adjustleft(Context & context) { +static void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); context.data.byte(153) = 0; @@ -2738,7 +2952,7 @@ static inline void adjustleft(Context & context) { return; } -static inline void adjustright(Context & context) { +static void adjustright(Context & context) { context.push(context.es); context.push(context.bx); context._add(context.data.byte(148), 11); @@ -2753,176 +2967,432 @@ static inline void adjustright(Context & context) { return; } -static inline void backobject(Context & context) { - context.ds = context.data.word(428); - context.di = context.data.word(context.bx+20); - context.al = context.data.byte(context.bx+18); - context._cmp(context.al, 0); - if (context.flags.z()) goto _tmp48z; - context._sub(context.al, 1); - context.data.byte(context.bx+18) = context.al; - goto finishback; -_tmp48z: - context.al = context.data.byte(context.di+7); - context.data.byte(context.bx+18) = context.al; - context.al = context.data.byte(context.di+8); - context._cmp(context.al, 6); - if (!context.flags.z()) goto notwidedoor; - widedoor(context); - goto finishback; -notwidedoor: - context._cmp(context.al, 5); - if (!context.flags.z()) goto notrandom; - random(context); - goto finishback; -notrandom: +static void reminders(Context & context) { + context._cmp(context.data.byte(184), 24); + if (!context.flags.z()) goto notinedenslift; + context._cmp(context.data.byte(148), 44); + if (!context.flags.z()) goto notinedenslift; + context._cmp(context.data.byte(2), 0); + if (!context.flags.z()) goto notfirst; + context.al = 'D'; + context.ah = 'K'; + context.cl = 'E'; + context.ch = 'Y'; + isryanholding(context); + if (context.flags.z()) goto forgotone; + context.al = 'C'; + context.ah = 'S'; + context.cl = 'H'; + context.ch = 'R'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto forgotone; + context.ax = context.data.word(context.bx+2); context._cmp(context.al, 4); - if (!context.flags.z()) goto notlockdoor; - lockeddoorway(context); - goto finishback; -notlockdoor: - context._cmp(context.al, 3); - if (!context.flags.z()) goto notlift; - liftsprite(context); - goto finishback; -notlift: - context._cmp(context.al, 2); - if (!context.flags.z()) goto notdoor; - doorway(context); - goto finishback; -notdoor: - context._cmp(context.al, 1); - if (!context.flags.z()) goto steadyob; - constant(context); - goto finishback; -steadyob: - steady(context); -finishback: - return; -} - -static inline void liftsprite(Context & context) { - context.al = context.data.byte(35); - context._cmp(context.al, 0); - if (context.flags.z()) goto liftclosed; - context._cmp(context.al, 1); - if (context.flags.z()) goto liftopen; - context._cmp(context.al, 3); - if (context.flags.z()) goto openlift; - context.al = context.data.byte(context.bx+19); - context._cmp(context.al, 0); - if (context.flags.z()) goto finishclose; - context._sub(context.al, 1); - context._cmp(context.al, 11); - if (!context.flags.z()) goto pokelift; - context.push(context.ax); - context.al = 3; - liftnoise(context); - context.ax = context.pop(); - goto pokelift; -finishclose: - context.data.byte(35) = 0; + if (!context.flags.z()) goto forgotone; + context._cmp(context.ah, 255); + if (context.flags.z()) goto havegotcard; + context.cl = 'P'; + context.ch = 'U'; + context.dl = 'R'; + context.dh = 'S'; + context._xchg(context.al, context.ah); + compare(context); + if (!context.flags.z()) goto forgotone; +havegotcard: + context._add(context.data.byte(2), 1); +notfirst: return; -openlift: - context.al = context.data.byte(context.bx+19); - context._cmp(context.al, 12); - if (context.flags.z()) goto endoflist; - context._add(context.al, 1); - context._cmp(context.al, 1); - if (!context.flags.z()) goto pokelift; - context.push(context.ax); - context.al = 2; - liftnoise(context); - context.ax = context.pop(); -pokelift: - context.data.byte(context.bx+19) = context.al; - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context.al = context.data.byte(context.di+18); - context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; +forgotone: + context.al = 50; + context.bl = 54; + context.bh = 70; + context.cx = 48; + context.dx = 8; + setuptimeduse(context); return; -endoflist: - context.data.byte(35) = 1; +notinedenslift: return; -liftopen: - context.al = context.data.byte(36); - context.push(context.es); - context.push(context.bx); - turnpathon(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(40), 0); - if (context.flags.z()) goto nocountclose; - context._sub(context.data.byte(40), 1); - context._cmp(context.data.byte(40), 0); - if (!context.flags.z()) goto nocountclose; - context.data.byte(35) = 2; -nocountclose: - context.al = 12; - goto pokelift; -liftclosed: - context.al = context.data.byte(36); - context.push(context.es); - context.push(context.bx); - turnpathoff(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(39), 0); - if (context.flags.z()) goto nocountopen; - context._sub(context.data.byte(39), 1); - context._cmp(context.data.byte(39), 0); - if (!context.flags.z()) goto nocountopen; - context.data.byte(35) = 3; -nocountopen: - context.al = 0; - goto pokelift; } -static inline void liftnoise(Context & context) { - context._cmp(context.data.byte(184), 5); - if (context.flags.z()) goto hissnoise; - context._cmp(context.data.byte(184), 21); - if (context.flags.z()) goto hissnoise; - playchannel1(context); +static void initrain(Context & context) { + context.es = context.data.word(412); + context.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); + context.bx = 1113; +checkmorerain: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto finishinitrain; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+1); + context._cmp(context.al, context.data.byte(148)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+2); + context._cmp(context.al, context.data.byte(149)); + if (!context.flags.z()) goto checkrain; + context.al = context.data.byte(context.bx+3); + context.data.byte(132) = context.al; + goto dorain; +checkrain: + context._add(context.bx, 4); + goto checkmorerain; +dorain: + context.cx = 4; +initraintop: + randomnumber(context); + context._and(context.al, 31); + context._add(context.al, 3); + context._cmp(context.al, context.data.byte(132)); + if (!context.flags.c()) goto initraintop; + context._add(context.cl, context.al); + context._cmp(context.cl, context.data.byte(128)); + if (!context.flags.c()) goto initrainside; + context.push(context.cx); + splitintolines(context); + context.cx = context.pop(); + goto initraintop; +initrainside: + context.cl = context.data.byte(128); + context._sub(context.cl, 1); +initrainside2: + randomnumber(context); + context._and(context.al, 31); + context._add(context.al, 3); + context._cmp(context.al, context.data.byte(132)); + if (!context.flags.c()) goto initrainside2; + context._add(context.ch, context.al); + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto finishinitrain; + context.push(context.cx); + splitintolines(context); + context.cx = context.pop(); + goto initrainside2; +finishinitrain: + context.al = 255; + context._stosb(); return; -hissnoise: - context.al = 13; - playchannel1(context); +} + +static void splitintolines(Context & context) { +lookforlinestart: + getblockofpixel(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto foundlinestart; + context._sub(context.cl, 1); + context._add(context.ch, 1); + context._cmp(context.cl, 0); + if (context.flags.z()) goto endofthisline; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto endofthisline; + goto lookforlinestart; +foundlinestart: + context.data.word(context.di) = context.cx; + context.bh = 1; +lookforlineend: + getblockofpixel(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundlineend; + context._sub(context.cl, 1); + context._add(context.ch, 1); + context._cmp(context.cl, 0); + if (context.flags.z()) goto foundlineend; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto foundlineend; + context._add(context.bh, 1); + goto lookforlineend; +foundlineend: + context.push(context.cx); + context.data.byte(context.di+2) = context.bh; + randomnumber(context); + context.data.byte(context.di+3) = context.al; + randomnumber(context); + context.data.byte(context.di+4) = context.al; + randomnumber(context); + context._and(context.al, 3); + context._add(context.al, 4); + context.data.byte(context.di+5) = context.al; + context._add(context.di, 6); + context.cx = context.pop(); + context._cmp(context.cl, 0); + if (context.flags.z()) goto endofthisline; + context._cmp(context.ch, context.data.byte(129)); + if (!context.flags.c()) goto endofthisline; + goto lookforlinestart; +endofthisline: return; } -static inline void random(Context & context) { - randomnum1(context); +static void getblockofpixel(Context & context) { + context.push(context.cx); + context.push(context.es); context.push(context.di); - context._and(context.ax, 7); - context._add(context.di, 18); - context._add(context.di, context.ax); - context.al = context.data.byte(context.di); + context.ax = context.data.word(125); + context._add(context.cl, context.al); + context.ax = context.data.word(127); + context._add(context.ch, context.al); + checkone(context); + context._and(context.cl, 1); + if (!context.flags.z()) goto failrain; context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; + context.es = context.pop(); + context.cx = context.pop(); return; -} - -static inline void steady(Context & context) { - context.al = context.data.byte(context.di+18); - context.data.byte(context.di+17) = context.al; - context.data.byte(context.bx+15) = context.al; +failrain: + context.di = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.al = 0; return; } -static inline void constant(Context & context) { - context._add(context.data.byte(context.bx+19), 1); - context.cl = context.data.byte(context.bx+19); - context.ch = 0; - context._add(context.di, context.cx); - context._cmp(context.data.byte(context.di+18), 255); - if (!context.flags.z()) goto gotconst; - context._sub(context.di, context.cx); - context.cx = 0; - context.data.byte(context.bx+19) = context.cl; +static void showrain(Context & context) { + context.ds = context.data.word(414); + context.si = 6*58; + context.ax = context.data.word(context.si+2); + context.si = context.ax; + context._add(context.si, 2080); + context.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); + context.es = context.data.word(412); + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto nothunder; +morerain: + context.es = context.data.word(412); + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto finishrain; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._add(context.ax, context.data.word(119)); + context._add(context.ax, context.data.word(127)); + context.cx = 320; + context._mul(context.cx); + context.cl = context.data.byte(context.bx); + context.ch = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.data.word(117)); + context._add(context.ax, context.data.word(125)); + context.di = context.ax; + context.cl = context.data.byte(context.bx+2); + context.ch = 0; + context.ax = context.data.word(context.bx+3); + context.dl = context.data.byte(context.bx+5); + context.dh = 0; + context._sub(context.ax, context.dx); + context._and(context.ax, 511); + context.data.word(context.bx+3) = context.ax; + context._add(context.bx, 6); + context.push(context.si); + context._add(context.si, context.ax); + context.es = context.data.word(400); + context.ah = 0; + context.dx = 320-2; +rainloop: + context._lodsb(); + context._cmp(context.al, context.ah); + if (context.flags.z()) goto noplot; + context._stosb(); + context._add(context.di, context.dx); + if (--context.cx) goto rainloop; + context.si = context.pop(); + goto morerain; +noplot: + context._add(context.di, 320-1); + if (--context.cx) goto rainloop; + context.si = context.pop(); + goto morerain; +finishrain: + context._cmp(context.data.word(521), 0); + if (!context.flags.z()) goto nothunder; + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notlouisthund; + context._cmp(context.data.byte(45), 1); + if (!context.flags.z()) goto nothunder; +notlouisthund: + context._cmp(context.data.byte(184), 55); + if (context.flags.z()) goto nothunder; + randomnum1(context); + context._cmp(context.al, 1); + if (!context.flags.c()) goto nothunder; + context.al = 7; + context._cmp(context.data.byte(507), 6); + if (context.flags.z()) goto isthunder1; + context.al = 4; +isthunder1: + playchannel1(context); +nothunder: + return; +} + +static void backobject(Context & context) { + context.ds = context.data.word(428); + context.di = context.data.word(context.bx+20); + context.al = context.data.byte(context.bx+18); + context._cmp(context.al, 0); + if (context.flags.z()) goto _tmp48z; + context._sub(context.al, 1); + context.data.byte(context.bx+18) = context.al; + goto finishback; +_tmp48z: + context.al = context.data.byte(context.di+7); + context.data.byte(context.bx+18) = context.al; + context.al = context.data.byte(context.di+8); + context._cmp(context.al, 6); + if (!context.flags.z()) goto notwidedoor; + widedoor(context); + goto finishback; +notwidedoor: + context._cmp(context.al, 5); + if (!context.flags.z()) goto notrandom; + random(context); + goto finishback; +notrandom: + context._cmp(context.al, 4); + if (!context.flags.z()) goto notlockdoor; + lockeddoorway(context); + goto finishback; +notlockdoor: + context._cmp(context.al, 3); + if (!context.flags.z()) goto notlift; + liftsprite(context); + goto finishback; +notlift: + context._cmp(context.al, 2); + if (!context.flags.z()) goto notdoor; + doorway(context); + goto finishback; +notdoor: + context._cmp(context.al, 1); + if (!context.flags.z()) goto steadyob; + constant(context); + goto finishback; +steadyob: + steady(context); +finishback: + return; +} + +static void liftsprite(Context & context) { + context.al = context.data.byte(35); + context._cmp(context.al, 0); + if (context.flags.z()) goto liftclosed; + context._cmp(context.al, 1); + if (context.flags.z()) goto liftopen; + context._cmp(context.al, 3); + if (context.flags.z()) goto openlift; + context.al = context.data.byte(context.bx+19); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishclose; + context._sub(context.al, 1); + context._cmp(context.al, 11); + if (!context.flags.z()) goto pokelift; + context.push(context.ax); + context.al = 3; + liftnoise(context); + context.ax = context.pop(); + goto pokelift; +finishclose: + context.data.byte(35) = 0; + return; +openlift: + context.al = context.data.byte(context.bx+19); + context._cmp(context.al, 12); + if (context.flags.z()) goto endoflist; + context._add(context.al, 1); + context._cmp(context.al, 1); + if (!context.flags.z()) goto pokelift; + context.push(context.ax); + context.al = 2; + liftnoise(context); + context.ax = context.pop(); +pokelift: + context.data.byte(context.bx+19) = context.al; + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di+18); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + context.data.byte(context.di+17) = context.al; + return; +endoflist: + context.data.byte(35) = 1; + return; +liftopen: + context.al = context.data.byte(36); + context.push(context.es); + context.push(context.bx); + turnpathon(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(40), 0); + if (context.flags.z()) goto nocountclose; + context._sub(context.data.byte(40), 1); + context._cmp(context.data.byte(40), 0); + if (!context.flags.z()) goto nocountclose; + context.data.byte(35) = 2; +nocountclose: + context.al = 12; + goto pokelift; +liftclosed: + context.al = context.data.byte(36); + context.push(context.es); + context.push(context.bx); + turnpathoff(context); + context.bx = context.pop(); + context.es = context.pop(); + context._cmp(context.data.byte(39), 0); + if (context.flags.z()) goto nocountopen; + context._sub(context.data.byte(39), 1); + context._cmp(context.data.byte(39), 0); + if (!context.flags.z()) goto nocountopen; + context.data.byte(35) = 3; +nocountopen: + context.al = 0; + goto pokelift; +} + +static void liftnoise(Context & context) { + context._cmp(context.data.byte(184), 5); + if (context.flags.z()) goto hissnoise; + context._cmp(context.data.byte(184), 21); + if (context.flags.z()) goto hissnoise; + playchannel1(context); + return; +hissnoise: + context.al = 13; + playchannel1(context); + return; +} + +static void random(Context & context) { + randomnum1(context); + context.push(context.di); + context._and(context.ax, 7); + context._add(context.di, 18); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + context.di = context.pop(); + context.data.byte(context.bx+15) = context.al; + return; +} + +static void steady(Context & context) { + context.al = context.data.byte(context.di+18); + context.data.byte(context.di+17) = context.al; + context.data.byte(context.bx+15) = context.al; + return; +} + +static void constant(Context & context) { + context._add(context.data.byte(context.bx+19), 1); + context.cl = context.data.byte(context.bx+19); + context.ch = 0; + context._add(context.di, context.cx); + context._cmp(context.data.byte(context.di+18), 255); + if (!context.flags.z()) goto gotconst; + context._sub(context.di, context.cx); + context.cx = 0; + context.data.byte(context.bx+19) = context.cl; gotconst: context.al = context.data.byte(context.di+18); context._sub(context.di, context.cx); @@ -2931,7 +3401,7 @@ gotconst: return; } -static inline void doorway(Context & context) { +static void doorway(Context & context) { context.data.byte(193) = -24; context.data.byte(194) = 10; context.data.byte(195) = -30; @@ -2940,7 +3410,7 @@ static inline void doorway(Context & context) { return; } -static inline void widedoor(Context & context) { +static void widedoor(Context & context) { context.data.byte(193) = -24; context.data.byte(194) = 24; context.data.byte(195) = -30; @@ -2949,7 +3419,7 @@ static inline void widedoor(Context & context) { return; } -static inline void dodoor(Context & context) { +static void dodoor(Context & context) { context.al = context.data.byte(151); context.ah = context.data.byte(152); context.cl = context.data.byte(context.bx+10); @@ -3039,7 +3509,7 @@ notnearly: return; } -static inline void lockeddoorway(Context & context) { +static void lockeddoorway(Context & context) { context.al = context.data.byte(151); context.ah = context.data.byte(152); context.cl = context.data.byte(context.bx+10); @@ -3176,17698 +3646,17122 @@ notnearly: return; } -static inline void getreelframeax(Context & context) { - context.push(context.ds); - context.data.word(160) = context.ax; - findsource(context); - context.es = context.ds; - context.ds = context.pop(); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); - context._add(context.ax, context.ax); - context.cx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.cx); - context.bx = context.ax; - return; -} - -static inline void dumpeverything(Context & context) { +static void updatepeople(Context & context) { context.es = context.data.word(412); - context.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); -dumpevery1: - context.ax = context.data.word(context.bx); - context.cx = context.data.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto finishevery1; - context._cmp(context.ax, context.data.word(context.bx+(40*5))); - if (!context.flags.z()) goto notskip1; - context._cmp(context.cx, context.data.word(context.bx+(40*5)+2)); - if (context.flags.z()) goto skip1; -notskip1: - context.push(context.bx); - context.push(context.es); - context.push(context.ds); - context.bl = context.ah; - context.bh = 0; - context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); - multidump(context); - context.ds = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); -skip1: - context._add(context.bx, 5); - goto dumpevery1; -finishevery1: - context.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)+(40*5); -dumpevery2: - context.ax = context.data.word(context.bx); - context.cx = context.data.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto finishevery2; - context.push(context.bx); - context.push(context.es); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.data.word(18) = context.di; + context.cx = 12*5; + context.al = 255; + while(--context.cx) context._stosb(); + context._add(context.data.word(138), 1); + context.es = context.cs; + context.bx = 537; + context.di = 1003; +updateloop: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto endupdate; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinthisroom; + context.cx = context.data.word(context.bx+1); + context._cmp(context.cl, context.data.byte(148)); + if (!context.flags.z()) goto notinthisroom; + context._cmp(context.ch, context.data.byte(149)); + if (!context.flags.z()) goto notinthisroom; + context.push(context.di); + context.ax = context.data.word(context.di); + __dispatch_call(context, context.ax); + context.di = context.pop(); +notinthisroom: + context._add(context.bx, 8); + context._add(context.di, 2); + goto updateloop; +endupdate: + return; +} + +static void getreelframeax(Context & context) { context.push(context.ds); - context.bl = context.ah; - context.bh = 0; - context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); - multidump(context); + context.data.word(160) = context.ax; + findsource(context); + context.es = context.ds; context.ds = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 5); - goto dumpevery2; -finishevery2: + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context._add(context.ax, context.ax); + context.cx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.cx); + context.bx = context.ax; return; } -static inline void readabyte(Context & context) { - context._cmp(context.si, 30000); - if (!context.flags.z()) goto notendblock; - context.push(context.bx); +static void reelsonscreen(Context & context) { + reconstruct(context); + updatepeople(context); + watchreel(context); + showrain(context); + usetimedtext(context); + return; +} + +static void plotreel(Context & context) { + getreelstart(context); +retryreel: context.push(context.es); - context.push(context.di); - context.push(context.ds); context.push(context.si); - readoneblock(context); + context.ax = context.data.word(context.si+2); + context._cmp(context.al, 220); + if (context.flags.c()) goto normalreel; + context._cmp(context.al, 255); + if (context.flags.z()) goto normalreel; + dealwithspecial(context); + context._add(context.data.word(239), 1); context.si = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); context.es = context.pop(); - context.bx = context.pop(); - context.si = 0; -notendblock: - context._lodsb(); - return; -} - -static inline void printundermon(Context & context) { - context.si = (320*43)+76; - context.di = context.si; - context.es = context.data.word(400); - context._add(context.si, 8*320); - context.dx = 0x0a000; - context.ds = context.dx; - context.cx = 104; -scrollmonloop1: + context._add(context.si, 40); + goto retryreel; +normalreel: + context.cx = 8; +plotloop: context.push(context.cx); - context.push(context.di); + context.push(context.es); context.push(context.si); - context.cx = 170; -scrollmonloop2: - context._lodsb(); - context._cmp(context.al, 231); - if (!context.flags.c()) goto dontplace; -placeit: - context._stosb(); - if (--context.cx) goto scrollmonloop2; - goto finmonscroll; -dontplace: - context._add(context.di, 1); - if (--context.cx) goto scrollmonloop2; -finmonscroll: + context.ax = context.data.word(context.si); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto notplot; + showreelframe(context); +notplot: context.si = context.pop(); - context.di = context.pop(); + context.es = context.pop(); context.cx = context.pop(); - context._add(context.si, 320); - context._add(context.di, 320); - if (--context.cx) goto scrollmonloop1; + context._add(context.si, 5); + if (--context.cx) goto plotloop; + soundonreels(context); + context.bx = context.pop(); + context.es = context.pop(); return; } -static inline void pixelcheckset(Context & context) { - context.push(context.ax); - context._sub(context.al, context.data.byte(context.bx)); - context._sub(context.ah, context.data.byte(context.bx+1)); - context.push(context.es); - context.push(context.bx); - context.push(context.cx); - context.push(context.ax); - context.al = context.data.byte(context.bx+4); - getsetad(context); - context.al = context.data.byte(context.bx+17); - context.es = context.data.word(444); - context.bx = 0; - context.ah = 0; - context.cx = 6; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.push(context.ax); - context.al = context.ah; +static void soundonreels(Context & context) { + context.bl = context.data.byte(184); + context._add(context.bl, context.bl); + context._xor(context.bh, context.bh); + context._add(context.bx, 1254); + context.si = context.data.word(context.bx); +reelsoundloop: + context.al = context.data.byte(context.si); + context._cmp(context.al, 255); + if (context.flags.z()) goto endreelsound; + context.ax = context.data.word(context.si+1); + context._cmp(context.ax, context.data.word(239)); + if (!context.flags.z()) goto skipreelsound; + context._cmp(context.ax, context.data.word(351)); + if (context.flags.z()) goto skipreelsound; + context.data.word(351) = context.ax; + context.al = context.data.byte(context.si); + context._cmp(context.al, 64); + if (context.flags.c()) { playchannel1(context); return; }; + context._cmp(context.al, 128); + if (context.flags.c()) goto channel0once; + context._and(context.al, 63); + context.ah = 255; + { playchannel0(context); return; }; +channel0once: + context._and(context.al, 63); context.ah = 0; - context.cl = context.data.byte(context.bx); - context.ch = 0; - context._mul(context.cx); - context.cx = context.pop(); - context.ch = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(context.bx+2)); - context.bx = context.ax; - context._add(context.bx, 0+2080); - context.al = context.data.byte(context.bx); - context.dl = context.al; - context.cx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = context.pop(); - context._cmp(context.dl, 0); + { playchannel0(context); return; }; +skipreelsound: + context._add(context.si, 3); + goto reelsoundloop; +endreelsound: + context.ax = context.data.word(351); + context._cmp(context.ax, context.data.word(239)); + if (context.flags.z()) goto nochange2; + context.data.word(351) = -1; +nochange2: return; } -static inline void delthisone(Context & context) { - context.push(context.ax); - context.push(context.ax); +static void reconstruct(Context & context) { + context._cmp(context.data.byte(130), 0); + if (context.flags.z()) goto noneedtorecon; + context.data.byte(62) = 1; + drawfloor(context); + spriteupdate(context); + printsprites(context); + context._cmp(context.data.byte(184), 20); + if (!context.flags.z()) goto notfudge; + undertextline(context); +notfudge: + context.data.byte(130) = 0; +noneedtorecon: + return; +} + +static void dealwithspecial(Context & context) { + context._sub(context.al, 220); + context._cmp(context.al, 0); + if (!context.flags.z()) goto notplset; context.al = context.ah; - context.ah = 0; - context._add(context.ax, context.data.word(119)); - context.bx = 320; - context._mul(context.bx); - context.bx = context.pop(); - context.bh = 0; - context._add(context.bx, context.data.word(117)); - context._add(context.ax, context.bx); - context.di = context.ax; - context.ax = context.pop(); - context.push(context.ax); + placesetobject(context); + context.data.byte(130) = 1; + return; +notplset: + context._cmp(context.al, 1); + if (!context.flags.z()) goto notremset; context.al = context.ah; - context.ah = 0; - context.bx = 22*8; - context._mul(context.bx); - context.bx = context.pop(); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(402); - context.dl = context.cl; - context.dh = 0; - context.ax = 320; - context._sub(context.ax, context.dx); - context._neg(context.dx); - context._add(context.dx, 22*8); -deloneloop: - context.push(context.cx); - context.ch = 0; - while(--context.cx) context._movsb(); - context.cx = context.pop(); - context._add(context.di, context.ax); - context._add(context.si, context.dx); - context._sub(context.ch, 1); - if (!context.flags.z()) goto deloneloop; + removesetobject(context); + context.data.byte(130) = 1; return; -} - -static inline void dofade(Context & context) { - context._cmp(context.data.byte(344), 0); - if (context.flags.z()) goto finishfade; - context.cl = context.data.byte(345); - context.ch = 0; - context.al = context.data.byte(343); - context.ah = 0; - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context._add(context.si, context.ax); - context._add(context.si, context.ax); - context._add(context.si, context.ax); - showgroup(context); - context.al = context.data.byte(345); - context._add(context.al, context.data.byte(343)); - context.data.byte(343) = context.al; - context._cmp(context.al, 0); - if (!context.flags.z()) goto finishfade; - fadecalculation(context); -finishfade: +notremset: + context._cmp(context.al, 2); + if (!context.flags.z()) goto notplfree; + context.al = context.ah; + placefreeobject(context); + context.data.byte(130) = 1; return; -} - -static inline void fadetowhite(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.cx = 768; - context.al = 63; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.al = 0; - context._stosb(); - context._stosb(); - context._stosb(); - paltostartpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; +notplfree: + context._cmp(context.al, 3); + if (!context.flags.z()) goto notremfree; + context.al = context.ah; + removefreeobject(context); + context.data.byte(130) = 1; + return; +notremfree: + context._cmp(context.al, 4); + if (!context.flags.z()) goto notryanoff; + switchryanoff(context); + return; +notryanoff: + context._cmp(context.al, 5); + if (!context.flags.z()) goto notryanon; + context.data.byte(135) = context.ah; + context.data.byte(133) = context.ah; + switchryanon(context); + return; +notryanon: + context._cmp(context.al, 6); + if (!context.flags.z()) goto notchangeloc; + context.data.byte(188) = context.ah; + return; +notchangeloc: + movemap(context); return; } -static inline void fadefromwhite(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.cx = 768; - context.al = 63; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.al = 0; - context._stosb(); - context._stosb(); - context._stosb(); - paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; +static void movemap(Context & context) { + context._cmp(context.ah, 32); + if (!context.flags.z()) goto notmapup2; + context._sub(context.data.byte(149), 20); + context.data.byte(186) = 1; + return; +notmapup2: + context._cmp(context.ah, 16); + if (!context.flags.z()) goto notmapupspec; + context._sub(context.data.byte(149), 10); + context.data.byte(186) = 1; + return; +notmapupspec: + context._cmp(context.ah, 8); + if (!context.flags.z()) goto notmapdownspec; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; + return; +notmapdownspec: + context._cmp(context.ah, 2); + if (!context.flags.z()) goto notmaprightspec; + context._add(context.data.byte(148), 11); + context.data.byte(186) = 1; + return; +notmaprightspec: + context._sub(context.data.byte(148), 11); + context.data.byte(186) = 1; return; } -static inline void fadescreendownhalf(Context & context) { - paltostartpal(context); - paltoendpal(context); - context.cx = 768; - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; -halfend: - context.al = context.data.byte(context.bx); - context._shr(context.al, 1); - context.data.byte(context.bx) = context.al; - context._add(context.bx, 1); - if (--context.cx) goto halfend; - context.ds = context.data.word(412); - context.es = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); - context.cx = 3*5; - while(--context.cx) context._movsb(); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(77*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); - context.cx = 3*2; - while(--context.cx) context._movsb(); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; +static void getreelstart(Context & context) { + context.ax = context.data.word(239); + context.cx = 40; + context._mul(context.cx); + context.es = context.data.word(450); + context.si = context.ax; + context._add(context.si, 0+(36*144)); return; } -static inline void fadescreenuphalf(Context & context) { - endpaltostart(context); - paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; +static void showreelframe(Context & context) { + context.al = context.data.byte(context.si+2); + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context.al = context.data.byte(context.si+3); + context.bx = context.ax; + context._add(context.bx, context.data.word(119)); + context.ax = context.data.word(context.si); + context.data.word(160) = context.ax; + findsource(context); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context.ah = 8; + showframe(context); return; } -static inline void fadecalculation(Context & context) { - context._cmp(context.data.byte(346), 0); - if (context.flags.z()) goto nomorefading; - context.bl = context.data.byte(346); - context.es = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.cx = 768; -fadecolloop: - context.al = context.data.byte(context.si); - context.ah = context.data.byte(context.di); - context._cmp(context.al, context.ah); - if (context.flags.z()) goto gotthere; - if (context.flags.c()) goto lesscolour; - context._sub(context.data.byte(context.si), 1); - goto gotthere; -lesscolour: - context._cmp(context.bl, context.ah); - if (context.flags.z()) goto withit; - if (!context.flags.c()) goto gotthere; -withit: - context._add(context.data.byte(context.si), 1); -gotthere: - context._add(context.si, 1); - context._add(context.di, 1); - if (--context.cx) goto fadecolloop; - context._sub(context.data.byte(346), 1); +static void deleverything(Context & context) { + context.al = context.data.byte(129); + context.ah = 0; + context._add(context.ax, context.data.word(123)); + context._cmp(context.ax, 182); + if (!context.flags.c()) goto bigroom; + maptopanel(context); return; -nomorefading: - context.data.byte(344) = 0; +bigroom: + context._sub(context.data.byte(129), 8); + maptopanel(context); + context._add(context.data.byte(129), 8); return; } -static inline void startpaltoend(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.cx = 768/2; - while(--context.cx) context._movsw(); - return; -} - -static inline void fadedownmon(Context & context) { - paltostartpal(context); - paltoendpal(context); +static void dumpeverything(Context & context) { context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); - context.cx = 3*8; - context.ax = 0; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 64; - hangon(context); + context.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); +dumpevery1: + context.ax = context.data.word(context.bx); + context.cx = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto finishevery1; + context._cmp(context.ax, context.data.word(context.bx+(40*5))); + if (!context.flags.z()) goto notskip1; + context._cmp(context.cx, context.data.word(context.bx+(40*5)+2)); + if (context.flags.z()) goto skip1; +notskip1: + context.push(context.bx); + context.push(context.es); + context.push(context.ds); + context.bl = context.ah; + context.bh = 0; + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + multidump(context); + context.ds = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); +skip1: + context._add(context.bx, 5); + goto dumpevery1; +finishevery1: + context.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)+(40*5); +dumpevery2: + context.ax = context.data.word(context.bx); + context.cx = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto finishevery2; + context.push(context.bx); + context.push(context.es); + context.push(context.ds); + context.bl = context.ah; + context.bh = 0; + context.ah = 0; + context.di = context.ax; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + multidump(context); + context.ds = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 5); + goto dumpevery2; +finishevery2: return; } -static inline void fadeupmon(Context & context) { - paltostartpal(context); - paltoendpal(context); - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); - context.cx = 3*8; - context.ax = 0; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 128; - hangon(context); +static void allocatework(Context & context) { + context.bx = 0x1000; + allocatemem(context); + context.data.word(400) = context.ax; return; } -static inline void fadeupmonfirst(Context & context) { - paltostartpal(context); - paltoendpal(context); - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); - context.cx = 3*8; - context.ax = 0; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 64; - hangon(context); - context.al = 26; - playchannel1(context); - context.cx = 64; - hangon(context); +static void readabyte(Context & context) { + context._cmp(context.si, 30000); + if (!context.flags.z()) goto notendblock; + context.push(context.bx); + context.push(context.es); + context.push(context.di); + context.push(context.ds); + context.push(context.si); + readoneblock(context); + context.si = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context.si = 0; +notendblock: + context._lodsb(); return; } -static inline void fadeupyellows(Context & context) { - paltoendpal(context); +static void loadpalfromiff(Context & context) { + context.dx = 2494; + openfile(context); + context.cx = 2000; + context.ds = context.data.word(402); + context.dx = 0; + readfromfile(context); + closefile(context); context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); - context.cx = 3*8; - context.ax = 0; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.ds = context.data.word(402); + context.si = 0x30; + context.cx = 768; +palloop: + context._lodsb(); + context._shr(context.al, 1); + context._shr(context.al, 1); + context._cmp(context.data.byte(73), 1); + if (!context.flags.z()) goto nought; + context._cmp(context.al, 0); + if (context.flags.z()) goto nought; + context.ah = context.al; + context._shr(context.ah, 1); + context._add(context.al, context.ah); + context._shr(context.ah, 1); + context._add(context.al, context.ah); + context._cmp(context.al, 64); + if (context.flags.c()) goto nought; + context.al = 63; +nought: context._stosb(); - context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 128; - hangon(context); + if (--context.cx) goto palloop; return; } -static inline void initialmoncols(Context & context) { - paltostartpal(context); - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); - context.cx = 3*9; +static void cls(Context & context) { + context.ax = 0x0a000; + context.es = context.ax; + context.di = 0; + context.cx = 0x7fff; context.ax = 0; - while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); - context._stosb(); - context._stosw(); - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); - context.al = 230; - context.cx = 18; - showgroup(context); + while(--context.cx) context._stosw(); return; } -static inline void monprint(Context & context) { - context.data.byte(72) = 1; - context.si = context.bx; - context.dl = 166; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); -printloop8: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; -printloop7: - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context._cmp(context.al, ':'); - if (context.flags.z()) goto finishmon2; - context._cmp(context.al, 0); - if (context.flags.z()) goto finishmon; - context._cmp(context.al, 34); - if (context.flags.z()) goto finishmon; - context._cmp(context.al, '='); - if (context.flags.z()) goto finishmon; - context._cmp(context.al, '%'); - if (!context.flags.z()) goto nottrigger; - context.ah = context.data.byte(context.si); - context._add(context.si, 1); - context._add(context.si, 1); - goto finishmon; -nottrigger: +static void printundermon(Context & context) { + context.si = (320*43)+76; + context.di = context.si; + context.es = context.data.word(400); + context._add(context.si, 8*320); + context.dx = 0x0a000; + context.ds = context.dx; + context.cx = 104; +scrollmonloop1: context.push(context.cx); - context.push(context.es); - modifychar(context); - printchar(context); - context.data.word(312) = context.di; - context.data.word(314) = context.bx; - context.data.word(138) = 1; - printcurs(context); - vsync(context); - context.push(context.si); - context.push(context.dx); - context.push(context.ds); - context.push(context.es); - context.push(context.bx); context.push(context.di); - lockmon(context); - context.di = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); - context.dx = context.pop(); + context.push(context.si); + context.cx = 170; +scrollmonloop2: + context._lodsb(); + context._cmp(context.al, 231); + if (!context.flags.c()) goto dontplace; +placeit: + context._stosb(); + if (--context.cx) goto scrollmonloop2; + goto finmonscroll; +dontplace: + context._add(context.di, 1); + if (--context.cx) goto scrollmonloop2; +finmonscroll: context.si = context.pop(); - delcurs(context); - context.es = context.pop(); - context.cx = context.pop(); - if (--context.cx) goto printloop7; -finishmon2: - context.dx = context.pop(); context.di = context.pop(); - context.bx = context.pop(); - scrollmonitor(context); - context.data.word(312) = context.di; - goto printloop8; -finishmon: - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._cmp(context.al, '%'); - if (!context.flags.z()) goto nottrigger2; - context.data.byte(55) = context.ah; -nottrigger2: - context.data.word(312) = context.di; - scrollmonitor(context); - context.bx = context.si; - context.data.byte(72) = 0; + context.cx = context.pop(); + context._add(context.si, 320); + context._add(context.di, 320); + if (--context.cx) goto scrollmonloop1; return; } -static inline void fillryan(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32; - findallryan(context); - context.si = 0+(228*13)+32; - context.al = context.data.byte(19); - context.ah = 0; - context.cx = 20; - context._mul(context.cx); - context._add(context.si, context.ax); - context.di = 80; - context.bx = 58; - context.cx = 2; -ryanloop2: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.cx = 5; -ryanloop1: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.ax = context.data.word(context.si); - context._add(context.si, 2); - context.push(context.si); - context.push(context.es); - obtoinv(context); - context.es = context.pop(); - context.si = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, 44); - if (--context.cx) goto ryanloop1; - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 44); - if (--context.cx) goto ryanloop2; - showryanpage(context); +static void worktoscreen(Context & context) { + vsync(context); + context.si = 0; + context.di = 0; + context.cx = 25; + context.ds = context.data.word(400); + context.dx = 0x0a000; + context.es = context.dx; +dumpallloop: + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + width160(context); + if (--context.cx) goto dumpallloop; return; } -static inline void fillopen(Context & context) { - deltextline(context); - getopenedsize(context); - context._cmp(context.ah, 4); - if (context.flags.c()) goto lessthanapage; - context.ah = 4; -lessthanapage: - context.al = 1; - context.push(context.ax); - context.es = context.data.word(412); - context.di = 0+(228*13); - findallopen(context); - context.si = 0+(228*13); - context.di = 80; - context.bx = 58+96; - context.cx = context.pop(); -openloop1: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.ax = context.data.word(context.si); - context._add(context.si, 2); - context.push(context.si); - context.push(context.es); - context._cmp(context.ch, context.cl); - if (context.flags.c()) goto nextopenslot; - obtoinv(context); -nextopenslot: - context.es = context.pop(); - context.si = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, 44); - context._add(context.cl, 1); - context._cmp(context.cl, 5); - if (!context.flags.z()) goto openloop1; - undertextline(context); +static void paneltomap(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); + context.si = 0; + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multiget(context); return; } -static inline void findallryan(Context & context) { - context.push(context.di); - context.cx = 30; - context.ax = 0x0ffff; - while(--context.cx) context._stosw(); - context.di = context.pop(); - context.cl = 4; - context.ds = context.data.word(398); - context.bx = 0+2080+30000; - context.ch = 0; -findryanloop: - context._cmp(context.data.byte(context.bx+2), context.cl); - if (!context.flags.z()) goto notinryaninv; - context._cmp(context.data.byte(context.bx+3), 255); - if (!context.flags.z()) goto notinryaninv; - context.al = context.data.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 4; - context._stosw(); - context.di = context.pop(); -notinryaninv: - context._add(context.bx, 16); - context._add(context.ch, 1); - context._cmp(context.ch, 114); - if (!context.flags.z()) goto findryanloop; +static void maptopanel(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); + context.si = 0; + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multiput(context); return; } -static inline void findallopen(Context & context) { - context.push(context.di); - context.cx = 16; - context.ax = 0x0ffff; - while(--context.cx) context._stosw(); - context.di = context.pop(); - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); - context.ds = context.data.word(398); - context.bx = 0+2080+30000; - context.ch = 0; -findopen1: - context._cmp(context.data.byte(context.bx+3), context.cl); - if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(context.bx+2), context.dl); - if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(111), 4); - if (context.flags.z()) goto noloccheck; - context.al = context.data.byte(context.bx+5); - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto findopen2; -noloccheck: - context.al = context.data.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 4; - context._stosw(); - context.di = context.pop(); -findopen2: - context._add(context.bx, 16); - context._add(context.ch, 1); - context._cmp(context.ch, 114); - if (!context.flags.z()) goto findopen1; - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); - context.push(context.dx); - context.ds = context.data.word(426); - context.dx = context.pop(); - context.bx = 0; - context.ch = 0; -findopen1a: - context._cmp(context.data.byte(context.bx+3), context.cl); - if (!context.flags.z()) goto findopen2a; - context._cmp(context.data.byte(context.bx+2), context.dl); - if (!context.flags.z()) goto findopen2a; - context.al = context.data.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 2; - context._stosw(); - context.di = context.pop(); -findopen2a: - context._add(context.bx, 16); - context._add(context.ch, 1); - context._cmp(context.ch, 80); - if (!context.flags.z()) goto findopen1a; +static void dumpmap(Context & context) { + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); + multidump(context); return; } -static inline void obtoinv(Context & context) { - context.push(context.bx); - context.push(context.es); - context.push(context.si); - context.push(context.ax); +static void pixelcheckset(Context & context) { context.push(context.ax); - context.push(context.di); + context._sub(context.al, context.data.byte(context.bx)); + context._sub(context.ah, context.data.byte(context.bx+1)); + context.push(context.es); context.push(context.bx); - context.ds = context.data.word(408); - context._sub(context.di, 2); - context._sub(context.bx, 1); - context.al = 10; + context.push(context.cx); + context.push(context.ax); + context.al = context.data.byte(context.bx+4); + getsetad(context); + context.al = context.data.byte(context.bx+17); + context.es = context.data.word(444); + context.bx = 0; context.ah = 0; - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); + context.cx = 6; + context._mul(context.cx); + context._add(context.bx, context.ax); context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) goto finishfill; - context.push(context.bx); - context.push(context.di); context.push(context.ax); - context.ds = context.data.word(398); - context._cmp(context.ah, 4); - if (context.flags.z()) goto isanextra; - context.ds = context.data.word(446); -isanextra: - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._add(context.al, 1); - context.ah = 128; - context._add(context.bx, 19); - context._add(context.di, 18); - showframe(context); - context.ax = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.push(context.bx); - getanyaddir(context); - isitworn(context); - context.bx = context.pop(); - if (!context.flags.z()) goto finishfill; - context.ds = context.data.word(408); - context._sub(context.di, 3); - context._sub(context.bx, 2); - context.al = 7; + context.al = context.ah; context.ah = 0; - showframe(context); -finishfill: - context.ax = context.pop(); - context.si = context.pop(); - context.es = context.pop(); + context.cl = context.data.byte(context.bx); + context.ch = 0; + context._mul(context.cx); + context.cx = context.pop(); + context.ch = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.data.word(context.bx+2)); + context.bx = context.ax; + context._add(context.bx, 0+2080); + context.al = context.data.byte(context.bx); + context.dl = context.al; + context.cx = context.pop(); context.bx = context.pop(); + context.es = context.pop(); + context.ax = context.pop(); + context._cmp(context.dl, 0); return; } -static inline void isitworn(Context & context) { - context.al = context.data.byte(context.bx+12); - context._cmp(context.al, 'W'-'A'); - if (!context.flags.z()) goto notworn; - context.al = context.data.byte(context.bx+13); - context._cmp(context.al, 'E'-'A'); -notworn: +static void createpanel(Context & context) { + context.di = 0; + context.bx = 8; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 8; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 0; + context.bx = 104; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 104; + context.ds = context.data.word(410); + context.al = 0; + context.ah = 2; + showframe(context); return; } -static inline void makeworn(Context & context) { - context.data.byte(context.bx+12) = 'W'-'A'; - context.data.byte(context.bx+13) = 'E'-'A'; +static void createpanel2(Context & context) { + createpanel(context); + context.di = 0; + context.bx = 0; + context.ds = context.data.word(410); + context.al = 5; + context.ah = 2; + showframe(context); + context.di = 160; + context.bx = 0; + context.ds = context.data.word(410); + context.al = 5; + context.ah = 2; + showframe(context); return; } -static inline void getbackfromob(Context & context) { - context._cmp(context.data.byte(106), 1); - if (!context.flags.z()) goto notheldob; - blank(context); - return; -notheldob: - getback1(context); +static void clearwork(Context & context) { + context.ax = 0x0; + context.es = context.data.word(400); + context.di = 0; + context.cx = (200*320)/64; +clearloop: + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + if (--context.cx) goto clearloop; return; } -static inline void incryanpage(Context & context) { - context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadyincryan; - context.data.byte(100) = 222; - context.al = 31; - commandonly(context); -alreadyincryan: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noincryan; - context._and(context.ax, 1); - if (!context.flags.z()) goto doincryan; -noincryan: +static void zoom(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto inwatching; + context._cmp(context.data.byte(8), 1); + if (context.flags.z()) goto zoomswitch; +inwatching: return; -doincryan: - context.ax = context.data.word(198); - context._sub(context.ax, 80+167); - context.data.byte(19) = -1; -findnewpage: - context._add(context.data.byte(19), 1); - context._sub(context.ax, 18); - if (!context.flags.c()) goto findnewpage; - delpointer(context); - fillryan(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); +zoomswitch: + context._cmp(context.data.byte(100), 199); + if (context.flags.c()) goto zoomit; +cantzoom: + putunderzoom(context); return; -} - -static inline void openinv(Context & context) { - context.data.byte(104) = 1; - context.al = 61; - context.di = 80; - context.bx = 58-10; - context.dl = 240; - printmessage(context); - fillryan(context); - context.data.byte(100) = 255; +zoomit: + context.ax = context.data.word(222); + context._sub(context.ax, 9); + context.cx = 320; + context._mul(context.cx); + context._add(context.ax, context.data.word(220)); + context._sub(context.ax, 11); + context.si = context.ax; + context.ax = 132+4; + context.cx = 320; + context._mul(context.cx); + context._add(context.ax, 8+5); + context.di = context.ax; + context.es = context.data.word(400); + context.ds = context.data.word(400); + context.cx = 20; +zoomloop: + context.push(context.cx); + context.cx = 23; +zoomloop2: + context._lodsb(); + context.ah = context.al; + context._stosw(); + context.data.word(context.di+320-2) = context.ax; + if (--context.cx) goto zoomloop2; + context._add(context.si, 320-23); + context._add(context.di, 320-46+320); + context.cx = context.pop(); + if (--context.cx) goto zoomloop; + crosshair(context); + context.data.byte(75) = 1; return; } -static inline void showryanpage(Context & context) { - context.ds = context.data.word(408); - context.di = 80+167; - context.bx = 58-12; - context.al = 12; - context.ah = 0; - showframe(context); - context.al = 13; - context._add(context.al, context.data.byte(19)); +static void delthisone(Context & context) { context.push(context.ax); - context.al = context.data.byte(19); + context.push(context.ax); + context.al = context.ah; context.ah = 0; - context.cx = 18; - context._mul(context.cx); - context.ds = context.data.word(408); - context.di = 80+167; - context._add(context.di, context.ax); - context.bx = 58-12; + context._add(context.ax, context.data.word(119)); + context.bx = 320; + context._mul(context.bx); + context.bx = context.pop(); + context.bh = 0; + context._add(context.bx, context.data.word(117)); + context._add(context.ax, context.bx); + context.di = context.ax; context.ax = context.pop(); + context.push(context.ax); + context.al = context.ah; context.ah = 0; - showframe(context); - return; -} - -static inline void openob(Context & context) { - context.al = context.data.byte(110); - context.ah = context.data.byte(111); - context.di = 5674; - copyname(context); - context.di = 80; - context.bx = 58+86; - context.al = 62; - context.dl = 240; - printmessage(context); - context.di = context.data.word(84); - context._add(context.di, 5); - context.bx = 58+86; - context.es = context.cs; - context.si = 5674; - context.dl = 220; - context.al = 0; - context.ah = 0; - printdirect(context); - fillopen(context); - getopenedsize(context); - context.al = context.ah; - context.ah = 0; - context.cx = 44; - context._mul(context.cx); - context._add(context.ax, 80); - context.bx = 2588; - context.data.word(context.bx) = context.ax; + context.bx = 22*8; + context._mul(context.bx); + context.bx = context.pop(); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = context.ax; + context.es = context.data.word(400); + context.ds = context.data.word(402); + context.dl = context.cl; + context.dh = 0; + context.ax = 320; + context._sub(context.ax, context.dx); + context._neg(context.dx); + context._add(context.dx, 22*8); +deloneloop: + context.push(context.cx); + context.ch = 0; + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context._add(context.di, context.ax); + context._add(context.si, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto deloneloop; return; } -static inline void examicon(Context & context) { - context.ds = context.data.word(410); - context.di = 254; - context.bx = 5; - context.al = 3; +static void multiget(Context & context) { + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.es = context.data.word(400); + context.es = context.ds; + context.ds = context.es; + context._xchg(context.di, context.si); + context.al = context.cl; context.ah = 0; - showframe(context); + context.dx = 320; + context._sub(context.dx, context.ax); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth2; + context.bl = context.cl; + context.bh = 0; + context.ax = 1819; + context._shr(context.bx, 1); + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop3: + __dispatch_call(context, context.ax); + context._add(context.si, context.dx); + if (--context.cx) goto multiloop3; + return; +oddwidth2: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop4: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.si, context.dx); + if (--context.cx) goto multiloop4; return; } -static inline void inventory(Context & context) { - context._cmp(context.data.byte(56), 1); - if (context.flags.z()) goto iswatchinv; - context._cmp(context.data.word(21), 0); - if (context.flags.z()) goto notwatchinv; -iswatchinv: - blank(context); - return; -notwatchinv: - context._cmp(context.data.byte(100), 239); - if (context.flags.z()) goto alreadyopinv; - context.data.byte(100) = 239; - context.al = 32; - commandonly(context); -alreadyopinv: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto cantopinv; - context._and(context.ax, 1); - if (!context.flags.z()) goto doopeninv; -cantopinv: - return; -doopeninv: - context.data.word(328) = 0; - context.data.byte(234) = 0; - context.data.byte(237) = 0; - animpointer(context); - createpanel(context); - showpanel(context); - examicon(context); - showman(context); - showexit(context); - undertextline(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; - openinv(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.byte(110) = 255; - goto waitexam; -/*continuing to unbounded code: examineagain from examineob:3-62*/ -examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; - context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(100) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -waitexam: - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.data.byte(103) = 0; - context.bx = 2494; - context._cmp(context.data.byte(104), 0); - if (context.flags.z()) goto notuseinv; - context.bx = 2556; - context._cmp(context.data.byte(104), 1); - if (context.flags.z()) goto notuseinv; - context.bx = 2618; -notuseinv: - checkcoords(context); - context._cmp(context.data.byte(108), 0); - if (context.flags.z()) goto norex; - goto examineagain; -norex: - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); - if (!context.flags.z()) goto justgetback; -iswatching: - makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; - return; -justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; +static void multiput(Context & context) { + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.es = context.data.word(400); + context.al = context.cl; + context.ah = 0; + context.dx = 320; + context._sub(context.dx, context.ax); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth3; + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop5: + __dispatch_call(context, context.ax); + context._add(context.di, context.dx); + if (--context.cx) goto multiloop5; return; +oddwidth3: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +multiloop6: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.dx); + if (--context.cx) goto multiloop6; return; } -static inline void setpickup(Context & context) { - context._cmp(context.data.byte(102), 1); - if (context.flags.z()) goto cantpick; - context._cmp(context.data.byte(102), 3); - if (context.flags.z()) goto cantpick; - getanyad(context); - context.al = context.data.byte(context.bx+2); - context._cmp(context.al, 4); - if (!context.flags.z()) goto canpick; -cantpick: - blank(context); +static void multidump(Context & context) { + context.dx = 0x0a000; + context.es = context.dx; + context.ds = context.data.word(400); + context.ax = context.bx; + context.bx = 320; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = 320; + context.si = context.di; + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidth; + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.bl = context.cl; + context.bh = 0; + context._neg(context.bx); + context._add(context.bx, context.dx); + context.cl = context.ch; + context.ch = 0; +multiloop1: + __dispatch_call(context, context.ax); + context._add(context.di, context.bx); + context._add(context.si, context.bx); + if (--context.cx) goto multiloop1; return; -canpick: - context._cmp(context.data.byte(100), 209); - if (context.flags.z()) goto alreadysp; - context.data.byte(100) = 209; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); - context.al = 33; - commandwithob(context); -alreadysp: - context.ax = context.data.word(202); - context._cmp(context.ax, 1); - if (!context.flags.z()) goto nosetpick; - context._cmp(context.ax, context.data.word(212)); - if (!context.flags.z()) goto dosetpick; -nosetpick: - return; -dosetpick: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - examicon(context); - context.data.byte(106) = 1; - context.data.byte(104) = 2; - context._cmp(context.data.byte(102), 4); - if (context.flags.z()) goto pickupexob; - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; - transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - openinv(context); - worktoscreenm(context); - return; -pickupexob: - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; - openinv(context); - worktoscreenm(context); - return; -} - -static inline void examinventory(Context & context) { - context._cmp(context.data.byte(100), 249); - if (context.flags.z()) goto alreadyexinv; - context.data.byte(100) = 249; - context.al = 32; - commandonly(context); -alreadyexinv: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (!context.flags.z()) goto doexinv; - return; -doexinv: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - examicon(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; - openinv(context); - worktoscreenm(context); - return; -} - -static inline void reexfrominv(Context & context) { - findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; - return; -} - -static inline void reexfromopen(Context & context) { - return; - findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; - return; -} - -static inline void swapwithinv(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub7; - context._cmp(context.data.byte(100), 243); - if (context.flags.z()) goto alreadyswap1; - context.data.byte(100) = 243; -difsub7: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 34; - commandwithob(context); -alreadyswap1: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto cantswap1; - context._and(context.ax, 1); - if (!context.flags.z()) goto doswap1; -cantswap1: - return; -doswap1: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); - context.push(context.ax); - findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); - context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; - context.push(context.bx); - findinvpos(context); - delpointer(context); - context.al = context.data.byte(89); - geteitherad(context); - context.data.byte(context.bx+2) = 4; - context.data.byte(context.bx+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; - fillryan(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void swapwithopen(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub8; - context._cmp(context.data.byte(100), 242); - if (context.flags.z()) goto alreadyswap2; - context.data.byte(100) = 242; -difsub8: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 34; - commandwithob(context); -alreadyswap2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto cantswap2; - context._and(context.ax, 1); - if (!context.flags.z()) goto doswap2; -cantswap2: - return; -doswap2: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) goto notwornswap; - wornerror(context); - return; -notwornswap: - delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); - if (!context.flags.z()) goto isntsame2; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); - if (!context.flags.z()) goto isntsame2; - errormessage1(context); - return; -isntsame2: - checkobjectsize(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto sizeok2; - return; -sizeok2: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); - context.push(context.ax); - findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; - context._cmp(context.ah, 4); - if (!context.flags.z()) goto makeswapex; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - goto actuallyswap; -makeswapex: - transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; -actuallyswap: - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); - context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; - context.push(context.bx); - findopenpos(context); - geteitherad(context); - context.al = context.data.byte(111); - context.data.byte(context.bx+2) = context.al; - context.al = context.data.byte(110); - context.data.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); - context.data.byte(context.bx+5) = context.al; - context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; - fillopen(context); - fillryan(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void intoinv(Context & context) { - context._cmp(context.data.byte(106), 0); - if (!context.flags.z()) goto notout; - outofinv(context); - return; -notout: - findinvpos(context); - context.ax = context.data.word(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) goto canplace1; - swapwithinv(context); - return; -canplace1: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub1; - context._cmp(context.data.byte(100), 220); - if (context.flags.z()) goto alreadyplce; - context.data.byte(100) = 220; -difsub1: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 35; - commandwithob(context); -alreadyplce: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notletgo2; - context._and(context.ax, 1); - if (!context.flags.z()) goto doplace; -notletgo2: - return; -doplace: - delpointer(context); - context.al = context.data.byte(89); - getexad(context); - context.data.byte(context.bx+2) = 4; - context.data.byte(context.bx+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.data.byte(106) = 0; - fillryan(context); - readmouse(context); - showpointer(context); - outofinv(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void outofinv(Context & context) { - findinvpos(context); - context.ax = context.data.word(context.bx); - context._cmp(context.al, 255); - if (!context.flags.z()) goto canpick2; - blank(context); - return; -canpick2: - context.bx = context.data.word(202); - context._cmp(context.bx, 2); - if (!context.flags.z()) goto canpick2a; - reexfrominv(context); - return; -canpick2a: - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub3; - context._cmp(context.data.byte(100), 221); - if (context.flags.z()) goto alreadygrab; - context.data.byte(100) = 221; -difsub3: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 36; - commandwithob(context); -alreadygrab: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notletgo; - context._and(context.ax, 1); - if (!context.flags.z()) goto dograb; -notletgo: - return; -dograb: - delpointer(context); - context.data.byte(106) = 1; - findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; - getexad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - fillryan(context); - readmouse(context); - showpointer(context); - intoinv(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void geteitherad(Context & context) { - context._cmp(context.data.byte(102), 4); - if (context.flags.z()) goto isinexlist; - context.al = context.data.byte(89); - getfreead(context); - return; -isinexlist: - context.al = context.data.byte(89); - getexad(context); - return; -} - -static inline void getopenedsize(Context & context) { - context._cmp(context.data.byte(111), 4); - if (context.flags.z()) goto isex2; - context._cmp(context.data.byte(111), 2); - if (context.flags.z()) goto isfree2; - context.al = context.data.byte(110); - getsetad(context); - context.ax = context.data.word(context.bx+3); - return; -isfree2: - context.al = context.data.byte(110); - getfreead(context); - context.ax = context.data.word(context.bx+7); - return; -isex2: - context.al = context.data.byte(110); - getexad(context); - context.ax = context.data.word(context.bx+7); - return; -} - -static inline void findinvpos(Context & context) { - context.cx = context.data.word(198); - context._sub(context.cx, 80); - context.bx = -1; -findinv1: - context._add(context.bx, 1); - context._sub(context.cx, 44); - if (!context.flags.c()) goto findinv1; - context.cx = context.data.word(200); - context._sub(context.cx, 58); - context._sub(context.bx, 5); -findinv2: - context._add(context.bx, 5); - context._sub(context.cx, 44); - if (!context.flags.c()) goto findinv2; - context.al = context.data.byte(19); - context.ah = 0; - context.cx = 10; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.bl; - context.data.byte(107) = context.al; - context._add(context.bx, context.bx); - context.es = context.data.word(412); - context._add(context.bx, 0+(228*13)+32); - return; -} - -static inline void findopenpos(Context & context) { - context.cx = context.data.word(198); - context._sub(context.cx, 80); - context.bx = -1; -findopenp1: - context._add(context.bx, 1); - context._sub(context.cx, 44); - if (!context.flags.c()) goto findopenp1; - context.al = context.bl; - context.data.byte(107) = context.al; - context._add(context.bx, context.bx); - context.es = context.data.word(412); - context._add(context.bx, 0+(228*13)); - return; -} - -static inline void dropobject(Context & context) { - context._cmp(context.data.byte(100), 223); - if (context.flags.z()) goto alreadydrop; - context.data.byte(100) = 223; - context._cmp(context.data.byte(106), 0); - if (context.flags.z()) { blank(context); return; }; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); - context.al = 37; - commandwithob(context); -alreadydrop: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nodrop; - context._and(context.ax, 1); - if (!context.flags.z()) goto dodrop; -nodrop: - return; -dodrop: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) goto nowornerror; - wornerror(context); - return; -nowornerror: - context._cmp(context.data.byte(184), 47); - if (context.flags.z()) goto nodrop2; - context.cl = context.data.byte(151); - context._add(context.cl, 12); - context.ch = context.data.byte(152); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) goto nodroperror; -nodrop2: - droperror(context); - return; -nodroperror: - context._cmp(context.data.byte(128), 64); - if (!context.flags.z()) goto notinlift; - context._cmp(context.data.byte(129), 64); - if (!context.flags.z()) goto notinlift; - droperror(context); - return; -notinlift: - context.al = context.data.byte(89); - context.ah = 4; - context.cl = 'G'; - context.ch = 'U'; - context.dl = 'N'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) { cantdrop(context); return; }; - context.al = context.data.byte(89); - context.ah = 4; - context.cl = 'S'; - context.ch = 'H'; - context.dl = 'L'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) { cantdrop(context); return; }; - context.data.byte(102) = 4; - context.al = context.data.byte(89); - getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(151); - context._add(context.al, 4); - context.cl = 4; - context._shr(context.al, context.cl); - context._add(context.al, context.data.byte(148)); - context.ah = context.data.byte(152); - context._add(context.ah, 8); - context.cl = 4; - context._shr(context.ah, context.cl); - context._add(context.ah, context.data.byte(149)); - context.data.byte(context.bx+3) = context.al; - context.data.byte(context.bx+5) = context.ah; - context.al = context.data.byte(151); - context._add(context.al, 4); - context._and(context.al, 15); - context.ah = context.data.byte(152); - context._add(context.ah, 8); - context._and(context.ah, 15); - context.data.byte(context.bx+4) = context.al; - context.data.byte(context.bx+6) = context.ah; - context.data.byte(106) = 0; - context.al = context.data.byte(184); - context.data.byte(context.bx) = context.al; - return; -} - -static inline void droperror(Context & context) { - context.data.byte(100) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 56; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(100) = 255; - worktoscreenm(context); - return; -} - -static inline void cantdrop(Context & context) { - context.data.byte(100) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 24; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(100) = 255; - worktoscreenm(context); - return; -} - -static inline void wornerror(Context & context) { - context.data.byte(100) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 57; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(100) = 255; - worktoscreenm(context); - return; -} - -static inline void removeobfrominv(Context & context) { - context._cmp(context.data.byte(99), 100); - if (context.flags.z()) goto obnotexist; - getanyad(context); - context.di = context.bx; - context.cl = context.data.byte(99); - context.ch = 0; - deleteexobject(context); -obnotexist: - return; -} - -static inline void selectopenob(Context & context) { - context.al = context.data.byte(99); - getanyad(context); - context._cmp(context.al, 255); - if (!context.flags.z()) goto canopenit1; - blank(context); - return; -canopenit1: - context._cmp(context.data.byte(100), 224); - if (context.flags.z()) goto alreadyopob; - context.data.byte(100) = 224; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); - context.al = 38; - commandwithob(context); -alreadyopob: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noopenob; - context._and(context.ax, 1); - if (!context.flags.z()) goto doopenob; -noopenob: - return; -doopenob: - context.al = context.data.byte(99); - context.data.byte(110) = context.al; - context.al = context.data.byte(102); - context.data.byte(111) = context.al; - createpanel(context); - showpanel(context); - showman(context); - examicon(context); - showexit(context); - openinv(context); - openob(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void useopened(Context & context) { - context._cmp(context.data.byte(110), 255); - if (context.flags.z()) goto cannotuseopen; - context._cmp(context.data.byte(106), 0); - if (!context.flags.z()) goto notout2; - outofopen(context); - return; -notout2: - findopenpos(context); - context.ax = context.data.word(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) goto canplace3; - swapwithopen(context); -cannotuseopen: - return; -canplace3: - context._cmp(context.data.byte(106), 1); - if (context.flags.z()) goto intoopen; - blank(context); - return; -intoopen: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub2; - context._cmp(context.data.byte(100), 227); - if (context.flags.z()) goto alreadyplc2; - context.data.byte(100) = 227; -difsub2: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 35; - commandwithob(context); -alreadyplc2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notletgo3; - context._cmp(context.ax, 1); - if (context.flags.z()) goto doplace2; -notletgo3: - return; -doplace2: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) goto notworntoopen; - wornerror(context); - return; -notworntoopen: - delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); - if (!context.flags.z()) goto isntsame; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); - if (!context.flags.z()) goto isntsame; - errormessage1(context); - return; -isntsame: - checkobjectsize(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto sizeok1; - return; -sizeok1: - context.data.byte(106) = 0; - context.al = context.data.byte(89); - geteitherad(context); - context.al = context.data.byte(111); - context.data.byte(context.bx+2) = context.al; - context.al = context.data.byte(110); - context.data.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); - context.data.byte(context.bx+5) = context.al; - fillopen(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void errormessage1(Context & context) { - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 58; - context.dl = 240; - printmessage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void errormessage2(Context & context) { - context.data.byte(100) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 59; - context.dl = 240; - printmessage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void errormessage3(Context & context) { - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 60; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void checkobjectsize(Context & context) { - getopenedsize(context); - context.push(context.ax); - context.al = context.data.byte(89); - geteitherad(context); - context.al = context.data.byte(context.bx+9); - context.cx = context.pop(); - context._cmp(context.al, 255); - if (!context.flags.z()) goto notunsized; - context.al = 6; -notunsized: - context._cmp(context.al, 100); - if (!context.flags.c()) goto specialcase; - context._cmp(context.cl, 100); - if (context.flags.c()) goto isntspecial; - errormessage3(context); - goto sizewrong; -isntspecial: - context._cmp(context.cl, context.al); - if (!context.flags.c()) goto sizeok; -specialcase: - context._sub(context.al, 100); - context._cmp(context.cl, 100); - if (!context.flags.c()) goto bothspecial; - context._cmp(context.cl, context.al); - if (!context.flags.c()) goto sizeok; - errormessage2(context); - goto sizewrong; -bothspecial: - context._sub(context.cl, 100); - context._cmp(context.al, context.cl); - if (context.flags.z()) goto sizeok; - errormessage3(context); -sizewrong: - context.al = 1; - return; -sizeok: - context.al = 0; - return; -} - -static inline void outofopen(Context & context) { - context._cmp(context.data.byte(110), 255); - if (context.flags.z()) goto cantuseopen; - findopenpos(context); - context.ax = context.data.word(context.bx); - context._cmp(context.al, 255); - if (!context.flags.z()) goto canpick4; -cantuseopen: - blank(context); - return; -canpick4: - context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto difsub4; - context._cmp(context.data.byte(100), 228); - if (context.flags.z()) goto alreadygrb; - context.data.byte(100) = 228; -difsub4: - context.data.word(94) = context.ax; - context.bx = context.ax; - context.al = 36; - commandwithob(context); -alreadygrb: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notletgo4; - context._cmp(context.ax, 1); - if (context.flags.z()) goto dogrb; - context._cmp(context.ax, 2); - if (!context.flags.z()) goto notletgo4; - reexfromopen(context); -notletgo4: - return; -dogrb: - delpointer(context); - context.data.byte(106) = 1; - findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; - context._cmp(context.ah, 4); - if (!context.flags.z()) goto makeintoex; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - goto actuallyout; -makeintoex: - transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; - geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; -actuallyout: - fillopen(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void blockget(Context & context) { - context.ah = context.al; - context.al = 0; - context.ds = context.data.word(416); - context.si = 0+192; - context._add(context.si, context.ax); - return; -} - -static inline void adjustlen(Context & context) { - context.ah = context.al; - context._add(context.al, context.ch); - context._cmp(context.al, 100); - if (context.flags.c()) goto over242; - context.al = 224; - context._sub(context.al, context.ch); - context.ch = context.al; -over242: - return; -} - -static inline void look(Context & context) { - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); - if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 241); - if (context.flags.z()) goto alreadylook; - context.data.byte(100) = 241; - context.al = 25; - commandonly(context); -alreadylook: - context._cmp(context.data.word(202), 1); - if (!context.flags.z()) goto nolook; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nolook; - dolook(context); -nolook: - return; -} - -static inline void getback1(Context & context) { - context._cmp(context.data.byte(106), 0); - if (context.flags.z()) goto notgotobject; - blank(context); - return; -notgotobject: - context._cmp(context.data.byte(100), 202); - if (context.flags.z()) goto alreadyget; - context.data.byte(100) = 202; - context.al = 26; - commandonly(context); -alreadyget: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nogetback; - context._and(context.ax, 1); - if (!context.flags.z()) goto dogetback; -nogetback: - return; -dogetback: - context.data.byte(103) = 1; - context.data.byte(106) = 0; - return; -} - -static inline void talk(Context & context) { - context.data.byte(246) = 0; - context.data.byte(237) = 0; - context.al = context.data.byte(99); - context.data.byte(247) = context.al; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - undertextline(context); - convicons(context); - starttalk(context); - context.data.byte(100) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); -waittalk: - delpointer(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.data.byte(103) = 0; - context.bx = 2660; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto waittalk; -finishtalk: - context.bx = context.data.word(249); - context.es = context.cs; - context._cmp(context.data.byte(246), 4); - if (context.flags.c()) goto notnexttalk; - context.al = context.data.byte(context.bx+7); - context._or(context.al, 128); - context.data.byte(context.bx+7) = context.al; -notnexttalk: - redrawmainscrn(context); - worktoscreenm(context); - context._cmp(context.data.byte(383), 1); - if (!context.flags.z()) goto nospeech; - cancelch1(context); - context.data.byte(388) = -1; - context.data.byte(387) = 0; -nospeech: - return; -} - -static inline void convicons(Context & context) { - context.al = context.data.byte(247); - context._and(context.al, 127); - getpersframe(context); - context.di = 234; - context.bx = 2; - context.data.word(160) = context.ax; - findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); - context.ah = 0; - showframe(context); - return; -} - -static inline void getpersframe(Context & context) { - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(448); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - return; -} - -static inline void starttalk(Context & context) { - context.data.byte(245) = 0; - context.al = context.data.byte(247); - context._and(context.al, 127); - getpersontext(context); - context.data.word(71) = 91+91; - context.di = 66; - context.bx = 64; - context.dl = 241; - context.al = 0; - context.ah = 79; - printdirect(context); - context.data.word(71) = 0; - context.di = 66; - context.bx = 80; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); -nospeech1: - return; -} - -static inline void getpersontext(Context & context) { - context.ah = 0; - context.cx = 64*2; - context._mul(context.cx); - context.si = context.ax; - context.es = context.data.word(448); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - return; -} - -static inline void moretalk(Context & context) { - context._cmp(context.data.byte(245), 0); - if (context.flags.z()) goto canmore; - redes(context); - return; -canmore: - context._cmp(context.data.byte(100), 215); - if (context.flags.z()) goto alreadymore; - context.data.byte(100) = 215; - context.al = 49; - commandonly(context); -alreadymore: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nomore; - context._and(context.ax, 1); - if (!context.flags.z()) goto domoretalk; -nomore: - return; -domoretalk: - context.data.byte(245) = 2; - context.data.byte(246) = 4; - context._cmp(context.data.byte(247), 100); - if (context.flags.c()) goto notsecondpart; - context.data.byte(246) = 48; -notsecondpart: - dosometalk(context); - return; -} - -static inline void dosometalk(Context & context) { -watchtalk: - context.al = context.data.byte(246); - context.al = context.data.byte(247); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cx = context.ax; - context.al = context.data.byte(246); - context.ah = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.ax); - context.si = context.ax; - context.es = context.data.word(448); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context._cmp(context.data.byte(context.si), 0); - if (context.flags.z()) goto endwatchtalk; - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 164; - context.bx = 64; - context.dl = 144; - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(234) = 3; - worktoscreenm(context); - context.cx = 180; - hangonpq(context); - context._add(context.data.byte(246), 1); - context.al = context.data.byte(246); - context.al = context.data.byte(247); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cx = context.ax; - context.al = context.data.byte(246); - context.ah = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.ax); - context.si = context.ax; - context.es = context.data.word(448); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context._cmp(context.data.byte(context.si), 0); - if (context.flags.z()) goto endwatchtalk; - context._cmp(context.data.byte(context.si), ':'); - if (context.flags.z()) goto skiptalk; - context._cmp(context.data.byte(context.si), 32); - if (context.flags.z()) goto skiptalk; - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 48; - context.bx = 128; - context.dl = 144; - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(234) = 3; - worktoscreenm(context); - context.cx = 180; - hangonpq(context); -skiptalk: - context._add(context.data.byte(246), 1); - goto watchtalk; -endwatchtalk: - context.data.byte(234) = 0; - return; -} - -static inline void hangonpq(Context & context) { - context.data.byte(103) = 0; - context.bx = 0; -hangloopq: - context.push(context.cx); - context.push(context.bx); - delpointer(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 2692; - checkcoords(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(103), 1); - if (context.flags.z()) goto quitconv; - context._cmp(context.data.byte(383), 1); - if (!context.flags.z()) goto notspeaking; - context._cmp(context.data.byte(515), 255); - if (!context.flags.z()) goto notspeaking; - context._add(context.bx, 1); - context._cmp(context.bx, 40); - if (context.flags.z()) goto finishconv; -notspeaking: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto hangloopq; - context._cmp(context.data.word(212), 0); - if (!context.flags.z()) goto hangloopq; -finishconv: - delpointer(context); - context.data.byte(234) = 0; - return; -quitconv: - delpointer(context); - context.data.byte(234) = 0; - context.ax = context.pop(); - cancelch1(context); - return; -} - -static inline void redes(Context & context) { - context._cmp(context.data.byte(515), 255); - if (!context.flags.z()) goto cantredes; - context._cmp(context.data.byte(245), 2); - if (context.flags.z()) goto canredes; -cantredes: - blank(context); - return; -canredes: - context._cmp(context.data.byte(100), 217); - if (context.flags.z()) goto alreadyreds; - context.data.byte(100) = 217; - context.al = 50; - commandonly(context); -alreadyreds: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (!context.flags.z()) goto doredes; - return; -doredes: - delpointer(context); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - starttalk(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -} - -static inline void lookatplace(Context & context) { - context._cmp(context.data.byte(100), 224); - if (context.flags.z()) goto alreadyinfo; - context.data.byte(100) = 224; - context.al = 27; - commandonly(context); -alreadyinfo: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto noinfo; - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noinfo; - context.bl = context.data.byte(183); - context._cmp(context.bl, 15); - if (!context.flags.c()) goto noinfo; - context.push(context.bx); - delpointer(context); - deltextline(context); - getundercentre(context); - context.ds = context.data.word(462); - context.al = 0; - context.ah = 0; - context.di = 60; - context.bx = 72; - showframe(context); - context.al = 4; - context.ah = 0; - context.di = 60; - context.bx = 72+55; - showframe(context); - context.al = 4; - context.ah = 0; - context.di = 60; - context.bx = 72+55+21; - showframe(context); - context.bx = context.pop(); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(456); - context.si = context.data.word(context.bx); - context._add(context.si, 66*2); - findnextcolon(context); - context.di = 63; - context.bx = 84+4; - context.dl = 191; - context.al = 0; - context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = 500; - hangonp(context); -afterinfo: - context.data.byte(234) = 0; - context.data.byte(231) = 0; - putundercentre(context); - worktoscreenm(context); -noinfo: - return; -} - -static inline void getundercentre(Context & context) { - context.di = 58; - context.bx = 72; - context.ds = context.data.word(402); - context.si = 0; - context.cl = 254; - context.ch = 110; - multiget(context); - return; -} - -static inline void putundercentre(Context & context) { - context.di = 58; - context.bx = 72; - context.ds = context.data.word(402); - context.si = 0; - context.cl = 254; - context.ch = 110; - multiput(context); - return; -} - -static inline void nextdest(Context & context) { -duok: - context._cmp(context.data.byte(100), 218); - if (context.flags.z()) goto alreadydu; - context.data.byte(100) = 218; - context.al = 28; - commandonly(context); -alreadydu: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto nodu; - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nodu; -searchdestup: - context._add(context.data.byte(183), 1); - context._cmp(context.data.byte(183), 15); - if (!context.flags.z()) goto notlastdest; - context.data.byte(183) = 0; -notlastdest: - getdestinfo(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto searchdestup; - context.data.byte(109) = 1; - deltextline(context); - delpointer(context); - showpanel(context); - showman(context); - showarrows(context); - locationpic(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -nodu: - return; -} - -static inline void lastdest(Context & context) { -ddok: - context._cmp(context.data.byte(100), 219); - if (context.flags.z()) goto alreadydd; - context.data.byte(100) = 219; - context.al = 29; - commandonly(context); -alreadydd: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto nodd; - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nodd; -searchdestdown: - context._sub(context.data.byte(183), 1); - context._cmp(context.data.byte(183), -1); - if (!context.flags.z()) goto notfirstdest; - context.data.byte(183) = 15; -notfirstdest: - getdestinfo(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto searchdestdown; - context.data.byte(109) = 1; - deltextline(context); - delpointer(context); - showpanel(context); - showman(context); - showarrows(context); - locationpic(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -nodd: - return; -} - -static inline void destselect(Context & context) { - context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadytrav; - context.data.byte(100) = 222; - context.al = 30; - commandonly(context); -alreadytrav: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto notrav; - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notrav; - getdestinfo(context); - context.al = context.data.byte(183); - context.data.byte(188) = context.al; -notrav: - return; -} - -static inline void usemon(Context & context) { - context.data.byte(55) = 0; - context.es = context.cs; - context.di = 2895+1; - context.cx = 12; - context.al = 32; - while(--context.cx) context._stosb(); - context.es = context.cs; - context.di = 2883+1; - context.cx = 12; - context.al = 32; - while(--context.cx) context._stosb(); - context.es = context.cs; - context.di = 2807; - context.data.byte(context.di) = 1; - context._add(context.di, 26); - context.cx = 3; -keyloop: - context.data.byte(context.di) = 0; - context._add(context.di, 26); - if (--context.cx) goto keyloop; - createpanel(context); - showpanel(context); - showicon(context); - drawfloor(context); - getridofall(context); - context.dx = 1987; - loadintotemp(context); - loadpersonal(context); - loadnews(context); - loadcart(context); - context.dx = 1883; - loadtempcharset(context); - printoutermon(context); - initialmoncols(context); - printlogo(context); - worktoscreen(context); - turnonpower(context); - fadeupyellows(context); - fadeupmonfirst(context); - context.data.word(318) = 76; - context.data.word(320) = 141; - context.al = 1; - monmessage(context); - context.cx = 120; - hangoncurs(context); - context.al = 2; - monmessage(context); - context.cx = 60; - randomaccess(context); - context.al = 3; - monmessage(context); - context.cx = 100; - hangoncurs(context); - printlogo(context); - scrollmonitor(context); - context.data.word(394) = 0; - context.data.word(396) = 0; -moreinput: - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.push(context.di); - context.push(context.bx); - input(context); - context.bx = context.pop(); - context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; - execcommand(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto moreinput; -endmon: - getridoftemp(context); - getridoftempcharset(context); - context.es = context.data.word(466); - deallocatemem(context); - context.es = context.data.word(468); - deallocatemem(context); - context.es = context.data.word(470); - deallocatemem(context); - context.data.byte(103) = 1; - context.al = 26; - playchannel1(context); - context.data.byte(131) = 0; - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); - return; -} - -static inline void printoutermon(Context & context) { - context.di = 40; - context.bx = 32; - context.ds = context.data.word(458); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = 264; - context.bx = 32; - context.ds = context.data.word(458); - context.al = 2; - context.ah = 0; - showframe(context); - context.di = 40; - context.bx = 12; - context.ds = context.data.word(458); - context.al = 3; - context.ah = 0; - showframe(context); - context.di = 40; - context.bx = 164; - context.ds = context.data.word(458); - context.al = 4; - context.ah = 0; - showframe(context); - return; -} - -static inline void loadpersonal(Context & context) { - context.al = context.data.byte(9); - context.dx = 2065; - context._cmp(context.al, 0); - if (context.flags.z()) goto foundpersonal; - context._cmp(context.al, 42); - if (context.flags.z()) goto foundpersonal; - context.dx = 2078; - context._cmp(context.al, 2); - if (context.flags.z()) goto foundpersonal; -foundpersonal: - openfile(context); - readheader(context); - context.bx = context.data.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(466) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); - return; -} - -static inline void loadnews(Context & context) { - context.al = context.data.byte(34); - context.dx = 2091; - context._cmp(context.al, 0); - if (context.flags.z()) goto foundnews; - context.dx = 2104; - context._cmp(context.al, 1); - if (context.flags.z()) goto foundnews; - context.dx = 2117; - context._cmp(context.al, 2); - if (context.flags.z()) goto foundnews; - context.dx = 2130; -foundnews: - openfile(context); - readheader(context); - context.bx = context.data.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(468) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); - return; -} - -static inline void loadcart(Context & context) { - lookininterface(context); - context.dx = 2143; - context._cmp(context.al, 0); - if (context.flags.z()) goto gotcart; - context.dx = 2156; - context._cmp(context.al, 1); - if (context.flags.z()) goto gotcart; - context.dx = 2169; - context._cmp(context.al, 2); - if (context.flags.z()) goto gotcart; - context.dx = 2182; - context._cmp(context.al, 3); - if (context.flags.z()) goto gotcart; - context.dx = 2195; -gotcart: - openfile(context); - readheader(context); - context.bx = context.data.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(470) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); - return; -} - -static inline void lookininterface(Context & context) { - context.al = 'I'; - context.ah = 'N'; - context.cl = 'T'; - context.ch = 'F'; - findsetobject(context); - context.ah = 1; - checkinside(context); - context._cmp(context.cl, 114); - if (context.flags.z()) goto emptyinterface; - context.al = context.data.byte(context.bx+15); - context._add(context.al, 1); - return; -emptyinterface: - context.al = 0; - return; -} - -static inline void turnonpower(Context & context) { - context.cx = 3; -powerloop: - context.push(context.cx); - powerlighton(context); - context.cx = 30; - hangon(context); - powerlightoff(context); - context.cx = 30; - hangon(context); - context.cx = context.pop(); - if (--context.cx) goto powerloop; - powerlighton(context); - return; -} - -static inline void randomaccess(Context & context) { -accessloop: - context.push(context.cx); - vsync(context); - vsync(context); - randomnum1(context); - context._and(context.al, 15); - context._cmp(context.al, 10); - if (context.flags.c()) goto off; - accesslighton(context); - goto chosenaccess; -off: - accesslightoff(context); -chosenaccess: - context.cx = context.pop(); - if (--context.cx) goto accessloop; - accesslightoff(context); - return; -} - -static inline void powerlighton(Context & context) { - context.di = 257+4; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 6; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); - return; -} - -static inline void powerlightoff(Context & context) { - context.di = 257+4; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 5; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); - return; -} - -static inline void accesslighton(Context & context) { - context.di = 74; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 8; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); +oddwidth: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.bl = context.cl; + context.bh = 0; + context._neg(context.bx); + context._add(context.bx, 320); + context.cl = context.ch; + context.ch = 0; +multiloop2: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.bx); + context._add(context.si, context.bx); + if (--context.cx) goto multiloop2; return; } -static inline void accesslightoff(Context & context) { - context.di = 74; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 7; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); +static void width160(Context & context) { + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width128: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width110: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width88: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width80: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + width63: + context._movsw(); + width62: + context._movsw(); + width61: + context._movsw(); + width60: + context._movsw(); + width59: + context._movsw(); + width58: + context._movsw(); + width57: + context._movsw(); + width56: + context._movsw(); + width55: + context._movsw(); + width54: + context._movsw(); + width53: + context._movsw(); + width52: + context._movsw(); + width51: + context._movsw(); + width50: + context._movsw(); + width49: + context._movsw(); + width48: + context._movsw(); + width47: + context._movsw(); + width46: + context._movsw(); + width45: + context._movsw(); + width44: + context._movsw(); + width43: + context._movsw(); + width42: + context._movsw(); + width41: + context._movsw(); + width40: + context._movsw(); + width39: + context._movsw(); + width38: + context._movsw(); + width37: + context._movsw(); + width36: + context._movsw(); + width35: + context._movsw(); + width34: + context._movsw(); + width33: + context._movsw(); + width32: + context._movsw(); + width31: + context._movsw(); + width30: + context._movsw(); + width29: + context._movsw(); + width28: + context._movsw(); + width27: + context._movsw(); + width26: + context._movsw(); + width25: + context._movsw(); + width24: + context._movsw(); + width23: + context._movsw(); + width22: + context._movsw(); + width21: + context._movsw(); + width20: + context._movsw(); + width19: + context._movsw(); + width18: + context._movsw(); + width17: + context._movsw(); + width16: + context._movsw(); + width15: + context._movsw(); + width14: + context._movsw(); + width13: + context._movsw(); + width12: + context._movsw(); + width11: + context._movsw(); + width10: + context._movsw(); + width9: + context._movsw(); + width8: + context._movsw(); + width7: + context._movsw(); + width6: + context._movsw(); + width5: + context._movsw(); + width4: + context._movsw(); + width3: + context._movsw(); + width2: + context._movsw(); + width1: + context._movsw(); + width0: return; } -static inline void locklighton(Context & context) { - context.di = 56; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 10; +static void doblocks(Context & context) { + context.es = context.data.word(400); + context.ax = context.data.word(119); + context.cx = 320; + context._mul(context.cx); + context.di = context.data.word(117); + context._add(context.di, context.ax); + context.al = context.data.byte(149); context.ah = 0; + context.bx = 66; + context._mul(context.bx); + context.bl = context.data.byte(148); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = 0; + context._add(context.si, context.ax); + context.cx = 10; +loop120: context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); - return; -} - -static inline void locklightoff(Context & context) { - context.di = 56; - context.bx = 182; - context.ds = context.data.word(458); - context.al = 9; - context.ah = 0; + context.push(context.cx); + context.cx = 11; +loop124: + context.push(context.cx); context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); - return; -} - -static inline void input(Context & context) { - context.es = context.cs; - context.di = 7944; - context.cx = 64; - context.al = 0; - while(--context.cx) context._stosb(); - context.data.word(316) = 0; - context.al = '>'; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); - context.ah = 0; - printchar(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.cl = 6; - context.ch = 8; - multidump(context); - context._add(context.data.word(318), 6); - context.ax = context.data.word(318); - context.data.word(312) = context.ax; - context.ax = context.data.word(320); - context.data.word(314) = context.ax; -waitkey: - printcurs(context); - vsync(context); - delcurs(context); - readkey(context); - context.al = context.data.byte(142); - context._cmp(context.al, 0); - if (context.flags.z()) goto waitkey; - context._cmp(context.al, 13); - if (context.flags.z()) goto endofinput; - context._cmp(context.al, 8); - if (!context.flags.z()) goto notdel; - context._cmp(context.data.word(316), 0); - if (context.flags.z()) goto waitkey; - delchar(context); - goto waitkey; -notdel: - context._cmp(context.data.word(316), 28); - if (context.flags.z()) goto waitkey; - context._cmp(context.data.byte(142), 32); - if (!context.flags.z()) goto notleadingspace; - context._cmp(context.data.word(316), 0); - if (context.flags.z()) goto waitkey; -notleadingspace: - makecaps(context); - context.es = context.cs; - context.si = context.data.word(316); - context._add(context.si, context.si); - context._add(context.si, 7944); - context.data.byte(context.si) = context.al; - context._cmp(context.al, 'Z'+1); - if (!context.flags.c()) goto waitkey; - context.push(context.ax); - context.push(context.es); - context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); - context._xchg(context.al, context.ah); - context.si = context.ax; - context.cl = 8; - context.ch = 8; - multiget(context); - context.si = context.pop(); - context.es = context.pop(); - context.ax = context.pop(); - context.push(context.es); + context.ds = context.data.word(418); + context._lodsb(); + context.ds = context.data.word(416); context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); - context.ah = 0; - printchar(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto zeroblock; + context.ah = context.al; + context.al = 0; + context.si = 0+192; + context._add(context.si, context.ax); + context.bh = 14; + context.bh = 4; +firstbitofblock: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._add(context.di, 320-16); + context._sub(context.bh, 1); + if (!context.flags.z()) goto firstbitofblock; + context.bh = 12; +loop125: + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context._movsw(); + context.ax = 0x0dfdf; + context._stosw(); + context._stosw(); + context._add(context.di, 320-20); + context._sub(context.bh, 1); + if (!context.flags.z()) goto loop125; + context._add(context.di, 4); + context.ax = 0x0dfdf; + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._add(context.di, 320-16); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); + context._stosw(); +zeroblock: context.si = context.pop(); - context.es = context.pop(); - context.data.byte(context.si+1) = context.cl; - context.ch = 0; - context._add(context.data.word(318), context.cx); - context._add(context.data.word(316), 1); - context._add(context.data.word(312), context.cx); - goto waitkey; -endofinput: + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 16); + if (--context.cx) goto loop124; + context._add(context.si, 66-11); + context.cx = context.pop(); + context.di = context.pop(); + context._add(context.di, 320*16); + if (--context.cx) goto loop120; return; } -static inline void makecaps(Context & context) { - context._cmp(context.al, 'a'); - if (context.flags.c()) goto notupperc; - context._sub(context.al, 32); -notupperc: +static void showframe(Context & context) { + context.push(context.dx); + context.push(context.ax); + context.cx = context.ax; + context._and(context.cx, 511); + context._add(context.cx, context.cx); + context.si = context.cx; + context._add(context.cx, context.cx); + context._add(context.si, context.cx); + context._cmp(context.data.word(context.si), 0); + if (!context.flags.z()) goto notblankshow; + context.cx = 0; return; -} - -static inline void delchar(Context & context) { - context._sub(context.data.word(316), 1); - context.si = context.data.word(316); - context._add(context.si, context.si); - context.es = context.cs; - context._add(context.si, 7944); - context.data.byte(context.si) = 0; - context.al = context.data.byte(context.si+1); +notblankshow: + context._test(context.ah, 128); + if (!context.flags.z()) goto skipoffsets; + context.al = context.data.byte(context.si+4); context.ah = 0; - context._sub(context.data.word(318), context.ax); - context._sub(context.data.word(312), context.ax); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); - context._xchg(context.al, context.ah); + context._add(context.di, context.ax); + context.al = context.data.byte(context.si+5); + context.ah = 0; + context._add(context.bx, context.ax); +skipoffsets: + context.cx = context.data.word(context.si+0); + context.ax = context.data.word(context.si+2); + context._add(context.ax, 2080); context.si = context.ax; - context.cl = 8; - context.ch = 8; - multiput(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.cl = context.al; - context.ch = 8; - multidump(context); - return; -} - -static inline void execcommand(Context & context) { - context.es = context.cs; - context.bx = 2776; - context.ds = context.cs; - context.si = 7944; - context.al = context.data.byte(context.si); - context._cmp(context.al, 0); - if (!context.flags.z()) goto notblankinp; - scrollmonitor(context); + context.ax = context.pop(); + context.dx = context.pop(); + context._cmp(context.ah, 0); + if (context.flags.z()) goto noeffects; + context._test(context.ah, 128); + if (context.flags.z()) goto notcentred; + context.push(context.ax); + context.al = context.cl; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.di, context.ax); + context.al = context.ch; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.bx, context.ax); + context.ax = context.pop(); +notcentred: + context._test(context.ah, 64); + if (context.flags.z()) goto notdiffdest; + context.push(context.cx); + frameoutfx(context); + context.cx = context.pop(); return; -notblankinp: - context.cl = 0; -comloop: +notdiffdest: + context._test(context.ah, 8); + if (context.flags.z()) goto notprintlist; + context.push(context.ax); + context.ax = context.di; + context._sub(context.ax, context.data.word(117)); context.push(context.bx); - context.push(context.si); -comloop2: - context.al = context.data.byte(context.si); - context._add(context.si, 2); - context.ah = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.ah, 32); - if (context.flags.z()) goto foundcom; - context._cmp(context.al, context.ah); - if (context.flags.z()) goto comloop2; - context.si = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 10); - context._add(context.cl, 1); - context._cmp(context.cl, 6); - if (!context.flags.z()) goto comloop; - neterror(context); - context.al = 0; - return; -foundcom: - context.si = context.pop(); + context._sub(context.bx, context.data.word(119)); + context.ah = context.bl; context.bx = context.pop(); - context._cmp(context.cl, 1); - if (context.flags.z()) goto testcom; - context._cmp(context.cl, 2); - if (context.flags.z()) goto directory; - context._cmp(context.cl, 3); - if (context.flags.z()) goto accesscom; - context._cmp(context.cl, 4); - if (context.flags.z()) goto signoncom; - context._cmp(context.cl, 5); - if (context.flags.z()) goto keyscom; - goto quitcom; -directory: - dircom(context); - context.al = 0; - return; -signoncom: - signon(context); - context.al = 0; - return; -accesscom: - read(context); - context.al = 0; - return; -keyscom: - showkeys(context); - context.al = 0; - return; -testcom: - context.al = 6; - monmessage(context); - context.al = 0; - return; -quitcom: - context.al = 1; - return; -} - -static inline void neterror(Context & context) { - context.al = 5; - monmessage(context); - scrollmonitor(context); - return; -} - -static inline void dircom(Context & context) { - context.cx = 30; - randomaccess(context); - parser(context); - context._cmp(context.data.byte(context.di+1), 0); - if (context.flags.z()) goto dirroot; - dirfile(context); - return; -dirroot: - context.data.byte(269) = 0; - context.ds = context.cs; - context.si = 2885; - context._add(context.si, 1); - context.es = context.cs; - context.di = 2895; - context._add(context.di, 1); - context.cx = 12; - while(--context.cx) context._movsb(); - monitorlogo(context); - scrollmonitor(context); - context.al = 9; - monmessage(context); - context.es = context.data.word(466); - searchforfiles(context); - context.es = context.data.word(468); - searchforfiles(context); - context.es = context.data.word(470); - searchforfiles(context); - scrollmonitor(context); + context.ax = context.pop(); +notprintlist: + context._test(context.ah, 4); + if (context.flags.z()) goto notflippedx; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutfx(context); + context.cx = context.pop(); return; -} - -static inline void searchforfiles(Context & context) { - context.bx = 66*2; -directloop1: - context.al = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.al, '*'); - if (context.flags.z()) goto endofdir; - context._cmp(context.al, 34); - if (!context.flags.z()) goto directloop1; - monprint(context); - goto directloop1; -endofdir: +notflippedx: + context._test(context.ah, 2); + if (context.flags.z()) goto notnomask; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutnm(context); + context.cx = context.pop(); + return; +notnomask: + context._test(context.ah, 32); + if (context.flags.z()) goto noeffects; + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutbh(context); + context.cx = context.pop(); + return; +noeffects: + context.dx = 320; + context.es = context.data.word(400); + context.push(context.cx); + frameoutv(context); + context.cx = context.pop(); return; } -static inline void signon(Context & context) { - parser(context); - context._add(context.di, 1); - context.ds = context.cs; - context.si = 2807; - context.cx = 4; -signonloop: +static void frameoutv(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); context.push(context.cx); - context.push(context.si); - context.push(context.di); - context._add(context.si, 14); - context.cx = 11; -signonloop2: + context.ch = 0; + context._sub(context.dx, context.cx); + context.cx = context.pop(); +frameloop1: + context.push(context.cx); + context.ch = 0; +frameloop2: context._lodsb(); - context._cmp(context.al, 32); - if (context.flags.z()) goto foundsign; - makecaps(context); - context.ah = context.data.byte(context.di); + context._cmp(context.al, 0); + if (!context.flags.z()) goto backtosolid; +backtoother: context._add(context.di, 1); - context._cmp(context.al, context.ah); - if (!context.flags.z()) goto nomatch; - if (--context.cx) goto signonloop2; -nomatch: - context.di = context.pop(); - context.si = context.pop(); + if (--context.cx) goto frameloop2; context.cx = context.pop(); - context._add(context.si, 26); - if (--context.cx) goto signonloop; - context.al = 13; - monmessage(context); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloop1; return; -foundsign: - context.di = context.pop(); - context.si = context.pop(); +frameloop3: + context._lodsb(); + context._cmp(context.al, 0); + if (context.flags.z()) goto backtoother; +backtosolid: + context._stosb(); + if (--context.cx) goto frameloop3; context.cx = context.pop(); - context.bx = context.si; - context.es = context.ds; - context._cmp(context.data.byte(context.bx), 0); - if (context.flags.z()) goto notyetassigned; - context.al = 17; - monmessage(context); - return; -notyetassigned: - context.push(context.es); - context.push(context.bx); - scrollmonitor(context); - context.al = 15; - monmessage(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.push(context.di); - context.push(context.bx); - input(context); - context.bx = context.pop(); - context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; - context.bx = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.bx); - context._add(context.bx, 2); - context.ds = context.cs; - context.si = 7944; -checkpass: - context._lodsw(); - context.ah = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.ah, 32); - if (context.flags.z()) goto passpassed; - context._cmp(context.al, context.ah); - if (context.flags.z()) goto checkpass; -passerror: - context.bx = context.pop(); - context.es = context.pop(); - scrollmonitor(context); - context.al = 16; - monmessage(context); - return; -passpassed: - context.al = 14; - monmessage(context); - context.bx = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.bx); - context._add(context.bx, 14); - monprint(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); - context.data.byte(context.bx) = 1; + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloop1; return; } -static inline void showkeys(Context & context) { - context.cx = 10; - randomaccess(context); - scrollmonitor(context); - context.al = 18; - monmessage(context); - context.es = context.cs; - context.bx = 2807; - context.cx = 4; -keysloop: +static void frameoutnm(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); context.push(context.cx); - context.push(context.bx); - context._cmp(context.data.byte(context.bx), 0); - if (context.flags.z()) goto notheld; - context._add(context.bx, 14); - monprint(context); -notheld: - context.bx = context.pop(); + context.ch = 0; + context._sub(context.dx, context.cx); context.cx = context.pop(); - context._add(context.bx, 26); - if (--context.cx) goto keysloop; - scrollmonitor(context); + context.al = context.cl; + context._and(context.al, 1); + if (!context.flags.z()) goto oddwidthframe; + context.bl = context.cl; + context.bh = 0; + context.ax = 1819; + context._shr(context.bx, 1); + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +nmloop1: + __dispatch_call(context, context.ax); + context._add(context.di, context.dx); + if (--context.cx) goto nmloop1; + return; +oddwidthframe: + context.bl = context.cl; + context.bh = 0; + context._shr(context.bx, 1); + context.ax = 1819; + context._sub(context.ax, context.bx); + context.cl = context.ch; + context.ch = 0; +nmloop2: + __dispatch_call(context, context.ax); + context._movsb(); + context._add(context.di, context.dx); + if (--context.cx) goto nmloop2; return; } -static inline void read(Context & context) { - context.cx = 40; - randomaccess(context); - parser(context); - context._cmp(context.data.byte(context.di+1), 0); - if (!context.flags.z()) goto okcom; - neterror(context); - return; -okcom: - context.es = context.cs; - context.di = 2895; - context.ax = context.data.word(466); - context.data.word(324) = context.ax; - context.ds = context.ax; - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(468); - context.data.word(324) = context.ax; - context.ds = context.ax; - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(470); - context.data.word(324) = context.ax; - context.ds = context.ax; - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; - context.al = 7; - monmessage(context); +static void frameoutbh(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._sub(context.dx, context.cx); + context.cx = context.pop(); +bhloop2: + context.push(context.cx); + context.ch = 0; + context.ah = 255; +bhloop1: + context._cmp(context.data.byte(context.di), context.ah); + if (!context.flags.z()) goto nofill; + context._movsb(); + if (--context.cx) goto bhloop1; + goto nextline; +nofill: + context._add(context.di, 1); + context._add(context.si, 1); + if (--context.cx) goto bhloop1; +nextline: + context._add(context.di, context.dx); + context.cx = context.pop(); + context._sub(context.ch, 1); + if (!context.flags.z()) goto bhloop2; return; -foundfile2: - getkeyandlogo(context); +} + +static void frameoutfx(Context & context) { + context.push(context.dx); + context.ax = context.bx; + context.bx = context.dx; + context._mul(context.bx); + context._add(context.di, context.ax); + context.dx = context.pop(); + context.push(context.cx); + context.ch = 0; + context._add(context.dx, context.cx); + context.cx = context.pop(); +frameloopfx1: + context.push(context.cx); + context.ch = 0; +frameloopfx2: + context._lodsb(); context._cmp(context.al, 0); - if (context.flags.z()) goto keyok1; + if (!context.flags.z()) goto backtosolidfx; +backtootherfx: + context._sub(context.di, 1); + if (--context.cx) goto frameloopfx2; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloopfx1; return; -keyok1: - context.es = context.cs; - context.di = 2883; - context.ds = context.data.word(324); - searchforstring(context); +frameloopfx3: + context._lodsb(); context._cmp(context.al, 0); - if (context.flags.z()) goto findtopictext; - context.al = context.data.byte(270); - context.data.byte(269) = context.al; - context.al = 11; - monmessage(context); + if (context.flags.z()) goto backtootherfx; +backtosolidfx: + context.data.byte(context.di) = context.al; + context._sub(context.di, 1); + if (--context.cx) goto frameloopfx3; + context.cx = context.pop(); + context._add(context.di, context.dx); + context._sub(context.ch, 1); + if (!context.flags.z()) goto frameloopfx1; return; -findtopictext: - context._add(context.bx, 1); - context.push(context.es); +} + +static void transferinv(Context & context) { + context.di = context.data.word(12); + context.push(context.di); + context.al = context.data.byte(10); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context._add(context.ax, 1); + context.cx = 6; + context._mul(context.cx); + context.es = context.data.word(398); + context.bx = 0; + context._add(context.bx, context.ax); + context._add(context.di, 0+2080); context.push(context.bx); - monitorlogo(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); -moretopic: - monprint(context); + context.al = context.data.byte(90); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context._add(context.ax, 1); + context.cx = 6; + context._mul(context.cx); + context.ds = context.data.word(446); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+2080; context.al = context.data.byte(context.bx); - context._cmp(context.al, 34); - if (context.flags.z()) goto endoftopic; - context._cmp(context.al, '='); - if (context.flags.z()) goto endoftopic; - context._cmp(context.al, '*'); - if (context.flags.z()) goto endoftopic; - context.push(context.es); - context.push(context.bx); - processtrigger(context); - context.cx = 24; - randomaccess(context); + context.ah = 0; + context.cl = context.data.byte(context.bx+1); + context.ch = 0; + context._add(context.si, context.data.word(context.bx+2)); + context.dx = context.data.word(context.bx+4); context.bx = context.pop(); - context.es = context.pop(); - goto moretopic; -endoftopic: - scrollmonitor(context); + context.data.byte(context.bx+0) = context.al; + context.data.byte(context.bx+1) = context.cl; + context.data.word(context.bx+4) = context.dx; + context._mul(context.cx); + context.cx = context.ax; + context.push(context.cx); + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context.ax = context.pop(); + context.data.word(context.bx+2) = context.ax; + context._add(context.data.word(12), context.cx); return; } -static inline void dirfile(Context & context) { - context.al = 34; - context.data.byte(context.di) = context.al; - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(466); - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(468); - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.push(context.es); +static void transfermap(Context & context) { + context.di = context.data.word(12); context.push(context.di); - context.ds = context.data.word(470); - context.si = 66*2; - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.al = 7; - monmessage(context); - return; -foundfile: - context.ax = context.pop(); - context.ax = context.pop(); - getkeyandlogo(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto keyok2; - return; -keyok2: - context.push(context.es); + context.al = context.data.byte(10); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context.cx = 6; + context._mul(context.cx); + context.es = context.data.word(398); + context.bx = 0; + context._add(context.bx, context.ax); + context._add(context.di, 0+2080); context.push(context.bx); - context.ds = context.cs; - context.si = 2883+1; - context.es = context.cs; - context.di = 2895+1; - context.cx = 12; - while(--context.cx) context._movsb(); - monitorlogo(context); - scrollmonitor(context); - context.al = 10; - monmessage(context); - context.bx = context.pop(); - context.es = context.pop(); -directloop2: + context.al = context.data.byte(90); + context.ah = 0; + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.bx); + context.cx = 6; + context._mul(context.cx); + context.ds = context.data.word(446); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+2080; context.al = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.al, 34); - if (context.flags.z()) goto endofdir2; - context._cmp(context.al, '*'); - if (context.flags.z()) goto endofdir2; - context._cmp(context.al, '='); - if (!context.flags.z()) goto directloop2; - monprint(context); - goto directloop2; -endofdir2: - scrollmonitor(context); + context.ah = 0; + context.cl = context.data.byte(context.bx+1); + context.ch = 0; + context._add(context.si, context.data.word(context.bx+2)); + context.dx = context.data.word(context.bx+4); + context.bx = context.pop(); + context.data.byte(context.bx+0) = context.al; + context.data.byte(context.bx+1) = context.cl; + context.data.word(context.bx+4) = context.dx; + context._mul(context.cx); + context.cx = context.ax; + context.push(context.cx); + while(--context.cx) context._movsb(); + context.cx = context.pop(); + context.ax = context.pop(); + context.data.word(context.bx+2) = context.ax; + context._add(context.data.word(12), context.cx); + return; +} + +static void dofade(Context & context) { + context._cmp(context.data.byte(344), 0); + if (context.flags.z()) goto finishfade; + context.cl = context.data.byte(345); + context.ch = 0; + context.al = context.data.byte(343); + context.ah = 0; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context._add(context.si, context.ax); + context._add(context.si, context.ax); + context._add(context.si, context.ax); + showgroup(context); + context.al = context.data.byte(345); + context._add(context.al, context.data.byte(343)); + context.data.byte(343) = context.al; + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishfade; + fadecalculation(context); +finishfade: return; } -static inline void getkeyandlogo(Context & context) { - context._add(context.bx, 1); - context.al = context.data.byte(context.bx); - context._sub(context.al, 48); - context.data.byte(271) = context.al; - context._add(context.bx, 2); - context.al = context.data.byte(context.bx); - context._sub(context.al, 48); - context.data.byte(276) = context.al; - context._add(context.bx, 1); - context.push(context.es); - context.push(context.bx); - context.al = context.data.byte(276); - context.ah = 0; - context.cx = 26; - context._mul(context.cx); - context.es = context.cs; - context.bx = 2807; - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context._cmp(context.al, 1); - if (context.flags.z()) goto keyok; - context.push(context.bx); - context.push(context.es); - context.al = 12; - monmessage(context); - context.es = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 14); - monprint(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); - context.al = 1; - return; -keyok: - context.bx = context.pop(); - context.es = context.pop(); - context.al = context.data.byte(271); - context.data.byte(269) = context.al; +static void clearendpal(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; context.al = 0; + while(--context.cx) context._stosb(); return; } -static inline void searchforstring(Context & context) { - context.dl = context.data.byte(context.di); - context.cx = context.di; -restartlook: - context.di = context.cx; - context.bx = context.si; - context.dh = 0; -keeplooking: - context._lodsb(); - makecaps(context); - context._cmp(context.al, '*'); - if (context.flags.z()) goto notfound; - context._cmp(context.dl, '='); - if (!context.flags.z()) goto nofindingtopic; - context._cmp(context.al, 34); - if (context.flags.z()) goto notfound; -nofindingtopic: - context.ah = context.data.byte(context.di); - context._cmp(context.al, context.dl); - if (!context.flags.z()) goto notbracket; - context._add(context.dh, 1); - context._cmp(context.dh, 2); - if (context.flags.z()) goto complete; -notbracket: - context._cmp(context.al, context.ah); - if (!context.flags.z()) goto restartlook; - context._add(context.di, 1); - goto keeplooking; -complete: - context.es = context.ds; - context.al = 0; - context.bx = context.si; +static void clearpalette(Context & context) { + context.data.byte(344) = 0; + clearstartpal(context); + dumpcurrent(context); return; -notfound: - context.al = 1; +} + +static void fadescreenup(Context & context) { + clearstartpal(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } -static inline void parser(Context & context) { - context.es = context.cs; - context.di = 2883; - context.cx = 13; +static void fadetowhite(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; + context.al = 63; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.al = 0; + context._stosb(); + context._stosb(); + context._stosb(); + paltostartpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static void fadefromwhite(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768; + context.al = 63; while(--context.cx) context._stosb(); - context.di = 2883; - context.al = '='; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.al = 0; context._stosb(); - context.ds = context.cs; - context.si = 7944; -notspace1: - context._lodsw(); - context._cmp(context.al, 32); - if (context.flags.z()) goto stillspace1; - context._cmp(context.al, 0); - if (!context.flags.z()) goto notspace1; - goto finishpars; -stillspace1: - context._lodsw(); - context._cmp(context.al, 32); - if (context.flags.z()) goto stillspace1; -copyin1: context._stosb(); - context._lodsw(); - context._cmp(context.al, 0); - if (context.flags.z()) goto finishpars; - context._cmp(context.al, 32); - if (!context.flags.z()) goto copyin1; -finishpars: - context.di = 2883; + context._stosb(); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } -static inline void scrollmonitor(Context & context) { - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.di); - context.push(context.si); - context.push(context.es); - context.push(context.ds); - printlogo(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); - printundermon(context); - context.ax = context.data.word(320); - worktoscreen(context); - context.al = 25; - playchannel1(context); - context.ds = context.pop(); - context.es = context.pop(); - context.si = context.pop(); - context.di = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); +static void fadescreenups(Context & context) { + clearstartpal(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; return; } -static inline void lockmon(Context & context) { - context._cmp(context.data.byte(392), 57); - if (!context.flags.z()) goto notlock; - locklighton(context); -lockloop: - context._cmp(context.data.byte(392), 57); - if (context.flags.z()) goto lockloop; - locklightoff(context); -notlock: +static void fadescreendownhalf(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.cx = 768; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; +halfend: + context.al = context.data.byte(context.bx); + context._shr(context.al, 1); + context.data.byte(context.bx) = context.al; + context._add(context.bx, 1); + if (--context.cx) goto halfend; + context.ds = context.data.word(412); + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); + context.cx = 3*5; + while(--context.cx) context._movsb(); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(77*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); + context.cx = 3*2; + while(--context.cx) context._movsb(); + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; return; } -static inline void monitorlogo(Context & context) { - context.al = context.data.byte(269); - context._cmp(context.al, context.data.byte(270)); - if (context.flags.z()) goto notnewlogo; - context.data.byte(270) = context.al; - printlogo(context); - printundermon(context); - worktoscreen(context); - printlogo(context); - printlogo(context); - context.al = 26; - playchannel1(context); - context.cx = 20; - randomaccess(context); +static void fadescreenuphalf(Context & context) { + endpaltostart(context); + paltoendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; return; -notnewlogo: - printlogo(context); +} + +static void fadescreendown(Context & context) { + paltostartpal(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + return; +} + +static void fadescreendowns(Context & context) { + paltostartpal(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; + return; +} + +static void clearstartpal(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 256; +wholeloop1: + context.ax = 0; + context._stosw(); + context.al = 0; + context._stosb(); + if (--context.cx) goto wholeloop1; return; } -static inline void printlogo(Context & context) { - context.di = 56; - context.bx = 32; +static void showgun(Context & context) { + context.data.byte(348) = 0; + context.data.byte(347) = 0; + context.data.byte(349) = 0; + paltostartpal(context); + paltoendpal(context); + greyscalesum(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 130; + hangon(context); + endpaltostart(context); + clearendpal(context); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 200; + hangon(context); + context.data.byte(531) = 34; + loadroomssample(context); + context.data.byte(386) = 0; + context.dx = 2364; + loadintotemp(context); + createpanel2(context); context.ds = context.data.word(458); context.al = 0; context.ah = 0; + context.di = 100; + context.bx = 4; showframe(context); - showcurrentfile(context); - return; -} - -static inline void showcurrentfile(Context & context) { - context.di = 178; - context.bx = 37; - context.si = 2895+1; -curfileloop: - context.al = context.data.byte(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) goto finishfile; - context._add(context.si, 1); - context.push(context.si); - modifychar(context); - context.ds = context.data.word(406); + context.ds = context.data.word(458); + context.al = 1; context.ah = 0; - printchar(context); - context.si = context.pop(); - goto curfileloop; -finishfile: - return; -} - -static inline void monmessage(Context & context) { - context.es = context.data.word(466); - context.bx = 66*2; - context.cl = context.al; - context.ch = 0; -monmessageloop: - context.al = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.al, '+'); - if (!context.flags.z()) goto monmessageloop; - if (--context.cx) goto monmessageloop; - monprint(context); + context.di = 158; + context.bx = 106; + showframe(context); + worktoscreen(context); + getridoftemp(context); + fadescreenup(context); + context.cx = 160; + hangon(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.dx = 2273; + loadtemptext(context); + rollendcredits2(context); + getridoftemptext(context); return; } -static inline void processtrigger(Context & context) { - context._cmp(context.data.byte(55), '1'); - if (!context.flags.z()) goto notfirsttrigger; - context.al = 8; - setlocation(context); - context.al = 45; - triggermessage(context); - return; -notfirsttrigger: - context._cmp(context.data.byte(55), '2'); - if (!context.flags.z()) goto notsecondtrigger; - context.al = 9; - setlocation(context); - context.al = 55; - triggermessage(context); - return; -notsecondtrigger: - context._cmp(context.data.byte(55), '3'); - if (!context.flags.z()) goto notthirdtrigger; - context.al = 2; - setlocation(context); - context.al = 59; - triggermessage(context); -notthirdtrigger: +static void rollendcredits2(Context & context) { + rollem(context); return; } -static inline void triggermessage(Context & context) { - context.push(context.ax); - context.di = 174; - context.bx = 153; - context.cl = 200; - context.ch = 63; +static void rollem(Context & context) { + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; context.ds = context.data.word(402); context.si = 0; multiget(context); - context.ax = context.pop(); - findpuztext(context); - context.di = 174; - context.bx = 156; - context.dl = 141; - context.ah = 16; - printdirect(context); - context.cx = 140; - hangon(context); - worktoscreen(context); - context.cx = 340; - hangon(context); - context.di = 174; - context.bx = 153; - context.cl = 200; - context.ch = 63; - context.ds = context.data.word(402); - context.si = 0; - multiput(context); - worktoscreen(context); - context.data.byte(55) = 0; - return; -} - -static inline void printcurs(Context & context) { + context.es = context.data.word(466); + context.si = 49*2; + context.ax = context.data.word(context.si); + context.si = context.ax; + context._add(context.si, 66*2); + context.cx = 80; +endcredits21: + context.push(context.cx); + context.bx = 10; + context.cx = context.data.word(77); +endcredits22: + context.push(context.cx); context.push(context.si); context.push(context.di); - context.push(context.ds); - context.push(context.dx); - context.push(context.bx); context.push(context.es); - context.di = context.data.word(312); - context.bx = context.data.word(314); - context.cl = 6; - context.ch = 8; - context._sub(context.bx, 3); - context.ch = 11; - context.ds = context.data.word(412); - context.si = 0; - context.push(context.di); - context.push(context.bx); - multiget(context); - context.bx = context.pop(); - context.di = context.pop(); context.push(context.bx); - context.push(context.di); - context._add(context.data.word(138), 1); - context.ax = context.data.word(138); - context._and(context.al, 16); - if (!context.flags.z()) goto flashcurs; - context.al = '/'; - context._sub(context.al, 32); - context.ah = 0; - context.ds = context.data.word(406); - showframe(context); -flashcurs: - context.di = context.pop(); + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; + context.ds = context.data.word(402); + context.si = 0; + multiput(context); + vsync(context); context.bx = context.pop(); - context._sub(context.di, 6); - context.cl = 12; - context.ch = 11; - multidump(context); context.es = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); context.di = context.pop(); context.si = context.pop(); - return; -} - -static inline void delcurs(Context & context) { - context.push(context.es); - context.push(context.bx); - context.push(context.di); - context.push(context.ds); - context.push(context.dx); context.push(context.si); - context.di = context.data.word(312); - context.bx = context.data.word(314); - context.cl = 6; - context.ch = 8; - context._sub(context.bx, 3); - context.ch = 11; context.push(context.di); + context.push(context.es); context.push(context.bx); + context.cx = 18; +onelot2: context.push(context.cx); - context.ds = context.data.word(412); - context.si = 0; - multiput(context); + context.di = 25; + context.dx = 161; + context.ax = 0; + printdirect(context); + context._add(context.bx, context.data.word(77)); + context.cx = context.pop(); + if (--context.cx) goto onelot2; + vsync(context); + context.cl = 160; + context.ch = 160; + context.di = 25; + context.bx = 20; + multidump(context); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto endearly2; + context._sub(context.bx, 1); + if (--context.cx) goto endcredits22; + context.cx = context.pop(); +looknext2: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto gotnext2; + context._cmp(context.al, 0); + if (context.flags.z()) goto gotnext2; + goto looknext2; +gotnext2: + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto endearly; + if (--context.cx) goto endcredits21; + context.cx = 120; + hangone(context); + return; +endearly2: context.cx = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - multidump(context); -finishcurdel: - context.si = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); +endearly: return; } -static inline void useobject(Context & context) { - context.data.byte(95) = 255; - context._cmp(context.data.byte(100), 229); - if (context.flags.z()) goto alreadyuse; - context.data.byte(100) = 229; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); - context.al = 51; - commandwithob(context); -alreadyuse: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nouse; - context._and(context.ax, 1); - if (!context.flags.z()) goto douse; -nouse: +static void fadecalculation(Context & context) { + context._cmp(context.data.byte(346), 0); + if (context.flags.z()) goto nomorefading; + context.bl = context.data.byte(346); + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 768; +fadecolloop: + context.al = context.data.byte(context.si); + context.ah = context.data.byte(context.di); + context._cmp(context.al, context.ah); + if (context.flags.z()) goto gotthere; + if (context.flags.c()) goto lesscolour; + context._sub(context.data.byte(context.si), 1); + goto gotthere; +lesscolour: + context._cmp(context.bl, context.ah); + if (context.flags.z()) goto withit; + if (!context.flags.c()) goto gotthere; +withit: + context._add(context.data.byte(context.si), 1); +gotthere: + context._add(context.si, 1); + context._add(context.di, 1); + if (--context.cx) goto fadecolloop; + context._sub(context.data.byte(346), 1); return; -douse: - useroutine(context); +nomorefading: + context.data.byte(344) = 0; return; } -static inline void useroutine(Context & context) { - context._cmp(context.data.byte(184), 50); - if (context.flags.c()) goto nodream7; - context._cmp(context.data.byte(232), 0); - if (!context.flags.z()) goto powerok; - return; -powerok: - context.data.byte(232) = 0; -nodream7: - getanyad(context); - context.dx = context.ds; - context.ds = context.dx; - context.si = 2895; -checkuselist: - context.push(context.si); - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+12)); - if (!context.flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+13)); - if (!context.flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+14)); - if (!context.flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+15)); - if (!context.flags.z()) goto failed; - context._lodsw(); - context.si = context.pop(); - __dispatch_call(context, context.ax); - return; -failed: - context.si = context.pop(); - context._add(context.si, 6); - context._cmp(context.data.byte(context.si), 140); - if (!context.flags.z()) goto checkuselist; - delpointer(context); - getobtextstart(context); - findnextcolon(context); +static void greyscalesum(Context & context) { + context.es = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.cx = 256; +greysumloop1: + context.push(context.cx); + context.bx = 0; + context.al = context.data.byte(context.si); + context.ah = 0; + context.cx = 20; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.si+1); + context.ah = 0; + context.cx = 59; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.si+2); + context.ah = 0; + context.cx = 11; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = -1; +greysumloop2: + context._add(context.al, 1); + context._sub(context.bx, 100); + if (!context.flags.c()) goto greysumloop2; + context.bl = context.al; + context.al = context.bl; + context.ah = context.data.byte(348); context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; - findnextcolon(context); + context._add(context.al, context.ah); +noaddr: + context._stosb(); + context.ah = context.data.byte(347); + context.al = context.bl; context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; - context.al = context.data.byte(context.si); + if (context.flags.z()) goto noaddg; + context._add(context.al, context.ah); +noaddg: + context._stosb(); + context.ah = context.data.byte(349); + context.al = context.bl; context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; - usetext(context); - context.cx = 400; - hangonp(context); - putbackobstuff(context); - return; -cantuse2: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.di = 33; - context.bx = 100; - context.al = 63; - context.dl = 241; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - putbackobstuff(context); - context.data.byte(100) = 255; + if (context.flags.z()) goto noaddb; + context._add(context.al, context.ah); +noaddb: + context._stosb(); + context._add(context.si, 3); + context.cx = context.pop(); + if (--context.cx) goto greysumloop1; return; } -static inline void wheelsound(Context & context) { - context.al = 17; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); - return; +static void paltostartpal(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; } -static inline void runtap(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto tapwith; - withwhat(context); - return; -tapwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto fillcupfromtap; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) goto cupfromtapfull; - context.cx = 300; - context.al = 56; - showpuztext(context); - putbackobstuff(context); - return; -fillcupfromtap: - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+15) = 'F'-'A'; - context.al = 8; - playchannel1(context); - context.cx = 300; - context.al = 57; - showpuztext(context); - putbackobstuff(context); - return; -cupfromtapfull: - context.cx = 300; - context.al = 58; - showpuztext(context); - putbackobstuff(context); +static void endpaltostart(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static void startpaltoend(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static void paltoendpal(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.cx = 768/2; + while(--context.cx) context._movsw(); + return; +} + +static void allpalette(Context & context) { + context.es = context.data.word(412); + context.ds = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.cx = 768/2; + while(--context.cx) context._movsw(); + dumpcurrent(context); return; } -static inline void playguitar(Context & context) { - context.al = 14; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); +static void dumpcurrent(Context & context) { + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.ds = context.data.word(412); + vsync(context); + context.al = 0; + context.cx = 128; + showgroup(context); + vsync(context); + context.al = 128; + context.cx = 128; + showgroup(context); return; } -static inline void hotelcontrol(Context & context) { - context._cmp(context.data.byte(184), 21); - if (!context.flags.z()) goto notrightcont; - context._cmp(context.data.byte(148), 33); - if (!context.flags.z()) goto notrightcont; - showfirstuse(context); - putbackobstuff(context); +static void fadedownmon(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 64; + hangon(context); return; -notrightcont: - showseconduse(context); - putbackobstuff(context); +} + +static void fadeupmon(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 128; + hangon(context); return; } -static inline void hotelbell(Context & context) { - context.al = 12; +static void fadeupmonfirst(Context & context) { + paltostartpal(context); + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 64; + hangon(context); + context.al = 26; playchannel1(context); - showfirstuse(context); - putbackobstuff(context); + context.cx = 64; + hangon(context); return; } -static inline void opentomb(Context & context) { - context._add(context.data.byte(2), 1); - showfirstuse(context); - context.data.word(21) = 35*2; - context.data.word(23) = 1; - context.data.word(25) = 33; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void fadeupyellows(Context & context) { + paltoendpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.cx = 3*8; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context._stosb(); + context._stosw(); + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; + context.cx = 128; + hangon(context); return; } -static inline void usetrainer(Context & context) { - getanyad(context); - context._cmp(context.data.byte(context.bx+2), 4); - if (!context.flags.z()) goto notheldtrainer; - context._add(context.data.byte(2), 1); - makeworn(context); - showseconduse(context); - putbackobstuff(context); - return; -notheldtrainer: - nothelderror(context); +static void initialmoncols(Context & context) { + paltostartpal(context); + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.cx = 3*9; + context.ax = 0; + while(--context.cx) context._stosb(); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context._stosb(); + context._stosw(); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.al = 230; + context.cx = 18; + showgroup(context); return; } -static inline void nothelderror(Context & context) { - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.di = 64; - context.bx = 100; - context.al = 63; - context.ah = 1; - context.dl = 201; - printmessage2(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - putbackobstuff(context); +static void titles(Context & context) { + clearpalette(context); + biblequote(context); + intro(context); return; } -static inline void usepipe(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto pipewith; - withwhat(context); +static void endgame(Context & context) { + context.dx = 2273; + loadtemptext(context); + monkspeaking(context); + gettingshot(context); + getridoftemptext(context); + context.data.byte(387) = 7; + context.data.byte(388) = 1; + context.cx = 200; + hangon(context); return; -pipewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto fillcup; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) goto alreadyfull; +} + +static void monkspeaking(Context & context) { + context.data.byte(531) = 35; + loadroomssample(context); + context.dx = 2377; + loadintotemp(context); + clearwork(context); + showmonk(context); + worktoscreen(context); + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; + context.al = 12; + context.ah = 255; + playchannel0(context); + fadescreenups(context); context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + hangon(context); + context.al = 40; +nextmonkspeak: + context.push(context.ax); + context.ah = 0; + context.si = context.ax; + context._add(context.si, context.si); + context.es = context.data.word(466); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; +nextbit: + context.di = 36; + context.bx = 140; + context.dl = 239; + printdirect(context); + context.push(context.ax); + context.push(context.si); + context.push(context.es); + worktoscreen(context); + clearwork(context); + showmonk(context); + context.cx = 240; + hangon(context); + context.es = context.pop(); + context.si = context.pop(); + context.ax = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto nextbit; + context.ax = context.pop(); + context._add(context.al, 1); + context._cmp(context.al, 44); + if (!context.flags.z()) goto nextmonkspeak; + context.data.byte(388) = 1; + context.data.byte(387) = 7; + fadescreendowns(context); + context.cx = 300; + hangon(context); + getridoftemp(context); + return; +} + +static void showmonk(Context & context) { + context.al = 0; + context.ah = 128; + context.di = 160; + context.bx = 72; + context.ds = context.data.word(458); + showframe(context); + return; +} + +static void gettingshot(Context & context) { + context.data.byte(188) = 55; + clearpalette(context); + loadintroroom(context); + fadescreenups(context); + context.data.byte(387) = 0; + context.data.byte(388) = -1; + runendseq(context); + clearbeforeload(context); return; -fillcup: - context.cx = 300; - context.al = 36; - showpuztext(context); - putbackobstuff(context); - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+15) = 'F'-'A'; +} + +static void credits(Context & context) { + clearpalette(context); + realcredits(context); return; -alreadyfull: - context.cx = 300; - context.al = 35; - showpuztext(context); - putbackobstuff(context); +} + +static void biblequote(Context & context) { + mode640x480(context); + context.dx = 2390; + showpcx(context); + fadescreenups(context); + context.cx = 80; + hangone(context); + context.cx = 560; + hangone(context); + fadescreendowns(context); + context.cx = 200; + hangone(context); + cancelch0(context); return; } -static inline void usefullcart(Context & context) { - context._add(context.data.byte(2), 1); - context.al = 2; - context.ah = context.data.byte(185); - context._add(context.ah, 6); - turnanypathon(context); - context.data.byte(475) = 4; - context.data.byte(133) = 4; - context.data.byte(135) = 4; - context.data.byte(477) = 4; - findxyfrompath(context); - context.data.byte(187) = 1; - showfirstuse(context); - context.data.word(21) = 72*2; - context.data.word(23) = 58; - context.data.word(25) = 142; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void hangone(Context & context) { +hangonloope: + context.push(context.cx); + vsync(context); + context.cx = context.pop(); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto hangonearly; + if (--context.cx) goto hangonloope; + return; +hangonearly: + context.ax = context.pop(); + context.ax = context.pop(); return; } -static inline void useplinth(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto plinthwith; - withwhat(context); +static void intro(Context & context) { + context.dx = 2260; + loadtemptext(context); + loadpalfromiff(context); + setmode(context); + context.data.byte(188) = 50; + clearpalette(context); + loadintroroom(context); + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; + context.al = 12; + context.ah = 255; + playchannel0(context); + fadescreenups(context); + runintroseq(context); + clearbeforeload(context); + context.data.byte(188) = 52; + loadintroroom(context); + runintroseq(context); + clearbeforeload(context); + context.data.byte(188) = 53; + loadintroroom(context); + runintroseq(context); + clearbeforeload(context); + allpalette(context); + context.data.byte(188) = 54; + loadintroroom(context); + runintroseq(context); + getridoftemptext(context); + clearbeforeload(context); return; -plinthwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'D'; - context.ch = 'K'; - context.dl = 'E'; - context.dh = 'Y'; - compare(context); - if (context.flags.z()) goto isrightkey; - showfirstuse(context); - putbackobstuff(context); +} + +static void runintroseq(Context & context) { + context.data.byte(103) = 0; +moreintroseq: + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + spriteupdate(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + deleverything(context); + printsprites(context); + reelsonscreen(context); + afterintroroom(context); + usetimedtext(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + dumpmap(context); + dumptimedtext(context); + vsync(context); + context._cmp(context.data.byte(392), 1); + if (context.flags.z()) goto earlyendrun; + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto moreintroseq; return; -isrightkey: - context._add(context.data.byte(2), 1); - showseconduse(context); - context.data.word(21) = 220; - context.data.word(23) = 0; - context.data.word(25) = 104; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.al = context.data.byte(67); - context.data.byte(188) = context.al; +earlyendrun: + context.ax = context.pop(); + context.ax = context.pop(); + getridoftemptext(context); + clearbeforeload(context); return; } -static inline void chewy(Context & context) { - showfirstuse(context); - getanyad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(103) = 1; +static void runendseq(Context & context) { + atmospheres(context); + context.data.byte(103) = 0; +moreendseq: + vsync(context); + spriteupdate(context); + vsync(context); + deleverything(context); + printsprites(context); + reelsonscreen(context); + afterintroroom(context); + usetimedtext(context); + vsync(context); + dumpmap(context); + dumptimedtext(context); + vsync(context); + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto moreendseq; return; } -static inline void useladder(Context & context) { - showfirstuse(context); - context._sub(context.data.byte(148), 11); - findroominloc(context); - context.data.byte(133) = 6; - context.data.byte(135) = 6; - context.data.byte(475) = 0; - context.data.byte(478) = 0; - context.data.byte(477) = 0; - findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; +static void loadintroroom(Context & context) { + context.data.byte(139) = 0; + context.data.byte(9) = 255; + loadroom(context); + context.data.word(121) = 72; + context.data.word(123) = 16; + clearsprites(context); + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; + clearwork(context); + context.data.byte(62) = 1; + drawfloor(context); + reelsonscreen(context); + spriteupdate(context); + printsprites(context); + worktoscreen(context); return; } -static inline void useladderb(Context & context) { - showfirstuse(context); - context._add(context.data.byte(148), 11); - findroominloc(context); - context.data.byte(133) = 2; - context.data.byte(135) = 2; - context.data.byte(475) = 1; - context.data.byte(478) = 1; - context.data.byte(477) = 1; - findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; +static void realcredits(Context & context) { + context.data.byte(531) = 33; + loadroomssample(context); + context.data.byte(386) = 0; + mode640x480(context); + context.cx = 35; + hangon(context); + context.dx = 2403; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2416; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2429; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2442; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2455; + showpcx(context); + context.al = 12; + context.ah = 0; + playchannel0(context); + context.cx = 2; + hangone(context); + allpalette(context); + context.cx = 80; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); + context.dx = 2468; + showpcx(context); + fadescreenups(context); + context.cx = 60; + hangone(context); + context.al = 13; + context.ah = 0; + playchannel0(context); + context.cx = 350; + hangone(context); + fadescreendowns(context); + context.cx = 256; + hangone(context); return; } -static inline void slabdoora(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 13; - context._cmp(context.data.byte(66), 3); - if (!context.flags.z()) goto slabawrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 42; - context.data.byte(188) = 47; - return; -slabawrong: - context.data.word(21) = 40; - context.data.word(25) = 34; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +static void printchar(Context & context) { + context._cmp(context.al, 255); + if (context.flags.z()) goto ignoreit; + context.push(context.si); + context.push(context.bx); + context.push(context.di); + context._sub(context.bx, 3); + context.push(context.ax); + context._sub(context.al, 32); + context.ah = 0; + context._add(context.ax, context.data.word(71)); + showframe(context); + context.ax = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._cmp(context.data.byte(72), 0); + if (!context.flags.z()) goto nokern; + kernchars(context); +nokern: + context.push(context.cx); + context.ch = 0; + context._add(context.di, context.cx); + context.cx = context.pop(); +ignoreit: return; } -static inline void slabdoorb(Context & context) { - context._cmp(context.data.byte(66), 1); - if (!context.flags.z()) goto slabbwrong; - context.al = 'S'; - context.ah = 'H'; - context.cl = 'L'; - context.ch = 'D'; - isryanholding(context); - if (!context.flags.z()) goto gotcrystal; - context.al = 44; - context.cx = 200; - showpuztext(context); - putbackobstuff(context); +static void kernchars(Context & context) { + context._cmp(context.al, 'a'); + if (context.flags.z()) goto iskern; + context._cmp(context.al, 'u'); + if (context.flags.z()) goto iskern; return; -gotcrystal: - showfirstuse(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 60; - context.data.word(25) = 71; - context.data.byte(188) = 47; +iskern: + context._cmp(context.ah, 'n'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 't'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'r'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'i'); + if (context.flags.z()) goto kernit; + context._cmp(context.ah, 'l'); + if (context.flags.z()) goto kernit; return; -slabbwrong: - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 40; - context.data.word(25) = 63; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +kernit: + context._sub(context.cl, 1); return; } -static inline void slabdoord(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 75; - context._cmp(context.data.byte(66), 0); - if (!context.flags.z()) goto slabcwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 102; - context.data.byte(188) = 47; +static void printslow(Context & context) { + context.data.byte(231) = 1; + context.data.byte(234) = 3; + context.ds = context.data.word(404); +printloopslow6: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloopslow5: + context.push(context.cx); + context.push(context.si); + context.push(context.es); + context.ax = context.data.word(context.si); + context.push(context.bx); + context.push(context.cx); + context.push(context.es); + context.push(context.si); + context.push(context.ds); + modifychar(context); + printboth(context); + context.ds = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.data.word(context.si+1); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishslow; + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishslow; + context._cmp(context.cl, 1); + if (context.flags.z()) goto afterslow; + context.push(context.di); + context.push(context.ds); + context.push(context.bx); + context.push(context.cx); + context.push(context.es); + context.push(context.si); + modifychar(context); + context.data.word(71) = 91; + printboth(context); + context.data.word(71) = 0; + context.si = context.pop(); + context.es = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + waitframes(context); + context._cmp(context.ax, 0); + if (context.flags.z()) goto keepgoing; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto finishslow2; +keepgoing: + waitframes(context); +noslow: + context._cmp(context.ax, 0); + if (context.flags.z()) goto afterslow; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto finishslow2; +afterslow: + context.es = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 1); + if (--context.cx) goto printloopslow5; + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 10); + goto printloopslow6; +finishslow: + context.cx = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.al = 0; return; -slabcwrong: - context.data.word(21) = 40; - context.data.word(25) = 94; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +finishslow2: + context.cx = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.al = 1; return; } -static inline void slabdoorc(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 108; - context._cmp(context.data.byte(66), 4); - if (!context.flags.z()) goto slabdwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 135; - context.data.byte(188) = 47; - return; -slabdwrong: - context.data.word(21) = 40; - context.data.word(25) = 127; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +static void waitframes(Context & context) { + context.push(context.di); + context.push(context.bx); + context.push(context.es); + context.push(context.si); + context.push(context.ds); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + delpointer(context); + context.ax = context.data.word(202); + context.ds = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); return; } -static inline void slabdoore(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 141; - context._cmp(context.data.byte(66), 5); - if (!context.flags.z()) goto slabewrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 168; - context.data.byte(188) = 47; - return; -slabewrong: - context.data.word(21) = 40; - context.data.word(25) = 160; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +static void printboth(Context & context) { + context.push(context.ax); + context.push(context.cx); + context.push(context.bx); + context.push(context.di); + printchar(context); + context.ax = context.pop(); + context.push(context.di); + context.di = context.ax; + multidump(context); + context.di = context.pop(); + context.bx = context.pop(); + context.cx = context.pop(); + context.ax = context.pop(); return; } -static inline void slabdoorf(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 171; - context._cmp(context.data.byte(66), 2); - if (!context.flags.z()) goto slabfwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 197; - context.data.byte(188) = 47; +static void printdirect(Context & context) { + context.data.word(84) = context.di; + context.ds = context.data.word(268); +printloop6: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloop5: + context.ax = context.data.word(context.si); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishdirct; + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishdirct; + context.push(context.cx); + context.push(context.es); + modifychar(context); + printchar(context); + context.data.word(84) = context.di; + context.es = context.pop(); + context.cx = context.pop(); + if (--context.cx) goto printloop5; + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._add(context.bx, context.data.word(77)); + goto printloop6; +finishdirct: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); return; -slabfwrong: - context.data.word(21) = 40; - context.data.word(25) = 189; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +} + +static void monprint(Context & context) { + context.data.byte(72) = 1; + context.si = context.bx; + context.dl = 166; + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); +printloop8: + context.push(context.bx); + context.push(context.di); + context.push(context.dx); + getnumber(context); + context.ch = 0; +printloop7: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishmon2; + context._cmp(context.al, 0); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, 34); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, '='); + if (context.flags.z()) goto finishmon; + context._cmp(context.al, '%'); + if (!context.flags.z()) goto nottrigger; + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._add(context.si, 1); + goto finishmon; +nottrigger: + context.push(context.cx); + context.push(context.es); + modifychar(context); + printchar(context); + context.data.word(312) = context.di; + context.data.word(314) = context.bx; + context.data.word(138) = 1; + printcurs(context); + vsync(context); + context.push(context.si); + context.push(context.dx); + context.push(context.ds); + context.push(context.es); + context.push(context.bx); + context.push(context.di); + lockmon(context); + context.di = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.dx = context.pop(); + context.si = context.pop(); + delcurs(context); + context.es = context.pop(); + context.cx = context.pop(); + if (--context.cx) goto printloop7; +finishmon2: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + scrollmonitor(context); + context.data.word(312) = context.di; + goto printloop8; +finishmon: + context.dx = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context._cmp(context.al, '%'); + if (!context.flags.z()) goto nottrigger2; + context.data.byte(55) = context.ah; +nottrigger2: + context.data.word(312) = context.di; + scrollmonitor(context); + context.bx = context.si; + context.data.byte(72) = 0; return; } -static inline void useslab(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto slabwith; - withwhat(context); +static void getnumber(Context & context) { + context.cx = 0; + context.push(context.si); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.push(context.es); + context.di = context.si; +wordloop: + context.push(context.cx); + context.push(context.dx); + getnextword(context); + context.dx = context.pop(); + context.cx = context.pop(); + context._cmp(context.al, 1); + if (context.flags.z()) goto endoftext; + context.al = context.cl; + context.ah = 0; + context.push(context.bx); + context.bh = 0; + context._add(context.ax, context.bx); + context.bx = context.pop(); + context._sub(context.ax, 10); + context.dh = 0; + context._cmp(context.ax, context.dx); + if (!context.flags.c()) goto gotoverend; + context._add(context.cl, context.bl); + context._add(context.ch, context.bh); + goto wordloop; +gotoverend: + context.al = context.dl; + context._and(context.al, 1); + if (context.flags.z()) goto notcentre; + context.push(context.cx); + context.al = context.dl; + context._and(context.al, 0xfe); + context.ah = 0; + context.ch = 0; + context._sub(context.ax, context.cx); + context._add(context.ax, 20); + context._shr(context.ax, 1); + context.cx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._add(context.di, context.ax); + context.cl = context.ch; return; -slabwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'J'; - context.ch = 'E'; - context.dl = 'W'; - context.dh = 'L'; - compare(context); - if (context.flags.z()) goto nextslab; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +notcentre: + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context.cl = context.ch; + return; +endoftext: + context.al = context.cl; + context.ah = 0; + context.push(context.bx); + context.bh = 0; + context._add(context.ax, context.bx); + context.bx = context.pop(); + context._sub(context.ax, 10); + context.dh = 0; + context._cmp(context.ax, context.dx); + if (!context.flags.c()) goto gotoverend2; + context._add(context.cl, context.bl); + context._add(context.ch, context.bh); +gotoverend2: + context.al = context.dl; + context._and(context.al, 1); + if (context.flags.z()) goto notcent2; + context.push(context.cx); + context.al = context.dl; + context._and(context.al, 0xfe); + context._add(context.al, 2); + context.ah = 0; + context.ch = 0; + context._add(context.ax, 20); + context._sub(context.ax, context.cx); + context._shr(context.ax, 1); + context.cx = context.pop(); + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context._add(context.di, context.ax); + context.cl = context.ch; return; -nextslab: - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(99); - context.push(context.ax); - removesetobject(context); - context.ax = context.pop(); - context._add(context.al, 1); - context.push(context.ax); - placesetobject(context); - context.ax = context.pop(); - context._cmp(context.al, 54); - if (!context.flags.z()) goto notlastslab; - context.al = 0; - turnpathon(context); - context.data.word(21) = 22; - context.data.word(23) = 35; - context.data.word(25) = 48; - context.data.byte(27) = 1; - context.data.byte(26) = 1; -notlastslab: - context._add(context.data.byte(2), 1); - showfirstuse(context); - context.data.byte(103) = 1; +notcent2: + context.es = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.si = context.pop(); + context.cl = context.ch; return; } -static inline void usecart(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto cartwith; - withwhat(context); - return; -cartwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'R'; - context.ch = 'O'; - context.dl = 'C'; - context.dh = 'K'; - compare(context); - if (context.flags.z()) goto nextcart; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -nextcart: - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(99); +static void getnextword(Context & context) { + context.bx = 0; +getloop: + context.ax = context.data.word(context.di); + context._add(context.di, 1); + context._add(context.bh, 1); + context._cmp(context.al, ':'); + if (context.flags.z()) goto endall; + context._cmp(context.al, 0); + if (context.flags.z()) goto endall; + context._cmp(context.al, 32); + if (context.flags.z()) goto endword; + modifychar(context); + context._cmp(context.al, 255); + if (context.flags.z()) goto getloop; context.push(context.ax); - removesetobject(context); + context._sub(context.al, 32); + context.ah = 0; + context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.cl = context.data.byte(context.si+0); context.ax = context.pop(); - context._add(context.al, 1); - placesetobject(context); - context._add(context.data.byte(2), 1); - context.al = 17; - playchannel1(context); - showfirstuse(context); - context.data.byte(103) = 1; - return; -} - -static inline void useclearbox(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto clearboxwith; - withwhat(context); - return; -clearboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'R'; - context.ch = 'A'; - context.dl = 'I'; - context.dh = 'L'; - compare(context); - if (context.flags.z()) goto openbox; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + kernchars(context); + context._add(context.bl, context.cl); + goto getloop; +endword: + context._add(context.bl, 6); + context.al = 0; return; -openbox: - context._add(context.data.byte(2), 1); - showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 67; - context.data.word(25) = 105; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +endall: + context._add(context.bl, 6); + context.al = 1; return; } -static inline void usecoveredbox(Context & context) { - context._add(context.data.byte(2), 1); - showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 41; - context.data.word(25) = 66; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void modifychar(Context & context) { + context._cmp(context.al, 128); + if (context.flags.c()) goto nomod; + context._cmp(context.al, 160); + if (!context.flags.z()) goto not160; + context.al = 'Z'+1; return; -} - -static inline void userailing(Context & context) { - showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.data.byte(56) = 4; +not160: + context._cmp(context.al, 130); + if (!context.flags.z()) goto not130; + context.al = 'Z'+2; return; -} - -static inline void useopenbox(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto openboxwith; - withwhat(context); +not130: + context._cmp(context.al, 161); + if (!context.flags.z()) goto not161; + context.al = 'Z'+3; return; -openboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) goto destoryopenbox; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto openboxwrong; - showfirstuse(context); +not161: + context._cmp(context.al, 162); + if (!context.flags.z()) goto not162; + context.al = 'Z'+4; return; -destoryopenbox: - context._add(context.data.byte(2), 1); - context.cx = 300; - context.al = 37; - showpuztext(context); - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+15) = 'E'-'A'; - context.data.word(21) = 140; - context.data.word(23) = 105; - context.data.word(25) = 181; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.al = 4; - turnpathon(context); - context.data.byte(103) = 1; +not162: + context._cmp(context.al, 163); + if (!context.flags.z()) goto not163; + context.al = 'Z'+5; return; -openboxwrong: - context.cx = 300; - context.al = 38; - showpuztext(context); - putbackobstuff(context); +not163: + context._cmp(context.al, 164); + if (!context.flags.z()) goto not164; + context.al = 'Z'+6; return; -} - -static inline void wearwatch(Context & context) { - context._cmp(context.data.byte(3), 1); - if (context.flags.z()) goto wearingwatch; - showfirstuse(context); - context.data.byte(3) = 1; - context.data.byte(103) = 1; - getanyad(context); - makeworn(context); +not164: + context._cmp(context.al, 165); + if (!context.flags.z()) goto not165; + context.al = ','-1; return; -wearingwatch: - showseconduse(context); - putbackobstuff(context); +not165: + context._cmp(context.al, 168); + if (!context.flags.z()) goto not168; + context.al = 'A'-1; return; -} - -static inline void wearshades(Context & context) { - context._cmp(context.data.byte(4), 1); - if (context.flags.z()) goto wearingshades; - context.data.byte(4) = 1; - showfirstuse(context); - context.data.byte(103) = 1; - getanyad(context); - makeworn(context); +not168: + context._cmp(context.al, 173); + if (!context.flags.z()) goto not173; + context.al = 'A'-4; + return; +not173: + context._cmp(context.al, 129); + if (!context.flags.z()) goto not129; + context.al = 'A'-5; +not129: return; -wearingshades: - showseconduse(context); - putbackobstuff(context); +nomod: return; } -static inline void sitdowninbar(Context & context) { - context._cmp(context.data.byte(32), -1); - if (!context.flags.z()) goto satdown; - showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 55; - context.data.word(25) = 71; - context.data.word(29) = 73; - context.data.word(31) = 83; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - return; -satdown: - showseconduse(context); - putbackobstuff(context); +static void fillryan(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32; + findallryan(context); + context.si = 0+(228*13)+32; + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 20; + context._mul(context.cx); + context._add(context.si, context.ax); + context.di = 80; + context.bx = 58; + context.cx = 2; +ryanloop2: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.cx = 5; +ryanloop1: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.ax = context.data.word(context.si); + context._add(context.si, 2); + context.push(context.si); + context.push(context.es); + obtoinv(context); + context.es = context.pop(); + context.si = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 44); + if (--context.cx) goto ryanloop1; + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 44); + if (--context.cx) goto ryanloop2; + showryanpage(context); return; } -static inline void usechurchhole(Context & context) { - showfirstuse(context); - context.data.byte(103) = 1; - context.data.word(21) = 28; - context.data.word(23) = 13; - context.data.word(25) = 26; - context.data.byte(27) = 1; - context.data.byte(26) = 1; +static void fillopen(Context & context) { + deltextline(context); + getopenedsize(context); + context._cmp(context.ah, 4); + if (context.flags.c()) goto lessthanapage; + context.ah = 4; +lessthanapage: + context.al = 1; + context.push(context.ax); + context.es = context.data.word(412); + context.di = 0+(228*13); + findallopen(context); + context.si = 0+(228*13); + context.di = 80; + context.bx = 58+96; + context.cx = context.pop(); +openloop1: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context.ax = context.data.word(context.si); + context._add(context.si, 2); + context.push(context.si); + context.push(context.es); + context._cmp(context.ch, context.cl); + if (context.flags.c()) goto nextopenslot; + obtoinv(context); +nextopenslot: + context.es = context.pop(); + context.si = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.di, 44); + context._add(context.cl, 1); + context._cmp(context.cl, 5); + if (!context.flags.z()) goto openloop1; + undertextline(context); return; } -static inline void usehole(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto holewith; - withwhat(context); - return; -holewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'H'; - context.ch = 'N'; - context.dl = 'D'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) goto righthand; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -righthand: - showfirstuse(context); - context.al = 86; - removesetobject(context); - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(47) = 1; - context.data.byte(103) = 1; +static void findallryan(Context & context) { + context.push(context.di); + context.cx = 30; + context.ax = 0x0ffff; + while(--context.cx) context._stosw(); + context.di = context.pop(); + context.cl = 4; + context.ds = context.data.word(398); + context.bx = 0+2080+30000; + context.ch = 0; +findryanloop: + context._cmp(context.data.byte(context.bx+2), context.cl); + if (!context.flags.z()) goto notinryaninv; + context._cmp(context.data.byte(context.bx+3), 255); + if (!context.flags.z()) goto notinryaninv; + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 4; + context._stosw(); + context.di = context.pop(); +notinryaninv: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 114); + if (!context.flags.z()) goto findryanloop; return; } -static inline void usealtar(Context & context) { - context.al = 'C'; - context.ah = 'N'; - context.cl = 'D'; - context.ch = 'A'; - findexobject(context); - context._cmp(context.al, 114); - if (context.flags.z()) goto thingsonaltar; - context.al = 'C'; - context.ah = 'N'; - context.cl = 'D'; - context.ch = 'B'; - findexobject(context); - context._cmp(context.al, 114); - if (context.flags.z()) goto thingsonaltar; - context._cmp(context.data.byte(47), 1); - if (context.flags.z()) goto movealtar; - context.cx = 300; - context.al = 23; - showpuztext(context); - context.data.byte(103) = 1; - return; -movealtar: - context._add(context.data.byte(2), 1); - showseconduse(context); - context.data.word(21) = 160; - context.data.word(23) = 81; - context.data.word(25) = 174; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.al = 47; - context.bl = 52; - context.bh = 76; - context.cx = 32; - context.dx = 98; - setuptimeduse(context); - context.data.byte(103) = 1; - return; -thingsonaltar: - showfirstuse(context); - context.data.byte(103) = 1; +static void findallopen(Context & context) { + context.push(context.di); + context.cx = 16; + context.ax = 0x0ffff; + while(--context.cx) context._stosw(); + context.di = context.pop(); + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); + context.ds = context.data.word(398); + context.bx = 0+2080+30000; + context.ch = 0; +findopen1: + context._cmp(context.data.byte(context.bx+3), context.cl); + if (!context.flags.z()) goto findopen2; + context._cmp(context.data.byte(context.bx+2), context.dl); + if (!context.flags.z()) goto findopen2; + context._cmp(context.data.byte(111), 4); + if (context.flags.z()) goto noloccheck; + context.al = context.data.byte(context.bx+5); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto findopen2; +noloccheck: + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 4; + context._stosw(); + context.di = context.pop(); +findopen2: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 114); + if (!context.flags.z()) goto findopen1; + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); + context.push(context.dx); + context.ds = context.data.word(426); + context.dx = context.pop(); + context.bx = 0; + context.ch = 0; +findopen1a: + context._cmp(context.data.byte(context.bx+3), context.cl); + if (!context.flags.z()) goto findopen2a; + context._cmp(context.data.byte(context.bx+2), context.dl); + if (!context.flags.z()) goto findopen2a; + context.al = context.data.byte(context.bx+4); + context.ah = 0; + context.push(context.di); + context._add(context.di, context.ax); + context._add(context.di, context.ax); + context.al = context.ch; + context.ah = 2; + context._stosw(); + context.di = context.pop(); +findopen2a: + context._add(context.bx, 16); + context._add(context.ch, 1); + context._cmp(context.ch, 80); + if (!context.flags.z()) goto findopen1a; return; } -static inline void opentvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto tvdoorwith; - withwhat(context); - return; -tvdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'U'; - context.ch = 'L'; - context.dl = 'O'; - context.dh = 'K'; - compare(context); - if (context.flags.z()) goto keyontv; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -keyontv: - showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; +static void obtoinv(Context & context) { + context.push(context.bx); + context.push(context.es); + context.push(context.si); + context.push(context.ax); + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.ds = context.data.word(408); + context._sub(context.di, 2); + context._sub(context.bx, 1); + context.al = 10; + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto finishfill; + context.push(context.bx); + context.push(context.di); + context.push(context.ax); + context.ds = context.data.word(398); + context._cmp(context.ah, 4); + if (context.flags.z()) goto isanextra; + context.ds = context.data.word(446); +isanextra: + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + context._add(context.bx, 19); + context._add(context.di, 18); + showframe(context); + context.ax = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.push(context.bx); + getanyaddir(context); + isitworn(context); + context.bx = context.pop(); + if (!context.flags.z()) goto finishfill; + context.ds = context.data.word(408); + context._sub(context.di, 3); + context._sub(context.bx, 2); + context.al = 7; + context.ah = 0; + showframe(context); +finishfill: + context.ax = context.pop(); + context.si = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); return; } -static inline void usedryer(Context & context) { - context.al = 12; - playchannel1(context); - showfirstuse(context); - context.data.byte(103) = 1; +static void isitworn(Context & context) { + context.al = context.data.byte(context.bx+12); + context._cmp(context.al, 'W'-'A'); + if (!context.flags.z()) goto notworn; + context.al = context.data.byte(context.bx+13); + context._cmp(context.al, 'E'-'A'); +notworn: return; } -static inline void openlouis(Context & context) { - context.al = 5; - context.ah = 2; - context.cl = 3; - context.ch = 8; - entercode(context); - context.data.byte(103) = 1; +static void makeworn(Context & context) { + context.data.byte(context.bx+12) = 'W'-'A'; + context.data.byte(context.bx+13) = 'E'-'A'; return; } -static inline void nextcolon(Context & context) { -lookcolon: - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context._cmp(context.al, ':'); - if (!context.flags.z()) goto lookcolon; +static void examineob(Context & context) { + context.data.byte(234) = 0; + context.data.word(328) = 0; +examineagain: + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +waitexam: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.data.byte(103) = 0; + context.bx = 2494; + context._cmp(context.data.byte(104), 0); + if (context.flags.z()) goto notuseinv; + context.bx = 2556; + context._cmp(context.data.byte(104), 1); + if (context.flags.z()) goto notuseinv; + context.bx = 2618; +notuseinv: + checkcoords(context); + context._cmp(context.data.byte(108), 0); + if (context.flags.z()) goto norex; + goto examineagain; +norex: + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitexam; + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatching; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto justgetback; +iswatching: + makemainscreen(context); + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; +justgetback: + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; } -static inline void openyourneighbour(Context & context) { - context.al = 255; - context.ah = 255; - context.cl = 255; - context.ch = 255; - entercode(context); - context.data.byte(103) = 1; +static void makemainscreen(Context & context) { + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + spriteupdate(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + context.data.byte(100) = 255; + animpointer(context); + worktoscreenm(context); + context.data.byte(100) = 200; + context.data.byte(131) = 0; return; } -static inline void usewindow(Context & context) { - context._cmp(context.data.byte(475), 6); - if (!context.flags.z()) goto notonbalc; - context._add(context.data.byte(2), 1); - showfirstuse(context); - context.data.byte(188) = 29; - context.data.byte(103) = 1; +static void getbackfromob(Context & context) { + context._cmp(context.data.byte(106), 1); + if (!context.flags.z()) goto notheldob; + blank(context); return; -notonbalc: - showseconduse(context); - putbackobstuff(context); +notheldob: + getback1(context); return; } -static inline void usebalcony(Context & context) { - showfirstuse(context); - context.al = 6; - turnpathon(context); - context.al = 0; - turnpathoff(context); - context.al = 1; - turnpathoff(context); - context.al = 2; - turnpathoff(context); - context.al = 3; - turnpathoff(context); - context.al = 4; - turnpathoff(context); - context.al = 5; - turnpathoff(context); - context._add(context.data.byte(2), 1); - context.data.byte(475) = 6; - context.data.byte(478) = 6; - context.data.byte(477) = 6; - findxyfrompath(context); - switchryanoff(context); - context.data.byte(187) = 1; - context.data.word(21) = 30*2; - context.data.word(23) = 183; - context.data.word(25) = 212; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void incryanpage(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyincryan; + context.data.byte(100) = 222; + context.al = 31; + commandonly(context); +alreadyincryan: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noincryan; + context._and(context.ax, 1); + if (!context.flags.z()) goto doincryan; +noincryan: return; -} - -static inline void openryan(Context & context) { - context.al = 5; - context.ah = 1; - context.cl = 0; - context.ch = 6; - entercode(context); - context.data.byte(103) = 1; +doincryan: + context.ax = context.data.word(198); + context._sub(context.ax, 80+167); + context.data.byte(19) = -1; +findnewpage: + context._add(context.data.byte(19), 1); + context._sub(context.ax, 18); + if (!context.flags.c()) goto findnewpage; + delpointer(context); + fillryan(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void openpoolboss(Context & context) { - context.al = 5; - context.ah = 2; - context.cl = 2; - context.ch = 2; - entercode(context); - context.data.byte(103) = 1; +static void openinv(Context & context) { + context.data.byte(104) = 1; + context.al = 61; + context.di = 80; + context.bx = 58-10; + context.dl = 240; + printmessage(context); + fillryan(context); + context.data.byte(100) = 255; return; } -static inline void openeden(Context & context) { - context.al = 2; - context.ah = 8; - context.cl = 6; - context.ch = 5; - entercode(context); - context.data.byte(103) = 1; +static void showryanpage(Context & context) { + context.ds = context.data.word(408); + context.di = 80+167; + context.bx = 58-12; + context.al = 12; + context.ah = 0; + showframe(context); + context.al = 13; + context._add(context.al, context.data.byte(19)); + context.push(context.ax); + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 18; + context._mul(context.cx); + context.ds = context.data.word(408); + context.di = 80+167; + context._add(context.di, context.ax); + context.bx = 58-12; + context.ax = context.pop(); + context.ah = 0; + showframe(context); return; } -static inline void opensarters(Context & context) { - context.al = 7; - context.ah = 8; - context.cl = 3; - context.ch = 3; - entercode(context); - context.data.byte(103) = 1; +static void openob(Context & context) { + context.al = context.data.byte(110); + context.ah = context.data.byte(111); + context.di = 5674; + copyname(context); + context.di = 80; + context.bx = 58+86; + context.al = 62; + context.dl = 240; + printmessage(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 58+86; + context.es = context.cs; + context.si = 5674; + context.dl = 220; + context.al = 0; + context.ah = 0; + printdirect(context); + fillopen(context); + getopenedsize(context); + context.al = context.ah; + context.ah = 0; + context.cx = 44; + context._mul(context.cx); + context._add(context.ax, 80); + context.bx = 2588; + context.data.word(context.bx) = context.ax; return; } -static inline void isitright(Context & context) { - context.bx = context.ds; - context.es = context.bx; - context.bx = 8350; - context._cmp(context.data.byte(context.bx+0), context.al); - if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+1), context.ah); - if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+2), context.cl); - if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+3), context.ch); -notright: +static void obicons(Context & context) { + context.al = context.data.byte(99); + getanyad(context); + context._cmp(context.al, 255); + if (context.flags.z()) goto cantopenit; + context.ds = context.data.word(410); + context.di = 210; + context.bx = 1; + context.al = 4; + context.ah = 0; + showframe(context); +cantopenit: + context.ds = context.data.word(410); + context.di = 260; + context.bx = 1; + context.al = 1; + context.ah = 0; + showframe(context); return; } -static inline void drawitall(Context & context) { - createpanel(context); - drawfloor(context); - printsprites(context); - showicon(context); +static void examicon(Context & context) { + context.ds = context.data.word(410); + context.di = 254; + context.bx = 5; + context.al = 3; + context.ah = 0; + showframe(context); return; } -static inline void openhoteldoor(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto hoteldoorwith; - withwhat(context); +static void obpicture(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context._cmp(context.ah, 1); + if (context.flags.z()) goto setframe; + context._cmp(context.ah, 4); + if (context.flags.z()) goto exframe; + context.ds = context.data.word(446); + context.di = 160; + context.bx = 68; + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + showframe(context); return; -hoteldoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) goto keyonhotel1; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +setframe: return; -keyonhotel1: - context.al = 16; - playchannel1(context); - showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; +exframe: + context.ds = context.data.word(398); + context.di = 160; + context.bx = 68; + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 128; + showframe(context); return; } -static inline void openhoteldoor2(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto hoteldoorwith2; - withwhat(context); - return; -hoteldoorwith2: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) goto keyonhotel2; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -keyonhotel2: - context.al = 16; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); +static void describeob(Context & context) { + getobtextstart(context); + context.di = 33; + context.bx = 92; + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto notsetd; + context.bx = 82; +notsetd: + context.dl = 241; + context.ah = 16; + context.data.word(71) = 91+91; + printdirect(context); + context.data.word(71) = 0; + context.di = 36; + context.bx = 104; + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto notsetd2; + context.bx = 94; +notsetd2: + context.dl = 241; + context.ah = 0; + printdirect(context); + context.push(context.bx); + obsthatdothings(context); + context.bx = context.pop(); + additionaltext(context); return; } -static inline void grafittidoor(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto grafwith; - withwhat(context); - return; -grafwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'A'; - context.ch = 'P'; - context.dl = 'E'; - context.dh = 'N'; +static void additionaltext(Context & context) { + context._add(context.bx, 10); + context.push(context.bx); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; compare(context); - if (context.flags.z()) goto dograf; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + if (context.flags.z()) goto emptycup; + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto fullcup; + context.bx = context.pop(); return; -dograf: - showfirstuse(context); - putbackobstuff(context); +emptycup: + context.al = 40; + findpuztext(context); + context.bx = context.pop(); + context.di = 36; + context.dl = 241; + context.ah = 0; + printdirect(context); + return; +fullcup: + context.al = 39; + findpuztext(context); + context.bx = context.pop(); + context.di = 36; + context.dl = 241; + context.ah = 0; + printdirect(context); return; } -static inline void trapdoor(Context & context) { - context._add(context.data.byte(2), 1); - showfirstuse(context); - switchryanoff(context); - context.data.word(21) = 20*2; - context.data.word(23) = 181; - context.data.word(25) = 197; - context.data.byte(188) = 26; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void obsthatdothings(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.cl = 'M'; + context.ch = 'E'; + context.dl = 'M'; + context.dh = 'B'; + compare(context); + if (!context.flags.z()) goto notlouiscard; + context.al = 4; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto seencard; + context.al = 4; + setlocation(context); + lookatcard(context); +seencard: + return; +notlouiscard: return; } -static inline void callhotellift(Context & context) { - context.al = 12; - playchannel1(context); - showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; - context.data.byte(478) = 5; - context.data.byte(477) = 5; - autosetwalk(context); - context.al = 4; - turnpathon(context); +static void getobtextstart(Context & context) { + context.es = context.data.word(438); + context.si = 0; + context.cx = 0+(82*2); + context._cmp(context.data.byte(102), 2); + if (context.flags.z()) goto describe; + context.es = context.data.word(440); + context.si = 0; + context.cx = 0+(130*2); + context._cmp(context.data.byte(102), 1); + if (context.flags.z()) goto describe; + context.es = context.data.word(398); + context.si = 0+2080+30000+(16*114); + context.cx = 0+2080+30000+(16*114)+((114+2)*2); +describe: + context.al = context.data.byte(99); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context.bx = context.ax; +tryagain: + context.push(context.si); + findnextcolon(context); + context.al = context.data.byte(context.si); + context.cx = context.si; + context.si = context.pop(); + context._cmp(context.data.byte(102), 1); + if (!context.flags.z()) goto cantmakeoneup; + context._cmp(context.al, 0); + if (context.flags.z()) goto findsometext; + context._cmp(context.al, ':'); + if (context.flags.z()) goto findsometext; +cantmakeoneup: + return; +findsometext: + searchforsame(context); + goto tryagain; return; } -static inline void calledenslift(Context & context) { - showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; - context.al = 2; - turnpathon(context); +static void searchforsame(Context & context) { + context.si = context.cx; +searchagain: + context._add(context.si, 1); + context.al = context.data.byte(context.bx); +search: + context._cmp(context.data.byte(context.si), context.al); + if (context.flags.z()) goto gotstartletter; + context._add(context.cx, 1); + context._add(context.si, 1); + context._cmp(context.si, 8000); + if (context.flags.c()) goto search; + context.si = context.bx; + context.ax = context.pop(); + return; +gotstartletter: + context.push(context.bx); + context.push(context.si); +keepchecking: + context._add(context.si, 1); + context._add(context.bx, 1); + context.al = context.data.byte(context.bx); + context.ah = context.data.byte(context.si); + context._cmp(context.al, ':'); + if (context.flags.z()) goto foundmatch; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundmatch; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto keepchecking; + context.si = context.pop(); + context.bx = context.pop(); + goto searchagain; +foundmatch: + context.si = context.pop(); + context.bx = context.pop(); return; } -static inline void calledensdlift(Context & context) { - context._cmp(context.data.byte(35), 1); - if (context.flags.z()) goto edensdhere; - showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; - context.al = 2; - turnpathon(context); - return; -edensdhere: - showseconduse(context); - putbackobstuff(context); +static void findnextcolon(Context & context) { +isntcolon: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, 0); + if (context.flags.z()) goto endofcolon; + context._cmp(context.al, ':'); + if (!context.flags.z()) goto isntcolon; +endofcolon: return; } -static inline void usepoolreader(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto poolwith; - withwhat(context); +static void inventory(Context & context) { + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto iswatchinv; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatchinv; +iswatchinv: + blank(context); return; -poolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'M'; - context.ch = 'E'; - context.dl = 'M'; - context.dh = 'B'; - compare(context); - if (context.flags.z()) goto openpool; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +notwatchinv: + context._cmp(context.data.byte(100), 239); + if (context.flags.z()) goto alreadyopinv; + context.data.byte(100) = 239; + context.al = 32; + commandonly(context); +alreadyopinv: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantopinv; + context._and(context.ax, 1); + if (!context.flags.z()) goto doopeninv; +cantopinv: return; -openpool: - context._cmp(context.data.byte(48), 1); - if (context.flags.z()) goto canopenpool; - showseconduse(context); - putbackobstuff(context); +doopeninv: + context.data.word(328) = 0; + context.data.byte(234) = 0; + context.data.byte(237) = 0; + animpointer(context); + createpanel(context); + showpanel(context); + examicon(context); + showman(context); + showexit(context); + undertextline(context); + context.data.byte(106) = 0; + context.data.byte(104) = 2; + openinv(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(110) = 255; + goto waitexam; +/*continuing to unbounded code: examineagain from examineob:3-66*/ +examineagain: + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +waitexam: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.data.byte(103) = 0; + context.bx = 2494; + context._cmp(context.data.byte(104), 0); + if (context.flags.z()) goto notuseinv; + context.bx = 2556; + context._cmp(context.data.byte(104), 1); + if (context.flags.z()) goto notuseinv; + context.bx = 2618; +notuseinv: + checkcoords(context); + context._cmp(context.data.byte(108), 0); + if (context.flags.z()) goto norex; + goto examineagain; +norex: + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitexam; + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatching; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto justgetback; +iswatching: + makemainscreen(context); + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; -canopenpool: - context.al = 17; - playchannel1(context); - showfirstuse(context); - context.data.byte(39) = 6; - context.data.byte(103) = 1; +justgetback: + context.data.byte(104) = 0; + context.data.byte(110) = 255; + return; +examlist: +invlist1: +openchangesize: +withlist1: return; } -static inline void uselighter(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotlighterwith; - withwhat(context); +static void setpickup(Context & context) { + context._cmp(context.data.byte(102), 1); + if (context.flags.z()) goto cantpick; + context._cmp(context.data.byte(102), 3); + if (context.flags.z()) goto cantpick; + getanyad(context); + context.al = context.data.byte(context.bx+2); + context._cmp(context.al, 4); + if (!context.flags.z()) goto canpick; +cantpick: + blank(context); return; -gotlighterwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'S'; - context.ch = 'M'; - context.dl = 'K'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto cigarette; - showfirstuse(context); - putbackobstuff(context); +canpick: + context._cmp(context.data.byte(100), 209); + if (context.flags.z()) goto alreadysp; + context.data.byte(100) = 209; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 33; + commandwithob(context); +alreadysp: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto nosetpick; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto dosetpick; +nosetpick: return; -cigarette: - context.cx = 300; - context.al = 9; - showpuztext(context); - context.al = context.data.byte(95); - getexad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(103) = 1; +dosetpick: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + examicon(context); + context.data.byte(106) = 1; + context.data.byte(104) = 2; + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto pickupexob; + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + openinv(context); + worktoscreenm(context); return; -} - -static inline void showseconduse(Context & context) { - getobtextstart(context); - nextcolon(context); - nextcolon(context); - nextcolon(context); - usetext(context); - context.cx = 400; - hangonp(context); +pickupexob: + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; + openinv(context); + worktoscreenm(context); return; } -static inline void usecardreader1(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotreader1with; - withwhat(context); - return; -gotreader1with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) goto correctcard; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -correctcard: - context._cmp(context.data.byte(49), 0); - if (context.flags.z()) goto notyet; - context._cmp(context.data.word(16), 0); - if (context.flags.z()) goto getscash; - context.cx = 300; - context.al = 17; - showpuztext(context); - putbackobstuff(context); - return; -getscash: - context.al = 16; - playchannel1(context); - context.cx = 300; - context.al = 18; - showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(16) = 12432; - context.data.byte(103) = 1; +static void examinventory(Context & context) { + context._cmp(context.data.byte(100), 249); + if (context.flags.z()) goto alreadyexinv; + context.data.byte(100) = 249; + context.al = 32; + commandonly(context); +alreadyexinv: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (!context.flags.z()) goto doexinv; return; -notyet: - showfirstuse(context); - putbackobstuff(context); +doexinv: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + examicon(context); + context.data.byte(106) = 0; + context.data.byte(104) = 2; + openinv(context); + worktoscreenm(context); return; } -static inline void usecardreader2(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotreader2with; - withwhat(context); - return; -gotreader2with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) goto correctcard2; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +static void reexfrominv(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; return; -correctcard2: - context._cmp(context.data.byte(50), 0); - if (context.flags.z()) goto notyetboss; - context._cmp(context.data.word(16), 0); - if (context.flags.z()) goto nocash; - context._cmp(context.data.byte(46), 2); - if (context.flags.z()) goto alreadygotnew; - context.al = 18; - playchannel1(context); - context.cx = 300; - context.al = 19; - showpuztext(context); - context.al = 94; - placesetobject(context); - context.data.byte(46) = 1; - context._sub(context.data.word(16), 2000); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; +} + +static void reexfromopen(Context & context) { return; -nocash: - context.cx = 300; - context.al = 20; - showpuztext(context); - putbackobstuff(context); + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; return; -alreadygotnew: - context.cx = 300; - context.al = 22; - showpuztext(context); - putbackobstuff(context); +} + +static void swapwithinv(Context & context) { + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub7; + context._cmp(context.data.byte(100), 243); + if (context.flags.z()) goto alreadyswap1; + context.data.byte(100) = 243; +difsub7: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 34; + commandwithob(context); +alreadyswap1: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantswap1; + context._and(context.ax, 1); + if (!context.flags.z()) goto doswap1; +cantswap1: return; -notyetboss: - showfirstuse(context); - putbackobstuff(context); +doswap1: + context.ah = context.data.byte(102); + context.al = context.data.byte(89); + context.push(context.ax); + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.push(context.bx); + findinvpos(context); + delpointer(context); + context.al = context.data.byte(89); + geteitherad(context); + context.data.byte(context.bx+2) = 4; + context.data.byte(context.bx+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + fillryan(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void usecardreader3(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotreader3with; - withwhat(context); +static void swapwithopen(Context & context) { + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub8; + context._cmp(context.data.byte(100), 242); + if (context.flags.z()) goto alreadyswap2; + context.data.byte(100) = 242; +difsub8: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 34; + commandwithob(context); +alreadyswap2: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto cantswap2; + context._and(context.ax, 1); + if (!context.flags.z()) goto doswap2; +cantswap2: return; -gotreader3with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) goto rightcard; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +doswap2: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto notwornswap; + wornerror(context); return; -rightcard: - context._cmp(context.data.byte(51), 0); - if (context.flags.z()) goto notyetrecep; - context._cmp(context.data.byte(52), 0); - if (!context.flags.z()) goto alreadyusedit; - context.al = 16; - playchannel1(context); - context.cx = 300; - context.al = 25; - showpuztext(context); - context._add(context.data.byte(2), 1); - context._sub(context.data.word(16), 8300); - context.data.byte(52) = 1; - context.data.byte(103) = 1; +notwornswap: + delpointer(context); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); + if (!context.flags.z()) goto isntsame2; + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); + if (!context.flags.z()) goto isntsame2; + errormessage1(context); return; -alreadyusedit: - context.cx = 300; - context.al = 26; - showpuztext(context); - putbackobstuff(context); +isntsame2: + checkobjectsize(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto sizeok2; return; -notyetrecep: - showfirstuse(context); - putbackobstuff(context); +sizeok2: + context.ah = context.data.byte(102); + context.al = context.data.byte(89); + context.push(context.ax); + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + context._cmp(context.ah, 4); + if (!context.flags.z()) goto makeswapex; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + goto actuallyswap; +makeswapex: + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; +actuallyswap: + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.push(context.bx); + findopenpos(context); + geteitherad(context); + context.al = context.data.byte(111); + context.data.byte(context.bx+2) = context.al; + context.al = context.data.byte(110); + context.data.byte(context.bx+3) = context.al; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.al = context.data.byte(184); + context.data.byte(context.bx+5) = context.al; + context.ax = context.pop(); + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; + fillopen(context); + fillryan(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void usecashcard(Context & context) { - getridofreels(context); - loadkeypad(context); - createpanel(context); - showpanel(context); - showexit(context); - showman(context); - context.di = 114; - context.bx = 120-3; - context.ds = context.data.word(458); - context.al = 39; - context.ah = 0; - showframe(context); - context.ax = context.data.word(16); - moneypoke(context); - getobtextstart(context); - nextcolon(context); - nextcolon(context); - context.di = 36; - context.bx = 98; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - context.di = 160; - context.bx = 155; - context.es = context.cs; - context.si = 3385; - context.data.word(71) = 91*2+75; - context.al = 0; - context.ah = 0; - context.dl = 240; - printdirect(context); - context.di = 187; - context.bx = 155; - context.es = context.cs; - context.si = 3390; - context.data.word(71) = 91*2+85; - context.al = 0; - context.ah = 0; - context.dl = 240; - printdirect(context); - context.data.word(71) = 0; - worktoscreenm(context); - context.cx = 400; - hangonp(context); - getridoftemp(context); - restorereels(context); - putbackobstuff(context); +static void intoinv(Context & context) { + context._cmp(context.data.byte(106), 0); + if (!context.flags.z()) goto notout; + outofinv(context); return; -} - -static inline void moneypoke(Context & context) { - context.bx = 3385; - context.cl = 48-1; -numberpoke0: - context._add(context.cl, 1); - context._sub(context.ax, 10000); - if (!context.flags.c()) goto numberpoke0; - context._add(context.ax, 10000); - context.data.byte(context.bx) = context.cl; - context._add(context.bx, 1); - context.cl = 48-1; -numberpoke1: - context._add(context.cl, 1); - context._sub(context.ax, 1000); - if (!context.flags.c()) goto numberpoke1; - context._add(context.ax, 1000); - context.data.byte(context.bx) = context.cl; - context._add(context.bx, 1); - context.cl = 48-1; -numberpoke2: - context._add(context.cl, 1); - context._sub(context.ax, 100); - if (!context.flags.c()) goto numberpoke2; - context._add(context.ax, 100); - context.data.byte(context.bx) = context.cl; - context._add(context.bx, 1); - context.cl = 48-1; -numberpoke3: - context._add(context.cl, 1); - context._sub(context.ax, 10); - if (!context.flags.c()) goto numberpoke3; - context._add(context.ax, 10); - context.data.byte(context.bx) = context.cl; - context.bx = 3390; - context._add(context.al, 48); - context.data.byte(context.bx) = context.al; +notout: + findinvpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto canplace1; + swapwithinv(context); + return; +canplace1: + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub1; + context._cmp(context.data.byte(100), 220); + if (context.flags.z()) goto alreadyplce; + context.data.byte(100) = 220; +difsub1: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 35; + commandwithob(context); +alreadyplce: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo2; + context._and(context.ax, 1); + if (!context.flags.z()) goto doplace; +notletgo2: + return; +doplace: + delpointer(context); + context.al = context.data.byte(89); + getexad(context); + context.data.byte(context.bx+2) = 4; + context.data.byte(context.bx+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.data.byte(106) = 0; + fillryan(context); + readmouse(context); + showpointer(context); + outofinv(context); + worktoscreen(context); + delpointer(context); return; } -static inline void usecontrol(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotcontrolwith; - withwhat(context); - return; -gotcontrolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) goto rightkey; - context._cmp(context.data.byte(184), 21); - if (!context.flags.z()) goto balls; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto jimmycontrols; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) goto axeoncontrols; -balls: - showfirstuse(context); - putbackobstuff(context); +static void deletetaken(Context & context) { + context.es = context.data.word(426); + context.ah = context.data.byte(184); + context.ds = context.data.word(398); + context.si = 0+2080+30000; + context.cx = 114; +takenloop: + context.al = context.data.byte(context.si+11); + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto notinhere; + context.bl = context.data.byte(context.si+1); + context.bh = 0; + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context._add(context.bx, context.bx); + context.data.byte(context.bx+2) = 254; +notinhere: + context._add(context.si, 16); + if (--context.cx) goto takenloop; return; -rightkey: - context.al = 16; - playchannel1(context); - context._cmp(context.data.byte(9), 21); - if (context.flags.z()) goto goingdown; - context.cx = 300; - context.al = 0; - showpuztext(context); - context.data.byte(188) = 21; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; +} + +static void outofinv(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (!context.flags.z()) goto canpick2; + blank(context); return; -goingdown: - context.cx = 300; - context.al = 3; - showpuztext(context); - context.data.byte(188) = 30; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; +canpick2: + context.bx = context.data.word(202); + context._cmp(context.bx, 2); + if (!context.flags.z()) goto canpick2a; + reexfrominv(context); return; -jimmycontrols: - context.al = 50; - placesetobject(context); - context.al = 51; - placesetobject(context); - context.al = 26; - placesetobject(context); - context.al = 30; - placesetobject(context); - context.al = 16; - removesetobject(context); - context.al = 17; - removesetobject(context); - context.al = 14; - playchannel1(context); - context.cx = 300; - context.al = 10; - showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; +canpick2a: + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub3; + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadygrab; + context.data.byte(100) = 221; +difsub3: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 36; + commandwithob(context); +alreadygrab: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo; + context._and(context.ax, 1); + if (!context.flags.z()) goto dograb; +notletgo: return; -axeoncontrols: - context.cx = 300; - context.al = 16; - showpuztext(context); - context._add(context.data.byte(2), 1); - putbackobstuff(context); +dograb: + delpointer(context); + context.data.byte(106) = 1; + findinvpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + getexad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + fillryan(context); + readmouse(context); + showpointer(context); + intoinv(context); + worktoscreen(context); + delpointer(context); return; } -static inline void usehatch(Context & context) { - showfirstuse(context); - context.data.byte(188) = 40; - context.data.byte(103) = 1; +static void getfreead(Context & context) { + context.ah = 0; + context.cl = 4; + context._shl(context.ax, context.cl); + context.bx = context.ax; + context.es = context.data.word(426); return; } -static inline void usewire(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotwirewith; - withwhat(context); - return; -gotwirewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto wireknife; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) goto wireaxe; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); +static void getexad(Context & context) { + context.ah = 0; + context.bx = 16; + context._mul(context.bx); + context.bx = context.ax; + context.es = context.data.word(398); + context._add(context.bx, 0+2080+30000); return; -wireaxe: - context.cx = 300; - context.al = 16; - showpuztext(context); - putbackobstuff(context); +} + +static void geteitherad(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto isinexlist; + context.al = context.data.byte(89); + getfreead(context); return; -wireknife: - context.al = 51; - removesetobject(context); - context.al = 52; - placesetobject(context); - context.cx = 300; - context.al = 11; - showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; +isinexlist: + context.al = context.data.byte(89); + getexad(context); return; } -static inline void usehandle(Context & context) { - context.al = 'C'; - context.ah = 'U'; - context.cl = 'T'; - context.ch = 'W'; - findsetobject(context); - context.al = context.data.byte(context.bx+58); - context._cmp(context.al, 255); - if (!context.flags.z()) goto havecutwire; - context.cx = 300; - context.al = 12; - showpuztext(context); - context.data.byte(103) = 1; +static void getanyad(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto isex; + context._cmp(context.data.byte(102), 2); + if (context.flags.z()) goto isfree; + context.al = context.data.byte(99); + getsetad(context); + context.ax = context.data.word(context.bx+4); return; -havecutwire: - context.cx = 300; - context.al = 13; - showpuztext(context); - context.data.byte(188) = 22; - context.data.byte(103) = 1; +isfree: + context.al = context.data.byte(99); + getfreead(context); + context.ax = context.data.word(context.bx+7); + return; +isex: + context.al = context.data.byte(99); + getexad(context); + context.ax = context.data.word(context.bx+7); return; } -static inline void useelevator1(Context & context) { - showfirstuse(context); - selectlocation(context); - context.data.byte(103) = 1; +static void getanyaddir(Context & context) { + context._cmp(context.ah, 4); + if (context.flags.z()) goto isex3; + context._cmp(context.ah, 2); + if (context.flags.z()) goto isfree3; + getsetad(context); return; -} - -static inline void showfirstuse(Context & context) { - getobtextstart(context); - findnextcolon(context); - findnextcolon(context); - usetext(context); - context.cx = 400; - hangonp(context); +isfree3: + getfreead(context); + return; +isex3: + getexad(context); return; } -static inline void useelevator3(Context & context) { - showfirstuse(context); - context.data.byte(40) = 20; - context.data.byte(188) = 34; - context.data.word(23) = 46; - context.data.word(25) = 63; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(21) = 80; - context.data.byte(103) = 1; +static void getopenedsize(Context & context) { + context._cmp(context.data.byte(111), 4); + if (context.flags.z()) goto isex2; + context._cmp(context.data.byte(111), 2); + if (context.flags.z()) goto isfree2; + context.al = context.data.byte(110); + getsetad(context); + context.ax = context.data.word(context.bx+3); + return; +isfree2: + context.al = context.data.byte(110); + getfreead(context); + context.ax = context.data.word(context.bx+7); + return; +isex2: + context.al = context.data.byte(110); + getexad(context); + context.ax = context.data.word(context.bx+7); return; } -static inline void useelevator4(Context & context) { - showfirstuse(context); - context.data.word(23) = 0; - context.data.word(25) = 11; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(40) = 20; - context.data.word(21) = 80; - context.data.byte(103) = 1; - context.data.byte(188) = 24; +static void getsetad(Context & context) { + context.ah = 0; + context.bx = 64; + context._mul(context.bx); + context.bx = context.ax; + context.es = context.data.word(428); return; } -static inline void useelevator2(Context & context) { - context._cmp(context.data.byte(9), 23); - if (context.flags.z()) goto inpoolhall; - showfirstuse(context); - context.data.byte(188) = 23; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; - return; -inpoolhall: - showfirstuse(context); - context.data.byte(188) = 31; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; +static void findinvpos(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, 80); + context.bx = -1; +findinv1: + context._add(context.bx, 1); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findinv1; + context.cx = context.data.word(200); + context._sub(context.cx, 58); + context._sub(context.bx, 5); +findinv2: + context._add(context.bx, 5); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findinv2; + context.al = context.data.byte(19); + context.ah = 0; + context.cx = 10; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.al = context.bl; + context.data.byte(107) = context.al; + context._add(context.bx, context.bx); + context.es = context.data.word(412); + context._add(context.bx, 0+(228*13)+32); return; } -static inline void useelevator5(Context & context) { - context.al = 4; - placesetobject(context); - context.al = 0; - removesetobject(context); - context.data.byte(188) = 20; - context.data.word(21) = 80; - context.data.byte(35) = 1; - context.data.byte(40) = 8; - context.data.byte(103) = 1; +static void findopenpos(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, 80); + context.bx = -1; +findopenp1: + context._add(context.bx, 1); + context._sub(context.cx, 44); + if (!context.flags.c()) goto findopenp1; + context.al = context.bl; + context.data.byte(107) = context.al; + context._add(context.bx, context.bx); + context.es = context.data.word(412); + context._add(context.bx, 0+(228*13)); return; } -static inline void usekey(Context & context) { - context._cmp(context.data.byte(9), 5); - if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 30); - if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 21); - if (context.flags.z()) goto usekey2; - context.cx = 200; - context.al = 1; - showpuztext(context); - putbackobstuff(context); +static void dropobject(Context & context) { + context._cmp(context.data.byte(100), 223); + if (context.flags.z()) goto alreadydrop; + context.data.byte(100) = 223; + context._cmp(context.data.byte(106), 0); + if (context.flags.z()) { blank(context); return; }; + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); + context.al = 37; + commandwithob(context); +alreadydrop: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodrop; + context._and(context.ax, 1); + if (!context.flags.z()) goto dodrop; +nodrop: return; -usekey1: - context._cmp(context.data.byte(148), 22); - if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); - if (!context.flags.z()) goto wrongroom1; - context.cx = 300; - context.al = 0; - showpuztext(context); - context.data.byte(40) = 100; - context.data.byte(103) = 1; +dodrop: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto nowornerror; + wornerror(context); return; -usekey2: - context._cmp(context.data.byte(148), 11); - if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); - if (!context.flags.z()) goto wrongroom1; - context.cx = 300; - context.al = 3; - showpuztext(context); - context.data.byte(188) = 30; - context.al = 2; - fadescreendown(context); - showfirstuse(context); - putbackobstuff(context); +nowornerror: + context._cmp(context.data.byte(184), 47); + if (context.flags.z()) goto nodrop2; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto nodroperror; +nodrop2: + droperror(context); return; -wrongroom1: - context.cx = 200; - context.al = 2; - showpuztext(context); - putbackobstuff(context); +nodroperror: + context._cmp(context.data.byte(128), 64); + if (!context.flags.z()) goto notinlift; + context._cmp(context.data.byte(129), 64); + if (!context.flags.z()) goto notinlift; + droperror(context); + return; +notinlift: + context.al = context.data.byte(89); + context.ah = 4; + context.cl = 'G'; + context.ch = 'U'; + context.dl = 'N'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) { cantdrop(context); return; }; + context.al = context.data.byte(89); + context.ah = 4; + context.cl = 'S'; + context.ch = 'H'; + context.dl = 'L'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) { cantdrop(context); return; }; + context.data.byte(102) = 4; + context.al = context.data.byte(89); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(151); + context._add(context.al, 4); + context.cl = 4; + context._shr(context.al, context.cl); + context._add(context.al, context.data.byte(148)); + context.ah = context.data.byte(152); + context._add(context.ah, 8); + context.cl = 4; + context._shr(context.ah, context.cl); + context._add(context.ah, context.data.byte(149)); + context.data.byte(context.bx+3) = context.al; + context.data.byte(context.bx+5) = context.ah; + context.al = context.data.byte(151); + context._add(context.al, 4); + context._and(context.al, 15); + context.ah = context.data.byte(152); + context._add(context.ah, 8); + context._and(context.ah, 15); + context.data.byte(context.bx+4) = context.al; + context.data.byte(context.bx+6) = context.ah; + context.data.byte(106) = 0; + context.al = context.data.byte(184); + context.data.byte(context.bx) = context.al; + return; +} + +static void droperror(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 56; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); return; } -static inline void usestereo(Context & context) { - context._cmp(context.data.byte(9), 0); - if (context.flags.z()) goto stereook; - context.cx = 400; - context.al = 4; - showpuztext(context); - putbackobstuff(context); +static void cantdrop(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 24; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); return; -stereook: - context._cmp(context.data.byte(148), 11); - if (!context.flags.z()) goto stereonotok; - context._cmp(context.data.byte(149), 0); - if (context.flags.z()) goto stereook2; -stereonotok: - context.cx = 400; - context.al = 5; - showpuztext(context); - putbackobstuff(context); +} + +static void wornerror(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 57; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + context.data.byte(100) = 255; + worktoscreenm(context); return; -stereook2: - context.al = 'C'; - context.ah = 'D'; - context.cl = 'P'; - context.ch = 'L'; - findsetobject(context); - context.ah = 1; - checkinside(context); - context._cmp(context.cl, 114); - if (!context.flags.z()) goto cdinside; - context.al = 6; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); +} + +static void removeobfrominv(Context & context) { + context._cmp(context.data.byte(99), 100); + if (context.flags.z()) goto obnotexist; getanyad(context); - context.al = 255; - context.data.byte(context.bx+10) = context.al; + context.di = context.bx; + context.cl = context.data.byte(99); + context.ch = 0; + deleteexobject(context); +obnotexist: return; -cdinside: +} + +static void selectopenob(Context & context) { + context.al = context.data.byte(99); getanyad(context); - context.al = context.data.byte(context.bx+10); - context._xor(context.al, 1); - context.data.byte(context.bx+10) = context.al; context._cmp(context.al, 255); - if (context.flags.z()) goto stereoon; - context.al = 7; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); + if (!context.flags.z()) goto canopenit1; + blank(context); return; -stereoon: - context.al = 8; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); +canopenit1: + context._cmp(context.data.byte(100), 224); + if (context.flags.z()) goto alreadyopob; + context.data.byte(100) = 224; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 38; + commandwithob(context); +alreadyopob: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noopenob; + context._and(context.ax, 1); + if (!context.flags.z()) goto doopenob; +noopenob: + return; +doopenob: + context.al = context.data.byte(99); + context.data.byte(110) = context.al; + context.al = context.data.byte(102); + context.data.byte(111) = context.al; + createpanel(context); + showpanel(context); + showman(context); + examicon(context); + showexit(context); + openinv(context); + openob(context); + undertextline(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void usecooker(Context & context) { - context.al = context.data.byte(99); +static void useopened(Context & context) { + context._cmp(context.data.byte(110), 255); + if (context.flags.z()) goto cannotuseopen; + context._cmp(context.data.byte(106), 0); + if (!context.flags.z()) goto notout2; + outofopen(context); + return; +notout2: + findopenpos(context); + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto canplace3; + swapwithopen(context); +cannotuseopen: + return; +canplace3: + context._cmp(context.data.byte(106), 1); + if (context.flags.z()) goto intoopen; + blank(context); + return; +intoopen: + context.al = context.data.byte(89); context.ah = context.data.byte(102); - checkinside(context); - context._cmp(context.cl, 114); - if (!context.flags.z()) goto foodinside; - showfirstuse(context); - putbackobstuff(context); + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto difsub2; + context._cmp(context.data.byte(100), 227); + if (context.flags.z()) goto alreadyplc2; + context.data.byte(100) = 227; +difsub2: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 35; + commandwithob(context); +alreadyplc2: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notletgo3; + context._cmp(context.ax, 1); + if (context.flags.z()) goto doplace2; +notletgo3: return; -foodinside: - showseconduse(context); - putbackobstuff(context); +doplace2: + geteitherad(context); + isitworn(context); + if (!context.flags.z()) goto notworntoopen; + wornerror(context); return; -} - -static inline void useaxe(Context & context) { - context._cmp(context.data.byte(184), 22); - if (!context.flags.z()) goto notinpool; - context._cmp(context.data.byte(149), 10); - if (context.flags.z()) goto axeondoor; - showseconduse(context); - context._add(context.data.byte(2), 1); - context.data.byte(65) = 2; - context.data.byte(103) = 1; - removeobfrominv(context); +notworntoopen: + delpointer(context); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); + if (!context.flags.z()) goto isntsame; + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); + if (!context.flags.z()) goto isntsame; + errormessage1(context); return; -notinpool: - showfirstuse(context); +isntsame: + checkobjectsize(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto sizeok1; return; -/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ -axeondoor: - context.al = 15; - context.cx = 300; - showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +sizeok1: + context.data.byte(106) = 0; + context.al = context.data.byte(89); + geteitherad(context); + context.al = context.data.byte(111); + context.data.byte(context.bx+2) = context.al; + context.al = context.data.byte(110); + context.data.byte(context.bx+3) = context.al; + context.al = context.data.byte(107); + context.data.byte(context.bx+4) = context.al; + context.al = context.data.byte(184); + context.data.byte(context.bx+5) = context.al; + fillopen(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; +} + +static void errormessage1(Context & context) { + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 58; + context.dl = 240; + printmessage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void useelvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gotdoorwith; - withwhat(context); - return; -gotdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) goto axeondoor; - context.al = 14; - context.cx = 300; - showpuztext(context); - putbackobstuff(context); - return; -axeondoor: - context.al = 15; - context.cx = 300; - showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; +static void errormessage2(Context & context) { + context.data.byte(100) = 255; + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 59; + context.dl = 240; + printmessage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.cx = 50; + hangonp(context); + showpanel(context); + showman(context); + examicon(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; } -static inline void withwhat(Context & context) { - createpanel(context); +static void errormessage3(Context & context) { + delpointer(context); + context.di = 76; + context.bx = 21; + context.al = 60; + context.dl = 240; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); showpanel(context); showman(context); - showexit(context); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); - context.es = context.cs; - context.di = 5674; - copyname(context); - context.di = 100; - context.bx = 21; - context.dl = 200; - context.al = 63; - context.ah = 2; - printmessage2(context); - context.di = context.data.word(84); - context._add(context.di, 5); - context.bx = 21; - context.es = context.cs; - context.si = 5674; - context.dl = 220; - context.al = 0; - context.ah = 0; - printdirect(context); - context.di = context.data.word(84); - context._add(context.di, 5); - context.bx = 21; - context.dl = 200; - context.al = 63; - context.ah = 3; - printmessage2(context); - fillryan(context); - context.data.byte(100) = 255; + examicon(context); readmouse(context); + useopened(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(104) = 2; return; } -static inline void selectob(Context & context) { - findinvpos(context); +static void checkobjectsize(Context & context) { + getopenedsize(context); + context.push(context.ax); + context.al = context.data.byte(89); + geteitherad(context); + context.al = context.data.byte(context.bx+9); + context.cx = context.pop(); + context._cmp(context.al, 255); + if (!context.flags.z()) goto notunsized; + context.al = 6; +notunsized: + context._cmp(context.al, 100); + if (!context.flags.c()) goto specialcase; + context._cmp(context.cl, 100); + if (context.flags.c()) goto isntspecial; + errormessage3(context); + goto sizewrong; +isntspecial: + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto sizeok; +specialcase: + context._sub(context.al, 100); + context._cmp(context.cl, 100); + if (!context.flags.c()) goto bothspecial; + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto sizeok; + errormessage2(context); + goto sizewrong; +bothspecial: + context._sub(context.cl, 100); + context._cmp(context.al, context.cl); + if (context.flags.z()) goto sizeok; + errormessage3(context); +sizewrong: + context.al = 1; + return; +sizeok: + context.al = 0; + return; +} + +static void outofopen(Context & context) { + context._cmp(context.data.byte(110), 255); + if (context.flags.z()) goto cantuseopen; + findopenpos(context); context.ax = context.data.word(context.bx); context._cmp(context.al, 255); - if (!context.flags.z()) goto canselectob; + if (!context.flags.z()) goto canpick4; +cantuseopen: blank(context); return; -canselectob: - context.data.byte(95) = context.al; - context.data.byte(96) = context.ah; +canpick4: context._cmp(context.ax, context.data.word(94)); - if (!context.flags.z()) goto diffsub3; - context._cmp(context.data.byte(100), 221); - if (context.flags.z()) goto alreadyselob; - context.data.byte(100) = 221; -diffsub3: + if (!context.flags.z()) goto difsub4; + context._cmp(context.data.byte(100), 228); + if (context.flags.z()) goto alreadygrb; + context.data.byte(100) = 228; +difsub4: context.data.word(94) = context.ax; context.bx = context.ax; - context.al = 0; + context.al = 36; commandwithob(context); -alreadyselob: +alreadygrb: context.ax = context.data.word(202); context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notselob; - context._and(context.ax, 1); - if (!context.flags.z()) goto doselob; -notselob: + if (context.flags.z()) goto notletgo4; + context._cmp(context.ax, 1); + if (context.flags.z()) goto dogrb; + context._cmp(context.ax, 2); + if (!context.flags.z()) goto notletgo4; + reexfromopen(context); +notletgo4: return; -doselob: +dogrb: + delpointer(context); + context.data.byte(106) = 1; + findopenpos(context); + context.ax = context.data.word(context.bx); + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; + context._cmp(context.ah, 4); + if (!context.flags.z()) goto makeintoex; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; + goto actuallyout; +makeintoex: + transfertoex(context); + context.data.byte(89) = context.al; + context.data.byte(102) = 4; + geteitherad(context); + context.data.byte(context.bx+2) = 20; + context.data.byte(context.bx+3) = 255; +actuallyout: + fillopen(context); + undertextline(context); + readmouse(context); + useopened(context); + showpointer(context); + worktoscreen(context); delpointer(context); - context.data.byte(104) = 0; - useroutine(context); - return; -} - -static inline void findsetobject(Context & context) { - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(428); - context.bx = 0; - context.dl = 0; -findsetloop: - context._cmp(context.al, context.data.byte(context.bx+12)); - if (!context.flags.z()) goto nofind; - context._cmp(context.ah, context.data.byte(context.bx+13)); - if (!context.flags.z()) goto nofind; - context._cmp(context.cl, context.data.byte(context.bx+14)); - if (!context.flags.z()) goto nofind; - context._cmp(context.ch, context.data.byte(context.bx+15)); - if (!context.flags.z()) goto nofind; - context.al = context.dl; - return; -nofind: - context._add(context.bx, 64); - context._add(context.dl, 1); - context._cmp(context.dl, 128); - if (!context.flags.z()) goto findsetloop; - context.al = context.dl; - return; -} - -static inline void checkinside(Context & context) { - context.es = context.data.word(398); - context.bx = 0+2080+30000; - context.cl = 0; -insideloop: - context._cmp(context.al, context.data.byte(context.bx+3)); - if (!context.flags.z()) goto notfoundinside; - context._cmp(context.ah, context.data.byte(context.bx+2)); - if (!context.flags.z()) goto notfoundinside; - return; -notfoundinside: - context._add(context.bx, 16); - context._add(context.cl, 1); - context._cmp(context.cl, 114); - if (!context.flags.z()) goto insideloop; - return; -} - -static inline void usetext(Context & context) { - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 104; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - worktoscreenm(context); return; } -static inline void showpuztext(Context & context) { - context.push(context.cx); - findpuztext(context); - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 104; - context.dl = 241; +static void transfertoex(Context & context) { + emergencypurge(context); + getexpos(context); + context.al = context.data.byte(10); + context.push(context.ax); + context.push(context.di); + context.al = context.data.byte(89); context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = context.pop(); - hangonp(context); + context.bx = 16; + context._mul(context.bx); + context.ds = context.data.word(426); + context.si = context.ax; + context.cx = 8; + while(--context.cx) context._movsw(); + context.di = context.pop(); + context.al = context.data.byte(184); + context.data.byte(context.di) = context.al; + context.data.byte(context.di+11) = context.al; + context.al = context.data.byte(89); + context.data.byte(context.di+1) = context.al; + context.data.byte(context.di+2) = 4; + context.data.byte(context.di+3) = 255; + context.al = context.data.byte(107); + context.data.byte(context.di+4) = context.al; + context.al = context.data.byte(89); + context.data.byte(90) = context.al; + transfermap(context); + transferinv(context); + transfertext(context); + context.al = context.data.byte(89); + context.ah = 0; + context.bx = 16; + context._mul(context.bx); + context.ds = context.data.word(426); + context.si = context.ax; + context.data.byte(context.si+2) = 254; + pickupconts(context); + context.ax = context.pop(); return; } -static inline void issetobonmap(Context & context) { +static void pickupconts(Context & context) { + context.al = context.data.byte(context.si+7); + context._cmp(context.al, 255); + if (context.flags.z()) goto notopenable; + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context.dl = context.data.byte(10); + context.es = context.data.word(426); + context.bx = 0; + context.cx = 0; +pickupcontloop: + context.push(context.cx); context.push(context.es); context.push(context.bx); - getsetad(context); - context.al = context.data.byte(context.bx+58); + context.push(context.dx); + context.push(context.ax); + context._cmp(context.data.byte(context.bx+2), context.ah); + if (!context.flags.z()) goto notinsidethis; + context._cmp(context.data.byte(context.bx+3), context.al); + if (!context.flags.z()) goto notinsidethis; + context.data.byte(90) = context.cl; + transfercontoex(context); +notinsidethis: + context.ax = context.pop(); + context.dx = context.pop(); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.al, 0); - return; -} - -static inline void setuptimedtemp(Context & context) { - context._cmp(context.data.word(328), 0); - if (!context.flags.z()) goto cantsetup2; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; - context._add(context.dx, context.cx); - context.data.word(328) = context.dx; - context.bl = context.al; - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(466); - context.cx = 66*2; - context.ax = context.data.word(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; -cantsetup2: - return; -} - -static inline void edenscdplayer(Context & context) { - showfirstuse(context); - context.data.word(21) = 18*2; - context.data.word(23) = 25; - context.data.word(25) = 42; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.cx = context.pop(); + context._add(context.bx, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 80); + if (!context.flags.z()) goto pickupcontloop; +notopenable: return; } -static inline void usewall(Context & context) { - showfirstuse(context); - context._cmp(context.data.byte(475), 3); - if (context.flags.z()) goto gobackover; - context.data.word(21) = 30*2; - context.data.word(23) = 2; - context.data.word(25) = 31; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.al = 3; - turnpathon(context); - context.al = 4; - turnpathon(context); - context.al = 0; - turnpathoff(context); - context.al = 1; - turnpathoff(context); - context.al = 2; - turnpathoff(context); - context.al = 5; - turnpathoff(context); - context.data.byte(475) = 3; - context.data.byte(477) = 3; - findxyfrompath(context); - context.data.byte(187) = 1; - switchryanoff(context); - return; -gobackover: - context.data.word(21) = 30*2; - context.data.word(23) = 34; - context.data.word(25) = 60; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.al = 3; - turnpathoff(context); - context.al = 4; - turnpathoff(context); - context.al = 0; - turnpathon(context); - context.al = 1; - turnpathon(context); - context.al = 2; - turnpathon(context); - context.al = 5; - turnpathon(context); - context.data.byte(475) = 5; - context.data.byte(477) = 5; - findxyfrompath(context); - context.data.byte(187) = 1; - switchryanoff(context); +static void transfercontoex(Context & context) { + context.push(context.es); + context.push(context.bx); + context.push(context.dx); + context.push(context.es); + context.push(context.bx); + getexpos(context); + context.si = context.pop(); + context.ds = context.pop(); + context.push(context.di); + context.cx = 8; + while(--context.cx) context._movsw(); + context.di = context.pop(); + context.dx = context.pop(); + context.al = context.data.byte(184); + context.data.byte(context.di) = context.al; + context.data.byte(context.di+11) = context.al; + context.al = context.data.byte(90); + context.data.byte(context.di+1) = context.al; + context.data.byte(context.di+3) = context.dl; + context.data.byte(context.di+2) = 4; + transfermap(context); + transferinv(context); + transfertext(context); + context.si = context.pop(); + context.ds = context.pop(); + context.data.byte(context.si+2) = 255; return; } -static inline void usechurchgate(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto gatewith; - withwhat(context); - return; -gatewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'T'; - context.dh = 'T'; - compare(context); - if (context.flags.z()) goto cutgate; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -cutgate: - showfirstuse(context); - context.data.word(21) = 64*2; - context.data.word(23) = 4; - context.data.word(25) = 70; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); - context.al = 3; - turnpathon(context); - context._cmp(context.data.byte(44), 0); - if (context.flags.z()) goto notopenchurch; - context.al = 2; - turnpathon(context); -notopenchurch: +static void transfertext(Context & context) { + context.es = context.data.word(398); + context.al = context.data.byte(10); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = 0+2080+30000+(16*114); + context._add(context.bx, context.ax); + context.di = context.data.word(14); + context.data.word(context.bx) = context.di; + context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context.al = context.data.byte(90); + context.ah = 0; + context._add(context.ax, context.ax); + context.ds = context.data.word(438); + context.bx = 0; + context._add(context.bx, context.ax); + context.si = 0+(82*2); + context.ax = context.data.word(context.bx); + context._add(context.si, context.ax); +moretext: + context._lodsb(); + context._stosb(); + context._add(context.data.word(14), 1); + context._cmp(context.al, 0); + if (!context.flags.z()) goto moretext; return; } -static inline void usegun(Context & context) { - context._cmp(context.data.byte(102), 4); - if (context.flags.z()) goto istakengun; - showseconduse(context); - putbackobstuff(context); - return; -istakengun: - context._cmp(context.data.byte(184), 22); - if (!context.flags.z()) goto notinpoolroom; - context.cx = 300; - context.al = 34; - showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 39; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); +static void getexpos(Context & context) { + context.es = context.data.word(398); + context.al = 0; + context.di = 0+2080+30000; +tryanotherex: + context._cmp(context.data.byte(context.di+2), 255); + if (context.flags.z()) goto foundnewex; + context._add(context.di, 16); + context._add(context.al, 1); + context._cmp(context.al, 114); + if (!context.flags.z()) goto tryanotherex; +foundnewex: + context.data.byte(10) = context.al; return; -notinpoolroom: - context._cmp(context.data.byte(184), 25); - if (!context.flags.z()) goto nothelicopter; - context.cx = 300; - context.al = 34; - showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 19; - context.data.byte(103) = 1; - context.data.byte(66) = 2; - context.data.byte(67) = 38; - context.data.byte(43) = 1; - context._add(context.data.byte(2), 1); +} + +static void purgealocation(Context & context) { + context.push(context.ax); + context.es = context.data.word(398); + context.di = 0+2080+30000; + context.bx = context.pop(); + context.cx = 0; +purgeloc: + context._cmp(context.bl, context.data.byte(context.di+0)); + if (!context.flags.z()) goto dontpurge; + context._cmp(context.data.byte(context.di+2), 0); + if (!context.flags.z()) goto dontpurge; + context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.push(context.cx); + deleteexobject(context); + context.cx = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); +dontpurge: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto purgeloc; return; -nothelicopter: - context._cmp(context.data.byte(184), 27); - if (!context.flags.z()) goto notinrockroom; - context.cx = 300; - context.al = 46; - showpuztext(context); - context.data.byte(234) = 2; - context.data.byte(41) = 1; - context.data.byte(65) = 1; - context.data.byte(34) = 1; - context.data.byte(103) = 1; - context.data.byte(67) = 32; - context.data.byte(66) = 0; - context._add(context.data.byte(2), 1); +} + +static void emergencypurge(Context & context) { +checkpurgeagain: + context.ax = context.data.word(12); + context._add(context.ax, 4000); + context._cmp(context.ax, 30000); + if (context.flags.c()) goto notnearframeend; + purgeanitem(context); + goto checkpurgeagain; +notnearframeend: + context.ax = context.data.word(14); + context._add(context.ax, 400); + context._cmp(context.ax, 18000); + if (context.flags.c()) goto notneartextend; + purgeanitem(context); + goto checkpurgeagain; +notneartextend: return; -notinrockroom: - context._cmp(context.data.byte(184), 8); - if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(148), 22); - if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(149), 40); - if (!context.flags.z()) goto notbystudio; - context.al = 92; - issetobonmap(context); - if (context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(475), 9); - if (context.flags.z()) goto notbystudio; - context.data.byte(478) = 9; - context.data.byte(477) = 9; - autosetwalk(context); - context.data.byte(65) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); +} + +static void purgeanitem(Context & context) { + context.es = context.data.word(398); + context.di = 0+2080+30000; + context.bl = context.data.byte(184); + context.cx = 0; +lookforpurge: + context.al = context.data.byte(context.di+2); + context._cmp(context.al, 0); + if (!context.flags.z()) goto cantpurge; + context._cmp(context.data.byte(context.di+12), 2); + if (context.flags.z()) goto iscup; + context._cmp(context.data.byte(context.di+12), 255); + if (!context.flags.z()) goto cantpurge; +iscup: + context._cmp(context.data.byte(context.di+11), context.bl); + if (context.flags.z()) goto cantpurge; + deleteexobject(context); return; -notbystudio: - context._cmp(context.data.byte(184), 6); - if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(148), 11); - if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(149), 20); - if (!context.flags.z()) goto notsarters; - context.al = 5; - issetobonmap(context); - if (!context.flags.z()) goto notsarters; - context.data.byte(478) = 1; - context.data.byte(477) = 1; - autosetwalk(context); - context.al = 5; - removesetobject(context); - context.al = 6; - placesetobject(context); - context.al = 1; - context.ah = context.data.byte(185); - context._sub(context.ah, 1); - turnanypathon(context); - context.data.byte(35) = 1; - context.data.word(21) = 40*2; - context.data.word(23) = 4; - context.data.word(25) = 43; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); +cantpurge: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto lookforpurge; + context.di = 0+2080+30000; + context.bl = context.data.byte(184); + context.cx = 0; +lookforpurge2: + context.al = context.data.byte(context.di+2); + context._cmp(context.al, 0); + if (!context.flags.z()) goto cantpurge2; + context._cmp(context.data.byte(context.di+12), 255); + if (!context.flags.z()) goto cantpurge2; + deleteexobject(context); return; -notsarters: - context._cmp(context.data.byte(184), 29); - if (!context.flags.z()) goto notaide; - context.data.byte(103) = 1; - context.al = 13; - resetlocation(context); - context.al = 12; - setlocation(context); - context.data.byte(183) = 12; - context.data.byte(478) = 2; - context.data.byte(477) = 2; - autosetwalk(context); - context.data.word(21) = 164*2; - context.data.word(23) = 3; - context.data.word(25) = 164; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(44) = 1; - context.data.byte(66) = 3; - context.data.byte(67) = 33; - context._add(context.data.byte(2), 1); +cantpurge2: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto lookforpurge2; return; -notaide: - context._cmp(context.data.byte(184), 23); - if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(148), 0); - if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(149), 50); - if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(475), 5); - if (context.flags.z()) goto pathokboss; - context.data.byte(478) = 5; - context.data.byte(477) = 5; - autosetwalk(context); -pathokboss: - context.data.byte(65) = 1; - context.data.byte(103) = 1; +} + +static void deleteexobject(Context & context) { + context.push(context.cx); + context.push(context.cx); + context.push(context.cx); + context.push(context.cx); + context.al = 255; + context.cx = 16; + while(--context.cx) context._stosb(); + context.ax = context.pop(); + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + deleteexframe(context); + context.ax = context.pop(); + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + deleteexframe(context); + context.ax = context.pop(); + deleteextext(context); + context.bx = context.pop(); + context.bh = context.bl; + context.bl = 4; + context.di = 0+2080+30000; + context.cx = 0; +deleteconts: + context._cmp(context.data.word(context.di+2), context.bx); + if (!context.flags.z()) goto notinsideex; + context.push(context.bx); + context.push(context.cx); + context.push(context.di); + deleteexobject(context); + context.di = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); +notinsideex: + context._add(context.di, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 114); + if (!context.flags.z()) goto deleteconts; return; -notwithboss: - context._cmp(context.data.byte(184), 8); - if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(148), 11); - if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(149), 10); - if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(475), 2); - if (context.flags.z()) goto pathoktv; - context.data.byte(478) = 2; - context.data.byte(477) = 2; - autosetwalk(context); -pathoktv: - context.data.byte(65) = 1; - context.data.byte(103) = 1; +} + +static void deleteexframe(Context & context) { + context.di = 0; + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + context.ah = 0; + context.cl = context.data.byte(context.di+1); + context.ch = 0; + context._mul(context.cx); + context.si = context.data.word(context.di+2); + context.push(context.si); + context._add(context.si, 0+2080); + context.cx = 30000; + context._sub(context.cx, context.data.word(context.di+2)); + context.di = context.si; + context._add(context.si, context.ax); + context.push(context.ax); + context.ds = context.es; + while(--context.cx) context._movsb(); + context.bx = context.pop(); + context._sub(context.data.word(12), context.bx); + context.si = context.pop(); + context.cx = 114*3; + context.di = 0; +shuffleadsdown: + context.ax = context.data.word(context.di+2); + context._cmp(context.ax, context.si); + if (context.flags.c()) goto beforethisone; + context._sub(context.ax, context.bx); +beforethisone: + context.data.word(context.di+2) = context.ax; + context._add(context.di, 6); + if (--context.cx) goto shuffleadsdown; return; -nottvsoldier: - showfirstuse(context); - putbackobstuff(context); +} + +static void deleteextext(Context & context) { + context.di = 0+2080+30000+(16*114); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.di, context.ax); + context.ax = context.data.word(context.di); + context.si = context.ax; + context.di = context.ax; + context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context.ax = 0; +findlenextext: + context.cl = context.data.byte(context.si); + context._add(context.ax, 1); + context._add(context.si, 1); + context._cmp(context.cl, 0); + if (!context.flags.z()) goto findlenextext; + context.cx = 18000; + context.bx = context.si; + context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2)); + context.push(context.bx); + context.push(context.ax); + context._sub(context.cx, context.bx); + while(--context.cx) context._movsb(); + context.bx = context.pop(); + context._sub(context.data.word(14), context.bx); + context.si = context.pop(); + context.cx = 114; + context.di = 0+2080+30000+(16*114); +shuffletextads: + context.ax = context.data.word(context.di); + context._cmp(context.ax, context.si); + if (context.flags.c()) goto beforethistext; + context._sub(context.ax, context.bx); +beforethistext: + context.data.word(context.di) = context.ax; + context._add(context.di, 2); + if (--context.cx) goto shuffletextads; return; } -static inline void useshield(Context & context) { - context._cmp(context.data.byte(184), 20); - if (!context.flags.z()) goto notinsartroom; - context._cmp(context.data.byte(64), 0); - if (context.flags.z()) goto notinsartroom; - context.data.byte(65) = 3; - showseconduse(context); - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); - removeobfrominv(context); +static void blockget(Context & context) { + context.ah = context.al; + context.al = 0; + context.ds = context.data.word(416); + context.si = 0+192; + context._add(context.si, context.ax); return; -notinsartroom: - showfirstuse(context); - putbackobstuff(context); +} + +static void drawfloor(Context & context) { + context.push(context.es); + context.push(context.bx); + eraseoldobs(context); + drawflags(context); + calcmapad(context); + doblocks(context); + showallobs(context); + showallfree(context); + showallex(context); + paneltomap(context); + initrain(context); + context.data.byte(62) = 0; + context.bx = context.pop(); + context.es = context.pop(); return; } -static inline void usebuttona(Context & context) { - context.al = 95; - issetobonmap(context); - if (context.flags.z()) goto donethisbit; - showfirstuse(context); - context.al = 0; - context.ah = context.data.byte(185); - context._sub(context.ah, 1); - turnanypathon(context); - context.al = 9; - removesetobject(context); - context.al = 95; - placesetobject(context); - context.data.word(21) = 15*2; - context.data.word(23) = 71; - context.data.word(25) = 85; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); +static void calcmapad(Context & context) { + getdimension(context); + context.push(context.cx); + context.push(context.dx); + context.al = 11; + context._sub(context.al, context.dl); + context._sub(context.al, context.cl); + context._sub(context.al, context.cl); + context.ax.cbw(); + context.bx = 8; + context._mul(context.bx); + context._add(context.ax, context.data.word(121)); + context.data.word(117) = context.ax; + context.dx = context.pop(); + context.cx = context.pop(); + context.al = 10; + context._sub(context.al, context.dh); + context._sub(context.al, context.ch); + context._sub(context.al, context.ch); + context.ax.cbw(); + context.bx = 8; + context._mul(context.bx); + context._add(context.ax, context.data.word(123)); + context.data.word(119) = context.ax; return; -donethisbit: - showseconduse(context); - putbackobstuff(context); +} + +static void getdimension(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32); + context.ch = 0; +dimloop1: + addalong(context); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim1; + context._add(context.ch, 1); + goto dimloop1; +finishdim1: + context.bx = 0+(228*13)+32+60+(32*32); + context.cl = 0; +dimloop2: + context.push(context.bx); + addlength(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim2; + context._add(context.cl, 1); + context._add(context.bx, 3); + goto dimloop2; +finishdim2: + context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9); + context.dh = 10; +dimloop3: + context.push(context.bx); + addalong(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim3; + context._sub(context.dh, 1); + context._sub(context.bx, 11*3); + goto dimloop3; +finishdim3: + context.bx = 0+(228*13)+32+60+(32*32)+(3*10); + context.dl = 11; +dimloop4: + context.push(context.bx); + addlength(context); + context.bx = context.pop(); + context._cmp(context.al, 0); + if (!context.flags.z()) goto finishdim4; + context._sub(context.dl, 1); + context._sub(context.bx, 3); + goto dimloop4; +finishdim4: + context.al = context.cl; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.word(125) = context.ax; + context.al = context.ch; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.word(127) = context.ax; + context._sub(context.dl, context.cl); + context._sub(context.dh, context.ch); + context.al = context.dl; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.byte(128) = context.al; + context.al = context.dh; + context.ah = 0; + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context._shl(context.ax, 1); + context.data.byte(129) = context.al; return; } -static inline void useplate(Context & context) { - context._cmp(context.data.byte(95), 255); - if (!context.flags.z()) goto platewith; - withwhat(context); - return; -platewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'S'; - context.ch = 'C'; - context.dl = 'R'; - context.dh = 'W'; - compare(context); - if (context.flags.z()) goto unscrewplate; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto triedknife; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); - return; -unscrewplate: - context.al = 20; - playchannel1(context); - showfirstuse(context); - context.al = 28; - placesetobject(context); - context.al = 24; - placesetobject(context); - context.al = 25; - removesetobject(context); +static void addalong(Context & context) { + context.ah = 11; +addloop: + context._cmp(context.data.byte(context.bx), 0); + if (!context.flags.z()) goto gotalong; + context._add(context.bx, 3); + context._sub(context.ah, 1); + if (!context.flags.z()) goto addloop; context.al = 0; - placefreeobject(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; return; -triedknife: - context.cx = 300; - context.al = 54; - showpuztext(context); - putbackobstuff(context); +gotalong: + context.al = 1; return; } -static inline void usewinch(Context & context) { - context.al = 40; - context.ah = 1; - checkinside(context); - context._cmp(context.cl, 114); - if (context.flags.z()) goto nowinch; - context.al = context.cl; - context.ah = 4; - context.cl = 'F'; - context.ch = 'U'; - context.dl = 'S'; - context.dh = 'E'; - compare(context); - if (!context.flags.z()) goto nowinch; - context.data.word(21) = 217*2; - context.data.word(23) = 0; - context.data.word(25) = 217; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(183) = 1; - context.data.byte(188) = 45; - context.data.byte(66) = 1; - context.data.byte(67) = 44; - context.data.byte(42) = 1; - context.data.byte(34) = 2; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); +static void addlength(Context & context) { + context.ah = 10; +addloop2: + context._cmp(context.data.byte(context.bx), 0); + if (!context.flags.z()) goto gotlength; + context._add(context.bx, 3*11); + context._sub(context.ah, 1); + if (!context.flags.z()) goto addloop2; + context.al = 0; return; -nowinch: - showfirstuse(context); - putbackobstuff(context); +gotlength: + context.al = 1; return; } -static inline void entercode(Context & context) { - context.data.word(284) = context.ax; - context.data.word(286) = context.cx; - getridofreels(context); - loadkeypad(context); - createpanel(context); - showicon(context); - showouterpad(context); - showkeypad(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.word(280) = 0; - context.data.byte(103) = 0; -keypadloop: - delpointer(context); - readmouse(context); - showkeypad(context); - showpointer(context); - context._cmp(context.data.byte(282), 0); - if (context.flags.z()) goto nopresses; - context._sub(context.data.byte(282), 1); - goto afterpress; -nopresses: - context.data.byte(278) = 255; - context.data.byte(281) = 255; - vsync(context); -afterpress: - dumppointer(context); - dumpkeypad(context); - dumptextline(context); - context.bx = 3393; - checkcoords(context); - context._cmp(context.data.byte(103), 1); - if (context.flags.z()) goto numberright; - context._cmp(context.data.byte(287), 1); - if (!context.flags.z()) goto notendkey; - context._cmp(context.data.byte(37), 0); - if (context.flags.z()) goto numberright; - goto keypadloop; -notendkey: - context._cmp(context.data.byte(282), 40); - if (!context.flags.z()) goto keypadloop; - addtopresslist(context); - context._cmp(context.data.byte(278), 11); - if (!context.flags.z()) goto keypadloop; - context.ax = context.data.word(284); - context.cx = context.data.word(286); - isitright(context); - if (!context.flags.z()) goto incorrect; - context.data.byte(37) = 0; - context.al = 11; - playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; - goto keypadloop; -incorrect: - context.al = 11; - playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; - goto keypadloop; -numberright: - context.data.byte(131) = 0; - getridoftemp(context); - restorereels(context); - redrawmainscrn(context); - worktoscreenm(context); +static void drawflags(Context & context) { + context.es = context.data.word(412); + context.di = 0+(228*13)+32+60+(32*32); + context.al = context.data.byte(149); + context.ah = 0; + context.cx = 66; + context._mul(context.cx); + context.bl = context.data.byte(148); + context.bh = 0; + context._add(context.ax, context.bx); + context.si = 0; + context._add(context.si, context.ax); + context.cx = 10; +_tmp28: + context.push(context.cx); + context.cx = 11; +_tmp28a: + context.ds = context.data.word(418); + context._lodsb(); + context.ds = context.data.word(416); + context.push(context.si); + context.push(context.ax); + context.ah = 0; + context._add(context.ax, context.ax); + context.si = 0; + context._add(context.si, context.ax); + context._movsw(); + context.ax = context.pop(); + context._stosb(); + context.si = context.pop(); + if (--context.cx) goto _tmp28a; + context._add(context.si, 66-11); + context.cx = context.pop(); + if (--context.cx) goto _tmp28; return; } -static inline void quitkey(Context & context) { - context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadyqk; - context.data.byte(100) = 222; - context.al = 4; - commandonly(context); -alreadyqk: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notqk; - context._and(context.ax, 1); - if (!context.flags.z()) goto doqk; -notqk: +static void eraseoldobs(Context & context) { + context._cmp(context.data.byte(62), 0); + if (context.flags.z()) goto donterase; + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.cx = 16; +oberase: + context.push(context.cx); + context.push(context.bx); + context.ax = context.data.word(context.bx+20); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto notthisob; + context.di = context.bx; + context.al = 255; + context.cx = 32; + while(--context.cx) context._stosb(); +notthisob: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 32); + if (--context.cx) goto oberase; +donterase: return; -doqk: - context.data.byte(103) = 1; +} + +static void showallobs(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); + context.data.word(18) = context.bx; + context.di = context.bx; + context.cx = 128*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(444); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.data.byte(181) = 0; + context.ds = context.data.word(428); + context.si = 0; + context.cx = 128; +showobsloop: + context.push(context.cx); + context.push(context.si); + context.push(context.si); + context._add(context.si, 58); + context.es = context.data.word(428); + getmapad(context); + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto blankframe; + context.al = context.data.byte(context.si+18); + context.ah = 0; + context.data.word(160) = context.ax; + context._cmp(context.al, 255); + if (context.flags.z()) goto blankframe; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(context.si+18); + context.data.byte(context.si+17) = context.al; + context._cmp(context.data.byte(context.si+8), 0); + if (!context.flags.z()) goto animating; + context._cmp(context.data.byte(context.si+5), 5); + if (context.flags.z()) goto animating; + context._cmp(context.data.byte(context.si+5), 6); + if (context.flags.z()) goto animating; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + goto drawnsetob; +animating: + makebackob(context); +drawnsetob: + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.al = context.data.byte(181); + context.data.byte(context.si+4) = context.al; + context._add(context.si, 5); + context.data.word(18) = context.si; +blankframe: + context._add(context.data.byte(181), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 64); + context._sub(context.cx, 1); + if (context.flags.z()) goto finishedsetobs; + goto showobsloop; +finishedsetobs: return; } -static inline void addtopresslist(Context & context) { - context._cmp(context.data.word(280), 5); - if (context.flags.z()) goto nomorekeys; - context.al = context.data.byte(278); - context._cmp(context.al, 10); - if (!context.flags.z()) goto not10; +static void makebackob(Context & context) { + context._cmp(context.data.byte(62), 0); + if (context.flags.z()) goto nomake; + context.al = context.data.byte(context.si+5); + context.ah = context.data.byte(context.si+8); + context.push(context.si); + context.push(context.ax); + context.push(context.si); + context.ax = context.data.word(168); + context.bx = context.data.word(170); + context.ah = context.bl; + context.si = context.ax; + context.cx = 49520; + context.dx = context.data.word(444); + context.di = 0; + makesprite(context); + context.ax = context.pop(); + context.data.word(context.bx+20) = context.ax; + context.ax = context.pop(); + context._cmp(context.al, 255); + if (!context.flags.z()) goto usedpriority; context.al = 0; -not10: - context.bx = context.data.word(280); - context.dx = context.ds; - context.es = context.dx; - context._add(context.bx, 8350); - context.data.byte(context.bx) = context.al; - context._add(context.data.word(280), 1); -nomorekeys: +usedpriority: + context.data.byte(context.bx+23) = context.al; + context.data.byte(context.bx+30) = context.ah; + context.data.byte(context.bx+16) = 0; + context.data.byte(context.bx+18) = 0; + context.data.byte(context.bx+19) = 0; + context.si = context.pop(); +nomake: return; } -static inline void buttonone(Context & context) { - context.cl = 1; - buttonpress(context); +static void showallfree(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.data.word(18) = context.bx; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.cx = 80*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(446); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.al = 0; + context.data.byte(158) = context.al; + context.ds = context.data.word(426); + context.si = 2; + context.cx = 0; +loop127: + context.push(context.cx); + context.push(context.si); + context.push(context.si); + context.es = context.data.word(426); + getmapad(context); + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over138; + context.al = context.data.byte(158); + context.ah = 0; + context.dx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.dx); + context.data.word(160) = context.ax; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + context.es = context.data.word(402); + context.ds = context.data.word(166); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context._cmp(context.cx, 0); + if (context.flags.z()) goto over138; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.ax = context.pop(); + context.cx = context.pop(); + context.push(context.cx); + context.push(context.ax); + context.data.byte(context.si+4) = context.cl; + context._add(context.si, 5); + context.data.word(18) = context.si; +over138: + context._add(context.data.byte(158), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 80); + if (context.flags.z()) goto finfree; + goto loop127; +finfree: return; } -static inline void buttontwo(Context & context) { - context.cl = 2; - buttonpress(context); +static void showallex(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.data.word(18) = context.bx; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.cx = 100*5; + context.al = 255; + while(--context.cx) context._stosb(); + context.es = context.data.word(398); + context.data.word(166) = context.es; + context.ax = 0; + context.data.word(164) = context.ax; + context.ax = 0+2080; + context.data.word(162) = context.ax; + context.data.byte(157) = 0; + context.si = 0+2080+30000+2; + context.cx = 0; +exloop: + context.push(context.cx); + context.push(context.si); + context.es = context.data.word(398); + context.push(context.si); + context.ch = 0; + context._cmp(context.data.byte(context.si), 255); + if (context.flags.z()) goto notinroom; + context.al = context.data.byte(context.si-2); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinroom; + getmapad(context); +notinroom: + context.si = context.pop(); + context._cmp(context.ch, 0); + if (context.flags.z()) goto blankex; + context.al = context.data.byte(157); + context.ah = 0; + context.dx = context.ax; + context._add(context.ax, context.ax); + context._add(context.ax, context.dx); + context.data.word(160) = context.ax; + context.push(context.es); + context.push(context.si); + calcfrframe(context); + context.es = context.data.word(402); + context.ds = context.data.word(166); + finalframe(context); + context.si = context.pop(); + context.es = context.pop(); + context._cmp(context.cx, 0); + if (context.flags.z()) goto blankex; + context.ax = context.data.word(160); + context.ah = 0; + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); + showframe(context); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); + context.data.word(context.si) = context.ax; + context.cx = context.ax; + context.ax = context.data.word(176); + context._add(context.al, context.cl); + context._add(context.ah, context.ch); + context.data.word(context.si+2) = context.ax; + context.ax = context.pop(); + context.cx = context.pop(); + context.push(context.cx); + context.push(context.ax); + context.data.byte(context.si+4) = context.cl; + context._add(context.si, 5); + context.data.word(18) = context.si; +blankex: + context._add(context.data.byte(157), 1); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 16); + context._add(context.cx, 1); + context._cmp(context.cx, 100); + if (context.flags.z()) goto finex; + goto exloop; +finex: return; } -static inline void buttonthree(Context & context) { - context.cl = 3; - buttonpress(context); +static void calcfrframe(Context & context) { + context.dx = context.data.word(166); + context.ax = context.data.word(162); + context.push(context.ax); + context.cx = context.data.word(164); + context.ax = context.data.word(160); + context.ds = context.dx; + context.bx = 6; + context._mul(context.bx); + context._add(context.ax, context.cx); + context.bx = context.ax; + context.cx = context.data.word(context.bx); + context.ax = context.data.word(context.bx+2); + context.dx = context.data.word(context.bx+4); + context.bx = context.pop(); + context.push(context.dx); + context._add(context.ax, context.bx); + context.data.word(178) = context.ax; + context.data.word(176) = context.cx; + context.ax = context.pop(); + context.push(context.ax); + context.ah = 0; + context.data.word(172) = context.ax; + context.ax = context.pop(); + context.al = context.ah; + context.ah = 0; + context.data.word(174) = context.ax; return; -} - -static inline void buttonfour(Context & context) { - context.cl = 4; - buttonpress(context); +nullframe: + context.ax = context.pop(); + context.cx = 0; + context.data.word(176) = context.cx; return; } -static inline void buttonfive(Context & context) { - context.cl = 5; - buttonpress(context); +static void finalframe(Context & context) { + context.ax = context.data.word(170); + context._add(context.ax, context.data.word(174)); + context.bx = context.data.word(168); + context._add(context.bx, context.data.word(172)); + context.data.byte(179) = context.bl; + context.data.byte(180) = context.al; + context.di = context.data.word(168); + context.bx = context.data.word(170); return; } -static inline void buttonsix(Context & context) { - context.cl = 6; - buttonpress(context); +static void adjustlen(Context & context) { + context.ah = context.al; + context._add(context.al, context.ch); + context._cmp(context.al, 100); + if (context.flags.c()) goto over242; + context.al = 224; + context._sub(context.al, context.ch); + context.ch = context.al; +over242: return; } -static inline void buttonseven(Context & context) { - context.cl = 7; - buttonpress(context); +static void getmapad(Context & context) { + getxad(context); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over146; + context.data.word(168) = context.ax; + getyad(context); + context._cmp(context.ch, 0); + if (context.flags.z()) goto over146; + context.data.word(170) = context.ax; + context.ch = 1; +over146: return; } -static inline void buttoneight(Context & context) { - context.cl = 8; - buttonpress(context); +static void getxad(Context & context) { + context.cl = context.data.byte(context.si); + context._add(context.si, 1); + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.cl, 0); + if (!context.flags.z()) goto over148; + context._sub(context.al, context.data.byte(148)); + if (context.flags.c()) goto over148; + context._cmp(context.al, 11); + if (!context.flags.c()) goto over148; + context.cl = 4; + context._shl(context.al, context.cl); + context._or(context.al, context.ah); + context.ah = 0; + context.ch = 1; return; -} - -static inline void buttonnine(Context & context) { - context.cl = 9; - buttonpress(context); +over148: + context.ch = 0; return; } -static inline void buttonnought(Context & context) { - context.cl = 10; - buttonpress(context); +static void getyad(Context & context) { + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context.ah = context.data.byte(context.si); + context._add(context.si, 1); + context._sub(context.al, context.data.byte(149)); + if (context.flags.c()) goto over147; + context._cmp(context.al, 10); + if (!context.flags.c()) goto over147; + context.cl = 4; + context._shl(context.al, context.cl); + context._or(context.al, context.ah); + context.ah = 0; + context.ch = 1; + return; +over147: + context.ch = 0; return; } -static inline void buttonenter(Context & context) { - context.cl = 11; - buttonpress(context); +static void autolook(Context & context) { + context.ax = context.data.word(198); + context._cmp(context.ax, context.data.word(214)); + if (!context.flags.z()) goto diffmouse; + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(216)); + if (!context.flags.z()) goto diffmouse; + context._sub(context.data.word(98), 1); + context._cmp(context.data.word(98), 0); + if (!context.flags.z()) goto noautolook; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto noautolook; + dolook(context); +noautolook: + return; +diffmouse: + context.data.word(98) = 1000; return; } -static inline void buttonpress(Context & context) { - context.ch = context.cl; - context._add(context.ch, 100); - context._cmp(context.data.byte(100), context.ch); - if (context.flags.z()) goto alreadyb; - context.data.byte(100) = context.ch; - context.al = context.cl; - context._add(context.al, 4); - context.push(context.cx); +static void look(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 241); + if (context.flags.z()) goto alreadylook; + context.data.byte(100) = 241; + context.al = 25; commandonly(context); - context.cx = context.pop(); -alreadyb: +alreadylook: + context._cmp(context.data.word(202), 1); + if (!context.flags.z()) goto nolook; context.ax = context.data.word(202); context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notb; - context._and(context.ax, 1); - if (!context.flags.z()) goto dob; -notb: - return; -dob: - context.data.byte(278) = context.cl; - context._add(context.cl, 21); - context.data.byte(281) = context.cl; - context.data.byte(282) = 40; - context._cmp(context.cl, 32); - if (context.flags.z()) goto nonoise; - context.al = 10; - playchannel1(context); -nonoise: - return; -} - -static inline void showouterpad(Context & context) { - context.di = 36+112-3; - context.bx = 72-4; - context.ds = context.data.word(458); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = 36+112+74; - context.bx = 72+76; - context.ds = context.data.word(458); - context.al = 37; - context.ah = 0; - showframe(context); + if (context.flags.z()) goto nolook; + dolook(context); +nolook: return; } -static inline void showkeypad(Context & context) { - context.al = 22; - context.di = 36+112+9; - context.bx = 72+5; - singlekey(context); - context.al = 23; - context.di = 36+112+31; - context.bx = 72+5; - singlekey(context); - context.al = 24; - context.di = 36+112+53; - context.bx = 72+5; - singlekey(context); - context.al = 25; - context.di = 36+112+9; - context.bx = 72+23; - singlekey(context); - context.al = 26; - context.di = 36+112+31; - context.bx = 72+23; - singlekey(context); - context.al = 27; - context.di = 36+112+53; - context.bx = 72+23; - singlekey(context); - context.al = 28; - context.di = 36+112+9; - context.bx = 72+41; - singlekey(context); - context.al = 29; - context.di = 36+112+31; - context.bx = 72+41; - singlekey(context); - context.al = 30; - context.di = 36+112+53; - context.bx = 72+41; - singlekey(context); - context.al = 31; - context.di = 36+112+9; - context.bx = 72+59; - singlekey(context); - context.al = 32; - context.di = 36+112+31; - context.bx = 72+59; - singlekey(context); - context._cmp(context.data.byte(287), 0); - if (context.flags.z()) goto notenter; - context._sub(context.data.byte(287), 1); - context.al = 36; - context.bx = 72-1+63; - context._cmp(context.data.byte(37), 0); - if (!context.flags.z()) goto changelight; - context.al = 41; - context.bx = 72+4+63; -changelight: - context._cmp(context.data.byte(287), 60); - if (context.flags.c()) goto gotlight; - context._cmp(context.data.byte(287), 100); - if (!context.flags.c()) goto gotlight; - context._sub(context.al, 1); -gotlight: - context.ds = context.data.word(458); - context.ah = 0; - context.di = 36+112+60; - showframe(context); -notenter: +static void dolook(Context & context) { + createpanel(context); + showicon(context); + undertextline(context); + worktoscreenm(context); + context.data.byte(100) = 255; + dumptextline(context); + context.bl = context.data.byte(185); + context._and(context.bl, 31); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(436); + context._add(context.bx, 0); + context.si = context.data.word(context.bx); + context._add(context.si, 0+(38*2)); + findnextcolon(context); + context.di = 66; + context._cmp(context.data.byte(184), 50); + if (context.flags.c()) goto notdream3; + context.di = 40; +notdream3: + context.bx = 80; + context.dl = 241; + printslow(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto afterlook; + context.cx = 400; + hangonp(context); +afterlook: + context.data.byte(234) = 0; + context.data.byte(100) = 0; + redrawmainscrn(context); + worktoscreenm(context); return; } -static inline void singlekey(Context & context) { - context._cmp(context.data.byte(281), context.al); - if (!context.flags.z()) goto gotkey; - context._add(context.al, 11); - context._cmp(context.data.byte(282), 8); - if (!context.flags.c()) goto gotkey; - context._sub(context.al, 11); -gotkey: - context.ds = context.data.word(458); - context._sub(context.al, 20); - context.ah = 0; - showframe(context); +static void redrawmainscrn(Context & context) { + context.data.word(328) = 0; + createpanel(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + readmouse(context); + context.data.byte(100) = 255; return; } -static inline void dumpkeypad(Context & context) { - context.di = 36+112-3; - context.bx = 72-4; - context.cl = 120; - context.ch = 90; - multidump(context); +static void getback1(Context & context) { + context._cmp(context.data.byte(106), 0); + if (context.flags.z()) goto notgotobject; + blank(context); + return; +notgotobject: + context._cmp(context.data.byte(100), 202); + if (context.flags.z()) goto alreadyget; + context.data.byte(100) = 202; + context.al = 26; + commandonly(context); +alreadyget: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nogetback; + context._and(context.ax, 1); + if (!context.flags.z()) goto dogetback; +nogetback: + return; +dogetback: + context.data.byte(103) = 1; + context.data.byte(106) = 0; return; } -static inline void usemenu(Context & context) { - getridofreels(context); - loadmenu(context); +static void talk(Context & context) { + context.data.byte(246) = 0; + context.data.byte(237) = 0; + context.al = context.data.byte(99); + context.data.byte(247) = context.al; createpanel(context); showpanel(context); - showicon(context); - context.data.byte(62) = 0; - drawfloor(context); - printsprites(context); - context.al = 4; - context.ah = 0; - context.di = 80+40-48; - context.bx = 60-4; - context.ds = context.data.word(460); - showframe(context); - getundermenu(context); - context.al = 5; - context.ah = 0; - context.di = 80+40+54; - context.bx = 60+72; - context.ds = context.data.word(460); - showframe(context); - worktoscreenm(context); - context.data.byte(103) = 0; -menuloop: + showman(context); + showexit(context); + undertextline(context); + convicons(context); + starttalk(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); +waittalk: delpointer(context); - putundermenu(context); - showmenu(context); readmouse(context); + animpointer(context); showpointer(context); vsync(context); dumppointer(context); - dumpmenu(context); dumptextline(context); - context.bx = 3525; + context.data.byte(103) = 0; + context.bx = 2660; checkcoords(context); - context._cmp(context.data.byte(103), 1); - if (!context.flags.z()) goto menuloop; - context.data.byte(131) = 0; + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waittalk; +finishtalk: + context.bx = context.data.word(249); + context.es = context.cs; + context._cmp(context.data.byte(246), 4); + if (context.flags.c()) goto notnexttalk; + context.al = context.data.byte(context.bx+7); + context._or(context.al, 128); + context.data.byte(context.bx+7) = context.al; +notnexttalk: redrawmainscrn(context); - getridoftemp(context); - getridoftemp2(context); - restorereels(context); worktoscreenm(context); - return; -menulist: + context._cmp(context.data.byte(383), 1); + if (!context.flags.z()) goto nospeech; + cancelch1(context); + context.data.byte(388) = -1; + context.data.byte(387) = 0; +nospeech: return; } -static inline void dumpmenu(Context & context) { - context.di = 80+40; - context.bx = 60; - context.cl = 48; - context.ch = 48; - multidump(context); +static void convicons(Context & context) { + context.al = context.data.byte(247); + context._and(context.al, 127); + getpersframe(context); + context.di = 234; + context.bx = 2; + context.data.word(160) = context.ax; + findsource(context); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); + context.ah = 0; + showframe(context); return; } -static inline void getundermenu(Context & context) { - context.di = 80+40; - context.bx = 60; - context.cl = 48; - context.ch = 48; - context.ds = context.data.word(412); - context.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(context); +static void getpersframe(Context & context) { + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(448); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); return; } -static inline void putundermenu(Context & context) { - context.di = 80+40; - context.bx = 60; - context.cl = 48; - context.ch = 48; - context.ds = context.data.word(412); - context.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(context); +static void starttalk(Context & context) { + context.data.byte(245) = 0; + context.al = context.data.byte(247); + context._and(context.al, 127); + getpersontext(context); + context.data.word(71) = 91+91; + context.di = 66; + context.bx = 64; + context.dl = 241; + context.al = 0; + context.ah = 79; + printdirect(context); + context.data.word(71) = 0; + context.di = 66; + context.bx = 80; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); +nospeech1: return; } -static inline void showoutermenu(Context & context) { - context.al = 40; - context.ah = 0; - context.di = 80+40-34; - context.bx = 60-40; - context.ds = context.data.word(458); - showframe(context); - context.al = 41; - context.ah = 0; - context.di = 80+40+64-34; - context.bx = 60-40; - context.ds = context.data.word(458); - showframe(context); - context.al = 42; - context.ah = 0; - context.di = 80+40-26; - context.bx = 60+57-40; - context.ds = context.data.word(458); - showframe(context); - context.al = 43; +static void getpersontext(Context & context) { context.ah = 0; - context.di = 80+40+64-26; - context.bx = 60+57-40; - context.ds = context.data.word(458); - showframe(context); + context.cx = 64*2; + context._mul(context.cx); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + return; +} + +static void moretalk(Context & context) { + context._cmp(context.data.byte(245), 0); + if (context.flags.z()) goto canmore; + redes(context); + return; +canmore: + context._cmp(context.data.byte(100), 215); + if (context.flags.z()) goto alreadymore; + context.data.byte(100) = 215; + context.al = 49; + commandonly(context); +alreadymore: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nomore; + context._and(context.ax, 1); + if (!context.flags.z()) goto domoretalk; +nomore: + return; +domoretalk: + context.data.byte(245) = 2; + context.data.byte(246) = 4; + context._cmp(context.data.byte(247), 100); + if (context.flags.c()) goto notsecondpart; + context.data.byte(246) = 48; +notsecondpart: + dosometalk(context); return; } -static inline void showmenu(Context & context) { - context._add(context.data.byte(290), 1); - context._cmp(context.data.byte(290), 37*2); - if (!context.flags.z()) goto menuframeok; - context.data.byte(290) = 0; -menuframeok: - context.al = context.data.byte(290); - context._shr(context.al, 1); +static void dosometalk(Context & context) { +watchtalk: + context.al = context.data.byte(246); + context.al = context.data.byte(247); + context._and(context.al, 127); context.ah = 0; - context.di = 80+40; - context.bx = 60; - context.ds = context.data.word(458); - showframe(context); - return; -} - -static inline void loadmenu(Context & context) { - context.dx = 1845; - loadintotemp(context); - context.dx = 2000; - loadintotemp2(context); + context.cx = 64; + context._mul(context.cx); + context.cx = context.ax; + context.al = context.data.byte(246); + context.ah = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.ax); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto endwatchtalk; + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 164; + context.bx = 64; + context.dl = 144; + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(234) = 3; + worktoscreenm(context); + context.cx = 180; + hangonpq(context); + context._add(context.data.byte(246), 1); + context.al = context.data.byte(246); + context.al = context.data.byte(247); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cx = context.ax; + context.al = context.data.byte(246); + context.ah = 0; + context._add(context.ax, context.cx); + context._add(context.ax, context.ax); + context.si = context.ax; + context.es = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto endwatchtalk; + context._cmp(context.data.byte(context.si), ':'); + if (context.flags.z()) goto skiptalk; + context._cmp(context.data.byte(context.si), 32); + if (context.flags.z()) goto skiptalk; + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 48; + context.bx = 128; + context.dl = 144; + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(234) = 3; + worktoscreenm(context); + context.cx = 180; + hangonpq(context); +skiptalk: + context._add(context.data.byte(246), 1); + goto watchtalk; +endwatchtalk: + context.data.byte(234) = 0; return; } -static inline void viewfolder(Context & context) { - context.data.byte(131) = 1; - getridofall(context); - loadfolder(context); - context.data.byte(288) = 0; - showfolder(context); - worktoscreenm(context); +static void hangonpq(Context & context) { context.data.byte(103) = 0; -folderloop: + context.bx = 0; +hangloopq: + context.push(context.cx); + context.push(context.bx); delpointer(context); readmouse(context); + animpointer(context); showpointer(context); vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3547; + context.bx = 2692; checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto folderloop; - context.data.byte(131) = 0; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - getridoftempcharset(context); - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); - return; -} - -static inline void nextfolder(Context & context) { - context._cmp(context.data.byte(288), 12); - if (!context.flags.z()) goto cannextf; - blank(context); - return; -cannextf: - context._cmp(context.data.byte(100), 201); - if (context.flags.z()) goto alreadynextf; - context.data.byte(100) = 201; - context.al = 16; - commandonly(context); -alreadynextf: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notnextf; - context._cmp(context.ax, 1); - if (context.flags.z()) goto donextf; -notnextf: - return; -donextf: - context._add(context.data.byte(288), 1); - folderhints(context); + context.bx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto quitconv; + context._cmp(context.data.byte(383), 1); + if (!context.flags.z()) goto notspeaking; + context._cmp(context.data.byte(515), 255); + if (!context.flags.z()) goto notspeaking; + context._add(context.bx, 1); + context._cmp(context.bx, 40); + if (context.flags.z()) goto finishconv; +notspeaking: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto hangloopq; + context._cmp(context.data.word(212), 0); + if (!context.flags.z()) goto hangloopq; +finishconv: delpointer(context); - showfolder(context); - context.data.word(202) = 0; - context.bx = 3547; - checkcoords(context); - worktoscreenm(context); - return; -} - -static inline void folderhints(Context & context) { - context._cmp(context.data.byte(288), 5); - if (!context.flags.z()) goto notaideadd; - context._cmp(context.data.byte(44), 1); - if (context.flags.z()) goto notaideadd; - context.al = 13; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) goto notaideadd; - context.al = 13; - setlocation(context); - showfolder(context); - context.al = 30; - findtext1(context); - context.di = 0; - context.bx = 86; - context.dl = 141; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); + context.data.byte(234) = 0; return; -notaideadd: - context._cmp(context.data.byte(288), 9); - if (!context.flags.z()) goto notaristoadd; - context.al = 7; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) goto notaristoadd; - context.al = 7; - setlocation(context); - showfolder(context); - context.al = 31; - findtext1(context); - context.di = 0; - context.bx = 86; - context.dl = 141; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); -notaristoadd: +quitconv: + delpointer(context); + context.data.byte(234) = 0; + context.ax = context.pop(); + cancelch1(context); return; } -static inline void lastfolder(Context & context) { - context._cmp(context.data.byte(288), 0); - if (!context.flags.z()) goto canlastf; +static void redes(Context & context) { + context._cmp(context.data.byte(515), 255); + if (!context.flags.z()) goto cantredes; + context._cmp(context.data.byte(245), 2); + if (context.flags.z()) goto canredes; +cantredes: blank(context); return; -canlastf: - context._cmp(context.data.byte(100), 202); - if (context.flags.z()) goto alreadylastf; - context.data.byte(100) = 202; - context.al = 17; +canredes: + context._cmp(context.data.byte(100), 217); + if (context.flags.z()) goto alreadyreds; + context.data.byte(100) = 217; + context.al = 50; commandonly(context); -alreadylastf: - context._cmp(context.data.byte(288), 0); - if (context.flags.z()) goto notlastf; +alreadyreds: context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notlastf; - context._cmp(context.ax, 1); - if (context.flags.z()) goto dolastf; -notlastf: + context._and(context.ax, 1); + if (!context.flags.z()) goto doredes; return; -dolastf: - context._sub(context.data.byte(288), 1); +doredes: + delpointer(context); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + convicons(context); + starttalk(context); + readmouse(context); + showpointer(context); + worktoscreen(context); delpointer(context); - showfolder(context); - context.data.word(202) = 0; - context.bx = 3547; - checkcoords(context); - worktoscreenm(context); return; } -static inline void loadfolder(Context & context) { - context.dx = 2312; - loadintotemp(context); - context.dx = 2325; - loadintotemp2(context); - context.dx = 2338; - loadintotemp3(context); - context.dx = 1896; - loadtempcharset(context); - context.dx = 2208; - loadtemptext(context); +static void newplace(Context & context) { + context._cmp(context.data.byte(60), 1); + if (context.flags.z()) goto istravel; + context._cmp(context.data.byte(189), -1); + if (!context.flags.z()) goto isautoloc; + return; +isautoloc: + context.al = context.data.byte(189); + context.data.byte(188) = context.al; + context.data.byte(189) = -1; + return; +istravel: + context.data.byte(60) = 0; + selectlocation(context); return; } -static inline void showfolder(Context & context) { +static void selectlocation(Context & context) { + context.data.byte(237) = 0; + clearbeforeload(context); + context.data.byte(103) = 0; + context.data.byte(231) = 22; + readcitypic(context); + showcity(context); + getridoftemp(context); + readdesticon(context); + loadtraveltext(context); + showpanel(context); + showman(context); + showarrows(context); + showexit(context); + locationpic(context); + undertextline(context); context.data.byte(100) = 255; - context._cmp(context.data.byte(288), 0); - if (context.flags.z()) goto closedfolder; - usetempcharset(context); - createpanel2(context); + readmouse(context); + context.data.byte(231) = 0; + showpointer(context); + worktoscreen(context); + context.al = 9; + context.ah = 255; + playchannel0(context); + context.data.byte(188) = 255; +select: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto quittravel; + context.bx = 2714; + checkcoords(context); + context._cmp(context.data.byte(188), 255); + if (context.flags.z()) goto select; + context.al = context.data.byte(188); + context._cmp(context.al, context.data.byte(9)); + if (context.flags.z()) goto quittravel; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + context.es = context.data.word(456); + deallocatemem(context); + return; +quittravel: + context.al = context.data.byte(184); + context.data.byte(188) = context.al; + context.data.byte(103) = 0; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + context.es = context.data.word(456); + deallocatemem(context); + return; +} + +static void showcity(Context & context) { + clearwork(context); context.ds = context.data.word(458); - context.di = 0; - context.bx = 0; + context.di = 57; + context.bx = 32; context.al = 0; context.ah = 0; showframe(context); context.ds = context.data.word(458); - context.di = 143; - context.bx = 0; + context.di = 120+57; + context.bx = 32; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); - context.di = 0; - context.bx = 92; - context.al = 2; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 143; - context.bx = 92; - context.al = 3; - context.ah = 0; - showframe(context); - folderexit(context); - context._cmp(context.data.byte(288), 1); - if (context.flags.z()) goto noleftpage; - showleftpage(context); -noleftpage: - context._cmp(context.data.byte(288), 12); - if (context.flags.z()) goto norightpage; - showrightpage(context); -norightpage: - usecharset1(context); - undertextline(context); return; -closedfolder: - createpanel2(context); +} + +static void lookatplace(Context & context) { + context._cmp(context.data.byte(100), 224); + if (context.flags.z()) goto alreadyinfo; + context.data.byte(100) = 224; + context.al = 27; + commandonly(context); +alreadyinfo: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noinfo; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noinfo; + context.bl = context.data.byte(183); + context._cmp(context.bl, 15); + if (!context.flags.c()) goto noinfo; + context.push(context.bx); + delpointer(context); + deltextline(context); + getundercentre(context); context.ds = context.data.word(462); - context.di = 143-28; - context.bx = 0; context.al = 0; context.ah = 0; + context.di = 60; + context.bx = 72; + showframe(context); + context.al = 4; + context.ah = 0; + context.di = 60; + context.bx = 72+55; showframe(context); - context.ds = context.data.word(462); - context.di = 143-28; - context.bx = 92; - context.al = 1; + context.al = 4; context.ah = 0; + context.di = 60; + context.bx = 72+55+21; showframe(context); - folderexit(context); - undertextline(context); + context.bx = context.pop(); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(456); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + findnextcolon(context); + context.di = 63; + context.bx = 84+4; + context.dl = 191; + context.al = 0; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = 500; + hangonp(context); +afterinfo: + context.data.byte(234) = 0; + context.data.byte(231) = 0; + putundercentre(context); + worktoscreenm(context); +noinfo: return; } -static inline void folderexit(Context & context) { - context.ds = context.data.word(460); - context.di = 296; - context.bx = 178; - context.al = 6; - context.ah = 0; - showframe(context); +static void getundercentre(Context & context) { + context.di = 58; + context.bx = 72; + context.ds = context.data.word(402); + context.si = 0; + context.cl = 254; + context.ch = 110; + multiget(context); return; } -static inline void showleftpage(Context & context) { - context.ds = context.data.word(460); +static void putundercentre(Context & context) { + context.di = 58; + context.bx = 72; + context.ds = context.data.word(402); + context.si = 0; + context.cl = 254; + context.ch = 110; + multiput(context); + return; +} + +static void locationpic(Context & context) { + getdestinfo(context); + context.al = context.data.byte(context.si); + context.push(context.es); + context.push(context.si); context.di = 0; - context.bx = 12; - context.al = 3; - context.ah = 0; - showframe(context); - context.bx = 12+5; - context.cx = 9; -leftpageloop: - context.push(context.cx); - context.push(context.bx); + context._cmp(context.al, 6); + if (!context.flags.c()) goto secondlot; + context.ds = context.data.word(458); + context._add(context.al, 4); + goto gotgraphic; +secondlot: + context._sub(context.al, 6); context.ds = context.data.word(460); - context.di = 0; - context.al = 4; +gotgraphic: + context._add(context.di, 104); + context.bx = 138+14; context.ah = 0; showframe(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - if (--context.cx) goto leftpageloop; - context.ds = context.data.word(460); - context.di = 0; - context.al = 5; + context.si = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(183); + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto notinthisone; + context.al = 3; + context.di = 104; + context.bx = 140+14; + context.ds = context.data.word(458); context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.word(71) = 91; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); - context._sub(context.bl, 1); - context._sub(context.bl, 1); - context._add(context.bl, context.bl); +notinthisone: + context.bl = context.data.byte(183); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); + context.es = context.data.word(456); context.si = context.data.word(context.bx); context._add(context.si, 66*2); - context.di = 2; - context.bx = 48; - context.dl = 140; - context.cx = 2; -twolotsleft: - context.push(context.cx); -contleftpage: + context.di = 50; + context.bx = 20; + context.dl = 241; + context.al = 0; + context.ah = 0; printdirect(context); - context._add(context.bx, context.data.word(77)); - context._cmp(context.al, 0); - if (!context.flags.z()) goto contleftpage; - context.cx = context.pop(); - if (--context.cx) goto twolotsleft; - context.data.byte(72) = 0; - context.data.word(71) = 0; - context.data.word(77) = 10; - context.es = context.data.word(400); - context.ds = context.data.word(400); - context.di = (48*320)+2; - context.si = (48*320)+2+130; - context.cx = 120; -flipfolder: + return; +} + +static void getdestinfo(Context & context) { + context.al = context.data.byte(183); + context.ah = 0; + context.push(context.ax); + context.dx = context.ds; + context.es = context.dx; + context.si = 7798; + context._add(context.si, context.ax); + context.cl = context.data.byte(context.si); + context.ax = context.pop(); context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.cx = 65; -flipfolderline: - context.al = context.data.byte(context.di); - context.ah = context.data.byte(context.si); - context.data.byte(context.di) = context.ah; - context.data.byte(context.si) = context.al; - context._sub(context.si, 1); - context._add(context.di, 1); - if (--context.cx) goto flipfolderline; - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.si, 320); - context._add(context.di, 320); - if (--context.cx) goto flipfolder; + context.dx = context.ds; + context.es = context.dx; + context.si = 7813; + context._add(context.si, context.ax); + context.ax = context.pop(); return; } -static inline void showrightpage(Context & context) { - context.ds = context.data.word(460); - context.di = 143; - context.bx = 12; +static void showarrows(Context & context) { + context.di = 116-12; + context.bx = 16; + context.ds = context.data.word(458); context.al = 0; context.ah = 0; showframe(context); - context.bx = 12+37; - context.cx = 7; -rightpageloop: - context.push(context.cx); - context.push(context.bx); - context.ds = context.data.word(460); - context.di = 143; + context.di = 226+12; + context.bx = 16; + context.ds = context.data.word(458); context.al = 1; context.ah = 0; showframe(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - if (--context.cx) goto rightpageloop; - context.ds = context.data.word(460); - context.di = 143; + context.di = 280; + context.bx = 14; + context.ds = context.data.word(458); context.al = 2; context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); - context._sub(context.bl, 1); - context._add(context.bl, context.bl); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(466); - context.si = context.data.word(context.bx); - context._add(context.si, 66*2); - context.di = 152; - context.bx = 48; - context.dl = 140; - context.cx = 2; -twolotsright: - context.push(context.cx); -contrightpage: - printdirect(context); - context._add(context.bx, context.data.word(77)); - context._cmp(context.al, 0); - if (!context.flags.z()) goto contrightpage; - context.cx = context.pop(); - if (--context.cx) goto twolotsright; - context.data.byte(72) = 0; - context.data.word(77) = 10; return; } -static inline void entersymbol(Context & context) { - context.data.byte(131) = 1; - getridofreels(context); - context.dx = 2351; - loadintotemp(context); - context.data.byte(291) = 24; - context.data.byte(293) = 0; - context.data.byte(294) = 24; - context.data.byte(296) = 0; - redrawmainscrn(context); - showsymbol(context); - undertextline(context); - worktoscreenm(context); - context.data.byte(103) = 0; -symbolloop: +static void nextdest(Context & context) { +duok: + context._cmp(context.data.byte(100), 218); + if (context.flags.z()) goto alreadydu; + context.data.byte(100) = 218; + context.al = 28; + commandonly(context); +alreadydu: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto nodu; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodu; +searchdestup: + context._add(context.data.byte(183), 1); + context._cmp(context.data.byte(183), 15); + if (!context.flags.z()) goto notlastdest; + context.data.byte(183) = 0; +notlastdest: + getdestinfo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto searchdestup; + context.data.byte(109) = 1; + deltextline(context); delpointer(context); - updatesymboltop(context); - updatesymbolbot(context); - showsymbol(context); + showpanel(context); + showman(context); + showarrows(context); + locationpic(context); + undertextline(context); readmouse(context); showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - dumpsymbol(context); - context.bx = 3589; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto symbolloop; - context._cmp(context.data.byte(295), 3); - if (!context.flags.z()) goto symbolwrong; - context._cmp(context.data.byte(292), 5); - if (!context.flags.z()) goto symbolwrong; - context.al = 43; - removesetobject(context); - context.al = 46; - placesetobject(context); - context.ah = context.data.byte(185); - context._add(context.ah, 12); - context.al = 0; - turnanypathon(context); - context.data.byte(131) = 0; - redrawmainscrn(context); - getridoftemp(context); - restorereels(context); - worktoscreenm(context); - context.al = 13; - playchannel1(context); + worktoscreen(context); + delpointer(context); +nodu: return; -symbolwrong: - context.al = 46; - removesetobject(context); - context.al = 43; - placesetobject(context); - context.ah = context.data.byte(185); - context._add(context.ah, 12); - context.al = 0; - turnanypathoff(context); - context.data.byte(131) = 0; - redrawmainscrn(context); - getridoftemp(context); - restorereels(context); - worktoscreenm(context); +} + +static void lastdest(Context & context) { +ddok: + context._cmp(context.data.byte(100), 219); + if (context.flags.z()) goto alreadydd; + context.data.byte(100) = 219; + context.al = 29; + commandonly(context); +alreadydd: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto nodd; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodd; +searchdestdown: + context._sub(context.data.byte(183), 1); + context._cmp(context.data.byte(183), -1); + if (!context.flags.z()) goto notfirstdest; + context.data.byte(183) = 15; +notfirstdest: + getdestinfo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto searchdestdown; + context.data.byte(109) = 1; + deltextline(context); + delpointer(context); + showpanel(context); + showman(context); + showarrows(context); + locationpic(context); + undertextline(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); +nodd: return; } -static inline void quitsymbol(Context & context) { - context._cmp(context.data.byte(291), 24); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(294), 24); - if (!context.flags.z()) { blank(context); return; }; +static void destselect(Context & context) { context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadyqs; + if (context.flags.z()) goto alreadytrav; context.data.byte(100) = 222; - context.al = 18; + context.al = 30; commandonly(context); -alreadyqs: +alreadytrav: context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notqs; context._and(context.ax, 1); - if (!context.flags.z()) goto doqs; -notqs: - return; -doqs: - context.data.byte(103) = 1; + if (context.flags.z()) goto notrav; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notrav; + getdestinfo(context); + context.al = context.data.byte(183); + context.data.byte(188) = context.al; +notrav: return; } -static inline void settopleft(Context & context) { - context._cmp(context.data.byte(293), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 210); - if (context.flags.z()) goto alreadytopl; - context.data.byte(100) = 210; - context.al = 19; - commandonly(context); -alreadytopl: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto notopleft; - context.data.byte(293) = -1; -notopleft: +static void getlocation(Context & context) { + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.al = context.data.byte(context.bx); return; } -static inline void settopright(Context & context) { - context._cmp(context.data.byte(293), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 211); - if (context.flags.z()) goto alreadytopr; - context.data.byte(100) = 211; - context.al = 20; - commandonly(context); -alreadytopr: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto notopright; - context.data.byte(293) = 1; -notopright: +static void setlocation(Context & context) { + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.data.byte(context.bx) = 1; return; } -static inline void setbotleft(Context & context) { - context._cmp(context.data.byte(296), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 212); - if (context.flags.z()) goto alreadybotl; - context.data.byte(100) = 212; +static void resetlocation(Context & context) { + context.push(context.ax); + context._cmp(context.al, 5); + if (!context.flags.z()) goto notdelhotel; + purgealocation(context); context.al = 21; - commandonly(context); -alreadybotl: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto nobotleft; - context.data.byte(296) = -1; -nobotleft: + purgealocation(context); + context.al = 22; + purgealocation(context); + context.al = 27; + purgealocation(context); + goto clearedlocations; +notdelhotel: + context._cmp(context.al, 8); + if (!context.flags.z()) goto notdeltvstud; + purgealocation(context); + context.al = 28; + purgealocation(context); + goto clearedlocations; +notdeltvstud: + context._cmp(context.al, 6); + if (!context.flags.z()) goto notdelsarters; + purgealocation(context); + context.al = 20; + purgealocation(context); + context.al = 25; + purgealocation(context); + goto clearedlocations; +notdelsarters: + context._cmp(context.al, 13); + if (!context.flags.z()) goto notdelboathouse; + purgealocation(context); + context.al = 29; + purgealocation(context); + goto clearedlocations; +notdelboathouse: +clearedlocations: + context.ax = context.pop(); + context.ah = 0; + context.bx = context.ax; + context.dx = context.ds; + context.es = context.dx; + context._add(context.bx, 7798); + context.data.byte(context.bx) = 0; return; } -static inline void setbotright(Context & context) { - context._cmp(context.data.byte(296), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 213); - if (context.flags.z()) goto alreadybotr; - context.data.byte(100) = 213; - context.al = 22; - commandonly(context); -alreadybotr: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto nobotright; - context.data.byte(296) = 1; -nobotright: +static void readdesticon(Context & context) { + context.dx = 2026; + loadintotemp(context); + context.dx = 2039; + loadintotemp2(context); + context.dx = 1974; + loadintotemp3(context); return; } -static inline void dumpsymbol(Context & context) { - context.data.byte(109) = 0; - context.di = 64; - context.bx = 56+20; - context.cl = 104; - context.ch = 60; - multidump(context); +static void readcitypic(Context & context) { + context.dx = 2013; + loadintotemp(context); return; } -static inline void showsymbol(Context & context) { - context.al = 12; - context.ah = 0; - context.di = 64; - context.bx = 56; - context.ds = context.data.word(458); - showframe(context); - context.al = context.data.byte(291); - context.ah = 0; - context.di = context.ax; - context._add(context.di, 64-44); - context.al = context.data.byte(292); - context.bx = 56+20; - context.ds = context.data.word(458); - context.ah = 32; - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - context.push(context.ax); +static void usemon(Context & context) { + context.data.byte(55) = 0; + context.es = context.cs; + context.di = 2895+1; + context.cx = 12; + context.al = 32; + while(--context.cx) context._stosb(); + context.es = context.cs; + context.di = 2883+1; + context.cx = 12; + context.al = 32; + while(--context.cx) context._stosb(); + context.es = context.cs; + context.di = 2807; + context.data.byte(context.di) = 1; + context._add(context.di, 26); + context.cx = 3; +keyloop: + context.data.byte(context.di) = 0; + context._add(context.di, 26); + if (--context.cx) goto keyloop; + createpanel(context); + showpanel(context); + showicon(context); + drawfloor(context); + getridofall(context); + context.dx = 1987; + loadintotemp(context); + loadpersonal(context); + loadnews(context); + loadcart(context); + context.dx = 1883; + loadtempcharset(context); + printoutermon(context); + initialmoncols(context); + printlogo(context); + worktoscreen(context); + turnonpower(context); + fadeupyellows(context); + fadeupmonfirst(context); + context.data.word(318) = 76; + context.data.word(320) = 141; + context.al = 1; + monmessage(context); + context.cx = 120; + hangoncurs(context); + context.al = 2; + monmessage(context); + context.cx = 60; + randomaccess(context); + context.al = 3; + monmessage(context); + context.cx = 100; + hangoncurs(context); + printlogo(context); + scrollmonitor(context); + context.data.word(394) = 0; + context.data.word(396) = 0; +moreinput: + context.di = context.data.word(318); + context.bx = context.data.word(320); context.push(context.di); context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); + input(context); context.bx = context.pop(); context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - showframe(context); - context.al = context.data.byte(294); + context.data.word(318) = context.di; + context.data.word(320) = context.bx; + execcommand(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto moreinput; +endmon: + getridoftemp(context); + getridoftempcharset(context); + context.es = context.data.word(466); + deallocatemem(context); + context.es = context.data.word(468); + deallocatemem(context); + context.es = context.data.word(470); + deallocatemem(context); + context.data.byte(103) = 1; + context.al = 26; + playchannel1(context); + context.data.byte(131) = 0; + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); + return; +} + +static void printoutermon(Context & context) { + context.di = 40; + context.bx = 32; + context.ds = context.data.word(458); + context.al = 1; context.ah = 0; - context.di = context.ax; - context._add(context.di, 64-44); - context.al = context.data.byte(295); - context._add(context.al, 6); - context.bx = 56+49; + showframe(context); + context.di = 264; + context.bx = 32; context.ds = context.data.word(458); - context.ah = 32; - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); + context.al = 2; + context.ah = 0; showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); + context.di = 40; + context.bx = 12; + context.ds = context.data.word(458); + context.al = 3; + context.ah = 0; showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); + context.di = 40; + context.bx = 164; + context.ds = context.data.word(458); + context.al = 4; + context.ah = 0; showframe(context); return; } -static inline void nextsymbol(Context & context) { - context._add(context.al, 1); - context._cmp(context.al, 6); - if (context.flags.z()) goto topwrap; - context._cmp(context.al, 12); - if (context.flags.z()) goto botwrap; - return; -topwrap: - context.al = 0; - return; -botwrap: - context.al = 6; +static void loadpersonal(Context & context) { + context.al = context.data.byte(9); + context.dx = 2065; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundpersonal; + context._cmp(context.al, 42); + if (context.flags.z()) goto foundpersonal; + context.dx = 2078; + context._cmp(context.al, 2); + if (context.flags.z()) goto foundpersonal; +foundpersonal: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(466) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); return; } -static inline void updatesymboltop(Context & context) { - context._cmp(context.data.byte(293), 0); - if (context.flags.z()) goto topfinished; - context._cmp(context.data.byte(293), -1); - if (context.flags.z()) goto backwards; - context._add(context.data.byte(291), 1); - context._cmp(context.data.byte(291), 49); - if (!context.flags.z()) goto notwrapfor; - context.data.byte(291) = 0; - context._sub(context.data.byte(292), 1); - context._cmp(context.data.byte(292), -1); - if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 5; - return; -notwrapfor: - context._cmp(context.data.byte(291), 24); - if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; - return; -backwards: - context._sub(context.data.byte(291), 1); - context._cmp(context.data.byte(291), -1); - if (!context.flags.z()) goto notwrapback; - context.data.byte(291) = 48; - context._add(context.data.byte(292), 1); - context._cmp(context.data.byte(292), 6); - if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 0; - return; -notwrapback: - context._cmp(context.data.byte(291), 24); - if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; -topfinished: +static void loadnews(Context & context) { + context.al = context.data.byte(34); + context.dx = 2091; + context._cmp(context.al, 0); + if (context.flags.z()) goto foundnews; + context.dx = 2104; + context._cmp(context.al, 1); + if (context.flags.z()) goto foundnews; + context.dx = 2117; + context._cmp(context.al, 2); + if (context.flags.z()) goto foundnews; + context.dx = 2130; +foundnews: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(468) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); return; } -static inline void updatesymbolbot(Context & context) { - context._cmp(context.data.byte(296), 0); - if (context.flags.z()) goto botfinished; - context._cmp(context.data.byte(296), -1); - if (context.flags.z()) goto backwardsbot; - context._add(context.data.byte(294), 1); - context._cmp(context.data.byte(294), 49); - if (!context.flags.z()) goto notwrapforb; - context.data.byte(294) = 0; - context._sub(context.data.byte(295), 1); - context._cmp(context.data.byte(295), -1); - if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 5; - return; -notwrapforb: - context._cmp(context.data.byte(294), 24); - if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; - return; -backwardsbot: - context._sub(context.data.byte(294), 1); - context._cmp(context.data.byte(294), -1); - if (!context.flags.z()) goto notwrapbackb; - context.data.byte(294) = 48; - context._add(context.data.byte(295), 1); - context._cmp(context.data.byte(295), 6); - if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 0; - return; -notwrapbackb: - context._cmp(context.data.byte(294), 24); - if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; -botfinished: +static void loadcart(Context & context) { + lookininterface(context); + context.dx = 2143; + context._cmp(context.al, 0); + if (context.flags.z()) goto gotcart; + context.dx = 2156; + context._cmp(context.al, 1); + if (context.flags.z()) goto gotcart; + context.dx = 2169; + context._cmp(context.al, 2); + if (context.flags.z()) goto gotcart; + context.dx = 2182; + context._cmp(context.al, 3); + if (context.flags.z()) goto gotcart; + context.dx = 2195; +gotcart: + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.data.word(470) = context.ax; + context.ds = context.ax; + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + closefile(context); return; } -static inline void dumpsymbox(Context & context) { - context._cmp(context.data.word(303), -1); - if (context.flags.z()) goto nodumpsym; - context.di = context.data.word(303); - context.bx = context.data.word(305); - context.cl = 30; - context.ch = 77; - multidump(context); - context.data.word(303) = -1; -nodumpsym: +static void lookininterface(Context & context) { + context.al = 'I'; + context.ah = 'N'; + context.cl = 'T'; + context.ch = 'F'; + findsetobject(context); + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (context.flags.z()) goto emptyinterface; + context.al = context.data.byte(context.bx+15); + context._add(context.al, 1); + return; +emptyinterface: + context.al = 0; return; } - -static inline void usediary(Context & context) { - getridofreels(context); - context.dx = 2052; - loadintotemp(context); - context.dx = 2221; - loadtemptext(context); - context.dx = 1896; - loadtempcharset(context); - createpanel(context); - showicon(context); - showdiary(context); - undertextline(context); - showdiarypage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.byte(103) = 0; -diaryloop: - delpointer(context); - readmouse(context); - showdiarykeys(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumpdiarykeys(context); - dumptextline(context); - context.bx = 3651; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto diaryloop; - getridoftemp(context); - getridoftemptext(context); - getridoftempcharset(context); - restorereels(context); - context.data.byte(131) = 0; - redrawmainscrn(context); - worktoscreenm(context); + +static void turnonpower(Context & context) { + context.cx = 3; +powerloop: + context.push(context.cx); + powerlighton(context); + context.cx = 30; + hangon(context); + powerlightoff(context); + context.cx = 30; + hangon(context); + context.cx = context.pop(); + if (--context.cx) goto powerloop; + powerlighton(context); return; -diarylist: +} + +static void randomaccess(Context & context) { +accessloop: + context.push(context.cx); + vsync(context); + vsync(context); + randomnum1(context); + context._and(context.al, 15); + context._cmp(context.al, 10); + if (context.flags.c()) goto off; + accesslighton(context); + goto chosenaccess; +off: + accesslightoff(context); +chosenaccess: + context.cx = context.pop(); + if (--context.cx) goto accessloop; + accesslightoff(context); return; } -static inline void showdiary(Context & context) { - context.al = 1; - context.ah = 0; - context.di = 68+24; - context.bx = 48+12+37; +static void powerlighton(Context & context) { + context.di = 257+4; + context.bx = 182; context.ds = context.data.word(458); - showframe(context); - context.al = 2; + context.al = 6; context.ah = 0; - context.di = 68+24+176; - context.bx = 48+12+108; - context.ds = context.data.word(458); + context.push(context.di); + context.push(context.bx); showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); return; } -static inline void showdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 0); - if (context.flags.z()) goto nokeyatall; - context._sub(context.data.byte(282), 1); - context._cmp(context.data.byte(282), 0); - if (context.flags.z()) goto nokeyatall; - context._cmp(context.data.byte(278), 'N'); - if (!context.flags.z()) goto nokeyn; - context.al = 3; - context._cmp(context.data.byte(282), 1); - if (context.flags.z()) goto gotkeyn; - context.al = 4; -gotkeyn: - context.ah = 0; - context.di = 68+24+94; - context.bx = 48+12+97; +static void powerlightoff(Context & context) { + context.di = 257+4; + context.bx = 182; context.ds = context.data.word(458); - showframe(context); - context._cmp(context.data.byte(282), 1); - if (!context.flags.z()) goto notshown; - showdiarypage(context); -notshown: - return; -nokeyn: context.al = 5; - context._cmp(context.data.byte(282), 1); - if (context.flags.z()) goto gotkeyp; - context.al = 6; -gotkeyp: context.ah = 0; - context.di = 68+24+151; - context.bx = 48+12+71; - context.ds = context.data.word(458); + context.push(context.di); + context.push(context.bx); showframe(context); - context._cmp(context.data.byte(282), 1); - if (!context.flags.z()) goto notshowp; - showdiarypage(context); -notshowp: - return; -nokeyatall: + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); return; } -static inline void dumpdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 1); - if (!context.flags.z()) goto notdumpdiary; - context._cmp(context.data.byte(43), 1); - if (context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); - if (!context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); - if (!context.flags.z()) goto notsartadd; - context.al = 6; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) goto notsartadd; - context.al = 6; - setlocation(context); - delpointer(context); - context.al = 12; - findtext1(context); - context.di = 70; - context.bx = 106; - context.dl = 241; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); - createpanel(context); - showicon(context); - showdiary(context); - showdiarypage(context); - worktoscreenm(context); - showpointer(context); - return; -notsartadd: - context.di = 68+24+48; - context.bx = 48+12+15; - context.cl = 200; - context.ch = 16; - multidump(context); -notdumpdiary: - context.di = 68+24+94; - context.bx = 48+12+97; - context.cl = 16; - context.ch = 16; - multidump(context); - context.di = 68+24+151; - context.bx = 48+12+71; - context.cl = 16; - context.ch = 16; +static void accesslighton(Context & context) { + context.di = 74; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 8; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; multidump(context); return; } -static inline void diarykeyp(Context & context) { - context._cmp(context.data.byte(100), 214); - if (context.flags.z()) goto alreadykeyp; - context.data.byte(100) = 214; - context.al = 23; - commandonly(context); -alreadykeyp: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto notkeyp; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); - if (context.flags.z()) goto notkeyp; - context._cmp(context.data.byte(282), 0); - if (!context.flags.z()) goto notkeyp; - context.al = 16; - playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'P'; - context._sub(context.data.byte(289), 1); - context._cmp(context.data.byte(289), -1); - if (!context.flags.z()) goto notkeyp; - context.data.byte(289) = 11; -notkeyp: +static void accesslightoff(Context & context) { + context.di = 74; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 7; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); return; } -static inline void diarykeyn(Context & context) { - context._cmp(context.data.byte(100), 213); - if (context.flags.z()) goto alreadykeyn; - context.data.byte(100) = 213; - context.al = 23; - commandonly(context); -alreadykeyn: - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto notkeyn; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); - if (context.flags.z()) goto notkeyn; - context._cmp(context.data.byte(282), 0); - if (!context.flags.z()) goto notkeyn; - context.al = 16; - playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'N'; - context._add(context.data.byte(289), 1); - context._cmp(context.data.byte(289), 12); - if (!context.flags.z()) goto notkeyn; - context.data.byte(289) = 0; -notkeyn: +static void locklighton(Context & context) { + context.di = 56; + context.bx = 182; + context.ds = context.data.word(458); + context.al = 10; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); return; } -static inline void showdiarypage(Context & context) { - context.al = 0; - context.ah = 0; - context.di = 68+24; - context.bx = 48+12; +static void locklightoff(Context & context) { + context.di = 56; + context.bx = 182; context.ds = context.data.word(458); - showframe(context); - context.al = context.data.byte(289); - findtext1(context); - context.data.byte(72) = 1; - usetempcharset(context); - context.di = 68+24+48; - context.bx = 48+12+16; - context.dl = 240; - context.ah = 16; - context.data.word(71) = 91+91; - printdirect(context); - context.di = 68+24+129; - context.bx = 48+12+16; - context.dl = 240; - context.ah = 16; - printdirect(context); - context.di = 68+24+48; - context.bx = 48+12+23; - context.dl = 240; - context.ah = 16; - printdirect(context); - context.data.byte(72) = 0; - context.data.word(71) = 0; - usecharset1(context); + context.al = 9; + context.ah = 0; + context.push(context.di); + context.push(context.bx); + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.cl = 12; + context.ch = 8; + multidump(context); return; } -static inline void findtext1(Context & context) { +static void input(Context & context) { + context.es = context.cs; + context.di = 7944; + context.cx = 64; + context.al = 0; + while(--context.cx) context._stosb(); + context.data.word(316) = 0; + context.al = '>'; + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); context.ah = 0; - context.si = context.ax; + printchar(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.cl = 6; + context.ch = 8; + multidump(context); + context._add(context.data.word(318), 6); + context.ax = context.data.word(318); + context.data.word(312) = context.ax; + context.ax = context.data.word(320); + context.data.word(314) = context.ax; +waitkey: + printcurs(context); + vsync(context); + delcurs(context); + readkey(context); + context.al = context.data.byte(142); + context._cmp(context.al, 0); + if (context.flags.z()) goto waitkey; + context._cmp(context.al, 13); + if (context.flags.z()) goto endofinput; + context._cmp(context.al, 8); + if (!context.flags.z()) goto notdel; + context._cmp(context.data.word(316), 0); + if (context.flags.z()) goto waitkey; + delchar(context); + goto waitkey; +notdel: + context._cmp(context.data.word(316), 28); + if (context.flags.z()) goto waitkey; + context._cmp(context.data.byte(142), 32); + if (!context.flags.z()) goto notleadingspace; + context._cmp(context.data.word(316), 0); + if (context.flags.z()) goto waitkey; +notleadingspace: + makecaps(context); + context.es = context.cs; + context.si = context.data.word(316); context._add(context.si, context.si); - context.es = context.data.word(466); - context.ax = context.data.word(context.si); - context._add(context.ax, 66*2); + context._add(context.si, 7944); + context.data.byte(context.si) = context.al; + context._cmp(context.al, 'Z'+1); + if (!context.flags.c()) goto waitkey; + context.push(context.ax); + context.push(context.es); + context.push(context.si); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); + context._xchg(context.al, context.ah); context.si = context.ax; + context.cl = 8; + context.ch = 8; + multiget(context); + context.si = context.pop(); + context.es = context.pop(); + context.ax = context.pop(); + context.push(context.es); + context.push(context.si); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); + context.ah = 0; + printchar(context); + context.si = context.pop(); + context.es = context.pop(); + context.data.byte(context.si+1) = context.cl; + context.ch = 0; + context._add(context.data.word(318), context.cx); + context._add(context.data.word(316), 1); + context._add(context.data.word(312), context.cx); + goto waitkey; +endofinput: return; } -static inline void zoomonoff(Context & context) { - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); - if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadyonoff; - context.data.byte(100) = 222; - context.al = 39; - commandonly(context); -alreadyonoff: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nozoomonoff; - context._and(context.ax, 1); - if (!context.flags.z()) goto dozoomonoff; -nozoomonoff: - return; -dozoomonoff: - context.al = context.data.byte(8); - context._xor(context.al, 1); - context.data.byte(8) = context.al; - createpanel(context); - context.data.byte(62) = 0; - drawfloor(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); - undertextline(context); - context.al = 39; - commandonly(context); - readmouse(context); - worktoscreenm(context); +static void makecaps(Context & context) { + context._cmp(context.al, 'a'); + if (context.flags.c()) goto notupperc; + context._sub(context.al, 32); +notupperc: return; } -static inline void saveload(Context & context) { - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); - if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 253); - if (context.flags.z()) goto alreadyops; - context.data.byte(100) = 253; - context.al = 43; - commandonly(context); -alreadyops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noops; - context._and(context.ax, 1); - if (context.flags.z()) goto noops; - dosaveload(context); -noops: +static void delchar(Context & context) { + context._sub(context.data.word(316), 1); + context.si = context.data.word(316); + context._add(context.si, context.si); + context.es = context.cs; + context._add(context.si, 7944); + context.data.byte(context.si) = 0; + context.al = context.data.byte(context.si+1); + context.ah = 0; + context._sub(context.data.word(318), context.ax); + context._sub(context.data.word(312), context.ax); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); + context._xchg(context.al, context.ah); + context.si = context.ax; + context.cl = 8; + context.ch = 8; + multiput(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.cl = context.al; + context.ch = 8; + multidump(context); return; } -static inline void dosaveload(Context & context) { - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; - clearwork(context); - createpanel2(context); - undertextline(context); - getridofall(context); - loadsavebox(context); - showopbox(context); - showmainops(context); - worktoscreen(context); - goto donefirstops; -restartops: - showopbox(context); - showmainops(context); - worktoscreenm(context); -donefirstops: - context.data.byte(103) = 0; -waitops: - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.bx = 3693; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto waitops; - context._cmp(context.data.byte(103), 2); - if (context.flags.z()) goto restartops; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context._cmp(context.data.byte(103), 4); - if (context.flags.z()) goto justret; - getridoftemp(context); - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); - context.data.byte(100) = 200; -justret: - context.data.byte(131) = 0; +static void execcommand(Context & context) { + context.es = context.cs; + context.bx = 2776; + context.ds = context.cs; + context.si = 7944; + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (!context.flags.z()) goto notblankinp; + scrollmonitor(context); + return; +notblankinp: + context.cl = 0; +comloop: + context.push(context.bx); + context.push(context.si); +comloop2: + context.al = context.data.byte(context.si); + context._add(context.si, 2); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.ah, 32); + if (context.flags.z()) goto foundcom; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto comloop2; + context.si = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 6); + if (!context.flags.z()) goto comloop; + neterror(context); + context.al = 0; + return; +foundcom: + context.si = context.pop(); + context.bx = context.pop(); + context._cmp(context.cl, 1); + if (context.flags.z()) goto testcom; + context._cmp(context.cl, 2); + if (context.flags.z()) goto directory; + context._cmp(context.cl, 3); + if (context.flags.z()) goto accesscom; + context._cmp(context.cl, 4); + if (context.flags.z()) goto signoncom; + context._cmp(context.cl, 5); + if (context.flags.z()) goto keyscom; + goto quitcom; +directory: + dircom(context); + context.al = 0; return; -} - -static inline void getbackfromops(Context & context) { - context._cmp(context.data.byte(56), 2); - if (context.flags.z()) goto opsblock1; - getback1(context); +signoncom: + signon(context); + context.al = 0; return; -opsblock1: - blank(context); +accesscom: + read(context); + context.al = 0; return; -} - -static inline void showmainops(Context & context) { - context.ds = context.data.word(458); - context.di = 60+10; - context.bx = 52+10; - context.al = 8; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+59; - context.bx = 52+30; - context.al = 7; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+128+4; - context.bx = 52+12; +keyscom: + showkeys(context); + context.al = 0; + return; +testcom: + context.al = 6; + monmessage(context); + context.al = 0; + return; +quitcom: context.al = 1; - context.ah = 0; - showframe(context); return; } -static inline void showdiscops(Context & context) { - context.ds = context.data.word(458); - context.di = 60+128+4; - context.bx = 52+12; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+10; - context.bx = 52+10; - context.al = 9; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+59; - context.bx = 52+30; - context.al = 10; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+176+2; - context.bx = 52+60-4; +static void neterror(Context & context) { context.al = 5; - context.ah = 0; - showframe(context); + monmessage(context); + scrollmonitor(context); return; } -static inline void loadgame(Context & context) { - context._cmp(context.data.byte(100), 246); - if (context.flags.z()) goto alreadyload; - context.data.byte(100) = 246; - context.al = 41; - commandonly(context); -alreadyload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noload; - context._cmp(context.ax, 1); - if (context.flags.z()) goto doload; -noload: +static void dircom(Context & context) { + context.cx = 30; + randomaccess(context); + parser(context); + context._cmp(context.data.byte(context.di+1), 0); + if (context.flags.z()) goto dirroot; + dirfile(context); return; -doload: - context.data.byte(340) = 1; - showopbox(context); - showloadops(context); - context.data.byte(341) = 0; - showslots(context); - shownames(context); - context.data.byte(231) = 0; - worktoscreenm(context); - namestoold(context); - context.data.byte(103) = 0; -loadops: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3735; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); - if (context.flags.z()) goto quitloaded; - getridoftemp(context); - context.dx = context.ds; - context.es = context.dx; - context.bx = 7782; - startloading(context); - loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; - clearsprites(context); - initman(context); - initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - startup(context); - worktoscreen(context); - context.data.byte(103) = 4; -quitloaded: +dirroot: + context.data.byte(269) = 0; + context.ds = context.cs; + context.si = 2885; + context._add(context.si, 1); + context.es = context.cs; + context.di = 2895; + context._add(context.di, 1); + context.cx = 12; + while(--context.cx) context._movsb(); + monitorlogo(context); + scrollmonitor(context); + context.al = 9; + monmessage(context); + context.es = context.data.word(466); + searchforfiles(context); + context.es = context.data.word(468); + searchforfiles(context); + context.es = context.data.word(470); + searchforfiles(context); + scrollmonitor(context); return; } -static inline void getbacktoops(Context & context) { - context._cmp(context.data.byte(100), 201); - if (context.flags.z()) goto alreadygetops; - context.data.byte(100) = 201; - context.al = 42; - commandonly(context); -alreadygetops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nogetbackops; - context._and(context.ax, 1); - if (!context.flags.z()) goto dogetbackops; -nogetbackops: +static void searchforfiles(Context & context) { + context.bx = 66*2; +directloop1: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, '*'); + if (context.flags.z()) goto endofdir; + context._cmp(context.al, 34); + if (!context.flags.z()) goto directloop1; + monprint(context); + goto directloop1; +endofdir: + return; +} + +static void signon(Context & context) { + parser(context); + context._add(context.di, 1); + context.ds = context.cs; + context.si = 2807; + context.cx = 4; +signonloop: + context.push(context.cx); + context.push(context.si); + context.push(context.di); + context._add(context.si, 14); + context.cx = 11; +signonloop2: + context._lodsb(); + context._cmp(context.al, 32); + if (context.flags.z()) goto foundsign; + makecaps(context); + context.ah = context.data.byte(context.di); + context._add(context.di, 1); + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto nomatch; + if (--context.cx) goto signonloop2; +nomatch: + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context._add(context.si, 26); + if (--context.cx) goto signonloop; + context.al = 13; + monmessage(context); + return; +foundsign: + context.di = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); + context.bx = context.si; + context.es = context.ds; + context._cmp(context.data.byte(context.bx), 0); + if (context.flags.z()) goto notyetassigned; + context.al = 17; + monmessage(context); + return; +notyetassigned: + context.push(context.es); + context.push(context.bx); + scrollmonitor(context); + context.al = 15; + monmessage(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.push(context.di); + context.push(context.bx); + input(context); + context.bx = context.pop(); + context.di = context.pop(); + context.data.word(318) = context.di; + context.data.word(320) = context.bx; + context.bx = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.bx); + context._add(context.bx, 2); + context.ds = context.cs; + context.si = 7944; +checkpass: + context._lodsw(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.ah, 32); + if (context.flags.z()) goto passpassed; + context._cmp(context.al, context.ah); + if (context.flags.z()) goto checkpass; +passerror: + context.bx = context.pop(); + context.es = context.pop(); + scrollmonitor(context); + context.al = 16; + monmessage(context); return; -dogetbackops: - oldtonames(context); - context.data.byte(103) = 2; +passpassed: + context.al = 14; + monmessage(context); + context.bx = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.bx); + context._add(context.bx, 14); + monprint(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); + context.data.byte(context.bx) = 1; return; } -static inline void discops(Context & context) { - context._cmp(context.data.byte(100), 249); - if (context.flags.z()) goto alreadydiscops; - context.data.byte(100) = 249; - context.al = 43; - commandonly(context); -alreadydiscops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto nodiscops; - context._and(context.ax, 1); - if (!context.flags.z()) goto dodiscops; -nodiscops: - return; -dodiscops: - scanfornames(context); - context.data.byte(340) = 2; - showopbox(context); - showdiscops(context); - context.data.byte(341) = 0; - worktoscreenm(context); - context.data.byte(103) = 0; -discopsloop: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3777; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto discopsloop; +static void showkeys(Context & context) { + context.cx = 10; + randomaccess(context); + scrollmonitor(context); + context.al = 18; + monmessage(context); + context.es = context.cs; + context.bx = 2807; + context.cx = 4; +keysloop: + context.push(context.cx); + context.push(context.bx); + context._cmp(context.data.byte(context.bx), 0); + if (context.flags.z()) goto notheld; + context._add(context.bx, 14); + monprint(context); +notheld: + context.bx = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 26); + if (--context.cx) goto keysloop; + scrollmonitor(context); return; } -static inline void savegame(Context & context) { - context._cmp(context.data.byte(56), 2); - if (!context.flags.z()) goto cansaveok; - blank(context); +static void read(Context & context) { + context.cx = 40; + randomaccess(context); + parser(context); + context._cmp(context.data.byte(context.di+1), 0); + if (!context.flags.z()) goto okcom; + neterror(context); return; -cansaveok: - context._cmp(context.data.byte(100), 247); - if (context.flags.z()) goto alreadysave; - context.data.byte(100) = 247; - context.al = 44; - commandonly(context); -alreadysave: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (!context.flags.z()) goto dosave; +okcom: + context.es = context.cs; + context.di = 2895; + context.ax = context.data.word(466); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.ax = context.data.word(468); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.ax = context.data.word(470); + context.data.word(324) = context.ax; + context.ds = context.ax; + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile2; + context.al = 7; + monmessage(context); return; -dosave: - context.data.byte(340) = 2; - showopbox(context); - showsaveops(context); - context.data.byte(341) = 0; - showslots(context); - shownames(context); - worktoscreenm(context); - namestoold(context); - context.data.word(394) = 0; - context.data.word(396) = 0; - context.data.byte(103) = 0; -saveops: - delpointer(context); - checkinput(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3819; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto saveops; +foundfile2: + getkeyandlogo(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto keyok1; return; -} - -static inline void actualsave(Context & context) { - context._cmp(context.data.byte(100), 222); - if (context.flags.z()) goto alreadyactsave; - context.data.byte(100) = 222; - context.al = 44; - commandonly(context); -alreadyactsave: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto noactsave; - context.dx = context.ds; - context.ds = context.dx; - context.si = 8367; - context.al = context.data.byte(341); - context.ah = 0; - context.cx = 17; - context._mul(context.cx); - context._add(context.si, context.ax); - context._add(context.si, 1); - context._cmp(context.data.byte(context.si), 0); - if (context.flags.z()) goto noactsave; - context.al = context.data.byte(9); - context.ah = 0; - context.cx = 32; - context._mul(context.cx); - context.ds = context.cs; - context.si = 5971; - context._add(context.si, context.ax); - context.di = 7782; - context.bx = context.di; +keyok1: context.es = context.cs; - context.cx = 16; - while(--context.cx) context._movsw(); - context.al = context.data.byte(531); - context.data.byte(context.bx+13) = context.al; - context.al = context.data.byte(148); - context.data.byte(context.bx+15) = context.al; - context.al = context.data.byte(149); - context.data.byte(context.bx+16) = context.al; - context.al = context.data.byte(35); - context.data.byte(context.bx+20) = context.al; - context.al = context.data.byte(475); - context.data.byte(context.bx+21) = context.al; - context.al = context.data.byte(133); - context.data.byte(context.bx+22) = context.al; - context.al = 255; - context.data.byte(context.bx+27) = context.al; - saveposition(context); - getridoftemp(context); - restoreall(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - redrawmainscrn(context); - worktoscreenm(context); - context.data.byte(103) = 4; -noactsave: + context.di = 2883; + context.ds = context.data.word(324); + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto findtopictext; + context.al = context.data.byte(270); + context.data.byte(269) = context.al; + context.al = 11; + monmessage(context); return; -} - -static inline void actualload(Context & context) { - context._cmp(context.data.byte(100), 221); - if (context.flags.z()) goto alreadyactload; - context.data.byte(100) = 221; - context.al = 41; - commandonly(context); -alreadyactload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto notactload; - context._cmp(context.ax, 1); - if (!context.flags.z()) goto notactload; - context.dx = context.ds; - context.ds = context.dx; - context.si = 8367; - context.al = context.data.byte(341); - context.ah = 0; - context.cx = 17; - context._mul(context.cx); - context._add(context.si, context.ax); - context._add(context.si, 1); - context._cmp(context.data.byte(context.si), 0); - if (context.flags.z()) goto notactload; - loadposition(context); - context.data.byte(103) = 1; -notactload: +findtopictext: + context._add(context.bx, 1); + context.push(context.es); + context.push(context.bx); + monitorlogo(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); +moretopic: + monprint(context); + context.al = context.data.byte(context.bx); + context._cmp(context.al, 34); + if (context.flags.z()) goto endoftopic; + context._cmp(context.al, '='); + if (context.flags.z()) goto endoftopic; + context._cmp(context.al, '*'); + if (context.flags.z()) goto endoftopic; + context.push(context.es); + context.push(context.bx); + processtrigger(context); + context.cx = 24; + randomaccess(context); + context.bx = context.pop(); + context.es = context.pop(); + goto moretopic; +endoftopic: + scrollmonitor(context); return; } -static inline void selectslot2(Context & context) { - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto noselslot2; - context.data.byte(340) = 2; -noselslot2: - selectslot(context); +static void dirfile(Context & context) { + context.al = 34; + context.data.byte(context.di) = context.al; + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(466); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(468); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(470); + context.si = 66*2; + searchforstring(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto foundfile; + context.di = context.pop(); + context.es = context.pop(); + context.al = 7; + monmessage(context); return; -} - -static inline void checkinput(Context & context) { - context._cmp(context.data.byte(340), 3); - if (context.flags.z()) goto nokeypress; - readkey(context); - context.al = context.data.byte(142); +foundfile: + context.ax = context.pop(); + context.ax = context.pop(); + getkeyandlogo(context); context._cmp(context.al, 0); - if (context.flags.z()) goto nokeypress; - context._cmp(context.al, 13); - if (!context.flags.z()) goto notret; - context.data.byte(340) = 3; - goto afterkey; -notret: - context._cmp(context.al, 8); - if (!context.flags.z()) goto nodel2; - context._cmp(context.data.byte(342), 0); - if (context.flags.z()) goto nokeypress; - getnamepos(context); - context._sub(context.data.byte(342), 1); - context.data.byte(context.bx) = 0; - context.data.byte(context.bx+1) = 1; - goto afterkey; -nodel2: -spacepress: - context._cmp(context.data.byte(342), 14); - if (context.flags.z()) goto nokeypress; - getnamepos(context); - context._add(context.data.byte(342), 1); - context.al = context.data.byte(142); - context.data.byte(context.bx+1) = context.al; - context.data.byte(context.bx+2) = 0; - context.data.byte(context.bx+3) = 1; - goto afterkey; -nokeypress: + if (context.flags.z()) goto keyok2; return; -afterkey: - showopbox(context); - shownames(context); - showslots(context); - showsaveops(context); - worktoscreenm(context); +keyok2: + context.push(context.es); + context.push(context.bx); + context.ds = context.cs; + context.si = 2883+1; + context.es = context.cs; + context.di = 2895+1; + context.cx = 12; + while(--context.cx) context._movsb(); + monitorlogo(context); + scrollmonitor(context); + context.al = 10; + monmessage(context); + context.bx = context.pop(); + context.es = context.pop(); +directloop2: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, 34); + if (context.flags.z()) goto endofdir2; + context._cmp(context.al, '*'); + if (context.flags.z()) goto endofdir2; + context._cmp(context.al, '='); + if (!context.flags.z()) goto directloop2; + monprint(context); + goto directloop2; +endofdir2: + scrollmonitor(context); return; } -static inline void getnamepos(Context & context) { - context.al = context.data.byte(341); +static void getkeyandlogo(Context & context) { + context._add(context.bx, 1); + context.al = context.data.byte(context.bx); + context._sub(context.al, 48); + context.data.byte(271) = context.al; + context._add(context.bx, 2); + context.al = context.data.byte(context.bx); + context._sub(context.al, 48); + context.data.byte(276) = context.al; + context._add(context.bx, 1); + context.push(context.es); + context.push(context.bx); + context.al = context.data.byte(276); context.ah = 0; - context.cx = 17; + context.cx = 26; context._mul(context.cx); - context.dx = context.ds; - context.es = context.dx; - context.bx = 8367; - context._add(context.bx, context.ax); - context.al = context.data.byte(342); - context.ah = 0; + context.es = context.cs; + context.bx = 2807; context._add(context.bx, context.ax); - return; -} - -static inline void showloadops(Context & context) { - context.ds = context.data.word(458); - context.di = 60+128+4; - context.bx = 52+12; + context.al = context.data.byte(context.bx); + context._cmp(context.al, 1); + if (context.flags.z()) goto keyok; + context.push(context.bx); + context.push(context.es); + context.al = 12; + monmessage(context); + context.es = context.pop(); + context.bx = context.pop(); + context._add(context.bx, 14); + monprint(context); + scrollmonitor(context); + context.bx = context.pop(); + context.es = context.pop(); context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+176+2; - context.bx = 52+60-4; - context.al = 5; - context.ah = 0; - showframe(context); - context.di = 60+104; - context.bx = 52+14; - context.al = 55; - context.dl = 101; - printmessage(context); return; -} - -static inline void showsaveops(Context & context) { - context.ds = context.data.word(458); - context.di = 60+128+4; - context.bx = 52+12; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 60+176+2; - context.bx = 52+60-4; - context.al = 5; - context.ah = 0; - showframe(context); - context.di = 60+104; - context.bx = 52+14; - context.al = 54; - context.dl = 101; - printmessage(context); +keyok: + context.bx = context.pop(); + context.es = context.pop(); + context.al = context.data.byte(271); + context.data.byte(269) = context.al; + context.al = 0; return; } -static inline void selectslot(Context & context) { - context._cmp(context.data.byte(100), 244); - if (context.flags.z()) goto alreadysel; - context.data.byte(100) = 244; - context.al = 45; - commandonly(context); -alreadysel: - context.ax = context.data.word(202); - context._cmp(context.ax, 1); - if (!context.flags.z()) goto noselslot; - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto noselslot; - context._cmp(context.data.byte(340), 3); - if (!context.flags.z()) goto notnocurs; - context._sub(context.data.byte(340), 1); -notnocurs: - oldtonames(context); - context.ax = context.data.word(200); - context._sub(context.ax, 52+4); - context.cl = -1; -getslotnum: - context._add(context.cl, 1); - context._sub(context.ax, 11); - if (!context.flags.c()) goto getslotnum; - context.data.byte(341) = context.cl; - delpointer(context); - showopbox(context); - showslots(context); - shownames(context); - context._cmp(context.data.byte(340), 1); - if (context.flags.z()) goto isloadmode; - showsaveops(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - return; -isloadmode: - showloadops(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); +static void searchforstring(Context & context) { + context.dl = context.data.byte(context.di); + context.cx = context.di; +restartlook: + context.di = context.cx; + context.bx = context.si; + context.dh = 0; +keeplooking: + context._lodsb(); + makecaps(context); + context._cmp(context.al, '*'); + if (context.flags.z()) goto notfound; + context._cmp(context.dl, '='); + if (!context.flags.z()) goto nofindingtopic; + context._cmp(context.al, 34); + if (context.flags.z()) goto notfound; +nofindingtopic: + context.ah = context.data.byte(context.di); + context._cmp(context.al, context.dl); + if (!context.flags.z()) goto notbracket; + context._add(context.dh, 1); + context._cmp(context.dh, 2); + if (context.flags.z()) goto complete; +notbracket: + context._cmp(context.al, context.ah); + if (!context.flags.z()) goto restartlook; + context._add(context.di, 1); + goto keeplooking; +complete: + context.es = context.ds; + context.al = 0; + context.bx = context.si; return; -noselslot: +notfound: + context.al = 1; return; } -static inline void showslots(Context & context) { - context.di = 60+7; - context.bx = 52+8; - context.al = 2; - context.ds = context.data.word(458); - context.ah = 0; - showframe(context); - context.di = 60+10; - context.bx = 52+11; - context.cl = 0; -slotloop: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context._cmp(context.cl, context.data.byte(341)); - if (!context.flags.z()) goto nomatchslot; - context.al = 3; - context.ds = context.data.word(458); - context.ah = 0; - showframe(context); -nomatchslot: - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 10); - context._add(context.cl, 1); - context._cmp(context.cl, 7); - if (!context.flags.z()) goto slotloop; +static void parser(Context & context) { + context.es = context.cs; + context.di = 2883; + context.cx = 13; + context.al = 0; + while(--context.cx) context._stosb(); + context.di = 2883; + context.al = '='; + context._stosb(); + context.ds = context.cs; + context.si = 7944; +notspace1: + context._lodsw(); + context._cmp(context.al, 32); + if (context.flags.z()) goto stillspace1; + context._cmp(context.al, 0); + if (!context.flags.z()) goto notspace1; + goto finishpars; +stillspace1: + context._lodsw(); + context._cmp(context.al, 32); + if (context.flags.z()) goto stillspace1; +copyin1: + context._stosb(); + context._lodsw(); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishpars; + context._cmp(context.al, 32); + if (!context.flags.z()) goto copyin1; +finishpars: + context.di = 2883; return; } -static inline void shownames(Context & context) { - context.dx = context.ds; - context.es = context.dx; - context.si = 8367+1; - context.di = 60+21; - context.bx = 52+10; - context.cl = 0; -shownameloop: +static void scrollmonitor(Context & context) { + context.push(context.ax); + context.push(context.bx); context.push(context.cx); + context.push(context.dx); context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.push(context.si); - context.al = 4; - context._cmp(context.cl, context.data.byte(341)); - if (!context.flags.z()) goto nomatchslot2; - context._cmp(context.data.byte(340), 2); - if (!context.flags.z()) goto loadmode; - context.dx = context.si; - context.cx = 15; - context._add(context.si, 15); -zerostill: - context._sub(context.si, 1); - context._sub(context.cl, 1); - context._cmp(context.data.byte(context.si), 1); - if (!context.flags.z()) goto foundcharacter; - goto zerostill; -foundcharacter: - context.data.byte(342) = context.cl; - context.data.byte(context.si) = '/'; - context.data.byte(context.si+1) = 0; context.push(context.si); - context.si = context.dx; - context.dl = 200; - context.ah = 0; - printdirect(context); - context.si = context.pop(); - context.data.byte(context.si) = 0; - context.data.byte(context.si+1) = 1; - goto afterprintname; -loadmode: - context.al = 0; - context.dl = 200; - context.ah = 0; - context.data.word(71) = 91; - printdirect(context); - context.data.word(71) = 0; - goto afterprintname; -nomatchslot2: - context.dl = 200; - context.ah = 0; - printdirect(context); -afterprintname: - context.si = context.pop(); - context.bx = context.pop(); + context.push(context.es); + context.push(context.ds); + printlogo(context); + context.di = context.data.word(318); + context.bx = context.data.word(320); + printundermon(context); + context.ax = context.data.word(320); + worktoscreen(context); + context.al = 25; + playchannel1(context); + context.ds = context.pop(); context.es = context.pop(); + context.si = context.pop(); context.di = context.pop(); + context.dx = context.pop(); context.cx = context.pop(); - context._add(context.si, 17); - context._add(context.bx, 10); - context._add(context.cl, 1); - context._cmp(context.cl, 7); - if (!context.flags.z()) goto shownameloop; + context.bx = context.pop(); + context.ax = context.pop(); return; } -static inline void namestoold(Context & context) { - context.ds = context.cs; - context.si = 8367; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.es = context.data.word(412); - context.cx = 17*4; - while(--context.cx) context._movsb(); - return; -} - -static inline void oldtonames(Context & context) { - context.es = context.cs; - context.di = 8367; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.ds = context.data.word(412); - context.cx = 17*4; - while(--context.cx) context._movsb(); - return; -} - -static inline void makeheader(Context & context) { - context.dx = context.ds; - context.es = context.dx; - context.di = 5952; - context.ax = 17; - storeit(context); - context.ax = 68-context.data.byte(1); - storeit(context); - context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; - storeit(context); - context.ax = 250*4; - storeit(context); - context.ax = 48; - storeit(context); - context.ax = 991-context.data.byte(537); - storeit(context); +static void lockmon(Context & context) { + context._cmp(context.data.byte(392), 57); + if (!context.flags.z()) goto notlock; + locklighton(context); +lockloop: + context._cmp(context.data.byte(392), 57); + if (context.flags.z()) goto lockloop; + locklightoff(context); +notlock: return; } -static inline void storeit(Context & context) { - context._cmp(context.ax, 0); - if (!context.flags.z()) goto isntblank; - context._add(context.ax, 1); -isntblank: - context._stosw(); +static void monitorlogo(Context & context) { + context.al = context.data.byte(269); + context._cmp(context.al, context.data.byte(270)); + if (context.flags.z()) goto notnewlogo; + context.data.byte(270) = context.al; + printlogo(context); + printundermon(context); + worktoscreen(context); + printlogo(context); + printlogo(context); + context.al = 26; + playchannel1(context); + context.cx = 20; + randomaccess(context); + return; +notnewlogo: + printlogo(context); return; } -static inline void findlen(Context & context) { - context._sub(context.bx, 1); - context._add(context.bx, context.ax); -nextone: - context._cmp(context.cl, context.data.byte(context.bx)); - if (!context.flags.z()) goto foundlen; - context._sub(context.bx, 1); - context._sub(context.ax, 1); - context._cmp(context.ax, 0); - if (!context.flags.z()) goto nextone; -foundlen: +static void printlogo(Context & context) { + context.di = 56; + context.bx = 32; + context.ds = context.data.word(458); + context.al = 0; + context.ah = 0; + showframe(context); + showcurrentfile(context); return; } -static inline void newgame(Context & context) { - context._cmp(context.data.byte(100), 251); - if (context.flags.z()) goto alreadynewgame; - context.data.byte(100) = 251; - context.al = 47; - commandonly(context); -alreadynewgame: - context.ax = context.data.word(202); - context._cmp(context.ax, 1); - if (!context.flags.z()) goto nonewgame; - context.data.byte(103) = 3; -nonewgame: +static void showcurrentfile(Context & context) { + context.di = 178; + context.bx = 37; + context.si = 2895+1; +curfileloop: + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (context.flags.z()) goto finishfile; + context._add(context.si, 1); + context.push(context.si); + modifychar(context); + context.ds = context.data.word(406); + context.ah = 0; + printchar(context); + context.si = context.pop(); + goto curfileloop; +finishfile: return; } -static inline void doload(Context & context) { - context.data.byte(340) = 1; - showopbox(context); - showloadops(context); - context.data.byte(341) = 0; - showslots(context); - shownames(context); - context.data.byte(231) = 0; - worktoscreenm(context); - namestoold(context); - context.data.byte(103) = 0; -loadops: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3735; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); - if (context.flags.z()) goto quitloaded; - getridoftemp(context); - context.dx = context.ds; - context.es = context.dx; - context.bx = 7782; - startloading(context); - loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; - clearsprites(context); - initman(context); - initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - startup(context); - worktoscreen(context); - context.data.byte(103) = 4; -quitloaded: +static void monmessage(Context & context) { + context.es = context.data.word(466); + context.bx = 66*2; + context.cl = context.al; + context.ch = 0; +monmessageloop: + context.al = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, '+'); + if (!context.flags.z()) goto monmessageloop; + if (--context.cx) goto monmessageloop; + monprint(context); return; } -static inline void loadold(Context & context) { - context._cmp(context.data.byte(100), 252); - if (context.flags.z()) goto alreadyloadold; - context.data.byte(100) = 252; - context.al = 48; - commandonly(context); -alreadyloadold: - context.ax = context.data.word(202); - context._and(context.ax, 1); - if (context.flags.z()) goto noloadold; - doload(context); - context._cmp(context.data.byte(103), 4); - if (context.flags.z()) goto noloadold; - showdecisions(context); - worktoscreenm(context); - context.data.byte(103) = 0; -noloadold: +static void processtrigger(Context & context) { + context._cmp(context.data.byte(55), '1'); + if (!context.flags.z()) goto notfirsttrigger; + context.al = 8; + setlocation(context); + context.al = 45; + triggermessage(context); + return; +notfirsttrigger: + context._cmp(context.data.byte(55), '2'); + if (!context.flags.z()) goto notsecondtrigger; + context.al = 9; + setlocation(context); + context.al = 55; + triggermessage(context); + return; +notsecondtrigger: + context._cmp(context.data.byte(55), '3'); + if (!context.flags.z()) goto notthirdtrigger; + context.al = 2; + setlocation(context); + context.al = 59; + triggermessage(context); +notthirdtrigger: return; } -static inline void createname(Context & context) { +static void triggermessage(Context & context) { context.push(context.ax); - context.di = 4932; - context.data.byte(context.di+0) = context.dl; - context.data.byte(context.di+3) = context.cl; - context.al = context.dh; - context.ah = '0'-1; -findten: - context._add(context.ah, 1); - context._sub(context.al, 10); - if (!context.flags.c()) goto findten; - context.data.byte(context.di+1) = context.ah; - context._add(context.al, 10+'0'); - context.data.byte(context.di+2) = context.al; + context.di = 174; + context.bx = 153; + context.cl = 200; + context.ch = 63; + context.ds = context.data.word(402); + context.si = 0; + multiget(context); context.ax = context.pop(); - context.cl = '0'-1; -thousandsc: - context._add(context.cl, 1); - context._sub(context.ax, 1000); - if (!context.flags.c()) goto thousandsc; - context._add(context.ax, 1000); - context.data.byte(context.di+4) = context.cl; - context.cl = '0'-1; -hundredsc: - context._add(context.cl, 1); - context._sub(context.ax, 100); - if (!context.flags.c()) goto hundredsc; - context._add(context.ax, 100); - context.data.byte(context.di+5) = context.cl; - context.cl = '0'-1; -tensc: - context._add(context.cl, 1); - context._sub(context.ax, 10); - if (!context.flags.c()) goto tensc; - context._add(context.ax, 10); - context.data.byte(context.di+6) = context.cl; - context._add(context.al, '0'); - context.data.byte(context.di+7) = context.al; + findpuztext(context); + context.di = 174; + context.bx = 156; + context.dl = 141; + context.ah = 16; + printdirect(context); + context.cx = 140; + hangon(context); + worktoscreen(context); + context.cx = 340; + hangon(context); + context.di = 174; + context.bx = 153; + context.cl = 200; + context.ch = 63; + context.ds = context.data.word(402); + context.si = 0; + multiput(context); + worktoscreen(context); + context.data.byte(55) = 0; return; } -static inline void makenextblock(Context & context) { - volumeadjust(context); - loopchannel0(context); - context._cmp(context.data.word(521), 0); - if (context.flags.z()) goto mightbeonlych0; - context._cmp(context.data.word(506), 0); - if (context.flags.z()) goto mightbeonlych1; - context._sub(context.data.word(506), 1); - context._sub(context.data.word(521), 1); - bothchannels(context); - return; -mightbeonlych1: - context.data.byte(507) = 255; - context._cmp(context.data.word(521), 0); - if (context.flags.z()) goto notch1only; - context._sub(context.data.word(521), 1); - channel1only(context); -notch1only: - return; -mightbeonlych0: - context.data.byte(515) = 255; - context._cmp(context.data.word(506), 0); - if (context.flags.z()) goto notch0only; - context._sub(context.data.word(506), 1); - channel0only(context); +static void printcurs(Context & context) { + context.push(context.si); + context.push(context.di); + context.push(context.ds); + context.push(context.dx); + context.push(context.bx); + context.push(context.es); + context.di = context.data.word(312); + context.bx = context.data.word(314); + context.cl = 6; + context.ch = 8; + context._sub(context.bx, 3); + context.ch = 11; + context.ds = context.data.word(412); + context.si = 0; + context.push(context.di); + context.push(context.bx); + multiget(context); + context.bx = context.pop(); + context.di = context.pop(); + context.push(context.bx); + context.push(context.di); + context._add(context.data.word(138), 1); + context.ax = context.data.word(138); + context._and(context.al, 16); + if (!context.flags.z()) goto flashcurs; + context.al = '/'; + context._sub(context.al, 32); + context.ah = 0; + context.ds = context.data.word(406); + showframe(context); +flashcurs: + context.di = context.pop(); + context.bx = context.pop(); + context._sub(context.di, 6); + context.cl = 12; + context.ch = 11; + multidump(context); + context.es = context.pop(); + context.bx = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.si = context.pop(); return; -notch0only: - context.es = context.data.word(353); - context.di = context.data.word(525); - context.cx = 1024; - context.ax = 0x7f7f; - while(--context.cx) context._stosw(); - context._and(context.di, 16384-1); - context.data.word(525) = context.di; +} + +static void delcurs(Context & context) { + context.push(context.es); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.push(context.dx); + context.push(context.si); + context.di = context.data.word(312); + context.bx = context.data.word(314); + context.cl = 6; + context.ch = 8; + context._sub(context.bx, 3); + context.ch = 11; + context.push(context.di); + context.push(context.bx); + context.push(context.cx); + context.ds = context.data.word(412); + context.si = 0; + multiput(context); + context.cx = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + multidump(context); +finishcurdel: + context.si = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); return; } -static inline void volumeadjust(Context & context) { - context.al = context.data.byte(388); - context._cmp(context.al, 0); - if (context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._cmp(context.al, context.data.byte(387)); - if (context.flags.z()) goto volfinish; - context._add(context.data.byte(389), 64); - if (!context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._add(context.al, context.data.byte(388)); - context.data.byte(386) = context.al; +static void useobject(Context & context) { + context.data.byte(95) = 255; + context._cmp(context.data.byte(100), 229); + if (context.flags.z()) goto alreadyuse; + context.data.byte(100) = 229; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); + context.al = 51; + commandwithob(context); +alreadyuse: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nouse; + context._and(context.ax, 1); + if (!context.flags.z()) goto douse; +nouse: return; -volfinish: - context.data.byte(388) = 0; -volok: +douse: + useroutine(context); return; } -static inline void loopchannel0(Context & context) { - context._cmp(context.data.word(506), 0); - if (!context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 0); - if (context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 255); - if (context.flags.z()) goto endlessloop; - context._sub(context.data.byte(508), 1); -endlessloop: - context.ax = context.data.word(510); - context.data.word(502) = context.ax; - context.ax = context.data.word(512); - context.data.word(504) = context.ax; - context.ax = context.data.word(506); - context._add(context.ax, context.data.word(514)); - context.data.word(506) = context.ax; +static void useroutine(Context & context) { + context._cmp(context.data.byte(184), 50); + if (context.flags.c()) goto nodream7; + context._cmp(context.data.byte(232), 0); + if (!context.flags.z()) goto powerok; return; -notloop: +powerok: + context.data.byte(232) = 0; +nodream7: + getanyad(context); + context.dx = context.ds; + context.ds = context.dx; + context.si = 2895; +checkuselist: + context.push(context.si); + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto failed; + context._lodsb(); + context._sub(context.al, 'A'); + context._cmp(context.al, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto failed; + context._lodsw(); + context.si = context.pop(); + __dispatch_call(context, context.ax); + return; +failed: + context.si = context.pop(); + context._add(context.si, 6); + context._cmp(context.data.byte(context.si), 140); + if (!context.flags.z()) goto checkuselist; + delpointer(context); + getobtextstart(context); + findnextcolon(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + findnextcolon(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + context.al = context.data.byte(context.si); + context._cmp(context.al, 0); + if (context.flags.z()) goto cantuse2; + usetext(context); + context.cx = 400; + hangonp(context); + putbackobstuff(context); + return; +cantuse2: + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.di = 33; + context.bx = 100; + context.al = 63; + context.dl = 241; + printmessage(context); + worktoscreenm(context); + context.cx = 50; + hangonp(context); + putbackobstuff(context); + context.data.byte(100) = 255; return; } -static inline void channel0tran(Context & context) { - context._cmp(context.data.byte(386), 0); - if (!context.flags.z()) goto lowvolumetran; - context.cx = 1024; - while(--context.cx) context._movsw(); - return; -lowvolumetran: - context.cx = 1024; - context.bh = context.data.byte(386); - context.bl = 0; - context._add(context.bx, 16384-256); -volloop: - context._lodsw(); - context.bl = context.al; - context.al = context.data.byte(context.bx); - context.bl = context.ah; - context.ah = context.data.byte(context.bx); - context._stosw(); - if (--context.cx) goto volloop; +static void wheelsound(Context & context) { + context.al = 17; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); return; } -static inline void domix(Context & context) { - context._cmp(context.data.byte(386), 0); - if (!context.flags.z()) goto lowvolumemix; -slow: - context._lodsb(); - context.ah = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.al, context.dh); - if (!context.flags.c()) goto toplot; -botlot: - context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto nodistort; - context._add(context.al, context.ah); - if (context.flags.s()) goto botok; - context._xor(context.al, context.al); - context._stosb(); - if (--context.cx) goto slow; - goto doneit; -botok: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto slow; - goto doneit; -toplot: - context._cmp(context.ah, context.dh); - if (context.flags.c()) goto nodistort; - context._add(context.al, context.ah); - if (!context.flags.s()) goto topok; - context.al = context.dl; - context._stosb(); - if (--context.cx) goto slow; - goto doneit; -topok: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto slow; - goto doneit; -nodistort: - context._add(context.al, context.ah); - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto slow; - goto doneit; -lowvolumemix: - context._lodsb(); - context.push(context.bx); - context.bh = context.data.byte(386); - context._add(context.bh, 63); - context.bl = context.al; - context.al = context.data.byte(context.bx); - context.bx = context.pop(); - context.ah = context.data.byte(context.bx); - context._add(context.bx, 1); - context._cmp(context.al, context.dh); - if (!context.flags.c()) goto toplotv; -botlotv: - context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto nodistortv; - context._add(context.al, context.ah); - if (context.flags.s()) goto botokv; - context._xor(context.al, context.al); - context._stosb(); - if (--context.cx) goto lowvolumemix; - goto doneit; -botokv: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto lowvolumemix; - goto doneit; -toplotv: - context._cmp(context.ah, context.dh); - if (context.flags.c()) goto nodistortv; - context._add(context.al, context.ah); - if (!context.flags.s()) goto topokv; - context.al = context.dl; - context._stosb(); - if (--context.cx) goto lowvolumemix; - goto doneit; -topokv: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto lowvolumemix; - goto doneit; -nodistortv: - context._add(context.al, context.ah); - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) goto lowvolumemix; -doneit: +static void runtap(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto tapwith; + withwhat(context); + return; +tapwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto fillcupfromtap; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto cupfromtapfull; + context.cx = 300; + context.al = 56; + showpuztext(context); + putbackobstuff(context); + return; +fillcupfromtap: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'F'-'A'; + context.al = 8; + playchannel1(context); + context.cx = 300; + context.al = 57; + showpuztext(context); + putbackobstuff(context); + return; +cupfromtapfull: + context.cx = 300; + context.al = 58; + showpuztext(context); + putbackobstuff(context); return; } -static inline void dreamweb(Context & context) { - seecommandtail(context); - checkbasemem(context); - soundstartup(context); - setkeyboardint(context); - setupemm(context); - allocatebuffers(context); - setmouse(context); - fadedos(context); - gettime(context); - clearbuffers(context); - clearpalette(context); - set16colpalette(context); - readsetdata(context); - context.data.byte(391) = 0; - context.dx = 1922; - loadsample(context); - setsoundoff(context); - scanfornames(context); - context._cmp(context.al, 0); - if (!context.flags.z()) goto dodecisions; - setmode(context); - loadpalfromiff(context); - titles(context); - credits(context); - goto playgame; -dodecisions: - cls(context); - setmode(context); - decide(context); - context._cmp(context.data.byte(103), 4); - if (context.flags.z()) goto mainloop; - titles(context); - credits(context); -playgame: - clearchanges(context); - setmode(context); - loadpalfromiff(context); - context.data.byte(9) = 255; - context.data.byte(67) = 1; - context.data.byte(188) = 35; - context.data.byte(386) = 7; - loadroom(context); - clearsprites(context); - initman(context); - entrytexts(context); - entryanims(context); - context.data.byte(183) = 3; - initialinv(context); - context.data.byte(153) = 32; - startup1(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; - context.data.byte(100) = 255; - goto mainloop; -loadnew: - clearbeforeload(context); - loadroom(context); - clearsprites(context); - initman(context); - entrytexts(context); - entryanims(context); - context.data.byte(188) = 255; - startup(context); - context.data.byte(100) = 255; +static void playguitar(Context & context) { + context.al = 14; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static void hotelcontrol(Context & context) { + context._cmp(context.data.byte(184), 21); + if (!context.flags.z()) goto notrightcont; + context._cmp(context.data.byte(148), 33); + if (!context.flags.z()) goto notrightcont; + showfirstuse(context); + putbackobstuff(context); + return; +notrightcont: + showseconduse(context); + putbackobstuff(context); + return; +} + +static void hotelbell(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); + return; +} + +static void opentomb(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 35*2; + context.data.word(23) = 1; + context.data.word(25) = 33; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + return; +} + +static void usetrainer(Context & context) { + getanyad(context); + context._cmp(context.data.byte(context.bx+2), 4); + if (!context.flags.z()) goto notheldtrainer; + context._add(context.data.byte(2), 1); + makeworn(context); + showseconduse(context); + putbackobstuff(context); + return; +notheldtrainer: + nothelderror(context); + return; +} + +static void nothelderror(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.di = 64; + context.bx = 100; + context.al = 63; + context.ah = 1; + context.dl = 201; + printmessage2(context); worktoscreenm(context); - goto mainloop; -alreadyloaded: - context.data.byte(188) = 255; - clearsprites(context); - initman(context); - startup(context); - context.data.byte(100) = 255; -mainloop: - screenupdate(context); - context._cmp(context.data.byte(391), 0); - if (!context.flags.z()) goto endofgame; - context._cmp(context.data.byte(56), 1); - if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(56), 2); - if (context.flags.z()) goto gameover; - context._cmp(context.data.word(21), 0); - if (context.flags.z()) goto notwatching; - context.al = context.data.byte(477); - context._cmp(context.al, context.data.byte(475)); - if (!context.flags.z()) goto mainloop; - context._sub(context.data.word(21), 1); - if (!context.flags.z()) goto mainloop; -notwatching: - context._cmp(context.data.byte(56), 4); - if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(188), 255); - if (!context.flags.z()) goto loadnew; - goto mainloop; -gameover: - clearbeforeload(context); - showgun(context); - fadescreendown(context); - context.cx = 100; - hangon(context); - goto dodecisions; -endofgame: - clearbeforeload(context); - fadescreendowns(context); - context.cx = 200; - hangon(context); - endgame(context); - { quickquit2(context); return; }; + context.cx = 50; + hangonp(context); + putbackobstuff(context); + return; } -static inline void parseblaster(Context & context) { -lookattail: - context.al = context.data.byte(context.bx); - context._cmp(context.al, 0); - if (context.flags.z()) goto endtail; - context._cmp(context.al, 13); - if (context.flags.z()) goto endtail; - context._cmp(context.al, 'i'); - if (context.flags.z()) goto issoundint; - context._cmp(context.al, 'I'); - if (context.flags.z()) goto issoundint; - context._cmp(context.al, 'b'); - if (context.flags.z()) goto isbright; - context._cmp(context.al, 'B'); - if (context.flags.z()) goto isbright; - context._cmp(context.al, 'a'); - if (context.flags.z()) goto isbaseadd; - context._cmp(context.al, 'A'); - if (context.flags.z()) goto isbaseadd; - context._cmp(context.al, 'n'); - if (context.flags.z()) goto isnosound; - context._cmp(context.al, 'N'); - if (context.flags.z()) goto isnosound; - context._cmp(context.al, 'd'); - if (context.flags.z()) goto isdma; - context._cmp(context.al, 'D'); - if (context.flags.z()) goto isdma; - context._add(context.bx, 1); - if (--context.cx) goto lookattail; +static void usepipe(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto pipewith; + withwhat(context); return; -issoundint: - context.al = context.data.byte(context.bx+1); - context._sub(context.al, '0'); - context.data.byte(378) = context.al; - context._add(context.bx, 1); - goto lookattail; -isdma: - context.al = context.data.byte(context.bx+1); - context._sub(context.al, '0'); - context.data.byte(379) = context.al; - context._add(context.bx, 1); - goto lookattail; -isbaseadd: - context.push(context.cx); - context.al = context.data.byte(context.bx+2); - context._sub(context.al, '0'); - context.ah = 0; - context.cl = 4; - context._shl(context.ax, context.cl); - context._add(context.ax, 0x200); - context.data.word(372) = context.ax; - context.cx = context.pop(); - context._add(context.bx, 1); - goto lookattail; -isbright: - context.data.byte(73) = 1; - context._add(context.bx, 1); - goto lookattail; -isnosound: - context.data.byte(378) = 255; - context._add(context.bx, 1); - goto lookattail; -endtail: +pipewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto fillcup; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto alreadyfull; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +fillcup: + context.cx = 300; + context.al = 36; + showpuztext(context); + putbackobstuff(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'F'-'A'; + return; +alreadyfull: + context.cx = 300; + context.al = 35; + showpuztext(context); + putbackobstuff(context); return; } -static inline void showbyte(Context & context) { - context.dl = context.al; - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - onedigit(context); - context.data.byte(context.di) = context.dl; - context.dl = context.al; - context._and(context.dl, 15); - onedigit(context); - context.data.byte(context.di+1) = context.dl; - context._add(context.di, 3); +static void usefullcart(Context & context) { + context._add(context.data.byte(2), 1); + context.al = 2; + context.ah = context.data.byte(185); + context._add(context.ah, 6); + turnanypathon(context); + context.data.byte(475) = 4; + context.data.byte(133) = 4; + context.data.byte(135) = 4; + context.data.byte(477) = 4; + findxyfrompath(context); + context.data.byte(187) = 1; + showfirstuse(context); + context.data.word(21) = 72*2; + context.data.word(23) = 58; + context.data.word(25) = 142; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void onedigit(Context & context) { - context._cmp(context.dl, 10); - if (!context.flags.c()) goto morethan10; - context._add(context.dl, '0'); +static void useplinth(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto plinthwith; + withwhat(context); return; -morethan10: - context._sub(context.dl, 10); - context._add(context.dl, 'A'); +plinthwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'D'; + context.ch = 'K'; + context.dl = 'E'; + context.dh = 'Y'; + compare(context); + if (context.flags.z()) goto isrightkey; + showfirstuse(context); + putbackobstuff(context); + return; +isrightkey: + context._add(context.data.byte(2), 1); + showseconduse(context); + context.data.word(21) = 220; + context.data.word(23) = 0; + context.data.word(25) = 104; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = context.data.byte(67); + context.data.byte(188) = context.al; return; } -static inline void showword(Context & context) { - context.ch = 0; - context.bx = 10000; - context.cl = 47; -word1: - context._add(context.cl, 1); - context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word1; - context._add(context.ax, context.bx); - convnum(context); - context.data.byte(context.di) = context.cl; - context.bx = 1000; - context.cl = 47; -word2: - context._add(context.cl, 1); - context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word2; - context._add(context.ax, context.bx); - convnum(context); - context.data.byte(context.di+1) = context.cl; - context.bx = 100; - context.cl = 47; -word3: - context._add(context.cl, 1); - context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word3; - context._add(context.ax, context.bx); - convnum(context); - context.data.byte(context.di+2) = context.cl; - context.bx = 10; - context.cl = 47; -word4: - context._add(context.cl, 1); - context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word4; - context._add(context.ax, context.bx); - convnum(context); - context.data.byte(context.di+3) = context.cl; - context._add(context.al, 48); - context.cl = context.al; - convnum(context); - context.data.byte(context.di+4) = context.cl; +static void chewy(Context & context) { + showfirstuse(context); + getanyad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(103) = 1; return; } -static inline void convnum(Context & context) { - context._cmp(context.ch, 0); - if (!context.flags.z()) goto noconvnum; - context._cmp(context.cl, '0'); - if (!context.flags.z()) goto notzeronum; - context.cl = 32; - goto noconvnum; -notzeronum: - context.ch = 1; -noconvnum: +static void useladder(Context & context) { + showfirstuse(context); + context._sub(context.data.byte(148), 11); + findroominloc(context); + context.data.byte(133) = 6; + context.data.byte(135) = 6; + context.data.byte(475) = 0; + context.data.byte(478) = 0; + context.data.byte(477) = 0; + findxyfrompath(context); + context.data.byte(187) = 1; + context.data.byte(103) = 1; return; } -static inline void madmanrun(Context & context) { - context._cmp(context.data.byte(9), 14); - if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(148), 22); - if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(234), 2); - if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(53), 0); - if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(100), 211); - if (context.flags.z()) goto alreadyrun; - context.data.byte(100) = 211; - context.al = 52; - commandonly(context); -alreadyrun: - context._cmp(context.data.word(202), 1); - if (!context.flags.z()) goto norun; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); - if (context.flags.z()) goto norun; - context.data.byte(65) = 8; -norun: +static void useladderb(Context & context) { + showfirstuse(context); + context._add(context.data.byte(148), 11); + findroominloc(context); + context.data.byte(133) = 2; + context.data.byte(135) = 2; + context.data.byte(475) = 1; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + findxyfrompath(context); + context.data.byte(187) = 1; + context.data.byte(103) = 1; return; } -static inline void identifyob(Context & context) { - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) { blank(context); return; }; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); - context._cmp(context.ax, 22*8); - if (context.flags.c()) goto notover1; - blank(context); +static void slabdoora(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 13; + context._cmp(context.data.byte(66), 3); + if (!context.flags.z()) goto slabawrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 42; + context.data.byte(188) = 47; return; -notover1: - context.bx = context.data.word(200); - context._sub(context.bx, context.data.word(119)); - context._cmp(context.bx, 20*8); - if (context.flags.c()) goto notover2; - blank(context); +slabawrong: + context.data.word(21) = 40; + context.data.word(25) = 34; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +} + +static void slabdoorb(Context & context) { + context._cmp(context.data.byte(66), 1); + if (!context.flags.z()) goto slabbwrong; + context.al = 'S'; + context.ah = 'H'; + context.cl = 'L'; + context.ch = 'D'; + isryanholding(context); + if (!context.flags.z()) goto gotcrystal; + context.al = 44; + context.cx = 200; + showpuztext(context); + putbackobstuff(context); + return; +gotcrystal: + showfirstuse(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 60; + context.data.word(25) = 71; + context.data.byte(188) = 47; + return; +slabbwrong: + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 40; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; -notover2: - context.data.byte(237) = 1; - context.ah = context.bl; - context.push(context.ax); - findpathofpoint(context); - context.data.byte(474) = context.dl; - context.ax = context.pop(); - context.push(context.ax); - findfirstpath(context); - context.data.byte(476) = context.al; - context.ax = context.pop(); - checkifex(context); - if (!context.flags.z()) goto finishidentify; - checkiffree(context); - if (!context.flags.z()) goto finishidentify; - checkifperson(context); - if (!context.flags.z()) goto finishidentify; - checkifset(context); - if (!context.flags.z()) goto finishidentify; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); - context.cl = context.al; - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); - context.ch = context.al; - checkone(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto nothingund; - context._cmp(context.data.byte(56), 1); - if (context.flags.z()) goto nothingund; - context.ah = 3; - obname(context); -finishidentify: +} + +static void slabdoord(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 75; + context._cmp(context.data.byte(66), 0); + if (!context.flags.z()) goto slabcwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 102; + context.data.byte(188) = 47; return; -nothingund: - blank(context); +slabcwrong: + context.data.word(21) = 40; + context.data.word(25) = 94; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } -static inline void checkifperson(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.cx = 12; -identifyreel: - context.push(context.cx); - context._cmp(context.data.byte(context.bx+4), 255); - if (context.flags.z()) goto notareelid; - context.push(context.es); - context.push(context.bx); - context.push(context.ax); - context.ax = context.data.word(context.bx+0); - context.data.word(239) = context.ax; - getreelstart(context); - context._cmp(context.data.word(context.si+2), 0x0ffff); - if (!context.flags.z()) goto notblankpers; - context._add(context.si, 5); -notblankpers: - context.cx = context.data.word(context.si+2); - context.ax = context.data.word(context.si+0); - context.push(context.cx); - getreelframeax(context); - context.cx = context.pop(); - context._add(context.cl, context.data.byte(context.bx+4)); - context._add(context.ch, context.data.byte(context.bx+5)); - context.dx = context.cx; - context._add(context.dl, context.data.byte(context.bx+0)); - context._add(context.dh, context.data.byte(context.bx+1)); - context.ax = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.al, context.cl); - if (context.flags.c()) goto notareelid; - context._cmp(context.ah, context.ch); - if (context.flags.c()) goto notareelid; - context._cmp(context.al, context.dl); - if (!context.flags.c()) goto notareelid; - context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto notareelid; - context.cx = context.pop(); - context.ax = context.data.word(context.bx+2); - context.data.word(249) = context.ax; - context.al = context.data.byte(context.bx+4); - context.ah = 5; - obname(context); - context.al = 0; - context._cmp(context.al, 1); +static void slabdoorc(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 108; + context._cmp(context.data.byte(66), 4); + if (!context.flags.z()) goto slabdwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 135; + context.data.byte(188) = 47; return; -notareelid: - context.cx = context.pop(); - context._add(context.bx, 5); - context._sub(context.cx, 1); - if (!context.flags.z()) goto identifyreel; +slabdwrong: + context.data.word(21) = 40; + context.data.word(25) = 127; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } -static inline void checkifset(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); - context.cx = 127; -identifyset: - context._cmp(context.data.byte(context.bx+4), 255); - if (context.flags.z()) goto notasetid; - context._cmp(context.al, context.data.byte(context.bx)); - if (context.flags.c()) goto notasetid; - context._cmp(context.al, context.data.byte(context.bx+2)); - if (!context.flags.c()) goto notasetid; - context._cmp(context.ah, context.data.byte(context.bx+1)); - if (context.flags.c()) goto notasetid; - context._cmp(context.ah, context.data.byte(context.bx+3)); - if (!context.flags.c()) goto notasetid; - pixelcheckset(context); - if (context.flags.z()) goto notasetid; - isitdescribed(context); - if (context.flags.z()) goto notasetid; - context.al = context.data.byte(context.bx+4); - context.ah = 1; - obname(context); - context.al = 0; - context._cmp(context.al, 1); +static void slabdoore(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 141; + context._cmp(context.data.byte(66), 5); + if (!context.flags.z()) goto slabewrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 168; + context.data.byte(188) = 47; return; -notasetid: - context._sub(context.bx, 5); - context._sub(context.cx, 1); - context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyset; +slabewrong: + context.data.word(21) = 40; + context.data.word(25) = 160; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } -static inline void checkifex(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); - context.cx = 99; -identifyex: - context._cmp(context.data.byte(context.bx+4), 255); - if (context.flags.z()) goto notanexid; - context._cmp(context.al, context.data.byte(context.bx)); - if (context.flags.c()) goto notanexid; - context._cmp(context.al, context.data.byte(context.bx+2)); - if (!context.flags.c()) goto notanexid; - context._cmp(context.ah, context.data.byte(context.bx+1)); - if (context.flags.c()) goto notanexid; - context._cmp(context.ah, context.data.byte(context.bx+3)); - if (!context.flags.c()) goto notanexid; - context.al = context.data.byte(context.bx+4); - context.ah = 4; - obname(context); - context.al = 1; - context._cmp(context.al, 0); +static void slabdoorf(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 171; + context._cmp(context.data.byte(66), 2); + if (!context.flags.z()) goto slabfwrong; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 197; + context.data.byte(188) = 47; return; -notanexid: - context._sub(context.bx, 5); - context._sub(context.cx, 1); - context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyex; +slabfwrong: + context.data.word(21) = 40; + context.data.word(25) = 189; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } -static inline void checkiffree(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); - context.cx = 79; -identifyfree: - context._cmp(context.data.byte(context.bx+4), 255); - if (context.flags.z()) goto notafreeid; - context._cmp(context.al, context.data.byte(context.bx)); - if (context.flags.c()) goto notafreeid; - context._cmp(context.al, context.data.byte(context.bx+2)); - if (!context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.data.byte(context.bx+1)); - if (context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.data.byte(context.bx+3)); - if (!context.flags.c()) goto notafreeid; - context.al = context.data.byte(context.bx+4); - context.ah = 2; - obname(context); +static void useslab(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto slabwith; + withwhat(context); + return; +slabwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'J'; + context.ch = 'E'; + context.dl = 'W'; + context.dh = 'L'; + compare(context); + if (context.flags.z()) goto nextslab; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +nextslab: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(99); + context.push(context.ax); + removesetobject(context); + context.ax = context.pop(); + context._add(context.al, 1); + context.push(context.ax); + placesetobject(context); + context.ax = context.pop(); + context._cmp(context.al, 54); + if (!context.flags.z()) goto notlastslab; context.al = 0; - context._cmp(context.al, 1); - return; -notafreeid: - context._sub(context.bx, 5); - context._sub(context.cx, 1); - context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyfree; + turnpathon(context); + context.data.word(21) = 22; + context.data.word(23) = 35; + context.data.word(25) = 48; + context.data.byte(27) = 1; + context.data.byte(26) = 1; +notlastslab: + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.byte(103) = 1; return; } -static inline void isitdescribed(Context & context) { +static void usecart(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto cartwith; + withwhat(context); + return; +cartwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'R'; + context.ch = 'O'; + context.dl = 'C'; + context.dh = 'K'; + compare(context); + if (context.flags.z()) goto nextcart; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +nextcart: + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 0; + context.al = context.data.byte(99); context.push(context.ax); - context.push(context.cx); - context.push(context.es); - context.push(context.bx); - context.al = context.data.byte(context.bx+4); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(440); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+(130*2)); - context.bx = context.ax; - context.dl = context.data.byte(context.bx); - context.bx = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); + removesetobject(context); context.ax = context.pop(); - context._cmp(context.dl, 0); + context._add(context.al, 1); + placesetobject(context); + context._add(context.data.byte(2), 1); + context.al = 17; + playchannel1(context); + showfirstuse(context); + context.data.byte(103) = 1; return; } -static inline void findfirstpath(Context & context) { - context.push(context.ax); - context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.cx = context.pop(); - context.dl = 0; -fpathloop: - context.ax = context.data.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nofirst; - context._cmp(context.cl, context.al); - if (context.flags.c()) goto nofirst; - context._cmp(context.ch, context.ah); - if (context.flags.c()) goto nofirst; - context.ax = context.data.word(context.bx+4); - context._cmp(context.cl, context.al); - if (!context.flags.c()) goto nofirst; - context._cmp(context.ch, context.ah); - if (!context.flags.c()) goto nofirst; - goto gotfirst; -nofirst: - context._add(context.bx, 8); - context._add(context.dl, 1); - context._cmp(context.dl, 12); - if (!context.flags.z()) goto fpathloop; - context.al = 0; +static void useclearbox(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto clearboxwith; + withwhat(context); return; -gotfirst: - context.al = context.data.byte(context.bx+6); +clearboxwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'R'; + context.ch = 'A'; + context.dl = 'I'; + context.dh = 'L'; + compare(context); + if (context.flags.z()) goto openbox; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +openbox: + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 80; + context.data.word(23) = 67; + context.data.word(25) = 105; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void turnpathoff(Context & context) { - context.push(context.ax); - context.push(context.ax); - context.cl = 0; - context.ch = context.data.byte(185); - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - getroomspaths(context); - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) goto nopathoff; - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.data.byte(context.bx+6) = context.al; -nopathoff: +static void usecoveredbox(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.word(21) = 50; + context.data.word(23) = 41; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void turnanypathoff(Context & context) { - context.push(context.ax); - context.push(context.ax); - context.cl = 0; - context.ch = context.ah; - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - context.al = context.ah; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(450); - context.bx = 0; - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.data.byte(context.bx+6) = context.al; +static void userailing(Context & context) { + showfirstuse(context); + context.data.word(21) = 80; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.data.byte(56) = 4; return; } -static inline void obname(Context & context) { - context._cmp(context.data.byte(473), 0); - if (context.flags.z()) goto notnewpath; - context.data.byte(473) = 0; - goto diff; -notnewpath: - context._cmp(context.ah, context.data.byte(100)); - if (context.flags.z()) goto notdiffob; - goto diff; -notdiffob: - context._cmp(context.al, context.data.byte(99)); - if (!context.flags.z()) goto diff; - context._cmp(context.data.byte(306), 1); - if (context.flags.z()) goto walkandexamine; - context._cmp(context.data.word(202), 0); - if (context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 3); - if (!context.flags.z()) goto isntblock; - context._cmp(context.data.byte(153), 2); - if (context.flags.c()) goto noobselect; -isntblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); - if (!context.flags.z()) goto wantstowalk; - context._cmp(context.data.byte(100), 3); - if (context.flags.z()) goto wantstowalk; - finishedwalking(context); - if (!context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 5); - if (context.flags.z()) goto wantstotalk; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto noobselect; - examineob(context); +static void useopenbox(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto openboxwith; + withwhat(context); return; -wantstotalk: - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto noobselect; - talk(context); +openboxwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'F'; + compare(context); + if (context.flags.z()) goto destoryopenbox; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'P'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto openboxwrong; + showfirstuse(context); + return; +destoryopenbox: + context._add(context.data.byte(2), 1); + context.cx = 300; + context.al = 37; + showpuztext(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+15) = 'E'-'A'; + context.data.word(21) = 140; + context.data.word(23) = 105; + context.data.word(25) = 181; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.al = 4; + turnpathon(context); + context.data.byte(103) = 1; + return; +openboxwrong: + context.cx = 300; + context.al = 38; + showpuztext(context); + putbackobstuff(context); return; -walkandexamine: - finishedwalking(context); - if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); - context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); - if (context.flags.z()) goto noobselect; - examineob(context); +} + +static void wearwatch(Context & context) { + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto wearingwatch; + showfirstuse(context); + context.data.byte(3) = 1; + context.data.byte(103) = 1; + getanyad(context); + makeworn(context); return; -wantstowalk: - setwalk(context); - context.data.byte(473) = 1; -noobselect: +wearingwatch: + showseconduse(context); + putbackobstuff(context); return; -diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; -diff2: - context._cmp(context.data.byte(492), 254); - if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); - if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); - if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); - if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); - context._add(context.cl, 12); - context.ch = context.data.byte(152); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) goto isblock; -dontcheck: - getflagunderp(context); - context._cmp(context.data.byte(153), 2); - if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); - if (!context.flags.c()) goto isblock; - goto toofaraway; -notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); - if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); - if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); - if (context.flags.z()) goto isaperson; - examineobtext(context); +} + +static void wearshades(Context & context) { + context._cmp(context.data.byte(4), 1); + if (context.flags.z()) goto wearingshades; + context.data.byte(4) = 1; + showfirstuse(context); + context.data.byte(103) = 1; + getanyad(context); + makeworn(context); return; -middleofwalk: - blocknametext(context); +wearingshades: + showseconduse(context); + putbackobstuff(context); return; -isblock: - blocknametext(context); +} + +static void sitdowninbar(Context & context) { + context._cmp(context.data.byte(32), -1); + if (!context.flags.z()) goto satdown; + showfirstuse(context); + context.data.word(21) = 50; + context.data.word(23) = 55; + context.data.word(25) = 71; + context.data.word(29) = 73; + context.data.word(31) = 83; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; -isaperson: - personnametext(context); +satdown: + showseconduse(context); + putbackobstuff(context); return; -toofaraway: - walktotext(context); +} + +static void usechurchhole(Context & context) { + showfirstuse(context); + context.data.byte(103) = 1; + context.data.word(21) = 28; + context.data.word(23) = 13; + context.data.word(25) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } -static inline void commandonly(Context & context) { - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.es); - context.push(context.ds); - context.push(context.si); - context.push(context.di); - deltextline(context); - context.di = context.pop(); - context.si = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); - context._add(context.ax, 66*2); - context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(109) = 1; +static void usehole(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto holewith; + withwhat(context); + return; +holewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'H'; + context.ch = 'N'; + context.dl = 'D'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto righthand; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +righthand: + showfirstuse(context); + context.al = 86; + removesetobject(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(47) = 1; + context.data.byte(103) = 1; return; } -static inline void printmessage2(Context & context) { - context.push(context.dx); - context.push(context.bx); - context.push(context.di); - context.push(context.ax); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); - context._add(context.ax, 66*2); - context.si = context.ax; - context.ax = context.pop(); -searchmess: - context.push(context.ax); - findnextcolon(context); - context.ax = context.pop(); - context._sub(context.ah, 1); - if (!context.flags.z()) goto searchmess; - context.di = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); - context.al = 0; - context.ah = 0; - printdirect(context); +static void usealtar(Context & context) { + context.al = 'C'; + context.ah = 'N'; + context.cl = 'D'; + context.ch = 'A'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto thingsonaltar; + context.al = 'C'; + context.ah = 'N'; + context.cl = 'D'; + context.ch = 'B'; + findexobject(context); + context._cmp(context.al, 114); + if (context.flags.z()) goto thingsonaltar; + context._cmp(context.data.byte(47), 1); + if (context.flags.z()) goto movealtar; + context.cx = 300; + context.al = 23; + showpuztext(context); + context.data.byte(103) = 1; + return; +movealtar: + context._add(context.data.byte(2), 1); + showseconduse(context); + context.data.word(21) = 160; + context.data.word(23) = 81; + context.data.word(25) = 174; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.al = 47; + context.bl = 52; + context.bh = 76; + context.cx = 32; + context.dx = 98; + setuptimeduse(context); + context.data.byte(103) = 1; + return; +thingsonaltar: + showfirstuse(context); + context.data.byte(103) = 1; return; } -static inline void usetempcharset(Context & context) { - context.ax = context.data.word(406); - context.data.word(268) = context.ax; +static void opentvdoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto tvdoorwith; + withwhat(context); + return; +tvdoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'U'; + context.ch = 'L'; + context.dl = 'O'; + context.dh = 'K'; + compare(context); + if (context.flags.z()) goto keyontv; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); return; -} - -static inline void blank(Context & context) { - context._cmp(context.data.byte(100), 199); - if (context.flags.z()) goto alreadyblnk; - context.data.byte(100) = 199; - context.al = 0; - commandonly(context); -alreadyblnk: +keyontv: + showfirstuse(context); + context.data.byte(37) = 0; + context.data.byte(103) = 1; return; } -static inline void allpointer(Context & context) { - readmouse(context); - showpointer(context); - dumppointer(context); +static void usedryer(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + context.data.byte(103) = 1; return; } -static inline void hangoncurs(Context & context) { -monloop1: - context.push(context.cx); - printcurs(context); - vsync(context); - delcurs(context); - context.cx = context.pop(); - if (--context.cx) goto monloop1; +static void openlouis(Context & context) { + context.al = 5; + context.ah = 2; + context.cl = 3; + context.ch = 8; + entercode(context); + context.data.byte(103) = 1; return; } -static inline void readkey(Context & context) { - context.bx = context.data.word(396); - context._cmp(context.bx, context.data.word(394)); - if (context.flags.z()) goto nokey; - context._add(context.bx, 1); - context._and(context.bx, 15); - context.data.word(396) = context.bx; - context.di = 5715; - context._add(context.di, context.bx); - context.al = context.data.byte(context.di); - context.data.byte(142) = context.al; - return; -nokey: - context.data.byte(142) = 0; +static void nextcolon(Context & context) { +lookcolon: + context.al = context.data.byte(context.si); + context._add(context.si, 1); + context._cmp(context.al, ':'); + if (!context.flags.z()) goto lookcolon; return; } -static inline void convertkey(Context & context) { - context._and(context.al, 127); - context.ah = 0; - context.di = 5731; - context._add(context.di, context.ax); - context.al = context.data.byte(context.di); +static void openyourneighbour(Context & context) { + context.al = 255; + context.ah = 255; + context.cl = 255; + context.ch = 255; + entercode(context); + context.data.byte(103) = 1; return; } -static inline void randomnum2(Context & context) { - context.push(context.ds); - context.push(context.es); - context.push(context.di); - context.push(context.bx); - context.push(context.ax); - randomnumber(context); - context.cl = context.al; - context.ax = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); +static void usewindow(Context & context) { + context._cmp(context.data.byte(475), 6); + if (!context.flags.z()) goto notonbalc; + context._add(context.data.byte(2), 1); + showfirstuse(context); + context.data.byte(188) = 29; + context.data.byte(103) = 1; return; -} - -static inline void loadtempcharset(Context & context) { - standardload(context); - context.data.word(406) = context.ax; +notonbalc: + showseconduse(context); + putbackobstuff(context); return; } -static inline void getridofall(Context & context) { - context.es = context.data.word(416); - deallocatemem(context); - context.es = context.data.word(444); - deallocatemem(context); - context.es = context.data.word(430); - deallocatemem(context); - context.es = context.data.word(432); - deallocatemem(context); - context.es = context.data.word(434); - deallocatemem(context); - context.es = context.data.word(450); - deallocatemem(context); - context.es = context.data.word(448); - deallocatemem(context); - context.es = context.data.word(440); - deallocatemem(context); - context.es = context.data.word(442); - deallocatemem(context); - context.es = context.data.word(436); - deallocatemem(context); - context.es = context.data.word(446); - deallocatemem(context); - context.es = context.data.word(438); - deallocatemem(context); +static void usebalcony(Context & context) { + showfirstuse(context); + context.al = 6; + turnpathon(context); + context.al = 0; + turnpathoff(context); + context.al = 1; + turnpathoff(context); + context.al = 2; + turnpathoff(context); + context.al = 3; + turnpathoff(context); + context.al = 4; + turnpathoff(context); + context.al = 5; + turnpathoff(context); + context._add(context.data.byte(2), 1); + context.data.byte(475) = 6; + context.data.byte(478) = 6; + context.data.byte(477) = 6; + findxyfrompath(context); + switchryanoff(context); + context.data.byte(187) = 1; + context.data.word(21) = 30*2; + context.data.word(23) = 183; + context.data.word(25) = 212; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void restoreall(Context & context) { - context.al = context.data.byte(9); - getroomdata(context); - context.dx = context.bx; - openfile(context); - readheader(context); - allocateload(context); - context.ds = context.ax; - context.data.word(416) = context.ax; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(400); - context.dx = 0; - context.cx = 132*66; - context.al = 0; - fillspace(context); - loadseg(context); - sortoutmap(context); - allocateload(context); - context.data.word(444) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(430) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(432) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(434) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(450) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(448) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(440) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(442) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(436) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(446) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(438) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - closefile(context); - setallchanges(context); +static void openryan(Context & context) { + context.al = 5; + context.ah = 1; + context.cl = 0; + context.ch = 6; + entercode(context); + context.data.byte(103) = 1; return; } -static inline void disablepath(Context & context) { - context.push(context.cx); - context._xchg(context.al, context.ah); - context.cx = -6; -looky2: - context._add(context.cx, 6); - context._sub(context.al, 10); - if (!context.flags.c()) goto looky2; - context.al = context.ah; - context._sub(context.cx, 1); -lookx2: - context._add(context.cx, 1); - context._sub(context.al, 11); - if (!context.flags.c()) goto lookx2; - context.al = context.cl; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(450); - context.bx = 0; - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.data.byte(context.bx+6) = context.al; +static void openpoolboss(Context & context) { + context.al = 5; + context.ah = 2; + context.cl = 2; + context.ch = 2; + entercode(context); + context.data.byte(103) = 1; + return; +} + +static void openeden(Context & context) { + context.al = 2; + context.ah = 8; + context.cl = 6; + context.ch = 5; + entercode(context); + context.data.byte(103) = 1; return; } -static inline void getridoftempcharset(Context & context) { - context.es = context.data.word(406); - deallocatemem(context); +static void opensarters(Context & context) { + context.al = 7; + context.ah = 8; + context.cl = 3; + context.ch = 3; + entercode(context); + context.data.byte(103) = 1; return; } -static inline void getridoftempsp(Context & context) { - context.es = context.data.word(464); - deallocatemem(context); +static void isitright(Context & context) { + context.bx = context.ds; + context.es = context.bx; + context.bx = 8350; + context._cmp(context.data.byte(context.bx+0), context.al); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+1), context.ah); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+2), context.cl); + if (!context.flags.z()) goto notright; + context._cmp(context.data.byte(context.bx+3), context.ch); +notright: return; } -static inline void seecommandtail(Context & context) { - context.data.word(372) = 0x220; - context.data.byte(378) = 5; - context.data.byte(379) = 1; - context.data.byte(73) = 0; - context.bx = 2; - context.ax = context.data.word(context.bx); - context.dx = context.es; - context._sub(context.ax, context.dx); - context.data.word(534) = context.ax; - context.bx = 0x02c; - context.ax = context.data.word(context.bx); - context.push(context.es); - context.push(context.bx); - context.es = context.ax; - context.bx = 0; -findblaster: - context.ax = context.data.word(context.bx); - context._cmp(context.ax, 0); - if (context.flags.z()) goto endofenvironment; - context._cmp(context.al, 'B'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ah, 'L'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+2), 'A'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+3), 'S'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+4), 'T'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+5), 'E'); - if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+6), 'R'); - if (!context.flags.z()) goto notblast; - context._add(context.bx, 7); - parseblaster(context); - goto endofenvironment; -notblast: - context._add(context.bx, 1); - goto findblaster; -endofenvironment: - context.bx = context.pop(); - context.es = context.pop(); - context.bx = 0x81; - parseblaster(context); +static void drawitall(Context & context) { + createpanel(context); + drawfloor(context); + printsprites(context); + showicon(context); return; } -static inline void checkbasemem(Context & context) { - context.bx = context.data.word(534); - context._cmp(context.bx, 0x9360); - if (!context.flags.c()) goto enoughmem; - context.data.byte(532) = 5; - { quickquit(context); return; }; -enoughmem: +static void openhoteldoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto hoteldoorwith; + withwhat(context); + return; +hoteldoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto keyonhotel1; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +keyonhotel1: + context.al = 16; + playchannel1(context); + showfirstuse(context); + context.data.byte(37) = 0; + context.data.byte(103) = 1; return; } -static inline void checkforemm(Context & context) { +static void openhoteldoor2(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto hoteldoorwith2; + withwhat(context); + return; +hoteldoorwith2: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto keyonhotel2; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +keyonhotel2: + context.al = 16; + playchannel1(context); + showfirstuse(context); + putbackobstuff(context); return; } -static inline void trysoundalloc(Context & context) { - context._cmp(context.data.byte(358), 1); - if (context.flags.z()) goto gotsoundbuff; - context._add(context.data.byte(357), 1); - context.bx = (16384+2048)/16; - allocatemem(context); - context.data.word(353) = context.ax; - context.push(context.ax); - context.al = context.ah; - context.cl = 4; - context._shr(context.al, context.cl); - context.data.byte(356) = context.al; - context.ax = context.pop(); - context.cl = 4; - context._shl(context.ax, context.cl); - context.data.word(355) = context.ax; - context._cmp(context.ax, 0x0b7ff); - if (!context.flags.c()) goto soundfail; - context.es = context.data.word(353); - context.di = 0; - context.cx = 16384/2; - context.ax = 0x7f7f; - while(--context.cx) context._stosw(); - context.data.byte(358) = 1; +static void grafittidoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto grafwith; + withwhat(context); return; -soundfail: - context.es = context.data.word(353); - deallocatemem(context); -gotsoundbuff: +grafwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'P'; + context.dl = 'E'; + context.dh = 'N'; + compare(context); + if (context.flags.z()) goto dograf; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +dograf: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void allocatework(Context & context) { - context.bx = 0x1000; - allocatemem(context); - context.data.word(400) = context.ax; +static void trapdoor(Context & context) { + context._add(context.data.byte(2), 1); + showfirstuse(context); + switchryanoff(context); + context.data.word(21) = 20*2; + context.data.word(23) = 181; + context.data.word(25) = 197; + context.data.byte(188) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void allocatebuffers(Context & context) { - context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; - allocatemem(context); - context.data.word(398) = context.ax; - trysoundalloc(context); - context.bx = 0+(66*60)/16; - allocatemem(context); - context.data.word(418) = context.ax; - trysoundalloc(context); - context.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-context.data.byte(537)+68-context.data.byte(1)/16; - allocatemem(context); - context.data.word(412) = context.ax; - trysoundalloc(context); - context.bx = 16*80/16; - allocatemem(context); - context.data.word(426) = context.ax; - trysoundalloc(context); - context.bx = 64*128/16; - allocatemem(context); - context.data.word(428) = context.ax; - trysoundalloc(context); - context.bx = 22*8*20*8/16; - allocatemem(context); - context.data.word(402) = context.ax; - allocatework(context); - context.bx = 2048/16; - allocatemem(context); - context.data.word(420) = context.ax; - context.bx = 2048/16; - allocatemem(context); - context.data.word(422) = context.ax; +static void callhotellift(Context & context) { + context.al = 12; + playchannel1(context); + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.data.byte(478) = 5; + context.data.byte(477) = 5; + autosetwalk(context); + context.al = 4; + turnpathon(context); return; } -static inline void clearbuffers(Context & context) { - context.es = context.data.word(412); - context.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-context.data.byte(537)+68-context.data.byte(1)/2; - context.ax = 0; - context.di = 0; - while(--context.cx) context._stosw(); - context.es = context.data.word(398); - context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; - context.ax = 0x0ffff; - context.di = 0; - while(--context.cx) context._stosw(); - context.es = context.data.word(412); - context.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); - context.ds = context.cs; - context.si = 537; - context.cx = 991-context.data.byte(537); - while(--context.cx) context._movsb(); - context.es = context.data.word(412); - context.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-context.data.byte(537); - context.ds = context.cs; - context.si = 1; - context.cx = 68-context.data.byte(1); - while(--context.cx) context._movsb(); - clearchanges(context); +static void calledenslift(Context & context) { + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.al = 2; + turnpathon(context); return; } -static inline void clearpalette(Context & context) { - context.data.byte(344) = 0; - clearstartpal(context); - dumpcurrent(context); +static void calledensdlift(Context & context) { + context._cmp(context.data.byte(35), 1); + if (context.flags.z()) goto edensdhere; + showfirstuse(context); + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.al = 2; + turnpathon(context); + return; +edensdhere: + showseconduse(context); + putbackobstuff(context); return; } -static inline void readsetdata(Context & context) { - context.dx = 1870; - standardload(context); - context.data.word(404) = context.ax; - context.dx = 1935; - standardload(context); - context.data.word(408) = context.ax; - context.dx = 1948; - standardload(context); - context.data.word(410) = context.ax; - context.dx = 1832; - standardload(context); - context.data.word(414) = context.ax; - context.dx = 2234; - standardload(context); - context.data.word(454) = context.ax; - context.dx = 2286; - standardload(context); - context.data.word(452) = context.ax; - context.ax = context.data.word(404); - context.data.word(268) = context.ax; - context._cmp(context.data.byte(378), 255); - if (context.flags.z()) goto novolumeload; - context.dx = 2299; - openfile(context); - context.cx = 2048-256; - context.ds = context.data.word(353); - context.dx = 16384; - readfromfile(context); - closefile(context); -novolumeload: +static void usepoolreader(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto poolwith; + withwhat(context); + return; +poolwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'M'; + context.ch = 'E'; + context.dl = 'M'; + context.dh = 'B'; + compare(context); + if (context.flags.z()) goto openpool; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +openpool: + context._cmp(context.data.byte(48), 1); + if (context.flags.z()) goto canopenpool; + showseconduse(context); + putbackobstuff(context); + return; +canopenpool: + context.al = 17; + playchannel1(context); + showfirstuse(context); + context.data.byte(39) = 6; + context.data.byte(103) = 1; return; } -static inline void loadpalfromiff(Context & context) { - context.dx = 2494; - openfile(context); - context.cx = 2000; - context.ds = context.data.word(402); - context.dx = 0; - readfromfile(context); - closefile(context); - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.ds = context.data.word(402); - context.si = 0x30; - context.cx = 768; -palloop: - context._lodsb(); - context._shr(context.al, 1); - context._shr(context.al, 1); - context._cmp(context.data.byte(73), 1); - if (!context.flags.z()) goto nought; - context._cmp(context.al, 0); - if (context.flags.z()) goto nought; - context.ah = context.al; - context._shr(context.ah, 1); - context._add(context.al, context.ah); - context._shr(context.ah, 1); - context._add(context.al, context.ah); - context._cmp(context.al, 64); - if (context.flags.c()) goto nought; - context.al = 63; -nought: - context._stosb(); - if (--context.cx) goto palloop; +static void uselighter(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotlighterwith; + withwhat(context); + return; +gotlighterwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'S'; + context.ch = 'M'; + context.dl = 'K'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto cigarette; + showfirstuse(context); + putbackobstuff(context); + return; +cigarette: + context.cx = 300; + context.al = 9; + showpuztext(context); + context.al = context.data.byte(95); + getexad(context); + context.data.byte(context.bx+2) = 255; + context.data.byte(103) = 1; return; } -static inline void biblequote(Context & context) { - mode640x480(context); - context.dx = 2390; - showpcx(context); - fadescreenups(context); - context.cx = 80; - hangone(context); - context.cx = 560; - hangone(context); - fadescreendowns(context); - context.cx = 200; - hangone(context); - cancelch0(context); +static void showseconduse(Context & context) { + getobtextstart(context); + nextcolon(context); + nextcolon(context); + nextcolon(context); + usetext(context); + context.cx = 400; + hangonp(context); return; } -static inline void runintroseq(Context & context) { - context.data.byte(103) = 0; -moreintroseq: - vsync(context); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto earlyendrun; - spriteupdate(context); - vsync(context); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto earlyendrun; - deleverything(context); - printsprites(context); - reelsonscreen(context); - afterintroroom(context); - usetimedtext(context); - vsync(context); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto earlyendrun; - dumpmap(context); - dumptimedtext(context); - vsync(context); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto earlyendrun; - context._cmp(context.data.byte(103), 1); - if (!context.flags.z()) goto moreintroseq; +static void usecardreader1(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader1with; + withwhat(context); + return; +gotreader1with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto correctcard; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +correctcard: + context._cmp(context.data.byte(49), 0); + if (context.flags.z()) goto notyet; + context._cmp(context.data.word(16), 0); + if (context.flags.z()) goto getscash; + context.cx = 300; + context.al = 17; + showpuztext(context); + putbackobstuff(context); + return; +getscash: + context.al = 16; + playchannel1(context); + context.cx = 300; + context.al = 18; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(16) = 12432; + context.data.byte(103) = 1; + return; +notyet: + showfirstuse(context); + putbackobstuff(context); + return; +} + +static void usecardreader2(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader2with; + withwhat(context); + return; +gotreader2with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto correctcard2; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +correctcard2: + context._cmp(context.data.byte(50), 0); + if (context.flags.z()) goto notyetboss; + context._cmp(context.data.word(16), 0); + if (context.flags.z()) goto nocash; + context._cmp(context.data.byte(46), 2); + if (context.flags.z()) goto alreadygotnew; + context.al = 18; + playchannel1(context); + context.cx = 300; + context.al = 19; + showpuztext(context); + context.al = 94; + placesetobject(context); + context.data.byte(46) = 1; + context._sub(context.data.word(16), 2000); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +nocash: + context.cx = 300; + context.al = 20; + showpuztext(context); + putbackobstuff(context); return; -earlyendrun: - context.ax = context.pop(); - context.ax = context.pop(); - getridoftemptext(context); - clearbeforeload(context); +alreadygotnew: + context.cx = 300; + context.al = 22; + showpuztext(context); + putbackobstuff(context); return; -} - -static inline void intro(Context & context) { - context.dx = 2260; - loadtemptext(context); - loadpalfromiff(context); - setmode(context); - context.data.byte(188) = 50; - clearpalette(context); - loadintroroom(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; - context.al = 12; - context.ah = 255; - playchannel0(context); - fadescreenups(context); - runintroseq(context); - clearbeforeload(context); - context.data.byte(188) = 52; - loadintroroom(context); - runintroseq(context); - clearbeforeload(context); - context.data.byte(188) = 53; - loadintroroom(context); - runintroseq(context); - clearbeforeload(context); - allpalette(context); - context.data.byte(188) = 54; - loadintroroom(context); - runintroseq(context); - getridoftemptext(context); - clearbeforeload(context); +notyetboss: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void titles(Context & context) { - clearpalette(context); - biblequote(context); - intro(context); +static void usecardreader3(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotreader3with; + withwhat(context); return; -} - -static inline void dumpcurrent(Context & context) { - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.ds = context.data.word(412); - vsync(context); - context.al = 0; - context.cx = 128; - showgroup(context); - vsync(context); - context.al = 128; - context.cx = 128; - showgroup(context); +gotreader3with: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'S'; + context.dl = 'H'; + context.dh = 'R'; + compare(context); + if (context.flags.z()) goto rightcard; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); return; -} - -static inline void allpalette(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.cx = 768/2; - while(--context.cx) context._movsw(); - dumpcurrent(context); +rightcard: + context._cmp(context.data.byte(51), 0); + if (context.flags.z()) goto notyetrecep; + context._cmp(context.data.byte(52), 0); + if (!context.flags.z()) goto alreadyusedit; + context.al = 16; + playchannel1(context); + context.cx = 300; + context.al = 25; + showpuztext(context); + context._add(context.data.byte(2), 1); + context._sub(context.data.word(16), 8300); + context.data.byte(52) = 1; + context.data.byte(103) = 1; + return; +alreadyusedit: + context.cx = 300; + context.al = 26; + showpuztext(context); + putbackobstuff(context); + return; +notyetrecep: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void realcredits(Context & context) { - context.data.byte(531) = 33; - loadroomssample(context); - context.data.byte(386) = 0; - mode640x480(context); - context.cx = 35; - hangon(context); - context.dx = 2403; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - allpalette(context); - context.cx = 80; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - context.dx = 2416; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - allpalette(context); - context.cx = 80; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - context.dx = 2429; - showpcx(context); - context.al = 12; +static void usecashcard(Context & context) { + getridofreels(context); + loadkeypad(context); + createpanel(context); + showpanel(context); + showexit(context); + showman(context); + context.di = 114; + context.bx = 120-3; + context.ds = context.data.word(458); + context.al = 39; context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - allpalette(context); - context.cx = 80; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - context.dx = 2442; - showpcx(context); - context.al = 12; + showframe(context); + context.ax = context.data.word(16); + moneypoke(context); + getobtextstart(context); + nextcolon(context); + nextcolon(context); + context.di = 36; + context.bx = 98; + context.dl = 241; + context.al = 0; context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - allpalette(context); - context.cx = 80; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - context.dx = 2455; - showpcx(context); - context.al = 12; + printdirect(context); + context.di = 160; + context.bx = 155; + context.es = context.cs; + context.si = 3385; + context.data.word(71) = 91*2+75; + context.al = 0; context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - allpalette(context); - context.cx = 80; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - context.dx = 2468; - showpcx(context); - fadescreenups(context); - context.cx = 60; - hangone(context); - context.al = 13; + context.dl = 240; + printdirect(context); + context.di = 187; + context.bx = 155; + context.es = context.cs; + context.si = 3390; + context.data.word(71) = 91*2+85; + context.al = 0; context.ah = 0; - playchannel0(context); - context.cx = 350; - hangone(context); - fadescreendowns(context); - context.cx = 256; - hangone(context); - return; -} - -static inline void credits(Context & context) { - clearpalette(context); - realcredits(context); - return; -} - -static inline void cls(Context & context) { - context.ax = 0x0a000; - context.es = context.ax; - context.di = 0; - context.cx = 0x7fff; - context.ax = 0; - while(--context.cx) context._stosw(); - return; -} - -static inline void loadsavebox(Context & context) { - context.dx = 1974; - loadintotemp(context); + context.dl = 240; + printdirect(context); + context.data.word(71) = 0; + worktoscreenm(context); + context.cx = 400; + hangonp(context); + getridoftemp(context); + restorereels(context); + putbackobstuff(context); return; } -static inline void showopbox(Context & context) { +static void lookatcard(Context & context) { + context.data.byte(131) = 1; + getridofreels(context); + loadkeypad(context); + createpanel2(context); + context.di = 160; + context.bx = 80; context.ds = context.data.word(458); - context.di = 60; - context.bx = 52; - context.al = 0; - context.ah = 0; + context.al = 42; + context.ah = 128; showframe(context); - context.ds = context.data.word(458); - context.di = 60; - context.bx = 52+55; - context.al = 4; + getobtextstart(context); + findnextcolon(context); + findnextcolon(context); + findnextcolon(context); + context.di = 36; + context.bx = 124; + context.dl = 241; + context.al = 0; context.ah = 0; - showframe(context); - return; -} - -static inline void showdecisions(Context & context) { + printdirect(context); + context.push(context.es); + context.push(context.si); + worktoscreenm(context); + context.cx = 280; + hangonw(context); createpanel2(context); - showopbox(context); + context.di = 160; + context.bx = 80; context.ds = context.data.word(458); - context.di = 60+17; - context.bx = 52+13; - context.al = 6; - context.ah = 0; + context.al = 42; + context.ah = 128; showframe(context); - undertextline(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 36; + context.bx = 130; + context.dl = 241; + context.al = 0; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonw(context); + context.data.byte(131) = 0; + getridoftemp(context); + restorereels(context); + putbackobstuff(context); return; } -static inline void decide(Context & context) { - setmode(context); - loadpalfromiff(context); - clearpalette(context); - context.data.byte(234) = 0; - context.data.word(21) = 0; - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; - loadsavebox(context); - showdecisions(context); - worktoscreen(context); - fadescreenup(context); - context.data.byte(103) = 0; -waitdecide: - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.bx = 4884; - checkcoords(context); - context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto waitdecide; - context._cmp(context.data.byte(103), 4); - if (context.flags.z()) goto hasloadedroom; - getridoftemp(context); -hasloadedroom: - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; +static void moneypoke(Context & context) { + context.bx = 3385; + context.cl = 48-1; +numberpoke0: + context._add(context.cl, 1); + context._sub(context.ax, 10000); + if (!context.flags.c()) goto numberpoke0; + context._add(context.ax, 10000); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke1: + context._add(context.cl, 1); + context._sub(context.ax, 1000); + if (!context.flags.c()) goto numberpoke1; + context._add(context.ax, 1000); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke2: + context._add(context.cl, 1); + context._sub(context.ax, 100); + if (!context.flags.c()) goto numberpoke2; + context._add(context.ax, 100); + context.data.byte(context.bx) = context.cl; + context._add(context.bx, 1); + context.cl = 48-1; +numberpoke3: + context._add(context.cl, 1); + context._sub(context.ax, 10); + if (!context.flags.c()) goto numberpoke3; + context._add(context.ax, 10); + context.data.byte(context.bx) = context.cl; + context.bx = 3390; + context._add(context.al, 48); + context.data.byte(context.bx) = context.al; return; } -static inline void clearchanges(Context & context) { - context.es = context.data.word(412); - context.cx = 250*2; - context.ax = 0x0ffff; - context.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); - while(--context.cx) context._stosw(); - context.ds = context.data.word(412); - context.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); - context.es = context.cs; - context.di = 537; - context.cx = 991-context.data.byte(537); - while(--context.cx) context._movsb(); - context.ds = context.data.word(412); - context.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-context.data.byte(537); - context.es = context.cs; - context.di = 1; - context.cx = 68-context.data.byte(1); - while(--context.cx) context._movsb(); - context.data.byte(10) = 0; - context.data.word(12) = 0; - context.data.word(14) = 0; - context.es = context.data.word(398); - context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; - context.ax = 0x0ffff; - context.di = 0; - while(--context.cx) context._stosw(); - context.es = context.cs; - context.di = 7798; - context.al = 1; - context._stosb(); - context._stosb(); +static void usecontrol(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotcontrolwith; + withwhat(context); + return; +gotcontrolwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'E'; + context.dl = 'Y'; + context.dh = 'A'; + compare(context); + if (context.flags.z()) goto rightkey; + context._cmp(context.data.byte(184), 21); + if (!context.flags.z()) goto balls; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto jimmycontrols; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto axeoncontrols; +balls: + showfirstuse(context); + putbackobstuff(context); + return; +rightkey: + context.al = 16; + playchannel1(context); + context._cmp(context.data.byte(9), 21); + if (context.flags.z()) goto goingdown; + context.cx = 300; context.al = 0; - context._stosb(); - context.al = 1; - context._stosb(); - context.ax = 0; - context.cx = 6; - while(--context.cx) context._stosw(); + showpuztext(context); + context.data.byte(188) = 21; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; -} - -static inline void fillspace(Context & context) { - context.push(context.es); - context.push(context.ds); - context.push(context.dx); - context.push(context.di); - context.push(context.bx); - context.di = context.dx; - context.es = context.ds; - while(--context.cx) context._stosb(); - context.bx = context.pop(); - context.di = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); +goingdown: + context.cx = 300; + context.al = 3; + showpuztext(context); + context.data.byte(188) = 30; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +jimmycontrols: + context.al = 50; + placesetobject(context); + context.al = 51; + placesetobject(context); + context.al = 26; + placesetobject(context); + context.al = 30; + placesetobject(context); + context.al = 16; + removesetobject(context); + context.al = 17; + removesetobject(context); + context.al = 14; + playchannel1(context); + context.cx = 300; + context.al = 10; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +axeoncontrols: + context.cx = 300; + context.al = 16; + showpuztext(context); + context._add(context.data.byte(2), 1); + putbackobstuff(context); return; } -static inline void sortoutmap(Context & context) { - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(400); - context.si = 0; - context.es = context.data.word(418); - context.di = 0; - context.cx = 60; -blimey: - context.push(context.cx); - context.push(context.si); - context.cx = 66; - while(--context.cx) context._movsb(); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 132); - if (--context.cx) goto blimey; - context.di = context.pop(); - context.es = context.pop(); +static void usehatch(Context & context) { + showfirstuse(context); + context.data.byte(188) = 40; + context.data.byte(103) = 1; return; } -static inline void deletetaken(Context & context) { - context.es = context.data.word(426); - context.ah = context.data.byte(184); - context.ds = context.data.word(398); - context.si = 0+2080+30000; - context.cx = 114; -takenloop: - context.al = context.data.byte(context.si+11); - context._cmp(context.al, context.ah); - if (!context.flags.z()) goto notinhere; - context.bl = context.data.byte(context.si+1); - context.bh = 0; - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context.data.byte(context.bx+2) = 254; -notinhere: - context._add(context.si, 16); - if (--context.cx) goto takenloop; +static void usewire(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotwirewith; + withwhat(context); return; -} - -static inline void dochange(Context & context) { - context._cmp(context.ch, 0); - if (context.flags.z()) goto object; - context._cmp(context.ch, 1); - if (context.flags.z()) goto freeobject; -path: - context.push(context.cx); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context.push(context.ax); - context.al = context.ch; - context._sub(context.al, 100); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.bx = context.pop(); - context._add(context.bx, context.ax); - context._add(context.bx, 0); - context.es = context.data.word(450); - context.cx = context.pop(); - context.data.byte(context.bx+6) = context.cl; -nopath: +gotwirewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto wireknife; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto wireaxe; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); return; -object: - context.push(context.cx); - getsetad(context); - context.cx = context.pop(); - context.data.byte(context.bx+58) = context.cl; +wireaxe: + context.cx = 300; + context.al = 16; + showpuztext(context); + putbackobstuff(context); return; -freeobject: - context.push(context.cx); - getfreead(context); - context.cx = context.pop(); - context._cmp(context.data.byte(context.bx+2), 255); - if (!context.flags.z()) goto beenpickedup; - context.data.byte(context.bx+2) = context.cl; -beenpickedup: +wireknife: + context.al = 51; + removesetobject(context); + context.al = 52; + placesetobject(context); + context.cx = 300; + context.al = 11; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; return; } -static inline void setallchanges(Context & context) { - context.es = context.data.word(412); - context.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); -setallloop: - context.ax = context.data.word(context.bx); +static void usehandle(Context & context) { + context.al = 'C'; + context.ah = 'U'; + context.cl = 'T'; + context.ch = 'W'; + findsetobject(context); + context.al = context.data.byte(context.bx+58); context._cmp(context.al, 255); - if (context.flags.z()) goto endsetloop; - context.cx = context.data.word(context.bx+2); - context._add(context.bx, 4); - context._cmp(context.ah, context.data.byte(184)); - if (!context.flags.z()) goto setallloop; - context.push(context.es); - context.push(context.bx); - dochange(context); - context.bx = context.pop(); - context.es = context.pop(); - goto setallloop; -endsetloop: + if (!context.flags.z()) goto havecutwire; + context.cx = 300; + context.al = 12; + showpuztext(context); + context.data.byte(103) = 1; + return; +havecutwire: + context.cx = 300; + context.al = 13; + showpuztext(context); + context.data.byte(188) = 22; + context.data.byte(103) = 1; return; } -static inline void autoappear(Context & context) { - context._cmp(context.data.byte(9), 32); - if (!context.flags.z()) goto notinalley; - context.al = 5; - resetlocation(context); - context.al = 10; - setlocation(context); - context.data.byte(183) = 10; +static void useelevator1(Context & context) { + showfirstuse(context); + selectlocation(context); + context.data.byte(103) = 1; return; -notinalley: - context._cmp(context.data.byte(184), 24); - if (!context.flags.z()) goto notinedens; - context._cmp(context.data.byte(42), 1); - if (!context.flags.z()) goto edenspart2; - context._add(context.data.byte(42), 1); - context.al = 44; - placesetobject(context); - context.al = 18; - placesetobject(context); - context.al = 93; - placesetobject(context); - context.al = 92; - removesetobject(context); - context.al = 55; - removesetobject(context); - context.al = 75; - removesetobject(context); - context.al = 84; - removesetobject(context); - context.al = 85; - removesetobject(context); +} + +static void showfirstuse(Context & context) { + getobtextstart(context); + findnextcolon(context); + findnextcolon(context); + usetext(context); + context.cx = 400; + hangonp(context); return; -edenspart2: - context._cmp(context.data.byte(43), 1); - if (!context.flags.z()) goto notedens2; - context.al = 44; - removesetobject(context); - context.al = 93; - removesetobject(context); - context.al = 55; - placesetobject(context); - context._add(context.data.byte(43), 1); -notedens2: +} + +static void useelevator3(Context & context) { + showfirstuse(context); + context.data.byte(40) = 20; + context.data.byte(188) = 34; + context.data.word(23) = 46; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; -notinedens: - context._cmp(context.data.byte(184), 25); - if (!context.flags.z()) goto notonsartroof; - context.data.byte(34) = 3; - context.al = 6; - resetlocation(context); - context.al = 11; - setlocation(context); - context.data.byte(183) = 11; +} + +static void useelevator4(Context & context) { + showfirstuse(context); + context.data.word(23) = 0; + context.data.word(25) = 11; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(40) = 20; + context.data.word(21) = 80; + context.data.byte(103) = 1; + context.data.byte(188) = 24; return; -notonsartroof: - context._cmp(context.data.byte(184), 2); - if (!context.flags.z()) goto notinlouiss; - context._cmp(context.data.byte(41), 0); - if (context.flags.z()) goto notinlouiss; - context.al = 23; - placesetobject(context); -notinlouiss: +} + +static void useelevator2(Context & context) { + context._cmp(context.data.byte(9), 23); + if (context.flags.z()) goto inpoolhall; + showfirstuse(context); + context.data.byte(188) = 23; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; + return; +inpoolhall: + showfirstuse(context); + context.data.byte(188) = 31; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; } -static inline void startloading(Context & context) { - context.data.byte(64) = 0; - context.al = context.data.byte(context.bx+13); - context.data.byte(531) = context.al; - context.al = context.data.byte(context.bx+15); - context.data.byte(148) = context.al; - context.al = context.data.byte(context.bx+16); - context.data.byte(149) = context.al; - context.al = context.data.byte(context.bx+20); - context.data.byte(35) = context.al; - context.al = context.data.byte(context.bx+21); - context.data.byte(475) = context.al; - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; - context.al = context.data.byte(context.bx+22); - context.data.byte(133) = context.al; - context.data.byte(135) = context.al; - context.al = context.data.byte(context.bx+23); - context.data.byte(39) = context.al; - context.al = context.data.byte(context.bx+24); - context.data.byte(36) = context.al; - context.al = context.data.byte(context.bx+25); - context.data.byte(38) = context.al; - context.data.byte(65) = -1; - context.al = context.data.byte(context.bx+27); - context.push(context.ax); - context.al = context.data.byte(context.bx+31); - context.ah = context.data.byte(184); - context.data.byte(184) = context.al; - context.dx = context.bx; - openfile(context); - readheader(context); - allocateload(context); - context.ds = context.ax; - context.data.word(416) = context.ax; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(400); - context.dx = 0; - context.cx = 132*66; +static void useelevator5(Context & context) { + context.al = 4; + placesetobject(context); context.al = 0; - fillspace(context); - loadseg(context); - sortoutmap(context); - allocateload(context); - context.data.word(444) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(428); - context.dx = 0; - context.cx = 64*128; - context.al = 255; - fillspace(context); - loadseg(context); - allocateload(context); - context.data.word(430) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(432) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(434) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(450) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(448) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(440) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(442) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(436) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(446) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(426); - context.dx = 0; - context.cx = 16*80; - context.al = 255; - fillspace(context); - loadseg(context); - allocateload(context); - context.data.word(438) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - closefile(context); - findroominloc(context); - deletetaken(context); - setallchanges(context); - autoappear(context); - context.al = context.data.byte(188); - getroomdata(context); - context.data.byte(65) = -1; - context.data.byte(56) = 0; - context.data.word(98) = 160; - context.data.byte(188) = 255; - context.data.byte(492) = 254; - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) goto dontwalkin; - context.data.byte(475) = context.al; - context.push(context.bx); - autosetwalk(context); - context.bx = context.pop(); -dontwalkin: - findxyfrompath(context); + removesetobject(context); + context.data.byte(188) = 20; + context.data.word(21) = 80; + context.data.byte(35) = 1; + context.data.byte(40) = 8; + context.data.byte(103) = 1; return; } -static inline void loadroom(Context & context) { - context.data.byte(74) = 1; - context.data.word(328) = 0; - context.data.word(138) = 0; - context.data.word(121) = 104; - context.data.word(123) = 38; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context.al = context.data.byte(188); - context.data.byte(9) = context.al; - getroomdata(context); - startloading(context); - loadroomssample(context); - switchryanon(context); - drawflags(context); - getdimension(context); +static void usekey(Context & context) { + context._cmp(context.data.byte(9), 5); + if (context.flags.z()) goto usekey1; + context._cmp(context.data.byte(9), 30); + if (context.flags.z()) goto usekey1; + context._cmp(context.data.byte(9), 21); + if (context.flags.z()) goto usekey2; + context.cx = 200; + context.al = 1; + showpuztext(context); + putbackobstuff(context); + return; +usekey1: + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto wrongroom1; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto wrongroom1; + context.cx = 300; + context.al = 0; + showpuztext(context); + context.data.byte(40) = 100; + context.data.byte(103) = 1; + return; +usekey2: + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto wrongroom1; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto wrongroom1; + context.cx = 300; + context.al = 3; + showpuztext(context); + context.data.byte(188) = 30; + context.al = 2; + fadescreendown(context); + showfirstuse(context); + putbackobstuff(context); + return; +wrongroom1: + context.cx = 200; + context.al = 2; + showpuztext(context); + putbackobstuff(context); return; } -static inline void clearsprites(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; +static void usestereo(Context & context) { + context._cmp(context.data.byte(9), 0); + if (context.flags.z()) goto stereook; + context.cx = 400; + context.al = 4; + showpuztext(context); + putbackobstuff(context); + return; +stereook: + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto stereonotok; + context._cmp(context.data.byte(149), 0); + if (context.flags.z()) goto stereook2; +stereonotok: + context.cx = 400; + context.al = 5; + showpuztext(context); + putbackobstuff(context); + return; +stereook2: + context.al = 'C'; + context.ah = 'D'; + context.cl = 'P'; + context.ch = 'L'; + findsetobject(context); + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto cdinside; + context.al = 6; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); + getanyad(context); context.al = 255; - context.cx = 32*16; - while(--context.cx) context._stosb(); + context.data.byte(context.bx+10) = context.al; + return; +cdinside: + getanyad(context); + context.al = context.data.byte(context.bx+10); + context._xor(context.al, 1); + context.data.byte(context.bx+10) = context.al; + context._cmp(context.al, 255); + if (context.flags.z()) goto stereoon; + context.al = 7; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); + return; +stereoon: + context.al = 8; + context.cx = 400; + showpuztext(context); + putbackobstuff(context); return; } -static inline void initman(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); - context.si = context.ax; - context.cx = 49464; - context.dx = context.data.word(414); - context.di = 0; - makesprite(context); - context.data.byte(context.bx+23) = 4; - context.data.byte(context.bx+22) = 0; - context.data.byte(context.bx+29) = 0; +static void usecooker(Context & context) { + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + checkinside(context); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto foodinside; + showfirstuse(context); + putbackobstuff(context); + return; +foodinside: + showseconduse(context); + putbackobstuff(context); return; } -static inline void entrytexts(Context & context) { - context._cmp(context.data.byte(9), 21); - if (!context.flags.z()) goto notloc15; - context.al = 28; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); - return; -notloc15: - context._cmp(context.data.byte(9), 30); - if (!context.flags.z()) goto notloc43; - context.al = 27; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); - return; -notloc43: - context._cmp(context.data.byte(9), 23); - if (!context.flags.z()) goto notloc23; - context.al = 29; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); - return; -notloc23: - context._cmp(context.data.byte(9), 31); - if (!context.flags.z()) goto notloc44; - context.al = 30; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); - return; -notloc44: - context._cmp(context.data.byte(9), 20); - if (!context.flags.z()) goto notsarters2; - context.al = 31; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); +static void useaxe(Context & context) { + context._cmp(context.data.byte(184), 22); + if (!context.flags.z()) goto notinpool; + context._cmp(context.data.byte(149), 10); + if (context.flags.z()) goto axeondoor; + showseconduse(context); + context._add(context.data.byte(2), 1); + context.data.byte(65) = 2; + context.data.byte(103) = 1; + removeobfrominv(context); return; -notsarters2: - context._cmp(context.data.byte(9), 24); - if (!context.flags.z()) goto notedenlob; - context.al = 32; - context.cx = 60; - context.dx = 3; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); +notinpool: + showfirstuse(context); return; -notedenlob: - context._cmp(context.data.byte(9), 34); - if (!context.flags.z()) goto noteden2; - context.al = 33; - context.cx = 60; - context.dx = 3; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); +/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ +axeondoor: + context.al = 15; + context.cx = 300; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; -noteden2: return; } -static inline void purgealocation(Context & context) { - context.push(context.ax); - context.es = context.data.word(398); - context.di = 0+2080+30000; - context.bx = context.pop(); - context.cx = 0; -purgeloc: - context._cmp(context.bl, context.data.byte(context.di+0)); - if (!context.flags.z()) goto dontpurge; - context._cmp(context.data.byte(context.di+2), 0); - if (!context.flags.z()) goto dontpurge; - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.push(context.cx); - deleteexobject(context); - context.cx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); -dontpurge: - context._add(context.di, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 114); - if (!context.flags.z()) goto purgeloc; +static void useelvdoor(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gotdoorwith; + withwhat(context); return; -} - -static inline void resetlocation(Context & context) { - context.push(context.ax); - context._cmp(context.al, 5); - if (!context.flags.z()) goto notdelhotel; - purgealocation(context); - context.al = 21; - purgealocation(context); - context.al = 22; - purgealocation(context); - context.al = 27; - purgealocation(context); - goto clearedlocations; -notdelhotel: - context._cmp(context.al, 8); - if (!context.flags.z()) goto notdeltvstud; - purgealocation(context); - context.al = 28; - purgealocation(context); - goto clearedlocations; -notdeltvstud: - context._cmp(context.al, 6); - if (!context.flags.z()) goto notdelsarters; - purgealocation(context); - context.al = 20; - purgealocation(context); - context.al = 25; - purgealocation(context); - goto clearedlocations; -notdelsarters: - context._cmp(context.al, 13); - if (!context.flags.z()) goto notdelboathouse; - purgealocation(context); - context.al = 29; - purgealocation(context); - goto clearedlocations; -notdelboathouse: -clearedlocations: - context.ax = context.pop(); - context.ah = 0; - context.bx = context.ax; - context.dx = context.ds; - context.es = context.dx; - context._add(context.bx, 7798); - context.data.byte(context.bx) = 0; +gotdoorwith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'A'; + context.ch = 'X'; + context.dl = 'E'; + context.dh = 'D'; + compare(context); + if (context.flags.z()) goto axeondoor; + context.al = 14; + context.cx = 300; + showpuztext(context); + putbackobstuff(context); + return; +axeondoor: + context.al = 15; + context.cx = 300; + showpuztext(context); + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void checkifpathison(Context & context) { - context.push(context.ax); - getroomspaths(context); - context.ax = context.pop(); +static void withwhat(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); + context.es = context.cs; + context.di = 5674; + copyname(context); + context.di = 100; + context.bx = 21; + context.dl = 200; + context.al = 63; + context.ah = 2; + printmessage2(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 21; + context.es = context.cs; + context.si = 5674; + context.dl = 220; + context.al = 0; context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx+6); - context._cmp(context.al, 255); + printdirect(context); + context.di = context.data.word(84); + context._add(context.di, 5); + context.bx = 21; + context.dl = 200; + context.al = 63; + context.ah = 3; + printmessage2(context); + fillryan(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(104) = 2; return; } -static inline void turnpathon(Context & context) { - context.push(context.ax); - context.push(context.ax); - context.cl = 255; - context.ch = context.data.byte(185); - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - getroomspaths(context); - context.ax = context.pop(); +static void selectob(Context & context) { + findinvpos(context); + context.ax = context.data.word(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto nopathon; - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 255; - context.data.byte(context.bx+6) = context.al; -nopathon: + if (!context.flags.z()) goto canselectob; + blank(context); + return; +canselectob: + context.data.byte(95) = context.al; + context.data.byte(96) = context.ah; + context._cmp(context.ax, context.data.word(94)); + if (!context.flags.z()) goto diffsub3; + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadyselob; + context.data.byte(100) = 221; +diffsub3: + context.data.word(94) = context.ax; + context.bx = context.ax; + context.al = 0; + commandwithob(context); +alreadyselob: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notselob; + context._and(context.ax, 1); + if (!context.flags.z()) goto doselob; +notselob: + return; +doselob: + delpointer(context); + context.data.byte(104) = 0; + useroutine(context); return; } -static inline void turnanypathon(Context & context) { - context.push(context.ax); - context.push(context.ax); - context.cl = 255; - context.ch = context.ah; - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - context.al = context.ah; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(450); - context.bx = 0; - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 255; - context.data.byte(context.bx+6) = context.al; +static void compare(Context & context) { + context._sub(context.dl, 'A'); + context._sub(context.dh, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.push(context.cx); + context.push(context.dx); + getanyaddir(context); + context.dx = context.pop(); + context.cx = context.pop(); + context._cmp(context.data.word(context.bx+12), context.cx); + if (!context.flags.z()) goto comparefin; + context._cmp(context.data.word(context.bx+14), context.dx); +comparefin: return; } -static inline void entryanims(Context & context) { - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.byte(9), 33); - if (!context.flags.z()) goto notinthebeach; - switchryanoff(context); - context.data.word(21) = 76*2; - context.data.word(23) = 0; - context.data.word(25) = 76; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - return; -notinthebeach: - context._cmp(context.data.byte(9), 44); - if (!context.flags.z()) goto notsparkys; - context.al = 8; - resetlocation(context); - context.data.word(21) = 50*2; - context.data.word(23) = 247; - context.data.word(25) = 297; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - switchryanoff(context); - return; -notsparkys: - context._cmp(context.data.byte(9), 22); - if (!context.flags.z()) goto notinthelift; - context.data.word(21) = 31*2; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - switchryanoff(context); - return; -notinthelift: - context._cmp(context.data.byte(9), 26); - if (!context.flags.z()) goto notunderchurch; - context.data.byte(292) = 2; - context.data.byte(295) = 1; - return; -notunderchurch: - context._cmp(context.data.byte(9), 45); - if (!context.flags.z()) goto notenterdream; - context.data.byte(54) = 0; - context.data.word(21) = 296; - context.data.word(23) = 45; - context.data.word(25) = 198; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - switchryanoff(context); +static void findsetobject(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(428); + context.bx = 0; + context.dl = 0; +findsetloop: + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofind; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofind; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofind; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofind; + context.al = context.dl; return; -notenterdream: - context._cmp(context.data.byte(184), 46); - if (!context.flags.z()) goto notcrystal; - context._cmp(context.data.byte(43), 1); - if (!context.flags.z()) goto notcrystal; - context.al = 0; - removefreeobject(context); +nofind: + context._add(context.bx, 64); + context._add(context.dl, 1); + context._cmp(context.dl, 128); + if (!context.flags.z()) goto findsetloop; + context.al = context.dl; return; -notcrystal: - context._cmp(context.data.byte(9), 9); - if (!context.flags.z()) goto nottopchurch; - context.al = 2; - checkifpathison(context); - if (context.flags.z()) goto nottopchurch; - context._cmp(context.data.byte(44), 0); - if (context.flags.z()) goto nottopchurch; - context.al = 3; - checkifpathison(context); - if (!context.flags.z()) goto makedoorsopen; - context.al = 2; - turnpathon(context); -makedoorsopen: - context.al = 4; - removesetobject(context); - context.al = 5; - placesetobject(context); +} + +static void findexobject(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.dl = 0; +findexloop: + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofindex; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofindex; + context.al = context.dl; return; -nottopchurch: - context._cmp(context.data.byte(9), 47); - if (!context.flags.z()) goto notdreamcentre; - context.al = 4; - placesetobject(context); - context.al = 5; - placesetobject(context); +nofindex: + context._add(context.bx, 16); + context._add(context.dl, 1); + context._cmp(context.dl, 114); + if (!context.flags.z()) goto findexloop; + context.al = context.dl; return; -notdreamcentre: - context._cmp(context.data.byte(9), 38); - if (!context.flags.z()) goto notcarpark; - context.data.word(21) = 57*2; - context.data.word(23) = 4; - context.data.word(25) = 57; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - switchryanoff(context); +} + +static void isryanholding(Context & context) { + context._sub(context.al, 'A'); + context._sub(context.ah, 'A'); + context._sub(context.cl, 'A'); + context._sub(context.ch, 'A'); + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.dl = 0; +searchinv: + context._cmp(context.data.byte(context.bx+2), 4); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.al, context.data.byte(context.bx+12)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.ah, context.data.byte(context.bx+13)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.cl, context.data.byte(context.bx+14)); + if (!context.flags.z()) goto nofindininv; + context._cmp(context.ch, context.data.byte(context.bx+15)); + if (!context.flags.z()) goto nofindininv; + context.al = context.dl; + context._cmp(context.al, 114); return; -notcarpark: - context._cmp(context.data.byte(9), 32); - if (!context.flags.z()) goto notalley; - context.data.word(21) = 66*2; - context.data.word(23) = 0; - context.data.word(25) = 66; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - switchryanoff(context); +nofindininv: + context._add(context.bx, 16); + context._add(context.dl, 1); + context._cmp(context.dl, 114); + if (!context.flags.z()) goto searchinv; + context.al = context.dl; + context._cmp(context.al, 114); return; -notalley: - context._cmp(context.data.byte(9), 24); - if (!context.flags.z()) goto notedensagain; - context.al = 2; - context.ah = context.data.byte(185); - context._sub(context.ah, 1); - turnanypathon(context); -notedensagain: +} + +static void checkinside(Context & context) { + context.es = context.data.word(398); + context.bx = 0+2080+30000; + context.cl = 0; +insideloop: + context._cmp(context.al, context.data.byte(context.bx+3)); + if (!context.flags.z()) goto notfoundinside; + context._cmp(context.ah, context.data.byte(context.bx+2)); + if (!context.flags.z()) goto notfoundinside; + return; +notfoundinside: + context._add(context.bx, 16); + context._add(context.cl, 1); + context._cmp(context.cl, 114); + if (!context.flags.z()) goto insideloop; return; } -static inline void deleteexframe(Context & context) { - context.di = 0; - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context.al = context.data.byte(context.di); +static void usetext(Context & context) { + context.push(context.es); + context.push(context.si); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); + context.si = context.pop(); + context.es = context.pop(); + context.di = 36; + context.bx = 104; + context.dl = 241; + context.al = 0; context.ah = 0; - context.cl = context.data.byte(context.di+1); - context.ch = 0; - context._mul(context.cx); - context.si = context.data.word(context.di+2); + printdirect(context); + worktoscreenm(context); + return; +} + +static void putbackobstuff(Context & context) { + createpanel(context); + showpanel(context); + showman(context); + obicons(context); + showexit(context); + obpicture(context); + describeob(context); + undertextline(context); + context.data.byte(100) = 255; + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + return; +} + +static void showpuztext(Context & context) { + context.push(context.cx); + findpuztext(context); + context.push(context.es); context.push(context.si); - context._add(context.si, 0+2080); - context.cx = 30000; - context._sub(context.cx, context.data.word(context.di+2)); - context.di = context.si; - context._add(context.si, context.ax); - context.push(context.ax); - context.ds = context.es; - while(--context.cx) context._movsb(); - context.bx = context.pop(); - context._sub(context.data.word(12), context.bx); + createpanel(context); + showpanel(context); + showman(context); + showexit(context); + obicons(context); context.si = context.pop(); - context.cx = 114*3; - context.di = 0; -shuffleadsdown: - context.ax = context.data.word(context.di+2); - context._cmp(context.ax, context.si); - if (context.flags.c()) goto beforethisone; - context._sub(context.ax, context.bx); -beforethisone: - context.data.word(context.di+2) = context.ax; - context._add(context.di, 6); - if (--context.cx) goto shuffleadsdown; + context.es = context.pop(); + context.di = 36; + context.bx = 104; + context.dl = 241; + context.ah = 0; + printdirect(context); + worktoscreenm(context); + context.cx = context.pop(); + hangonp(context); return; } -static inline void deleteextext(Context & context) { - context.di = 0+2080+30000+(16*114); +static void findpuztext(Context & context) { context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context.ax = context.data.word(context.di); context.si = context.ax; - context.di = context.ax; - context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); - context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.ax = 0; -findlenextext: - context.cl = context.data.byte(context.si); - context._add(context.ax, 1); - context._add(context.si, 1); - context._cmp(context.cl, 0); - if (!context.flags.z()) goto findlenextext; - context.cx = 18000; - context.bx = context.si; - context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.si, context.si); + context.es = context.data.word(454); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; + return; +} + +static void placesetobject(Context & context) { + context.push(context.es); context.push(context.bx); - context.push(context.ax); - context._sub(context.cx, context.bx); - while(--context.cx) context._movsb(); - context.bx = context.pop(); - context._sub(context.data.word(14), context.bx); - context.si = context.pop(); - context.cx = 114; - context.di = 0+2080+30000+(16*114); -shuffletextads: - context.ax = context.data.word(context.di); - context._cmp(context.ax, context.si); - if (context.flags.c()) goto beforethistext; - context._sub(context.ax, context.bx); -beforethistext: - context.data.word(context.di) = context.ax; - context._add(context.di, 2); - if (--context.cx) goto shuffletextads; + context.cl = 0; + context.ch = 0; + findormake(context); + getsetad(context); + context.data.byte(context.bx+58) = 0; + context.bx = context.pop(); + context.es = context.pop(); return; } -static inline void deleteexobject(Context & context) { - context.push(context.cx); - context.push(context.cx); - context.push(context.cx); - context.push(context.cx); - context.al = 255; - context.cx = 16; - while(--context.cx) context._stosb(); - context.ax = context.pop(); - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - deleteexframe(context); - context.ax = context.pop(); - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._add(context.al, 1); - deleteexframe(context); - context.ax = context.pop(); - deleteextext(context); +static void removesetobject(Context & context) { + context.push(context.es); + context.push(context.bx); + context.cl = 255; + context.ch = 0; + findormake(context); + getsetad(context); + context.data.byte(context.bx+58) = 255; context.bx = context.pop(); - context.bh = context.bl; - context.bl = 4; - context.di = 0+2080+30000; - context.cx = 0; -deleteconts: - context._cmp(context.data.word(context.di+2), context.bx); - if (!context.flags.z()) goto notinsideex; + context.es = context.pop(); + return; +} + +static void issetobonmap(Context & context) { + context.push(context.es); context.push(context.bx); - context.push(context.cx); - context.push(context.di); - deleteexobject(context); - context.di = context.pop(); - context.cx = context.pop(); + getsetad(context); + context.al = context.data.byte(context.bx+58); context.bx = context.pop(); -notinsideex: - context._add(context.di, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 114); - if (!context.flags.z()) goto deleteconts; + context.es = context.pop(); + context._cmp(context.al, 0); + return; +} + +static void placefreeobject(Context & context) { + context.push(context.es); + context.push(context.bx); + context.cl = 0; + context.ch = 1; + findormake(context); + getfreead(context); + context.data.byte(context.bx+2) = 0; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static void removefreeobject(Context & context) { + context.push(context.es); + context.push(context.bx); + getfreead(context); + context.data.byte(context.bx+2) = 255; + context.bx = context.pop(); + context.es = context.pop(); + return; +} + +static void findormake(Context & context) { + context.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); + context.push(context.ax); + context.es = context.data.word(412); + context.ah = context.data.byte(184); +changeloop: + context._cmp(context.data.byte(context.bx), 255); + if (context.flags.z()) goto haventfound; + context._cmp(context.ax, context.data.word(context.bx)); + if (!context.flags.z()) goto nofoundchange; + context._cmp(context.ch, context.data.byte(context.bx+3)); + if (context.flags.z()) goto foundchange; +nofoundchange: + context._add(context.bx, 4); + goto changeloop; +foundchange: + context.ax = context.pop(); + context.data.byte(context.bx+2) = context.cl; + return; +haventfound: + context.data.word(context.bx) = context.ax; + context.data.word(context.bx+2) = context.cx; + context.ax = context.pop(); return; } -static inline void purgeanitem(Context & context) { - context.es = context.data.word(398); - context.di = 0+2080+30000; - context.bl = context.data.byte(184); - context.cx = 0; -lookforpurge: - context.al = context.data.byte(context.di+2); - context._cmp(context.al, 0); - if (!context.flags.z()) goto cantpurge; - context._cmp(context.data.byte(context.di+12), 2); - if (context.flags.z()) goto iscup; - context._cmp(context.data.byte(context.di+12), 255); - if (!context.flags.z()) goto cantpurge; -iscup: - context._cmp(context.data.byte(context.di+11), context.bl); - if (context.flags.z()) goto cantpurge; - deleteexobject(context); - return; -cantpurge: - context._add(context.di, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 114); - if (!context.flags.z()) goto lookforpurge; - context.di = 0+2080+30000; - context.bl = context.data.byte(184); - context.cx = 0; -lookforpurge2: - context.al = context.data.byte(context.di+2); - context._cmp(context.al, 0); - if (!context.flags.z()) goto cantpurge2; - context._cmp(context.data.byte(context.di+12), 255); - if (!context.flags.z()) goto cantpurge2; - deleteexobject(context); - return; -cantpurge2: - context._add(context.di, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 114); - if (!context.flags.z()) goto lookforpurge2; +static void switchryanon(Context & context) { + context.data.byte(63) = 255; return; } -static inline void emergencypurge(Context & context) { -checkpurgeagain: - context.ax = context.data.word(12); - context._add(context.ax, 4000); - context._cmp(context.ax, 30000); - if (context.flags.c()) goto notnearframeend; - purgeanitem(context); - goto checkpurgeagain; -notnearframeend: - context.ax = context.data.word(14); - context._add(context.ax, 400); - context._cmp(context.ax, 18000); - if (context.flags.c()) goto notneartextend; - purgeanitem(context); - goto checkpurgeagain; -notneartextend: +static void switchryanoff(Context & context) { + context.data.byte(63) = 1; return; } -static inline void getexpos(Context & context) { - context.es = context.data.word(398); - context.al = 0; - context.di = 0+2080+30000; -tryanotherex: - context._cmp(context.data.byte(context.di+2), 255); - if (context.flags.z()) goto foundnewex; - context._add(context.di, 16); - context._add(context.al, 1); - context._cmp(context.al, 114); - if (!context.flags.z()) goto tryanotherex; -foundnewex: - context.data.byte(10) = context.al; +static void setallchanges(Context & context) { + context.es = context.data.word(412); + context.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); +setallloop: + context.ax = context.data.word(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto endsetloop; + context.cx = context.data.word(context.bx+2); + context._add(context.bx, 4); + context._cmp(context.ah, context.data.byte(184)); + if (!context.flags.z()) goto setallloop; + context.push(context.es); + context.push(context.bx); + dochange(context); + context.bx = context.pop(); + context.es = context.pop(); + goto setallloop; +endsetloop: return; } -static inline void transfermap(Context & context) { - context.di = context.data.word(12); - context.push(context.di); - context.al = context.data.byte(10); +static void dochange(Context & context) { + context._cmp(context.ch, 0); + if (context.flags.z()) goto object; + context._cmp(context.ch, 1); + if (context.flags.z()) goto freeobject; +path: + context.push(context.cx); context.ah = 0; - context.bx = context.ax; context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context.cx = 6; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context.push(context.ax); + context.al = context.ch; + context._sub(context.al, 100); + context.ah = 0; + context.cx = 144; context._mul(context.cx); - context.es = context.data.word(398); - context.bx = 0; + context.bx = context.pop(); context._add(context.bx, context.ax); - context._add(context.di, 0+2080); - context.push(context.bx); - context.al = context.data.byte(90); + context._add(context.bx, 0); + context.es = context.data.word(450); + context.cx = context.pop(); + context.data.byte(context.bx+6) = context.cl; +nopath: + return; +object: + context.push(context.cx); + getsetad(context); + context.cx = context.pop(); + context.data.byte(context.bx+58) = context.cl; + return; +freeobject: + context.push(context.cx); + getfreead(context); + context.cx = context.pop(); + context._cmp(context.data.byte(context.bx+2), 255); + if (!context.flags.z()) goto beenpickedup; + context.data.byte(context.bx+2) = context.cl; +beenpickedup: + return; +} + +static void autoappear(Context & context) { + context._cmp(context.data.byte(9), 32); + if (!context.flags.z()) goto notinalley; + context.al = 5; + resetlocation(context); + context.al = 10; + setlocation(context); + context.data.byte(183) = 10; + return; +notinalley: + context._cmp(context.data.byte(184), 24); + if (!context.flags.z()) goto notinedens; + context._cmp(context.data.byte(42), 1); + if (!context.flags.z()) goto edenspart2; + context._add(context.data.byte(42), 1); + context.al = 44; + placesetobject(context); + context.al = 18; + placesetobject(context); + context.al = 93; + placesetobject(context); + context.al = 92; + removesetobject(context); + context.al = 55; + removesetobject(context); + context.al = 75; + removesetobject(context); + context.al = 84; + removesetobject(context); + context.al = 85; + removesetobject(context); + return; +edenspart2: + context._cmp(context.data.byte(43), 1); + if (!context.flags.z()) goto notedens2; + context.al = 44; + removesetobject(context); + context.al = 93; + removesetobject(context); + context.al = 55; + placesetobject(context); + context._add(context.data.byte(43), 1); +notedens2: + return; +notinedens: + context._cmp(context.data.byte(184), 25); + if (!context.flags.z()) goto notonsartroof; + context.data.byte(34) = 3; + context.al = 6; + resetlocation(context); + context.al = 11; + setlocation(context); + context.data.byte(183) = 11; + return; +notonsartroof: + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notinlouiss; + context._cmp(context.data.byte(41), 0); + if (context.flags.z()) goto notinlouiss; + context.al = 23; + placesetobject(context); +notinlouiss: + return; +} + +static void getundertimed(Context & context) { + context.al = context.data.byte(335); + context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context.cx = 6; - context._mul(context.cx); - context.ds = context.data.word(446); - context.bx = 0; - context._add(context.bx, context.ax); - context.si = 0+2080; - context.al = context.data.byte(context.bx); + context.al = context.data.byte(336); context.ah = 0; - context.cl = context.data.byte(context.bx+1); - context.ch = 0; - context._add(context.si, context.data.word(context.bx+2)); - context.dx = context.data.word(context.bx+4); - context.bx = context.pop(); - context.data.byte(context.bx+0) = context.al; - context.data.byte(context.bx+1) = context.cl; - context.data.word(context.bx+4) = context.dx; - context._mul(context.cx); - context.cx = context.ax; - context.push(context.cx); - while(--context.cx) context._movsb(); - context.cx = context.pop(); - context.ax = context.pop(); - context.data.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context.di = context.ax; + context.ch = 30; + context.cl = 240; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static void putundertimed(Context & context) { + context.al = context.data.byte(335); + context._sub(context.al, 3); + context.ah = 0; + context.bx = context.ax; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.ch = 30; + context.cl = 240; + context.ds = context.data.word(412); + context.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(context); + return; +} + +static void dumptimedtext(Context & context) { + context._cmp(context.data.byte(337), 1); + if (!context.flags.z()) goto nodumptimed; + context.al = context.data.byte(335); + context._sub(context.al, 3); + context.ah = 0; + context.bx = context.ax; + context.al = context.data.byte(336); + context.ah = 0; + context.di = context.ax; + context.cl = 240; + context.ch = 30; + multidump(context); + context.data.byte(337) = 0; +nodumptimed: return; } -static inline void transferinv(Context & context) { - context.di = context.data.word(12); - context.push(context.di); - context.al = context.data.byte(10); - context.ah = 0; +static void setuptimeduse(Context & context) { + context._cmp(context.data.word(328), 0); + if (!context.flags.z()) goto cantsetup; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; + context._add(context.dx, context.cx); + context.data.word(328) = context.dx; + context.bl = context.al; + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(454); + context.cx = 66*2; + context.ax = context.data.word(context.bx); + context._add(context.ax, context.cx); context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context._add(context.ax, 1); - context.cx = 6; - context._mul(context.cx); - context.es = context.data.word(398); - context.bx = 0; - context._add(context.bx, context.ax); - context._add(context.di, 0+2080); - context.push(context.bx); - context.al = context.data.byte(90); - context.ah = 0; + context.data.word(332) = context.es; + context.data.word(334) = context.bx; +cantsetup: + return; +} + +static void setuptimedtemp(Context & context) { + context._cmp(context.data.word(328), 0); + if (!context.flags.z()) goto cantsetup2; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; + context._add(context.dx, context.cx); + context.data.word(328) = context.dx; + context.bl = context.al; + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.cx = 66*2; + context.ax = context.data.word(context.bx); + context._add(context.ax, context.cx); context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context._add(context.ax, 1); - context.cx = 6; - context._mul(context.cx); - context.ds = context.data.word(446); - context.bx = 0; - context._add(context.bx, context.ax); - context.si = 0+2080; - context.al = context.data.byte(context.bx); - context.ah = 0; - context.cl = context.data.byte(context.bx+1); - context.ch = 0; - context._add(context.si, context.data.word(context.bx+2)); - context.dx = context.data.word(context.bx+4); - context.bx = context.pop(); - context.data.byte(context.bx+0) = context.al; - context.data.byte(context.bx+1) = context.cl; - context.data.word(context.bx+4) = context.dx; - context._mul(context.cx); - context.cx = context.ax; - context.push(context.cx); - while(--context.cx) context._movsb(); - context.cx = context.pop(); - context.ax = context.pop(); - context.data.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context.data.word(332) = context.es; + context.data.word(334) = context.bx; +cantsetup2: return; } -static inline void transfertext(Context & context) { - context.es = context.data.word(398); - context.al = context.data.byte(10); +static void usetimedtext(Context & context) { + context._cmp(context.data.word(328), 0); + if (context.flags.z()) goto notext; + context._sub(context.data.word(328), 1); + context._cmp(context.data.word(328), 0); + if (context.flags.z()) goto deltimedtext; + context.ax = context.data.word(328); + context._cmp(context.ax, context.data.word(330)); + if (context.flags.z()) goto firsttimed; + if (!context.flags.c()) goto notext; + goto notfirsttimed; +firsttimed: + getundertimed(context); +notfirsttimed: + context.bl = context.data.byte(335); + context.bh = 0; + context.al = context.data.byte(336); context.ah = 0; - context._add(context.ax, context.ax); - context.bx = 0+2080+30000+(16*114); - context._add(context.bx, context.ax); - context.di = context.data.word(14); - context.data.word(context.bx) = context.di; - context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.al = context.data.byte(90); + context.di = context.ax; + context.es = context.data.word(332); + context.si = context.data.word(334); + context.dl = 237; context.ah = 0; - context._add(context.ax, context.ax); - context.ds = context.data.word(438); - context.bx = 0; - context._add(context.bx, context.ax); - context.si = 0+(82*2); - context.ax = context.data.word(context.bx); - context._add(context.si, context.ax); -moretext: - context._lodsb(); - context._stosb(); - context._add(context.data.word(14), 1); - context._cmp(context.al, 0); - if (!context.flags.z()) goto moretext; + printdirect(context); + context.data.byte(337) = 1; +notext: + return; +deltimedtext: + putundertimed(context); + context.data.byte(337) = 1; return; } -static inline void transfercontoex(Context & context) { - context.push(context.es); - context.push(context.bx); - context.push(context.dx); - context.push(context.es); - context.push(context.bx); - getexpos(context); - context.si = context.pop(); - context.ds = context.pop(); - context.push(context.di); - context.cx = 8; - while(--context.cx) context._movsw(); - context.di = context.pop(); - context.dx = context.pop(); - context.al = context.data.byte(184); - context.data.byte(context.di) = context.al; - context.data.byte(context.di+11) = context.al; - context.al = context.data.byte(90); - context.data.byte(context.di+1) = context.al; - context.data.byte(context.di+3) = context.dl; - context.data.byte(context.di+2) = 4; - transfermap(context); - transferinv(context); - transfertext(context); - context.si = context.pop(); - context.ds = context.pop(); - context.data.byte(context.si+2) = 255; +static void edenscdplayer(Context & context) { + showfirstuse(context); + context.data.word(21) = 18*2; + context.data.word(23) = 25; + context.data.word(25) = 42; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } -static inline void pickupconts(Context & context) { - context.al = context.data.byte(context.si+7); - context._cmp(context.al, 255); - if (context.flags.z()) goto notopenable; - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context.dl = context.data.byte(10); - context.es = context.data.word(426); - context.bx = 0; - context.cx = 0; -pickupcontloop: - context.push(context.cx); - context.push(context.es); - context.push(context.bx); - context.push(context.dx); - context.push(context.ax); - context._cmp(context.data.byte(context.bx+2), context.ah); - if (!context.flags.z()) goto notinsidethis; - context._cmp(context.data.byte(context.bx+3), context.al); - if (!context.flags.z()) goto notinsidethis; - context.data.byte(90) = context.cl; - transfercontoex(context); -notinsidethis: - context.ax = context.pop(); - context.dx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 80); - if (!context.flags.z()) goto pickupcontloop; -notopenable: +static void usewall(Context & context) { + showfirstuse(context); + context._cmp(context.data.byte(475), 3); + if (context.flags.z()) goto gobackover; + context.data.word(21) = 30*2; + context.data.word(23) = 2; + context.data.word(25) = 31; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = 3; + turnpathon(context); + context.al = 4; + turnpathon(context); + context.al = 0; + turnpathoff(context); + context.al = 1; + turnpathoff(context); + context.al = 2; + turnpathoff(context); + context.al = 5; + turnpathoff(context); + context.data.byte(475) = 3; + context.data.byte(477) = 3; + findxyfrompath(context); + context.data.byte(187) = 1; + switchryanoff(context); + return; +gobackover: + context.data.word(21) = 30*2; + context.data.word(23) = 34; + context.data.word(25) = 60; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = 3; + turnpathoff(context); + context.al = 4; + turnpathoff(context); + context.al = 0; + turnpathon(context); + context.al = 1; + turnpathon(context); + context.al = 2; + turnpathon(context); + context.al = 5; + turnpathon(context); + context.data.byte(475) = 5; + context.data.byte(477) = 5; + findxyfrompath(context); + context.data.byte(187) = 1; + switchryanoff(context); return; } -static inline void transfertoex(Context & context) { - emergencypurge(context); - getexpos(context); - context.al = context.data.byte(10); - context.push(context.ax); - context.push(context.di); - context.al = context.data.byte(89); - context.ah = 0; - context.bx = 16; - context._mul(context.bx); - context.ds = context.data.word(426); - context.si = context.ax; - context.cx = 8; - while(--context.cx) context._movsw(); - context.di = context.pop(); - context.al = context.data.byte(184); - context.data.byte(context.di) = context.al; - context.data.byte(context.di+11) = context.al; - context.al = context.data.byte(89); - context.data.byte(context.di+1) = context.al; - context.data.byte(context.di+2) = 4; - context.data.byte(context.di+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.di+4) = context.al; - context.al = context.data.byte(89); - context.data.byte(90) = context.al; - transfermap(context); - transferinv(context); - transfertext(context); - context.al = context.data.byte(89); - context.ah = 0; - context.bx = 16; - context._mul(context.bx); - context.ds = context.data.word(426); - context.si = context.ax; - context.data.byte(context.si+2) = 254; - pickupconts(context); - context.ax = context.pop(); +static void usechurchgate(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto gatewith; + withwhat(context); return; -} - -static inline void pickupob(Context & context) { - context.data.byte(107) = context.ah; - context.data.byte(102) = 2; - context.data.byte(89) = context.al; - context.data.byte(99) = context.al; - getanyad(context); - transfertoex(context); +gatewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'C'; + context.ch = 'U'; + context.dl = 'T'; + context.dh = 'T'; + compare(context); + if (context.flags.z()) goto cutgate; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +cutgate: + showfirstuse(context); + context.data.word(21) = 64*2; + context.data.word(23) = 4; + context.data.word(25) = 70; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.al = 3; + turnpathon(context); + context._cmp(context.data.byte(44), 0); + if (context.flags.z()) goto notopenchurch; + context.al = 2; + turnpathon(context); +notopenchurch: return; } -static inline void initialinv(Context & context) { - context._cmp(context.data.byte(184), 24); - if (context.flags.z()) goto isedens; +static void usegun(Context & context) { + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto istakengun; + showseconduse(context); + putbackobstuff(context); return; -isedens: - context.al = 11; - context.ah = 5; - pickupob(context); - context.al = 12; - context.ah = 6; - pickupob(context); +istakengun: + context._cmp(context.data.byte(184), 22); + if (!context.flags.z()) goto notinpoolroom; + context.cx = 300; + context.al = 34; + showpuztext(context); + context.data.byte(65) = 1; + context.data.byte(64) = 39; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notinpoolroom: + context._cmp(context.data.byte(184), 25); + if (!context.flags.z()) goto nothelicopter; + context.cx = 300; + context.al = 34; + showpuztext(context); + context.data.byte(65) = 1; + context.data.byte(64) = 19; + context.data.byte(103) = 1; + context.data.byte(66) = 2; + context.data.byte(67) = 38; + context.data.byte(43) = 1; + context._add(context.data.byte(2), 1); + return; +nothelicopter: + context._cmp(context.data.byte(184), 27); + if (!context.flags.z()) goto notinrockroom; + context.cx = 300; + context.al = 46; + showpuztext(context); + context.data.byte(234) = 2; + context.data.byte(41) = 1; + context.data.byte(65) = 1; + context.data.byte(34) = 1; + context.data.byte(103) = 1; + context.data.byte(67) = 32; + context.data.byte(66) = 0; + context._add(context.data.byte(2), 1); + return; +notinrockroom: + context._cmp(context.data.byte(184), 8); + if (!context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(149), 40); + if (!context.flags.z()) goto notbystudio; + context.al = 92; + issetobonmap(context); + if (context.flags.z()) goto notbystudio; + context._cmp(context.data.byte(475), 9); + if (context.flags.z()) goto notbystudio; + context.data.byte(478) = 9; + context.data.byte(477) = 9; + autosetwalk(context); + context.data.byte(65) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notbystudio: + context._cmp(context.data.byte(184), 6); + if (!context.flags.z()) goto notsarters; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto notsarters; + context._cmp(context.data.byte(149), 20); + if (!context.flags.z()) goto notsarters; + context.al = 5; + issetobonmap(context); + if (!context.flags.z()) goto notsarters; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + autosetwalk(context); + context.al = 5; + removesetobject(context); + context.al = 6; + placesetobject(context); + context.al = 1; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); + context.data.byte(35) = 1; + context.data.word(21) = 40*2; + context.data.word(23) = 4; + context.data.word(25) = 43; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +notsarters: + context._cmp(context.data.byte(184), 29); + if (!context.flags.z()) goto notaide; + context.data.byte(103) = 1; context.al = 13; - context.ah = 7; - pickupob(context); - context.al = 14; - context.ah = 8; - pickupob(context); - context.al = 18; - context.al = 18; - context.ah = 0; - pickupob(context); - context.al = 19; - context.ah = 1; - pickupob(context); - context.al = 20; - context.ah = 9; - pickupob(context); - context.al = 16; - context.ah = 2; - pickupob(context); - context.data.byte(32) = 1; - context.data.word(29) = 0; - context.data.word(31) = 6; + resetlocation(context); + context.al = 12; + setlocation(context); + context.data.byte(183) = 12; + context.data.byte(478) = 2; + context.data.byte(477) = 2; + autosetwalk(context); + context.data.word(21) = 164*2; + context.data.word(23) = 3; + context.data.word(25) = 164; context.data.byte(27) = 1; context.data.byte(26) = 1; - switchryanoff(context); + context.data.byte(44) = 1; + context.data.byte(66) = 3; + context.data.byte(67) = 33; + context._add(context.data.byte(2), 1); + return; +notaide: + context._cmp(context.data.byte(184), 23); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(148), 0); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(149), 50); + if (!context.flags.z()) goto notwithboss; + context._cmp(context.data.byte(475), 5); + if (context.flags.z()) goto pathokboss; + context.data.byte(478) = 5; + context.data.byte(477) = 5; + autosetwalk(context); +pathokboss: + context.data.byte(65) = 1; + context.data.byte(103) = 1; + return; +notwithboss: + context._cmp(context.data.byte(184), 8); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto nottvsoldier; + context._cmp(context.data.byte(475), 2); + if (context.flags.z()) goto pathoktv; + context.data.byte(478) = 2; + context.data.byte(477) = 2; + autosetwalk(context); +pathoktv: + context.data.byte(65) = 1; + context.data.byte(103) = 1; + return; +nottvsoldier: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void startup1(Context & context) { - clearpalette(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; - createpanel(context); - context.data.byte(62) = 1; - drawfloor(context); - showicon(context); - getunderzoom(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - atmospheres(context); - worktoscreen(context); - fadescreenup(context); +static void useshield(Context & context) { + context._cmp(context.data.byte(184), 20); + if (!context.flags.z()) goto notinsartroom; + context._cmp(context.data.byte(64), 0); + if (context.flags.z()) goto notinsartroom; + context.data.byte(65) = 3; + showseconduse(context); + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + removeobfrominv(context); + return; +notinsartroom: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void clearreels(Context & context) { - context.es = context.data.word(430); - deallocatemem(context); - context.es = context.data.word(432); - deallocatemem(context); - context.es = context.data.word(434); - deallocatemem(context); +static void usebuttona(Context & context) { + context.al = 95; + issetobonmap(context); + if (context.flags.z()) goto donethisbit; + showfirstuse(context); + context.al = 0; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); + context.al = 9; + removesetobject(context); + context.al = 95; + placesetobject(context); + context.data.word(21) = 15*2; + context.data.word(23) = 71; + context.data.word(25) = 85; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +donethisbit: + showseconduse(context); + putbackobstuff(context); return; } -static inline void clearrest(Context & context) { - context.es = context.data.word(418); - context.cx = 66*60/2; - context.ax = 0; - context.di = 0; - while(--context.cx) context._stosw(); - context.es = context.data.word(416); - deallocatemem(context); - context.es = context.data.word(444); - deallocatemem(context); - context.es = context.data.word(450); - deallocatemem(context); - context.es = context.data.word(448); - deallocatemem(context); - context.es = context.data.word(440); - deallocatemem(context); - context.es = context.data.word(442); - deallocatemem(context); - context.es = context.data.word(436); - deallocatemem(context); - context.es = context.data.word(446); - deallocatemem(context); - context.es = context.data.word(438); - deallocatemem(context); +static void useplate(Context & context) { + context._cmp(context.data.byte(95), 255); + if (!context.flags.z()) goto platewith; + withwhat(context); + return; +platewith: + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'S'; + context.ch = 'C'; + context.dl = 'R'; + context.dh = 'W'; + compare(context); + if (context.flags.z()) goto unscrewplate; + context.al = context.data.byte(95); + context.ah = context.data.byte(96); + context.cl = 'K'; + context.ch = 'N'; + context.dl = 'F'; + context.dh = 'E'; + compare(context); + if (context.flags.z()) goto triedknife; + context.cx = 300; + context.al = 14; + showpuztext(context); + putbackobstuff(context); + return; +unscrewplate: + context.al = 20; + playchannel1(context); + showfirstuse(context); + context.al = 28; + placesetobject(context); + context.al = 24; + placesetobject(context); + context.al = 25; + removesetobject(context); + context.al = 0; + placefreeobject(context); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + return; +triedknife: + context.cx = 300; + context.al = 54; + showpuztext(context); + putbackobstuff(context); return; } -static inline void clearbeforeload(Context & context) { - context._cmp(context.data.byte(74), 1); - if (!context.flags.z()) goto noclear; - clearreels(context); - clearrest(context); - context.data.byte(74) = 0; -noclear: +static void usewinch(Context & context) { + context.al = 40; + context.ah = 1; + checkinside(context); + context._cmp(context.cl, 114); + if (context.flags.z()) goto nowinch; + context.al = context.cl; + context.ah = 4; + context.cl = 'F'; + context.ch = 'U'; + context.dl = 'S'; + context.dh = 'E'; + compare(context); + if (!context.flags.z()) goto nowinch; + context.data.word(21) = 217*2; + context.data.word(23) = 0; + context.data.word(25) = 217; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(183) = 1; + context.data.byte(188) = 45; + context.data.byte(66) = 1; + context.data.byte(67) = 44; + context.data.byte(42) = 1; + context.data.byte(34) = 2; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); + return; +nowinch: + showfirstuse(context); + putbackobstuff(context); return; } -static inline void startup(Context & context) { - context.data.byte(142) = 0; - context.data.byte(105) = 0; +static void entercode(Context & context) { + context.data.word(284) = context.ax; + context.data.word(286) = context.cx; + getridofreels(context); + loadkeypad(context); createpanel(context); - context.data.byte(62) = 1; - drawfloor(context); showicon(context); - getunderzoom(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - atmospheres(context); - return; -} - -static inline void worktoscreenm(Context & context) { - animpointer(context); + showouterpad(context); + showkeypad(context); readmouse(context); showpointer(context); - vsync(context); worktoscreen(context); delpointer(context); + context.data.word(280) = 0; + context.data.byte(103) = 0; +keypadloop: + delpointer(context); + readmouse(context); + showkeypad(context); + showpointer(context); + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nopresses; + context._sub(context.data.byte(282), 1); + goto afterpress; +nopresses: + context.data.byte(278) = 255; + context.data.byte(281) = 255; + vsync(context); +afterpress: + dumppointer(context); + dumpkeypad(context); + dumptextline(context); + context.bx = 3393; + checkcoords(context); + context._cmp(context.data.byte(103), 1); + if (context.flags.z()) goto numberright; + context._cmp(context.data.byte(287), 1); + if (!context.flags.z()) goto notendkey; + context._cmp(context.data.byte(37), 0); + if (context.flags.z()) goto numberright; + goto keypadloop; +notendkey: + context._cmp(context.data.byte(282), 40); + if (!context.flags.z()) goto keypadloop; + addtopresslist(context); + context._cmp(context.data.byte(278), 11); + if (!context.flags.z()) goto keypadloop; + context.ax = context.data.word(284); + context.cx = context.data.word(286); + isitright(context); + if (!context.flags.z()) goto incorrect; + context.data.byte(37) = 0; + context.al = 11; + playchannel1(context); + context.data.byte(287) = 120; + context.data.word(280) = 0; + goto keypadloop; +incorrect: + context.al = 11; + playchannel1(context); + context.data.byte(287) = 120; + context.data.word(280) = 0; + goto keypadloop; +numberright: + context.data.byte(131) = 0; + getridoftemp(context); + restorereels(context); + redrawmainscrn(context); + worktoscreenm(context); return; } -static inline void readcitypic(Context & context) { - context.dx = 2013; - loadintotemp(context); - return; -} - -static inline void showcity(Context & context) { - clearwork(context); - context.ds = context.data.word(458); - context.di = 57; - context.bx = 32; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(458); - context.di = 120+57; - context.bx = 32; - context.al = 1; - context.ah = 0; - showframe(context); - return; -} - -static inline void loadintotemp2(Context & context) { - context.ds = context.cs; - standardload(context); - context.data.word(460) = context.ax; - return; -} - -static inline void loadintotemp3(Context & context) { - context.ds = context.cs; - standardload(context); - context.data.word(462) = context.ax; - return; -} - -static inline void readdesticon(Context & context) { - context.dx = 2026; +static void loadkeypad(Context & context) { + context.dx = 1961; loadintotemp(context); - context.dx = 2039; - loadintotemp2(context); - context.dx = 1974; - loadintotemp3(context); return; } -static inline void loadtraveltext(Context & context) { - context.dx = 2247; - standardload(context); - context.data.word(456) = context.ax; +static void quitkey(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyqk; + context.data.byte(100) = 222; + context.al = 4; + commandonly(context); +alreadyqk: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notqk; + context._and(context.ax, 1); + if (!context.flags.z()) goto doqk; +notqk: return; -} - -static inline void showarrows(Context & context) { - context.di = 116-12; - context.bx = 16; - context.ds = context.data.word(458); - context.al = 0; - context.ah = 0; - showframe(context); - context.di = 226+12; - context.bx = 16; - context.ds = context.data.word(458); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = 280; - context.bx = 14; - context.ds = context.data.word(458); - context.al = 2; - context.ah = 0; - showframe(context); +doqk: + context.data.byte(103) = 1; return; } -static inline void getdestinfo(Context & context) { - context.al = context.data.byte(183); - context.ah = 0; - context.push(context.ax); - context.dx = context.ds; - context.es = context.dx; - context.si = 7798; - context._add(context.si, context.ax); - context.cl = context.data.byte(context.si); - context.ax = context.pop(); - context.push(context.cx); +static void addtopresslist(Context & context) { + context._cmp(context.data.word(280), 5); + if (context.flags.z()) goto nomorekeys; + context.al = context.data.byte(278); + context._cmp(context.al, 10); + if (!context.flags.z()) goto not10; + context.al = 0; +not10: + context.bx = context.data.word(280); context.dx = context.ds; context.es = context.dx; - context.si = 7813; - context._add(context.si, context.ax); - context.ax = context.pop(); + context._add(context.bx, 8350); + context.data.byte(context.bx) = context.al; + context._add(context.data.word(280), 1); +nomorekeys: return; } -static inline void locationpic(Context & context) { - getdestinfo(context); - context.al = context.data.byte(context.si); - context.push(context.es); - context.push(context.si); - context.di = 0; - context._cmp(context.al, 6); - if (!context.flags.c()) goto secondlot; - context.ds = context.data.word(458); - context._add(context.al, 4); - goto gotgraphic; -secondlot: - context._sub(context.al, 6); - context.ds = context.data.word(460); -gotgraphic: - context._add(context.di, 104); - context.bx = 138+14; - context.ah = 0; - showframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.al = context.data.byte(183); - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto notinthisone; - context.al = 3; - context.di = 104; - context.bx = 140+14; - context.ds = context.data.word(458); - context.ah = 0; - showframe(context); -notinthisone: - context.bl = context.data.byte(183); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(456); - context.si = context.data.word(context.bx); - context._add(context.si, 66*2); - context.di = 50; - context.bx = 20; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); +static void buttonone(Context & context) { + context.cl = 1; + buttonpress(context); return; } -static inline void getridoftemp2(Context & context) { - context.es = context.data.word(460); - deallocatemem(context); +static void buttontwo(Context & context) { + context.cl = 2; + buttonpress(context); return; } -static inline void getridoftemp3(Context & context) { - context.es = context.data.word(462); - deallocatemem(context); +static void buttonthree(Context & context) { + context.cl = 3; + buttonpress(context); return; } -static inline void selectlocation(Context & context) { - context.data.byte(237) = 0; - clearbeforeload(context); - context.data.byte(103) = 0; - context.data.byte(231) = 22; - readcitypic(context); - showcity(context); - getridoftemp(context); - readdesticon(context); - loadtraveltext(context); - showpanel(context); - showman(context); - showarrows(context); - showexit(context); - locationpic(context); - undertextline(context); - context.data.byte(100) = 255; - readmouse(context); - context.data.byte(231) = 0; - showpointer(context); - worktoscreen(context); - context.al = 9; - context.ah = 255; - playchannel0(context); - context.data.byte(188) = 255; -select: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context._cmp(context.data.byte(103), 1); - if (context.flags.z()) goto quittravel; - context.bx = 2714; - checkcoords(context); - context._cmp(context.data.byte(188), 255); - if (context.flags.z()) goto select; - context.al = context.data.byte(188); - context._cmp(context.al, context.data.byte(9)); - if (context.flags.z()) goto quittravel; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - context.es = context.data.word(456); - deallocatemem(context); - return; -quittravel: - context.al = context.data.byte(184); - context.data.byte(188) = context.al; - context.data.byte(103) = 0; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - context.es = context.data.word(456); - deallocatemem(context); +static void buttonfour(Context & context) { + context.cl = 4; + buttonpress(context); return; } -static inline void newplace(Context & context) { - context._cmp(context.data.byte(60), 1); - if (context.flags.z()) goto istravel; - context._cmp(context.data.byte(189), -1); - if (!context.flags.z()) goto isautoloc; - return; -isautoloc: - context.al = context.data.byte(189); - context.data.byte(188) = context.al; - context.data.byte(189) = -1; - return; -istravel: - context.data.byte(60) = 0; - selectlocation(context); +static void buttonfive(Context & context) { + context.cl = 5; + buttonpress(context); return; } -static inline void checkcoords(Context & context) { -loop048: - context.ax = context.data.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nonefound; - context.push(context.bx); - context._cmp(context.data.word(198), context.ax); - if (context.flags.l()) goto over045; - context.ax = context.data.word(context.bx+2); - context._cmp(context.data.word(198), context.ax); - if (!context.flags.ge()) goto over045; - context.ax = context.data.word(context.bx+4); - context._cmp(context.data.word(200), context.ax); - if (context.flags.l()) goto over045; - context.ax = context.data.word(context.bx+6); - context._cmp(context.data.word(200), context.ax); - if (!context.flags.ge()) goto over045; - context.ax = context.data.word(context.bx+8); - __dispatch_call(context, context.ax); -finished: - context.ax = context.pop(); +static void buttonsix(Context & context) { + context.cl = 6; + buttonpress(context); return; -over045: - context.bx = context.pop(); - context._add(context.bx, 10); - goto loop048; -nonefound: +} + +static void buttonseven(Context & context) { + context.cl = 7; + buttonpress(context); return; } -static inline void finishedwalking(Context & context) { - context._cmp(context.data.byte(492), 254); - if (!context.flags.z()) goto iswalking; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); -iswalking: +static void buttoneight(Context & context) { + context.cl = 8; + buttonpress(context); return; } -static inline void showexit(Context & context) { - context.ds = context.data.word(408); - context.di = 274; - context.bx = 154; - context.al = 11; - context.ah = 0; - showframe(context); +static void buttonnine(Context & context) { + context.cl = 9; + buttonpress(context); + return; +} + +static void buttonnought(Context & context) { + context.cl = 10; + buttonpress(context); return; } -static inline void getanyad(Context & context) { - context._cmp(context.data.byte(102), 4); - if (context.flags.z()) goto isex; - context._cmp(context.data.byte(102), 2); - if (context.flags.z()) goto isfree; - context.al = context.data.byte(99); - getsetad(context); - context.ax = context.data.word(context.bx+4); +static void buttonenter(Context & context) { + context.cl = 11; + buttonpress(context); return; -isfree: - context.al = context.data.byte(99); - getfreead(context); - context.ax = context.data.word(context.bx+7); +} + +static void buttonpress(Context & context) { + context.ch = context.cl; + context._add(context.ch, 100); + context._cmp(context.data.byte(100), context.ch); + if (context.flags.z()) goto alreadyb; + context.data.byte(100) = context.ch; + context.al = context.cl; + context._add(context.al, 4); + context.push(context.cx); + commandonly(context); + context.cx = context.pop(); +alreadyb: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notb; + context._and(context.ax, 1); + if (!context.flags.z()) goto dob; +notb: return; -isex: - context.al = context.data.byte(99); - getexad(context); - context.ax = context.data.word(context.bx+7); +dob: + context.data.byte(278) = context.cl; + context._add(context.cl, 21); + context.data.byte(281) = context.cl; + context.data.byte(282) = 40; + context._cmp(context.cl, 32); + if (context.flags.z()) goto nonoise; + context.al = 10; + playchannel1(context); +nonoise: return; } -static inline void obicons(Context & context) { - context.al = context.data.byte(99); - getanyad(context); - context._cmp(context.al, 255); - if (context.flags.z()) goto cantopenit; - context.ds = context.data.word(410); - context.di = 210; - context.bx = 1; - context.al = 4; +static void showouterpad(Context & context) { + context.di = 36+112-3; + context.bx = 72-4; + context.ds = context.data.word(458); + context.al = 1; context.ah = 0; showframe(context); -cantopenit: - context.ds = context.data.word(410); - context.di = 260; - context.bx = 1; - context.al = 1; + context.di = 36+112+74; + context.bx = 72+76; + context.ds = context.data.word(458); + context.al = 37; context.ah = 0; showframe(context); return; } -static inline void obpicture(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); - context._cmp(context.ah, 1); - if (context.flags.z()) goto setframe; - context._cmp(context.ah, 4); - if (context.flags.z()) goto exframe; - context.ds = context.data.word(446); - context.di = 160; - context.bx = 68; - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._add(context.al, 1); - context.ah = 128; +static void showkeypad(Context & context) { + context.al = 22; + context.di = 36+112+9; + context.bx = 72+5; + singlekey(context); + context.al = 23; + context.di = 36+112+31; + context.bx = 72+5; + singlekey(context); + context.al = 24; + context.di = 36+112+53; + context.bx = 72+5; + singlekey(context); + context.al = 25; + context.di = 36+112+9; + context.bx = 72+23; + singlekey(context); + context.al = 26; + context.di = 36+112+31; + context.bx = 72+23; + singlekey(context); + context.al = 27; + context.di = 36+112+53; + context.bx = 72+23; + singlekey(context); + context.al = 28; + context.di = 36+112+9; + context.bx = 72+41; + singlekey(context); + context.al = 29; + context.di = 36+112+31; + context.bx = 72+41; + singlekey(context); + context.al = 30; + context.di = 36+112+53; + context.bx = 72+41; + singlekey(context); + context.al = 31; + context.di = 36+112+9; + context.bx = 72+59; + singlekey(context); + context.al = 32; + context.di = 36+112+31; + context.bx = 72+59; + singlekey(context); + context._cmp(context.data.byte(287), 0); + if (context.flags.z()) goto notenter; + context._sub(context.data.byte(287), 1); + context.al = 36; + context.bx = 72-1+63; + context._cmp(context.data.byte(37), 0); + if (!context.flags.z()) goto changelight; + context.al = 41; + context.bx = 72+4+63; +changelight: + context._cmp(context.data.byte(287), 60); + if (context.flags.c()) goto gotlight; + context._cmp(context.data.byte(287), 100); + if (!context.flags.c()) goto gotlight; + context._sub(context.al, 1); +gotlight: + context.ds = context.data.word(458); + context.ah = 0; + context.di = 36+112+60; showframe(context); +notenter: return; -setframe: - return; -exframe: - context.ds = context.data.word(398); - context.di = 160; - context.bx = 68; - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._add(context.al, 1); - context.ah = 128; +} + +static void singlekey(Context & context) { + context._cmp(context.data.byte(281), context.al); + if (!context.flags.z()) goto gotkey; + context._add(context.al, 11); + context._cmp(context.data.byte(282), 8); + if (!context.flags.c()) goto gotkey; + context._sub(context.al, 11); +gotkey: + context.ds = context.data.word(458); + context._sub(context.al, 20); + context.ah = 0; showframe(context); return; } -static inline void searchforsame(Context & context) { - context.si = context.cx; -searchagain: - context._add(context.si, 1); - context.al = context.data.byte(context.bx); -search: - context._cmp(context.data.byte(context.si), context.al); - if (context.flags.z()) goto gotstartletter; - context._add(context.cx, 1); - context._add(context.si, 1); - context._cmp(context.si, 8000); - if (context.flags.c()) goto search; - context.si = context.bx; - context.ax = context.pop(); +static void dumpkeypad(Context & context) { + context.di = 36+112-3; + context.bx = 72-4; + context.cl = 120; + context.ch = 90; + multidump(context); return; -gotstartletter: - context.push(context.bx); - context.push(context.si); -keepchecking: - context._add(context.si, 1); - context._add(context.bx, 1); - context.al = context.data.byte(context.bx); - context.ah = context.data.byte(context.si); - context._cmp(context.al, ':'); - if (context.flags.z()) goto foundmatch; - context._cmp(context.al, 0); - if (context.flags.z()) goto foundmatch; - context._cmp(context.al, context.ah); - if (context.flags.z()) goto keepchecking; - context.si = context.pop(); - context.bx = context.pop(); - goto searchagain; -foundmatch: - context.si = context.pop(); - context.bx = context.pop(); +} + +static void usemenu(Context & context) { + getridofreels(context); + loadmenu(context); + createpanel(context); + showpanel(context); + showicon(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + context.al = 4; + context.ah = 0; + context.di = 80+40-48; + context.bx = 60-4; + context.ds = context.data.word(460); + showframe(context); + getundermenu(context); + context.al = 5; + context.ah = 0; + context.di = 80+40+54; + context.bx = 60+72; + context.ds = context.data.word(460); + showframe(context); + worktoscreenm(context); + context.data.byte(103) = 0; +menuloop: + delpointer(context); + putundermenu(context); + showmenu(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumpmenu(context); + dumptextline(context); + context.bx = 3525; + checkcoords(context); + context._cmp(context.data.byte(103), 1); + if (!context.flags.z()) goto menuloop; + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + getridoftemp2(context); + restorereels(context); + worktoscreenm(context); + return; +menulist: return; } -static inline void getobtextstart(Context & context) { - context.es = context.data.word(438); - context.si = 0; - context.cx = 0+(82*2); - context._cmp(context.data.byte(102), 2); - if (context.flags.z()) goto describe; - context.es = context.data.word(440); - context.si = 0; - context.cx = 0+(130*2); - context._cmp(context.data.byte(102), 1); - if (context.flags.z()) goto describe; - context.es = context.data.word(398); - context.si = 0+2080+30000+(16*114); - context.cx = 0+2080+30000+(16*114)+((114+2)*2); -describe: - context.al = context.data.byte(99); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.ax = context.data.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context.bx = context.ax; -tryagain: - context.push(context.si); - findnextcolon(context); - context.al = context.data.byte(context.si); - context.cx = context.si; - context.si = context.pop(); - context._cmp(context.data.byte(102), 1); - if (!context.flags.z()) goto cantmakeoneup; - context._cmp(context.al, 0); - if (context.flags.z()) goto findsometext; - context._cmp(context.al, ':'); - if (context.flags.z()) goto findsometext; -cantmakeoneup: +static void dumpmenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + multidump(context); return; -findsometext: - searchforsame(context); - goto tryagain; +} + +static void getundermenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + context.ds = context.data.word(412); + context.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(context); return; } -static inline void getlocation(Context & context) { - context.ah = 0; - context.bx = context.ax; - context.dx = context.ds; - context.es = context.dx; - context._add(context.bx, 7798); - context.al = context.data.byte(context.bx); +static void putundermenu(Context & context) { + context.di = 80+40; + context.bx = 60; + context.cl = 48; + context.ch = 48; + context.ds = context.data.word(412); + context.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(context); return; } -static inline void setlocation(Context & context) { +static void showoutermenu(Context & context) { + context.al = 40; context.ah = 0; - context.bx = context.ax; - context.dx = context.ds; - context.es = context.dx; - context._add(context.bx, 7798); - context.data.byte(context.bx) = 1; + context.di = 80+40-34; + context.bx = 60-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 41; + context.ah = 0; + context.di = 80+40+64-34; + context.bx = 60-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 42; + context.ah = 0; + context.di = 80+40-26; + context.bx = 60+57-40; + context.ds = context.data.word(458); + showframe(context); + context.al = 43; + context.ah = 0; + context.di = 80+40+64-26; + context.bx = 60+57-40; + context.ds = context.data.word(458); + showframe(context); return; } -static inline void getridofreels(Context & context) { - context._cmp(context.data.byte(74), 0); - if (context.flags.z()) goto dontgetrid; - context.es = context.data.word(430); - deallocatemem(context); - context.es = context.data.word(432); - deallocatemem(context); - context.es = context.data.word(434); - deallocatemem(context); -dontgetrid: +static void showmenu(Context & context) { + context._add(context.data.byte(290), 1); + context._cmp(context.data.byte(290), 37*2); + if (!context.flags.z()) goto menuframeok; + context.data.byte(290) = 0; +menuframeok: + context.al = context.data.byte(290); + context._shr(context.al, 1); + context.ah = 0; + context.di = 80+40; + context.bx = 60; + context.ds = context.data.word(458); + showframe(context); return; } -static inline void loadkeypad(Context & context) { - context.dx = 1961; +static void loadmenu(Context & context) { + context.dx = 1845; loadintotemp(context); + context.dx = 2000; + loadintotemp2(context); return; } -static inline void hangonw(Context & context) { -hangloopw: - context.push(context.cx); +static void viewfolder(Context & context) { + context.data.byte(131) = 1; + getridofall(context); + loadfolder(context); + context.data.byte(288) = 0; + showfolder(context); + worktoscreenm(context); + context.data.byte(103) = 0; +folderloop: delpointer(context); readmouse(context); - animpointer(context); showpointer(context); vsync(context); dumppointer(context); - context.cx = context.pop(); - if (--context.cx) goto hangloopw; + dumptextline(context); + context.bx = 3547; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto folderloop; + context.data.byte(131) = 0; + getridoftemp(context); + getridoftemp2(context); + getridoftemp3(context); + getridoftempcharset(context); + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); return; } -static inline void getroomdata(Context & context) { - context.ah = 0; - context.cx = 32; - context._mul(context.cx); - context.bx = 5971; - context._add(context.bx, context.ax); +static void nextfolder(Context & context) { + context._cmp(context.data.byte(288), 12); + if (!context.flags.z()) goto cannextf; + blank(context); return; -} - -static inline void allocateload(Context & context) { - context.push(context.es); - context.push(context.di); - context.bx = context.data.word(context.di); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.di = context.pop(); - context.es = context.pop(); +cannextf: + context._cmp(context.data.byte(100), 201); + if (context.flags.z()) goto alreadynextf; + context.data.byte(100) = 201; + context.al = 16; + commandonly(context); +alreadynextf: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notnextf; + context._cmp(context.ax, 1); + if (context.flags.z()) goto donextf; +notnextf: + return; +donextf: + context._add(context.data.byte(288), 1); + folderhints(context); + delpointer(context); + showfolder(context); + context.data.word(202) = 0; + context.bx = 3547; + checkcoords(context); + worktoscreenm(context); return; } -static inline void restorereels(Context & context) { - context._cmp(context.data.byte(74), 0); - if (context.flags.z()) goto dontrestore; - context.al = context.data.byte(184); - getroomdata(context); - context.dx = context.bx; - openfile(context); - readheader(context); - dontloadseg(context); - dontloadseg(context); - dontloadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(430) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(432) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(434) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - closefile(context); -dontrestore: +static void folderhints(Context & context) { + context._cmp(context.data.byte(288), 5); + if (!context.flags.z()) goto notaideadd; + context._cmp(context.data.byte(44), 1); + if (context.flags.z()) goto notaideadd; + context.al = 13; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notaideadd; + context.al = 13; + setlocation(context); + showfolder(context); + context.al = 30; + findtext1(context); + context.di = 0; + context.bx = 86; + context.dl = 141; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); + return; +notaideadd: + context._cmp(context.data.byte(288), 9); + if (!context.flags.z()) goto notaristoadd; + context.al = 7; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notaristoadd; + context.al = 7; + setlocation(context); + showfolder(context); + context.al = 31; + findtext1(context); + context.di = 0; + context.bx = 86; + context.dl = 141; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); +notaristoadd: return; } -static inline void putbackobstuff(Context & context) { - createpanel(context); - showpanel(context); - showman(context); - obicons(context); - showexit(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(100) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); +static void lastfolder(Context & context) { + context._cmp(context.data.byte(288), 0); + if (!context.flags.z()) goto canlastf; + blank(context); + return; +canlastf: + context._cmp(context.data.byte(100), 202); + if (context.flags.z()) goto alreadylastf; + context.data.byte(100) = 202; + context.al = 17; + commandonly(context); +alreadylastf: + context._cmp(context.data.byte(288), 0); + if (context.flags.z()) goto notlastf; + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notlastf; + context._cmp(context.ax, 1); + if (context.flags.z()) goto dolastf; +notlastf: + return; +dolastf: + context._sub(context.data.byte(288), 1); delpointer(context); + showfolder(context); + context.data.word(202) = 0; + context.bx = 3547; + checkcoords(context); + worktoscreenm(context); return; } -static inline void lookatcard(Context & context) { - context.data.byte(131) = 1; - getridofreels(context); - loadkeypad(context); +static void loadfolder(Context & context) { + context.dx = 2312; + loadintotemp(context); + context.dx = 2325; + loadintotemp2(context); + context.dx = 2338; + loadintotemp3(context); + context.dx = 1896; + loadtempcharset(context); + context.dx = 2208; + loadtemptext(context); + return; +} + +static void showfolder(Context & context) { + context.data.byte(100) = 255; + context._cmp(context.data.byte(288), 0); + if (context.flags.z()) goto closedfolder; + usetempcharset(context); createpanel2(context); - context.di = 160; - context.bx = 80; context.ds = context.data.word(458); - context.al = 42; - context.ah = 128; - showframe(context); - getobtextstart(context); - findnextcolon(context); - findnextcolon(context); - findnextcolon(context); - context.di = 36; - context.bx = 124; - context.dl = 241; + context.di = 0; + context.bx = 0; context.al = 0; context.ah = 0; - printdirect(context); - context.push(context.es); - context.push(context.si); - worktoscreenm(context); - context.cx = 280; - hangonw(context); - createpanel2(context); - context.di = 160; - context.bx = 80; + showframe(context); context.ds = context.data.word(458); - context.al = 42; - context.ah = 128; + context.di = 143; + context.bx = 0; + context.al = 1; + context.ah = 0; showframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 130; - context.dl = 241; - context.al = 0; + context.ds = context.data.word(458); + context.di = 0; + context.bx = 92; + context.al = 2; context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonw(context); - context.data.byte(131) = 0; - getridoftemp(context); - restorereels(context); - putbackobstuff(context); - return; -} - -static inline void obsthatdothings(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); - context.cl = 'M'; - context.ch = 'E'; - context.dl = 'M'; - context.dh = 'B'; - compare(context); - if (!context.flags.z()) goto notlouiscard; - context.al = 4; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) goto seencard; - context.al = 4; - setlocation(context); - lookatcard(context); -seencard: + showframe(context); + context.ds = context.data.word(458); + context.di = 143; + context.bx = 92; + context.al = 3; + context.ah = 0; + showframe(context); + folderexit(context); + context._cmp(context.data.byte(288), 1); + if (context.flags.z()) goto noleftpage; + showleftpage(context); +noleftpage: + context._cmp(context.data.byte(288), 12); + if (context.flags.z()) goto norightpage; + showrightpage(context); +norightpage: + usecharset1(context); + undertextline(context); return; -notlouiscard: +closedfolder: + createpanel2(context); + context.ds = context.data.word(462); + context.di = 143-28; + context.bx = 0; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(462); + context.di = 143-28; + context.bx = 92; + context.al = 1; + context.ah = 0; + showframe(context); + folderexit(context); + undertextline(context); return; } -static inline void findpuztext(Context & context) { +static void folderexit(Context & context) { + context.ds = context.data.word(460); + context.di = 296; + context.bx = 178; + context.al = 6; context.ah = 0; - context.si = context.ax; - context._add(context.si, context.si); - context.es = context.data.word(454); - context.ax = context.data.word(context.si); - context._add(context.ax, 66*2); - context.si = context.ax; + showframe(context); return; } -static inline void additionaltext(Context & context) { - context._add(context.bx, 10); +static void showleftpage(Context & context) { + context.ds = context.data.word(460); + context.di = 0; + context.bx = 12; + context.al = 3; + context.ah = 0; + showframe(context); + context.bx = 12+5; + context.cx = 9; +leftpageloop: + context.push(context.cx); context.push(context.bx); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) goto emptycup; - context.al = context.data.byte(99); - context.ah = context.data.byte(102); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) goto fullcup; - context.bx = context.pop(); - return; -emptycup: - context.al = 40; - findpuztext(context); - context.bx = context.pop(); - context.di = 36; - context.dl = 241; + context.ds = context.data.word(460); + context.di = 0; + context.al = 4; context.ah = 0; - printdirect(context); - return; -fullcup: - context.al = 39; - findpuztext(context); + showframe(context); context.bx = context.pop(); - context.di = 36; - context.dl = 241; + context.cx = context.pop(); + context._add(context.bx, 16); + if (--context.cx) goto leftpageloop; + context.ds = context.data.word(460); + context.di = 0; + context.al = 5; context.ah = 0; + showframe(context); + context.data.word(77) = 8; + context.data.word(71) = 91; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); + context._sub(context.bl, 1); + context._sub(context.bl, 1); + context._add(context.bl, context.bl); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + context.di = 2; + context.bx = 48; + context.dl = 140; + context.cx = 2; +twolotsleft: + context.push(context.cx); +contleftpage: printdirect(context); + context._add(context.bx, context.data.word(77)); + context._cmp(context.al, 0); + if (!context.flags.z()) goto contleftpage; + context.cx = context.pop(); + if (--context.cx) goto twolotsleft; + context.data.byte(72) = 0; + context.data.word(71) = 0; + context.data.word(77) = 10; + context.es = context.data.word(400); + context.ds = context.data.word(400); + context.di = (48*320)+2; + context.si = (48*320)+2+130; + context.cx = 120; +flipfolder: + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.cx = 65; +flipfolderline: + context.al = context.data.byte(context.di); + context.ah = context.data.byte(context.si); + context.data.byte(context.di) = context.ah; + context.data.byte(context.si) = context.al; + context._sub(context.si, 1); + context._add(context.di, 1); + if (--context.cx) goto flipfolderline; + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.si, 320); + context._add(context.di, 320); + if (--context.cx) goto flipfolder; return; } -static inline void describeob(Context & context) { - getobtextstart(context); - context.di = 33; - context.bx = 92; - context._cmp(context.data.byte(102), 1); - if (!context.flags.z()) goto notsetd; - context.bx = 82; -notsetd: - context.dl = 241; - context.ah = 16; - context.data.word(71) = 91+91; - printdirect(context); - context.data.word(71) = 0; - context.di = 36; - context.bx = 104; - context._cmp(context.data.byte(102), 1); - if (!context.flags.z()) goto notsetd2; - context.bx = 94; -notsetd2: - context.dl = 241; +static void showrightpage(Context & context) { + context.ds = context.data.word(460); + context.di = 143; + context.bx = 12; + context.al = 0; context.ah = 0; - printdirect(context); + showframe(context); + context.bx = 12+37; + context.cx = 7; +rightpageloop: + context.push(context.cx); context.push(context.bx); - obsthatdothings(context); + context.ds = context.data.word(460); + context.di = 143; + context.al = 1; + context.ah = 0; + showframe(context); context.bx = context.pop(); - additionaltext(context); + context.cx = context.pop(); + context._add(context.bx, 16); + if (--context.cx) goto rightpageloop; + context.ds = context.data.word(460); + context.di = 143; + context.al = 2; + context.ah = 0; + showframe(context); + context.data.word(77) = 8; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); + context._sub(context.bl, 1); + context._add(context.bl, context.bl); + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(466); + context.si = context.data.word(context.bx); + context._add(context.si, 66*2); + context.di = 152; + context.bx = 48; + context.dl = 140; + context.cx = 2; +twolotsright: + context.push(context.cx); +contrightpage: + printdirect(context); + context._add(context.bx, context.data.word(77)); + context._cmp(context.al, 0); + if (!context.flags.z()) goto contrightpage; + context.cx = context.pop(); + if (--context.cx) goto twolotsright; + context.data.byte(72) = 0; + context.data.word(77) = 10; return; } -static inline void makemainscreen(Context & context) { - createpanel(context); - context.data.byte(62) = 1; - drawfloor(context); - spriteupdate(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); +static void entersymbol(Context & context) { + context.data.byte(131) = 1; + getridofreels(context); + context.dx = 2351; + loadintotemp(context); + context.data.byte(291) = 24; + context.data.byte(293) = 0; + context.data.byte(294) = 24; + context.data.byte(296) = 0; + redrawmainscrn(context); + showsymbol(context); undertextline(context); - context.data.byte(100) = 255; - animpointer(context); worktoscreenm(context); - context.data.byte(100) = 200; - context.data.byte(131) = 0; - return; -} - -static inline void examineob(Context & context) { - context.data.byte(234) = 0; - context.data.word(328) = 0; -examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; - context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(100) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); + context.data.byte(103) = 0; +symbolloop: delpointer(context); -waitexam: + updatesymboltop(context); + updatesymbolbot(context); + showsymbol(context); readmouse(context); showpointer(context); vsync(context); dumppointer(context); dumptextline(context); - delpointer(context); - context.data.byte(103) = 0; - context.bx = 2494; - context._cmp(context.data.byte(104), 0); - if (context.flags.z()) goto notuseinv; - context.bx = 2556; - context._cmp(context.data.byte(104), 1); - if (context.flags.z()) goto notuseinv; - context.bx = 2618; -notuseinv: + dumpsymbol(context); + context.bx = 3589; checkcoords(context); - context._cmp(context.data.byte(108), 0); - if (context.flags.z()) goto norex; - goto examineagain; -norex: context._cmp(context.data.byte(103), 0); - if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); - if (!context.flags.z()) goto justgetback; -iswatching: - makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; - return; -justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; + if (context.flags.z()) goto symbolloop; + context._cmp(context.data.byte(295), 3); + if (!context.flags.z()) goto symbolwrong; + context._cmp(context.data.byte(292), 5); + if (!context.flags.z()) goto symbolwrong; + context.al = 43; + removesetobject(context); + context.al = 46; + placesetobject(context); + context.ah = context.data.byte(185); + context._add(context.ah, 12); + context.al = 0; + turnanypathon(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + restorereels(context); + worktoscreenm(context); + context.al = 13; + playchannel1(context); return; -} - -static inline void facerightway(Context & context) { - context.push(context.es); - context.push(context.bx); - getroomspaths(context); - context.al = context.data.byte(475); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx+7); - context.data.byte(135) = context.al; - context.data.byte(134) = context.al; - context.bx = context.pop(); - context.es = context.pop(); +symbolwrong: + context.al = 46; + removesetobject(context); + context.al = 43; + placesetobject(context); + context.ah = context.data.byte(185); + context._add(context.ah, 12); + context.al = 0; + turnanypathoff(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + getridoftemp(context); + restorereels(context); + worktoscreenm(context); return; } -static inline void setwalk(Context & context) { - context._cmp(context.data.byte(492), 254); - if (!context.flags.z()) goto alreadywalking; - context.al = context.data.byte(474); - context._cmp(context.al, context.data.byte(475)); - if (context.flags.z()) goto cantwalk2; - context._cmp(context.data.byte(32), 1); - if (context.flags.z()) goto holdingreel; - context._cmp(context.data.byte(32), 2); - if (context.flags.z()) goto cantwalk; - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; - context._cmp(context.data.word(202), 2); - if (!context.flags.z()) goto notwalkandexam; - context._cmp(context.data.byte(100), 3); - if (context.flags.z()) goto notwalkandexam; - context.data.byte(306) = 1; - context.al = context.data.byte(100); - context.data.byte(307) = context.al; - context.al = context.data.byte(99); - context.data.byte(308) = context.al; -notwalkandexam: - autosetwalk(context); -cantwalk: - return; -cantwalk2: - facerightway(context); +static void quitsymbol(Context & context) { + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyqs; + context.data.byte(100) = 222; + context.al = 18; + commandonly(context); +alreadyqs: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notqs; + context._and(context.ax, 1); + if (!context.flags.z()) goto doqs; +notqs: return; -alreadywalking: - context.al = context.data.byte(474); - context.data.byte(477) = context.al; +doqs: + context.data.byte(103) = 1; return; -holdingreel: - context.data.byte(33) = context.al; - context.data.byte(32) = 2; +} + +static void settopleft(Context & context) { + context._cmp(context.data.byte(293), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 210); + if (context.flags.z()) goto alreadytopl; + context.data.byte(100) = 210; + context.al = 19; + commandonly(context); +alreadytopl: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notopleft; + context.data.byte(293) = -1; +notopleft: return; } -static inline void examineobtext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); - context.al = 1; - commandwithob(context); +static void settopright(Context & context) { + context._cmp(context.data.byte(293), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 211); + if (context.flags.z()) goto alreadytopr; + context.data.byte(100) = 211; + context.al = 20; + commandonly(context); +alreadytopr: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notopright; + context.data.byte(293) = 1; +notopright: return; } -static inline void blocknametext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); - context.al = 0; - commandwithob(context); +static void setbotleft(Context & context) { + context._cmp(context.data.byte(296), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 212); + if (context.flags.z()) goto alreadybotl; + context.data.byte(100) = 212; + context.al = 21; + commandonly(context); +alreadybotl: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto nobotleft; + context.data.byte(296) = -1; +nobotleft: return; } -static inline void personnametext(Context & context) { - context.bl = context.data.byte(99); - context._and(context.bl, 127); - context.bh = context.data.byte(100); - context.al = 2; - commandwithob(context); +static void setbotright(Context & context) { + context._cmp(context.data.byte(296), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 213); + if (context.flags.z()) goto alreadybotr; + context.data.byte(100) = 213; + context.al = 22; + commandonly(context); +alreadybotr: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto nobotright; + context.data.byte(296) = 1; +nobotright: return; } -static inline void deltextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); - context._sub(context.bx, 3); - context.ds = context.data.word(412); - context.si = 0; - context.cl = 228; - context.ch = 13; - multiput(context); +static void dumpsymbol(Context & context) { + context.data.byte(109) = 0; + context.di = 64; + context.bx = 56+20; + context.cl = 104; + context.ch = 60; + multidump(context); return; } -static inline void findobname(Context & context) { - context.push(context.ax); +static void showsymbol(Context & context) { + context.al = 12; context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; + context.di = 64; + context.bx = 56; + context.ds = context.data.word(458); + showframe(context); + context.al = context.data.byte(291); + context.ah = 0; + context.di = context.ax; + context._add(context.di, 64-44); + context.al = context.data.byte(292); + context.bx = 56+20; + context.ds = context.data.word(458); + context.ah = 32; + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); context.ax = context.pop(); - context._cmp(context.ah, 5); - if (!context.flags.z()) goto notpersonname; + nextsymbol(context); + context._add(context.di, 49); context.push(context.ax); - context._and(context.al, 127); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + showframe(context); + context.al = context.data.byte(294); context.ah = 0; - context.bx = 64*2; - context._mul(context.bx); - context.si = context.ax; - context.ds = context.data.word(448); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; + context.di = context.ax; + context._add(context.di, 64-44); + context.al = context.data.byte(295); + context._add(context.al, 6); + context.bx = 56+49; + context.ds = context.data.word(458); + context.ah = 32; + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); + context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + context.push(context.ax); + context.push(context.di); + context.push(context.bx); + context.push(context.ds); + showframe(context); + context.ds = context.pop(); + context.bx = context.pop(); + context.di = context.pop(); context.ax = context.pop(); + nextsymbol(context); + context._add(context.di, 49); + showframe(context); return; -notpersonname: - context._cmp(context.ah, 4); - if (!context.flags.z()) goto notextraname; - context.ds = context.data.word(398); - context._add(context.bx, 0+2080+30000+(16*114)); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); - context.si = context.ax; +} + +static void nextsymbol(Context & context) { + context._add(context.al, 1); + context._cmp(context.al, 6); + if (context.flags.z()) goto topwrap; + context._cmp(context.al, 12); + if (context.flags.z()) goto botwrap; return; -notextraname: - context._cmp(context.ah, 2); - if (!context.flags.z()) goto notfreename; - context.ds = context.data.word(438); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+(82*2)); - context.si = context.ax; +topwrap: + context.al = 0; + return; +botwrap: + context.al = 6; + return; +} + +static void updatesymboltop(Context & context) { + context._cmp(context.data.byte(293), 0); + if (context.flags.z()) goto topfinished; + context._cmp(context.data.byte(293), -1); + if (context.flags.z()) goto backwards; + context._add(context.data.byte(291), 1); + context._cmp(context.data.byte(291), 49); + if (!context.flags.z()) goto notwrapfor; + context.data.byte(291) = 0; + context._sub(context.data.byte(292), 1); + context._cmp(context.data.byte(292), -1); + if (!context.flags.z()) goto topfinished; + context.data.byte(292) = 5; + return; +notwrapfor: + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) goto topfinished; + context.data.byte(293) = 0; + return; +backwards: + context._sub(context.data.byte(291), 1); + context._cmp(context.data.byte(291), -1); + if (!context.flags.z()) goto notwrapback; + context.data.byte(291) = 48; + context._add(context.data.byte(292), 1); + context._cmp(context.data.byte(292), 6); + if (!context.flags.z()) goto topfinished; + context.data.byte(292) = 0; + return; +notwrapback: + context._cmp(context.data.byte(291), 24); + if (!context.flags.z()) goto topfinished; + context.data.byte(293) = 0; +topfinished: + return; +} + +static void updatesymbolbot(Context & context) { + context._cmp(context.data.byte(296), 0); + if (context.flags.z()) goto botfinished; + context._cmp(context.data.byte(296), -1); + if (context.flags.z()) goto backwardsbot; + context._add(context.data.byte(294), 1); + context._cmp(context.data.byte(294), 49); + if (!context.flags.z()) goto notwrapforb; + context.data.byte(294) = 0; + context._sub(context.data.byte(295), 1); + context._cmp(context.data.byte(295), -1); + if (!context.flags.z()) goto botfinished; + context.data.byte(295) = 5; + return; +notwrapforb: + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) goto botfinished; + context.data.byte(296) = 0; return; -notfreename: - context._cmp(context.ah, 1); - if (!context.flags.z()) goto notsetname; - context.ds = context.data.word(440); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+(130*2)); - context.si = context.ax; +backwardsbot: + context._sub(context.data.byte(294), 1); + context._cmp(context.data.byte(294), -1); + if (!context.flags.z()) goto notwrapbackb; + context.data.byte(294) = 48; + context._add(context.data.byte(295), 1); + context._cmp(context.data.byte(295), 6); + if (!context.flags.z()) goto botfinished; + context.data.byte(295) = 0; return; -notsetname: - context.ds = context.data.word(442); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+(98*2)); - context.si = context.ax; +notwrapbackb: + context._cmp(context.data.byte(294), 24); + if (!context.flags.z()) goto botfinished; + context.data.byte(296) = 0; +botfinished: return; } -static inline void copyname(Context & context) { - context.push(context.di); - findobname(context); - context.di = context.pop(); - context.es = context.cs; -copytext: - context.cx = 28; -make: - context._lodsb(); - context._cmp(context.al, ':'); - if (context.flags.z()) goto finishmakename; - context._cmp(context.al, 0); - if (context.flags.z()) goto finishmakename; - context._stosb(); - if (--context.cx) goto make; -finishmakename: - context._add(context.cx, 1); - context.al = 0; - context._stosb(); +static void dumpsymbox(Context & context) { + context._cmp(context.data.word(303), -1); + if (context.flags.z()) goto nodumpsym; + context.di = context.data.word(303); + context.bx = context.data.word(305); + context.cl = 30; + context.ch = 77; + multidump(context); + context.data.word(303) = -1; +nodumpsym: return; - context.al = 255; - while(--context.cx) context._stosb(); +} + +static void usediary(Context & context) { + getridofreels(context); + context.dx = 2052; + loadintotemp(context); + context.dx = 2221; + loadtemptext(context); + context.dx = 1896; + loadtempcharset(context); + createpanel(context); + showicon(context); + showdiary(context); + undertextline(context); + showdiarypage(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); + context.data.byte(103) = 0; +diaryloop: + delpointer(context); + readmouse(context); + showdiarykeys(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumpdiarykeys(context); + dumptextline(context); + context.bx = 3651; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto diaryloop; + getridoftemp(context); + getridoftemptext(context); + getridoftempcharset(context); + restorereels(context); + context.data.byte(131) = 0; + redrawmainscrn(context); + worktoscreenm(context); + return; +diarylist: return; } -static inline void commandwithob(Context & context) { - context.push(context.ax); - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.es); - context.push(context.ds); - context.push(context.si); - context.push(context.di); - deltextline(context); - context.di = context.pop(); - context.si = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.push(context.bx); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); - context._add(context.ax, 66*2); - context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); - context.al = 0; +static void showdiary(Context & context) { + context.al = 1; context.ah = 0; - printdirect(context); - context.ax = context.pop(); - context.di = 5674; - copyname(context); - context.ax = context.pop(); - context.di = context.data.word(84); - context._cmp(context.al, 0); - if (context.flags.z()) goto noadd; - context._add(context.di, 5); -noadd: - context.bx = context.data.word(81); - context.es = context.cs; - context.si = 5674; - context.dl = context.data.byte(82); - context.al = 0; + context.di = 68+24; + context.bx = 48+12+37; + context.ds = context.data.word(458); + showframe(context); + context.al = 2; context.ah = 0; - printdirect(context); - context.data.byte(109) = 1; + context.di = 68+24+176; + context.bx = 48+12+108; + context.ds = context.data.word(458); + showframe(context); return; } -static inline void walktotext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); +static void showdiarykeys(Context & context) { + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nokeyatall; + context._sub(context.data.byte(282), 1); + context._cmp(context.data.byte(282), 0); + if (context.flags.z()) goto nokeyatall; + context._cmp(context.data.byte(278), 'N'); + if (!context.flags.z()) goto nokeyn; context.al = 3; - commandwithob(context); - return; -} - -static inline void walkandexamine(Context & context) { - finishedwalking(context); - if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); - context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); - if (context.flags.z()) goto noobselect; - examineob(context); - return; -wantstowalk: - setwalk(context); - context.data.byte(473) = 1; -noobselect: - return; -diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; -diff2: - context._cmp(context.data.byte(492), 254); - if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); - if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); - if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); - if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); - context._add(context.cl, 12); - context.ch = context.data.byte(152); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) goto isblock; -dontcheck: - getflagunderp(context); - context._cmp(context.data.byte(153), 2); - if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); - if (!context.flags.c()) goto isblock; - goto toofaraway; -notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); - if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); - if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); - if (context.flags.z()) goto isaperson; - examineobtext(context); - return; -middleofwalk: - blocknametext(context); - return; -isblock: - blocknametext(context); + context._cmp(context.data.byte(282), 1); + if (context.flags.z()) goto gotkeyn; + context.al = 4; +gotkeyn: + context.ah = 0; + context.di = 68+24+94; + context.bx = 48+12+97; + context.ds = context.data.word(458); + showframe(context); + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notshown; + showdiarypage(context); +notshown: return; -isaperson: - personnametext(context); +nokeyn: + context.al = 5; + context._cmp(context.data.byte(282), 1); + if (context.flags.z()) goto gotkeyp; + context.al = 6; +gotkeyp: + context.ah = 0; + context.di = 68+24+151; + context.bx = 48+12+71; + context.ds = context.data.word(458); + showframe(context); + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notshowp; + showdiarypage(context); +notshowp: return; -toofaraway: - walktotext(context); +nokeyatall: return; } -static inline void mainscreen(Context & context) { - context.data.byte(237) = 0; - context.bx = 4949; - context._cmp(context.data.byte(3), 1); - if (context.flags.z()) goto checkmain; - context.bx = 5011; -checkmain: - checkcoords(context); - context._cmp(context.data.byte(306), 0); - if (context.flags.z()) goto finishmain; - walkandexamine(context); -finishmain: +static void dumpdiarykeys(Context & context) { + context._cmp(context.data.byte(282), 1); + if (!context.flags.z()) goto notdumpdiary; + context._cmp(context.data.byte(43), 1); + if (context.flags.z()) goto notsartadd; + context._cmp(context.data.byte(289), 5); + if (!context.flags.z()) goto notsartadd; + context._cmp(context.data.byte(289), 5); + if (!context.flags.z()) goto notsartadd; + context.al = 6; + getlocation(context); + context._cmp(context.al, 1); + if (context.flags.z()) goto notsartadd; + context.al = 6; + setlocation(context); + delpointer(context); + context.al = 12; + findtext1(context); + context.di = 70; + context.bx = 106; + context.dl = 241; + context.ah = 16; + printdirect(context); + worktoscreenm(context); + context.cx = 200; + hangonp(context); + createpanel(context); + showicon(context); + showdiary(context); + showdiarypage(context); + worktoscreenm(context); + showpointer(context); return; -} - -static inline void getflagunderp(Context & context) { - context.cx = context.data.word(198); - context._sub(context.cx, context.data.word(117)); - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); - context.ch = context.al; - checkone(context); - context.data.byte(153) = context.cl; - context.data.byte(154) = context.ch; +notsartadd: + context.di = 68+24+48; + context.bx = 48+12+15; + context.cl = 200; + context.ch = 16; + multidump(context); +notdumpdiary: + context.di = 68+24+94; + context.bx = 48+12+97; + context.cl = 16; + context.ch = 16; + multidump(context); + context.di = 68+24+151; + context.bx = 48+12+71; + context.cl = 16; + context.ch = 16; + multidump(context); return; } -static inline void animpointer(Context & context) { - context._cmp(context.data.byte(234), 2); - if (context.flags.z()) goto combathand; - context._cmp(context.data.byte(234), 3); - if (context.flags.z()) goto mousehand; - context._cmp(context.data.word(21), 0); - if (context.flags.z()) goto notwatchpoint; - context.data.byte(231) = 11; - return; -notwatchpoint: - context.data.byte(231) = 0; - context._cmp(context.data.byte(237), 0); - if (context.flags.z()) goto gothand; - context._cmp(context.data.byte(476), 0); - if (context.flags.z()) goto gothand; -arrow: - getflagunderp(context); - context._cmp(context.cl, 2); - if (context.flags.c()) goto gothand; - context._cmp(context.cl, 128); - if (!context.flags.c()) goto gothand; - context.data.byte(231) = 3; - context._test(context.cl, 4); - if (!context.flags.z()) goto gothand; - context.data.byte(231) = 4; - context._test(context.cl, 16); - if (!context.flags.z()) goto gothand; - context.data.byte(231) = 5; - context._test(context.cl, 2); - if (!context.flags.z()) goto gothand; - context.data.byte(231) = 6; - context._test(context.cl, 8); - if (!context.flags.z()) goto gothand; - context.data.byte(231) = 8; -gothand: - return; -mousehand: - context._cmp(context.data.byte(235), 0); - if (context.flags.z()) goto rightspeed3; - context._sub(context.data.byte(235), 1); - goto finflashmouse; -rightspeed3: - context.data.byte(235) = 5; - context._add(context.data.byte(236), 1); - context._cmp(context.data.byte(236), 16); - if (!context.flags.z()) goto finflashmouse; - context.data.byte(236) = 0; -finflashmouse: - context.al = context.data.byte(236); - context.ah = 0; - context.bx = 5698; - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.data.byte(231) = context.al; - return; -combathand: - context.data.byte(231) = 0; - context._cmp(context.data.byte(184), 14); - if (!context.flags.z()) goto notarrow; - context._cmp(context.data.byte(100), 211); - if (!context.flags.z()) goto notarrow; - context.data.byte(231) = 5; -notarrow: +static void diarykeyp(Context & context) { + context._cmp(context.data.byte(100), 214); + if (context.flags.z()) goto alreadykeyp; + context.data.byte(100) = 214; + context.al = 23; + commandonly(context); +alreadykeyp: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notkeyp; + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); + if (context.flags.z()) goto notkeyp; + context._cmp(context.data.byte(282), 0); + if (!context.flags.z()) goto notkeyp; + context.al = 16; + playchannel1(context); + context.data.byte(282) = 12; + context.data.byte(278) = 'P'; + context._sub(context.data.byte(289), 1); + context._cmp(context.data.byte(289), -1); + if (!context.flags.z()) goto notkeyp; + context.data.byte(289) = 11; +notkeyp: return; } -static inline void showblink(Context & context) { - context._cmp(context.data.byte(131), 1); - if (context.flags.z()) goto finblink1; - context._add(context.data.byte(472), 1); - context._cmp(context.data.byte(4), 0); - if (!context.flags.z()) goto finblink1; - context._cmp(context.data.byte(184), 50); - if (!context.flags.c()) goto eyesshut; - context.al = context.data.byte(472); - context._cmp(context.al, 3); - if (!context.flags.z()) goto finblink1; - context.data.byte(472) = 0; - context.al = context.data.byte(471); - context._add(context.al, 1); - context.data.byte(471) = context.al; - context._cmp(context.al, 6); - if (context.flags.c()) goto nomorethan6; - context.al = 6; -nomorethan6: - context.ah = 0; - context.bx = 5691; - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ds = context.data.word(408); - context.di = 44; - context.bx = 32; - context.ah = 0; - showframe(context); -finblink1: - return; -eyesshut: +static void diarykeyn(Context & context) { + context._cmp(context.data.byte(100), 213); + if (context.flags.z()) goto alreadykeyn; + context.data.byte(100) = 213; + context.al = 23; + commandonly(context); +alreadykeyn: + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto notkeyn; + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); + if (context.flags.z()) goto notkeyn; + context._cmp(context.data.byte(282), 0); + if (!context.flags.z()) goto notkeyn; + context.al = 16; + playchannel1(context); + context.data.byte(282) = 12; + context.data.byte(278) = 'N'; + context._add(context.data.byte(289), 1); + context._cmp(context.data.byte(289), 12); + if (!context.flags.z()) goto notkeyn; + context.data.byte(289) = 0; +notkeyn: return; } -static inline void showpointer(Context & context) { - showblink(context); - context.di = context.data.word(198); - context.data.word(220) = context.di; - context.bx = context.data.word(200); - context.data.word(222) = context.bx; - context._cmp(context.data.byte(106), 1); - if (context.flags.z()) goto itsanobject; - context.push(context.bx); - context.push(context.di); - context.ds = context.data.word(408); - context.al = context.data.byte(231); - context._add(context.al, 20); - context.ah = 0; - context._add(context.ax, context.ax); - context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.cx = context.data.word(context.si); - context._cmp(context.cl, 12); - if (!context.flags.c()) goto notsmallx; - context.cl = 12; -notsmallx: - context._cmp(context.ch, 12); - if (!context.flags.c()) goto notsmally; - context.ch = 12; -notsmally: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; - context.push(context.ds); - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60; - multiget(context); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.push(context.di); - context.push(context.bx); - context.al = context.data.byte(231); - context._add(context.al, 20); +static void showdiarypage(Context & context) { + context.al = 0; context.ah = 0; + context.di = 68+24; + context.bx = 48+12; + context.ds = context.data.word(458); showframe(context); - context.bx = context.pop(); - context.di = context.pop(); + context.al = context.data.byte(289); + findtext1(context); + context.data.byte(72) = 1; + usetempcharset(context); + context.di = 68+24+48; + context.bx = 48+12+16; + context.dl = 240; + context.ah = 16; + context.data.word(71) = 91+91; + printdirect(context); + context.di = 68+24+129; + context.bx = 48+12+16; + context.dl = 240; + context.ah = 16; + printdirect(context); + context.di = 68+24+48; + context.bx = 48+12+23; + context.dl = 240; + context.ah = 16; + printdirect(context); + context.data.byte(72) = 0; + context.data.word(71) = 0; + usecharset1(context); return; -itsanobject: - context.al = context.data.byte(89); - context.ds = context.data.word(398); - context._cmp(context.data.byte(102), 4); - if (context.flags.z()) goto itsfrominv; - context.ds = context.data.word(446); -itsfrominv: - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._add(context.al, 1); +} + +static void findtext1(Context & context) { context.ah = 0; - context.push(context.ax); - context._add(context.ax, context.ax); context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.ax = 2080; - context.cx = context.data.word(context.si); - context._cmp(context.cl, 12); - if (!context.flags.c()) goto notsmallx2; - context.cl = 12; -notsmallx2: - context._cmp(context.ch, 12); - if (!context.flags.c()) goto notsmally2; - context.ch = 12; -notsmally2: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; - context.ax = context.pop(); - context.push(context.di); - context.push(context.bx); - context.push(context.ax); - context.push(context.bx); - context.push(context.di); - context.push(context.ds); - context.al = context.cl; - context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.data.word(220), context.ax); - context._sub(context.di, context.ax); - context.al = context.ch; - context._shr(context.ax, 1); - context._sub(context.data.word(222), context.ax); - context._sub(context.bx, context.ax); - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60; - multiget(context); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.ah = 128; - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.ds = context.data.word(408); - context.al = 3; - context.ah = 128; - showframe(context); + context._add(context.si, context.si); + context.es = context.data.word(466); + context.ax = context.data.word(context.si); + context._add(context.ax, 66*2); + context.si = context.ax; return; } -static inline void readmouse1(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; - mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(204) = context.bx; +static void zoomonoff(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyonoff; + context.data.byte(100) = 222; + context.al = 39; + commandonly(context); +alreadyonoff: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nozoomonoff; + context._and(context.ax, 1); + if (!context.flags.z()) goto dozoomonoff; +nozoomonoff: + return; +dozoomonoff: + context.al = context.data.byte(8); + context._xor(context.al, 1); + context.data.byte(8) = context.al; + createpanel(context); + context.data.byte(62) = 0; + drawfloor(context); + printsprites(context); + reelsonscreen(context); + showicon(context); + getunderzoom(context); + undertextline(context); + context.al = 39; + commandonly(context); + readmouse(context); + worktoscreenm(context); return; } -static inline void dumpblink(Context & context) { - context._cmp(context.data.byte(4), 0); - if (!context.flags.z()) goto nodumpeye; - context._cmp(context.data.byte(472), 0); - if (!context.flags.z()) goto nodumpeye; - context.al = context.data.byte(471); - context._cmp(context.al, 6); - if (!context.flags.c()) goto nodumpeye; - context.push(context.ds); - context.di = 44; - context.bx = 32; - context.cl = 16; - context.ch = 12; - multidump(context); - context.ds = context.pop(); -nodumpeye: +static void saveload(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) { blank(context); return; }; + context._cmp(context.data.byte(100), 253); + if (context.flags.z()) goto alreadyops; + context.data.byte(100) = 253; + context.al = 43; + commandonly(context); +alreadyops: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noops; + context._and(context.ax, 1); + if (context.flags.z()) goto noops; + dosaveload(context); +noops: return; } -static inline void dumppointer(Context & context) { - dumpblink(context); - context.cl = context.data.byte(229); - context.ch = context.data.byte(230); - context.di = context.data.word(224); - context.bx = context.data.word(226); - multidump(context); - context.bx = context.data.word(222); - context.di = context.data.word(220); - context._cmp(context.di, context.data.word(224)); - if (!context.flags.z()) goto difffound; - context._cmp(context.bx, context.data.word(226)); - if (context.flags.z()) goto notboth; -difffound: - context.cl = context.data.byte(227); - context.ch = context.data.byte(228); - multidump(context); -notboth: +static void dosaveload(Context & context) { + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; + clearwork(context); + createpanel2(context); + undertextline(context); + getridofall(context); + loadsavebox(context); + showopbox(context); + showmainops(context); + worktoscreen(context); + goto donefirstops; +restartops: + showopbox(context); + showmainops(context); + worktoscreenm(context); +donefirstops: + context.data.byte(103) = 0; +waitops: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.bx = 3693; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto restartops; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto justret; + getridoftemp(context); + restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); + context.data.byte(100) = 200; +justret: + context.data.byte(131) = 0; return; } -static inline void dumptextline(Context & context) { - context._cmp(context.data.byte(109), 1); - if (!context.flags.z()) goto nodumptextline; - context.data.byte(109) = 0; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context._sub(context.bx, 3); - context.cl = 228; - context.ch = 13; - multidump(context); -nodumptextline: +static void getbackfromops(Context & context) { + context._cmp(context.data.byte(56), 2); + if (context.flags.z()) goto opsblock1; + getback1(context); + return; +opsblock1: + blank(context); + return; +} + +static void showmainops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+10; + context.bx = 52+10; + context.al = 8; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+59; + context.bx = 52+30; + context.al = 7; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); return; } -static inline void delpointer(Context & context) { - context.ax = context.data.word(220); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nevershown; - context.data.word(224) = context.ax; - context.ax = context.data.word(222); - context.data.word(226) = context.ax; - context.cl = context.data.byte(227); - context.data.byte(229) = context.cl; - context.ch = context.data.byte(228); - context.data.byte(230) = context.ch; - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60; - context.di = context.data.word(224); - context.bx = context.data.word(226); - multiput(context); -nevershown: +static void showdiscops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+10; + context.bx = 52+10; + context.al = 9; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+59; + context.bx = 52+30; + context.al = 10; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); return; } -static inline void findnextcolon(Context & context) { -isntcolon: - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context._cmp(context.al, 0); - if (context.flags.z()) goto endofcolon; - context._cmp(context.al, ':'); - if (!context.flags.z()) goto isntcolon; -endofcolon: +static void loadsavebox(Context & context) { + context.dx = 1974; + loadintotemp(context); return; } -static inline void printboth(Context & context) { - context.push(context.ax); - context.push(context.cx); - context.push(context.bx); - context.push(context.di); - printchar(context); - context.ax = context.pop(); - context.push(context.di); - context.di = context.ax; - multidump(context); - context.di = context.pop(); - context.bx = context.pop(); - context.cx = context.pop(); - context.ax = context.pop(); +static void loadgame(Context & context) { + context._cmp(context.data.byte(100), 246); + if (context.flags.z()) goto alreadyload; + context.data.byte(100) = 246; + context.al = 41; + commandonly(context); +alreadyload: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noload; + context._cmp(context.ax, 1); + if (context.flags.z()) goto doload; +noload: return; -} - -static inline void waitframes(Context & context) { - context.push(context.di); - context.push(context.bx); - context.push(context.es); - context.push(context.si); - context.push(context.ds); +doload: + context.data.byte(340) = 1; + showopbox(context); + showloadops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + context.data.byte(231) = 0; + worktoscreenm(context); + namestoold(context); + context.data.byte(103) = 0; +loadops: + delpointer(context); readmouse(context); showpointer(context); vsync(context); dumppointer(context); - delpointer(context); - context.ax = context.data.word(202); - context.ds = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); + dumptextline(context); + context.bx = 3735; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto loadops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto quitloaded; + getridoftemp(context); + context.dx = context.ds; + context.es = context.dx; + context.bx = 7782; + startloading(context); + loadroomssample(context); + context.data.byte(74) = 1; + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + initrain(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + startup(context); + worktoscreen(context); + context.data.byte(103) = 4; +quitloaded: return; } -static inline void printslow(Context & context) { - context.data.byte(231) = 1; - context.data.byte(234) = 3; - context.ds = context.data.word(404); -printloopslow6: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; -printloopslow5: - context.push(context.cx); - context.push(context.si); - context.push(context.es); - context.ax = context.data.word(context.si); - context.push(context.bx); - context.push(context.cx); - context.push(context.es); - context.push(context.si); - context.push(context.ds); - modifychar(context); - printboth(context); - context.ds = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.data.word(context.si+1); - context._add(context.si, 1); - context._cmp(context.al, 0); - if (context.flags.z()) goto finishslow; - context._cmp(context.al, ':'); - if (context.flags.z()) goto finishslow; - context._cmp(context.cl, 1); - if (context.flags.z()) goto afterslow; - context.push(context.di); - context.push(context.ds); - context.push(context.bx); - context.push(context.cx); - context.push(context.es); - context.push(context.si); - modifychar(context); - context.data.word(71) = 91; - printboth(context); - context.data.word(71) = 0; - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - waitframes(context); - context._cmp(context.ax, 0); - if (context.flags.z()) goto keepgoing; - context._cmp(context.ax, context.data.word(212)); - if (!context.flags.z()) goto finishslow2; -keepgoing: - waitframes(context); -noslow: - context._cmp(context.ax, 0); - if (context.flags.z()) goto afterslow; +static void getbacktoops(Context & context) { + context._cmp(context.data.byte(100), 201); + if (context.flags.z()) goto alreadygetops; + context.data.byte(100) = 201; + context.al = 42; + commandonly(context); +alreadygetops: + context.ax = context.data.word(202); context._cmp(context.ax, context.data.word(212)); - if (!context.flags.z()) goto finishslow2; -afterslow: - context.es = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 1); - if (--context.cx) goto printloopslow5; - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 10); - goto printloopslow6; -finishslow: - context.cx = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.al = 0; + if (context.flags.z()) goto nogetbackops; + context._and(context.ax, 1); + if (!context.flags.z()) goto dogetbackops; +nogetbackops: return; -finishslow2: - context.cx = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.al = 1; +dogetbackops: + oldtonames(context); + context.data.byte(103) = 2; return; } -static inline void hangonp(Context & context) { - context.push(context.cx); - context._add(context.cx, context.cx); - context.ax = context.pop(); - context._add(context.cx, context.ax); - context.data.word(138) = 0; - context.al = context.data.byte(231); - context.ah = context.data.byte(106); - context.push(context.ax); - context.data.byte(234) = 3; - context.data.byte(106) = 0; - context.push(context.cx); - context.data.byte(100) = 255; - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - context.cx = context.pop(); -hangloop: - context.push(context.cx); +static void discops(Context & context) { + context._cmp(context.data.byte(100), 249); + if (context.flags.z()) goto alreadydiscops; + context.data.byte(100) = 249; + context.al = 43; + commandonly(context); +alreadydiscops: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto nodiscops; + context._and(context.ax, 1); + if (!context.flags.z()) goto dodiscops; +nodiscops: + return; +dodiscops: + scanfornames(context); + context.data.byte(340) = 2; + showopbox(context); + showdiscops(context); + context.data.byte(341) = 0; + worktoscreenm(context); + context.data.byte(103) = 0; +discopsloop: delpointer(context); readmouse(context); - animpointer(context); showpointer(context); vsync(context); dumppointer(context); - context.cx = context.pop(); - context.ax = context.data.word(202); - context._cmp(context.ax, 0); - if (context.flags.z()) goto notpressed; - context._cmp(context.ax, context.data.word(212)); - if (!context.flags.z()) goto getoutofit; -notpressed: - if (--context.cx) goto hangloop; -getoutofit: - delpointer(context); - context.ax = context.pop(); - context.data.byte(231) = context.al; - context.data.byte(106) = context.ah; - context.data.byte(234) = 0; + dumptextline(context); + context.bx = 3777; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto discopsloop; return; } -static inline void readmouse(Context & context) { +static void savegame(Context & context) { + context._cmp(context.data.byte(56), 2); + if (!context.flags.z()) goto cansaveok; + blank(context); + return; +cansaveok: + context._cmp(context.data.byte(100), 247); + if (context.flags.z()) goto alreadysave; + context.data.byte(100) = 247; + context.al = 44; + commandonly(context); +alreadysave: context.ax = context.data.word(202); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; - mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(202) = context.bx; + context._and(context.ax, 1); + if (!context.flags.z()) goto dosave; return; -} - -static inline void redrawmainscrn(Context & context) { - context.data.word(328) = 0; - createpanel(context); - context.data.byte(62) = 0; - drawfloor(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); - undertextline(context); +dosave: + context.data.byte(340) = 2; + showopbox(context); + showsaveops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + worktoscreenm(context); + namestoold(context); + context.data.word(394) = 0; + context.data.word(396) = 0; + context.data.byte(103) = 0; +saveops: + delpointer(context); + checkinput(context); readmouse(context); - context.data.byte(100) = 255; + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3819; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto saveops; return; } -static inline void dolook(Context & context) { - createpanel(context); - showicon(context); - undertextline(context); - worktoscreenm(context); - context.data.byte(100) = 255; - dumptextline(context); - context.bl = context.data.byte(185); - context._and(context.bl, 31); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(436); - context._add(context.bx, 0); - context.si = context.data.word(context.bx); - context._add(context.si, 0+(38*2)); - findnextcolon(context); - context.di = 66; - context._cmp(context.data.byte(184), 50); - if (context.flags.c()) goto notdream3; - context.di = 40; -notdream3: - context.bx = 80; - context.dl = 241; - printslow(context); - context._cmp(context.al, 1); - if (context.flags.z()) goto afterlook; - context.cx = 400; - hangonp(context); -afterlook: - context.data.byte(234) = 0; - context.data.byte(100) = 0; +static void actualsave(Context & context) { + context._cmp(context.data.byte(100), 222); + if (context.flags.z()) goto alreadyactsave; + context.data.byte(100) = 222; + context.al = 44; + commandonly(context); +alreadyactsave: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noactsave; + context.dx = context.ds; + context.ds = context.dx; + context.si = 8367; + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; + context._mul(context.cx); + context._add(context.si, context.ax); + context._add(context.si, 1); + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto noactsave; + context.al = context.data.byte(9); + context.ah = 0; + context.cx = 32; + context._mul(context.cx); + context.ds = context.cs; + context.si = 5971; + context._add(context.si, context.ax); + context.di = 7782; + context.bx = context.di; + context.es = context.cs; + context.cx = 16; + while(--context.cx) context._movsw(); + context.al = context.data.byte(531); + context.data.byte(context.bx+13) = context.al; + context.al = context.data.byte(148); + context.data.byte(context.bx+15) = context.al; + context.al = context.data.byte(149); + context.data.byte(context.bx+16) = context.al; + context.al = context.data.byte(35); + context.data.byte(context.bx+20) = context.al; + context.al = context.data.byte(475); + context.data.byte(context.bx+21) = context.al; + context.al = context.data.byte(133); + context.data.byte(context.bx+22) = context.al; + context.al = 255; + context.data.byte(context.bx+27) = context.al; + saveposition(context); + getridoftemp(context); + restoreall(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; redrawmainscrn(context); worktoscreenm(context); + context.data.byte(103) = 4; +noactsave: return; } -static inline void autolook(Context & context) { - context.ax = context.data.word(198); - context._cmp(context.ax, context.data.word(214)); - if (!context.flags.z()) goto diffmouse; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(216)); - if (!context.flags.z()) goto diffmouse; - context._sub(context.data.word(98), 1); - context._cmp(context.data.word(98), 0); - if (!context.flags.z()) goto noautolook; - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto noautolook; - dolook(context); -noautolook: - return; -diffmouse: - context.data.word(98) = 1000; - return; -} - -static inline void watchcount(Context & context) { - context._cmp(context.data.byte(3), 0); - if (context.flags.z()) goto nowatchworn; - context._add(context.data.byte(146), 1); - context._cmp(context.data.byte(146), 9); - if (context.flags.z()) goto flashdots; - context._cmp(context.data.byte(146), 18); - if (context.flags.z()) goto uptime; -nowatchworn: - return; -flashdots: - context.ax = 91*3+21; - context.di = 268+4; - context.bx = 21; - context.ds = context.data.word(404); - showframe(context); - goto finishwatch; -uptime: - context.data.byte(146) = 0; - context._add(context.data.byte(5), 1); - context._cmp(context.data.byte(5), 60); - if (!context.flags.z()) goto finishtime; - context.data.byte(5) = 0; - context._add(context.data.byte(6), 1); - context._cmp(context.data.byte(6), 60); - if (!context.flags.z()) goto finishtime; - context.data.byte(6) = 0; - context._add(context.data.byte(7), 1); - context._cmp(context.data.byte(7), 24); - if (!context.flags.z()) goto finishtime; - context.data.byte(7) = 0; -finishtime: - showtime(context); -finishwatch: - context.data.byte(266) = 1; +static void actualload(Context & context) { + context._cmp(context.data.byte(100), 221); + if (context.flags.z()) goto alreadyactload; + context.data.byte(100) = 221; + context.al = 41; + commandonly(context); +alreadyactload: + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto notactload; + context._cmp(context.ax, 1); + if (!context.flags.z()) goto notactload; + context.dx = context.ds; + context.ds = context.dx; + context.si = 8367; + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; + context._mul(context.cx); + context._add(context.si, context.ax); + context._add(context.si, 1); + context._cmp(context.data.byte(context.si), 0); + if (context.flags.z()) goto notactload; + loadposition(context); + context.data.byte(103) = 1; +notactload: return; } -static inline void putunderzoom(Context & context) { - context.di = 8+5; - context.bx = 132+4; - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.cl = 46; - context.ch = 40; - multiput(context); +static void selectslot2(Context & context) { + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto noselslot2; + context.data.byte(340) = 2; +noselslot2: + selectslot(context); return; } -static inline void crosshair(Context & context) { - context._cmp(context.data.byte(100), 3); - if (context.flags.z()) goto nocross; - context._cmp(context.data.byte(100), 10); - if (!context.flags.c()) goto nocross; - context.es = context.data.word(400); - context.ds = context.data.word(408); - context.di = 8+24; - context.bx = 132+19; - context.al = 9; - context.ah = 0; - showframe(context); +static void checkinput(Context & context) { + context._cmp(context.data.byte(340), 3); + if (context.flags.z()) goto nokeypress; + readkey(context); + context.al = context.data.byte(142); + context._cmp(context.al, 0); + if (context.flags.z()) goto nokeypress; + context._cmp(context.al, 13); + if (!context.flags.z()) goto notret; + context.data.byte(340) = 3; + goto afterkey; +notret: + context._cmp(context.al, 8); + if (!context.flags.z()) goto nodel2; + context._cmp(context.data.byte(342), 0); + if (context.flags.z()) goto nokeypress; + getnamepos(context); + context._sub(context.data.byte(342), 1); + context.data.byte(context.bx) = 0; + context.data.byte(context.bx+1) = 1; + goto afterkey; +nodel2: +spacepress: + context._cmp(context.data.byte(342), 14); + if (context.flags.z()) goto nokeypress; + getnamepos(context); + context._add(context.data.byte(342), 1); + context.al = context.data.byte(142); + context.data.byte(context.bx+1) = context.al; + context.data.byte(context.bx+2) = 0; + context.data.byte(context.bx+3) = 1; + goto afterkey; +nokeypress: return; -nocross: - context.es = context.data.word(400); - context.ds = context.data.word(408); - context.di = 8+24; - context.bx = 132+19; - context.al = 29; - context.ah = 0; - showframe(context); +afterkey: + showopbox(context); + shownames(context); + showslots(context); + showsaveops(context); + worktoscreenm(context); return; } -static inline void zoom(Context & context) { - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto inwatching; - context._cmp(context.data.byte(8), 1); - if (context.flags.z()) goto zoomswitch; -inwatching: - return; -zoomswitch: - context._cmp(context.data.byte(100), 199); - if (context.flags.c()) goto zoomit; -cantzoom: - putunderzoom(context); - return; -zoomit: - context.ax = context.data.word(222); - context._sub(context.ax, 9); - context.cx = 320; - context._mul(context.cx); - context._add(context.ax, context.data.word(220)); - context._sub(context.ax, 11); - context.si = context.ax; - context.ax = 132+4; - context.cx = 320; +static void getnamepos(Context & context) { + context.al = context.data.byte(341); + context.ah = 0; + context.cx = 17; context._mul(context.cx); - context._add(context.ax, 8+5); - context.di = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(400); - context.cx = 20; -zoomloop: - context.push(context.cx); - context.cx = 23; -zoomloop2: - context._lodsb(); - context.ah = context.al; - context._stosw(); - context.data.word(context.di+320-2) = context.ax; - if (--context.cx) goto zoomloop2; - context._add(context.si, 320-23); - context._add(context.di, 320-46+320); - context.cx = context.pop(); - if (--context.cx) goto zoomloop; - crosshair(context); - context.data.byte(75) = 1; + context.dx = context.ds; + context.es = context.dx; + context.bx = 8367; + context._add(context.bx, context.ax); + context.al = context.data.byte(342); + context.ah = 0; + context._add(context.bx, context.ax); return; } -static inline void readmouse2(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; - mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(206) = context.bx; +static void showopbox(Context & context) { + context.ds = context.data.word(458); + context.di = 60; + context.bx = 52; + context.al = 0; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60; + context.bx = 52+55; + context.al = 4; + context.ah = 0; + showframe(context); return; } -static inline void dumpzoom(Context & context) { - context._cmp(context.data.byte(8), 1); - if (!context.flags.z()) goto notzoomon; - context.di = 8+5; - context.bx = 132+4; - context.cl = 46; - context.ch = 40; - multidump(context); -notzoomon: +static void showloadops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; + context.ah = 0; + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); + context.di = 60+104; + context.bx = 52+14; + context.al = 55; + context.dl = 101; + printmessage(context); return; } -static inline void findpathofpoint(Context & context) { - context.push(context.ax); - context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); +static void showsaveops(Context & context) { + context.ds = context.data.word(458); + context.di = 60+128+4; + context.bx = 52+12; + context.al = 1; context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.cx = context.pop(); - context.dl = 0; -pathloop: - context.al = context.data.byte(context.bx+6); - context._cmp(context.al, 255); - if (!context.flags.z()) goto flunkedit; - context.ax = context.data.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto flunkedit; - context._cmp(context.cl, context.al); - if (context.flags.c()) goto flunkedit; - context._cmp(context.ch, context.ah); - if (context.flags.c()) goto flunkedit; - context.ax = context.data.word(context.bx+4); - context._cmp(context.cl, context.al); - if (!context.flags.c()) goto flunkedit; - context._cmp(context.ch, context.ah); - if (!context.flags.c()) goto flunkedit; - goto gotvalidpath; -flunkedit: - context._add(context.bx, 8); - context._add(context.dl, 1); - context._cmp(context.dl, 12); - if (!context.flags.z()) goto pathloop; - context.dl = 255; -gotvalidpath: + showframe(context); + context.ds = context.data.word(458); + context.di = 60+176+2; + context.bx = 52+60-4; + context.al = 5; + context.ah = 0; + showframe(context); + context.di = 60+104; + context.bx = 52+14; + context.al = 54; + context.dl = 101; + printmessage(context); + return; +} + +static void selectslot(Context & context) { + context._cmp(context.data.byte(100), 244); + if (context.flags.z()) goto alreadysel; + context.data.byte(100) = 244; + context.al = 45; + commandonly(context); +alreadysel: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto noselslot; + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto noselslot; + context._cmp(context.data.byte(340), 3); + if (!context.flags.z()) goto notnocurs; + context._sub(context.data.byte(340), 1); +notnocurs: + oldtonames(context); + context.ax = context.data.word(200); + context._sub(context.ax, 52+4); + context.cl = -1; +getslotnum: + context._add(context.cl, 1); + context._sub(context.ax, 11); + if (!context.flags.c()) goto getslotnum; + context.data.byte(341) = context.cl; + delpointer(context); + showopbox(context); + showslots(context); + shownames(context); + context._cmp(context.data.byte(340), 1); + if (context.flags.z()) goto isloadmode; + showsaveops(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; -} - -static inline void findxyfrompath(Context & context) { - getroomspaths(context); - context.al = context.data.byte(475); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.ax = context.data.word(context.bx); - context._sub(context.al, 12); - context._sub(context.ah, 12); - context.data.byte(151) = context.al; - context.data.byte(152) = context.ah; +isloadmode: + showloadops(context); + readmouse(context); + showpointer(context); + worktoscreen(context); + delpointer(context); return; -} - -static inline void showpanel(Context & context) { - context.ds = context.data.word(408); - context.di = 72; - context.bx = 0; - context.al = 19; - context.ah = 0; - showframe(context); - context.ds = context.data.word(408); - context.di = 192; - context.bx = 0; - context.al = 19; - context.ah = 0; - showframe(context); +noselslot: return; } -static inline void showman(Context & context) { - context.ds = context.data.word(408); - context.di = 0; - context.bx = 0; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(408); - context.di = 0; - context.bx = 114; - context.al = 1; +static void showslots(Context & context) { + context.di = 60+7; + context.bx = 52+8; + context.al = 2; + context.ds = context.data.word(458); context.ah = 0; showframe(context); - context._cmp(context.data.byte(4), 0); - if (context.flags.z()) goto notverycool; - context.ds = context.data.word(408); - context.di = 28; - context.bx = 25; - context.al = 2; + context.di = 60+10; + context.bx = 52+11; + context.cl = 0; +slotloop: + context.push(context.cx); + context.push(context.di); + context.push(context.bx); + context._cmp(context.cl, context.data.byte(341)); + if (!context.flags.z()) goto nomatchslot; + context.al = 3; + context.ds = context.data.word(458); context.ah = 0; showframe(context); -notverycool: +nomatchslot: + context.bx = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 7); + if (!context.flags.z()) goto slotloop; return; } -static inline void printmessage(Context & context) { - context.push(context.dx); - context.push(context.bx); +static void shownames(Context & context) { + context.dx = context.ds; + context.es = context.dx; + context.si = 8367+1; + context.di = 60+21; + context.bx = 52+10; + context.cl = 0; +shownameloop: + context.push(context.cx); context.push(context.di); + context.push(context.es); + context.push(context.bx); + context.push(context.si); + context.al = 4; + context._cmp(context.cl, context.data.byte(341)); + if (!context.flags.z()) goto nomatchslot2; + context._cmp(context.data.byte(340), 2); + if (!context.flags.z()) goto loadmode; + context.dx = context.si; + context.cx = 15; + context._add(context.si, 15); +zerostill: + context._sub(context.si, 1); + context._sub(context.cl, 1); + context._cmp(context.data.byte(context.si), 1); + if (!context.flags.z()) goto foundcharacter; + goto zerostill; +foundcharacter: + context.data.byte(342) = context.cl; + context.data.byte(context.si) = '/'; + context.data.byte(context.si+1) = 0; + context.push(context.si); + context.si = context.dx; + context.dl = 200; context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); - context._add(context.ax, 66*2); - context.si = context.ax; - context.di = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); + printdirect(context); + context.si = context.pop(); + context.data.byte(context.si) = 0; + context.data.byte(context.si+1) = 1; + goto afterprintname; +loadmode: context.al = 0; + context.dl = 200; + context.ah = 0; + context.data.word(71) = 91; + printdirect(context); + context.data.word(71) = 0; + goto afterprintname; +nomatchslot2: + context.dl = 200; context.ah = 0; printdirect(context); +afterprintname: + context.si = context.pop(); + context.bx = context.pop(); + context.es = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context._add(context.si, 17); + context._add(context.bx, 10); + context._add(context.cl, 1); + context._cmp(context.cl, 7); + if (!context.flags.z()) goto shownameloop; return; } -static inline void usecharset1(Context & context) { - context.ax = context.data.word(404); - context.data.word(268) = context.ax; - return; -} - -static inline void roomname(Context & context) { - context.di = 88; - context.bx = 18; - context.al = 53; - context.dl = 240; - printmessage(context); - context.bl = context.data.byte(185); - context._cmp(context.bl, 32); - if (context.flags.c()) goto notover32; - context._sub(context.bl, 32); -notover32: - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(436); - context._add(context.bx, 0); - context.ax = context.data.word(context.bx); - context._add(context.ax, 0+(38*2)); - context.si = context.ax; - context.data.word(77) = 7; - context.di = 88; - context.bx = 25; - context.dl = 120; - context._cmp(context.data.byte(3), 1); - if (context.flags.z()) goto gotpl; - context.dl = 160; -gotpl: - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.word(77) = 10; - usecharset1(context); - return; +static void namestoold(Context & context) { + context.ds = context.cs; + context.si = 8367; + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.es = context.data.word(412); + context.cx = 17*4; + while(--context.cx) context._movsb(); + return; } -static inline void showtime(Context & context) { - context._cmp(context.data.byte(3), 0); - if (context.flags.z()) goto nowatch; - context.al = context.data.byte(5); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); - context.di = 282+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); - context.di = 282+9; - context.bx = 21; - showframe(context); - context.al = context.data.byte(6); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(404); - context.di = 270+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(404); - context.di = 270+11; - context.bx = 21; - showframe(context); - context.al = context.data.byte(7); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(404); - context.di = 256+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(404); - context.di = 256+11; - context.bx = 21; - showframe(context); - context.ax = 91*3+20; - context.ds = context.data.word(404); - context.di = 267+5; - context.bx = 21; - showframe(context); -nowatch: +static void oldtonames(Context & context) { + context.es = context.cs; + context.di = 8367; + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.ds = context.data.word(412); + context.cx = 17*4; + while(--context.cx) context._movsb(); + return; +} + +static void makeheader(Context & context) { + context.dx = context.ds; + context.es = context.dx; + context.di = 5952; + context.ax = 17; + storeit(context); + context.ax = 68-context.data.byte(1); + storeit(context); + context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; + storeit(context); + context.ax = 250*4; + storeit(context); + context.ax = 48; + storeit(context); + context.ax = 991-context.data.byte(537); + storeit(context); return; } -static inline void showwatch(Context & context) { - context._cmp(context.data.byte(3), 0); - if (context.flags.z()) goto nowristwatch; - context.ds = context.data.word(408); - context.di = 250; - context.bx = 1; - context.al = 6; - context.ah = 0; - showframe(context); - showtime(context); -nowristwatch: +static void storeit(Context & context) { + context._cmp(context.ax, 0); + if (!context.flags.z()) goto isntblank; + context._add(context.ax, 1); +isntblank: + context._stosw(); return; } -static inline void panelicons1(Context & context) { - context.di = 0; - context._cmp(context.data.byte(3), 1); - if (context.flags.z()) goto watchison; - context.di = 48; -watchison: - context.push(context.di); - context.ds = context.data.word(410); - context._add(context.di, 204); - context.bx = 4; - context.al = 2; - context.ah = 0; - showframe(context); - context.di = context.pop(); - context.push(context.di); - context._cmp(context.data.byte(8), 1); - if (context.flags.z()) goto zoomisoff; - context.ds = context.data.word(408); - context._add(context.di, 228); - context.bx = 8; - context.al = 5; - context.ah = 0; - showframe(context); -zoomisoff: - context.di = context.pop(); - showwatch(context); +static void findlen(Context & context) { + context._sub(context.bx, 1); + context._add(context.bx, context.ax); +nextone: + context._cmp(context.cl, context.data.byte(context.bx)); + if (!context.flags.z()) goto foundlen; + context._sub(context.bx, 1); + context._sub(context.ax, 1); + context._cmp(context.ax, 0); + if (!context.flags.z()) goto nextone; +foundlen: return; } -static inline void zoomicon(Context & context) { - context._cmp(context.data.byte(8), 0); - if (context.flags.z()) goto nozoom1; - context.ds = context.data.word(408); - context.di = 8; - context.bx = 132-1; - context.al = 8; - context.ah = 0; - showframe(context); -nozoom1: +static void decide(Context & context) { + setmode(context); + loadpalfromiff(context); + clearpalette(context); + context.data.byte(234) = 0; + context.data.word(21) = 0; + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; + loadsavebox(context); + showdecisions(context); + worktoscreen(context); + fadescreenup(context); + context.data.byte(103) = 0; +waitdecide: + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + context.bx = 4884; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto waitdecide; + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto hasloadedroom; + getridoftemp(context); +hasloadedroom: + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; return; } -static inline void middlepanel(Context & context) { - context.ds = context.data.word(464); - context.di = 72+47+20; - context.bx = 0; - context.al = 48; - context.ah = 0; - showframe(context); - context.ds = context.data.word(464); - context.di = 72+19; - context.bx = 21; - context.al = 47; +static void showdecisions(Context & context) { + createpanel2(context); + showopbox(context); + context.ds = context.data.word(458); + context.di = 60+17; + context.bx = 52+13; + context.al = 6; context.ah = 0; showframe(context); - context.ds = context.data.word(464); - context.di = 160+23; - context.bx = 0; - context.al = 48; - context.ah = 4; - showframe(context); - context.ds = context.data.word(464); - context.di = 160+71; - context.bx = 21; - context.al = 47; - context.ah = 4; - showframe(context); + undertextline(context); return; } -static inline void showicon(Context & context) { - context._cmp(context.data.byte(184), 50); - if (!context.flags.c()) goto isdream1; - showpanel(context); - showman(context); - roomname(context); - panelicons1(context); - zoomicon(context); - return; -isdream1: - context.ds = context.data.word(464); - context.di = 72; - context.bx = 2; - context.al = 45; - context.ah = 0; - showframe(context); - context.ds = context.data.word(464); - context.di = 72+47; - context.bx = 2; - context.al = 46; - context.ah = 0; - showframe(context); - context.ds = context.data.word(464); - context.di = 69-10; - context.bx = 21; - context.al = 49; - context.ah = 0; - showframe(context); - context.ds = context.data.word(464); - context.di = 160+88; - context.bx = 2; - context.al = 45; - context.ah = 4; - showframe(context); - context.ds = context.data.word(464); - context.di = 160+43; - context.bx = 2; - context.al = 46; - context.ah = 4; - showframe(context); - context.ds = context.data.word(464); - context.di = 160+101; - context.bx = 21; - context.al = 49; - context.ah = 4; - showframe(context); - middlepanel(context); +static void newgame(Context & context) { + context._cmp(context.data.byte(100), 251); + if (context.flags.z()) goto alreadynewgame; + context.data.byte(100) = 251; + context.al = 47; + commandonly(context); +alreadynewgame: + context.ax = context.data.word(202); + context._cmp(context.ax, 1); + if (!context.flags.z()) goto nonewgame; + context.data.byte(103) = 3; +nonewgame: return; } -static inline void getunderzoom(Context & context) { - context.di = 8+5; - context.bx = 132+4; - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.cl = 46; - context.ch = 40; - multiget(context); +static void doload(Context & context) { + context.data.byte(340) = 1; + showopbox(context); + showloadops(context); + context.data.byte(341) = 0; + showslots(context); + shownames(context); + context.data.byte(231) = 0; + worktoscreenm(context); + namestoold(context); + context.data.byte(103) = 0; +loadops: + delpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + dumppointer(context); + dumptextline(context); + context.bx = 3735; + checkcoords(context); + context._cmp(context.data.byte(103), 0); + if (context.flags.z()) goto loadops; + context._cmp(context.data.byte(103), 2); + if (context.flags.z()) goto quitloaded; + getridoftemp(context); + context.dx = context.ds; + context.es = context.dx; + context.bx = 7782; + startloading(context); + loadroomssample(context); + context.data.byte(74) = 1; + context.data.byte(188) = 255; + clearsprites(context); + initman(context); + initrain(context); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + startup(context); + worktoscreen(context); + context.data.byte(103) = 4; +quitloaded: return; } -static inline void walkintoroom(Context & context) { - context._cmp(context.data.byte(9), 14); - if (!context.flags.z()) goto notlair; - context._cmp(context.data.byte(148), 22); - if (!context.flags.z()) goto notlair; - context.data.byte(478) = 1; - context.data.byte(477) = 1; - autosetwalk(context); -notlair: +static void loadold(Context & context) { + context._cmp(context.data.byte(100), 252); + if (context.flags.z()) goto alreadyloadold; + context.data.byte(100) = 252; + context.al = 48; + commandonly(context); +alreadyloadold: + context.ax = context.data.word(202); + context._and(context.ax, 1); + if (context.flags.z()) goto noloadold; + doload(context); + context._cmp(context.data.byte(103), 4); + if (context.flags.z()) goto noloadold; + showdecisions(context); + worktoscreenm(context); + context.data.byte(103) = 0; +noloadold: return; } -static inline void isryanholding(Context & context) { - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(398); - context.bx = 0+2080+30000; - context.dl = 0; -searchinv: - context._cmp(context.data.byte(context.bx+2), 4); - if (!context.flags.z()) goto nofindininv; - context._cmp(context.al, context.data.byte(context.bx+12)); - if (!context.flags.z()) goto nofindininv; - context._cmp(context.ah, context.data.byte(context.bx+13)); - if (!context.flags.z()) goto nofindininv; - context._cmp(context.cl, context.data.byte(context.bx+14)); - if (!context.flags.z()) goto nofindininv; - context._cmp(context.ch, context.data.byte(context.bx+15)); - if (!context.flags.z()) goto nofindininv; - context.al = context.dl; - context._cmp(context.al, 114); - return; -nofindininv: - context._add(context.bx, 16); - context._add(context.dl, 1); - context._cmp(context.dl, 114); - if (!context.flags.z()) goto searchinv; - context.al = context.dl; - context._cmp(context.al, 114); +static void createname(Context & context) { + context.push(context.ax); + context.di = 4932; + context.data.byte(context.di+0) = context.dl; + context.data.byte(context.di+3) = context.cl; + context.al = context.dh; + context.ah = '0'-1; +findten: + context._add(context.ah, 1); + context._sub(context.al, 10); + if (!context.flags.c()) goto findten; + context.data.byte(context.di+1) = context.ah; + context._add(context.al, 10+'0'); + context.data.byte(context.di+2) = context.al; + context.ax = context.pop(); + context.cl = '0'-1; +thousandsc: + context._add(context.cl, 1); + context._sub(context.ax, 1000); + if (!context.flags.c()) goto thousandsc; + context._add(context.ax, 1000); + context.data.byte(context.di+4) = context.cl; + context.cl = '0'-1; +hundredsc: + context._add(context.cl, 1); + context._sub(context.ax, 100); + if (!context.flags.c()) goto hundredsc; + context._add(context.ax, 100); + context.data.byte(context.di+5) = context.cl; + context.cl = '0'-1; +tensc: + context._add(context.cl, 1); + context._sub(context.ax, 10); + if (!context.flags.c()) goto tensc; + context._add(context.ax, 10); + context.data.byte(context.di+6) = context.cl; + context._add(context.al, '0'); + context.data.byte(context.di+7) = context.al; return; } -static inline void findexobject(Context & context) { - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(398); - context.bx = 0+2080+30000; - context.dl = 0; -findexloop: - context._cmp(context.al, context.data.byte(context.bx+12)); - if (!context.flags.z()) goto nofindex; - context._cmp(context.ah, context.data.byte(context.bx+13)); - if (!context.flags.z()) goto nofindex; - context._cmp(context.cl, context.data.byte(context.bx+14)); - if (!context.flags.z()) goto nofindex; - context._cmp(context.ch, context.data.byte(context.bx+15)); - if (!context.flags.z()) goto nofindex; - context.al = context.dl; +static void trysoundalloc(Context & context) { + context._cmp(context.data.byte(358), 1); + if (context.flags.z()) goto gotsoundbuff; + context._add(context.data.byte(357), 1); + context.bx = (16384+2048)/16; + allocatemem(context); + context.data.word(353) = context.ax; + context.push(context.ax); + context.al = context.ah; + context.cl = 4; + context._shr(context.al, context.cl); + context.data.byte(356) = context.al; + context.ax = context.pop(); + context.cl = 4; + context._shl(context.ax, context.cl); + context.data.word(355) = context.ax; + context._cmp(context.ax, 0x0b7ff); + if (!context.flags.c()) goto soundfail; + context.es = context.data.word(353); + context.di = 0; + context.cx = 16384/2; + context.ax = 0x7f7f; + while(--context.cx) context._stosw(); + context.data.byte(358) = 1; return; -nofindex: - context._add(context.bx, 16); - context._add(context.dl, 1); - context._cmp(context.dl, 114); - if (!context.flags.z()) goto findexloop; - context.al = context.dl; +soundfail: + context.es = context.data.word(353); + deallocatemem(context); +gotsoundbuff: return; } -static inline void getexad(Context & context) { +static void playchannel0(Context & context) { + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto dontbother4; + context.push(context.es); + context.push(context.ds); + context.push(context.bx); + context.push(context.cx); + context.push(context.di); + context.push(context.si); + context.data.byte(507) = context.al; + context.es = context.data.word(420); + context._cmp(context.al, 12); + if (context.flags.c()) goto notsecondbank; + context.es = context.data.word(422); + context._sub(context.al, 12); +notsecondbank: + context.data.byte(508) = context.ah; context.ah = 0; - context.bx = 16; - context._mul(context.bx); + context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(398); - context._add(context.bx, 0+2080+30000); - return; -} - -static inline void getanyaddir(Context & context) { - context._cmp(context.ah, 4); - if (context.flags.z()) goto isex3; - context._cmp(context.ah, 2); - if (context.flags.z()) goto isfree3; - getsetad(context); - return; -isfree3: - getfreead(context); - return; -isex3: - getexad(context); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context.data.word(502) = context.ax; + context.ax = context.data.word(context.bx+1); + context.data.word(504) = context.ax; + context.ax = context.data.word(context.bx+3); + context.data.word(506) = context.ax; + context._cmp(context.data.byte(508), 0); + if (context.flags.z()) goto nosetloop; + context.ax = context.data.word(502); + context.data.word(510) = context.ax; + context.ax = context.data.word(504); + context.data.word(512) = context.ax; + context.ax = context.data.word(506); + context.data.word(514) = context.ax; +nosetloop: + context.si = context.pop(); + context.di = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); +dontbother4: return; } -static inline void compare(Context & context) { - context._sub(context.dl, 'A'); - context._sub(context.dh, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); +static void playchannel1(Context & context) { + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto dontbother5; + context._cmp(context.data.byte(515), 7); + if (context.flags.z()) goto dontbother5; + context.push(context.es); + context.push(context.ds); + context.push(context.bx); context.push(context.cx); - context.push(context.dx); - getanyaddir(context); - context.dx = context.pop(); + context.push(context.di); + context.push(context.si); + context.data.byte(515) = context.al; + context.es = context.data.word(420); + context._cmp(context.al, 12); + if (context.flags.c()) goto notsecondbank1; + context.es = context.data.word(422); + context._sub(context.al, 12); +notsecondbank1: + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context.data.word(517) = context.ax; + context.ax = context.data.word(context.bx+1); + context.data.word(519) = context.ax; + context.ax = context.data.word(context.bx+3); + context.data.word(521) = context.ax; + context.si = context.pop(); + context.di = context.pop(); context.cx = context.pop(); - context._cmp(context.data.word(context.bx+12), context.cx); - if (!context.flags.z()) goto comparefin; - context._cmp(context.data.word(context.bx+14), context.dx); -comparefin: + context.bx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); +dontbother5: return; } -static inline void setuptimeduse(Context & context) { - context._cmp(context.data.word(328), 0); - if (!context.flags.z()) goto cantsetup; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; - context._add(context.dx, context.cx); - context.data.word(328) = context.dx; - context.bl = context.al; - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(454); - context.cx = 66*2; - context.ax = context.data.word(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; -cantsetup: +static void makenextblock(Context & context) { + volumeadjust(context); + loopchannel0(context); + context._cmp(context.data.word(521), 0); + if (context.flags.z()) goto mightbeonlych0; + context._cmp(context.data.word(506), 0); + if (context.flags.z()) goto mightbeonlych1; + context._sub(context.data.word(506), 1); + context._sub(context.data.word(521), 1); + bothchannels(context); return; -} - -static inline void reminders(Context & context) { - context._cmp(context.data.byte(184), 24); - if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(148), 44); - if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(2), 0); - if (!context.flags.z()) goto notfirst; - context.al = 'D'; - context.ah = 'K'; - context.cl = 'E'; - context.ch = 'Y'; - isryanholding(context); - if (context.flags.z()) goto forgotone; - context.al = 'C'; - context.ah = 'S'; - context.cl = 'H'; - context.ch = 'R'; - findexobject(context); - context._cmp(context.al, 114); - if (context.flags.z()) goto forgotone; - context.ax = context.data.word(context.bx+2); - context._cmp(context.al, 4); - if (!context.flags.z()) goto forgotone; - context._cmp(context.ah, 255); - if (context.flags.z()) goto havegotcard; - context.cl = 'P'; - context.ch = 'U'; - context.dl = 'R'; - context.dh = 'S'; - context._xchg(context.al, context.ah); - compare(context); - if (!context.flags.z()) goto forgotone; -havegotcard: - context._add(context.data.byte(2), 1); -notfirst: +mightbeonlych1: + context.data.byte(507) = 255; + context._cmp(context.data.word(521), 0); + if (context.flags.z()) goto notch1only; + context._sub(context.data.word(521), 1); + channel1only(context); +notch1only: return; -forgotone: - context.al = 50; - context.bl = 54; - context.bh = 70; - context.cx = 48; - context.dx = 8; - setuptimeduse(context); +mightbeonlych0: + context.data.byte(515) = 255; + context._cmp(context.data.word(506), 0); + if (context.flags.z()) goto notch0only; + context._sub(context.data.word(506), 1); + channel0only(context); return; -notinedenslift: +notch0only: + context.es = context.data.word(353); + context.di = context.data.word(525); + context.cx = 1024; + context.ax = 0x7f7f; + while(--context.cx) context._stosw(); + context._and(context.di, 16384-1); + context.data.word(525) = context.di; return; } -static inline void afternewroom(Context & context) { - context._cmp(context.data.byte(186), 0); - if (context.flags.z()) goto notnew; - context.data.word(328) = 0; - createpanel(context); - context.data.byte(100) = 0; - findroominloc(context); - context._cmp(context.data.byte(63), 1); - if (context.flags.z()) goto ryansoff; - context.al = context.data.byte(151); - context._add(context.al, 12); - context.ah = context.data.byte(152); - context._add(context.ah, 12); - findpathofpoint(context); - context.data.byte(475) = context.dl; - findxyfrompath(context); - context.data.byte(187) = 1; -ryansoff: - context.data.byte(62) = 1; - drawfloor(context); - context.data.word(98) = 160; - context.data.byte(186) = 0; - showicon(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - mainscreen(context); - getunderzoom(context); - zoom(context); - worktoscreenm(context); - walkintoroom(context); - reminders(context); - atmospheres(context); -notnew: +static void volumeadjust(Context & context) { + context.al = context.data.byte(388); + context._cmp(context.al, 0); + if (context.flags.z()) goto volok; + context.al = context.data.byte(386); + context._cmp(context.al, context.data.byte(387)); + if (context.flags.z()) goto volfinish; + context._add(context.data.byte(389), 64); + if (!context.flags.z()) goto volok; + context.al = context.data.byte(386); + context._add(context.al, context.data.byte(388)); + context.data.byte(386) = context.al; return; -} - -static inline void readmouse3(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; - mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(208) = context.bx; +volfinish: + context.data.byte(388) = 0; +volok: return; } -static inline void readmouse4(Context & context) { - context.ax = context.data.word(202); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; - mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.ax = context.data.word(204); - context._or(context.ax, context.data.word(206)); - context._or(context.ax, context.data.word(208)); - context._or(context.bx, context.ax); - context.data.word(202) = context.bx; +static void loopchannel0(Context & context) { + context._cmp(context.data.word(506), 0); + if (!context.flags.z()) goto notloop; + context._cmp(context.data.byte(508), 0); + if (context.flags.z()) goto notloop; + context._cmp(context.data.byte(508), 255); + if (context.flags.z()) goto endlessloop; + context._sub(context.data.byte(508), 1); +endlessloop: + context.ax = context.data.word(510); + context.data.word(502) = context.ax; + context.ax = context.data.word(512); + context.data.word(504) = context.ax; + context.ax = context.data.word(506); + context._add(context.ax, context.data.word(514)); + context.data.word(506) = context.ax; + return; +notloop: return; } -static inline void dumpwatch(Context & context) { - context._cmp(context.data.byte(266), 1); - if (!context.flags.z()) goto nodumpwatch; - context.di = 256; - context.bx = 21; - context.cl = 40; - context.ch = 12; - multidump(context); - context.data.byte(266) = 0; -nodumpwatch: +static void cancelch0(Context & context) { + context.data.byte(508) = 0; + context.data.word(506) = 0; + context.data.byte(507) = 255; return; } -static inline void screenupdate(Context & context) { - newplace(context); - mainscreen(context); - animpointer(context); - showpointer(context); - context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto iswatchingmode; - context._cmp(context.data.byte(188), 255); - if (!context.flags.z()) goto finishearly; -iswatchingmode: - vsync(context); - readmouse1(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - autolook(context); - spriteupdate(context); - watchcount(context); - zoom(context); - showpointer(context); - context._cmp(context.data.byte(391), 0); - if (!context.flags.z()) goto finishearly; - vsync(context); - readmouse2(context); - dumppointer(context); - dumpzoom(context); - delpointer(context); - deleverything(context); - printsprites(context); - reelsonscreen(context); - afternewroom(context); - showpointer(context); - vsync(context); - readmouse3(context); - dumppointer(context); - dumpmap(context); - dumptimedtext(context); - delpointer(context); - showpointer(context); - vsync(context); - readmouse4(context); - dumppointer(context); - dumpwatch(context); - delpointer(context); -finishearly: +static void cancelch1(Context & context) { + context.data.word(521) = 0; + context.data.byte(515) = 255; return; } -static inline void greyscalesum(Context & context) { - context.es = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.cx = 256; -greysumloop1: - context.push(context.cx); - context.bx = 0; - context.al = context.data.byte(context.si); - context.ah = 0; - context.cx = 20; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.si+1); - context.ah = 0; - context.cx = 59; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.si+2); - context.ah = 0; - context.cx = 11; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = -1; -greysumloop2: - context._add(context.al, 1); - context._sub(context.bx, 100); - if (!context.flags.c()) goto greysumloop2; +static void channel0tran(Context & context) { + context._cmp(context.data.byte(386), 0); + if (!context.flags.z()) goto lowvolumetran; + context.cx = 1024; + while(--context.cx) context._movsw(); + return; +lowvolumetran: + context.cx = 1024; + context.bh = context.data.byte(386); + context.bl = 0; + context._add(context.bx, 16384-256); +volloop: + context._lodsw(); + context.bl = context.al; + context.al = context.data.byte(context.bx); + context.bl = context.ah; + context.ah = context.data.byte(context.bx); + context._stosw(); + if (--context.cx) goto volloop; + return; +} + +static void domix(Context & context) { + context._cmp(context.data.byte(386), 0); + if (!context.flags.z()) goto lowvolumemix; +slow: + context._lodsb(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, context.dh); + if (!context.flags.c()) goto toplot; +botlot: + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto nodistort; + context._add(context.al, context.ah); + if (context.flags.s()) goto botok; + context._xor(context.al, context.al); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +botok: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +toplot: + context._cmp(context.ah, context.dh); + if (context.flags.c()) goto nodistort; + context._add(context.al, context.ah); + if (!context.flags.s()) goto topok; + context.al = context.dl; + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +topok: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +nodistort: + context._add(context.al, context.ah); + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto slow; + goto doneit; +lowvolumemix: + context._lodsb(); + context.push(context.bx); + context.bh = context.data.byte(386); + context._add(context.bh, 63); context.bl = context.al; - context.al = context.bl; - context.ah = context.data.byte(348); - context._cmp(context.al, 0); + context.al = context.data.byte(context.bx); + context.bx = context.pop(); + context.ah = context.data.byte(context.bx); + context._add(context.bx, 1); + context._cmp(context.al, context.dh); + if (!context.flags.c()) goto toplotv; +botlotv: + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto nodistortv; context._add(context.al, context.ah); -noaddr: + if (context.flags.s()) goto botokv; + context._xor(context.al, context.al); context._stosb(); - context.ah = context.data.byte(347); - context.al = context.bl; - context._cmp(context.al, 0); - if (context.flags.z()) goto noaddg; + if (--context.cx) goto lowvolumemix; + goto doneit; +botokv: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +toplotv: + context._cmp(context.ah, context.dh); + if (context.flags.c()) goto nodistortv; context._add(context.al, context.ah); -noaddg: + if (!context.flags.s()) goto topokv; + context.al = context.dl; context._stosb(); - context.ah = context.data.byte(349); - context.al = context.bl; - context._cmp(context.al, 0); - if (context.flags.z()) goto noaddb; + if (--context.cx) goto lowvolumemix; + goto doneit; +topokv: + context._xor(context.al, context.dh); + context._stosb(); + if (--context.cx) goto lowvolumemix; + goto doneit; +nodistortv: context._add(context.al, context.ah); -noaddb: + context._xor(context.al, context.dh); context._stosb(); - context._add(context.si, 3); - context.cx = context.pop(); - if (--context.cx) goto greysumloop1; + if (--context.cx) goto lowvolumemix; +doneit: return; } -static inline void endpaltostart(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.cx = 768/2; - while(--context.cx) context._movsw(); - return; +static void entrytexts(Context & context) { + context._cmp(context.data.byte(9), 21); + if (!context.flags.z()) goto notloc15; + context.al = 28; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc15: + context._cmp(context.data.byte(9), 30); + if (!context.flags.z()) goto notloc43; + context.al = 27; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc43: + context._cmp(context.data.byte(9), 23); + if (!context.flags.z()) goto notloc23; + context.al = 29; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc23: + context._cmp(context.data.byte(9), 31); + if (!context.flags.z()) goto notloc44; + context.al = 30; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notloc44: + context._cmp(context.data.byte(9), 20); + if (!context.flags.z()) goto notsarters2; + context.al = 31; + context.cx = 60; + context.dx = 11; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notsarters2: + context._cmp(context.data.byte(9), 24); + if (!context.flags.z()) goto notedenlob; + context.al = 32; + context.cx = 60; + context.dx = 3; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +notedenlob: + context._cmp(context.data.byte(9), 34); + if (!context.flags.z()) goto noteden2; + context.al = 33; + context.cx = 60; + context.dx = 3; + context.bl = 68; + context.bh = 64; + setuptimeduse(context); + return; +noteden2: + return; } -static inline void createpanel(Context & context) { - context.di = 0; - context.bx = 8; - context.ds = context.data.word(410); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 8; - context.ds = context.data.word(410); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 0; - context.bx = 104; - context.ds = context.data.word(410); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 104; - context.ds = context.data.word(410); +static void entryanims(Context & context) { + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.byte(9), 33); + if (!context.flags.z()) goto notinthebeach; + switchryanoff(context); + context.data.word(21) = 76*2; + context.data.word(23) = 0; + context.data.word(25) = 76; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + return; +notinthebeach: + context._cmp(context.data.byte(9), 44); + if (!context.flags.z()) goto notsparkys; + context.al = 8; + resetlocation(context); + context.data.word(21) = 50*2; + context.data.word(23) = 247; + context.data.word(25) = 297; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notsparkys: + context._cmp(context.data.byte(9), 22); + if (!context.flags.z()) goto notinthelift; + context.data.word(21) = 31*2; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notinthelift: + context._cmp(context.data.byte(9), 26); + if (!context.flags.z()) goto notunderchurch; + context.data.byte(292) = 2; + context.data.byte(295) = 1; + return; +notunderchurch: + context._cmp(context.data.byte(9), 45); + if (!context.flags.z()) goto notenterdream; + context.data.byte(54) = 0; + context.data.word(21) = 296; + context.data.word(23) = 45; + context.data.word(25) = 198; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); + return; +notenterdream: + context._cmp(context.data.byte(184), 46); + if (!context.flags.z()) goto notcrystal; + context._cmp(context.data.byte(43), 1); + if (!context.flags.z()) goto notcrystal; context.al = 0; - context.ah = 2; - showframe(context); + removefreeobject(context); return; -} - -static inline void createpanel2(Context & context) { - createpanel(context); - context.di = 0; - context.bx = 0; - context.ds = context.data.word(410); - context.al = 5; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 0; - context.ds = context.data.word(410); +notcrystal: + context._cmp(context.data.byte(9), 9); + if (!context.flags.z()) goto nottopchurch; + context.al = 2; + checkifpathison(context); + if (context.flags.z()) goto nottopchurch; + context._cmp(context.data.byte(44), 0); + if (context.flags.z()) goto nottopchurch; + context.al = 3; + checkifpathison(context); + if (!context.flags.z()) goto makedoorsopen; + context.al = 2; + turnpathon(context); +makedoorsopen: + context.al = 4; + removesetobject(context); context.al = 5; - context.ah = 2; - showframe(context); - return; -} - -static inline void fadescreenup(Context & context) { - clearstartpal(context); - paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + placesetobject(context); return; -} - -static inline void hangone(Context & context) { -hangonloope: - context.push(context.cx); - vsync(context); - context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto hangonearly; - if (--context.cx) goto hangonloope; +nottopchurch: + context._cmp(context.data.byte(9), 47); + if (!context.flags.z()) goto notdreamcentre; + context.al = 4; + placesetobject(context); + context.al = 5; + placesetobject(context); return; -hangonearly: - context.ax = context.pop(); - context.ax = context.pop(); +notdreamcentre: + context._cmp(context.data.byte(9), 38); + if (!context.flags.z()) goto notcarpark; + context.data.word(21) = 57*2; + context.data.word(23) = 4; + context.data.word(25) = 57; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); return; -} - -static inline void rollem(Context & context) { - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - context.ds = context.data.word(402); - context.si = 0; - multiget(context); - context.es = context.data.word(466); - context.si = 49*2; - context.ax = context.data.word(context.si); - context.si = context.ax; - context._add(context.si, 66*2); - context.cx = 80; -endcredits21: - context.push(context.cx); - context.bx = 10; - context.cx = context.data.word(77); -endcredits22: - context.push(context.cx); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - context.ds = context.data.word(402); - context.si = 0; - multiput(context); - vsync(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.cx = 18; -onelot2: - context.push(context.cx); - context.di = 25; - context.dx = 161; - context.ax = 0; - printdirect(context); - context._add(context.bx, context.data.word(77)); - context.cx = context.pop(); - if (--context.cx) goto onelot2; - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - multidump(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto endearly2; - context._sub(context.bx, 1); - if (--context.cx) goto endcredits22; - context.cx = context.pop(); -looknext2: - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context._cmp(context.al, ':'); - if (context.flags.z()) goto gotnext2; - context._cmp(context.al, 0); - if (context.flags.z()) goto gotnext2; - goto looknext2; -gotnext2: - context._cmp(context.data.byte(392), 1); - if (context.flags.z()) goto endearly; - if (--context.cx) goto endcredits21; - context.cx = 120; - hangone(context); +notcarpark: + context._cmp(context.data.byte(9), 32); + if (!context.flags.z()) goto notalley; + context.data.word(21) = 66*2; + context.data.word(23) = 0; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); return; -endearly2: - context.cx = context.pop(); -endearly: +notalley: + context._cmp(context.data.byte(9), 24); + if (!context.flags.z()) goto notedensagain; + context.al = 2; + context.ah = context.data.byte(185); + context._sub(context.ah, 1); + turnanypathon(context); +notedensagain: return; } -static inline void rollendcredits2(Context & context) { - rollem(context); +static void initialinv(Context & context) { + context._cmp(context.data.byte(184), 24); + if (context.flags.z()) goto isedens; return; -} - -static inline void showgun(Context & context) { - context.data.byte(348) = 0; - context.data.byte(347) = 0; - context.data.byte(349) = 0; - paltostartpal(context); - paltoendpal(context); - greyscalesum(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 130; - hangon(context); - endpaltostart(context); - clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; - context.cx = 200; - hangon(context); - context.data.byte(531) = 34; - loadroomssample(context); - context.data.byte(386) = 0; - context.dx = 2364; - loadintotemp(context); - createpanel2(context); - context.ds = context.data.word(458); - context.al = 0; - context.ah = 0; - context.di = 100; - context.bx = 4; - showframe(context); - context.ds = context.data.word(458); - context.al = 1; - context.ah = 0; - context.di = 158; - context.bx = 106; - showframe(context); - worktoscreen(context); - getridoftemp(context); - fadescreenup(context); - context.cx = 160; - hangon(context); +isedens: + context.al = 11; + context.ah = 5; + pickupob(context); context.al = 12; + context.ah = 6; + pickupob(context); + context.al = 13; + context.ah = 7; + pickupob(context); + context.al = 14; + context.ah = 8; + pickupob(context); + context.al = 18; + context.al = 18; context.ah = 0; - playchannel0(context); - context.dx = 2273; - loadtemptext(context); - rollendcredits2(context); - getridoftemptext(context); + pickupob(context); + context.al = 19; + context.ah = 1; + pickupob(context); + context.al = 20; + context.ah = 9; + pickupob(context); + context.al = 16; + context.ah = 2; + pickupob(context); + context.data.byte(32) = 1; + context.data.word(29) = 0; + context.data.word(31) = 6; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + switchryanoff(context); return; } -static inline void fadescreendown(Context & context) { - paltostartpal(context); - clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; +static void pickupob(Context & context) { + context.data.byte(107) = context.ah; + context.data.byte(102) = 2; + context.data.byte(89) = context.al; + context.data.byte(99) = context.al; + getanyad(context); + transfertoex(context); return; } -static inline void hangon(Context & context) { -hangonloop: - context.push(context.cx); - vsync(context); - context.cx = context.pop(); - if (--context.cx) goto hangonloop; +static void checkforemm(Context & context) { return; } -static inline void paltostartpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.cx = 768/2; - while(--context.cx) context._movsw(); - return; +static void checkbasemem(Context & context) { + context.bx = context.data.word(534); + context._cmp(context.bx, 0x9360); + if (!context.flags.c()) goto enoughmem; + context.data.byte(532) = 5; + { quickquit(context); return; }; +enoughmem: + return; +} + +static void allocatebuffers(Context & context) { + context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; + allocatemem(context); + context.data.word(398) = context.ax; + trysoundalloc(context); + context.bx = 0+(66*60)/16; + allocatemem(context); + context.data.word(418) = context.ax; + trysoundalloc(context); + context.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-context.data.byte(537)+68-context.data.byte(1)/16; + allocatemem(context); + context.data.word(412) = context.ax; + trysoundalloc(context); + context.bx = 16*80/16; + allocatemem(context); + context.data.word(426) = context.ax; + trysoundalloc(context); + context.bx = 64*128/16; + allocatemem(context); + context.data.word(428) = context.ax; + trysoundalloc(context); + context.bx = 22*8*20*8/16; + allocatemem(context); + context.data.word(402) = context.ax; + allocatework(context); + context.bx = 2048/16; + allocatemem(context); + context.data.word(420) = context.ax; + context.bx = 2048/16; + allocatemem(context); + context.data.word(422) = context.ax; + return; } -static inline void clearendpal(Context & context) { +static void clearbuffers(Context & context) { context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.cx = 768; - context.al = 0; - while(--context.cx) context._stosb(); + context.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-context.data.byte(537)+68-context.data.byte(1)/2; + context.ax = 0; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(398); + context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.ax = 0x0ffff; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(412); + context.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); + context.ds = context.cs; + context.si = 537; + context.cx = 991-context.data.byte(537); + while(--context.cx) context._movsb(); + context.es = context.data.word(412); + context.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-context.data.byte(537); + context.ds = context.cs; + context.si = 1; + context.cx = 68-context.data.byte(1); + while(--context.cx) context._movsb(); + clearchanges(context); return; } -static inline void fadescreendowns(Context & context) { - paltostartpal(context); - clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; +static void clearchanges(Context & context) { + context.es = context.data.word(412); + context.cx = 250*2; + context.ax = 0x0ffff; + context.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); + while(--context.cx) context._stosw(); + context.ds = context.data.word(412); + context.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); + context.es = context.cs; + context.di = 537; + context.cx = 991-context.data.byte(537); + while(--context.cx) context._movsb(); + context.ds = context.data.word(412); + context.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-context.data.byte(537); + context.es = context.cs; + context.di = 1; + context.cx = 68-context.data.byte(1); + while(--context.cx) context._movsb(); + context.data.byte(10) = 0; + context.data.word(12) = 0; + context.data.word(14) = 0; + context.es = context.data.word(398); + context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.ax = 0x0ffff; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.cs; + context.di = 7798; + context.al = 1; + context._stosb(); + context._stosb(); + context.al = 0; + context._stosb(); + context.al = 1; + context._stosb(); + context.ax = 0; + context.cx = 6; + while(--context.cx) context._stosw(); return; } -static inline void loadtemptext(Context & context) { - standardload(context); - context.data.word(466) = context.ax; +static void clearbeforeload(Context & context) { + context._cmp(context.data.byte(74), 1); + if (!context.flags.z()) goto noclear; + clearreels(context); + clearrest(context); + context.data.byte(74) = 0; +noclear: return; } -static inline void twodigitnum(Context & context) { - context.ah = context.cl; - context._sub(context.ah, 1); -numloop1: - context._add(context.ah, 1); - context._sub(context.al, 10); - if (!context.flags.c()) goto numloop1; - context._add(context.al, 10); - context._add(context.al, context.cl); +static void clearreels(Context & context) { + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); return; } -static inline void cancelch1(Context & context) { - context.data.word(521) = 0; - context.data.byte(515) = 255; +static void clearrest(Context & context) { + context.es = context.data.word(418); + context.cx = 66*60/2; + context.ax = 0; + context.di = 0; + while(--context.cx) context._stosw(); + context.es = context.data.word(416); + deallocatemem(context); + context.es = context.data.word(444); + deallocatemem(context); + context.es = context.data.word(450); + deallocatemem(context); + context.es = context.data.word(448); + deallocatemem(context); + context.es = context.data.word(440); + deallocatemem(context); + context.es = context.data.word(442); + deallocatemem(context); + context.es = context.data.word(436); + deallocatemem(context); + context.es = context.data.word(446); + deallocatemem(context); + context.es = context.data.word(438); + deallocatemem(context); return; } -static inline void loadroomssample(Context & context) { - context.al = context.data.byte(531); - context._cmp(context.al, 255); - if (context.flags.z()) goto loadedalready; - context._cmp(context.al, context.data.byte(530)); - if (context.flags.z()) goto loadedalready; - context.data.byte(530) = context.al; - context.al = context.data.byte(530); - context.cl = '0'; - twodigitnum(context); - context.di = 1909; - context._xchg(context.al, context.ah); - context.data.word(context.di+10) = context.ax; - context.dx = context.di; - loadsecondsample(context); -loadedalready: +static void seecommandtail(Context & context) { + context.data.word(372) = 0x220; + context.data.byte(378) = 5; + context.data.byte(379) = 1; + context.data.byte(73) = 0; + context.bx = 2; + context.ax = context.data.word(context.bx); + context.dx = context.es; + context._sub(context.ax, context.dx); + context.data.word(534) = context.ax; + context.bx = 0x02c; + context.ax = context.data.word(context.bx); + context.push(context.es); + context.push(context.bx); + context.es = context.ax; + context.bx = 0; +findblaster: + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0); + if (context.flags.z()) goto endofenvironment; + context._cmp(context.al, 'B'); + if (!context.flags.z()) goto notblast; + context._cmp(context.ah, 'L'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+2), 'A'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+3), 'S'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+4), 'T'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+5), 'E'); + if (!context.flags.z()) goto notblast; + context._cmp(context.data.byte(context.bx+6), 'R'); + if (!context.flags.z()) goto notblast; + context._add(context.bx, 7); + parseblaster(context); + goto endofenvironment; +notblast: + context._add(context.bx, 1); + goto findblaster; +endofenvironment: + context.bx = context.pop(); + context.es = context.pop(); + context.bx = 0x81; + parseblaster(context); return; } -static inline void readheader(Context & context) { - context.ds = context.cs; - context.dx = 5881; - context.cx = 5958-context.data.byte(5881); - readfromfile(context); - context.es = context.cs; - context.di = 5952; +static void parseblaster(Context & context) { +lookattail: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 0); + if (context.flags.z()) goto endtail; + context._cmp(context.al, 13); + if (context.flags.z()) goto endtail; + context._cmp(context.al, 'i'); + if (context.flags.z()) goto issoundint; + context._cmp(context.al, 'I'); + if (context.flags.z()) goto issoundint; + context._cmp(context.al, 'b'); + if (context.flags.z()) goto isbright; + context._cmp(context.al, 'B'); + if (context.flags.z()) goto isbright; + context._cmp(context.al, 'a'); + if (context.flags.z()) goto isbaseadd; + context._cmp(context.al, 'A'); + if (context.flags.z()) goto isbaseadd; + context._cmp(context.al, 'n'); + if (context.flags.z()) goto isnosound; + context._cmp(context.al, 'N'); + if (context.flags.z()) goto isnosound; + context._cmp(context.al, 'd'); + if (context.flags.z()) goto isdma; + context._cmp(context.al, 'D'); + if (context.flags.z()) goto isdma; + context._add(context.bx, 1); + if (--context.cx) goto lookattail; return; -} - -static inline void standardload(Context & context) { - openfile(context); - readheader(context); - context.bx = context.data.word(context.di); - context.push(context.bx); +issoundint: + context.al = context.data.byte(context.bx+1); + context._sub(context.al, '0'); + context.data.byte(378) = context.al; + context._add(context.bx, 1); + goto lookattail; +isdma: + context.al = context.data.byte(context.bx+1); + context._sub(context.al, '0'); + context.data.byte(379) = context.al; + context._add(context.bx, 1); + goto lookattail; +isbaseadd: + context.push(context.cx); + context.al = context.data.byte(context.bx+2); + context._sub(context.al, '0'); + context.ah = 0; context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.ds = context.ax; + context._shl(context.ax, context.cl); + context._add(context.ax, 0x200); + context.data.word(372) = context.ax; context.cx = context.pop(); - context.push(context.ax); - context.dx = 0; - readfromfile(context); - closefile(context); - context.ax = context.pop(); + context._add(context.bx, 1); + goto lookattail; +isbright: + context.data.byte(73) = 1; + context._add(context.bx, 1); + goto lookattail; +isnosound: + context.data.byte(378) = 255; + context._add(context.bx, 1); + goto lookattail; +endtail: return; } -static inline void loadintotemp(Context & context) { - context.ds = context.cs; - standardload(context); - context.data.word(458) = context.ax; +static void startup(Context & context) { + context.data.byte(142) = 0; + context.data.byte(105) = 0; + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + showicon(context); + getunderzoom(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + atmospheres(context); return; } -static inline void showmonk(Context & context) { - context.al = 0; - context.ah = 128; - context.di = 160; - context.bx = 72; - context.ds = context.data.word(458); - showframe(context); +static void startup1(Context & context) { + clearpalette(context); + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; + createpanel(context); + context.data.byte(62) = 1; + drawfloor(context); + showicon(context); + getunderzoom(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + atmospheres(context); + worktoscreen(context); + fadescreenup(context); return; } -static inline void getridoftemp(Context & context) { - context.es = context.data.word(458); - deallocatemem(context); +static void screenupdate(Context & context) { + newplace(context); + mainscreen(context); + animpointer(context); + showpointer(context); + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto iswatchingmode; + context._cmp(context.data.byte(188), 255); + if (!context.flags.z()) goto finishearly; +iswatchingmode: + vsync(context); + readmouse1(context); + dumppointer(context); + dumptextline(context); + delpointer(context); + autolook(context); + spriteupdate(context); + watchcount(context); + zoom(context); + showpointer(context); + context._cmp(context.data.byte(391), 0); + if (!context.flags.z()) goto finishearly; + vsync(context); + readmouse2(context); + dumppointer(context); + dumpzoom(context); + delpointer(context); + deleverything(context); + printsprites(context); + reelsonscreen(context); + afternewroom(context); + showpointer(context); + vsync(context); + readmouse3(context); + dumppointer(context); + dumpmap(context); + dumptimedtext(context); + delpointer(context); + showpointer(context); + vsync(context); + readmouse4(context); + dumppointer(context); + dumpwatch(context); + delpointer(context); +finishearly: return; } -static inline void monkspeaking(Context & context) { - context.data.byte(531) = 35; - loadroomssample(context); - context.dx = 2377; - loadintotemp(context); - clearwork(context); - showmonk(context); - worktoscreen(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; - context.al = 12; - context.ah = 255; - playchannel0(context); - fadescreenups(context); - context.cx = 300; - hangon(context); - context.al = 40; -nextmonkspeak: - context.push(context.ax); - context.ah = 0; - context.si = context.ax; - context._add(context.si, context.si); - context.es = context.data.word(466); - context.ax = context.data.word(context.si); - context._add(context.ax, 66*2); - context.si = context.ax; -nextbit: - context.di = 36; - context.bx = 140; - context.dl = 239; - printdirect(context); - context.push(context.ax); - context.push(context.si); - context.push(context.es); - worktoscreen(context); - clearwork(context); - showmonk(context); - context.cx = 240; - hangon(context); - context.es = context.pop(); - context.si = context.pop(); - context.ax = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto nextbit; - context.ax = context.pop(); - context._add(context.al, 1); - context._cmp(context.al, 44); - if (!context.flags.z()) goto nextmonkspeak; - context.data.byte(388) = 1; - context.data.byte(387) = 7; - fadescreendowns(context); - context.cx = 300; - hangon(context); - getridoftemp(context); +static void watchreel(Context & context) { + context._cmp(context.data.word(23), -1); + if (context.flags.z()) goto notplayingreel; + context.al = context.data.byte(475); + context._cmp(context.al, context.data.byte(477)); + if (!context.flags.z()) goto waitstopwalk; + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); + if (context.flags.z()) goto notwatchpath; +waitstopwalk: + return; +notwatchpath: + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); + if (!context.flags.z()) goto showwatchreel; + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context.ax = context.data.word(23); + context._cmp(context.ax, context.data.word(25)); + if (!context.flags.z()) goto ismorereel; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto showwatchreel; + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.word(29), -1); + if (context.flags.z()) goto nomorereel; + context.data.byte(32) = 1; + goto notplayingreel; +ismorereel: + context._add(context.data.word(23), 1); +showwatchreel: + context.ax = context.data.word(23); + context.data.word(239) = context.ax; + plotreel(context); + context.ax = context.data.word(239); + context.data.word(23) = context.ax; + checkforshake(context); +nomorereel: + return; +notplayingreel: + context._cmp(context.data.byte(32), 1); + if (!context.flags.z()) goto notholdingreel; + context.ax = context.data.word(29); + context.data.word(239) = context.ax; + plotreel(context); + return; +notholdingreel: + context._cmp(context.data.byte(32), 2); + if (!context.flags.z()) goto notreleasehold; + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); + if (!context.flags.z()) goto notlastspeed2; + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context._add(context.data.word(29), 1); +notlastspeed2: + context.ax = context.data.word(29); + context._cmp(context.ax, context.data.word(31)); + if (!context.flags.z()) goto ismorereel2; + context.data.word(29) = -1; + context.data.byte(32) = -1; + context.al = context.data.byte(33); + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + autosetwalk(context); return; -} - -static inline void loadintroroom(Context & context) { - context.data.byte(139) = 0; - context.data.byte(9) = 255; - loadroom(context); - context.data.word(121) = 72; - context.data.word(123) = 16; - clearsprites(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; - clearwork(context); - context.data.byte(62) = 1; - drawfloor(context); - reelsonscreen(context); - spriteupdate(context); - printsprites(context); - worktoscreen(context); +ismorereel2: + context.ax = context.data.word(29); + context.data.word(239) = context.ax; + plotreel(context); return; -} - -static inline void clearstartpal(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.cx = 256; -wholeloop1: - context.ax = 0; - context._stosw(); - context.al = 0; - context._stosb(); - if (--context.cx) goto wholeloop1; +notreleasehold: return; } -static inline void paltoendpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.cx = 768/2; - while(--context.cx) context._movsw(); - return; -} - -static inline void fadescreenups(Context & context) { - clearstartpal(context); - paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; +static void checkforshake(Context & context) { + context._cmp(context.data.byte(184), 26); + if (!context.flags.z()) goto notstartshake; + context._cmp(context.ax, 104); + if (!context.flags.z()) goto notstartshake; + context.data.byte(68) = -1; +notstartshake: return; } -static inline void playchannel0(Context & context) { - context._cmp(context.data.byte(378), 255); - if (context.flags.z()) goto dontbother4; - context.push(context.es); - context.push(context.ds); - context.push(context.bx); - context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.data.byte(507) = context.al; - context.es = context.data.word(420); - context._cmp(context.al, 12); - if (context.flags.c()) goto notsecondbank; - context.es = context.data.word(422); - context._sub(context.al, 12); -notsecondbank: - context.data.byte(508) = context.ah; - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ah = 0; - context.data.word(502) = context.ax; - context.ax = context.data.word(context.bx+1); - context.data.word(504) = context.ax; - context.ax = context.data.word(context.bx+3); - context.data.word(506) = context.ax; - context._cmp(context.data.byte(508), 0); - if (context.flags.z()) goto nosetloop; - context.ax = context.data.word(502); - context.data.word(510) = context.ax; - context.ax = context.data.word(504); - context.data.word(512) = context.ax; - context.ax = context.data.word(506); - context.data.word(514) = context.ax; -nosetloop: - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); -dontbother4: +static void watchcount(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowatchworn; + context._add(context.data.byte(146), 1); + context._cmp(context.data.byte(146), 9); + if (context.flags.z()) goto flashdots; + context._cmp(context.data.byte(146), 18); + if (context.flags.z()) goto uptime; +nowatchworn: return; -} - -static inline void cancelch0(Context & context) { - context.data.byte(508) = 0; - context.data.word(506) = 0; - context.data.byte(507) = 255; +flashdots: + context.ax = 91*3+21; + context.di = 268+4; + context.bx = 21; + context.ds = context.data.word(404); + showframe(context); + goto finishwatch; +uptime: + context.data.byte(146) = 0; + context._add(context.data.byte(5), 1); + context._cmp(context.data.byte(5), 60); + if (!context.flags.z()) goto finishtime; + context.data.byte(5) = 0; + context._add(context.data.byte(6), 1); + context._cmp(context.data.byte(6), 60); + if (!context.flags.z()) goto finishtime; + context.data.byte(6) = 0; + context._add(context.data.byte(7), 1); + context._cmp(context.data.byte(7), 24); + if (!context.flags.z()) goto finishtime; + context.data.byte(7) = 0; +finishtime: + showtime(context); +finishwatch: + context.data.byte(266) = 1; return; } -static inline void atmospheres(Context & context) { - context.cl = context.data.byte(148); - context.ch = context.data.byte(149); - context.bx = 5073; -nextatmos: - context.al = context.data.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) goto nomoreatmos; - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto wrongatmos; - context.ax = context.data.word(context.bx+1); - context._cmp(context.ax, context.cx); - if (!context.flags.z()) goto wrongatmos; - context.ax = context.data.word(context.bx+3); - context._cmp(context.al, context.data.byte(507)); - if (context.flags.z()) goto playingalready; - context._cmp(context.data.byte(9), 45); - if (!context.flags.z()) goto notweb; - context._cmp(context.data.word(23), 45); - if (context.flags.z()) goto wrongatmos; -notweb: - playchannel0(context); - context._cmp(context.data.byte(184), 2); - context._cmp(context.data.byte(149), 0); - if (context.flags.z()) goto fullvol; - if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(149), 10); - if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(148), 22); - if (!context.flags.z()) goto notlouisvol; - context.data.byte(386) = 5; -notlouisvol: -playingalready: - context._cmp(context.data.byte(184), 2); - if (!context.flags.z()) goto notlouisvol2; - context._cmp(context.data.byte(148), 22); - if (context.flags.z()) goto louisvol; - context._cmp(context.data.byte(148), 11); - if (!context.flags.z()) goto notlouisvol2; -fullvol: - context.data.byte(386) = 0; -notlouisvol2: - return; -louisvol: - context.data.byte(386) = 5; - return; -wrongatmos: - context._add(context.bx, 5); - goto nextatmos; -nomoreatmos: - cancelch0(context); +static void showtime(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowatch; + context.al = context.data.byte(5); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3+10); + context.ds = context.data.word(404); + context.di = 282+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3+10); + context.ds = context.data.word(404); + context.di = 282+9; + context.bx = 21; + showframe(context); + context.al = context.data.byte(6); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 270+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 270+11; + context.bx = 21; + showframe(context); + context.al = context.data.byte(7); + context.cl = 0; + twodigitnum(context); + context.push(context.ax); + context.al = context.ah; + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 256+5; + context.bx = 21; + showframe(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, 91*3); + context.ds = context.data.word(404); + context.di = 256+11; + context.bx = 21; + showframe(context); + context.ax = 91*3+20; + context.ds = context.data.word(404); + context.di = 267+5; + context.bx = 21; + showframe(context); +nowatch: return; } -static inline void spriteupdate(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.al = context.data.byte(63); - context.data.byte(context.bx+31) = context.al; - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.cx = 16; -_tmp18: - context.push(context.cx); - context.push(context.bx); - context.ax = context.data.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto _tmp18a; - context.push(context.es); - context.push(context.ds); - context.cx = context.data.word(context.bx+2); - context.data.word(context.bx+24) = context.cx; - __dispatch_call(context, context.ax); - context.ds = context.pop(); - context.es = context.pop(); -_tmp18a: - context.bx = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(186), 1); - if (context.flags.z()) goto _tmp18b; - context._add(context.bx, 32); - if (--context.cx) goto _tmp18; -_tmp18b: +static void dumpwatch(Context & context) { + context._cmp(context.data.byte(266), 1); + if (!context.flags.z()) goto nodumpwatch; + context.di = 256; + context.bx = 21; + context.cl = 40; + context.ch = 12; + multidump(context); + context.data.byte(266) = 0; +nodumpwatch: return; } -static inline void maptopanel(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); - context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); - multiput(context); +static void showbyte(Context & context) { + context.dl = context.al; + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + onedigit(context); + context.data.byte(context.di) = context.dl; + context.dl = context.al; + context._and(context.dl, 15); + onedigit(context); + context.data.byte(context.di+1) = context.dl; + context._add(context.di, 3); return; } -static inline void deleverything(Context & context) { - context.al = context.data.byte(129); - context.ah = 0; - context._add(context.ax, context.data.word(123)); - context._cmp(context.ax, 182); - if (!context.flags.c()) goto bigroom; - maptopanel(context); +static void onedigit(Context & context) { + context._cmp(context.dl, 10); + if (!context.flags.c()) goto morethan10; + context._add(context.dl, '0'); return; -bigroom: - context._sub(context.data.byte(129), 8); - maptopanel(context); - context._add(context.data.byte(129), 8); +morethan10: + context._sub(context.dl, 10); + context._add(context.dl, 'A'); return; } -static inline void printasprite(Context & context) { - context.push(context.es); - context.push(context.bx); - context.si = context.bx; - context.ds = context.data.word(context.si+6); - context.al = context.data.byte(context.si+11); - context.ah = 0; - context._cmp(context.al, 220); - if (context.flags.c()) goto notnegative1; - context.ah = 255; -notnegative1: - context.bx = context.ax; - context._add(context.bx, context.data.word(119)); - context.al = context.data.byte(context.si+10); - context.ah = 0; - context._cmp(context.al, 220); - if (context.flags.c()) goto notnegative2; - context.ah = 255; -notnegative2: - context.di = context.ax; - context._add(context.di, context.data.word(117)); - context.al = context.data.byte(context.si+15); - context.ah = 0; - context._cmp(context.data.byte(context.si+30), 0); - if (context.flags.z()) goto steadyframe; - context.ah = 8; -steadyframe: - context._cmp(context.data.byte(182), 6); - if (!context.flags.z()) goto notquickp; -notquickp: - showframe(context); - context.bx = context.pop(); - context.es = context.pop(); +static void twodigitnum(Context & context) { + context.ah = context.cl; + context._sub(context.ah, 1); +numloop1: + context._add(context.ah, 1); + context._sub(context.al, 10); + if (!context.flags.c()) goto numloop1; + context._add(context.al, 10); + context._add(context.al, context.cl); return; } -static inline void printsprites(Context & context) { - context.es = context.data.word(412); - context.cx = 0; -priorityloop: - context.push(context.cx); - context.data.byte(182) = context.cl; - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.cx = 16; -prtspriteloop: - context.push(context.cx); - context.push(context.bx); - context.ax = context.data.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto skipsprite; - context.al = context.data.byte(182); - context._cmp(context.al, context.data.byte(context.bx+23)); - if (!context.flags.z()) goto skipsprite; - context._cmp(context.data.byte(context.bx+31), 1); - if (context.flags.z()) goto skipsprite; - printasprite(context); -skipsprite: - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 32); - if (--context.cx) goto prtspriteloop; - context.cx = context.pop(); - context._add(context.cx, 1); - context._cmp(context.cx, 7); - if (!context.flags.z()) goto priorityloop; +static void showword(Context & context) { + context.ch = 0; + context.bx = 10000; + context.cl = 47; +word1: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word1; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di) = context.cl; + context.bx = 1000; + context.cl = 47; +word2: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word2; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+1) = context.cl; + context.bx = 100; + context.cl = 47; +word3: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word3; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+2) = context.cl; + context.bx = 10; + context.cl = 47; +word4: + context._add(context.cl, 1); + context._sub(context.ax, context.bx); + if (!context.flags.c()) goto word4; + context._add(context.ax, context.bx); + convnum(context); + context.data.byte(context.di+3) = context.cl; + context._add(context.al, 48); + context.cl = context.al; + convnum(context); + context.data.byte(context.di+4) = context.cl; + return; +} + +static void convnum(Context & context) { + context._cmp(context.ch, 0); + if (!context.flags.z()) goto noconvnum; + context._cmp(context.cl, '0'); + if (!context.flags.z()) goto notzeronum; + context.cl = 32; + goto noconvnum; +notzeronum: + context.ch = 1; +noconvnum: + return; +} + +static void walkandexamine(Context & context) { + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto noobselect; + examineob(context); + return; +wantstowalk: + setwalk(context); + context.data.byte(473) = 1; +noobselect: + return; +diff: + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; +diff2: + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto middleofwalk; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto notblock; + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto dontcheck; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto isblock; +dontcheck: + getflagunderp(context); + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto isblock; + context._cmp(context.data.byte(153), 128); + if (!context.flags.c()) goto isblock; + goto toofaraway; +notblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto toofaraway; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto isblock; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto isaperson; + examineobtext(context); + return; +middleofwalk: + blocknametext(context); + return; +isblock: + blocknametext(context); + return; +isaperson: + personnametext(context); + return; +toofaraway: + walktotext(context); return; } -static inline void undertextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); - context._sub(context.bx, 3); - context.ds = context.data.word(412); - context.si = 0; - context.cl = 228; - context.ch = 13; - multiget(context); +static void mainscreen(Context & context) { + context.data.byte(237) = 0; + context.bx = 4949; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto checkmain; + context.bx = 5011; +checkmain: + checkcoords(context); + context._cmp(context.data.byte(306), 0); + if (context.flags.z()) goto finishmain; + walkandexamine(context); +finishmain: return; } -static inline void reconstruct(Context & context) { - context._cmp(context.data.byte(130), 0); - if (context.flags.z()) goto noneedtorecon; - context.data.byte(62) = 1; - drawfloor(context); - spriteupdate(context); - printsprites(context); - context._cmp(context.data.byte(184), 20); - if (!context.flags.z()) goto notfudge; - undertextline(context); -notfudge: - context.data.byte(130) = 0; -noneedtorecon: +static void madmanrun(Context & context) { + context._cmp(context.data.byte(9), 14); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(234), 2); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(53), 0); + if (!context.flags.z()) { identifyob(context); return; }; + context._cmp(context.data.byte(100), 211); + if (context.flags.z()) goto alreadyrun; + context.data.byte(100) = 211; + context.al = 52; + commandonly(context); +alreadyrun: + context._cmp(context.data.word(202), 1); + if (!context.flags.z()) goto norun; + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); + if (context.flags.z()) goto norun; + context.data.byte(65) = 8; +norun: return; } -static inline void updatepeople(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.data.word(18) = context.di; - context.cx = 12*5; - context.al = 255; - while(--context.cx) context._stosb(); - context._add(context.data.word(138), 1); - context.es = context.cs; - context.bx = 537; - context.di = 1003; -updateloop: - context.al = context.data.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) goto endupdate; - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto notinthisroom; - context.cx = context.data.word(context.bx+1); - context._cmp(context.cl, context.data.byte(148)); - if (!context.flags.z()) goto notinthisroom; - context._cmp(context.ch, context.data.byte(149)); - if (!context.flags.z()) goto notinthisroom; - context.push(context.di); - context.ax = context.data.word(context.di); +static void checkcoords(Context & context) { +loop048: + context.ax = context.data.word(context.bx); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nonefound; + context.push(context.bx); + context._cmp(context.data.word(198), context.ax); + if (context.flags.l()) goto over045; + context.ax = context.data.word(context.bx+2); + context._cmp(context.data.word(198), context.ax); + if (!context.flags.ge()) goto over045; + context.ax = context.data.word(context.bx+4); + context._cmp(context.data.word(200), context.ax); + if (context.flags.l()) goto over045; + context.ax = context.data.word(context.bx+6); + context._cmp(context.data.word(200), context.ax); + if (!context.flags.ge()) goto over045; + context.ax = context.data.word(context.bx+8); __dispatch_call(context, context.ax); - context.di = context.pop(); -notinthisroom: - context._add(context.bx, 8); - context._add(context.di, 2); - goto updateloop; -endupdate: +finished: + context.ax = context.pop(); + return; +over045: + context.bx = context.pop(); + context._add(context.bx, 10); + goto loop048; +nonefound: return; } -static inline void getreelstart(Context & context) { - context.ax = context.data.word(239); - context.cx = 40; - context._mul(context.cx); - context.es = context.data.word(450); - context.si = context.ax; - context._add(context.si, 0+(36*144)); +static void identifyob(Context & context) { + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) { blank(context); return; }; + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); + context._cmp(context.ax, 22*8); + if (context.flags.c()) goto notover1; + blank(context); + return; +notover1: + context.bx = context.data.word(200); + context._sub(context.bx, context.data.word(119)); + context._cmp(context.bx, 20*8); + if (context.flags.c()) goto notover2; + blank(context); + return; +notover2: + context.data.byte(237) = 1; + context.ah = context.bl; + context.push(context.ax); + findpathofpoint(context); + context.data.byte(474) = context.dl; + context.ax = context.pop(); + context.push(context.ax); + findfirstpath(context); + context.data.byte(476) = context.al; + context.ax = context.pop(); + checkifex(context); + if (!context.flags.z()) goto finishidentify; + checkiffree(context); + if (!context.flags.z()) goto finishidentify; + checkifperson(context); + if (!context.flags.z()) goto finishidentify; + checkifset(context); + if (!context.flags.z()) goto finishidentify; + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); + context.cl = context.al; + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); + context.ch = context.al; + checkone(context); + context._cmp(context.al, 0); + if (context.flags.z()) goto nothingund; + context._cmp(context.data.byte(56), 1); + if (context.flags.z()) goto nothingund; + context.ah = 3; + obname(context); +finishidentify: + return; +nothingund: + blank(context); return; } -static inline void placesetobject(Context & context) { +static void checkifperson(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.cx = 12; +identifyreel: + context.push(context.cx); + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notareelid; context.push(context.es); context.push(context.bx); - context.cl = 0; - context.ch = 0; - findormake(context); - getsetad(context); - context.data.byte(context.bx+58) = 0; + context.push(context.ax); + context.ax = context.data.word(context.bx+0); + context.data.word(239) = context.ax; + getreelstart(context); + context._cmp(context.data.word(context.si+2), 0x0ffff); + if (!context.flags.z()) goto notblankpers; + context._add(context.si, 5); +notblankpers: + context.cx = context.data.word(context.si+2); + context.ax = context.data.word(context.si+0); + context.push(context.cx); + getreelframeax(context); + context.cx = context.pop(); + context._add(context.cl, context.data.byte(context.bx+4)); + context._add(context.ch, context.data.byte(context.bx+5)); + context.dx = context.cx; + context._add(context.dl, context.data.byte(context.bx+0)); + context._add(context.dh, context.data.byte(context.bx+1)); + context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); + context._cmp(context.al, context.cl); + if (context.flags.c()) goto notareelid; + context._cmp(context.ah, context.ch); + if (context.flags.c()) goto notareelid; + context._cmp(context.al, context.dl); + if (!context.flags.c()) goto notareelid; + context._cmp(context.ah, context.dh); + if (!context.flags.c()) goto notareelid; + context.cx = context.pop(); + context.ax = context.data.word(context.bx+2); + context.data.word(249) = context.ax; + context.al = context.data.byte(context.bx+4); + context.ah = 5; + obname(context); + context.al = 0; + context._cmp(context.al, 1); + return; +notareelid: + context.cx = context.pop(); + context._add(context.bx, 5); + context._sub(context.cx, 1); + if (!context.flags.z()) goto identifyreel; + return; +} + +static void checkifset(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); + context.cx = 127; +identifyset: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notasetid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notasetid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notasetid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notasetid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notasetid; + pixelcheckset(context); + if (context.flags.z()) goto notasetid; + isitdescribed(context); + if (context.flags.z()) goto notasetid; + context.al = context.data.byte(context.bx+4); + context.ah = 1; + obname(context); + context.al = 0; + context._cmp(context.al, 1); + return; +notasetid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyset; return; } -static inline void getsetad(Context & context) { - context.ah = 0; - context.bx = 64; - context._mul(context.bx); - context.bx = context.ax; - context.es = context.data.word(428); +static void checkifex(Context & context) { + context.es = context.data.word(412); + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); + context.cx = 99; +identifyex: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notanexid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notanexid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notanexid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notanexid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notanexid; + context.al = context.data.byte(context.bx+4); + context.ah = 4; + obname(context); + context.al = 1; + context._cmp(context.al, 0); return; -} - -static inline void removesetobject(Context & context) { - context.push(context.es); - context.push(context.bx); - context.cl = 255; - context.ch = 0; - findormake(context); - getsetad(context); - context.data.byte(context.bx+58) = 255; - context.bx = context.pop(); - context.es = context.pop(); +notanexid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyex; return; } -static inline void findormake(Context & context) { - context.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); - context.push(context.ax); +static void checkiffree(Context & context) { context.es = context.data.word(412); - context.ah = context.data.byte(184); -changeloop: - context._cmp(context.data.byte(context.bx), 255); - if (context.flags.z()) goto haventfound; - context._cmp(context.ax, context.data.word(context.bx)); - if (!context.flags.z()) goto nofoundchange; - context._cmp(context.ch, context.data.byte(context.bx+3)); - if (context.flags.z()) goto foundchange; -nofoundchange: - context._add(context.bx, 4); - goto changeloop; -foundchange: - context.ax = context.pop(); - context.data.byte(context.bx+2) = context.cl; + context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); + context.cx = 79; +identifyfree: + context._cmp(context.data.byte(context.bx+4), 255); + if (context.flags.z()) goto notafreeid; + context._cmp(context.al, context.data.byte(context.bx)); + if (context.flags.c()) goto notafreeid; + context._cmp(context.al, context.data.byte(context.bx+2)); + if (!context.flags.c()) goto notafreeid; + context._cmp(context.ah, context.data.byte(context.bx+1)); + if (context.flags.c()) goto notafreeid; + context._cmp(context.ah, context.data.byte(context.bx+3)); + if (!context.flags.c()) goto notafreeid; + context.al = context.data.byte(context.bx+4); + context.ah = 2; + obname(context); + context.al = 0; + context._cmp(context.al, 1); return; -haventfound: - context.data.word(context.bx) = context.ax; - context.data.word(context.bx+2) = context.cx; - context.ax = context.pop(); +notafreeid: + context._sub(context.bx, 5); + context._sub(context.cx, 1); + context._cmp(context.cx, -1); + if (!context.flags.z()) goto identifyfree; return; } -static inline void placefreeobject(Context & context) { +static void isitdescribed(Context & context) { + context.push(context.ax); + context.push(context.cx); context.push(context.es); context.push(context.bx); - context.cl = 0; - context.ch = 1; - findormake(context); - getfreead(context); - context.data.byte(context.bx+2) = 0; - context.bx = context.pop(); - context.es = context.pop(); - return; -} - -static inline void getfreead(Context & context) { + context.al = context.data.byte(context.bx+4); context.ah = 0; - context.cl = 4; - context._shl(context.ax, context.cl); + context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(426); - return; -} - -static inline void removefreeobject(Context & context) { - context.push(context.es); - context.push(context.bx); - getfreead(context); - context.data.byte(context.bx+2) = 255; + context.es = context.data.word(440); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(130*2)); + context.bx = context.ax; + context.dl = context.data.byte(context.bx); context.bx = context.pop(); context.es = context.pop(); + context.cx = context.pop(); + context.ax = context.pop(); + context._cmp(context.dl, 0); return; } -static inline void switchryanoff(Context & context) { - context.data.byte(63) = 1; - return; -} - -static inline void switchryanon(Context & context) { - context.data.byte(63) = 255; - return; -} - -static inline void movemap(Context & context) { - context._cmp(context.ah, 32); - if (!context.flags.z()) goto notmapup2; - context._sub(context.data.byte(149), 20); - context.data.byte(186) = 1; - return; -notmapup2: - context._cmp(context.ah, 16); - if (!context.flags.z()) goto notmapupspec; - context._sub(context.data.byte(149), 10); - context.data.byte(186) = 1; - return; -notmapupspec: - context._cmp(context.ah, 8); - if (!context.flags.z()) goto notmapdownspec; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; - return; -notmapdownspec: - context._cmp(context.ah, 2); - if (!context.flags.z()) goto notmaprightspec; - context._add(context.data.byte(148), 11); - context.data.byte(186) = 1; - return; -notmaprightspec: - context._sub(context.data.byte(148), 11); - context.data.byte(186) = 1; - return; -} - -static inline void dealwithspecial(Context & context) { - context._sub(context.al, 220); - context._cmp(context.al, 0); - if (!context.flags.z()) goto notplset; - context.al = context.ah; - placesetobject(context); - context.data.byte(130) = 1; - return; -notplset: - context._cmp(context.al, 1); - if (!context.flags.z()) goto notremset; - context.al = context.ah; - removesetobject(context); - context.data.byte(130) = 1; - return; -notremset: - context._cmp(context.al, 2); - if (!context.flags.z()) goto notplfree; - context.al = context.ah; - placefreeobject(context); - context.data.byte(130) = 1; - return; -notplfree: - context._cmp(context.al, 3); - if (!context.flags.z()) goto notremfree; - context.al = context.ah; - removefreeobject(context); - context.data.byte(130) = 1; - return; -notremfree: - context._cmp(context.al, 4); - if (!context.flags.z()) goto notryanoff; - switchryanoff(context); - return; -notryanoff: - context._cmp(context.al, 5); - if (!context.flags.z()) goto notryanon; - context.data.byte(135) = context.ah; - context.data.byte(133) = context.ah; - switchryanon(context); - return; -notryanon: - context._cmp(context.al, 6); - if (!context.flags.z()) goto notchangeloc; - context.data.byte(188) = context.ah; - return; -notchangeloc: - movemap(context); - return; -} - -static inline void findsource(Context & context) { - context.ax = context.data.word(160); - context._cmp(context.ax, 160); - if (!context.flags.c()) goto over1000; - context.ds = context.data.word(430); - context.data.word(244) = 0; - return; -over1000: - context._cmp(context.ax, 320); - if (!context.flags.c()) goto over1001; - context.ds = context.data.word(432); - context.data.word(244) = 160; - return; -over1001: - context.ds = context.data.word(434); - context.data.word(244) = 320; +static void findpathofpoint(Context & context) { + context.push(context.ax); + context.bx = 0; + context.es = context.data.word(450); + context.al = context.data.byte(185); + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.cx = context.pop(); + context.dl = 0; +pathloop: + context.al = context.data.byte(context.bx+6); + context._cmp(context.al, 255); + if (!context.flags.z()) goto flunkedit; + context.ax = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto flunkedit; + context._cmp(context.cl, context.al); + if (context.flags.c()) goto flunkedit; + context._cmp(context.ch, context.ah); + if (context.flags.c()) goto flunkedit; + context.ax = context.data.word(context.bx+4); + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto flunkedit; + context._cmp(context.ch, context.ah); + if (!context.flags.c()) goto flunkedit; + goto gotvalidpath; +flunkedit: + context._add(context.bx, 8); + context._add(context.dl, 1); + context._cmp(context.dl, 12); + if (!context.flags.z()) goto pathloop; + context.dl = 255; +gotvalidpath: return; } -static inline void showreelframe(Context & context) { - context.al = context.data.byte(context.si+2); +static void findfirstpath(Context & context) { + context.push(context.ax); + context.bx = 0; + context.es = context.data.word(450); + context.al = context.data.byte(185); context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(117)); - context.al = context.data.byte(context.si+3); - context.bx = context.ax; - context._add(context.bx, context.data.word(119)); - context.ax = context.data.word(context.si); - context.data.word(160) = context.ax; - findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); - context.ah = 8; - showframe(context); + context.cx = 144; + context._mul(context.cx); + context._add(context.bx, context.ax); + context.cx = context.pop(); + context.dl = 0; +fpathloop: + context.ax = context.data.word(context.bx+2); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nofirst; + context._cmp(context.cl, context.al); + if (context.flags.c()) goto nofirst; + context._cmp(context.ch, context.ah); + if (context.flags.c()) goto nofirst; + context.ax = context.data.word(context.bx+4); + context._cmp(context.cl, context.al); + if (!context.flags.c()) goto nofirst; + context._cmp(context.ch, context.ah); + if (!context.flags.c()) goto nofirst; + goto gotfirst; +nofirst: + context._add(context.bx, 8); + context._add(context.dl, 1); + context._cmp(context.dl, 12); + if (!context.flags.z()) goto fpathloop; + context.al = 0; + return; +gotfirst: + context.al = context.data.byte(context.bx+6); return; } -static inline void soundonreels(Context & context) { - context.bl = context.data.byte(184); - context._add(context.bl, context.bl); - context._xor(context.bh, context.bh); - context._add(context.bx, 1254); - context.si = context.data.word(context.bx); -reelsoundloop: - context.al = context.data.byte(context.si); +static void turnpathon(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 255; + context.ch = context.data.byte(185); + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + getroomspaths(context); + context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto endreelsound; - context.ax = context.data.word(context.si+1); - context._cmp(context.ax, context.data.word(239)); - if (!context.flags.z()) goto skipreelsound; - context._cmp(context.ax, context.data.word(351)); - if (context.flags.z()) goto skipreelsound; - context.data.word(351) = context.ax; - context.al = context.data.byte(context.si); - context._cmp(context.al, 64); - if (context.flags.c()) { playchannel1(context); return; }; - context._cmp(context.al, 128); - if (context.flags.c()) goto channel0once; - context._and(context.al, 63); - context.ah = 255; - { playchannel0(context); return; }; -channel0once: - context._and(context.al, 63); + if (context.flags.z()) goto nopathon; context.ah = 0; - { playchannel0(context); return; }; -skipreelsound: - context._add(context.si, 3); - goto reelsoundloop; -endreelsound: - context.ax = context.data.word(351); - context._cmp(context.ax, context.data.word(239)); - if (context.flags.z()) goto nochange2; - context.data.word(351) = -1; -nochange2: + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 255; + context.data.byte(context.bx+6) = context.al; +nopathon: return; } -static inline void plotreel(Context & context) { - getreelstart(context); -retryreel: - context.push(context.es); - context.push(context.si); - context.ax = context.data.word(context.si+2); - context._cmp(context.al, 220); - if (context.flags.c()) goto normalreel; +static void turnpathoff(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 0; + context.ch = context.data.byte(185); + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + getroomspaths(context); + context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto normalreel; - dealwithspecial(context); - context._add(context.data.word(239), 1); - context.si = context.pop(); - context.es = context.pop(); - context._add(context.si, 40); - goto retryreel; -normalreel: - context.cx = 8; -plotloop: - context.push(context.cx); - context.push(context.es); - context.push(context.si); - context.ax = context.data.word(context.si); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto notplot; - showreelframe(context); -notplot: - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context._add(context.si, 5); - if (--context.cx) goto plotloop; - soundonreels(context); - context.bx = context.pop(); - context.es = context.pop(); + if (context.flags.z()) goto nopathoff; + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; +nopathoff: return; } -static inline void checkforshake(Context & context) { - context._cmp(context.data.byte(184), 26); - if (!context.flags.z()) goto notstartshake; - context._cmp(context.ax, 104); - if (!context.flags.z()) goto notstartshake; - context.data.byte(68) = -1; -notstartshake: +static void turnanypathon(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 255; + context.ch = context.ah; + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + context.al = context.ah; + context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 255; + context.data.byte(context.bx+6) = context.al; return; } -static inline void getroomspaths(Context & context) { - context.al = context.data.byte(185); +static void turnanypathoff(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.cl = 0; + context.ch = context.ah; + context._add(context.ch, 100); + findormake(context); + context.ax = context.pop(); + context.al = context.ah; context.ah = 0; context.cx = 144; context._mul(context.cx); context.es = context.data.word(450); context.bx = 0; context._add(context.bx, context.ax); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; return; } -static inline void checkdest(Context & context) { - context.push(context.bx); - context._add(context.bx, 12*8); - context.ah = context.data.byte(475); - context.cl = 4; - context._shl(context.ah, context.cl); - context.al = context.data.byte(478); - context.cl = 24; - context.ch = context.data.byte(478); -checkdestloop: - context.dh = context.data.byte(context.bx); - context._and(context.dh, 0b11110000); - context.dl = context.data.byte(context.bx); - context._and(context.dl, 0b00001111); - context._cmp(context.ax, context.dx); - if (!context.flags.z()) goto nextcheck; - context.al = context.data.byte(context.bx+1); - context._and(context.al, 15); - context.data.byte(478) = context.al; - context.bx = context.pop(); +static void checkifpathison(Context & context) { + context.push(context.ax); + getroomspaths(context); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx+6); + context._cmp(context.al, 255); return; -nextcheck: - context.dl = context.data.byte(context.bx); - context._and(context.dl, 0b11110000); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context.dh = context.data.byte(context.bx); - context._and(context.dh, 0b00001111); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._cmp(context.ax, context.dx); - if (!context.flags.z()) goto nextcheck2; - context.ch = context.data.byte(context.bx+1); - context._and(context.ch, 15); -nextcheck2: - context._add(context.bx, 2); - context._sub(context.cl, 1); - if (!context.flags.z()) goto checkdestloop; - context.data.byte(478) = context.ch; - context.bx = context.pop(); +} + +static void afternewroom(Context & context) { + context._cmp(context.data.byte(186), 0); + if (context.flags.z()) goto notnew; + context.data.word(328) = 0; + createpanel(context); + context.data.byte(100) = 0; + findroominloc(context); + context._cmp(context.data.byte(63), 1); + if (context.flags.z()) goto ryansoff; + context.al = context.data.byte(151); + context._add(context.al, 12); + context.ah = context.data.byte(152); + context._add(context.ah, 12); + findpathofpoint(context); + context.data.byte(475) = context.dl; + findxyfrompath(context); + context.data.byte(187) = 1; +ryansoff: + context.data.byte(62) = 1; + drawfloor(context); + context.data.word(98) = 160; + context.data.byte(186) = 0; + showicon(context); + spriteupdate(context); + printsprites(context); + undertextline(context); + reelsonscreen(context); + mainscreen(context); + getunderzoom(context); + zoom(context); + worktoscreenm(context); + walkintoroom(context); + reminders(context); + atmospheres(context); +notnew: return; } -static inline void workoutframes(Context & context) { - context.bx = context.data.word(480); - context._add(context.bx, 32); - context.ax = context.data.word(484); - context._add(context.ax, 32); - context._sub(context.bx, context.ax); - if (!context.flags.c()) goto notneg1; - context._neg(context.bx); -notneg1: - context.cx = context.data.word(482); - context._add(context.cx, 32); - context.ax = context.data.word(486); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) goto notneg2; - context._neg(context.cx); -notneg2: - context._cmp(context.bx, context.cx); - if (!context.flags.c()) goto tendstohoriz; - context.dl = 2; - context.ax = context.cx; - context._shr(context.ax, 1); - context._cmp(context.bx, context.ax); - if (context.flags.c()) goto gotquad; - context.dl = 1; - goto gotquad; -tendstohoriz: - context.dl = 0; - context.ax = context.bx; - context._shr(context.ax, 1); - context._cmp(context.cx, context.ax); - if (context.flags.c()) goto gotquad; - context.dl = 1; - goto gotquad; -gotquad: - context.bx = context.data.word(480); - context._add(context.bx, 32); - context.ax = context.data.word(484); - context._add(context.ax, 32); - context._sub(context.bx, context.ax); - if (context.flags.c()) goto isinright; -isinleft: - context.cx = context.data.word(482); - context._add(context.cx, 32); - context.ax = context.data.word(486); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) goto topleft; - context._cmp(context.dl, 1); - if (context.flags.z()) goto noswap1; - context._xor(context.dl, 2); -noswap1: - context._add(context.dl, 4); - goto success; -topleft: - context._add(context.dl, 6); - goto success; -isinright: - context.cx = context.data.word(482); - context._add(context.cx, 32); - context.ax = context.data.word(486); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) goto botright; - context._add(context.dl, 2); - goto success; -botright: - context._cmp(context.dl, 1); - if (context.flags.z()) goto noswap2; - context._xor(context.dl, 2); -noswap2: -success: - context._and(context.dl, 7); - context.data.byte(135) = context.dl; - context.data.byte(136) = 0; +static void atmospheres(Context & context) { + context.cl = context.data.byte(148); + context.ch = context.data.byte(149); + context.bx = 5073; +nextatmos: + context.al = context.data.byte(context.bx); + context._cmp(context.al, 255); + if (context.flags.z()) goto nomoreatmos; + context._cmp(context.al, context.data.byte(184)); + if (!context.flags.z()) goto wrongatmos; + context.ax = context.data.word(context.bx+1); + context._cmp(context.ax, context.cx); + if (!context.flags.z()) goto wrongatmos; + context.ax = context.data.word(context.bx+3); + context._cmp(context.al, context.data.byte(507)); + if (context.flags.z()) goto playingalready; + context._cmp(context.data.byte(9), 45); + if (!context.flags.z()) goto notweb; + context._cmp(context.data.word(23), 45); + if (context.flags.z()) goto wrongatmos; +notweb: + playchannel0(context); + context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(149), 0); + if (context.flags.z()) goto fullvol; + if (!context.flags.z()) goto notlouisvol; + context._cmp(context.data.byte(149), 10); + if (!context.flags.z()) goto notlouisvol; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notlouisvol; + context.data.byte(386) = 5; +notlouisvol: +playingalready: + context._cmp(context.data.byte(184), 2); + if (!context.flags.z()) goto notlouisvol2; + context._cmp(context.data.byte(148), 22); + if (context.flags.z()) goto louisvol; + context._cmp(context.data.byte(148), 11); + if (!context.flags.z()) goto notlouisvol2; +fullvol: + context.data.byte(386) = 0; +notlouisvol2: + return; +louisvol: + context.data.byte(386) = 5; + return; +wrongatmos: + context._add(context.bx, 5); + goto nextatmos; +nomoreatmos: + cancelch0(context); return; } -static inline void bresenhams(Context & context) { - workoutframes(context); - context.dx = context.ds; - context.es = context.dx; - context.di = 8344; - context.si = 1; - context.data.byte(493) = 0; - context.cx = context.data.word(484); - context._sub(context.cx, context.data.word(480)); - if (context.flags.z()) goto vertline; - if (!context.flags.s()) goto line1; - context._neg(context.cx); - context.bx = context.data.word(484); - context._xchg(context.bx, context.data.word(480)); - context.data.word(484) = context.bx; - context.bx = context.data.word(486); - context._xchg(context.bx, context.data.word(482)); - context.data.word(486) = context.bx; - context.data.byte(493) = 1; -line1: - context.bx = context.data.word(486); - context._sub(context.bx, context.data.word(482)); - if (context.flags.z()) goto horizline; - if (!context.flags.s()) goto line3; - context._neg(context.bx); - context._neg(context.si); -line3: - context.push(context.si); - context.data.byte(491) = 0; - context._cmp(context.bx, context.cx); - if (context.flags.le()) goto line4; - context.data.byte(491) = 1; - context._xchg(context.bx, context.cx); -line4: - context._shl(context.bx, 1); - context.data.word(488) = context.bx; - context._sub(context.bx, context.cx); - context.si = context.bx; - context._sub(context.bx, context.cx); - context.data.word(490) = context.bx; - context.ax = context.data.word(480); - context.bx = context.data.word(482); - context.ah = context.bl; - context._add(context.cx, 1); - context.bx = context.pop(); - context._cmp(context.data.byte(491), 1); - if (context.flags.z()) goto hislope; - goto loslope; -vertline: - context.ax = context.data.word(482); - context.bx = context.data.word(486); - context.cx = context.bx; - context._sub(context.cx, context.ax); - if (!context.flags.ge()) goto line31; - context._neg(context.cx); - context.ax = context.bx; - context.data.byte(493) = 1; -line31: - context._add(context.cx, 1); - context.bx = context.data.word(480); - context._xchg(context.ax, context.bx); - context.ah = context.bl; - context.bx = context.si; -line32: - context._stosw(); - context._add(context.ah, context.bl); - if (--context.cx) goto line32; - goto lineexit; -horizline: - context.ax = context.data.word(480); - context.bx = context.data.word(482); - context.ah = context.bl; - context._add(context.cx, 1); -horizloop: - context._stosw(); - context._add(context.al, 1); - if (--context.cx) goto horizloop; - goto lineexit; -loslope: -loloop: - context._stosw(); - context._add(context.al, 1); - context._or(context.si, context.si); - if (!context.flags.s()) goto line12; - context._add(context.si, context.data.word(488)); - if (--context.cx) goto loloop; - goto lineexit; -line12: - context._add(context.si, context.data.word(490)); - context._add(context.ah, context.bl); - if (--context.cx) goto loloop; - goto lineexit; -hislope: -hiloop: - context._stosw(); - context._add(context.ah, context.bl); - context._or(context.si, context.si); - if (!context.flags.s()) goto line23; - context._add(context.si, context.data.word(488)); - if (--context.cx) goto hiloop; - goto lineexit; -line23: - context._add(context.si, context.data.word(490)); - context._add(context.al, 1); - if (--context.cx) goto hiloop; -lineexit: - context._sub(context.di, 8344); - context.ax = context.di; - context._shr(context.ax, 1); - context.data.byte(494) = context.al; +static void walkintoroom(Context & context) { + context._cmp(context.data.byte(9), 14); + if (!context.flags.z()) goto notlair; + context._cmp(context.data.byte(148), 22); + if (!context.flags.z()) goto notlair; + context.data.byte(478) = 1; + context.data.byte(477) = 1; + autosetwalk(context); +notlair: return; } -static inline void autosetwalk(Context & context) { - context.al = context.data.byte(475); - context._cmp(context.data.byte(477), context.al); - if (!context.flags.z()) goto notsamealready; - return; -notsamealready: - getroomspaths(context); - checkdest(context); - context.push(context.bx); - context.al = context.data.byte(475); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(480) = context.ax; - context.al = context.data.byte(context.bx+1); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(482) = context.ax; - context.bx = context.pop(); - context.al = context.data.byte(478); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(484) = context.ax; - context.al = context.data.byte(context.bx+1); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(486) = context.ax; - bresenhams(context); - context._cmp(context.data.byte(493), 0); - if (context.flags.z()) goto normalline; - context.al = context.data.byte(494); - context._sub(context.al, 1); - context.data.byte(492) = context.al; - context.data.byte(493) = 1; - return; -normalline: - context.data.byte(492) = 0; +static void afterintroroom(Context & context) { + context._cmp(context.data.byte(186), 0); + if (context.flags.z()) goto notnewintro; + clearwork(context); + findroominloc(context); + context.data.byte(62) = 1; + drawfloor(context); + reelsonscreen(context); + spriteupdate(context); + printsprites(context); + worktoscreen(context); + context.data.byte(186) = 0; +notnewintro: return; } -static inline void watchreel(Context & context) { - context._cmp(context.data.word(23), -1); - if (context.flags.z()) goto notplayingreel; - context.al = context.data.byte(475); - context._cmp(context.al, context.data.byte(477)); - if (!context.flags.z()) goto waitstopwalk; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); - if (context.flags.z()) goto notwatchpath; -waitstopwalk: +static void obname(Context & context) { + context._cmp(context.data.byte(473), 0); + if (context.flags.z()) goto notnewpath; + context.data.byte(473) = 0; + goto diff; +notnewpath: + context._cmp(context.ah, context.data.byte(100)); + if (context.flags.z()) goto notdiffob; + goto diff; +notdiffob: + context._cmp(context.al, context.data.byte(99)); + if (!context.flags.z()) goto diff; + context._cmp(context.data.byte(306), 1); + if (context.flags.z()) goto walkandexamine; + context._cmp(context.data.word(202), 0); + if (context.flags.z()) goto noobselect; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto isntblock; + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto noobselect; +isntblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto wantstowalk; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto wantstowalk; + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto wantstotalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto noobselect; + examineob(context); return; -notwatchpath: - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); - if (!context.flags.z()) goto showwatchreel; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context.ax = context.data.word(23); - context._cmp(context.ax, context.data.word(25)); - if (!context.flags.z()) goto ismorereel; +wantstotalk: context._cmp(context.data.word(21), 0); - if (!context.flags.z()) goto showwatchreel; - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.word(29), -1); - if (context.flags.z()) goto nomorereel; - context.data.byte(32) = 1; - goto notplayingreel; -ismorereel: - context._add(context.data.word(23), 1); -showwatchreel: - context.ax = context.data.word(23); - context.data.word(239) = context.ax; - plotreel(context); - context.ax = context.data.word(239); - context.data.word(23) = context.ax; - checkforshake(context); -nomorereel: + if (!context.flags.z()) goto noobselect; + talk(context); return; -notplayingreel: - context._cmp(context.data.byte(32), 1); - if (!context.flags.z()) goto notholdingreel; - context.ax = context.data.word(29); - context.data.word(239) = context.ax; - plotreel(context); +walkandexamine: + finishedwalking(context); + if (!context.flags.z()) goto noobselect; + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto noobselect; + examineob(context); return; -notholdingreel: - context._cmp(context.data.byte(32), 2); - if (!context.flags.z()) goto notreleasehold; - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); - if (!context.flags.z()) goto notlastspeed2; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context._add(context.data.word(29), 1); -notlastspeed2: - context.ax = context.data.word(29); - context._cmp(context.ax, context.data.word(31)); - if (!context.flags.z()) goto ismorereel2; - context.data.word(29) = -1; - context.data.byte(32) = -1; - context.al = context.data.byte(33); - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; - autosetwalk(context); +wantstowalk: + setwalk(context); + context.data.byte(473) = 1; +noobselect: return; -ismorereel2: - context.ax = context.data.word(29); - context.data.word(239) = context.ax; - plotreel(context); +diff: + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; +diff2: + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.word(21), 0); + if (!context.flags.z()) goto middleofwalk; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); + if (!context.flags.z()) goto middleofwalk; + context._cmp(context.data.byte(100), 3); + if (!context.flags.z()) goto notblock; + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto dontcheck; + context.cl = context.data.byte(151); + context._add(context.cl, 12); + context.ch = context.data.byte(152); + context._add(context.ch, 12); + checkone(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto isblock; +dontcheck: + getflagunderp(context); + context._cmp(context.data.byte(153), 2); + if (context.flags.c()) goto isblock; + context._cmp(context.data.byte(153), 128); + if (!context.flags.c()) goto isblock; + goto toofaraway; +notblock: + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); + if (!context.flags.z()) goto toofaraway; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto isblock; + context._cmp(context.data.byte(100), 5); + if (context.flags.z()) goto isaperson; + examineobtext(context); return; -notreleasehold: +middleofwalk: + blocknametext(context); + return; +isblock: + blocknametext(context); + return; +isaperson: + personnametext(context); + return; +toofaraway: + walktotext(context); + return; +} + +static void finishedwalking(Context & context) { + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto iswalking; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); +iswalking: + return; +} + +static void examineobtext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 1; + commandwithob(context); + return; +} + +static void commandwithob(Context & context) { + context.push(context.ax); + context.push(context.ax); + context.push(context.bx); + context.push(context.cx); + context.push(context.dx); + context.push(context.es); + context.push(context.ds); + context.push(context.si); + context.push(context.di); + deltextline(context); + context.di = context.pop(); + context.si = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.push(context.bx); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.ax = context.pop(); + context.di = 5674; + copyname(context); + context.ax = context.pop(); + context.di = context.data.word(84); + context._cmp(context.al, 0); + if (context.flags.z()) goto noadd; + context._add(context.di, 5); +noadd: + context.bx = context.data.word(81); + context.es = context.cs; + context.si = 5674; + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(109) = 1; return; } -static inline void randomnum1(Context & context) { - context.push(context.ds); - context.push(context.es); - context.push(context.di); +static void commandonly(Context & context) { + context.push(context.ax); context.push(context.bx); context.push(context.cx); - randomnumber(context); - context.cx = context.pop(); - context.bx = context.pop(); + context.push(context.dx); + context.push(context.es); + context.push(context.ds); + context.push(context.si); + context.push(context.di); + deltextline(context); context.di = context.pop(); - context.es = context.pop(); + context.si = context.pop(); context.ds = context.pop(); + context.es = context.pop(); + context.dx = context.pop(); + context.cx = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.ah = 0; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); + context.al = 0; + context.ah = 0; + printdirect(context); + context.data.byte(109) = 1; return; } -static inline void playchannel1(Context & context) { - context._cmp(context.data.byte(378), 255); - if (context.flags.z()) goto dontbother5; - context._cmp(context.data.byte(515), 7); - if (context.flags.z()) goto dontbother5; - context.push(context.es); - context.push(context.ds); +static void printmessage(Context & context) { + context.push(context.dx); context.push(context.bx); - context.push(context.cx); context.push(context.di); - context.push(context.si); - context.data.byte(515) = context.al; - context.es = context.data.word(420); - context._cmp(context.al, 12); - if (context.flags.c()) goto notsecondbank1; - context.es = context.data.word(422); - context._sub(context.al, 12); -notsecondbank1: context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ah = 0; - context.data.word(517) = context.ax; - context.ax = context.data.word(context.bx+1); - context.data.word(519) = context.ax; - context.ax = context.data.word(context.bx+3); - context.data.word(521) = context.ax; - context.si = context.pop(); + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; context.di = context.pop(); - context.cx = context.pop(); context.bx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); -dontbother5: + context.dx = context.pop(); + context.al = 0; + context.ah = 0; + printdirect(context); return; } -static inline void showrain(Context & context) { - context.ds = context.data.word(414); - context.si = 6*58; - context.ax = context.data.word(context.si+2); - context.si = context.ax; - context._add(context.si, 2080); - context.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); - context.es = context.data.word(412); - context._cmp(context.data.byte(context.bx), 255); - if (context.flags.z()) goto nothunder; -morerain: - context.es = context.data.word(412); - context._cmp(context.data.byte(context.bx), 255); - if (context.flags.z()) goto finishrain; - context.al = context.data.byte(context.bx+1); +static void printmessage2(Context & context) { + context.push(context.dx); + context.push(context.bx); + context.push(context.di); + context.push(context.ax); context.ah = 0; - context._add(context.ax, context.data.word(119)); - context._add(context.ax, context.data.word(127)); - context.cx = 320; - context._mul(context.cx); - context.cl = context.data.byte(context.bx); - context.ch = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(117)); - context._add(context.ax, context.data.word(125)); - context.di = context.ax; - context.cl = context.data.byte(context.bx+2); - context.ch = 0; - context.ax = context.data.word(context.bx+3); - context.dl = context.data.byte(context.bx+5); - context.dh = 0; - context._sub(context.ax, context.dx); - context._and(context.ax, 511); - context.data.word(context.bx+3) = context.ax; - context._add(context.bx, 6); - context.push(context.si); - context._add(context.si, context.ax); - context.es = context.data.word(400); + context._add(context.ax, context.ax); + context.bx = context.ax; + context.es = context.data.word(452); + context.ax = context.data.word(context.bx); + context._add(context.ax, 66*2); + context.si = context.ax; + context.ax = context.pop(); +searchmess: + context.push(context.ax); + findnextcolon(context); + context.ax = context.pop(); + context._sub(context.ah, 1); + if (!context.flags.z()) goto searchmess; + context.di = context.pop(); + context.bx = context.pop(); + context.dx = context.pop(); + context.al = 0; context.ah = 0; - context.dx = 320-2; -rainloop: - context._lodsb(); - context._cmp(context.al, context.ah); - if (context.flags.z()) goto noplot; - context._stosb(); - context._add(context.di, context.dx); - if (--context.cx) goto rainloop; - context.si = context.pop(); - goto morerain; -noplot: - context._add(context.di, 320-1); - if (--context.cx) goto rainloop; - context.si = context.pop(); - goto morerain; -finishrain: - context._cmp(context.data.word(521), 0); - if (!context.flags.z()) goto nothunder; - context._cmp(context.data.byte(184), 2); - if (!context.flags.z()) goto notlouisthund; - context._cmp(context.data.byte(45), 1); - if (!context.flags.z()) goto nothunder; -notlouisthund: - context._cmp(context.data.byte(184), 55); - if (context.flags.z()) goto nothunder; - randomnum1(context); - context._cmp(context.al, 1); - if (!context.flags.c()) goto nothunder; - context.al = 7; - context._cmp(context.data.byte(507), 6); - if (context.flags.z()) goto isthunder1; - context.al = 4; -isthunder1: - playchannel1(context); -nothunder: + printdirect(context); return; } -static inline void reelsonscreen(Context & context) { - reconstruct(context); - updatepeople(context); - watchreel(context); - showrain(context); - usetimedtext(context); +static void blocknametext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 0; + commandwithob(context); return; } -static inline void clearwork(Context & context) { - context.ax = 0x0; - context.es = context.data.word(400); - context.di = 0; - context.cx = (200*320)/64; -clearloop: - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - if (--context.cx) goto clearloop; +static void personnametext(Context & context) { + context.bl = context.data.byte(99); + context._and(context.bl, 127); + context.bh = context.data.byte(100); + context.al = 2; + commandwithob(context); return; } -static inline void findroominloc(Context & context) { - context.al = context.data.byte(149); - context.cx = -6; -looky: - context._add(context.cx, 6); - context._sub(context.al, 10); - if (!context.flags.c()) goto looky; - context.al = context.data.byte(148); - context._sub(context.cx, 1); -lookx: - context._add(context.cx, 1); - context._sub(context.al, 11); - if (!context.flags.c()) goto lookx; - context.data.byte(185) = context.cl; +static void walktotext(Context & context) { + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); + context.al = 3; + commandwithob(context); return; } -static inline void eraseoldobs(Context & context) { - context._cmp(context.data.byte(62), 0); - if (context.flags.z()) goto donterase; - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.cx = 16; -oberase: - context.push(context.cx); - context.push(context.bx); - context.ax = context.data.word(context.bx+20); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto notthisob; - context.di = context.bx; - context.al = 255; - context.cx = 32; - while(--context.cx) context._stosb(); -notthisob: - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 32); - if (--context.cx) goto oberase; -donterase: +static void getflagunderp(Context & context) { + context.cx = context.data.word(198); + context._sub(context.cx, context.data.word(117)); + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); + context.ch = context.al; + checkone(context); + context.data.byte(153) = context.cl; + context.data.byte(154) = context.ch; return; } -static inline void drawflags(Context & context) { - context.es = context.data.word(412); - context.di = 0+(228*13)+32+60+(32*32); - context.al = context.data.byte(149); +static void setwalk(Context & context) { + context._cmp(context.data.byte(492), 254); + if (!context.flags.z()) goto alreadywalking; + context.al = context.data.byte(474); + context._cmp(context.al, context.data.byte(475)); + if (context.flags.z()) goto cantwalk2; + context._cmp(context.data.byte(32), 1); + if (context.flags.z()) goto holdingreel; + context._cmp(context.data.byte(32), 2); + if (context.flags.z()) goto cantwalk; + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + context._cmp(context.data.word(202), 2); + if (!context.flags.z()) goto notwalkandexam; + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto notwalkandexam; + context.data.byte(306) = 1; + context.al = context.data.byte(100); + context.data.byte(307) = context.al; + context.al = context.data.byte(99); + context.data.byte(308) = context.al; +notwalkandexam: + autosetwalk(context); +cantwalk: + return; +cantwalk2: + facerightway(context); + return; +alreadywalking: + context.al = context.data.byte(474); + context.data.byte(477) = context.al; + return; +holdingreel: + context.data.byte(33) = context.al; + context.data.byte(32) = 2; + return; +} + +static void autosetwalk(Context & context) { + context.al = context.data.byte(475); + context._cmp(context.data.byte(477), context.al); + if (!context.flags.z()) goto notsamealready; + return; +notsamealready: + getroomspaths(context); + checkdest(context); + context.push(context.bx); + context.al = context.data.byte(475); context.ah = 0; - context.cx = 66; - context._mul(context.cx); - context.bl = context.data.byte(148); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = 0; - context._add(context.si, context.ax); - context.cx = 10; -_tmp28: - context.push(context.cx); - context.cx = 11; -_tmp28a: - context.ds = context.data.word(418); - context._lodsb(); - context.ds = context.data.word(416); - context.push(context.si); - context.push(context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(480) = context.ax; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(482) = context.ax; + context.bx = context.pop(); + context.al = context.data.byte(478); context.ah = 0; context._add(context.ax, context.ax); - context.si = 0; - context._add(context.si, context.ax); - context._movsw(); - context.ax = context.pop(); - context._stosb(); - context.si = context.pop(); - if (--context.cx) goto _tmp28a; - context._add(context.si, 66-11); - context.cx = context.pop(); - if (--context.cx) goto _tmp28; + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(484) = context.ax; + context.al = context.data.byte(context.bx+1); + context.ah = 0; + context._sub(context.ax, 12); + context.data.word(486) = context.ax; + bresenhams(context); + context._cmp(context.data.byte(493), 0); + if (context.flags.z()) goto normalline; + context.al = context.data.byte(494); + context._sub(context.al, 1); + context.data.byte(492) = context.al; + context.data.byte(493) = 1; + return; +normalline: + context.data.byte(492) = 0; return; } -static inline void addalong(Context & context) { - context.ah = 11; -addloop: - context._cmp(context.data.byte(context.bx), 0); - if (!context.flags.z()) goto gotalong; - context._add(context.bx, 3); - context._sub(context.ah, 1); - if (!context.flags.z()) goto addloop; - context.al = 0; +static void checkdest(Context & context) { + context.push(context.bx); + context._add(context.bx, 12*8); + context.ah = context.data.byte(475); + context.cl = 4; + context._shl(context.ah, context.cl); + context.al = context.data.byte(478); + context.cl = 24; + context.ch = context.data.byte(478); +checkdestloop: + context.dh = context.data.byte(context.bx); + context._and(context.dh, 0xf0); + context.dl = context.data.byte(context.bx); + context._and(context.dl, 0xf); + context._cmp(context.ax, context.dx); + if (!context.flags.z()) goto nextcheck; + context.al = context.data.byte(context.bx+1); + context._and(context.al, 15); + context.data.byte(478) = context.al; + context.bx = context.pop(); return; -gotalong: - context.al = 1; +nextcheck: + context.dl = context.data.byte(context.bx); + context._and(context.dl, 0xf0); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context._shr(context.dl, 1); + context.dh = context.data.byte(context.bx); + context._and(context.dh, 0xf); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._shl(context.dh, 1); + context._cmp(context.ax, context.dx); + if (!context.flags.z()) goto nextcheck2; + context.ch = context.data.byte(context.bx+1); + context._and(context.ch, 15); +nextcheck2: + context._add(context.bx, 2); + context._sub(context.cl, 1); + if (!context.flags.z()) goto checkdestloop; + context.data.byte(478) = context.ch; + context.bx = context.pop(); + return; +} + +static void bresenhams(Context & context) { + workoutframes(context); + context.dx = context.ds; + context.es = context.dx; + context.di = 8344; + context.si = 1; + context.data.byte(493) = 0; + context.cx = context.data.word(484); + context._sub(context.cx, context.data.word(480)); + if (context.flags.z()) goto vertline; + if (!context.flags.s()) goto line1; + context._neg(context.cx); + context.bx = context.data.word(484); + context._xchg(context.bx, context.data.word(480)); + context.data.word(484) = context.bx; + context.bx = context.data.word(486); + context._xchg(context.bx, context.data.word(482)); + context.data.word(486) = context.bx; + context.data.byte(493) = 1; +line1: + context.bx = context.data.word(486); + context._sub(context.bx, context.data.word(482)); + if (context.flags.z()) goto horizline; + if (!context.flags.s()) goto line3; + context._neg(context.bx); + context._neg(context.si); +line3: + context.push(context.si); + context.data.byte(491) = 0; + context._cmp(context.bx, context.cx); + if (context.flags.le()) goto line4; + context.data.byte(491) = 1; + context._xchg(context.bx, context.cx); +line4: + context._shl(context.bx, 1); + context.data.word(488) = context.bx; + context._sub(context.bx, context.cx); + context.si = context.bx; + context._sub(context.bx, context.cx); + context.data.word(490) = context.bx; + context.ax = context.data.word(480); + context.bx = context.data.word(482); + context.ah = context.bl; + context._add(context.cx, 1); + context.bx = context.pop(); + context._cmp(context.data.byte(491), 1); + if (context.flags.z()) goto hislope; + goto loslope; +vertline: + context.ax = context.data.word(482); + context.bx = context.data.word(486); + context.cx = context.bx; + context._sub(context.cx, context.ax); + if (!context.flags.ge()) goto line31; + context._neg(context.cx); + context.ax = context.bx; + context.data.byte(493) = 1; +line31: + context._add(context.cx, 1); + context.bx = context.data.word(480); + context._xchg(context.ax, context.bx); + context.ah = context.bl; + context.bx = context.si; +line32: + context._stosw(); + context._add(context.ah, context.bl); + if (--context.cx) goto line32; + goto lineexit; +horizline: + context.ax = context.data.word(480); + context.bx = context.data.word(482); + context.ah = context.bl; + context._add(context.cx, 1); +horizloop: + context._stosw(); + context._add(context.al, 1); + if (--context.cx) goto horizloop; + goto lineexit; +loslope: +loloop: + context._stosw(); + context._add(context.al, 1); + context._or(context.si, context.si); + if (!context.flags.s()) goto line12; + context._add(context.si, context.data.word(488)); + if (--context.cx) goto loloop; + goto lineexit; +line12: + context._add(context.si, context.data.word(490)); + context._add(context.ah, context.bl); + if (--context.cx) goto loloop; + goto lineexit; +hislope: +hiloop: + context._stosw(); + context._add(context.ah, context.bl); + context._or(context.si, context.si); + if (!context.flags.s()) goto line23; + context._add(context.si, context.data.word(488)); + if (--context.cx) goto hiloop; + goto lineexit; +line23: + context._add(context.si, context.data.word(490)); + context._add(context.al, 1); + if (--context.cx) goto hiloop; +lineexit: + context._sub(context.di, 8344); + context.ax = context.di; + context._shr(context.ax, 1); + context.data.byte(494) = context.al; return; } -static inline void addlength(Context & context) { - context.ah = 10; -addloop2: - context._cmp(context.data.byte(context.bx), 0); - if (!context.flags.z()) goto gotlength; - context._add(context.bx, 3*11); - context._sub(context.ah, 1); - if (!context.flags.z()) goto addloop2; - context.al = 0; - return; -gotlength: - context.al = 1; +static void workoutframes(Context & context) { + context.bx = context.data.word(480); + context._add(context.bx, 32); + context.ax = context.data.word(484); + context._add(context.ax, 32); + context._sub(context.bx, context.ax); + if (!context.flags.c()) goto notneg1; + context._neg(context.bx); +notneg1: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto notneg2; + context._neg(context.cx); +notneg2: + context._cmp(context.bx, context.cx); + if (!context.flags.c()) goto tendstohoriz; + context.dl = 2; + context.ax = context.cx; + context._shr(context.ax, 1); + context._cmp(context.bx, context.ax); + if (context.flags.c()) goto gotquad; + context.dl = 1; + goto gotquad; +tendstohoriz: + context.dl = 0; + context.ax = context.bx; + context._shr(context.ax, 1); + context._cmp(context.cx, context.ax); + if (context.flags.c()) goto gotquad; + context.dl = 1; + goto gotquad; +gotquad: + context.bx = context.data.word(480); + context._add(context.bx, 32); + context.ax = context.data.word(484); + context._add(context.ax, 32); + context._sub(context.bx, context.ax); + if (context.flags.c()) goto isinright; +isinleft: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto topleft; + context._cmp(context.dl, 1); + if (context.flags.z()) goto noswap1; + context._xor(context.dl, 2); +noswap1: + context._add(context.dl, 4); + goto success; +topleft: + context._add(context.dl, 6); + goto success; +isinright: + context.cx = context.data.word(482); + context._add(context.cx, 32); + context.ax = context.data.word(486); + context._add(context.ax, 32); + context._sub(context.cx, context.ax); + if (!context.flags.c()) goto botright; + context._add(context.dl, 2); + goto success; +botright: + context._cmp(context.dl, 1); + if (context.flags.z()) goto noswap2; + context._xor(context.dl, 2); +noswap2: +success: + context._and(context.dl, 7); + context.data.byte(135) = context.dl; + context.data.byte(136) = 0; return; } -static inline void getdimension(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32); - context.ch = 0; -dimloop1: - addalong(context); - context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim1; - context._add(context.ch, 1); - goto dimloop1; -finishdim1: - context.bx = 0+(228*13)+32+60+(32*32); - context.cl = 0; -dimloop2: - context.push(context.bx); - addlength(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim2; - context._add(context.cl, 1); - context._add(context.bx, 3); - goto dimloop2; -finishdim2: - context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9); - context.dh = 10; -dimloop3: - context.push(context.bx); - addalong(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim3; - context._sub(context.dh, 1); - context._sub(context.bx, 11*3); - goto dimloop3; -finishdim3: - context.bx = 0+(228*13)+32+60+(32*32)+(3*10); - context.dl = 11; -dimloop4: - context.push(context.bx); - addlength(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim4; - context._sub(context.dl, 1); - context._sub(context.bx, 3); - goto dimloop4; -finishdim4: - context.al = context.cl; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.word(125) = context.ax; - context.al = context.ch; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.word(127) = context.ax; - context._sub(context.dl, context.cl); - context._sub(context.dh, context.ch); - context.al = context.dl; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.byte(128) = context.al; - context.al = context.dh; +static void getroomspaths(Context & context) { + context.al = context.data.byte(185); context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.byte(129) = context.al; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; + context._add(context.bx, context.ax); return; } -static inline void calcmapad(Context & context) { - getdimension(context); - context.push(context.cx); - context.push(context.dx); - context.al = 11; - context._sub(context.al, context.dl); - context._sub(context.al, context.cl); - context._sub(context.al, context.cl); - context.ax.cbw(); - context.bx = 8; - context._mul(context.bx); - context._add(context.ax, context.data.word(121)); - context.data.word(117) = context.ax; - context.dx = context.pop(); - context.cx = context.pop(); - context.al = 10; - context._sub(context.al, context.dh); - context._sub(context.al, context.ch); - context._sub(context.al, context.ch); - context.ax.cbw(); - context.bx = 8; - context._mul(context.bx); - context._add(context.ax, context.data.word(123)); - context.data.word(119) = context.ax; +static void copyname(Context & context) { + context.push(context.di); + findobname(context); + context.di = context.pop(); + context.es = context.cs; +copytext: + context.cx = 28; +make: + context._lodsb(); + context._cmp(context.al, ':'); + if (context.flags.z()) goto finishmakename; + context._cmp(context.al, 0); + if (context.flags.z()) goto finishmakename; + context._stosb(); + if (--context.cx) goto make; +finishmakename: + context._add(context.cx, 1); + context.al = 0; + context._stosb(); + return; + context.al = 255; + while(--context.cx) context._stosb(); return; } -static inline void doblocks(Context & context) { - context.es = context.data.word(400); - context.ax = context.data.word(119); - context.cx = 320; - context._mul(context.cx); - context.di = context.data.word(117); - context._add(context.di, context.ax); - context.al = context.data.byte(149); +static void findobname(Context & context) { + context.push(context.ax); context.ah = 0; - context.bx = 66; + context._add(context.ax, context.ax); + context.bx = context.ax; + context.ax = context.pop(); + context._cmp(context.ah, 5); + if (!context.flags.z()) goto notpersonname; + context.push(context.ax); + context._and(context.al, 127); + context.ah = 0; + context.bx = 64*2; context._mul(context.bx); - context.bl = context.data.byte(148); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = 0; - context._add(context.si, context.ax); - context.cx = 10; -loop120: - context.push(context.di); - context.push(context.cx); - context.cx = 11; -loop124: - context.push(context.cx); - context.push(context.di); - context.ds = context.data.word(418); - context._lodsb(); - context.ds = context.data.word(416); - context.push(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) goto zeroblock; - context.ah = context.al; - context.al = 0; - context.si = 0+192; - context._add(context.si, context.ax); - context.bh = 14; - context.bh = 4; -firstbitofblock: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._add(context.di, 320-16); - context._sub(context.bh, 1); - if (!context.flags.z()) goto firstbitofblock; - context.bh = 12; -loop125: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context.ax = 0x0dfdf; - context._stosw(); - context._stosw(); - context._add(context.di, 320-20); - context._sub(context.bh, 1); - if (!context.flags.z()) goto loop125; - context._add(context.di, 4); - context.ax = 0x0dfdf; - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._add(context.di, 320-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._add(context.di, 320-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._add(context.di, 320-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); -zeroblock: - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, 16); - if (--context.cx) goto loop124; - context._add(context.si, 66-11); - context.cx = context.pop(); - context.di = context.pop(); - context._add(context.di, 320*16); - if (--context.cx) goto loop120; + context.si = context.ax; + context.ds = context.data.word(448); + context._add(context.si, 0+24); + context.cx = 0+24+(1026*2); + context.ax = context.data.word(context.si); + context._add(context.ax, context.cx); + context.si = context.ax; + context.ax = context.pop(); + return; +notpersonname: + context._cmp(context.ah, 4); + if (!context.flags.z()) goto notextraname; + context.ds = context.data.word(398); + context._add(context.bx, 0+2080+30000+(16*114)); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); + context.si = context.ax; + return; +notextraname: + context._cmp(context.ah, 2); + if (!context.flags.z()) goto notfreename; + context.ds = context.data.word(438); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(82*2)); + context.si = context.ax; + return; +notfreename: + context._cmp(context.ah, 1); + if (!context.flags.z()) goto notsetname; + context.ds = context.data.word(440); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(130*2)); + context.si = context.ax; + return; +notsetname: + context.ds = context.data.word(442); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(98*2)); + context.si = context.ax; return; } -static inline void makesprite(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; -_tmp17: - context._cmp(context.data.byte(context.bx+15), 255); - if (context.flags.z()) goto _tmp17a; - context._add(context.bx, 32); - goto _tmp17; -_tmp17a: - context.data.word(context.bx) = context.cx; - context.data.word(context.bx+10) = context.si; - context.data.word(context.bx+6) = context.dx; - context.data.word(context.bx+8) = context.di; - context.data.word(context.bx+2) = 0x0ffff; - context.data.byte(context.bx+15) = 0; - context.data.byte(context.bx+18) = 0; +static void showicon(Context & context) { + context._cmp(context.data.byte(184), 50); + if (!context.flags.c()) goto isdream1; + showpanel(context); + showman(context); + roomname(context); + panelicons1(context); + zoomicon(context); + return; +isdream1: + context.ds = context.data.word(464); + context.di = 72; + context.bx = 2; + context.al = 45; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 72+47; + context.bx = 2; + context.al = 46; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 69-10; + context.bx = 21; + context.al = 49; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+88; + context.bx = 2; + context.al = 45; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+43; + context.bx = 2; + context.al = 46; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+101; + context.bx = 21; + context.al = 49; + context.ah = 4; + showframe(context); + middlepanel(context); + return; +} + +static void middlepanel(Context & context) { + context.ds = context.data.word(464); + context.di = 72+47+20; + context.bx = 0; + context.al = 48; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 72+19; + context.bx = 21; + context.al = 47; + context.ah = 0; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+23; + context.bx = 0; + context.al = 48; + context.ah = 4; + showframe(context); + context.ds = context.data.word(464); + context.di = 160+71; + context.bx = 21; + context.al = 47; + context.ah = 4; + showframe(context); return; } -static inline void makebackob(Context & context) { - context._cmp(context.data.byte(62), 0); - if (context.flags.z()) goto nomake; - context.al = context.data.byte(context.si+5); - context.ah = context.data.byte(context.si+8); - context.push(context.si); - context.push(context.ax); - context.push(context.si); - context.ax = context.data.word(168); - context.bx = context.data.word(170); - context.ah = context.bl; - context.si = context.ax; - context.cx = 49520; - context.dx = context.data.word(444); +static void showman(Context & context) { + context.ds = context.data.word(408); context.di = 0; - makesprite(context); - context.ax = context.pop(); - context.data.word(context.bx+20) = context.ax; - context.ax = context.pop(); - context._cmp(context.al, 255); - if (!context.flags.z()) goto usedpriority; + context.bx = 0; context.al = 0; -usedpriority: - context.data.byte(context.bx+23) = context.al; - context.data.byte(context.bx+30) = context.ah; - context.data.byte(context.bx+16) = 0; - context.data.byte(context.bx+18) = 0; - context.data.byte(context.bx+19) = 0; - context.si = context.pop(); -nomake: + context.ah = 0; + showframe(context); + context.ds = context.data.word(408); + context.di = 0; + context.bx = 114; + context.al = 1; + context.ah = 0; + showframe(context); + context._cmp(context.data.byte(4), 0); + if (context.flags.z()) goto notverycool; + context.ds = context.data.word(408); + context.di = 28; + context.bx = 25; + context.al = 2; + context.ah = 0; + showframe(context); +notverycool: return; } -static inline void showallobs(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); - context.data.word(18) = context.bx; - context.di = context.bx; - context.cx = 128*5; - context.al = 255; - while(--context.cx) context._stosb(); - context.es = context.data.word(444); - context.data.word(166) = context.es; - context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; - context.data.word(162) = context.ax; - context.data.byte(181) = 0; - context.ds = context.data.word(428); - context.si = 0; - context.cx = 128; -showobsloop: - context.push(context.cx); - context.push(context.si); - context.push(context.si); - context._add(context.si, 58); - context.es = context.data.word(428); - getmapad(context); - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) goto blankframe; - context.al = context.data.byte(context.si+18); +static void showpanel(Context & context) { + context.ds = context.data.word(408); + context.di = 72; + context.bx = 0; + context.al = 19; context.ah = 0; - context.data.word(160) = context.ax; - context._cmp(context.al, 255); - if (context.flags.z()) goto blankframe; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.al = context.data.byte(context.si+18); - context.data.byte(context.si+17) = context.al; - context._cmp(context.data.byte(context.si+8), 0); - if (!context.flags.z()) goto animating; - context._cmp(context.data.byte(context.si+5), 5); - if (context.flags.z()) goto animating; - context._cmp(context.data.byte(context.si+5), 6); - if (context.flags.z()) goto animating; - context.ax = context.data.word(160); + showframe(context); + context.ds = context.data.word(408); + context.di = 192; + context.bx = 0; + context.al = 19; context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); showframe(context); - goto drawnsetob; -animating: - makebackob(context); -drawnsetob: - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(176); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; - context.al = context.data.byte(181); - context.data.byte(context.si+4) = context.al; - context._add(context.si, 5); - context.data.word(18) = context.si; -blankframe: - context._add(context.data.byte(181), 1); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 64); - context._sub(context.cx, 1); - if (context.flags.z()) goto finishedsetobs; - goto showobsloop; -finishedsetobs: return; } -static inline void showallfree(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.data.word(18) = context.bx; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.cx = 80*5; - context.al = 255; - while(--context.cx) context._stosb(); - context.es = context.data.word(446); - context.data.word(166) = context.es; - context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; - context.data.word(162) = context.ax; +static void roomname(Context & context) { + context.di = 88; + context.bx = 18; + context.al = 53; + context.dl = 240; + printmessage(context); + context.bl = context.data.byte(185); + context._cmp(context.bl, 32); + if (context.flags.c()) goto notover32; + context._sub(context.bl, 32); +notover32: + context.bh = 0; + context._add(context.bx, context.bx); + context.es = context.data.word(436); + context._add(context.bx, 0); + context.ax = context.data.word(context.bx); + context._add(context.ax, 0+(38*2)); + context.si = context.ax; + context.data.word(77) = 7; + context.di = 88; + context.bx = 25; + context.dl = 120; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto gotpl; + context.dl = 160; +gotpl: context.al = 0; - context.data.byte(158) = context.al; - context.ds = context.data.word(426); - context.si = 2; - context.cx = 0; -loop127: - context.push(context.cx); - context.push(context.si); - context.push(context.si); - context.es = context.data.word(426); - getmapad(context); - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) goto over138; - context.al = context.data.byte(158); - context.ah = 0; - context.dx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.dx); - context.data.word(160) = context.ax; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context._cmp(context.cx, 0); - if (context.flags.z()) goto over138; - context.ax = context.data.word(160); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); - showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(176); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; - context.ax = context.pop(); - context.cx = context.pop(); - context.push(context.cx); - context.push(context.ax); - context.data.byte(context.si+4) = context.cl; - context._add(context.si, 5); - context.data.word(18) = context.si; -over138: - context._add(context.data.byte(158), 1); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 80); - if (context.flags.z()) goto finfree; - goto loop127; -finfree: + printdirect(context); + context.data.word(77) = 10; + usecharset1(context); + return; +} + +static void usecharset1(Context & context) { + context.ax = context.data.word(404); + context.data.word(268) = context.ax; + return; +} + +static void usetempcharset(Context & context) { + context.ax = context.data.word(406); + context.data.word(268) = context.ax; + return; +} + +static void showexit(Context & context) { + context.ds = context.data.word(408); + context.di = 274; + context.bx = 154; + context.al = 11; + context.ah = 0; + showframe(context); return; } -static inline void getxad(Context & context) { - context.cl = context.data.byte(context.si); - context._add(context.si, 1); - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context.ah = context.data.byte(context.si); - context._add(context.si, 1); - context._cmp(context.cl, 0); - if (!context.flags.z()) goto over148; - context._sub(context.al, context.data.byte(148)); - if (context.flags.c()) goto over148; - context._cmp(context.al, 11); - if (!context.flags.c()) goto over148; - context.cl = 4; - context._shl(context.al, context.cl); - context._or(context.al, context.ah); +static void panelicons1(Context & context) { + context.di = 0; + context._cmp(context.data.byte(3), 1); + if (context.flags.z()) goto watchison; + context.di = 48; +watchison: + context.push(context.di); + context.ds = context.data.word(410); + context._add(context.di, 204); + context.bx = 4; + context.al = 2; context.ah = 0; - context.ch = 1; - return; -over148: - context.ch = 0; + showframe(context); + context.di = context.pop(); + context.push(context.di); + context._cmp(context.data.byte(8), 1); + if (context.flags.z()) goto zoomisoff; + context.ds = context.data.word(408); + context._add(context.di, 228); + context.bx = 8; + context.al = 5; + context.ah = 0; + showframe(context); +zoomisoff: + context.di = context.pop(); + showwatch(context); return; } -static inline void getyad(Context & context) { - context.al = context.data.byte(context.si); - context._add(context.si, 1); - context.ah = context.data.byte(context.si); - context._add(context.si, 1); - context._sub(context.al, context.data.byte(149)); - if (context.flags.c()) goto over147; - context._cmp(context.al, 10); - if (!context.flags.c()) goto over147; - context.cl = 4; - context._shl(context.al, context.cl); - context._or(context.al, context.ah); +static void showwatch(Context & context) { + context._cmp(context.data.byte(3), 0); + if (context.flags.z()) goto nowristwatch; + context.ds = context.data.word(408); + context.di = 250; + context.bx = 1; + context.al = 6; context.ah = 0; - context.ch = 1; - return; -over147: - context.ch = 0; + showframe(context); + showtime(context); +nowristwatch: return; } -static inline void getmapad(Context & context) { - getxad(context); - context._cmp(context.ch, 0); - if (context.flags.z()) goto over146; - context.data.word(168) = context.ax; - getyad(context); - context._cmp(context.ch, 0); - if (context.flags.z()) goto over146; - context.data.word(170) = context.ax; - context.ch = 1; -over146: +static void zoomicon(Context & context) { + context._cmp(context.data.byte(8), 0); + if (context.flags.z()) goto nozoom1; + context.ds = context.data.word(408); + context.di = 8; + context.bx = 132-1; + context.al = 8; + context.ah = 0; + showframe(context); +nozoom1: return; } -static inline void calcfrframe(Context & context) { - context.dx = context.data.word(166); - context.ax = context.data.word(162); - context.push(context.ax); - context.cx = context.data.word(164); - context.ax = context.data.word(160); - context.ds = context.dx; - context.bx = 6; - context._mul(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.cx = context.data.word(context.bx); - context.ax = context.data.word(context.bx+2); - context.dx = context.data.word(context.bx+4); - context.bx = context.pop(); - context.push(context.dx); - context._add(context.ax, context.bx); - context.data.word(178) = context.ax; - context.data.word(176) = context.cx; - context.ax = context.pop(); - context.push(context.ax); +static void showblink(Context & context) { + context._cmp(context.data.byte(131), 1); + if (context.flags.z()) goto finblink1; + context._add(context.data.byte(472), 1); + context._cmp(context.data.byte(4), 0); + if (!context.flags.z()) goto finblink1; + context._cmp(context.data.byte(184), 50); + if (!context.flags.c()) goto eyesshut; + context.al = context.data.byte(472); + context._cmp(context.al, 3); + if (!context.flags.z()) goto finblink1; + context.data.byte(472) = 0; + context.al = context.data.byte(471); + context._add(context.al, 1); + context.data.byte(471) = context.al; + context._cmp(context.al, 6); + if (context.flags.c()) goto nomorethan6; + context.al = 6; +nomorethan6: context.ah = 0; - context.data.word(172) = context.ax; - context.ax = context.pop(); - context.al = context.ah; + context.bx = 5691; + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.ds = context.data.word(408); + context.di = 44; + context.bx = 32; context.ah = 0; - context.data.word(174) = context.ax; + showframe(context); +finblink1: return; -nullframe: - context.ax = context.pop(); - context.cx = 0; - context.data.word(176) = context.cx; +eyesshut: return; } -static inline void finalframe(Context & context) { - context.ax = context.data.word(170); - context._add(context.ax, context.data.word(174)); - context.bx = context.data.word(168); - context._add(context.bx, context.data.word(172)); - context.data.byte(179) = context.bl; - context.data.byte(180) = context.al; - context.di = context.data.word(168); - context.bx = context.data.word(170); +static void dumpblink(Context & context) { + context._cmp(context.data.byte(4), 0); + if (!context.flags.z()) goto nodumpeye; + context._cmp(context.data.byte(472), 0); + if (!context.flags.z()) goto nodumpeye; + context.al = context.data.byte(471); + context._cmp(context.al, 6); + if (!context.flags.c()) goto nodumpeye; + context.push(context.ds); + context.di = 44; + context.bx = 32; + context.cl = 16; + context.ch = 12; + multidump(context); + context.ds = context.pop(); +nodumpeye: return; } -static inline void showallex(Context & context) { - context.es = context.data.word(412); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.data.word(18) = context.bx; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.cx = 100*5; - context.al = 255; - while(--context.cx) context._stosb(); - context.es = context.data.word(398); - context.data.word(166) = context.es; - context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; - context.data.word(162) = context.ax; - context.data.byte(157) = 0; - context.si = 0+2080+30000+2; - context.cx = 0; -exloop: - context.push(context.cx); - context.push(context.si); - context.es = context.data.word(398); - context.push(context.si); - context.ch = 0; - context._cmp(context.data.byte(context.si), 255); - if (context.flags.z()) goto notinroom; - context.al = context.data.byte(context.si-2); - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto notinroom; - getmapad(context); -notinroom: - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) goto blankex; - context.al = context.data.byte(157); - context.ah = 0; - context.dx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.dx); - context.data.word(160) = context.ax; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context._cmp(context.cx, 0); - if (context.flags.z()) goto blankex; - context.ax = context.data.word(160); - context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); - showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(176); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; - context.ax = context.pop(); - context.cx = context.pop(); - context.push(context.cx); - context.push(context.ax); - context.data.byte(context.si+4) = context.cl; - context._add(context.si, 5); - context.data.word(18) = context.si; -blankex: - context._add(context.data.byte(157), 1); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 16); - context._add(context.cx, 1); - context._cmp(context.cx, 100); - if (context.flags.z()) goto finex; - goto exloop; -finex: +static void worktoscreenm(Context & context) { + animpointer(context); + readmouse(context); + showpointer(context); + vsync(context); + worktoscreen(context); + delpointer(context); + return; +} + +static void blank(Context & context) { + context._cmp(context.data.byte(100), 199); + if (context.flags.z()) goto alreadyblnk; + context.data.byte(100) = 199; + context.al = 0; + commandonly(context); +alreadyblnk: return; } -static inline void paneltomap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); - context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); - multiget(context); +static void allpointer(Context & context) { + readmouse(context); + showpointer(context); + dumppointer(context); return; } -static inline void checkone(Context & context) { +static void hangonp(Context & context) { context.push(context.cx); - context.al = context.ch; - context.ah = 0; - context.cl = 4; - context._shr(context.ax, context.cl); - context.dl = context.al; - context.cx = context.pop(); - context.al = context.cl; - context.ah = 0; - context.cl = 4; - context._shr(context.ax, context.cl); - context.ah = context.dl; + context._add(context.cx, context.cx); + context.ax = context.pop(); + context._add(context.cx, context.ax); + context.data.word(138) = 0; + context.al = context.data.byte(231); + context.ah = context.data.byte(106); context.push(context.ax); - context.ch = 0; - context.cl = context.al; + context.data.byte(234) = 3; + context.data.byte(106) = 0; context.push(context.cx); - context.al = context.ah; - context.ah = 0; - context.cx = 11; - context._mul(context.cx); + context.data.byte(100) = 255; + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); context.cx = context.pop(); - context._add(context.ax, context.cx); - context.cx = 3; - context._mul(context.cx); - context.si = context.ax; - context.ds = context.data.word(412); - context._add(context.si, 0+(228*13)+32+60+(32*32)); - context._lodsw(); - context.cx = context.ax; - context._lodsb(); - context.dx = context.pop(); +hangloop: + context.push(context.cx); + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); + context.cx = context.pop(); + context.ax = context.data.word(202); + context._cmp(context.ax, 0); + if (context.flags.z()) goto notpressed; + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto getoutofit; +notpressed: + if (--context.cx) goto hangloop; +getoutofit: + delpointer(context); + context.ax = context.pop(); + context.data.byte(231) = context.al; + context.data.byte(106) = context.ah; + context.data.byte(234) = 0; return; } -static inline void getblockofpixel(Context & context) { +static void hangonw(Context & context) { +hangloopw: context.push(context.cx); - context.push(context.es); - context.push(context.di); - context.ax = context.data.word(125); - context._add(context.cl, context.al); - context.ax = context.data.word(127); - context._add(context.ch, context.al); - checkone(context); - context._and(context.cl, 1); - if (!context.flags.z()) goto failrain; - context.di = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - return; -failrain: - context.di = context.pop(); - context.es = context.pop(); + delpointer(context); + readmouse(context); + animpointer(context); + showpointer(context); + vsync(context); + dumppointer(context); context.cx = context.pop(); - context.al = 0; + if (--context.cx) goto hangloopw; return; } -static inline void splitintolines(Context & context) { -lookforlinestart: - getblockofpixel(context); - context._cmp(context.al, 0); - if (!context.flags.z()) goto foundlinestart; - context._sub(context.cl, 1); - context._add(context.ch, 1); - context._cmp(context.cl, 0); - if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); - if (!context.flags.c()) goto endofthisline; - goto lookforlinestart; -foundlinestart: - context.data.word(context.di) = context.cx; - context.bh = 1; -lookforlineend: - getblockofpixel(context); - context._cmp(context.al, 0); - if (context.flags.z()) goto foundlineend; - context._sub(context.cl, 1); - context._add(context.ch, 1); - context._cmp(context.cl, 0); - if (context.flags.z()) goto foundlineend; - context._cmp(context.ch, context.data.byte(129)); - if (!context.flags.c()) goto foundlineend; - context._add(context.bh, 1); - goto lookforlineend; -foundlineend: +static void hangoncurs(Context & context) { +monloop1: context.push(context.cx); - context.data.byte(context.di+2) = context.bh; - randomnumber(context); - context.data.byte(context.di+3) = context.al; - randomnumber(context); - context.data.byte(context.di+4) = context.al; - randomnumber(context); - context._and(context.al, 3); - context._add(context.al, 4); - context.data.byte(context.di+5) = context.al; - context._add(context.di, 6); + printcurs(context); + vsync(context); + delcurs(context); context.cx = context.pop(); - context._cmp(context.cl, 0); - if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); - if (!context.flags.c()) goto endofthisline; - goto lookforlinestart; -endofthisline: + if (--context.cx) goto monloop1; return; } -static inline void initrain(Context & context) { - context.es = context.data.word(412); - context.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); - context.bx = 1113; -checkmorerain: - context.al = context.data.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) goto finishinitrain; - context._cmp(context.al, context.data.byte(184)); - if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+1); - context._cmp(context.al, context.data.byte(148)); - if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+2); - context._cmp(context.al, context.data.byte(149)); - if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+3); - context.data.byte(132) = context.al; - goto dorain; -checkrain: - context._add(context.bx, 4); - goto checkmorerain; -dorain: - context.cx = 4; -initraintop: - randomnumber(context); - context._and(context.al, 31); - context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); - if (!context.flags.c()) goto initraintop; - context._add(context.cl, context.al); - context._cmp(context.cl, context.data.byte(128)); - if (!context.flags.c()) goto initrainside; - context.push(context.cx); - splitintolines(context); - context.cx = context.pop(); - goto initraintop; -initrainside: - context.cl = context.data.byte(128); - context._sub(context.cl, 1); -initrainside2: - randomnumber(context); - context._and(context.al, 31); - context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); - if (!context.flags.c()) goto initrainside2; - context._add(context.ch, context.al); - context._cmp(context.ch, context.data.byte(129)); - if (!context.flags.c()) goto finishinitrain; - context.push(context.cx); - splitintolines(context); - context.cx = context.pop(); - goto initrainside2; -finishinitrain: - context.al = 255; - context._stosb(); +static void getunderzoom(Context & context) { + context.di = 8+5; + context.bx = 132+4; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.cl = 46; + context.ch = 40; + multiget(context); + return; +} + +static void dumpzoom(Context & context) { + context._cmp(context.data.byte(8), 1); + if (!context.flags.z()) goto notzoomon; + context.di = 8+5; + context.bx = 132+4; + context.cl = 46; + context.ch = 40; + multidump(context); +notzoomon: + return; +} + +static void putunderzoom(Context & context) { + context.di = 8+5; + context.bx = 132+4; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.cl = 46; + context.ch = 40; + multiput(context); + return; +} + +static void crosshair(Context & context) { + context._cmp(context.data.byte(100), 3); + if (context.flags.z()) goto nocross; + context._cmp(context.data.byte(100), 10); + if (!context.flags.c()) goto nocross; + context.es = context.data.word(400); + context.ds = context.data.word(408); + context.di = 8+24; + context.bx = 132+19; + context.al = 9; + context.ah = 0; + showframe(context); + return; +nocross: + context.es = context.data.word(400); + context.ds = context.data.word(408); + context.di = 8+24; + context.bx = 132+19; + context.al = 29; + context.ah = 0; + showframe(context); return; } -static inline void drawfloor(Context & context) { - context.push(context.es); +static void showpointer(Context & context) { + showblink(context); + context.di = context.data.word(198); + context.data.word(220) = context.di; + context.bx = context.data.word(200); + context.data.word(222) = context.bx; + context._cmp(context.data.byte(106), 1); + if (context.flags.z()) goto itsanobject; context.push(context.bx); - eraseoldobs(context); - drawflags(context); - calcmapad(context); - doblocks(context); - showallobs(context); - showallfree(context); - showallex(context); - paneltomap(context); - initrain(context); - context.data.byte(62) = 0; - context.bx = context.pop(); - context.es = context.pop(); - return; -} - -static inline void width160(Context & context) { - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width128: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width110: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width88: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width80: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width63: - context._movsw(); - width62: - context._movsw(); - width61: - context._movsw(); - width60: - context._movsw(); - width59: - context._movsw(); - width58: - context._movsw(); - width57: - context._movsw(); - width56: - context._movsw(); - width55: - context._movsw(); - width54: - context._movsw(); - width53: - context._movsw(); - width52: - context._movsw(); - width51: - context._movsw(); - width50: - context._movsw(); - width49: - context._movsw(); - width48: - context._movsw(); - width47: - context._movsw(); - width46: - context._movsw(); - width45: - context._movsw(); - width44: - context._movsw(); - width43: - context._movsw(); - width42: - context._movsw(); - width41: - context._movsw(); - width40: - context._movsw(); - width39: - context._movsw(); - width38: - context._movsw(); - width37: - context._movsw(); - width36: - context._movsw(); - width35: - context._movsw(); - width34: - context._movsw(); - width33: - context._movsw(); - width32: - context._movsw(); - width31: - context._movsw(); - width30: - context._movsw(); - width29: - context._movsw(); - width28: - context._movsw(); - width27: - context._movsw(); - width26: - context._movsw(); - width25: - context._movsw(); - width24: - context._movsw(); - width23: - context._movsw(); - width22: - context._movsw(); - width21: - context._movsw(); - width20: - context._movsw(); - width19: - context._movsw(); - width18: - context._movsw(); - width17: - context._movsw(); - width16: - context._movsw(); - width15: - context._movsw(); - width14: - context._movsw(); - width13: - context._movsw(); - width12: - context._movsw(); - width11: - context._movsw(); - width10: - context._movsw(); - width9: - context._movsw(); - width8: - context._movsw(); - width7: - context._movsw(); - width6: - context._movsw(); - width5: - context._movsw(); - width4: - context._movsw(); - width3: - context._movsw(); - width2: - context._movsw(); - width1: - context._movsw(); - width0: + context.push(context.di); + context.ds = context.data.word(408); + context.al = context.data.byte(231); + context._add(context.al, 20); + context.ah = 0; + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.cx = context.data.word(context.si); + context._cmp(context.cl, 12); + if (!context.flags.c()) goto notsmallx; + context.cl = 12; +notsmallx: + context._cmp(context.ch, 12); + if (!context.flags.c()) goto notsmally; + context.ch = 12; +notsmally: + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; + context.push(context.ds); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + multiget(context); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.push(context.di); + context.push(context.bx); + context.al = context.data.byte(231); + context._add(context.al, 20); + context.ah = 0; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + return; +itsanobject: + context.al = context.data.byte(89); + context.ds = context.data.word(398); + context._cmp(context.data.byte(102), 4); + if (context.flags.z()) goto itsfrominv; + context.ds = context.data.word(446); +itsfrominv: + context.cl = context.al; + context._add(context.al, context.al); + context._add(context.al, context.cl); + context._add(context.al, 1); + context.ah = 0; + context.push(context.ax); + context._add(context.ax, context.ax); + context.si = context.ax; + context._add(context.ax, context.ax); + context._add(context.si, context.ax); + context.ax = 2080; + context.cx = context.data.word(context.si); + context._cmp(context.cl, 12); + if (!context.flags.c()) goto notsmallx2; + context.cl = 12; +notsmallx2: + context._cmp(context.ch, 12); + if (!context.flags.c()) goto notsmally2; + context.ch = 12; +notsmally2: + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; + context.ax = context.pop(); + context.push(context.di); + context.push(context.bx); + context.push(context.ax); + context.push(context.bx); + context.push(context.di); + context.push(context.ds); + context.al = context.cl; + context.ah = 0; + context._shr(context.ax, 1); + context._sub(context.data.word(220), context.ax); + context._sub(context.di, context.ax); + context.al = context.ch; + context._shr(context.ax, 1); + context._sub(context.data.word(222), context.ax); + context._sub(context.bx, context.ax); + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + multiget(context); + context.ds = context.pop(); + context.di = context.pop(); + context.bx = context.pop(); + context.ax = context.pop(); + context.ah = 128; + showframe(context); + context.bx = context.pop(); + context.di = context.pop(); + context.ds = context.data.word(408); + context.al = 3; + context.ah = 128; + showframe(context); return; } -static inline void worktoscreen(Context & context) { - vsync(context); +static void delpointer(Context & context) { + context.ax = context.data.word(220); + context._cmp(context.ax, 0x0ffff); + if (context.flags.z()) goto nevershown; + context.data.word(224) = context.ax; + context.ax = context.data.word(222); + context.data.word(226) = context.ax; + context.cl = context.data.byte(227); + context.data.byte(229) = context.cl; + context.ch = context.data.byte(228); + context.data.byte(230) = context.ch; + context.ds = context.data.word(412); + context.si = 0+(228*13)+32+60; + context.di = context.data.word(224); + context.bx = context.data.word(226); + multiput(context); +nevershown: + return; +} + +static void dumppointer(Context & context) { + dumpblink(context); + context.cl = context.data.byte(229); + context.ch = context.data.byte(230); + context.di = context.data.word(224); + context.bx = context.data.word(226); + multidump(context); + context.bx = context.data.word(222); + context.di = context.data.word(220); + context._cmp(context.di, context.data.word(224)); + if (!context.flags.z()) goto difffound; + context._cmp(context.bx, context.data.word(226)); + if (context.flags.z()) goto notboth; +difffound: + context.cl = context.data.byte(227); + context.ch = context.data.byte(228); + multidump(context); +notboth: + return; +} + +static void undertextline(Context & context) { + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.ds = context.data.word(412); context.si = 0; - context.di = 0; - context.cx = 25; - context.ds = context.data.word(400); - context.dx = 0x0a000; - context.es = context.dx; -dumpallloop: - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - if (--context.cx) goto dumpallloop; + context.cl = 228; + context.ch = 13; + multiget(context); + return; +} + +static void deltextline(Context & context) { + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.ds = context.data.word(412); + context.si = 0; + context.cl = 228; + context.ch = 13; + multiput(context); + return; +} + +static void dumptextline(Context & context) { + context._cmp(context.data.byte(109), 1); + if (!context.flags.z()) goto nodumptextline; + context.data.byte(109) = 0; + context.di = context.data.word(79); + context.bx = context.data.word(81); + context._sub(context.bx, 3); + context.cl = 228; + context.ch = 13; + multidump(context); +nodumptextline: + return; +} + +static void animpointer(Context & context) { + context._cmp(context.data.byte(234), 2); + if (context.flags.z()) goto combathand; + context._cmp(context.data.byte(234), 3); + if (context.flags.z()) goto mousehand; + context._cmp(context.data.word(21), 0); + if (context.flags.z()) goto notwatchpoint; + context.data.byte(231) = 11; + return; +notwatchpoint: + context.data.byte(231) = 0; + context._cmp(context.data.byte(237), 0); + if (context.flags.z()) goto gothand; + context._cmp(context.data.byte(476), 0); + if (context.flags.z()) goto gothand; +arrow: + getflagunderp(context); + context._cmp(context.cl, 2); + if (context.flags.c()) goto gothand; + context._cmp(context.cl, 128); + if (!context.flags.c()) goto gothand; + context.data.byte(231) = 3; + context._test(context.cl, 4); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 4; + context._test(context.cl, 16); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 5; + context._test(context.cl, 2); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 6; + context._test(context.cl, 8); + if (!context.flags.z()) goto gothand; + context.data.byte(231) = 8; +gothand: + return; +mousehand: + context._cmp(context.data.byte(235), 0); + if (context.flags.z()) goto rightspeed3; + context._sub(context.data.byte(235), 1); + goto finflashmouse; +rightspeed3: + context.data.byte(235) = 5; + context._add(context.data.byte(236), 1); + context._cmp(context.data.byte(236), 16); + if (!context.flags.z()) goto finflashmouse; + context.data.byte(236) = 0; +finflashmouse: + context.al = context.data.byte(236); + context.ah = 0; + context.bx = 5698; + context._add(context.bx, context.ax); + context.al = context.data.byte(context.bx); + context.data.byte(231) = context.al; + return; +combathand: + context.data.byte(231) = 0; + context._cmp(context.data.byte(184), 14); + if (!context.flags.z()) goto notarrow; + context._cmp(context.data.byte(100), 211); + if (!context.flags.z()) goto notarrow; + context.data.byte(231) = 5; +notarrow: + return; +} + +static void readmouse(Context & context) { + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(202) = context.bx; return; } -static inline void afterintroroom(Context & context) { - context._cmp(context.data.byte(186), 0); - if (context.flags.z()) goto notnewintro; - clearwork(context); - findroominloc(context); - context.data.byte(62) = 1; - drawfloor(context); - reelsonscreen(context); - spriteupdate(context); - printsprites(context); - worktoscreen(context); - context.data.byte(186) = 0; -notnewintro: +static void readmouse1(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(204) = context.bx; return; } -static inline void multiget(Context & context) { - context.ax = context.bx; - context.bx = 320; - context._mul(context.bx); - context._add(context.di, context.ax); - context.es = context.data.word(400); - context.es = context.ds; - context.ds = context.es; - context._xchg(context.di, context.si); - context.al = context.cl; - context.ah = 0; - context.dx = 320; - context._sub(context.dx, context.ax); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth2; - context.bl = context.cl; - context.bh = 0; - context.ax = 1819; - context._shr(context.bx, 1); - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop3: - __dispatch_call(context, context.ax); - context._add(context.si, context.dx); - if (--context.cx) goto multiloop3; +static void readmouse2(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(206) = context.bx; return; -oddwidth2: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop4: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.si, context.dx); - if (--context.cx) goto multiloop4; +} + +static void readmouse3(Context & context) { + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(208) = context.bx; return; } -static inline void getundertimed(Context & context) { - context.al = context.data.byte(335); - context._sub(context.al, 3); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(336); - context.ah = 0; - context.di = context.ax; - context.ch = 30; - context.cl = 240; - context.ds = context.data.word(412); - context.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(context); +static void readmouse4(Context & context) { + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; + mousecall(context); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.ax = context.data.word(204); + context._or(context.ax, context.data.word(206)); + context._or(context.ax, context.data.word(208)); + context._or(context.bx, context.ax); + context.data.word(202) = context.bx; return; } -static inline void getnextword(Context & context) { - context.bx = 0; -getloop: - context.ax = context.data.word(context.di); - context._add(context.di, 1); - context._add(context.bh, 1); - context._cmp(context.al, ':'); - if (context.flags.z()) goto endall; - context._cmp(context.al, 0); - if (context.flags.z()) goto endall; - context._cmp(context.al, 32); - if (context.flags.z()) goto endword; - modifychar(context); - context._cmp(context.al, 255); - if (context.flags.z()) goto getloop; - context.push(context.ax); - context._sub(context.al, 32); - context.ah = 0; - context._add(context.ax, context.data.word(71)); - context._add(context.ax, context.ax); - context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.cl = context.data.byte(context.si+0); - context.ax = context.pop(); - kernchars(context); - context._add(context.bl, context.cl); - goto getloop; -endword: - context._add(context.bl, 6); - context.al = 0; +static void readkey(Context & context) { + context.bx = context.data.word(396); + context._cmp(context.bx, context.data.word(394)); + if (context.flags.z()) goto nokey; + context._add(context.bx, 1); + context._and(context.bx, 15); + context.data.word(396) = context.bx; + context.di = 5715; + context._add(context.di, context.bx); + context.al = context.data.byte(context.di); + context.data.byte(142) = context.al; return; -endall: - context._add(context.bl, 6); - context.al = 1; +nokey: + context.data.byte(142) = 0; return; } -static inline void getnumber(Context & context) { - context.cx = 0; - context.push(context.si); - context.push(context.bx); - context.push(context.di); +static void convertkey(Context & context) { + context._and(context.al, 127); + context.ah = 0; + context.di = 5731; + context._add(context.di, context.ax); + context.al = context.data.byte(context.di); + return; +} + +static void randomnum1(Context & context) { context.push(context.ds); context.push(context.es); - context.di = context.si; -wordloop: - context.push(context.cx); - context.push(context.dx); - getnextword(context); - context.dx = context.pop(); - context.cx = context.pop(); - context._cmp(context.al, 1); - if (context.flags.z()) goto endoftext; - context.al = context.cl; - context.ah = 0; + context.push(context.di); context.push(context.bx); - context.bh = 0; - context._add(context.ax, context.bx); - context.bx = context.pop(); - context._sub(context.ax, 10); - context.dh = 0; - context._cmp(context.ax, context.dx); - if (!context.flags.c()) goto gotoverend; - context._add(context.cl, context.bl); - context._add(context.ch, context.bh); - goto wordloop; -gotoverend: - context.al = context.dl; - context._and(context.al, 1); - if (context.flags.z()) goto notcentre; context.push(context.cx); - context.al = context.dl; - context._and(context.al, 0b11111110); - context.ah = 0; - context.ch = 0; - context._sub(context.ax, context.cx); - context._add(context.ax, 20); - context._shr(context.ax, 1); + randomnumber(context); context.cx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); context.bx = context.pop(); - context.si = context.pop(); - context._add(context.di, context.ax); - context.cl = context.ch; - return; -notcentre: + context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context.cl = context.ch; return; -endoftext: - context.al = context.cl; - context.ah = 0; +} + +static void randomnum2(Context & context) { + context.push(context.ds); + context.push(context.es); + context.push(context.di); context.push(context.bx); - context.bh = 0; - context._add(context.ax, context.bx); + context.push(context.ax); + randomnumber(context); + context.cl = context.al; + context.ax = context.pop(); context.bx = context.pop(); - context._sub(context.ax, 10); - context.dh = 0; - context._cmp(context.ax, context.dx); - if (!context.flags.c()) goto gotoverend2; - context._add(context.cl, context.bl); - context._add(context.ch, context.bh); -gotoverend2: - context.al = context.dl; - context._and(context.al, 1); - if (context.flags.z()) goto notcent2; - context.push(context.cx); - context.al = context.dl; - context._and(context.al, 0b11111110); - context._add(context.al, 2); - context.ah = 0; - context.ch = 0; - context._add(context.ax, 20); - context._sub(context.ax, context.cx); - context._shr(context.ax, 1); - context.cx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context._add(context.di, context.ax); - context.cl = context.ch; - return; -notcent2: context.es = context.pop(); context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context.cl = context.ch; return; } -static inline void modifychar(Context & context) { - context._cmp(context.al, 128); - if (context.flags.c()) goto nomod; - context._cmp(context.al, 160); - if (!context.flags.z()) goto not160; - context.al = 'Z'+1; +static void hangon(Context & context) { +hangonloop: + context.push(context.cx); + vsync(context); + context.cx = context.pop(); + if (--context.cx) goto hangonloop; + return; +} + +static void loadtraveltext(Context & context) { + context.dx = 2247; + standardload(context); + context.data.word(456) = context.ax; return; -not160: - context._cmp(context.al, 130); - if (!context.flags.z()) goto not130; - context.al = 'Z'+2; +} + +static void loadintotemp(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(458) = context.ax; return; -not130: - context._cmp(context.al, 161); - if (!context.flags.z()) goto not161; - context.al = 'Z'+3; +} + +static void loadintotemp2(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(460) = context.ax; return; -not161: - context._cmp(context.al, 162); - if (!context.flags.z()) goto not162; - context.al = 'Z'+4; +} + +static void loadintotemp3(Context & context) { + context.ds = context.cs; + standardload(context); + context.data.word(462) = context.ax; return; -not162: - context._cmp(context.al, 163); - if (!context.flags.z()) goto not163; - context.al = 'Z'+5; +} + +static void loadtempcharset(Context & context) { + standardload(context); + context.data.word(406) = context.ax; return; -not163: - context._cmp(context.al, 164); - if (!context.flags.z()) goto not164; - context.al = 'Z'+6; +} + +static void standardload(Context & context) { + openfile(context); + readheader(context); + context.bx = context.data.word(context.di); + context.push(context.bx); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.ds = context.ax; + context.cx = context.pop(); + context.push(context.ax); + context.dx = 0; + readfromfile(context); + closefile(context); + context.ax = context.pop(); return; -not164: - context._cmp(context.al, 165); - if (!context.flags.z()) goto not165; - context.al = ','-1; +} + +static void loadtemptext(Context & context) { + standardload(context); + context.data.word(466) = context.ax; return; -not165: - context._cmp(context.al, 168); - if (!context.flags.z()) goto not168; - context.al = 'A'-1; +} + +static void loadroom(Context & context) { + context.data.byte(74) = 1; + context.data.word(328) = 0; + context.data.word(138) = 0; + context.data.word(121) = 104; + context.data.word(123) = 38; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context.al = context.data.byte(188); + context.data.byte(9) = context.al; + getroomdata(context); + startloading(context); + loadroomssample(context); + switchryanon(context); + drawflags(context); + getdimension(context); return; -not168: - context._cmp(context.al, 173); - if (!context.flags.z()) goto not173; - context.al = 'A'-4; +} + +static void loadroomssample(Context & context) { + context.al = context.data.byte(531); + context._cmp(context.al, 255); + if (context.flags.z()) goto loadedalready; + context._cmp(context.al, context.data.byte(530)); + if (context.flags.z()) goto loadedalready; + context.data.byte(530) = context.al; + context.al = context.data.byte(530); + context.cl = '0'; + twodigitnum(context); + context.di = 1909; + context._xchg(context.al, context.ah); + context.data.word(context.di+10) = context.ax; + context.dx = context.di; + loadsecondsample(context); +loadedalready: return; -not173: - context._cmp(context.al, 129); - if (!context.flags.z()) goto not129; - context.al = 'A'-5; -not129: +} + +static void getridofreels(Context & context) { + context._cmp(context.data.byte(74), 0); + if (context.flags.z()) goto dontgetrid; + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); +dontgetrid: return; -nomod: +} + +static void getridofall(Context & context) { + context.es = context.data.word(416); + deallocatemem(context); + context.es = context.data.word(444); + deallocatemem(context); + context.es = context.data.word(430); + deallocatemem(context); + context.es = context.data.word(432); + deallocatemem(context); + context.es = context.data.word(434); + deallocatemem(context); + context.es = context.data.word(450); + deallocatemem(context); + context.es = context.data.word(448); + deallocatemem(context); + context.es = context.data.word(440); + deallocatemem(context); + context.es = context.data.word(442); + deallocatemem(context); + context.es = context.data.word(436); + deallocatemem(context); + context.es = context.data.word(446); + deallocatemem(context); + context.es = context.data.word(438); + deallocatemem(context); return; } -static inline void frameoutfx(Context & context) { - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._add(context.dx, context.cx); - context.cx = context.pop(); -frameloopfx1: - context.push(context.cx); - context.ch = 0; -frameloopfx2: - context._lodsb(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto backtosolidfx; -backtootherfx: - context._sub(context.di, 1); - if (--context.cx) goto frameloopfx2; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._sub(context.ch, 1); - if (!context.flags.z()) goto frameloopfx1; +static void restorereels(Context & context) { + context._cmp(context.data.byte(74), 0); + if (context.flags.z()) goto dontrestore; + context.al = context.data.byte(184); + getroomdata(context); + context.dx = context.bx; + openfile(context); + readheader(context); + dontloadseg(context); + dontloadseg(context); + dontloadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); +dontrestore: return; -frameloopfx3: - context._lodsb(); - context._cmp(context.al, 0); - if (context.flags.z()) goto backtootherfx; -backtosolidfx: - context.data.byte(context.di) = context.al; - context._sub(context.di, 1); - if (--context.cx) goto frameloopfx3; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._sub(context.ch, 1); - if (!context.flags.z()) goto frameloopfx1; +} + +static void restoreall(Context & context) { + context.al = context.data.byte(9); + getroomdata(context); + context.dx = context.bx; + openfile(context); + readheader(context); + allocateload(context); + context.ds = context.ax; + context.data.word(416) = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(400); + context.dx = 0; + context.cx = 132*66; + context.al = 0; + fillspace(context); + loadseg(context); + sortoutmap(context); + allocateload(context); + context.data.word(444) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(450) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(448) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(440) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(442) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(436) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(446) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + dontloadseg(context); + allocateload(context); + context.data.word(438) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); + setallchanges(context); return; } -static inline void frameoutnm(Context & context) { - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); +static void sortoutmap(Context & context) { + context.push(context.es); + context.push(context.di); + context.ds = context.data.word(400); + context.si = 0; + context.es = context.data.word(418); + context.di = 0; + context.cx = 60; +blimey: context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); + context.push(context.si); + context.cx = 66; + while(--context.cx) context._movsb(); + context.si = context.pop(); context.cx = context.pop(); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidthframe; - context.bl = context.cl; - context.bh = 0; - context.ax = 1819; - context._shr(context.bx, 1); - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -nmloop1: - __dispatch_call(context, context.ax); - context._add(context.di, context.dx); - if (--context.cx) goto nmloop1; - return; -oddwidthframe: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -nmloop2: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.dx); - if (--context.cx) goto nmloop2; + context._add(context.si, 132); + if (--context.cx) goto blimey; + context.di = context.pop(); + context.es = context.pop(); return; } -static inline void frameoutbh(Context & context) { - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); - context.cx = context.pop(); -bhloop2: - context.push(context.cx); - context.ch = 0; - context.ah = 255; -bhloop1: - context._cmp(context.data.byte(context.di), context.ah); - if (!context.flags.z()) goto nofill; - context._movsb(); - if (--context.cx) goto bhloop1; - goto nextline; -nofill: - context._add(context.di, 1); - context._add(context.si, 1); - if (--context.cx) goto bhloop1; -nextline: - context._add(context.di, context.dx); - context.cx = context.pop(); - context._sub(context.ch, 1); - if (!context.flags.z()) goto bhloop2; +static void startloading(Context & context) { + context.data.byte(64) = 0; + context.al = context.data.byte(context.bx+13); + context.data.byte(531) = context.al; + context.al = context.data.byte(context.bx+15); + context.data.byte(148) = context.al; + context.al = context.data.byte(context.bx+16); + context.data.byte(149) = context.al; + context.al = context.data.byte(context.bx+20); + context.data.byte(35) = context.al; + context.al = context.data.byte(context.bx+21); + context.data.byte(475) = context.al; + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + context.al = context.data.byte(context.bx+22); + context.data.byte(133) = context.al; + context.data.byte(135) = context.al; + context.al = context.data.byte(context.bx+23); + context.data.byte(39) = context.al; + context.al = context.data.byte(context.bx+24); + context.data.byte(36) = context.al; + context.al = context.data.byte(context.bx+25); + context.data.byte(38) = context.al; + context.data.byte(65) = -1; + context.al = context.data.byte(context.bx+27); + context.push(context.ax); + context.al = context.data.byte(context.bx+31); + context.ah = context.data.byte(184); + context.data.byte(184) = context.al; + context.dx = context.bx; + openfile(context); + readheader(context); + allocateload(context); + context.ds = context.ax; + context.data.word(416) = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(400); + context.dx = 0; + context.cx = 132*66; + context.al = 0; + fillspace(context); + loadseg(context); + sortoutmap(context); + allocateload(context); + context.data.word(444) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(428); + context.dx = 0; + context.cx = 64*128; + context.al = 255; + fillspace(context); + loadseg(context); + allocateload(context); + context.data.word(430) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(432) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(434) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(450) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(448) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(440) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(442) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(436) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + allocateload(context); + context.data.word(446) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(426); + context.dx = 0; + context.cx = 16*80; + context.al = 255; + fillspace(context); + loadseg(context); + allocateload(context); + context.data.word(438) = context.ax; + context.ds = context.ax; + context.dx = 0; + loadseg(context); + closefile(context); + findroominloc(context); + deletetaken(context); + setallchanges(context); + autoappear(context); + context.al = context.data.byte(188); + getroomdata(context); + context.data.byte(65) = -1; + context.data.byte(56) = 0; + context.data.word(98) = 160; + context.data.byte(188) = 255; + context.data.byte(492) = 254; + context.ax = context.pop(); + context._cmp(context.al, 255); + if (context.flags.z()) goto dontwalkin; + context.data.byte(475) = context.al; + context.push(context.bx); + autosetwalk(context); + context.bx = context.pop(); +dontwalkin: + findxyfrompath(context); return; } -static inline void frameoutv(Context & context) { - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); - context.cx = context.pop(); -frameloop1: +static void disablepath(Context & context) { context.push(context.cx); - context.ch = 0; -frameloop2: - context._lodsb(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto backtosolid; -backtoother: - context._add(context.di, 1); - if (--context.cx) goto frameloop2; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._sub(context.ch, 1); - if (!context.flags.z()) goto frameloop1; - return; -frameloop3: - context._lodsb(); - context._cmp(context.al, 0); - if (context.flags.z()) goto backtoother; -backtosolid: - context._stosb(); - if (--context.cx) goto frameloop3; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._sub(context.ch, 1); - if (!context.flags.z()) goto frameloop1; - return; -} - -static inline void showframe(Context & context) { - context.push(context.dx); - context.push(context.ax); - context.cx = context.ax; - context._and(context.cx, 511); - context._add(context.cx, context.cx); - context.si = context.cx; - context._add(context.cx, context.cx); - context._add(context.si, context.cx); - context._cmp(context.data.word(context.si), 0); - if (!context.flags.z()) goto notblankshow; - context.cx = 0; - return; -notblankshow: - context._test(context.ah, 128); - if (!context.flags.z()) goto skipoffsets; - context.al = context.data.byte(context.si+4); - context.ah = 0; - context._add(context.di, context.ax); - context.al = context.data.byte(context.si+5); + context._xchg(context.al, context.ah); + context.cx = -6; +looky2: + context._add(context.cx, 6); + context._sub(context.al, 10); + if (!context.flags.c()) goto looky2; + context.al = context.ah; + context._sub(context.cx, 1); +lookx2: + context._add(context.cx, 1); + context._sub(context.al, 11); + if (!context.flags.c()) goto lookx2; + context.al = context.cl; context.ah = 0; + context.cx = 144; + context._mul(context.cx); + context.es = context.data.word(450); + context.bx = 0; context._add(context.bx, context.ax); -skipoffsets: - context.cx = context.data.word(context.si+0); - context.ax = context.data.word(context.si+2); - context._add(context.ax, 2080); - context.si = context.ax; context.ax = context.pop(); - context.dx = context.pop(); - context._cmp(context.ah, 0); - if (context.flags.z()) goto noeffects; - context._test(context.ah, 128); - if (context.flags.z()) goto notcentred; - context.push(context.ax); - context.al = context.cl; - context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.di, context.ax); - context.al = context.ch; context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.bx, context.ax); - context.ax = context.pop(); -notcentred: - context._test(context.ah, 64); - if (context.flags.z()) goto notdiffdest; - context.push(context.cx); - frameoutfx(context); - context.cx = context.pop(); - return; -notdiffdest: - context._test(context.ah, 8); - if (context.flags.z()) goto notprintlist; - context.push(context.ax); - context.ax = context.di; - context._sub(context.ax, context.data.word(117)); - context.push(context.bx); - context._sub(context.bx, context.data.word(119)); - context.ah = context.bl; - context.bx = context.pop(); - context.ax = context.pop(); -notprintlist: - context._test(context.ah, 4); - if (context.flags.z()) goto notflippedx; - context.dx = 320; - context.es = context.data.word(400); - context.push(context.cx); - frameoutfx(context); - context.cx = context.pop(); - return; -notflippedx: - context._test(context.ah, 2); - if (context.flags.z()) goto notnomask; - context.dx = 320; - context.es = context.data.word(400); - context.push(context.cx); - frameoutnm(context); - context.cx = context.pop(); - return; -notnomask: - context._test(context.ah, 32); - if (context.flags.z()) goto noeffects; - context.dx = 320; - context.es = context.data.word(400); - context.push(context.cx); - frameoutbh(context); - context.cx = context.pop(); - return; -noeffects: - context.dx = 320; - context.es = context.data.word(400); - context.push(context.cx); - frameoutv(context); - context.cx = context.pop(); - return; -} - -static inline void kernchars(Context & context) { - context._cmp(context.al, 'a'); - if (context.flags.z()) goto iskern; - context._cmp(context.al, 'u'); - if (context.flags.z()) goto iskern; - return; -iskern: - context._cmp(context.ah, 'n'); - if (context.flags.z()) goto kernit; - context._cmp(context.ah, 't'); - if (context.flags.z()) goto kernit; - context._cmp(context.ah, 'r'); - if (context.flags.z()) goto kernit; - context._cmp(context.ah, 'i'); - if (context.flags.z()) goto kernit; - context._cmp(context.ah, 'l'); - if (context.flags.z()) goto kernit; - return; -kernit: - context._sub(context.cl, 1); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.al = 0; + context.data.byte(context.bx+6) = context.al; return; } -static inline void printchar(Context & context) { - context._cmp(context.al, 255); - if (context.flags.z()) goto ignoreit; - context.push(context.si); - context.push(context.bx); - context.push(context.di); - context._sub(context.bx, 3); - context.push(context.ax); - context._sub(context.al, 32); +static void findxyfrompath(Context & context) { + getroomspaths(context); + context.al = context.data.byte(475); context.ah = 0; - context._add(context.ax, context.data.word(71)); - showframe(context); - context.ax = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context._cmp(context.data.byte(72), 0); - if (!context.flags.z()) goto nokern; - kernchars(context); -nokern: - context.push(context.cx); - context.ch = 0; - context._add(context.di, context.cx); - context.cx = context.pop(); -ignoreit: + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.ax, context.ax); + context._add(context.bx, context.ax); + context.ax = context.data.word(context.bx); + context._sub(context.al, 12); + context._sub(context.ah, 12); + context.data.byte(151) = context.al; + context.data.byte(152) = context.ah; return; } -static inline void printdirect(Context & context) { - context.data.word(84) = context.di; - context.ds = context.data.word(268); -printloop6: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; -printloop5: - context.ax = context.data.word(context.si); - context._add(context.si, 1); - context._cmp(context.al, 0); - if (context.flags.z()) goto finishdirct; - context._cmp(context.al, ':'); - if (context.flags.z()) goto finishdirct; - context.push(context.cx); - context.push(context.es); - modifychar(context); - printchar(context); - context.data.word(84) = context.di; - context.es = context.pop(); - context.cx = context.pop(); - if (--context.cx) goto printloop5; - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._add(context.bx, context.data.word(77)); - goto printloop6; -finishdirct: - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); +static void findroominloc(Context & context) { + context.al = context.data.byte(149); + context.cx = -6; +looky: + context._add(context.cx, 6); + context._sub(context.al, 10); + if (!context.flags.c()) goto looky; + context.al = context.data.byte(148); + context._sub(context.cx, 1); +lookx: + context._add(context.cx, 1); + context._sub(context.al, 11); + if (!context.flags.c()) goto lookx; + context.data.byte(185) = context.cl; return; } -static inline void multiput(Context & context) { - context.ax = context.bx; - context.bx = 320; - context._mul(context.bx); - context._add(context.di, context.ax); - context.es = context.data.word(400); - context.al = context.cl; +static void getroomdata(Context & context) { context.ah = 0; - context.dx = 320; - context._sub(context.dx, context.ax); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth3; - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop5: - __dispatch_call(context, context.ax); - context._add(context.di, context.dx); - if (--context.cx) goto multiloop5; - return; -oddwidth3: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop6: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.dx); - if (--context.cx) goto multiloop6; + context.cx = 32; + context._mul(context.cx); + context.bx = 5971; + context._add(context.bx, context.ax); return; } -static inline void putundertimed(Context & context) { - context.al = context.data.byte(335); - context._sub(context.al, 3); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(336); - context.ah = 0; - context.di = context.ax; - context.ch = 30; - context.cl = 240; - context.ds = context.data.word(412); - context.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(context); +static void readheader(Context & context) { + context.ds = context.cs; + context.dx = 5881; + context.cx = 5958-context.data.byte(5881); + readfromfile(context); + context.es = context.cs; + context.di = 5952; return; } -static inline void usetimedtext(Context & context) { - context._cmp(context.data.word(328), 0); - if (context.flags.z()) goto notext; - context._sub(context.data.word(328), 1); - context._cmp(context.data.word(328), 0); - if (context.flags.z()) goto deltimedtext; - context.ax = context.data.word(328); - context._cmp(context.ax, context.data.word(330)); - if (context.flags.z()) goto firsttimed; - if (!context.flags.c()) goto notext; - goto notfirsttimed; -firsttimed: - getundertimed(context); -notfirsttimed: - context.bl = context.data.byte(335); - context.bh = 0; - context.al = context.data.byte(336); - context.ah = 0; - context.di = context.ax; - context.es = context.data.word(332); - context.si = context.data.word(334); - context.dl = 237; - context.ah = 0; - printdirect(context); - context.data.byte(337) = 1; -notext: - return; -deltimedtext: - putundertimed(context); - context.data.byte(337) = 1; +static void allocateload(Context & context) { + context.push(context.es); + context.push(context.di); + context.bx = context.data.word(context.di); + context.cl = 4; + context._shr(context.bx, context.cl); + allocatemem(context); + context.di = context.pop(); + context.es = context.pop(); return; } -static inline void dumpmap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); - multidump(context); +static void fillspace(Context & context) { + context.push(context.es); + context.push(context.ds); + context.push(context.dx); + context.push(context.di); + context.push(context.bx); + context.di = context.dx; + context.es = context.ds; + while(--context.cx) context._stosb(); + context.bx = context.pop(); + context.di = context.pop(); + context.dx = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); return; } -static inline void multidump(Context & context) { - context.dx = 0x0a000; - context.es = context.dx; - context.ds = context.data.word(400); - context.ax = context.bx; - context.bx = 320; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = 320; - context.si = context.di; - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth; - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.bl = context.cl; - context.bh = 0; - context._neg(context.bx); - context._add(context.bx, context.dx); - context.cl = context.ch; - context.ch = 0; -multiloop1: - __dispatch_call(context, context.ax); - context._add(context.di, context.bx); - context._add(context.si, context.bx); - if (--context.cx) goto multiloop1; +static void getridoftemp(Context & context) { + context.es = context.data.word(458); + deallocatemem(context); return; -oddwidth: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.bl = context.cl; - context.bh = 0; - context._neg(context.bx); - context._add(context.bx, 320); - context.cl = context.ch; - context.ch = 0; -multiloop2: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.bx); - context._add(context.si, context.bx); - if (--context.cx) goto multiloop2; +} + +static void getridoftemptext(Context & context) { + context.es = context.data.word(466); + deallocatemem(context); return; } -static inline void dumptimedtext(Context & context) { - context._cmp(context.data.byte(337), 1); - if (!context.flags.z()) goto nodumptimed; - context.al = context.data.byte(335); - context._sub(context.al, 3); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(336); - context.ah = 0; - context.di = context.ax; - context.cl = 240; - context.ch = 30; - multidump(context); - context.data.byte(337) = 0; -nodumptimed: +static void getridoftemp2(Context & context) { + context.es = context.data.word(460); + deallocatemem(context); return; } -static inline void runendseq(Context & context) { - atmospheres(context); - context.data.byte(103) = 0; -moreendseq: - vsync(context); - spriteupdate(context); - vsync(context); - deleverything(context); - printsprites(context); - reelsonscreen(context); - afterintroroom(context); - usetimedtext(context); - vsync(context); - dumpmap(context); - dumptimedtext(context); - vsync(context); - context._cmp(context.data.byte(103), 1); - if (!context.flags.z()) goto moreendseq; +static void getridoftemp3(Context & context) { + context.es = context.data.word(462); + deallocatemem(context); return; } -static inline void gettingshot(Context & context) { - context.data.byte(188) = 55; - clearpalette(context); - loadintroroom(context); - fadescreenups(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; - runendseq(context); - clearbeforeload(context); +static void getridoftempcharset(Context & context) { + context.es = context.data.word(406); + deallocatemem(context); return; } -static inline void getridoftemptext(Context & context) { - context.es = context.data.word(466); +static void getridoftempsp(Context & context) { + context.es = context.data.word(464); deallocatemem(context); return; } -static inline void endgame(Context & context) { - context.dx = 2273; - loadtemptext(context); - monkspeaking(context); - gettingshot(context); - getridoftemptext(context); - context.data.byte(387) = 7; - context.data.byte(388) = 1; - context.cx = 200; - hangon(context); +static void readsetdata(Context & context) { + context.dx = 1870; + standardload(context); + context.data.word(404) = context.ax; + context.dx = 1935; + standardload(context); + context.data.word(408) = context.ax; + context.dx = 1948; + standardload(context); + context.data.word(410) = context.ax; + context.dx = 1832; + standardload(context); + context.data.word(414) = context.ax; + context.dx = 2234; + standardload(context); + context.data.word(454) = context.ax; + context.dx = 2286; + standardload(context); + context.data.word(452) = context.ax; + context.ax = context.data.word(404); + context.data.word(268) = context.ax; + context._cmp(context.data.byte(378), 255); + if (context.flags.z()) goto novolumeload; + context.dx = 2299; + openfile(context); + context.cx = 2048-256; + context.ds = context.data.word(353); + context.dx = 16384; + readfromfile(context); + closefile(context); +novolumeload: return; } -static inline void dreamweb(Context & context) { +static void dreamweb(Context & context) { seecommandtail(context); checkbasemem(context); soundstartup(context); @@ -21536,6 +21430,8 @@ data.assign(src, src + sizeof(src)); }; +void __start(Context &context) { dreamweb(context); } + void __dispatch_call(Context &context, unsigned addr) { switch(addr) { case 0xc000: alleybarksound(context); break; @@ -22132,7 +22028,6 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc93c: getridofpit(context); break; case 0xc940: pitinterupt(context); break; case 0xc944: dreamweb(context); break; - case 0xc944: dreamweb(context); break; case 0xc948: entrytexts(context); break; case 0xc94c: entryanims(context); break; case 0xc950: initialinv(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 7cad64ee2e..f4d1801b96 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -13,40 +13,28 @@ namespace dreamgen { typedef RegisterContext Context; void __dispatch_call(Context &context, unsigned addr); + void __start(Context &context); void randomnumber(Context &context); void quickquit(Context &context); void quickquit2(Context &context); - void deallocatemem(Context &context); - void vsync(Context &context); - void closefile(Context &context); - void readfromfile(Context &context); - void allocatemem(Context &context); - void openfile(Context &context); - void loadsecondsample(Context &context); - void mousecall(Context &context); - void loadseg(Context &context); - void dontloadseg(Context &context); - void showgroup(Context &context); - void showpcx(Context &context); - void mode640x480(Context &context); - void setmode(Context &context); - void scanfornames(Context &context); - void openfilenocheck(Context &context); - void setsoundoff(Context &context); - void loadsample(Context &context); - void set16colpalette(Context &context); - void gettime(Context &context); - void fadedos(Context &context); - void setmouse(Context &context); - void setupemm(Context &context); - void setkeyboardint(Context &context); - void soundstartup(Context &context); void keyboardread(Context &context); void resetkeyboard(Context &context); + void setkeyboardint(Context &context); + void readfromfile(Context &context); + void closefile(Context &context); void openforsave(Context &context); + void openfilenocheck(Context &context); + void openfile(Context &context); void createfile(Context &context); + void dontloadseg(Context &context); + void mousecall(Context &context); + void setmouse(Context &context); + void gettime(Context &context); + void allocatemem(Context &context); + void deallocatemem(Context &context); void removeemm(Context &context); + void setupemm(Context &context); void pitinterupt(Context &context); void getridofpit(Context &context); void setuppit(Context &context); @@ -63,15 +51,28 @@ namespace dreamgen { void disablesoundint(Context &context); void enablesoundint(Context &context); void checksoundint(Context &context); + void setsoundoff(Context &context); + void soundstartup(Context &context); + void loadsecondsample(Context &context); + void loadsample(Context &context); void loadspeech(Context &context); + void scanfornames(Context &context); void saveseg(Context &context); + void loadseg(Context &context); void loadposition(Context &context); void saveposition(Context &context); void error(Context &context); void generalerror(Context &context); void dosreturn(Context &context); + void set16colpalette(Context &context); + void mode640x480(Context &context); + void showgroup(Context &context); + void fadedos(Context &context); void doshake(Context &context); + void vsync(Context &context); + void setmode(Context &context); void readoneblock(Context &context); + void showpcx(Context &context); } diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index ec3c9992a3..594357203f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -40,6 +40,7 @@ #include "graphics/palette.h" #include "dreamweb/dreamweb.h" +#include "dreamweb/dreamgen.h" namespace DreamWeb { @@ -91,6 +92,9 @@ void DreamWebEngine::waitForVSync() { Common::Error DreamWebEngine::run() { _console = new DreamWebConsole(this); + + dreamgen::Context context; + dreamgen::__start(context); Common::EventManager *event_manager = _system->getEventManager(); getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this); -- cgit v1.2.3 From 1f063c947b34ba9e56fabcbdf838094da80b3727 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 5 Jun 2011 15:01:01 +0400 Subject: DREAMWEB: added stubs --- engines/dreamweb/dreamweb.cpp | 236 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 594357203f..9e04147d40 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -133,3 +133,239 @@ Common::Error DreamWebEngine::run() { } } // End of namespace DreamWeb + + +namespace dreamgen { +void randomnumber(Context &context) { + ::error("randomnumber"); +} + +void quickquit(Context &context) { + ::error("quickquit"); +} + +void quickquit2(Context &context) { + ::error("quickquit2"); +} + +void keyboardread(Context &context) { + ::error("keyboardread"); +} + +void resetkeyboard(Context &context) { + ::error("resetkeyboard"); +} + +void setkeyboardint(Context &context) { + ::error("setkeyboardint"); +} + +void readfromfile(Context &context) { + ::error("readfromfile"); +} + +void closefile(Context &context) { + ::error("closefile"); +} + +void openforsave(Context &context) { + ::error("openforsave"); +} + +void openfilenocheck(Context &context) { + ::error("openfilenocheck"); +} + +void openfile(Context &context) { + ::error("openfile"); +} + +void createfile(Context &context) { + ::error("createfile"); +} + +void dontloadseg(Context &context) { + ::error("dontloadseg"); +} + +void mousecall(Context &context) { + ::error("mousecall"); +} + +void setmouse(Context &context) { + ::error("setmouse"); +} + +void gettime(Context &context) { + ::error("gettime"); +} + +void allocatemem(Context &context) { + ::error("allocatemem"); +} + +void deallocatemem(Context &context) { + ::error("deallocatemem"); +} + +void removeemm(Context &context) { + ::error("removeemm"); +} + +void setupemm(Context &context) { + ::error("setupemm"); +} + +void pitinterupt(Context &context) { + ::error("pitinterupt"); +} + +void getridofpit(Context &context) { + ::error("getridofpit"); +} + +void setuppit(Context &context) { + ::error("setuppit"); +} + +void startdmablock(Context &context) { + ::error("startdmablock"); +} + +void dmaend(Context &context) { + ::error("dmaend"); +} + +void restoreems(Context &context) { + ::error("restoreems"); +} + +void saveems(Context &context) { + ::error("saveems"); +} + +void bothchannels(Context &context) { + ::error("bothchannels"); +} + +void channel1only(Context &context) { + ::error("channel1only"); +} + +void channel0only(Context &context) { + ::error("channel0only"); +} + +void out22c(Context &context) { + ::error("out22c"); +} + +void soundend(Context &context) { + ::error("soundend"); +} + +void interupttest(Context &context) { + ::error("interupttest"); +} + +void disablesoundint(Context &context) { + ::error("disablesoundint"); +} + +void enablesoundint(Context &context) { + ::error("enablesoundint"); +} + +void checksoundint(Context &context) { + ::error("checksoundint"); +} + +void setsoundoff(Context &context) { + ::error("setsoundoff"); +} + +void soundstartup(Context &context) { + ::error("soundstartup"); +} + +void loadsecondsample(Context &context) { + ::error("loadsecondsample"); +} + +void loadsample(Context &context) { + ::error("loadsample"); +} + +void loadspeech(Context &context) { + ::error("loadspeech"); +} + +void scanfornames(Context &context) { + ::error("scanfornames"); +} + +void saveseg(Context &context) { + ::error("saveseg"); +} + +void loadseg(Context &context) { + ::error("loadseg"); +} + +void loadposition(Context &context) { + ::error("loadposition"); +} + +void saveposition(Context &context) { + ::error("saveposition"); +} + +void error(Context &context) { + ::error("error"); +} + +void generalerror(Context &context) { + ::error("generalerror"); +} + +void dosreturn(Context &context) { + ::error("dosreturn"); +} + +void set16colpalette(Context &context) { + ::error("set16colpalette"); +} + +void mode640x480(Context &context) { + ::error("mode640x480"); +} + +void showgroup(Context &context) { + ::error("showgroup"); +} + +void fadedos(Context &context) { + ::error("fadedos"); +} + +void doshake(Context &context) { + ::error("doshake"); +} + +void vsync(Context &context) { + ::error("vsync"); +} + +void setmode(Context &context) { + ::error("setmode"); +} + +void readoneblock(Context &context) { + ::error("readoneblock"); +} + +void showpcx(Context &context) { + ::error("showpcx"); +} + +} /*namespace dreamgen */ -- cgit v1.2.3 From 9cf2a7ba0e686b35a4f1041f67c51cb9ef2fa867 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 5 Jun 2011 15:05:12 +0400 Subject: DREAMWEB: added tasm-recover tool --- devtools/tasmrecover/runtime.h | 330 ++++++++++++++++++++ devtools/tasmrecover/tasm-recover | 11 + devtools/tasmrecover/tasm/__init__.py | 0 devtools/tasmrecover/tasm/__init__.pyc | Bin 0 -> 137 bytes devtools/tasmrecover/tasm/cpp.py | 544 +++++++++++++++++++++++++++++++++ devtools/tasmrecover/tasm/cpp.pyc | Bin 0 -> 22205 bytes devtools/tasmrecover/tasm/lex.py | 52 ++++ devtools/tasmrecover/tasm/lex.pyc | Bin 0 -> 1058 bytes devtools/tasmrecover/tasm/op.py | 394 ++++++++++++++++++++++++ devtools/tasmrecover/tasm/op.pyc | Bin 0 -> 32291 bytes devtools/tasmrecover/tasm/parser.py | 248 +++++++++++++++ devtools/tasmrecover/tasm/parser.pyc | Bin 0 -> 8391 bytes devtools/tasmrecover/tasm/proc.py | 84 +++++ devtools/tasmrecover/tasm/proc.pyc | Bin 0 -> 3100 bytes 14 files changed, 1663 insertions(+) create mode 100644 devtools/tasmrecover/runtime.h create mode 100755 devtools/tasmrecover/tasm-recover create mode 100644 devtools/tasmrecover/tasm/__init__.py create mode 100644 devtools/tasmrecover/tasm/__init__.pyc create mode 100644 devtools/tasmrecover/tasm/cpp.py create mode 100644 devtools/tasmrecover/tasm/cpp.pyc create mode 100644 devtools/tasmrecover/tasm/lex.py create mode 100644 devtools/tasmrecover/tasm/lex.pyc create mode 100644 devtools/tasmrecover/tasm/op.py create mode 100644 devtools/tasmrecover/tasm/op.pyc create mode 100644 devtools/tasmrecover/tasm/parser.py create mode 100644 devtools/tasmrecover/tasm/parser.pyc create mode 100644 devtools/tasmrecover/tasm/proc.py create mode 100644 devtools/tasmrecover/tasm/proc.pyc diff --git a/devtools/tasmrecover/runtime.h b/devtools/tasmrecover/runtime.h new file mode 100644 index 0000000000..5824728283 --- /dev/null +++ b/devtools/tasmrecover/runtime.h @@ -0,0 +1,330 @@ +#ifndef TASM_RECOVER_H__ +#define TASM_RECOVER_H__ + +#include +#include +#include + +typedef uint16_t uint16; +typedef uint8_t uint8; +typedef int16_t int16; +typedef int8_t int8; + +//little endian +#define REG_LOW 0 +#define REG_HIGH 1 + +struct Register { + union { + uint16 _value; + uint8 _part[2]; + }; + inline Register(): _value() {} + inline Register& operator=(uint16_t v) { _value = v; return *this; } + inline operator uint16&() { return _value; } + inline void cbw() { + if (_value & 0x80) + _value |= 0xff00; + else + _value &= 0xff; + } +}; + +template +struct RegisterPart { + uint8_t &_part; + + inline RegisterPart(Register ®) : _part(reg._part[PART]) {} + + inline operator uint8&() { + return _part; + } + inline RegisterPart& operator=(const RegisterPart& o) { + _part = o._part; + return *this; + } + inline RegisterPart& operator=(uint8_t v) { + _part = v; + return *this; + } +}; + +struct WordRef { + std::vector &data; + unsigned index; + bool changed; + uint16_t value; + + inline WordRef(std::vector &data, unsigned index) : data(data), index(index), changed(false) { + assert(index + 1 < data.size()); + value = data[index] | (data[index + 1] << 8); + } + inline WordRef& operator=(const WordRef &ref) { + changed = true; + value = ref.value; + return *this; + } + inline WordRef& operator=(uint16_t v) { + changed = true; + value = v; + return *this; + } + inline operator uint16_t() const { + return value; + } + inline operator uint16_t&() { + return value; + } + inline ~WordRef() { + if (changed) { + data[index] = value & 0xff; + data[index + 1] = value >> 8; + } + } +}; + +struct Segment { + std::vector data; + inline uint8_t &byte(unsigned index) { + assert(index < data.size()); + return data[index]; + } + inline uint16_t word(unsigned index) const { + assert(index + 1 < data.size()); + return data[index] | (data[index + 1] << 8); + } + + inline WordRef word(unsigned index) { + return WordRef(data, index); + } +}; + + +struct SegmentRef { + public: + uint16_t value; + std::vector *data; + inline SegmentRef& operator=(const SegmentRef &o) { + data = o.data; + return *this; + } + inline SegmentRef& operator=(const uint16_t id) { + return *this; + } + inline uint8_t &byte(unsigned index) { + assert(index < data->size()); + return (*data)[index]; + } + inline uint16_t word(unsigned index) const { + assert(index + 1 < data->size()); + return (*data)[index] | ((*data)[index + 1] << 8); + } + + inline operator uint16_t() const { + return value; + } + + inline WordRef word(unsigned index) { + return WordRef(*data, index); + } +}; + +struct Flags { + bool _z, _c, _s, _o; + inline Flags(): _z(true), _c(false), _s(false), _o(false) {} + + inline bool z() const { return _z; } + inline bool c() const { return _c; } + inline bool s() const { return _s; } + //complex flags: + inline bool g() const { return !_z && _s == _o; } + inline bool ge() const { return _z || _s == _o; } + inline bool l() const { return !_z && _s != _o; } + inline bool le() const { return _z || _s != _o; } + + inline void update_sign(uint8 v) { + bool s = v & 0x80; + _o = s != _s; + _s = s; + _z = v == 0; + } + + inline void update(uint16 v) { + bool s = v & 0x8000; + _o = s != _s; + _s = s; + _z = v == 0; + } +}; + +template +struct RegisterContext { + Register ax, dx, bx, cx, si, di; + RegisterPart al; + RegisterPart ah; + RegisterPart bl; + RegisterPart bh; + RegisterPart cl; + RegisterPart ch; + RegisterPart dl; + RegisterPart dh; + + SegmentRef cs, ds, es; + Flags flags; + + inline RegisterContext(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx) {} + + inline void _cmp(uint8 a, uint8 b) { + uint8 x = a; + _sub(x, b); + } + inline void _cmp(uint16 a, uint16 b) { + uint16 x = a; + _sub(x, b); + } + inline void _test(uint8 a, uint8 b) { + uint8 x = a; + _and(x, b); + } + inline void _test(uint16 a, uint16 b) { + uint16 x = a; + _and(x, b); + } + + inline void _add(uint8 &dst, uint8 src) { + flags._c = dst + src < dst; + dst += src; + flags.update(dst); + } + inline void _add(uint16 &dst, uint16 src) { + flags._c = dst + src < dst; + dst += src; + flags.update(dst); + } + inline void _sub(uint8 &dst, uint8 src) { + flags._c = dst < src; + dst -= src; + flags.update(dst); + } + inline void _sub(uint16 &dst, uint16 src) { + flags._c = dst < src; + dst -= src; + flags.update(dst); + } + + inline void _and(uint8 &dst, uint8 src) { + dst &= src; + flags._c = false; + flags.update(dst); + } + inline void _and(uint16 &dst, uint16 src) { + dst &= src; + flags._c = false; + flags.update(dst); + } + inline void _or(uint8 &dst, uint8 src) { + dst |= src; + flags._c = false; + flags.update(dst); + } + inline void _or(uint16 &dst, uint16 src) { + dst |= src; + flags._c = false; + flags.update(dst); + } + + inline void _xor(uint8 &dst, uint8 src) { + dst ^= src; + flags._c = false; + flags.update(dst); + } + inline void _xor(uint16 &dst, uint16 src) { + dst ^= src; + flags._c = false; + flags.update(dst); + } + + inline void _shr(uint8 &dst, uint8 src) {} + inline void _shr(uint16 &dst, uint8 src) {} + inline void _shl(uint8 &dst, uint8 src) {} + inline void _shl(uint16 &dst, uint8 src) {} + inline void _mul(uint8 src) { + unsigned r = unsigned(al) * src; + ax = (uint16)r; + flags._c = r >= 0x10000; + flags._z = r == 0; + bool s = r & 0x8000; + flags._o = s != flags._s; + flags._s = s; + } + inline void _mul(uint16 src) { + unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits + dx = (r >> 16) & 0xffff; + ax = r & 0xffff; + flags._c = false;//fixme + flags._z = r == 0; + bool s = r & 0x80000000; + flags._o = s != flags._s; + flags._s = s; + } + inline void _neg(uint8 &src) { + src = ~src; + flags._c = false; + flags.update(src); + } + inline void _neg(uint16 &src) { + src = ~src; + flags._c = false; + flags.update(src); + } + + inline void _movsb() { + es.byte(di++) = ds.byte(si++); + } + inline void _movsw() { + es.word(di) = ds.word(si); + di += 2; + si += 2; + } + inline void _lodsb() { + al = ds.byte(si++); + } + inline void _lodsw() { + ax = ds.word(si); + si += 2; + } + inline void _stosb() { + es.byte(di++) = al; + } + inline void _stosw() { + es.word(di) = al; + di += 2; + } + + inline void _xchg(uint16 &a, uint16 &b) { + uint16 x = a; + a = b; + b = x; + } + + inline void _xchg(uint8 &a, uint8 &b) { + uint8 t = a; + a = b; + b = t; + } + + std::vector stack; + inline void push(uint16 v) { + stack.push_back(v); + } + inline uint16 pop() { + uint16 v = stack.back(); + stack.pop_back(); + return v; + } + + Data data; +}; + +#endif + diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover new file mode 100755 index 0000000000..c4214b205a --- /dev/null +++ b/devtools/tasmrecover/tasm-recover @@ -0,0 +1,11 @@ +#!/usr/bin/python + +from tasm.parser import parser +from tasm.cpp import cpp + +p = parser() +p.strip_path = 3 +context = p.parse('dreamweb/dreamweb.asm') +p.link() +generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2']) +generator.generate('dreamweb') #start routine diff --git a/devtools/tasmrecover/tasm/__init__.py b/devtools/tasmrecover/tasm/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/devtools/tasmrecover/tasm/__init__.pyc b/devtools/tasmrecover/tasm/__init__.pyc new file mode 100644 index 0000000000..8582b7b592 Binary files /dev/null and b/devtools/tasmrecover/tasm/__init__.pyc differ diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py new file mode 100644 index 0000000000..53338c1d02 --- /dev/null +++ b/devtools/tasmrecover/tasm/cpp.py @@ -0,0 +1,544 @@ +import op, traceback, re, proc +from copy import copy +proc_module = proc + +class CrossJump(Exception): + pass + +def parse_bin(s): + b = s.group(1) + v = hex(int(b, 2)) + #print "BINARY: %s -> %s" %(b, v) + return v + +class cpp: + def __init__(self, context, namespace, skip_first = 0, blacklist = []): + self.namespace = namespace + fname = namespace + ".cpp" + header = namespace + ".h" + self.fd = open(fname, "wt") + self.hd = open(header, "wt") + self.context = context + self.data_seg = context.binary_data + self.procs = context.proc_list + self.skip_first = skip_first + self.proc_queue = [] + self.proc_done = [] + self.blacklist = blacklist + self.failed = list(blacklist) + self.translated = [] + self.proc_addr = [] + self.forwards = [] + self.fd.write("""#include \"%s\" + +namespace %s { + +""" %(header, namespace)) + + def expand_cb(self, match): + name = match.group(0).lower() + if len(name) == 2 and \ + ((name[0] in ['a', 'b', 'c', 'd'] and name[1] in ['h', 'x', 'l']) or name in ['si', 'di', 'es', 'ds', 'cs']): + return "context.%s" %name + + if self.indirection == -1: + try: + offset,p,p = self.context.get_offset(name) + print "OFFSET = %d" %offset + self.indirection = 0 + return str(offset) + except: + pass + + g = self.context.get_global(name) + if isinstance(g, op.const): + value = self.expand(g.value) + elif isinstance(g, proc.proc): + if self.indirection != -1: + raise Exception("invalid proc label usage") + value = str(g.offset) + self.indirection = 0 + else: + size = g.size + if size == 0: + raise Exception("invalid var '%s' size %u" %(name, size)) + if self.indirection == 0: + value = "context.data.%s(%d)" %("byte" if size == 1 else "word", g.offset) + elif self.indirection == -1: + value = "%s" %g.offset + self.indirection = 0 + else: + raise Exception("invalid indirection %d" %self.indirection) + return value + + def get_size(self, expr): + #print 'get_size("%s")' %expr + try: + v = self.context.parse_int(expr) + return 1 if v < 256 else 2 + except: + pass + + if re.match(r'byte\s+ptr\s', expr) is not None: + return 1 + + if re.match(r'word\s+ptr\s', expr) is not None: + return 2 + + if len(expr) == 2 and expr[0] in ['a', 'b', 'c', 'd'] and expr[1] in ['h', 'l']: + return 1 + if expr in ['ax', 'bx', 'cx', 'dx', 'si', 'di', 'sp', 'bp', 'ds', 'cs', 'es', 'fs']: + return 2 + + m = re.match(r'[a-zA-Z_]\w*', expr) + if m is not None: + name = m.group(0) + try: + g = self.context.get_global(name) + return g.size + except: + pass + + return 0 + + def expand(self, expr, def_size = 0): + #print "EXPAND \"%s\"" %expr + size = self.get_size(expr) if def_size == 0 else def_size + indirection = 0 + seg = None + reg = True + + m = re.match(r'seg\s+(.*?)$', expr) + if m is not None: + return "context.ds" + + match_id = True + m = re.match(r'offset\s+(.*?)$', expr) + if m is not None: + indirection -= 1 + expr = m.group(1).strip() + + m = re.match(r'byte\s+ptr\s+(.*?)$', expr) + if m is not None: + expr = m.group(1).strip() + + m = re.match(r'word\s+ptr\s+(.*?)$', expr) + if m is not None: + expr = m.group(1).strip() + + m = re.match(r'\[(.*)\]$', expr) + if m is not None: + indirection += 1 + expr = m.group(1).strip() + + m = re.match(r'(\w{2,2}):(.*)$', expr) + if m is not None: + seg = m.group(1) + expr = m.group(2).strip() + print "SEGMENT %s, remains: %s" %(seg, expr) + + m = re.match(r'(([abcd][xhl])|si|di|bp|sp)([\+-].*)?$', expr) + if m is not None: + reg = m.group(1) + plus = m.group(3) + if plus is not None: + plus = self.expand(plus) + else: + plus = "" + match_id = False + #print "COMMON_REG: ", reg, plus + expr = "context.%s%s" %(reg, plus) + + expr = re.sub(r'\b([0-9][a-fA-F0-9]*)h', '0x\\1', expr) + expr = re.sub(r'\b([0-1]+)b', parse_bin, expr) + expr = re.sub(r'"(.)"', '\'\\1\'', expr) + if match_id: + #print "BEFORE: %d" %indirection + self.indirection = indirection + expr = re.sub(r'\b[a-zA-Z_][a-zA-Z0-9_]+\b', self.expand_cb, expr) + indirection = self.indirection + #print "AFTER: %d" %indirection + + if indirection == 1: + if size == 1: + expr = "context.data.byte(%s)" %expr + elif size == 2: + expr = "context.data.word(%s)" %expr + else: + expr = "@invalid size 0" + elif indirection == 0: + pass + elif indirection == -1: + expr = "&%s" %expr + else: + raise Exception("invalid indirection %d" %indirection) + return expr + + def mangle_label(self, name): + name = name.lower() + return re.sub(r'\$', '_tmp', name) + + def resolve_label(self, name): + name = name.lower() + if not name in self.proc.labels: + try: + offset, proc, pos = self.context.get_offset(name) + except: + print "no label %s, trying procedure" %name + proc = self.context.get_global(name) + pos = 0 + if not isinstance(proc, proc_module.proc): + raise CrossJump("cross-procedure jump to non label and non procedure %s" %(name)) + self.proc.labels.add(name) + for i in xrange(0, len(self.unbounded)): + u = self.unbounded[i] + if u[1] == proc: + if pos < u[2]: + self.unbounded[i] = (name, proc, pos) + return self.mangle_label(name) + self.unbounded.append((name, proc, pos)) + + return self.mangle_label(name) + + def jump_to_label(self, name): + jump_proc = False + if name in self.blacklist: + jump_proc = True + + if self.context.has_global(name) : + g = self.context.get_global(name) + if isinstance(g, proc_module.proc): + jump_proc = True + + if jump_proc: + self.add_forward(name) + return "{ %s(context); return; }" %name + else: + return "goto %s" %self.resolve_label(name) + + def _label(self, name): + self.body += "%s:\n" %self.mangle_label(name) + + def schedule(self, name): + name = name.lower() + if name in self.proc_queue or name in self.proc_done or name in self.failed: + return + print "+scheduling function %s..." %name + self.proc_queue.append(name) + + def add_forward(self, name): + if name not in self.forwards and name not in self.failed: + self.forwards.append(name) + + def _call(self, name): + name = name.lower() + if name == 'ax': + self.body += "\t__dispatch_call(context, %s);\n" %self.expand('ax', 2) + return + self.body += "\t%s(context);\n" %name + self.add_forward(name); + self.schedule(name) + + def _ret(self): + self.body += "\treturn;\n" + + def parse2(self, dst, src): + dst_size, src_size = self.get_size(dst), self.get_size(src) + if dst_size == 0: + if src_size == 0: + raise Exception("both sizes are 0") + dst_size = src_size + if src_size == 0: + src_size = dst_size + + dst = self.expand(dst, dst_size) + src = self.expand(src, src_size) + return dst, src + + def _mov(self, dst, src): + self.body += "\t%s = %s;\n" %self.parse2(dst, src) + + def _add(self, dst, src): + self.body += "\tcontext._add(%s, %s);\n" %self.parse2(dst, src) + + def _sub(self, dst, src): + self.body += "\tcontext._sub(%s, %s);\n" %self.parse2(dst, src) + + def _and(self, dst, src): + self.body += "\tcontext._and(%s, %s);\n" %self.parse2(dst, src) + + def _or(self, dst, src): + self.body += "\tcontext._or(%s, %s);\n" %self.parse2(dst, src) + + def _xor(self, dst, src): + self.body += "\tcontext._xor(%s, %s);\n" %self.parse2(dst, src) + + def _neg(self, dst): + dst = self.expand(dst) + self.body += "\tcontext._neg(%s);\n" %(dst) + + def _cbw(self): + self.body += "\tcontext.ax.cbw();\n" + + def _shr(self, dst, src): + self.body += "\tcontext._shr(%s, %s);\n" %self.parse2(dst, src) + + def _shl(self, dst, src): + self.body += "\tcontext._shl(%s, %s);\n" %self.parse2(dst, src) + + def _sar(self, dst, src): + self.body += "\tcontext._sar(%s%s);\n" %self.parse2(dst, src) + + def _sal(self, dst, src): + self.body += "\tcontext._sal(%s, %s);\n" %self.parse2(dst, src) + + def _rcl(self, dst, src): + self.body += "\tcontext._rcl(%s, %s);\n" %self.parse2(dst, src) + + def _rcr(self, dst, src): + self.body += "\tcontext._rcr(%s, %s);\n" %self.parse2(dst, src) + + def _mul(self, src): + src = self.expand(src) + self.body += "\tcontext._mul(%s);\n" %(src) + + def _div(self, src): + src = self.expand(src) + self.body += "\tcontext._div(%s);\n" %(src) + + def _inc(self, dst): + dst = self.expand(dst) + self.body += "\tcontext._add(%s, 1);\n" %(dst) + + def _dec(self, dst): + dst = self.expand(dst) + self.body += "\tcontext._sub(%s, 1);\n" %(dst) + + def _cmp(self, a, b): + self.body += "\tcontext._cmp(%s, %s);\n" %self.parse2(a, b) + + def _test(self, a, b): + self.body += "\tcontext._test(%s, %s);\n" %self.parse2(a, b) + + def _js(self, label): + self.body += "\tif (context.flags.s()) %s;\n" %(self.jump_to_label(label)) + + def _jns(self, label): + self.body += "\tif (!context.flags.s()) %s;\n" %(self.jump_to_label(label)) + + def _jz(self, label): + self.body += "\tif (context.flags.z()) %s;\n" %(self.jump_to_label(label)) + + def _jnz(self, label): + self.body += "\tif (!context.flags.z()) %s;\n" %(self.jump_to_label(label)) + + def _jl(self, label): + self.body += "\tif (context.flags.l()) %s;\n" %(self.jump_to_label(label)) + + def _jg(self, label): + self.body += "\tif (!context.flags.g()) %s;\n" %(self.jump_to_label(label)) + + def _jle(self, label): + self.body += "\tif (context.flags.le()) %s;\n" %(self.jump_to_label(label)) + + def _jge(self, label): + self.body += "\tif (!context.flags.ge()) %s;\n" %(self.jump_to_label(label)) + + def _jc(self, label): + self.body += "\tif (context.flags.c()) %s;\n" %(self.jump_to_label(label)) + + def _jnc(self, label): + self.body += "\tif (!context.flags.c()) %s;\n" %(self.jump_to_label(label)) + + def _xchg(self, dst, src): + self.body += "\tcontext._xchg(%s, %s);\n" %self.parse2(dst, src) + + def _jmp(self, label): + self.body += "\t%s;\n" %(self.jump_to_label(label)) + + def _loop(self, label): + self.body += "\tif (--context.cx) %s;\n" %self.jump_to_label(label) + + def _push(self, regs): + p = str(); + for r in regs: + r = self.expand(r) + p += "\tcontext.push(%s);\n" %(r) + self.body += p + + def _pop(self, regs): + p = str(); + for r in regs: + self.temps_count -= 1 + i = self.temps_count + r = self.expand(r) + p += "\t%s = context.pop();\n" %r + self.body += p + + def _rep(self): + self.body += "\twhile(--context.cx) "; + + def _lodsb(self): + self.body += "\tcontext._lodsb();\n"; + + def _lodsw(self): + self.body += "\tcontext._lodsw();\n"; + + def _stosb(self): + self.body += "\tcontext._stosb();\n"; + + def _stosw(self): + self.body += "\tcontext._stosw();\n"; + + def _movsb(self): + self.body += "\tcontext._movsb();\n "; + + def _movsw(self): + self.body += "\tcontext._movsw();\n "; + + def __proc(self, name, def_skip = 0): + try: + skip = def_skip + self.temps_count = 0 + self.temps_max = 0 + if self.context.has_global(name): + self.proc = self.context.get_global(name) + else: + print "No procedure named %s, trying label" %name + off, src_proc, skip = self.context.get_offset(name) + + self.proc = proc_module.proc(name) + self.proc.stmts = copy(src_proc.stmts) + self.proc.labels = copy(src_proc.labels) + #for p in xrange(skip, len(self.proc.stmts)): + # s = self.proc.stmts[p] + # if isinstance(s, op.basejmp): + # o, p, s = self.context.get_offset(s.label) + # if p == src_proc and s < skip: + # skip = s + + + self.proc_addr.append((name, self.proc.offset)) + self.body = str() + self.body += "static void %s(Context & context) {\n" %name; + self.proc.optimize() + self.unbounded = [] + self.proc.visit(self, skip) + + #adding remaining labels: + for i in xrange(0, len(self.unbounded)): + u = self.unbounded[i] + print "UNBOUNDED: ", u + proc = u[1] + for p in xrange(u[2], len(proc.stmts)): + s = proc.stmts[p] + if isinstance(s, op.basejmp): + self.resolve_label(s.label) + + #adding statements + for label, proc, offset in self.unbounded: + self.body += "/*continuing to unbounded code: %s from %s:%d-%d*/\n" %(label, proc.name, offset, len(proc.stmts)) + start = len(self.proc.stmts) + self.proc.add_label(label) + for s in proc.stmts[offset:]: + if isinstance(s, op.label): + self.proc.labels.add(s.name) + self.proc.stmts.append(s) + self.proc.add("ret") + print "skipping %d instructions, todo: %d" %(start, len(self.proc.stmts) - start) + self.proc.visit(self, start) + self.body += "}\n"; + self.translated.insert(0, self.body) + self.proc = None + if self.temps_count > 0: + raise Exception("temps count == %d at the exit of proc" %self.temps_count); + return True + except (CrossJump, op.Unsupported) as e: + print "%s: ERROR: %s" %(name, e) + self.failed.append(name) + except: + raise + + def get_type(self, width): + return "uint%d_t" %(width * 8) + + def write_stubs(self, fname, procs): + fd = open(fname, "wt") + fd.write("namespace %s {\n" %self.namespace) + for p in procs: + fd.write("void %s(Context &context) {\n\t::error(\"%s\");\n}\n\n" %(p, p)) + fd.write("} /*namespace %s */\n" %self.namespace) + fd.close() + + + def generate(self, start): + #print self.prologue() + #print context + self.proc_queue.append(start) + while len(self.proc_queue): + name = self.proc_queue.pop() + if name in self.failed or name in self.proc_done: + continue + if len(self.proc_queue) == 0 and len(self.procs) > 0: + print "queue's empty, adding remaining procs:" + for p in self.procs: + self.schedule(p) + self.procs = [] + print "continuing on %s" %name + self.proc_done.append(name) + self.__proc(name) + self.write_stubs("_stubs.cpp", self.failed) + done, failed = len(self.proc_done), len(self.failed) + for f in self.forwards: + if f not in self.failed: + self.fd.write("static void %s(Context &context);\n" %f) + self.fd.write("\n") + self.fd.write("\n".join(self.translated)) + self.fd.write("\n\n") + print "%d ok, %d failed of %d, %.02g%% translated" %(done, failed, done + failed, 100.0 * done / (done + failed)) + print "\n".join(self.failed) + data_decl = "struct Data : public Segment {\n\t\tData();\n" + data_impl = "Data::Data() {\n" + data_bin = self.data_seg + data_impl += "\tstatic const uint8 src[] = {\n\t\t" + n = 0 + for v in data_bin: + data_impl += "%s, " %v + n += 1 + if (n & 0xf) == 0: + data_impl += "\n\t\t" + data_impl += "};\ndata.assign(src, src + sizeof(src));\n" + hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper() + data_decl += "\t};\n\n" + data_impl += "\t};\n\n" + self.hd.write("""#ifndef %s +#define %s +""" %(hid, hid)) + self.hd.write( +"""\n#\tinclude "runtime.h" + +namespace %s { + + %s + typedef RegisterContext Context; + + void __dispatch_call(Context &context, unsigned addr); + void __start(Context &context); + +""" %(self.namespace, data_decl)) + self.fd.write(data_impl) + + for f in self.failed: + self.hd.write("\tvoid %s(Context &context);\n" %f) + self.hd.write("\n}\n\n#endif\n") + self.hd.close() + + self.fd.write("\nvoid __start(Context &context) { %s(context); }\n" %start) + + self.fd.write("\nvoid __dispatch_call(Context &context, unsigned addr) {\n\tswitch(addr) {\n") + self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1]) + for name,addr in self.proc_addr: + self.fd.write("\t\tcase 0x%04x: %s(context); break;\n" %(addr, name)) + self.fd.write("\n\t}\n}\n\n} /*namespace*/\n") + + self.fd.close() diff --git a/devtools/tasmrecover/tasm/cpp.pyc b/devtools/tasmrecover/tasm/cpp.pyc new file mode 100644 index 0000000000..b0406b3252 Binary files /dev/null and b/devtools/tasmrecover/tasm/cpp.pyc differ diff --git a/devtools/tasmrecover/tasm/lex.py b/devtools/tasmrecover/tasm/lex.py new file mode 100644 index 0000000000..ba66611bce --- /dev/null +++ b/devtools/tasmrecover/tasm/lex.py @@ -0,0 +1,52 @@ +def parse_args(text): + #print "parsing: [%s]" %text + escape = False + string = False + result = [] + token = str() + value = 0; + for c in text: + #print "[%s]%s: %s: %s" %(token, c, escape, string) + if c == '\\': + escape = True + continue + + if escape: + if not string: + raise SyntaxError("escape found in no string: %s" %text); + + #print "escaping[%s]" %c + escape = False + token += c + continue + + if string: + if c == '\'' or c == '"': + string = False + + token += c + continue + + if c == '\'' or c == '"': + string = True + token += c + continue + + if c == ',': + result.append(token.strip()) + token = str() + continue + + if c == ';': #comment, bailing out + break + + token += c + token = token.strip() + if len(token): + result.append(token) + #print result + return result + +def compile(width, data): + print data + return data diff --git a/devtools/tasmrecover/tasm/lex.pyc b/devtools/tasmrecover/tasm/lex.pyc new file mode 100644 index 0000000000..aaab26e8cf Binary files /dev/null and b/devtools/tasmrecover/tasm/lex.pyc differ diff --git a/devtools/tasmrecover/tasm/op.py b/devtools/tasmrecover/tasm/op.py new file mode 100644 index 0000000000..c77eda2b7e --- /dev/null +++ b/devtools/tasmrecover/tasm/op.py @@ -0,0 +1,394 @@ +import re +import lex + +class Unsupported(Exception): + pass + +class var: + def __init__(self, size, offset): + self.size = size + self.offset = offset + +class const: + def __init__(self, value): + self.value = value + +class reg: + def __init__(self, name): + self.name = name + def size(self): + return 2 if self.name[1] == 'x' else 1 + def __str__(self): + return "" %self.name + +class unref: + def __init__(self, exp): + self.exp = exp + def __str__(self): + return "" %self.exp + +class ref: + def __init__(self, name): + self.name = name + def __str__(self): + return "" %self.name + +class glob: + def __init__(self, name): + self.name = name + def __str__(self): + return "" %self.name + +class segment: + def __init__(self, name): + self.name = name + def __str__(self): + return "" %self.name + +class baseop(object): + def parse_arg(self, arg): + return arg + + def split(self, text): + a, b = lex.parse_args(text) + return self.parse_arg(a), self.parse_arg(b) + def __str__(self): + return str(self.__class__) + +class basejmp(baseop): + pass + +class _call(baseop): + def __init__(self, arg): + self.name = arg + def visit(self, visitor): + visitor._call(self.name) + def __str__(self): + return "call(%s)" %self.name + +class _rep(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._rep() + +class _mov(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._mov(self.dst, self.src) + def __str__(self): + return "mov(%s, %s)" %(self.dst, self.src) + +class _mov2(baseop): + def __init__(self, dst, src): + self.dst, self.src = dst, src + def visit(self, visitor): + visitor._mov(self.dst, self.src) + +class _shr(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._shr(self.dst, self.src) + +class _shl(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._shl(self.dst, self.src) + +class _ror(baseop): + def __init__(self, arg): + pass + +class _rol(baseop): + def __init__(self, arg): + pass + +class _sar(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._sar(self.dst, self.src) + +class _sal(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._sal(self.dst, self.src) + +class _rcl(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._rcl(self.dst, self.src) + +class _rcr(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._rcr(self.dst, self.src) + +class _neg(baseop): + def __init__(self, arg): + self.arg = arg + def visit(self, visitor): + visitor._neg(self.arg) + +class _dec(baseop): + def __init__(self, arg): + self.dst = arg + def visit(self, visitor): + visitor._dec(self.dst) + +class _inc(baseop): + def __init__(self, arg): + self.dst = arg + def visit(self, visitor): + visitor._inc(self.dst) + +class _add(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._add(self.dst, self.src) + +class _sub(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._sub(self.dst, self.src) + +class _mul(baseop): + def __init__(self, arg): + self.arg = self.parse_arg(arg) + def visit(self, visitor): + visitor._mul(self.arg) + +class _div(baseop): + def __init__(self, arg): + self.arg = self.parse_arg(arg) + def visit(self, visitor): + visitor._div(self.arg) + +class _and(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._and(self.dst, self.src) + +class _xor(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._xor(self.dst, self.src) + +class _or(baseop): + def __init__(self, arg): + self.dst, self.src = self.split(arg) + def visit(self, visitor): + visitor._or(self.dst, self.src) + +class _cmp(baseop): + def __init__(self, arg): + self.a, self.b = self.split(arg) + def visit(self, visitor): + visitor._cmp(self.a, self.b) + +class _test(baseop): + def __init__(self, arg): + self.a, self.b = self.split(arg) + def visit(self, visitor): + visitor._test(self.a, self.b) + +class _xchg(baseop): + def __init__(self, arg): + self.a, self.b = self.split(arg) + def visit(self, visitor): + visitor._xchg(self.a, self.b) + +class _jnz(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jnz(self.label) + +class _jz(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jz(self.label) + +class _jc(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jc(self.label) + +class _jnc(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jnc(self.label) + +class _js(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._js(self.label) + +class _jns(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jns(self.label) + +class _jl(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jl(self.label) + +class _jg(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jg(self.label) + +class _jle(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jle(self.label) + +class _jge(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jge(self.label) + +class _jmp(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._jmp(self.label) + +class _loop(basejmp): + def __init__(self, label): + self.label = label + def visit(self, visitor): + visitor._loop(self.label) + +class _push(baseop): + def __init__(self, arg): + self.regs = [] + for r in arg.split(): + self.regs.append(self.parse_arg(r)) + def visit(self, visitor): + visitor._push(self.regs) + +class _pop(baseop): + def __init__(self, arg): + self.regs = [] + for r in arg.split(): + self.regs.append(self.parse_arg(r)) + def visit(self, visitor): + visitor._pop(self.regs) + +class _ret(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._ret() + +class _lodsb(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._lodsb() + +class _lodsw(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._lodsw() + +class _stosw(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._stosw() + +class _stosb(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._stosb() + +class _movsw(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._movsw() + +class _movsb(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._movsb() + +class _in(baseop): + def __init__(self, arg): + self.arg = arg + def visit(self, visitor): + raise Unsupported("input from port: %s" %self.arg) + +class _out(baseop): + def __init__(self, arg): + self.arg = arg + def visit(self, visitor): + raise Unsupported("out to port: %s" %self.arg) + +class _cli(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + raise Unsupported("cli") + +class _sti(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + raise Unsupported("sli") + +class _int(baseop): + def __init__(self, arg): + self.arg = arg + def visit(self, visitor): + raise Unsupported("interrupt: %s" %self.arg) + +class _iret(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + raise Unsupported("interrupt return") + +class _cbw(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._cbw() + +class _nop(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + pass + +class label(baseop): + def __init__(self, name): + self.name = name + def visit(self, visitor): + visitor._label(self.name) + diff --git a/devtools/tasmrecover/tasm/op.pyc b/devtools/tasmrecover/tasm/op.pyc new file mode 100644 index 0000000000..2e212ae64c Binary files /dev/null and b/devtools/tasmrecover/tasm/op.pyc differ diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py new file mode 100644 index 0000000000..8dbf54c5a3 --- /dev/null +++ b/devtools/tasmrecover/tasm/parser.py @@ -0,0 +1,248 @@ +import os, re +from proc import proc +import lex +import op + +class parser: + def __init__(self): + self.strip_path = 0 + self.__globals = {} + self.__offsets = {} + self.__stack = [] + self.proc = None + self.proc_list = [] + self.binary_data = [] + + self.symbols = [] + self.link_later = [] + + def visible(self): + for i in self.__stack: + if not i or i == 0: + return False + return True + + def push_if(self, text): + value = self.eval(text) + #print "if %s -> %s" %(text, value) + self.__stack.append(value) + + def push_else(self): + #print "else" + self.__stack[-1] = not self.__stack[-1] + + def pop_if(self): + #print "endif" + return self.__stack.pop() + + def set_global(self, name, value): + if len(name) == 0: + raise Exception("empty name is not allowed") + name = name.lower() + #print "adding global %s -> %s" %(name, value) + if self.__globals.has_key(name): + raise Exception("global %s was already defined", name) + self.__globals[name] = value + + def get_global(self, name): + name = name.lower() + return self.__globals[name] + + def has_global(self, name): + name = name.lower() + return self.__globals.has_key(name) + + def set_offset(self, name, value): + if len(name) == 0: + raise Exception("empty name is not allowed") + name = name.lower() + #print "adding global %s -> %s" %(name, value) + if self.__offsets.has_key(name): + raise Exception("global %s was already defined", name) + self.__offsets[name] = value + + def get_offset(self, name): + name = name.lower() + return self.__offsets[name] + + def include(self, basedir, fname): + path = fname.split('\\')[self.strip_path:] + path = os.path.join(basedir, os.path.pathsep.join(path)) + #print "including %s" %(path) + + self.parse(path) + + def eval(self, stmt): + try: + return self.parse_int(stmt) + except: + pass + value = self.__globals[stmt.lower()].value + return int(value) + + def expr_callback(self, match): + name = match.group(1).lower() + g = self.get_global(name) + if isinstance(g, op.const): + return g.value + else: + return "0x%04x" %g.offset + + def eval_expr(self, expr): + n = 1 + while n > 0: + expr, n = re.subn(r'\b([a-zA-Z_]+[a-zA-Z0-9_]*)', self.expr_callback, expr) + return eval(expr) + + def expand_globals(self, text): + return text + + def fix_dollar(self, v): + return re.sub(r'\$', "%d" %len(self.binary_data), v) + + def parse_int(self, v): + if re.match(r'[01]+b$', v): + v = int(v[:-1], 2) + if re.match(r'[\+-]?[0-9a-f]+h$', v): + v = int(v[:-1], 16) + return int(v) + + def compact_data(self, width, data): + #print "COMPACTING %d %s" %(width, data) + r = [] + base = 0x100 if width == 1 else 0x10000 + for v in data: + if v[0] == '"': + if v[-1] != '"': + raise Exception("invalid string %s" %v) + if width == 2: + raise Exception("string with data width more than 1") #we could allow it :) + for i in xrange(1, len(v) - 1): + r.append(ord(v[i])) + continue + + m = re.match(r'(\w+)\s+dup\s+\((\s*\S+\s*)\)', v) + if m is not None: + #we should parse that + n = self.parse_int(m.group(1)) + if m.group(2) != '?': + value = self.parse_int(m.group(2)) + else: + value = 0 + for i in xrange(0, n): + v = value + for b in xrange(0, width): + r.append(v & 0xff); + v >>= 8 + continue + + try: + v = self.parse_int(v) + if v < 0: + v += base + except: + #global name + print "global/expr: %s" %v + try: + g = self.get_global(v) + v = g.offset + except: + print "unknown address %s" %(v) + self.link_later.append((len(self.binary_data) + len(r), v)) + v = 0 + + for b in xrange(0, width): + r.append(v & 0xff); + v >>= 8 + #print r + return r + + def parse(self, fname): +# print "opening file %s..." %(fname, basedir) + fd = open(fname, 'rb') + for line in fd: + line = line.strip() + if len(line) == 0 or line[0] == ';' or line[0] == chr(0x1a): + continue + + #print cmd + m = re.match('(\w+)\s*?:', line) + if m is not None: + line = line[len(m.group(0)):] + if self.visible(): + name = m.group(1) + if self.proc is not None: + self.proc.add_label(name) + self.set_offset(name, (len(self.binary_data), self.proc, len(self.proc.stmts) if self.proc is not None else 0)) + + cmd = line.split() + if len(cmd) == 0: + continue + + cmd0 = str(cmd[0]) + if cmd0 == 'if': + self.push_if(cmd[1]) + continue + elif cmd0 == 'else': + self.push_else() + continue + elif cmd0 == 'endif': + self.pop_if() + continue + + if not self.visible(): + continue + + if cmd0 == 'db' or cmd0 == 'dw' or cmd0 == 'dd': + arg = " ".join(cmd[1:]) + binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd0[1]] + self.binary_data += self.compact_data(binary_width, lex.parse_args(arg)) + continue + elif cmd0 == 'include': + self.include(os.path.dirname(fname), cmd[1]) + continue + elif cmd0 == 'endp': + self.proc = None + continue + elif cmd0 == 'assume': + print "skipping: %s" %line + continue + elif cmd0 == 'rep': + self.proc.add(cmd0) + self.proc.add(" ".join(cmd[1:])) + continue + + if len(cmd) >= 3: + cmd1 = cmd[1] + if cmd1 == 'equ': + v = cmd[2] + self.set_global(cmd0, op.const(self.fix_dollar(v))) + elif cmd1 == 'db' or cmd1 == 'dw' or cmd1 == 'dd': + binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd1[1]] + self.binary_data += self.compact_data(binary_width, lex.parse_args(" ".join(cmd[2:]))) + self.set_global(cmd0.lower(), op.var(binary_width, len(self.binary_data))) + continue + elif cmd1 == 'proc': + name = cmd0.lower() + self.proc = proc(name) + print "procedure %s, #%d" %(name, len(self.proc_list)) + self.proc_list.append(name) + self.set_global(name, self.proc) + continue + if (self.proc): + self.proc.add(line) + else: + #print line + pass + + fd.close() + return self + + def link(self): + for addr, expr in self.link_later: + v = self.eval_expr(expr) + print "link: patching %04x -> %04x" %(addr, v) + while v != 0: + self.binary_data[addr] = v & 0xff + addr += 1 + v >>= 8 diff --git a/devtools/tasmrecover/tasm/parser.pyc b/devtools/tasmrecover/tasm/parser.pyc new file mode 100644 index 0000000000..d7049c84b4 Binary files /dev/null and b/devtools/tasmrecover/tasm/parser.pyc differ diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py new file mode 100644 index 0000000000..4337d4c936 --- /dev/null +++ b/devtools/tasmrecover/tasm/proc.py @@ -0,0 +1,84 @@ +import re +import op + +class proc: + last_addr = 0xc000 + + def __init__(self, name): + self.name = name + self.calls = [] + self.stmts = [] + self.labels = set() + self.__label_re = re.compile(r'^(\S+):(.*)$') + self.offset = proc.last_addr + proc.last_addr += 4 + + def add_label(self, label): + self.stmts.append(op.label(label)) + self.labels.add(label) + + def optimize(self): + print "optimizing..." + #trivial simplifications, removing last ret + while len(self.stmts) and isinstance(self.stmts[-1], op.label): + print "stripping last label" + self.stmts.pop() + #if isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): + # print "stripping last ret" + # self.stmts.pop() + #merging push ax pop bx constructs + i = 0 + while i + 1 < len(self.stmts): + a, b = self.stmts[i], self.stmts[i + 1] + if isinstance(a, op._push) and isinstance(b, op._pop): + ar, br = a.regs, b.regs + movs = [] + while len(ar) and len(br): + src = ar.pop() + dst = br.pop(0) + movs.append(op._mov2(dst, src)) + if len(br) == 0: + self.stmts.pop(i + 1) + print "merging %d push-pops into movs" %(len(movs)) + for m in movs: + print "\t%s <- %s" %(m.dst, m.src) + self.stmts[i + 1:i + 1] = movs + if len(ar) == 0: + self.stmts.pop(i) + else: + i += 1 + #fixme: add local? + + def add(self, stmt): + #print stmt + comment = stmt.rfind(';') + if comment >= 0: + stmt = stmt[:comment] + stmt = stmt.strip() + + r = self.__label_re.search(stmt) + if r is not None: + #label + self.add_label(r.group(1).lower()) + #print "remains: %s" %r.group(2) + stmt = r.group(2).strip() + + if len(stmt) == 0: + return + + s = stmt.split(None) + cmd = s[0] + cl = getattr(op, '_' + cmd) + arg = " ".join(s[1:]) if len(s) > 1 else str() + o = cl(arg) + self.stmts.append(o) + + def __str__(self): + r = [] + for i in self.stmts: + r.append(i.__str__()) + return "\n".join(r) + + def visit(self, visitor, skip = 0): + for i in xrange(skip, len(self.stmts)): + self.stmts[i].visit(visitor) diff --git a/devtools/tasmrecover/tasm/proc.pyc b/devtools/tasmrecover/tasm/proc.pyc new file mode 100644 index 0000000000..cd8f967509 Binary files /dev/null and b/devtools/tasmrecover/tasm/proc.pyc differ -- cgit v1.2.3 From 10c84a81fe3e04d9b923c023c46e89ca9eeb151a Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:00:48 +0400 Subject: DREAMWEB: removed ugly macroses --- engines/dreamweb/runtime.h | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 5824728283..8050e9f0de 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -1,18 +1,15 @@ -#ifndef TASM_RECOVER_H__ -#define TASM_RECOVER_H__ +#ifndef ENGINES_DREAMGEN_RUNTIME_H__ +#define ENGINES_DREAMGEN_RUNTIME_H__ #include #include #include +#include "common/scummsys.h" -typedef uint16_t uint16; -typedef uint8_t uint8; -typedef int16_t int16; -typedef int8_t int8; +//fixme: name clash +#undef random -//little endian -#define REG_LOW 0 -#define REG_HIGH 1 +enum { kLowPartOfRegister = 0, kHighPartOfRegister = 1 }; struct Register { union { @@ -160,14 +157,14 @@ struct Flags { template struct RegisterContext { Register ax, dx, bx, cx, si, di; - RegisterPart al; - RegisterPart ah; - RegisterPart bl; - RegisterPart bh; - RegisterPart cl; - RegisterPart ch; - RegisterPart dl; - RegisterPart dh; + RegisterPart al; + RegisterPart ah; + RegisterPart bl; + RegisterPart bh; + RegisterPart cl; + RegisterPart ch; + RegisterPart dl; + RegisterPart dh; SegmentRef cs, ds, es; Flags flags; -- cgit v1.2.3 From e3178397ce9dd1e5e52e7a6831f3a19670005076 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:10:39 +0400 Subject: COMMON: added assign(T*, T*) --- common/array.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/array.h b/common/array.h index 7ab4a1b042..b3d3e01727 100644 --- a/common/array.h +++ b/common/array.h @@ -252,6 +252,13 @@ public: _size = newSize; } + void assign(const T *srcBegin, const T *srcEnd) { + reserve(distance(srcBegin, srcEnd)); + T *dst = _storage; + while(srcBegin != srcEnd) + *dst++ = *srcBegin++; + } + protected: static uint roundUpCapacity(uint capacity) { // Round up capacity to the next power of 2; -- cgit v1.2.3 From d725199ac05e439a1a616f9eef2fe010d3433d90 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:10:51 +0400 Subject: DREAMWEB: 'scummvm'ing types. :) --- engines/dreamweb/runtime.h | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 8050e9f0de..c266c5d419 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -1,10 +1,9 @@ #ifndef ENGINES_DREAMGEN_RUNTIME_H__ #define ENGINES_DREAMGEN_RUNTIME_H__ -#include #include -#include #include "common/scummsys.h" +#include "common/array.h" //fixme: name clash #undef random @@ -17,7 +16,7 @@ struct Register { uint8 _part[2]; }; inline Register(): _value() {} - inline Register& operator=(uint16_t v) { _value = v; return *this; } + inline Register& operator=(uint16 v) { _value = v; return *this; } inline operator uint16&() { return _value; } inline void cbw() { if (_value & 0x80) @@ -29,7 +28,7 @@ struct Register { template struct RegisterPart { - uint8_t &_part; + uint8 &_part; inline RegisterPart(Register ®) : _part(reg._part[PART]) {} @@ -40,19 +39,19 @@ struct RegisterPart { _part = o._part; return *this; } - inline RegisterPart& operator=(uint8_t v) { + inline RegisterPart& operator=(uint8 v) { _part = v; return *this; } }; struct WordRef { - std::vector &data; + Common::Array &data; unsigned index; bool changed; - uint16_t value; + uint16 value; - inline WordRef(std::vector &data, unsigned index) : data(data), index(index), changed(false) { + inline WordRef(Common::Array &data, unsigned index) : data(data), index(index), changed(false) { assert(index + 1 < data.size()); value = data[index] | (data[index + 1] << 8); } @@ -61,15 +60,15 @@ struct WordRef { value = ref.value; return *this; } - inline WordRef& operator=(uint16_t v) { + inline WordRef& operator=(uint16 v) { changed = true; value = v; return *this; } - inline operator uint16_t() const { + inline operator uint16() const { return value; } - inline operator uint16_t&() { + inline operator uint16&() { return value; } inline ~WordRef() { @@ -81,12 +80,12 @@ struct WordRef { }; struct Segment { - std::vector data; - inline uint8_t &byte(unsigned index) { + Common::Array data; + inline uint8 &byte(unsigned index) { assert(index < data.size()); return data[index]; } - inline uint16_t word(unsigned index) const { + inline uint16 word(unsigned index) const { assert(index + 1 < data.size()); return data[index] | (data[index + 1] << 8); } @@ -99,25 +98,25 @@ struct Segment { struct SegmentRef { public: - uint16_t value; - std::vector *data; + uint16 value; + Common::Array *data; inline SegmentRef& operator=(const SegmentRef &o) { data = o.data; return *this; } - inline SegmentRef& operator=(const uint16_t id) { + inline SegmentRef& operator=(const uint16 id) { return *this; } - inline uint8_t &byte(unsigned index) { + inline uint8 &byte(unsigned index) { assert(index < data->size()); return (*data)[index]; } - inline uint16_t word(unsigned index) const { + inline uint16 word(unsigned index) const { assert(index + 1 < data->size()); return (*data)[index] | ((*data)[index + 1] << 8); } - inline operator uint16_t() const { + inline operator uint16() const { return value; } @@ -310,7 +309,7 @@ struct RegisterContext { b = t; } - std::vector stack; + Common::Array stack; inline void push(uint16 v) { stack.push_back(v); } -- cgit v1.2.3 From 1f991fa1e4ae59fb86852212d7fe5021b6f97809 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:20:43 +0400 Subject: DREAMWEB: fixed almost all runtime warnings --- engines/dreamweb/runtime.h | 81 ++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index c266c5d419..7324475cc9 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -4,6 +4,7 @@ #include #include "common/scummsys.h" #include "common/array.h" +#include "common/hashmap.h" //fixme: name clash #undef random @@ -45,36 +46,38 @@ struct RegisterPart { } }; -struct WordRef { - Common::Array &data; - unsigned index; - bool changed; - uint16 value; +class WordRef { + Common::Array &_data; + unsigned _index; + bool _changed; + uint16 _value; - inline WordRef(Common::Array &data, unsigned index) : data(data), index(index), changed(false) { +public: + + inline WordRef(Common::Array &data, unsigned index) : _data(data), _index(index), _changed(false) { assert(index + 1 < data.size()); - value = data[index] | (data[index + 1] << 8); + _value = _data[index] | (_data[index + 1] << 8); } inline WordRef& operator=(const WordRef &ref) { - changed = true; - value = ref.value; + _changed = true; + _value = ref._value; return *this; } inline WordRef& operator=(uint16 v) { - changed = true; - value = v; + _changed = true; + _value = v; return *this; } inline operator uint16() const { - return value; + return _value; } inline operator uint16&() { - return value; + return _value; } inline ~WordRef() { - if (changed) { - data[index] = value & 0xff; - data[index + 1] = value >> 8; + if (_changed) { + _data[_index] = _value & 0xff; + _data[_index + 1] = _value >> 8; } } }; @@ -96,32 +99,40 @@ struct Segment { }; -struct SegmentRef { - public: - uint16 value; - Common::Array *data; - inline SegmentRef& operator=(const SegmentRef &o) { - data = o.data; - return *this; +class SegmentRef { + + uint16 _value; + Segment *_segment; + +public: + SegmentRef(): _value(), _segment() { } + + inline void reset(uint16 value) { + + } + inline SegmentRef& operator=(const uint16 id) { return *this; } + inline uint8 &byte(unsigned index) { - assert(index < data->size()); - return (*data)[index]; + assert(_segment != 0); + return _segment->byte(index); } + inline uint16 word(unsigned index) const { - assert(index + 1 < data->size()); - return (*data)[index] | ((*data)[index + 1] << 8); + assert(_segment != 0); + return _segment->word(index); } inline operator uint16() const { - return value; + return _value; } inline WordRef word(unsigned index) { - return WordRef(*data, index); + assert(_segment != 0); + return _segment->word(index); } }; @@ -139,16 +150,16 @@ struct Flags { inline bool le() const { return _z || _s != _o; } inline void update_sign(uint8 v) { - bool s = v & 0x80; - _o = s != _s; - _s = s; + bool new_s = v & 0x80; + _o = new_s != _s; + _s = new_s; _z = v == 0; } inline void update(uint16 v) { - bool s = v & 0x8000; - _o = s != _s; - _s = s; + bool new_s = v & 0x8000; + _o = new_s != _s; + _s = new_s; _z = v == 0; } }; -- cgit v1.2.3 From cc784e9a0c0b0527548b1ea5cac06b4d9458042a Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:35:48 +0400 Subject: DREAMWEB: removed context template, cleaned up initialization --- engines/dreamweb/dreamgen.cpp | 1113 ++++++++++++++++++++--------------------- engines/dreamweb/dreamgen.h | 7 - engines/dreamweb/runtime.h | 31 +- 3 files changed, 578 insertions(+), 573 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 5b075a14fe..6d45fbfd80 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -20872,565 +20872,562 @@ endofgame: } -Data::Data() { + +void __start(Context &context) { static const uint8 src[] = { - 0, 0, 0, 0, 0, 30, 19, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 255, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 255, 0, - 255, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 10, 0, 13, 0, 182, - 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, 104, 0, 38, 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, 255, 255, 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, 32, 32, 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, - 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, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 255, 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, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 23, 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, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 0, 0, 0, 0, 1, 44, 0, 20, 0, 2, 0, 1, 1, 55, - 0, 0, 0, 50, 20, 0, 24, 22, 0, 74, 0, 1, 0, 0, 24, 33, - 10, 75, 0, 1, 0, 1, 1, 44, 0, 27, 0, 2, 0, 2, 1, 44, - 0, 96, 0, 3, 0, 4, 1, 44, 0, 118, 0, 2, 0, 5, 1, 44, - 10, 0, 0, 2, 0, 0, 5, 22, 20, 53, 0, 3, 0, 0, 5, 22, - 20, 40, 0, 1, 0, 2, 5, 22, 20, 50, 0, 1, 0, 3, 2, 11, - 10, 192, 0, 1, 0, 0, 2, 11, 10, 182, 0, 2, 0, 1, 8, 11, - 10, 0, 0, 2, 0, 1, 23, 0, 50, 0, 0, 3, 0, 0, 28, 11, - 20, 250, 0, 4, 0, 0, 23, 0, 50, 43, 0, 2, 0, 8, 23, 11, - 40, 130, 0, 2, 0, 1, 23, 22, 40, 122, 0, 2, 0, 2, 23, 22, - 40, 105, 0, 2, 0, 3, 23, 22, 40, 81, 0, 2, 0, 4, 23, 11, - 40, 135, 0, 2, 0, 5, 23, 22, 40, 145, 0, 2, 0, 6, 4, 22, - 30, 0, 0, 2, 0, 0, 45, 22, 30, 200, 0, 0, 0, 20, 45, 22, - 30, 39, 0, 2, 0, 0, 45, 22, 30, 25, 0, 2, 0, 0, 8, 22, - 40, 32, 0, 2, 0, 0, 7, 11, 20, 64, 0, 2, 0, 0, 22, 22, - 20, 82, 0, 2, 0, 0, 27, 11, 30, 0, 0, 2, 0, 0, 20, 0, - 30, 0, 0, 2, 0, 0, 14, 33, 40, 21, 0, 1, 0, 0, 29, 11, - 10, 0, 0, 1, 0, 0, 2, 22, 0, 2, 0, 2, 0, 0, 25, 0, - 50, 4, 0, 2, 0, 0, 50, 22, 30, 121, 0, 2, 0, 0, 50, 22, - 30, 0, 0, 20, 0, 0, 52, 22, 30, 192, 0, 2, 0, 0, 52, 22, - 30, 233, 0, 2, 0, 0, 50, 22, 40, 104, 0, 55, 0, 0, 53, 33, - 0, 99, 0, 2, 0, 0, 50, 22, 40, 0, 0, 3, 0, 0, 50, 22, - 30, 162, 0, 2, 0, 0, 52, 22, 30, 57, 0, 2, 0, 0, 52, 22, - 30, 0, 0, 2, 0, 0, 54, 0, 0, 72, 0, 3, 0, 0, 55, 44, - 0, 0, 0, 2, 0, 0, 19, 0, 0, 0, 0, 28, 0, 0, 14, 22, - 0, 2, 0, 2, 0, 0, 14, 22, 0, 44, 1, 1, 0, 0, 10, 22, - 30, 174, 0, 0, 0, 0, 12, 22, 20, 0, 0, 1, 0, 0, 11, 11, - 20, 0, 0, 50, 20, 0, 11, 11, 30, 0, 0, 50, 20, 0, 11, 22, - 20, 0, 0, 50, 20, 0, 14, 33, 40, 0, 0, 50, 20, 0, 255, 124, - 192, 128, 192, 28, 192, 32, 192, 0, 193, 16, 192, 24, 192, 244, 192, 12, - 192, 36, 192, 40, 192, 44, 192, 48, 192, 84, 192, 120, 192, 80, 192, 116, - 192, 52, 192, 56, 192, 64, 192, 68, 192, 72, 192, 60, 192, 20, 192, 136, - 192, 140, 192, 144, 192, 112, 192, 252, 192, 108, 192, 88, 192, 104, 192, 4, - 193, 100, 192, 96, 192, 92, 192, 148, 192, 4, 192, 164, 192, 156, 192, 160, - 192, 168, 192, 172, 192, 152, 192, 176, 192, 180, 192, 200, 192, 204, 192, 212, - 192, 220, 192, 216, 192, 0, 192, 8, 192, 132, 192, 132, 192, 132, 192, 132, - 192, 0, 60, 33, 71, 11, 82, 22, 93, 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, 47, 5, - 48, 5, 52, 5, 47, 5, 47, 5, 47, 5, 71, 5, 47, 5, 78, 5, - 94, 5, 101, 5, 105, 5, 109, 5, 113, 5, 126, 5, 47, 5, 47, 5, - 47, 5, 47, 5, 47, 5, 160, 5, 47, 5, 182, 5, 213, 5, 47, 5, - 226, 5, 248, 5, 14, 6, 39, 6, 58, 6, 47, 5, 47, 5, 47, 5, - 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, 47, 5, - 47, 5, 47, 5, 47, 5, 47, 5, 74, 6, 81, 6, 118, 6, 47, 5, - 47, 5, 47, 5, 47, 5, 131, 6, 135, 6, 47, 5, 142, 6, 255, 15, - 1, 1, 255, 12, 5, 0, 13, 21, 0, 15, 35, 0, 17, 50, 0, 18, - 103, 0, 19, 108, 0, 255, 18, 19, 0, 19, 23, 0, 255, 12, 51, 0, - 13, 53, 0, 14, 14, 0, 15, 20, 0, 0, 78, 0, 255, 12, 119, 0, - 12, 145, 0, 255, 13, 16, 0, 255, 13, 20, 0, 255, 14, 16, 0, 255, - 15, 4, 0, 16, 8, 0, 17, 134, 0, 18, 153, 0, 255, 13, 108, 0, - 15, 70, 1, 15, 75, 1, 15, 80, 1, 15, 86, 1, 15, 92, 1, 15, - 98, 1, 18, 159, 0, 18, 178, 0, 147, 217, 0, 84, 228, 0, 255, 13, - 20, 0, 13, 21, 0, 15, 34, 0, 13, 52, 0, 13, 55, 0, 25, 57, - 0, 21, 73, 0, 255, 13, 196, 0, 13, 234, 0, 13, 156, 0, 14, 129, - 0, 13, 124, 0, 15, 162, 0, 15, 200, 0, 15, 239, 0, 17, 99, 0, - 12, 52, 0, 255, 15, 56, 0, 16, 64, 0, 19, 22, 0, 20, 33, 0, - 255, 20, 11, 0, 20, 15, 0, 15, 28, 0, 13, 80, 0, 21, 82, 0, - 147, 87, 0, 87, 128, 0, 255, 12, 13, 0, 14, 39, 0, 12, 67, 0, - 12, 75, 0, 12, 83, 0, 12, 91, 0, 15, 102, 0, 255, 22, 36, 0, - 13, 125, 0, 18, 88, 0, 15, 107, 0, 14, 127, 0, 14, 154, 0, 147, - 170, 0, 87, 232, 0, 255, 21, 16, 0, 21, 72, 0, 21, 205, 0, 22, - 63, 0, 151, 99, 0, 88, 158, 0, 255, 13, 21, 0, 14, 24, 0, 147, - 50, 0, 87, 75, 0, 24, 128, 0, 255, 83, 46, 0, 16, 167, 0, 255, - 16, 19, 0, 14, 36, 0, 16, 50, 0, 14, 65, 0, 16, 81, 0, 14, - 96, 0, 16, 114, 0, 14, 129, 0, 16, 147, 0, 14, 162, 0, 16, 177, - 0, 14, 191, 0, 255, 13, 48, 0, 14, 41, 0, 15, 78, 0, 16, 92, - 0, 255, 16, 115, 0, 255, 21, 103, 0, 20, 199, 0, 255, 17, 53, 0, - 17, 54, 0, 17, 55, 0, 17, 56, 0, 17, 57, 0, 17, 58, 0, 17, - 59, 0, 17, 61, 0, 17, 63, 0, 17, 64, 0, 17, 65, 0, 255, 156, - 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, - 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, - 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, - 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, - 158, 160, 155, 157, 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, - 153, 159, 158, 156, 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 158, 156, - 154, 159, 154, 156, 158, 160, 155, 157, 153, 159, 156, 68, 82, 69, 65, 77, - 87, 69, 66, 46, 83, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, - 46, 83, 48, 50, 0, 73, 78, 83, 84, 65, 76, 76, 46, 68, 65, 84, - 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 67, 48, 48, 0, 68, 82, - 69, 65, 77, 87, 69, 66, 46, 67, 48, 49, 0, 68, 82, 69, 65, 77, - 87, 69, 66, 46, 67, 48, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, - 46, 86, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 86, 57, - 57, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 48, 0, 68, - 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 49, 0, 68, 82, 69, 65, - 77, 87, 69, 66, 46, 71, 48, 50, 0, 68, 82, 69, 65, 77, 87, 69, - 66, 46, 71, 48, 56, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, - 48, 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 55, 0, - 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 48, 52, 0, 68, 82, 69, - 65, 77, 87, 69, 66, 46, 71, 48, 53, 0, 68, 82, 69, 65, 77, 87, - 69, 66, 46, 71, 48, 54, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, - 71, 49, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 48, 49, - 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 48, 50, 0, 68, 82, - 69, 65, 77, 87, 69, 66, 46, 84, 49, 48, 0, 68, 82, 69, 65, 77, - 87, 69, 66, 46, 84, 49, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, - 46, 84, 49, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 49, - 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 50, 48, 0, 68, - 82, 69, 65, 77, 87, 69, 66, 46, 84, 50, 49, 0, 68, 82, 69, 65, - 77, 87, 69, 66, 46, 84, 50, 50, 0, 68, 82, 69, 65, 77, 87, 69, - 66, 46, 84, 50, 51, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, - 50, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 53, 48, 0, - 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 53, 49, 0, 68, 82, 69, - 65, 77, 87, 69, 66, 46, 84, 56, 48, 0, 68, 82, 69, 65, 77, 87, - 69, 66, 46, 84, 56, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, - 84, 56, 50, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 56, 51, - 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 84, 56, 52, 0, 68, 82, - 69, 65, 77, 87, 69, 66, 46, 86, 79, 76, 0, 68, 82, 69, 65, 77, - 87, 69, 66, 46, 71, 48, 57, 0, 68, 82, 69, 65, 77, 87, 69, 66, - 46, 71, 49, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, - 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, 50, 0, 68, - 82, 69, 65, 77, 87, 69, 66, 46, 71, 49, 51, 0, 68, 82, 69, 65, - 77, 87, 69, 66, 46, 71, 49, 53, 0, 68, 82, 69, 65, 77, 87, 69, - 66, 46, 73, 48, 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, - 48, 49, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 50, 0, - 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 51, 0, 68, 82, 69, - 65, 77, 87, 69, 66, 46, 73, 48, 52, 0, 68, 82, 69, 65, 77, 87, - 69, 66, 46, 73, 48, 53, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, - 73, 48, 54, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 73, 48, 55, - 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 80, 65, 76, 0, 17, 1, - 64, 1, 157, 0, 198, 0, 72, 195, 4, 1, 44, 1, 0, 0, 44, 0, - 132, 197, 210, 0, 254, 0, 0, 0, 44, 0, 224, 195, 144, 0, 176, 0, - 64, 0, 96, 0, 132, 195, 0, 0, 50, 0, 50, 0, 200, 0, 136, 195, - 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 17, 1, 64, 1, - 157, 0, 198, 0, 72, 195, 255, 0, 38, 1, 0, 0, 24, 0, 204, 195, - 247, 0, 45, 1, 40, 0, 56, 0, 76, 195, 80, 0, 0, 1, 158, 0, - 202, 0, 228, 195, 80, 0, 44, 1, 58, 0, 146, 0, 156, 195, 0, 0, - 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, - 198, 0, 72, 195, 247, 0, 45, 1, 40, 0, 56, 0, 76, 195, 80, 0, - 44, 1, 58, 0, 146, 0, 192, 198, 0, 0, 64, 1, 0, 0, 200, 0, - 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 240, 0, - 34, 1, 2, 0, 44, 0, 152, 196, 0, 0, 64, 1, 0, 0, 200, 0, - 156, 202, 255, 255, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 0, 0, - 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 238, 0, 2, 1, 4, 0, - 44, 0, 204, 196, 104, 0, 124, 0, 4, 0, 44, 0, 208, 196, 24, 1, - 52, 1, 4, 0, 44, 0, 180, 196, 104, 0, 216, 0, 138, 0, 192, 0, - 212, 196, 17, 1, 64, 1, 157, 0, 198, 0, 128, 196, 0, 0, 64, 1, - 0, 0, 200, 0, 156, 202, 255, 255, 69, 88, 73, 84, 32, 72, 69, 76, - 80, 32, 76, 73, 83, 84, 32, 82, 69, 65, 68, 32, 76, 79, 71, 79, - 78, 32, 75, 69, 89, 83, 32, 1, 0, 80, 85, 66, 76, 73, 67, 32, - 80, 85, 66, 76, 73, 67, 32, 0, 0, 0, 66, 76, 65, 67, 75, 68, - 82, 65, 71, 79, 78, 32, 82, 89, 65, 78, 32, 0, 0, 0, 72, 69, - 78, 68, 82, 73, 88, 32, 76, 79, 85, 73, 83, 32, 0, 0, 0, 83, - 69, 80, 84, 73, 77, 85, 83, 32, 66, 69, 67, 75, 69, 84, 84, 32, - 0, 255, 255, 32, 0, 34, 82, 79, 79, 84, 32, 0, 34, 32, 0, 78, - 69, 84, 87, 236, 196, 69, 76, 86, 65, 144, 198, 69, 76, 86, 66, 160, - 198, 69, 76, 86, 67, 152, 198, 69, 76, 86, 69, 156, 198, 69, 76, 86, - 70, 164, 198, 67, 71, 65, 84, 52, 199, 82, 69, 77, 79, 172, 198, 66, - 85, 84, 65, 64, 199, 67, 66, 79, 88, 72, 199, 76, 73, 84, 69, 96, - 198, 80, 76, 65, 84, 68, 199, 76, 73, 70, 84, 128, 198, 87, 73, 82, - 69, 136, 198, 72, 78, 68, 76, 140, 198, 72, 65, 67, 72, 132, 198, 68, - 79, 79, 82, 184, 198, 67, 83, 72, 82, 116, 198, 71, 85, 78, 65, 56, - 199, 67, 82, 65, 65, 104, 198, 67, 82, 66, 66, 108, 198, 67, 82, 67, - 67, 112, 198, 83, 69, 65, 84, 252, 197, 77, 69, 78, 85, 156, 199, 67, - 79, 79, 75, 176, 198, 69, 76, 67, 65, 80, 198, 69, 68, 67, 65, 84, - 198, 68, 68, 67, 65, 88, 198, 65, 76, 84, 82, 8, 198, 76, 79, 75, - 65, 64, 198, 76, 79, 75, 66, 68, 198, 69, 78, 84, 65, 20, 198, 69, - 78, 84, 66, 40, 198, 69, 78, 84, 69, 44, 198, 69, 78, 84, 67, 28, - 198, 69, 78, 84, 68, 48, 198, 69, 78, 84, 72, 52, 198, 87, 87, 65, - 84, 244, 197, 80, 79, 79, 76, 92, 198, 87, 83, 72, 68, 248, 197, 71, - 82, 65, 70, 72, 198, 84, 82, 65, 80, 76, 198, 67, 68, 80, 69, 44, - 199, 68, 76, 79, 75, 12, 198, 72, 79, 76, 69, 4, 198, 68, 82, 89, - 82, 16, 198, 72, 79, 76, 89, 0, 198, 87, 65, 76, 76, 48, 199, 66, - 79, 79, 75, 12, 200, 65, 88, 69, 68, 180, 198, 83, 72, 76, 68, 60, - 199, 66, 67, 78, 89, 236, 197, 76, 73, 68, 67, 232, 197, 76, 73, 68, - 85, 228, 197, 76, 73, 68, 79, 240, 197, 80, 73, 80, 69, 172, 197, 66, - 65, 76, 67, 36, 198, 87, 73, 78, 68, 32, 198, 80, 65, 80, 82, 184, - 199, 85, 87, 84, 65, 164, 197, 85, 87, 84, 66, 164, 197, 83, 84, 65, - 84, 220, 199, 84, 76, 73, 68, 160, 197, 83, 76, 65, 66, 220, 197, 67, - 65, 82, 84, 224, 197, 70, 67, 65, 82, 176, 197, 83, 76, 66, 65, 196, - 197, 83, 76, 66, 66, 200, 197, 83, 76, 66, 67, 208, 197, 83, 76, 66, - 68, 204, 197, 83, 76, 66, 69, 212, 197, 83, 76, 66, 70, 216, 197, 80, - 76, 73, 78, 180, 197, 76, 65, 68, 68, 188, 197, 76, 65, 68, 66, 192, - 197, 71, 85, 77, 65, 184, 197, 83, 81, 69, 69, 140, 197, 84, 65, 80, - 80, 144, 197, 71, 85, 73, 84, 148, 197, 67, 79, 78, 84, 152, 197, 66, - 69, 76, 76, 156, 197, 140, 140, 140, 140, 48, 48, 48, 48, 0, 48, 48, - 0, 157, 0, 178, 0, 81, 0, 94, 0, 92, 199, 179, 0, 200, 0, 81, - 0, 94, 0, 96, 199, 201, 0, 222, 0, 81, 0, 94, 0, 100, 199, 157, - 0, 178, 0, 95, 0, 112, 0, 104, 199, 179, 0, 200, 0, 95, 0, 112, - 0, 108, 199, 201, 0, 222, 0, 95, 0, 112, 0, 112, 199, 157, 0, 178, - 0, 113, 0, 130, 0, 116, 199, 179, 0, 200, 0, 113, 0, 130, 0, 120, - 199, 201, 0, 222, 0, 113, 0, 130, 0, 124, 199, 157, 0, 178, 0, 131, - 0, 145, 0, 128, 199, 179, 0, 222, 0, 131, 0, 145, 0, 132, 199, 220, - 0, 234, 0, 152, 0, 166, 0, 84, 199, 0, 0, 64, 1, 0, 0, 200, - 0, 156, 202, 255, 255, 174, 0, 188, 0, 132, 0, 148, 0, 84, 199, 0, - 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 24, 1, 64, 1, 160, - 0, 200, 0, 84, 199, 143, 0, 44, 1, 6, 0, 194, 0, 188, 199, 0, - 0, 143, 0, 6, 0, 194, 0, 196, 199, 0, 0, 64, 1, 0, 0, 200, - 0, 156, 202, 255, 255, 104, 0, 128, 0, 58, 0, 72, 0, 224, 199, 64, - 0, 116, 0, 76, 0, 106, 0, 228, 199, 116, 0, 168, 0, 76, 0, 106, - 0, 232, 199, 64, 0, 116, 0, 106, 0, 136, 0, 236, 199, 116, 0, 168, - 0, 106, 0, 136, 0, 240, 199, 0, 0, 64, 1, 0, 0, 200, 0, 156, - 202, 255, 255, 186, 0, 202, 0, 157, 0, 173, 0, 32, 200, 243, 0, 3, - 1, 131, 0, 147, 0, 28, 200, 12, 1, 28, 1, 168, 0, 184, 0, 84, - 199, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 119, 0, 174, - 0, 82, 0, 128, 0, 56, 200, 70, 0, 137, 0, 62, 0, 111, 0, 132, - 200, 188, 0, 250, 0, 68, 0, 152, 0, 80, 200, 0, 0, 64, 1, 0, - 0, 200, 0, 156, 202, 255, 255, 236, 0, 252, 0, 112, 0, 128, 0, 76, - 200, 188, 0, 250, 0, 64, 0, 152, 0, 92, 200, 62, 0, 152, 0, 56, - 0, 133, 0, 120, 200, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, - 255, 119, 0, 174, 0, 82, 0, 128, 0, 72, 200, 70, 0, 139, 0, 62, - 0, 111, 0, 84, 200, 236, 0, 252, 0, 112, 0, 128, 0, 76, 200, 0, - 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 236, 0, 252, 0, 112, - 0, 128, 0, 76, 200, 188, 0, 250, 0, 64, 0, 152, 0, 88, 200, 62, - 0, 152, 0, 56, 0, 133, 0, 120, 200, 0, 0, 64, 1, 0, 0, 200, - 0, 156, 202, 255, 255, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, 101, - 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, 13, - 10, 85, 110, 97, 98, 108, 101, 32, 116, 111, 32, 97, 108, 108, 111, 99, - 97, 116, 101, 32, 69, 120, 112, 97, 110, 100, 101, 100, 32, 77, 101, 109, - 111, 114, 121, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, - 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, - 111, 114, 58, 13, 10, 83, 111, 117, 110, 100, 32, 66, 108, 97, 115, 116, - 101, 114, 32, 99, 97, 114, 100, 32, 110, 111, 116, 32, 102, 111, 117, 110, - 100, 32, 97, 116, 32, 97, 100, 100, 114, 101, 115, 115, 32, 50, 50, 48, - 32, 72, 101, 120, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, - 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, - 114, 111, 114, 58, 13, 10, 79, 117, 116, 32, 111, 102, 32, 66, 97, 115, - 101, 32, 77, 101, 109, 111, 114, 121, 46, 13, 10, 13, 10, 36, 13, 10, - 13, 10, 68, 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, - 110, 32, 69, 114, 114, 111, 114, 58, 13, 10, 77, 101, 109, 111, 114, 121, - 32, 68, 101, 97, 108, 108, 111, 99, 97, 116, 105, 111, 110, 32, 112, 114, - 111, 98, 108, 101, 109, 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, - 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, - 114, 114, 111, 114, 58, 13, 10, 65, 116, 32, 108, 101, 97, 115, 116, 32, - 53, 57, 48, 75, 32, 111, 102, 32, 98, 97, 115, 101, 32, 109, 101, 109, - 111, 114, 121, 32, 105, 115, 32, 114, 101, 113, 117, 105, 114, 101, 100, 46, - 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, 101, - 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, 13, - 10, 83, 111, 117, 110, 100, 32, 66, 108, 97, 115, 116, 101, 114, 32, 110, - 111, 116, 32, 102, 111, 117, 110, 100, 32, 111, 110, 32, 105, 110, 116, 101, - 114, 117, 112, 116, 32, 48, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, - 114, 101, 97, 109, 119, 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, - 114, 114, 111, 114, 58, 13, 10, 85, 110, 97, 98, 108, 101, 32, 116, 111, - 32, 115, 101, 108, 101, 99, 116, 32, 69, 77, 77, 32, 112, 97, 103, 101, - 46, 13, 10, 13, 10, 36, 13, 10, 13, 10, 68, 114, 101, 97, 109, 119, - 101, 98, 32, 104, 97, 115, 32, 97, 110, 32, 69, 114, 114, 111, 114, 58, - 13, 10, 70, 105, 108, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, - 46, 99, 13, 10, 13, 10, 36, 68, 114, 101, 97, 109, 119, 101, 98, 32, - 108, 111, 111, 107, 115, 32, 102, 111, 114, 32, 83, 111, 117, 110, 100, 32, - 66, 108, 97, 115, 116, 101, 114, 32, 105, 110, 102, 111, 114, 109, 97, 116, - 105, 111, 110, 32, 105, 110, 13, 10, 116, 104, 101, 32, 66, 76, 65, 83, - 84, 69, 82, 32, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 32, - 118, 97, 114, 105, 97, 98, 108, 101, 32, 40, 105, 110, 32, 121, 111, 117, - 114, 32, 65, 85, 84, 79, 69, 88, 69, 67, 46, 66, 65, 84, 41, 13, - 10, 13, 10, 73, 102, 32, 116, 104, 105, 115, 32, 105, 115, 32, 110, 111, - 116, 32, 102, 111, 117, 110, 100, 32, 116, 104, 101, 110, 32, 73, 82, 81, - 32, 55, 44, 32, 68, 77, 65, 32, 99, 104, 97, 110, 110, 101, 108, 32, - 49, 32, 97, 110, 100, 32, 98, 97, 115, 101, 13, 10, 97, 100, 100, 114, - 101, 115, 115, 32, 50, 50, 48, 104, 32, 97, 114, 101, 32, 97, 115, 115, - 117, 109, 101, 100, 46, 13, 10, 13, 10, 84, 111, 32, 97, 108, 116, 101, - 114, 32, 97, 110, 121, 32, 111, 114, 32, 97, 108, 108, 32, 111, 102, 32, - 116, 104, 101, 115, 101, 32, 115, 101, 116, 116, 105, 110, 103, 115, 32, 121, - 111, 117, 32, 99, 97, 110, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, - 104, 101, 109, 13, 10, 111, 110, 32, 116, 104, 101, 32, 99, 111, 109, 109, - 97, 110, 100, 32, 108, 105, 110, 101, 46, 32, 70, 111, 114, 32, 101, 120, - 97, 109, 112, 108, 101, 58, 13, 10, 13, 10, 84, 121, 112, 101, 32, 68, - 82, 69, 65, 77, 87, 69, 66, 32, 73, 55, 32, 65, 50, 50, 48, 32, - 68, 49, 32, 116, 111, 32, 114, 117, 110, 32, 68, 114, 101, 97, 109, 119, - 101, 98, 32, 111, 110, 32, 73, 82, 81, 32, 55, 44, 32, 68, 77, 65, - 13, 10, 32, 99, 104, 97, 110, 110, 101, 108, 32, 49, 32, 97, 110, 100, - 32, 98, 97, 115, 101, 32, 97, 100, 100, 114, 101, 115, 115, 32, 50, 50, - 48, 104, 13, 10, 32, 68, 82, 69, 65, 77, 87, 69, 66, 32, 73, 53, - 32, 116, 111, 32, 114, 117, 110, 32, 68, 114, 101, 97, 109, 119, 101, 98, - 32, 111, 110, 32, 73, 82, 81, 32, 53, 32, 97, 110, 100, 13, 10, 32, - 100, 101, 102, 97, 117, 108, 116, 32, 97, 100, 100, 114, 101, 115, 115, 32, - 111, 102, 32, 50, 50, 48, 104, 44, 32, 68, 77, 65, 32, 49, 13, 10, - 13, 10, 36, 13, 10, 13, 10, 84, 114, 121, 32, 116, 104, 101, 32, 68, - 114, 101, 97, 109, 119, 101, 98, 32, 67, 68, 32, 105, 110, 32, 121, 111, - 117, 114, 32, 115, 116, 101, 114, 101, 111, 46, 46, 46, 46, 13, 10, 13, - 10, 13, 10, 36, 129, 0, 184, 0, 82, 0, 128, 0, 188, 200, 80, 0, - 147, 0, 62, 0, 111, 0, 132, 200, 183, 0, 250, 0, 62, 0, 111, 0, - 192, 200, 0, 0, 64, 1, 0, 0, 200, 0, 156, 202, 255, 255, 83, 80, - 69, 69, 67, 72, 82, 50, 52, 67, 48, 48, 48, 53, 46, 82, 65, 87, - 0, 135, 131, 129, 130, 44, 0, 70, 0, 32, 0, 46, 0, 116, 196, 0, - 0, 50, 0, 0, 0, 180, 0, 128, 195, 226, 0, 244, 0, 10, 0, 26, - 0, 44, 200, 226, 0, 244, 0, 26, 0, 40, 0, 48, 200, 240, 0, 4, - 1, 100, 0, 124, 0, 200, 201, 0, 0, 64, 1, 0, 0, 200, 0, 208, - 201, 255, 255, 44, 0, 70, 0, 32, 0, 46, 0, 116, 196, 0, 0, 50, - 0, 0, 0, 180, 0, 128, 195, 18, 1, 36, 1, 10, 0, 26, 0, 44, - 200, 18, 1, 36, 1, 26, 0, 40, 0, 48, 200, 240, 0, 4, 1, 100, - 0, 124, 0, 200, 201, 0, 0, 64, 1, 0, 0, 200, 0, 208, 201, 255, - 255, 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, 5, 22, 10, 15, 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, 21, 11, 20, 15, 255, 21, 0, - 20, 15, 255, 21, 22, 20, 15, 255, 21, 33, 20, 15, 255, 21, 44, 20, - 15, 255, 21, 44, 10, 15, 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, 79, 66, 74, 69, 67, 84, - 32, 78, 65, 77, 69, 32, 79, 78, 69, 32, 0, 16, 18, 18, 17, 16, - 16, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 45, - 0, 8, 0, 81, 87, 69, 82, 84, 89, 85, 73, 79, 80, 0, 0, 13, - 0, 65, 83, 68, 70, 71, 72, 74, 75, 76, 0, 0, 0, 0, 0, 90, - 88, 67, 86, 66, 78, 77, 0, 0, 0, 0, 0, 0, 32, 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, 68, 82, 69, 65, 77, 87, 69, 66, 32, 68, - 65, 84, 65, 32, 70, 73, 76, 69, 32, 67, 79, 80, 89, 82, 73, 71, - 72, 84, 32, 49, 57, 57, 50, 32, 67, 82, 69, 65, 84, 73, 86, 69, - 32, 82, 69, 65, 76, 73, 84, 89, 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, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 48, 0, 5, 255, 33, 10, 255, 255, 255, 0, 1, 6, 2, 255, 3, - 255, 255, 255, 255, 255, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 49, 0, 1, 255, 44, 10, 255, 255, 255, 0, 7, 2, 255, 255, 255, - 255, 6, 255, 255, 255, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 50, 0, 2, 255, 33, 0, 255, 255, 255, 0, 1, 0, 255, 255, 1, - 255, 3, 255, 255, 255, 2, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 51, 0, 5, 255, 33, 10, 255, 255, 255, 0, 2, 2, 0, 2, 4, - 255, 0, 255, 255, 255, 3, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 52, 0, 23, 255, 11, 30, 255, 255, 255, 0, 1, 4, 0, 5, 255, - 255, 3, 255, 255, 255, 4, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 53, 0, 5, 255, 22, 30, 255, 255, 255, 0, 1, 2, 0, 4, 255, - 255, 3, 255, 255, 255, 5, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 54, 0, 5, 255, 11, 30, 255, 255, 255, 0, 1, 0, 0, 1, 2, - 255, 0, 255, 255, 255, 6, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 55, 0, 255, 255, 0, 20, 255, 255, 255, 0, 2, 2, 255, 255, 255, - 255, 0, 255, 255, 255, 7, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 56, 0, 8, 255, 0, 10, 255, 255, 255, 0, 1, 2, 255, 255, 255, - 255, 0, 11, 40, 0, 8, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 57, 0, 9, 255, 22, 10, 255, 255, 255, 0, 4, 6, 255, 255, 255, - 255, 0, 255, 255, 255, 9, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 48, 0, 10, 255, 33, 30, 255, 255, 255, 0, 2, 0, 255, 255, 2, - 2, 4, 22, 30, 255, 10, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 49, 0, 11, 255, 11, 20, 255, 255, 255, 0, 0, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 11, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 50, 0, 12, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 12, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 51, 0, 12, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 13, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 52, 0, 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, 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, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 57, 0, 19, 255, 0, 0, 255, 255, 255, 0, 0, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 19, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 48, 0, 22, 255, 0, 20, 255, 255, 255, 0, 1, 4, 2, 15, 255, - 255, 255, 255, 255, 255, 20, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 49, 0, 5, 255, 11, 10, 255, 255, 255, 0, 1, 4, 2, 15, 1, - 255, 255, 255, 255, 255, 21, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 50, 0, 22, 255, 22, 10, 255, 255, 255, 0, 0, 4, 255, 255, 1, - 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 51, 0, 23, 255, 22, 30, 255, 255, 255, 0, 1, 4, 2, 15, 3, - 255, 255, 255, 255, 255, 23, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 52, 0, 5, 255, 44, 0, 255, 255, 255, 0, 1, 6, 2, 15, 255, - 255, 255, 255, 255, 255, 24, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 53, 0, 22, 255, 11, 40, 255, 255, 255, 0, 1, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 25, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 54, 0, 9, 255, 22, 20, 255, 255, 255, 0, 4, 2, 255, 255, 255, - 255, 255, 255, 255, 255, 26, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 55, 0, 22, 255, 11, 20, 255, 255, 255, 0, 0, 6, 255, 255, 255, - 255, 255, 255, 255, 255, 27, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 56, 0, 5, 255, 11, 30, 255, 255, 255, 0, 0, 0, 255, 255, 2, - 255, 255, 255, 255, 255, 28, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 57, 0, 22, 255, 11, 10, 255, 255, 255, 0, 0, 2, 255, 255, 255, - 255, 255, 255, 255, 255, 29, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 53, 0, 5, 255, 22, 10, 255, 255, 255, 0, 1, 4, 1, 15, 255, - 255, 255, 255, 255, 255, 5, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 52, 0, 23, 255, 22, 20, 255, 255, 255, 0, 1, 4, 2, 15, 255, - 255, 255, 255, 255, 255, 4, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 48, 0, 10, 255, 22, 30, 255, 255, 255, 0, 3, 6, 255, 255, 255, - 255, 255, 255, 255, 255, 10, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 50, 0, 12, 255, 22, 20, 255, 255, 255, 0, 0, 2, 255, 255, 255, - 255, 255, 255, 255, 255, 12, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 51, 0, 5, 255, 44, 0, 255, 255, 255, 0, 1, 6, 2, 255, 4, - 255, 255, 255, 255, 255, 3, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 52, 0, 5, 255, 22, 0, 255, 255, 255, 0, 3, 6, 0, 255, 255, - 255, 255, 33, 0, 3, 24, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 50, 0, 22, 255, 22, 20, 255, 255, 255, 0, 1, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 50, 0, 22, 255, 22, 20, 255, 255, 255, 0, 0, 2, 255, 255, 255, - 255, 255, 255, 255, 255, 22, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 49, 0, 11, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 11, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 56, 0, 5, 255, 11, 20, 255, 255, 255, 0, 0, 6, 255, 255, 2, - 255, 255, 255, 255, 255, 28, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 49, 0, 5, 255, 11, 10, 255, 255, 255, 0, 1, 4, 2, 15, 1, - 255, 255, 255, 255, 255, 21, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 50, 54, 0, 9, 255, 0, 40, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 26, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 49, 57, 0, 19, 255, 0, 0, 255, 255, 255, 0, 2, 2, 255, 255, 255, - 255, 255, 255, 255, 255, 19, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 56, 0, 8, 255, 11, 40, 255, 255, 255, 0, 0, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 8, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 48, 49, 0, 1, 255, 44, 10, 255, 255, 255, 0, 3, 6, 255, 255, 255, - 255, 255, 255, 255, 255, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 52, 53, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 6, 255, 255, 255, - 255, 255, 255, 255, 255, 45, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 52, 54, 0, 35, 255, 22, 40, 255, 255, 255, 0, 0, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 46, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 52, 55, 0, 35, 255, 0, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 47, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 52, 53, 0, 35, 255, 22, 30, 255, 255, 255, 0, 4, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 45, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 52, 54, 0, 35, 255, 22, 50, 255, 255, 255, 0, 0, 4, 255, 255, 255, - 255, 255, 255, 255, 255, 46, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 48, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 50, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 49, 0, 35, 255, 11, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 51, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 50, 0, 35, 255, 22, 30, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 52, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 51, 0, 35, 255, 33, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 53, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 52, 0, 35, 255, 0, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 54, 68, 82, 69, 65, 77, 87, 69, 66, 46, 82, - 53, 53, 0, 14, 255, 44, 0, 255, 255, 255, 0, 0, 0, 255, 255, 255, - 255, 255, 255, 255, 255, 55, 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, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5, 0, 3, 2, 4, 1, 10, 9, 8, 6, - 11, 4, 7, 7, 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, - 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, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 2, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, - 48, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 49, 0, 68, - 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 50, 0, 68, 82, 69, 65, - 77, 87, 69, 66, 46, 68, 48, 51, 0, 68, 82, 69, 65, 77, 87, 69, - 66, 46, 68, 48, 52, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, - 48, 53, 0, 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 48, 54, 0, - 68, 82, 69, 65, 77, 87, 69, 66, 46, 68, 69, 77, 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, 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, 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, - 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, }; -data.assign(src, src + sizeof(src)); - }; - - -void __start(Context &context) { dreamweb(context); } + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00, + 0xff, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 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, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, + 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, + 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, + 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, + 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, + 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, + 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, + 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, + 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, + 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, + 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, + 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, + 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, + 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, + 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, + 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, + 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, + 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, + 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, + 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, + 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, + 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, + 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, + 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, + 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, + 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, + 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, + 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, + 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, + 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, + 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2f, 0x05, + 0x30, 0x05, 0x34, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x47, 0x05, 0x2f, 0x05, 0x4e, 0x05, + 0x5e, 0x05, 0x65, 0x05, 0x69, 0x05, 0x6d, 0x05, 0x71, 0x05, 0x7e, 0x05, 0x2f, 0x05, 0x2f, 0x05, + 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0xa0, 0x05, 0x2f, 0x05, 0xb6, 0x05, 0xd5, 0x05, 0x2f, 0x05, + 0xe2, 0x05, 0xf8, 0x05, 0x0e, 0x06, 0x27, 0x06, 0x3a, 0x06, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, + 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, + 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x4a, 0x06, 0x51, 0x06, 0x76, 0x06, 0x2f, 0x05, + 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x83, 0x06, 0x87, 0x06, 0x2f, 0x05, 0x8e, 0x06, 0xff, 0x0f, + 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, + 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, + 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, + 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, + 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, + 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, + 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, + 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, + 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, + 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, + 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, + 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, + 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, + 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, + 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, + 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, + 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, + 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, + 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, + 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, + 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, + 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, + 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, + 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, + 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, + 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, + 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, + 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, + 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, + 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, + 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, + 0x84, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xe0, 0xc3, 0x90, 0x00, 0xb0, 0x00, + 0x40, 0x00, 0x60, 0x00, 0x84, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x88, 0xc3, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, + 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xcc, 0xc3, + 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, + 0xca, 0x00, 0xe4, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x9c, 0xc3, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, + 0xc6, 0x00, 0x48, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, + 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xc0, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0xf0, 0x00, + 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x98, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, + 0x2c, 0x00, 0xcc, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xd0, 0xc4, 0x18, 0x01, + 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb4, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, + 0xd4, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, 0x40, 0x01, + 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, + 0x50, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x4c, 0x4f, 0x47, 0x4f, + 0x4e, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, + 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, + 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, + 0x4e, 0x44, 0x52, 0x49, 0x58, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x00, 0x00, 0x00, 0x53, + 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, + 0x00, 0xff, 0xff, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x00, 0x22, 0x20, 0x00, 0x4e, + 0x45, 0x54, 0x57, 0xec, 0xc4, 0x45, 0x4c, 0x56, 0x41, 0x90, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0xa0, + 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x45, 0x9c, 0xc6, 0x45, 0x4c, 0x56, + 0x46, 0xa4, 0xc6, 0x43, 0x47, 0x41, 0x54, 0x34, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xac, 0xc6, 0x42, + 0x55, 0x54, 0x41, 0x40, 0xc7, 0x43, 0x42, 0x4f, 0x58, 0x48, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x60, + 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x44, 0xc7, 0x4c, 0x49, 0x46, 0x54, 0x80, 0xc6, 0x57, 0x49, 0x52, + 0x45, 0x88, 0xc6, 0x48, 0x4e, 0x44, 0x4c, 0x8c, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x84, 0xc6, 0x44, + 0x4f, 0x4f, 0x52, 0xb8, 0xc6, 0x43, 0x53, 0x48, 0x52, 0x74, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x38, + 0xc7, 0x43, 0x52, 0x41, 0x41, 0x68, 0xc6, 0x43, 0x52, 0x42, 0x42, 0x6c, 0xc6, 0x43, 0x52, 0x43, + 0x43, 0x70, 0xc6, 0x53, 0x45, 0x41, 0x54, 0xfc, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x9c, 0xc7, 0x43, + 0x4f, 0x4f, 0x4b, 0xb0, 0xc6, 0x45, 0x4c, 0x43, 0x41, 0x50, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x54, + 0xc6, 0x44, 0x44, 0x43, 0x41, 0x58, 0xc6, 0x41, 0x4c, 0x54, 0x52, 0x08, 0xc6, 0x4c, 0x4f, 0x4b, + 0x41, 0x40, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, 0x44, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x14, 0xc6, 0x45, + 0x4e, 0x54, 0x42, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x45, 0x2c, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x1c, + 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x30, 0xc6, 0x45, 0x4e, 0x54, 0x48, 0x34, 0xc6, 0x57, 0x57, 0x41, + 0x54, 0xf4, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, 0x5c, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf8, 0xc5, 0x47, + 0x52, 0x41, 0x46, 0x48, 0xc6, 0x54, 0x52, 0x41, 0x50, 0x4c, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x2c, + 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x45, 0x04, 0xc6, 0x44, 0x52, 0x59, + 0x52, 0x10, 0xc6, 0x48, 0x4f, 0x4c, 0x59, 0x00, 0xc6, 0x57, 0x41, 0x4c, 0x4c, 0x30, 0xc7, 0x42, + 0x4f, 0x4f, 0x4b, 0x0c, 0xc8, 0x41, 0x58, 0x45, 0x44, 0xb4, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x3c, + 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xec, 0xc5, 0x4c, 0x49, 0x44, 0x43, 0xe8, 0xc5, 0x4c, 0x49, 0x44, + 0x55, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x4f, 0xf0, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xac, 0xc5, 0x42, + 0x41, 0x4c, 0x43, 0x24, 0xc6, 0x57, 0x49, 0x4e, 0x44, 0x20, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb8, + 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa4, 0xc5, 0x55, 0x57, 0x54, 0x42, 0xa4, 0xc5, 0x53, 0x54, 0x41, + 0x54, 0xdc, 0xc7, 0x54, 0x4c, 0x49, 0x44, 0xa0, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xdc, 0xc5, 0x43, + 0x41, 0x52, 0x54, 0xe0, 0xc5, 0x46, 0x43, 0x41, 0x52, 0xb0, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc4, + 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x43, 0xd0, 0xc5, 0x53, 0x4c, 0x42, + 0x44, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x45, 0xd4, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd8, 0xc5, 0x50, + 0x4c, 0x49, 0x4e, 0xb4, 0xc5, 0x4c, 0x41, 0x44, 0x44, 0xbc, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xc0, + 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb8, 0xc5, 0x53, 0x51, 0x45, 0x45, 0x8c, 0xc5, 0x54, 0x41, 0x50, + 0x50, 0x90, 0xc5, 0x47, 0x55, 0x49, 0x54, 0x94, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x98, 0xc5, 0x42, + 0x45, 0x4c, 0x4c, 0x9c, 0xc5, 0x8c, 0x8c, 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, + 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, + 0x00, 0x5e, 0x00, 0x60, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x64, 0xc7, 0x9d, + 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, + 0x00, 0x6c, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x70, 0xc7, 0x9d, 0x00, 0xb2, + 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x78, + 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, 0x82, 0x00, 0x7c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, + 0x00, 0x91, 0x00, 0x80, 0xc7, 0xb3, 0x00, 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x84, 0xc7, 0xdc, + 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, 0x54, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0x9c, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x54, 0xc7, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, + 0x00, 0xc8, 0x00, 0x54, 0xc7, 0x8f, 0x00, 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xbc, 0xc7, 0x00, + 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, 0xc4, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0x9c, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xe0, 0xc7, 0x40, + 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, + 0x00, 0xe8, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, 0x74, 0x00, 0xa8, + 0x00, 0x6a, 0x00, 0x88, 0x00, 0xf0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, + 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x20, 0xc8, 0xf3, 0x00, 0x03, + 0x01, 0x83, 0x00, 0x93, 0x00, 0x1c, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x54, + 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, + 0x00, 0x52, 0x00, 0x80, 0x00, 0x38, 0xc8, 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, + 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x50, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, + 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, + 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x5c, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, + 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, + 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, + 0x00, 0x6f, 0x00, 0x54, 0xc8, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, 0xc8, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, + 0x00, 0x80, 0x00, 0x4c, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x58, 0xc8, 0x3e, + 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0x9c, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, + 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, + 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, + 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, + 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, + 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, + 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, + 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, + 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, + 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, + 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, + 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, + 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, + 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, + 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, + 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, + 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, + 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, + 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, + 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, + 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, + 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, + 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, + 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, + 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, + 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, + 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, + 0x44, 0x31, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, + 0x65, 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, + 0x0d, 0x0a, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, + 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, + 0x30, 0x68, 0x0d, 0x0a, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x49, 0x35, + 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, + 0x6f, 0x66, 0x20, 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, + 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, + 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, + 0x75, 0x72, 0x20, 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xbc, 0xc8, 0x50, 0x00, + 0x93, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, + 0xc0, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x53, 0x50, + 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, + 0x00, 0x87, 0x83, 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, + 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, + 0x00, 0x2c, 0xc8, 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, + 0x01, 0x64, 0x00, 0x7c, 0x00, 0xc8, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd0, + 0xc9, 0xff, 0xff, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x2c, + 0xc8, 0x12, 0x01, 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, + 0x00, 0x7c, 0x00, 0xc8, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd0, 0xc9, 0xff, + 0xff, 0x00, 0x21, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, + 0x00, 0x0b, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, + 0x2c, 0x0a, 0x06, 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, + 0x00, 0x05, 0xff, 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, + 0x0f, 0xff, 0x03, 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, + 0xff, 0x04, 0x16, 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, + 0x0a, 0x16, 0x1e, 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, + 0x16, 0x1e, 0x10, 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, + 0x1e, 0x06, 0xff, 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, + 0x0f, 0xff, 0x06, 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, + 0xff, 0x07, 0x00, 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, + 0x05, 0x16, 0x1e, 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, + 0x16, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, + 0x0a, 0x0f, 0xff, 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, + 0x06, 0xff, 0x08, 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, + 0xff, 0x08, 0x21, 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, + 0x0b, 0x0b, 0x14, 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, + 0x16, 0x1e, 0x0c, 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, + 0x14, 0x0c, 0xff, 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, + 0x0c, 0xff, 0x0e, 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, + 0xff, 0x0e, 0x16, 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, + 0x14, 0x00, 0x1e, 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, + 0x0b, 0x28, 0x10, 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, + 0x14, 0x0f, 0xff, 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, + 0x0f, 0xff, 0x15, 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, + 0xff, 0x17, 0x16, 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, + 0x17, 0x0b, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, + 0x0b, 0x28, 0x10, 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, + 0x14, 0x10, 0xff, 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, + 0x0c, 0xff, 0x2d, 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, + 0xff, 0x2e, 0x0b, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, + 0x2f, 0x00, 0x00, 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, + 0x21, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, + 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, + 0x10, 0xff, 0x1a, 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, + 0xff, 0x1a, 0x0b, 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, + 0x1c, 0x00, 0x28, 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, + 0x16, 0x1e, 0x0f, 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, + 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, + 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x2d, + 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, 0x4f, 0x50, 0x00, 0x00, 0x0d, + 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, + 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x44, + 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, + 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x56, 0x45, + 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0xff, 0x03, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x07, 0x02, 0xff, 0xff, 0xff, + 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, + 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0x00, 0x02, 0x04, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x00, 0x05, 0xff, + 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x00, 0x04, 0xff, + 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x01, 0x02, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0xff, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x04, 0x06, 0xff, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, + 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x01, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0x01, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x03, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0x0f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x04, 0x02, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x01, 0x0f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0xff, 0x04, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0x02, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x01, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x04, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, + 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, + 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, + 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x31, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, + 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x36, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, 0x4d, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + context.data.assign(src, src + sizeof(src)); dreamweb(context); } void __dispatch_call(Context &context, unsigned addr) { switch(addr) { diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f4d1801b96..e5b4493a33 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -5,13 +5,6 @@ namespace dreamgen { - struct Data : public Segment { - Data(); - }; - - - typedef RegisterContext Context; - void __dispatch_call(Context &context, unsigned addr); void __start(Context &context); diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 7324475cc9..fb634b6e05 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -6,6 +6,8 @@ #include "common/array.h" #include "common/hashmap.h" +namespace dreamgen { + //fixme: name clash #undef random @@ -84,10 +86,16 @@ public: struct Segment { Common::Array 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 uint16 word(unsigned index) const { assert(index + 1 < data.size()); return data[index] | (data[index + 1] << 8); @@ -98,14 +106,15 @@ struct Segment { } }; +class Context; class SegmentRef { - - uint16 _value; - Segment *_segment; + Context *_context; + uint16 _value; + Segment *_segment; public: - SegmentRef(): _value(), _segment() { + SegmentRef(Context *ctx): _context(ctx), _value(), _segment() { } inline void reset(uint16 value) { @@ -164,8 +173,10 @@ struct Flags { } }; -template -struct RegisterContext { +class Context { + Common::HashMap _segments; + +public: Register ax, dx, bx, cx, si, di; RegisterPart al; RegisterPart ah; @@ -179,7 +190,9 @@ struct RegisterContext { SegmentRef cs, ds, es; Flags flags; - inline RegisterContext(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx) {} + inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this) { + + } inline void _cmp(uint8 a, uint8 b) { uint8 x = a; @@ -330,8 +343,10 @@ struct RegisterContext { return v; } - Data data; + Segment data; }; +} + #endif -- cgit v1.2.3 From 0b0b22ccc2157c7260a55afe3add0629703c0b21 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:36:31 +0400 Subject: DREAMWEB: removed data declaration --- devtools/tasmrecover/tasm/cpp.py | 19 +++++-------------- devtools/tasmrecover/tasm/cpp.pyc | Bin 22205 -> 22024 bytes 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 53338c1d02..d63f568d78 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -497,20 +497,16 @@ namespace %s { self.fd.write("\n\n") print "%d ok, %d failed of %d, %.02g%% translated" %(done, failed, done + failed, 100.0 * done / (done + failed)) print "\n".join(self.failed) - data_decl = "struct Data : public Segment {\n\t\tData();\n" - data_impl = "Data::Data() {\n" data_bin = self.data_seg - data_impl += "\tstatic const uint8 src[] = {\n\t\t" + data_impl = "\n\tstatic const uint8 src[] = {\n\t\t" n = 0 for v in data_bin: - data_impl += "%s, " %v + data_impl += "0x%02x, " %v n += 1 if (n & 0xf) == 0: data_impl += "\n\t\t" - data_impl += "};\ndata.assign(src, src + sizeof(src));\n" + data_impl += "};\n\tcontext.data.assign(src, src + sizeof(src))" hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper() - data_decl += "\t};\n\n" - data_impl += "\t};\n\n" self.hd.write("""#ifndef %s #define %s """ %(hid, hid)) @@ -519,21 +515,16 @@ namespace %s { namespace %s { - %s - typedef RegisterContext Context; - void __dispatch_call(Context &context, unsigned addr); void __start(Context &context); -""" %(self.namespace, data_decl)) - self.fd.write(data_impl) - +""" %(self.namespace)) for f in self.failed: self.hd.write("\tvoid %s(Context &context);\n" %f) self.hd.write("\n}\n\n#endif\n") self.hd.close() - self.fd.write("\nvoid __start(Context &context) { %s(context); }\n" %start) + self.fd.write("\nvoid __start(Context &context) { %s; %s(context); }\n" %(data_impl, start)) self.fd.write("\nvoid __dispatch_call(Context &context, unsigned addr) {\n\tswitch(addr) {\n") self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1]) diff --git a/devtools/tasmrecover/tasm/cpp.pyc b/devtools/tasmrecover/tasm/cpp.pyc index b0406b3252..c454ae4971 100644 Binary files a/devtools/tasmrecover/tasm/cpp.pyc and b/devtools/tasmrecover/tasm/cpp.pyc differ -- cgit v1.2.3 From 4e6483e700e016d9a94b3ddb1fe53e8bc087f9c9 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:37:04 +0400 Subject: DREAMWEB: removed python generated bytecode --- devtools/tasmrecover/.gitignore | 1 + devtools/tasmrecover/tasm/__init__.pyc | Bin 137 -> 0 bytes devtools/tasmrecover/tasm/cpp.pyc | Bin 22024 -> 0 bytes devtools/tasmrecover/tasm/lex.pyc | Bin 1058 -> 0 bytes devtools/tasmrecover/tasm/op.pyc | Bin 32291 -> 0 bytes devtools/tasmrecover/tasm/parser.pyc | Bin 8391 -> 0 bytes devtools/tasmrecover/tasm/proc.pyc | Bin 3100 -> 0 bytes 7 files changed, 1 insertion(+) create mode 100644 devtools/tasmrecover/.gitignore delete mode 100644 devtools/tasmrecover/tasm/__init__.pyc delete mode 100644 devtools/tasmrecover/tasm/cpp.pyc delete mode 100644 devtools/tasmrecover/tasm/lex.pyc delete mode 100644 devtools/tasmrecover/tasm/op.pyc delete mode 100644 devtools/tasmrecover/tasm/parser.pyc delete mode 100644 devtools/tasmrecover/tasm/proc.pyc diff --git a/devtools/tasmrecover/.gitignore b/devtools/tasmrecover/.gitignore new file mode 100644 index 0000000000..0d20b6487c --- /dev/null +++ b/devtools/tasmrecover/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/devtools/tasmrecover/tasm/__init__.pyc b/devtools/tasmrecover/tasm/__init__.pyc deleted file mode 100644 index 8582b7b592..0000000000 Binary files a/devtools/tasmrecover/tasm/__init__.pyc and /dev/null differ diff --git a/devtools/tasmrecover/tasm/cpp.pyc b/devtools/tasmrecover/tasm/cpp.pyc deleted file mode 100644 index c454ae4971..0000000000 Binary files a/devtools/tasmrecover/tasm/cpp.pyc and /dev/null differ diff --git a/devtools/tasmrecover/tasm/lex.pyc b/devtools/tasmrecover/tasm/lex.pyc deleted file mode 100644 index aaab26e8cf..0000000000 Binary files a/devtools/tasmrecover/tasm/lex.pyc and /dev/null differ diff --git a/devtools/tasmrecover/tasm/op.pyc b/devtools/tasmrecover/tasm/op.pyc deleted file mode 100644 index 2e212ae64c..0000000000 Binary files a/devtools/tasmrecover/tasm/op.pyc and /dev/null differ diff --git a/devtools/tasmrecover/tasm/parser.pyc b/devtools/tasmrecover/tasm/parser.pyc deleted file mode 100644 index d7049c84b4..0000000000 Binary files a/devtools/tasmrecover/tasm/parser.pyc and /dev/null differ diff --git a/devtools/tasmrecover/tasm/proc.pyc b/devtools/tasmrecover/tasm/proc.pyc deleted file mode 100644 index cd8f967509..0000000000 Binary files a/devtools/tasmrecover/tasm/proc.pyc and /dev/null differ -- cgit v1.2.3 From 781d06709f4e5dbc0812c285248a08452f9f7005 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:38:20 +0400 Subject: DREAMWEB: updated git ignore --- devtools/tasmrecover/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devtools/tasmrecover/.gitignore b/devtools/tasmrecover/.gitignore index 0d20b6487c..c1b0a4c6eb 100644 --- a/devtools/tasmrecover/.gitignore +++ b/devtools/tasmrecover/.gitignore @@ -1 +1,5 @@ *.pyc +dreamweb +dreamgen.* +_stubs* + -- cgit v1.2.3 From 1ee6b0af692d0dc478ad50ec32c8a7144c40ee40 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:53:47 +0400 Subject: DREAMWEB: get rid of data, added simple segment management --- devtools/tasmrecover/tasm/cpp.py | 8 +- engines/dreamweb/dreamgen.cpp | 8390 +++++++++++++++++++------------------- engines/dreamweb/runtime.h | 35 +- 3 files changed, 4225 insertions(+), 4208 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index d63f568d78..f9afe48fd8 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -63,7 +63,7 @@ namespace %s { if size == 0: raise Exception("invalid var '%s' size %u" %(name, size)) if self.indirection == 0: - value = "context.data.%s(%d)" %("byte" if size == 1 else "word", g.offset) + value = "context.ds.%s(%d)" %("byte" if size == 1 else "word", g.offset) elif self.indirection == -1: value = "%s" %g.offset self.indirection = 0 @@ -161,9 +161,9 @@ namespace %s { if indirection == 1: if size == 1: - expr = "context.data.byte(%s)" %expr + expr = "context.ds.byte(%s)" %expr elif size == 2: - expr = "context.data.word(%s)" %expr + expr = "context.ds.word(%s)" %expr else: expr = "@invalid size 0" elif indirection == 0: @@ -505,7 +505,7 @@ namespace %s { n += 1 if (n & 0xf) == 0: data_impl += "\n\t\t" - data_impl += "};\n\tcontext.data.assign(src, src + sizeof(src))" + data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src))" hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper() self.hd.write("""#ifndef %s #define %s diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 6d45fbfd80..3ec12c1363 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -483,7 +483,7 @@ static void intro3text(Context &context); static void intro1text(Context &context); static void alleybarksound(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._sub(context.ax, 1); context._cmp(context.ax, 0); if (!context.flags.z()) goto nobark; @@ -495,7 +495,7 @@ static void alleybarksound(Context & context) { context.bx = context.pop(); context.ax = 1000; nobark: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; return; } @@ -516,49 +516,49 @@ nofog: static void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; - context._cmp(context.data.byte(52), 1); + context._cmp(context.ds.byte(52), 1); if (!context.flags.z()) goto notsetcard; - context._add(context.data.byte(52), 1); - context.data.byte(context.bx+7) = 1; - context.data.word(context.bx+3) = 64; + context._add(context.ds.byte(52), 1); + context.ds.byte(context.bx+7) = 1; + context.ds.word(context.bx+3) = 64; notsetcard: - context._cmp(context.data.word(context.bx+3), 58); + context._cmp(context.ds.word(context.bx+3), 58); if (!context.flags.z()) goto notdes1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto notdes2; - context.data.word(context.bx+3) = 55; + context.ds.word(context.bx+3) = 55; goto gotrecep; notdes1: - context._cmp(context.data.word(context.bx+3), 60); + context._cmp(context.ds.word(context.bx+3), 60); if (!context.flags.z()) goto notdes2; randomnumber(context); context._cmp(context.al, 240); if (context.flags.c()) goto gotrecep; - context.data.word(context.bx+3) = 53; + context.ds.word(context.bx+3) = 53; goto gotrecep; notdes2: - context._cmp(context.data.word(context.bx+3), 88); + context._cmp(context.ds.word(context.bx+3), 88); if (!context.flags.z()) goto notendcard; - context.data.word(context.bx+3) = 53; + context.ds.word(context.bx+3) = 53; goto gotrecep; notendcard: - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); gotrecep: showgamereel(context); addtopeoplelist(context); - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedrecep; - context.data.byte(51) = 1; + context.ds.byte(51) = 1; nottalkedrecep: return; } static void smokebloke(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.ds.byte(41), 0); if (!context.flags.z()) goto notspokento; - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto notspokento; context.push(context.es); @@ -570,20 +570,20 @@ static void smokebloke(Context & context) { notspokento: checkspeed(context); if (!context.flags.z()) goto gotsmokeb; - context._cmp(context.data.word(context.bx+3), 100); + context._cmp(context.ds.word(context.bx+3), 100); if (!context.flags.z()) goto notsmokeb1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto notsmokeb2; - context.data.word(context.bx+3) = 96; + context.ds.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb1: - context._cmp(context.data.word(context.bx+3), 117); + context._cmp(context.ds.word(context.bx+3), 117); if (!context.flags.z()) goto notsmokeb2; - context.data.word(context.bx+3) = 96; + context.ds.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb2: - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); gotsmokeb: showgamereel(context); addtopeoplelist(context); @@ -593,25 +593,25 @@ gotsmokeb: static void attendant(Context & context) { showgamereel(context); addtopeoplelist(context); - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalked; - context.data.byte(48) = 1; + context.ds.byte(48) = 1; nottalked: return; } static void manasleep(Context & context) { - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); - context.data.byte(context.bx+7) = context.al; + context.ds.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); return; } static void eden(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.ds.byte(42), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); @@ -620,9 +620,9 @@ notinbed: } static void edeninbath(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.ds.byte(42), 0); if (context.flags.z()) goto notinbed; - context._cmp(context.data.byte(43), 0); + context._cmp(context.ds.byte(43), 0); if (!context.flags.z()) goto notinbath; showgamereel(context); addtopeoplelist(context); @@ -647,7 +647,7 @@ static void femalefan(Context & context) { } static void louis(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.ds.byte(41), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); @@ -656,26 +656,26 @@ notlouis1: } static void louischair(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.ds.byte(41), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); if (!context.flags.z()) goto notlouisanim; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 191); if (context.flags.z()) goto restartlouis; context._cmp(context.ax, 185); if (context.flags.z()) goto randomlouis; - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; goto notlouisanim; randomlouis: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; randomnumber(context); context._cmp(context.al, 245); if (!context.flags.c()) goto notlouisanim; restartlouis: context.ax = 182; - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; notlouisanim: showgamereel(context); addtopeoplelist(context); @@ -684,9 +684,9 @@ notlouis2: } static void manasleep2(Context & context) { - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); - context.data.byte(context.bx+7) = context.al; + context.ds.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); return; @@ -707,18 +707,18 @@ static void tattooman(Context & context) { static void drinker(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotdrinker; - context._add(context.data.word(context.bx+3), 1); - context._cmp(context.data.word(context.bx+3), 115); + context._add(context.ds.word(context.bx+3), 1); + context._cmp(context.ds.word(context.bx+3), 115); if (!context.flags.z()) goto notdrinker1; - context.data.word(context.bx+3) = 105; + context.ds.word(context.bx+3) = 105; goto gotdrinker; notdrinker1: - context._cmp(context.data.word(context.bx+3), 106); + context._cmp(context.ds.word(context.bx+3), 106); if (!context.flags.z()) goto gotdrinker; randomnumber(context); context._cmp(context.al, 3); if (context.flags.c()) goto gotdrinker; - context.data.word(context.bx+3) = 105; + context.ds.word(context.bx+3) = 105; gotdrinker: showgamereel(context); addtopeoplelist(context); @@ -728,25 +728,25 @@ gotdrinker: static void bartender(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotsmoket; - context._cmp(context.data.word(context.bx+3), 86); + context._cmp(context.ds.word(context.bx+3), 86); if (!context.flags.z()) goto notsmoket1; randomnumber(context); context._cmp(context.al, 18); if (context.flags.c()) goto notsmoket2; - context.data.word(context.bx+3) = 81; + context.ds.word(context.bx+3) = 81; goto gotsmoket; notsmoket1: - context._cmp(context.data.word(context.bx+3), 103); + context._cmp(context.ds.word(context.bx+3), 103); if (!context.flags.z()) goto notsmoket2; - context.data.word(context.bx+3) = 81; + context.ds.word(context.bx+3) = 81; goto gotsmoket; notsmoket2: - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); gotsmoket: showgamereel(context); - context._cmp(context.data.byte(46), 1); + context._cmp(context.ds.byte(46), 1); if (!context.flags.z()) goto notgotgun; - context.data.byte(context.bx+7) = 9; + context.ds.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); return; @@ -765,49 +765,49 @@ static void barwoman(Context & context) { } static void interviewer(Context & context) { - context._cmp(context.data.word(23), 68); + context._cmp(context.ds.word(23), 68); if (!context.flags.z()) goto notgeneralstart; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); notgeneralstart: - context._cmp(context.data.word(context.bx+3), 250); + context._cmp(context.ds.word(context.bx+3), 250); if (context.flags.z()) goto talking; checkspeed(context); if (!context.flags.z()) goto talking; - context._cmp(context.data.word(context.bx+3), 259); + context._cmp(context.ds.word(context.bx+3), 259); if (context.flags.z()) goto talking; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); talking: showgamereel(context); return; } static void soldier1(Context & context) { - context._cmp(context.data.word(context.bx+3), 0); + context._cmp(context.ds.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; - context.data.word(21) = 10; - context._cmp(context.data.word(context.bx+3), 30); + context.ds.word(21) = 10; + context._cmp(context.ds.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 40); if (!context.flags.z()) goto gotsoldframe; - context.data.byte(56) = 2; + context.ds.byte(56) = 2; goto gotsoldframe; notaftersshot: checkspeed(context); if (!context.flags.z()) goto gotsoldframe; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); goto gotsoldframe; soldierwait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto gotsoldframe; - context.data.word(21) = 10; - context._cmp(context.data.byte(475), 2); + context.ds.word(21) = 10; + context._cmp(context.ds.byte(475), 2); if (!context.flags.z()) goto gotsoldframe; - context._cmp(context.data.byte(133), 4); + context._cmp(context.ds.byte(133), 4); if (!context.flags.z()) goto gotsoldframe; - context._add(context.data.word(context.bx+3), 1); - context.data.byte(65) = -1; - context.data.byte(64) = 0; + context._add(context.ds.word(context.bx+3), 1); + context.ds.byte(65) = -1; + context.ds.byte(64) = 0; gotsoldframe: showgamereel(context); addtopeoplelist(context); @@ -815,70 +815,70 @@ gotsoldframe: } static void rockstar(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; context._cmp(context.ax, 118); if (context.flags.z()) goto rockcombatend; checkspeed(context); if (!context.flags.z()) goto rockspeed; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; - context.data.byte(56) = 2; + context.ds.byte(56) = 2; goto gotrockframe; notbeforedead: context._cmp(context.ax, 79); if (!context.flags.z()) goto gotrockframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto notgunonrock; - context.data.byte(65) = -1; + context.ds.byte(65) = -1; context.ax = 123; goto gotrockframe; notgunonrock: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 40); if (!context.flags.z()) goto gotrockframe; - context.data.byte(64) = 0; + context.ds.byte(64) = 0; context.ax = 79; gotrockframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; rockspeed: showgamereel(context); - context._cmp(context.data.word(context.bx+3), 78); + context._cmp(context.ds.word(context.bx+3), 78); if (!context.flags.z()) goto notalkrock; addtopeoplelist(context); - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.ds.byte(234) = 2; + context.ds.word(21) = 0; return; notalkrock: - context.data.word(21) = 2; - context.data.byte(234) = 0; - context.al = context.data.byte(149); - context.data.byte(context.bx+2) = context.al; + context.ds.word(21) = 2; + context.ds.byte(234) = 0; + context.al = context.ds.byte(149); + context.ds.byte(context.bx+2) = context.al; return; rockcombatend: - context.data.byte(188) = 45; + context.ds.byte(188) = 45; showgamereel(context); return; } static void helicopter(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; checkspeed(context); if (!context.flags.z()) goto helispeed; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 8); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 8); if (context.flags.c()) goto waitabit; - context.data.byte(56) = 2; + context.ds.byte(56) = 2; waitabit: context.ax = 49; goto gotheliframe; @@ -886,59 +886,59 @@ notbeforehdead: context._cmp(context.ax, 9); if (!context.flags.z()) goto gotheliframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto notgunonheli; - context.data.byte(65) = -1; + context.ds.byte(65) = -1; context.ax = 55; goto gotheliframe; notgunonheli: context.ax = 5; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 20); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 20); if (!context.flags.z()) goto gotheliframe; - context.data.byte(64) = 0; + context.ds.byte(64) = 0; context.ax = 9; gotheliframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; helispeed: showgamereel(context); - context.al = context.data.byte(148); - context.data.byte(context.bx+1) = context.al; + context.al = context.ds.byte(148); + context.ds.byte(context.bx+1) = context.al; helicombatend: - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; - context._cmp(context.data.byte(64), 7); + context._cmp(context.ds.byte(64), 7); if (context.flags.c()) goto notwaitingheli; - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.ds.byte(234) = 2; + context.ds.word(21) = 0; return; notwaitingheli: - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.ds.byte(234) = 0; + context.ds.word(21) = 2; return; heliwon: - context.data.byte(234) = 0; + context.ds.byte(234) = 0; return; } static void mugger(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; context._cmp(context.ax, 176); if (context.flags.z()) goto endmugger2; context._cmp(context.ax, 2); if (!context.flags.z()) goto havesetwatch; - context.data.word(21) = 175*2; + context.ds.word(21) = 175*2; havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); notmugger: showgamereel(context); - context.al = context.data.byte(148); - context.data.byte(context.bx+1) = context.al; + context.al = context.ds.byte(148); + context.ds.byte(context.bx+1) = context.al; return; endmugger1: context.push(context.es); @@ -959,26 +959,26 @@ endmugger1: context.es = context.pop(); context.push(context.es); context.push(context.bx); - context.data.word(context.bx+3) = 140; - context.data.byte(475) = 2; - context.data.byte(477) = 2; + context.ds.word(context.bx+3) = 140; + context.ds.byte(475) = 2; + context.ds.byte(477) = 2; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'A'; findexobject(context); - context.data.byte(99) = context.al; - context.data.byte(102) = 4; + context.ds.byte(99) = context.al; + context.ds.byte(102) = 4; removeobfrominv(context); context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'B'; findexobject(context); - context.data.byte(99) = context.al; - context.data.byte(102) = 4; + context.ds.byte(99) = context.al; + context.ds.byte(102) = 4; removeobfrominv(context); makemainscreen(context); context.al = 48; @@ -987,7 +987,7 @@ endmugger1: context.cx = 70; context.dx = 10; setuptimeduse(context); - context.data.byte(45) = 1; + context.ds.byte(45) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -1002,9 +1002,9 @@ static void aide(Context & context) { } static void businessman(Context & context) { - context.data.byte(234) = 0; - context.data.word(21) = 2; - context.ax = context.data.word(context.bx+3); + context.ds.byte(234) = 0; + context.ds.word(21) = 2; + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 2); if (!context.flags.z()) goto notfirstbiz; context.push(context.ax); @@ -1026,27 +1026,27 @@ notfirstbiz: if (context.flags.z()) goto buscombatend; checkspeed(context); if (!context.flags.z()) goto busspeed; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; - context.data.byte(56) = 2; + context.ds.byte(56) = 2; goto gotbusframe; notbeforedeadb: context._cmp(context.ax, 15); if (!context.flags.z()) goto buscombatwon; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 3); + context._cmp(context.ds.byte(65), 3); if (!context.flags.z()) goto notshieldonbus; - context.data.byte(65) = -1; - context.data.byte(64) = 0; + context.ds.byte(65) = -1; + context.ds.byte(64) = 0; context.ax = 51; goto gotbusframe; notshieldonbus: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 20); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 20); if (!context.flags.z()) goto gotbusframe; - context.data.byte(64) = 0; + context.ds.byte(64) = 0; context.ax = 15; goto gotbusframe; buscombatwon: @@ -1062,36 +1062,36 @@ buscombatwon: turnpathon(context); context.al = 3; turnpathoff(context); - context.data.byte(475) = 5; - context.data.byte(477) = 5; + context.ds.byte(475) = 5; + context.ds.byte(477) = 5; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; context.es = context.pop(); context.bx = context.pop(); context.ax = 92; goto gotbusframe; gotbusframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; busspeed: showgamereel(context); - context.al = context.data.byte(149); - context.data.byte(context.bx+2) = context.al; - context.ax = context.data.word(context.bx+3); + context.al = context.ds.byte(149); + context.ds.byte(context.bx+2) = context.al; + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) goto buscombatend; - context.data.word(21) = 0; - context.data.byte(234) = 2; + context.ds.word(21) = 0; + context.ds.byte(234) = 2; return; buscombatend: return; buscombatwonend: - context.data.byte(234) = 0; - context.data.word(21) = 0; + context.ds.byte(234) = 0; + context.ds.word(21) = 0; return; } static void poolguard(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; context._cmp(context.ax, 258); @@ -1105,57 +1105,57 @@ static void poolguard(Context & context) { notfirstpool: checkspeed(context); if (!context.flags.z()) goto guardspeed; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 2); + context._cmp(context.ds.byte(65), 2); if (!context.flags.z()) goto notaxeonpool; - context.data.byte(65) = -1; + context.ds.byte(65) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(64) = 0; + context.ds.byte(64) = 0; context.ax = 195; goto gotguardframe; notendguard1: context._cmp(context.ax, 147); if (!context.flags.z()) goto gotguardframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto notgunonpool; - context.data.byte(65) = -1; + context.ds.byte(65) = -1; context.ax = 147; goto gotguardframe; notgunonpool: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(64) = 0; + context.ds.byte(64) = 0; context.ax = 220; gotguardframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; guardspeed: showgamereel(context); - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 121); if (context.flags.z()) goto iswaitingpool; context._cmp(context.ax, 146); if (context.flags.z()) goto iswaitingpool; - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.ds.byte(234) = 0; + context.ds.word(21) = 2; return; iswaitingpool: - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.ds.byte(234) = 2; + context.ds.word(21) = 0; return; combatover1: - context.data.word(21) = 0; - context.data.byte(234) = 0; + context.ds.word(21) = 0; + context.ds.byte(234) = 0; context.al = 0; turnpathon(context); context.al = 1; @@ -1163,39 +1163,39 @@ combatover1: return; combatover2: showgamereel(context); - context.data.word(21) = 2; - context.data.byte(234) = 0; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 100); + context.ds.word(21) = 2; + context.ds.byte(234) = 0; + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 100); if (context.flags.c()) goto doneover2; - context.data.word(21) = 0; - context.data.byte(56) = 2; + context.ds.word(21) = 0; + context.ds.byte(56) = 2; doneover2: return; } static void security(Context & context) { - context._cmp(context.data.word(context.bx+3), 32); + context._cmp(context.ds.word(context.bx+3), 32); if (context.flags.z()) goto securwait; - context._cmp(context.data.word(context.bx+3), 69); + context._cmp(context.ds.word(context.bx+3), 69); if (!context.flags.z()) goto notaftersec; return; notaftersec: - context.data.word(21) = 10; + context.ds.word(21) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); goto gotsecurframe; securwait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto gotsecurframe; - context.data.word(21) = 10; - context._cmp(context.data.byte(475), 9); + context.ds.word(21) = 10; + context._cmp(context.ds.byte(475), 9); if (!context.flags.z()) goto gotsecurframe; - context._cmp(context.data.byte(133), 0); + context._cmp(context.ds.byte(133), 0); if (!context.flags.z()) goto gotsecurframe; - context.data.byte(65) = -1; - context._add(context.data.word(context.bx+3), 1); + context.ds.byte(65) = -1; + context._add(context.ds.word(context.bx+3), 1); gotsecurframe: showgamereel(context); addtopeoplelist(context); @@ -1203,34 +1203,34 @@ gotsecurframe: } static void heavy(Context & context) { - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); - context.data.byte(context.bx+7) = context.al; - context._cmp(context.data.word(context.bx+3), 43); + context.ds.byte(context.bx+7) = context.al; + context._cmp(context.ds.word(context.bx+3), 43); if (context.flags.z()) goto heavywait; - context.data.word(21) = 10; - context._cmp(context.data.word(context.bx+3), 70); + context.ds.word(21) = 10; + context._cmp(context.ds.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 80); + context._add(context.ds.byte(64), 1); + context._cmp(context.ds.byte(64), 80); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(56) = 2; + context.ds.byte(56) = 2; goto gotheavyframe; notafterhshot: checkspeed(context); if (!context.flags.z()) goto gotheavyframe; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); goto gotheavyframe; heavywait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.ds.byte(65), 1); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(475), 5); + context._cmp(context.ds.byte(475), 5); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(133), 4); + context._cmp(context.ds.byte(133), 4); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(65) = -1; - context._add(context.data.word(context.bx+3), 1); - context.data.byte(64) = 0; + context.ds.byte(65) = -1; + context._add(context.ds.word(context.bx+3), 1); + context.ds.byte(64) = 0; gotheavyframe: showgamereel(context); addtopeoplelist(context); @@ -1240,7 +1240,7 @@ gotheavyframe: static void bossman(Context & context) { checkspeed(context); if (!context.flags.z()) goto notboss; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 4); if (context.flags.z()) goto firstdes; @@ -1249,11 +1249,11 @@ static void bossman(Context & context) { context._cmp(context.ax, 41); if (!context.flags.z()) goto gotallboss; context.ax = 0; - context._add(context.data.byte(46), 1); - context.data.byte(context.bx+7) = 10; + context._add(context.ds.byte(46), 1); + context.ds.byte(context.bx+7) = 10; goto gotallboss; firstdes: - context._cmp(context.data.byte(46), 1); + context._cmp(context.ds.byte(46), 1); if (context.flags.z()) goto gotallboss; context.push(context.ax); randomnumber(context); @@ -1264,18 +1264,18 @@ firstdes: context.ax = 0; goto gotallboss; secdes: - context._cmp(context.data.byte(46), 1); + context._cmp(context.ds.byte(46), 1); if (context.flags.z()) goto gotallboss; context.ax = 0; gotallboss: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; notboss: showgamereel(context); addtopeoplelist(context); - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedboss; - context.data.byte(50) = 1; + context.ds.byte(50) = 1; nottalkedboss: return; } @@ -1289,10 +1289,10 @@ gameragain: context._cmp(context.al, 5); if (!context.flags.c()) goto gameragain; context._add(context.al, 20); - context._cmp(context.al, context.data.byte(context.bx+3)); + context._cmp(context.al, context.ds.byte(context.bx+3)); if (context.flags.z()) goto gameragain; context.ah = 0; - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; gamerfin: showgamereel(context); addtopeoplelist(context); @@ -1319,17 +1319,17 @@ cantdrip2: } static void keeper(Context & context) { - context._cmp(context.data.byte(54), 0); + context._cmp(context.ds.byte(54), 0); if (!context.flags.z()) goto notwaiting; - context._cmp(context.data.word(23), 190); + context._cmp(context.ds.word(23), 190); if (context.flags.c()) goto waiting; - context._add(context.data.byte(54), 1); - context.ah = context.data.byte(context.bx+7); + context._add(context.ds.byte(54), 1); + context.ah = context.ds.byte(context.bx+7); context._and(context.ah, 127); - context._cmp(context.ah, context.data.byte(66)); + context._cmp(context.ah, context.ds.byte(66)); if (context.flags.z()) goto notdiff; - context.al = context.data.byte(66); - context.data.byte(context.bx+7) = context.al; + context.al = context.ds.byte(66); + context.ds.byte(context.bx+7) = context.al; notdiff: return; notwaiting: @@ -1342,13 +1342,13 @@ waiting: static void candles1(Context & context) { checkspeed(context); if (!context.flags.z()) goto candle1; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 44); if (!context.flags.z()) goto notendcandle1; context.ax = 39; notendcandle1: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; candle1: showgamereel(context); return; @@ -1357,13 +1357,13 @@ candle1: static void smallcandle(Context & context) { checkspeed(context); if (!context.flags.z()) goto smallcandlef; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 37); if (!context.flags.z()) goto notendsmallcandle; context.ax = 25; notendsmallcandle: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; smallcandlef: showgamereel(context); return; @@ -1372,25 +1372,25 @@ smallcandlef: static void intromagic1(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm1fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 145); if (!context.flags.z()) goto gotintrom1; context.ax = 121; gotintrom1: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(139), 1); + context._add(context.ds.byte(139), 1); context.push(context.es); context.push(context.bx); intro1text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 8); + context._cmp(context.ds.byte(139), 8); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.ds.byte(149), 10); + context.ds.byte(186) = 1; introm1fin: showgamereel(context); return; @@ -1399,13 +1399,13 @@ introm1fin: static void candles(Context & context) { checkspeed(context); if (!context.flags.z()) goto candlesfin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 167); if (!context.flags.z()) goto gotcandles; context.ax = 162; gotcandles: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; candlesfin: showgamereel(context); return; @@ -1414,13 +1414,13 @@ candlesfin: static void candles2(Context & context) { checkspeed(context); if (!context.flags.z()) goto candles2fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 238); if (!context.flags.z()) goto gotcandles2; context.ax = 233; gotcandles2: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; candles2fin: showgamereel(context); return; @@ -1429,7 +1429,7 @@ candles2fin: static void gates(Context & context) { checkspeed(context); if (!context.flags.z()) goto gatesfin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 116); if (!context.flags.z()) goto notbang; @@ -1444,14 +1444,14 @@ static void gates(Context & context) { notbang: context._cmp(context.ax, 110); if (context.flags.c()) goto slowgates; - context.data.byte(context.bx+5) = 2; + context.ds.byte(context.bx+5) = 2; slowgates: context._cmp(context.ax, 120); if (!context.flags.z()) goto gotgates; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; context.ax = 119; gotgates: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; context.push(context.es); context.push(context.bx); intro3text(context); @@ -1465,13 +1465,13 @@ gatesfin: static void intromagic2(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm2fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 216); if (!context.flags.z()) goto gotintrom2; context.ax = 192; gotintrom2: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; introm2fin: showgamereel(context); return; @@ -1480,39 +1480,39 @@ introm2fin: static void intromagic3(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm3fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; gotintrom3: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; introm3fin: showgamereel(context); - context.al = context.data.byte(148); - context.data.byte(context.bx+1) = context.al; + context.al = context.ds.byte(148); + context.ds.byte(context.bx+1) = context.al; return; } static void intromonks1(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk1fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.ds.byte(149), 10); + context.ds.byte(186) = 1; showgamereel(context); return; notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; - context._sub(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._sub(context.ds.byte(149), 10); + context.ds.byte(186) = 1; context.ax = 51; gotintromonk1: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; context._cmp(context.ax, 5); if (context.flags.z()) goto waitstep; context._cmp(context.ax, 15); @@ -1530,28 +1530,28 @@ waitstep: intro2text(context); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(context.bx+6) = -20; + context.ds.byte(context.bx+6) = -20; intromonk1fin: showgamereel(context); - context.al = context.data.byte(149); - context.data.byte(context.bx+2) = context.al; + context.al = context.ds.byte(149); + context.ds.byte(context.bx+2) = context.al; return; } static void intromonks2(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk2fin; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; - context._add(context.data.byte(139), 1); + context._add(context.ds.byte(139), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 19); + context._cmp(context.ds.byte(139), 19); if (!context.flags.z()) goto notlasttalk1; context.ax = 87; goto gotintromonk2; @@ -1561,13 +1561,13 @@ notlasttalk1: nottalk1: context._cmp(context.ax, 110); if (!context.flags.z()) goto notraisearm; - context._add(context.data.byte(139), 1); + context._add(context.ds.byte(139), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 35); + context._cmp(context.ds.byte(139), 35); if (!context.flags.z()) goto notlastraise; context.ax = 111; goto gotintromonk2; @@ -1577,14 +1577,14 @@ notlastraise: notraisearm: context._cmp(context.ax, 176); if (!context.flags.z()) goto notendmonk2; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; goto gotintromonk2; notendmonk2: context._cmp(context.ax, 125); if (!context.flags.z()) goto gotintromonk2; context.ax = 140; gotintromonk2: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; intromonk2fin: showgamereel(context); return; @@ -1595,7 +1595,7 @@ static void handclap(Context & context) { } static void monks2text(Context & context) { - context._cmp(context.data.byte(139), 1); + context._cmp(context.ds.byte(139), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; context.bl = 36; @@ -1603,7 +1603,7 @@ static void monks2text(Context & context) { context.cx = 100; goto gotmonks2text; notmonk2text1: - context._cmp(context.data.byte(139), 4); + context._cmp(context.ds.byte(139), 4); if (!context.flags.z()) goto notmonk2text2; context.al = 9; context.bl = 36; @@ -1611,7 +1611,7 @@ notmonk2text1: context.cx = 100; goto gotmonks2text; notmonk2text2: - context._cmp(context.data.byte(139), 7); + context._cmp(context.ds.byte(139), 7); if (!context.flags.z()) goto notmonk2text3; context.al = 10; context.bl = 36; @@ -1619,7 +1619,7 @@ notmonk2text2: context.cx = 100; goto gotmonks2text; notmonk2text3: - context._cmp(context.data.byte(139), 10); + context._cmp(context.ds.byte(139), 10); if (!context.flags.z()) goto notmonk2text4; context.al = 11; context.bl = 0; @@ -1627,7 +1627,7 @@ notmonk2text3: context.cx = 100; goto gotmonks2text; notmonk2text4: - context._cmp(context.data.byte(139), 13); + context._cmp(context.ds.byte(139), 13); if (!context.flags.z()) goto notmonk2text5; context.al = 12; context.bl = 0; @@ -1635,7 +1635,7 @@ notmonk2text4: context.cx = 100; goto gotmonks2text; notmonk2text5: - context._cmp(context.data.byte(139), 16); + context._cmp(context.ds.byte(139), 16); if (!context.flags.z()) goto notmonk2text6; context.al = 13; context.bl = 0; @@ -1643,7 +1643,7 @@ notmonk2text5: context.cx = 100; goto gotmonks2text; notmonk2text6: - context._cmp(context.data.byte(139), 19); + context._cmp(context.ds.byte(139), 19); if (!context.flags.z()) goto notmonk2text7; context.al = 14; context.bl = 36; @@ -1653,7 +1653,7 @@ notmonk2text6: context.ah = 82; { setuptimedtemp(context); return; }; notmonk2text7: - context._cmp(context.data.byte(139), 22); + context._cmp(context.ds.byte(139), 22); if (!context.flags.z()) goto notmonk2text8; context.al = 15; context.bl = 36; @@ -1661,7 +1661,7 @@ notmonk2text7: context.cx = 100; goto gotmonks2text; notmonk2text8: - context._cmp(context.data.byte(139), 25); + context._cmp(context.ds.byte(139), 25); if (!context.flags.z()) goto notmonk2text9; context.al = 16; context.bl = 36; @@ -1669,7 +1669,7 @@ notmonk2text8: context.cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.data.byte(139), 28); + context._cmp(context.ds.byte(139), 28); if (!context.flags.z()) goto notmonk2text10; context.al = 17; context.bl = 36; @@ -1677,7 +1677,7 @@ notmonk2text9: context.cx = 100; goto gotmonks2text; notmonk2text10: - context._cmp(context.data.byte(139), 31); + context._cmp(context.ds.byte(139), 31); if (!context.flags.z()) goto notmonk2text11; context.al = 18; context.bl = 36; @@ -1695,7 +1695,7 @@ gotmonks2text: } static void intro1text(Context & context) { - context._cmp(context.data.byte(139), 2); + context._cmp(context.ds.byte(139), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; context.bl = 34; @@ -1703,7 +1703,7 @@ static void intro1text(Context & context) { context.cx = 90; goto gotintro1text; notintro1text1: - context._cmp(context.data.byte(139), 4); + context._cmp(context.ds.byte(139), 4); if (!context.flags.z()) goto notintro1text2; context.al = 41; context.bl = 34; @@ -1711,7 +1711,7 @@ notintro1text1: context.cx = 90; goto gotintro1text; notintro1text2: - context._cmp(context.data.byte(139), 6); + context._cmp(context.ds.byte(139), 6); if (!context.flags.z()) goto notintro1text3; context.al = 42; context.bl = 34; @@ -1781,23 +1781,23 @@ gotintro3text: static void monkandryan(Context & context) { checkspeed(context); if (!context.flags.z()) goto notmonkryan; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; - context._add(context.data.byte(139), 1); + context._add(context.ds.byte(139), 1); context.push(context.es); context.push(context.bx); textformonk(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 77; - context._cmp(context.data.byte(139), 57); + context._cmp(context.ds.byte(139), 57); if (!context.flags.z()) goto gotmonkryan; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; gotmonkryan: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; notmonkryan: showgamereel(context); return; @@ -1806,13 +1806,13 @@ notmonkryan: static void endgameseq(Context & context) { checkspeed(context); if (!context.flags.z()) goto notendseq; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; - context._cmp(context.data.byte(139), 140); + context._cmp(context.ds.byte(139), 140); if (context.flags.z()) goto gotendseq; - context._add(context.data.byte(139), 1); + context._add(context.ds.byte(139), 1); context.push(context.es); context.push(context.bx); textforend(context); @@ -1820,7 +1820,7 @@ static void endgameseq(Context & context) { context.es = context.pop(); context.ax = 50; gotendseq: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; context._cmp(context.ax, 134); if (!context.flags.z()) goto notfadedown; context.push(context.es); @@ -1838,23 +1838,23 @@ notfadedown: context.push(context.bx); context.push(context.ax); fadescreendowns(context); - context.data.byte(387) = 7; - context.data.byte(388) = 1; + context.ds.byte(387) = 7; + context.ds.byte(388) = 1; context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); notfadeend: context._cmp(context.ax, 340); if (!context.flags.z()) goto notendseq; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; notendseq: showgamereel(context); - context.al = context.data.byte(149); - context.data.byte(context.bx+2) = context.al; - context.ax = context.data.word(context.bx+3); + context.al = context.ds.byte(149); + context.ds.byte(context.bx+2) = context.al; + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 145); if (!context.flags.z()) goto notendcreds; - context.data.word(context.bx+3) = 146; + context.ds.word(context.bx+3) = 146; rollendcredits(context); notendcreds: return; @@ -1864,26 +1864,26 @@ static void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); - context.data.byte(386) = 7; - context.data.byte(387) = 0; - context.data.byte(388) = -1; + context.ds.byte(386) = 7; + context.ds.byte(387) = 0; + context.ds.byte(388) = -1; context.cl = 160; context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiget(context); - context.es = context.data.word(466); + context.es = context.ds.word(466); context.si = 3*2; - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context.si = context.ax; context._add(context.si, 66*2); context.cx = 254; endcredits1: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(77); + context.cx = context.ds.word(77); endcredits2: context.push(context.cx); context.push(context.si); @@ -1895,7 +1895,7 @@ endcredits2: context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiput(context); vsync(context); @@ -1914,7 +1914,7 @@ onelot: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.ds.word(77)); context.cx = context.pop(); if (--context.cx) goto onelot; vsync(context); @@ -1932,7 +1932,7 @@ onelot: if (--context.cx) goto endcredits2; context.cx = context.pop(); looknext: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext; @@ -1949,13 +1949,13 @@ gotnext: } static void priest(Context & context) { - context._cmp(context.data.word(context.bx+3), 8); + context._cmp(context.ds.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.ds.byte(234) = 0; + context.ds.word(21) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); context.push(context.es); context.push(context.bx); priesttext(context); @@ -1968,22 +1968,22 @@ priestspoken: } static void madmanstelly(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 307); if (!context.flags.z()) goto notendtelly; context.ax = 300; notendtelly: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; showgamereel(context); return; } static void madman(Context & context) { - context.data.word(21) = 2; + context.ds.word(21) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 364); if (!context.flags.c()) goto ryansded; context._cmp(context.ax, 10); @@ -1996,46 +1996,46 @@ static void madman(Context & context) { context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(64) = -1; - context.data.byte(69) = 0; + context.ds.byte(64) = -1; + context.ds.byte(69) = 0; notfirstmad: context._add(context.ax, 1); context._cmp(context.ax, 294); if (context.flags.z()) goto madmanspoken; context._cmp(context.ax, 66); if (!context.flags.z()) goto nomadspeak; - context._add(context.data.byte(64), 1); + context._add(context.ds.byte(64), 1); context.push(context.es); context.push(context.bx); madmantext(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 53; - context._cmp(context.data.byte(64), 62); + context._cmp(context.ds.byte(64), 62); if (context.flags.c()) goto nomadspeak; - context._cmp(context.data.byte(64), 68); + context._cmp(context.ds.byte(64), 68); if (context.flags.z()) goto killryan; - context._cmp(context.data.byte(65), 8); + context._cmp(context.ds.byte(65), 8); if (!context.flags.z()) goto nomadspeak; - context.data.byte(64) = 70; - context.data.byte(65) = -1; - context.data.byte(53) = 1; + context.ds.byte(64) = 70; + context.ds.byte(65) = -1; + context.ds.byte(53) = 1; context.ax = 67; goto nomadspeak; killryan: context.ax = 310; nomadspeak: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; nomadspeed: showgamereel(context); - context.al = context.data.byte(148); - context.data.byte(context.bx+1) = context.al; + context.al = context.ds.byte(148); + context.ds.byte(context.bx+1) = context.al; madmode(context); return; madmanspoken: - context._cmp(context.data.byte(391), 1); + context._cmp(context.ds.byte(391), 1); if (context.flags.z()) goto alreadywon; - context.data.byte(391) = 1; + context.ds.byte(391) = 1; context.push(context.es); context.push(context.bx); getridoftemptext(context); @@ -2044,18 +2044,18 @@ madmanspoken: alreadywon: return; ryansded: - context.data.byte(56) = 2; + context.ds.byte(56) = 2; showgamereel(context); return; } static void madmantext(Context & context) { - context._cmp(context.data.byte(64), 61); + context._cmp(context.ds.byte(64), 61); if (!context.flags.c()) goto nomadtext; - context.al = context.data.byte(64); + context.al = context.ds.byte(64); context._and(context.al, 3); if (!context.flags.z()) goto nomadtext; - context.al = context.data.byte(64); + context.al = context.ds.byte(64); context._shr(context.al, 1); context._shr(context.al, 1); context._add(context.al, 47); @@ -2070,26 +2070,26 @@ nomadtext: } static void madmode(Context & context) { - context.data.word(21) = 2; - context.data.byte(234) = 0; - context._cmp(context.data.byte(64), 63); + context.ds.word(21) = 2; + context.ds.byte(234) = 0; + context._cmp(context.ds.byte(64), 63); if (context.flags.c()) goto iswatchmad; - context._cmp(context.data.byte(64), 68); + context._cmp(context.ds.byte(64), 68); if (!context.flags.c()) goto iswatchmad; - context.data.byte(234) = 2; + context.ds.byte(234) = 2; iswatchmad: return; } static void priesttext(Context & context) { - context._cmp(context.data.word(context.bx+3), 2); + context._cmp(context.ds.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; - context._cmp(context.data.word(context.bx+3), 7); + context._cmp(context.ds.word(context.bx+3), 7); if (!context.flags.c()) goto nopriesttext; - context.al = context.data.byte(context.bx+3); + context.al = context.ds.byte(context.bx+3); context._and(context.al, 1); if (!context.flags.z()) goto nopriesttext; - context.al = context.data.byte(context.bx+3); + context.al = context.ds.byte(context.bx+3); context._shr(context.al, 1); context._add(context.al, 50); context.bl = 72; @@ -2102,7 +2102,7 @@ nopriesttext: } static void textforend(Context & context) { - context._cmp(context.data.byte(139), 20); + context._cmp(context.ds.byte(139), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; context.bl = 34; @@ -2110,7 +2110,7 @@ static void textforend(Context & context) { context.cx = 60; goto gotendtext; notendtext1: - context._cmp(context.data.byte(139), 65); + context._cmp(context.ds.byte(139), 65); if (!context.flags.z()) goto notendtext2; context.al = 1; context.bl = 34; @@ -2118,7 +2118,7 @@ notendtext1: context.cx = 60; goto gotendtext; notendtext2: - context._cmp(context.data.byte(139), 110); + context._cmp(context.ds.byte(139), 110); if (!context.flags.z()) goto notendtext3; context.al = 2; context.bl = 34; @@ -2135,7 +2135,7 @@ gotendtext: } static void textformonk(Context & context) { - context._cmp(context.data.byte(139), 1); + context._cmp(context.ds.byte(139), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; context.bl = 68; @@ -2143,7 +2143,7 @@ static void textformonk(Context & context) { context.cx = 120; goto gotmonktext; notmonktext1: - context._cmp(context.data.byte(139), 5); + context._cmp(context.ds.byte(139), 5); if (!context.flags.z()) goto notmonktext2; context.al = 20; context.bl = 68; @@ -2151,7 +2151,7 @@ notmonktext1: context.cx = 120; goto gotmonktext; notmonktext2: - context._cmp(context.data.byte(139), 9); + context._cmp(context.ds.byte(139), 9); if (!context.flags.z()) goto notmonktext3; context.al = 21; context.bl = 48; @@ -2159,7 +2159,7 @@ notmonktext2: context.cx = 120; goto gotmonktext; notmonktext3: - context._cmp(context.data.byte(139), 13); + context._cmp(context.ds.byte(139), 13); if (!context.flags.z()) goto notmonktext4; context.al = 22; context.bl = 68; @@ -2167,7 +2167,7 @@ notmonktext3: context.cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.data.byte(139), 17); + context._cmp(context.ds.byte(139), 17); if (!context.flags.z()) goto notmonktext5; context.al = 23; context.bl = 68; @@ -2175,7 +2175,7 @@ notmonktext4: context.cx = 120; goto gotmonktext; notmonktext5: - context._cmp(context.data.byte(139), 21); + context._cmp(context.ds.byte(139), 21); if (!context.flags.z()) goto notmonktext6; context.al = 24; context.bl = 68; @@ -2183,7 +2183,7 @@ notmonktext5: context.cx = 120; goto gotmonktext; notmonktext6: - context._cmp(context.data.byte(139), 25); + context._cmp(context.ds.byte(139), 25); if (!context.flags.z()) goto notmonktext7; context.al = 25; context.bl = 68; @@ -2191,7 +2191,7 @@ notmonktext6: context.cx = 120; goto gotmonktext; notmonktext7: - context._cmp(context.data.byte(139), 29); + context._cmp(context.ds.byte(139), 29); if (!context.flags.z()) goto notmonktext8; context.al = 26; context.bl = 68; @@ -2199,7 +2199,7 @@ notmonktext7: context.cx = 120; goto gotmonktext; notmonktext8: - context._cmp(context.data.byte(139), 33); + context._cmp(context.ds.byte(139), 33); if (!context.flags.z()) goto notmonktext9; context.al = 27; context.bl = 68; @@ -2207,7 +2207,7 @@ notmonktext8: context.cx = 120; goto gotmonktext; notmonktext9: - context._cmp(context.data.byte(139), 37); + context._cmp(context.ds.byte(139), 37); if (!context.flags.z()) goto notmonktext10; context.al = 28; context.bl = 68; @@ -2215,7 +2215,7 @@ notmonktext9: context.cx = 120; goto gotmonktext; notmonktext10: - context._cmp(context.data.byte(139), 41); + context._cmp(context.ds.byte(139), 41); if (!context.flags.z()) goto notmonktext11; context.al = 29; context.bl = 68; @@ -2223,7 +2223,7 @@ notmonktext10: context.cx = 120; goto gotmonktext; notmonktext11: - context._cmp(context.data.byte(139), 45); + context._cmp(context.ds.byte(139), 45); if (!context.flags.z()) goto notmonktext12; context.al = 30; context.bl = 68; @@ -2231,7 +2231,7 @@ notmonktext11: context.cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.data.byte(139), 49); + context._cmp(context.ds.byte(139), 49); if (!context.flags.z()) goto notmonktext13; context.al = 31; context.bl = 68; @@ -2239,7 +2239,7 @@ notmonktext12: context.cx = 220; goto gotmonktext; notmonktext13: - context._cmp(context.data.byte(139), 53); + context._cmp(context.ds.byte(139), 53); if (!context.flags.z()) goto notendtitles; fadescreendowns(context); notendtitles: @@ -2253,11 +2253,11 @@ oktalk: } static void drunk(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.ds.byte(42), 0); if (!context.flags.z()) goto trampgone; - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); - context.data.byte(context.bx+7) = context.al; + context.ds.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); trampgone: @@ -2268,7 +2268,7 @@ static void advisor(Context & context) { checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 123); if (!context.flags.z()) goto notendadvis; @@ -2285,7 +2285,7 @@ notendadvis: if (context.flags.c()) goto gotadvframe; context.ax = 106; gotadvframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; noadvisor: showgamereel(context); addtopeoplelist(context); @@ -2295,7 +2295,7 @@ noadvisor: static void copper(Context & context) { checkspeed(context); if (!context.flags.z()) goto nocopper; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 94); if (!context.flags.z()) goto notendcopper; @@ -2315,7 +2315,7 @@ mightwait: if (context.flags.c()) goto gotcopframe; context._sub(context.ax, 1); gotcopframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; nocopper: showgamereel(context); addtopeoplelist(context); @@ -2323,41 +2323,41 @@ nocopper: } static void sparky(Context & context) { - context._cmp(context.data.word(16), 0); + context._cmp(context.ds.word(16), 0); if (context.flags.z()) goto animsparky; - context.data.byte(context.bx+7) = 3; + context.ds.byte(context.bx+7) = 3; goto animsparky; animsparky: checkspeed(context); if (!context.flags.z()) goto finishsparky; - context._cmp(context.data.word(context.bx+3), 34); + context._cmp(context.ds.word(context.bx+3), 34); if (!context.flags.z()) goto notsparky1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto dosparky; - context.data.word(context.bx+3) = 27; + context.ds.word(context.bx+3) = 27; goto finishsparky; notsparky1: - context._cmp(context.data.word(context.bx+3), 48); + context._cmp(context.ds.word(context.bx+3), 48); if (!context.flags.z()) goto dosparky; - context.data.word(context.bx+3) = 27; + context.ds.word(context.bx+3) = 27; goto finishsparky; dosparky: - context._add(context.data.word(context.bx+3), 1); + context._add(context.ds.word(context.bx+3), 1); finishsparky: showgamereel(context); addtopeoplelist(context); - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedsparky; - context.data.byte(49) = 1; + context.ds.byte(49) = 1; nottalkedsparky: return; } static void train(Context & context) { return; - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 21); if (!context.flags.c()) goto notrainyet; context._add(context.ax, 1); @@ -2366,13 +2366,13 @@ notrainyet: randomnumber(context); context._cmp(context.al, 253); if (context.flags.c()) goto notrainatall; - context._cmp(context.data.byte(475), 5); + context._cmp(context.ds.byte(475), 5); if (!context.flags.z()) goto notrainatall; - context._cmp(context.data.byte(477), 5); + context._cmp(context.ds.byte(477), 5); if (!context.flags.z()) goto notrainatall; context.ax = 5; gottrainframe: - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; showgamereel(context); notrainatall: return; @@ -2382,45 +2382,45 @@ static void addtopeoplelist(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.bx); - context.cl = context.data.byte(context.bx+7); - context.ax = context.data.word(context.bx+3); - context.bx = context.data.word(18); - context.es = context.data.word(412); - context.data.word(context.bx) = context.ax; + context.cl = context.ds.byte(context.bx+7); + context.ax = context.ds.word(context.bx+3); + context.bx = context.ds.word(18); + context.es = context.ds.word(412); + context.ds.word(context.bx) = context.ax; context.ax = context.pop(); - context.data.word(context.bx+2) = context.ax; - context.data.byte(context.bx+4) = context.cl; + context.ds.word(context.bx+2) = context.ax; + context.ds.byte(context.bx+4) = context.cl; context.bx = context.pop(); context.es = context.pop(); - context._add(context.data.word(18), 5); + context._add(context.ds.word(18), 5); return; } static void showgamereel(Context & context) { - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; - context.data.word(239) = context.ax; + context.ds.word(239) = context.ax; context.push(context.es); context.push(context.bx); plotreel(context); context.bx = context.pop(); context.es = context.pop(); - context.ax = context.data.word(239); - context.data.word(context.bx+3) = context.ax; + context.ax = context.ds.word(239); + context.ds.word(context.bx+3) = context.ax; noshow: return; } static void checkspeed(Context & context) { - context._cmp(context.data.byte(65), -1); + context._cmp(context.ds.byte(65), -1); if (!context.flags.z()) goto forcenext; - context._add(context.data.byte(context.bx+6), 1); - context.al = context.data.byte(context.bx+6); - context._cmp(context.al, context.data.byte(context.bx+5)); + context._add(context.ds.byte(context.bx+6), 1); + context.al = context.ds.byte(context.bx+6); + context._cmp(context.al, context.ds.byte(context.bx+5)); if (!context.flags.z()) goto notspeed; context.al = 0; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); notspeed: return; @@ -2430,7 +2430,7 @@ forcenext: } static void clearsprites(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = 255; context.cx = 32*16; @@ -2439,21 +2439,21 @@ static void clearsprites(Context & context) { } static void makesprite(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: - context._cmp(context.data.byte(context.bx+15), 255); + context._cmp(context.ds.byte(context.bx+15), 255); if (context.flags.z()) goto _tmp17a; context._add(context.bx, 32); goto _tmp17; _tmp17a: - context.data.word(context.bx) = context.cx; - context.data.word(context.bx+10) = context.si; - context.data.word(context.bx+6) = context.dx; - context.data.word(context.bx+8) = context.di; - context.data.word(context.bx+2) = 0x0ffff; - context.data.byte(context.bx+15) = 0; - context.data.byte(context.bx+18) = 0; + context.ds.word(context.bx) = context.cx; + context.ds.word(context.bx+10) = context.si; + context.ds.word(context.bx+6) = context.dx; + context.ds.word(context.bx+8) = context.di; + context.ds.word(context.bx+2) = 0x0ffff; + context.ds.byte(context.bx+15) = 0; + context.ds.byte(context.bx+18) = 0; return; } @@ -2466,30 +2466,30 @@ static void delsprite(Context & context) { } static void spriteupdate(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.al = context.data.byte(63); - context.data.byte(context.bx+31) = context.al; - context.es = context.data.word(412); + context.al = context.ds.byte(63); + context.ds.byte(context.bx+31) = context.al; + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; _tmp18: context.push(context.cx); context.push(context.bx); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto _tmp18a; context.push(context.es); context.push(context.ds); - context.cx = context.data.word(context.bx+2); - context.data.word(context.bx+24) = context.cx; + context.cx = context.ds.word(context.bx+2); + context.ds.word(context.bx+24) = context.cx; __dispatch_call(context, context.ax); context.ds = context.pop(); context.es = context.pop(); _tmp18a: context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(186), 1); + context._cmp(context.ds.byte(186), 1); if (context.flags.z()) goto _tmp18b; context._add(context.bx, 32); if (--context.cx) goto _tmp18; @@ -2498,23 +2498,23 @@ _tmp18b: } static void printsprites(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.cx = 0; priorityloop: context.push(context.cx); - context.data.byte(182) = context.cl; + context.ds.byte(182) = context.cl; context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; prtspriteloop: context.push(context.cx); context.push(context.bx); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto skipsprite; - context.al = context.data.byte(182); - context._cmp(context.al, context.data.byte(context.bx+23)); + context.al = context.ds.byte(182); + context._cmp(context.al, context.ds.byte(context.bx+23)); if (!context.flags.z()) goto skipsprite; - context._cmp(context.data.byte(context.bx+31), 1); + context._cmp(context.ds.byte(context.bx+31), 1); if (context.flags.z()) goto skipsprite; printasprite(context); skipsprite: @@ -2533,30 +2533,30 @@ static void printasprite(Context & context) { context.push(context.es); context.push(context.bx); context.si = context.bx; - context.ds = context.data.word(context.si+6); - context.al = context.data.byte(context.si+11); + context.ds = context.ds.word(context.si+6); + context.al = context.ds.byte(context.si+11); context.ah = 0; context._cmp(context.al, 220); if (context.flags.c()) goto notnegative1; context.ah = 255; notnegative1: context.bx = context.ax; - context._add(context.bx, context.data.word(119)); - context.al = context.data.byte(context.si+10); + context._add(context.bx, context.ds.word(119)); + context.al = context.ds.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); if (context.flags.c()) goto notnegative2; context.ah = 255; notnegative2: context.di = context.ax; - context._add(context.di, context.data.word(117)); - context.al = context.data.byte(context.si+15); + context._add(context.di, context.ds.word(117)); + context.al = context.ds.byte(context.si+15); context.ah = 0; - context._cmp(context.data.byte(context.si+30), 0); + context._cmp(context.ds.byte(context.si+30), 0); if (context.flags.z()) goto steadyframe; context.ah = 8; steadyframe: - context._cmp(context.data.byte(182), 6); + context._cmp(context.ds.byte(182), 6); if (!context.flags.z()) goto notquickp; notquickp: showframe(context); @@ -2591,7 +2591,7 @@ static void checkone(Context & context) { context.cx = 3; context._mul(context.cx); context.si = context.ax; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context._add(context.si, 0+(228*13)+32+60+(32*32)); context._lodsw(); context.cx = context.ax; @@ -2601,90 +2601,90 @@ static void checkone(Context & context) { } static void findsource(Context & context) { - context.ax = context.data.word(160); + context.ax = context.ds.word(160); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; - context.ds = context.data.word(430); - context.data.word(244) = 0; + context.ds = context.ds.word(430); + context.ds.word(244) = 0; return; over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; - context.ds = context.data.word(432); - context.data.word(244) = 160; + context.ds = context.ds.word(432); + context.ds.word(244) = 160; return; over1001: - context.ds = context.data.word(434); - context.data.word(244) = 320; + context.ds = context.ds.word(434); + context.ds.word(244) = 320; return; } static void initman(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); + context.al = context.ds.byte(151); + context.ah = context.ds.byte(152); context.si = context.ax; context.cx = 49464; - context.dx = context.data.word(414); + context.dx = context.ds.word(414); context.di = 0; makesprite(context); - context.data.byte(context.bx+23) = 4; - context.data.byte(context.bx+22) = 0; - context.data.byte(context.bx+29) = 0; + context.ds.byte(context.bx+23) = 4; + context.ds.byte(context.bx+22) = 0; + context.ds.byte(context.bx+29) = 0; return; } static void mainman(Context & context) { - context._cmp(context.data.byte(187), 1); + context._cmp(context.ds.byte(187), 1); if (!context.flags.z()) goto notinnewroom; - context.data.byte(187) = 0; - context.al = context.data.byte(151); - context.ah = context.data.byte(152); - context.data.word(context.bx+10) = context.ax; - context.data.byte(context.bx+29) = 0; + context.ds.byte(187) = 0; + context.al = context.ds.byte(151); + context.ah = context.ds.byte(152); + context.ds.word(context.bx+10) = context.ax; + context.ds.byte(context.bx+29) = 0; goto executewalk; notinnewroom: - context._sub(context.data.byte(context.bx+22), 1); - context._cmp(context.data.byte(context.bx+22), -1); + context._sub(context.ds.byte(context.bx+22), 1); + context._cmp(context.ds.byte(context.bx+22), -1); if (context.flags.z()) goto executewalk; return; executewalk: - context.data.byte(context.bx+22) = 0; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.ds.byte(context.bx+22) = 0; + context.al = context.ds.byte(135); + context._cmp(context.al, context.ds.byte(133)); if (context.flags.z()) goto facingok; aboutturn(context); goto notwalk; facingok: - context._cmp(context.data.byte(136), 0); + context._cmp(context.ds.byte(136), 0); if (context.flags.z()) goto alreadyturned; - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto alreadyturned; - context.data.byte(473) = 1; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(134)); + context.ds.byte(473) = 1; + context.al = context.ds.byte(133); + context._cmp(context.al, context.ds.byte(134)); if (!context.flags.z()) goto alreadyturned; checkforexit(context); alreadyturned: - context.data.byte(136) = 0; - context._cmp(context.data.byte(492), 254); + context.ds.byte(136) = 0; + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto walkman; - context.data.byte(context.bx+29) = 0; + context.ds.byte(context.bx+29) = 0; goto notwalk; walkman: - context.al = context.data.byte(context.bx+29); + context.al = context.ds.byte(context.bx+29); context._add(context.al, 1); context._cmp(context.al, 11); if (!context.flags.z()) goto notanimend1; context.al = 1; notanimend1: - context.data.byte(context.bx+29) = context.al; + context.ds.byte(context.bx+29) = context.al; walking(context); - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (context.flags.z()) goto afterwalk; - context.al = context.data.byte(133); + context.al = context.ds.byte(133); context._and(context.al, 1); if (context.flags.z()) goto isdouble; - context.al = context.data.byte(context.bx+29); + context.al = context.ds.byte(context.bx+29); context._cmp(context.al, 2); if (context.flags.z()) goto afterwalk; context._cmp(context.al, 7); @@ -2692,37 +2692,37 @@ notanimend1: isdouble: walking(context); afterwalk: - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto notwalk; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.al = context.ds.byte(135); + context._cmp(context.al, context.ds.byte(133)); if (!context.flags.z()) goto notwalk; - context.data.byte(473) = 1; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(134)); + context.ds.byte(473) = 1; + context.al = context.ds.byte(133); + context._cmp(context.al, context.ds.byte(134)); if (!context.flags.z()) goto notwalk; checkforexit(context); notwalk: - context.al = context.data.byte(133); + context.al = context.ds.byte(133); context.ah = 0; context.di = 1105; context._add(context.di, context.ax); - context.al = context.data.byte(context.di); - context._add(context.al, context.data.byte(context.bx+29)); - context.data.byte(context.bx+15) = context.al; - context.ax = context.data.word(context.bx+10); - context.data.byte(151) = context.al; - context.data.byte(152) = context.ah; + context.al = context.ds.byte(context.di); + context._add(context.al, context.ds.byte(context.bx+29)); + context.ds.byte(context.bx+15) = context.al; + context.ax = context.ds.word(context.bx+10); + context.ds.byte(151) = context.al; + context.ds.byte(152) = context.ah; return; } static void aboutturn(Context & context) { - context._cmp(context.data.byte(136), 1); + context._cmp(context.ds.byte(136), 1); if (context.flags.z()) goto incdir; - context._cmp(context.data.byte(136), -1); + context._cmp(context.ds.byte(136), -1); if (context.flags.z()) goto decdir; - context.al = context.data.byte(133); - context._sub(context.al, context.data.byte(135)); + context.al = context.ds.byte(133); + context._sub(context.al, context.ds.byte(135)); if (!context.flags.c()) goto higher; context._neg(context.al); context._cmp(context.al, 4); @@ -2733,37 +2733,37 @@ higher: if (!context.flags.c()) goto incdir; goto decdir; incdir: - context.data.byte(136) = 1; - context.al = context.data.byte(133); + context.ds.byte(136) = 1; + context.al = context.ds.byte(133); context._add(context.al, 1); context._and(context.al, 7); - context.data.byte(133) = context.al; - context.data.byte(context.bx+29) = 0; + context.ds.byte(133) = context.al; + context.ds.byte(context.bx+29) = 0; return; decdir: - context.data.byte(136) = -1; - context.al = context.data.byte(133); + context.ds.byte(136) = -1; + context.al = context.ds.byte(133); context._sub(context.al, 1); context._and(context.al, 7); - context.data.byte(133) = context.al; - context.data.byte(context.bx+29) = 0; + context.ds.byte(133) = context.al; + context.ds.byte(context.bx+29) = 0; return; } static void walking(Context & context) { - context._cmp(context.data.byte(493), 0); + context._cmp(context.ds.byte(493), 0); if (context.flags.z()) goto normalwalk; - context.al = context.data.byte(492); + context.al = context.ds.byte(492); context._sub(context.al, 1); - context.data.byte(492) = context.al; + context.ds.byte(492) = context.al; context._cmp(context.al, 200); if (!context.flags.c()) goto endofline; goto continuewalk; normalwalk: - context.al = context.data.byte(492); + context.al = context.ds.byte(492); context._add(context.al, 1); - context.data.byte(492) = context.al; - context._cmp(context.al, context.data.byte(494)); + context.ds.byte(492) = context.al; + context._cmp(context.al, context.ds.byte(494)); if (!context.flags.c()) goto endofline; continuewalk: context.ah = 0; @@ -2774,20 +2774,20 @@ continuewalk: context.es = context.dx; context.bx = 8344; context._add(context.bx, context.ax); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context.bx = context.pop(); context.es = context.pop(); stillline: - context.data.word(context.bx+10) = context.ax; + context.ds.word(context.bx+10) = context.ax; return; endofline: - context.data.byte(492) = 254; - context.al = context.data.byte(478); - context.data.byte(475) = context.al; - context._cmp(context.al, context.data.byte(477)); + context.ds.byte(492) = 254; + context.al = context.ds.byte(478); + context.ds.byte(475) = context.al; + context._cmp(context.al, context.ds.byte(477)); if (context.flags.z()) goto finishedwalk; - context.al = context.data.byte(477); - context.data.byte(478) = context.al; + context.al = context.ds.byte(477); + context.ds.byte(478) = context.al; context.push(context.es); context.push(context.bx); autosetwalk(context); @@ -2803,42 +2803,42 @@ static void facerightway(Context & context) { context.push(context.es); context.push(context.bx); getroomspaths(context); - context.al = context.data.byte(475); + context.al = context.ds.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx+7); - context.data.byte(135) = context.al; - context.data.byte(134) = context.al; + context.al = context.ds.byte(context.bx+7); + context.ds.byte(135) = context.al; + context.ds.byte(134) = context.al; context.bx = context.pop(); context.es = context.pop(); return; } static void checkforexit(Context & context) { - context.cl = context.data.byte(151); + context.cl = context.ds.byte(151); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.ds.byte(152); context._add(context.ch, 12); checkone(context); - context.data.byte(153) = context.cl; - context.data.byte(154) = context.ch; - context.data.byte(155) = context.dl; - context.data.byte(156) = context.dh; - context.al = context.data.byte(153); + context.ds.byte(153) = context.cl; + context.ds.byte(154) = context.ch; + context.ds.byte(155) = context.dl; + context.ds.byte(156) = context.dh; + context.al = context.ds.byte(153); context._test(context.al, 64); if (context.flags.z()) goto notnewdirect; - context.al = context.data.byte(154); - context.data.byte(189) = context.al; + context.al = context.ds.byte(154); + context.ds.byte(189) = context.al; return; notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; context.push(context.es); context.push(context.bx); - context._cmp(context.data.byte(184), 2); + context._cmp(context.ds.byte(184), 2); if (!context.flags.z()) goto notlouis; context.bl = 0; context.push(context.bx); @@ -2873,17 +2873,17 @@ notravmessage: context.bl = 68; context.bh = 64; setuptimeduse(context); - context.al = context.data.byte(133); + context.al = context.ds.byte(133); context._add(context.al, 4); context._and(context.al, 7); - context.data.byte(135) = context.al; + context.ds.byte(135) = context.al; context.bx = context.pop(); context.es = context.pop(); return; notlouis: context.bx = context.pop(); context.es = context.pop(); - context.data.byte(60) = 1; + context.ds.byte(60) = 1; return; notleave: context._test(context.al, 4); @@ -2912,12 +2912,12 @@ notanup: static void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(149), 10); - context.al = context.data.byte(154); + context._add(context.ds.byte(149), 10); + context.al = context.ds.byte(154); context.cl = 16; context._mul(context.cl); - context.data.byte(context.bx+11) = context.al; - context.data.byte(186) = 1; + context.ds.byte(context.bx+11) = context.al; + context.ds.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2926,12 +2926,12 @@ static void adjustdown(Context & context) { static void adjustup(Context & context) { context.push(context.es); context.push(context.bx); - context._sub(context.data.byte(149), 10); - context.al = context.data.byte(154); + context._sub(context.ds.byte(149), 10); + context.al = context.ds.byte(154); context.cl = 16; context._mul(context.cl); - context.data.byte(context.bx+11) = context.al; - context.data.byte(186) = 1; + context.ds.byte(context.bx+11) = context.al; + context.ds.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2940,13 +2940,13 @@ static void adjustup(Context & context) { static void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); - context.data.byte(153) = 0; - context._sub(context.data.byte(148), 11); - context.al = context.data.byte(154); + context.ds.byte(153) = 0; + context._sub(context.ds.byte(148), 11); + context.al = context.ds.byte(154); context.cl = 16; context._mul(context.cl); - context.data.byte(context.bx+10) = context.al; - context.data.byte(186) = 1; + context.ds.byte(context.bx+10) = context.al; + context.ds.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2955,24 +2955,24 @@ static void adjustleft(Context & context) { static void adjustright(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(148), 11); - context.al = context.data.byte(154); + context._add(context.ds.byte(148), 11); + context.al = context.ds.byte(154); context.cl = 16; context._mul(context.cl); context._sub(context.al, 2); - context.data.byte(context.bx+10) = context.al; - context.data.byte(186) = 1; + context.ds.byte(context.bx+10) = context.al; + context.ds.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; } static void reminders(Context & context) { - context._cmp(context.data.byte(184), 24); + context._cmp(context.ds.byte(184), 24); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(148), 44); + context._cmp(context.ds.byte(148), 44); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(2), 0); + context._cmp(context.ds.byte(2), 0); if (!context.flags.z()) goto notfirst; context.al = 'D'; context.ah = 'K'; @@ -2987,7 +2987,7 @@ static void reminders(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto forgotone; - context.ax = context.data.word(context.bx+2); + context.ax = context.ds.word(context.bx+2); context._cmp(context.al, 4); if (!context.flags.z()) goto forgotone; context._cmp(context.ah, 255); @@ -3000,7 +3000,7 @@ static void reminders(Context & context) { compare(context); if (!context.flags.z()) goto forgotone; havegotcard: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); notfirst: return; forgotone: @@ -3016,23 +3016,23 @@ notinedenslift: } static void initrain(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.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); context.bx = 1113; checkmorerain: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto finishinitrain; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+1); - context._cmp(context.al, context.data.byte(148)); + context.al = context.ds.byte(context.bx+1); + context._cmp(context.al, context.ds.byte(148)); if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+2); - context._cmp(context.al, context.data.byte(149)); + context.al = context.ds.byte(context.bx+2); + context._cmp(context.al, context.ds.byte(149)); if (!context.flags.z()) goto checkrain; - context.al = context.data.byte(context.bx+3); - context.data.byte(132) = context.al; + context.al = context.ds.byte(context.bx+3); + context.ds.byte(132) = context.al; goto dorain; checkrain: context._add(context.bx, 4); @@ -3043,26 +3043,26 @@ initraintop: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); + context._cmp(context.al, context.ds.byte(132)); if (!context.flags.c()) goto initraintop; context._add(context.cl, context.al); - context._cmp(context.cl, context.data.byte(128)); + context._cmp(context.cl, context.ds.byte(128)); if (!context.flags.c()) goto initrainside; context.push(context.cx); splitintolines(context); context.cx = context.pop(); goto initraintop; initrainside: - context.cl = context.data.byte(128); + context.cl = context.ds.byte(128); context._sub(context.cl, 1); initrainside2: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); + context._cmp(context.al, context.ds.byte(132)); if (!context.flags.c()) goto initrainside2; context._add(context.ch, context.al); - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.ds.byte(129)); if (!context.flags.c()) goto finishinitrain; context.push(context.cx); splitintolines(context); @@ -3083,11 +3083,11 @@ lookforlinestart: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.ds.byte(129)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; foundlinestart: - context.data.word(context.di) = context.cx; + context.ds.word(context.di) = context.cx; context.bh = 1; lookforlineend: getblockofpixel(context); @@ -3097,26 +3097,26 @@ lookforlineend: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto foundlineend; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.ds.byte(129)); if (!context.flags.c()) goto foundlineend; context._add(context.bh, 1); goto lookforlineend; foundlineend: context.push(context.cx); - context.data.byte(context.di+2) = context.bh; + context.ds.byte(context.di+2) = context.bh; randomnumber(context); - context.data.byte(context.di+3) = context.al; + context.ds.byte(context.di+3) = context.al; randomnumber(context); - context.data.byte(context.di+4) = context.al; + context.ds.byte(context.di+4) = context.al; randomnumber(context); context._and(context.al, 3); context._add(context.al, 4); - context.data.byte(context.di+5) = context.al; + context.ds.byte(context.di+5) = context.al; context._add(context.di, 6); context.cx = context.pop(); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.ds.byte(129)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: @@ -3127,9 +3127,9 @@ static void getblockofpixel(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.di); - context.ax = context.data.word(125); + context.ax = context.ds.word(125); context._add(context.cl, context.al); - context.ax = context.data.word(127); + context.ax = context.ds.word(127); context._add(context.ch, context.al); checkone(context); context._and(context.cl, 1); @@ -3147,43 +3147,43 @@ failrain: } static void showrain(Context & context) { - context.ds = context.data.word(414); + context.ds = context.ds.word(414); context.si = 6*58; - context.ax = context.data.word(context.si+2); + context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); context.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); - context.es = context.data.word(412); - context._cmp(context.data.byte(context.bx), 255); + context.es = context.ds.word(412); + context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto nothunder; morerain: - context.es = context.data.word(412); - context._cmp(context.data.byte(context.bx), 255); + context.es = context.ds.word(412); + context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto finishrain; - context.al = context.data.byte(context.bx+1); + context.al = context.ds.byte(context.bx+1); context.ah = 0; - context._add(context.ax, context.data.word(119)); - context._add(context.ax, context.data.word(127)); + context._add(context.ax, context.ds.word(119)); + context._add(context.ax, context.ds.word(127)); context.cx = 320; context._mul(context.cx); - context.cl = context.data.byte(context.bx); + context.cl = context.ds.byte(context.bx); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(117)); - context._add(context.ax, context.data.word(125)); + context._add(context.ax, context.ds.word(117)); + context._add(context.ax, context.ds.word(125)); context.di = context.ax; - context.cl = context.data.byte(context.bx+2); + context.cl = context.ds.byte(context.bx+2); context.ch = 0; - context.ax = context.data.word(context.bx+3); - context.dl = context.data.byte(context.bx+5); + context.ax = context.ds.word(context.bx+3); + context.dl = context.ds.byte(context.bx+5); context.dh = 0; context._sub(context.ax, context.dx); context._and(context.ax, 511); - context.data.word(context.bx+3) = context.ax; + context.ds.word(context.bx+3) = context.ax; context._add(context.bx, 6); context.push(context.si); context._add(context.si, context.ax); - context.es = context.data.word(400); + context.es = context.ds.word(400); context.ah = 0; context.dx = 320-2; rainloop: @@ -3201,20 +3201,20 @@ noplot: context.si = context.pop(); goto morerain; finishrain: - context._cmp(context.data.word(521), 0); + context._cmp(context.ds.word(521), 0); if (!context.flags.z()) goto nothunder; - context._cmp(context.data.byte(184), 2); + context._cmp(context.ds.byte(184), 2); if (!context.flags.z()) goto notlouisthund; - context._cmp(context.data.byte(45), 1); + context._cmp(context.ds.byte(45), 1); if (!context.flags.z()) goto nothunder; notlouisthund: - context._cmp(context.data.byte(184), 55); + context._cmp(context.ds.byte(184), 55); if (context.flags.z()) goto nothunder; randomnum1(context); context._cmp(context.al, 1); if (!context.flags.c()) goto nothunder; context.al = 7; - context._cmp(context.data.byte(507), 6); + context._cmp(context.ds.byte(507), 6); if (context.flags.z()) goto isthunder1; context.al = 4; isthunder1: @@ -3224,18 +3224,18 @@ nothunder: } static void backobject(Context & context) { - context.ds = context.data.word(428); - context.di = context.data.word(context.bx+20); - context.al = context.data.byte(context.bx+18); + context.ds = context.ds.word(428); + context.di = context.ds.word(context.bx+20); + context.al = context.ds.byte(context.bx+18); context._cmp(context.al, 0); if (context.flags.z()) goto _tmp48z; context._sub(context.al, 1); - context.data.byte(context.bx+18) = context.al; + context.ds.byte(context.bx+18) = context.al; goto finishback; _tmp48z: - context.al = context.data.byte(context.di+7); - context.data.byte(context.bx+18) = context.al; - context.al = context.data.byte(context.di+8); + context.al = context.ds.byte(context.di+7); + context.ds.byte(context.bx+18) = context.al; + context.al = context.ds.byte(context.di+8); context._cmp(context.al, 6); if (!context.flags.z()) goto notwidedoor; widedoor(context); @@ -3272,14 +3272,14 @@ finishback: } static void liftsprite(Context & context) { - context.al = context.data.byte(35); + context.al = context.ds.byte(35); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; context._cmp(context.al, 1); if (context.flags.z()) goto liftopen; context._cmp(context.al, 3); if (context.flags.z()) goto openlift; - context.al = context.data.byte(context.bx+19); + context.al = context.ds.byte(context.bx+19); context._cmp(context.al, 0); if (context.flags.z()) goto finishclose; context._sub(context.al, 1); @@ -3291,10 +3291,10 @@ static void liftsprite(Context & context) { context.ax = context.pop(); goto pokelift; finishclose: - context.data.byte(35) = 0; + context.ds.byte(35) = 0; return; openlift: - context.al = context.data.byte(context.bx+19); + context.al = context.ds.byte(context.bx+19); context._cmp(context.al, 12); if (context.flags.z()) goto endoflist; context._add(context.al, 1); @@ -3305,56 +3305,56 @@ openlift: liftnoise(context); context.ax = context.pop(); pokelift: - context.data.byte(context.bx+19) = context.al; + context.ds.byte(context.bx+19) = context.al; context.ah = 0; context.push(context.di); context._add(context.di, context.ax); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; return; endoflist: - context.data.byte(35) = 1; + context.ds.byte(35) = 1; return; liftopen: - context.al = context.data.byte(36); + context.al = context.ds.byte(36); context.push(context.es); context.push(context.bx); turnpathon(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(40), 0); + context._cmp(context.ds.byte(40), 0); if (context.flags.z()) goto nocountclose; - context._sub(context.data.byte(40), 1); - context._cmp(context.data.byte(40), 0); + context._sub(context.ds.byte(40), 1); + context._cmp(context.ds.byte(40), 0); if (!context.flags.z()) goto nocountclose; - context.data.byte(35) = 2; + context.ds.byte(35) = 2; nocountclose: context.al = 12; goto pokelift; liftclosed: - context.al = context.data.byte(36); + context.al = context.ds.byte(36); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(39), 0); + context._cmp(context.ds.byte(39), 0); if (context.flags.z()) goto nocountopen; - context._sub(context.data.byte(39), 1); - context._cmp(context.data.byte(39), 0); + context._sub(context.ds.byte(39), 1); + context._cmp(context.ds.byte(39), 0); if (!context.flags.z()) goto nocountopen; - context.data.byte(35) = 3; + context.ds.byte(35) = 3; nocountopen: context.al = 0; goto pokelift; } static void liftnoise(Context & context) { - context._cmp(context.data.byte(184), 5); + context._cmp(context.ds.byte(184), 5); if (context.flags.z()) goto hissnoise; - context._cmp(context.data.byte(184), 21); + context._cmp(context.ds.byte(184), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); return; @@ -3370,84 +3370,84 @@ static void random(Context & context) { context._and(context.ax, 7); context._add(context.di, 18); context._add(context.di, context.ax); - context.al = context.data.byte(context.di); + context.al = context.ds.byte(context.di); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; + context.ds.byte(context.bx+15) = context.al; return; } static void steady(Context & context) { - context.al = context.data.byte(context.di+18); - context.data.byte(context.di+17) = context.al; - context.data.byte(context.bx+15) = context.al; + context.al = context.ds.byte(context.di+18); + context.ds.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; return; } static void constant(Context & context) { - context._add(context.data.byte(context.bx+19), 1); - context.cl = context.data.byte(context.bx+19); + context._add(context.ds.byte(context.bx+19), 1); + context.cl = context.ds.byte(context.bx+19); context.ch = 0; context._add(context.di, context.cx); - context._cmp(context.data.byte(context.di+18), 255); + context._cmp(context.ds.byte(context.di+18), 255); if (!context.flags.z()) goto gotconst; context._sub(context.di, context.cx); context.cx = 0; - context.data.byte(context.bx+19) = context.cl; + context.ds.byte(context.bx+19) = context.cl; gotconst: - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context._sub(context.di, context.cx); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; return; } static void doorway(Context & context) { - context.data.byte(193) = -24; - context.data.byte(194) = 10; - context.data.byte(195) = -30; - context.data.byte(196) = 10; + context.ds.byte(193) = -24; + context.ds.byte(194) = 10; + context.ds.byte(195) = -30; + context.ds.byte(196) = 10; dodoor(context); return; } static void widedoor(Context & context) { - context.data.byte(193) = -24; - context.data.byte(194) = 24; - context.data.byte(195) = -30; - context.data.byte(196) = 24; + context.ds.byte(193) = -24; + context.ds.byte(194) = 24; + context.ds.byte(195) = -30; + context.ds.byte(196) = 24; dodoor(context); return; } static void dodoor(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); - context.cl = context.data.byte(context.bx+10); - context.ch = context.data.byte(context.bx+11); + context.al = context.ds.byte(151); + context.ah = context.ds.byte(152); + context.cl = context.ds.byte(context.bx+10); + context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor; context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(193)); + context._cmp(context.al, context.ds.byte(193)); if (!context.flags.c()) goto upordown; goto shutdoor; rtofdoor: context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(194)); + context._cmp(context.al, context.ds.byte(194)); if (!context.flags.c()) goto shutdoor; upordown: context._cmp(context.ah, context.ch); if (!context.flags.c()) goto botofdoor; context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(195)); + context._cmp(context.ah, context.ds.byte(195)); if (context.flags.c()) goto shutdoor; goto opendoor; botofdoor: context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(196)); + context._cmp(context.ah, context.ds.byte(196)); if (!context.flags.c()) goto shutdoor; opendoor: - context.cl = context.data.byte(context.bx+19); - context._cmp(context.data.byte(61), 1); + context.cl = context.ds.byte(context.bx+19); + context._cmp(context.ds.byte(61), 1); if (!context.flags.z()) goto notthrough; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough; @@ -3457,7 +3457,7 @@ notthrough: context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound2; context.al = 0; - context._cmp(context.data.byte(184), 5); + context._cmp(context.ds.byte(184), 5); if (!context.flags.z()) goto nothoteldoor2; context.al = 13; nothoteldoor2: @@ -3466,25 +3466,25 @@ notdoorsound2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); if (!context.flags.z()) goto atlast1; context._sub(context.di, 1); context._sub(context.cl, 1); atlast1: - context.data.byte(context.bx+19) = context.cl; - context.al = context.data.byte(context.di+18); + context.ds.byte(context.bx+19) = context.cl; + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; - context.data.byte(61) = 1; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; + context.ds.byte(61) = 1; return; shutdoor: - context.cl = context.data.byte(context.bx+19); + context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(184), 5); + context._cmp(context.ds.byte(184), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3493,27 +3493,27 @@ notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; context._sub(context.cl, 1); - context.data.byte(context.bx+19) = context.cl; + context.ds.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(61) = 0; + context.ds.byte(61) = 0; notnearly: return; } static void lockeddoorway(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); - context.cl = context.data.byte(context.bx+10); - context.ch = context.data.byte(context.bx+11); + context.al = context.ds.byte(151); + context.ah = context.ds.byte(152); + context.cl = context.ds.byte(context.bx+10); + context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor2; context._sub(context.al, context.cl); @@ -3536,12 +3536,12 @@ botofdoor2: context._cmp(context.ah, 12); if (!context.flags.c()) goto shutdoor2; opendoor2: - context._cmp(context.data.byte(61), 1); + context._cmp(context.ds.byte(61), 1); if (context.flags.z()) goto mustbeopen; - context._cmp(context.data.byte(37), 1); + context._cmp(context.ds.byte(37), 1); if (context.flags.z()) goto shutdoor; mustbeopen: - context.cl = context.data.byte(context.bx+19); + context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound4; context.al = 0; @@ -3549,15 +3549,15 @@ mustbeopen: notdoorsound4: context._cmp(context.cl, 6); if (!context.flags.z()) goto noturnonyet; - context.al = context.data.byte(38); + context.al = context.ds.byte(38); context.push(context.es); context.push(context.bx); turnpathon(context); context.bx = context.pop(); context.es = context.pop(); noturnonyet: - context.cl = context.data.byte(context.bx+19); - context._cmp(context.data.byte(61), 1); + context.cl = context.ds.byte(context.bx+19); + context._cmp(context.ds.byte(61), 1); if (!context.flags.z()) goto notthrough2; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough2; @@ -3567,24 +3567,24 @@ notthrough2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); if (!context.flags.z()) goto atlast3; context._sub(context.di, 1); context._sub(context.cl, 1); atlast3: - context.data.byte(context.bx+19) = context.cl; - context.al = context.data.byte(context.di+18); + context.ds.byte(context.bx+19) = context.cl; + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto justshutting; - context.data.byte(61) = 1; + context.ds.byte(61) = 1; justshutting: return; shutdoor2: - context.cl = context.data.byte(context.bx+19); + context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound3; context.al = 1; @@ -3593,34 +3593,34 @@ notdoorsound3: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast4; context._sub(context.cl, 1); - context.data.byte(context.bx+19) = context.cl; + context.ds.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; - context.data.byte(61) = 0; + context.ds.byte(61) = 0; context.push(context.di); context._add(context.di, context.cx); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) goto notlocky; - context.al = context.data.byte(38); + context.al = context.ds.byte(38); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(37) = 1; + context.ds.byte(37) = 1; notlocky: return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: - context.cl = context.data.byte(context.bx+19); + context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(184), 5); + context._cmp(context.ds.byte(184), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3629,47 +3629,47 @@ notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; context._sub(context.cl, 1); - context.data.byte(context.bx+19) = context.cl; + context.ds.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); - context.al = context.data.byte(context.di+18); + context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.data.byte(context.bx+15) = context.al; - context.data.byte(context.di+17) = context.al; + context.ds.byte(context.bx+15) = context.al; + context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(61) = 0; + context.ds.byte(61) = 0; notnearly: return; return; } static void updatepeople(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.data.word(18) = context.di; + context.ds.word(18) = context.di; context.cx = 12*5; context.al = 255; while(--context.cx) context._stosb(); - context._add(context.data.word(138), 1); + context._add(context.ds.word(138), 1); context.es = context.cs; context.bx = 537; context.di = 1003; updateloop: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endupdate; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto notinthisroom; - context.cx = context.data.word(context.bx+1); - context._cmp(context.cl, context.data.byte(148)); + context.cx = context.ds.word(context.bx+1); + context._cmp(context.cl, context.ds.byte(148)); if (!context.flags.z()) goto notinthisroom; - context._cmp(context.ch, context.data.byte(149)); + context._cmp(context.ch, context.ds.byte(149)); if (!context.flags.z()) goto notinthisroom; context.push(context.di); - context.ax = context.data.word(context.di); + context.ax = context.ds.word(context.di); __dispatch_call(context, context.ax); context.di = context.pop(); notinthisroom: @@ -3682,12 +3682,12 @@ endupdate: static void getreelframeax(Context & context) { context.push(context.ds); - context.data.word(160) = context.ax; + context.ds.word(160) = context.ax; findsource(context); context.es = context.ds; context.ds = context.pop(); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.ds.word(160); + context._sub(context.ax, context.ds.word(244)); context._add(context.ax, context.ax); context.cx = context.ax; context._add(context.ax, context.ax); @@ -3710,13 +3710,13 @@ static void plotreel(Context & context) { retryreel: context.push(context.es); context.push(context.si); - context.ax = context.data.word(context.si+2); + context.ax = context.ds.word(context.si+2); context._cmp(context.al, 220); if (context.flags.c()) goto normalreel; context._cmp(context.al, 255); if (context.flags.z()) goto normalreel; dealwithspecial(context); - context._add(context.data.word(239), 1); + context._add(context.ds.word(239), 1); context.si = context.pop(); context.es = context.pop(); context._add(context.si, 40); @@ -3727,7 +3727,7 @@ plotloop: context.push(context.cx); context.push(context.es); context.push(context.si); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto notplot; showreelframe(context); @@ -3744,22 +3744,22 @@ notplot: } static void soundonreels(Context & context) { - context.bl = context.data.byte(184); + context.bl = context.ds.byte(184); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); context._add(context.bx, 1254); - context.si = context.data.word(context.bx); + context.si = context.ds.word(context.bx); reelsoundloop: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._cmp(context.al, 255); if (context.flags.z()) goto endreelsound; - context.ax = context.data.word(context.si+1); - context._cmp(context.ax, context.data.word(239)); + context.ax = context.ds.word(context.si+1); + context._cmp(context.ax, context.ds.word(239)); if (!context.flags.z()) goto skipreelsound; - context._cmp(context.ax, context.data.word(351)); + context._cmp(context.ax, context.ds.word(351)); if (context.flags.z()) goto skipreelsound; - context.data.word(351) = context.ax; - context.al = context.data.byte(context.si); + context.ds.word(351) = context.ax; + context.al = context.ds.byte(context.si); context._cmp(context.al, 64); if (context.flags.c()) { playchannel1(context); return; }; context._cmp(context.al, 128); @@ -3775,26 +3775,26 @@ skipreelsound: context._add(context.si, 3); goto reelsoundloop; endreelsound: - context.ax = context.data.word(351); - context._cmp(context.ax, context.data.word(239)); + context.ax = context.ds.word(351); + context._cmp(context.ax, context.ds.word(239)); if (context.flags.z()) goto nochange2; - context.data.word(351) = -1; + context.ds.word(351) = -1; nochange2: return; } static void reconstruct(Context & context) { - context._cmp(context.data.byte(130), 0); + context._cmp(context.ds.byte(130), 0); if (context.flags.z()) goto noneedtorecon; - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); spriteupdate(context); printsprites(context); - context._cmp(context.data.byte(184), 20); + context._cmp(context.ds.byte(184), 20); if (!context.flags.z()) goto notfudge; undertextline(context); notfudge: - context.data.byte(130) = 0; + context.ds.byte(130) = 0; noneedtorecon: return; } @@ -3805,28 +3805,28 @@ static void dealwithspecial(Context & context) { if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); - context.data.byte(130) = 1; + context.ds.byte(130) = 1; return; notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); - context.data.byte(130) = 1; + context.ds.byte(130) = 1; return; notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); - context.data.byte(130) = 1; + context.ds.byte(130) = 1; return; notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); - context.data.byte(130) = 1; + context.ds.byte(130) = 1; return; notremfree: context._cmp(context.al, 4); @@ -3836,14 +3836,14 @@ notremfree: notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; - context.data.byte(135) = context.ah; - context.data.byte(133) = context.ah; + context.ds.byte(135) = context.ah; + context.ds.byte(133) = context.ah; switchryanon(context); return; notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; - context.data.byte(188) = context.ah; + context.ds.byte(188) = context.ah; return; notchangeloc: movemap(context); @@ -3853,87 +3853,87 @@ notchangeloc: static void movemap(Context & context) { context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; - context._sub(context.data.byte(149), 20); - context.data.byte(186) = 1; + context._sub(context.ds.byte(149), 20); + context.ds.byte(186) = 1; return; notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; - context._sub(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._sub(context.ds.byte(149), 10); + context.ds.byte(186) = 1; return; notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.ds.byte(149), 10); + context.ds.byte(186) = 1; return; notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; - context._add(context.data.byte(148), 11); - context.data.byte(186) = 1; + context._add(context.ds.byte(148), 11); + context.ds.byte(186) = 1; return; notmaprightspec: - context._sub(context.data.byte(148), 11); - context.data.byte(186) = 1; + context._sub(context.ds.byte(148), 11); + context.ds.byte(186) = 1; return; } static void getreelstart(Context & context) { - context.ax = context.data.word(239); + context.ax = context.ds.word(239); context.cx = 40; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.si = context.ax; context._add(context.si, 0+(36*144)); return; } static void showreelframe(Context & context) { - context.al = context.data.byte(context.si+2); + context.al = context.ds.byte(context.si+2); context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); - context.al = context.data.byte(context.si+3); + context._add(context.di, context.ds.word(117)); + context.al = context.ds.byte(context.si+3); context.bx = context.ax; - context._add(context.bx, context.data.word(119)); - context.ax = context.data.word(context.si); - context.data.word(160) = context.ax; + context._add(context.bx, context.ds.word(119)); + context.ax = context.ds.word(context.si); + context.ds.word(160) = context.ax; findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.ds.word(160); + context._sub(context.ax, context.ds.word(244)); context.ah = 8; showframe(context); return; } static void deleverything(Context & context) { - context.al = context.data.byte(129); + context.al = context.ds.byte(129); context.ah = 0; - context._add(context.ax, context.data.word(123)); + context._add(context.ax, context.ds.word(123)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); return; bigroom: - context._sub(context.data.byte(129), 8); + context._sub(context.ds.byte(129), 8); maptopanel(context); - context._add(context.data.byte(129), 8); + context._add(context.ds.byte(129), 8); return; } static void dumpeverything(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.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); dumpevery1: - context.ax = context.data.word(context.bx); - context.cx = context.data.word(context.bx+2); + context.ax = context.ds.word(context.bx); + context.cx = context.ds.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto finishevery1; - context._cmp(context.ax, context.data.word(context.bx+(40*5))); + context._cmp(context.ax, context.ds.word(context.bx+(40*5))); if (!context.flags.z()) goto notskip1; - context._cmp(context.cx, context.data.word(context.bx+(40*5)+2)); + context._cmp(context.cx, context.ds.word(context.bx+(40*5)+2)); if (context.flags.z()) goto skip1; notskip1: context.push(context.bx); @@ -3943,8 +3943,8 @@ notskip1: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.ds.word(117)); + context._add(context.bx, context.ds.word(119)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3955,8 +3955,8 @@ skip1: finishevery1: context.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)+(40*5); dumpevery2: - context.ax = context.data.word(context.bx); - context.cx = context.data.word(context.bx+2); + context.ax = context.ds.word(context.bx); + context.cx = context.ds.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto finishevery2; context.push(context.bx); @@ -3966,8 +3966,8 @@ dumpevery2: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.ds.word(117)); + context._add(context.bx, context.ds.word(119)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3981,7 +3981,7 @@ finishevery2: static void allocatework(Context & context) { context.bx = 0x1000; allocatemem(context); - context.data.word(400) = context.ax; + context.ds.word(400) = context.ax; return; } @@ -4009,20 +4009,20 @@ static void loadpalfromiff(Context & context) { context.dx = 2494; openfile(context); context.cx = 2000; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.dx = 0; readfromfile(context); closefile(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0x30; context.cx = 768; palloop: context._lodsb(); context._shr(context.al, 1); context._shr(context.al, 1); - context._cmp(context.data.byte(73), 1); + context._cmp(context.ds.byte(73), 1); if (!context.flags.z()) goto nought; context._cmp(context.al, 0); if (context.flags.z()) goto nought; @@ -4053,7 +4053,7 @@ static void cls(Context & context) { static void printundermon(Context & context) { context.si = (320*43)+76; context.di = context.si; - context.es = context.data.word(400); + context.es = context.ds.word(400); context._add(context.si, 8*320); context.dx = 0x0a000; context.ds = context.dx; @@ -4089,7 +4089,7 @@ static void worktoscreen(Context & context) { context.si = 0; context.di = 0; context.cx = 25; - context.ds = context.data.word(400); + context.ds = context.ds.word(400); context.dx = 0x0a000; context.es = context.dx; dumpallloop: @@ -4106,54 +4106,54 @@ dumpallloop: } static void paneltomap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); + context.di = context.ds.word(125); + context._add(context.di, context.ds.word(117)); + context.bx = context.ds.word(127); + context._add(context.bx, context.ds.word(119)); + context.ds = context.ds.word(402); context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.cl = context.ds.byte(128); + context.ch = context.ds.byte(129); multiget(context); return; } static void maptopanel(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); + context.di = context.ds.word(125); + context._add(context.di, context.ds.word(117)); + context.bx = context.ds.word(127); + context._add(context.bx, context.ds.word(119)); + context.ds = context.ds.word(402); context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.cl = context.ds.byte(128); + context.ch = context.ds.byte(129); multiput(context); return; } static void dumpmap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.di = context.ds.word(125); + context._add(context.di, context.ds.word(117)); + context.bx = context.ds.word(127); + context._add(context.bx, context.ds.word(119)); + context.cl = context.ds.byte(128); + context.ch = context.ds.byte(129); multidump(context); return; } static void pixelcheckset(Context & context) { context.push(context.ax); - context._sub(context.al, context.data.byte(context.bx)); - context._sub(context.ah, context.data.byte(context.bx+1)); + context._sub(context.al, context.ds.byte(context.bx)); + context._sub(context.ah, context.ds.byte(context.bx+1)); context.push(context.es); context.push(context.bx); context.push(context.cx); context.push(context.ax); - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); getsetad(context); - context.al = context.data.byte(context.bx+17); - context.es = context.data.word(444); + context.al = context.ds.byte(context.bx+17); + context.es = context.ds.word(444); context.bx = 0; context.ah = 0; context.cx = 6; @@ -4163,16 +4163,16 @@ static void pixelcheckset(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context.cl = context.data.byte(context.bx); + context.cl = context.ds.byte(context.bx); context.ch = 0; context._mul(context.cx); context.cx = context.pop(); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(context.bx+2)); + context._add(context.ax, context.ds.word(context.bx+2)); context.bx = context.ax; context._add(context.bx, 0+2080); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.dl = context.al; context.cx = context.pop(); context.bx = context.pop(); @@ -4185,25 +4185,25 @@ static void pixelcheckset(Context & context) { static void createpanel(Context & context) { context.di = 0; context.bx = 8; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 8; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 0; context.bx = 104; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 104; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 0; context.ah = 2; showframe(context); @@ -4214,13 +4214,13 @@ static void createpanel2(Context & context) { createpanel(context); context.di = 0; context.bx = 0; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 5; context.ah = 2; showframe(context); context.di = 160; context.bx = 0; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.al = 5; context.ah = 2; showframe(context); @@ -4229,7 +4229,7 @@ static void createpanel2(Context & context) { static void clearwork(Context & context) { context.ax = 0x0; - context.es = context.data.word(400); + context.es = context.ds.word(400); context.di = 0; context.cx = (200*320)/64; clearloop: @@ -4270,24 +4270,24 @@ clearloop: } static void zoom(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto inwatching; - context._cmp(context.data.byte(8), 1); + context._cmp(context.ds.byte(8), 1); if (context.flags.z()) goto zoomswitch; inwatching: return; zoomswitch: - context._cmp(context.data.byte(100), 199); + context._cmp(context.ds.byte(100), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); return; zoomit: - context.ax = context.data.word(222); + context.ax = context.ds.word(222); context._sub(context.ax, 9); context.cx = 320; context._mul(context.cx); - context._add(context.ax, context.data.word(220)); + context._add(context.ax, context.ds.word(220)); context._sub(context.ax, 11); context.si = context.ax; context.ax = 132+4; @@ -4295,8 +4295,8 @@ zoomit: context._mul(context.cx); context._add(context.ax, 8+5); context.di = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(400); + context.es = context.ds.word(400); + context.ds = context.ds.word(400); context.cx = 20; zoomloop: context.push(context.cx); @@ -4305,14 +4305,14 @@ zoomloop2: context._lodsb(); context.ah = context.al; context._stosw(); - context.data.word(context.di+320-2) = context.ax; + context.ds.word(context.di+320-2) = context.ax; if (--context.cx) goto zoomloop2; context._add(context.si, 320-23); context._add(context.di, 320-46+320); context.cx = context.pop(); if (--context.cx) goto zoomloop; crosshair(context); - context.data.byte(75) = 1; + context.ds.byte(75) = 1; return; } @@ -4321,12 +4321,12 @@ static void delthisone(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context._add(context.ax, context.data.word(119)); + context._add(context.ax, context.ds.word(119)); context.bx = 320; context._mul(context.bx); context.bx = context.pop(); context.bh = 0; - context._add(context.bx, context.data.word(117)); + context._add(context.bx, context.ds.word(117)); context._add(context.ax, context.bx); context.di = context.ax; context.ax = context.pop(); @@ -4339,8 +4339,8 @@ static void delthisone(Context & context) { context.bh = 0; context._add(context.ax, context.bx); context.si = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(402); + context.es = context.ds.word(400); + context.ds = context.ds.word(402); context.dl = context.cl; context.dh = 0; context.ax = 320; @@ -4364,7 +4364,7 @@ static void multiget(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(400); + context.es = context.ds.word(400); context.es = context.ds; context.ds = context.es; context._xchg(context.di, context.si); @@ -4408,7 +4408,7 @@ static void multiput(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(400); + context.es = context.ds.word(400); context.al = context.cl; context.ah = 0; context.dx = 320; @@ -4447,7 +4447,7 @@ multiloop6: static void multidump(Context & context) { context.dx = 0x0a000; context.es = context.dx; - context.ds = context.data.word(400); + context.ds = context.ds.word(400); context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4729,17 +4729,17 @@ static void width160(Context & context) { } static void doblocks(Context & context) { - context.es = context.data.word(400); - context.ax = context.data.word(119); + context.es = context.ds.word(400); + context.ax = context.ds.word(119); context.cx = 320; context._mul(context.cx); - context.di = context.data.word(117); + context.di = context.ds.word(117); context._add(context.di, context.ax); - context.al = context.data.byte(149); + context.al = context.ds.byte(149); context.ah = 0; context.bx = 66; context._mul(context.bx); - context.bl = context.data.byte(148); + context.bl = context.ds.byte(148); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -4752,9 +4752,9 @@ loop120: loop124: context.push(context.cx); context.push(context.di); - context.ds = context.data.word(418); + context.ds = context.ds.word(418); context._lodsb(); - context.ds = context.data.word(416); + context.ds = context.ds.word(416); context.push(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto zeroblock; @@ -4852,22 +4852,22 @@ static void showframe(Context & context) { context.si = context.cx; context._add(context.cx, context.cx); context._add(context.si, context.cx); - context._cmp(context.data.word(context.si), 0); + context._cmp(context.ds.word(context.si), 0); if (!context.flags.z()) goto notblankshow; context.cx = 0; return; notblankshow: context._test(context.ah, 128); if (!context.flags.z()) goto skipoffsets; - context.al = context.data.byte(context.si+4); + context.al = context.ds.byte(context.si+4); context.ah = 0; context._add(context.di, context.ax); - context.al = context.data.byte(context.si+5); + context.al = context.ds.byte(context.si+5); context.ah = 0; context._add(context.bx, context.ax); skipoffsets: - context.cx = context.data.word(context.si+0); - context.ax = context.data.word(context.si+2); + context.cx = context.ds.word(context.si+0); + context.ax = context.ds.word(context.si+2); context._add(context.ax, 2080); context.si = context.ax; context.ax = context.pop(); @@ -4898,9 +4898,9 @@ notdiffdest: if (context.flags.z()) goto notprintlist; context.push(context.ax); context.ax = context.di; - context._sub(context.ax, context.data.word(117)); + context._sub(context.ax, context.ds.word(117)); context.push(context.bx); - context._sub(context.bx, context.data.word(119)); + context._sub(context.bx, context.ds.word(119)); context.ah = context.bl; context.bx = context.pop(); context.ax = context.pop(); @@ -4908,7 +4908,7 @@ notprintlist: context._test(context.ah, 4); if (context.flags.z()) goto notflippedx; context.dx = 320; - context.es = context.data.word(400); + context.es = context.ds.word(400); context.push(context.cx); frameoutfx(context); context.cx = context.pop(); @@ -4917,7 +4917,7 @@ notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; context.dx = 320; - context.es = context.data.word(400); + context.es = context.ds.word(400); context.push(context.cx); frameoutnm(context); context.cx = context.pop(); @@ -4926,14 +4926,14 @@ notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; context.dx = 320; - context.es = context.data.word(400); + context.es = context.ds.word(400); context.push(context.cx); frameoutbh(context); context.cx = context.pop(); return; noeffects: context.dx = 320; - context.es = context.data.word(400); + context.es = context.ds.word(400); context.push(context.cx); frameoutv(context); context.cx = context.pop(); @@ -5038,7 +5038,7 @@ bhloop2: context.ch = 0; context.ah = 255; bhloop1: - context._cmp(context.data.byte(context.di), context.ah); + context._cmp(context.ds.byte(context.di), context.ah); if (!context.flags.z()) goto nofill; context._movsb(); if (--context.cx) goto bhloop1; @@ -5086,7 +5086,7 @@ frameloopfx3: context._cmp(context.al, 0); if (context.flags.z()) goto backtootherfx; backtosolidfx: - context.data.byte(context.di) = context.al; + context.ds.byte(context.di) = context.al; context._sub(context.di, 1); if (--context.cx) goto frameloopfx3; context.cx = context.pop(); @@ -5097,9 +5097,9 @@ backtosolidfx: } static void transferinv(Context & context) { - context.di = context.data.word(12); + context.di = context.ds.word(12); context.push(context.di); - context.al = context.data.byte(10); + context.al = context.ds.byte(10); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5107,12 +5107,12 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(90); + context.al = context.ds.byte(90); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5120,94 +5120,94 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(446); + context.ds = context.ds.word(446); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.ah = 0; - context.cl = context.data.byte(context.bx+1); + context.cl = context.ds.byte(context.bx+1); context.ch = 0; - context._add(context.si, context.data.word(context.bx+2)); - context.dx = context.data.word(context.bx+4); + context._add(context.si, context.ds.word(context.bx+2)); + context.dx = context.ds.word(context.bx+4); context.bx = context.pop(); - context.data.byte(context.bx+0) = context.al; - context.data.byte(context.bx+1) = context.cl; - context.data.word(context.bx+4) = context.dx; + context.ds.byte(context.bx+0) = context.al; + context.ds.byte(context.bx+1) = context.cl; + context.ds.word(context.bx+4) = context.dx; context._mul(context.cx); context.cx = context.ax; context.push(context.cx); while(--context.cx) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); - context.data.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context.ds.word(context.bx+2) = context.ax; + context._add(context.ds.word(12), context.cx); return; } static void transfermap(Context & context) { - context.di = context.data.word(12); + context.di = context.ds.word(12); context.push(context.di); - context.al = context.data.byte(10); + context.al = context.ds.byte(10); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(90); + context.al = context.ds.byte(90); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(446); + context.ds = context.ds.word(446); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.ah = 0; - context.cl = context.data.byte(context.bx+1); + context.cl = context.ds.byte(context.bx+1); context.ch = 0; - context._add(context.si, context.data.word(context.bx+2)); - context.dx = context.data.word(context.bx+4); + context._add(context.si, context.ds.word(context.bx+2)); + context.dx = context.ds.word(context.bx+4); context.bx = context.pop(); - context.data.byte(context.bx+0) = context.al; - context.data.byte(context.bx+1) = context.cl; - context.data.word(context.bx+4) = context.dx; + context.ds.byte(context.bx+0) = context.al; + context.ds.byte(context.bx+1) = context.cl; + context.ds.word(context.bx+4) = context.dx; context._mul(context.cx); context.cx = context.ax; context.push(context.cx); while(--context.cx) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); - context.data.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context.ds.word(context.bx+2) = context.ax; + context._add(context.ds.word(12), context.cx); return; } static void dofade(Context & context) { - context._cmp(context.data.byte(344), 0); + context._cmp(context.ds.byte(344), 0); if (context.flags.z()) goto finishfade; - context.cl = context.data.byte(345); + context.cl = context.ds.byte(345); context.ch = 0; - context.al = context.data.byte(343); + context.al = context.ds.byte(343); context.ah = 0; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); showgroup(context); - context.al = context.data.byte(345); - context._add(context.al, context.data.byte(343)); - context.data.byte(343) = context.al; + context.al = context.ds.byte(345); + context._add(context.al, context.ds.byte(343)); + context.ds.byte(343) = context.al; context._cmp(context.al, 0); if (!context.flags.z()) goto finishfade; fadecalculation(context); @@ -5216,7 +5216,7 @@ finishfade: } static void clearendpal(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 0; @@ -5225,7 +5225,7 @@ static void clearendpal(Context & context) { } static void clearpalette(Context & context) { - context.data.byte(344) = 0; + context.ds.byte(344) = 0; clearstartpal(context); dumpcurrent(context); return; @@ -5234,15 +5234,15 @@ static void clearpalette(Context & context) { static void fadescreenup(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; return; } static void fadetowhite(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 63; @@ -5253,15 +5253,15 @@ static void fadetowhite(Context & context) { context._stosb(); context._stosb(); paltostartpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; return; } static void fadefromwhite(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768; context.al = 63; @@ -5272,20 +5272,20 @@ static void fadefromwhite(Context & context) { context._stosb(); context._stosb(); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; return; } static void fadescreenups(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 64; return; } @@ -5293,16 +5293,16 @@ static void fadescreendownhalf(Context & context) { paltostartpal(context); paltoendpal(context); context.cx = 768; - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; halfend: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._shr(context.al, 1); - context.data.byte(context.bx) = context.al; + context.ds.byte(context.bx) = context.al; context._add(context.bx, 1); if (--context.cx) goto halfend; - context.ds = context.data.word(412); - context.es = context.data.word(412); + context.ds = context.ds.word(412); + context.es = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); context.cx = 3*5; @@ -5311,45 +5311,45 @@ halfend: context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); context.cx = 3*2; while(--context.cx) context._movsb(); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; + context.ds.byte(344) = 1; + context.ds.byte(346) = 31; + context.ds.byte(343) = 0; + context.ds.byte(345) = 32; return; } static void fadescreenuphalf(Context & context) { endpaltostart(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; + context.ds.byte(344) = 1; + context.ds.byte(346) = 31; + context.ds.byte(343) = 0; + context.ds.byte(345) = 32; return; } static void fadescreendown(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; return; } static void fadescreendowns(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 64; return; } static void clearstartpal(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 256; wholeloop1: @@ -5362,39 +5362,39 @@ wholeloop1: } static void showgun(Context & context) { - context.data.byte(348) = 0; - context.data.byte(347) = 0; - context.data.byte(349) = 0; + context.ds.byte(348) = 0; + context.ds.byte(347) = 0; + context.ds.byte(349) = 0; paltostartpal(context); paltoendpal(context); greyscalesum(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 130; hangon(context); endpaltostart(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 200; hangon(context); - context.data.byte(531) = 34; + context.ds.byte(531) = 34; loadroomssample(context); - context.data.byte(386) = 0; + context.ds.byte(386) = 0; context.dx = 2364; loadintotemp(context); createpanel2(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 0; context.ah = 0; context.di = 100; context.bx = 4; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 1; context.ah = 0; context.di = 158; @@ -5425,19 +5425,19 @@ static void rollem(Context & context) { context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiget(context); - context.es = context.data.word(466); + context.es = context.ds.word(466); context.si = 49*2; - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context.si = context.ax; context._add(context.si, 66*2); context.cx = 80; endcredits21: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(77); + context.cx = context.ds.word(77); endcredits22: context.push(context.cx); context.push(context.si); @@ -5449,7 +5449,7 @@ endcredits22: context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiput(context); vsync(context); @@ -5468,7 +5468,7 @@ onelot2: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.ds.word(77)); context.cx = context.pop(); if (--context.cx) goto onelot2; vsync(context); @@ -5482,13 +5482,13 @@ onelot2: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto endearly2; context._sub(context.bx, 1); if (--context.cx) goto endcredits22; context.cx = context.pop(); looknext2: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext2; @@ -5496,7 +5496,7 @@ looknext2: if (context.flags.z()) goto gotnext2; goto looknext2; gotnext2: - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto endearly; if (--context.cx) goto endcredits21; context.cx = 120; @@ -5509,57 +5509,57 @@ endearly: } static void fadecalculation(Context & context) { - context._cmp(context.data.byte(346), 0); + context._cmp(context.ds.byte(346), 0); if (context.flags.z()) goto nomorefading; - context.bl = context.data.byte(346); - context.es = context.data.word(412); + context.bl = context.ds.byte(346); + context.es = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; fadecolloop: - context.al = context.data.byte(context.si); - context.ah = context.data.byte(context.di); + context.al = context.ds.byte(context.si); + context.ah = context.ds.byte(context.di); context._cmp(context.al, context.ah); if (context.flags.z()) goto gotthere; if (context.flags.c()) goto lesscolour; - context._sub(context.data.byte(context.si), 1); + context._sub(context.ds.byte(context.si), 1); goto gotthere; lesscolour: context._cmp(context.bl, context.ah); if (context.flags.z()) goto withit; if (!context.flags.c()) goto gotthere; withit: - context._add(context.data.byte(context.si), 1); + context._add(context.ds.byte(context.si), 1); gotthere: context._add(context.si, 1); context._add(context.di, 1); if (--context.cx) goto fadecolloop; - context._sub(context.data.byte(346), 1); + context._sub(context.ds.byte(346), 1); return; nomorefading: - context.data.byte(344) = 0; + context.ds.byte(344) = 0; return; } static void greyscalesum(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 256; greysumloop1: context.push(context.cx); context.bx = 0; - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context.ah = 0; context.cx = 20; context._mul(context.cx); context._add(context.bx, context.ax); - context.al = context.data.byte(context.si+1); + context.al = context.ds.byte(context.si+1); context.ah = 0; context.cx = 59; context._mul(context.cx); context._add(context.bx, context.ax); - context.al = context.data.byte(context.si+2); + context.al = context.ds.byte(context.si+2); context.ah = 0; context.cx = 11; context._mul(context.cx); @@ -5571,19 +5571,19 @@ greysumloop2: if (!context.flags.c()) goto greysumloop2; context.bl = context.al; context.al = context.bl; - context.ah = context.data.byte(348); + context.ah = context.ds.byte(348); context._cmp(context.al, 0); context._add(context.al, context.ah); noaddr: context._stosb(); - context.ah = context.data.byte(347); + context.ah = context.ds.byte(347); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddg; context._add(context.al, context.ah); noaddg: context._stosb(); - context.ah = context.data.byte(349); + context.ah = context.ds.byte(349); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddb; @@ -5597,8 +5597,8 @@ noaddb: } static void paltostartpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.ds.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5607,8 +5607,8 @@ static void paltostartpal(Context & context) { } static void endpaltostart(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.ds.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5617,8 +5617,8 @@ static void endpaltostart(Context & context) { } static void startpaltoend(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.ds.word(412); + context.ds = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5627,8 +5627,8 @@ static void startpaltoend(Context & context) { } static void paltoendpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.ds.word(412); + context.ds = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5637,8 +5637,8 @@ static void paltoendpal(Context & context) { } static void allpalette(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.ds.word(412); + context.ds = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5649,7 +5649,7 @@ static void allpalette(Context & context) { static void dumpcurrent(Context & context) { context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); vsync(context); context.al = 0; context.cx = 128; @@ -5664,7 +5664,7 @@ static void dumpcurrent(Context & context) { static void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5672,10 +5672,10 @@ static void fadedownmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 64; hangon(context); return; @@ -5684,7 +5684,7 @@ static void fadedownmon(Context & context) { static void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5692,10 +5692,10 @@ static void fadeupmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 128; hangon(context); return; @@ -5704,7 +5704,7 @@ static void fadeupmon(Context & context) { static void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5712,10 +5712,10 @@ static void fadeupmonfirst(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 64; hangon(context); context.al = 26; @@ -5727,7 +5727,7 @@ static void fadeupmonfirst(Context & context) { static void fadeupyellows(Context & context) { paltoendpal(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5735,10 +5735,10 @@ static void fadeupyellows(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.ds.byte(344) = 1; + context.ds.byte(346) = 63; + context.ds.byte(343) = 0; + context.ds.byte(345) = 128; context.cx = 128; hangon(context); return; @@ -5746,7 +5746,7 @@ static void fadeupyellows(Context & context) { static void initialmoncols(Context & context) { paltostartpal(context); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.cx = 3*9; context.ax = 0; @@ -5754,7 +5754,7 @@ static void initialmoncols(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.al = 230; context.cx = 18; @@ -5775,24 +5775,24 @@ static void endgame(Context & context) { monkspeaking(context); gettingshot(context); getridoftemptext(context); - context.data.byte(387) = 7; - context.data.byte(388) = 1; + context.ds.byte(387) = 7; + context.ds.byte(388) = 1; context.cx = 200; hangon(context); return; } static void monkspeaking(Context & context) { - context.data.byte(531) = 35; + context.ds.byte(531) = 35; loadroomssample(context); context.dx = 2377; loadintotemp(context); clearwork(context); showmonk(context); worktoscreen(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.ds.byte(386) = 7; + context.ds.byte(388) = -1; + context.ds.byte(387) = 0; context.al = 12; context.ah = 255; playchannel0(context); @@ -5805,8 +5805,8 @@ nextmonkspeak: context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(466); - context.ax = context.data.word(context.si); + context.es = context.ds.word(466); + context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; nextbit: @@ -5831,8 +5831,8 @@ nextbit: context._add(context.al, 1); context._cmp(context.al, 44); if (!context.flags.z()) goto nextmonkspeak; - context.data.byte(388) = 1; - context.data.byte(387) = 7; + context.ds.byte(388) = 1; + context.ds.byte(387) = 7; fadescreendowns(context); context.cx = 300; hangon(context); @@ -5845,18 +5845,18 @@ static void showmonk(Context & context) { context.ah = 128; context.di = 160; context.bx = 72; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); return; } static void gettingshot(Context & context) { - context.data.byte(188) = 55; + context.ds.byte(188) = 55; clearpalette(context); loadintroroom(context); fadescreenups(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; + context.ds.byte(387) = 0; + context.ds.byte(388) = -1; runendseq(context); clearbeforeload(context); return; @@ -5889,7 +5889,7 @@ hangonloope: context.push(context.cx); vsync(context); context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; return; @@ -5904,28 +5904,28 @@ static void intro(Context & context) { loadtemptext(context); loadpalfromiff(context); setmode(context); - context.data.byte(188) = 50; + context.ds.byte(188) = 50; clearpalette(context); loadintroroom(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.ds.byte(386) = 7; + context.ds.byte(388) = -1; + context.ds.byte(387) = 0; context.al = 12; context.ah = 255; playchannel0(context); fadescreenups(context); runintroseq(context); clearbeforeload(context); - context.data.byte(188) = 52; + context.ds.byte(188) = 52; loadintroroom(context); runintroseq(context); clearbeforeload(context); - context.data.byte(188) = 53; + context.ds.byte(188) = 53; loadintroroom(context); runintroseq(context); clearbeforeload(context); allpalette(context); - context.data.byte(188) = 54; + context.ds.byte(188) = 54; loadintroroom(context); runintroseq(context); getridoftemptext(context); @@ -5934,14 +5934,14 @@ static void intro(Context & context) { } static void runintroseq(Context & context) { - context.data.byte(103) = 0; + context.ds.byte(103) = 0; moreintroseq: vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto earlyendrun; spriteupdate(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto earlyendrun; deleverything(context); printsprites(context); @@ -5949,14 +5949,14 @@ moreintroseq: afterintroroom(context); usetimedtext(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto earlyendrun; dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.ds.byte(392), 1); if (context.flags.z()) goto earlyendrun; - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (!context.flags.z()) goto moreintroseq; return; earlyendrun: @@ -5969,7 +5969,7 @@ earlyendrun: static void runendseq(Context & context) { atmospheres(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; moreendseq: vsync(context); spriteupdate(context); @@ -5983,23 +5983,23 @@ moreendseq: dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (!context.flags.z()) goto moreendseq; return; } static void loadintroroom(Context & context) { - context.data.byte(139) = 0; - context.data.byte(9) = 255; + context.ds.byte(139) = 0; + context.ds.byte(9) = 255; loadroom(context); - context.data.word(121) = 72; - context.data.word(123) = 16; + context.ds.word(121) = 72; + context.ds.word(123) = 16; clearsprites(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; + context.ds.byte(61) = 0; + context.ds.byte(142) = '0'; + context.ds.byte(105) = 0; clearwork(context); - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); @@ -6009,9 +6009,9 @@ static void loadintroroom(Context & context) { } static void realcredits(Context & context) { - context.data.byte(531) = 33; + context.ds.byte(531) = 33; loadroomssample(context); - context.data.byte(386) = 0; + context.ds.byte(386) = 0; mode640x480(context); context.cx = 35; hangon(context); @@ -6106,13 +6106,13 @@ static void printchar(Context & context) { context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.ds.word(71)); showframe(context); context.ax = context.pop(); context.di = context.pop(); context.bx = context.pop(); context.si = context.pop(); - context._cmp(context.data.byte(72), 0); + context._cmp(context.ds.byte(72), 0); if (!context.flags.z()) goto nokern; kernchars(context); nokern: @@ -6148,9 +6148,9 @@ kernit: } static void printslow(Context & context) { - context.data.byte(231) = 1; - context.data.byte(234) = 3; - context.ds = context.data.word(404); + context.ds.byte(231) = 1; + context.ds.byte(234) = 3; + context.ds = context.ds.word(404); printloopslow6: context.push(context.bx); context.push(context.di); @@ -6161,7 +6161,7 @@ printloopslow5: context.push(context.cx); context.push(context.si); context.push(context.es); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context.push(context.bx); context.push(context.cx); context.push(context.es); @@ -6174,7 +6174,7 @@ printloopslow5: context.es = context.pop(); context.cx = context.pop(); context.bx = context.pop(); - context.ax = context.data.word(context.si+1); + context.ax = context.ds.word(context.si+1); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto finishslow; @@ -6189,9 +6189,9 @@ printloopslow5: context.push(context.es); context.push(context.si); modifychar(context); - context.data.word(71) = 91; + context.ds.word(71) = 91; printboth(context); - context.data.word(71) = 0; + context.ds.word(71) = 0; context.si = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -6201,14 +6201,14 @@ printloopslow5: waitframes(context); context._cmp(context.ax, 0); if (context.flags.z()) goto keepgoing; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (!context.flags.z()) goto finishslow2; keepgoing: waitframes(context); noslow: context._cmp(context.ax, 0); if (context.flags.z()) goto afterslow; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (!context.flags.z()) goto finishslow2; afterslow: context.es = context.pop(); @@ -6252,7 +6252,7 @@ static void waitframes(Context & context) { vsync(context); dumppointer(context); delpointer(context); - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context.ds = context.pop(); context.si = context.pop(); context.es = context.pop(); @@ -6279,8 +6279,8 @@ static void printboth(Context & context) { } static void printdirect(Context & context) { - context.data.word(84) = context.di; - context.ds = context.data.word(268); + context.ds.word(84) = context.di; + context.ds = context.ds.word(268); printloop6: context.push(context.bx); context.push(context.di); @@ -6288,7 +6288,7 @@ printloop6: getnumber(context); context.ch = 0; printloop5: - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto finishdirct; @@ -6298,14 +6298,14 @@ printloop5: context.push(context.es); modifychar(context); printchar(context); - context.data.word(84) = context.di; + context.ds.word(84) = context.di; context.es = context.pop(); context.cx = context.pop(); if (--context.cx) goto printloop5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.ds.word(77)); goto printloop6; finishdirct: context.dx = context.pop(); @@ -6315,12 +6315,12 @@ finishdirct: } static void monprint(Context & context) { - context.data.byte(72) = 1; + context.ds.byte(72) = 1; context.si = context.bx; context.dl = 166; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); + context.ds = context.ds.word(406); printloop8: context.push(context.bx); context.push(context.di); @@ -6328,7 +6328,7 @@ printloop8: getnumber(context); context.ch = 0; printloop7: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto finishmon2; @@ -6340,7 +6340,7 @@ printloop7: if (context.flags.z()) goto finishmon; context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger; - context.ah = context.data.byte(context.si); + context.ah = context.ds.byte(context.si); context._add(context.si, 1); context._add(context.si, 1); goto finishmon; @@ -6349,9 +6349,9 @@ nottrigger: context.push(context.es); modifychar(context); printchar(context); - context.data.word(312) = context.di; - context.data.word(314) = context.bx; - context.data.word(138) = 1; + context.ds.word(312) = context.di; + context.ds.word(314) = context.bx; + context.ds.word(138) = 1; printcurs(context); vsync(context); context.push(context.si); @@ -6376,7 +6376,7 @@ finishmon2: context.di = context.pop(); context.bx = context.pop(); scrollmonitor(context); - context.data.word(312) = context.di; + context.ds.word(312) = context.di; goto printloop8; finishmon: context.dx = context.pop(); @@ -6384,12 +6384,12 @@ finishmon: context.bx = context.pop(); context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger2; - context.data.byte(55) = context.ah; + context.ds.byte(55) = context.ah; nottrigger2: - context.data.word(312) = context.di; + context.ds.word(312) = context.di; scrollmonitor(context); context.bx = context.si; - context.data.byte(72) = 0; + context.ds.byte(72) = 0; return; } @@ -6499,7 +6499,7 @@ notcent2: static void getnextword(Context & context) { context.bx = 0; getloop: - context.ax = context.data.word(context.di); + context.ax = context.ds.word(context.di); context._add(context.di, 1); context._add(context.bh, 1); context._cmp(context.al, ':'); @@ -6514,12 +6514,12 @@ getloop: context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.ds.word(71)); context._add(context.ax, context.ax); context.si = context.ax; context._add(context.ax, context.ax); context._add(context.si, context.ax); - context.cl = context.data.byte(context.si+0); + context.cl = context.ds.byte(context.si+0); context.ax = context.pop(); kernchars(context); context._add(context.bl, context.cl); @@ -6592,11 +6592,11 @@ nomod: } static void fillryan(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32; findallryan(context); context.si = 0+(228*13)+32; - context.al = context.data.byte(19); + context.al = context.ds.byte(19); context.ah = 0; context.cx = 20; context._mul(context.cx); @@ -6613,7 +6613,7 @@ ryanloop1: context.push(context.cx); context.push(context.di); context.push(context.bx); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.si, 2); context.push(context.si); context.push(context.es); @@ -6643,7 +6643,7 @@ static void fillopen(Context & context) { lessthanapage: context.al = 1; context.push(context.ax); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13); findallopen(context); context.si = 0+(228*13); @@ -6654,7 +6654,7 @@ openloop1: context.push(context.cx); context.push(context.di); context.push(context.bx); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.si, 2); context.push(context.si); context.push(context.es); @@ -6682,15 +6682,15 @@ static void findallryan(Context & context) { while(--context.cx) context._stosw(); context.di = context.pop(); context.cl = 4; - context.ds = context.data.word(398); + context.ds = context.ds.word(398); context.bx = 0+2080+30000; context.ch = 0; findryanloop: - context._cmp(context.data.byte(context.bx+2), context.cl); + context._cmp(context.ds.byte(context.bx+2), context.cl); if (!context.flags.z()) goto notinryaninv; - context._cmp(context.data.byte(context.bx+3), 255); + context._cmp(context.ds.byte(context.bx+3), 255); if (!context.flags.z()) goto notinryaninv; - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 0; context.push(context.di); context._add(context.di, context.ax); @@ -6713,23 +6713,23 @@ static void findallopen(Context & context) { context.ax = 0x0ffff; while(--context.cx) context._stosw(); context.di = context.pop(); - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); - context.ds = context.data.word(398); + context.cl = context.ds.byte(110); + context.dl = context.ds.byte(111); + context.ds = context.ds.word(398); context.bx = 0+2080+30000; context.ch = 0; findopen1: - context._cmp(context.data.byte(context.bx+3), context.cl); + context._cmp(context.ds.byte(context.bx+3), context.cl); if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(context.bx+2), context.dl); + context._cmp(context.ds.byte(context.bx+2), context.dl); if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(111), 4); + context._cmp(context.ds.byte(111), 4); if (context.flags.z()) goto noloccheck; - context.al = context.data.byte(context.bx+5); - context._cmp(context.al, context.data.byte(184)); + context.al = context.ds.byte(context.bx+5); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto findopen2; noloccheck: - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 0; context.push(context.di); context._add(context.di, context.ax); @@ -6743,19 +6743,19 @@ findopen2: context._add(context.ch, 1); context._cmp(context.ch, 114); if (!context.flags.z()) goto findopen1; - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); + context.cl = context.ds.byte(110); + context.dl = context.ds.byte(111); context.push(context.dx); - context.ds = context.data.word(426); + context.ds = context.ds.word(426); context.dx = context.pop(); context.bx = 0; context.ch = 0; findopen1a: - context._cmp(context.data.byte(context.bx+3), context.cl); + context._cmp(context.ds.byte(context.bx+3), context.cl); if (!context.flags.z()) goto findopen2a; - context._cmp(context.data.byte(context.bx+2), context.dl); + context._cmp(context.ds.byte(context.bx+2), context.dl); if (!context.flags.z()) goto findopen2a; - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 0; context.push(context.di); context._add(context.di, context.ax); @@ -6780,7 +6780,7 @@ static void obtoinv(Context & context) { context.push(context.ax); context.push(context.di); context.push(context.bx); - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context._sub(context.di, 2); context._sub(context.bx, 1); context.al = 10; @@ -6794,10 +6794,10 @@ static void obtoinv(Context & context) { context.push(context.bx); context.push(context.di); context.push(context.ax); - context.ds = context.data.word(398); + context.ds = context.ds.word(398); context._cmp(context.ah, 4); if (context.flags.z()) goto isanextra; - context.ds = context.data.word(446); + context.ds = context.ds.word(446); isanextra: context.cl = context.al; context._add(context.al, context.al); @@ -6815,7 +6815,7 @@ isanextra: isitworn(context); context.bx = context.pop(); if (!context.flags.z()) goto finishfill; - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context._sub(context.di, 3); context._sub(context.bx, 2); context.al = 7; @@ -6830,34 +6830,34 @@ finishfill: } static void isitworn(Context & context) { - context.al = context.data.byte(context.bx+12); + context.al = context.ds.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) goto notworn; - context.al = context.data.byte(context.bx+13); + context.al = context.ds.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); notworn: return; } static void makeworn(Context & context) { - context.data.byte(context.bx+12) = 'W'-'A'; - context.data.byte(context.bx+13) = 'E'-'A'; + context.ds.byte(context.bx+12) = 'W'-'A'; + context.ds.byte(context.bx+13) = 'E'-'A'; return; } static void examineob(Context & context) { - context.data.byte(234) = 0; - context.data.word(328) = 0; + context.ds.byte(234) = 0; + context.ds.word(328) = 0; examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; - context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; + context.ds.byte(237) = 0; + context.ds.byte(108) = 0; + context.ds.byte(110) = 255; + context.ds.byte(111) = 255; + context.ds.byte(104) = 0; + context.al = context.ds.byte(100); + context.ds.byte(102) = context.al; + context.ds.byte(89) = 0; + context.ds.byte(231) = 0; createpanel(context); showpanel(context); showman(context); @@ -6866,7 +6866,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -6878,41 +6878,41 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; context.bx = 2494; - context._cmp(context.data.byte(104), 0); + context._cmp(context.ds.byte(104), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(104), 1); + context._cmp(context.ds.byte(104), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(108), 0); + context._cmp(context.ds.byte(108), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); + context.ds.byte(106) = 0; + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); + context._cmp(context.ds.byte(188), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.ds.byte(104) = 0; + context.ds.byte(110) = 255; return; justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.ds.byte(104) = 0; + context.ds.byte(110) = 255; return; } static void makemainscreen(Context & context) { createpanel(context); - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); spriteupdate(context); printsprites(context); @@ -6920,16 +6920,16 @@ static void makemainscreen(Context & context) { showicon(context); getunderzoom(context); undertextline(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; animpointer(context); worktoscreenm(context); - context.data.byte(100) = 200; - context.data.byte(131) = 0; + context.ds.byte(100) = 200; + context.ds.byte(131) = 0; return; } static void getbackfromob(Context & context) { - context._cmp(context.data.byte(106), 1); + context._cmp(context.ds.byte(106), 1); if (!context.flags.z()) goto notheldob; blank(context); return; @@ -6939,25 +6939,25 @@ notheldob: } static void incryanpage(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadyincryan; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 31; commandonly(context); alreadyincryan: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noincryan; context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: return; doincryan: - context.ax = context.data.word(198); + context.ax = context.ds.word(198); context._sub(context.ax, 80+167); - context.data.byte(19) = -1; + context.ds.byte(19) = -1; findnewpage: - context._add(context.data.byte(19), 1); + context._add(context.ds.byte(19), 1); context._sub(context.ax, 18); if (!context.flags.c()) goto findnewpage; delpointer(context); @@ -6970,32 +6970,32 @@ findnewpage: } static void openinv(Context & context) { - context.data.byte(104) = 1; + context.ds.byte(104) = 1; context.al = 61; context.di = 80; context.bx = 58-10; context.dl = 240; printmessage(context); fillryan(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; return; } static void showryanpage(Context & context) { - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 80+167; context.bx = 58-12; context.al = 12; context.ah = 0; showframe(context); context.al = 13; - context._add(context.al, context.data.byte(19)); + context._add(context.al, context.ds.byte(19)); context.push(context.ax); - context.al = context.data.byte(19); + context.al = context.ds.byte(19); context.ah = 0; context.cx = 18; context._mul(context.cx); - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 80+167; context._add(context.di, context.ax); context.bx = 58-12; @@ -7006,8 +7006,8 @@ static void showryanpage(Context & context) { } static void openob(Context & context) { - context.al = context.data.byte(110); - context.ah = context.data.byte(111); + context.al = context.ds.byte(110); + context.ah = context.ds.byte(111); context.di = 5674; copyname(context); context.di = 80; @@ -7015,7 +7015,7 @@ static void openob(Context & context) { context.al = 62; context.dl = 240; printmessage(context); - context.di = context.data.word(84); + context.di = context.ds.word(84); context._add(context.di, 5); context.bx = 58+86; context.es = context.cs; @@ -7032,23 +7032,23 @@ static void openob(Context & context) { context._mul(context.cx); context._add(context.ax, 80); context.bx = 2588; - context.data.word(context.bx) = context.ax; + context.ds.word(context.bx) = context.ax; return; } static void obicons(Context & context) { - context.al = context.data.byte(99); + context.al = context.ds.byte(99); getanyad(context); context._cmp(context.al, 255); if (context.flags.z()) goto cantopenit; - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.di = 210; context.bx = 1; context.al = 4; context.ah = 0; showframe(context); cantopenit: - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.di = 260; context.bx = 1; context.al = 1; @@ -7058,7 +7058,7 @@ cantopenit: } static void examicon(Context & context) { - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context.di = 254; context.bx = 5; context.al = 3; @@ -7068,13 +7068,13 @@ static void examicon(Context & context) { } static void obpicture(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); context._cmp(context.ah, 1); if (context.flags.z()) goto setframe; context._cmp(context.ah, 4); if (context.flags.z()) goto exframe; - context.ds = context.data.word(446); + context.ds = context.ds.word(446); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7087,7 +7087,7 @@ static void obpicture(Context & context) { setframe: return; exframe: - context.ds = context.data.word(398); + context.ds = context.ds.word(398); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7103,18 +7103,18 @@ static void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; - context._cmp(context.data.byte(102), 1); + context._cmp(context.ds.byte(102), 1); if (!context.flags.z()) goto notsetd; context.bx = 82; notsetd: context.dl = 241; context.ah = 16; - context.data.word(71) = 91+91; + context.ds.word(71) = 91+91; printdirect(context); - context.data.word(71) = 0; + context.ds.word(71) = 0; context.di = 36; context.bx = 104; - context._cmp(context.data.byte(102), 1); + context._cmp(context.ds.byte(102), 1); if (!context.flags.z()) goto notsetd2; context.bx = 94; notsetd2: @@ -7131,16 +7131,16 @@ notsetd2: static void additionaltext(Context & context) { context._add(context.bx, 10); context.push(context.bx); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto emptycup; - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -7170,8 +7170,8 @@ fullcup: } static void obsthatdothings(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -7192,35 +7192,35 @@ notlouiscard: } static void getobtextstart(Context & context) { - context.es = context.data.word(438); + context.es = context.ds.word(438); context.si = 0; context.cx = 0+(82*2); - context._cmp(context.data.byte(102), 2); + context._cmp(context.ds.byte(102), 2); if (context.flags.z()) goto describe; - context.es = context.data.word(440); + context.es = context.ds.word(440); context.si = 0; context.cx = 0+(130*2); - context._cmp(context.data.byte(102), 1); + context._cmp(context.ds.byte(102), 1); if (context.flags.z()) goto describe; - context.es = context.data.word(398); + context.es = context.ds.word(398); context.si = 0+2080+30000+(16*114); context.cx = 0+2080+30000+(16*114)+((114+2)*2); describe: - context.al = context.data.byte(99); + context.al = context.ds.byte(99); context.ah = 0; context._add(context.ax, context.ax); context._add(context.si, context.ax); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; context.bx = context.ax; tryagain: context.push(context.si); findnextcolon(context); - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context.cx = context.si; context.si = context.pop(); - context._cmp(context.data.byte(102), 1); + context._cmp(context.ds.byte(102), 1); if (!context.flags.z()) goto cantmakeoneup; context._cmp(context.al, 0); if (context.flags.z()) goto findsometext; @@ -7238,9 +7238,9 @@ static void searchforsame(Context & context) { context.si = context.cx; searchagain: context._add(context.si, 1); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); search: - context._cmp(context.data.byte(context.si), context.al); + context._cmp(context.ds.byte(context.si), context.al); if (context.flags.z()) goto gotstartletter; context._add(context.cx, 1); context._add(context.si, 1); @@ -7255,8 +7255,8 @@ gotstartletter: keepchecking: context._add(context.si, 1); context._add(context.bx, 1); - context.al = context.data.byte(context.bx); - context.ah = context.data.byte(context.si); + context.al = context.ds.byte(context.bx); + context.ah = context.ds.byte(context.si); context._cmp(context.al, ':'); if (context.flags.z()) goto foundmatch; context._cmp(context.al, 0); @@ -7274,7 +7274,7 @@ foundmatch: static void findnextcolon(Context & context) { isntcolon: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto endofcolon; @@ -7285,31 +7285,31 @@ endofcolon: } static void inventory(Context & context) { - context._cmp(context.data.byte(56), 1); + context._cmp(context.ds.byte(56), 1); if (context.flags.z()) goto iswatchinv; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); return; notwatchinv: - context._cmp(context.data.byte(100), 239); + context._cmp(context.ds.byte(100), 239); if (context.flags.z()) goto alreadyopinv; - context.data.byte(100) = 239; + context.ds.byte(100) = 239; context.al = 32; commandonly(context); alreadyopinv: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto cantopinv; context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: return; doopeninv: - context.data.word(328) = 0; - context.data.byte(234) = 0; - context.data.byte(237) = 0; + context.ds.word(328) = 0; + context.ds.byte(234) = 0; + context.ds.byte(237) = 0; animpointer(context); createpanel(context); showpanel(context); @@ -7317,26 +7317,26 @@ doopeninv: showman(context); showexit(context); undertextline(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; + context.ds.byte(106) = 0; + context.ds.byte(104) = 2; openinv(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(110) = 255; + context.ds.byte(110) = 255; goto waitexam; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; - context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; + context.ds.byte(237) = 0; + context.ds.byte(108) = 0; + context.ds.byte(110) = 255; + context.ds.byte(111) = 255; + context.ds.byte(104) = 0; + context.al = context.ds.byte(100); + context.ds.byte(102) = context.al; + context.ds.byte(89) = 0; + context.ds.byte(231) = 0; createpanel(context); showpanel(context); showman(context); @@ -7345,7 +7345,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -7357,35 +7357,35 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; context.bx = 2494; - context._cmp(context.data.byte(104), 0); + context._cmp(context.ds.byte(104), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(104), 1); + context._cmp(context.ds.byte(104), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(108), 0); + context._cmp(context.ds.byte(108), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); + context.ds.byte(106) = 0; + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); + context._cmp(context.ds.byte(188), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.ds.byte(104) = 0; + context.ds.byte(110) = 255; return; justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.ds.byte(104) = 0; + context.ds.byte(110) = 255; return; examlist: invlist1: @@ -7395,30 +7395,30 @@ withlist1: } static void setpickup(Context & context) { - context._cmp(context.data.byte(102), 1); + context._cmp(context.ds.byte(102), 1); if (context.flags.z()) goto cantpick; - context._cmp(context.data.byte(102), 3); + context._cmp(context.ds.byte(102), 3); if (context.flags.z()) goto cantpick; getanyad(context); - context.al = context.data.byte(context.bx+2); + context.al = context.ds.byte(context.bx+2); context._cmp(context.al, 4); if (!context.flags.z()) goto canpick; cantpick: blank(context); return; canpick: - context._cmp(context.data.byte(100), 209); + context._cmp(context.ds.byte(100), 209); if (context.flags.z()) goto alreadysp; - context.data.byte(100) = 209; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.ds.byte(100) = 209; + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(102); context.al = 33; commandwithob(context); alreadysp: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto nosetpick; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (!context.flags.z()) goto dosetpick; nosetpick: return; @@ -7428,39 +7428,39 @@ dosetpick: showman(context); showexit(context); examicon(context); - context.data.byte(106) = 1; - context.data.byte(104) = 2; - context._cmp(context.data.byte(102), 4); + context.ds.byte(106) = 1; + context.ds.byte(104) = 2; + context._cmp(context.ds.byte(102), 4); if (context.flags.z()) goto pickupexob; - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; + context.al = context.ds.byte(99); + context.ds.byte(89) = context.al; + context.ds.byte(110) = 255; transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.ds.byte(89) = context.al; + context.ds.byte(102) = 4; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; openinv(context); worktoscreenm(context); return; pickupexob: - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; + context.al = context.ds.byte(99); + context.ds.byte(89) = context.al; + context.ds.byte(110) = 255; openinv(context); worktoscreenm(context); return; } static void examinventory(Context & context) { - context._cmp(context.data.byte(100), 249); + context._cmp(context.ds.byte(100), 249); if (context.flags.z()) goto alreadyexinv; - context.data.byte(100) = 249; + context.ds.byte(100) = 249; context.al = 32; commandonly(context); alreadyexinv: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; return; @@ -7470,8 +7470,8 @@ doexinv: showman(context); showexit(context); examicon(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; + context.ds.byte(106) = 0; + context.ds.byte(104) = 2; openinv(context); worktoscreenm(context); return; @@ -7479,74 +7479,74 @@ doexinv: static void reexfrominv(Context & context) { findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; + context.ax = context.ds.word(context.bx); + context.ds.byte(100) = context.ah; + context.ds.byte(99) = context.al; + context.ds.byte(108) = 1; + context.ds.byte(234) = 0; return; } static void reexfromopen(Context & context) { return; findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; + context.ax = context.ds.word(context.bx); + context.ds.byte(100) = context.ah; + context.ds.byte(99) = context.al; + context.ds.byte(108) = 1; + context.ds.byte(234) = 0; return; } static void swapwithinv(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.ds.byte(89); + context.ah = context.ds.byte(102); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub7; - context._cmp(context.data.byte(100), 243); + context._cmp(context.ds.byte(100), 243); if (context.flags.z()) goto alreadyswap1; - context.data.byte(100) = 243; + context.ds.byte(100) = 243; difsub7: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap1: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto cantswap1; context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: return; doswap1: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); + context.ah = context.ds.byte(102); + context.al = context.ds.byte(89); context.push(context.ax); findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.ax = context.ds.word(context.bx); + context.ds.byte(89) = context.al; + context.ds.byte(102) = context.ah; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; + context.bl = context.ds.byte(89); + context.bh = context.ds.byte(102); context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.ds.byte(102) = context.ah; + context.ds.byte(89) = context.al; context.push(context.bx); findinvpos(context); delpointer(context); - context.al = context.data.byte(89); + context.al = context.ds.byte(89); geteitherad(context); - context.data.byte(context.bx+2) = 4; - context.data.byte(context.bx+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; + context.ds.byte(context.bx+2) = 4; + context.ds.byte(context.bx+3) = 255; + context.al = context.ds.byte(107); + context.ds.byte(context.bx+4) = context.al; context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.ds.byte(102) = context.ah; + context.ds.byte(89) = context.al; fillryan(context); readmouse(context); showpointer(context); @@ -7556,21 +7556,21 @@ doswap1: } static void swapwithopen(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.ds.byte(89); + context.ah = context.ds.byte(102); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub8; - context._cmp(context.data.byte(100), 242); + context._cmp(context.ds.byte(100), 242); if (context.flags.z()) goto alreadyswap2; - context.data.byte(100) = 242; + context.ds.byte(100) = 242; difsub8: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto cantswap2; context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; @@ -7584,11 +7584,11 @@ doswap2: return; notwornswap: delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); + context.al = context.ds.byte(89); + context._cmp(context.al, context.ds.byte(110)); if (!context.flags.z()) goto isntsame2; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); + context.al = context.ds.byte(102); + context._cmp(context.al, context.ds.byte(111)); if (!context.flags.z()) goto isntsame2; errormessage1(context); return; @@ -7598,46 +7598,46 @@ isntsame2: if (context.flags.z()) goto sizeok2; return; sizeok2: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); + context.ah = context.ds.byte(102); + context.al = context.ds.byte(89); context.push(context.ax); findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.ax = context.ds.word(context.bx); + context.ds.byte(89) = context.al; + context.ds.byte(102) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeswapex; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; goto actuallyswap; makeswapex: transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.ds.byte(89) = context.al; + context.ds.byte(102) = 4; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; actuallyswap: - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.bl = context.ds.byte(89); + context.bh = context.ds.byte(102); context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.ds.byte(102) = context.ah; + context.ds.byte(89) = context.al; context.push(context.bx); findopenpos(context); geteitherad(context); - context.al = context.data.byte(111); - context.data.byte(context.bx+2) = context.al; - context.al = context.data.byte(110); - context.data.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); - context.data.byte(context.bx+5) = context.al; + context.al = context.ds.byte(111); + context.ds.byte(context.bx+2) = context.al; + context.al = context.ds.byte(110); + context.ds.byte(context.bx+3) = context.al; + context.al = context.ds.byte(107); + context.ds.byte(context.bx+4) = context.al; + context.al = context.ds.byte(184); + context.ds.byte(context.bx+5) = context.al; context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.ds.byte(102) = context.ah; + context.ds.byte(89) = context.al; fillopen(context); fillryan(context); undertextline(context); @@ -7650,33 +7650,33 @@ actuallyswap: } static void intoinv(Context & context) { - context._cmp(context.data.byte(106), 0); + context._cmp(context.ds.byte(106), 0); if (!context.flags.z()) goto notout; outofinv(context); return; notout: findinvpos(context); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace1; swapwithinv(context); return; canplace1: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.ds.byte(89); + context.ah = context.ds.byte(102); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub1; - context._cmp(context.data.byte(100), 220); + context._cmp(context.ds.byte(100), 220); if (context.flags.z()) goto alreadyplce; - context.data.byte(100) = 220; + context.ds.byte(100) = 220; difsub1: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplce: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notletgo2; context._and(context.ax, 1); if (!context.flags.z()) goto doplace; @@ -7684,13 +7684,13 @@ notletgo2: return; doplace: delpointer(context); - context.al = context.data.byte(89); + context.al = context.ds.byte(89); getexad(context); - context.data.byte(context.bx+2) = 4; - context.data.byte(context.bx+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.data.byte(106) = 0; + context.ds.byte(context.bx+2) = 4; + context.ds.byte(context.bx+3) = 255; + context.al = context.ds.byte(107); + context.ds.byte(context.bx+4) = context.al; + context.ds.byte(106) = 0; fillryan(context); readmouse(context); showpointer(context); @@ -7701,22 +7701,22 @@ doplace: } static void deletetaken(Context & context) { - context.es = context.data.word(426); - context.ah = context.data.byte(184); - context.ds = context.data.word(398); + context.es = context.ds.word(426); + context.ah = context.ds.byte(184); + context.ds = context.ds.word(398); context.si = 0+2080+30000; context.cx = 114; takenloop: - context.al = context.data.byte(context.si+11); + context.al = context.ds.byte(context.si+11); context._cmp(context.al, context.ah); if (!context.flags.z()) goto notinhere; - context.bl = context.data.byte(context.si+1); + context.bl = context.ds.byte(context.si+1); context.bh = 0; context._add(context.bx, context.bx); context._add(context.bx, context.bx); context._add(context.bx, context.bx); context._add(context.bx, context.bx); - context.data.byte(context.bx+2) = 254; + context.ds.byte(context.bx+2) = 254; notinhere: context._add(context.si, 16); if (--context.cx) goto takenloop; @@ -7725,31 +7725,31 @@ notinhere: static void outofinv(Context & context) { findinvpos(context); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick2; blank(context); return; canpick2: - context.bx = context.data.word(202); + context.bx = context.ds.word(202); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); return; canpick2a: - context._cmp(context.ax, context.data.word(94)); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub3; - context._cmp(context.data.byte(100), 221); + context._cmp(context.ds.byte(100), 221); if (context.flags.z()) goto alreadygrab; - context.data.byte(100) = 221; + context.ds.byte(100) = 221; difsub3: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrab: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notletgo; context._and(context.ax, 1); if (!context.flags.z()) goto dograb; @@ -7757,14 +7757,14 @@ notletgo: return; dograb: delpointer(context); - context.data.byte(106) = 1; + context.ds.byte(106) = 1; findinvpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.ax = context.ds.word(context.bx); + context.ds.byte(89) = context.al; + context.ds.byte(102) = context.ah; getexad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; fillryan(context); readmouse(context); showpointer(context); @@ -7779,7 +7779,7 @@ static void getfreead(Context & context) { context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; - context.es = context.data.word(426); + context.es = context.ds.word(426); return; } @@ -7788,41 +7788,41 @@ static void getexad(Context & context) { context.bx = 16; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(398); + context.es = context.ds.word(398); context._add(context.bx, 0+2080+30000); return; } static void geteitherad(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.ds.byte(102), 4); if (context.flags.z()) goto isinexlist; - context.al = context.data.byte(89); + context.al = context.ds.byte(89); getfreead(context); return; isinexlist: - context.al = context.data.byte(89); + context.al = context.ds.byte(89); getexad(context); return; } static void getanyad(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.ds.byte(102), 4); if (context.flags.z()) goto isex; - context._cmp(context.data.byte(102), 2); + context._cmp(context.ds.byte(102), 2); if (context.flags.z()) goto isfree; - context.al = context.data.byte(99); + context.al = context.ds.byte(99); getsetad(context); - context.ax = context.data.word(context.bx+4); + context.ax = context.ds.word(context.bx+4); return; isfree: - context.al = context.data.byte(99); + context.al = context.ds.byte(99); getfreead(context); - context.ax = context.data.word(context.bx+7); + context.ax = context.ds.word(context.bx+7); return; isex: - context.al = context.data.byte(99); + context.al = context.ds.byte(99); getexad(context); - context.ax = context.data.word(context.bx+7); + context.ax = context.ds.word(context.bx+7); return; } @@ -7842,23 +7842,23 @@ isex3: } static void getopenedsize(Context & context) { - context._cmp(context.data.byte(111), 4); + context._cmp(context.ds.byte(111), 4); if (context.flags.z()) goto isex2; - context._cmp(context.data.byte(111), 2); + context._cmp(context.ds.byte(111), 2); if (context.flags.z()) goto isfree2; - context.al = context.data.byte(110); + context.al = context.ds.byte(110); getsetad(context); - context.ax = context.data.word(context.bx+3); + context.ax = context.ds.word(context.bx+3); return; isfree2: - context.al = context.data.byte(110); + context.al = context.ds.byte(110); getfreead(context); - context.ax = context.data.word(context.bx+7); + context.ax = context.ds.word(context.bx+7); return; isex2: - context.al = context.data.byte(110); + context.al = context.ds.byte(110); getexad(context); - context.ax = context.data.word(context.bx+7); + context.ax = context.ds.word(context.bx+7); return; } @@ -7867,40 +7867,40 @@ static void getsetad(Context & context) { context.bx = 64; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(428); + context.es = context.ds.word(428); return; } static void findinvpos(Context & context) { - context.cx = context.data.word(198); + context.cx = context.ds.word(198); context._sub(context.cx, 80); context.bx = -1; findinv1: context._add(context.bx, 1); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv1; - context.cx = context.data.word(200); + context.cx = context.ds.word(200); context._sub(context.cx, 58); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv2; - context.al = context.data.byte(19); + context.al = context.ds.byte(19); context.ah = 0; context.cx = 10; context._mul(context.cx); context._add(context.bx, context.ax); context.al = context.bl; - context.data.byte(107) = context.al; + context.ds.byte(107) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(412); + context.es = context.ds.word(412); context._add(context.bx, 0+(228*13)+32); return; } static void findopenpos(Context & context) { - context.cx = context.data.word(198); + context.cx = context.ds.word(198); context._sub(context.cx, 80); context.bx = -1; findopenp1: @@ -7908,26 +7908,26 @@ findopenp1: context._sub(context.cx, 44); if (!context.flags.c()) goto findopenp1; context.al = context.bl; - context.data.byte(107) = context.al; + context.ds.byte(107) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(412); + context.es = context.ds.word(412); context._add(context.bx, 0+(228*13)); return; } static void dropobject(Context & context) { - context._cmp(context.data.byte(100), 223); + context._cmp(context.ds.byte(100), 223); if (context.flags.z()) goto alreadydrop; - context.data.byte(100) = 223; - context._cmp(context.data.byte(106), 0); + context.ds.byte(100) = 223; + context._cmp(context.ds.byte(106), 0); if (context.flags.z()) { blank(context); return; }; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.bl = context.ds.byte(89); + context.bh = context.ds.byte(102); context.al = 37; commandwithob(context); alreadydrop: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nodrop; context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; @@ -7940,11 +7940,11 @@ dodrop: wornerror(context); return; nowornerror: - context._cmp(context.data.byte(184), 47); + context._cmp(context.ds.byte(184), 47); if (context.flags.z()) goto nodrop2; - context.cl = context.data.byte(151); + context.cl = context.ds.byte(151); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.ds.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); @@ -7953,14 +7953,14 @@ nodrop2: droperror(context); return; nodroperror: - context._cmp(context.data.byte(128), 64); + context._cmp(context.ds.byte(128), 64); if (!context.flags.z()) goto notinlift; - context._cmp(context.data.byte(129), 64); + context._cmp(context.ds.byte(129), 64); if (!context.flags.z()) goto notinlift; droperror(context); return; notinlift: - context.al = context.data.byte(89); + context.al = context.ds.byte(89); context.ah = 4; context.cl = 'G'; context.ch = 'U'; @@ -7968,7 +7968,7 @@ notinlift: context.dh = 'A'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.al = context.data.byte(89); + context.al = context.ds.byte(89); context.ah = 4; context.cl = 'S'; context.ch = 'H'; @@ -7976,38 +7976,38 @@ notinlift: context.dh = 'D'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.data.byte(102) = 4; - context.al = context.data.byte(89); + context.ds.byte(102) = 4; + context.al = context.ds.byte(89); getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(151); + context.ds.byte(context.bx+2) = 0; + context.al = context.ds.byte(151); context._add(context.al, 4); context.cl = 4; context._shr(context.al, context.cl); - context._add(context.al, context.data.byte(148)); - context.ah = context.data.byte(152); + context._add(context.al, context.ds.byte(148)); + context.ah = context.ds.byte(152); context._add(context.ah, 8); context.cl = 4; context._shr(context.ah, context.cl); - context._add(context.ah, context.data.byte(149)); - context.data.byte(context.bx+3) = context.al; - context.data.byte(context.bx+5) = context.ah; - context.al = context.data.byte(151); + context._add(context.ah, context.ds.byte(149)); + context.ds.byte(context.bx+3) = context.al; + context.ds.byte(context.bx+5) = context.ah; + context.al = context.ds.byte(151); context._add(context.al, 4); context._and(context.al, 15); - context.ah = context.data.byte(152); + context.ah = context.ds.byte(152); context._add(context.ah, 8); context._and(context.ah, 15); - context.data.byte(context.bx+4) = context.al; - context.data.byte(context.bx+6) = context.ah; - context.data.byte(106) = 0; - context.al = context.data.byte(184); - context.data.byte(context.bx) = context.al; + context.ds.byte(context.bx+4) = context.al; + context.ds.byte(context.bx+6) = context.ah; + context.ds.byte(106) = 0; + context.al = context.ds.byte(184); + context.ds.byte(context.bx) = context.al; return; } static void droperror(Context & context) { - context.data.byte(100) = 255; + context.ds.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8020,13 +8020,13 @@ static void droperror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; worktoscreenm(context); return; } static void cantdrop(Context & context) { - context.data.byte(100) = 255; + context.ds.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8039,13 +8039,13 @@ static void cantdrop(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; worktoscreenm(context); return; } static void wornerror(Context & context) { - context.data.byte(100) = 255; + context.ds.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8058,17 +8058,17 @@ static void wornerror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; worktoscreenm(context); return; } static void removeobfrominv(Context & context) { - context._cmp(context.data.byte(99), 100); + context._cmp(context.ds.byte(99), 100); if (context.flags.z()) goto obnotexist; getanyad(context); context.di = context.bx; - context.cl = context.data.byte(99); + context.cl = context.ds.byte(99); context.ch = 0; deleteexobject(context); obnotexist: @@ -8076,33 +8076,33 @@ obnotexist: } static void selectopenob(Context & context) { - context.al = context.data.byte(99); + context.al = context.ds.byte(99); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); return; canopenit1: - context._cmp(context.data.byte(100), 224); + context._cmp(context.ds.byte(100), 224); if (context.flags.z()) goto alreadyopob; - context.data.byte(100) = 224; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.ds.byte(100) = 224; + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(102); context.al = 38; commandwithob(context); alreadyopob: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noopenob; context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: return; doopenob: - context.al = context.data.byte(99); - context.data.byte(110) = context.al; - context.al = context.data.byte(102); - context.data.byte(111) = context.al; + context.al = context.ds.byte(99); + context.ds.byte(110) = context.al; + context.al = context.ds.byte(102); + context.ds.byte(111) = context.al; createpanel(context); showpanel(context); showman(context); @@ -8119,41 +8119,41 @@ doopenob: } static void useopened(Context & context) { - context._cmp(context.data.byte(110), 255); + context._cmp(context.ds.byte(110), 255); if (context.flags.z()) goto cannotuseopen; - context._cmp(context.data.byte(106), 0); + context._cmp(context.ds.byte(106), 0); if (!context.flags.z()) goto notout2; outofopen(context); return; notout2: findopenpos(context); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace3; swapwithopen(context); cannotuseopen: return; canplace3: - context._cmp(context.data.byte(106), 1); + context._cmp(context.ds.byte(106), 1); if (context.flags.z()) goto intoopen; blank(context); return; intoopen: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.ds.byte(89); + context.ah = context.ds.byte(102); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub2; - context._cmp(context.data.byte(100), 227); + context._cmp(context.ds.byte(100), 227); if (context.flags.z()) goto alreadyplc2; - context.data.byte(100) = 227; + context.ds.byte(100) = 227; difsub2: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplc2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notletgo3; context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; @@ -8167,11 +8167,11 @@ doplace2: return; notworntoopen: delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); + context.al = context.ds.byte(89); + context._cmp(context.al, context.ds.byte(110)); if (!context.flags.z()) goto isntsame; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); + context.al = context.ds.byte(102); + context._cmp(context.al, context.ds.byte(111)); if (!context.flags.z()) goto isntsame; errormessage1(context); return; @@ -8181,17 +8181,17 @@ isntsame: if (context.flags.z()) goto sizeok1; return; sizeok1: - context.data.byte(106) = 0; - context.al = context.data.byte(89); + context.ds.byte(106) = 0; + context.al = context.ds.byte(89); geteitherad(context); - context.al = context.data.byte(111); - context.data.byte(context.bx+2) = context.al; - context.al = context.data.byte(110); - context.data.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); - context.data.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); - context.data.byte(context.bx+5) = context.al; + context.al = context.ds.byte(111); + context.ds.byte(context.bx+2) = context.al; + context.al = context.ds.byte(110); + context.ds.byte(context.bx+3) = context.al; + context.al = context.ds.byte(107); + context.ds.byte(context.bx+4) = context.al; + context.al = context.ds.byte(184); + context.ds.byte(context.bx+5) = context.al; fillopen(context); undertextline(context); readmouse(context); @@ -8227,7 +8227,7 @@ static void errormessage1(Context & context) { } static void errormessage2(Context & context) { - context.data.byte(100) = 255; + context.ds.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8275,9 +8275,9 @@ static void errormessage3(Context & context) { static void checkobjectsize(Context & context) { getopenedsize(context); context.push(context.ax); - context.al = context.data.byte(89); + context.al = context.ds.byte(89); geteitherad(context); - context.al = context.data.byte(context.bx+9); + context.al = context.ds.byte(context.bx+9); context.cx = context.pop(); context._cmp(context.al, 255); if (!context.flags.z()) goto notunsized; @@ -8314,29 +8314,29 @@ sizeok: } static void outofopen(Context & context) { - context._cmp(context.data.byte(110), 255); + context._cmp(context.ds.byte(110), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick4; cantuseopen: blank(context); return; canpick4: - context._cmp(context.ax, context.data.word(94)); + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto difsub4; - context._cmp(context.data.byte(100), 228); + context._cmp(context.ds.byte(100), 228); if (context.flags.z()) goto alreadygrb; - context.data.byte(100) = 228; + context.ds.byte(100) = 228; difsub4: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrb: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notletgo4; context._cmp(context.ax, 1); if (context.flags.z()) goto dogrb; @@ -8347,24 +8347,24 @@ notletgo4: return; dogrb: delpointer(context); - context.data.byte(106) = 1; + context.ds.byte(106) = 1; findopenpos(context); - context.ax = context.data.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.ax = context.ds.word(context.bx); + context.ds.byte(89) = context.al; + context.ds.byte(102) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeintoex; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; goto actuallyout; makeintoex: transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.ds.byte(89) = context.al; + context.ds.byte(102) = 4; geteitherad(context); - context.data.byte(context.bx+2) = 20; - context.data.byte(context.bx+3) = 255; + context.ds.byte(context.bx+2) = 20; + context.ds.byte(context.bx+3) = 255; actuallyout: fillopen(context); undertextline(context); @@ -8379,52 +8379,52 @@ actuallyout: static void transfertoex(Context & context) { emergencypurge(context); getexpos(context); - context.al = context.data.byte(10); + context.al = context.ds.byte(10); context.push(context.ax); context.push(context.di); - context.al = context.data.byte(89); + context.al = context.ds.byte(89); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(426); + context.ds = context.ds.word(426); context.si = context.ax; context.cx = 8; while(--context.cx) context._movsw(); context.di = context.pop(); - context.al = context.data.byte(184); - context.data.byte(context.di) = context.al; - context.data.byte(context.di+11) = context.al; - context.al = context.data.byte(89); - context.data.byte(context.di+1) = context.al; - context.data.byte(context.di+2) = 4; - context.data.byte(context.di+3) = 255; - context.al = context.data.byte(107); - context.data.byte(context.di+4) = context.al; - context.al = context.data.byte(89); - context.data.byte(90) = context.al; + context.al = context.ds.byte(184); + context.ds.byte(context.di) = context.al; + context.ds.byte(context.di+11) = context.al; + context.al = context.ds.byte(89); + context.ds.byte(context.di+1) = context.al; + context.ds.byte(context.di+2) = 4; + context.ds.byte(context.di+3) = 255; + context.al = context.ds.byte(107); + context.ds.byte(context.di+4) = context.al; + context.al = context.ds.byte(89); + context.ds.byte(90) = context.al; transfermap(context); transferinv(context); transfertext(context); - context.al = context.data.byte(89); + context.al = context.ds.byte(89); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(426); + context.ds = context.ds.word(426); context.si = context.ax; - context.data.byte(context.si+2) = 254; + context.ds.byte(context.si+2) = 254; pickupconts(context); context.ax = context.pop(); return; } static void pickupconts(Context & context) { - context.al = context.data.byte(context.si+7); + context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context.dl = context.data.byte(10); - context.es = context.data.word(426); + context.al = context.ds.byte(89); + context.ah = context.ds.byte(102); + context.dl = context.ds.byte(10); + context.es = context.ds.word(426); context.bx = 0; context.cx = 0; pickupcontloop: @@ -8433,11 +8433,11 @@ pickupcontloop: context.push(context.bx); context.push(context.dx); context.push(context.ax); - context._cmp(context.data.byte(context.bx+2), context.ah); + context._cmp(context.ds.byte(context.bx+2), context.ah); if (!context.flags.z()) goto notinsidethis; - context._cmp(context.data.byte(context.bx+3), context.al); + context._cmp(context.ds.byte(context.bx+3), context.al); if (!context.flags.z()) goto notinsidethis; - context.data.byte(90) = context.cl; + context.ds.byte(90) = context.cl; transfercontoex(context); notinsidethis: context.ax = context.pop(); @@ -8467,76 +8467,76 @@ static void transfercontoex(Context & context) { while(--context.cx) context._movsw(); context.di = context.pop(); context.dx = context.pop(); - context.al = context.data.byte(184); - context.data.byte(context.di) = context.al; - context.data.byte(context.di+11) = context.al; - context.al = context.data.byte(90); - context.data.byte(context.di+1) = context.al; - context.data.byte(context.di+3) = context.dl; - context.data.byte(context.di+2) = 4; + context.al = context.ds.byte(184); + context.ds.byte(context.di) = context.al; + context.ds.byte(context.di+11) = context.al; + context.al = context.ds.byte(90); + context.ds.byte(context.di+1) = context.al; + context.ds.byte(context.di+3) = context.dl; + context.ds.byte(context.di+2) = 4; transfermap(context); transferinv(context); transfertext(context); context.si = context.pop(); context.ds = context.pop(); - context.data.byte(context.si+2) = 255; + context.ds.byte(context.si+2) = 255; return; } static void transfertext(Context & context) { - context.es = context.data.word(398); - context.al = context.data.byte(10); + context.es = context.ds.word(398); + context.al = context.ds.byte(10); context.ah = 0; context._add(context.ax, context.ax); context.bx = 0+2080+30000+(16*114); context._add(context.bx, context.ax); - context.di = context.data.word(14); - context.data.word(context.bx) = context.di; + context.di = context.ds.word(14); + context.ds.word(context.bx) = context.di; context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.al = context.data.byte(90); + context.al = context.ds.byte(90); context.ah = 0; context._add(context.ax, context.ax); - context.ds = context.data.word(438); + context.ds = context.ds.word(438); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+(82*2); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.si, context.ax); moretext: context._lodsb(); context._stosb(); - context._add(context.data.word(14), 1); + context._add(context.ds.word(14), 1); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; return; } static void getexpos(Context & context) { - context.es = context.data.word(398); + context.es = context.ds.word(398); context.al = 0; context.di = 0+2080+30000; tryanotherex: - context._cmp(context.data.byte(context.di+2), 255); + context._cmp(context.ds.byte(context.di+2), 255); if (context.flags.z()) goto foundnewex; context._add(context.di, 16); context._add(context.al, 1); context._cmp(context.al, 114); if (!context.flags.z()) goto tryanotherex; foundnewex: - context.data.byte(10) = context.al; + context.ds.byte(10) = context.al; return; } static void purgealocation(Context & context) { context.push(context.ax); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.di = 0+2080+30000; context.bx = context.pop(); context.cx = 0; purgeloc: - context._cmp(context.bl, context.data.byte(context.di+0)); + context._cmp(context.bl, context.ds.byte(context.di+0)); if (!context.flags.z()) goto dontpurge; - context._cmp(context.data.byte(context.di+2), 0); + context._cmp(context.ds.byte(context.di+2), 0); if (!context.flags.z()) goto dontpurge; context.push(context.di); context.push(context.es); @@ -8557,14 +8557,14 @@ dontpurge: static void emergencypurge(Context & context) { checkpurgeagain: - context.ax = context.data.word(12); + context.ax = context.ds.word(12); context._add(context.ax, 4000); context._cmp(context.ax, 30000); if (context.flags.c()) goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: - context.ax = context.data.word(14); + context.ax = context.ds.word(14); context._add(context.ax, 400); context._cmp(context.ax, 18000); if (context.flags.c()) goto notneartextend; @@ -8575,20 +8575,20 @@ notneartextend: } static void purgeanitem(Context & context) { - context.es = context.data.word(398); + context.es = context.ds.word(398); context.di = 0+2080+30000; - context.bl = context.data.byte(184); + context.bl = context.ds.byte(184); context.cx = 0; lookforpurge: - context.al = context.data.byte(context.di+2); + context.al = context.ds.byte(context.di+2); context._cmp(context.al, 0); if (!context.flags.z()) goto cantpurge; - context._cmp(context.data.byte(context.di+12), 2); + context._cmp(context.ds.byte(context.di+12), 2); if (context.flags.z()) goto iscup; - context._cmp(context.data.byte(context.di+12), 255); + context._cmp(context.ds.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge; iscup: - context._cmp(context.data.byte(context.di+11), context.bl); + context._cmp(context.ds.byte(context.di+11), context.bl); if (context.flags.z()) goto cantpurge; deleteexobject(context); return; @@ -8598,13 +8598,13 @@ cantpurge: context._cmp(context.cx, 114); if (!context.flags.z()) goto lookforpurge; context.di = 0+2080+30000; - context.bl = context.data.byte(184); + context.bl = context.ds.byte(184); context.cx = 0; lookforpurge2: - context.al = context.data.byte(context.di+2); + context.al = context.ds.byte(context.di+2); context._cmp(context.al, 0); if (!context.flags.z()) goto cantpurge2; - context._cmp(context.data.byte(context.di+12), 255); + context._cmp(context.ds.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge2; deleteexobject(context); return; @@ -8643,7 +8643,7 @@ static void deleteexobject(Context & context) { context.di = 0+2080+30000; context.cx = 0; deleteconts: - context._cmp(context.data.word(context.di+2), context.bx); + context._cmp(context.ds.word(context.di+2), context.bx); if (!context.flags.z()) goto notinsideex; context.push(context.bx); context.push(context.cx); @@ -8667,33 +8667,33 @@ static void deleteexframe(Context & context) { context._add(context.di, context.ax); context._add(context.ax, context.ax); context._add(context.di, context.ax); - context.al = context.data.byte(context.di); + context.al = context.ds.byte(context.di); context.ah = 0; - context.cl = context.data.byte(context.di+1); + context.cl = context.ds.byte(context.di+1); context.ch = 0; context._mul(context.cx); - context.si = context.data.word(context.di+2); + context.si = context.ds.word(context.di+2); context.push(context.si); context._add(context.si, 0+2080); context.cx = 30000; - context._sub(context.cx, context.data.word(context.di+2)); + context._sub(context.cx, context.ds.word(context.di+2)); context.di = context.si; context._add(context.si, context.ax); context.push(context.ax); context.ds = context.es; while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(12), context.bx); + context._sub(context.ds.word(12), context.bx); context.si = context.pop(); context.cx = 114*3; context.di = 0; shuffleadsdown: - context.ax = context.data.word(context.di+2); + context.ax = context.ds.word(context.di+2); context._cmp(context.ax, context.si); if (context.flags.c()) goto beforethisone; context._sub(context.ax, context.bx); beforethisone: - context.data.word(context.di+2) = context.ax; + context.ds.word(context.di+2) = context.ax; context._add(context.di, 6); if (--context.cx) goto shuffleadsdown; return; @@ -8704,14 +8704,14 @@ static void deleteextext(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context._add(context.di, context.ax); - context.ax = context.data.word(context.di); + context.ax = context.ds.word(context.di); context.si = context.ax; context.di = context.ax; context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); context.ax = 0; findlenextext: - context.cl = context.data.byte(context.si); + context.cl = context.ds.byte(context.si); context._add(context.ax, 1); context._add(context.si, 1); context._cmp(context.cl, 0); @@ -8724,17 +8724,17 @@ findlenextext: context._sub(context.cx, context.bx); while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(14), context.bx); + context._sub(context.ds.word(14), context.bx); context.si = context.pop(); context.cx = 114; context.di = 0+2080+30000+(16*114); shuffletextads: - context.ax = context.data.word(context.di); + context.ax = context.ds.word(context.di); context._cmp(context.ax, context.si); if (context.flags.c()) goto beforethistext; context._sub(context.ax, context.bx); beforethistext: - context.data.word(context.di) = context.ax; + context.ds.word(context.di) = context.ax; context._add(context.di, 2); if (--context.cx) goto shuffletextads; return; @@ -8743,7 +8743,7 @@ beforethistext: static void blockget(Context & context) { context.ah = context.al; context.al = 0; - context.ds = context.data.word(416); + context.ds = context.ds.word(416); context.si = 0+192; context._add(context.si, context.ax); return; @@ -8761,7 +8761,7 @@ static void drawfloor(Context & context) { showallex(context); paneltomap(context); initrain(context); - context.data.byte(62) = 0; + context.ds.byte(62) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -8778,8 +8778,8 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(121)); - context.data.word(117) = context.ax; + context._add(context.ax, context.ds.word(121)); + context.ds.word(117) = context.ax; context.dx = context.pop(); context.cx = context.pop(); context.al = 10; @@ -8789,13 +8789,13 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(123)); - context.data.word(119) = context.ax; + context._add(context.ax, context.ds.word(123)); + context.ds.word(119) = context.ax; return; } static void getdimension(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32); context.ch = 0; dimloop1: @@ -8847,14 +8847,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(125) = context.ax; + context.ds.word(125) = context.ax; context.al = context.ch; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(127) = context.ax; + context.ds.word(127) = context.ax; context._sub(context.dl, context.cl); context._sub(context.dh, context.ch); context.al = context.dl; @@ -8863,21 +8863,21 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(128) = context.al; + context.ds.byte(128) = context.al; context.al = context.dh; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(129) = context.al; + context.ds.byte(129) = context.al; return; } static void addalong(Context & context) { context.ah = 11; addloop: - context._cmp(context.data.byte(context.bx), 0); + context._cmp(context.ds.byte(context.bx), 0); if (!context.flags.z()) goto gotalong; context._add(context.bx, 3); context._sub(context.ah, 1); @@ -8892,7 +8892,7 @@ gotalong: static void addlength(Context & context) { context.ah = 10; addloop2: - context._cmp(context.data.byte(context.bx), 0); + context._cmp(context.ds.byte(context.bx), 0); if (!context.flags.z()) goto gotlength; context._add(context.bx, 3*11); context._sub(context.ah, 1); @@ -8905,13 +8905,13 @@ gotlength: } static void drawflags(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.di = 0+(228*13)+32+60+(32*32); - context.al = context.data.byte(149); + context.al = context.ds.byte(149); context.ah = 0; context.cx = 66; context._mul(context.cx); - context.bl = context.data.byte(148); + context.bl = context.ds.byte(148); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -8921,9 +8921,9 @@ _tmp28: context.push(context.cx); context.cx = 11; _tmp28a: - context.ds = context.data.word(418); + context.ds = context.ds.word(418); context._lodsb(); - context.ds = context.data.word(416); + context.ds = context.ds.word(416); context.push(context.si); context.push(context.ax); context.ah = 0; @@ -8942,15 +8942,15 @@ _tmp28a: } static void eraseoldobs(Context & context) { - context._cmp(context.data.byte(62), 0); + context._cmp(context.ds.byte(62), 0); if (context.flags.z()) goto donterase; - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; oberase: context.push(context.cx); context.push(context.bx); - context.ax = context.data.word(context.bx+20); + context.ax = context.ds.word(context.bx+20); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto notthisob; context.di = context.bx; @@ -8967,21 +8967,21 @@ donterase: } static void showallobs(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); - context.data.word(18) = context.bx; + context.ds.word(18) = context.bx; context.di = context.bx; context.cx = 128*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(444); - context.data.word(166) = context.es; + context.es = context.ds.word(444); + context.ds.word(166) = context.es; context.ax = 0; - context.data.word(164) = context.ax; + context.ds.word(164) = context.ax; context.ax = 0+2080; - context.data.word(162) = context.ax; - context.data.byte(181) = 0; - context.ds = context.data.word(428); + context.ds.word(162) = context.ax; + context.ds.byte(181) = 0; + context.ds = context.ds.word(428); context.si = 0; context.cx = 128; showobsloop: @@ -8989,14 +8989,14 @@ showobsloop: context.push(context.si); context.push(context.si); context._add(context.si, 58); - context.es = context.data.word(428); + context.es = context.ds.word(428); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankframe; - context.al = context.data.byte(context.si+18); + context.al = context.ds.byte(context.si+18); context.ah = 0; - context.data.word(160) = context.ax; + context.ds.word(160) = context.ax; context._cmp(context.al, 255); if (context.flags.z()) goto blankframe; context.push(context.es); @@ -9005,39 +9005,39 @@ showobsloop: finalframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.data.byte(context.si+18); - context.data.byte(context.si+17) = context.al; - context._cmp(context.data.byte(context.si+8), 0); + context.al = context.ds.byte(context.si+18); + context.ds.byte(context.si+17) = context.al; + context._cmp(context.ds.byte(context.si+8), 0); if (!context.flags.z()) goto animating; - context._cmp(context.data.byte(context.si+5), 5); + context._cmp(context.ds.byte(context.si+5), 5); if (context.flags.z()) goto animating; - context._cmp(context.data.byte(context.si+5), 6); + context._cmp(context.ds.byte(context.si+5), 6); if (context.flags.z()) goto animating; - context.ax = context.data.word(160); + context.ax = context.ds.word(160); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.ds.word(117)); + context._add(context.bx, context.ds.word(119)); showframe(context); goto drawnsetob; animating: makebackob(context); drawnsetob: - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; + context.si = context.ds.word(18); + context.es = context.ds.word(412); + context.al = context.ds.byte(179); + context.ah = context.ds.byte(180); + context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.ds.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; - context.al = context.data.byte(181); - context.data.byte(context.si+4) = context.al; + context.ds.word(context.si+2) = context.ax; + context.al = context.ds.byte(181); + context.ds.byte(context.si+4) = context.al; context._add(context.si, 5); - context.data.word(18) = context.si; + context.ds.word(18) = context.si; blankframe: - context._add(context.data.byte(181), 1); + context._add(context.ds.byte(181), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 64); @@ -9049,106 +9049,106 @@ finishedsetobs: } static void makebackob(Context & context) { - context._cmp(context.data.byte(62), 0); + context._cmp(context.ds.byte(62), 0); if (context.flags.z()) goto nomake; - context.al = context.data.byte(context.si+5); - context.ah = context.data.byte(context.si+8); + context.al = context.ds.byte(context.si+5); + context.ah = context.ds.byte(context.si+8); context.push(context.si); context.push(context.ax); context.push(context.si); - context.ax = context.data.word(168); - context.bx = context.data.word(170); + context.ax = context.ds.word(168); + context.bx = context.ds.word(170); context.ah = context.bl; context.si = context.ax; context.cx = 49520; - context.dx = context.data.word(444); + context.dx = context.ds.word(444); context.di = 0; makesprite(context); context.ax = context.pop(); - context.data.word(context.bx+20) = context.ax; + context.ds.word(context.bx+20) = context.ax; context.ax = context.pop(); context._cmp(context.al, 255); if (!context.flags.z()) goto usedpriority; context.al = 0; usedpriority: - context.data.byte(context.bx+23) = context.al; - context.data.byte(context.bx+30) = context.ah; - context.data.byte(context.bx+16) = 0; - context.data.byte(context.bx+18) = 0; - context.data.byte(context.bx+19) = 0; + context.ds.byte(context.bx+23) = context.al; + context.ds.byte(context.bx+30) = context.ah; + context.ds.byte(context.bx+16) = 0; + context.ds.byte(context.bx+18) = 0; + context.ds.byte(context.bx+19) = 0; context.si = context.pop(); nomake: return; } static void showallfree(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.data.word(18) = context.bx; + context.ds.word(18) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); context.cx = 80*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(446); - context.data.word(166) = context.es; + context.es = context.ds.word(446); + context.ds.word(166) = context.es; context.ax = 0; - context.data.word(164) = context.ax; + context.ds.word(164) = context.ax; context.ax = 0+2080; - context.data.word(162) = context.ax; + context.ds.word(162) = context.ax; context.al = 0; - context.data.byte(158) = context.al; - context.ds = context.data.word(426); + context.ds.byte(158) = context.al; + context.ds = context.ds.word(426); context.si = 2; context.cx = 0; loop127: context.push(context.cx); context.push(context.si); context.push(context.si); - context.es = context.data.word(426); + context.es = context.ds.word(426); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto over138; - context.al = context.data.byte(158); + context.al = context.ds.byte(158); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(160) = context.ax; + context.ds.word(160) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); + context.es = context.ds.word(402); + context.ds = context.ds.word(166); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto over138; - context.ax = context.data.word(160); + context.ax = context.ds.word(160); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.ds.word(117)); + context._add(context.bx, context.ds.word(119)); showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; + context.si = context.ds.word(18); + context.es = context.ds.word(412); + context.al = context.ds.byte(179); + context.ah = context.ds.byte(180); + context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.ds.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; + context.ds.word(context.si+2) = context.ax; context.ax = context.pop(); context.cx = context.pop(); context.push(context.cx); context.push(context.ax); - context.data.byte(context.si+4) = context.cl; + context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(18) = context.si; + context.ds.word(18) = context.si; over138: - context._add(context.data.byte(158), 1); + context._add(context.ds.byte(158), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9161,78 +9161,78 @@ finfree: } static void showallex(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.data.word(18) = context.bx; + context.ds.word(18) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); context.cx = 100*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(398); - context.data.word(166) = context.es; + context.es = context.ds.word(398); + context.ds.word(166) = context.es; context.ax = 0; - context.data.word(164) = context.ax; + context.ds.word(164) = context.ax; context.ax = 0+2080; - context.data.word(162) = context.ax; - context.data.byte(157) = 0; + context.ds.word(162) = context.ax; + context.ds.byte(157) = 0; context.si = 0+2080+30000+2; context.cx = 0; exloop: context.push(context.cx); context.push(context.si); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.push(context.si); context.ch = 0; - context._cmp(context.data.byte(context.si), 255); + context._cmp(context.ds.byte(context.si), 255); if (context.flags.z()) goto notinroom; - context.al = context.data.byte(context.si-2); - context._cmp(context.al, context.data.byte(184)); + context.al = context.ds.byte(context.si-2); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto notinroom; getmapad(context); notinroom: context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankex; - context.al = context.data.byte(157); + context.al = context.ds.byte(157); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(160) = context.ax; + context.ds.word(160) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); + context.es = context.ds.word(402); + context.ds = context.ds.word(166); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto blankex; - context.ax = context.data.word(160); + context.ax = context.ds.word(160); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.ds.word(117)); + context._add(context.bx, context.ds.word(119)); showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); - context.data.word(context.si) = context.ax; + context.si = context.ds.word(18); + context.es = context.ds.word(412); + context.al = context.ds.byte(179); + context.ah = context.ds.byte(180); + context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.ds.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.data.word(context.si+2) = context.ax; + context.ds.word(context.si+2) = context.ax; context.ax = context.pop(); context.cx = context.pop(); context.push(context.cx); context.push(context.ax); - context.data.byte(context.si+4) = context.cl; + context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(18) = context.si; + context.ds.word(18) = context.si; blankex: - context._add(context.data.byte(157), 1); + context._add(context.ds.byte(157), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9245,49 +9245,49 @@ finex: } static void calcfrframe(Context & context) { - context.dx = context.data.word(166); - context.ax = context.data.word(162); + context.dx = context.ds.word(166); + context.ax = context.ds.word(162); context.push(context.ax); - context.cx = context.data.word(164); - context.ax = context.data.word(160); + context.cx = context.ds.word(164); + context.ax = context.ds.word(160); context.ds = context.dx; context.bx = 6; context._mul(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.cx = context.data.word(context.bx); - context.ax = context.data.word(context.bx+2); - context.dx = context.data.word(context.bx+4); + context.cx = context.ds.word(context.bx); + context.ax = context.ds.word(context.bx+2); + context.dx = context.ds.word(context.bx+4); context.bx = context.pop(); context.push(context.dx); context._add(context.ax, context.bx); - context.data.word(178) = context.ax; - context.data.word(176) = context.cx; + context.ds.word(178) = context.ax; + context.ds.word(176) = context.cx; context.ax = context.pop(); context.push(context.ax); context.ah = 0; - context.data.word(172) = context.ax; + context.ds.word(172) = context.ax; context.ax = context.pop(); context.al = context.ah; context.ah = 0; - context.data.word(174) = context.ax; + context.ds.word(174) = context.ax; return; nullframe: context.ax = context.pop(); context.cx = 0; - context.data.word(176) = context.cx; + context.ds.word(176) = context.cx; return; } static void finalframe(Context & context) { - context.ax = context.data.word(170); - context._add(context.ax, context.data.word(174)); - context.bx = context.data.word(168); - context._add(context.bx, context.data.word(172)); - context.data.byte(179) = context.bl; - context.data.byte(180) = context.al; - context.di = context.data.word(168); - context.bx = context.data.word(170); + context.ax = context.ds.word(170); + context._add(context.ax, context.ds.word(174)); + context.bx = context.ds.word(168); + context._add(context.bx, context.ds.word(172)); + context.ds.byte(179) = context.bl; + context.ds.byte(180) = context.al; + context.di = context.ds.word(168); + context.bx = context.ds.word(170); return; } @@ -9307,26 +9307,26 @@ static void getmapad(Context & context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(168) = context.ax; + context.ds.word(168) = context.ax; getyad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(170) = context.ax; + context.ds.word(170) = context.ax; context.ch = 1; over146: return; } static void getxad(Context & context) { - context.cl = context.data.byte(context.si); + context.cl = context.ds.byte(context.si); context._add(context.si, 1); - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); - context.ah = context.data.byte(context.si); + context.ah = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; - context._sub(context.al, context.data.byte(148)); + context._sub(context.al, context.ds.byte(148)); if (context.flags.c()) goto over148; context._cmp(context.al, 11); if (!context.flags.c()) goto over148; @@ -9342,11 +9342,11 @@ over148: } static void getyad(Context & context) { - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); - context.ah = context.data.byte(context.si); + context.ah = context.ds.byte(context.si); context._add(context.si, 1); - context._sub(context.al, context.data.byte(149)); + context._sub(context.al, context.ds.byte(149)); if (context.flags.c()) goto over147; context._cmp(context.al, 10); if (!context.flags.c()) goto over147; @@ -9362,40 +9362,40 @@ over147: } static void autolook(Context & context) { - context.ax = context.data.word(198); - context._cmp(context.ax, context.data.word(214)); + context.ax = context.ds.word(198); + context._cmp(context.ax, context.ds.word(214)); if (!context.flags.z()) goto diffmouse; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(216)); + context.ax = context.ds.word(200); + context._cmp(context.ax, context.ds.word(216)); if (!context.flags.z()) goto diffmouse; - context._sub(context.data.word(98), 1); - context._cmp(context.data.word(98), 0); + context._sub(context.ds.word(98), 1); + context._cmp(context.ds.word(98), 0); if (!context.flags.z()) goto noautolook; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto noautolook; dolook(context); noautolook: return; diffmouse: - context.data.word(98) = 1000; + context.ds.word(98) = 1000; return; } static void look(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.ds.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 241); + context._cmp(context.ds.byte(100), 241); if (context.flags.z()) goto alreadylook; - context.data.byte(100) = 241; + context.ds.byte(100) = 241; context.al = 25; commandonly(context); alreadylook: - context._cmp(context.data.word(202), 1); + context._cmp(context.ds.word(202), 1); if (!context.flags.z()) goto nolook; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nolook; dolook(context); nolook: @@ -9407,19 +9407,19 @@ static void dolook(Context & context) { showicon(context); undertextline(context); worktoscreenm(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; dumptextline(context); - context.bl = context.data.byte(185); + context.bl = context.ds.byte(185); context._and(context.bl, 31); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(436); + context.es = context.ds.word(436); context._add(context.bx, 0); - context.si = context.data.word(context.bx); + context.si = context.ds.word(context.bx); context._add(context.si, 0+(38*2)); findnextcolon(context); context.di = 66; - context._cmp(context.data.byte(184), 50); + context._cmp(context.ds.byte(184), 50); if (context.flags.c()) goto notdream3; context.di = 40; notdream3: @@ -9431,17 +9431,17 @@ notdream3: context.cx = 400; hangonp(context); afterlook: - context.data.byte(234) = 0; - context.data.byte(100) = 0; + context.ds.byte(234) = 0; + context.ds.byte(100) = 0; redrawmainscrn(context); worktoscreenm(context); return; } static void redrawmainscrn(Context & context) { - context.data.word(328) = 0; + context.ds.word(328) = 0; createpanel(context); - context.data.byte(62) = 0; + context.ds.byte(62) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -9449,40 +9449,40 @@ static void redrawmainscrn(Context & context) { getunderzoom(context); undertextline(context); readmouse(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; return; } static void getback1(Context & context) { - context._cmp(context.data.byte(106), 0); + context._cmp(context.ds.byte(106), 0); if (context.flags.z()) goto notgotobject; blank(context); return; notgotobject: - context._cmp(context.data.byte(100), 202); + context._cmp(context.ds.byte(100), 202); if (context.flags.z()) goto alreadyget; - context.data.byte(100) = 202; + context.ds.byte(100) = 202; context.al = 26; commandonly(context); alreadyget: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nogetback; context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: return; dogetback: - context.data.byte(103) = 1; - context.data.byte(106) = 0; + context.ds.byte(103) = 1; + context.ds.byte(106) = 0; return; } static void talk(Context & context) { - context.data.byte(246) = 0; - context.data.byte(237) = 0; - context.al = context.data.byte(99); - context.data.byte(247) = context.al; + context.ds.byte(246) = 0; + context.ds.byte(237) = 0; + context.al = context.ds.byte(99); + context.ds.byte(247) = context.al; createpanel(context); showpanel(context); showman(context); @@ -9490,7 +9490,7 @@ static void talk(Context & context) { undertextline(context); convicons(context); starttalk(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -9502,41 +9502,41 @@ waittalk: vsync(context); dumppointer(context); dumptextline(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; context.bx = 2660; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto waittalk; finishtalk: - context.bx = context.data.word(249); + context.bx = context.ds.word(249); context.es = context.cs; - context._cmp(context.data.byte(246), 4); + context._cmp(context.ds.byte(246), 4); if (context.flags.c()) goto notnexttalk; - context.al = context.data.byte(context.bx+7); + context.al = context.ds.byte(context.bx+7); context._or(context.al, 128); - context.data.byte(context.bx+7) = context.al; + context.ds.byte(context.bx+7) = context.al; notnexttalk: redrawmainscrn(context); worktoscreenm(context); - context._cmp(context.data.byte(383), 1); + context._cmp(context.ds.byte(383), 1); if (!context.flags.z()) goto nospeech; cancelch1(context); - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.ds.byte(388) = -1; + context.ds.byte(387) = 0; nospeech: return; } static void convicons(Context & context) { - context.al = context.data.byte(247); + context.al = context.ds.byte(247); context._and(context.al, 127); getpersframe(context); context.di = 234; context.bx = 2; - context.data.word(160) = context.ax; + context.ds.word(160) = context.ax; findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.ds.word(160); + context._sub(context.ax, context.ds.word(244)); context.ah = 0; showframe(context); return; @@ -9546,25 +9546,25 @@ static void getpersframe(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(448); + context.es = context.ds.word(448); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); return; } static void starttalk(Context & context) { - context.data.byte(245) = 0; - context.al = context.data.byte(247); + context.ds.byte(245) = 0; + context.al = context.ds.byte(247); context._and(context.al, 127); getpersontext(context); - context.data.word(71) = 91+91; + context.ds.word(71) = 91+91; context.di = 66; context.bx = 64; context.dl = 241; context.al = 0; context.ah = 79; printdirect(context); - context.data.word(71) = 0; + context.ds.word(71) = 0; context.di = 66; context.bx = 80; context.dl = 241; @@ -9580,40 +9580,40 @@ static void getpersontext(Context & context) { context.cx = 64*2; context._mul(context.cx); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.ds.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; return; } static void moretalk(Context & context) { - context._cmp(context.data.byte(245), 0); + context._cmp(context.ds.byte(245), 0); if (context.flags.z()) goto canmore; redes(context); return; canmore: - context._cmp(context.data.byte(100), 215); + context._cmp(context.ds.byte(100), 215); if (context.flags.z()) goto alreadymore; - context.data.byte(100) = 215; + context.ds.byte(100) = 215; context.al = 49; commandonly(context); alreadymore: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nomore; context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: return; domoretalk: - context.data.byte(245) = 2; - context.data.byte(246) = 4; - context._cmp(context.data.byte(247), 100); + context.ds.byte(245) = 2; + context.ds.byte(246) = 4; + context._cmp(context.ds.byte(247), 100); if (context.flags.c()) goto notsecondpart; - context.data.byte(246) = 48; + context.ds.byte(246) = 48; notsecondpart: dosometalk(context); return; @@ -9621,25 +9621,25 @@ notsecondpart: static void dosometalk(Context & context) { watchtalk: - context.al = context.data.byte(246); - context.al = context.data.byte(247); + context.al = context.ds.byte(246); + context.al = context.ds.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(246); + context.al = context.ds.byte(246); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.ds.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - context._cmp(context.data.byte(context.si), 0); + context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto endwatchtalk; context.push(context.es); context.push(context.si); @@ -9656,34 +9656,34 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(234) = 3; + context.ds.byte(234) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); - context._add(context.data.byte(246), 1); - context.al = context.data.byte(246); - context.al = context.data.byte(247); + context._add(context.ds.byte(246), 1); + context.al = context.ds.byte(246); + context.al = context.ds.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(246); + context.al = context.ds.byte(246); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.ds.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - context._cmp(context.data.byte(context.si), 0); + context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto endwatchtalk; - context._cmp(context.data.byte(context.si), ':'); + context._cmp(context.ds.byte(context.si), ':'); if (context.flags.z()) goto skiptalk; - context._cmp(context.data.byte(context.si), 32); + context._cmp(context.ds.byte(context.si), 32); if (context.flags.z()) goto skiptalk; context.push(context.es); context.push(context.si); @@ -9700,20 +9700,20 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(234) = 3; + context.ds.byte(234) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); skiptalk: - context._add(context.data.byte(246), 1); + context._add(context.ds.byte(246), 1); goto watchtalk; endwatchtalk: - context.data.byte(234) = 0; + context.ds.byte(234) = 0; return; } static void hangonpq(Context & context) { - context.data.byte(103) = 0; + context.ds.byte(103) = 0; context.bx = 0; hangloopq: context.push(context.cx); @@ -9729,48 +9729,48 @@ hangloopq: checkcoords(context); context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (context.flags.z()) goto quitconv; - context._cmp(context.data.byte(383), 1); + context._cmp(context.ds.byte(383), 1); if (!context.flags.z()) goto notspeaking; - context._cmp(context.data.byte(515), 255); + context._cmp(context.ds.byte(515), 255); if (!context.flags.z()) goto notspeaking; context._add(context.bx, 1); context._cmp(context.bx, 40); if (context.flags.z()) goto finishconv; notspeaking: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto hangloopq; - context._cmp(context.data.word(212), 0); + context._cmp(context.ds.word(212), 0); if (!context.flags.z()) goto hangloopq; finishconv: delpointer(context); - context.data.byte(234) = 0; + context.ds.byte(234) = 0; return; quitconv: delpointer(context); - context.data.byte(234) = 0; + context.ds.byte(234) = 0; context.ax = context.pop(); cancelch1(context); return; } static void redes(Context & context) { - context._cmp(context.data.byte(515), 255); + context._cmp(context.ds.byte(515), 255); if (!context.flags.z()) goto cantredes; - context._cmp(context.data.byte(245), 2); + context._cmp(context.ds.byte(245), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); return; canredes: - context._cmp(context.data.byte(100), 217); + context._cmp(context.ds.byte(100), 217); if (context.flags.z()) goto alreadyreds; - context.data.byte(100) = 217; + context.ds.byte(100) = 217; context.al = 50; commandonly(context); alreadyreds: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; return; @@ -9790,27 +9790,27 @@ doredes: } static void newplace(Context & context) { - context._cmp(context.data.byte(60), 1); + context._cmp(context.ds.byte(60), 1); if (context.flags.z()) goto istravel; - context._cmp(context.data.byte(189), -1); + context._cmp(context.ds.byte(189), -1); if (!context.flags.z()) goto isautoloc; return; isautoloc: - context.al = context.data.byte(189); - context.data.byte(188) = context.al; - context.data.byte(189) = -1; + context.al = context.ds.byte(189); + context.ds.byte(188) = context.al; + context.ds.byte(189) = -1; return; istravel: - context.data.byte(60) = 0; + context.ds.byte(60) = 0; selectlocation(context); return; } static void selectlocation(Context & context) { - context.data.byte(237) = 0; + context.ds.byte(237) = 0; clearbeforeload(context); - context.data.byte(103) = 0; - context.data.byte(231) = 22; + context.ds.byte(103) = 0; + context.ds.byte(231) = 22; readcitypic(context); showcity(context); getridoftemp(context); @@ -9822,15 +9822,15 @@ static void selectlocation(Context & context) { showexit(context); locationpic(context); undertextline(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); - context.data.byte(231) = 0; + context.ds.byte(231) = 0; showpointer(context); worktoscreen(context); context.al = 9; context.ah = 255; playchannel0(context); - context.data.byte(188) = 255; + context.ds.byte(188) = 255; select: delpointer(context); readmouse(context); @@ -9838,42 +9838,42 @@ select: vsync(context); dumppointer(context); dumptextline(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (context.flags.z()) goto quittravel; context.bx = 2714; checkcoords(context); - context._cmp(context.data.byte(188), 255); + context._cmp(context.ds.byte(188), 255); if (context.flags.z()) goto select; - context.al = context.data.byte(188); - context._cmp(context.al, context.data.byte(9)); + context.al = context.ds.byte(188); + context._cmp(context.al, context.ds.byte(9)); if (context.flags.z()) goto quittravel; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(456); + context.es = context.ds.word(456); deallocatemem(context); return; quittravel: - context.al = context.data.byte(184); - context.data.byte(188) = context.al; - context.data.byte(103) = 0; + context.al = context.ds.byte(184); + context.ds.byte(188) = context.al; + context.ds.byte(103) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(456); + context.es = context.ds.word(456); deallocatemem(context); return; } static void showcity(Context & context) { clearwork(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 57; context.bx = 32; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 120+57; context.bx = 32; context.al = 1; @@ -9883,25 +9883,25 @@ static void showcity(Context & context) { } static void lookatplace(Context & context) { - context._cmp(context.data.byte(100), 224); + context._cmp(context.ds.byte(100), 224); if (context.flags.z()) goto alreadyinfo; - context.data.byte(100) = 224; + context.ds.byte(100) = 224; context.al = 27; commandonly(context); alreadyinfo: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noinfo; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noinfo; - context.bl = context.data.byte(183); + context.bl = context.ds.byte(183); context._cmp(context.bl, 15); if (!context.flags.c()) goto noinfo; context.push(context.bx); delpointer(context); deltextline(context); getundercentre(context); - context.ds = context.data.word(462); + context.ds = context.ds.word(462); context.al = 0; context.ah = 0; context.di = 60; @@ -9920,8 +9920,8 @@ alreadyinfo: context.bx = context.pop(); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(456); - context.si = context.data.word(context.bx); + context.es = context.ds.word(456); + context.si = context.ds.word(context.bx); context._add(context.si, 66*2); findnextcolon(context); context.di = 63; @@ -9934,8 +9934,8 @@ alreadyinfo: context.cx = 500; hangonp(context); afterinfo: - context.data.byte(234) = 0; - context.data.byte(231) = 0; + context.ds.byte(234) = 0; + context.ds.byte(231) = 0; putundercentre(context); worktoscreenm(context); noinfo: @@ -9945,7 +9945,7 @@ noinfo: static void getundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; context.cl = 254; context.ch = 110; @@ -9956,7 +9956,7 @@ static void getundercentre(Context & context) { static void putundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; context.cl = 254; context.ch = 110; @@ -9966,18 +9966,18 @@ static void putundercentre(Context & context) { static void locationpic(Context & context) { getdestinfo(context); - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context.push(context.es); context.push(context.si); context.di = 0; context._cmp(context.al, 6); if (!context.flags.c()) goto secondlot; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context._add(context.al, 4); goto gotgraphic; secondlot: context._sub(context.al, 6); - context.ds = context.data.word(460); + context.ds = context.ds.word(460); gotgraphic: context._add(context.di, 104); context.bx = 138+14; @@ -9985,21 +9985,21 @@ gotgraphic: showframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.data.byte(183); - context._cmp(context.al, context.data.byte(184)); + context.al = context.ds.byte(183); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto notinthisone; context.al = 3; context.di = 104; context.bx = 140+14; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 0; showframe(context); notinthisone: - context.bl = context.data.byte(183); + context.bl = context.ds.byte(183); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(456); - context.si = context.data.word(context.bx); + context.es = context.ds.word(456); + context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 50; context.bx = 20; @@ -10011,14 +10011,14 @@ notinthisone: } static void getdestinfo(Context & context) { - context.al = context.data.byte(183); + context.al = context.ds.byte(183); context.ah = 0; context.push(context.ax); context.dx = context.ds; context.es = context.dx; context.si = 7798; context._add(context.si, context.ax); - context.cl = context.data.byte(context.si); + context.cl = context.ds.byte(context.si); context.ax = context.pop(); context.push(context.cx); context.dx = context.ds; @@ -10032,19 +10032,19 @@ static void getdestinfo(Context & context) { static void showarrows(Context & context) { context.di = 116-12; context.bx = 16; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 0; context.ah = 0; showframe(context); context.di = 226+12; context.bx = 16; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 280; context.bx = 14; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 2; context.ah = 0; showframe(context); @@ -10053,27 +10053,27 @@ static void showarrows(Context & context) { static void nextdest(Context & context) { duok: - context._cmp(context.data.byte(100), 218); + context._cmp(context.ds.byte(100), 218); if (context.flags.z()) goto alreadydu; - context.data.byte(100) = 218; + context.ds.byte(100) = 218; context.al = 28; commandonly(context); alreadydu: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto nodu; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nodu; searchdestup: - context._add(context.data.byte(183), 1); - context._cmp(context.data.byte(183), 15); + context._add(context.ds.byte(183), 1); + context._cmp(context.ds.byte(183), 15); if (!context.flags.z()) goto notlastdest; - context.data.byte(183) = 0; + context.ds.byte(183) = 0; notlastdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestup; - context.data.byte(109) = 1; + context.ds.byte(109) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10091,27 +10091,27 @@ nodu: static void lastdest(Context & context) { ddok: - context._cmp(context.data.byte(100), 219); + context._cmp(context.ds.byte(100), 219); if (context.flags.z()) goto alreadydd; - context.data.byte(100) = 219; + context.ds.byte(100) = 219; context.al = 29; commandonly(context); alreadydd: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto nodd; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nodd; searchdestdown: - context._sub(context.data.byte(183), 1); - context._cmp(context.data.byte(183), -1); + context._sub(context.ds.byte(183), 1); + context._cmp(context.ds.byte(183), -1); if (!context.flags.z()) goto notfirstdest; - context.data.byte(183) = 15; + context.ds.byte(183) = 15; notfirstdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestdown; - context.data.byte(109) = 1; + context.ds.byte(109) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10128,20 +10128,20 @@ nodd: } static void destselect(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadytrav; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 30; commandonly(context); alreadytrav: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto notrav; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notrav; getdestinfo(context); - context.al = context.data.byte(183); - context.data.byte(188) = context.al; + context.al = context.ds.byte(183); + context.ds.byte(188) = context.al; notrav: return; } @@ -10152,7 +10152,7 @@ static void getlocation(Context & context) { context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7798); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); return; } @@ -10162,7 +10162,7 @@ static void setlocation(Context & context) { context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7798); - context.data.byte(context.bx) = 1; + context.ds.byte(context.bx) = 1; return; } @@ -10209,7 +10209,7 @@ clearedlocations: context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7798); - context.data.byte(context.bx) = 0; + context.ds.byte(context.bx) = 0; return; } @@ -10230,7 +10230,7 @@ static void readcitypic(Context & context) { } static void usemon(Context & context) { - context.data.byte(55) = 0; + context.ds.byte(55) = 0; context.es = context.cs; context.di = 2895+1; context.cx = 12; @@ -10243,11 +10243,11 @@ static void usemon(Context & context) { while(--context.cx) context._stosb(); context.es = context.cs; context.di = 2807; - context.data.byte(context.di) = 1; + context.ds.byte(context.di) = 1; context._add(context.di, 26); context.cx = 3; keyloop: - context.data.byte(context.di) = 0; + context.ds.byte(context.di) = 0; context._add(context.di, 26); if (--context.cx) goto keyloop; createpanel(context); @@ -10269,8 +10269,8 @@ keyloop: turnonpower(context); fadeupyellows(context); fadeupmonfirst(context); - context.data.word(318) = 76; - context.data.word(320) = 141; + context.ds.word(318) = 76; + context.ds.word(320) = 141; context.al = 1; monmessage(context); context.cx = 120; @@ -10285,34 +10285,34 @@ keyloop: hangoncurs(context); printlogo(context); scrollmonitor(context); - context.data.word(394) = 0; - context.data.word(396) = 0; + context.ds.word(394) = 0; + context.ds.word(396) = 0; moreinput: - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; + context.ds.word(318) = context.di; + context.ds.word(320) = context.bx; execcommand(context); context._cmp(context.al, 0); if (context.flags.z()) goto moreinput; endmon: getridoftemp(context); getridoftempcharset(context); - context.es = context.data.word(466); + context.es = context.ds.word(466); deallocatemem(context); - context.es = context.data.word(468); + context.es = context.ds.word(468); deallocatemem(context); - context.es = context.data.word(470); + context.es = context.ds.word(470); deallocatemem(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; context.al = 26; playchannel1(context); - context.data.byte(131) = 0; + context.ds.byte(131) = 0; restoreall(context); redrawmainscrn(context); worktoscreenm(context); @@ -10322,25 +10322,25 @@ endmon: static void printoutermon(Context & context) { context.di = 40; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 264; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 2; context.ah = 0; showframe(context); context.di = 40; context.bx = 12; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 3; context.ah = 0; showframe(context); context.di = 40; context.bx = 164; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 4; context.ah = 0; showframe(context); @@ -10348,7 +10348,7 @@ static void printoutermon(Context & context) { } static void loadpersonal(Context & context) { - context.al = context.data.byte(9); + context.al = context.ds.byte(9); context.dx = 2065; context._cmp(context.al, 0); if (context.flags.z()) goto foundpersonal; @@ -10360,12 +10360,12 @@ static void loadpersonal(Context & context) { foundpersonal: openfile(context); readheader(context); - context.bx = context.data.word(context.di); + context.bx = context.ds.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(466) = context.ax; + context.ds.word(466) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10375,7 +10375,7 @@ foundpersonal: } static void loadnews(Context & context) { - context.al = context.data.byte(34); + context.al = context.ds.byte(34); context.dx = 2091; context._cmp(context.al, 0); if (context.flags.z()) goto foundnews; @@ -10389,12 +10389,12 @@ static void loadnews(Context & context) { foundnews: openfile(context); readheader(context); - context.bx = context.data.word(context.di); + context.bx = context.ds.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(468) = context.ax; + context.ds.word(468) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10421,12 +10421,12 @@ static void loadcart(Context & context) { gotcart: openfile(context); readheader(context); - context.bx = context.data.word(context.di); + context.bx = context.ds.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(470) = context.ax; + context.ds.word(470) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10445,7 +10445,7 @@ static void lookininterface(Context & context) { checkinside(context); context._cmp(context.cl, 114); if (context.flags.z()) goto emptyinterface; - context.al = context.data.byte(context.bx+15); + context.al = context.ds.byte(context.bx+15); context._add(context.al, 1); return; emptyinterface: @@ -10492,7 +10492,7 @@ chosenaccess: static void powerlighton(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 6; context.ah = 0; context.push(context.di); @@ -10509,7 +10509,7 @@ static void powerlighton(Context & context) { static void powerlightoff(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 5; context.ah = 0; context.push(context.di); @@ -10526,7 +10526,7 @@ static void powerlightoff(Context & context) { static void accesslighton(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 8; context.ah = 0; context.push(context.di); @@ -10543,7 +10543,7 @@ static void accesslighton(Context & context) { static void accesslightoff(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 7; context.ah = 0; context.push(context.di); @@ -10560,7 +10560,7 @@ static void accesslightoff(Context & context) { static void locklighton(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 10; context.ah = 0; context.push(context.di); @@ -10577,7 +10577,7 @@ static void locklighton(Context & context) { static void locklightoff(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 9; context.ah = 0; context.push(context.di); @@ -10597,62 +10597,62 @@ static void input(Context & context) { context.cx = 64; context.al = 0; while(--context.cx) context._stosb(); - context.data.word(316) = 0; + context.ds.word(316) = 0; context.al = '>'; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); + context.ds = context.ds.word(406); context.ah = 0; printchar(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); context.cl = 6; context.ch = 8; multidump(context); - context._add(context.data.word(318), 6); - context.ax = context.data.word(318); - context.data.word(312) = context.ax; - context.ax = context.data.word(320); - context.data.word(314) = context.ax; + context._add(context.ds.word(318), 6); + context.ax = context.ds.word(318); + context.ds.word(312) = context.ax; + context.ax = context.ds.word(320); + context.ds.word(314) = context.ax; waitkey: printcurs(context); vsync(context); delcurs(context); readkey(context); - context.al = context.data.byte(142); + context.al = context.ds.byte(142); context._cmp(context.al, 0); if (context.flags.z()) goto waitkey; context._cmp(context.al, 13); if (context.flags.z()) goto endofinput; context._cmp(context.al, 8); if (!context.flags.z()) goto notdel; - context._cmp(context.data.word(316), 0); + context._cmp(context.ds.word(316), 0); if (context.flags.z()) goto waitkey; delchar(context); goto waitkey; notdel: - context._cmp(context.data.word(316), 28); + context._cmp(context.ds.word(316), 28); if (context.flags.z()) goto waitkey; - context._cmp(context.data.byte(142), 32); + context._cmp(context.ds.byte(142), 32); if (!context.flags.z()) goto notleadingspace; - context._cmp(context.data.word(316), 0); + context._cmp(context.ds.word(316), 0); if (context.flags.z()) goto waitkey; notleadingspace: makecaps(context); context.es = context.cs; - context.si = context.data.word(316); + context.si = context.ds.word(316); context._add(context.si, context.si); context._add(context.si, 7944); - context.data.byte(context.si) = context.al; + context.ds.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); if (!context.flags.c()) goto waitkey; context.push(context.ax); context.push(context.es); context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); + context.ds = context.ds.word(402); + context.ax = context.ds.word(316); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; @@ -10663,18 +10663,18 @@ notleadingspace: context.ax = context.pop(); context.push(context.es); context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); + context.ds = context.ds.word(406); context.ah = 0; printchar(context); context.si = context.pop(); context.es = context.pop(); - context.data.byte(context.si+1) = context.cl; + context.ds.byte(context.si+1) = context.cl; context.ch = 0; - context._add(context.data.word(318), context.cx); - context._add(context.data.word(316), 1); - context._add(context.data.word(312), context.cx); + context._add(context.ds.word(318), context.cx); + context._add(context.ds.word(316), 1); + context._add(context.ds.word(312), context.cx); goto waitkey; endofinput: return; @@ -10689,27 +10689,27 @@ notupperc: } static void delchar(Context & context) { - context._sub(context.data.word(316), 1); - context.si = context.data.word(316); + context._sub(context.ds.word(316), 1); + context.si = context.ds.word(316); context._add(context.si, context.si); context.es = context.cs; context._add(context.si, 7944); - context.data.byte(context.si) = 0; - context.al = context.data.byte(context.si+1); - context.ah = 0; - context._sub(context.data.word(318), context.ax); - context._sub(context.data.word(312), context.ax); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); + context.ds.byte(context.si) = 0; + context.al = context.ds.byte(context.si+1); + context.ah = 0; + context._sub(context.ds.word(318), context.ax); + context._sub(context.ds.word(312), context.ax); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); + context.ds = context.ds.word(402); + context.ax = context.ds.word(316); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; context.ch = 8; multiput(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); context.cl = context.al; context.ch = 8; multidump(context); @@ -10721,7 +10721,7 @@ static void execcommand(Context & context) { context.bx = 2776; context.ds = context.cs; context.si = 7944; - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; scrollmonitor(context); @@ -10732,9 +10732,9 @@ comloop: context.push(context.bx); context.push(context.si); comloop2: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 2); - context.ah = context.data.byte(context.bx); + context.ah = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.ah, 32); if (context.flags.z()) goto foundcom; @@ -10800,12 +10800,12 @@ static void dircom(Context & context) { context.cx = 30; randomaccess(context); parser(context); - context._cmp(context.data.byte(context.di+1), 0); + context._cmp(context.ds.byte(context.di+1), 0); if (context.flags.z()) goto dirroot; dirfile(context); return; dirroot: - context.data.byte(269) = 0; + context.ds.byte(269) = 0; context.ds = context.cs; context.si = 2885; context._add(context.si, 1); @@ -10818,11 +10818,11 @@ dirroot: scrollmonitor(context); context.al = 9; monmessage(context); - context.es = context.data.word(466); + context.es = context.ds.word(466); searchforfiles(context); - context.es = context.data.word(468); + context.es = context.ds.word(468); searchforfiles(context); - context.es = context.data.word(470); + context.es = context.ds.word(470); searchforfiles(context); scrollmonitor(context); return; @@ -10831,7 +10831,7 @@ dirroot: static void searchforfiles(Context & context) { context.bx = 66*2; directloop1: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, '*'); if (context.flags.z()) goto endofdir; @@ -10860,7 +10860,7 @@ signonloop2: context._cmp(context.al, 32); if (context.flags.z()) goto foundsign; makecaps(context); - context.ah = context.data.byte(context.di); + context.ah = context.ds.byte(context.di); context._add(context.di, 1); context._cmp(context.al, context.ah); if (!context.flags.z()) goto nomatch; @@ -10880,7 +10880,7 @@ foundsign: context.cx = context.pop(); context.bx = context.si; context.es = context.ds; - context._cmp(context.data.byte(context.bx), 0); + context._cmp(context.ds.byte(context.bx), 0); if (context.flags.z()) goto notyetassigned; context.al = 17; monmessage(context); @@ -10891,15 +10891,15 @@ notyetassigned: scrollmonitor(context); context.al = 15; monmessage(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; + context.ds.word(318) = context.di; + context.ds.word(320) = context.bx; context.bx = context.pop(); context.es = context.pop(); context.push(context.es); @@ -10909,7 +10909,7 @@ notyetassigned: context.si = 7944; checkpass: context._lodsw(); - context.ah = context.data.byte(context.bx); + context.ah = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.ah, 32); if (context.flags.z()) goto passpassed; @@ -10934,7 +10934,7 @@ passpassed: scrollmonitor(context); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(context.bx) = 1; + context.ds.byte(context.bx) = 1; return; } @@ -10950,7 +10950,7 @@ static void showkeys(Context & context) { keysloop: context.push(context.cx); context.push(context.bx); - context._cmp(context.data.byte(context.bx), 0); + context._cmp(context.ds.byte(context.bx), 0); if (context.flags.z()) goto notheld; context._add(context.bx, 14); monprint(context); @@ -10967,29 +10967,29 @@ static void read(Context & context) { context.cx = 40; randomaccess(context); parser(context); - context._cmp(context.data.byte(context.di+1), 0); + context._cmp(context.ds.byte(context.di+1), 0); if (!context.flags.z()) goto okcom; neterror(context); return; okcom: context.es = context.cs; context.di = 2895; - context.ax = context.data.word(466); - context.data.word(324) = context.ax; + context.ax = context.ds.word(466); + context.ds.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(468); - context.data.word(324) = context.ax; + context.ax = context.ds.word(468); + context.ds.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(470); - context.data.word(324) = context.ax; + context.ax = context.ds.word(470); + context.ds.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); @@ -11006,12 +11006,12 @@ foundfile2: keyok1: context.es = context.cs; context.di = 2883; - context.ds = context.data.word(324); + context.ds = context.ds.word(324); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto findtopictext; - context.al = context.data.byte(270); - context.data.byte(269) = context.al; + context.al = context.ds.byte(270); + context.ds.byte(269) = context.al; context.al = 11; monmessage(context); return; @@ -11025,7 +11025,7 @@ findtopictext: context.es = context.pop(); moretopic: monprint(context); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 34); if (context.flags.z()) goto endoftopic; context._cmp(context.al, '='); @@ -11047,10 +11047,10 @@ endoftopic: static void dirfile(Context & context) { context.al = 34; - context.data.byte(context.di) = context.al; + context.ds.byte(context.di) = context.al; context.push(context.es); context.push(context.di); - context.ds = context.data.word(466); + context.ds = context.ds.word(466); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11059,7 +11059,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(468); + context.ds = context.ds.word(468); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11068,7 +11068,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(470); + context.ds = context.ds.word(470); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11101,7 +11101,7 @@ keyok2: context.bx = context.pop(); context.es = context.pop(); directloop2: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, 34); if (context.flags.z()) goto endofdir2; @@ -11118,24 +11118,24 @@ endofdir2: static void getkeyandlogo(Context & context) { context._add(context.bx, 1); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.data.byte(271) = context.al; + context.ds.byte(271) = context.al; context._add(context.bx, 2); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.data.byte(276) = context.al; + context.ds.byte(276) = context.al; context._add(context.bx, 1); context.push(context.es); context.push(context.bx); - context.al = context.data.byte(276); + context.al = context.ds.byte(276); context.ah = 0; context.cx = 26; context._mul(context.cx); context.es = context.cs; context.bx = 2807; context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 1); if (context.flags.z()) goto keyok; context.push(context.bx); @@ -11154,14 +11154,14 @@ static void getkeyandlogo(Context & context) { keyok: context.bx = context.pop(); context.es = context.pop(); - context.al = context.data.byte(271); - context.data.byte(269) = context.al; + context.al = context.ds.byte(271); + context.ds.byte(269) = context.al; context.al = 0; return; } static void searchforstring(Context & context) { - context.dl = context.data.byte(context.di); + context.dl = context.ds.byte(context.di); context.cx = context.di; restartlook: context.di = context.cx; @@ -11177,7 +11177,7 @@ keeplooking: context._cmp(context.al, 34); if (context.flags.z()) goto notfound; nofindingtopic: - context.ah = context.data.byte(context.di); + context.ah = context.ds.byte(context.di); context._cmp(context.al, context.dl); if (!context.flags.z()) goto notbracket; context._add(context.dh, 1); @@ -11242,10 +11242,10 @@ static void scrollmonitor(Context & context) { context.push(context.es); context.push(context.ds); printlogo(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.ds.word(318); + context.bx = context.ds.word(320); printundermon(context); - context.ax = context.data.word(320); + context.ax = context.ds.word(320); worktoscreen(context); context.al = 25; playchannel1(context); @@ -11261,11 +11261,11 @@ static void scrollmonitor(Context & context) { } static void lockmon(Context & context) { - context._cmp(context.data.byte(392), 57); + context._cmp(context.ds.byte(392), 57); if (!context.flags.z()) goto notlock; locklighton(context); lockloop: - context._cmp(context.data.byte(392), 57); + context._cmp(context.ds.byte(392), 57); if (context.flags.z()) goto lockloop; locklightoff(context); notlock: @@ -11273,10 +11273,10 @@ notlock: } static void monitorlogo(Context & context) { - context.al = context.data.byte(269); - context._cmp(context.al, context.data.byte(270)); + context.al = context.ds.byte(269); + context._cmp(context.al, context.ds.byte(270)); if (context.flags.z()) goto notnewlogo; - context.data.byte(270) = context.al; + context.ds.byte(270) = context.al; printlogo(context); printundermon(context); worktoscreen(context); @@ -11295,7 +11295,7 @@ notnewlogo: static void printlogo(Context & context) { context.di = 56; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 0; context.ah = 0; showframe(context); @@ -11308,13 +11308,13 @@ static void showcurrentfile(Context & context) { context.bx = 37; context.si = 2895+1; curfileloop: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto finishfile; context._add(context.si, 1); context.push(context.si); modifychar(context); - context.ds = context.data.word(406); + context.ds = context.ds.word(406); context.ah = 0; printchar(context); context.si = context.pop(); @@ -11324,12 +11324,12 @@ finishfile: } static void monmessage(Context & context) { - context.es = context.data.word(466); + context.es = context.ds.word(466); context.bx = 66*2; context.cl = context.al; context.ch = 0; monmessageloop: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, '+'); if (!context.flags.z()) goto monmessageloop; @@ -11339,7 +11339,7 @@ monmessageloop: } static void processtrigger(Context & context) { - context._cmp(context.data.byte(55), '1'); + context._cmp(context.ds.byte(55), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); @@ -11347,7 +11347,7 @@ static void processtrigger(Context & context) { triggermessage(context); return; notfirsttrigger: - context._cmp(context.data.byte(55), '2'); + context._cmp(context.ds.byte(55), '2'); if (!context.flags.z()) goto notsecondtrigger; context.al = 9; setlocation(context); @@ -11355,7 +11355,7 @@ notfirsttrigger: triggermessage(context); return; notsecondtrigger: - context._cmp(context.data.byte(55), '3'); + context._cmp(context.ds.byte(55), '3'); if (!context.flags.z()) goto notthirdtrigger; context.al = 2; setlocation(context); @@ -11371,7 +11371,7 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiget(context); context.ax = context.pop(); @@ -11390,11 +11390,11 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(402); + context.ds = context.ds.word(402); context.si = 0; multiput(context); worktoscreen(context); - context.data.byte(55) = 0; + context.ds.byte(55) = 0; return; } @@ -11405,13 +11405,13 @@ static void printcurs(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.es); - context.di = context.data.word(312); - context.bx = context.data.word(314); + context.di = context.ds.word(312); + context.bx = context.ds.word(314); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); context.ch = 11; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0; context.push(context.di); context.push(context.bx); @@ -11420,14 +11420,14 @@ static void printcurs(Context & context) { context.di = context.pop(); context.push(context.bx); context.push(context.di); - context._add(context.data.word(138), 1); - context.ax = context.data.word(138); + context._add(context.ds.word(138), 1); + context.ax = context.ds.word(138); context._and(context.al, 16); if (!context.flags.z()) goto flashcurs; context.al = '/'; context._sub(context.al, 32); context.ah = 0; - context.ds = context.data.word(406); + context.ds = context.ds.word(406); showframe(context); flashcurs: context.di = context.pop(); @@ -11452,8 +11452,8 @@ static void delcurs(Context & context) { context.push(context.ds); context.push(context.dx); context.push(context.si); - context.di = context.data.word(312); - context.bx = context.data.word(314); + context.di = context.ds.word(312); + context.bx = context.ds.word(314); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); @@ -11461,7 +11461,7 @@ static void delcurs(Context & context) { context.push(context.di); context.push(context.bx); context.push(context.cx); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0; multiput(context); context.cx = context.pop(); @@ -11479,17 +11479,17 @@ finishcurdel: } static void useobject(Context & context) { - context.data.byte(95) = 255; - context._cmp(context.data.byte(100), 229); + context.ds.byte(95) = 255; + context._cmp(context.ds.byte(100), 229); if (context.flags.z()) goto alreadyuse; - context.data.byte(100) = 229; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.ds.byte(100) = 229; + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(102); context.al = 51; commandwithob(context); alreadyuse: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nouse; context._and(context.ax, 1); if (!context.flags.z()) goto douse; @@ -11501,13 +11501,13 @@ douse: } static void useroutine(Context & context) { - context._cmp(context.data.byte(184), 50); + context._cmp(context.ds.byte(184), 50); if (context.flags.c()) goto nodream7; - context._cmp(context.data.byte(232), 0); + context._cmp(context.ds.byte(232), 0); if (!context.flags.z()) goto powerok; return; powerok: - context.data.byte(232) = 0; + context.ds.byte(232) = 0; nodream7: getanyad(context); context.dx = context.ds; @@ -11517,19 +11517,19 @@ checkuselist: context.push(context.si); context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+12)); + context._cmp(context.al, context.ds.byte(context.bx+12)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+13)); + context._cmp(context.al, context.ds.byte(context.bx+13)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+14)); + context._cmp(context.al, context.ds.byte(context.bx+14)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.data.byte(context.bx+15)); + context._cmp(context.al, context.ds.byte(context.bx+15)); if (!context.flags.z()) goto failed; context._lodsw(); context.si = context.pop(); @@ -11538,7 +11538,7 @@ checkuselist: failed: context.si = context.pop(); context._add(context.si, 6); - context._cmp(context.data.byte(context.si), 140); + context._cmp(context.ds.byte(context.si), 140); if (!context.flags.z()) goto checkuselist; delpointer(context); getobtextstart(context); @@ -11548,7 +11548,7 @@ failed: findnextcolon(context); context._cmp(context.al, 0); if (context.flags.z()) goto cantuse2; - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto cantuse2; usetext(context); @@ -11571,7 +11571,7 @@ cantuse2: context.cx = 50; hangonp(context); putbackobstuff(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; return; } @@ -11584,21 +11584,21 @@ static void wheelsound(Context & context) { } static void runtap(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto tapwith; withwhat(context); return; tapwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcupfromtap; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11611,9 +11611,9 @@ tapwith: putbackobstuff(context); return; fillcupfromtap: - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+15) = 'F'-'A'; + context.ds.byte(context.bx+15) = 'F'-'A'; context.al = 8; playchannel1(context); context.cx = 300; @@ -11638,9 +11638,9 @@ static void playguitar(Context & context) { } static void hotelcontrol(Context & context) { - context._cmp(context.data.byte(184), 21); + context._cmp(context.ds.byte(184), 21); if (!context.flags.z()) goto notrightcont; - context._cmp(context.data.byte(148), 33); + context._cmp(context.ds.byte(148), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); @@ -11660,22 +11660,22 @@ static void hotelbell(Context & context) { } static void opentomb(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); - context.data.word(21) = 35*2; - context.data.word(23) = 1; - context.data.word(25) = 33; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 35*2; + context.ds.word(23) = 1; + context.ds.word(25) = 33; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } static void usetrainer(Context & context) { getanyad(context); - context._cmp(context.data.byte(context.bx+2), 4); + context._cmp(context.ds.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); makeworn(context); showseconduse(context); putbackobstuff(context); @@ -11705,21 +11705,21 @@ static void nothelderror(Context & context) { } static void usepipe(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto pipewith; withwhat(context); return; pipewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcup; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11736,9 +11736,9 @@ fillcup: context.al = 36; showpuztext(context); putbackobstuff(context); - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+15) = 'F'-'A'; + context.ds.byte(context.bx+15) = 'F'-'A'; return; alreadyfull: context.cx = 300; @@ -11749,35 +11749,35 @@ alreadyfull: } static void usefullcart(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); context.al = 2; - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._add(context.ah, 6); turnanypathon(context); - context.data.byte(475) = 4; - context.data.byte(133) = 4; - context.data.byte(135) = 4; - context.data.byte(477) = 4; + context.ds.byte(475) = 4; + context.ds.byte(133) = 4; + context.ds.byte(135) = 4; + context.ds.byte(477) = 4; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; showfirstuse(context); - context.data.word(21) = 72*2; - context.data.word(23) = 58; - context.data.word(25) = 142; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 72*2; + context.ds.word(23) = 58; + context.ds.word(25) = 142; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } static void useplinth(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); return; plinthwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'D'; context.ch = 'K'; context.dl = 'E'; @@ -11788,80 +11788,80 @@ plinthwith: putbackobstuff(context); return; isrightkey: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showseconduse(context); - context.data.word(21) = 220; - context.data.word(23) = 0; - context.data.word(25) = 104; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.al = context.data.byte(67); - context.data.byte(188) = context.al; + context.ds.word(21) = 220; + context.ds.word(23) = 0; + context.ds.word(25) = 104; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; + context.al = context.ds.byte(67); + context.ds.byte(188) = context.al; return; } static void chewy(Context & context) { showfirstuse(context); getanyad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(103) = 1; + context.ds.byte(context.bx+2) = 255; + context.ds.byte(103) = 1; return; } static void useladder(Context & context) { showfirstuse(context); - context._sub(context.data.byte(148), 11); + context._sub(context.ds.byte(148), 11); findroominloc(context); - context.data.byte(133) = 6; - context.data.byte(135) = 6; - context.data.byte(475) = 0; - context.data.byte(478) = 0; - context.data.byte(477) = 0; + context.ds.byte(133) = 6; + context.ds.byte(135) = 6; + context.ds.byte(475) = 0; + context.ds.byte(478) = 0; + context.ds.byte(477) = 0; findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; + context.ds.byte(187) = 1; + context.ds.byte(103) = 1; return; } static void useladderb(Context & context) { showfirstuse(context); - context._add(context.data.byte(148), 11); + context._add(context.ds.byte(148), 11); findroominloc(context); - context.data.byte(133) = 2; - context.data.byte(135) = 2; - context.data.byte(475) = 1; - context.data.byte(478) = 1; - context.data.byte(477) = 1; + context.ds.byte(133) = 2; + context.ds.byte(135) = 2; + context.ds.byte(475) = 1; + context.ds.byte(478) = 1; + context.ds.byte(477) = 1; findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; + context.ds.byte(187) = 1; + context.ds.byte(103) = 1; return; } static void slabdoora(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 13; - context._cmp(context.data.byte(66), 3); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 13; + context._cmp(context.ds.byte(66), 3); if (!context.flags.z()) goto slabawrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 42; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 60; + context.ds.word(25) = 42; + context.ds.byte(188) = 47; return; slabawrong: - context.data.word(21) = 40; - context.data.word(25) = 34; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 40; + context.ds.word(25) = 34; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void slabdoorb(Context & context) { - context._cmp(context.data.byte(66), 1); + context._cmp(context.ds.byte(66), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; context.ah = 'H'; @@ -11876,120 +11876,120 @@ static void slabdoorb(Context & context) { return; gotcrystal: showfirstuse(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 60; - context.data.word(25) = 71; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 44; + context.ds.word(21) = 60; + context.ds.word(25) = 71; + context.ds.byte(188) = 47; return; slabbwrong: showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 40; - context.data.word(25) = 63; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 44; + context.ds.word(21) = 40; + context.ds.word(25) = 63; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void slabdoord(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 75; - context._cmp(context.data.byte(66), 0); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 75; + context._cmp(context.ds.byte(66), 0); if (!context.flags.z()) goto slabcwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 102; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 60; + context.ds.word(25) = 102; + context.ds.byte(188) = 47; return; slabcwrong: - context.data.word(21) = 40; - context.data.word(25) = 94; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 40; + context.ds.word(25) = 94; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void slabdoorc(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 108; - context._cmp(context.data.byte(66), 4); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 108; + context._cmp(context.ds.byte(66), 4); if (!context.flags.z()) goto slabdwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 135; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 60; + context.ds.word(25) = 135; + context.ds.byte(188) = 47; return; slabdwrong: - context.data.word(21) = 40; - context.data.word(25) = 127; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 40; + context.ds.word(25) = 127; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void slabdoore(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 141; - context._cmp(context.data.byte(66), 5); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 141; + context._cmp(context.ds.byte(66), 5); if (!context.flags.z()) goto slabewrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 168; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 60; + context.ds.word(25) = 168; + context.ds.byte(188) = 47; return; slabewrong: - context.data.word(21) = 40; - context.data.word(25) = 160; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 40; + context.ds.word(25) = 160; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void slabdoorf(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(23) = 171; - context._cmp(context.data.byte(66), 2); + context.ds.byte(103) = 1; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(23) = 171; + context._cmp(context.ds.byte(66), 2); if (!context.flags.z()) goto slabfwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 197; - context.data.byte(188) = 47; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 60; + context.ds.word(25) = 197; + context.ds.byte(188) = 47; return; slabfwrong: - context.data.word(21) = 40; - context.data.word(25) = 189; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 40; + context.ds.word(25) = 189; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void useslab(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto slabwith; withwhat(context); return; slabwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'J'; context.ch = 'E'; context.dl = 'W'; @@ -12002,10 +12002,10 @@ slabwith: putbackobstuff(context); return; nextslab: - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(99); + context.ds.byte(context.bx+2) = 0; + context.al = context.ds.byte(99); context.push(context.ax); removesetobject(context); context.ax = context.pop(); @@ -12017,26 +12017,26 @@ nextslab: if (!context.flags.z()) goto notlastslab; context.al = 0; turnpathon(context); - context.data.word(21) = 22; - context.data.word(23) = 35; - context.data.word(25) = 48; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 22; + context.ds.word(23) = 35; + context.ds.word(25) = 48; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; notlastslab: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void usecart(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto cartwith; withwhat(context); return; cartwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'R'; context.ch = 'O'; context.dl = 'C'; @@ -12049,31 +12049,31 @@ cartwith: putbackobstuff(context); return; nextcart: - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+2) = 0; - context.al = context.data.byte(99); + context.ds.byte(context.bx+2) = 0; + context.al = context.ds.byte(99); context.push(context.ax); removesetobject(context); context.ax = context.pop(); context._add(context.al, 1); placesetobject(context); - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void useclearbox(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); return; clearboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'R'; context.ch = 'A'; context.dl = 'I'; @@ -12086,57 +12086,57 @@ clearboxwith: putbackobstuff(context); return; openbox: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 67; - context.data.word(25) = 105; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 80; + context.ds.word(23) = 67; + context.ds.word(25) = 105; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } static void usecoveredbox(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 41; - context.data.word(25) = 66; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 50; + context.ds.word(23) = 41; + context.ds.word(25) = 66; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } static void userailing(Context & context) { showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.data.byte(56) = 4; + context.ds.word(21) = 80; + context.ds.word(23) = 0; + context.ds.word(25) = 30; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; + context.ds.byte(56) = 4; return; } static void useopenbox(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); return; openboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'F'; compare(context); if (context.flags.z()) goto destoryopenbox; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -12146,21 +12146,21 @@ openboxwith: showfirstuse(context); return; destoryopenbox: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); context.cx = 300; context.al = 37; showpuztext(context); - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+15) = 'E'-'A'; - context.data.word(21) = 140; - context.data.word(23) = 105; - context.data.word(25) = 181; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.byte(context.bx+15) = 'E'-'A'; + context.ds.word(21) = 140; + context.ds.word(23) = 105; + context.ds.word(25) = 181; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; context.al = 4; turnpathon(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; openboxwrong: context.cx = 300; @@ -12171,11 +12171,11 @@ openboxwrong: } static void wearwatch(Context & context) { - context._cmp(context.data.byte(3), 1); + context._cmp(context.ds.byte(3), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); - context.data.byte(3) = 1; - context.data.byte(103) = 1; + context.ds.byte(3) = 1; + context.ds.byte(103) = 1; getanyad(context); makeworn(context); return; @@ -12186,11 +12186,11 @@ wearingwatch: } static void wearshades(Context & context) { - context._cmp(context.data.byte(4), 1); + context._cmp(context.ds.byte(4), 1); if (context.flags.z()) goto wearingshades; - context.data.byte(4) = 1; + context.ds.byte(4) = 1; showfirstuse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; getanyad(context); makeworn(context); return; @@ -12201,17 +12201,17 @@ wearingshades: } static void sitdowninbar(Context & context) { - context._cmp(context.data.byte(32), -1); + context._cmp(context.ds.byte(32), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 55; - context.data.word(25) = 71; - context.data.word(29) = 73; - context.data.word(31) = 83; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 50; + context.ds.word(23) = 55; + context.ds.word(25) = 71; + context.ds.word(29) = 73; + context.ds.word(31) = 83; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; satdown: showseconduse(context); @@ -12221,23 +12221,23 @@ satdown: static void usechurchhole(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.word(21) = 28; - context.data.word(23) = 13; - context.data.word(25) = 26; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.byte(103) = 1; + context.ds.word(21) = 28; + context.ds.word(23) = 13; + context.ds.word(25) = 26; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; } static void usehole(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto holewith; withwhat(context); return; holewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'H'; context.ch = 'N'; context.dl = 'D'; @@ -12253,11 +12253,11 @@ righthand: showfirstuse(context); context.al = 86; removesetobject(context); - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(47) = 1; - context.data.byte(103) = 1; + context.ds.byte(context.bx+2) = 255; + context.ds.byte(47) = 1; + context.ds.byte(103) = 1; return; } @@ -12276,43 +12276,43 @@ static void usealtar(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto thingsonaltar; - context._cmp(context.data.byte(47), 1); + context._cmp(context.ds.byte(47), 1); if (context.flags.z()) goto movealtar; context.cx = 300; context.al = 23; showpuztext(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; movealtar: - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showseconduse(context); - context.data.word(21) = 160; - context.data.word(23) = 81; - context.data.word(25) = 174; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 160; + context.ds.word(23) = 81; + context.ds.word(25) = 174; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; context.al = 47; context.bl = 52; context.bh = 76; context.cx = 32; context.dx = 98; setuptimeduse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; thingsonaltar: showfirstuse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void opentvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); return; tvdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'U'; context.ch = 'L'; context.dl = 'O'; @@ -12326,8 +12326,8 @@ tvdoorwith: return; keyontv: showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; + context.ds.byte(37) = 0; + context.ds.byte(103) = 1; return; } @@ -12335,7 +12335,7 @@ static void usedryer(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -12345,13 +12345,13 @@ static void openlouis(Context & context) { context.cl = 3; context.ch = 8; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void nextcolon(Context & context) { lookcolon: - context.al = context.data.byte(context.si); + context.al = context.ds.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; @@ -12364,17 +12364,17 @@ static void openyourneighbour(Context & context) { context.cl = 255; context.ch = 255; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void usewindow(Context & context) { - context._cmp(context.data.byte(475), 6); + context._cmp(context.ds.byte(475), 6); if (!context.flags.z()) goto notonbalc; - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); - context.data.byte(188) = 29; - context.data.byte(103) = 1; + context.ds.byte(188) = 29; + context.ds.byte(103) = 1; return; notonbalc: showseconduse(context); @@ -12398,19 +12398,19 @@ static void usebalcony(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context._add(context.data.byte(2), 1); - context.data.byte(475) = 6; - context.data.byte(478) = 6; - context.data.byte(477) = 6; + context._add(context.ds.byte(2), 1); + context.ds.byte(475) = 6; + context.ds.byte(478) = 6; + context.ds.byte(477) = 6; findxyfrompath(context); switchryanoff(context); - context.data.byte(187) = 1; - context.data.word(21) = 30*2; - context.data.word(23) = 183; - context.data.word(25) = 212; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.byte(187) = 1; + context.ds.word(21) = 30*2; + context.ds.word(23) = 183; + context.ds.word(25) = 212; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } @@ -12420,7 +12420,7 @@ static void openryan(Context & context) { context.cl = 0; context.ch = 6; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -12430,7 +12430,7 @@ static void openpoolboss(Context & context) { context.cl = 2; context.ch = 2; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -12440,7 +12440,7 @@ static void openeden(Context & context) { context.cl = 6; context.ch = 5; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -12450,7 +12450,7 @@ static void opensarters(Context & context) { context.cl = 3; context.ch = 3; entercode(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -12458,13 +12458,13 @@ static void isitright(Context & context) { context.bx = context.ds; context.es = context.bx; context.bx = 8350; - context._cmp(context.data.byte(context.bx+0), context.al); + context._cmp(context.ds.byte(context.bx+0), context.al); if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+1), context.ah); + context._cmp(context.ds.byte(context.bx+1), context.ah); if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+2), context.cl); + context._cmp(context.ds.byte(context.bx+2), context.cl); if (!context.flags.z()) goto notright; - context._cmp(context.data.byte(context.bx+3), context.ch); + context._cmp(context.ds.byte(context.bx+3), context.ch); notright: return; } @@ -12478,13 +12478,13 @@ static void drawitall(Context & context) { } static void openhoteldoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); return; hoteldoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12500,19 +12500,19 @@ keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; + context.ds.byte(37) = 0; + context.ds.byte(103) = 1; return; } static void openhoteldoor2(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); return; hoteldoorwith2: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12533,13 +12533,13 @@ keyonhotel2: } static void grafittidoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto grafwith; withwhat(context); return; grafwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'A'; context.ch = 'P'; context.dl = 'E'; @@ -12558,16 +12558,16 @@ dograf: } static void trapdoor(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); showfirstuse(context); switchryanoff(context); - context.data.word(21) = 20*2; - context.data.word(23) = 181; - context.data.word(25) = 197; - context.data.byte(188) = 26; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 20*2; + context.ds.word(23) = 181; + context.ds.word(25) = 197; + context.ds.byte(188) = 26; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } @@ -12575,10 +12575,10 @@ static void callhotellift(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; - context.data.byte(478) = 5; - context.data.byte(477) = 5; + context.ds.byte(39) = 8; + context.ds.byte(103) = 1; + context.ds.byte(478) = 5; + context.ds.byte(477) = 5; autosetwalk(context); context.al = 4; turnpathon(context); @@ -12587,19 +12587,19 @@ static void callhotellift(Context & context) { static void calledenslift(Context & context) { showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; + context.ds.byte(39) = 8; + context.ds.byte(103) = 1; context.al = 2; turnpathon(context); return; } static void calledensdlift(Context & context) { - context._cmp(context.data.byte(35), 1); + context._cmp(context.ds.byte(35), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; + context.ds.byte(39) = 8; + context.ds.byte(103) = 1; context.al = 2; turnpathon(context); return; @@ -12610,13 +12610,13 @@ edensdhere: } static void usepoolreader(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto poolwith; withwhat(context); return; poolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -12629,7 +12629,7 @@ poolwith: putbackobstuff(context); return; openpool: - context._cmp(context.data.byte(48), 1); + context._cmp(context.ds.byte(48), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); @@ -12638,19 +12638,19 @@ canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(39) = 6; - context.data.byte(103) = 1; + context.ds.byte(39) = 6; + context.ds.byte(103) = 1; return; } static void uselighter(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); return; gotlighterwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'S'; context.ch = 'M'; context.dl = 'K'; @@ -12664,10 +12664,10 @@ cigarette: context.cx = 300; context.al = 9; showpuztext(context); - context.al = context.data.byte(95); + context.al = context.ds.byte(95); getexad(context); - context.data.byte(context.bx+2) = 255; - context.data.byte(103) = 1; + context.ds.byte(context.bx+2) = 255; + context.ds.byte(103) = 1; return; } @@ -12683,13 +12683,13 @@ static void showseconduse(Context & context) { } static void usecardreader1(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); return; gotreader1with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12702,9 +12702,9 @@ gotreader1with: putbackobstuff(context); return; correctcard: - context._cmp(context.data.byte(49), 0); + context._cmp(context.ds.byte(49), 0); if (context.flags.z()) goto notyet; - context._cmp(context.data.word(16), 0); + context._cmp(context.ds.word(16), 0); if (context.flags.z()) goto getscash; context.cx = 300; context.al = 17; @@ -12717,9 +12717,9 @@ getscash: context.cx = 300; context.al = 18; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(16) = 12432; - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.word(16) = 12432; + context.ds.byte(103) = 1; return; notyet: showfirstuse(context); @@ -12728,13 +12728,13 @@ notyet: } static void usecardreader2(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); return; gotreader2with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12747,11 +12747,11 @@ gotreader2with: putbackobstuff(context); return; correctcard2: - context._cmp(context.data.byte(50), 0); + context._cmp(context.ds.byte(50), 0); if (context.flags.z()) goto notyetboss; - context._cmp(context.data.word(16), 0); + context._cmp(context.ds.word(16), 0); if (context.flags.z()) goto nocash; - context._cmp(context.data.byte(46), 2); + context._cmp(context.ds.byte(46), 2); if (context.flags.z()) goto alreadygotnew; context.al = 18; playchannel1(context); @@ -12760,10 +12760,10 @@ correctcard2: showpuztext(context); context.al = 94; placesetobject(context); - context.data.byte(46) = 1; - context._sub(context.data.word(16), 2000); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context.ds.byte(46) = 1; + context._sub(context.ds.word(16), 2000); + context._add(context.ds.byte(2), 1); + context.ds.byte(103) = 1; return; nocash: context.cx = 300; @@ -12784,13 +12784,13 @@ notyetboss: } static void usecardreader3(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); return; gotreader3with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12803,19 +12803,19 @@ gotreader3with: putbackobstuff(context); return; rightcard: - context._cmp(context.data.byte(51), 0); + context._cmp(context.ds.byte(51), 0); if (context.flags.z()) goto notyetrecep; - context._cmp(context.data.byte(52), 0); + context._cmp(context.ds.byte(52), 0); if (!context.flags.z()) goto alreadyusedit; context.al = 16; playchannel1(context); context.cx = 300; context.al = 25; showpuztext(context); - context._add(context.data.byte(2), 1); - context._sub(context.data.word(16), 8300); - context.data.byte(52) = 1; - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context._sub(context.ds.word(16), 8300); + context.ds.byte(52) = 1; + context.ds.byte(103) = 1; return; alreadyusedit: context.cx = 300; @@ -12838,11 +12838,11 @@ static void usecashcard(Context & context) { showman(context); context.di = 114; context.bx = 120-3; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 39; context.ah = 0; showframe(context); - context.ax = context.data.word(16); + context.ax = context.ds.word(16); moneypoke(context); getobtextstart(context); nextcolon(context); @@ -12857,7 +12857,7 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3385; - context.data.word(71) = 91*2+75; + context.ds.word(71) = 91*2+75; context.al = 0; context.ah = 0; context.dl = 240; @@ -12866,12 +12866,12 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3390; - context.data.word(71) = 91*2+85; + context.ds.word(71) = 91*2+85; context.al = 0; context.ah = 0; context.dl = 240; printdirect(context); - context.data.word(71) = 0; + context.ds.word(71) = 0; worktoscreenm(context); context.cx = 400; hangonp(context); @@ -12882,13 +12882,13 @@ static void usecashcard(Context & context) { } static void lookatcard(Context & context) { - context.data.byte(131) = 1; + context.ds.byte(131) = 1; getridofreels(context); loadkeypad(context); createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 42; context.ah = 128; showframe(context); @@ -12910,7 +12910,7 @@ static void lookatcard(Context & context) { createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 42; context.ah = 128; showframe(context); @@ -12925,7 +12925,7 @@ static void lookatcard(Context & context) { worktoscreenm(context); context.cx = 200; hangonw(context); - context.data.byte(131) = 0; + context.ds.byte(131) = 0; getridoftemp(context); restorereels(context); putbackobstuff(context); @@ -12940,7 +12940,7 @@ numberpoke0: context._sub(context.ax, 10000); if (!context.flags.c()) goto numberpoke0; context._add(context.ax, 10000); - context.data.byte(context.bx) = context.cl; + context.ds.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke1: @@ -12948,7 +12948,7 @@ numberpoke1: context._sub(context.ax, 1000); if (!context.flags.c()) goto numberpoke1; context._add(context.ax, 1000); - context.data.byte(context.bx) = context.cl; + context.ds.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke2: @@ -12956,7 +12956,7 @@ numberpoke2: context._sub(context.ax, 100); if (!context.flags.c()) goto numberpoke2; context._add(context.ax, 100); - context.data.byte(context.bx) = context.cl; + context.ds.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke3: @@ -12964,39 +12964,39 @@ numberpoke3: context._sub(context.ax, 10); if (!context.flags.c()) goto numberpoke3; context._add(context.ax, 10); - context.data.byte(context.bx) = context.cl; + context.ds.byte(context.bx) = context.cl; context.bx = 3390; context._add(context.al, 48); - context.data.byte(context.bx) = context.al; + context.ds.byte(context.bx) = context.al; return; } static void usecontrol(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); return; gotcontrolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; context.dh = 'A'; compare(context); if (context.flags.z()) goto rightkey; - context._cmp(context.data.byte(184), 21); + context._cmp(context.ds.byte(184), 21); if (!context.flags.z()) goto balls; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto jimmycontrols; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13010,26 +13010,26 @@ balls: rightkey: context.al = 16; playchannel1(context); - context._cmp(context.data.byte(9), 21); + context._cmp(context.ds.byte(9), 21); if (context.flags.z()) goto goingdown; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(188) = 21; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.ds.byte(188) = 21; + context.ds.byte(40) = 8; + context.ds.byte(39) = 0; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; return; goingdown: context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(188) = 30; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.ds.byte(188) = 30; + context.ds.byte(40) = 8; + context.ds.byte(39) = 0; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; return; jimmycontrols: context.al = 50; @@ -13049,41 +13049,41 @@ jimmycontrols: context.cx = 300; context.al = 10; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.byte(103) = 1; return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); - context._add(context.data.byte(2), 1); + context._add(context.ds.byte(2), 1); putbackobstuff(context); return; } static void usehatch(Context & context) { showfirstuse(context); - context.data.byte(188) = 40; - context.data.byte(103) = 1; + context.ds.byte(188) = 40; + context.ds.byte(103) = 1; return; } static void usewire(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); return; gotwirewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto wireknife; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13109,8 +13109,8 @@ wireknife: context.cx = 300; context.al = 11; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.byte(103) = 1; return; } @@ -13120,27 +13120,27 @@ static void usehandle(Context & context) { context.cl = 'T'; context.ch = 'W'; findsetobject(context); - context.al = context.data.byte(context.bx+58); + context.al = context.ds.byte(context.bx+58); context._cmp(context.al, 255); if (!context.flags.z()) goto havecutwire; context.cx = 300; context.al = 12; showpuztext(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; havecutwire: context.cx = 300; context.al = 13; showpuztext(context); - context.data.byte(188) = 22; - context.data.byte(103) = 1; + context.ds.byte(188) = 22; + context.ds.byte(103) = 1; return; } static void useelevator1(Context & context) { showfirstuse(context); selectlocation(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } @@ -13156,47 +13156,47 @@ static void showfirstuse(Context & context) { static void useelevator3(Context & context) { showfirstuse(context); - context.data.byte(40) = 20; - context.data.byte(188) = 34; - context.data.word(23) = 46; - context.data.word(25) = 63; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.ds.byte(40) = 20; + context.ds.byte(188) = 34; + context.ds.word(23) = 46; + context.ds.word(25) = 63; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; return; } static void useelevator4(Context & context) { showfirstuse(context); - context.data.word(23) = 0; - context.data.word(25) = 11; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(40) = 20; - context.data.word(21) = 80; - context.data.byte(103) = 1; - context.data.byte(188) = 24; + context.ds.word(23) = 0; + context.ds.word(25) = 11; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(40) = 20; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; + context.ds.byte(188) = 24; return; } static void useelevator2(Context & context) { - context._cmp(context.data.byte(9), 23); + context._cmp(context.ds.byte(9), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); - context.data.byte(188) = 23; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.ds.byte(188) = 23; + context.ds.byte(40) = 20; + context.ds.byte(39) = 0; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; return; inpoolhall: showfirstuse(context); - context.data.byte(188) = 31; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.ds.byte(188) = 31; + context.ds.byte(40) = 20; + context.ds.byte(39) = 0; + context.ds.word(21) = 80; + context.ds.byte(103) = 1; return; } @@ -13205,20 +13205,20 @@ static void useelevator5(Context & context) { placesetobject(context); context.al = 0; removesetobject(context); - context.data.byte(188) = 20; - context.data.word(21) = 80; - context.data.byte(35) = 1; - context.data.byte(40) = 8; - context.data.byte(103) = 1; + context.ds.byte(188) = 20; + context.ds.word(21) = 80; + context.ds.byte(35) = 1; + context.ds.byte(40) = 8; + context.ds.byte(103) = 1; return; } static void usekey(Context & context) { - context._cmp(context.data.byte(9), 5); + context._cmp(context.ds.byte(9), 5); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 30); + context._cmp(context.ds.byte(9), 30); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 21); + context._cmp(context.ds.byte(9), 21); if (context.flags.z()) goto usekey2; context.cx = 200; context.al = 1; @@ -13226,25 +13226,25 @@ static void usekey(Context & context) { putbackobstuff(context); return; usekey1: - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); + context._cmp(context.ds.byte(149), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(40) = 100; - context.data.byte(103) = 1; + context.ds.byte(40) = 100; + context.ds.byte(103) = 1; return; usekey2: - context._cmp(context.data.byte(148), 11); + context._cmp(context.ds.byte(148), 11); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); + context._cmp(context.ds.byte(149), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(188) = 30; + context.ds.byte(188) = 30; context.al = 2; fadescreendown(context); showfirstuse(context); @@ -13259,7 +13259,7 @@ wrongroom1: } static void usestereo(Context & context) { - context._cmp(context.data.byte(9), 0); + context._cmp(context.ds.byte(9), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; @@ -13267,9 +13267,9 @@ static void usestereo(Context & context) { putbackobstuff(context); return; stereook: - context._cmp(context.data.byte(148), 11); + context._cmp(context.ds.byte(148), 11); if (!context.flags.z()) goto stereonotok; - context._cmp(context.data.byte(149), 0); + context._cmp(context.ds.byte(149), 0); if (context.flags.z()) goto stereook2; stereonotok: context.cx = 400; @@ -13293,13 +13293,13 @@ stereook2: putbackobstuff(context); getanyad(context); context.al = 255; - context.data.byte(context.bx+10) = context.al; + context.ds.byte(context.bx+10) = context.al; return; cdinside: getanyad(context); - context.al = context.data.byte(context.bx+10); + context.al = context.ds.byte(context.bx+10); context._xor(context.al, 1); - context.data.byte(context.bx+10) = context.al; + context.ds.byte(context.bx+10) = context.al; context._cmp(context.al, 255); if (context.flags.z()) goto stereoon; context.al = 7; @@ -13316,8 +13316,8 @@ stereoon: } static void usecooker(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); checkinside(context); context._cmp(context.cl, 114); if (!context.flags.z()) goto foodinside; @@ -13331,14 +13331,14 @@ foodinside: } static void useaxe(Context & context) { - context._cmp(context.data.byte(184), 22); + context._cmp(context.ds.byte(184), 22); if (!context.flags.z()) goto notinpool; - context._cmp(context.data.byte(149), 10); + context._cmp(context.ds.byte(149), 10); if (context.flags.z()) goto axeondoor; showseconduse(context); - context._add(context.data.byte(2), 1); - context.data.byte(65) = 2; - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.byte(65) = 2; + context.ds.byte(103) = 1; removeobfrominv(context); return; notinpool: @@ -13349,25 +13349,25 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 46*2; + context.ds.word(23) = 31; + context.ds.word(25) = 77; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; return; } static void useelvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); return; gotdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13383,13 +13383,13 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.word(21) = 46*2; + context.ds.word(23) = 31; + context.ds.word(25) = 77; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } @@ -13398,8 +13398,8 @@ static void withwhat(Context & context) { showpanel(context); showman(context); showexit(context); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.ds.byte(99); + context.ah = context.ds.byte(102); context.es = context.cs; context.di = 5674; copyname(context); @@ -13409,7 +13409,7 @@ static void withwhat(Context & context) { context.al = 63; context.ah = 2; printmessage2(context); - context.di = context.data.word(84); + context.di = context.ds.word(84); context._add(context.di, 5); context.bx = 21; context.es = context.cs; @@ -13418,7 +13418,7 @@ static void withwhat(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - context.di = context.data.word(84); + context.di = context.ds.word(84); context._add(context.di, 5); context.bx = 21; context.dl = 200; @@ -13426,38 +13426,38 @@ static void withwhat(Context & context) { context.ah = 3; printmessage2(context); fillryan(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(104) = 2; + context.ds.byte(104) = 2; return; } static void selectob(Context & context) { findinvpos(context); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canselectob; blank(context); return; canselectob: - context.data.byte(95) = context.al; - context.data.byte(96) = context.ah; - context._cmp(context.ax, context.data.word(94)); + context.ds.byte(95) = context.al; + context.ds.byte(96) = context.ah; + context._cmp(context.ax, context.ds.word(94)); if (!context.flags.z()) goto diffsub3; - context._cmp(context.data.byte(100), 221); + context._cmp(context.ds.byte(100), 221); if (context.flags.z()) goto alreadyselob; - context.data.byte(100) = 221; + context.ds.byte(100) = 221; diffsub3: - context.data.word(94) = context.ax; + context.ds.word(94) = context.ax; context.bx = context.ax; context.al = 0; commandwithob(context); alreadyselob: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notselob; context._and(context.ax, 1); if (!context.flags.z()) goto doselob; @@ -13465,7 +13465,7 @@ notselob: return; doselob: delpointer(context); - context.data.byte(104) = 0; + context.ds.byte(104) = 0; useroutine(context); return; } @@ -13480,9 +13480,9 @@ static void compare(Context & context) { getanyaddir(context); context.dx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.word(context.bx+12), context.cx); + context._cmp(context.ds.word(context.bx+12), context.cx); if (!context.flags.z()) goto comparefin; - context._cmp(context.data.word(context.bx+14), context.dx); + context._cmp(context.ds.word(context.bx+14), context.dx); comparefin: return; } @@ -13492,17 +13492,17 @@ static void findsetobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(428); + context.es = context.ds.word(428); context.bx = 0; context.dl = 0; findsetloop: - context._cmp(context.al, context.data.byte(context.bx+12)); + context._cmp(context.al, context.ds.byte(context.bx+12)); if (!context.flags.z()) goto nofind; - context._cmp(context.ah, context.data.byte(context.bx+13)); + context._cmp(context.ah, context.ds.byte(context.bx+13)); if (!context.flags.z()) goto nofind; - context._cmp(context.cl, context.data.byte(context.bx+14)); + context._cmp(context.cl, context.ds.byte(context.bx+14)); if (!context.flags.z()) goto nofind; - context._cmp(context.ch, context.data.byte(context.bx+15)); + context._cmp(context.ch, context.ds.byte(context.bx+15)); if (!context.flags.z()) goto nofind; context.al = context.dl; return; @@ -13520,17 +13520,17 @@ static void findexobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.bx = 0+2080+30000; context.dl = 0; findexloop: - context._cmp(context.al, context.data.byte(context.bx+12)); + context._cmp(context.al, context.ds.byte(context.bx+12)); if (!context.flags.z()) goto nofindex; - context._cmp(context.ah, context.data.byte(context.bx+13)); + context._cmp(context.ah, context.ds.byte(context.bx+13)); if (!context.flags.z()) goto nofindex; - context._cmp(context.cl, context.data.byte(context.bx+14)); + context._cmp(context.cl, context.ds.byte(context.bx+14)); if (!context.flags.z()) goto nofindex; - context._cmp(context.ch, context.data.byte(context.bx+15)); + context._cmp(context.ch, context.ds.byte(context.bx+15)); if (!context.flags.z()) goto nofindex; context.al = context.dl; return; @@ -13548,19 +13548,19 @@ static void isryanholding(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.bx = 0+2080+30000; context.dl = 0; searchinv: - context._cmp(context.data.byte(context.bx+2), 4); + context._cmp(context.ds.byte(context.bx+2), 4); if (!context.flags.z()) goto nofindininv; - context._cmp(context.al, context.data.byte(context.bx+12)); + context._cmp(context.al, context.ds.byte(context.bx+12)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.ah, context.data.byte(context.bx+13)); + context._cmp(context.ah, context.ds.byte(context.bx+13)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.cl, context.data.byte(context.bx+14)); + context._cmp(context.cl, context.ds.byte(context.bx+14)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.ch, context.data.byte(context.bx+15)); + context._cmp(context.ch, context.ds.byte(context.bx+15)); if (!context.flags.z()) goto nofindininv; context.al = context.dl; context._cmp(context.al, 114); @@ -13576,13 +13576,13 @@ nofindininv: } static void checkinside(Context & context) { - context.es = context.data.word(398); + context.es = context.ds.word(398); context.bx = 0+2080+30000; context.cl = 0; insideloop: - context._cmp(context.al, context.data.byte(context.bx+3)); + context._cmp(context.al, context.ds.byte(context.bx+3)); if (!context.flags.z()) goto notfoundinside; - context._cmp(context.ah, context.data.byte(context.bx+2)); + context._cmp(context.ah, context.ds.byte(context.bx+2)); if (!context.flags.z()) goto notfoundinside; return; notfoundinside: @@ -13622,7 +13622,7 @@ static void putbackobstuff(Context & context) { obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -13657,8 +13657,8 @@ static void findpuztext(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(454); - context.ax = context.data.word(context.si); + context.es = context.ds.word(454); + context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; return; @@ -13671,7 +13671,7 @@ static void placesetobject(Context & context) { context.ch = 0; findormake(context); getsetad(context); - context.data.byte(context.bx+58) = 0; + context.ds.byte(context.bx+58) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -13684,7 +13684,7 @@ static void removesetobject(Context & context) { context.ch = 0; findormake(context); getsetad(context); - context.data.byte(context.bx+58) = 255; + context.ds.byte(context.bx+58) = 255; context.bx = context.pop(); context.es = context.pop(); return; @@ -13694,7 +13694,7 @@ static void issetobonmap(Context & context) { context.push(context.es); context.push(context.bx); getsetad(context); - context.al = context.data.byte(context.bx+58); + context.al = context.ds.byte(context.bx+58); context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, 0); @@ -13708,7 +13708,7 @@ static void placefreeobject(Context & context) { context.ch = 1; findormake(context); getfreead(context); - context.data.byte(context.bx+2) = 0; + context.ds.byte(context.bx+2) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -13718,7 +13718,7 @@ static void removefreeobject(Context & context) { context.push(context.es); context.push(context.bx); getfreead(context); - context.data.byte(context.bx+2) = 255; + context.ds.byte(context.bx+2) = 255; context.bx = context.pop(); context.es = context.pop(); return; @@ -13727,49 +13727,49 @@ static void removefreeobject(Context & context) { static void findormake(Context & context) { context.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); context.push(context.ax); - context.es = context.data.word(412); - context.ah = context.data.byte(184); + context.es = context.ds.word(412); + context.ah = context.ds.byte(184); changeloop: - context._cmp(context.data.byte(context.bx), 255); + context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto haventfound; - context._cmp(context.ax, context.data.word(context.bx)); + context._cmp(context.ax, context.ds.word(context.bx)); if (!context.flags.z()) goto nofoundchange; - context._cmp(context.ch, context.data.byte(context.bx+3)); + context._cmp(context.ch, context.ds.byte(context.bx+3)); if (context.flags.z()) goto foundchange; nofoundchange: context._add(context.bx, 4); goto changeloop; foundchange: context.ax = context.pop(); - context.data.byte(context.bx+2) = context.cl; + context.ds.byte(context.bx+2) = context.cl; return; haventfound: - context.data.word(context.bx) = context.ax; - context.data.word(context.bx+2) = context.cx; + context.ds.word(context.bx) = context.ax; + context.ds.word(context.bx+2) = context.cx; context.ax = context.pop(); return; } static void switchryanon(Context & context) { - context.data.byte(63) = 255; + context.ds.byte(63) = 255; return; } static void switchryanoff(Context & context) { - context.data.byte(63) = 1; + context.ds.byte(63) = 1; return; } static void setallchanges(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.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); setallloop: - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endsetloop; - context.cx = context.data.word(context.bx+2); + context.cx = context.ds.word(context.bx+2); context._add(context.bx, 4); - context._cmp(context.ah, context.data.byte(184)); + context._cmp(context.ah, context.ds.byte(184)); if (!context.flags.z()) goto setallloop; context.push(context.es); context.push(context.bx); @@ -13801,43 +13801,43 @@ path: context.bx = context.pop(); context._add(context.bx, context.ax); context._add(context.bx, 0); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.cx = context.pop(); - context.data.byte(context.bx+6) = context.cl; + context.ds.byte(context.bx+6) = context.cl; nopath: return; object: context.push(context.cx); getsetad(context); context.cx = context.pop(); - context.data.byte(context.bx+58) = context.cl; + context.ds.byte(context.bx+58) = context.cl; return; freeobject: context.push(context.cx); getfreead(context); context.cx = context.pop(); - context._cmp(context.data.byte(context.bx+2), 255); + context._cmp(context.ds.byte(context.bx+2), 255); if (!context.flags.z()) goto beenpickedup; - context.data.byte(context.bx+2) = context.cl; + context.ds.byte(context.bx+2) = context.cl; beenpickedup: return; } static void autoappear(Context & context) { - context._cmp(context.data.byte(9), 32); + context._cmp(context.ds.byte(9), 32); if (!context.flags.z()) goto notinalley; context.al = 5; resetlocation(context); context.al = 10; setlocation(context); - context.data.byte(183) = 10; + context.ds.byte(183) = 10; return; notinalley: - context._cmp(context.data.byte(184), 24); + context._cmp(context.ds.byte(184), 24); if (!context.flags.z()) goto notinedens; - context._cmp(context.data.byte(42), 1); + context._cmp(context.ds.byte(42), 1); if (!context.flags.z()) goto edenspart2; - context._add(context.data.byte(42), 1); + context._add(context.ds.byte(42), 1); context.al = 44; placesetobject(context); context.al = 18; @@ -13856,7 +13856,7 @@ notinalley: removesetobject(context); return; edenspart2: - context._cmp(context.data.byte(43), 1); + context._cmp(context.ds.byte(43), 1); if (!context.flags.z()) goto notedens2; context.al = 44; removesetobject(context); @@ -13864,23 +13864,23 @@ edenspart2: removesetobject(context); context.al = 55; placesetobject(context); - context._add(context.data.byte(43), 1); + context._add(context.ds.byte(43), 1); notedens2: return; notinedens: - context._cmp(context.data.byte(184), 25); + context._cmp(context.ds.byte(184), 25); if (!context.flags.z()) goto notonsartroof; - context.data.byte(34) = 3; + context.ds.byte(34) = 3; context.al = 6; resetlocation(context); context.al = 11; setlocation(context); - context.data.byte(183) = 11; + context.ds.byte(183) = 11; return; notonsartroof: - context._cmp(context.data.byte(184), 2); + context._cmp(context.ds.byte(184), 2); if (!context.flags.z()) goto notinlouiss; - context._cmp(context.data.byte(41), 0); + context._cmp(context.ds.byte(41), 0); if (context.flags.z()) goto notinlouiss; context.al = 23; placesetobject(context); @@ -13889,153 +13889,153 @@ notinlouiss: } static void getundertimed(Context & context) { - context.al = context.data.byte(335); + context.al = context.ds.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.ds.byte(336); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.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(context); return; } static void putundertimed(Context & context) { - context.al = context.data.byte(335); + context.al = context.ds.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.ds.byte(336); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.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(context); return; } static void dumptimedtext(Context & context) { - context._cmp(context.data.byte(337), 1); + context._cmp(context.ds.byte(337), 1); if (!context.flags.z()) goto nodumptimed; - context.al = context.data.byte(335); + context.al = context.ds.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.ds.byte(336); context.ah = 0; context.di = context.ax; context.cl = 240; context.ch = 30; multidump(context); - context.data.byte(337) = 0; + context.ds.byte(337) = 0; nodumptimed: return; } static void setuptimeduse(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.ds.word(328), 0); if (!context.flags.z()) goto cantsetup; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; + context.ds.byte(335) = context.bh; + context.ds.byte(336) = context.bl; + context.ds.word(330) = context.cx; context._add(context.dx, context.cx); - context.data.word(328) = context.dx; + context.ds.word(328) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(454); + context.es = context.ds.word(454); context.cx = 66*2; - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; + context.ds.word(332) = context.es; + context.ds.word(334) = context.bx; cantsetup: return; } static void setuptimedtemp(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.ds.word(328), 0); if (!context.flags.z()) goto cantsetup2; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; + context.ds.byte(335) = context.bh; + context.ds.byte(336) = context.bl; + context.ds.word(330) = context.cx; context._add(context.dx, context.cx); - context.data.word(328) = context.dx; + context.ds.word(328) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); + context.es = context.ds.word(466); context.cx = 66*2; - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; + context.ds.word(332) = context.es; + context.ds.word(334) = context.bx; cantsetup2: return; } static void usetimedtext(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.ds.word(328), 0); if (context.flags.z()) goto notext; - context._sub(context.data.word(328), 1); - context._cmp(context.data.word(328), 0); + context._sub(context.ds.word(328), 1); + context._cmp(context.ds.word(328), 0); if (context.flags.z()) goto deltimedtext; - context.ax = context.data.word(328); - context._cmp(context.ax, context.data.word(330)); + context.ax = context.ds.word(328); + context._cmp(context.ax, context.ds.word(330)); if (context.flags.z()) goto firsttimed; if (!context.flags.c()) goto notext; goto notfirsttimed; firsttimed: getundertimed(context); notfirsttimed: - context.bl = context.data.byte(335); + context.bl = context.ds.byte(335); context.bh = 0; - context.al = context.data.byte(336); + context.al = context.ds.byte(336); context.ah = 0; context.di = context.ax; - context.es = context.data.word(332); - context.si = context.data.word(334); + context.es = context.ds.word(332); + context.si = context.ds.word(334); context.dl = 237; context.ah = 0; printdirect(context); - context.data.byte(337) = 1; + context.ds.byte(337) = 1; notext: return; deltimedtext: putundertimed(context); - context.data.byte(337) = 1; + context.ds.byte(337) = 1; return; } static void edenscdplayer(Context & context) { showfirstuse(context); - context.data.word(21) = 18*2; - context.data.word(23) = 25; - context.data.word(25) = 42; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 18*2; + context.ds.word(23) = 25; + context.ds.word(25) = 42; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; return; } static void usewall(Context & context) { showfirstuse(context); - context._cmp(context.data.byte(475), 3); + context._cmp(context.ds.byte(475), 3); if (context.flags.z()) goto gobackover; - context.data.word(21) = 30*2; - context.data.word(23) = 2; - context.data.word(25) = 31; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 30*2; + context.ds.word(23) = 2; + context.ds.word(25) = 31; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; context.al = 3; turnpathon(context); context.al = 4; @@ -14048,19 +14048,19 @@ static void usewall(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context.data.byte(475) = 3; - context.data.byte(477) = 3; + context.ds.byte(475) = 3; + context.ds.byte(477) = 3; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; switchryanoff(context); return; gobackover: - context.data.word(21) = 30*2; - context.data.word(23) = 34; - context.data.word(25) = 60; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.ds.word(21) = 30*2; + context.ds.word(23) = 34; + context.ds.word(25) = 60; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; context.al = 3; turnpathoff(context); context.al = 4; @@ -14073,22 +14073,22 @@ gobackover: turnpathon(context); context.al = 5; turnpathon(context); - context.data.byte(475) = 5; - context.data.byte(477) = 5; + context.ds.byte(475) = 5; + context.ds.byte(477) = 5; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; switchryanoff(context); return; } static void usechurchgate(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto gatewith; withwhat(context); return; gatewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'T'; @@ -14102,16 +14102,16 @@ gatewith: return; cutgate: showfirstuse(context); - context.data.word(21) = 64*2; - context.data.word(23) = 4; - context.data.word(25) = 70; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.word(21) = 64*2; + context.ds.word(23) = 4; + context.ds.word(25) = 70; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); context.al = 3; turnpathon(context); - context._cmp(context.data.byte(44), 0); + context._cmp(context.ds.byte(44), 0); if (context.flags.z()) goto notopenchurch; context.al = 2; turnpathon(context); @@ -14120,153 +14120,153 @@ notopenchurch: } static void usegun(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.ds.byte(102), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); return; istakengun: - context._cmp(context.data.byte(184), 22); + context._cmp(context.ds.byte(184), 22); if (!context.flags.z()) goto notinpoolroom; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 39; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.byte(65) = 1; + context.ds.byte(64) = 39; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); return; notinpoolroom: - context._cmp(context.data.byte(184), 25); + context._cmp(context.ds.byte(184), 25); if (!context.flags.z()) goto nothelicopter; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 19; - context.data.byte(103) = 1; - context.data.byte(66) = 2; - context.data.byte(67) = 38; - context.data.byte(43) = 1; - context._add(context.data.byte(2), 1); + context.ds.byte(65) = 1; + context.ds.byte(64) = 19; + context.ds.byte(103) = 1; + context.ds.byte(66) = 2; + context.ds.byte(67) = 38; + context.ds.byte(43) = 1; + context._add(context.ds.byte(2), 1); return; nothelicopter: - context._cmp(context.data.byte(184), 27); + context._cmp(context.ds.byte(184), 27); if (!context.flags.z()) goto notinrockroom; context.cx = 300; context.al = 46; showpuztext(context); - context.data.byte(234) = 2; - context.data.byte(41) = 1; - context.data.byte(65) = 1; - context.data.byte(34) = 1; - context.data.byte(103) = 1; - context.data.byte(67) = 32; - context.data.byte(66) = 0; - context._add(context.data.byte(2), 1); + context.ds.byte(234) = 2; + context.ds.byte(41) = 1; + context.ds.byte(65) = 1; + context.ds.byte(34) = 1; + context.ds.byte(103) = 1; + context.ds.byte(67) = 32; + context.ds.byte(66) = 0; + context._add(context.ds.byte(2), 1); return; notinrockroom: - context._cmp(context.data.byte(184), 8); + context._cmp(context.ds.byte(184), 8); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(149), 40); + context._cmp(context.ds.byte(149), 40); if (!context.flags.z()) goto notbystudio; context.al = 92; issetobonmap(context); if (context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(475), 9); + context._cmp(context.ds.byte(475), 9); if (context.flags.z()) goto notbystudio; - context.data.byte(478) = 9; - context.data.byte(477) = 9; + context.ds.byte(478) = 9; + context.ds.byte(477) = 9; autosetwalk(context); - context.data.byte(65) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.byte(65) = 1; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); return; notbystudio: - context._cmp(context.data.byte(184), 6); + context._cmp(context.ds.byte(184), 6); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(148), 11); + context._cmp(context.ds.byte(148), 11); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(149), 20); + context._cmp(context.ds.byte(149), 20); if (!context.flags.z()) goto notsarters; context.al = 5; issetobonmap(context); if (!context.flags.z()) goto notsarters; - context.data.byte(478) = 1; - context.data.byte(477) = 1; + context.ds.byte(478) = 1; + context.ds.byte(477) = 1; autosetwalk(context); context.al = 5; removesetobject(context); context.al = 6; placesetobject(context); context.al = 1; - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._sub(context.ah, 1); turnanypathon(context); - context.data.byte(35) = 1; - context.data.word(21) = 40*2; - context.data.word(23) = 4; - context.data.word(25) = 43; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.byte(35) = 1; + context.ds.word(21) = 40*2; + context.ds.word(23) = 4; + context.ds.word(25) = 43; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); return; notsarters: - context._cmp(context.data.byte(184), 29); + context._cmp(context.ds.byte(184), 29); if (!context.flags.z()) goto notaide; - context.data.byte(103) = 1; + context.ds.byte(103) = 1; context.al = 13; resetlocation(context); context.al = 12; setlocation(context); - context.data.byte(183) = 12; - context.data.byte(478) = 2; - context.data.byte(477) = 2; + context.ds.byte(183) = 12; + context.ds.byte(478) = 2; + context.ds.byte(477) = 2; autosetwalk(context); - context.data.word(21) = 164*2; - context.data.word(23) = 3; - context.data.word(25) = 164; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(44) = 1; - context.data.byte(66) = 3; - context.data.byte(67) = 33; - context._add(context.data.byte(2), 1); + context.ds.word(21) = 164*2; + context.ds.word(23) = 3; + context.ds.word(25) = 164; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(44) = 1; + context.ds.byte(66) = 3; + context.ds.byte(67) = 33; + context._add(context.ds.byte(2), 1); return; notaide: - context._cmp(context.data.byte(184), 23); + context._cmp(context.ds.byte(184), 23); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(148), 0); + context._cmp(context.ds.byte(148), 0); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(149), 50); + context._cmp(context.ds.byte(149), 50); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(475), 5); + context._cmp(context.ds.byte(475), 5); if (context.flags.z()) goto pathokboss; - context.data.byte(478) = 5; - context.data.byte(477) = 5; + context.ds.byte(478) = 5; + context.ds.byte(477) = 5; autosetwalk(context); pathokboss: - context.data.byte(65) = 1; - context.data.byte(103) = 1; + context.ds.byte(65) = 1; + context.ds.byte(103) = 1; return; notwithboss: - context._cmp(context.data.byte(184), 8); + context._cmp(context.ds.byte(184), 8); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(148), 11); + context._cmp(context.ds.byte(148), 11); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(149), 10); + context._cmp(context.ds.byte(149), 10); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(475), 2); + context._cmp(context.ds.byte(475), 2); if (context.flags.z()) goto pathoktv; - context.data.byte(478) = 2; - context.data.byte(477) = 2; + context.ds.byte(478) = 2; + context.ds.byte(477) = 2; autosetwalk(context); pathoktv: - context.data.byte(65) = 1; - context.data.byte(103) = 1; + context.ds.byte(65) = 1; + context.ds.byte(103) = 1; return; nottvsoldier: showfirstuse(context); @@ -14275,14 +14275,14 @@ nottvsoldier: } static void useshield(Context & context) { - context._cmp(context.data.byte(184), 20); + context._cmp(context.ds.byte(184), 20); if (!context.flags.z()) goto notinsartroom; - context._cmp(context.data.byte(64), 0); + context._cmp(context.ds.byte(64), 0); if (context.flags.z()) goto notinsartroom; - context.data.byte(65) = 3; + context.ds.byte(65) = 3; showseconduse(context); - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); removeobfrominv(context); return; notinsartroom: @@ -14297,20 +14297,20 @@ static void usebuttona(Context & context) { if (context.flags.z()) goto donethisbit; showfirstuse(context); context.al = 0; - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._sub(context.ah, 1); turnanypathon(context); context.al = 9; removesetobject(context); context.al = 95; placesetobject(context); - context.data.word(21) = 15*2; - context.data.word(23) = 71; - context.data.word(25) = 85; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.word(21) = 15*2; + context.ds.word(23) = 71; + context.ds.word(25) = 85; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); return; donethisbit: showseconduse(context); @@ -14319,21 +14319,21 @@ donethisbit: } static void useplate(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.ds.byte(95), 255); if (!context.flags.z()) goto platewith; withwhat(context); return; platewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'S'; context.ch = 'C'; context.dl = 'R'; context.dh = 'W'; compare(context); if (context.flags.z()) goto unscrewplate; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.ds.byte(95); + context.ah = context.ds.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; @@ -14357,8 +14357,8 @@ unscrewplate: removesetobject(context); context.al = 0; placefreeobject(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.ds.byte(2), 1); + context.ds.byte(103) = 1; return; triedknife: context.cx = 300; @@ -14382,19 +14382,19 @@ static void usewinch(Context & context) { context.dh = 'E'; compare(context); if (!context.flags.z()) goto nowinch; - context.data.word(21) = 217*2; - context.data.word(23) = 0; - context.data.word(25) = 217; - context.data.byte(27) = 1; - context.data.byte(26) = 1; - context.data.byte(183) = 1; - context.data.byte(188) = 45; - context.data.byte(66) = 1; - context.data.byte(67) = 44; - context.data.byte(42) = 1; - context.data.byte(34) = 2; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.ds.word(21) = 217*2; + context.ds.word(23) = 0; + context.ds.word(25) = 217; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; + context.ds.byte(183) = 1; + context.ds.byte(188) = 45; + context.ds.byte(66) = 1; + context.ds.byte(67) = 44; + context.ds.byte(42) = 1; + context.ds.byte(34) = 2; + context.ds.byte(103) = 1; + context._add(context.ds.byte(2), 1); return; nowinch: showfirstuse(context); @@ -14403,8 +14403,8 @@ nowinch: } static void entercode(Context & context) { - context.data.word(284) = context.ax; - context.data.word(286) = context.cx; + context.ds.word(284) = context.ax; + context.ds.word(286) = context.cx; getridofreels(context); loadkeypad(context); createpanel(context); @@ -14415,20 +14415,20 @@ static void entercode(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.word(280) = 0; - context.data.byte(103) = 0; + context.ds.word(280) = 0; + context.ds.byte(103) = 0; keypadloop: delpointer(context); readmouse(context); showkeypad(context); showpointer(context); - context._cmp(context.data.byte(282), 0); + context._cmp(context.ds.byte(282), 0); if (context.flags.z()) goto nopresses; - context._sub(context.data.byte(282), 1); + context._sub(context.ds.byte(282), 1); goto afterpress; nopresses: - context.data.byte(278) = 255; - context.data.byte(281) = 255; + context.ds.byte(278) = 255; + context.ds.byte(281) = 255; vsync(context); afterpress: dumppointer(context); @@ -14436,37 +14436,37 @@ afterpress: dumptextline(context); context.bx = 3393; checkcoords(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (context.flags.z()) goto numberright; - context._cmp(context.data.byte(287), 1); + context._cmp(context.ds.byte(287), 1); if (!context.flags.z()) goto notendkey; - context._cmp(context.data.byte(37), 0); + context._cmp(context.ds.byte(37), 0); if (context.flags.z()) goto numberright; goto keypadloop; notendkey: - context._cmp(context.data.byte(282), 40); + context._cmp(context.ds.byte(282), 40); if (!context.flags.z()) goto keypadloop; addtopresslist(context); - context._cmp(context.data.byte(278), 11); + context._cmp(context.ds.byte(278), 11); if (!context.flags.z()) goto keypadloop; - context.ax = context.data.word(284); - context.cx = context.data.word(286); + context.ax = context.ds.word(284); + context.cx = context.ds.word(286); isitright(context); if (!context.flags.z()) goto incorrect; - context.data.byte(37) = 0; + context.ds.byte(37) = 0; context.al = 11; playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; + context.ds.byte(287) = 120; + context.ds.word(280) = 0; goto keypadloop; incorrect: context.al = 11; playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; + context.ds.byte(287) = 120; + context.ds.word(280) = 0; goto keypadloop; numberright: - context.data.byte(131) = 0; + context.ds.byte(131) = 0; getridoftemp(context); restorereels(context); redrawmainscrn(context); @@ -14481,38 +14481,38 @@ static void loadkeypad(Context & context) { } static void quitkey(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadyqk; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 4; commandonly(context); alreadyqk: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notqk; context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: return; doqk: - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void addtopresslist(Context & context) { - context._cmp(context.data.word(280), 5); + context._cmp(context.ds.word(280), 5); if (context.flags.z()) goto nomorekeys; - context.al = context.data.byte(278); + context.al = context.ds.byte(278); context._cmp(context.al, 10); if (!context.flags.z()) goto not10; context.al = 0; not10: - context.bx = context.data.word(280); + context.bx = context.ds.word(280); context.dx = context.ds; context.es = context.dx; context._add(context.bx, 8350); - context.data.byte(context.bx) = context.al; - context._add(context.data.word(280), 1); + context.ds.byte(context.bx) = context.al; + context._add(context.ds.word(280), 1); nomorekeys: return; } @@ -14586,27 +14586,27 @@ static void buttonenter(Context & context) { static void buttonpress(Context & context) { context.ch = context.cl; context._add(context.ch, 100); - context._cmp(context.data.byte(100), context.ch); + context._cmp(context.ds.byte(100), context.ch); if (context.flags.z()) goto alreadyb; - context.data.byte(100) = context.ch; + context.ds.byte(100) = context.ch; context.al = context.cl; context._add(context.al, 4); context.push(context.cx); commandonly(context); context.cx = context.pop(); alreadyb: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notb; context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: return; dob: - context.data.byte(278) = context.cl; + context.ds.byte(278) = context.cl; context._add(context.cl, 21); - context.data.byte(281) = context.cl; - context.data.byte(282) = 40; + context.ds.byte(281) = context.cl; + context.ds.byte(282) = 40; context._cmp(context.cl, 32); if (context.flags.z()) goto nonoise; context.al = 10; @@ -14618,13 +14618,13 @@ nonoise: static void showouterpad(Context & context) { context.di = 36+112-3; context.bx = 72-4; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 36+112+74; context.bx = 72+76; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.al = 37; context.ah = 0; showframe(context); @@ -14676,23 +14676,23 @@ static void showkeypad(Context & context) { context.di = 36+112+31; context.bx = 72+59; singlekey(context); - context._cmp(context.data.byte(287), 0); + context._cmp(context.ds.byte(287), 0); if (context.flags.z()) goto notenter; - context._sub(context.data.byte(287), 1); + context._sub(context.ds.byte(287), 1); context.al = 36; context.bx = 72-1+63; - context._cmp(context.data.byte(37), 0); + context._cmp(context.ds.byte(37), 0); if (!context.flags.z()) goto changelight; context.al = 41; context.bx = 72+4+63; changelight: - context._cmp(context.data.byte(287), 60); + context._cmp(context.ds.byte(287), 60); if (context.flags.c()) goto gotlight; - context._cmp(context.data.byte(287), 100); + context._cmp(context.ds.byte(287), 100); if (!context.flags.c()) goto gotlight; context._sub(context.al, 1); gotlight: - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 0; context.di = 36+112+60; showframe(context); @@ -14701,14 +14701,14 @@ notenter: } static void singlekey(Context & context) { - context._cmp(context.data.byte(281), context.al); + context._cmp(context.ds.byte(281), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); - context._cmp(context.data.byte(282), 8); + context._cmp(context.ds.byte(282), 8); if (!context.flags.c()) goto gotkey; context._sub(context.al, 11); gotkey: - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context._sub(context.al, 20); context.ah = 0; showframe(context); @@ -14730,24 +14730,24 @@ static void usemenu(Context & context) { createpanel(context); showpanel(context); showicon(context); - context.data.byte(62) = 0; + context.ds.byte(62) = 0; drawfloor(context); printsprites(context); context.al = 4; context.ah = 0; context.di = 80+40-48; context.bx = 60-4; - context.ds = context.data.word(460); + context.ds = context.ds.word(460); showframe(context); getundermenu(context); context.al = 5; context.ah = 0; context.di = 80+40+54; context.bx = 60+72; - context.ds = context.data.word(460); + context.ds = context.ds.word(460); showframe(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; menuloop: delpointer(context); putundermenu(context); @@ -14760,9 +14760,9 @@ menuloop: dumptextline(context); context.bx = 3525; checkcoords(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.ds.byte(103), 1); if (!context.flags.z()) goto menuloop; - context.data.byte(131) = 0; + context.ds.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); getridoftemp2(context); @@ -14787,7 +14787,7 @@ static void getundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.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(context); return; @@ -14798,7 +14798,7 @@ static void putundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.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(context); return; @@ -14809,41 +14809,41 @@ static void showoutermenu(Context & context) { context.ah = 0; context.di = 80+40-34; context.bx = 60-40; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); context.al = 41; context.ah = 0; context.di = 80+40+64-34; context.bx = 60-40; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); context.al = 42; context.ah = 0; context.di = 80+40-26; context.bx = 60+57-40; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); context.al = 43; context.ah = 0; context.di = 80+40+64-26; context.bx = 60+57-40; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); return; } static void showmenu(Context & context) { - context._add(context.data.byte(290), 1); - context._cmp(context.data.byte(290), 37*2); + context._add(context.ds.byte(290), 1); + context._cmp(context.ds.byte(290), 37*2); if (!context.flags.z()) goto menuframeok; - context.data.byte(290) = 0; + context.ds.byte(290) = 0; menuframeok: - context.al = context.data.byte(290); + context.al = context.ds.byte(290); context._shr(context.al, 1); context.ah = 0; context.di = 80+40; context.bx = 60; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); return; } @@ -14857,13 +14857,13 @@ static void loadmenu(Context & context) { } static void viewfolder(Context & context) { - context.data.byte(131) = 1; + context.ds.byte(131) = 1; getridofall(context); loadfolder(context); - context.data.byte(288) = 0; + context.ds.byte(288) = 0; showfolder(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; folderloop: delpointer(context); readmouse(context); @@ -14873,9 +14873,9 @@ folderloop: dumptextline(context); context.bx = 3547; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto folderloop; - context.data.byte(131) = 0; + context.ds.byte(131) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); @@ -14887,30 +14887,30 @@ folderloop: } static void nextfolder(Context & context) { - context._cmp(context.data.byte(288), 12); + context._cmp(context.ds.byte(288), 12); if (!context.flags.z()) goto cannextf; blank(context); return; cannextf: - context._cmp(context.data.byte(100), 201); + context._cmp(context.ds.byte(100), 201); if (context.flags.z()) goto alreadynextf; - context.data.byte(100) = 201; + context.ds.byte(100) = 201; context.al = 16; commandonly(context); alreadynextf: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notnextf; context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: return; donextf: - context._add(context.data.byte(288), 1); + context._add(context.ds.byte(288), 1); folderhints(context); delpointer(context); showfolder(context); - context.data.word(202) = 0; + context.ds.word(202) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -14918,9 +14918,9 @@ donextf: } static void folderhints(Context & context) { - context._cmp(context.data.byte(288), 5); + context._cmp(context.ds.byte(288), 5); if (!context.flags.z()) goto notaideadd; - context._cmp(context.data.byte(44), 1); + context._cmp(context.ds.byte(44), 1); if (context.flags.z()) goto notaideadd; context.al = 13; getlocation(context); @@ -14941,7 +14941,7 @@ static void folderhints(Context & context) { hangonp(context); return; notaideadd: - context._cmp(context.data.byte(288), 9); + context._cmp(context.ds.byte(288), 9); if (!context.flags.z()) goto notaristoadd; context.al = 7; getlocation(context); @@ -14965,31 +14965,31 @@ notaristoadd: } static void lastfolder(Context & context) { - context._cmp(context.data.byte(288), 0); + context._cmp(context.ds.byte(288), 0); if (!context.flags.z()) goto canlastf; blank(context); return; canlastf: - context._cmp(context.data.byte(100), 202); + context._cmp(context.ds.byte(100), 202); if (context.flags.z()) goto alreadylastf; - context.data.byte(100) = 202; + context.ds.byte(100) = 202; context.al = 17; commandonly(context); alreadylastf: - context._cmp(context.data.byte(288), 0); + context._cmp(context.ds.byte(288), 0); if (context.flags.z()) goto notlastf; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notlastf; context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: return; dolastf: - context._sub(context.data.byte(288), 1); + context._sub(context.ds.byte(288), 1); delpointer(context); showfolder(context); - context.data.word(202) = 0; + context.ds.word(202) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -15011,41 +15011,41 @@ static void loadfolder(Context & context) { } static void showfolder(Context & context) { - context.data.byte(100) = 255; - context._cmp(context.data.byte(288), 0); + context.ds.byte(100) = 255; + context._cmp(context.ds.byte(288), 0); if (context.flags.z()) goto closedfolder; usetempcharset(context); createpanel2(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 143; context.bx = 0; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 0; context.bx = 92; context.al = 2; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 143; context.bx = 92; context.al = 3; context.ah = 0; showframe(context); folderexit(context); - context._cmp(context.data.byte(288), 1); + context._cmp(context.ds.byte(288), 1); if (context.flags.z()) goto noleftpage; showleftpage(context); noleftpage: - context._cmp(context.data.byte(288), 12); + context._cmp(context.ds.byte(288), 12); if (context.flags.z()) goto norightpage; showrightpage(context); norightpage: @@ -15054,13 +15054,13 @@ norightpage: return; closedfolder: createpanel2(context); - context.ds = context.data.word(462); + context.ds = context.ds.word(462); context.di = 143-28; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.ds.word(462); context.di = 143-28; context.bx = 92; context.al = 1; @@ -15072,7 +15072,7 @@ closedfolder: } static void folderexit(Context & context) { - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 296; context.bx = 178; context.al = 6; @@ -15082,7 +15082,7 @@ static void folderexit(Context & context) { } static void showleftpage(Context & context) { - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 0; context.bx = 12; context.al = 3; @@ -15093,7 +15093,7 @@ static void showleftpage(Context & context) { leftpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 0; context.al = 4; context.ah = 0; @@ -15102,22 +15102,22 @@ leftpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto leftpageloop; - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 0; context.al = 5; context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.word(71) = 91; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); + context.ds.word(77) = 8; + context.ds.word(71) = 91; + context.ds.byte(72) = 1; + context.bl = context.ds.byte(288); context._sub(context.bl, 1); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); - context.si = context.data.word(context.bx); + context.es = context.ds.word(466); + context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 2; context.bx = 48; @@ -15127,16 +15127,16 @@ twolotsleft: context.push(context.cx); contleftpage: printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.ds.word(77)); context._cmp(context.al, 0); if (!context.flags.z()) goto contleftpage; context.cx = context.pop(); if (--context.cx) goto twolotsleft; - context.data.byte(72) = 0; - context.data.word(71) = 0; - context.data.word(77) = 10; - context.es = context.data.word(400); - context.ds = context.data.word(400); + context.ds.byte(72) = 0; + context.ds.word(71) = 0; + context.ds.word(77) = 10; + context.es = context.ds.word(400); + context.ds = context.ds.word(400); context.di = (48*320)+2; context.si = (48*320)+2+130; context.cx = 120; @@ -15146,10 +15146,10 @@ flipfolder: context.push(context.si); context.cx = 65; flipfolderline: - context.al = context.data.byte(context.di); - context.ah = context.data.byte(context.si); - context.data.byte(context.di) = context.ah; - context.data.byte(context.si) = context.al; + context.al = context.ds.byte(context.di); + context.ah = context.ds.byte(context.si); + context.ds.byte(context.di) = context.ah; + context.ds.byte(context.si) = context.al; context._sub(context.si, 1); context._add(context.di, 1); if (--context.cx) goto flipfolderline; @@ -15163,7 +15163,7 @@ flipfolderline: } static void showrightpage(Context & context) { - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 143; context.bx = 12; context.al = 0; @@ -15174,7 +15174,7 @@ static void showrightpage(Context & context) { rightpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 143; context.al = 1; context.ah = 0; @@ -15183,20 +15183,20 @@ rightpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto rightpageloop; - context.ds = context.data.word(460); + context.ds = context.ds.word(460); context.di = 143; context.al = 2; context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); + context.ds.word(77) = 8; + context.ds.byte(72) = 1; + context.bl = context.ds.byte(288); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); - context.si = context.data.word(context.bx); + context.es = context.ds.word(466); + context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 152; context.bx = 48; @@ -15206,30 +15206,30 @@ twolotsright: context.push(context.cx); contrightpage: printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.ds.word(77)); context._cmp(context.al, 0); if (!context.flags.z()) goto contrightpage; context.cx = context.pop(); if (--context.cx) goto twolotsright; - context.data.byte(72) = 0; - context.data.word(77) = 10; + context.ds.byte(72) = 0; + context.ds.word(77) = 10; return; } static void entersymbol(Context & context) { - context.data.byte(131) = 1; + context.ds.byte(131) = 1; getridofreels(context); context.dx = 2351; loadintotemp(context); - context.data.byte(291) = 24; - context.data.byte(293) = 0; - context.data.byte(294) = 24; - context.data.byte(296) = 0; + context.ds.byte(291) = 24; + context.ds.byte(293) = 0; + context.ds.byte(294) = 24; + context.ds.byte(296) = 0; redrawmainscrn(context); showsymbol(context); undertextline(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; symbolloop: delpointer(context); updatesymboltop(context); @@ -15243,21 +15243,21 @@ symbolloop: dumpsymbol(context); context.bx = 3589; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto symbolloop; - context._cmp(context.data.byte(295), 3); + context._cmp(context.ds.byte(295), 3); if (!context.flags.z()) goto symbolwrong; - context._cmp(context.data.byte(292), 5); + context._cmp(context.ds.byte(292), 5); if (!context.flags.z()) goto symbolwrong; context.al = 43; removesetobject(context); context.al = 46; placesetobject(context); - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._add(context.ah, 12); context.al = 0; turnanypathon(context); - context.data.byte(131) = 0; + context.ds.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15270,11 +15270,11 @@ symbolwrong: removesetobject(context); context.al = 43; placesetobject(context); - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._add(context.ah, 12); context.al = 0; turnanypathoff(context); - context.data.byte(131) = 0; + context.ds.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15283,94 +15283,94 @@ symbolwrong: } static void quitsymbol(Context & context) { - context._cmp(context.data.byte(291), 24); + context._cmp(context.ds.byte(291), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(294), 24); + context._cmp(context.ds.byte(294), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadyqs; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 18; commandonly(context); alreadyqs: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notqs; context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: return; doqs: - context.data.byte(103) = 1; + context.ds.byte(103) = 1; return; } static void settopleft(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.ds.byte(293), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 210); + context._cmp(context.ds.byte(100), 210); if (context.flags.z()) goto alreadytopl; - context.data.byte(100) = 210; + context.ds.byte(100) = 210; context.al = 19; commandonly(context); alreadytopl: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto notopleft; - context.data.byte(293) = -1; + context.ds.byte(293) = -1; notopleft: return; } static void settopright(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.ds.byte(293), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 211); + context._cmp(context.ds.byte(100), 211); if (context.flags.z()) goto alreadytopr; - context.data.byte(100) = 211; + context.ds.byte(100) = 211; context.al = 20; commandonly(context); alreadytopr: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto notopright; - context.data.byte(293) = 1; + context.ds.byte(293) = 1; notopright: return; } static void setbotleft(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.ds.byte(296), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 212); + context._cmp(context.ds.byte(100), 212); if (context.flags.z()) goto alreadybotl; - context.data.byte(100) = 212; + context.ds.byte(100) = 212; context.al = 21; commandonly(context); alreadybotl: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto nobotleft; - context.data.byte(296) = -1; + context.ds.byte(296) = -1; nobotleft: return; } static void setbotright(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.ds.byte(296), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 213); + context._cmp(context.ds.byte(100), 213); if (context.flags.z()) goto alreadybotr; - context.data.byte(100) = 213; + context.ds.byte(100) = 213; context.al = 22; commandonly(context); alreadybotr: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto nobotright; - context.data.byte(296) = 1; + context.ds.byte(296) = 1; nobotright: return; } static void dumpsymbol(Context & context) { - context.data.byte(109) = 0; + context.ds.byte(109) = 0; context.di = 64; context.bx = 56+20; context.cl = 104; @@ -15384,15 +15384,15 @@ static void showsymbol(Context & context) { context.ah = 0; context.di = 64; context.bx = 56; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); - context.al = context.data.byte(291); + context.al = context.ds.byte(291); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(292); + context.al = context.ds.byte(292); context.bx = 56+20; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15417,14 +15417,14 @@ static void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - context.al = context.data.byte(294); + context.al = context.ds.byte(294); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(295); + context.al = context.ds.byte(295); context._add(context.al, 6); context.bx = 56+49; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15468,88 +15468,88 @@ botwrap: } static void updatesymboltop(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.ds.byte(293), 0); if (context.flags.z()) goto topfinished; - context._cmp(context.data.byte(293), -1); + context._cmp(context.ds.byte(293), -1); if (context.flags.z()) goto backwards; - context._add(context.data.byte(291), 1); - context._cmp(context.data.byte(291), 49); + context._add(context.ds.byte(291), 1); + context._cmp(context.ds.byte(291), 49); if (!context.flags.z()) goto notwrapfor; - context.data.byte(291) = 0; - context._sub(context.data.byte(292), 1); - context._cmp(context.data.byte(292), -1); + context.ds.byte(291) = 0; + context._sub(context.ds.byte(292), 1); + context._cmp(context.ds.byte(292), -1); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 5; + context.ds.byte(292) = 5; return; notwrapfor: - context._cmp(context.data.byte(291), 24); + context._cmp(context.ds.byte(291), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; + context.ds.byte(293) = 0; return; backwards: - context._sub(context.data.byte(291), 1); - context._cmp(context.data.byte(291), -1); + context._sub(context.ds.byte(291), 1); + context._cmp(context.ds.byte(291), -1); if (!context.flags.z()) goto notwrapback; - context.data.byte(291) = 48; - context._add(context.data.byte(292), 1); - context._cmp(context.data.byte(292), 6); + context.ds.byte(291) = 48; + context._add(context.ds.byte(292), 1); + context._cmp(context.ds.byte(292), 6); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 0; + context.ds.byte(292) = 0; return; notwrapback: - context._cmp(context.data.byte(291), 24); + context._cmp(context.ds.byte(291), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; + context.ds.byte(293) = 0; topfinished: return; } static void updatesymbolbot(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.ds.byte(296), 0); if (context.flags.z()) goto botfinished; - context._cmp(context.data.byte(296), -1); + context._cmp(context.ds.byte(296), -1); if (context.flags.z()) goto backwardsbot; - context._add(context.data.byte(294), 1); - context._cmp(context.data.byte(294), 49); + context._add(context.ds.byte(294), 1); + context._cmp(context.ds.byte(294), 49); if (!context.flags.z()) goto notwrapforb; - context.data.byte(294) = 0; - context._sub(context.data.byte(295), 1); - context._cmp(context.data.byte(295), -1); + context.ds.byte(294) = 0; + context._sub(context.ds.byte(295), 1); + context._cmp(context.ds.byte(295), -1); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 5; + context.ds.byte(295) = 5; return; notwrapforb: - context._cmp(context.data.byte(294), 24); + context._cmp(context.ds.byte(294), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; + context.ds.byte(296) = 0; return; backwardsbot: - context._sub(context.data.byte(294), 1); - context._cmp(context.data.byte(294), -1); + context._sub(context.ds.byte(294), 1); + context._cmp(context.ds.byte(294), -1); if (!context.flags.z()) goto notwrapbackb; - context.data.byte(294) = 48; - context._add(context.data.byte(295), 1); - context._cmp(context.data.byte(295), 6); + context.ds.byte(294) = 48; + context._add(context.ds.byte(295), 1); + context._cmp(context.ds.byte(295), 6); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 0; + context.ds.byte(295) = 0; return; notwrapbackb: - context._cmp(context.data.byte(294), 24); + context._cmp(context.ds.byte(294), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; + context.ds.byte(296) = 0; botfinished: return; } static void dumpsymbox(Context & context) { - context._cmp(context.data.word(303), -1); + context._cmp(context.ds.word(303), -1); if (context.flags.z()) goto nodumpsym; - context.di = context.data.word(303); - context.bx = context.data.word(305); + context.di = context.ds.word(303); + context.bx = context.ds.word(305); context.cl = 30; context.ch = 77; multidump(context); - context.data.word(303) = -1; + context.ds.word(303) = -1; nodumpsym: return; } @@ -15571,7 +15571,7 @@ static void usediary(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; diaryloop: delpointer(context); readmouse(context); @@ -15583,13 +15583,13 @@ diaryloop: dumptextline(context); context.bx = 3651; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto diaryloop; getridoftemp(context); getridoftemptext(context); getridoftempcharset(context); restorereels(context); - context.data.byte(131) = 0; + context.ds.byte(131) = 0; redrawmainscrn(context); worktoscreenm(context); return; @@ -15602,52 +15602,52 @@ static void showdiary(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12+37; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); context.al = 2; context.ah = 0; context.di = 68+24+176; context.bx = 48+12+108; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); return; } static void showdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 0); + context._cmp(context.ds.byte(282), 0); if (context.flags.z()) goto nokeyatall; - context._sub(context.data.byte(282), 1); - context._cmp(context.data.byte(282), 0); + context._sub(context.ds.byte(282), 1); + context._cmp(context.ds.byte(282), 0); if (context.flags.z()) goto nokeyatall; - context._cmp(context.data.byte(278), 'N'); + context._cmp(context.ds.byte(278), 'N'); if (!context.flags.z()) goto nokeyn; context.al = 3; - context._cmp(context.data.byte(282), 1); + context._cmp(context.ds.byte(282), 1); if (context.flags.z()) goto gotkeyn; context.al = 4; gotkeyn: context.ah = 0; context.di = 68+24+94; context.bx = 48+12+97; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); - context._cmp(context.data.byte(282), 1); + context._cmp(context.ds.byte(282), 1); if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: return; nokeyn: context.al = 5; - context._cmp(context.data.byte(282), 1); + context._cmp(context.ds.byte(282), 1); if (context.flags.z()) goto gotkeyp; context.al = 6; gotkeyp: context.ah = 0; context.di = 68+24+151; context.bx = 48+12+71; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); - context._cmp(context.data.byte(282), 1); + context._cmp(context.ds.byte(282), 1); if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: @@ -15657,13 +15657,13 @@ nokeyatall: } static void dumpdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 1); + context._cmp(context.ds.byte(282), 1); if (!context.flags.z()) goto notdumpdiary; - context._cmp(context.data.byte(43), 1); + context._cmp(context.ds.byte(43), 1); if (context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); + context._cmp(context.ds.byte(289), 5); if (!context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); + context._cmp(context.ds.byte(289), 5); if (!context.flags.z()) goto notsartadd; context.al = 6; getlocation(context); @@ -15710,53 +15710,53 @@ notdumpdiary: } static void diarykeyp(Context & context) { - context._cmp(context.data.byte(100), 214); + context._cmp(context.ds.byte(100), 214); if (context.flags.z()) goto alreadykeyp; - context.data.byte(100) = 214; + context.ds.byte(100) = 214; context.al = 23; commandonly(context); alreadykeyp: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto notkeyp; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); + context.ax = context.ds.word(212); + context._cmp(context.ax, context.ds.word(202)); if (context.flags.z()) goto notkeyp; - context._cmp(context.data.byte(282), 0); + context._cmp(context.ds.byte(282), 0); if (!context.flags.z()) goto notkeyp; context.al = 16; playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'P'; - context._sub(context.data.byte(289), 1); - context._cmp(context.data.byte(289), -1); + context.ds.byte(282) = 12; + context.ds.byte(278) = 'P'; + context._sub(context.ds.byte(289), 1); + context._cmp(context.ds.byte(289), -1); if (!context.flags.z()) goto notkeyp; - context.data.byte(289) = 11; + context.ds.byte(289) = 11; notkeyp: return; } static void diarykeyn(Context & context) { - context._cmp(context.data.byte(100), 213); + context._cmp(context.ds.byte(100), 213); if (context.flags.z()) goto alreadykeyn; - context.data.byte(100) = 213; + context.ds.byte(100) = 213; context.al = 23; commandonly(context); alreadykeyn: - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto notkeyn; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); + context.ax = context.ds.word(212); + context._cmp(context.ax, context.ds.word(202)); if (context.flags.z()) goto notkeyn; - context._cmp(context.data.byte(282), 0); + context._cmp(context.ds.byte(282), 0); if (!context.flags.z()) goto notkeyn; context.al = 16; playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'N'; - context._add(context.data.byte(289), 1); - context._cmp(context.data.byte(289), 12); + context.ds.byte(282) = 12; + context.ds.byte(278) = 'N'; + context._add(context.ds.byte(289), 1); + context._cmp(context.ds.byte(289), 12); if (!context.flags.z()) goto notkeyn; - context.data.byte(289) = 0; + context.ds.byte(289) = 0; notkeyn: return; } @@ -15766,17 +15766,17 @@ static void showdiarypage(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); showframe(context); - context.al = context.data.byte(289); + context.al = context.ds.byte(289); findtext1(context); - context.data.byte(72) = 1; + context.ds.byte(72) = 1; usetempcharset(context); context.di = 68+24+48; context.bx = 48+12+16; context.dl = 240; context.ah = 16; - context.data.word(71) = 91+91; + context.ds.word(71) = 91+91; printdirect(context); context.di = 68+24+129; context.bx = 48+12+16; @@ -15788,8 +15788,8 @@ static void showdiarypage(Context & context) { context.dl = 240; context.ah = 16; printdirect(context); - context.data.byte(72) = 0; - context.data.word(71) = 0; + context.ds.byte(72) = 0; + context.ds.word(71) = 0; usecharset1(context); return; } @@ -15798,37 +15798,37 @@ static void findtext1(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(466); - context.ax = context.data.word(context.si); + context.es = context.ds.word(466); + context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; return; } static void zoomonoff(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.ds.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadyonoff; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 39; commandonly(context); alreadyonoff: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nozoomonoff; context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: return; dozoomonoff: - context.al = context.data.byte(8); + context.al = context.ds.byte(8); context._xor(context.al, 1); - context.data.byte(8) = context.al; + context.ds.byte(8) = context.al; createpanel(context); - context.data.byte(62) = 0; + context.ds.byte(62) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -15843,18 +15843,18 @@ dozoomonoff: } static void saveload(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.ds.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 253); + context._cmp(context.ds.byte(100), 253); if (context.flags.z()) goto alreadyops; - context.data.byte(100) = 253; + context.ds.byte(100) = 253; context.al = 43; commandonly(context); alreadyops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noops; context._and(context.ax, 1); if (context.flags.z()) goto noops; @@ -15864,11 +15864,11 @@ noops: } static void dosaveload(Context & context) { - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; + context.ds.byte(231) = 0; + context.ds.word(79) = 70; + context.ds.word(81) = 182-8; + context.ds.byte(82) = 181; + context.ds.byte(131) = 1; clearwork(context); createpanel2(context); undertextline(context); @@ -15883,7 +15883,7 @@ restartops: showmainops(context); worktoscreenm(context); donefirstops: - context.data.byte(103) = 0; + context.ds.byte(103) = 0; waitops: readmouse(context); showpointer(context); @@ -15893,27 +15893,27 @@ waitops: delpointer(context); context.bx = 3693; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto waitops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.ds.byte(103), 2); if (context.flags.z()) goto restartops; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context._cmp(context.data.byte(103), 4); + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; + context._cmp(context.ds.byte(103), 4); if (context.flags.z()) goto justret; getridoftemp(context); restoreall(context); redrawmainscrn(context); worktoscreenm(context); - context.data.byte(100) = 200; + context.ds.byte(100) = 200; justret: - context.data.byte(131) = 0; + context.ds.byte(131) = 0; return; } static void getbackfromops(Context & context) { - context._cmp(context.data.byte(56), 2); + context._cmp(context.ds.byte(56), 2); if (context.flags.z()) goto opsblock1; getback1(context); return; @@ -15923,19 +15923,19 @@ opsblock1: } static void showmainops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+10; context.bx = 52+10; context.al = 8; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+59; context.bx = 52+30; context.al = 7; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; @@ -15945,25 +15945,25 @@ static void showmainops(Context & context) { } static void showdiscops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+10; context.bx = 52+10; context.al = 9; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+59; context.bx = 52+30; context.al = 10; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -15979,30 +15979,30 @@ static void loadsavebox(Context & context) { } static void loadgame(Context & context) { - context._cmp(context.data.byte(100), 246); + context._cmp(context.ds.byte(100), 246); if (context.flags.z()) goto alreadyload; - context.data.byte(100) = 246; + context.ds.byte(100) = 246; context.al = 41; commandonly(context); alreadyload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noload; context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: return; doload: - context.data.byte(340) = 1; + context.ds.byte(340) = 1; showopbox(context); showloadops(context); - context.data.byte(341) = 0; + context.ds.byte(341) = 0; showslots(context); shownames(context); - context.data.byte(231) = 0; + context.ds.byte(231) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; loadops: delpointer(context); readmouse(context); @@ -16012,9 +16012,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.ds.byte(103), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16022,30 +16022,30 @@ loadops: context.bx = 7782; startloading(context); loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; + context.ds.byte(74) = 1; + context.ds.byte(188) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; startup(context); worktoscreen(context); - context.data.byte(103) = 4; + context.ds.byte(103) = 4; quitloaded: return; } static void getbacktoops(Context & context) { - context._cmp(context.data.byte(100), 201); + context._cmp(context.ds.byte(100), 201); if (context.flags.z()) goto alreadygetops; - context.data.byte(100) = 201; + context.ds.byte(100) = 201; context.al = 42; commandonly(context); alreadygetops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nogetbackops; context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; @@ -16053,19 +16053,19 @@ nogetbackops: return; dogetbackops: oldtonames(context); - context.data.byte(103) = 2; + context.ds.byte(103) = 2; return; } static void discops(Context & context) { - context._cmp(context.data.byte(100), 249); + context._cmp(context.ds.byte(100), 249); if (context.flags.z()) goto alreadydiscops; - context.data.byte(100) = 249; + context.ds.byte(100) = 249; context.al = 43; commandonly(context); alreadydiscops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto nodiscops; context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; @@ -16073,12 +16073,12 @@ nodiscops: return; dodiscops: scanfornames(context); - context.data.byte(340) = 2; + context.ds.byte(340) = 2; showopbox(context); showdiscops(context); - context.data.byte(341) = 0; + context.ds.byte(341) = 0; worktoscreenm(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; discopsloop: delpointer(context); readmouse(context); @@ -16088,39 +16088,39 @@ discopsloop: dumptextline(context); context.bx = 3777; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto discopsloop; return; } static void savegame(Context & context) { - context._cmp(context.data.byte(56), 2); + context._cmp(context.ds.byte(56), 2); if (!context.flags.z()) goto cansaveok; blank(context); return; cansaveok: - context._cmp(context.data.byte(100), 247); + context._cmp(context.ds.byte(100), 247); if (context.flags.z()) goto alreadysave; - context.data.byte(100) = 247; + context.ds.byte(100) = 247; context.al = 44; commandonly(context); alreadysave: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; return; dosave: - context.data.byte(340) = 2; + context.ds.byte(340) = 2; showopbox(context); showsaveops(context); - context.data.byte(341) = 0; + context.ds.byte(341) = 0; showslots(context); shownames(context); worktoscreenm(context); namestoold(context); - context.data.word(394) = 0; - context.data.word(396) = 0; - context.data.byte(103) = 0; + context.ds.word(394) = 0; + context.ds.word(396) = 0; + context.ds.byte(103) = 0; saveops: delpointer(context); checkinput(context); @@ -16131,33 +16131,33 @@ saveops: dumptextline(context); context.bx = 3819; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto saveops; return; } static void actualsave(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.ds.byte(100), 222); if (context.flags.z()) goto alreadyactsave; - context.data.byte(100) = 222; + context.ds.byte(100) = 222; context.al = 44; commandonly(context); alreadyactsave: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noactsave; context.dx = context.ds; context.ds = context.dx; context.si = 8367; - context.al = context.data.byte(341); + context.al = context.ds.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); context._add(context.si, context.ax); context._add(context.si, 1); - context._cmp(context.data.byte(context.si), 0); + context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto noactsave; - context.al = context.data.byte(9); + context.al = context.ds.byte(9); context.ah = 0; context.cx = 32; context._mul(context.cx); @@ -16169,102 +16169,102 @@ alreadyactsave: context.es = context.cs; context.cx = 16; while(--context.cx) context._movsw(); - context.al = context.data.byte(531); - context.data.byte(context.bx+13) = context.al; - context.al = context.data.byte(148); - context.data.byte(context.bx+15) = context.al; - context.al = context.data.byte(149); - context.data.byte(context.bx+16) = context.al; - context.al = context.data.byte(35); - context.data.byte(context.bx+20) = context.al; - context.al = context.data.byte(475); - context.data.byte(context.bx+21) = context.al; - context.al = context.data.byte(133); - context.data.byte(context.bx+22) = context.al; + context.al = context.ds.byte(531); + context.ds.byte(context.bx+13) = context.al; + context.al = context.ds.byte(148); + context.ds.byte(context.bx+15) = context.al; + context.al = context.ds.byte(149); + context.ds.byte(context.bx+16) = context.al; + context.al = context.ds.byte(35); + context.ds.byte(context.bx+20) = context.al; + context.al = context.ds.byte(475); + context.ds.byte(context.bx+21) = context.al; + context.al = context.ds.byte(133); + context.ds.byte(context.bx+22) = context.al; context.al = 255; - context.data.byte(context.bx+27) = context.al; + context.ds.byte(context.bx+27) = context.al; saveposition(context); getridoftemp(context); restoreall(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; redrawmainscrn(context); worktoscreenm(context); - context.data.byte(103) = 4; + context.ds.byte(103) = 4; noactsave: return; } static void actualload(Context & context) { - context._cmp(context.data.byte(100), 221); + context._cmp(context.ds.byte(100), 221); if (context.flags.z()) goto alreadyactload; - context.data.byte(100) = 221; + context.ds.byte(100) = 221; context.al = 41; commandonly(context); alreadyactload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto notactload; context._cmp(context.ax, 1); if (!context.flags.z()) goto notactload; context.dx = context.ds; context.ds = context.dx; context.si = 8367; - context.al = context.data.byte(341); + context.al = context.ds.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); context._add(context.si, context.ax); context._add(context.si, 1); - context._cmp(context.data.byte(context.si), 0); + context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto notactload; loadposition(context); - context.data.byte(103) = 1; + context.ds.byte(103) = 1; notactload: return; } static void selectslot2(Context & context) { - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto noselslot2; - context.data.byte(340) = 2; + context.ds.byte(340) = 2; noselslot2: selectslot(context); return; } static void checkinput(Context & context) { - context._cmp(context.data.byte(340), 3); + context._cmp(context.ds.byte(340), 3); if (context.flags.z()) goto nokeypress; readkey(context); - context.al = context.data.byte(142); + context.al = context.ds.byte(142); context._cmp(context.al, 0); if (context.flags.z()) goto nokeypress; context._cmp(context.al, 13); if (!context.flags.z()) goto notret; - context.data.byte(340) = 3; + context.ds.byte(340) = 3; goto afterkey; notret: context._cmp(context.al, 8); if (!context.flags.z()) goto nodel2; - context._cmp(context.data.byte(342), 0); + context._cmp(context.ds.byte(342), 0); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._sub(context.data.byte(342), 1); - context.data.byte(context.bx) = 0; - context.data.byte(context.bx+1) = 1; + context._sub(context.ds.byte(342), 1); + context.ds.byte(context.bx) = 0; + context.ds.byte(context.bx+1) = 1; goto afterkey; nodel2: spacepress: - context._cmp(context.data.byte(342), 14); + context._cmp(context.ds.byte(342), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._add(context.data.byte(342), 1); - context.al = context.data.byte(142); - context.data.byte(context.bx+1) = context.al; - context.data.byte(context.bx+2) = 0; - context.data.byte(context.bx+3) = 1; + context._add(context.ds.byte(342), 1); + context.al = context.ds.byte(142); + context.ds.byte(context.bx+1) = context.al; + context.ds.byte(context.bx+2) = 0; + context.ds.byte(context.bx+3) = 1; goto afterkey; nokeypress: return; @@ -16278,7 +16278,7 @@ afterkey: } static void getnamepos(Context & context) { - context.al = context.data.byte(341); + context.al = context.ds.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16286,20 +16286,20 @@ static void getnamepos(Context & context) { context.es = context.dx; context.bx = 8367; context._add(context.bx, context.ax); - context.al = context.data.byte(342); + context.al = context.ds.byte(342); context.ah = 0; context._add(context.bx, context.ax); return; } static void showopbox(Context & context) { - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60; context.bx = 52; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60; context.bx = 52+55; context.al = 4; @@ -16309,13 +16309,13 @@ static void showopbox(Context & context) { } static void showloadops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16330,13 +16330,13 @@ static void showloadops(Context & context) { } static void showsaveops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16351,35 +16351,35 @@ static void showsaveops(Context & context) { } static void selectslot(Context & context) { - context._cmp(context.data.byte(100), 244); + context._cmp(context.ds.byte(100), 244); if (context.flags.z()) goto alreadysel; - context.data.byte(100) = 244; + context.ds.byte(100) = 244; context.al = 45; commandonly(context); alreadysel: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto noselslot; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto noselslot; - context._cmp(context.data.byte(340), 3); + context._cmp(context.ds.byte(340), 3); if (!context.flags.z()) goto notnocurs; - context._sub(context.data.byte(340), 1); + context._sub(context.ds.byte(340), 1); notnocurs: oldtonames(context); - context.ax = context.data.word(200); + context.ax = context.ds.word(200); context._sub(context.ax, 52+4); context.cl = -1; getslotnum: context._add(context.cl, 1); context._sub(context.ax, 11); if (!context.flags.c()) goto getslotnum; - context.data.byte(341) = context.cl; + context.ds.byte(341) = context.cl; delpointer(context); showopbox(context); showslots(context); shownames(context); - context._cmp(context.data.byte(340), 1); + context._cmp(context.ds.byte(340), 1); if (context.flags.z()) goto isloadmode; showsaveops(context); readmouse(context); @@ -16402,7 +16402,7 @@ static void showslots(Context & context) { context.di = 60+7; context.bx = 52+8; context.al = 2; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 0; showframe(context); context.di = 60+10; @@ -16412,10 +16412,10 @@ slotloop: context.push(context.cx); context.push(context.di); context.push(context.bx); - context._cmp(context.cl, context.data.byte(341)); + context._cmp(context.cl, context.ds.byte(341)); if (!context.flags.z()) goto nomatchslot; context.al = 3; - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.ah = 0; showframe(context); nomatchslot: @@ -16443,9 +16443,9 @@ shownameloop: context.push(context.bx); context.push(context.si); context.al = 4; - context._cmp(context.cl, context.data.byte(341)); + context._cmp(context.cl, context.ds.byte(341)); if (!context.flags.z()) goto nomatchslot2; - context._cmp(context.data.byte(340), 2); + context._cmp(context.ds.byte(340), 2); if (!context.flags.z()) goto loadmode; context.dx = context.si; context.cx = 15; @@ -16453,29 +16453,29 @@ shownameloop: zerostill: context._sub(context.si, 1); context._sub(context.cl, 1); - context._cmp(context.data.byte(context.si), 1); + context._cmp(context.ds.byte(context.si), 1); if (!context.flags.z()) goto foundcharacter; goto zerostill; foundcharacter: - context.data.byte(342) = context.cl; - context.data.byte(context.si) = '/'; - context.data.byte(context.si+1) = 0; + context.ds.byte(342) = context.cl; + context.ds.byte(context.si) = '/'; + context.ds.byte(context.si+1) = 0; context.push(context.si); context.si = context.dx; context.dl = 200; context.ah = 0; printdirect(context); context.si = context.pop(); - context.data.byte(context.si) = 0; - context.data.byte(context.si+1) = 1; + context.ds.byte(context.si) = 0; + context.ds.byte(context.si+1) = 1; goto afterprintname; loadmode: context.al = 0; context.dl = 200; context.ah = 0; - context.data.word(71) = 91; + context.ds.word(71) = 91; printdirect(context); - context.data.word(71) = 0; + context.ds.word(71) = 0; goto afterprintname; nomatchslot2: context.dl = 200; @@ -16499,7 +16499,7 @@ static void namestoold(Context & context) { context.ds = context.cs; context.si = 8367; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16509,7 +16509,7 @@ static void oldtonames(Context & context) { context.es = context.cs; context.di = 8367; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16521,7 +16521,7 @@ static void makeheader(Context & context) { context.di = 5952; context.ax = 17; storeit(context); - context.ax = 68-context.data.byte(1); + context.ax = 68-context.ds.byte(1); storeit(context); context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; storeit(context); @@ -16529,7 +16529,7 @@ static void makeheader(Context & context) { storeit(context); context.ax = 48; storeit(context); - context.ax = 991-context.data.byte(537); + context.ax = 991-context.ds.byte(537); storeit(context); return; } @@ -16547,7 +16547,7 @@ static void findlen(Context & context) { context._sub(context.bx, 1); context._add(context.bx, context.ax); nextone: - context._cmp(context.cl, context.data.byte(context.bx)); + context._cmp(context.cl, context.ds.byte(context.bx)); if (!context.flags.z()) goto foundlen; context._sub(context.bx, 1); context._sub(context.ax, 1); @@ -16561,18 +16561,18 @@ static void decide(Context & context) { setmode(context); loadpalfromiff(context); clearpalette(context); - context.data.byte(234) = 0; - context.data.word(21) = 0; - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; + context.ds.byte(234) = 0; + context.ds.word(21) = 0; + context.ds.byte(231) = 0; + context.ds.word(79) = 70; + context.ds.word(81) = 182-8; + context.ds.byte(82) = 181; + context.ds.byte(131) = 1; loadsavebox(context); showdecisions(context); worktoscreen(context); fadescreenup(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; waitdecide: readmouse(context); showpointer(context); @@ -16582,22 +16582,22 @@ waitdecide: delpointer(context); context.bx = 4884; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto waitdecide; - context._cmp(context.data.byte(103), 4); + context._cmp(context.ds.byte(103), 4); if (context.flags.z()) goto hasloadedroom; getridoftemp(context); hasloadedroom: - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; return; } static void showdecisions(Context & context) { createpanel2(context); showopbox(context); - context.ds = context.data.word(458); + context.ds = context.ds.word(458); context.di = 60+17; context.bx = 52+13; context.al = 6; @@ -16608,31 +16608,31 @@ static void showdecisions(Context & context) { } static void newgame(Context & context) { - context._cmp(context.data.byte(100), 251); + context._cmp(context.ds.byte(100), 251); if (context.flags.z()) goto alreadynewgame; - context.data.byte(100) = 251; + context.ds.byte(100) = 251; context.al = 47; commandonly(context); alreadynewgame: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto nonewgame; - context.data.byte(103) = 3; + context.ds.byte(103) = 3; nonewgame: return; } static void doload(Context & context) { - context.data.byte(340) = 1; + context.ds.byte(340) = 1; showopbox(context); showloadops(context); - context.data.byte(341) = 0; + context.ds.byte(341) = 0; showslots(context); shownames(context); - context.data.byte(231) = 0; + context.ds.byte(231) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; loadops: delpointer(context); readmouse(context); @@ -16642,9 +16642,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.ds.byte(103), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.ds.byte(103), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16652,37 +16652,37 @@ loadops: context.bx = 7782; startloading(context); loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; + context.ds.byte(74) = 1; + context.ds.byte(188) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; startup(context); worktoscreen(context); - context.data.byte(103) = 4; + context.ds.byte(103) = 4; quitloaded: return; } static void loadold(Context & context) { - context._cmp(context.data.byte(100), 252); + context._cmp(context.ds.byte(100), 252); if (context.flags.z()) goto alreadyloadold; - context.data.byte(100) = 252; + context.ds.byte(100) = 252; context.al = 48; commandonly(context); alreadyloadold: - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noloadold; doload(context); - context._cmp(context.data.byte(103), 4); + context._cmp(context.ds.byte(103), 4); if (context.flags.z()) goto noloadold; showdecisions(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.ds.byte(103) = 0; noloadold: return; } @@ -16690,17 +16690,17 @@ noloadold: static void createname(Context & context) { context.push(context.ax); context.di = 4932; - context.data.byte(context.di+0) = context.dl; - context.data.byte(context.di+3) = context.cl; + context.ds.byte(context.di+0) = context.dl; + context.ds.byte(context.di+3) = context.cl; context.al = context.dh; context.ah = '0'-1; findten: context._add(context.ah, 1); context._sub(context.al, 10); if (!context.flags.c()) goto findten; - context.data.byte(context.di+1) = context.ah; + context.ds.byte(context.di+1) = context.ah; context._add(context.al, 10+'0'); - context.data.byte(context.di+2) = context.al; + context.ds.byte(context.di+2) = context.al; context.ax = context.pop(); context.cl = '0'-1; thousandsc: @@ -16708,60 +16708,60 @@ thousandsc: context._sub(context.ax, 1000); if (!context.flags.c()) goto thousandsc; context._add(context.ax, 1000); - context.data.byte(context.di+4) = context.cl; + context.ds.byte(context.di+4) = context.cl; context.cl = '0'-1; hundredsc: context._add(context.cl, 1); context._sub(context.ax, 100); if (!context.flags.c()) goto hundredsc; context._add(context.ax, 100); - context.data.byte(context.di+5) = context.cl; + context.ds.byte(context.di+5) = context.cl; context.cl = '0'-1; tensc: context._add(context.cl, 1); context._sub(context.ax, 10); if (!context.flags.c()) goto tensc; context._add(context.ax, 10); - context.data.byte(context.di+6) = context.cl; + context.ds.byte(context.di+6) = context.cl; context._add(context.al, '0'); - context.data.byte(context.di+7) = context.al; + context.ds.byte(context.di+7) = context.al; return; } static void trysoundalloc(Context & context) { - context._cmp(context.data.byte(358), 1); + context._cmp(context.ds.byte(358), 1); if (context.flags.z()) goto gotsoundbuff; - context._add(context.data.byte(357), 1); + context._add(context.ds.byte(357), 1); context.bx = (16384+2048)/16; allocatemem(context); - context.data.word(353) = context.ax; + context.ds.word(353) = context.ax; context.push(context.ax); context.al = context.ah; context.cl = 4; context._shr(context.al, context.cl); - context.data.byte(356) = context.al; + context.ds.byte(356) = context.al; context.ax = context.pop(); context.cl = 4; context._shl(context.ax, context.cl); - context.data.word(355) = context.ax; + context.ds.word(355) = context.ax; context._cmp(context.ax, 0x0b7ff); if (!context.flags.c()) goto soundfail; - context.es = context.data.word(353); + context.es = context.ds.word(353); context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; while(--context.cx) context._stosw(); - context.data.byte(358) = 1; + context.ds.byte(358) = 1; return; soundfail: - context.es = context.data.word(353); + context.es = context.ds.word(353); deallocatemem(context); gotsoundbuff: return; } static void playchannel0(Context & context) { - context._cmp(context.data.byte(378), 255); + context._cmp(context.ds.byte(378), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); context.push(context.ds); @@ -16769,34 +16769,34 @@ static void playchannel0(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(507) = context.al; - context.es = context.data.word(420); + context.ds.byte(507) = context.al; + context.es = context.ds.word(420); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank; - context.es = context.data.word(422); + context.es = context.ds.word(422); context._sub(context.al, 12); notsecondbank: - context.data.byte(508) = context.ah; + context.ds.byte(508) = context.ah; context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ah = 0; - context.data.word(502) = context.ax; - context.ax = context.data.word(context.bx+1); - context.data.word(504) = context.ax; - context.ax = context.data.word(context.bx+3); - context.data.word(506) = context.ax; - context._cmp(context.data.byte(508), 0); + context.al = context.ds.byte(context.bx); + context.ah = 0; + context.ds.word(502) = context.ax; + context.ax = context.ds.word(context.bx+1); + context.ds.word(504) = context.ax; + context.ax = context.ds.word(context.bx+3); + context.ds.word(506) = context.ax; + context._cmp(context.ds.byte(508), 0); if (context.flags.z()) goto nosetloop; - context.ax = context.data.word(502); - context.data.word(510) = context.ax; - context.ax = context.data.word(504); - context.data.word(512) = context.ax; - context.ax = context.data.word(506); - context.data.word(514) = context.ax; + context.ax = context.ds.word(502); + context.ds.word(510) = context.ax; + context.ax = context.ds.word(504); + context.ds.word(512) = context.ax; + context.ax = context.ds.word(506); + context.ds.word(514) = context.ax; nosetloop: context.si = context.pop(); context.di = context.pop(); @@ -16809,9 +16809,9 @@ dontbother4: } static void playchannel1(Context & context) { - context._cmp(context.data.byte(378), 255); + context._cmp(context.ds.byte(378), 255); if (context.flags.z()) goto dontbother5; - context._cmp(context.data.byte(515), 7); + context._cmp(context.ds.byte(515), 7); if (context.flags.z()) goto dontbother5; context.push(context.es); context.push(context.ds); @@ -16819,11 +16819,11 @@ static void playchannel1(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(515) = context.al; - context.es = context.data.word(420); + context.ds.byte(515) = context.al; + context.es = context.ds.word(420); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank1; - context.es = context.data.word(422); + context.es = context.ds.word(422); context._sub(context.al, 12); notsecondbank1: context.ah = 0; @@ -16831,13 +16831,13 @@ notsecondbank1: context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.ah = 0; - context.data.word(517) = context.ax; - context.ax = context.data.word(context.bx+1); - context.data.word(519) = context.ax; - context.ax = context.data.word(context.bx+3); - context.data.word(521) = context.ax; + context.ds.word(517) = context.ax; + context.ax = context.ds.word(context.bx+1); + context.ds.word(519) = context.ax; + context.ax = context.ds.word(context.bx+3); + context.ds.word(521) = context.ax; context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); @@ -16851,121 +16851,121 @@ dontbother5: static void makenextblock(Context & context) { volumeadjust(context); loopchannel0(context); - context._cmp(context.data.word(521), 0); + context._cmp(context.ds.word(521), 0); if (context.flags.z()) goto mightbeonlych0; - context._cmp(context.data.word(506), 0); + context._cmp(context.ds.word(506), 0); if (context.flags.z()) goto mightbeonlych1; - context._sub(context.data.word(506), 1); - context._sub(context.data.word(521), 1); + context._sub(context.ds.word(506), 1); + context._sub(context.ds.word(521), 1); bothchannels(context); return; mightbeonlych1: - context.data.byte(507) = 255; - context._cmp(context.data.word(521), 0); + context.ds.byte(507) = 255; + context._cmp(context.ds.word(521), 0); if (context.flags.z()) goto notch1only; - context._sub(context.data.word(521), 1); + context._sub(context.ds.word(521), 1); channel1only(context); notch1only: return; mightbeonlych0: - context.data.byte(515) = 255; - context._cmp(context.data.word(506), 0); + context.ds.byte(515) = 255; + context._cmp(context.ds.word(506), 0); if (context.flags.z()) goto notch0only; - context._sub(context.data.word(506), 1); + context._sub(context.ds.word(506), 1); channel0only(context); return; notch0only: - context.es = context.data.word(353); - context.di = context.data.word(525); + context.es = context.ds.word(353); + context.di = context.ds.word(525); context.cx = 1024; context.ax = 0x7f7f; while(--context.cx) context._stosw(); context._and(context.di, 16384-1); - context.data.word(525) = context.di; + context.ds.word(525) = context.di; return; } static void volumeadjust(Context & context) { - context.al = context.data.byte(388); + context.al = context.ds.byte(388); context._cmp(context.al, 0); if (context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._cmp(context.al, context.data.byte(387)); + context.al = context.ds.byte(386); + context._cmp(context.al, context.ds.byte(387)); if (context.flags.z()) goto volfinish; - context._add(context.data.byte(389), 64); + context._add(context.ds.byte(389), 64); if (!context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._add(context.al, context.data.byte(388)); - context.data.byte(386) = context.al; + context.al = context.ds.byte(386); + context._add(context.al, context.ds.byte(388)); + context.ds.byte(386) = context.al; return; volfinish: - context.data.byte(388) = 0; + context.ds.byte(388) = 0; volok: return; } static void loopchannel0(Context & context) { - context._cmp(context.data.word(506), 0); + context._cmp(context.ds.word(506), 0); if (!context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 0); + context._cmp(context.ds.byte(508), 0); if (context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 255); + context._cmp(context.ds.byte(508), 255); if (context.flags.z()) goto endlessloop; - context._sub(context.data.byte(508), 1); + context._sub(context.ds.byte(508), 1); endlessloop: - context.ax = context.data.word(510); - context.data.word(502) = context.ax; - context.ax = context.data.word(512); - context.data.word(504) = context.ax; - context.ax = context.data.word(506); - context._add(context.ax, context.data.word(514)); - context.data.word(506) = context.ax; + context.ax = context.ds.word(510); + context.ds.word(502) = context.ax; + context.ax = context.ds.word(512); + context.ds.word(504) = context.ax; + context.ax = context.ds.word(506); + context._add(context.ax, context.ds.word(514)); + context.ds.word(506) = context.ax; return; notloop: return; } static void cancelch0(Context & context) { - context.data.byte(508) = 0; - context.data.word(506) = 0; - context.data.byte(507) = 255; + context.ds.byte(508) = 0; + context.ds.word(506) = 0; + context.ds.byte(507) = 255; return; } static void cancelch1(Context & context) { - context.data.word(521) = 0; - context.data.byte(515) = 255; + context.ds.word(521) = 0; + context.ds.byte(515) = 255; return; } static void channel0tran(Context & context) { - context._cmp(context.data.byte(386), 0); + context._cmp(context.ds.byte(386), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(--context.cx) context._movsw(); return; lowvolumetran: context.cx = 1024; - context.bh = context.data.byte(386); + context.bh = context.ds.byte(386); context.bl = 0; context._add(context.bx, 16384-256); volloop: context._lodsw(); context.bl = context.al; - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.bl = context.ah; - context.ah = context.data.byte(context.bx); + context.ah = context.ds.byte(context.bx); context._stosw(); if (--context.cx) goto volloop; return; } static void domix(Context & context) { - context._cmp(context.data.byte(386), 0); + context._cmp(context.ds.byte(386), 0); if (!context.flags.z()) goto lowvolumemix; slow: context._lodsb(); - context.ah = context.data.byte(context.bx); + context.ah = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplot; @@ -17006,12 +17006,12 @@ nodistort: lowvolumemix: context._lodsb(); context.push(context.bx); - context.bh = context.data.byte(386); + context.bh = context.ds.byte(386); context._add(context.bh, 63); context.bl = context.al; - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.bx = context.pop(); - context.ah = context.data.byte(context.bx); + context.ah = context.ds.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplotv; @@ -17053,7 +17053,7 @@ doneit: } static void entrytexts(Context & context) { - context._cmp(context.data.byte(9), 21); + context._cmp(context.ds.byte(9), 21); if (!context.flags.z()) goto notloc15; context.al = 28; context.cx = 60; @@ -17063,7 +17063,7 @@ static void entrytexts(Context & context) { setuptimeduse(context); return; notloc15: - context._cmp(context.data.byte(9), 30); + context._cmp(context.ds.byte(9), 30); if (!context.flags.z()) goto notloc43; context.al = 27; context.cx = 60; @@ -17073,7 +17073,7 @@ notloc15: setuptimeduse(context); return; notloc43: - context._cmp(context.data.byte(9), 23); + context._cmp(context.ds.byte(9), 23); if (!context.flags.z()) goto notloc23; context.al = 29; context.cx = 60; @@ -17083,7 +17083,7 @@ notloc43: setuptimeduse(context); return; notloc23: - context._cmp(context.data.byte(9), 31); + context._cmp(context.ds.byte(9), 31); if (!context.flags.z()) goto notloc44; context.al = 30; context.cx = 60; @@ -17093,7 +17093,7 @@ notloc23: setuptimeduse(context); return; notloc44: - context._cmp(context.data.byte(9), 20); + context._cmp(context.ds.byte(9), 20); if (!context.flags.z()) goto notsarters2; context.al = 31; context.cx = 60; @@ -17103,7 +17103,7 @@ notloc44: setuptimeduse(context); return; notsarters2: - context._cmp(context.data.byte(9), 24); + context._cmp(context.ds.byte(9), 24); if (!context.flags.z()) goto notedenlob; context.al = 32; context.cx = 60; @@ -17113,7 +17113,7 @@ notsarters2: setuptimeduse(context); return; notedenlob: - context._cmp(context.data.byte(9), 34); + context._cmp(context.ds.byte(9), 34); if (!context.flags.z()) goto noteden2; context.al = 33; context.cx = 60; @@ -17127,71 +17127,71 @@ noteden2: } static void entryanims(Context & context) { - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.byte(9), 33); + context.ds.word(23) = -1; + context.ds.byte(32) = -1; + context._cmp(context.ds.byte(9), 33); if (!context.flags.z()) goto notinthebeach; switchryanoff(context); - context.data.word(21) = 76*2; - context.data.word(23) = 0; - context.data.word(25) = 76; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 76*2; + context.ds.word(23) = 0; + context.ds.word(25) = 76; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; return; notinthebeach: - context._cmp(context.data.byte(9), 44); + context._cmp(context.ds.byte(9), 44); if (!context.flags.z()) goto notsparkys; context.al = 8; resetlocation(context); - context.data.word(21) = 50*2; - context.data.word(23) = 247; - context.data.word(25) = 297; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 50*2; + context.ds.word(23) = 247; + context.ds.word(25) = 297; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; notsparkys: - context._cmp(context.data.byte(9), 22); + context._cmp(context.ds.byte(9), 22); if (!context.flags.z()) goto notinthelift; - context.data.word(21) = 31*2; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 31*2; + context.ds.word(23) = 0; + context.ds.word(25) = 30; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; notinthelift: - context._cmp(context.data.byte(9), 26); + context._cmp(context.ds.byte(9), 26); if (!context.flags.z()) goto notunderchurch; - context.data.byte(292) = 2; - context.data.byte(295) = 1; + context.ds.byte(292) = 2; + context.ds.byte(295) = 1; return; notunderchurch: - context._cmp(context.data.byte(9), 45); + context._cmp(context.ds.byte(9), 45); if (!context.flags.z()) goto notenterdream; - context.data.byte(54) = 0; - context.data.word(21) = 296; - context.data.word(23) = 45; - context.data.word(25) = 198; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.byte(54) = 0; + context.ds.word(21) = 296; + context.ds.word(23) = 45; + context.ds.word(25) = 198; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; notenterdream: - context._cmp(context.data.byte(184), 46); + context._cmp(context.ds.byte(184), 46); if (!context.flags.z()) goto notcrystal; - context._cmp(context.data.byte(43), 1); + context._cmp(context.ds.byte(43), 1); if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); return; notcrystal: - context._cmp(context.data.byte(9), 9); + context._cmp(context.ds.byte(9), 9); if (!context.flags.z()) goto nottopchurch; context.al = 2; checkifpathison(context); if (context.flags.z()) goto nottopchurch; - context._cmp(context.data.byte(44), 0); + context._cmp(context.ds.byte(44), 0); if (context.flags.z()) goto nottopchurch; context.al = 3; checkifpathison(context); @@ -17205,7 +17205,7 @@ makedoorsopen: placesetobject(context); return; nottopchurch: - context._cmp(context.data.byte(9), 47); + context._cmp(context.ds.byte(9), 47); if (!context.flags.z()) goto notdreamcentre; context.al = 4; placesetobject(context); @@ -17213,30 +17213,30 @@ nottopchurch: placesetobject(context); return; notdreamcentre: - context._cmp(context.data.byte(9), 38); + context._cmp(context.ds.byte(9), 38); if (!context.flags.z()) goto notcarpark; - context.data.word(21) = 57*2; - context.data.word(23) = 4; - context.data.word(25) = 57; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 57*2; + context.ds.word(23) = 4; + context.ds.word(25) = 57; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; notcarpark: - context._cmp(context.data.byte(9), 32); + context._cmp(context.ds.byte(9), 32); if (!context.flags.z()) goto notalley; - context.data.word(21) = 66*2; - context.data.word(23) = 0; - context.data.word(25) = 66; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.word(21) = 66*2; + context.ds.word(23) = 0; + context.ds.word(25) = 66; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; notalley: - context._cmp(context.data.byte(9), 24); + context._cmp(context.ds.byte(9), 24); if (!context.flags.z()) goto notedensagain; context.al = 2; - context.ah = context.data.byte(185); + context.ah = context.ds.byte(185); context._sub(context.ah, 1); turnanypathon(context); notedensagain: @@ -17244,7 +17244,7 @@ notedensagain: } static void initialinv(Context & context) { - context._cmp(context.data.byte(184), 24); + context._cmp(context.ds.byte(184), 24); if (context.flags.z()) goto isedens; return; isedens: @@ -17273,20 +17273,20 @@ isedens: context.al = 16; context.ah = 2; pickupob(context); - context.data.byte(32) = 1; - context.data.word(29) = 0; - context.data.word(31) = 6; - context.data.byte(27) = 1; - context.data.byte(26) = 1; + context.ds.byte(32) = 1; + context.ds.word(29) = 0; + context.ds.word(31) = 6; + context.ds.byte(27) = 1; + context.ds.byte(26) = 1; switchryanoff(context); return; } static void pickupob(Context & context) { - context.data.byte(107) = context.ah; - context.data.byte(102) = 2; - context.data.byte(89) = context.al; - context.data.byte(99) = context.al; + context.ds.byte(107) = context.ah; + context.ds.byte(102) = 2; + context.ds.byte(89) = context.al; + context.ds.byte(99) = context.al; getanyad(context); transfertoex(context); return; @@ -17297,10 +17297,10 @@ static void checkforemm(Context & context) { } static void checkbasemem(Context & context) { - context.bx = context.data.word(534); + context.bx = context.ds.word(534); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; - context.data.byte(532) = 5; + context.ds.byte(532) = 5; { quickquit(context); return; }; enoughmem: return; @@ -17309,86 +17309,86 @@ enoughmem: static void allocatebuffers(Context & context) { context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; allocatemem(context); - context.data.word(398) = context.ax; + context.ds.word(398) = context.ax; trysoundalloc(context); context.bx = 0+(66*60)/16; allocatemem(context); - context.data.word(418) = context.ax; + context.ds.word(418) = context.ax; trysoundalloc(context); - context.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-context.data.byte(537)+68-context.data.byte(1)/16; + context.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-context.ds.byte(537)+68-context.ds.byte(1)/16; allocatemem(context); - context.data.word(412) = context.ax; + context.ds.word(412) = context.ax; trysoundalloc(context); context.bx = 16*80/16; allocatemem(context); - context.data.word(426) = context.ax; + context.ds.word(426) = context.ax; trysoundalloc(context); context.bx = 64*128/16; allocatemem(context); - context.data.word(428) = context.ax; + context.ds.word(428) = context.ax; trysoundalloc(context); context.bx = 22*8*20*8/16; allocatemem(context); - context.data.word(402) = context.ax; + context.ds.word(402) = context.ax; allocatework(context); context.bx = 2048/16; allocatemem(context); - context.data.word(420) = context.ax; + context.ds.word(420) = context.ax; context.bx = 2048/16; allocatemem(context); - context.data.word(422) = context.ax; + context.ds.word(422) = context.ax; return; } static void clearbuffers(Context & context) { - context.es = context.data.word(412); - context.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-context.data.byte(537)+68-context.data.byte(1)/2; + context.es = context.ds.word(412); + context.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-context.ds.byte(537)+68-context.ds.byte(1)/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(398); + context.es = context.ds.word(398); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(412); + context.es = context.ds.word(412); context.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); context.ds = context.cs; context.si = 537; - context.cx = 991-context.data.byte(537); + context.cx = 991-context.ds.byte(537); while(--context.cx) context._movsb(); - context.es = context.data.word(412); - context.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-context.data.byte(537); + context.es = context.ds.word(412); + context.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-context.ds.byte(537); context.ds = context.cs; context.si = 1; - context.cx = 68-context.data.byte(1); + context.cx = 68-context.ds.byte(1); while(--context.cx) context._movsb(); clearchanges(context); return; } static void clearchanges(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.cx = 250*2; context.ax = 0x0ffff; context.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); while(--context.cx) context._stosw(); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.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); context.es = context.cs; context.di = 537; - context.cx = 991-context.data.byte(537); + context.cx = 991-context.ds.byte(537); while(--context.cx) context._movsb(); - context.ds = context.data.word(412); - context.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-context.data.byte(537); + context.ds = context.ds.word(412); + context.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-context.ds.byte(537); context.es = context.cs; context.di = 1; - context.cx = 68-context.data.byte(1); + context.cx = 68-context.ds.byte(1); while(--context.cx) context._movsb(); - context.data.byte(10) = 0; - context.data.word(12) = 0; - context.data.word(14) = 0; - context.es = context.data.word(398); + context.ds.byte(10) = 0; + context.ds.word(12) = 0; + context.ds.word(14) = 0; + context.es = context.ds.word(398); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; @@ -17409,85 +17409,85 @@ static void clearchanges(Context & context) { } static void clearbeforeload(Context & context) { - context._cmp(context.data.byte(74), 1); + context._cmp(context.ds.byte(74), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); - context.data.byte(74) = 0; + context.ds.byte(74) = 0; noclear: return; } static void clearreels(Context & context) { - context.es = context.data.word(430); + context.es = context.ds.word(430); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.ds.word(432); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.ds.word(434); deallocatemem(context); return; } static void clearrest(Context & context) { - context.es = context.data.word(418); + context.es = context.ds.word(418); context.cx = 66*60/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(416); + context.es = context.ds.word(416); deallocatemem(context); - context.es = context.data.word(444); + context.es = context.ds.word(444); deallocatemem(context); - context.es = context.data.word(450); + context.es = context.ds.word(450); deallocatemem(context); - context.es = context.data.word(448); + context.es = context.ds.word(448); deallocatemem(context); - context.es = context.data.word(440); + context.es = context.ds.word(440); deallocatemem(context); - context.es = context.data.word(442); + context.es = context.ds.word(442); deallocatemem(context); - context.es = context.data.word(436); + context.es = context.ds.word(436); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.ds.word(446); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.ds.word(438); deallocatemem(context); return; } static void seecommandtail(Context & context) { - context.data.word(372) = 0x220; - context.data.byte(378) = 5; - context.data.byte(379) = 1; - context.data.byte(73) = 0; + context.ds.word(372) = 0x220; + context.ds.byte(378) = 5; + context.ds.byte(379) = 1; + context.ds.byte(73) = 0; context.bx = 2; - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context.dx = context.es; context._sub(context.ax, context.dx); - context.data.word(534) = context.ax; + context.ds.word(534) = context.ax; context.bx = 0x02c; - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context.push(context.es); context.push(context.bx); context.es = context.ax; context.bx = 0; findblaster: - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0); if (context.flags.z()) goto endofenvironment; context._cmp(context.al, 'B'); if (!context.flags.z()) goto notblast; context._cmp(context.ah, 'L'); if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+2), 'A'); + context._cmp(context.ds.byte(context.bx+2), 'A'); if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+3), 'S'); + context._cmp(context.ds.byte(context.bx+3), 'S'); if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+4), 'T'); + context._cmp(context.ds.byte(context.bx+4), 'T'); if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+5), 'E'); + context._cmp(context.ds.byte(context.bx+5), 'E'); if (!context.flags.z()) goto notblast; - context._cmp(context.data.byte(context.bx+6), 'R'); + context._cmp(context.ds.byte(context.bx+6), 'R'); if (!context.flags.z()) goto notblast; context._add(context.bx, 7); parseblaster(context); @@ -17505,7 +17505,7 @@ endofenvironment: static void parseblaster(Context & context) { lookattail: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 0); if (context.flags.z()) goto endtail; context._cmp(context.al, 13); @@ -17534,35 +17534,35 @@ lookattail: if (--context.cx) goto lookattail; return; issoundint: - context.al = context.data.byte(context.bx+1); + context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(378) = context.al; + context.ds.byte(378) = context.al; context._add(context.bx, 1); goto lookattail; isdma: - context.al = context.data.byte(context.bx+1); + context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(379) = context.al; + context.ds.byte(379) = context.al; context._add(context.bx, 1); goto lookattail; isbaseadd: context.push(context.cx); - context.al = context.data.byte(context.bx+2); + context.al = context.ds.byte(context.bx+2); context._sub(context.al, '0'); context.ah = 0; context.cl = 4; context._shl(context.ax, context.cl); context._add(context.ax, 0x200); - context.data.word(372) = context.ax; + context.ds.word(372) = context.ax; context.cx = context.pop(); context._add(context.bx, 1); goto lookattail; isbright: - context.data.byte(73) = 1; + context.ds.byte(73) = 1; context._add(context.bx, 1); goto lookattail; isnosound: - context.data.byte(378) = 255; + context.ds.byte(378) = 255; context._add(context.bx, 1); goto lookattail; endtail: @@ -17570,10 +17570,10 @@ endtail: } static void startup(Context & context) { - context.data.byte(142) = 0; - context.data.byte(105) = 0; + context.ds.byte(142) = 0; + context.ds.byte(105) = 0; createpanel(context); - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17587,11 +17587,11 @@ static void startup(Context & context) { static void startup1(Context & context) { clearpalette(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; + context.ds.byte(61) = 0; + context.ds.byte(142) = '0'; + context.ds.byte(105) = 0; createpanel(context); - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17610,9 +17610,9 @@ static void screenupdate(Context & context) { mainscreen(context); animpointer(context); showpointer(context); - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto iswatchingmode; - context._cmp(context.data.byte(188), 255); + context._cmp(context.ds.byte(188), 255); if (!context.flags.z()) goto finishearly; iswatchingmode: vsync(context); @@ -17625,7 +17625,7 @@ iswatchingmode: watchcount(context); zoom(context); showpointer(context); - context._cmp(context.data.byte(391), 0); + context._cmp(context.ds.byte(391), 0); if (!context.flags.z()) goto finishearly; vsync(context); readmouse2(context); @@ -17654,74 +17654,74 @@ finishearly: } static void watchreel(Context & context) { - context._cmp(context.data.word(23), -1); + context._cmp(context.ds.word(23), -1); if (context.flags.z()) goto notplayingreel; - context.al = context.data.byte(475); - context._cmp(context.al, context.data.byte(477)); + context.al = context.ds.byte(475); + context._cmp(context.al, context.ds.byte(477)); if (!context.flags.z()) goto waitstopwalk; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.al = context.ds.byte(135); + context._cmp(context.al, context.ds.byte(133)); if (context.flags.z()) goto notwatchpath; waitstopwalk: return; notwatchpath: - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); + context._sub(context.ds.byte(26), 1); + context._cmp(context.ds.byte(26), -1); if (!context.flags.z()) goto showwatchreel; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context.ax = context.data.word(23); - context._cmp(context.ax, context.data.word(25)); + context.al = context.ds.byte(27); + context.ds.byte(26) = context.al; + context.ax = context.ds.word(23); + context._cmp(context.ax, context.ds.word(25)); if (!context.flags.z()) goto ismorereel; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto showwatchreel; - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.word(29), -1); + context.ds.word(23) = -1; + context.ds.byte(32) = -1; + context._cmp(context.ds.word(29), -1); if (context.flags.z()) goto nomorereel; - context.data.byte(32) = 1; + context.ds.byte(32) = 1; goto notplayingreel; ismorereel: - context._add(context.data.word(23), 1); + context._add(context.ds.word(23), 1); showwatchreel: - context.ax = context.data.word(23); - context.data.word(239) = context.ax; + context.ax = context.ds.word(23); + context.ds.word(239) = context.ax; plotreel(context); - context.ax = context.data.word(239); - context.data.word(23) = context.ax; + context.ax = context.ds.word(239); + context.ds.word(23) = context.ax; checkforshake(context); nomorereel: return; notplayingreel: - context._cmp(context.data.byte(32), 1); + context._cmp(context.ds.byte(32), 1); if (!context.flags.z()) goto notholdingreel; - context.ax = context.data.word(29); - context.data.word(239) = context.ax; + context.ax = context.ds.word(29); + context.ds.word(239) = context.ax; plotreel(context); return; notholdingreel: - context._cmp(context.data.byte(32), 2); + context._cmp(context.ds.byte(32), 2); if (!context.flags.z()) goto notreleasehold; - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); + context._sub(context.ds.byte(26), 1); + context._cmp(context.ds.byte(26), -1); if (!context.flags.z()) goto notlastspeed2; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context._add(context.data.word(29), 1); + context.al = context.ds.byte(27); + context.ds.byte(26) = context.al; + context._add(context.ds.word(29), 1); notlastspeed2: - context.ax = context.data.word(29); - context._cmp(context.ax, context.data.word(31)); + context.ax = context.ds.word(29); + context._cmp(context.ax, context.ds.word(31)); if (!context.flags.z()) goto ismorereel2; - context.data.word(29) = -1; - context.data.byte(32) = -1; - context.al = context.data.byte(33); - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; + context.ds.word(29) = -1; + context.ds.byte(32) = -1; + context.al = context.ds.byte(33); + context.ds.byte(478) = context.al; + context.ds.byte(477) = context.al; autosetwalk(context); return; ismorereel2: - context.ax = context.data.word(29); - context.data.word(239) = context.ax; + context.ax = context.ds.word(29); + context.ds.word(239) = context.ax; plotreel(context); return; notreleasehold: @@ -17729,22 +17729,22 @@ notreleasehold: } static void checkforshake(Context & context) { - context._cmp(context.data.byte(184), 26); + context._cmp(context.ds.byte(184), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; - context.data.byte(68) = -1; + context.ds.byte(68) = -1; notstartshake: return; } static void watchcount(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.ds.byte(3), 0); if (context.flags.z()) goto nowatchworn; - context._add(context.data.byte(146), 1); - context._cmp(context.data.byte(146), 9); + context._add(context.ds.byte(146), 1); + context._cmp(context.ds.byte(146), 9); if (context.flags.z()) goto flashdots; - context._cmp(context.data.byte(146), 18); + context._cmp(context.ds.byte(146), 18); if (context.flags.z()) goto uptime; nowatchworn: return; @@ -17752,89 +17752,89 @@ flashdots: context.ax = 91*3+21; context.di = 268+4; context.bx = 21; - context.ds = context.data.word(404); + context.ds = context.ds.word(404); showframe(context); goto finishwatch; uptime: - context.data.byte(146) = 0; - context._add(context.data.byte(5), 1); - context._cmp(context.data.byte(5), 60); + context.ds.byte(146) = 0; + context._add(context.ds.byte(5), 1); + context._cmp(context.ds.byte(5), 60); if (!context.flags.z()) goto finishtime; - context.data.byte(5) = 0; - context._add(context.data.byte(6), 1); - context._cmp(context.data.byte(6), 60); + context.ds.byte(5) = 0; + context._add(context.ds.byte(6), 1); + context._cmp(context.ds.byte(6), 60); if (!context.flags.z()) goto finishtime; - context.data.byte(6) = 0; - context._add(context.data.byte(7), 1); - context._cmp(context.data.byte(7), 24); + context.ds.byte(6) = 0; + context._add(context.ds.byte(7), 1); + context._cmp(context.ds.byte(7), 24); if (!context.flags.z()) goto finishtime; - context.data.byte(7) = 0; + context.ds.byte(7) = 0; finishtime: showtime(context); finishwatch: - context.data.byte(266) = 1; + context.ds.byte(266) = 1; return; } static void showtime(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.ds.byte(3), 0); if (context.flags.z()) goto nowatch; - context.al = context.data.byte(5); + context.al = context.ds.byte(5); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 282+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 282+9; context.bx = 21; showframe(context); - context.al = context.data.byte(6); + context.al = context.ds.byte(6); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 270+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 270+11; context.bx = 21; showframe(context); - context.al = context.data.byte(7); + context.al = context.ds.byte(7); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 256+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 256+11; context.bx = 21; showframe(context); context.ax = 91*3+20; - context.ds = context.data.word(404); + context.ds = context.ds.word(404); context.di = 267+5; context.bx = 21; showframe(context); @@ -17843,14 +17843,14 @@ nowatch: } static void dumpwatch(Context & context) { - context._cmp(context.data.byte(266), 1); + context._cmp(context.ds.byte(266), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; context.bx = 21; context.cl = 40; context.ch = 12; multidump(context); - context.data.byte(266) = 0; + context.ds.byte(266) = 0; nodumpwatch: return; } @@ -17862,11 +17862,11 @@ static void showbyte(Context & context) { context._shr(context.dl, 1); context._shr(context.dl, 1); onedigit(context); - context.data.byte(context.di) = context.dl; + context.ds.byte(context.di) = context.dl; context.dl = context.al; context._and(context.dl, 15); onedigit(context); - context.data.byte(context.di+1) = context.dl; + context.ds.byte(context.di+1) = context.dl; context._add(context.di, 3); return; } @@ -17904,7 +17904,7 @@ word1: if (!context.flags.c()) goto word1; context._add(context.ax, context.bx); convnum(context); - context.data.byte(context.di) = context.cl; + context.ds.byte(context.di) = context.cl; context.bx = 1000; context.cl = 47; word2: @@ -17913,7 +17913,7 @@ word2: if (!context.flags.c()) goto word2; context._add(context.ax, context.bx); convnum(context); - context.data.byte(context.di+1) = context.cl; + context.ds.byte(context.di+1) = context.cl; context.bx = 100; context.cl = 47; word3: @@ -17922,7 +17922,7 @@ word3: if (!context.flags.c()) goto word3; context._add(context.ax, context.bx); convnum(context); - context.data.byte(context.di+2) = context.cl; + context.ds.byte(context.di+2) = context.cl; context.bx = 10; context.cl = 47; word4: @@ -17931,11 +17931,11 @@ word4: if (!context.flags.c()) goto word4; context._add(context.ax, context.bx); convnum(context); - context.data.byte(context.di+3) = context.cl; + context.ds.byte(context.di+3) = context.cl; context._add(context.al, 48); context.cl = context.al; convnum(context); - context.data.byte(context.di+4) = context.cl; + context.ds.byte(context.di+4) = context.cl; return; } @@ -17955,57 +17955,57 @@ noconvnum: static void walkandexamine(Context & context) { finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); - context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); + context.al = context.ds.byte(307); + context.ds.byte(100) = context.al; + context.al = context.ds.byte(308); + context.ds.byte(99) = context.al; + context.ds.byte(306) = 0; + context._cmp(context.ds.byte(100), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(473) = 1; + context.ds.byte(473) = 1; noobselect: return; diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; + context.ds.byte(99) = context.al; + context.ds.byte(100) = context.ah; diff2: - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.ds.byte(133); + context._cmp(context.al, context.ds.byte(135)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.ds.byte(475); + context._cmp(context.bl, context.ds.byte(474)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); + context.cl = context.ds.byte(151); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.ds.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(153), 2); + context._cmp(context.ds.byte(153), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); + context._cmp(context.ds.byte(153), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.ds.byte(475); + context._cmp(context.bl, context.ds.byte(474)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); + context._cmp(context.ds.byte(100), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -18024,14 +18024,14 @@ toofaraway: } static void mainscreen(Context & context) { - context.data.byte(237) = 0; + context.ds.byte(237) = 0; context.bx = 4949; - context._cmp(context.data.byte(3), 1); + context._cmp(context.ds.byte(3), 1); if (context.flags.z()) goto checkmain; context.bx = 5011; checkmain: checkcoords(context); - context._cmp(context.data.byte(306), 0); + context._cmp(context.ds.byte(306), 0); if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: @@ -18039,48 +18039,48 @@ finishmain: } static void madmanrun(Context & context) { - context._cmp(context.data.byte(9), 14); + context._cmp(context.ds.byte(9), 14); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.ds.byte(234), 2); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(53), 0); + context._cmp(context.ds.byte(53), 0); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(100), 211); + context._cmp(context.ds.byte(100), 211); if (context.flags.z()) goto alreadyrun; - context.data.byte(100) = 211; + context.ds.byte(100) = 211; context.al = 52; commandonly(context); alreadyrun: - context._cmp(context.data.word(202), 1); + context._cmp(context.ds.word(202), 1); if (!context.flags.z()) goto norun; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.ds.word(202); + context._cmp(context.ax, context.ds.word(212)); if (context.flags.z()) goto norun; - context.data.byte(65) = 8; + context.ds.byte(65) = 8; norun: return; } static void checkcoords(Context & context) { loop048: - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nonefound; context.push(context.bx); - context._cmp(context.data.word(198), context.ax); + context._cmp(context.ds.word(198), context.ax); if (context.flags.l()) goto over045; - context.ax = context.data.word(context.bx+2); - context._cmp(context.data.word(198), context.ax); + context.ax = context.ds.word(context.bx+2); + context._cmp(context.ds.word(198), context.ax); if (!context.flags.ge()) goto over045; - context.ax = context.data.word(context.bx+4); - context._cmp(context.data.word(200), context.ax); + context.ax = context.ds.word(context.bx+4); + context._cmp(context.ds.word(200), context.ax); if (context.flags.l()) goto over045; - context.ax = context.data.word(context.bx+6); - context._cmp(context.data.word(200), context.ax); + context.ax = context.ds.word(context.bx+6); + context._cmp(context.ds.word(200), context.ax); if (!context.flags.ge()) goto over045; - context.ax = context.data.word(context.bx+8); + context.ax = context.ds.word(context.bx+8); __dispatch_call(context, context.ax); finished: context.ax = context.pop(); @@ -18094,31 +18094,31 @@ nonefound: } static void identifyob(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); + context.ax = context.ds.word(198); + context._sub(context.ax, context.ds.word(117)); context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); return; notover1: - context.bx = context.data.word(200); - context._sub(context.bx, context.data.word(119)); + context.bx = context.ds.word(200); + context._sub(context.bx, context.ds.word(119)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); return; notover2: - context.data.byte(237) = 1; + context.ds.byte(237) = 1; context.ah = context.bl; context.push(context.ax); findpathofpoint(context); - context.data.byte(474) = context.dl; + context.ds.byte(474) = context.dl; context.ax = context.pop(); context.push(context.ax); findfirstpath(context); - context.data.byte(476) = context.al; + context.ds.byte(476) = context.al; context.ax = context.pop(); checkifex(context); if (!context.flags.z()) goto finishidentify; @@ -18128,16 +18128,16 @@ notover2: if (!context.flags.z()) goto finishidentify; checkifset(context); if (!context.flags.z()) goto finishidentify; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); + context.ax = context.ds.word(198); + context._sub(context.ax, context.ds.word(117)); context.cl = context.al; - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); + context.ax = context.ds.word(200); + context._sub(context.ax, context.ds.word(119)); context.ch = context.al; checkone(context); context._cmp(context.al, 0); if (context.flags.z()) goto nothingund; - context._cmp(context.data.byte(56), 1); + context._cmp(context.ds.byte(56), 1); if (context.flags.z()) goto nothingund; context.ah = 3; obname(context); @@ -18149,33 +18149,33 @@ nothingund: } static void checkifperson(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.cx = 12; identifyreel: context.push(context.cx); - context._cmp(context.data.byte(context.bx+4), 255); + context._cmp(context.ds.byte(context.bx+4), 255); if (context.flags.z()) goto notareelid; context.push(context.es); context.push(context.bx); context.push(context.ax); - context.ax = context.data.word(context.bx+0); - context.data.word(239) = context.ax; + context.ax = context.ds.word(context.bx+0); + context.ds.word(239) = context.ax; getreelstart(context); - context._cmp(context.data.word(context.si+2), 0x0ffff); + context._cmp(context.ds.word(context.si+2), 0x0ffff); if (!context.flags.z()) goto notblankpers; context._add(context.si, 5); notblankpers: - context.cx = context.data.word(context.si+2); - context.ax = context.data.word(context.si+0); + context.cx = context.ds.word(context.si+2); + context.ax = context.ds.word(context.si+0); context.push(context.cx); getreelframeax(context); context.cx = context.pop(); - context._add(context.cl, context.data.byte(context.bx+4)); - context._add(context.ch, context.data.byte(context.bx+5)); + context._add(context.cl, context.ds.byte(context.bx+4)); + context._add(context.ch, context.ds.byte(context.bx+5)); context.dx = context.cx; - context._add(context.dl, context.data.byte(context.bx+0)); - context._add(context.dh, context.data.byte(context.bx+1)); + context._add(context.dl, context.ds.byte(context.bx+0)); + context._add(context.dh, context.ds.byte(context.bx+1)); context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); @@ -18188,9 +18188,9 @@ notblankpers: context._cmp(context.ah, context.dh); if (!context.flags.c()) goto notareelid; context.cx = context.pop(); - context.ax = context.data.word(context.bx+2); - context.data.word(249) = context.ax; - context.al = context.data.byte(context.bx+4); + context.ax = context.ds.word(context.bx+2); + context.ds.word(249) = context.ax; + context.al = context.ds.byte(context.bx+4); context.ah = 5; obname(context); context.al = 0; @@ -18205,25 +18205,25 @@ notareelid: } static void checkifset(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; identifyset: - context._cmp(context.data.byte(context.bx+4), 255); + context._cmp(context.ds.byte(context.bx+4), 255); if (context.flags.z()) goto notasetid; - context._cmp(context.al, context.data.byte(context.bx)); + context._cmp(context.al, context.ds.byte(context.bx)); if (context.flags.c()) goto notasetid; - context._cmp(context.al, context.data.byte(context.bx+2)); + context._cmp(context.al, context.ds.byte(context.bx+2)); if (!context.flags.c()) goto notasetid; - context._cmp(context.ah, context.data.byte(context.bx+1)); + context._cmp(context.ah, context.ds.byte(context.bx+1)); if (context.flags.c()) goto notasetid; - context._cmp(context.ah, context.data.byte(context.bx+3)); + context._cmp(context.ah, context.ds.byte(context.bx+3)); if (!context.flags.c()) goto notasetid; pixelcheckset(context); if (context.flags.z()) goto notasetid; isitdescribed(context); if (context.flags.z()) goto notasetid; - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 1; obname(context); context.al = 0; @@ -18238,21 +18238,21 @@ notasetid: } static void checkifex(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; identifyex: - context._cmp(context.data.byte(context.bx+4), 255); + context._cmp(context.ds.byte(context.bx+4), 255); if (context.flags.z()) goto notanexid; - context._cmp(context.al, context.data.byte(context.bx)); + context._cmp(context.al, context.ds.byte(context.bx)); if (context.flags.c()) goto notanexid; - context._cmp(context.al, context.data.byte(context.bx+2)); + context._cmp(context.al, context.ds.byte(context.bx+2)); if (!context.flags.c()) goto notanexid; - context._cmp(context.ah, context.data.byte(context.bx+1)); + context._cmp(context.ah, context.ds.byte(context.bx+1)); if (context.flags.c()) goto notanexid; - context._cmp(context.ah, context.data.byte(context.bx+3)); + context._cmp(context.ah, context.ds.byte(context.bx+3)); if (!context.flags.c()) goto notanexid; - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 4; obname(context); context.al = 1; @@ -18267,21 +18267,21 @@ notanexid: } static void checkiffree(Context & context) { - context.es = context.data.word(412); + context.es = context.ds.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; identifyfree: - context._cmp(context.data.byte(context.bx+4), 255); + context._cmp(context.ds.byte(context.bx+4), 255); if (context.flags.z()) goto notafreeid; - context._cmp(context.al, context.data.byte(context.bx)); + context._cmp(context.al, context.ds.byte(context.bx)); if (context.flags.c()) goto notafreeid; - context._cmp(context.al, context.data.byte(context.bx+2)); + context._cmp(context.al, context.ds.byte(context.bx+2)); if (!context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.data.byte(context.bx+1)); + context._cmp(context.ah, context.ds.byte(context.bx+1)); if (context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.data.byte(context.bx+3)); + context._cmp(context.ah, context.ds.byte(context.bx+3)); if (!context.flags.c()) goto notafreeid; - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 2; obname(context); context.al = 0; @@ -18300,16 +18300,16 @@ static void isitdescribed(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.bx); - context.al = context.data.byte(context.bx+4); + context.al = context.ds.byte(context.bx+4); context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(440); + context.es = context.ds.word(440); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); context.bx = context.ax; - context.dl = context.data.byte(context.bx); + context.dl = context.ds.byte(context.bx); context.bx = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -18321,8 +18321,8 @@ static void isitdescribed(Context & context) { static void findpathofpoint(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); + context.es = context.ds.word(450); + context.al = context.ds.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18330,17 +18330,17 @@ static void findpathofpoint(Context & context) { context.cx = context.pop(); context.dl = 0; pathloop: - context.al = context.data.byte(context.bx+6); + context.al = context.ds.byte(context.bx+6); context._cmp(context.al, 255); if (!context.flags.z()) goto flunkedit; - context.ax = context.data.word(context.bx+2); + context.ax = context.ds.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto flunkedit; context._cmp(context.cl, context.al); if (context.flags.c()) goto flunkedit; context._cmp(context.ch, context.ah); if (context.flags.c()) goto flunkedit; - context.ax = context.data.word(context.bx+4); + context.ax = context.ds.word(context.bx+4); context._cmp(context.cl, context.al); if (!context.flags.c()) goto flunkedit; context._cmp(context.ch, context.ah); @@ -18359,8 +18359,8 @@ gotvalidpath: static void findfirstpath(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); + context.es = context.ds.word(450); + context.al = context.ds.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18368,14 +18368,14 @@ static void findfirstpath(Context & context) { context.cx = context.pop(); context.dl = 0; fpathloop: - context.ax = context.data.word(context.bx+2); + context.ax = context.ds.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nofirst; context._cmp(context.cl, context.al); if (context.flags.c()) goto nofirst; context._cmp(context.ch, context.ah); if (context.flags.c()) goto nofirst; - context.ax = context.data.word(context.bx+4); + context.ax = context.ds.word(context.bx+4); context._cmp(context.cl, context.al); if (!context.flags.c()) goto nofirst; context._cmp(context.ch, context.ah); @@ -18389,7 +18389,7 @@ nofirst: context.al = 0; return; gotfirst: - context.al = context.data.byte(context.bx+6); + context.al = context.ds.byte(context.bx+6); return; } @@ -18397,7 +18397,7 @@ static void turnpathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; - context.ch = context.data.byte(185); + context.ch = context.ds.byte(185); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18411,7 +18411,7 @@ static void turnpathon(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 255; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; nopathon: return; } @@ -18420,7 +18420,7 @@ static void turnpathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; - context.ch = context.data.byte(185); + context.ch = context.ds.byte(185); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18434,7 +18434,7 @@ static void turnpathoff(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; nopathoff: return; } @@ -18451,7 +18451,7 @@ static void turnanypathon(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18461,7 +18461,7 @@ static void turnanypathon(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 255; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; return; } @@ -18477,7 +18477,7 @@ static void turnanypathoff(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18487,7 +18487,7 @@ static void turnanypathoff(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; return; } @@ -18500,33 +18500,33 @@ static void checkifpathison(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx+6); + context.al = context.ds.byte(context.bx+6); context._cmp(context.al, 255); return; } static void afternewroom(Context & context) { - context._cmp(context.data.byte(186), 0); + context._cmp(context.ds.byte(186), 0); if (context.flags.z()) goto notnew; - context.data.word(328) = 0; + context.ds.word(328) = 0; createpanel(context); - context.data.byte(100) = 0; + context.ds.byte(100) = 0; findroominloc(context); - context._cmp(context.data.byte(63), 1); + context._cmp(context.ds.byte(63), 1); if (context.flags.z()) goto ryansoff; - context.al = context.data.byte(151); + context.al = context.ds.byte(151); context._add(context.al, 12); - context.ah = context.data.byte(152); + context.ah = context.ds.byte(152); context._add(context.ah, 12); findpathofpoint(context); - context.data.byte(475) = context.dl; + context.ds.byte(475) = context.dl; findxyfrompath(context); - context.data.byte(187) = 1; + context.ds.byte(187) = 1; ryansoff: - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); - context.data.word(98) = 160; - context.data.byte(186) = 0; + context.ds.word(98) = 160; + context.ds.byte(186) = 0; showicon(context); spriteupdate(context); printsprites(context); @@ -18544,50 +18544,50 @@ notnew: } static void atmospheres(Context & context) { - context.cl = context.data.byte(148); - context.ch = context.data.byte(149); + context.cl = context.ds.byte(148); + context.ch = context.ds.byte(149); context.bx = 5073; nextatmos: - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto nomoreatmos; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.ds.byte(184)); if (!context.flags.z()) goto wrongatmos; - context.ax = context.data.word(context.bx+1); + context.ax = context.ds.word(context.bx+1); context._cmp(context.ax, context.cx); if (!context.flags.z()) goto wrongatmos; - context.ax = context.data.word(context.bx+3); - context._cmp(context.al, context.data.byte(507)); + context.ax = context.ds.word(context.bx+3); + context._cmp(context.al, context.ds.byte(507)); if (context.flags.z()) goto playingalready; - context._cmp(context.data.byte(9), 45); + context._cmp(context.ds.byte(9), 45); if (!context.flags.z()) goto notweb; - context._cmp(context.data.word(23), 45); + context._cmp(context.ds.word(23), 45); if (context.flags.z()) goto wrongatmos; notweb: playchannel0(context); - context._cmp(context.data.byte(184), 2); - context._cmp(context.data.byte(149), 0); + context._cmp(context.ds.byte(184), 2); + context._cmp(context.ds.byte(149), 0); if (context.flags.z()) goto fullvol; if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(149), 10); + context._cmp(context.ds.byte(149), 10); if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (!context.flags.z()) goto notlouisvol; - context.data.byte(386) = 5; + context.ds.byte(386) = 5; notlouisvol: playingalready: - context._cmp(context.data.byte(184), 2); + context._cmp(context.ds.byte(184), 2); if (!context.flags.z()) goto notlouisvol2; - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (context.flags.z()) goto louisvol; - context._cmp(context.data.byte(148), 11); + context._cmp(context.ds.byte(148), 11); if (!context.flags.z()) goto notlouisvol2; fullvol: - context.data.byte(386) = 0; + context.ds.byte(386) = 0; notlouisvol2: return; louisvol: - context.data.byte(386) = 5; + context.ds.byte(386) = 5; return; wrongatmos: context._add(context.bx, 5); @@ -18598,126 +18598,126 @@ nomoreatmos: } static void walkintoroom(Context & context) { - context._cmp(context.data.byte(9), 14); + context._cmp(context.ds.byte(9), 14); if (!context.flags.z()) goto notlair; - context._cmp(context.data.byte(148), 22); + context._cmp(context.ds.byte(148), 22); if (!context.flags.z()) goto notlair; - context.data.byte(478) = 1; - context.data.byte(477) = 1; + context.ds.byte(478) = 1; + context.ds.byte(477) = 1; autosetwalk(context); notlair: return; } static void afterintroroom(Context & context) { - context._cmp(context.data.byte(186), 0); + context._cmp(context.ds.byte(186), 0); if (context.flags.z()) goto notnewintro; clearwork(context); findroominloc(context); - context.data.byte(62) = 1; + context.ds.byte(62) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); printsprites(context); worktoscreen(context); - context.data.byte(186) = 0; + context.ds.byte(186) = 0; notnewintro: return; } static void obname(Context & context) { - context._cmp(context.data.byte(473), 0); + context._cmp(context.ds.byte(473), 0); if (context.flags.z()) goto notnewpath; - context.data.byte(473) = 0; + context.ds.byte(473) = 0; goto diff; notnewpath: - context._cmp(context.ah, context.data.byte(100)); + context._cmp(context.ah, context.ds.byte(100)); if (context.flags.z()) goto notdiffob; goto diff; notdiffob: - context._cmp(context.al, context.data.byte(99)); + context._cmp(context.al, context.ds.byte(99)); if (!context.flags.z()) goto diff; - context._cmp(context.data.byte(306), 1); + context._cmp(context.ds.byte(306), 1); if (context.flags.z()) goto walkandexamine; - context._cmp(context.data.word(202), 0); + context._cmp(context.ds.word(202), 0); if (context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (!context.flags.z()) goto isntblock; - context._cmp(context.data.byte(153), 2); + context._cmp(context.ds.byte(153), 2); if (context.flags.c()) goto noobselect; isntblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.ds.byte(475); + context._cmp(context.bl, context.ds.byte(474)); if (!context.flags.z()) goto wantstowalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (context.flags.z()) goto wantstowalk; finishedwalking(context); if (!context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 5); + context._cmp(context.ds.byte(100), 5); if (context.flags.z()) goto wantstotalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto noobselect; examineob(context); return; wantstotalk: - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto noobselect; talk(context); return; walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); - context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); + context.al = context.ds.byte(307); + context.ds.byte(100) = context.al; + context.al = context.ds.byte(308); + context.ds.byte(99) = context.al; + context.ds.byte(306) = 0; + context._cmp(context.ds.byte(100), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(473) = 1; + context.ds.byte(473) = 1; noobselect: return; diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; + context.ds.byte(99) = context.al; + context.ds.byte(100) = context.ah; diff2: - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.ds.byte(133); + context._cmp(context.al, context.ds.byte(135)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.ds.byte(475); + context._cmp(context.bl, context.ds.byte(474)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); + context.cl = context.ds.byte(151); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.ds.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(153), 2); + context._cmp(context.ds.byte(153), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); + context._cmp(context.ds.byte(153), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.ds.byte(475); + context._cmp(context.bl, context.ds.byte(474)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); + context._cmp(context.ds.byte(100), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -18736,17 +18736,17 @@ toofaraway: } static void finishedwalking(Context & context) { - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto iswalking; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.ds.byte(133); + context._cmp(context.al, context.ds.byte(135)); iswalking: return; } static void examineobtext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(100); context.al = 1; commandwithob(context); return; @@ -18775,13 +18775,13 @@ static void commandwithob(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); + context.es = context.ds.word(452); + context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); + context.di = context.ds.word(79); + context.bx = context.ds.word(81); + context.dl = context.ds.byte(82); context.al = 0; context.ah = 0; printdirect(context); @@ -18789,19 +18789,19 @@ static void commandwithob(Context & context) { context.di = 5674; copyname(context); context.ax = context.pop(); - context.di = context.data.word(84); + context.di = context.ds.word(84); context._cmp(context.al, 0); if (context.flags.z()) goto noadd; context._add(context.di, 5); noadd: - context.bx = context.data.word(81); + context.bx = context.ds.word(81); context.es = context.cs; context.si = 5674; - context.dl = context.data.byte(82); + context.dl = context.ds.byte(82); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(109) = 1; + context.ds.byte(109) = 1; return; } @@ -18826,17 +18826,17 @@ static void commandonly(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); + context.es = context.ds.word(452); + context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); + context.di = context.ds.word(79); + context.bx = context.ds.word(81); + context.dl = context.ds.byte(82); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(109) = 1; + context.ds.byte(109) = 1; return; } @@ -18847,8 +18847,8 @@ static void printmessage(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); + context.es = context.ds.word(452); + context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.di = context.pop(); @@ -18868,8 +18868,8 @@ static void printmessage2(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); - context.ax = context.data.word(context.bx); + context.es = context.ds.word(452); + context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.ax = context.pop(); @@ -18889,63 +18889,63 @@ searchmess: } static void blocknametext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(100); context.al = 0; commandwithob(context); return; } static void personnametext(Context & context) { - context.bl = context.data.byte(99); + context.bl = context.ds.byte(99); context._and(context.bl, 127); - context.bh = context.data.byte(100); + context.bh = context.ds.byte(100); context.al = 2; commandwithob(context); return; } static void walktotext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.ds.byte(99); + context.bh = context.ds.byte(100); context.al = 3; commandwithob(context); return; } static void getflagunderp(Context & context) { - context.cx = context.data.word(198); - context._sub(context.cx, context.data.word(117)); - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); + context.cx = context.ds.word(198); + context._sub(context.cx, context.ds.word(117)); + context.ax = context.ds.word(200); + context._sub(context.ax, context.ds.word(119)); context.ch = context.al; checkone(context); - context.data.byte(153) = context.cl; - context.data.byte(154) = context.ch; + context.ds.byte(153) = context.cl; + context.ds.byte(154) = context.ch; return; } static void setwalk(Context & context) { - context._cmp(context.data.byte(492), 254); + context._cmp(context.ds.byte(492), 254); if (!context.flags.z()) goto alreadywalking; - context.al = context.data.byte(474); - context._cmp(context.al, context.data.byte(475)); + context.al = context.ds.byte(474); + context._cmp(context.al, context.ds.byte(475)); if (context.flags.z()) goto cantwalk2; - context._cmp(context.data.byte(32), 1); + context._cmp(context.ds.byte(32), 1); if (context.flags.z()) goto holdingreel; - context._cmp(context.data.byte(32), 2); + context._cmp(context.ds.byte(32), 2); if (context.flags.z()) goto cantwalk; - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; - context._cmp(context.data.word(202), 2); + context.ds.byte(478) = context.al; + context.ds.byte(477) = context.al; + context._cmp(context.ds.word(202), 2); if (!context.flags.z()) goto notwalkandexam; - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (context.flags.z()) goto notwalkandexam; - context.data.byte(306) = 1; - context.al = context.data.byte(100); - context.data.byte(307) = context.al; - context.al = context.data.byte(99); - context.data.byte(308) = context.al; + context.ds.byte(306) = 1; + context.al = context.ds.byte(100); + context.ds.byte(307) = context.al; + context.al = context.ds.byte(99); + context.ds.byte(308) = context.al; notwalkandexam: autosetwalk(context); cantwalk: @@ -18954,95 +18954,95 @@ cantwalk2: facerightway(context); return; alreadywalking: - context.al = context.data.byte(474); - context.data.byte(477) = context.al; + context.al = context.ds.byte(474); + context.ds.byte(477) = context.al; return; holdingreel: - context.data.byte(33) = context.al; - context.data.byte(32) = 2; + context.ds.byte(33) = context.al; + context.ds.byte(32) = 2; return; } static void autosetwalk(Context & context) { - context.al = context.data.byte(475); - context._cmp(context.data.byte(477), context.al); + context.al = context.ds.byte(475); + context._cmp(context.ds.byte(477), context.al); if (!context.flags.z()) goto notsamealready; return; notsamealready: getroomspaths(context); checkdest(context); context.push(context.bx); - context.al = context.data.byte(475); + context.al = context.ds.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(480) = context.ax; - context.al = context.data.byte(context.bx+1); + context.ds.word(480) = context.ax; + context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(482) = context.ax; + context.ds.word(482) = context.ax; context.bx = context.pop(); - context.al = context.data.byte(478); + context.al = context.ds.byte(478); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); + context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(484) = context.ax; - context.al = context.data.byte(context.bx+1); + context.ds.word(484) = context.ax; + context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(486) = context.ax; + context.ds.word(486) = context.ax; bresenhams(context); - context._cmp(context.data.byte(493), 0); + context._cmp(context.ds.byte(493), 0); if (context.flags.z()) goto normalline; - context.al = context.data.byte(494); + context.al = context.ds.byte(494); context._sub(context.al, 1); - context.data.byte(492) = context.al; - context.data.byte(493) = 1; + context.ds.byte(492) = context.al; + context.ds.byte(493) = 1; return; normalline: - context.data.byte(492) = 0; + context.ds.byte(492) = 0; return; } static void checkdest(Context & context) { context.push(context.bx); context._add(context.bx, 12*8); - context.ah = context.data.byte(475); + context.ah = context.ds.byte(475); context.cl = 4; context._shl(context.ah, context.cl); - context.al = context.data.byte(478); + context.al = context.ds.byte(478); context.cl = 24; - context.ch = context.data.byte(478); + context.ch = context.ds.byte(478); checkdestloop: - context.dh = context.data.byte(context.bx); + context.dh = context.ds.byte(context.bx); context._and(context.dh, 0xf0); - context.dl = context.data.byte(context.bx); + context.dl = context.ds.byte(context.bx); context._and(context.dl, 0xf); context._cmp(context.ax, context.dx); if (!context.flags.z()) goto nextcheck; - context.al = context.data.byte(context.bx+1); + context.al = context.ds.byte(context.bx+1); context._and(context.al, 15); - context.data.byte(478) = context.al; + context.ds.byte(478) = context.al; context.bx = context.pop(); return; nextcheck: - context.dl = context.data.byte(context.bx); + context.dl = context.ds.byte(context.bx); context._and(context.dl, 0xf0); context._shr(context.dl, 1); context._shr(context.dl, 1); context._shr(context.dl, 1); context._shr(context.dl, 1); - context.dh = context.data.byte(context.bx); + context.dh = context.ds.byte(context.bx); context._and(context.dh, 0xf); context._shl(context.dh, 1); context._shl(context.dh, 1); @@ -19050,13 +19050,13 @@ nextcheck: context._shl(context.dh, 1); context._cmp(context.ax, context.dx); if (!context.flags.z()) goto nextcheck2; - context.ch = context.data.byte(context.bx+1); + context.ch = context.ds.byte(context.bx+1); context._and(context.ch, 15); nextcheck2: context._add(context.bx, 2); context._sub(context.cl, 1); if (!context.flags.z()) goto checkdestloop; - context.data.byte(478) = context.ch; + context.ds.byte(478) = context.ch; context.bx = context.pop(); return; } @@ -19067,60 +19067,60 @@ static void bresenhams(Context & context) { context.es = context.dx; context.di = 8344; context.si = 1; - context.data.byte(493) = 0; - context.cx = context.data.word(484); - context._sub(context.cx, context.data.word(480)); + context.ds.byte(493) = 0; + context.cx = context.ds.word(484); + context._sub(context.cx, context.ds.word(480)); if (context.flags.z()) goto vertline; if (!context.flags.s()) goto line1; context._neg(context.cx); - context.bx = context.data.word(484); - context._xchg(context.bx, context.data.word(480)); - context.data.word(484) = context.bx; - context.bx = context.data.word(486); - context._xchg(context.bx, context.data.word(482)); - context.data.word(486) = context.bx; - context.data.byte(493) = 1; + context.bx = context.ds.word(484); + context._xchg(context.bx, context.ds.word(480)); + context.ds.word(484) = context.bx; + context.bx = context.ds.word(486); + context._xchg(context.bx, context.ds.word(482)); + context.ds.word(486) = context.bx; + context.ds.byte(493) = 1; line1: - context.bx = context.data.word(486); - context._sub(context.bx, context.data.word(482)); + context.bx = context.ds.word(486); + context._sub(context.bx, context.ds.word(482)); if (context.flags.z()) goto horizline; if (!context.flags.s()) goto line3; context._neg(context.bx); context._neg(context.si); line3: context.push(context.si); - context.data.byte(491) = 0; + context.ds.byte(491) = 0; context._cmp(context.bx, context.cx); if (context.flags.le()) goto line4; - context.data.byte(491) = 1; + context.ds.byte(491) = 1; context._xchg(context.bx, context.cx); line4: context._shl(context.bx, 1); - context.data.word(488) = context.bx; + context.ds.word(488) = context.bx; context._sub(context.bx, context.cx); context.si = context.bx; context._sub(context.bx, context.cx); - context.data.word(490) = context.bx; - context.ax = context.data.word(480); - context.bx = context.data.word(482); + context.ds.word(490) = context.bx; + context.ax = context.ds.word(480); + context.bx = context.ds.word(482); context.ah = context.bl; context._add(context.cx, 1); context.bx = context.pop(); - context._cmp(context.data.byte(491), 1); + context._cmp(context.ds.byte(491), 1); if (context.flags.z()) goto hislope; goto loslope; vertline: - context.ax = context.data.word(482); - context.bx = context.data.word(486); + context.ax = context.ds.word(482); + context.bx = context.ds.word(486); context.cx = context.bx; context._sub(context.cx, context.ax); if (!context.flags.ge()) goto line31; context._neg(context.cx); context.ax = context.bx; - context.data.byte(493) = 1; + context.ds.byte(493) = 1; line31: context._add(context.cx, 1); - context.bx = context.data.word(480); + context.bx = context.ds.word(480); context._xchg(context.ax, context.bx); context.ah = context.bl; context.bx = context.si; @@ -19130,8 +19130,8 @@ line32: if (--context.cx) goto line32; goto lineexit; horizline: - context.ax = context.data.word(480); - context.bx = context.data.word(482); + context.ax = context.ds.word(480); + context.bx = context.ds.word(482); context.ah = context.bl; context._add(context.cx, 1); horizloop: @@ -19145,11 +19145,11 @@ loloop: context._add(context.al, 1); context._or(context.si, context.si); if (!context.flags.s()) goto line12; - context._add(context.si, context.data.word(488)); + context._add(context.si, context.ds.word(488)); if (--context.cx) goto loloop; goto lineexit; line12: - context._add(context.si, context.data.word(490)); + context._add(context.si, context.ds.word(490)); context._add(context.ah, context.bl); if (--context.cx) goto loloop; goto lineexit; @@ -19159,33 +19159,33 @@ hiloop: context._add(context.ah, context.bl); context._or(context.si, context.si); if (!context.flags.s()) goto line23; - context._add(context.si, context.data.word(488)); + context._add(context.si, context.ds.word(488)); if (--context.cx) goto hiloop; goto lineexit; line23: - context._add(context.si, context.data.word(490)); + context._add(context.si, context.ds.word(490)); context._add(context.al, 1); if (--context.cx) goto hiloop; lineexit: context._sub(context.di, 8344); context.ax = context.di; context._shr(context.ax, 1); - context.data.byte(494) = context.al; + context.ds.byte(494) = context.al; return; } static void workoutframes(Context & context) { - context.bx = context.data.word(480); + context.bx = context.ds.word(480); context._add(context.bx, 32); - context.ax = context.data.word(484); + context.ax = context.ds.word(484); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (!context.flags.c()) goto notneg1; context._neg(context.bx); notneg1: - context.cx = context.data.word(482); + context.cx = context.ds.word(482); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.ds.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto notneg2; @@ -19209,16 +19209,16 @@ tendstohoriz: context.dl = 1; goto gotquad; gotquad: - context.bx = context.data.word(480); + context.bx = context.ds.word(480); context._add(context.bx, 32); - context.ax = context.data.word(484); + context.ax = context.ds.word(484); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (context.flags.c()) goto isinright; isinleft: - context.cx = context.data.word(482); + context.cx = context.ds.word(482); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.ds.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto topleft; @@ -19232,9 +19232,9 @@ topleft: context._add(context.dl, 6); goto success; isinright: - context.cx = context.data.word(482); + context.cx = context.ds.word(482); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.ds.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto botright; @@ -19247,17 +19247,17 @@ botright: noswap2: success: context._and(context.dl, 7); - context.data.byte(135) = context.dl; - context.data.byte(136) = 0; + context.ds.byte(135) = context.dl; + context.ds.byte(136) = 0; return; } static void getroomspaths(Context & context) { - context.al = context.data.byte(185); + context.al = context.ds.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.bx = 0; context._add(context.bx, context.ax); return; @@ -19302,10 +19302,10 @@ static void findobname(Context & context) { context.bx = 64*2; context._mul(context.bx); context.si = context.ax; - context.ds = context.data.word(448); + context.ds = context.ds.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.data.word(context.si); + context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; context.ax = context.pop(); @@ -19313,41 +19313,41 @@ static void findobname(Context & context) { notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; - context.ds = context.data.word(398); + context.ds = context.ds.word(398); context._add(context.bx, 0+2080+30000+(16*114)); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); context.si = context.ax; return; notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; - context.ds = context.data.word(438); + context.ds = context.ds.word(438); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(82*2)); context.si = context.ax; return; notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; - context.ds = context.data.word(440); + context.ds = context.ds.word(440); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); context.si = context.ax; return; notsetname: - context.ds = context.data.word(442); + context.ds = context.ds.word(442); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(98*2)); context.si = context.ax; return; } static void showicon(Context & context) { - context._cmp(context.data.byte(184), 50); + context._cmp(context.ds.byte(184), 50); if (!context.flags.c()) goto isdream1; showpanel(context); showman(context); @@ -19356,37 +19356,37 @@ static void showicon(Context & context) { zoomicon(context); return; isdream1: - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 72; context.bx = 2; context.al = 45; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 72+47; context.bx = 2; context.al = 46; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 69-10; context.bx = 21; context.al = 49; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 160+88; context.bx = 2; context.al = 45; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 160+43; context.bx = 2; context.al = 46; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 160+101; context.bx = 21; context.al = 49; @@ -19397,25 +19397,25 @@ isdream1: } static void middlepanel(Context & context) { - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 72+47+20; context.bx = 0; context.al = 48; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 72+19; context.bx = 21; context.al = 47; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 160+23; context.bx = 0; context.al = 48; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.ds.word(464); context.di = 160+71; context.bx = 21; context.al = 47; @@ -19425,21 +19425,21 @@ static void middlepanel(Context & context) { } static void showman(Context & context) { - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 0; context.bx = 114; context.al = 1; context.ah = 0; showframe(context); - context._cmp(context.data.byte(4), 0); + context._cmp(context.ds.byte(4), 0); if (context.flags.z()) goto notverycool; - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 28; context.bx = 25; context.al = 2; @@ -19450,13 +19450,13 @@ notverycool: } static void showpanel(Context & context) { - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 72; context.bx = 0; context.al = 19; context.ah = 0; showframe(context); - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 192; context.bx = 0; context.al = 19; @@ -19471,48 +19471,48 @@ static void roomname(Context & context) { context.al = 53; context.dl = 240; printmessage(context); - context.bl = context.data.byte(185); + context.bl = context.ds.byte(185); context._cmp(context.bl, 32); if (context.flags.c()) goto notover32; context._sub(context.bl, 32); notover32: context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(436); + context.es = context.ds.word(436); context._add(context.bx, 0); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(38*2)); context.si = context.ax; - context.data.word(77) = 7; + context.ds.word(77) = 7; context.di = 88; context.bx = 25; context.dl = 120; - context._cmp(context.data.byte(3), 1); + context._cmp(context.ds.byte(3), 1); if (context.flags.z()) goto gotpl; context.dl = 160; gotpl: context.al = 0; context.ah = 0; printdirect(context); - context.data.word(77) = 10; + context.ds.word(77) = 10; usecharset1(context); return; } static void usecharset1(Context & context) { - context.ax = context.data.word(404); - context.data.word(268) = context.ax; + context.ax = context.ds.word(404); + context.ds.word(268) = context.ax; return; } static void usetempcharset(Context & context) { - context.ax = context.data.word(406); - context.data.word(268) = context.ax; + context.ax = context.ds.word(406); + context.ds.word(268) = context.ax; return; } static void showexit(Context & context) { - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 274; context.bx = 154; context.al = 11; @@ -19523,12 +19523,12 @@ static void showexit(Context & context) { static void panelicons1(Context & context) { context.di = 0; - context._cmp(context.data.byte(3), 1); + context._cmp(context.ds.byte(3), 1); if (context.flags.z()) goto watchison; context.di = 48; watchison: context.push(context.di); - context.ds = context.data.word(410); + context.ds = context.ds.word(410); context._add(context.di, 204); context.bx = 4; context.al = 2; @@ -19536,9 +19536,9 @@ watchison: showframe(context); context.di = context.pop(); context.push(context.di); - context._cmp(context.data.byte(8), 1); + context._cmp(context.ds.byte(8), 1); if (context.flags.z()) goto zoomisoff; - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context._add(context.di, 228); context.bx = 8; context.al = 5; @@ -19551,9 +19551,9 @@ zoomisoff: } static void showwatch(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.ds.byte(3), 0); if (context.flags.z()) goto nowristwatch; - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 250; context.bx = 1; context.al = 6; @@ -19565,9 +19565,9 @@ nowristwatch: } static void zoomicon(Context & context) { - context._cmp(context.data.byte(8), 0); + context._cmp(context.ds.byte(8), 0); if (context.flags.z()) goto nozoom1; - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.di = 8; context.bx = 132-1; context.al = 8; @@ -19578,20 +19578,20 @@ nozoom1: } static void showblink(Context & context) { - context._cmp(context.data.byte(131), 1); + context._cmp(context.ds.byte(131), 1); if (context.flags.z()) goto finblink1; - context._add(context.data.byte(472), 1); - context._cmp(context.data.byte(4), 0); + context._add(context.ds.byte(472), 1); + context._cmp(context.ds.byte(4), 0); if (!context.flags.z()) goto finblink1; - context._cmp(context.data.byte(184), 50); + context._cmp(context.ds.byte(184), 50); if (!context.flags.c()) goto eyesshut; - context.al = context.data.byte(472); + context.al = context.ds.byte(472); context._cmp(context.al, 3); if (!context.flags.z()) goto finblink1; - context.data.byte(472) = 0; - context.al = context.data.byte(471); + context.ds.byte(472) = 0; + context.al = context.ds.byte(471); context._add(context.al, 1); - context.data.byte(471) = context.al; + context.ds.byte(471) = context.al; context._cmp(context.al, 6); if (context.flags.c()) goto nomorethan6; context.al = 6; @@ -19599,8 +19599,8 @@ nomorethan6: context.ah = 0; context.bx = 5691; context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.ds = context.data.word(408); + context.al = context.ds.byte(context.bx); + context.ds = context.ds.word(408); context.di = 44; context.bx = 32; context.ah = 0; @@ -19612,11 +19612,11 @@ eyesshut: } static void dumpblink(Context & context) { - context._cmp(context.data.byte(4), 0); + context._cmp(context.ds.byte(4), 0); if (!context.flags.z()) goto nodumpeye; - context._cmp(context.data.byte(472), 0); + context._cmp(context.ds.byte(472), 0); if (!context.flags.z()) goto nodumpeye; - context.al = context.data.byte(471); + context.al = context.ds.byte(471); context._cmp(context.al, 6); if (!context.flags.c()) goto nodumpeye; context.push(context.ds); @@ -19641,9 +19641,9 @@ static void worktoscreenm(Context & context) { } static void blank(Context & context) { - context._cmp(context.data.byte(100), 199); + context._cmp(context.ds.byte(100), 199); if (context.flags.z()) goto alreadyblnk; - context.data.byte(100) = 199; + context.ds.byte(100) = 199; context.al = 0; commandonly(context); alreadyblnk: @@ -19662,14 +19662,14 @@ static void hangonp(Context & context) { context._add(context.cx, context.cx); context.ax = context.pop(); context._add(context.cx, context.ax); - context.data.word(138) = 0; - context.al = context.data.byte(231); - context.ah = context.data.byte(106); + context.ds.word(138) = 0; + context.al = context.ds.byte(231); + context.ah = context.ds.byte(106); context.push(context.ax); - context.data.byte(234) = 3; - context.data.byte(106) = 0; + context.ds.byte(234) = 3; + context.ds.byte(106) = 0; context.push(context.cx); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; readmouse(context); animpointer(context); showpointer(context); @@ -19685,19 +19685,19 @@ hangloop: vsync(context); dumppointer(context); context.cx = context.pop(); - context.ax = context.data.word(202); + context.ax = context.ds.word(202); context._cmp(context.ax, 0); if (context.flags.z()) goto notpressed; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.ds.word(212)); if (!context.flags.z()) goto getoutofit; notpressed: if (--context.cx) goto hangloop; getoutofit: delpointer(context); context.ax = context.pop(); - context.data.byte(231) = context.al; - context.data.byte(106) = context.ah; - context.data.byte(234) = 0; + context.ds.byte(231) = context.al; + context.ds.byte(106) = context.ah; + context.ds.byte(234) = 0; return; } @@ -19729,7 +19729,7 @@ monloop1: static void getunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19738,7 +19738,7 @@ static void getunderzoom(Context & context) { } static void dumpzoom(Context & context) { - context._cmp(context.data.byte(8), 1); + context._cmp(context.ds.byte(8), 1); if (!context.flags.z()) goto notzoomon; context.di = 8+5; context.bx = 132+4; @@ -19752,7 +19752,7 @@ notzoomon: static void putunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19761,12 +19761,12 @@ static void putunderzoom(Context & context) { } static void crosshair(Context & context) { - context._cmp(context.data.byte(100), 3); + context._cmp(context.ds.byte(100), 3); if (context.flags.z()) goto nocross; - context._cmp(context.data.byte(100), 10); + context._cmp(context.ds.byte(100), 10); if (!context.flags.c()) goto nocross; - context.es = context.data.word(400); - context.ds = context.data.word(408); + context.es = context.ds.word(400); + context.ds = context.ds.word(408); context.di = 8+24; context.bx = 132+19; context.al = 9; @@ -19774,8 +19774,8 @@ static void crosshair(Context & context) { showframe(context); return; nocross: - context.es = context.data.word(400); - context.ds = context.data.word(408); + context.es = context.ds.word(400); + context.ds = context.ds.word(408); context.di = 8+24; context.bx = 132+19; context.al = 29; @@ -19786,23 +19786,23 @@ nocross: static void showpointer(Context & context) { showblink(context); - context.di = context.data.word(198); - context.data.word(220) = context.di; - context.bx = context.data.word(200); - context.data.word(222) = context.bx; - context._cmp(context.data.byte(106), 1); + context.di = context.ds.word(198); + context.ds.word(220) = context.di; + context.bx = context.ds.word(200); + context.ds.word(222) = context.bx; + context._cmp(context.ds.byte(106), 1); if (context.flags.z()) goto itsanobject; context.push(context.bx); context.push(context.di); - context.ds = context.data.word(408); - context.al = context.data.byte(231); + context.ds = context.ds.word(408); + context.al = context.ds.byte(231); context._add(context.al, 20); context.ah = 0; context._add(context.ax, context.ax); context.si = context.ax; context._add(context.ax, context.ax); context._add(context.si, context.ax); - context.cx = context.data.word(context.si); + context.cx = context.ds.word(context.si); context._cmp(context.cl, 12); if (!context.flags.c()) goto notsmallx; context.cl = 12; @@ -19811,10 +19811,10 @@ notsmallx: if (!context.flags.c()) goto notsmally; context.ch = 12; notsmally: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; + context.ds.byte(227) = context.cl; + context.ds.byte(228) = context.ch; context.push(context.ds); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19822,7 +19822,7 @@ notsmally: context.bx = context.pop(); context.push(context.di); context.push(context.bx); - context.al = context.data.byte(231); + context.al = context.ds.byte(231); context._add(context.al, 20); context.ah = 0; showframe(context); @@ -19830,11 +19830,11 @@ notsmally: context.di = context.pop(); return; itsanobject: - context.al = context.data.byte(89); - context.ds = context.data.word(398); - context._cmp(context.data.byte(102), 4); + context.al = context.ds.byte(89); + context.ds = context.ds.word(398); + context._cmp(context.ds.byte(102), 4); if (context.flags.z()) goto itsfrominv; - context.ds = context.data.word(446); + context.ds = context.ds.word(446); itsfrominv: context.cl = context.al; context._add(context.al, context.al); @@ -19847,7 +19847,7 @@ itsfrominv: context._add(context.ax, context.ax); context._add(context.si, context.ax); context.ax = 2080; - context.cx = context.data.word(context.si); + context.cx = context.ds.word(context.si); context._cmp(context.cl, 12); if (!context.flags.c()) goto notsmallx2; context.cl = 12; @@ -19856,8 +19856,8 @@ notsmallx2: if (!context.flags.c()) goto notsmally2; context.ch = 12; notsmally2: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; + context.ds.byte(227) = context.cl; + context.ds.byte(228) = context.ch; context.ax = context.pop(); context.push(context.di); context.push(context.bx); @@ -19868,13 +19868,13 @@ notsmally2: context.al = context.cl; context.ah = 0; context._shr(context.ax, 1); - context._sub(context.data.word(220), context.ax); + context._sub(context.ds.word(220), context.ax); context._sub(context.di, context.ax); context.al = context.ch; context._shr(context.ax, 1); - context._sub(context.data.word(222), context.ax); + context._sub(context.ds.word(222), context.ax); context._sub(context.bx, context.ax); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19885,7 +19885,7 @@ notsmally2: showframe(context); context.bx = context.pop(); context.di = context.pop(); - context.ds = context.data.word(408); + context.ds = context.ds.word(408); context.al = 3; context.ah = 128; showframe(context); @@ -19893,20 +19893,20 @@ notsmally2: } static void delpointer(Context & context) { - context.ax = context.data.word(220); + context.ax = context.ds.word(220); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; - context.data.word(224) = context.ax; - context.ax = context.data.word(222); - context.data.word(226) = context.ax; - context.cl = context.data.byte(227); - context.data.byte(229) = context.cl; - context.ch = context.data.byte(228); - context.data.byte(230) = context.ch; - context.ds = context.data.word(412); + context.ds.word(224) = context.ax; + context.ax = context.ds.word(222); + context.ds.word(226) = context.ax; + context.cl = context.ds.byte(227); + context.ds.byte(229) = context.cl; + context.ch = context.ds.byte(228); + context.ds.byte(230) = context.ch; + context.ds = context.ds.word(412); context.si = 0+(228*13)+32+60; - context.di = context.data.word(224); - context.bx = context.data.word(226); + context.di = context.ds.word(224); + context.bx = context.ds.word(226); multiput(context); nevershown: return; @@ -19914,30 +19914,30 @@ nevershown: static void dumppointer(Context & context) { dumpblink(context); - context.cl = context.data.byte(229); - context.ch = context.data.byte(230); - context.di = context.data.word(224); - context.bx = context.data.word(226); + context.cl = context.ds.byte(229); + context.ch = context.ds.byte(230); + context.di = context.ds.word(224); + context.bx = context.ds.word(226); multidump(context); - context.bx = context.data.word(222); - context.di = context.data.word(220); - context._cmp(context.di, context.data.word(224)); + context.bx = context.ds.word(222); + context.di = context.ds.word(220); + context._cmp(context.di, context.ds.word(224)); if (!context.flags.z()) goto difffound; - context._cmp(context.bx, context.data.word(226)); + context._cmp(context.bx, context.ds.word(226)); if (context.flags.z()) goto notboth; difffound: - context.cl = context.data.byte(227); - context.ch = context.data.byte(228); + context.cl = context.ds.byte(227); + context.ch = context.ds.byte(228); multidump(context); notboth: return; } static void undertextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.di = context.ds.word(79); + context.bx = context.ds.word(81); context._sub(context.bx, 3); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0; context.cl = 228; context.ch = 13; @@ -19946,10 +19946,10 @@ static void undertextline(Context & context) { } static void deltextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.di = context.ds.word(79); + context.bx = context.ds.word(81); context._sub(context.bx, 3); - context.ds = context.data.word(412); + context.ds = context.ds.word(412); context.si = 0; context.cl = 228; context.ch = 13; @@ -19958,11 +19958,11 @@ static void deltextline(Context & context) { } static void dumptextline(Context & context) { - context._cmp(context.data.byte(109), 1); + context._cmp(context.ds.byte(109), 1); if (!context.flags.z()) goto nodumptextline; - context.data.byte(109) = 0; - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.ds.byte(109) = 0; + context.di = context.ds.word(79); + context.bx = context.ds.word(81); context._sub(context.bx, 3); context.cl = 228; context.ch = 13; @@ -19972,19 +19972,19 @@ nodumptextline: } static void animpointer(Context & context) { - context._cmp(context.data.byte(234), 2); + context._cmp(context.ds.byte(234), 2); if (context.flags.z()) goto combathand; - context._cmp(context.data.byte(234), 3); + context._cmp(context.ds.byte(234), 3); if (context.flags.z()) goto mousehand; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (context.flags.z()) goto notwatchpoint; - context.data.byte(231) = 11; + context.ds.byte(231) = 11; return; notwatchpoint: - context.data.byte(231) = 0; - context._cmp(context.data.byte(237), 0); + context.ds.byte(231) = 0; + context._cmp(context.ds.byte(237), 0); if (context.flags.z()) goto gothand; - context._cmp(context.data.byte(476), 0); + context._cmp(context.ds.byte(476), 0); if (context.flags.z()) goto gothand; arrow: getflagunderp(context); @@ -19992,133 +19992,133 @@ arrow: if (context.flags.c()) goto gothand; context._cmp(context.cl, 128); if (!context.flags.c()) goto gothand; - context.data.byte(231) = 3; + context.ds.byte(231) = 3; context._test(context.cl, 4); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 4; + context.ds.byte(231) = 4; context._test(context.cl, 16); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 5; + context.ds.byte(231) = 5; context._test(context.cl, 2); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 6; + context.ds.byte(231) = 6; context._test(context.cl, 8); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 8; + context.ds.byte(231) = 8; gothand: return; mousehand: - context._cmp(context.data.byte(235), 0); + context._cmp(context.ds.byte(235), 0); if (context.flags.z()) goto rightspeed3; - context._sub(context.data.byte(235), 1); + context._sub(context.ds.byte(235), 1); goto finflashmouse; rightspeed3: - context.data.byte(235) = 5; - context._add(context.data.byte(236), 1); - context._cmp(context.data.byte(236), 16); + context.ds.byte(235) = 5; + context._add(context.ds.byte(236), 1); + context._cmp(context.ds.byte(236), 16); if (!context.flags.z()) goto finflashmouse; - context.data.byte(236) = 0; + context.ds.byte(236) = 0; finflashmouse: - context.al = context.data.byte(236); + context.al = context.ds.byte(236); context.ah = 0; context.bx = 5698; context._add(context.bx, context.ax); - context.al = context.data.byte(context.bx); - context.data.byte(231) = context.al; + context.al = context.ds.byte(context.bx); + context.ds.byte(231) = context.al; return; combathand: - context.data.byte(231) = 0; - context._cmp(context.data.byte(184), 14); + context.ds.byte(231) = 0; + context._cmp(context.ds.byte(184), 14); if (!context.flags.z()) goto notarrow; - context._cmp(context.data.byte(100), 211); + context._cmp(context.ds.byte(100), 211); if (!context.flags.z()) goto notarrow; - context.data.byte(231) = 5; + context.ds.byte(231) = 5; notarrow: return; } static void readmouse(Context & context) { - context.ax = context.data.word(202); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; + context.ax = context.ds.word(202); + context.ds.word(212) = context.ax; + context.ax = context.ds.word(198); + context.ds.word(214) = context.ax; + context.ax = context.ds.word(200); + context.ds.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(202) = context.bx; + context.ds.word(198) = context.cx; + context.ds.word(200) = context.dx; + context.ds.word(202) = context.bx; return; } static void readmouse1(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; + context.ax = context.ds.word(198); + context.ds.word(214) = context.ax; + context.ax = context.ds.word(200); + context.ds.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(204) = context.bx; + context.ds.word(198) = context.cx; + context.ds.word(200) = context.dx; + context.ds.word(204) = context.bx; return; } static void readmouse2(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; + context.ax = context.ds.word(198); + context.ds.word(214) = context.ax; + context.ax = context.ds.word(200); + context.ds.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(206) = context.bx; + context.ds.word(198) = context.cx; + context.ds.word(200) = context.dx; + context.ds.word(206) = context.bx; return; } static void readmouse3(Context & context) { - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; + context.ax = context.ds.word(198); + context.ds.word(214) = context.ax; + context.ax = context.ds.word(200); + context.ds.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(208) = context.bx; + context.ds.word(198) = context.cx; + context.ds.word(200) = context.dx; + context.ds.word(208) = context.bx; return; } static void readmouse4(Context & context) { - context.ax = context.data.word(202); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; + context.ax = context.ds.word(202); + context.ds.word(212) = context.ax; + context.ax = context.ds.word(198); + context.ds.word(214) = context.ax; + context.ax = context.ds.word(200); + context.ds.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.ax = context.data.word(204); - context._or(context.ax, context.data.word(206)); - context._or(context.ax, context.data.word(208)); + context.ds.word(198) = context.cx; + context.ds.word(200) = context.dx; + context.ax = context.ds.word(204); + context._or(context.ax, context.ds.word(206)); + context._or(context.ax, context.ds.word(208)); context._or(context.bx, context.ax); - context.data.word(202) = context.bx; + context.ds.word(202) = context.bx; return; } static void readkey(Context & context) { - context.bx = context.data.word(396); - context._cmp(context.bx, context.data.word(394)); + context.bx = context.ds.word(396); + context._cmp(context.bx, context.ds.word(394)); if (context.flags.z()) goto nokey; context._add(context.bx, 1); context._and(context.bx, 15); - context.data.word(396) = context.bx; + context.ds.word(396) = context.bx; context.di = 5715; context._add(context.di, context.bx); - context.al = context.data.byte(context.di); - context.data.byte(142) = context.al; + context.al = context.ds.byte(context.di); + context.ds.byte(142) = context.al; return; nokey: - context.data.byte(142) = 0; + context.ds.byte(142) = 0; return; } @@ -20127,7 +20127,7 @@ static void convertkey(Context & context) { context.ah = 0; context.di = 5731; context._add(context.di, context.ax); - context.al = context.data.byte(context.di); + context.al = context.ds.byte(context.di); return; } @@ -20174,41 +20174,41 @@ hangonloop: static void loadtraveltext(Context & context) { context.dx = 2247; standardload(context); - context.data.word(456) = context.ax; + context.ds.word(456) = context.ax; return; } static void loadintotemp(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(458) = context.ax; + context.ds.word(458) = context.ax; return; } static void loadintotemp2(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(460) = context.ax; + context.ds.word(460) = context.ax; return; } static void loadintotemp3(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(462) = context.ax; + context.ds.word(462) = context.ax; return; } static void loadtempcharset(Context & context) { standardload(context); - context.data.word(406) = context.ax; + context.ds.word(406) = context.ax; return; } static void standardload(Context & context) { openfile(context); readheader(context); - context.bx = context.data.word(context.di); + context.bx = context.ds.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); @@ -20225,21 +20225,21 @@ static void standardload(Context & context) { static void loadtemptext(Context & context) { standardload(context); - context.data.word(466) = context.ax; + context.ds.word(466) = context.ax; return; } static void loadroom(Context & context) { - context.data.byte(74) = 1; - context.data.word(328) = 0; - context.data.word(138) = 0; - context.data.word(121) = 104; - context.data.word(123) = 38; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context.al = context.data.byte(188); - context.data.byte(9) = context.al; + context.ds.byte(74) = 1; + context.ds.word(328) = 0; + context.ds.word(138) = 0; + context.ds.word(121) = 104; + context.ds.word(123) = 38; + context.ds.word(79) = 13; + context.ds.word(81) = 182; + context.ds.byte(82) = 240; + context.al = context.ds.byte(188); + context.ds.byte(9) = context.al; getroomdata(context); startloading(context); loadroomssample(context); @@ -20250,18 +20250,18 @@ static void loadroom(Context & context) { } static void loadroomssample(Context & context) { - context.al = context.data.byte(531); + context.al = context.ds.byte(531); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; - context._cmp(context.al, context.data.byte(530)); + context._cmp(context.al, context.ds.byte(530)); if (context.flags.z()) goto loadedalready; - context.data.byte(530) = context.al; - context.al = context.data.byte(530); + context.ds.byte(530) = context.al; + context.al = context.ds.byte(530); context.cl = '0'; twodigitnum(context); context.di = 1909; context._xchg(context.al, context.ah); - context.data.word(context.di+10) = context.ax; + context.ds.word(context.di+10) = context.ax; context.dx = context.di; loadsecondsample(context); loadedalready: @@ -20269,50 +20269,50 @@ loadedalready: } static void getridofreels(Context & context) { - context._cmp(context.data.byte(74), 0); + context._cmp(context.ds.byte(74), 0); if (context.flags.z()) goto dontgetrid; - context.es = context.data.word(430); + context.es = context.ds.word(430); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.ds.word(432); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.ds.word(434); deallocatemem(context); dontgetrid: return; } static void getridofall(Context & context) { - context.es = context.data.word(416); + context.es = context.ds.word(416); deallocatemem(context); - context.es = context.data.word(444); + context.es = context.ds.word(444); deallocatemem(context); - context.es = context.data.word(430); + context.es = context.ds.word(430); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.ds.word(432); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.ds.word(434); deallocatemem(context); - context.es = context.data.word(450); + context.es = context.ds.word(450); deallocatemem(context); - context.es = context.data.word(448); + context.es = context.ds.word(448); deallocatemem(context); - context.es = context.data.word(440); + context.es = context.ds.word(440); deallocatemem(context); - context.es = context.data.word(442); + context.es = context.ds.word(442); deallocatemem(context); - context.es = context.data.word(436); + context.es = context.ds.word(436); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.ds.word(446); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.ds.word(438); deallocatemem(context); return; } static void restorereels(Context & context) { - context._cmp(context.data.byte(74), 0); + context._cmp(context.ds.byte(74), 0); if (context.flags.z()) goto dontrestore; - context.al = context.data.byte(184); + context.al = context.ds.byte(184); getroomdata(context); context.dx = context.bx; openfile(context); @@ -20322,17 +20322,17 @@ static void restorereels(Context & context) { dontloadseg(context); dontloadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.ds.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.ds.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.ds.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20342,17 +20342,17 @@ dontrestore: } static void restoreall(Context & context) { - context.al = context.data.byte(9); + context.al = context.ds.byte(9); getroomdata(context); context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(416) = context.ax; + context.ds.word(416) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(400); + context.ds = context.ds.word(400); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20360,59 +20360,59 @@ static void restoreall(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(444) = context.ax; + context.ds.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.ds.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.ds.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.ds.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(450) = context.ax; + context.ds.word(450) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.ds.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.ds.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(442) = context.ax; + context.ds.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.ds.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.ds.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.ds.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20424,9 +20424,9 @@ static void restoreall(Context & context) { static void sortoutmap(Context & context) { context.push(context.es); context.push(context.di); - context.ds = context.data.word(400); + context.ds = context.ds.word(400); context.si = 0; - context.es = context.data.word(418); + context.es = context.ds.word(418); context.di = 0; context.cx = 60; blimey: @@ -20444,43 +20444,43 @@ blimey: } static void startloading(Context & context) { - context.data.byte(64) = 0; - context.al = context.data.byte(context.bx+13); - context.data.byte(531) = context.al; - context.al = context.data.byte(context.bx+15); - context.data.byte(148) = context.al; - context.al = context.data.byte(context.bx+16); - context.data.byte(149) = context.al; - context.al = context.data.byte(context.bx+20); - context.data.byte(35) = context.al; - context.al = context.data.byte(context.bx+21); - context.data.byte(475) = context.al; - context.data.byte(478) = context.al; - context.data.byte(477) = context.al; - context.al = context.data.byte(context.bx+22); - context.data.byte(133) = context.al; - context.data.byte(135) = context.al; - context.al = context.data.byte(context.bx+23); - context.data.byte(39) = context.al; - context.al = context.data.byte(context.bx+24); - context.data.byte(36) = context.al; - context.al = context.data.byte(context.bx+25); - context.data.byte(38) = context.al; - context.data.byte(65) = -1; - context.al = context.data.byte(context.bx+27); + context.ds.byte(64) = 0; + context.al = context.ds.byte(context.bx+13); + context.ds.byte(531) = context.al; + context.al = context.ds.byte(context.bx+15); + context.ds.byte(148) = context.al; + context.al = context.ds.byte(context.bx+16); + context.ds.byte(149) = context.al; + context.al = context.ds.byte(context.bx+20); + context.ds.byte(35) = context.al; + context.al = context.ds.byte(context.bx+21); + context.ds.byte(475) = context.al; + context.ds.byte(478) = context.al; + context.ds.byte(477) = context.al; + context.al = context.ds.byte(context.bx+22); + context.ds.byte(133) = context.al; + context.ds.byte(135) = context.al; + context.al = context.ds.byte(context.bx+23); + context.ds.byte(39) = context.al; + context.al = context.ds.byte(context.bx+24); + context.ds.byte(36) = context.al; + context.al = context.ds.byte(context.bx+25); + context.ds.byte(38) = context.al; + context.ds.byte(65) = -1; + context.al = context.ds.byte(context.bx+27); context.push(context.ax); - context.al = context.data.byte(context.bx+31); - context.ah = context.data.byte(184); - context.data.byte(184) = context.al; + context.al = context.ds.byte(context.bx+31); + context.ah = context.ds.byte(184); + context.ds.byte(184) = context.al; context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(416) = context.ax; + context.ds.word(416) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(400); + context.ds = context.ds.word(400); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20488,69 +20488,69 @@ static void startloading(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(444) = context.ax; + context.ds.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(428); + context.ds = context.ds.word(428); context.dx = 0; context.cx = 64*128; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.ds.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.ds.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.ds.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(450) = context.ax; + context.ds.word(450) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.ds.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.ds.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(442) = context.ax; + context.ds.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.ds.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.ds.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(426); + context.ds = context.ds.word(426); context.dx = 0; context.cx = 16*80; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.ds.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20559,17 +20559,17 @@ static void startloading(Context & context) { deletetaken(context); setallchanges(context); autoappear(context); - context.al = context.data.byte(188); + context.al = context.ds.byte(188); getroomdata(context); - context.data.byte(65) = -1; - context.data.byte(56) = 0; - context.data.word(98) = 160; - context.data.byte(188) = 255; - context.data.byte(492) = 254; + context.ds.byte(65) = -1; + context.ds.byte(56) = 0; + context.ds.word(98) = 160; + context.ds.byte(188) = 255; + context.ds.byte(492) = 254; context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) goto dontwalkin; - context.data.byte(475) = context.al; + context.ds.byte(475) = context.al; context.push(context.bx); autosetwalk(context); context.bx = context.pop(); @@ -20596,7 +20596,7 @@ lookx2: context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.ds.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -20606,40 +20606,40 @@ lookx2: context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.data.byte(context.bx+6) = context.al; + context.ds.byte(context.bx+6) = context.al; return; } static void findxyfrompath(Context & context) { getroomspaths(context); - context.al = context.data.byte(475); + context.al = context.ds.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.ax = context.data.word(context.bx); + context.ax = context.ds.word(context.bx); context._sub(context.al, 12); context._sub(context.ah, 12); - context.data.byte(151) = context.al; - context.data.byte(152) = context.ah; + context.ds.byte(151) = context.al; + context.ds.byte(152) = context.ah; return; } static void findroominloc(Context & context) { - context.al = context.data.byte(149); + context.al = context.ds.byte(149); context.cx = -6; looky: context._add(context.cx, 6); context._sub(context.al, 10); if (!context.flags.c()) goto looky; - context.al = context.data.byte(148); + context.al = context.ds.byte(148); context._sub(context.cx, 1); lookx: context._add(context.cx, 1); context._sub(context.al, 11); if (!context.flags.c()) goto lookx; - context.data.byte(185) = context.cl; + context.ds.byte(185) = context.cl; return; } @@ -20655,7 +20655,7 @@ static void getroomdata(Context & context) { static void readheader(Context & context) { context.ds = context.cs; context.dx = 5881; - context.cx = 5958-context.data.byte(5881); + context.cx = 5958-context.ds.byte(5881); readfromfile(context); context.es = context.cs; context.di = 5952; @@ -20665,7 +20665,7 @@ static void readheader(Context & context) { static void allocateload(Context & context) { context.push(context.es); context.push(context.di); - context.bx = context.data.word(context.di); + context.bx = context.ds.word(context.di); context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); @@ -20692,37 +20692,37 @@ static void fillspace(Context & context) { } static void getridoftemp(Context & context) { - context.es = context.data.word(458); + context.es = context.ds.word(458); deallocatemem(context); return; } static void getridoftemptext(Context & context) { - context.es = context.data.word(466); + context.es = context.ds.word(466); deallocatemem(context); return; } static void getridoftemp2(Context & context) { - context.es = context.data.word(460); + context.es = context.ds.word(460); deallocatemem(context); return; } static void getridoftemp3(Context & context) { - context.es = context.data.word(462); + context.es = context.ds.word(462); deallocatemem(context); return; } static void getridoftempcharset(Context & context) { - context.es = context.data.word(406); + context.es = context.ds.word(406); deallocatemem(context); return; } static void getridoftempsp(Context & context) { - context.es = context.data.word(464); + context.es = context.ds.word(464); deallocatemem(context); return; } @@ -20730,30 +20730,30 @@ static void getridoftempsp(Context & context) { static void readsetdata(Context & context) { context.dx = 1870; standardload(context); - context.data.word(404) = context.ax; + context.ds.word(404) = context.ax; context.dx = 1935; standardload(context); - context.data.word(408) = context.ax; + context.ds.word(408) = context.ax; context.dx = 1948; standardload(context); - context.data.word(410) = context.ax; + context.ds.word(410) = context.ax; context.dx = 1832; standardload(context); - context.data.word(414) = context.ax; + context.ds.word(414) = context.ax; context.dx = 2234; standardload(context); - context.data.word(454) = context.ax; + context.ds.word(454) = context.ax; context.dx = 2286; standardload(context); - context.data.word(452) = context.ax; - context.ax = context.data.word(404); - context.data.word(268) = context.ax; - context._cmp(context.data.byte(378), 255); + context.ds.word(452) = context.ax; + context.ax = context.ds.word(404); + context.ds.word(268) = context.ax; + context._cmp(context.ds.byte(378), 255); if (context.flags.z()) goto novolumeload; context.dx = 2299; openfile(context); context.cx = 2048-256; - context.ds = context.data.word(353); + context.ds = context.ds.word(353); context.dx = 16384; readfromfile(context); closefile(context); @@ -20775,7 +20775,7 @@ static void dreamweb(Context & context) { clearpalette(context); set16colpalette(context); readsetdata(context); - context.data.byte(391) = 0; + context.ds.byte(391) = 0; context.dx = 1922; loadsample(context); setsoundoff(context); @@ -20791,7 +20791,7 @@ dodecisions: cls(context); setmode(context); decide(context); - context._cmp(context.data.byte(103), 4); + context._cmp(context.ds.byte(103), 4); if (context.flags.z()) goto mainloop; titles(context); credits(context); @@ -20799,22 +20799,22 @@ playgame: clearchanges(context); setmode(context); loadpalfromiff(context); - context.data.byte(9) = 255; - context.data.byte(67) = 1; - context.data.byte(188) = 35; - context.data.byte(386) = 7; + context.ds.byte(9) = 255; + context.ds.byte(67) = 1; + context.ds.byte(188) = 35; + context.ds.byte(386) = 7; loadroom(context); clearsprites(context); initman(context); entrytexts(context); entryanims(context); - context.data.byte(183) = 3; + context.ds.byte(183) = 3; initialinv(context); - context.data.byte(153) = 32; + context.ds.byte(153) = 32; startup1(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; - context.data.byte(100) = 255; + context.ds.byte(387) = 0; + context.ds.byte(388) = -1; + context.ds.byte(100) = 255; goto mainloop; loadnew: clearbeforeload(context); @@ -20823,36 +20823,36 @@ loadnew: initman(context); entrytexts(context); entryanims(context); - context.data.byte(188) = 255; + context.ds.byte(188) = 255; startup(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; worktoscreenm(context); goto mainloop; alreadyloaded: - context.data.byte(188) = 255; + context.ds.byte(188) = 255; clearsprites(context); initman(context); startup(context); - context.data.byte(100) = 255; + context.ds.byte(100) = 255; mainloop: screenupdate(context); - context._cmp(context.data.byte(391), 0); + context._cmp(context.ds.byte(391), 0); if (!context.flags.z()) goto endofgame; - context._cmp(context.data.byte(56), 1); + context._cmp(context.ds.byte(56), 1); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(56), 2); + context._cmp(context.ds.byte(56), 2); if (context.flags.z()) goto gameover; - context._cmp(context.data.word(21), 0); + context._cmp(context.ds.word(21), 0); if (context.flags.z()) goto notwatching; - context.al = context.data.byte(477); - context._cmp(context.al, context.data.byte(475)); + context.al = context.ds.byte(477); + context._cmp(context.al, context.ds.byte(475)); if (!context.flags.z()) goto mainloop; - context._sub(context.data.word(21), 1); + context._sub(context.ds.word(21), 1); if (!context.flags.z()) goto mainloop; notwatching: - context._cmp(context.data.byte(56), 4); + context._cmp(context.ds.byte(56), 4); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(188), 255); + context._cmp(context.ds.byte(188), 255); if (!context.flags.z()) goto loadnew; goto mainloop; gameover: @@ -21427,7 +21427,7 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - context.data.assign(src, src + sizeof(src)); dreamweb(context); } + context.ds.assign(src, src + sizeof(src)); dreamweb(context); } void __dispatch_call(Context &context, unsigned addr) { switch(addr) { diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index fb634b6e05..6adcdc73be 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -114,12 +114,10 @@ class SegmentRef { Segment *_segment; public: - SegmentRef(Context *ctx): _context(ctx), _value(), _segment() { + SegmentRef(Context *ctx, uint16 value = 0, Segment *segment = 0): _context(ctx), _value(value), _segment(segment) { } - inline void reset(uint16 value) { - - } + inline void reset(uint16 value); inline SegmentRef& operator=(const uint16 id) { return *this; @@ -143,6 +141,11 @@ public: assert(_segment != 0); return _segment->word(index); } + + inline void assign(const uint8 *b, const uint8 *e) { + assert(_segment != 0); + _segment->assign(b, e); + } }; struct Flags { @@ -174,9 +177,12 @@ struct Flags { }; class Context { - Common::HashMap _segments; + typedef Common::HashMap SegmentMap; + SegmentMap _segments; public: + enum { kDefaultDataSegment }; + Register ax, dx, bx, cx, si, di; RegisterPart al; RegisterPart ah; @@ -191,9 +197,18 @@ public: Flags flags; inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this) { - + _segments[kDefaultDataSegment] = Segment(); + cs.reset(1); + ds.reset(1); + es.reset(1); } - + + SegmentRef getSegment(uint16 value) { + SegmentMap::iterator i = _segments.find(value); + assert(i != _segments.end()); + return SegmentRef(this, value, &i->_value); + } + inline void _cmp(uint8 a, uint8 b) { uint8 x = a; _sub(x, b); @@ -342,10 +357,12 @@ public: stack.pop_back(); return v; } - - Segment data; }; +inline void SegmentRef::reset(uint16 value) { + *this = _context->getSegment(value); +} + } #endif -- cgit v1.2.3 From 61fe610c730ec3488e98b26d5a01e66526d33e85 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:56:23 +0400 Subject: DREAMWEB: fixed default segment addr --- engines/dreamweb/runtime.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 6adcdc73be..6b5f650fc6 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -181,7 +181,7 @@ class Context { SegmentMap _segments; public: - enum { kDefaultDataSegment }; + enum { kDefaultDataSegment = 0x1000 }; Register ax, dx, bx, cx, si, di; RegisterPart al; @@ -198,9 +198,9 @@ public: inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this) { _segments[kDefaultDataSegment] = Segment(); - cs.reset(1); - ds.reset(1); - es.reset(1); + cs.reset(kDefaultDataSegment); + ds.reset(kDefaultDataSegment); + es.reset(kDefaultDataSegment); } SegmentRef getSegment(uint16 value) { -- cgit v1.2.3 From a0e56d9cad9148ae2c6fb5d616bc15c47de79e77 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:58:18 +0400 Subject: DREAMWEB: minor cleanup --- devtools/tasmrecover/tasm/cpp.py | 4 ++-- engines/dreamweb/dreamgen.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index f9afe48fd8..fa2dd672fb 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -505,7 +505,7 @@ namespace %s { n += 1 if (n & 0xf) == 0: data_impl += "\n\t\t" - data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src))" + data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src));\n" hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper() self.hd.write("""#ifndef %s #define %s @@ -524,7 +524,7 @@ namespace %s { self.hd.write("\n}\n\n#endif\n") self.hd.close() - self.fd.write("\nvoid __start(Context &context) { %s; %s(context); }\n" %(data_impl, start)) + self.fd.write("\nvoid __start(Context &context) { %s%s(context); \n}\n" %(data_impl, start)) self.fd.write("\nvoid __dispatch_call(Context &context, unsigned addr) {\n\tswitch(addr) {\n") self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1]) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 3ec12c1363..cb94596a49 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -21427,7 +21427,9 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - context.ds.assign(src, src + sizeof(src)); dreamweb(context); } + context.ds.assign(src, src + sizeof(src)); +dreamweb(context); +} void __dispatch_call(Context &context, unsigned addr) { switch(addr) { -- cgit v1.2.3 From e4c9ae7a5452e52d9ae064af293a5f12d5a06bab Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 01:00:09 +0400 Subject: COMMON: fixed resize --- common/array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/array.h b/common/array.h index b3d3e01727..ff32d3d94c 100644 --- a/common/array.h +++ b/common/array.h @@ -253,7 +253,7 @@ public: } void assign(const T *srcBegin, const T *srcEnd) { - reserve(distance(srcBegin, srcEnd)); + resize(distance(srcBegin, srcEnd)); //fixme: ineffective? T *dst = _storage; while(srcBegin != srcEnd) *dst++ = *srcBegin++; -- cgit v1.2.3 From 5b9a40584e8f244169943c419763c2ad35fa851a Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 01:02:09 +0400 Subject: DREAMWEB: added stubs for sound startup/exit --- engines/dreamweb/dreamweb.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 9e04147d40..25e6118457 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -260,8 +260,10 @@ void out22c(Context &context) { ::error("out22c"); } +void soundstartup(Context &context) { +} + void soundend(Context &context) { - ::error("soundend"); } void interupttest(Context &context) { @@ -284,9 +286,6 @@ void setsoundoff(Context &context) { ::error("setsoundoff"); } -void soundstartup(Context &context) { - ::error("soundstartup"); -} void loadsecondsample(Context &context) { ::error("loadsecondsample"); -- cgit v1.2.3 From 59b0c4b4b5992d6fe0bdc0b88849169d167b98fe Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 01:53:42 +0400 Subject: DREAMWEB: added all offsets --- devtools/tasmrecover/tasm/cpp.py | 7 + devtools/tasmrecover/tasm/parser.py | 3 + engines/dreamweb/dreamgen.h | 1522 +++++++++++++++++++++++++++++++++++ 3 files changed, 1532 insertions(+) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index fa2dd672fb..fe7f3ff9d6 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -521,6 +521,13 @@ namespace %s { """ %(self.namespace)) for f in self.failed: self.hd.write("\tvoid %s(Context &context);\n" %f) + + offsets_decl = "\n" + for k,v in self.context.get_offsets().items(): + offsets_decl += "\tconst static uint16 k%s = %d;\n" %(k.capitalize(), v[0]) + offsets_decl += "\n" + self.hd.write(offsets_decl); + self.hd.write("\n}\n\n#endif\n") self.hd.close() diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 8dbf54c5a3..6342a17d84 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -64,6 +64,9 @@ class parser: def get_offset(self, name): name = name.lower() return self.__offsets[name] + + def get_offsets(self): + return self.__offsets def include(self, basedir, fname): path = fname.split('\\')[self.strip_path:] diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index e5b4493a33..c3451342eb 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -67,6 +67,1528 @@ namespace dreamgen { void readoneblock(Context &context); void showpcx(Context &context); + const static uint16 kWaitabit = 1105; + const static uint16 kShuffletextads = 2660; + const static uint16 kCanopenpool = 3385; + const static uint16 kGottrainframe = 1105; + const static uint16 kInteruptworked = 4949; + const static uint16 kIsmorereel2 = 4949; + const static uint16 kCannotuseopen = 2660; + const static uint16 kNotret = 3861; + const static uint16 kNextmonkspeak = 2494; + const static uint16 kNothoteldoor1 = 1214; + const static uint16 kNothoteldoor2 = 1214; + const static uint16 kWearingshades = 3385; + const static uint16 kKillryan = 1105; + const static uint16 kSameline = 1711; + const static uint16 kNotuseinv = 2494; + const static uint16 kDoneit = 4949; + const static uint16 kNotunderchurch = 4949; + const static uint16 kNowatch = 4949; + const static uint16 kBlankex = 2660; + const static uint16 kOberase = 2660; + const static uint16 kNowornerror = 2660; + const static uint16 kNotdes2 = 1105; + const static uint16 kAlreadyactload = 3861; + const static uint16 kNotrightcont = 3385; + const static uint16 kNotch0only = 4949; + const static uint16 kNotwatchpath = 4949; + const static uint16 kEdensdhere = 3385; + const static uint16 kUnscrewplate = 3393; + const static uint16 kGotmonkryan = 1105; + const static uint16 kFindopen1a = 2494; + const static uint16 kSearchmess = 5691; + const static uint16 kNotworn = 2494; + const static uint16 kError6patch = 4261; + const static uint16 kNextcheck = 5691; + const static uint16 kPlayingalready = 5073; + const static uint16 kStereonotok = 3393; + const static uint16 kSearchagain = 2660; + const static uint16 kNotnewdirect = 1113; + const static uint16 kEarlyendrun = 2494; + const static uint16 kWidth18 = 1819; + const static uint16 kNotbeforehdead = 1105; + const static uint16 kNotheldtrainer = 3385; + const static uint16 kAfterprintname = 3861; + const static uint16 kIncdir = 1113; + const static uint16 kError1 = 3861; + const static uint16 kError2 = 3861; + const static uint16 kError3 = 3861; + const static uint16 kError4 = 3861; + const static uint16 kError5 = 3861; + const static uint16 kError6 = 3861; + const static uint16 kError7 = 3861; + const static uint16 kError8 = 3861; + const static uint16 kNotendcard = 1105; + const static uint16 kNotneg2 = 5691; + const static uint16 kCantpick = 2660; + const static uint16 kNodown = 2494; + const static uint16 kNotaxeonpool = 1105; + const static uint16 kIsbaseadd = 4949; + const static uint16 kShuffleadsdown = 2660; + const static uint16 kFindtopictext = 2895; + const static uint16 kFinishevery2 = 1711; + const static uint16 kCheckuselist = 2895; + const static uint16 kFinishevery1 = 1711; + const static uint16 kBigroom = 1711; + const static uint16 kAlreadyplce = 2660; + const static uint16 kMenuframeok = 3547; + const static uint16 kNotdelhotel = 2776; + const static uint16 kAlreadydu = 2776; + const static uint16 kGotintro1text = 1105; + const static uint16 kNotnewintro = 5674; + const static uint16 kRootdir = 2885; + const static uint16 kDorain = 1113; + const static uint16 kAlreadydd = 2776; + const static uint16 kNotblast = 4949; + const static uint16 kNorex = 2494; + const static uint16 kNosetloop = 4949; + const static uint16 kMonmessageloop = 2895; + const static uint16 kAlreadyplc2 = 2660; + const static uint16 kNotarrow = 5698; + const static uint16 kUpdateloop = 1214; + const static uint16 kIdentifyex = 5073; + const static uint16 kSeencard = 2660; + const static uint16 kAlreadygetops = 3777; + const static uint16 kNotenter = 3525; + const static uint16 kRainloop = 1214; + const static uint16 kNotplot = 1214; + const static uint16 kIdentifyreel = 5073; + const static uint16 kStillline = 1113; + const static uint16 kSetallloop = 3393; + const static uint16 kDiscopslist = 3777; + const static uint16 kBacktosolid = 1819; + const static uint16 kNotloc43 = 4949; + const static uint16 kTapwith = 3385; + const static uint16 kFinishrain = 1214; + const static uint16 kNotgunonpool = 1105; + const static uint16 kNotsmally2 = 5698; + const static uint16 kBotlotv = 4949; + const static uint16 kNotendkey = 3393; + const static uint16 kAlreadyblnk = 5698; + const static uint16 kPasspassed = 2895; + const static uint16 kMoreintroseq = 2494; + const static uint16 kNotplset = 1711; + const static uint16 kPathoktv = 3393; + const static uint16 kIsex = 2660; + const static uint16 kLineexit = 5691; + const static uint16 kNotupperc = 2776; + const static uint16 kGotsoldframe = 1105; + const static uint16 kDonextf = 3589; + const static uint16 kNomorethan6 = 5691; + const static uint16 kTendstohoriz = 5691; + const static uint16 kTwolotsleft = 3589; + const static uint16 kCanmore = 2692; + const static uint16 kArrow = 5698; + const static uint16 kHigher = 1113; + const static uint16 kAtmospherelist = 5073; + const static uint16 kHundredsc = 4945; + const static uint16 kNotbeforedead = 1105; + const static uint16 kNofindininv = 3393; + const static uint16 kFinmonscroll = 1711; + const static uint16 kFindinv2 = 2660; + const static uint16 kFindinv1 = 2660; + const static uint16 kNotsparkys = 4949; + const static uint16 kSpacepress = 3861; + const static uint16 kWaitstep = 1105; + const static uint16 kNofill = 1819; + const static uint16 kFolderlist = 3547; + const static uint16 kNoleftpage = 3589; + const static uint16 kFoundcharacter = 3861; + const static uint16 kHangonloop = 5862; + const static uint16 kTopleft = 5691; + const static uint16 kGetscash = 3385; + const static uint16 kNotlastraise = 1105; + const static uint16 kNumberpoke3 = 3393; + const static uint16 kNumberpoke2 = 3393; + const static uint16 kNumberpoke1 = 3393; + const static uint16 kNumberpoke0 = 3393; + const static uint16 kNotsparky1 = 1105; + const static uint16 kAlreadygrab = 2660; + const static uint16 kNotsamealready = 5691; + const static uint16 kInitrainside = 1113; + const static uint16 kShutdoor = 1214; + const static uint16 kOktalk2 = 1105; + const static uint16 kNotmonkryan = 1105; + const static uint16 kNotendcreds = 1105; + const static uint16 kNotworntoopen = 2660; + const static uint16 kNotsmokeb2 = 1105; + const static uint16 kNotsmokeb1 = 1105; + const static uint16 kAlreadyexinv = 2660; + const static uint16 kShowwatchreel = 4949; + const static uint16 kNoshow = 1105; + const static uint16 kRandomlouis = 1105; + const static uint16 kNotnexttalk = 2660; + const static uint16 kSteadyframe = 1105; + const static uint16 kDiarylist = 3651; + const static uint16 kNotlouisanim = 1105; + const static uint16 kNotonbalc = 3385; + const static uint16 kNotout2 = 2660; + const static uint16 kClosedfolder = 3589; + const static uint16 kNomadtext = 1105; + const static uint16 kCorrectcard = 3385; + const static uint16 kTalking = 1105; + const static uint16 kExframe = 2660; + const static uint16 kFoundfile2 = 2895; + const static uint16 kNotover32 = 5691; + const static uint16 kAlreadywalking = 5691; + const static uint16 kCansaveok = 3819; + const static uint16 kWatchison = 5691; + const static uint16 kKernit = 2494; + const static uint16 kNotinlouiss = 3393; + const static uint16 kOver1001 = 1105; + const static uint16 kOver1000 = 1105; + const static uint16 kFillcupfromtap = 3385; + const static uint16 kOpenlift = 1214; + const static uint16 kMakeswapex = 2660; + const static uint16 kAlreadyinfo = 2776; + const static uint16 kGotlighterwith = 3385; + const static uint16 kNowristwatch = 5691; + const static uint16 kNotfirstmad = 1105; + const static uint16 kCurfileloop = 2895; + const static uint16 kGameerror1 = 3861; + const static uint16 kGotcopframe = 1105; + const static uint16 kAlreadykeyp = 3693; + const static uint16 kDob = 3525; + const static uint16 kNotdiffdest = 1819; + const static uint16 kNotremset = 1711; + const static uint16 kDumpallloop = 1711; + const static uint16 kNextcheck2 = 5691; + const static uint16 kAlreadykeyn = 3693; + const static uint16 kEndwatchtalk = 2692; + const static uint16 kNottalked = 1105; + const static uint16 kNotsetd = 2660; + const static uint16 kSkipreelsound = 1214; + const static uint16 kNotspokento = 1105; + const static uint16 kEndofenvironment = 4949; + const static uint16 kEndofgame = 4949; + const static uint16 kNoselslot2 = 3861; + const static uint16 kScanloop = 4884; + const static uint16 kNotskip1 = 1711; + const static uint16 kKeybuffer = 5715; + const static uint16 kNotendcopper = 1105; + const static uint16 kFrameloopfx1 = 1819; + const static uint16 kFrameloopfx3 = 1819; + const static uint16 kFrameloopfx2 = 1819; + const static uint16 kNotpressed = 5698; + const static uint16 kNotmonk2text8 = 1105; + const static uint16 kNotmonk2text9 = 1105; + const static uint16 kNotmonk2text2 = 1105; + const static uint16 kNotmonk2text3 = 1105; + const static uint16 kNotmonk2text1 = 1105; + const static uint16 kNotmonk2text6 = 1105; + const static uint16 kNotmonk2text7 = 1105; + const static uint16 kNotmonk2text4 = 1105; + const static uint16 kNotmonk2text5 = 1105; + const static uint16 kNot164 = 2494; + const static uint16 kNot165 = 2494; + const static uint16 kNot160 = 2494; + const static uint16 kNot161 = 2494; + const static uint16 kNot162 = 2494; + const static uint16 kNot163 = 2494; + const static uint16 kNot168 = 2494; + const static uint16 kNocopper = 1105; + const static uint16 kCantdrip = 1105; + const static uint16 kFlashdots = 4949; + const static uint16 kTopfinished = 3651; + const static uint16 kOktalk = 1105; + const static uint16 kNonefound = 5073; + const static uint16 kNofindingtopic = 2895; + const static uint16 kGotgraphic = 2776; + const static uint16 kOnelot2 = 2494; + const static uint16 kFirstdes = 1105; + const static uint16 kWordloop = 2494; + const static uint16 kBotlot = 4949; + const static uint16 kDonterase = 2660; + const static uint16 kAtlast4 = 1214; + const static uint16 kEndofcolon = 2660; + const static uint16 kNotcentre = 2494; + const static uint16 kDontbother28 = 4949; + const static uint16 kNomadspeed = 1105; + const static uint16 kCanselectob = 3393; + const static uint16 kNotgunonrock = 1105; + const static uint16 kPath = 3393; + const static uint16 kNomorefading = 2494; + const static uint16 kAlreadydiscops = 3777; + const static uint16 kWidth80 = 1819; + const static uint16 kNotsartadd = 3693; + const static uint16 kRyanloop1 = 2494; + const static uint16 kRyanloop2 = 2494; + const static uint16 kLoop120 = 1819; + const static uint16 kLoop127 = 2660; + const static uint16 kLoop124 = 1819; + const static uint16 kLoop125 = 1819; + const static uint16 kLessthanapage = 2494; + const static uint16 kMoreloadspeech = 4926; + const static uint16 kCupfromtapfull = 3385; + const static uint16 kCombatover1 = 1105; + const static uint16 kCombatover2 = 1105; + const static uint16 kFlunkedit = 5073; + const static uint16 kCutgate = 3393; + const static uint16 kNotlastf = 3589; + const static uint16 kDoswap1 = 2660; + const static uint16 kDoswap2 = 2660; + const static uint16 kNotdes1 = 1105; + const static uint16 kBuscombatwonend = 1105; + const static uint16 kAddloop = 2660; + const static uint16 kWidth10 = 1819; + const static uint16 kWidth11 = 1819; + const static uint16 kWidth12 = 1819; + const static uint16 kWidth13 = 1819; + const static uint16 kWidth14 = 1819; + const static uint16 kWidth15 = 1819; + const static uint16 kWidth16 = 1819; + const static uint16 kWidth17 = 1819; + const static uint16 kWaitstopwalk = 4949; + const static uint16 kWidth19 = 1819; + const static uint16 kNonoise = 3525; + const static uint16 kSlabdwrong = 3385; + const static uint16 kUselist = 2895; + const static uint16 kMovealtar = 3385; + const static uint16 kQuickquit2 = 3861; + const static uint16 kFoundlen = 4884; + const static uint16 kOperand1 = 2883; + const static uint16 kMake = 5691; + const static uint16 kFinishidentify = 5073; + const static uint16 kNotlouiscard = 2660; + const static uint16 kIswalking = 5674; + const static uint16 kIsntcolon = 2660; + const static uint16 kZoomit = 1819; + const static uint16 kFoundnews = 2776; + const static uint16 kSlabbwrong = 3385; + const static uint16 kSlotloop = 3861; + const static uint16 kNotsarters2 = 4949; + const static uint16 kNotneg1 = 5691; + const static uint16 kDoopeninv = 2660; + const static uint16 kFoodinside = 3393; + const static uint16 kClearedlocations = 2776; + const static uint16 kNomore = 2692; + const static uint16 kAlreadyusedit = 3385; + const static uint16 kRetryreel = 1214; + const static uint16 kTalklist = 2660; + const static uint16 kNotexist = 4884; + const static uint16 kRockcombatend = 1105; + const static uint16 kWidth57 = 1819; + const static uint16 kPrtspriteloop = 1105; + const static uint16 kOpenboxwith = 3385; + const static uint16 kNotloop = 4949; + const static uint16 kNotinalley = 3393; + const static uint16 kPrintloopslow6 = 2494; + const static uint16 kPrintloopslow5 = 2494; + const static uint16 kNextone = 4884; + const static uint16 kExloop = 2660; + const static uint16 kCantdrip2 = 1105; + const static uint16 kSecondlot = 2776; + const static uint16 kAlreadysel = 3861; + const static uint16 kNotfreename = 5691; + const static uint16 kNotover2 = 5073; + const static uint16 kCanplace1 = 2660; + const static uint16 kCanplace3 = 2660; + const static uint16 kFinishmon = 2494; + const static uint16 kDeleteconts = 2660; + const static uint16 kLooknext2 = 2494; + const static uint16 kNotwalk = 1105; + const static uint16 kNotzeronum = 4949; + const static uint16 kError8patch = 4370; + const static uint16 kNodos = 3861; + const static uint16 kIsedens = 4949; + const static uint16 kNotlouisvol2 = 5073; + const static uint16 kHeavywait = 1105; + const static uint16 kPickupcontloop = 2660; + const static uint16 kHavegotcard = 1113; + const static uint16 kNotlastslab = 3385; + const static uint16 kComloop2 = 2776; + const static uint16 kSpeechfile = 4932; + const static uint16 kFindlenextext = 2660; + const static uint16 kSecurwait = 1105; + const static uint16 kComloop = 2776; + const static uint16 kNotboss = 1105; + const static uint16 kLine23 = 5691; + const static uint16 kDiscopsloop = 3777; + const static uint16 kKeypadlist = 3393; + const static uint16 kWearingwatch = 3385; + const static uint16 kSoundfail = 4949; + const static uint16 kHislope = 5691; + const static uint16 kGeneralerror = 3861; + const static uint16 kGotmonktext = 1105; + const static uint16 kNovolumeload = 5862; + const static uint16 kGotkeyn = 3693; + const static uint16 kDiffsub3 = 3393; + const static uint16 kGotlength = 2660; + const static uint16 kAnimsparky = 1105; + const static uint16 kNought = 1711; + const static uint16 kNotendtitles = 1105; + const static uint16 kIswatchingmode = 4949; + const static uint16 kNotquickp = 1105; + const static uint16 kNotwaitingheli = 1105; + const static uint16 kNotright = 3385; + const static uint16 kNolook = 2660; + const static uint16 kAxeoncontrols = 3393; + const static uint16 kFoundpersonal = 2776; + const static uint16 kNotaristoadd = 3589; + const static uint16 kFinishpars = 2895; + const static uint16 kNotnearly = 1214; + const static uint16 kSlabawrong = 3385; + const static uint16 kAfterpress = 3393; + const static uint16 kFinishedwalk = 1113; + const static uint16 kGotnext2 = 2494; + const static uint16 kNozoomonoff = 3693; + const static uint16 kDdok = 2776; + const static uint16 kLiftclosed = 1214; + const static uint16 kNotmonktext11 = 1105; + const static uint16 kNotafreeid = 5073; + const static uint16 kEndreelsound = 1214; + const static uint16 kNotendguard1 = 1105; + const static uint16 kWidth29 = 1819; + const static uint16 kWidth28 = 1819; + const static uint16 kWidth25 = 1819; + const static uint16 kWidth24 = 1819; + const static uint16 kWidth27 = 1819; + const static uint16 kWidth26 = 1819; + const static uint16 kAlreadydos = 3861; + const static uint16 kWidth20 = 1819; + const static uint16 kWidth23 = 1819; + const static uint16 kWidth22 = 1819; + const static uint16 kNodd = 2776; + const static uint16 kPipewith = 3385; + const static uint16 kShutdoor2 = 1214; + const static uint16 kGotdrinker = 1105; + const static uint16 kDogrb = 2660; + const static uint16 kNodu = 2776; + const static uint16 kHangonloope = 2494; + const static uint16 kShaketable = 1711; + const static uint16 kAfterinfo = 2776; + const static uint16 kCanredes = 2714; + const static uint16 kNotbeforedeadb = 1105; + const static uint16 kFinishshake = 1711; + const static uint16 kNomake = 2660; + const static uint16 kNotclear = 4949; + const static uint16 kNotwithboss = 3393; + const static uint16 kAlreadylastf = 3589; + const static uint16 kConvertpcx = 1711; + const static uint16 kFadedosloop = 2494; + const static uint16 kMiddleofwalk = 5674; + const static uint16 kFinflashmouse = 5698; + const static uint16 kScrollmonloop1 = 1711; + const static uint16 kMenulist = 3525; + const static uint16 kScrollmonloop2 = 1711; + const static uint16 kAlreadytrav = 2776; + const static uint16 kNotfirstdest = 2776; + const static uint16 kWidth55 = 1819; + const static uint16 kNotendtelly = 1105; + const static uint16 kNotch1endofpage1 = 4949; + const static uint16 kNotedens2 = 3393; + const static uint16 kBlimey = 5862; + const static uint16 kNotxover = 5715; + const static uint16 kGotconst = 1214; + const static uint16 kContinuewalk = 1113; + const static uint16 kLeftpageloop = 3589; + const static uint16 kCantsetup = 3393; + const static uint16 kNottrigger = 2494; + const static uint16 kIsanextra = 2494; + const static uint16 kNotonsartroof = 3393; + const static uint16 kCombathand = 5698; + const static uint16 kGotreader1with = 3385; + const static uint16 kCanpick2 = 2660; + const static uint16 kNodistortv = 4949; + const static uint16 kCanpick4 = 2660; + const static uint16 kSlowgates = 1105; + const static uint16 kNotsetd2 = 2660; + const static uint16 kNotnearframeend = 2660; + const static uint16 kInsideloop = 3393; + const static uint16 kCommandline = 5674; + const static uint16 kEndofdir = 2895; + const static uint16 kLouisvol = 5073; + const static uint16 kNotdrinker1 = 1105; + const static uint16 kGobackover = 3393; + const static uint16 kIswatchinv = 2660; + const static uint16 kHissnoise = 1214; + const static uint16 kNodumptimed = 3393; + const static uint16 kLoloop = 5691; + const static uint16 kNotplfree = 1711; + const static uint16 kLooky2 = 5862; + const static uint16 kSetframe = 2660; + const static uint16 kLine31 = 5691; + const static uint16 kHalfend = 2494; + const static uint16 kLine32 = 5691; + const static uint16 kIsntspecial = 2660; + const static uint16 kAlreadynextf = 3589; + const static uint16 kBeforethisone = 2660; + const static uint16 kRtofdoor = 1214; + const static uint16 kGotkeyp = 3693; + const static uint16 kNotinsartroom = 3393; + const static uint16 kChosenaccess = 2776; + const static uint16 kNofoundchange = 3393; + const static uint16 kIstravel = 2714; + const static uint16 kOddwidth2 = 1819; + const static uint16 kOddwidth3 = 1819; + const static uint16 kIswatchmad = 1105; + const static uint16 kNomorereel = 4949; + const static uint16 kDosparky = 1105; + const static uint16 kCandle1 = 1105; + const static uint16 kNextbit = 2494; + const static uint16 kSizeok1 = 2660; + const static uint16 kSizeok2 = 2660; + const static uint16 kNoadd = 5674; + const static uint16 kLookattail = 4949; + const static uint16 kBacktootherfx = 1819; + const static uint16 kIsautoloc = 2714; + const static uint16 kFoundcom = 2776; + const static uint16 kFreeobject = 3393; + const static uint16 kWidth38 = 1819; + const static uint16 kWidth39 = 1819; + const static uint16 kWidth32 = 1819; + const static uint16 kWidth33 = 1819; + const static uint16 kNotendblock = 1711; + const static uint16 kWidth31 = 1819; + const static uint16 kWidth36 = 1819; + const static uint16 kWidth37 = 1819; + const static uint16 kWidth34 = 1819; + const static uint16 kWidth35 = 1819; + const static uint16 kNotwrapforb = 3651; + const static uint16 kAlreadyload = 3735; + const static uint16 kCantpurge = 2660; + const static uint16 kHelicombatend = 1105; + const static uint16 kEmptyinterface = 2776; + const static uint16 kSymbolwrong = 3589; + const static uint16 kNotlouis = 1113; + const static uint16 kWaitops = 3693; + const static uint16 kNotedensagain = 4949; + const static uint16 kNotyetrecep = 3385; + const static uint16 kInitrainside2 = 1113; + const static uint16 kGotheliframe = 1105; + const static uint16 kNevershown = 5698; + const static uint16 kDodiscops = 3777; + const static uint16 kNotlasttalk1 = 1105; + const static uint16 kAlreadyreds = 2714; + const static uint16 kNotext = 3393; + const static uint16 kNodiscops = 3777; + const static uint16 kGotrockframe = 1105; + const static uint16 kNotloc15 = 4949; + const static uint16 kWaittalk = 2660; + const static uint16 kChannel0once = 1214; + const static uint16 kEndline = 1711; + const static uint16 kNomoreatmos = 5073; + const static uint16 kDestoryopenbox = 3385; + const static uint16 kNotsmally = 5698; + const static uint16 kBotofdoor = 1214; + const static uint16 kNotqk = 3525; + const static uint16 kNotqs = 3651; + const static uint16 kCantopinv = 2660; + const static uint16 kWidth8 = 1819; + const static uint16 kWidth9 = 1819; + const static uint16 kWidth2 = 1819; + const static uint16 kWidth3 = 1819; + const static uint16 kWidth0 = 1819; + const static uint16 kWidth1 = 1819; + const static uint16 kWidth6 = 1819; + const static uint16 kWidth7 = 1819; + const static uint16 kWidth4 = 1819; + const static uint16 kWidth5 = 1819; + const static uint16 kAlreadybotl = 3651; + const static uint16 kNotsetcard = 1105; + const static uint16 kVolok = 4949; + const static uint16 kAlreadysave = 3819; + const static uint16 kGotwirewith = 3393; + const static uint16 kBhloop2 = 1819; + const static uint16 kBhloop1 = 1819; + const static uint16 kHangonearly = 2494; + const static uint16 kTakenloop = 2660; + const static uint16 kGotmonks2text = 1105; + const static uint16 kNotanimend1 = 1105; + const static uint16 kNoopenob = 2660; + const static uint16 kLookx2 = 5862; + const static uint16 kFindsometext = 2660; + const static uint16 kNotnextf = 3589; + const static uint16 kGameerror8 = 4326; + const static uint16 kNotdelboathouse = 2776; + const static uint16 kGameerror6 = 4197; + const static uint16 kGameerror7 = 4267; + const static uint16 kGameerror4 = 4062; + const static uint16 kGameerror5 = 4123; + const static uint16 kGameerror2 = 3929; + const static uint16 kGameerror3 = 4010; + const static uint16 kNomatch = 2895; + const static uint16 kVolloop = 4949; + const static uint16 kPlatewith = 3393; + const static uint16 kHiloop = 5691; + const static uint16 kNodrop2 = 2660; + const static uint16 kSkipoffsets = 1819; + const static uint16 kRockspeed = 1105; + const static uint16 kWantstowalk = 5674; + const static uint16 kNotfirstpool = 1105; + const static uint16 kNotlocky = 1214; + const static uint16 kGotalong = 2660; + const static uint16 kNoinfo = 2776; + const static uint16 kToofaraway = 5674; + const static uint16 kMoney2poke = 3390; + const static uint16 kThousandsc = 4945; + const static uint16 kNotb = 3525; + const static uint16 kKeeplooking = 2895; + const static uint16 kDontrestore = 5862; + const static uint16 kNotlastspeed2 = 4949; + const static uint16 kOver242 = 2660; + const static uint16 kInitraintop = 1113; + const static uint16 kError2patch = 3997; + const static uint16 kNoplot = 1214; + const static uint16 kNormal = 1711; + const static uint16 kFinishslow = 2494; + const static uint16 kMustgo = 4949; + const static uint16 kLesscolour = 2494; + const static uint16 kOpenboxwrong = 3385; + const static uint16 kNotch1only = 4949; + const static uint16 kClearboxwith = 3385; + const static uint16 kEndoflist = 1214; + const static uint16 kNotblock = 5674; + const static uint16 kNotbothendofpage0 = 4949; + const static uint16 kNotbothendofpage1 = 4949; + const static uint16 kGotrecep = 1105; + const static uint16 kNoreset = 5862; + const static uint16 kKeypadloop = 3393; + const static uint16 kPoolwith = 3385; + const static uint16 kOddwidthframe = 1819; + const static uint16 kGuardspeed = 1105; + const static uint16 kNocountclose = 1214; + const static uint16 kRightcard = 3385; + const static uint16 kWireknife = 3393; + const static uint16 kNouse = 2895; + const static uint16 kNotdream3 = 2660; + const static uint16 kDolastf = 3589; + const static uint16 kDirectloop1 = 2895; + const static uint16 kSlow = 4949; + const static uint16 kAlreadynewgame = 4926; + const static uint16 kLoop048 = 5073; + const static uint16 kIntrom2fin = 1105; + const static uint16 kDiaryloop = 3651; + const static uint16 kRyansoff = 5073; + const static uint16 kDoneover2 = 1105; + const static uint16 kNotinroom = 2660; + const static uint16 kIsaperson = 5674; + const static uint16 kNotadown = 1113; + const static uint16 kFoundchange = 3393; + const static uint16 kNumloop1 = 4949; + const static uint16 kNoaddg = 2494; + const static uint16 kEndoftext = 2494; + const static uint16 kNoaddb = 2494; + const static uint16 kKeepgoing = 2494; + const static uint16 kNotintro1text2 = 1105; + const static uint16 kGotintromonk2 = 1105; + const static uint16 kNoaddr = 2494; + const static uint16 kGotintromonk1 = 1105; + const static uint16 kAccesscom = 2776; + const static uint16 kNotshieldonbus = 1105; + const static uint16 kDontplace = 1711; + const static uint16 kAlreadydrop = 2660; + const static uint16 kLoadmode = 3861; + const static uint16 kGotendseq = 1105; + const static uint16 kNotverycool = 5691; + const static uint16 kNorightpage = 3589; + const static uint16 kChangeloop = 3393; + const static uint16 kGotintro2text = 1105; + const static uint16 kItsanobject = 5698; + const static uint16 kGotquad = 5691; + const static uint16 kNotsmoket1 = 1105; + const static uint16 kNotsmoket2 = 1105; + const static uint16 kAlreadymore = 2692; + const static uint16 kFoundlineend = 1214; + const static uint16 kHasloadedroom = 4884; + const static uint16 kShowobsloop = 2660; + const static uint16 kNogetback = 2660; + const static uint16 kLooknext = 1105; + const static uint16 kGotthere = 2494; + const static uint16 kIsrightkey = 3385; + const static uint16 kGameover = 4949; + const static uint16 kRainlocations = 1113; + const static uint16 kFolderloop = 3547; + const static uint16 kNotactload = 3861; + const static uint16 kBotfinished = 3651; + const static uint16 kNotthisob = 2660; + const static uint16 kSteadyob = 1214; + const static uint16 kNoneedforemm = 4949; + const static uint16 kDirroot = 2895; + const static uint16 kSearchdestup = 2776; + const static uint16 kUsedpriority = 2660; + const static uint16 kFinishedsetobs = 2660; + const static uint16 kNotlouisthund = 1214; + const static uint16 kNotmapupspec = 1711; + const static uint16 kGotkey = 3525; + const static uint16 kNotraisearm = 1105; + const static uint16 kFoundmatch = 2660; + const static uint16 kRightkey = 3393; + const static uint16 kEndoftopic = 2895; + const static uint16 kBotwrap = 3651; + const static uint16 kSame = 5862; + const static uint16 kNotwrapback = 3651; + const static uint16 kCantswap1 = 2660; + const static uint16 kCantswap2 = 2660; + const static uint16 kTryagain = 2660; + const static uint16 kNotnewpath = 5674; + const static uint16 kTvdoorwith = 3385; + const static uint16 kFinishearly = 4949; + const static uint16 kCantpurge2 = 2660; + const static uint16 kGetloop = 2494; + const static uint16 kLine12 = 5691; + const static uint16 kRestartlouis = 1105; + const static uint16 kAlreadyactsave = 3861; + const static uint16 kNotaleft = 1113; + const static uint16 kNobark = 1105; + const static uint16 kTopok = 4949; + const static uint16 kQuitconv = 2692; + const static uint16 kFacelist = 1105; + const static uint16 kNomadspeak = 1105; + const static uint16 kSymbolloop = 3589; + const static uint16 kEmmerror1 = 4949; + const static uint16 kEmmerror2 = 4945; + const static uint16 kNoload = 3735; + const static uint16 kNowatchworn = 4949; + const static uint16 kWithlist1 = 2618; + const static uint16 kNotaide = 3393; + const static uint16 kNotinhere = 2660; + const static uint16 kNotnew = 5073; + const static uint16 kDestlist = 2714; + const static uint16 kNocountopen = 1214; + const static uint16 kNextatmos = 5073; + const static uint16 kNokern = 2494; + const static uint16 kAnimating = 2660; + const static uint16 kNomorekeys = 3525; + const static uint16 kWaitinit = 4945; + const static uint16 kGotdoorwith = 3393; + const static uint16 kBeforethistext = 2660; + const static uint16 kNotyetassigned = 2895; + const static uint16 kDifffound = 5698; + const static uint16 kNotfoundinside = 3393; + const static uint16 kFpathloop = 5073; + const static uint16 kNottrigger2 = 2494; + const static uint16 kNotdoor = 1214; + const static uint16 kFinishback = 1214; + const static uint16 kLookforpurge2 = 2660; + const static uint16 kNotnegative2 = 1105; + const static uint16 kNotgotgun = 1105; + const static uint16 kNotnegative1 = 1105; + const static uint16 kGotreader2with = 3385; + const static uint16 kSavelist = 3819; + const static uint16 kMousehand = 5698; + const static uint16 kFindnewpage = 2660; + const static uint16 kNotspeed = 1105; + const static uint16 kFinishmakename = 5691; + const static uint16 kNotlock = 2895; + const static uint16 kNormalreel = 1214; + const static uint16 kFoundsign = 2895; + const static uint16 kGotnext = 1105; + const static uint16 kNofog = 1105; + const static uint16 kNopresses = 3393; + const static uint16 kComplete = 2895; + const static uint16 kSizewrong = 2660; + const static uint16 kAlreadytopl = 3651; + const static uint16 kNoneedtorecon = 1711; + const static uint16 kGatewith = 3393; + const static uint16 kPrintloop7 = 2494; + const static uint16 kPrintloop6 = 2494; + const static uint16 kPrintloop5 = 2494; + const static uint16 kNullframe = 2660; + const static uint16 kNotcrystal = 4949; + const static uint16 kAlreadytopr = 3651; + const static uint16 kPrintloop8 = 2494; + const static uint16 kNotinthisone = 2776; + const static uint16 kNotblankshow = 1819; + const static uint16 kNoshoe2 = 1113; + const static uint16 kDspready = 4945; + const static uint16 kToplotv = 4949; + const static uint16 kIdentifyfree = 5073; + const static uint16 kSignonloop = 2895; + const static uint16 kEndcredits21 = 2494; + const static uint16 kDescribe = 2660; + const static uint16 kNotinnewroom = 1105; + const static uint16 kPathokboss = 3393; + const static uint16 kOpendoor2 = 1214; + const static uint16 kJustcancel = 4945; + const static uint16 kOpenchangesize = 2588; + const static uint16 kIncorrect = 3393; + const static uint16 kZeroblock = 1819; + const static uint16 kFindsetloop = 3393; + const static uint16 kNotxover2 = 5715; + const static uint16 kNotsecondbank = 4949; + const static uint16 kNextline = 1819; + const static uint16 kNotheldob = 2660; + const static uint16 kGotfirst = 5073; + const static uint16 kPowerok = 2895; + const static uint16 kCheckdestloop = 5691; + const static uint16 kMadmanspoken = 1105; + const static uint16 kTensc = 4945; + const static uint16 kDosave = 3819; + const static uint16 kDirectory = 2776; + const static uint16 kKeyontv = 3385; + const static uint16 kDoselob = 3393; + const static uint16 kDuok = 2776; + const static uint16 kChangelight = 3525; + const static uint16 kIsinleft = 5691; + const static uint16 kIsdream1 = 5691; + const static uint16 kDodecisions = 4949; + const static uint16 kNotlockdoor = 1214; + const static uint16 kNotinlift = 2660; + const static uint16 kNotplayingreel = 4949; + const static uint16 kNodumpwatch = 4949; + const static uint16 kTrampgone = 1105; + const static uint16 kObnotexist = 2660; + const static uint16 kNodumptextline = 5698; + const static uint16 kTwolotsright = 3589; + const static uint16 kCantopenit = 2660; + const static uint16 kCantwalk = 5691; + const static uint16 kCdinside = 3393; + const static uint16 kMakedoorsopen = 4949; + const static uint16 kPowerloop = 2776; + const static uint16 kNotanexid = 5073; + const static uint16 kNotcent2 = 2494; + const static uint16 kOpenbox = 3385; + const static uint16 kNotwatching = 4949; + const static uint16 kNosetpick = 2660; + const static uint16 kPlaceit = 1711; + const static uint16 kNotwatchinv = 2660; + const static uint16 kDiff2 = 5674; + const static uint16 kEndupdate = 1214; + const static uint16 kNotendcandle1 = 1105; + const static uint16 kFlipfolder = 3589; + const static uint16 kNokeyatall = 3693; + const static uint16 kGotlight = 3525; + const static uint16 kAlreadyqs = 3651; + const static uint16 kDifsub8 = 2660; + const static uint16 kWidth88 = 1819; + const static uint16 kAlreadyqk = 3525; + const static uint16 kCanpick = 2660; + const static uint16 kDifsub1 = 2660; + const static uint16 kDifsub2 = 2660; + const static uint16 kDifsub3 = 2660; + const static uint16 kDifsub4 = 2660; + const static uint16 kNotinedenslift = 1113; + const static uint16 kDifsub7 = 2660; + const static uint16 kSearch = 2660; + const static uint16 kDomoretalk = 2692; + const static uint16 kNotbystudio = 3393; + const static uint16 kDonethisbit = 3393; + const static uint16 kNotrainatall = 1105; + const static uint16 kNotremfree = 1711; + const static uint16 kNomatchslot2 = 3861; + const static uint16 kSelect = 2714; + const static uint16 kGotheavyframe = 1105; + const static uint16 kDrawnsetob = 2660; + const static uint16 kNotloc23 = 4949; + const static uint16 kNotopright = 3651; + const static uint16 kCheckpurgeagain = 2660; + const static uint16 kNotleave = 1113; + const static uint16 kGotendtext = 1105; + const static uint16 kNotdel = 2776; + const static uint16 kNotmonktext10 = 1105; + const static uint16 kNotmonktext13 = 1105; + const static uint16 kNotmonktext12 = 1105; + const static uint16 kDogetbackops = 3777; + const static uint16 kNoautolook = 2660; + const static uint16 kDecdir = 1113; + const static uint16 kNotaright = 1113; + const static uint16 kZoomswitch = 1819; + const static uint16 kFoundnewex = 2660; + const static uint16 kNodream7 = 2895; + const static uint16 kIswatching = 2494; + const static uint16 kNotfudge = 1711; + const static uint16 kZerostill = 3861; + const static uint16 kNotenterdream = 4949; + const static uint16 kNotlastdest = 2776; + const static uint16 kDoexinv = 2660; + const static uint16 kOpsblock1 = 3735; + const static uint16 kGotsecurframe = 1105; + const static uint16 kEndearly2 = 2494; + const static uint16 kPlaygame = 4949; + const static uint16 kNotdiff = 1105; + const static uint16 kNotaftersshot = 1105; + const static uint16 kSet16palloop2 = 2494; + const static uint16 kPriestspoken = 1105; + const static uint16 kOpenloop1 = 2494; + const static uint16 kMoreload2 = 4945; + const static uint16 kGotstartletter = 2660; + const static uint16 kEndmugger1 = 1105; + const static uint16 kEndmugger2 = 1105; + const static uint16 kGotintrom1 = 1105; + const static uint16 kGotintrom3 = 1105; + const static uint16 kGotintrom2 = 1105; + const static uint16 kWaitkey = 2776; + const static uint16 kNozoom1 = 5691; + const static uint16 kWantstotalk = 5674; + const static uint16 kNotfirst = 1113; + const static uint16 kSlabewrong = 3385; + const static uint16 kCantmakeoneup = 2660; + const static uint16 kNotdoorsound1 = 1214; + const static uint16 kNotdoorsound3 = 1214; + const static uint16 kNotdoorsound2 = 1214; + const static uint16 kNotdoorsound4 = 1214; + const static uint16 kDirectloop2 = 2895; + const static uint16 kNomatchslot = 3861; + const static uint16 kNotzoomon = 5698; + const static uint16 kDontcheck = 5674; + const static uint16 kLookforlineend = 1214; + const static uint16 kFrameloop1 = 1819; + const static uint16 kFrameloop3 = 1819; + const static uint16 kFrameloop2 = 1819; + const static uint16 kRightspeed3 = 5698; + const static uint16 kFinex = 2660; + const static uint16 kIscup = 2660; + const static uint16 kNoconvnum = 4949; + const static uint16 kEmmerror = 4945; + const static uint16 kLiftopen = 1214; + const static uint16 kClearloop = 1711; + const static uint16 kDumpevery2 = 1711; + const static uint16 kDumpevery1 = 1711; + const static uint16 kAlreadyb = 3525; + const static uint16 kFirsttimed = 3393; + const static uint16 kNotboth = 5698; + const static uint16 kKeyconverttab = 5731; + const static uint16 kNoturnonyet = 1214; + const static uint16 kNotmonk2text10 = 1105; + const static uint16 kNotmonk2text11 = 1105; + const static uint16 kNotinbath = 1105; + const static uint16 kActuallyswap = 2660; + const static uint16 kKeyscom = 2776; + const static uint16 kNormalline = 5691; + const static uint16 kEndcredits2 = 1105; + const static uint16 kEndcredits1 = 1105; + const static uint16 kNofindex = 3393; + const static uint16 kLoslope = 5691; + const static uint16 kNottalkedboss = 1105; + const static uint16 kWrongroom1 = 3393; + const static uint16 kWaitexam = 2494; + const static uint16 kNotsetname = 5691; + const static uint16 kFileerror = 5862; + const static uint16 kLoop2 = 1711; + const static uint16 kLoop1 = 1711; + const static uint16 kRtofdoor2 = 1214; + const static uint16 kNotmaprightspec = 1711; + const static uint16 kIsnosound = 4949; + const static uint16 kInwatching = 1819; + const static uint16 kNotthirdtrigger = 2895; + const static uint16 kHavesetwatch = 1105; + const static uint16 kIsthunder1 = 1214; + const static uint16 kMainlist = 4949; + const static uint16 kNotopenchurch = 3393; + const static uint16 kPriorityloop = 1105; + const static uint16 kEdenspart2 = 3393; + const static uint16 kRyansded = 1105; + const static uint16 kNotwrapfor = 3651; + const static uint16 kNotintro3text2 = 1105; + const static uint16 kNotafterhshot = 1105; + const static uint16 kNottalkedsparky = 1105; + const static uint16 kZoomloop2 = 1819; + const static uint16 kNotmugger = 1105; + const static uint16 kNotcarpark = 4949; + const static uint16 kLoadlist = 3735; + const static uint16 kWaitdecide = 4884; + const static uint16 kSkiptalk = 2692; + const static uint16 kNextopenslot = 2494; + const static uint16 kNotfound = 2895; + const static uint16 kDosetpick = 2660; + const static uint16 kTryanotherex = 2660; + const static uint16 kNotaideadd = 3589; + const static uint16 kNotshown = 3693; + const static uint16 kNotshowp = 3693; + const static uint16 kNotendadvis = 1105; + const static uint16 kAlreadylook = 2660; + const static uint16 kNotblankpers = 5073; + const static uint16 kCorrectcard2 = 3385; + const static uint16 kGetslotnum = 3861; + const static uint16 kNogetbackops = 3777; + const static uint16 kNotinsideex = 2660; + const static uint16 kHangloopw = 5698; + const static uint16 kHangloopq = 2692; + const static uint16 kCigarette = 3385; + const static uint16 kDonefirstops = 3693; + const static uint16 kBotright = 5691; + const static uint16 kNotwalkandexam = 5691; + const static uint16 kFinishfile = 2895; + const static uint16 kAlreadyselob = 3393; + const static uint16 kFinishfill = 2494; + const static uint16 kPickupexob = 2660; + const static uint16 kTriedknife = 3393; + const static uint16 kIsinexlist = 2660; + const static uint16 kAfterkey = 3861; + const static uint16 kDoopenob = 2660; + const static uint16 kFinishdirct = 2494; + const static uint16 kLoadedalready = 5862; + const static uint16 kWatchtalk = 2692; + const static uint16 kKeysloop = 2895; + const static uint16 kFailed = 2895; + const static uint16 kEndearly = 2494; + const static uint16 kNotfirsttimed = 3393; + const static uint16 kIswaitingpool = 1105; + const static uint16 kBlinktab = 5691; + const static uint16 kNotcentred = 1819; + const static uint16 kCandles2fin = 1105; + const static uint16 kMoretext = 2660; + const static uint16 kNormalwalk = 1113; + const static uint16 kNokey = 5715; + const static uint16 kGotpl = 5691; + const static uint16 kAlreadyswap1 = 2660; + const static uint16 kSignoncom = 2776; + const static uint16 kOpenpool = 3385; + const static uint16 kOpslist = 3693; + const static uint16 kNoneedtoremove = 4949; + const static uint16 kNoloadold = 4926; + const static uint16 kNotintro2text1 = 1105; + const static uint16 kNotintro2text2 = 1105; + const static uint16 kNobotleft = 3651; + const static uint16 kIgnoreit = 2494; + const static uint16 kNotalley = 4949; + const static uint16 kSpecialcase = 2660; + const static uint16 kNodumpsym = 3651; + const static uint16 kCanopenit1 = 2660; + const static uint16 kNotsecondpart = 2692; + const static uint16 kNotmapup2 = 1711; + const static uint16 kIsfree = 2660; + const static uint16 kOver045 = 5073; + const static uint16 kGoingdown = 3393; + const static uint16 kNotedenlob = 4949; + const static uint16 kNoclear = 4949; + const static uint16 kNoobselect = 5674; + const static uint16 kLowvolumetran = 4949; + const static uint16 kCh0oksecond = 4945; + const static uint16 kFlashmousetab = 5698; + const static uint16 kIntrom3fin = 1105; + const static uint16 kNotareelid = 5073; + const static uint16 kKeyok = 2895; + const static uint16 kDontbother4 = 4949; + const static uint16 kExamlist = 2494; + const static uint16 kDontbother2 = 4945; + const static uint16 kDontbother3 = 4949; + const static uint16 kNotlair = 5674; + const static uint16 kDontbother8 = 4926; + const static uint16 kDontbother9 = 4945; + const static uint16 kNotfirstbiz = 1105; + const static uint16 kWrongatmos = 5073; + const static uint16 kContleftpage = 3589; + const static uint16 kAlreadysp = 2660; + const static uint16 kMustbeopen = 1214; + const static uint16 kNotryanoff = 1711; + const static uint16 kSkip1 = 1711; + const static uint16 kOver138 = 2660; + const static uint16 kNotkeyn = 3693; + const static uint16 kWholeloop1 = 2494; + const static uint16 kCanlastf = 3589; + const static uint16 kStereook = 3393; + const static uint16 kStereoon = 3393; + const static uint16 kEmptycup = 2660; + const static uint16 kQuitloaded = 3735; + const static uint16 kNotkeyp = 3693; + const static uint16 kFlipfolderline = 3589; + const static uint16 kIdentifyset = 5073; + const static uint16 kWalkandexamine = 5674; + const static uint16 kFirstbitofblock = 1819; + const static uint16 kNotloc44 = 4949; + const static uint16 kRighthand = 3385; + const static uint16 kBacktoother = 1819; + const static uint16 kEndofdir2 = 2895; + const static uint16 kNotendsmallcandle = 1105; + const static uint16 kIsbright = 4949; + const static uint16 kWidth63 = 1819; + const static uint16 kEndofinput = 2776; + const static uint16 kGotadvframe = 1105; + const static uint16 kQuitlist = 2692; + const static uint16 kNotwornswap = 2660; + const static uint16 kKeys = 2807; + const static uint16 kNomod = 2494; + const static uint16 kNodumpeye = 5698; + const static uint16 kCopyin1 = 2895; + const static uint16 kHorizloop = 5691; + const static uint16 kFquit = 4884; + const static uint16 kFullcup = 2660; + const static uint16 kPurgeloc = 2660; + const static uint16 kNotendmonk1 = 1105; + const static uint16 kDontpurge = 2660; + const static uint16 kExecutewalk = 1105; + const static uint16 kIntrom1fin = 1105; + const static uint16 kNotout = 2660; + const static uint16 kGamerfin = 1105; + const static uint16 kAfterwalk = 1105; + const static uint16 kNotgotobject = 2660; + const static uint16 kDoincryan = 2660; + const static uint16 kCopytext = 5691; + const static uint16 kIsntsame = 2660; + const static uint16 kNoeffects = 1819; + const static uint16 kFindblaster = 4949; + const static uint16 kNottalkedrecep = 1105; + const static uint16 kDecidelist = 4884; + const static uint16 kIsdouble = 1105; + const static uint16 kNoswap2 = 5691; + const static uint16 kNoswap1 = 5691; + const static uint16 kNotspeaking = 2692; + const static uint16 kMorerain = 1214; + const static uint16 kSizeok = 2660; + const static uint16 kNotdeltvstud = 2776; + const static uint16 kEndofline = 1113; + const static uint16 kOddwidth = 1819; + const static uint16 kBacktosolidfx = 1819; + const static uint16 kNotinedens = 3393; + const static uint16 kMoreload = 4945; + const static uint16 kIntoopen = 2660; + const static uint16 kIsfree3 = 2660; + const static uint16 kIsfree2 = 2660; + const static uint16 kActuallyout = 2660; + const static uint16 kFailrain = 1214; + const static uint16 kFullvol = 5073; + const static uint16 kGotreader3with = 3385; + const static uint16 kNmloop1 = 1819; + const static uint16 kNmloop2 = 1819; + const static uint16 kIntromonk2fin = 1105; + const static uint16 kNotnocurs = 3861; + const static uint16 kMultiloop1 = 1819; + const static uint16 kWithit = 2494; + const static uint16 kMultiloop3 = 1819; + const static uint16 kMultiloop2 = 1819; + const static uint16 kMultiloop5 = 1819; + const static uint16 kMultiloop4 = 1819; + const static uint16 kMultiloop6 = 1819; + const static uint16 kInpoolhall = 3393; + const static uint16 kUsekey1 = 3393; + const static uint16 kUsekey2 = 3393; + const static uint16 kGetoutofit = 5698; + const static uint16 kNotrav = 2776; + const static uint16 kDouse = 2895; + const static uint16 kNotdelsarters = 2776; + const static uint16 kNottvsoldier = 3393; + const static uint16 kAddloop2 = 2660; + const static uint16 kJustgetback = 2494; + const static uint16 kNotreleasehold = 4949; + const static uint16 kMightwait = 1105; + const static uint16 kNotyet = 3385; + const static uint16 kNotintro1text1 = 1105; + const static uint16 kNotintro1text3 = 1105; + const static uint16 kIsdma = 4949; + const static uint16 kNotinbed = 1105; + const static uint16 kPlinthwith = 3385; + const static uint16 kAxeondoor = 3393; + const static uint16 kOkcom = 2895; + const static uint16 kNotover1 = 5073; + const static uint16 kHorizline = 5691; + const static uint16 kBuscombatwon = 1105; + const static uint16 kAlreadyincryan = 2660; + const static uint16 kPalloop = 1711; + const static uint16 kGotguardframe = 1105; + const static uint16 kGotcrystal = 3385; + const static uint16 kLookcolon = 3385; + const static uint16 kAccessloop = 2776; + const static uint16 kSaveops = 3819; + const static uint16 kMonloop1 = 5698; + const static uint16 kCheckmain = 4949; + const static uint16 kWidth128 = 1819; + const static uint16 kNotheld = 2895; + const static uint16 kNotopleft = 3651; + const static uint16 kDeallerror = 4949; + const static uint16 kEndtail = 4949; + const static uint16 kEndofthisline = 1214; + const static uint16 kSignonloop2 = 2895; + const static uint16 kSymbollist = 3589; + const static uint16 kNofirst = 5073; + const static uint16 kLockloop = 2895; + const static uint16 kFinishslow2 = 2494; + const static uint16 kNopathoff = 5073; + const static uint16 kCantsetup2 = 3393; + const static uint16 kHaventfound = 3393; + const static uint16 kIsmorereel = 4949; + const static uint16 kNotbracket = 2895; + const static uint16 kMoreendseq = 2494; + const static uint16 kEndlessloop = 4949; + const static uint16 kNodel2 = 3861; + const static uint16 kNodroperror = 2660; + const static uint16 kEndgametext1 = 4835; + const static uint16 kNoops = 3693; + const static uint16 kNotclear3 = 4949; + const static uint16 kNotclear2 = 4949; + const static uint16 kNotclear1 = 4949; + const static uint16 kLoadnew = 4949; + const static uint16 kFinishtime = 4949; + const static uint16 kBusspeed = 1105; + const static uint16 kGotbusframe = 1105; + const static uint16 kGrafwith = 3385; + const static uint16 kIsex2 = 2660; + const static uint16 kIsex3 = 2660; + const static uint16 kDoplace = 2660; + const static uint16 kSoldierwait = 1105; + const static uint16 kGotsmoket = 1105; + const static uint16 kNothingund = 5073; + const static uint16 kPlotloop = 1214; + const static uint16 kWaiting = 1105; + const static uint16 kNoresetpit = 4949; + const static uint16 kGotsmokeb = 1105; + const static uint16 kFoundfile = 2895; + const static uint16 kRightpageloop = 3589; + const static uint16 kBothspecial = 2660; + const static uint16 kIssoundint = 4949; + const static uint16 kNotspace1 = 2895; + const static uint16 kLowvolumemix = 4949; + const static uint16 kNoactsave = 3861; + const static uint16 kWalkman = 1105; + const static uint16 kNotinrockroom = 3393; + const static uint16 kNodrop = 2660; + const static uint16 kKeyonhotel2 = 3385; + const static uint16 kKeyonhotel1 = 3385; + const static uint16 kGotcontrolwith = 3393; + const static uint16 kThingsonaltar = 3385; + const static uint16 kAlreadywon = 1105; + const static uint16 kNextslab = 3385; + const static uint16 kAlreadyrun = 5073; + const static uint16 kFinishclose = 1214; + const static uint16 kHangloop = 5698; + const static uint16 kNonewgame = 4926; + const static uint16 kCh1oksecond = 4945; + const static uint16 kForcenext = 1105; + const static uint16 kUpordown2 = 1214; + const static uint16 kBalls = 3393; + const static uint16 kWidth21 = 1819; + const static uint16 kAlreadyops = 3693; + const static uint16 kEndword = 2494; + const static uint16 kIsntblank = 4884; + const static uint16 kNotfadeend = 1105; + const static uint16 kDoqk = 3525; + const static uint16 kQuitcom = 2776; + const static uint16 kNotyover = 5715; + const static uint16 kDoqs = 3651; + const static uint16 kNotdreamcentre = 4949; + const static uint16 kLine4 = 5691; + const static uint16 kLine3 = 5691; + const static uint16 kLine1 = 5691; + const static uint16 kGotgates = 1105; + const static uint16 kZoomisoff = 5691; + const static uint16 kForgotone = 1113; + const static uint16 kNotch0endofpage0 = 4949; + const static uint16 kWidth49 = 1819; + const static uint16 kWidth48 = 1819; + const static uint16 kWidth47 = 1819; + const static uint16 kWidth46 = 1819; + const static uint16 kNoselslot = 3861; + const static uint16 kWidth44 = 1819; + const static uint16 kFoundlinestart = 1214; + const static uint16 kWidth42 = 1819; + const static uint16 kWidth41 = 1819; + const static uint16 kWidth40 = 1819; + const static uint16 kNotletgo4 = 2660; + const static uint16 kWidth110 = 1819; + const static uint16 kNotletgo3 = 2660; + const static uint16 kNotletgo2 = 2660; + const static uint16 kGotsoundbuff = 4949; + const static uint16 kSearchdestdown = 2776; + const static uint16 kNotneartextend = 2660; + const static uint16 kHelispeed = 1105; + const static uint16 kQuickquit = 3861; + const static uint16 kAfterlook = 2660; + const static uint16 kNotwaiting = 1105; + const static uint16 kCheckmorerain = 1113; + const static uint16 kDontbother = 4945; + const static uint16 kAlreadyloadold = 4926; + const static uint16 kAlreadyopob = 2660; + const static uint16 kTestcom = 2776; + const static uint16 kNotinryaninv = 2494; + const static uint16 kLookx = 5862; + const static uint16 kLooky = 5862; + const static uint16 kDozoomonoff = 3693; + const static uint16 kNotyover2 = 5715; + const static uint16 kAfterslow = 2494; + const static uint16 kGotoverend2 = 2494; + const static uint16 kNotletgo = 2660; + const static uint16 kAlreadyget = 2660; + const static uint16 kHoteldoorwith2 = 3385; + const static uint16 kNoteden2 = 4949; + const static uint16 kNowinch = 3393; + const static uint16 kKeyloop = 2776; + const static uint16 kNocross = 5698; + const static uint16 kNotpersonname = 5691; + const static uint16 kFindexloop = 3393; + const static uint16 kNotlouis2 = 1105; + const static uint16 kNothelicopter = 3393; + const static uint16 kNotlouis1 = 1105; + const static uint16 kFacingok = 1105; + const static uint16 kNotrandom = 1214; + const static uint16 kGotoverend = 2494; + const static uint16 kNotgunonheli = 1105; + const static uint16 kNoslow = 2494; + const static uint16 kFinishmon2 = 2494; + const static uint16 kFinishsparky = 1105; + const static uint16 kNotselob = 3393; + const static uint16 kSkipsprite = 1105; + const static uint16 kFinishconv = 2692; + const static uint16 kIsinright = 5691; + const static uint16 kWidth45 = 1819; + const static uint16 kHavecutwire = 3393; + const static uint16 kFinfree = 2660; + const static uint16 kWidth43 = 1819; + const static uint16 kHolewith = 3385; + const static uint16 kNodistort = 4949; + const static uint16 kBackwards = 3651; + const static uint16 kNotasetid = 5073; + const static uint16 kNotholdingreel = 4949; + const static uint16 kAlreadygotnew = 3385; + const static uint16 kFlashcurs = 2895; + const static uint16 kCantuseopen = 2660; + const static uint16 kHoteldoorwith = 3385; + const static uint16 kIsloadmode = 3861; + const static uint16 kNot129 = 2494; + const static uint16 kNobotright = 3651; + const static uint16 kMemerror = 4949; + const static uint16 kBlankframe = 2660; + const static uint16 kOpendoor = 1214; + const static uint16 kNotbang = 1105; + const static uint16 kFadecolloop = 2494; + const static uint16 kNotlouisvol = 5073; + const static uint16 kBotok = 4949; + const static uint16 kNextcart = 3385; + const static uint16 kFillcup = 3385; + const static uint16 kNotopenable = 2660; + const static uint16 kWireaxe = 3393; + const static uint16 kNotinsidethis = 2660; + const static uint16 kAtlast2 = 1214; + const static uint16 kAtlast3 = 1214; + const static uint16 kAtlast1 = 1214; + const static uint16 kHoldingreel = 5691; + const static uint16 kFindopen2 = 2494; + const static uint16 kFindopen1 = 2494; + const static uint16 kEndsetloop = 3393; + const static uint16 kGotcart = 2776; + const static uint16 kNot10 = 3525; + const static uint16 kLookforlinestart = 1214; + const static uint16 kCanpick2a = 2660; + const static uint16 kAlreadyonoff = 3693; + const static uint16 kNotsarters = 3393; + const static uint16 kDogetback = 2660; + const static uint16 kNotthrough2 = 1214; + const static uint16 kNotprintlist = 1819; + const static uint16 kNotwrapbackb = 3651; + const static uint16 kNoadvisor = 1105; + const static uint16 kWidth30 = 1819; + const static uint16 kNotleadingspace = 2776; + const static uint16 kMoney1poke = 3385; + const static uint16 kFinishwatch = 4949; + const static uint16 kQuittravel = 2714; + const static uint16 kDontgetrid = 5862; + const static uint16 kVolfinish = 4949; + const static uint16 kDograf = 3385; + const static uint16 kDograb = 2660; + const static uint16 kWidth58 = 1819; + const static uint16 kWidth59 = 1819; + const static uint16 kEnoughmem = 4949; + const static uint16 kWidth54 = 1819; + const static uint16 kMainloop = 4949; + const static uint16 kWidth56 = 1819; + const static uint16 kShowgroup1 = 2494; + const static uint16 kWidth50 = 1819; + const static uint16 kWidth51 = 1819; + const static uint16 kWidth52 = 1819; + const static uint16 kWidth53 = 1819; + const static uint16 kOver148 = 2660; + const static uint16 kWord4 = 4949; + const static uint16 kNottalk1 = 1105; + const static uint16 kWord1 = 4949; + const static uint16 kWord3 = 4949; + const static uint16 kWord2 = 4949; + const static uint16 kPriestwait = 1105; + const static uint16 kKeepchecking = 2660; + const static uint16 kOver146 = 2660; + const static uint16 kOver147 = 2660; + const static uint16 kAlreadyopinv = 2660; + const static uint16 kIsntblock = 5674; + const static uint16 kKeyok2 = 2895; + const static uint16 kKeyok1 = 2895; + const static uint16 kFinishtalk = 2660; + const static uint16 kNumberright = 3393; + const static uint16 kFindryanloop = 2494; + const static uint16 kAlreadyfull = 3385; + const static uint16 kNotchangeloc = 1711; + const static uint16 kNotweb = 5073; + const static uint16 kNotendseq = 1105; + const static uint16 kSecdes = 1105; + const static uint16 kComparefin = 3393; + const static uint16 kAlreadygrb = 2660; + const static uint16 kNoshoe1 = 1113; + const static uint16 kFinishdim4 = 2660; + const static uint16 kRestartlook = 2895; + const static uint16 kFinishdim1 = 2660; + const static uint16 kFinishdim3 = 2660; + const static uint16 kFinishdim2 = 2660; + const static uint16 kNotnomask = 1819; + const static uint16 kNorun = 5073; + const static uint16 kNotryanon = 1711; + const static uint16 kFinishmain = 4949; + const static uint16 kFinishfade = 2494; + const static uint16 kNopitflip = 4949; + const static uint16 kStereook2 = 3393; + const static uint16 kGreysumloop1 = 2494; + const static uint16 kGreysumloop2 = 2494; + const static uint16 kNotaftersec = 1105; + const static uint16 kNotinthelift = 4949; + const static uint16 kAdjustemmpage = 4945; + const static uint16 kNotendtext2 = 1105; + const static uint16 kNotendtext3 = 1105; + const static uint16 kNotendtext1 = 1105; + const static uint16 kNospeech1 = 2692; + const static uint16 kSlabfwrong = 3385; + const static uint16 kNotdumpdiary = 3693; + const static uint16 kNokeypress = 3861; + const static uint16 kFindten = 4945; + const static uint16 kBuscombatend = 1105; + const static uint16 kIstakengun = 3393; + const static uint16 kFindopenp1 = 2660; + const static uint16 kNotstartshake = 4949; + const static uint16 kNoloccheck = 2494; + const static uint16 kJustret = 3693; + const static uint16 kAlreadyturned = 1105; + const static uint16 kNothunder = 1214; + const static uint16 kNotmonktext5 = 1105; + const static uint16 kNotmonktext4 = 1105; + const static uint16 kNotmonktext7 = 1105; + const static uint16 kNotmonktext6 = 1105; + const static uint16 kNotmonktext1 = 1105; + const static uint16 kNotmonktext3 = 1105; + const static uint16 kNotmonktext2 = 1105; + const static uint16 kGotcandles = 1105; + const static uint16 kNotmonktext9 = 1105; + const static uint16 kNotmonktext8 = 1105; + const static uint16 kSatdown = 3385; + const static uint16 kSlabwith = 3385; + const static uint16 kIntromonk1fin = 1105; + const static uint16 kContrightpage = 3589; + const static uint16 kCantwalk2 = 5691; + const static uint16 kDeltimedtext = 3393; + const static uint16 kEndcredits22 = 2494; + const static uint16 kBackwardsbot = 3651; + const static uint16 kNot130 = 2494; + const static uint16 kFinished = 5073; + const static uint16 kAlreadyswap2 = 2660; + const static uint16 kEndall = 2494; + const static uint16 kMoreinput = 2776; + const static uint16 kFinishinitrain = 1113; + const static uint16 kNotsecondbank1 = 4949; + const static uint16 kDimloop4 = 2660; + const static uint16 kDontwalkin = 5862; + const static uint16 kReelsoundloop = 1214; + const static uint16 kDimloop1 = 2660; + const static uint16 kDimloop2 = 2660; + const static uint16 kDimloop3 = 2660; + const static uint16 kNotinpool = 3393; + const static uint16 kIskern = 2494; + const static uint16 kEyesshut = 5691; + const static uint16 kDoload = 3735; + const static uint16 kCantzoom = 1819; + const static uint16 kToplot = 4949; + const static uint16 kNotfirsttrigger = 2895; + const static uint16 kMenuloop = 3525; + const static uint16 kNotmapdownspec = 1711; + const static uint16 kUptime = 4949; + const static uint16 kFindopen2a = 2494; + const static uint16 kPathloop = 5073; + const static uint16 kCheckrain = 1113; + const static uint16 kNotyetboss = 3385; + const static uint16 kNoincryan = 2660; + const static uint16 kSpeechfilename = 4926; + const static uint16 kComlist = 2776; + const static uint16 kGotallboss = 1105; + const static uint16 kNottopchurch = 4949; + const static uint16 kBeenpickedup = 3393; + const static uint16 kNotintro3text1 = 1105; + const static uint16 kNopathon = 5073; + const static uint16 kOff = 2776; + const static uint16 kAlreadyuse = 2895; + const static uint16 kInvlist1 = 2556; + const static uint16 kObject = 3393; + const static uint16 kMorethan10 = 4949; + const static uint16 kMightbeonlych1 = 4949; + const static uint16 kMightbeonlych0 = 4949; + const static uint16 kPasserror = 2895; + const static uint16 kAlreadyloaded = 4949; + const static uint16 kNopriesttext = 1105; + const static uint16 kNotanup = 1113; + const static uint16 kEndmon = 2776; + const static uint16 kMoretopic = 2895; + const static uint16 kGatesfin = 1105; + const static uint16 kNokeyn = 3693; + const static uint16 kFinishcurdel = 2895; + const static uint16 kCheckpass = 2895; + const static uint16 kNotlift = 1214; + const static uint16 kWidth61 = 1819; + const static uint16 kWidth60 = 1819; + const static uint16 kNofind = 3393; + const static uint16 kWidth62 = 1819; + const static uint16 kNotsmallx2 = 5698; + const static uint16 kDos2 = 2494; + const static uint16 kDos3 = 2494; + const static uint16 kNocash = 3385; + const static uint16 kDos1 = 2494; + const static uint16 kNotendmonk2 = 1105; + const static uint16 kDiffmouse = 2660; + const static uint16 kNotinthebeach = 4949; + const static uint16 kPcxpal = 1711; + const static uint16 kCandlesfin = 1105; + const static uint16 kSuccess = 5691; + const static uint16 kGotvalidpath = 5073; + const static uint16 kTopokv = 4949; + const static uint16 kNotinpoolroom = 3393; + const static uint16 kGothand = 5698; + const static uint16 kCantuse2 = 2895; + const static uint16 kDiff = 5674; + const static uint16 kSearchinv = 3393; + const static uint16 kIsblock = 5674; + const static uint16 kJimmycontrols = 3393; + const static uint16 kItsfrominv = 5698; + const static uint16 kNotgeneralstart = 1105; + const static uint16 kMakeintoex = 2660; + const static uint16 kDoredes = 2714; + const static uint16 kLookforpurge = 2660; + const static uint16 kNochange2 = 1214; + const static uint16 kUpordown = 1214; + const static uint16 kDontbother5 = 4949; + const static uint16 kZoomloop = 1819; + const static uint16 kStillspace1 = 2895; + const static uint16 kHeliwon = 1105; + const static uint16 kGameinfo = 4375; + const static uint16 kNotalkrock = 1105; + const static uint16 kShownameloop = 3861; + const static uint16 kNotblankinp = 2776; + const static uint16 kJustshutting = 1214; + const static uint16 kNotwidedoor = 1214; + const static uint16 kNotdiffob = 5674; + const static uint16 kNotthrough = 1214; + const static uint16 kExamineagain = 2494; + const static uint16 kVertline = 5691; + const static uint16 kRestartops = 3693; + const static uint16 kNotsmallx = 5698; + const static uint16 kNotwatchpoint = 5698; + const static uint16 kNotflippedx = 1819; + const static uint16 kBotokv = 4949; + const static uint16 kSmallcandlef = 1105; + const static uint16 kGotcandles2 = 1105; + const static uint16 kFinblink1 = 5691; + const static uint16 kNotinthisroom = 1214; + const static uint16 kNospeech = 2660; + const static uint16 kSlabcwrong = 3385; + const static uint16 kPokelift = 1214; + const static uint16 kLoadops = 3735; + const static uint16 kNotextraname = 5691; + const static uint16 kCantredes = 2714; + const static uint16 kOnelot = 1105; + const static uint16 kDeloneloop = 1819; + const static uint16 kDodrop = 2660; + const static uint16 kDoplace2 = 2660; + const static uint16 kNopath = 3393; + const static uint16 kBotofdoor2 = 1214; + const static uint16 kNotnewlogo = 2895; + const static uint16 kIsntsame2 = 2660; + const static uint16 kNotfadedown = 1105; + const static uint16 kNot173 = 2494; + const static uint16 kTopwrap = 3651; + const static uint16 kCannextf = 3589; + const static uint16 kCartwith = 3385; + const static uint16 kGotintro3text = 1105; + const static uint16 kAlreadybotr = 3651; + const static uint16 kMainlist2 = 5011; + const static uint16 kNotrainyet = 1105; + const static uint16 kNotsecondtrigger = 2895; + const static uint16 kNotravmessage = 1113; + const static uint16 kNotunsized = 2660; + const static uint16 kGameragain = 1105; + + } #endif -- cgit v1.2.3 From b76035db6696a0afb4cb0521c6c16a28878c3ff1 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 02:02:14 +0400 Subject: DREAMWEB: put data offsets, not labels into public --- devtools/tasmrecover/tasm/cpp.py | 10 ++++++++-- devtools/tasmrecover/tasm/parser.py | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index fe7f3ff9d6..a8d225359b 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -523,8 +523,14 @@ namespace %s { self.hd.write("\tvoid %s(Context &context);\n" %f) offsets_decl = "\n" - for k,v in self.context.get_offsets().items(): - offsets_decl += "\tconst static uint16 k%s = %d;\n" %(k.capitalize(), v[0]) + offsets = [] + for k, v in self.context.get_globals().items(): + if isinstance(v, op.var): + offsets.append((k.capitalize(), v.offset)) + + offsets = sorted(offsets, key=lambda t: t[1]) + for o in offsets: + offsets_decl += "\tconst static uint16 k%s = %d;\n" %o offsets_decl += "\n" self.hd.write(offsets_decl); diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 6342a17d84..3eb553fdd1 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -48,6 +48,9 @@ class parser: name = name.lower() return self.__globals[name] + def get_globals(self): + return self.__globals + def has_global(self, name): name = name.lower() return self.__globals.has_key(name) @@ -65,9 +68,6 @@ class parser: name = name.lower() return self.__offsets[name] - def get_offsets(self): - return self.__offsets - def include(self, basedir, fname): path = fname.split('\\')[self.strip_path:] path = os.path.join(basedir, os.path.pathsep.join(path)) -- cgit v1.2.3 From d9e4fb5d0e2b0239478d9d7030ddd1150707cd68 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 02:02:49 +0400 Subject: DREAMWEB: regenerated code --- engines/dreamweb/dreamgen.h | 1994 ++++++++++--------------------------------- 1 file changed, 474 insertions(+), 1520 deletions(-) diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index c3451342eb..c82d9f83b1 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -67,1526 +67,480 @@ namespace dreamgen { void readoneblock(Context &context); void showpcx(Context &context); - const static uint16 kWaitabit = 1105; - const static uint16 kShuffletextads = 2660; - const static uint16 kCanopenpool = 3385; - const static uint16 kGottrainframe = 1105; - const static uint16 kInteruptworked = 4949; - const static uint16 kIsmorereel2 = 4949; - const static uint16 kCannotuseopen = 2660; - const static uint16 kNotret = 3861; - const static uint16 kNextmonkspeak = 2494; - const static uint16 kNothoteldoor1 = 1214; - const static uint16 kNothoteldoor2 = 1214; - const static uint16 kWearingshades = 3385; - const static uint16 kKillryan = 1105; - const static uint16 kSameline = 1711; - const static uint16 kNotuseinv = 2494; - const static uint16 kDoneit = 4949; - const static uint16 kNotunderchurch = 4949; - const static uint16 kNowatch = 4949; - const static uint16 kBlankex = 2660; - const static uint16 kOberase = 2660; - const static uint16 kNowornerror = 2660; - const static uint16 kNotdes2 = 1105; - const static uint16 kAlreadyactload = 3861; - const static uint16 kNotrightcont = 3385; - const static uint16 kNotch0only = 4949; - const static uint16 kNotwatchpath = 4949; - const static uint16 kEdensdhere = 3385; - const static uint16 kUnscrewplate = 3393; - const static uint16 kGotmonkryan = 1105; - const static uint16 kFindopen1a = 2494; - const static uint16 kSearchmess = 5691; - const static uint16 kNotworn = 2494; - const static uint16 kError6patch = 4261; - const static uint16 kNextcheck = 5691; - const static uint16 kPlayingalready = 5073; - const static uint16 kStereonotok = 3393; - const static uint16 kSearchagain = 2660; - const static uint16 kNotnewdirect = 1113; - const static uint16 kEarlyendrun = 2494; - const static uint16 kWidth18 = 1819; - const static uint16 kNotbeforehdead = 1105; - const static uint16 kNotheldtrainer = 3385; - const static uint16 kAfterprintname = 3861; - const static uint16 kIncdir = 1113; - const static uint16 kError1 = 3861; - const static uint16 kError2 = 3861; - const static uint16 kError3 = 3861; - const static uint16 kError4 = 3861; - const static uint16 kError5 = 3861; - const static uint16 kError6 = 3861; - const static uint16 kError7 = 3861; - const static uint16 kError8 = 3861; - const static uint16 kNotendcard = 1105; - const static uint16 kNotneg2 = 5691; - const static uint16 kCantpick = 2660; - const static uint16 kNodown = 2494; - const static uint16 kNotaxeonpool = 1105; - const static uint16 kIsbaseadd = 4949; - const static uint16 kShuffleadsdown = 2660; - const static uint16 kFindtopictext = 2895; - const static uint16 kFinishevery2 = 1711; - const static uint16 kCheckuselist = 2895; - const static uint16 kFinishevery1 = 1711; - const static uint16 kBigroom = 1711; - const static uint16 kAlreadyplce = 2660; - const static uint16 kMenuframeok = 3547; - const static uint16 kNotdelhotel = 2776; - const static uint16 kAlreadydu = 2776; - const static uint16 kGotintro1text = 1105; - const static uint16 kNotnewintro = 5674; - const static uint16 kRootdir = 2885; - const static uint16 kDorain = 1113; - const static uint16 kAlreadydd = 2776; - const static uint16 kNotblast = 4949; - const static uint16 kNorex = 2494; - const static uint16 kNosetloop = 4949; - const static uint16 kMonmessageloop = 2895; - const static uint16 kAlreadyplc2 = 2660; - const static uint16 kNotarrow = 5698; - const static uint16 kUpdateloop = 1214; - const static uint16 kIdentifyex = 5073; - const static uint16 kSeencard = 2660; - const static uint16 kAlreadygetops = 3777; - const static uint16 kNotenter = 3525; - const static uint16 kRainloop = 1214; - const static uint16 kNotplot = 1214; - const static uint16 kIdentifyreel = 5073; - const static uint16 kStillline = 1113; - const static uint16 kSetallloop = 3393; - const static uint16 kDiscopslist = 3777; - const static uint16 kBacktosolid = 1819; - const static uint16 kNotloc43 = 4949; - const static uint16 kTapwith = 3385; - const static uint16 kFinishrain = 1214; - const static uint16 kNotgunonpool = 1105; - const static uint16 kNotsmally2 = 5698; - const static uint16 kBotlotv = 4949; - const static uint16 kNotendkey = 3393; - const static uint16 kAlreadyblnk = 5698; - const static uint16 kPasspassed = 2895; - const static uint16 kMoreintroseq = 2494; - const static uint16 kNotplset = 1711; - const static uint16 kPathoktv = 3393; - const static uint16 kIsex = 2660; - const static uint16 kLineexit = 5691; - const static uint16 kNotupperc = 2776; - const static uint16 kGotsoldframe = 1105; - const static uint16 kDonextf = 3589; - const static uint16 kNomorethan6 = 5691; - const static uint16 kTendstohoriz = 5691; - const static uint16 kTwolotsleft = 3589; - const static uint16 kCanmore = 2692; - const static uint16 kArrow = 5698; - const static uint16 kHigher = 1113; - const static uint16 kAtmospherelist = 5073; - const static uint16 kHundredsc = 4945; - const static uint16 kNotbeforedead = 1105; - const static uint16 kNofindininv = 3393; - const static uint16 kFinmonscroll = 1711; - const static uint16 kFindinv2 = 2660; - const static uint16 kFindinv1 = 2660; - const static uint16 kNotsparkys = 4949; - const static uint16 kSpacepress = 3861; - const static uint16 kWaitstep = 1105; - const static uint16 kNofill = 1819; - const static uint16 kFolderlist = 3547; - const static uint16 kNoleftpage = 3589; - const static uint16 kFoundcharacter = 3861; - const static uint16 kHangonloop = 5862; - const static uint16 kTopleft = 5691; - const static uint16 kGetscash = 3385; - const static uint16 kNotlastraise = 1105; - const static uint16 kNumberpoke3 = 3393; - const static uint16 kNumberpoke2 = 3393; - const static uint16 kNumberpoke1 = 3393; - const static uint16 kNumberpoke0 = 3393; - const static uint16 kNotsparky1 = 1105; - const static uint16 kAlreadygrab = 2660; - const static uint16 kNotsamealready = 5691; - const static uint16 kInitrainside = 1113; - const static uint16 kShutdoor = 1214; - const static uint16 kOktalk2 = 1105; - const static uint16 kNotmonkryan = 1105; - const static uint16 kNotendcreds = 1105; - const static uint16 kNotworntoopen = 2660; - const static uint16 kNotsmokeb2 = 1105; - const static uint16 kNotsmokeb1 = 1105; - const static uint16 kAlreadyexinv = 2660; - const static uint16 kShowwatchreel = 4949; - const static uint16 kNoshow = 1105; - const static uint16 kRandomlouis = 1105; - const static uint16 kNotnexttalk = 2660; - const static uint16 kSteadyframe = 1105; - const static uint16 kDiarylist = 3651; - const static uint16 kNotlouisanim = 1105; - const static uint16 kNotonbalc = 3385; - const static uint16 kNotout2 = 2660; - const static uint16 kClosedfolder = 3589; - const static uint16 kNomadtext = 1105; - const static uint16 kCorrectcard = 3385; - const static uint16 kTalking = 1105; - const static uint16 kExframe = 2660; - const static uint16 kFoundfile2 = 2895; - const static uint16 kNotover32 = 5691; - const static uint16 kAlreadywalking = 5691; - const static uint16 kCansaveok = 3819; - const static uint16 kWatchison = 5691; - const static uint16 kKernit = 2494; - const static uint16 kNotinlouiss = 3393; - const static uint16 kOver1001 = 1105; - const static uint16 kOver1000 = 1105; - const static uint16 kFillcupfromtap = 3385; - const static uint16 kOpenlift = 1214; - const static uint16 kMakeswapex = 2660; - const static uint16 kAlreadyinfo = 2776; - const static uint16 kGotlighterwith = 3385; - const static uint16 kNowristwatch = 5691; - const static uint16 kNotfirstmad = 1105; - const static uint16 kCurfileloop = 2895; - const static uint16 kGameerror1 = 3861; - const static uint16 kGotcopframe = 1105; - const static uint16 kAlreadykeyp = 3693; - const static uint16 kDob = 3525; - const static uint16 kNotdiffdest = 1819; - const static uint16 kNotremset = 1711; - const static uint16 kDumpallloop = 1711; - const static uint16 kNextcheck2 = 5691; - const static uint16 kAlreadykeyn = 3693; - const static uint16 kEndwatchtalk = 2692; - const static uint16 kNottalked = 1105; - const static uint16 kNotsetd = 2660; - const static uint16 kSkipreelsound = 1214; - const static uint16 kNotspokento = 1105; - const static uint16 kEndofenvironment = 4949; - const static uint16 kEndofgame = 4949; - const static uint16 kNoselslot2 = 3861; - const static uint16 kScanloop = 4884; - const static uint16 kNotskip1 = 1711; - const static uint16 kKeybuffer = 5715; - const static uint16 kNotendcopper = 1105; - const static uint16 kFrameloopfx1 = 1819; - const static uint16 kFrameloopfx3 = 1819; - const static uint16 kFrameloopfx2 = 1819; - const static uint16 kNotpressed = 5698; - const static uint16 kNotmonk2text8 = 1105; - const static uint16 kNotmonk2text9 = 1105; - const static uint16 kNotmonk2text2 = 1105; - const static uint16 kNotmonk2text3 = 1105; - const static uint16 kNotmonk2text1 = 1105; - const static uint16 kNotmonk2text6 = 1105; - const static uint16 kNotmonk2text7 = 1105; - const static uint16 kNotmonk2text4 = 1105; - const static uint16 kNotmonk2text5 = 1105; - const static uint16 kNot164 = 2494; - const static uint16 kNot165 = 2494; - const static uint16 kNot160 = 2494; - const static uint16 kNot161 = 2494; - const static uint16 kNot162 = 2494; - const static uint16 kNot163 = 2494; - const static uint16 kNot168 = 2494; - const static uint16 kNocopper = 1105; - const static uint16 kCantdrip = 1105; - const static uint16 kFlashdots = 4949; - const static uint16 kTopfinished = 3651; - const static uint16 kOktalk = 1105; - const static uint16 kNonefound = 5073; - const static uint16 kNofindingtopic = 2895; - const static uint16 kGotgraphic = 2776; - const static uint16 kOnelot2 = 2494; - const static uint16 kFirstdes = 1105; - const static uint16 kWordloop = 2494; - const static uint16 kBotlot = 4949; - const static uint16 kDonterase = 2660; - const static uint16 kAtlast4 = 1214; - const static uint16 kEndofcolon = 2660; - const static uint16 kNotcentre = 2494; - const static uint16 kDontbother28 = 4949; - const static uint16 kNomadspeed = 1105; - const static uint16 kCanselectob = 3393; - const static uint16 kNotgunonrock = 1105; - const static uint16 kPath = 3393; - const static uint16 kNomorefading = 2494; - const static uint16 kAlreadydiscops = 3777; - const static uint16 kWidth80 = 1819; - const static uint16 kNotsartadd = 3693; - const static uint16 kRyanloop1 = 2494; - const static uint16 kRyanloop2 = 2494; - const static uint16 kLoop120 = 1819; - const static uint16 kLoop127 = 2660; - const static uint16 kLoop124 = 1819; - const static uint16 kLoop125 = 1819; - const static uint16 kLessthanapage = 2494; - const static uint16 kMoreloadspeech = 4926; - const static uint16 kCupfromtapfull = 3385; - const static uint16 kCombatover1 = 1105; - const static uint16 kCombatover2 = 1105; - const static uint16 kFlunkedit = 5073; - const static uint16 kCutgate = 3393; - const static uint16 kNotlastf = 3589; - const static uint16 kDoswap1 = 2660; - const static uint16 kDoswap2 = 2660; - const static uint16 kNotdes1 = 1105; - const static uint16 kBuscombatwonend = 1105; - const static uint16 kAddloop = 2660; - const static uint16 kWidth10 = 1819; - const static uint16 kWidth11 = 1819; - const static uint16 kWidth12 = 1819; - const static uint16 kWidth13 = 1819; - const static uint16 kWidth14 = 1819; - const static uint16 kWidth15 = 1819; - const static uint16 kWidth16 = 1819; - const static uint16 kWidth17 = 1819; - const static uint16 kWaitstopwalk = 4949; - const static uint16 kWidth19 = 1819; - const static uint16 kNonoise = 3525; - const static uint16 kSlabdwrong = 3385; - const static uint16 kUselist = 2895; - const static uint16 kMovealtar = 3385; - const static uint16 kQuickquit2 = 3861; - const static uint16 kFoundlen = 4884; - const static uint16 kOperand1 = 2883; - const static uint16 kMake = 5691; - const static uint16 kFinishidentify = 5073; - const static uint16 kNotlouiscard = 2660; - const static uint16 kIswalking = 5674; - const static uint16 kIsntcolon = 2660; - const static uint16 kZoomit = 1819; - const static uint16 kFoundnews = 2776; - const static uint16 kSlabbwrong = 3385; - const static uint16 kSlotloop = 3861; - const static uint16 kNotsarters2 = 4949; - const static uint16 kNotneg1 = 5691; - const static uint16 kDoopeninv = 2660; - const static uint16 kFoodinside = 3393; - const static uint16 kClearedlocations = 2776; - const static uint16 kNomore = 2692; - const static uint16 kAlreadyusedit = 3385; - const static uint16 kRetryreel = 1214; - const static uint16 kTalklist = 2660; - const static uint16 kNotexist = 4884; - const static uint16 kRockcombatend = 1105; - const static uint16 kWidth57 = 1819; - const static uint16 kPrtspriteloop = 1105; - const static uint16 kOpenboxwith = 3385; - const static uint16 kNotloop = 4949; - const static uint16 kNotinalley = 3393; - const static uint16 kPrintloopslow6 = 2494; - const static uint16 kPrintloopslow5 = 2494; - const static uint16 kNextone = 4884; - const static uint16 kExloop = 2660; - const static uint16 kCantdrip2 = 1105; - const static uint16 kSecondlot = 2776; - const static uint16 kAlreadysel = 3861; - const static uint16 kNotfreename = 5691; - const static uint16 kNotover2 = 5073; - const static uint16 kCanplace1 = 2660; - const static uint16 kCanplace3 = 2660; - const static uint16 kFinishmon = 2494; - const static uint16 kDeleteconts = 2660; - const static uint16 kLooknext2 = 2494; - const static uint16 kNotwalk = 1105; - const static uint16 kNotzeronum = 4949; - const static uint16 kError8patch = 4370; - const static uint16 kNodos = 3861; - const static uint16 kIsedens = 4949; - const static uint16 kNotlouisvol2 = 5073; - const static uint16 kHeavywait = 1105; - const static uint16 kPickupcontloop = 2660; - const static uint16 kHavegotcard = 1113; - const static uint16 kNotlastslab = 3385; - const static uint16 kComloop2 = 2776; - const static uint16 kSpeechfile = 4932; - const static uint16 kFindlenextext = 2660; - const static uint16 kSecurwait = 1105; - const static uint16 kComloop = 2776; - const static uint16 kNotboss = 1105; - const static uint16 kLine23 = 5691; - const static uint16 kDiscopsloop = 3777; - const static uint16 kKeypadlist = 3393; - const static uint16 kWearingwatch = 3385; - const static uint16 kSoundfail = 4949; - const static uint16 kHislope = 5691; - const static uint16 kGeneralerror = 3861; - const static uint16 kGotmonktext = 1105; - const static uint16 kNovolumeload = 5862; - const static uint16 kGotkeyn = 3693; - const static uint16 kDiffsub3 = 3393; - const static uint16 kGotlength = 2660; - const static uint16 kAnimsparky = 1105; - const static uint16 kNought = 1711; - const static uint16 kNotendtitles = 1105; - const static uint16 kIswatchingmode = 4949; - const static uint16 kNotquickp = 1105; - const static uint16 kNotwaitingheli = 1105; - const static uint16 kNotright = 3385; - const static uint16 kNolook = 2660; - const static uint16 kAxeoncontrols = 3393; - const static uint16 kFoundpersonal = 2776; - const static uint16 kNotaristoadd = 3589; - const static uint16 kFinishpars = 2895; - const static uint16 kNotnearly = 1214; - const static uint16 kSlabawrong = 3385; - const static uint16 kAfterpress = 3393; - const static uint16 kFinishedwalk = 1113; - const static uint16 kGotnext2 = 2494; - const static uint16 kNozoomonoff = 3693; - const static uint16 kDdok = 2776; - const static uint16 kLiftclosed = 1214; - const static uint16 kNotmonktext11 = 1105; - const static uint16 kNotafreeid = 5073; - const static uint16 kEndreelsound = 1214; - const static uint16 kNotendguard1 = 1105; - const static uint16 kWidth29 = 1819; - const static uint16 kWidth28 = 1819; - const static uint16 kWidth25 = 1819; - const static uint16 kWidth24 = 1819; - const static uint16 kWidth27 = 1819; - const static uint16 kWidth26 = 1819; - const static uint16 kAlreadydos = 3861; - const static uint16 kWidth20 = 1819; - const static uint16 kWidth23 = 1819; - const static uint16 kWidth22 = 1819; - const static uint16 kNodd = 2776; - const static uint16 kPipewith = 3385; - const static uint16 kShutdoor2 = 1214; - const static uint16 kGotdrinker = 1105; - const static uint16 kDogrb = 2660; - const static uint16 kNodu = 2776; - const static uint16 kHangonloope = 2494; - const static uint16 kShaketable = 1711; - const static uint16 kAfterinfo = 2776; - const static uint16 kCanredes = 2714; - const static uint16 kNotbeforedeadb = 1105; - const static uint16 kFinishshake = 1711; - const static uint16 kNomake = 2660; - const static uint16 kNotclear = 4949; - const static uint16 kNotwithboss = 3393; - const static uint16 kAlreadylastf = 3589; - const static uint16 kConvertpcx = 1711; - const static uint16 kFadedosloop = 2494; - const static uint16 kMiddleofwalk = 5674; - const static uint16 kFinflashmouse = 5698; - const static uint16 kScrollmonloop1 = 1711; - const static uint16 kMenulist = 3525; - const static uint16 kScrollmonloop2 = 1711; - const static uint16 kAlreadytrav = 2776; - const static uint16 kNotfirstdest = 2776; - const static uint16 kWidth55 = 1819; - const static uint16 kNotendtelly = 1105; - const static uint16 kNotch1endofpage1 = 4949; - const static uint16 kNotedens2 = 3393; - const static uint16 kBlimey = 5862; - const static uint16 kNotxover = 5715; - const static uint16 kGotconst = 1214; - const static uint16 kContinuewalk = 1113; - const static uint16 kLeftpageloop = 3589; - const static uint16 kCantsetup = 3393; - const static uint16 kNottrigger = 2494; - const static uint16 kIsanextra = 2494; - const static uint16 kNotonsartroof = 3393; - const static uint16 kCombathand = 5698; - const static uint16 kGotreader1with = 3385; - const static uint16 kCanpick2 = 2660; - const static uint16 kNodistortv = 4949; - const static uint16 kCanpick4 = 2660; - const static uint16 kSlowgates = 1105; - const static uint16 kNotsetd2 = 2660; - const static uint16 kNotnearframeend = 2660; - const static uint16 kInsideloop = 3393; - const static uint16 kCommandline = 5674; - const static uint16 kEndofdir = 2895; - const static uint16 kLouisvol = 5073; - const static uint16 kNotdrinker1 = 1105; - const static uint16 kGobackover = 3393; - const static uint16 kIswatchinv = 2660; - const static uint16 kHissnoise = 1214; - const static uint16 kNodumptimed = 3393; - const static uint16 kLoloop = 5691; - const static uint16 kNotplfree = 1711; - const static uint16 kLooky2 = 5862; - const static uint16 kSetframe = 2660; - const static uint16 kLine31 = 5691; - const static uint16 kHalfend = 2494; - const static uint16 kLine32 = 5691; - const static uint16 kIsntspecial = 2660; - const static uint16 kAlreadynextf = 3589; - const static uint16 kBeforethisone = 2660; - const static uint16 kRtofdoor = 1214; - const static uint16 kGotkeyp = 3693; - const static uint16 kNotinsartroom = 3393; - const static uint16 kChosenaccess = 2776; - const static uint16 kNofoundchange = 3393; - const static uint16 kIstravel = 2714; - const static uint16 kOddwidth2 = 1819; - const static uint16 kOddwidth3 = 1819; - const static uint16 kIswatchmad = 1105; - const static uint16 kNomorereel = 4949; - const static uint16 kDosparky = 1105; - const static uint16 kCandle1 = 1105; - const static uint16 kNextbit = 2494; - const static uint16 kSizeok1 = 2660; - const static uint16 kSizeok2 = 2660; - const static uint16 kNoadd = 5674; - const static uint16 kLookattail = 4949; - const static uint16 kBacktootherfx = 1819; - const static uint16 kIsautoloc = 2714; - const static uint16 kFoundcom = 2776; - const static uint16 kFreeobject = 3393; - const static uint16 kWidth38 = 1819; - const static uint16 kWidth39 = 1819; - const static uint16 kWidth32 = 1819; - const static uint16 kWidth33 = 1819; - const static uint16 kNotendblock = 1711; - const static uint16 kWidth31 = 1819; - const static uint16 kWidth36 = 1819; - const static uint16 kWidth37 = 1819; - const static uint16 kWidth34 = 1819; - const static uint16 kWidth35 = 1819; - const static uint16 kNotwrapforb = 3651; - const static uint16 kAlreadyload = 3735; - const static uint16 kCantpurge = 2660; - const static uint16 kHelicombatend = 1105; - const static uint16 kEmptyinterface = 2776; - const static uint16 kSymbolwrong = 3589; - const static uint16 kNotlouis = 1113; - const static uint16 kWaitops = 3693; - const static uint16 kNotedensagain = 4949; - const static uint16 kNotyetrecep = 3385; - const static uint16 kInitrainside2 = 1113; - const static uint16 kGotheliframe = 1105; - const static uint16 kNevershown = 5698; - const static uint16 kDodiscops = 3777; - const static uint16 kNotlasttalk1 = 1105; - const static uint16 kAlreadyreds = 2714; - const static uint16 kNotext = 3393; - const static uint16 kNodiscops = 3777; - const static uint16 kGotrockframe = 1105; - const static uint16 kNotloc15 = 4949; - const static uint16 kWaittalk = 2660; - const static uint16 kChannel0once = 1214; - const static uint16 kEndline = 1711; - const static uint16 kNomoreatmos = 5073; - const static uint16 kDestoryopenbox = 3385; - const static uint16 kNotsmally = 5698; - const static uint16 kBotofdoor = 1214; - const static uint16 kNotqk = 3525; - const static uint16 kNotqs = 3651; - const static uint16 kCantopinv = 2660; - const static uint16 kWidth8 = 1819; - const static uint16 kWidth9 = 1819; - const static uint16 kWidth2 = 1819; - const static uint16 kWidth3 = 1819; - const static uint16 kWidth0 = 1819; - const static uint16 kWidth1 = 1819; - const static uint16 kWidth6 = 1819; - const static uint16 kWidth7 = 1819; - const static uint16 kWidth4 = 1819; - const static uint16 kWidth5 = 1819; - const static uint16 kAlreadybotl = 3651; - const static uint16 kNotsetcard = 1105; - const static uint16 kVolok = 4949; - const static uint16 kAlreadysave = 3819; - const static uint16 kGotwirewith = 3393; - const static uint16 kBhloop2 = 1819; - const static uint16 kBhloop1 = 1819; - const static uint16 kHangonearly = 2494; - const static uint16 kTakenloop = 2660; - const static uint16 kGotmonks2text = 1105; - const static uint16 kNotanimend1 = 1105; - const static uint16 kNoopenob = 2660; - const static uint16 kLookx2 = 5862; - const static uint16 kFindsometext = 2660; - const static uint16 kNotnextf = 3589; - const static uint16 kGameerror8 = 4326; - const static uint16 kNotdelboathouse = 2776; - const static uint16 kGameerror6 = 4197; - const static uint16 kGameerror7 = 4267; - const static uint16 kGameerror4 = 4062; - const static uint16 kGameerror5 = 4123; - const static uint16 kGameerror2 = 3929; - const static uint16 kGameerror3 = 4010; - const static uint16 kNomatch = 2895; - const static uint16 kVolloop = 4949; - const static uint16 kPlatewith = 3393; - const static uint16 kHiloop = 5691; - const static uint16 kNodrop2 = 2660; - const static uint16 kSkipoffsets = 1819; - const static uint16 kRockspeed = 1105; - const static uint16 kWantstowalk = 5674; - const static uint16 kNotfirstpool = 1105; - const static uint16 kNotlocky = 1214; - const static uint16 kGotalong = 2660; - const static uint16 kNoinfo = 2776; - const static uint16 kToofaraway = 5674; - const static uint16 kMoney2poke = 3390; - const static uint16 kThousandsc = 4945; - const static uint16 kNotb = 3525; - const static uint16 kKeeplooking = 2895; - const static uint16 kDontrestore = 5862; - const static uint16 kNotlastspeed2 = 4949; - const static uint16 kOver242 = 2660; - const static uint16 kInitraintop = 1113; - const static uint16 kError2patch = 3997; - const static uint16 kNoplot = 1214; - const static uint16 kNormal = 1711; - const static uint16 kFinishslow = 2494; - const static uint16 kMustgo = 4949; - const static uint16 kLesscolour = 2494; - const static uint16 kOpenboxwrong = 3385; - const static uint16 kNotch1only = 4949; - const static uint16 kClearboxwith = 3385; - const static uint16 kEndoflist = 1214; - const static uint16 kNotblock = 5674; - const static uint16 kNotbothendofpage0 = 4949; - const static uint16 kNotbothendofpage1 = 4949; - const static uint16 kGotrecep = 1105; - const static uint16 kNoreset = 5862; - const static uint16 kKeypadloop = 3393; - const static uint16 kPoolwith = 3385; - const static uint16 kOddwidthframe = 1819; - const static uint16 kGuardspeed = 1105; - const static uint16 kNocountclose = 1214; - const static uint16 kRightcard = 3385; - const static uint16 kWireknife = 3393; - const static uint16 kNouse = 2895; - const static uint16 kNotdream3 = 2660; - const static uint16 kDolastf = 3589; - const static uint16 kDirectloop1 = 2895; - const static uint16 kSlow = 4949; - const static uint16 kAlreadynewgame = 4926; - const static uint16 kLoop048 = 5073; - const static uint16 kIntrom2fin = 1105; - const static uint16 kDiaryloop = 3651; - const static uint16 kRyansoff = 5073; - const static uint16 kDoneover2 = 1105; - const static uint16 kNotinroom = 2660; - const static uint16 kIsaperson = 5674; - const static uint16 kNotadown = 1113; - const static uint16 kFoundchange = 3393; - const static uint16 kNumloop1 = 4949; - const static uint16 kNoaddg = 2494; - const static uint16 kEndoftext = 2494; - const static uint16 kNoaddb = 2494; - const static uint16 kKeepgoing = 2494; - const static uint16 kNotintro1text2 = 1105; - const static uint16 kGotintromonk2 = 1105; - const static uint16 kNoaddr = 2494; - const static uint16 kGotintromonk1 = 1105; - const static uint16 kAccesscom = 2776; - const static uint16 kNotshieldonbus = 1105; - const static uint16 kDontplace = 1711; - const static uint16 kAlreadydrop = 2660; - const static uint16 kLoadmode = 3861; - const static uint16 kGotendseq = 1105; - const static uint16 kNotverycool = 5691; - const static uint16 kNorightpage = 3589; - const static uint16 kChangeloop = 3393; - const static uint16 kGotintro2text = 1105; - const static uint16 kItsanobject = 5698; - const static uint16 kGotquad = 5691; - const static uint16 kNotsmoket1 = 1105; - const static uint16 kNotsmoket2 = 1105; - const static uint16 kAlreadymore = 2692; - const static uint16 kFoundlineend = 1214; - const static uint16 kHasloadedroom = 4884; - const static uint16 kShowobsloop = 2660; - const static uint16 kNogetback = 2660; - const static uint16 kLooknext = 1105; - const static uint16 kGotthere = 2494; - const static uint16 kIsrightkey = 3385; - const static uint16 kGameover = 4949; - const static uint16 kRainlocations = 1113; - const static uint16 kFolderloop = 3547; - const static uint16 kNotactload = 3861; - const static uint16 kBotfinished = 3651; - const static uint16 kNotthisob = 2660; - const static uint16 kSteadyob = 1214; - const static uint16 kNoneedforemm = 4949; - const static uint16 kDirroot = 2895; - const static uint16 kSearchdestup = 2776; - const static uint16 kUsedpriority = 2660; - const static uint16 kFinishedsetobs = 2660; - const static uint16 kNotlouisthund = 1214; - const static uint16 kNotmapupspec = 1711; - const static uint16 kGotkey = 3525; - const static uint16 kNotraisearm = 1105; - const static uint16 kFoundmatch = 2660; - const static uint16 kRightkey = 3393; - const static uint16 kEndoftopic = 2895; - const static uint16 kBotwrap = 3651; - const static uint16 kSame = 5862; - const static uint16 kNotwrapback = 3651; - const static uint16 kCantswap1 = 2660; - const static uint16 kCantswap2 = 2660; - const static uint16 kTryagain = 2660; - const static uint16 kNotnewpath = 5674; - const static uint16 kTvdoorwith = 3385; - const static uint16 kFinishearly = 4949; - const static uint16 kCantpurge2 = 2660; - const static uint16 kGetloop = 2494; - const static uint16 kLine12 = 5691; - const static uint16 kRestartlouis = 1105; - const static uint16 kAlreadyactsave = 3861; - const static uint16 kNotaleft = 1113; - const static uint16 kNobark = 1105; - const static uint16 kTopok = 4949; - const static uint16 kQuitconv = 2692; - const static uint16 kFacelist = 1105; - const static uint16 kNomadspeak = 1105; - const static uint16 kSymbolloop = 3589; - const static uint16 kEmmerror1 = 4949; - const static uint16 kEmmerror2 = 4945; - const static uint16 kNoload = 3735; - const static uint16 kNowatchworn = 4949; - const static uint16 kWithlist1 = 2618; - const static uint16 kNotaide = 3393; - const static uint16 kNotinhere = 2660; - const static uint16 kNotnew = 5073; - const static uint16 kDestlist = 2714; - const static uint16 kNocountopen = 1214; - const static uint16 kNextatmos = 5073; - const static uint16 kNokern = 2494; - const static uint16 kAnimating = 2660; - const static uint16 kNomorekeys = 3525; - const static uint16 kWaitinit = 4945; - const static uint16 kGotdoorwith = 3393; - const static uint16 kBeforethistext = 2660; - const static uint16 kNotyetassigned = 2895; - const static uint16 kDifffound = 5698; - const static uint16 kNotfoundinside = 3393; - const static uint16 kFpathloop = 5073; - const static uint16 kNottrigger2 = 2494; - const static uint16 kNotdoor = 1214; - const static uint16 kFinishback = 1214; - const static uint16 kLookforpurge2 = 2660; - const static uint16 kNotnegative2 = 1105; - const static uint16 kNotgotgun = 1105; - const static uint16 kNotnegative1 = 1105; - const static uint16 kGotreader2with = 3385; - const static uint16 kSavelist = 3819; - const static uint16 kMousehand = 5698; - const static uint16 kFindnewpage = 2660; - const static uint16 kNotspeed = 1105; - const static uint16 kFinishmakename = 5691; - const static uint16 kNotlock = 2895; - const static uint16 kNormalreel = 1214; - const static uint16 kFoundsign = 2895; - const static uint16 kGotnext = 1105; - const static uint16 kNofog = 1105; - const static uint16 kNopresses = 3393; - const static uint16 kComplete = 2895; - const static uint16 kSizewrong = 2660; - const static uint16 kAlreadytopl = 3651; - const static uint16 kNoneedtorecon = 1711; - const static uint16 kGatewith = 3393; - const static uint16 kPrintloop7 = 2494; - const static uint16 kPrintloop6 = 2494; - const static uint16 kPrintloop5 = 2494; - const static uint16 kNullframe = 2660; - const static uint16 kNotcrystal = 4949; - const static uint16 kAlreadytopr = 3651; - const static uint16 kPrintloop8 = 2494; - const static uint16 kNotinthisone = 2776; - const static uint16 kNotblankshow = 1819; - const static uint16 kNoshoe2 = 1113; - const static uint16 kDspready = 4945; - const static uint16 kToplotv = 4949; - const static uint16 kIdentifyfree = 5073; - const static uint16 kSignonloop = 2895; - const static uint16 kEndcredits21 = 2494; - const static uint16 kDescribe = 2660; - const static uint16 kNotinnewroom = 1105; - const static uint16 kPathokboss = 3393; - const static uint16 kOpendoor2 = 1214; - const static uint16 kJustcancel = 4945; - const static uint16 kOpenchangesize = 2588; - const static uint16 kIncorrect = 3393; - const static uint16 kZeroblock = 1819; - const static uint16 kFindsetloop = 3393; - const static uint16 kNotxover2 = 5715; - const static uint16 kNotsecondbank = 4949; - const static uint16 kNextline = 1819; - const static uint16 kNotheldob = 2660; - const static uint16 kGotfirst = 5073; - const static uint16 kPowerok = 2895; - const static uint16 kCheckdestloop = 5691; - const static uint16 kMadmanspoken = 1105; - const static uint16 kTensc = 4945; - const static uint16 kDosave = 3819; - const static uint16 kDirectory = 2776; - const static uint16 kKeyontv = 3385; - const static uint16 kDoselob = 3393; - const static uint16 kDuok = 2776; - const static uint16 kChangelight = 3525; - const static uint16 kIsinleft = 5691; - const static uint16 kIsdream1 = 5691; - const static uint16 kDodecisions = 4949; - const static uint16 kNotlockdoor = 1214; - const static uint16 kNotinlift = 2660; - const static uint16 kNotplayingreel = 4949; - const static uint16 kNodumpwatch = 4949; - const static uint16 kTrampgone = 1105; - const static uint16 kObnotexist = 2660; - const static uint16 kNodumptextline = 5698; - const static uint16 kTwolotsright = 3589; - const static uint16 kCantopenit = 2660; - const static uint16 kCantwalk = 5691; - const static uint16 kCdinside = 3393; - const static uint16 kMakedoorsopen = 4949; - const static uint16 kPowerloop = 2776; - const static uint16 kNotanexid = 5073; - const static uint16 kNotcent2 = 2494; - const static uint16 kOpenbox = 3385; - const static uint16 kNotwatching = 4949; - const static uint16 kNosetpick = 2660; - const static uint16 kPlaceit = 1711; - const static uint16 kNotwatchinv = 2660; - const static uint16 kDiff2 = 5674; - const static uint16 kEndupdate = 1214; - const static uint16 kNotendcandle1 = 1105; - const static uint16 kFlipfolder = 3589; - const static uint16 kNokeyatall = 3693; - const static uint16 kGotlight = 3525; - const static uint16 kAlreadyqs = 3651; - const static uint16 kDifsub8 = 2660; - const static uint16 kWidth88 = 1819; - const static uint16 kAlreadyqk = 3525; - const static uint16 kCanpick = 2660; - const static uint16 kDifsub1 = 2660; - const static uint16 kDifsub2 = 2660; - const static uint16 kDifsub3 = 2660; - const static uint16 kDifsub4 = 2660; - const static uint16 kNotinedenslift = 1113; - const static uint16 kDifsub7 = 2660; - const static uint16 kSearch = 2660; - const static uint16 kDomoretalk = 2692; - const static uint16 kNotbystudio = 3393; - const static uint16 kDonethisbit = 3393; - const static uint16 kNotrainatall = 1105; - const static uint16 kNotremfree = 1711; - const static uint16 kNomatchslot2 = 3861; - const static uint16 kSelect = 2714; - const static uint16 kGotheavyframe = 1105; - const static uint16 kDrawnsetob = 2660; - const static uint16 kNotloc23 = 4949; - const static uint16 kNotopright = 3651; - const static uint16 kCheckpurgeagain = 2660; - const static uint16 kNotleave = 1113; - const static uint16 kGotendtext = 1105; - const static uint16 kNotdel = 2776; - const static uint16 kNotmonktext10 = 1105; - const static uint16 kNotmonktext13 = 1105; - const static uint16 kNotmonktext12 = 1105; - const static uint16 kDogetbackops = 3777; - const static uint16 kNoautolook = 2660; - const static uint16 kDecdir = 1113; - const static uint16 kNotaright = 1113; - const static uint16 kZoomswitch = 1819; - const static uint16 kFoundnewex = 2660; - const static uint16 kNodream7 = 2895; - const static uint16 kIswatching = 2494; - const static uint16 kNotfudge = 1711; - const static uint16 kZerostill = 3861; - const static uint16 kNotenterdream = 4949; - const static uint16 kNotlastdest = 2776; - const static uint16 kDoexinv = 2660; - const static uint16 kOpsblock1 = 3735; - const static uint16 kGotsecurframe = 1105; - const static uint16 kEndearly2 = 2494; - const static uint16 kPlaygame = 4949; - const static uint16 kNotdiff = 1105; - const static uint16 kNotaftersshot = 1105; - const static uint16 kSet16palloop2 = 2494; - const static uint16 kPriestspoken = 1105; - const static uint16 kOpenloop1 = 2494; - const static uint16 kMoreload2 = 4945; - const static uint16 kGotstartletter = 2660; - const static uint16 kEndmugger1 = 1105; - const static uint16 kEndmugger2 = 1105; - const static uint16 kGotintrom1 = 1105; - const static uint16 kGotintrom3 = 1105; - const static uint16 kGotintrom2 = 1105; - const static uint16 kWaitkey = 2776; - const static uint16 kNozoom1 = 5691; - const static uint16 kWantstotalk = 5674; - const static uint16 kNotfirst = 1113; - const static uint16 kSlabewrong = 3385; - const static uint16 kCantmakeoneup = 2660; - const static uint16 kNotdoorsound1 = 1214; - const static uint16 kNotdoorsound3 = 1214; - const static uint16 kNotdoorsound2 = 1214; - const static uint16 kNotdoorsound4 = 1214; - const static uint16 kDirectloop2 = 2895; - const static uint16 kNomatchslot = 3861; - const static uint16 kNotzoomon = 5698; - const static uint16 kDontcheck = 5674; - const static uint16 kLookforlineend = 1214; - const static uint16 kFrameloop1 = 1819; - const static uint16 kFrameloop3 = 1819; - const static uint16 kFrameloop2 = 1819; - const static uint16 kRightspeed3 = 5698; - const static uint16 kFinex = 2660; - const static uint16 kIscup = 2660; - const static uint16 kNoconvnum = 4949; - const static uint16 kEmmerror = 4945; - const static uint16 kLiftopen = 1214; - const static uint16 kClearloop = 1711; - const static uint16 kDumpevery2 = 1711; - const static uint16 kDumpevery1 = 1711; - const static uint16 kAlreadyb = 3525; - const static uint16 kFirsttimed = 3393; - const static uint16 kNotboth = 5698; - const static uint16 kKeyconverttab = 5731; - const static uint16 kNoturnonyet = 1214; - const static uint16 kNotmonk2text10 = 1105; - const static uint16 kNotmonk2text11 = 1105; - const static uint16 kNotinbath = 1105; - const static uint16 kActuallyswap = 2660; - const static uint16 kKeyscom = 2776; - const static uint16 kNormalline = 5691; - const static uint16 kEndcredits2 = 1105; - const static uint16 kEndcredits1 = 1105; - const static uint16 kNofindex = 3393; - const static uint16 kLoslope = 5691; - const static uint16 kNottalkedboss = 1105; - const static uint16 kWrongroom1 = 3393; - const static uint16 kWaitexam = 2494; - const static uint16 kNotsetname = 5691; - const static uint16 kFileerror = 5862; - const static uint16 kLoop2 = 1711; - const static uint16 kLoop1 = 1711; - const static uint16 kRtofdoor2 = 1214; - const static uint16 kNotmaprightspec = 1711; - const static uint16 kIsnosound = 4949; - const static uint16 kInwatching = 1819; - const static uint16 kNotthirdtrigger = 2895; - const static uint16 kHavesetwatch = 1105; - const static uint16 kIsthunder1 = 1214; - const static uint16 kMainlist = 4949; - const static uint16 kNotopenchurch = 3393; - const static uint16 kPriorityloop = 1105; - const static uint16 kEdenspart2 = 3393; - const static uint16 kRyansded = 1105; - const static uint16 kNotwrapfor = 3651; - const static uint16 kNotintro3text2 = 1105; - const static uint16 kNotafterhshot = 1105; - const static uint16 kNottalkedsparky = 1105; - const static uint16 kZoomloop2 = 1819; - const static uint16 kNotmugger = 1105; - const static uint16 kNotcarpark = 4949; - const static uint16 kLoadlist = 3735; - const static uint16 kWaitdecide = 4884; - const static uint16 kSkiptalk = 2692; - const static uint16 kNextopenslot = 2494; - const static uint16 kNotfound = 2895; - const static uint16 kDosetpick = 2660; - const static uint16 kTryanotherex = 2660; - const static uint16 kNotaideadd = 3589; - const static uint16 kNotshown = 3693; - const static uint16 kNotshowp = 3693; - const static uint16 kNotendadvis = 1105; - const static uint16 kAlreadylook = 2660; - const static uint16 kNotblankpers = 5073; - const static uint16 kCorrectcard2 = 3385; - const static uint16 kGetslotnum = 3861; - const static uint16 kNogetbackops = 3777; - const static uint16 kNotinsideex = 2660; - const static uint16 kHangloopw = 5698; - const static uint16 kHangloopq = 2692; - const static uint16 kCigarette = 3385; - const static uint16 kDonefirstops = 3693; - const static uint16 kBotright = 5691; - const static uint16 kNotwalkandexam = 5691; - const static uint16 kFinishfile = 2895; - const static uint16 kAlreadyselob = 3393; - const static uint16 kFinishfill = 2494; - const static uint16 kPickupexob = 2660; - const static uint16 kTriedknife = 3393; - const static uint16 kIsinexlist = 2660; - const static uint16 kAfterkey = 3861; - const static uint16 kDoopenob = 2660; - const static uint16 kFinishdirct = 2494; - const static uint16 kLoadedalready = 5862; - const static uint16 kWatchtalk = 2692; - const static uint16 kKeysloop = 2895; - const static uint16 kFailed = 2895; - const static uint16 kEndearly = 2494; - const static uint16 kNotfirsttimed = 3393; - const static uint16 kIswaitingpool = 1105; - const static uint16 kBlinktab = 5691; - const static uint16 kNotcentred = 1819; - const static uint16 kCandles2fin = 1105; - const static uint16 kMoretext = 2660; - const static uint16 kNormalwalk = 1113; - const static uint16 kNokey = 5715; - const static uint16 kGotpl = 5691; - const static uint16 kAlreadyswap1 = 2660; - const static uint16 kSignoncom = 2776; - const static uint16 kOpenpool = 3385; - const static uint16 kOpslist = 3693; - const static uint16 kNoneedtoremove = 4949; - const static uint16 kNoloadold = 4926; - const static uint16 kNotintro2text1 = 1105; - const static uint16 kNotintro2text2 = 1105; - const static uint16 kNobotleft = 3651; - const static uint16 kIgnoreit = 2494; - const static uint16 kNotalley = 4949; - const static uint16 kSpecialcase = 2660; - const static uint16 kNodumpsym = 3651; - const static uint16 kCanopenit1 = 2660; - const static uint16 kNotsecondpart = 2692; - const static uint16 kNotmapup2 = 1711; - const static uint16 kIsfree = 2660; - const static uint16 kOver045 = 5073; - const static uint16 kGoingdown = 3393; - const static uint16 kNotedenlob = 4949; - const static uint16 kNoclear = 4949; - const static uint16 kNoobselect = 5674; - const static uint16 kLowvolumetran = 4949; - const static uint16 kCh0oksecond = 4945; - const static uint16 kFlashmousetab = 5698; - const static uint16 kIntrom3fin = 1105; - const static uint16 kNotareelid = 5073; - const static uint16 kKeyok = 2895; - const static uint16 kDontbother4 = 4949; - const static uint16 kExamlist = 2494; - const static uint16 kDontbother2 = 4945; - const static uint16 kDontbother3 = 4949; - const static uint16 kNotlair = 5674; - const static uint16 kDontbother8 = 4926; - const static uint16 kDontbother9 = 4945; - const static uint16 kNotfirstbiz = 1105; - const static uint16 kWrongatmos = 5073; - const static uint16 kContleftpage = 3589; - const static uint16 kAlreadysp = 2660; - const static uint16 kMustbeopen = 1214; - const static uint16 kNotryanoff = 1711; - const static uint16 kSkip1 = 1711; - const static uint16 kOver138 = 2660; - const static uint16 kNotkeyn = 3693; - const static uint16 kWholeloop1 = 2494; - const static uint16 kCanlastf = 3589; - const static uint16 kStereook = 3393; - const static uint16 kStereoon = 3393; - const static uint16 kEmptycup = 2660; - const static uint16 kQuitloaded = 3735; - const static uint16 kNotkeyp = 3693; - const static uint16 kFlipfolderline = 3589; - const static uint16 kIdentifyset = 5073; - const static uint16 kWalkandexamine = 5674; - const static uint16 kFirstbitofblock = 1819; - const static uint16 kNotloc44 = 4949; - const static uint16 kRighthand = 3385; - const static uint16 kBacktoother = 1819; - const static uint16 kEndofdir2 = 2895; - const static uint16 kNotendsmallcandle = 1105; - const static uint16 kIsbright = 4949; - const static uint16 kWidth63 = 1819; - const static uint16 kEndofinput = 2776; - const static uint16 kGotadvframe = 1105; - const static uint16 kQuitlist = 2692; - const static uint16 kNotwornswap = 2660; - const static uint16 kKeys = 2807; - const static uint16 kNomod = 2494; - const static uint16 kNodumpeye = 5698; - const static uint16 kCopyin1 = 2895; - const static uint16 kHorizloop = 5691; - const static uint16 kFquit = 4884; - const static uint16 kFullcup = 2660; - const static uint16 kPurgeloc = 2660; - const static uint16 kNotendmonk1 = 1105; - const static uint16 kDontpurge = 2660; - const static uint16 kExecutewalk = 1105; - const static uint16 kIntrom1fin = 1105; - const static uint16 kNotout = 2660; - const static uint16 kGamerfin = 1105; - const static uint16 kAfterwalk = 1105; - const static uint16 kNotgotobject = 2660; - const static uint16 kDoincryan = 2660; - const static uint16 kCopytext = 5691; - const static uint16 kIsntsame = 2660; - const static uint16 kNoeffects = 1819; - const static uint16 kFindblaster = 4949; - const static uint16 kNottalkedrecep = 1105; - const static uint16 kDecidelist = 4884; - const static uint16 kIsdouble = 1105; - const static uint16 kNoswap2 = 5691; - const static uint16 kNoswap1 = 5691; - const static uint16 kNotspeaking = 2692; - const static uint16 kMorerain = 1214; - const static uint16 kSizeok = 2660; - const static uint16 kNotdeltvstud = 2776; - const static uint16 kEndofline = 1113; - const static uint16 kOddwidth = 1819; - const static uint16 kBacktosolidfx = 1819; - const static uint16 kNotinedens = 3393; - const static uint16 kMoreload = 4945; - const static uint16 kIntoopen = 2660; - const static uint16 kIsfree3 = 2660; - const static uint16 kIsfree2 = 2660; - const static uint16 kActuallyout = 2660; - const static uint16 kFailrain = 1214; - const static uint16 kFullvol = 5073; - const static uint16 kGotreader3with = 3385; - const static uint16 kNmloop1 = 1819; - const static uint16 kNmloop2 = 1819; - const static uint16 kIntromonk2fin = 1105; - const static uint16 kNotnocurs = 3861; - const static uint16 kMultiloop1 = 1819; - const static uint16 kWithit = 2494; - const static uint16 kMultiloop3 = 1819; - const static uint16 kMultiloop2 = 1819; - const static uint16 kMultiloop5 = 1819; - const static uint16 kMultiloop4 = 1819; - const static uint16 kMultiloop6 = 1819; - const static uint16 kInpoolhall = 3393; - const static uint16 kUsekey1 = 3393; - const static uint16 kUsekey2 = 3393; - const static uint16 kGetoutofit = 5698; - const static uint16 kNotrav = 2776; - const static uint16 kDouse = 2895; - const static uint16 kNotdelsarters = 2776; - const static uint16 kNottvsoldier = 3393; - const static uint16 kAddloop2 = 2660; - const static uint16 kJustgetback = 2494; - const static uint16 kNotreleasehold = 4949; - const static uint16 kMightwait = 1105; - const static uint16 kNotyet = 3385; - const static uint16 kNotintro1text1 = 1105; - const static uint16 kNotintro1text3 = 1105; - const static uint16 kIsdma = 4949; - const static uint16 kNotinbed = 1105; - const static uint16 kPlinthwith = 3385; - const static uint16 kAxeondoor = 3393; - const static uint16 kOkcom = 2895; - const static uint16 kNotover1 = 5073; - const static uint16 kHorizline = 5691; - const static uint16 kBuscombatwon = 1105; - const static uint16 kAlreadyincryan = 2660; - const static uint16 kPalloop = 1711; - const static uint16 kGotguardframe = 1105; - const static uint16 kGotcrystal = 3385; - const static uint16 kLookcolon = 3385; - const static uint16 kAccessloop = 2776; - const static uint16 kSaveops = 3819; - const static uint16 kMonloop1 = 5698; - const static uint16 kCheckmain = 4949; - const static uint16 kWidth128 = 1819; - const static uint16 kNotheld = 2895; - const static uint16 kNotopleft = 3651; - const static uint16 kDeallerror = 4949; - const static uint16 kEndtail = 4949; - const static uint16 kEndofthisline = 1214; - const static uint16 kSignonloop2 = 2895; - const static uint16 kSymbollist = 3589; - const static uint16 kNofirst = 5073; - const static uint16 kLockloop = 2895; - const static uint16 kFinishslow2 = 2494; - const static uint16 kNopathoff = 5073; - const static uint16 kCantsetup2 = 3393; - const static uint16 kHaventfound = 3393; - const static uint16 kIsmorereel = 4949; - const static uint16 kNotbracket = 2895; - const static uint16 kMoreendseq = 2494; - const static uint16 kEndlessloop = 4949; - const static uint16 kNodel2 = 3861; - const static uint16 kNodroperror = 2660; - const static uint16 kEndgametext1 = 4835; - const static uint16 kNoops = 3693; - const static uint16 kNotclear3 = 4949; - const static uint16 kNotclear2 = 4949; - const static uint16 kNotclear1 = 4949; - const static uint16 kLoadnew = 4949; - const static uint16 kFinishtime = 4949; - const static uint16 kBusspeed = 1105; - const static uint16 kGotbusframe = 1105; - const static uint16 kGrafwith = 3385; - const static uint16 kIsex2 = 2660; - const static uint16 kIsex3 = 2660; - const static uint16 kDoplace = 2660; - const static uint16 kSoldierwait = 1105; - const static uint16 kGotsmoket = 1105; - const static uint16 kNothingund = 5073; - const static uint16 kPlotloop = 1214; - const static uint16 kWaiting = 1105; - const static uint16 kNoresetpit = 4949; - const static uint16 kGotsmokeb = 1105; - const static uint16 kFoundfile = 2895; - const static uint16 kRightpageloop = 3589; - const static uint16 kBothspecial = 2660; - const static uint16 kIssoundint = 4949; - const static uint16 kNotspace1 = 2895; - const static uint16 kLowvolumemix = 4949; - const static uint16 kNoactsave = 3861; - const static uint16 kWalkman = 1105; - const static uint16 kNotinrockroom = 3393; - const static uint16 kNodrop = 2660; - const static uint16 kKeyonhotel2 = 3385; - const static uint16 kKeyonhotel1 = 3385; - const static uint16 kGotcontrolwith = 3393; - const static uint16 kThingsonaltar = 3385; - const static uint16 kAlreadywon = 1105; - const static uint16 kNextslab = 3385; - const static uint16 kAlreadyrun = 5073; - const static uint16 kFinishclose = 1214; - const static uint16 kHangloop = 5698; - const static uint16 kNonewgame = 4926; - const static uint16 kCh1oksecond = 4945; - const static uint16 kForcenext = 1105; - const static uint16 kUpordown2 = 1214; - const static uint16 kBalls = 3393; - const static uint16 kWidth21 = 1819; - const static uint16 kAlreadyops = 3693; - const static uint16 kEndword = 2494; - const static uint16 kIsntblank = 4884; - const static uint16 kNotfadeend = 1105; - const static uint16 kDoqk = 3525; - const static uint16 kQuitcom = 2776; - const static uint16 kNotyover = 5715; - const static uint16 kDoqs = 3651; - const static uint16 kNotdreamcentre = 4949; - const static uint16 kLine4 = 5691; - const static uint16 kLine3 = 5691; - const static uint16 kLine1 = 5691; - const static uint16 kGotgates = 1105; - const static uint16 kZoomisoff = 5691; - const static uint16 kForgotone = 1113; - const static uint16 kNotch0endofpage0 = 4949; - const static uint16 kWidth49 = 1819; - const static uint16 kWidth48 = 1819; - const static uint16 kWidth47 = 1819; - const static uint16 kWidth46 = 1819; - const static uint16 kNoselslot = 3861; - const static uint16 kWidth44 = 1819; - const static uint16 kFoundlinestart = 1214; - const static uint16 kWidth42 = 1819; - const static uint16 kWidth41 = 1819; - const static uint16 kWidth40 = 1819; - const static uint16 kNotletgo4 = 2660; - const static uint16 kWidth110 = 1819; - const static uint16 kNotletgo3 = 2660; - const static uint16 kNotletgo2 = 2660; - const static uint16 kGotsoundbuff = 4949; - const static uint16 kSearchdestdown = 2776; - const static uint16 kNotneartextend = 2660; - const static uint16 kHelispeed = 1105; - const static uint16 kQuickquit = 3861; - const static uint16 kAfterlook = 2660; - const static uint16 kNotwaiting = 1105; - const static uint16 kCheckmorerain = 1113; - const static uint16 kDontbother = 4945; - const static uint16 kAlreadyloadold = 4926; - const static uint16 kAlreadyopob = 2660; - const static uint16 kTestcom = 2776; - const static uint16 kNotinryaninv = 2494; - const static uint16 kLookx = 5862; - const static uint16 kLooky = 5862; - const static uint16 kDozoomonoff = 3693; - const static uint16 kNotyover2 = 5715; - const static uint16 kAfterslow = 2494; - const static uint16 kGotoverend2 = 2494; - const static uint16 kNotletgo = 2660; - const static uint16 kAlreadyget = 2660; - const static uint16 kHoteldoorwith2 = 3385; - const static uint16 kNoteden2 = 4949; - const static uint16 kNowinch = 3393; - const static uint16 kKeyloop = 2776; - const static uint16 kNocross = 5698; - const static uint16 kNotpersonname = 5691; - const static uint16 kFindexloop = 3393; - const static uint16 kNotlouis2 = 1105; - const static uint16 kNothelicopter = 3393; - const static uint16 kNotlouis1 = 1105; - const static uint16 kFacingok = 1105; - const static uint16 kNotrandom = 1214; - const static uint16 kGotoverend = 2494; - const static uint16 kNotgunonheli = 1105; - const static uint16 kNoslow = 2494; - const static uint16 kFinishmon2 = 2494; - const static uint16 kFinishsparky = 1105; - const static uint16 kNotselob = 3393; - const static uint16 kSkipsprite = 1105; - const static uint16 kFinishconv = 2692; - const static uint16 kIsinright = 5691; - const static uint16 kWidth45 = 1819; - const static uint16 kHavecutwire = 3393; - const static uint16 kFinfree = 2660; - const static uint16 kWidth43 = 1819; - const static uint16 kHolewith = 3385; - const static uint16 kNodistort = 4949; - const static uint16 kBackwards = 3651; - const static uint16 kNotasetid = 5073; - const static uint16 kNotholdingreel = 4949; - const static uint16 kAlreadygotnew = 3385; - const static uint16 kFlashcurs = 2895; - const static uint16 kCantuseopen = 2660; - const static uint16 kHoteldoorwith = 3385; - const static uint16 kIsloadmode = 3861; - const static uint16 kNot129 = 2494; - const static uint16 kNobotright = 3651; - const static uint16 kMemerror = 4949; - const static uint16 kBlankframe = 2660; - const static uint16 kOpendoor = 1214; - const static uint16 kNotbang = 1105; - const static uint16 kFadecolloop = 2494; - const static uint16 kNotlouisvol = 5073; - const static uint16 kBotok = 4949; - const static uint16 kNextcart = 3385; - const static uint16 kFillcup = 3385; - const static uint16 kNotopenable = 2660; - const static uint16 kWireaxe = 3393; - const static uint16 kNotinsidethis = 2660; - const static uint16 kAtlast2 = 1214; - const static uint16 kAtlast3 = 1214; - const static uint16 kAtlast1 = 1214; - const static uint16 kHoldingreel = 5691; - const static uint16 kFindopen2 = 2494; - const static uint16 kFindopen1 = 2494; - const static uint16 kEndsetloop = 3393; - const static uint16 kGotcart = 2776; - const static uint16 kNot10 = 3525; - const static uint16 kLookforlinestart = 1214; - const static uint16 kCanpick2a = 2660; - const static uint16 kAlreadyonoff = 3693; - const static uint16 kNotsarters = 3393; - const static uint16 kDogetback = 2660; - const static uint16 kNotthrough2 = 1214; - const static uint16 kNotprintlist = 1819; - const static uint16 kNotwrapbackb = 3651; - const static uint16 kNoadvisor = 1105; - const static uint16 kWidth30 = 1819; - const static uint16 kNotleadingspace = 2776; - const static uint16 kMoney1poke = 3385; - const static uint16 kFinishwatch = 4949; - const static uint16 kQuittravel = 2714; - const static uint16 kDontgetrid = 5862; - const static uint16 kVolfinish = 4949; - const static uint16 kDograf = 3385; - const static uint16 kDograb = 2660; - const static uint16 kWidth58 = 1819; - const static uint16 kWidth59 = 1819; - const static uint16 kEnoughmem = 4949; - const static uint16 kWidth54 = 1819; - const static uint16 kMainloop = 4949; - const static uint16 kWidth56 = 1819; - const static uint16 kShowgroup1 = 2494; - const static uint16 kWidth50 = 1819; - const static uint16 kWidth51 = 1819; - const static uint16 kWidth52 = 1819; - const static uint16 kWidth53 = 1819; - const static uint16 kOver148 = 2660; - const static uint16 kWord4 = 4949; - const static uint16 kNottalk1 = 1105; - const static uint16 kWord1 = 4949; - const static uint16 kWord3 = 4949; - const static uint16 kWord2 = 4949; - const static uint16 kPriestwait = 1105; - const static uint16 kKeepchecking = 2660; - const static uint16 kOver146 = 2660; - const static uint16 kOver147 = 2660; - const static uint16 kAlreadyopinv = 2660; - const static uint16 kIsntblock = 5674; - const static uint16 kKeyok2 = 2895; - const static uint16 kKeyok1 = 2895; - const static uint16 kFinishtalk = 2660; - const static uint16 kNumberright = 3393; - const static uint16 kFindryanloop = 2494; - const static uint16 kAlreadyfull = 3385; - const static uint16 kNotchangeloc = 1711; - const static uint16 kNotweb = 5073; - const static uint16 kNotendseq = 1105; - const static uint16 kSecdes = 1105; - const static uint16 kComparefin = 3393; - const static uint16 kAlreadygrb = 2660; - const static uint16 kNoshoe1 = 1113; - const static uint16 kFinishdim4 = 2660; - const static uint16 kRestartlook = 2895; - const static uint16 kFinishdim1 = 2660; - const static uint16 kFinishdim3 = 2660; - const static uint16 kFinishdim2 = 2660; - const static uint16 kNotnomask = 1819; - const static uint16 kNorun = 5073; - const static uint16 kNotryanon = 1711; - const static uint16 kFinishmain = 4949; - const static uint16 kFinishfade = 2494; - const static uint16 kNopitflip = 4949; - const static uint16 kStereook2 = 3393; - const static uint16 kGreysumloop1 = 2494; - const static uint16 kGreysumloop2 = 2494; - const static uint16 kNotaftersec = 1105; - const static uint16 kNotinthelift = 4949; - const static uint16 kAdjustemmpage = 4945; - const static uint16 kNotendtext2 = 1105; - const static uint16 kNotendtext3 = 1105; - const static uint16 kNotendtext1 = 1105; - const static uint16 kNospeech1 = 2692; - const static uint16 kSlabfwrong = 3385; - const static uint16 kNotdumpdiary = 3693; - const static uint16 kNokeypress = 3861; - const static uint16 kFindten = 4945; - const static uint16 kBuscombatend = 1105; - const static uint16 kIstakengun = 3393; - const static uint16 kFindopenp1 = 2660; - const static uint16 kNotstartshake = 4949; - const static uint16 kNoloccheck = 2494; - const static uint16 kJustret = 3693; - const static uint16 kAlreadyturned = 1105; - const static uint16 kNothunder = 1214; - const static uint16 kNotmonktext5 = 1105; - const static uint16 kNotmonktext4 = 1105; - const static uint16 kNotmonktext7 = 1105; - const static uint16 kNotmonktext6 = 1105; - const static uint16 kNotmonktext1 = 1105; - const static uint16 kNotmonktext3 = 1105; - const static uint16 kNotmonktext2 = 1105; - const static uint16 kGotcandles = 1105; - const static uint16 kNotmonktext9 = 1105; - const static uint16 kNotmonktext8 = 1105; - const static uint16 kSatdown = 3385; - const static uint16 kSlabwith = 3385; - const static uint16 kIntromonk1fin = 1105; - const static uint16 kContrightpage = 3589; - const static uint16 kCantwalk2 = 5691; - const static uint16 kDeltimedtext = 3393; - const static uint16 kEndcredits22 = 2494; - const static uint16 kBackwardsbot = 3651; - const static uint16 kNot130 = 2494; - const static uint16 kFinished = 5073; - const static uint16 kAlreadyswap2 = 2660; - const static uint16 kEndall = 2494; - const static uint16 kMoreinput = 2776; - const static uint16 kFinishinitrain = 1113; - const static uint16 kNotsecondbank1 = 4949; - const static uint16 kDimloop4 = 2660; - const static uint16 kDontwalkin = 5862; - const static uint16 kReelsoundloop = 1214; - const static uint16 kDimloop1 = 2660; - const static uint16 kDimloop2 = 2660; - const static uint16 kDimloop3 = 2660; - const static uint16 kNotinpool = 3393; - const static uint16 kIskern = 2494; - const static uint16 kEyesshut = 5691; - const static uint16 kDoload = 3735; - const static uint16 kCantzoom = 1819; - const static uint16 kToplot = 4949; - const static uint16 kNotfirsttrigger = 2895; - const static uint16 kMenuloop = 3525; - const static uint16 kNotmapdownspec = 1711; - const static uint16 kUptime = 4949; - const static uint16 kFindopen2a = 2494; - const static uint16 kPathloop = 5073; - const static uint16 kCheckrain = 1113; - const static uint16 kNotyetboss = 3385; - const static uint16 kNoincryan = 2660; - const static uint16 kSpeechfilename = 4926; - const static uint16 kComlist = 2776; - const static uint16 kGotallboss = 1105; - const static uint16 kNottopchurch = 4949; - const static uint16 kBeenpickedup = 3393; - const static uint16 kNotintro3text1 = 1105; - const static uint16 kNopathon = 5073; - const static uint16 kOff = 2776; - const static uint16 kAlreadyuse = 2895; - const static uint16 kInvlist1 = 2556; - const static uint16 kObject = 3393; - const static uint16 kMorethan10 = 4949; - const static uint16 kMightbeonlych1 = 4949; - const static uint16 kMightbeonlych0 = 4949; - const static uint16 kPasserror = 2895; - const static uint16 kAlreadyloaded = 4949; - const static uint16 kNopriesttext = 1105; - const static uint16 kNotanup = 1113; - const static uint16 kEndmon = 2776; - const static uint16 kMoretopic = 2895; - const static uint16 kGatesfin = 1105; - const static uint16 kNokeyn = 3693; - const static uint16 kFinishcurdel = 2895; - const static uint16 kCheckpass = 2895; - const static uint16 kNotlift = 1214; - const static uint16 kWidth61 = 1819; - const static uint16 kWidth60 = 1819; - const static uint16 kNofind = 3393; - const static uint16 kWidth62 = 1819; - const static uint16 kNotsmallx2 = 5698; - const static uint16 kDos2 = 2494; - const static uint16 kDos3 = 2494; - const static uint16 kNocash = 3385; - const static uint16 kDos1 = 2494; - const static uint16 kNotendmonk2 = 1105; - const static uint16 kDiffmouse = 2660; - const static uint16 kNotinthebeach = 4949; - const static uint16 kPcxpal = 1711; - const static uint16 kCandlesfin = 1105; - const static uint16 kSuccess = 5691; - const static uint16 kGotvalidpath = 5073; - const static uint16 kTopokv = 4949; - const static uint16 kNotinpoolroom = 3393; - const static uint16 kGothand = 5698; - const static uint16 kCantuse2 = 2895; - const static uint16 kDiff = 5674; - const static uint16 kSearchinv = 3393; - const static uint16 kIsblock = 5674; - const static uint16 kJimmycontrols = 3393; - const static uint16 kItsfrominv = 5698; - const static uint16 kNotgeneralstart = 1105; - const static uint16 kMakeintoex = 2660; - const static uint16 kDoredes = 2714; - const static uint16 kLookforpurge = 2660; - const static uint16 kNochange2 = 1214; - const static uint16 kUpordown = 1214; - const static uint16 kDontbother5 = 4949; - const static uint16 kZoomloop = 1819; - const static uint16 kStillspace1 = 2895; - const static uint16 kHeliwon = 1105; - const static uint16 kGameinfo = 4375; - const static uint16 kNotalkrock = 1105; - const static uint16 kShownameloop = 3861; - const static uint16 kNotblankinp = 2776; - const static uint16 kJustshutting = 1214; - const static uint16 kNotwidedoor = 1214; - const static uint16 kNotdiffob = 5674; - const static uint16 kNotthrough = 1214; - const static uint16 kExamineagain = 2494; - const static uint16 kVertline = 5691; - const static uint16 kRestartops = 3693; - const static uint16 kNotsmallx = 5698; - const static uint16 kNotwatchpoint = 5698; - const static uint16 kNotflippedx = 1819; - const static uint16 kBotokv = 4949; - const static uint16 kSmallcandlef = 1105; - const static uint16 kGotcandles2 = 1105; - const static uint16 kFinblink1 = 5691; - const static uint16 kNotinthisroom = 1214; - const static uint16 kNospeech = 2660; - const static uint16 kSlabcwrong = 3385; - const static uint16 kPokelift = 1214; - const static uint16 kLoadops = 3735; - const static uint16 kNotextraname = 5691; - const static uint16 kCantredes = 2714; - const static uint16 kOnelot = 1105; - const static uint16 kDeloneloop = 1819; - const static uint16 kDodrop = 2660; - const static uint16 kDoplace2 = 2660; - const static uint16 kNopath = 3393; - const static uint16 kBotofdoor2 = 1214; - const static uint16 kNotnewlogo = 2895; - const static uint16 kIsntsame2 = 2660; - const static uint16 kNotfadedown = 1105; - const static uint16 kNot173 = 2494; - const static uint16 kTopwrap = 3651; - const static uint16 kCannextf = 3589; - const static uint16 kCartwith = 3385; - const static uint16 kGotintro3text = 1105; - const static uint16 kAlreadybotr = 3651; - const static uint16 kMainlist2 = 5011; - const static uint16 kNotrainyet = 1105; - const static uint16 kNotsecondtrigger = 2895; - const static uint16 kNotravmessage = 1113; - const static uint16 kNotunsized = 2660; - const static uint16 kGameragain = 1105; + const static uint16 kStartvars = 1; + const static uint16 kProgresspoints = 2; + const static uint16 kWatchon = 3; + const static uint16 kShadeson = 4; + const static uint16 kSecondcount = 5; + const static uint16 kMinutecount = 6; + const static uint16 kHourcount = 7; + const static uint16 kZoomon = 8; + const static uint16 kLocation = 9; + const static uint16 kExpos = 10; + const static uint16 kExframepos = 12; + const static uint16 kExtextpos = 14; + const static uint16 kCard1money = 16; + const static uint16 kListpos = 18; + const static uint16 kRyanpage = 19; + const static uint16 kWatchingtime = 21; + const static uint16 kReeltowatch = 23; + const static uint16 kEndwatchreel = 25; + const static uint16 kSpeedcount = 26; + const static uint16 kWatchspeed = 27; + const static uint16 kReeltohold = 29; + const static uint16 kEndofholdreel = 31; + const static uint16 kWatchmode = 32; + const static uint16 kDestafterhold = 33; + const static uint16 kNewsitem = 34; + const static uint16 kLiftflag = 35; + const static uint16 kLiftpath = 36; + const static uint16 kLockstatus = 37; + const static uint16 kDoorpath = 38; + const static uint16 kCounttoopen = 39; + const static uint16 kCounttoclose = 40; + const static uint16 kRockstardead = 41; + const static uint16 kGeneraldead = 42; + const static uint16 kSartaindead = 43; + const static uint16 kAidedead = 44; + const static uint16 kBeenmugged = 45; + const static uint16 kGunpassflag = 46; + const static uint16 kCanmovealtar = 47; + const static uint16 kTalkedtoattendant = 48; + const static uint16 kTalkedtosparky = 49; + const static uint16 kTalkedtoboss = 50; + const static uint16 kTalkedtorecep = 51; + const static uint16 kCardpassflag = 52; + const static uint16 kMadmanflag = 53; + const static uint16 kKeeperflag = 54; + const static uint16 kLasttrigger = 55; + const static uint16 kMandead = 56; + const static uint16 kSeed = 59; + const static uint16 kNeedtotravel = 60; + const static uint16 kThroughdoor = 61; + const static uint16 kNewobs = 62; + const static uint16 kRyanon = 63; + const static uint16 kCombatcount = 64; + const static uint16 kLastweapon = 65; + const static uint16 kDreamnumber = 66; + const static uint16 kRoomafterdream = 67; + const static uint16 kShakecounter = 68; + const static uint16 kSpeechcount = 69; + const static uint16 kCharshift = 71; + const static uint16 kKerning = 72; + const static uint16 kBrightness = 73; + const static uint16 kRoomloaded = 74; + const static uint16 kDidzoom = 75; + const static uint16 kLinespacing = 77; + const static uint16 kTextaddressx = 79; + const static uint16 kTextaddressy = 81; + const static uint16 kTextlen = 82; + const static uint16 kLastxpos = 84; + const static uint16 kIcontop = 86; + const static uint16 kIconleft = 88; + const static uint16 kItemframe = 89; + const static uint16 kItemtotran = 90; + const static uint16 kRoomad = 92; + const static uint16 kOldsubject = 94; + const static uint16 kWithobject = 95; + const static uint16 kWithtype = 96; + const static uint16 kLookcounter = 98; + const static uint16 kCommand = 99; + const static uint16 kCommandtype = 100; + const static uint16 kOldcommandtype = 101; + const static uint16 kObjecttype = 102; + const static uint16 kGetback = 103; + const static uint16 kInvopen = 104; + const static uint16 kMainmode = 105; + const static uint16 kPickup = 106; + const static uint16 kLastinvpos = 107; + const static uint16 kExamagain = 108; + const static uint16 kNewtextline = 109; + const static uint16 kOpenedob = 110; + const static uint16 kOpenedtype = 111; + const static uint16 kOldmapadx = 113; + const static uint16 kOldmapady = 115; + const static uint16 kMapadx = 117; + const static uint16 kMapady = 119; + const static uint16 kMapoffsetx = 121; + const static uint16 kMapoffsety = 123; + const static uint16 kMapxstart = 125; + const static uint16 kMapystart = 127; + const static uint16 kMapxsize = 128; + const static uint16 kMapysize = 129; + const static uint16 kHavedoneobs = 130; + const static uint16 kManisoffscreen = 131; + const static uint16 kRainspace = 132; + const static uint16 kFacing = 133; + const static uint16 kLeavedirection = 134; + const static uint16 kTurntoface = 135; + const static uint16 kTurndirection = 136; + const static uint16 kMaintimer = 138; + const static uint16 kIntrocount = 139; + const static uint16 kArrowad = 141; + const static uint16 kCurrentkey = 142; + const static uint16 kOldkey = 143; + const static uint16 kUseddirection = 144; + const static uint16 kCurrentkey2 = 145; + const static uint16 kTimercount = 146; + const static uint16 kOldtimercount = 147; + const static uint16 kMapx = 148; + const static uint16 kMapy = 149; + const static uint16 kNewscreen = 150; + const static uint16 kRyanx = 151; + const static uint16 kRyany = 152; + const static uint16 kLastflag = 153; + const static uint16 kLastflagex = 154; + const static uint16 kFlagx = 155; + const static uint16 kFlagy = 156; + const static uint16 kCurrentex = 157; + const static uint16 kCurrentfree = 158; + const static uint16 kCurrentframe = 160; + const static uint16 kFramesad = 162; + const static uint16 kDataad = 164; + const static uint16 kFrsegment = 166; + const static uint16 kObjectx = 168; + const static uint16 kObjecty = 170; + const static uint16 kOffsetx = 172; + const static uint16 kOffsety = 174; + const static uint16 kSavesize = 176; + const static uint16 kSavesource = 178; + const static uint16 kSavex = 179; + const static uint16 kSavey = 180; + const static uint16 kCurrentob = 181; + const static uint16 kPriority = 182; + const static uint16 kDestpos = 183; + const static uint16 kReallocation = 184; + const static uint16 kRoomnum = 185; + const static uint16 kNowinnewroom = 186; + const static uint16 kResetmanxy = 187; + const static uint16 kNewlocation = 188; + const static uint16 kAutolocation = 189; + const static uint16 kMustload = 190; + const static uint16 kAnswered = 191; + const static uint16 kSaidno = 192; + const static uint16 kDoorcheck1 = 193; + const static uint16 kDoorcheck2 = 194; + const static uint16 kDoorcheck3 = 195; + const static uint16 kDoorcheck4 = 196; + const static uint16 kMousex = 198; + const static uint16 kMousey = 200; + const static uint16 kMousebutton = 202; + const static uint16 kMousebutton1 = 204; + const static uint16 kMousebutton2 = 206; + const static uint16 kMousebutton3 = 208; + const static uint16 kMousebutton4 = 210; + const static uint16 kOldbutton = 212; + const static uint16 kOldx = 214; + const static uint16 kOldy = 216; + const static uint16 kLastbutton = 218; + const static uint16 kOldpointerx = 220; + const static uint16 kOldpointery = 222; + const static uint16 kDelherex = 224; + const static uint16 kDelherey = 226; + const static uint16 kPointerxs = 227; + const static uint16 kPointerys = 228; + const static uint16 kDelxs = 229; + const static uint16 kDelys = 230; + const static uint16 kPointerframe = 231; + const static uint16 kPointerpower = 232; + const static uint16 kAuxpointerframe = 233; + const static uint16 kPointermode = 234; + const static uint16 kPointerspeed = 235; + const static uint16 kPointercount = 236; + const static uint16 kInmaparea = 237; + const static uint16 kReelpointer = 239; + const static uint16 kSlotdata = 240; + const static uint16 kThisslot = 241; + const static uint16 kSlotflags = 242; + const static uint16 kTakeoff = 244; + const static uint16 kTalkmode = 245; + const static uint16 kTalkpos = 246; + const static uint16 kCharacter = 247; + const static uint16 kPersondata = 249; + const static uint16 kTalknum = 250; + const static uint16 kNumberinroom = 251; + const static uint16 kCurrentcel = 252; + const static uint16 kOldselection = 253; + const static uint16 kStopwalking = 254; + const static uint16 kMouseon = 255; + const static uint16 kPlayed = 257; + const static uint16 kTimer1 = 258; + const static uint16 kTimer2 = 259; + const static uint16 kTimer3 = 260; + const static uint16 kWholetimer = 262; + const static uint16 kTimer1to = 263; + const static uint16 kTimer2to = 264; + const static uint16 kTimer3to = 265; + const static uint16 kWatchdump = 266; + const static uint16 kCurrentset = 268; + const static uint16 kLogonum = 269; + const static uint16 kOldlogonum = 270; + const static uint16 kNewlogonum = 271; + const static uint16 kNetseg = 273; + const static uint16 kNetpoint = 275; + const static uint16 kKeynum = 276; + const static uint16 kCursorstate = 277; + const static uint16 kPressed = 278; + const static uint16 kPresspointer = 280; + const static uint16 kGraphicpress = 281; + const static uint16 kPresscount = 282; + const static uint16 kKeypadax = 284; + const static uint16 kKeypadcx = 286; + const static uint16 kLightcount = 287; + const static uint16 kFolderpage = 288; + const static uint16 kDiarypage = 289; + const static uint16 kMenucount = 290; + const static uint16 kSymboltopx = 291; + const static uint16 kSymboltopnum = 292; + const static uint16 kSymboltopdir = 293; + const static uint16 kSymbolbotx = 294; + const static uint16 kSymbolbotnum = 295; + const static uint16 kSymbolbotdir = 296; + const static uint16 kSymboltolight = 297; + const static uint16 kSymbol1 = 298; + const static uint16 kSymbol2 = 299; + const static uint16 kSymbol3 = 300; + const static uint16 kSymbolnum = 301; + const static uint16 kDumpx = 303; + const static uint16 kDumpy = 305; + const static uint16 kWalkandexam = 306; + const static uint16 kWalkexamtype = 307; + const static uint16 kWalkexamnum = 308; + const static uint16 kCursloc = 310; + const static uint16 kCurslocx = 312; + const static uint16 kCurslocy = 314; + const static uint16 kCurpos = 316; + const static uint16 kMonadx = 318; + const static uint16 kMonady = 320; + const static uint16 kGotfrom = 322; + const static uint16 kMonsource = 324; + const static uint16 kNumtodo = 326; + const static uint16 kTimecount = 328; + const static uint16 kCounttotimed = 330; + const static uint16 kTimedseg = 332; + const static uint16 kTimedoffset = 334; + const static uint16 kTimedy = 335; + const static uint16 kTimedx = 336; + const static uint16 kNeedtodumptimed = 337; + const static uint16 kHandle = 339; + const static uint16 kLoadingorsave = 340; + const static uint16 kCurrentslot = 341; + const static uint16 kCursorpos = 342; + const static uint16 kColourpos = 343; + const static uint16 kFadedirection = 344; + const static uint16 kNumtofade = 345; + const static uint16 kFadecount = 346; + const static uint16 kAddtogreen = 347; + const static uint16 kAddtored = 348; + const static uint16 kAddtoblue = 349; + const static uint16 kLastsoundreel = 351; + const static uint16 kSoundbuffer = 353; + const static uint16 kSoundbufferad = 355; + const static uint16 kSoundbufferpage = 356; + const static uint16 kSoundtimes = 357; + const static uint16 kNeedsoundbuff = 358; + const static uint16 kOldint9seg = 360; + const static uint16 kOldint9add = 362; + const static uint16 kOldint8seg = 364; + const static uint16 kOldint8add = 366; + const static uint16 kOldsoundintseg = 368; + const static uint16 kOldsoundintadd = 370; + const static uint16 kSoundbaseadd = 372; + const static uint16 kDsp_status = 374; + const static uint16 kDsp_write = 376; + const static uint16 kDmaaddress = 377; + const static uint16 kSoundint = 378; + const static uint16 kSounddmachannel = 379; + const static uint16 kSampleplaying = 380; + const static uint16 kTestresult = 381; + const static uint16 kCurrentirq = 382; + const static uint16 kSpeechloaded = 383; + const static uint16 kSpeechlength = 385; + const static uint16 kVolume = 386; + const static uint16 kVolumeto = 387; + const static uint16 kVolumedirection = 388; + const static uint16 kVolumecount = 389; + const static uint16 kPlayblock = 390; + const static uint16 kWongame = 391; + const static uint16 kLasthardkey = 392; + const static uint16 kBufferin = 394; + const static uint16 kBufferout = 396; + const static uint16 kExtras = 398; + const static uint16 kWorkspace = 400; + const static uint16 kMapstore = 402; + const static uint16 kCharset1 = 404; + const static uint16 kTempcharset = 406; + const static uint16 kIcons1 = 408; + const static uint16 kIcons2 = 410; + const static uint16 kBuffers = 412; + const static uint16 kMainsprites = 414; + const static uint16 kBackdrop = 416; + const static uint16 kMapdata = 418; + const static uint16 kSounddata = 420; + const static uint16 kSounddata2 = 422; + const static uint16 kRecordspace = 424; + const static uint16 kFreedat = 426; + const static uint16 kSetdat = 428; + const static uint16 kReel1 = 430; + const static uint16 kReel2 = 432; + const static uint16 kReel3 = 434; + const static uint16 kRoomdesc = 436; + const static uint16 kFreedesc = 438; + const static uint16 kSetdesc = 440; + const static uint16 kBlockdesc = 442; + const static uint16 kSetframes = 444; + const static uint16 kFreeframes = 446; + const static uint16 kPeople = 448; + const static uint16 kReels = 450; + const static uint16 kCommandtext = 452; + const static uint16 kPuzzletext = 454; + const static uint16 kTraveltext = 456; + const static uint16 kTempgraphics = 458; + const static uint16 kTempgraphics2 = 460; + const static uint16 kTempgraphics3 = 462; + const static uint16 kTempsprites = 464; + const static uint16 kTextfile1 = 466; + const static uint16 kTextfile2 = 468; + const static uint16 kTextfile3 = 470; + const static uint16 kBlinkframe = 471; + const static uint16 kBlinkcount = 472; + const static uint16 kReasseschanges = 473; + const static uint16 kPointerspath = 474; + const static uint16 kManspath = 475; + const static uint16 kPointerfirstpath = 476; + const static uint16 kFinaldest = 477; + const static uint16 kDestination = 478; + const static uint16 kLinestartx = 480; + const static uint16 kLinestarty = 482; + const static uint16 kLineendx = 484; + const static uint16 kLineendy = 486; + const static uint16 kIncrement1 = 488; + const static uint16 kIncrement2 = 490; + const static uint16 kLineroutine = 491; + const static uint16 kLinepointer = 492; + const static uint16 kLinedirection = 493; + const static uint16 kLinelength = 494; + const static uint16 kLiftsoundcount = 495; + const static uint16 kEmmhandle = 497; + const static uint16 kEmmpageframe = 499; + const static uint16 kEmmhardwarepage = 500; + const static uint16 kCh0emmpage = 502; + const static uint16 kCh0offset = 504; + const static uint16 kCh0blockstocopy = 506; + const static uint16 kCh0playing = 507; + const static uint16 kCh0repeat = 508; + const static uint16 kCh0oldemmpage = 510; + const static uint16 kCh0oldoffset = 512; + const static uint16 kCh0oldblockstocopy = 514; + const static uint16 kCh1playing = 515; + const static uint16 kCh1emmpage = 517; + const static uint16 kCh1offset = 519; + const static uint16 kCh1blockstocopy = 521; + const static uint16 kCh1blocksplayed = 523; + const static uint16 kSoundbufferwrite = 525; + const static uint16 kSoundemmpage = 527; + const static uint16 kSpeechemmpage = 529; + const static uint16 kCurrentsample = 530; + const static uint16 kRoomssample = 531; + const static uint16 kGameerror = 532; + const static uint16 kHowmuchalloc = 534; + const static uint16 kReelroutines = 537; + const static uint16 kReelcalls = 1003; + const static uint16 kRoombyroom = 1254; + const static uint16 kR0 = 1327; + const static uint16 kR1 = 1328; + const static uint16 kR2 = 1332; + const static uint16 kR6 = 1351; + const static uint16 kR8 = 1358; + const static uint16 kR9 = 1374; + const static uint16 kR10 = 1381; + const static uint16 kR11 = 1385; + const static uint16 kR12 = 1389; + const static uint16 kR13 = 1393; + const static uint16 kR14 = 1406; + const static uint16 kR20 = 1440; + const static uint16 kR22 = 1462; + const static uint16 kR23 = 1493; + const static uint16 kR25 = 1506; + const static uint16 kR26 = 1528; + const static uint16 kR27 = 1550; + const static uint16 kR28 = 1575; + const static uint16 kR29 = 1594; + const static uint16 kR45 = 1610; + const static uint16 kR46 = 1617; + const static uint16 kR47 = 1654; + const static uint16 kR52 = 1667; + const static uint16 kR53 = 1671; + const static uint16 kR55 = 1678; + const static uint16 kSpritename1 = 1832; + const static uint16 kSpritename3 = 1845; + const static uint16 kIdname = 1857; + const static uint16 kCharacterset1 = 1870; + const static uint16 kCharacterset2 = 1883; + const static uint16 kCharacterset3 = 1896; + const static uint16 kSamplename = 1909; + const static uint16 kBasicsample = 1922; + const static uint16 kIcongraphics0 = 1935; + const static uint16 kIcongraphics1 = 1948; + const static uint16 kExtragraphics1 = 1961; + const static uint16 kIcongraphics8 = 1974; + const static uint16 kMongraphicname = 1987; + const static uint16 kMongraphics2 = 2000; + const static uint16 kCityname = 2013; + const static uint16 kTravelgraphic1 = 2026; + const static uint16 kTravelgraphic2 = 2039; + const static uint16 kDiarygraphic = 2052; + const static uint16 kMonitorfile1 = 2065; + const static uint16 kMonitorfile2 = 2078; + const static uint16 kMonitorfile10 = 2091; + const static uint16 kMonitorfile11 = 2104; + const static uint16 kMonitorfile12 = 2117; + const static uint16 kMonitorfile13 = 2130; + const static uint16 kMonitorfile20 = 2143; + const static uint16 kMonitorfile21 = 2156; + const static uint16 kMonitorfile22 = 2169; + const static uint16 kMonitorfile23 = 2182; + const static uint16 kMonitorfile24 = 2195; + const static uint16 kFoldertext = 2208; + const static uint16 kDiarytext = 2221; + const static uint16 kPuzzletextname = 2234; + const static uint16 kTraveltextname = 2247; + const static uint16 kIntrotextname = 2260; + const static uint16 kEndtextname = 2273; + const static uint16 kCommandtextname = 2286; + const static uint16 kVolumetabname = 2299; + const static uint16 kFoldergraphic1 = 2312; + const static uint16 kFoldergraphic2 = 2325; + const static uint16 kFoldergraphic3 = 2338; + const static uint16 kSymbolgraphic = 2351; + const static uint16 kGungraphic = 2364; + const static uint16 kMonkface = 2377; + const static uint16 kTitle0graphics = 2390; + const static uint16 kTitle1graphics = 2403; + const static uint16 kTitle2graphics = 2416; + const static uint16 kTitle3graphics = 2429; + const static uint16 kTitle4graphics = 2442; + const static uint16 kTitle5graphics = 2455; + const static uint16 kTitle6graphics = 2468; + const static uint16 kTitle7graphics = 2481; + const static uint16 kPalettescreen = 2494; + const static uint16 kCurrentfile = 2895; + const static uint16 kDmaaddresses = 4949; + const static uint16 kFileheader = 5881; + const static uint16 kFiledata = 5952; + const static uint16 kExtradata = 5958; + const static uint16 kRoomdata = 5971; + const static uint16 kMadeuproomdat = 7782; + const static uint16 kRoomscango = 7798; + const static uint16 kRoompics = 7813; + const static uint16 kOplist = 7816; + const static uint16 kInputline = 7944; + const static uint16 kLinedata = 8344; + const static uint16 kPresslist = 8350; + const static uint16 kSavenames = 8367; + const static uint16 kSavefiles = 8482; + const static uint16 kRecname = 8573; + const static uint16 kStak = 8829; } -- cgit v1.2.3 From 9d53cefa53349c5717e3f585445664b56361c4de Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 02:26:37 +0400 Subject: DREAMWEB: added allocateSegment, added some stubs --- engines/dreamweb/dreamweb.cpp | 11 +++++++---- engines/dreamweb/runtime.h | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 25e6118457..8c6b3ce3fb 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -153,11 +153,9 @@ void keyboardread(Context &context) { } void resetkeyboard(Context &context) { - ::error("resetkeyboard"); } void setkeyboardint(Context &context) { - ::error("setkeyboardint"); } void readfromfile(Context &context) { @@ -201,7 +199,12 @@ void gettime(Context &context) { } void allocatemem(Context &context) { - ::error("allocatemem"); + uint size = (context.bx + 2) * 16; + debug(1, "allocate mem, %u bytes", size); + context.flags._c = false; + SegmentRef seg = context.allocateSegment(size); + context.ax = (uint16)seg; + debug(1, "\tsegment address -> %04x", (uint16)context.ax); } void deallocatemem(Context &context) { @@ -213,7 +216,7 @@ void removeemm(Context &context) { } void setupemm(Context &context) { - ::error("setupemm"); + //fixme: double check this, but it seems that emm pages used only for sound } void pitinterupt(Context &context) { diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 6b5f650fc6..bcc7c383a7 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -209,6 +209,14 @@ public: return SegmentRef(this, value, &i->_value); } + SegmentRef allocateSegment(uint size) { + unsigned id = kDefaultDataSegment + _segments.size(); + assert(!_segments.contains(id)); + Segment &seg = _segments[id]; + seg.data.resize(size); + return SegmentRef(this, id, &seg); + } + inline void _cmp(uint8 a, uint8 b) { uint8 x = a; _sub(x, b); -- cgit v1.2.3 From e94a8299aa2aa6dec189232f2db8a340e588c228 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 02:34:27 +0400 Subject: DREAMWEB: fixed invalid operator= --- engines/dreamweb/runtime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index bcc7c383a7..c46ac64e87 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -120,6 +120,7 @@ public: inline void reset(uint16 value); inline SegmentRef& operator=(const uint16 id) { + reset(id); return *this; } -- cgit v1.2.3 From 40c02f2f7ff999ee1b07306604607cb2ff3e12e5 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 02:45:48 +0400 Subject: DREAMWEB: replaced seecommandtail with stub --- devtools/tasmrecover/tasm-recover | 2 +- engines/dreamweb/dreamgen.cpp | 51 --------------------------------------- engines/dreamweb/dreamgen.h | 1 + engines/dreamweb/dreamweb.cpp | 10 ++++++++ 4 files changed, 12 insertions(+), 52 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index c4214b205a..159acacca4 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -7,5 +7,5 @@ p = parser() p.strip_path = 3 context = p.parse('dreamweb/dreamweb.asm') p.link() -generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2']) +generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2', 'seecommandtail']) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index cb94596a49..bf996f8353 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2,7 +2,6 @@ namespace dreamgen { -static void seecommandtail(Context &context); static void checkbasemem(Context &context); static void allocatebuffers(Context &context); static void clearbuffers(Context &context); @@ -145,7 +144,6 @@ static void dumptimedtext(Context &context); static void readmouse4(Context &context); static void dumpwatch(Context &context); static void fadescreenup(Context &context); -static void parseblaster(Context &context); static void clearreels(Context &context); static void clearrest(Context &context); static void trysoundalloc(Context &context); @@ -17455,54 +17453,6 @@ static void clearrest(Context & context) { return; } -static void seecommandtail(Context & context) { - context.ds.word(372) = 0x220; - context.ds.byte(378) = 5; - context.ds.byte(379) = 1; - context.ds.byte(73) = 0; - context.bx = 2; - context.ax = context.ds.word(context.bx); - context.dx = context.es; - context._sub(context.ax, context.dx); - context.ds.word(534) = context.ax; - context.bx = 0x02c; - context.ax = context.ds.word(context.bx); - context.push(context.es); - context.push(context.bx); - context.es = context.ax; - context.bx = 0; -findblaster: - context.ax = context.ds.word(context.bx); - context._cmp(context.ax, 0); - if (context.flags.z()) goto endofenvironment; - context._cmp(context.al, 'B'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ah, 'L'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ds.byte(context.bx+2), 'A'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ds.byte(context.bx+3), 'S'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ds.byte(context.bx+4), 'T'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ds.byte(context.bx+5), 'E'); - if (!context.flags.z()) goto notblast; - context._cmp(context.ds.byte(context.bx+6), 'R'); - if (!context.flags.z()) goto notblast; - context._add(context.bx, 7); - parseblaster(context); - goto endofenvironment; -notblast: - context._add(context.bx, 1); - goto findblaster; -endofenvironment: - context.bx = context.pop(); - context.es = context.pop(); - context.bx = 0x81; - parseblaster(context); - return; -} - static void parseblaster(Context & context) { lookattail: context.al = context.ds.byte(context.bx); @@ -22043,7 +21993,6 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc97c: clearrest(context); break; case 0xc980: deallocatemem(context); break; case 0xc984: allocatemem(context); break; - case 0xc988: seecommandtail(context); break; case 0xc98c: parseblaster(context); break; case 0xc990: startup(context); break; case 0xc994: startup1(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index c82d9f83b1..3696c957e2 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -11,6 +11,7 @@ namespace dreamgen { void randomnumber(Context &context); void quickquit(Context &context); void quickquit2(Context &context); + void seecommandtail(Context &context); void keyboardread(Context &context); void resetkeyboard(Context &context); void setkeyboardint(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8c6b3ce3fb..c25ee6a6ba 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -136,15 +136,25 @@ Common::Error DreamWebEngine::run() { namespace dreamgen { +void seecommandtail(Context &context) { + context.ds.word(kSoundbaseadd) = 0x220; + context.ds.byte(kSoundint) = 5; + context.ds.byte(kSounddmachannel) = 1; + context.ds.byte(kBrightness) = 1; + context.ds.word(kHowmuchalloc) = 0x9360; +} + void randomnumber(Context &context) { ::error("randomnumber"); } void quickquit(Context &context) { + assert(0); ::error("quickquit"); } void quickquit2(Context &context) { + assert(0); ::error("quickquit2"); } -- cgit v1.2.3 From d4d5c0527e4fa42cb83e58b03190e92eb2c2ddbb Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 03:00:53 +0400 Subject: DREAMWEB: implemented some of the stubs --- engines/dreamweb/dreamweb.cpp | 29 +++++++++++++++++++++-------- engines/dreamweb/dreamweb.h | 14 +++++++++----- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c25ee6a6ba..f2c86eb38d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -44,25 +44,26 @@ namespace DreamWeb { -DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +DreamWebEngine *DreamWebEngine::_instance; + +DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : + Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb") { // Setup mixer _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); - _rnd = new Common::RandomSource("dreamweb"); - _vSyncInterrupt = false; _console = 0; DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); + _instance = this; } DreamWebEngine::~DreamWebEngine() { DebugMan.clearAllDebugChannels(); delete _console; - delete _rnd; } // Let's see if it's a good idea to emulate VSYNC interrupts with a timer like @@ -136,6 +137,11 @@ Common::Error DreamWebEngine::run() { namespace dreamgen { + +static inline DreamWeb::DreamWebEngine *engine() { + return DreamWeb::DreamWebEngine::instance(); +} + void seecommandtail(Context &context) { context.ds.word(kSoundbaseadd) = 0x220; context.ds.byte(kSoundint) = 5; @@ -145,7 +151,7 @@ void seecommandtail(Context &context) { } void randomnumber(Context &context) { - ::error("randomnumber"); + context.al = engine()->randomNumber(); } void quickquit(Context &context) { @@ -201,11 +207,18 @@ void mousecall(Context &context) { } void setmouse(Context &context) { - ::error("setmouse"); + context.ds.word(kOldpointerx) = 0xffff; + warning("setmouse: fixme: add range setting"); + //set vertical range to 15-184 + //set horizontal range to 15-298*2 } void gettime(Context &context) { - ::error("gettime"); + warning("gettime: stub: "); + context.ch = 10; + context.cl = 15; + context.dh = 0; +; } void allocatemem(Context &context) { @@ -357,7 +370,7 @@ void showgroup(Context &context) { } void fadedos(Context &context) { - ::error("fadedos"); + warning("fadedos: STUB"); } void doshake(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 2bff384f18..96aa61ab50 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -50,8 +50,9 @@ struct DreamWebGameDescription; class DreamWebEngine : public Engine { private: - DreamWebConsole *_console; - bool _vSyncInterrupt; + DreamWebConsole *_console; + bool _vSyncInterrupt; + static DreamWebEngine *_instance; protected: // Engine APIs @@ -61,6 +62,7 @@ protected: public: DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc); virtual ~DreamWebEngine(); + static DreamWebEngine* instance() { return _instance; } void setVSyncInterrupt(bool flag); void waitForVSync(); @@ -71,10 +73,12 @@ public: bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); - const DreamWebGameDescription *_gameDescription; +//dreamgen public api: + uint8 randomNumber() { return _rnd.getRandomNumber(255); } - Common::RandomSource *_rnd; - +private: + const DreamWebGameDescription *_gameDescription; + Common::RandomSource _rnd; Common::Point _mouse; }; -- cgit v1.2.3 From f0b54cec1319a0d1e56e66350091732f73a47d62 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 03:01:09 +0400 Subject: DREAMWEB: fixed typo --- engines/dreamweb/dreamweb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index f2c86eb38d..d27fba2e7d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -218,7 +218,6 @@ void gettime(Context &context) { context.ch = 10; context.cl = 15; context.dh = 0; -; } void allocatemem(Context &context) { -- cgit v1.2.3 From 9e10e8e8939a0834611c37ccad5cfb382c62d899 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 03:13:06 +0400 Subject: DREAMWEB: minor cleanup --- engines/dreamweb/dreamweb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index d27fba2e7d..19e5b29024 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -214,9 +214,9 @@ void setmouse(Context &context) { } void gettime(Context &context) { - warning("gettime: stub: "); + warning("gettime: stub: 10:10:00"); context.ch = 10; - context.cl = 15; + context.cl = 10; context.dh = 0; } -- cgit v1.2.3 From a5e76d6911d29c42b810925480fd80478356fd10 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 03:23:57 +0400 Subject: DREAMWEB: cleaned up register part mess --- engines/dreamweb/runtime.h | 58 +++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index c46ac64e87..c3b4fc9398 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -11,13 +11,17 @@ namespace dreamgen { //fixme: name clash #undef random -enum { kLowPartOfRegister = 0, kHighPartOfRegister = 1 }; +struct LowPartOfRegister { + enum { Mask = 0xff }; + enum { Shift = 0 }; +}; +struct HighPartOfRegister { + enum { Mask = 0xff00 }; + enum { Shift = 8 }; +}; struct Register { - union { - uint16 _value; - uint8 _part[2]; - }; + uint16 _value; inline Register(): _value() {} inline Register& operator=(uint16 v) { _value = v; return *this; } inline operator uint16&() { return _value; } @@ -29,44 +33,46 @@ struct Register { } }; -template +template struct RegisterPart { - uint8 &_part; + typedef P PartTraits; + Register &_reg; + uint8 _value; - inline RegisterPart(Register ®) : _part(reg._part[PART]) {} + inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> PartTraits::Shift) {} inline operator uint8&() { - return _part; + return _value; } inline RegisterPart& operator=(const RegisterPart& o) { - _part = o._part; + _value = o._value; return *this; } inline RegisterPart& operator=(uint8 v) { - _part = v; + _value = v; return *this; } + inline ~RegisterPart() { + _reg._value = (_reg._value & ~PartTraits::Mask) | (_value << PartTraits::Shift); + } }; class WordRef { Common::Array &_data; unsigned _index; - bool _changed; uint16 _value; public: - inline WordRef(Common::Array &data, unsigned index) : _data(data), _index(index), _changed(false) { + inline WordRef(Common::Array &data, unsigned index) : _data(data), _index(index) { assert(index + 1 < data.size()); _value = _data[index] | (_data[index + 1] << 8); } inline WordRef& operator=(const WordRef &ref) { - _changed = true; _value = ref._value; return *this; } inline WordRef& operator=(uint16 v) { - _changed = true; _value = v; return *this; } @@ -77,10 +83,8 @@ public: return _value; } inline ~WordRef() { - if (_changed) { - _data[_index] = _value & 0xff; - _data[_index + 1] = _value >> 8; - } + _data[_index] = _value & 0xff; + _data[_index + 1] = _value >> 8; } }; @@ -185,14 +189,14 @@ public: enum { kDefaultDataSegment = 0x1000 }; Register ax, dx, bx, cx, si, di; - RegisterPart al; - RegisterPart ah; - RegisterPart bl; - RegisterPart bh; - RegisterPart cl; - RegisterPart ch; - RegisterPart dl; - RegisterPart dh; + RegisterPart al; + RegisterPart ah; + RegisterPart bl; + RegisterPart bh; + RegisterPart cl; + RegisterPart ch; + RegisterPart dl; + RegisterPart dh; SegmentRef cs, ds, es; Flags flags; -- cgit v1.2.3 From 222d9b23762d24ad3a752c8fbb9d2112cd2faeba Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 11:47:41 +0400 Subject: DREAMWEB: fixed stosw instruction --- engines/dreamweb/runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index c3b4fc9398..1d3096d48d 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -345,7 +345,7 @@ public: es.byte(di++) = al; } inline void _stosw() { - es.word(di) = al; + es.word(di) = ax; di += 2; } -- cgit v1.2.3 From f7de3e8c386293b162225829a8268565408b0e4e Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 22:52:06 +0400 Subject: DREAMWEB: simplified register part definition --- engines/dreamweb/runtime.h | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 1d3096d48d..be83686fe3 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -11,15 +11,6 @@ namespace dreamgen { //fixme: name clash #undef random -struct LowPartOfRegister { - enum { Mask = 0xff }; - enum { Shift = 0 }; -}; -struct HighPartOfRegister { - enum { Mask = 0xff00 }; - enum { Shift = 8 }; -}; - struct Register { uint16 _value; inline Register(): _value() {} @@ -33,13 +24,12 @@ struct Register { } }; -template +template struct RegisterPart { - typedef P PartTraits; Register &_reg; uint8 _value; - inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> PartTraits::Shift) {} + inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> Shift) {} inline operator uint8&() { return _value; @@ -53,9 +43,11 @@ struct RegisterPart { return *this; } inline ~RegisterPart() { - _reg._value = (_reg._value & ~PartTraits::Mask) | (_value << PartTraits::Shift); + _reg._value = (_reg._value & Mask) | (_value << Shift); } }; +typedef RegisterPart<0xff, 0> LowPartOfRegister; +typedef RegisterPart<0xff00, 8> HighPartOfRegister; class WordRef { Common::Array &_data; @@ -189,14 +181,14 @@ public: enum { kDefaultDataSegment = 0x1000 }; Register ax, dx, bx, cx, si, di; - RegisterPart al; - RegisterPart ah; - RegisterPart bl; - RegisterPart bh; - RegisterPart cl; - RegisterPart ch; - RegisterPart dl; - RegisterPart dh; + LowPartOfRegister al; + HighPartOfRegister ah; + LowPartOfRegister bl; + HighPartOfRegister bh; + LowPartOfRegister cl; + HighPartOfRegister ch; + LowPartOfRegister dl; + HighPartOfRegister dh; SegmentRef cs, ds, es; Flags flags; -- cgit v1.2.3 From 78cc82a18ce8047e703a2fbbdc6a729f760e2905 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 22:56:13 +0400 Subject: DREAMWEB: fixed typo --- engines/dreamweb/runtime.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index be83686fe3..6b330288b2 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -29,7 +29,7 @@ struct RegisterPart { Register &_reg; uint8 _value; - inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> Shift) {} + explicit inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> Shift) {} inline operator uint8&() { return _value; @@ -46,6 +46,7 @@ struct RegisterPart { _reg._value = (_reg._value & Mask) | (_value << Shift); } }; + typedef RegisterPart<0xff, 0> LowPartOfRegister; typedef RegisterPart<0xff00, 8> HighPartOfRegister; @@ -60,14 +61,17 @@ public: assert(index + 1 < data.size()); _value = _data[index] | (_data[index + 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() const { return _value; } @@ -158,7 +162,7 @@ struct Flags { inline bool l() const { return !_z && _s != _o; } inline bool le() const { return _z || _s != _o; } - inline void update_sign(uint8 v) { + inline void update(uint8 v) { bool new_s = v & 0x80; _o = new_s != _s; _s = new_s; -- cgit v1.2.3 From 27210a70b49567e1307fcf9f43558ef615daa3ac Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 00:46:36 +0400 Subject: DREAMWEB: removed useless const methods, fixed mask --- engines/dreamweb/runtime.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 6b330288b2..b6771dd1d8 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -43,7 +43,7 @@ struct RegisterPart { return *this; } inline ~RegisterPart() { - _reg._value = (_reg._value & Mask) | (_value << Shift); + _reg._value = (_reg._value & ~Mask) | (_value << Shift); } }; @@ -56,7 +56,6 @@ class WordRef { uint16 _value; public: - inline WordRef(Common::Array &data, unsigned index) : _data(data), _index(index) { assert(index + 1 < data.size()); _value = _data[index] | (_data[index + 1] << 8); @@ -72,9 +71,6 @@ public: return *this; } - inline operator uint16() const { - return _value; - } inline operator uint16&() { return _value; } @@ -96,11 +92,6 @@ struct Segment { return data[index]; } - inline uint16 word(unsigned index) const { - assert(index + 1 < data.size()); - return data[index] | (data[index + 1] << 8); - } - inline WordRef word(unsigned index) { return WordRef(data, index); } -- cgit v1.2.3 From 326d5025ccdf0af4cf580583066bc0708a0c4e74 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 00:49:32 +0400 Subject: DREAMWEB: removed const method --- engines/dreamweb/runtime.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index b6771dd1d8..8e2eeb1db8 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -120,11 +120,6 @@ public: return _segment->byte(index); } - inline uint16 word(unsigned index) const { - assert(_segment != 0); - return _segment->word(index); - } - inline operator uint16() const { return _value; } -- cgit v1.2.3 From 694c00bd10ec3daaf61445dfdc7c37f6c04a525c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:03:53 +0400 Subject: DREAMWEB: cleanups --- engines/dreamweb/runtime.h | 56 +++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 8e2eeb1db8..30bd043fd4 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -4,6 +4,7 @@ #include #include "common/scummsys.h" #include "common/array.h" +#include "common/debug.h" #include "common/hashmap.h" namespace dreamgen { @@ -51,32 +52,37 @@ typedef RegisterPart<0xff, 0> LowPartOfRegister; typedef RegisterPart<0xff00, 8> HighPartOfRegister; class WordRef { - Common::Array &_data; - unsigned _index; - uint16 _value; + uint8 *_data; + unsigned _index; + uint16 _value; public: - inline WordRef(Common::Array &data, unsigned index) : _data(data), _index(index) { + inline WordRef(Common::Array &data, unsigned index) : _data(data.begin() + index), _index(index) { assert(index + 1 < data.size()); - _value = _data[index] | (_data[index + 1] << 8); + _value = _data[0] | (_data[1] << 8); + debug(1, "word ref %d -> 0x%04x", _index, _value); } - + 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[_index] = _value & 0xff; - _data[_index + 1] = _value >> 8; + debug(1, "writing %d -> 0x%04x", _index, _value); + _data[0] = _value & 0xff; + _data[1] = _value >> 8; + _value = _data[0] | (_data[1] << 8); + debug(1, "word ref result %d -> 0x%04x", _index, _value); } }; @@ -189,13 +195,13 @@ public: ds.reset(kDefaultDataSegment); es.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 = kDefaultDataSegment + _segments.size(); assert(!_segments.contains(id)); @@ -203,39 +209,45 @@ public: seg.data.resize(size); return SegmentRef(this, id, &seg); } - + inline void _cmp(uint8 a, uint8 b) { uint8 x = a; _sub(x, b); } + inline void _cmp(uint16 a, uint16 b) { uint16 x = a; _sub(x, b); } + inline void _test(uint8 a, uint8 b) { uint8 x = a; _and(x, b); } + inline void _test(uint16 a, uint16 b) { uint16 x = a; _and(x, b); } - + inline void _add(uint8 &dst, uint8 src) { flags._c = dst + src < dst; dst += src; flags.update(dst); } + inline void _add(uint16 &dst, uint16 src) { flags._c = dst + src < dst; dst += src; flags.update(dst); } + inline void _sub(uint8 &dst, uint8 src) { flags._c = dst < src; dst -= src; flags.update(dst); } + inline void _sub(uint16 &dst, uint16 src) { flags._c = dst < src; dst -= src; @@ -247,16 +259,19 @@ public: flags._c = false; flags.update(dst); } + inline void _and(uint16 &dst, uint16 src) { dst &= src; flags._c = false; flags.update(dst); } + inline void _or(uint8 &dst, uint8 src) { dst |= src; flags._c = false; flags.update(dst); } + inline void _or(uint16 &dst, uint16 src) { dst |= src; flags._c = false; @@ -268,6 +283,7 @@ public: flags._c = false; flags.update(dst); } + inline void _xor(uint16 &dst, uint16 src) { dst ^= src; flags._c = false; @@ -278,6 +294,7 @@ public: inline void _shr(uint16 &dst, uint8 src) {} inline void _shl(uint8 &dst, uint8 src) {} inline void _shl(uint16 &dst, uint8 src) {} + inline void _mul(uint8 src) { unsigned r = unsigned(al) * src; ax = (uint16)r; @@ -287,6 +304,7 @@ public: flags._o = s != flags._s; flags._s = s; } + inline void _mul(uint16 src) { unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits dx = (r >> 16) & 0xffff; @@ -297,11 +315,13 @@ public: flags._o = s != flags._s; flags._s = s; } + inline void _neg(uint8 &src) { src = ~src; flags._c = false; flags.update(src); } + inline void _neg(uint16 &src) { src = ~src; flags._c = false; @@ -311,26 +331,31 @@ public: inline void _movsb() { es.byte(di++) = ds.byte(si++); } + inline void _movsw() { es.word(di) = ds.word(si); di += 2; si += 2; } + inline void _lodsb() { al = ds.byte(si++); } + inline void _lodsw() { ax = ds.word(si); si += 2; } + inline void _stosb() { es.byte(di++) = al; } + inline void _stosw() { es.word(di) = ax; di += 2; } - + inline void _xchg(uint16 &a, uint16 &b) { uint16 x = a; a = b; @@ -347,6 +372,7 @@ public: inline void push(uint16 v) { stack.push_back(v); } + inline uint16 pop() { uint16 v = stack.back(); stack.pop_back(); -- cgit v1.2.3 From bba7724aec6b6b440e166fdd95b65be5346977c1 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:12:50 +0400 Subject: DREAMWEB: added fake data register pointing to variables --- devtools/tasmrecover/tasm/cpp.py | 2 +- engines/dreamweb/dreamgen.cpp | 6828 +++++++++++++++++++------------------- engines/dreamweb/runtime.h | 10 +- 3 files changed, 3420 insertions(+), 3420 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index a8d225359b..1e77893f89 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -63,7 +63,7 @@ namespace %s { if size == 0: raise Exception("invalid var '%s' size %u" %(name, size)) if self.indirection == 0: - value = "context.ds.%s(%d)" %("byte" if size == 1 else "word", g.offset) + value = "context.data.%s(%d)" %("byte" if size == 1 else "word", g.offset) elif self.indirection == -1: value = "%s" %g.offset self.indirection = 0 diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index bf996f8353..ef05c31e87 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -514,9 +514,9 @@ nofog: static void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; - context._cmp(context.ds.byte(52), 1); + context._cmp(context.data.byte(52), 1); if (!context.flags.z()) goto notsetcard; - context._add(context.ds.byte(52), 1); + context._add(context.data.byte(52), 1); context.ds.byte(context.bx+7) = 1; context.ds.word(context.bx+3) = 64; notsetcard: @@ -548,13 +548,13 @@ gotrecep: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedrecep; - context.ds.byte(51) = 1; + context.data.byte(51) = 1; nottalkedrecep: return; } static void smokebloke(Context & context) { - context._cmp(context.ds.byte(41), 0); + context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notspokento; context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); @@ -594,7 +594,7 @@ static void attendant(Context & context) { context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalked; - context.ds.byte(48) = 1; + context.data.byte(48) = 1; nottalked: return; } @@ -609,7 +609,7 @@ static void manasleep(Context & context) { } static void eden(Context & context) { - context._cmp(context.ds.byte(42), 0); + context._cmp(context.data.byte(42), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); @@ -618,9 +618,9 @@ notinbed: } static void edeninbath(Context & context) { - context._cmp(context.ds.byte(42), 0); + context._cmp(context.data.byte(42), 0); if (context.flags.z()) goto notinbed; - context._cmp(context.ds.byte(43), 0); + context._cmp(context.data.byte(43), 0); if (!context.flags.z()) goto notinbath; showgamereel(context); addtopeoplelist(context); @@ -645,7 +645,7 @@ static void femalefan(Context & context) { } static void louis(Context & context) { - context._cmp(context.ds.byte(41), 0); + context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); @@ -654,7 +654,7 @@ notlouis1: } static void louischair(Context & context) { - context._cmp(context.ds.byte(41), 0); + context._cmp(context.data.byte(41), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); if (!context.flags.z()) goto notlouisanim; @@ -742,7 +742,7 @@ notsmoket2: context._add(context.ds.word(context.bx+3), 1); gotsmoket: showgamereel(context); - context._cmp(context.ds.byte(46), 1); + context._cmp(context.data.byte(46), 1); if (!context.flags.z()) goto notgotgun; context.ds.byte(context.bx+7) = 9; notgotgun: @@ -763,7 +763,7 @@ static void barwoman(Context & context) { } static void interviewer(Context & context) { - context._cmp(context.ds.word(23), 68); + context._cmp(context.data.word(23), 68); if (!context.flags.z()) goto notgeneralstart; context._add(context.ds.word(context.bx+3), 1); notgeneralstart: @@ -782,13 +782,13 @@ talking: static void soldier1(Context & context) { context._cmp(context.ds.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; - context.ds.word(21) = 10; + context.data.word(21) = 10; context._cmp(context.ds.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 40); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); if (!context.flags.z()) goto gotsoldframe; - context.ds.byte(56) = 2; + context.data.byte(56) = 2; goto gotsoldframe; notaftersshot: checkspeed(context); @@ -796,16 +796,16 @@ notaftersshot: context._add(context.ds.word(context.bx+3), 1); goto gotsoldframe; soldierwait: - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto gotsoldframe; - context.ds.word(21) = 10; - context._cmp(context.ds.byte(475), 2); + context.data.word(21) = 10; + context._cmp(context.data.byte(475), 2); if (!context.flags.z()) goto gotsoldframe; - context._cmp(context.ds.byte(133), 4); + context._cmp(context.data.byte(133), 4); if (!context.flags.z()) goto gotsoldframe; context._add(context.ds.word(context.bx+3), 1); - context.ds.byte(65) = -1; - context.ds.byte(64) = 0; + context.data.byte(65) = -1; + context.data.byte(64) = 0; gotsoldframe: showgamereel(context); addtopeoplelist(context); @@ -824,22 +824,22 @@ static void rockstar(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; - context.ds.byte(56) = 2; + context.data.byte(56) = 2; goto gotrockframe; notbeforedead: context._cmp(context.ax, 79); if (!context.flags.z()) goto gotrockframe; context._sub(context.ax, 1); - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto notgunonrock; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context.ax = 123; goto gotrockframe; notgunonrock: - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 40); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); if (!context.flags.z()) goto gotrockframe; - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.ax = 79; gotrockframe: context.ds.word(context.bx+3) = context.ax; @@ -848,17 +848,17 @@ rockspeed: context._cmp(context.ds.word(context.bx+3), 78); if (!context.flags.z()) goto notalkrock; addtopeoplelist(context); - context.ds.byte(234) = 2; - context.ds.word(21) = 0; + context.data.byte(234) = 2; + context.data.word(21) = 0; return; notalkrock: - context.ds.word(21) = 2; - context.ds.byte(234) = 0; - context.al = context.ds.byte(149); + context.data.word(21) = 2; + context.data.byte(234) = 0; + context.al = context.data.byte(149); context.ds.byte(context.bx+2) = context.al; return; rockcombatend: - context.ds.byte(188) = 45; + context.data.byte(188) = 45; showgamereel(context); return; } @@ -873,10 +873,10 @@ static void helicopter(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 8); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 8); if (context.flags.c()) goto waitabit; - context.ds.byte(56) = 2; + context.data.byte(56) = 2; waitabit: context.ax = 49; goto gotheliframe; @@ -884,39 +884,39 @@ notbeforehdead: context._cmp(context.ax, 9); if (!context.flags.z()) goto gotheliframe; context._sub(context.ax, 1); - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto notgunonheli; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context.ax = 55; goto gotheliframe; notgunonheli: context.ax = 5; - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 20); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 20); if (!context.flags.z()) goto gotheliframe; - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.ax = 9; gotheliframe: context.ds.word(context.bx+3) = context.ax; helispeed: showgamereel(context); - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context.ds.byte(context.bx+1) = context.al; helicombatend: context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; - context._cmp(context.ds.byte(64), 7); + context._cmp(context.data.byte(64), 7); if (context.flags.c()) goto notwaitingheli; - context.ds.byte(234) = 2; - context.ds.word(21) = 0; + context.data.byte(234) = 2; + context.data.word(21) = 0; return; notwaitingheli: - context.ds.byte(234) = 0; - context.ds.word(21) = 2; + context.data.byte(234) = 0; + context.data.word(21) = 2; return; heliwon: - context.ds.byte(234) = 0; + context.data.byte(234) = 0; return; } @@ -928,14 +928,14 @@ static void mugger(Context & context) { if (context.flags.z()) goto endmugger2; context._cmp(context.ax, 2); if (!context.flags.z()) goto havesetwatch; - context.ds.word(21) = 175*2; + context.data.word(21) = 175*2; havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; context._add(context.ds.word(context.bx+3), 1); notmugger: showgamereel(context); - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context.ds.byte(context.bx+1) = context.al; return; endmugger1: @@ -958,25 +958,25 @@ endmugger1: context.push(context.es); context.push(context.bx); context.ds.word(context.bx+3) = 140; - context.ds.byte(475) = 2; - context.ds.byte(477) = 2; + context.data.byte(475) = 2; + context.data.byte(477) = 2; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'A'; findexobject(context); - context.ds.byte(99) = context.al; - context.ds.byte(102) = 4; + context.data.byte(99) = context.al; + context.data.byte(102) = 4; removeobfrominv(context); context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'B'; findexobject(context); - context.ds.byte(99) = context.al; - context.ds.byte(102) = 4; + context.data.byte(99) = context.al; + context.data.byte(102) = 4; removeobfrominv(context); makemainscreen(context); context.al = 48; @@ -985,7 +985,7 @@ endmugger1: context.cx = 70; context.dx = 10; setuptimeduse(context); - context.ds.byte(45) = 1; + context.data.byte(45) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -1000,8 +1000,8 @@ static void aide(Context & context) { } static void businessman(Context & context) { - context.ds.byte(234) = 0; - context.ds.word(21) = 2; + context.data.byte(234) = 0; + context.data.word(21) = 2; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 2); if (!context.flags.z()) goto notfirstbiz; @@ -1028,23 +1028,23 @@ notfirstbiz: context._add(context.ax, 1); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; - context.ds.byte(56) = 2; + context.data.byte(56) = 2; goto gotbusframe; notbeforedeadb: context._cmp(context.ax, 15); if (!context.flags.z()) goto buscombatwon; context._sub(context.ax, 1); - context._cmp(context.ds.byte(65), 3); + context._cmp(context.data.byte(65), 3); if (!context.flags.z()) goto notshieldonbus; - context.ds.byte(65) = -1; - context.ds.byte(64) = 0; + context.data.byte(65) = -1; + context.data.byte(64) = 0; context.ax = 51; goto gotbusframe; notshieldonbus: - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 20); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 20); if (!context.flags.z()) goto gotbusframe; - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.ax = 15; goto gotbusframe; buscombatwon: @@ -1060,10 +1060,10 @@ buscombatwon: turnpathon(context); context.al = 3; turnpathoff(context); - context.ds.byte(475) = 5; - context.ds.byte(477) = 5; + context.data.byte(475) = 5; + context.data.byte(477) = 5; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; context.es = context.pop(); context.bx = context.pop(); context.ax = 92; @@ -1072,19 +1072,19 @@ gotbusframe: context.ds.word(context.bx+3) = context.ax; busspeed: showgamereel(context); - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ds.byte(context.bx+2) = context.al; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) goto buscombatend; - context.ds.word(21) = 0; - context.ds.byte(234) = 2; + context.data.word(21) = 0; + context.data.byte(234) = 2; return; buscombatend: return; buscombatwonend: - context.ds.byte(234) = 0; - context.ds.word(21) = 0; + context.data.byte(234) = 0; + context.data.word(21) = 0; return; } @@ -1108,32 +1108,32 @@ notfirstpool: context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; context._sub(context.ax, 1); - context._cmp(context.ds.byte(65), 2); + context._cmp(context.data.byte(65), 2); if (!context.flags.z()) goto notaxeonpool; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 40); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); if (!context.flags.z()) goto gotguardframe; - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.ax = 195; goto gotguardframe; notendguard1: context._cmp(context.ax, 147); if (!context.flags.z()) goto gotguardframe; context._sub(context.ax, 1); - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto notgunonpool; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context.ax = 147; goto gotguardframe; notgunonpool: - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 40); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 40); if (!context.flags.z()) goto gotguardframe; - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.ax = 220; gotguardframe: context.ds.word(context.bx+3) = context.ax; @@ -1144,16 +1144,16 @@ guardspeed: if (context.flags.z()) goto iswaitingpool; context._cmp(context.ax, 146); if (context.flags.z()) goto iswaitingpool; - context.ds.byte(234) = 0; - context.ds.word(21) = 2; + context.data.byte(234) = 0; + context.data.word(21) = 2; return; iswaitingpool: - context.ds.byte(234) = 2; - context.ds.word(21) = 0; + context.data.byte(234) = 2; + context.data.word(21) = 0; return; combatover1: - context.ds.word(21) = 0; - context.ds.byte(234) = 0; + context.data.word(21) = 0; + context.data.byte(234) = 0; context.al = 0; turnpathon(context); context.al = 1; @@ -1161,13 +1161,13 @@ combatover1: return; combatover2: showgamereel(context); - context.ds.word(21) = 2; - context.ds.byte(234) = 0; - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 100); + context.data.word(21) = 2; + context.data.byte(234) = 0; + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 100); if (context.flags.c()) goto doneover2; - context.ds.word(21) = 0; - context.ds.byte(56) = 2; + context.data.word(21) = 0; + context.data.byte(56) = 2; doneover2: return; } @@ -1179,20 +1179,20 @@ static void security(Context & context) { if (!context.flags.z()) goto notaftersec; return; notaftersec: - context.ds.word(21) = 10; + context.data.word(21) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; context._add(context.ds.word(context.bx+3), 1); goto gotsecurframe; securwait: - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto gotsecurframe; - context.ds.word(21) = 10; - context._cmp(context.ds.byte(475), 9); + context.data.word(21) = 10; + context._cmp(context.data.byte(475), 9); if (!context.flags.z()) goto gotsecurframe; - context._cmp(context.ds.byte(133), 0); + context._cmp(context.data.byte(133), 0); if (!context.flags.z()) goto gotsecurframe; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context._add(context.ds.word(context.bx+3), 1); gotsecurframe: showgamereel(context); @@ -1206,13 +1206,13 @@ static void heavy(Context & context) { context.ds.byte(context.bx+7) = context.al; context._cmp(context.ds.word(context.bx+3), 43); if (context.flags.z()) goto heavywait; - context.ds.word(21) = 10; + context.data.word(21) = 10; context._cmp(context.ds.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; - context._add(context.ds.byte(64), 1); - context._cmp(context.ds.byte(64), 80); + context._add(context.data.byte(64), 1); + context._cmp(context.data.byte(64), 80); if (!context.flags.z()) goto gotheavyframe; - context.ds.byte(56) = 2; + context.data.byte(56) = 2; goto gotheavyframe; notafterhshot: checkspeed(context); @@ -1220,15 +1220,15 @@ notafterhshot: context._add(context.ds.word(context.bx+3), 1); goto gotheavyframe; heavywait: - context._cmp(context.ds.byte(65), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.ds.byte(475), 5); + context._cmp(context.data.byte(475), 5); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.ds.byte(133), 4); + context._cmp(context.data.byte(133), 4); if (!context.flags.z()) goto gotheavyframe; - context.ds.byte(65) = -1; + context.data.byte(65) = -1; context._add(context.ds.word(context.bx+3), 1); - context.ds.byte(64) = 0; + context.data.byte(64) = 0; gotheavyframe: showgamereel(context); addtopeoplelist(context); @@ -1247,11 +1247,11 @@ static void bossman(Context & context) { context._cmp(context.ax, 41); if (!context.flags.z()) goto gotallboss; context.ax = 0; - context._add(context.ds.byte(46), 1); + context._add(context.data.byte(46), 1); context.ds.byte(context.bx+7) = 10; goto gotallboss; firstdes: - context._cmp(context.ds.byte(46), 1); + context._cmp(context.data.byte(46), 1); if (context.flags.z()) goto gotallboss; context.push(context.ax); randomnumber(context); @@ -1262,7 +1262,7 @@ firstdes: context.ax = 0; goto gotallboss; secdes: - context._cmp(context.ds.byte(46), 1); + context._cmp(context.data.byte(46), 1); if (context.flags.z()) goto gotallboss; context.ax = 0; gotallboss: @@ -1273,7 +1273,7 @@ notboss: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedboss; - context.ds.byte(50) = 1; + context.data.byte(50) = 1; nottalkedboss: return; } @@ -1317,16 +1317,16 @@ cantdrip2: } static void keeper(Context & context) { - context._cmp(context.ds.byte(54), 0); + context._cmp(context.data.byte(54), 0); if (!context.flags.z()) goto notwaiting; - context._cmp(context.ds.word(23), 190); + context._cmp(context.data.word(23), 190); if (context.flags.c()) goto waiting; - context._add(context.ds.byte(54), 1); + context._add(context.data.byte(54), 1); context.ah = context.ds.byte(context.bx+7); context._and(context.ah, 127); - context._cmp(context.ah, context.ds.byte(66)); + context._cmp(context.ah, context.data.byte(66)); if (context.flags.z()) goto notdiff; - context.al = context.ds.byte(66); + context.al = context.data.byte(66); context.ds.byte(context.bx+7) = context.al; notdiff: return; @@ -1379,16 +1379,16 @@ gotintrom1: context.ds.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; - context._add(context.ds.byte(139), 1); + context._add(context.data.byte(139), 1); context.push(context.es); context.push(context.bx); intro1text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.ds.byte(139), 8); + context._cmp(context.data.byte(139), 8); if (!context.flags.z()) goto introm1fin; - context._add(context.ds.byte(149), 10); - context.ds.byte(186) = 1; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; introm1fin: showgamereel(context); return; @@ -1446,7 +1446,7 @@ notbang: slowgates: context._cmp(context.ax, 120); if (!context.flags.z()) goto gotgates; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; context.ax = 119; gotgates: context.ds.word(context.bx+3) = context.ax; @@ -1482,12 +1482,12 @@ static void intromagic3(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; gotintrom3: context.ds.word(context.bx+3) = context.ax; introm3fin: showgamereel(context); - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context.ds.byte(context.bx+1) = context.al; return; } @@ -1499,15 +1499,15 @@ static void intromonks1(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; - context._add(context.ds.byte(149), 10); - context.ds.byte(186) = 1; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; showgamereel(context); return; notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; - context._sub(context.ds.byte(149), 10); - context.ds.byte(186) = 1; + context._sub(context.data.byte(149), 10); + context.data.byte(186) = 1; context.ax = 51; gotintromonk1: context.ds.word(context.bx+3) = context.ax; @@ -1531,7 +1531,7 @@ waitstep: context.ds.byte(context.bx+6) = -20; intromonk1fin: showgamereel(context); - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ds.byte(context.bx+2) = context.al; return; } @@ -1543,13 +1543,13 @@ static void intromonks2(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; - context._add(context.ds.byte(139), 1); + context._add(context.data.byte(139), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.ds.byte(139), 19); + context._cmp(context.data.byte(139), 19); if (!context.flags.z()) goto notlasttalk1; context.ax = 87; goto gotintromonk2; @@ -1559,13 +1559,13 @@ notlasttalk1: nottalk1: context._cmp(context.ax, 110); if (!context.flags.z()) goto notraisearm; - context._add(context.ds.byte(139), 1); + context._add(context.data.byte(139), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.ds.byte(139), 35); + context._cmp(context.data.byte(139), 35); if (!context.flags.z()) goto notlastraise; context.ax = 111; goto gotintromonk2; @@ -1575,7 +1575,7 @@ notlastraise: notraisearm: context._cmp(context.ax, 176); if (!context.flags.z()) goto notendmonk2; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; goto gotintromonk2; notendmonk2: context._cmp(context.ax, 125); @@ -1593,7 +1593,7 @@ static void handclap(Context & context) { } static void monks2text(Context & context) { - context._cmp(context.ds.byte(139), 1); + context._cmp(context.data.byte(139), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; context.bl = 36; @@ -1601,7 +1601,7 @@ static void monks2text(Context & context) { context.cx = 100; goto gotmonks2text; notmonk2text1: - context._cmp(context.ds.byte(139), 4); + context._cmp(context.data.byte(139), 4); if (!context.flags.z()) goto notmonk2text2; context.al = 9; context.bl = 36; @@ -1609,7 +1609,7 @@ notmonk2text1: context.cx = 100; goto gotmonks2text; notmonk2text2: - context._cmp(context.ds.byte(139), 7); + context._cmp(context.data.byte(139), 7); if (!context.flags.z()) goto notmonk2text3; context.al = 10; context.bl = 36; @@ -1617,7 +1617,7 @@ notmonk2text2: context.cx = 100; goto gotmonks2text; notmonk2text3: - context._cmp(context.ds.byte(139), 10); + context._cmp(context.data.byte(139), 10); if (!context.flags.z()) goto notmonk2text4; context.al = 11; context.bl = 0; @@ -1625,7 +1625,7 @@ notmonk2text3: context.cx = 100; goto gotmonks2text; notmonk2text4: - context._cmp(context.ds.byte(139), 13); + context._cmp(context.data.byte(139), 13); if (!context.flags.z()) goto notmonk2text5; context.al = 12; context.bl = 0; @@ -1633,7 +1633,7 @@ notmonk2text4: context.cx = 100; goto gotmonks2text; notmonk2text5: - context._cmp(context.ds.byte(139), 16); + context._cmp(context.data.byte(139), 16); if (!context.flags.z()) goto notmonk2text6; context.al = 13; context.bl = 0; @@ -1641,7 +1641,7 @@ notmonk2text5: context.cx = 100; goto gotmonks2text; notmonk2text6: - context._cmp(context.ds.byte(139), 19); + context._cmp(context.data.byte(139), 19); if (!context.flags.z()) goto notmonk2text7; context.al = 14; context.bl = 36; @@ -1651,7 +1651,7 @@ notmonk2text6: context.ah = 82; { setuptimedtemp(context); return; }; notmonk2text7: - context._cmp(context.ds.byte(139), 22); + context._cmp(context.data.byte(139), 22); if (!context.flags.z()) goto notmonk2text8; context.al = 15; context.bl = 36; @@ -1659,7 +1659,7 @@ notmonk2text7: context.cx = 100; goto gotmonks2text; notmonk2text8: - context._cmp(context.ds.byte(139), 25); + context._cmp(context.data.byte(139), 25); if (!context.flags.z()) goto notmonk2text9; context.al = 16; context.bl = 36; @@ -1667,7 +1667,7 @@ notmonk2text8: context.cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.ds.byte(139), 28); + context._cmp(context.data.byte(139), 28); if (!context.flags.z()) goto notmonk2text10; context.al = 17; context.bl = 36; @@ -1675,7 +1675,7 @@ notmonk2text9: context.cx = 100; goto gotmonks2text; notmonk2text10: - context._cmp(context.ds.byte(139), 31); + context._cmp(context.data.byte(139), 31); if (!context.flags.z()) goto notmonk2text11; context.al = 18; context.bl = 36; @@ -1693,7 +1693,7 @@ gotmonks2text: } static void intro1text(Context & context) { - context._cmp(context.ds.byte(139), 2); + context._cmp(context.data.byte(139), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; context.bl = 34; @@ -1701,7 +1701,7 @@ static void intro1text(Context & context) { context.cx = 90; goto gotintro1text; notintro1text1: - context._cmp(context.ds.byte(139), 4); + context._cmp(context.data.byte(139), 4); if (!context.flags.z()) goto notintro1text2; context.al = 41; context.bl = 34; @@ -1709,7 +1709,7 @@ notintro1text1: context.cx = 90; goto gotintro1text; notintro1text2: - context._cmp(context.ds.byte(139), 6); + context._cmp(context.data.byte(139), 6); if (!context.flags.z()) goto notintro1text3; context.al = 42; context.bl = 34; @@ -1783,16 +1783,16 @@ static void monkandryan(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; - context._add(context.ds.byte(139), 1); + context._add(context.data.byte(139), 1); context.push(context.es); context.push(context.bx); textformonk(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 77; - context._cmp(context.ds.byte(139), 57); + context._cmp(context.data.byte(139), 57); if (!context.flags.z()) goto gotmonkryan; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; gotmonkryan: context.ds.word(context.bx+3) = context.ax; @@ -1808,9 +1808,9 @@ static void endgameseq(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; - context._cmp(context.ds.byte(139), 140); + context._cmp(context.data.byte(139), 140); if (context.flags.z()) goto gotendseq; - context._add(context.ds.byte(139), 1); + context._add(context.data.byte(139), 1); context.push(context.es); context.push(context.bx); textforend(context); @@ -1836,18 +1836,18 @@ notfadedown: context.push(context.bx); context.push(context.ax); fadescreendowns(context); - context.ds.byte(387) = 7; - context.ds.byte(388) = 1; + context.data.byte(387) = 7; + context.data.byte(388) = 1; context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); notfadeend: context._cmp(context.ax, 340); if (!context.flags.z()) goto notendseq; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; notendseq: showgamereel(context); - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ds.byte(context.bx+2) = context.al; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 145); @@ -1862,17 +1862,17 @@ static void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); - context.ds.byte(386) = 7; - context.ds.byte(387) = 0; - context.ds.byte(388) = -1; + context.data.byte(386) = 7; + context.data.byte(387) = 0; + context.data.byte(388) = -1; context.cl = 160; context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiget(context); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.si = 3*2; context.ax = context.ds.word(context.si); context.si = context.ax; @@ -1881,7 +1881,7 @@ static void rollendcredits(Context & context) { endcredits1: context.push(context.cx); context.bx = 10; - context.cx = context.ds.word(77); + context.cx = context.data.word(77); endcredits2: context.push(context.cx); context.push(context.si); @@ -1893,7 +1893,7 @@ endcredits2: context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiput(context); vsync(context); @@ -1912,7 +1912,7 @@ onelot: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.ds.word(77)); + context._add(context.bx, context.data.word(77)); context.cx = context.pop(); if (--context.cx) goto onelot; vsync(context); @@ -1949,8 +1949,8 @@ gotnext: static void priest(Context & context) { context._cmp(context.ds.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; - context.ds.byte(234) = 0; - context.ds.word(21) = 2; + context.data.byte(234) = 0; + context.data.word(21) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; context._add(context.ds.word(context.bx+3), 1); @@ -1978,7 +1978,7 @@ notendtelly: } static void madman(Context & context) { - context.ds.word(21) = 2; + context.data.word(21) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; context.ax = context.ds.word(context.bx+3); @@ -1994,30 +1994,30 @@ static void madman(Context & context) { context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); - context.ds.byte(64) = -1; - context.ds.byte(69) = 0; + context.data.byte(64) = -1; + context.data.byte(69) = 0; notfirstmad: context._add(context.ax, 1); context._cmp(context.ax, 294); if (context.flags.z()) goto madmanspoken; context._cmp(context.ax, 66); if (!context.flags.z()) goto nomadspeak; - context._add(context.ds.byte(64), 1); + context._add(context.data.byte(64), 1); context.push(context.es); context.push(context.bx); madmantext(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 53; - context._cmp(context.ds.byte(64), 62); + context._cmp(context.data.byte(64), 62); if (context.flags.c()) goto nomadspeak; - context._cmp(context.ds.byte(64), 68); + context._cmp(context.data.byte(64), 68); if (context.flags.z()) goto killryan; - context._cmp(context.ds.byte(65), 8); + context._cmp(context.data.byte(65), 8); if (!context.flags.z()) goto nomadspeak; - context.ds.byte(64) = 70; - context.ds.byte(65) = -1; - context.ds.byte(53) = 1; + context.data.byte(64) = 70; + context.data.byte(65) = -1; + context.data.byte(53) = 1; context.ax = 67; goto nomadspeak; killryan: @@ -2026,14 +2026,14 @@ nomadspeak: context.ds.word(context.bx+3) = context.ax; nomadspeed: showgamereel(context); - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context.ds.byte(context.bx+1) = context.al; madmode(context); return; madmanspoken: - context._cmp(context.ds.byte(391), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto alreadywon; - context.ds.byte(391) = 1; + context.data.byte(391) = 1; context.push(context.es); context.push(context.bx); getridoftemptext(context); @@ -2042,18 +2042,18 @@ madmanspoken: alreadywon: return; ryansded: - context.ds.byte(56) = 2; + context.data.byte(56) = 2; showgamereel(context); return; } static void madmantext(Context & context) { - context._cmp(context.ds.byte(64), 61); + context._cmp(context.data.byte(64), 61); if (!context.flags.c()) goto nomadtext; - context.al = context.ds.byte(64); + context.al = context.data.byte(64); context._and(context.al, 3); if (!context.flags.z()) goto nomadtext; - context.al = context.ds.byte(64); + context.al = context.data.byte(64); context._shr(context.al, 1); context._shr(context.al, 1); context._add(context.al, 47); @@ -2068,13 +2068,13 @@ nomadtext: } static void madmode(Context & context) { - context.ds.word(21) = 2; - context.ds.byte(234) = 0; - context._cmp(context.ds.byte(64), 63); + context.data.word(21) = 2; + context.data.byte(234) = 0; + context._cmp(context.data.byte(64), 63); if (context.flags.c()) goto iswatchmad; - context._cmp(context.ds.byte(64), 68); + context._cmp(context.data.byte(64), 68); if (!context.flags.c()) goto iswatchmad; - context.ds.byte(234) = 2; + context.data.byte(234) = 2; iswatchmad: return; } @@ -2100,7 +2100,7 @@ nopriesttext: } static void textforend(Context & context) { - context._cmp(context.ds.byte(139), 20); + context._cmp(context.data.byte(139), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; context.bl = 34; @@ -2108,7 +2108,7 @@ static void textforend(Context & context) { context.cx = 60; goto gotendtext; notendtext1: - context._cmp(context.ds.byte(139), 65); + context._cmp(context.data.byte(139), 65); if (!context.flags.z()) goto notendtext2; context.al = 1; context.bl = 34; @@ -2116,7 +2116,7 @@ notendtext1: context.cx = 60; goto gotendtext; notendtext2: - context._cmp(context.ds.byte(139), 110); + context._cmp(context.data.byte(139), 110); if (!context.flags.z()) goto notendtext3; context.al = 2; context.bl = 34; @@ -2133,7 +2133,7 @@ gotendtext: } static void textformonk(Context & context) { - context._cmp(context.ds.byte(139), 1); + context._cmp(context.data.byte(139), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; context.bl = 68; @@ -2141,7 +2141,7 @@ static void textformonk(Context & context) { context.cx = 120; goto gotmonktext; notmonktext1: - context._cmp(context.ds.byte(139), 5); + context._cmp(context.data.byte(139), 5); if (!context.flags.z()) goto notmonktext2; context.al = 20; context.bl = 68; @@ -2149,7 +2149,7 @@ notmonktext1: context.cx = 120; goto gotmonktext; notmonktext2: - context._cmp(context.ds.byte(139), 9); + context._cmp(context.data.byte(139), 9); if (!context.flags.z()) goto notmonktext3; context.al = 21; context.bl = 48; @@ -2157,7 +2157,7 @@ notmonktext2: context.cx = 120; goto gotmonktext; notmonktext3: - context._cmp(context.ds.byte(139), 13); + context._cmp(context.data.byte(139), 13); if (!context.flags.z()) goto notmonktext4; context.al = 22; context.bl = 68; @@ -2165,7 +2165,7 @@ notmonktext3: context.cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.ds.byte(139), 17); + context._cmp(context.data.byte(139), 17); if (!context.flags.z()) goto notmonktext5; context.al = 23; context.bl = 68; @@ -2173,7 +2173,7 @@ notmonktext4: context.cx = 120; goto gotmonktext; notmonktext5: - context._cmp(context.ds.byte(139), 21); + context._cmp(context.data.byte(139), 21); if (!context.flags.z()) goto notmonktext6; context.al = 24; context.bl = 68; @@ -2181,7 +2181,7 @@ notmonktext5: context.cx = 120; goto gotmonktext; notmonktext6: - context._cmp(context.ds.byte(139), 25); + context._cmp(context.data.byte(139), 25); if (!context.flags.z()) goto notmonktext7; context.al = 25; context.bl = 68; @@ -2189,7 +2189,7 @@ notmonktext6: context.cx = 120; goto gotmonktext; notmonktext7: - context._cmp(context.ds.byte(139), 29); + context._cmp(context.data.byte(139), 29); if (!context.flags.z()) goto notmonktext8; context.al = 26; context.bl = 68; @@ -2197,7 +2197,7 @@ notmonktext7: context.cx = 120; goto gotmonktext; notmonktext8: - context._cmp(context.ds.byte(139), 33); + context._cmp(context.data.byte(139), 33); if (!context.flags.z()) goto notmonktext9; context.al = 27; context.bl = 68; @@ -2205,7 +2205,7 @@ notmonktext8: context.cx = 120; goto gotmonktext; notmonktext9: - context._cmp(context.ds.byte(139), 37); + context._cmp(context.data.byte(139), 37); if (!context.flags.z()) goto notmonktext10; context.al = 28; context.bl = 68; @@ -2213,7 +2213,7 @@ notmonktext9: context.cx = 120; goto gotmonktext; notmonktext10: - context._cmp(context.ds.byte(139), 41); + context._cmp(context.data.byte(139), 41); if (!context.flags.z()) goto notmonktext11; context.al = 29; context.bl = 68; @@ -2221,7 +2221,7 @@ notmonktext10: context.cx = 120; goto gotmonktext; notmonktext11: - context._cmp(context.ds.byte(139), 45); + context._cmp(context.data.byte(139), 45); if (!context.flags.z()) goto notmonktext12; context.al = 30; context.bl = 68; @@ -2229,7 +2229,7 @@ notmonktext11: context.cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.ds.byte(139), 49); + context._cmp(context.data.byte(139), 49); if (!context.flags.z()) goto notmonktext13; context.al = 31; context.bl = 68; @@ -2237,7 +2237,7 @@ notmonktext12: context.cx = 220; goto gotmonktext; notmonktext13: - context._cmp(context.ds.byte(139), 53); + context._cmp(context.data.byte(139), 53); if (!context.flags.z()) goto notendtitles; fadescreendowns(context); notendtitles: @@ -2251,7 +2251,7 @@ oktalk: } static void drunk(Context & context) { - context._cmp(context.ds.byte(42), 0); + context._cmp(context.data.byte(42), 0); if (!context.flags.z()) goto trampgone; context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); @@ -2321,7 +2321,7 @@ nocopper: } static void sparky(Context & context) { - context._cmp(context.ds.word(16), 0); + context._cmp(context.data.word(16), 0); if (context.flags.z()) goto animsparky; context.ds.byte(context.bx+7) = 3; goto animsparky; @@ -2348,7 +2348,7 @@ finishsparky: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedsparky; - context.ds.byte(49) = 1; + context.data.byte(49) = 1; nottalkedsparky: return; } @@ -2364,9 +2364,9 @@ notrainyet: randomnumber(context); context._cmp(context.al, 253); if (context.flags.c()) goto notrainatall; - context._cmp(context.ds.byte(475), 5); + context._cmp(context.data.byte(475), 5); if (!context.flags.z()) goto notrainatall; - context._cmp(context.ds.byte(477), 5); + context._cmp(context.data.byte(477), 5); if (!context.flags.z()) goto notrainatall; context.ax = 5; gottrainframe: @@ -2382,15 +2382,15 @@ static void addtopeoplelist(Context & context) { context.push(context.bx); context.cl = context.ds.byte(context.bx+7); context.ax = context.ds.word(context.bx+3); - context.bx = context.ds.word(18); - context.es = context.ds.word(412); + context.bx = context.data.word(18); + context.es = context.data.word(412); context.ds.word(context.bx) = context.ax; context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; context.ds.byte(context.bx+4) = context.cl; context.bx = context.pop(); context.es = context.pop(); - context._add(context.ds.word(18), 5); + context._add(context.data.word(18), 5); return; } @@ -2398,20 +2398,20 @@ static void showgamereel(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; - context.ds.word(239) = context.ax; + context.data.word(239) = context.ax; context.push(context.es); context.push(context.bx); plotreel(context); context.bx = context.pop(); context.es = context.pop(); - context.ax = context.ds.word(239); + context.ax = context.data.word(239); context.ds.word(context.bx+3) = context.ax; noshow: return; } static void checkspeed(Context & context) { - context._cmp(context.ds.byte(65), -1); + context._cmp(context.data.byte(65), -1); if (!context.flags.z()) goto forcenext; context._add(context.ds.byte(context.bx+6), 1); context.al = context.ds.byte(context.bx+6); @@ -2428,7 +2428,7 @@ forcenext: } static void clearsprites(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = 255; context.cx = 32*16; @@ -2437,7 +2437,7 @@ static void clearsprites(Context & context) { } static void makesprite(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: context._cmp(context.ds.byte(context.bx+15), 255); @@ -2464,11 +2464,11 @@ static void delsprite(Context & context) { } static void spriteupdate(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.al = context.ds.byte(63); + context.al = context.data.byte(63); context.ds.byte(context.bx+31) = context.al; - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; _tmp18: @@ -2487,7 +2487,7 @@ _tmp18: _tmp18a: context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.ds.byte(186), 1); + context._cmp(context.data.byte(186), 1); if (context.flags.z()) goto _tmp18b; context._add(context.bx, 32); if (--context.cx) goto _tmp18; @@ -2496,11 +2496,11 @@ _tmp18b: } static void printsprites(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.cx = 0; priorityloop: context.push(context.cx); - context.ds.byte(182) = context.cl; + context.data.byte(182) = context.cl; context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; prtspriteloop: @@ -2509,7 +2509,7 @@ prtspriteloop: context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto skipsprite; - context.al = context.ds.byte(182); + context.al = context.data.byte(182); context._cmp(context.al, context.ds.byte(context.bx+23)); if (!context.flags.z()) goto skipsprite; context._cmp(context.ds.byte(context.bx+31), 1); @@ -2539,7 +2539,7 @@ static void printasprite(Context & context) { context.ah = 255; notnegative1: context.bx = context.ax; - context._add(context.bx, context.ds.word(119)); + context._add(context.bx, context.data.word(119)); context.al = context.ds.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); @@ -2547,14 +2547,14 @@ notnegative1: context.ah = 255; notnegative2: context.di = context.ax; - context._add(context.di, context.ds.word(117)); + context._add(context.di, context.data.word(117)); context.al = context.ds.byte(context.si+15); context.ah = 0; context._cmp(context.ds.byte(context.si+30), 0); if (context.flags.z()) goto steadyframe; context.ah = 8; steadyframe: - context._cmp(context.ds.byte(182), 6); + context._cmp(context.data.byte(182), 6); if (!context.flags.z()) goto notquickp; notquickp: showframe(context); @@ -2589,7 +2589,7 @@ static void checkone(Context & context) { context.cx = 3; context._mul(context.cx); context.si = context.ax; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context._add(context.si, 0+(228*13)+32+60+(32*32)); context._lodsw(); context.cx = context.ax; @@ -2599,30 +2599,30 @@ static void checkone(Context & context) { } static void findsource(Context & context) { - context.ax = context.ds.word(160); + context.ax = context.data.word(160); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; - context.ds = context.ds.word(430); - context.ds.word(244) = 0; + context.ds = context.data.word(430); + context.data.word(244) = 0; return; over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; - context.ds = context.ds.word(432); - context.ds.word(244) = 160; + context.ds = context.data.word(432); + context.data.word(244) = 160; return; over1001: - context.ds = context.ds.word(434); - context.ds.word(244) = 320; + context.ds = context.data.word(434); + context.data.word(244) = 320; return; } static void initman(Context & context) { - context.al = context.ds.byte(151); - context.ah = context.ds.byte(152); + context.al = context.data.byte(151); + context.ah = context.data.byte(152); context.si = context.ax; context.cx = 49464; - context.dx = context.ds.word(414); + context.dx = context.data.word(414); context.di = 0; makesprite(context); context.ds.byte(context.bx+23) = 4; @@ -2632,11 +2632,11 @@ static void initman(Context & context) { } static void mainman(Context & context) { - context._cmp(context.ds.byte(187), 1); + context._cmp(context.data.byte(187), 1); if (!context.flags.z()) goto notinnewroom; - context.ds.byte(187) = 0; - context.al = context.ds.byte(151); - context.ah = context.ds.byte(152); + context.data.byte(187) = 0; + context.al = context.data.byte(151); + context.ah = context.data.byte(152); context.ds.word(context.bx+10) = context.ax; context.ds.byte(context.bx+29) = 0; goto executewalk; @@ -2647,24 +2647,24 @@ notinnewroom: return; executewalk: context.ds.byte(context.bx+22) = 0; - context.al = context.ds.byte(135); - context._cmp(context.al, context.ds.byte(133)); + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); if (context.flags.z()) goto facingok; aboutturn(context); goto notwalk; facingok: - context._cmp(context.ds.byte(136), 0); + context._cmp(context.data.byte(136), 0); if (context.flags.z()) goto alreadyturned; - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto alreadyturned; - context.ds.byte(473) = 1; - context.al = context.ds.byte(133); - context._cmp(context.al, context.ds.byte(134)); + context.data.byte(473) = 1; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(134)); if (!context.flags.z()) goto alreadyturned; checkforexit(context); alreadyturned: - context.ds.byte(136) = 0; - context._cmp(context.ds.byte(492), 254); + context.data.byte(136) = 0; + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto walkman; context.ds.byte(context.bx+29) = 0; goto notwalk; @@ -2677,9 +2677,9 @@ walkman: notanimend1: context.ds.byte(context.bx+29) = context.al; walking(context); - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (context.flags.z()) goto afterwalk; - context.al = context.ds.byte(133); + context.al = context.data.byte(133); context._and(context.al, 1); if (context.flags.z()) goto isdouble; context.al = context.ds.byte(context.bx+29); @@ -2690,18 +2690,18 @@ notanimend1: isdouble: walking(context); afterwalk: - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto notwalk; - context.al = context.ds.byte(135); - context._cmp(context.al, context.ds.byte(133)); + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); if (!context.flags.z()) goto notwalk; - context.ds.byte(473) = 1; - context.al = context.ds.byte(133); - context._cmp(context.al, context.ds.byte(134)); + context.data.byte(473) = 1; + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(134)); if (!context.flags.z()) goto notwalk; checkforexit(context); notwalk: - context.al = context.ds.byte(133); + context.al = context.data.byte(133); context.ah = 0; context.di = 1105; context._add(context.di, context.ax); @@ -2709,18 +2709,18 @@ notwalk: context._add(context.al, context.ds.byte(context.bx+29)); context.ds.byte(context.bx+15) = context.al; context.ax = context.ds.word(context.bx+10); - context.ds.byte(151) = context.al; - context.ds.byte(152) = context.ah; + context.data.byte(151) = context.al; + context.data.byte(152) = context.ah; return; } static void aboutturn(Context & context) { - context._cmp(context.ds.byte(136), 1); + context._cmp(context.data.byte(136), 1); if (context.flags.z()) goto incdir; - context._cmp(context.ds.byte(136), -1); + context._cmp(context.data.byte(136), -1); if (context.flags.z()) goto decdir; - context.al = context.ds.byte(133); - context._sub(context.al, context.ds.byte(135)); + context.al = context.data.byte(133); + context._sub(context.al, context.data.byte(135)); if (!context.flags.c()) goto higher; context._neg(context.al); context._cmp(context.al, 4); @@ -2731,37 +2731,37 @@ higher: if (!context.flags.c()) goto incdir; goto decdir; incdir: - context.ds.byte(136) = 1; - context.al = context.ds.byte(133); + context.data.byte(136) = 1; + context.al = context.data.byte(133); context._add(context.al, 1); context._and(context.al, 7); - context.ds.byte(133) = context.al; + context.data.byte(133) = context.al; context.ds.byte(context.bx+29) = 0; return; decdir: - context.ds.byte(136) = -1; - context.al = context.ds.byte(133); + context.data.byte(136) = -1; + context.al = context.data.byte(133); context._sub(context.al, 1); context._and(context.al, 7); - context.ds.byte(133) = context.al; + context.data.byte(133) = context.al; context.ds.byte(context.bx+29) = 0; return; } static void walking(Context & context) { - context._cmp(context.ds.byte(493), 0); + context._cmp(context.data.byte(493), 0); if (context.flags.z()) goto normalwalk; - context.al = context.ds.byte(492); + context.al = context.data.byte(492); context._sub(context.al, 1); - context.ds.byte(492) = context.al; + context.data.byte(492) = context.al; context._cmp(context.al, 200); if (!context.flags.c()) goto endofline; goto continuewalk; normalwalk: - context.al = context.ds.byte(492); + context.al = context.data.byte(492); context._add(context.al, 1); - context.ds.byte(492) = context.al; - context._cmp(context.al, context.ds.byte(494)); + context.data.byte(492) = context.al; + context._cmp(context.al, context.data.byte(494)); if (!context.flags.c()) goto endofline; continuewalk: context.ah = 0; @@ -2779,13 +2779,13 @@ stillline: context.ds.word(context.bx+10) = context.ax; return; endofline: - context.ds.byte(492) = 254; - context.al = context.ds.byte(478); - context.ds.byte(475) = context.al; - context._cmp(context.al, context.ds.byte(477)); + context.data.byte(492) = 254; + context.al = context.data.byte(478); + context.data.byte(475) = context.al; + context._cmp(context.al, context.data.byte(477)); if (context.flags.z()) goto finishedwalk; - context.al = context.ds.byte(477); - context.ds.byte(478) = context.al; + context.al = context.data.byte(477); + context.data.byte(478) = context.al; context.push(context.es); context.push(context.bx); autosetwalk(context); @@ -2801,42 +2801,42 @@ static void facerightway(Context & context) { context.push(context.es); context.push(context.bx); getroomspaths(context); - context.al = context.ds.byte(475); + context.al = context.data.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx+7); - context.ds.byte(135) = context.al; - context.ds.byte(134) = context.al; + context.data.byte(135) = context.al; + context.data.byte(134) = context.al; context.bx = context.pop(); context.es = context.pop(); return; } static void checkforexit(Context & context) { - context.cl = context.ds.byte(151); + context.cl = context.data.byte(151); context._add(context.cl, 12); - context.ch = context.ds.byte(152); + context.ch = context.data.byte(152); context._add(context.ch, 12); checkone(context); - context.ds.byte(153) = context.cl; - context.ds.byte(154) = context.ch; - context.ds.byte(155) = context.dl; - context.ds.byte(156) = context.dh; - context.al = context.ds.byte(153); + context.data.byte(153) = context.cl; + context.data.byte(154) = context.ch; + context.data.byte(155) = context.dl; + context.data.byte(156) = context.dh; + context.al = context.data.byte(153); context._test(context.al, 64); if (context.flags.z()) goto notnewdirect; - context.al = context.ds.byte(154); - context.ds.byte(189) = context.al; + context.al = context.data.byte(154); + context.data.byte(189) = context.al; return; notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; context.push(context.es); context.push(context.bx); - context._cmp(context.ds.byte(184), 2); + context._cmp(context.data.byte(184), 2); if (!context.flags.z()) goto notlouis; context.bl = 0; context.push(context.bx); @@ -2871,17 +2871,17 @@ notravmessage: context.bl = 68; context.bh = 64; setuptimeduse(context); - context.al = context.ds.byte(133); + context.al = context.data.byte(133); context._add(context.al, 4); context._and(context.al, 7); - context.ds.byte(135) = context.al; + context.data.byte(135) = context.al; context.bx = context.pop(); context.es = context.pop(); return; notlouis: context.bx = context.pop(); context.es = context.pop(); - context.ds.byte(60) = 1; + context.data.byte(60) = 1; return; notleave: context._test(context.al, 4); @@ -2910,12 +2910,12 @@ notanup: static void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.ds.byte(149), 10); - context.al = context.ds.byte(154); + context._add(context.data.byte(149), 10); + context.al = context.data.byte(154); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+11) = context.al; - context.ds.byte(186) = 1; + context.data.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2924,12 +2924,12 @@ static void adjustdown(Context & context) { static void adjustup(Context & context) { context.push(context.es); context.push(context.bx); - context._sub(context.ds.byte(149), 10); - context.al = context.ds.byte(154); + context._sub(context.data.byte(149), 10); + context.al = context.data.byte(154); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+11) = context.al; - context.ds.byte(186) = 1; + context.data.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2938,13 +2938,13 @@ static void adjustup(Context & context) { static void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); - context.ds.byte(153) = 0; - context._sub(context.ds.byte(148), 11); - context.al = context.ds.byte(154); + context.data.byte(153) = 0; + context._sub(context.data.byte(148), 11); + context.al = context.data.byte(154); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+10) = context.al; - context.ds.byte(186) = 1; + context.data.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2953,24 +2953,24 @@ static void adjustleft(Context & context) { static void adjustright(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.ds.byte(148), 11); - context.al = context.ds.byte(154); + context._add(context.data.byte(148), 11); + context.al = context.data.byte(154); context.cl = 16; context._mul(context.cl); context._sub(context.al, 2); context.ds.byte(context.bx+10) = context.al; - context.ds.byte(186) = 1; + context.data.byte(186) = 1; context.bx = context.pop(); context.es = context.pop(); return; } static void reminders(Context & context) { - context._cmp(context.ds.byte(184), 24); + context._cmp(context.data.byte(184), 24); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.ds.byte(148), 44); + context._cmp(context.data.byte(148), 44); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.ds.byte(2), 0); + context._cmp(context.data.byte(2), 0); if (!context.flags.z()) goto notfirst; context.al = 'D'; context.ah = 'K'; @@ -2998,7 +2998,7 @@ static void reminders(Context & context) { compare(context); if (!context.flags.z()) goto forgotone; havegotcard: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); notfirst: return; forgotone: @@ -3014,23 +3014,23 @@ notinedenslift: } static void initrain(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.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); context.bx = 1113; checkmorerain: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto finishinitrain; - context._cmp(context.al, context.ds.byte(184)); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+1); - context._cmp(context.al, context.ds.byte(148)); + context._cmp(context.al, context.data.byte(148)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+2); - context._cmp(context.al, context.ds.byte(149)); + context._cmp(context.al, context.data.byte(149)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+3); - context.ds.byte(132) = context.al; + context.data.byte(132) = context.al; goto dorain; checkrain: context._add(context.bx, 4); @@ -3041,26 +3041,26 @@ initraintop: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.ds.byte(132)); + context._cmp(context.al, context.data.byte(132)); if (!context.flags.c()) goto initraintop; context._add(context.cl, context.al); - context._cmp(context.cl, context.ds.byte(128)); + context._cmp(context.cl, context.data.byte(128)); if (!context.flags.c()) goto initrainside; context.push(context.cx); splitintolines(context); context.cx = context.pop(); goto initraintop; initrainside: - context.cl = context.ds.byte(128); + context.cl = context.data.byte(128); context._sub(context.cl, 1); initrainside2: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.ds.byte(132)); + context._cmp(context.al, context.data.byte(132)); if (!context.flags.c()) goto initrainside2; context._add(context.ch, context.al); - context._cmp(context.ch, context.ds.byte(129)); + context._cmp(context.ch, context.data.byte(129)); if (!context.flags.c()) goto finishinitrain; context.push(context.cx); splitintolines(context); @@ -3081,7 +3081,7 @@ lookforlinestart: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.ds.byte(129)); + context._cmp(context.ch, context.data.byte(129)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; foundlinestart: @@ -3095,7 +3095,7 @@ lookforlineend: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto foundlineend; - context._cmp(context.ch, context.ds.byte(129)); + context._cmp(context.ch, context.data.byte(129)); if (!context.flags.c()) goto foundlineend; context._add(context.bh, 1); goto lookforlineend; @@ -3114,7 +3114,7 @@ foundlineend: context.cx = context.pop(); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.ds.byte(129)); + context._cmp(context.ch, context.data.byte(129)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: @@ -3125,9 +3125,9 @@ static void getblockofpixel(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.di); - context.ax = context.ds.word(125); + context.ax = context.data.word(125); context._add(context.cl, context.al); - context.ax = context.ds.word(127); + context.ax = context.data.word(127); context._add(context.ch, context.al); checkone(context); context._and(context.cl, 1); @@ -3145,30 +3145,30 @@ failrain: } static void showrain(Context & context) { - context.ds = context.ds.word(414); + context.ds = context.data.word(414); context.si = 6*58; context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); context.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); - context.es = context.ds.word(412); + context.es = context.data.word(412); context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto nothunder; morerain: - context.es = context.ds.word(412); + context.es = context.data.word(412); context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto finishrain; context.al = context.ds.byte(context.bx+1); context.ah = 0; - context._add(context.ax, context.ds.word(119)); - context._add(context.ax, context.ds.word(127)); + context._add(context.ax, context.data.word(119)); + context._add(context.ax, context.data.word(127)); context.cx = 320; context._mul(context.cx); context.cl = context.ds.byte(context.bx); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.ds.word(117)); - context._add(context.ax, context.ds.word(125)); + context._add(context.ax, context.data.word(117)); + context._add(context.ax, context.data.word(125)); context.di = context.ax; context.cl = context.ds.byte(context.bx+2); context.ch = 0; @@ -3181,7 +3181,7 @@ morerain: context._add(context.bx, 6); context.push(context.si); context._add(context.si, context.ax); - context.es = context.ds.word(400); + context.es = context.data.word(400); context.ah = 0; context.dx = 320-2; rainloop: @@ -3199,20 +3199,20 @@ noplot: context.si = context.pop(); goto morerain; finishrain: - context._cmp(context.ds.word(521), 0); + context._cmp(context.data.word(521), 0); if (!context.flags.z()) goto nothunder; - context._cmp(context.ds.byte(184), 2); + context._cmp(context.data.byte(184), 2); if (!context.flags.z()) goto notlouisthund; - context._cmp(context.ds.byte(45), 1); + context._cmp(context.data.byte(45), 1); if (!context.flags.z()) goto nothunder; notlouisthund: - context._cmp(context.ds.byte(184), 55); + context._cmp(context.data.byte(184), 55); if (context.flags.z()) goto nothunder; randomnum1(context); context._cmp(context.al, 1); if (!context.flags.c()) goto nothunder; context.al = 7; - context._cmp(context.ds.byte(507), 6); + context._cmp(context.data.byte(507), 6); if (context.flags.z()) goto isthunder1; context.al = 4; isthunder1: @@ -3222,7 +3222,7 @@ nothunder: } static void backobject(Context & context) { - context.ds = context.ds.word(428); + context.ds = context.data.word(428); context.di = context.ds.word(context.bx+20); context.al = context.ds.byte(context.bx+18); context._cmp(context.al, 0); @@ -3270,7 +3270,7 @@ finishback: } static void liftsprite(Context & context) { - context.al = context.ds.byte(35); + context.al = context.data.byte(35); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; context._cmp(context.al, 1); @@ -3289,7 +3289,7 @@ static void liftsprite(Context & context) { context.ax = context.pop(); goto pokelift; finishclose: - context.ds.byte(35) = 0; + context.data.byte(35) = 0; return; openlift: context.al = context.ds.byte(context.bx+19); @@ -3313,46 +3313,46 @@ pokelift: context.ds.byte(context.di+17) = context.al; return; endoflist: - context.ds.byte(35) = 1; + context.data.byte(35) = 1; return; liftopen: - context.al = context.ds.byte(36); + context.al = context.data.byte(36); context.push(context.es); context.push(context.bx); turnpathon(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.ds.byte(40), 0); + context._cmp(context.data.byte(40), 0); if (context.flags.z()) goto nocountclose; - context._sub(context.ds.byte(40), 1); - context._cmp(context.ds.byte(40), 0); + context._sub(context.data.byte(40), 1); + context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto nocountclose; - context.ds.byte(35) = 2; + context.data.byte(35) = 2; nocountclose: context.al = 12; goto pokelift; liftclosed: - context.al = context.ds.byte(36); + context.al = context.data.byte(36); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.ds.byte(39), 0); + context._cmp(context.data.byte(39), 0); if (context.flags.z()) goto nocountopen; - context._sub(context.ds.byte(39), 1); - context._cmp(context.ds.byte(39), 0); + context._sub(context.data.byte(39), 1); + context._cmp(context.data.byte(39), 0); if (!context.flags.z()) goto nocountopen; - context.ds.byte(35) = 3; + context.data.byte(35) = 3; nocountopen: context.al = 0; goto pokelift; } static void liftnoise(Context & context) { - context._cmp(context.ds.byte(184), 5); + context._cmp(context.data.byte(184), 5); if (context.flags.z()) goto hissnoise; - context._cmp(context.ds.byte(184), 21); + context._cmp(context.data.byte(184), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); return; @@ -3400,52 +3400,52 @@ gotconst: } static void doorway(Context & context) { - context.ds.byte(193) = -24; - context.ds.byte(194) = 10; - context.ds.byte(195) = -30; - context.ds.byte(196) = 10; + context.data.byte(193) = -24; + context.data.byte(194) = 10; + context.data.byte(195) = -30; + context.data.byte(196) = 10; dodoor(context); return; } static void widedoor(Context & context) { - context.ds.byte(193) = -24; - context.ds.byte(194) = 24; - context.ds.byte(195) = -30; - context.ds.byte(196) = 24; + context.data.byte(193) = -24; + context.data.byte(194) = 24; + context.data.byte(195) = -30; + context.data.byte(196) = 24; dodoor(context); return; } static void dodoor(Context & context) { - context.al = context.ds.byte(151); - context.ah = context.ds.byte(152); + context.al = context.data.byte(151); + context.ah = context.data.byte(152); context.cl = context.ds.byte(context.bx+10); context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor; context._sub(context.al, context.cl); - context._cmp(context.al, context.ds.byte(193)); + context._cmp(context.al, context.data.byte(193)); if (!context.flags.c()) goto upordown; goto shutdoor; rtofdoor: context._sub(context.al, context.cl); - context._cmp(context.al, context.ds.byte(194)); + context._cmp(context.al, context.data.byte(194)); if (!context.flags.c()) goto shutdoor; upordown: context._cmp(context.ah, context.ch); if (!context.flags.c()) goto botofdoor; context._sub(context.ah, context.ch); - context._cmp(context.ah, context.ds.byte(195)); + context._cmp(context.ah, context.data.byte(195)); if (context.flags.c()) goto shutdoor; goto opendoor; botofdoor: context._sub(context.ah, context.ch); - context._cmp(context.ah, context.ds.byte(196)); + context._cmp(context.ah, context.data.byte(196)); if (!context.flags.c()) goto shutdoor; opendoor: context.cl = context.ds.byte(context.bx+19); - context._cmp(context.ds.byte(61), 1); + context._cmp(context.data.byte(61), 1); if (!context.flags.z()) goto notthrough; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough; @@ -3455,7 +3455,7 @@ notthrough: context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound2; context.al = 0; - context._cmp(context.ds.byte(184), 5); + context._cmp(context.data.byte(184), 5); if (!context.flags.z()) goto nothoteldoor2; context.al = 13; nothoteldoor2: @@ -3475,14 +3475,14 @@ atlast1: context.di = context.pop(); context.ds.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - context.ds.byte(61) = 1; + context.data.byte(61) = 1; return; shutdoor: context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.ds.byte(184), 5); + context._cmp(context.data.byte(184), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3502,14 +3502,14 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.ds.byte(61) = 0; + context.data.byte(61) = 0; notnearly: return; } static void lockeddoorway(Context & context) { - context.al = context.ds.byte(151); - context.ah = context.ds.byte(152); + context.al = context.data.byte(151); + context.ah = context.data.byte(152); context.cl = context.ds.byte(context.bx+10); context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); @@ -3534,9 +3534,9 @@ botofdoor2: context._cmp(context.ah, 12); if (!context.flags.c()) goto shutdoor2; opendoor2: - context._cmp(context.ds.byte(61), 1); + context._cmp(context.data.byte(61), 1); if (context.flags.z()) goto mustbeopen; - context._cmp(context.ds.byte(37), 1); + context._cmp(context.data.byte(37), 1); if (context.flags.z()) goto shutdoor; mustbeopen: context.cl = context.ds.byte(context.bx+19); @@ -3547,7 +3547,7 @@ mustbeopen: notdoorsound4: context._cmp(context.cl, 6); if (!context.flags.z()) goto noturnonyet; - context.al = context.ds.byte(38); + context.al = context.data.byte(38); context.push(context.es); context.push(context.bx); turnpathon(context); @@ -3555,7 +3555,7 @@ notdoorsound4: context.es = context.pop(); noturnonyet: context.cl = context.ds.byte(context.bx+19); - context._cmp(context.ds.byte(61), 1); + context._cmp(context.data.byte(61), 1); if (!context.flags.z()) goto notthrough2; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough2; @@ -3578,7 +3578,7 @@ atlast3: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto justshutting; - context.ds.byte(61) = 1; + context.data.byte(61) = 1; justshutting: return; shutdoor2: @@ -3594,7 +3594,7 @@ notdoorsound3: context.ds.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; - context.ds.byte(61) = 0; + context.data.byte(61) = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); @@ -3603,13 +3603,13 @@ atlast4: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) goto notlocky; - context.al = context.ds.byte(38); + context.al = context.data.byte(38); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context.ds.byte(37) = 1; + context.data.byte(37) = 1; notlocky: return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ @@ -3618,7 +3618,7 @@ shutdoor: context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.ds.byte(184), 5); + context._cmp(context.data.byte(184), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3638,20 +3638,20 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.ds.byte(61) = 0; + context.data.byte(61) = 0; notnearly: return; return; } static void updatepeople(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.ds.word(18) = context.di; + context.data.word(18) = context.di; context.cx = 12*5; context.al = 255; while(--context.cx) context._stosb(); - context._add(context.ds.word(138), 1); + context._add(context.data.word(138), 1); context.es = context.cs; context.bx = 537; context.di = 1003; @@ -3659,12 +3659,12 @@ updateloop: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endupdate; - context._cmp(context.al, context.ds.byte(184)); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto notinthisroom; context.cx = context.ds.word(context.bx+1); - context._cmp(context.cl, context.ds.byte(148)); + context._cmp(context.cl, context.data.byte(148)); if (!context.flags.z()) goto notinthisroom; - context._cmp(context.ch, context.ds.byte(149)); + context._cmp(context.ch, context.data.byte(149)); if (!context.flags.z()) goto notinthisroom; context.push(context.di); context.ax = context.ds.word(context.di); @@ -3680,12 +3680,12 @@ endupdate: static void getreelframeax(Context & context) { context.push(context.ds); - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; findsource(context); context.es = context.ds; context.ds = context.pop(); - context.ax = context.ds.word(160); - context._sub(context.ax, context.ds.word(244)); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); context._add(context.ax, context.ax); context.cx = context.ax; context._add(context.ax, context.ax); @@ -3714,7 +3714,7 @@ retryreel: context._cmp(context.al, 255); if (context.flags.z()) goto normalreel; dealwithspecial(context); - context._add(context.ds.word(239), 1); + context._add(context.data.word(239), 1); context.si = context.pop(); context.es = context.pop(); context._add(context.si, 40); @@ -3742,7 +3742,7 @@ notplot: } static void soundonreels(Context & context) { - context.bl = context.ds.byte(184); + context.bl = context.data.byte(184); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); context._add(context.bx, 1254); @@ -3752,11 +3752,11 @@ reelsoundloop: context._cmp(context.al, 255); if (context.flags.z()) goto endreelsound; context.ax = context.ds.word(context.si+1); - context._cmp(context.ax, context.ds.word(239)); + context._cmp(context.ax, context.data.word(239)); if (!context.flags.z()) goto skipreelsound; - context._cmp(context.ax, context.ds.word(351)); + context._cmp(context.ax, context.data.word(351)); if (context.flags.z()) goto skipreelsound; - context.ds.word(351) = context.ax; + context.data.word(351) = context.ax; context.al = context.ds.byte(context.si); context._cmp(context.al, 64); if (context.flags.c()) { playchannel1(context); return; }; @@ -3773,26 +3773,26 @@ skipreelsound: context._add(context.si, 3); goto reelsoundloop; endreelsound: - context.ax = context.ds.word(351); - context._cmp(context.ax, context.ds.word(239)); + context.ax = context.data.word(351); + context._cmp(context.ax, context.data.word(239)); if (context.flags.z()) goto nochange2; - context.ds.word(351) = -1; + context.data.word(351) = -1; nochange2: return; } static void reconstruct(Context & context) { - context._cmp(context.ds.byte(130), 0); + context._cmp(context.data.byte(130), 0); if (context.flags.z()) goto noneedtorecon; - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); spriteupdate(context); printsprites(context); - context._cmp(context.ds.byte(184), 20); + context._cmp(context.data.byte(184), 20); if (!context.flags.z()) goto notfudge; undertextline(context); notfudge: - context.ds.byte(130) = 0; + context.data.byte(130) = 0; noneedtorecon: return; } @@ -3803,28 +3803,28 @@ static void dealwithspecial(Context & context) { if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); - context.ds.byte(130) = 1; + context.data.byte(130) = 1; return; notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); - context.ds.byte(130) = 1; + context.data.byte(130) = 1; return; notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); - context.ds.byte(130) = 1; + context.data.byte(130) = 1; return; notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); - context.ds.byte(130) = 1; + context.data.byte(130) = 1; return; notremfree: context._cmp(context.al, 4); @@ -3834,14 +3834,14 @@ notremfree: notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; - context.ds.byte(135) = context.ah; - context.ds.byte(133) = context.ah; + context.data.byte(135) = context.ah; + context.data.byte(133) = context.ah; switchryanon(context); return; notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; - context.ds.byte(188) = context.ah; + context.data.byte(188) = context.ah; return; notchangeloc: movemap(context); @@ -3851,38 +3851,38 @@ notchangeloc: static void movemap(Context & context) { context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; - context._sub(context.ds.byte(149), 20); - context.ds.byte(186) = 1; + context._sub(context.data.byte(149), 20); + context.data.byte(186) = 1; return; notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; - context._sub(context.ds.byte(149), 10); - context.ds.byte(186) = 1; + context._sub(context.data.byte(149), 10); + context.data.byte(186) = 1; return; notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; - context._add(context.ds.byte(149), 10); - context.ds.byte(186) = 1; + context._add(context.data.byte(149), 10); + context.data.byte(186) = 1; return; notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; - context._add(context.ds.byte(148), 11); - context.ds.byte(186) = 1; + context._add(context.data.byte(148), 11); + context.data.byte(186) = 1; return; notmaprightspec: - context._sub(context.ds.byte(148), 11); - context.ds.byte(186) = 1; + context._sub(context.data.byte(148), 11); + context.data.byte(186) = 1; return; } static void getreelstart(Context & context) { - context.ax = context.ds.word(239); + context.ax = context.data.word(239); context.cx = 40; context._mul(context.cx); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.si = context.ax; context._add(context.si, 0+(36*144)); return; @@ -3892,37 +3892,37 @@ static void showreelframe(Context & context) { context.al = context.ds.byte(context.si+2); context.ah = 0; context.di = context.ax; - context._add(context.di, context.ds.word(117)); + context._add(context.di, context.data.word(117)); context.al = context.ds.byte(context.si+3); context.bx = context.ax; - context._add(context.bx, context.ds.word(119)); + context._add(context.bx, context.data.word(119)); context.ax = context.ds.word(context.si); - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; findsource(context); - context.ax = context.ds.word(160); - context._sub(context.ax, context.ds.word(244)); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); context.ah = 8; showframe(context); return; } static void deleverything(Context & context) { - context.al = context.ds.byte(129); + context.al = context.data.byte(129); context.ah = 0; - context._add(context.ax, context.ds.word(123)); + context._add(context.ax, context.data.word(123)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); return; bigroom: - context._sub(context.ds.byte(129), 8); + context._sub(context.data.byte(129), 8); maptopanel(context); - context._add(context.ds.byte(129), 8); + context._add(context.data.byte(129), 8); return; } static void dumpeverything(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.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); dumpevery1: context.ax = context.ds.word(context.bx); @@ -3941,8 +3941,8 @@ notskip1: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.ds.word(117)); - context._add(context.bx, context.ds.word(119)); + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3964,8 +3964,8 @@ dumpevery2: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.ds.word(117)); - context._add(context.bx, context.ds.word(119)); + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3979,7 +3979,7 @@ finishevery2: static void allocatework(Context & context) { context.bx = 0x1000; allocatemem(context); - context.ds.word(400) = context.ax; + context.data.word(400) = context.ax; return; } @@ -4007,20 +4007,20 @@ static void loadpalfromiff(Context & context) { context.dx = 2494; openfile(context); context.cx = 2000; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.dx = 0; readfromfile(context); closefile(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0x30; context.cx = 768; palloop: context._lodsb(); context._shr(context.al, 1); context._shr(context.al, 1); - context._cmp(context.ds.byte(73), 1); + context._cmp(context.data.byte(73), 1); if (!context.flags.z()) goto nought; context._cmp(context.al, 0); if (context.flags.z()) goto nought; @@ -4051,7 +4051,7 @@ static void cls(Context & context) { static void printundermon(Context & context) { context.si = (320*43)+76; context.di = context.si; - context.es = context.ds.word(400); + context.es = context.data.word(400); context._add(context.si, 8*320); context.dx = 0x0a000; context.ds = context.dx; @@ -4087,7 +4087,7 @@ static void worktoscreen(Context & context) { context.si = 0; context.di = 0; context.cx = 25; - context.ds = context.ds.word(400); + context.ds = context.data.word(400); context.dx = 0x0a000; context.es = context.dx; dumpallloop: @@ -4104,38 +4104,38 @@ dumpallloop: } static void paneltomap(Context & context) { - context.di = context.ds.word(125); - context._add(context.di, context.ds.word(117)); - context.bx = context.ds.word(127); - context._add(context.bx, context.ds.word(119)); - context.ds = context.ds.word(402); + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); context.si = 0; - context.cl = context.ds.byte(128); - context.ch = context.ds.byte(129); + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); multiget(context); return; } static void maptopanel(Context & context) { - context.di = context.ds.word(125); - context._add(context.di, context.ds.word(117)); - context.bx = context.ds.word(127); - context._add(context.bx, context.ds.word(119)); - context.ds = context.ds.word(402); + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.ds = context.data.word(402); context.si = 0; - context.cl = context.ds.byte(128); - context.ch = context.ds.byte(129); + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); multiput(context); return; } static void dumpmap(Context & context) { - context.di = context.ds.word(125); - context._add(context.di, context.ds.word(117)); - context.bx = context.ds.word(127); - context._add(context.bx, context.ds.word(119)); - context.cl = context.ds.byte(128); - context.ch = context.ds.byte(129); + context.di = context.data.word(125); + context._add(context.di, context.data.word(117)); + context.bx = context.data.word(127); + context._add(context.bx, context.data.word(119)); + context.cl = context.data.byte(128); + context.ch = context.data.byte(129); multidump(context); return; } @@ -4151,7 +4151,7 @@ static void pixelcheckset(Context & context) { context.al = context.ds.byte(context.bx+4); getsetad(context); context.al = context.ds.byte(context.bx+17); - context.es = context.ds.word(444); + context.es = context.data.word(444); context.bx = 0; context.ah = 0; context.cx = 6; @@ -4183,25 +4183,25 @@ static void pixelcheckset(Context & context) { static void createpanel(Context & context) { context.di = 0; context.bx = 8; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 8; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 0; context.bx = 104; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 104; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 0; context.ah = 2; showframe(context); @@ -4212,13 +4212,13 @@ static void createpanel2(Context & context) { createpanel(context); context.di = 0; context.bx = 0; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 5; context.ah = 2; showframe(context); context.di = 160; context.bx = 0; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.al = 5; context.ah = 2; showframe(context); @@ -4227,7 +4227,7 @@ static void createpanel2(Context & context) { static void clearwork(Context & context) { context.ax = 0x0; - context.es = context.ds.word(400); + context.es = context.data.word(400); context.di = 0; context.cx = (200*320)/64; clearloop: @@ -4268,24 +4268,24 @@ clearloop: } static void zoom(Context & context) { - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto inwatching; - context._cmp(context.ds.byte(8), 1); + context._cmp(context.data.byte(8), 1); if (context.flags.z()) goto zoomswitch; inwatching: return; zoomswitch: - context._cmp(context.ds.byte(100), 199); + context._cmp(context.data.byte(100), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); return; zoomit: - context.ax = context.ds.word(222); + context.ax = context.data.word(222); context._sub(context.ax, 9); context.cx = 320; context._mul(context.cx); - context._add(context.ax, context.ds.word(220)); + context._add(context.ax, context.data.word(220)); context._sub(context.ax, 11); context.si = context.ax; context.ax = 132+4; @@ -4293,8 +4293,8 @@ zoomit: context._mul(context.cx); context._add(context.ax, 8+5); context.di = context.ax; - context.es = context.ds.word(400); - context.ds = context.ds.word(400); + context.es = context.data.word(400); + context.ds = context.data.word(400); context.cx = 20; zoomloop: context.push(context.cx); @@ -4310,7 +4310,7 @@ zoomloop2: context.cx = context.pop(); if (--context.cx) goto zoomloop; crosshair(context); - context.ds.byte(75) = 1; + context.data.byte(75) = 1; return; } @@ -4319,12 +4319,12 @@ static void delthisone(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context._add(context.ax, context.ds.word(119)); + context._add(context.ax, context.data.word(119)); context.bx = 320; context._mul(context.bx); context.bx = context.pop(); context.bh = 0; - context._add(context.bx, context.ds.word(117)); + context._add(context.bx, context.data.word(117)); context._add(context.ax, context.bx); context.di = context.ax; context.ax = context.pop(); @@ -4337,8 +4337,8 @@ static void delthisone(Context & context) { context.bh = 0; context._add(context.ax, context.bx); context.si = context.ax; - context.es = context.ds.word(400); - context.ds = context.ds.word(402); + context.es = context.data.word(400); + context.ds = context.data.word(402); context.dl = context.cl; context.dh = 0; context.ax = 320; @@ -4362,7 +4362,7 @@ static void multiget(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.ds.word(400); + context.es = context.data.word(400); context.es = context.ds; context.ds = context.es; context._xchg(context.di, context.si); @@ -4406,7 +4406,7 @@ static void multiput(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.ds.word(400); + context.es = context.data.word(400); context.al = context.cl; context.ah = 0; context.dx = 320; @@ -4445,7 +4445,7 @@ multiloop6: static void multidump(Context & context) { context.dx = 0x0a000; context.es = context.dx; - context.ds = context.ds.word(400); + context.ds = context.data.word(400); context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4727,17 +4727,17 @@ static void width160(Context & context) { } static void doblocks(Context & context) { - context.es = context.ds.word(400); - context.ax = context.ds.word(119); + context.es = context.data.word(400); + context.ax = context.data.word(119); context.cx = 320; context._mul(context.cx); - context.di = context.ds.word(117); + context.di = context.data.word(117); context._add(context.di, context.ax); - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ah = 0; context.bx = 66; context._mul(context.bx); - context.bl = context.ds.byte(148); + context.bl = context.data.byte(148); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -4750,9 +4750,9 @@ loop120: loop124: context.push(context.cx); context.push(context.di); - context.ds = context.ds.word(418); + context.ds = context.data.word(418); context._lodsb(); - context.ds = context.ds.word(416); + context.ds = context.data.word(416); context.push(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto zeroblock; @@ -4896,9 +4896,9 @@ notdiffdest: if (context.flags.z()) goto notprintlist; context.push(context.ax); context.ax = context.di; - context._sub(context.ax, context.ds.word(117)); + context._sub(context.ax, context.data.word(117)); context.push(context.bx); - context._sub(context.bx, context.ds.word(119)); + context._sub(context.bx, context.data.word(119)); context.ah = context.bl; context.bx = context.pop(); context.ax = context.pop(); @@ -4906,7 +4906,7 @@ notprintlist: context._test(context.ah, 4); if (context.flags.z()) goto notflippedx; context.dx = 320; - context.es = context.ds.word(400); + context.es = context.data.word(400); context.push(context.cx); frameoutfx(context); context.cx = context.pop(); @@ -4915,7 +4915,7 @@ notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; context.dx = 320; - context.es = context.ds.word(400); + context.es = context.data.word(400); context.push(context.cx); frameoutnm(context); context.cx = context.pop(); @@ -4924,14 +4924,14 @@ notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; context.dx = 320; - context.es = context.ds.word(400); + context.es = context.data.word(400); context.push(context.cx); frameoutbh(context); context.cx = context.pop(); return; noeffects: context.dx = 320; - context.es = context.ds.word(400); + context.es = context.data.word(400); context.push(context.cx); frameoutv(context); context.cx = context.pop(); @@ -5095,9 +5095,9 @@ backtosolidfx: } static void transferinv(Context & context) { - context.di = context.ds.word(12); + context.di = context.data.word(12); context.push(context.di); - context.al = context.ds.byte(10); + context.al = context.data.byte(10); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5105,12 +5105,12 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.ds.byte(90); + context.al = context.data.byte(90); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5118,7 +5118,7 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.ds = context.ds.word(446); + context.ds = context.data.word(446); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5139,33 +5139,33 @@ static void transferinv(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; - context._add(context.ds.word(12), context.cx); + context._add(context.data.word(12), context.cx); return; } static void transfermap(Context & context) { - context.di = context.ds.word(12); + context.di = context.data.word(12); context.push(context.di); - context.al = context.ds.byte(10); + context.al = context.data.byte(10); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.ds.byte(90); + context.al = context.data.byte(90); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.ds = context.ds.word(446); + context.ds = context.data.word(446); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5186,26 +5186,26 @@ static void transfermap(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; - context._add(context.ds.word(12), context.cx); + context._add(context.data.word(12), context.cx); return; } static void dofade(Context & context) { - context._cmp(context.ds.byte(344), 0); + context._cmp(context.data.byte(344), 0); if (context.flags.z()) goto finishfade; - context.cl = context.ds.byte(345); + context.cl = context.data.byte(345); context.ch = 0; - context.al = context.ds.byte(343); + context.al = context.data.byte(343); context.ah = 0; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); showgroup(context); - context.al = context.ds.byte(345); - context._add(context.al, context.ds.byte(343)); - context.ds.byte(343) = context.al; + context.al = context.data.byte(345); + context._add(context.al, context.data.byte(343)); + context.data.byte(343) = context.al; context._cmp(context.al, 0); if (!context.flags.z()) goto finishfade; fadecalculation(context); @@ -5214,7 +5214,7 @@ finishfade: } static void clearendpal(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 0; @@ -5223,7 +5223,7 @@ static void clearendpal(Context & context) { } static void clearpalette(Context & context) { - context.ds.byte(344) = 0; + context.data.byte(344) = 0; clearstartpal(context); dumpcurrent(context); return; @@ -5232,15 +5232,15 @@ static void clearpalette(Context & context) { static void fadescreenup(Context & context) { clearstartpal(context); paltoendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } static void fadetowhite(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 63; @@ -5251,15 +5251,15 @@ static void fadetowhite(Context & context) { context._stosb(); context._stosb(); paltostartpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } static void fadefromwhite(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768; context.al = 63; @@ -5270,20 +5270,20 @@ static void fadefromwhite(Context & context) { context._stosb(); context._stosb(); paltoendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } static void fadescreenups(Context & context) { clearstartpal(context); paltoendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 64; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; return; } @@ -5291,7 +5291,7 @@ static void fadescreendownhalf(Context & context) { paltostartpal(context); paltoendpal(context); context.cx = 768; - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; halfend: context.al = context.ds.byte(context.bx); @@ -5299,8 +5299,8 @@ halfend: context.ds.byte(context.bx) = context.al; context._add(context.bx, 1); if (--context.cx) goto halfend; - context.ds = context.ds.word(412); - context.es = context.ds.word(412); + context.ds = context.data.word(412); + context.es = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); context.cx = 3*5; @@ -5309,45 +5309,45 @@ halfend: context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); context.cx = 3*2; while(--context.cx) context._movsb(); - context.ds.byte(344) = 1; - context.ds.byte(346) = 31; - context.ds.byte(343) = 0; - context.ds.byte(345) = 32; + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; return; } static void fadescreenuphalf(Context & context) { endpaltostart(context); paltoendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 31; - context.ds.byte(343) = 0; - context.ds.byte(345) = 32; + context.data.byte(344) = 1; + context.data.byte(346) = 31; + context.data.byte(343) = 0; + context.data.byte(345) = 32; return; } static void fadescreendown(Context & context) { paltostartpal(context); clearendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; return; } static void fadescreendowns(Context & context) { paltostartpal(context); clearendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 64; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 64; return; } static void clearstartpal(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 256; wholeloop1: @@ -5360,39 +5360,39 @@ wholeloop1: } static void showgun(Context & context) { - context.ds.byte(348) = 0; - context.ds.byte(347) = 0; - context.ds.byte(349) = 0; + context.data.byte(348) = 0; + context.data.byte(347) = 0; + context.data.byte(349) = 0; paltostartpal(context); paltoendpal(context); greyscalesum(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 130; hangon(context); endpaltostart(context); clearendpal(context); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 200; hangon(context); - context.ds.byte(531) = 34; + context.data.byte(531) = 34; loadroomssample(context); - context.ds.byte(386) = 0; + context.data.byte(386) = 0; context.dx = 2364; loadintotemp(context); createpanel2(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 0; context.ah = 0; context.di = 100; context.bx = 4; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 1; context.ah = 0; context.di = 158; @@ -5423,10 +5423,10 @@ static void rollem(Context & context) { context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiget(context); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.si = 49*2; context.ax = context.ds.word(context.si); context.si = context.ax; @@ -5435,7 +5435,7 @@ static void rollem(Context & context) { endcredits21: context.push(context.cx); context.bx = 10; - context.cx = context.ds.word(77); + context.cx = context.data.word(77); endcredits22: context.push(context.cx); context.push(context.si); @@ -5447,7 +5447,7 @@ endcredits22: context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiput(context); vsync(context); @@ -5466,7 +5466,7 @@ onelot2: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.ds.word(77)); + context._add(context.bx, context.data.word(77)); context.cx = context.pop(); if (--context.cx) goto onelot2; vsync(context); @@ -5480,7 +5480,7 @@ onelot2: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto endearly2; context._sub(context.bx, 1); if (--context.cx) goto endcredits22; @@ -5494,7 +5494,7 @@ looknext2: if (context.flags.z()) goto gotnext2; goto looknext2; gotnext2: - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto endearly; if (--context.cx) goto endcredits21; context.cx = 120; @@ -5507,10 +5507,10 @@ endearly: } static void fadecalculation(Context & context) { - context._cmp(context.ds.byte(346), 0); + context._cmp(context.data.byte(346), 0); if (context.flags.z()) goto nomorefading; - context.bl = context.ds.byte(346); - context.es = context.ds.word(412); + context.bl = context.data.byte(346); + context.es = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; @@ -5532,15 +5532,15 @@ gotthere: context._add(context.si, 1); context._add(context.di, 1); if (--context.cx) goto fadecolloop; - context._sub(context.ds.byte(346), 1); + context._sub(context.data.byte(346), 1); return; nomorefading: - context.ds.byte(344) = 0; + context.data.byte(344) = 0; return; } static void greyscalesum(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 256; @@ -5569,19 +5569,19 @@ greysumloop2: if (!context.flags.c()) goto greysumloop2; context.bl = context.al; context.al = context.bl; - context.ah = context.ds.byte(348); + context.ah = context.data.byte(348); context._cmp(context.al, 0); context._add(context.al, context.ah); noaddr: context._stosb(); - context.ah = context.ds.byte(347); + context.ah = context.data.byte(347); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddg; context._add(context.al, context.ah); noaddg: context._stosb(); - context.ah = context.ds.byte(349); + context.ah = context.data.byte(349); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddb; @@ -5595,8 +5595,8 @@ noaddb: } static void paltostartpal(Context & context) { - context.es = context.ds.word(412); - context.ds = context.ds.word(412); + context.es = context.data.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5605,8 +5605,8 @@ static void paltostartpal(Context & context) { } static void endpaltostart(Context & context) { - context.es = context.ds.word(412); - context.ds = context.ds.word(412); + context.es = context.data.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5615,8 +5615,8 @@ static void endpaltostart(Context & context) { } static void startpaltoend(Context & context) { - context.es = context.ds.word(412); - context.ds = context.ds.word(412); + context.es = context.data.word(412); + context.ds = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5625,8 +5625,8 @@ static void startpaltoend(Context & context) { } static void paltoendpal(Context & context) { - context.es = context.ds.word(412); - context.ds = context.ds.word(412); + context.es = context.data.word(412); + context.ds = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5635,8 +5635,8 @@ static void paltoendpal(Context & context) { } static void allpalette(Context & context) { - context.es = context.ds.word(412); - context.ds = context.ds.word(412); + context.es = context.data.word(412); + context.ds = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5647,7 +5647,7 @@ static void allpalette(Context & context) { static void dumpcurrent(Context & context) { context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); vsync(context); context.al = 0; context.cx = 128; @@ -5662,7 +5662,7 @@ static void dumpcurrent(Context & context) { static void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5670,10 +5670,10 @@ static void fadedownmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 64; hangon(context); return; @@ -5682,7 +5682,7 @@ static void fadedownmon(Context & context) { static void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5690,10 +5690,10 @@ static void fadeupmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 128; hangon(context); return; @@ -5702,7 +5702,7 @@ static void fadeupmon(Context & context) { static void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5710,10 +5710,10 @@ static void fadeupmonfirst(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 64; hangon(context); context.al = 26; @@ -5725,7 +5725,7 @@ static void fadeupmonfirst(Context & context) { static void fadeupyellows(Context & context) { paltoendpal(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5733,10 +5733,10 @@ static void fadeupyellows(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.ds.byte(344) = 1; - context.ds.byte(346) = 63; - context.ds.byte(343) = 0; - context.ds.byte(345) = 128; + context.data.byte(344) = 1; + context.data.byte(346) = 63; + context.data.byte(343) = 0; + context.data.byte(345) = 128; context.cx = 128; hangon(context); return; @@ -5744,7 +5744,7 @@ static void fadeupyellows(Context & context) { static void initialmoncols(Context & context) { paltostartpal(context); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.cx = 3*9; context.ax = 0; @@ -5752,7 +5752,7 @@ static void initialmoncols(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.al = 230; context.cx = 18; @@ -5773,24 +5773,24 @@ static void endgame(Context & context) { monkspeaking(context); gettingshot(context); getridoftemptext(context); - context.ds.byte(387) = 7; - context.ds.byte(388) = 1; + context.data.byte(387) = 7; + context.data.byte(388) = 1; context.cx = 200; hangon(context); return; } static void monkspeaking(Context & context) { - context.ds.byte(531) = 35; + context.data.byte(531) = 35; loadroomssample(context); context.dx = 2377; loadintotemp(context); clearwork(context); showmonk(context); worktoscreen(context); - context.ds.byte(386) = 7; - context.ds.byte(388) = -1; - context.ds.byte(387) = 0; + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; context.al = 12; context.ah = 255; playchannel0(context); @@ -5803,7 +5803,7 @@ nextmonkspeak: context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -5829,8 +5829,8 @@ nextbit: context._add(context.al, 1); context._cmp(context.al, 44); if (!context.flags.z()) goto nextmonkspeak; - context.ds.byte(388) = 1; - context.ds.byte(387) = 7; + context.data.byte(388) = 1; + context.data.byte(387) = 7; fadescreendowns(context); context.cx = 300; hangon(context); @@ -5843,18 +5843,18 @@ static void showmonk(Context & context) { context.ah = 128; context.di = 160; context.bx = 72; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); return; } static void gettingshot(Context & context) { - context.ds.byte(188) = 55; + context.data.byte(188) = 55; clearpalette(context); loadintroroom(context); fadescreenups(context); - context.ds.byte(387) = 0; - context.ds.byte(388) = -1; + context.data.byte(387) = 0; + context.data.byte(388) = -1; runendseq(context); clearbeforeload(context); return; @@ -5887,7 +5887,7 @@ hangonloope: context.push(context.cx); vsync(context); context.cx = context.pop(); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; return; @@ -5902,28 +5902,28 @@ static void intro(Context & context) { loadtemptext(context); loadpalfromiff(context); setmode(context); - context.ds.byte(188) = 50; + context.data.byte(188) = 50; clearpalette(context); loadintroroom(context); - context.ds.byte(386) = 7; - context.ds.byte(388) = -1; - context.ds.byte(387) = 0; + context.data.byte(386) = 7; + context.data.byte(388) = -1; + context.data.byte(387) = 0; context.al = 12; context.ah = 255; playchannel0(context); fadescreenups(context); runintroseq(context); clearbeforeload(context); - context.ds.byte(188) = 52; + context.data.byte(188) = 52; loadintroroom(context); runintroseq(context); clearbeforeload(context); - context.ds.byte(188) = 53; + context.data.byte(188) = 53; loadintroroom(context); runintroseq(context); clearbeforeload(context); allpalette(context); - context.ds.byte(188) = 54; + context.data.byte(188) = 54; loadintroroom(context); runintroseq(context); getridoftemptext(context); @@ -5932,14 +5932,14 @@ static void intro(Context & context) { } static void runintroseq(Context & context) { - context.ds.byte(103) = 0; + context.data.byte(103) = 0; moreintroseq: vsync(context); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto earlyendrun; spriteupdate(context); vsync(context); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto earlyendrun; deleverything(context); printsprites(context); @@ -5947,14 +5947,14 @@ moreintroseq: afterintroroom(context); usetimedtext(context); vsync(context); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto earlyendrun; dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.ds.byte(392), 1); + context._cmp(context.data.byte(392), 1); if (context.flags.z()) goto earlyendrun; - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (!context.flags.z()) goto moreintroseq; return; earlyendrun: @@ -5967,7 +5967,7 @@ earlyendrun: static void runendseq(Context & context) { atmospheres(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; moreendseq: vsync(context); spriteupdate(context); @@ -5981,23 +5981,23 @@ moreendseq: dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (!context.flags.z()) goto moreendseq; return; } static void loadintroroom(Context & context) { - context.ds.byte(139) = 0; - context.ds.byte(9) = 255; + context.data.byte(139) = 0; + context.data.byte(9) = 255; loadroom(context); - context.ds.word(121) = 72; - context.ds.word(123) = 16; + context.data.word(121) = 72; + context.data.word(123) = 16; clearsprites(context); - context.ds.byte(61) = 0; - context.ds.byte(142) = '0'; - context.ds.byte(105) = 0; + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; clearwork(context); - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); @@ -6007,9 +6007,9 @@ static void loadintroroom(Context & context) { } static void realcredits(Context & context) { - context.ds.byte(531) = 33; + context.data.byte(531) = 33; loadroomssample(context); - context.ds.byte(386) = 0; + context.data.byte(386) = 0; mode640x480(context); context.cx = 35; hangon(context); @@ -6104,13 +6104,13 @@ static void printchar(Context & context) { context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.ds.word(71)); + context._add(context.ax, context.data.word(71)); showframe(context); context.ax = context.pop(); context.di = context.pop(); context.bx = context.pop(); context.si = context.pop(); - context._cmp(context.ds.byte(72), 0); + context._cmp(context.data.byte(72), 0); if (!context.flags.z()) goto nokern; kernchars(context); nokern: @@ -6146,9 +6146,9 @@ kernit: } static void printslow(Context & context) { - context.ds.byte(231) = 1; - context.ds.byte(234) = 3; - context.ds = context.ds.word(404); + context.data.byte(231) = 1; + context.data.byte(234) = 3; + context.ds = context.data.word(404); printloopslow6: context.push(context.bx); context.push(context.di); @@ -6187,9 +6187,9 @@ printloopslow5: context.push(context.es); context.push(context.si); modifychar(context); - context.ds.word(71) = 91; + context.data.word(71) = 91; printboth(context); - context.ds.word(71) = 0; + context.data.word(71) = 0; context.si = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -6199,14 +6199,14 @@ printloopslow5: waitframes(context); context._cmp(context.ax, 0); if (context.flags.z()) goto keepgoing; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (!context.flags.z()) goto finishslow2; keepgoing: waitframes(context); noslow: context._cmp(context.ax, 0); if (context.flags.z()) goto afterslow; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (!context.flags.z()) goto finishslow2; afterslow: context.es = context.pop(); @@ -6250,7 +6250,7 @@ static void waitframes(Context & context) { vsync(context); dumppointer(context); delpointer(context); - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context.ds = context.pop(); context.si = context.pop(); context.es = context.pop(); @@ -6277,8 +6277,8 @@ static void printboth(Context & context) { } static void printdirect(Context & context) { - context.ds.word(84) = context.di; - context.ds = context.ds.word(268); + context.data.word(84) = context.di; + context.ds = context.data.word(268); printloop6: context.push(context.bx); context.push(context.di); @@ -6296,14 +6296,14 @@ printloop5: context.push(context.es); modifychar(context); printchar(context); - context.ds.word(84) = context.di; + context.data.word(84) = context.di; context.es = context.pop(); context.cx = context.pop(); if (--context.cx) goto printloop5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - context._add(context.bx, context.ds.word(77)); + context._add(context.bx, context.data.word(77)); goto printloop6; finishdirct: context.dx = context.pop(); @@ -6313,12 +6313,12 @@ finishdirct: } static void monprint(Context & context) { - context.ds.byte(72) = 1; + context.data.byte(72) = 1; context.si = context.bx; context.dl = 166; - context.di = context.ds.word(318); - context.bx = context.ds.word(320); - context.ds = context.ds.word(406); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); printloop8: context.push(context.bx); context.push(context.di); @@ -6347,9 +6347,9 @@ nottrigger: context.push(context.es); modifychar(context); printchar(context); - context.ds.word(312) = context.di; - context.ds.word(314) = context.bx; - context.ds.word(138) = 1; + context.data.word(312) = context.di; + context.data.word(314) = context.bx; + context.data.word(138) = 1; printcurs(context); vsync(context); context.push(context.si); @@ -6374,7 +6374,7 @@ finishmon2: context.di = context.pop(); context.bx = context.pop(); scrollmonitor(context); - context.ds.word(312) = context.di; + context.data.word(312) = context.di; goto printloop8; finishmon: context.dx = context.pop(); @@ -6382,12 +6382,12 @@ finishmon: context.bx = context.pop(); context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger2; - context.ds.byte(55) = context.ah; + context.data.byte(55) = context.ah; nottrigger2: - context.ds.word(312) = context.di; + context.data.word(312) = context.di; scrollmonitor(context); context.bx = context.si; - context.ds.byte(72) = 0; + context.data.byte(72) = 0; return; } @@ -6512,7 +6512,7 @@ getloop: context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.ds.word(71)); + context._add(context.ax, context.data.word(71)); context._add(context.ax, context.ax); context.si = context.ax; context._add(context.ax, context.ax); @@ -6590,11 +6590,11 @@ nomod: } static void fillryan(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32; findallryan(context); context.si = 0+(228*13)+32; - context.al = context.ds.byte(19); + context.al = context.data.byte(19); context.ah = 0; context.cx = 20; context._mul(context.cx); @@ -6641,7 +6641,7 @@ static void fillopen(Context & context) { lessthanapage: context.al = 1; context.push(context.ax); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13); findallopen(context); context.si = 0+(228*13); @@ -6680,7 +6680,7 @@ static void findallryan(Context & context) { while(--context.cx) context._stosw(); context.di = context.pop(); context.cl = 4; - context.ds = context.ds.word(398); + context.ds = context.data.word(398); context.bx = 0+2080+30000; context.ch = 0; findryanloop: @@ -6711,9 +6711,9 @@ static void findallopen(Context & context) { context.ax = 0x0ffff; while(--context.cx) context._stosw(); context.di = context.pop(); - context.cl = context.ds.byte(110); - context.dl = context.ds.byte(111); - context.ds = context.ds.word(398); + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); + context.ds = context.data.word(398); context.bx = 0+2080+30000; context.ch = 0; findopen1: @@ -6721,10 +6721,10 @@ findopen1: if (!context.flags.z()) goto findopen2; context._cmp(context.ds.byte(context.bx+2), context.dl); if (!context.flags.z()) goto findopen2; - context._cmp(context.ds.byte(111), 4); + context._cmp(context.data.byte(111), 4); if (context.flags.z()) goto noloccheck; context.al = context.ds.byte(context.bx+5); - context._cmp(context.al, context.ds.byte(184)); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto findopen2; noloccheck: context.al = context.ds.byte(context.bx+4); @@ -6741,10 +6741,10 @@ findopen2: context._add(context.ch, 1); context._cmp(context.ch, 114); if (!context.flags.z()) goto findopen1; - context.cl = context.ds.byte(110); - context.dl = context.ds.byte(111); + context.cl = context.data.byte(110); + context.dl = context.data.byte(111); context.push(context.dx); - context.ds = context.ds.word(426); + context.ds = context.data.word(426); context.dx = context.pop(); context.bx = 0; context.ch = 0; @@ -6778,7 +6778,7 @@ static void obtoinv(Context & context) { context.push(context.ax); context.push(context.di); context.push(context.bx); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context._sub(context.di, 2); context._sub(context.bx, 1); context.al = 10; @@ -6792,10 +6792,10 @@ static void obtoinv(Context & context) { context.push(context.bx); context.push(context.di); context.push(context.ax); - context.ds = context.ds.word(398); + context.ds = context.data.word(398); context._cmp(context.ah, 4); if (context.flags.z()) goto isanextra; - context.ds = context.ds.word(446); + context.ds = context.data.word(446); isanextra: context.cl = context.al; context._add(context.al, context.al); @@ -6813,7 +6813,7 @@ isanextra: isitworn(context); context.bx = context.pop(); if (!context.flags.z()) goto finishfill; - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context._sub(context.di, 3); context._sub(context.bx, 2); context.al = 7; @@ -6844,18 +6844,18 @@ static void makeworn(Context & context) { } static void examineob(Context & context) { - context.ds.byte(234) = 0; - context.ds.word(328) = 0; + context.data.byte(234) = 0; + context.data.word(328) = 0; examineagain: - context.ds.byte(237) = 0; - context.ds.byte(108) = 0; - context.ds.byte(110) = 255; - context.ds.byte(111) = 255; - context.ds.byte(104) = 0; - context.al = context.ds.byte(100); - context.ds.byte(102) = context.al; - context.ds.byte(89) = 0; - context.ds.byte(231) = 0; + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; createpanel(context); showpanel(context); showman(context); @@ -6864,7 +6864,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -6876,41 +6876,41 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; context.bx = 2494; - context._cmp(context.ds.byte(104), 0); + context._cmp(context.data.byte(104), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.ds.byte(104), 1); + context._cmp(context.data.byte(104), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.ds.byte(108), 0); + context._cmp(context.data.byte(108), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto waitexam; - context.ds.byte(106) = 0; - context._cmp(context.ds.word(21), 0); + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.ds.byte(188), 255); + context._cmp(context.data.byte(188), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.ds.byte(104) = 0; - context.ds.byte(110) = 255; + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; justgetback: - context.ds.byte(104) = 0; - context.ds.byte(110) = 255; + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; } static void makemainscreen(Context & context) { createpanel(context); - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); spriteupdate(context); printsprites(context); @@ -6918,16 +6918,16 @@ static void makemainscreen(Context & context) { showicon(context); getunderzoom(context); undertextline(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; animpointer(context); worktoscreenm(context); - context.ds.byte(100) = 200; - context.ds.byte(131) = 0; + context.data.byte(100) = 200; + context.data.byte(131) = 0; return; } static void getbackfromob(Context & context) { - context._cmp(context.ds.byte(106), 1); + context._cmp(context.data.byte(106), 1); if (!context.flags.z()) goto notheldob; blank(context); return; @@ -6937,25 +6937,25 @@ notheldob: } static void incryanpage(Context & context) { - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadyincryan; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 31; commandonly(context); alreadyincryan: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noincryan; context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: return; doincryan: - context.ax = context.ds.word(198); + context.ax = context.data.word(198); context._sub(context.ax, 80+167); - context.ds.byte(19) = -1; + context.data.byte(19) = -1; findnewpage: - context._add(context.ds.byte(19), 1); + context._add(context.data.byte(19), 1); context._sub(context.ax, 18); if (!context.flags.c()) goto findnewpage; delpointer(context); @@ -6968,32 +6968,32 @@ findnewpage: } static void openinv(Context & context) { - context.ds.byte(104) = 1; + context.data.byte(104) = 1; context.al = 61; context.di = 80; context.bx = 58-10; context.dl = 240; printmessage(context); fillryan(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; return; } static void showryanpage(Context & context) { - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 80+167; context.bx = 58-12; context.al = 12; context.ah = 0; showframe(context); context.al = 13; - context._add(context.al, context.ds.byte(19)); + context._add(context.al, context.data.byte(19)); context.push(context.ax); - context.al = context.ds.byte(19); + context.al = context.data.byte(19); context.ah = 0; context.cx = 18; context._mul(context.cx); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 80+167; context._add(context.di, context.ax); context.bx = 58-12; @@ -7004,8 +7004,8 @@ static void showryanpage(Context & context) { } static void openob(Context & context) { - context.al = context.ds.byte(110); - context.ah = context.ds.byte(111); + context.al = context.data.byte(110); + context.ah = context.data.byte(111); context.di = 5674; copyname(context); context.di = 80; @@ -7013,7 +7013,7 @@ static void openob(Context & context) { context.al = 62; context.dl = 240; printmessage(context); - context.di = context.ds.word(84); + context.di = context.data.word(84); context._add(context.di, 5); context.bx = 58+86; context.es = context.cs; @@ -7035,18 +7035,18 @@ static void openob(Context & context) { } static void obicons(Context & context) { - context.al = context.ds.byte(99); + context.al = context.data.byte(99); getanyad(context); context._cmp(context.al, 255); if (context.flags.z()) goto cantopenit; - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.di = 210; context.bx = 1; context.al = 4; context.ah = 0; showframe(context); cantopenit: - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.di = 260; context.bx = 1; context.al = 1; @@ -7056,7 +7056,7 @@ cantopenit: } static void examicon(Context & context) { - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context.di = 254; context.bx = 5; context.al = 3; @@ -7066,13 +7066,13 @@ static void examicon(Context & context) { } static void obpicture(Context & context) { - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); context._cmp(context.ah, 1); if (context.flags.z()) goto setframe; context._cmp(context.ah, 4); if (context.flags.z()) goto exframe; - context.ds = context.ds.word(446); + context.ds = context.data.word(446); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7085,7 +7085,7 @@ static void obpicture(Context & context) { setframe: return; exframe: - context.ds = context.ds.word(398); + context.ds = context.data.word(398); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7101,18 +7101,18 @@ static void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; - context._cmp(context.ds.byte(102), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto notsetd; context.bx = 82; notsetd: context.dl = 241; context.ah = 16; - context.ds.word(71) = 91+91; + context.data.word(71) = 91+91; printdirect(context); - context.ds.word(71) = 0; + context.data.word(71) = 0; context.di = 36; context.bx = 104; - context._cmp(context.ds.byte(102), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto notsetd2; context.bx = 94; notsetd2: @@ -7129,16 +7129,16 @@ notsetd2: static void additionaltext(Context & context) { context._add(context.bx, 10); context.push(context.bx); - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto emptycup; - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -7168,8 +7168,8 @@ fullcup: } static void obsthatdothings(Context & context) { - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -7190,21 +7190,21 @@ notlouiscard: } static void getobtextstart(Context & context) { - context.es = context.ds.word(438); + context.es = context.data.word(438); context.si = 0; context.cx = 0+(82*2); - context._cmp(context.ds.byte(102), 2); + context._cmp(context.data.byte(102), 2); if (context.flags.z()) goto describe; - context.es = context.ds.word(440); + context.es = context.data.word(440); context.si = 0; context.cx = 0+(130*2); - context._cmp(context.ds.byte(102), 1); + context._cmp(context.data.byte(102), 1); if (context.flags.z()) goto describe; - context.es = context.ds.word(398); + context.es = context.data.word(398); context.si = 0+2080+30000+(16*114); context.cx = 0+2080+30000+(16*114)+((114+2)*2); describe: - context.al = context.ds.byte(99); + context.al = context.data.byte(99); context.ah = 0; context._add(context.ax, context.ax); context._add(context.si, context.ax); @@ -7218,7 +7218,7 @@ tryagain: context.al = context.ds.byte(context.si); context.cx = context.si; context.si = context.pop(); - context._cmp(context.ds.byte(102), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto cantmakeoneup; context._cmp(context.al, 0); if (context.flags.z()) goto findsometext; @@ -7283,31 +7283,31 @@ endofcolon: } static void inventory(Context & context) { - context._cmp(context.ds.byte(56), 1); + context._cmp(context.data.byte(56), 1); if (context.flags.z()) goto iswatchinv; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); return; notwatchinv: - context._cmp(context.ds.byte(100), 239); + context._cmp(context.data.byte(100), 239); if (context.flags.z()) goto alreadyopinv; - context.ds.byte(100) = 239; + context.data.byte(100) = 239; context.al = 32; commandonly(context); alreadyopinv: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto cantopinv; context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: return; doopeninv: - context.ds.word(328) = 0; - context.ds.byte(234) = 0; - context.ds.byte(237) = 0; + context.data.word(328) = 0; + context.data.byte(234) = 0; + context.data.byte(237) = 0; animpointer(context); createpanel(context); showpanel(context); @@ -7315,26 +7315,26 @@ doopeninv: showman(context); showexit(context); undertextline(context); - context.ds.byte(106) = 0; - context.ds.byte(104) = 2; + context.data.byte(106) = 0; + context.data.byte(104) = 2; openinv(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.ds.byte(110) = 255; + context.data.byte(110) = 255; goto waitexam; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: - context.ds.byte(237) = 0; - context.ds.byte(108) = 0; - context.ds.byte(110) = 255; - context.ds.byte(111) = 255; - context.ds.byte(104) = 0; - context.al = context.ds.byte(100); - context.ds.byte(102) = context.al; - context.ds.byte(89) = 0; - context.ds.byte(231) = 0; + context.data.byte(237) = 0; + context.data.byte(108) = 0; + context.data.byte(110) = 255; + context.data.byte(111) = 255; + context.data.byte(104) = 0; + context.al = context.data.byte(100); + context.data.byte(102) = context.al; + context.data.byte(89) = 0; + context.data.byte(231) = 0; createpanel(context); showpanel(context); showman(context); @@ -7343,7 +7343,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -7355,35 +7355,35 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; context.bx = 2494; - context._cmp(context.ds.byte(104), 0); + context._cmp(context.data.byte(104), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.ds.byte(104), 1); + context._cmp(context.data.byte(104), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.ds.byte(108), 0); + context._cmp(context.data.byte(108), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto waitexam; - context.ds.byte(106) = 0; - context._cmp(context.ds.word(21), 0); + context.data.byte(106) = 0; + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.ds.byte(188), 255); + context._cmp(context.data.byte(188), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.ds.byte(104) = 0; - context.ds.byte(110) = 255; + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; justgetback: - context.ds.byte(104) = 0; - context.ds.byte(110) = 255; + context.data.byte(104) = 0; + context.data.byte(110) = 255; return; examlist: invlist1: @@ -7393,9 +7393,9 @@ withlist1: } static void setpickup(Context & context) { - context._cmp(context.ds.byte(102), 1); + context._cmp(context.data.byte(102), 1); if (context.flags.z()) goto cantpick; - context._cmp(context.ds.byte(102), 3); + context._cmp(context.data.byte(102), 3); if (context.flags.z()) goto cantpick; getanyad(context); context.al = context.ds.byte(context.bx+2); @@ -7405,18 +7405,18 @@ cantpick: blank(context); return; canpick: - context._cmp(context.ds.byte(100), 209); + context._cmp(context.data.byte(100), 209); if (context.flags.z()) goto alreadysp; - context.ds.byte(100) = 209; - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(102); + context.data.byte(100) = 209; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); context.al = 33; commandwithob(context); alreadysp: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto nosetpick; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (!context.flags.z()) goto dosetpick; nosetpick: return; @@ -7426,16 +7426,16 @@ dosetpick: showman(context); showexit(context); examicon(context); - context.ds.byte(106) = 1; - context.ds.byte(104) = 2; - context._cmp(context.ds.byte(102), 4); + context.data.byte(106) = 1; + context.data.byte(104) = 2; + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto pickupexob; - context.al = context.ds.byte(99); - context.ds.byte(89) = context.al; - context.ds.byte(110) = 255; + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; transfertoex(context); - context.ds.byte(89) = context.al; - context.ds.byte(102) = 4; + context.data.byte(89) = context.al; + context.data.byte(102) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -7443,22 +7443,22 @@ dosetpick: worktoscreenm(context); return; pickupexob: - context.al = context.ds.byte(99); - context.ds.byte(89) = context.al; - context.ds.byte(110) = 255; + context.al = context.data.byte(99); + context.data.byte(89) = context.al; + context.data.byte(110) = 255; openinv(context); worktoscreenm(context); return; } static void examinventory(Context & context) { - context._cmp(context.ds.byte(100), 249); + context._cmp(context.data.byte(100), 249); if (context.flags.z()) goto alreadyexinv; - context.ds.byte(100) = 249; + context.data.byte(100) = 249; context.al = 32; commandonly(context); alreadyexinv: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; return; @@ -7468,8 +7468,8 @@ doexinv: showman(context); showexit(context); examicon(context); - context.ds.byte(106) = 0; - context.ds.byte(104) = 2; + context.data.byte(106) = 0; + context.data.byte(104) = 2; openinv(context); worktoscreenm(context); return; @@ -7478,10 +7478,10 @@ doexinv: static void reexfrominv(Context & context) { findinvpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(100) = context.ah; - context.ds.byte(99) = context.al; - context.ds.byte(108) = 1; - context.ds.byte(234) = 0; + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; return; } @@ -7489,62 +7489,62 @@ static void reexfromopen(Context & context) { return; findopenpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(100) = context.ah; - context.ds.byte(99) = context.al; - context.ds.byte(108) = 1; - context.ds.byte(234) = 0; + context.data.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(108) = 1; + context.data.byte(234) = 0; return; } static void swapwithinv(Context & context) { - context.al = context.ds.byte(89); - context.ah = context.ds.byte(102); - context._cmp(context.ax, context.ds.word(94)); + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub7; - context._cmp(context.ds.byte(100), 243); + context._cmp(context.data.byte(100), 243); if (context.flags.z()) goto alreadyswap1; - context.ds.byte(100) = 243; + context.data.byte(100) = 243; difsub7: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap1: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto cantswap1; context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: return; doswap1: - context.ah = context.ds.byte(102); - context.al = context.ds.byte(89); + context.ah = context.data.byte(102); + context.al = context.data.byte(89); context.push(context.ax); findinvpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(89) = context.al; - context.ds.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; - context.bl = context.ds.byte(89); - context.bh = context.ds.byte(102); + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); context.ax = context.pop(); - context.ds.byte(102) = context.ah; - context.ds.byte(89) = context.al; + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; context.push(context.bx); findinvpos(context); delpointer(context); - context.al = context.ds.byte(89); + context.al = context.data.byte(89); geteitherad(context); context.ds.byte(context.bx+2) = 4; context.ds.byte(context.bx+3) = 255; - context.al = context.ds.byte(107); + context.al = context.data.byte(107); context.ds.byte(context.bx+4) = context.al; context.ax = context.pop(); - context.ds.byte(102) = context.ah; - context.ds.byte(89) = context.al; + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; fillryan(context); readmouse(context); showpointer(context); @@ -7554,21 +7554,21 @@ doswap1: } static void swapwithopen(Context & context) { - context.al = context.ds.byte(89); - context.ah = context.ds.byte(102); - context._cmp(context.ax, context.ds.word(94)); + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub8; - context._cmp(context.ds.byte(100), 242); + context._cmp(context.data.byte(100), 242); if (context.flags.z()) goto alreadyswap2; - context.ds.byte(100) = 242; + context.data.byte(100) = 242; difsub8: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap2: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto cantswap2; context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; @@ -7582,11 +7582,11 @@ doswap2: return; notwornswap: delpointer(context); - context.al = context.ds.byte(89); - context._cmp(context.al, context.ds.byte(110)); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); if (!context.flags.z()) goto isntsame2; - context.al = context.ds.byte(102); - context._cmp(context.al, context.ds.byte(111)); + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); if (!context.flags.z()) goto isntsame2; errormessage1(context); return; @@ -7596,13 +7596,13 @@ isntsame2: if (context.flags.z()) goto sizeok2; return; sizeok2: - context.ah = context.ds.byte(102); - context.al = context.ds.byte(89); + context.ah = context.data.byte(102); + context.al = context.data.byte(89); context.push(context.ax); findopenpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(89) = context.al; - context.ds.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeswapex; geteitherad(context); @@ -7611,31 +7611,31 @@ sizeok2: goto actuallyswap; makeswapex: transfertoex(context); - context.ds.byte(89) = context.al; - context.ds.byte(102) = 4; + context.data.byte(89) = context.al; + context.data.byte(102) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; actuallyswap: - context.bl = context.ds.byte(89); - context.bh = context.ds.byte(102); + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); context.ax = context.pop(); - context.ds.byte(102) = context.ah; - context.ds.byte(89) = context.al; + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; context.push(context.bx); findopenpos(context); geteitherad(context); - context.al = context.ds.byte(111); + context.al = context.data.byte(111); context.ds.byte(context.bx+2) = context.al; - context.al = context.ds.byte(110); + context.al = context.data.byte(110); context.ds.byte(context.bx+3) = context.al; - context.al = context.ds.byte(107); + context.al = context.data.byte(107); context.ds.byte(context.bx+4) = context.al; - context.al = context.ds.byte(184); + context.al = context.data.byte(184); context.ds.byte(context.bx+5) = context.al; context.ax = context.pop(); - context.ds.byte(102) = context.ah; - context.ds.byte(89) = context.al; + context.data.byte(102) = context.ah; + context.data.byte(89) = context.al; fillopen(context); fillryan(context); undertextline(context); @@ -7648,7 +7648,7 @@ actuallyswap: } static void intoinv(Context & context) { - context._cmp(context.ds.byte(106), 0); + context._cmp(context.data.byte(106), 0); if (!context.flags.z()) goto notout; outofinv(context); return; @@ -7660,21 +7660,21 @@ notout: swapwithinv(context); return; canplace1: - context.al = context.ds.byte(89); - context.ah = context.ds.byte(102); - context._cmp(context.ax, context.ds.word(94)); + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub1; - context._cmp(context.ds.byte(100), 220); + context._cmp(context.data.byte(100), 220); if (context.flags.z()) goto alreadyplce; - context.ds.byte(100) = 220; + context.data.byte(100) = 220; difsub1: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplce: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notletgo2; context._and(context.ax, 1); if (!context.flags.z()) goto doplace; @@ -7682,13 +7682,13 @@ notletgo2: return; doplace: delpointer(context); - context.al = context.ds.byte(89); + context.al = context.data.byte(89); getexad(context); context.ds.byte(context.bx+2) = 4; context.ds.byte(context.bx+3) = 255; - context.al = context.ds.byte(107); + context.al = context.data.byte(107); context.ds.byte(context.bx+4) = context.al; - context.ds.byte(106) = 0; + context.data.byte(106) = 0; fillryan(context); readmouse(context); showpointer(context); @@ -7699,9 +7699,9 @@ doplace: } static void deletetaken(Context & context) { - context.es = context.ds.word(426); - context.ah = context.ds.byte(184); - context.ds = context.ds.word(398); + context.es = context.data.word(426); + context.ah = context.data.byte(184); + context.ds = context.data.word(398); context.si = 0+2080+30000; context.cx = 114; takenloop: @@ -7729,25 +7729,25 @@ static void outofinv(Context & context) { blank(context); return; canpick2: - context.bx = context.ds.word(202); + context.bx = context.data.word(202); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); return; canpick2a: - context._cmp(context.ax, context.ds.word(94)); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub3; - context._cmp(context.ds.byte(100), 221); + context._cmp(context.data.byte(100), 221); if (context.flags.z()) goto alreadygrab; - context.ds.byte(100) = 221; + context.data.byte(100) = 221; difsub3: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrab: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notletgo; context._and(context.ax, 1); if (!context.flags.z()) goto dograb; @@ -7755,11 +7755,11 @@ notletgo: return; dograb: delpointer(context); - context.ds.byte(106) = 1; + context.data.byte(106) = 1; findinvpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(89) = context.al; - context.ds.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; getexad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -7777,7 +7777,7 @@ static void getfreead(Context & context) { context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; - context.es = context.ds.word(426); + context.es = context.data.word(426); return; } @@ -7786,39 +7786,39 @@ static void getexad(Context & context) { context.bx = 16; context._mul(context.bx); context.bx = context.ax; - context.es = context.ds.word(398); + context.es = context.data.word(398); context._add(context.bx, 0+2080+30000); return; } static void geteitherad(Context & context) { - context._cmp(context.ds.byte(102), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto isinexlist; - context.al = context.ds.byte(89); + context.al = context.data.byte(89); getfreead(context); return; isinexlist: - context.al = context.ds.byte(89); + context.al = context.data.byte(89); getexad(context); return; } static void getanyad(Context & context) { - context._cmp(context.ds.byte(102), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto isex; - context._cmp(context.ds.byte(102), 2); + context._cmp(context.data.byte(102), 2); if (context.flags.z()) goto isfree; - context.al = context.ds.byte(99); + context.al = context.data.byte(99); getsetad(context); context.ax = context.ds.word(context.bx+4); return; isfree: - context.al = context.ds.byte(99); + context.al = context.data.byte(99); getfreead(context); context.ax = context.ds.word(context.bx+7); return; isex: - context.al = context.ds.byte(99); + context.al = context.data.byte(99); getexad(context); context.ax = context.ds.word(context.bx+7); return; @@ -7840,21 +7840,21 @@ isex3: } static void getopenedsize(Context & context) { - context._cmp(context.ds.byte(111), 4); + context._cmp(context.data.byte(111), 4); if (context.flags.z()) goto isex2; - context._cmp(context.ds.byte(111), 2); + context._cmp(context.data.byte(111), 2); if (context.flags.z()) goto isfree2; - context.al = context.ds.byte(110); + context.al = context.data.byte(110); getsetad(context); context.ax = context.ds.word(context.bx+3); return; isfree2: - context.al = context.ds.byte(110); + context.al = context.data.byte(110); getfreead(context); context.ax = context.ds.word(context.bx+7); return; isex2: - context.al = context.ds.byte(110); + context.al = context.data.byte(110); getexad(context); context.ax = context.ds.word(context.bx+7); return; @@ -7865,40 +7865,40 @@ static void getsetad(Context & context) { context.bx = 64; context._mul(context.bx); context.bx = context.ax; - context.es = context.ds.word(428); + context.es = context.data.word(428); return; } static void findinvpos(Context & context) { - context.cx = context.ds.word(198); + context.cx = context.data.word(198); context._sub(context.cx, 80); context.bx = -1; findinv1: context._add(context.bx, 1); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv1; - context.cx = context.ds.word(200); + context.cx = context.data.word(200); context._sub(context.cx, 58); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv2; - context.al = context.ds.byte(19); + context.al = context.data.byte(19); context.ah = 0; context.cx = 10; context._mul(context.cx); context._add(context.bx, context.ax); context.al = context.bl; - context.ds.byte(107) = context.al; + context.data.byte(107) = context.al; context._add(context.bx, context.bx); - context.es = context.ds.word(412); + context.es = context.data.word(412); context._add(context.bx, 0+(228*13)+32); return; } static void findopenpos(Context & context) { - context.cx = context.ds.word(198); + context.cx = context.data.word(198); context._sub(context.cx, 80); context.bx = -1; findopenp1: @@ -7906,26 +7906,26 @@ findopenp1: context._sub(context.cx, 44); if (!context.flags.c()) goto findopenp1; context.al = context.bl; - context.ds.byte(107) = context.al; + context.data.byte(107) = context.al; context._add(context.bx, context.bx); - context.es = context.ds.word(412); + context.es = context.data.word(412); context._add(context.bx, 0+(228*13)); return; } static void dropobject(Context & context) { - context._cmp(context.ds.byte(100), 223); + context._cmp(context.data.byte(100), 223); if (context.flags.z()) goto alreadydrop; - context.ds.byte(100) = 223; - context._cmp(context.ds.byte(106), 0); + context.data.byte(100) = 223; + context._cmp(context.data.byte(106), 0); if (context.flags.z()) { blank(context); return; }; - context.bl = context.ds.byte(89); - context.bh = context.ds.byte(102); + context.bl = context.data.byte(89); + context.bh = context.data.byte(102); context.al = 37; commandwithob(context); alreadydrop: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nodrop; context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; @@ -7938,11 +7938,11 @@ dodrop: wornerror(context); return; nowornerror: - context._cmp(context.ds.byte(184), 47); + context._cmp(context.data.byte(184), 47); if (context.flags.z()) goto nodrop2; - context.cl = context.ds.byte(151); + context.cl = context.data.byte(151); context._add(context.cl, 12); - context.ch = context.ds.byte(152); + context.ch = context.data.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); @@ -7951,14 +7951,14 @@ nodrop2: droperror(context); return; nodroperror: - context._cmp(context.ds.byte(128), 64); + context._cmp(context.data.byte(128), 64); if (!context.flags.z()) goto notinlift; - context._cmp(context.ds.byte(129), 64); + context._cmp(context.data.byte(129), 64); if (!context.flags.z()) goto notinlift; droperror(context); return; notinlift: - context.al = context.ds.byte(89); + context.al = context.data.byte(89); context.ah = 4; context.cl = 'G'; context.ch = 'U'; @@ -7966,7 +7966,7 @@ notinlift: context.dh = 'A'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.al = context.ds.byte(89); + context.al = context.data.byte(89); context.ah = 4; context.cl = 'S'; context.ch = 'H'; @@ -7974,38 +7974,38 @@ notinlift: context.dh = 'D'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.ds.byte(102) = 4; - context.al = context.ds.byte(89); + context.data.byte(102) = 4; + context.al = context.data.byte(89); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.ds.byte(151); + context.al = context.data.byte(151); context._add(context.al, 4); context.cl = 4; context._shr(context.al, context.cl); - context._add(context.al, context.ds.byte(148)); - context.ah = context.ds.byte(152); + context._add(context.al, context.data.byte(148)); + context.ah = context.data.byte(152); context._add(context.ah, 8); context.cl = 4; context._shr(context.ah, context.cl); - context._add(context.ah, context.ds.byte(149)); + context._add(context.ah, context.data.byte(149)); context.ds.byte(context.bx+3) = context.al; context.ds.byte(context.bx+5) = context.ah; - context.al = context.ds.byte(151); + context.al = context.data.byte(151); context._add(context.al, 4); context._and(context.al, 15); - context.ah = context.ds.byte(152); + context.ah = context.data.byte(152); context._add(context.ah, 8); context._and(context.ah, 15); context.ds.byte(context.bx+4) = context.al; context.ds.byte(context.bx+6) = context.ah; - context.ds.byte(106) = 0; - context.al = context.ds.byte(184); + context.data.byte(106) = 0; + context.al = context.data.byte(184); context.ds.byte(context.bx) = context.al; return; } static void droperror(Context & context) { - context.ds.byte(100) = 255; + context.data.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8018,13 +8018,13 @@ static void droperror(Context & context) { showpanel(context); showman(context); examicon(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; worktoscreenm(context); return; } static void cantdrop(Context & context) { - context.ds.byte(100) = 255; + context.data.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8037,13 +8037,13 @@ static void cantdrop(Context & context) { showpanel(context); showman(context); examicon(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; worktoscreenm(context); return; } static void wornerror(Context & context) { - context.ds.byte(100) = 255; + context.data.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8056,17 +8056,17 @@ static void wornerror(Context & context) { showpanel(context); showman(context); examicon(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; worktoscreenm(context); return; } static void removeobfrominv(Context & context) { - context._cmp(context.ds.byte(99), 100); + context._cmp(context.data.byte(99), 100); if (context.flags.z()) goto obnotexist; getanyad(context); context.di = context.bx; - context.cl = context.ds.byte(99); + context.cl = context.data.byte(99); context.ch = 0; deleteexobject(context); obnotexist: @@ -8074,33 +8074,33 @@ obnotexist: } static void selectopenob(Context & context) { - context.al = context.ds.byte(99); + context.al = context.data.byte(99); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); return; canopenit1: - context._cmp(context.ds.byte(100), 224); + context._cmp(context.data.byte(100), 224); if (context.flags.z()) goto alreadyopob; - context.ds.byte(100) = 224; - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(102); + context.data.byte(100) = 224; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); context.al = 38; commandwithob(context); alreadyopob: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noopenob; context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: return; doopenob: - context.al = context.ds.byte(99); - context.ds.byte(110) = context.al; - context.al = context.ds.byte(102); - context.ds.byte(111) = context.al; + context.al = context.data.byte(99); + context.data.byte(110) = context.al; + context.al = context.data.byte(102); + context.data.byte(111) = context.al; createpanel(context); showpanel(context); showman(context); @@ -8117,9 +8117,9 @@ doopenob: } static void useopened(Context & context) { - context._cmp(context.ds.byte(110), 255); + context._cmp(context.data.byte(110), 255); if (context.flags.z()) goto cannotuseopen; - context._cmp(context.ds.byte(106), 0); + context._cmp(context.data.byte(106), 0); if (!context.flags.z()) goto notout2; outofopen(context); return; @@ -8132,26 +8132,26 @@ notout2: cannotuseopen: return; canplace3: - context._cmp(context.ds.byte(106), 1); + context._cmp(context.data.byte(106), 1); if (context.flags.z()) goto intoopen; blank(context); return; intoopen: - context.al = context.ds.byte(89); - context.ah = context.ds.byte(102); - context._cmp(context.ax, context.ds.word(94)); + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub2; - context._cmp(context.ds.byte(100), 227); + context._cmp(context.data.byte(100), 227); if (context.flags.z()) goto alreadyplc2; - context.ds.byte(100) = 227; + context.data.byte(100) = 227; difsub2: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplc2: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notletgo3; context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; @@ -8165,11 +8165,11 @@ doplace2: return; notworntoopen: delpointer(context); - context.al = context.ds.byte(89); - context._cmp(context.al, context.ds.byte(110)); + context.al = context.data.byte(89); + context._cmp(context.al, context.data.byte(110)); if (!context.flags.z()) goto isntsame; - context.al = context.ds.byte(102); - context._cmp(context.al, context.ds.byte(111)); + context.al = context.data.byte(102); + context._cmp(context.al, context.data.byte(111)); if (!context.flags.z()) goto isntsame; errormessage1(context); return; @@ -8179,16 +8179,16 @@ isntsame: if (context.flags.z()) goto sizeok1; return; sizeok1: - context.ds.byte(106) = 0; - context.al = context.ds.byte(89); + context.data.byte(106) = 0; + context.al = context.data.byte(89); geteitherad(context); - context.al = context.ds.byte(111); + context.al = context.data.byte(111); context.ds.byte(context.bx+2) = context.al; - context.al = context.ds.byte(110); + context.al = context.data.byte(110); context.ds.byte(context.bx+3) = context.al; - context.al = context.ds.byte(107); + context.al = context.data.byte(107); context.ds.byte(context.bx+4) = context.al; - context.al = context.ds.byte(184); + context.al = context.data.byte(184); context.ds.byte(context.bx+5) = context.al; fillopen(context); undertextline(context); @@ -8225,7 +8225,7 @@ static void errormessage1(Context & context) { } static void errormessage2(Context & context) { - context.ds.byte(100) = 255; + context.data.byte(100) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8273,7 +8273,7 @@ static void errormessage3(Context & context) { static void checkobjectsize(Context & context) { getopenedsize(context); context.push(context.ax); - context.al = context.ds.byte(89); + context.al = context.data.byte(89); geteitherad(context); context.al = context.ds.byte(context.bx+9); context.cx = context.pop(); @@ -8312,7 +8312,7 @@ sizeok: } static void outofopen(Context & context) { - context._cmp(context.ds.byte(110), 255); + context._cmp(context.data.byte(110), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); context.ax = context.ds.word(context.bx); @@ -8322,19 +8322,19 @@ cantuseopen: blank(context); return; canpick4: - context._cmp(context.ax, context.ds.word(94)); + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto difsub4; - context._cmp(context.ds.byte(100), 228); + context._cmp(context.data.byte(100), 228); if (context.flags.z()) goto alreadygrb; - context.ds.byte(100) = 228; + context.data.byte(100) = 228; difsub4: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrb: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notletgo4; context._cmp(context.ax, 1); if (context.flags.z()) goto dogrb; @@ -8345,11 +8345,11 @@ notletgo4: return; dogrb: delpointer(context); - context.ds.byte(106) = 1; + context.data.byte(106) = 1; findopenpos(context); context.ax = context.ds.word(context.bx); - context.ds.byte(89) = context.al; - context.ds.byte(102) = context.ah; + context.data.byte(89) = context.al; + context.data.byte(102) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeintoex; geteitherad(context); @@ -8358,8 +8358,8 @@ dogrb: goto actuallyout; makeintoex: transfertoex(context); - context.ds.byte(89) = context.al; - context.ds.byte(102) = 4; + context.data.byte(89) = context.al; + context.data.byte(102) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -8377,37 +8377,37 @@ actuallyout: static void transfertoex(Context & context) { emergencypurge(context); getexpos(context); - context.al = context.ds.byte(10); + context.al = context.data.byte(10); context.push(context.ax); context.push(context.di); - context.al = context.ds.byte(89); + context.al = context.data.byte(89); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.ds.word(426); + context.ds = context.data.word(426); context.si = context.ax; context.cx = 8; while(--context.cx) context._movsw(); context.di = context.pop(); - context.al = context.ds.byte(184); + context.al = context.data.byte(184); context.ds.byte(context.di) = context.al; context.ds.byte(context.di+11) = context.al; - context.al = context.ds.byte(89); + context.al = context.data.byte(89); context.ds.byte(context.di+1) = context.al; context.ds.byte(context.di+2) = 4; context.ds.byte(context.di+3) = 255; - context.al = context.ds.byte(107); + context.al = context.data.byte(107); context.ds.byte(context.di+4) = context.al; - context.al = context.ds.byte(89); - context.ds.byte(90) = context.al; + context.al = context.data.byte(89); + context.data.byte(90) = context.al; transfermap(context); transferinv(context); transfertext(context); - context.al = context.ds.byte(89); + context.al = context.data.byte(89); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.ds.word(426); + context.ds = context.data.word(426); context.si = context.ax; context.ds.byte(context.si+2) = 254; pickupconts(context); @@ -8419,10 +8419,10 @@ static void pickupconts(Context & context) { context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; - context.al = context.ds.byte(89); - context.ah = context.ds.byte(102); - context.dl = context.ds.byte(10); - context.es = context.ds.word(426); + context.al = context.data.byte(89); + context.ah = context.data.byte(102); + context.dl = context.data.byte(10); + context.es = context.data.word(426); context.bx = 0; context.cx = 0; pickupcontloop: @@ -8435,7 +8435,7 @@ pickupcontloop: if (!context.flags.z()) goto notinsidethis; context._cmp(context.ds.byte(context.bx+3), context.al); if (!context.flags.z()) goto notinsidethis; - context.ds.byte(90) = context.cl; + context.data.byte(90) = context.cl; transfercontoex(context); notinsidethis: context.ax = context.pop(); @@ -8465,10 +8465,10 @@ static void transfercontoex(Context & context) { while(--context.cx) context._movsw(); context.di = context.pop(); context.dx = context.pop(); - context.al = context.ds.byte(184); + context.al = context.data.byte(184); context.ds.byte(context.di) = context.al; context.ds.byte(context.di+11) = context.al; - context.al = context.ds.byte(90); + context.al = context.data.byte(90); context.ds.byte(context.di+1) = context.al; context.ds.byte(context.di+3) = context.dl; context.ds.byte(context.di+2) = 4; @@ -8482,19 +8482,19 @@ static void transfercontoex(Context & context) { } static void transfertext(Context & context) { - context.es = context.ds.word(398); - context.al = context.ds.byte(10); + context.es = context.data.word(398); + context.al = context.data.byte(10); context.ah = 0; context._add(context.ax, context.ax); context.bx = 0+2080+30000+(16*114); context._add(context.bx, context.ax); - context.di = context.ds.word(14); + context.di = context.data.word(14); context.ds.word(context.bx) = context.di; context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.al = context.ds.byte(90); + context.al = context.data.byte(90); context.ah = 0; context._add(context.ax, context.ax); - context.ds = context.ds.word(438); + context.ds = context.data.word(438); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+(82*2); @@ -8503,14 +8503,14 @@ static void transfertext(Context & context) { moretext: context._lodsb(); context._stosb(); - context._add(context.ds.word(14), 1); + context._add(context.data.word(14), 1); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; return; } static void getexpos(Context & context) { - context.es = context.ds.word(398); + context.es = context.data.word(398); context.al = 0; context.di = 0+2080+30000; tryanotherex: @@ -8521,13 +8521,13 @@ tryanotherex: context._cmp(context.al, 114); if (!context.flags.z()) goto tryanotherex; foundnewex: - context.ds.byte(10) = context.al; + context.data.byte(10) = context.al; return; } static void purgealocation(Context & context) { context.push(context.ax); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.di = 0+2080+30000; context.bx = context.pop(); context.cx = 0; @@ -8555,14 +8555,14 @@ dontpurge: static void emergencypurge(Context & context) { checkpurgeagain: - context.ax = context.ds.word(12); + context.ax = context.data.word(12); context._add(context.ax, 4000); context._cmp(context.ax, 30000); if (context.flags.c()) goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: - context.ax = context.ds.word(14); + context.ax = context.data.word(14); context._add(context.ax, 400); context._cmp(context.ax, 18000); if (context.flags.c()) goto notneartextend; @@ -8573,9 +8573,9 @@ notneartextend: } static void purgeanitem(Context & context) { - context.es = context.ds.word(398); + context.es = context.data.word(398); context.di = 0+2080+30000; - context.bl = context.ds.byte(184); + context.bl = context.data.byte(184); context.cx = 0; lookforpurge: context.al = context.ds.byte(context.di+2); @@ -8596,7 +8596,7 @@ cantpurge: context._cmp(context.cx, 114); if (!context.flags.z()) goto lookforpurge; context.di = 0+2080+30000; - context.bl = context.ds.byte(184); + context.bl = context.data.byte(184); context.cx = 0; lookforpurge2: context.al = context.ds.byte(context.di+2); @@ -8681,7 +8681,7 @@ static void deleteexframe(Context & context) { context.ds = context.es; while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.ds.word(12), context.bx); + context._sub(context.data.word(12), context.bx); context.si = context.pop(); context.cx = 114*3; context.di = 0; @@ -8722,7 +8722,7 @@ findlenextext: context._sub(context.cx, context.bx); while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.ds.word(14), context.bx); + context._sub(context.data.word(14), context.bx); context.si = context.pop(); context.cx = 114; context.di = 0+2080+30000+(16*114); @@ -8741,7 +8741,7 @@ beforethistext: static void blockget(Context & context) { context.ah = context.al; context.al = 0; - context.ds = context.ds.word(416); + context.ds = context.data.word(416); context.si = 0+192; context._add(context.si, context.ax); return; @@ -8759,7 +8759,7 @@ static void drawfloor(Context & context) { showallex(context); paneltomap(context); initrain(context); - context.ds.byte(62) = 0; + context.data.byte(62) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -8776,8 +8776,8 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.ds.word(121)); - context.ds.word(117) = context.ax; + context._add(context.ax, context.data.word(121)); + context.data.word(117) = context.ax; context.dx = context.pop(); context.cx = context.pop(); context.al = 10; @@ -8787,13 +8787,13 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.ds.word(123)); - context.ds.word(119) = context.ax; + context._add(context.ax, context.data.word(123)); + context.data.word(119) = context.ax; return; } static void getdimension(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32); context.ch = 0; dimloop1: @@ -8845,14 +8845,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.ds.word(125) = context.ax; + context.data.word(125) = context.ax; context.al = context.ch; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.ds.word(127) = context.ax; + context.data.word(127) = context.ax; context._sub(context.dl, context.cl); context._sub(context.dh, context.ch); context.al = context.dl; @@ -8861,14 +8861,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.ds.byte(128) = context.al; + context.data.byte(128) = context.al; context.al = context.dh; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.ds.byte(129) = context.al; + context.data.byte(129) = context.al; return; } @@ -8903,13 +8903,13 @@ gotlength: } static void drawflags(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.di = 0+(228*13)+32+60+(32*32); - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ah = 0; context.cx = 66; context._mul(context.cx); - context.bl = context.ds.byte(148); + context.bl = context.data.byte(148); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -8919,9 +8919,9 @@ _tmp28: context.push(context.cx); context.cx = 11; _tmp28a: - context.ds = context.ds.word(418); + context.ds = context.data.word(418); context._lodsb(); - context.ds = context.ds.word(416); + context.ds = context.data.word(416); context.push(context.si); context.push(context.ax); context.ah = 0; @@ -8940,9 +8940,9 @@ _tmp28a: } static void eraseoldobs(Context & context) { - context._cmp(context.ds.byte(62), 0); + context._cmp(context.data.byte(62), 0); if (context.flags.z()) goto donterase; - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; oberase: @@ -8965,21 +8965,21 @@ donterase: } static void showallobs(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); - context.ds.word(18) = context.bx; + context.data.word(18) = context.bx; context.di = context.bx; context.cx = 128*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.ds.word(444); - context.ds.word(166) = context.es; + context.es = context.data.word(444); + context.data.word(166) = context.es; context.ax = 0; - context.ds.word(164) = context.ax; + context.data.word(164) = context.ax; context.ax = 0+2080; - context.ds.word(162) = context.ax; - context.ds.byte(181) = 0; - context.ds = context.ds.word(428); + context.data.word(162) = context.ax; + context.data.byte(181) = 0; + context.ds = context.data.word(428); context.si = 0; context.cx = 128; showobsloop: @@ -8987,14 +8987,14 @@ showobsloop: context.push(context.si); context.push(context.si); context._add(context.si, 58); - context.es = context.ds.word(428); + context.es = context.data.word(428); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankframe; context.al = context.ds.byte(context.si+18); context.ah = 0; - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; context._cmp(context.al, 255); if (context.flags.z()) goto blankframe; context.push(context.es); @@ -9011,31 +9011,31 @@ showobsloop: if (context.flags.z()) goto animating; context._cmp(context.ds.byte(context.si+5), 6); if (context.flags.z()) goto animating; - context.ax = context.ds.word(160); + context.ax = context.data.word(160); context.ah = 0; - context._add(context.di, context.ds.word(117)); - context._add(context.bx, context.ds.word(119)); + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); showframe(context); goto drawnsetob; animating: makebackob(context); drawnsetob: - context.si = context.ds.word(18); - context.es = context.ds.word(412); - context.al = context.ds.byte(179); - context.ah = context.ds.byte(180); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.ds.word(176); + context.ax = context.data.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; - context.al = context.ds.byte(181); + context.al = context.data.byte(181); context.ds.byte(context.si+4) = context.al; context._add(context.si, 5); - context.ds.word(18) = context.si; + context.data.word(18) = context.si; blankframe: - context._add(context.ds.byte(181), 1); + context._add(context.data.byte(181), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 64); @@ -9047,19 +9047,19 @@ finishedsetobs: } static void makebackob(Context & context) { - context._cmp(context.ds.byte(62), 0); + context._cmp(context.data.byte(62), 0); if (context.flags.z()) goto nomake; context.al = context.ds.byte(context.si+5); context.ah = context.ds.byte(context.si+8); context.push(context.si); context.push(context.ax); context.push(context.si); - context.ax = context.ds.word(168); - context.bx = context.ds.word(170); + context.ax = context.data.word(168); + context.bx = context.data.word(170); context.ah = context.bl; context.si = context.ax; context.cx = 49520; - context.dx = context.ds.word(444); + context.dx = context.data.word(444); context.di = 0; makesprite(context); context.ax = context.pop(); @@ -9080,61 +9080,61 @@ nomake: } static void showallfree(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.ds.word(18) = context.bx; + context.data.word(18) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); context.cx = 80*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.ds.word(446); - context.ds.word(166) = context.es; + context.es = context.data.word(446); + context.data.word(166) = context.es; context.ax = 0; - context.ds.word(164) = context.ax; + context.data.word(164) = context.ax; context.ax = 0+2080; - context.ds.word(162) = context.ax; + context.data.word(162) = context.ax; context.al = 0; - context.ds.byte(158) = context.al; - context.ds = context.ds.word(426); + context.data.byte(158) = context.al; + context.ds = context.data.word(426); context.si = 2; context.cx = 0; loop127: context.push(context.cx); context.push(context.si); context.push(context.si); - context.es = context.ds.word(426); + context.es = context.data.word(426); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto over138; - context.al = context.ds.byte(158); + context.al = context.data.byte(158); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.ds.word(402); - context.ds = context.ds.word(166); + context.es = context.data.word(402); + context.ds = context.data.word(166); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto over138; - context.ax = context.ds.word(160); + context.ax = context.data.word(160); context.ah = 0; - context._add(context.di, context.ds.word(117)); - context._add(context.bx, context.ds.word(119)); + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); showframe(context); - context.si = context.ds.word(18); - context.es = context.ds.word(412); - context.al = context.ds.byte(179); - context.ah = context.ds.byte(180); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.ds.word(176); + context.ax = context.data.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; @@ -9144,9 +9144,9 @@ loop127: context.push(context.ax); context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.ds.word(18) = context.si; + context.data.word(18) = context.si; over138: - context._add(context.ds.byte(158), 1); + context._add(context.data.byte(158), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9159,66 +9159,66 @@ finfree: } static void showallex(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.ds.word(18) = context.bx; + context.data.word(18) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); context.cx = 100*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.ds.word(398); - context.ds.word(166) = context.es; + context.es = context.data.word(398); + context.data.word(166) = context.es; context.ax = 0; - context.ds.word(164) = context.ax; + context.data.word(164) = context.ax; context.ax = 0+2080; - context.ds.word(162) = context.ax; - context.ds.byte(157) = 0; + context.data.word(162) = context.ax; + context.data.byte(157) = 0; context.si = 0+2080+30000+2; context.cx = 0; exloop: context.push(context.cx); context.push(context.si); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.push(context.si); context.ch = 0; context._cmp(context.ds.byte(context.si), 255); if (context.flags.z()) goto notinroom; context.al = context.ds.byte(context.si-2); - context._cmp(context.al, context.ds.byte(184)); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto notinroom; getmapad(context); notinroom: context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankex; - context.al = context.ds.byte(157); + context.al = context.data.byte(157); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.ds.word(402); - context.ds = context.ds.word(166); + context.es = context.data.word(402); + context.ds = context.data.word(166); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto blankex; - context.ax = context.ds.word(160); + context.ax = context.data.word(160); context.ah = 0; - context._add(context.di, context.ds.word(117)); - context._add(context.bx, context.ds.word(119)); + context._add(context.di, context.data.word(117)); + context._add(context.bx, context.data.word(119)); showframe(context); - context.si = context.ds.word(18); - context.es = context.ds.word(412); - context.al = context.ds.byte(179); - context.ah = context.ds.byte(180); + context.si = context.data.word(18); + context.es = context.data.word(412); + context.al = context.data.byte(179); + context.ah = context.data.byte(180); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.ds.word(176); + context.ax = context.data.word(176); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; @@ -9228,9 +9228,9 @@ notinroom: context.push(context.ax); context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.ds.word(18) = context.si; + context.data.word(18) = context.si; blankex: - context._add(context.ds.byte(157), 1); + context._add(context.data.byte(157), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9243,11 +9243,11 @@ finex: } static void calcfrframe(Context & context) { - context.dx = context.ds.word(166); - context.ax = context.ds.word(162); + context.dx = context.data.word(166); + context.ax = context.data.word(162); context.push(context.ax); - context.cx = context.ds.word(164); - context.ax = context.ds.word(160); + context.cx = context.data.word(164); + context.ax = context.data.word(160); context.ds = context.dx; context.bx = 6; context._mul(context.bx); @@ -9259,33 +9259,33 @@ static void calcfrframe(Context & context) { context.bx = context.pop(); context.push(context.dx); context._add(context.ax, context.bx); - context.ds.word(178) = context.ax; - context.ds.word(176) = context.cx; + context.data.word(178) = context.ax; + context.data.word(176) = context.cx; context.ax = context.pop(); context.push(context.ax); context.ah = 0; - context.ds.word(172) = context.ax; + context.data.word(172) = context.ax; context.ax = context.pop(); context.al = context.ah; context.ah = 0; - context.ds.word(174) = context.ax; + context.data.word(174) = context.ax; return; nullframe: context.ax = context.pop(); context.cx = 0; - context.ds.word(176) = context.cx; + context.data.word(176) = context.cx; return; } static void finalframe(Context & context) { - context.ax = context.ds.word(170); - context._add(context.ax, context.ds.word(174)); - context.bx = context.ds.word(168); - context._add(context.bx, context.ds.word(172)); - context.ds.byte(179) = context.bl; - context.ds.byte(180) = context.al; - context.di = context.ds.word(168); - context.bx = context.ds.word(170); + context.ax = context.data.word(170); + context._add(context.ax, context.data.word(174)); + context.bx = context.data.word(168); + context._add(context.bx, context.data.word(172)); + context.data.byte(179) = context.bl; + context.data.byte(180) = context.al; + context.di = context.data.word(168); + context.bx = context.data.word(170); return; } @@ -9305,11 +9305,11 @@ static void getmapad(Context & context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.ds.word(168) = context.ax; + context.data.word(168) = context.ax; getyad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.ds.word(170) = context.ax; + context.data.word(170) = context.ax; context.ch = 1; over146: return; @@ -9324,7 +9324,7 @@ static void getxad(Context & context) { context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; - context._sub(context.al, context.ds.byte(148)); + context._sub(context.al, context.data.byte(148)); if (context.flags.c()) goto over148; context._cmp(context.al, 11); if (!context.flags.c()) goto over148; @@ -9344,7 +9344,7 @@ static void getyad(Context & context) { context._add(context.si, 1); context.ah = context.ds.byte(context.si); context._add(context.si, 1); - context._sub(context.al, context.ds.byte(149)); + context._sub(context.al, context.data.byte(149)); if (context.flags.c()) goto over147; context._cmp(context.al, 10); if (!context.flags.c()) goto over147; @@ -9360,40 +9360,40 @@ over147: } static void autolook(Context & context) { - context.ax = context.ds.word(198); - context._cmp(context.ax, context.ds.word(214)); + context.ax = context.data.word(198); + context._cmp(context.ax, context.data.word(214)); if (!context.flags.z()) goto diffmouse; - context.ax = context.ds.word(200); - context._cmp(context.ax, context.ds.word(216)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(216)); if (!context.flags.z()) goto diffmouse; - context._sub(context.ds.word(98), 1); - context._cmp(context.ds.word(98), 0); + context._sub(context.data.word(98), 1); + context._cmp(context.data.word(98), 0); if (!context.flags.z()) goto noautolook; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto noautolook; dolook(context); noautolook: return; diffmouse: - context.ds.word(98) = 1000; + context.data.word(98) = 1000; return; } static void look(Context & context) { - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(234), 2); + context._cmp(context.data.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 241); + context._cmp(context.data.byte(100), 241); if (context.flags.z()) goto alreadylook; - context.ds.byte(100) = 241; + context.data.byte(100) = 241; context.al = 25; commandonly(context); alreadylook: - context._cmp(context.ds.word(202), 1); + context._cmp(context.data.word(202), 1); if (!context.flags.z()) goto nolook; - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nolook; dolook(context); nolook: @@ -9405,19 +9405,19 @@ static void dolook(Context & context) { showicon(context); undertextline(context); worktoscreenm(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; dumptextline(context); - context.bl = context.ds.byte(185); + context.bl = context.data.byte(185); context._and(context.bl, 31); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(436); + context.es = context.data.word(436); context._add(context.bx, 0); context.si = context.ds.word(context.bx); context._add(context.si, 0+(38*2)); findnextcolon(context); context.di = 66; - context._cmp(context.ds.byte(184), 50); + context._cmp(context.data.byte(184), 50); if (context.flags.c()) goto notdream3; context.di = 40; notdream3: @@ -9429,17 +9429,17 @@ notdream3: context.cx = 400; hangonp(context); afterlook: - context.ds.byte(234) = 0; - context.ds.byte(100) = 0; + context.data.byte(234) = 0; + context.data.byte(100) = 0; redrawmainscrn(context); worktoscreenm(context); return; } static void redrawmainscrn(Context & context) { - context.ds.word(328) = 0; + context.data.word(328) = 0; createpanel(context); - context.ds.byte(62) = 0; + context.data.byte(62) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -9447,40 +9447,40 @@ static void redrawmainscrn(Context & context) { getunderzoom(context); undertextline(context); readmouse(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; return; } static void getback1(Context & context) { - context._cmp(context.ds.byte(106), 0); + context._cmp(context.data.byte(106), 0); if (context.flags.z()) goto notgotobject; blank(context); return; notgotobject: - context._cmp(context.ds.byte(100), 202); + context._cmp(context.data.byte(100), 202); if (context.flags.z()) goto alreadyget; - context.ds.byte(100) = 202; + context.data.byte(100) = 202; context.al = 26; commandonly(context); alreadyget: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nogetback; context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: return; dogetback: - context.ds.byte(103) = 1; - context.ds.byte(106) = 0; + context.data.byte(103) = 1; + context.data.byte(106) = 0; return; } static void talk(Context & context) { - context.ds.byte(246) = 0; - context.ds.byte(237) = 0; - context.al = context.ds.byte(99); - context.ds.byte(247) = context.al; + context.data.byte(246) = 0; + context.data.byte(237) = 0; + context.al = context.data.byte(99); + context.data.byte(247) = context.al; createpanel(context); showpanel(context); showman(context); @@ -9488,7 +9488,7 @@ static void talk(Context & context) { undertextline(context); convicons(context); starttalk(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -9500,15 +9500,15 @@ waittalk: vsync(context); dumppointer(context); dumptextline(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; context.bx = 2660; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto waittalk; finishtalk: - context.bx = context.ds.word(249); + context.bx = context.data.word(249); context.es = context.cs; - context._cmp(context.ds.byte(246), 4); + context._cmp(context.data.byte(246), 4); if (context.flags.c()) goto notnexttalk; context.al = context.ds.byte(context.bx+7); context._or(context.al, 128); @@ -9516,25 +9516,25 @@ finishtalk: notnexttalk: redrawmainscrn(context); worktoscreenm(context); - context._cmp(context.ds.byte(383), 1); + context._cmp(context.data.byte(383), 1); if (!context.flags.z()) goto nospeech; cancelch1(context); - context.ds.byte(388) = -1; - context.ds.byte(387) = 0; + context.data.byte(388) = -1; + context.data.byte(387) = 0; nospeech: return; } static void convicons(Context & context) { - context.al = context.ds.byte(247); + context.al = context.data.byte(247); context._and(context.al, 127); getpersframe(context); context.di = 234; context.bx = 2; - context.ds.word(160) = context.ax; + context.data.word(160) = context.ax; findsource(context); - context.ax = context.ds.word(160); - context._sub(context.ax, context.ds.word(244)); + context.ax = context.data.word(160); + context._sub(context.ax, context.data.word(244)); context.ah = 0; showframe(context); return; @@ -9544,25 +9544,25 @@ static void getpersframe(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(448); + context.es = context.data.word(448); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); return; } static void starttalk(Context & context) { - context.ds.byte(245) = 0; - context.al = context.ds.byte(247); + context.data.byte(245) = 0; + context.al = context.data.byte(247); context._and(context.al, 127); getpersontext(context); - context.ds.word(71) = 91+91; + context.data.word(71) = 91+91; context.di = 66; context.bx = 64; context.dl = 241; context.al = 0; context.ah = 79; printdirect(context); - context.ds.word(71) = 0; + context.data.word(71) = 0; context.di = 66; context.bx = 80; context.dl = 241; @@ -9578,7 +9578,7 @@ static void getpersontext(Context & context) { context.cx = 64*2; context._mul(context.cx); context.si = context.ax; - context.es = context.ds.word(448); + context.es = context.data.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9588,30 +9588,30 @@ static void getpersontext(Context & context) { } static void moretalk(Context & context) { - context._cmp(context.ds.byte(245), 0); + context._cmp(context.data.byte(245), 0); if (context.flags.z()) goto canmore; redes(context); return; canmore: - context._cmp(context.ds.byte(100), 215); + context._cmp(context.data.byte(100), 215); if (context.flags.z()) goto alreadymore; - context.ds.byte(100) = 215; + context.data.byte(100) = 215; context.al = 49; commandonly(context); alreadymore: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nomore; context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: return; domoretalk: - context.ds.byte(245) = 2; - context.ds.byte(246) = 4; - context._cmp(context.ds.byte(247), 100); + context.data.byte(245) = 2; + context.data.byte(246) = 4; + context._cmp(context.data.byte(247), 100); if (context.flags.c()) goto notsecondpart; - context.ds.byte(246) = 48; + context.data.byte(246) = 48; notsecondpart: dosometalk(context); return; @@ -9619,19 +9619,19 @@ notsecondpart: static void dosometalk(Context & context) { watchtalk: - context.al = context.ds.byte(246); - context.al = context.ds.byte(247); + context.al = context.data.byte(246); + context.al = context.data.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.ds.byte(246); + context.al = context.data.byte(246); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.ds.word(448); + context.es = context.data.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9654,24 +9654,24 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.ds.byte(234) = 3; + context.data.byte(234) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); - context._add(context.ds.byte(246), 1); - context.al = context.ds.byte(246); - context.al = context.ds.byte(247); + context._add(context.data.byte(246), 1); + context.al = context.data.byte(246); + context.al = context.data.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.ds.byte(246); + context.al = context.data.byte(246); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.ds.word(448); + context.es = context.data.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9698,20 +9698,20 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.ds.byte(234) = 3; + context.data.byte(234) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); skiptalk: - context._add(context.ds.byte(246), 1); + context._add(context.data.byte(246), 1); goto watchtalk; endwatchtalk: - context.ds.byte(234) = 0; + context.data.byte(234) = 0; return; } static void hangonpq(Context & context) { - context.ds.byte(103) = 0; + context.data.byte(103) = 0; context.bx = 0; hangloopq: context.push(context.cx); @@ -9727,48 +9727,48 @@ hangloopq: checkcoords(context); context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (context.flags.z()) goto quitconv; - context._cmp(context.ds.byte(383), 1); + context._cmp(context.data.byte(383), 1); if (!context.flags.z()) goto notspeaking; - context._cmp(context.ds.byte(515), 255); + context._cmp(context.data.byte(515), 255); if (!context.flags.z()) goto notspeaking; context._add(context.bx, 1); context._cmp(context.bx, 40); if (context.flags.z()) goto finishconv; notspeaking: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto hangloopq; - context._cmp(context.ds.word(212), 0); + context._cmp(context.data.word(212), 0); if (!context.flags.z()) goto hangloopq; finishconv: delpointer(context); - context.ds.byte(234) = 0; + context.data.byte(234) = 0; return; quitconv: delpointer(context); - context.ds.byte(234) = 0; + context.data.byte(234) = 0; context.ax = context.pop(); cancelch1(context); return; } static void redes(Context & context) { - context._cmp(context.ds.byte(515), 255); + context._cmp(context.data.byte(515), 255); if (!context.flags.z()) goto cantredes; - context._cmp(context.ds.byte(245), 2); + context._cmp(context.data.byte(245), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); return; canredes: - context._cmp(context.ds.byte(100), 217); + context._cmp(context.data.byte(100), 217); if (context.flags.z()) goto alreadyreds; - context.ds.byte(100) = 217; + context.data.byte(100) = 217; context.al = 50; commandonly(context); alreadyreds: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; return; @@ -9788,27 +9788,27 @@ doredes: } static void newplace(Context & context) { - context._cmp(context.ds.byte(60), 1); + context._cmp(context.data.byte(60), 1); if (context.flags.z()) goto istravel; - context._cmp(context.ds.byte(189), -1); + context._cmp(context.data.byte(189), -1); if (!context.flags.z()) goto isautoloc; return; isautoloc: - context.al = context.ds.byte(189); - context.ds.byte(188) = context.al; - context.ds.byte(189) = -1; + context.al = context.data.byte(189); + context.data.byte(188) = context.al; + context.data.byte(189) = -1; return; istravel: - context.ds.byte(60) = 0; + context.data.byte(60) = 0; selectlocation(context); return; } static void selectlocation(Context & context) { - context.ds.byte(237) = 0; + context.data.byte(237) = 0; clearbeforeload(context); - context.ds.byte(103) = 0; - context.ds.byte(231) = 22; + context.data.byte(103) = 0; + context.data.byte(231) = 22; readcitypic(context); showcity(context); getridoftemp(context); @@ -9820,15 +9820,15 @@ static void selectlocation(Context & context) { showexit(context); locationpic(context); undertextline(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); - context.ds.byte(231) = 0; + context.data.byte(231) = 0; showpointer(context); worktoscreen(context); context.al = 9; context.ah = 255; playchannel0(context); - context.ds.byte(188) = 255; + context.data.byte(188) = 255; select: delpointer(context); readmouse(context); @@ -9836,42 +9836,42 @@ select: vsync(context); dumppointer(context); dumptextline(context); - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (context.flags.z()) goto quittravel; context.bx = 2714; checkcoords(context); - context._cmp(context.ds.byte(188), 255); + context._cmp(context.data.byte(188), 255); if (context.flags.z()) goto select; - context.al = context.ds.byte(188); - context._cmp(context.al, context.ds.byte(9)); + context.al = context.data.byte(188); + context._cmp(context.al, context.data.byte(9)); if (context.flags.z()) goto quittravel; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.ds.word(456); + context.es = context.data.word(456); deallocatemem(context); return; quittravel: - context.al = context.ds.byte(184); - context.ds.byte(188) = context.al; - context.ds.byte(103) = 0; + context.al = context.data.byte(184); + context.data.byte(188) = context.al; + context.data.byte(103) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.ds.word(456); + context.es = context.data.word(456); deallocatemem(context); return; } static void showcity(Context & context) { clearwork(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 57; context.bx = 32; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 120+57; context.bx = 32; context.al = 1; @@ -9881,25 +9881,25 @@ static void showcity(Context & context) { } static void lookatplace(Context & context) { - context._cmp(context.ds.byte(100), 224); + context._cmp(context.data.byte(100), 224); if (context.flags.z()) goto alreadyinfo; - context.ds.byte(100) = 224; + context.data.byte(100) = 224; context.al = 27; commandonly(context); alreadyinfo: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noinfo; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noinfo; - context.bl = context.ds.byte(183); + context.bl = context.data.byte(183); context._cmp(context.bl, 15); if (!context.flags.c()) goto noinfo; context.push(context.bx); delpointer(context); deltextline(context); getundercentre(context); - context.ds = context.ds.word(462); + context.ds = context.data.word(462); context.al = 0; context.ah = 0; context.di = 60; @@ -9918,7 +9918,7 @@ alreadyinfo: context.bx = context.pop(); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(456); + context.es = context.data.word(456); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); findnextcolon(context); @@ -9932,8 +9932,8 @@ alreadyinfo: context.cx = 500; hangonp(context); afterinfo: - context.ds.byte(234) = 0; - context.ds.byte(231) = 0; + context.data.byte(234) = 0; + context.data.byte(231) = 0; putundercentre(context); worktoscreenm(context); noinfo: @@ -9943,7 +9943,7 @@ noinfo: static void getundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; context.cl = 254; context.ch = 110; @@ -9954,7 +9954,7 @@ static void getundercentre(Context & context) { static void putundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; context.cl = 254; context.ch = 110; @@ -9970,12 +9970,12 @@ static void locationpic(Context & context) { context.di = 0; context._cmp(context.al, 6); if (!context.flags.c()) goto secondlot; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context._add(context.al, 4); goto gotgraphic; secondlot: context._sub(context.al, 6); - context.ds = context.ds.word(460); + context.ds = context.data.word(460); gotgraphic: context._add(context.di, 104); context.bx = 138+14; @@ -9983,20 +9983,20 @@ gotgraphic: showframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.ds.byte(183); - context._cmp(context.al, context.ds.byte(184)); + context.al = context.data.byte(183); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto notinthisone; context.al = 3; context.di = 104; context.bx = 140+14; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 0; showframe(context); notinthisone: - context.bl = context.ds.byte(183); + context.bl = context.data.byte(183); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(456); + context.es = context.data.word(456); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 50; @@ -10009,7 +10009,7 @@ notinthisone: } static void getdestinfo(Context & context) { - context.al = context.ds.byte(183); + context.al = context.data.byte(183); context.ah = 0; context.push(context.ax); context.dx = context.ds; @@ -10030,19 +10030,19 @@ static void getdestinfo(Context & context) { static void showarrows(Context & context) { context.di = 116-12; context.bx = 16; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 0; context.ah = 0; showframe(context); context.di = 226+12; context.bx = 16; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 280; context.bx = 14; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 2; context.ah = 0; showframe(context); @@ -10051,27 +10051,27 @@ static void showarrows(Context & context) { static void nextdest(Context & context) { duok: - context._cmp(context.ds.byte(100), 218); + context._cmp(context.data.byte(100), 218); if (context.flags.z()) goto alreadydu; - context.ds.byte(100) = 218; + context.data.byte(100) = 218; context.al = 28; commandonly(context); alreadydu: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto nodu; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nodu; searchdestup: - context._add(context.ds.byte(183), 1); - context._cmp(context.ds.byte(183), 15); + context._add(context.data.byte(183), 1); + context._cmp(context.data.byte(183), 15); if (!context.flags.z()) goto notlastdest; - context.ds.byte(183) = 0; + context.data.byte(183) = 0; notlastdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestup; - context.ds.byte(109) = 1; + context.data.byte(109) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10089,27 +10089,27 @@ nodu: static void lastdest(Context & context) { ddok: - context._cmp(context.ds.byte(100), 219); + context._cmp(context.data.byte(100), 219); if (context.flags.z()) goto alreadydd; - context.ds.byte(100) = 219; + context.data.byte(100) = 219; context.al = 29; commandonly(context); alreadydd: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto nodd; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nodd; searchdestdown: - context._sub(context.ds.byte(183), 1); - context._cmp(context.ds.byte(183), -1); + context._sub(context.data.byte(183), 1); + context._cmp(context.data.byte(183), -1); if (!context.flags.z()) goto notfirstdest; - context.ds.byte(183) = 15; + context.data.byte(183) = 15; notfirstdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestdown; - context.ds.byte(109) = 1; + context.data.byte(109) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10126,20 +10126,20 @@ nodd: } static void destselect(Context & context) { - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadytrav; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 30; commandonly(context); alreadytrav: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto notrav; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notrav; getdestinfo(context); - context.al = context.ds.byte(183); - context.ds.byte(188) = context.al; + context.al = context.data.byte(183); + context.data.byte(188) = context.al; notrav: return; } @@ -10228,7 +10228,7 @@ static void readcitypic(Context & context) { } static void usemon(Context & context) { - context.ds.byte(55) = 0; + context.data.byte(55) = 0; context.es = context.cs; context.di = 2895+1; context.cx = 12; @@ -10267,8 +10267,8 @@ keyloop: turnonpower(context); fadeupyellows(context); fadeupmonfirst(context); - context.ds.word(318) = 76; - context.ds.word(320) = 141; + context.data.word(318) = 76; + context.data.word(320) = 141; context.al = 1; monmessage(context); context.cx = 120; @@ -10283,34 +10283,34 @@ keyloop: hangoncurs(context); printlogo(context); scrollmonitor(context); - context.ds.word(394) = 0; - context.ds.word(396) = 0; + context.data.word(394) = 0; + context.data.word(396) = 0; moreinput: - context.di = context.ds.word(318); - context.bx = context.ds.word(320); + context.di = context.data.word(318); + context.bx = context.data.word(320); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.ds.word(318) = context.di; - context.ds.word(320) = context.bx; + context.data.word(318) = context.di; + context.data.word(320) = context.bx; execcommand(context); context._cmp(context.al, 0); if (context.flags.z()) goto moreinput; endmon: getridoftemp(context); getridoftempcharset(context); - context.es = context.ds.word(466); + context.es = context.data.word(466); deallocatemem(context); - context.es = context.ds.word(468); + context.es = context.data.word(468); deallocatemem(context); - context.es = context.ds.word(470); + context.es = context.data.word(470); deallocatemem(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; context.al = 26; playchannel1(context); - context.ds.byte(131) = 0; + context.data.byte(131) = 0; restoreall(context); redrawmainscrn(context); worktoscreenm(context); @@ -10320,25 +10320,25 @@ endmon: static void printoutermon(Context & context) { context.di = 40; context.bx = 32; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 264; context.bx = 32; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 2; context.ah = 0; showframe(context); context.di = 40; context.bx = 12; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 3; context.ah = 0; showframe(context); context.di = 40; context.bx = 164; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 4; context.ah = 0; showframe(context); @@ -10346,7 +10346,7 @@ static void printoutermon(Context & context) { } static void loadpersonal(Context & context) { - context.al = context.ds.byte(9); + context.al = context.data.byte(9); context.dx = 2065; context._cmp(context.al, 0); if (context.flags.z()) goto foundpersonal; @@ -10363,7 +10363,7 @@ foundpersonal: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.ds.word(466) = context.ax; + context.data.word(466) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10373,7 +10373,7 @@ foundpersonal: } static void loadnews(Context & context) { - context.al = context.ds.byte(34); + context.al = context.data.byte(34); context.dx = 2091; context._cmp(context.al, 0); if (context.flags.z()) goto foundnews; @@ -10392,7 +10392,7 @@ foundnews: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.ds.word(468) = context.ax; + context.data.word(468) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10424,7 +10424,7 @@ gotcart: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.ds.word(470) = context.ax; + context.data.word(470) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10490,7 +10490,7 @@ chosenaccess: static void powerlighton(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 6; context.ah = 0; context.push(context.di); @@ -10507,7 +10507,7 @@ static void powerlighton(Context & context) { static void powerlightoff(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 5; context.ah = 0; context.push(context.di); @@ -10524,7 +10524,7 @@ static void powerlightoff(Context & context) { static void accesslighton(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 8; context.ah = 0; context.push(context.di); @@ -10541,7 +10541,7 @@ static void accesslighton(Context & context) { static void accesslightoff(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 7; context.ah = 0; context.push(context.di); @@ -10558,7 +10558,7 @@ static void accesslightoff(Context & context) { static void locklighton(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 10; context.ah = 0; context.push(context.di); @@ -10575,7 +10575,7 @@ static void locklighton(Context & context) { static void locklightoff(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 9; context.ah = 0; context.push(context.di); @@ -10595,50 +10595,50 @@ static void input(Context & context) { context.cx = 64; context.al = 0; while(--context.cx) context._stosb(); - context.ds.word(316) = 0; + context.data.word(316) = 0; context.al = '>'; - context.di = context.ds.word(318); - context.bx = context.ds.word(320); - context.ds = context.ds.word(406); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); context.ah = 0; printchar(context); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); + context.di = context.data.word(318); + context.bx = context.data.word(320); context.cl = 6; context.ch = 8; multidump(context); - context._add(context.ds.word(318), 6); - context.ax = context.ds.word(318); - context.ds.word(312) = context.ax; - context.ax = context.ds.word(320); - context.ds.word(314) = context.ax; + context._add(context.data.word(318), 6); + context.ax = context.data.word(318); + context.data.word(312) = context.ax; + context.ax = context.data.word(320); + context.data.word(314) = context.ax; waitkey: printcurs(context); vsync(context); delcurs(context); readkey(context); - context.al = context.ds.byte(142); + context.al = context.data.byte(142); context._cmp(context.al, 0); if (context.flags.z()) goto waitkey; context._cmp(context.al, 13); if (context.flags.z()) goto endofinput; context._cmp(context.al, 8); if (!context.flags.z()) goto notdel; - context._cmp(context.ds.word(316), 0); + context._cmp(context.data.word(316), 0); if (context.flags.z()) goto waitkey; delchar(context); goto waitkey; notdel: - context._cmp(context.ds.word(316), 28); + context._cmp(context.data.word(316), 28); if (context.flags.z()) goto waitkey; - context._cmp(context.ds.byte(142), 32); + context._cmp(context.data.byte(142), 32); if (!context.flags.z()) goto notleadingspace; - context._cmp(context.ds.word(316), 0); + context._cmp(context.data.word(316), 0); if (context.flags.z()) goto waitkey; notleadingspace: makecaps(context); context.es = context.cs; - context.si = context.ds.word(316); + context.si = context.data.word(316); context._add(context.si, context.si); context._add(context.si, 7944); context.ds.byte(context.si) = context.al; @@ -10647,10 +10647,10 @@ notleadingspace: context.push(context.ax); context.push(context.es); context.push(context.si); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); - context.ds = context.ds.word(402); - context.ax = context.ds.word(316); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; @@ -10661,18 +10661,18 @@ notleadingspace: context.ax = context.pop(); context.push(context.es); context.push(context.si); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); - context.ds = context.ds.word(406); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(406); context.ah = 0; printchar(context); context.si = context.pop(); context.es = context.pop(); context.ds.byte(context.si+1) = context.cl; context.ch = 0; - context._add(context.ds.word(318), context.cx); - context._add(context.ds.word(316), 1); - context._add(context.ds.word(312), context.cx); + context._add(context.data.word(318), context.cx); + context._add(context.data.word(316), 1); + context._add(context.data.word(312), context.cx); goto waitkey; endofinput: return; @@ -10687,27 +10687,27 @@ notupperc: } static void delchar(Context & context) { - context._sub(context.ds.word(316), 1); - context.si = context.ds.word(316); + context._sub(context.data.word(316), 1); + context.si = context.data.word(316); context._add(context.si, context.si); context.es = context.cs; context._add(context.si, 7944); context.ds.byte(context.si) = 0; context.al = context.ds.byte(context.si+1); context.ah = 0; - context._sub(context.ds.word(318), context.ax); - context._sub(context.ds.word(312), context.ax); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); - context.ds = context.ds.word(402); - context.ax = context.ds.word(316); + context._sub(context.data.word(318), context.ax); + context._sub(context.data.word(312), context.ax); + context.di = context.data.word(318); + context.bx = context.data.word(320); + context.ds = context.data.word(402); + context.ax = context.data.word(316); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; context.ch = 8; multiput(context); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); + context.di = context.data.word(318); + context.bx = context.data.word(320); context.cl = context.al; context.ch = 8; multidump(context); @@ -10803,7 +10803,7 @@ static void dircom(Context & context) { dirfile(context); return; dirroot: - context.ds.byte(269) = 0; + context.data.byte(269) = 0; context.ds = context.cs; context.si = 2885; context._add(context.si, 1); @@ -10816,11 +10816,11 @@ dirroot: scrollmonitor(context); context.al = 9; monmessage(context); - context.es = context.ds.word(466); + context.es = context.data.word(466); searchforfiles(context); - context.es = context.ds.word(468); + context.es = context.data.word(468); searchforfiles(context); - context.es = context.ds.word(470); + context.es = context.data.word(470); searchforfiles(context); scrollmonitor(context); return; @@ -10889,15 +10889,15 @@ notyetassigned: scrollmonitor(context); context.al = 15; monmessage(context); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); + context.di = context.data.word(318); + context.bx = context.data.word(320); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.ds.word(318) = context.di; - context.ds.word(320) = context.bx; + context.data.word(318) = context.di; + context.data.word(320) = context.bx; context.bx = context.pop(); context.es = context.pop(); context.push(context.es); @@ -10972,22 +10972,22 @@ static void read(Context & context) { okcom: context.es = context.cs; context.di = 2895; - context.ax = context.ds.word(466); - context.ds.word(324) = context.ax; + context.ax = context.data.word(466); + context.data.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.ds.word(468); - context.ds.word(324) = context.ax; + context.ax = context.data.word(468); + context.data.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.ds.word(470); - context.ds.word(324) = context.ax; + context.ax = context.data.word(470); + context.data.word(324) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); @@ -11004,12 +11004,12 @@ foundfile2: keyok1: context.es = context.cs; context.di = 2883; - context.ds = context.ds.word(324); + context.ds = context.data.word(324); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto findtopictext; - context.al = context.ds.byte(270); - context.ds.byte(269) = context.al; + context.al = context.data.byte(270); + context.data.byte(269) = context.al; context.al = 11; monmessage(context); return; @@ -11048,7 +11048,7 @@ static void dirfile(Context & context) { context.ds.byte(context.di) = context.al; context.push(context.es); context.push(context.di); - context.ds = context.ds.word(466); + context.ds = context.data.word(466); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11057,7 +11057,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.ds.word(468); + context.ds = context.data.word(468); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11066,7 +11066,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.ds.word(470); + context.ds = context.data.word(470); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11118,15 +11118,15 @@ static void getkeyandlogo(Context & context) { context._add(context.bx, 1); context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.ds.byte(271) = context.al; + context.data.byte(271) = context.al; context._add(context.bx, 2); context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.ds.byte(276) = context.al; + context.data.byte(276) = context.al; context._add(context.bx, 1); context.push(context.es); context.push(context.bx); - context.al = context.ds.byte(276); + context.al = context.data.byte(276); context.ah = 0; context.cx = 26; context._mul(context.cx); @@ -11152,8 +11152,8 @@ static void getkeyandlogo(Context & context) { keyok: context.bx = context.pop(); context.es = context.pop(); - context.al = context.ds.byte(271); - context.ds.byte(269) = context.al; + context.al = context.data.byte(271); + context.data.byte(269) = context.al; context.al = 0; return; } @@ -11240,10 +11240,10 @@ static void scrollmonitor(Context & context) { context.push(context.es); context.push(context.ds); printlogo(context); - context.di = context.ds.word(318); - context.bx = context.ds.word(320); + context.di = context.data.word(318); + context.bx = context.data.word(320); printundermon(context); - context.ax = context.ds.word(320); + context.ax = context.data.word(320); worktoscreen(context); context.al = 25; playchannel1(context); @@ -11259,11 +11259,11 @@ static void scrollmonitor(Context & context) { } static void lockmon(Context & context) { - context._cmp(context.ds.byte(392), 57); + context._cmp(context.data.byte(392), 57); if (!context.flags.z()) goto notlock; locklighton(context); lockloop: - context._cmp(context.ds.byte(392), 57); + context._cmp(context.data.byte(392), 57); if (context.flags.z()) goto lockloop; locklightoff(context); notlock: @@ -11271,10 +11271,10 @@ notlock: } static void monitorlogo(Context & context) { - context.al = context.ds.byte(269); - context._cmp(context.al, context.ds.byte(270)); + context.al = context.data.byte(269); + context._cmp(context.al, context.data.byte(270)); if (context.flags.z()) goto notnewlogo; - context.ds.byte(270) = context.al; + context.data.byte(270) = context.al; printlogo(context); printundermon(context); worktoscreen(context); @@ -11293,7 +11293,7 @@ notnewlogo: static void printlogo(Context & context) { context.di = 56; context.bx = 32; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 0; context.ah = 0; showframe(context); @@ -11312,7 +11312,7 @@ curfileloop: context._add(context.si, 1); context.push(context.si); modifychar(context); - context.ds = context.ds.word(406); + context.ds = context.data.word(406); context.ah = 0; printchar(context); context.si = context.pop(); @@ -11322,7 +11322,7 @@ finishfile: } static void monmessage(Context & context) { - context.es = context.ds.word(466); + context.es = context.data.word(466); context.bx = 66*2; context.cl = context.al; context.ch = 0; @@ -11337,7 +11337,7 @@ monmessageloop: } static void processtrigger(Context & context) { - context._cmp(context.ds.byte(55), '1'); + context._cmp(context.data.byte(55), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); @@ -11345,7 +11345,7 @@ static void processtrigger(Context & context) { triggermessage(context); return; notfirsttrigger: - context._cmp(context.ds.byte(55), '2'); + context._cmp(context.data.byte(55), '2'); if (!context.flags.z()) goto notsecondtrigger; context.al = 9; setlocation(context); @@ -11353,7 +11353,7 @@ notfirsttrigger: triggermessage(context); return; notsecondtrigger: - context._cmp(context.ds.byte(55), '3'); + context._cmp(context.data.byte(55), '3'); if (!context.flags.z()) goto notthirdtrigger; context.al = 2; setlocation(context); @@ -11369,7 +11369,7 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiget(context); context.ax = context.pop(); @@ -11388,11 +11388,11 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.ds.word(402); + context.ds = context.data.word(402); context.si = 0; multiput(context); worktoscreen(context); - context.ds.byte(55) = 0; + context.data.byte(55) = 0; return; } @@ -11403,13 +11403,13 @@ static void printcurs(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.es); - context.di = context.ds.word(312); - context.bx = context.ds.word(314); + context.di = context.data.word(312); + context.bx = context.data.word(314); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); context.ch = 11; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0; context.push(context.di); context.push(context.bx); @@ -11418,14 +11418,14 @@ static void printcurs(Context & context) { context.di = context.pop(); context.push(context.bx); context.push(context.di); - context._add(context.ds.word(138), 1); - context.ax = context.ds.word(138); + context._add(context.data.word(138), 1); + context.ax = context.data.word(138); context._and(context.al, 16); if (!context.flags.z()) goto flashcurs; context.al = '/'; context._sub(context.al, 32); context.ah = 0; - context.ds = context.ds.word(406); + context.ds = context.data.word(406); showframe(context); flashcurs: context.di = context.pop(); @@ -11450,8 +11450,8 @@ static void delcurs(Context & context) { context.push(context.ds); context.push(context.dx); context.push(context.si); - context.di = context.ds.word(312); - context.bx = context.ds.word(314); + context.di = context.data.word(312); + context.bx = context.data.word(314); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); @@ -11459,7 +11459,7 @@ static void delcurs(Context & context) { context.push(context.di); context.push(context.bx); context.push(context.cx); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0; multiput(context); context.cx = context.pop(); @@ -11477,17 +11477,17 @@ finishcurdel: } static void useobject(Context & context) { - context.ds.byte(95) = 255; - context._cmp(context.ds.byte(100), 229); + context.data.byte(95) = 255; + context._cmp(context.data.byte(100), 229); if (context.flags.z()) goto alreadyuse; - context.ds.byte(100) = 229; - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(102); + context.data.byte(100) = 229; + context.bl = context.data.byte(99); + context.bh = context.data.byte(102); context.al = 51; commandwithob(context); alreadyuse: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nouse; context._and(context.ax, 1); if (!context.flags.z()) goto douse; @@ -11499,13 +11499,13 @@ douse: } static void useroutine(Context & context) { - context._cmp(context.ds.byte(184), 50); + context._cmp(context.data.byte(184), 50); if (context.flags.c()) goto nodream7; - context._cmp(context.ds.byte(232), 0); + context._cmp(context.data.byte(232), 0); if (!context.flags.z()) goto powerok; return; powerok: - context.ds.byte(232) = 0; + context.data.byte(232) = 0; nodream7: getanyad(context); context.dx = context.ds; @@ -11569,7 +11569,7 @@ cantuse2: context.cx = 50; hangonp(context); putbackobstuff(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; return; } @@ -11582,21 +11582,21 @@ static void wheelsound(Context & context) { } static void runtap(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto tapwith; withwhat(context); return; tapwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcupfromtap; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11609,7 +11609,7 @@ tapwith: putbackobstuff(context); return; fillcupfromtap: - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+15) = 'F'-'A'; context.al = 8; @@ -11636,9 +11636,9 @@ static void playguitar(Context & context) { } static void hotelcontrol(Context & context) { - context._cmp(context.ds.byte(184), 21); + context._cmp(context.data.byte(184), 21); if (!context.flags.z()) goto notrightcont; - context._cmp(context.ds.byte(148), 33); + context._cmp(context.data.byte(148), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); @@ -11658,14 +11658,14 @@ static void hotelbell(Context & context) { } static void opentomb(Context & context) { - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); - context.ds.word(21) = 35*2; - context.ds.word(23) = 1; - context.ds.word(25) = 33; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 35*2; + context.data.word(23) = 1; + context.data.word(25) = 33; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } @@ -11673,7 +11673,7 @@ static void usetrainer(Context & context) { getanyad(context); context._cmp(context.ds.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); makeworn(context); showseconduse(context); putbackobstuff(context); @@ -11703,21 +11703,21 @@ static void nothelderror(Context & context) { } static void usepipe(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto pipewith; withwhat(context); return; pipewith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcup; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11734,7 +11734,7 @@ fillcup: context.al = 36; showpuztext(context); putbackobstuff(context); - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+15) = 'F'-'A'; return; @@ -11747,35 +11747,35 @@ alreadyfull: } static void usefullcart(Context & context) { - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); context.al = 2; - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._add(context.ah, 6); turnanypathon(context); - context.ds.byte(475) = 4; - context.ds.byte(133) = 4; - context.ds.byte(135) = 4; - context.ds.byte(477) = 4; + context.data.byte(475) = 4; + context.data.byte(133) = 4; + context.data.byte(135) = 4; + context.data.byte(477) = 4; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; showfirstuse(context); - context.ds.word(21) = 72*2; - context.ds.word(23) = 58; - context.ds.word(25) = 142; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 72*2; + context.data.word(23) = 58; + context.data.word(25) = 142; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } static void useplinth(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); return; plinthwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'D'; context.ch = 'K'; context.dl = 'E'; @@ -11786,16 +11786,16 @@ plinthwith: putbackobstuff(context); return; isrightkey: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showseconduse(context); - context.ds.word(21) = 220; - context.ds.word(23) = 0; - context.ds.word(25) = 104; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; - context.al = context.ds.byte(67); - context.ds.byte(188) = context.al; + context.data.word(21) = 220; + context.data.word(23) = 0; + context.data.word(25) = 104; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.al = context.data.byte(67); + context.data.byte(188) = context.al; return; } @@ -11803,63 +11803,63 @@ static void chewy(Context & context) { showfirstuse(context); getanyad(context); context.ds.byte(context.bx+2) = 255; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void useladder(Context & context) { showfirstuse(context); - context._sub(context.ds.byte(148), 11); + context._sub(context.data.byte(148), 11); findroominloc(context); - context.ds.byte(133) = 6; - context.ds.byte(135) = 6; - context.ds.byte(475) = 0; - context.ds.byte(478) = 0; - context.ds.byte(477) = 0; + context.data.byte(133) = 6; + context.data.byte(135) = 6; + context.data.byte(475) = 0; + context.data.byte(478) = 0; + context.data.byte(477) = 0; findxyfrompath(context); - context.ds.byte(187) = 1; - context.ds.byte(103) = 1; + context.data.byte(187) = 1; + context.data.byte(103) = 1; return; } static void useladderb(Context & context) { showfirstuse(context); - context._add(context.ds.byte(148), 11); + context._add(context.data.byte(148), 11); findroominloc(context); - context.ds.byte(133) = 2; - context.ds.byte(135) = 2; - context.ds.byte(475) = 1; - context.ds.byte(478) = 1; - context.ds.byte(477) = 1; + context.data.byte(133) = 2; + context.data.byte(135) = 2; + context.data.byte(475) = 1; + context.data.byte(478) = 1; + context.data.byte(477) = 1; findxyfrompath(context); - context.ds.byte(187) = 1; - context.ds.byte(103) = 1; + context.data.byte(187) = 1; + context.data.byte(103) = 1; return; } static void slabdoora(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 13; - context._cmp(context.ds.byte(66), 3); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 13; + context._cmp(context.data.byte(66), 3); if (!context.flags.z()) goto slabawrong; - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 60; - context.ds.word(25) = 42; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 42; + context.data.byte(188) = 47; return; slabawrong: - context.ds.word(21) = 40; - context.ds.word(25) = 34; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 40; + context.data.word(25) = 34; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void slabdoorb(Context & context) { - context._cmp(context.ds.byte(66), 1); + context._cmp(context.data.byte(66), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; context.ah = 'H'; @@ -11874,120 +11874,120 @@ static void slabdoorb(Context & context) { return; gotcrystal: showfirstuse(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 44; - context.ds.word(21) = 60; - context.ds.word(25) = 71; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 60; + context.data.word(25) = 71; + context.data.byte(188) = 47; return; slabbwrong: showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 44; - context.ds.word(21) = 40; - context.ds.word(25) = 63; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 44; + context.data.word(21) = 40; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void slabdoord(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 75; - context._cmp(context.ds.byte(66), 0); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 75; + context._cmp(context.data.byte(66), 0); if (!context.flags.z()) goto slabcwrong; - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 60; - context.ds.word(25) = 102; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 102; + context.data.byte(188) = 47; return; slabcwrong: - context.ds.word(21) = 40; - context.ds.word(25) = 94; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 40; + context.data.word(25) = 94; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void slabdoorc(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 108; - context._cmp(context.ds.byte(66), 4); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 108; + context._cmp(context.data.byte(66), 4); if (!context.flags.z()) goto slabdwrong; - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 60; - context.ds.word(25) = 135; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 135; + context.data.byte(188) = 47; return; slabdwrong: - context.ds.word(21) = 40; - context.ds.word(25) = 127; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 40; + context.data.word(25) = 127; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void slabdoore(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 141; - context._cmp(context.ds.byte(66), 5); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 141; + context._cmp(context.data.byte(66), 5); if (!context.flags.z()) goto slabewrong; - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 60; - context.ds.word(25) = 168; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 168; + context.data.byte(188) = 47; return; slabewrong: - context.ds.word(21) = 40; - context.ds.word(25) = 160; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 40; + context.data.word(25) = 160; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void slabdoorf(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(23) = 171; - context._cmp(context.ds.byte(66), 2); + context.data.byte(103) = 1; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(23) = 171; + context._cmp(context.data.byte(66), 2); if (!context.flags.z()) goto slabfwrong; - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 60; - context.ds.word(25) = 197; - context.ds.byte(188) = 47; + context._add(context.data.byte(2), 1); + context.data.word(21) = 60; + context.data.word(25) = 197; + context.data.byte(188) = 47; return; slabfwrong: - context.ds.word(21) = 40; - context.ds.word(25) = 189; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 40; + context.data.word(25) = 189; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void useslab(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto slabwith; withwhat(context); return; slabwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'J'; context.ch = 'E'; context.dl = 'W'; @@ -12000,10 +12000,10 @@ slabwith: putbackobstuff(context); return; nextslab: - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.ds.byte(99); + context.al = context.data.byte(99); context.push(context.ax); removesetobject(context); context.ax = context.pop(); @@ -12015,26 +12015,26 @@ nextslab: if (!context.flags.z()) goto notlastslab; context.al = 0; turnpathon(context); - context.ds.word(21) = 22; - context.ds.word(23) = 35; - context.ds.word(25) = 48; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 22; + context.data.word(23) = 35; + context.data.word(25) = 48; + context.data.byte(27) = 1; + context.data.byte(26) = 1; notlastslab: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void usecart(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto cartwith; withwhat(context); return; cartwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'R'; context.ch = 'O'; context.dl = 'C'; @@ -12047,31 +12047,31 @@ cartwith: putbackobstuff(context); return; nextcart: - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.ds.byte(99); + context.al = context.data.byte(99); context.push(context.ax); removesetobject(context); context.ax = context.pop(); context._add(context.al, 1); placesetobject(context); - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); context.al = 17; playchannel1(context); showfirstuse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void useclearbox(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); return; clearboxwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'R'; context.ch = 'A'; context.dl = 'I'; @@ -12084,57 +12084,57 @@ clearboxwith: putbackobstuff(context); return; openbox: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); - context.ds.word(21) = 80; - context.ds.word(23) = 67; - context.ds.word(25) = 105; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 80; + context.data.word(23) = 67; + context.data.word(25) = 105; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } static void usecoveredbox(Context & context) { - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); - context.ds.word(21) = 50; - context.ds.word(23) = 41; - context.ds.word(25) = 66; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 50; + context.data.word(23) = 41; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } static void userailing(Context & context) { showfirstuse(context); - context.ds.word(21) = 80; - context.ds.word(23) = 0; - context.ds.word(25) = 30; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; - context.ds.byte(56) = 4; + context.data.word(21) = 80; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context.data.byte(56) = 4; return; } static void useopenbox(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); return; openboxwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'F'; compare(context); if (context.flags.z()) goto destoryopenbox; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -12144,21 +12144,21 @@ openboxwith: showfirstuse(context); return; destoryopenbox: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); context.cx = 300; context.al = 37; showpuztext(context); - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+15) = 'E'-'A'; - context.ds.word(21) = 140; - context.ds.word(23) = 105; - context.ds.word(25) = 181; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 140; + context.data.word(23) = 105; + context.data.word(25) = 181; + context.data.byte(27) = 1; + context.data.byte(26) = 1; context.al = 4; turnpathon(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; openboxwrong: context.cx = 300; @@ -12169,11 +12169,11 @@ openboxwrong: } static void wearwatch(Context & context) { - context._cmp(context.ds.byte(3), 1); + context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); - context.ds.byte(3) = 1; - context.ds.byte(103) = 1; + context.data.byte(3) = 1; + context.data.byte(103) = 1; getanyad(context); makeworn(context); return; @@ -12184,11 +12184,11 @@ wearingwatch: } static void wearshades(Context & context) { - context._cmp(context.ds.byte(4), 1); + context._cmp(context.data.byte(4), 1); if (context.flags.z()) goto wearingshades; - context.ds.byte(4) = 1; + context.data.byte(4) = 1; showfirstuse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; getanyad(context); makeworn(context); return; @@ -12199,17 +12199,17 @@ wearingshades: } static void sitdowninbar(Context & context) { - context._cmp(context.ds.byte(32), -1); + context._cmp(context.data.byte(32), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); - context.ds.word(21) = 50; - context.ds.word(23) = 55; - context.ds.word(25) = 71; - context.ds.word(29) = 73; - context.ds.word(31) = 83; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 50; + context.data.word(23) = 55; + context.data.word(25) = 71; + context.data.word(29) = 73; + context.data.word(31) = 83; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; satdown: showseconduse(context); @@ -12219,23 +12219,23 @@ satdown: static void usechurchhole(Context & context) { showfirstuse(context); - context.ds.byte(103) = 1; - context.ds.word(21) = 28; - context.ds.word(23) = 13; - context.ds.word(25) = 26; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.byte(103) = 1; + context.data.word(21) = 28; + context.data.word(23) = 13; + context.data.word(25) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; } static void usehole(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto holewith; withwhat(context); return; holewith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'H'; context.ch = 'N'; context.dl = 'D'; @@ -12251,11 +12251,11 @@ righthand: showfirstuse(context); context.al = 86; removesetobject(context); - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+2) = 255; - context.ds.byte(47) = 1; - context.ds.byte(103) = 1; + context.data.byte(47) = 1; + context.data.byte(103) = 1; return; } @@ -12274,43 +12274,43 @@ static void usealtar(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto thingsonaltar; - context._cmp(context.ds.byte(47), 1); + context._cmp(context.data.byte(47), 1); if (context.flags.z()) goto movealtar; context.cx = 300; context.al = 23; showpuztext(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; movealtar: - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showseconduse(context); - context.ds.word(21) = 160; - context.ds.word(23) = 81; - context.ds.word(25) = 174; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 160; + context.data.word(23) = 81; + context.data.word(25) = 174; + context.data.byte(27) = 1; + context.data.byte(26) = 1; context.al = 47; context.bl = 52; context.bh = 76; context.cx = 32; context.dx = 98; setuptimeduse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; thingsonaltar: showfirstuse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void opentvdoor(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); return; tvdoorwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'U'; context.ch = 'L'; context.dl = 'O'; @@ -12324,8 +12324,8 @@ tvdoorwith: return; keyontv: showfirstuse(context); - context.ds.byte(37) = 0; - context.ds.byte(103) = 1; + context.data.byte(37) = 0; + context.data.byte(103) = 1; return; } @@ -12333,7 +12333,7 @@ static void usedryer(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12343,7 +12343,7 @@ static void openlouis(Context & context) { context.cl = 3; context.ch = 8; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12362,17 +12362,17 @@ static void openyourneighbour(Context & context) { context.cl = 255; context.ch = 255; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void usewindow(Context & context) { - context._cmp(context.ds.byte(475), 6); + context._cmp(context.data.byte(475), 6); if (!context.flags.z()) goto notonbalc; - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); - context.ds.byte(188) = 29; - context.ds.byte(103) = 1; + context.data.byte(188) = 29; + context.data.byte(103) = 1; return; notonbalc: showseconduse(context); @@ -12396,19 +12396,19 @@ static void usebalcony(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(475) = 6; - context.ds.byte(478) = 6; - context.ds.byte(477) = 6; + context._add(context.data.byte(2), 1); + context.data.byte(475) = 6; + context.data.byte(478) = 6; + context.data.byte(477) = 6; findxyfrompath(context); switchryanoff(context); - context.ds.byte(187) = 1; - context.ds.word(21) = 30*2; - context.ds.word(23) = 183; - context.ds.word(25) = 212; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.byte(187) = 1; + context.data.word(21) = 30*2; + context.data.word(23) = 183; + context.data.word(25) = 212; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } @@ -12418,7 +12418,7 @@ static void openryan(Context & context) { context.cl = 0; context.ch = 6; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12428,7 +12428,7 @@ static void openpoolboss(Context & context) { context.cl = 2; context.ch = 2; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12438,7 +12438,7 @@ static void openeden(Context & context) { context.cl = 6; context.ch = 5; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12448,7 +12448,7 @@ static void opensarters(Context & context) { context.cl = 3; context.ch = 3; entercode(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12476,13 +12476,13 @@ static void drawitall(Context & context) { } static void openhoteldoor(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); return; hoteldoorwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12498,19 +12498,19 @@ keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); - context.ds.byte(37) = 0; - context.ds.byte(103) = 1; + context.data.byte(37) = 0; + context.data.byte(103) = 1; return; } static void openhoteldoor2(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); return; hoteldoorwith2: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12531,13 +12531,13 @@ keyonhotel2: } static void grafittidoor(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto grafwith; withwhat(context); return; grafwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'A'; context.ch = 'P'; context.dl = 'E'; @@ -12556,16 +12556,16 @@ dograf: } static void trapdoor(Context & context) { - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); showfirstuse(context); switchryanoff(context); - context.ds.word(21) = 20*2; - context.ds.word(23) = 181; - context.ds.word(25) = 197; - context.ds.byte(188) = 26; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 20*2; + context.data.word(23) = 181; + context.data.word(25) = 197; + context.data.byte(188) = 26; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } @@ -12573,10 +12573,10 @@ static void callhotellift(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.ds.byte(39) = 8; - context.ds.byte(103) = 1; - context.ds.byte(478) = 5; - context.ds.byte(477) = 5; + context.data.byte(39) = 8; + context.data.byte(103) = 1; + context.data.byte(478) = 5; + context.data.byte(477) = 5; autosetwalk(context); context.al = 4; turnpathon(context); @@ -12585,19 +12585,19 @@ static void callhotellift(Context & context) { static void calledenslift(Context & context) { showfirstuse(context); - context.ds.byte(39) = 8; - context.ds.byte(103) = 1; + context.data.byte(39) = 8; + context.data.byte(103) = 1; context.al = 2; turnpathon(context); return; } static void calledensdlift(Context & context) { - context._cmp(context.ds.byte(35), 1); + context._cmp(context.data.byte(35), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); - context.ds.byte(39) = 8; - context.ds.byte(103) = 1; + context.data.byte(39) = 8; + context.data.byte(103) = 1; context.al = 2; turnpathon(context); return; @@ -12608,13 +12608,13 @@ edensdhere: } static void usepoolreader(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto poolwith; withwhat(context); return; poolwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -12627,7 +12627,7 @@ poolwith: putbackobstuff(context); return; openpool: - context._cmp(context.ds.byte(48), 1); + context._cmp(context.data.byte(48), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); @@ -12636,19 +12636,19 @@ canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); - context.ds.byte(39) = 6; - context.ds.byte(103) = 1; + context.data.byte(39) = 6; + context.data.byte(103) = 1; return; } static void uselighter(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); return; gotlighterwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'S'; context.ch = 'M'; context.dl = 'K'; @@ -12662,10 +12662,10 @@ cigarette: context.cx = 300; context.al = 9; showpuztext(context); - context.al = context.ds.byte(95); + context.al = context.data.byte(95); getexad(context); context.ds.byte(context.bx+2) = 255; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -12681,13 +12681,13 @@ static void showseconduse(Context & context) { } static void usecardreader1(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); return; gotreader1with: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12700,9 +12700,9 @@ gotreader1with: putbackobstuff(context); return; correctcard: - context._cmp(context.ds.byte(49), 0); + context._cmp(context.data.byte(49), 0); if (context.flags.z()) goto notyet; - context._cmp(context.ds.word(16), 0); + context._cmp(context.data.word(16), 0); if (context.flags.z()) goto getscash; context.cx = 300; context.al = 17; @@ -12715,9 +12715,9 @@ getscash: context.cx = 300; context.al = 18; showpuztext(context); - context._add(context.ds.byte(2), 1); - context.ds.word(16) = 12432; - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.word(16) = 12432; + context.data.byte(103) = 1; return; notyet: showfirstuse(context); @@ -12726,13 +12726,13 @@ notyet: } static void usecardreader2(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); return; gotreader2with: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12745,11 +12745,11 @@ gotreader2with: putbackobstuff(context); return; correctcard2: - context._cmp(context.ds.byte(50), 0); + context._cmp(context.data.byte(50), 0); if (context.flags.z()) goto notyetboss; - context._cmp(context.ds.word(16), 0); + context._cmp(context.data.word(16), 0); if (context.flags.z()) goto nocash; - context._cmp(context.ds.byte(46), 2); + context._cmp(context.data.byte(46), 2); if (context.flags.z()) goto alreadygotnew; context.al = 18; playchannel1(context); @@ -12758,10 +12758,10 @@ correctcard2: showpuztext(context); context.al = 94; placesetobject(context); - context.ds.byte(46) = 1; - context._sub(context.ds.word(16), 2000); - context._add(context.ds.byte(2), 1); - context.ds.byte(103) = 1; + context.data.byte(46) = 1; + context._sub(context.data.word(16), 2000); + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; return; nocash: context.cx = 300; @@ -12782,13 +12782,13 @@ notyetboss: } static void usecardreader3(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); return; gotreader3with: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12801,19 +12801,19 @@ gotreader3with: putbackobstuff(context); return; rightcard: - context._cmp(context.ds.byte(51), 0); + context._cmp(context.data.byte(51), 0); if (context.flags.z()) goto notyetrecep; - context._cmp(context.ds.byte(52), 0); + context._cmp(context.data.byte(52), 0); if (!context.flags.z()) goto alreadyusedit; context.al = 16; playchannel1(context); context.cx = 300; context.al = 25; showpuztext(context); - context._add(context.ds.byte(2), 1); - context._sub(context.ds.word(16), 8300); - context.ds.byte(52) = 1; - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context._sub(context.data.word(16), 8300); + context.data.byte(52) = 1; + context.data.byte(103) = 1; return; alreadyusedit: context.cx = 300; @@ -12836,11 +12836,11 @@ static void usecashcard(Context & context) { showman(context); context.di = 114; context.bx = 120-3; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 39; context.ah = 0; showframe(context); - context.ax = context.ds.word(16); + context.ax = context.data.word(16); moneypoke(context); getobtextstart(context); nextcolon(context); @@ -12855,7 +12855,7 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3385; - context.ds.word(71) = 91*2+75; + context.data.word(71) = 91*2+75; context.al = 0; context.ah = 0; context.dl = 240; @@ -12864,12 +12864,12 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3390; - context.ds.word(71) = 91*2+85; + context.data.word(71) = 91*2+85; context.al = 0; context.ah = 0; context.dl = 240; printdirect(context); - context.ds.word(71) = 0; + context.data.word(71) = 0; worktoscreenm(context); context.cx = 400; hangonp(context); @@ -12880,13 +12880,13 @@ static void usecashcard(Context & context) { } static void lookatcard(Context & context) { - context.ds.byte(131) = 1; + context.data.byte(131) = 1; getridofreels(context); loadkeypad(context); createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 42; context.ah = 128; showframe(context); @@ -12908,7 +12908,7 @@ static void lookatcard(Context & context) { createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 42; context.ah = 128; showframe(context); @@ -12923,7 +12923,7 @@ static void lookatcard(Context & context) { worktoscreenm(context); context.cx = 200; hangonw(context); - context.ds.byte(131) = 0; + context.data.byte(131) = 0; getridoftemp(context); restorereels(context); putbackobstuff(context); @@ -12970,31 +12970,31 @@ numberpoke3: } static void usecontrol(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); return; gotcontrolwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; context.dh = 'A'; compare(context); if (context.flags.z()) goto rightkey; - context._cmp(context.ds.byte(184), 21); + context._cmp(context.data.byte(184), 21); if (!context.flags.z()) goto balls; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto jimmycontrols; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13008,26 +13008,26 @@ balls: rightkey: context.al = 16; playchannel1(context); - context._cmp(context.ds.byte(9), 21); + context._cmp(context.data.byte(9), 21); if (context.flags.z()) goto goingdown; context.cx = 300; context.al = 0; showpuztext(context); - context.ds.byte(188) = 21; - context.ds.byte(40) = 8; - context.ds.byte(39) = 0; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; + context.data.byte(188) = 21; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; goingdown: context.cx = 300; context.al = 3; showpuztext(context); - context.ds.byte(188) = 30; - context.ds.byte(40) = 8; - context.ds.byte(39) = 0; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; + context.data.byte(188) = 30; + context.data.byte(40) = 8; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; jimmycontrols: context.al = 50; @@ -13047,41 +13047,41 @@ jimmycontrols: context.cx = 300; context.al = 10; showpuztext(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); - context._add(context.ds.byte(2), 1); + context._add(context.data.byte(2), 1); putbackobstuff(context); return; } static void usehatch(Context & context) { showfirstuse(context); - context.ds.byte(188) = 40; - context.ds.byte(103) = 1; + context.data.byte(188) = 40; + context.data.byte(103) = 1; return; } static void usewire(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); return; gotwirewith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto wireknife; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13107,8 +13107,8 @@ wireknife: context.cx = 300; context.al = 11; showpuztext(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; return; } @@ -13124,21 +13124,21 @@ static void usehandle(Context & context) { context.cx = 300; context.al = 12; showpuztext(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; havecutwire: context.cx = 300; context.al = 13; showpuztext(context); - context.ds.byte(188) = 22; - context.ds.byte(103) = 1; + context.data.byte(188) = 22; + context.data.byte(103) = 1; return; } static void useelevator1(Context & context) { showfirstuse(context); selectlocation(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } @@ -13154,47 +13154,47 @@ static void showfirstuse(Context & context) { static void useelevator3(Context & context) { showfirstuse(context); - context.ds.byte(40) = 20; - context.ds.byte(188) = 34; - context.ds.word(23) = 46; - context.ds.word(25) = 63; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; + context.data.byte(40) = 20; + context.data.byte(188) = 34; + context.data.word(23) = 46; + context.data.word(25) = 63; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; } static void useelevator4(Context & context) { showfirstuse(context); - context.ds.word(23) = 0; - context.ds.word(25) = 11; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(40) = 20; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; - context.ds.byte(188) = 24; + context.data.word(23) = 0; + context.data.word(25) = 11; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(40) = 20; + context.data.word(21) = 80; + context.data.byte(103) = 1; + context.data.byte(188) = 24; return; } static void useelevator2(Context & context) { - context._cmp(context.ds.byte(9), 23); + context._cmp(context.data.byte(9), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); - context.ds.byte(188) = 23; - context.ds.byte(40) = 20; - context.ds.byte(39) = 0; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; + context.data.byte(188) = 23; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; inpoolhall: showfirstuse(context); - context.ds.byte(188) = 31; - context.ds.byte(40) = 20; - context.ds.byte(39) = 0; - context.ds.word(21) = 80; - context.ds.byte(103) = 1; + context.data.byte(188) = 31; + context.data.byte(40) = 20; + context.data.byte(39) = 0; + context.data.word(21) = 80; + context.data.byte(103) = 1; return; } @@ -13203,20 +13203,20 @@ static void useelevator5(Context & context) { placesetobject(context); context.al = 0; removesetobject(context); - context.ds.byte(188) = 20; - context.ds.word(21) = 80; - context.ds.byte(35) = 1; - context.ds.byte(40) = 8; - context.ds.byte(103) = 1; + context.data.byte(188) = 20; + context.data.word(21) = 80; + context.data.byte(35) = 1; + context.data.byte(40) = 8; + context.data.byte(103) = 1; return; } static void usekey(Context & context) { - context._cmp(context.ds.byte(9), 5); + context._cmp(context.data.byte(9), 5); if (context.flags.z()) goto usekey1; - context._cmp(context.ds.byte(9), 30); + context._cmp(context.data.byte(9), 30); if (context.flags.z()) goto usekey1; - context._cmp(context.ds.byte(9), 21); + context._cmp(context.data.byte(9), 21); if (context.flags.z()) goto usekey2; context.cx = 200; context.al = 1; @@ -13224,25 +13224,25 @@ static void usekey(Context & context) { putbackobstuff(context); return; usekey1: - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.ds.byte(149), 10); + context._cmp(context.data.byte(149), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 0; showpuztext(context); - context.ds.byte(40) = 100; - context.ds.byte(103) = 1; + context.data.byte(40) = 100; + context.data.byte(103) = 1; return; usekey2: - context._cmp(context.ds.byte(148), 11); + context._cmp(context.data.byte(148), 11); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.ds.byte(149), 10); + context._cmp(context.data.byte(149), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 3; showpuztext(context); - context.ds.byte(188) = 30; + context.data.byte(188) = 30; context.al = 2; fadescreendown(context); showfirstuse(context); @@ -13257,7 +13257,7 @@ wrongroom1: } static void usestereo(Context & context) { - context._cmp(context.ds.byte(9), 0); + context._cmp(context.data.byte(9), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; @@ -13265,9 +13265,9 @@ static void usestereo(Context & context) { putbackobstuff(context); return; stereook: - context._cmp(context.ds.byte(148), 11); + context._cmp(context.data.byte(148), 11); if (!context.flags.z()) goto stereonotok; - context._cmp(context.ds.byte(149), 0); + context._cmp(context.data.byte(149), 0); if (context.flags.z()) goto stereook2; stereonotok: context.cx = 400; @@ -13314,8 +13314,8 @@ stereoon: } static void usecooker(Context & context) { - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); checkinside(context); context._cmp(context.cl, 114); if (!context.flags.z()) goto foodinside; @@ -13329,14 +13329,14 @@ foodinside: } static void useaxe(Context & context) { - context._cmp(context.ds.byte(184), 22); + context._cmp(context.data.byte(184), 22); if (!context.flags.z()) goto notinpool; - context._cmp(context.ds.byte(149), 10); + context._cmp(context.data.byte(149), 10); if (context.flags.z()) goto axeondoor; showseconduse(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(65) = 2; - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.byte(65) = 2; + context.data.byte(103) = 1; removeobfrominv(context); return; notinpool: @@ -13347,25 +13347,25 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 46*2; - context.ds.word(23) = 31; - context.ds.word(25) = 77; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; return; } static void useelvdoor(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); return; gotdoorwith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13381,13 +13381,13 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.ds.byte(2), 1); - context.ds.word(21) = 46*2; - context.ds.word(23) = 31; - context.ds.word(25) = 77; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.word(21) = 46*2; + context.data.word(23) = 31; + context.data.word(25) = 77; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } @@ -13396,8 +13396,8 @@ static void withwhat(Context & context) { showpanel(context); showman(context); showexit(context); - context.al = context.ds.byte(99); - context.ah = context.ds.byte(102); + context.al = context.data.byte(99); + context.ah = context.data.byte(102); context.es = context.cs; context.di = 5674; copyname(context); @@ -13407,7 +13407,7 @@ static void withwhat(Context & context) { context.al = 63; context.ah = 2; printmessage2(context); - context.di = context.ds.word(84); + context.di = context.data.word(84); context._add(context.di, 5); context.bx = 21; context.es = context.cs; @@ -13416,7 +13416,7 @@ static void withwhat(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - context.di = context.ds.word(84); + context.di = context.data.word(84); context._add(context.di, 5); context.bx = 21; context.dl = 200; @@ -13424,12 +13424,12 @@ static void withwhat(Context & context) { context.ah = 3; printmessage2(context); fillryan(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.ds.byte(104) = 2; + context.data.byte(104) = 2; return; } @@ -13441,21 +13441,21 @@ static void selectob(Context & context) { blank(context); return; canselectob: - context.ds.byte(95) = context.al; - context.ds.byte(96) = context.ah; - context._cmp(context.ax, context.ds.word(94)); + context.data.byte(95) = context.al; + context.data.byte(96) = context.ah; + context._cmp(context.ax, context.data.word(94)); if (!context.flags.z()) goto diffsub3; - context._cmp(context.ds.byte(100), 221); + context._cmp(context.data.byte(100), 221); if (context.flags.z()) goto alreadyselob; - context.ds.byte(100) = 221; + context.data.byte(100) = 221; diffsub3: - context.ds.word(94) = context.ax; + context.data.word(94) = context.ax; context.bx = context.ax; context.al = 0; commandwithob(context); alreadyselob: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notselob; context._and(context.ax, 1); if (!context.flags.z()) goto doselob; @@ -13463,7 +13463,7 @@ notselob: return; doselob: delpointer(context); - context.ds.byte(104) = 0; + context.data.byte(104) = 0; useroutine(context); return; } @@ -13490,7 +13490,7 @@ static void findsetobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.ds.word(428); + context.es = context.data.word(428); context.bx = 0; context.dl = 0; findsetloop: @@ -13518,7 +13518,7 @@ static void findexobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.bx = 0+2080+30000; context.dl = 0; findexloop: @@ -13546,7 +13546,7 @@ static void isryanholding(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.bx = 0+2080+30000; context.dl = 0; searchinv: @@ -13574,7 +13574,7 @@ nofindininv: } static void checkinside(Context & context) { - context.es = context.ds.word(398); + context.es = context.data.word(398); context.bx = 0+2080+30000; context.cl = 0; insideloop: @@ -13620,7 +13620,7 @@ static void putbackobstuff(Context & context) { obpicture(context); describeob(context); undertextline(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -13655,7 +13655,7 @@ static void findpuztext(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.ds.word(454); + context.es = context.data.word(454); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -13725,8 +13725,8 @@ static void removefreeobject(Context & context) { static void findormake(Context & context) { context.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); context.push(context.ax); - context.es = context.ds.word(412); - context.ah = context.ds.byte(184); + context.es = context.data.word(412); + context.ah = context.data.byte(184); changeloop: context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto haventfound; @@ -13749,17 +13749,17 @@ haventfound: } static void switchryanon(Context & context) { - context.ds.byte(63) = 255; + context.data.byte(63) = 255; return; } static void switchryanoff(Context & context) { - context.ds.byte(63) = 1; + context.data.byte(63) = 1; return; } static void setallchanges(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.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); setallloop: context.ax = context.ds.word(context.bx); @@ -13767,7 +13767,7 @@ setallloop: if (context.flags.z()) goto endsetloop; context.cx = context.ds.word(context.bx+2); context._add(context.bx, 4); - context._cmp(context.ah, context.ds.byte(184)); + context._cmp(context.ah, context.data.byte(184)); if (!context.flags.z()) goto setallloop; context.push(context.es); context.push(context.bx); @@ -13799,7 +13799,7 @@ path: context.bx = context.pop(); context._add(context.bx, context.ax); context._add(context.bx, 0); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.cx = context.pop(); context.ds.byte(context.bx+6) = context.cl; nopath: @@ -13822,20 +13822,20 @@ beenpickedup: } static void autoappear(Context & context) { - context._cmp(context.ds.byte(9), 32); + context._cmp(context.data.byte(9), 32); if (!context.flags.z()) goto notinalley; context.al = 5; resetlocation(context); context.al = 10; setlocation(context); - context.ds.byte(183) = 10; + context.data.byte(183) = 10; return; notinalley: - context._cmp(context.ds.byte(184), 24); + context._cmp(context.data.byte(184), 24); if (!context.flags.z()) goto notinedens; - context._cmp(context.ds.byte(42), 1); + context._cmp(context.data.byte(42), 1); if (!context.flags.z()) goto edenspart2; - context._add(context.ds.byte(42), 1); + context._add(context.data.byte(42), 1); context.al = 44; placesetobject(context); context.al = 18; @@ -13854,7 +13854,7 @@ notinalley: removesetobject(context); return; edenspart2: - context._cmp(context.ds.byte(43), 1); + context._cmp(context.data.byte(43), 1); if (!context.flags.z()) goto notedens2; context.al = 44; removesetobject(context); @@ -13862,23 +13862,23 @@ edenspart2: removesetobject(context); context.al = 55; placesetobject(context); - context._add(context.ds.byte(43), 1); + context._add(context.data.byte(43), 1); notedens2: return; notinedens: - context._cmp(context.ds.byte(184), 25); + context._cmp(context.data.byte(184), 25); if (!context.flags.z()) goto notonsartroof; - context.ds.byte(34) = 3; + context.data.byte(34) = 3; context.al = 6; resetlocation(context); context.al = 11; setlocation(context); - context.ds.byte(183) = 11; + context.data.byte(183) = 11; return; notonsartroof: - context._cmp(context.ds.byte(184), 2); + context._cmp(context.data.byte(184), 2); if (!context.flags.z()) goto notinlouiss; - context._cmp(context.ds.byte(41), 0); + context._cmp(context.data.byte(41), 0); if (context.flags.z()) goto notinlouiss; context.al = 23; placesetobject(context); @@ -13887,153 +13887,153 @@ notinlouiss: } static void getundertimed(Context & context) { - context.al = context.ds.byte(335); + context.al = context.data.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.ds.byte(336); + context.al = context.data.byte(336); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.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(context); return; } static void putundertimed(Context & context) { - context.al = context.ds.byte(335); + context.al = context.data.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.ds.byte(336); + context.al = context.data.byte(336); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.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(context); return; } static void dumptimedtext(Context & context) { - context._cmp(context.ds.byte(337), 1); + context._cmp(context.data.byte(337), 1); if (!context.flags.z()) goto nodumptimed; - context.al = context.ds.byte(335); + context.al = context.data.byte(335); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.ds.byte(336); + context.al = context.data.byte(336); context.ah = 0; context.di = context.ax; context.cl = 240; context.ch = 30; multidump(context); - context.ds.byte(337) = 0; + context.data.byte(337) = 0; nodumptimed: return; } static void setuptimeduse(Context & context) { - context._cmp(context.ds.word(328), 0); + context._cmp(context.data.word(328), 0); if (!context.flags.z()) goto cantsetup; - context.ds.byte(335) = context.bh; - context.ds.byte(336) = context.bl; - context.ds.word(330) = context.cx; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; context._add(context.dx, context.cx); - context.ds.word(328) = context.dx; + context.data.word(328) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(454); + context.es = context.data.word(454); context.cx = 66*2; context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.ds.word(332) = context.es; - context.ds.word(334) = context.bx; + context.data.word(332) = context.es; + context.data.word(334) = context.bx; cantsetup: return; } static void setuptimedtemp(Context & context) { - context._cmp(context.ds.word(328), 0); + context._cmp(context.data.word(328), 0); if (!context.flags.z()) goto cantsetup2; - context.ds.byte(335) = context.bh; - context.ds.byte(336) = context.bl; - context.ds.word(330) = context.cx; + context.data.byte(335) = context.bh; + context.data.byte(336) = context.bl; + context.data.word(330) = context.cx; context._add(context.dx, context.cx); - context.ds.word(328) = context.dx; + context.data.word(328) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.cx = 66*2; context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.ds.word(332) = context.es; - context.ds.word(334) = context.bx; + context.data.word(332) = context.es; + context.data.word(334) = context.bx; cantsetup2: return; } static void usetimedtext(Context & context) { - context._cmp(context.ds.word(328), 0); + context._cmp(context.data.word(328), 0); if (context.flags.z()) goto notext; - context._sub(context.ds.word(328), 1); - context._cmp(context.ds.word(328), 0); + context._sub(context.data.word(328), 1); + context._cmp(context.data.word(328), 0); if (context.flags.z()) goto deltimedtext; - context.ax = context.ds.word(328); - context._cmp(context.ax, context.ds.word(330)); + context.ax = context.data.word(328); + context._cmp(context.ax, context.data.word(330)); if (context.flags.z()) goto firsttimed; if (!context.flags.c()) goto notext; goto notfirsttimed; firsttimed: getundertimed(context); notfirsttimed: - context.bl = context.ds.byte(335); + context.bl = context.data.byte(335); context.bh = 0; - context.al = context.ds.byte(336); + context.al = context.data.byte(336); context.ah = 0; context.di = context.ax; - context.es = context.ds.word(332); - context.si = context.ds.word(334); + context.es = context.data.word(332); + context.si = context.data.word(334); context.dl = 237; context.ah = 0; printdirect(context); - context.ds.byte(337) = 1; + context.data.byte(337) = 1; notext: return; deltimedtext: putundertimed(context); - context.ds.byte(337) = 1; + context.data.byte(337) = 1; return; } static void edenscdplayer(Context & context) { showfirstuse(context); - context.ds.word(21) = 18*2; - context.ds.word(23) = 25; - context.ds.word(25) = 42; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 18*2; + context.data.word(23) = 25; + context.data.word(25) = 42; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; return; } static void usewall(Context & context) { showfirstuse(context); - context._cmp(context.ds.byte(475), 3); + context._cmp(context.data.byte(475), 3); if (context.flags.z()) goto gobackover; - context.ds.word(21) = 30*2; - context.ds.word(23) = 2; - context.ds.word(25) = 31; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 30*2; + context.data.word(23) = 2; + context.data.word(25) = 31; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; context.al = 3; turnpathon(context); context.al = 4; @@ -14046,19 +14046,19 @@ static void usewall(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context.ds.byte(475) = 3; - context.ds.byte(477) = 3; + context.data.byte(475) = 3; + context.data.byte(477) = 3; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; switchryanoff(context); return; gobackover: - context.ds.word(21) = 30*2; - context.ds.word(23) = 34; - context.ds.word(25) = 60; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; + context.data.word(21) = 30*2; + context.data.word(23) = 34; + context.data.word(25) = 60; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; context.al = 3; turnpathoff(context); context.al = 4; @@ -14071,22 +14071,22 @@ gobackover: turnpathon(context); context.al = 5; turnpathon(context); - context.ds.byte(475) = 5; - context.ds.byte(477) = 5; + context.data.byte(475) = 5; + context.data.byte(477) = 5; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; switchryanoff(context); return; } static void usechurchgate(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto gatewith; withwhat(context); return; gatewith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'C'; context.ch = 'U'; context.dl = 'T'; @@ -14100,16 +14100,16 @@ gatewith: return; cutgate: showfirstuse(context); - context.ds.word(21) = 64*2; - context.ds.word(23) = 4; - context.ds.word(25) = 70; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.word(21) = 64*2; + context.data.word(23) = 4; + context.data.word(25) = 70; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); context.al = 3; turnpathon(context); - context._cmp(context.ds.byte(44), 0); + context._cmp(context.data.byte(44), 0); if (context.flags.z()) goto notopenchurch; context.al = 2; turnpathon(context); @@ -14118,153 +14118,153 @@ notopenchurch: } static void usegun(Context & context) { - context._cmp(context.ds.byte(102), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); return; istakengun: - context._cmp(context.ds.byte(184), 22); + context._cmp(context.data.byte(184), 22); if (!context.flags.z()) goto notinpoolroom; context.cx = 300; context.al = 34; showpuztext(context); - context.ds.byte(65) = 1; - context.ds.byte(64) = 39; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.byte(65) = 1; + context.data.byte(64) = 39; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); return; notinpoolroom: - context._cmp(context.ds.byte(184), 25); + context._cmp(context.data.byte(184), 25); if (!context.flags.z()) goto nothelicopter; context.cx = 300; context.al = 34; showpuztext(context); - context.ds.byte(65) = 1; - context.ds.byte(64) = 19; - context.ds.byte(103) = 1; - context.ds.byte(66) = 2; - context.ds.byte(67) = 38; - context.ds.byte(43) = 1; - context._add(context.ds.byte(2), 1); + context.data.byte(65) = 1; + context.data.byte(64) = 19; + context.data.byte(103) = 1; + context.data.byte(66) = 2; + context.data.byte(67) = 38; + context.data.byte(43) = 1; + context._add(context.data.byte(2), 1); return; nothelicopter: - context._cmp(context.ds.byte(184), 27); + context._cmp(context.data.byte(184), 27); if (!context.flags.z()) goto notinrockroom; context.cx = 300; context.al = 46; showpuztext(context); - context.ds.byte(234) = 2; - context.ds.byte(41) = 1; - context.ds.byte(65) = 1; - context.ds.byte(34) = 1; - context.ds.byte(103) = 1; - context.ds.byte(67) = 32; - context.ds.byte(66) = 0; - context._add(context.ds.byte(2), 1); + context.data.byte(234) = 2; + context.data.byte(41) = 1; + context.data.byte(65) = 1; + context.data.byte(34) = 1; + context.data.byte(103) = 1; + context.data.byte(67) = 32; + context.data.byte(66) = 0; + context._add(context.data.byte(2), 1); return; notinrockroom: - context._cmp(context.ds.byte(184), 8); + context._cmp(context.data.byte(184), 8); if (!context.flags.z()) goto notbystudio; - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (!context.flags.z()) goto notbystudio; - context._cmp(context.ds.byte(149), 40); + context._cmp(context.data.byte(149), 40); if (!context.flags.z()) goto notbystudio; context.al = 92; issetobonmap(context); if (context.flags.z()) goto notbystudio; - context._cmp(context.ds.byte(475), 9); + context._cmp(context.data.byte(475), 9); if (context.flags.z()) goto notbystudio; - context.ds.byte(478) = 9; - context.ds.byte(477) = 9; + context.data.byte(478) = 9; + context.data.byte(477) = 9; autosetwalk(context); - context.ds.byte(65) = 1; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.byte(65) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); return; notbystudio: - context._cmp(context.ds.byte(184), 6); + context._cmp(context.data.byte(184), 6); if (!context.flags.z()) goto notsarters; - context._cmp(context.ds.byte(148), 11); + context._cmp(context.data.byte(148), 11); if (!context.flags.z()) goto notsarters; - context._cmp(context.ds.byte(149), 20); + context._cmp(context.data.byte(149), 20); if (!context.flags.z()) goto notsarters; context.al = 5; issetobonmap(context); if (!context.flags.z()) goto notsarters; - context.ds.byte(478) = 1; - context.ds.byte(477) = 1; + context.data.byte(478) = 1; + context.data.byte(477) = 1; autosetwalk(context); context.al = 5; removesetobject(context); context.al = 6; placesetobject(context); context.al = 1; - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._sub(context.ah, 1); turnanypathon(context); - context.ds.byte(35) = 1; - context.ds.word(21) = 40*2; - context.ds.word(23) = 4; - context.ds.word(25) = 43; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.byte(35) = 1; + context.data.word(21) = 40*2; + context.data.word(23) = 4; + context.data.word(25) = 43; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); return; notsarters: - context._cmp(context.ds.byte(184), 29); + context._cmp(context.data.byte(184), 29); if (!context.flags.z()) goto notaide; - context.ds.byte(103) = 1; + context.data.byte(103) = 1; context.al = 13; resetlocation(context); context.al = 12; setlocation(context); - context.ds.byte(183) = 12; - context.ds.byte(478) = 2; - context.ds.byte(477) = 2; + context.data.byte(183) = 12; + context.data.byte(478) = 2; + context.data.byte(477) = 2; autosetwalk(context); - context.ds.word(21) = 164*2; - context.ds.word(23) = 3; - context.ds.word(25) = 164; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(44) = 1; - context.ds.byte(66) = 3; - context.ds.byte(67) = 33; - context._add(context.ds.byte(2), 1); + context.data.word(21) = 164*2; + context.data.word(23) = 3; + context.data.word(25) = 164; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(44) = 1; + context.data.byte(66) = 3; + context.data.byte(67) = 33; + context._add(context.data.byte(2), 1); return; notaide: - context._cmp(context.ds.byte(184), 23); + context._cmp(context.data.byte(184), 23); if (!context.flags.z()) goto notwithboss; - context._cmp(context.ds.byte(148), 0); + context._cmp(context.data.byte(148), 0); if (!context.flags.z()) goto notwithboss; - context._cmp(context.ds.byte(149), 50); + context._cmp(context.data.byte(149), 50); if (!context.flags.z()) goto notwithboss; - context._cmp(context.ds.byte(475), 5); + context._cmp(context.data.byte(475), 5); if (context.flags.z()) goto pathokboss; - context.ds.byte(478) = 5; - context.ds.byte(477) = 5; + context.data.byte(478) = 5; + context.data.byte(477) = 5; autosetwalk(context); pathokboss: - context.ds.byte(65) = 1; - context.ds.byte(103) = 1; + context.data.byte(65) = 1; + context.data.byte(103) = 1; return; notwithboss: - context._cmp(context.ds.byte(184), 8); + context._cmp(context.data.byte(184), 8); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.ds.byte(148), 11); + context._cmp(context.data.byte(148), 11); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.ds.byte(149), 10); + context._cmp(context.data.byte(149), 10); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.ds.byte(475), 2); + context._cmp(context.data.byte(475), 2); if (context.flags.z()) goto pathoktv; - context.ds.byte(478) = 2; - context.ds.byte(477) = 2; + context.data.byte(478) = 2; + context.data.byte(477) = 2; autosetwalk(context); pathoktv: - context.ds.byte(65) = 1; - context.ds.byte(103) = 1; + context.data.byte(65) = 1; + context.data.byte(103) = 1; return; nottvsoldier: showfirstuse(context); @@ -14273,14 +14273,14 @@ nottvsoldier: } static void useshield(Context & context) { - context._cmp(context.ds.byte(184), 20); + context._cmp(context.data.byte(184), 20); if (!context.flags.z()) goto notinsartroom; - context._cmp(context.ds.byte(64), 0); + context._cmp(context.data.byte(64), 0); if (context.flags.z()) goto notinsartroom; - context.ds.byte(65) = 3; + context.data.byte(65) = 3; showseconduse(context); - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); removeobfrominv(context); return; notinsartroom: @@ -14295,20 +14295,20 @@ static void usebuttona(Context & context) { if (context.flags.z()) goto donethisbit; showfirstuse(context); context.al = 0; - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._sub(context.ah, 1); turnanypathon(context); context.al = 9; removesetobject(context); context.al = 95; placesetobject(context); - context.ds.word(21) = 15*2; - context.ds.word(23) = 71; - context.ds.word(25) = 85; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.word(21) = 15*2; + context.data.word(23) = 71; + context.data.word(25) = 85; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); return; donethisbit: showseconduse(context); @@ -14317,21 +14317,21 @@ donethisbit: } static void useplate(Context & context) { - context._cmp(context.ds.byte(95), 255); + context._cmp(context.data.byte(95), 255); if (!context.flags.z()) goto platewith; withwhat(context); return; platewith: - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'S'; context.ch = 'C'; context.dl = 'R'; context.dh = 'W'; compare(context); if (context.flags.z()) goto unscrewplate; - context.al = context.ds.byte(95); - context.ah = context.ds.byte(96); + context.al = context.data.byte(95); + context.ah = context.data.byte(96); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; @@ -14355,8 +14355,8 @@ unscrewplate: removesetobject(context); context.al = 0; placefreeobject(context); - context._add(context.ds.byte(2), 1); - context.ds.byte(103) = 1; + context._add(context.data.byte(2), 1); + context.data.byte(103) = 1; return; triedknife: context.cx = 300; @@ -14380,19 +14380,19 @@ static void usewinch(Context & context) { context.dh = 'E'; compare(context); if (!context.flags.z()) goto nowinch; - context.ds.word(21) = 217*2; - context.ds.word(23) = 0; - context.ds.word(25) = 217; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; - context.ds.byte(183) = 1; - context.ds.byte(188) = 45; - context.ds.byte(66) = 1; - context.ds.byte(67) = 44; - context.ds.byte(42) = 1; - context.ds.byte(34) = 2; - context.ds.byte(103) = 1; - context._add(context.ds.byte(2), 1); + context.data.word(21) = 217*2; + context.data.word(23) = 0; + context.data.word(25) = 217; + context.data.byte(27) = 1; + context.data.byte(26) = 1; + context.data.byte(183) = 1; + context.data.byte(188) = 45; + context.data.byte(66) = 1; + context.data.byte(67) = 44; + context.data.byte(42) = 1; + context.data.byte(34) = 2; + context.data.byte(103) = 1; + context._add(context.data.byte(2), 1); return; nowinch: showfirstuse(context); @@ -14401,8 +14401,8 @@ nowinch: } static void entercode(Context & context) { - context.ds.word(284) = context.ax; - context.ds.word(286) = context.cx; + context.data.word(284) = context.ax; + context.data.word(286) = context.cx; getridofreels(context); loadkeypad(context); createpanel(context); @@ -14413,20 +14413,20 @@ static void entercode(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.ds.word(280) = 0; - context.ds.byte(103) = 0; + context.data.word(280) = 0; + context.data.byte(103) = 0; keypadloop: delpointer(context); readmouse(context); showkeypad(context); showpointer(context); - context._cmp(context.ds.byte(282), 0); + context._cmp(context.data.byte(282), 0); if (context.flags.z()) goto nopresses; - context._sub(context.ds.byte(282), 1); + context._sub(context.data.byte(282), 1); goto afterpress; nopresses: - context.ds.byte(278) = 255; - context.ds.byte(281) = 255; + context.data.byte(278) = 255; + context.data.byte(281) = 255; vsync(context); afterpress: dumppointer(context); @@ -14434,37 +14434,37 @@ afterpress: dumptextline(context); context.bx = 3393; checkcoords(context); - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (context.flags.z()) goto numberright; - context._cmp(context.ds.byte(287), 1); + context._cmp(context.data.byte(287), 1); if (!context.flags.z()) goto notendkey; - context._cmp(context.ds.byte(37), 0); + context._cmp(context.data.byte(37), 0); if (context.flags.z()) goto numberright; goto keypadloop; notendkey: - context._cmp(context.ds.byte(282), 40); + context._cmp(context.data.byte(282), 40); if (!context.flags.z()) goto keypadloop; addtopresslist(context); - context._cmp(context.ds.byte(278), 11); + context._cmp(context.data.byte(278), 11); if (!context.flags.z()) goto keypadloop; - context.ax = context.ds.word(284); - context.cx = context.ds.word(286); + context.ax = context.data.word(284); + context.cx = context.data.word(286); isitright(context); if (!context.flags.z()) goto incorrect; - context.ds.byte(37) = 0; + context.data.byte(37) = 0; context.al = 11; playchannel1(context); - context.ds.byte(287) = 120; - context.ds.word(280) = 0; + context.data.byte(287) = 120; + context.data.word(280) = 0; goto keypadloop; incorrect: context.al = 11; playchannel1(context); - context.ds.byte(287) = 120; - context.ds.word(280) = 0; + context.data.byte(287) = 120; + context.data.word(280) = 0; goto keypadloop; numberright: - context.ds.byte(131) = 0; + context.data.byte(131) = 0; getridoftemp(context); restorereels(context); redrawmainscrn(context); @@ -14479,38 +14479,38 @@ static void loadkeypad(Context & context) { } static void quitkey(Context & context) { - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadyqk; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 4; commandonly(context); alreadyqk: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notqk; context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: return; doqk: - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void addtopresslist(Context & context) { - context._cmp(context.ds.word(280), 5); + context._cmp(context.data.word(280), 5); if (context.flags.z()) goto nomorekeys; - context.al = context.ds.byte(278); + context.al = context.data.byte(278); context._cmp(context.al, 10); if (!context.flags.z()) goto not10; context.al = 0; not10: - context.bx = context.ds.word(280); + context.bx = context.data.word(280); context.dx = context.ds; context.es = context.dx; context._add(context.bx, 8350); context.ds.byte(context.bx) = context.al; - context._add(context.ds.word(280), 1); + context._add(context.data.word(280), 1); nomorekeys: return; } @@ -14584,27 +14584,27 @@ static void buttonenter(Context & context) { static void buttonpress(Context & context) { context.ch = context.cl; context._add(context.ch, 100); - context._cmp(context.ds.byte(100), context.ch); + context._cmp(context.data.byte(100), context.ch); if (context.flags.z()) goto alreadyb; - context.ds.byte(100) = context.ch; + context.data.byte(100) = context.ch; context.al = context.cl; context._add(context.al, 4); context.push(context.cx); commandonly(context); context.cx = context.pop(); alreadyb: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notb; context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: return; dob: - context.ds.byte(278) = context.cl; + context.data.byte(278) = context.cl; context._add(context.cl, 21); - context.ds.byte(281) = context.cl; - context.ds.byte(282) = 40; + context.data.byte(281) = context.cl; + context.data.byte(282) = 40; context._cmp(context.cl, 32); if (context.flags.z()) goto nonoise; context.al = 10; @@ -14616,13 +14616,13 @@ nonoise: static void showouterpad(Context & context) { context.di = 36+112-3; context.bx = 72-4; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 1; context.ah = 0; showframe(context); context.di = 36+112+74; context.bx = 72+76; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.al = 37; context.ah = 0; showframe(context); @@ -14674,23 +14674,23 @@ static void showkeypad(Context & context) { context.di = 36+112+31; context.bx = 72+59; singlekey(context); - context._cmp(context.ds.byte(287), 0); + context._cmp(context.data.byte(287), 0); if (context.flags.z()) goto notenter; - context._sub(context.ds.byte(287), 1); + context._sub(context.data.byte(287), 1); context.al = 36; context.bx = 72-1+63; - context._cmp(context.ds.byte(37), 0); + context._cmp(context.data.byte(37), 0); if (!context.flags.z()) goto changelight; context.al = 41; context.bx = 72+4+63; changelight: - context._cmp(context.ds.byte(287), 60); + context._cmp(context.data.byte(287), 60); if (context.flags.c()) goto gotlight; - context._cmp(context.ds.byte(287), 100); + context._cmp(context.data.byte(287), 100); if (!context.flags.c()) goto gotlight; context._sub(context.al, 1); gotlight: - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 0; context.di = 36+112+60; showframe(context); @@ -14699,14 +14699,14 @@ notenter: } static void singlekey(Context & context) { - context._cmp(context.ds.byte(281), context.al); + context._cmp(context.data.byte(281), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); - context._cmp(context.ds.byte(282), 8); + context._cmp(context.data.byte(282), 8); if (!context.flags.c()) goto gotkey; context._sub(context.al, 11); gotkey: - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context._sub(context.al, 20); context.ah = 0; showframe(context); @@ -14728,24 +14728,24 @@ static void usemenu(Context & context) { createpanel(context); showpanel(context); showicon(context); - context.ds.byte(62) = 0; + context.data.byte(62) = 0; drawfloor(context); printsprites(context); context.al = 4; context.ah = 0; context.di = 80+40-48; context.bx = 60-4; - context.ds = context.ds.word(460); + context.ds = context.data.word(460); showframe(context); getundermenu(context); context.al = 5; context.ah = 0; context.di = 80+40+54; context.bx = 60+72; - context.ds = context.ds.word(460); + context.ds = context.data.word(460); showframe(context); worktoscreenm(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; menuloop: delpointer(context); putundermenu(context); @@ -14758,9 +14758,9 @@ menuloop: dumptextline(context); context.bx = 3525; checkcoords(context); - context._cmp(context.ds.byte(103), 1); + context._cmp(context.data.byte(103), 1); if (!context.flags.z()) goto menuloop; - context.ds.byte(131) = 0; + context.data.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); getridoftemp2(context); @@ -14785,7 +14785,7 @@ static void getundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.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(context); return; @@ -14796,7 +14796,7 @@ static void putundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.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(context); return; @@ -14807,41 +14807,41 @@ static void showoutermenu(Context & context) { context.ah = 0; context.di = 80+40-34; context.bx = 60-40; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); context.al = 41; context.ah = 0; context.di = 80+40+64-34; context.bx = 60-40; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); context.al = 42; context.ah = 0; context.di = 80+40-26; context.bx = 60+57-40; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); context.al = 43; context.ah = 0; context.di = 80+40+64-26; context.bx = 60+57-40; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); return; } static void showmenu(Context & context) { - context._add(context.ds.byte(290), 1); - context._cmp(context.ds.byte(290), 37*2); + context._add(context.data.byte(290), 1); + context._cmp(context.data.byte(290), 37*2); if (!context.flags.z()) goto menuframeok; - context.ds.byte(290) = 0; + context.data.byte(290) = 0; menuframeok: - context.al = context.ds.byte(290); + context.al = context.data.byte(290); context._shr(context.al, 1); context.ah = 0; context.di = 80+40; context.bx = 60; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); return; } @@ -14855,13 +14855,13 @@ static void loadmenu(Context & context) { } static void viewfolder(Context & context) { - context.ds.byte(131) = 1; + context.data.byte(131) = 1; getridofall(context); loadfolder(context); - context.ds.byte(288) = 0; + context.data.byte(288) = 0; showfolder(context); worktoscreenm(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; folderloop: delpointer(context); readmouse(context); @@ -14871,9 +14871,9 @@ folderloop: dumptextline(context); context.bx = 3547; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto folderloop; - context.ds.byte(131) = 0; + context.data.byte(131) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); @@ -14885,30 +14885,30 @@ folderloop: } static void nextfolder(Context & context) { - context._cmp(context.ds.byte(288), 12); + context._cmp(context.data.byte(288), 12); if (!context.flags.z()) goto cannextf; blank(context); return; cannextf: - context._cmp(context.ds.byte(100), 201); + context._cmp(context.data.byte(100), 201); if (context.flags.z()) goto alreadynextf; - context.ds.byte(100) = 201; + context.data.byte(100) = 201; context.al = 16; commandonly(context); alreadynextf: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notnextf; context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: return; donextf: - context._add(context.ds.byte(288), 1); + context._add(context.data.byte(288), 1); folderhints(context); delpointer(context); showfolder(context); - context.ds.word(202) = 0; + context.data.word(202) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -14916,9 +14916,9 @@ donextf: } static void folderhints(Context & context) { - context._cmp(context.ds.byte(288), 5); + context._cmp(context.data.byte(288), 5); if (!context.flags.z()) goto notaideadd; - context._cmp(context.ds.byte(44), 1); + context._cmp(context.data.byte(44), 1); if (context.flags.z()) goto notaideadd; context.al = 13; getlocation(context); @@ -14939,7 +14939,7 @@ static void folderhints(Context & context) { hangonp(context); return; notaideadd: - context._cmp(context.ds.byte(288), 9); + context._cmp(context.data.byte(288), 9); if (!context.flags.z()) goto notaristoadd; context.al = 7; getlocation(context); @@ -14963,31 +14963,31 @@ notaristoadd: } static void lastfolder(Context & context) { - context._cmp(context.ds.byte(288), 0); + context._cmp(context.data.byte(288), 0); if (!context.flags.z()) goto canlastf; blank(context); return; canlastf: - context._cmp(context.ds.byte(100), 202); + context._cmp(context.data.byte(100), 202); if (context.flags.z()) goto alreadylastf; - context.ds.byte(100) = 202; + context.data.byte(100) = 202; context.al = 17; commandonly(context); alreadylastf: - context._cmp(context.ds.byte(288), 0); + context._cmp(context.data.byte(288), 0); if (context.flags.z()) goto notlastf; - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notlastf; context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: return; dolastf: - context._sub(context.ds.byte(288), 1); + context._sub(context.data.byte(288), 1); delpointer(context); showfolder(context); - context.ds.word(202) = 0; + context.data.word(202) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -15009,41 +15009,41 @@ static void loadfolder(Context & context) { } static void showfolder(Context & context) { - context.ds.byte(100) = 255; - context._cmp(context.ds.byte(288), 0); + context.data.byte(100) = 255; + context._cmp(context.data.byte(288), 0); if (context.flags.z()) goto closedfolder; usetempcharset(context); createpanel2(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 143; context.bx = 0; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 0; context.bx = 92; context.al = 2; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 143; context.bx = 92; context.al = 3; context.ah = 0; showframe(context); folderexit(context); - context._cmp(context.ds.byte(288), 1); + context._cmp(context.data.byte(288), 1); if (context.flags.z()) goto noleftpage; showleftpage(context); noleftpage: - context._cmp(context.ds.byte(288), 12); + context._cmp(context.data.byte(288), 12); if (context.flags.z()) goto norightpage; showrightpage(context); norightpage: @@ -15052,13 +15052,13 @@ norightpage: return; closedfolder: createpanel2(context); - context.ds = context.ds.word(462); + context.ds = context.data.word(462); context.di = 143-28; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.ds.word(462); + context.ds = context.data.word(462); context.di = 143-28; context.bx = 92; context.al = 1; @@ -15070,7 +15070,7 @@ closedfolder: } static void folderexit(Context & context) { - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 296; context.bx = 178; context.al = 6; @@ -15080,7 +15080,7 @@ static void folderexit(Context & context) { } static void showleftpage(Context & context) { - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 0; context.bx = 12; context.al = 3; @@ -15091,7 +15091,7 @@ static void showleftpage(Context & context) { leftpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 0; context.al = 4; context.ah = 0; @@ -15100,21 +15100,21 @@ leftpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto leftpageloop; - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 0; context.al = 5; context.ah = 0; showframe(context); - context.ds.word(77) = 8; - context.ds.word(71) = 91; - context.ds.byte(72) = 1; - context.bl = context.ds.byte(288); + context.data.word(77) = 8; + context.data.word(71) = 91; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); context._sub(context.bl, 1); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 2; @@ -15125,16 +15125,16 @@ twolotsleft: context.push(context.cx); contleftpage: printdirect(context); - context._add(context.bx, context.ds.word(77)); + context._add(context.bx, context.data.word(77)); context._cmp(context.al, 0); if (!context.flags.z()) goto contleftpage; context.cx = context.pop(); if (--context.cx) goto twolotsleft; - context.ds.byte(72) = 0; - context.ds.word(71) = 0; - context.ds.word(77) = 10; - context.es = context.ds.word(400); - context.ds = context.ds.word(400); + context.data.byte(72) = 0; + context.data.word(71) = 0; + context.data.word(77) = 10; + context.es = context.data.word(400); + context.ds = context.data.word(400); context.di = (48*320)+2; context.si = (48*320)+2+130; context.cx = 120; @@ -15161,7 +15161,7 @@ flipfolderline: } static void showrightpage(Context & context) { - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 143; context.bx = 12; context.al = 0; @@ -15172,7 +15172,7 @@ static void showrightpage(Context & context) { rightpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 143; context.al = 1; context.ah = 0; @@ -15181,19 +15181,19 @@ rightpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto rightpageloop; - context.ds = context.ds.word(460); + context.ds = context.data.word(460); context.di = 143; context.al = 2; context.ah = 0; showframe(context); - context.ds.word(77) = 8; - context.ds.byte(72) = 1; - context.bl = context.ds.byte(288); + context.data.word(77) = 8; + context.data.byte(72) = 1; + context.bl = context.data.byte(288); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 152; @@ -15204,30 +15204,30 @@ twolotsright: context.push(context.cx); contrightpage: printdirect(context); - context._add(context.bx, context.ds.word(77)); + context._add(context.bx, context.data.word(77)); context._cmp(context.al, 0); if (!context.flags.z()) goto contrightpage; context.cx = context.pop(); if (--context.cx) goto twolotsright; - context.ds.byte(72) = 0; - context.ds.word(77) = 10; + context.data.byte(72) = 0; + context.data.word(77) = 10; return; } static void entersymbol(Context & context) { - context.ds.byte(131) = 1; + context.data.byte(131) = 1; getridofreels(context); context.dx = 2351; loadintotemp(context); - context.ds.byte(291) = 24; - context.ds.byte(293) = 0; - context.ds.byte(294) = 24; - context.ds.byte(296) = 0; + context.data.byte(291) = 24; + context.data.byte(293) = 0; + context.data.byte(294) = 24; + context.data.byte(296) = 0; redrawmainscrn(context); showsymbol(context); undertextline(context); worktoscreenm(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; symbolloop: delpointer(context); updatesymboltop(context); @@ -15241,21 +15241,21 @@ symbolloop: dumpsymbol(context); context.bx = 3589; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto symbolloop; - context._cmp(context.ds.byte(295), 3); + context._cmp(context.data.byte(295), 3); if (!context.flags.z()) goto symbolwrong; - context._cmp(context.ds.byte(292), 5); + context._cmp(context.data.byte(292), 5); if (!context.flags.z()) goto symbolwrong; context.al = 43; removesetobject(context); context.al = 46; placesetobject(context); - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._add(context.ah, 12); context.al = 0; turnanypathon(context); - context.ds.byte(131) = 0; + context.data.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15268,11 +15268,11 @@ symbolwrong: removesetobject(context); context.al = 43; placesetobject(context); - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._add(context.ah, 12); context.al = 0; turnanypathoff(context); - context.ds.byte(131) = 0; + context.data.byte(131) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15281,94 +15281,94 @@ symbolwrong: } static void quitsymbol(Context & context) { - context._cmp(context.ds.byte(291), 24); + context._cmp(context.data.byte(291), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(294), 24); + context._cmp(context.data.byte(294), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadyqs; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 18; commandonly(context); alreadyqs: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notqs; context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: return; doqs: - context.ds.byte(103) = 1; + context.data.byte(103) = 1; return; } static void settopleft(Context & context) { - context._cmp(context.ds.byte(293), 0); + context._cmp(context.data.byte(293), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 210); + context._cmp(context.data.byte(100), 210); if (context.flags.z()) goto alreadytopl; - context.ds.byte(100) = 210; + context.data.byte(100) = 210; context.al = 19; commandonly(context); alreadytopl: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto notopleft; - context.ds.byte(293) = -1; + context.data.byte(293) = -1; notopleft: return; } static void settopright(Context & context) { - context._cmp(context.ds.byte(293), 0); + context._cmp(context.data.byte(293), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 211); + context._cmp(context.data.byte(100), 211); if (context.flags.z()) goto alreadytopr; - context.ds.byte(100) = 211; + context.data.byte(100) = 211; context.al = 20; commandonly(context); alreadytopr: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto notopright; - context.ds.byte(293) = 1; + context.data.byte(293) = 1; notopright: return; } static void setbotleft(Context & context) { - context._cmp(context.ds.byte(296), 0); + context._cmp(context.data.byte(296), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 212); + context._cmp(context.data.byte(100), 212); if (context.flags.z()) goto alreadybotl; - context.ds.byte(100) = 212; + context.data.byte(100) = 212; context.al = 21; commandonly(context); alreadybotl: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto nobotleft; - context.ds.byte(296) = -1; + context.data.byte(296) = -1; nobotleft: return; } static void setbotright(Context & context) { - context._cmp(context.ds.byte(296), 0); + context._cmp(context.data.byte(296), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 213); + context._cmp(context.data.byte(100), 213); if (context.flags.z()) goto alreadybotr; - context.ds.byte(100) = 213; + context.data.byte(100) = 213; context.al = 22; commandonly(context); alreadybotr: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto nobotright; - context.ds.byte(296) = 1; + context.data.byte(296) = 1; nobotright: return; } static void dumpsymbol(Context & context) { - context.ds.byte(109) = 0; + context.data.byte(109) = 0; context.di = 64; context.bx = 56+20; context.cl = 104; @@ -15382,15 +15382,15 @@ static void showsymbol(Context & context) { context.ah = 0; context.di = 64; context.bx = 56; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); - context.al = context.ds.byte(291); + context.al = context.data.byte(291); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.ds.byte(292); + context.al = context.data.byte(292); context.bx = 56+20; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15415,14 +15415,14 @@ static void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - context.al = context.ds.byte(294); + context.al = context.data.byte(294); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.ds.byte(295); + context.al = context.data.byte(295); context._add(context.al, 6); context.bx = 56+49; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15466,88 +15466,88 @@ botwrap: } static void updatesymboltop(Context & context) { - context._cmp(context.ds.byte(293), 0); + context._cmp(context.data.byte(293), 0); if (context.flags.z()) goto topfinished; - context._cmp(context.ds.byte(293), -1); + context._cmp(context.data.byte(293), -1); if (context.flags.z()) goto backwards; - context._add(context.ds.byte(291), 1); - context._cmp(context.ds.byte(291), 49); + context._add(context.data.byte(291), 1); + context._cmp(context.data.byte(291), 49); if (!context.flags.z()) goto notwrapfor; - context.ds.byte(291) = 0; - context._sub(context.ds.byte(292), 1); - context._cmp(context.ds.byte(292), -1); + context.data.byte(291) = 0; + context._sub(context.data.byte(292), 1); + context._cmp(context.data.byte(292), -1); if (!context.flags.z()) goto topfinished; - context.ds.byte(292) = 5; + context.data.byte(292) = 5; return; notwrapfor: - context._cmp(context.ds.byte(291), 24); + context._cmp(context.data.byte(291), 24); if (!context.flags.z()) goto topfinished; - context.ds.byte(293) = 0; + context.data.byte(293) = 0; return; backwards: - context._sub(context.ds.byte(291), 1); - context._cmp(context.ds.byte(291), -1); + context._sub(context.data.byte(291), 1); + context._cmp(context.data.byte(291), -1); if (!context.flags.z()) goto notwrapback; - context.ds.byte(291) = 48; - context._add(context.ds.byte(292), 1); - context._cmp(context.ds.byte(292), 6); + context.data.byte(291) = 48; + context._add(context.data.byte(292), 1); + context._cmp(context.data.byte(292), 6); if (!context.flags.z()) goto topfinished; - context.ds.byte(292) = 0; + context.data.byte(292) = 0; return; notwrapback: - context._cmp(context.ds.byte(291), 24); + context._cmp(context.data.byte(291), 24); if (!context.flags.z()) goto topfinished; - context.ds.byte(293) = 0; + context.data.byte(293) = 0; topfinished: return; } static void updatesymbolbot(Context & context) { - context._cmp(context.ds.byte(296), 0); + context._cmp(context.data.byte(296), 0); if (context.flags.z()) goto botfinished; - context._cmp(context.ds.byte(296), -1); + context._cmp(context.data.byte(296), -1); if (context.flags.z()) goto backwardsbot; - context._add(context.ds.byte(294), 1); - context._cmp(context.ds.byte(294), 49); + context._add(context.data.byte(294), 1); + context._cmp(context.data.byte(294), 49); if (!context.flags.z()) goto notwrapforb; - context.ds.byte(294) = 0; - context._sub(context.ds.byte(295), 1); - context._cmp(context.ds.byte(295), -1); + context.data.byte(294) = 0; + context._sub(context.data.byte(295), 1); + context._cmp(context.data.byte(295), -1); if (!context.flags.z()) goto botfinished; - context.ds.byte(295) = 5; + context.data.byte(295) = 5; return; notwrapforb: - context._cmp(context.ds.byte(294), 24); + context._cmp(context.data.byte(294), 24); if (!context.flags.z()) goto botfinished; - context.ds.byte(296) = 0; + context.data.byte(296) = 0; return; backwardsbot: - context._sub(context.ds.byte(294), 1); - context._cmp(context.ds.byte(294), -1); + context._sub(context.data.byte(294), 1); + context._cmp(context.data.byte(294), -1); if (!context.flags.z()) goto notwrapbackb; - context.ds.byte(294) = 48; - context._add(context.ds.byte(295), 1); - context._cmp(context.ds.byte(295), 6); + context.data.byte(294) = 48; + context._add(context.data.byte(295), 1); + context._cmp(context.data.byte(295), 6); if (!context.flags.z()) goto botfinished; - context.ds.byte(295) = 0; + context.data.byte(295) = 0; return; notwrapbackb: - context._cmp(context.ds.byte(294), 24); + context._cmp(context.data.byte(294), 24); if (!context.flags.z()) goto botfinished; - context.ds.byte(296) = 0; + context.data.byte(296) = 0; botfinished: return; } static void dumpsymbox(Context & context) { - context._cmp(context.ds.word(303), -1); + context._cmp(context.data.word(303), -1); if (context.flags.z()) goto nodumpsym; - context.di = context.ds.word(303); - context.bx = context.ds.word(305); + context.di = context.data.word(303); + context.bx = context.data.word(305); context.cl = 30; context.ch = 77; multidump(context); - context.ds.word(303) = -1; + context.data.word(303) = -1; nodumpsym: return; } @@ -15569,7 +15569,7 @@ static void usediary(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; diaryloop: delpointer(context); readmouse(context); @@ -15581,13 +15581,13 @@ diaryloop: dumptextline(context); context.bx = 3651; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto diaryloop; getridoftemp(context); getridoftemptext(context); getridoftempcharset(context); restorereels(context); - context.ds.byte(131) = 0; + context.data.byte(131) = 0; redrawmainscrn(context); worktoscreenm(context); return; @@ -15600,52 +15600,52 @@ static void showdiary(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12+37; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); context.al = 2; context.ah = 0; context.di = 68+24+176; context.bx = 48+12+108; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); return; } static void showdiarykeys(Context & context) { - context._cmp(context.ds.byte(282), 0); + context._cmp(context.data.byte(282), 0); if (context.flags.z()) goto nokeyatall; - context._sub(context.ds.byte(282), 1); - context._cmp(context.ds.byte(282), 0); + context._sub(context.data.byte(282), 1); + context._cmp(context.data.byte(282), 0); if (context.flags.z()) goto nokeyatall; - context._cmp(context.ds.byte(278), 'N'); + context._cmp(context.data.byte(278), 'N'); if (!context.flags.z()) goto nokeyn; context.al = 3; - context._cmp(context.ds.byte(282), 1); + context._cmp(context.data.byte(282), 1); if (context.flags.z()) goto gotkeyn; context.al = 4; gotkeyn: context.ah = 0; context.di = 68+24+94; context.bx = 48+12+97; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); - context._cmp(context.ds.byte(282), 1); + context._cmp(context.data.byte(282), 1); if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: return; nokeyn: context.al = 5; - context._cmp(context.ds.byte(282), 1); + context._cmp(context.data.byte(282), 1); if (context.flags.z()) goto gotkeyp; context.al = 6; gotkeyp: context.ah = 0; context.di = 68+24+151; context.bx = 48+12+71; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); - context._cmp(context.ds.byte(282), 1); + context._cmp(context.data.byte(282), 1); if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: @@ -15655,13 +15655,13 @@ nokeyatall: } static void dumpdiarykeys(Context & context) { - context._cmp(context.ds.byte(282), 1); + context._cmp(context.data.byte(282), 1); if (!context.flags.z()) goto notdumpdiary; - context._cmp(context.ds.byte(43), 1); + context._cmp(context.data.byte(43), 1); if (context.flags.z()) goto notsartadd; - context._cmp(context.ds.byte(289), 5); + context._cmp(context.data.byte(289), 5); if (!context.flags.z()) goto notsartadd; - context._cmp(context.ds.byte(289), 5); + context._cmp(context.data.byte(289), 5); if (!context.flags.z()) goto notsartadd; context.al = 6; getlocation(context); @@ -15708,53 +15708,53 @@ notdumpdiary: } static void diarykeyp(Context & context) { - context._cmp(context.ds.byte(100), 214); + context._cmp(context.data.byte(100), 214); if (context.flags.z()) goto alreadykeyp; - context.ds.byte(100) = 214; + context.data.byte(100) = 214; context.al = 23; commandonly(context); alreadykeyp: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto notkeyp; - context.ax = context.ds.word(212); - context._cmp(context.ax, context.ds.word(202)); + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); if (context.flags.z()) goto notkeyp; - context._cmp(context.ds.byte(282), 0); + context._cmp(context.data.byte(282), 0); if (!context.flags.z()) goto notkeyp; context.al = 16; playchannel1(context); - context.ds.byte(282) = 12; - context.ds.byte(278) = 'P'; - context._sub(context.ds.byte(289), 1); - context._cmp(context.ds.byte(289), -1); + context.data.byte(282) = 12; + context.data.byte(278) = 'P'; + context._sub(context.data.byte(289), 1); + context._cmp(context.data.byte(289), -1); if (!context.flags.z()) goto notkeyp; - context.ds.byte(289) = 11; + context.data.byte(289) = 11; notkeyp: return; } static void diarykeyn(Context & context) { - context._cmp(context.ds.byte(100), 213); + context._cmp(context.data.byte(100), 213); if (context.flags.z()) goto alreadykeyn; - context.ds.byte(100) = 213; + context.data.byte(100) = 213; context.al = 23; commandonly(context); alreadykeyn: - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto notkeyn; - context.ax = context.ds.word(212); - context._cmp(context.ax, context.ds.word(202)); + context.ax = context.data.word(212); + context._cmp(context.ax, context.data.word(202)); if (context.flags.z()) goto notkeyn; - context._cmp(context.ds.byte(282), 0); + context._cmp(context.data.byte(282), 0); if (!context.flags.z()) goto notkeyn; context.al = 16; playchannel1(context); - context.ds.byte(282) = 12; - context.ds.byte(278) = 'N'; - context._add(context.ds.byte(289), 1); - context._cmp(context.ds.byte(289), 12); + context.data.byte(282) = 12; + context.data.byte(278) = 'N'; + context._add(context.data.byte(289), 1); + context._cmp(context.data.byte(289), 12); if (!context.flags.z()) goto notkeyn; - context.ds.byte(289) = 0; + context.data.byte(289) = 0; notkeyn: return; } @@ -15764,17 +15764,17 @@ static void showdiarypage(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); showframe(context); - context.al = context.ds.byte(289); + context.al = context.data.byte(289); findtext1(context); - context.ds.byte(72) = 1; + context.data.byte(72) = 1; usetempcharset(context); context.di = 68+24+48; context.bx = 48+12+16; context.dl = 240; context.ah = 16; - context.ds.word(71) = 91+91; + context.data.word(71) = 91+91; printdirect(context); context.di = 68+24+129; context.bx = 48+12+16; @@ -15786,8 +15786,8 @@ static void showdiarypage(Context & context) { context.dl = 240; context.ah = 16; printdirect(context); - context.ds.byte(72) = 0; - context.ds.word(71) = 0; + context.data.byte(72) = 0; + context.data.word(71) = 0; usecharset1(context); return; } @@ -15796,7 +15796,7 @@ static void findtext1(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.ds.word(466); + context.es = context.data.word(466); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -15804,29 +15804,29 @@ static void findtext1(Context & context) { } static void zoomonoff(Context & context) { - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(234), 2); + context._cmp(context.data.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadyonoff; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 39; commandonly(context); alreadyonoff: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nozoomonoff; context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: return; dozoomonoff: - context.al = context.ds.byte(8); + context.al = context.data.byte(8); context._xor(context.al, 1); - context.ds.byte(8) = context.al; + context.data.byte(8) = context.al; createpanel(context); - context.ds.byte(62) = 0; + context.data.byte(62) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -15841,18 +15841,18 @@ dozoomonoff: } static void saveload(Context & context) { - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(234), 2); + context._cmp(context.data.byte(234), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.ds.byte(100), 253); + context._cmp(context.data.byte(100), 253); if (context.flags.z()) goto alreadyops; - context.ds.byte(100) = 253; + context.data.byte(100) = 253; context.al = 43; commandonly(context); alreadyops: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noops; context._and(context.ax, 1); if (context.flags.z()) goto noops; @@ -15862,11 +15862,11 @@ noops: } static void dosaveload(Context & context) { - context.ds.byte(231) = 0; - context.ds.word(79) = 70; - context.ds.word(81) = 182-8; - context.ds.byte(82) = 181; - context.ds.byte(131) = 1; + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; clearwork(context); createpanel2(context); undertextline(context); @@ -15881,7 +15881,7 @@ restartops: showmainops(context); worktoscreenm(context); donefirstops: - context.ds.byte(103) = 0; + context.data.byte(103) = 0; waitops: readmouse(context); showpointer(context); @@ -15891,27 +15891,27 @@ waitops: delpointer(context); context.bx = 3693; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto waitops; - context._cmp(context.ds.byte(103), 2); + context._cmp(context.data.byte(103), 2); if (context.flags.z()) goto restartops; - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; - context._cmp(context.ds.byte(103), 4); + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context._cmp(context.data.byte(103), 4); if (context.flags.z()) goto justret; getridoftemp(context); restoreall(context); redrawmainscrn(context); worktoscreenm(context); - context.ds.byte(100) = 200; + context.data.byte(100) = 200; justret: - context.ds.byte(131) = 0; + context.data.byte(131) = 0; return; } static void getbackfromops(Context & context) { - context._cmp(context.ds.byte(56), 2); + context._cmp(context.data.byte(56), 2); if (context.flags.z()) goto opsblock1; getback1(context); return; @@ -15921,19 +15921,19 @@ opsblock1: } static void showmainops(Context & context) { - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+10; context.bx = 52+10; context.al = 8; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+59; context.bx = 52+30; context.al = 7; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; @@ -15943,25 +15943,25 @@ static void showmainops(Context & context) { } static void showdiscops(Context & context) { - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+10; context.bx = 52+10; context.al = 9; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+59; context.bx = 52+30; context.al = 10; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -15977,30 +15977,30 @@ static void loadsavebox(Context & context) { } static void loadgame(Context & context) { - context._cmp(context.ds.byte(100), 246); + context._cmp(context.data.byte(100), 246); if (context.flags.z()) goto alreadyload; - context.ds.byte(100) = 246; + context.data.byte(100) = 246; context.al = 41; commandonly(context); alreadyload: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noload; context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: return; doload: - context.ds.byte(340) = 1; + context.data.byte(340) = 1; showopbox(context); showloadops(context); - context.ds.byte(341) = 0; + context.data.byte(341) = 0; showslots(context); shownames(context); - context.ds.byte(231) = 0; + context.data.byte(231) = 0; worktoscreenm(context); namestoold(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; loadops: delpointer(context); readmouse(context); @@ -16010,9 +16010,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto loadops; - context._cmp(context.ds.byte(103), 2); + context._cmp(context.data.byte(103), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16020,30 +16020,30 @@ loadops: context.bx = 7782; startloading(context); loadroomssample(context); - context.ds.byte(74) = 1; - context.ds.byte(188) = 255; + context.data.byte(74) = 1; + context.data.byte(188) = 255; clearsprites(context); initman(context); initrain(context); - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; startup(context); worktoscreen(context); - context.ds.byte(103) = 4; + context.data.byte(103) = 4; quitloaded: return; } static void getbacktoops(Context & context) { - context._cmp(context.ds.byte(100), 201); + context._cmp(context.data.byte(100), 201); if (context.flags.z()) goto alreadygetops; - context.ds.byte(100) = 201; + context.data.byte(100) = 201; context.al = 42; commandonly(context); alreadygetops: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nogetbackops; context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; @@ -16051,19 +16051,19 @@ nogetbackops: return; dogetbackops: oldtonames(context); - context.ds.byte(103) = 2; + context.data.byte(103) = 2; return; } static void discops(Context & context) { - context._cmp(context.ds.byte(100), 249); + context._cmp(context.data.byte(100), 249); if (context.flags.z()) goto alreadydiscops; - context.ds.byte(100) = 249; + context.data.byte(100) = 249; context.al = 43; commandonly(context); alreadydiscops: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto nodiscops; context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; @@ -16071,12 +16071,12 @@ nodiscops: return; dodiscops: scanfornames(context); - context.ds.byte(340) = 2; + context.data.byte(340) = 2; showopbox(context); showdiscops(context); - context.ds.byte(341) = 0; + context.data.byte(341) = 0; worktoscreenm(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; discopsloop: delpointer(context); readmouse(context); @@ -16086,39 +16086,39 @@ discopsloop: dumptextline(context); context.bx = 3777; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto discopsloop; return; } static void savegame(Context & context) { - context._cmp(context.ds.byte(56), 2); + context._cmp(context.data.byte(56), 2); if (!context.flags.z()) goto cansaveok; blank(context); return; cansaveok: - context._cmp(context.ds.byte(100), 247); + context._cmp(context.data.byte(100), 247); if (context.flags.z()) goto alreadysave; - context.ds.byte(100) = 247; + context.data.byte(100) = 247; context.al = 44; commandonly(context); alreadysave: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; return; dosave: - context.ds.byte(340) = 2; + context.data.byte(340) = 2; showopbox(context); showsaveops(context); - context.ds.byte(341) = 0; + context.data.byte(341) = 0; showslots(context); shownames(context); worktoscreenm(context); namestoold(context); - context.ds.word(394) = 0; - context.ds.word(396) = 0; - context.ds.byte(103) = 0; + context.data.word(394) = 0; + context.data.word(396) = 0; + context.data.byte(103) = 0; saveops: delpointer(context); checkinput(context); @@ -16129,25 +16129,25 @@ saveops: dumptextline(context); context.bx = 3819; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto saveops; return; } static void actualsave(Context & context) { - context._cmp(context.ds.byte(100), 222); + context._cmp(context.data.byte(100), 222); if (context.flags.z()) goto alreadyactsave; - context.ds.byte(100) = 222; + context.data.byte(100) = 222; context.al = 44; commandonly(context); alreadyactsave: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noactsave; context.dx = context.ds; context.ds = context.dx; context.si = 8367; - context.al = context.ds.byte(341); + context.al = context.data.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16155,7 +16155,7 @@ alreadyactsave: context._add(context.si, 1); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto noactsave; - context.al = context.ds.byte(9); + context.al = context.data.byte(9); context.ah = 0; context.cx = 32; context._mul(context.cx); @@ -16167,49 +16167,49 @@ alreadyactsave: context.es = context.cs; context.cx = 16; while(--context.cx) context._movsw(); - context.al = context.ds.byte(531); + context.al = context.data.byte(531); context.ds.byte(context.bx+13) = context.al; - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context.ds.byte(context.bx+15) = context.al; - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.ds.byte(context.bx+16) = context.al; - context.al = context.ds.byte(35); + context.al = context.data.byte(35); context.ds.byte(context.bx+20) = context.al; - context.al = context.ds.byte(475); + context.al = context.data.byte(475); context.ds.byte(context.bx+21) = context.al; - context.al = context.ds.byte(133); + context.al = context.data.byte(133); context.ds.byte(context.bx+22) = context.al; context.al = 255; context.ds.byte(context.bx+27) = context.al; saveposition(context); getridoftemp(context); restoreall(context); - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; redrawmainscrn(context); worktoscreenm(context); - context.ds.byte(103) = 4; + context.data.byte(103) = 4; noactsave: return; } static void actualload(Context & context) { - context._cmp(context.ds.byte(100), 221); + context._cmp(context.data.byte(100), 221); if (context.flags.z()) goto alreadyactload; - context.ds.byte(100) = 221; + context.data.byte(100) = 221; context.al = 41; commandonly(context); alreadyactload: - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto notactload; context._cmp(context.ax, 1); if (!context.flags.z()) goto notactload; context.dx = context.ds; context.ds = context.dx; context.si = 8367; - context.al = context.ds.byte(341); + context.al = context.data.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16218,48 +16218,48 @@ alreadyactload: context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto notactload; loadposition(context); - context.ds.byte(103) = 1; + context.data.byte(103) = 1; notactload: return; } static void selectslot2(Context & context) { - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto noselslot2; - context.ds.byte(340) = 2; + context.data.byte(340) = 2; noselslot2: selectslot(context); return; } static void checkinput(Context & context) { - context._cmp(context.ds.byte(340), 3); + context._cmp(context.data.byte(340), 3); if (context.flags.z()) goto nokeypress; readkey(context); - context.al = context.ds.byte(142); + context.al = context.data.byte(142); context._cmp(context.al, 0); if (context.flags.z()) goto nokeypress; context._cmp(context.al, 13); if (!context.flags.z()) goto notret; - context.ds.byte(340) = 3; + context.data.byte(340) = 3; goto afterkey; notret: context._cmp(context.al, 8); if (!context.flags.z()) goto nodel2; - context._cmp(context.ds.byte(342), 0); + context._cmp(context.data.byte(342), 0); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._sub(context.ds.byte(342), 1); + context._sub(context.data.byte(342), 1); context.ds.byte(context.bx) = 0; context.ds.byte(context.bx+1) = 1; goto afterkey; nodel2: spacepress: - context._cmp(context.ds.byte(342), 14); + context._cmp(context.data.byte(342), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._add(context.ds.byte(342), 1); - context.al = context.ds.byte(142); + context._add(context.data.byte(342), 1); + context.al = context.data.byte(142); context.ds.byte(context.bx+1) = context.al; context.ds.byte(context.bx+2) = 0; context.ds.byte(context.bx+3) = 1; @@ -16276,7 +16276,7 @@ afterkey: } static void getnamepos(Context & context) { - context.al = context.ds.byte(341); + context.al = context.data.byte(341); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16284,20 +16284,20 @@ static void getnamepos(Context & context) { context.es = context.dx; context.bx = 8367; context._add(context.bx, context.ax); - context.al = context.ds.byte(342); + context.al = context.data.byte(342); context.ah = 0; context._add(context.bx, context.ax); return; } static void showopbox(Context & context) { - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60; context.bx = 52; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60; context.bx = 52+55; context.al = 4; @@ -16307,13 +16307,13 @@ static void showopbox(Context & context) { } static void showloadops(Context & context) { - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16328,13 +16328,13 @@ static void showloadops(Context & context) { } static void showsaveops(Context & context) { - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16349,35 +16349,35 @@ static void showsaveops(Context & context) { } static void selectslot(Context & context) { - context._cmp(context.ds.byte(100), 244); + context._cmp(context.data.byte(100), 244); if (context.flags.z()) goto alreadysel; - context.ds.byte(100) = 244; + context.data.byte(100) = 244; context.al = 45; commandonly(context); alreadysel: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto noselslot; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto noselslot; - context._cmp(context.ds.byte(340), 3); + context._cmp(context.data.byte(340), 3); if (!context.flags.z()) goto notnocurs; - context._sub(context.ds.byte(340), 1); + context._sub(context.data.byte(340), 1); notnocurs: oldtonames(context); - context.ax = context.ds.word(200); + context.ax = context.data.word(200); context._sub(context.ax, 52+4); context.cl = -1; getslotnum: context._add(context.cl, 1); context._sub(context.ax, 11); if (!context.flags.c()) goto getslotnum; - context.ds.byte(341) = context.cl; + context.data.byte(341) = context.cl; delpointer(context); showopbox(context); showslots(context); shownames(context); - context._cmp(context.ds.byte(340), 1); + context._cmp(context.data.byte(340), 1); if (context.flags.z()) goto isloadmode; showsaveops(context); readmouse(context); @@ -16400,7 +16400,7 @@ static void showslots(Context & context) { context.di = 60+7; context.bx = 52+8; context.al = 2; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 0; showframe(context); context.di = 60+10; @@ -16410,10 +16410,10 @@ slotloop: context.push(context.cx); context.push(context.di); context.push(context.bx); - context._cmp(context.cl, context.ds.byte(341)); + context._cmp(context.cl, context.data.byte(341)); if (!context.flags.z()) goto nomatchslot; context.al = 3; - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.ah = 0; showframe(context); nomatchslot: @@ -16441,9 +16441,9 @@ shownameloop: context.push(context.bx); context.push(context.si); context.al = 4; - context._cmp(context.cl, context.ds.byte(341)); + context._cmp(context.cl, context.data.byte(341)); if (!context.flags.z()) goto nomatchslot2; - context._cmp(context.ds.byte(340), 2); + context._cmp(context.data.byte(340), 2); if (!context.flags.z()) goto loadmode; context.dx = context.si; context.cx = 15; @@ -16455,7 +16455,7 @@ zerostill: if (!context.flags.z()) goto foundcharacter; goto zerostill; foundcharacter: - context.ds.byte(342) = context.cl; + context.data.byte(342) = context.cl; context.ds.byte(context.si) = '/'; context.ds.byte(context.si+1) = 0; context.push(context.si); @@ -16471,9 +16471,9 @@ loadmode: context.al = 0; context.dl = 200; context.ah = 0; - context.ds.word(71) = 91; + context.data.word(71) = 91; printdirect(context); - context.ds.word(71) = 0; + context.data.word(71) = 0; goto afterprintname; nomatchslot2: context.dl = 200; @@ -16497,7 +16497,7 @@ static void namestoold(Context & context) { context.ds = context.cs; context.si = 8367; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16507,7 +16507,7 @@ static void oldtonames(Context & context) { context.es = context.cs; context.di = 8367; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16519,7 +16519,7 @@ static void makeheader(Context & context) { context.di = 5952; context.ax = 17; storeit(context); - context.ax = 68-context.ds.byte(1); + context.ax = 68-context.data.byte(1); storeit(context); context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; storeit(context); @@ -16527,7 +16527,7 @@ static void makeheader(Context & context) { storeit(context); context.ax = 48; storeit(context); - context.ax = 991-context.ds.byte(537); + context.ax = 991-context.data.byte(537); storeit(context); return; } @@ -16559,18 +16559,18 @@ static void decide(Context & context) { setmode(context); loadpalfromiff(context); clearpalette(context); - context.ds.byte(234) = 0; - context.ds.word(21) = 0; - context.ds.byte(231) = 0; - context.ds.word(79) = 70; - context.ds.word(81) = 182-8; - context.ds.byte(82) = 181; - context.ds.byte(131) = 1; + context.data.byte(234) = 0; + context.data.word(21) = 0; + context.data.byte(231) = 0; + context.data.word(79) = 70; + context.data.word(81) = 182-8; + context.data.byte(82) = 181; + context.data.byte(131) = 1; loadsavebox(context); showdecisions(context); worktoscreen(context); fadescreenup(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; waitdecide: readmouse(context); showpointer(context); @@ -16580,22 +16580,22 @@ waitdecide: delpointer(context); context.bx = 4884; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto waitdecide; - context._cmp(context.ds.byte(103), 4); + context._cmp(context.data.byte(103), 4); if (context.flags.z()) goto hasloadedroom; getridoftemp(context); hasloadedroom: - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; return; } static void showdecisions(Context & context) { createpanel2(context); showopbox(context); - context.ds = context.ds.word(458); + context.ds = context.data.word(458); context.di = 60+17; context.bx = 52+13; context.al = 6; @@ -16606,31 +16606,31 @@ static void showdecisions(Context & context) { } static void newgame(Context & context) { - context._cmp(context.ds.byte(100), 251); + context._cmp(context.data.byte(100), 251); if (context.flags.z()) goto alreadynewgame; - context.ds.byte(100) = 251; + context.data.byte(100) = 251; context.al = 47; commandonly(context); alreadynewgame: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._cmp(context.ax, 1); if (!context.flags.z()) goto nonewgame; - context.ds.byte(103) = 3; + context.data.byte(103) = 3; nonewgame: return; } static void doload(Context & context) { - context.ds.byte(340) = 1; + context.data.byte(340) = 1; showopbox(context); showloadops(context); - context.ds.byte(341) = 0; + context.data.byte(341) = 0; showslots(context); shownames(context); - context.ds.byte(231) = 0; + context.data.byte(231) = 0; worktoscreenm(context); namestoold(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; loadops: delpointer(context); readmouse(context); @@ -16640,9 +16640,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.ds.byte(103), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto loadops; - context._cmp(context.ds.byte(103), 2); + context._cmp(context.data.byte(103), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16650,37 +16650,37 @@ loadops: context.bx = 7782; startloading(context); loadroomssample(context); - context.ds.byte(74) = 1; - context.ds.byte(188) = 255; + context.data.byte(74) = 1; + context.data.byte(188) = 255; clearsprites(context); initman(context); initrain(context); - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; startup(context); worktoscreen(context); - context.ds.byte(103) = 4; + context.data.byte(103) = 4; quitloaded: return; } static void loadold(Context & context) { - context._cmp(context.ds.byte(100), 252); + context._cmp(context.data.byte(100), 252); if (context.flags.z()) goto alreadyloadold; - context.ds.byte(100) = 252; + context.data.byte(100) = 252; context.al = 48; commandonly(context); alreadyloadold: - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._and(context.ax, 1); if (context.flags.z()) goto noloadold; doload(context); - context._cmp(context.ds.byte(103), 4); + context._cmp(context.data.byte(103), 4); if (context.flags.z()) goto noloadold; showdecisions(context); worktoscreenm(context); - context.ds.byte(103) = 0; + context.data.byte(103) = 0; noloadold: return; } @@ -16727,39 +16727,39 @@ tensc: } static void trysoundalloc(Context & context) { - context._cmp(context.ds.byte(358), 1); + context._cmp(context.data.byte(358), 1); if (context.flags.z()) goto gotsoundbuff; - context._add(context.ds.byte(357), 1); + context._add(context.data.byte(357), 1); context.bx = (16384+2048)/16; allocatemem(context); - context.ds.word(353) = context.ax; + context.data.word(353) = context.ax; context.push(context.ax); context.al = context.ah; context.cl = 4; context._shr(context.al, context.cl); - context.ds.byte(356) = context.al; + context.data.byte(356) = context.al; context.ax = context.pop(); context.cl = 4; context._shl(context.ax, context.cl); - context.ds.word(355) = context.ax; + context.data.word(355) = context.ax; context._cmp(context.ax, 0x0b7ff); if (!context.flags.c()) goto soundfail; - context.es = context.ds.word(353); + context.es = context.data.word(353); context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; while(--context.cx) context._stosw(); - context.ds.byte(358) = 1; + context.data.byte(358) = 1; return; soundfail: - context.es = context.ds.word(353); + context.es = context.data.word(353); deallocatemem(context); gotsoundbuff: return; } static void playchannel0(Context & context) { - context._cmp(context.ds.byte(378), 255); + context._cmp(context.data.byte(378), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); context.push(context.ds); @@ -16767,14 +16767,14 @@ static void playchannel0(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.ds.byte(507) = context.al; - context.es = context.ds.word(420); + context.data.byte(507) = context.al; + context.es = context.data.word(420); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank; - context.es = context.ds.word(422); + context.es = context.data.word(422); context._sub(context.al, 12); notsecondbank: - context.ds.byte(508) = context.ah; + context.data.byte(508) = context.ah; context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; @@ -16782,19 +16782,19 @@ notsecondbank: context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); context.ah = 0; - context.ds.word(502) = context.ax; + context.data.word(502) = context.ax; context.ax = context.ds.word(context.bx+1); - context.ds.word(504) = context.ax; + context.data.word(504) = context.ax; context.ax = context.ds.word(context.bx+3); - context.ds.word(506) = context.ax; - context._cmp(context.ds.byte(508), 0); + context.data.word(506) = context.ax; + context._cmp(context.data.byte(508), 0); if (context.flags.z()) goto nosetloop; - context.ax = context.ds.word(502); - context.ds.word(510) = context.ax; - context.ax = context.ds.word(504); - context.ds.word(512) = context.ax; - context.ax = context.ds.word(506); - context.ds.word(514) = context.ax; + context.ax = context.data.word(502); + context.data.word(510) = context.ax; + context.ax = context.data.word(504); + context.data.word(512) = context.ax; + context.ax = context.data.word(506); + context.data.word(514) = context.ax; nosetloop: context.si = context.pop(); context.di = context.pop(); @@ -16807,9 +16807,9 @@ dontbother4: } static void playchannel1(Context & context) { - context._cmp(context.ds.byte(378), 255); + context._cmp(context.data.byte(378), 255); if (context.flags.z()) goto dontbother5; - context._cmp(context.ds.byte(515), 7); + context._cmp(context.data.byte(515), 7); if (context.flags.z()) goto dontbother5; context.push(context.es); context.push(context.ds); @@ -16817,11 +16817,11 @@ static void playchannel1(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.ds.byte(515) = context.al; - context.es = context.ds.word(420); + context.data.byte(515) = context.al; + context.es = context.data.word(420); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank1; - context.es = context.ds.word(422); + context.es = context.data.word(422); context._sub(context.al, 12); notsecondbank1: context.ah = 0; @@ -16831,11 +16831,11 @@ notsecondbank1: context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); context.ah = 0; - context.ds.word(517) = context.ax; + context.data.word(517) = context.ax; context.ax = context.ds.word(context.bx+1); - context.ds.word(519) = context.ax; + context.data.word(519) = context.ax; context.ax = context.ds.word(context.bx+3); - context.ds.word(521) = context.ax; + context.data.word(521) = context.ax; context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); @@ -16849,102 +16849,102 @@ dontbother5: static void makenextblock(Context & context) { volumeadjust(context); loopchannel0(context); - context._cmp(context.ds.word(521), 0); + context._cmp(context.data.word(521), 0); if (context.flags.z()) goto mightbeonlych0; - context._cmp(context.ds.word(506), 0); + context._cmp(context.data.word(506), 0); if (context.flags.z()) goto mightbeonlych1; - context._sub(context.ds.word(506), 1); - context._sub(context.ds.word(521), 1); + context._sub(context.data.word(506), 1); + context._sub(context.data.word(521), 1); bothchannels(context); return; mightbeonlych1: - context.ds.byte(507) = 255; - context._cmp(context.ds.word(521), 0); + context.data.byte(507) = 255; + context._cmp(context.data.word(521), 0); if (context.flags.z()) goto notch1only; - context._sub(context.ds.word(521), 1); + context._sub(context.data.word(521), 1); channel1only(context); notch1only: return; mightbeonlych0: - context.ds.byte(515) = 255; - context._cmp(context.ds.word(506), 0); + context.data.byte(515) = 255; + context._cmp(context.data.word(506), 0); if (context.flags.z()) goto notch0only; - context._sub(context.ds.word(506), 1); + context._sub(context.data.word(506), 1); channel0only(context); return; notch0only: - context.es = context.ds.word(353); - context.di = context.ds.word(525); + context.es = context.data.word(353); + context.di = context.data.word(525); context.cx = 1024; context.ax = 0x7f7f; while(--context.cx) context._stosw(); context._and(context.di, 16384-1); - context.ds.word(525) = context.di; + context.data.word(525) = context.di; return; } static void volumeadjust(Context & context) { - context.al = context.ds.byte(388); + context.al = context.data.byte(388); context._cmp(context.al, 0); if (context.flags.z()) goto volok; - context.al = context.ds.byte(386); - context._cmp(context.al, context.ds.byte(387)); + context.al = context.data.byte(386); + context._cmp(context.al, context.data.byte(387)); if (context.flags.z()) goto volfinish; - context._add(context.ds.byte(389), 64); + context._add(context.data.byte(389), 64); if (!context.flags.z()) goto volok; - context.al = context.ds.byte(386); - context._add(context.al, context.ds.byte(388)); - context.ds.byte(386) = context.al; + context.al = context.data.byte(386); + context._add(context.al, context.data.byte(388)); + context.data.byte(386) = context.al; return; volfinish: - context.ds.byte(388) = 0; + context.data.byte(388) = 0; volok: return; } static void loopchannel0(Context & context) { - context._cmp(context.ds.word(506), 0); + context._cmp(context.data.word(506), 0); if (!context.flags.z()) goto notloop; - context._cmp(context.ds.byte(508), 0); + context._cmp(context.data.byte(508), 0); if (context.flags.z()) goto notloop; - context._cmp(context.ds.byte(508), 255); + context._cmp(context.data.byte(508), 255); if (context.flags.z()) goto endlessloop; - context._sub(context.ds.byte(508), 1); + context._sub(context.data.byte(508), 1); endlessloop: - context.ax = context.ds.word(510); - context.ds.word(502) = context.ax; - context.ax = context.ds.word(512); - context.ds.word(504) = context.ax; - context.ax = context.ds.word(506); - context._add(context.ax, context.ds.word(514)); - context.ds.word(506) = context.ax; + context.ax = context.data.word(510); + context.data.word(502) = context.ax; + context.ax = context.data.word(512); + context.data.word(504) = context.ax; + context.ax = context.data.word(506); + context._add(context.ax, context.data.word(514)); + context.data.word(506) = context.ax; return; notloop: return; } static void cancelch0(Context & context) { - context.ds.byte(508) = 0; - context.ds.word(506) = 0; - context.ds.byte(507) = 255; + context.data.byte(508) = 0; + context.data.word(506) = 0; + context.data.byte(507) = 255; return; } static void cancelch1(Context & context) { - context.ds.word(521) = 0; - context.ds.byte(515) = 255; + context.data.word(521) = 0; + context.data.byte(515) = 255; return; } static void channel0tran(Context & context) { - context._cmp(context.ds.byte(386), 0); + context._cmp(context.data.byte(386), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(--context.cx) context._movsw(); return; lowvolumetran: context.cx = 1024; - context.bh = context.ds.byte(386); + context.bh = context.data.byte(386); context.bl = 0; context._add(context.bx, 16384-256); volloop: @@ -16959,7 +16959,7 @@ volloop: } static void domix(Context & context) { - context._cmp(context.ds.byte(386), 0); + context._cmp(context.data.byte(386), 0); if (!context.flags.z()) goto lowvolumemix; slow: context._lodsb(); @@ -17004,7 +17004,7 @@ nodistort: lowvolumemix: context._lodsb(); context.push(context.bx); - context.bh = context.ds.byte(386); + context.bh = context.data.byte(386); context._add(context.bh, 63); context.bl = context.al; context.al = context.ds.byte(context.bx); @@ -17051,7 +17051,7 @@ doneit: } static void entrytexts(Context & context) { - context._cmp(context.ds.byte(9), 21); + context._cmp(context.data.byte(9), 21); if (!context.flags.z()) goto notloc15; context.al = 28; context.cx = 60; @@ -17061,7 +17061,7 @@ static void entrytexts(Context & context) { setuptimeduse(context); return; notloc15: - context._cmp(context.ds.byte(9), 30); + context._cmp(context.data.byte(9), 30); if (!context.flags.z()) goto notloc43; context.al = 27; context.cx = 60; @@ -17071,7 +17071,7 @@ notloc15: setuptimeduse(context); return; notloc43: - context._cmp(context.ds.byte(9), 23); + context._cmp(context.data.byte(9), 23); if (!context.flags.z()) goto notloc23; context.al = 29; context.cx = 60; @@ -17081,7 +17081,7 @@ notloc43: setuptimeduse(context); return; notloc23: - context._cmp(context.ds.byte(9), 31); + context._cmp(context.data.byte(9), 31); if (!context.flags.z()) goto notloc44; context.al = 30; context.cx = 60; @@ -17091,7 +17091,7 @@ notloc23: setuptimeduse(context); return; notloc44: - context._cmp(context.ds.byte(9), 20); + context._cmp(context.data.byte(9), 20); if (!context.flags.z()) goto notsarters2; context.al = 31; context.cx = 60; @@ -17101,7 +17101,7 @@ notloc44: setuptimeduse(context); return; notsarters2: - context._cmp(context.ds.byte(9), 24); + context._cmp(context.data.byte(9), 24); if (!context.flags.z()) goto notedenlob; context.al = 32; context.cx = 60; @@ -17111,7 +17111,7 @@ notsarters2: setuptimeduse(context); return; notedenlob: - context._cmp(context.ds.byte(9), 34); + context._cmp(context.data.byte(9), 34); if (!context.flags.z()) goto noteden2; context.al = 33; context.cx = 60; @@ -17125,71 +17125,71 @@ noteden2: } static void entryanims(Context & context) { - context.ds.word(23) = -1; - context.ds.byte(32) = -1; - context._cmp(context.ds.byte(9), 33); + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.byte(9), 33); if (!context.flags.z()) goto notinthebeach; switchryanoff(context); - context.ds.word(21) = 76*2; - context.ds.word(23) = 0; - context.ds.word(25) = 76; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 76*2; + context.data.word(23) = 0; + context.data.word(25) = 76; + context.data.byte(27) = 1; + context.data.byte(26) = 1; return; notinthebeach: - context._cmp(context.ds.byte(9), 44); + context._cmp(context.data.byte(9), 44); if (!context.flags.z()) goto notsparkys; context.al = 8; resetlocation(context); - context.ds.word(21) = 50*2; - context.ds.word(23) = 247; - context.ds.word(25) = 297; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 50*2; + context.data.word(23) = 247; + context.data.word(25) = 297; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; notsparkys: - context._cmp(context.ds.byte(9), 22); + context._cmp(context.data.byte(9), 22); if (!context.flags.z()) goto notinthelift; - context.ds.word(21) = 31*2; - context.ds.word(23) = 0; - context.ds.word(25) = 30; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 31*2; + context.data.word(23) = 0; + context.data.word(25) = 30; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; notinthelift: - context._cmp(context.ds.byte(9), 26); + context._cmp(context.data.byte(9), 26); if (!context.flags.z()) goto notunderchurch; - context.ds.byte(292) = 2; - context.ds.byte(295) = 1; + context.data.byte(292) = 2; + context.data.byte(295) = 1; return; notunderchurch: - context._cmp(context.ds.byte(9), 45); + context._cmp(context.data.byte(9), 45); if (!context.flags.z()) goto notenterdream; - context.ds.byte(54) = 0; - context.ds.word(21) = 296; - context.ds.word(23) = 45; - context.ds.word(25) = 198; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.byte(54) = 0; + context.data.word(21) = 296; + context.data.word(23) = 45; + context.data.word(25) = 198; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; notenterdream: - context._cmp(context.ds.byte(184), 46); + context._cmp(context.data.byte(184), 46); if (!context.flags.z()) goto notcrystal; - context._cmp(context.ds.byte(43), 1); + context._cmp(context.data.byte(43), 1); if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); return; notcrystal: - context._cmp(context.ds.byte(9), 9); + context._cmp(context.data.byte(9), 9); if (!context.flags.z()) goto nottopchurch; context.al = 2; checkifpathison(context); if (context.flags.z()) goto nottopchurch; - context._cmp(context.ds.byte(44), 0); + context._cmp(context.data.byte(44), 0); if (context.flags.z()) goto nottopchurch; context.al = 3; checkifpathison(context); @@ -17203,7 +17203,7 @@ makedoorsopen: placesetobject(context); return; nottopchurch: - context._cmp(context.ds.byte(9), 47); + context._cmp(context.data.byte(9), 47); if (!context.flags.z()) goto notdreamcentre; context.al = 4; placesetobject(context); @@ -17211,30 +17211,30 @@ nottopchurch: placesetobject(context); return; notdreamcentre: - context._cmp(context.ds.byte(9), 38); + context._cmp(context.data.byte(9), 38); if (!context.flags.z()) goto notcarpark; - context.ds.word(21) = 57*2; - context.ds.word(23) = 4; - context.ds.word(25) = 57; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 57*2; + context.data.word(23) = 4; + context.data.word(25) = 57; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; notcarpark: - context._cmp(context.ds.byte(9), 32); + context._cmp(context.data.byte(9), 32); if (!context.flags.z()) goto notalley; - context.ds.word(21) = 66*2; - context.ds.word(23) = 0; - context.ds.word(25) = 66; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.word(21) = 66*2; + context.data.word(23) = 0; + context.data.word(25) = 66; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; notalley: - context._cmp(context.ds.byte(9), 24); + context._cmp(context.data.byte(9), 24); if (!context.flags.z()) goto notedensagain; context.al = 2; - context.ah = context.ds.byte(185); + context.ah = context.data.byte(185); context._sub(context.ah, 1); turnanypathon(context); notedensagain: @@ -17242,7 +17242,7 @@ notedensagain: } static void initialinv(Context & context) { - context._cmp(context.ds.byte(184), 24); + context._cmp(context.data.byte(184), 24); if (context.flags.z()) goto isedens; return; isedens: @@ -17271,20 +17271,20 @@ isedens: context.al = 16; context.ah = 2; pickupob(context); - context.ds.byte(32) = 1; - context.ds.word(29) = 0; - context.ds.word(31) = 6; - context.ds.byte(27) = 1; - context.ds.byte(26) = 1; + context.data.byte(32) = 1; + context.data.word(29) = 0; + context.data.word(31) = 6; + context.data.byte(27) = 1; + context.data.byte(26) = 1; switchryanoff(context); return; } static void pickupob(Context & context) { - context.ds.byte(107) = context.ah; - context.ds.byte(102) = 2; - context.ds.byte(89) = context.al; - context.ds.byte(99) = context.al; + context.data.byte(107) = context.ah; + context.data.byte(102) = 2; + context.data.byte(89) = context.al; + context.data.byte(99) = context.al; getanyad(context); transfertoex(context); return; @@ -17295,10 +17295,10 @@ static void checkforemm(Context & context) { } static void checkbasemem(Context & context) { - context.bx = context.ds.word(534); + context.bx = context.data.word(534); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; - context.ds.byte(532) = 5; + context.data.byte(532) = 5; { quickquit(context); return; }; enoughmem: return; @@ -17307,86 +17307,86 @@ enoughmem: static void allocatebuffers(Context & context) { context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; allocatemem(context); - context.ds.word(398) = context.ax; + context.data.word(398) = context.ax; trysoundalloc(context); context.bx = 0+(66*60)/16; allocatemem(context); - context.ds.word(418) = context.ax; + context.data.word(418) = context.ax; trysoundalloc(context); - context.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-context.ds.byte(537)+68-context.ds.byte(1)/16; + context.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-context.data.byte(537)+68-context.data.byte(1)/16; allocatemem(context); - context.ds.word(412) = context.ax; + context.data.word(412) = context.ax; trysoundalloc(context); context.bx = 16*80/16; allocatemem(context); - context.ds.word(426) = context.ax; + context.data.word(426) = context.ax; trysoundalloc(context); context.bx = 64*128/16; allocatemem(context); - context.ds.word(428) = context.ax; + context.data.word(428) = context.ax; trysoundalloc(context); context.bx = 22*8*20*8/16; allocatemem(context); - context.ds.word(402) = context.ax; + context.data.word(402) = context.ax; allocatework(context); context.bx = 2048/16; allocatemem(context); - context.ds.word(420) = context.ax; + context.data.word(420) = context.ax; context.bx = 2048/16; allocatemem(context); - context.ds.word(422) = context.ax; + context.data.word(422) = context.ax; return; } static void clearbuffers(Context & context) { - context.es = context.ds.word(412); - context.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-context.ds.byte(537)+68-context.ds.byte(1)/2; + context.es = context.data.word(412); + context.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-context.data.byte(537)+68-context.data.byte(1)/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.ds.word(398); + context.es = context.data.word(398); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.ds.word(412); + context.es = context.data.word(412); context.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); context.ds = context.cs; context.si = 537; - context.cx = 991-context.ds.byte(537); + context.cx = 991-context.data.byte(537); while(--context.cx) context._movsb(); - context.es = context.ds.word(412); - context.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-context.ds.byte(537); + context.es = context.data.word(412); + context.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-context.data.byte(537); context.ds = context.cs; context.si = 1; - context.cx = 68-context.ds.byte(1); + context.cx = 68-context.data.byte(1); while(--context.cx) context._movsb(); clearchanges(context); return; } static void clearchanges(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.cx = 250*2; context.ax = 0x0ffff; context.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); while(--context.cx) context._stosw(); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.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); context.es = context.cs; context.di = 537; - context.cx = 991-context.ds.byte(537); + context.cx = 991-context.data.byte(537); while(--context.cx) context._movsb(); - context.ds = context.ds.word(412); - context.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-context.ds.byte(537); + context.ds = context.data.word(412); + context.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-context.data.byte(537); context.es = context.cs; context.di = 1; - context.cx = 68-context.ds.byte(1); + context.cx = 68-context.data.byte(1); while(--context.cx) context._movsb(); - context.ds.byte(10) = 0; - context.ds.word(12) = 0; - context.ds.word(14) = 0; - context.es = context.ds.word(398); + context.data.byte(10) = 0; + context.data.word(12) = 0; + context.data.word(14) = 0; + context.es = context.data.word(398); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; @@ -17407,48 +17407,48 @@ static void clearchanges(Context & context) { } static void clearbeforeload(Context & context) { - context._cmp(context.ds.byte(74), 1); + context._cmp(context.data.byte(74), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); - context.ds.byte(74) = 0; + context.data.byte(74) = 0; noclear: return; } static void clearreels(Context & context) { - context.es = context.ds.word(430); + context.es = context.data.word(430); deallocatemem(context); - context.es = context.ds.word(432); + context.es = context.data.word(432); deallocatemem(context); - context.es = context.ds.word(434); + context.es = context.data.word(434); deallocatemem(context); return; } static void clearrest(Context & context) { - context.es = context.ds.word(418); + context.es = context.data.word(418); context.cx = 66*60/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.ds.word(416); + context.es = context.data.word(416); deallocatemem(context); - context.es = context.ds.word(444); + context.es = context.data.word(444); deallocatemem(context); - context.es = context.ds.word(450); + context.es = context.data.word(450); deallocatemem(context); - context.es = context.ds.word(448); + context.es = context.data.word(448); deallocatemem(context); - context.es = context.ds.word(440); + context.es = context.data.word(440); deallocatemem(context); - context.es = context.ds.word(442); + context.es = context.data.word(442); deallocatemem(context); - context.es = context.ds.word(436); + context.es = context.data.word(436); deallocatemem(context); - context.es = context.ds.word(446); + context.es = context.data.word(446); deallocatemem(context); - context.es = context.ds.word(438); + context.es = context.data.word(438); deallocatemem(context); return; } @@ -17486,13 +17486,13 @@ lookattail: issoundint: context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.ds.byte(378) = context.al; + context.data.byte(378) = context.al; context._add(context.bx, 1); goto lookattail; isdma: context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.ds.byte(379) = context.al; + context.data.byte(379) = context.al; context._add(context.bx, 1); goto lookattail; isbaseadd: @@ -17503,16 +17503,16 @@ isbaseadd: context.cl = 4; context._shl(context.ax, context.cl); context._add(context.ax, 0x200); - context.ds.word(372) = context.ax; + context.data.word(372) = context.ax; context.cx = context.pop(); context._add(context.bx, 1); goto lookattail; isbright: - context.ds.byte(73) = 1; + context.data.byte(73) = 1; context._add(context.bx, 1); goto lookattail; isnosound: - context.ds.byte(378) = 255; + context.data.byte(378) = 255; context._add(context.bx, 1); goto lookattail; endtail: @@ -17520,10 +17520,10 @@ endtail: } static void startup(Context & context) { - context.ds.byte(142) = 0; - context.ds.byte(105) = 0; + context.data.byte(142) = 0; + context.data.byte(105) = 0; createpanel(context); - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17537,11 +17537,11 @@ static void startup(Context & context) { static void startup1(Context & context) { clearpalette(context); - context.ds.byte(61) = 0; - context.ds.byte(142) = '0'; - context.ds.byte(105) = 0; + context.data.byte(61) = 0; + context.data.byte(142) = '0'; + context.data.byte(105) = 0; createpanel(context); - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17560,9 +17560,9 @@ static void screenupdate(Context & context) { mainscreen(context); animpointer(context); showpointer(context); - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto iswatchingmode; - context._cmp(context.ds.byte(188), 255); + context._cmp(context.data.byte(188), 255); if (!context.flags.z()) goto finishearly; iswatchingmode: vsync(context); @@ -17575,7 +17575,7 @@ iswatchingmode: watchcount(context); zoom(context); showpointer(context); - context._cmp(context.ds.byte(391), 0); + context._cmp(context.data.byte(391), 0); if (!context.flags.z()) goto finishearly; vsync(context); readmouse2(context); @@ -17604,74 +17604,74 @@ finishearly: } static void watchreel(Context & context) { - context._cmp(context.ds.word(23), -1); + context._cmp(context.data.word(23), -1); if (context.flags.z()) goto notplayingreel; - context.al = context.ds.byte(475); - context._cmp(context.al, context.ds.byte(477)); + context.al = context.data.byte(475); + context._cmp(context.al, context.data.byte(477)); if (!context.flags.z()) goto waitstopwalk; - context.al = context.ds.byte(135); - context._cmp(context.al, context.ds.byte(133)); + context.al = context.data.byte(135); + context._cmp(context.al, context.data.byte(133)); if (context.flags.z()) goto notwatchpath; waitstopwalk: return; notwatchpath: - context._sub(context.ds.byte(26), 1); - context._cmp(context.ds.byte(26), -1); + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); if (!context.flags.z()) goto showwatchreel; - context.al = context.ds.byte(27); - context.ds.byte(26) = context.al; - context.ax = context.ds.word(23); - context._cmp(context.ax, context.ds.word(25)); + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context.ax = context.data.word(23); + context._cmp(context.ax, context.data.word(25)); if (!context.flags.z()) goto ismorereel; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto showwatchreel; - context.ds.word(23) = -1; - context.ds.byte(32) = -1; - context._cmp(context.ds.word(29), -1); + context.data.word(23) = -1; + context.data.byte(32) = -1; + context._cmp(context.data.word(29), -1); if (context.flags.z()) goto nomorereel; - context.ds.byte(32) = 1; + context.data.byte(32) = 1; goto notplayingreel; ismorereel: - context._add(context.ds.word(23), 1); + context._add(context.data.word(23), 1); showwatchreel: - context.ax = context.ds.word(23); - context.ds.word(239) = context.ax; + context.ax = context.data.word(23); + context.data.word(239) = context.ax; plotreel(context); - context.ax = context.ds.word(239); - context.ds.word(23) = context.ax; + context.ax = context.data.word(239); + context.data.word(23) = context.ax; checkforshake(context); nomorereel: return; notplayingreel: - context._cmp(context.ds.byte(32), 1); + context._cmp(context.data.byte(32), 1); if (!context.flags.z()) goto notholdingreel; - context.ax = context.ds.word(29); - context.ds.word(239) = context.ax; + context.ax = context.data.word(29); + context.data.word(239) = context.ax; plotreel(context); return; notholdingreel: - context._cmp(context.ds.byte(32), 2); + context._cmp(context.data.byte(32), 2); if (!context.flags.z()) goto notreleasehold; - context._sub(context.ds.byte(26), 1); - context._cmp(context.ds.byte(26), -1); + context._sub(context.data.byte(26), 1); + context._cmp(context.data.byte(26), -1); if (!context.flags.z()) goto notlastspeed2; - context.al = context.ds.byte(27); - context.ds.byte(26) = context.al; - context._add(context.ds.word(29), 1); + context.al = context.data.byte(27); + context.data.byte(26) = context.al; + context._add(context.data.word(29), 1); notlastspeed2: - context.ax = context.ds.word(29); - context._cmp(context.ax, context.ds.word(31)); + context.ax = context.data.word(29); + context._cmp(context.ax, context.data.word(31)); if (!context.flags.z()) goto ismorereel2; - context.ds.word(29) = -1; - context.ds.byte(32) = -1; - context.al = context.ds.byte(33); - context.ds.byte(478) = context.al; - context.ds.byte(477) = context.al; + context.data.word(29) = -1; + context.data.byte(32) = -1; + context.al = context.data.byte(33); + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; autosetwalk(context); return; ismorereel2: - context.ax = context.ds.word(29); - context.ds.word(239) = context.ax; + context.ax = context.data.word(29); + context.data.word(239) = context.ax; plotreel(context); return; notreleasehold: @@ -17679,22 +17679,22 @@ notreleasehold: } static void checkforshake(Context & context) { - context._cmp(context.ds.byte(184), 26); + context._cmp(context.data.byte(184), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; - context.ds.byte(68) = -1; + context.data.byte(68) = -1; notstartshake: return; } static void watchcount(Context & context) { - context._cmp(context.ds.byte(3), 0); + context._cmp(context.data.byte(3), 0); if (context.flags.z()) goto nowatchworn; - context._add(context.ds.byte(146), 1); - context._cmp(context.ds.byte(146), 9); + context._add(context.data.byte(146), 1); + context._cmp(context.data.byte(146), 9); if (context.flags.z()) goto flashdots; - context._cmp(context.ds.byte(146), 18); + context._cmp(context.data.byte(146), 18); if (context.flags.z()) goto uptime; nowatchworn: return; @@ -17702,89 +17702,89 @@ flashdots: context.ax = 91*3+21; context.di = 268+4; context.bx = 21; - context.ds = context.ds.word(404); + context.ds = context.data.word(404); showframe(context); goto finishwatch; uptime: - context.ds.byte(146) = 0; - context._add(context.ds.byte(5), 1); - context._cmp(context.ds.byte(5), 60); + context.data.byte(146) = 0; + context._add(context.data.byte(5), 1); + context._cmp(context.data.byte(5), 60); if (!context.flags.z()) goto finishtime; - context.ds.byte(5) = 0; - context._add(context.ds.byte(6), 1); - context._cmp(context.ds.byte(6), 60); + context.data.byte(5) = 0; + context._add(context.data.byte(6), 1); + context._cmp(context.data.byte(6), 60); if (!context.flags.z()) goto finishtime; - context.ds.byte(6) = 0; - context._add(context.ds.byte(7), 1); - context._cmp(context.ds.byte(7), 24); + context.data.byte(6) = 0; + context._add(context.data.byte(7), 1); + context._cmp(context.data.byte(7), 24); if (!context.flags.z()) goto finishtime; - context.ds.byte(7) = 0; + context.data.byte(7) = 0; finishtime: showtime(context); finishwatch: - context.ds.byte(266) = 1; + context.data.byte(266) = 1; return; } static void showtime(Context & context) { - context._cmp(context.ds.byte(3), 0); + context._cmp(context.data.byte(3), 0); if (context.flags.z()) goto nowatch; - context.al = context.ds.byte(5); + context.al = context.data.byte(5); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 282+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 282+9; context.bx = 21; showframe(context); - context.al = context.ds.byte(6); + context.al = context.data.byte(6); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 270+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 270+11; context.bx = 21; showframe(context); - context.al = context.ds.byte(7); + context.al = context.data.byte(7); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 256+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 256+11; context.bx = 21; showframe(context); context.ax = 91*3+20; - context.ds = context.ds.word(404); + context.ds = context.data.word(404); context.di = 267+5; context.bx = 21; showframe(context); @@ -17793,14 +17793,14 @@ nowatch: } static void dumpwatch(Context & context) { - context._cmp(context.ds.byte(266), 1); + context._cmp(context.data.byte(266), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; context.bx = 21; context.cl = 40; context.ch = 12; multidump(context); - context.ds.byte(266) = 0; + context.data.byte(266) = 0; nodumpwatch: return; } @@ -17905,57 +17905,57 @@ noconvnum: static void walkandexamine(Context & context) { finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.ds.byte(307); - context.ds.byte(100) = context.al; - context.al = context.ds.byte(308); - context.ds.byte(99) = context.al; - context.ds.byte(306) = 0; - context._cmp(context.ds.byte(100), 5); + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.ds.byte(473) = 1; + context.data.byte(473) = 1; noobselect: return; diff: - context.ds.byte(99) = context.al; - context.ds.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; diff2: - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.ds.byte(133); - context._cmp(context.al, context.ds.byte(135)); + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (!context.flags.z()) goto notblock; - context.bl = context.ds.byte(475); - context._cmp(context.bl, context.ds.byte(474)); + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); if (!context.flags.z()) goto dontcheck; - context.cl = context.ds.byte(151); + context.cl = context.data.byte(151); context._add(context.cl, 12); - context.ch = context.ds.byte(152); + context.ch = context.data.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.ds.byte(153), 2); + context._cmp(context.data.byte(153), 2); if (context.flags.c()) goto isblock; - context._cmp(context.ds.byte(153), 128); + context._cmp(context.data.byte(153), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.ds.byte(475); - context._cmp(context.bl, context.ds.byte(474)); + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (context.flags.z()) goto isblock; - context._cmp(context.ds.byte(100), 5); + context._cmp(context.data.byte(100), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -17974,14 +17974,14 @@ toofaraway: } static void mainscreen(Context & context) { - context.ds.byte(237) = 0; + context.data.byte(237) = 0; context.bx = 4949; - context._cmp(context.ds.byte(3), 1); + context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto checkmain; context.bx = 5011; checkmain: checkcoords(context); - context._cmp(context.ds.byte(306), 0); + context._cmp(context.data.byte(306), 0); if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: @@ -17989,26 +17989,26 @@ finishmain: } static void madmanrun(Context & context) { - context._cmp(context.ds.byte(9), 14); + context._cmp(context.data.byte(9), 14); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.ds.byte(234), 2); + context._cmp(context.data.byte(234), 2); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.ds.byte(53), 0); + context._cmp(context.data.byte(53), 0); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.ds.byte(100), 211); + context._cmp(context.data.byte(100), 211); if (context.flags.z()) goto alreadyrun; - context.ds.byte(100) = 211; + context.data.byte(100) = 211; context.al = 52; commandonly(context); alreadyrun: - context._cmp(context.ds.word(202), 1); + context._cmp(context.data.word(202), 1); if (!context.flags.z()) goto norun; - context.ax = context.ds.word(202); - context._cmp(context.ax, context.ds.word(212)); + context.ax = context.data.word(202); + context._cmp(context.ax, context.data.word(212)); if (context.flags.z()) goto norun; - context.ds.byte(65) = 8; + context.data.byte(65) = 8; norun: return; } @@ -18019,16 +18019,16 @@ loop048: context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nonefound; context.push(context.bx); - context._cmp(context.ds.word(198), context.ax); + context._cmp(context.data.word(198), context.ax); if (context.flags.l()) goto over045; context.ax = context.ds.word(context.bx+2); - context._cmp(context.ds.word(198), context.ax); + context._cmp(context.data.word(198), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.ds.word(context.bx+4); - context._cmp(context.ds.word(200), context.ax); + context._cmp(context.data.word(200), context.ax); if (context.flags.l()) goto over045; context.ax = context.ds.word(context.bx+6); - context._cmp(context.ds.word(200), context.ax); + context._cmp(context.data.word(200), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.ds.word(context.bx+8); __dispatch_call(context, context.ax); @@ -18044,31 +18044,31 @@ nonefound: } static void identifyob(Context & context) { - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) { blank(context); return; }; - context.ax = context.ds.word(198); - context._sub(context.ax, context.ds.word(117)); + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); return; notover1: - context.bx = context.ds.word(200); - context._sub(context.bx, context.ds.word(119)); + context.bx = context.data.word(200); + context._sub(context.bx, context.data.word(119)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); return; notover2: - context.ds.byte(237) = 1; + context.data.byte(237) = 1; context.ah = context.bl; context.push(context.ax); findpathofpoint(context); - context.ds.byte(474) = context.dl; + context.data.byte(474) = context.dl; context.ax = context.pop(); context.push(context.ax); findfirstpath(context); - context.ds.byte(476) = context.al; + context.data.byte(476) = context.al; context.ax = context.pop(); checkifex(context); if (!context.flags.z()) goto finishidentify; @@ -18078,16 +18078,16 @@ notover2: if (!context.flags.z()) goto finishidentify; checkifset(context); if (!context.flags.z()) goto finishidentify; - context.ax = context.ds.word(198); - context._sub(context.ax, context.ds.word(117)); + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); context.cl = context.al; - context.ax = context.ds.word(200); - context._sub(context.ax, context.ds.word(119)); + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); context.ch = context.al; checkone(context); context._cmp(context.al, 0); if (context.flags.z()) goto nothingund; - context._cmp(context.ds.byte(56), 1); + context._cmp(context.data.byte(56), 1); if (context.flags.z()) goto nothingund; context.ah = 3; obname(context); @@ -18099,7 +18099,7 @@ nothingund: } static void checkifperson(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.cx = 12; identifyreel: @@ -18110,7 +18110,7 @@ identifyreel: context.push(context.bx); context.push(context.ax); context.ax = context.ds.word(context.bx+0); - context.ds.word(239) = context.ax; + context.data.word(239) = context.ax; getreelstart(context); context._cmp(context.ds.word(context.si+2), 0x0ffff); if (!context.flags.z()) goto notblankpers; @@ -18139,7 +18139,7 @@ notblankpers: if (!context.flags.c()) goto notareelid; context.cx = context.pop(); context.ax = context.ds.word(context.bx+2); - context.ds.word(249) = context.ax; + context.data.word(249) = context.ax; context.al = context.ds.byte(context.bx+4); context.ah = 5; obname(context); @@ -18155,7 +18155,7 @@ notareelid: } static void checkifset(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; identifyset: @@ -18188,7 +18188,7 @@ notasetid: } static void checkifex(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; identifyex: @@ -18217,7 +18217,7 @@ notanexid: } static void checkiffree(Context & context) { - context.es = context.ds.word(412); + context.es = context.data.word(412); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; identifyfree: @@ -18254,7 +18254,7 @@ static void isitdescribed(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(440); + context.es = context.data.word(440); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); @@ -18271,8 +18271,8 @@ static void isitdescribed(Context & context) { static void findpathofpoint(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.ds.word(450); - context.al = context.ds.byte(185); + context.es = context.data.word(450); + context.al = context.data.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18309,8 +18309,8 @@ gotvalidpath: static void findfirstpath(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.ds.word(450); - context.al = context.ds.byte(185); + context.es = context.data.word(450); + context.al = context.data.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18347,7 +18347,7 @@ static void turnpathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; - context.ch = context.ds.byte(185); + context.ch = context.data.byte(185); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18370,7 +18370,7 @@ static void turnpathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; - context.ch = context.ds.byte(185); + context.ch = context.data.byte(185); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18401,7 +18401,7 @@ static void turnanypathon(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18427,7 +18427,7 @@ static void turnanypathoff(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18456,27 +18456,27 @@ static void checkifpathison(Context & context) { } static void afternewroom(Context & context) { - context._cmp(context.ds.byte(186), 0); + context._cmp(context.data.byte(186), 0); if (context.flags.z()) goto notnew; - context.ds.word(328) = 0; + context.data.word(328) = 0; createpanel(context); - context.ds.byte(100) = 0; + context.data.byte(100) = 0; findroominloc(context); - context._cmp(context.ds.byte(63), 1); + context._cmp(context.data.byte(63), 1); if (context.flags.z()) goto ryansoff; - context.al = context.ds.byte(151); + context.al = context.data.byte(151); context._add(context.al, 12); - context.ah = context.ds.byte(152); + context.ah = context.data.byte(152); context._add(context.ah, 12); findpathofpoint(context); - context.ds.byte(475) = context.dl; + context.data.byte(475) = context.dl; findxyfrompath(context); - context.ds.byte(187) = 1; + context.data.byte(187) = 1; ryansoff: - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); - context.ds.word(98) = 160; - context.ds.byte(186) = 0; + context.data.word(98) = 160; + context.data.byte(186) = 0; showicon(context); spriteupdate(context); printsprites(context); @@ -18494,50 +18494,50 @@ notnew: } static void atmospheres(Context & context) { - context.cl = context.ds.byte(148); - context.ch = context.ds.byte(149); + context.cl = context.data.byte(148); + context.ch = context.data.byte(149); context.bx = 5073; nextatmos: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto nomoreatmos; - context._cmp(context.al, context.ds.byte(184)); + context._cmp(context.al, context.data.byte(184)); if (!context.flags.z()) goto wrongatmos; context.ax = context.ds.word(context.bx+1); context._cmp(context.ax, context.cx); if (!context.flags.z()) goto wrongatmos; context.ax = context.ds.word(context.bx+3); - context._cmp(context.al, context.ds.byte(507)); + context._cmp(context.al, context.data.byte(507)); if (context.flags.z()) goto playingalready; - context._cmp(context.ds.byte(9), 45); + context._cmp(context.data.byte(9), 45); if (!context.flags.z()) goto notweb; - context._cmp(context.ds.word(23), 45); + context._cmp(context.data.word(23), 45); if (context.flags.z()) goto wrongatmos; notweb: playchannel0(context); - context._cmp(context.ds.byte(184), 2); - context._cmp(context.ds.byte(149), 0); + context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(149), 0); if (context.flags.z()) goto fullvol; if (!context.flags.z()) goto notlouisvol; - context._cmp(context.ds.byte(149), 10); + context._cmp(context.data.byte(149), 10); if (!context.flags.z()) goto notlouisvol; - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (!context.flags.z()) goto notlouisvol; - context.ds.byte(386) = 5; + context.data.byte(386) = 5; notlouisvol: playingalready: - context._cmp(context.ds.byte(184), 2); + context._cmp(context.data.byte(184), 2); if (!context.flags.z()) goto notlouisvol2; - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (context.flags.z()) goto louisvol; - context._cmp(context.ds.byte(148), 11); + context._cmp(context.data.byte(148), 11); if (!context.flags.z()) goto notlouisvol2; fullvol: - context.ds.byte(386) = 0; + context.data.byte(386) = 0; notlouisvol2: return; louisvol: - context.ds.byte(386) = 5; + context.data.byte(386) = 5; return; wrongatmos: context._add(context.bx, 5); @@ -18548,126 +18548,126 @@ nomoreatmos: } static void walkintoroom(Context & context) { - context._cmp(context.ds.byte(9), 14); + context._cmp(context.data.byte(9), 14); if (!context.flags.z()) goto notlair; - context._cmp(context.ds.byte(148), 22); + context._cmp(context.data.byte(148), 22); if (!context.flags.z()) goto notlair; - context.ds.byte(478) = 1; - context.ds.byte(477) = 1; + context.data.byte(478) = 1; + context.data.byte(477) = 1; autosetwalk(context); notlair: return; } static void afterintroroom(Context & context) { - context._cmp(context.ds.byte(186), 0); + context._cmp(context.data.byte(186), 0); if (context.flags.z()) goto notnewintro; clearwork(context); findroominloc(context); - context.ds.byte(62) = 1; + context.data.byte(62) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); printsprites(context); worktoscreen(context); - context.ds.byte(186) = 0; + context.data.byte(186) = 0; notnewintro: return; } static void obname(Context & context) { - context._cmp(context.ds.byte(473), 0); + context._cmp(context.data.byte(473), 0); if (context.flags.z()) goto notnewpath; - context.ds.byte(473) = 0; + context.data.byte(473) = 0; goto diff; notnewpath: - context._cmp(context.ah, context.ds.byte(100)); + context._cmp(context.ah, context.data.byte(100)); if (context.flags.z()) goto notdiffob; goto diff; notdiffob: - context._cmp(context.al, context.ds.byte(99)); + context._cmp(context.al, context.data.byte(99)); if (!context.flags.z()) goto diff; - context._cmp(context.ds.byte(306), 1); + context._cmp(context.data.byte(306), 1); if (context.flags.z()) goto walkandexamine; - context._cmp(context.ds.word(202), 0); + context._cmp(context.data.word(202), 0); if (context.flags.z()) goto noobselect; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (!context.flags.z()) goto isntblock; - context._cmp(context.ds.byte(153), 2); + context._cmp(context.data.byte(153), 2); if (context.flags.c()) goto noobselect; isntblock: - context.bl = context.ds.byte(475); - context._cmp(context.bl, context.ds.byte(474)); + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); if (!context.flags.z()) goto wantstowalk; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (context.flags.z()) goto wantstowalk; finishedwalking(context); if (!context.flags.z()) goto noobselect; - context._cmp(context.ds.byte(100), 5); + context._cmp(context.data.byte(100), 5); if (context.flags.z()) goto wantstotalk; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto noobselect; examineob(context); return; wantstotalk: - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto noobselect; talk(context); return; walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.ds.byte(307); - context.ds.byte(100) = context.al; - context.al = context.ds.byte(308); - context.ds.byte(99) = context.al; - context.ds.byte(306) = 0; - context._cmp(context.ds.byte(100), 5); + context.al = context.data.byte(307); + context.data.byte(100) = context.al; + context.al = context.data.byte(308); + context.data.byte(99) = context.al; + context.data.byte(306) = 0; + context._cmp(context.data.byte(100), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.ds.byte(473) = 1; + context.data.byte(473) = 1; noobselect: return; diff: - context.ds.byte(99) = context.al; - context.ds.byte(100) = context.ah; + context.data.byte(99) = context.al; + context.data.byte(100) = context.ah; diff2: - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.ds.byte(133); - context._cmp(context.al, context.ds.byte(135)); + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (!context.flags.z()) goto notblock; - context.bl = context.ds.byte(475); - context._cmp(context.bl, context.ds.byte(474)); + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); if (!context.flags.z()) goto dontcheck; - context.cl = context.ds.byte(151); + context.cl = context.data.byte(151); context._add(context.cl, 12); - context.ch = context.ds.byte(152); + context.ch = context.data.byte(152); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.ds.byte(153), 2); + context._cmp(context.data.byte(153), 2); if (context.flags.c()) goto isblock; - context._cmp(context.ds.byte(153), 128); + context._cmp(context.data.byte(153), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.ds.byte(475); - context._cmp(context.bl, context.ds.byte(474)); + context.bl = context.data.byte(475); + context._cmp(context.bl, context.data.byte(474)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (context.flags.z()) goto isblock; - context._cmp(context.ds.byte(100), 5); + context._cmp(context.data.byte(100), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -18686,17 +18686,17 @@ toofaraway: } static void finishedwalking(Context & context) { - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto iswalking; - context.al = context.ds.byte(133); - context._cmp(context.al, context.ds.byte(135)); + context.al = context.data.byte(133); + context._cmp(context.al, context.data.byte(135)); iswalking: return; } static void examineobtext(Context & context) { - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(100); + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); context.al = 1; commandwithob(context); return; @@ -18725,13 +18725,13 @@ static void commandwithob(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(452); + context.es = context.data.word(452); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.ds.word(79); - context.bx = context.ds.word(81); - context.dl = context.ds.byte(82); + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); context.al = 0; context.ah = 0; printdirect(context); @@ -18739,19 +18739,19 @@ static void commandwithob(Context & context) { context.di = 5674; copyname(context); context.ax = context.pop(); - context.di = context.ds.word(84); + context.di = context.data.word(84); context._cmp(context.al, 0); if (context.flags.z()) goto noadd; context._add(context.di, 5); noadd: - context.bx = context.ds.word(81); + context.bx = context.data.word(81); context.es = context.cs; context.si = 5674; - context.dl = context.ds.byte(82); + context.dl = context.data.byte(82); context.al = 0; context.ah = 0; printdirect(context); - context.ds.byte(109) = 1; + context.data.byte(109) = 1; return; } @@ -18776,17 +18776,17 @@ static void commandonly(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(452); + context.es = context.data.word(452); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.ds.word(79); - context.bx = context.ds.word(81); - context.dl = context.ds.byte(82); + context.di = context.data.word(79); + context.bx = context.data.word(81); + context.dl = context.data.byte(82); context.al = 0; context.ah = 0; printdirect(context); - context.ds.byte(109) = 1; + context.data.byte(109) = 1; return; } @@ -18797,7 +18797,7 @@ static void printmessage(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(452); + context.es = context.data.word(452); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18818,7 +18818,7 @@ static void printmessage2(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.ds.word(452); + context.es = context.data.word(452); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18839,63 +18839,63 @@ searchmess: } static void blocknametext(Context & context) { - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(100); + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); context.al = 0; commandwithob(context); return; } static void personnametext(Context & context) { - context.bl = context.ds.byte(99); + context.bl = context.data.byte(99); context._and(context.bl, 127); - context.bh = context.ds.byte(100); + context.bh = context.data.byte(100); context.al = 2; commandwithob(context); return; } static void walktotext(Context & context) { - context.bl = context.ds.byte(99); - context.bh = context.ds.byte(100); + context.bl = context.data.byte(99); + context.bh = context.data.byte(100); context.al = 3; commandwithob(context); return; } static void getflagunderp(Context & context) { - context.cx = context.ds.word(198); - context._sub(context.cx, context.ds.word(117)); - context.ax = context.ds.word(200); - context._sub(context.ax, context.ds.word(119)); + context.cx = context.data.word(198); + context._sub(context.cx, context.data.word(117)); + context.ax = context.data.word(200); + context._sub(context.ax, context.data.word(119)); context.ch = context.al; checkone(context); - context.ds.byte(153) = context.cl; - context.ds.byte(154) = context.ch; + context.data.byte(153) = context.cl; + context.data.byte(154) = context.ch; return; } static void setwalk(Context & context) { - context._cmp(context.ds.byte(492), 254); + context._cmp(context.data.byte(492), 254); if (!context.flags.z()) goto alreadywalking; - context.al = context.ds.byte(474); - context._cmp(context.al, context.ds.byte(475)); + context.al = context.data.byte(474); + context._cmp(context.al, context.data.byte(475)); if (context.flags.z()) goto cantwalk2; - context._cmp(context.ds.byte(32), 1); + context._cmp(context.data.byte(32), 1); if (context.flags.z()) goto holdingreel; - context._cmp(context.ds.byte(32), 2); + context._cmp(context.data.byte(32), 2); if (context.flags.z()) goto cantwalk; - context.ds.byte(478) = context.al; - context.ds.byte(477) = context.al; - context._cmp(context.ds.word(202), 2); + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; + context._cmp(context.data.word(202), 2); if (!context.flags.z()) goto notwalkandexam; - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (context.flags.z()) goto notwalkandexam; - context.ds.byte(306) = 1; - context.al = context.ds.byte(100); - context.ds.byte(307) = context.al; - context.al = context.ds.byte(99); - context.ds.byte(308) = context.al; + context.data.byte(306) = 1; + context.al = context.data.byte(100); + context.data.byte(307) = context.al; + context.al = context.data.byte(99); + context.data.byte(308) = context.al; notwalkandexam: autosetwalk(context); cantwalk: @@ -18904,25 +18904,25 @@ cantwalk2: facerightway(context); return; alreadywalking: - context.al = context.ds.byte(474); - context.ds.byte(477) = context.al; + context.al = context.data.byte(474); + context.data.byte(477) = context.al; return; holdingreel: - context.ds.byte(33) = context.al; - context.ds.byte(32) = 2; + context.data.byte(33) = context.al; + context.data.byte(32) = 2; return; } static void autosetwalk(Context & context) { - context.al = context.ds.byte(475); - context._cmp(context.ds.byte(477), context.al); + context.al = context.data.byte(475); + context._cmp(context.data.byte(477), context.al); if (!context.flags.z()) goto notsamealready; return; notsamealready: getroomspaths(context); checkdest(context); context.push(context.bx); - context.al = context.ds.byte(475); + context.al = context.data.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18931,13 +18931,13 @@ notsamealready: context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.ds.word(480) = context.ax; + context.data.word(480) = context.ax; context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.ds.word(482) = context.ax; + context.data.word(482) = context.ax; context.bx = context.pop(); - context.al = context.ds.byte(478); + context.al = context.data.byte(478); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18946,33 +18946,33 @@ notsamealready: context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.ds.word(484) = context.ax; + context.data.word(484) = context.ax; context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.ds.word(486) = context.ax; + context.data.word(486) = context.ax; bresenhams(context); - context._cmp(context.ds.byte(493), 0); + context._cmp(context.data.byte(493), 0); if (context.flags.z()) goto normalline; - context.al = context.ds.byte(494); + context.al = context.data.byte(494); context._sub(context.al, 1); - context.ds.byte(492) = context.al; - context.ds.byte(493) = 1; + context.data.byte(492) = context.al; + context.data.byte(493) = 1; return; normalline: - context.ds.byte(492) = 0; + context.data.byte(492) = 0; return; } static void checkdest(Context & context) { context.push(context.bx); context._add(context.bx, 12*8); - context.ah = context.ds.byte(475); + context.ah = context.data.byte(475); context.cl = 4; context._shl(context.ah, context.cl); - context.al = context.ds.byte(478); + context.al = context.data.byte(478); context.cl = 24; - context.ch = context.ds.byte(478); + context.ch = context.data.byte(478); checkdestloop: context.dh = context.ds.byte(context.bx); context._and(context.dh, 0xf0); @@ -18982,7 +18982,7 @@ checkdestloop: if (!context.flags.z()) goto nextcheck; context.al = context.ds.byte(context.bx+1); context._and(context.al, 15); - context.ds.byte(478) = context.al; + context.data.byte(478) = context.al; context.bx = context.pop(); return; nextcheck: @@ -19006,7 +19006,7 @@ nextcheck2: context._add(context.bx, 2); context._sub(context.cl, 1); if (!context.flags.z()) goto checkdestloop; - context.ds.byte(478) = context.ch; + context.data.byte(478) = context.ch; context.bx = context.pop(); return; } @@ -19017,60 +19017,60 @@ static void bresenhams(Context & context) { context.es = context.dx; context.di = 8344; context.si = 1; - context.ds.byte(493) = 0; - context.cx = context.ds.word(484); - context._sub(context.cx, context.ds.word(480)); + context.data.byte(493) = 0; + context.cx = context.data.word(484); + context._sub(context.cx, context.data.word(480)); if (context.flags.z()) goto vertline; if (!context.flags.s()) goto line1; context._neg(context.cx); - context.bx = context.ds.word(484); - context._xchg(context.bx, context.ds.word(480)); - context.ds.word(484) = context.bx; - context.bx = context.ds.word(486); - context._xchg(context.bx, context.ds.word(482)); - context.ds.word(486) = context.bx; - context.ds.byte(493) = 1; + context.bx = context.data.word(484); + context._xchg(context.bx, context.data.word(480)); + context.data.word(484) = context.bx; + context.bx = context.data.word(486); + context._xchg(context.bx, context.data.word(482)); + context.data.word(486) = context.bx; + context.data.byte(493) = 1; line1: - context.bx = context.ds.word(486); - context._sub(context.bx, context.ds.word(482)); + context.bx = context.data.word(486); + context._sub(context.bx, context.data.word(482)); if (context.flags.z()) goto horizline; if (!context.flags.s()) goto line3; context._neg(context.bx); context._neg(context.si); line3: context.push(context.si); - context.ds.byte(491) = 0; + context.data.byte(491) = 0; context._cmp(context.bx, context.cx); if (context.flags.le()) goto line4; - context.ds.byte(491) = 1; + context.data.byte(491) = 1; context._xchg(context.bx, context.cx); line4: context._shl(context.bx, 1); - context.ds.word(488) = context.bx; + context.data.word(488) = context.bx; context._sub(context.bx, context.cx); context.si = context.bx; context._sub(context.bx, context.cx); - context.ds.word(490) = context.bx; - context.ax = context.ds.word(480); - context.bx = context.ds.word(482); + context.data.word(490) = context.bx; + context.ax = context.data.word(480); + context.bx = context.data.word(482); context.ah = context.bl; context._add(context.cx, 1); context.bx = context.pop(); - context._cmp(context.ds.byte(491), 1); + context._cmp(context.data.byte(491), 1); if (context.flags.z()) goto hislope; goto loslope; vertline: - context.ax = context.ds.word(482); - context.bx = context.ds.word(486); + context.ax = context.data.word(482); + context.bx = context.data.word(486); context.cx = context.bx; context._sub(context.cx, context.ax); if (!context.flags.ge()) goto line31; context._neg(context.cx); context.ax = context.bx; - context.ds.byte(493) = 1; + context.data.byte(493) = 1; line31: context._add(context.cx, 1); - context.bx = context.ds.word(480); + context.bx = context.data.word(480); context._xchg(context.ax, context.bx); context.ah = context.bl; context.bx = context.si; @@ -19080,8 +19080,8 @@ line32: if (--context.cx) goto line32; goto lineexit; horizline: - context.ax = context.ds.word(480); - context.bx = context.ds.word(482); + context.ax = context.data.word(480); + context.bx = context.data.word(482); context.ah = context.bl; context._add(context.cx, 1); horizloop: @@ -19095,11 +19095,11 @@ loloop: context._add(context.al, 1); context._or(context.si, context.si); if (!context.flags.s()) goto line12; - context._add(context.si, context.ds.word(488)); + context._add(context.si, context.data.word(488)); if (--context.cx) goto loloop; goto lineexit; line12: - context._add(context.si, context.ds.word(490)); + context._add(context.si, context.data.word(490)); context._add(context.ah, context.bl); if (--context.cx) goto loloop; goto lineexit; @@ -19109,33 +19109,33 @@ hiloop: context._add(context.ah, context.bl); context._or(context.si, context.si); if (!context.flags.s()) goto line23; - context._add(context.si, context.ds.word(488)); + context._add(context.si, context.data.word(488)); if (--context.cx) goto hiloop; goto lineexit; line23: - context._add(context.si, context.ds.word(490)); + context._add(context.si, context.data.word(490)); context._add(context.al, 1); if (--context.cx) goto hiloop; lineexit: context._sub(context.di, 8344); context.ax = context.di; context._shr(context.ax, 1); - context.ds.byte(494) = context.al; + context.data.byte(494) = context.al; return; } static void workoutframes(Context & context) { - context.bx = context.ds.word(480); + context.bx = context.data.word(480); context._add(context.bx, 32); - context.ax = context.ds.word(484); + context.ax = context.data.word(484); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (!context.flags.c()) goto notneg1; context._neg(context.bx); notneg1: - context.cx = context.ds.word(482); + context.cx = context.data.word(482); context._add(context.cx, 32); - context.ax = context.ds.word(486); + context.ax = context.data.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto notneg2; @@ -19159,16 +19159,16 @@ tendstohoriz: context.dl = 1; goto gotquad; gotquad: - context.bx = context.ds.word(480); + context.bx = context.data.word(480); context._add(context.bx, 32); - context.ax = context.ds.word(484); + context.ax = context.data.word(484); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (context.flags.c()) goto isinright; isinleft: - context.cx = context.ds.word(482); + context.cx = context.data.word(482); context._add(context.cx, 32); - context.ax = context.ds.word(486); + context.ax = context.data.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto topleft; @@ -19182,9 +19182,9 @@ topleft: context._add(context.dl, 6); goto success; isinright: - context.cx = context.ds.word(482); + context.cx = context.data.word(482); context._add(context.cx, 32); - context.ax = context.ds.word(486); + context.ax = context.data.word(486); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto botright; @@ -19197,17 +19197,17 @@ botright: noswap2: success: context._and(context.dl, 7); - context.ds.byte(135) = context.dl; - context.ds.byte(136) = 0; + context.data.byte(135) = context.dl; + context.data.byte(136) = 0; return; } static void getroomspaths(Context & context) { - context.al = context.ds.byte(185); + context.al = context.data.byte(185); context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.bx = 0; context._add(context.bx, context.ax); return; @@ -19252,7 +19252,7 @@ static void findobname(Context & context) { context.bx = 64*2; context._mul(context.bx); context.si = context.ax; - context.ds = context.ds.word(448); + context.ds = context.data.word(448); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -19263,7 +19263,7 @@ static void findobname(Context & context) { notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; - context.ds = context.ds.word(398); + context.ds = context.data.word(398); context._add(context.bx, 0+2080+30000+(16*114)); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); @@ -19272,7 +19272,7 @@ notpersonname: notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; - context.ds = context.ds.word(438); + context.ds = context.data.word(438); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(82*2)); @@ -19281,14 +19281,14 @@ notextraname: notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; - context.ds = context.ds.word(440); + context.ds = context.data.word(440); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); context.si = context.ax; return; notsetname: - context.ds = context.ds.word(442); + context.ds = context.data.word(442); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(98*2)); @@ -19297,7 +19297,7 @@ notsetname: } static void showicon(Context & context) { - context._cmp(context.ds.byte(184), 50); + context._cmp(context.data.byte(184), 50); if (!context.flags.c()) goto isdream1; showpanel(context); showman(context); @@ -19306,37 +19306,37 @@ static void showicon(Context & context) { zoomicon(context); return; isdream1: - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 72; context.bx = 2; context.al = 45; context.ah = 0; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 72+47; context.bx = 2; context.al = 46; context.ah = 0; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 69-10; context.bx = 21; context.al = 49; context.ah = 0; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 160+88; context.bx = 2; context.al = 45; context.ah = 4; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 160+43; context.bx = 2; context.al = 46; context.ah = 4; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 160+101; context.bx = 21; context.al = 49; @@ -19347,25 +19347,25 @@ isdream1: } static void middlepanel(Context & context) { - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 72+47+20; context.bx = 0; context.al = 48; context.ah = 0; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 72+19; context.bx = 21; context.al = 47; context.ah = 0; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 160+23; context.bx = 0; context.al = 48; context.ah = 4; showframe(context); - context.ds = context.ds.word(464); + context.ds = context.data.word(464); context.di = 160+71; context.bx = 21; context.al = 47; @@ -19375,21 +19375,21 @@ static void middlepanel(Context & context) { } static void showman(Context & context) { - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 0; context.bx = 114; context.al = 1; context.ah = 0; showframe(context); - context._cmp(context.ds.byte(4), 0); + context._cmp(context.data.byte(4), 0); if (context.flags.z()) goto notverycool; - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 28; context.bx = 25; context.al = 2; @@ -19400,13 +19400,13 @@ notverycool: } static void showpanel(Context & context) { - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 72; context.bx = 0; context.al = 19; context.ah = 0; showframe(context); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 192; context.bx = 0; context.al = 19; @@ -19421,48 +19421,48 @@ static void roomname(Context & context) { context.al = 53; context.dl = 240; printmessage(context); - context.bl = context.ds.byte(185); + context.bl = context.data.byte(185); context._cmp(context.bl, 32); if (context.flags.c()) goto notover32; context._sub(context.bl, 32); notover32: context.bh = 0; context._add(context.bx, context.bx); - context.es = context.ds.word(436); + context.es = context.data.word(436); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(38*2)); context.si = context.ax; - context.ds.word(77) = 7; + context.data.word(77) = 7; context.di = 88; context.bx = 25; context.dl = 120; - context._cmp(context.ds.byte(3), 1); + context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto gotpl; context.dl = 160; gotpl: context.al = 0; context.ah = 0; printdirect(context); - context.ds.word(77) = 10; + context.data.word(77) = 10; usecharset1(context); return; } static void usecharset1(Context & context) { - context.ax = context.ds.word(404); - context.ds.word(268) = context.ax; + context.ax = context.data.word(404); + context.data.word(268) = context.ax; return; } static void usetempcharset(Context & context) { - context.ax = context.ds.word(406); - context.ds.word(268) = context.ax; + context.ax = context.data.word(406); + context.data.word(268) = context.ax; return; } static void showexit(Context & context) { - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 274; context.bx = 154; context.al = 11; @@ -19473,12 +19473,12 @@ static void showexit(Context & context) { static void panelicons1(Context & context) { context.di = 0; - context._cmp(context.ds.byte(3), 1); + context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto watchison; context.di = 48; watchison: context.push(context.di); - context.ds = context.ds.word(410); + context.ds = context.data.word(410); context._add(context.di, 204); context.bx = 4; context.al = 2; @@ -19486,9 +19486,9 @@ watchison: showframe(context); context.di = context.pop(); context.push(context.di); - context._cmp(context.ds.byte(8), 1); + context._cmp(context.data.byte(8), 1); if (context.flags.z()) goto zoomisoff; - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context._add(context.di, 228); context.bx = 8; context.al = 5; @@ -19501,9 +19501,9 @@ zoomisoff: } static void showwatch(Context & context) { - context._cmp(context.ds.byte(3), 0); + context._cmp(context.data.byte(3), 0); if (context.flags.z()) goto nowristwatch; - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 250; context.bx = 1; context.al = 6; @@ -19515,9 +19515,9 @@ nowristwatch: } static void zoomicon(Context & context) { - context._cmp(context.ds.byte(8), 0); + context._cmp(context.data.byte(8), 0); if (context.flags.z()) goto nozoom1; - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 8; context.bx = 132-1; context.al = 8; @@ -19528,20 +19528,20 @@ nozoom1: } static void showblink(Context & context) { - context._cmp(context.ds.byte(131), 1); + context._cmp(context.data.byte(131), 1); if (context.flags.z()) goto finblink1; - context._add(context.ds.byte(472), 1); - context._cmp(context.ds.byte(4), 0); + context._add(context.data.byte(472), 1); + context._cmp(context.data.byte(4), 0); if (!context.flags.z()) goto finblink1; - context._cmp(context.ds.byte(184), 50); + context._cmp(context.data.byte(184), 50); if (!context.flags.c()) goto eyesshut; - context.al = context.ds.byte(472); + context.al = context.data.byte(472); context._cmp(context.al, 3); if (!context.flags.z()) goto finblink1; - context.ds.byte(472) = 0; - context.al = context.ds.byte(471); + context.data.byte(472) = 0; + context.al = context.data.byte(471); context._add(context.al, 1); - context.ds.byte(471) = context.al; + context.data.byte(471) = context.al; context._cmp(context.al, 6); if (context.flags.c()) goto nomorethan6; context.al = 6; @@ -19550,7 +19550,7 @@ nomorethan6: context.bx = 5691; context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.di = 44; context.bx = 32; context.ah = 0; @@ -19562,11 +19562,11 @@ eyesshut: } static void dumpblink(Context & context) { - context._cmp(context.ds.byte(4), 0); + context._cmp(context.data.byte(4), 0); if (!context.flags.z()) goto nodumpeye; - context._cmp(context.ds.byte(472), 0); + context._cmp(context.data.byte(472), 0); if (!context.flags.z()) goto nodumpeye; - context.al = context.ds.byte(471); + context.al = context.data.byte(471); context._cmp(context.al, 6); if (!context.flags.c()) goto nodumpeye; context.push(context.ds); @@ -19591,9 +19591,9 @@ static void worktoscreenm(Context & context) { } static void blank(Context & context) { - context._cmp(context.ds.byte(100), 199); + context._cmp(context.data.byte(100), 199); if (context.flags.z()) goto alreadyblnk; - context.ds.byte(100) = 199; + context.data.byte(100) = 199; context.al = 0; commandonly(context); alreadyblnk: @@ -19612,14 +19612,14 @@ static void hangonp(Context & context) { context._add(context.cx, context.cx); context.ax = context.pop(); context._add(context.cx, context.ax); - context.ds.word(138) = 0; - context.al = context.ds.byte(231); - context.ah = context.ds.byte(106); + context.data.word(138) = 0; + context.al = context.data.byte(231); + context.ah = context.data.byte(106); context.push(context.ax); - context.ds.byte(234) = 3; - context.ds.byte(106) = 0; + context.data.byte(234) = 3; + context.data.byte(106) = 0; context.push(context.cx); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; readmouse(context); animpointer(context); showpointer(context); @@ -19635,19 +19635,19 @@ hangloop: vsync(context); dumppointer(context); context.cx = context.pop(); - context.ax = context.ds.word(202); + context.ax = context.data.word(202); context._cmp(context.ax, 0); if (context.flags.z()) goto notpressed; - context._cmp(context.ax, context.ds.word(212)); + context._cmp(context.ax, context.data.word(212)); if (!context.flags.z()) goto getoutofit; notpressed: if (--context.cx) goto hangloop; getoutofit: delpointer(context); context.ax = context.pop(); - context.ds.byte(231) = context.al; - context.ds.byte(106) = context.ah; - context.ds.byte(234) = 0; + context.data.byte(231) = context.al; + context.data.byte(106) = context.ah; + context.data.byte(234) = 0; return; } @@ -19679,7 +19679,7 @@ monloop1: static void getunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19688,7 +19688,7 @@ static void getunderzoom(Context & context) { } static void dumpzoom(Context & context) { - context._cmp(context.ds.byte(8), 1); + context._cmp(context.data.byte(8), 1); if (!context.flags.z()) goto notzoomon; context.di = 8+5; context.bx = 132+4; @@ -19702,7 +19702,7 @@ notzoomon: static void putunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19711,12 +19711,12 @@ static void putunderzoom(Context & context) { } static void crosshair(Context & context) { - context._cmp(context.ds.byte(100), 3); + context._cmp(context.data.byte(100), 3); if (context.flags.z()) goto nocross; - context._cmp(context.ds.byte(100), 10); + context._cmp(context.data.byte(100), 10); if (!context.flags.c()) goto nocross; - context.es = context.ds.word(400); - context.ds = context.ds.word(408); + context.es = context.data.word(400); + context.ds = context.data.word(408); context.di = 8+24; context.bx = 132+19; context.al = 9; @@ -19724,8 +19724,8 @@ static void crosshair(Context & context) { showframe(context); return; nocross: - context.es = context.ds.word(400); - context.ds = context.ds.word(408); + context.es = context.data.word(400); + context.ds = context.data.word(408); context.di = 8+24; context.bx = 132+19; context.al = 29; @@ -19736,16 +19736,16 @@ nocross: static void showpointer(Context & context) { showblink(context); - context.di = context.ds.word(198); - context.ds.word(220) = context.di; - context.bx = context.ds.word(200); - context.ds.word(222) = context.bx; - context._cmp(context.ds.byte(106), 1); + context.di = context.data.word(198); + context.data.word(220) = context.di; + context.bx = context.data.word(200); + context.data.word(222) = context.bx; + context._cmp(context.data.byte(106), 1); if (context.flags.z()) goto itsanobject; context.push(context.bx); context.push(context.di); - context.ds = context.ds.word(408); - context.al = context.ds.byte(231); + context.ds = context.data.word(408); + context.al = context.data.byte(231); context._add(context.al, 20); context.ah = 0; context._add(context.ax, context.ax); @@ -19761,10 +19761,10 @@ notsmallx: if (!context.flags.c()) goto notsmally; context.ch = 12; notsmally: - context.ds.byte(227) = context.cl; - context.ds.byte(228) = context.ch; + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; context.push(context.ds); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19772,7 +19772,7 @@ notsmally: context.bx = context.pop(); context.push(context.di); context.push(context.bx); - context.al = context.ds.byte(231); + context.al = context.data.byte(231); context._add(context.al, 20); context.ah = 0; showframe(context); @@ -19780,11 +19780,11 @@ notsmally: context.di = context.pop(); return; itsanobject: - context.al = context.ds.byte(89); - context.ds = context.ds.word(398); - context._cmp(context.ds.byte(102), 4); + context.al = context.data.byte(89); + context.ds = context.data.word(398); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto itsfrominv; - context.ds = context.ds.word(446); + context.ds = context.data.word(446); itsfrominv: context.cl = context.al; context._add(context.al, context.al); @@ -19806,8 +19806,8 @@ notsmallx2: if (!context.flags.c()) goto notsmally2; context.ch = 12; notsmally2: - context.ds.byte(227) = context.cl; - context.ds.byte(228) = context.ch; + context.data.byte(227) = context.cl; + context.data.byte(228) = context.ch; context.ax = context.pop(); context.push(context.di); context.push(context.bx); @@ -19818,13 +19818,13 @@ notsmally2: context.al = context.cl; context.ah = 0; context._shr(context.ax, 1); - context._sub(context.ds.word(220), context.ax); + context._sub(context.data.word(220), context.ax); context._sub(context.di, context.ax); context.al = context.ch; context._shr(context.ax, 1); - context._sub(context.ds.word(222), context.ax); + context._sub(context.data.word(222), context.ax); context._sub(context.bx, context.ax); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19835,7 +19835,7 @@ notsmally2: showframe(context); context.bx = context.pop(); context.di = context.pop(); - context.ds = context.ds.word(408); + context.ds = context.data.word(408); context.al = 3; context.ah = 128; showframe(context); @@ -19843,20 +19843,20 @@ notsmally2: } static void delpointer(Context & context) { - context.ax = context.ds.word(220); + context.ax = context.data.word(220); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; - context.ds.word(224) = context.ax; - context.ax = context.ds.word(222); - context.ds.word(226) = context.ax; - context.cl = context.ds.byte(227); - context.ds.byte(229) = context.cl; - context.ch = context.ds.byte(228); - context.ds.byte(230) = context.ch; - context.ds = context.ds.word(412); + context.data.word(224) = context.ax; + context.ax = context.data.word(222); + context.data.word(226) = context.ax; + context.cl = context.data.byte(227); + context.data.byte(229) = context.cl; + context.ch = context.data.byte(228); + context.data.byte(230) = context.ch; + context.ds = context.data.word(412); context.si = 0+(228*13)+32+60; - context.di = context.ds.word(224); - context.bx = context.ds.word(226); + context.di = context.data.word(224); + context.bx = context.data.word(226); multiput(context); nevershown: return; @@ -19864,30 +19864,30 @@ nevershown: static void dumppointer(Context & context) { dumpblink(context); - context.cl = context.ds.byte(229); - context.ch = context.ds.byte(230); - context.di = context.ds.word(224); - context.bx = context.ds.word(226); + context.cl = context.data.byte(229); + context.ch = context.data.byte(230); + context.di = context.data.word(224); + context.bx = context.data.word(226); multidump(context); - context.bx = context.ds.word(222); - context.di = context.ds.word(220); - context._cmp(context.di, context.ds.word(224)); + context.bx = context.data.word(222); + context.di = context.data.word(220); + context._cmp(context.di, context.data.word(224)); if (!context.flags.z()) goto difffound; - context._cmp(context.bx, context.ds.word(226)); + context._cmp(context.bx, context.data.word(226)); if (context.flags.z()) goto notboth; difffound: - context.cl = context.ds.byte(227); - context.ch = context.ds.byte(228); + context.cl = context.data.byte(227); + context.ch = context.data.byte(228); multidump(context); notboth: return; } static void undertextline(Context & context) { - context.di = context.ds.word(79); - context.bx = context.ds.word(81); + context.di = context.data.word(79); + context.bx = context.data.word(81); context._sub(context.bx, 3); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0; context.cl = 228; context.ch = 13; @@ -19896,10 +19896,10 @@ static void undertextline(Context & context) { } static void deltextline(Context & context) { - context.di = context.ds.word(79); - context.bx = context.ds.word(81); + context.di = context.data.word(79); + context.bx = context.data.word(81); context._sub(context.bx, 3); - context.ds = context.ds.word(412); + context.ds = context.data.word(412); context.si = 0; context.cl = 228; context.ch = 13; @@ -19908,11 +19908,11 @@ static void deltextline(Context & context) { } static void dumptextline(Context & context) { - context._cmp(context.ds.byte(109), 1); + context._cmp(context.data.byte(109), 1); if (!context.flags.z()) goto nodumptextline; - context.ds.byte(109) = 0; - context.di = context.ds.word(79); - context.bx = context.ds.word(81); + context.data.byte(109) = 0; + context.di = context.data.word(79); + context.bx = context.data.word(81); context._sub(context.bx, 3); context.cl = 228; context.ch = 13; @@ -19922,19 +19922,19 @@ nodumptextline: } static void animpointer(Context & context) { - context._cmp(context.ds.byte(234), 2); + context._cmp(context.data.byte(234), 2); if (context.flags.z()) goto combathand; - context._cmp(context.ds.byte(234), 3); + context._cmp(context.data.byte(234), 3); if (context.flags.z()) goto mousehand; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (context.flags.z()) goto notwatchpoint; - context.ds.byte(231) = 11; + context.data.byte(231) = 11; return; notwatchpoint: - context.ds.byte(231) = 0; - context._cmp(context.ds.byte(237), 0); + context.data.byte(231) = 0; + context._cmp(context.data.byte(237), 0); if (context.flags.z()) goto gothand; - context._cmp(context.ds.byte(476), 0); + context._cmp(context.data.byte(476), 0); if (context.flags.z()) goto gothand; arrow: getflagunderp(context); @@ -19942,133 +19942,133 @@ arrow: if (context.flags.c()) goto gothand; context._cmp(context.cl, 128); if (!context.flags.c()) goto gothand; - context.ds.byte(231) = 3; + context.data.byte(231) = 3; context._test(context.cl, 4); if (!context.flags.z()) goto gothand; - context.ds.byte(231) = 4; + context.data.byte(231) = 4; context._test(context.cl, 16); if (!context.flags.z()) goto gothand; - context.ds.byte(231) = 5; + context.data.byte(231) = 5; context._test(context.cl, 2); if (!context.flags.z()) goto gothand; - context.ds.byte(231) = 6; + context.data.byte(231) = 6; context._test(context.cl, 8); if (!context.flags.z()) goto gothand; - context.ds.byte(231) = 8; + context.data.byte(231) = 8; gothand: return; mousehand: - context._cmp(context.ds.byte(235), 0); + context._cmp(context.data.byte(235), 0); if (context.flags.z()) goto rightspeed3; - context._sub(context.ds.byte(235), 1); + context._sub(context.data.byte(235), 1); goto finflashmouse; rightspeed3: - context.ds.byte(235) = 5; - context._add(context.ds.byte(236), 1); - context._cmp(context.ds.byte(236), 16); + context.data.byte(235) = 5; + context._add(context.data.byte(236), 1); + context._cmp(context.data.byte(236), 16); if (!context.flags.z()) goto finflashmouse; - context.ds.byte(236) = 0; + context.data.byte(236) = 0; finflashmouse: - context.al = context.ds.byte(236); + context.al = context.data.byte(236); context.ah = 0; context.bx = 5698; context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); - context.ds.byte(231) = context.al; + context.data.byte(231) = context.al; return; combathand: - context.ds.byte(231) = 0; - context._cmp(context.ds.byte(184), 14); + context.data.byte(231) = 0; + context._cmp(context.data.byte(184), 14); if (!context.flags.z()) goto notarrow; - context._cmp(context.ds.byte(100), 211); + context._cmp(context.data.byte(100), 211); if (!context.flags.z()) goto notarrow; - context.ds.byte(231) = 5; + context.data.byte(231) = 5; notarrow: return; } static void readmouse(Context & context) { - context.ax = context.ds.word(202); - context.ds.word(212) = context.ax; - context.ax = context.ds.word(198); - context.ds.word(214) = context.ax; - context.ax = context.ds.word(200); - context.ds.word(216) = context.ax; + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; mousecall(context); - context.ds.word(198) = context.cx; - context.ds.word(200) = context.dx; - context.ds.word(202) = context.bx; + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(202) = context.bx; return; } static void readmouse1(Context & context) { - context.ax = context.ds.word(198); - context.ds.word(214) = context.ax; - context.ax = context.ds.word(200); - context.ds.word(216) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; mousecall(context); - context.ds.word(198) = context.cx; - context.ds.word(200) = context.dx; - context.ds.word(204) = context.bx; + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(204) = context.bx; return; } static void readmouse2(Context & context) { - context.ax = context.ds.word(198); - context.ds.word(214) = context.ax; - context.ax = context.ds.word(200); - context.ds.word(216) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; mousecall(context); - context.ds.word(198) = context.cx; - context.ds.word(200) = context.dx; - context.ds.word(206) = context.bx; + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(206) = context.bx; return; } static void readmouse3(Context & context) { - context.ax = context.ds.word(198); - context.ds.word(214) = context.ax; - context.ax = context.ds.word(200); - context.ds.word(216) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; mousecall(context); - context.ds.word(198) = context.cx; - context.ds.word(200) = context.dx; - context.ds.word(208) = context.bx; + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.data.word(208) = context.bx; return; } static void readmouse4(Context & context) { - context.ax = context.ds.word(202); - context.ds.word(212) = context.ax; - context.ax = context.ds.word(198); - context.ds.word(214) = context.ax; - context.ax = context.ds.word(200); - context.ds.word(216) = context.ax; + context.ax = context.data.word(202); + context.data.word(212) = context.ax; + context.ax = context.data.word(198); + context.data.word(214) = context.ax; + context.ax = context.data.word(200); + context.data.word(216) = context.ax; mousecall(context); - context.ds.word(198) = context.cx; - context.ds.word(200) = context.dx; - context.ax = context.ds.word(204); - context._or(context.ax, context.ds.word(206)); - context._or(context.ax, context.ds.word(208)); + context.data.word(198) = context.cx; + context.data.word(200) = context.dx; + context.ax = context.data.word(204); + context._or(context.ax, context.data.word(206)); + context._or(context.ax, context.data.word(208)); context._or(context.bx, context.ax); - context.ds.word(202) = context.bx; + context.data.word(202) = context.bx; return; } static void readkey(Context & context) { - context.bx = context.ds.word(396); - context._cmp(context.bx, context.ds.word(394)); + context.bx = context.data.word(396); + context._cmp(context.bx, context.data.word(394)); if (context.flags.z()) goto nokey; context._add(context.bx, 1); context._and(context.bx, 15); - context.ds.word(396) = context.bx; + context.data.word(396) = context.bx; context.di = 5715; context._add(context.di, context.bx); context.al = context.ds.byte(context.di); - context.ds.byte(142) = context.al; + context.data.byte(142) = context.al; return; nokey: - context.ds.byte(142) = 0; + context.data.byte(142) = 0; return; } @@ -20124,34 +20124,34 @@ hangonloop: static void loadtraveltext(Context & context) { context.dx = 2247; standardload(context); - context.ds.word(456) = context.ax; + context.data.word(456) = context.ax; return; } static void loadintotemp(Context & context) { context.ds = context.cs; standardload(context); - context.ds.word(458) = context.ax; + context.data.word(458) = context.ax; return; } static void loadintotemp2(Context & context) { context.ds = context.cs; standardload(context); - context.ds.word(460) = context.ax; + context.data.word(460) = context.ax; return; } static void loadintotemp3(Context & context) { context.ds = context.cs; standardload(context); - context.ds.word(462) = context.ax; + context.data.word(462) = context.ax; return; } static void loadtempcharset(Context & context) { standardload(context); - context.ds.word(406) = context.ax; + context.data.word(406) = context.ax; return; } @@ -20175,21 +20175,21 @@ static void standardload(Context & context) { static void loadtemptext(Context & context) { standardload(context); - context.ds.word(466) = context.ax; + context.data.word(466) = context.ax; return; } static void loadroom(Context & context) { - context.ds.byte(74) = 1; - context.ds.word(328) = 0; - context.ds.word(138) = 0; - context.ds.word(121) = 104; - context.ds.word(123) = 38; - context.ds.word(79) = 13; - context.ds.word(81) = 182; - context.ds.byte(82) = 240; - context.al = context.ds.byte(188); - context.ds.byte(9) = context.al; + context.data.byte(74) = 1; + context.data.word(328) = 0; + context.data.word(138) = 0; + context.data.word(121) = 104; + context.data.word(123) = 38; + context.data.word(79) = 13; + context.data.word(81) = 182; + context.data.byte(82) = 240; + context.al = context.data.byte(188); + context.data.byte(9) = context.al; getroomdata(context); startloading(context); loadroomssample(context); @@ -20200,13 +20200,13 @@ static void loadroom(Context & context) { } static void loadroomssample(Context & context) { - context.al = context.ds.byte(531); + context.al = context.data.byte(531); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; - context._cmp(context.al, context.ds.byte(530)); + context._cmp(context.al, context.data.byte(530)); if (context.flags.z()) goto loadedalready; - context.ds.byte(530) = context.al; - context.al = context.ds.byte(530); + context.data.byte(530) = context.al; + context.al = context.data.byte(530); context.cl = '0'; twodigitnum(context); context.di = 1909; @@ -20219,50 +20219,50 @@ loadedalready: } static void getridofreels(Context & context) { - context._cmp(context.ds.byte(74), 0); + context._cmp(context.data.byte(74), 0); if (context.flags.z()) goto dontgetrid; - context.es = context.ds.word(430); + context.es = context.data.word(430); deallocatemem(context); - context.es = context.ds.word(432); + context.es = context.data.word(432); deallocatemem(context); - context.es = context.ds.word(434); + context.es = context.data.word(434); deallocatemem(context); dontgetrid: return; } static void getridofall(Context & context) { - context.es = context.ds.word(416); + context.es = context.data.word(416); deallocatemem(context); - context.es = context.ds.word(444); + context.es = context.data.word(444); deallocatemem(context); - context.es = context.ds.word(430); + context.es = context.data.word(430); deallocatemem(context); - context.es = context.ds.word(432); + context.es = context.data.word(432); deallocatemem(context); - context.es = context.ds.word(434); + context.es = context.data.word(434); deallocatemem(context); - context.es = context.ds.word(450); + context.es = context.data.word(450); deallocatemem(context); - context.es = context.ds.word(448); + context.es = context.data.word(448); deallocatemem(context); - context.es = context.ds.word(440); + context.es = context.data.word(440); deallocatemem(context); - context.es = context.ds.word(442); + context.es = context.data.word(442); deallocatemem(context); - context.es = context.ds.word(436); + context.es = context.data.word(436); deallocatemem(context); - context.es = context.ds.word(446); + context.es = context.data.word(446); deallocatemem(context); - context.es = context.ds.word(438); + context.es = context.data.word(438); deallocatemem(context); return; } static void restorereels(Context & context) { - context._cmp(context.ds.byte(74), 0); + context._cmp(context.data.byte(74), 0); if (context.flags.z()) goto dontrestore; - context.al = context.ds.byte(184); + context.al = context.data.byte(184); getroomdata(context); context.dx = context.bx; openfile(context); @@ -20272,17 +20272,17 @@ static void restorereels(Context & context) { dontloadseg(context); dontloadseg(context); allocateload(context); - context.ds.word(430) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(432) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(434) = context.ax; + context.data.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20292,17 +20292,17 @@ dontrestore: } static void restoreall(Context & context) { - context.al = context.ds.byte(9); + context.al = context.data.byte(9); getroomdata(context); context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.ds.word(416) = context.ax; + context.data.word(416) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.ds.word(400); + context.ds = context.data.word(400); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20310,59 +20310,59 @@ static void restoreall(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.ds.word(444) = context.ax; + context.data.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.ds.word(430) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(432) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(434) = context.ax; + context.data.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(450) = context.ax; + context.data.word(450) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(448) = context.ax; + context.data.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(440) = context.ax; + context.data.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(442) = context.ax; + context.data.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(436) = context.ax; + context.data.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(446) = context.ax; + context.data.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.ds.word(438) = context.ax; + context.data.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20374,9 +20374,9 @@ static void restoreall(Context & context) { static void sortoutmap(Context & context) { context.push(context.es); context.push(context.di); - context.ds = context.ds.word(400); + context.ds = context.data.word(400); context.si = 0; - context.es = context.ds.word(418); + context.es = context.data.word(418); context.di = 0; context.cx = 60; blimey: @@ -20394,43 +20394,43 @@ blimey: } static void startloading(Context & context) { - context.ds.byte(64) = 0; + context.data.byte(64) = 0; context.al = context.ds.byte(context.bx+13); - context.ds.byte(531) = context.al; + context.data.byte(531) = context.al; context.al = context.ds.byte(context.bx+15); - context.ds.byte(148) = context.al; + context.data.byte(148) = context.al; context.al = context.ds.byte(context.bx+16); - context.ds.byte(149) = context.al; + context.data.byte(149) = context.al; context.al = context.ds.byte(context.bx+20); - context.ds.byte(35) = context.al; + context.data.byte(35) = context.al; context.al = context.ds.byte(context.bx+21); - context.ds.byte(475) = context.al; - context.ds.byte(478) = context.al; - context.ds.byte(477) = context.al; + context.data.byte(475) = context.al; + context.data.byte(478) = context.al; + context.data.byte(477) = context.al; context.al = context.ds.byte(context.bx+22); - context.ds.byte(133) = context.al; - context.ds.byte(135) = context.al; + context.data.byte(133) = context.al; + context.data.byte(135) = context.al; context.al = context.ds.byte(context.bx+23); - context.ds.byte(39) = context.al; + context.data.byte(39) = context.al; context.al = context.ds.byte(context.bx+24); - context.ds.byte(36) = context.al; + context.data.byte(36) = context.al; context.al = context.ds.byte(context.bx+25); - context.ds.byte(38) = context.al; - context.ds.byte(65) = -1; + context.data.byte(38) = context.al; + context.data.byte(65) = -1; context.al = context.ds.byte(context.bx+27); context.push(context.ax); context.al = context.ds.byte(context.bx+31); - context.ah = context.ds.byte(184); - context.ds.byte(184) = context.al; + context.ah = context.data.byte(184); + context.data.byte(184) = context.al; context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.ds.word(416) = context.ax; + context.data.word(416) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.ds.word(400); + context.ds = context.data.word(400); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20438,69 +20438,69 @@ static void startloading(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.ds.word(444) = context.ax; + context.data.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.ds.word(428); + context.ds = context.data.word(428); context.dx = 0; context.cx = 64*128; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.ds.word(430) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(432) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(434) = context.ax; + context.data.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(450) = context.ax; + context.data.word(450) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(448) = context.ax; + context.data.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(440) = context.ax; + context.data.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(442) = context.ax; + context.data.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(436) = context.ax; + context.data.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.ds.word(446) = context.ax; + context.data.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.ds.word(426); + context.ds = context.data.word(426); context.dx = 0; context.cx = 16*80; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.ds.word(438) = context.ax; + context.data.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20509,17 +20509,17 @@ static void startloading(Context & context) { deletetaken(context); setallchanges(context); autoappear(context); - context.al = context.ds.byte(188); + context.al = context.data.byte(188); getroomdata(context); - context.ds.byte(65) = -1; - context.ds.byte(56) = 0; - context.ds.word(98) = 160; - context.ds.byte(188) = 255; - context.ds.byte(492) = 254; + context.data.byte(65) = -1; + context.data.byte(56) = 0; + context.data.word(98) = 160; + context.data.byte(188) = 255; + context.data.byte(492) = 254; context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) goto dontwalkin; - context.ds.byte(475) = context.al; + context.data.byte(475) = context.al; context.push(context.bx); autosetwalk(context); context.bx = context.pop(); @@ -20546,7 +20546,7 @@ lookx2: context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.ds.word(450); + context.es = context.data.word(450); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -20562,7 +20562,7 @@ lookx2: static void findxyfrompath(Context & context) { getroomspaths(context); - context.al = context.ds.byte(475); + context.al = context.data.byte(475); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -20571,25 +20571,25 @@ static void findxyfrompath(Context & context) { context.ax = context.ds.word(context.bx); context._sub(context.al, 12); context._sub(context.ah, 12); - context.ds.byte(151) = context.al; - context.ds.byte(152) = context.ah; + context.data.byte(151) = context.al; + context.data.byte(152) = context.ah; return; } static void findroominloc(Context & context) { - context.al = context.ds.byte(149); + context.al = context.data.byte(149); context.cx = -6; looky: context._add(context.cx, 6); context._sub(context.al, 10); if (!context.flags.c()) goto looky; - context.al = context.ds.byte(148); + context.al = context.data.byte(148); context._sub(context.cx, 1); lookx: context._add(context.cx, 1); context._sub(context.al, 11); if (!context.flags.c()) goto lookx; - context.ds.byte(185) = context.cl; + context.data.byte(185) = context.cl; return; } @@ -20605,7 +20605,7 @@ static void getroomdata(Context & context) { static void readheader(Context & context) { context.ds = context.cs; context.dx = 5881; - context.cx = 5958-context.ds.byte(5881); + context.cx = 5958-context.data.byte(5881); readfromfile(context); context.es = context.cs; context.di = 5952; @@ -20642,37 +20642,37 @@ static void fillspace(Context & context) { } static void getridoftemp(Context & context) { - context.es = context.ds.word(458); + context.es = context.data.word(458); deallocatemem(context); return; } static void getridoftemptext(Context & context) { - context.es = context.ds.word(466); + context.es = context.data.word(466); deallocatemem(context); return; } static void getridoftemp2(Context & context) { - context.es = context.ds.word(460); + context.es = context.data.word(460); deallocatemem(context); return; } static void getridoftemp3(Context & context) { - context.es = context.ds.word(462); + context.es = context.data.word(462); deallocatemem(context); return; } static void getridoftempcharset(Context & context) { - context.es = context.ds.word(406); + context.es = context.data.word(406); deallocatemem(context); return; } static void getridoftempsp(Context & context) { - context.es = context.ds.word(464); + context.es = context.data.word(464); deallocatemem(context); return; } @@ -20680,30 +20680,30 @@ static void getridoftempsp(Context & context) { static void readsetdata(Context & context) { context.dx = 1870; standardload(context); - context.ds.word(404) = context.ax; + context.data.word(404) = context.ax; context.dx = 1935; standardload(context); - context.ds.word(408) = context.ax; + context.data.word(408) = context.ax; context.dx = 1948; standardload(context); - context.ds.word(410) = context.ax; + context.data.word(410) = context.ax; context.dx = 1832; standardload(context); - context.ds.word(414) = context.ax; + context.data.word(414) = context.ax; context.dx = 2234; standardload(context); - context.ds.word(454) = context.ax; + context.data.word(454) = context.ax; context.dx = 2286; standardload(context); - context.ds.word(452) = context.ax; - context.ax = context.ds.word(404); - context.ds.word(268) = context.ax; - context._cmp(context.ds.byte(378), 255); + context.data.word(452) = context.ax; + context.ax = context.data.word(404); + context.data.word(268) = context.ax; + context._cmp(context.data.byte(378), 255); if (context.flags.z()) goto novolumeload; context.dx = 2299; openfile(context); context.cx = 2048-256; - context.ds = context.ds.word(353); + context.ds = context.data.word(353); context.dx = 16384; readfromfile(context); closefile(context); @@ -20725,7 +20725,7 @@ static void dreamweb(Context & context) { clearpalette(context); set16colpalette(context); readsetdata(context); - context.ds.byte(391) = 0; + context.data.byte(391) = 0; context.dx = 1922; loadsample(context); setsoundoff(context); @@ -20741,7 +20741,7 @@ dodecisions: cls(context); setmode(context); decide(context); - context._cmp(context.ds.byte(103), 4); + context._cmp(context.data.byte(103), 4); if (context.flags.z()) goto mainloop; titles(context); credits(context); @@ -20749,22 +20749,22 @@ playgame: clearchanges(context); setmode(context); loadpalfromiff(context); - context.ds.byte(9) = 255; - context.ds.byte(67) = 1; - context.ds.byte(188) = 35; - context.ds.byte(386) = 7; + context.data.byte(9) = 255; + context.data.byte(67) = 1; + context.data.byte(188) = 35; + context.data.byte(386) = 7; loadroom(context); clearsprites(context); initman(context); entrytexts(context); entryanims(context); - context.ds.byte(183) = 3; + context.data.byte(183) = 3; initialinv(context); - context.ds.byte(153) = 32; + context.data.byte(153) = 32; startup1(context); - context.ds.byte(387) = 0; - context.ds.byte(388) = -1; - context.ds.byte(100) = 255; + context.data.byte(387) = 0; + context.data.byte(388) = -1; + context.data.byte(100) = 255; goto mainloop; loadnew: clearbeforeload(context); @@ -20773,36 +20773,36 @@ loadnew: initman(context); entrytexts(context); entryanims(context); - context.ds.byte(188) = 255; + context.data.byte(188) = 255; startup(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; worktoscreenm(context); goto mainloop; alreadyloaded: - context.ds.byte(188) = 255; + context.data.byte(188) = 255; clearsprites(context); initman(context); startup(context); - context.ds.byte(100) = 255; + context.data.byte(100) = 255; mainloop: screenupdate(context); - context._cmp(context.ds.byte(391), 0); + context._cmp(context.data.byte(391), 0); if (!context.flags.z()) goto endofgame; - context._cmp(context.ds.byte(56), 1); + context._cmp(context.data.byte(56), 1); if (context.flags.z()) goto gameover; - context._cmp(context.ds.byte(56), 2); + context._cmp(context.data.byte(56), 2); if (context.flags.z()) goto gameover; - context._cmp(context.ds.word(21), 0); + context._cmp(context.data.word(21), 0); if (context.flags.z()) goto notwatching; - context.al = context.ds.byte(477); - context._cmp(context.al, context.ds.byte(475)); + context.al = context.data.byte(477); + context._cmp(context.al, context.data.byte(475)); if (!context.flags.z()) goto mainloop; - context._sub(context.ds.word(21), 1); + context._sub(context.data.word(21), 1); if (!context.flags.z()) goto mainloop; notwatching: - context._cmp(context.ds.byte(56), 4); + context._cmp(context.data.byte(56), 4); if (context.flags.z()) goto gameover; - context._cmp(context.ds.byte(188), 255); + context._cmp(context.data.byte(188), 255); if (!context.flags.z()) goto loadnew; goto mainloop; gameover: diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 30bd043fd4..d1c65114cf 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -60,7 +60,6 @@ public: inline WordRef(Common::Array &data, unsigned index) : _data(data.begin() + index), _index(index) { assert(index + 1 < data.size()); _value = _data[0] | (_data[1] << 8); - debug(1, "word ref %d -> 0x%04x", _index, _value); } inline WordRef& operator=(const WordRef &ref) { @@ -78,11 +77,9 @@ public: } inline ~WordRef() { - debug(1, "writing %d -> 0x%04x", _index, _value); _data[0] = _value & 0xff; _data[1] = _value >> 8; _value = _data[0] | (_data[1] << 8); - debug(1, "word ref result %d -> 0x%04x", _index, _value); } }; @@ -131,6 +128,7 @@ public: } inline WordRef word(unsigned index) { + //debug(1, "getting word ref for %04x:%d", _value, index); assert(_segment != 0); return _segment->word(index); } @@ -186,14 +184,16 @@ public: LowPartOfRegister dl; HighPartOfRegister dh; - SegmentRef cs, ds, es; + SegmentRef cs, ds, es, data; + //data == fake segment register always pointing to data segment Flags flags; - inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this) { + inline Context(): 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] = Segment(); cs.reset(kDefaultDataSegment); ds.reset(kDefaultDataSegment); es.reset(kDefaultDataSegment); + data.reset(kDefaultDataSegment); } SegmentRef getSegment(uint16 value) { -- cgit v1.2.3 From 1494cdb29597369dcaee6dbbd146f63f916af9c0 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:19:39 +0400 Subject: DREAMWEB: added openfile stub --- engines/dreamweb/dreamweb.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 19e5b29024..2e4be71bcf 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -191,7 +191,12 @@ void openfilenocheck(Context &context) { } void openfile(Context &context) { - ::error("openfile"); + uint16 name_ptr = context.dx; + Common::String name; + uint8 c; + while((c = context.data.byte(name_ptr++)) != 0) + name += (char)c; + debug(1, "opening file: %s", name.c_str()); } void createfile(Context &context) { @@ -357,7 +362,7 @@ void dosreturn(Context &context) { } void set16colpalette(Context &context) { - ::error("set16colpalette"); + warning("set16colpalette: STUB"); } void mode640x480(Context &context) { @@ -365,7 +370,7 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - ::error("showgroup"); + warning("vsync: STUB"); } void fadedos(Context &context) { @@ -377,7 +382,8 @@ void doshake(Context &context) { } void vsync(Context &context) { - ::error("vsync"); + //engine()->waitForVSync(); + warning("vsync: STUB"); } void setmode(Context &context) { -- cgit v1.2.3 From 9a1575b9d560ff7ffa5056081072e3b049c0c2c5 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:25:26 +0400 Subject: DREAMWEB: implemented openfile --- engines/dreamweb/dreamweb.cpp | 13 ++++++++++++- engines/dreamweb/dreamweb.h | 9 +++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 2e4be71bcf..fab9955dcd 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -133,6 +133,15 @@ Common::Error DreamWebEngine::run() { return Common::kNoError; } +void DreamWebEngine::openFile(const Common::String &name) { + if (_file.isOpen()) { + _file.close(); + } + if (!_file.open(name)) + error("cannot open file %s", name.c_str()); +} + + } // End of namespace DreamWeb @@ -194,9 +203,11 @@ void openfile(Context &context) { uint16 name_ptr = context.dx; Common::String name; uint8 c; - while((c = context.data.byte(name_ptr++)) != 0) + while((c = context.cs.byte(name_ptr++)) != 0) name += (char)c; debug(1, "opening file: %s", name.c_str()); + context.cs.word(kHandle) = 1; //only one handle + context.flags._c = false; } void createfile(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 96aa61ab50..8669aad5fe 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -26,10 +26,11 @@ #ifndef DREAMWEB_H #define DREAMWEB_H -#include "common/scummsys.h" +#include "common/error.h" +#include "common/file.h" #include "common/random.h" #include "common/rect.h" -#include "common/error.h" +#include "common/scummsys.h" #include "engines/engine.h" #include "dreamweb/console.h" @@ -76,10 +77,14 @@ public: //dreamgen public api: uint8 randomNumber() { return _rnd.getRandomNumber(255); } + void openFile(const Common::String &name); + private: const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; Common::Point _mouse; + + Common::File _file; }; } // End of namespace DreamWeb -- cgit v1.2.3 From 858a898aa7aef678c9c486c8c18788ade47f8aea Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:38:12 +0400 Subject: DREAMWEB: added readfile --- engines/dreamweb/dreamweb.cpp | 13 ++++++++++++- engines/dreamweb/dreamweb.h | 1 + engines/dreamweb/runtime.h | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fab9955dcd..fed8a802bc 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -141,6 +141,12 @@ void DreamWebEngine::openFile(const Common::String &name) { error("cannot open file %s", name.c_str()); } +void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { + //if (!_file.isOpen()) + // error("file was not opened"); + _file.read(dst, size); +} + } // End of namespace DreamWeb @@ -184,7 +190,11 @@ void setkeyboardint(Context &context) { } void readfromfile(Context &context) { - ::error("readfromfile"); + uint16 dst_offset = context.dx; + uint16 size = context.bx; + debug(1, "readfromfile(ds:%u, %u)", dst_offset, size); + engine()->readFromFile(context.ds.ptr(dst_offset, size), size); + context.flags._c = false; //fixme: add return args } void closefile(Context &context) { @@ -206,6 +216,7 @@ void openfile(Context &context) { while((c = context.cs.byte(name_ptr++)) != 0) name += (char)c; debug(1, "opening file: %s", name.c_str()); + engine()->openFile(name); context.cs.word(kHandle) = 1; //only one handle context.flags._c = false; } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 8669aad5fe..cba1b00051 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -78,6 +78,7 @@ public: uint8 randomNumber() { return _rnd.getRandomNumber(255); } void openFile(const Common::String &name); + void readFromFile(uint8 *dst, unsigned size); private: const DreamWebGameDescription *_gameDescription; diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index d1c65114cf..d55f947032 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -98,6 +98,11 @@ struct Segment { 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; + } }; class Context; @@ -137,6 +142,11 @@ public: assert(_segment != 0); _segment->assign(b, e); } + + inline uint8* ptr(unsigned index, unsigned size) { + assert(_segment != 0); + return _segment->ptr(index, size); + } }; struct Flags { -- cgit v1.2.3 From ab41fb783de0323e333623411f7915eb110e6fac Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:48:38 +0400 Subject: DREAMWEB: fixed equ expanding --- devtools/tasmrecover/tasm/cpp.py | 15 ++++++++++++++- engines/dreamweb/dreamgen.cpp | 22 +++++++++++----------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 1e77893f89..36bc192219 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -52,7 +52,7 @@ namespace %s { g = self.context.get_global(name) if isinstance(g, op.const): - value = self.expand(g.value) + value = self.expand_equ(g.value) elif isinstance(g, proc.proc): if self.indirection != -1: raise Exception("invalid proc label usage") @@ -101,6 +101,19 @@ namespace %s { return 0 + def expand_equ_cb(self, match): + name = match.group(0).lower() + g = self.context.get_global(name) + if isinstance(g, op.const): + return g.value + return str(g.offset) + + def expand_equ(self, expr): + n = 1 + while n > 0: + expr, n = re.subn(r'\b[a-zA-Z_][a-zA-Z0-9_]+\b', self.expand_equ_cb, expr) + return expr + def expand(self, expr, def_size = 0): #print "EXPAND \"%s\"" %expr size = self.get_size(expr) if def_size == 0 else def_size diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index ef05c31e87..c5b349fb44 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -16519,7 +16519,7 @@ static void makeheader(Context & context) { context.di = 5952; context.ax = 17; storeit(context); - context.ax = 68-context.data.byte(1); + context.ax = 68-1; storeit(context); context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; storeit(context); @@ -16527,7 +16527,7 @@ static void makeheader(Context & context) { storeit(context); context.ax = 48; storeit(context); - context.ax = 991-context.data.byte(537); + context.ax = 991-537; storeit(context); return; } @@ -17313,7 +17313,7 @@ static void allocatebuffers(Context & context) { allocatemem(context); context.data.word(418) = context.ax; trysoundalloc(context); - context.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-context.data.byte(537)+68-context.data.byte(1)/16; + context.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-537+68-1/16; allocatemem(context); context.data.word(412) = context.ax; trysoundalloc(context); @@ -17340,7 +17340,7 @@ static void allocatebuffers(Context & context) { static void clearbuffers(Context & context) { context.es = context.data.word(412); - context.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-context.data.byte(537)+68-context.data.byte(1)/2; + context.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-537+68-1/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); @@ -17353,13 +17353,13 @@ static void clearbuffers(Context & context) { context.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); context.ds = context.cs; context.si = 537; - context.cx = 991-context.data.byte(537); + context.cx = 991-537; while(--context.cx) context._movsb(); context.es = context.data.word(412); - context.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-context.data.byte(537); + context.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-537; context.ds = context.cs; context.si = 1; - context.cx = 68-context.data.byte(1); + context.cx = 68-1; while(--context.cx) context._movsb(); clearchanges(context); return; @@ -17375,13 +17375,13 @@ static void clearchanges(Context & context) { context.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); context.es = context.cs; context.di = 537; - context.cx = 991-context.data.byte(537); + context.cx = 991-537; while(--context.cx) context._movsb(); context.ds = context.data.word(412); - context.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-context.data.byte(537); + context.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-537; context.es = context.cs; context.di = 1; - context.cx = 68-context.data.byte(1); + context.cx = 68-1; while(--context.cx) context._movsb(); context.data.byte(10) = 0; context.data.word(12) = 0; @@ -20605,7 +20605,7 @@ static void getroomdata(Context & context) { static void readheader(Context & context) { context.ds = context.cs; context.dx = 5881; - context.cx = 5958-context.data.byte(5881); + context.cx = 5958-5881; readfromfile(context); context.es = context.cs; context.di = 5952; -- cgit v1.2.3 From 6a33ce30f2041743624bcc115c4d74be6c57b033 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 01:51:01 +0400 Subject: DREAMWEB: added close file --- engines/dreamweb/dreamweb.cpp | 6 +++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fed8a802bc..6938423c69 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -147,6 +147,10 @@ void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { _file.read(dst, size); } +void DreamWebEngine::closeFile() { + _file.close(); +} + } // End of namespace DreamWeb @@ -198,7 +202,7 @@ void readfromfile(Context &context) { } void closefile(Context &context) { - ::error("closefile"); + engine()->closeFile(); } void openforsave(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index cba1b00051..03db193b23 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -79,6 +79,7 @@ public: void openFile(const Common::String &name); void readFromFile(uint8 *dst, unsigned size); + void closeFile(); private: const DreamWebGameDescription *_gameDescription; -- cgit v1.2.3 From 08e2316d875443ce820590004daba0e526e93204 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:17:28 +0400 Subject: DREAMWEB: more stubs --- engines/dreamweb/dreamweb.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6938423c69..f68818f572 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -327,19 +327,20 @@ void interupttest(Context &context) { } void disablesoundint(Context &context) { - ::error("disablesoundint"); + warning("disablesoundint: STUB"); } void enablesoundint(Context &context) { - ::error("enablesoundint"); + warning("enablesoundint: STUB"); } void checksoundint(Context &context) { - ::error("checksoundint"); + context.data.byte(kTestresult) = 1; + warning("checksoundint: STUB"); } void setsoundoff(Context &context) { - ::error("setsoundoff"); + warning("setsoundoff: STUB"); } @@ -348,7 +349,10 @@ void loadsecondsample(Context &context) { } void loadsample(Context &context) { - ::error("loadsample"); + warning("loadsample: STUB"); + openfile(context); + closefile(context); + //readheader(context); //add exports to tasm recompiler } void loadspeech(Context &context) { @@ -356,7 +360,8 @@ void loadspeech(Context &context) { } void scanfornames(Context &context) { - ::error("scanfornames"); + warning("scanfornames: STUB"); + context.ch = 0; } void saveseg(Context &context) { -- cgit v1.2.3 From 7e56cc2d91a662694816dea0be69af4a013a7ea9 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:31:48 +0400 Subject: DREAMWEB: added video segment --- engines/dreamweb/runtime.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index d55f947032..4a928ea5e2 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -182,7 +182,7 @@ class Context { SegmentMap _segments; public: - enum { kDefaultDataSegment = 0x1000 }; + enum { kDefaultDataSegment = 0x1000, kVideoSegment = 0xa000 }; Register ax, dx, bx, cx, si, di; LowPartOfRegister al; @@ -194,16 +194,20 @@ public: LowPartOfRegister dl; HighPartOfRegister dh; - SegmentRef cs, ds, es, data; + SegmentRef cs, ds, es, data, video; //data == fake segment register always pointing to data segment Flags flags; - inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this), data(this) { + inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), + cs(this), ds(this), es(this), data(this), video(this) { _segments[kDefaultDataSegment] = Segment(); + _segments[kVideoSegment].data.resize(0x10000); + cs.reset(kDefaultDataSegment); ds.reset(kDefaultDataSegment); es.reset(kDefaultDataSegment); data.reset(kDefaultDataSegment); + video.reset(kVideoSegment); } SegmentRef getSegment(uint16 value) { -- cgit v1.2.3 From 59f8d31132783439fed8a8475f17304faa8deb03 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:46:54 +0400 Subject: DREAMWEB: fixed offsets shifting for db/dw --- devtools/tasmrecover/tasm/parser.py | 3 +- engines/dreamweb/dreamgen.cpp | 6816 +++++++++++++++++------------------ engines/dreamweb/dreamgen.h | 948 ++--- engines/dreamweb/dreamweb.cpp | 5 +- 4 files changed, 3887 insertions(+), 3885 deletions(-) diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 3eb553fdd1..2391aa442b 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -222,8 +222,9 @@ class parser: self.set_global(cmd0, op.const(self.fix_dollar(v))) elif cmd1 == 'db' or cmd1 == 'dw' or cmd1 == 'dd': binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd1[1]] + offset = len(self.binary_data) self.binary_data += self.compact_data(binary_width, lex.parse_args(" ".join(cmd[2:]))) - self.set_global(cmd0.lower(), op.var(binary_width, len(self.binary_data))) + self.set_global(cmd0.lower(), op.var(binary_width, offset)) continue elif cmd1 == 'proc': name = cmd0.lower() diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c5b349fb44..54de5a9539 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -514,9 +514,9 @@ nofog: static void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; - context._cmp(context.data.byte(52), 1); + context._cmp(context.data.byte(51), 1); if (!context.flags.z()) goto notsetcard; - context._add(context.data.byte(52), 1); + context._add(context.data.byte(51), 1); context.ds.byte(context.bx+7) = 1; context.ds.word(context.bx+3) = 64; notsetcard: @@ -548,13 +548,13 @@ gotrecep: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedrecep; - context.data.byte(51) = 1; + context.data.byte(50) = 1; nottalkedrecep: return; } static void smokebloke(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto notspokento; context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); @@ -594,7 +594,7 @@ static void attendant(Context & context) { context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalked; - context.data.byte(48) = 1; + context.data.byte(47) = 1; nottalked: return; } @@ -609,7 +609,7 @@ static void manasleep(Context & context) { } static void eden(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); @@ -618,9 +618,9 @@ notinbed: } static void edeninbath(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.data.byte(41), 0); if (context.flags.z()) goto notinbed; - context._cmp(context.data.byte(43), 0); + context._cmp(context.data.byte(42), 0); if (!context.flags.z()) goto notinbath; showgamereel(context); addtopeoplelist(context); @@ -645,7 +645,7 @@ static void femalefan(Context & context) { } static void louis(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); @@ -654,7 +654,7 @@ notlouis1: } static void louischair(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(40), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); if (!context.flags.z()) goto notlouisanim; @@ -742,7 +742,7 @@ notsmoket2: context._add(context.ds.word(context.bx+3), 1); gotsmoket: showgamereel(context); - context._cmp(context.data.byte(46), 1); + context._cmp(context.data.byte(45), 1); if (!context.flags.z()) goto notgotgun; context.ds.byte(context.bx+7) = 9; notgotgun: @@ -763,7 +763,7 @@ static void barwoman(Context & context) { } static void interviewer(Context & context) { - context._cmp(context.data.word(23), 68); + context._cmp(context.data.word(21), 68); if (!context.flags.z()) goto notgeneralstart; context._add(context.ds.word(context.bx+3), 1); notgeneralstart: @@ -782,13 +782,13 @@ talking: static void soldier1(Context & context) { context._cmp(context.ds.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; - context.data.word(21) = 10; + context.data.word(19) = 10; context._cmp(context.ds.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 40); if (!context.flags.z()) goto gotsoldframe; - context.data.byte(56) = 2; + context.data.byte(55) = 2; goto gotsoldframe; notaftersshot: checkspeed(context); @@ -796,16 +796,16 @@ notaftersshot: context._add(context.ds.word(context.bx+3), 1); goto gotsoldframe; soldierwait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto gotsoldframe; - context.data.word(21) = 10; - context._cmp(context.data.byte(475), 2); + context.data.word(19) = 10; + context._cmp(context.data.byte(474), 2); if (!context.flags.z()) goto gotsoldframe; - context._cmp(context.data.byte(133), 4); + context._cmp(context.data.byte(132), 4); if (!context.flags.z()) goto gotsoldframe; context._add(context.ds.word(context.bx+3), 1); - context.data.byte(65) = -1; - context.data.byte(64) = 0; + context.data.byte(64) = -1; + context.data.byte(63) = 0; gotsoldframe: showgamereel(context); addtopeoplelist(context); @@ -824,22 +824,22 @@ static void rockstar(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; - context.data.byte(56) = 2; + context.data.byte(55) = 2; goto gotrockframe; notbeforedead: context._cmp(context.ax, 79); if (!context.flags.z()) goto gotrockframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto notgunonrock; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context.ax = 123; goto gotrockframe; notgunonrock: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 40); if (!context.flags.z()) goto gotrockframe; - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.ax = 79; gotrockframe: context.ds.word(context.bx+3) = context.ax; @@ -848,17 +848,17 @@ rockspeed: context._cmp(context.ds.word(context.bx+3), 78); if (!context.flags.z()) goto notalkrock; addtopeoplelist(context); - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.data.byte(233) = 2; + context.data.word(19) = 0; return; notalkrock: - context.data.word(21) = 2; - context.data.byte(234) = 0; - context.al = context.data.byte(149); + context.data.word(19) = 2; + context.data.byte(233) = 0; + context.al = context.data.byte(148); context.ds.byte(context.bx+2) = context.al; return; rockcombatend: - context.data.byte(188) = 45; + context.data.byte(187) = 45; showgamereel(context); return; } @@ -873,10 +873,10 @@ static void helicopter(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 8); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 8); if (context.flags.c()) goto waitabit; - context.data.byte(56) = 2; + context.data.byte(55) = 2; waitabit: context.ax = 49; goto gotheliframe; @@ -884,39 +884,39 @@ notbeforehdead: context._cmp(context.ax, 9); if (!context.flags.z()) goto gotheliframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto notgunonheli; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context.ax = 55; goto gotheliframe; notgunonheli: context.ax = 5; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 20); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 20); if (!context.flags.z()) goto gotheliframe; - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.ax = 9; gotheliframe: context.ds.word(context.bx+3) = context.ax; helispeed: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(147); context.ds.byte(context.bx+1) = context.al; helicombatend: context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; - context._cmp(context.data.byte(64), 7); + context._cmp(context.data.byte(63), 7); if (context.flags.c()) goto notwaitingheli; - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.data.byte(233) = 2; + context.data.word(19) = 0; return; notwaitingheli: - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.data.byte(233) = 0; + context.data.word(19) = 2; return; heliwon: - context.data.byte(234) = 0; + context.data.byte(233) = 0; return; } @@ -928,14 +928,14 @@ static void mugger(Context & context) { if (context.flags.z()) goto endmugger2; context._cmp(context.ax, 2); if (!context.flags.z()) goto havesetwatch; - context.data.word(21) = 175*2; + context.data.word(19) = 175*2; havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; context._add(context.ds.word(context.bx+3), 1); notmugger: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(147); context.ds.byte(context.bx+1) = context.al; return; endmugger1: @@ -958,25 +958,25 @@ endmugger1: context.push(context.es); context.push(context.bx); context.ds.word(context.bx+3) = 140; - context.data.byte(475) = 2; - context.data.byte(477) = 2; + context.data.byte(474) = 2; + context.data.byte(476) = 2; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'A'; findexobject(context); - context.data.byte(99) = context.al; - context.data.byte(102) = 4; + context.data.byte(98) = context.al; + context.data.byte(101) = 4; removeobfrominv(context); context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'B'; findexobject(context); - context.data.byte(99) = context.al; - context.data.byte(102) = 4; + context.data.byte(98) = context.al; + context.data.byte(101) = 4; removeobfrominv(context); makemainscreen(context); context.al = 48; @@ -985,7 +985,7 @@ endmugger1: context.cx = 70; context.dx = 10; setuptimeduse(context); - context.data.byte(45) = 1; + context.data.byte(44) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -1000,8 +1000,8 @@ static void aide(Context & context) { } static void businessman(Context & context) { - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.data.byte(233) = 0; + context.data.word(19) = 2; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 2); if (!context.flags.z()) goto notfirstbiz; @@ -1028,23 +1028,23 @@ notfirstbiz: context._add(context.ax, 1); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; - context.data.byte(56) = 2; + context.data.byte(55) = 2; goto gotbusframe; notbeforedeadb: context._cmp(context.ax, 15); if (!context.flags.z()) goto buscombatwon; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 3); + context._cmp(context.data.byte(64), 3); if (!context.flags.z()) goto notshieldonbus; - context.data.byte(65) = -1; - context.data.byte(64) = 0; + context.data.byte(64) = -1; + context.data.byte(63) = 0; context.ax = 51; goto gotbusframe; notshieldonbus: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 20); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 20); if (!context.flags.z()) goto gotbusframe; - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.ax = 15; goto gotbusframe; buscombatwon: @@ -1060,10 +1060,10 @@ buscombatwon: turnpathon(context); context.al = 3; turnpathoff(context); - context.data.byte(475) = 5; - context.data.byte(477) = 5; + context.data.byte(474) = 5; + context.data.byte(476) = 5; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; context.es = context.pop(); context.bx = context.pop(); context.ax = 92; @@ -1072,19 +1072,19 @@ gotbusframe: context.ds.word(context.bx+3) = context.ax; busspeed: showgamereel(context); - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ds.byte(context.bx+2) = context.al; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) goto buscombatend; - context.data.word(21) = 0; - context.data.byte(234) = 2; + context.data.word(19) = 0; + context.data.byte(233) = 2; return; buscombatend: return; buscombatwonend: - context.data.byte(234) = 0; - context.data.word(21) = 0; + context.data.byte(233) = 0; + context.data.word(19) = 0; return; } @@ -1108,32 +1108,32 @@ notfirstpool: context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 2); + context._cmp(context.data.byte(64), 2); if (!context.flags.z()) goto notaxeonpool; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.ax = 195; goto gotguardframe; notendguard1: context._cmp(context.ax, 147); if (!context.flags.z()) goto gotguardframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto notgunonpool; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context.ax = 147; goto gotguardframe; notgunonpool: - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 40); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.ax = 220; gotguardframe: context.ds.word(context.bx+3) = context.ax; @@ -1144,16 +1144,16 @@ guardspeed: if (context.flags.z()) goto iswaitingpool; context._cmp(context.ax, 146); if (context.flags.z()) goto iswaitingpool; - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.data.byte(233) = 0; + context.data.word(19) = 2; return; iswaitingpool: - context.data.byte(234) = 2; - context.data.word(21) = 0; + context.data.byte(233) = 2; + context.data.word(19) = 0; return; combatover1: - context.data.word(21) = 0; - context.data.byte(234) = 0; + context.data.word(19) = 0; + context.data.byte(233) = 0; context.al = 0; turnpathon(context); context.al = 1; @@ -1161,13 +1161,13 @@ combatover1: return; combatover2: showgamereel(context); - context.data.word(21) = 2; - context.data.byte(234) = 0; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 100); + context.data.word(19) = 2; + context.data.byte(233) = 0; + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 100); if (context.flags.c()) goto doneover2; - context.data.word(21) = 0; - context.data.byte(56) = 2; + context.data.word(19) = 0; + context.data.byte(55) = 2; doneover2: return; } @@ -1179,20 +1179,20 @@ static void security(Context & context) { if (!context.flags.z()) goto notaftersec; return; notaftersec: - context.data.word(21) = 10; + context.data.word(19) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; context._add(context.ds.word(context.bx+3), 1); goto gotsecurframe; securwait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto gotsecurframe; - context.data.word(21) = 10; - context._cmp(context.data.byte(475), 9); + context.data.word(19) = 10; + context._cmp(context.data.byte(474), 9); if (!context.flags.z()) goto gotsecurframe; - context._cmp(context.data.byte(133), 0); + context._cmp(context.data.byte(132), 0); if (!context.flags.z()) goto gotsecurframe; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context._add(context.ds.word(context.bx+3), 1); gotsecurframe: showgamereel(context); @@ -1206,13 +1206,13 @@ static void heavy(Context & context) { context.ds.byte(context.bx+7) = context.al; context._cmp(context.ds.word(context.bx+3), 43); if (context.flags.z()) goto heavywait; - context.data.word(21) = 10; + context.data.word(19) = 10; context._cmp(context.ds.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; - context._add(context.data.byte(64), 1); - context._cmp(context.data.byte(64), 80); + context._add(context.data.byte(63), 1); + context._cmp(context.data.byte(63), 80); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(56) = 2; + context.data.byte(55) = 2; goto gotheavyframe; notafterhshot: checkspeed(context); @@ -1220,15 +1220,15 @@ notafterhshot: context._add(context.ds.word(context.bx+3), 1); goto gotheavyframe; heavywait: - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(64), 1); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(475), 5); + context._cmp(context.data.byte(474), 5); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(133), 4); + context._cmp(context.data.byte(132), 4); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(65) = -1; + context.data.byte(64) = -1; context._add(context.ds.word(context.bx+3), 1); - context.data.byte(64) = 0; + context.data.byte(63) = 0; gotheavyframe: showgamereel(context); addtopeoplelist(context); @@ -1247,11 +1247,11 @@ static void bossman(Context & context) { context._cmp(context.ax, 41); if (!context.flags.z()) goto gotallboss; context.ax = 0; - context._add(context.data.byte(46), 1); + context._add(context.data.byte(45), 1); context.ds.byte(context.bx+7) = 10; goto gotallboss; firstdes: - context._cmp(context.data.byte(46), 1); + context._cmp(context.data.byte(45), 1); if (context.flags.z()) goto gotallboss; context.push(context.ax); randomnumber(context); @@ -1262,7 +1262,7 @@ firstdes: context.ax = 0; goto gotallboss; secdes: - context._cmp(context.data.byte(46), 1); + context._cmp(context.data.byte(45), 1); if (context.flags.z()) goto gotallboss; context.ax = 0; gotallboss: @@ -1273,7 +1273,7 @@ notboss: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedboss; - context.data.byte(50) = 1; + context.data.byte(49) = 1; nottalkedboss: return; } @@ -1317,16 +1317,16 @@ cantdrip2: } static void keeper(Context & context) { - context._cmp(context.data.byte(54), 0); + context._cmp(context.data.byte(53), 0); if (!context.flags.z()) goto notwaiting; - context._cmp(context.data.word(23), 190); + context._cmp(context.data.word(21), 190); if (context.flags.c()) goto waiting; - context._add(context.data.byte(54), 1); + context._add(context.data.byte(53), 1); context.ah = context.ds.byte(context.bx+7); context._and(context.ah, 127); - context._cmp(context.ah, context.data.byte(66)); + context._cmp(context.ah, context.data.byte(65)); if (context.flags.z()) goto notdiff; - context.al = context.data.byte(66); + context.al = context.data.byte(65); context.ds.byte(context.bx+7) = context.al; notdiff: return; @@ -1379,16 +1379,16 @@ gotintrom1: context.ds.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(139), 1); + context._add(context.data.byte(138), 1); context.push(context.es); context.push(context.bx); intro1text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 8); + context._cmp(context.data.byte(138), 8); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.data.byte(148), 10); + context.data.byte(185) = 1; introm1fin: showgamereel(context); return; @@ -1446,7 +1446,7 @@ notbang: slowgates: context._cmp(context.ax, 120); if (!context.flags.z()) goto gotgates; - context.data.byte(103) = 1; + context.data.byte(102) = 1; context.ax = 119; gotgates: context.ds.word(context.bx+3) = context.ax; @@ -1482,12 +1482,12 @@ static void intromagic3(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; - context.data.byte(103) = 1; + context.data.byte(102) = 1; gotintrom3: context.ds.word(context.bx+3) = context.ax; introm3fin: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(147); context.ds.byte(context.bx+1) = context.al; return; } @@ -1499,15 +1499,15 @@ static void intromonks1(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.data.byte(148), 10); + context.data.byte(185) = 1; showgamereel(context); return; notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; - context._sub(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._sub(context.data.byte(148), 10); + context.data.byte(185) = 1; context.ax = 51; gotintromonk1: context.ds.word(context.bx+3) = context.ax; @@ -1531,7 +1531,7 @@ waitstep: context.ds.byte(context.bx+6) = -20; intromonk1fin: showgamereel(context); - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ds.byte(context.bx+2) = context.al; return; } @@ -1543,13 +1543,13 @@ static void intromonks2(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; - context._add(context.data.byte(139), 1); + context._add(context.data.byte(138), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 19); + context._cmp(context.data.byte(138), 19); if (!context.flags.z()) goto notlasttalk1; context.ax = 87; goto gotintromonk2; @@ -1559,13 +1559,13 @@ notlasttalk1: nottalk1: context._cmp(context.ax, 110); if (!context.flags.z()) goto notraisearm; - context._add(context.data.byte(139), 1); + context._add(context.data.byte(138), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(139), 35); + context._cmp(context.data.byte(138), 35); if (!context.flags.z()) goto notlastraise; context.ax = 111; goto gotintromonk2; @@ -1575,7 +1575,7 @@ notlastraise: notraisearm: context._cmp(context.ax, 176); if (!context.flags.z()) goto notendmonk2; - context.data.byte(103) = 1; + context.data.byte(102) = 1; goto gotintromonk2; notendmonk2: context._cmp(context.ax, 125); @@ -1593,7 +1593,7 @@ static void handclap(Context & context) { } static void monks2text(Context & context) { - context._cmp(context.data.byte(139), 1); + context._cmp(context.data.byte(138), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; context.bl = 36; @@ -1601,7 +1601,7 @@ static void monks2text(Context & context) { context.cx = 100; goto gotmonks2text; notmonk2text1: - context._cmp(context.data.byte(139), 4); + context._cmp(context.data.byte(138), 4); if (!context.flags.z()) goto notmonk2text2; context.al = 9; context.bl = 36; @@ -1609,7 +1609,7 @@ notmonk2text1: context.cx = 100; goto gotmonks2text; notmonk2text2: - context._cmp(context.data.byte(139), 7); + context._cmp(context.data.byte(138), 7); if (!context.flags.z()) goto notmonk2text3; context.al = 10; context.bl = 36; @@ -1617,7 +1617,7 @@ notmonk2text2: context.cx = 100; goto gotmonks2text; notmonk2text3: - context._cmp(context.data.byte(139), 10); + context._cmp(context.data.byte(138), 10); if (!context.flags.z()) goto notmonk2text4; context.al = 11; context.bl = 0; @@ -1625,7 +1625,7 @@ notmonk2text3: context.cx = 100; goto gotmonks2text; notmonk2text4: - context._cmp(context.data.byte(139), 13); + context._cmp(context.data.byte(138), 13); if (!context.flags.z()) goto notmonk2text5; context.al = 12; context.bl = 0; @@ -1633,7 +1633,7 @@ notmonk2text4: context.cx = 100; goto gotmonks2text; notmonk2text5: - context._cmp(context.data.byte(139), 16); + context._cmp(context.data.byte(138), 16); if (!context.flags.z()) goto notmonk2text6; context.al = 13; context.bl = 0; @@ -1641,7 +1641,7 @@ notmonk2text5: context.cx = 100; goto gotmonks2text; notmonk2text6: - context._cmp(context.data.byte(139), 19); + context._cmp(context.data.byte(138), 19); if (!context.flags.z()) goto notmonk2text7; context.al = 14; context.bl = 36; @@ -1651,7 +1651,7 @@ notmonk2text6: context.ah = 82; { setuptimedtemp(context); return; }; notmonk2text7: - context._cmp(context.data.byte(139), 22); + context._cmp(context.data.byte(138), 22); if (!context.flags.z()) goto notmonk2text8; context.al = 15; context.bl = 36; @@ -1659,7 +1659,7 @@ notmonk2text7: context.cx = 100; goto gotmonks2text; notmonk2text8: - context._cmp(context.data.byte(139), 25); + context._cmp(context.data.byte(138), 25); if (!context.flags.z()) goto notmonk2text9; context.al = 16; context.bl = 36; @@ -1667,7 +1667,7 @@ notmonk2text8: context.cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.data.byte(139), 28); + context._cmp(context.data.byte(138), 28); if (!context.flags.z()) goto notmonk2text10; context.al = 17; context.bl = 36; @@ -1675,7 +1675,7 @@ notmonk2text9: context.cx = 100; goto gotmonks2text; notmonk2text10: - context._cmp(context.data.byte(139), 31); + context._cmp(context.data.byte(138), 31); if (!context.flags.z()) goto notmonk2text11; context.al = 18; context.bl = 36; @@ -1693,7 +1693,7 @@ gotmonks2text: } static void intro1text(Context & context) { - context._cmp(context.data.byte(139), 2); + context._cmp(context.data.byte(138), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; context.bl = 34; @@ -1701,7 +1701,7 @@ static void intro1text(Context & context) { context.cx = 90; goto gotintro1text; notintro1text1: - context._cmp(context.data.byte(139), 4); + context._cmp(context.data.byte(138), 4); if (!context.flags.z()) goto notintro1text2; context.al = 41; context.bl = 34; @@ -1709,7 +1709,7 @@ notintro1text1: context.cx = 90; goto gotintro1text; notintro1text2: - context._cmp(context.data.byte(139), 6); + context._cmp(context.data.byte(138), 6); if (!context.flags.z()) goto notintro1text3; context.al = 42; context.bl = 34; @@ -1783,16 +1783,16 @@ static void monkandryan(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; - context._add(context.data.byte(139), 1); + context._add(context.data.byte(138), 1); context.push(context.es); context.push(context.bx); textformonk(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 77; - context._cmp(context.data.byte(139), 57); + context._cmp(context.data.byte(138), 57); if (!context.flags.z()) goto gotmonkryan; - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; gotmonkryan: context.ds.word(context.bx+3) = context.ax; @@ -1808,9 +1808,9 @@ static void endgameseq(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; - context._cmp(context.data.byte(139), 140); + context._cmp(context.data.byte(138), 140); if (context.flags.z()) goto gotendseq; - context._add(context.data.byte(139), 1); + context._add(context.data.byte(138), 1); context.push(context.es); context.push(context.bx); textforend(context); @@ -1836,18 +1836,18 @@ notfadedown: context.push(context.bx); context.push(context.ax); fadescreendowns(context); - context.data.byte(387) = 7; - context.data.byte(388) = 1; + context.data.byte(386) = 7; + context.data.byte(387) = 1; context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); notfadeend: context._cmp(context.ax, 340); if (!context.flags.z()) goto notendseq; - context.data.byte(103) = 1; + context.data.byte(102) = 1; notendseq: showgamereel(context); - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ds.byte(context.bx+2) = context.al; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 145); @@ -1862,17 +1862,17 @@ static void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); - context.data.byte(386) = 7; - context.data.byte(387) = 0; - context.data.byte(388) = -1; + context.data.byte(385) = 7; + context.data.byte(386) = 0; + context.data.byte(387) = -1; context.cl = 160; context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiget(context); - context.es = context.data.word(466); + context.es = context.data.word(464); context.si = 3*2; context.ax = context.ds.word(context.si); context.si = context.ax; @@ -1881,7 +1881,7 @@ static void rollendcredits(Context & context) { endcredits1: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(77); + context.cx = context.data.word(75); endcredits2: context.push(context.cx); context.push(context.si); @@ -1893,7 +1893,7 @@ endcredits2: context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiput(context); vsync(context); @@ -1912,7 +1912,7 @@ onelot: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.data.word(75)); context.cx = context.pop(); if (--context.cx) goto onelot; vsync(context); @@ -1949,8 +1949,8 @@ gotnext: static void priest(Context & context) { context._cmp(context.ds.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; - context.data.byte(234) = 0; - context.data.word(21) = 2; + context.data.byte(233) = 0; + context.data.word(19) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; context._add(context.ds.word(context.bx+3), 1); @@ -1978,7 +1978,7 @@ notendtelly: } static void madman(Context & context) { - context.data.word(21) = 2; + context.data.word(19) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; context.ax = context.ds.word(context.bx+3); @@ -1989,35 +1989,35 @@ static void madman(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.ax); - context.dx = 2260; + context.dx = 2247; loadtemptext(context); context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(64) = -1; - context.data.byte(69) = 0; + context.data.byte(63) = -1; + context.data.byte(68) = 0; notfirstmad: context._add(context.ax, 1); context._cmp(context.ax, 294); if (context.flags.z()) goto madmanspoken; context._cmp(context.ax, 66); if (!context.flags.z()) goto nomadspeak; - context._add(context.data.byte(64), 1); + context._add(context.data.byte(63), 1); context.push(context.es); context.push(context.bx); madmantext(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 53; - context._cmp(context.data.byte(64), 62); + context._cmp(context.data.byte(63), 62); if (context.flags.c()) goto nomadspeak; - context._cmp(context.data.byte(64), 68); + context._cmp(context.data.byte(63), 68); if (context.flags.z()) goto killryan; - context._cmp(context.data.byte(65), 8); + context._cmp(context.data.byte(64), 8); if (!context.flags.z()) goto nomadspeak; - context.data.byte(64) = 70; - context.data.byte(65) = -1; - context.data.byte(53) = 1; + context.data.byte(63) = 70; + context.data.byte(64) = -1; + context.data.byte(52) = 1; context.ax = 67; goto nomadspeak; killryan: @@ -2026,14 +2026,14 @@ nomadspeak: context.ds.word(context.bx+3) = context.ax; nomadspeed: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(147); context.ds.byte(context.bx+1) = context.al; madmode(context); return; madmanspoken: - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(390), 1); if (context.flags.z()) goto alreadywon; - context.data.byte(391) = 1; + context.data.byte(390) = 1; context.push(context.es); context.push(context.bx); getridoftemptext(context); @@ -2042,18 +2042,18 @@ madmanspoken: alreadywon: return; ryansded: - context.data.byte(56) = 2; + context.data.byte(55) = 2; showgamereel(context); return; } static void madmantext(Context & context) { - context._cmp(context.data.byte(64), 61); + context._cmp(context.data.byte(63), 61); if (!context.flags.c()) goto nomadtext; - context.al = context.data.byte(64); + context.al = context.data.byte(63); context._and(context.al, 3); if (!context.flags.z()) goto nomadtext; - context.al = context.data.byte(64); + context.al = context.data.byte(63); context._shr(context.al, 1); context._shr(context.al, 1); context._add(context.al, 47); @@ -2068,13 +2068,13 @@ nomadtext: } static void madmode(Context & context) { - context.data.word(21) = 2; - context.data.byte(234) = 0; - context._cmp(context.data.byte(64), 63); + context.data.word(19) = 2; + context.data.byte(233) = 0; + context._cmp(context.data.byte(63), 63); if (context.flags.c()) goto iswatchmad; - context._cmp(context.data.byte(64), 68); + context._cmp(context.data.byte(63), 68); if (!context.flags.c()) goto iswatchmad; - context.data.byte(234) = 2; + context.data.byte(233) = 2; iswatchmad: return; } @@ -2100,7 +2100,7 @@ nopriesttext: } static void textforend(Context & context) { - context._cmp(context.data.byte(139), 20); + context._cmp(context.data.byte(138), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; context.bl = 34; @@ -2108,7 +2108,7 @@ static void textforend(Context & context) { context.cx = 60; goto gotendtext; notendtext1: - context._cmp(context.data.byte(139), 65); + context._cmp(context.data.byte(138), 65); if (!context.flags.z()) goto notendtext2; context.al = 1; context.bl = 34; @@ -2116,7 +2116,7 @@ notendtext1: context.cx = 60; goto gotendtext; notendtext2: - context._cmp(context.data.byte(139), 110); + context._cmp(context.data.byte(138), 110); if (!context.flags.z()) goto notendtext3; context.al = 2; context.bl = 34; @@ -2133,7 +2133,7 @@ gotendtext: } static void textformonk(Context & context) { - context._cmp(context.data.byte(139), 1); + context._cmp(context.data.byte(138), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; context.bl = 68; @@ -2141,7 +2141,7 @@ static void textformonk(Context & context) { context.cx = 120; goto gotmonktext; notmonktext1: - context._cmp(context.data.byte(139), 5); + context._cmp(context.data.byte(138), 5); if (!context.flags.z()) goto notmonktext2; context.al = 20; context.bl = 68; @@ -2149,7 +2149,7 @@ notmonktext1: context.cx = 120; goto gotmonktext; notmonktext2: - context._cmp(context.data.byte(139), 9); + context._cmp(context.data.byte(138), 9); if (!context.flags.z()) goto notmonktext3; context.al = 21; context.bl = 48; @@ -2157,7 +2157,7 @@ notmonktext2: context.cx = 120; goto gotmonktext; notmonktext3: - context._cmp(context.data.byte(139), 13); + context._cmp(context.data.byte(138), 13); if (!context.flags.z()) goto notmonktext4; context.al = 22; context.bl = 68; @@ -2165,7 +2165,7 @@ notmonktext3: context.cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.data.byte(139), 17); + context._cmp(context.data.byte(138), 17); if (!context.flags.z()) goto notmonktext5; context.al = 23; context.bl = 68; @@ -2173,7 +2173,7 @@ notmonktext4: context.cx = 120; goto gotmonktext; notmonktext5: - context._cmp(context.data.byte(139), 21); + context._cmp(context.data.byte(138), 21); if (!context.flags.z()) goto notmonktext6; context.al = 24; context.bl = 68; @@ -2181,7 +2181,7 @@ notmonktext5: context.cx = 120; goto gotmonktext; notmonktext6: - context._cmp(context.data.byte(139), 25); + context._cmp(context.data.byte(138), 25); if (!context.flags.z()) goto notmonktext7; context.al = 25; context.bl = 68; @@ -2189,7 +2189,7 @@ notmonktext6: context.cx = 120; goto gotmonktext; notmonktext7: - context._cmp(context.data.byte(139), 29); + context._cmp(context.data.byte(138), 29); if (!context.flags.z()) goto notmonktext8; context.al = 26; context.bl = 68; @@ -2197,7 +2197,7 @@ notmonktext7: context.cx = 120; goto gotmonktext; notmonktext8: - context._cmp(context.data.byte(139), 33); + context._cmp(context.data.byte(138), 33); if (!context.flags.z()) goto notmonktext9; context.al = 27; context.bl = 68; @@ -2205,7 +2205,7 @@ notmonktext8: context.cx = 120; goto gotmonktext; notmonktext9: - context._cmp(context.data.byte(139), 37); + context._cmp(context.data.byte(138), 37); if (!context.flags.z()) goto notmonktext10; context.al = 28; context.bl = 68; @@ -2213,7 +2213,7 @@ notmonktext9: context.cx = 120; goto gotmonktext; notmonktext10: - context._cmp(context.data.byte(139), 41); + context._cmp(context.data.byte(138), 41); if (!context.flags.z()) goto notmonktext11; context.al = 29; context.bl = 68; @@ -2221,7 +2221,7 @@ notmonktext10: context.cx = 120; goto gotmonktext; notmonktext11: - context._cmp(context.data.byte(139), 45); + context._cmp(context.data.byte(138), 45); if (!context.flags.z()) goto notmonktext12; context.al = 30; context.bl = 68; @@ -2229,7 +2229,7 @@ notmonktext11: context.cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.data.byte(139), 49); + context._cmp(context.data.byte(138), 49); if (!context.flags.z()) goto notmonktext13; context.al = 31; context.bl = 68; @@ -2237,7 +2237,7 @@ notmonktext12: context.cx = 220; goto gotmonktext; notmonktext13: - context._cmp(context.data.byte(139), 53); + context._cmp(context.data.byte(138), 53); if (!context.flags.z()) goto notendtitles; fadescreendowns(context); notendtitles: @@ -2251,7 +2251,7 @@ oktalk: } static void drunk(Context & context) { - context._cmp(context.data.byte(42), 0); + context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto trampgone; context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); @@ -2321,7 +2321,7 @@ nocopper: } static void sparky(Context & context) { - context._cmp(context.data.word(16), 0); + context._cmp(context.data.word(14), 0); if (context.flags.z()) goto animsparky; context.ds.byte(context.bx+7) = 3; goto animsparky; @@ -2348,7 +2348,7 @@ finishsparky: context.al = context.ds.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedsparky; - context.data.byte(49) = 1; + context.data.byte(48) = 1; nottalkedsparky: return; } @@ -2364,9 +2364,9 @@ notrainyet: randomnumber(context); context._cmp(context.al, 253); if (context.flags.c()) goto notrainatall; - context._cmp(context.data.byte(475), 5); + context._cmp(context.data.byte(474), 5); if (!context.flags.z()) goto notrainatall; - context._cmp(context.data.byte(477), 5); + context._cmp(context.data.byte(476), 5); if (!context.flags.z()) goto notrainatall; context.ax = 5; gottrainframe: @@ -2382,15 +2382,15 @@ static void addtopeoplelist(Context & context) { context.push(context.bx); context.cl = context.ds.byte(context.bx+7); context.ax = context.ds.word(context.bx+3); - context.bx = context.data.word(18); - context.es = context.data.word(412); + context.bx = context.data.word(16); + context.es = context.data.word(410); context.ds.word(context.bx) = context.ax; context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; context.ds.byte(context.bx+4) = context.cl; context.bx = context.pop(); context.es = context.pop(); - context._add(context.data.word(18), 5); + context._add(context.data.word(16), 5); return; } @@ -2398,20 +2398,20 @@ static void showgamereel(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; - context.data.word(239) = context.ax; + context.data.word(237) = context.ax; context.push(context.es); context.push(context.bx); plotreel(context); context.bx = context.pop(); context.es = context.pop(); - context.ax = context.data.word(239); + context.ax = context.data.word(237); context.ds.word(context.bx+3) = context.ax; noshow: return; } static void checkspeed(Context & context) { - context._cmp(context.data.byte(65), -1); + context._cmp(context.data.byte(64), -1); if (!context.flags.z()) goto forcenext; context._add(context.ds.byte(context.bx+6), 1); context.al = context.ds.byte(context.bx+6); @@ -2428,7 +2428,7 @@ forcenext: } static void clearsprites(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = 255; context.cx = 32*16; @@ -2437,7 +2437,7 @@ static void clearsprites(Context & context) { } static void makesprite(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: context._cmp(context.ds.byte(context.bx+15), 255); @@ -2464,11 +2464,11 @@ static void delsprite(Context & context) { } static void spriteupdate(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.al = context.data.byte(63); + context.al = context.data.byte(62); context.ds.byte(context.bx+31) = context.al; - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; _tmp18: @@ -2487,7 +2487,7 @@ _tmp18: _tmp18a: context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(186), 1); + context._cmp(context.data.byte(185), 1); if (context.flags.z()) goto _tmp18b; context._add(context.bx, 32); if (--context.cx) goto _tmp18; @@ -2496,11 +2496,11 @@ _tmp18b: } static void printsprites(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.cx = 0; priorityloop: context.push(context.cx); - context.data.byte(182) = context.cl; + context.data.byte(181) = context.cl; context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; prtspriteloop: @@ -2509,7 +2509,7 @@ prtspriteloop: context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto skipsprite; - context.al = context.data.byte(182); + context.al = context.data.byte(181); context._cmp(context.al, context.ds.byte(context.bx+23)); if (!context.flags.z()) goto skipsprite; context._cmp(context.ds.byte(context.bx+31), 1); @@ -2539,7 +2539,7 @@ static void printasprite(Context & context) { context.ah = 255; notnegative1: context.bx = context.ax; - context._add(context.bx, context.data.word(119)); + context._add(context.bx, context.data.word(117)); context.al = context.ds.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); @@ -2547,14 +2547,14 @@ notnegative1: context.ah = 255; notnegative2: context.di = context.ax; - context._add(context.di, context.data.word(117)); + context._add(context.di, context.data.word(115)); context.al = context.ds.byte(context.si+15); context.ah = 0; context._cmp(context.ds.byte(context.si+30), 0); if (context.flags.z()) goto steadyframe; context.ah = 8; steadyframe: - context._cmp(context.data.byte(182), 6); + context._cmp(context.data.byte(181), 6); if (!context.flags.z()) goto notquickp; notquickp: showframe(context); @@ -2589,7 +2589,7 @@ static void checkone(Context & context) { context.cx = 3; context._mul(context.cx); context.si = context.ax; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context._add(context.si, 0+(228*13)+32+60+(32*32)); context._lodsw(); context.cx = context.ax; @@ -2599,30 +2599,30 @@ static void checkone(Context & context) { } static void findsource(Context & context) { - context.ax = context.data.word(160); + context.ax = context.data.word(158); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; - context.ds = context.data.word(430); - context.data.word(244) = 0; + context.ds = context.data.word(428); + context.data.word(242) = 0; return; over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; - context.ds = context.data.word(432); - context.data.word(244) = 160; + context.ds = context.data.word(430); + context.data.word(242) = 160; return; over1001: - context.ds = context.data.word(434); - context.data.word(244) = 320; + context.ds = context.data.word(432); + context.data.word(242) = 320; return; } static void initman(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); + context.al = context.data.byte(150); + context.ah = context.data.byte(151); context.si = context.ax; context.cx = 49464; - context.dx = context.data.word(414); + context.dx = context.data.word(412); context.di = 0; makesprite(context); context.ds.byte(context.bx+23) = 4; @@ -2632,11 +2632,11 @@ static void initman(Context & context) { } static void mainman(Context & context) { - context._cmp(context.data.byte(187), 1); + context._cmp(context.data.byte(186), 1); if (!context.flags.z()) goto notinnewroom; - context.data.byte(187) = 0; - context.al = context.data.byte(151); - context.ah = context.data.byte(152); + context.data.byte(186) = 0; + context.al = context.data.byte(150); + context.ah = context.data.byte(151); context.ds.word(context.bx+10) = context.ax; context.ds.byte(context.bx+29) = 0; goto executewalk; @@ -2647,24 +2647,24 @@ notinnewroom: return; executewalk: context.ds.byte(context.bx+22) = 0; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.al = context.data.byte(134); + context._cmp(context.al, context.data.byte(132)); if (context.flags.z()) goto facingok; aboutturn(context); goto notwalk; facingok: - context._cmp(context.data.byte(136), 0); + context._cmp(context.data.byte(135), 0); if (context.flags.z()) goto alreadyturned; - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto alreadyturned; - context.data.byte(473) = 1; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(134)); + context.data.byte(472) = 1; + context.al = context.data.byte(132); + context._cmp(context.al, context.data.byte(133)); if (!context.flags.z()) goto alreadyturned; checkforexit(context); alreadyturned: - context.data.byte(136) = 0; - context._cmp(context.data.byte(492), 254); + context.data.byte(135) = 0; + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto walkman; context.ds.byte(context.bx+29) = 0; goto notwalk; @@ -2677,9 +2677,9 @@ walkman: notanimend1: context.ds.byte(context.bx+29) = context.al; walking(context); - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (context.flags.z()) goto afterwalk; - context.al = context.data.byte(133); + context.al = context.data.byte(132); context._and(context.al, 1); if (context.flags.z()) goto isdouble; context.al = context.ds.byte(context.bx+29); @@ -2690,18 +2690,18 @@ notanimend1: isdouble: walking(context); afterwalk: - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto notwalk; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.al = context.data.byte(134); + context._cmp(context.al, context.data.byte(132)); if (!context.flags.z()) goto notwalk; - context.data.byte(473) = 1; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(134)); + context.data.byte(472) = 1; + context.al = context.data.byte(132); + context._cmp(context.al, context.data.byte(133)); if (!context.flags.z()) goto notwalk; checkforexit(context); notwalk: - context.al = context.data.byte(133); + context.al = context.data.byte(132); context.ah = 0; context.di = 1105; context._add(context.di, context.ax); @@ -2709,18 +2709,18 @@ notwalk: context._add(context.al, context.ds.byte(context.bx+29)); context.ds.byte(context.bx+15) = context.al; context.ax = context.ds.word(context.bx+10); - context.data.byte(151) = context.al; - context.data.byte(152) = context.ah; + context.data.byte(150) = context.al; + context.data.byte(151) = context.ah; return; } static void aboutturn(Context & context) { - context._cmp(context.data.byte(136), 1); + context._cmp(context.data.byte(135), 1); if (context.flags.z()) goto incdir; - context._cmp(context.data.byte(136), -1); + context._cmp(context.data.byte(135), -1); if (context.flags.z()) goto decdir; - context.al = context.data.byte(133); - context._sub(context.al, context.data.byte(135)); + context.al = context.data.byte(132); + context._sub(context.al, context.data.byte(134)); if (!context.flags.c()) goto higher; context._neg(context.al); context._cmp(context.al, 4); @@ -2731,37 +2731,37 @@ higher: if (!context.flags.c()) goto incdir; goto decdir; incdir: - context.data.byte(136) = 1; - context.al = context.data.byte(133); + context.data.byte(135) = 1; + context.al = context.data.byte(132); context._add(context.al, 1); context._and(context.al, 7); - context.data.byte(133) = context.al; + context.data.byte(132) = context.al; context.ds.byte(context.bx+29) = 0; return; decdir: - context.data.byte(136) = -1; - context.al = context.data.byte(133); + context.data.byte(135) = -1; + context.al = context.data.byte(132); context._sub(context.al, 1); context._and(context.al, 7); - context.data.byte(133) = context.al; + context.data.byte(132) = context.al; context.ds.byte(context.bx+29) = 0; return; } static void walking(Context & context) { - context._cmp(context.data.byte(493), 0); + context._cmp(context.data.byte(492), 0); if (context.flags.z()) goto normalwalk; - context.al = context.data.byte(492); + context.al = context.data.byte(491); context._sub(context.al, 1); - context.data.byte(492) = context.al; + context.data.byte(491) = context.al; context._cmp(context.al, 200); if (!context.flags.c()) goto endofline; goto continuewalk; normalwalk: - context.al = context.data.byte(492); + context.al = context.data.byte(491); context._add(context.al, 1); - context.data.byte(492) = context.al; - context._cmp(context.al, context.data.byte(494)); + context.data.byte(491) = context.al; + context._cmp(context.al, context.data.byte(493)); if (!context.flags.c()) goto endofline; continuewalk: context.ah = 0; @@ -2770,7 +2770,7 @@ continuewalk: context.push(context.bx); context.dx = context.ds; context.es = context.dx; - context.bx = 8344; + context.bx = 7944; context._add(context.bx, context.ax); context.ax = context.ds.word(context.bx); context.bx = context.pop(); @@ -2779,13 +2779,13 @@ stillline: context.ds.word(context.bx+10) = context.ax; return; endofline: - context.data.byte(492) = 254; - context.al = context.data.byte(478); - context.data.byte(475) = context.al; - context._cmp(context.al, context.data.byte(477)); - if (context.flags.z()) goto finishedwalk; + context.data.byte(491) = 254; context.al = context.data.byte(477); - context.data.byte(478) = context.al; + context.data.byte(474) = context.al; + context._cmp(context.al, context.data.byte(476)); + if (context.flags.z()) goto finishedwalk; + context.al = context.data.byte(476); + context.data.byte(477) = context.al; context.push(context.es); context.push(context.bx); autosetwalk(context); @@ -2801,42 +2801,42 @@ static void facerightway(Context & context) { context.push(context.es); context.push(context.bx); getroomspaths(context); - context.al = context.data.byte(475); + context.al = context.data.byte(474); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx+7); - context.data.byte(135) = context.al; context.data.byte(134) = context.al; + context.data.byte(133) = context.al; context.bx = context.pop(); context.es = context.pop(); return; } static void checkforexit(Context & context) { - context.cl = context.data.byte(151); + context.cl = context.data.byte(150); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.data.byte(151); context._add(context.ch, 12); checkone(context); - context.data.byte(153) = context.cl; - context.data.byte(154) = context.ch; - context.data.byte(155) = context.dl; - context.data.byte(156) = context.dh; - context.al = context.data.byte(153); + context.data.byte(152) = context.cl; + context.data.byte(153) = context.ch; + context.data.byte(154) = context.dl; + context.data.byte(155) = context.dh; + context.al = context.data.byte(152); context._test(context.al, 64); if (context.flags.z()) goto notnewdirect; - context.al = context.data.byte(154); - context.data.byte(189) = context.al; + context.al = context.data.byte(153); + context.data.byte(188) = context.al; return; notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; context.push(context.es); context.push(context.bx); - context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(183), 2); if (!context.flags.z()) goto notlouis; context.bl = 0; context.push(context.bx); @@ -2871,17 +2871,17 @@ notravmessage: context.bl = 68; context.bh = 64; setuptimeduse(context); - context.al = context.data.byte(133); + context.al = context.data.byte(132); context._add(context.al, 4); context._and(context.al, 7); - context.data.byte(135) = context.al; + context.data.byte(134) = context.al; context.bx = context.pop(); context.es = context.pop(); return; notlouis: context.bx = context.pop(); context.es = context.pop(); - context.data.byte(60) = 1; + context.data.byte(59) = 1; return; notleave: context._test(context.al, 4); @@ -2910,12 +2910,12 @@ notanup: static void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(149), 10); - context.al = context.data.byte(154); + context._add(context.data.byte(148), 10); + context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+11) = context.al; - context.data.byte(186) = 1; + context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2924,12 +2924,12 @@ static void adjustdown(Context & context) { static void adjustup(Context & context) { context.push(context.es); context.push(context.bx); - context._sub(context.data.byte(149), 10); - context.al = context.data.byte(154); + context._sub(context.data.byte(148), 10); + context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+11) = context.al; - context.data.byte(186) = 1; + context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2938,13 +2938,13 @@ static void adjustup(Context & context) { static void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); - context.data.byte(153) = 0; - context._sub(context.data.byte(148), 11); - context.al = context.data.byte(154); + context.data.byte(152) = 0; + context._sub(context.data.byte(147), 11); + context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); context.ds.byte(context.bx+10) = context.al; - context.data.byte(186) = 1; + context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2953,24 +2953,24 @@ static void adjustleft(Context & context) { static void adjustright(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(148), 11); - context.al = context.data.byte(154); + context._add(context.data.byte(147), 11); + context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); context._sub(context.al, 2); context.ds.byte(context.bx+10) = context.al; - context.data.byte(186) = 1; + context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); return; } static void reminders(Context & context) { - context._cmp(context.data.byte(184), 24); + context._cmp(context.data.byte(183), 24); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(148), 44); + context._cmp(context.data.byte(147), 44); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(2), 0); + context._cmp(context.data.byte(1), 0); if (!context.flags.z()) goto notfirst; context.al = 'D'; context.ah = 'K'; @@ -2998,7 +2998,7 @@ static void reminders(Context & context) { compare(context); if (!context.flags.z()) goto forgotone; havegotcard: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); notfirst: return; forgotone: @@ -3014,23 +3014,23 @@ notinedenslift: } static void initrain(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.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); context.bx = 1113; checkmorerain: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto finishinitrain; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+1); - context._cmp(context.al, context.data.byte(148)); + context._cmp(context.al, context.data.byte(147)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+2); - context._cmp(context.al, context.data.byte(149)); + context._cmp(context.al, context.data.byte(148)); if (!context.flags.z()) goto checkrain; context.al = context.ds.byte(context.bx+3); - context.data.byte(132) = context.al; + context.data.byte(131) = context.al; goto dorain; checkrain: context._add(context.bx, 4); @@ -3041,26 +3041,26 @@ initraintop: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); + context._cmp(context.al, context.data.byte(131)); if (!context.flags.c()) goto initraintop; context._add(context.cl, context.al); - context._cmp(context.cl, context.data.byte(128)); + context._cmp(context.cl, context.data.byte(127)); if (!context.flags.c()) goto initrainside; context.push(context.cx); splitintolines(context); context.cx = context.pop(); goto initraintop; initrainside: - context.cl = context.data.byte(128); + context.cl = context.data.byte(127); context._sub(context.cl, 1); initrainside2: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(132)); + context._cmp(context.al, context.data.byte(131)); if (!context.flags.c()) goto initrainside2; context._add(context.ch, context.al); - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.data.byte(128)); if (!context.flags.c()) goto finishinitrain; context.push(context.cx); splitintolines(context); @@ -3081,7 +3081,7 @@ lookforlinestart: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.data.byte(128)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; foundlinestart: @@ -3095,7 +3095,7 @@ lookforlineend: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto foundlineend; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.data.byte(128)); if (!context.flags.c()) goto foundlineend; context._add(context.bh, 1); goto lookforlineend; @@ -3114,7 +3114,7 @@ foundlineend: context.cx = context.pop(); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(129)); + context._cmp(context.ch, context.data.byte(128)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: @@ -3125,9 +3125,9 @@ static void getblockofpixel(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.di); - context.ax = context.data.word(125); + context.ax = context.data.word(123); context._add(context.cl, context.al); - context.ax = context.data.word(127); + context.ax = context.data.word(125); context._add(context.ch, context.al); checkone(context); context._and(context.cl, 1); @@ -3145,30 +3145,30 @@ failrain: } static void showrain(Context & context) { - context.ds = context.data.word(414); + context.ds = context.data.word(412); context.si = 6*58; context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); context.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); - context.es = context.data.word(412); + context.es = context.data.word(410); context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto nothunder; morerain: - context.es = context.data.word(412); + context.es = context.data.word(410); context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto finishrain; context.al = context.ds.byte(context.bx+1); context.ah = 0; - context._add(context.ax, context.data.word(119)); - context._add(context.ax, context.data.word(127)); + context._add(context.ax, context.data.word(117)); + context._add(context.ax, context.data.word(125)); context.cx = 320; context._mul(context.cx); context.cl = context.ds.byte(context.bx); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(117)); - context._add(context.ax, context.data.word(125)); + context._add(context.ax, context.data.word(115)); + context._add(context.ax, context.data.word(123)); context.di = context.ax; context.cl = context.ds.byte(context.bx+2); context.ch = 0; @@ -3181,7 +3181,7 @@ morerain: context._add(context.bx, 6); context.push(context.si); context._add(context.si, context.ax); - context.es = context.data.word(400); + context.es = context.data.word(398); context.ah = 0; context.dx = 320-2; rainloop: @@ -3199,20 +3199,20 @@ noplot: context.si = context.pop(); goto morerain; finishrain: - context._cmp(context.data.word(521), 0); + context._cmp(context.data.word(519), 0); if (!context.flags.z()) goto nothunder; - context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(183), 2); if (!context.flags.z()) goto notlouisthund; - context._cmp(context.data.byte(45), 1); + context._cmp(context.data.byte(44), 1); if (!context.flags.z()) goto nothunder; notlouisthund: - context._cmp(context.data.byte(184), 55); + context._cmp(context.data.byte(183), 55); if (context.flags.z()) goto nothunder; randomnum1(context); context._cmp(context.al, 1); if (!context.flags.c()) goto nothunder; context.al = 7; - context._cmp(context.data.byte(507), 6); + context._cmp(context.data.byte(506), 6); if (context.flags.z()) goto isthunder1; context.al = 4; isthunder1: @@ -3222,7 +3222,7 @@ nothunder: } static void backobject(Context & context) { - context.ds = context.data.word(428); + context.ds = context.data.word(426); context.di = context.ds.word(context.bx+20); context.al = context.ds.byte(context.bx+18); context._cmp(context.al, 0); @@ -3270,7 +3270,7 @@ finishback: } static void liftsprite(Context & context) { - context.al = context.data.byte(35); + context.al = context.data.byte(34); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; context._cmp(context.al, 1); @@ -3289,7 +3289,7 @@ static void liftsprite(Context & context) { context.ax = context.pop(); goto pokelift; finishclose: - context.data.byte(35) = 0; + context.data.byte(34) = 0; return; openlift: context.al = context.ds.byte(context.bx+19); @@ -3313,46 +3313,46 @@ pokelift: context.ds.byte(context.di+17) = context.al; return; endoflist: - context.data.byte(35) = 1; + context.data.byte(34) = 1; return; liftopen: - context.al = context.data.byte(36); + context.al = context.data.byte(35); context.push(context.es); context.push(context.bx); turnpathon(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(40), 0); + context._cmp(context.data.byte(39), 0); if (context.flags.z()) goto nocountclose; - context._sub(context.data.byte(40), 1); - context._cmp(context.data.byte(40), 0); + context._sub(context.data.byte(39), 1); + context._cmp(context.data.byte(39), 0); if (!context.flags.z()) goto nocountclose; - context.data.byte(35) = 2; + context.data.byte(34) = 2; nocountclose: context.al = 12; goto pokelift; liftclosed: - context.al = context.data.byte(36); + context.al = context.data.byte(35); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(39), 0); + context._cmp(context.data.byte(38), 0); if (context.flags.z()) goto nocountopen; - context._sub(context.data.byte(39), 1); - context._cmp(context.data.byte(39), 0); + context._sub(context.data.byte(38), 1); + context._cmp(context.data.byte(38), 0); if (!context.flags.z()) goto nocountopen; - context.data.byte(35) = 3; + context.data.byte(34) = 3; nocountopen: context.al = 0; goto pokelift; } static void liftnoise(Context & context) { - context._cmp(context.data.byte(184), 5); + context._cmp(context.data.byte(183), 5); if (context.flags.z()) goto hissnoise; - context._cmp(context.data.byte(184), 21); + context._cmp(context.data.byte(183), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); return; @@ -3400,52 +3400,52 @@ gotconst: } static void doorway(Context & context) { - context.data.byte(193) = -24; - context.data.byte(194) = 10; - context.data.byte(195) = -30; - context.data.byte(196) = 10; + context.data.byte(192) = -24; + context.data.byte(193) = 10; + context.data.byte(194) = -30; + context.data.byte(195) = 10; dodoor(context); return; } static void widedoor(Context & context) { - context.data.byte(193) = -24; - context.data.byte(194) = 24; - context.data.byte(195) = -30; - context.data.byte(196) = 24; + context.data.byte(192) = -24; + context.data.byte(193) = 24; + context.data.byte(194) = -30; + context.data.byte(195) = 24; dodoor(context); return; } static void dodoor(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); + context.al = context.data.byte(150); + context.ah = context.data.byte(151); context.cl = context.ds.byte(context.bx+10); context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor; context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(193)); + context._cmp(context.al, context.data.byte(192)); if (!context.flags.c()) goto upordown; goto shutdoor; rtofdoor: context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(194)); + context._cmp(context.al, context.data.byte(193)); if (!context.flags.c()) goto shutdoor; upordown: context._cmp(context.ah, context.ch); if (!context.flags.c()) goto botofdoor; context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(195)); + context._cmp(context.ah, context.data.byte(194)); if (context.flags.c()) goto shutdoor; goto opendoor; botofdoor: context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(196)); + context._cmp(context.ah, context.data.byte(195)); if (!context.flags.c()) goto shutdoor; opendoor: context.cl = context.ds.byte(context.bx+19); - context._cmp(context.data.byte(61), 1); + context._cmp(context.data.byte(60), 1); if (!context.flags.z()) goto notthrough; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough; @@ -3455,7 +3455,7 @@ notthrough: context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound2; context.al = 0; - context._cmp(context.data.byte(184), 5); + context._cmp(context.data.byte(183), 5); if (!context.flags.z()) goto nothoteldoor2; context.al = 13; nothoteldoor2: @@ -3475,14 +3475,14 @@ atlast1: context.di = context.pop(); context.ds.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - context.data.byte(61) = 1; + context.data.byte(60) = 1; return; shutdoor: context.cl = context.ds.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(184), 5); + context._cmp(context.data.byte(183), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3502,14 +3502,14 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(61) = 0; + context.data.byte(60) = 0; notnearly: return; } static void lockeddoorway(Context & context) { - context.al = context.data.byte(151); - context.ah = context.data.byte(152); + context.al = context.data.byte(150); + context.ah = context.data.byte(151); context.cl = context.ds.byte(context.bx+10); context.ch = context.ds.byte(context.bx+11); context._cmp(context.al, context.cl); @@ -3534,9 +3534,9 @@ botofdoor2: context._cmp(context.ah, 12); if (!context.flags.c()) goto shutdoor2; opendoor2: - context._cmp(context.data.byte(61), 1); + context._cmp(context.data.byte(60), 1); if (context.flags.z()) goto mustbeopen; - context._cmp(context.data.byte(37), 1); + context._cmp(context.data.byte(36), 1); if (context.flags.z()) goto shutdoor; mustbeopen: context.cl = context.ds.byte(context.bx+19); @@ -3547,7 +3547,7 @@ mustbeopen: notdoorsound4: context._cmp(context.cl, 6); if (!context.flags.z()) goto noturnonyet; - context.al = context.data.byte(38); + context.al = context.data.byte(37); context.push(context.es); context.push(context.bx); turnpathon(context); @@ -3555,7 +3555,7 @@ notdoorsound4: context.es = context.pop(); noturnonyet: context.cl = context.ds.byte(context.bx+19); - context._cmp(context.data.byte(61), 1); + context._cmp(context.data.byte(60), 1); if (!context.flags.z()) goto notthrough2; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough2; @@ -3578,7 +3578,7 @@ atlast3: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto justshutting; - context.data.byte(61) = 1; + context.data.byte(60) = 1; justshutting: return; shutdoor2: @@ -3594,7 +3594,7 @@ notdoorsound3: context.ds.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; - context.data.byte(61) = 0; + context.data.byte(60) = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); @@ -3603,13 +3603,13 @@ atlast4: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) goto notlocky; - context.al = context.data.byte(38); + context.al = context.data.byte(37); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(37) = 1; + context.data.byte(36) = 1; notlocky: return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ @@ -3618,7 +3618,7 @@ shutdoor: context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(184), 5); + context._cmp(context.data.byte(183), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3638,33 +3638,33 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(61) = 0; + context.data.byte(60) = 0; notnearly: return; return; } static void updatepeople(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.data.word(18) = context.di; + context.data.word(16) = context.di; context.cx = 12*5; context.al = 255; while(--context.cx) context._stosb(); - context._add(context.data.word(138), 1); + context._add(context.data.word(136), 1); context.es = context.cs; - context.bx = 537; - context.di = 1003; + context.bx = 534; + context.di = 991; updateloop: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endupdate; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto notinthisroom; context.cx = context.ds.word(context.bx+1); - context._cmp(context.cl, context.data.byte(148)); + context._cmp(context.cl, context.data.byte(147)); if (!context.flags.z()) goto notinthisroom; - context._cmp(context.ch, context.data.byte(149)); + context._cmp(context.ch, context.data.byte(148)); if (!context.flags.z()) goto notinthisroom; context.push(context.di); context.ax = context.ds.word(context.di); @@ -3680,12 +3680,12 @@ endupdate: static void getreelframeax(Context & context) { context.push(context.ds); - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; findsource(context); context.es = context.ds; context.ds = context.pop(); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.data.word(158); + context._sub(context.ax, context.data.word(242)); context._add(context.ax, context.ax); context.cx = context.ax; context._add(context.ax, context.ax); @@ -3714,7 +3714,7 @@ retryreel: context._cmp(context.al, 255); if (context.flags.z()) goto normalreel; dealwithspecial(context); - context._add(context.data.word(239), 1); + context._add(context.data.word(237), 1); context.si = context.pop(); context.es = context.pop(); context._add(context.si, 40); @@ -3742,21 +3742,21 @@ notplot: } static void soundonreels(Context & context) { - context.bl = context.data.byte(184); + context.bl = context.data.byte(183); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); - context._add(context.bx, 1254); + context._add(context.bx, 1214); context.si = context.ds.word(context.bx); reelsoundloop: context.al = context.ds.byte(context.si); context._cmp(context.al, 255); if (context.flags.z()) goto endreelsound; context.ax = context.ds.word(context.si+1); - context._cmp(context.ax, context.data.word(239)); + context._cmp(context.ax, context.data.word(237)); if (!context.flags.z()) goto skipreelsound; - context._cmp(context.ax, context.data.word(351)); + context._cmp(context.ax, context.data.word(349)); if (context.flags.z()) goto skipreelsound; - context.data.word(351) = context.ax; + context.data.word(349) = context.ax; context.al = context.ds.byte(context.si); context._cmp(context.al, 64); if (context.flags.c()) { playchannel1(context); return; }; @@ -3773,26 +3773,26 @@ skipreelsound: context._add(context.si, 3); goto reelsoundloop; endreelsound: - context.ax = context.data.word(351); - context._cmp(context.ax, context.data.word(239)); + context.ax = context.data.word(349); + context._cmp(context.ax, context.data.word(237)); if (context.flags.z()) goto nochange2; - context.data.word(351) = -1; + context.data.word(349) = -1; nochange2: return; } static void reconstruct(Context & context) { - context._cmp(context.data.byte(130), 0); + context._cmp(context.data.byte(129), 0); if (context.flags.z()) goto noneedtorecon; - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); spriteupdate(context); printsprites(context); - context._cmp(context.data.byte(184), 20); + context._cmp(context.data.byte(183), 20); if (!context.flags.z()) goto notfudge; undertextline(context); notfudge: - context.data.byte(130) = 0; + context.data.byte(129) = 0; noneedtorecon: return; } @@ -3803,28 +3803,28 @@ static void dealwithspecial(Context & context) { if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); - context.data.byte(130) = 1; + context.data.byte(129) = 1; return; notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); - context.data.byte(130) = 1; + context.data.byte(129) = 1; return; notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); - context.data.byte(130) = 1; + context.data.byte(129) = 1; return; notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); - context.data.byte(130) = 1; + context.data.byte(129) = 1; return; notremfree: context._cmp(context.al, 4); @@ -3834,14 +3834,14 @@ notremfree: notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; - context.data.byte(135) = context.ah; - context.data.byte(133) = context.ah; + context.data.byte(134) = context.ah; + context.data.byte(132) = context.ah; switchryanon(context); return; notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; - context.data.byte(188) = context.ah; + context.data.byte(187) = context.ah; return; notchangeloc: movemap(context); @@ -3851,38 +3851,38 @@ notchangeloc: static void movemap(Context & context) { context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; - context._sub(context.data.byte(149), 20); - context.data.byte(186) = 1; + context._sub(context.data.byte(148), 20); + context.data.byte(185) = 1; return; notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; - context._sub(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._sub(context.data.byte(148), 10); + context.data.byte(185) = 1; return; notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; - context._add(context.data.byte(149), 10); - context.data.byte(186) = 1; + context._add(context.data.byte(148), 10); + context.data.byte(185) = 1; return; notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; - context._add(context.data.byte(148), 11); - context.data.byte(186) = 1; + context._add(context.data.byte(147), 11); + context.data.byte(185) = 1; return; notmaprightspec: - context._sub(context.data.byte(148), 11); - context.data.byte(186) = 1; + context._sub(context.data.byte(147), 11); + context.data.byte(185) = 1; return; } static void getreelstart(Context & context) { - context.ax = context.data.word(239); + context.ax = context.data.word(237); context.cx = 40; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.data.word(448); context.si = context.ax; context._add(context.si, 0+(36*144)); return; @@ -3892,37 +3892,37 @@ static void showreelframe(Context & context) { context.al = context.ds.byte(context.si+2); context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); + context._add(context.di, context.data.word(115)); context.al = context.ds.byte(context.si+3); context.bx = context.ax; - context._add(context.bx, context.data.word(119)); + context._add(context.bx, context.data.word(117)); context.ax = context.ds.word(context.si); - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.data.word(158); + context._sub(context.ax, context.data.word(242)); context.ah = 8; showframe(context); return; } static void deleverything(Context & context) { - context.al = context.data.byte(129); + context.al = context.data.byte(128); context.ah = 0; - context._add(context.ax, context.data.word(123)); + context._add(context.ax, context.data.word(121)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); return; bigroom: - context._sub(context.data.byte(129), 8); + context._sub(context.data.byte(128), 8); maptopanel(context); - context._add(context.data.byte(129), 8); + context._add(context.data.byte(128), 8); return; } static void dumpeverything(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.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); dumpevery1: context.ax = context.ds.word(context.bx); @@ -3941,8 +3941,8 @@ notskip1: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.data.word(115)); + context._add(context.bx, context.data.word(117)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3964,8 +3964,8 @@ dumpevery2: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.data.word(115)); + context._add(context.bx, context.data.word(117)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3979,7 +3979,7 @@ finishevery2: static void allocatework(Context & context) { context.bx = 0x1000; allocatemem(context); - context.data.word(400) = context.ax; + context.data.word(398) = context.ax; return; } @@ -4004,23 +4004,23 @@ notendblock: } static void loadpalfromiff(Context & context) { - context.dx = 2494; + context.dx = 2481; openfile(context); context.cx = 2000; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.dx = 0; readfromfile(context); closefile(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0x30; context.cx = 768; palloop: context._lodsb(); context._shr(context.al, 1); context._shr(context.al, 1); - context._cmp(context.data.byte(73), 1); + context._cmp(context.data.byte(72), 1); if (!context.flags.z()) goto nought; context._cmp(context.al, 0); if (context.flags.z()) goto nought; @@ -4051,7 +4051,7 @@ static void cls(Context & context) { static void printundermon(Context & context) { context.si = (320*43)+76; context.di = context.si; - context.es = context.data.word(400); + context.es = context.data.word(398); context._add(context.si, 8*320); context.dx = 0x0a000; context.ds = context.dx; @@ -4087,7 +4087,7 @@ static void worktoscreen(Context & context) { context.si = 0; context.di = 0; context.cx = 25; - context.ds = context.data.word(400); + context.ds = context.data.word(398); context.dx = 0x0a000; context.es = context.dx; dumpallloop: @@ -4104,38 +4104,38 @@ dumpallloop: } static void paneltomap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); + context.di = context.data.word(123); + context._add(context.di, context.data.word(115)); + context.bx = context.data.word(125); + context._add(context.bx, context.data.word(117)); + context.ds = context.data.word(400); context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.cl = context.data.byte(127); + context.ch = context.data.byte(128); multiget(context); return; } static void maptopanel(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.ds = context.data.word(402); + context.di = context.data.word(123); + context._add(context.di, context.data.word(115)); + context.bx = context.data.word(125); + context._add(context.bx, context.data.word(117)); + context.ds = context.data.word(400); context.si = 0; - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.cl = context.data.byte(127); + context.ch = context.data.byte(128); multiput(context); return; } static void dumpmap(Context & context) { - context.di = context.data.word(125); - context._add(context.di, context.data.word(117)); - context.bx = context.data.word(127); - context._add(context.bx, context.data.word(119)); - context.cl = context.data.byte(128); - context.ch = context.data.byte(129); + context.di = context.data.word(123); + context._add(context.di, context.data.word(115)); + context.bx = context.data.word(125); + context._add(context.bx, context.data.word(117)); + context.cl = context.data.byte(127); + context.ch = context.data.byte(128); multidump(context); return; } @@ -4151,7 +4151,7 @@ static void pixelcheckset(Context & context) { context.al = context.ds.byte(context.bx+4); getsetad(context); context.al = context.ds.byte(context.bx+17); - context.es = context.data.word(444); + context.es = context.data.word(442); context.bx = 0; context.ah = 0; context.cx = 6; @@ -4183,25 +4183,25 @@ static void pixelcheckset(Context & context) { static void createpanel(Context & context) { context.di = 0; context.bx = 8; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 8; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 0; context.ah = 2; showframe(context); context.di = 0; context.bx = 104; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 104; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 0; context.ah = 2; showframe(context); @@ -4212,13 +4212,13 @@ static void createpanel2(Context & context) { createpanel(context); context.di = 0; context.bx = 0; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 5; context.ah = 2; showframe(context); context.di = 160; context.bx = 0; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.al = 5; context.ah = 2; showframe(context); @@ -4227,7 +4227,7 @@ static void createpanel2(Context & context) { static void clearwork(Context & context) { context.ax = 0x0; - context.es = context.data.word(400); + context.es = context.data.word(398); context.di = 0; context.cx = (200*320)/64; clearloop: @@ -4268,24 +4268,24 @@ clearloop: } static void zoom(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto inwatching; - context._cmp(context.data.byte(8), 1); + context._cmp(context.data.byte(7), 1); if (context.flags.z()) goto zoomswitch; inwatching: return; zoomswitch: - context._cmp(context.data.byte(100), 199); + context._cmp(context.data.byte(99), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); return; zoomit: - context.ax = context.data.word(222); + context.ax = context.data.word(220); context._sub(context.ax, 9); context.cx = 320; context._mul(context.cx); - context._add(context.ax, context.data.word(220)); + context._add(context.ax, context.data.word(218)); context._sub(context.ax, 11); context.si = context.ax; context.ax = 132+4; @@ -4293,8 +4293,8 @@ zoomit: context._mul(context.cx); context._add(context.ax, 8+5); context.di = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(400); + context.es = context.data.word(398); + context.ds = context.data.word(398); context.cx = 20; zoomloop: context.push(context.cx); @@ -4310,7 +4310,7 @@ zoomloop2: context.cx = context.pop(); if (--context.cx) goto zoomloop; crosshair(context); - context.data.byte(75) = 1; + context.data.byte(74) = 1; return; } @@ -4319,12 +4319,12 @@ static void delthisone(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context._add(context.ax, context.data.word(119)); + context._add(context.ax, context.data.word(117)); context.bx = 320; context._mul(context.bx); context.bx = context.pop(); context.bh = 0; - context._add(context.bx, context.data.word(117)); + context._add(context.bx, context.data.word(115)); context._add(context.ax, context.bx); context.di = context.ax; context.ax = context.pop(); @@ -4337,8 +4337,8 @@ static void delthisone(Context & context) { context.bh = 0; context._add(context.ax, context.bx); context.si = context.ax; - context.es = context.data.word(400); - context.ds = context.data.word(402); + context.es = context.data.word(398); + context.ds = context.data.word(400); context.dl = context.cl; context.dh = 0; context.ax = 320; @@ -4362,7 +4362,7 @@ static void multiget(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(400); + context.es = context.data.word(398); context.es = context.ds; context.ds = context.es; context._xchg(context.di, context.si); @@ -4406,7 +4406,7 @@ static void multiput(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(400); + context.es = context.data.word(398); context.al = context.cl; context.ah = 0; context.dx = 320; @@ -4445,7 +4445,7 @@ multiloop6: static void multidump(Context & context) { context.dx = 0x0a000; context.es = context.dx; - context.ds = context.data.word(400); + context.ds = context.data.word(398); context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4727,17 +4727,17 @@ static void width160(Context & context) { } static void doblocks(Context & context) { - context.es = context.data.word(400); - context.ax = context.data.word(119); + context.es = context.data.word(398); + context.ax = context.data.word(117); context.cx = 320; context._mul(context.cx); - context.di = context.data.word(117); + context.di = context.data.word(115); context._add(context.di, context.ax); - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ah = 0; context.bx = 66; context._mul(context.bx); - context.bl = context.data.byte(148); + context.bl = context.data.byte(147); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -4750,9 +4750,9 @@ loop120: loop124: context.push(context.cx); context.push(context.di); - context.ds = context.data.word(418); - context._lodsb(); context.ds = context.data.word(416); + context._lodsb(); + context.ds = context.data.word(414); context.push(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto zeroblock; @@ -4896,9 +4896,9 @@ notdiffdest: if (context.flags.z()) goto notprintlist; context.push(context.ax); context.ax = context.di; - context._sub(context.ax, context.data.word(117)); + context._sub(context.ax, context.data.word(115)); context.push(context.bx); - context._sub(context.bx, context.data.word(119)); + context._sub(context.bx, context.data.word(117)); context.ah = context.bl; context.bx = context.pop(); context.ax = context.pop(); @@ -4906,7 +4906,7 @@ notprintlist: context._test(context.ah, 4); if (context.flags.z()) goto notflippedx; context.dx = 320; - context.es = context.data.word(400); + context.es = context.data.word(398); context.push(context.cx); frameoutfx(context); context.cx = context.pop(); @@ -4915,7 +4915,7 @@ notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; context.dx = 320; - context.es = context.data.word(400); + context.es = context.data.word(398); context.push(context.cx); frameoutnm(context); context.cx = context.pop(); @@ -4924,14 +4924,14 @@ notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; context.dx = 320; - context.es = context.data.word(400); + context.es = context.data.word(398); context.push(context.cx); frameoutbh(context); context.cx = context.pop(); return; noeffects: context.dx = 320; - context.es = context.data.word(400); + context.es = context.data.word(398); context.push(context.cx); frameoutv(context); context.cx = context.pop(); @@ -5095,9 +5095,9 @@ backtosolidfx: } static void transferinv(Context & context) { - context.di = context.data.word(12); + context.di = context.data.word(10); context.push(context.di); - context.al = context.data.byte(10); + context.al = context.data.byte(9); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5105,12 +5105,12 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(398); + context.es = context.data.word(396); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(90); + context.al = context.data.byte(89); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5118,7 +5118,7 @@ static void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(446); + context.ds = context.data.word(444); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5139,33 +5139,33 @@ static void transferinv(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context._add(context.data.word(10), context.cx); return; } static void transfermap(Context & context) { - context.di = context.data.word(12); + context.di = context.data.word(10); context.push(context.di); - context.al = context.data.byte(10); + context.al = context.data.byte(9); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(398); + context.es = context.data.word(396); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(90); + context.al = context.data.byte(89); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(446); + context.ds = context.data.word(444); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5186,26 +5186,26 @@ static void transfermap(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.ds.word(context.bx+2) = context.ax; - context._add(context.data.word(12), context.cx); + context._add(context.data.word(10), context.cx); return; } static void dofade(Context & context) { - context._cmp(context.data.byte(344), 0); + context._cmp(context.data.byte(343), 0); if (context.flags.z()) goto finishfade; - context.cl = context.data.byte(345); + context.cl = context.data.byte(344); context.ch = 0; - context.al = context.data.byte(343); + context.al = context.data.byte(342); context.ah = 0; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); showgroup(context); - context.al = context.data.byte(345); - context._add(context.al, context.data.byte(343)); - context.data.byte(343) = context.al; + context.al = context.data.byte(344); + context._add(context.al, context.data.byte(342)); + context.data.byte(342) = context.al; context._cmp(context.al, 0); if (!context.flags.z()) goto finishfade; fadecalculation(context); @@ -5214,7 +5214,7 @@ finishfade: } static void clearendpal(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 0; @@ -5223,7 +5223,7 @@ static void clearendpal(Context & context) { } static void clearpalette(Context & context) { - context.data.byte(344) = 0; + context.data.byte(343) = 0; clearstartpal(context); dumpcurrent(context); return; @@ -5232,15 +5232,15 @@ static void clearpalette(Context & context) { static void fadescreenup(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; return; } static void fadetowhite(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 63; @@ -5251,15 +5251,15 @@ static void fadetowhite(Context & context) { context._stosb(); context._stosb(); paltostartpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; return; } static void fadefromwhite(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768; context.al = 63; @@ -5270,20 +5270,20 @@ static void fadefromwhite(Context & context) { context._stosb(); context._stosb(); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; return; } static void fadescreenups(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 64; return; } @@ -5291,7 +5291,7 @@ static void fadescreendownhalf(Context & context) { paltostartpal(context); paltoendpal(context); context.cx = 768; - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; halfend: context.al = context.ds.byte(context.bx); @@ -5299,8 +5299,8 @@ halfend: context.ds.byte(context.bx) = context.al; context._add(context.bx, 1); if (--context.cx) goto halfend; - context.ds = context.data.word(412); - context.es = context.data.word(412); + context.ds = context.data.word(410); + context.es = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); context.cx = 3*5; @@ -5309,45 +5309,45 @@ halfend: context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); context.cx = 3*2; while(--context.cx) context._movsb(); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; + context.data.byte(343) = 1; + context.data.byte(345) = 31; + context.data.byte(342) = 0; + context.data.byte(344) = 32; return; } static void fadescreenuphalf(Context & context) { endpaltostart(context); paltoendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 31; - context.data.byte(343) = 0; - context.data.byte(345) = 32; + context.data.byte(343) = 1; + context.data.byte(345) = 31; + context.data.byte(342) = 0; + context.data.byte(344) = 32; return; } static void fadescreendown(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; return; } static void fadescreendowns(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 64; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 64; return; } static void clearstartpal(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 256; wholeloop1: @@ -5360,39 +5360,39 @@ wholeloop1: } static void showgun(Context & context) { - context.data.byte(348) = 0; context.data.byte(347) = 0; - context.data.byte(349) = 0; + context.data.byte(346) = 0; + context.data.byte(348) = 0; paltostartpal(context); paltoendpal(context); greyscalesum(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 130; hangon(context); endpaltostart(context); clearendpal(context); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 200; hangon(context); - context.data.byte(531) = 34; + context.data.byte(530) = 34; loadroomssample(context); - context.data.byte(386) = 0; - context.dx = 2364; + context.data.byte(385) = 0; + context.dx = 2351; loadintotemp(context); createpanel2(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 0; context.ah = 0; context.di = 100; context.bx = 4; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 1; context.ah = 0; context.di = 158; @@ -5406,7 +5406,7 @@ static void showgun(Context & context) { context.al = 12; context.ah = 0; playchannel0(context); - context.dx = 2273; + context.dx = 2260; loadtemptext(context); rollendcredits2(context); getridoftemptext(context); @@ -5423,10 +5423,10 @@ static void rollem(Context & context) { context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiget(context); - context.es = context.data.word(466); + context.es = context.data.word(464); context.si = 49*2; context.ax = context.ds.word(context.si); context.si = context.ax; @@ -5435,7 +5435,7 @@ static void rollem(Context & context) { endcredits21: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(77); + context.cx = context.data.word(75); endcredits22: context.push(context.cx); context.push(context.si); @@ -5447,7 +5447,7 @@ endcredits22: context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiput(context); vsync(context); @@ -5466,7 +5466,7 @@ onelot2: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.data.word(75)); context.cx = context.pop(); if (--context.cx) goto onelot2; vsync(context); @@ -5480,7 +5480,7 @@ onelot2: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto endearly2; context._sub(context.bx, 1); if (--context.cx) goto endcredits22; @@ -5494,7 +5494,7 @@ looknext2: if (context.flags.z()) goto gotnext2; goto looknext2; gotnext2: - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto endearly; if (--context.cx) goto endcredits21; context.cx = 120; @@ -5507,10 +5507,10 @@ endearly: } static void fadecalculation(Context & context) { - context._cmp(context.data.byte(346), 0); + context._cmp(context.data.byte(345), 0); if (context.flags.z()) goto nomorefading; - context.bl = context.data.byte(346); - context.es = context.data.word(412); + context.bl = context.data.byte(345); + context.es = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; @@ -5532,15 +5532,15 @@ gotthere: context._add(context.si, 1); context._add(context.di, 1); if (--context.cx) goto fadecolloop; - context._sub(context.data.byte(346), 1); + context._sub(context.data.byte(345), 1); return; nomorefading: - context.data.byte(344) = 0; + context.data.byte(343) = 0; return; } static void greyscalesum(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 256; @@ -5569,19 +5569,19 @@ greysumloop2: if (!context.flags.c()) goto greysumloop2; context.bl = context.al; context.al = context.bl; - context.ah = context.data.byte(348); + context.ah = context.data.byte(347); context._cmp(context.al, 0); context._add(context.al, context.ah); noaddr: context._stosb(); - context.ah = context.data.byte(347); + context.ah = context.data.byte(346); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddg; context._add(context.al, context.ah); noaddg: context._stosb(); - context.ah = context.data.byte(349); + context.ah = context.data.byte(348); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddb; @@ -5595,8 +5595,8 @@ noaddb: } static void paltostartpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.data.word(410); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5605,8 +5605,8 @@ static void paltostartpal(Context & context) { } static void endpaltostart(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.data.word(410); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5615,8 +5615,8 @@ static void endpaltostart(Context & context) { } static void startpaltoend(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.data.word(410); + context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5625,8 +5625,8 @@ static void startpaltoend(Context & context) { } static void paltoendpal(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.data.word(410); + context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5635,8 +5635,8 @@ static void paltoendpal(Context & context) { } static void allpalette(Context & context) { - context.es = context.data.word(412); - context.ds = context.data.word(412); + context.es = context.data.word(410); + context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5647,7 +5647,7 @@ static void allpalette(Context & context) { static void dumpcurrent(Context & context) { context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.ds = context.data.word(412); + context.ds = context.data.word(410); vsync(context); context.al = 0; context.cx = 128; @@ -5662,7 +5662,7 @@ static void dumpcurrent(Context & context) { static void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5670,10 +5670,10 @@ static void fadedownmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 64; hangon(context); return; @@ -5682,7 +5682,7 @@ static void fadedownmon(Context & context) { static void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5690,10 +5690,10 @@ static void fadeupmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 128; hangon(context); return; @@ -5702,7 +5702,7 @@ static void fadeupmon(Context & context) { static void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5710,10 +5710,10 @@ static void fadeupmonfirst(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 64; hangon(context); context.al = 26; @@ -5725,7 +5725,7 @@ static void fadeupmonfirst(Context & context) { static void fadeupyellows(Context & context) { paltoendpal(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5733,10 +5733,10 @@ static void fadeupyellows(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(344) = 1; - context.data.byte(346) = 63; - context.data.byte(343) = 0; - context.data.byte(345) = 128; + context.data.byte(343) = 1; + context.data.byte(345) = 63; + context.data.byte(342) = 0; + context.data.byte(344) = 128; context.cx = 128; hangon(context); return; @@ -5744,7 +5744,7 @@ static void fadeupyellows(Context & context) { static void initialmoncols(Context & context) { paltostartpal(context); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.cx = 3*9; context.ax = 0; @@ -5752,7 +5752,7 @@ static void initialmoncols(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.al = 230; context.cx = 18; @@ -5768,29 +5768,29 @@ static void titles(Context & context) { } static void endgame(Context & context) { - context.dx = 2273; + context.dx = 2260; loadtemptext(context); monkspeaking(context); gettingshot(context); getridoftemptext(context); - context.data.byte(387) = 7; - context.data.byte(388) = 1; + context.data.byte(386) = 7; + context.data.byte(387) = 1; context.cx = 200; hangon(context); return; } static void monkspeaking(Context & context) { - context.data.byte(531) = 35; + context.data.byte(530) = 35; loadroomssample(context); - context.dx = 2377; + context.dx = 2364; loadintotemp(context); clearwork(context); showmonk(context); worktoscreen(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.data.byte(385) = 7; + context.data.byte(387) = -1; + context.data.byte(386) = 0; context.al = 12; context.ah = 255; playchannel0(context); @@ -5803,7 +5803,7 @@ nextmonkspeak: context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(466); + context.es = context.data.word(464); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -5829,8 +5829,8 @@ nextbit: context._add(context.al, 1); context._cmp(context.al, 44); if (!context.flags.z()) goto nextmonkspeak; - context.data.byte(388) = 1; - context.data.byte(387) = 7; + context.data.byte(387) = 1; + context.data.byte(386) = 7; fadescreendowns(context); context.cx = 300; hangon(context); @@ -5843,18 +5843,18 @@ static void showmonk(Context & context) { context.ah = 128; context.di = 160; context.bx = 72; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); return; } static void gettingshot(Context & context) { - context.data.byte(188) = 55; + context.data.byte(187) = 55; clearpalette(context); loadintroroom(context); fadescreenups(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; + context.data.byte(386) = 0; + context.data.byte(387) = -1; runendseq(context); clearbeforeload(context); return; @@ -5868,7 +5868,7 @@ static void credits(Context & context) { static void biblequote(Context & context) { mode640x480(context); - context.dx = 2390; + context.dx = 2377; showpcx(context); fadescreenups(context); context.cx = 80; @@ -5887,7 +5887,7 @@ hangonloope: context.push(context.cx); vsync(context); context.cx = context.pop(); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; return; @@ -5898,32 +5898,32 @@ hangonearly: } static void intro(Context & context) { - context.dx = 2260; + context.dx = 2247; loadtemptext(context); loadpalfromiff(context); setmode(context); - context.data.byte(188) = 50; + context.data.byte(187) = 50; clearpalette(context); loadintroroom(context); - context.data.byte(386) = 7; - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.data.byte(385) = 7; + context.data.byte(387) = -1; + context.data.byte(386) = 0; context.al = 12; context.ah = 255; playchannel0(context); fadescreenups(context); runintroseq(context); clearbeforeload(context); - context.data.byte(188) = 52; + context.data.byte(187) = 52; loadintroroom(context); runintroseq(context); clearbeforeload(context); - context.data.byte(188) = 53; + context.data.byte(187) = 53; loadintroroom(context); runintroseq(context); clearbeforeload(context); allpalette(context); - context.data.byte(188) = 54; + context.data.byte(187) = 54; loadintroroom(context); runintroseq(context); getridoftemptext(context); @@ -5932,14 +5932,14 @@ static void intro(Context & context) { } static void runintroseq(Context & context) { - context.data.byte(103) = 0; + context.data.byte(102) = 0; moreintroseq: vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto earlyendrun; spriteupdate(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto earlyendrun; deleverything(context); printsprites(context); @@ -5947,14 +5947,14 @@ moreintroseq: afterintroroom(context); usetimedtext(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto earlyendrun; dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(392), 1); + context._cmp(context.data.byte(391), 1); if (context.flags.z()) goto earlyendrun; - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto moreintroseq; return; earlyendrun: @@ -5967,7 +5967,7 @@ earlyendrun: static void runendseq(Context & context) { atmospheres(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; moreendseq: vsync(context); spriteupdate(context); @@ -5981,23 +5981,23 @@ moreendseq: dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto moreendseq; return; } static void loadintroroom(Context & context) { - context.data.byte(139) = 0; - context.data.byte(9) = 255; + context.data.byte(138) = 0; + context.data.byte(8) = 255; loadroom(context); - context.data.word(121) = 72; - context.data.word(123) = 16; + context.data.word(119) = 72; + context.data.word(121) = 16; clearsprites(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; + context.data.byte(60) = 0; + context.data.byte(141) = '0'; + context.data.byte(104) = 0; clearwork(context); - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); @@ -6007,13 +6007,13 @@ static void loadintroroom(Context & context) { } static void realcredits(Context & context) { - context.data.byte(531) = 33; + context.data.byte(530) = 33; loadroomssample(context); - context.data.byte(386) = 0; + context.data.byte(385) = 0; mode640x480(context); context.cx = 35; hangon(context); - context.dx = 2403; + context.dx = 2390; showpcx(context); context.al = 12; context.ah = 0; @@ -6026,7 +6026,7 @@ static void realcredits(Context & context) { fadescreendowns(context); context.cx = 256; hangone(context); - context.dx = 2416; + context.dx = 2403; showpcx(context); context.al = 12; context.ah = 0; @@ -6039,7 +6039,7 @@ static void realcredits(Context & context) { fadescreendowns(context); context.cx = 256; hangone(context); - context.dx = 2429; + context.dx = 2416; showpcx(context); context.al = 12; context.ah = 0; @@ -6052,7 +6052,7 @@ static void realcredits(Context & context) { fadescreendowns(context); context.cx = 256; hangone(context); - context.dx = 2442; + context.dx = 2429; showpcx(context); context.al = 12; context.ah = 0; @@ -6065,7 +6065,7 @@ static void realcredits(Context & context) { fadescreendowns(context); context.cx = 256; hangone(context); - context.dx = 2455; + context.dx = 2442; showpcx(context); context.al = 12; context.ah = 0; @@ -6078,7 +6078,7 @@ static void realcredits(Context & context) { fadescreendowns(context); context.cx = 256; hangone(context); - context.dx = 2468; + context.dx = 2455; showpcx(context); fadescreenups(context); context.cx = 60; @@ -6104,13 +6104,13 @@ static void printchar(Context & context) { context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.data.word(69)); showframe(context); context.ax = context.pop(); context.di = context.pop(); context.bx = context.pop(); context.si = context.pop(); - context._cmp(context.data.byte(72), 0); + context._cmp(context.data.byte(71), 0); if (!context.flags.z()) goto nokern; kernchars(context); nokern: @@ -6146,9 +6146,9 @@ kernit: } static void printslow(Context & context) { - context.data.byte(231) = 1; - context.data.byte(234) = 3; - context.ds = context.data.word(404); + context.data.byte(230) = 1; + context.data.byte(233) = 3; + context.ds = context.data.word(402); printloopslow6: context.push(context.bx); context.push(context.di); @@ -6187,9 +6187,9 @@ printloopslow5: context.push(context.es); context.push(context.si); modifychar(context); - context.data.word(71) = 91; + context.data.word(69) = 91; printboth(context); - context.data.word(71) = 0; + context.data.word(69) = 0; context.si = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -6199,14 +6199,14 @@ printloopslow5: waitframes(context); context._cmp(context.ax, 0); if (context.flags.z()) goto keepgoing; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (!context.flags.z()) goto finishslow2; keepgoing: waitframes(context); noslow: context._cmp(context.ax, 0); if (context.flags.z()) goto afterslow; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (!context.flags.z()) goto finishslow2; afterslow: context.es = context.pop(); @@ -6250,7 +6250,7 @@ static void waitframes(Context & context) { vsync(context); dumppointer(context); delpointer(context); - context.ax = context.data.word(202); + context.ax = context.data.word(200); context.ds = context.pop(); context.si = context.pop(); context.es = context.pop(); @@ -6277,8 +6277,8 @@ static void printboth(Context & context) { } static void printdirect(Context & context) { - context.data.word(84) = context.di; - context.ds = context.data.word(268); + context.data.word(82) = context.di; + context.ds = context.data.word(266); printloop6: context.push(context.bx); context.push(context.di); @@ -6296,14 +6296,14 @@ printloop5: context.push(context.es); modifychar(context); printchar(context); - context.data.word(84) = context.di; + context.data.word(82) = context.di; context.es = context.pop(); context.cx = context.pop(); if (--context.cx) goto printloop5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.data.word(75)); goto printloop6; finishdirct: context.dx = context.pop(); @@ -6313,12 +6313,12 @@ finishdirct: } static void monprint(Context & context) { - context.data.byte(72) = 1; + context.data.byte(71) = 1; context.si = context.bx; context.dl = 166; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.data.word(316); + context.bx = context.data.word(318); + context.ds = context.data.word(404); printloop8: context.push(context.bx); context.push(context.di); @@ -6347,9 +6347,9 @@ nottrigger: context.push(context.es); modifychar(context); printchar(context); - context.data.word(312) = context.di; - context.data.word(314) = context.bx; - context.data.word(138) = 1; + context.data.word(310) = context.di; + context.data.word(312) = context.bx; + context.data.word(136) = 1; printcurs(context); vsync(context); context.push(context.si); @@ -6374,7 +6374,7 @@ finishmon2: context.di = context.pop(); context.bx = context.pop(); scrollmonitor(context); - context.data.word(312) = context.di; + context.data.word(310) = context.di; goto printloop8; finishmon: context.dx = context.pop(); @@ -6382,12 +6382,12 @@ finishmon: context.bx = context.pop(); context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger2; - context.data.byte(55) = context.ah; + context.data.byte(54) = context.ah; nottrigger2: - context.data.word(312) = context.di; + context.data.word(310) = context.di; scrollmonitor(context); context.bx = context.si; - context.data.byte(72) = 0; + context.data.byte(71) = 0; return; } @@ -6512,7 +6512,7 @@ getloop: context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(71)); + context._add(context.ax, context.data.word(69)); context._add(context.ax, context.ax); context.si = context.ax; context._add(context.ax, context.ax); @@ -6590,11 +6590,11 @@ nomod: } static void fillryan(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32; findallryan(context); context.si = 0+(228*13)+32; - context.al = context.data.byte(19); + context.al = context.data.byte(18); context.ah = 0; context.cx = 20; context._mul(context.cx); @@ -6641,7 +6641,7 @@ static void fillopen(Context & context) { lessthanapage: context.al = 1; context.push(context.ax); - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13); findallopen(context); context.si = 0+(228*13); @@ -6680,7 +6680,7 @@ static void findallryan(Context & context) { while(--context.cx) context._stosw(); context.di = context.pop(); context.cl = 4; - context.ds = context.data.word(398); + context.ds = context.data.word(396); context.bx = 0+2080+30000; context.ch = 0; findryanloop: @@ -6711,9 +6711,9 @@ static void findallopen(Context & context) { context.ax = 0x0ffff; while(--context.cx) context._stosw(); context.di = context.pop(); - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); - context.ds = context.data.word(398); + context.cl = context.data.byte(109); + context.dl = context.data.byte(110); + context.ds = context.data.word(396); context.bx = 0+2080+30000; context.ch = 0; findopen1: @@ -6721,10 +6721,10 @@ findopen1: if (!context.flags.z()) goto findopen2; context._cmp(context.ds.byte(context.bx+2), context.dl); if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(111), 4); + context._cmp(context.data.byte(110), 4); if (context.flags.z()) goto noloccheck; context.al = context.ds.byte(context.bx+5); - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto findopen2; noloccheck: context.al = context.ds.byte(context.bx+4); @@ -6741,10 +6741,10 @@ findopen2: context._add(context.ch, 1); context._cmp(context.ch, 114); if (!context.flags.z()) goto findopen1; - context.cl = context.data.byte(110); - context.dl = context.data.byte(111); + context.cl = context.data.byte(109); + context.dl = context.data.byte(110); context.push(context.dx); - context.ds = context.data.word(426); + context.ds = context.data.word(424); context.dx = context.pop(); context.bx = 0; context.ch = 0; @@ -6778,7 +6778,7 @@ static void obtoinv(Context & context) { context.push(context.ax); context.push(context.di); context.push(context.bx); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context._sub(context.di, 2); context._sub(context.bx, 1); context.al = 10; @@ -6792,10 +6792,10 @@ static void obtoinv(Context & context) { context.push(context.bx); context.push(context.di); context.push(context.ax); - context.ds = context.data.word(398); + context.ds = context.data.word(396); context._cmp(context.ah, 4); if (context.flags.z()) goto isanextra; - context.ds = context.data.word(446); + context.ds = context.data.word(444); isanextra: context.cl = context.al; context._add(context.al, context.al); @@ -6813,7 +6813,7 @@ isanextra: isitworn(context); context.bx = context.pop(); if (!context.flags.z()) goto finishfill; - context.ds = context.data.word(408); + context.ds = context.data.word(406); context._sub(context.di, 3); context._sub(context.bx, 2); context.al = 7; @@ -6844,18 +6844,18 @@ static void makeworn(Context & context) { } static void examineob(Context & context) { - context.data.byte(234) = 0; - context.data.word(328) = 0; + context.data.byte(233) = 0; + context.data.word(326) = 0; examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; + context.data.byte(236) = 0; + context.data.byte(107) = 0; + context.data.byte(109) = 255; context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; + context.data.byte(103) = 0; + context.al = context.data.byte(99); + context.data.byte(101) = context.al; + context.data.byte(88) = 0; + context.data.byte(230) = 0; createpanel(context); showpanel(context); showman(context); @@ -6864,7 +6864,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -6876,41 +6876,41 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; context.bx = 2494; - context._cmp(context.data.byte(104), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(104), 1); + context._cmp(context.data.byte(103), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(108), 0); + context._cmp(context.data.byte(107), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); + context.data.byte(105) = 0; + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); + context._cmp(context.data.byte(187), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.data.byte(103) = 0; + context.data.byte(109) = 255; return; justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.data.byte(103) = 0; + context.data.byte(109) = 255; return; } static void makemainscreen(Context & context) { createpanel(context); - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); spriteupdate(context); printsprites(context); @@ -6918,16 +6918,16 @@ static void makemainscreen(Context & context) { showicon(context); getunderzoom(context); undertextline(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; animpointer(context); worktoscreenm(context); - context.data.byte(100) = 200; - context.data.byte(131) = 0; + context.data.byte(99) = 200; + context.data.byte(130) = 0; return; } static void getbackfromob(Context & context) { - context._cmp(context.data.byte(106), 1); + context._cmp(context.data.byte(105), 1); if (!context.flags.z()) goto notheldob; blank(context); return; @@ -6937,25 +6937,25 @@ notheldob: } static void incryanpage(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyincryan; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 31; commandonly(context); alreadyincryan: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noincryan; context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: return; doincryan: - context.ax = context.data.word(198); + context.ax = context.data.word(196); context._sub(context.ax, 80+167); - context.data.byte(19) = -1; + context.data.byte(18) = -1; findnewpage: - context._add(context.data.byte(19), 1); + context._add(context.data.byte(18), 1); context._sub(context.ax, 18); if (!context.flags.c()) goto findnewpage; delpointer(context); @@ -6968,32 +6968,32 @@ findnewpage: } static void openinv(Context & context) { - context.data.byte(104) = 1; + context.data.byte(103) = 1; context.al = 61; context.di = 80; context.bx = 58-10; context.dl = 240; printmessage(context); fillryan(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; return; } static void showryanpage(Context & context) { - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 80+167; context.bx = 58-12; context.al = 12; context.ah = 0; showframe(context); context.al = 13; - context._add(context.al, context.data.byte(19)); + context._add(context.al, context.data.byte(18)); context.push(context.ax); - context.al = context.data.byte(19); + context.al = context.data.byte(18); context.ah = 0; context.cx = 18; context._mul(context.cx); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 80+167; context._add(context.di, context.ax); context.bx = 58-12; @@ -7004,8 +7004,8 @@ static void showryanpage(Context & context) { } static void openob(Context & context) { - context.al = context.data.byte(110); - context.ah = context.data.byte(111); + context.al = context.data.byte(109); + context.ah = context.data.byte(110); context.di = 5674; copyname(context); context.di = 80; @@ -7013,7 +7013,7 @@ static void openob(Context & context) { context.al = 62; context.dl = 240; printmessage(context); - context.di = context.data.word(84); + context.di = context.data.word(82); context._add(context.di, 5); context.bx = 58+86; context.es = context.cs; @@ -7035,18 +7035,18 @@ static void openob(Context & context) { } static void obicons(Context & context) { - context.al = context.data.byte(99); + context.al = context.data.byte(98); getanyad(context); context._cmp(context.al, 255); if (context.flags.z()) goto cantopenit; - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.di = 210; context.bx = 1; context.al = 4; context.ah = 0; showframe(context); cantopenit: - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.di = 260; context.bx = 1; context.al = 1; @@ -7056,7 +7056,7 @@ cantopenit: } static void examicon(Context & context) { - context.ds = context.data.word(410); + context.ds = context.data.word(408); context.di = 254; context.bx = 5; context.al = 3; @@ -7066,13 +7066,13 @@ static void examicon(Context & context) { } static void obpicture(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); context._cmp(context.ah, 1); if (context.flags.z()) goto setframe; context._cmp(context.ah, 4); if (context.flags.z()) goto exframe; - context.ds = context.data.word(446); + context.ds = context.data.word(444); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7085,7 +7085,7 @@ static void obpicture(Context & context) { setframe: return; exframe: - context.ds = context.data.word(398); + context.ds = context.data.word(396); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7101,18 +7101,18 @@ static void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(101), 1); if (!context.flags.z()) goto notsetd; context.bx = 82; notsetd: context.dl = 241; context.ah = 16; - context.data.word(71) = 91+91; + context.data.word(69) = 91+91; printdirect(context); - context.data.word(71) = 0; + context.data.word(69) = 0; context.di = 36; context.bx = 104; - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(101), 1); if (!context.flags.z()) goto notsetd2; context.bx = 94; notsetd2: @@ -7129,16 +7129,16 @@ notsetd2: static void additionaltext(Context & context) { context._add(context.bx, 10); context.push(context.bx); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto emptycup; - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -7168,8 +7168,8 @@ fullcup: } static void obsthatdothings(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -7190,21 +7190,21 @@ notlouiscard: } static void getobtextstart(Context & context) { - context.es = context.data.word(438); + context.es = context.data.word(436); context.si = 0; context.cx = 0+(82*2); - context._cmp(context.data.byte(102), 2); + context._cmp(context.data.byte(101), 2); if (context.flags.z()) goto describe; - context.es = context.data.word(440); + context.es = context.data.word(438); context.si = 0; context.cx = 0+(130*2); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(101), 1); if (context.flags.z()) goto describe; - context.es = context.data.word(398); + context.es = context.data.word(396); context.si = 0+2080+30000+(16*114); context.cx = 0+2080+30000+(16*114)+((114+2)*2); describe: - context.al = context.data.byte(99); + context.al = context.data.byte(98); context.ah = 0; context._add(context.ax, context.ax); context._add(context.si, context.ax); @@ -7218,7 +7218,7 @@ tryagain: context.al = context.ds.byte(context.si); context.cx = context.si; context.si = context.pop(); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(101), 1); if (!context.flags.z()) goto cantmakeoneup; context._cmp(context.al, 0); if (context.flags.z()) goto findsometext; @@ -7283,31 +7283,31 @@ endofcolon: } static void inventory(Context & context) { - context._cmp(context.data.byte(56), 1); + context._cmp(context.data.byte(55), 1); if (context.flags.z()) goto iswatchinv; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); return; notwatchinv: - context._cmp(context.data.byte(100), 239); + context._cmp(context.data.byte(99), 239); if (context.flags.z()) goto alreadyopinv; - context.data.byte(100) = 239; + context.data.byte(99) = 239; context.al = 32; commandonly(context); alreadyopinv: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto cantopinv; context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: return; doopeninv: - context.data.word(328) = 0; - context.data.byte(234) = 0; - context.data.byte(237) = 0; + context.data.word(326) = 0; + context.data.byte(233) = 0; + context.data.byte(236) = 0; animpointer(context); createpanel(context); showpanel(context); @@ -7315,26 +7315,26 @@ doopeninv: showman(context); showexit(context); undertextline(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; + context.data.byte(105) = 0; + context.data.byte(103) = 2; openinv(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(110) = 255; + context.data.byte(109) = 255; goto waitexam; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: - context.data.byte(237) = 0; - context.data.byte(108) = 0; + context.data.byte(236) = 0; + context.data.byte(107) = 0; + context.data.byte(109) = 255; context.data.byte(110) = 255; - context.data.byte(111) = 255; - context.data.byte(104) = 0; - context.al = context.data.byte(100); - context.data.byte(102) = context.al; - context.data.byte(89) = 0; - context.data.byte(231) = 0; + context.data.byte(103) = 0; + context.al = context.data.byte(99); + context.data.byte(101) = context.al; + context.data.byte(88) = 0; + context.data.byte(230) = 0; createpanel(context); showpanel(context); showman(context); @@ -7343,7 +7343,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -7355,35 +7355,35 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; context.bx = 2494; - context._cmp(context.data.byte(104), 0); + context._cmp(context.data.byte(103), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(104), 1); + context._cmp(context.data.byte(103), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(108), 0); + context._cmp(context.data.byte(107), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto waitexam; - context.data.byte(106) = 0; - context._cmp(context.data.word(21), 0); + context.data.byte(105) = 0; + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(188), 255); + context._cmp(context.data.byte(187), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.data.byte(103) = 0; + context.data.byte(109) = 255; return; justgetback: - context.data.byte(104) = 0; - context.data.byte(110) = 255; + context.data.byte(103) = 0; + context.data.byte(109) = 255; return; examlist: invlist1: @@ -7393,9 +7393,9 @@ withlist1: } static void setpickup(Context & context) { - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(101), 1); if (context.flags.z()) goto cantpick; - context._cmp(context.data.byte(102), 3); + context._cmp(context.data.byte(101), 3); if (context.flags.z()) goto cantpick; getanyad(context); context.al = context.ds.byte(context.bx+2); @@ -7405,18 +7405,18 @@ cantpick: blank(context); return; canpick: - context._cmp(context.data.byte(100), 209); + context._cmp(context.data.byte(99), 209); if (context.flags.z()) goto alreadysp; - context.data.byte(100) = 209; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.data.byte(99) = 209; + context.bl = context.data.byte(98); + context.bh = context.data.byte(101); context.al = 33; commandwithob(context); alreadysp: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._cmp(context.ax, 1); if (!context.flags.z()) goto nosetpick; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (!context.flags.z()) goto dosetpick; nosetpick: return; @@ -7426,16 +7426,16 @@ dosetpick: showman(context); showexit(context); examicon(context); - context.data.byte(106) = 1; - context.data.byte(104) = 2; - context._cmp(context.data.byte(102), 4); + context.data.byte(105) = 1; + context.data.byte(103) = 2; + context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto pickupexob; - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; + context.al = context.data.byte(98); + context.data.byte(88) = context.al; + context.data.byte(109) = 255; transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.data.byte(88) = context.al; + context.data.byte(101) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -7443,22 +7443,22 @@ dosetpick: worktoscreenm(context); return; pickupexob: - context.al = context.data.byte(99); - context.data.byte(89) = context.al; - context.data.byte(110) = 255; + context.al = context.data.byte(98); + context.data.byte(88) = context.al; + context.data.byte(109) = 255; openinv(context); worktoscreenm(context); return; } static void examinventory(Context & context) { - context._cmp(context.data.byte(100), 249); + context._cmp(context.data.byte(99), 249); if (context.flags.z()) goto alreadyexinv; - context.data.byte(100) = 249; + context.data.byte(99) = 249; context.al = 32; commandonly(context); alreadyexinv: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; return; @@ -7468,8 +7468,8 @@ doexinv: showman(context); showexit(context); examicon(context); - context.data.byte(106) = 0; - context.data.byte(104) = 2; + context.data.byte(105) = 0; + context.data.byte(103) = 2; openinv(context); worktoscreenm(context); return; @@ -7478,10 +7478,10 @@ doexinv: static void reexfrominv(Context & context) { findinvpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; + context.data.byte(99) = context.ah; + context.data.byte(98) = context.al; + context.data.byte(107) = 1; + context.data.byte(233) = 0; return; } @@ -7489,62 +7489,62 @@ static void reexfromopen(Context & context) { return; findopenpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(100) = context.ah; - context.data.byte(99) = context.al; - context.data.byte(108) = 1; - context.data.byte(234) = 0; + context.data.byte(99) = context.ah; + context.data.byte(98) = context.al; + context.data.byte(107) = 1; + context.data.byte(233) = 0; return; } static void swapwithinv(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.data.byte(88); + context.ah = context.data.byte(101); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub7; - context._cmp(context.data.byte(100), 243); + context._cmp(context.data.byte(99), 243); if (context.flags.z()) goto alreadyswap1; - context.data.byte(100) = 243; + context.data.byte(99) = 243; difsub7: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap1: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto cantswap1; context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: return; doswap1: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); + context.ah = context.data.byte(101); + context.al = context.data.byte(88); context.push(context.ax); findinvpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.data.byte(88) = context.al; + context.data.byte(101) = context.ah; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.bl = context.data.byte(88); + context.bh = context.data.byte(101); context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.data.byte(101) = context.ah; + context.data.byte(88) = context.al; context.push(context.bx); findinvpos(context); delpointer(context); - context.al = context.data.byte(89); + context.al = context.data.byte(88); geteitherad(context); context.ds.byte(context.bx+2) = 4; context.ds.byte(context.bx+3) = 255; - context.al = context.data.byte(107); + context.al = context.data.byte(106); context.ds.byte(context.bx+4) = context.al; context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.data.byte(101) = context.ah; + context.data.byte(88) = context.al; fillryan(context); readmouse(context); showpointer(context); @@ -7554,21 +7554,21 @@ doswap1: } static void swapwithopen(Context & context) { - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.data.byte(88); + context.ah = context.data.byte(101); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub8; - context._cmp(context.data.byte(100), 242); + context._cmp(context.data.byte(99), 242); if (context.flags.z()) goto alreadyswap2; - context.data.byte(100) = 242; + context.data.byte(99) = 242; difsub8: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto cantswap2; context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; @@ -7582,11 +7582,11 @@ doswap2: return; notwornswap: delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); + context.al = context.data.byte(88); + context._cmp(context.al, context.data.byte(109)); if (!context.flags.z()) goto isntsame2; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); + context.al = context.data.byte(101); + context._cmp(context.al, context.data.byte(110)); if (!context.flags.z()) goto isntsame2; errormessage1(context); return; @@ -7596,13 +7596,13 @@ isntsame2: if (context.flags.z()) goto sizeok2; return; sizeok2: - context.ah = context.data.byte(102); - context.al = context.data.byte(89); + context.ah = context.data.byte(101); + context.al = context.data.byte(88); context.push(context.ax); findopenpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.data.byte(88) = context.al; + context.data.byte(101) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeswapex; geteitherad(context); @@ -7611,31 +7611,31 @@ sizeok2: goto actuallyswap; makeswapex: transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.data.byte(88) = context.al; + context.data.byte(101) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; actuallyswap: - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.bl = context.data.byte(88); + context.bh = context.data.byte(101); context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.data.byte(101) = context.ah; + context.data.byte(88) = context.al; context.push(context.bx); findopenpos(context); geteitherad(context); - context.al = context.data.byte(111); - context.ds.byte(context.bx+2) = context.al; context.al = context.data.byte(110); + context.ds.byte(context.bx+2) = context.al; + context.al = context.data.byte(109); context.ds.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); + context.al = context.data.byte(106); context.ds.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); + context.al = context.data.byte(183); context.ds.byte(context.bx+5) = context.al; context.ax = context.pop(); - context.data.byte(102) = context.ah; - context.data.byte(89) = context.al; + context.data.byte(101) = context.ah; + context.data.byte(88) = context.al; fillopen(context); fillryan(context); undertextline(context); @@ -7648,7 +7648,7 @@ actuallyswap: } static void intoinv(Context & context) { - context._cmp(context.data.byte(106), 0); + context._cmp(context.data.byte(105), 0); if (!context.flags.z()) goto notout; outofinv(context); return; @@ -7660,21 +7660,21 @@ notout: swapwithinv(context); return; canplace1: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.data.byte(88); + context.ah = context.data.byte(101); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub1; - context._cmp(context.data.byte(100), 220); + context._cmp(context.data.byte(99), 220); if (context.flags.z()) goto alreadyplce; - context.data.byte(100) = 220; + context.data.byte(99) = 220; difsub1: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplce: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notletgo2; context._and(context.ax, 1); if (!context.flags.z()) goto doplace; @@ -7682,13 +7682,13 @@ notletgo2: return; doplace: delpointer(context); - context.al = context.data.byte(89); + context.al = context.data.byte(88); getexad(context); context.ds.byte(context.bx+2) = 4; context.ds.byte(context.bx+3) = 255; - context.al = context.data.byte(107); + context.al = context.data.byte(106); context.ds.byte(context.bx+4) = context.al; - context.data.byte(106) = 0; + context.data.byte(105) = 0; fillryan(context); readmouse(context); showpointer(context); @@ -7699,9 +7699,9 @@ doplace: } static void deletetaken(Context & context) { - context.es = context.data.word(426); - context.ah = context.data.byte(184); - context.ds = context.data.word(398); + context.es = context.data.word(424); + context.ah = context.data.byte(183); + context.ds = context.data.word(396); context.si = 0+2080+30000; context.cx = 114; takenloop: @@ -7729,25 +7729,25 @@ static void outofinv(Context & context) { blank(context); return; canpick2: - context.bx = context.data.word(202); + context.bx = context.data.word(200); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); return; canpick2a: - context._cmp(context.ax, context.data.word(94)); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub3; - context._cmp(context.data.byte(100), 221); + context._cmp(context.data.byte(99), 221); if (context.flags.z()) goto alreadygrab; - context.data.byte(100) = 221; + context.data.byte(99) = 221; difsub3: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrab: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notletgo; context._and(context.ax, 1); if (!context.flags.z()) goto dograb; @@ -7755,11 +7755,11 @@ notletgo: return; dograb: delpointer(context); - context.data.byte(106) = 1; + context.data.byte(105) = 1; findinvpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.data.byte(88) = context.al; + context.data.byte(101) = context.ah; getexad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -7777,7 +7777,7 @@ static void getfreead(Context & context) { context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; - context.es = context.data.word(426); + context.es = context.data.word(424); return; } @@ -7786,39 +7786,39 @@ static void getexad(Context & context) { context.bx = 16; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(398); + context.es = context.data.word(396); context._add(context.bx, 0+2080+30000); return; } static void geteitherad(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto isinexlist; - context.al = context.data.byte(89); + context.al = context.data.byte(88); getfreead(context); return; isinexlist: - context.al = context.data.byte(89); + context.al = context.data.byte(88); getexad(context); return; } static void getanyad(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto isex; - context._cmp(context.data.byte(102), 2); + context._cmp(context.data.byte(101), 2); if (context.flags.z()) goto isfree; - context.al = context.data.byte(99); + context.al = context.data.byte(98); getsetad(context); context.ax = context.ds.word(context.bx+4); return; isfree: - context.al = context.data.byte(99); + context.al = context.data.byte(98); getfreead(context); context.ax = context.ds.word(context.bx+7); return; isex: - context.al = context.data.byte(99); + context.al = context.data.byte(98); getexad(context); context.ax = context.ds.word(context.bx+7); return; @@ -7840,21 +7840,21 @@ isex3: } static void getopenedsize(Context & context) { - context._cmp(context.data.byte(111), 4); + context._cmp(context.data.byte(110), 4); if (context.flags.z()) goto isex2; - context._cmp(context.data.byte(111), 2); + context._cmp(context.data.byte(110), 2); if (context.flags.z()) goto isfree2; - context.al = context.data.byte(110); + context.al = context.data.byte(109); getsetad(context); context.ax = context.ds.word(context.bx+3); return; isfree2: - context.al = context.data.byte(110); + context.al = context.data.byte(109); getfreead(context); context.ax = context.ds.word(context.bx+7); return; isex2: - context.al = context.data.byte(110); + context.al = context.data.byte(109); getexad(context); context.ax = context.ds.word(context.bx+7); return; @@ -7865,40 +7865,40 @@ static void getsetad(Context & context) { context.bx = 64; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(428); + context.es = context.data.word(426); return; } static void findinvpos(Context & context) { - context.cx = context.data.word(198); + context.cx = context.data.word(196); context._sub(context.cx, 80); context.bx = -1; findinv1: context._add(context.bx, 1); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv1; - context.cx = context.data.word(200); + context.cx = context.data.word(198); context._sub(context.cx, 58); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv2; - context.al = context.data.byte(19); + context.al = context.data.byte(18); context.ah = 0; context.cx = 10; context._mul(context.cx); context._add(context.bx, context.ax); context.al = context.bl; - context.data.byte(107) = context.al; + context.data.byte(106) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(412); + context.es = context.data.word(410); context._add(context.bx, 0+(228*13)+32); return; } static void findopenpos(Context & context) { - context.cx = context.data.word(198); + context.cx = context.data.word(196); context._sub(context.cx, 80); context.bx = -1; findopenp1: @@ -7906,26 +7906,26 @@ findopenp1: context._sub(context.cx, 44); if (!context.flags.c()) goto findopenp1; context.al = context.bl; - context.data.byte(107) = context.al; + context.data.byte(106) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(412); + context.es = context.data.word(410); context._add(context.bx, 0+(228*13)); return; } static void dropobject(Context & context) { - context._cmp(context.data.byte(100), 223); + context._cmp(context.data.byte(99), 223); if (context.flags.z()) goto alreadydrop; - context.data.byte(100) = 223; - context._cmp(context.data.byte(106), 0); + context.data.byte(99) = 223; + context._cmp(context.data.byte(105), 0); if (context.flags.z()) { blank(context); return; }; - context.bl = context.data.byte(89); - context.bh = context.data.byte(102); + context.bl = context.data.byte(88); + context.bh = context.data.byte(101); context.al = 37; commandwithob(context); alreadydrop: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nodrop; context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; @@ -7938,11 +7938,11 @@ dodrop: wornerror(context); return; nowornerror: - context._cmp(context.data.byte(184), 47); + context._cmp(context.data.byte(183), 47); if (context.flags.z()) goto nodrop2; - context.cl = context.data.byte(151); + context.cl = context.data.byte(150); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.data.byte(151); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); @@ -7951,14 +7951,14 @@ nodrop2: droperror(context); return; nodroperror: - context._cmp(context.data.byte(128), 64); + context._cmp(context.data.byte(127), 64); if (!context.flags.z()) goto notinlift; - context._cmp(context.data.byte(129), 64); + context._cmp(context.data.byte(128), 64); if (!context.flags.z()) goto notinlift; droperror(context); return; notinlift: - context.al = context.data.byte(89); + context.al = context.data.byte(88); context.ah = 4; context.cl = 'G'; context.ch = 'U'; @@ -7966,7 +7966,7 @@ notinlift: context.dh = 'A'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.al = context.data.byte(89); + context.al = context.data.byte(88); context.ah = 4; context.cl = 'S'; context.ch = 'H'; @@ -7974,38 +7974,38 @@ notinlift: context.dh = 'D'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.data.byte(102) = 4; - context.al = context.data.byte(89); + context.data.byte(101) = 4; + context.al = context.data.byte(88); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.data.byte(151); + context.al = context.data.byte(150); context._add(context.al, 4); context.cl = 4; context._shr(context.al, context.cl); - context._add(context.al, context.data.byte(148)); - context.ah = context.data.byte(152); + context._add(context.al, context.data.byte(147)); + context.ah = context.data.byte(151); context._add(context.ah, 8); context.cl = 4; context._shr(context.ah, context.cl); - context._add(context.ah, context.data.byte(149)); + context._add(context.ah, context.data.byte(148)); context.ds.byte(context.bx+3) = context.al; context.ds.byte(context.bx+5) = context.ah; - context.al = context.data.byte(151); + context.al = context.data.byte(150); context._add(context.al, 4); context._and(context.al, 15); - context.ah = context.data.byte(152); + context.ah = context.data.byte(151); context._add(context.ah, 8); context._and(context.ah, 15); context.ds.byte(context.bx+4) = context.al; context.ds.byte(context.bx+6) = context.ah; - context.data.byte(106) = 0; - context.al = context.data.byte(184); + context.data.byte(105) = 0; + context.al = context.data.byte(183); context.ds.byte(context.bx) = context.al; return; } static void droperror(Context & context) { - context.data.byte(100) = 255; + context.data.byte(99) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8018,13 +8018,13 @@ static void droperror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; worktoscreenm(context); return; } static void cantdrop(Context & context) { - context.data.byte(100) = 255; + context.data.byte(99) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8037,13 +8037,13 @@ static void cantdrop(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; worktoscreenm(context); return; } static void wornerror(Context & context) { - context.data.byte(100) = 255; + context.data.byte(99) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8056,17 +8056,17 @@ static void wornerror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; worktoscreenm(context); return; } static void removeobfrominv(Context & context) { - context._cmp(context.data.byte(99), 100); + context._cmp(context.data.byte(98), 100); if (context.flags.z()) goto obnotexist; getanyad(context); context.di = context.bx; - context.cl = context.data.byte(99); + context.cl = context.data.byte(98); context.ch = 0; deleteexobject(context); obnotexist: @@ -8074,33 +8074,33 @@ obnotexist: } static void selectopenob(Context & context) { - context.al = context.data.byte(99); + context.al = context.data.byte(98); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); return; canopenit1: - context._cmp(context.data.byte(100), 224); + context._cmp(context.data.byte(99), 224); if (context.flags.z()) goto alreadyopob; - context.data.byte(100) = 224; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.data.byte(99) = 224; + context.bl = context.data.byte(98); + context.bh = context.data.byte(101); context.al = 38; commandwithob(context); alreadyopob: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noopenob; context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: return; doopenob: - context.al = context.data.byte(99); + context.al = context.data.byte(98); + context.data.byte(109) = context.al; + context.al = context.data.byte(101); context.data.byte(110) = context.al; - context.al = context.data.byte(102); - context.data.byte(111) = context.al; createpanel(context); showpanel(context); showman(context); @@ -8117,9 +8117,9 @@ doopenob: } static void useopened(Context & context) { - context._cmp(context.data.byte(110), 255); + context._cmp(context.data.byte(109), 255); if (context.flags.z()) goto cannotuseopen; - context._cmp(context.data.byte(106), 0); + context._cmp(context.data.byte(105), 0); if (!context.flags.z()) goto notout2; outofopen(context); return; @@ -8132,26 +8132,26 @@ notout2: cannotuseopen: return; canplace3: - context._cmp(context.data.byte(106), 1); + context._cmp(context.data.byte(105), 1); if (context.flags.z()) goto intoopen; blank(context); return; intoopen: - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context._cmp(context.ax, context.data.word(94)); + context.al = context.data.byte(88); + context.ah = context.data.byte(101); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub2; - context._cmp(context.data.byte(100), 227); + context._cmp(context.data.byte(99), 227); if (context.flags.z()) goto alreadyplc2; - context.data.byte(100) = 227; + context.data.byte(99) = 227; difsub2: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplc2: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notletgo3; context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; @@ -8165,11 +8165,11 @@ doplace2: return; notworntoopen: delpointer(context); - context.al = context.data.byte(89); - context._cmp(context.al, context.data.byte(110)); + context.al = context.data.byte(88); + context._cmp(context.al, context.data.byte(109)); if (!context.flags.z()) goto isntsame; - context.al = context.data.byte(102); - context._cmp(context.al, context.data.byte(111)); + context.al = context.data.byte(101); + context._cmp(context.al, context.data.byte(110)); if (!context.flags.z()) goto isntsame; errormessage1(context); return; @@ -8179,16 +8179,16 @@ isntsame: if (context.flags.z()) goto sizeok1; return; sizeok1: - context.data.byte(106) = 0; - context.al = context.data.byte(89); + context.data.byte(105) = 0; + context.al = context.data.byte(88); geteitherad(context); - context.al = context.data.byte(111); - context.ds.byte(context.bx+2) = context.al; context.al = context.data.byte(110); + context.ds.byte(context.bx+2) = context.al; + context.al = context.data.byte(109); context.ds.byte(context.bx+3) = context.al; - context.al = context.data.byte(107); + context.al = context.data.byte(106); context.ds.byte(context.bx+4) = context.al; - context.al = context.data.byte(184); + context.al = context.data.byte(183); context.ds.byte(context.bx+5) = context.al; fillopen(context); undertextline(context); @@ -8225,7 +8225,7 @@ static void errormessage1(Context & context) { } static void errormessage2(Context & context) { - context.data.byte(100) = 255; + context.data.byte(99) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8273,7 +8273,7 @@ static void errormessage3(Context & context) { static void checkobjectsize(Context & context) { getopenedsize(context); context.push(context.ax); - context.al = context.data.byte(89); + context.al = context.data.byte(88); geteitherad(context); context.al = context.ds.byte(context.bx+9); context.cx = context.pop(); @@ -8312,7 +8312,7 @@ sizeok: } static void outofopen(Context & context) { - context._cmp(context.data.byte(110), 255); + context._cmp(context.data.byte(109), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); context.ax = context.ds.word(context.bx); @@ -8322,19 +8322,19 @@ cantuseopen: blank(context); return; canpick4: - context._cmp(context.ax, context.data.word(94)); + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto difsub4; - context._cmp(context.data.byte(100), 228); + context._cmp(context.data.byte(99), 228); if (context.flags.z()) goto alreadygrb; - context.data.byte(100) = 228; + context.data.byte(99) = 228; difsub4: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrb: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notletgo4; context._cmp(context.ax, 1); if (context.flags.z()) goto dogrb; @@ -8345,11 +8345,11 @@ notletgo4: return; dogrb: delpointer(context); - context.data.byte(106) = 1; + context.data.byte(105) = 1; findopenpos(context); context.ax = context.ds.word(context.bx); - context.data.byte(89) = context.al; - context.data.byte(102) = context.ah; + context.data.byte(88) = context.al; + context.data.byte(101) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeintoex; geteitherad(context); @@ -8358,8 +8358,8 @@ dogrb: goto actuallyout; makeintoex: transfertoex(context); - context.data.byte(89) = context.al; - context.data.byte(102) = 4; + context.data.byte(88) = context.al; + context.data.byte(101) = 4; geteitherad(context); context.ds.byte(context.bx+2) = 20; context.ds.byte(context.bx+3) = 255; @@ -8377,37 +8377,37 @@ actuallyout: static void transfertoex(Context & context) { emergencypurge(context); getexpos(context); - context.al = context.data.byte(10); + context.al = context.data.byte(9); context.push(context.ax); context.push(context.di); - context.al = context.data.byte(89); + context.al = context.data.byte(88); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(426); + context.ds = context.data.word(424); context.si = context.ax; context.cx = 8; while(--context.cx) context._movsw(); context.di = context.pop(); - context.al = context.data.byte(184); + context.al = context.data.byte(183); context.ds.byte(context.di) = context.al; context.ds.byte(context.di+11) = context.al; - context.al = context.data.byte(89); + context.al = context.data.byte(88); context.ds.byte(context.di+1) = context.al; context.ds.byte(context.di+2) = 4; context.ds.byte(context.di+3) = 255; - context.al = context.data.byte(107); + context.al = context.data.byte(106); context.ds.byte(context.di+4) = context.al; - context.al = context.data.byte(89); - context.data.byte(90) = context.al; + context.al = context.data.byte(88); + context.data.byte(89) = context.al; transfermap(context); transferinv(context); transfertext(context); - context.al = context.data.byte(89); + context.al = context.data.byte(88); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(426); + context.ds = context.data.word(424); context.si = context.ax; context.ds.byte(context.si+2) = 254; pickupconts(context); @@ -8419,10 +8419,10 @@ static void pickupconts(Context & context) { context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; - context.al = context.data.byte(89); - context.ah = context.data.byte(102); - context.dl = context.data.byte(10); - context.es = context.data.word(426); + context.al = context.data.byte(88); + context.ah = context.data.byte(101); + context.dl = context.data.byte(9); + context.es = context.data.word(424); context.bx = 0; context.cx = 0; pickupcontloop: @@ -8435,7 +8435,7 @@ pickupcontloop: if (!context.flags.z()) goto notinsidethis; context._cmp(context.ds.byte(context.bx+3), context.al); if (!context.flags.z()) goto notinsidethis; - context.data.byte(90) = context.cl; + context.data.byte(89) = context.cl; transfercontoex(context); notinsidethis: context.ax = context.pop(); @@ -8465,10 +8465,10 @@ static void transfercontoex(Context & context) { while(--context.cx) context._movsw(); context.di = context.pop(); context.dx = context.pop(); - context.al = context.data.byte(184); + context.al = context.data.byte(183); context.ds.byte(context.di) = context.al; context.ds.byte(context.di+11) = context.al; - context.al = context.data.byte(90); + context.al = context.data.byte(89); context.ds.byte(context.di+1) = context.al; context.ds.byte(context.di+3) = context.dl; context.ds.byte(context.di+2) = 4; @@ -8482,19 +8482,19 @@ static void transfercontoex(Context & context) { } static void transfertext(Context & context) { - context.es = context.data.word(398); - context.al = context.data.byte(10); + context.es = context.data.word(396); + context.al = context.data.byte(9); context.ah = 0; context._add(context.ax, context.ax); context.bx = 0+2080+30000+(16*114); context._add(context.bx, context.ax); - context.di = context.data.word(14); + context.di = context.data.word(12); context.ds.word(context.bx) = context.di; context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.al = context.data.byte(90); + context.al = context.data.byte(89); context.ah = 0; context._add(context.ax, context.ax); - context.ds = context.data.word(438); + context.ds = context.data.word(436); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+(82*2); @@ -8503,14 +8503,14 @@ static void transfertext(Context & context) { moretext: context._lodsb(); context._stosb(); - context._add(context.data.word(14), 1); + context._add(context.data.word(12), 1); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; return; } static void getexpos(Context & context) { - context.es = context.data.word(398); + context.es = context.data.word(396); context.al = 0; context.di = 0+2080+30000; tryanotherex: @@ -8521,13 +8521,13 @@ tryanotherex: context._cmp(context.al, 114); if (!context.flags.z()) goto tryanotherex; foundnewex: - context.data.byte(10) = context.al; + context.data.byte(9) = context.al; return; } static void purgealocation(Context & context) { context.push(context.ax); - context.es = context.data.word(398); + context.es = context.data.word(396); context.di = 0+2080+30000; context.bx = context.pop(); context.cx = 0; @@ -8555,14 +8555,14 @@ dontpurge: static void emergencypurge(Context & context) { checkpurgeagain: - context.ax = context.data.word(12); + context.ax = context.data.word(10); context._add(context.ax, 4000); context._cmp(context.ax, 30000); if (context.flags.c()) goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: - context.ax = context.data.word(14); + context.ax = context.data.word(12); context._add(context.ax, 400); context._cmp(context.ax, 18000); if (context.flags.c()) goto notneartextend; @@ -8573,9 +8573,9 @@ notneartextend: } static void purgeanitem(Context & context) { - context.es = context.data.word(398); + context.es = context.data.word(396); context.di = 0+2080+30000; - context.bl = context.data.byte(184); + context.bl = context.data.byte(183); context.cx = 0; lookforpurge: context.al = context.ds.byte(context.di+2); @@ -8596,7 +8596,7 @@ cantpurge: context._cmp(context.cx, 114); if (!context.flags.z()) goto lookforpurge; context.di = 0+2080+30000; - context.bl = context.data.byte(184); + context.bl = context.data.byte(183); context.cx = 0; lookforpurge2: context.al = context.ds.byte(context.di+2); @@ -8681,7 +8681,7 @@ static void deleteexframe(Context & context) { context.ds = context.es; while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(12), context.bx); + context._sub(context.data.word(10), context.bx); context.si = context.pop(); context.cx = 114*3; context.di = 0; @@ -8722,7 +8722,7 @@ findlenextext: context._sub(context.cx, context.bx); while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(14), context.bx); + context._sub(context.data.word(12), context.bx); context.si = context.pop(); context.cx = 114; context.di = 0+2080+30000+(16*114); @@ -8741,7 +8741,7 @@ beforethistext: static void blockget(Context & context) { context.ah = context.al; context.al = 0; - context.ds = context.data.word(416); + context.ds = context.data.word(414); context.si = 0+192; context._add(context.si, context.ax); return; @@ -8759,7 +8759,7 @@ static void drawfloor(Context & context) { showallex(context); paneltomap(context); initrain(context); - context.data.byte(62) = 0; + context.data.byte(61) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -8776,8 +8776,8 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(121)); - context.data.word(117) = context.ax; + context._add(context.ax, context.data.word(119)); + context.data.word(115) = context.ax; context.dx = context.pop(); context.cx = context.pop(); context.al = 10; @@ -8787,13 +8787,13 @@ static void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(123)); - context.data.word(119) = context.ax; + context._add(context.ax, context.data.word(121)); + context.data.word(117) = context.ax; return; } static void getdimension(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32); context.ch = 0; dimloop1: @@ -8845,14 +8845,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(125) = context.ax; + context.data.word(123) = context.ax; context.al = context.ch; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(127) = context.ax; + context.data.word(125) = context.ax; context._sub(context.dl, context.cl); context._sub(context.dh, context.ch); context.al = context.dl; @@ -8861,14 +8861,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(128) = context.al; + context.data.byte(127) = context.al; context.al = context.dh; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(129) = context.al; + context.data.byte(128) = context.al; return; } @@ -8903,13 +8903,13 @@ gotlength: } static void drawflags(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32); - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ah = 0; context.cx = 66; context._mul(context.cx); - context.bl = context.data.byte(148); + context.bl = context.data.byte(147); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -8919,9 +8919,9 @@ _tmp28: context.push(context.cx); context.cx = 11; _tmp28a: - context.ds = context.data.word(418); - context._lodsb(); context.ds = context.data.word(416); + context._lodsb(); + context.ds = context.data.word(414); context.push(context.si); context.push(context.ax); context.ah = 0; @@ -8940,9 +8940,9 @@ _tmp28a: } static void eraseoldobs(Context & context) { - context._cmp(context.data.byte(62), 0); + context._cmp(context.data.byte(61), 0); if (context.flags.z()) goto donterase; - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; oberase: @@ -8965,21 +8965,21 @@ donterase: } static void showallobs(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); - context.data.word(18) = context.bx; + context.data.word(16) = context.bx; context.di = context.bx; context.cx = 128*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(444); - context.data.word(166) = context.es; + context.es = context.data.word(442); + context.data.word(164) = context.es; context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; context.data.word(162) = context.ax; - context.data.byte(181) = 0; - context.ds = context.data.word(428); + context.ax = 0+2080; + context.data.word(160) = context.ax; + context.data.byte(180) = 0; + context.ds = context.data.word(426); context.si = 0; context.cx = 128; showobsloop: @@ -8987,14 +8987,14 @@ showobsloop: context.push(context.si); context.push(context.si); context._add(context.si, 58); - context.es = context.data.word(428); + context.es = context.data.word(426); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankframe; context.al = context.ds.byte(context.si+18); context.ah = 0; - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; context._cmp(context.al, 255); if (context.flags.z()) goto blankframe; context.push(context.es); @@ -9011,31 +9011,31 @@ showobsloop: if (context.flags.z()) goto animating; context._cmp(context.ds.byte(context.si+5), 6); if (context.flags.z()) goto animating; - context.ax = context.data.word(160); + context.ax = context.data.word(158); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.data.word(115)); + context._add(context.bx, context.data.word(117)); showframe(context); goto drawnsetob; animating: makebackob(context); drawnsetob: - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); + context.si = context.data.word(16); + context.es = context.data.word(410); + context.al = context.data.byte(178); + context.ah = context.data.byte(179); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; - context.al = context.data.byte(181); + context.al = context.data.byte(180); context.ds.byte(context.si+4) = context.al; context._add(context.si, 5); - context.data.word(18) = context.si; + context.data.word(16) = context.si; blankframe: - context._add(context.data.byte(181), 1); + context._add(context.data.byte(180), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 64); @@ -9047,19 +9047,19 @@ finishedsetobs: } static void makebackob(Context & context) { - context._cmp(context.data.byte(62), 0); + context._cmp(context.data.byte(61), 0); if (context.flags.z()) goto nomake; context.al = context.ds.byte(context.si+5); context.ah = context.ds.byte(context.si+8); context.push(context.si); context.push(context.ax); context.push(context.si); - context.ax = context.data.word(168); - context.bx = context.data.word(170); + context.ax = context.data.word(166); + context.bx = context.data.word(168); context.ah = context.bl; context.si = context.ax; context.cx = 49520; - context.dx = context.data.word(444); + context.dx = context.data.word(442); context.di = 0; makesprite(context); context.ax = context.pop(); @@ -9080,61 +9080,61 @@ nomake: } static void showallfree(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.data.word(18) = context.bx; + context.data.word(16) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); context.cx = 80*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(446); - context.data.word(166) = context.es; + context.es = context.data.word(444); + context.data.word(164) = context.es; context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; context.data.word(162) = context.ax; + context.ax = 0+2080; + context.data.word(160) = context.ax; context.al = 0; - context.data.byte(158) = context.al; - context.ds = context.data.word(426); + context.data.byte(157) = context.al; + context.ds = context.data.word(424); context.si = 2; context.cx = 0; loop127: context.push(context.cx); context.push(context.si); context.push(context.si); - context.es = context.data.word(426); + context.es = context.data.word(424); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto over138; - context.al = context.data.byte(158); + context.al = context.data.byte(157); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); + context.es = context.data.word(400); + context.ds = context.data.word(164); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto over138; - context.ax = context.data.word(160); + context.ax = context.data.word(158); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.data.word(115)); + context._add(context.bx, context.data.word(117)); showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); + context.si = context.data.word(16); + context.es = context.data.word(410); + context.al = context.data.byte(178); + context.ah = context.data.byte(179); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; @@ -9144,9 +9144,9 @@ loop127: context.push(context.ax); context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(18) = context.si; + context.data.word(16) = context.si; over138: - context._add(context.data.byte(158), 1); + context._add(context.data.byte(157), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9159,66 +9159,66 @@ finfree: } static void showallex(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.data.word(18) = context.bx; + context.data.word(16) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); context.cx = 100*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(398); - context.data.word(166) = context.es; + context.es = context.data.word(396); + context.data.word(164) = context.es; context.ax = 0; - context.data.word(164) = context.ax; - context.ax = 0+2080; context.data.word(162) = context.ax; - context.data.byte(157) = 0; + context.ax = 0+2080; + context.data.word(160) = context.ax; + context.data.byte(156) = 0; context.si = 0+2080+30000+2; context.cx = 0; exloop: context.push(context.cx); context.push(context.si); - context.es = context.data.word(398); + context.es = context.data.word(396); context.push(context.si); context.ch = 0; context._cmp(context.ds.byte(context.si), 255); if (context.flags.z()) goto notinroom; context.al = context.ds.byte(context.si-2); - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto notinroom; getmapad(context); notinroom: context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankex; - context.al = context.data.byte(157); + context.al = context.data.byte(156); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(402); - context.ds = context.data.word(166); + context.es = context.data.word(400); + context.ds = context.data.word(164); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto blankex; - context.ax = context.data.word(160); + context.ax = context.data.word(158); context.ah = 0; - context._add(context.di, context.data.word(117)); - context._add(context.bx, context.data.word(119)); + context._add(context.di, context.data.word(115)); + context._add(context.bx, context.data.word(117)); showframe(context); - context.si = context.data.word(18); - context.es = context.data.word(412); - context.al = context.data.byte(179); - context.ah = context.data.byte(180); + context.si = context.data.word(16); + context.es = context.data.word(410); + context.al = context.data.byte(178); + context.ah = context.data.byte(179); context.ds.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(176); + context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.ds.word(context.si+2) = context.ax; @@ -9228,9 +9228,9 @@ notinroom: context.push(context.ax); context.ds.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(18) = context.si; + context.data.word(16) = context.si; blankex: - context._add(context.data.byte(157), 1); + context._add(context.data.byte(156), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9243,11 +9243,11 @@ finex: } static void calcfrframe(Context & context) { - context.dx = context.data.word(166); - context.ax = context.data.word(162); - context.push(context.ax); - context.cx = context.data.word(164); + context.dx = context.data.word(164); context.ax = context.data.word(160); + context.push(context.ax); + context.cx = context.data.word(162); + context.ax = context.data.word(158); context.ds = context.dx; context.bx = 6; context._mul(context.bx); @@ -9259,33 +9259,33 @@ static void calcfrframe(Context & context) { context.bx = context.pop(); context.push(context.dx); context._add(context.ax, context.bx); - context.data.word(178) = context.ax; - context.data.word(176) = context.cx; + context.data.word(176) = context.ax; + context.data.word(174) = context.cx; context.ax = context.pop(); context.push(context.ax); context.ah = 0; - context.data.word(172) = context.ax; + context.data.word(170) = context.ax; context.ax = context.pop(); context.al = context.ah; context.ah = 0; - context.data.word(174) = context.ax; + context.data.word(172) = context.ax; return; nullframe: context.ax = context.pop(); context.cx = 0; - context.data.word(176) = context.cx; + context.data.word(174) = context.cx; return; } static void finalframe(Context & context) { - context.ax = context.data.word(170); - context._add(context.ax, context.data.word(174)); + context.ax = context.data.word(168); + context._add(context.ax, context.data.word(172)); + context.bx = context.data.word(166); + context._add(context.bx, context.data.word(170)); + context.data.byte(178) = context.bl; + context.data.byte(179) = context.al; + context.di = context.data.word(166); context.bx = context.data.word(168); - context._add(context.bx, context.data.word(172)); - context.data.byte(179) = context.bl; - context.data.byte(180) = context.al; - context.di = context.data.word(168); - context.bx = context.data.word(170); return; } @@ -9305,11 +9305,11 @@ static void getmapad(Context & context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(168) = context.ax; + context.data.word(166) = context.ax; getyad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(170) = context.ax; + context.data.word(168) = context.ax; context.ch = 1; over146: return; @@ -9324,7 +9324,7 @@ static void getxad(Context & context) { context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; - context._sub(context.al, context.data.byte(148)); + context._sub(context.al, context.data.byte(147)); if (context.flags.c()) goto over148; context._cmp(context.al, 11); if (!context.flags.c()) goto over148; @@ -9344,7 +9344,7 @@ static void getyad(Context & context) { context._add(context.si, 1); context.ah = context.ds.byte(context.si); context._add(context.si, 1); - context._sub(context.al, context.data.byte(149)); + context._sub(context.al, context.data.byte(148)); if (context.flags.c()) goto over147; context._cmp(context.al, 10); if (!context.flags.c()) goto over147; @@ -9360,40 +9360,40 @@ over147: } static void autolook(Context & context) { + context.ax = context.data.word(196); + context._cmp(context.ax, context.data.word(212)); + if (!context.flags.z()) goto diffmouse; context.ax = context.data.word(198); context._cmp(context.ax, context.data.word(214)); if (!context.flags.z()) goto diffmouse; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(216)); - if (!context.flags.z()) goto diffmouse; - context._sub(context.data.word(98), 1); - context._cmp(context.data.word(98), 0); + context._sub(context.data.word(96), 1); + context._cmp(context.data.word(96), 0); if (!context.flags.z()) goto noautolook; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto noautolook; dolook(context); noautolook: return; diffmouse: - context.data.word(98) = 1000; + context.data.word(96) = 1000; return; } static void look(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.data.byte(233), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 241); + context._cmp(context.data.byte(99), 241); if (context.flags.z()) goto alreadylook; - context.data.byte(100) = 241; + context.data.byte(99) = 241; context.al = 25; commandonly(context); alreadylook: - context._cmp(context.data.word(202), 1); + context._cmp(context.data.word(200), 1); if (!context.flags.z()) goto nolook; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nolook; dolook(context); nolook: @@ -9405,19 +9405,19 @@ static void dolook(Context & context) { showicon(context); undertextline(context); worktoscreenm(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; dumptextline(context); - context.bl = context.data.byte(185); + context.bl = context.data.byte(184); context._and(context.bl, 31); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(436); + context.es = context.data.word(434); context._add(context.bx, 0); context.si = context.ds.word(context.bx); context._add(context.si, 0+(38*2)); findnextcolon(context); context.di = 66; - context._cmp(context.data.byte(184), 50); + context._cmp(context.data.byte(183), 50); if (context.flags.c()) goto notdream3; context.di = 40; notdream3: @@ -9429,17 +9429,17 @@ notdream3: context.cx = 400; hangonp(context); afterlook: - context.data.byte(234) = 0; - context.data.byte(100) = 0; + context.data.byte(233) = 0; + context.data.byte(99) = 0; redrawmainscrn(context); worktoscreenm(context); return; } static void redrawmainscrn(Context & context) { - context.data.word(328) = 0; + context.data.word(326) = 0; createpanel(context); - context.data.byte(62) = 0; + context.data.byte(61) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -9447,40 +9447,40 @@ static void redrawmainscrn(Context & context) { getunderzoom(context); undertextline(context); readmouse(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; return; } static void getback1(Context & context) { - context._cmp(context.data.byte(106), 0); + context._cmp(context.data.byte(105), 0); if (context.flags.z()) goto notgotobject; blank(context); return; notgotobject: - context._cmp(context.data.byte(100), 202); + context._cmp(context.data.byte(99), 202); if (context.flags.z()) goto alreadyget; - context.data.byte(100) = 202; + context.data.byte(99) = 202; context.al = 26; commandonly(context); alreadyget: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nogetback; context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: return; dogetback: - context.data.byte(103) = 1; - context.data.byte(106) = 0; + context.data.byte(102) = 1; + context.data.byte(105) = 0; return; } static void talk(Context & context) { - context.data.byte(246) = 0; - context.data.byte(237) = 0; - context.al = context.data.byte(99); - context.data.byte(247) = context.al; + context.data.byte(245) = 0; + context.data.byte(236) = 0; + context.al = context.data.byte(98); + context.data.byte(246) = context.al; createpanel(context); showpanel(context); showman(context); @@ -9488,7 +9488,7 @@ static void talk(Context & context) { undertextline(context); convicons(context); starttalk(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -9500,15 +9500,15 @@ waittalk: vsync(context); dumppointer(context); dumptextline(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; context.bx = 2660; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto waittalk; finishtalk: - context.bx = context.data.word(249); + context.bx = context.data.word(247); context.es = context.cs; - context._cmp(context.data.byte(246), 4); + context._cmp(context.data.byte(245), 4); if (context.flags.c()) goto notnexttalk; context.al = context.ds.byte(context.bx+7); context._or(context.al, 128); @@ -9516,25 +9516,25 @@ finishtalk: notnexttalk: redrawmainscrn(context); worktoscreenm(context); - context._cmp(context.data.byte(383), 1); + context._cmp(context.data.byte(382), 1); if (!context.flags.z()) goto nospeech; cancelch1(context); - context.data.byte(388) = -1; - context.data.byte(387) = 0; + context.data.byte(387) = -1; + context.data.byte(386) = 0; nospeech: return; } static void convicons(Context & context) { - context.al = context.data.byte(247); + context.al = context.data.byte(246); context._and(context.al, 127); getpersframe(context); context.di = 234; context.bx = 2; - context.data.word(160) = context.ax; + context.data.word(158) = context.ax; findsource(context); - context.ax = context.data.word(160); - context._sub(context.ax, context.data.word(244)); + context.ax = context.data.word(158); + context._sub(context.ax, context.data.word(242)); context.ah = 0; showframe(context); return; @@ -9544,25 +9544,25 @@ static void getpersframe(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(448); + context.es = context.data.word(446); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); return; } static void starttalk(Context & context) { - context.data.byte(245) = 0; - context.al = context.data.byte(247); + context.data.byte(244) = 0; + context.al = context.data.byte(246); context._and(context.al, 127); getpersontext(context); - context.data.word(71) = 91+91; + context.data.word(69) = 91+91; context.di = 66; context.bx = 64; context.dl = 241; context.al = 0; context.ah = 79; printdirect(context); - context.data.word(71) = 0; + context.data.word(69) = 0; context.di = 66; context.bx = 80; context.dl = 241; @@ -9578,7 +9578,7 @@ static void getpersontext(Context & context) { context.cx = 64*2; context._mul(context.cx); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9588,30 +9588,30 @@ static void getpersontext(Context & context) { } static void moretalk(Context & context) { - context._cmp(context.data.byte(245), 0); + context._cmp(context.data.byte(244), 0); if (context.flags.z()) goto canmore; redes(context); return; canmore: - context._cmp(context.data.byte(100), 215); + context._cmp(context.data.byte(99), 215); if (context.flags.z()) goto alreadymore; - context.data.byte(100) = 215; + context.data.byte(99) = 215; context.al = 49; commandonly(context); alreadymore: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nomore; context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: return; domoretalk: - context.data.byte(245) = 2; - context.data.byte(246) = 4; - context._cmp(context.data.byte(247), 100); + context.data.byte(244) = 2; + context.data.byte(245) = 4; + context._cmp(context.data.byte(246), 100); if (context.flags.c()) goto notsecondpart; - context.data.byte(246) = 48; + context.data.byte(245) = 48; notsecondpart: dosometalk(context); return; @@ -9619,19 +9619,19 @@ notsecondpart: static void dosometalk(Context & context) { watchtalk: + context.al = context.data.byte(245); context.al = context.data.byte(246); - context.al = context.data.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(246); + context.al = context.data.byte(245); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9654,24 +9654,24 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(234) = 3; + context.data.byte(233) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); - context._add(context.data.byte(246), 1); + context._add(context.data.byte(245), 1); + context.al = context.data.byte(245); context.al = context.data.byte(246); - context.al = context.data.byte(247); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(246); + context.al = context.data.byte(245); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(448); + context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -9698,20 +9698,20 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(234) = 3; + context.data.byte(233) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); skiptalk: - context._add(context.data.byte(246), 1); + context._add(context.data.byte(245), 1); goto watchtalk; endwatchtalk: - context.data.byte(234) = 0; + context.data.byte(233) = 0; return; } static void hangonpq(Context & context) { - context.data.byte(103) = 0; + context.data.byte(102) = 0; context.bx = 0; hangloopq: context.push(context.cx); @@ -9727,48 +9727,48 @@ hangloopq: checkcoords(context); context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (context.flags.z()) goto quitconv; - context._cmp(context.data.byte(383), 1); + context._cmp(context.data.byte(382), 1); if (!context.flags.z()) goto notspeaking; - context._cmp(context.data.byte(515), 255); + context._cmp(context.data.byte(514), 255); if (!context.flags.z()) goto notspeaking; context._add(context.bx, 1); context._cmp(context.bx, 40); if (context.flags.z()) goto finishconv; notspeaking: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto hangloopq; - context._cmp(context.data.word(212), 0); + context._cmp(context.data.word(210), 0); if (!context.flags.z()) goto hangloopq; finishconv: delpointer(context); - context.data.byte(234) = 0; + context.data.byte(233) = 0; return; quitconv: delpointer(context); - context.data.byte(234) = 0; + context.data.byte(233) = 0; context.ax = context.pop(); cancelch1(context); return; } static void redes(Context & context) { - context._cmp(context.data.byte(515), 255); + context._cmp(context.data.byte(514), 255); if (!context.flags.z()) goto cantredes; - context._cmp(context.data.byte(245), 2); + context._cmp(context.data.byte(244), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); return; canredes: - context._cmp(context.data.byte(100), 217); + context._cmp(context.data.byte(99), 217); if (context.flags.z()) goto alreadyreds; - context.data.byte(100) = 217; + context.data.byte(99) = 217; context.al = 50; commandonly(context); alreadyreds: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; return; @@ -9788,27 +9788,27 @@ doredes: } static void newplace(Context & context) { - context._cmp(context.data.byte(60), 1); + context._cmp(context.data.byte(59), 1); if (context.flags.z()) goto istravel; - context._cmp(context.data.byte(189), -1); + context._cmp(context.data.byte(188), -1); if (!context.flags.z()) goto isautoloc; return; isautoloc: - context.al = context.data.byte(189); - context.data.byte(188) = context.al; - context.data.byte(189) = -1; + context.al = context.data.byte(188); + context.data.byte(187) = context.al; + context.data.byte(188) = -1; return; istravel: - context.data.byte(60) = 0; + context.data.byte(59) = 0; selectlocation(context); return; } static void selectlocation(Context & context) { - context.data.byte(237) = 0; + context.data.byte(236) = 0; clearbeforeload(context); - context.data.byte(103) = 0; - context.data.byte(231) = 22; + context.data.byte(102) = 0; + context.data.byte(230) = 22; readcitypic(context); showcity(context); getridoftemp(context); @@ -9820,15 +9820,15 @@ static void selectlocation(Context & context) { showexit(context); locationpic(context); undertextline(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); - context.data.byte(231) = 0; + context.data.byte(230) = 0; showpointer(context); worktoscreen(context); context.al = 9; context.ah = 255; playchannel0(context); - context.data.byte(188) = 255; + context.data.byte(187) = 255; select: delpointer(context); readmouse(context); @@ -9836,42 +9836,42 @@ select: vsync(context); dumppointer(context); dumptextline(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (context.flags.z()) goto quittravel; context.bx = 2714; checkcoords(context); - context._cmp(context.data.byte(188), 255); + context._cmp(context.data.byte(187), 255); if (context.flags.z()) goto select; - context.al = context.data.byte(188); - context._cmp(context.al, context.data.byte(9)); + context.al = context.data.byte(187); + context._cmp(context.al, context.data.byte(8)); if (context.flags.z()) goto quittravel; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(456); + context.es = context.data.word(454); deallocatemem(context); return; quittravel: - context.al = context.data.byte(184); - context.data.byte(188) = context.al; - context.data.byte(103) = 0; + context.al = context.data.byte(183); + context.data.byte(187) = context.al; + context.data.byte(102) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(456); + context.es = context.data.word(454); deallocatemem(context); return; } static void showcity(Context & context) { clearwork(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 57; context.bx = 32; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 120+57; context.bx = 32; context.al = 1; @@ -9881,25 +9881,25 @@ static void showcity(Context & context) { } static void lookatplace(Context & context) { - context._cmp(context.data.byte(100), 224); + context._cmp(context.data.byte(99), 224); if (context.flags.z()) goto alreadyinfo; - context.data.byte(100) = 224; + context.data.byte(99) = 224; context.al = 27; commandonly(context); alreadyinfo: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto noinfo; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noinfo; - context.bl = context.data.byte(183); + context.bl = context.data.byte(182); context._cmp(context.bl, 15); if (!context.flags.c()) goto noinfo; context.push(context.bx); delpointer(context); deltextline(context); getundercentre(context); - context.ds = context.data.word(462); + context.ds = context.data.word(460); context.al = 0; context.ah = 0; context.di = 60; @@ -9918,7 +9918,7 @@ alreadyinfo: context.bx = context.pop(); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(456); + context.es = context.data.word(454); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); findnextcolon(context); @@ -9932,8 +9932,8 @@ alreadyinfo: context.cx = 500; hangonp(context); afterinfo: - context.data.byte(234) = 0; - context.data.byte(231) = 0; + context.data.byte(233) = 0; + context.data.byte(230) = 0; putundercentre(context); worktoscreenm(context); noinfo: @@ -9943,7 +9943,7 @@ noinfo: static void getundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; context.cl = 254; context.ch = 110; @@ -9954,7 +9954,7 @@ static void getundercentre(Context & context) { static void putundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; context.cl = 254; context.ch = 110; @@ -9970,12 +9970,12 @@ static void locationpic(Context & context) { context.di = 0; context._cmp(context.al, 6); if (!context.flags.c()) goto secondlot; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context._add(context.al, 4); goto gotgraphic; secondlot: context._sub(context.al, 6); - context.ds = context.data.word(460); + context.ds = context.data.word(458); gotgraphic: context._add(context.di, 104); context.bx = 138+14; @@ -9983,20 +9983,20 @@ gotgraphic: showframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.data.byte(183); - context._cmp(context.al, context.data.byte(184)); + context.al = context.data.byte(182); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto notinthisone; context.al = 3; context.di = 104; context.bx = 140+14; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 0; showframe(context); notinthisone: - context.bl = context.data.byte(183); + context.bl = context.data.byte(182); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(456); + context.es = context.data.word(454); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 50; @@ -10009,19 +10009,19 @@ notinthisone: } static void getdestinfo(Context & context) { - context.al = context.data.byte(183); + context.al = context.data.byte(182); context.ah = 0; context.push(context.ax); context.dx = context.ds; context.es = context.dx; - context.si = 7798; + context.si = 7782; context._add(context.si, context.ax); context.cl = context.ds.byte(context.si); context.ax = context.pop(); context.push(context.cx); context.dx = context.ds; context.es = context.dx; - context.si = 7813; + context.si = 7798; context._add(context.si, context.ax); context.ax = context.pop(); return; @@ -10030,19 +10030,19 @@ static void getdestinfo(Context & context) { static void showarrows(Context & context) { context.di = 116-12; context.bx = 16; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 0; context.ah = 0; showframe(context); context.di = 226+12; context.bx = 16; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 1; context.ah = 0; showframe(context); context.di = 280; context.bx = 14; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 2; context.ah = 0; showframe(context); @@ -10051,27 +10051,27 @@ static void showarrows(Context & context) { static void nextdest(Context & context) { duok: - context._cmp(context.data.byte(100), 218); + context._cmp(context.data.byte(99), 218); if (context.flags.z()) goto alreadydu; - context.data.byte(100) = 218; + context.data.byte(99) = 218; context.al = 28; commandonly(context); alreadydu: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto nodu; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nodu; searchdestup: - context._add(context.data.byte(183), 1); - context._cmp(context.data.byte(183), 15); + context._add(context.data.byte(182), 1); + context._cmp(context.data.byte(182), 15); if (!context.flags.z()) goto notlastdest; - context.data.byte(183) = 0; + context.data.byte(182) = 0; notlastdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestup; - context.data.byte(109) = 1; + context.data.byte(108) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10089,27 +10089,27 @@ nodu: static void lastdest(Context & context) { ddok: - context._cmp(context.data.byte(100), 219); + context._cmp(context.data.byte(99), 219); if (context.flags.z()) goto alreadydd; - context.data.byte(100) = 219; + context.data.byte(99) = 219; context.al = 29; commandonly(context); alreadydd: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto nodd; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nodd; searchdestdown: - context._sub(context.data.byte(183), 1); - context._cmp(context.data.byte(183), -1); + context._sub(context.data.byte(182), 1); + context._cmp(context.data.byte(182), -1); if (!context.flags.z()) goto notfirstdest; - context.data.byte(183) = 15; + context.data.byte(182) = 15; notfirstdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestdown; - context.data.byte(109) = 1; + context.data.byte(108) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10126,20 +10126,20 @@ nodd: } static void destselect(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadytrav; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 30; commandonly(context); alreadytrav: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto notrav; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notrav; getdestinfo(context); - context.al = context.data.byte(183); - context.data.byte(188) = context.al; + context.al = context.data.byte(182); + context.data.byte(187) = context.al; notrav: return; } @@ -10149,7 +10149,7 @@ static void getlocation(Context & context) { context.bx = context.ax; context.dx = context.ds; context.es = context.dx; - context._add(context.bx, 7798); + context._add(context.bx, 7782); context.al = context.ds.byte(context.bx); return; } @@ -10159,7 +10159,7 @@ static void setlocation(Context & context) { context.bx = context.ax; context.dx = context.ds; context.es = context.dx; - context._add(context.bx, 7798); + context._add(context.bx, 7782); context.ds.byte(context.bx) = 1; return; } @@ -10206,31 +10206,31 @@ clearedlocations: context.bx = context.ax; context.dx = context.ds; context.es = context.dx; - context._add(context.bx, 7798); + context._add(context.bx, 7782); context.ds.byte(context.bx) = 0; return; } static void readdesticon(Context & context) { - context.dx = 2026; + context.dx = 2013; loadintotemp(context); - context.dx = 2039; + context.dx = 2026; loadintotemp2(context); - context.dx = 1974; + context.dx = 1961; loadintotemp3(context); return; } static void readcitypic(Context & context) { - context.dx = 2013; + context.dx = 2000; loadintotemp(context); return; } static void usemon(Context & context) { - context.data.byte(55) = 0; + context.data.byte(54) = 0; context.es = context.cs; - context.di = 2895+1; + context.di = 2892+1; context.cx = 12; context.al = 32; while(--context.cx) context._stosb(); @@ -10253,12 +10253,12 @@ keyloop: showicon(context); drawfloor(context); getridofall(context); - context.dx = 1987; + context.dx = 1974; loadintotemp(context); loadpersonal(context); loadnews(context); loadcart(context); - context.dx = 1883; + context.dx = 1870; loadtempcharset(context); printoutermon(context); initialmoncols(context); @@ -10267,8 +10267,8 @@ keyloop: turnonpower(context); fadeupyellows(context); fadeupmonfirst(context); - context.data.word(318) = 76; - context.data.word(320) = 141; + context.data.word(316) = 76; + context.data.word(318) = 141; context.al = 1; monmessage(context); context.cx = 120; @@ -10283,34 +10283,34 @@ keyloop: hangoncurs(context); printlogo(context); scrollmonitor(context); + context.data.word(392) = 0; context.data.word(394) = 0; - context.data.word(396) = 0; moreinput: - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.data.word(316); + context.bx = context.data.word(318); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; + context.data.word(316) = context.di; + context.data.word(318) = context.bx; execcommand(context); context._cmp(context.al, 0); if (context.flags.z()) goto moreinput; endmon: getridoftemp(context); getridoftempcharset(context); + context.es = context.data.word(464); + deallocatemem(context); context.es = context.data.word(466); deallocatemem(context); context.es = context.data.word(468); deallocatemem(context); - context.es = context.data.word(470); - deallocatemem(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; context.al = 26; playchannel1(context); - context.data.byte(131) = 0; + context.data.byte(130) = 0; restoreall(context); redrawmainscrn(context); worktoscreenm(context); @@ -10320,25 +10320,25 @@ endmon: static void printoutermon(Context & context) { context.di = 40; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 1; context.ah = 0; showframe(context); context.di = 264; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 2; context.ah = 0; showframe(context); context.di = 40; context.bx = 12; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 3; context.ah = 0; showframe(context); context.di = 40; context.bx = 164; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 4; context.ah = 0; showframe(context); @@ -10346,13 +10346,13 @@ static void printoutermon(Context & context) { } static void loadpersonal(Context & context) { - context.al = context.data.byte(9); - context.dx = 2065; + context.al = context.data.byte(8); + context.dx = 2052; context._cmp(context.al, 0); if (context.flags.z()) goto foundpersonal; context._cmp(context.al, 42); if (context.flags.z()) goto foundpersonal; - context.dx = 2078; + context.dx = 2065; context._cmp(context.al, 2); if (context.flags.z()) goto foundpersonal; foundpersonal: @@ -10363,7 +10363,7 @@ foundpersonal: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(466) = context.ax; + context.data.word(464) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10373,17 +10373,17 @@ foundpersonal: } static void loadnews(Context & context) { - context.al = context.data.byte(34); - context.dx = 2091; + context.al = context.data.byte(33); + context.dx = 2078; context._cmp(context.al, 0); if (context.flags.z()) goto foundnews; - context.dx = 2104; + context.dx = 2091; context._cmp(context.al, 1); if (context.flags.z()) goto foundnews; - context.dx = 2117; + context.dx = 2104; context._cmp(context.al, 2); if (context.flags.z()) goto foundnews; - context.dx = 2130; + context.dx = 2117; foundnews: openfile(context); readheader(context); @@ -10392,7 +10392,7 @@ foundnews: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(468) = context.ax; + context.data.word(466) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10403,19 +10403,19 @@ foundnews: static void loadcart(Context & context) { lookininterface(context); - context.dx = 2143; + context.dx = 2130; context._cmp(context.al, 0); if (context.flags.z()) goto gotcart; - context.dx = 2156; + context.dx = 2143; context._cmp(context.al, 1); if (context.flags.z()) goto gotcart; - context.dx = 2169; + context.dx = 2156; context._cmp(context.al, 2); if (context.flags.z()) goto gotcart; - context.dx = 2182; + context.dx = 2169; context._cmp(context.al, 3); if (context.flags.z()) goto gotcart; - context.dx = 2195; + context.dx = 2182; gotcart: openfile(context); readheader(context); @@ -10424,7 +10424,7 @@ gotcart: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(470) = context.ax; + context.data.word(468) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10490,7 +10490,7 @@ chosenaccess: static void powerlighton(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 6; context.ah = 0; context.push(context.di); @@ -10507,7 +10507,7 @@ static void powerlighton(Context & context) { static void powerlightoff(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 5; context.ah = 0; context.push(context.di); @@ -10524,7 +10524,7 @@ static void powerlightoff(Context & context) { static void accesslighton(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 8; context.ah = 0; context.push(context.di); @@ -10541,7 +10541,7 @@ static void accesslighton(Context & context) { static void accesslightoff(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 7; context.ah = 0; context.push(context.di); @@ -10558,7 +10558,7 @@ static void accesslightoff(Context & context) { static void locklighton(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 10; context.ah = 0; context.push(context.di); @@ -10575,7 +10575,7 @@ static void locklighton(Context & context) { static void locklightoff(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 9; context.ah = 0; context.push(context.di); @@ -10591,66 +10591,66 @@ static void locklightoff(Context & context) { static void input(Context & context) { context.es = context.cs; - context.di = 7944; + context.di = 7816; context.cx = 64; context.al = 0; while(--context.cx) context._stosb(); - context.data.word(316) = 0; + context.data.word(314) = 0; context.al = '>'; - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.data.word(316); + context.bx = context.data.word(318); + context.ds = context.data.word(404); context.ah = 0; printchar(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.data.word(316); + context.bx = context.data.word(318); context.cl = 6; context.ch = 8; multidump(context); - context._add(context.data.word(318), 6); + context._add(context.data.word(316), 6); + context.ax = context.data.word(316); + context.data.word(310) = context.ax; context.ax = context.data.word(318); context.data.word(312) = context.ax; - context.ax = context.data.word(320); - context.data.word(314) = context.ax; waitkey: printcurs(context); vsync(context); delcurs(context); readkey(context); - context.al = context.data.byte(142); + context.al = context.data.byte(141); context._cmp(context.al, 0); if (context.flags.z()) goto waitkey; context._cmp(context.al, 13); if (context.flags.z()) goto endofinput; context._cmp(context.al, 8); if (!context.flags.z()) goto notdel; - context._cmp(context.data.word(316), 0); + context._cmp(context.data.word(314), 0); if (context.flags.z()) goto waitkey; delchar(context); goto waitkey; notdel: - context._cmp(context.data.word(316), 28); + context._cmp(context.data.word(314), 28); if (context.flags.z()) goto waitkey; - context._cmp(context.data.byte(142), 32); + context._cmp(context.data.byte(141), 32); if (!context.flags.z()) goto notleadingspace; - context._cmp(context.data.word(316), 0); + context._cmp(context.data.word(314), 0); if (context.flags.z()) goto waitkey; notleadingspace: makecaps(context); context.es = context.cs; - context.si = context.data.word(316); + context.si = context.data.word(314); context._add(context.si, context.si); - context._add(context.si, 7944); + context._add(context.si, 7816); context.ds.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); if (!context.flags.c()) goto waitkey; context.push(context.ax); context.push(context.es); context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); + context.di = context.data.word(316); + context.bx = context.data.word(318); + context.ds = context.data.word(400); + context.ax = context.data.word(314); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; @@ -10661,18 +10661,18 @@ notleadingspace: context.ax = context.pop(); context.push(context.es); context.push(context.si); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(406); + context.di = context.data.word(316); + context.bx = context.data.word(318); + context.ds = context.data.word(404); context.ah = 0; printchar(context); context.si = context.pop(); context.es = context.pop(); context.ds.byte(context.si+1) = context.cl; context.ch = 0; - context._add(context.data.word(318), context.cx); - context._add(context.data.word(316), 1); - context._add(context.data.word(312), context.cx); + context._add(context.data.word(316), context.cx); + context._add(context.data.word(314), 1); + context._add(context.data.word(310), context.cx); goto waitkey; endofinput: return; @@ -10687,27 +10687,27 @@ notupperc: } static void delchar(Context & context) { - context._sub(context.data.word(316), 1); - context.si = context.data.word(316); + context._sub(context.data.word(314), 1); + context.si = context.data.word(314); context._add(context.si, context.si); context.es = context.cs; - context._add(context.si, 7944); + context._add(context.si, 7816); context.ds.byte(context.si) = 0; context.al = context.ds.byte(context.si+1); context.ah = 0; - context._sub(context.data.word(318), context.ax); - context._sub(context.data.word(312), context.ax); - context.di = context.data.word(318); - context.bx = context.data.word(320); - context.ds = context.data.word(402); - context.ax = context.data.word(316); + context._sub(context.data.word(316), context.ax); + context._sub(context.data.word(310), context.ax); + context.di = context.data.word(316); + context.bx = context.data.word(318); + context.ds = context.data.word(400); + context.ax = context.data.word(314); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; context.ch = 8; multiput(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.data.word(316); + context.bx = context.data.word(318); context.cl = context.al; context.ch = 8; multidump(context); @@ -10718,7 +10718,7 @@ static void execcommand(Context & context) { context.es = context.cs; context.bx = 2776; context.ds = context.cs; - context.si = 7944; + context.si = 7816; context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; @@ -10803,12 +10803,12 @@ static void dircom(Context & context) { dirfile(context); return; dirroot: - context.data.byte(269) = 0; + context.data.byte(268) = 0; context.ds = context.cs; context.si = 2885; context._add(context.si, 1); context.es = context.cs; - context.di = 2895; + context.di = 2892; context._add(context.di, 1); context.cx = 12; while(--context.cx) context._movsb(); @@ -10816,12 +10816,12 @@ dirroot: scrollmonitor(context); context.al = 9; monmessage(context); + context.es = context.data.word(464); + searchforfiles(context); context.es = context.data.word(466); searchforfiles(context); context.es = context.data.word(468); searchforfiles(context); - context.es = context.data.word(470); - searchforfiles(context); scrollmonitor(context); return; } @@ -10889,22 +10889,22 @@ notyetassigned: scrollmonitor(context); context.al = 15; monmessage(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.data.word(316); + context.bx = context.data.word(318); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(318) = context.di; - context.data.word(320) = context.bx; + context.data.word(316) = context.di; + context.data.word(318) = context.bx; context.bx = context.pop(); context.es = context.pop(); context.push(context.es); context.push(context.bx); context._add(context.bx, 2); context.ds = context.cs; - context.si = 7944; + context.si = 7816; checkpass: context._lodsw(); context.ah = context.ds.byte(context.bx); @@ -10971,23 +10971,23 @@ static void read(Context & context) { return; okcom: context.es = context.cs; - context.di = 2895; - context.ax = context.data.word(466); - context.data.word(324) = context.ax; + context.di = 2892; + context.ax = context.data.word(464); + context.data.word(322) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(468); - context.data.word(324) = context.ax; + context.ax = context.data.word(466); + context.data.word(322) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(470); - context.data.word(324) = context.ax; + context.ax = context.data.word(468); + context.data.word(322) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); @@ -11004,12 +11004,12 @@ foundfile2: keyok1: context.es = context.cs; context.di = 2883; - context.ds = context.data.word(324); + context.ds = context.data.word(322); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto findtopictext; - context.al = context.data.byte(270); - context.data.byte(269) = context.al; + context.al = context.data.byte(269); + context.data.byte(268) = context.al; context.al = 11; monmessage(context); return; @@ -11048,7 +11048,7 @@ static void dirfile(Context & context) { context.ds.byte(context.di) = context.al; context.push(context.es); context.push(context.di); - context.ds = context.data.word(466); + context.ds = context.data.word(464); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11057,7 +11057,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(468); + context.ds = context.data.word(466); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11066,7 +11066,7 @@ static void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(470); + context.ds = context.data.word(468); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11089,7 +11089,7 @@ keyok2: context.ds = context.cs; context.si = 2883+1; context.es = context.cs; - context.di = 2895+1; + context.di = 2892+1; context.cx = 12; while(--context.cx) context._movsb(); monitorlogo(context); @@ -11118,15 +11118,15 @@ static void getkeyandlogo(Context & context) { context._add(context.bx, 1); context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.data.byte(271) = context.al; + context.data.byte(270) = context.al; context._add(context.bx, 2); context.al = context.ds.byte(context.bx); context._sub(context.al, 48); - context.data.byte(276) = context.al; + context.data.byte(275) = context.al; context._add(context.bx, 1); context.push(context.es); context.push(context.bx); - context.al = context.data.byte(276); + context.al = context.data.byte(275); context.ah = 0; context.cx = 26; context._mul(context.cx); @@ -11152,8 +11152,8 @@ static void getkeyandlogo(Context & context) { keyok: context.bx = context.pop(); context.es = context.pop(); - context.al = context.data.byte(271); - context.data.byte(269) = context.al; + context.al = context.data.byte(270); + context.data.byte(268) = context.al; context.al = 0; return; } @@ -11206,7 +11206,7 @@ static void parser(Context & context) { context.al = '='; context._stosb(); context.ds = context.cs; - context.si = 7944; + context.si = 7816; notspace1: context._lodsw(); context._cmp(context.al, 32); @@ -11240,10 +11240,10 @@ static void scrollmonitor(Context & context) { context.push(context.es); context.push(context.ds); printlogo(context); - context.di = context.data.word(318); - context.bx = context.data.word(320); + context.di = context.data.word(316); + context.bx = context.data.word(318); printundermon(context); - context.ax = context.data.word(320); + context.ax = context.data.word(318); worktoscreen(context); context.al = 25; playchannel1(context); @@ -11259,11 +11259,11 @@ static void scrollmonitor(Context & context) { } static void lockmon(Context & context) { - context._cmp(context.data.byte(392), 57); + context._cmp(context.data.byte(391), 57); if (!context.flags.z()) goto notlock; locklighton(context); lockloop: - context._cmp(context.data.byte(392), 57); + context._cmp(context.data.byte(391), 57); if (context.flags.z()) goto lockloop; locklightoff(context); notlock: @@ -11271,10 +11271,10 @@ notlock: } static void monitorlogo(Context & context) { - context.al = context.data.byte(269); - context._cmp(context.al, context.data.byte(270)); + context.al = context.data.byte(268); + context._cmp(context.al, context.data.byte(269)); if (context.flags.z()) goto notnewlogo; - context.data.byte(270) = context.al; + context.data.byte(269) = context.al; printlogo(context); printundermon(context); worktoscreen(context); @@ -11293,7 +11293,7 @@ notnewlogo: static void printlogo(Context & context) { context.di = 56; context.bx = 32; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 0; context.ah = 0; showframe(context); @@ -11304,7 +11304,7 @@ static void printlogo(Context & context) { static void showcurrentfile(Context & context) { context.di = 178; context.bx = 37; - context.si = 2895+1; + context.si = 2892+1; curfileloop: context.al = context.ds.byte(context.si); context._cmp(context.al, 0); @@ -11312,7 +11312,7 @@ curfileloop: context._add(context.si, 1); context.push(context.si); modifychar(context); - context.ds = context.data.word(406); + context.ds = context.data.word(404); context.ah = 0; printchar(context); context.si = context.pop(); @@ -11322,7 +11322,7 @@ finishfile: } static void monmessage(Context & context) { - context.es = context.data.word(466); + context.es = context.data.word(464); context.bx = 66*2; context.cl = context.al; context.ch = 0; @@ -11337,7 +11337,7 @@ monmessageloop: } static void processtrigger(Context & context) { - context._cmp(context.data.byte(55), '1'); + context._cmp(context.data.byte(54), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); @@ -11345,7 +11345,7 @@ static void processtrigger(Context & context) { triggermessage(context); return; notfirsttrigger: - context._cmp(context.data.byte(55), '2'); + context._cmp(context.data.byte(54), '2'); if (!context.flags.z()) goto notsecondtrigger; context.al = 9; setlocation(context); @@ -11353,7 +11353,7 @@ notfirsttrigger: triggermessage(context); return; notsecondtrigger: - context._cmp(context.data.byte(55), '3'); + context._cmp(context.data.byte(54), '3'); if (!context.flags.z()) goto notthirdtrigger; context.al = 2; setlocation(context); @@ -11369,7 +11369,7 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiget(context); context.ax = context.pop(); @@ -11388,11 +11388,11 @@ static void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(402); + context.ds = context.data.word(400); context.si = 0; multiput(context); worktoscreen(context); - context.data.byte(55) = 0; + context.data.byte(54) = 0; return; } @@ -11403,13 +11403,13 @@ static void printcurs(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.es); - context.di = context.data.word(312); - context.bx = context.data.word(314); + context.di = context.data.word(310); + context.bx = context.data.word(312); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); context.ch = 11; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0; context.push(context.di); context.push(context.bx); @@ -11418,14 +11418,14 @@ static void printcurs(Context & context) { context.di = context.pop(); context.push(context.bx); context.push(context.di); - context._add(context.data.word(138), 1); - context.ax = context.data.word(138); + context._add(context.data.word(136), 1); + context.ax = context.data.word(136); context._and(context.al, 16); if (!context.flags.z()) goto flashcurs; context.al = '/'; context._sub(context.al, 32); context.ah = 0; - context.ds = context.data.word(406); + context.ds = context.data.word(404); showframe(context); flashcurs: context.di = context.pop(); @@ -11450,8 +11450,8 @@ static void delcurs(Context & context) { context.push(context.ds); context.push(context.dx); context.push(context.si); - context.di = context.data.word(312); - context.bx = context.data.word(314); + context.di = context.data.word(310); + context.bx = context.data.word(312); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); @@ -11459,7 +11459,7 @@ static void delcurs(Context & context) { context.push(context.di); context.push(context.bx); context.push(context.cx); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0; multiput(context); context.cx = context.pop(); @@ -11477,17 +11477,17 @@ finishcurdel: } static void useobject(Context & context) { - context.data.byte(95) = 255; - context._cmp(context.data.byte(100), 229); + context.data.byte(94) = 255; + context._cmp(context.data.byte(99), 229); if (context.flags.z()) goto alreadyuse; - context.data.byte(100) = 229; - context.bl = context.data.byte(99); - context.bh = context.data.byte(102); + context.data.byte(99) = 229; + context.bl = context.data.byte(98); + context.bh = context.data.byte(101); context.al = 51; commandwithob(context); alreadyuse: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nouse; context._and(context.ax, 1); if (!context.flags.z()) goto douse; @@ -11499,13 +11499,13 @@ douse: } static void useroutine(Context & context) { - context._cmp(context.data.byte(184), 50); + context._cmp(context.data.byte(183), 50); if (context.flags.c()) goto nodream7; - context._cmp(context.data.byte(232), 0); + context._cmp(context.data.byte(231), 0); if (!context.flags.z()) goto powerok; return; powerok: - context.data.byte(232) = 0; + context.data.byte(231) = 0; nodream7: getanyad(context); context.dx = context.ds; @@ -11569,7 +11569,7 @@ cantuse2: context.cx = 50; hangonp(context); putbackobstuff(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; return; } @@ -11582,21 +11582,21 @@ static void wheelsound(Context & context) { } static void runtap(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto tapwith; withwhat(context); return; tapwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcupfromtap; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11609,7 +11609,7 @@ tapwith: putbackobstuff(context); return; fillcupfromtap: - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+15) = 'F'-'A'; context.al = 8; @@ -11636,9 +11636,9 @@ static void playguitar(Context & context) { } static void hotelcontrol(Context & context) { - context._cmp(context.data.byte(184), 21); + context._cmp(context.data.byte(183), 21); if (!context.flags.z()) goto notrightcont; - context._cmp(context.data.byte(148), 33); + context._cmp(context.data.byte(147), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); @@ -11658,14 +11658,14 @@ static void hotelbell(Context & context) { } static void opentomb(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); - context.data.word(21) = 35*2; - context.data.word(23) = 1; - context.data.word(25) = 33; - context.data.byte(27) = 1; + context.data.word(19) = 35*2; + context.data.word(21) = 1; + context.data.word(23) = 33; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } @@ -11673,7 +11673,7 @@ static void usetrainer(Context & context) { getanyad(context); context._cmp(context.ds.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); makeworn(context); showseconduse(context); putbackobstuff(context); @@ -11703,21 +11703,21 @@ static void nothelderror(Context & context) { } static void usepipe(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto pipewith; withwhat(context); return; pipewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcup; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11734,7 +11734,7 @@ fillcup: context.al = 36; showpuztext(context); putbackobstuff(context); - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+15) = 'F'-'A'; return; @@ -11747,35 +11747,35 @@ alreadyfull: } static void usefullcart(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); context.al = 2; - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._add(context.ah, 6); turnanypathon(context); - context.data.byte(475) = 4; - context.data.byte(133) = 4; - context.data.byte(135) = 4; - context.data.byte(477) = 4; + context.data.byte(474) = 4; + context.data.byte(132) = 4; + context.data.byte(134) = 4; + context.data.byte(476) = 4; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; showfirstuse(context); - context.data.word(21) = 72*2; - context.data.word(23) = 58; - context.data.word(25) = 142; - context.data.byte(27) = 1; + context.data.word(19) = 72*2; + context.data.word(21) = 58; + context.data.word(23) = 142; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } static void useplinth(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); return; plinthwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'D'; context.ch = 'K'; context.dl = 'E'; @@ -11786,16 +11786,16 @@ plinthwith: putbackobstuff(context); return; isrightkey: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showseconduse(context); - context.data.word(21) = 220; - context.data.word(23) = 0; - context.data.word(25) = 104; - context.data.byte(27) = 1; + context.data.word(19) = 220; + context.data.word(21) = 0; + context.data.word(23) = 104; context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.al = context.data.byte(67); - context.data.byte(188) = context.al; + context.data.byte(25) = 1; + context.data.byte(102) = 1; + context.al = context.data.byte(66); + context.data.byte(187) = context.al; return; } @@ -11803,63 +11803,63 @@ static void chewy(Context & context) { showfirstuse(context); getanyad(context); context.ds.byte(context.bx+2) = 255; - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void useladder(Context & context) { showfirstuse(context); - context._sub(context.data.byte(148), 11); + context._sub(context.data.byte(147), 11); findroominloc(context); - context.data.byte(133) = 6; - context.data.byte(135) = 6; - context.data.byte(475) = 0; - context.data.byte(478) = 0; + context.data.byte(132) = 6; + context.data.byte(134) = 6; + context.data.byte(474) = 0; context.data.byte(477) = 0; + context.data.byte(476) = 0; findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; + context.data.byte(186) = 1; + context.data.byte(102) = 1; return; } static void useladderb(Context & context) { showfirstuse(context); - context._add(context.data.byte(148), 11); + context._add(context.data.byte(147), 11); findroominloc(context); - context.data.byte(133) = 2; - context.data.byte(135) = 2; - context.data.byte(475) = 1; - context.data.byte(478) = 1; + context.data.byte(132) = 2; + context.data.byte(134) = 2; + context.data.byte(474) = 1; context.data.byte(477) = 1; + context.data.byte(476) = 1; findxyfrompath(context); - context.data.byte(187) = 1; - context.data.byte(103) = 1; + context.data.byte(186) = 1; + context.data.byte(102) = 1; return; } static void slabdoora(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 13; - context._cmp(context.data.byte(66), 3); + context.data.byte(25) = 1; + context.data.word(21) = 13; + context._cmp(context.data.byte(65), 3); if (!context.flags.z()) goto slabawrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 42; - context.data.byte(188) = 47; + context._add(context.data.byte(1), 1); + context.data.word(19) = 60; + context.data.word(23) = 42; + context.data.byte(187) = 47; return; slabawrong: - context.data.word(21) = 40; - context.data.word(25) = 34; - context.data.byte(27) = 1; + context.data.word(19) = 40; + context.data.word(23) = 34; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void slabdoorb(Context & context) { - context._cmp(context.data.byte(66), 1); + context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; context.ah = 'H'; @@ -11874,120 +11874,120 @@ static void slabdoorb(Context & context) { return; gotcrystal: showfirstuse(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context._add(context.data.byte(1), 1); + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 60; - context.data.word(25) = 71; - context.data.byte(188) = 47; + context.data.byte(25) = 1; + context.data.word(21) = 44; + context.data.word(19) = 60; + context.data.word(23) = 71; + context.data.byte(187) = 47; return; slabbwrong: showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 44; - context.data.word(21) = 40; - context.data.word(25) = 63; - context.data.byte(27) = 1; + context.data.byte(25) = 1; + context.data.word(21) = 44; + context.data.word(19) = 40; + context.data.word(23) = 63; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void slabdoord(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 75; - context._cmp(context.data.byte(66), 0); + context.data.byte(25) = 1; + context.data.word(21) = 75; + context._cmp(context.data.byte(65), 0); if (!context.flags.z()) goto slabcwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 102; - context.data.byte(188) = 47; + context._add(context.data.byte(1), 1); + context.data.word(19) = 60; + context.data.word(23) = 102; + context.data.byte(187) = 47; return; slabcwrong: - context.data.word(21) = 40; - context.data.word(25) = 94; - context.data.byte(27) = 1; + context.data.word(19) = 40; + context.data.word(23) = 94; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void slabdoorc(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 108; - context._cmp(context.data.byte(66), 4); + context.data.byte(25) = 1; + context.data.word(21) = 108; + context._cmp(context.data.byte(65), 4); if (!context.flags.z()) goto slabdwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 135; - context.data.byte(188) = 47; + context._add(context.data.byte(1), 1); + context.data.word(19) = 60; + context.data.word(23) = 135; + context.data.byte(187) = 47; return; slabdwrong: - context.data.word(21) = 40; - context.data.word(25) = 127; - context.data.byte(27) = 1; + context.data.word(19) = 40; + context.data.word(23) = 127; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void slabdoore(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 141; - context._cmp(context.data.byte(66), 5); + context.data.byte(25) = 1; + context.data.word(21) = 141; + context._cmp(context.data.byte(65), 5); if (!context.flags.z()) goto slabewrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 168; - context.data.byte(188) = 47; + context._add(context.data.byte(1), 1); + context.data.word(19) = 60; + context.data.word(23) = 168; + context.data.byte(187) = 47; return; slabewrong: - context.data.word(21) = 40; - context.data.word(25) = 160; - context.data.byte(27) = 1; + context.data.word(19) = 40; + context.data.word(23) = 160; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void slabdoorf(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.byte(27) = 1; + context.data.byte(102) = 1; context.data.byte(26) = 1; - context.data.word(23) = 171; - context._cmp(context.data.byte(66), 2); + context.data.byte(25) = 1; + context.data.word(21) = 171; + context._cmp(context.data.byte(65), 2); if (!context.flags.z()) goto slabfwrong; - context._add(context.data.byte(2), 1); - context.data.word(21) = 60; - context.data.word(25) = 197; - context.data.byte(188) = 47; + context._add(context.data.byte(1), 1); + context.data.word(19) = 60; + context.data.word(23) = 197; + context.data.byte(187) = 47; return; slabfwrong: - context.data.word(21) = 40; - context.data.word(25) = 189; - context.data.byte(27) = 1; + context.data.word(19) = 40; + context.data.word(23) = 189; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void useslab(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto slabwith; withwhat(context); return; slabwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'J'; context.ch = 'E'; context.dl = 'W'; @@ -12000,10 +12000,10 @@ slabwith: putbackobstuff(context); return; nextslab: - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.data.byte(99); + context.al = context.data.byte(98); context.push(context.ax); removesetobject(context); context.ax = context.pop(); @@ -12015,26 +12015,26 @@ nextslab: if (!context.flags.z()) goto notlastslab; context.al = 0; turnpathon(context); - context.data.word(21) = 22; - context.data.word(23) = 35; - context.data.word(25) = 48; - context.data.byte(27) = 1; + context.data.word(19) = 22; + context.data.word(21) = 35; + context.data.word(23) = 48; context.data.byte(26) = 1; + context.data.byte(25) = 1; notlastslab: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void usecart(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto cartwith; withwhat(context); return; cartwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'R'; context.ch = 'O'; context.dl = 'C'; @@ -12047,31 +12047,31 @@ cartwith: putbackobstuff(context); return; nextcart: - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+2) = 0; - context.al = context.data.byte(99); + context.al = context.data.byte(98); context.push(context.ax); removesetobject(context); context.ax = context.pop(); context._add(context.al, 1); placesetobject(context); - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void useclearbox(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); return; clearboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'R'; context.ch = 'A'; context.dl = 'I'; @@ -12084,57 +12084,57 @@ clearboxwith: putbackobstuff(context); return; openbox: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 67; - context.data.word(25) = 105; - context.data.byte(27) = 1; + context.data.word(19) = 80; + context.data.word(21) = 67; + context.data.word(23) = 105; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } static void usecoveredbox(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 41; - context.data.word(25) = 66; - context.data.byte(27) = 1; + context.data.word(19) = 50; + context.data.word(21) = 41; + context.data.word(23) = 66; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } static void userailing(Context & context) { showfirstuse(context); - context.data.word(21) = 80; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; + context.data.word(19) = 80; + context.data.word(21) = 0; + context.data.word(23) = 30; context.data.byte(26) = 1; - context.data.byte(103) = 1; - context.data.byte(56) = 4; + context.data.byte(25) = 1; + context.data.byte(102) = 1; + context.data.byte(55) = 4; return; } static void useopenbox(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); return; openboxwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'F'; compare(context); if (context.flags.z()) goto destoryopenbox; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -12144,21 +12144,21 @@ openboxwith: showfirstuse(context); return; destoryopenbox: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); context.cx = 300; context.al = 37; showpuztext(context); - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+15) = 'E'-'A'; - context.data.word(21) = 140; - context.data.word(23) = 105; - context.data.word(25) = 181; - context.data.byte(27) = 1; + context.data.word(19) = 140; + context.data.word(21) = 105; + context.data.word(23) = 181; context.data.byte(26) = 1; + context.data.byte(25) = 1; context.al = 4; turnpathon(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; openboxwrong: context.cx = 300; @@ -12169,11 +12169,11 @@ openboxwrong: } static void wearwatch(Context & context) { - context._cmp(context.data.byte(3), 1); + context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); - context.data.byte(3) = 1; - context.data.byte(103) = 1; + context.data.byte(2) = 1; + context.data.byte(102) = 1; getanyad(context); makeworn(context); return; @@ -12184,11 +12184,11 @@ wearingwatch: } static void wearshades(Context & context) { - context._cmp(context.data.byte(4), 1); + context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto wearingshades; - context.data.byte(4) = 1; + context.data.byte(3) = 1; showfirstuse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; getanyad(context); makeworn(context); return; @@ -12199,17 +12199,17 @@ wearingshades: } static void sitdowninbar(Context & context) { - context._cmp(context.data.byte(32), -1); + context._cmp(context.data.byte(31), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); - context.data.word(21) = 50; - context.data.word(23) = 55; - context.data.word(25) = 71; - context.data.word(29) = 73; - context.data.word(31) = 83; - context.data.byte(27) = 1; + context.data.word(19) = 50; + context.data.word(21) = 55; + context.data.word(23) = 71; + context.data.word(27) = 73; + context.data.word(29) = 83; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; satdown: showseconduse(context); @@ -12219,23 +12219,23 @@ satdown: static void usechurchhole(Context & context) { showfirstuse(context); - context.data.byte(103) = 1; - context.data.word(21) = 28; - context.data.word(23) = 13; - context.data.word(25) = 26; - context.data.byte(27) = 1; + context.data.byte(102) = 1; + context.data.word(19) = 28; + context.data.word(21) = 13; + context.data.word(23) = 26; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; } static void usehole(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto holewith; withwhat(context); return; holewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'H'; context.ch = 'N'; context.dl = 'D'; @@ -12251,11 +12251,11 @@ righthand: showfirstuse(context); context.al = 86; removesetobject(context); - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+2) = 255; - context.data.byte(47) = 1; - context.data.byte(103) = 1; + context.data.byte(46) = 1; + context.data.byte(102) = 1; return; } @@ -12274,43 +12274,43 @@ static void usealtar(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto thingsonaltar; - context._cmp(context.data.byte(47), 1); + context._cmp(context.data.byte(46), 1); if (context.flags.z()) goto movealtar; context.cx = 300; context.al = 23; showpuztext(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; movealtar: - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showseconduse(context); - context.data.word(21) = 160; - context.data.word(23) = 81; - context.data.word(25) = 174; - context.data.byte(27) = 1; + context.data.word(19) = 160; + context.data.word(21) = 81; + context.data.word(23) = 174; context.data.byte(26) = 1; + context.data.byte(25) = 1; context.al = 47; context.bl = 52; context.bh = 76; context.cx = 32; context.dx = 98; setuptimeduse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; thingsonaltar: showfirstuse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void opentvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); return; tvdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'U'; context.ch = 'L'; context.dl = 'O'; @@ -12324,8 +12324,8 @@ tvdoorwith: return; keyontv: showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; + context.data.byte(36) = 0; + context.data.byte(102) = 1; return; } @@ -12333,7 +12333,7 @@ static void usedryer(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12343,7 +12343,7 @@ static void openlouis(Context & context) { context.cl = 3; context.ch = 8; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12362,17 +12362,17 @@ static void openyourneighbour(Context & context) { context.cl = 255; context.ch = 255; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void usewindow(Context & context) { - context._cmp(context.data.byte(475), 6); + context._cmp(context.data.byte(474), 6); if (!context.flags.z()) goto notonbalc; - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); - context.data.byte(188) = 29; - context.data.byte(103) = 1; + context.data.byte(187) = 29; + context.data.byte(102) = 1; return; notonbalc: showseconduse(context); @@ -12396,19 +12396,19 @@ static void usebalcony(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context._add(context.data.byte(2), 1); - context.data.byte(475) = 6; - context.data.byte(478) = 6; + context._add(context.data.byte(1), 1); + context.data.byte(474) = 6; context.data.byte(477) = 6; + context.data.byte(476) = 6; findxyfrompath(context); switchryanoff(context); - context.data.byte(187) = 1; - context.data.word(21) = 30*2; - context.data.word(23) = 183; - context.data.word(25) = 212; - context.data.byte(27) = 1; + context.data.byte(186) = 1; + context.data.word(19) = 30*2; + context.data.word(21) = 183; + context.data.word(23) = 212; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } @@ -12418,7 +12418,7 @@ static void openryan(Context & context) { context.cl = 0; context.ch = 6; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12428,7 +12428,7 @@ static void openpoolboss(Context & context) { context.cl = 2; context.ch = 2; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12438,7 +12438,7 @@ static void openeden(Context & context) { context.cl = 6; context.ch = 5; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12448,14 +12448,14 @@ static void opensarters(Context & context) { context.cl = 3; context.ch = 3; entercode(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void isitright(Context & context) { context.bx = context.ds; context.es = context.bx; - context.bx = 8350; + context.bx = 8344; context._cmp(context.ds.byte(context.bx+0), context.al); if (!context.flags.z()) goto notright; context._cmp(context.ds.byte(context.bx+1), context.ah); @@ -12476,13 +12476,13 @@ static void drawitall(Context & context) { } static void openhoteldoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); return; hoteldoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12498,19 +12498,19 @@ keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); - context.data.byte(37) = 0; - context.data.byte(103) = 1; + context.data.byte(36) = 0; + context.data.byte(102) = 1; return; } static void openhoteldoor2(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); return; hoteldoorwith2: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12531,13 +12531,13 @@ keyonhotel2: } static void grafittidoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto grafwith; withwhat(context); return; grafwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'A'; context.ch = 'P'; context.dl = 'E'; @@ -12556,16 +12556,16 @@ dograf: } static void trapdoor(Context & context) { - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); showfirstuse(context); switchryanoff(context); - context.data.word(21) = 20*2; - context.data.word(23) = 181; - context.data.word(25) = 197; - context.data.byte(188) = 26; - context.data.byte(27) = 1; + context.data.word(19) = 20*2; + context.data.word(21) = 181; + context.data.word(23) = 197; + context.data.byte(187) = 26; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } @@ -12573,10 +12573,10 @@ static void callhotellift(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; - context.data.byte(478) = 5; + context.data.byte(38) = 8; + context.data.byte(102) = 1; context.data.byte(477) = 5; + context.data.byte(476) = 5; autosetwalk(context); context.al = 4; turnpathon(context); @@ -12585,19 +12585,19 @@ static void callhotellift(Context & context) { static void calledenslift(Context & context) { showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; + context.data.byte(38) = 8; + context.data.byte(102) = 1; context.al = 2; turnpathon(context); return; } static void calledensdlift(Context & context) { - context._cmp(context.data.byte(35), 1); + context._cmp(context.data.byte(34), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); - context.data.byte(39) = 8; - context.data.byte(103) = 1; + context.data.byte(38) = 8; + context.data.byte(102) = 1; context.al = 2; turnpathon(context); return; @@ -12608,13 +12608,13 @@ edensdhere: } static void usepoolreader(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto poolwith; withwhat(context); return; poolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -12627,7 +12627,7 @@ poolwith: putbackobstuff(context); return; openpool: - context._cmp(context.data.byte(48), 1); + context._cmp(context.data.byte(47), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); @@ -12636,19 +12636,19 @@ canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(39) = 6; - context.data.byte(103) = 1; + context.data.byte(38) = 6; + context.data.byte(102) = 1; return; } static void uselighter(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); return; gotlighterwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'S'; context.ch = 'M'; context.dl = 'K'; @@ -12662,10 +12662,10 @@ cigarette: context.cx = 300; context.al = 9; showpuztext(context); - context.al = context.data.byte(95); + context.al = context.data.byte(94); getexad(context); context.ds.byte(context.bx+2) = 255; - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -12681,13 +12681,13 @@ static void showseconduse(Context & context) { } static void usecardreader1(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); return; gotreader1with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12700,9 +12700,9 @@ gotreader1with: putbackobstuff(context); return; correctcard: - context._cmp(context.data.byte(49), 0); + context._cmp(context.data.byte(48), 0); if (context.flags.z()) goto notyet; - context._cmp(context.data.word(16), 0); + context._cmp(context.data.word(14), 0); if (context.flags.z()) goto getscash; context.cx = 300; context.al = 17; @@ -12715,9 +12715,9 @@ getscash: context.cx = 300; context.al = 18; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(16) = 12432; - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context.data.word(14) = 12432; + context.data.byte(102) = 1; return; notyet: showfirstuse(context); @@ -12726,13 +12726,13 @@ notyet: } static void usecardreader2(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); return; gotreader2with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12745,11 +12745,11 @@ gotreader2with: putbackobstuff(context); return; correctcard2: - context._cmp(context.data.byte(50), 0); + context._cmp(context.data.byte(49), 0); if (context.flags.z()) goto notyetboss; - context._cmp(context.data.word(16), 0); + context._cmp(context.data.word(14), 0); if (context.flags.z()) goto nocash; - context._cmp(context.data.byte(46), 2); + context._cmp(context.data.byte(45), 2); if (context.flags.z()) goto alreadygotnew; context.al = 18; playchannel1(context); @@ -12758,10 +12758,10 @@ correctcard2: showpuztext(context); context.al = 94; placesetobject(context); - context.data.byte(46) = 1; - context._sub(context.data.word(16), 2000); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context.data.byte(45) = 1; + context._sub(context.data.word(14), 2000); + context._add(context.data.byte(1), 1); + context.data.byte(102) = 1; return; nocash: context.cx = 300; @@ -12782,13 +12782,13 @@ notyetboss: } static void usecardreader3(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); return; gotreader3with: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12801,19 +12801,19 @@ gotreader3with: putbackobstuff(context); return; rightcard: - context._cmp(context.data.byte(51), 0); + context._cmp(context.data.byte(50), 0); if (context.flags.z()) goto notyetrecep; - context._cmp(context.data.byte(52), 0); + context._cmp(context.data.byte(51), 0); if (!context.flags.z()) goto alreadyusedit; context.al = 16; playchannel1(context); context.cx = 300; context.al = 25; showpuztext(context); - context._add(context.data.byte(2), 1); - context._sub(context.data.word(16), 8300); - context.data.byte(52) = 1; - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context._sub(context.data.word(14), 8300); + context.data.byte(51) = 1; + context.data.byte(102) = 1; return; alreadyusedit: context.cx = 300; @@ -12836,11 +12836,11 @@ static void usecashcard(Context & context) { showman(context); context.di = 114; context.bx = 120-3; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 39; context.ah = 0; showframe(context); - context.ax = context.data.word(16); + context.ax = context.data.word(14); moneypoke(context); getobtextstart(context); nextcolon(context); @@ -12855,7 +12855,7 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3385; - context.data.word(71) = 91*2+75; + context.data.word(69) = 91*2+75; context.al = 0; context.ah = 0; context.dl = 240; @@ -12864,12 +12864,12 @@ static void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3390; - context.data.word(71) = 91*2+85; + context.data.word(69) = 91*2+85; context.al = 0; context.ah = 0; context.dl = 240; printdirect(context); - context.data.word(71) = 0; + context.data.word(69) = 0; worktoscreenm(context); context.cx = 400; hangonp(context); @@ -12880,13 +12880,13 @@ static void usecashcard(Context & context) { } static void lookatcard(Context & context) { - context.data.byte(131) = 1; + context.data.byte(130) = 1; getridofreels(context); loadkeypad(context); createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 42; context.ah = 128; showframe(context); @@ -12908,7 +12908,7 @@ static void lookatcard(Context & context) { createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 42; context.ah = 128; showframe(context); @@ -12923,7 +12923,7 @@ static void lookatcard(Context & context) { worktoscreenm(context); context.cx = 200; hangonw(context); - context.data.byte(131) = 0; + context.data.byte(130) = 0; getridoftemp(context); restorereels(context); putbackobstuff(context); @@ -12970,31 +12970,31 @@ numberpoke3: } static void usecontrol(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); return; gotcontrolwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; context.dh = 'A'; compare(context); if (context.flags.z()) goto rightkey; - context._cmp(context.data.byte(184), 21); + context._cmp(context.data.byte(183), 21); if (!context.flags.z()) goto balls; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto jimmycontrols; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13008,26 +13008,26 @@ balls: rightkey: context.al = 16; playchannel1(context); - context._cmp(context.data.byte(9), 21); + context._cmp(context.data.byte(8), 21); if (context.flags.z()) goto goingdown; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(188) = 21; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.data.byte(187) = 21; + context.data.byte(39) = 8; + context.data.byte(38) = 0; + context.data.word(19) = 80; + context.data.byte(102) = 1; return; goingdown: context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(188) = 30; - context.data.byte(40) = 8; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.data.byte(187) = 30; + context.data.byte(39) = 8; + context.data.byte(38) = 0; + context.data.word(19) = 80; + context.data.byte(102) = 1; return; jimmycontrols: context.al = 50; @@ -13047,41 +13047,41 @@ jimmycontrols: context.cx = 300; context.al = 10; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context.data.byte(102) = 1; return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); - context._add(context.data.byte(2), 1); + context._add(context.data.byte(1), 1); putbackobstuff(context); return; } static void usehatch(Context & context) { showfirstuse(context); - context.data.byte(188) = 40; - context.data.byte(103) = 1; + context.data.byte(187) = 40; + context.data.byte(102) = 1; return; } static void usewire(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); return; gotwirewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto wireknife; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13107,8 +13107,8 @@ wireknife: context.cx = 300; context.al = 11; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context.data.byte(102) = 1; return; } @@ -13124,21 +13124,21 @@ static void usehandle(Context & context) { context.cx = 300; context.al = 12; showpuztext(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; havecutwire: context.cx = 300; context.al = 13; showpuztext(context); - context.data.byte(188) = 22; - context.data.byte(103) = 1; + context.data.byte(187) = 22; + context.data.byte(102) = 1; return; } static void useelevator1(Context & context) { showfirstuse(context); selectlocation(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } @@ -13154,47 +13154,47 @@ static void showfirstuse(Context & context) { static void useelevator3(Context & context) { showfirstuse(context); - context.data.byte(40) = 20; - context.data.byte(188) = 34; - context.data.word(23) = 46; - context.data.word(25) = 63; - context.data.byte(27) = 1; + context.data.byte(39) = 20; + context.data.byte(187) = 34; + context.data.word(21) = 46; + context.data.word(23) = 63; context.data.byte(26) = 1; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.word(19) = 80; + context.data.byte(102) = 1; return; } static void useelevator4(Context & context) { showfirstuse(context); - context.data.word(23) = 0; - context.data.word(25) = 11; - context.data.byte(27) = 1; + context.data.word(21) = 0; + context.data.word(23) = 11; context.data.byte(26) = 1; - context.data.byte(40) = 20; - context.data.word(21) = 80; - context.data.byte(103) = 1; - context.data.byte(188) = 24; + context.data.byte(25) = 1; + context.data.byte(39) = 20; + context.data.word(19) = 80; + context.data.byte(102) = 1; + context.data.byte(187) = 24; return; } static void useelevator2(Context & context) { - context._cmp(context.data.byte(9), 23); + context._cmp(context.data.byte(8), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); - context.data.byte(188) = 23; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.data.byte(187) = 23; + context.data.byte(39) = 20; + context.data.byte(38) = 0; + context.data.word(19) = 80; + context.data.byte(102) = 1; return; inpoolhall: showfirstuse(context); - context.data.byte(188) = 31; - context.data.byte(40) = 20; - context.data.byte(39) = 0; - context.data.word(21) = 80; - context.data.byte(103) = 1; + context.data.byte(187) = 31; + context.data.byte(39) = 20; + context.data.byte(38) = 0; + context.data.word(19) = 80; + context.data.byte(102) = 1; return; } @@ -13203,20 +13203,20 @@ static void useelevator5(Context & context) { placesetobject(context); context.al = 0; removesetobject(context); - context.data.byte(188) = 20; - context.data.word(21) = 80; - context.data.byte(35) = 1; - context.data.byte(40) = 8; - context.data.byte(103) = 1; + context.data.byte(187) = 20; + context.data.word(19) = 80; + context.data.byte(34) = 1; + context.data.byte(39) = 8; + context.data.byte(102) = 1; return; } static void usekey(Context & context) { - context._cmp(context.data.byte(9), 5); + context._cmp(context.data.byte(8), 5); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 30); + context._cmp(context.data.byte(8), 30); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(9), 21); + context._cmp(context.data.byte(8), 21); if (context.flags.z()) goto usekey2; context.cx = 200; context.al = 1; @@ -13224,25 +13224,25 @@ static void usekey(Context & context) { putbackobstuff(context); return; usekey1: - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); + context._cmp(context.data.byte(148), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(40) = 100; - context.data.byte(103) = 1; + context.data.byte(39) = 100; + context.data.byte(102) = 1; return; usekey2: - context._cmp(context.data.byte(148), 11); + context._cmp(context.data.byte(147), 11); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(149), 10); + context._cmp(context.data.byte(148), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(188) = 30; + context.data.byte(187) = 30; context.al = 2; fadescreendown(context); showfirstuse(context); @@ -13257,7 +13257,7 @@ wrongroom1: } static void usestereo(Context & context) { - context._cmp(context.data.byte(9), 0); + context._cmp(context.data.byte(8), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; @@ -13265,9 +13265,9 @@ static void usestereo(Context & context) { putbackobstuff(context); return; stereook: - context._cmp(context.data.byte(148), 11); + context._cmp(context.data.byte(147), 11); if (!context.flags.z()) goto stereonotok; - context._cmp(context.data.byte(149), 0); + context._cmp(context.data.byte(148), 0); if (context.flags.z()) goto stereook2; stereonotok: context.cx = 400; @@ -13314,8 +13314,8 @@ stereoon: } static void usecooker(Context & context) { - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); checkinside(context); context._cmp(context.cl, 114); if (!context.flags.z()) goto foodinside; @@ -13329,14 +13329,14 @@ foodinside: } static void useaxe(Context & context) { - context._cmp(context.data.byte(184), 22); + context._cmp(context.data.byte(183), 22); if (!context.flags.z()) goto notinpool; - context._cmp(context.data.byte(149), 10); + context._cmp(context.data.byte(148), 10); if (context.flags.z()) goto axeondoor; showseconduse(context); - context._add(context.data.byte(2), 1); - context.data.byte(65) = 2; - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context.data.byte(64) = 2; + context.data.byte(102) = 1; removeobfrominv(context); return; notinpool: @@ -13347,25 +13347,25 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; + context._add(context.data.byte(1), 1); + context.data.word(19) = 46*2; + context.data.word(21) = 31; + context.data.word(23) = 77; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; return; } static void useelvdoor(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); return; gotdoorwith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13381,13 +13381,13 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(2), 1); - context.data.word(21) = 46*2; - context.data.word(23) = 31; - context.data.word(25) = 77; - context.data.byte(27) = 1; + context._add(context.data.byte(1), 1); + context.data.word(19) = 46*2; + context.data.word(21) = 31; + context.data.word(23) = 77; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } @@ -13396,8 +13396,8 @@ static void withwhat(Context & context) { showpanel(context); showman(context); showexit(context); - context.al = context.data.byte(99); - context.ah = context.data.byte(102); + context.al = context.data.byte(98); + context.ah = context.data.byte(101); context.es = context.cs; context.di = 5674; copyname(context); @@ -13407,7 +13407,7 @@ static void withwhat(Context & context) { context.al = 63; context.ah = 2; printmessage2(context); - context.di = context.data.word(84); + context.di = context.data.word(82); context._add(context.di, 5); context.bx = 21; context.es = context.cs; @@ -13416,7 +13416,7 @@ static void withwhat(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - context.di = context.data.word(84); + context.di = context.data.word(82); context._add(context.di, 5); context.bx = 21; context.dl = 200; @@ -13424,12 +13424,12 @@ static void withwhat(Context & context) { context.ah = 3; printmessage2(context); fillryan(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(104) = 2; + context.data.byte(103) = 2; return; } @@ -13441,21 +13441,21 @@ static void selectob(Context & context) { blank(context); return; canselectob: - context.data.byte(95) = context.al; - context.data.byte(96) = context.ah; - context._cmp(context.ax, context.data.word(94)); + context.data.byte(94) = context.al; + context.data.byte(95) = context.ah; + context._cmp(context.ax, context.data.word(92)); if (!context.flags.z()) goto diffsub3; - context._cmp(context.data.byte(100), 221); + context._cmp(context.data.byte(99), 221); if (context.flags.z()) goto alreadyselob; - context.data.byte(100) = 221; + context.data.byte(99) = 221; diffsub3: - context.data.word(94) = context.ax; + context.data.word(92) = context.ax; context.bx = context.ax; context.al = 0; commandwithob(context); alreadyselob: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notselob; context._and(context.ax, 1); if (!context.flags.z()) goto doselob; @@ -13463,7 +13463,7 @@ notselob: return; doselob: delpointer(context); - context.data.byte(104) = 0; + context.data.byte(103) = 0; useroutine(context); return; } @@ -13490,7 +13490,7 @@ static void findsetobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(428); + context.es = context.data.word(426); context.bx = 0; context.dl = 0; findsetloop: @@ -13518,7 +13518,7 @@ static void findexobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(398); + context.es = context.data.word(396); context.bx = 0+2080+30000; context.dl = 0; findexloop: @@ -13546,7 +13546,7 @@ static void isryanholding(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(398); + context.es = context.data.word(396); context.bx = 0+2080+30000; context.dl = 0; searchinv: @@ -13574,7 +13574,7 @@ nofindininv: } static void checkinside(Context & context) { - context.es = context.data.word(398); + context.es = context.data.word(396); context.bx = 0+2080+30000; context.cl = 0; insideloop: @@ -13620,7 +13620,7 @@ static void putbackobstuff(Context & context) { obpicture(context); describeob(context); undertextline(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -13655,7 +13655,7 @@ static void findpuztext(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(454); + context.es = context.data.word(452); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -13725,8 +13725,8 @@ static void removefreeobject(Context & context) { static void findormake(Context & context) { context.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); context.push(context.ax); - context.es = context.data.word(412); - context.ah = context.data.byte(184); + context.es = context.data.word(410); + context.ah = context.data.byte(183); changeloop: context._cmp(context.ds.byte(context.bx), 255); if (context.flags.z()) goto haventfound; @@ -13749,17 +13749,17 @@ haventfound: } static void switchryanon(Context & context) { - context.data.byte(63) = 255; + context.data.byte(62) = 255; return; } static void switchryanoff(Context & context) { - context.data.byte(63) = 1; + context.data.byte(62) = 1; return; } static void setallchanges(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.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); setallloop: context.ax = context.ds.word(context.bx); @@ -13767,7 +13767,7 @@ setallloop: if (context.flags.z()) goto endsetloop; context.cx = context.ds.word(context.bx+2); context._add(context.bx, 4); - context._cmp(context.ah, context.data.byte(184)); + context._cmp(context.ah, context.data.byte(183)); if (!context.flags.z()) goto setallloop; context.push(context.es); context.push(context.bx); @@ -13799,7 +13799,7 @@ path: context.bx = context.pop(); context._add(context.bx, context.ax); context._add(context.bx, 0); - context.es = context.data.word(450); + context.es = context.data.word(448); context.cx = context.pop(); context.ds.byte(context.bx+6) = context.cl; nopath: @@ -13822,20 +13822,20 @@ beenpickedup: } static void autoappear(Context & context) { - context._cmp(context.data.byte(9), 32); + context._cmp(context.data.byte(8), 32); if (!context.flags.z()) goto notinalley; context.al = 5; resetlocation(context); context.al = 10; setlocation(context); - context.data.byte(183) = 10; + context.data.byte(182) = 10; return; notinalley: - context._cmp(context.data.byte(184), 24); + context._cmp(context.data.byte(183), 24); if (!context.flags.z()) goto notinedens; - context._cmp(context.data.byte(42), 1); + context._cmp(context.data.byte(41), 1); if (!context.flags.z()) goto edenspart2; - context._add(context.data.byte(42), 1); + context._add(context.data.byte(41), 1); context.al = 44; placesetobject(context); context.al = 18; @@ -13854,7 +13854,7 @@ notinalley: removesetobject(context); return; edenspart2: - context._cmp(context.data.byte(43), 1); + context._cmp(context.data.byte(42), 1); if (!context.flags.z()) goto notedens2; context.al = 44; removesetobject(context); @@ -13862,23 +13862,23 @@ edenspart2: removesetobject(context); context.al = 55; placesetobject(context); - context._add(context.data.byte(43), 1); + context._add(context.data.byte(42), 1); notedens2: return; notinedens: - context._cmp(context.data.byte(184), 25); + context._cmp(context.data.byte(183), 25); if (!context.flags.z()) goto notonsartroof; - context.data.byte(34) = 3; + context.data.byte(33) = 3; context.al = 6; resetlocation(context); context.al = 11; setlocation(context); - context.data.byte(183) = 11; + context.data.byte(182) = 11; return; notonsartroof: - context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(183), 2); if (!context.flags.z()) goto notinlouiss; - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(40), 0); if (context.flags.z()) goto notinlouiss; context.al = 23; placesetobject(context); @@ -13887,153 +13887,153 @@ notinlouiss: } static void getundertimed(Context & context) { - context.al = context.data.byte(335); + context.al = context.data.byte(334); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.data.byte(335); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.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(context); return; } static void putundertimed(Context & context) { - context.al = context.data.byte(335); + context.al = context.data.byte(334); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.data.byte(335); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.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(context); return; } static void dumptimedtext(Context & context) { - context._cmp(context.data.byte(337), 1); + context._cmp(context.data.byte(336), 1); if (!context.flags.z()) goto nodumptimed; - context.al = context.data.byte(335); + context.al = context.data.byte(334); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(336); + context.al = context.data.byte(335); context.ah = 0; context.di = context.ax; context.cl = 240; context.ch = 30; multidump(context); - context.data.byte(337) = 0; + context.data.byte(336) = 0; nodumptimed: return; } static void setuptimeduse(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.data.word(326), 0); if (!context.flags.z()) goto cantsetup; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; + context.data.byte(334) = context.bh; + context.data.byte(335) = context.bl; + context.data.word(328) = context.cx; context._add(context.dx, context.cx); - context.data.word(328) = context.dx; + context.data.word(326) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(454); + context.es = context.data.word(452); context.cx = 66*2; context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; + context.data.word(330) = context.es; + context.data.word(332) = context.bx; cantsetup: return; } static void setuptimedtemp(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.data.word(326), 0); if (!context.flags.z()) goto cantsetup2; - context.data.byte(335) = context.bh; - context.data.byte(336) = context.bl; - context.data.word(330) = context.cx; + context.data.byte(334) = context.bh; + context.data.byte(335) = context.bl; + context.data.word(328) = context.cx; context._add(context.dx, context.cx); - context.data.word(328) = context.dx; + context.data.word(326) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); + context.es = context.data.word(464); context.cx = 66*2; context.ax = context.ds.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(332) = context.es; - context.data.word(334) = context.bx; + context.data.word(330) = context.es; + context.data.word(332) = context.bx; cantsetup2: return; } static void usetimedtext(Context & context) { - context._cmp(context.data.word(328), 0); + context._cmp(context.data.word(326), 0); if (context.flags.z()) goto notext; - context._sub(context.data.word(328), 1); - context._cmp(context.data.word(328), 0); + context._sub(context.data.word(326), 1); + context._cmp(context.data.word(326), 0); if (context.flags.z()) goto deltimedtext; - context.ax = context.data.word(328); - context._cmp(context.ax, context.data.word(330)); + context.ax = context.data.word(326); + context._cmp(context.ax, context.data.word(328)); if (context.flags.z()) goto firsttimed; if (!context.flags.c()) goto notext; goto notfirsttimed; firsttimed: getundertimed(context); notfirsttimed: - context.bl = context.data.byte(335); + context.bl = context.data.byte(334); context.bh = 0; - context.al = context.data.byte(336); + context.al = context.data.byte(335); context.ah = 0; context.di = context.ax; - context.es = context.data.word(332); - context.si = context.data.word(334); + context.es = context.data.word(330); + context.si = context.data.word(332); context.dl = 237; context.ah = 0; printdirect(context); - context.data.byte(337) = 1; + context.data.byte(336) = 1; notext: return; deltimedtext: putundertimed(context); - context.data.byte(337) = 1; + context.data.byte(336) = 1; return; } static void edenscdplayer(Context & context) { showfirstuse(context); - context.data.word(21) = 18*2; - context.data.word(23) = 25; - context.data.word(25) = 42; - context.data.byte(27) = 1; + context.data.word(19) = 18*2; + context.data.word(21) = 25; + context.data.word(23) = 42; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; return; } static void usewall(Context & context) { showfirstuse(context); - context._cmp(context.data.byte(475), 3); + context._cmp(context.data.byte(474), 3); if (context.flags.z()) goto gobackover; - context.data.word(21) = 30*2; - context.data.word(23) = 2; - context.data.word(25) = 31; - context.data.byte(27) = 1; + context.data.word(19) = 30*2; + context.data.word(21) = 2; + context.data.word(23) = 31; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; context.al = 3; turnpathon(context); context.al = 4; @@ -14046,19 +14046,19 @@ static void usewall(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context.data.byte(475) = 3; - context.data.byte(477) = 3; + context.data.byte(474) = 3; + context.data.byte(476) = 3; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; switchryanoff(context); return; gobackover: - context.data.word(21) = 30*2; - context.data.word(23) = 34; - context.data.word(25) = 60; - context.data.byte(27) = 1; + context.data.word(19) = 30*2; + context.data.word(21) = 34; + context.data.word(23) = 60; context.data.byte(26) = 1; - context.data.byte(103) = 1; + context.data.byte(25) = 1; + context.data.byte(102) = 1; context.al = 3; turnpathoff(context); context.al = 4; @@ -14071,22 +14071,22 @@ gobackover: turnpathon(context); context.al = 5; turnpathon(context); - context.data.byte(475) = 5; - context.data.byte(477) = 5; + context.data.byte(474) = 5; + context.data.byte(476) = 5; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; switchryanoff(context); return; } static void usechurchgate(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gatewith; withwhat(context); return; gatewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'C'; context.ch = 'U'; context.dl = 'T'; @@ -14100,16 +14100,16 @@ gatewith: return; cutgate: showfirstuse(context); - context.data.word(21) = 64*2; - context.data.word(23) = 4; - context.data.word(25) = 70; - context.data.byte(27) = 1; + context.data.word(19) = 64*2; + context.data.word(21) = 4; + context.data.word(23) = 70; context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(25) = 1; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); context.al = 3; turnpathon(context); - context._cmp(context.data.byte(44), 0); + context._cmp(context.data.byte(43), 0); if (context.flags.z()) goto notopenchurch; context.al = 2; turnpathon(context); @@ -14118,153 +14118,153 @@ notopenchurch: } static void usegun(Context & context) { - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); return; istakengun: - context._cmp(context.data.byte(184), 22); + context._cmp(context.data.byte(183), 22); if (!context.flags.z()) goto notinpoolroom; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 39; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(64) = 1; + context.data.byte(63) = 39; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); return; notinpoolroom: - context._cmp(context.data.byte(184), 25); + context._cmp(context.data.byte(183), 25); if (!context.flags.z()) goto nothelicopter; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(65) = 1; - context.data.byte(64) = 19; - context.data.byte(103) = 1; - context.data.byte(66) = 2; - context.data.byte(67) = 38; - context.data.byte(43) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(64) = 1; + context.data.byte(63) = 19; + context.data.byte(102) = 1; + context.data.byte(65) = 2; + context.data.byte(66) = 38; + context.data.byte(42) = 1; + context._add(context.data.byte(1), 1); return; nothelicopter: - context._cmp(context.data.byte(184), 27); + context._cmp(context.data.byte(183), 27); if (!context.flags.z()) goto notinrockroom; context.cx = 300; context.al = 46; showpuztext(context); - context.data.byte(234) = 2; - context.data.byte(41) = 1; - context.data.byte(65) = 1; - context.data.byte(34) = 1; - context.data.byte(103) = 1; - context.data.byte(67) = 32; - context.data.byte(66) = 0; - context._add(context.data.byte(2), 1); + context.data.byte(233) = 2; + context.data.byte(40) = 1; + context.data.byte(64) = 1; + context.data.byte(33) = 1; + context.data.byte(102) = 1; + context.data.byte(66) = 32; + context.data.byte(65) = 0; + context._add(context.data.byte(1), 1); return; notinrockroom: - context._cmp(context.data.byte(184), 8); + context._cmp(context.data.byte(183), 8); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(149), 40); + context._cmp(context.data.byte(148), 40); if (!context.flags.z()) goto notbystudio; context.al = 92; issetobonmap(context); if (context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(475), 9); + context._cmp(context.data.byte(474), 9); if (context.flags.z()) goto notbystudio; - context.data.byte(478) = 9; context.data.byte(477) = 9; + context.data.byte(476) = 9; autosetwalk(context); - context.data.byte(65) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(64) = 1; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); return; notbystudio: - context._cmp(context.data.byte(184), 6); + context._cmp(context.data.byte(183), 6); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(148), 11); + context._cmp(context.data.byte(147), 11); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(149), 20); + context._cmp(context.data.byte(148), 20); if (!context.flags.z()) goto notsarters; context.al = 5; issetobonmap(context); if (!context.flags.z()) goto notsarters; - context.data.byte(478) = 1; context.data.byte(477) = 1; + context.data.byte(476) = 1; autosetwalk(context); context.al = 5; removesetobject(context); context.al = 6; placesetobject(context); context.al = 1; - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._sub(context.ah, 1); turnanypathon(context); - context.data.byte(35) = 1; - context.data.word(21) = 40*2; - context.data.word(23) = 4; - context.data.word(25) = 43; - context.data.byte(27) = 1; + context.data.byte(34) = 1; + context.data.word(19) = 40*2; + context.data.word(21) = 4; + context.data.word(23) = 43; context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(25) = 1; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); return; notsarters: - context._cmp(context.data.byte(184), 29); + context._cmp(context.data.byte(183), 29); if (!context.flags.z()) goto notaide; - context.data.byte(103) = 1; + context.data.byte(102) = 1; context.al = 13; resetlocation(context); context.al = 12; setlocation(context); - context.data.byte(183) = 12; - context.data.byte(478) = 2; + context.data.byte(182) = 12; context.data.byte(477) = 2; + context.data.byte(476) = 2; autosetwalk(context); - context.data.word(21) = 164*2; - context.data.word(23) = 3; - context.data.word(25) = 164; - context.data.byte(27) = 1; + context.data.word(19) = 164*2; + context.data.word(21) = 3; + context.data.word(23) = 164; context.data.byte(26) = 1; - context.data.byte(44) = 1; - context.data.byte(66) = 3; - context.data.byte(67) = 33; - context._add(context.data.byte(2), 1); + context.data.byte(25) = 1; + context.data.byte(43) = 1; + context.data.byte(65) = 3; + context.data.byte(66) = 33; + context._add(context.data.byte(1), 1); return; notaide: - context._cmp(context.data.byte(184), 23); + context._cmp(context.data.byte(183), 23); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(148), 0); + context._cmp(context.data.byte(147), 0); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(149), 50); + context._cmp(context.data.byte(148), 50); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(475), 5); + context._cmp(context.data.byte(474), 5); if (context.flags.z()) goto pathokboss; - context.data.byte(478) = 5; context.data.byte(477) = 5; + context.data.byte(476) = 5; autosetwalk(context); pathokboss: - context.data.byte(65) = 1; - context.data.byte(103) = 1; + context.data.byte(64) = 1; + context.data.byte(102) = 1; return; notwithboss: - context._cmp(context.data.byte(184), 8); + context._cmp(context.data.byte(183), 8); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(148), 11); + context._cmp(context.data.byte(147), 11); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(149), 10); + context._cmp(context.data.byte(148), 10); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(475), 2); + context._cmp(context.data.byte(474), 2); if (context.flags.z()) goto pathoktv; - context.data.byte(478) = 2; context.data.byte(477) = 2; + context.data.byte(476) = 2; autosetwalk(context); pathoktv: - context.data.byte(65) = 1; - context.data.byte(103) = 1; + context.data.byte(64) = 1; + context.data.byte(102) = 1; return; nottvsoldier: showfirstuse(context); @@ -14273,14 +14273,14 @@ nottvsoldier: } static void useshield(Context & context) { - context._cmp(context.data.byte(184), 20); + context._cmp(context.data.byte(183), 20); if (!context.flags.z()) goto notinsartroom; - context._cmp(context.data.byte(64), 0); + context._cmp(context.data.byte(63), 0); if (context.flags.z()) goto notinsartroom; - context.data.byte(65) = 3; + context.data.byte(64) = 3; showseconduse(context); - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); removeobfrominv(context); return; notinsartroom: @@ -14295,20 +14295,20 @@ static void usebuttona(Context & context) { if (context.flags.z()) goto donethisbit; showfirstuse(context); context.al = 0; - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._sub(context.ah, 1); turnanypathon(context); context.al = 9; removesetobject(context); context.al = 95; placesetobject(context); - context.data.word(21) = 15*2; - context.data.word(23) = 71; - context.data.word(25) = 85; - context.data.byte(27) = 1; + context.data.word(19) = 15*2; + context.data.word(21) = 71; + context.data.word(23) = 85; context.data.byte(26) = 1; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(25) = 1; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); return; donethisbit: showseconduse(context); @@ -14317,21 +14317,21 @@ donethisbit: } static void useplate(Context & context) { - context._cmp(context.data.byte(95), 255); + context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto platewith; withwhat(context); return; platewith: - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'S'; context.ch = 'C'; context.dl = 'R'; context.dh = 'W'; compare(context); if (context.flags.z()) goto unscrewplate; - context.al = context.data.byte(95); - context.ah = context.data.byte(96); + context.al = context.data.byte(94); + context.ah = context.data.byte(95); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; @@ -14355,8 +14355,8 @@ unscrewplate: removesetobject(context); context.al = 0; placefreeobject(context); - context._add(context.data.byte(2), 1); - context.data.byte(103) = 1; + context._add(context.data.byte(1), 1); + context.data.byte(102) = 1; return; triedknife: context.cx = 300; @@ -14380,19 +14380,19 @@ static void usewinch(Context & context) { context.dh = 'E'; compare(context); if (!context.flags.z()) goto nowinch; - context.data.word(21) = 217*2; - context.data.word(23) = 0; - context.data.word(25) = 217; - context.data.byte(27) = 1; + context.data.word(19) = 217*2; + context.data.word(21) = 0; + context.data.word(23) = 217; context.data.byte(26) = 1; - context.data.byte(183) = 1; - context.data.byte(188) = 45; - context.data.byte(66) = 1; - context.data.byte(67) = 44; - context.data.byte(42) = 1; - context.data.byte(34) = 2; - context.data.byte(103) = 1; - context._add(context.data.byte(2), 1); + context.data.byte(25) = 1; + context.data.byte(182) = 1; + context.data.byte(187) = 45; + context.data.byte(65) = 1; + context.data.byte(66) = 44; + context.data.byte(41) = 1; + context.data.byte(33) = 2; + context.data.byte(102) = 1; + context._add(context.data.byte(1), 1); return; nowinch: showfirstuse(context); @@ -14401,8 +14401,8 @@ nowinch: } static void entercode(Context & context) { - context.data.word(284) = context.ax; - context.data.word(286) = context.cx; + context.data.word(282) = context.ax; + context.data.word(284) = context.cx; getridofreels(context); loadkeypad(context); createpanel(context); @@ -14413,20 +14413,20 @@ static void entercode(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.word(280) = 0; - context.data.byte(103) = 0; + context.data.word(278) = 0; + context.data.byte(102) = 0; keypadloop: delpointer(context); readmouse(context); showkeypad(context); showpointer(context); - context._cmp(context.data.byte(282), 0); + context._cmp(context.data.byte(281), 0); if (context.flags.z()) goto nopresses; - context._sub(context.data.byte(282), 1); + context._sub(context.data.byte(281), 1); goto afterpress; nopresses: - context.data.byte(278) = 255; - context.data.byte(281) = 255; + context.data.byte(277) = 255; + context.data.byte(280) = 255; vsync(context); afterpress: dumppointer(context); @@ -14434,37 +14434,37 @@ afterpress: dumptextline(context); context.bx = 3393; checkcoords(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (context.flags.z()) goto numberright; - context._cmp(context.data.byte(287), 1); + context._cmp(context.data.byte(286), 1); if (!context.flags.z()) goto notendkey; - context._cmp(context.data.byte(37), 0); + context._cmp(context.data.byte(36), 0); if (context.flags.z()) goto numberright; goto keypadloop; notendkey: - context._cmp(context.data.byte(282), 40); + context._cmp(context.data.byte(281), 40); if (!context.flags.z()) goto keypadloop; addtopresslist(context); - context._cmp(context.data.byte(278), 11); + context._cmp(context.data.byte(277), 11); if (!context.flags.z()) goto keypadloop; - context.ax = context.data.word(284); - context.cx = context.data.word(286); + context.ax = context.data.word(282); + context.cx = context.data.word(284); isitright(context); if (!context.flags.z()) goto incorrect; - context.data.byte(37) = 0; + context.data.byte(36) = 0; context.al = 11; playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; + context.data.byte(286) = 120; + context.data.word(278) = 0; goto keypadloop; incorrect: context.al = 11; playchannel1(context); - context.data.byte(287) = 120; - context.data.word(280) = 0; + context.data.byte(286) = 120; + context.data.word(278) = 0; goto keypadloop; numberright: - context.data.byte(131) = 0; + context.data.byte(130) = 0; getridoftemp(context); restorereels(context); redrawmainscrn(context); @@ -14473,44 +14473,44 @@ numberright: } static void loadkeypad(Context & context) { - context.dx = 1961; + context.dx = 1948; loadintotemp(context); return; } static void quitkey(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyqk; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 4; commandonly(context); alreadyqk: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notqk; context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: return; doqk: - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void addtopresslist(Context & context) { - context._cmp(context.data.word(280), 5); + context._cmp(context.data.word(278), 5); if (context.flags.z()) goto nomorekeys; - context.al = context.data.byte(278); + context.al = context.data.byte(277); context._cmp(context.al, 10); if (!context.flags.z()) goto not10; context.al = 0; not10: - context.bx = context.data.word(280); + context.bx = context.data.word(278); context.dx = context.ds; context.es = context.dx; - context._add(context.bx, 8350); + context._add(context.bx, 8344); context.ds.byte(context.bx) = context.al; - context._add(context.data.word(280), 1); + context._add(context.data.word(278), 1); nomorekeys: return; } @@ -14584,27 +14584,27 @@ static void buttonenter(Context & context) { static void buttonpress(Context & context) { context.ch = context.cl; context._add(context.ch, 100); - context._cmp(context.data.byte(100), context.ch); + context._cmp(context.data.byte(99), context.ch); if (context.flags.z()) goto alreadyb; - context.data.byte(100) = context.ch; + context.data.byte(99) = context.ch; context.al = context.cl; context._add(context.al, 4); context.push(context.cx); commandonly(context); context.cx = context.pop(); alreadyb: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notb; context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: return; dob: - context.data.byte(278) = context.cl; + context.data.byte(277) = context.cl; context._add(context.cl, 21); - context.data.byte(281) = context.cl; - context.data.byte(282) = 40; + context.data.byte(280) = context.cl; + context.data.byte(281) = 40; context._cmp(context.cl, 32); if (context.flags.z()) goto nonoise; context.al = 10; @@ -14616,13 +14616,13 @@ nonoise: static void showouterpad(Context & context) { context.di = 36+112-3; context.bx = 72-4; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 1; context.ah = 0; showframe(context); context.di = 36+112+74; context.bx = 72+76; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.al = 37; context.ah = 0; showframe(context); @@ -14674,23 +14674,23 @@ static void showkeypad(Context & context) { context.di = 36+112+31; context.bx = 72+59; singlekey(context); - context._cmp(context.data.byte(287), 0); + context._cmp(context.data.byte(286), 0); if (context.flags.z()) goto notenter; - context._sub(context.data.byte(287), 1); + context._sub(context.data.byte(286), 1); context.al = 36; context.bx = 72-1+63; - context._cmp(context.data.byte(37), 0); + context._cmp(context.data.byte(36), 0); if (!context.flags.z()) goto changelight; context.al = 41; context.bx = 72+4+63; changelight: - context._cmp(context.data.byte(287), 60); + context._cmp(context.data.byte(286), 60); if (context.flags.c()) goto gotlight; - context._cmp(context.data.byte(287), 100); + context._cmp(context.data.byte(286), 100); if (!context.flags.c()) goto gotlight; context._sub(context.al, 1); gotlight: - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 0; context.di = 36+112+60; showframe(context); @@ -14699,14 +14699,14 @@ notenter: } static void singlekey(Context & context) { - context._cmp(context.data.byte(281), context.al); + context._cmp(context.data.byte(280), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); - context._cmp(context.data.byte(282), 8); + context._cmp(context.data.byte(281), 8); if (!context.flags.c()) goto gotkey; context._sub(context.al, 11); gotkey: - context.ds = context.data.word(458); + context.ds = context.data.word(456); context._sub(context.al, 20); context.ah = 0; showframe(context); @@ -14728,24 +14728,24 @@ static void usemenu(Context & context) { createpanel(context); showpanel(context); showicon(context); - context.data.byte(62) = 0; + context.data.byte(61) = 0; drawfloor(context); printsprites(context); context.al = 4; context.ah = 0; context.di = 80+40-48; context.bx = 60-4; - context.ds = context.data.word(460); + context.ds = context.data.word(458); showframe(context); getundermenu(context); context.al = 5; context.ah = 0; context.di = 80+40+54; context.bx = 60+72; - context.ds = context.data.word(460); + context.ds = context.data.word(458); showframe(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; menuloop: delpointer(context); putundermenu(context); @@ -14758,9 +14758,9 @@ menuloop: dumptextline(context); context.bx = 3525; checkcoords(context); - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(102), 1); if (!context.flags.z()) goto menuloop; - context.data.byte(131) = 0; + context.data.byte(130) = 0; redrawmainscrn(context); getridoftemp(context); getridoftemp2(context); @@ -14785,7 +14785,7 @@ static void getundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.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(context); return; @@ -14796,7 +14796,7 @@ static void putundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.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(context); return; @@ -14807,61 +14807,61 @@ static void showoutermenu(Context & context) { context.ah = 0; context.di = 80+40-34; context.bx = 60-40; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); context.al = 41; context.ah = 0; context.di = 80+40+64-34; context.bx = 60-40; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); context.al = 42; context.ah = 0; context.di = 80+40-26; context.bx = 60+57-40; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); context.al = 43; context.ah = 0; context.di = 80+40+64-26; context.bx = 60+57-40; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); return; } static void showmenu(Context & context) { - context._add(context.data.byte(290), 1); - context._cmp(context.data.byte(290), 37*2); + context._add(context.data.byte(289), 1); + context._cmp(context.data.byte(289), 37*2); if (!context.flags.z()) goto menuframeok; - context.data.byte(290) = 0; + context.data.byte(289) = 0; menuframeok: - context.al = context.data.byte(290); + context.al = context.data.byte(289); context._shr(context.al, 1); context.ah = 0; context.di = 80+40; context.bx = 60; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); return; } static void loadmenu(Context & context) { - context.dx = 1845; + context.dx = 1832; loadintotemp(context); - context.dx = 2000; + context.dx = 1987; loadintotemp2(context); return; } static void viewfolder(Context & context) { - context.data.byte(131) = 1; + context.data.byte(130) = 1; getridofall(context); loadfolder(context); - context.data.byte(288) = 0; + context.data.byte(287) = 0; showfolder(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; folderloop: delpointer(context); readmouse(context); @@ -14871,9 +14871,9 @@ folderloop: dumptextline(context); context.bx = 3547; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto folderloop; - context.data.byte(131) = 0; + context.data.byte(130) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); @@ -14885,30 +14885,30 @@ folderloop: } static void nextfolder(Context & context) { - context._cmp(context.data.byte(288), 12); + context._cmp(context.data.byte(287), 12); if (!context.flags.z()) goto cannextf; blank(context); return; cannextf: - context._cmp(context.data.byte(100), 201); + context._cmp(context.data.byte(99), 201); if (context.flags.z()) goto alreadynextf; - context.data.byte(100) = 201; + context.data.byte(99) = 201; context.al = 16; commandonly(context); alreadynextf: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notnextf; context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: return; donextf: - context._add(context.data.byte(288), 1); + context._add(context.data.byte(287), 1); folderhints(context); delpointer(context); showfolder(context); - context.data.word(202) = 0; + context.data.word(200) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -14916,9 +14916,9 @@ donextf: } static void folderhints(Context & context) { - context._cmp(context.data.byte(288), 5); + context._cmp(context.data.byte(287), 5); if (!context.flags.z()) goto notaideadd; - context._cmp(context.data.byte(44), 1); + context._cmp(context.data.byte(43), 1); if (context.flags.z()) goto notaideadd; context.al = 13; getlocation(context); @@ -14939,7 +14939,7 @@ static void folderhints(Context & context) { hangonp(context); return; notaideadd: - context._cmp(context.data.byte(288), 9); + context._cmp(context.data.byte(287), 9); if (!context.flags.z()) goto notaristoadd; context.al = 7; getlocation(context); @@ -14963,31 +14963,31 @@ notaristoadd: } static void lastfolder(Context & context) { - context._cmp(context.data.byte(288), 0); + context._cmp(context.data.byte(287), 0); if (!context.flags.z()) goto canlastf; blank(context); return; canlastf: - context._cmp(context.data.byte(100), 202); + context._cmp(context.data.byte(99), 202); if (context.flags.z()) goto alreadylastf; - context.data.byte(100) = 202; + context.data.byte(99) = 202; context.al = 17; commandonly(context); alreadylastf: - context._cmp(context.data.byte(288), 0); + context._cmp(context.data.byte(287), 0); if (context.flags.z()) goto notlastf; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notlastf; context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: return; dolastf: - context._sub(context.data.byte(288), 1); + context._sub(context.data.byte(287), 1); delpointer(context); showfolder(context); - context.data.word(202) = 0; + context.data.word(200) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -14995,55 +14995,55 @@ dolastf: } static void loadfolder(Context & context) { - context.dx = 2312; + context.dx = 2299; loadintotemp(context); - context.dx = 2325; + context.dx = 2312; loadintotemp2(context); - context.dx = 2338; + context.dx = 2325; loadintotemp3(context); - context.dx = 1896; + context.dx = 1883; loadtempcharset(context); - context.dx = 2208; + context.dx = 2195; loadtemptext(context); return; } static void showfolder(Context & context) { - context.data.byte(100) = 255; - context._cmp(context.data.byte(288), 0); + context.data.byte(99) = 255; + context._cmp(context.data.byte(287), 0); if (context.flags.z()) goto closedfolder; usetempcharset(context); createpanel2(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 143; context.bx = 0; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 0; context.bx = 92; context.al = 2; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 143; context.bx = 92; context.al = 3; context.ah = 0; showframe(context); folderexit(context); - context._cmp(context.data.byte(288), 1); + context._cmp(context.data.byte(287), 1); if (context.flags.z()) goto noleftpage; showleftpage(context); noleftpage: - context._cmp(context.data.byte(288), 12); + context._cmp(context.data.byte(287), 12); if (context.flags.z()) goto norightpage; showrightpage(context); norightpage: @@ -15052,13 +15052,13 @@ norightpage: return; closedfolder: createpanel2(context); - context.ds = context.data.word(462); + context.ds = context.data.word(460); context.di = 143-28; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(460); context.di = 143-28; context.bx = 92; context.al = 1; @@ -15070,7 +15070,7 @@ closedfolder: } static void folderexit(Context & context) { - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 296; context.bx = 178; context.al = 6; @@ -15080,7 +15080,7 @@ static void folderexit(Context & context) { } static void showleftpage(Context & context) { - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 0; context.bx = 12; context.al = 3; @@ -15091,7 +15091,7 @@ static void showleftpage(Context & context) { leftpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 0; context.al = 4; context.ah = 0; @@ -15100,21 +15100,21 @@ leftpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto leftpageloop; - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 0; context.al = 5; context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.word(71) = 91; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); + context.data.word(75) = 8; + context.data.word(69) = 91; + context.data.byte(71) = 1; + context.bl = context.data.byte(287); context._sub(context.bl, 1); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); + context.es = context.data.word(464); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 2; @@ -15125,16 +15125,16 @@ twolotsleft: context.push(context.cx); contleftpage: printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.data.word(75)); context._cmp(context.al, 0); if (!context.flags.z()) goto contleftpage; context.cx = context.pop(); if (--context.cx) goto twolotsleft; - context.data.byte(72) = 0; - context.data.word(71) = 0; - context.data.word(77) = 10; - context.es = context.data.word(400); - context.ds = context.data.word(400); + context.data.byte(71) = 0; + context.data.word(69) = 0; + context.data.word(75) = 10; + context.es = context.data.word(398); + context.ds = context.data.word(398); context.di = (48*320)+2; context.si = (48*320)+2+130; context.cx = 120; @@ -15161,7 +15161,7 @@ flipfolderline: } static void showrightpage(Context & context) { - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 143; context.bx = 12; context.al = 0; @@ -15172,7 +15172,7 @@ static void showrightpage(Context & context) { rightpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 143; context.al = 1; context.ah = 0; @@ -15181,19 +15181,19 @@ rightpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto rightpageloop; - context.ds = context.data.word(460); + context.ds = context.data.word(458); context.di = 143; context.al = 2; context.ah = 0; showframe(context); - context.data.word(77) = 8; - context.data.byte(72) = 1; - context.bl = context.data.byte(288); + context.data.word(75) = 8; + context.data.byte(71) = 1; + context.bl = context.data.byte(287); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(466); + context.es = context.data.word(464); context.si = context.ds.word(context.bx); context._add(context.si, 66*2); context.di = 152; @@ -15204,30 +15204,30 @@ twolotsright: context.push(context.cx); contrightpage: printdirect(context); - context._add(context.bx, context.data.word(77)); + context._add(context.bx, context.data.word(75)); context._cmp(context.al, 0); if (!context.flags.z()) goto contrightpage; context.cx = context.pop(); if (--context.cx) goto twolotsright; - context.data.byte(72) = 0; - context.data.word(77) = 10; + context.data.byte(71) = 0; + context.data.word(75) = 10; return; } static void entersymbol(Context & context) { - context.data.byte(131) = 1; + context.data.byte(130) = 1; getridofreels(context); - context.dx = 2351; + context.dx = 2338; loadintotemp(context); - context.data.byte(291) = 24; - context.data.byte(293) = 0; - context.data.byte(294) = 24; - context.data.byte(296) = 0; + context.data.byte(290) = 24; + context.data.byte(292) = 0; + context.data.byte(293) = 24; + context.data.byte(295) = 0; redrawmainscrn(context); showsymbol(context); undertextline(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; symbolloop: delpointer(context); updatesymboltop(context); @@ -15241,21 +15241,21 @@ symbolloop: dumpsymbol(context); context.bx = 3589; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto symbolloop; - context._cmp(context.data.byte(295), 3); + context._cmp(context.data.byte(294), 3); if (!context.flags.z()) goto symbolwrong; - context._cmp(context.data.byte(292), 5); + context._cmp(context.data.byte(291), 5); if (!context.flags.z()) goto symbolwrong; context.al = 43; removesetobject(context); context.al = 46; placesetobject(context); - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._add(context.ah, 12); context.al = 0; turnanypathon(context); - context.data.byte(131) = 0; + context.data.byte(130) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15268,11 +15268,11 @@ symbolwrong: removesetobject(context); context.al = 43; placesetobject(context); - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._add(context.ah, 12); context.al = 0; turnanypathoff(context); - context.data.byte(131) = 0; + context.data.byte(130) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15281,94 +15281,94 @@ symbolwrong: } static void quitsymbol(Context & context) { - context._cmp(context.data.byte(291), 24); + context._cmp(context.data.byte(290), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(294), 24); + context._cmp(context.data.byte(293), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyqs; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 18; commandonly(context); alreadyqs: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notqs; context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: return; doqs: - context.data.byte(103) = 1; + context.data.byte(102) = 1; return; } static void settopleft(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.data.byte(292), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 210); + context._cmp(context.data.byte(99), 210); if (context.flags.z()) goto alreadytopl; - context.data.byte(100) = 210; + context.data.byte(99) = 210; context.al = 19; commandonly(context); alreadytopl: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto notopleft; - context.data.byte(293) = -1; + context.data.byte(292) = -1; notopleft: return; } static void settopright(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.data.byte(292), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 211); + context._cmp(context.data.byte(99), 211); if (context.flags.z()) goto alreadytopr; - context.data.byte(100) = 211; + context.data.byte(99) = 211; context.al = 20; commandonly(context); alreadytopr: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto notopright; - context.data.byte(293) = 1; + context.data.byte(292) = 1; notopright: return; } static void setbotleft(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.data.byte(295), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 212); + context._cmp(context.data.byte(99), 212); if (context.flags.z()) goto alreadybotl; - context.data.byte(100) = 212; + context.data.byte(99) = 212; context.al = 21; commandonly(context); alreadybotl: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto nobotleft; - context.data.byte(296) = -1; + context.data.byte(295) = -1; nobotleft: return; } static void setbotright(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.data.byte(295), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 213); + context._cmp(context.data.byte(99), 213); if (context.flags.z()) goto alreadybotr; - context.data.byte(100) = 213; + context.data.byte(99) = 213; context.al = 22; commandonly(context); alreadybotr: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto nobotright; - context.data.byte(296) = 1; + context.data.byte(295) = 1; nobotright: return; } static void dumpsymbol(Context & context) { - context.data.byte(109) = 0; + context.data.byte(108) = 0; context.di = 64; context.bx = 56+20; context.cl = 104; @@ -15382,15 +15382,15 @@ static void showsymbol(Context & context) { context.ah = 0; context.di = 64; context.bx = 56; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); - context.al = context.data.byte(291); + context.al = context.data.byte(290); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(292); + context.al = context.data.byte(291); context.bx = 56+20; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15415,14 +15415,14 @@ static void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - context.al = context.data.byte(294); + context.al = context.data.byte(293); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(295); + context.al = context.data.byte(294); context._add(context.al, 6); context.bx = 56+49; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15466,99 +15466,99 @@ botwrap: } static void updatesymboltop(Context & context) { - context._cmp(context.data.byte(293), 0); + context._cmp(context.data.byte(292), 0); if (context.flags.z()) goto topfinished; - context._cmp(context.data.byte(293), -1); + context._cmp(context.data.byte(292), -1); if (context.flags.z()) goto backwards; - context._add(context.data.byte(291), 1); - context._cmp(context.data.byte(291), 49); + context._add(context.data.byte(290), 1); + context._cmp(context.data.byte(290), 49); if (!context.flags.z()) goto notwrapfor; - context.data.byte(291) = 0; - context._sub(context.data.byte(292), 1); - context._cmp(context.data.byte(292), -1); + context.data.byte(290) = 0; + context._sub(context.data.byte(291), 1); + context._cmp(context.data.byte(291), -1); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 5; + context.data.byte(291) = 5; return; notwrapfor: - context._cmp(context.data.byte(291), 24); + context._cmp(context.data.byte(290), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; + context.data.byte(292) = 0; return; backwards: - context._sub(context.data.byte(291), 1); - context._cmp(context.data.byte(291), -1); + context._sub(context.data.byte(290), 1); + context._cmp(context.data.byte(290), -1); if (!context.flags.z()) goto notwrapback; - context.data.byte(291) = 48; - context._add(context.data.byte(292), 1); - context._cmp(context.data.byte(292), 6); + context.data.byte(290) = 48; + context._add(context.data.byte(291), 1); + context._cmp(context.data.byte(291), 6); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 0; + context.data.byte(291) = 0; return; notwrapback: - context._cmp(context.data.byte(291), 24); + context._cmp(context.data.byte(290), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(293) = 0; + context.data.byte(292) = 0; topfinished: return; } static void updatesymbolbot(Context & context) { - context._cmp(context.data.byte(296), 0); + context._cmp(context.data.byte(295), 0); if (context.flags.z()) goto botfinished; - context._cmp(context.data.byte(296), -1); + context._cmp(context.data.byte(295), -1); if (context.flags.z()) goto backwardsbot; - context._add(context.data.byte(294), 1); - context._cmp(context.data.byte(294), 49); + context._add(context.data.byte(293), 1); + context._cmp(context.data.byte(293), 49); if (!context.flags.z()) goto notwrapforb; - context.data.byte(294) = 0; - context._sub(context.data.byte(295), 1); - context._cmp(context.data.byte(295), -1); + context.data.byte(293) = 0; + context._sub(context.data.byte(294), 1); + context._cmp(context.data.byte(294), -1); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 5; + context.data.byte(294) = 5; return; notwrapforb: - context._cmp(context.data.byte(294), 24); + context._cmp(context.data.byte(293), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; + context.data.byte(295) = 0; return; backwardsbot: - context._sub(context.data.byte(294), 1); - context._cmp(context.data.byte(294), -1); + context._sub(context.data.byte(293), 1); + context._cmp(context.data.byte(293), -1); if (!context.flags.z()) goto notwrapbackb; - context.data.byte(294) = 48; - context._add(context.data.byte(295), 1); - context._cmp(context.data.byte(295), 6); + context.data.byte(293) = 48; + context._add(context.data.byte(294), 1); + context._cmp(context.data.byte(294), 6); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 0; + context.data.byte(294) = 0; return; notwrapbackb: - context._cmp(context.data.byte(294), 24); + context._cmp(context.data.byte(293), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(296) = 0; + context.data.byte(295) = 0; botfinished: return; } static void dumpsymbox(Context & context) { - context._cmp(context.data.word(303), -1); + context._cmp(context.data.word(301), -1); if (context.flags.z()) goto nodumpsym; - context.di = context.data.word(303); - context.bx = context.data.word(305); + context.di = context.data.word(301); + context.bx = context.data.word(303); context.cl = 30; context.ch = 77; multidump(context); - context.data.word(303) = -1; + context.data.word(301) = -1; nodumpsym: return; } static void usediary(Context & context) { getridofreels(context); - context.dx = 2052; + context.dx = 2039; loadintotemp(context); - context.dx = 2221; + context.dx = 2208; loadtemptext(context); - context.dx = 1896; + context.dx = 1883; loadtempcharset(context); createpanel(context); showicon(context); @@ -15569,7 +15569,7 @@ static void usediary(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; diaryloop: delpointer(context); readmouse(context); @@ -15581,13 +15581,13 @@ diaryloop: dumptextline(context); context.bx = 3651; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto diaryloop; getridoftemp(context); getridoftemptext(context); getridoftempcharset(context); restorereels(context); - context.data.byte(131) = 0; + context.data.byte(130) = 0; redrawmainscrn(context); worktoscreenm(context); return; @@ -15600,52 +15600,52 @@ static void showdiary(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12+37; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); context.al = 2; context.ah = 0; context.di = 68+24+176; context.bx = 48+12+108; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); return; } static void showdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 0); + context._cmp(context.data.byte(281), 0); if (context.flags.z()) goto nokeyatall; - context._sub(context.data.byte(282), 1); - context._cmp(context.data.byte(282), 0); + context._sub(context.data.byte(281), 1); + context._cmp(context.data.byte(281), 0); if (context.flags.z()) goto nokeyatall; - context._cmp(context.data.byte(278), 'N'); + context._cmp(context.data.byte(277), 'N'); if (!context.flags.z()) goto nokeyn; context.al = 3; - context._cmp(context.data.byte(282), 1); + context._cmp(context.data.byte(281), 1); if (context.flags.z()) goto gotkeyn; context.al = 4; gotkeyn: context.ah = 0; context.di = 68+24+94; context.bx = 48+12+97; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); - context._cmp(context.data.byte(282), 1); + context._cmp(context.data.byte(281), 1); if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: return; nokeyn: context.al = 5; - context._cmp(context.data.byte(282), 1); + context._cmp(context.data.byte(281), 1); if (context.flags.z()) goto gotkeyp; context.al = 6; gotkeyp: context.ah = 0; context.di = 68+24+151; context.bx = 48+12+71; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); - context._cmp(context.data.byte(282), 1); + context._cmp(context.data.byte(281), 1); if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: @@ -15655,13 +15655,13 @@ nokeyatall: } static void dumpdiarykeys(Context & context) { - context._cmp(context.data.byte(282), 1); + context._cmp(context.data.byte(281), 1); if (!context.flags.z()) goto notdumpdiary; - context._cmp(context.data.byte(43), 1); + context._cmp(context.data.byte(42), 1); if (context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); + context._cmp(context.data.byte(288), 5); if (!context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(289), 5); + context._cmp(context.data.byte(288), 5); if (!context.flags.z()) goto notsartadd; context.al = 6; getlocation(context); @@ -15708,53 +15708,53 @@ notdumpdiary: } static void diarykeyp(Context & context) { - context._cmp(context.data.byte(100), 214); + context._cmp(context.data.byte(99), 214); if (context.flags.z()) goto alreadykeyp; - context.data.byte(100) = 214; + context.data.byte(99) = 214; context.al = 23; commandonly(context); alreadykeyp: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto notkeyp; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); + context.ax = context.data.word(210); + context._cmp(context.ax, context.data.word(200)); if (context.flags.z()) goto notkeyp; - context._cmp(context.data.byte(282), 0); + context._cmp(context.data.byte(281), 0); if (!context.flags.z()) goto notkeyp; context.al = 16; playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'P'; - context._sub(context.data.byte(289), 1); - context._cmp(context.data.byte(289), -1); + context.data.byte(281) = 12; + context.data.byte(277) = 'P'; + context._sub(context.data.byte(288), 1); + context._cmp(context.data.byte(288), -1); if (!context.flags.z()) goto notkeyp; - context.data.byte(289) = 11; + context.data.byte(288) = 11; notkeyp: return; } static void diarykeyn(Context & context) { - context._cmp(context.data.byte(100), 213); + context._cmp(context.data.byte(99), 213); if (context.flags.z()) goto alreadykeyn; - context.data.byte(100) = 213; + context.data.byte(99) = 213; context.al = 23; commandonly(context); alreadykeyn: - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto notkeyn; - context.ax = context.data.word(212); - context._cmp(context.ax, context.data.word(202)); + context.ax = context.data.word(210); + context._cmp(context.ax, context.data.word(200)); if (context.flags.z()) goto notkeyn; - context._cmp(context.data.byte(282), 0); + context._cmp(context.data.byte(281), 0); if (!context.flags.z()) goto notkeyn; context.al = 16; playchannel1(context); - context.data.byte(282) = 12; - context.data.byte(278) = 'N'; - context._add(context.data.byte(289), 1); - context._cmp(context.data.byte(289), 12); + context.data.byte(281) = 12; + context.data.byte(277) = 'N'; + context._add(context.data.byte(288), 1); + context._cmp(context.data.byte(288), 12); if (!context.flags.z()) goto notkeyn; - context.data.byte(289) = 0; + context.data.byte(288) = 0; notkeyn: return; } @@ -15764,17 +15764,17 @@ static void showdiarypage(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12; - context.ds = context.data.word(458); + context.ds = context.data.word(456); showframe(context); - context.al = context.data.byte(289); + context.al = context.data.byte(288); findtext1(context); - context.data.byte(72) = 1; + context.data.byte(71) = 1; usetempcharset(context); context.di = 68+24+48; context.bx = 48+12+16; context.dl = 240; context.ah = 16; - context.data.word(71) = 91+91; + context.data.word(69) = 91+91; printdirect(context); context.di = 68+24+129; context.bx = 48+12+16; @@ -15786,8 +15786,8 @@ static void showdiarypage(Context & context) { context.dl = 240; context.ah = 16; printdirect(context); - context.data.byte(72) = 0; - context.data.word(71) = 0; + context.data.byte(71) = 0; + context.data.word(69) = 0; usecharset1(context); return; } @@ -15796,7 +15796,7 @@ static void findtext1(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(466); + context.es = context.data.word(464); context.ax = context.ds.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -15804,29 +15804,29 @@ static void findtext1(Context & context) { } static void zoomonoff(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.data.byte(233), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyonoff; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 39; commandonly(context); alreadyonoff: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nozoomonoff; context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: return; dozoomonoff: - context.al = context.data.byte(8); + context.al = context.data.byte(7); context._xor(context.al, 1); - context.data.byte(8) = context.al; + context.data.byte(7) = context.al; createpanel(context); - context.data.byte(62) = 0; + context.data.byte(61) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -15841,18 +15841,18 @@ dozoomonoff: } static void saveload(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.data.byte(233), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(100), 253); + context._cmp(context.data.byte(99), 253); if (context.flags.z()) goto alreadyops; - context.data.byte(100) = 253; + context.data.byte(99) = 253; context.al = 43; commandonly(context); alreadyops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noops; context._and(context.ax, 1); if (context.flags.z()) goto noops; @@ -15862,11 +15862,11 @@ noops: } static void dosaveload(Context & context) { - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; + context.data.byte(230) = 0; + context.data.word(77) = 70; + context.data.word(79) = 182-8; + context.data.byte(81) = 181; + context.data.byte(130) = 1; clearwork(context); createpanel2(context); undertextline(context); @@ -15881,7 +15881,7 @@ restartops: showmainops(context); worktoscreenm(context); donefirstops: - context.data.byte(103) = 0; + context.data.byte(102) = 0; waitops: readmouse(context); showpointer(context); @@ -15891,27 +15891,27 @@ waitops: delpointer(context); context.bx = 3693; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto waitops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.data.byte(102), 2); if (context.flags.z()) goto restartops; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context._cmp(context.data.byte(103), 4); + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto justret; getridoftemp(context); restoreall(context); redrawmainscrn(context); worktoscreenm(context); - context.data.byte(100) = 200; + context.data.byte(99) = 200; justret: - context.data.byte(131) = 0; + context.data.byte(130) = 0; return; } static void getbackfromops(Context & context) { - context._cmp(context.data.byte(56), 2); + context._cmp(context.data.byte(55), 2); if (context.flags.z()) goto opsblock1; getback1(context); return; @@ -15921,19 +15921,19 @@ opsblock1: } static void showmainops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+10; context.bx = 52+10; context.al = 8; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+59; context.bx = 52+30; context.al = 7; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; context.al = 1; @@ -15943,25 +15943,25 @@ static void showmainops(Context & context) { } static void showdiscops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+10; context.bx = 52+10; context.al = 9; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+59; context.bx = 52+30; context.al = 10; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -15971,36 +15971,36 @@ static void showdiscops(Context & context) { } static void loadsavebox(Context & context) { - context.dx = 1974; + context.dx = 1961; loadintotemp(context); return; } static void loadgame(Context & context) { - context._cmp(context.data.byte(100), 246); + context._cmp(context.data.byte(99), 246); if (context.flags.z()) goto alreadyload; - context.data.byte(100) = 246; + context.data.byte(99) = 246; context.al = 41; commandonly(context); alreadyload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noload; context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: return; doload: - context.data.byte(340) = 1; + context.data.byte(339) = 1; showopbox(context); showloadops(context); - context.data.byte(341) = 0; + context.data.byte(340) = 0; showslots(context); shownames(context); - context.data.byte(231) = 0; + context.data.byte(230) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; loadops: delpointer(context); readmouse(context); @@ -16010,40 +16010,40 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.data.byte(102), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; context.es = context.dx; - context.bx = 7782; + context.bx = 7750; startloading(context); loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; + context.data.byte(73) = 1; + context.data.byte(187) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; startup(context); worktoscreen(context); - context.data.byte(103) = 4; + context.data.byte(102) = 4; quitloaded: return; } static void getbacktoops(Context & context) { - context._cmp(context.data.byte(100), 201); + context._cmp(context.data.byte(99), 201); if (context.flags.z()) goto alreadygetops; - context.data.byte(100) = 201; + context.data.byte(99) = 201; context.al = 42; commandonly(context); alreadygetops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nogetbackops; context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; @@ -16051,19 +16051,19 @@ nogetbackops: return; dogetbackops: oldtonames(context); - context.data.byte(103) = 2; + context.data.byte(102) = 2; return; } static void discops(Context & context) { - context._cmp(context.data.byte(100), 249); + context._cmp(context.data.byte(99), 249); if (context.flags.z()) goto alreadydiscops; - context.data.byte(100) = 249; + context.data.byte(99) = 249; context.al = 43; commandonly(context); alreadydiscops: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto nodiscops; context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; @@ -16071,12 +16071,12 @@ nodiscops: return; dodiscops: scanfornames(context); - context.data.byte(340) = 2; + context.data.byte(339) = 2; showopbox(context); showdiscops(context); - context.data.byte(341) = 0; + context.data.byte(340) = 0; worktoscreenm(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; discopsloop: delpointer(context); readmouse(context); @@ -16086,39 +16086,39 @@ discopsloop: dumptextline(context); context.bx = 3777; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto discopsloop; return; } static void savegame(Context & context) { - context._cmp(context.data.byte(56), 2); + context._cmp(context.data.byte(55), 2); if (!context.flags.z()) goto cansaveok; blank(context); return; cansaveok: - context._cmp(context.data.byte(100), 247); + context._cmp(context.data.byte(99), 247); if (context.flags.z()) goto alreadysave; - context.data.byte(100) = 247; + context.data.byte(99) = 247; context.al = 44; commandonly(context); alreadysave: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; return; dosave: - context.data.byte(340) = 2; + context.data.byte(339) = 2; showopbox(context); showsaveops(context); - context.data.byte(341) = 0; + context.data.byte(340) = 0; showslots(context); shownames(context); worktoscreenm(context); namestoold(context); + context.data.word(392) = 0; context.data.word(394) = 0; - context.data.word(396) = 0; - context.data.byte(103) = 0; + context.data.byte(102) = 0; saveops: delpointer(context); checkinput(context); @@ -16129,25 +16129,25 @@ saveops: dumptextline(context); context.bx = 3819; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto saveops; return; } static void actualsave(Context & context) { - context._cmp(context.data.byte(100), 222); + context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyactsave; - context.data.byte(100) = 222; + context.data.byte(99) = 222; context.al = 44; commandonly(context); alreadyactsave: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto noactsave; context.dx = context.ds; context.ds = context.dx; - context.si = 8367; - context.al = context.data.byte(341); + context.si = 8350; + context.al = context.data.byte(340); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16155,61 +16155,61 @@ alreadyactsave: context._add(context.si, 1); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto noactsave; - context.al = context.data.byte(9); + context.al = context.data.byte(8); context.ah = 0; context.cx = 32; context._mul(context.cx); context.ds = context.cs; - context.si = 5971; + context.si = 5958; context._add(context.si, context.ax); - context.di = 7782; + context.di = 7750; context.bx = context.di; context.es = context.cs; context.cx = 16; while(--context.cx) context._movsw(); - context.al = context.data.byte(531); + context.al = context.data.byte(530); context.ds.byte(context.bx+13) = context.al; - context.al = context.data.byte(148); + context.al = context.data.byte(147); context.ds.byte(context.bx+15) = context.al; - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.ds.byte(context.bx+16) = context.al; - context.al = context.data.byte(35); + context.al = context.data.byte(34); context.ds.byte(context.bx+20) = context.al; - context.al = context.data.byte(475); + context.al = context.data.byte(474); context.ds.byte(context.bx+21) = context.al; - context.al = context.data.byte(133); + context.al = context.data.byte(132); context.ds.byte(context.bx+22) = context.al; context.al = 255; context.ds.byte(context.bx+27) = context.al; saveposition(context); getridoftemp(context); restoreall(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; redrawmainscrn(context); worktoscreenm(context); - context.data.byte(103) = 4; + context.data.byte(102) = 4; noactsave: return; } static void actualload(Context & context) { - context._cmp(context.data.byte(100), 221); + context._cmp(context.data.byte(99), 221); if (context.flags.z()) goto alreadyactload; - context.data.byte(100) = 221; + context.data.byte(99) = 221; context.al = 41; commandonly(context); alreadyactload: - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto notactload; context._cmp(context.ax, 1); if (!context.flags.z()) goto notactload; context.dx = context.ds; context.ds = context.dx; - context.si = 8367; - context.al = context.data.byte(341); + context.si = 8350; + context.al = context.data.byte(340); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16218,48 +16218,48 @@ alreadyactload: context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto notactload; loadposition(context); - context.data.byte(103) = 1; + context.data.byte(102) = 1; notactload: return; } static void selectslot2(Context & context) { - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto noselslot2; - context.data.byte(340) = 2; + context.data.byte(339) = 2; noselslot2: selectslot(context); return; } static void checkinput(Context & context) { - context._cmp(context.data.byte(340), 3); + context._cmp(context.data.byte(339), 3); if (context.flags.z()) goto nokeypress; readkey(context); - context.al = context.data.byte(142); + context.al = context.data.byte(141); context._cmp(context.al, 0); if (context.flags.z()) goto nokeypress; context._cmp(context.al, 13); if (!context.flags.z()) goto notret; - context.data.byte(340) = 3; + context.data.byte(339) = 3; goto afterkey; notret: context._cmp(context.al, 8); if (!context.flags.z()) goto nodel2; - context._cmp(context.data.byte(342), 0); + context._cmp(context.data.byte(341), 0); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._sub(context.data.byte(342), 1); + context._sub(context.data.byte(341), 1); context.ds.byte(context.bx) = 0; context.ds.byte(context.bx+1) = 1; goto afterkey; nodel2: spacepress: - context._cmp(context.data.byte(342), 14); + context._cmp(context.data.byte(341), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._add(context.data.byte(342), 1); - context.al = context.data.byte(142); + context._add(context.data.byte(341), 1); + context.al = context.data.byte(141); context.ds.byte(context.bx+1) = context.al; context.ds.byte(context.bx+2) = 0; context.ds.byte(context.bx+3) = 1; @@ -16276,28 +16276,28 @@ afterkey: } static void getnamepos(Context & context) { - context.al = context.data.byte(341); + context.al = context.data.byte(340); context.ah = 0; context.cx = 17; context._mul(context.cx); context.dx = context.ds; context.es = context.dx; - context.bx = 8367; + context.bx = 8350; context._add(context.bx, context.ax); - context.al = context.data.byte(342); + context.al = context.data.byte(341); context.ah = 0; context._add(context.bx, context.ax); return; } static void showopbox(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60; context.bx = 52; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60; context.bx = 52+55; context.al = 4; @@ -16307,13 +16307,13 @@ static void showopbox(Context & context) { } static void showloadops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16328,13 +16328,13 @@ static void showloadops(Context & context) { } static void showsaveops(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16349,35 +16349,35 @@ static void showsaveops(Context & context) { } static void selectslot(Context & context) { - context._cmp(context.data.byte(100), 244); + context._cmp(context.data.byte(99), 244); if (context.flags.z()) goto alreadysel; - context.data.byte(100) = 244; + context.data.byte(99) = 244; context.al = 45; commandonly(context); alreadysel: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._cmp(context.ax, 1); if (!context.flags.z()) goto noselslot; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto noselslot; - context._cmp(context.data.byte(340), 3); + context._cmp(context.data.byte(339), 3); if (!context.flags.z()) goto notnocurs; - context._sub(context.data.byte(340), 1); + context._sub(context.data.byte(339), 1); notnocurs: oldtonames(context); - context.ax = context.data.word(200); + context.ax = context.data.word(198); context._sub(context.ax, 52+4); context.cl = -1; getslotnum: context._add(context.cl, 1); context._sub(context.ax, 11); if (!context.flags.c()) goto getslotnum; - context.data.byte(341) = context.cl; + context.data.byte(340) = context.cl; delpointer(context); showopbox(context); showslots(context); shownames(context); - context._cmp(context.data.byte(340), 1); + context._cmp(context.data.byte(339), 1); if (context.flags.z()) goto isloadmode; showsaveops(context); readmouse(context); @@ -16400,7 +16400,7 @@ static void showslots(Context & context) { context.di = 60+7; context.bx = 52+8; context.al = 2; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 0; showframe(context); context.di = 60+10; @@ -16410,10 +16410,10 @@ slotloop: context.push(context.cx); context.push(context.di); context.push(context.bx); - context._cmp(context.cl, context.data.byte(341)); + context._cmp(context.cl, context.data.byte(340)); if (!context.flags.z()) goto nomatchslot; context.al = 3; - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.ah = 0; showframe(context); nomatchslot: @@ -16430,7 +16430,7 @@ nomatchslot: static void shownames(Context & context) { context.dx = context.ds; context.es = context.dx; - context.si = 8367+1; + context.si = 8350+1; context.di = 60+21; context.bx = 52+10; context.cl = 0; @@ -16441,9 +16441,9 @@ shownameloop: context.push(context.bx); context.push(context.si); context.al = 4; - context._cmp(context.cl, context.data.byte(341)); + context._cmp(context.cl, context.data.byte(340)); if (!context.flags.z()) goto nomatchslot2; - context._cmp(context.data.byte(340), 2); + context._cmp(context.data.byte(339), 2); if (!context.flags.z()) goto loadmode; context.dx = context.si; context.cx = 15; @@ -16455,7 +16455,7 @@ zerostill: if (!context.flags.z()) goto foundcharacter; goto zerostill; foundcharacter: - context.data.byte(342) = context.cl; + context.data.byte(341) = context.cl; context.ds.byte(context.si) = '/'; context.ds.byte(context.si+1) = 0; context.push(context.si); @@ -16471,9 +16471,9 @@ loadmode: context.al = 0; context.dl = 200; context.ah = 0; - context.data.word(71) = 91; + context.data.word(69) = 91; printdirect(context); - context.data.word(71) = 0; + context.data.word(69) = 0; goto afterprintname; nomatchslot2: context.dl = 200; @@ -16495,9 +16495,9 @@ afterprintname: static void namestoold(Context & context) { context.ds = context.cs; - context.si = 8367; + context.si = 8350; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.es = context.data.word(412); + context.es = context.data.word(410); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16505,9 +16505,9 @@ static void namestoold(Context & context) { static void oldtonames(Context & context) { context.es = context.cs; - context.di = 8367; + context.di = 8350; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16516,10 +16516,10 @@ static void oldtonames(Context & context) { static void makeheader(Context & context) { context.dx = context.ds; context.es = context.dx; - context.di = 5952; + context.di = 5912; context.ax = 17; storeit(context); - context.ax = 68-1; + context.ax = 68-0; storeit(context); context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; storeit(context); @@ -16527,7 +16527,7 @@ static void makeheader(Context & context) { storeit(context); context.ax = 48; storeit(context); - context.ax = 991-537; + context.ax = 991-534; storeit(context); return; } @@ -16559,18 +16559,18 @@ static void decide(Context & context) { setmode(context); loadpalfromiff(context); clearpalette(context); - context.data.byte(234) = 0; - context.data.word(21) = 0; - context.data.byte(231) = 0; - context.data.word(79) = 70; - context.data.word(81) = 182-8; - context.data.byte(82) = 181; - context.data.byte(131) = 1; + context.data.byte(233) = 0; + context.data.word(19) = 0; + context.data.byte(230) = 0; + context.data.word(77) = 70; + context.data.word(79) = 182-8; + context.data.byte(81) = 181; + context.data.byte(130) = 1; loadsavebox(context); showdecisions(context); worktoscreen(context); fadescreenup(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; waitdecide: readmouse(context); showpointer(context); @@ -16580,22 +16580,22 @@ waitdecide: delpointer(context); context.bx = 4884; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto waitdecide; - context._cmp(context.data.byte(103), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto hasloadedroom; getridoftemp(context); hasloadedroom: - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; return; } static void showdecisions(Context & context) { createpanel2(context); showopbox(context); - context.ds = context.data.word(458); + context.ds = context.data.word(456); context.di = 60+17; context.bx = 52+13; context.al = 6; @@ -16606,31 +16606,31 @@ static void showdecisions(Context & context) { } static void newgame(Context & context) { - context._cmp(context.data.byte(100), 251); + context._cmp(context.data.byte(99), 251); if (context.flags.z()) goto alreadynewgame; - context.data.byte(100) = 251; + context.data.byte(99) = 251; context.al = 47; commandonly(context); alreadynewgame: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._cmp(context.ax, 1); if (!context.flags.z()) goto nonewgame; - context.data.byte(103) = 3; + context.data.byte(102) = 3; nonewgame: return; } static void doload(Context & context) { - context.data.byte(340) = 1; + context.data.byte(339) = 1; showopbox(context); showloadops(context); - context.data.byte(341) = 0; + context.data.byte(340) = 0; showslots(context); shownames(context); - context.data.byte(231) = 0; + context.data.byte(230) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; loadops: delpointer(context); readmouse(context); @@ -16640,47 +16640,47 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(102), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(103), 2); + context._cmp(context.data.byte(102), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; context.es = context.dx; - context.bx = 7782; + context.bx = 7750; startloading(context); loadroomssample(context); - context.data.byte(74) = 1; - context.data.byte(188) = 255; + context.data.byte(73) = 1; + context.data.byte(187) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; startup(context); worktoscreen(context); - context.data.byte(103) = 4; + context.data.byte(102) = 4; quitloaded: return; } static void loadold(Context & context) { - context._cmp(context.data.byte(100), 252); + context._cmp(context.data.byte(99), 252); if (context.flags.z()) goto alreadyloadold; - context.data.byte(100) = 252; + context.data.byte(99) = 252; context.al = 48; commandonly(context); alreadyloadold: - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._and(context.ax, 1); if (context.flags.z()) goto noloadold; doload(context); - context._cmp(context.data.byte(103), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto noloadold; showdecisions(context); worktoscreenm(context); - context.data.byte(103) = 0; + context.data.byte(102) = 0; noloadold: return; } @@ -16727,39 +16727,39 @@ tensc: } static void trysoundalloc(Context & context) { - context._cmp(context.data.byte(358), 1); + context._cmp(context.data.byte(357), 1); if (context.flags.z()) goto gotsoundbuff; - context._add(context.data.byte(357), 1); + context._add(context.data.byte(356), 1); context.bx = (16384+2048)/16; allocatemem(context); - context.data.word(353) = context.ax; + context.data.word(351) = context.ax; context.push(context.ax); context.al = context.ah; context.cl = 4; context._shr(context.al, context.cl); - context.data.byte(356) = context.al; + context.data.byte(355) = context.al; context.ax = context.pop(); context.cl = 4; context._shl(context.ax, context.cl); - context.data.word(355) = context.ax; + context.data.word(353) = context.ax; context._cmp(context.ax, 0x0b7ff); if (!context.flags.c()) goto soundfail; - context.es = context.data.word(353); + context.es = context.data.word(351); context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; while(--context.cx) context._stosw(); - context.data.byte(358) = 1; + context.data.byte(357) = 1; return; soundfail: - context.es = context.data.word(353); + context.es = context.data.word(351); deallocatemem(context); gotsoundbuff: return; } static void playchannel0(Context & context) { - context._cmp(context.data.byte(378), 255); + context._cmp(context.data.byte(377), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); context.push(context.ds); @@ -16767,14 +16767,14 @@ static void playchannel0(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(507) = context.al; - context.es = context.data.word(420); + context.data.byte(506) = context.al; + context.es = context.data.word(418); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank; - context.es = context.data.word(422); + context.es = context.data.word(420); context._sub(context.al, 12); notsecondbank: - context.data.byte(508) = context.ah; + context.data.byte(507) = context.ah; context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; @@ -16782,19 +16782,19 @@ notsecondbank: context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); context.ah = 0; - context.data.word(502) = context.ax; + context.data.word(500) = context.ax; context.ax = context.ds.word(context.bx+1); - context.data.word(504) = context.ax; + context.data.word(502) = context.ax; context.ax = context.ds.word(context.bx+3); - context.data.word(506) = context.ax; - context._cmp(context.data.byte(508), 0); + context.data.word(504) = context.ax; + context._cmp(context.data.byte(507), 0); if (context.flags.z()) goto nosetloop; + context.ax = context.data.word(500); + context.data.word(508) = context.ax; context.ax = context.data.word(502); context.data.word(510) = context.ax; context.ax = context.data.word(504); context.data.word(512) = context.ax; - context.ax = context.data.word(506); - context.data.word(514) = context.ax; nosetloop: context.si = context.pop(); context.di = context.pop(); @@ -16807,9 +16807,9 @@ dontbother4: } static void playchannel1(Context & context) { - context._cmp(context.data.byte(378), 255); + context._cmp(context.data.byte(377), 255); if (context.flags.z()) goto dontbother5; - context._cmp(context.data.byte(515), 7); + context._cmp(context.data.byte(514), 7); if (context.flags.z()) goto dontbother5; context.push(context.es); context.push(context.ds); @@ -16817,11 +16817,11 @@ static void playchannel1(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(515) = context.al; - context.es = context.data.word(420); + context.data.byte(514) = context.al; + context.es = context.data.word(418); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank1; - context.es = context.data.word(422); + context.es = context.data.word(420); context._sub(context.al, 12); notsecondbank1: context.ah = 0; @@ -16831,11 +16831,11 @@ notsecondbank1: context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); context.ah = 0; - context.data.word(517) = context.ax; + context.data.word(515) = context.ax; context.ax = context.ds.word(context.bx+1); - context.data.word(519) = context.ax; + context.data.word(517) = context.ax; context.ax = context.ds.word(context.bx+3); - context.data.word(521) = context.ax; + context.data.word(519) = context.ax; context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); @@ -16849,102 +16849,102 @@ dontbother5: static void makenextblock(Context & context) { volumeadjust(context); loopchannel0(context); - context._cmp(context.data.word(521), 0); + context._cmp(context.data.word(519), 0); if (context.flags.z()) goto mightbeonlych0; - context._cmp(context.data.word(506), 0); + context._cmp(context.data.word(504), 0); if (context.flags.z()) goto mightbeonlych1; - context._sub(context.data.word(506), 1); - context._sub(context.data.word(521), 1); + context._sub(context.data.word(504), 1); + context._sub(context.data.word(519), 1); bothchannels(context); return; mightbeonlych1: - context.data.byte(507) = 255; - context._cmp(context.data.word(521), 0); + context.data.byte(506) = 255; + context._cmp(context.data.word(519), 0); if (context.flags.z()) goto notch1only; - context._sub(context.data.word(521), 1); + context._sub(context.data.word(519), 1); channel1only(context); notch1only: return; mightbeonlych0: - context.data.byte(515) = 255; - context._cmp(context.data.word(506), 0); + context.data.byte(514) = 255; + context._cmp(context.data.word(504), 0); if (context.flags.z()) goto notch0only; - context._sub(context.data.word(506), 1); + context._sub(context.data.word(504), 1); channel0only(context); return; notch0only: - context.es = context.data.word(353); - context.di = context.data.word(525); + context.es = context.data.word(351); + context.di = context.data.word(523); context.cx = 1024; context.ax = 0x7f7f; while(--context.cx) context._stosw(); context._and(context.di, 16384-1); - context.data.word(525) = context.di; + context.data.word(523) = context.di; return; } static void volumeadjust(Context & context) { - context.al = context.data.byte(388); + context.al = context.data.byte(387); context._cmp(context.al, 0); if (context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._cmp(context.al, context.data.byte(387)); + context.al = context.data.byte(385); + context._cmp(context.al, context.data.byte(386)); if (context.flags.z()) goto volfinish; - context._add(context.data.byte(389), 64); + context._add(context.data.byte(388), 64); if (!context.flags.z()) goto volok; - context.al = context.data.byte(386); - context._add(context.al, context.data.byte(388)); - context.data.byte(386) = context.al; + context.al = context.data.byte(385); + context._add(context.al, context.data.byte(387)); + context.data.byte(385) = context.al; return; volfinish: - context.data.byte(388) = 0; + context.data.byte(387) = 0; volok: return; } static void loopchannel0(Context & context) { - context._cmp(context.data.word(506), 0); + context._cmp(context.data.word(504), 0); if (!context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 0); + context._cmp(context.data.byte(507), 0); if (context.flags.z()) goto notloop; - context._cmp(context.data.byte(508), 255); + context._cmp(context.data.byte(507), 255); if (context.flags.z()) goto endlessloop; - context._sub(context.data.byte(508), 1); + context._sub(context.data.byte(507), 1); endlessloop: + context.ax = context.data.word(508); + context.data.word(500) = context.ax; context.ax = context.data.word(510); context.data.word(502) = context.ax; - context.ax = context.data.word(512); + context.ax = context.data.word(504); + context._add(context.ax, context.data.word(512)); context.data.word(504) = context.ax; - context.ax = context.data.word(506); - context._add(context.ax, context.data.word(514)); - context.data.word(506) = context.ax; return; notloop: return; } static void cancelch0(Context & context) { - context.data.byte(508) = 0; - context.data.word(506) = 0; - context.data.byte(507) = 255; + context.data.byte(507) = 0; + context.data.word(504) = 0; + context.data.byte(506) = 255; return; } static void cancelch1(Context & context) { - context.data.word(521) = 0; - context.data.byte(515) = 255; + context.data.word(519) = 0; + context.data.byte(514) = 255; return; } static void channel0tran(Context & context) { - context._cmp(context.data.byte(386), 0); + context._cmp(context.data.byte(385), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(--context.cx) context._movsw(); return; lowvolumetran: context.cx = 1024; - context.bh = context.data.byte(386); + context.bh = context.data.byte(385); context.bl = 0; context._add(context.bx, 16384-256); volloop: @@ -16959,7 +16959,7 @@ volloop: } static void domix(Context & context) { - context._cmp(context.data.byte(386), 0); + context._cmp(context.data.byte(385), 0); if (!context.flags.z()) goto lowvolumemix; slow: context._lodsb(); @@ -17004,7 +17004,7 @@ nodistort: lowvolumemix: context._lodsb(); context.push(context.bx); - context.bh = context.data.byte(386); + context.bh = context.data.byte(385); context._add(context.bh, 63); context.bl = context.al; context.al = context.ds.byte(context.bx); @@ -17051,7 +17051,7 @@ doneit: } static void entrytexts(Context & context) { - context._cmp(context.data.byte(9), 21); + context._cmp(context.data.byte(8), 21); if (!context.flags.z()) goto notloc15; context.al = 28; context.cx = 60; @@ -17061,7 +17061,7 @@ static void entrytexts(Context & context) { setuptimeduse(context); return; notloc15: - context._cmp(context.data.byte(9), 30); + context._cmp(context.data.byte(8), 30); if (!context.flags.z()) goto notloc43; context.al = 27; context.cx = 60; @@ -17071,7 +17071,7 @@ notloc15: setuptimeduse(context); return; notloc43: - context._cmp(context.data.byte(9), 23); + context._cmp(context.data.byte(8), 23); if (!context.flags.z()) goto notloc23; context.al = 29; context.cx = 60; @@ -17081,7 +17081,7 @@ notloc43: setuptimeduse(context); return; notloc23: - context._cmp(context.data.byte(9), 31); + context._cmp(context.data.byte(8), 31); if (!context.flags.z()) goto notloc44; context.al = 30; context.cx = 60; @@ -17091,7 +17091,7 @@ notloc23: setuptimeduse(context); return; notloc44: - context._cmp(context.data.byte(9), 20); + context._cmp(context.data.byte(8), 20); if (!context.flags.z()) goto notsarters2; context.al = 31; context.cx = 60; @@ -17101,7 +17101,7 @@ notloc44: setuptimeduse(context); return; notsarters2: - context._cmp(context.data.byte(9), 24); + context._cmp(context.data.byte(8), 24); if (!context.flags.z()) goto notedenlob; context.al = 32; context.cx = 60; @@ -17111,7 +17111,7 @@ notsarters2: setuptimeduse(context); return; notedenlob: - context._cmp(context.data.byte(9), 34); + context._cmp(context.data.byte(8), 34); if (!context.flags.z()) goto noteden2; context.al = 33; context.cx = 60; @@ -17125,71 +17125,71 @@ noteden2: } static void entryanims(Context & context) { - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.byte(9), 33); + context.data.word(21) = -1; + context.data.byte(31) = -1; + context._cmp(context.data.byte(8), 33); if (!context.flags.z()) goto notinthebeach; switchryanoff(context); - context.data.word(21) = 76*2; - context.data.word(23) = 0; - context.data.word(25) = 76; - context.data.byte(27) = 1; + context.data.word(19) = 76*2; + context.data.word(21) = 0; + context.data.word(23) = 76; context.data.byte(26) = 1; + context.data.byte(25) = 1; return; notinthebeach: - context._cmp(context.data.byte(9), 44); + context._cmp(context.data.byte(8), 44); if (!context.flags.z()) goto notsparkys; context.al = 8; resetlocation(context); - context.data.word(21) = 50*2; - context.data.word(23) = 247; - context.data.word(25) = 297; - context.data.byte(27) = 1; + context.data.word(19) = 50*2; + context.data.word(21) = 247; + context.data.word(23) = 297; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; notsparkys: - context._cmp(context.data.byte(9), 22); + context._cmp(context.data.byte(8), 22); if (!context.flags.z()) goto notinthelift; - context.data.word(21) = 31*2; - context.data.word(23) = 0; - context.data.word(25) = 30; - context.data.byte(27) = 1; + context.data.word(19) = 31*2; + context.data.word(21) = 0; + context.data.word(23) = 30; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; notinthelift: - context._cmp(context.data.byte(9), 26); + context._cmp(context.data.byte(8), 26); if (!context.flags.z()) goto notunderchurch; - context.data.byte(292) = 2; - context.data.byte(295) = 1; + context.data.byte(291) = 2; + context.data.byte(294) = 1; return; notunderchurch: - context._cmp(context.data.byte(9), 45); + context._cmp(context.data.byte(8), 45); if (!context.flags.z()) goto notenterdream; - context.data.byte(54) = 0; - context.data.word(21) = 296; - context.data.word(23) = 45; - context.data.word(25) = 198; - context.data.byte(27) = 1; + context.data.byte(53) = 0; + context.data.word(19) = 296; + context.data.word(21) = 45; + context.data.word(23) = 198; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; notenterdream: - context._cmp(context.data.byte(184), 46); + context._cmp(context.data.byte(183), 46); if (!context.flags.z()) goto notcrystal; - context._cmp(context.data.byte(43), 1); + context._cmp(context.data.byte(42), 1); if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); return; notcrystal: - context._cmp(context.data.byte(9), 9); + context._cmp(context.data.byte(8), 9); if (!context.flags.z()) goto nottopchurch; context.al = 2; checkifpathison(context); if (context.flags.z()) goto nottopchurch; - context._cmp(context.data.byte(44), 0); + context._cmp(context.data.byte(43), 0); if (context.flags.z()) goto nottopchurch; context.al = 3; checkifpathison(context); @@ -17203,7 +17203,7 @@ makedoorsopen: placesetobject(context); return; nottopchurch: - context._cmp(context.data.byte(9), 47); + context._cmp(context.data.byte(8), 47); if (!context.flags.z()) goto notdreamcentre; context.al = 4; placesetobject(context); @@ -17211,30 +17211,30 @@ nottopchurch: placesetobject(context); return; notdreamcentre: - context._cmp(context.data.byte(9), 38); + context._cmp(context.data.byte(8), 38); if (!context.flags.z()) goto notcarpark; - context.data.word(21) = 57*2; - context.data.word(23) = 4; - context.data.word(25) = 57; - context.data.byte(27) = 1; + context.data.word(19) = 57*2; + context.data.word(21) = 4; + context.data.word(23) = 57; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; notcarpark: - context._cmp(context.data.byte(9), 32); + context._cmp(context.data.byte(8), 32); if (!context.flags.z()) goto notalley; - context.data.word(21) = 66*2; - context.data.word(23) = 0; - context.data.word(25) = 66; - context.data.byte(27) = 1; + context.data.word(19) = 66*2; + context.data.word(21) = 0; + context.data.word(23) = 66; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; notalley: - context._cmp(context.data.byte(9), 24); + context._cmp(context.data.byte(8), 24); if (!context.flags.z()) goto notedensagain; context.al = 2; - context.ah = context.data.byte(185); + context.ah = context.data.byte(184); context._sub(context.ah, 1); turnanypathon(context); notedensagain: @@ -17242,7 +17242,7 @@ notedensagain: } static void initialinv(Context & context) { - context._cmp(context.data.byte(184), 24); + context._cmp(context.data.byte(183), 24); if (context.flags.z()) goto isedens; return; isedens: @@ -17271,20 +17271,20 @@ isedens: context.al = 16; context.ah = 2; pickupob(context); - context.data.byte(32) = 1; - context.data.word(29) = 0; - context.data.word(31) = 6; - context.data.byte(27) = 1; + context.data.byte(31) = 1; + context.data.word(27) = 0; + context.data.word(29) = 6; context.data.byte(26) = 1; + context.data.byte(25) = 1; switchryanoff(context); return; } static void pickupob(Context & context) { - context.data.byte(107) = context.ah; - context.data.byte(102) = 2; - context.data.byte(89) = context.al; - context.data.byte(99) = context.al; + context.data.byte(106) = context.ah; + context.data.byte(101) = 2; + context.data.byte(88) = context.al; + context.data.byte(98) = context.al; getanyad(context); transfertoex(context); return; @@ -17295,10 +17295,10 @@ static void checkforemm(Context & context) { } static void checkbasemem(Context & context) { - context.bx = context.data.word(534); + context.bx = context.data.word(532); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; - context.data.byte(532) = 5; + context.data.byte(531) = 5; { quickquit(context); return; }; enoughmem: return; @@ -17307,92 +17307,92 @@ enoughmem: static void allocatebuffers(Context & context) { context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; allocatemem(context); - context.data.word(398) = context.ax; + context.data.word(396) = context.ax; trysoundalloc(context); context.bx = 0+(66*60)/16; allocatemem(context); - context.data.word(418) = context.ax; + context.data.word(416) = context.ax; trysoundalloc(context); - context.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-537+68-1/16; + context.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(context); - context.data.word(412) = context.ax; + context.data.word(410) = context.ax; trysoundalloc(context); context.bx = 16*80/16; allocatemem(context); - context.data.word(426) = context.ax; + context.data.word(424) = context.ax; trysoundalloc(context); context.bx = 64*128/16; allocatemem(context); - context.data.word(428) = context.ax; + context.data.word(426) = context.ax; trysoundalloc(context); context.bx = 22*8*20*8/16; allocatemem(context); - context.data.word(402) = context.ax; + context.data.word(400) = context.ax; allocatework(context); context.bx = 2048/16; allocatemem(context); - context.data.word(420) = context.ax; + context.data.word(418) = context.ax; context.bx = 2048/16; allocatemem(context); - context.data.word(422) = context.ax; + context.data.word(420) = context.ax; return; } static void clearbuffers(Context & context) { - context.es = context.data.word(412); - context.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-537+68-1/2; + context.es = context.data.word(410); + context.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; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(398); + context.es = context.data.word(396); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(412); + context.es = context.data.word(410); context.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); context.ds = context.cs; - context.si = 537; - context.cx = 991-537; + context.si = 534; + context.cx = 991-534; while(--context.cx) context._movsb(); - context.es = context.data.word(412); - context.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-537; + context.es = context.data.word(410); + context.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; context.ds = context.cs; - context.si = 1; - context.cx = 68-1; + context.si = 0; + context.cx = 68-0; while(--context.cx) context._movsb(); clearchanges(context); return; } static void clearchanges(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.cx = 250*2; context.ax = 0x0ffff; context.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); while(--context.cx) context._stosw(); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.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); context.es = context.cs; - context.di = 537; - context.cx = 991-537; + context.di = 534; + context.cx = 991-534; while(--context.cx) context._movsb(); - context.ds = context.data.word(412); - context.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-537; + context.ds = context.data.word(410); + context.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; context.es = context.cs; - context.di = 1; - context.cx = 68-1; + context.di = 0; + context.cx = 68-0; while(--context.cx) context._movsb(); - context.data.byte(10) = 0; + context.data.byte(9) = 0; + context.data.word(10) = 0; context.data.word(12) = 0; - context.data.word(14) = 0; - context.es = context.data.word(398); + context.es = context.data.word(396); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); context.es = context.cs; - context.di = 7798; + context.di = 7782; context.al = 1; context._stosb(); context._stosb(); @@ -17407,48 +17407,48 @@ static void clearchanges(Context & context) { } static void clearbeforeload(Context & context) { - context._cmp(context.data.byte(74), 1); + context._cmp(context.data.byte(73), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); - context.data.byte(74) = 0; + context.data.byte(73) = 0; noclear: return; } static void clearreels(Context & context) { + context.es = context.data.word(428); + deallocatemem(context); context.es = context.data.word(430); deallocatemem(context); context.es = context.data.word(432); deallocatemem(context); - context.es = context.data.word(434); - deallocatemem(context); return; } static void clearrest(Context & context) { - context.es = context.data.word(418); + context.es = context.data.word(416); context.cx = 66*60/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(416); - deallocatemem(context); - context.es = context.data.word(444); + context.es = context.data.word(414); deallocatemem(context); - context.es = context.data.word(450); + context.es = context.data.word(442); deallocatemem(context); context.es = context.data.word(448); deallocatemem(context); - context.es = context.data.word(440); + context.es = context.data.word(446); deallocatemem(context); - context.es = context.data.word(442); + context.es = context.data.word(438); deallocatemem(context); - context.es = context.data.word(436); + context.es = context.data.word(440); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.data.word(434); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.data.word(444); + deallocatemem(context); + context.es = context.data.word(436); deallocatemem(context); return; } @@ -17486,13 +17486,13 @@ lookattail: issoundint: context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(378) = context.al; + context.data.byte(377) = context.al; context._add(context.bx, 1); goto lookattail; isdma: context.al = context.ds.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(379) = context.al; + context.data.byte(378) = context.al; context._add(context.bx, 1); goto lookattail; isbaseadd: @@ -17503,16 +17503,16 @@ isbaseadd: context.cl = 4; context._shl(context.ax, context.cl); context._add(context.ax, 0x200); - context.data.word(372) = context.ax; + context.data.word(370) = context.ax; context.cx = context.pop(); context._add(context.bx, 1); goto lookattail; isbright: - context.data.byte(73) = 1; + context.data.byte(72) = 1; context._add(context.bx, 1); goto lookattail; isnosound: - context.data.byte(378) = 255; + context.data.byte(377) = 255; context._add(context.bx, 1); goto lookattail; endtail: @@ -17520,10 +17520,10 @@ endtail: } static void startup(Context & context) { - context.data.byte(142) = 0; - context.data.byte(105) = 0; + context.data.byte(141) = 0; + context.data.byte(104) = 0; createpanel(context); - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17537,11 +17537,11 @@ static void startup(Context & context) { static void startup1(Context & context) { clearpalette(context); - context.data.byte(61) = 0; - context.data.byte(142) = '0'; - context.data.byte(105) = 0; + context.data.byte(60) = 0; + context.data.byte(141) = '0'; + context.data.byte(104) = 0; createpanel(context); - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17560,9 +17560,9 @@ static void screenupdate(Context & context) { mainscreen(context); animpointer(context); showpointer(context); - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto iswatchingmode; - context._cmp(context.data.byte(188), 255); + context._cmp(context.data.byte(187), 255); if (!context.flags.z()) goto finishearly; iswatchingmode: vsync(context); @@ -17575,7 +17575,7 @@ iswatchingmode: watchcount(context); zoom(context); showpointer(context); - context._cmp(context.data.byte(391), 0); + context._cmp(context.data.byte(390), 0); if (!context.flags.z()) goto finishearly; vsync(context); readmouse2(context); @@ -17604,74 +17604,74 @@ finishearly: } static void watchreel(Context & context) { - context._cmp(context.data.word(23), -1); + context._cmp(context.data.word(21), -1); if (context.flags.z()) goto notplayingreel; - context.al = context.data.byte(475); - context._cmp(context.al, context.data.byte(477)); + context.al = context.data.byte(474); + context._cmp(context.al, context.data.byte(476)); if (!context.flags.z()) goto waitstopwalk; - context.al = context.data.byte(135); - context._cmp(context.al, context.data.byte(133)); + context.al = context.data.byte(134); + context._cmp(context.al, context.data.byte(132)); if (context.flags.z()) goto notwatchpath; waitstopwalk: return; notwatchpath: - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); + context._sub(context.data.byte(25), 1); + context._cmp(context.data.byte(25), -1); if (!context.flags.z()) goto showwatchreel; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context.ax = context.data.word(23); - context._cmp(context.ax, context.data.word(25)); + context.al = context.data.byte(26); + context.data.byte(25) = context.al; + context.ax = context.data.word(21); + context._cmp(context.ax, context.data.word(23)); if (!context.flags.z()) goto ismorereel; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto showwatchreel; - context.data.word(23) = -1; - context.data.byte(32) = -1; - context._cmp(context.data.word(29), -1); + context.data.word(21) = -1; + context.data.byte(31) = -1; + context._cmp(context.data.word(27), -1); if (context.flags.z()) goto nomorereel; - context.data.byte(32) = 1; + context.data.byte(31) = 1; goto notplayingreel; ismorereel: - context._add(context.data.word(23), 1); + context._add(context.data.word(21), 1); showwatchreel: - context.ax = context.data.word(23); - context.data.word(239) = context.ax; + context.ax = context.data.word(21); + context.data.word(237) = context.ax; plotreel(context); - context.ax = context.data.word(239); - context.data.word(23) = context.ax; + context.ax = context.data.word(237); + context.data.word(21) = context.ax; checkforshake(context); nomorereel: return; notplayingreel: - context._cmp(context.data.byte(32), 1); + context._cmp(context.data.byte(31), 1); if (!context.flags.z()) goto notholdingreel; - context.ax = context.data.word(29); - context.data.word(239) = context.ax; + context.ax = context.data.word(27); + context.data.word(237) = context.ax; plotreel(context); return; notholdingreel: - context._cmp(context.data.byte(32), 2); + context._cmp(context.data.byte(31), 2); if (!context.flags.z()) goto notreleasehold; - context._sub(context.data.byte(26), 1); - context._cmp(context.data.byte(26), -1); + context._sub(context.data.byte(25), 1); + context._cmp(context.data.byte(25), -1); if (!context.flags.z()) goto notlastspeed2; - context.al = context.data.byte(27); - context.data.byte(26) = context.al; - context._add(context.data.word(29), 1); + context.al = context.data.byte(26); + context.data.byte(25) = context.al; + context._add(context.data.word(27), 1); notlastspeed2: - context.ax = context.data.word(29); - context._cmp(context.ax, context.data.word(31)); + context.ax = context.data.word(27); + context._cmp(context.ax, context.data.word(29)); if (!context.flags.z()) goto ismorereel2; - context.data.word(29) = -1; - context.data.byte(32) = -1; - context.al = context.data.byte(33); - context.data.byte(478) = context.al; + context.data.word(27) = -1; + context.data.byte(31) = -1; + context.al = context.data.byte(32); context.data.byte(477) = context.al; + context.data.byte(476) = context.al; autosetwalk(context); return; ismorereel2: - context.ax = context.data.word(29); - context.data.word(239) = context.ax; + context.ax = context.data.word(27); + context.data.word(237) = context.ax; plotreel(context); return; notreleasehold: @@ -17679,22 +17679,22 @@ notreleasehold: } static void checkforshake(Context & context) { - context._cmp(context.data.byte(184), 26); + context._cmp(context.data.byte(183), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; - context.data.byte(68) = -1; + context.data.byte(67) = -1; notstartshake: return; } static void watchcount(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowatchworn; - context._add(context.data.byte(146), 1); - context._cmp(context.data.byte(146), 9); + context._add(context.data.byte(145), 1); + context._cmp(context.data.byte(145), 9); if (context.flags.z()) goto flashdots; - context._cmp(context.data.byte(146), 18); + context._cmp(context.data.byte(145), 18); if (context.flags.z()) goto uptime; nowatchworn: return; @@ -17702,89 +17702,89 @@ flashdots: context.ax = 91*3+21; context.di = 268+4; context.bx = 21; - context.ds = context.data.word(404); + context.ds = context.data.word(402); showframe(context); goto finishwatch; uptime: - context.data.byte(146) = 0; + context.data.byte(145) = 0; + context._add(context.data.byte(4), 1); + context._cmp(context.data.byte(4), 60); + if (!context.flags.z()) goto finishtime; + context.data.byte(4) = 0; context._add(context.data.byte(5), 1); context._cmp(context.data.byte(5), 60); if (!context.flags.z()) goto finishtime; context.data.byte(5) = 0; context._add(context.data.byte(6), 1); - context._cmp(context.data.byte(6), 60); + context._cmp(context.data.byte(6), 24); if (!context.flags.z()) goto finishtime; context.data.byte(6) = 0; - context._add(context.data.byte(7), 1); - context._cmp(context.data.byte(7), 24); - if (!context.flags.z()) goto finishtime; - context.data.byte(7) = 0; finishtime: showtime(context); finishwatch: - context.data.byte(266) = 1; + context.data.byte(265) = 1; return; } static void showtime(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowatch; - context.al = context.data.byte(5); + context.al = context.data.byte(4); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 282+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 282+9; context.bx = 21; showframe(context); - context.al = context.data.byte(6); + context.al = context.data.byte(5); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 270+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 270+11; context.bx = 21; showframe(context); - context.al = context.data.byte(7); + context.al = context.data.byte(6); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 256+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 256+11; context.bx = 21; showframe(context); context.ax = 91*3+20; - context.ds = context.data.word(404); + context.ds = context.data.word(402); context.di = 267+5; context.bx = 21; showframe(context); @@ -17793,14 +17793,14 @@ nowatch: } static void dumpwatch(Context & context) { - context._cmp(context.data.byte(266), 1); + context._cmp(context.data.byte(265), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; context.bx = 21; context.cl = 40; context.ch = 12; multidump(context); - context.data.byte(266) = 0; + context.data.byte(265) = 0; nodumpwatch: return; } @@ -17905,57 +17905,57 @@ noconvnum: static void walkandexamine(Context & context) { finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); + context.al = context.data.byte(306); context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); + context.al = context.data.byte(307); + context.data.byte(98) = context.al; + context.data.byte(305) = 0; + context._cmp(context.data.byte(99), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(473) = 1; + context.data.byte(472) = 1; noobselect: return; diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; + context.data.byte(98) = context.al; + context.data.byte(99) = context.ah; diff2: - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.data.byte(132); + context._cmp(context.al, context.data.byte(134)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.data.byte(474); + context._cmp(context.bl, context.data.byte(473)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); + context.cl = context.data.byte(150); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.data.byte(151); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(153), 2); + context._cmp(context.data.byte(152), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); + context._cmp(context.data.byte(152), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.data.byte(474); + context._cmp(context.bl, context.data.byte(473)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); + context._cmp(context.data.byte(99), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -17974,14 +17974,14 @@ toofaraway: } static void mainscreen(Context & context) { - context.data.byte(237) = 0; + context.data.byte(236) = 0; context.bx = 4949; - context._cmp(context.data.byte(3), 1); + context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto checkmain; context.bx = 5011; checkmain: checkcoords(context); - context._cmp(context.data.byte(306), 0); + context._cmp(context.data.byte(305), 0); if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: @@ -17989,26 +17989,26 @@ finishmain: } static void madmanrun(Context & context) { - context._cmp(context.data.byte(9), 14); + context._cmp(context.data.byte(8), 14); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(234), 2); + context._cmp(context.data.byte(233), 2); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(53), 0); + context._cmp(context.data.byte(52), 0); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(100), 211); + context._cmp(context.data.byte(99), 211); if (context.flags.z()) goto alreadyrun; - context.data.byte(100) = 211; + context.data.byte(99) = 211; context.al = 52; commandonly(context); alreadyrun: - context._cmp(context.data.word(202), 1); + context._cmp(context.data.word(200), 1); if (!context.flags.z()) goto norun; - context.ax = context.data.word(202); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(200); + context._cmp(context.ax, context.data.word(210)); if (context.flags.z()) goto norun; - context.data.byte(65) = 8; + context.data.byte(64) = 8; norun: return; } @@ -18019,16 +18019,16 @@ loop048: context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nonefound; context.push(context.bx); - context._cmp(context.data.word(198), context.ax); + context._cmp(context.data.word(196), context.ax); if (context.flags.l()) goto over045; context.ax = context.ds.word(context.bx+2); - context._cmp(context.data.word(198), context.ax); + context._cmp(context.data.word(196), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.ds.word(context.bx+4); - context._cmp(context.data.word(200), context.ax); + context._cmp(context.data.word(198), context.ax); if (context.flags.l()) goto over045; context.ax = context.ds.word(context.bx+6); - context._cmp(context.data.word(200), context.ax); + context._cmp(context.data.word(198), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.ds.word(context.bx+8); __dispatch_call(context, context.ax); @@ -18044,31 +18044,31 @@ nonefound: } static void identifyob(Context & context) { - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); + context.ax = context.data.word(196); + context._sub(context.ax, context.data.word(115)); context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); return; notover1: - context.bx = context.data.word(200); - context._sub(context.bx, context.data.word(119)); + context.bx = context.data.word(198); + context._sub(context.bx, context.data.word(117)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); return; notover2: - context.data.byte(237) = 1; + context.data.byte(236) = 1; context.ah = context.bl; context.push(context.ax); findpathofpoint(context); - context.data.byte(474) = context.dl; + context.data.byte(473) = context.dl; context.ax = context.pop(); context.push(context.ax); findfirstpath(context); - context.data.byte(476) = context.al; + context.data.byte(475) = context.al; context.ax = context.pop(); checkifex(context); if (!context.flags.z()) goto finishidentify; @@ -18078,16 +18078,16 @@ notover2: if (!context.flags.z()) goto finishidentify; checkifset(context); if (!context.flags.z()) goto finishidentify; + context.ax = context.data.word(196); + context._sub(context.ax, context.data.word(115)); + context.cl = context.al; context.ax = context.data.word(198); context._sub(context.ax, context.data.word(117)); - context.cl = context.al; - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); context.ch = context.al; checkone(context); context._cmp(context.al, 0); if (context.flags.z()) goto nothingund; - context._cmp(context.data.byte(56), 1); + context._cmp(context.data.byte(55), 1); if (context.flags.z()) goto nothingund; context.ah = 3; obname(context); @@ -18099,7 +18099,7 @@ nothingund: } static void checkifperson(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.cx = 12; identifyreel: @@ -18110,7 +18110,7 @@ identifyreel: context.push(context.bx); context.push(context.ax); context.ax = context.ds.word(context.bx+0); - context.data.word(239) = context.ax; + context.data.word(237) = context.ax; getreelstart(context); context._cmp(context.ds.word(context.si+2), 0x0ffff); if (!context.flags.z()) goto notblankpers; @@ -18139,7 +18139,7 @@ notblankpers: if (!context.flags.c()) goto notareelid; context.cx = context.pop(); context.ax = context.ds.word(context.bx+2); - context.data.word(249) = context.ax; + context.data.word(247) = context.ax; context.al = context.ds.byte(context.bx+4); context.ah = 5; obname(context); @@ -18155,7 +18155,7 @@ notareelid: } static void checkifset(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; identifyset: @@ -18188,7 +18188,7 @@ notasetid: } static void checkifex(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; identifyex: @@ -18217,7 +18217,7 @@ notanexid: } static void checkiffree(Context & context) { - context.es = context.data.word(412); + context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; identifyfree: @@ -18254,7 +18254,7 @@ static void isitdescribed(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(440); + context.es = context.data.word(438); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); @@ -18271,8 +18271,8 @@ static void isitdescribed(Context & context) { static void findpathofpoint(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); + context.es = context.data.word(448); + context.al = context.data.byte(184); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18309,8 +18309,8 @@ gotvalidpath: static void findfirstpath(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(450); - context.al = context.data.byte(185); + context.es = context.data.word(448); + context.al = context.data.byte(184); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18347,7 +18347,7 @@ static void turnpathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; - context.ch = context.data.byte(185); + context.ch = context.data.byte(184); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18370,7 +18370,7 @@ static void turnpathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; - context.ch = context.data.byte(185); + context.ch = context.data.byte(184); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18401,7 +18401,7 @@ static void turnanypathon(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.data.word(448); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18427,7 +18427,7 @@ static void turnanypathoff(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.data.word(448); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18456,27 +18456,27 @@ static void checkifpathison(Context & context) { } static void afternewroom(Context & context) { - context._cmp(context.data.byte(186), 0); + context._cmp(context.data.byte(185), 0); if (context.flags.z()) goto notnew; - context.data.word(328) = 0; + context.data.word(326) = 0; createpanel(context); - context.data.byte(100) = 0; + context.data.byte(99) = 0; findroominloc(context); - context._cmp(context.data.byte(63), 1); + context._cmp(context.data.byte(62), 1); if (context.flags.z()) goto ryansoff; - context.al = context.data.byte(151); + context.al = context.data.byte(150); context._add(context.al, 12); - context.ah = context.data.byte(152); + context.ah = context.data.byte(151); context._add(context.ah, 12); findpathofpoint(context); - context.data.byte(475) = context.dl; + context.data.byte(474) = context.dl; findxyfrompath(context); - context.data.byte(187) = 1; + context.data.byte(186) = 1; ryansoff: - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); - context.data.word(98) = 160; - context.data.byte(186) = 0; + context.data.word(96) = 160; + context.data.byte(185) = 0; showicon(context); spriteupdate(context); printsprites(context); @@ -18494,50 +18494,50 @@ notnew: } static void atmospheres(Context & context) { - context.cl = context.data.byte(148); - context.ch = context.data.byte(149); + context.cl = context.data.byte(147); + context.ch = context.data.byte(148); context.bx = 5073; nextatmos: context.al = context.ds.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto nomoreatmos; - context._cmp(context.al, context.data.byte(184)); + context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto wrongatmos; context.ax = context.ds.word(context.bx+1); context._cmp(context.ax, context.cx); if (!context.flags.z()) goto wrongatmos; context.ax = context.ds.word(context.bx+3); - context._cmp(context.al, context.data.byte(507)); + context._cmp(context.al, context.data.byte(506)); if (context.flags.z()) goto playingalready; - context._cmp(context.data.byte(9), 45); + context._cmp(context.data.byte(8), 45); if (!context.flags.z()) goto notweb; - context._cmp(context.data.word(23), 45); + context._cmp(context.data.word(21), 45); if (context.flags.z()) goto wrongatmos; notweb: playchannel0(context); - context._cmp(context.data.byte(184), 2); - context._cmp(context.data.byte(149), 0); + context._cmp(context.data.byte(183), 2); + context._cmp(context.data.byte(148), 0); if (context.flags.z()) goto fullvol; if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(149), 10); + context._cmp(context.data.byte(148), 10); if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (!context.flags.z()) goto notlouisvol; - context.data.byte(386) = 5; + context.data.byte(385) = 5; notlouisvol: playingalready: - context._cmp(context.data.byte(184), 2); + context._cmp(context.data.byte(183), 2); if (!context.flags.z()) goto notlouisvol2; - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (context.flags.z()) goto louisvol; - context._cmp(context.data.byte(148), 11); + context._cmp(context.data.byte(147), 11); if (!context.flags.z()) goto notlouisvol2; fullvol: - context.data.byte(386) = 0; + context.data.byte(385) = 0; notlouisvol2: return; louisvol: - context.data.byte(386) = 5; + context.data.byte(385) = 5; return; wrongatmos: context._add(context.bx, 5); @@ -18548,126 +18548,126 @@ nomoreatmos: } static void walkintoroom(Context & context) { - context._cmp(context.data.byte(9), 14); + context._cmp(context.data.byte(8), 14); if (!context.flags.z()) goto notlair; - context._cmp(context.data.byte(148), 22); + context._cmp(context.data.byte(147), 22); if (!context.flags.z()) goto notlair; - context.data.byte(478) = 1; context.data.byte(477) = 1; + context.data.byte(476) = 1; autosetwalk(context); notlair: return; } static void afterintroroom(Context & context) { - context._cmp(context.data.byte(186), 0); + context._cmp(context.data.byte(185), 0); if (context.flags.z()) goto notnewintro; clearwork(context); findroominloc(context); - context.data.byte(62) = 1; + context.data.byte(61) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); printsprites(context); worktoscreen(context); - context.data.byte(186) = 0; + context.data.byte(185) = 0; notnewintro: return; } static void obname(Context & context) { - context._cmp(context.data.byte(473), 0); + context._cmp(context.data.byte(472), 0); if (context.flags.z()) goto notnewpath; - context.data.byte(473) = 0; + context.data.byte(472) = 0; goto diff; notnewpath: - context._cmp(context.ah, context.data.byte(100)); + context._cmp(context.ah, context.data.byte(99)); if (context.flags.z()) goto notdiffob; goto diff; notdiffob: - context._cmp(context.al, context.data.byte(99)); + context._cmp(context.al, context.data.byte(98)); if (!context.flags.z()) goto diff; - context._cmp(context.data.byte(306), 1); + context._cmp(context.data.byte(305), 1); if (context.flags.z()) goto walkandexamine; - context._cmp(context.data.word(202), 0); + context._cmp(context.data.word(200), 0); if (context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (!context.flags.z()) goto isntblock; - context._cmp(context.data.byte(153), 2); + context._cmp(context.data.byte(152), 2); if (context.flags.c()) goto noobselect; isntblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.data.byte(474); + context._cmp(context.bl, context.data.byte(473)); if (!context.flags.z()) goto wantstowalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto wantstowalk; finishedwalking(context); if (!context.flags.z()) goto noobselect; - context._cmp(context.data.byte(100), 5); + context._cmp(context.data.byte(99), 5); if (context.flags.z()) goto wantstotalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto noobselect; examineob(context); return; wantstotalk: - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto noobselect; talk(context); return; walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(307); - context.data.byte(100) = context.al; - context.al = context.data.byte(308); + context.al = context.data.byte(306); context.data.byte(99) = context.al; - context.data.byte(306) = 0; - context._cmp(context.data.byte(100), 5); + context.al = context.data.byte(307); + context.data.byte(98) = context.al; + context.data.byte(305) = 0; + context._cmp(context.data.byte(99), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(473) = 1; + context.data.byte(472) = 1; noobselect: return; diff: - context.data.byte(99) = context.al; - context.data.byte(100) = context.ah; + context.data.byte(98) = context.al; + context.data.byte(99) = context.ah; diff2: - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.data.byte(132); + context._cmp(context.al, context.data.byte(134)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.data.byte(474); + context._cmp(context.bl, context.data.byte(473)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(151); + context.cl = context.data.byte(150); context._add(context.cl, 12); - context.ch = context.data.byte(152); + context.ch = context.data.byte(151); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(153), 2); + context._cmp(context.data.byte(152), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(153), 128); + context._cmp(context.data.byte(152), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(475); - context._cmp(context.bl, context.data.byte(474)); + context.bl = context.data.byte(474); + context._cmp(context.bl, context.data.byte(473)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(100), 5); + context._cmp(context.data.byte(99), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -18686,17 +18686,17 @@ toofaraway: } static void finishedwalking(Context & context) { - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto iswalking; - context.al = context.data.byte(133); - context._cmp(context.al, context.data.byte(135)); + context.al = context.data.byte(132); + context._cmp(context.al, context.data.byte(134)); iswalking: return; } static void examineobtext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.data.byte(98); + context.bh = context.data.byte(99); context.al = 1; commandwithob(context); return; @@ -18725,13 +18725,13 @@ static void commandwithob(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); + context.es = context.data.word(450); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); + context.di = context.data.word(77); + context.bx = context.data.word(79); + context.dl = context.data.byte(81); context.al = 0; context.ah = 0; printdirect(context); @@ -18739,19 +18739,19 @@ static void commandwithob(Context & context) { context.di = 5674; copyname(context); context.ax = context.pop(); - context.di = context.data.word(84); + context.di = context.data.word(82); context._cmp(context.al, 0); if (context.flags.z()) goto noadd; context._add(context.di, 5); noadd: - context.bx = context.data.word(81); + context.bx = context.data.word(79); context.es = context.cs; context.si = 5674; - context.dl = context.data.byte(82); + context.dl = context.data.byte(81); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(109) = 1; + context.data.byte(108) = 1; return; } @@ -18776,17 +18776,17 @@ static void commandonly(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); + context.es = context.data.word(450); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(79); - context.bx = context.data.word(81); - context.dl = context.data.byte(82); + context.di = context.data.word(77); + context.bx = context.data.word(79); + context.dl = context.data.byte(81); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(109) = 1; + context.data.byte(108) = 1; return; } @@ -18797,7 +18797,7 @@ static void printmessage(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); + context.es = context.data.word(450); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18818,7 +18818,7 @@ static void printmessage2(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(452); + context.es = context.data.word(450); context.ax = context.ds.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18839,63 +18839,63 @@ searchmess: } static void blocknametext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.data.byte(98); + context.bh = context.data.byte(99); context.al = 0; commandwithob(context); return; } static void personnametext(Context & context) { - context.bl = context.data.byte(99); + context.bl = context.data.byte(98); context._and(context.bl, 127); - context.bh = context.data.byte(100); + context.bh = context.data.byte(99); context.al = 2; commandwithob(context); return; } static void walktotext(Context & context) { - context.bl = context.data.byte(99); - context.bh = context.data.byte(100); + context.bl = context.data.byte(98); + context.bh = context.data.byte(99); context.al = 3; commandwithob(context); return; } static void getflagunderp(Context & context) { - context.cx = context.data.word(198); - context._sub(context.cx, context.data.word(117)); - context.ax = context.data.word(200); - context._sub(context.ax, context.data.word(119)); + context.cx = context.data.word(196); + context._sub(context.cx, context.data.word(115)); + context.ax = context.data.word(198); + context._sub(context.ax, context.data.word(117)); context.ch = context.al; checkone(context); - context.data.byte(153) = context.cl; - context.data.byte(154) = context.ch; + context.data.byte(152) = context.cl; + context.data.byte(153) = context.ch; return; } static void setwalk(Context & context) { - context._cmp(context.data.byte(492), 254); + context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto alreadywalking; - context.al = context.data.byte(474); - context._cmp(context.al, context.data.byte(475)); + context.al = context.data.byte(473); + context._cmp(context.al, context.data.byte(474)); if (context.flags.z()) goto cantwalk2; - context._cmp(context.data.byte(32), 1); + context._cmp(context.data.byte(31), 1); if (context.flags.z()) goto holdingreel; - context._cmp(context.data.byte(32), 2); + context._cmp(context.data.byte(31), 2); if (context.flags.z()) goto cantwalk; - context.data.byte(478) = context.al; context.data.byte(477) = context.al; - context._cmp(context.data.word(202), 2); + context.data.byte(476) = context.al; + context._cmp(context.data.word(200), 2); if (!context.flags.z()) goto notwalkandexam; - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto notwalkandexam; - context.data.byte(306) = 1; - context.al = context.data.byte(100); - context.data.byte(307) = context.al; + context.data.byte(305) = 1; context.al = context.data.byte(99); - context.data.byte(308) = context.al; + context.data.byte(306) = context.al; + context.al = context.data.byte(98); + context.data.byte(307) = context.al; notwalkandexam: autosetwalk(context); cantwalk: @@ -18904,25 +18904,25 @@ cantwalk2: facerightway(context); return; alreadywalking: - context.al = context.data.byte(474); - context.data.byte(477) = context.al; + context.al = context.data.byte(473); + context.data.byte(476) = context.al; return; holdingreel: - context.data.byte(33) = context.al; - context.data.byte(32) = 2; + context.data.byte(32) = context.al; + context.data.byte(31) = 2; return; } static void autosetwalk(Context & context) { - context.al = context.data.byte(475); - context._cmp(context.data.byte(477), context.al); + context.al = context.data.byte(474); + context._cmp(context.data.byte(476), context.al); if (!context.flags.z()) goto notsamealready; return; notsamealready: getroomspaths(context); checkdest(context); context.push(context.bx); - context.al = context.data.byte(475); + context.al = context.data.byte(474); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18931,13 +18931,13 @@ notsamealready: context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(480) = context.ax; + context.data.word(478) = context.ax; context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(482) = context.ax; + context.data.word(480) = context.ax; context.bx = context.pop(); - context.al = context.data.byte(478); + context.al = context.data.byte(477); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18946,33 +18946,33 @@ notsamealready: context.al = context.ds.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(484) = context.ax; + context.data.word(482) = context.ax; context.al = context.ds.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(486) = context.ax; + context.data.word(484) = context.ax; bresenhams(context); - context._cmp(context.data.byte(493), 0); + context._cmp(context.data.byte(492), 0); if (context.flags.z()) goto normalline; - context.al = context.data.byte(494); + context.al = context.data.byte(493); context._sub(context.al, 1); - context.data.byte(492) = context.al; - context.data.byte(493) = 1; + context.data.byte(491) = context.al; + context.data.byte(492) = 1; return; normalline: - context.data.byte(492) = 0; + context.data.byte(491) = 0; return; } static void checkdest(Context & context) { context.push(context.bx); context._add(context.bx, 12*8); - context.ah = context.data.byte(475); + context.ah = context.data.byte(474); context.cl = 4; context._shl(context.ah, context.cl); - context.al = context.data.byte(478); + context.al = context.data.byte(477); context.cl = 24; - context.ch = context.data.byte(478); + context.ch = context.data.byte(477); checkdestloop: context.dh = context.ds.byte(context.bx); context._and(context.dh, 0xf0); @@ -18982,7 +18982,7 @@ checkdestloop: if (!context.flags.z()) goto nextcheck; context.al = context.ds.byte(context.bx+1); context._and(context.al, 15); - context.data.byte(478) = context.al; + context.data.byte(477) = context.al; context.bx = context.pop(); return; nextcheck: @@ -19006,7 +19006,7 @@ nextcheck2: context._add(context.bx, 2); context._sub(context.cl, 1); if (!context.flags.z()) goto checkdestloop; - context.data.byte(478) = context.ch; + context.data.byte(477) = context.ch; context.bx = context.pop(); return; } @@ -19015,62 +19015,62 @@ static void bresenhams(Context & context) { workoutframes(context); context.dx = context.ds; context.es = context.dx; - context.di = 8344; + context.di = 7944; context.si = 1; - context.data.byte(493) = 0; - context.cx = context.data.word(484); - context._sub(context.cx, context.data.word(480)); + context.data.byte(492) = 0; + context.cx = context.data.word(482); + context._sub(context.cx, context.data.word(478)); if (context.flags.z()) goto vertline; if (!context.flags.s()) goto line1; context._neg(context.cx); + context.bx = context.data.word(482); + context._xchg(context.bx, context.data.word(478)); + context.data.word(482) = context.bx; context.bx = context.data.word(484); context._xchg(context.bx, context.data.word(480)); context.data.word(484) = context.bx; - context.bx = context.data.word(486); - context._xchg(context.bx, context.data.word(482)); - context.data.word(486) = context.bx; - context.data.byte(493) = 1; + context.data.byte(492) = 1; line1: - context.bx = context.data.word(486); - context._sub(context.bx, context.data.word(482)); + context.bx = context.data.word(484); + context._sub(context.bx, context.data.word(480)); if (context.flags.z()) goto horizline; if (!context.flags.s()) goto line3; context._neg(context.bx); context._neg(context.si); line3: context.push(context.si); - context.data.byte(491) = 0; + context.data.byte(490) = 0; context._cmp(context.bx, context.cx); if (context.flags.le()) goto line4; - context.data.byte(491) = 1; + context.data.byte(490) = 1; context._xchg(context.bx, context.cx); line4: context._shl(context.bx, 1); - context.data.word(488) = context.bx; + context.data.word(486) = context.bx; context._sub(context.bx, context.cx); context.si = context.bx; context._sub(context.bx, context.cx); - context.data.word(490) = context.bx; - context.ax = context.data.word(480); - context.bx = context.data.word(482); + context.data.word(488) = context.bx; + context.ax = context.data.word(478); + context.bx = context.data.word(480); context.ah = context.bl; context._add(context.cx, 1); context.bx = context.pop(); - context._cmp(context.data.byte(491), 1); + context._cmp(context.data.byte(490), 1); if (context.flags.z()) goto hislope; goto loslope; vertline: - context.ax = context.data.word(482); - context.bx = context.data.word(486); + context.ax = context.data.word(480); + context.bx = context.data.word(484); context.cx = context.bx; context._sub(context.cx, context.ax); if (!context.flags.ge()) goto line31; context._neg(context.cx); context.ax = context.bx; - context.data.byte(493) = 1; + context.data.byte(492) = 1; line31: context._add(context.cx, 1); - context.bx = context.data.word(480); + context.bx = context.data.word(478); context._xchg(context.ax, context.bx); context.ah = context.bl; context.bx = context.si; @@ -19080,8 +19080,8 @@ line32: if (--context.cx) goto line32; goto lineexit; horizline: - context.ax = context.data.word(480); - context.bx = context.data.word(482); + context.ax = context.data.word(478); + context.bx = context.data.word(480); context.ah = context.bl; context._add(context.cx, 1); horizloop: @@ -19095,11 +19095,11 @@ loloop: context._add(context.al, 1); context._or(context.si, context.si); if (!context.flags.s()) goto line12; - context._add(context.si, context.data.word(488)); + context._add(context.si, context.data.word(486)); if (--context.cx) goto loloop; goto lineexit; line12: - context._add(context.si, context.data.word(490)); + context._add(context.si, context.data.word(488)); context._add(context.ah, context.bl); if (--context.cx) goto loloop; goto lineexit; @@ -19109,33 +19109,33 @@ hiloop: context._add(context.ah, context.bl); context._or(context.si, context.si); if (!context.flags.s()) goto line23; - context._add(context.si, context.data.word(488)); + context._add(context.si, context.data.word(486)); if (--context.cx) goto hiloop; goto lineexit; line23: - context._add(context.si, context.data.word(490)); + context._add(context.si, context.data.word(488)); context._add(context.al, 1); if (--context.cx) goto hiloop; lineexit: - context._sub(context.di, 8344); + context._sub(context.di, 7944); context.ax = context.di; context._shr(context.ax, 1); - context.data.byte(494) = context.al; + context.data.byte(493) = context.al; return; } static void workoutframes(Context & context) { - context.bx = context.data.word(480); + context.bx = context.data.word(478); context._add(context.bx, 32); - context.ax = context.data.word(484); + context.ax = context.data.word(482); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (!context.flags.c()) goto notneg1; context._neg(context.bx); notneg1: - context.cx = context.data.word(482); + context.cx = context.data.word(480); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.data.word(484); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto notneg2; @@ -19159,16 +19159,16 @@ tendstohoriz: context.dl = 1; goto gotquad; gotquad: - context.bx = context.data.word(480); + context.bx = context.data.word(478); context._add(context.bx, 32); - context.ax = context.data.word(484); + context.ax = context.data.word(482); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (context.flags.c()) goto isinright; isinleft: - context.cx = context.data.word(482); + context.cx = context.data.word(480); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.data.word(484); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto topleft; @@ -19182,9 +19182,9 @@ topleft: context._add(context.dl, 6); goto success; isinright: - context.cx = context.data.word(482); + context.cx = context.data.word(480); context._add(context.cx, 32); - context.ax = context.data.word(486); + context.ax = context.data.word(484); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto botright; @@ -19197,17 +19197,17 @@ botright: noswap2: success: context._and(context.dl, 7); - context.data.byte(135) = context.dl; - context.data.byte(136) = 0; + context.data.byte(134) = context.dl; + context.data.byte(135) = 0; return; } static void getroomspaths(Context & context) { - context.al = context.data.byte(185); + context.al = context.data.byte(184); context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.data.word(448); context.bx = 0; context._add(context.bx, context.ax); return; @@ -19252,7 +19252,7 @@ static void findobname(Context & context) { context.bx = 64*2; context._mul(context.bx); context.si = context.ax; - context.ds = context.data.word(448); + context.ds = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -19263,7 +19263,7 @@ static void findobname(Context & context) { notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; - context.ds = context.data.word(398); + context.ds = context.data.word(396); context._add(context.bx, 0+2080+30000+(16*114)); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); @@ -19272,7 +19272,7 @@ notpersonname: notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; - context.ds = context.data.word(438); + context.ds = context.data.word(436); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(82*2)); @@ -19281,14 +19281,14 @@ notextraname: notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; - context.ds = context.data.word(440); + context.ds = context.data.word(438); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); context.si = context.ax; return; notsetname: - context.ds = context.data.word(442); + context.ds = context.data.word(440); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(98*2)); @@ -19297,7 +19297,7 @@ notsetname: } static void showicon(Context & context) { - context._cmp(context.data.byte(184), 50); + context._cmp(context.data.byte(183), 50); if (!context.flags.c()) goto isdream1; showpanel(context); showman(context); @@ -19306,37 +19306,37 @@ static void showicon(Context & context) { zoomicon(context); return; isdream1: - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 72; context.bx = 2; context.al = 45; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 72+47; context.bx = 2; context.al = 46; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 69-10; context.bx = 21; context.al = 49; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 160+88; context.bx = 2; context.al = 45; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 160+43; context.bx = 2; context.al = 46; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 160+101; context.bx = 21; context.al = 49; @@ -19347,25 +19347,25 @@ isdream1: } static void middlepanel(Context & context) { - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 72+47+20; context.bx = 0; context.al = 48; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 72+19; context.bx = 21; context.al = 47; context.ah = 0; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 160+23; context.bx = 0; context.al = 48; context.ah = 4; showframe(context); - context.ds = context.data.word(464); + context.ds = context.data.word(462); context.di = 160+71; context.bx = 21; context.al = 47; @@ -19375,21 +19375,21 @@ static void middlepanel(Context & context) { } static void showman(Context & context) { - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 0; context.bx = 114; context.al = 1; context.ah = 0; showframe(context); - context._cmp(context.data.byte(4), 0); + context._cmp(context.data.byte(3), 0); if (context.flags.z()) goto notverycool; - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 28; context.bx = 25; context.al = 2; @@ -19400,13 +19400,13 @@ notverycool: } static void showpanel(Context & context) { - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 72; context.bx = 0; context.al = 19; context.ah = 0; showframe(context); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 192; context.bx = 0; context.al = 19; @@ -19421,48 +19421,48 @@ static void roomname(Context & context) { context.al = 53; context.dl = 240; printmessage(context); - context.bl = context.data.byte(185); + context.bl = context.data.byte(184); context._cmp(context.bl, 32); if (context.flags.c()) goto notover32; context._sub(context.bl, 32); notover32: context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(436); + context.es = context.data.word(434); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(38*2)); context.si = context.ax; - context.data.word(77) = 7; + context.data.word(75) = 7; context.di = 88; context.bx = 25; context.dl = 120; - context._cmp(context.data.byte(3), 1); + context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto gotpl; context.dl = 160; gotpl: context.al = 0; context.ah = 0; printdirect(context); - context.data.word(77) = 10; + context.data.word(75) = 10; usecharset1(context); return; } static void usecharset1(Context & context) { - context.ax = context.data.word(404); - context.data.word(268) = context.ax; + context.ax = context.data.word(402); + context.data.word(266) = context.ax; return; } static void usetempcharset(Context & context) { - context.ax = context.data.word(406); - context.data.word(268) = context.ax; + context.ax = context.data.word(404); + context.data.word(266) = context.ax; return; } static void showexit(Context & context) { - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 274; context.bx = 154; context.al = 11; @@ -19473,12 +19473,12 @@ static void showexit(Context & context) { static void panelicons1(Context & context) { context.di = 0; - context._cmp(context.data.byte(3), 1); + context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto watchison; context.di = 48; watchison: context.push(context.di); - context.ds = context.data.word(410); + context.ds = context.data.word(408); context._add(context.di, 204); context.bx = 4; context.al = 2; @@ -19486,9 +19486,9 @@ watchison: showframe(context); context.di = context.pop(); context.push(context.di); - context._cmp(context.data.byte(8), 1); + context._cmp(context.data.byte(7), 1); if (context.flags.z()) goto zoomisoff; - context.ds = context.data.word(408); + context.ds = context.data.word(406); context._add(context.di, 228); context.bx = 8; context.al = 5; @@ -19501,9 +19501,9 @@ zoomisoff: } static void showwatch(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowristwatch; - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 250; context.bx = 1; context.al = 6; @@ -19515,9 +19515,9 @@ nowristwatch: } static void zoomicon(Context & context) { - context._cmp(context.data.byte(8), 0); + context._cmp(context.data.byte(7), 0); if (context.flags.z()) goto nozoom1; - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 8; context.bx = 132-1; context.al = 8; @@ -19528,20 +19528,20 @@ nozoom1: } static void showblink(Context & context) { - context._cmp(context.data.byte(131), 1); + context._cmp(context.data.byte(130), 1); if (context.flags.z()) goto finblink1; - context._add(context.data.byte(472), 1); - context._cmp(context.data.byte(4), 0); + context._add(context.data.byte(471), 1); + context._cmp(context.data.byte(3), 0); if (!context.flags.z()) goto finblink1; - context._cmp(context.data.byte(184), 50); + context._cmp(context.data.byte(183), 50); if (!context.flags.c()) goto eyesshut; - context.al = context.data.byte(472); + context.al = context.data.byte(471); context._cmp(context.al, 3); if (!context.flags.z()) goto finblink1; - context.data.byte(472) = 0; - context.al = context.data.byte(471); + context.data.byte(471) = 0; + context.al = context.data.byte(470); context._add(context.al, 1); - context.data.byte(471) = context.al; + context.data.byte(470) = context.al; context._cmp(context.al, 6); if (context.flags.c()) goto nomorethan6; context.al = 6; @@ -19550,7 +19550,7 @@ nomorethan6: context.bx = 5691; context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.di = 44; context.bx = 32; context.ah = 0; @@ -19562,11 +19562,11 @@ eyesshut: } static void dumpblink(Context & context) { - context._cmp(context.data.byte(4), 0); + context._cmp(context.data.byte(3), 0); if (!context.flags.z()) goto nodumpeye; - context._cmp(context.data.byte(472), 0); + context._cmp(context.data.byte(471), 0); if (!context.flags.z()) goto nodumpeye; - context.al = context.data.byte(471); + context.al = context.data.byte(470); context._cmp(context.al, 6); if (!context.flags.c()) goto nodumpeye; context.push(context.ds); @@ -19591,9 +19591,9 @@ static void worktoscreenm(Context & context) { } static void blank(Context & context) { - context._cmp(context.data.byte(100), 199); + context._cmp(context.data.byte(99), 199); if (context.flags.z()) goto alreadyblnk; - context.data.byte(100) = 199; + context.data.byte(99) = 199; context.al = 0; commandonly(context); alreadyblnk: @@ -19612,14 +19612,14 @@ static void hangonp(Context & context) { context._add(context.cx, context.cx); context.ax = context.pop(); context._add(context.cx, context.ax); - context.data.word(138) = 0; - context.al = context.data.byte(231); - context.ah = context.data.byte(106); + context.data.word(136) = 0; + context.al = context.data.byte(230); + context.ah = context.data.byte(105); context.push(context.ax); - context.data.byte(234) = 3; - context.data.byte(106) = 0; + context.data.byte(233) = 3; + context.data.byte(105) = 0; context.push(context.cx); - context.data.byte(100) = 255; + context.data.byte(99) = 255; readmouse(context); animpointer(context); showpointer(context); @@ -19635,19 +19635,19 @@ hangloop: vsync(context); dumppointer(context); context.cx = context.pop(); - context.ax = context.data.word(202); + context.ax = context.data.word(200); context._cmp(context.ax, 0); if (context.flags.z()) goto notpressed; - context._cmp(context.ax, context.data.word(212)); + context._cmp(context.ax, context.data.word(210)); if (!context.flags.z()) goto getoutofit; notpressed: if (--context.cx) goto hangloop; getoutofit: delpointer(context); context.ax = context.pop(); - context.data.byte(231) = context.al; - context.data.byte(106) = context.ah; - context.data.byte(234) = 0; + context.data.byte(230) = context.al; + context.data.byte(105) = context.ah; + context.data.byte(233) = 0; return; } @@ -19679,7 +19679,7 @@ monloop1: static void getunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19688,7 +19688,7 @@ static void getunderzoom(Context & context) { } static void dumpzoom(Context & context) { - context._cmp(context.data.byte(8), 1); + context._cmp(context.data.byte(7), 1); if (!context.flags.z()) goto notzoomon; context.di = 8+5; context.bx = 132+4; @@ -19702,7 +19702,7 @@ notzoomon: static void putunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19711,12 +19711,12 @@ static void putunderzoom(Context & context) { } static void crosshair(Context & context) { - context._cmp(context.data.byte(100), 3); + context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto nocross; - context._cmp(context.data.byte(100), 10); + context._cmp(context.data.byte(99), 10); if (!context.flags.c()) goto nocross; - context.es = context.data.word(400); - context.ds = context.data.word(408); + context.es = context.data.word(398); + context.ds = context.data.word(406); context.di = 8+24; context.bx = 132+19; context.al = 9; @@ -19724,8 +19724,8 @@ static void crosshair(Context & context) { showframe(context); return; nocross: - context.es = context.data.word(400); - context.ds = context.data.word(408); + context.es = context.data.word(398); + context.ds = context.data.word(406); context.di = 8+24; context.bx = 132+19; context.al = 29; @@ -19736,16 +19736,16 @@ nocross: static void showpointer(Context & context) { showblink(context); - context.di = context.data.word(198); - context.data.word(220) = context.di; - context.bx = context.data.word(200); - context.data.word(222) = context.bx; - context._cmp(context.data.byte(106), 1); + context.di = context.data.word(196); + context.data.word(218) = context.di; + context.bx = context.data.word(198); + context.data.word(220) = context.bx; + context._cmp(context.data.byte(105), 1); if (context.flags.z()) goto itsanobject; context.push(context.bx); context.push(context.di); - context.ds = context.data.word(408); - context.al = context.data.byte(231); + context.ds = context.data.word(406); + context.al = context.data.byte(230); context._add(context.al, 20); context.ah = 0; context._add(context.ax, context.ax); @@ -19761,10 +19761,10 @@ notsmallx: if (!context.flags.c()) goto notsmally; context.ch = 12; notsmally: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; + context.data.byte(226) = context.cl; + context.data.byte(227) = context.ch; context.push(context.ds); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19772,7 +19772,7 @@ notsmally: context.bx = context.pop(); context.push(context.di); context.push(context.bx); - context.al = context.data.byte(231); + context.al = context.data.byte(230); context._add(context.al, 20); context.ah = 0; showframe(context); @@ -19780,11 +19780,11 @@ notsmally: context.di = context.pop(); return; itsanobject: - context.al = context.data.byte(89); - context.ds = context.data.word(398); - context._cmp(context.data.byte(102), 4); + context.al = context.data.byte(88); + context.ds = context.data.word(396); + context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto itsfrominv; - context.ds = context.data.word(446); + context.ds = context.data.word(444); itsfrominv: context.cl = context.al; context._add(context.al, context.al); @@ -19806,8 +19806,8 @@ notsmallx2: if (!context.flags.c()) goto notsmally2; context.ch = 12; notsmally2: - context.data.byte(227) = context.cl; - context.data.byte(228) = context.ch; + context.data.byte(226) = context.cl; + context.data.byte(227) = context.ch; context.ax = context.pop(); context.push(context.di); context.push(context.bx); @@ -19818,13 +19818,13 @@ notsmally2: context.al = context.cl; context.ah = 0; context._shr(context.ax, 1); - context._sub(context.data.word(220), context.ax); + context._sub(context.data.word(218), context.ax); context._sub(context.di, context.ax); context.al = context.ch; context._shr(context.ax, 1); - context._sub(context.data.word(222), context.ax); + context._sub(context.data.word(220), context.ax); context._sub(context.bx, context.ax); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19835,7 +19835,7 @@ notsmally2: showframe(context); context.bx = context.pop(); context.di = context.pop(); - context.ds = context.data.word(408); + context.ds = context.data.word(406); context.al = 3; context.ah = 128; showframe(context); @@ -19843,20 +19843,20 @@ notsmally2: } static void delpointer(Context & context) { - context.ax = context.data.word(220); + context.ax = context.data.word(218); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; + context.data.word(222) = context.ax; + context.ax = context.data.word(220); context.data.word(224) = context.ax; - context.ax = context.data.word(222); - context.data.word(226) = context.ax; - context.cl = context.data.byte(227); - context.data.byte(229) = context.cl; - context.ch = context.data.byte(228); - context.data.byte(230) = context.ch; - context.ds = context.data.word(412); + context.cl = context.data.byte(226); + context.data.byte(228) = context.cl; + context.ch = context.data.byte(227); + context.data.byte(229) = context.ch; + context.ds = context.data.word(410); context.si = 0+(228*13)+32+60; - context.di = context.data.word(224); - context.bx = context.data.word(226); + context.di = context.data.word(222); + context.bx = context.data.word(224); multiput(context); nevershown: return; @@ -19864,30 +19864,30 @@ nevershown: static void dumppointer(Context & context) { dumpblink(context); - context.cl = context.data.byte(229); - context.ch = context.data.byte(230); - context.di = context.data.word(224); - context.bx = context.data.word(226); + context.cl = context.data.byte(228); + context.ch = context.data.byte(229); + context.di = context.data.word(222); + context.bx = context.data.word(224); multidump(context); - context.bx = context.data.word(222); - context.di = context.data.word(220); - context._cmp(context.di, context.data.word(224)); + context.bx = context.data.word(220); + context.di = context.data.word(218); + context._cmp(context.di, context.data.word(222)); if (!context.flags.z()) goto difffound; - context._cmp(context.bx, context.data.word(226)); + context._cmp(context.bx, context.data.word(224)); if (context.flags.z()) goto notboth; difffound: - context.cl = context.data.byte(227); - context.ch = context.data.byte(228); + context.cl = context.data.byte(226); + context.ch = context.data.byte(227); multidump(context); notboth: return; } static void undertextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.di = context.data.word(77); + context.bx = context.data.word(79); context._sub(context.bx, 3); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0; context.cl = 228; context.ch = 13; @@ -19896,10 +19896,10 @@ static void undertextline(Context & context) { } static void deltextline(Context & context) { - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.di = context.data.word(77); + context.bx = context.data.word(79); context._sub(context.bx, 3); - context.ds = context.data.word(412); + context.ds = context.data.word(410); context.si = 0; context.cl = 228; context.ch = 13; @@ -19908,11 +19908,11 @@ static void deltextline(Context & context) { } static void dumptextline(Context & context) { - context._cmp(context.data.byte(109), 1); + context._cmp(context.data.byte(108), 1); if (!context.flags.z()) goto nodumptextline; - context.data.byte(109) = 0; - context.di = context.data.word(79); - context.bx = context.data.word(81); + context.data.byte(108) = 0; + context.di = context.data.word(77); + context.bx = context.data.word(79); context._sub(context.bx, 3); context.cl = 228; context.ch = 13; @@ -19922,19 +19922,19 @@ nodumptextline: } static void animpointer(Context & context) { - context._cmp(context.data.byte(234), 2); + context._cmp(context.data.byte(233), 2); if (context.flags.z()) goto combathand; - context._cmp(context.data.byte(234), 3); + context._cmp(context.data.byte(233), 3); if (context.flags.z()) goto mousehand; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (context.flags.z()) goto notwatchpoint; - context.data.byte(231) = 11; + context.data.byte(230) = 11; return; notwatchpoint: - context.data.byte(231) = 0; - context._cmp(context.data.byte(237), 0); + context.data.byte(230) = 0; + context._cmp(context.data.byte(236), 0); if (context.flags.z()) goto gothand; - context._cmp(context.data.byte(476), 0); + context._cmp(context.data.byte(475), 0); if (context.flags.z()) goto gothand; arrow: getflagunderp(context); @@ -19942,133 +19942,133 @@ arrow: if (context.flags.c()) goto gothand; context._cmp(context.cl, 128); if (!context.flags.c()) goto gothand; - context.data.byte(231) = 3; + context.data.byte(230) = 3; context._test(context.cl, 4); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 4; + context.data.byte(230) = 4; context._test(context.cl, 16); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 5; + context.data.byte(230) = 5; context._test(context.cl, 2); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 6; + context.data.byte(230) = 6; context._test(context.cl, 8); if (!context.flags.z()) goto gothand; - context.data.byte(231) = 8; + context.data.byte(230) = 8; gothand: return; mousehand: - context._cmp(context.data.byte(235), 0); + context._cmp(context.data.byte(234), 0); if (context.flags.z()) goto rightspeed3; - context._sub(context.data.byte(235), 1); + context._sub(context.data.byte(234), 1); goto finflashmouse; rightspeed3: - context.data.byte(235) = 5; - context._add(context.data.byte(236), 1); - context._cmp(context.data.byte(236), 16); + context.data.byte(234) = 5; + context._add(context.data.byte(235), 1); + context._cmp(context.data.byte(235), 16); if (!context.flags.z()) goto finflashmouse; - context.data.byte(236) = 0; + context.data.byte(235) = 0; finflashmouse: - context.al = context.data.byte(236); + context.al = context.data.byte(235); context.ah = 0; context.bx = 5698; context._add(context.bx, context.ax); context.al = context.ds.byte(context.bx); - context.data.byte(231) = context.al; + context.data.byte(230) = context.al; return; combathand: - context.data.byte(231) = 0; - context._cmp(context.data.byte(184), 14); + context.data.byte(230) = 0; + context._cmp(context.data.byte(183), 14); if (!context.flags.z()) goto notarrow; - context._cmp(context.data.byte(100), 211); + context._cmp(context.data.byte(99), 211); if (!context.flags.z()) goto notarrow; - context.data.byte(231) = 5; + context.data.byte(230) = 5; notarrow: return; } static void readmouse(Context & context) { - context.ax = context.data.word(202); + context.ax = context.data.word(200); + context.data.word(210) = context.ax; + context.ax = context.data.word(196); context.data.word(212) = context.ax; context.ax = context.data.word(198); context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(202) = context.bx; + context.data.word(196) = context.cx; + context.data.word(198) = context.dx; + context.data.word(200) = context.bx; return; } static void readmouse1(Context & context) { + context.ax = context.data.word(196); + context.data.word(212) = context.ax; context.ax = context.data.word(198); context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(204) = context.bx; + context.data.word(196) = context.cx; + context.data.word(198) = context.dx; + context.data.word(202) = context.bx; return; } static void readmouse2(Context & context) { + context.ax = context.data.word(196); + context.data.word(212) = context.ax; context.ax = context.data.word(198); context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(206) = context.bx; + context.data.word(196) = context.cx; + context.data.word(198) = context.dx; + context.data.word(204) = context.bx; return; } static void readmouse3(Context & context) { + context.ax = context.data.word(196); + context.data.word(212) = context.ax; context.ax = context.data.word(198); context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.data.word(208) = context.bx; + context.data.word(196) = context.cx; + context.data.word(198) = context.dx; + context.data.word(206) = context.bx; return; } static void readmouse4(Context & context) { - context.ax = context.data.word(202); + context.ax = context.data.word(200); + context.data.word(210) = context.ax; + context.ax = context.data.word(196); context.data.word(212) = context.ax; context.ax = context.data.word(198); context.data.word(214) = context.ax; - context.ax = context.data.word(200); - context.data.word(216) = context.ax; mousecall(context); - context.data.word(198) = context.cx; - context.data.word(200) = context.dx; - context.ax = context.data.word(204); + context.data.word(196) = context.cx; + context.data.word(198) = context.dx; + context.ax = context.data.word(202); + context._or(context.ax, context.data.word(204)); context._or(context.ax, context.data.word(206)); - context._or(context.ax, context.data.word(208)); context._or(context.bx, context.ax); - context.data.word(202) = context.bx; + context.data.word(200) = context.bx; return; } static void readkey(Context & context) { - context.bx = context.data.word(396); - context._cmp(context.bx, context.data.word(394)); + context.bx = context.data.word(394); + context._cmp(context.bx, context.data.word(392)); if (context.flags.z()) goto nokey; context._add(context.bx, 1); context._and(context.bx, 15); - context.data.word(396) = context.bx; + context.data.word(394) = context.bx; context.di = 5715; context._add(context.di, context.bx); context.al = context.ds.byte(context.di); - context.data.byte(142) = context.al; + context.data.byte(141) = context.al; return; nokey: - context.data.byte(142) = 0; + context.data.byte(141) = 0; return; } @@ -20122,36 +20122,36 @@ hangonloop: } static void loadtraveltext(Context & context) { - context.dx = 2247; + context.dx = 2234; standardload(context); - context.data.word(456) = context.ax; + context.data.word(454) = context.ax; return; } static void loadintotemp(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(458) = context.ax; + context.data.word(456) = context.ax; return; } static void loadintotemp2(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(460) = context.ax; + context.data.word(458) = context.ax; return; } static void loadintotemp3(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(462) = context.ax; + context.data.word(460) = context.ax; return; } static void loadtempcharset(Context & context) { standardload(context); - context.data.word(406) = context.ax; + context.data.word(404) = context.ax; return; } @@ -20175,21 +20175,21 @@ static void standardload(Context & context) { static void loadtemptext(Context & context) { standardload(context); - context.data.word(466) = context.ax; + context.data.word(464) = context.ax; return; } static void loadroom(Context & context) { - context.data.byte(74) = 1; - context.data.word(328) = 0; - context.data.word(138) = 0; - context.data.word(121) = 104; - context.data.word(123) = 38; - context.data.word(79) = 13; - context.data.word(81) = 182; - context.data.byte(82) = 240; - context.al = context.data.byte(188); - context.data.byte(9) = context.al; + context.data.byte(73) = 1; + context.data.word(326) = 0; + context.data.word(136) = 0; + context.data.word(119) = 104; + context.data.word(121) = 38; + context.data.word(77) = 13; + context.data.word(79) = 182; + context.data.byte(81) = 240; + context.al = context.data.byte(187); + context.data.byte(8) = context.al; getroomdata(context); startloading(context); loadroomssample(context); @@ -20200,16 +20200,16 @@ static void loadroom(Context & context) { } static void loadroomssample(Context & context) { - context.al = context.data.byte(531); + context.al = context.data.byte(530); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; - context._cmp(context.al, context.data.byte(530)); + context._cmp(context.al, context.data.byte(529)); if (context.flags.z()) goto loadedalready; - context.data.byte(530) = context.al; - context.al = context.data.byte(530); + context.data.byte(529) = context.al; + context.al = context.data.byte(529); context.cl = '0'; twodigitnum(context); - context.di = 1909; + context.di = 1896; context._xchg(context.al, context.ah); context.ds.word(context.di+10) = context.ax; context.dx = context.di; @@ -20219,50 +20219,50 @@ loadedalready: } static void getridofreels(Context & context) { - context._cmp(context.data.byte(74), 0); + context._cmp(context.data.byte(73), 0); if (context.flags.z()) goto dontgetrid; + context.es = context.data.word(428); + deallocatemem(context); context.es = context.data.word(430); deallocatemem(context); context.es = context.data.word(432); deallocatemem(context); - context.es = context.data.word(434); - deallocatemem(context); dontgetrid: return; } static void getridofall(Context & context) { - context.es = context.data.word(416); + context.es = context.data.word(414); deallocatemem(context); - context.es = context.data.word(444); + context.es = context.data.word(442); + deallocatemem(context); + context.es = context.data.word(428); deallocatemem(context); context.es = context.data.word(430); deallocatemem(context); context.es = context.data.word(432); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.data.word(448); deallocatemem(context); - context.es = context.data.word(450); + context.es = context.data.word(446); deallocatemem(context); - context.es = context.data.word(448); + context.es = context.data.word(438); deallocatemem(context); context.es = context.data.word(440); deallocatemem(context); - context.es = context.data.word(442); - deallocatemem(context); - context.es = context.data.word(436); + context.es = context.data.word(434); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.data.word(444); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.data.word(436); deallocatemem(context); return; } static void restorereels(Context & context) { - context._cmp(context.data.byte(74), 0); + context._cmp(context.data.byte(73), 0); if (context.flags.z()) goto dontrestore; - context.al = context.data.byte(184); + context.al = context.data.byte(183); getroomdata(context); context.dx = context.bx; openfile(context); @@ -20272,17 +20272,17 @@ static void restorereels(Context & context) { dontloadseg(context); dontloadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(428) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20292,17 +20292,17 @@ dontrestore: } static void restoreall(Context & context) { - context.al = context.data.byte(9); + context.al = context.data.byte(8); getroomdata(context); context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(416) = context.ax; + context.data.word(414) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(400); + context.ds = context.data.word(398); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20310,59 +20310,59 @@ static void restoreall(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(444) = context.ax; + context.data.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(428) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(450) = context.ax; + context.data.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.data.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.data.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(442) = context.ax; + context.data.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.data.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.data.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.data.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20374,9 +20374,9 @@ static void restoreall(Context & context) { static void sortoutmap(Context & context) { context.push(context.es); context.push(context.di); - context.ds = context.data.word(400); + context.ds = context.data.word(398); context.si = 0; - context.es = context.data.word(418); + context.es = context.data.word(416); context.di = 0; context.cx = 60; blimey: @@ -20394,43 +20394,43 @@ blimey: } static void startloading(Context & context) { - context.data.byte(64) = 0; + context.data.byte(63) = 0; context.al = context.ds.byte(context.bx+13); - context.data.byte(531) = context.al; + context.data.byte(530) = context.al; context.al = context.ds.byte(context.bx+15); - context.data.byte(148) = context.al; + context.data.byte(147) = context.al; context.al = context.ds.byte(context.bx+16); - context.data.byte(149) = context.al; + context.data.byte(148) = context.al; context.al = context.ds.byte(context.bx+20); - context.data.byte(35) = context.al; + context.data.byte(34) = context.al; context.al = context.ds.byte(context.bx+21); - context.data.byte(475) = context.al; - context.data.byte(478) = context.al; + context.data.byte(474) = context.al; context.data.byte(477) = context.al; + context.data.byte(476) = context.al; context.al = context.ds.byte(context.bx+22); - context.data.byte(133) = context.al; - context.data.byte(135) = context.al; + context.data.byte(132) = context.al; + context.data.byte(134) = context.al; context.al = context.ds.byte(context.bx+23); - context.data.byte(39) = context.al; + context.data.byte(38) = context.al; context.al = context.ds.byte(context.bx+24); - context.data.byte(36) = context.al; + context.data.byte(35) = context.al; context.al = context.ds.byte(context.bx+25); - context.data.byte(38) = context.al; - context.data.byte(65) = -1; + context.data.byte(37) = context.al; + context.data.byte(64) = -1; context.al = context.ds.byte(context.bx+27); context.push(context.ax); context.al = context.ds.byte(context.bx+31); - context.ah = context.data.byte(184); - context.data.byte(184) = context.al; + context.ah = context.data.byte(183); + context.data.byte(183) = context.al; context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(416) = context.ax; + context.data.word(414) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(400); + context.ds = context.data.word(398); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20438,69 +20438,69 @@ static void startloading(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(444) = context.ax; + context.data.word(442) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(428); + context.ds = context.data.word(426); context.dx = 0; context.cx = 64*128; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(428) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(430) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.data.word(432) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(450) = context.ax; + context.data.word(448) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.data.word(446) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.data.word(438) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(442) = context.ax; + context.data.word(440) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.data.word(434) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.data.word(444) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(426); + context.ds = context.data.word(424); context.dx = 0; context.cx = 16*80; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.data.word(436) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20509,17 +20509,17 @@ static void startloading(Context & context) { deletetaken(context); setallchanges(context); autoappear(context); - context.al = context.data.byte(188); + context.al = context.data.byte(187); getroomdata(context); - context.data.byte(65) = -1; - context.data.byte(56) = 0; - context.data.word(98) = 160; - context.data.byte(188) = 255; - context.data.byte(492) = 254; + context.data.byte(64) = -1; + context.data.byte(55) = 0; + context.data.word(96) = 160; + context.data.byte(187) = 255; + context.data.byte(491) = 254; context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) goto dontwalkin; - context.data.byte(475) = context.al; + context.data.byte(474) = context.al; context.push(context.bx); autosetwalk(context); context.bx = context.pop(); @@ -20546,7 +20546,7 @@ lookx2: context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(450); + context.es = context.data.word(448); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -20562,7 +20562,7 @@ lookx2: static void findxyfrompath(Context & context) { getroomspaths(context); - context.al = context.data.byte(475); + context.al = context.data.byte(474); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -20571,25 +20571,25 @@ static void findxyfrompath(Context & context) { context.ax = context.ds.word(context.bx); context._sub(context.al, 12); context._sub(context.ah, 12); - context.data.byte(151) = context.al; - context.data.byte(152) = context.ah; + context.data.byte(150) = context.al; + context.data.byte(151) = context.ah; return; } static void findroominloc(Context & context) { - context.al = context.data.byte(149); + context.al = context.data.byte(148); context.cx = -6; looky: context._add(context.cx, 6); context._sub(context.al, 10); if (!context.flags.c()) goto looky; - context.al = context.data.byte(148); + context.al = context.data.byte(147); context._sub(context.cx, 1); lookx: context._add(context.cx, 1); context._sub(context.al, 11); if (!context.flags.c()) goto lookx; - context.data.byte(185) = context.cl; + context.data.byte(184) = context.cl; return; } @@ -20597,18 +20597,18 @@ static void getroomdata(Context & context) { context.ah = 0; context.cx = 32; context._mul(context.cx); - context.bx = 5971; + context.bx = 5958; context._add(context.bx, context.ax); return; } static void readheader(Context & context) { context.ds = context.cs; - context.dx = 5881; - context.cx = 5958-5881; + context.dx = 5862; + context.cx = 5958-5862; readfromfile(context); context.es = context.cs; - context.di = 5952; + context.di = 5912; return; } @@ -20642,68 +20642,68 @@ static void fillspace(Context & context) { } static void getridoftemp(Context & context) { - context.es = context.data.word(458); + context.es = context.data.word(456); deallocatemem(context); return; } static void getridoftemptext(Context & context) { - context.es = context.data.word(466); + context.es = context.data.word(464); deallocatemem(context); return; } static void getridoftemp2(Context & context) { - context.es = context.data.word(460); + context.es = context.data.word(458); deallocatemem(context); return; } static void getridoftemp3(Context & context) { - context.es = context.data.word(462); + context.es = context.data.word(460); deallocatemem(context); return; } static void getridoftempcharset(Context & context) { - context.es = context.data.word(406); + context.es = context.data.word(404); deallocatemem(context); return; } static void getridoftempsp(Context & context) { - context.es = context.data.word(464); + context.es = context.data.word(462); deallocatemem(context); return; } static void readsetdata(Context & context) { - context.dx = 1870; + context.dx = 1857; standardload(context); - context.data.word(404) = context.ax; + context.data.word(402) = context.ax; + context.dx = 1922; + standardload(context); + context.data.word(406) = context.ax; context.dx = 1935; standardload(context); context.data.word(408) = context.ax; - context.dx = 1948; + context.dx = 1819; standardload(context); - context.data.word(410) = context.ax; - context.dx = 1832; - standardload(context); - context.data.word(414) = context.ax; - context.dx = 2234; - standardload(context); - context.data.word(454) = context.ax; - context.dx = 2286; + context.data.word(412) = context.ax; + context.dx = 2221; standardload(context); context.data.word(452) = context.ax; - context.ax = context.data.word(404); - context.data.word(268) = context.ax; - context._cmp(context.data.byte(378), 255); + context.dx = 2273; + standardload(context); + context.data.word(450) = context.ax; + context.ax = context.data.word(402); + context.data.word(266) = context.ax; + context._cmp(context.data.byte(377), 255); if (context.flags.z()) goto novolumeload; - context.dx = 2299; + context.dx = 2286; openfile(context); context.cx = 2048-256; - context.ds = context.data.word(353); + context.ds = context.data.word(351); context.dx = 16384; readfromfile(context); closefile(context); @@ -20725,8 +20725,8 @@ static void dreamweb(Context & context) { clearpalette(context); set16colpalette(context); readsetdata(context); - context.data.byte(391) = 0; - context.dx = 1922; + context.data.byte(390) = 0; + context.dx = 1909; loadsample(context); setsoundoff(context); scanfornames(context); @@ -20741,7 +20741,7 @@ dodecisions: cls(context); setmode(context); decide(context); - context._cmp(context.data.byte(103), 4); + context._cmp(context.data.byte(102), 4); if (context.flags.z()) goto mainloop; titles(context); credits(context); @@ -20749,22 +20749,22 @@ playgame: clearchanges(context); setmode(context); loadpalfromiff(context); - context.data.byte(9) = 255; - context.data.byte(67) = 1; - context.data.byte(188) = 35; - context.data.byte(386) = 7; + context.data.byte(8) = 255; + context.data.byte(66) = 1; + context.data.byte(187) = 35; + context.data.byte(385) = 7; loadroom(context); clearsprites(context); initman(context); entrytexts(context); entryanims(context); - context.data.byte(183) = 3; + context.data.byte(182) = 3; initialinv(context); - context.data.byte(153) = 32; + context.data.byte(152) = 32; startup1(context); - context.data.byte(387) = 0; - context.data.byte(388) = -1; - context.data.byte(100) = 255; + context.data.byte(386) = 0; + context.data.byte(387) = -1; + context.data.byte(99) = 255; goto mainloop; loadnew: clearbeforeload(context); @@ -20773,36 +20773,36 @@ loadnew: initman(context); entrytexts(context); entryanims(context); - context.data.byte(188) = 255; + context.data.byte(187) = 255; startup(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; worktoscreenm(context); goto mainloop; alreadyloaded: - context.data.byte(188) = 255; + context.data.byte(187) = 255; clearsprites(context); initman(context); startup(context); - context.data.byte(100) = 255; + context.data.byte(99) = 255; mainloop: screenupdate(context); - context._cmp(context.data.byte(391), 0); + context._cmp(context.data.byte(390), 0); if (!context.flags.z()) goto endofgame; - context._cmp(context.data.byte(56), 1); + context._cmp(context.data.byte(55), 1); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(56), 2); + context._cmp(context.data.byte(55), 2); if (context.flags.z()) goto gameover; - context._cmp(context.data.word(21), 0); + context._cmp(context.data.word(19), 0); if (context.flags.z()) goto notwatching; - context.al = context.data.byte(477); - context._cmp(context.al, context.data.byte(475)); + context.al = context.data.byte(476); + context._cmp(context.al, context.data.byte(474)); if (!context.flags.z()) goto mainloop; - context._sub(context.data.word(21), 1); + context._sub(context.data.word(19), 1); if (!context.flags.z()) goto mainloop; notwatching: - context._cmp(context.data.byte(56), 4); + context._cmp(context.data.byte(55), 4); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(188), 255); + context._cmp(context.data.byte(187), 255); if (!context.flags.z()) goto loadnew; goto mainloop; gameover: @@ -20900,14 +20900,14 @@ void __start(Context &context) { 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, - 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2f, 0x05, - 0x30, 0x05, 0x34, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x47, 0x05, 0x2f, 0x05, 0x4e, 0x05, - 0x5e, 0x05, 0x65, 0x05, 0x69, 0x05, 0x6d, 0x05, 0x71, 0x05, 0x7e, 0x05, 0x2f, 0x05, 0x2f, 0x05, - 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0xa0, 0x05, 0x2f, 0x05, 0xb6, 0x05, 0xd5, 0x05, 0x2f, 0x05, - 0xe2, 0x05, 0xf8, 0x05, 0x0e, 0x06, 0x27, 0x06, 0x3a, 0x06, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, - 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, - 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x4a, 0x06, 0x51, 0x06, 0x76, 0x06, 0x2f, 0x05, - 0x2f, 0x05, 0x2f, 0x05, 0x2f, 0x05, 0x83, 0x06, 0x87, 0x06, 0x2f, 0x05, 0x8e, 0x06, 0xff, 0x0f, + 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, + 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, + 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, + 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 3696c957e2..0380304be8 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -68,480 +68,480 @@ namespace dreamgen { void readoneblock(Context &context); void showpcx(Context &context); - const static uint16 kStartvars = 1; - const static uint16 kProgresspoints = 2; - const static uint16 kWatchon = 3; - const static uint16 kShadeson = 4; - const static uint16 kSecondcount = 5; - const static uint16 kMinutecount = 6; - const static uint16 kHourcount = 7; - const static uint16 kZoomon = 8; - const static uint16 kLocation = 9; - const static uint16 kExpos = 10; - const static uint16 kExframepos = 12; - const static uint16 kExtextpos = 14; - const static uint16 kCard1money = 16; - const static uint16 kListpos = 18; - const static uint16 kRyanpage = 19; - const static uint16 kWatchingtime = 21; - const static uint16 kReeltowatch = 23; - const static uint16 kEndwatchreel = 25; - const static uint16 kSpeedcount = 26; - const static uint16 kWatchspeed = 27; - const static uint16 kReeltohold = 29; - const static uint16 kEndofholdreel = 31; - const static uint16 kWatchmode = 32; - const static uint16 kDestafterhold = 33; - const static uint16 kNewsitem = 34; - const static uint16 kLiftflag = 35; - const static uint16 kLiftpath = 36; - const static uint16 kLockstatus = 37; - const static uint16 kDoorpath = 38; - const static uint16 kCounttoopen = 39; - const static uint16 kCounttoclose = 40; - const static uint16 kRockstardead = 41; - const static uint16 kGeneraldead = 42; - const static uint16 kSartaindead = 43; - const static uint16 kAidedead = 44; - const static uint16 kBeenmugged = 45; - const static uint16 kGunpassflag = 46; - const static uint16 kCanmovealtar = 47; - const static uint16 kTalkedtoattendant = 48; - const static uint16 kTalkedtosparky = 49; - const static uint16 kTalkedtoboss = 50; - const static uint16 kTalkedtorecep = 51; - const static uint16 kCardpassflag = 52; - const static uint16 kMadmanflag = 53; - const static uint16 kKeeperflag = 54; - const static uint16 kLasttrigger = 55; - const static uint16 kMandead = 56; - const static uint16 kSeed = 59; - const static uint16 kNeedtotravel = 60; - const static uint16 kThroughdoor = 61; - const static uint16 kNewobs = 62; - const static uint16 kRyanon = 63; - const static uint16 kCombatcount = 64; - const static uint16 kLastweapon = 65; - const static uint16 kDreamnumber = 66; - const static uint16 kRoomafterdream = 67; - const static uint16 kShakecounter = 68; - const static uint16 kSpeechcount = 69; - const static uint16 kCharshift = 71; - const static uint16 kKerning = 72; - const static uint16 kBrightness = 73; - const static uint16 kRoomloaded = 74; - const static uint16 kDidzoom = 75; - const static uint16 kLinespacing = 77; - const static uint16 kTextaddressx = 79; - const static uint16 kTextaddressy = 81; - const static uint16 kTextlen = 82; - const static uint16 kLastxpos = 84; - const static uint16 kIcontop = 86; - const static uint16 kIconleft = 88; - const static uint16 kItemframe = 89; - const static uint16 kItemtotran = 90; - const static uint16 kRoomad = 92; - const static uint16 kOldsubject = 94; - const static uint16 kWithobject = 95; - const static uint16 kWithtype = 96; - const static uint16 kLookcounter = 98; - const static uint16 kCommand = 99; - const static uint16 kCommandtype = 100; - const static uint16 kOldcommandtype = 101; - const static uint16 kObjecttype = 102; - const static uint16 kGetback = 103; - const static uint16 kInvopen = 104; - const static uint16 kMainmode = 105; - const static uint16 kPickup = 106; - const static uint16 kLastinvpos = 107; - const static uint16 kExamagain = 108; - const static uint16 kNewtextline = 109; - const static uint16 kOpenedob = 110; - const static uint16 kOpenedtype = 111; - const static uint16 kOldmapadx = 113; - const static uint16 kOldmapady = 115; - const static uint16 kMapadx = 117; - const static uint16 kMapady = 119; - const static uint16 kMapoffsetx = 121; - const static uint16 kMapoffsety = 123; - const static uint16 kMapxstart = 125; - const static uint16 kMapystart = 127; - const static uint16 kMapxsize = 128; - const static uint16 kMapysize = 129; - const static uint16 kHavedoneobs = 130; - const static uint16 kManisoffscreen = 131; - const static uint16 kRainspace = 132; - const static uint16 kFacing = 133; - const static uint16 kLeavedirection = 134; - const static uint16 kTurntoface = 135; - const static uint16 kTurndirection = 136; - const static uint16 kMaintimer = 138; - const static uint16 kIntrocount = 139; - const static uint16 kArrowad = 141; - const static uint16 kCurrentkey = 142; - const static uint16 kOldkey = 143; - const static uint16 kUseddirection = 144; - const static uint16 kCurrentkey2 = 145; - const static uint16 kTimercount = 146; - const static uint16 kOldtimercount = 147; - const static uint16 kMapx = 148; - const static uint16 kMapy = 149; - const static uint16 kNewscreen = 150; - const static uint16 kRyanx = 151; - const static uint16 kRyany = 152; - const static uint16 kLastflag = 153; - const static uint16 kLastflagex = 154; - const static uint16 kFlagx = 155; - const static uint16 kFlagy = 156; - const static uint16 kCurrentex = 157; - const static uint16 kCurrentfree = 158; - const static uint16 kCurrentframe = 160; - const static uint16 kFramesad = 162; - const static uint16 kDataad = 164; - const static uint16 kFrsegment = 166; - const static uint16 kObjectx = 168; - const static uint16 kObjecty = 170; - const static uint16 kOffsetx = 172; - const static uint16 kOffsety = 174; - const static uint16 kSavesize = 176; - const static uint16 kSavesource = 178; - const static uint16 kSavex = 179; - const static uint16 kSavey = 180; - const static uint16 kCurrentob = 181; - const static uint16 kPriority = 182; - const static uint16 kDestpos = 183; - const static uint16 kReallocation = 184; - const static uint16 kRoomnum = 185; - const static uint16 kNowinnewroom = 186; - const static uint16 kResetmanxy = 187; - const static uint16 kNewlocation = 188; - const static uint16 kAutolocation = 189; - const static uint16 kMustload = 190; - const static uint16 kAnswered = 191; - const static uint16 kSaidno = 192; - const static uint16 kDoorcheck1 = 193; - const static uint16 kDoorcheck2 = 194; - const static uint16 kDoorcheck3 = 195; - const static uint16 kDoorcheck4 = 196; - const static uint16 kMousex = 198; - const static uint16 kMousey = 200; - const static uint16 kMousebutton = 202; - const static uint16 kMousebutton1 = 204; - const static uint16 kMousebutton2 = 206; - const static uint16 kMousebutton3 = 208; - const static uint16 kMousebutton4 = 210; - const static uint16 kOldbutton = 212; - const static uint16 kOldx = 214; - const static uint16 kOldy = 216; - const static uint16 kLastbutton = 218; - const static uint16 kOldpointerx = 220; - const static uint16 kOldpointery = 222; - const static uint16 kDelherex = 224; - const static uint16 kDelherey = 226; - const static uint16 kPointerxs = 227; - const static uint16 kPointerys = 228; - const static uint16 kDelxs = 229; - const static uint16 kDelys = 230; - const static uint16 kPointerframe = 231; - const static uint16 kPointerpower = 232; - const static uint16 kAuxpointerframe = 233; - const static uint16 kPointermode = 234; - const static uint16 kPointerspeed = 235; - const static uint16 kPointercount = 236; - const static uint16 kInmaparea = 237; - const static uint16 kReelpointer = 239; - const static uint16 kSlotdata = 240; - const static uint16 kThisslot = 241; - const static uint16 kSlotflags = 242; - const static uint16 kTakeoff = 244; - const static uint16 kTalkmode = 245; - const static uint16 kTalkpos = 246; - const static uint16 kCharacter = 247; - const static uint16 kPersondata = 249; - const static uint16 kTalknum = 250; - const static uint16 kNumberinroom = 251; - const static uint16 kCurrentcel = 252; - const static uint16 kOldselection = 253; - const static uint16 kStopwalking = 254; - const static uint16 kMouseon = 255; - const static uint16 kPlayed = 257; - const static uint16 kTimer1 = 258; - const static uint16 kTimer2 = 259; - const static uint16 kTimer3 = 260; - const static uint16 kWholetimer = 262; - const static uint16 kTimer1to = 263; - const static uint16 kTimer2to = 264; - const static uint16 kTimer3to = 265; - const static uint16 kWatchdump = 266; - const static uint16 kCurrentset = 268; - const static uint16 kLogonum = 269; - const static uint16 kOldlogonum = 270; - const static uint16 kNewlogonum = 271; - const static uint16 kNetseg = 273; - const static uint16 kNetpoint = 275; - const static uint16 kKeynum = 276; - const static uint16 kCursorstate = 277; - const static uint16 kPressed = 278; - const static uint16 kPresspointer = 280; - const static uint16 kGraphicpress = 281; - const static uint16 kPresscount = 282; - const static uint16 kKeypadax = 284; - const static uint16 kKeypadcx = 286; - const static uint16 kLightcount = 287; - const static uint16 kFolderpage = 288; - const static uint16 kDiarypage = 289; - const static uint16 kMenucount = 290; - const static uint16 kSymboltopx = 291; - const static uint16 kSymboltopnum = 292; - const static uint16 kSymboltopdir = 293; - const static uint16 kSymbolbotx = 294; - const static uint16 kSymbolbotnum = 295; - const static uint16 kSymbolbotdir = 296; - const static uint16 kSymboltolight = 297; - const static uint16 kSymbol1 = 298; - const static uint16 kSymbol2 = 299; - const static uint16 kSymbol3 = 300; - const static uint16 kSymbolnum = 301; - const static uint16 kDumpx = 303; - const static uint16 kDumpy = 305; - const static uint16 kWalkandexam = 306; - const static uint16 kWalkexamtype = 307; - const static uint16 kWalkexamnum = 308; - const static uint16 kCursloc = 310; - const static uint16 kCurslocx = 312; - const static uint16 kCurslocy = 314; - const static uint16 kCurpos = 316; - const static uint16 kMonadx = 318; - const static uint16 kMonady = 320; - const static uint16 kGotfrom = 322; - const static uint16 kMonsource = 324; - const static uint16 kNumtodo = 326; - const static uint16 kTimecount = 328; - const static uint16 kCounttotimed = 330; - const static uint16 kTimedseg = 332; - const static uint16 kTimedoffset = 334; - const static uint16 kTimedy = 335; - const static uint16 kTimedx = 336; - const static uint16 kNeedtodumptimed = 337; - const static uint16 kHandle = 339; - const static uint16 kLoadingorsave = 340; - const static uint16 kCurrentslot = 341; - const static uint16 kCursorpos = 342; - const static uint16 kColourpos = 343; - const static uint16 kFadedirection = 344; - const static uint16 kNumtofade = 345; - const static uint16 kFadecount = 346; - const static uint16 kAddtogreen = 347; - const static uint16 kAddtored = 348; - const static uint16 kAddtoblue = 349; - const static uint16 kLastsoundreel = 351; - const static uint16 kSoundbuffer = 353; - const static uint16 kSoundbufferad = 355; - const static uint16 kSoundbufferpage = 356; - const static uint16 kSoundtimes = 357; - const static uint16 kNeedsoundbuff = 358; - const static uint16 kOldint9seg = 360; - const static uint16 kOldint9add = 362; - const static uint16 kOldint8seg = 364; - const static uint16 kOldint8add = 366; - const static uint16 kOldsoundintseg = 368; - const static uint16 kOldsoundintadd = 370; - const static uint16 kSoundbaseadd = 372; - const static uint16 kDsp_status = 374; - const static uint16 kDsp_write = 376; - const static uint16 kDmaaddress = 377; - const static uint16 kSoundint = 378; - const static uint16 kSounddmachannel = 379; - const static uint16 kSampleplaying = 380; - const static uint16 kTestresult = 381; - const static uint16 kCurrentirq = 382; - const static uint16 kSpeechloaded = 383; - const static uint16 kSpeechlength = 385; - const static uint16 kVolume = 386; - const static uint16 kVolumeto = 387; - const static uint16 kVolumedirection = 388; - const static uint16 kVolumecount = 389; - const static uint16 kPlayblock = 390; - const static uint16 kWongame = 391; - const static uint16 kLasthardkey = 392; - const static uint16 kBufferin = 394; - const static uint16 kBufferout = 396; - const static uint16 kExtras = 398; - const static uint16 kWorkspace = 400; - const static uint16 kMapstore = 402; - const static uint16 kCharset1 = 404; - const static uint16 kTempcharset = 406; - const static uint16 kIcons1 = 408; - const static uint16 kIcons2 = 410; - const static uint16 kBuffers = 412; - const static uint16 kMainsprites = 414; - const static uint16 kBackdrop = 416; - const static uint16 kMapdata = 418; - const static uint16 kSounddata = 420; - const static uint16 kSounddata2 = 422; - const static uint16 kRecordspace = 424; - const static uint16 kFreedat = 426; - const static uint16 kSetdat = 428; - const static uint16 kReel1 = 430; - const static uint16 kReel2 = 432; - const static uint16 kReel3 = 434; - const static uint16 kRoomdesc = 436; - const static uint16 kFreedesc = 438; - const static uint16 kSetdesc = 440; - const static uint16 kBlockdesc = 442; - const static uint16 kSetframes = 444; - const static uint16 kFreeframes = 446; - const static uint16 kPeople = 448; - const static uint16 kReels = 450; - const static uint16 kCommandtext = 452; - const static uint16 kPuzzletext = 454; - const static uint16 kTraveltext = 456; - const static uint16 kTempgraphics = 458; - const static uint16 kTempgraphics2 = 460; - const static uint16 kTempgraphics3 = 462; - const static uint16 kTempsprites = 464; - const static uint16 kTextfile1 = 466; - const static uint16 kTextfile2 = 468; - const static uint16 kTextfile3 = 470; - const static uint16 kBlinkframe = 471; - const static uint16 kBlinkcount = 472; - const static uint16 kReasseschanges = 473; - const static uint16 kPointerspath = 474; - const static uint16 kManspath = 475; - const static uint16 kPointerfirstpath = 476; - const static uint16 kFinaldest = 477; - const static uint16 kDestination = 478; - const static uint16 kLinestartx = 480; - const static uint16 kLinestarty = 482; - const static uint16 kLineendx = 484; - const static uint16 kLineendy = 486; - const static uint16 kIncrement1 = 488; - const static uint16 kIncrement2 = 490; - const static uint16 kLineroutine = 491; - const static uint16 kLinepointer = 492; - const static uint16 kLinedirection = 493; - const static uint16 kLinelength = 494; - const static uint16 kLiftsoundcount = 495; - const static uint16 kEmmhandle = 497; - const static uint16 kEmmpageframe = 499; - const static uint16 kEmmhardwarepage = 500; - const static uint16 kCh0emmpage = 502; - const static uint16 kCh0offset = 504; - const static uint16 kCh0blockstocopy = 506; - const static uint16 kCh0playing = 507; - const static uint16 kCh0repeat = 508; - const static uint16 kCh0oldemmpage = 510; - const static uint16 kCh0oldoffset = 512; - const static uint16 kCh0oldblockstocopy = 514; - const static uint16 kCh1playing = 515; - const static uint16 kCh1emmpage = 517; - const static uint16 kCh1offset = 519; - const static uint16 kCh1blockstocopy = 521; - const static uint16 kCh1blocksplayed = 523; - const static uint16 kSoundbufferwrite = 525; - const static uint16 kSoundemmpage = 527; - const static uint16 kSpeechemmpage = 529; - const static uint16 kCurrentsample = 530; - const static uint16 kRoomssample = 531; - const static uint16 kGameerror = 532; - const static uint16 kHowmuchalloc = 534; - const static uint16 kReelroutines = 537; - const static uint16 kReelcalls = 1003; - const static uint16 kRoombyroom = 1254; - const static uint16 kR0 = 1327; - const static uint16 kR1 = 1328; - const static uint16 kR2 = 1332; - const static uint16 kR6 = 1351; - const static uint16 kR8 = 1358; - const static uint16 kR9 = 1374; - const static uint16 kR10 = 1381; - const static uint16 kR11 = 1385; - const static uint16 kR12 = 1389; - const static uint16 kR13 = 1393; - const static uint16 kR14 = 1406; - const static uint16 kR20 = 1440; - const static uint16 kR22 = 1462; - const static uint16 kR23 = 1493; - const static uint16 kR25 = 1506; - const static uint16 kR26 = 1528; - const static uint16 kR27 = 1550; - const static uint16 kR28 = 1575; - const static uint16 kR29 = 1594; - const static uint16 kR45 = 1610; - const static uint16 kR46 = 1617; - const static uint16 kR47 = 1654; - const static uint16 kR52 = 1667; - const static uint16 kR53 = 1671; - const static uint16 kR55 = 1678; - const static uint16 kSpritename1 = 1832; - const static uint16 kSpritename3 = 1845; - const static uint16 kIdname = 1857; - const static uint16 kCharacterset1 = 1870; - const static uint16 kCharacterset2 = 1883; - const static uint16 kCharacterset3 = 1896; - const static uint16 kSamplename = 1909; - const static uint16 kBasicsample = 1922; - const static uint16 kIcongraphics0 = 1935; - const static uint16 kIcongraphics1 = 1948; - const static uint16 kExtragraphics1 = 1961; - const static uint16 kIcongraphics8 = 1974; - const static uint16 kMongraphicname = 1987; - const static uint16 kMongraphics2 = 2000; - const static uint16 kCityname = 2013; - const static uint16 kTravelgraphic1 = 2026; - const static uint16 kTravelgraphic2 = 2039; - const static uint16 kDiarygraphic = 2052; - const static uint16 kMonitorfile1 = 2065; - const static uint16 kMonitorfile2 = 2078; - const static uint16 kMonitorfile10 = 2091; - const static uint16 kMonitorfile11 = 2104; - const static uint16 kMonitorfile12 = 2117; - const static uint16 kMonitorfile13 = 2130; - const static uint16 kMonitorfile20 = 2143; - const static uint16 kMonitorfile21 = 2156; - const static uint16 kMonitorfile22 = 2169; - const static uint16 kMonitorfile23 = 2182; - const static uint16 kMonitorfile24 = 2195; - const static uint16 kFoldertext = 2208; - const static uint16 kDiarytext = 2221; - const static uint16 kPuzzletextname = 2234; - const static uint16 kTraveltextname = 2247; - const static uint16 kIntrotextname = 2260; - const static uint16 kEndtextname = 2273; - const static uint16 kCommandtextname = 2286; - const static uint16 kVolumetabname = 2299; - const static uint16 kFoldergraphic1 = 2312; - const static uint16 kFoldergraphic2 = 2325; - const static uint16 kFoldergraphic3 = 2338; - const static uint16 kSymbolgraphic = 2351; - const static uint16 kGungraphic = 2364; - const static uint16 kMonkface = 2377; - const static uint16 kTitle0graphics = 2390; - const static uint16 kTitle1graphics = 2403; - const static uint16 kTitle2graphics = 2416; - const static uint16 kTitle3graphics = 2429; - const static uint16 kTitle4graphics = 2442; - const static uint16 kTitle5graphics = 2455; - const static uint16 kTitle6graphics = 2468; - const static uint16 kTitle7graphics = 2481; - const static uint16 kPalettescreen = 2494; - const static uint16 kCurrentfile = 2895; - const static uint16 kDmaaddresses = 4949; - const static uint16 kFileheader = 5881; - const static uint16 kFiledata = 5952; - const static uint16 kExtradata = 5958; - const static uint16 kRoomdata = 5971; - const static uint16 kMadeuproomdat = 7782; - const static uint16 kRoomscango = 7798; - const static uint16 kRoompics = 7813; - const static uint16 kOplist = 7816; - const static uint16 kInputline = 7944; - const static uint16 kLinedata = 8344; - const static uint16 kPresslist = 8350; - const static uint16 kSavenames = 8367; - const static uint16 kSavefiles = 8482; - const static uint16 kRecname = 8573; - const static uint16 kStak = 8829; + const static uint16 kStartvars = 0; + const static uint16 kProgresspoints = 1; + const static uint16 kWatchon = 2; + const static uint16 kShadeson = 3; + const static uint16 kSecondcount = 4; + const static uint16 kMinutecount = 5; + const static uint16 kHourcount = 6; + const static uint16 kZoomon = 7; + const static uint16 kLocation = 8; + const static uint16 kExpos = 9; + const static uint16 kExframepos = 10; + const static uint16 kExtextpos = 12; + const static uint16 kCard1money = 14; + const static uint16 kListpos = 16; + const static uint16 kRyanpage = 18; + const static uint16 kWatchingtime = 19; + const static uint16 kReeltowatch = 21; + const static uint16 kEndwatchreel = 23; + const static uint16 kSpeedcount = 25; + const static uint16 kWatchspeed = 26; + const static uint16 kReeltohold = 27; + const static uint16 kEndofholdreel = 29; + const static uint16 kWatchmode = 31; + const static uint16 kDestafterhold = 32; + const static uint16 kNewsitem = 33; + const static uint16 kLiftflag = 34; + const static uint16 kLiftpath = 35; + const static uint16 kLockstatus = 36; + const static uint16 kDoorpath = 37; + const static uint16 kCounttoopen = 38; + const static uint16 kCounttoclose = 39; + const static uint16 kRockstardead = 40; + const static uint16 kGeneraldead = 41; + const static uint16 kSartaindead = 42; + const static uint16 kAidedead = 43; + const static uint16 kBeenmugged = 44; + const static uint16 kGunpassflag = 45; + const static uint16 kCanmovealtar = 46; + const static uint16 kTalkedtoattendant = 47; + const static uint16 kTalkedtosparky = 48; + const static uint16 kTalkedtoboss = 49; + const static uint16 kTalkedtorecep = 50; + const static uint16 kCardpassflag = 51; + const static uint16 kMadmanflag = 52; + const static uint16 kKeeperflag = 53; + const static uint16 kLasttrigger = 54; + const static uint16 kMandead = 55; + const static uint16 kSeed = 56; + const static uint16 kNeedtotravel = 59; + const static uint16 kThroughdoor = 60; + const static uint16 kNewobs = 61; + const static uint16 kRyanon = 62; + const static uint16 kCombatcount = 63; + const static uint16 kLastweapon = 64; + const static uint16 kDreamnumber = 65; + const static uint16 kRoomafterdream = 66; + const static uint16 kShakecounter = 67; + const static uint16 kSpeechcount = 68; + const static uint16 kCharshift = 69; + const static uint16 kKerning = 71; + const static uint16 kBrightness = 72; + const static uint16 kRoomloaded = 73; + const static uint16 kDidzoom = 74; + const static uint16 kLinespacing = 75; + const static uint16 kTextaddressx = 77; + const static uint16 kTextaddressy = 79; + const static uint16 kTextlen = 81; + const static uint16 kLastxpos = 82; + const static uint16 kIcontop = 84; + const static uint16 kIconleft = 86; + const static uint16 kItemframe = 88; + const static uint16 kItemtotran = 89; + const static uint16 kRoomad = 90; + const static uint16 kOldsubject = 92; + const static uint16 kWithobject = 94; + const static uint16 kWithtype = 95; + const static uint16 kLookcounter = 96; + const static uint16 kCommand = 98; + const static uint16 kCommandtype = 99; + const static uint16 kOldcommandtype = 100; + const static uint16 kObjecttype = 101; + const static uint16 kGetback = 102; + const static uint16 kInvopen = 103; + const static uint16 kMainmode = 104; + const static uint16 kPickup = 105; + const static uint16 kLastinvpos = 106; + const static uint16 kExamagain = 107; + const static uint16 kNewtextline = 108; + const static uint16 kOpenedob = 109; + const static uint16 kOpenedtype = 110; + const static uint16 kOldmapadx = 111; + const static uint16 kOldmapady = 113; + const static uint16 kMapadx = 115; + const static uint16 kMapady = 117; + const static uint16 kMapoffsetx = 119; + const static uint16 kMapoffsety = 121; + const static uint16 kMapxstart = 123; + const static uint16 kMapystart = 125; + const static uint16 kMapxsize = 127; + const static uint16 kMapysize = 128; + const static uint16 kHavedoneobs = 129; + const static uint16 kManisoffscreen = 130; + const static uint16 kRainspace = 131; + const static uint16 kFacing = 132; + const static uint16 kLeavedirection = 133; + const static uint16 kTurntoface = 134; + const static uint16 kTurndirection = 135; + const static uint16 kMaintimer = 136; + const static uint16 kIntrocount = 138; + const static uint16 kArrowad = 139; + const static uint16 kCurrentkey = 141; + const static uint16 kOldkey = 142; + const static uint16 kUseddirection = 143; + const static uint16 kCurrentkey2 = 144; + const static uint16 kTimercount = 145; + const static uint16 kOldtimercount = 146; + const static uint16 kMapx = 147; + const static uint16 kMapy = 148; + const static uint16 kNewscreen = 149; + const static uint16 kRyanx = 150; + const static uint16 kRyany = 151; + const static uint16 kLastflag = 152; + const static uint16 kLastflagex = 153; + const static uint16 kFlagx = 154; + const static uint16 kFlagy = 155; + const static uint16 kCurrentex = 156; + const static uint16 kCurrentfree = 157; + const static uint16 kCurrentframe = 158; + const static uint16 kFramesad = 160; + const static uint16 kDataad = 162; + const static uint16 kFrsegment = 164; + const static uint16 kObjectx = 166; + const static uint16 kObjecty = 168; + const static uint16 kOffsetx = 170; + const static uint16 kOffsety = 172; + const static uint16 kSavesize = 174; + const static uint16 kSavesource = 176; + const static uint16 kSavex = 178; + const static uint16 kSavey = 179; + const static uint16 kCurrentob = 180; + const static uint16 kPriority = 181; + const static uint16 kDestpos = 182; + const static uint16 kReallocation = 183; + const static uint16 kRoomnum = 184; + const static uint16 kNowinnewroom = 185; + const static uint16 kResetmanxy = 186; + const static uint16 kNewlocation = 187; + const static uint16 kAutolocation = 188; + const static uint16 kMustload = 189; + const static uint16 kAnswered = 190; + const static uint16 kSaidno = 191; + const static uint16 kDoorcheck1 = 192; + const static uint16 kDoorcheck2 = 193; + const static uint16 kDoorcheck3 = 194; + const static uint16 kDoorcheck4 = 195; + const static uint16 kMousex = 196; + const static uint16 kMousey = 198; + const static uint16 kMousebutton = 200; + const static uint16 kMousebutton1 = 202; + const static uint16 kMousebutton2 = 204; + const static uint16 kMousebutton3 = 206; + const static uint16 kMousebutton4 = 208; + const static uint16 kOldbutton = 210; + const static uint16 kOldx = 212; + const static uint16 kOldy = 214; + const static uint16 kLastbutton = 216; + const static uint16 kOldpointerx = 218; + const static uint16 kOldpointery = 220; + const static uint16 kDelherex = 222; + const static uint16 kDelherey = 224; + const static uint16 kPointerxs = 226; + const static uint16 kPointerys = 227; + const static uint16 kDelxs = 228; + const static uint16 kDelys = 229; + const static uint16 kPointerframe = 230; + const static uint16 kPointerpower = 231; + const static uint16 kAuxpointerframe = 232; + const static uint16 kPointermode = 233; + const static uint16 kPointerspeed = 234; + const static uint16 kPointercount = 235; + const static uint16 kInmaparea = 236; + const static uint16 kReelpointer = 237; + const static uint16 kSlotdata = 239; + const static uint16 kThisslot = 240; + const static uint16 kSlotflags = 241; + const static uint16 kTakeoff = 242; + const static uint16 kTalkmode = 244; + const static uint16 kTalkpos = 245; + const static uint16 kCharacter = 246; + const static uint16 kPersondata = 247; + const static uint16 kTalknum = 249; + const static uint16 kNumberinroom = 250; + const static uint16 kCurrentcel = 251; + const static uint16 kOldselection = 252; + const static uint16 kStopwalking = 253; + const static uint16 kMouseon = 254; + const static uint16 kPlayed = 255; + const static uint16 kTimer1 = 257; + const static uint16 kTimer2 = 258; + const static uint16 kTimer3 = 259; + const static uint16 kWholetimer = 260; + const static uint16 kTimer1to = 262; + const static uint16 kTimer2to = 263; + const static uint16 kTimer3to = 264; + const static uint16 kWatchdump = 265; + const static uint16 kCurrentset = 266; + const static uint16 kLogonum = 268; + const static uint16 kOldlogonum = 269; + const static uint16 kNewlogonum = 270; + const static uint16 kNetseg = 271; + const static uint16 kNetpoint = 273; + const static uint16 kKeynum = 275; + const static uint16 kCursorstate = 276; + const static uint16 kPressed = 277; + const static uint16 kPresspointer = 278; + const static uint16 kGraphicpress = 280; + const static uint16 kPresscount = 281; + const static uint16 kKeypadax = 282; + const static uint16 kKeypadcx = 284; + const static uint16 kLightcount = 286; + const static uint16 kFolderpage = 287; + const static uint16 kDiarypage = 288; + const static uint16 kMenucount = 289; + const static uint16 kSymboltopx = 290; + const static uint16 kSymboltopnum = 291; + const static uint16 kSymboltopdir = 292; + const static uint16 kSymbolbotx = 293; + const static uint16 kSymbolbotnum = 294; + const static uint16 kSymbolbotdir = 295; + const static uint16 kSymboltolight = 296; + const static uint16 kSymbol1 = 297; + const static uint16 kSymbol2 = 298; + const static uint16 kSymbol3 = 299; + const static uint16 kSymbolnum = 300; + const static uint16 kDumpx = 301; + const static uint16 kDumpy = 303; + const static uint16 kWalkandexam = 305; + const static uint16 kWalkexamtype = 306; + const static uint16 kWalkexamnum = 307; + const static uint16 kCursloc = 308; + const static uint16 kCurslocx = 310; + const static uint16 kCurslocy = 312; + const static uint16 kCurpos = 314; + const static uint16 kMonadx = 316; + const static uint16 kMonady = 318; + const static uint16 kGotfrom = 320; + const static uint16 kMonsource = 322; + const static uint16 kNumtodo = 324; + const static uint16 kTimecount = 326; + const static uint16 kCounttotimed = 328; + const static uint16 kTimedseg = 330; + const static uint16 kTimedoffset = 332; + const static uint16 kTimedy = 334; + const static uint16 kTimedx = 335; + const static uint16 kNeedtodumptimed = 336; + const static uint16 kHandle = 337; + const static uint16 kLoadingorsave = 339; + const static uint16 kCurrentslot = 340; + const static uint16 kCursorpos = 341; + const static uint16 kColourpos = 342; + const static uint16 kFadedirection = 343; + const static uint16 kNumtofade = 344; + const static uint16 kFadecount = 345; + const static uint16 kAddtogreen = 346; + const static uint16 kAddtored = 347; + const static uint16 kAddtoblue = 348; + const static uint16 kLastsoundreel = 349; + const static uint16 kSoundbuffer = 351; + const static uint16 kSoundbufferad = 353; + const static uint16 kSoundbufferpage = 355; + const static uint16 kSoundtimes = 356; + const static uint16 kNeedsoundbuff = 357; + const static uint16 kOldint9seg = 358; + const static uint16 kOldint9add = 360; + const static uint16 kOldint8seg = 362; + const static uint16 kOldint8add = 364; + const static uint16 kOldsoundintseg = 366; + const static uint16 kOldsoundintadd = 368; + const static uint16 kSoundbaseadd = 370; + const static uint16 kDsp_status = 372; + const static uint16 kDsp_write = 374; + const static uint16 kDmaaddress = 376; + const static uint16 kSoundint = 377; + const static uint16 kSounddmachannel = 378; + const static uint16 kSampleplaying = 379; + const static uint16 kTestresult = 380; + const static uint16 kCurrentirq = 381; + const static uint16 kSpeechloaded = 382; + const static uint16 kSpeechlength = 383; + const static uint16 kVolume = 385; + const static uint16 kVolumeto = 386; + const static uint16 kVolumedirection = 387; + const static uint16 kVolumecount = 388; + const static uint16 kPlayblock = 389; + const static uint16 kWongame = 390; + const static uint16 kLasthardkey = 391; + const static uint16 kBufferin = 392; + const static uint16 kBufferout = 394; + const static uint16 kExtras = 396; + const static uint16 kWorkspace = 398; + const static uint16 kMapstore = 400; + const static uint16 kCharset1 = 402; + const static uint16 kTempcharset = 404; + const static uint16 kIcons1 = 406; + const static uint16 kIcons2 = 408; + const static uint16 kBuffers = 410; + const static uint16 kMainsprites = 412; + const static uint16 kBackdrop = 414; + const static uint16 kMapdata = 416; + const static uint16 kSounddata = 418; + const static uint16 kSounddata2 = 420; + const static uint16 kRecordspace = 422; + const static uint16 kFreedat = 424; + const static uint16 kSetdat = 426; + const static uint16 kReel1 = 428; + const static uint16 kReel2 = 430; + const static uint16 kReel3 = 432; + const static uint16 kRoomdesc = 434; + const static uint16 kFreedesc = 436; + const static uint16 kSetdesc = 438; + const static uint16 kBlockdesc = 440; + const static uint16 kSetframes = 442; + const static uint16 kFreeframes = 444; + const static uint16 kPeople = 446; + const static uint16 kReels = 448; + const static uint16 kCommandtext = 450; + const static uint16 kPuzzletext = 452; + const static uint16 kTraveltext = 454; + const static uint16 kTempgraphics = 456; + const static uint16 kTempgraphics2 = 458; + const static uint16 kTempgraphics3 = 460; + const static uint16 kTempsprites = 462; + const static uint16 kTextfile1 = 464; + const static uint16 kTextfile2 = 466; + const static uint16 kTextfile3 = 468; + const static uint16 kBlinkframe = 470; + const static uint16 kBlinkcount = 471; + const static uint16 kReasseschanges = 472; + const static uint16 kPointerspath = 473; + const static uint16 kManspath = 474; + const static uint16 kPointerfirstpath = 475; + const static uint16 kFinaldest = 476; + const static uint16 kDestination = 477; + const static uint16 kLinestartx = 478; + const static uint16 kLinestarty = 480; + const static uint16 kLineendx = 482; + const static uint16 kLineendy = 484; + const static uint16 kIncrement1 = 486; + const static uint16 kIncrement2 = 488; + const static uint16 kLineroutine = 490; + const static uint16 kLinepointer = 491; + const static uint16 kLinedirection = 492; + const static uint16 kLinelength = 493; + const static uint16 kLiftsoundcount = 494; + const static uint16 kEmmhandle = 495; + const static uint16 kEmmpageframe = 497; + const static uint16 kEmmhardwarepage = 499; + const static uint16 kCh0emmpage = 500; + const static uint16 kCh0offset = 502; + const static uint16 kCh0blockstocopy = 504; + const static uint16 kCh0playing = 506; + const static uint16 kCh0repeat = 507; + const static uint16 kCh0oldemmpage = 508; + const static uint16 kCh0oldoffset = 510; + const static uint16 kCh0oldblockstocopy = 512; + const static uint16 kCh1playing = 514; + const static uint16 kCh1emmpage = 515; + const static uint16 kCh1offset = 517; + const static uint16 kCh1blockstocopy = 519; + const static uint16 kCh1blocksplayed = 521; + const static uint16 kSoundbufferwrite = 523; + const static uint16 kSoundemmpage = 525; + const static uint16 kSpeechemmpage = 527; + const static uint16 kCurrentsample = 529; + const static uint16 kRoomssample = 530; + const static uint16 kGameerror = 531; + const static uint16 kHowmuchalloc = 532; + const static uint16 kReelroutines = 534; + const static uint16 kReelcalls = 991; + const static uint16 kRoombyroom = 1214; + const static uint16 kR0 = 1326; + const static uint16 kR1 = 1327; + const static uint16 kR2 = 1331; + const static uint16 kR6 = 1350; + const static uint16 kR8 = 1357; + const static uint16 kR9 = 1373; + const static uint16 kR10 = 1380; + const static uint16 kR11 = 1384; + const static uint16 kR12 = 1388; + const static uint16 kR13 = 1392; + const static uint16 kR14 = 1405; + const static uint16 kR20 = 1439; + const static uint16 kR22 = 1461; + const static uint16 kR23 = 1492; + const static uint16 kR25 = 1505; + const static uint16 kR26 = 1527; + const static uint16 kR27 = 1549; + const static uint16 kR28 = 1574; + const static uint16 kR29 = 1593; + const static uint16 kR45 = 1609; + const static uint16 kR46 = 1616; + const static uint16 kR47 = 1653; + const static uint16 kR52 = 1666; + const static uint16 kR53 = 1670; + const static uint16 kR55 = 1677; + const static uint16 kSpritename1 = 1819; + const static uint16 kSpritename3 = 1832; + const static uint16 kIdname = 1845; + const static uint16 kCharacterset1 = 1857; + const static uint16 kCharacterset2 = 1870; + const static uint16 kCharacterset3 = 1883; + const static uint16 kSamplename = 1896; + const static uint16 kBasicsample = 1909; + const static uint16 kIcongraphics0 = 1922; + const static uint16 kIcongraphics1 = 1935; + const static uint16 kExtragraphics1 = 1948; + const static uint16 kIcongraphics8 = 1961; + const static uint16 kMongraphicname = 1974; + const static uint16 kMongraphics2 = 1987; + const static uint16 kCityname = 2000; + const static uint16 kTravelgraphic1 = 2013; + const static uint16 kTravelgraphic2 = 2026; + const static uint16 kDiarygraphic = 2039; + const static uint16 kMonitorfile1 = 2052; + const static uint16 kMonitorfile2 = 2065; + const static uint16 kMonitorfile10 = 2078; + const static uint16 kMonitorfile11 = 2091; + const static uint16 kMonitorfile12 = 2104; + const static uint16 kMonitorfile13 = 2117; + const static uint16 kMonitorfile20 = 2130; + const static uint16 kMonitorfile21 = 2143; + const static uint16 kMonitorfile22 = 2156; + const static uint16 kMonitorfile23 = 2169; + const static uint16 kMonitorfile24 = 2182; + const static uint16 kFoldertext = 2195; + const static uint16 kDiarytext = 2208; + const static uint16 kPuzzletextname = 2221; + const static uint16 kTraveltextname = 2234; + const static uint16 kIntrotextname = 2247; + const static uint16 kEndtextname = 2260; + const static uint16 kCommandtextname = 2273; + const static uint16 kVolumetabname = 2286; + const static uint16 kFoldergraphic1 = 2299; + const static uint16 kFoldergraphic2 = 2312; + const static uint16 kFoldergraphic3 = 2325; + const static uint16 kSymbolgraphic = 2338; + const static uint16 kGungraphic = 2351; + const static uint16 kMonkface = 2364; + const static uint16 kTitle0graphics = 2377; + const static uint16 kTitle1graphics = 2390; + const static uint16 kTitle2graphics = 2403; + const static uint16 kTitle3graphics = 2416; + const static uint16 kTitle4graphics = 2429; + const static uint16 kTitle5graphics = 2442; + const static uint16 kTitle6graphics = 2455; + const static uint16 kTitle7graphics = 2468; + const static uint16 kPalettescreen = 2481; + const static uint16 kCurrentfile = 2892; + const static uint16 kDmaaddresses = 4945; + const static uint16 kFileheader = 5862; + const static uint16 kFiledata = 5912; + const static uint16 kExtradata = 5952; + const static uint16 kRoomdata = 5958; + const static uint16 kMadeuproomdat = 7750; + const static uint16 kRoomscango = 7782; + const static uint16 kRoompics = 7798; + const static uint16 kOplist = 7813; + const static uint16 kInputline = 7816; + const static uint16 kLinedata = 7944; + const static uint16 kPresslist = 8344; + const static uint16 kSavenames = 8350; + const static uint16 kSavefiles = 8469; + const static uint16 kRecname = 8560; + const static uint16 kStak = 8573; } diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index f68818f572..a83c700775 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -137,8 +137,9 @@ void DreamWebEngine::openFile(const Common::String &name) { if (_file.isOpen()) { _file.close(); } - if (!_file.open(name)) + if (!_file.open(name)) { error("cannot open file %s", name.c_str()); + } } void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { @@ -418,7 +419,7 @@ void vsync(Context &context) { } void setmode(Context &context) { - ::error("setmode"); + warning("setmode (vga): STUB"); } void readoneblock(Context &context) { -- cgit v1.2.3 From 5d6be069e9a4bf62b217778b9e54b089e42a28b6 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:49:05 +0400 Subject: DREAMWEB: restored open file check in read --- engines/dreamweb/dreamweb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index a83c700775..0225a1b772 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -143,8 +143,8 @@ void DreamWebEngine::openFile(const Common::String &name) { } void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { - //if (!_file.isOpen()) - // error("file was not opened"); + if (!_file.isOpen()) + error("file was not opened (read before open)"); _file.read(dst, size); } @@ -204,6 +204,7 @@ void readfromfile(Context &context) { void closefile(Context &context) { engine()->closeFile(); + context.data.byte(kHandle) = 0; } void openforsave(Context &context) { -- cgit v1.2.3 From 6a2ac8728c26b70ecd810999a8dab983b8a12bc7 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:53:35 +0400 Subject: DREAMWEB: fixed invalid file read length --- engines/dreamweb/dreamweb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0225a1b772..8e1b04bfa1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -196,8 +196,8 @@ void setkeyboardint(Context &context) { void readfromfile(Context &context) { uint16 dst_offset = context.dx; - uint16 size = context.bx; - debug(1, "readfromfile(ds:%u, %u)", dst_offset, size); + uint16 size = context.cx; + debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); engine()->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; //fixme: add return args } -- cgit v1.2.3 From 221a3575a35c7848937f575179b4ccdc4ae86ddb Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 02:57:56 +0400 Subject: DREAMWEB: added mousecall stub --- engines/dreamweb/dreamweb.cpp | 12 +++++++++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8e1b04bfa1..f2ee6a6268 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -236,7 +236,17 @@ void dontloadseg(Context &context) { } void mousecall(Context &context) { - ::error("mousecall"); + Common::Point pos = engine()->mousePos(); + if (pos.x > 298) + pos.x = 298; + if (pos.x < 15) + pos.x = 15; + if (pos.y < 15) + pos.y = 15; + if (pos.y > 184) + pos.y = 184; + context.cx = pos.x; + context.dx = pos.y; } void setmouse(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 03db193b23..245f4967bb 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -81,6 +81,7 @@ public: void readFromFile(uint8 *dst, unsigned size); void closeFile(); + Common::Point mousePos() const { return _mouse; } private: const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; -- cgit v1.2.3 From 2fa141335de2576e49dbb4c8d4cdadffacd68c71 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 03:03:05 +0400 Subject: DREAMWEB: fixed release warnings --- engines/dreamweb/runtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 4a928ea5e2..af484fe19c 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -245,13 +245,13 @@ public: } inline void _add(uint8 &dst, uint8 src) { - flags._c = dst + src < dst; + flags._c = (unsigned(dst) + src) >= 0x100; dst += src; flags.update(dst); } inline void _add(uint16 &dst, uint16 src) { - flags._c = dst + src < dst; + flags._c = (unsigned(dst) + src) >= 0x10000; dst += src; flags.update(dst); } -- cgit v1.2.3 From 3595e9b675b4f18570c589bd759a20ca28d469b8 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 03:12:14 +0400 Subject: DREAMWEB: added shr/shl instructions --- engines/dreamweb/dreamweb.cpp | 4 ++-- engines/dreamweb/runtime.h | 46 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index f2ee6a6268..feec93f8f5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -413,7 +413,7 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - warning("vsync: STUB"); + warning("showgroup: STUB"); } void fadedos(Context &context) { @@ -426,7 +426,7 @@ void doshake(Context &context) { void vsync(Context &context) { //engine()->waitForVSync(); - warning("vsync: STUB"); + //warning("vsync: STUB"); //fixme: loop } void setmode(Context &context) { diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index af484fe19c..b69bd15d52 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -245,14 +245,16 @@ public: } inline void _add(uint8 &dst, uint8 src) { - flags._c = (unsigned(dst) + src) >= 0x100; - dst += src; + unsigned r = (unsigned)dst + src; + flags._c = r >= 0x100; + dst = r; flags.update(dst); } inline void _add(uint16 &dst, uint16 src) { - flags._c = (unsigned(dst) + src) >= 0x10000; - dst += src; + unsigned r = (unsigned)dst + src; + flags._c = r >= 0x10000; + dst = r; flags.update(dst); } @@ -304,10 +306,38 @@ public: flags.update(dst); } - inline void _shr(uint8 &dst, uint8 src) {} - inline void _shr(uint16 &dst, uint8 src) {} - inline void _shl(uint8 &dst, uint8 src) {} - inline void _shl(uint16 &dst, uint8 src) {} + inline void _shr(uint8 &dst, uint8 src) { + if (src > 0 && src < 32) { + dst >>= (src - 1); + flags._c = dst & 1; + dst >>= 1; + } + flags.update(dst); + } + inline void _shr(uint16 &dst, uint8 src) { + if (src > 0 && src < 32) { + dst >>= (src - 1); + flags._c = dst & 1; + dst >>= 1; + } + flags.update(dst); + } + inline void _shl(uint8 &dst, uint8 src) { + if (src > 0 && src < 32) { + dst <<= (src - 1); + flags._c = dst & 0x80; + dst <<= 1; + } + flags.update(dst); + } + inline void _shl(uint16 &dst, uint8 src) { + if (src > 0 && src < 32) { + dst <<= (src - 1); + flags._c = dst & 0x8000; + dst <<= 1; + } + flags.update(dst); + } inline void _mul(uint8 src) { unsigned r = unsigned(al) * src; -- cgit v1.2.3 From 35d5ffa85da39022c6cad3d6e077aecc73d00c75 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 03:15:03 +0400 Subject: DREAMWEB: zero cx after showgroup --- engines/dreamweb/dreamweb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index feec93f8f5..c145b51f34 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -414,6 +414,7 @@ void mode640x480(Context &context) { void showgroup(Context &context) { warning("showgroup: STUB"); + context.cx = 0; } void fadedos(Context &context) { -- cgit v1.2.3 From a07ec818c7d3b498a3967a6a09c517647a9ae392 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 11:14:12 +0400 Subject: DREAMWEB: added processEvents, added mouse support --- engines/dreamweb/dreamweb.cpp | 110 +++++++++++++++++++++++++----------------- engines/dreamweb/dreamweb.h | 14 ++++-- 2 files changed, 77 insertions(+), 47 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c145b51f34..353474ad53 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -83,57 +83,74 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) { } void DreamWebEngine::waitForVSync() { + processEvents(); +/* while (!_vSyncInterrupt) { _system->delayMillis(10); } setVSyncInterrupt(false); +*/ // doshake // dofade } -Common::Error DreamWebEngine::run() { - _console = new DreamWebConsole(this); - - dreamgen::Context context; - dreamgen::__start(context); - +void DreamWebEngine::processEvents() { Common::EventManager *event_manager = _system->getEventManager(); - getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this); - - do { - uint32 frame_time = _system->getMillis(); - Common::Event event; - while (event_manager->pollEvent(event)) { - switch(event.type) { - case Common::EVENT_RTL: - return Common::kNoError; - case Common::EVENT_MOUSEMOVE: - _mouse = event.mouse; - break; - case Common::EVENT_KEYDOWN: - switch (event.kbd.keycode) { - case Common::KEYCODE_d: - if (event.kbd.flags & Common::KBD_CTRL) { - _console->attach(); - _console->onFrame(); - } - break; - default: - break; + Common::Event event; + while (event_manager->pollEvent(event)) { + switch(event.type) { + case Common::EVENT_RTL: + warning("quit requested"); + return; + case Common::EVENT_LBUTTONDOWN: + _mouseState |= 1; + break; + case Common::EVENT_LBUTTONUP: + _mouseState &= ~1; + break; + case Common::EVENT_RBUTTONDOWN: + _mouseState |= 2; + break; + case Common::EVENT_RBUTTONUP: + _mouseState &= ~2; + break; + case Common::EVENT_MOUSEMOVE: + _mouse = event.mouse; + break; + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_d: + if (event.kbd.flags & Common::KBD_CTRL) { + _console->attach(); + _console->onFrame(); } break; default: - debug(0, "skipped event type %d", event.type); + break; } + break; + default: + debug(0, "skipped event type %d", event.type); } - } while (!shouldQuit()); + } +} + + +Common::Error DreamWebEngine::run() { + _mouseState = 0; + _console = new DreamWebConsole(this); + getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this); + + dreamgen::__start(_context); + getTimerManager()->removeTimerProc(vSyncInterrupt); return Common::kNoError; } void DreamWebEngine::openFile(const Common::String &name) { + processEvents(); if (_file.isOpen()) { _file.close(); } @@ -143,15 +160,33 @@ void DreamWebEngine::openFile(const Common::String &name) { } void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { + processEvents(); if (!_file.isOpen()) error("file was not opened (read before open)"); _file.read(dst, size); } void DreamWebEngine::closeFile() { + processEvents(); _file.close(); } +void DreamWebEngine::mouseCall() { + processEvents(); + Common::Point pos = _mouse; + if (pos.x > 298) + pos.x = 298; + if (pos.x < 15) + pos.x = 15; + if (pos.y < 15) + pos.y = 15; + if (pos.y > 184) + pos.y = 184; + _context.cx = pos.x; + _context.dx = pos.y; + _context.bx = _mouseState; +} + } // End of namespace DreamWeb @@ -236,17 +271,7 @@ void dontloadseg(Context &context) { } void mousecall(Context &context) { - Common::Point pos = engine()->mousePos(); - if (pos.x > 298) - pos.x = 298; - if (pos.x < 15) - pos.x = 15; - if (pos.y < 15) - pos.y = 15; - if (pos.y > 184) - pos.y = 184; - context.cx = pos.x; - context.dx = pos.y; + engine()->mouseCall(); } void setmouse(Context &context) { @@ -426,8 +451,7 @@ void doshake(Context &context) { } void vsync(Context &context) { - //engine()->waitForVSync(); - //warning("vsync: STUB"); //fixme: loop + engine()->waitForVSync(); } void setmode(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 245f4967bb..0548df69dc 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -33,6 +33,7 @@ #include "common/scummsys.h" #include "engines/engine.h" +#include "dreamweb/dreamgen.h" #include "dreamweb/console.h" namespace Graphics { @@ -81,13 +82,18 @@ public: void readFromFile(uint8 *dst, unsigned size); void closeFile(); - Common::Point mousePos() const { return _mouse; } + void mouseCall(); //fill mouse pos and button state + void processEvents(); + private: - const DreamWebGameDescription *_gameDescription; - Common::RandomSource _rnd; - Common::Point _mouse; + const DreamWebGameDescription *_gameDescription; + Common::RandomSource _rnd; + Common::Point _mouse; + unsigned _mouseState; Common::File _file; + + dreamgen::Context _context; }; } // End of namespace DreamWeb -- cgit v1.2.3 From af4f0e6b1e40971c23331ed677d0fa70a8607eb2 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 8 Jun 2011 11:26:46 +0400 Subject: DREAMWEB: added graphics mode initialization --- engines/dreamweb/dreamweb.cpp | 33 ++++++++++++++++++++++++--------- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 353474ad53..fbb16a83db 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -32,12 +32,14 @@ #include "common/iff_container.h" #include "common/system.h" #include "common/timer.h" +#include "common/util.h" #include "engines/util.h" #include "audio/mixer.h" #include "graphics/palette.h" +#include "graphics/surface.h" #include "dreamweb/dreamweb.h" #include "dreamweb/dreamgen.h" @@ -84,6 +86,15 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) { void DreamWebEngine::waitForVSync() { processEvents(); + Graphics::Surface *s = _system->lockScreen(); + if (!s) + error("lockScreen failed"); + for(int y = 0; y < 200; ++y) { + uint8 *scanline = (uint8*)s->getBasePtr(0, y); + uint8 *src = _context.video.ptr(y * 320, 320); + memcpy(scanline, src, 320); + } + _system->unlockScreen(); /* while (!_vSyncInterrupt) { _system->delayMillis(10); @@ -130,7 +141,7 @@ void DreamWebEngine::processEvents() { } break; default: - debug(0, "skipped event type %d", event.type); + break; } } } @@ -187,6 +198,10 @@ void DreamWebEngine::mouseCall() { _context.bx = _mouseState; } +void DreamWebEngine::setGraphicsMode() { + initGraphics(320, 200, false); +} + } // End of namespace DreamWeb @@ -198,11 +213,11 @@ static inline DreamWeb::DreamWebEngine *engine() { } void seecommandtail(Context &context) { - context.ds.word(kSoundbaseadd) = 0x220; - context.ds.byte(kSoundint) = 5; - context.ds.byte(kSounddmachannel) = 1; - context.ds.byte(kBrightness) = 1; - context.ds.word(kHowmuchalloc) = 0x9360; + context.data.word(kSoundbaseadd) = 0x220; + context.data.byte(kSoundint) = 5; + context.data.byte(kSounddmachannel) = 1; + context.data.byte(kBrightness) = 1; + context.data.word(kHowmuchalloc) = 0x9360; } void randomnumber(Context &context) { @@ -275,8 +290,8 @@ void mousecall(Context &context) { } void setmouse(Context &context) { - context.ds.word(kOldpointerx) = 0xffff; - warning("setmouse: fixme: add range setting"); + context.data.word(kOldpointerx) = 0xffff; + //warning("setmouse: fixme: add range setting"); //set vertical range to 15-184 //set horizontal range to 15-298*2 } @@ -455,7 +470,7 @@ void vsync(Context &context) { } void setmode(Context &context) { - warning("setmode (vga): STUB"); + engine()->setGraphicsMode(); } void readoneblock(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 0548df69dc..1c2d1f6688 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -84,6 +84,7 @@ public: void mouseCall(); //fill mouse pos and button state void processEvents(); + void setGraphicsMode(); private: const DreamWebGameDescription *_gameDescription; -- cgit v1.2.3 From 28cc856572f1fa2041958062382a0e5e54d046fd Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 7 Jun 2011 19:12:09 +0200 Subject: DREAMWEB: Unstub gettime(). --- engines/dreamweb/dreamweb.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fbb16a83db..9fd8b66641 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -297,10 +297,15 @@ void setmouse(Context &context) { } void gettime(Context &context) { - warning("gettime: stub: 10:10:00"); - context.ch = 10; - context.cl = 10; - context.dh = 0; + TimeDate t; + g_system->getTimeAndDate(t); + debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); + context.ch = t.tm_hour; + context.cl = t.tm_min; + context.dh = t.tm_sec; + context.ds.byte(5) = context.dh; + context.ds.byte(6) = context.cl; + context.ds.byte(7) = context.ch; } void allocatemem(Context &context) { -- cgit v1.2.3 From a1b1d78e69bca1c274106cdea988be7d2452dc72 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 7 Jun 2011 19:21:22 +0200 Subject: DREAMWEB: Unstub mode640x480() --- engines/dreamweb/dreamweb.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 9fd8b66641..b5be2a63c1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -454,7 +454,8 @@ void set16colpalette(Context &context) { } void mode640x480(Context &context) { - ::error("mode640x480"); + // Video mode 12h: 640x480 pixels, 16 colors, I believe + initGraphics(640, 480, true); } void showgroup(Context &context) { -- cgit v1.2.3 From a6fb92d230a08829c7e313665396d9c81fb545d8 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 01:11:03 +0400 Subject: DREAMWEB: added o flag handling for shr/shl instructions --- engines/dreamweb/runtime.h | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index b69bd15d52..e474c1bc6f 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -225,23 +225,19 @@ public: } inline void _cmp(uint8 a, uint8 b) { - uint8 x = a; - _sub(x, b); + _sub(a, b); } inline void _cmp(uint16 a, uint16 b) { - uint16 x = a; - _sub(x, b); + _sub(a, b); } inline void _test(uint8 a, uint8 b) { - uint8 x = a; - _and(x, b); + _and(a, b); } inline void _test(uint16 a, uint16 b) { - uint16 x = a; - _and(x, b); + _and(a, b); } inline void _add(uint8 &dst, uint8 src) { @@ -307,36 +303,50 @@ public: } inline void _shr(uint8 &dst, uint8 src) { - if (src > 0 && src < 32) { + src &= 0x1f; + if (src > 0) { dst >>= (src - 1); flags._c = dst & 1; dst >>= 1; } flags.update(dst); + if (src == 1) + flags._o = dst & 0x80; } + inline void _shr(uint16 &dst, uint8 src) { - if (src > 0 && src < 32) { + src &= 0x1f; + if (src > 0) { dst >>= (src - 1); flags._c = dst & 1; dst >>= 1; } flags.update(dst); + if (src == 1) + flags._o = dst & 0x8000; } + inline void _shl(uint8 &dst, uint8 src) { - if (src > 0 && src < 32) { + src &= 0x1f; + if (src > 0) { dst <<= (src - 1); flags._c = dst & 0x80; dst <<= 1; } flags.update(dst); + if (src == 1) + flags._o = ((dst & 0x80) != 0) == flags._c; } inline void _shl(uint16 &dst, uint8 src) { - if (src > 0 && src < 32) { + src &= 0x1f; + if (src > 0) { dst <<= (src - 1); flags._c = dst & 0x8000; dst <<= 1; } flags.update(dst); + if (src == 1) + flags._o = ((dst & 0x8000) != 0) == flags._c; } inline void _mul(uint8 src) { -- cgit v1.2.3 From 797127cb65e2fd26ab5875b6bc64ad16f5439fc5 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 01:18:19 +0400 Subject: DREAMWEB: cleared overflow flag on logic instructions --- engines/dreamweb/runtime.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index e474c1bc6f..f904497bb4 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -268,38 +268,38 @@ public: inline void _and(uint8 &dst, uint8 src) { dst &= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _and(uint16 &dst, uint16 src) { dst &= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _or(uint8 &dst, uint8 src) { dst |= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _or(uint16 &dst, uint16 src) { dst |= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _xor(uint8 &dst, uint8 src) { dst ^= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _xor(uint16 &dst, uint16 src) { dst ^= src; - flags._c = false; flags.update(dst); + flags._c = flags._o = false; } inline void _shr(uint8 &dst, uint8 src) { @@ -372,8 +372,8 @@ public: inline void _neg(uint8 &src) { src = ~src; - flags._c = false; flags.update(src); + flags._c = flags._o = false; } inline void _neg(uint16 &src) { -- cgit v1.2.3 From e0eac547cb0c008fd6893a87f331f9498e55e0c1 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 01:23:37 +0400 Subject: DREAMWEB: fixed g/l/ge/le flags --- engines/dreamweb/runtime.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index f904497bb4..388fc751fc 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -153,14 +153,14 @@ struct Flags { bool _z, _c, _s, _o; inline Flags(): _z(true), _c(false), _s(false), _o(false) {} - inline bool z() const { return _z; } - inline bool c() const { return _c; } - inline bool s() const { return _s; } + inline bool z() const { return _z; } + inline bool c() const { return _c; } + inline bool s() const { return _s; } //complex flags: - inline bool g() const { return !_z && _s == _o; } - inline bool ge() const { return _z || _s == _o; } - inline bool l() const { return !_z && _s != _o; } - inline bool le() const { return _z || _s != _o; } + inline bool g() const { return !_z && _s == _o; } + inline bool ge() const { return _s == _o; } + inline bool l() const { return _s != _o; } + inline bool le() const { return _z || _s != _o; } inline void update(uint8 v) { bool new_s = v & 0x80; @@ -378,8 +378,8 @@ public: inline void _neg(uint16 &src) { src = ~src; - flags._c = false; flags.update(src); + flags._c = flags._o = false; } inline void _movsb() { -- cgit v1.2.3 From 978d17454b4fad024939320a1e45b1a66e41b3ea Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 01:35:40 +0400 Subject: DREAMWEB: fixed OF flag handling --- engines/dreamweb/runtime.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 388fc751fc..0772e5acad 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -163,18 +163,22 @@ struct Flags { inline bool le() const { return _z || _s != _o; } inline void update(uint8 v) { - bool new_s = v & 0x80; - _o = new_s != _s; - _s = new_s; + _s = v & 0x80; _z = v == 0; } + inline void update_o(uint8 v, uint8 old) { + _o = (old & 0x80) == (v & 0x80); + } + inline void update(uint16 v) { - bool new_s = v & 0x8000; - _o = new_s != _s; - _s = new_s; + _s = v & 0x8000; _z = v == 0; } + + inline void update_o(uint16 v, uint16 old) { + _o = (old & 0x8000) == (v & 0x8000); + } }; class Context { @@ -242,6 +246,7 @@ public: inline void _add(uint8 &dst, uint8 src) { unsigned r = (unsigned)dst + src; + flags.update_o(r, dst); flags._c = r >= 0x100; dst = r; flags.update(dst); @@ -249,18 +254,21 @@ public: inline void _add(uint16 &dst, uint16 src) { unsigned r = (unsigned)dst + src; + flags.update_o(r, dst); flags._c = r >= 0x10000; dst = r; flags.update(dst); } inline void _sub(uint8 &dst, uint8 src) { + flags.update_o(dst - src, dst); flags._c = dst < src; dst -= src; flags.update(dst); } inline void _sub(uint16 &dst, uint16 src) { + flags.update_o(dst - src, dst); flags._c = dst < src; dst -= src; flags.update(dst); @@ -351,23 +359,21 @@ public: inline void _mul(uint8 src) { unsigned r = unsigned(al) * src; + flags.update_o(r, al); ax = (uint16)r; flags._c = r >= 0x10000; flags._z = r == 0; - bool s = r & 0x8000; - flags._o = s != flags._s; - flags._s = s; + flags._s = r & 0x8000; } inline void _mul(uint16 src) { unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits + flags.update_o(r, ax); dx = (r >> 16) & 0xffff; ax = r & 0xffff; flags._c = false;//fixme flags._z = r == 0; - bool s = r & 0x80000000; - flags._o = s != flags._s; - flags._s = s; + flags._s = r & 0x80000000; } inline void _neg(uint8 &src) { -- cgit v1.2.3 From 3bd7cb1902b7a01d622cc8ccdfc54bc5b50f164c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 02:00:41 +0400 Subject: DREAMWEB: fixed loadfromfile --- engines/dreamweb/dreamweb.cpp | 21 +++++++++++++++------ engines/dreamweb/dreamweb.h | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b5be2a63c1..340c916b41 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -170,11 +170,11 @@ void DreamWebEngine::openFile(const Common::String &name) { } } -void DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { +uint32 DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { processEvents(); if (!_file.isOpen()) error("file was not opened (read before open)"); - _file.read(dst, size); + return _file.read(dst, size); } void DreamWebEngine::closeFile() { @@ -248,7 +248,7 @@ void readfromfile(Context &context) { uint16 dst_offset = context.dx; uint16 size = context.cx; debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - engine()->readFromFile(context.ds.ptr(dst_offset, size), size); + context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; //fixme: add return args } @@ -459,8 +459,17 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - warning("showgroup: STUB"); - context.cx = 0; + debug(1, "setting palette entries %u, %u colors, ds: %04x", (uint8)context.al, (uint16)context.cx, (uint16)context.ds); + unsigned idx = context.al; + while(context.cx--) { + context._lodsb(); + unsigned r = context.al; + context._lodsb(); + unsigned g = context.al; + context._lodsb(); + unsigned b = context.al; + debug(1, "%u -> %u,%u,%u", idx, r, g, b); + } } void fadedos(Context &context) { @@ -484,7 +493,7 @@ void readoneblock(Context &context) { } void showpcx(Context &context) { - ::error("showpcx"); + warning("showpcx"); } } /*namespace dreamgen */ diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 1c2d1f6688..d2fc447fee 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -79,7 +79,7 @@ public: uint8 randomNumber() { return _rnd.getRandomNumber(255); } void openFile(const Common::String &name); - void readFromFile(uint8 *dst, unsigned size); + uint32 readFromFile(uint8 *dst, unsigned size); void closeFile(); void mouseCall(); //fill mouse pos and button state -- cgit v1.2.3 From fe40748d1ac2b110120da1826aac7816b00ee60b Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 02:08:09 +0400 Subject: DREAMWEB: implemented loadseg --- engines/dreamweb/dreamweb.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 340c916b41..565002317c 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -249,7 +249,7 @@ void readfromfile(Context &context) { uint16 size = context.cx; debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); - context.flags._c = false; //fixme: add return args + context.flags._c = false; } void closefile(Context &context) { @@ -426,7 +426,15 @@ void saveseg(Context &context) { } void loadseg(Context &context) { - ::error("loadseg"); + uint16 dst_offset = context.dx; + uint16 size = context.ax; + + context.ax = context.es.word(context.di); + context.di += 2; + + debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); + context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); + context.flags._c = false; } void loadposition(Context &context) { -- cgit v1.2.3 From 83d7320712bdfe565215e96360d552092503eb80 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 02:09:19 +0400 Subject: DREAMWEB: fixed bogus logs --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 565002317c..aead233f74 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -432,7 +432,7 @@ void loadseg(Context &context) { context.ax = context.es.word(context.di); context.di += 2; - debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); + debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; } -- cgit v1.2.3 From a5bd71858b1933c771f123457ba873e1898a873f Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 9 Jun 2011 06:03:01 +0200 Subject: DREAMWEB: Adjusted mode640x480 slightly I can't imagine it makes any diffrence, but I guess this function should set these registers just in case... --- engines/dreamweb/dreamweb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index aead233f74..ebdc4a99f7 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -463,6 +463,8 @@ void set16colpalette(Context &context) { void mode640x480(Context &context) { // Video mode 12h: 640x480 pixels, 16 colors, I believe + context.al = 0x12 + 128; + context.ah = 0; initGraphics(640, 480, true); } -- cgit v1.2.3 From bea919c9b45d8d6d31adcb0b8edc3ab48d5b8c35 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 10:25:36 +0400 Subject: DREAMWEB: fixed hardcoded offsets --- engines/dreamweb/dreamweb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index ebdc4a99f7..28dea96f9f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -303,9 +303,9 @@ void gettime(Context &context) { context.ch = t.tm_hour; context.cl = t.tm_min; context.dh = t.tm_sec; - context.ds.byte(5) = context.dh; - context.ds.byte(6) = context.cl; - context.ds.byte(7) = context.ch; + context.data.byte(kSecondcount) = context.dh; + context.data.byte(kMinutecount) = context.cl; + context.data.byte(kHourcount) = context.ch; } void allocatemem(Context &context) { -- cgit v1.2.3 From fce91bd196d6c1d17fb56b4a983b219a55fde045 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 10:32:23 +0400 Subject: DREAMWEB: fixed of flag handling --- engines/dreamweb/runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 0772e5acad..8d4592f401 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -168,7 +168,7 @@ struct Flags { } inline void update_o(uint8 v, uint8 old) { - _o = (old & 0x80) == (v & 0x80); + _o = (old & 0x80) != (v & 0x80); } inline void update(uint16 v) { -- cgit v1.2.3 From 66ee7b20f5d72a981b44ebf083a5e1280a61399e Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 9 Jun 2011 10:32:40 +0400 Subject: DREAMWEB: removed noisy palette log --- engines/dreamweb/dreamweb.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 28dea96f9f..e88898bb43 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -470,15 +470,14 @@ void mode640x480(Context &context) { void showgroup(Context &context) { debug(1, "setting palette entries %u, %u colors, ds: %04x", (uint8)context.al, (uint16)context.cx, (uint16)context.ds); - unsigned idx = context.al; - while(context.cx--) { + for(unsigned idx = context.al; context.cx--; ++idx) { context._lodsb(); unsigned r = context.al; context._lodsb(); unsigned g = context.al; context._lodsb(); unsigned b = context.al; - debug(1, "%u -> %u,%u,%u", idx, r, g, b); + //debug(1, "%u -> (%u,%u,%u)", idx, r, g, b); } } -- cgit v1.2.3 From 4cea3245fe90b7e09d5e55e8dbf598045b525b95 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 9 Jun 2011 21:35:13 +0200 Subject: DREAMWEB: First attempt at unstubbing showpcx() This is untested and incomplete, but I'm too tired to do an more with it tonight, and it doesn't seem to cause any catastrophic failures. Yet. --- engines/dreamweb/dreamweb.cpp | 101 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index e88898bb43..4714511296 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -498,11 +498,108 @@ void setmode(Context &context) { } void readoneblock(Context &context) { - ::error("readoneblock"); + context.ds = context.data.word(kWorkspace); + context.cx = 30000; + context.dx = 0; + readfromfile(context); +} + +// TODO: This is already defined in dreamgen.cpp, so expose it should be +// exposed from there. Once that's done, remove this copy! + +static void readabyte(Context & context) { + context._cmp(context.si, 30000); + if (!context.flags.z()) goto notendblock; + context.push(context.bx); + context.push(context.es); + context.push(context.di); + context.push(context.ds); + context.push(context.si); + readoneblock(context); + context.si = context.pop(); + context.ds = context.pop(); + context.di = context.pop(); + context.es = context.pop(); + context.bx = context.pop(); + context.si = 0; +notendblock: + context._lodsb(); } void showpcx(Context &context) { - warning("showpcx"); + openfile(context); + context.ds = context.data.word(kWorkspace); + context.cx = 128; + context.dx = 0; + readfromfile(context); + + context.ds = context.data.word(kWorkspace); + context.si = 16; + context.cx = 48; + context.es = context.data.word(kBuffers); + context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; +pcxpal: + context.push(context.cx); + readabyte(context); + context._shr(context.al, 1); + context._shr(context.al, 1); + context._stosb(); + context.cx = context.pop(); + if (--context.cx) goto pcxpal; + context.cx = 768 - 48; + context.ax = 0x0ffff; + while (--context.cx) context._stosw(); + + readoneblock(context); + context.si = 0; + context.di = 0; + context.cx = 480; +convertpcx: + context.push(context.cx); + context.push(context.di); + context.ds = context.data.word(kWorkspace); + context.es = context.data.word(kBuffers); + context.di = 0+(228*13)+32+60; + context.bx = 0; +sameline: + readabyte(context); + context.ah = context.al; + context._and(context.ah, 0xc0); + context._cmp(context.ah, 0xc0); + if (!context.flags.z()) goto normal; + context.cl = context.al; + context._and(context.cl, 0x3f); + context.ch = 0; + context.push(context.cx); + readabyte(context); + context.cx = context.pop(); + context._add(context.bx, context.cx); + if (--context.cx) context._stosb(); + context._cmp(context.bx, 4 * 80); + if (!context.flags.z()) goto sameline; + goto endline; +normal: + context._stosb(); + context._add(context.bx, 1); + context._cmp(context.bx, 4 * 80); + if (!context.flags.z()) goto sameline; + +endline: + context.di = context.pop(); + context.push(context.si); + context.dx = 0xa000; + context.es = context.dx; + context.si = 0+(228*13)+32+60; + context.ds = context.data.word(kBuffers); + + // TODO: There's a bunch of code here which I assume draws data to the + // screen or something like that. + + context.si = context.pop(); + context.cx = context.pop(); + if (--context.cx) goto convertpcx; + + closefile(context); } } /*namespace dreamgen */ -- cgit v1.2.3 From d2688a520bf58bb5aef751ce7a331fc900532c98 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 9 Jun 2011 23:47:32 +0400 Subject: DREAMWEB: removed static from functions for now (allowing external usage) --- devtools/tasmrecover/tasm/cpp.py | 6 +- engines/dreamweb/dreamgen.cpp | 2342 +++++++++++++++++++------------------- 2 files changed, 1175 insertions(+), 1173 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 36bc192219..f5f7057211 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -433,7 +433,7 @@ namespace %s { self.proc_addr.append((name, self.proc.offset)) self.body = str() - self.body += "static void %s(Context & context) {\n" %name; + self.body += "void %s(Context & context) {\n" %name; self.proc.optimize() self.unbounded = [] self.proc.visit(self, skip) @@ -502,9 +502,11 @@ namespace %s { self.__proc(name) self.write_stubs("_stubs.cpp", self.failed) done, failed = len(self.proc_done), len(self.failed) + for f in self.forwards: if f not in self.failed: - self.fd.write("static void %s(Context &context);\n" %f) + self.fd.write("void %s(Context &context);\n" %f) + self.fd.write("\n") self.fd.write("\n".join(self.translated)) self.fd.write("\n\n") diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 54de5a9539..f7acf6e82c 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2,485 +2,485 @@ namespace dreamgen { -static void checkbasemem(Context &context); -static void allocatebuffers(Context &context); -static void clearbuffers(Context &context); -static void clearpalette(Context &context); -static void readsetdata(Context &context); -static void loadpalfromiff(Context &context); -static void titles(Context &context); -static void credits(Context &context); -static void cls(Context &context); -static void decide(Context &context); -static void clearchanges(Context &context); -static void loadroom(Context &context); -static void clearsprites(Context &context); -static void initman(Context &context); -static void entrytexts(Context &context); -static void entryanims(Context &context); -static void initialinv(Context &context); -static void startup1(Context &context); -static void clearbeforeload(Context &context); -static void startup(Context &context); -static void worktoscreenm(Context &context); -static void screenupdate(Context &context); -static void showgun(Context &context); -static void fadescreendown(Context &context); -static void hangon(Context &context); -static void fadescreendowns(Context &context); -static void endgame(Context &context); -static void standardload(Context &context); -static void getroomspaths(Context &context); -static void readheader(Context &context); -static void allocateload(Context &context); -static void fillspace(Context &context); -static void sortoutmap(Context &context); -static void findroominloc(Context &context); -static void deletetaken(Context &context); -static void setallchanges(Context &context); -static void autoappear(Context &context); -static void getroomdata(Context &context); -static void autosetwalk(Context &context); -static void findxyfrompath(Context &context); -static void twodigitnum(Context &context); -static void startloading(Context &context); -static void loadroomssample(Context &context); -static void switchryanon(Context &context); -static void drawflags(Context &context); -static void getdimension(Context &context); -static void getflagunderp(Context &context); -static void multidump(Context &context); -static void multiput(Context &context); -static void multiget(Context &context); -static void dumpblink(Context &context); -static void showblink(Context &context); -static void showframe(Context &context); -static void printcurs(Context &context); -static void delcurs(Context &context); -static void delpointer(Context &context); -static void readmouse(Context &context); -static void animpointer(Context &context); -static void showpointer(Context &context); -static void dumppointer(Context &context); -static void commandonly(Context &context); -static void worktoscreen(Context &context); -static void showtime(Context &context); -static void showwatch(Context &context); -static void printmessage(Context &context); -static void printdirect(Context &context); -static void usecharset1(Context &context); -static void showpanel(Context &context); -static void showman(Context &context); -static void roomname(Context &context); -static void panelicons1(Context &context); -static void zoomicon(Context &context); -static void middlepanel(Context &context); -static void findobname(Context &context); -static void workoutframes(Context &context); -static void checkdest(Context &context); -static void bresenhams(Context &context); -static void facerightway(Context &context); -static void checkone(Context &context); -static void commandwithob(Context &context); -static void findnextcolon(Context &context); -static void deltextline(Context &context); -static void copyname(Context &context); -static void finishedwalking(Context &context); -static void examineob(Context &context); -static void talk(Context &context); -static void setwalk(Context &context); -static void examineobtext(Context &context); -static void blocknametext(Context &context); -static void personnametext(Context &context); -static void walktotext(Context &context); -static void clearwork(Context &context); -static void drawfloor(Context &context); -static void reelsonscreen(Context &context); -static void spriteupdate(Context &context); -static void printsprites(Context &context); -static void playchannel0(Context &context); -static void cancelch0(Context &context); -static void createpanel(Context &context); -static void findpathofpoint(Context &context); -static void showicon(Context &context); -static void undertextline(Context &context); -static void mainscreen(Context &context); -static void getunderzoom(Context &context); -static void zoom(Context &context); -static void walkintoroom(Context &context); -static void reminders(Context &context); -static void atmospheres(Context &context); -static void findormake(Context &context); -static void obname(Context &context); -static void pixelcheckset(Context &context); -static void isitdescribed(Context &context); -static void getreelstart(Context &context); -static void getreelframeax(Context &context); -static void blank(Context &context); -static void findfirstpath(Context &context); -static void checkifex(Context &context); -static void checkiffree(Context &context); -static void checkifperson(Context &context); -static void checkifset(Context &context); -static void identifyob(Context &context); -static void checkcoords(Context &context); -static void walkandexamine(Context &context); -static void convnum(Context &context); -static void onedigit(Context &context); -static void plotreel(Context &context); -static void checkforshake(Context &context); -static void newplace(Context &context); -static void readmouse1(Context &context); -static void dumptextline(Context &context); -static void autolook(Context &context); -static void watchcount(Context &context); -static void readmouse2(Context &context); -static void dumpzoom(Context &context); -static void deleverything(Context &context); -static void afternewroom(Context &context); -static void readmouse3(Context &context); -static void dumpmap(Context &context); -static void dumptimedtext(Context &context); -static void readmouse4(Context &context); -static void dumpwatch(Context &context); -static void fadescreenup(Context &context); -static void clearreels(Context &context); -static void clearrest(Context &context); -static void trysoundalloc(Context &context); -static void allocatework(Context &context); -static void checkforemm(Context &context); -static void getanyad(Context &context); -static void transfertoex(Context &context); -static void pickupob(Context &context); -static void switchryanoff(Context &context); -static void resetlocation(Context &context); -static void removefreeobject(Context &context); -static void checkifpathison(Context &context); -static void turnpathon(Context &context); -static void removesetobject(Context &context); -static void placesetobject(Context &context); -static void turnanypathon(Context &context); -static void setuptimeduse(Context &context); -static void volumeadjust(Context &context); -static void loopchannel0(Context &context); -static void cancelch1(Context &context); -static void createname(Context &context); -static void doload(Context &context); -static void showdecisions(Context &context); -static void showopbox(Context &context); -static void showloadops(Context &context); -static void showslots(Context &context); -static void shownames(Context &context); -static void namestoold(Context &context); -static void getridoftemp(Context &context); -static void initrain(Context &context); -static void createpanel2(Context &context); -static void loadsavebox(Context &context); -static void storeit(Context &context); -static void makeheader(Context &context); -static void oldtonames(Context &context); -static void showsaveops(Context &context); -static void readkey(Context &context); -static void getnamepos(Context &context); -static void selectslot(Context &context); -static void restoreall(Context &context); -static void redrawmainscrn(Context &context); -static void checkinput(Context &context); -static void showdiscops(Context &context); -static void loadintotemp(Context &context); -static void getback1(Context &context); -static void getridofall(Context &context); -static void showmainops(Context &context); -static void dosaveload(Context &context); -static void findtext1(Context &context); -static void usetempcharset(Context &context); -static void playchannel1(Context &context); -static void getlocation(Context &context); -static void setlocation(Context &context); -static void hangonp(Context &context); -static void showdiary(Context &context); -static void showdiarypage(Context &context); -static void getridofreels(Context &context); -static void loadtemptext(Context &context); -static void loadtempcharset(Context &context); -static void showdiarykeys(Context &context); -static void dumpdiarykeys(Context &context); -static void getridoftemptext(Context &context); -static void getridoftempcharset(Context &context); -static void restorereels(Context &context); -static void nextsymbol(Context &context); -static void showsymbol(Context &context); -static void updatesymboltop(Context &context); -static void updatesymbolbot(Context &context); -static void dumpsymbol(Context &context); -static void turnanypathoff(Context &context); -static void folderexit(Context &context); -static void showleftpage(Context &context); -static void showrightpage(Context &context); -static void loadintotemp2(Context &context); -static void loadintotemp3(Context &context); -static void showfolder(Context &context); -static void folderhints(Context &context); -static void loadfolder(Context &context); -static void getridoftemp2(Context &context); -static void getridoftemp3(Context &context); -static void loadmenu(Context &context); -static void getundermenu(Context &context); -static void putundermenu(Context &context); -static void showmenu(Context &context); -static void dumpmenu(Context &context); -static void singlekey(Context &context); -static void buttonpress(Context &context); -static void loadkeypad(Context &context); -static void showouterpad(Context &context); -static void showkeypad(Context &context); -static void dumpkeypad(Context &context); -static void addtopresslist(Context &context); -static void isitright(Context &context); -static void checkinside(Context &context); -static void compare(Context &context); -static void showfirstuse(Context &context); -static void putbackobstuff(Context &context); -static void withwhat(Context &context); -static void showpuztext(Context &context); -static void placefreeobject(Context &context); -static void issetobonmap(Context &context); -static void showseconduse(Context &context); -static void removeobfrominv(Context &context); -static void turnpathoff(Context &context); -static void getundertimed(Context &context); -static void putundertimed(Context &context); -static void getsetad(Context &context); -static void getfreead(Context &context); -static void dochange(Context &context); -static void findpuztext(Context &context); -static void showexit(Context &context); -static void obicons(Context &context); -static void obpicture(Context &context); -static void describeob(Context &context); -static void getanyaddir(Context &context); -static void findinvpos(Context &context); -static void useroutine(Context &context); -static void printmessage2(Context &context); -static void fillryan(Context &context); -static void findsetobject(Context &context); -static void getobtextstart(Context &context); -static void usetext(Context &context); -static void selectlocation(Context &context); -static void hangonw(Context &context); -static void moneypoke(Context &context); -static void nextcolon(Context &context); -static void getexad(Context &context); -static void entercode(Context &context); -static void findexobject(Context &context); -static void makeworn(Context &context); -static void isryanholding(Context &context); -static void nothelderror(Context &context); -static void triggermessage(Context &context); -static void monprint(Context &context); -static void modifychar(Context &context); -static void printchar(Context &context); -static void showcurrentfile(Context &context); -static void printlogo(Context &context); -static void printundermon(Context &context); -static void randomaccess(Context &context); -static void locklighton(Context &context); -static void locklightoff(Context &context); -static void makecaps(Context &context); -static void monmessage(Context &context); -static void scrollmonitor(Context &context); -static void searchforstring(Context &context); -static void getkeyandlogo(Context &context); -static void monitorlogo(Context &context); -static void parser(Context &context); -static void neterror(Context &context); -static void processtrigger(Context &context); -static void input(Context &context); -static void dirfile(Context &context); -static void searchforfiles(Context &context); -static void dircom(Context &context); -static void signon(Context &context); -static void read(Context &context); -static void showkeys(Context &context); -static void delchar(Context &context); -static void randomnum1(Context &context); -static void accesslighton(Context &context); -static void accesslightoff(Context &context); -static void powerlighton(Context &context); -static void powerlightoff(Context &context); -static void lookininterface(Context &context); -static void loadpersonal(Context &context); -static void loadnews(Context &context); -static void loadcart(Context &context); -static void printoutermon(Context &context); -static void initialmoncols(Context &context); -static void turnonpower(Context &context); -static void fadeupyellows(Context &context); -static void fadeupmonfirst(Context &context); -static void hangoncurs(Context &context); -static void execcommand(Context &context); -static void purgealocation(Context &context); -static void getdestinfo(Context &context); -static void showarrows(Context &context); -static void locationpic(Context &context); -static void getundercentre(Context &context); -static void putundercentre(Context &context); -static void readcitypic(Context &context); -static void showcity(Context &context); -static void readdesticon(Context &context); -static void loadtraveltext(Context &context); -static void convicons(Context &context); -static void starttalk(Context &context); -static void hangonpq(Context &context); -static void redes(Context &context); -static void dosometalk(Context &context); -static void getpersontext(Context &context); -static void getpersframe(Context &context); -static void findsource(Context &context); -static void printslow(Context &context); -static void dolook(Context &context); -static void getxad(Context &context); -static void getyad(Context &context); -static void getmapad(Context &context); -static void calcfrframe(Context &context); -static void finalframe(Context &context); -static void makesprite(Context &context); -static void makebackob(Context &context); -static void addalong(Context &context); -static void addlength(Context &context); -static void eraseoldobs(Context &context); -static void calcmapad(Context &context); -static void doblocks(Context &context); -static void showallobs(Context &context); -static void showallfree(Context &context); -static void showallex(Context &context); -static void paneltomap(Context &context); -static void deleteexframe(Context &context); -static void deleteextext(Context &context); -static void deleteexobject(Context &context); -static void purgeanitem(Context &context); -static void getexpos(Context &context); -static void transfermap(Context &context); -static void transferinv(Context &context); -static void transfertext(Context &context); -static void transfercontoex(Context &context); -static void emergencypurge(Context &context); -static void pickupconts(Context &context); -static void findopenpos(Context &context); -static void reexfromopen(Context &context); -static void geteitherad(Context &context); -static void fillopen(Context &context); -static void useopened(Context &context); -static void getopenedsize(Context &context); -static void errormessage3(Context &context); -static void errormessage2(Context &context); -static void examicon(Context &context); -static void outofopen(Context &context); -static void swapwithopen(Context &context); -static void isitworn(Context &context); -static void wornerror(Context &context); -static void errormessage1(Context &context); -static void checkobjectsize(Context &context); -static void openinv(Context &context); -static void openob(Context &context); -static void droperror(Context &context); -static void cantdrop(Context &context); -static void reexfrominv(Context &context); -static void intoinv(Context &context); -static void outofinv(Context &context); -static void swapwithinv(Context &context); -static void makemainscreen(Context &context); -static void searchforsame(Context &context); -static void lookatcard(Context &context); -static void obsthatdothings(Context &context); -static void additionaltext(Context &context); -static void findallopen(Context &context); -static void obtoinv(Context &context); -static void findallryan(Context &context); -static void showryanpage(Context &context); -static void kernchars(Context &context); -static void getnextword(Context &context); -static void getnumber(Context &context); -static void lockmon(Context &context); -static void printboth(Context &context); -static void waitframes(Context &context); -static void hangone(Context &context); -static void allpalette(Context &context); -static void fadescreenups(Context &context); -static void afterintroroom(Context &context); -static void usetimedtext(Context &context); -static void loadintroroom(Context &context); -static void runintroseq(Context &context); -static void realcredits(Context &context); -static void runendseq(Context &context); -static void showmonk(Context &context); -static void monkspeaking(Context &context); -static void gettingshot(Context &context); -static void biblequote(Context &context); -static void intro(Context &context); -static void paltostartpal(Context &context); -static void paltoendpal(Context &context); -static void dumpcurrent(Context &context); -static void rollem(Context &context); -static void greyscalesum(Context &context); -static void endpaltostart(Context &context); -static void clearendpal(Context &context); -static void rollendcredits2(Context &context); -static void clearstartpal(Context &context); -static void fadecalculation(Context &context); -static void frameoutfx(Context &context); -static void frameoutnm(Context &context); -static void frameoutbh(Context &context); -static void frameoutv(Context &context); -static void putunderzoom(Context &context); -static void crosshair(Context &context); -static void width160(Context &context); -static void maptopanel(Context &context); -static void movemap(Context &context); -static void dealwithspecial(Context &context); -static void showreelframe(Context &context); -static void soundonreels(Context &context); -static void reconstruct(Context &context); -static void updatepeople(Context &context); -static void watchreel(Context &context); -static void showrain(Context &context); -static void dodoor(Context &context); -static void liftnoise(Context &context); -static void widedoor(Context &context); -static void random(Context &context); -static void lockeddoorway(Context &context); -static void liftsprite(Context &context); -static void doorway(Context &context); -static void constant(Context &context); -static void steady(Context &context); -static void getblockofpixel(Context &context); -static void splitintolines(Context &context); -static void adjustleft(Context &context); -static void adjustright(Context &context); -static void adjustdown(Context &context); -static void adjustup(Context &context); -static void aboutturn(Context &context); -static void checkforexit(Context &context); -static void walking(Context &context); -static void printasprite(Context &context); -static void showgamereel(Context &context); -static void checkspeed(Context &context); -static void addtopeoplelist(Context &context); -static void setuptimedtemp(Context &context); -static void madmantext(Context &context); -static void madmode(Context &context); -static void priesttext(Context &context); -static void fadescreenuphalf(Context &context); -static void textforend(Context &context); -static void fadescreendownhalf(Context &context); -static void rollendcredits(Context &context); -static void textformonk(Context &context); -static void monks2text(Context &context); -static void intro2text(Context &context); -static void intro3text(Context &context); -static void intro1text(Context &context); - -static void alleybarksound(Context & context) { +void checkbasemem(Context &context); +void allocatebuffers(Context &context); +void clearbuffers(Context &context); +void clearpalette(Context &context); +void readsetdata(Context &context); +void loadpalfromiff(Context &context); +void titles(Context &context); +void credits(Context &context); +void cls(Context &context); +void decide(Context &context); +void clearchanges(Context &context); +void loadroom(Context &context); +void clearsprites(Context &context); +void initman(Context &context); +void entrytexts(Context &context); +void entryanims(Context &context); +void initialinv(Context &context); +void startup1(Context &context); +void clearbeforeload(Context &context); +void startup(Context &context); +void worktoscreenm(Context &context); +void screenupdate(Context &context); +void showgun(Context &context); +void fadescreendown(Context &context); +void hangon(Context &context); +void fadescreendowns(Context &context); +void endgame(Context &context); +void standardload(Context &context); +void getroomspaths(Context &context); +void readheader(Context &context); +void allocateload(Context &context); +void fillspace(Context &context); +void sortoutmap(Context &context); +void findroominloc(Context &context); +void deletetaken(Context &context); +void setallchanges(Context &context); +void autoappear(Context &context); +void getroomdata(Context &context); +void autosetwalk(Context &context); +void findxyfrompath(Context &context); +void twodigitnum(Context &context); +void startloading(Context &context); +void loadroomssample(Context &context); +void switchryanon(Context &context); +void drawflags(Context &context); +void getdimension(Context &context); +void getflagunderp(Context &context); +void multidump(Context &context); +void multiput(Context &context); +void multiget(Context &context); +void dumpblink(Context &context); +void showblink(Context &context); +void showframe(Context &context); +void printcurs(Context &context); +void delcurs(Context &context); +void delpointer(Context &context); +void readmouse(Context &context); +void animpointer(Context &context); +void showpointer(Context &context); +void dumppointer(Context &context); +void commandonly(Context &context); +void worktoscreen(Context &context); +void showtime(Context &context); +void showwatch(Context &context); +void printmessage(Context &context); +void printdirect(Context &context); +void usecharset1(Context &context); +void showpanel(Context &context); +void showman(Context &context); +void roomname(Context &context); +void panelicons1(Context &context); +void zoomicon(Context &context); +void middlepanel(Context &context); +void findobname(Context &context); +void workoutframes(Context &context); +void checkdest(Context &context); +void bresenhams(Context &context); +void facerightway(Context &context); +void checkone(Context &context); +void commandwithob(Context &context); +void findnextcolon(Context &context); +void deltextline(Context &context); +void copyname(Context &context); +void finishedwalking(Context &context); +void examineob(Context &context); +void talk(Context &context); +void setwalk(Context &context); +void examineobtext(Context &context); +void blocknametext(Context &context); +void personnametext(Context &context); +void walktotext(Context &context); +void clearwork(Context &context); +void drawfloor(Context &context); +void reelsonscreen(Context &context); +void spriteupdate(Context &context); +void printsprites(Context &context); +void playchannel0(Context &context); +void cancelch0(Context &context); +void createpanel(Context &context); +void findpathofpoint(Context &context); +void showicon(Context &context); +void undertextline(Context &context); +void mainscreen(Context &context); +void getunderzoom(Context &context); +void zoom(Context &context); +void walkintoroom(Context &context); +void reminders(Context &context); +void atmospheres(Context &context); +void findormake(Context &context); +void obname(Context &context); +void pixelcheckset(Context &context); +void isitdescribed(Context &context); +void getreelstart(Context &context); +void getreelframeax(Context &context); +void blank(Context &context); +void findfirstpath(Context &context); +void checkifex(Context &context); +void checkiffree(Context &context); +void checkifperson(Context &context); +void checkifset(Context &context); +void identifyob(Context &context); +void checkcoords(Context &context); +void walkandexamine(Context &context); +void convnum(Context &context); +void onedigit(Context &context); +void plotreel(Context &context); +void checkforshake(Context &context); +void newplace(Context &context); +void readmouse1(Context &context); +void dumptextline(Context &context); +void autolook(Context &context); +void watchcount(Context &context); +void readmouse2(Context &context); +void dumpzoom(Context &context); +void deleverything(Context &context); +void afternewroom(Context &context); +void readmouse3(Context &context); +void dumpmap(Context &context); +void dumptimedtext(Context &context); +void readmouse4(Context &context); +void dumpwatch(Context &context); +void fadescreenup(Context &context); +void clearreels(Context &context); +void clearrest(Context &context); +void trysoundalloc(Context &context); +void allocatework(Context &context); +void checkforemm(Context &context); +void getanyad(Context &context); +void transfertoex(Context &context); +void pickupob(Context &context); +void switchryanoff(Context &context); +void resetlocation(Context &context); +void removefreeobject(Context &context); +void checkifpathison(Context &context); +void turnpathon(Context &context); +void removesetobject(Context &context); +void placesetobject(Context &context); +void turnanypathon(Context &context); +void setuptimeduse(Context &context); +void volumeadjust(Context &context); +void loopchannel0(Context &context); +void cancelch1(Context &context); +void createname(Context &context); +void doload(Context &context); +void showdecisions(Context &context); +void showopbox(Context &context); +void showloadops(Context &context); +void showslots(Context &context); +void shownames(Context &context); +void namestoold(Context &context); +void getridoftemp(Context &context); +void initrain(Context &context); +void createpanel2(Context &context); +void loadsavebox(Context &context); +void storeit(Context &context); +void makeheader(Context &context); +void oldtonames(Context &context); +void showsaveops(Context &context); +void readkey(Context &context); +void getnamepos(Context &context); +void selectslot(Context &context); +void restoreall(Context &context); +void redrawmainscrn(Context &context); +void checkinput(Context &context); +void showdiscops(Context &context); +void loadintotemp(Context &context); +void getback1(Context &context); +void getridofall(Context &context); +void showmainops(Context &context); +void dosaveload(Context &context); +void findtext1(Context &context); +void usetempcharset(Context &context); +void playchannel1(Context &context); +void getlocation(Context &context); +void setlocation(Context &context); +void hangonp(Context &context); +void showdiary(Context &context); +void showdiarypage(Context &context); +void getridofreels(Context &context); +void loadtemptext(Context &context); +void loadtempcharset(Context &context); +void showdiarykeys(Context &context); +void dumpdiarykeys(Context &context); +void getridoftemptext(Context &context); +void getridoftempcharset(Context &context); +void restorereels(Context &context); +void nextsymbol(Context &context); +void showsymbol(Context &context); +void updatesymboltop(Context &context); +void updatesymbolbot(Context &context); +void dumpsymbol(Context &context); +void turnanypathoff(Context &context); +void folderexit(Context &context); +void showleftpage(Context &context); +void showrightpage(Context &context); +void loadintotemp2(Context &context); +void loadintotemp3(Context &context); +void showfolder(Context &context); +void folderhints(Context &context); +void loadfolder(Context &context); +void getridoftemp2(Context &context); +void getridoftemp3(Context &context); +void loadmenu(Context &context); +void getundermenu(Context &context); +void putundermenu(Context &context); +void showmenu(Context &context); +void dumpmenu(Context &context); +void singlekey(Context &context); +void buttonpress(Context &context); +void loadkeypad(Context &context); +void showouterpad(Context &context); +void showkeypad(Context &context); +void dumpkeypad(Context &context); +void addtopresslist(Context &context); +void isitright(Context &context); +void checkinside(Context &context); +void compare(Context &context); +void showfirstuse(Context &context); +void putbackobstuff(Context &context); +void withwhat(Context &context); +void showpuztext(Context &context); +void placefreeobject(Context &context); +void issetobonmap(Context &context); +void showseconduse(Context &context); +void removeobfrominv(Context &context); +void turnpathoff(Context &context); +void getundertimed(Context &context); +void putundertimed(Context &context); +void getsetad(Context &context); +void getfreead(Context &context); +void dochange(Context &context); +void findpuztext(Context &context); +void showexit(Context &context); +void obicons(Context &context); +void obpicture(Context &context); +void describeob(Context &context); +void getanyaddir(Context &context); +void findinvpos(Context &context); +void useroutine(Context &context); +void printmessage2(Context &context); +void fillryan(Context &context); +void findsetobject(Context &context); +void getobtextstart(Context &context); +void usetext(Context &context); +void selectlocation(Context &context); +void hangonw(Context &context); +void moneypoke(Context &context); +void nextcolon(Context &context); +void getexad(Context &context); +void entercode(Context &context); +void findexobject(Context &context); +void makeworn(Context &context); +void isryanholding(Context &context); +void nothelderror(Context &context); +void triggermessage(Context &context); +void monprint(Context &context); +void modifychar(Context &context); +void printchar(Context &context); +void showcurrentfile(Context &context); +void printlogo(Context &context); +void printundermon(Context &context); +void randomaccess(Context &context); +void locklighton(Context &context); +void locklightoff(Context &context); +void makecaps(Context &context); +void monmessage(Context &context); +void scrollmonitor(Context &context); +void searchforstring(Context &context); +void getkeyandlogo(Context &context); +void monitorlogo(Context &context); +void parser(Context &context); +void neterror(Context &context); +void processtrigger(Context &context); +void input(Context &context); +void dirfile(Context &context); +void searchforfiles(Context &context); +void dircom(Context &context); +void signon(Context &context); +void read(Context &context); +void showkeys(Context &context); +void delchar(Context &context); +void randomnum1(Context &context); +void accesslighton(Context &context); +void accesslightoff(Context &context); +void powerlighton(Context &context); +void powerlightoff(Context &context); +void lookininterface(Context &context); +void loadpersonal(Context &context); +void loadnews(Context &context); +void loadcart(Context &context); +void printoutermon(Context &context); +void initialmoncols(Context &context); +void turnonpower(Context &context); +void fadeupyellows(Context &context); +void fadeupmonfirst(Context &context); +void hangoncurs(Context &context); +void execcommand(Context &context); +void purgealocation(Context &context); +void getdestinfo(Context &context); +void showarrows(Context &context); +void locationpic(Context &context); +void getundercentre(Context &context); +void putundercentre(Context &context); +void readcitypic(Context &context); +void showcity(Context &context); +void readdesticon(Context &context); +void loadtraveltext(Context &context); +void convicons(Context &context); +void starttalk(Context &context); +void hangonpq(Context &context); +void redes(Context &context); +void dosometalk(Context &context); +void getpersontext(Context &context); +void getpersframe(Context &context); +void findsource(Context &context); +void printslow(Context &context); +void dolook(Context &context); +void getxad(Context &context); +void getyad(Context &context); +void getmapad(Context &context); +void calcfrframe(Context &context); +void finalframe(Context &context); +void makesprite(Context &context); +void makebackob(Context &context); +void addalong(Context &context); +void addlength(Context &context); +void eraseoldobs(Context &context); +void calcmapad(Context &context); +void doblocks(Context &context); +void showallobs(Context &context); +void showallfree(Context &context); +void showallex(Context &context); +void paneltomap(Context &context); +void deleteexframe(Context &context); +void deleteextext(Context &context); +void deleteexobject(Context &context); +void purgeanitem(Context &context); +void getexpos(Context &context); +void transfermap(Context &context); +void transferinv(Context &context); +void transfertext(Context &context); +void transfercontoex(Context &context); +void emergencypurge(Context &context); +void pickupconts(Context &context); +void findopenpos(Context &context); +void reexfromopen(Context &context); +void geteitherad(Context &context); +void fillopen(Context &context); +void useopened(Context &context); +void getopenedsize(Context &context); +void errormessage3(Context &context); +void errormessage2(Context &context); +void examicon(Context &context); +void outofopen(Context &context); +void swapwithopen(Context &context); +void isitworn(Context &context); +void wornerror(Context &context); +void errormessage1(Context &context); +void checkobjectsize(Context &context); +void openinv(Context &context); +void openob(Context &context); +void droperror(Context &context); +void cantdrop(Context &context); +void reexfrominv(Context &context); +void intoinv(Context &context); +void outofinv(Context &context); +void swapwithinv(Context &context); +void makemainscreen(Context &context); +void searchforsame(Context &context); +void lookatcard(Context &context); +void obsthatdothings(Context &context); +void additionaltext(Context &context); +void findallopen(Context &context); +void obtoinv(Context &context); +void findallryan(Context &context); +void showryanpage(Context &context); +void kernchars(Context &context); +void getnextword(Context &context); +void getnumber(Context &context); +void lockmon(Context &context); +void printboth(Context &context); +void waitframes(Context &context); +void hangone(Context &context); +void allpalette(Context &context); +void fadescreenups(Context &context); +void afterintroroom(Context &context); +void usetimedtext(Context &context); +void loadintroroom(Context &context); +void runintroseq(Context &context); +void realcredits(Context &context); +void runendseq(Context &context); +void showmonk(Context &context); +void monkspeaking(Context &context); +void gettingshot(Context &context); +void biblequote(Context &context); +void intro(Context &context); +void paltostartpal(Context &context); +void paltoendpal(Context &context); +void dumpcurrent(Context &context); +void rollem(Context &context); +void greyscalesum(Context &context); +void endpaltostart(Context &context); +void clearendpal(Context &context); +void rollendcredits2(Context &context); +void clearstartpal(Context &context); +void fadecalculation(Context &context); +void frameoutfx(Context &context); +void frameoutnm(Context &context); +void frameoutbh(Context &context); +void frameoutv(Context &context); +void putunderzoom(Context &context); +void crosshair(Context &context); +void width160(Context &context); +void maptopanel(Context &context); +void movemap(Context &context); +void dealwithspecial(Context &context); +void showreelframe(Context &context); +void soundonreels(Context &context); +void reconstruct(Context &context); +void updatepeople(Context &context); +void watchreel(Context &context); +void showrain(Context &context); +void dodoor(Context &context); +void liftnoise(Context &context); +void widedoor(Context &context); +void random(Context &context); +void lockeddoorway(Context &context); +void liftsprite(Context &context); +void doorway(Context &context); +void constant(Context &context); +void steady(Context &context); +void getblockofpixel(Context &context); +void splitintolines(Context &context); +void adjustleft(Context &context); +void adjustright(Context &context); +void adjustdown(Context &context); +void adjustup(Context &context); +void aboutturn(Context &context); +void checkforexit(Context &context); +void walking(Context &context); +void printasprite(Context &context); +void showgamereel(Context &context); +void checkspeed(Context &context); +void addtopeoplelist(Context &context); +void setuptimedtemp(Context &context); +void madmantext(Context &context); +void madmode(Context &context); +void priesttext(Context &context); +void fadescreenuphalf(Context &context); +void textforend(Context &context); +void fadescreendownhalf(Context &context); +void rollendcredits(Context &context); +void textformonk(Context &context); +void monks2text(Context &context); +void intro2text(Context &context); +void intro3text(Context &context); +void intro1text(Context &context); + +void alleybarksound(Context & context) { context.ax = context.ds.word(context.bx+3); context._sub(context.ax, 1); context._cmp(context.ax, 0); @@ -497,11 +497,11 @@ nobark: return; } -static void intromusic(Context & context) { +void intromusic(Context & context) { return; } -static void foghornsound(Context & context) { +void foghornsound(Context & context) { randomnumber(context); context._cmp(context.al, 198); if (!context.flags.z()) goto nofog; @@ -511,7 +511,7 @@ nofog: return; } -static void receptionist(Context & context) { +void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; context._cmp(context.data.byte(51), 1); @@ -553,7 +553,7 @@ nottalkedrecep: return; } -static void smokebloke(Context & context) { +void smokebloke(Context & context) { context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto notspokento; context.al = context.ds.byte(context.bx+7); @@ -588,7 +588,7 @@ gotsmokeb: return; } -static void attendant(Context & context) { +void attendant(Context & context) { showgamereel(context); addtopeoplelist(context); context.al = context.ds.byte(context.bx+7); @@ -599,7 +599,7 @@ nottalked: return; } -static void manasleep(Context & context) { +void manasleep(Context & context) { context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); context.ds.byte(context.bx+7) = context.al; @@ -608,7 +608,7 @@ static void manasleep(Context & context) { return; } -static void eden(Context & context) { +void eden(Context & context) { context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); @@ -617,7 +617,7 @@ notinbed: return; } -static void edeninbath(Context & context) { +void edeninbath(Context & context) { context._cmp(context.data.byte(41), 0); if (context.flags.z()) goto notinbed; context._cmp(context.data.byte(42), 0); @@ -632,19 +632,19 @@ notinbed: return; } -static void malefan(Context & context) { +void malefan(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void femalefan(Context & context) { +void femalefan(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void louis(Context & context) { +void louis(Context & context) { context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); @@ -653,7 +653,7 @@ notlouis1: return; } -static void louischair(Context & context) { +void louischair(Context & context) { context._cmp(context.data.byte(40), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); @@ -681,7 +681,7 @@ notlouis2: return; } -static void manasleep2(Context & context) { +void manasleep2(Context & context) { context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); context.ds.byte(context.bx+7) = context.al; @@ -690,19 +690,19 @@ static void manasleep2(Context & context) { return; } -static void mansatstill(Context & context) { +void mansatstill(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void tattooman(Context & context) { +void tattooman(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void drinker(Context & context) { +void drinker(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotdrinker; context._add(context.ds.word(context.bx+3), 1); @@ -723,7 +723,7 @@ gotdrinker: return; } -static void bartender(Context & context) { +void bartender(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotsmoket; context._cmp(context.ds.word(context.bx+3), 86); @@ -750,19 +750,19 @@ notgotgun: return; } -static void othersmoker(Context & context) { +void othersmoker(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void barwoman(Context & context) { +void barwoman(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void interviewer(Context & context) { +void interviewer(Context & context) { context._cmp(context.data.word(21), 68); if (!context.flags.z()) goto notgeneralstart; context._add(context.ds.word(context.bx+3), 1); @@ -779,7 +779,7 @@ talking: return; } -static void soldier1(Context & context) { +void soldier1(Context & context) { context._cmp(context.ds.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; context.data.word(19) = 10; @@ -812,7 +812,7 @@ gotsoldframe: return; } -static void rockstar(Context & context) { +void rockstar(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; @@ -863,7 +863,7 @@ rockcombatend: return; } -static void helicopter(Context & context) { +void helicopter(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; @@ -920,7 +920,7 @@ heliwon: return; } -static void mugger(Context & context) { +void mugger(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; @@ -993,13 +993,13 @@ endmugger2: return; } -static void aide(Context & context) { +void aide(Context & context) { showgamereel(context); addtopeoplelist(context); return; } -static void businessman(Context & context) { +void businessman(Context & context) { context.data.byte(233) = 0; context.data.word(19) = 2; context.ax = context.ds.word(context.bx+3); @@ -1088,7 +1088,7 @@ buscombatwonend: return; } -static void poolguard(Context & context) { +void poolguard(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; @@ -1172,7 +1172,7 @@ doneover2: return; } -static void security(Context & context) { +void security(Context & context) { context._cmp(context.ds.word(context.bx+3), 32); if (context.flags.z()) goto securwait; context._cmp(context.ds.word(context.bx+3), 69); @@ -1200,7 +1200,7 @@ gotsecurframe: return; } -static void heavy(Context & context) { +void heavy(Context & context) { context.al = context.ds.byte(context.bx+7); context._and(context.al, 127); context.ds.byte(context.bx+7) = context.al; @@ -1235,7 +1235,7 @@ gotheavyframe: return; } -static void bossman(Context & context) { +void bossman(Context & context) { checkspeed(context); if (!context.flags.z()) goto notboss; context.ax = context.ds.word(context.bx+3); @@ -1278,7 +1278,7 @@ nottalkedboss: return; } -static void gamer(Context & context) { +void gamer(Context & context) { checkspeed(context); if (!context.flags.z()) goto gamerfin; gameragain: @@ -1297,7 +1297,7 @@ gamerfin: return; } -static void sparkydrip(Context & context) { +void sparkydrip(Context & context) { checkspeed(context); if (!context.flags.z()) goto cantdrip; context.al = 14; @@ -1307,7 +1307,7 @@ cantdrip: return; } -static void carparkdrip(Context & context) { +void carparkdrip(Context & context) { checkspeed(context); if (!context.flags.z()) goto cantdrip2; context.al = 14; @@ -1316,7 +1316,7 @@ cantdrip2: return; } -static void keeper(Context & context) { +void keeper(Context & context) { context._cmp(context.data.byte(53), 0); if (!context.flags.z()) goto notwaiting; context._cmp(context.data.word(21), 190); @@ -1337,7 +1337,7 @@ waiting: return; } -static void candles1(Context & context) { +void candles1(Context & context) { checkspeed(context); if (!context.flags.z()) goto candle1; context.ax = context.ds.word(context.bx+3); @@ -1352,7 +1352,7 @@ candle1: return; } -static void smallcandle(Context & context) { +void smallcandle(Context & context) { checkspeed(context); if (!context.flags.z()) goto smallcandlef; context.ax = context.ds.word(context.bx+3); @@ -1367,7 +1367,7 @@ smallcandlef: return; } -static void intromagic1(Context & context) { +void intromagic1(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm1fin; context.ax = context.ds.word(context.bx+3); @@ -1394,7 +1394,7 @@ introm1fin: return; } -static void candles(Context & context) { +void candles(Context & context) { checkspeed(context); if (!context.flags.z()) goto candlesfin; context.ax = context.ds.word(context.bx+3); @@ -1409,7 +1409,7 @@ candlesfin: return; } -static void candles2(Context & context) { +void candles2(Context & context) { checkspeed(context); if (!context.flags.z()) goto candles2fin; context.ax = context.ds.word(context.bx+3); @@ -1424,7 +1424,7 @@ candles2fin: return; } -static void gates(Context & context) { +void gates(Context & context) { checkspeed(context); if (!context.flags.z()) goto gatesfin; context.ax = context.ds.word(context.bx+3); @@ -1460,7 +1460,7 @@ gatesfin: return; } -static void intromagic2(Context & context) { +void intromagic2(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm2fin; context.ax = context.ds.word(context.bx+3); @@ -1475,7 +1475,7 @@ introm2fin: return; } -static void intromagic3(Context & context) { +void intromagic3(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm3fin; context.ax = context.ds.word(context.bx+3); @@ -1492,7 +1492,7 @@ introm3fin: return; } -static void intromonks1(Context & context) { +void intromonks1(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk1fin; context.ax = context.ds.word(context.bx+3); @@ -1536,7 +1536,7 @@ intromonk1fin: return; } -static void intromonks2(Context & context) { +void intromonks2(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk2fin; context.ax = context.ds.word(context.bx+3); @@ -1588,11 +1588,11 @@ intromonk2fin: return; } -static void handclap(Context & context) { +void handclap(Context & context) { return; } -static void monks2text(Context & context) { +void monks2text(Context & context) { context._cmp(context.data.byte(138), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; @@ -1692,7 +1692,7 @@ gotmonks2text: return; } -static void intro1text(Context & context) { +void intro1text(Context & context) { context._cmp(context.data.byte(138), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; @@ -1726,7 +1726,7 @@ oktalk2: return; } -static void intro2text(Context & context) { +void intro2text(Context & context) { context._cmp(context.ax, 5); if (!context.flags.z()) goto notintro2text1; context.al = 43; @@ -1751,7 +1751,7 @@ gotintro2text: return; } -static void intro3text(Context & context) { +void intro3text(Context & context) { context._cmp(context.ax, 107); if (!context.flags.z()) goto notintro3text1; context.al = 45; @@ -1776,7 +1776,7 @@ gotintro3text: return; } -static void monkandryan(Context & context) { +void monkandryan(Context & context) { checkspeed(context); if (!context.flags.z()) goto notmonkryan; context.ax = context.ds.word(context.bx+3); @@ -1801,7 +1801,7 @@ notmonkryan: return; } -static void endgameseq(Context & context) { +void endgameseq(Context & context) { checkspeed(context); if (!context.flags.z()) goto notendseq; context.ax = context.ds.word(context.bx+3); @@ -1858,7 +1858,7 @@ notendcreds: return; } -static void rollendcredits(Context & context) { +void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); @@ -1946,7 +1946,7 @@ gotnext: return; } -static void priest(Context & context) { +void priest(Context & context) { context._cmp(context.ds.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; context.data.byte(233) = 0; @@ -1965,7 +1965,7 @@ priestspoken: return; } -static void madmanstelly(Context & context) { +void madmanstelly(Context & context) { context.ax = context.ds.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 307); @@ -1977,7 +1977,7 @@ notendtelly: return; } -static void madman(Context & context) { +void madman(Context & context) { context.data.word(19) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; @@ -2047,7 +2047,7 @@ ryansded: return; } -static void madmantext(Context & context) { +void madmantext(Context & context) { context._cmp(context.data.byte(63), 61); if (!context.flags.c()) goto nomadtext; context.al = context.data.byte(63); @@ -2067,7 +2067,7 @@ nomadtext: return; } -static void madmode(Context & context) { +void madmode(Context & context) { context.data.word(19) = 2; context.data.byte(233) = 0; context._cmp(context.data.byte(63), 63); @@ -2079,7 +2079,7 @@ iswatchmad: return; } -static void priesttext(Context & context) { +void priesttext(Context & context) { context._cmp(context.ds.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; context._cmp(context.ds.word(context.bx+3), 7); @@ -2099,7 +2099,7 @@ nopriesttext: return; } -static void textforend(Context & context) { +void textforend(Context & context) { context._cmp(context.data.byte(138), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; @@ -2132,7 +2132,7 @@ gotendtext: return; } -static void textformonk(Context & context) { +void textformonk(Context & context) { context._cmp(context.data.byte(138), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; @@ -2250,7 +2250,7 @@ oktalk: return; } -static void drunk(Context & context) { +void drunk(Context & context) { context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto trampgone; context.al = context.ds.byte(context.bx+7); @@ -2262,7 +2262,7 @@ trampgone: return; } -static void advisor(Context & context) { +void advisor(Context & context) { checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; @@ -2290,7 +2290,7 @@ noadvisor: return; } -static void copper(Context & context) { +void copper(Context & context) { checkspeed(context); if (!context.flags.z()) goto nocopper; context.ax = context.ds.word(context.bx+3); @@ -2320,7 +2320,7 @@ nocopper: return; } -static void sparky(Context & context) { +void sparky(Context & context) { context._cmp(context.data.word(14), 0); if (context.flags.z()) goto animsparky; context.ds.byte(context.bx+7) = 3; @@ -2353,7 +2353,7 @@ nottalkedsparky: return; } -static void train(Context & context) { +void train(Context & context) { return; context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 21); @@ -2376,7 +2376,7 @@ notrainatall: return; } -static void addtopeoplelist(Context & context) { +void addtopeoplelist(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.bx); @@ -2394,7 +2394,7 @@ static void addtopeoplelist(Context & context) { return; } -static void showgamereel(Context & context) { +void showgamereel(Context & context) { context.ax = context.ds.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; @@ -2410,7 +2410,7 @@ noshow: return; } -static void checkspeed(Context & context) { +void checkspeed(Context & context) { context._cmp(context.data.byte(64), -1); if (!context.flags.z()) goto forcenext; context._add(context.ds.byte(context.bx+6), 1); @@ -2427,7 +2427,7 @@ forcenext: return; } -static void clearsprites(Context & context) { +void clearsprites(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = 255; @@ -2436,7 +2436,7 @@ static void clearsprites(Context & context) { return; } -static void makesprite(Context & context) { +void makesprite(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: @@ -2455,7 +2455,7 @@ _tmp17a: return; } -static void delsprite(Context & context) { +void delsprite(Context & context) { context.di = context.bx; context.cx = 32; context.al = 255; @@ -2463,7 +2463,7 @@ static void delsprite(Context & context) { return; } -static void spriteupdate(Context & context) { +void spriteupdate(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = context.data.byte(62); @@ -2495,7 +2495,7 @@ _tmp18b: return; } -static void printsprites(Context & context) { +void printsprites(Context & context) { context.es = context.data.word(410); context.cx = 0; priorityloop: @@ -2527,7 +2527,7 @@ skipsprite: return; } -static void printasprite(Context & context) { +void printasprite(Context & context) { context.push(context.es); context.push(context.bx); context.si = context.bx; @@ -2563,7 +2563,7 @@ notquickp: return; } -static void checkone(Context & context) { +void checkone(Context & context) { context.push(context.cx); context.al = context.ch; context.ah = 0; @@ -2598,7 +2598,7 @@ static void checkone(Context & context) { return; } -static void findsource(Context & context) { +void findsource(Context & context) { context.ax = context.data.word(158); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; @@ -2617,7 +2617,7 @@ over1001: return; } -static void initman(Context & context) { +void initman(Context & context) { context.al = context.data.byte(150); context.ah = context.data.byte(151); context.si = context.ax; @@ -2631,7 +2631,7 @@ static void initman(Context & context) { return; } -static void mainman(Context & context) { +void mainman(Context & context) { context._cmp(context.data.byte(186), 1); if (!context.flags.z()) goto notinnewroom; context.data.byte(186) = 0; @@ -2714,7 +2714,7 @@ notwalk: return; } -static void aboutturn(Context & context) { +void aboutturn(Context & context) { context._cmp(context.data.byte(135), 1); if (context.flags.z()) goto incdir; context._cmp(context.data.byte(135), -1); @@ -2748,7 +2748,7 @@ decdir: return; } -static void walking(Context & context) { +void walking(Context & context) { context._cmp(context.data.byte(492), 0); if (context.flags.z()) goto normalwalk; context.al = context.data.byte(491); @@ -2797,7 +2797,7 @@ finishedwalk: return; } -static void facerightway(Context & context) { +void facerightway(Context & context) { context.push(context.es); context.push(context.bx); getroomspaths(context); @@ -2815,7 +2815,7 @@ static void facerightway(Context & context) { return; } -static void checkforexit(Context & context) { +void checkforexit(Context & context) { context.cl = context.data.byte(150); context._add(context.cl, 12); context.ch = context.data.byte(151); @@ -2907,7 +2907,7 @@ notanup: return; } -static void adjustdown(Context & context) { +void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); context._add(context.data.byte(148), 10); @@ -2921,7 +2921,7 @@ static void adjustdown(Context & context) { return; } -static void adjustup(Context & context) { +void adjustup(Context & context) { context.push(context.es); context.push(context.bx); context._sub(context.data.byte(148), 10); @@ -2935,7 +2935,7 @@ static void adjustup(Context & context) { return; } -static void adjustleft(Context & context) { +void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); context.data.byte(152) = 0; @@ -2950,7 +2950,7 @@ static void adjustleft(Context & context) { return; } -static void adjustright(Context & context) { +void adjustright(Context & context) { context.push(context.es); context.push(context.bx); context._add(context.data.byte(147), 11); @@ -2965,7 +2965,7 @@ static void adjustright(Context & context) { return; } -static void reminders(Context & context) { +void reminders(Context & context) { context._cmp(context.data.byte(183), 24); if (!context.flags.z()) goto notinedenslift; context._cmp(context.data.byte(147), 44); @@ -3013,7 +3013,7 @@ notinedenslift: return; } -static void initrain(Context & context) { +void initrain(Context & context) { context.es = context.data.word(410); context.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); context.bx = 1113; @@ -3072,7 +3072,7 @@ finishinitrain: return; } -static void splitintolines(Context & context) { +void splitintolines(Context & context) { lookforlinestart: getblockofpixel(context); context._cmp(context.al, 0); @@ -3121,7 +3121,7 @@ endofthisline: return; } -static void getblockofpixel(Context & context) { +void getblockofpixel(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.di); @@ -3144,7 +3144,7 @@ failrain: return; } -static void showrain(Context & context) { +void showrain(Context & context) { context.ds = context.data.word(412); context.si = 6*58; context.ax = context.ds.word(context.si+2); @@ -3221,7 +3221,7 @@ nothunder: return; } -static void backobject(Context & context) { +void backobject(Context & context) { context.ds = context.data.word(426); context.di = context.ds.word(context.bx+20); context.al = context.ds.byte(context.bx+18); @@ -3269,7 +3269,7 @@ finishback: return; } -static void liftsprite(Context & context) { +void liftsprite(Context & context) { context.al = context.data.byte(34); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; @@ -3349,7 +3349,7 @@ nocountopen: goto pokelift; } -static void liftnoise(Context & context) { +void liftnoise(Context & context) { context._cmp(context.data.byte(183), 5); if (context.flags.z()) goto hissnoise; context._cmp(context.data.byte(183), 21); @@ -3362,7 +3362,7 @@ hissnoise: return; } -static void random(Context & context) { +void random(Context & context) { randomnum1(context); context.push(context.di); context._and(context.ax, 7); @@ -3374,14 +3374,14 @@ static void random(Context & context) { return; } -static void steady(Context & context) { +void steady(Context & context) { context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; context.ds.byte(context.bx+15) = context.al; return; } -static void constant(Context & context) { +void constant(Context & context) { context._add(context.ds.byte(context.bx+19), 1); context.cl = context.ds.byte(context.bx+19); context.ch = 0; @@ -3399,7 +3399,7 @@ gotconst: return; } -static void doorway(Context & context) { +void doorway(Context & context) { context.data.byte(192) = -24; context.data.byte(193) = 10; context.data.byte(194) = -30; @@ -3408,7 +3408,7 @@ static void doorway(Context & context) { return; } -static void widedoor(Context & context) { +void widedoor(Context & context) { context.data.byte(192) = -24; context.data.byte(193) = 24; context.data.byte(194) = -30; @@ -3417,7 +3417,7 @@ static void widedoor(Context & context) { return; } -static void dodoor(Context & context) { +void dodoor(Context & context) { context.al = context.data.byte(150); context.ah = context.data.byte(151); context.cl = context.ds.byte(context.bx+10); @@ -3507,7 +3507,7 @@ notnearly: return; } -static void lockeddoorway(Context & context) { +void lockeddoorway(Context & context) { context.al = context.data.byte(150); context.ah = context.data.byte(151); context.cl = context.ds.byte(context.bx+10); @@ -3644,7 +3644,7 @@ notnearly: return; } -static void updatepeople(Context & context) { +void updatepeople(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.data.word(16) = context.di; @@ -3678,7 +3678,7 @@ endupdate: return; } -static void getreelframeax(Context & context) { +void getreelframeax(Context & context) { context.push(context.ds); context.data.word(158) = context.ax; findsource(context); @@ -3694,7 +3694,7 @@ static void getreelframeax(Context & context) { return; } -static void reelsonscreen(Context & context) { +void reelsonscreen(Context & context) { reconstruct(context); updatepeople(context); watchreel(context); @@ -3703,7 +3703,7 @@ static void reelsonscreen(Context & context) { return; } -static void plotreel(Context & context) { +void plotreel(Context & context) { getreelstart(context); retryreel: context.push(context.es); @@ -3741,7 +3741,7 @@ notplot: return; } -static void soundonreels(Context & context) { +void soundonreels(Context & context) { context.bl = context.data.byte(183); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); @@ -3781,7 +3781,7 @@ nochange2: return; } -static void reconstruct(Context & context) { +void reconstruct(Context & context) { context._cmp(context.data.byte(129), 0); if (context.flags.z()) goto noneedtorecon; context.data.byte(61) = 1; @@ -3797,7 +3797,7 @@ noneedtorecon: return; } -static void dealwithspecial(Context & context) { +void dealwithspecial(Context & context) { context._sub(context.al, 220); context._cmp(context.al, 0); if (!context.flags.z()) goto notplset; @@ -3848,7 +3848,7 @@ notchangeloc: return; } -static void movemap(Context & context) { +void movemap(Context & context) { context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; context._sub(context.data.byte(148), 20); @@ -3878,7 +3878,7 @@ notmaprightspec: return; } -static void getreelstart(Context & context) { +void getreelstart(Context & context) { context.ax = context.data.word(237); context.cx = 40; context._mul(context.cx); @@ -3888,7 +3888,7 @@ static void getreelstart(Context & context) { return; } -static void showreelframe(Context & context) { +void showreelframe(Context & context) { context.al = context.ds.byte(context.si+2); context.ah = 0; context.di = context.ax; @@ -3906,7 +3906,7 @@ static void showreelframe(Context & context) { return; } -static void deleverything(Context & context) { +void deleverything(Context & context) { context.al = context.data.byte(128); context.ah = 0; context._add(context.ax, context.data.word(121)); @@ -3921,7 +3921,7 @@ bigroom: return; } -static void dumpeverything(Context & context) { +void dumpeverything(Context & context) { context.es = context.data.word(410); context.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); dumpevery1: @@ -3976,14 +3976,14 @@ finishevery2: return; } -static void allocatework(Context & context) { +void allocatework(Context & context) { context.bx = 0x1000; allocatemem(context); context.data.word(398) = context.ax; return; } -static void readabyte(Context & context) { +void readabyte(Context & context) { context._cmp(context.si, 30000); if (!context.flags.z()) goto notendblock; context.push(context.bx); @@ -4003,7 +4003,7 @@ notendblock: return; } -static void loadpalfromiff(Context & context) { +void loadpalfromiff(Context & context) { context.dx = 2481; openfile(context); context.cx = 2000; @@ -4038,7 +4038,7 @@ nought: return; } -static void cls(Context & context) { +void cls(Context & context) { context.ax = 0x0a000; context.es = context.ax; context.di = 0; @@ -4048,7 +4048,7 @@ static void cls(Context & context) { return; } -static void printundermon(Context & context) { +void printundermon(Context & context) { context.si = (320*43)+76; context.di = context.si; context.es = context.data.word(398); @@ -4082,7 +4082,7 @@ finmonscroll: return; } -static void worktoscreen(Context & context) { +void worktoscreen(Context & context) { vsync(context); context.si = 0; context.di = 0; @@ -4103,7 +4103,7 @@ dumpallloop: return; } -static void paneltomap(Context & context) { +void paneltomap(Context & context) { context.di = context.data.word(123); context._add(context.di, context.data.word(115)); context.bx = context.data.word(125); @@ -4116,7 +4116,7 @@ static void paneltomap(Context & context) { return; } -static void maptopanel(Context & context) { +void maptopanel(Context & context) { context.di = context.data.word(123); context._add(context.di, context.data.word(115)); context.bx = context.data.word(125); @@ -4129,7 +4129,7 @@ static void maptopanel(Context & context) { return; } -static void dumpmap(Context & context) { +void dumpmap(Context & context) { context.di = context.data.word(123); context._add(context.di, context.data.word(115)); context.bx = context.data.word(125); @@ -4140,7 +4140,7 @@ static void dumpmap(Context & context) { return; } -static void pixelcheckset(Context & context) { +void pixelcheckset(Context & context) { context.push(context.ax); context._sub(context.al, context.ds.byte(context.bx)); context._sub(context.ah, context.ds.byte(context.bx+1)); @@ -4180,7 +4180,7 @@ static void pixelcheckset(Context & context) { return; } -static void createpanel(Context & context) { +void createpanel(Context & context) { context.di = 0; context.bx = 8; context.ds = context.data.word(408); @@ -4208,7 +4208,7 @@ static void createpanel(Context & context) { return; } -static void createpanel2(Context & context) { +void createpanel2(Context & context) { createpanel(context); context.di = 0; context.bx = 0; @@ -4225,7 +4225,7 @@ static void createpanel2(Context & context) { return; } -static void clearwork(Context & context) { +void clearwork(Context & context) { context.ax = 0x0; context.es = context.data.word(398); context.di = 0; @@ -4267,7 +4267,7 @@ clearloop: return; } -static void zoom(Context & context) { +void zoom(Context & context) { context._cmp(context.data.word(19), 0); if (!context.flags.z()) goto inwatching; context._cmp(context.data.byte(7), 1); @@ -4314,7 +4314,7 @@ zoomloop2: return; } -static void delthisone(Context & context) { +void delthisone(Context & context) { context.push(context.ax); context.push(context.ax); context.al = context.ah; @@ -4357,7 +4357,7 @@ deloneloop: return; } -static void multiget(Context & context) { +void multiget(Context & context) { context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4401,7 +4401,7 @@ multiloop4: return; } -static void multiput(Context & context) { +void multiput(Context & context) { context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4442,7 +4442,7 @@ multiloop6: return; } -static void multidump(Context & context) { +void multidump(Context & context) { context.dx = 0x0a000; context.es = context.dx; context.ds = context.data.word(398); @@ -4493,7 +4493,7 @@ multiloop2: return; } -static void width160(Context & context) { +void width160(Context & context) { context._movsw(); context._movsw(); context._movsw(); @@ -4726,7 +4726,7 @@ static void width160(Context & context) { return; } -static void doblocks(Context & context) { +void doblocks(Context & context) { context.es = context.data.word(398); context.ax = context.data.word(117); context.cx = 320; @@ -4841,7 +4841,7 @@ zeroblock: return; } -static void showframe(Context & context) { +void showframe(Context & context) { context.push(context.dx); context.push(context.ax); context.cx = context.ax; @@ -4938,7 +4938,7 @@ noeffects: return; } -static void frameoutv(Context & context) { +void frameoutv(Context & context) { context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4978,7 +4978,7 @@ backtosolid: return; } -static void frameoutnm(Context & context) { +void frameoutnm(Context & context) { context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -5020,7 +5020,7 @@ nmloop2: return; } -static void frameoutbh(Context & context) { +void frameoutbh(Context & context) { context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -5053,7 +5053,7 @@ nextline: return; } -static void frameoutfx(Context & context) { +void frameoutfx(Context & context) { context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -5094,7 +5094,7 @@ backtosolidfx: return; } -static void transferinv(Context & context) { +void transferinv(Context & context) { context.di = context.data.word(10); context.push(context.di); context.al = context.data.byte(9); @@ -5143,7 +5143,7 @@ static void transferinv(Context & context) { return; } -static void transfermap(Context & context) { +void transfermap(Context & context) { context.di = context.data.word(10); context.push(context.di); context.al = context.data.byte(9); @@ -5190,7 +5190,7 @@ static void transfermap(Context & context) { return; } -static void dofade(Context & context) { +void dofade(Context & context) { context._cmp(context.data.byte(343), 0); if (context.flags.z()) goto finishfade; context.cl = context.data.byte(344); @@ -5213,7 +5213,7 @@ finishfade: return; } -static void clearendpal(Context & context) { +void clearendpal(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; @@ -5222,14 +5222,14 @@ static void clearendpal(Context & context) { return; } -static void clearpalette(Context & context) { +void clearpalette(Context & context) { context.data.byte(343) = 0; clearstartpal(context); dumpcurrent(context); return; } -static void fadescreenup(Context & context) { +void fadescreenup(Context & context) { clearstartpal(context); paltoendpal(context); context.data.byte(343) = 1; @@ -5239,7 +5239,7 @@ static void fadescreenup(Context & context) { return; } -static void fadetowhite(Context & context) { +void fadetowhite(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; @@ -5258,7 +5258,7 @@ static void fadetowhite(Context & context) { return; } -static void fadefromwhite(Context & context) { +void fadefromwhite(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768; @@ -5277,7 +5277,7 @@ static void fadefromwhite(Context & context) { return; } -static void fadescreenups(Context & context) { +void fadescreenups(Context & context) { clearstartpal(context); paltoendpal(context); context.data.byte(343) = 1; @@ -5287,7 +5287,7 @@ static void fadescreenups(Context & context) { return; } -static void fadescreendownhalf(Context & context) { +void fadescreendownhalf(Context & context) { paltostartpal(context); paltoendpal(context); context.cx = 768; @@ -5316,7 +5316,7 @@ halfend: return; } -static void fadescreenuphalf(Context & context) { +void fadescreenuphalf(Context & context) { endpaltostart(context); paltoendpal(context); context.data.byte(343) = 1; @@ -5326,7 +5326,7 @@ static void fadescreenuphalf(Context & context) { return; } -static void fadescreendown(Context & context) { +void fadescreendown(Context & context) { paltostartpal(context); clearendpal(context); context.data.byte(343) = 1; @@ -5336,7 +5336,7 @@ static void fadescreendown(Context & context) { return; } -static void fadescreendowns(Context & context) { +void fadescreendowns(Context & context) { paltostartpal(context); clearendpal(context); context.data.byte(343) = 1; @@ -5346,7 +5346,7 @@ static void fadescreendowns(Context & context) { return; } -static void clearstartpal(Context & context) { +void clearstartpal(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 256; @@ -5359,7 +5359,7 @@ wholeloop1: return; } -static void showgun(Context & context) { +void showgun(Context & context) { context.data.byte(347) = 0; context.data.byte(346) = 0; context.data.byte(348) = 0; @@ -5413,12 +5413,12 @@ static void showgun(Context & context) { return; } -static void rollendcredits2(Context & context) { +void rollendcredits2(Context & context) { rollem(context); return; } -static void rollem(Context & context) { +void rollem(Context & context) { context.cl = 160; context.ch = 160; context.di = 25; @@ -5506,7 +5506,7 @@ endearly: return; } -static void fadecalculation(Context & context) { +void fadecalculation(Context & context) { context._cmp(context.data.byte(345), 0); if (context.flags.z()) goto nomorefading; context.bl = context.data.byte(345); @@ -5539,7 +5539,7 @@ nomorefading: return; } -static void greyscalesum(Context & context) { +void greyscalesum(Context & context) { context.es = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; @@ -5594,7 +5594,7 @@ noaddb: return; } -static void paltostartpal(Context & context) { +void paltostartpal(Context & context) { context.es = context.data.word(410); context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; @@ -5604,7 +5604,7 @@ static void paltostartpal(Context & context) { return; } -static void endpaltostart(Context & context) { +void endpaltostart(Context & context) { context.es = context.data.word(410); context.ds = context.data.word(410); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; @@ -5614,7 +5614,7 @@ static void endpaltostart(Context & context) { return; } -static void startpaltoend(Context & context) { +void startpaltoend(Context & context) { context.es = context.data.word(410); context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; @@ -5624,7 +5624,7 @@ static void startpaltoend(Context & context) { return; } -static void paltoendpal(Context & context) { +void paltoendpal(Context & context) { context.es = context.data.word(410); context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; @@ -5634,7 +5634,7 @@ static void paltoendpal(Context & context) { return; } -static void allpalette(Context & context) { +void allpalette(Context & context) { context.es = context.data.word(410); context.ds = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); @@ -5645,7 +5645,7 @@ static void allpalette(Context & context) { return; } -static void dumpcurrent(Context & context) { +void dumpcurrent(Context & context) { context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.ds = context.data.word(410); vsync(context); @@ -5659,7 +5659,7 @@ static void dumpcurrent(Context & context) { return; } -static void fadedownmon(Context & context) { +void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(410); @@ -5679,7 +5679,7 @@ static void fadedownmon(Context & context) { return; } -static void fadeupmon(Context & context) { +void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(410); @@ -5699,7 +5699,7 @@ static void fadeupmon(Context & context) { return; } -static void fadeupmonfirst(Context & context) { +void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(410); @@ -5723,7 +5723,7 @@ static void fadeupmonfirst(Context & context) { return; } -static void fadeupyellows(Context & context) { +void fadeupyellows(Context & context) { paltoendpal(context); context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); @@ -5742,7 +5742,7 @@ static void fadeupyellows(Context & context) { return; } -static void initialmoncols(Context & context) { +void initialmoncols(Context & context) { paltostartpal(context); context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); @@ -5760,14 +5760,14 @@ static void initialmoncols(Context & context) { return; } -static void titles(Context & context) { +void titles(Context & context) { clearpalette(context); biblequote(context); intro(context); return; } -static void endgame(Context & context) { +void endgame(Context & context) { context.dx = 2260; loadtemptext(context); monkspeaking(context); @@ -5780,7 +5780,7 @@ static void endgame(Context & context) { return; } -static void monkspeaking(Context & context) { +void monkspeaking(Context & context) { context.data.byte(530) = 35; loadroomssample(context); context.dx = 2364; @@ -5838,7 +5838,7 @@ nextbit: return; } -static void showmonk(Context & context) { +void showmonk(Context & context) { context.al = 0; context.ah = 128; context.di = 160; @@ -5848,7 +5848,7 @@ static void showmonk(Context & context) { return; } -static void gettingshot(Context & context) { +void gettingshot(Context & context) { context.data.byte(187) = 55; clearpalette(context); loadintroroom(context); @@ -5860,13 +5860,13 @@ static void gettingshot(Context & context) { return; } -static void credits(Context & context) { +void credits(Context & context) { clearpalette(context); realcredits(context); return; } -static void biblequote(Context & context) { +void biblequote(Context & context) { mode640x480(context); context.dx = 2377; showpcx(context); @@ -5882,7 +5882,7 @@ static void biblequote(Context & context) { return; } -static void hangone(Context & context) { +void hangone(Context & context) { hangonloope: context.push(context.cx); vsync(context); @@ -5897,7 +5897,7 @@ hangonearly: return; } -static void intro(Context & context) { +void intro(Context & context) { context.dx = 2247; loadtemptext(context); loadpalfromiff(context); @@ -5931,7 +5931,7 @@ static void intro(Context & context) { return; } -static void runintroseq(Context & context) { +void runintroseq(Context & context) { context.data.byte(102) = 0; moreintroseq: vsync(context); @@ -5965,7 +5965,7 @@ earlyendrun: return; } -static void runendseq(Context & context) { +void runendseq(Context & context) { atmospheres(context); context.data.byte(102) = 0; moreendseq: @@ -5986,7 +5986,7 @@ moreendseq: return; } -static void loadintroroom(Context & context) { +void loadintroroom(Context & context) { context.data.byte(138) = 0; context.data.byte(8) = 255; loadroom(context); @@ -6006,7 +6006,7 @@ static void loadintroroom(Context & context) { return; } -static void realcredits(Context & context) { +void realcredits(Context & context) { context.data.byte(530) = 33; loadroomssample(context); context.data.byte(385) = 0; @@ -6094,7 +6094,7 @@ static void realcredits(Context & context) { return; } -static void printchar(Context & context) { +void printchar(Context & context) { context._cmp(context.al, 255); if (context.flags.z()) goto ignoreit; context.push(context.si); @@ -6122,7 +6122,7 @@ ignoreit: return; } -static void kernchars(Context & context) { +void kernchars(Context & context) { context._cmp(context.al, 'a'); if (context.flags.z()) goto iskern; context._cmp(context.al, 'u'); @@ -6145,7 +6145,7 @@ kernit: return; } -static void printslow(Context & context) { +void printslow(Context & context) { context.data.byte(230) = 1; context.data.byte(233) = 3; context.ds = context.data.word(402); @@ -6239,7 +6239,7 @@ finishslow2: return; } -static void waitframes(Context & context) { +void waitframes(Context & context) { context.push(context.di); context.push(context.bx); context.push(context.es); @@ -6259,7 +6259,7 @@ static void waitframes(Context & context) { return; } -static void printboth(Context & context) { +void printboth(Context & context) { context.push(context.ax); context.push(context.cx); context.push(context.bx); @@ -6276,7 +6276,7 @@ static void printboth(Context & context) { return; } -static void printdirect(Context & context) { +void printdirect(Context & context) { context.data.word(82) = context.di; context.ds = context.data.word(266); printloop6: @@ -6312,7 +6312,7 @@ finishdirct: return; } -static void monprint(Context & context) { +void monprint(Context & context) { context.data.byte(71) = 1; context.si = context.bx; context.dl = 166; @@ -6391,7 +6391,7 @@ nottrigger2: return; } -static void getnumber(Context & context) { +void getnumber(Context & context) { context.cx = 0; context.push(context.si); context.push(context.bx); @@ -6494,7 +6494,7 @@ notcent2: return; } -static void getnextword(Context & context) { +void getnextword(Context & context) { context.bx = 0; getloop: context.ax = context.ds.word(context.di); @@ -6532,7 +6532,7 @@ endall: return; } -static void modifychar(Context & context) { +void modifychar(Context & context) { context._cmp(context.al, 128); if (context.flags.c()) goto nomod; context._cmp(context.al, 160); @@ -6589,7 +6589,7 @@ nomod: return; } -static void fillryan(Context & context) { +void fillryan(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32; findallryan(context); @@ -6632,7 +6632,7 @@ ryanloop1: return; } -static void fillopen(Context & context) { +void fillopen(Context & context) { deltextline(context); getopenedsize(context); context._cmp(context.ah, 4); @@ -6673,7 +6673,7 @@ nextopenslot: return; } -static void findallryan(Context & context) { +void findallryan(Context & context) { context.push(context.di); context.cx = 30; context.ax = 0x0ffff; @@ -6705,7 +6705,7 @@ notinryaninv: return; } -static void findallopen(Context & context) { +void findallopen(Context & context) { context.push(context.di); context.cx = 16; context.ax = 0x0ffff; @@ -6770,7 +6770,7 @@ findopen2a: return; } -static void obtoinv(Context & context) { +void obtoinv(Context & context) { context.push(context.bx); context.push(context.es); context.push(context.si); @@ -6827,7 +6827,7 @@ finishfill: return; } -static void isitworn(Context & context) { +void isitworn(Context & context) { context.al = context.ds.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) goto notworn; @@ -6837,13 +6837,13 @@ notworn: return; } -static void makeworn(Context & context) { +void makeworn(Context & context) { context.ds.byte(context.bx+12) = 'W'-'A'; context.ds.byte(context.bx+13) = 'E'-'A'; return; } -static void examineob(Context & context) { +void examineob(Context & context) { context.data.byte(233) = 0; context.data.word(326) = 0; examineagain: @@ -6908,7 +6908,7 @@ justgetback: return; } -static void makemainscreen(Context & context) { +void makemainscreen(Context & context) { createpanel(context); context.data.byte(61) = 1; drawfloor(context); @@ -6926,7 +6926,7 @@ static void makemainscreen(Context & context) { return; } -static void getbackfromob(Context & context) { +void getbackfromob(Context & context) { context._cmp(context.data.byte(105), 1); if (!context.flags.z()) goto notheldob; blank(context); @@ -6936,7 +6936,7 @@ notheldob: return; } -static void incryanpage(Context & context) { +void incryanpage(Context & context) { context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyincryan; context.data.byte(99) = 222; @@ -6967,7 +6967,7 @@ findnewpage: return; } -static void openinv(Context & context) { +void openinv(Context & context) { context.data.byte(103) = 1; context.al = 61; context.di = 80; @@ -6979,7 +6979,7 @@ static void openinv(Context & context) { return; } -static void showryanpage(Context & context) { +void showryanpage(Context & context) { context.ds = context.data.word(406); context.di = 80+167; context.bx = 58-12; @@ -7003,7 +7003,7 @@ static void showryanpage(Context & context) { return; } -static void openob(Context & context) { +void openob(Context & context) { context.al = context.data.byte(109); context.ah = context.data.byte(110); context.di = 5674; @@ -7034,7 +7034,7 @@ static void openob(Context & context) { return; } -static void obicons(Context & context) { +void obicons(Context & context) { context.al = context.data.byte(98); getanyad(context); context._cmp(context.al, 255); @@ -7055,7 +7055,7 @@ cantopenit: return; } -static void examicon(Context & context) { +void examicon(Context & context) { context.ds = context.data.word(408); context.di = 254; context.bx = 5; @@ -7065,7 +7065,7 @@ static void examicon(Context & context) { return; } -static void obpicture(Context & context) { +void obpicture(Context & context) { context.al = context.data.byte(98); context.ah = context.data.byte(101); context._cmp(context.ah, 1); @@ -7097,7 +7097,7 @@ exframe: return; } -static void describeob(Context & context) { +void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; @@ -7126,7 +7126,7 @@ notsetd2: return; } -static void additionaltext(Context & context) { +void additionaltext(Context & context) { context._add(context.bx, 10); context.push(context.bx); context.al = context.data.byte(98); @@ -7167,7 +7167,7 @@ fullcup: return; } -static void obsthatdothings(Context & context) { +void obsthatdothings(Context & context) { context.al = context.data.byte(98); context.ah = context.data.byte(101); context.cl = 'M'; @@ -7189,7 +7189,7 @@ notlouiscard: return; } -static void getobtextstart(Context & context) { +void getobtextstart(Context & context) { context.es = context.data.word(436); context.si = 0; context.cx = 0+(82*2); @@ -7232,7 +7232,7 @@ findsometext: return; } -static void searchforsame(Context & context) { +void searchforsame(Context & context) { context.si = context.cx; searchagain: context._add(context.si, 1); @@ -7270,7 +7270,7 @@ foundmatch: return; } -static void findnextcolon(Context & context) { +void findnextcolon(Context & context) { isntcolon: context.al = context.ds.byte(context.si); context._add(context.si, 1); @@ -7282,7 +7282,7 @@ endofcolon: return; } -static void inventory(Context & context) { +void inventory(Context & context) { context._cmp(context.data.byte(55), 1); if (context.flags.z()) goto iswatchinv; context._cmp(context.data.word(19), 0); @@ -7392,7 +7392,7 @@ withlist1: return; } -static void setpickup(Context & context) { +void setpickup(Context & context) { context._cmp(context.data.byte(101), 1); if (context.flags.z()) goto cantpick; context._cmp(context.data.byte(101), 3); @@ -7451,7 +7451,7 @@ pickupexob: return; } -static void examinventory(Context & context) { +void examinventory(Context & context) { context._cmp(context.data.byte(99), 249); if (context.flags.z()) goto alreadyexinv; context.data.byte(99) = 249; @@ -7475,7 +7475,7 @@ doexinv: return; } -static void reexfrominv(Context & context) { +void reexfrominv(Context & context) { findinvpos(context); context.ax = context.ds.word(context.bx); context.data.byte(99) = context.ah; @@ -7485,7 +7485,7 @@ static void reexfrominv(Context & context) { return; } -static void reexfromopen(Context & context) { +void reexfromopen(Context & context) { return; findopenpos(context); context.ax = context.ds.word(context.bx); @@ -7496,7 +7496,7 @@ static void reexfromopen(Context & context) { return; } -static void swapwithinv(Context & context) { +void swapwithinv(Context & context) { context.al = context.data.byte(88); context.ah = context.data.byte(101); context._cmp(context.ax, context.data.word(92)); @@ -7553,7 +7553,7 @@ doswap1: return; } -static void swapwithopen(Context & context) { +void swapwithopen(Context & context) { context.al = context.data.byte(88); context.ah = context.data.byte(101); context._cmp(context.ax, context.data.word(92)); @@ -7647,7 +7647,7 @@ actuallyswap: return; } -static void intoinv(Context & context) { +void intoinv(Context & context) { context._cmp(context.data.byte(105), 0); if (!context.flags.z()) goto notout; outofinv(context); @@ -7698,7 +7698,7 @@ doplace: return; } -static void deletetaken(Context & context) { +void deletetaken(Context & context) { context.es = context.data.word(424); context.ah = context.data.byte(183); context.ds = context.data.word(396); @@ -7721,7 +7721,7 @@ notinhere: return; } -static void outofinv(Context & context) { +void outofinv(Context & context) { findinvpos(context); context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); @@ -7772,7 +7772,7 @@ dograb: return; } -static void getfreead(Context & context) { +void getfreead(Context & context) { context.ah = 0; context.cl = 4; context._shl(context.ax, context.cl); @@ -7781,7 +7781,7 @@ static void getfreead(Context & context) { return; } -static void getexad(Context & context) { +void getexad(Context & context) { context.ah = 0; context.bx = 16; context._mul(context.bx); @@ -7791,7 +7791,7 @@ static void getexad(Context & context) { return; } -static void geteitherad(Context & context) { +void geteitherad(Context & context) { context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto isinexlist; context.al = context.data.byte(88); @@ -7803,7 +7803,7 @@ isinexlist: return; } -static void getanyad(Context & context) { +void getanyad(Context & context) { context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto isex; context._cmp(context.data.byte(101), 2); @@ -7824,7 +7824,7 @@ isex: return; } -static void getanyaddir(Context & context) { +void getanyaddir(Context & context) { context._cmp(context.ah, 4); if (context.flags.z()) goto isex3; context._cmp(context.ah, 2); @@ -7839,7 +7839,7 @@ isex3: return; } -static void getopenedsize(Context & context) { +void getopenedsize(Context & context) { context._cmp(context.data.byte(110), 4); if (context.flags.z()) goto isex2; context._cmp(context.data.byte(110), 2); @@ -7860,7 +7860,7 @@ isex2: return; } -static void getsetad(Context & context) { +void getsetad(Context & context) { context.ah = 0; context.bx = 64; context._mul(context.bx); @@ -7869,7 +7869,7 @@ static void getsetad(Context & context) { return; } -static void findinvpos(Context & context) { +void findinvpos(Context & context) { context.cx = context.data.word(196); context._sub(context.cx, 80); context.bx = -1; @@ -7897,7 +7897,7 @@ findinv2: return; } -static void findopenpos(Context & context) { +void findopenpos(Context & context) { context.cx = context.data.word(196); context._sub(context.cx, 80); context.bx = -1; @@ -7913,7 +7913,7 @@ findopenp1: return; } -static void dropobject(Context & context) { +void dropobject(Context & context) { context._cmp(context.data.byte(99), 223); if (context.flags.z()) goto alreadydrop; context.data.byte(99) = 223; @@ -8004,7 +8004,7 @@ notinlift: return; } -static void droperror(Context & context) { +void droperror(Context & context) { context.data.byte(99) = 255; delpointer(context); context.di = 76; @@ -8023,7 +8023,7 @@ static void droperror(Context & context) { return; } -static void cantdrop(Context & context) { +void cantdrop(Context & context) { context.data.byte(99) = 255; delpointer(context); context.di = 76; @@ -8042,7 +8042,7 @@ static void cantdrop(Context & context) { return; } -static void wornerror(Context & context) { +void wornerror(Context & context) { context.data.byte(99) = 255; delpointer(context); context.di = 76; @@ -8061,7 +8061,7 @@ static void wornerror(Context & context) { return; } -static void removeobfrominv(Context & context) { +void removeobfrominv(Context & context) { context._cmp(context.data.byte(98), 100); if (context.flags.z()) goto obnotexist; getanyad(context); @@ -8073,7 +8073,7 @@ obnotexist: return; } -static void selectopenob(Context & context) { +void selectopenob(Context & context) { context.al = context.data.byte(98); getanyad(context); context._cmp(context.al, 255); @@ -8116,7 +8116,7 @@ doopenob: return; } -static void useopened(Context & context) { +void useopened(Context & context) { context._cmp(context.data.byte(109), 255); if (context.flags.z()) goto cannotuseopen; context._cmp(context.data.byte(105), 0); @@ -8200,7 +8200,7 @@ sizeok1: return; } -static void errormessage1(Context & context) { +void errormessage1(Context & context) { delpointer(context); context.di = 76; context.bx = 21; @@ -8224,7 +8224,7 @@ static void errormessage1(Context & context) { return; } -static void errormessage2(Context & context) { +void errormessage2(Context & context) { context.data.byte(99) = 255; delpointer(context); context.di = 76; @@ -8249,7 +8249,7 @@ static void errormessage2(Context & context) { return; } -static void errormessage3(Context & context) { +void errormessage3(Context & context) { delpointer(context); context.di = 76; context.bx = 21; @@ -8270,7 +8270,7 @@ static void errormessage3(Context & context) { return; } -static void checkobjectsize(Context & context) { +void checkobjectsize(Context & context) { getopenedsize(context); context.push(context.ax); context.al = context.data.byte(88); @@ -8311,7 +8311,7 @@ sizeok: return; } -static void outofopen(Context & context) { +void outofopen(Context & context) { context._cmp(context.data.byte(109), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); @@ -8374,7 +8374,7 @@ actuallyout: return; } -static void transfertoex(Context & context) { +void transfertoex(Context & context) { emergencypurge(context); getexpos(context); context.al = context.data.byte(9); @@ -8415,7 +8415,7 @@ static void transfertoex(Context & context) { return; } -static void pickupconts(Context & context) { +void pickupconts(Context & context) { context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; @@ -8451,7 +8451,7 @@ notopenable: return; } -static void transfercontoex(Context & context) { +void transfercontoex(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.dx); @@ -8481,7 +8481,7 @@ static void transfercontoex(Context & context) { return; } -static void transfertext(Context & context) { +void transfertext(Context & context) { context.es = context.data.word(396); context.al = context.data.byte(9); context.ah = 0; @@ -8509,7 +8509,7 @@ moretext: return; } -static void getexpos(Context & context) { +void getexpos(Context & context) { context.es = context.data.word(396); context.al = 0; context.di = 0+2080+30000; @@ -8525,7 +8525,7 @@ foundnewex: return; } -static void purgealocation(Context & context) { +void purgealocation(Context & context) { context.push(context.ax); context.es = context.data.word(396); context.di = 0+2080+30000; @@ -8553,7 +8553,7 @@ dontpurge: return; } -static void emergencypurge(Context & context) { +void emergencypurge(Context & context) { checkpurgeagain: context.ax = context.data.word(10); context._add(context.ax, 4000); @@ -8572,7 +8572,7 @@ notneartextend: return; } -static void purgeanitem(Context & context) { +void purgeanitem(Context & context) { context.es = context.data.word(396); context.di = 0+2080+30000; context.bl = context.data.byte(183); @@ -8614,7 +8614,7 @@ cantpurge2: return; } -static void deleteexobject(Context & context) { +void deleteexobject(Context & context) { context.push(context.cx); context.push(context.cx); context.push(context.cx); @@ -8658,7 +8658,7 @@ notinsideex: return; } -static void deleteexframe(Context & context) { +void deleteexframe(Context & context) { context.di = 0; context.ah = 0; context._add(context.ax, context.ax); @@ -8697,7 +8697,7 @@ beforethisone: return; } -static void deleteextext(Context & context) { +void deleteextext(Context & context) { context.di = 0+2080+30000+(16*114); context.ah = 0; context._add(context.ax, context.ax); @@ -8738,7 +8738,7 @@ beforethistext: return; } -static void blockget(Context & context) { +void blockget(Context & context) { context.ah = context.al; context.al = 0; context.ds = context.data.word(414); @@ -8747,7 +8747,7 @@ static void blockget(Context & context) { return; } -static void drawfloor(Context & context) { +void drawfloor(Context & context) { context.push(context.es); context.push(context.bx); eraseoldobs(context); @@ -8765,7 +8765,7 @@ static void drawfloor(Context & context) { return; } -static void calcmapad(Context & context) { +void calcmapad(Context & context) { getdimension(context); context.push(context.cx); context.push(context.dx); @@ -8792,7 +8792,7 @@ static void calcmapad(Context & context) { return; } -static void getdimension(Context & context) { +void getdimension(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32); context.ch = 0; @@ -8872,7 +8872,7 @@ finishdim4: return; } -static void addalong(Context & context) { +void addalong(Context & context) { context.ah = 11; addloop: context._cmp(context.ds.byte(context.bx), 0); @@ -8887,7 +8887,7 @@ gotalong: return; } -static void addlength(Context & context) { +void addlength(Context & context) { context.ah = 10; addloop2: context._cmp(context.ds.byte(context.bx), 0); @@ -8902,7 +8902,7 @@ gotlength: return; } -static void drawflags(Context & context) { +void drawflags(Context & context) { context.es = context.data.word(410); context.di = 0+(228*13)+32+60+(32*32); context.al = context.data.byte(148); @@ -8939,7 +8939,7 @@ _tmp28a: return; } -static void eraseoldobs(Context & context) { +void eraseoldobs(Context & context) { context._cmp(context.data.byte(61), 0); if (context.flags.z()) goto donterase; context.es = context.data.word(410); @@ -8964,7 +8964,7 @@ donterase: return; } -static void showallobs(Context & context) { +void showallobs(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); context.data.word(16) = context.bx; @@ -9046,7 +9046,7 @@ finishedsetobs: return; } -static void makebackob(Context & context) { +void makebackob(Context & context) { context._cmp(context.data.byte(61), 0); if (context.flags.z()) goto nomake; context.al = context.ds.byte(context.si+5); @@ -9079,7 +9079,7 @@ nomake: return; } -static void showallfree(Context & context) { +void showallfree(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); context.data.word(16) = context.bx; @@ -9158,7 +9158,7 @@ finfree: return; } -static void showallex(Context & context) { +void showallex(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); context.data.word(16) = context.bx; @@ -9242,7 +9242,7 @@ finex: return; } -static void calcfrframe(Context & context) { +void calcfrframe(Context & context) { context.dx = context.data.word(164); context.ax = context.data.word(160); context.push(context.ax); @@ -9277,7 +9277,7 @@ nullframe: return; } -static void finalframe(Context & context) { +void finalframe(Context & context) { context.ax = context.data.word(168); context._add(context.ax, context.data.word(172)); context.bx = context.data.word(166); @@ -9289,7 +9289,7 @@ static void finalframe(Context & context) { return; } -static void adjustlen(Context & context) { +void adjustlen(Context & context) { context.ah = context.al; context._add(context.al, context.ch); context._cmp(context.al, 100); @@ -9301,7 +9301,7 @@ over242: return; } -static void getmapad(Context & context) { +void getmapad(Context & context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; @@ -9315,7 +9315,7 @@ over146: return; } -static void getxad(Context & context) { +void getxad(Context & context) { context.cl = context.ds.byte(context.si); context._add(context.si, 1); context.al = context.ds.byte(context.si); @@ -9339,7 +9339,7 @@ over148: return; } -static void getyad(Context & context) { +void getyad(Context & context) { context.al = context.ds.byte(context.si); context._add(context.si, 1); context.ah = context.ds.byte(context.si); @@ -9359,7 +9359,7 @@ over147: return; } -static void autolook(Context & context) { +void autolook(Context & context) { context.ax = context.data.word(196); context._cmp(context.ax, context.data.word(212)); if (!context.flags.z()) goto diffmouse; @@ -9379,7 +9379,7 @@ diffmouse: return; } -static void look(Context & context) { +void look(Context & context) { context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(233), 2); @@ -9400,7 +9400,7 @@ nolook: return; } -static void dolook(Context & context) { +void dolook(Context & context) { createpanel(context); showicon(context); undertextline(context); @@ -9436,7 +9436,7 @@ afterlook: return; } -static void redrawmainscrn(Context & context) { +void redrawmainscrn(Context & context) { context.data.word(326) = 0; createpanel(context); context.data.byte(61) = 0; @@ -9451,7 +9451,7 @@ static void redrawmainscrn(Context & context) { return; } -static void getback1(Context & context) { +void getback1(Context & context) { context._cmp(context.data.byte(105), 0); if (context.flags.z()) goto notgotobject; blank(context); @@ -9476,7 +9476,7 @@ dogetback: return; } -static void talk(Context & context) { +void talk(Context & context) { context.data.byte(245) = 0; context.data.byte(236) = 0; context.al = context.data.byte(98); @@ -9525,7 +9525,7 @@ nospeech: return; } -static void convicons(Context & context) { +void convicons(Context & context) { context.al = context.data.byte(246); context._and(context.al, 127); getpersframe(context); @@ -9540,7 +9540,7 @@ static void convicons(Context & context) { return; } -static void getpersframe(Context & context) { +void getpersframe(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; @@ -9550,7 +9550,7 @@ static void getpersframe(Context & context) { return; } -static void starttalk(Context & context) { +void starttalk(Context & context) { context.data.byte(244) = 0; context.al = context.data.byte(246); context._and(context.al, 127); @@ -9573,7 +9573,7 @@ nospeech1: return; } -static void getpersontext(Context & context) { +void getpersontext(Context & context) { context.ah = 0; context.cx = 64*2; context._mul(context.cx); @@ -9587,7 +9587,7 @@ static void getpersontext(Context & context) { return; } -static void moretalk(Context & context) { +void moretalk(Context & context) { context._cmp(context.data.byte(244), 0); if (context.flags.z()) goto canmore; redes(context); @@ -9617,7 +9617,7 @@ notsecondpart: return; } -static void dosometalk(Context & context) { +void dosometalk(Context & context) { watchtalk: context.al = context.data.byte(245); context.al = context.data.byte(246); @@ -9710,7 +9710,7 @@ endwatchtalk: return; } -static void hangonpq(Context & context) { +void hangonpq(Context & context) { context.data.byte(102) = 0; context.bx = 0; hangloopq: @@ -9753,7 +9753,7 @@ quitconv: return; } -static void redes(Context & context) { +void redes(Context & context) { context._cmp(context.data.byte(514), 255); if (!context.flags.z()) goto cantredes; context._cmp(context.data.byte(244), 2); @@ -9787,7 +9787,7 @@ doredes: return; } -static void newplace(Context & context) { +void newplace(Context & context) { context._cmp(context.data.byte(59), 1); if (context.flags.z()) goto istravel; context._cmp(context.data.byte(188), -1); @@ -9804,7 +9804,7 @@ istravel: return; } -static void selectlocation(Context & context) { +void selectlocation(Context & context) { context.data.byte(236) = 0; clearbeforeload(context); context.data.byte(102) = 0; @@ -9863,7 +9863,7 @@ quittravel: return; } -static void showcity(Context & context) { +void showcity(Context & context) { clearwork(context); context.ds = context.data.word(456); context.di = 57; @@ -9880,7 +9880,7 @@ static void showcity(Context & context) { return; } -static void lookatplace(Context & context) { +void lookatplace(Context & context) { context._cmp(context.data.byte(99), 224); if (context.flags.z()) goto alreadyinfo; context.data.byte(99) = 224; @@ -9940,7 +9940,7 @@ noinfo: return; } -static void getundercentre(Context & context) { +void getundercentre(Context & context) { context.di = 58; context.bx = 72; context.ds = context.data.word(400); @@ -9951,7 +9951,7 @@ static void getundercentre(Context & context) { return; } -static void putundercentre(Context & context) { +void putundercentre(Context & context) { context.di = 58; context.bx = 72; context.ds = context.data.word(400); @@ -9962,7 +9962,7 @@ static void putundercentre(Context & context) { return; } -static void locationpic(Context & context) { +void locationpic(Context & context) { getdestinfo(context); context.al = context.ds.byte(context.si); context.push(context.es); @@ -10008,7 +10008,7 @@ notinthisone: return; } -static void getdestinfo(Context & context) { +void getdestinfo(Context & context) { context.al = context.data.byte(182); context.ah = 0; context.push(context.ax); @@ -10027,7 +10027,7 @@ static void getdestinfo(Context & context) { return; } -static void showarrows(Context & context) { +void showarrows(Context & context) { context.di = 116-12; context.bx = 16; context.ds = context.data.word(456); @@ -10049,7 +10049,7 @@ static void showarrows(Context & context) { return; } -static void nextdest(Context & context) { +void nextdest(Context & context) { duok: context._cmp(context.data.byte(99), 218); if (context.flags.z()) goto alreadydu; @@ -10087,7 +10087,7 @@ nodu: return; } -static void lastdest(Context & context) { +void lastdest(Context & context) { ddok: context._cmp(context.data.byte(99), 219); if (context.flags.z()) goto alreadydd; @@ -10125,7 +10125,7 @@ nodd: return; } -static void destselect(Context & context) { +void destselect(Context & context) { context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadytrav; context.data.byte(99) = 222; @@ -10144,7 +10144,7 @@ notrav: return; } -static void getlocation(Context & context) { +void getlocation(Context & context) { context.ah = 0; context.bx = context.ax; context.dx = context.ds; @@ -10154,7 +10154,7 @@ static void getlocation(Context & context) { return; } -static void setlocation(Context & context) { +void setlocation(Context & context) { context.ah = 0; context.bx = context.ax; context.dx = context.ds; @@ -10164,7 +10164,7 @@ static void setlocation(Context & context) { return; } -static void resetlocation(Context & context) { +void resetlocation(Context & context) { context.push(context.ax); context._cmp(context.al, 5); if (!context.flags.z()) goto notdelhotel; @@ -10211,7 +10211,7 @@ clearedlocations: return; } -static void readdesticon(Context & context) { +void readdesticon(Context & context) { context.dx = 2013; loadintotemp(context); context.dx = 2026; @@ -10221,13 +10221,13 @@ static void readdesticon(Context & context) { return; } -static void readcitypic(Context & context) { +void readcitypic(Context & context) { context.dx = 2000; loadintotemp(context); return; } -static void usemon(Context & context) { +void usemon(Context & context) { context.data.byte(54) = 0; context.es = context.cs; context.di = 2892+1; @@ -10317,7 +10317,7 @@ endmon: return; } -static void printoutermon(Context & context) { +void printoutermon(Context & context) { context.di = 40; context.bx = 32; context.ds = context.data.word(456); @@ -10345,7 +10345,7 @@ static void printoutermon(Context & context) { return; } -static void loadpersonal(Context & context) { +void loadpersonal(Context & context) { context.al = context.data.byte(8); context.dx = 2052; context._cmp(context.al, 0); @@ -10372,7 +10372,7 @@ foundpersonal: return; } -static void loadnews(Context & context) { +void loadnews(Context & context) { context.al = context.data.byte(33); context.dx = 2078; context._cmp(context.al, 0); @@ -10401,7 +10401,7 @@ foundnews: return; } -static void loadcart(Context & context) { +void loadcart(Context & context) { lookininterface(context); context.dx = 2130; context._cmp(context.al, 0); @@ -10433,7 +10433,7 @@ gotcart: return; } -static void lookininterface(Context & context) { +void lookininterface(Context & context) { context.al = 'I'; context.ah = 'N'; context.cl = 'T'; @@ -10451,7 +10451,7 @@ emptyinterface: return; } -static void turnonpower(Context & context) { +void turnonpower(Context & context) { context.cx = 3; powerloop: context.push(context.cx); @@ -10467,7 +10467,7 @@ powerloop: return; } -static void randomaccess(Context & context) { +void randomaccess(Context & context) { accessloop: context.push(context.cx); vsync(context); @@ -10487,7 +10487,7 @@ chosenaccess: return; } -static void powerlighton(Context & context) { +void powerlighton(Context & context) { context.di = 257+4; context.bx = 182; context.ds = context.data.word(456); @@ -10504,7 +10504,7 @@ static void powerlighton(Context & context) { return; } -static void powerlightoff(Context & context) { +void powerlightoff(Context & context) { context.di = 257+4; context.bx = 182; context.ds = context.data.word(456); @@ -10521,7 +10521,7 @@ static void powerlightoff(Context & context) { return; } -static void accesslighton(Context & context) { +void accesslighton(Context & context) { context.di = 74; context.bx = 182; context.ds = context.data.word(456); @@ -10538,7 +10538,7 @@ static void accesslighton(Context & context) { return; } -static void accesslightoff(Context & context) { +void accesslightoff(Context & context) { context.di = 74; context.bx = 182; context.ds = context.data.word(456); @@ -10555,7 +10555,7 @@ static void accesslightoff(Context & context) { return; } -static void locklighton(Context & context) { +void locklighton(Context & context) { context.di = 56; context.bx = 182; context.ds = context.data.word(456); @@ -10572,7 +10572,7 @@ static void locklighton(Context & context) { return; } -static void locklightoff(Context & context) { +void locklightoff(Context & context) { context.di = 56; context.bx = 182; context.ds = context.data.word(456); @@ -10589,7 +10589,7 @@ static void locklightoff(Context & context) { return; } -static void input(Context & context) { +void input(Context & context) { context.es = context.cs; context.di = 7816; context.cx = 64; @@ -10678,7 +10678,7 @@ endofinput: return; } -static void makecaps(Context & context) { +void makecaps(Context & context) { context._cmp(context.al, 'a'); if (context.flags.c()) goto notupperc; context._sub(context.al, 32); @@ -10686,7 +10686,7 @@ notupperc: return; } -static void delchar(Context & context) { +void delchar(Context & context) { context._sub(context.data.word(314), 1); context.si = context.data.word(314); context._add(context.si, context.si); @@ -10714,7 +10714,7 @@ static void delchar(Context & context) { return; } -static void execcommand(Context & context) { +void execcommand(Context & context) { context.es = context.cs; context.bx = 2776; context.ds = context.cs; @@ -10787,14 +10787,14 @@ quitcom: return; } -static void neterror(Context & context) { +void neterror(Context & context) { context.al = 5; monmessage(context); scrollmonitor(context); return; } -static void dircom(Context & context) { +void dircom(Context & context) { context.cx = 30; randomaccess(context); parser(context); @@ -10826,7 +10826,7 @@ dirroot: return; } -static void searchforfiles(Context & context) { +void searchforfiles(Context & context) { context.bx = 66*2; directloop1: context.al = context.ds.byte(context.bx); @@ -10841,7 +10841,7 @@ endofdir: return; } -static void signon(Context & context) { +void signon(Context & context) { parser(context); context._add(context.di, 1); context.ds = context.cs; @@ -10936,7 +10936,7 @@ passpassed: return; } -static void showkeys(Context & context) { +void showkeys(Context & context) { context.cx = 10; randomaccess(context); scrollmonitor(context); @@ -10961,7 +10961,7 @@ notheld: return; } -static void read(Context & context) { +void read(Context & context) { context.cx = 40; randomaccess(context); parser(context); @@ -11043,7 +11043,7 @@ endoftopic: return; } -static void dirfile(Context & context) { +void dirfile(Context & context) { context.al = 34; context.ds.byte(context.di) = context.al; context.push(context.es); @@ -11114,7 +11114,7 @@ endofdir2: return; } -static void getkeyandlogo(Context & context) { +void getkeyandlogo(Context & context) { context._add(context.bx, 1); context.al = context.ds.byte(context.bx); context._sub(context.al, 48); @@ -11158,7 +11158,7 @@ keyok: return; } -static void searchforstring(Context & context) { +void searchforstring(Context & context) { context.dl = context.ds.byte(context.di); context.cx = context.di; restartlook: @@ -11196,7 +11196,7 @@ notfound: return; } -static void parser(Context & context) { +void parser(Context & context) { context.es = context.cs; context.di = 2883; context.cx = 13; @@ -11230,7 +11230,7 @@ finishpars: return; } -static void scrollmonitor(Context & context) { +void scrollmonitor(Context & context) { context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -11258,7 +11258,7 @@ static void scrollmonitor(Context & context) { return; } -static void lockmon(Context & context) { +void lockmon(Context & context) { context._cmp(context.data.byte(391), 57); if (!context.flags.z()) goto notlock; locklighton(context); @@ -11270,7 +11270,7 @@ notlock: return; } -static void monitorlogo(Context & context) { +void monitorlogo(Context & context) { context.al = context.data.byte(268); context._cmp(context.al, context.data.byte(269)); if (context.flags.z()) goto notnewlogo; @@ -11290,7 +11290,7 @@ notnewlogo: return; } -static void printlogo(Context & context) { +void printlogo(Context & context) { context.di = 56; context.bx = 32; context.ds = context.data.word(456); @@ -11301,7 +11301,7 @@ static void printlogo(Context & context) { return; } -static void showcurrentfile(Context & context) { +void showcurrentfile(Context & context) { context.di = 178; context.bx = 37; context.si = 2892+1; @@ -11321,7 +11321,7 @@ finishfile: return; } -static void monmessage(Context & context) { +void monmessage(Context & context) { context.es = context.data.word(464); context.bx = 66*2; context.cl = context.al; @@ -11336,7 +11336,7 @@ monmessageloop: return; } -static void processtrigger(Context & context) { +void processtrigger(Context & context) { context._cmp(context.data.byte(54), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; @@ -11363,7 +11363,7 @@ notthirdtrigger: return; } -static void triggermessage(Context & context) { +void triggermessage(Context & context) { context.push(context.ax); context.di = 174; context.bx = 153; @@ -11396,7 +11396,7 @@ static void triggermessage(Context & context) { return; } -static void printcurs(Context & context) { +void printcurs(Context & context) { context.push(context.si); context.push(context.di); context.push(context.ds); @@ -11443,7 +11443,7 @@ flashcurs: return; } -static void delcurs(Context & context) { +void delcurs(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.di); @@ -11476,7 +11476,7 @@ finishcurdel: return; } -static void useobject(Context & context) { +void useobject(Context & context) { context.data.byte(94) = 255; context._cmp(context.data.byte(99), 229); if (context.flags.z()) goto alreadyuse; @@ -11498,7 +11498,7 @@ douse: return; } -static void useroutine(Context & context) { +void useroutine(Context & context) { context._cmp(context.data.byte(183), 50); if (context.flags.c()) goto nodream7; context._cmp(context.data.byte(231), 0); @@ -11573,7 +11573,7 @@ cantuse2: return; } -static void wheelsound(Context & context) { +void wheelsound(Context & context) { context.al = 17; playchannel1(context); showfirstuse(context); @@ -11581,7 +11581,7 @@ static void wheelsound(Context & context) { return; } -static void runtap(Context & context) { +void runtap(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto tapwith; withwhat(context); @@ -11627,7 +11627,7 @@ cupfromtapfull: return; } -static void playguitar(Context & context) { +void playguitar(Context & context) { context.al = 14; playchannel1(context); showfirstuse(context); @@ -11635,7 +11635,7 @@ static void playguitar(Context & context) { return; } -static void hotelcontrol(Context & context) { +void hotelcontrol(Context & context) { context._cmp(context.data.byte(183), 21); if (!context.flags.z()) goto notrightcont; context._cmp(context.data.byte(147), 33); @@ -11649,7 +11649,7 @@ notrightcont: return; } -static void hotelbell(Context & context) { +void hotelbell(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); @@ -11657,7 +11657,7 @@ static void hotelbell(Context & context) { return; } -static void opentomb(Context & context) { +void opentomb(Context & context) { context._add(context.data.byte(1), 1); showfirstuse(context); context.data.word(19) = 35*2; @@ -11669,7 +11669,7 @@ static void opentomb(Context & context) { return; } -static void usetrainer(Context & context) { +void usetrainer(Context & context) { getanyad(context); context._cmp(context.ds.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; @@ -11683,7 +11683,7 @@ notheldtrainer: return; } -static void nothelderror(Context & context) { +void nothelderror(Context & context) { createpanel(context); showpanel(context); showman(context); @@ -11702,7 +11702,7 @@ static void nothelderror(Context & context) { return; } -static void usepipe(Context & context) { +void usepipe(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto pipewith; withwhat(context); @@ -11746,7 +11746,7 @@ alreadyfull: return; } -static void usefullcart(Context & context) { +void usefullcart(Context & context) { context._add(context.data.byte(1), 1); context.al = 2; context.ah = context.data.byte(184); @@ -11768,7 +11768,7 @@ static void usefullcart(Context & context) { return; } -static void useplinth(Context & context) { +void useplinth(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); @@ -11799,7 +11799,7 @@ isrightkey: return; } -static void chewy(Context & context) { +void chewy(Context & context) { showfirstuse(context); getanyad(context); context.ds.byte(context.bx+2) = 255; @@ -11807,7 +11807,7 @@ static void chewy(Context & context) { return; } -static void useladder(Context & context) { +void useladder(Context & context) { showfirstuse(context); context._sub(context.data.byte(147), 11); findroominloc(context); @@ -11822,7 +11822,7 @@ static void useladder(Context & context) { return; } -static void useladderb(Context & context) { +void useladderb(Context & context) { showfirstuse(context); context._add(context.data.byte(147), 11); findroominloc(context); @@ -11837,7 +11837,7 @@ static void useladderb(Context & context) { return; } -static void slabdoora(Context & context) { +void slabdoora(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.byte(26) = 1; @@ -11858,7 +11858,7 @@ slabawrong: return; } -static void slabdoorb(Context & context) { +void slabdoorb(Context & context) { context._cmp(context.data.byte(65), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; @@ -11896,7 +11896,7 @@ slabbwrong: return; } -static void slabdoord(Context & context) { +void slabdoord(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.byte(26) = 1; @@ -11917,7 +11917,7 @@ slabcwrong: return; } -static void slabdoorc(Context & context) { +void slabdoorc(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.byte(26) = 1; @@ -11938,7 +11938,7 @@ slabdwrong: return; } -static void slabdoore(Context & context) { +void slabdoore(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.byte(26) = 1; @@ -11959,7 +11959,7 @@ slabewrong: return; } -static void slabdoorf(Context & context) { +void slabdoorf(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.byte(26) = 1; @@ -11980,7 +11980,7 @@ slabfwrong: return; } -static void useslab(Context & context) { +void useslab(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto slabwith; withwhat(context); @@ -12027,7 +12027,7 @@ notlastslab: return; } -static void usecart(Context & context) { +void usecart(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto cartwith; withwhat(context); @@ -12064,7 +12064,7 @@ nextcart: return; } -static void useclearbox(Context & context) { +void useclearbox(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); @@ -12095,7 +12095,7 @@ openbox: return; } -static void usecoveredbox(Context & context) { +void usecoveredbox(Context & context) { context._add(context.data.byte(1), 1); showfirstuse(context); context.data.word(19) = 50; @@ -12107,7 +12107,7 @@ static void usecoveredbox(Context & context) { return; } -static void userailing(Context & context) { +void userailing(Context & context) { showfirstuse(context); context.data.word(19) = 80; context.data.word(21) = 0; @@ -12119,7 +12119,7 @@ static void userailing(Context & context) { return; } -static void useopenbox(Context & context) { +void useopenbox(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); @@ -12168,7 +12168,7 @@ openboxwrong: return; } -static void wearwatch(Context & context) { +void wearwatch(Context & context) { context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); @@ -12183,7 +12183,7 @@ wearingwatch: return; } -static void wearshades(Context & context) { +void wearshades(Context & context) { context._cmp(context.data.byte(3), 1); if (context.flags.z()) goto wearingshades; context.data.byte(3) = 1; @@ -12198,7 +12198,7 @@ wearingshades: return; } -static void sitdowninbar(Context & context) { +void sitdowninbar(Context & context) { context._cmp(context.data.byte(31), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); @@ -12217,7 +12217,7 @@ satdown: return; } -static void usechurchhole(Context & context) { +void usechurchhole(Context & context) { showfirstuse(context); context.data.byte(102) = 1; context.data.word(19) = 28; @@ -12228,7 +12228,7 @@ static void usechurchhole(Context & context) { return; } -static void usehole(Context & context) { +void usehole(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto holewith; withwhat(context); @@ -12259,7 +12259,7 @@ righthand: return; } -static void usealtar(Context & context) { +void usealtar(Context & context) { context.al = 'C'; context.ah = 'N'; context.cl = 'D'; @@ -12303,7 +12303,7 @@ thingsonaltar: return; } -static void opentvdoor(Context & context) { +void opentvdoor(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); @@ -12329,7 +12329,7 @@ keyontv: return; } -static void usedryer(Context & context) { +void usedryer(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); @@ -12337,7 +12337,7 @@ static void usedryer(Context & context) { return; } -static void openlouis(Context & context) { +void openlouis(Context & context) { context.al = 5; context.ah = 2; context.cl = 3; @@ -12347,7 +12347,7 @@ static void openlouis(Context & context) { return; } -static void nextcolon(Context & context) { +void nextcolon(Context & context) { lookcolon: context.al = context.ds.byte(context.si); context._add(context.si, 1); @@ -12356,7 +12356,7 @@ lookcolon: return; } -static void openyourneighbour(Context & context) { +void openyourneighbour(Context & context) { context.al = 255; context.ah = 255; context.cl = 255; @@ -12366,7 +12366,7 @@ static void openyourneighbour(Context & context) { return; } -static void usewindow(Context & context) { +void usewindow(Context & context) { context._cmp(context.data.byte(474), 6); if (!context.flags.z()) goto notonbalc; context._add(context.data.byte(1), 1); @@ -12380,7 +12380,7 @@ notonbalc: return; } -static void usebalcony(Context & context) { +void usebalcony(Context & context) { showfirstuse(context); context.al = 6; turnpathon(context); @@ -12412,7 +12412,7 @@ static void usebalcony(Context & context) { return; } -static void openryan(Context & context) { +void openryan(Context & context) { context.al = 5; context.ah = 1; context.cl = 0; @@ -12422,7 +12422,7 @@ static void openryan(Context & context) { return; } -static void openpoolboss(Context & context) { +void openpoolboss(Context & context) { context.al = 5; context.ah = 2; context.cl = 2; @@ -12432,7 +12432,7 @@ static void openpoolboss(Context & context) { return; } -static void openeden(Context & context) { +void openeden(Context & context) { context.al = 2; context.ah = 8; context.cl = 6; @@ -12442,7 +12442,7 @@ static void openeden(Context & context) { return; } -static void opensarters(Context & context) { +void opensarters(Context & context) { context.al = 7; context.ah = 8; context.cl = 3; @@ -12452,7 +12452,7 @@ static void opensarters(Context & context) { return; } -static void isitright(Context & context) { +void isitright(Context & context) { context.bx = context.ds; context.es = context.bx; context.bx = 8344; @@ -12467,7 +12467,7 @@ notright: return; } -static void drawitall(Context & context) { +void drawitall(Context & context) { createpanel(context); drawfloor(context); printsprites(context); @@ -12475,7 +12475,7 @@ static void drawitall(Context & context) { return; } -static void openhoteldoor(Context & context) { +void openhoteldoor(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); @@ -12503,7 +12503,7 @@ keyonhotel1: return; } -static void openhoteldoor2(Context & context) { +void openhoteldoor2(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); @@ -12530,7 +12530,7 @@ keyonhotel2: return; } -static void grafittidoor(Context & context) { +void grafittidoor(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto grafwith; withwhat(context); @@ -12555,7 +12555,7 @@ dograf: return; } -static void trapdoor(Context & context) { +void trapdoor(Context & context) { context._add(context.data.byte(1), 1); showfirstuse(context); switchryanoff(context); @@ -12569,7 +12569,7 @@ static void trapdoor(Context & context) { return; } -static void callhotellift(Context & context) { +void callhotellift(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); @@ -12583,7 +12583,7 @@ static void callhotellift(Context & context) { return; } -static void calledenslift(Context & context) { +void calledenslift(Context & context) { showfirstuse(context); context.data.byte(38) = 8; context.data.byte(102) = 1; @@ -12592,7 +12592,7 @@ static void calledenslift(Context & context) { return; } -static void calledensdlift(Context & context) { +void calledensdlift(Context & context) { context._cmp(context.data.byte(34), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); @@ -12607,7 +12607,7 @@ edensdhere: return; } -static void usepoolreader(Context & context) { +void usepoolreader(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto poolwith; withwhat(context); @@ -12641,7 +12641,7 @@ canopenpool: return; } -static void uselighter(Context & context) { +void uselighter(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); @@ -12669,7 +12669,7 @@ cigarette: return; } -static void showseconduse(Context & context) { +void showseconduse(Context & context) { getobtextstart(context); nextcolon(context); nextcolon(context); @@ -12680,7 +12680,7 @@ static void showseconduse(Context & context) { return; } -static void usecardreader1(Context & context) { +void usecardreader1(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); @@ -12725,7 +12725,7 @@ notyet: return; } -static void usecardreader2(Context & context) { +void usecardreader2(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); @@ -12781,7 +12781,7 @@ notyetboss: return; } -static void usecardreader3(Context & context) { +void usecardreader3(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); @@ -12827,7 +12827,7 @@ notyetrecep: return; } -static void usecashcard(Context & context) { +void usecashcard(Context & context) { getridofreels(context); loadkeypad(context); createpanel(context); @@ -12879,7 +12879,7 @@ static void usecashcard(Context & context) { return; } -static void lookatcard(Context & context) { +void lookatcard(Context & context) { context.data.byte(130) = 1; getridofreels(context); loadkeypad(context); @@ -12930,7 +12930,7 @@ static void lookatcard(Context & context) { return; } -static void moneypoke(Context & context) { +void moneypoke(Context & context) { context.bx = 3385; context.cl = 48-1; numberpoke0: @@ -12969,7 +12969,7 @@ numberpoke3: return; } -static void usecontrol(Context & context) { +void usecontrol(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); @@ -13059,14 +13059,14 @@ axeoncontrols: return; } -static void usehatch(Context & context) { +void usehatch(Context & context) { showfirstuse(context); context.data.byte(187) = 40; context.data.byte(102) = 1; return; } -static void usewire(Context & context) { +void usewire(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); @@ -13112,7 +13112,7 @@ wireknife: return; } -static void usehandle(Context & context) { +void usehandle(Context & context) { context.al = 'C'; context.ah = 'U'; context.cl = 'T'; @@ -13135,14 +13135,14 @@ havecutwire: return; } -static void useelevator1(Context & context) { +void useelevator1(Context & context) { showfirstuse(context); selectlocation(context); context.data.byte(102) = 1; return; } -static void showfirstuse(Context & context) { +void showfirstuse(Context & context) { getobtextstart(context); findnextcolon(context); findnextcolon(context); @@ -13152,7 +13152,7 @@ static void showfirstuse(Context & context) { return; } -static void useelevator3(Context & context) { +void useelevator3(Context & context) { showfirstuse(context); context.data.byte(39) = 20; context.data.byte(187) = 34; @@ -13165,7 +13165,7 @@ static void useelevator3(Context & context) { return; } -static void useelevator4(Context & context) { +void useelevator4(Context & context) { showfirstuse(context); context.data.word(21) = 0; context.data.word(23) = 11; @@ -13178,7 +13178,7 @@ static void useelevator4(Context & context) { return; } -static void useelevator2(Context & context) { +void useelevator2(Context & context) { context._cmp(context.data.byte(8), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); @@ -13198,7 +13198,7 @@ inpoolhall: return; } -static void useelevator5(Context & context) { +void useelevator5(Context & context) { context.al = 4; placesetobject(context); context.al = 0; @@ -13211,7 +13211,7 @@ static void useelevator5(Context & context) { return; } -static void usekey(Context & context) { +void usekey(Context & context) { context._cmp(context.data.byte(8), 5); if (context.flags.z()) goto usekey1; context._cmp(context.data.byte(8), 30); @@ -13256,7 +13256,7 @@ wrongroom1: return; } -static void usestereo(Context & context) { +void usestereo(Context & context) { context._cmp(context.data.byte(8), 0); if (context.flags.z()) goto stereook; context.cx = 400; @@ -13313,7 +13313,7 @@ stereoon: return; } -static void usecooker(Context & context) { +void usecooker(Context & context) { context.al = context.data.byte(98); context.ah = context.data.byte(101); checkinside(context); @@ -13328,7 +13328,7 @@ foodinside: return; } -static void useaxe(Context & context) { +void useaxe(Context & context) { context._cmp(context.data.byte(183), 22); if (!context.flags.z()) goto notinpool; context._cmp(context.data.byte(148), 10); @@ -13358,7 +13358,7 @@ axeondoor: return; } -static void useelvdoor(Context & context) { +void useelvdoor(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); @@ -13391,7 +13391,7 @@ axeondoor: return; } -static void withwhat(Context & context) { +void withwhat(Context & context) { createpanel(context); showpanel(context); showman(context); @@ -13433,7 +13433,7 @@ static void withwhat(Context & context) { return; } -static void selectob(Context & context) { +void selectob(Context & context) { findinvpos(context); context.ax = context.ds.word(context.bx); context._cmp(context.al, 255); @@ -13468,7 +13468,7 @@ doselob: return; } -static void compare(Context & context) { +void compare(Context & context) { context._sub(context.dl, 'A'); context._sub(context.dh, 'A'); context._sub(context.cl, 'A'); @@ -13485,7 +13485,7 @@ comparefin: return; } -static void findsetobject(Context & context) { +void findsetobject(Context & context) { context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13513,7 +13513,7 @@ nofind: return; } -static void findexobject(Context & context) { +void findexobject(Context & context) { context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13541,7 +13541,7 @@ nofindex: return; } -static void isryanholding(Context & context) { +void isryanholding(Context & context) { context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13573,7 +13573,7 @@ nofindininv: return; } -static void checkinside(Context & context) { +void checkinside(Context & context) { context.es = context.data.word(396); context.bx = 0+2080+30000; context.cl = 0; @@ -13591,7 +13591,7 @@ notfoundinside: return; } -static void usetext(Context & context) { +void usetext(Context & context) { context.push(context.es); context.push(context.si); createpanel(context); @@ -13611,7 +13611,7 @@ static void usetext(Context & context) { return; } -static void putbackobstuff(Context & context) { +void putbackobstuff(Context & context) { createpanel(context); showpanel(context); showman(context); @@ -13628,7 +13628,7 @@ static void putbackobstuff(Context & context) { return; } -static void showpuztext(Context & context) { +void showpuztext(Context & context) { context.push(context.cx); findpuztext(context); context.push(context.es); @@ -13651,7 +13651,7 @@ static void showpuztext(Context & context) { return; } -static void findpuztext(Context & context) { +void findpuztext(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -13662,7 +13662,7 @@ static void findpuztext(Context & context) { return; } -static void placesetobject(Context & context) { +void placesetobject(Context & context) { context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13675,7 +13675,7 @@ static void placesetobject(Context & context) { return; } -static void removesetobject(Context & context) { +void removesetobject(Context & context) { context.push(context.es); context.push(context.bx); context.cl = 255; @@ -13688,7 +13688,7 @@ static void removesetobject(Context & context) { return; } -static void issetobonmap(Context & context) { +void issetobonmap(Context & context) { context.push(context.es); context.push(context.bx); getsetad(context); @@ -13699,7 +13699,7 @@ static void issetobonmap(Context & context) { return; } -static void placefreeobject(Context & context) { +void placefreeobject(Context & context) { context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13712,7 +13712,7 @@ static void placefreeobject(Context & context) { return; } -static void removefreeobject(Context & context) { +void removefreeobject(Context & context) { context.push(context.es); context.push(context.bx); getfreead(context); @@ -13722,7 +13722,7 @@ static void removefreeobject(Context & context) { return; } -static void findormake(Context & context) { +void findormake(Context & context) { context.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); context.push(context.ax); context.es = context.data.word(410); @@ -13748,17 +13748,17 @@ haventfound: return; } -static void switchryanon(Context & context) { +void switchryanon(Context & context) { context.data.byte(62) = 255; return; } -static void switchryanoff(Context & context) { +void switchryanoff(Context & context) { context.data.byte(62) = 1; return; } -static void setallchanges(Context & context) { +void setallchanges(Context & context) { context.es = context.data.word(410); context.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); setallloop: @@ -13779,7 +13779,7 @@ endsetloop: return; } -static void dochange(Context & context) { +void dochange(Context & context) { context._cmp(context.ch, 0); if (context.flags.z()) goto object; context._cmp(context.ch, 1); @@ -13821,7 +13821,7 @@ beenpickedup: return; } -static void autoappear(Context & context) { +void autoappear(Context & context) { context._cmp(context.data.byte(8), 32); if (!context.flags.z()) goto notinalley; context.al = 5; @@ -13886,7 +13886,7 @@ notinlouiss: return; } -static void getundertimed(Context & context) { +void getundertimed(Context & context) { context.al = context.data.byte(334); context._sub(context.al, 3); context.ah = 0; @@ -13902,7 +13902,7 @@ static void getundertimed(Context & context) { return; } -static void putundertimed(Context & context) { +void putundertimed(Context & context) { context.al = context.data.byte(334); context._sub(context.al, 3); context.ah = 0; @@ -13918,7 +13918,7 @@ static void putundertimed(Context & context) { return; } -static void dumptimedtext(Context & context) { +void dumptimedtext(Context & context) { context._cmp(context.data.byte(336), 1); if (!context.flags.z()) goto nodumptimed; context.al = context.data.byte(334); @@ -13936,7 +13936,7 @@ nodumptimed: return; } -static void setuptimeduse(Context & context) { +void setuptimeduse(Context & context) { context._cmp(context.data.word(326), 0); if (!context.flags.z()) goto cantsetup; context.data.byte(334) = context.bh; @@ -13958,7 +13958,7 @@ cantsetup: return; } -static void setuptimedtemp(Context & context) { +void setuptimedtemp(Context & context) { context._cmp(context.data.word(326), 0); if (!context.flags.z()) goto cantsetup2; context.data.byte(334) = context.bh; @@ -13980,7 +13980,7 @@ cantsetup2: return; } -static void usetimedtext(Context & context) { +void usetimedtext(Context & context) { context._cmp(context.data.word(326), 0); if (context.flags.z()) goto notext; context._sub(context.data.word(326), 1); @@ -14013,7 +14013,7 @@ deltimedtext: return; } -static void edenscdplayer(Context & context) { +void edenscdplayer(Context & context) { showfirstuse(context); context.data.word(19) = 18*2; context.data.word(21) = 25; @@ -14024,7 +14024,7 @@ static void edenscdplayer(Context & context) { return; } -static void usewall(Context & context) { +void usewall(Context & context) { showfirstuse(context); context._cmp(context.data.byte(474), 3); if (context.flags.z()) goto gobackover; @@ -14079,7 +14079,7 @@ gobackover: return; } -static void usechurchgate(Context & context) { +void usechurchgate(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto gatewith; withwhat(context); @@ -14117,7 +14117,7 @@ notopenchurch: return; } -static void usegun(Context & context) { +void usegun(Context & context) { context._cmp(context.data.byte(101), 4); if (context.flags.z()) goto istakengun; showseconduse(context); @@ -14272,7 +14272,7 @@ nottvsoldier: return; } -static void useshield(Context & context) { +void useshield(Context & context) { context._cmp(context.data.byte(183), 20); if (!context.flags.z()) goto notinsartroom; context._cmp(context.data.byte(63), 0); @@ -14289,7 +14289,7 @@ notinsartroom: return; } -static void usebuttona(Context & context) { +void usebuttona(Context & context) { context.al = 95; issetobonmap(context); if (context.flags.z()) goto donethisbit; @@ -14316,7 +14316,7 @@ donethisbit: return; } -static void useplate(Context & context) { +void useplate(Context & context) { context._cmp(context.data.byte(94), 255); if (!context.flags.z()) goto platewith; withwhat(context); @@ -14366,7 +14366,7 @@ triedknife: return; } -static void usewinch(Context & context) { +void usewinch(Context & context) { context.al = 40; context.ah = 1; checkinside(context); @@ -14400,7 +14400,7 @@ nowinch: return; } -static void entercode(Context & context) { +void entercode(Context & context) { context.data.word(282) = context.ax; context.data.word(284) = context.cx; getridofreels(context); @@ -14472,13 +14472,13 @@ numberright: return; } -static void loadkeypad(Context & context) { +void loadkeypad(Context & context) { context.dx = 1948; loadintotemp(context); return; } -static void quitkey(Context & context) { +void quitkey(Context & context) { context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyqk; context.data.byte(99) = 222; @@ -14497,7 +14497,7 @@ doqk: return; } -static void addtopresslist(Context & context) { +void addtopresslist(Context & context) { context._cmp(context.data.word(278), 5); if (context.flags.z()) goto nomorekeys; context.al = context.data.byte(277); @@ -14515,73 +14515,73 @@ nomorekeys: return; } -static void buttonone(Context & context) { +void buttonone(Context & context) { context.cl = 1; buttonpress(context); return; } -static void buttontwo(Context & context) { +void buttontwo(Context & context) { context.cl = 2; buttonpress(context); return; } -static void buttonthree(Context & context) { +void buttonthree(Context & context) { context.cl = 3; buttonpress(context); return; } -static void buttonfour(Context & context) { +void buttonfour(Context & context) { context.cl = 4; buttonpress(context); return; } -static void buttonfive(Context & context) { +void buttonfive(Context & context) { context.cl = 5; buttonpress(context); return; } -static void buttonsix(Context & context) { +void buttonsix(Context & context) { context.cl = 6; buttonpress(context); return; } -static void buttonseven(Context & context) { +void buttonseven(Context & context) { context.cl = 7; buttonpress(context); return; } -static void buttoneight(Context & context) { +void buttoneight(Context & context) { context.cl = 8; buttonpress(context); return; } -static void buttonnine(Context & context) { +void buttonnine(Context & context) { context.cl = 9; buttonpress(context); return; } -static void buttonnought(Context & context) { +void buttonnought(Context & context) { context.cl = 10; buttonpress(context); return; } -static void buttonenter(Context & context) { +void buttonenter(Context & context) { context.cl = 11; buttonpress(context); return; } -static void buttonpress(Context & context) { +void buttonpress(Context & context) { context.ch = context.cl; context._add(context.ch, 100); context._cmp(context.data.byte(99), context.ch); @@ -14613,7 +14613,7 @@ nonoise: return; } -static void showouterpad(Context & context) { +void showouterpad(Context & context) { context.di = 36+112-3; context.bx = 72-4; context.ds = context.data.word(456); @@ -14629,7 +14629,7 @@ static void showouterpad(Context & context) { return; } -static void showkeypad(Context & context) { +void showkeypad(Context & context) { context.al = 22; context.di = 36+112+9; context.bx = 72+5; @@ -14698,7 +14698,7 @@ notenter: return; } -static void singlekey(Context & context) { +void singlekey(Context & context) { context._cmp(context.data.byte(280), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); @@ -14713,7 +14713,7 @@ gotkey: return; } -static void dumpkeypad(Context & context) { +void dumpkeypad(Context & context) { context.di = 36+112-3; context.bx = 72-4; context.cl = 120; @@ -14722,7 +14722,7 @@ static void dumpkeypad(Context & context) { return; } -static void usemenu(Context & context) { +void usemenu(Context & context) { getridofreels(context); loadmenu(context); createpanel(context); @@ -14771,7 +14771,7 @@ menulist: return; } -static void dumpmenu(Context & context) { +void dumpmenu(Context & context) { context.di = 80+40; context.bx = 60; context.cl = 48; @@ -14780,7 +14780,7 @@ static void dumpmenu(Context & context) { return; } -static void getundermenu(Context & context) { +void getundermenu(Context & context) { context.di = 80+40; context.bx = 60; context.cl = 48; @@ -14791,7 +14791,7 @@ static void getundermenu(Context & context) { return; } -static void putundermenu(Context & context) { +void putundermenu(Context & context) { context.di = 80+40; context.bx = 60; context.cl = 48; @@ -14802,7 +14802,7 @@ static void putundermenu(Context & context) { return; } -static void showoutermenu(Context & context) { +void showoutermenu(Context & context) { context.al = 40; context.ah = 0; context.di = 80+40-34; @@ -14830,7 +14830,7 @@ static void showoutermenu(Context & context) { return; } -static void showmenu(Context & context) { +void showmenu(Context & context) { context._add(context.data.byte(289), 1); context._cmp(context.data.byte(289), 37*2); if (!context.flags.z()) goto menuframeok; @@ -14846,7 +14846,7 @@ menuframeok: return; } -static void loadmenu(Context & context) { +void loadmenu(Context & context) { context.dx = 1832; loadintotemp(context); context.dx = 1987; @@ -14854,7 +14854,7 @@ static void loadmenu(Context & context) { return; } -static void viewfolder(Context & context) { +void viewfolder(Context & context) { context.data.byte(130) = 1; getridofall(context); loadfolder(context); @@ -14884,7 +14884,7 @@ folderloop: return; } -static void nextfolder(Context & context) { +void nextfolder(Context & context) { context._cmp(context.data.byte(287), 12); if (!context.flags.z()) goto cannextf; blank(context); @@ -14915,7 +14915,7 @@ donextf: return; } -static void folderhints(Context & context) { +void folderhints(Context & context) { context._cmp(context.data.byte(287), 5); if (!context.flags.z()) goto notaideadd; context._cmp(context.data.byte(43), 1); @@ -14962,7 +14962,7 @@ notaristoadd: return; } -static void lastfolder(Context & context) { +void lastfolder(Context & context) { context._cmp(context.data.byte(287), 0); if (!context.flags.z()) goto canlastf; blank(context); @@ -14994,7 +14994,7 @@ dolastf: return; } -static void loadfolder(Context & context) { +void loadfolder(Context & context) { context.dx = 2299; loadintotemp(context); context.dx = 2312; @@ -15008,7 +15008,7 @@ static void loadfolder(Context & context) { return; } -static void showfolder(Context & context) { +void showfolder(Context & context) { context.data.byte(99) = 255; context._cmp(context.data.byte(287), 0); if (context.flags.z()) goto closedfolder; @@ -15069,7 +15069,7 @@ closedfolder: return; } -static void folderexit(Context & context) { +void folderexit(Context & context) { context.ds = context.data.word(458); context.di = 296; context.bx = 178; @@ -15079,7 +15079,7 @@ static void folderexit(Context & context) { return; } -static void showleftpage(Context & context) { +void showleftpage(Context & context) { context.ds = context.data.word(458); context.di = 0; context.bx = 12; @@ -15160,7 +15160,7 @@ flipfolderline: return; } -static void showrightpage(Context & context) { +void showrightpage(Context & context) { context.ds = context.data.word(458); context.di = 143; context.bx = 12; @@ -15214,7 +15214,7 @@ contrightpage: return; } -static void entersymbol(Context & context) { +void entersymbol(Context & context) { context.data.byte(130) = 1; getridofreels(context); context.dx = 2338; @@ -15280,7 +15280,7 @@ symbolwrong: return; } -static void quitsymbol(Context & context) { +void quitsymbol(Context & context) { context._cmp(context.data.byte(290), 24); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(293), 24); @@ -15303,7 +15303,7 @@ doqs: return; } -static void settopleft(Context & context) { +void settopleft(Context & context) { context._cmp(context.data.byte(292), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(99), 210); @@ -15319,7 +15319,7 @@ notopleft: return; } -static void settopright(Context & context) { +void settopright(Context & context) { context._cmp(context.data.byte(292), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(99), 211); @@ -15335,7 +15335,7 @@ notopright: return; } -static void setbotleft(Context & context) { +void setbotleft(Context & context) { context._cmp(context.data.byte(295), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(99), 212); @@ -15351,7 +15351,7 @@ nobotleft: return; } -static void setbotright(Context & context) { +void setbotright(Context & context) { context._cmp(context.data.byte(295), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(99), 213); @@ -15367,7 +15367,7 @@ nobotright: return; } -static void dumpsymbol(Context & context) { +void dumpsymbol(Context & context) { context.data.byte(108) = 0; context.di = 64; context.bx = 56+20; @@ -15377,7 +15377,7 @@ static void dumpsymbol(Context & context) { return; } -static void showsymbol(Context & context) { +void showsymbol(Context & context) { context.al = 12; context.ah = 0; context.di = 64; @@ -15450,7 +15450,7 @@ static void showsymbol(Context & context) { return; } -static void nextsymbol(Context & context) { +void nextsymbol(Context & context) { context._add(context.al, 1); context._cmp(context.al, 6); if (context.flags.z()) goto topwrap; @@ -15465,7 +15465,7 @@ botwrap: return; } -static void updatesymboltop(Context & context) { +void updatesymboltop(Context & context) { context._cmp(context.data.byte(292), 0); if (context.flags.z()) goto topfinished; context._cmp(context.data.byte(292), -1); @@ -15502,7 +15502,7 @@ topfinished: return; } -static void updatesymbolbot(Context & context) { +void updatesymbolbot(Context & context) { context._cmp(context.data.byte(295), 0); if (context.flags.z()) goto botfinished; context._cmp(context.data.byte(295), -1); @@ -15539,7 +15539,7 @@ botfinished: return; } -static void dumpsymbox(Context & context) { +void dumpsymbox(Context & context) { context._cmp(context.data.word(301), -1); if (context.flags.z()) goto nodumpsym; context.di = context.data.word(301); @@ -15552,7 +15552,7 @@ nodumpsym: return; } -static void usediary(Context & context) { +void usediary(Context & context) { getridofreels(context); context.dx = 2039; loadintotemp(context); @@ -15595,7 +15595,7 @@ diarylist: return; } -static void showdiary(Context & context) { +void showdiary(Context & context) { context.al = 1; context.ah = 0; context.di = 68+24; @@ -15611,7 +15611,7 @@ static void showdiary(Context & context) { return; } -static void showdiarykeys(Context & context) { +void showdiarykeys(Context & context) { context._cmp(context.data.byte(281), 0); if (context.flags.z()) goto nokeyatall; context._sub(context.data.byte(281), 1); @@ -15654,7 +15654,7 @@ nokeyatall: return; } -static void dumpdiarykeys(Context & context) { +void dumpdiarykeys(Context & context) { context._cmp(context.data.byte(281), 1); if (!context.flags.z()) goto notdumpdiary; context._cmp(context.data.byte(42), 1); @@ -15707,7 +15707,7 @@ notdumpdiary: return; } -static void diarykeyp(Context & context) { +void diarykeyp(Context & context) { context._cmp(context.data.byte(99), 214); if (context.flags.z()) goto alreadykeyp; context.data.byte(99) = 214; @@ -15733,7 +15733,7 @@ notkeyp: return; } -static void diarykeyn(Context & context) { +void diarykeyn(Context & context) { context._cmp(context.data.byte(99), 213); if (context.flags.z()) goto alreadykeyn; context.data.byte(99) = 213; @@ -15759,7 +15759,7 @@ notkeyn: return; } -static void showdiarypage(Context & context) { +void showdiarypage(Context & context) { context.al = 0; context.ah = 0; context.di = 68+24; @@ -15792,7 +15792,7 @@ static void showdiarypage(Context & context) { return; } -static void findtext1(Context & context) { +void findtext1(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -15803,7 +15803,7 @@ static void findtext1(Context & context) { return; } -static void zoomonoff(Context & context) { +void zoomonoff(Context & context) { context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(233), 2); @@ -15840,7 +15840,7 @@ dozoomonoff: return; } -static void saveload(Context & context) { +void saveload(Context & context) { context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(233), 2); @@ -15861,7 +15861,7 @@ noops: return; } -static void dosaveload(Context & context) { +void dosaveload(Context & context) { context.data.byte(230) = 0; context.data.word(77) = 70; context.data.word(79) = 182-8; @@ -15910,7 +15910,7 @@ justret: return; } -static void getbackfromops(Context & context) { +void getbackfromops(Context & context) { context._cmp(context.data.byte(55), 2); if (context.flags.z()) goto opsblock1; getback1(context); @@ -15920,7 +15920,7 @@ opsblock1: return; } -static void showmainops(Context & context) { +void showmainops(Context & context) { context.ds = context.data.word(456); context.di = 60+10; context.bx = 52+10; @@ -15942,7 +15942,7 @@ static void showmainops(Context & context) { return; } -static void showdiscops(Context & context) { +void showdiscops(Context & context) { context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; @@ -15970,13 +15970,13 @@ static void showdiscops(Context & context) { return; } -static void loadsavebox(Context & context) { +void loadsavebox(Context & context) { context.dx = 1961; loadintotemp(context); return; } -static void loadgame(Context & context) { +void loadgame(Context & context) { context._cmp(context.data.byte(99), 246); if (context.flags.z()) goto alreadyload; context.data.byte(99) = 246; @@ -16035,7 +16035,7 @@ quitloaded: return; } -static void getbacktoops(Context & context) { +void getbacktoops(Context & context) { context._cmp(context.data.byte(99), 201); if (context.flags.z()) goto alreadygetops; context.data.byte(99) = 201; @@ -16055,7 +16055,7 @@ dogetbackops: return; } -static void discops(Context & context) { +void discops(Context & context) { context._cmp(context.data.byte(99), 249); if (context.flags.z()) goto alreadydiscops; context.data.byte(99) = 249; @@ -16091,7 +16091,7 @@ discopsloop: return; } -static void savegame(Context & context) { +void savegame(Context & context) { context._cmp(context.data.byte(55), 2); if (!context.flags.z()) goto cansaveok; blank(context); @@ -16134,7 +16134,7 @@ saveops: return; } -static void actualsave(Context & context) { +void actualsave(Context & context) { context._cmp(context.data.byte(99), 222); if (context.flags.z()) goto alreadyactsave; context.data.byte(99) = 222; @@ -16194,7 +16194,7 @@ noactsave: return; } -static void actualload(Context & context) { +void actualload(Context & context) { context._cmp(context.data.byte(99), 221); if (context.flags.z()) goto alreadyactload; context.data.byte(99) = 221; @@ -16223,7 +16223,7 @@ notactload: return; } -static void selectslot2(Context & context) { +void selectslot2(Context & context) { context._cmp(context.data.word(200), 0); if (context.flags.z()) goto noselslot2; context.data.byte(339) = 2; @@ -16232,7 +16232,7 @@ noselslot2: return; } -static void checkinput(Context & context) { +void checkinput(Context & context) { context._cmp(context.data.byte(339), 3); if (context.flags.z()) goto nokeypress; readkey(context); @@ -16275,7 +16275,7 @@ afterkey: return; } -static void getnamepos(Context & context) { +void getnamepos(Context & context) { context.al = context.data.byte(340); context.ah = 0; context.cx = 17; @@ -16290,7 +16290,7 @@ static void getnamepos(Context & context) { return; } -static void showopbox(Context & context) { +void showopbox(Context & context) { context.ds = context.data.word(456); context.di = 60; context.bx = 52; @@ -16306,7 +16306,7 @@ static void showopbox(Context & context) { return; } -static void showloadops(Context & context) { +void showloadops(Context & context) { context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; @@ -16327,7 +16327,7 @@ static void showloadops(Context & context) { return; } -static void showsaveops(Context & context) { +void showsaveops(Context & context) { context.ds = context.data.word(456); context.di = 60+128+4; context.bx = 52+12; @@ -16348,7 +16348,7 @@ static void showsaveops(Context & context) { return; } -static void selectslot(Context & context) { +void selectslot(Context & context) { context._cmp(context.data.byte(99), 244); if (context.flags.z()) goto alreadysel; context.data.byte(99) = 244; @@ -16396,7 +16396,7 @@ noselslot: return; } -static void showslots(Context & context) { +void showslots(Context & context) { context.di = 60+7; context.bx = 52+8; context.al = 2; @@ -16427,7 +16427,7 @@ nomatchslot: return; } -static void shownames(Context & context) { +void shownames(Context & context) { context.dx = context.ds; context.es = context.dx; context.si = 8350+1; @@ -16493,7 +16493,7 @@ afterprintname: return; } -static void namestoold(Context & context) { +void namestoold(Context & context) { context.ds = context.cs; context.si = 8350; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); @@ -16503,7 +16503,7 @@ static void namestoold(Context & context) { return; } -static void oldtonames(Context & context) { +void oldtonames(Context & context) { context.es = context.cs; context.di = 8350; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); @@ -16513,7 +16513,7 @@ static void oldtonames(Context & context) { return; } -static void makeheader(Context & context) { +void makeheader(Context & context) { context.dx = context.ds; context.es = context.dx; context.di = 5912; @@ -16532,7 +16532,7 @@ static void makeheader(Context & context) { return; } -static void storeit(Context & context) { +void storeit(Context & context) { context._cmp(context.ax, 0); if (!context.flags.z()) goto isntblank; context._add(context.ax, 1); @@ -16541,7 +16541,7 @@ isntblank: return; } -static void findlen(Context & context) { +void findlen(Context & context) { context._sub(context.bx, 1); context._add(context.bx, context.ax); nextone: @@ -16555,7 +16555,7 @@ foundlen: return; } -static void decide(Context & context) { +void decide(Context & context) { setmode(context); loadpalfromiff(context); clearpalette(context); @@ -16592,7 +16592,7 @@ hasloadedroom: return; } -static void showdecisions(Context & context) { +void showdecisions(Context & context) { createpanel2(context); showopbox(context); context.ds = context.data.word(456); @@ -16605,7 +16605,7 @@ static void showdecisions(Context & context) { return; } -static void newgame(Context & context) { +void newgame(Context & context) { context._cmp(context.data.byte(99), 251); if (context.flags.z()) goto alreadynewgame; context.data.byte(99) = 251; @@ -16620,7 +16620,7 @@ nonewgame: return; } -static void doload(Context & context) { +void doload(Context & context) { context.data.byte(339) = 1; showopbox(context); showloadops(context); @@ -16665,7 +16665,7 @@ quitloaded: return; } -static void loadold(Context & context) { +void loadold(Context & context) { context._cmp(context.data.byte(99), 252); if (context.flags.z()) goto alreadyloadold; context.data.byte(99) = 252; @@ -16685,7 +16685,7 @@ noloadold: return; } -static void createname(Context & context) { +void createname(Context & context) { context.push(context.ax); context.di = 4932; context.ds.byte(context.di+0) = context.dl; @@ -16726,7 +16726,7 @@ tensc: return; } -static void trysoundalloc(Context & context) { +void trysoundalloc(Context & context) { context._cmp(context.data.byte(357), 1); if (context.flags.z()) goto gotsoundbuff; context._add(context.data.byte(356), 1); @@ -16758,7 +16758,7 @@ gotsoundbuff: return; } -static void playchannel0(Context & context) { +void playchannel0(Context & context) { context._cmp(context.data.byte(377), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); @@ -16806,7 +16806,7 @@ dontbother4: return; } -static void playchannel1(Context & context) { +void playchannel1(Context & context) { context._cmp(context.data.byte(377), 255); if (context.flags.z()) goto dontbother5; context._cmp(context.data.byte(514), 7); @@ -16846,7 +16846,7 @@ dontbother5: return; } -static void makenextblock(Context & context) { +void makenextblock(Context & context) { volumeadjust(context); loopchannel0(context); context._cmp(context.data.word(519), 0); @@ -16883,7 +16883,7 @@ notch0only: return; } -static void volumeadjust(Context & context) { +void volumeadjust(Context & context) { context.al = context.data.byte(387); context._cmp(context.al, 0); if (context.flags.z()) goto volok; @@ -16902,7 +16902,7 @@ volok: return; } -static void loopchannel0(Context & context) { +void loopchannel0(Context & context) { context._cmp(context.data.word(504), 0); if (!context.flags.z()) goto notloop; context._cmp(context.data.byte(507), 0); @@ -16923,20 +16923,20 @@ notloop: return; } -static void cancelch0(Context & context) { +void cancelch0(Context & context) { context.data.byte(507) = 0; context.data.word(504) = 0; context.data.byte(506) = 255; return; } -static void cancelch1(Context & context) { +void cancelch1(Context & context) { context.data.word(519) = 0; context.data.byte(514) = 255; return; } -static void channel0tran(Context & context) { +void channel0tran(Context & context) { context._cmp(context.data.byte(385), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; @@ -16958,7 +16958,7 @@ volloop: return; } -static void domix(Context & context) { +void domix(Context & context) { context._cmp(context.data.byte(385), 0); if (!context.flags.z()) goto lowvolumemix; slow: @@ -17050,7 +17050,7 @@ doneit: return; } -static void entrytexts(Context & context) { +void entrytexts(Context & context) { context._cmp(context.data.byte(8), 21); if (!context.flags.z()) goto notloc15; context.al = 28; @@ -17124,7 +17124,7 @@ noteden2: return; } -static void entryanims(Context & context) { +void entryanims(Context & context) { context.data.word(21) = -1; context.data.byte(31) = -1; context._cmp(context.data.byte(8), 33); @@ -17241,7 +17241,7 @@ notedensagain: return; } -static void initialinv(Context & context) { +void initialinv(Context & context) { context._cmp(context.data.byte(183), 24); if (context.flags.z()) goto isedens; return; @@ -17280,7 +17280,7 @@ isedens: return; } -static void pickupob(Context & context) { +void pickupob(Context & context) { context.data.byte(106) = context.ah; context.data.byte(101) = 2; context.data.byte(88) = context.al; @@ -17290,11 +17290,11 @@ static void pickupob(Context & context) { return; } -static void checkforemm(Context & context) { +void checkforemm(Context & context) { return; } -static void checkbasemem(Context & context) { +void checkbasemem(Context & context) { context.bx = context.data.word(532); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; @@ -17304,7 +17304,7 @@ enoughmem: return; } -static void allocatebuffers(Context & context) { +void allocatebuffers(Context & context) { context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; allocatemem(context); context.data.word(396) = context.ax; @@ -17338,7 +17338,7 @@ static void allocatebuffers(Context & context) { return; } -static void clearbuffers(Context & context) { +void clearbuffers(Context & context) { context.es = context.data.word(410); context.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; context.ax = 0; @@ -17365,7 +17365,7 @@ static void clearbuffers(Context & context) { return; } -static void clearchanges(Context & context) { +void clearchanges(Context & context) { context.es = context.data.word(410); context.cx = 250*2; context.ax = 0x0ffff; @@ -17406,7 +17406,7 @@ static void clearchanges(Context & context) { return; } -static void clearbeforeload(Context & context) { +void clearbeforeload(Context & context) { context._cmp(context.data.byte(73), 1); if (!context.flags.z()) goto noclear; clearreels(context); @@ -17416,7 +17416,7 @@ noclear: return; } -static void clearreels(Context & context) { +void clearreels(Context & context) { context.es = context.data.word(428); deallocatemem(context); context.es = context.data.word(430); @@ -17426,7 +17426,7 @@ static void clearreels(Context & context) { return; } -static void clearrest(Context & context) { +void clearrest(Context & context) { context.es = context.data.word(416); context.cx = 66*60/2; context.ax = 0; @@ -17453,7 +17453,7 @@ static void clearrest(Context & context) { return; } -static void parseblaster(Context & context) { +void parseblaster(Context & context) { lookattail: context.al = context.ds.byte(context.bx); context._cmp(context.al, 0); @@ -17519,7 +17519,7 @@ endtail: return; } -static void startup(Context & context) { +void startup(Context & context) { context.data.byte(141) = 0; context.data.byte(104) = 0; createpanel(context); @@ -17535,7 +17535,7 @@ static void startup(Context & context) { return; } -static void startup1(Context & context) { +void startup1(Context & context) { clearpalette(context); context.data.byte(60) = 0; context.data.byte(141) = '0'; @@ -17555,7 +17555,7 @@ static void startup1(Context & context) { return; } -static void screenupdate(Context & context) { +void screenupdate(Context & context) { newplace(context); mainscreen(context); animpointer(context); @@ -17603,7 +17603,7 @@ finishearly: return; } -static void watchreel(Context & context) { +void watchreel(Context & context) { context._cmp(context.data.word(21), -1); if (context.flags.z()) goto notplayingreel; context.al = context.data.byte(474); @@ -17678,7 +17678,7 @@ notreleasehold: return; } -static void checkforshake(Context & context) { +void checkforshake(Context & context) { context._cmp(context.data.byte(183), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); @@ -17688,7 +17688,7 @@ notstartshake: return; } -static void watchcount(Context & context) { +void watchcount(Context & context) { context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowatchworn; context._add(context.data.byte(145), 1); @@ -17726,7 +17726,7 @@ finishwatch: return; } -static void showtime(Context & context) { +void showtime(Context & context) { context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowatch; context.al = context.data.byte(4); @@ -17792,7 +17792,7 @@ nowatch: return; } -static void dumpwatch(Context & context) { +void dumpwatch(Context & context) { context._cmp(context.data.byte(265), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; @@ -17805,7 +17805,7 @@ nodumpwatch: return; } -static void showbyte(Context & context) { +void showbyte(Context & context) { context.dl = context.al; context._shr(context.dl, 1); context._shr(context.dl, 1); @@ -17821,7 +17821,7 @@ static void showbyte(Context & context) { return; } -static void onedigit(Context & context) { +void onedigit(Context & context) { context._cmp(context.dl, 10); if (!context.flags.c()) goto morethan10; context._add(context.dl, '0'); @@ -17832,7 +17832,7 @@ morethan10: return; } -static void twodigitnum(Context & context) { +void twodigitnum(Context & context) { context.ah = context.cl; context._sub(context.ah, 1); numloop1: @@ -17844,7 +17844,7 @@ numloop1: return; } -static void showword(Context & context) { +void showword(Context & context) { context.ch = 0; context.bx = 10000; context.cl = 47; @@ -17889,7 +17889,7 @@ word4: return; } -static void convnum(Context & context) { +void convnum(Context & context) { context._cmp(context.ch, 0); if (!context.flags.z()) goto noconvnum; context._cmp(context.cl, '0'); @@ -17902,7 +17902,7 @@ noconvnum: return; } -static void walkandexamine(Context & context) { +void walkandexamine(Context & context) { finishedwalking(context); if (!context.flags.z()) goto noobselect; context.al = context.data.byte(306); @@ -17973,7 +17973,7 @@ toofaraway: return; } -static void mainscreen(Context & context) { +void mainscreen(Context & context) { context.data.byte(236) = 0; context.bx = 4949; context._cmp(context.data.byte(2), 1); @@ -17988,7 +17988,7 @@ finishmain: return; } -static void madmanrun(Context & context) { +void madmanrun(Context & context) { context._cmp(context.data.byte(8), 14); if (!context.flags.z()) { identifyob(context); return; }; context._cmp(context.data.byte(147), 22); @@ -18013,7 +18013,7 @@ norun: return; } -static void checkcoords(Context & context) { +void checkcoords(Context & context) { loop048: context.ax = context.ds.word(context.bx); context._cmp(context.ax, 0x0ffff); @@ -18043,7 +18043,7 @@ nonefound: return; } -static void identifyob(Context & context) { +void identifyob(Context & context) { context._cmp(context.data.word(19), 0); if (!context.flags.z()) { blank(context); return; }; context.ax = context.data.word(196); @@ -18098,7 +18098,7 @@ nothingund: return; } -static void checkifperson(Context & context) { +void checkifperson(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.cx = 12; @@ -18154,7 +18154,7 @@ notareelid: return; } -static void checkifset(Context & context) { +void checkifset(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; @@ -18187,7 +18187,7 @@ notasetid: return; } -static void checkifex(Context & context) { +void checkifex(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; @@ -18216,7 +18216,7 @@ notanexid: return; } -static void checkiffree(Context & context) { +void checkiffree(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; @@ -18245,7 +18245,7 @@ notafreeid: return; } -static void isitdescribed(Context & context) { +void isitdescribed(Context & context) { context.push(context.ax); context.push(context.cx); context.push(context.es); @@ -18268,7 +18268,7 @@ static void isitdescribed(Context & context) { return; } -static void findpathofpoint(Context & context) { +void findpathofpoint(Context & context) { context.push(context.ax); context.bx = 0; context.es = context.data.word(448); @@ -18306,7 +18306,7 @@ gotvalidpath: return; } -static void findfirstpath(Context & context) { +void findfirstpath(Context & context) { context.push(context.ax); context.bx = 0; context.es = context.data.word(448); @@ -18343,7 +18343,7 @@ gotfirst: return; } -static void turnpathon(Context & context) { +void turnpathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18366,7 +18366,7 @@ nopathon: return; } -static void turnpathoff(Context & context) { +void turnpathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18389,7 +18389,7 @@ nopathoff: return; } -static void turnanypathon(Context & context) { +void turnanypathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18415,7 +18415,7 @@ static void turnanypathon(Context & context) { return; } -static void turnanypathoff(Context & context) { +void turnanypathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18441,7 +18441,7 @@ static void turnanypathoff(Context & context) { return; } -static void checkifpathison(Context & context) { +void checkifpathison(Context & context) { context.push(context.ax); getroomspaths(context); context.ax = context.pop(); @@ -18455,7 +18455,7 @@ static void checkifpathison(Context & context) { return; } -static void afternewroom(Context & context) { +void afternewroom(Context & context) { context._cmp(context.data.byte(185), 0); if (context.flags.z()) goto notnew; context.data.word(326) = 0; @@ -18493,7 +18493,7 @@ notnew: return; } -static void atmospheres(Context & context) { +void atmospheres(Context & context) { context.cl = context.data.byte(147); context.ch = context.data.byte(148); context.bx = 5073; @@ -18547,7 +18547,7 @@ nomoreatmos: return; } -static void walkintoroom(Context & context) { +void walkintoroom(Context & context) { context._cmp(context.data.byte(8), 14); if (!context.flags.z()) goto notlair; context._cmp(context.data.byte(147), 22); @@ -18559,7 +18559,7 @@ notlair: return; } -static void afterintroroom(Context & context) { +void afterintroroom(Context & context) { context._cmp(context.data.byte(185), 0); if (context.flags.z()) goto notnewintro; clearwork(context); @@ -18575,7 +18575,7 @@ notnewintro: return; } -static void obname(Context & context) { +void obname(Context & context) { context._cmp(context.data.byte(472), 0); if (context.flags.z()) goto notnewpath; context.data.byte(472) = 0; @@ -18685,7 +18685,7 @@ toofaraway: return; } -static void finishedwalking(Context & context) { +void finishedwalking(Context & context) { context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto iswalking; context.al = context.data.byte(132); @@ -18694,7 +18694,7 @@ iswalking: return; } -static void examineobtext(Context & context) { +void examineobtext(Context & context) { context.bl = context.data.byte(98); context.bh = context.data.byte(99); context.al = 1; @@ -18702,7 +18702,7 @@ static void examineobtext(Context & context) { return; } -static void commandwithob(Context & context) { +void commandwithob(Context & context) { context.push(context.ax); context.push(context.ax); context.push(context.bx); @@ -18755,7 +18755,7 @@ noadd: return; } -static void commandonly(Context & context) { +void commandonly(Context & context) { context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -18790,7 +18790,7 @@ static void commandonly(Context & context) { return; } -static void printmessage(Context & context) { +void printmessage(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -18810,7 +18810,7 @@ static void printmessage(Context & context) { return; } -static void printmessage2(Context & context) { +void printmessage2(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -18838,7 +18838,7 @@ searchmess: return; } -static void blocknametext(Context & context) { +void blocknametext(Context & context) { context.bl = context.data.byte(98); context.bh = context.data.byte(99); context.al = 0; @@ -18846,7 +18846,7 @@ static void blocknametext(Context & context) { return; } -static void personnametext(Context & context) { +void personnametext(Context & context) { context.bl = context.data.byte(98); context._and(context.bl, 127); context.bh = context.data.byte(99); @@ -18855,7 +18855,7 @@ static void personnametext(Context & context) { return; } -static void walktotext(Context & context) { +void walktotext(Context & context) { context.bl = context.data.byte(98); context.bh = context.data.byte(99); context.al = 3; @@ -18863,7 +18863,7 @@ static void walktotext(Context & context) { return; } -static void getflagunderp(Context & context) { +void getflagunderp(Context & context) { context.cx = context.data.word(196); context._sub(context.cx, context.data.word(115)); context.ax = context.data.word(198); @@ -18875,7 +18875,7 @@ static void getflagunderp(Context & context) { return; } -static void setwalk(Context & context) { +void setwalk(Context & context) { context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto alreadywalking; context.al = context.data.byte(473); @@ -18913,7 +18913,7 @@ holdingreel: return; } -static void autosetwalk(Context & context) { +void autosetwalk(Context & context) { context.al = context.data.byte(474); context._cmp(context.data.byte(476), context.al); if (!context.flags.z()) goto notsamealready; @@ -18964,7 +18964,7 @@ normalline: return; } -static void checkdest(Context & context) { +void checkdest(Context & context) { context.push(context.bx); context._add(context.bx, 12*8); context.ah = context.data.byte(474); @@ -19011,7 +19011,7 @@ nextcheck2: return; } -static void bresenhams(Context & context) { +void bresenhams(Context & context) { workoutframes(context); context.dx = context.ds; context.es = context.dx; @@ -19124,7 +19124,7 @@ lineexit: return; } -static void workoutframes(Context & context) { +void workoutframes(Context & context) { context.bx = context.data.word(478); context._add(context.bx, 32); context.ax = context.data.word(482); @@ -19202,7 +19202,7 @@ success: return; } -static void getroomspaths(Context & context) { +void getroomspaths(Context & context) { context.al = context.data.byte(184); context.ah = 0; context.cx = 144; @@ -19213,7 +19213,7 @@ static void getroomspaths(Context & context) { return; } -static void copyname(Context & context) { +void copyname(Context & context) { context.push(context.di); findobname(context); context.di = context.pop(); @@ -19238,7 +19238,7 @@ finishmakename: return; } -static void findobname(Context & context) { +void findobname(Context & context) { context.push(context.ax); context.ah = 0; context._add(context.ax, context.ax); @@ -19296,7 +19296,7 @@ notsetname: return; } -static void showicon(Context & context) { +void showicon(Context & context) { context._cmp(context.data.byte(183), 50); if (!context.flags.c()) goto isdream1; showpanel(context); @@ -19346,7 +19346,7 @@ isdream1: return; } -static void middlepanel(Context & context) { +void middlepanel(Context & context) { context.ds = context.data.word(462); context.di = 72+47+20; context.bx = 0; @@ -19374,7 +19374,7 @@ static void middlepanel(Context & context) { return; } -static void showman(Context & context) { +void showman(Context & context) { context.ds = context.data.word(406); context.di = 0; context.bx = 0; @@ -19399,7 +19399,7 @@ notverycool: return; } -static void showpanel(Context & context) { +void showpanel(Context & context) { context.ds = context.data.word(406); context.di = 72; context.bx = 0; @@ -19415,7 +19415,7 @@ static void showpanel(Context & context) { return; } -static void roomname(Context & context) { +void roomname(Context & context) { context.di = 88; context.bx = 18; context.al = 53; @@ -19449,19 +19449,19 @@ gotpl: return; } -static void usecharset1(Context & context) { +void usecharset1(Context & context) { context.ax = context.data.word(402); context.data.word(266) = context.ax; return; } -static void usetempcharset(Context & context) { +void usetempcharset(Context & context) { context.ax = context.data.word(404); context.data.word(266) = context.ax; return; } -static void showexit(Context & context) { +void showexit(Context & context) { context.ds = context.data.word(406); context.di = 274; context.bx = 154; @@ -19471,7 +19471,7 @@ static void showexit(Context & context) { return; } -static void panelicons1(Context & context) { +void panelicons1(Context & context) { context.di = 0; context._cmp(context.data.byte(2), 1); if (context.flags.z()) goto watchison; @@ -19500,7 +19500,7 @@ zoomisoff: return; } -static void showwatch(Context & context) { +void showwatch(Context & context) { context._cmp(context.data.byte(2), 0); if (context.flags.z()) goto nowristwatch; context.ds = context.data.word(406); @@ -19514,7 +19514,7 @@ nowristwatch: return; } -static void zoomicon(Context & context) { +void zoomicon(Context & context) { context._cmp(context.data.byte(7), 0); if (context.flags.z()) goto nozoom1; context.ds = context.data.word(406); @@ -19527,7 +19527,7 @@ nozoom1: return; } -static void showblink(Context & context) { +void showblink(Context & context) { context._cmp(context.data.byte(130), 1); if (context.flags.z()) goto finblink1; context._add(context.data.byte(471), 1); @@ -19561,7 +19561,7 @@ eyesshut: return; } -static void dumpblink(Context & context) { +void dumpblink(Context & context) { context._cmp(context.data.byte(3), 0); if (!context.flags.z()) goto nodumpeye; context._cmp(context.data.byte(471), 0); @@ -19580,7 +19580,7 @@ nodumpeye: return; } -static void worktoscreenm(Context & context) { +void worktoscreenm(Context & context) { animpointer(context); readmouse(context); showpointer(context); @@ -19590,7 +19590,7 @@ static void worktoscreenm(Context & context) { return; } -static void blank(Context & context) { +void blank(Context & context) { context._cmp(context.data.byte(99), 199); if (context.flags.z()) goto alreadyblnk; context.data.byte(99) = 199; @@ -19600,14 +19600,14 @@ alreadyblnk: return; } -static void allpointer(Context & context) { +void allpointer(Context & context) { readmouse(context); showpointer(context); dumppointer(context); return; } -static void hangonp(Context & context) { +void hangonp(Context & context) { context.push(context.cx); context._add(context.cx, context.cx); context.ax = context.pop(); @@ -19651,7 +19651,7 @@ getoutofit: return; } -static void hangonw(Context & context) { +void hangonw(Context & context) { hangloopw: context.push(context.cx); delpointer(context); @@ -19665,7 +19665,7 @@ hangloopw: return; } -static void hangoncurs(Context & context) { +void hangoncurs(Context & context) { monloop1: context.push(context.cx); printcurs(context); @@ -19676,7 +19676,7 @@ monloop1: return; } -static void getunderzoom(Context & context) { +void getunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; context.ds = context.data.word(410); @@ -19687,7 +19687,7 @@ static void getunderzoom(Context & context) { return; } -static void dumpzoom(Context & context) { +void dumpzoom(Context & context) { context._cmp(context.data.byte(7), 1); if (!context.flags.z()) goto notzoomon; context.di = 8+5; @@ -19699,7 +19699,7 @@ notzoomon: return; } -static void putunderzoom(Context & context) { +void putunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; context.ds = context.data.word(410); @@ -19710,7 +19710,7 @@ static void putunderzoom(Context & context) { return; } -static void crosshair(Context & context) { +void crosshair(Context & context) { context._cmp(context.data.byte(99), 3); if (context.flags.z()) goto nocross; context._cmp(context.data.byte(99), 10); @@ -19734,7 +19734,7 @@ nocross: return; } -static void showpointer(Context & context) { +void showpointer(Context & context) { showblink(context); context.di = context.data.word(196); context.data.word(218) = context.di; @@ -19842,7 +19842,7 @@ notsmally2: return; } -static void delpointer(Context & context) { +void delpointer(Context & context) { context.ax = context.data.word(218); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; @@ -19862,7 +19862,7 @@ nevershown: return; } -static void dumppointer(Context & context) { +void dumppointer(Context & context) { dumpblink(context); context.cl = context.data.byte(228); context.ch = context.data.byte(229); @@ -19883,7 +19883,7 @@ notboth: return; } -static void undertextline(Context & context) { +void undertextline(Context & context) { context.di = context.data.word(77); context.bx = context.data.word(79); context._sub(context.bx, 3); @@ -19895,7 +19895,7 @@ static void undertextline(Context & context) { return; } -static void deltextline(Context & context) { +void deltextline(Context & context) { context.di = context.data.word(77); context.bx = context.data.word(79); context._sub(context.bx, 3); @@ -19907,7 +19907,7 @@ static void deltextline(Context & context) { return; } -static void dumptextline(Context & context) { +void dumptextline(Context & context) { context._cmp(context.data.byte(108), 1); if (!context.flags.z()) goto nodumptextline; context.data.byte(108) = 0; @@ -19921,7 +19921,7 @@ nodumptextline: return; } -static void animpointer(Context & context) { +void animpointer(Context & context) { context._cmp(context.data.byte(233), 2); if (context.flags.z()) goto combathand; context._cmp(context.data.byte(233), 3); @@ -19987,7 +19987,7 @@ notarrow: return; } -static void readmouse(Context & context) { +void readmouse(Context & context) { context.ax = context.data.word(200); context.data.word(210) = context.ax; context.ax = context.data.word(196); @@ -20001,7 +20001,7 @@ static void readmouse(Context & context) { return; } -static void readmouse1(Context & context) { +void readmouse1(Context & context) { context.ax = context.data.word(196); context.data.word(212) = context.ax; context.ax = context.data.word(198); @@ -20013,7 +20013,7 @@ static void readmouse1(Context & context) { return; } -static void readmouse2(Context & context) { +void readmouse2(Context & context) { context.ax = context.data.word(196); context.data.word(212) = context.ax; context.ax = context.data.word(198); @@ -20025,7 +20025,7 @@ static void readmouse2(Context & context) { return; } -static void readmouse3(Context & context) { +void readmouse3(Context & context) { context.ax = context.data.word(196); context.data.word(212) = context.ax; context.ax = context.data.word(198); @@ -20037,7 +20037,7 @@ static void readmouse3(Context & context) { return; } -static void readmouse4(Context & context) { +void readmouse4(Context & context) { context.ax = context.data.word(200); context.data.word(210) = context.ax; context.ax = context.data.word(196); @@ -20055,7 +20055,7 @@ static void readmouse4(Context & context) { return; } -static void readkey(Context & context) { +void readkey(Context & context) { context.bx = context.data.word(394); context._cmp(context.bx, context.data.word(392)); if (context.flags.z()) goto nokey; @@ -20072,7 +20072,7 @@ nokey: return; } -static void convertkey(Context & context) { +void convertkey(Context & context) { context._and(context.al, 127); context.ah = 0; context.di = 5731; @@ -20081,7 +20081,7 @@ static void convertkey(Context & context) { return; } -static void randomnum1(Context & context) { +void randomnum1(Context & context) { context.push(context.ds); context.push(context.es); context.push(context.di); @@ -20096,7 +20096,7 @@ static void randomnum1(Context & context) { return; } -static void randomnum2(Context & context) { +void randomnum2(Context & context) { context.push(context.ds); context.push(context.es); context.push(context.di); @@ -20112,7 +20112,7 @@ static void randomnum2(Context & context) { return; } -static void hangon(Context & context) { +void hangon(Context & context) { hangonloop: context.push(context.cx); vsync(context); @@ -20121,41 +20121,41 @@ hangonloop: return; } -static void loadtraveltext(Context & context) { +void loadtraveltext(Context & context) { context.dx = 2234; standardload(context); context.data.word(454) = context.ax; return; } -static void loadintotemp(Context & context) { +void loadintotemp(Context & context) { context.ds = context.cs; standardload(context); context.data.word(456) = context.ax; return; } -static void loadintotemp2(Context & context) { +void loadintotemp2(Context & context) { context.ds = context.cs; standardload(context); context.data.word(458) = context.ax; return; } -static void loadintotemp3(Context & context) { +void loadintotemp3(Context & context) { context.ds = context.cs; standardload(context); context.data.word(460) = context.ax; return; } -static void loadtempcharset(Context & context) { +void loadtempcharset(Context & context) { standardload(context); context.data.word(404) = context.ax; return; } -static void standardload(Context & context) { +void standardload(Context & context) { openfile(context); readheader(context); context.bx = context.ds.word(context.di); @@ -20173,13 +20173,13 @@ static void standardload(Context & context) { return; } -static void loadtemptext(Context & context) { +void loadtemptext(Context & context) { standardload(context); context.data.word(464) = context.ax; return; } -static void loadroom(Context & context) { +void loadroom(Context & context) { context.data.byte(73) = 1; context.data.word(326) = 0; context.data.word(136) = 0; @@ -20199,7 +20199,7 @@ static void loadroom(Context & context) { return; } -static void loadroomssample(Context & context) { +void loadroomssample(Context & context) { context.al = context.data.byte(530); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; @@ -20218,7 +20218,7 @@ loadedalready: return; } -static void getridofreels(Context & context) { +void getridofreels(Context & context) { context._cmp(context.data.byte(73), 0); if (context.flags.z()) goto dontgetrid; context.es = context.data.word(428); @@ -20231,7 +20231,7 @@ dontgetrid: return; } -static void getridofall(Context & context) { +void getridofall(Context & context) { context.es = context.data.word(414); deallocatemem(context); context.es = context.data.word(442); @@ -20259,7 +20259,7 @@ static void getridofall(Context & context) { return; } -static void restorereels(Context & context) { +void restorereels(Context & context) { context._cmp(context.data.byte(73), 0); if (context.flags.z()) goto dontrestore; context.al = context.data.byte(183); @@ -20291,7 +20291,7 @@ dontrestore: return; } -static void restoreall(Context & context) { +void restoreall(Context & context) { context.al = context.data.byte(8); getroomdata(context); context.dx = context.bx; @@ -20371,7 +20371,7 @@ static void restoreall(Context & context) { return; } -static void sortoutmap(Context & context) { +void sortoutmap(Context & context) { context.push(context.es); context.push(context.di); context.ds = context.data.word(398); @@ -20393,7 +20393,7 @@ blimey: return; } -static void startloading(Context & context) { +void startloading(Context & context) { context.data.byte(63) = 0; context.al = context.ds.byte(context.bx+13); context.data.byte(530) = context.al; @@ -20528,7 +20528,7 @@ dontwalkin: return; } -static void disablepath(Context & context) { +void disablepath(Context & context) { context.push(context.cx); context._xchg(context.al, context.ah); context.cx = -6; @@ -20560,7 +20560,7 @@ lookx2: return; } -static void findxyfrompath(Context & context) { +void findxyfrompath(Context & context) { getroomspaths(context); context.al = context.data.byte(474); context.ah = 0; @@ -20576,7 +20576,7 @@ static void findxyfrompath(Context & context) { return; } -static void findroominloc(Context & context) { +void findroominloc(Context & context) { context.al = context.data.byte(148); context.cx = -6; looky: @@ -20593,7 +20593,7 @@ lookx: return; } -static void getroomdata(Context & context) { +void getroomdata(Context & context) { context.ah = 0; context.cx = 32; context._mul(context.cx); @@ -20602,7 +20602,7 @@ static void getroomdata(Context & context) { return; } -static void readheader(Context & context) { +void readheader(Context & context) { context.ds = context.cs; context.dx = 5862; context.cx = 5958-5862; @@ -20612,7 +20612,7 @@ static void readheader(Context & context) { return; } -static void allocateload(Context & context) { +void allocateload(Context & context) { context.push(context.es); context.push(context.di); context.bx = context.ds.word(context.di); @@ -20624,7 +20624,7 @@ static void allocateload(Context & context) { return; } -static void fillspace(Context & context) { +void fillspace(Context & context) { context.push(context.es); context.push(context.ds); context.push(context.dx); @@ -20641,43 +20641,43 @@ static void fillspace(Context & context) { return; } -static void getridoftemp(Context & context) { +void getridoftemp(Context & context) { context.es = context.data.word(456); deallocatemem(context); return; } -static void getridoftemptext(Context & context) { +void getridoftemptext(Context & context) { context.es = context.data.word(464); deallocatemem(context); return; } -static void getridoftemp2(Context & context) { +void getridoftemp2(Context & context) { context.es = context.data.word(458); deallocatemem(context); return; } -static void getridoftemp3(Context & context) { +void getridoftemp3(Context & context) { context.es = context.data.word(460); deallocatemem(context); return; } -static void getridoftempcharset(Context & context) { +void getridoftempcharset(Context & context) { context.es = context.data.word(404); deallocatemem(context); return; } -static void getridoftempsp(Context & context) { +void getridoftempsp(Context & context) { context.es = context.data.word(462); deallocatemem(context); return; } -static void readsetdata(Context & context) { +void readsetdata(Context & context) { context.dx = 1857; standardload(context); context.data.word(402) = context.ax; @@ -20711,7 +20711,7 @@ novolumeload: return; } -static void dreamweb(Context & context) { +void dreamweb(Context & context) { seecommandtail(context); checkbasemem(context); soundstartup(context); -- cgit v1.2.3 From e654b5063201f4264533fde2964a54a7df692215 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 9 Jun 2011 23:49:12 +0400 Subject: DREAMWEB: removed generated code --- engines/dreamweb/dreamweb.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 4714511296..5c8c6da0c9 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -504,27 +504,7 @@ void readoneblock(Context &context) { readfromfile(context); } -// TODO: This is already defined in dreamgen.cpp, so expose it should be -// exposed from there. Once that's done, remove this copy! - -static void readabyte(Context & context) { - context._cmp(context.si, 30000); - if (!context.flags.z()) goto notendblock; - context.push(context.bx); - context.push(context.es); - context.push(context.di); - context.push(context.ds); - context.push(context.si); - readoneblock(context); - context.si = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context.si = 0; -notendblock: - context._lodsb(); -} +void readabyte(Context & context); void showpcx(Context &context) { openfile(context); -- cgit v1.2.3 From 90440a2b6890d65ce05ed93b5f83f3b4b20e070a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 00:53:20 +0400 Subject: DREAMWEB: added assertion in pop() --- engines/dreamweb/runtime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 8d4592f401..1def57a50d 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -434,6 +434,7 @@ public: } inline uint16 pop() { + assert(!stack.empty()); uint16 v = stack.back(); stack.pop_back(); return v; -- cgit v1.2.3 From 2f9e63579d22ff1075620ef16b3c04e829dc73f4 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 00:58:13 +0400 Subject: DREAMWEB: fixed missing explicit segment specification. added verbose data dump to the generator --- devtools/tasmrecover/tasm/cpp.py | 10 +- devtools/tasmrecover/tasm/parser.py | 3 + engines/dreamweb/dreamgen.cpp | 1388 +++++++++++++++++------------------ 3 files changed, 703 insertions(+), 698 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index f5f7057211..831074976d 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -146,9 +146,11 @@ namespace %s { m = re.match(r'(\w{2,2}):(.*)$', expr) if m is not None: - seg = m.group(1) + seg_prefix = m.group(1) expr = m.group(2).strip() - print "SEGMENT %s, remains: %s" %(seg, expr) + print "SEGMENT %s, remains: %s" %(seg_prefix, expr) + else: + seg_prefix = "ds" m = re.match(r'(([abcd][xhl])|si|di|bp|sp)([\+-].*)?$', expr) if m is not None: @@ -174,9 +176,9 @@ namespace %s { if indirection == 1: if size == 1: - expr = "context.ds.byte(%s)" %expr + expr = "context.%s.byte(%s)" %(seg_prefix, expr) elif size == 2: - expr = "context.ds.word(%s)" %expr + expr = "context.%s.word(%s)" %(seg_prefix, expr) else: expr = "@invalid size 0" elif indirection == 0: diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 2391aa442b..b1d7995597 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -101,6 +101,7 @@ class parser: return text def fix_dollar(self, v): + print("$ = %d" %len(self.binary_data)) return re.sub(r'\$', "%d" %len(self.binary_data), v) def parse_int(self, v): @@ -198,6 +199,7 @@ class parser: if cmd0 == 'db' or cmd0 == 'dw' or cmd0 == 'dd': arg = " ".join(cmd[1:]) + print "%d: %s" %(len(self.binary_data), line) #fixme: COPYPASTE binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd0[1]] self.binary_data += self.compact_data(binary_width, lex.parse_args(arg)) continue @@ -221,6 +223,7 @@ class parser: v = cmd[2] self.set_global(cmd0, op.const(self.fix_dollar(v))) elif cmd1 == 'db' or cmd1 == 'dw' or cmd1 == 'dd': + print "%d: %s" %(len(self.binary_data), line) binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd1[1]] offset = len(self.binary_data) self.binary_data += self.compact_data(binary_width, lex.parse_args(" ".join(cmd[2:]))) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index f7acf6e82c..8ae92d841a 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -481,7 +481,7 @@ void intro3text(Context &context); void intro1text(Context &context); void alleybarksound(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._sub(context.ax, 1); context._cmp(context.ax, 0); if (!context.flags.z()) goto nobark; @@ -493,7 +493,7 @@ void alleybarksound(Context & context) { context.bx = context.pop(); context.ax = 1000; nobark: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; return; } @@ -517,35 +517,35 @@ void receptionist(Context & context) { context._cmp(context.data.byte(51), 1); if (!context.flags.z()) goto notsetcard; context._add(context.data.byte(51), 1); - context.ds.byte(context.bx+7) = 1; - context.ds.word(context.bx+3) = 64; + context.es.byte(context.bx+7) = 1; + context.es.word(context.bx+3) = 64; notsetcard: - context._cmp(context.ds.word(context.bx+3), 58); + context._cmp(context.es.word(context.bx+3), 58); if (!context.flags.z()) goto notdes1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto notdes2; - context.ds.word(context.bx+3) = 55; + context.es.word(context.bx+3) = 55; goto gotrecep; notdes1: - context._cmp(context.ds.word(context.bx+3), 60); + context._cmp(context.es.word(context.bx+3), 60); if (!context.flags.z()) goto notdes2; randomnumber(context); context._cmp(context.al, 240); if (context.flags.c()) goto gotrecep; - context.ds.word(context.bx+3) = 53; + context.es.word(context.bx+3) = 53; goto gotrecep; notdes2: - context._cmp(context.ds.word(context.bx+3), 88); + context._cmp(context.es.word(context.bx+3), 88); if (!context.flags.z()) goto notendcard; - context.ds.word(context.bx+3) = 53; + context.es.word(context.bx+3) = 53; goto gotrecep; notendcard: - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); gotrecep: showgamereel(context); addtopeoplelist(context); - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedrecep; context.data.byte(50) = 1; @@ -556,7 +556,7 @@ nottalkedrecep: void smokebloke(Context & context) { context._cmp(context.data.byte(40), 0); if (!context.flags.z()) goto notspokento; - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto notspokento; context.push(context.es); @@ -568,20 +568,20 @@ void smokebloke(Context & context) { notspokento: checkspeed(context); if (!context.flags.z()) goto gotsmokeb; - context._cmp(context.ds.word(context.bx+3), 100); + context._cmp(context.es.word(context.bx+3), 100); if (!context.flags.z()) goto notsmokeb1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto notsmokeb2; - context.ds.word(context.bx+3) = 96; + context.es.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb1: - context._cmp(context.ds.word(context.bx+3), 117); + context._cmp(context.es.word(context.bx+3), 117); if (!context.flags.z()) goto notsmokeb2; - context.ds.word(context.bx+3) = 96; + context.es.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb2: - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); gotsmokeb: showgamereel(context); addtopeoplelist(context); @@ -591,7 +591,7 @@ gotsmokeb: void attendant(Context & context) { showgamereel(context); addtopeoplelist(context); - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalked; context.data.byte(47) = 1; @@ -600,9 +600,9 @@ nottalked: } void manasleep(Context & context) { - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 127); - context.ds.byte(context.bx+7) = context.al; + context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); return; @@ -658,22 +658,22 @@ void louischair(Context & context) { if (context.flags.z()) goto notlouis2; checkspeed(context); if (!context.flags.z()) goto notlouisanim; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 191); if (context.flags.z()) goto restartlouis; context._cmp(context.ax, 185); if (context.flags.z()) goto randomlouis; - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; goto notlouisanim; randomlouis: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; randomnumber(context); context._cmp(context.al, 245); if (!context.flags.c()) goto notlouisanim; restartlouis: context.ax = 182; - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; notlouisanim: showgamereel(context); addtopeoplelist(context); @@ -682,9 +682,9 @@ notlouis2: } void manasleep2(Context & context) { - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 127); - context.ds.byte(context.bx+7) = context.al; + context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); return; @@ -705,18 +705,18 @@ void tattooman(Context & context) { void drinker(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotdrinker; - context._add(context.ds.word(context.bx+3), 1); - context._cmp(context.ds.word(context.bx+3), 115); + context._add(context.es.word(context.bx+3), 1); + context._cmp(context.es.word(context.bx+3), 115); if (!context.flags.z()) goto notdrinker1; - context.ds.word(context.bx+3) = 105; + context.es.word(context.bx+3) = 105; goto gotdrinker; notdrinker1: - context._cmp(context.ds.word(context.bx+3), 106); + context._cmp(context.es.word(context.bx+3), 106); if (!context.flags.z()) goto gotdrinker; randomnumber(context); context._cmp(context.al, 3); if (context.flags.c()) goto gotdrinker; - context.ds.word(context.bx+3) = 105; + context.es.word(context.bx+3) = 105; gotdrinker: showgamereel(context); addtopeoplelist(context); @@ -726,25 +726,25 @@ gotdrinker: void bartender(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotsmoket; - context._cmp(context.ds.word(context.bx+3), 86); + context._cmp(context.es.word(context.bx+3), 86); if (!context.flags.z()) goto notsmoket1; randomnumber(context); context._cmp(context.al, 18); if (context.flags.c()) goto notsmoket2; - context.ds.word(context.bx+3) = 81; + context.es.word(context.bx+3) = 81; goto gotsmoket; notsmoket1: - context._cmp(context.ds.word(context.bx+3), 103); + context._cmp(context.es.word(context.bx+3), 103); if (!context.flags.z()) goto notsmoket2; - context.ds.word(context.bx+3) = 81; + context.es.word(context.bx+3) = 81; goto gotsmoket; notsmoket2: - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); gotsmoket: showgamereel(context); context._cmp(context.data.byte(45), 1); if (!context.flags.z()) goto notgotgun; - context.ds.byte(context.bx+7) = 9; + context.es.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); return; @@ -765,25 +765,25 @@ void barwoman(Context & context) { void interviewer(Context & context) { context._cmp(context.data.word(21), 68); if (!context.flags.z()) goto notgeneralstart; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); notgeneralstart: - context._cmp(context.ds.word(context.bx+3), 250); + context._cmp(context.es.word(context.bx+3), 250); if (context.flags.z()) goto talking; checkspeed(context); if (!context.flags.z()) goto talking; - context._cmp(context.ds.word(context.bx+3), 259); + context._cmp(context.es.word(context.bx+3), 259); if (context.flags.z()) goto talking; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); talking: showgamereel(context); return; } void soldier1(Context & context) { - context._cmp(context.ds.word(context.bx+3), 0); + context._cmp(context.es.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; context.data.word(19) = 10; - context._cmp(context.ds.word(context.bx+3), 30); + context._cmp(context.es.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; context._add(context.data.byte(63), 1); context._cmp(context.data.byte(63), 40); @@ -793,7 +793,7 @@ void soldier1(Context & context) { notaftersshot: checkspeed(context); if (!context.flags.z()) goto gotsoldframe; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); goto gotsoldframe; soldierwait: context._cmp(context.data.byte(64), 1); @@ -803,7 +803,7 @@ soldierwait: if (!context.flags.z()) goto gotsoldframe; context._cmp(context.data.byte(132), 4); if (!context.flags.z()) goto gotsoldframe; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); context.data.byte(64) = -1; context.data.byte(63) = 0; gotsoldframe: @@ -813,14 +813,14 @@ gotsoldframe: } void rockstar(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; context._cmp(context.ax, 118); if (context.flags.z()) goto rockcombatend; checkspeed(context); if (!context.flags.z()) goto rockspeed; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; @@ -842,10 +842,10 @@ notgunonrock: context.data.byte(63) = 0; context.ax = 79; gotrockframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; rockspeed: showgamereel(context); - context._cmp(context.ds.word(context.bx+3), 78); + context._cmp(context.es.word(context.bx+3), 78); if (!context.flags.z()) goto notalkrock; addtopeoplelist(context); context.data.byte(233) = 2; @@ -855,7 +855,7 @@ notalkrock: context.data.word(19) = 2; context.data.byte(233) = 0; context.al = context.data.byte(148); - context.ds.byte(context.bx+2) = context.al; + context.es.byte(context.bx+2) = context.al; return; rockcombatend: context.data.byte(187) = 45; @@ -864,12 +864,12 @@ rockcombatend: } void helicopter(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; checkspeed(context); if (!context.flags.z()) goto helispeed; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; @@ -897,13 +897,13 @@ notgunonheli: context.data.byte(63) = 0; context.ax = 9; gotheliframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; helispeed: showgamereel(context); context.al = context.data.byte(147); - context.ds.byte(context.bx+1) = context.al; + context.es.byte(context.bx+1) = context.al; helicombatend: - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; context._cmp(context.data.byte(63), 7); @@ -921,7 +921,7 @@ heliwon: } void mugger(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; context._cmp(context.ax, 176); @@ -932,11 +932,11 @@ void mugger(Context & context) { havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); notmugger: showgamereel(context); context.al = context.data.byte(147); - context.ds.byte(context.bx+1) = context.al; + context.es.byte(context.bx+1) = context.al; return; endmugger1: context.push(context.es); @@ -957,7 +957,7 @@ endmugger1: context.es = context.pop(); context.push(context.es); context.push(context.bx); - context.ds.word(context.bx+3) = 140; + context.es.word(context.bx+3) = 140; context.data.byte(474) = 2; context.data.byte(476) = 2; findxyfrompath(context); @@ -1002,7 +1002,7 @@ void aide(Context & context) { void businessman(Context & context) { context.data.byte(233) = 0; context.data.word(19) = 2; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 2); if (!context.flags.z()) goto notfirstbiz; context.push(context.ax); @@ -1024,7 +1024,7 @@ notfirstbiz: if (context.flags.z()) goto buscombatend; checkspeed(context); if (!context.flags.z()) goto busspeed; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; @@ -1069,12 +1069,12 @@ buscombatwon: context.ax = 92; goto gotbusframe; gotbusframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; busspeed: showgamereel(context); context.al = context.data.byte(148); - context.ds.byte(context.bx+2) = context.al; - context.ax = context.ds.word(context.bx+3); + context.es.byte(context.bx+2) = context.al; + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) goto buscombatend; context.data.word(19) = 0; @@ -1089,7 +1089,7 @@ buscombatwonend: } void poolguard(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; context._cmp(context.ax, 258); @@ -1103,7 +1103,7 @@ void poolguard(Context & context) { notfirstpool: checkspeed(context); if (!context.flags.z()) goto guardspeed; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; @@ -1136,10 +1136,10 @@ notgunonpool: context.data.byte(63) = 0; context.ax = 220; gotguardframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; guardspeed: showgamereel(context); - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 121); if (context.flags.z()) goto iswaitingpool; context._cmp(context.ax, 146); @@ -1173,16 +1173,16 @@ doneover2: } void security(Context & context) { - context._cmp(context.ds.word(context.bx+3), 32); + context._cmp(context.es.word(context.bx+3), 32); if (context.flags.z()) goto securwait; - context._cmp(context.ds.word(context.bx+3), 69); + context._cmp(context.es.word(context.bx+3), 69); if (!context.flags.z()) goto notaftersec; return; notaftersec: context.data.word(19) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); goto gotsecurframe; securwait: context._cmp(context.data.byte(64), 1); @@ -1193,7 +1193,7 @@ securwait: context._cmp(context.data.byte(132), 0); if (!context.flags.z()) goto gotsecurframe; context.data.byte(64) = -1; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); gotsecurframe: showgamereel(context); addtopeoplelist(context); @@ -1201,13 +1201,13 @@ gotsecurframe: } void heavy(Context & context) { - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 127); - context.ds.byte(context.bx+7) = context.al; - context._cmp(context.ds.word(context.bx+3), 43); + context.es.byte(context.bx+7) = context.al; + context._cmp(context.es.word(context.bx+3), 43); if (context.flags.z()) goto heavywait; context.data.word(19) = 10; - context._cmp(context.ds.word(context.bx+3), 70); + context._cmp(context.es.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; context._add(context.data.byte(63), 1); context._cmp(context.data.byte(63), 80); @@ -1217,7 +1217,7 @@ void heavy(Context & context) { notafterhshot: checkspeed(context); if (!context.flags.z()) goto gotheavyframe; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); goto gotheavyframe; heavywait: context._cmp(context.data.byte(64), 1); @@ -1227,7 +1227,7 @@ heavywait: context._cmp(context.data.byte(132), 4); if (!context.flags.z()) goto gotheavyframe; context.data.byte(64) = -1; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); context.data.byte(63) = 0; gotheavyframe: showgamereel(context); @@ -1238,7 +1238,7 @@ gotheavyframe: void bossman(Context & context) { checkspeed(context); if (!context.flags.z()) goto notboss; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 4); if (context.flags.z()) goto firstdes; @@ -1248,7 +1248,7 @@ void bossman(Context & context) { if (!context.flags.z()) goto gotallboss; context.ax = 0; context._add(context.data.byte(45), 1); - context.ds.byte(context.bx+7) = 10; + context.es.byte(context.bx+7) = 10; goto gotallboss; firstdes: context._cmp(context.data.byte(45), 1); @@ -1266,11 +1266,11 @@ secdes: if (context.flags.z()) goto gotallboss; context.ax = 0; gotallboss: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; notboss: showgamereel(context); addtopeoplelist(context); - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedboss; context.data.byte(49) = 1; @@ -1287,10 +1287,10 @@ gameragain: context._cmp(context.al, 5); if (!context.flags.c()) goto gameragain; context._add(context.al, 20); - context._cmp(context.al, context.ds.byte(context.bx+3)); + context._cmp(context.al, context.es.byte(context.bx+3)); if (context.flags.z()) goto gameragain; context.ah = 0; - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; gamerfin: showgamereel(context); addtopeoplelist(context); @@ -1322,12 +1322,12 @@ void keeper(Context & context) { context._cmp(context.data.word(21), 190); if (context.flags.c()) goto waiting; context._add(context.data.byte(53), 1); - context.ah = context.ds.byte(context.bx+7); + context.ah = context.es.byte(context.bx+7); context._and(context.ah, 127); context._cmp(context.ah, context.data.byte(65)); if (context.flags.z()) goto notdiff; context.al = context.data.byte(65); - context.ds.byte(context.bx+7) = context.al; + context.es.byte(context.bx+7) = context.al; notdiff: return; notwaiting: @@ -1340,13 +1340,13 @@ waiting: void candles1(Context & context) { checkspeed(context); if (!context.flags.z()) goto candle1; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 44); if (!context.flags.z()) goto notendcandle1; context.ax = 39; notendcandle1: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; candle1: showgamereel(context); return; @@ -1355,13 +1355,13 @@ candle1: void smallcandle(Context & context) { checkspeed(context); if (!context.flags.z()) goto smallcandlef; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 37); if (!context.flags.z()) goto notendsmallcandle; context.ax = 25; notendsmallcandle: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; smallcandlef: showgamereel(context); return; @@ -1370,13 +1370,13 @@ smallcandlef: void intromagic1(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm1fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 145); if (!context.flags.z()) goto gotintrom1; context.ax = 121; gotintrom1: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; context._add(context.data.byte(138), 1); @@ -1397,13 +1397,13 @@ introm1fin: void candles(Context & context) { checkspeed(context); if (!context.flags.z()) goto candlesfin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 167); if (!context.flags.z()) goto gotcandles; context.ax = 162; gotcandles: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; candlesfin: showgamereel(context); return; @@ -1412,13 +1412,13 @@ candlesfin: void candles2(Context & context) { checkspeed(context); if (!context.flags.z()) goto candles2fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 238); if (!context.flags.z()) goto gotcandles2; context.ax = 233; gotcandles2: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; candles2fin: showgamereel(context); return; @@ -1427,7 +1427,7 @@ candles2fin: void gates(Context & context) { checkspeed(context); if (!context.flags.z()) goto gatesfin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 116); if (!context.flags.z()) goto notbang; @@ -1442,14 +1442,14 @@ void gates(Context & context) { notbang: context._cmp(context.ax, 110); if (context.flags.c()) goto slowgates; - context.ds.byte(context.bx+5) = 2; + context.es.byte(context.bx+5) = 2; slowgates: context._cmp(context.ax, 120); if (!context.flags.z()) goto gotgates; context.data.byte(102) = 1; context.ax = 119; gotgates: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; context.push(context.es); context.push(context.bx); intro3text(context); @@ -1463,13 +1463,13 @@ gatesfin: void intromagic2(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm2fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 216); if (!context.flags.z()) goto gotintrom2; context.ax = 192; gotintrom2: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; introm2fin: showgamereel(context); return; @@ -1478,24 +1478,24 @@ introm2fin: void intromagic3(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm3fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; context.data.byte(102) = 1; gotintrom3: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; introm3fin: showgamereel(context); context.al = context.data.byte(147); - context.ds.byte(context.bx+1) = context.al; + context.es.byte(context.bx+1) = context.al; return; } void intromonks1(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk1fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; @@ -1510,7 +1510,7 @@ notendmonk1: context.data.byte(185) = 1; context.ax = 51; gotintromonk1: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 5); if (context.flags.z()) goto waitstep; context._cmp(context.ax, 15); @@ -1528,18 +1528,18 @@ waitstep: intro2text(context); context.bx = context.pop(); context.es = context.pop(); - context.ds.byte(context.bx+6) = -20; + context.es.byte(context.bx+6) = -20; intromonk1fin: showgamereel(context); context.al = context.data.byte(148); - context.ds.byte(context.bx+2) = context.al; + context.es.byte(context.bx+2) = context.al; return; } void intromonks2(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk2fin; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; @@ -1582,7 +1582,7 @@ notendmonk2: if (!context.flags.z()) goto gotintromonk2; context.ax = 140; gotintromonk2: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; intromonk2fin: showgamereel(context); return; @@ -1779,7 +1779,7 @@ gotintro3text: void monkandryan(Context & context) { checkspeed(context); if (!context.flags.z()) goto notmonkryan; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; @@ -1795,7 +1795,7 @@ void monkandryan(Context & context) { context.data.byte(102) = 1; return; gotmonkryan: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; notmonkryan: showgamereel(context); return; @@ -1804,7 +1804,7 @@ notmonkryan: void endgameseq(Context & context) { checkspeed(context); if (!context.flags.z()) goto notendseq; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; @@ -1818,7 +1818,7 @@ void endgameseq(Context & context) { context.es = context.pop(); context.ax = 50; gotendseq: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 134); if (!context.flags.z()) goto notfadedown; context.push(context.es); @@ -1848,11 +1848,11 @@ notfadeend: notendseq: showgamereel(context); context.al = context.data.byte(148); - context.ds.byte(context.bx+2) = context.al; - context.ax = context.ds.word(context.bx+3); + context.es.byte(context.bx+2) = context.al; + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 145); if (!context.flags.z()) goto notendcreds; - context.ds.word(context.bx+3) = 146; + context.es.word(context.bx+3) = 146; rollendcredits(context); notendcreds: return; @@ -1874,7 +1874,7 @@ void rollendcredits(Context & context) { multiget(context); context.es = context.data.word(464); context.si = 3*2; - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context.si = context.ax; context._add(context.si, 66*2); context.cx = 254; @@ -1930,7 +1930,7 @@ onelot: if (--context.cx) goto endcredits2; context.cx = context.pop(); looknext: - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext; @@ -1947,13 +1947,13 @@ gotnext: } void priest(Context & context) { - context._cmp(context.ds.word(context.bx+3), 8); + context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; context.data.byte(233) = 0; context.data.word(19) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); context.push(context.es); context.push(context.bx); priesttext(context); @@ -1966,13 +1966,13 @@ priestspoken: } void madmanstelly(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 307); if (!context.flags.z()) goto notendtelly; context.ax = 300; notendtelly: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; showgamereel(context); return; } @@ -1981,7 +1981,7 @@ void madman(Context & context) { context.data.word(19) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 364); if (!context.flags.c()) goto ryansded; context._cmp(context.ax, 10); @@ -2023,11 +2023,11 @@ notfirstmad: killryan: context.ax = 310; nomadspeak: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; nomadspeed: showgamereel(context); context.al = context.data.byte(147); - context.ds.byte(context.bx+1) = context.al; + context.es.byte(context.bx+1) = context.al; madmode(context); return; madmanspoken: @@ -2080,14 +2080,14 @@ iswatchmad: } void priesttext(Context & context) { - context._cmp(context.ds.word(context.bx+3), 2); + context._cmp(context.es.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; - context._cmp(context.ds.word(context.bx+3), 7); + context._cmp(context.es.word(context.bx+3), 7); if (!context.flags.c()) goto nopriesttext; - context.al = context.ds.byte(context.bx+3); + context.al = context.es.byte(context.bx+3); context._and(context.al, 1); if (!context.flags.z()) goto nopriesttext; - context.al = context.ds.byte(context.bx+3); + context.al = context.es.byte(context.bx+3); context._shr(context.al, 1); context._add(context.al, 50); context.bl = 72; @@ -2253,9 +2253,9 @@ oktalk: void drunk(Context & context) { context._cmp(context.data.byte(41), 0); if (!context.flags.z()) goto trampgone; - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 127); - context.ds.byte(context.bx+7) = context.al; + context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); trampgone: @@ -2266,7 +2266,7 @@ void advisor(Context & context) { checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 123); if (!context.flags.z()) goto notendadvis; @@ -2283,7 +2283,7 @@ notendadvis: if (context.flags.c()) goto gotadvframe; context.ax = 106; gotadvframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; noadvisor: showgamereel(context); addtopeoplelist(context); @@ -2293,7 +2293,7 @@ noadvisor: void copper(Context & context) { checkspeed(context); if (!context.flags.z()) goto nocopper; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._add(context.ax, 1); context._cmp(context.ax, 94); if (!context.flags.z()) goto notendcopper; @@ -2313,7 +2313,7 @@ mightwait: if (context.flags.c()) goto gotcopframe; context._sub(context.ax, 1); gotcopframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; nocopper: showgamereel(context); addtopeoplelist(context); @@ -2323,29 +2323,29 @@ nocopper: void sparky(Context & context) { context._cmp(context.data.word(14), 0); if (context.flags.z()) goto animsparky; - context.ds.byte(context.bx+7) = 3; + context.es.byte(context.bx+7) = 3; goto animsparky; animsparky: checkspeed(context); if (!context.flags.z()) goto finishsparky; - context._cmp(context.ds.word(context.bx+3), 34); + context._cmp(context.es.word(context.bx+3), 34); if (!context.flags.z()) goto notsparky1; randomnumber(context); context._cmp(context.al, 30); if (context.flags.c()) goto dosparky; - context.ds.word(context.bx+3) = 27; + context.es.word(context.bx+3) = 27; goto finishsparky; notsparky1: - context._cmp(context.ds.word(context.bx+3), 48); + context._cmp(context.es.word(context.bx+3), 48); if (!context.flags.z()) goto dosparky; - context.ds.word(context.bx+3) = 27; + context.es.word(context.bx+3) = 27; goto finishsparky; dosparky: - context._add(context.ds.word(context.bx+3), 1); + context._add(context.es.word(context.bx+3), 1); finishsparky: showgamereel(context); addtopeoplelist(context); - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedsparky; context.data.byte(48) = 1; @@ -2355,7 +2355,7 @@ nottalkedsparky: void train(Context & context) { return; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 21); if (!context.flags.c()) goto notrainyet; context._add(context.ax, 1); @@ -2370,7 +2370,7 @@ notrainyet: if (!context.flags.z()) goto notrainatall; context.ax = 5; gottrainframe: - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; showgamereel(context); notrainatall: return; @@ -2380,14 +2380,14 @@ void addtopeoplelist(Context & context) { context.push(context.es); context.push(context.bx); context.push(context.bx); - context.cl = context.ds.byte(context.bx+7); - context.ax = context.ds.word(context.bx+3); + context.cl = context.es.byte(context.bx+7); + context.ax = context.es.word(context.bx+3); context.bx = context.data.word(16); context.es = context.data.word(410); - context.ds.word(context.bx) = context.ax; + context.es.word(context.bx) = context.ax; context.ax = context.pop(); - context.ds.word(context.bx+2) = context.ax; - context.ds.byte(context.bx+4) = context.cl; + context.es.word(context.bx+2) = context.ax; + context.es.byte(context.bx+4) = context.cl; context.bx = context.pop(); context.es = context.pop(); context._add(context.data.word(16), 5); @@ -2395,7 +2395,7 @@ void addtopeoplelist(Context & context) { } void showgamereel(Context & context) { - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; context.data.word(237) = context.ax; @@ -2405,7 +2405,7 @@ void showgamereel(Context & context) { context.bx = context.pop(); context.es = context.pop(); context.ax = context.data.word(237); - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; noshow: return; } @@ -2413,12 +2413,12 @@ noshow: void checkspeed(Context & context) { context._cmp(context.data.byte(64), -1); if (!context.flags.z()) goto forcenext; - context._add(context.ds.byte(context.bx+6), 1); - context.al = context.ds.byte(context.bx+6); - context._cmp(context.al, context.ds.byte(context.bx+5)); + context._add(context.es.byte(context.bx+6), 1); + context.al = context.es.byte(context.bx+6); + context._cmp(context.al, context.es.byte(context.bx+5)); if (!context.flags.z()) goto notspeed; context.al = 0; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); notspeed: return; @@ -2440,18 +2440,18 @@ void makesprite(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: - context._cmp(context.ds.byte(context.bx+15), 255); + context._cmp(context.es.byte(context.bx+15), 255); if (context.flags.z()) goto _tmp17a; context._add(context.bx, 32); goto _tmp17; _tmp17a: - context.ds.word(context.bx) = context.cx; - context.ds.word(context.bx+10) = context.si; - context.ds.word(context.bx+6) = context.dx; - context.ds.word(context.bx+8) = context.di; - context.ds.word(context.bx+2) = 0x0ffff; - context.ds.byte(context.bx+15) = 0; - context.ds.byte(context.bx+18) = 0; + context.es.word(context.bx) = context.cx; + context.es.word(context.bx+10) = context.si; + context.es.word(context.bx+6) = context.dx; + context.es.word(context.bx+8) = context.di; + context.es.word(context.bx+2) = 0x0ffff; + context.es.byte(context.bx+15) = 0; + context.es.byte(context.bx+18) = 0; return; } @@ -2467,20 +2467,20 @@ void spriteupdate(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = context.data.byte(62); - context.ds.byte(context.bx+31) = context.al; + context.es.byte(context.bx+31) = context.al; context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; _tmp18: context.push(context.cx); context.push(context.bx); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto _tmp18a; context.push(context.es); context.push(context.ds); - context.cx = context.ds.word(context.bx+2); - context.ds.word(context.bx+24) = context.cx; + context.cx = context.es.word(context.bx+2); + context.es.word(context.bx+24) = context.cx; __dispatch_call(context, context.ax); context.ds = context.pop(); context.es = context.pop(); @@ -2506,13 +2506,13 @@ priorityloop: prtspriteloop: context.push(context.cx); context.push(context.bx); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto skipsprite; context.al = context.data.byte(181); - context._cmp(context.al, context.ds.byte(context.bx+23)); + context._cmp(context.al, context.es.byte(context.bx+23)); if (!context.flags.z()) goto skipsprite; - context._cmp(context.ds.byte(context.bx+31), 1); + context._cmp(context.es.byte(context.bx+31), 1); if (context.flags.z()) goto skipsprite; printasprite(context); skipsprite: @@ -2531,8 +2531,8 @@ void printasprite(Context & context) { context.push(context.es); context.push(context.bx); context.si = context.bx; - context.ds = context.ds.word(context.si+6); - context.al = context.ds.byte(context.si+11); + context.ds = context.es.word(context.si+6); + context.al = context.es.byte(context.si+11); context.ah = 0; context._cmp(context.al, 220); if (context.flags.c()) goto notnegative1; @@ -2540,7 +2540,7 @@ void printasprite(Context & context) { notnegative1: context.bx = context.ax; context._add(context.bx, context.data.word(117)); - context.al = context.ds.byte(context.si+10); + context.al = context.es.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); if (context.flags.c()) goto notnegative2; @@ -2548,9 +2548,9 @@ notnegative1: notnegative2: context.di = context.ax; context._add(context.di, context.data.word(115)); - context.al = context.ds.byte(context.si+15); + context.al = context.es.byte(context.si+15); context.ah = 0; - context._cmp(context.ds.byte(context.si+30), 0); + context._cmp(context.es.byte(context.si+30), 0); if (context.flags.z()) goto steadyframe; context.ah = 8; steadyframe: @@ -2625,9 +2625,9 @@ void initman(Context & context) { context.dx = context.data.word(412); context.di = 0; makesprite(context); - context.ds.byte(context.bx+23) = 4; - context.ds.byte(context.bx+22) = 0; - context.ds.byte(context.bx+29) = 0; + context.es.byte(context.bx+23) = 4; + context.es.byte(context.bx+22) = 0; + context.es.byte(context.bx+29) = 0; return; } @@ -2637,16 +2637,16 @@ void mainman(Context & context) { context.data.byte(186) = 0; context.al = context.data.byte(150); context.ah = context.data.byte(151); - context.ds.word(context.bx+10) = context.ax; - context.ds.byte(context.bx+29) = 0; + context.es.word(context.bx+10) = context.ax; + context.es.byte(context.bx+29) = 0; goto executewalk; notinnewroom: - context._sub(context.ds.byte(context.bx+22), 1); - context._cmp(context.ds.byte(context.bx+22), -1); + context._sub(context.es.byte(context.bx+22), 1); + context._cmp(context.es.byte(context.bx+22), -1); if (context.flags.z()) goto executewalk; return; executewalk: - context.ds.byte(context.bx+22) = 0; + context.es.byte(context.bx+22) = 0; context.al = context.data.byte(134); context._cmp(context.al, context.data.byte(132)); if (context.flags.z()) goto facingok; @@ -2666,23 +2666,23 @@ alreadyturned: context.data.byte(135) = 0; context._cmp(context.data.byte(491), 254); if (!context.flags.z()) goto walkman; - context.ds.byte(context.bx+29) = 0; + context.es.byte(context.bx+29) = 0; goto notwalk; walkman: - context.al = context.ds.byte(context.bx+29); + context.al = context.es.byte(context.bx+29); context._add(context.al, 1); context._cmp(context.al, 11); if (!context.flags.z()) goto notanimend1; context.al = 1; notanimend1: - context.ds.byte(context.bx+29) = context.al; + context.es.byte(context.bx+29) = context.al; walking(context); context._cmp(context.data.byte(491), 254); if (context.flags.z()) goto afterwalk; context.al = context.data.byte(132); context._and(context.al, 1); if (context.flags.z()) goto isdouble; - context.al = context.ds.byte(context.bx+29); + context.al = context.es.byte(context.bx+29); context._cmp(context.al, 2); if (context.flags.z()) goto afterwalk; context._cmp(context.al, 7); @@ -2705,10 +2705,10 @@ notwalk: context.ah = 0; context.di = 1105; context._add(context.di, context.ax); - context.al = context.ds.byte(context.di); - context._add(context.al, context.ds.byte(context.bx+29)); - context.ds.byte(context.bx+15) = context.al; - context.ax = context.ds.word(context.bx+10); + context.al = context.cs.byte(context.di); + context._add(context.al, context.es.byte(context.bx+29)); + context.es.byte(context.bx+15) = context.al; + context.ax = context.es.word(context.bx+10); context.data.byte(150) = context.al; context.data.byte(151) = context.ah; return; @@ -2736,7 +2736,7 @@ incdir: context._add(context.al, 1); context._and(context.al, 7); context.data.byte(132) = context.al; - context.ds.byte(context.bx+29) = 0; + context.es.byte(context.bx+29) = 0; return; decdir: context.data.byte(135) = -1; @@ -2744,7 +2744,7 @@ decdir: context._sub(context.al, 1); context._and(context.al, 7); context.data.byte(132) = context.al; - context.ds.byte(context.bx+29) = 0; + context.es.byte(context.bx+29) = 0; return; } @@ -2772,11 +2772,11 @@ continuewalk: context.es = context.dx; context.bx = 7944; context._add(context.bx, context.ax); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.bx = context.pop(); context.es = context.pop(); stillline: - context.ds.word(context.bx+10) = context.ax; + context.es.word(context.bx+10) = context.ax; return; endofline: context.data.byte(491) = 254; @@ -2807,7 +2807,7 @@ void facerightway(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context.data.byte(134) = context.al; context.data.byte(133) = context.al; context.bx = context.pop(); @@ -2914,7 +2914,7 @@ void adjustdown(Context & context) { context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); - context.ds.byte(context.bx+11) = context.al; + context.es.byte(context.bx+11) = context.al; context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); @@ -2928,7 +2928,7 @@ void adjustup(Context & context) { context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); - context.ds.byte(context.bx+11) = context.al; + context.es.byte(context.bx+11) = context.al; context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); @@ -2943,7 +2943,7 @@ void adjustleft(Context & context) { context.al = context.data.byte(153); context.cl = 16; context._mul(context.cl); - context.ds.byte(context.bx+10) = context.al; + context.es.byte(context.bx+10) = context.al; context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); @@ -2958,7 +2958,7 @@ void adjustright(Context & context) { context.cl = 16; context._mul(context.cl); context._sub(context.al, 2); - context.ds.byte(context.bx+10) = context.al; + context.es.byte(context.bx+10) = context.al; context.data.byte(185) = 1; context.bx = context.pop(); context.es = context.pop(); @@ -2985,7 +2985,7 @@ void reminders(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto forgotone; - context.ax = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx+2); context._cmp(context.al, 4); if (!context.flags.z()) goto forgotone; context._cmp(context.ah, 255); @@ -3018,18 +3018,18 @@ void initrain(Context & context) { context.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); context.bx = 1113; checkmorerain: - context.al = context.ds.byte(context.bx); + context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto finishinitrain; context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto checkrain; - context.al = context.ds.byte(context.bx+1); + context.al = context.cs.byte(context.bx+1); context._cmp(context.al, context.data.byte(147)); if (!context.flags.z()) goto checkrain; - context.al = context.ds.byte(context.bx+2); + context.al = context.cs.byte(context.bx+2); context._cmp(context.al, context.data.byte(148)); if (!context.flags.z()) goto checkrain; - context.al = context.ds.byte(context.bx+3); + context.al = context.cs.byte(context.bx+3); context.data.byte(131) = context.al; goto dorain; checkrain: @@ -3085,7 +3085,7 @@ lookforlinestart: if (!context.flags.c()) goto endofthisline; goto lookforlinestart; foundlinestart: - context.ds.word(context.di) = context.cx; + context.es.word(context.di) = context.cx; context.bh = 1; lookforlineend: getblockofpixel(context); @@ -3101,15 +3101,15 @@ lookforlineend: goto lookforlineend; foundlineend: context.push(context.cx); - context.ds.byte(context.di+2) = context.bh; + context.es.byte(context.di+2) = context.bh; randomnumber(context); - context.ds.byte(context.di+3) = context.al; + context.es.byte(context.di+3) = context.al; randomnumber(context); - context.ds.byte(context.di+4) = context.al; + context.es.byte(context.di+4) = context.al; randomnumber(context); context._and(context.al, 3); context._add(context.al, 4); - context.ds.byte(context.di+5) = context.al; + context.es.byte(context.di+5) = context.al; context._add(context.di, 6); context.cx = context.pop(); context._cmp(context.cl, 0); @@ -3152,32 +3152,32 @@ void showrain(Context & context) { context._add(context.si, 2080); context.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); context.es = context.data.word(410); - context._cmp(context.ds.byte(context.bx), 255); + context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto nothunder; morerain: context.es = context.data.word(410); - context._cmp(context.ds.byte(context.bx), 255); + context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto finishrain; - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context.ah = 0; context._add(context.ax, context.data.word(117)); context._add(context.ax, context.data.word(125)); context.cx = 320; context._mul(context.cx); - context.cl = context.ds.byte(context.bx); + context.cl = context.es.byte(context.bx); context.ch = 0; context._add(context.ax, context.cx); context._add(context.ax, context.data.word(115)); context._add(context.ax, context.data.word(123)); context.di = context.ax; - context.cl = context.ds.byte(context.bx+2); + context.cl = context.es.byte(context.bx+2); context.ch = 0; - context.ax = context.ds.word(context.bx+3); - context.dl = context.ds.byte(context.bx+5); + context.ax = context.es.word(context.bx+3); + context.dl = context.es.byte(context.bx+5); context.dh = 0; context._sub(context.ax, context.dx); context._and(context.ax, 511); - context.ds.word(context.bx+3) = context.ax; + context.es.word(context.bx+3) = context.ax; context._add(context.bx, 6); context.push(context.si); context._add(context.si, context.ax); @@ -3223,16 +3223,16 @@ nothunder: void backobject(Context & context) { context.ds = context.data.word(426); - context.di = context.ds.word(context.bx+20); - context.al = context.ds.byte(context.bx+18); + context.di = context.es.word(context.bx+20); + context.al = context.es.byte(context.bx+18); context._cmp(context.al, 0); if (context.flags.z()) goto _tmp48z; context._sub(context.al, 1); - context.ds.byte(context.bx+18) = context.al; + context.es.byte(context.bx+18) = context.al; goto finishback; _tmp48z: context.al = context.ds.byte(context.di+7); - context.ds.byte(context.bx+18) = context.al; + context.es.byte(context.bx+18) = context.al; context.al = context.ds.byte(context.di+8); context._cmp(context.al, 6); if (!context.flags.z()) goto notwidedoor; @@ -3277,7 +3277,7 @@ void liftsprite(Context & context) { if (context.flags.z()) goto liftopen; context._cmp(context.al, 3); if (context.flags.z()) goto openlift; - context.al = context.ds.byte(context.bx+19); + context.al = context.es.byte(context.bx+19); context._cmp(context.al, 0); if (context.flags.z()) goto finishclose; context._sub(context.al, 1); @@ -3292,7 +3292,7 @@ finishclose: context.data.byte(34) = 0; return; openlift: - context.al = context.ds.byte(context.bx+19); + context.al = context.es.byte(context.bx+19); context._cmp(context.al, 12); if (context.flags.z()) goto endoflist; context._add(context.al, 1); @@ -3303,13 +3303,13 @@ openlift: liftnoise(context); context.ax = context.pop(); pokelift: - context.ds.byte(context.bx+19) = context.al; + context.es.byte(context.bx+19) = context.al; context.ah = 0; context.push(context.di); context._add(context.di, context.ax); context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; return; endoflist: @@ -3370,31 +3370,31 @@ void random(Context & context) { context._add(context.di, context.ax); context.al = context.ds.byte(context.di); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; return; } void steady(Context & context) { context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; return; } void constant(Context & context) { - context._add(context.ds.byte(context.bx+19), 1); - context.cl = context.ds.byte(context.bx+19); + context._add(context.es.byte(context.bx+19), 1); + context.cl = context.es.byte(context.bx+19); context.ch = 0; context._add(context.di, context.cx); context._cmp(context.ds.byte(context.di+18), 255); if (!context.flags.z()) goto gotconst; context._sub(context.di, context.cx); context.cx = 0; - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; gotconst: context.al = context.ds.byte(context.di+18); context._sub(context.di, context.cx); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; return; } @@ -3420,8 +3420,8 @@ void widedoor(Context & context) { void dodoor(Context & context) { context.al = context.data.byte(150); context.ah = context.data.byte(151); - context.cl = context.ds.byte(context.bx+10); - context.ch = context.ds.byte(context.bx+11); + context.cl = context.es.byte(context.bx+10); + context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor; context._sub(context.al, context.cl); @@ -3444,7 +3444,7 @@ botofdoor: context._cmp(context.ah, context.data.byte(195)); if (!context.flags.c()) goto shutdoor; opendoor: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.data.byte(60), 1); if (!context.flags.z()) goto notthrough; context._cmp(context.cl, 0); @@ -3470,15 +3470,15 @@ notdoorsound2: context._sub(context.di, 1); context._sub(context.cl, 1); atlast1: - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context.data.byte(60) = 1; return; shutdoor: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; @@ -3491,14 +3491,14 @@ notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; context._sub(context.cl, 1); - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; @@ -3510,8 +3510,8 @@ notnearly: void lockeddoorway(Context & context) { context.al = context.data.byte(150); context.ah = context.data.byte(151); - context.cl = context.ds.byte(context.bx+10); - context.ch = context.ds.byte(context.bx+11); + context.cl = context.es.byte(context.bx+10); + context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor2; context._sub(context.al, context.cl); @@ -3539,7 +3539,7 @@ opendoor2: context._cmp(context.data.byte(36), 1); if (context.flags.z()) goto shutdoor; mustbeopen: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound4; context.al = 0; @@ -3554,7 +3554,7 @@ notdoorsound4: context.bx = context.pop(); context.es = context.pop(); noturnonyet: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.data.byte(60), 1); if (!context.flags.z()) goto notthrough2; context._cmp(context.cl, 0); @@ -3571,10 +3571,10 @@ notthrough2: context._sub(context.di, 1); context._sub(context.cl, 1); atlast3: - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto justshutting; @@ -3582,7 +3582,7 @@ atlast3: justshutting: return; shutdoor2: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound3; context.al = 1; @@ -3591,7 +3591,7 @@ notdoorsound3: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast4; context._sub(context.cl, 1); - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; context.data.byte(60) = 0; @@ -3599,7 +3599,7 @@ atlast4: context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) goto notlocky; @@ -3614,7 +3614,7 @@ notlocky: return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: - context.cl = context.ds.byte(context.bx+19); + context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; @@ -3627,14 +3627,14 @@ notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; context._sub(context.cl, 1); - context.ds.byte(context.bx+19) = context.cl; + context.es.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context.di = context.pop(); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; @@ -3656,18 +3656,18 @@ void updatepeople(Context & context) { context.bx = 534; context.di = 991; updateloop: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endupdate; context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto notinthisroom; - context.cx = context.ds.word(context.bx+1); + context.cx = context.es.word(context.bx+1); context._cmp(context.cl, context.data.byte(147)); if (!context.flags.z()) goto notinthisroom; context._cmp(context.ch, context.data.byte(148)); if (!context.flags.z()) goto notinthisroom; context.push(context.di); - context.ax = context.ds.word(context.di); + context.ax = context.cs.word(context.di); __dispatch_call(context, context.ax); context.di = context.pop(); notinthisroom: @@ -3708,7 +3708,7 @@ void plotreel(Context & context) { retryreel: context.push(context.es); context.push(context.si); - context.ax = context.ds.word(context.si+2); + context.ax = context.es.word(context.si+2); context._cmp(context.al, 220); if (context.flags.c()) goto normalreel; context._cmp(context.al, 255); @@ -3725,7 +3725,7 @@ plotloop: context.push(context.cx); context.push(context.es); context.push(context.si); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto notplot; showreelframe(context); @@ -3746,18 +3746,18 @@ void soundonreels(Context & context) { context._add(context.bl, context.bl); context._xor(context.bh, context.bh); context._add(context.bx, 1214); - context.si = context.ds.word(context.bx); + context.si = context.cs.word(context.bx); reelsoundloop: - context.al = context.ds.byte(context.si); + context.al = context.cs.byte(context.si); context._cmp(context.al, 255); if (context.flags.z()) goto endreelsound; - context.ax = context.ds.word(context.si+1); + context.ax = context.cs.word(context.si+1); context._cmp(context.ax, context.data.word(237)); if (!context.flags.z()) goto skipreelsound; context._cmp(context.ax, context.data.word(349)); if (context.flags.z()) goto skipreelsound; context.data.word(349) = context.ax; - context.al = context.ds.byte(context.si); + context.al = context.cs.byte(context.si); context._cmp(context.al, 64); if (context.flags.c()) { playchannel1(context); return; }; context._cmp(context.al, 128); @@ -3889,14 +3889,14 @@ void getreelstart(Context & context) { } void showreelframe(Context & context) { - context.al = context.ds.byte(context.si+2); + context.al = context.es.byte(context.si+2); context.ah = 0; context.di = context.ax; context._add(context.di, context.data.word(115)); - context.al = context.ds.byte(context.si+3); + context.al = context.es.byte(context.si+3); context.bx = context.ax; context._add(context.bx, context.data.word(117)); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context.data.word(158) = context.ax; findsource(context); context.ax = context.data.word(158); @@ -3925,13 +3925,13 @@ void dumpeverything(Context & context) { context.es = context.data.word(410); context.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); dumpevery1: - context.ax = context.ds.word(context.bx); - context.cx = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx); + context.cx = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto finishevery1; - context._cmp(context.ax, context.ds.word(context.bx+(40*5))); + context._cmp(context.ax, context.es.word(context.bx+(40*5))); if (!context.flags.z()) goto notskip1; - context._cmp(context.cx, context.ds.word(context.bx+(40*5)+2)); + context._cmp(context.cx, context.es.word(context.bx+(40*5)+2)); if (context.flags.z()) goto skip1; notskip1: context.push(context.bx); @@ -3953,8 +3953,8 @@ skip1: finishevery1: context.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)+(40*5); dumpevery2: - context.ax = context.ds.word(context.bx); - context.cx = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx); + context.cx = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto finishevery2; context.push(context.bx); @@ -4142,15 +4142,15 @@ void dumpmap(Context & context) { void pixelcheckset(Context & context) { context.push(context.ax); - context._sub(context.al, context.ds.byte(context.bx)); - context._sub(context.ah, context.ds.byte(context.bx+1)); + context._sub(context.al, context.es.byte(context.bx)); + context._sub(context.ah, context.es.byte(context.bx+1)); context.push(context.es); context.push(context.bx); context.push(context.cx); context.push(context.ax); - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); getsetad(context); - context.al = context.ds.byte(context.bx+17); + context.al = context.es.byte(context.bx+17); context.es = context.data.word(442); context.bx = 0; context.ah = 0; @@ -4161,16 +4161,16 @@ void pixelcheckset(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context.cl = context.ds.byte(context.bx); + context.cl = context.es.byte(context.bx); context.ch = 0; context._mul(context.cx); context.cx = context.pop(); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.ds.word(context.bx+2)); + context._add(context.ax, context.es.word(context.bx+2)); context.bx = context.ax; context._add(context.bx, 0+2080); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.dl = context.al; context.cx = context.pop(); context.bx = context.pop(); @@ -4303,7 +4303,7 @@ zoomloop2: context._lodsb(); context.ah = context.al; context._stosw(); - context.ds.word(context.di+320-2) = context.ax; + context.es.word(context.di+320-2) = context.ax; if (--context.cx) goto zoomloop2; context._add(context.si, 320-23); context._add(context.di, 320-46+320); @@ -5036,7 +5036,7 @@ bhloop2: context.ch = 0; context.ah = 255; bhloop1: - context._cmp(context.ds.byte(context.di), context.ah); + context._cmp(context.es.byte(context.di), context.ah); if (!context.flags.z()) goto nofill; context._movsb(); if (--context.cx) goto bhloop1; @@ -5084,7 +5084,7 @@ frameloopfx3: context._cmp(context.al, 0); if (context.flags.z()) goto backtootherfx; backtosolidfx: - context.ds.byte(context.di) = context.al; + context.es.byte(context.di) = context.al; context._sub(context.di, 1); if (--context.cx) goto frameloopfx3; context.cx = context.pop(); @@ -5129,16 +5129,16 @@ void transferinv(Context & context) { context._add(context.si, context.ds.word(context.bx+2)); context.dx = context.ds.word(context.bx+4); context.bx = context.pop(); - context.ds.byte(context.bx+0) = context.al; - context.ds.byte(context.bx+1) = context.cl; - context.ds.word(context.bx+4) = context.dx; + context.es.byte(context.bx+0) = context.al; + context.es.byte(context.bx+1) = context.cl; + context.es.word(context.bx+4) = context.dx; context._mul(context.cx); context.cx = context.ax; context.push(context.cx); while(--context.cx) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); - context.ds.word(context.bx+2) = context.ax; + context.es.word(context.bx+2) = context.ax; context._add(context.data.word(10), context.cx); return; } @@ -5176,16 +5176,16 @@ void transfermap(Context & context) { context._add(context.si, context.ds.word(context.bx+2)); context.dx = context.ds.word(context.bx+4); context.bx = context.pop(); - context.ds.byte(context.bx+0) = context.al; - context.ds.byte(context.bx+1) = context.cl; - context.ds.word(context.bx+4) = context.dx; + context.es.byte(context.bx+0) = context.al; + context.es.byte(context.bx+1) = context.cl; + context.es.word(context.bx+4) = context.dx; context._mul(context.cx); context.cx = context.ax; context.push(context.cx); while(--context.cx) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); - context.ds.word(context.bx+2) = context.ax; + context.es.word(context.bx+2) = context.ax; context._add(context.data.word(10), context.cx); return; } @@ -5294,9 +5294,9 @@ void fadescreendownhalf(Context & context) { context.es = context.data.word(410); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; halfend: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._shr(context.al, 1); - context.ds.byte(context.bx) = context.al; + context.es.byte(context.bx) = context.al; context._add(context.bx, 1); if (--context.cx) goto halfend; context.ds = context.data.word(410); @@ -5428,7 +5428,7 @@ void rollem(Context & context) { multiget(context); context.es = context.data.word(464); context.si = 49*2; - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context.si = context.ax; context._add(context.si, 66*2); context.cx = 80; @@ -5486,7 +5486,7 @@ onelot2: if (--context.cx) goto endcredits22; context.cx = context.pop(); looknext2: - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext2; @@ -5515,19 +5515,19 @@ void fadecalculation(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; fadecolloop: - context.al = context.ds.byte(context.si); - context.ah = context.ds.byte(context.di); + context.al = context.es.byte(context.si); + context.ah = context.es.byte(context.di); context._cmp(context.al, context.ah); if (context.flags.z()) goto gotthere; if (context.flags.c()) goto lesscolour; - context._sub(context.ds.byte(context.si), 1); + context._sub(context.es.byte(context.si), 1); goto gotthere; lesscolour: context._cmp(context.bl, context.ah); if (context.flags.z()) goto withit; if (!context.flags.c()) goto gotthere; withit: - context._add(context.ds.byte(context.si), 1); + context._add(context.es.byte(context.si), 1); gotthere: context._add(context.si, 1); context._add(context.di, 1); @@ -5547,17 +5547,17 @@ void greyscalesum(Context & context) { greysumloop1: context.push(context.cx); context.bx = 0; - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context.ah = 0; context.cx = 20; context._mul(context.cx); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.si+1); + context.al = context.es.byte(context.si+1); context.ah = 0; context.cx = 59; context._mul(context.cx); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.si+2); + context.al = context.es.byte(context.si+2); context.ah = 0; context.cx = 11; context._mul(context.cx); @@ -5804,7 +5804,7 @@ nextmonkspeak: context.si = context.ax; context._add(context.si, context.si); context.es = context.data.word(464); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; nextbit: @@ -6159,7 +6159,7 @@ printloopslow5: context.push(context.cx); context.push(context.si); context.push(context.es); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context.push(context.bx); context.push(context.cx); context.push(context.es); @@ -6172,7 +6172,7 @@ printloopslow5: context.es = context.pop(); context.cx = context.pop(); context.bx = context.pop(); - context.ax = context.ds.word(context.si+1); + context.ax = context.es.word(context.si+1); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto finishslow; @@ -6286,7 +6286,7 @@ printloop6: getnumber(context); context.ch = 0; printloop5: - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto finishdirct; @@ -6326,7 +6326,7 @@ printloop8: getnumber(context); context.ch = 0; printloop7: - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (context.flags.z()) goto finishmon2; @@ -6338,7 +6338,7 @@ printloop7: if (context.flags.z()) goto finishmon; context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger; - context.ah = context.ds.byte(context.si); + context.ah = context.es.byte(context.si); context._add(context.si, 1); context._add(context.si, 1); goto finishmon; @@ -6497,7 +6497,7 @@ notcent2: void getnextword(Context & context) { context.bx = 0; getloop: - context.ax = context.ds.word(context.di); + context.ax = context.es.word(context.di); context._add(context.di, 1); context._add(context.bh, 1); context._cmp(context.al, ':'); @@ -6611,7 +6611,7 @@ ryanloop1: context.push(context.cx); context.push(context.di); context.push(context.bx); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.si, 2); context.push(context.si); context.push(context.es); @@ -6652,7 +6652,7 @@ openloop1: context.push(context.cx); context.push(context.di); context.push(context.bx); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.si, 2); context.push(context.si); context.push(context.es); @@ -6828,18 +6828,18 @@ finishfill: } void isitworn(Context & context) { - context.al = context.ds.byte(context.bx+12); + context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) goto notworn; - context.al = context.ds.byte(context.bx+13); + context.al = context.es.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); notworn: return; } void makeworn(Context & context) { - context.ds.byte(context.bx+12) = 'W'-'A'; - context.ds.byte(context.bx+13) = 'E'-'A'; + context.es.byte(context.bx+12) = 'W'-'A'; + context.es.byte(context.bx+13) = 'E'-'A'; return; } @@ -7030,7 +7030,7 @@ void openob(Context & context) { context._mul(context.cx); context._add(context.ax, 80); context.bx = 2588; - context.ds.word(context.bx) = context.ax; + context.cs.word(context.bx) = context.ax; return; } @@ -7208,14 +7208,14 @@ describe: context.ah = 0; context._add(context.ax, context.ax); context._add(context.si, context.ax); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; context.bx = context.ax; tryagain: context.push(context.si); findnextcolon(context); - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context.cx = context.si; context.si = context.pop(); context._cmp(context.data.byte(101), 1); @@ -7236,9 +7236,9 @@ void searchforsame(Context & context) { context.si = context.cx; searchagain: context._add(context.si, 1); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); search: - context._cmp(context.ds.byte(context.si), context.al); + context._cmp(context.es.byte(context.si), context.al); if (context.flags.z()) goto gotstartletter; context._add(context.cx, 1); context._add(context.si, 1); @@ -7253,8 +7253,8 @@ gotstartletter: keepchecking: context._add(context.si, 1); context._add(context.bx, 1); - context.al = context.ds.byte(context.bx); - context.ah = context.ds.byte(context.si); + context.al = context.es.byte(context.bx); + context.ah = context.es.byte(context.si); context._cmp(context.al, ':'); if (context.flags.z()) goto foundmatch; context._cmp(context.al, 0); @@ -7272,7 +7272,7 @@ foundmatch: void findnextcolon(Context & context) { isntcolon: - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.al, 0); if (context.flags.z()) goto endofcolon; @@ -7398,7 +7398,7 @@ void setpickup(Context & context) { context._cmp(context.data.byte(101), 3); if (context.flags.z()) goto cantpick; getanyad(context); - context.al = context.ds.byte(context.bx+2); + context.al = context.es.byte(context.bx+2); context._cmp(context.al, 4); if (!context.flags.z()) goto canpick; cantpick: @@ -7437,8 +7437,8 @@ dosetpick: context.data.byte(88) = context.al; context.data.byte(101) = 4; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; openinv(context); worktoscreenm(context); return; @@ -7477,7 +7477,7 @@ doexinv: void reexfrominv(Context & context) { findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(99) = context.ah; context.data.byte(98) = context.al; context.data.byte(107) = 1; @@ -7488,7 +7488,7 @@ void reexfrominv(Context & context) { void reexfromopen(Context & context) { return; findopenpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(99) = context.ah; context.data.byte(98) = context.al; context.data.byte(107) = 1; @@ -7522,12 +7522,12 @@ doswap1: context.al = context.data.byte(88); context.push(context.ax); findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(88) = context.al; context.data.byte(101) = context.ah; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; context.bl = context.data.byte(88); context.bh = context.data.byte(101); context.ax = context.pop(); @@ -7538,10 +7538,10 @@ doswap1: delpointer(context); context.al = context.data.byte(88); geteitherad(context); - context.ds.byte(context.bx+2) = 4; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 4; + context.es.byte(context.bx+3) = 255; context.al = context.data.byte(106); - context.ds.byte(context.bx+4) = context.al; + context.es.byte(context.bx+4) = context.al; context.ax = context.pop(); context.data.byte(101) = context.ah; context.data.byte(88) = context.al; @@ -7600,22 +7600,22 @@ sizeok2: context.al = context.data.byte(88); context.push(context.ax); findopenpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(88) = context.al; context.data.byte(101) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeswapex; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; goto actuallyswap; makeswapex: transfertoex(context); context.data.byte(88) = context.al; context.data.byte(101) = 4; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; actuallyswap: context.bl = context.data.byte(88); context.bh = context.data.byte(101); @@ -7626,13 +7626,13 @@ actuallyswap: findopenpos(context); geteitherad(context); context.al = context.data.byte(110); - context.ds.byte(context.bx+2) = context.al; + context.es.byte(context.bx+2) = context.al; context.al = context.data.byte(109); - context.ds.byte(context.bx+3) = context.al; + context.es.byte(context.bx+3) = context.al; context.al = context.data.byte(106); - context.ds.byte(context.bx+4) = context.al; + context.es.byte(context.bx+4) = context.al; context.al = context.data.byte(183); - context.ds.byte(context.bx+5) = context.al; + context.es.byte(context.bx+5) = context.al; context.ax = context.pop(); context.data.byte(101) = context.ah; context.data.byte(88) = context.al; @@ -7654,7 +7654,7 @@ void intoinv(Context & context) { return; notout: findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace1; swapwithinv(context); @@ -7684,10 +7684,10 @@ doplace: delpointer(context); context.al = context.data.byte(88); getexad(context); - context.ds.byte(context.bx+2) = 4; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 4; + context.es.byte(context.bx+3) = 255; context.al = context.data.byte(106); - context.ds.byte(context.bx+4) = context.al; + context.es.byte(context.bx+4) = context.al; context.data.byte(105) = 0; fillryan(context); readmouse(context); @@ -7714,7 +7714,7 @@ takenloop: context._add(context.bx, context.bx); context._add(context.bx, context.bx); context._add(context.bx, context.bx); - context.ds.byte(context.bx+2) = 254; + context.es.byte(context.bx+2) = 254; notinhere: context._add(context.si, 16); if (--context.cx) goto takenloop; @@ -7723,7 +7723,7 @@ notinhere: void outofinv(Context & context) { findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick2; blank(context); @@ -7757,12 +7757,12 @@ dograb: delpointer(context); context.data.byte(105) = 1; findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(88) = context.al; context.data.byte(101) = context.ah; getexad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; fillryan(context); readmouse(context); showpointer(context); @@ -7810,17 +7810,17 @@ void getanyad(Context & context) { if (context.flags.z()) goto isfree; context.al = context.data.byte(98); getsetad(context); - context.ax = context.ds.word(context.bx+4); + context.ax = context.es.word(context.bx+4); return; isfree: context.al = context.data.byte(98); getfreead(context); - context.ax = context.ds.word(context.bx+7); + context.ax = context.es.word(context.bx+7); return; isex: context.al = context.data.byte(98); getexad(context); - context.ax = context.ds.word(context.bx+7); + context.ax = context.es.word(context.bx+7); return; } @@ -7846,17 +7846,17 @@ void getopenedsize(Context & context) { if (context.flags.z()) goto isfree2; context.al = context.data.byte(109); getsetad(context); - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); return; isfree2: context.al = context.data.byte(109); getfreead(context); - context.ax = context.ds.word(context.bx+7); + context.ax = context.es.word(context.bx+7); return; isex2: context.al = context.data.byte(109); getexad(context); - context.ax = context.ds.word(context.bx+7); + context.ax = context.es.word(context.bx+7); return; } @@ -7977,7 +7977,7 @@ notinlift: context.data.byte(101) = 4; context.al = context.data.byte(88); getexad(context); - context.ds.byte(context.bx+2) = 0; + context.es.byte(context.bx+2) = 0; context.al = context.data.byte(150); context._add(context.al, 4); context.cl = 4; @@ -7988,19 +7988,19 @@ notinlift: context.cl = 4; context._shr(context.ah, context.cl); context._add(context.ah, context.data.byte(148)); - context.ds.byte(context.bx+3) = context.al; - context.ds.byte(context.bx+5) = context.ah; + context.es.byte(context.bx+3) = context.al; + context.es.byte(context.bx+5) = context.ah; context.al = context.data.byte(150); context._add(context.al, 4); context._and(context.al, 15); context.ah = context.data.byte(151); context._add(context.ah, 8); context._and(context.ah, 15); - context.ds.byte(context.bx+4) = context.al; - context.ds.byte(context.bx+6) = context.ah; + context.es.byte(context.bx+4) = context.al; + context.es.byte(context.bx+6) = context.ah; context.data.byte(105) = 0; context.al = context.data.byte(183); - context.ds.byte(context.bx) = context.al; + context.es.byte(context.bx) = context.al; return; } @@ -8125,7 +8125,7 @@ void useopened(Context & context) { return; notout2: findopenpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace3; swapwithopen(context); @@ -8183,13 +8183,13 @@ sizeok1: context.al = context.data.byte(88); geteitherad(context); context.al = context.data.byte(110); - context.ds.byte(context.bx+2) = context.al; + context.es.byte(context.bx+2) = context.al; context.al = context.data.byte(109); - context.ds.byte(context.bx+3) = context.al; + context.es.byte(context.bx+3) = context.al; context.al = context.data.byte(106); - context.ds.byte(context.bx+4) = context.al; + context.es.byte(context.bx+4) = context.al; context.al = context.data.byte(183); - context.ds.byte(context.bx+5) = context.al; + context.es.byte(context.bx+5) = context.al; fillopen(context); undertextline(context); readmouse(context); @@ -8275,7 +8275,7 @@ void checkobjectsize(Context & context) { context.push(context.ax); context.al = context.data.byte(88); geteitherad(context); - context.al = context.ds.byte(context.bx+9); + context.al = context.es.byte(context.bx+9); context.cx = context.pop(); context._cmp(context.al, 255); if (!context.flags.z()) goto notunsized; @@ -8315,7 +8315,7 @@ void outofopen(Context & context) { context._cmp(context.data.byte(109), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick4; cantuseopen: @@ -8347,22 +8347,22 @@ dogrb: delpointer(context); context.data.byte(105) = 1; findopenpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context.data.byte(88) = context.al; context.data.byte(101) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeintoex; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; goto actuallyout; makeintoex: transfertoex(context); context.data.byte(88) = context.al; context.data.byte(101) = 4; geteitherad(context); - context.ds.byte(context.bx+2) = 20; - context.ds.byte(context.bx+3) = 255; + context.es.byte(context.bx+2) = 20; + context.es.byte(context.bx+3) = 255; actuallyout: fillopen(context); undertextline(context); @@ -8390,14 +8390,14 @@ void transfertoex(Context & context) { while(--context.cx) context._movsw(); context.di = context.pop(); context.al = context.data.byte(183); - context.ds.byte(context.di) = context.al; - context.ds.byte(context.di+11) = context.al; + context.es.byte(context.di) = context.al; + context.es.byte(context.di+11) = context.al; context.al = context.data.byte(88); - context.ds.byte(context.di+1) = context.al; - context.ds.byte(context.di+2) = 4; - context.ds.byte(context.di+3) = 255; + context.es.byte(context.di+1) = context.al; + context.es.byte(context.di+2) = 4; + context.es.byte(context.di+3) = 255; context.al = context.data.byte(106); - context.ds.byte(context.di+4) = context.al; + context.es.byte(context.di+4) = context.al; context.al = context.data.byte(88); context.data.byte(89) = context.al; transfermap(context); @@ -8431,9 +8431,9 @@ pickupcontloop: context.push(context.bx); context.push(context.dx); context.push(context.ax); - context._cmp(context.ds.byte(context.bx+2), context.ah); + context._cmp(context.es.byte(context.bx+2), context.ah); if (!context.flags.z()) goto notinsidethis; - context._cmp(context.ds.byte(context.bx+3), context.al); + context._cmp(context.es.byte(context.bx+3), context.al); if (!context.flags.z()) goto notinsidethis; context.data.byte(89) = context.cl; transfercontoex(context); @@ -8466,12 +8466,12 @@ void transfercontoex(Context & context) { context.di = context.pop(); context.dx = context.pop(); context.al = context.data.byte(183); - context.ds.byte(context.di) = context.al; - context.ds.byte(context.di+11) = context.al; + context.es.byte(context.di) = context.al; + context.es.byte(context.di+11) = context.al; context.al = context.data.byte(89); - context.ds.byte(context.di+1) = context.al; - context.ds.byte(context.di+3) = context.dl; - context.ds.byte(context.di+2) = 4; + context.es.byte(context.di+1) = context.al; + context.es.byte(context.di+3) = context.dl; + context.es.byte(context.di+2) = 4; transfermap(context); transferinv(context); transfertext(context); @@ -8489,7 +8489,7 @@ void transfertext(Context & context) { context.bx = 0+2080+30000+(16*114); context._add(context.bx, context.ax); context.di = context.data.word(12); - context.ds.word(context.bx) = context.di; + context.es.word(context.bx) = context.di; context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); context.al = context.data.byte(89); context.ah = 0; @@ -8514,7 +8514,7 @@ void getexpos(Context & context) { context.al = 0; context.di = 0+2080+30000; tryanotherex: - context._cmp(context.ds.byte(context.di+2), 255); + context._cmp(context.es.byte(context.di+2), 255); if (context.flags.z()) goto foundnewex; context._add(context.di, 16); context._add(context.al, 1); @@ -8532,9 +8532,9 @@ void purgealocation(Context & context) { context.bx = context.pop(); context.cx = 0; purgeloc: - context._cmp(context.bl, context.ds.byte(context.di+0)); + context._cmp(context.bl, context.es.byte(context.di+0)); if (!context.flags.z()) goto dontpurge; - context._cmp(context.ds.byte(context.di+2), 0); + context._cmp(context.es.byte(context.di+2), 0); if (!context.flags.z()) goto dontpurge; context.push(context.di); context.push(context.es); @@ -8578,15 +8578,15 @@ void purgeanitem(Context & context) { context.bl = context.data.byte(183); context.cx = 0; lookforpurge: - context.al = context.ds.byte(context.di+2); + context.al = context.es.byte(context.di+2); context._cmp(context.al, 0); if (!context.flags.z()) goto cantpurge; - context._cmp(context.ds.byte(context.di+12), 2); + context._cmp(context.es.byte(context.di+12), 2); if (context.flags.z()) goto iscup; - context._cmp(context.ds.byte(context.di+12), 255); + context._cmp(context.es.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge; iscup: - context._cmp(context.ds.byte(context.di+11), context.bl); + context._cmp(context.es.byte(context.di+11), context.bl); if (context.flags.z()) goto cantpurge; deleteexobject(context); return; @@ -8599,10 +8599,10 @@ cantpurge: context.bl = context.data.byte(183); context.cx = 0; lookforpurge2: - context.al = context.ds.byte(context.di+2); + context.al = context.es.byte(context.di+2); context._cmp(context.al, 0); if (!context.flags.z()) goto cantpurge2; - context._cmp(context.ds.byte(context.di+12), 255); + context._cmp(context.es.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge2; deleteexobject(context); return; @@ -8641,7 +8641,7 @@ void deleteexobject(Context & context) { context.di = 0+2080+30000; context.cx = 0; deleteconts: - context._cmp(context.ds.word(context.di+2), context.bx); + context._cmp(context.es.word(context.di+2), context.bx); if (!context.flags.z()) goto notinsideex; context.push(context.bx); context.push(context.cx); @@ -8665,16 +8665,16 @@ void deleteexframe(Context & context) { context._add(context.di, context.ax); context._add(context.ax, context.ax); context._add(context.di, context.ax); - context.al = context.ds.byte(context.di); + context.al = context.es.byte(context.di); context.ah = 0; - context.cl = context.ds.byte(context.di+1); + context.cl = context.es.byte(context.di+1); context.ch = 0; context._mul(context.cx); - context.si = context.ds.word(context.di+2); + context.si = context.es.word(context.di+2); context.push(context.si); context._add(context.si, 0+2080); context.cx = 30000; - context._sub(context.cx, context.ds.word(context.di+2)); + context._sub(context.cx, context.es.word(context.di+2)); context.di = context.si; context._add(context.si, context.ax); context.push(context.ax); @@ -8686,12 +8686,12 @@ void deleteexframe(Context & context) { context.cx = 114*3; context.di = 0; shuffleadsdown: - context.ax = context.ds.word(context.di+2); + context.ax = context.es.word(context.di+2); context._cmp(context.ax, context.si); if (context.flags.c()) goto beforethisone; context._sub(context.ax, context.bx); beforethisone: - context.ds.word(context.di+2) = context.ax; + context.es.word(context.di+2) = context.ax; context._add(context.di, 6); if (--context.cx) goto shuffleadsdown; return; @@ -8702,14 +8702,14 @@ void deleteextext(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context._add(context.di, context.ax); - context.ax = context.ds.word(context.di); + context.ax = context.es.word(context.di); context.si = context.ax; context.di = context.ax; context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); context.ax = 0; findlenextext: - context.cl = context.ds.byte(context.si); + context.cl = context.es.byte(context.si); context._add(context.ax, 1); context._add(context.si, 1); context._cmp(context.cl, 0); @@ -8727,12 +8727,12 @@ findlenextext: context.cx = 114; context.di = 0+2080+30000+(16*114); shuffletextads: - context.ax = context.ds.word(context.di); + context.ax = context.es.word(context.di); context._cmp(context.ax, context.si); if (context.flags.c()) goto beforethistext; context._sub(context.ax, context.bx); beforethistext: - context.ds.word(context.di) = context.ax; + context.es.word(context.di) = context.ax; context._add(context.di, 2); if (--context.cx) goto shuffletextads; return; @@ -8875,7 +8875,7 @@ finishdim4: void addalong(Context & context) { context.ah = 11; addloop: - context._cmp(context.ds.byte(context.bx), 0); + context._cmp(context.es.byte(context.bx), 0); if (!context.flags.z()) goto gotalong; context._add(context.bx, 3); context._sub(context.ah, 1); @@ -8890,7 +8890,7 @@ gotalong: void addlength(Context & context) { context.ah = 10; addloop2: - context._cmp(context.ds.byte(context.bx), 0); + context._cmp(context.es.byte(context.bx), 0); if (!context.flags.z()) goto gotlength; context._add(context.bx, 3*11); context._sub(context.ah, 1); @@ -8948,7 +8948,7 @@ void eraseoldobs(Context & context) { oberase: context.push(context.cx); context.push(context.bx); - context.ax = context.ds.word(context.bx+20); + context.ax = context.es.word(context.bx+20); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto notthisob; context.di = context.bx; @@ -8992,7 +8992,7 @@ showobsloop: context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankframe; - context.al = context.ds.byte(context.si+18); + context.al = context.es.byte(context.si+18); context.ah = 0; context.data.word(158) = context.ax; context._cmp(context.al, 255); @@ -9003,13 +9003,13 @@ showobsloop: finalframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.ds.byte(context.si+18); - context.ds.byte(context.si+17) = context.al; - context._cmp(context.ds.byte(context.si+8), 0); + context.al = context.es.byte(context.si+18); + context.es.byte(context.si+17) = context.al; + context._cmp(context.es.byte(context.si+8), 0); if (!context.flags.z()) goto animating; - context._cmp(context.ds.byte(context.si+5), 5); + context._cmp(context.es.byte(context.si+5), 5); if (context.flags.z()) goto animating; - context._cmp(context.ds.byte(context.si+5), 6); + context._cmp(context.es.byte(context.si+5), 6); if (context.flags.z()) goto animating; context.ax = context.data.word(158); context.ah = 0; @@ -9024,14 +9024,14 @@ drawnsetob: context.es = context.data.word(410); context.al = context.data.byte(178); context.ah = context.data.byte(179); - context.ds.word(context.si) = context.ax; + context.es.word(context.si) = context.ax; context.cx = context.ax; context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.ds.word(context.si+2) = context.ax; + context.es.word(context.si+2) = context.ax; context.al = context.data.byte(180); - context.ds.byte(context.si+4) = context.al; + context.es.byte(context.si+4) = context.al; context._add(context.si, 5); context.data.word(16) = context.si; blankframe: @@ -9049,8 +9049,8 @@ finishedsetobs: void makebackob(Context & context) { context._cmp(context.data.byte(61), 0); if (context.flags.z()) goto nomake; - context.al = context.ds.byte(context.si+5); - context.ah = context.ds.byte(context.si+8); + context.al = context.es.byte(context.si+5); + context.ah = context.es.byte(context.si+8); context.push(context.si); context.push(context.ax); context.push(context.si); @@ -9063,17 +9063,17 @@ void makebackob(Context & context) { context.di = 0; makesprite(context); context.ax = context.pop(); - context.ds.word(context.bx+20) = context.ax; + context.es.word(context.bx+20) = context.ax; context.ax = context.pop(); context._cmp(context.al, 255); if (!context.flags.z()) goto usedpriority; context.al = 0; usedpriority: - context.ds.byte(context.bx+23) = context.al; - context.ds.byte(context.bx+30) = context.ah; - context.ds.byte(context.bx+16) = 0; - context.ds.byte(context.bx+18) = 0; - context.ds.byte(context.bx+19) = 0; + context.es.byte(context.bx+23) = context.al; + context.es.byte(context.bx+30) = context.ah; + context.es.byte(context.bx+16) = 0; + context.es.byte(context.bx+18) = 0; + context.es.byte(context.bx+19) = 0; context.si = context.pop(); nomake: return; @@ -9132,17 +9132,17 @@ loop127: context.es = context.data.word(410); context.al = context.data.byte(178); context.ah = context.data.byte(179); - context.ds.word(context.si) = context.ax; + context.es.word(context.si) = context.ax; context.cx = context.ax; context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.ds.word(context.si+2) = context.ax; + context.es.word(context.si+2) = context.ax; context.ax = context.pop(); context.cx = context.pop(); context.push(context.cx); context.push(context.ax); - context.ds.byte(context.si+4) = context.cl; + context.es.byte(context.si+4) = context.cl; context._add(context.si, 5); context.data.word(16) = context.si; over138: @@ -9181,9 +9181,9 @@ exloop: context.es = context.data.word(396); context.push(context.si); context.ch = 0; - context._cmp(context.ds.byte(context.si), 255); + context._cmp(context.es.byte(context.si), 255); if (context.flags.z()) goto notinroom; - context.al = context.ds.byte(context.si-2); + context.al = context.es.byte(context.si-2); context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto notinroom; getmapad(context); @@ -9216,17 +9216,17 @@ notinroom: context.es = context.data.word(410); context.al = context.data.byte(178); context.ah = context.data.byte(179); - context.ds.word(context.si) = context.ax; + context.es.word(context.si) = context.ax; context.cx = context.ax; context.ax = context.data.word(174); context._add(context.al, context.cl); context._add(context.ah, context.ch); - context.ds.word(context.si+2) = context.ax; + context.es.word(context.si+2) = context.ax; context.ax = context.pop(); context.cx = context.pop(); context.push(context.cx); context.push(context.ax); - context.ds.byte(context.si+4) = context.cl; + context.es.byte(context.si+4) = context.cl; context._add(context.si, 5); context.data.word(16) = context.si; blankex: @@ -9316,11 +9316,11 @@ over146: } void getxad(Context & context) { - context.cl = context.ds.byte(context.si); + context.cl = context.es.byte(context.si); context._add(context.si, 1); - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); - context.ah = context.ds.byte(context.si); + context.ah = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; @@ -9340,9 +9340,9 @@ over148: } void getyad(Context & context) { - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); - context.ah = context.ds.byte(context.si); + context.ah = context.es.byte(context.si); context._add(context.si, 1); context._sub(context.al, context.data.byte(148)); if (context.flags.c()) goto over147; @@ -9413,7 +9413,7 @@ void dolook(Context & context) { context._add(context.bx, context.bx); context.es = context.data.word(434); context._add(context.bx, 0); - context.si = context.ds.word(context.bx); + context.si = context.es.word(context.bx); context._add(context.si, 0+(38*2)); findnextcolon(context); context.di = 66; @@ -9510,9 +9510,9 @@ finishtalk: context.es = context.cs; context._cmp(context.data.byte(245), 4); if (context.flags.c()) goto notnexttalk; - context.al = context.ds.byte(context.bx+7); + context.al = context.es.byte(context.bx+7); context._or(context.al, 128); - context.ds.byte(context.bx+7) = context.al; + context.es.byte(context.bx+7) = context.al; notnexttalk: redrawmainscrn(context); worktoscreenm(context); @@ -9546,7 +9546,7 @@ void getpersframe(Context & context) { context.bx = context.ax; context.es = context.data.word(446); context._add(context.bx, 0); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); return; } @@ -9581,7 +9581,7 @@ void getpersontext(Context & context) { context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; return; @@ -9634,10 +9634,10 @@ watchtalk: context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - context._cmp(context.ds.byte(context.si), 0); + context._cmp(context.es.byte(context.si), 0); if (context.flags.z()) goto endwatchtalk; context.push(context.es); context.push(context.si); @@ -9674,14 +9674,14 @@ watchtalk: context.es = context.data.word(446); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - context._cmp(context.ds.byte(context.si), 0); + context._cmp(context.es.byte(context.si), 0); if (context.flags.z()) goto endwatchtalk; - context._cmp(context.ds.byte(context.si), ':'); + context._cmp(context.es.byte(context.si), ':'); if (context.flags.z()) goto skiptalk; - context._cmp(context.ds.byte(context.si), 32); + context._cmp(context.es.byte(context.si), 32); if (context.flags.z()) goto skiptalk; context.push(context.es); context.push(context.si); @@ -9919,7 +9919,7 @@ alreadyinfo: context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(454); - context.si = context.ds.word(context.bx); + context.si = context.es.word(context.bx); context._add(context.si, 66*2); findnextcolon(context); context.di = 63; @@ -9964,7 +9964,7 @@ void putundercentre(Context & context) { void locationpic(Context & context) { getdestinfo(context); - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context.push(context.es); context.push(context.si); context.di = 0; @@ -9997,7 +9997,7 @@ notinthisone: context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(454); - context.si = context.ds.word(context.bx); + context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 50; context.bx = 20; @@ -10016,7 +10016,7 @@ void getdestinfo(Context & context) { context.es = context.dx; context.si = 7782; context._add(context.si, context.ax); - context.cl = context.ds.byte(context.si); + context.cl = context.es.byte(context.si); context.ax = context.pop(); context.push(context.cx); context.dx = context.ds; @@ -10150,7 +10150,7 @@ void getlocation(Context & context) { context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7782); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); return; } @@ -10160,7 +10160,7 @@ void setlocation(Context & context) { context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7782); - context.ds.byte(context.bx) = 1; + context.es.byte(context.bx) = 1; return; } @@ -10207,7 +10207,7 @@ clearedlocations: context.dx = context.ds; context.es = context.dx; context._add(context.bx, 7782); - context.ds.byte(context.bx) = 0; + context.es.byte(context.bx) = 0; return; } @@ -10241,11 +10241,11 @@ void usemon(Context & context) { while(--context.cx) context._stosb(); context.es = context.cs; context.di = 2807; - context.ds.byte(context.di) = 1; + context.es.byte(context.di) = 1; context._add(context.di, 26); context.cx = 3; keyloop: - context.ds.byte(context.di) = 0; + context.es.byte(context.di) = 0; context._add(context.di, 26); if (--context.cx) goto keyloop; createpanel(context); @@ -10358,7 +10358,7 @@ void loadpersonal(Context & context) { foundpersonal: openfile(context); readheader(context); - context.bx = context.ds.word(context.di); + context.bx = context.es.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); @@ -10387,7 +10387,7 @@ void loadnews(Context & context) { foundnews: openfile(context); readheader(context); - context.bx = context.ds.word(context.di); + context.bx = context.es.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); @@ -10419,7 +10419,7 @@ void loadcart(Context & context) { gotcart: openfile(context); readheader(context); - context.bx = context.ds.word(context.di); + context.bx = context.es.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); @@ -10443,7 +10443,7 @@ void lookininterface(Context & context) { checkinside(context); context._cmp(context.cl, 114); if (context.flags.z()) goto emptyinterface; - context.al = context.ds.byte(context.bx+15); + context.al = context.es.byte(context.bx+15); context._add(context.al, 1); return; emptyinterface: @@ -10641,7 +10641,7 @@ notleadingspace: context.si = context.data.word(314); context._add(context.si, context.si); context._add(context.si, 7816); - context.ds.byte(context.si) = context.al; + context.es.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); if (!context.flags.c()) goto waitkey; context.push(context.ax); @@ -10668,7 +10668,7 @@ notleadingspace: printchar(context); context.si = context.pop(); context.es = context.pop(); - context.ds.byte(context.si+1) = context.cl; + context.es.byte(context.si+1) = context.cl; context.ch = 0; context._add(context.data.word(316), context.cx); context._add(context.data.word(314), 1); @@ -10692,8 +10692,8 @@ void delchar(Context & context) { context._add(context.si, context.si); context.es = context.cs; context._add(context.si, 7816); - context.ds.byte(context.si) = 0; - context.al = context.ds.byte(context.si+1); + context.es.byte(context.si) = 0; + context.al = context.es.byte(context.si+1); context.ah = 0; context._sub(context.data.word(316), context.ax); context._sub(context.data.word(310), context.ax); @@ -10732,7 +10732,7 @@ comloop: comloop2: context.al = context.ds.byte(context.si); context._add(context.si, 2); - context.ah = context.ds.byte(context.bx); + context.ah = context.es.byte(context.bx); context._add(context.bx, 1); context._cmp(context.ah, 32); if (context.flags.z()) goto foundcom; @@ -10798,7 +10798,7 @@ void dircom(Context & context) { context.cx = 30; randomaccess(context); parser(context); - context._cmp(context.ds.byte(context.di+1), 0); + context._cmp(context.es.byte(context.di+1), 0); if (context.flags.z()) goto dirroot; dirfile(context); return; @@ -10829,7 +10829,7 @@ dirroot: void searchforfiles(Context & context) { context.bx = 66*2; directloop1: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, '*'); if (context.flags.z()) goto endofdir; @@ -10858,7 +10858,7 @@ signonloop2: context._cmp(context.al, 32); if (context.flags.z()) goto foundsign; makecaps(context); - context.ah = context.ds.byte(context.di); + context.ah = context.es.byte(context.di); context._add(context.di, 1); context._cmp(context.al, context.ah); if (!context.flags.z()) goto nomatch; @@ -10878,7 +10878,7 @@ foundsign: context.cx = context.pop(); context.bx = context.si; context.es = context.ds; - context._cmp(context.ds.byte(context.bx), 0); + context._cmp(context.es.byte(context.bx), 0); if (context.flags.z()) goto notyetassigned; context.al = 17; monmessage(context); @@ -10907,7 +10907,7 @@ notyetassigned: context.si = 7816; checkpass: context._lodsw(); - context.ah = context.ds.byte(context.bx); + context.ah = context.es.byte(context.bx); context._add(context.bx, 1); context._cmp(context.ah, 32); if (context.flags.z()) goto passpassed; @@ -10932,7 +10932,7 @@ passpassed: scrollmonitor(context); context.bx = context.pop(); context.es = context.pop(); - context.ds.byte(context.bx) = 1; + context.es.byte(context.bx) = 1; return; } @@ -10948,7 +10948,7 @@ void showkeys(Context & context) { keysloop: context.push(context.cx); context.push(context.bx); - context._cmp(context.ds.byte(context.bx), 0); + context._cmp(context.es.byte(context.bx), 0); if (context.flags.z()) goto notheld; context._add(context.bx, 14); monprint(context); @@ -10965,7 +10965,7 @@ void read(Context & context) { context.cx = 40; randomaccess(context); parser(context); - context._cmp(context.ds.byte(context.di+1), 0); + context._cmp(context.es.byte(context.di+1), 0); if (!context.flags.z()) goto okcom; neterror(context); return; @@ -11023,7 +11023,7 @@ findtopictext: context.es = context.pop(); moretopic: monprint(context); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._cmp(context.al, 34); if (context.flags.z()) goto endoftopic; context._cmp(context.al, '='); @@ -11045,7 +11045,7 @@ endoftopic: void dirfile(Context & context) { context.al = 34; - context.ds.byte(context.di) = context.al; + context.es.byte(context.di) = context.al; context.push(context.es); context.push(context.di); context.ds = context.data.word(464); @@ -11099,7 +11099,7 @@ keyok2: context.bx = context.pop(); context.es = context.pop(); directloop2: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, 34); if (context.flags.z()) goto endofdir2; @@ -11116,11 +11116,11 @@ endofdir2: void getkeyandlogo(Context & context) { context._add(context.bx, 1); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._sub(context.al, 48); context.data.byte(270) = context.al; context._add(context.bx, 2); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._sub(context.al, 48); context.data.byte(275) = context.al; context._add(context.bx, 1); @@ -11133,7 +11133,7 @@ void getkeyandlogo(Context & context) { context.es = context.cs; context.bx = 2807; context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._cmp(context.al, 1); if (context.flags.z()) goto keyok; context.push(context.bx); @@ -11159,7 +11159,7 @@ keyok: } void searchforstring(Context & context) { - context.dl = context.ds.byte(context.di); + context.dl = context.es.byte(context.di); context.cx = context.di; restartlook: context.di = context.cx; @@ -11175,7 +11175,7 @@ keeplooking: context._cmp(context.al, 34); if (context.flags.z()) goto notfound; nofindingtopic: - context.ah = context.ds.byte(context.di); + context.ah = context.es.byte(context.di); context._cmp(context.al, context.dl); if (!context.flags.z()) goto notbracket; context._add(context.dh, 1); @@ -11306,7 +11306,7 @@ void showcurrentfile(Context & context) { context.bx = 37; context.si = 2892+1; curfileloop: - context.al = context.ds.byte(context.si); + context.al = context.cs.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto finishfile; context._add(context.si, 1); @@ -11327,7 +11327,7 @@ void monmessage(Context & context) { context.cl = context.al; context.ch = 0; monmessageloop: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._add(context.bx, 1); context._cmp(context.al, '+'); if (!context.flags.z()) goto monmessageloop; @@ -11515,19 +11515,19 @@ checkuselist: context.push(context.si); context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.ds.byte(context.bx+12)); + context._cmp(context.al, context.es.byte(context.bx+12)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.ds.byte(context.bx+13)); + context._cmp(context.al, context.es.byte(context.bx+13)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.ds.byte(context.bx+14)); + context._cmp(context.al, context.es.byte(context.bx+14)); if (!context.flags.z()) goto failed; context._lodsb(); context._sub(context.al, 'A'); - context._cmp(context.al, context.ds.byte(context.bx+15)); + context._cmp(context.al, context.es.byte(context.bx+15)); if (!context.flags.z()) goto failed; context._lodsw(); context.si = context.pop(); @@ -11546,7 +11546,7 @@ failed: findnextcolon(context); context._cmp(context.al, 0); if (context.flags.z()) goto cantuse2; - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto cantuse2; usetext(context); @@ -11611,7 +11611,7 @@ tapwith: fillcupfromtap: context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+15) = 'F'-'A'; + context.es.byte(context.bx+15) = 'F'-'A'; context.al = 8; playchannel1(context); context.cx = 300; @@ -11671,7 +11671,7 @@ void opentomb(Context & context) { void usetrainer(Context & context) { getanyad(context); - context._cmp(context.ds.byte(context.bx+2), 4); + context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; context._add(context.data.byte(1), 1); makeworn(context); @@ -11736,7 +11736,7 @@ fillcup: putbackobstuff(context); context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+15) = 'F'-'A'; + context.es.byte(context.bx+15) = 'F'-'A'; return; alreadyfull: context.cx = 300; @@ -11802,7 +11802,7 @@ isrightkey: void chewy(Context & context) { showfirstuse(context); getanyad(context); - context.ds.byte(context.bx+2) = 255; + context.es.byte(context.bx+2) = 255; context.data.byte(102) = 1; return; } @@ -12002,7 +12002,7 @@ slabwith: nextslab: context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+2) = 0; + context.es.byte(context.bx+2) = 0; context.al = context.data.byte(98); context.push(context.ax); removesetobject(context); @@ -12049,7 +12049,7 @@ cartwith: nextcart: context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+2) = 0; + context.es.byte(context.bx+2) = 0; context.al = context.data.byte(98); context.push(context.ax); removesetobject(context); @@ -12150,7 +12150,7 @@ destoryopenbox: showpuztext(context); context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+15) = 'E'-'A'; + context.es.byte(context.bx+15) = 'E'-'A'; context.data.word(19) = 140; context.data.word(21) = 105; context.data.word(23) = 181; @@ -12253,7 +12253,7 @@ righthand: removesetobject(context); context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+2) = 255; + context.es.byte(context.bx+2) = 255; context.data.byte(46) = 1; context.data.byte(102) = 1; return; @@ -12349,7 +12349,7 @@ void openlouis(Context & context) { void nextcolon(Context & context) { lookcolon: - context.al = context.ds.byte(context.si); + context.al = context.es.byte(context.si); context._add(context.si, 1); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; @@ -12456,13 +12456,13 @@ void isitright(Context & context) { context.bx = context.ds; context.es = context.bx; context.bx = 8344; - context._cmp(context.ds.byte(context.bx+0), context.al); + context._cmp(context.es.byte(context.bx+0), context.al); if (!context.flags.z()) goto notright; - context._cmp(context.ds.byte(context.bx+1), context.ah); + context._cmp(context.es.byte(context.bx+1), context.ah); if (!context.flags.z()) goto notright; - context._cmp(context.ds.byte(context.bx+2), context.cl); + context._cmp(context.es.byte(context.bx+2), context.cl); if (!context.flags.z()) goto notright; - context._cmp(context.ds.byte(context.bx+3), context.ch); + context._cmp(context.es.byte(context.bx+3), context.ch); notright: return; } @@ -12664,7 +12664,7 @@ cigarette: showpuztext(context); context.al = context.data.byte(94); getexad(context); - context.ds.byte(context.bx+2) = 255; + context.es.byte(context.bx+2) = 255; context.data.byte(102) = 1; return; } @@ -12938,7 +12938,7 @@ numberpoke0: context._sub(context.ax, 10000); if (!context.flags.c()) goto numberpoke0; context._add(context.ax, 10000); - context.ds.byte(context.bx) = context.cl; + context.cs.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke1: @@ -12946,7 +12946,7 @@ numberpoke1: context._sub(context.ax, 1000); if (!context.flags.c()) goto numberpoke1; context._add(context.ax, 1000); - context.ds.byte(context.bx) = context.cl; + context.cs.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke2: @@ -12954,7 +12954,7 @@ numberpoke2: context._sub(context.ax, 100); if (!context.flags.c()) goto numberpoke2; context._add(context.ax, 100); - context.ds.byte(context.bx) = context.cl; + context.cs.byte(context.bx) = context.cl; context._add(context.bx, 1); context.cl = 48-1; numberpoke3: @@ -12962,10 +12962,10 @@ numberpoke3: context._sub(context.ax, 10); if (!context.flags.c()) goto numberpoke3; context._add(context.ax, 10); - context.ds.byte(context.bx) = context.cl; + context.cs.byte(context.bx) = context.cl; context.bx = 3390; context._add(context.al, 48); - context.ds.byte(context.bx) = context.al; + context.cs.byte(context.bx) = context.al; return; } @@ -13118,7 +13118,7 @@ void usehandle(Context & context) { context.cl = 'T'; context.ch = 'W'; findsetobject(context); - context.al = context.ds.byte(context.bx+58); + context.al = context.es.byte(context.bx+58); context._cmp(context.al, 255); if (!context.flags.z()) goto havecutwire; context.cx = 300; @@ -13291,13 +13291,13 @@ stereook2: putbackobstuff(context); getanyad(context); context.al = 255; - context.ds.byte(context.bx+10) = context.al; + context.es.byte(context.bx+10) = context.al; return; cdinside: getanyad(context); - context.al = context.ds.byte(context.bx+10); + context.al = context.es.byte(context.bx+10); context._xor(context.al, 1); - context.ds.byte(context.bx+10) = context.al; + context.es.byte(context.bx+10) = context.al; context._cmp(context.al, 255); if (context.flags.z()) goto stereoon; context.al = 7; @@ -13435,7 +13435,7 @@ void withwhat(Context & context) { void selectob(Context & context) { findinvpos(context); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canselectob; blank(context); @@ -13478,9 +13478,9 @@ void compare(Context & context) { getanyaddir(context); context.dx = context.pop(); context.cx = context.pop(); - context._cmp(context.ds.word(context.bx+12), context.cx); + context._cmp(context.es.word(context.bx+12), context.cx); if (!context.flags.z()) goto comparefin; - context._cmp(context.ds.word(context.bx+14), context.dx); + context._cmp(context.es.word(context.bx+14), context.dx); comparefin: return; } @@ -13494,13 +13494,13 @@ void findsetobject(Context & context) { context.bx = 0; context.dl = 0; findsetloop: - context._cmp(context.al, context.ds.byte(context.bx+12)); + context._cmp(context.al, context.es.byte(context.bx+12)); if (!context.flags.z()) goto nofind; - context._cmp(context.ah, context.ds.byte(context.bx+13)); + context._cmp(context.ah, context.es.byte(context.bx+13)); if (!context.flags.z()) goto nofind; - context._cmp(context.cl, context.ds.byte(context.bx+14)); + context._cmp(context.cl, context.es.byte(context.bx+14)); if (!context.flags.z()) goto nofind; - context._cmp(context.ch, context.ds.byte(context.bx+15)); + context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofind; context.al = context.dl; return; @@ -13522,13 +13522,13 @@ void findexobject(Context & context) { context.bx = 0+2080+30000; context.dl = 0; findexloop: - context._cmp(context.al, context.ds.byte(context.bx+12)); + context._cmp(context.al, context.es.byte(context.bx+12)); if (!context.flags.z()) goto nofindex; - context._cmp(context.ah, context.ds.byte(context.bx+13)); + context._cmp(context.ah, context.es.byte(context.bx+13)); if (!context.flags.z()) goto nofindex; - context._cmp(context.cl, context.ds.byte(context.bx+14)); + context._cmp(context.cl, context.es.byte(context.bx+14)); if (!context.flags.z()) goto nofindex; - context._cmp(context.ch, context.ds.byte(context.bx+15)); + context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofindex; context.al = context.dl; return; @@ -13550,15 +13550,15 @@ void isryanholding(Context & context) { context.bx = 0+2080+30000; context.dl = 0; searchinv: - context._cmp(context.ds.byte(context.bx+2), 4); + context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto nofindininv; - context._cmp(context.al, context.ds.byte(context.bx+12)); + context._cmp(context.al, context.es.byte(context.bx+12)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.ah, context.ds.byte(context.bx+13)); + context._cmp(context.ah, context.es.byte(context.bx+13)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.cl, context.ds.byte(context.bx+14)); + context._cmp(context.cl, context.es.byte(context.bx+14)); if (!context.flags.z()) goto nofindininv; - context._cmp(context.ch, context.ds.byte(context.bx+15)); + context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofindininv; context.al = context.dl; context._cmp(context.al, 114); @@ -13578,9 +13578,9 @@ void checkinside(Context & context) { context.bx = 0+2080+30000; context.cl = 0; insideloop: - context._cmp(context.al, context.ds.byte(context.bx+3)); + context._cmp(context.al, context.es.byte(context.bx+3)); if (!context.flags.z()) goto notfoundinside; - context._cmp(context.ah, context.ds.byte(context.bx+2)); + context._cmp(context.ah, context.es.byte(context.bx+2)); if (!context.flags.z()) goto notfoundinside; return; notfoundinside: @@ -13656,7 +13656,7 @@ void findpuztext(Context & context) { context.si = context.ax; context._add(context.si, context.si); context.es = context.data.word(452); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; return; @@ -13669,7 +13669,7 @@ void placesetobject(Context & context) { context.ch = 0; findormake(context); getsetad(context); - context.ds.byte(context.bx+58) = 0; + context.es.byte(context.bx+58) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -13682,7 +13682,7 @@ void removesetobject(Context & context) { context.ch = 0; findormake(context); getsetad(context); - context.ds.byte(context.bx+58) = 255; + context.es.byte(context.bx+58) = 255; context.bx = context.pop(); context.es = context.pop(); return; @@ -13692,7 +13692,7 @@ void issetobonmap(Context & context) { context.push(context.es); context.push(context.bx); getsetad(context); - context.al = context.ds.byte(context.bx+58); + context.al = context.es.byte(context.bx+58); context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, 0); @@ -13706,7 +13706,7 @@ void placefreeobject(Context & context) { context.ch = 1; findormake(context); getfreead(context); - context.ds.byte(context.bx+2) = 0; + context.es.byte(context.bx+2) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -13716,7 +13716,7 @@ void removefreeobject(Context & context) { context.push(context.es); context.push(context.bx); getfreead(context); - context.ds.byte(context.bx+2) = 255; + context.es.byte(context.bx+2) = 255; context.bx = context.pop(); context.es = context.pop(); return; @@ -13728,22 +13728,22 @@ void findormake(Context & context) { context.es = context.data.word(410); context.ah = context.data.byte(183); changeloop: - context._cmp(context.ds.byte(context.bx), 255); + context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto haventfound; - context._cmp(context.ax, context.ds.word(context.bx)); + context._cmp(context.ax, context.es.word(context.bx)); if (!context.flags.z()) goto nofoundchange; - context._cmp(context.ch, context.ds.byte(context.bx+3)); + context._cmp(context.ch, context.es.byte(context.bx+3)); if (context.flags.z()) goto foundchange; nofoundchange: context._add(context.bx, 4); goto changeloop; foundchange: context.ax = context.pop(); - context.ds.byte(context.bx+2) = context.cl; + context.es.byte(context.bx+2) = context.cl; return; haventfound: - context.ds.word(context.bx) = context.ax; - context.ds.word(context.bx+2) = context.cx; + context.es.word(context.bx) = context.ax; + context.es.word(context.bx+2) = context.cx; context.ax = context.pop(); return; } @@ -13762,10 +13762,10 @@ void setallchanges(Context & context) { context.es = context.data.word(410); context.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); setallloop: - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endsetloop; - context.cx = context.ds.word(context.bx+2); + context.cx = context.es.word(context.bx+2); context._add(context.bx, 4); context._cmp(context.ah, context.data.byte(183)); if (!context.flags.z()) goto setallloop; @@ -13801,22 +13801,22 @@ path: context._add(context.bx, 0); context.es = context.data.word(448); context.cx = context.pop(); - context.ds.byte(context.bx+6) = context.cl; + context.es.byte(context.bx+6) = context.cl; nopath: return; object: context.push(context.cx); getsetad(context); context.cx = context.pop(); - context.ds.byte(context.bx+58) = context.cl; + context.es.byte(context.bx+58) = context.cl; return; freeobject: context.push(context.cx); getfreead(context); context.cx = context.pop(); - context._cmp(context.ds.byte(context.bx+2), 255); + context._cmp(context.es.byte(context.bx+2), 255); if (!context.flags.z()) goto beenpickedup; - context.ds.byte(context.bx+2) = context.cl; + context.es.byte(context.bx+2) = context.cl; beenpickedup: return; } @@ -13949,7 +13949,7 @@ void setuptimeduse(Context & context) { context._add(context.bx, context.bx); context.es = context.data.word(452); context.cx = 66*2; - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; context.data.word(330) = context.es; @@ -13971,7 +13971,7 @@ void setuptimedtemp(Context & context) { context._add(context.bx, context.bx); context.es = context.data.word(464); context.cx = 66*2; - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; context.data.word(330) = context.es; @@ -14509,7 +14509,7 @@ not10: context.dx = context.ds; context.es = context.dx; context._add(context.bx, 8344); - context.ds.byte(context.bx) = context.al; + context.es.byte(context.bx) = context.al; context._add(context.data.word(278), 1); nomorekeys: return; @@ -15115,7 +15115,7 @@ leftpageloop: context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(464); - context.si = context.ds.word(context.bx); + context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 2; context.bx = 48; @@ -15144,10 +15144,10 @@ flipfolder: context.push(context.si); context.cx = 65; flipfolderline: - context.al = context.ds.byte(context.di); - context.ah = context.ds.byte(context.si); - context.ds.byte(context.di) = context.ah; - context.ds.byte(context.si) = context.al; + context.al = context.es.byte(context.di); + context.ah = context.es.byte(context.si); + context.es.byte(context.di) = context.ah; + context.es.byte(context.si) = context.al; context._sub(context.si, 1); context._add(context.di, 1); if (--context.cx) goto flipfolderline; @@ -15194,7 +15194,7 @@ rightpageloop: context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(464); - context.si = context.ds.word(context.bx); + context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 152; context.bx = 48; @@ -15797,7 +15797,7 @@ void findtext1(Context & context) { context.si = context.ax; context._add(context.si, context.si); context.es = context.data.word(464); - context.ax = context.ds.word(context.si); + context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; return; @@ -16168,19 +16168,19 @@ alreadyactsave: context.cx = 16; while(--context.cx) context._movsw(); context.al = context.data.byte(530); - context.ds.byte(context.bx+13) = context.al; + context.es.byte(context.bx+13) = context.al; context.al = context.data.byte(147); - context.ds.byte(context.bx+15) = context.al; + context.es.byte(context.bx+15) = context.al; context.al = context.data.byte(148); - context.ds.byte(context.bx+16) = context.al; + context.es.byte(context.bx+16) = context.al; context.al = context.data.byte(34); - context.ds.byte(context.bx+20) = context.al; + context.es.byte(context.bx+20) = context.al; context.al = context.data.byte(474); - context.ds.byte(context.bx+21) = context.al; + context.es.byte(context.bx+21) = context.al; context.al = context.data.byte(132); - context.ds.byte(context.bx+22) = context.al; + context.es.byte(context.bx+22) = context.al; context.al = 255; - context.ds.byte(context.bx+27) = context.al; + context.es.byte(context.bx+27) = context.al; saveposition(context); getridoftemp(context); restoreall(context); @@ -16250,8 +16250,8 @@ notret: if (context.flags.z()) goto nokeypress; getnamepos(context); context._sub(context.data.byte(341), 1); - context.ds.byte(context.bx) = 0; - context.ds.byte(context.bx+1) = 1; + context.es.byte(context.bx) = 0; + context.es.byte(context.bx+1) = 1; goto afterkey; nodel2: spacepress: @@ -16260,9 +16260,9 @@ spacepress: getnamepos(context); context._add(context.data.byte(341), 1); context.al = context.data.byte(141); - context.ds.byte(context.bx+1) = context.al; - context.ds.byte(context.bx+2) = 0; - context.ds.byte(context.bx+3) = 1; + context.es.byte(context.bx+1) = context.al; + context.es.byte(context.bx+2) = 0; + context.es.byte(context.bx+3) = 1; goto afterkey; nokeypress: return; @@ -16451,21 +16451,21 @@ shownameloop: zerostill: context._sub(context.si, 1); context._sub(context.cl, 1); - context._cmp(context.ds.byte(context.si), 1); + context._cmp(context.es.byte(context.si), 1); if (!context.flags.z()) goto foundcharacter; goto zerostill; foundcharacter: context.data.byte(341) = context.cl; - context.ds.byte(context.si) = '/'; - context.ds.byte(context.si+1) = 0; + context.es.byte(context.si) = '/'; + context.es.byte(context.si+1) = 0; context.push(context.si); context.si = context.dx; context.dl = 200; context.ah = 0; printdirect(context); context.si = context.pop(); - context.ds.byte(context.si) = 0; - context.ds.byte(context.si+1) = 1; + context.es.byte(context.si) = 0; + context.es.byte(context.si+1) = 1; goto afterprintname; loadmode: context.al = 0; @@ -16688,17 +16688,17 @@ noloadold: void createname(Context & context) { context.push(context.ax); context.di = 4932; - context.ds.byte(context.di+0) = context.dl; - context.ds.byte(context.di+3) = context.cl; + context.cs.byte(context.di+0) = context.dl; + context.cs.byte(context.di+3) = context.cl; context.al = context.dh; context.ah = '0'-1; findten: context._add(context.ah, 1); context._sub(context.al, 10); if (!context.flags.c()) goto findten; - context.ds.byte(context.di+1) = context.ah; + context.cs.byte(context.di+1) = context.ah; context._add(context.al, 10+'0'); - context.ds.byte(context.di+2) = context.al; + context.cs.byte(context.di+2) = context.al; context.ax = context.pop(); context.cl = '0'-1; thousandsc: @@ -16706,23 +16706,23 @@ thousandsc: context._sub(context.ax, 1000); if (!context.flags.c()) goto thousandsc; context._add(context.ax, 1000); - context.ds.byte(context.di+4) = context.cl; + context.cs.byte(context.di+4) = context.cl; context.cl = '0'-1; hundredsc: context._add(context.cl, 1); context._sub(context.ax, 100); if (!context.flags.c()) goto hundredsc; context._add(context.ax, 100); - context.ds.byte(context.di+5) = context.cl; + context.cs.byte(context.di+5) = context.cl; context.cl = '0'-1; tensc: context._add(context.cl, 1); context._sub(context.ax, 10); if (!context.flags.c()) goto tensc; context._add(context.ax, 10); - context.ds.byte(context.di+6) = context.cl; + context.cs.byte(context.di+6) = context.cl; context._add(context.al, '0'); - context.ds.byte(context.di+7) = context.al; + context.cs.byte(context.di+7) = context.al; return; } @@ -16780,12 +16780,12 @@ notsecondbank: context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.ah = 0; context.data.word(500) = context.ax; - context.ax = context.ds.word(context.bx+1); + context.ax = context.es.word(context.bx+1); context.data.word(502) = context.ax; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context.data.word(504) = context.ax; context._cmp(context.data.byte(507), 0); if (context.flags.z()) goto nosetloop; @@ -16829,12 +16829,12 @@ notsecondbank1: context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.ah = 0; context.data.word(515) = context.ax; - context.ax = context.ds.word(context.bx+1); + context.ax = context.es.word(context.bx+1); context.data.word(517) = context.ax; - context.ax = context.ds.word(context.bx+3); + context.ax = context.es.word(context.bx+3); context.data.word(519) = context.ax; context.si = context.pop(); context.di = context.pop(); @@ -16950,9 +16950,9 @@ lowvolumetran: volloop: context._lodsw(); context.bl = context.al; - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.bl = context.ah; - context.ah = context.ds.byte(context.bx); + context.ah = context.es.byte(context.bx); context._stosw(); if (--context.cx) goto volloop; return; @@ -17007,7 +17007,7 @@ lowvolumemix: context.bh = context.data.byte(385); context._add(context.bh, 63); context.bl = context.al; - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.bx = context.pop(); context.ah = context.ds.byte(context.bx); context._add(context.bx, 1); @@ -17455,7 +17455,7 @@ void clearrest(Context & context) { void parseblaster(Context & context) { lookattail: - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context._cmp(context.al, 0); if (context.flags.z()) goto endtail; context._cmp(context.al, 13); @@ -17484,20 +17484,20 @@ lookattail: if (--context.cx) goto lookattail; return; issoundint: - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); context.data.byte(377) = context.al; context._add(context.bx, 1); goto lookattail; isdma: - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); context.data.byte(378) = context.al; context._add(context.bx, 1); goto lookattail; isbaseadd: context.push(context.cx); - context.al = context.ds.byte(context.bx+2); + context.al = context.es.byte(context.bx+2); context._sub(context.al, '0'); context.ah = 0; context.cl = 4; @@ -17812,11 +17812,11 @@ void showbyte(Context & context) { context._shr(context.dl, 1); context._shr(context.dl, 1); onedigit(context); - context.ds.byte(context.di) = context.dl; + context.es.byte(context.di) = context.dl; context.dl = context.al; context._and(context.dl, 15); onedigit(context); - context.ds.byte(context.di+1) = context.dl; + context.es.byte(context.di+1) = context.dl; context._add(context.di, 3); return; } @@ -17854,7 +17854,7 @@ word1: if (!context.flags.c()) goto word1; context._add(context.ax, context.bx); convnum(context); - context.ds.byte(context.di) = context.cl; + context.cs.byte(context.di) = context.cl; context.bx = 1000; context.cl = 47; word2: @@ -17863,7 +17863,7 @@ word2: if (!context.flags.c()) goto word2; context._add(context.ax, context.bx); convnum(context); - context.ds.byte(context.di+1) = context.cl; + context.cs.byte(context.di+1) = context.cl; context.bx = 100; context.cl = 47; word3: @@ -17872,7 +17872,7 @@ word3: if (!context.flags.c()) goto word3; context._add(context.ax, context.bx); convnum(context); - context.ds.byte(context.di+2) = context.cl; + context.cs.byte(context.di+2) = context.cl; context.bx = 10; context.cl = 47; word4: @@ -17881,11 +17881,11 @@ word4: if (!context.flags.c()) goto word4; context._add(context.ax, context.bx); convnum(context); - context.ds.byte(context.di+3) = context.cl; + context.cs.byte(context.di+3) = context.cl; context._add(context.al, 48); context.cl = context.al; convnum(context); - context.ds.byte(context.di+4) = context.cl; + context.cs.byte(context.di+4) = context.cl; return; } @@ -18015,22 +18015,22 @@ norun: void checkcoords(Context & context) { loop048: - context.ax = context.ds.word(context.bx); + context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nonefound; context.push(context.bx); context._cmp(context.data.word(196), context.ax); if (context.flags.l()) goto over045; - context.ax = context.ds.word(context.bx+2); + context.ax = context.cs.word(context.bx+2); context._cmp(context.data.word(196), context.ax); if (!context.flags.ge()) goto over045; - context.ax = context.ds.word(context.bx+4); + context.ax = context.cs.word(context.bx+4); context._cmp(context.data.word(198), context.ax); if (context.flags.l()) goto over045; - context.ax = context.ds.word(context.bx+6); + context.ax = context.cs.word(context.bx+6); context._cmp(context.data.word(198), context.ax); if (!context.flags.ge()) goto over045; - context.ax = context.ds.word(context.bx+8); + context.ax = context.cs.word(context.bx+8); __dispatch_call(context, context.ax); finished: context.ax = context.pop(); @@ -18104,28 +18104,28 @@ void checkifperson(Context & context) { context.cx = 12; identifyreel: context.push(context.cx); - context._cmp(context.ds.byte(context.bx+4), 255); + context._cmp(context.es.byte(context.bx+4), 255); if (context.flags.z()) goto notareelid; context.push(context.es); context.push(context.bx); context.push(context.ax); - context.ax = context.ds.word(context.bx+0); + context.ax = context.es.word(context.bx+0); context.data.word(237) = context.ax; getreelstart(context); - context._cmp(context.ds.word(context.si+2), 0x0ffff); + context._cmp(context.es.word(context.si+2), 0x0ffff); if (!context.flags.z()) goto notblankpers; context._add(context.si, 5); notblankpers: - context.cx = context.ds.word(context.si+2); - context.ax = context.ds.word(context.si+0); + context.cx = context.es.word(context.si+2); + context.ax = context.es.word(context.si+0); context.push(context.cx); getreelframeax(context); context.cx = context.pop(); - context._add(context.cl, context.ds.byte(context.bx+4)); - context._add(context.ch, context.ds.byte(context.bx+5)); + context._add(context.cl, context.es.byte(context.bx+4)); + context._add(context.ch, context.es.byte(context.bx+5)); context.dx = context.cx; - context._add(context.dl, context.ds.byte(context.bx+0)); - context._add(context.dh, context.ds.byte(context.bx+1)); + context._add(context.dl, context.es.byte(context.bx+0)); + context._add(context.dh, context.es.byte(context.bx+1)); context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); @@ -18138,9 +18138,9 @@ notblankpers: context._cmp(context.ah, context.dh); if (!context.flags.c()) goto notareelid; context.cx = context.pop(); - context.ax = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx+2); context.data.word(247) = context.ax; - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); context.ah = 5; obname(context); context.al = 0; @@ -18159,21 +18159,21 @@ void checkifset(Context & context) { context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; identifyset: - context._cmp(context.ds.byte(context.bx+4), 255); + context._cmp(context.es.byte(context.bx+4), 255); if (context.flags.z()) goto notasetid; - context._cmp(context.al, context.ds.byte(context.bx)); + context._cmp(context.al, context.es.byte(context.bx)); if (context.flags.c()) goto notasetid; - context._cmp(context.al, context.ds.byte(context.bx+2)); + context._cmp(context.al, context.es.byte(context.bx+2)); if (!context.flags.c()) goto notasetid; - context._cmp(context.ah, context.ds.byte(context.bx+1)); + context._cmp(context.ah, context.es.byte(context.bx+1)); if (context.flags.c()) goto notasetid; - context._cmp(context.ah, context.ds.byte(context.bx+3)); + context._cmp(context.ah, context.es.byte(context.bx+3)); if (!context.flags.c()) goto notasetid; pixelcheckset(context); if (context.flags.z()) goto notasetid; isitdescribed(context); if (context.flags.z()) goto notasetid; - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); context.ah = 1; obname(context); context.al = 0; @@ -18192,17 +18192,17 @@ void checkifex(Context & context) { context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; identifyex: - context._cmp(context.ds.byte(context.bx+4), 255); + context._cmp(context.es.byte(context.bx+4), 255); if (context.flags.z()) goto notanexid; - context._cmp(context.al, context.ds.byte(context.bx)); + context._cmp(context.al, context.es.byte(context.bx)); if (context.flags.c()) goto notanexid; - context._cmp(context.al, context.ds.byte(context.bx+2)); + context._cmp(context.al, context.es.byte(context.bx+2)); if (!context.flags.c()) goto notanexid; - context._cmp(context.ah, context.ds.byte(context.bx+1)); + context._cmp(context.ah, context.es.byte(context.bx+1)); if (context.flags.c()) goto notanexid; - context._cmp(context.ah, context.ds.byte(context.bx+3)); + context._cmp(context.ah, context.es.byte(context.bx+3)); if (!context.flags.c()) goto notanexid; - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); context.ah = 4; obname(context); context.al = 1; @@ -18221,17 +18221,17 @@ void checkiffree(Context & context) { context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; identifyfree: - context._cmp(context.ds.byte(context.bx+4), 255); + context._cmp(context.es.byte(context.bx+4), 255); if (context.flags.z()) goto notafreeid; - context._cmp(context.al, context.ds.byte(context.bx)); + context._cmp(context.al, context.es.byte(context.bx)); if (context.flags.c()) goto notafreeid; - context._cmp(context.al, context.ds.byte(context.bx+2)); + context._cmp(context.al, context.es.byte(context.bx+2)); if (!context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.ds.byte(context.bx+1)); + context._cmp(context.ah, context.es.byte(context.bx+1)); if (context.flags.c()) goto notafreeid; - context._cmp(context.ah, context.ds.byte(context.bx+3)); + context._cmp(context.ah, context.es.byte(context.bx+3)); if (!context.flags.c()) goto notafreeid; - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); context.ah = 2; obname(context); context.al = 0; @@ -18250,16 +18250,16 @@ void isitdescribed(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.bx); - context.al = context.ds.byte(context.bx+4); + context.al = context.es.byte(context.bx+4); context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(438); context._add(context.bx, 0); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 0+(130*2)); context.bx = context.ax; - context.dl = context.ds.byte(context.bx); + context.dl = context.es.byte(context.bx); context.bx = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -18280,17 +18280,17 @@ void findpathofpoint(Context & context) { context.cx = context.pop(); context.dl = 0; pathloop: - context.al = context.ds.byte(context.bx+6); + context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); if (!context.flags.z()) goto flunkedit; - context.ax = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto flunkedit; context._cmp(context.cl, context.al); if (context.flags.c()) goto flunkedit; context._cmp(context.ch, context.ah); if (context.flags.c()) goto flunkedit; - context.ax = context.ds.word(context.bx+4); + context.ax = context.es.word(context.bx+4); context._cmp(context.cl, context.al); if (!context.flags.c()) goto flunkedit; context._cmp(context.ch, context.ah); @@ -18318,14 +18318,14 @@ void findfirstpath(Context & context) { context.cx = context.pop(); context.dl = 0; fpathloop: - context.ax = context.ds.word(context.bx+2); + context.ax = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nofirst; context._cmp(context.cl, context.al); if (context.flags.c()) goto nofirst; context._cmp(context.ch, context.ah); if (context.flags.c()) goto nofirst; - context.ax = context.ds.word(context.bx+4); + context.ax = context.es.word(context.bx+4); context._cmp(context.cl, context.al); if (!context.flags.c()) goto nofirst; context._cmp(context.ch, context.ah); @@ -18339,7 +18339,7 @@ nofirst: context.al = 0; return; gotfirst: - context.al = context.ds.byte(context.bx+6); + context.al = context.es.byte(context.bx+6); return; } @@ -18361,7 +18361,7 @@ void turnpathon(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 255; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; nopathon: return; } @@ -18384,7 +18384,7 @@ void turnpathoff(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; nopathoff: return; } @@ -18411,7 +18411,7 @@ void turnanypathon(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 255; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; return; } @@ -18437,7 +18437,7 @@ void turnanypathoff(Context & context) { context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; return; } @@ -18450,7 +18450,7 @@ void checkifpathison(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx+6); + context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); return; } @@ -18498,15 +18498,15 @@ void atmospheres(Context & context) { context.ch = context.data.byte(148); context.bx = 5073; nextatmos: - context.al = context.ds.byte(context.bx); + context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto nomoreatmos; context._cmp(context.al, context.data.byte(183)); if (!context.flags.z()) goto wrongatmos; - context.ax = context.ds.word(context.bx+1); + context.ax = context.cs.word(context.bx+1); context._cmp(context.ax, context.cx); if (!context.flags.z()) goto wrongatmos; - context.ax = context.ds.word(context.bx+3); + context.ax = context.cs.word(context.bx+3); context._cmp(context.al, context.data.byte(506)); if (context.flags.z()) goto playingalready; context._cmp(context.data.byte(8), 45); @@ -18726,7 +18726,7 @@ void commandwithob(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(450); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.di = context.data.word(77); @@ -18777,7 +18777,7 @@ void commandonly(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(450); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.di = context.data.word(77); @@ -18798,7 +18798,7 @@ void printmessage(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(450); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.di = context.pop(); @@ -18819,7 +18819,7 @@ void printmessage2(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(450); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; context.ax = context.pop(); @@ -18928,11 +18928,11 @@ notsamealready: context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); context.data.word(478) = context.ax; - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); context.data.word(480) = context.ax; @@ -18943,11 +18943,11 @@ notsamealready: context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.es.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); context.data.word(482) = context.ax; - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); context.data.word(484) = context.ax; @@ -18974,25 +18974,25 @@ void checkdest(Context & context) { context.cl = 24; context.ch = context.data.byte(477); checkdestloop: - context.dh = context.ds.byte(context.bx); + context.dh = context.es.byte(context.bx); context._and(context.dh, 0xf0); - context.dl = context.ds.byte(context.bx); + context.dl = context.es.byte(context.bx); context._and(context.dl, 0xf); context._cmp(context.ax, context.dx); if (!context.flags.z()) goto nextcheck; - context.al = context.ds.byte(context.bx+1); + context.al = context.es.byte(context.bx+1); context._and(context.al, 15); context.data.byte(477) = context.al; context.bx = context.pop(); return; nextcheck: - context.dl = context.ds.byte(context.bx); + context.dl = context.es.byte(context.bx); context._and(context.dl, 0xf0); context._shr(context.dl, 1); context._shr(context.dl, 1); context._shr(context.dl, 1); context._shr(context.dl, 1); - context.dh = context.ds.byte(context.bx); + context.dh = context.es.byte(context.bx); context._and(context.dh, 0xf); context._shl(context.dh, 1); context._shl(context.dh, 1); @@ -19000,7 +19000,7 @@ nextcheck: context._shl(context.dh, 1); context._cmp(context.ax, context.dx); if (!context.flags.z()) goto nextcheck2; - context.ch = context.ds.byte(context.bx+1); + context.ch = context.es.byte(context.bx+1); context._and(context.ch, 15); nextcheck2: context._add(context.bx, 2); @@ -19430,7 +19430,7 @@ notover32: context._add(context.bx, context.bx); context.es = context.data.word(434); context._add(context.bx, 0); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._add(context.ax, 0+(38*2)); context.si = context.ax; context.data.word(75) = 7; @@ -19549,7 +19549,7 @@ nomorethan6: context.ah = 0; context.bx = 5691; context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.cs.byte(context.bx); context.ds = context.data.word(406); context.di = 44; context.bx = 32; @@ -19973,7 +19973,7 @@ finflashmouse: context.ah = 0; context.bx = 5698; context._add(context.bx, context.ax); - context.al = context.ds.byte(context.bx); + context.al = context.cs.byte(context.bx); context.data.byte(230) = context.al; return; combathand: @@ -20064,7 +20064,7 @@ void readkey(Context & context) { context.data.word(394) = context.bx; context.di = 5715; context._add(context.di, context.bx); - context.al = context.ds.byte(context.di); + context.al = context.cs.byte(context.di); context.data.byte(141) = context.al; return; nokey: @@ -20077,7 +20077,7 @@ void convertkey(Context & context) { context.ah = 0; context.di = 5731; context._add(context.di, context.ax); - context.al = context.ds.byte(context.di); + context.al = context.cs.byte(context.di); return; } @@ -20158,7 +20158,7 @@ void loadtempcharset(Context & context) { void standardload(Context & context) { openfile(context); readheader(context); - context.bx = context.ds.word(context.di); + context.bx = context.es.word(context.di); context.push(context.bx); context.cl = 4; context._shr(context.bx, context.cl); @@ -20211,7 +20211,7 @@ void loadroomssample(Context & context) { twodigitnum(context); context.di = 1896; context._xchg(context.al, context.ah); - context.ds.word(context.di+10) = context.ax; + context.cs.word(context.di+10) = context.ax; context.dx = context.di; loadsecondsample(context); loadedalready: @@ -20395,31 +20395,31 @@ blimey: void startloading(Context & context) { context.data.byte(63) = 0; - context.al = context.ds.byte(context.bx+13); + context.al = context.cs.byte(context.bx+13); context.data.byte(530) = context.al; - context.al = context.ds.byte(context.bx+15); + context.al = context.cs.byte(context.bx+15); context.data.byte(147) = context.al; - context.al = context.ds.byte(context.bx+16); + context.al = context.cs.byte(context.bx+16); context.data.byte(148) = context.al; - context.al = context.ds.byte(context.bx+20); + context.al = context.cs.byte(context.bx+20); context.data.byte(34) = context.al; - context.al = context.ds.byte(context.bx+21); + context.al = context.cs.byte(context.bx+21); context.data.byte(474) = context.al; context.data.byte(477) = context.al; context.data.byte(476) = context.al; - context.al = context.ds.byte(context.bx+22); + context.al = context.cs.byte(context.bx+22); context.data.byte(132) = context.al; context.data.byte(134) = context.al; - context.al = context.ds.byte(context.bx+23); + context.al = context.cs.byte(context.bx+23); context.data.byte(38) = context.al; - context.al = context.ds.byte(context.bx+24); + context.al = context.cs.byte(context.bx+24); context.data.byte(35) = context.al; - context.al = context.ds.byte(context.bx+25); + context.al = context.cs.byte(context.bx+25); context.data.byte(37) = context.al; context.data.byte(64) = -1; - context.al = context.ds.byte(context.bx+27); + context.al = context.cs.byte(context.bx+27); context.push(context.ax); - context.al = context.ds.byte(context.bx+31); + context.al = context.cs.byte(context.bx+31); context.ah = context.data.byte(183); context.data.byte(183) = context.al; context.dx = context.bx; @@ -20556,7 +20556,7 @@ lookx2: context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = 0; - context.ds.byte(context.bx+6) = context.al; + context.es.byte(context.bx+6) = context.al; return; } @@ -20568,7 +20568,7 @@ void findxyfrompath(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); - context.ax = context.ds.word(context.bx); + context.ax = context.es.word(context.bx); context._sub(context.al, 12); context._sub(context.ah, 12); context.data.byte(150) = context.al; @@ -20615,7 +20615,7 @@ void readheader(Context & context) { void allocateload(Context & context) { context.push(context.es); context.push(context.di); - context.bx = context.ds.word(context.di); + context.bx = context.es.word(context.di); context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); -- cgit v1.2.3 From 834816db60fac762c44d4526fb5d48f689b71039 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 01:02:22 +0400 Subject: DREAMWEB: fixed loadseg --- engines/dreamweb/dreamweb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 5c8c6da0c9..3493e5d1e0 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -426,12 +426,12 @@ void saveseg(Context &context) { } void loadseg(Context &context) { - uint16 dst_offset = context.dx; - uint16 size = context.ax; - context.ax = context.es.word(context.di); context.di += 2; + uint16 dst_offset = context.dx; + uint16 size = context.ax; + debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; -- cgit v1.2.3 From 9717b220f10186d816c4a897157c4810ae615490 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 01:06:33 +0400 Subject: DREAMWEB: added names instead of offsets for variables --- devtools/tasmrecover/tasm/cpp.py | 2 +- engines/dreamweb/dreamgen.cpp | 6806 +++++++++++++++++++------------------- 2 files changed, 3404 insertions(+), 3404 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 831074976d..0c1a4b4cec 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -63,7 +63,7 @@ namespace %s { if size == 0: raise Exception("invalid var '%s' size %u" %(name, size)) if self.indirection == 0: - value = "context.data.%s(%d)" %("byte" if size == 1 else "word", g.offset) + value = "context.data.%s(k%s)" %("byte" if size == 1 else "word", name.capitalize()) elif self.indirection == -1: value = "%s" %g.offset self.indirection = 0 diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 8ae92d841a..f270ea6bf4 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -514,9 +514,9 @@ nofog: void receptionist(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotrecep; - context._cmp(context.data.byte(51), 1); + context._cmp(context.data.byte(kCardpassflag), 1); if (!context.flags.z()) goto notsetcard; - context._add(context.data.byte(51), 1); + context._add(context.data.byte(kCardpassflag), 1); context.es.byte(context.bx+7) = 1; context.es.word(context.bx+3) = 64; notsetcard: @@ -548,13 +548,13 @@ gotrecep: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedrecep; - context.data.byte(50) = 1; + context.data.byte(kTalkedtorecep) = 1; nottalkedrecep: return; } void smokebloke(Context & context) { - context._cmp(context.data.byte(40), 0); + context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notspokento; context.al = context.es.byte(context.bx+7); context._and(context.al, 128); @@ -594,7 +594,7 @@ void attendant(Context & context) { context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalked; - context.data.byte(47) = 1; + context.data.byte(kTalkedtoattendant) = 1; nottalked: return; } @@ -609,7 +609,7 @@ void manasleep(Context & context) { } void eden(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); @@ -618,9 +618,9 @@ notinbed: } void edeninbath(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(kGeneraldead), 0); if (context.flags.z()) goto notinbed; - context._cmp(context.data.byte(42), 0); + context._cmp(context.data.byte(kSartaindead), 0); if (!context.flags.z()) goto notinbath; showgamereel(context); addtopeoplelist(context); @@ -645,7 +645,7 @@ void femalefan(Context & context) { } void louis(Context & context) { - context._cmp(context.data.byte(40), 0); + context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); @@ -654,7 +654,7 @@ notlouis1: } void louischair(Context & context) { - context._cmp(context.data.byte(40), 0); + context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); if (!context.flags.z()) goto notlouisanim; @@ -742,7 +742,7 @@ notsmoket2: context._add(context.es.word(context.bx+3), 1); gotsmoket: showgamereel(context); - context._cmp(context.data.byte(45), 1); + context._cmp(context.data.byte(kGunpassflag), 1); if (!context.flags.z()) goto notgotgun; context.es.byte(context.bx+7) = 9; notgotgun: @@ -763,7 +763,7 @@ void barwoman(Context & context) { } void interviewer(Context & context) { - context._cmp(context.data.word(21), 68); + context._cmp(context.data.word(kReeltowatch), 68); if (!context.flags.z()) goto notgeneralstart; context._add(context.es.word(context.bx+3), 1); notgeneralstart: @@ -782,13 +782,13 @@ talking: void soldier1(Context & context) { context._cmp(context.es.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; - context.data.word(19) = 10; + context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 40); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotsoldframe; - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; goto gotsoldframe; notaftersshot: checkspeed(context); @@ -796,16 +796,16 @@ notaftersshot: context._add(context.es.word(context.bx+3), 1); goto gotsoldframe; soldierwait: - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto gotsoldframe; - context.data.word(19) = 10; - context._cmp(context.data.byte(474), 2); + context.data.word(kWatchingtime) = 10; + context._cmp(context.data.byte(kManspath), 2); if (!context.flags.z()) goto gotsoldframe; - context._cmp(context.data.byte(132), 4); + context._cmp(context.data.byte(kFacing), 4); if (!context.flags.z()) goto gotsoldframe; context._add(context.es.word(context.bx+3), 1); - context.data.byte(64) = -1; - context.data.byte(63) = 0; + context.data.byte(kLastweapon) = -1; + context.data.byte(kCombatcount) = 0; gotsoldframe: showgamereel(context); addtopeoplelist(context); @@ -824,22 +824,22 @@ void rockstar(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; goto gotrockframe; notbeforedead: context._cmp(context.ax, 79); if (!context.flags.z()) goto gotrockframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonrock; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context.ax = 123; goto gotrockframe; notgunonrock: - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 40); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotrockframe; - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.ax = 79; gotrockframe: context.es.word(context.bx+3) = context.ax; @@ -848,17 +848,17 @@ rockspeed: context._cmp(context.es.word(context.bx+3), 78); if (!context.flags.z()) goto notalkrock; addtopeoplelist(context); - context.data.byte(233) = 2; - context.data.word(19) = 0; + context.data.byte(kPointermode) = 2; + context.data.word(kWatchingtime) = 0; return; notalkrock: - context.data.word(19) = 2; - context.data.byte(233) = 0; - context.al = context.data.byte(148); + context.data.word(kWatchingtime) = 2; + context.data.byte(kPointermode) = 0; + context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; return; rockcombatend: - context.data.byte(187) = 45; + context.data.byte(kNewlocation) = 45; showgamereel(context); return; } @@ -873,10 +873,10 @@ void helicopter(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 8); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 8); if (context.flags.c()) goto waitabit; - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; waitabit: context.ax = 49; goto gotheliframe; @@ -884,39 +884,39 @@ notbeforehdead: context._cmp(context.ax, 9); if (!context.flags.z()) goto gotheliframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonheli; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context.ax = 55; goto gotheliframe; notgunonheli: context.ax = 5; - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 20); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 20); if (!context.flags.z()) goto gotheliframe; - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.ax = 9; gotheliframe: context.es.word(context.bx+3) = context.ax; helispeed: showgamereel(context); - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; helicombatend: context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; - context._cmp(context.data.byte(63), 7); + context._cmp(context.data.byte(kCombatcount), 7); if (context.flags.c()) goto notwaitingheli; - context.data.byte(233) = 2; - context.data.word(19) = 0; + context.data.byte(kPointermode) = 2; + context.data.word(kWatchingtime) = 0; return; notwaitingheli: - context.data.byte(233) = 0; - context.data.word(19) = 2; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 2; return; heliwon: - context.data.byte(233) = 0; + context.data.byte(kPointermode) = 0; return; } @@ -928,14 +928,14 @@ void mugger(Context & context) { if (context.flags.z()) goto endmugger2; context._cmp(context.ax, 2); if (!context.flags.z()) goto havesetwatch; - context.data.word(19) = 175*2; + context.data.word(kWatchingtime) = 175*2; havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; context._add(context.es.word(context.bx+3), 1); notmugger: showgamereel(context); - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; return; endmugger1: @@ -958,25 +958,25 @@ endmugger1: context.push(context.es); context.push(context.bx); context.es.word(context.bx+3) = 140; - context.data.byte(474) = 2; - context.data.byte(476) = 2; + context.data.byte(kManspath) = 2; + context.data.byte(kFinaldest) = 2; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'A'; findexobject(context); - context.data.byte(98) = context.al; - context.data.byte(101) = 4; + context.data.byte(kCommand) = context.al; + context.data.byte(kObjecttype) = 4; removeobfrominv(context); context.al = 'W'; context.ah = 'E'; context.cl = 'T'; context.ch = 'B'; findexobject(context); - context.data.byte(98) = context.al; - context.data.byte(101) = 4; + context.data.byte(kCommand) = context.al; + context.data.byte(kObjecttype) = 4; removeobfrominv(context); makemainscreen(context); context.al = 48; @@ -985,7 +985,7 @@ endmugger1: context.cx = 70; context.dx = 10; setuptimeduse(context); - context.data.byte(44) = 1; + context.data.byte(kBeenmugged) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -1000,8 +1000,8 @@ void aide(Context & context) { } void businessman(Context & context) { - context.data.byte(233) = 0; - context.data.word(19) = 2; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 2; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 2); if (!context.flags.z()) goto notfirstbiz; @@ -1028,23 +1028,23 @@ notfirstbiz: context._add(context.ax, 1); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; goto gotbusframe; notbeforedeadb: context._cmp(context.ax, 15); if (!context.flags.z()) goto buscombatwon; context._sub(context.ax, 1); - context._cmp(context.data.byte(64), 3); + context._cmp(context.data.byte(kLastweapon), 3); if (!context.flags.z()) goto notshieldonbus; - context.data.byte(64) = -1; - context.data.byte(63) = 0; + context.data.byte(kLastweapon) = -1; + context.data.byte(kCombatcount) = 0; context.ax = 51; goto gotbusframe; notshieldonbus: - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 20); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 20); if (!context.flags.z()) goto gotbusframe; - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.ax = 15; goto gotbusframe; buscombatwon: @@ -1060,10 +1060,10 @@ buscombatwon: turnpathon(context); context.al = 3; turnpathoff(context); - context.data.byte(474) = 5; - context.data.byte(476) = 5; + context.data.byte(kManspath) = 5; + context.data.byte(kFinaldest) = 5; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; context.es = context.pop(); context.bx = context.pop(); context.ax = 92; @@ -1072,19 +1072,19 @@ gotbusframe: context.es.word(context.bx+3) = context.ax; busspeed: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) goto buscombatend; - context.data.word(19) = 0; - context.data.byte(233) = 2; + context.data.word(kWatchingtime) = 0; + context.data.byte(kPointermode) = 2; return; buscombatend: return; buscombatwonend: - context.data.byte(233) = 0; - context.data.word(19) = 0; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 0; return; } @@ -1108,32 +1108,32 @@ notfirstpool: context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; context._sub(context.ax, 1); - context._cmp(context.data.byte(64), 2); + context._cmp(context.data.byte(kLastweapon), 2); if (!context.flags.z()) goto notaxeonpool; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 40); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.ax = 195; goto gotguardframe; notendguard1: context._cmp(context.ax, 147); if (!context.flags.z()) goto gotguardframe; context._sub(context.ax, 1); - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonpool; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context.ax = 147; goto gotguardframe; notgunonpool: - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 40); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotguardframe; - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.ax = 220; gotguardframe: context.es.word(context.bx+3) = context.ax; @@ -1144,16 +1144,16 @@ guardspeed: if (context.flags.z()) goto iswaitingpool; context._cmp(context.ax, 146); if (context.flags.z()) goto iswaitingpool; - context.data.byte(233) = 0; - context.data.word(19) = 2; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 2; return; iswaitingpool: - context.data.byte(233) = 2; - context.data.word(19) = 0; + context.data.byte(kPointermode) = 2; + context.data.word(kWatchingtime) = 0; return; combatover1: - context.data.word(19) = 0; - context.data.byte(233) = 0; + context.data.word(kWatchingtime) = 0; + context.data.byte(kPointermode) = 0; context.al = 0; turnpathon(context); context.al = 1; @@ -1161,13 +1161,13 @@ combatover1: return; combatover2: showgamereel(context); - context.data.word(19) = 2; - context.data.byte(233) = 0; - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 100); + context.data.word(kWatchingtime) = 2; + context.data.byte(kPointermode) = 0; + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 100); if (context.flags.c()) goto doneover2; - context.data.word(19) = 0; - context.data.byte(55) = 2; + context.data.word(kWatchingtime) = 0; + context.data.byte(kMandead) = 2; doneover2: return; } @@ -1179,20 +1179,20 @@ void security(Context & context) { if (!context.flags.z()) goto notaftersec; return; notaftersec: - context.data.word(19) = 10; + context.data.word(kWatchingtime) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; context._add(context.es.word(context.bx+3), 1); goto gotsecurframe; securwait: - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto gotsecurframe; - context.data.word(19) = 10; - context._cmp(context.data.byte(474), 9); + context.data.word(kWatchingtime) = 10; + context._cmp(context.data.byte(kManspath), 9); if (!context.flags.z()) goto gotsecurframe; - context._cmp(context.data.byte(132), 0); + context._cmp(context.data.byte(kFacing), 0); if (!context.flags.z()) goto gotsecurframe; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context._add(context.es.word(context.bx+3), 1); gotsecurframe: showgamereel(context); @@ -1206,13 +1206,13 @@ void heavy(Context & context) { context.es.byte(context.bx+7) = context.al; context._cmp(context.es.word(context.bx+3), 43); if (context.flags.z()) goto heavywait; - context.data.word(19) = 10; + context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; - context._add(context.data.byte(63), 1); - context._cmp(context.data.byte(63), 80); + context._add(context.data.byte(kCombatcount), 1); + context._cmp(context.data.byte(kCombatcount), 80); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; goto gotheavyframe; notafterhshot: checkspeed(context); @@ -1220,15 +1220,15 @@ notafterhshot: context._add(context.es.word(context.bx+3), 1); goto gotheavyframe; heavywait: - context._cmp(context.data.byte(64), 1); + context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(474), 5); + context._cmp(context.data.byte(kManspath), 5); if (!context.flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(132), 4); + context._cmp(context.data.byte(kFacing), 4); if (!context.flags.z()) goto gotheavyframe; - context.data.byte(64) = -1; + context.data.byte(kLastweapon) = -1; context._add(context.es.word(context.bx+3), 1); - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; gotheavyframe: showgamereel(context); addtopeoplelist(context); @@ -1247,11 +1247,11 @@ void bossman(Context & context) { context._cmp(context.ax, 41); if (!context.flags.z()) goto gotallboss; context.ax = 0; - context._add(context.data.byte(45), 1); + context._add(context.data.byte(kGunpassflag), 1); context.es.byte(context.bx+7) = 10; goto gotallboss; firstdes: - context._cmp(context.data.byte(45), 1); + context._cmp(context.data.byte(kGunpassflag), 1); if (context.flags.z()) goto gotallboss; context.push(context.ax); randomnumber(context); @@ -1262,7 +1262,7 @@ firstdes: context.ax = 0; goto gotallboss; secdes: - context._cmp(context.data.byte(45), 1); + context._cmp(context.data.byte(kGunpassflag), 1); if (context.flags.z()) goto gotallboss; context.ax = 0; gotallboss: @@ -1273,7 +1273,7 @@ notboss: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedboss; - context.data.byte(49) = 1; + context.data.byte(kTalkedtoboss) = 1; nottalkedboss: return; } @@ -1317,16 +1317,16 @@ cantdrip2: } void keeper(Context & context) { - context._cmp(context.data.byte(53), 0); + context._cmp(context.data.byte(kKeeperflag), 0); if (!context.flags.z()) goto notwaiting; - context._cmp(context.data.word(21), 190); + context._cmp(context.data.word(kReeltowatch), 190); if (context.flags.c()) goto waiting; - context._add(context.data.byte(53), 1); + context._add(context.data.byte(kKeeperflag), 1); context.ah = context.es.byte(context.bx+7); context._and(context.ah, 127); - context._cmp(context.ah, context.data.byte(65)); + context._cmp(context.ah, context.data.byte(kDreamnumber)); if (context.flags.z()) goto notdiff; - context.al = context.data.byte(65); + context.al = context.data.byte(kDreamnumber); context.es.byte(context.bx+7) = context.al; notdiff: return; @@ -1379,16 +1379,16 @@ gotintrom1: context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(138), 1); + context._add(context.data.byte(kIntrocount), 1); context.push(context.es); context.push(context.bx); intro1text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(138), 8); + context._cmp(context.data.byte(kIntrocount), 8); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(148), 10); - context.data.byte(185) = 1; + context._add(context.data.byte(kMapy), 10); + context.data.byte(kNowinnewroom) = 1; introm1fin: showgamereel(context); return; @@ -1446,7 +1446,7 @@ notbang: slowgates: context._cmp(context.ax, 120); if (!context.flags.z()) goto gotgates; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; context.ax = 119; gotgates: context.es.word(context.bx+3) = context.ax; @@ -1482,12 +1482,12 @@ void intromagic3(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; gotintrom3: context.es.word(context.bx+3) = context.ax; introm3fin: showgamereel(context); - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; return; } @@ -1499,15 +1499,15 @@ void intromonks1(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; - context._add(context.data.byte(148), 10); - context.data.byte(185) = 1; + context._add(context.data.byte(kMapy), 10); + context.data.byte(kNowinnewroom) = 1; showgamereel(context); return; notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; - context._sub(context.data.byte(148), 10); - context.data.byte(185) = 1; + context._sub(context.data.byte(kMapy), 10); + context.data.byte(kNowinnewroom) = 1; context.ax = 51; gotintromonk1: context.es.word(context.bx+3) = context.ax; @@ -1531,7 +1531,7 @@ waitstep: context.es.byte(context.bx+6) = -20; intromonk1fin: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; return; } @@ -1543,13 +1543,13 @@ void intromonks2(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; - context._add(context.data.byte(138), 1); + context._add(context.data.byte(kIntrocount), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(138), 19); + context._cmp(context.data.byte(kIntrocount), 19); if (!context.flags.z()) goto notlasttalk1; context.ax = 87; goto gotintromonk2; @@ -1559,13 +1559,13 @@ notlasttalk1: nottalk1: context._cmp(context.ax, 110); if (!context.flags.z()) goto notraisearm; - context._add(context.data.byte(138), 1); + context._add(context.data.byte(kIntrocount), 1); context.push(context.es); context.push(context.bx); monks2text(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(138), 35); + context._cmp(context.data.byte(kIntrocount), 35); if (!context.flags.z()) goto notlastraise; context.ax = 111; goto gotintromonk2; @@ -1575,7 +1575,7 @@ notlastraise: notraisearm: context._cmp(context.ax, 176); if (!context.flags.z()) goto notendmonk2; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; goto gotintromonk2; notendmonk2: context._cmp(context.ax, 125); @@ -1593,7 +1593,7 @@ void handclap(Context & context) { } void monks2text(Context & context) { - context._cmp(context.data.byte(138), 1); + context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; context.bl = 36; @@ -1601,7 +1601,7 @@ void monks2text(Context & context) { context.cx = 100; goto gotmonks2text; notmonk2text1: - context._cmp(context.data.byte(138), 4); + context._cmp(context.data.byte(kIntrocount), 4); if (!context.flags.z()) goto notmonk2text2; context.al = 9; context.bl = 36; @@ -1609,7 +1609,7 @@ notmonk2text1: context.cx = 100; goto gotmonks2text; notmonk2text2: - context._cmp(context.data.byte(138), 7); + context._cmp(context.data.byte(kIntrocount), 7); if (!context.flags.z()) goto notmonk2text3; context.al = 10; context.bl = 36; @@ -1617,7 +1617,7 @@ notmonk2text2: context.cx = 100; goto gotmonks2text; notmonk2text3: - context._cmp(context.data.byte(138), 10); + context._cmp(context.data.byte(kIntrocount), 10); if (!context.flags.z()) goto notmonk2text4; context.al = 11; context.bl = 0; @@ -1625,7 +1625,7 @@ notmonk2text3: context.cx = 100; goto gotmonks2text; notmonk2text4: - context._cmp(context.data.byte(138), 13); + context._cmp(context.data.byte(kIntrocount), 13); if (!context.flags.z()) goto notmonk2text5; context.al = 12; context.bl = 0; @@ -1633,7 +1633,7 @@ notmonk2text4: context.cx = 100; goto gotmonks2text; notmonk2text5: - context._cmp(context.data.byte(138), 16); + context._cmp(context.data.byte(kIntrocount), 16); if (!context.flags.z()) goto notmonk2text6; context.al = 13; context.bl = 0; @@ -1641,7 +1641,7 @@ notmonk2text5: context.cx = 100; goto gotmonks2text; notmonk2text6: - context._cmp(context.data.byte(138), 19); + context._cmp(context.data.byte(kIntrocount), 19); if (!context.flags.z()) goto notmonk2text7; context.al = 14; context.bl = 36; @@ -1651,7 +1651,7 @@ notmonk2text6: context.ah = 82; { setuptimedtemp(context); return; }; notmonk2text7: - context._cmp(context.data.byte(138), 22); + context._cmp(context.data.byte(kIntrocount), 22); if (!context.flags.z()) goto notmonk2text8; context.al = 15; context.bl = 36; @@ -1659,7 +1659,7 @@ notmonk2text7: context.cx = 100; goto gotmonks2text; notmonk2text8: - context._cmp(context.data.byte(138), 25); + context._cmp(context.data.byte(kIntrocount), 25); if (!context.flags.z()) goto notmonk2text9; context.al = 16; context.bl = 36; @@ -1667,7 +1667,7 @@ notmonk2text8: context.cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.data.byte(138), 28); + context._cmp(context.data.byte(kIntrocount), 28); if (!context.flags.z()) goto notmonk2text10; context.al = 17; context.bl = 36; @@ -1675,7 +1675,7 @@ notmonk2text9: context.cx = 100; goto gotmonks2text; notmonk2text10: - context._cmp(context.data.byte(138), 31); + context._cmp(context.data.byte(kIntrocount), 31); if (!context.flags.z()) goto notmonk2text11; context.al = 18; context.bl = 36; @@ -1693,7 +1693,7 @@ gotmonks2text: } void intro1text(Context & context) { - context._cmp(context.data.byte(138), 2); + context._cmp(context.data.byte(kIntrocount), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; context.bl = 34; @@ -1701,7 +1701,7 @@ void intro1text(Context & context) { context.cx = 90; goto gotintro1text; notintro1text1: - context._cmp(context.data.byte(138), 4); + context._cmp(context.data.byte(kIntrocount), 4); if (!context.flags.z()) goto notintro1text2; context.al = 41; context.bl = 34; @@ -1709,7 +1709,7 @@ notintro1text1: context.cx = 90; goto gotintro1text; notintro1text2: - context._cmp(context.data.byte(138), 6); + context._cmp(context.data.byte(kIntrocount), 6); if (!context.flags.z()) goto notintro1text3; context.al = 42; context.bl = 34; @@ -1783,16 +1783,16 @@ void monkandryan(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; - context._add(context.data.byte(138), 1); + context._add(context.data.byte(kIntrocount), 1); context.push(context.es); context.push(context.bx); textformonk(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 77; - context._cmp(context.data.byte(138), 57); + context._cmp(context.data.byte(kIntrocount), 57); if (!context.flags.z()) goto gotmonkryan; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; gotmonkryan: context.es.word(context.bx+3) = context.ax; @@ -1808,9 +1808,9 @@ void endgameseq(Context & context) { context._add(context.ax, 1); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; - context._cmp(context.data.byte(138), 140); + context._cmp(context.data.byte(kIntrocount), 140); if (context.flags.z()) goto gotendseq; - context._add(context.data.byte(138), 1); + context._add(context.data.byte(kIntrocount), 1); context.push(context.es); context.push(context.bx); textforend(context); @@ -1836,18 +1836,18 @@ notfadedown: context.push(context.bx); context.push(context.ax); fadescreendowns(context); - context.data.byte(386) = 7; - context.data.byte(387) = 1; + context.data.byte(kVolumeto) = 7; + context.data.byte(kVolumedirection) = 1; context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); notfadeend: context._cmp(context.ax, 340); if (!context.flags.z()) goto notendseq; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; notendseq: showgamereel(context); - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 145); @@ -1862,17 +1862,17 @@ void rollendcredits(Context & context) { context.al = 16; context.ah = 255; playchannel0(context); - context.data.byte(385) = 7; - context.data.byte(386) = 0; - context.data.byte(387) = -1; + context.data.byte(kVolume) = 7; + context.data.byte(kVolumeto) = 0; + context.data.byte(kVolumedirection) = -1; context.cl = 160; context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiget(context); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.si = 3*2; context.ax = context.es.word(context.si); context.si = context.ax; @@ -1881,7 +1881,7 @@ void rollendcredits(Context & context) { endcredits1: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(75); + context.cx = context.data.word(kLinespacing); endcredits2: context.push(context.cx); context.push(context.si); @@ -1893,7 +1893,7 @@ endcredits2: context.ch = 160; context.di = 75; context.bx = 20; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiput(context); vsync(context); @@ -1912,7 +1912,7 @@ onelot: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(75)); + context._add(context.bx, context.data.word(kLinespacing)); context.cx = context.pop(); if (--context.cx) goto onelot; vsync(context); @@ -1949,8 +1949,8 @@ gotnext: void priest(Context & context) { context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; - context.data.byte(233) = 0; - context.data.word(19) = 2; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; context._add(context.es.word(context.bx+3), 1); @@ -1978,7 +1978,7 @@ notendtelly: } void madman(Context & context) { - context.data.word(19) = 2; + context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; context.ax = context.es.word(context.bx+3); @@ -1994,30 +1994,30 @@ void madman(Context & context) { context.ax = context.pop(); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(63) = -1; - context.data.byte(68) = 0; + context.data.byte(kCombatcount) = -1; + context.data.byte(kSpeechcount) = 0; notfirstmad: context._add(context.ax, 1); context._cmp(context.ax, 294); if (context.flags.z()) goto madmanspoken; context._cmp(context.ax, 66); if (!context.flags.z()) goto nomadspeak; - context._add(context.data.byte(63), 1); + context._add(context.data.byte(kCombatcount), 1); context.push(context.es); context.push(context.bx); madmantext(context); context.bx = context.pop(); context.es = context.pop(); context.ax = 53; - context._cmp(context.data.byte(63), 62); + context._cmp(context.data.byte(kCombatcount), 62); if (context.flags.c()) goto nomadspeak; - context._cmp(context.data.byte(63), 68); + context._cmp(context.data.byte(kCombatcount), 68); if (context.flags.z()) goto killryan; - context._cmp(context.data.byte(64), 8); + context._cmp(context.data.byte(kLastweapon), 8); if (!context.flags.z()) goto nomadspeak; - context.data.byte(63) = 70; - context.data.byte(64) = -1; - context.data.byte(52) = 1; + context.data.byte(kCombatcount) = 70; + context.data.byte(kLastweapon) = -1; + context.data.byte(kMadmanflag) = 1; context.ax = 67; goto nomadspeak; killryan: @@ -2026,14 +2026,14 @@ nomadspeak: context.es.word(context.bx+3) = context.ax; nomadspeed: showgamereel(context); - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; madmode(context); return; madmanspoken: - context._cmp(context.data.byte(390), 1); + context._cmp(context.data.byte(kWongame), 1); if (context.flags.z()) goto alreadywon; - context.data.byte(390) = 1; + context.data.byte(kWongame) = 1; context.push(context.es); context.push(context.bx); getridoftemptext(context); @@ -2042,18 +2042,18 @@ madmanspoken: alreadywon: return; ryansded: - context.data.byte(55) = 2; + context.data.byte(kMandead) = 2; showgamereel(context); return; } void madmantext(Context & context) { - context._cmp(context.data.byte(63), 61); + context._cmp(context.data.byte(kCombatcount), 61); if (!context.flags.c()) goto nomadtext; - context.al = context.data.byte(63); + context.al = context.data.byte(kCombatcount); context._and(context.al, 3); if (!context.flags.z()) goto nomadtext; - context.al = context.data.byte(63); + context.al = context.data.byte(kCombatcount); context._shr(context.al, 1); context._shr(context.al, 1); context._add(context.al, 47); @@ -2068,13 +2068,13 @@ nomadtext: } void madmode(Context & context) { - context.data.word(19) = 2; - context.data.byte(233) = 0; - context._cmp(context.data.byte(63), 63); + context.data.word(kWatchingtime) = 2; + context.data.byte(kPointermode) = 0; + context._cmp(context.data.byte(kCombatcount), 63); if (context.flags.c()) goto iswatchmad; - context._cmp(context.data.byte(63), 68); + context._cmp(context.data.byte(kCombatcount), 68); if (!context.flags.c()) goto iswatchmad; - context.data.byte(233) = 2; + context.data.byte(kPointermode) = 2; iswatchmad: return; } @@ -2100,7 +2100,7 @@ nopriesttext: } void textforend(Context & context) { - context._cmp(context.data.byte(138), 20); + context._cmp(context.data.byte(kIntrocount), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; context.bl = 34; @@ -2108,7 +2108,7 @@ void textforend(Context & context) { context.cx = 60; goto gotendtext; notendtext1: - context._cmp(context.data.byte(138), 65); + context._cmp(context.data.byte(kIntrocount), 65); if (!context.flags.z()) goto notendtext2; context.al = 1; context.bl = 34; @@ -2116,7 +2116,7 @@ notendtext1: context.cx = 60; goto gotendtext; notendtext2: - context._cmp(context.data.byte(138), 110); + context._cmp(context.data.byte(kIntrocount), 110); if (!context.flags.z()) goto notendtext3; context.al = 2; context.bl = 34; @@ -2133,7 +2133,7 @@ gotendtext: } void textformonk(Context & context) { - context._cmp(context.data.byte(138), 1); + context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; context.bl = 68; @@ -2141,7 +2141,7 @@ void textformonk(Context & context) { context.cx = 120; goto gotmonktext; notmonktext1: - context._cmp(context.data.byte(138), 5); + context._cmp(context.data.byte(kIntrocount), 5); if (!context.flags.z()) goto notmonktext2; context.al = 20; context.bl = 68; @@ -2149,7 +2149,7 @@ notmonktext1: context.cx = 120; goto gotmonktext; notmonktext2: - context._cmp(context.data.byte(138), 9); + context._cmp(context.data.byte(kIntrocount), 9); if (!context.flags.z()) goto notmonktext3; context.al = 21; context.bl = 48; @@ -2157,7 +2157,7 @@ notmonktext2: context.cx = 120; goto gotmonktext; notmonktext3: - context._cmp(context.data.byte(138), 13); + context._cmp(context.data.byte(kIntrocount), 13); if (!context.flags.z()) goto notmonktext4; context.al = 22; context.bl = 68; @@ -2165,7 +2165,7 @@ notmonktext3: context.cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.data.byte(138), 17); + context._cmp(context.data.byte(kIntrocount), 17); if (!context.flags.z()) goto notmonktext5; context.al = 23; context.bl = 68; @@ -2173,7 +2173,7 @@ notmonktext4: context.cx = 120; goto gotmonktext; notmonktext5: - context._cmp(context.data.byte(138), 21); + context._cmp(context.data.byte(kIntrocount), 21); if (!context.flags.z()) goto notmonktext6; context.al = 24; context.bl = 68; @@ -2181,7 +2181,7 @@ notmonktext5: context.cx = 120; goto gotmonktext; notmonktext6: - context._cmp(context.data.byte(138), 25); + context._cmp(context.data.byte(kIntrocount), 25); if (!context.flags.z()) goto notmonktext7; context.al = 25; context.bl = 68; @@ -2189,7 +2189,7 @@ notmonktext6: context.cx = 120; goto gotmonktext; notmonktext7: - context._cmp(context.data.byte(138), 29); + context._cmp(context.data.byte(kIntrocount), 29); if (!context.flags.z()) goto notmonktext8; context.al = 26; context.bl = 68; @@ -2197,7 +2197,7 @@ notmonktext7: context.cx = 120; goto gotmonktext; notmonktext8: - context._cmp(context.data.byte(138), 33); + context._cmp(context.data.byte(kIntrocount), 33); if (!context.flags.z()) goto notmonktext9; context.al = 27; context.bl = 68; @@ -2205,7 +2205,7 @@ notmonktext8: context.cx = 120; goto gotmonktext; notmonktext9: - context._cmp(context.data.byte(138), 37); + context._cmp(context.data.byte(kIntrocount), 37); if (!context.flags.z()) goto notmonktext10; context.al = 28; context.bl = 68; @@ -2213,7 +2213,7 @@ notmonktext9: context.cx = 120; goto gotmonktext; notmonktext10: - context._cmp(context.data.byte(138), 41); + context._cmp(context.data.byte(kIntrocount), 41); if (!context.flags.z()) goto notmonktext11; context.al = 29; context.bl = 68; @@ -2221,7 +2221,7 @@ notmonktext10: context.cx = 120; goto gotmonktext; notmonktext11: - context._cmp(context.data.byte(138), 45); + context._cmp(context.data.byte(kIntrocount), 45); if (!context.flags.z()) goto notmonktext12; context.al = 30; context.bl = 68; @@ -2229,7 +2229,7 @@ notmonktext11: context.cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.data.byte(138), 49); + context._cmp(context.data.byte(kIntrocount), 49); if (!context.flags.z()) goto notmonktext13; context.al = 31; context.bl = 68; @@ -2237,7 +2237,7 @@ notmonktext12: context.cx = 220; goto gotmonktext; notmonktext13: - context._cmp(context.data.byte(138), 53); + context._cmp(context.data.byte(kIntrocount), 53); if (!context.flags.z()) goto notendtitles; fadescreendowns(context); notendtitles: @@ -2251,7 +2251,7 @@ oktalk: } void drunk(Context & context) { - context._cmp(context.data.byte(41), 0); + context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto trampgone; context.al = context.es.byte(context.bx+7); context._and(context.al, 127); @@ -2321,7 +2321,7 @@ nocopper: } void sparky(Context & context) { - context._cmp(context.data.word(14), 0); + context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto animsparky; context.es.byte(context.bx+7) = 3; goto animsparky; @@ -2348,7 +2348,7 @@ finishsparky: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) goto nottalkedsparky; - context.data.byte(48) = 1; + context.data.byte(kTalkedtosparky) = 1; nottalkedsparky: return; } @@ -2364,9 +2364,9 @@ notrainyet: randomnumber(context); context._cmp(context.al, 253); if (context.flags.c()) goto notrainatall; - context._cmp(context.data.byte(474), 5); + context._cmp(context.data.byte(kManspath), 5); if (!context.flags.z()) goto notrainatall; - context._cmp(context.data.byte(476), 5); + context._cmp(context.data.byte(kFinaldest), 5); if (!context.flags.z()) goto notrainatall; context.ax = 5; gottrainframe: @@ -2382,15 +2382,15 @@ void addtopeoplelist(Context & context) { context.push(context.bx); context.cl = context.es.byte(context.bx+7); context.ax = context.es.word(context.bx+3); - context.bx = context.data.word(16); - context.es = context.data.word(410); + context.bx = context.data.word(kListpos); + context.es = context.data.word(kBuffers); context.es.word(context.bx) = context.ax; context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context.es.byte(context.bx+4) = context.cl; context.bx = context.pop(); context.es = context.pop(); - context._add(context.data.word(16), 5); + context._add(context.data.word(kListpos), 5); return; } @@ -2398,20 +2398,20 @@ void showgamereel(Context & context) { context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; - context.data.word(237) = context.ax; + context.data.word(kReelpointer) = context.ax; context.push(context.es); context.push(context.bx); plotreel(context); context.bx = context.pop(); context.es = context.pop(); - context.ax = context.data.word(237); + context.ax = context.data.word(kReelpointer); context.es.word(context.bx+3) = context.ax; noshow: return; } void checkspeed(Context & context) { - context._cmp(context.data.byte(64), -1); + context._cmp(context.data.byte(kLastweapon), -1); if (!context.flags.z()) goto forcenext; context._add(context.es.byte(context.bx+6), 1); context.al = context.es.byte(context.bx+6); @@ -2428,7 +2428,7 @@ forcenext: } void clearsprites(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.al = 255; context.cx = 32*16; @@ -2437,7 +2437,7 @@ void clearsprites(Context & context) { } void makesprite(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; _tmp17: context._cmp(context.es.byte(context.bx+15), 255); @@ -2464,11 +2464,11 @@ void delsprite(Context & context) { } void spriteupdate(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; - context.al = context.data.byte(62); + context.al = context.data.byte(kRyanon); context.es.byte(context.bx+31) = context.al; - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; _tmp18: @@ -2487,7 +2487,7 @@ _tmp18: _tmp18a: context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(185), 1); + context._cmp(context.data.byte(kNowinnewroom), 1); if (context.flags.z()) goto _tmp18b; context._add(context.bx, 32); if (--context.cx) goto _tmp18; @@ -2496,11 +2496,11 @@ _tmp18b: } void printsprites(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.cx = 0; priorityloop: context.push(context.cx); - context.data.byte(181) = context.cl; + context.data.byte(kPriority) = context.cl; context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; prtspriteloop: @@ -2509,7 +2509,7 @@ prtspriteloop: context.ax = context.es.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto skipsprite; - context.al = context.data.byte(181); + context.al = context.data.byte(kPriority); context._cmp(context.al, context.es.byte(context.bx+23)); if (!context.flags.z()) goto skipsprite; context._cmp(context.es.byte(context.bx+31), 1); @@ -2539,7 +2539,7 @@ void printasprite(Context & context) { context.ah = 255; notnegative1: context.bx = context.ax; - context._add(context.bx, context.data.word(117)); + context._add(context.bx, context.data.word(kMapady)); context.al = context.es.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); @@ -2547,14 +2547,14 @@ notnegative1: context.ah = 255; notnegative2: context.di = context.ax; - context._add(context.di, context.data.word(115)); + context._add(context.di, context.data.word(kMapadx)); context.al = context.es.byte(context.si+15); context.ah = 0; context._cmp(context.es.byte(context.si+30), 0); if (context.flags.z()) goto steadyframe; context.ah = 8; steadyframe: - context._cmp(context.data.byte(181), 6); + context._cmp(context.data.byte(kPriority), 6); if (!context.flags.z()) goto notquickp; notquickp: showframe(context); @@ -2589,7 +2589,7 @@ void checkone(Context & context) { context.cx = 3; context._mul(context.cx); context.si = context.ax; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context._add(context.si, 0+(228*13)+32+60+(32*32)); context._lodsw(); context.cx = context.ax; @@ -2599,30 +2599,30 @@ void checkone(Context & context) { } void findsource(Context & context) { - context.ax = context.data.word(158); + context.ax = context.data.word(kCurrentframe); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; - context.ds = context.data.word(428); - context.data.word(242) = 0; + context.ds = context.data.word(kReel1); + context.data.word(kTakeoff) = 0; return; over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; - context.ds = context.data.word(430); - context.data.word(242) = 160; + context.ds = context.data.word(kReel2); + context.data.word(kTakeoff) = 160; return; over1001: - context.ds = context.data.word(432); - context.data.word(242) = 320; + context.ds = context.data.word(kReel3); + context.data.word(kTakeoff) = 320; return; } void initman(Context & context) { - context.al = context.data.byte(150); - context.ah = context.data.byte(151); + context.al = context.data.byte(kRyanx); + context.ah = context.data.byte(kRyany); context.si = context.ax; context.cx = 49464; - context.dx = context.data.word(412); + context.dx = context.data.word(kMainsprites); context.di = 0; makesprite(context); context.es.byte(context.bx+23) = 4; @@ -2632,11 +2632,11 @@ void initman(Context & context) { } void mainman(Context & context) { - context._cmp(context.data.byte(186), 1); + context._cmp(context.data.byte(kResetmanxy), 1); if (!context.flags.z()) goto notinnewroom; - context.data.byte(186) = 0; - context.al = context.data.byte(150); - context.ah = context.data.byte(151); + context.data.byte(kResetmanxy) = 0; + context.al = context.data.byte(kRyanx); + context.ah = context.data.byte(kRyany); context.es.word(context.bx+10) = context.ax; context.es.byte(context.bx+29) = 0; goto executewalk; @@ -2647,24 +2647,24 @@ notinnewroom: return; executewalk: context.es.byte(context.bx+22) = 0; - context.al = context.data.byte(134); - context._cmp(context.al, context.data.byte(132)); + context.al = context.data.byte(kTurntoface); + context._cmp(context.al, context.data.byte(kFacing)); if (context.flags.z()) goto facingok; aboutturn(context); goto notwalk; facingok: - context._cmp(context.data.byte(135), 0); + context._cmp(context.data.byte(kTurndirection), 0); if (context.flags.z()) goto alreadyturned; - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto alreadyturned; - context.data.byte(472) = 1; - context.al = context.data.byte(132); - context._cmp(context.al, context.data.byte(133)); + context.data.byte(kReasseschanges) = 1; + context.al = context.data.byte(kFacing); + context._cmp(context.al, context.data.byte(kLeavedirection)); if (!context.flags.z()) goto alreadyturned; checkforexit(context); alreadyturned: - context.data.byte(135) = 0; - context._cmp(context.data.byte(491), 254); + context.data.byte(kTurndirection) = 0; + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto walkman; context.es.byte(context.bx+29) = 0; goto notwalk; @@ -2677,9 +2677,9 @@ walkman: notanimend1: context.es.byte(context.bx+29) = context.al; walking(context); - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (context.flags.z()) goto afterwalk; - context.al = context.data.byte(132); + context.al = context.data.byte(kFacing); context._and(context.al, 1); if (context.flags.z()) goto isdouble; context.al = context.es.byte(context.bx+29); @@ -2690,18 +2690,18 @@ notanimend1: isdouble: walking(context); afterwalk: - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto notwalk; - context.al = context.data.byte(134); - context._cmp(context.al, context.data.byte(132)); + context.al = context.data.byte(kTurntoface); + context._cmp(context.al, context.data.byte(kFacing)); if (!context.flags.z()) goto notwalk; - context.data.byte(472) = 1; - context.al = context.data.byte(132); - context._cmp(context.al, context.data.byte(133)); + context.data.byte(kReasseschanges) = 1; + context.al = context.data.byte(kFacing); + context._cmp(context.al, context.data.byte(kLeavedirection)); if (!context.flags.z()) goto notwalk; checkforexit(context); notwalk: - context.al = context.data.byte(132); + context.al = context.data.byte(kFacing); context.ah = 0; context.di = 1105; context._add(context.di, context.ax); @@ -2709,18 +2709,18 @@ notwalk: context._add(context.al, context.es.byte(context.bx+29)); context.es.byte(context.bx+15) = context.al; context.ax = context.es.word(context.bx+10); - context.data.byte(150) = context.al; - context.data.byte(151) = context.ah; + context.data.byte(kRyanx) = context.al; + context.data.byte(kRyany) = context.ah; return; } void aboutturn(Context & context) { - context._cmp(context.data.byte(135), 1); + context._cmp(context.data.byte(kTurndirection), 1); if (context.flags.z()) goto incdir; - context._cmp(context.data.byte(135), -1); + context._cmp(context.data.byte(kTurndirection), -1); if (context.flags.z()) goto decdir; - context.al = context.data.byte(132); - context._sub(context.al, context.data.byte(134)); + context.al = context.data.byte(kFacing); + context._sub(context.al, context.data.byte(kTurntoface)); if (!context.flags.c()) goto higher; context._neg(context.al); context._cmp(context.al, 4); @@ -2731,37 +2731,37 @@ higher: if (!context.flags.c()) goto incdir; goto decdir; incdir: - context.data.byte(135) = 1; - context.al = context.data.byte(132); + context.data.byte(kTurndirection) = 1; + context.al = context.data.byte(kFacing); context._add(context.al, 1); context._and(context.al, 7); - context.data.byte(132) = context.al; + context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; return; decdir: - context.data.byte(135) = -1; - context.al = context.data.byte(132); + context.data.byte(kTurndirection) = -1; + context.al = context.data.byte(kFacing); context._sub(context.al, 1); context._and(context.al, 7); - context.data.byte(132) = context.al; + context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; return; } void walking(Context & context) { - context._cmp(context.data.byte(492), 0); + context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalwalk; - context.al = context.data.byte(491); + context.al = context.data.byte(kLinepointer); context._sub(context.al, 1); - context.data.byte(491) = context.al; + context.data.byte(kLinepointer) = context.al; context._cmp(context.al, 200); if (!context.flags.c()) goto endofline; goto continuewalk; normalwalk: - context.al = context.data.byte(491); + context.al = context.data.byte(kLinepointer); context._add(context.al, 1); - context.data.byte(491) = context.al; - context._cmp(context.al, context.data.byte(493)); + context.data.byte(kLinepointer) = context.al; + context._cmp(context.al, context.data.byte(kLinelength)); if (!context.flags.c()) goto endofline; continuewalk: context.ah = 0; @@ -2779,13 +2779,13 @@ stillline: context.es.word(context.bx+10) = context.ax; return; endofline: - context.data.byte(491) = 254; - context.al = context.data.byte(477); - context.data.byte(474) = context.al; - context._cmp(context.al, context.data.byte(476)); + context.data.byte(kLinepointer) = 254; + context.al = context.data.byte(kDestination); + context.data.byte(kManspath) = context.al; + context._cmp(context.al, context.data.byte(kFinaldest)); if (context.flags.z()) goto finishedwalk; - context.al = context.data.byte(476); - context.data.byte(477) = context.al; + context.al = context.data.byte(kFinaldest); + context.data.byte(kDestination) = context.al; context.push(context.es); context.push(context.bx); autosetwalk(context); @@ -2801,42 +2801,42 @@ void facerightway(Context & context) { context.push(context.es); context.push(context.bx); getroomspaths(context); - context.al = context.data.byte(474); + context.al = context.data.byte(kManspath); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.ax, context.ax); context._add(context.bx, context.ax); context.al = context.es.byte(context.bx+7); - context.data.byte(134) = context.al; - context.data.byte(133) = context.al; + context.data.byte(kTurntoface) = context.al; + context.data.byte(kLeavedirection) = context.al; context.bx = context.pop(); context.es = context.pop(); return; } void checkforexit(Context & context) { - context.cl = context.data.byte(150); + context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); - context.ch = context.data.byte(151); + context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); - context.data.byte(152) = context.cl; - context.data.byte(153) = context.ch; - context.data.byte(154) = context.dl; - context.data.byte(155) = context.dh; - context.al = context.data.byte(152); + context.data.byte(kLastflag) = context.cl; + context.data.byte(kLastflagex) = context.ch; + context.data.byte(kFlagx) = context.dl; + context.data.byte(kFlagy) = context.dh; + context.al = context.data.byte(kLastflag); context._test(context.al, 64); if (context.flags.z()) goto notnewdirect; - context.al = context.data.byte(153); - context.data.byte(188) = context.al; + context.al = context.data.byte(kLastflagex); + context.data.byte(kAutolocation) = context.al; return; notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; context.push(context.es); context.push(context.bx); - context._cmp(context.data.byte(183), 2); + context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notlouis; context.bl = 0; context.push(context.bx); @@ -2871,17 +2871,17 @@ notravmessage: context.bl = 68; context.bh = 64; setuptimeduse(context); - context.al = context.data.byte(132); + context.al = context.data.byte(kFacing); context._add(context.al, 4); context._and(context.al, 7); - context.data.byte(134) = context.al; + context.data.byte(kTurntoface) = context.al; context.bx = context.pop(); context.es = context.pop(); return; notlouis: context.bx = context.pop(); context.es = context.pop(); - context.data.byte(59) = 1; + context.data.byte(kNeedtotravel) = 1; return; notleave: context._test(context.al, 4); @@ -2910,12 +2910,12 @@ notanup: void adjustdown(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(148), 10); - context.al = context.data.byte(153); + context._add(context.data.byte(kMapy), 10); + context.al = context.data.byte(kLastflagex); context.cl = 16; context._mul(context.cl); context.es.byte(context.bx+11) = context.al; - context.data.byte(185) = 1; + context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2924,12 +2924,12 @@ void adjustdown(Context & context) { void adjustup(Context & context) { context.push(context.es); context.push(context.bx); - context._sub(context.data.byte(148), 10); - context.al = context.data.byte(153); + context._sub(context.data.byte(kMapy), 10); + context.al = context.data.byte(kLastflagex); context.cl = 16; context._mul(context.cl); context.es.byte(context.bx+11) = context.al; - context.data.byte(185) = 1; + context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2938,13 +2938,13 @@ void adjustup(Context & context) { void adjustleft(Context & context) { context.push(context.es); context.push(context.bx); - context.data.byte(152) = 0; - context._sub(context.data.byte(147), 11); - context.al = context.data.byte(153); + context.data.byte(kLastflag) = 0; + context._sub(context.data.byte(kMapx), 11); + context.al = context.data.byte(kLastflagex); context.cl = 16; context._mul(context.cl); context.es.byte(context.bx+10) = context.al; - context.data.byte(185) = 1; + context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); return; @@ -2953,24 +2953,24 @@ void adjustleft(Context & context) { void adjustright(Context & context) { context.push(context.es); context.push(context.bx); - context._add(context.data.byte(147), 11); - context.al = context.data.byte(153); + context._add(context.data.byte(kMapx), 11); + context.al = context.data.byte(kLastflagex); context.cl = 16; context._mul(context.cl); context._sub(context.al, 2); context.es.byte(context.bx+10) = context.al; - context.data.byte(185) = 1; + context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); return; } void reminders(Context & context) { - context._cmp(context.data.byte(183), 24); + context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(147), 44); + context._cmp(context.data.byte(kMapx), 44); if (!context.flags.z()) goto notinedenslift; - context._cmp(context.data.byte(1), 0); + context._cmp(context.data.byte(kProgresspoints), 0); if (!context.flags.z()) goto notfirst; context.al = 'D'; context.ah = 'K'; @@ -2998,7 +2998,7 @@ void reminders(Context & context) { compare(context); if (!context.flags.z()) goto forgotone; havegotcard: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); notfirst: return; forgotone: @@ -3014,23 +3014,23 @@ notinedenslift: } void initrain(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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); context.bx = 1113; checkmorerain: context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto finishinitrain; - context._cmp(context.al, context.data.byte(183)); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto checkrain; context.al = context.cs.byte(context.bx+1); - context._cmp(context.al, context.data.byte(147)); + context._cmp(context.al, context.data.byte(kMapx)); if (!context.flags.z()) goto checkrain; context.al = context.cs.byte(context.bx+2); - context._cmp(context.al, context.data.byte(148)); + context._cmp(context.al, context.data.byte(kMapy)); if (!context.flags.z()) goto checkrain; context.al = context.cs.byte(context.bx+3); - context.data.byte(131) = context.al; + context.data.byte(kRainspace) = context.al; goto dorain; checkrain: context._add(context.bx, 4); @@ -3041,26 +3041,26 @@ initraintop: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(131)); + context._cmp(context.al, context.data.byte(kRainspace)); if (!context.flags.c()) goto initraintop; context._add(context.cl, context.al); - context._cmp(context.cl, context.data.byte(127)); + context._cmp(context.cl, context.data.byte(kMapxsize)); if (!context.flags.c()) goto initrainside; context.push(context.cx); splitintolines(context); context.cx = context.pop(); goto initraintop; initrainside: - context.cl = context.data.byte(127); + context.cl = context.data.byte(kMapxsize); context._sub(context.cl, 1); initrainside2: randomnumber(context); context._and(context.al, 31); context._add(context.al, 3); - context._cmp(context.al, context.data.byte(131)); + context._cmp(context.al, context.data.byte(kRainspace)); if (!context.flags.c()) goto initrainside2; context._add(context.ch, context.al); - context._cmp(context.ch, context.data.byte(128)); + context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) goto finishinitrain; context.push(context.cx); splitintolines(context); @@ -3081,7 +3081,7 @@ lookforlinestart: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(128)); + context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; foundlinestart: @@ -3095,7 +3095,7 @@ lookforlineend: context._add(context.ch, 1); context._cmp(context.cl, 0); if (context.flags.z()) goto foundlineend; - context._cmp(context.ch, context.data.byte(128)); + context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) goto foundlineend; context._add(context.bh, 1); goto lookforlineend; @@ -3114,7 +3114,7 @@ foundlineend: context.cx = context.pop(); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; - context._cmp(context.ch, context.data.byte(128)); + context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: @@ -3125,9 +3125,9 @@ void getblockofpixel(Context & context) { context.push(context.cx); context.push(context.es); context.push(context.di); - context.ax = context.data.word(123); + context.ax = context.data.word(kMapxstart); context._add(context.cl, context.al); - context.ax = context.data.word(125); + context.ax = context.data.word(kMapystart); context._add(context.ch, context.al); checkone(context); context._and(context.cl, 1); @@ -3145,30 +3145,30 @@ failrain: } void showrain(Context & context) { - context.ds = context.data.word(412); + context.ds = context.data.word(kMainsprites); context.si = 6*58; context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); context.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); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto nothunder; morerain: - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto finishrain; context.al = context.es.byte(context.bx+1); context.ah = 0; - context._add(context.ax, context.data.word(117)); - context._add(context.ax, context.data.word(125)); + context._add(context.ax, context.data.word(kMapady)); + context._add(context.ax, context.data.word(kMapystart)); context.cx = 320; context._mul(context.cx); context.cl = context.es.byte(context.bx); context.ch = 0; context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(115)); - context._add(context.ax, context.data.word(123)); + context._add(context.ax, context.data.word(kMapadx)); + context._add(context.ax, context.data.word(kMapxstart)); context.di = context.ax; context.cl = context.es.byte(context.bx+2); context.ch = 0; @@ -3181,7 +3181,7 @@ morerain: context._add(context.bx, 6); context.push(context.si); context._add(context.si, context.ax); - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.ah = 0; context.dx = 320-2; rainloop: @@ -3199,20 +3199,20 @@ noplot: context.si = context.pop(); goto morerain; finishrain: - context._cmp(context.data.word(519), 0); + context._cmp(context.data.word(kCh1blockstocopy), 0); if (!context.flags.z()) goto nothunder; - context._cmp(context.data.byte(183), 2); + context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notlouisthund; - context._cmp(context.data.byte(44), 1); + context._cmp(context.data.byte(kBeenmugged), 1); if (!context.flags.z()) goto nothunder; notlouisthund: - context._cmp(context.data.byte(183), 55); + context._cmp(context.data.byte(kReallocation), 55); if (context.flags.z()) goto nothunder; randomnum1(context); context._cmp(context.al, 1); if (!context.flags.c()) goto nothunder; context.al = 7; - context._cmp(context.data.byte(506), 6); + context._cmp(context.data.byte(kCh0playing), 6); if (context.flags.z()) goto isthunder1; context.al = 4; isthunder1: @@ -3222,7 +3222,7 @@ nothunder: } void backobject(Context & context) { - context.ds = context.data.word(426); + context.ds = context.data.word(kSetdat); context.di = context.es.word(context.bx+20); context.al = context.es.byte(context.bx+18); context._cmp(context.al, 0); @@ -3270,7 +3270,7 @@ finishback: } void liftsprite(Context & context) { - context.al = context.data.byte(34); + context.al = context.data.byte(kLiftflag); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; context._cmp(context.al, 1); @@ -3289,7 +3289,7 @@ void liftsprite(Context & context) { context.ax = context.pop(); goto pokelift; finishclose: - context.data.byte(34) = 0; + context.data.byte(kLiftflag) = 0; return; openlift: context.al = context.es.byte(context.bx+19); @@ -3313,46 +3313,46 @@ pokelift: context.ds.byte(context.di+17) = context.al; return; endoflist: - context.data.byte(34) = 1; + context.data.byte(kLiftflag) = 1; return; liftopen: - context.al = context.data.byte(35); + context.al = context.data.byte(kLiftpath); context.push(context.es); context.push(context.bx); turnpathon(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(39), 0); + context._cmp(context.data.byte(kCounttoclose), 0); if (context.flags.z()) goto nocountclose; - context._sub(context.data.byte(39), 1); - context._cmp(context.data.byte(39), 0); + context._sub(context.data.byte(kCounttoclose), 1); + context._cmp(context.data.byte(kCounttoclose), 0); if (!context.flags.z()) goto nocountclose; - context.data.byte(34) = 2; + context.data.byte(kLiftflag) = 2; nocountclose: context.al = 12; goto pokelift; liftclosed: - context.al = context.data.byte(35); + context.al = context.data.byte(kLiftpath); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context._cmp(context.data.byte(38), 0); + context._cmp(context.data.byte(kCounttoopen), 0); if (context.flags.z()) goto nocountopen; - context._sub(context.data.byte(38), 1); - context._cmp(context.data.byte(38), 0); + context._sub(context.data.byte(kCounttoopen), 1); + context._cmp(context.data.byte(kCounttoopen), 0); if (!context.flags.z()) goto nocountopen; - context.data.byte(34) = 3; + context.data.byte(kLiftflag) = 3; nocountopen: context.al = 0; goto pokelift; } void liftnoise(Context & context) { - context._cmp(context.data.byte(183), 5); + context._cmp(context.data.byte(kReallocation), 5); if (context.flags.z()) goto hissnoise; - context._cmp(context.data.byte(183), 21); + context._cmp(context.data.byte(kReallocation), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); return; @@ -3400,52 +3400,52 @@ gotconst: } void doorway(Context & context) { - context.data.byte(192) = -24; - context.data.byte(193) = 10; - context.data.byte(194) = -30; - context.data.byte(195) = 10; + context.data.byte(kDoorcheck1) = -24; + context.data.byte(kDoorcheck2) = 10; + context.data.byte(kDoorcheck3) = -30; + context.data.byte(kDoorcheck4) = 10; dodoor(context); return; } void widedoor(Context & context) { - context.data.byte(192) = -24; - context.data.byte(193) = 24; - context.data.byte(194) = -30; - context.data.byte(195) = 24; + context.data.byte(kDoorcheck1) = -24; + context.data.byte(kDoorcheck2) = 24; + context.data.byte(kDoorcheck3) = -30; + context.data.byte(kDoorcheck4) = 24; dodoor(context); return; } void dodoor(Context & context) { - context.al = context.data.byte(150); - context.ah = context.data.byte(151); + context.al = context.data.byte(kRyanx); + context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); if (!context.flags.c()) goto rtofdoor; context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(192)); + context._cmp(context.al, context.data.byte(kDoorcheck1)); if (!context.flags.c()) goto upordown; goto shutdoor; rtofdoor: context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(193)); + context._cmp(context.al, context.data.byte(kDoorcheck2)); if (!context.flags.c()) goto shutdoor; upordown: context._cmp(context.ah, context.ch); if (!context.flags.c()) goto botofdoor; context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(194)); + context._cmp(context.ah, context.data.byte(kDoorcheck3)); if (context.flags.c()) goto shutdoor; goto opendoor; botofdoor: context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(195)); + context._cmp(context.ah, context.data.byte(kDoorcheck4)); if (!context.flags.c()) goto shutdoor; opendoor: context.cl = context.es.byte(context.bx+19); - context._cmp(context.data.byte(60), 1); + context._cmp(context.data.byte(kThroughdoor), 1); if (!context.flags.z()) goto notthrough; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough; @@ -3455,7 +3455,7 @@ notthrough: context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound2; context.al = 0; - context._cmp(context.data.byte(183), 5); + context._cmp(context.data.byte(kReallocation), 5); if (!context.flags.z()) goto nothoteldoor2; context.al = 13; nothoteldoor2: @@ -3475,14 +3475,14 @@ atlast1: context.di = context.pop(); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - context.data.byte(60) = 1; + context.data.byte(kThroughdoor) = 1; return; shutdoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(183), 5); + context._cmp(context.data.byte(kReallocation), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3502,14 +3502,14 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(60) = 0; + context.data.byte(kThroughdoor) = 0; notnearly: return; } void lockeddoorway(Context & context) { - context.al = context.data.byte(150); - context.ah = context.data.byte(151); + context.al = context.data.byte(kRyanx); + context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); @@ -3534,9 +3534,9 @@ botofdoor2: context._cmp(context.ah, 12); if (!context.flags.c()) goto shutdoor2; opendoor2: - context._cmp(context.data.byte(60), 1); + context._cmp(context.data.byte(kThroughdoor), 1); if (context.flags.z()) goto mustbeopen; - context._cmp(context.data.byte(36), 1); + context._cmp(context.data.byte(kLockstatus), 1); if (context.flags.z()) goto shutdoor; mustbeopen: context.cl = context.es.byte(context.bx+19); @@ -3547,7 +3547,7 @@ mustbeopen: notdoorsound4: context._cmp(context.cl, 6); if (!context.flags.z()) goto noturnonyet; - context.al = context.data.byte(37); + context.al = context.data.byte(kDoorpath); context.push(context.es); context.push(context.bx); turnpathon(context); @@ -3555,7 +3555,7 @@ notdoorsound4: context.es = context.pop(); noturnonyet: context.cl = context.es.byte(context.bx+19); - context._cmp(context.data.byte(60), 1); + context._cmp(context.data.byte(kThroughdoor), 1); if (!context.flags.z()) goto notthrough2; context._cmp(context.cl, 0); if (!context.flags.z()) goto notthrough2; @@ -3578,7 +3578,7 @@ atlast3: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto justshutting; - context.data.byte(60) = 1; + context.data.byte(kThroughdoor) = 1; justshutting: return; shutdoor2: @@ -3594,7 +3594,7 @@ notdoorsound3: context.es.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; - context.data.byte(60) = 0; + context.data.byte(kThroughdoor) = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); @@ -3603,13 +3603,13 @@ atlast4: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) goto notlocky; - context.al = context.data.byte(37); + context.al = context.data.byte(kDoorpath); context.push(context.es); context.push(context.bx); turnpathoff(context); context.bx = context.pop(); context.es = context.pop(); - context.data.byte(36) = 1; + context.data.byte(kLockstatus) = 1; notlocky: return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ @@ -3618,7 +3618,7 @@ shutdoor: context._cmp(context.cl, 5); if (!context.flags.z()) goto notdoorsound1; context.al = 1; - context._cmp(context.data.byte(183), 5); + context._cmp(context.data.byte(kReallocation), 5); if (!context.flags.z()) goto nothoteldoor1; context.al = 13; nothoteldoor1: @@ -3638,20 +3638,20 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) goto notnearly; - context.data.byte(60) = 0; + context.data.byte(kThroughdoor) = 0; notnearly: return; return; } void updatepeople(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); - context.data.word(16) = context.di; + context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; while(--context.cx) context._stosb(); - context._add(context.data.word(136), 1); + context._add(context.data.word(kMaintimer), 1); context.es = context.cs; context.bx = 534; context.di = 991; @@ -3659,12 +3659,12 @@ updateloop: context.al = context.es.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto endupdate; - context._cmp(context.al, context.data.byte(183)); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto notinthisroom; context.cx = context.es.word(context.bx+1); - context._cmp(context.cl, context.data.byte(147)); + context._cmp(context.cl, context.data.byte(kMapx)); if (!context.flags.z()) goto notinthisroom; - context._cmp(context.ch, context.data.byte(148)); + context._cmp(context.ch, context.data.byte(kMapy)); if (!context.flags.z()) goto notinthisroom; context.push(context.di); context.ax = context.cs.word(context.di); @@ -3680,12 +3680,12 @@ endupdate: void getreelframeax(Context & context) { context.push(context.ds); - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; findsource(context); context.es = context.ds; context.ds = context.pop(); - context.ax = context.data.word(158); - context._sub(context.ax, context.data.word(242)); + context.ax = context.data.word(kCurrentframe); + context._sub(context.ax, context.data.word(kTakeoff)); context._add(context.ax, context.ax); context.cx = context.ax; context._add(context.ax, context.ax); @@ -3714,7 +3714,7 @@ retryreel: context._cmp(context.al, 255); if (context.flags.z()) goto normalreel; dealwithspecial(context); - context._add(context.data.word(237), 1); + context._add(context.data.word(kReelpointer), 1); context.si = context.pop(); context.es = context.pop(); context._add(context.si, 40); @@ -3742,7 +3742,7 @@ notplot: } void soundonreels(Context & context) { - context.bl = context.data.byte(183); + context.bl = context.data.byte(kReallocation); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); context._add(context.bx, 1214); @@ -3752,11 +3752,11 @@ reelsoundloop: context._cmp(context.al, 255); if (context.flags.z()) goto endreelsound; context.ax = context.cs.word(context.si+1); - context._cmp(context.ax, context.data.word(237)); + context._cmp(context.ax, context.data.word(kReelpointer)); if (!context.flags.z()) goto skipreelsound; - context._cmp(context.ax, context.data.word(349)); + context._cmp(context.ax, context.data.word(kLastsoundreel)); if (context.flags.z()) goto skipreelsound; - context.data.word(349) = context.ax; + context.data.word(kLastsoundreel) = context.ax; context.al = context.cs.byte(context.si); context._cmp(context.al, 64); if (context.flags.c()) { playchannel1(context); return; }; @@ -3773,26 +3773,26 @@ skipreelsound: context._add(context.si, 3); goto reelsoundloop; endreelsound: - context.ax = context.data.word(349); - context._cmp(context.ax, context.data.word(237)); + context.ax = context.data.word(kLastsoundreel); + context._cmp(context.ax, context.data.word(kReelpointer)); if (context.flags.z()) goto nochange2; - context.data.word(349) = -1; + context.data.word(kLastsoundreel) = -1; nochange2: return; } void reconstruct(Context & context) { - context._cmp(context.data.byte(129), 0); + context._cmp(context.data.byte(kHavedoneobs), 0); if (context.flags.z()) goto noneedtorecon; - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); spriteupdate(context); printsprites(context); - context._cmp(context.data.byte(183), 20); + context._cmp(context.data.byte(kReallocation), 20); if (!context.flags.z()) goto notfudge; undertextline(context); notfudge: - context.data.byte(129) = 0; + context.data.byte(kHavedoneobs) = 0; noneedtorecon: return; } @@ -3803,28 +3803,28 @@ void dealwithspecial(Context & context) { if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); - context.data.byte(129) = 1; + context.data.byte(kHavedoneobs) = 1; return; notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); - context.data.byte(129) = 1; + context.data.byte(kHavedoneobs) = 1; return; notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); - context.data.byte(129) = 1; + context.data.byte(kHavedoneobs) = 1; return; notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); - context.data.byte(129) = 1; + context.data.byte(kHavedoneobs) = 1; return; notremfree: context._cmp(context.al, 4); @@ -3834,14 +3834,14 @@ notremfree: notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; - context.data.byte(134) = context.ah; - context.data.byte(132) = context.ah; + context.data.byte(kTurntoface) = context.ah; + context.data.byte(kFacing) = context.ah; switchryanon(context); return; notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; - context.data.byte(187) = context.ah; + context.data.byte(kNewlocation) = context.ah; return; notchangeloc: movemap(context); @@ -3851,38 +3851,38 @@ notchangeloc: void movemap(Context & context) { context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; - context._sub(context.data.byte(148), 20); - context.data.byte(185) = 1; + context._sub(context.data.byte(kMapy), 20); + context.data.byte(kNowinnewroom) = 1; return; notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; - context._sub(context.data.byte(148), 10); - context.data.byte(185) = 1; + context._sub(context.data.byte(kMapy), 10); + context.data.byte(kNowinnewroom) = 1; return; notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; - context._add(context.data.byte(148), 10); - context.data.byte(185) = 1; + context._add(context.data.byte(kMapy), 10); + context.data.byte(kNowinnewroom) = 1; return; notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; - context._add(context.data.byte(147), 11); - context.data.byte(185) = 1; + context._add(context.data.byte(kMapx), 11); + context.data.byte(kNowinnewroom) = 1; return; notmaprightspec: - context._sub(context.data.byte(147), 11); - context.data.byte(185) = 1; + context._sub(context.data.byte(kMapx), 11); + context.data.byte(kNowinnewroom) = 1; return; } void getreelstart(Context & context) { - context.ax = context.data.word(237); + context.ax = context.data.word(kReelpointer); context.cx = 40; context._mul(context.cx); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.si = context.ax; context._add(context.si, 0+(36*144)); return; @@ -3892,37 +3892,37 @@ void showreelframe(Context & context) { context.al = context.es.byte(context.si+2); context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(115)); + context._add(context.di, context.data.word(kMapadx)); context.al = context.es.byte(context.si+3); context.bx = context.ax; - context._add(context.bx, context.data.word(117)); + context._add(context.bx, context.data.word(kMapady)); context.ax = context.es.word(context.si); - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; findsource(context); - context.ax = context.data.word(158); - context._sub(context.ax, context.data.word(242)); + context.ax = context.data.word(kCurrentframe); + context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 8; showframe(context); return; } void deleverything(Context & context) { - context.al = context.data.byte(128); + context.al = context.data.byte(kMapysize); context.ah = 0; - context._add(context.ax, context.data.word(121)); + context._add(context.ax, context.data.word(kMapoffsety)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); return; bigroom: - context._sub(context.data.byte(128), 8); + context._sub(context.data.byte(kMapysize), 8); maptopanel(context); - context._add(context.data.byte(128), 8); + context._add(context.data.byte(kMapysize), 8); return; } void dumpeverything(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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); dumpevery1: context.ax = context.es.word(context.bx); @@ -3941,8 +3941,8 @@ notskip1: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(115)); - context._add(context.bx, context.data.word(117)); + context._add(context.di, context.data.word(kMapadx)); + context._add(context.bx, context.data.word(kMapady)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3964,8 +3964,8 @@ dumpevery2: context.bh = 0; context.ah = 0; context.di = context.ax; - context._add(context.di, context.data.word(115)); - context._add(context.bx, context.data.word(117)); + context._add(context.di, context.data.word(kMapadx)); + context._add(context.bx, context.data.word(kMapady)); multidump(context); context.ds = context.pop(); context.es = context.pop(); @@ -3979,7 +3979,7 @@ finishevery2: void allocatework(Context & context) { context.bx = 0x1000; allocatemem(context); - context.data.word(398) = context.ax; + context.data.word(kWorkspace) = context.ax; return; } @@ -4007,20 +4007,20 @@ void loadpalfromiff(Context & context) { context.dx = 2481; openfile(context); context.cx = 2000; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.dx = 0; readfromfile(context); closefile(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0x30; context.cx = 768; palloop: context._lodsb(); context._shr(context.al, 1); context._shr(context.al, 1); - context._cmp(context.data.byte(72), 1); + context._cmp(context.data.byte(kBrightness), 1); if (!context.flags.z()) goto nought; context._cmp(context.al, 0); if (context.flags.z()) goto nought; @@ -4051,7 +4051,7 @@ void cls(Context & context) { void printundermon(Context & context) { context.si = (320*43)+76; context.di = context.si; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context._add(context.si, 8*320); context.dx = 0x0a000; context.ds = context.dx; @@ -4087,7 +4087,7 @@ void worktoscreen(Context & context) { context.si = 0; context.di = 0; context.cx = 25; - context.ds = context.data.word(398); + context.ds = context.data.word(kWorkspace); context.dx = 0x0a000; context.es = context.dx; dumpallloop: @@ -4104,38 +4104,38 @@ dumpallloop: } void paneltomap(Context & context) { - context.di = context.data.word(123); - context._add(context.di, context.data.word(115)); - context.bx = context.data.word(125); - context._add(context.bx, context.data.word(117)); - context.ds = context.data.word(400); + context.di = context.data.word(kMapxstart); + context._add(context.di, context.data.word(kMapadx)); + context.bx = context.data.word(kMapystart); + context._add(context.bx, context.data.word(kMapady)); + context.ds = context.data.word(kMapstore); context.si = 0; - context.cl = context.data.byte(127); - context.ch = context.data.byte(128); + context.cl = context.data.byte(kMapxsize); + context.ch = context.data.byte(kMapysize); multiget(context); return; } void maptopanel(Context & context) { - context.di = context.data.word(123); - context._add(context.di, context.data.word(115)); - context.bx = context.data.word(125); - context._add(context.bx, context.data.word(117)); - context.ds = context.data.word(400); + context.di = context.data.word(kMapxstart); + context._add(context.di, context.data.word(kMapadx)); + context.bx = context.data.word(kMapystart); + context._add(context.bx, context.data.word(kMapady)); + context.ds = context.data.word(kMapstore); context.si = 0; - context.cl = context.data.byte(127); - context.ch = context.data.byte(128); + context.cl = context.data.byte(kMapxsize); + context.ch = context.data.byte(kMapysize); multiput(context); return; } void dumpmap(Context & context) { - context.di = context.data.word(123); - context._add(context.di, context.data.word(115)); - context.bx = context.data.word(125); - context._add(context.bx, context.data.word(117)); - context.cl = context.data.byte(127); - context.ch = context.data.byte(128); + context.di = context.data.word(kMapxstart); + context._add(context.di, context.data.word(kMapadx)); + context.bx = context.data.word(kMapystart); + context._add(context.bx, context.data.word(kMapady)); + context.cl = context.data.byte(kMapxsize); + context.ch = context.data.byte(kMapysize); multidump(context); return; } @@ -4151,7 +4151,7 @@ void pixelcheckset(Context & context) { context.al = context.es.byte(context.bx+4); getsetad(context); context.al = context.es.byte(context.bx+17); - context.es = context.data.word(442); + context.es = context.data.word(kSetframes); context.bx = 0; context.ah = 0; context.cx = 6; @@ -4183,25 +4183,25 @@ void pixelcheckset(Context & context) { void createpanel(Context & context) { context.di = 0; context.bx = 8; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 8; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 0; context.ah = 2; showframe(context); context.di = 0; context.bx = 104; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 0; context.ah = 2; showframe(context); context.di = 160; context.bx = 104; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 0; context.ah = 2; showframe(context); @@ -4212,13 +4212,13 @@ void createpanel2(Context & context) { createpanel(context); context.di = 0; context.bx = 0; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 5; context.ah = 2; showframe(context); context.di = 160; context.bx = 0; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.al = 5; context.ah = 2; showframe(context); @@ -4227,7 +4227,7 @@ void createpanel2(Context & context) { void clearwork(Context & context) { context.ax = 0x0; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.di = 0; context.cx = (200*320)/64; clearloop: @@ -4268,24 +4268,24 @@ clearloop: } void zoom(Context & context) { - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto inwatching; - context._cmp(context.data.byte(7), 1); + context._cmp(context.data.byte(kZoomon), 1); if (context.flags.z()) goto zoomswitch; inwatching: return; zoomswitch: - context._cmp(context.data.byte(99), 199); + context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); return; zoomit: - context.ax = context.data.word(220); + context.ax = context.data.word(kOldpointery); context._sub(context.ax, 9); context.cx = 320; context._mul(context.cx); - context._add(context.ax, context.data.word(218)); + context._add(context.ax, context.data.word(kOldpointerx)); context._sub(context.ax, 11); context.si = context.ax; context.ax = 132+4; @@ -4293,8 +4293,8 @@ zoomit: context._mul(context.cx); context._add(context.ax, 8+5); context.di = context.ax; - context.es = context.data.word(398); - context.ds = context.data.word(398); + context.es = context.data.word(kWorkspace); + context.ds = context.data.word(kWorkspace); context.cx = 20; zoomloop: context.push(context.cx); @@ -4310,7 +4310,7 @@ zoomloop2: context.cx = context.pop(); if (--context.cx) goto zoomloop; crosshair(context); - context.data.byte(74) = 1; + context.data.byte(kDidzoom) = 1; return; } @@ -4319,12 +4319,12 @@ void delthisone(Context & context) { context.push(context.ax); context.al = context.ah; context.ah = 0; - context._add(context.ax, context.data.word(117)); + context._add(context.ax, context.data.word(kMapady)); context.bx = 320; context._mul(context.bx); context.bx = context.pop(); context.bh = 0; - context._add(context.bx, context.data.word(115)); + context._add(context.bx, context.data.word(kMapadx)); context._add(context.ax, context.bx); context.di = context.ax; context.ax = context.pop(); @@ -4337,8 +4337,8 @@ void delthisone(Context & context) { context.bh = 0; context._add(context.ax, context.bx); context.si = context.ax; - context.es = context.data.word(398); - context.ds = context.data.word(400); + context.es = context.data.word(kWorkspace); + context.ds = context.data.word(kMapstore); context.dl = context.cl; context.dh = 0; context.ax = 320; @@ -4362,7 +4362,7 @@ void multiget(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.es = context.ds; context.ds = context.es; context._xchg(context.di, context.si); @@ -4406,7 +4406,7 @@ void multiput(Context & context) { context.bx = 320; context._mul(context.bx); context._add(context.di, context.ax); - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.al = context.cl; context.ah = 0; context.dx = 320; @@ -4445,7 +4445,7 @@ multiloop6: void multidump(Context & context) { context.dx = 0x0a000; context.es = context.dx; - context.ds = context.data.word(398); + context.ds = context.data.word(kWorkspace); context.ax = context.bx; context.bx = 320; context._mul(context.bx); @@ -4727,17 +4727,17 @@ void width160(Context & context) { } void doblocks(Context & context) { - context.es = context.data.word(398); - context.ax = context.data.word(117); + context.es = context.data.word(kWorkspace); + context.ax = context.data.word(kMapady); context.cx = 320; context._mul(context.cx); - context.di = context.data.word(115); + context.di = context.data.word(kMapadx); context._add(context.di, context.ax); - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.ah = 0; context.bx = 66; context._mul(context.bx); - context.bl = context.data.byte(147); + context.bl = context.data.byte(kMapx); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -4750,9 +4750,9 @@ loop120: loop124: context.push(context.cx); context.push(context.di); - context.ds = context.data.word(416); + context.ds = context.data.word(kMapdata); context._lodsb(); - context.ds = context.data.word(414); + context.ds = context.data.word(kBackdrop); context.push(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto zeroblock; @@ -4896,9 +4896,9 @@ notdiffdest: if (context.flags.z()) goto notprintlist; context.push(context.ax); context.ax = context.di; - context._sub(context.ax, context.data.word(115)); + context._sub(context.ax, context.data.word(kMapadx)); context.push(context.bx); - context._sub(context.bx, context.data.word(117)); + context._sub(context.bx, context.data.word(kMapady)); context.ah = context.bl; context.bx = context.pop(); context.ax = context.pop(); @@ -4906,7 +4906,7 @@ notprintlist: context._test(context.ah, 4); if (context.flags.z()) goto notflippedx; context.dx = 320; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutfx(context); context.cx = context.pop(); @@ -4915,7 +4915,7 @@ notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; context.dx = 320; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutnm(context); context.cx = context.pop(); @@ -4924,14 +4924,14 @@ notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; context.dx = 320; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutbh(context); context.cx = context.pop(); return; noeffects: context.dx = 320; - context.es = context.data.word(398); + context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutv(context); context.cx = context.pop(); @@ -5095,9 +5095,9 @@ backtosolidfx: } void transferinv(Context & context) { - context.di = context.data.word(10); + context.di = context.data.word(kExframepos); context.push(context.di); - context.al = context.data.byte(9); + context.al = context.data.byte(kExpos); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5105,12 +5105,12 @@ void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(89); + context.al = context.data.byte(kItemtotran); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); @@ -5118,7 +5118,7 @@ void transferinv(Context & context) { context._add(context.ax, 1); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(444); + context.ds = context.data.word(kFreeframes); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5139,33 +5139,33 @@ void transferinv(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; - context._add(context.data.word(10), context.cx); + context._add(context.data.word(kExframepos), context.cx); return; } void transfermap(Context & context) { - context.di = context.data.word(10); + context.di = context.data.word(kExframepos); context.push(context.di); - context.al = context.data.byte(9); + context.al = context.data.byte(kExpos); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.bx = 0; context._add(context.bx, context.ax); context._add(context.di, 0+2080); context.push(context.bx); - context.al = context.data.byte(89); + context.al = context.data.byte(kItemtotran); context.ah = 0; context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); context.cx = 6; context._mul(context.cx); - context.ds = context.data.word(444); + context.ds = context.data.word(kFreeframes); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+2080; @@ -5186,26 +5186,26 @@ void transfermap(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; - context._add(context.data.word(10), context.cx); + context._add(context.data.word(kExframepos), context.cx); return; } void dofade(Context & context) { - context._cmp(context.data.byte(343), 0); + context._cmp(context.data.byte(kFadedirection), 0); if (context.flags.z()) goto finishfade; - context.cl = context.data.byte(344); + context.cl = context.data.byte(kNumtofade); context.ch = 0; - context.al = context.data.byte(342); + context.al = context.data.byte(kColourpos); context.ah = 0; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); showgroup(context); - context.al = context.data.byte(344); - context._add(context.al, context.data.byte(342)); - context.data.byte(342) = context.al; + context.al = context.data.byte(kNumtofade); + context._add(context.al, context.data.byte(kColourpos)); + context.data.byte(kColourpos) = context.al; context._cmp(context.al, 0); if (!context.flags.z()) goto finishfade; fadecalculation(context); @@ -5214,7 +5214,7 @@ finishfade: } void clearendpal(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 0; @@ -5223,7 +5223,7 @@ void clearendpal(Context & context) { } void clearpalette(Context & context) { - context.data.byte(343) = 0; + context.data.byte(kFadedirection) = 0; clearstartpal(context); dumpcurrent(context); return; @@ -5232,15 +5232,15 @@ void clearpalette(Context & context) { void fadescreenup(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; return; } void fadetowhite(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; context.al = 63; @@ -5251,15 +5251,15 @@ void fadetowhite(Context & context) { context._stosb(); context._stosb(); paltostartpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; return; } void fadefromwhite(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768; context.al = 63; @@ -5270,20 +5270,20 @@ void fadefromwhite(Context & context) { context._stosb(); context._stosb(); paltoendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; return; } void fadescreenups(Context & context) { clearstartpal(context); paltoendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 64; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 64; return; } @@ -5291,7 +5291,7 @@ void fadescreendownhalf(Context & context) { paltostartpal(context); paltoendpal(context); context.cx = 768; - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; halfend: context.al = context.es.byte(context.bx); @@ -5299,8 +5299,8 @@ halfend: context.es.byte(context.bx) = context.al; context._add(context.bx, 1); if (--context.cx) goto halfend; - context.ds = context.data.word(410); - context.es = context.data.word(410); + context.ds = context.data.word(kBuffers); + context.es = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); context.cx = 3*5; @@ -5309,45 +5309,45 @@ halfend: context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); context.cx = 3*2; while(--context.cx) context._movsb(); - context.data.byte(343) = 1; - context.data.byte(345) = 31; - context.data.byte(342) = 0; - context.data.byte(344) = 32; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 31; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 32; return; } void fadescreenuphalf(Context & context) { endpaltostart(context); paltoendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 31; - context.data.byte(342) = 0; - context.data.byte(344) = 32; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 31; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 32; return; } void fadescreendown(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; return; } void fadescreendowns(Context & context) { paltostartpal(context); clearendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 64; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 64; return; } void clearstartpal(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 256; wholeloop1: @@ -5360,39 +5360,39 @@ wholeloop1: } void showgun(Context & context) { - context.data.byte(347) = 0; - context.data.byte(346) = 0; - context.data.byte(348) = 0; + context.data.byte(kAddtored) = 0; + context.data.byte(kAddtogreen) = 0; + context.data.byte(kAddtoblue) = 0; paltostartpal(context); paltoendpal(context); greyscalesum(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 130; hangon(context); endpaltostart(context); clearendpal(context); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 200; hangon(context); - context.data.byte(530) = 34; + context.data.byte(kRoomssample) = 34; loadroomssample(context); - context.data.byte(385) = 0; + context.data.byte(kVolume) = 0; context.dx = 2351; loadintotemp(context); createpanel2(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 0; context.ah = 0; context.di = 100; context.bx = 4; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 1; context.ah = 0; context.di = 158; @@ -5423,10 +5423,10 @@ void rollem(Context & context) { context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiget(context); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.si = 49*2; context.ax = context.es.word(context.si); context.si = context.ax; @@ -5435,7 +5435,7 @@ void rollem(Context & context) { endcredits21: context.push(context.cx); context.bx = 10; - context.cx = context.data.word(75); + context.cx = context.data.word(kLinespacing); endcredits22: context.push(context.cx); context.push(context.si); @@ -5447,7 +5447,7 @@ endcredits22: context.ch = 160; context.di = 25; context.bx = 20; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiput(context); vsync(context); @@ -5466,7 +5466,7 @@ onelot2: context.dx = 161; context.ax = 0; printdirect(context); - context._add(context.bx, context.data.word(75)); + context._add(context.bx, context.data.word(kLinespacing)); context.cx = context.pop(); if (--context.cx) goto onelot2; vsync(context); @@ -5480,7 +5480,7 @@ onelot2: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto endearly2; context._sub(context.bx, 1); if (--context.cx) goto endcredits22; @@ -5494,7 +5494,7 @@ looknext2: if (context.flags.z()) goto gotnext2; goto looknext2; gotnext2: - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto endearly; if (--context.cx) goto endcredits21; context.cx = 120; @@ -5507,10 +5507,10 @@ endearly: } void fadecalculation(Context & context) { - context._cmp(context.data.byte(345), 0); + context._cmp(context.data.byte(kFadecount), 0); if (context.flags.z()) goto nomorefading; - context.bl = context.data.byte(345); - context.es = context.data.word(410); + context.bl = context.data.byte(kFadecount); + context.es = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 768; @@ -5532,15 +5532,15 @@ gotthere: context._add(context.si, 1); context._add(context.di, 1); if (--context.cx) goto fadecolloop; - context._sub(context.data.byte(345), 1); + context._sub(context.data.byte(kFadecount), 1); return; nomorefading: - context.data.byte(343) = 0; + context.data.byte(kFadedirection) = 0; return; } void greyscalesum(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.cx = 256; @@ -5569,19 +5569,19 @@ greysumloop2: if (!context.flags.c()) goto greysumloop2; context.bl = context.al; context.al = context.bl; - context.ah = context.data.byte(347); + context.ah = context.data.byte(kAddtored); context._cmp(context.al, 0); context._add(context.al, context.ah); noaddr: context._stosb(); - context.ah = context.data.byte(346); + context.ah = context.data.byte(kAddtogreen); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddg; context._add(context.al, context.ah); noaddg: context._stosb(); - context.ah = context.data.byte(348); + context.ah = context.data.byte(kAddtoblue); context.al = context.bl; context._cmp(context.al, 0); if (context.flags.z()) goto noaddb; @@ -5595,8 +5595,8 @@ noaddb: } void paltostartpal(Context & context) { - context.es = context.data.word(410); - context.ds = context.data.word(410); + context.es = context.data.word(kBuffers); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5605,8 +5605,8 @@ void paltostartpal(Context & context) { } void endpaltostart(Context & context) { - context.es = context.data.word(410); - context.ds = context.data.word(410); + context.es = context.data.word(kBuffers); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5615,8 +5615,8 @@ void endpaltostart(Context & context) { } void startpaltoend(Context & context) { - context.es = context.data.word(410); - context.ds = context.data.word(410); + context.es = context.data.word(kBuffers); + context.ds = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); context.cx = 768/2; @@ -5625,8 +5625,8 @@ void startpaltoend(Context & context) { } void paltoendpal(Context & context) { - context.es = context.data.word(410); - context.ds = context.data.word(410); + context.es = context.data.word(kBuffers); + context.ds = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5635,8 +5635,8 @@ void paltoendpal(Context & context) { } void allpalette(Context & context) { - context.es = context.data.word(410); - context.ds = context.data.word(410); + context.es = context.data.word(kBuffers); + context.ds = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; context.cx = 768/2; @@ -5647,7 +5647,7 @@ void allpalette(Context & context) { void dumpcurrent(Context & context) { context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); vsync(context); context.al = 0; context.cx = 128; @@ -5662,7 +5662,7 @@ void dumpcurrent(Context & context) { void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5670,10 +5670,10 @@ void fadedownmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 64; hangon(context); return; @@ -5682,7 +5682,7 @@ void fadedownmon(Context & context) { void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5690,10 +5690,10 @@ void fadeupmon(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); return; @@ -5702,7 +5702,7 @@ void fadeupmon(Context & context) { void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); context.cx = 3*8; context.ax = 0; @@ -5710,10 +5710,10 @@ void fadeupmonfirst(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 64; hangon(context); context.al = 26; @@ -5725,7 +5725,7 @@ void fadeupmonfirst(Context & context) { void fadeupyellows(Context & context) { paltoendpal(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); context.cx = 3*8; context.ax = 0; @@ -5733,10 +5733,10 @@ void fadeupyellows(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); context._stosb(); context._stosw(); - context.data.byte(343) = 1; - context.data.byte(345) = 63; - context.data.byte(342) = 0; - context.data.byte(344) = 128; + context.data.byte(kFadedirection) = 1; + context.data.byte(kFadecount) = 63; + context.data.byte(kColourpos) = 0; + context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); return; @@ -5744,7 +5744,7 @@ void fadeupyellows(Context & context) { void initialmoncols(Context & context) { paltostartpal(context); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.cx = 3*9; context.ax = 0; @@ -5752,7 +5752,7 @@ void initialmoncols(Context & context) { context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); context._stosb(); context._stosw(); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); context.al = 230; context.cx = 18; @@ -5773,24 +5773,24 @@ void endgame(Context & context) { monkspeaking(context); gettingshot(context); getridoftemptext(context); - context.data.byte(386) = 7; - context.data.byte(387) = 1; + context.data.byte(kVolumeto) = 7; + context.data.byte(kVolumedirection) = 1; context.cx = 200; hangon(context); return; } void monkspeaking(Context & context) { - context.data.byte(530) = 35; + context.data.byte(kRoomssample) = 35; loadroomssample(context); context.dx = 2364; loadintotemp(context); clearwork(context); showmonk(context); worktoscreen(context); - context.data.byte(385) = 7; - context.data.byte(387) = -1; - context.data.byte(386) = 0; + context.data.byte(kVolume) = 7; + context.data.byte(kVolumedirection) = -1; + context.data.byte(kVolumeto) = 0; context.al = 12; context.ah = 255; playchannel0(context); @@ -5803,7 +5803,7 @@ nextmonkspeak: context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -5829,8 +5829,8 @@ nextbit: context._add(context.al, 1); context._cmp(context.al, 44); if (!context.flags.z()) goto nextmonkspeak; - context.data.byte(387) = 1; - context.data.byte(386) = 7; + context.data.byte(kVolumedirection) = 1; + context.data.byte(kVolumeto) = 7; fadescreendowns(context); context.cx = 300; hangon(context); @@ -5843,18 +5843,18 @@ void showmonk(Context & context) { context.ah = 128; context.di = 160; context.bx = 72; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); return; } void gettingshot(Context & context) { - context.data.byte(187) = 55; + context.data.byte(kNewlocation) = 55; clearpalette(context); loadintroroom(context); fadescreenups(context); - context.data.byte(386) = 0; - context.data.byte(387) = -1; + context.data.byte(kVolumeto) = 0; + context.data.byte(kVolumedirection) = -1; runendseq(context); clearbeforeload(context); return; @@ -5887,7 +5887,7 @@ hangonloope: context.push(context.cx); vsync(context); context.cx = context.pop(); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; return; @@ -5902,28 +5902,28 @@ void intro(Context & context) { loadtemptext(context); loadpalfromiff(context); setmode(context); - context.data.byte(187) = 50; + context.data.byte(kNewlocation) = 50; clearpalette(context); loadintroroom(context); - context.data.byte(385) = 7; - context.data.byte(387) = -1; - context.data.byte(386) = 0; + context.data.byte(kVolume) = 7; + context.data.byte(kVolumedirection) = -1; + context.data.byte(kVolumeto) = 0; context.al = 12; context.ah = 255; playchannel0(context); fadescreenups(context); runintroseq(context); clearbeforeload(context); - context.data.byte(187) = 52; + context.data.byte(kNewlocation) = 52; loadintroroom(context); runintroseq(context); clearbeforeload(context); - context.data.byte(187) = 53; + context.data.byte(kNewlocation) = 53; loadintroroom(context); runintroseq(context); clearbeforeload(context); allpalette(context); - context.data.byte(187) = 54; + context.data.byte(kNewlocation) = 54; loadintroroom(context); runintroseq(context); getridoftemptext(context); @@ -5932,14 +5932,14 @@ void intro(Context & context) { } void runintroseq(Context & context) { - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; moreintroseq: vsync(context); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto earlyendrun; spriteupdate(context); vsync(context); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto earlyendrun; deleverything(context); printsprites(context); @@ -5947,14 +5947,14 @@ moreintroseq: afterintroroom(context); usetimedtext(context); vsync(context); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto earlyendrun; dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(391), 1); + context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto earlyendrun; - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreintroseq; return; earlyendrun: @@ -5967,7 +5967,7 @@ earlyendrun: void runendseq(Context & context) { atmospheres(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; moreendseq: vsync(context); spriteupdate(context); @@ -5981,23 +5981,23 @@ moreendseq: dumpmap(context); dumptimedtext(context); vsync(context); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreendseq; return; } void loadintroroom(Context & context) { - context.data.byte(138) = 0; - context.data.byte(8) = 255; + context.data.byte(kIntrocount) = 0; + context.data.byte(kLocation) = 255; loadroom(context); - context.data.word(119) = 72; - context.data.word(121) = 16; + context.data.word(kMapoffsetx) = 72; + context.data.word(kMapoffsety) = 16; clearsprites(context); - context.data.byte(60) = 0; - context.data.byte(141) = '0'; - context.data.byte(104) = 0; + context.data.byte(kThroughdoor) = 0; + context.data.byte(kCurrentkey) = '0'; + context.data.byte(kMainmode) = 0; clearwork(context); - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); @@ -6007,9 +6007,9 @@ void loadintroroom(Context & context) { } void realcredits(Context & context) { - context.data.byte(530) = 33; + context.data.byte(kRoomssample) = 33; loadroomssample(context); - context.data.byte(385) = 0; + context.data.byte(kVolume) = 0; mode640x480(context); context.cx = 35; hangon(context); @@ -6104,13 +6104,13 @@ void printchar(Context & context) { context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(69)); + context._add(context.ax, context.data.word(kCharshift)); showframe(context); context.ax = context.pop(); context.di = context.pop(); context.bx = context.pop(); context.si = context.pop(); - context._cmp(context.data.byte(71), 0); + context._cmp(context.data.byte(kKerning), 0); if (!context.flags.z()) goto nokern; kernchars(context); nokern: @@ -6146,9 +6146,9 @@ kernit: } void printslow(Context & context) { - context.data.byte(230) = 1; - context.data.byte(233) = 3; - context.ds = context.data.word(402); + context.data.byte(kPointerframe) = 1; + context.data.byte(kPointermode) = 3; + context.ds = context.data.word(kCharset1); printloopslow6: context.push(context.bx); context.push(context.di); @@ -6187,9 +6187,9 @@ printloopslow5: context.push(context.es); context.push(context.si); modifychar(context); - context.data.word(69) = 91; + context.data.word(kCharshift) = 91; printboth(context); - context.data.word(69) = 0; + context.data.word(kCharshift) = 0; context.si = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -6199,14 +6199,14 @@ printloopslow5: waitframes(context); context._cmp(context.ax, 0); if (context.flags.z()) goto keepgoing; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto finishslow2; keepgoing: waitframes(context); noslow: context._cmp(context.ax, 0); if (context.flags.z()) goto afterslow; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto finishslow2; afterslow: context.es = context.pop(); @@ -6250,7 +6250,7 @@ void waitframes(Context & context) { vsync(context); dumppointer(context); delpointer(context); - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context.ds = context.pop(); context.si = context.pop(); context.es = context.pop(); @@ -6277,8 +6277,8 @@ void printboth(Context & context) { } void printdirect(Context & context) { - context.data.word(82) = context.di; - context.ds = context.data.word(266); + context.data.word(kLastxpos) = context.di; + context.ds = context.data.word(kCurrentset); printloop6: context.push(context.bx); context.push(context.di); @@ -6296,14 +6296,14 @@ printloop5: context.push(context.es); modifychar(context); printchar(context); - context.data.word(82) = context.di; + context.data.word(kLastxpos) = context.di; context.es = context.pop(); context.cx = context.pop(); if (--context.cx) goto printloop5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - context._add(context.bx, context.data.word(75)); + context._add(context.bx, context.data.word(kLinespacing)); goto printloop6; finishdirct: context.dx = context.pop(); @@ -6313,12 +6313,12 @@ finishdirct: } void monprint(Context & context) { - context.data.byte(71) = 1; + context.data.byte(kKerning) = 1; context.si = context.bx; context.dl = 166; - context.di = context.data.word(316); - context.bx = context.data.word(318); - context.ds = context.data.word(404); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); + context.ds = context.data.word(kTempcharset); printloop8: context.push(context.bx); context.push(context.di); @@ -6347,9 +6347,9 @@ nottrigger: context.push(context.es); modifychar(context); printchar(context); - context.data.word(310) = context.di; - context.data.word(312) = context.bx; - context.data.word(136) = 1; + context.data.word(kCurslocx) = context.di; + context.data.word(kCurslocy) = context.bx; + context.data.word(kMaintimer) = 1; printcurs(context); vsync(context); context.push(context.si); @@ -6374,7 +6374,7 @@ finishmon2: context.di = context.pop(); context.bx = context.pop(); scrollmonitor(context); - context.data.word(310) = context.di; + context.data.word(kCurslocx) = context.di; goto printloop8; finishmon: context.dx = context.pop(); @@ -6382,12 +6382,12 @@ finishmon: context.bx = context.pop(); context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger2; - context.data.byte(54) = context.ah; + context.data.byte(kLasttrigger) = context.ah; nottrigger2: - context.data.word(310) = context.di; + context.data.word(kCurslocx) = context.di; scrollmonitor(context); context.bx = context.si; - context.data.byte(71) = 0; + context.data.byte(kKerning) = 0; return; } @@ -6512,7 +6512,7 @@ getloop: context.push(context.ax); context._sub(context.al, 32); context.ah = 0; - context._add(context.ax, context.data.word(69)); + context._add(context.ax, context.data.word(kCharshift)); context._add(context.ax, context.ax); context.si = context.ax; context._add(context.ax, context.ax); @@ -6590,11 +6590,11 @@ nomod: } void fillryan(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32; findallryan(context); context.si = 0+(228*13)+32; - context.al = context.data.byte(18); + context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 20; context._mul(context.cx); @@ -6641,7 +6641,7 @@ void fillopen(Context & context) { lessthanapage: context.al = 1; context.push(context.ax); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13); findallopen(context); context.si = 0+(228*13); @@ -6680,7 +6680,7 @@ void findallryan(Context & context) { while(--context.cx) context._stosw(); context.di = context.pop(); context.cl = 4; - context.ds = context.data.word(396); + context.ds = context.data.word(kExtras); context.bx = 0+2080+30000; context.ch = 0; findryanloop: @@ -6711,9 +6711,9 @@ void findallopen(Context & context) { context.ax = 0x0ffff; while(--context.cx) context._stosw(); context.di = context.pop(); - context.cl = context.data.byte(109); - context.dl = context.data.byte(110); - context.ds = context.data.word(396); + context.cl = context.data.byte(kOpenedob); + context.dl = context.data.byte(kOpenedtype); + context.ds = context.data.word(kExtras); context.bx = 0+2080+30000; context.ch = 0; findopen1: @@ -6721,10 +6721,10 @@ findopen1: if (!context.flags.z()) goto findopen2; context._cmp(context.ds.byte(context.bx+2), context.dl); if (!context.flags.z()) goto findopen2; - context._cmp(context.data.byte(110), 4); + context._cmp(context.data.byte(kOpenedtype), 4); if (context.flags.z()) goto noloccheck; context.al = context.ds.byte(context.bx+5); - context._cmp(context.al, context.data.byte(183)); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto findopen2; noloccheck: context.al = context.ds.byte(context.bx+4); @@ -6741,10 +6741,10 @@ findopen2: context._add(context.ch, 1); context._cmp(context.ch, 114); if (!context.flags.z()) goto findopen1; - context.cl = context.data.byte(109); - context.dl = context.data.byte(110); + context.cl = context.data.byte(kOpenedob); + context.dl = context.data.byte(kOpenedtype); context.push(context.dx); - context.ds = context.data.word(424); + context.ds = context.data.word(kFreedat); context.dx = context.pop(); context.bx = 0; context.ch = 0; @@ -6778,7 +6778,7 @@ void obtoinv(Context & context) { context.push(context.ax); context.push(context.di); context.push(context.bx); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context._sub(context.di, 2); context._sub(context.bx, 1); context.al = 10; @@ -6792,10 +6792,10 @@ void obtoinv(Context & context) { context.push(context.bx); context.push(context.di); context.push(context.ax); - context.ds = context.data.word(396); + context.ds = context.data.word(kExtras); context._cmp(context.ah, 4); if (context.flags.z()) goto isanextra; - context.ds = context.data.word(444); + context.ds = context.data.word(kFreeframes); isanextra: context.cl = context.al; context._add(context.al, context.al); @@ -6813,7 +6813,7 @@ isanextra: isitworn(context); context.bx = context.pop(); if (!context.flags.z()) goto finishfill; - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context._sub(context.di, 3); context._sub(context.bx, 2); context.al = 7; @@ -6844,18 +6844,18 @@ void makeworn(Context & context) { } void examineob(Context & context) { - context.data.byte(233) = 0; - context.data.word(326) = 0; + context.data.byte(kPointermode) = 0; + context.data.word(kTimecount) = 0; examineagain: - context.data.byte(236) = 0; - context.data.byte(107) = 0; - context.data.byte(109) = 255; - context.data.byte(110) = 255; - context.data.byte(103) = 0; - context.al = context.data.byte(99); - context.data.byte(101) = context.al; - context.data.byte(88) = 0; - context.data.byte(230) = 0; + context.data.byte(kInmaparea) = 0; + context.data.byte(kExamagain) = 0; + context.data.byte(kOpenedob) = 255; + context.data.byte(kOpenedtype) = 255; + context.data.byte(kInvopen) = 0; + context.al = context.data.byte(kCommandtype); + context.data.byte(kObjecttype) = context.al; + context.data.byte(kItemframe) = 0; + context.data.byte(kPointerframe) = 0; createpanel(context); showpanel(context); showman(context); @@ -6864,7 +6864,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -6876,41 +6876,41 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; context.bx = 2494; - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(kInvopen), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(kInvopen), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(107), 0); + context._cmp(context.data.byte(kExamagain), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitexam; - context.data.byte(105) = 0; - context._cmp(context.data.word(19), 0); + context.data.byte(kPickup) = 0; + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(187), 255); + context._cmp(context.data.byte(kNewlocation), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(103) = 0; - context.data.byte(109) = 255; + context.data.byte(kInvopen) = 0; + context.data.byte(kOpenedob) = 255; return; justgetback: - context.data.byte(103) = 0; - context.data.byte(109) = 255; + context.data.byte(kInvopen) = 0; + context.data.byte(kOpenedob) = 255; return; } void makemainscreen(Context & context) { createpanel(context); - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); spriteupdate(context); printsprites(context); @@ -6918,16 +6918,16 @@ void makemainscreen(Context & context) { showicon(context); getunderzoom(context); undertextline(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; animpointer(context); worktoscreenm(context); - context.data.byte(99) = 200; - context.data.byte(130) = 0; + context.data.byte(kCommandtype) = 200; + context.data.byte(kManisoffscreen) = 0; return; } void getbackfromob(Context & context) { - context._cmp(context.data.byte(105), 1); + context._cmp(context.data.byte(kPickup), 1); if (!context.flags.z()) goto notheldob; blank(context); return; @@ -6937,25 +6937,25 @@ notheldob: } void incryanpage(Context & context) { - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyincryan; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 31; commandonly(context); alreadyincryan: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noincryan; context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: return; doincryan: - context.ax = context.data.word(196); + context.ax = context.data.word(kMousex); context._sub(context.ax, 80+167); - context.data.byte(18) = -1; + context.data.byte(kRyanpage) = -1; findnewpage: - context._add(context.data.byte(18), 1); + context._add(context.data.byte(kRyanpage), 1); context._sub(context.ax, 18); if (!context.flags.c()) goto findnewpage; delpointer(context); @@ -6968,32 +6968,32 @@ findnewpage: } void openinv(Context & context) { - context.data.byte(103) = 1; + context.data.byte(kInvopen) = 1; context.al = 61; context.di = 80; context.bx = 58-10; context.dl = 240; printmessage(context); fillryan(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; return; } void showryanpage(Context & context) { - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 80+167; context.bx = 58-12; context.al = 12; context.ah = 0; showframe(context); context.al = 13; - context._add(context.al, context.data.byte(18)); + context._add(context.al, context.data.byte(kRyanpage)); context.push(context.ax); - context.al = context.data.byte(18); + context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 18; context._mul(context.cx); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 80+167; context._add(context.di, context.ax); context.bx = 58-12; @@ -7004,8 +7004,8 @@ void showryanpage(Context & context) { } void openob(Context & context) { - context.al = context.data.byte(109); - context.ah = context.data.byte(110); + context.al = context.data.byte(kOpenedob); + context.ah = context.data.byte(kOpenedtype); context.di = 5674; copyname(context); context.di = 80; @@ -7013,7 +7013,7 @@ void openob(Context & context) { context.al = 62; context.dl = 240; printmessage(context); - context.di = context.data.word(82); + context.di = context.data.word(kLastxpos); context._add(context.di, 5); context.bx = 58+86; context.es = context.cs; @@ -7035,18 +7035,18 @@ void openob(Context & context) { } void obicons(Context & context) { - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); if (context.flags.z()) goto cantopenit; - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.di = 210; context.bx = 1; context.al = 4; context.ah = 0; showframe(context); cantopenit: - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.di = 260; context.bx = 1; context.al = 1; @@ -7056,7 +7056,7 @@ cantopenit: } void examicon(Context & context) { - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context.di = 254; context.bx = 5; context.al = 3; @@ -7066,13 +7066,13 @@ void examicon(Context & context) { } void obpicture(Context & context) { - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); context._cmp(context.ah, 1); if (context.flags.z()) goto setframe; context._cmp(context.ah, 4); if (context.flags.z()) goto exframe; - context.ds = context.data.word(444); + context.ds = context.data.word(kFreeframes); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7085,7 +7085,7 @@ void obpicture(Context & context) { setframe: return; exframe: - context.ds = context.data.word(396); + context.ds = context.data.word(kExtras); context.di = 160; context.bx = 68; context.cl = context.al; @@ -7101,18 +7101,18 @@ void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; - context._cmp(context.data.byte(101), 1); + context._cmp(context.data.byte(kObjecttype), 1); if (!context.flags.z()) goto notsetd; context.bx = 82; notsetd: context.dl = 241; context.ah = 16; - context.data.word(69) = 91+91; + context.data.word(kCharshift) = 91+91; printdirect(context); - context.data.word(69) = 0; + context.data.word(kCharshift) = 0; context.di = 36; context.bx = 104; - context._cmp(context.data.byte(101), 1); + context._cmp(context.data.byte(kObjecttype), 1); if (!context.flags.z()) goto notsetd2; context.bx = 94; notsetd2: @@ -7129,16 +7129,16 @@ notsetd2: void additionaltext(Context & context) { context._add(context.bx, 10); context.push(context.bx); - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto emptycup; - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -7168,8 +7168,8 @@ fullcup: } void obsthatdothings(Context & context) { - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -7190,21 +7190,21 @@ notlouiscard: } void getobtextstart(Context & context) { - context.es = context.data.word(436); + context.es = context.data.word(kFreedesc); context.si = 0; context.cx = 0+(82*2); - context._cmp(context.data.byte(101), 2); + context._cmp(context.data.byte(kObjecttype), 2); if (context.flags.z()) goto describe; - context.es = context.data.word(438); + context.es = context.data.word(kSetdesc); context.si = 0; context.cx = 0+(130*2); - context._cmp(context.data.byte(101), 1); + context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto describe; - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.si = 0+2080+30000+(16*114); context.cx = 0+2080+30000+(16*114)+((114+2)*2); describe: - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); context.ah = 0; context._add(context.ax, context.ax); context._add(context.si, context.ax); @@ -7218,7 +7218,7 @@ tryagain: context.al = context.es.byte(context.si); context.cx = context.si; context.si = context.pop(); - context._cmp(context.data.byte(101), 1); + context._cmp(context.data.byte(kObjecttype), 1); if (!context.flags.z()) goto cantmakeoneup; context._cmp(context.al, 0); if (context.flags.z()) goto findsometext; @@ -7283,31 +7283,31 @@ endofcolon: } void inventory(Context & context) { - context._cmp(context.data.byte(55), 1); + context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto iswatchinv; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); return; notwatchinv: - context._cmp(context.data.byte(99), 239); + context._cmp(context.data.byte(kCommandtype), 239); if (context.flags.z()) goto alreadyopinv; - context.data.byte(99) = 239; + context.data.byte(kCommandtype) = 239; context.al = 32; commandonly(context); alreadyopinv: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto cantopinv; context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: return; doopeninv: - context.data.word(326) = 0; - context.data.byte(233) = 0; - context.data.byte(236) = 0; + context.data.word(kTimecount) = 0; + context.data.byte(kPointermode) = 0; + context.data.byte(kInmaparea) = 0; animpointer(context); createpanel(context); showpanel(context); @@ -7315,26 +7315,26 @@ doopeninv: showman(context); showexit(context); undertextline(context); - context.data.byte(105) = 0; - context.data.byte(103) = 2; + context.data.byte(kPickup) = 0; + context.data.byte(kInvopen) = 2; openinv(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(109) = 255; + context.data.byte(kOpenedob) = 255; goto waitexam; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: - context.data.byte(236) = 0; - context.data.byte(107) = 0; - context.data.byte(109) = 255; - context.data.byte(110) = 255; - context.data.byte(103) = 0; - context.al = context.data.byte(99); - context.data.byte(101) = context.al; - context.data.byte(88) = 0; - context.data.byte(230) = 0; + context.data.byte(kInmaparea) = 0; + context.data.byte(kExamagain) = 0; + context.data.byte(kOpenedob) = 255; + context.data.byte(kOpenedtype) = 255; + context.data.byte(kInvopen) = 0; + context.al = context.data.byte(kCommandtype); + context.data.byte(kObjecttype) = context.al; + context.data.byte(kItemframe) = 0; + context.data.byte(kPointerframe) = 0; createpanel(context); showpanel(context); showman(context); @@ -7343,7 +7343,7 @@ examineagain: obpicture(context); describeob(context); undertextline(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -7355,35 +7355,35 @@ waitexam: dumppointer(context); dumptextline(context); delpointer(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; context.bx = 2494; - context._cmp(context.data.byte(103), 0); + context._cmp(context.data.byte(kInvopen), 0); if (context.flags.z()) goto notuseinv; context.bx = 2556; - context._cmp(context.data.byte(103), 1); + context._cmp(context.data.byte(kInvopen), 1); if (context.flags.z()) goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); - context._cmp(context.data.byte(107), 0); + context._cmp(context.data.byte(kExamagain), 0); if (context.flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitexam; - context.data.byte(105) = 0; - context._cmp(context.data.word(19), 0); + context.data.byte(kPickup) = 0; + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto iswatching; - context._cmp(context.data.byte(187), 255); + context._cmp(context.data.byte(kNewlocation), 255); if (!context.flags.z()) goto justgetback; iswatching: makemainscreen(context); - context.data.byte(103) = 0; - context.data.byte(109) = 255; + context.data.byte(kInvopen) = 0; + context.data.byte(kOpenedob) = 255; return; justgetback: - context.data.byte(103) = 0; - context.data.byte(109) = 255; + context.data.byte(kInvopen) = 0; + context.data.byte(kOpenedob) = 255; return; examlist: invlist1: @@ -7393,9 +7393,9 @@ withlist1: } void setpickup(Context & context) { - context._cmp(context.data.byte(101), 1); + context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto cantpick; - context._cmp(context.data.byte(101), 3); + context._cmp(context.data.byte(kObjecttype), 3); if (context.flags.z()) goto cantpick; getanyad(context); context.al = context.es.byte(context.bx+2); @@ -7405,18 +7405,18 @@ cantpick: blank(context); return; canpick: - context._cmp(context.data.byte(99), 209); + context._cmp(context.data.byte(kCommandtype), 209); if (context.flags.z()) goto alreadysp; - context.data.byte(99) = 209; - context.bl = context.data.byte(98); - context.bh = context.data.byte(101); + context.data.byte(kCommandtype) = 209; + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kObjecttype); context.al = 33; commandwithob(context); alreadysp: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) goto nosetpick; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto dosetpick; nosetpick: return; @@ -7426,16 +7426,16 @@ dosetpick: showman(context); showexit(context); examicon(context); - context.data.byte(105) = 1; - context.data.byte(103) = 2; - context._cmp(context.data.byte(101), 4); + context.data.byte(kPickup) = 1; + context.data.byte(kInvopen) = 2; + context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto pickupexob; - context.al = context.data.byte(98); - context.data.byte(88) = context.al; - context.data.byte(109) = 255; + context.al = context.data.byte(kCommand); + context.data.byte(kItemframe) = context.al; + context.data.byte(kOpenedob) = 255; transfertoex(context); - context.data.byte(88) = context.al; - context.data.byte(101) = 4; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = 4; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; @@ -7443,22 +7443,22 @@ dosetpick: worktoscreenm(context); return; pickupexob: - context.al = context.data.byte(98); - context.data.byte(88) = context.al; - context.data.byte(109) = 255; + context.al = context.data.byte(kCommand); + context.data.byte(kItemframe) = context.al; + context.data.byte(kOpenedob) = 255; openinv(context); worktoscreenm(context); return; } void examinventory(Context & context) { - context._cmp(context.data.byte(99), 249); + context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadyexinv; - context.data.byte(99) = 249; + context.data.byte(kCommandtype) = 249; context.al = 32; commandonly(context); alreadyexinv: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; return; @@ -7468,8 +7468,8 @@ doexinv: showman(context); showexit(context); examicon(context); - context.data.byte(105) = 0; - context.data.byte(103) = 2; + context.data.byte(kPickup) = 0; + context.data.byte(kInvopen) = 2; openinv(context); worktoscreenm(context); return; @@ -7478,10 +7478,10 @@ doexinv: void reexfrominv(Context & context) { findinvpos(context); context.ax = context.es.word(context.bx); - context.data.byte(99) = context.ah; - context.data.byte(98) = context.al; - context.data.byte(107) = 1; - context.data.byte(233) = 0; + context.data.byte(kCommandtype) = context.ah; + context.data.byte(kCommand) = context.al; + context.data.byte(kExamagain) = 1; + context.data.byte(kPointermode) = 0; return; } @@ -7489,62 +7489,62 @@ void reexfromopen(Context & context) { return; findopenpos(context); context.ax = context.es.word(context.bx); - context.data.byte(99) = context.ah; - context.data.byte(98) = context.al; - context.data.byte(107) = 1; - context.data.byte(233) = 0; + context.data.byte(kCommandtype) = context.ah; + context.data.byte(kCommand) = context.al; + context.data.byte(kExamagain) = 1; + context.data.byte(kPointermode) = 0; return; } void swapwithinv(Context & context) { - context.al = context.data.byte(88); - context.ah = context.data.byte(101); - context._cmp(context.ax, context.data.word(92)); + context.al = context.data.byte(kItemframe); + context.ah = context.data.byte(kObjecttype); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub7; - context._cmp(context.data.byte(99), 243); + context._cmp(context.data.byte(kCommandtype), 243); if (context.flags.z()) goto alreadyswap1; - context.data.byte(99) = 243; + context.data.byte(kCommandtype) = 243; difsub7: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap1: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto cantswap1; context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: return; doswap1: - context.ah = context.data.byte(101); - context.al = context.data.byte(88); + context.ah = context.data.byte(kObjecttype); + context.al = context.data.byte(kItemframe); context.push(context.ax); findinvpos(context); context.ax = context.es.word(context.bx); - context.data.byte(88) = context.al; - context.data.byte(101) = context.ah; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = context.ah; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; - context.bl = context.data.byte(88); - context.bh = context.data.byte(101); + context.bl = context.data.byte(kItemframe); + context.bh = context.data.byte(kObjecttype); context.ax = context.pop(); - context.data.byte(101) = context.ah; - context.data.byte(88) = context.al; + context.data.byte(kObjecttype) = context.ah; + context.data.byte(kItemframe) = context.al; context.push(context.bx); findinvpos(context); delpointer(context); - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); geteitherad(context); context.es.byte(context.bx+2) = 4; context.es.byte(context.bx+3) = 255; - context.al = context.data.byte(106); + context.al = context.data.byte(kLastinvpos); context.es.byte(context.bx+4) = context.al; context.ax = context.pop(); - context.data.byte(101) = context.ah; - context.data.byte(88) = context.al; + context.data.byte(kObjecttype) = context.ah; + context.data.byte(kItemframe) = context.al; fillryan(context); readmouse(context); showpointer(context); @@ -7554,21 +7554,21 @@ doswap1: } void swapwithopen(Context & context) { - context.al = context.data.byte(88); - context.ah = context.data.byte(101); - context._cmp(context.ax, context.data.word(92)); + context.al = context.data.byte(kItemframe); + context.ah = context.data.byte(kObjecttype); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub8; - context._cmp(context.data.byte(99), 242); + context._cmp(context.data.byte(kCommandtype), 242); if (context.flags.z()) goto alreadyswap2; - context.data.byte(99) = 242; + context.data.byte(kCommandtype) = 242; difsub8: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 34; commandwithob(context); alreadyswap2: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto cantswap2; context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; @@ -7582,11 +7582,11 @@ doswap2: return; notwornswap: delpointer(context); - context.al = context.data.byte(88); - context._cmp(context.al, context.data.byte(109)); + context.al = context.data.byte(kItemframe); + context._cmp(context.al, context.data.byte(kOpenedob)); if (!context.flags.z()) goto isntsame2; - context.al = context.data.byte(101); - context._cmp(context.al, context.data.byte(110)); + context.al = context.data.byte(kObjecttype); + context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame2; errormessage1(context); return; @@ -7596,13 +7596,13 @@ isntsame2: if (context.flags.z()) goto sizeok2; return; sizeok2: - context.ah = context.data.byte(101); - context.al = context.data.byte(88); + context.ah = context.data.byte(kObjecttype); + context.al = context.data.byte(kItemframe); context.push(context.ax); findopenpos(context); context.ax = context.es.word(context.bx); - context.data.byte(88) = context.al; - context.data.byte(101) = context.ah; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeswapex; geteitherad(context); @@ -7611,31 +7611,31 @@ sizeok2: goto actuallyswap; makeswapex: transfertoex(context); - context.data.byte(88) = context.al; - context.data.byte(101) = 4; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = 4; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; actuallyswap: - context.bl = context.data.byte(88); - context.bh = context.data.byte(101); + context.bl = context.data.byte(kItemframe); + context.bh = context.data.byte(kObjecttype); context.ax = context.pop(); - context.data.byte(101) = context.ah; - context.data.byte(88) = context.al; + context.data.byte(kObjecttype) = context.ah; + context.data.byte(kItemframe) = context.al; context.push(context.bx); findopenpos(context); geteitherad(context); - context.al = context.data.byte(110); + context.al = context.data.byte(kOpenedtype); context.es.byte(context.bx+2) = context.al; - context.al = context.data.byte(109); + context.al = context.data.byte(kOpenedob); context.es.byte(context.bx+3) = context.al; - context.al = context.data.byte(106); + context.al = context.data.byte(kLastinvpos); context.es.byte(context.bx+4) = context.al; - context.al = context.data.byte(183); + context.al = context.data.byte(kReallocation); context.es.byte(context.bx+5) = context.al; context.ax = context.pop(); - context.data.byte(101) = context.ah; - context.data.byte(88) = context.al; + context.data.byte(kObjecttype) = context.ah; + context.data.byte(kItemframe) = context.al; fillopen(context); fillryan(context); undertextline(context); @@ -7648,7 +7648,7 @@ actuallyswap: } void intoinv(Context & context) { - context._cmp(context.data.byte(105), 0); + context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout; outofinv(context); return; @@ -7660,21 +7660,21 @@ notout: swapwithinv(context); return; canplace1: - context.al = context.data.byte(88); - context.ah = context.data.byte(101); - context._cmp(context.ax, context.data.word(92)); + context.al = context.data.byte(kItemframe); + context.ah = context.data.byte(kObjecttype); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub1; - context._cmp(context.data.byte(99), 220); + context._cmp(context.data.byte(kCommandtype), 220); if (context.flags.z()) goto alreadyplce; - context.data.byte(99) = 220; + context.data.byte(kCommandtype) = 220; difsub1: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplce: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notletgo2; context._and(context.ax, 1); if (!context.flags.z()) goto doplace; @@ -7682,13 +7682,13 @@ notletgo2: return; doplace: delpointer(context); - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); getexad(context); context.es.byte(context.bx+2) = 4; context.es.byte(context.bx+3) = 255; - context.al = context.data.byte(106); + context.al = context.data.byte(kLastinvpos); context.es.byte(context.bx+4) = context.al; - context.data.byte(105) = 0; + context.data.byte(kPickup) = 0; fillryan(context); readmouse(context); showpointer(context); @@ -7699,9 +7699,9 @@ doplace: } void deletetaken(Context & context) { - context.es = context.data.word(424); - context.ah = context.data.byte(183); - context.ds = context.data.word(396); + context.es = context.data.word(kFreedat); + context.ah = context.data.byte(kReallocation); + context.ds = context.data.word(kExtras); context.si = 0+2080+30000; context.cx = 114; takenloop: @@ -7729,25 +7729,25 @@ void outofinv(Context & context) { blank(context); return; canpick2: - context.bx = context.data.word(200); + context.bx = context.data.word(kMousebutton); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); return; canpick2a: - context._cmp(context.ax, context.data.word(92)); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub3; - context._cmp(context.data.byte(99), 221); + context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadygrab; - context.data.byte(99) = 221; + context.data.byte(kCommandtype) = 221; difsub3: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrab: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notletgo; context._and(context.ax, 1); if (!context.flags.z()) goto dograb; @@ -7755,11 +7755,11 @@ notletgo: return; dograb: delpointer(context); - context.data.byte(105) = 1; + context.data.byte(kPickup) = 1; findinvpos(context); context.ax = context.es.word(context.bx); - context.data.byte(88) = context.al; - context.data.byte(101) = context.ah; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = context.ah; getexad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; @@ -7777,7 +7777,7 @@ void getfreead(Context & context) { context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; - context.es = context.data.word(424); + context.es = context.data.word(kFreedat); return; } @@ -7786,39 +7786,39 @@ void getexad(Context & context) { context.bx = 16; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context._add(context.bx, 0+2080+30000); return; } void geteitherad(Context & context) { - context._cmp(context.data.byte(101), 4); + context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isinexlist; - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); getfreead(context); return; isinexlist: - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); getexad(context); return; } void getanyad(Context & context) { - context._cmp(context.data.byte(101), 4); + context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isex; - context._cmp(context.data.byte(101), 2); + context._cmp(context.data.byte(kObjecttype), 2); if (context.flags.z()) goto isfree; - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); getsetad(context); context.ax = context.es.word(context.bx+4); return; isfree: - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); getfreead(context); context.ax = context.es.word(context.bx+7); return; isex: - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); getexad(context); context.ax = context.es.word(context.bx+7); return; @@ -7840,21 +7840,21 @@ isex3: } void getopenedsize(Context & context) { - context._cmp(context.data.byte(110), 4); + context._cmp(context.data.byte(kOpenedtype), 4); if (context.flags.z()) goto isex2; - context._cmp(context.data.byte(110), 2); + context._cmp(context.data.byte(kOpenedtype), 2); if (context.flags.z()) goto isfree2; - context.al = context.data.byte(109); + context.al = context.data.byte(kOpenedob); getsetad(context); context.ax = context.es.word(context.bx+3); return; isfree2: - context.al = context.data.byte(109); + context.al = context.data.byte(kOpenedob); getfreead(context); context.ax = context.es.word(context.bx+7); return; isex2: - context.al = context.data.byte(109); + context.al = context.data.byte(kOpenedob); getexad(context); context.ax = context.es.word(context.bx+7); return; @@ -7865,40 +7865,40 @@ void getsetad(Context & context) { context.bx = 64; context._mul(context.bx); context.bx = context.ax; - context.es = context.data.word(426); + context.es = context.data.word(kSetdat); return; } void findinvpos(Context & context) { - context.cx = context.data.word(196); + context.cx = context.data.word(kMousex); context._sub(context.cx, 80); context.bx = -1; findinv1: context._add(context.bx, 1); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv1; - context.cx = context.data.word(198); + context.cx = context.data.word(kMousey); context._sub(context.cx, 58); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); context._sub(context.cx, 44); if (!context.flags.c()) goto findinv2; - context.al = context.data.byte(18); + context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 10; context._mul(context.cx); context._add(context.bx, context.ax); context.al = context.bl; - context.data.byte(106) = context.al; + context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context._add(context.bx, 0+(228*13)+32); return; } void findopenpos(Context & context) { - context.cx = context.data.word(196); + context.cx = context.data.word(kMousex); context._sub(context.cx, 80); context.bx = -1; findopenp1: @@ -7906,26 +7906,26 @@ findopenp1: context._sub(context.cx, 44); if (!context.flags.c()) goto findopenp1; context.al = context.bl; - context.data.byte(106) = context.al; + context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context._add(context.bx, 0+(228*13)); return; } void dropobject(Context & context) { - context._cmp(context.data.byte(99), 223); + context._cmp(context.data.byte(kCommandtype), 223); if (context.flags.z()) goto alreadydrop; - context.data.byte(99) = 223; - context._cmp(context.data.byte(105), 0); + context.data.byte(kCommandtype) = 223; + context._cmp(context.data.byte(kPickup), 0); if (context.flags.z()) { blank(context); return; }; - context.bl = context.data.byte(88); - context.bh = context.data.byte(101); + context.bl = context.data.byte(kItemframe); + context.bh = context.data.byte(kObjecttype); context.al = 37; commandwithob(context); alreadydrop: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodrop; context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; @@ -7938,11 +7938,11 @@ dodrop: wornerror(context); return; nowornerror: - context._cmp(context.data.byte(183), 47); + context._cmp(context.data.byte(kReallocation), 47); if (context.flags.z()) goto nodrop2; - context.cl = context.data.byte(150); + context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); - context.ch = context.data.byte(151); + context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); @@ -7951,14 +7951,14 @@ nodrop2: droperror(context); return; nodroperror: - context._cmp(context.data.byte(127), 64); + context._cmp(context.data.byte(kMapxsize), 64); if (!context.flags.z()) goto notinlift; - context._cmp(context.data.byte(128), 64); + context._cmp(context.data.byte(kMapysize), 64); if (!context.flags.z()) goto notinlift; droperror(context); return; notinlift: - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); context.ah = 4; context.cl = 'G'; context.ch = 'U'; @@ -7966,7 +7966,7 @@ notinlift: context.dh = 'A'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); context.ah = 4; context.cl = 'S'; context.ch = 'H'; @@ -7974,38 +7974,38 @@ notinlift: context.dh = 'D'; compare(context); if (context.flags.z()) { cantdrop(context); return; }; - context.data.byte(101) = 4; - context.al = context.data.byte(88); + context.data.byte(kObjecttype) = 4; + context.al = context.data.byte(kItemframe); getexad(context); context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(150); + context.al = context.data.byte(kRyanx); context._add(context.al, 4); context.cl = 4; context._shr(context.al, context.cl); - context._add(context.al, context.data.byte(147)); - context.ah = context.data.byte(151); + context._add(context.al, context.data.byte(kMapx)); + context.ah = context.data.byte(kRyany); context._add(context.ah, 8); context.cl = 4; context._shr(context.ah, context.cl); - context._add(context.ah, context.data.byte(148)); + context._add(context.ah, context.data.byte(kMapy)); context.es.byte(context.bx+3) = context.al; context.es.byte(context.bx+5) = context.ah; - context.al = context.data.byte(150); + context.al = context.data.byte(kRyanx); context._add(context.al, 4); context._and(context.al, 15); - context.ah = context.data.byte(151); + context.ah = context.data.byte(kRyany); context._add(context.ah, 8); context._and(context.ah, 15); context.es.byte(context.bx+4) = context.al; context.es.byte(context.bx+6) = context.ah; - context.data.byte(105) = 0; - context.al = context.data.byte(183); + context.data.byte(kPickup) = 0; + context.al = context.data.byte(kReallocation); context.es.byte(context.bx) = context.al; return; } void droperror(Context & context) { - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8018,13 +8018,13 @@ void droperror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; worktoscreenm(context); return; } void cantdrop(Context & context) { - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8037,13 +8037,13 @@ void cantdrop(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; worktoscreenm(context); return; } void wornerror(Context & context) { - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8056,17 +8056,17 @@ void wornerror(Context & context) { showpanel(context); showman(context); examicon(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; worktoscreenm(context); return; } void removeobfrominv(Context & context) { - context._cmp(context.data.byte(98), 100); + context._cmp(context.data.byte(kCommand), 100); if (context.flags.z()) goto obnotexist; getanyad(context); context.di = context.bx; - context.cl = context.data.byte(98); + context.cl = context.data.byte(kCommand); context.ch = 0; deleteexobject(context); obnotexist: @@ -8074,33 +8074,33 @@ obnotexist: } void selectopenob(Context & context) { - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); return; canopenit1: - context._cmp(context.data.byte(99), 224); + context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyopob; - context.data.byte(99) = 224; - context.bl = context.data.byte(98); - context.bh = context.data.byte(101); + context.data.byte(kCommandtype) = 224; + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kObjecttype); context.al = 38; commandwithob(context); alreadyopob: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noopenob; context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: return; doopenob: - context.al = context.data.byte(98); - context.data.byte(109) = context.al; - context.al = context.data.byte(101); - context.data.byte(110) = context.al; + context.al = context.data.byte(kCommand); + context.data.byte(kOpenedob) = context.al; + context.al = context.data.byte(kObjecttype); + context.data.byte(kOpenedtype) = context.al; createpanel(context); showpanel(context); showman(context); @@ -8117,9 +8117,9 @@ doopenob: } void useopened(Context & context) { - context._cmp(context.data.byte(109), 255); + context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cannotuseopen; - context._cmp(context.data.byte(105), 0); + context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout2; outofopen(context); return; @@ -8132,26 +8132,26 @@ notout2: cannotuseopen: return; canplace3: - context._cmp(context.data.byte(105), 1); + context._cmp(context.data.byte(kPickup), 1); if (context.flags.z()) goto intoopen; blank(context); return; intoopen: - context.al = context.data.byte(88); - context.ah = context.data.byte(101); - context._cmp(context.ax, context.data.word(92)); + context.al = context.data.byte(kItemframe); + context.ah = context.data.byte(kObjecttype); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub2; - context._cmp(context.data.byte(99), 227); + context._cmp(context.data.byte(kCommandtype), 227); if (context.flags.z()) goto alreadyplc2; - context.data.byte(99) = 227; + context.data.byte(kCommandtype) = 227; difsub2: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 35; commandwithob(context); alreadyplc2: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notletgo3; context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; @@ -8165,11 +8165,11 @@ doplace2: return; notworntoopen: delpointer(context); - context.al = context.data.byte(88); - context._cmp(context.al, context.data.byte(109)); + context.al = context.data.byte(kItemframe); + context._cmp(context.al, context.data.byte(kOpenedob)); if (!context.flags.z()) goto isntsame; - context.al = context.data.byte(101); - context._cmp(context.al, context.data.byte(110)); + context.al = context.data.byte(kObjecttype); + context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame; errormessage1(context); return; @@ -8179,16 +8179,16 @@ isntsame: if (context.flags.z()) goto sizeok1; return; sizeok1: - context.data.byte(105) = 0; - context.al = context.data.byte(88); + context.data.byte(kPickup) = 0; + context.al = context.data.byte(kItemframe); geteitherad(context); - context.al = context.data.byte(110); + context.al = context.data.byte(kOpenedtype); context.es.byte(context.bx+2) = context.al; - context.al = context.data.byte(109); + context.al = context.data.byte(kOpenedob); context.es.byte(context.bx+3) = context.al; - context.al = context.data.byte(106); + context.al = context.data.byte(kLastinvpos); context.es.byte(context.bx+4) = context.al; - context.al = context.data.byte(183); + context.al = context.data.byte(kReallocation); context.es.byte(context.bx+5) = context.al; fillopen(context); undertextline(context); @@ -8225,7 +8225,7 @@ void errormessage1(Context & context) { } void errormessage2(Context & context) { - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; context.bx = 21; @@ -8273,7 +8273,7 @@ void errormessage3(Context & context) { void checkobjectsize(Context & context) { getopenedsize(context); context.push(context.ax); - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); geteitherad(context); context.al = context.es.byte(context.bx+9); context.cx = context.pop(); @@ -8312,7 +8312,7 @@ sizeok: } void outofopen(Context & context) { - context._cmp(context.data.byte(109), 255); + context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); context.ax = context.es.word(context.bx); @@ -8322,19 +8322,19 @@ cantuseopen: blank(context); return; canpick4: - context._cmp(context.ax, context.data.word(92)); + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub4; - context._cmp(context.data.byte(99), 228); + context._cmp(context.data.byte(kCommandtype), 228); if (context.flags.z()) goto alreadygrb; - context.data.byte(99) = 228; + context.data.byte(kCommandtype) = 228; difsub4: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 36; commandwithob(context); alreadygrb: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notletgo4; context._cmp(context.ax, 1); if (context.flags.z()) goto dogrb; @@ -8345,11 +8345,11 @@ notletgo4: return; dogrb: delpointer(context); - context.data.byte(105) = 1; + context.data.byte(kPickup) = 1; findopenpos(context); context.ax = context.es.word(context.bx); - context.data.byte(88) = context.al; - context.data.byte(101) = context.ah; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = context.ah; context._cmp(context.ah, 4); if (!context.flags.z()) goto makeintoex; geteitherad(context); @@ -8358,8 +8358,8 @@ dogrb: goto actuallyout; makeintoex: transfertoex(context); - context.data.byte(88) = context.al; - context.data.byte(101) = 4; + context.data.byte(kItemframe) = context.al; + context.data.byte(kObjecttype) = 4; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; @@ -8377,37 +8377,37 @@ actuallyout: void transfertoex(Context & context) { emergencypurge(context); getexpos(context); - context.al = context.data.byte(9); + context.al = context.data.byte(kExpos); context.push(context.ax); context.push(context.di); - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(424); + context.ds = context.data.word(kFreedat); context.si = context.ax; context.cx = 8; while(--context.cx) context._movsw(); context.di = context.pop(); - context.al = context.data.byte(183); + context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; context.es.byte(context.di+11) = context.al; - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); context.es.byte(context.di+1) = context.al; context.es.byte(context.di+2) = 4; context.es.byte(context.di+3) = 255; - context.al = context.data.byte(106); + context.al = context.data.byte(kLastinvpos); context.es.byte(context.di+4) = context.al; - context.al = context.data.byte(88); - context.data.byte(89) = context.al; + context.al = context.data.byte(kItemframe); + context.data.byte(kItemtotran) = context.al; transfermap(context); transferinv(context); transfertext(context); - context.al = context.data.byte(88); + context.al = context.data.byte(kItemframe); context.ah = 0; context.bx = 16; context._mul(context.bx); - context.ds = context.data.word(424); + context.ds = context.data.word(kFreedat); context.si = context.ax; context.ds.byte(context.si+2) = 254; pickupconts(context); @@ -8419,10 +8419,10 @@ void pickupconts(Context & context) { context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; - context.al = context.data.byte(88); - context.ah = context.data.byte(101); - context.dl = context.data.byte(9); - context.es = context.data.word(424); + context.al = context.data.byte(kItemframe); + context.ah = context.data.byte(kObjecttype); + context.dl = context.data.byte(kExpos); + context.es = context.data.word(kFreedat); context.bx = 0; context.cx = 0; pickupcontloop: @@ -8435,7 +8435,7 @@ pickupcontloop: if (!context.flags.z()) goto notinsidethis; context._cmp(context.es.byte(context.bx+3), context.al); if (!context.flags.z()) goto notinsidethis; - context.data.byte(89) = context.cl; + context.data.byte(kItemtotran) = context.cl; transfercontoex(context); notinsidethis: context.ax = context.pop(); @@ -8465,10 +8465,10 @@ void transfercontoex(Context & context) { while(--context.cx) context._movsw(); context.di = context.pop(); context.dx = context.pop(); - context.al = context.data.byte(183); + context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; context.es.byte(context.di+11) = context.al; - context.al = context.data.byte(89); + context.al = context.data.byte(kItemtotran); context.es.byte(context.di+1) = context.al; context.es.byte(context.di+3) = context.dl; context.es.byte(context.di+2) = 4; @@ -8482,19 +8482,19 @@ void transfercontoex(Context & context) { } void transfertext(Context & context) { - context.es = context.data.word(396); - context.al = context.data.byte(9); + context.es = context.data.word(kExtras); + context.al = context.data.byte(kExpos); context.ah = 0; context._add(context.ax, context.ax); context.bx = 0+2080+30000+(16*114); context._add(context.bx, context.ax); - context.di = context.data.word(12); + context.di = context.data.word(kExtextpos); context.es.word(context.bx) = context.di; context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); - context.al = context.data.byte(89); + context.al = context.data.byte(kItemtotran); context.ah = 0; context._add(context.ax, context.ax); - context.ds = context.data.word(436); + context.ds = context.data.word(kFreedesc); context.bx = 0; context._add(context.bx, context.ax); context.si = 0+(82*2); @@ -8503,14 +8503,14 @@ void transfertext(Context & context) { moretext: context._lodsb(); context._stosb(); - context._add(context.data.word(12), 1); + context._add(context.data.word(kExtextpos), 1); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; return; } void getexpos(Context & context) { - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.al = 0; context.di = 0+2080+30000; tryanotherex: @@ -8521,13 +8521,13 @@ tryanotherex: context._cmp(context.al, 114); if (!context.flags.z()) goto tryanotherex; foundnewex: - context.data.byte(9) = context.al; + context.data.byte(kExpos) = context.al; return; } void purgealocation(Context & context) { context.push(context.ax); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.di = 0+2080+30000; context.bx = context.pop(); context.cx = 0; @@ -8555,14 +8555,14 @@ dontpurge: void emergencypurge(Context & context) { checkpurgeagain: - context.ax = context.data.word(10); + context.ax = context.data.word(kExframepos); context._add(context.ax, 4000); context._cmp(context.ax, 30000); if (context.flags.c()) goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: - context.ax = context.data.word(12); + context.ax = context.data.word(kExtextpos); context._add(context.ax, 400); context._cmp(context.ax, 18000); if (context.flags.c()) goto notneartextend; @@ -8573,9 +8573,9 @@ notneartextend: } void purgeanitem(Context & context) { - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.di = 0+2080+30000; - context.bl = context.data.byte(183); + context.bl = context.data.byte(kReallocation); context.cx = 0; lookforpurge: context.al = context.es.byte(context.di+2); @@ -8596,7 +8596,7 @@ cantpurge: context._cmp(context.cx, 114); if (!context.flags.z()) goto lookforpurge; context.di = 0+2080+30000; - context.bl = context.data.byte(183); + context.bl = context.data.byte(kReallocation); context.cx = 0; lookforpurge2: context.al = context.es.byte(context.di+2); @@ -8681,7 +8681,7 @@ void deleteexframe(Context & context) { context.ds = context.es; while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(10), context.bx); + context._sub(context.data.word(kExframepos), context.bx); context.si = context.pop(); context.cx = 114*3; context.di = 0; @@ -8722,7 +8722,7 @@ findlenextext: context._sub(context.cx, context.bx); while(--context.cx) context._movsb(); context.bx = context.pop(); - context._sub(context.data.word(12), context.bx); + context._sub(context.data.word(kExtextpos), context.bx); context.si = context.pop(); context.cx = 114; context.di = 0+2080+30000+(16*114); @@ -8741,7 +8741,7 @@ beforethistext: void blockget(Context & context) { context.ah = context.al; context.al = 0; - context.ds = context.data.word(414); + context.ds = context.data.word(kBackdrop); context.si = 0+192; context._add(context.si, context.ax); return; @@ -8759,7 +8759,7 @@ void drawfloor(Context & context) { showallex(context); paneltomap(context); initrain(context); - context.data.byte(61) = 0; + context.data.byte(kNewobs) = 0; context.bx = context.pop(); context.es = context.pop(); return; @@ -8776,8 +8776,8 @@ void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(119)); - context.data.word(115) = context.ax; + context._add(context.ax, context.data.word(kMapoffsetx)); + context.data.word(kMapadx) = context.ax; context.dx = context.pop(); context.cx = context.pop(); context.al = 10; @@ -8787,13 +8787,13 @@ void calcmapad(Context & context) { context.ax.cbw(); context.bx = 8; context._mul(context.bx); - context._add(context.ax, context.data.word(121)); - context.data.word(117) = context.ax; + context._add(context.ax, context.data.word(kMapoffsety)); + context.data.word(kMapady) = context.ax; return; } void getdimension(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32); context.ch = 0; dimloop1: @@ -8845,14 +8845,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(123) = context.ax; + context.data.word(kMapxstart) = context.ax; context.al = context.ch; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.word(125) = context.ax; + context.data.word(kMapystart) = context.ax; context._sub(context.dl, context.cl); context._sub(context.dh, context.ch); context.al = context.dl; @@ -8861,14 +8861,14 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(127) = context.al; + context.data.byte(kMapxsize) = context.al; context.al = context.dh; context.ah = 0; context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); context._shl(context.ax, 1); - context.data.byte(128) = context.al; + context.data.byte(kMapysize) = context.al; return; } @@ -8903,13 +8903,13 @@ gotlength: } void drawflags(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32); - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.ah = 0; context.cx = 66; context._mul(context.cx); - context.bl = context.data.byte(147); + context.bl = context.data.byte(kMapx); context.bh = 0; context._add(context.ax, context.bx); context.si = 0; @@ -8919,9 +8919,9 @@ _tmp28: context.push(context.cx); context.cx = 11; _tmp28a: - context.ds = context.data.word(416); + context.ds = context.data.word(kMapdata); context._lodsb(); - context.ds = context.data.word(414); + context.ds = context.data.word(kBackdrop); context.push(context.si); context.push(context.ax); context.ah = 0; @@ -8940,9 +8940,9 @@ _tmp28a: } void eraseoldobs(Context & context) { - context._cmp(context.data.byte(61), 0); + context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; context.cx = 16; oberase: @@ -8965,21 +8965,21 @@ donterase: } void showallobs(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); - context.data.word(16) = context.bx; + context.data.word(kListpos) = context.bx; context.di = context.bx; context.cx = 128*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(442); - context.data.word(164) = context.es; + context.es = context.data.word(kSetframes); + context.data.word(kFrsegment) = context.es; context.ax = 0; - context.data.word(162) = context.ax; + context.data.word(kDataad) = context.ax; context.ax = 0+2080; - context.data.word(160) = context.ax; - context.data.byte(180) = 0; - context.ds = context.data.word(426); + context.data.word(kFramesad) = context.ax; + context.data.byte(kCurrentob) = 0; + context.ds = context.data.word(kSetdat); context.si = 0; context.cx = 128; showobsloop: @@ -8987,14 +8987,14 @@ showobsloop: context.push(context.si); context.push(context.si); context._add(context.si, 58); - context.es = context.data.word(426); + context.es = context.data.word(kSetdat); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankframe; context.al = context.es.byte(context.si+18); context.ah = 0; - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; context._cmp(context.al, 255); if (context.flags.z()) goto blankframe; context.push(context.es); @@ -9011,31 +9011,31 @@ showobsloop: if (context.flags.z()) goto animating; context._cmp(context.es.byte(context.si+5), 6); if (context.flags.z()) goto animating; - context.ax = context.data.word(158); + context.ax = context.data.word(kCurrentframe); context.ah = 0; - context._add(context.di, context.data.word(115)); - context._add(context.bx, context.data.word(117)); + context._add(context.di, context.data.word(kMapadx)); + context._add(context.bx, context.data.word(kMapady)); showframe(context); goto drawnsetob; animating: makebackob(context); drawnsetob: - context.si = context.data.word(16); - context.es = context.data.word(410); - context.al = context.data.byte(178); - context.ah = context.data.byte(179); + context.si = context.data.word(kListpos); + context.es = context.data.word(kBuffers); + context.al = context.data.byte(kSavex); + context.ah = context.data.byte(kSavey); context.es.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(174); + context.ax = context.data.word(kSavesize); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.es.word(context.si+2) = context.ax; - context.al = context.data.byte(180); + context.al = context.data.byte(kCurrentob); context.es.byte(context.si+4) = context.al; context._add(context.si, 5); - context.data.word(16) = context.si; + context.data.word(kListpos) = context.si; blankframe: - context._add(context.data.byte(180), 1); + context._add(context.data.byte(kCurrentob), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 64); @@ -9047,19 +9047,19 @@ finishedsetobs: } void makebackob(Context & context) { - context._cmp(context.data.byte(61), 0); + context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto nomake; context.al = context.es.byte(context.si+5); context.ah = context.es.byte(context.si+8); context.push(context.si); context.push(context.ax); context.push(context.si); - context.ax = context.data.word(166); - context.bx = context.data.word(168); + context.ax = context.data.word(kObjectx); + context.bx = context.data.word(kObjecty); context.ah = context.bl; context.si = context.ax; context.cx = 49520; - context.dx = context.data.word(442); + context.dx = context.data.word(kSetframes); context.di = 0; makesprite(context); context.ax = context.pop(); @@ -9080,61 +9080,61 @@ nomake: } void showallfree(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); - context.data.word(16) = context.bx; + context.data.word(kListpos) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); context.cx = 80*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(444); - context.data.word(164) = context.es; + context.es = context.data.word(kFreeframes); + context.data.word(kFrsegment) = context.es; context.ax = 0; - context.data.word(162) = context.ax; + context.data.word(kDataad) = context.ax; context.ax = 0+2080; - context.data.word(160) = context.ax; + context.data.word(kFramesad) = context.ax; context.al = 0; - context.data.byte(157) = context.al; - context.ds = context.data.word(424); + context.data.byte(kCurrentfree) = context.al; + context.ds = context.data.word(kFreedat); context.si = 2; context.cx = 0; loop127: context.push(context.cx); context.push(context.si); context.push(context.si); - context.es = context.data.word(424); + context.es = context.data.word(kFreedat); getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto over138; - context.al = context.data.byte(157); + context.al = context.data.byte(kCurrentfree); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(400); - context.ds = context.data.word(164); + context.es = context.data.word(kMapstore); + context.ds = context.data.word(kFrsegment); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto over138; - context.ax = context.data.word(158); + context.ax = context.data.word(kCurrentframe); context.ah = 0; - context._add(context.di, context.data.word(115)); - context._add(context.bx, context.data.word(117)); + context._add(context.di, context.data.word(kMapadx)); + context._add(context.bx, context.data.word(kMapady)); showframe(context); - context.si = context.data.word(16); - context.es = context.data.word(410); - context.al = context.data.byte(178); - context.ah = context.data.byte(179); + context.si = context.data.word(kListpos); + context.es = context.data.word(kBuffers); + context.al = context.data.byte(kSavex); + context.ah = context.data.byte(kSavey); context.es.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(174); + context.ax = context.data.word(kSavesize); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.es.word(context.si+2) = context.ax; @@ -9144,9 +9144,9 @@ loop127: context.push(context.ax); context.es.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(16) = context.si; + context.data.word(kListpos) = context.si; over138: - context._add(context.data.byte(157), 1); + context._add(context.data.byte(kCurrentfree), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9159,66 +9159,66 @@ finfree: } void showallex(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); - context.data.word(16) = context.bx; + context.data.word(kListpos) = context.bx; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); context.cx = 100*5; context.al = 255; while(--context.cx) context._stosb(); - context.es = context.data.word(396); - context.data.word(164) = context.es; + context.es = context.data.word(kExtras); + context.data.word(kFrsegment) = context.es; context.ax = 0; - context.data.word(162) = context.ax; + context.data.word(kDataad) = context.ax; context.ax = 0+2080; - context.data.word(160) = context.ax; - context.data.byte(156) = 0; + context.data.word(kFramesad) = context.ax; + context.data.byte(kCurrentex) = 0; context.si = 0+2080+30000+2; context.cx = 0; exloop: context.push(context.cx); context.push(context.si); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.push(context.si); context.ch = 0; context._cmp(context.es.byte(context.si), 255); if (context.flags.z()) goto notinroom; context.al = context.es.byte(context.si-2); - context._cmp(context.al, context.data.byte(183)); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto notinroom; getmapad(context); notinroom: context.si = context.pop(); context._cmp(context.ch, 0); if (context.flags.z()) goto blankex; - context.al = context.data.byte(156); + context.al = context.data.byte(kCurrentex); context.ah = 0; context.dx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.dx); - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; context.push(context.es); context.push(context.si); calcfrframe(context); - context.es = context.data.word(400); - context.ds = context.data.word(164); + context.es = context.data.word(kMapstore); + context.ds = context.data.word(kFrsegment); finalframe(context); context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); if (context.flags.z()) goto blankex; - context.ax = context.data.word(158); + context.ax = context.data.word(kCurrentframe); context.ah = 0; - context._add(context.di, context.data.word(115)); - context._add(context.bx, context.data.word(117)); + context._add(context.di, context.data.word(kMapadx)); + context._add(context.bx, context.data.word(kMapady)); showframe(context); - context.si = context.data.word(16); - context.es = context.data.word(410); - context.al = context.data.byte(178); - context.ah = context.data.byte(179); + context.si = context.data.word(kListpos); + context.es = context.data.word(kBuffers); + context.al = context.data.byte(kSavex); + context.ah = context.data.byte(kSavey); context.es.word(context.si) = context.ax; context.cx = context.ax; - context.ax = context.data.word(174); + context.ax = context.data.word(kSavesize); context._add(context.al, context.cl); context._add(context.ah, context.ch); context.es.word(context.si+2) = context.ax; @@ -9228,9 +9228,9 @@ notinroom: context.push(context.ax); context.es.byte(context.si+4) = context.cl; context._add(context.si, 5); - context.data.word(16) = context.si; + context.data.word(kListpos) = context.si; blankex: - context._add(context.data.byte(156), 1); + context._add(context.data.byte(kCurrentex), 1); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); @@ -9243,11 +9243,11 @@ finex: } void calcfrframe(Context & context) { - context.dx = context.data.word(164); - context.ax = context.data.word(160); + context.dx = context.data.word(kFrsegment); + context.ax = context.data.word(kFramesad); context.push(context.ax); - context.cx = context.data.word(162); - context.ax = context.data.word(158); + context.cx = context.data.word(kDataad); + context.ax = context.data.word(kCurrentframe); context.ds = context.dx; context.bx = 6; context._mul(context.bx); @@ -9259,33 +9259,33 @@ void calcfrframe(Context & context) { context.bx = context.pop(); context.push(context.dx); context._add(context.ax, context.bx); - context.data.word(176) = context.ax; - context.data.word(174) = context.cx; + context.data.word(kSavesource) = context.ax; + context.data.word(kSavesize) = context.cx; context.ax = context.pop(); context.push(context.ax); context.ah = 0; - context.data.word(170) = context.ax; + context.data.word(kOffsetx) = context.ax; context.ax = context.pop(); context.al = context.ah; context.ah = 0; - context.data.word(172) = context.ax; + context.data.word(kOffsety) = context.ax; return; nullframe: context.ax = context.pop(); context.cx = 0; - context.data.word(174) = context.cx; + context.data.word(kSavesize) = context.cx; return; } void finalframe(Context & context) { - context.ax = context.data.word(168); - context._add(context.ax, context.data.word(172)); - context.bx = context.data.word(166); - context._add(context.bx, context.data.word(170)); - context.data.byte(178) = context.bl; - context.data.byte(179) = context.al; - context.di = context.data.word(166); - context.bx = context.data.word(168); + context.ax = context.data.word(kObjecty); + context._add(context.ax, context.data.word(kOffsety)); + context.bx = context.data.word(kObjectx); + context._add(context.bx, context.data.word(kOffsetx)); + context.data.byte(kSavex) = context.bl; + context.data.byte(kSavey) = context.al; + context.di = context.data.word(kObjectx); + context.bx = context.data.word(kObjecty); return; } @@ -9305,11 +9305,11 @@ void getmapad(Context & context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(166) = context.ax; + context.data.word(kObjectx) = context.ax; getyad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; - context.data.word(168) = context.ax; + context.data.word(kObjecty) = context.ax; context.ch = 1; over146: return; @@ -9324,7 +9324,7 @@ void getxad(Context & context) { context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; - context._sub(context.al, context.data.byte(147)); + context._sub(context.al, context.data.byte(kMapx)); if (context.flags.c()) goto over148; context._cmp(context.al, 11); if (!context.flags.c()) goto over148; @@ -9344,7 +9344,7 @@ void getyad(Context & context) { context._add(context.si, 1); context.ah = context.es.byte(context.si); context._add(context.si, 1); - context._sub(context.al, context.data.byte(148)); + context._sub(context.al, context.data.byte(kMapy)); if (context.flags.c()) goto over147; context._cmp(context.al, 10); if (!context.flags.c()) goto over147; @@ -9360,40 +9360,40 @@ over147: } void autolook(Context & context) { - context.ax = context.data.word(196); - context._cmp(context.ax, context.data.word(212)); + context.ax = context.data.word(kMousex); + context._cmp(context.ax, context.data.word(kOldx)); if (!context.flags.z()) goto diffmouse; - context.ax = context.data.word(198); - context._cmp(context.ax, context.data.word(214)); + context.ax = context.data.word(kMousey); + context._cmp(context.ax, context.data.word(kOldy)); if (!context.flags.z()) goto diffmouse; - context._sub(context.data.word(96), 1); - context._cmp(context.data.word(96), 0); + context._sub(context.data.word(kLookcounter), 1); + context._cmp(context.data.word(kLookcounter), 0); if (!context.flags.z()) goto noautolook; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noautolook; dolook(context); noautolook: return; diffmouse: - context.data.word(96) = 1000; + context.data.word(kLookcounter) = 1000; return; } void look(Context & context) { - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(233), 2); + context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 241); + context._cmp(context.data.byte(kCommandtype), 241); if (context.flags.z()) goto alreadylook; - context.data.byte(99) = 241; + context.data.byte(kCommandtype) = 241; context.al = 25; commandonly(context); alreadylook: - context._cmp(context.data.word(200), 1); + context._cmp(context.data.word(kMousebutton), 1); if (!context.flags.z()) goto nolook; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nolook; dolook(context); nolook: @@ -9405,19 +9405,19 @@ void dolook(Context & context) { showicon(context); undertextline(context); worktoscreenm(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; dumptextline(context); - context.bl = context.data.byte(184); + context.bl = context.data.byte(kRoomnum); context._and(context.bl, 31); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(434); + context.es = context.data.word(kRoomdesc); context._add(context.bx, 0); context.si = context.es.word(context.bx); context._add(context.si, 0+(38*2)); findnextcolon(context); context.di = 66; - context._cmp(context.data.byte(183), 50); + context._cmp(context.data.byte(kReallocation), 50); if (context.flags.c()) goto notdream3; context.di = 40; notdream3: @@ -9429,17 +9429,17 @@ notdream3: context.cx = 400; hangonp(context); afterlook: - context.data.byte(233) = 0; - context.data.byte(99) = 0; + context.data.byte(kPointermode) = 0; + context.data.byte(kCommandtype) = 0; redrawmainscrn(context); worktoscreenm(context); return; } void redrawmainscrn(Context & context) { - context.data.word(326) = 0; + context.data.word(kTimecount) = 0; createpanel(context); - context.data.byte(61) = 0; + context.data.byte(kNewobs) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -9447,40 +9447,40 @@ void redrawmainscrn(Context & context) { getunderzoom(context); undertextline(context); readmouse(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; return; } void getback1(Context & context) { - context._cmp(context.data.byte(105), 0); + context._cmp(context.data.byte(kPickup), 0); if (context.flags.z()) goto notgotobject; blank(context); return; notgotobject: - context._cmp(context.data.byte(99), 202); + context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadyget; - context.data.byte(99) = 202; + context.data.byte(kCommandtype) = 202; context.al = 26; commandonly(context); alreadyget: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nogetback; context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: return; dogetback: - context.data.byte(102) = 1; - context.data.byte(105) = 0; + context.data.byte(kGetback) = 1; + context.data.byte(kPickup) = 0; return; } void talk(Context & context) { - context.data.byte(245) = 0; - context.data.byte(236) = 0; - context.al = context.data.byte(98); - context.data.byte(246) = context.al; + context.data.byte(kTalkpos) = 0; + context.data.byte(kInmaparea) = 0; + context.al = context.data.byte(kCommand); + context.data.byte(kCharacter) = context.al; createpanel(context); showpanel(context); showman(context); @@ -9488,7 +9488,7 @@ void talk(Context & context) { undertextline(context); convicons(context); starttalk(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -9500,15 +9500,15 @@ waittalk: vsync(context); dumppointer(context); dumptextline(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; context.bx = 2660; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waittalk; finishtalk: - context.bx = context.data.word(247); + context.bx = context.data.word(kPersondata); context.es = context.cs; - context._cmp(context.data.byte(245), 4); + context._cmp(context.data.byte(kTalkpos), 4); if (context.flags.c()) goto notnexttalk; context.al = context.es.byte(context.bx+7); context._or(context.al, 128); @@ -9516,25 +9516,25 @@ finishtalk: notnexttalk: redrawmainscrn(context); worktoscreenm(context); - context._cmp(context.data.byte(382), 1); + context._cmp(context.data.byte(kSpeechloaded), 1); if (!context.flags.z()) goto nospeech; cancelch1(context); - context.data.byte(387) = -1; - context.data.byte(386) = 0; + context.data.byte(kVolumedirection) = -1; + context.data.byte(kVolumeto) = 0; nospeech: return; } void convicons(Context & context) { - context.al = context.data.byte(246); + context.al = context.data.byte(kCharacter); context._and(context.al, 127); getpersframe(context); context.di = 234; context.bx = 2; - context.data.word(158) = context.ax; + context.data.word(kCurrentframe) = context.ax; findsource(context); - context.ax = context.data.word(158); - context._sub(context.ax, context.data.word(242)); + context.ax = context.data.word(kCurrentframe); + context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 0; showframe(context); return; @@ -9544,25 +9544,25 @@ void getpersframe(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(446); + context.es = context.data.word(kPeople); context._add(context.bx, 0); context.ax = context.es.word(context.bx); return; } void starttalk(Context & context) { - context.data.byte(244) = 0; - context.al = context.data.byte(246); + context.data.byte(kTalkmode) = 0; + context.al = context.data.byte(kCharacter); context._and(context.al, 127); getpersontext(context); - context.data.word(69) = 91+91; + context.data.word(kCharshift) = 91+91; context.di = 66; context.bx = 64; context.dl = 241; context.al = 0; context.ah = 79; printdirect(context); - context.data.word(69) = 0; + context.data.word(kCharshift) = 0; context.di = 66; context.bx = 80; context.dl = 241; @@ -9578,7 +9578,7 @@ void getpersontext(Context & context) { context.cx = 64*2; context._mul(context.cx); context.si = context.ax; - context.es = context.data.word(446); + context.es = context.data.word(kPeople); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.es.word(context.si); @@ -9588,30 +9588,30 @@ void getpersontext(Context & context) { } void moretalk(Context & context) { - context._cmp(context.data.byte(244), 0); + context._cmp(context.data.byte(kTalkmode), 0); if (context.flags.z()) goto canmore; redes(context); return; canmore: - context._cmp(context.data.byte(99), 215); + context._cmp(context.data.byte(kCommandtype), 215); if (context.flags.z()) goto alreadymore; - context.data.byte(99) = 215; + context.data.byte(kCommandtype) = 215; context.al = 49; commandonly(context); alreadymore: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nomore; context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: return; domoretalk: - context.data.byte(244) = 2; - context.data.byte(245) = 4; - context._cmp(context.data.byte(246), 100); + context.data.byte(kTalkmode) = 2; + context.data.byte(kTalkpos) = 4; + context._cmp(context.data.byte(kCharacter), 100); if (context.flags.c()) goto notsecondpart; - context.data.byte(245) = 48; + context.data.byte(kTalkpos) = 48; notsecondpart: dosometalk(context); return; @@ -9619,19 +9619,19 @@ notsecondpart: void dosometalk(Context & context) { watchtalk: - context.al = context.data.byte(245); - context.al = context.data.byte(246); + context.al = context.data.byte(kTalkpos); + context.al = context.data.byte(kCharacter); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(245); + context.al = context.data.byte(kTalkpos); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(446); + context.es = context.data.word(kPeople); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.es.word(context.si); @@ -9654,24 +9654,24 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(233) = 3; + context.data.byte(kPointermode) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); - context._add(context.data.byte(245), 1); - context.al = context.data.byte(245); - context.al = context.data.byte(246); + context._add(context.data.byte(kTalkpos), 1); + context.al = context.data.byte(kTalkpos); + context.al = context.data.byte(kCharacter); context._and(context.al, 127); context.ah = 0; context.cx = 64; context._mul(context.cx); context.cx = context.ax; - context.al = context.data.byte(245); + context.al = context.data.byte(kTalkpos); context.ah = 0; context._add(context.ax, context.cx); context._add(context.ax, context.ax); context.si = context.ax; - context.es = context.data.word(446); + context.es = context.data.word(kPeople); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.es.word(context.si); @@ -9698,20 +9698,20 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(233) = 3; + context.data.byte(kPointermode) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); skiptalk: - context._add(context.data.byte(245), 1); + context._add(context.data.byte(kTalkpos), 1); goto watchtalk; endwatchtalk: - context.data.byte(233) = 0; + context.data.byte(kPointermode) = 0; return; } void hangonpq(Context & context) { - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; context.bx = 0; hangloopq: context.push(context.cx); @@ -9727,48 +9727,48 @@ hangloopq: checkcoords(context); context.bx = context.pop(); context.cx = context.pop(); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (context.flags.z()) goto quitconv; - context._cmp(context.data.byte(382), 1); + context._cmp(context.data.byte(kSpeechloaded), 1); if (!context.flags.z()) goto notspeaking; - context._cmp(context.data.byte(514), 255); + context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto notspeaking; context._add(context.bx, 1); context._cmp(context.bx, 40); if (context.flags.z()) goto finishconv; notspeaking: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto hangloopq; - context._cmp(context.data.word(210), 0); + context._cmp(context.data.word(kOldbutton), 0); if (!context.flags.z()) goto hangloopq; finishconv: delpointer(context); - context.data.byte(233) = 0; + context.data.byte(kPointermode) = 0; return; quitconv: delpointer(context); - context.data.byte(233) = 0; + context.data.byte(kPointermode) = 0; context.ax = context.pop(); cancelch1(context); return; } void redes(Context & context) { - context._cmp(context.data.byte(514), 255); + context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto cantredes; - context._cmp(context.data.byte(244), 2); + context._cmp(context.data.byte(kTalkmode), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); return; canredes: - context._cmp(context.data.byte(99), 217); + context._cmp(context.data.byte(kCommandtype), 217); if (context.flags.z()) goto alreadyreds; - context.data.byte(99) = 217; + context.data.byte(kCommandtype) = 217; context.al = 50; commandonly(context); alreadyreds: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; return; @@ -9788,27 +9788,27 @@ doredes: } void newplace(Context & context) { - context._cmp(context.data.byte(59), 1); + context._cmp(context.data.byte(kNeedtotravel), 1); if (context.flags.z()) goto istravel; - context._cmp(context.data.byte(188), -1); + context._cmp(context.data.byte(kAutolocation), -1); if (!context.flags.z()) goto isautoloc; return; isautoloc: - context.al = context.data.byte(188); - context.data.byte(187) = context.al; - context.data.byte(188) = -1; + context.al = context.data.byte(kAutolocation); + context.data.byte(kNewlocation) = context.al; + context.data.byte(kAutolocation) = -1; return; istravel: - context.data.byte(59) = 0; + context.data.byte(kNeedtotravel) = 0; selectlocation(context); return; } void selectlocation(Context & context) { - context.data.byte(236) = 0; + context.data.byte(kInmaparea) = 0; clearbeforeload(context); - context.data.byte(102) = 0; - context.data.byte(230) = 22; + context.data.byte(kGetback) = 0; + context.data.byte(kPointerframe) = 22; readcitypic(context); showcity(context); getridoftemp(context); @@ -9820,15 +9820,15 @@ void selectlocation(Context & context) { showexit(context); locationpic(context); undertextline(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); - context.data.byte(230) = 0; + context.data.byte(kPointerframe) = 0; showpointer(context); worktoscreen(context); context.al = 9; context.ah = 255; playchannel0(context); - context.data.byte(187) = 255; + context.data.byte(kNewlocation) = 255; select: delpointer(context); readmouse(context); @@ -9836,42 +9836,42 @@ select: vsync(context); dumppointer(context); dumptextline(context); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (context.flags.z()) goto quittravel; context.bx = 2714; checkcoords(context); - context._cmp(context.data.byte(187), 255); + context._cmp(context.data.byte(kNewlocation), 255); if (context.flags.z()) goto select; - context.al = context.data.byte(187); - context._cmp(context.al, context.data.byte(8)); + context.al = context.data.byte(kNewlocation); + context._cmp(context.al, context.data.byte(kLocation)); if (context.flags.z()) goto quittravel; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(454); + context.es = context.data.word(kTraveltext); deallocatemem(context); return; quittravel: - context.al = context.data.byte(183); - context.data.byte(187) = context.al; - context.data.byte(102) = 0; + context.al = context.data.byte(kReallocation); + context.data.byte(kNewlocation) = context.al; + context.data.byte(kGetback) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); - context.es = context.data.word(454); + context.es = context.data.word(kTraveltext); deallocatemem(context); return; } void showcity(Context & context) { clearwork(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 57; context.bx = 32; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 120+57; context.bx = 32; context.al = 1; @@ -9881,25 +9881,25 @@ void showcity(Context & context) { } void lookatplace(Context & context) { - context._cmp(context.data.byte(99), 224); + context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyinfo; - context.data.byte(99) = 224; + context.data.byte(kCommandtype) = 224; context.al = 27; commandonly(context); alreadyinfo: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto noinfo; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noinfo; - context.bl = context.data.byte(182); + context.bl = context.data.byte(kDestpos); context._cmp(context.bl, 15); if (!context.flags.c()) goto noinfo; context.push(context.bx); delpointer(context); deltextline(context); getundercentre(context); - context.ds = context.data.word(460); + context.ds = context.data.word(kTempgraphics3); context.al = 0; context.ah = 0; context.di = 60; @@ -9918,7 +9918,7 @@ alreadyinfo: context.bx = context.pop(); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(454); + context.es = context.data.word(kTraveltext); context.si = context.es.word(context.bx); context._add(context.si, 66*2); findnextcolon(context); @@ -9932,8 +9932,8 @@ alreadyinfo: context.cx = 500; hangonp(context); afterinfo: - context.data.byte(233) = 0; - context.data.byte(230) = 0; + context.data.byte(kPointermode) = 0; + context.data.byte(kPointerframe) = 0; putundercentre(context); worktoscreenm(context); noinfo: @@ -9943,7 +9943,7 @@ noinfo: void getundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; context.cl = 254; context.ch = 110; @@ -9954,7 +9954,7 @@ void getundercentre(Context & context) { void putundercentre(Context & context) { context.di = 58; context.bx = 72; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; context.cl = 254; context.ch = 110; @@ -9970,12 +9970,12 @@ void locationpic(Context & context) { context.di = 0; context._cmp(context.al, 6); if (!context.flags.c()) goto secondlot; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context._add(context.al, 4); goto gotgraphic; secondlot: context._sub(context.al, 6); - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); gotgraphic: context._add(context.di, 104); context.bx = 138+14; @@ -9983,20 +9983,20 @@ gotgraphic: showframe(context); context.si = context.pop(); context.es = context.pop(); - context.al = context.data.byte(182); - context._cmp(context.al, context.data.byte(183)); + context.al = context.data.byte(kDestpos); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto notinthisone; context.al = 3; context.di = 104; context.bx = 140+14; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 0; showframe(context); notinthisone: - context.bl = context.data.byte(182); + context.bl = context.data.byte(kDestpos); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(454); + context.es = context.data.word(kTraveltext); context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 50; @@ -10009,7 +10009,7 @@ notinthisone: } void getdestinfo(Context & context) { - context.al = context.data.byte(182); + context.al = context.data.byte(kDestpos); context.ah = 0; context.push(context.ax); context.dx = context.ds; @@ -10030,19 +10030,19 @@ void getdestinfo(Context & context) { void showarrows(Context & context) { context.di = 116-12; context.bx = 16; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 0; context.ah = 0; showframe(context); context.di = 226+12; context.bx = 16; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 1; context.ah = 0; showframe(context); context.di = 280; context.bx = 14; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 2; context.ah = 0; showframe(context); @@ -10051,27 +10051,27 @@ void showarrows(Context & context) { void nextdest(Context & context) { duok: - context._cmp(context.data.byte(99), 218); + context._cmp(context.data.byte(kCommandtype), 218); if (context.flags.z()) goto alreadydu; - context.data.byte(99) = 218; + context.data.byte(kCommandtype) = 218; context.al = 28; commandonly(context); alreadydu: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto nodu; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodu; searchdestup: - context._add(context.data.byte(182), 1); - context._cmp(context.data.byte(182), 15); + context._add(context.data.byte(kDestpos), 1); + context._cmp(context.data.byte(kDestpos), 15); if (!context.flags.z()) goto notlastdest; - context.data.byte(182) = 0; + context.data.byte(kDestpos) = 0; notlastdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestup; - context.data.byte(108) = 1; + context.data.byte(kNewtextline) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10089,27 +10089,27 @@ nodu: void lastdest(Context & context) { ddok: - context._cmp(context.data.byte(99), 219); + context._cmp(context.data.byte(kCommandtype), 219); if (context.flags.z()) goto alreadydd; - context.data.byte(99) = 219; + context.data.byte(kCommandtype) = 219; context.al = 29; commandonly(context); alreadydd: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto nodd; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodd; searchdestdown: - context._sub(context.data.byte(182), 1); - context._cmp(context.data.byte(182), -1); + context._sub(context.data.byte(kDestpos), 1); + context._cmp(context.data.byte(kDestpos), -1); if (!context.flags.z()) goto notfirstdest; - context.data.byte(182) = 15; + context.data.byte(kDestpos) = 15; notfirstdest: getdestinfo(context); context._cmp(context.al, 0); if (context.flags.z()) goto searchdestdown; - context.data.byte(108) = 1; + context.data.byte(kNewtextline) = 1; deltextline(context); delpointer(context); showpanel(context); @@ -10126,20 +10126,20 @@ nodd: } void destselect(Context & context) { - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadytrav; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 30; commandonly(context); alreadytrav: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto notrav; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notrav; getdestinfo(context); - context.al = context.data.byte(182); - context.data.byte(187) = context.al; + context.al = context.data.byte(kDestpos); + context.data.byte(kNewlocation) = context.al; notrav: return; } @@ -10228,7 +10228,7 @@ void readcitypic(Context & context) { } void usemon(Context & context) { - context.data.byte(54) = 0; + context.data.byte(kLasttrigger) = 0; context.es = context.cs; context.di = 2892+1; context.cx = 12; @@ -10267,8 +10267,8 @@ keyloop: turnonpower(context); fadeupyellows(context); fadeupmonfirst(context); - context.data.word(316) = 76; - context.data.word(318) = 141; + context.data.word(kMonadx) = 76; + context.data.word(kMonady) = 141; context.al = 1; monmessage(context); context.cx = 120; @@ -10283,34 +10283,34 @@ keyloop: hangoncurs(context); printlogo(context); scrollmonitor(context); - context.data.word(392) = 0; - context.data.word(394) = 0; + context.data.word(kBufferin) = 0; + context.data.word(kBufferout) = 0; moreinput: - context.di = context.data.word(316); - context.bx = context.data.word(318); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(316) = context.di; - context.data.word(318) = context.bx; + context.data.word(kMonadx) = context.di; + context.data.word(kMonady) = context.bx; execcommand(context); context._cmp(context.al, 0); if (context.flags.z()) goto moreinput; endmon: getridoftemp(context); getridoftempcharset(context); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); deallocatemem(context); - context.es = context.data.word(466); + context.es = context.data.word(kTextfile2); deallocatemem(context); - context.es = context.data.word(468); + context.es = context.data.word(kTextfile3); deallocatemem(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; context.al = 26; playchannel1(context); - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; restoreall(context); redrawmainscrn(context); worktoscreenm(context); @@ -10320,25 +10320,25 @@ endmon: void printoutermon(Context & context) { context.di = 40; context.bx = 32; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 1; context.ah = 0; showframe(context); context.di = 264; context.bx = 32; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 2; context.ah = 0; showframe(context); context.di = 40; context.bx = 12; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 3; context.ah = 0; showframe(context); context.di = 40; context.bx = 164; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 4; context.ah = 0; showframe(context); @@ -10346,7 +10346,7 @@ void printoutermon(Context & context) { } void loadpersonal(Context & context) { - context.al = context.data.byte(8); + context.al = context.data.byte(kLocation); context.dx = 2052; context._cmp(context.al, 0); if (context.flags.z()) goto foundpersonal; @@ -10363,7 +10363,7 @@ foundpersonal: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(464) = context.ax; + context.data.word(kTextfile1) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10373,7 +10373,7 @@ foundpersonal: } void loadnews(Context & context) { - context.al = context.data.byte(33); + context.al = context.data.byte(kNewsitem); context.dx = 2078; context._cmp(context.al, 0); if (context.flags.z()) goto foundnews; @@ -10392,7 +10392,7 @@ foundnews: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(466) = context.ax; + context.data.word(kTextfile2) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10424,7 +10424,7 @@ gotcart: context.cl = 4; context._shr(context.bx, context.cl); allocatemem(context); - context.data.word(468) = context.ax; + context.data.word(kTextfile3) = context.ax; context.ds = context.ax; context.cx = context.pop(); context.dx = 0; @@ -10490,7 +10490,7 @@ chosenaccess: void powerlighton(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 6; context.ah = 0; context.push(context.di); @@ -10507,7 +10507,7 @@ void powerlighton(Context & context) { void powerlightoff(Context & context) { context.di = 257+4; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 5; context.ah = 0; context.push(context.di); @@ -10524,7 +10524,7 @@ void powerlightoff(Context & context) { void accesslighton(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 8; context.ah = 0; context.push(context.di); @@ -10541,7 +10541,7 @@ void accesslighton(Context & context) { void accesslightoff(Context & context) { context.di = 74; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 7; context.ah = 0; context.push(context.di); @@ -10558,7 +10558,7 @@ void accesslightoff(Context & context) { void locklighton(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 10; context.ah = 0; context.push(context.di); @@ -10575,7 +10575,7 @@ void locklighton(Context & context) { void locklightoff(Context & context) { context.di = 56; context.bx = 182; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 9; context.ah = 0; context.push(context.di); @@ -10595,50 +10595,50 @@ void input(Context & context) { context.cx = 64; context.al = 0; while(--context.cx) context._stosb(); - context.data.word(314) = 0; + context.data.word(kCurpos) = 0; context.al = '>'; - context.di = context.data.word(316); - context.bx = context.data.word(318); - context.ds = context.data.word(404); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); + context.ds = context.data.word(kTempcharset); context.ah = 0; printchar(context); - context.di = context.data.word(316); - context.bx = context.data.word(318); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); context.cl = 6; context.ch = 8; multidump(context); - context._add(context.data.word(316), 6); - context.ax = context.data.word(316); - context.data.word(310) = context.ax; - context.ax = context.data.word(318); - context.data.word(312) = context.ax; + context._add(context.data.word(kMonadx), 6); + context.ax = context.data.word(kMonadx); + context.data.word(kCurslocx) = context.ax; + context.ax = context.data.word(kMonady); + context.data.word(kCurslocy) = context.ax; waitkey: printcurs(context); vsync(context); delcurs(context); readkey(context); - context.al = context.data.byte(141); + context.al = context.data.byte(kCurrentkey); context._cmp(context.al, 0); if (context.flags.z()) goto waitkey; context._cmp(context.al, 13); if (context.flags.z()) goto endofinput; context._cmp(context.al, 8); if (!context.flags.z()) goto notdel; - context._cmp(context.data.word(314), 0); + context._cmp(context.data.word(kCurpos), 0); if (context.flags.z()) goto waitkey; delchar(context); goto waitkey; notdel: - context._cmp(context.data.word(314), 28); + context._cmp(context.data.word(kCurpos), 28); if (context.flags.z()) goto waitkey; - context._cmp(context.data.byte(141), 32); + context._cmp(context.data.byte(kCurrentkey), 32); if (!context.flags.z()) goto notleadingspace; - context._cmp(context.data.word(314), 0); + context._cmp(context.data.word(kCurpos), 0); if (context.flags.z()) goto waitkey; notleadingspace: makecaps(context); context.es = context.cs; - context.si = context.data.word(314); + context.si = context.data.word(kCurpos); context._add(context.si, context.si); context._add(context.si, 7816); context.es.byte(context.si) = context.al; @@ -10647,10 +10647,10 @@ notleadingspace: context.push(context.ax); context.push(context.es); context.push(context.si); - context.di = context.data.word(316); - context.bx = context.data.word(318); - context.ds = context.data.word(400); - context.ax = context.data.word(314); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); + context.ds = context.data.word(kMapstore); + context.ax = context.data.word(kCurpos); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; @@ -10661,18 +10661,18 @@ notleadingspace: context.ax = context.pop(); context.push(context.es); context.push(context.si); - context.di = context.data.word(316); - context.bx = context.data.word(318); - context.ds = context.data.word(404); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); + context.ds = context.data.word(kTempcharset); context.ah = 0; printchar(context); context.si = context.pop(); context.es = context.pop(); context.es.byte(context.si+1) = context.cl; context.ch = 0; - context._add(context.data.word(316), context.cx); - context._add(context.data.word(314), 1); - context._add(context.data.word(310), context.cx); + context._add(context.data.word(kMonadx), context.cx); + context._add(context.data.word(kCurpos), 1); + context._add(context.data.word(kCurslocx), context.cx); goto waitkey; endofinput: return; @@ -10687,27 +10687,27 @@ notupperc: } void delchar(Context & context) { - context._sub(context.data.word(314), 1); - context.si = context.data.word(314); + context._sub(context.data.word(kCurpos), 1); + context.si = context.data.word(kCurpos); context._add(context.si, context.si); context.es = context.cs; context._add(context.si, 7816); context.es.byte(context.si) = 0; context.al = context.es.byte(context.si+1); context.ah = 0; - context._sub(context.data.word(316), context.ax); - context._sub(context.data.word(310), context.ax); - context.di = context.data.word(316); - context.bx = context.data.word(318); - context.ds = context.data.word(400); - context.ax = context.data.word(314); + context._sub(context.data.word(kMonadx), context.ax); + context._sub(context.data.word(kCurslocx), context.ax); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); + context.ds = context.data.word(kMapstore); + context.ax = context.data.word(kCurpos); context._xchg(context.al, context.ah); context.si = context.ax; context.cl = 8; context.ch = 8; multiput(context); - context.di = context.data.word(316); - context.bx = context.data.word(318); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); context.cl = context.al; context.ch = 8; multidump(context); @@ -10803,7 +10803,7 @@ void dircom(Context & context) { dirfile(context); return; dirroot: - context.data.byte(268) = 0; + context.data.byte(kLogonum) = 0; context.ds = context.cs; context.si = 2885; context._add(context.si, 1); @@ -10816,11 +10816,11 @@ dirroot: scrollmonitor(context); context.al = 9; monmessage(context); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); searchforfiles(context); - context.es = context.data.word(466); + context.es = context.data.word(kTextfile2); searchforfiles(context); - context.es = context.data.word(468); + context.es = context.data.word(kTextfile3); searchforfiles(context); scrollmonitor(context); return; @@ -10889,15 +10889,15 @@ notyetassigned: scrollmonitor(context); context.al = 15; monmessage(context); - context.di = context.data.word(316); - context.bx = context.data.word(318); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); context.push(context.di); context.push(context.bx); input(context); context.bx = context.pop(); context.di = context.pop(); - context.data.word(316) = context.di; - context.data.word(318) = context.bx; + context.data.word(kMonadx) = context.di; + context.data.word(kMonady) = context.bx; context.bx = context.pop(); context.es = context.pop(); context.push(context.es); @@ -10972,22 +10972,22 @@ void read(Context & context) { okcom: context.es = context.cs; context.di = 2892; - context.ax = context.data.word(464); - context.data.word(322) = context.ax; + context.ax = context.data.word(kTextfile1); + context.data.word(kMonsource) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(466); - context.data.word(322) = context.ax; + context.ax = context.data.word(kTextfile2); + context.data.word(kMonsource) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; - context.ax = context.data.word(468); - context.data.word(322) = context.ax; + context.ax = context.data.word(kTextfile3); + context.data.word(kMonsource) = context.ax; context.ds = context.ax; context.si = 66*2; searchforstring(context); @@ -11004,12 +11004,12 @@ foundfile2: keyok1: context.es = context.cs; context.di = 2883; - context.ds = context.data.word(322); + context.ds = context.data.word(kMonsource); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto findtopictext; - context.al = context.data.byte(269); - context.data.byte(268) = context.al; + context.al = context.data.byte(kOldlogonum); + context.data.byte(kLogonum) = context.al; context.al = 11; monmessage(context); return; @@ -11048,7 +11048,7 @@ void dirfile(Context & context) { context.es.byte(context.di) = context.al; context.push(context.es); context.push(context.di); - context.ds = context.data.word(464); + context.ds = context.data.word(kTextfile1); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11057,7 +11057,7 @@ void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(466); + context.ds = context.data.word(kTextfile2); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11066,7 +11066,7 @@ void dirfile(Context & context) { context.es = context.pop(); context.push(context.es); context.push(context.di); - context.ds = context.data.word(468); + context.ds = context.data.word(kTextfile3); context.si = 66*2; searchforstring(context); context._cmp(context.al, 0); @@ -11118,15 +11118,15 @@ void getkeyandlogo(Context & context) { context._add(context.bx, 1); context.al = context.es.byte(context.bx); context._sub(context.al, 48); - context.data.byte(270) = context.al; + context.data.byte(kNewlogonum) = context.al; context._add(context.bx, 2); context.al = context.es.byte(context.bx); context._sub(context.al, 48); - context.data.byte(275) = context.al; + context.data.byte(kKeynum) = context.al; context._add(context.bx, 1); context.push(context.es); context.push(context.bx); - context.al = context.data.byte(275); + context.al = context.data.byte(kKeynum); context.ah = 0; context.cx = 26; context._mul(context.cx); @@ -11152,8 +11152,8 @@ void getkeyandlogo(Context & context) { keyok: context.bx = context.pop(); context.es = context.pop(); - context.al = context.data.byte(270); - context.data.byte(268) = context.al; + context.al = context.data.byte(kNewlogonum); + context.data.byte(kLogonum) = context.al; context.al = 0; return; } @@ -11240,10 +11240,10 @@ void scrollmonitor(Context & context) { context.push(context.es); context.push(context.ds); printlogo(context); - context.di = context.data.word(316); - context.bx = context.data.word(318); + context.di = context.data.word(kMonadx); + context.bx = context.data.word(kMonady); printundermon(context); - context.ax = context.data.word(318); + context.ax = context.data.word(kMonady); worktoscreen(context); context.al = 25; playchannel1(context); @@ -11259,11 +11259,11 @@ void scrollmonitor(Context & context) { } void lockmon(Context & context) { - context._cmp(context.data.byte(391), 57); + context._cmp(context.data.byte(kLasthardkey), 57); if (!context.flags.z()) goto notlock; locklighton(context); lockloop: - context._cmp(context.data.byte(391), 57); + context._cmp(context.data.byte(kLasthardkey), 57); if (context.flags.z()) goto lockloop; locklightoff(context); notlock: @@ -11271,10 +11271,10 @@ notlock: } void monitorlogo(Context & context) { - context.al = context.data.byte(268); - context._cmp(context.al, context.data.byte(269)); + context.al = context.data.byte(kLogonum); + context._cmp(context.al, context.data.byte(kOldlogonum)); if (context.flags.z()) goto notnewlogo; - context.data.byte(269) = context.al; + context.data.byte(kOldlogonum) = context.al; printlogo(context); printundermon(context); worktoscreen(context); @@ -11293,7 +11293,7 @@ notnewlogo: void printlogo(Context & context) { context.di = 56; context.bx = 32; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 0; context.ah = 0; showframe(context); @@ -11312,7 +11312,7 @@ curfileloop: context._add(context.si, 1); context.push(context.si); modifychar(context); - context.ds = context.data.word(404); + context.ds = context.data.word(kTempcharset); context.ah = 0; printchar(context); context.si = context.pop(); @@ -11322,7 +11322,7 @@ finishfile: } void monmessage(Context & context) { - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.bx = 66*2; context.cl = context.al; context.ch = 0; @@ -11337,7 +11337,7 @@ monmessageloop: } void processtrigger(Context & context) { - context._cmp(context.data.byte(54), '1'); + context._cmp(context.data.byte(kLasttrigger), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); @@ -11345,7 +11345,7 @@ void processtrigger(Context & context) { triggermessage(context); return; notfirsttrigger: - context._cmp(context.data.byte(54), '2'); + context._cmp(context.data.byte(kLasttrigger), '2'); if (!context.flags.z()) goto notsecondtrigger; context.al = 9; setlocation(context); @@ -11353,7 +11353,7 @@ notfirsttrigger: triggermessage(context); return; notsecondtrigger: - context._cmp(context.data.byte(54), '3'); + context._cmp(context.data.byte(kLasttrigger), '3'); if (!context.flags.z()) goto notthirdtrigger; context.al = 2; setlocation(context); @@ -11369,7 +11369,7 @@ void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiget(context); context.ax = context.pop(); @@ -11388,11 +11388,11 @@ void triggermessage(Context & context) { context.bx = 153; context.cl = 200; context.ch = 63; - context.ds = context.data.word(400); + context.ds = context.data.word(kMapstore); context.si = 0; multiput(context); worktoscreen(context); - context.data.byte(54) = 0; + context.data.byte(kLasttrigger) = 0; return; } @@ -11403,13 +11403,13 @@ void printcurs(Context & context) { context.push(context.dx); context.push(context.bx); context.push(context.es); - context.di = context.data.word(310); - context.bx = context.data.word(312); + context.di = context.data.word(kCurslocx); + context.bx = context.data.word(kCurslocy); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); context.ch = 11; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0; context.push(context.di); context.push(context.bx); @@ -11418,14 +11418,14 @@ void printcurs(Context & context) { context.di = context.pop(); context.push(context.bx); context.push(context.di); - context._add(context.data.word(136), 1); - context.ax = context.data.word(136); + context._add(context.data.word(kMaintimer), 1); + context.ax = context.data.word(kMaintimer); context._and(context.al, 16); if (!context.flags.z()) goto flashcurs; context.al = '/'; context._sub(context.al, 32); context.ah = 0; - context.ds = context.data.word(404); + context.ds = context.data.word(kTempcharset); showframe(context); flashcurs: context.di = context.pop(); @@ -11450,8 +11450,8 @@ void delcurs(Context & context) { context.push(context.ds); context.push(context.dx); context.push(context.si); - context.di = context.data.word(310); - context.bx = context.data.word(312); + context.di = context.data.word(kCurslocx); + context.bx = context.data.word(kCurslocy); context.cl = 6; context.ch = 8; context._sub(context.bx, 3); @@ -11459,7 +11459,7 @@ void delcurs(Context & context) { context.push(context.di); context.push(context.bx); context.push(context.cx); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0; multiput(context); context.cx = context.pop(); @@ -11477,17 +11477,17 @@ finishcurdel: } void useobject(Context & context) { - context.data.byte(94) = 255; - context._cmp(context.data.byte(99), 229); + context.data.byte(kWithobject) = 255; + context._cmp(context.data.byte(kCommandtype), 229); if (context.flags.z()) goto alreadyuse; - context.data.byte(99) = 229; - context.bl = context.data.byte(98); - context.bh = context.data.byte(101); + context.data.byte(kCommandtype) = 229; + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kObjecttype); context.al = 51; commandwithob(context); alreadyuse: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nouse; context._and(context.ax, 1); if (!context.flags.z()) goto douse; @@ -11499,13 +11499,13 @@ douse: } void useroutine(Context & context) { - context._cmp(context.data.byte(183), 50); + context._cmp(context.data.byte(kReallocation), 50); if (context.flags.c()) goto nodream7; - context._cmp(context.data.byte(231), 0); + context._cmp(context.data.byte(kPointerpower), 0); if (!context.flags.z()) goto powerok; return; powerok: - context.data.byte(231) = 0; + context.data.byte(kPointerpower) = 0; nodream7: getanyad(context); context.dx = context.ds; @@ -11569,7 +11569,7 @@ cantuse2: context.cx = 50; hangonp(context); putbackobstuff(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; return; } @@ -11582,21 +11582,21 @@ void wheelsound(Context & context) { } void runtap(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tapwith; withwhat(context); return; tapwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcupfromtap; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11609,7 +11609,7 @@ tapwith: putbackobstuff(context); return; fillcupfromtap: - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+15) = 'F'-'A'; context.al = 8; @@ -11636,9 +11636,9 @@ void playguitar(Context & context) { } void hotelcontrol(Context & context) { - context._cmp(context.data.byte(183), 21); + context._cmp(context.data.byte(kReallocation), 21); if (!context.flags.z()) goto notrightcont; - context._cmp(context.data.byte(147), 33); + context._cmp(context.data.byte(kMapx), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); @@ -11658,14 +11658,14 @@ void hotelbell(Context & context) { } void opentomb(Context & context) { - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); - context.data.word(19) = 35*2; - context.data.word(21) = 1; - context.data.word(23) = 33; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 35*2; + context.data.word(kReeltowatch) = 1; + context.data.word(kEndwatchreel) = 33; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } @@ -11673,7 +11673,7 @@ void usetrainer(Context & context) { getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); makeworn(context); showseconduse(context); putbackobstuff(context); @@ -11703,21 +11703,21 @@ void nothelderror(Context & context) { } void usepipe(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto pipewith; withwhat(context); return; pipewith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'E'; compare(context); if (context.flags.z()) goto fillcup; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -11734,7 +11734,7 @@ fillcup: context.al = 36; showpuztext(context); putbackobstuff(context); - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+15) = 'F'-'A'; return; @@ -11747,35 +11747,35 @@ alreadyfull: } void usefullcart(Context & context) { - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); context.al = 2; - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._add(context.ah, 6); turnanypathon(context); - context.data.byte(474) = 4; - context.data.byte(132) = 4; - context.data.byte(134) = 4; - context.data.byte(476) = 4; + context.data.byte(kManspath) = 4; + context.data.byte(kFacing) = 4; + context.data.byte(kTurntoface) = 4; + context.data.byte(kFinaldest) = 4; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; showfirstuse(context); - context.data.word(19) = 72*2; - context.data.word(21) = 58; - context.data.word(23) = 142; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 72*2; + context.data.word(kReeltowatch) = 58; + context.data.word(kEndwatchreel) = 142; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } void useplinth(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); return; plinthwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'D'; context.ch = 'K'; context.dl = 'E'; @@ -11786,16 +11786,16 @@ plinthwith: putbackobstuff(context); return; isrightkey: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showseconduse(context); - context.data.word(19) = 220; - context.data.word(21) = 0; - context.data.word(23) = 104; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; - context.al = context.data.byte(66); - context.data.byte(187) = context.al; + context.data.word(kWatchingtime) = 220; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 104; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; + context.al = context.data.byte(kRoomafterdream); + context.data.byte(kNewlocation) = context.al; return; } @@ -11803,63 +11803,63 @@ void chewy(Context & context) { showfirstuse(context); getanyad(context); context.es.byte(context.bx+2) = 255; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void useladder(Context & context) { showfirstuse(context); - context._sub(context.data.byte(147), 11); + context._sub(context.data.byte(kMapx), 11); findroominloc(context); - context.data.byte(132) = 6; - context.data.byte(134) = 6; - context.data.byte(474) = 0; - context.data.byte(477) = 0; - context.data.byte(476) = 0; + context.data.byte(kFacing) = 6; + context.data.byte(kTurntoface) = 6; + context.data.byte(kManspath) = 0; + context.data.byte(kDestination) = 0; + context.data.byte(kFinaldest) = 0; findxyfrompath(context); - context.data.byte(186) = 1; - context.data.byte(102) = 1; + context.data.byte(kResetmanxy) = 1; + context.data.byte(kGetback) = 1; return; } void useladderb(Context & context) { showfirstuse(context); - context._add(context.data.byte(147), 11); + context._add(context.data.byte(kMapx), 11); findroominloc(context); - context.data.byte(132) = 2; - context.data.byte(134) = 2; - context.data.byte(474) = 1; - context.data.byte(477) = 1; - context.data.byte(476) = 1; + context.data.byte(kFacing) = 2; + context.data.byte(kTurntoface) = 2; + context.data.byte(kManspath) = 1; + context.data.byte(kDestination) = 1; + context.data.byte(kFinaldest) = 1; findxyfrompath(context); - context.data.byte(186) = 1; - context.data.byte(102) = 1; + context.data.byte(kResetmanxy) = 1; + context.data.byte(kGetback) = 1; return; } void slabdoora(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 13; - context._cmp(context.data.byte(65), 3); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 13; + context._cmp(context.data.byte(kDreamnumber), 3); if (!context.flags.z()) goto slabawrong; - context._add(context.data.byte(1), 1); - context.data.word(19) = 60; - context.data.word(23) = 42; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 42; + context.data.byte(kNewlocation) = 47; return; slabawrong: - context.data.word(19) = 40; - context.data.word(23) = 34; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 34; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void slabdoorb(Context & context) { - context._cmp(context.data.byte(65), 1); + context._cmp(context.data.byte(kDreamnumber), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; context.ah = 'H'; @@ -11874,120 +11874,120 @@ void slabdoorb(Context & context) { return; gotcrystal: showfirstuse(context); - context._add(context.data.byte(1), 1); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 44; - context.data.word(19) = 60; - context.data.word(23) = 71; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 44; + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 71; + context.data.byte(kNewlocation) = 47; return; slabbwrong: showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 44; - context.data.word(19) = 40; - context.data.word(23) = 63; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 44; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 63; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void slabdoord(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 75; - context._cmp(context.data.byte(65), 0); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 75; + context._cmp(context.data.byte(kDreamnumber), 0); if (!context.flags.z()) goto slabcwrong; - context._add(context.data.byte(1), 1); - context.data.word(19) = 60; - context.data.word(23) = 102; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 102; + context.data.byte(kNewlocation) = 47; return; slabcwrong: - context.data.word(19) = 40; - context.data.word(23) = 94; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 94; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void slabdoorc(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 108; - context._cmp(context.data.byte(65), 4); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 108; + context._cmp(context.data.byte(kDreamnumber), 4); if (!context.flags.z()) goto slabdwrong; - context._add(context.data.byte(1), 1); - context.data.word(19) = 60; - context.data.word(23) = 135; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 135; + context.data.byte(kNewlocation) = 47; return; slabdwrong: - context.data.word(19) = 40; - context.data.word(23) = 127; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 127; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void slabdoore(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 141; - context._cmp(context.data.byte(65), 5); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 141; + context._cmp(context.data.byte(kDreamnumber), 5); if (!context.flags.z()) goto slabewrong; - context._add(context.data.byte(1), 1); - context.data.word(19) = 60; - context.data.word(23) = 168; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 168; + context.data.byte(kNewlocation) = 47; return; slabewrong: - context.data.word(19) = 40; - context.data.word(23) = 160; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 160; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void slabdoorf(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(21) = 171; - context._cmp(context.data.byte(65), 2); + context.data.byte(kGetback) = 1; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kReeltowatch) = 171; + context._cmp(context.data.byte(kDreamnumber), 2); if (!context.flags.z()) goto slabfwrong; - context._add(context.data.byte(1), 1); - context.data.word(19) = 60; - context.data.word(23) = 197; - context.data.byte(187) = 47; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 60; + context.data.word(kEndwatchreel) = 197; + context.data.byte(kNewlocation) = 47; return; slabfwrong: - context.data.word(19) = 40; - context.data.word(23) = 189; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 40; + context.data.word(kEndwatchreel) = 189; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void useslab(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto slabwith; withwhat(context); return; slabwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'J'; context.ch = 'E'; context.dl = 'W'; @@ -12000,10 +12000,10 @@ slabwith: putbackobstuff(context); return; nextslab: - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); context.push(context.ax); removesetobject(context); context.ax = context.pop(); @@ -12015,26 +12015,26 @@ nextslab: if (!context.flags.z()) goto notlastslab; context.al = 0; turnpathon(context); - context.data.word(19) = 22; - context.data.word(21) = 35; - context.data.word(23) = 48; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 22; + context.data.word(kReeltowatch) = 35; + context.data.word(kEndwatchreel) = 48; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; notlastslab: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void usecart(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto cartwith; withwhat(context); return; cartwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'R'; context.ch = 'O'; context.dl = 'C'; @@ -12047,31 +12047,31 @@ cartwith: putbackobstuff(context); return; nextcart: - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(98); + context.al = context.data.byte(kCommand); context.push(context.ax); removesetobject(context); context.ax = context.pop(); context._add(context.al, 1); placesetobject(context); - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void useclearbox(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); return; clearboxwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'R'; context.ch = 'A'; context.dl = 'I'; @@ -12084,57 +12084,57 @@ clearboxwith: putbackobstuff(context); return; openbox: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); - context.data.word(19) = 80; - context.data.word(21) = 67; - context.data.word(23) = 105; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 80; + context.data.word(kReeltowatch) = 67; + context.data.word(kEndwatchreel) = 105; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } void usecoveredbox(Context & context) { - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); - context.data.word(19) = 50; - context.data.word(21) = 41; - context.data.word(23) = 66; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 50; + context.data.word(kReeltowatch) = 41; + context.data.word(kEndwatchreel) = 66; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } void userailing(Context & context) { showfirstuse(context); - context.data.word(19) = 80; - context.data.word(21) = 0; - context.data.word(23) = 30; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; - context.data.byte(55) = 4; + context.data.word(kWatchingtime) = 80; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 30; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; + context.data.byte(kMandead) = 4; return; } void useopenbox(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); return; openboxwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; context.dh = 'F'; compare(context); if (context.flags.z()) goto destoryopenbox; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'P'; @@ -12144,21 +12144,21 @@ openboxwith: showfirstuse(context); return; destoryopenbox: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); context.cx = 300; context.al = 37; showpuztext(context); - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+15) = 'E'-'A'; - context.data.word(19) = 140; - context.data.word(21) = 105; - context.data.word(23) = 181; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 140; + context.data.word(kReeltowatch) = 105; + context.data.word(kEndwatchreel) = 181; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; context.al = 4; turnpathon(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; openboxwrong: context.cx = 300; @@ -12169,11 +12169,11 @@ openboxwrong: } void wearwatch(Context & context) { - context._cmp(context.data.byte(2), 1); + context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); - context.data.byte(2) = 1; - context.data.byte(102) = 1; + context.data.byte(kWatchon) = 1; + context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); return; @@ -12184,11 +12184,11 @@ wearingwatch: } void wearshades(Context & context) { - context._cmp(context.data.byte(3), 1); + context._cmp(context.data.byte(kShadeson), 1); if (context.flags.z()) goto wearingshades; - context.data.byte(3) = 1; + context.data.byte(kShadeson) = 1; showfirstuse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); return; @@ -12199,17 +12199,17 @@ wearingshades: } void sitdowninbar(Context & context) { - context._cmp(context.data.byte(31), -1); + context._cmp(context.data.byte(kWatchmode), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); - context.data.word(19) = 50; - context.data.word(21) = 55; - context.data.word(23) = 71; - context.data.word(27) = 73; - context.data.word(29) = 83; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 50; + context.data.word(kReeltowatch) = 55; + context.data.word(kEndwatchreel) = 71; + context.data.word(kReeltohold) = 73; + context.data.word(kEndofholdreel) = 83; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; satdown: showseconduse(context); @@ -12219,23 +12219,23 @@ satdown: void usechurchhole(Context & context) { showfirstuse(context); - context.data.byte(102) = 1; - context.data.word(19) = 28; - context.data.word(21) = 13; - context.data.word(23) = 26; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.byte(kGetback) = 1; + context.data.word(kWatchingtime) = 28; + context.data.word(kReeltowatch) = 13; + context.data.word(kEndwatchreel) = 26; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; } void usehole(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto holewith; withwhat(context); return; holewith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'H'; context.ch = 'N'; context.dl = 'D'; @@ -12251,11 +12251,11 @@ righthand: showfirstuse(context); context.al = 86; removesetobject(context); - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+2) = 255; - context.data.byte(46) = 1; - context.data.byte(102) = 1; + context.data.byte(kCanmovealtar) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12274,43 +12274,43 @@ void usealtar(Context & context) { findexobject(context); context._cmp(context.al, 114); if (context.flags.z()) goto thingsonaltar; - context._cmp(context.data.byte(46), 1); + context._cmp(context.data.byte(kCanmovealtar), 1); if (context.flags.z()) goto movealtar; context.cx = 300; context.al = 23; showpuztext(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; movealtar: - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showseconduse(context); - context.data.word(19) = 160; - context.data.word(21) = 81; - context.data.word(23) = 174; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 160; + context.data.word(kReeltowatch) = 81; + context.data.word(kEndwatchreel) = 174; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; context.al = 47; context.bl = 52; context.bh = 76; context.cx = 32; context.dx = 98; setuptimeduse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; thingsonaltar: showfirstuse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void opentvdoor(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); return; tvdoorwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'U'; context.ch = 'L'; context.dl = 'O'; @@ -12324,8 +12324,8 @@ tvdoorwith: return; keyontv: showfirstuse(context); - context.data.byte(36) = 0; - context.data.byte(102) = 1; + context.data.byte(kLockstatus) = 0; + context.data.byte(kGetback) = 1; return; } @@ -12333,7 +12333,7 @@ void usedryer(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12343,7 +12343,7 @@ void openlouis(Context & context) { context.cl = 3; context.ch = 8; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12362,17 +12362,17 @@ void openyourneighbour(Context & context) { context.cl = 255; context.ch = 255; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void usewindow(Context & context) { - context._cmp(context.data.byte(474), 6); + context._cmp(context.data.byte(kManspath), 6); if (!context.flags.z()) goto notonbalc; - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); - context.data.byte(187) = 29; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 29; + context.data.byte(kGetback) = 1; return; notonbalc: showseconduse(context); @@ -12396,19 +12396,19 @@ void usebalcony(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context._add(context.data.byte(1), 1); - context.data.byte(474) = 6; - context.data.byte(477) = 6; - context.data.byte(476) = 6; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kManspath) = 6; + context.data.byte(kDestination) = 6; + context.data.byte(kFinaldest) = 6; findxyfrompath(context); switchryanoff(context); - context.data.byte(186) = 1; - context.data.word(19) = 30*2; - context.data.word(21) = 183; - context.data.word(23) = 212; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.byte(kResetmanxy) = 1; + context.data.word(kWatchingtime) = 30*2; + context.data.word(kReeltowatch) = 183; + context.data.word(kEndwatchreel) = 212; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12418,7 +12418,7 @@ void openryan(Context & context) { context.cl = 0; context.ch = 6; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12428,7 +12428,7 @@ void openpoolboss(Context & context) { context.cl = 2; context.ch = 2; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12438,7 +12438,7 @@ void openeden(Context & context) { context.cl = 6; context.ch = 5; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12448,7 +12448,7 @@ void opensarters(Context & context) { context.cl = 3; context.ch = 3; entercode(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12476,13 +12476,13 @@ void drawitall(Context & context) { } void openhoteldoor(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); return; hoteldoorwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12498,19 +12498,19 @@ keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); - context.data.byte(36) = 0; - context.data.byte(102) = 1; + context.data.byte(kLockstatus) = 0; + context.data.byte(kGetback) = 1; return; } void openhoteldoor2(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); return; hoteldoorwith2: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; @@ -12531,13 +12531,13 @@ keyonhotel2: } void grafittidoor(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto grafwith; withwhat(context); return; grafwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'A'; context.ch = 'P'; context.dl = 'E'; @@ -12556,16 +12556,16 @@ dograf: } void trapdoor(Context & context) { - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); showfirstuse(context); switchryanoff(context); - context.data.word(19) = 20*2; - context.data.word(21) = 181; - context.data.word(23) = 197; - context.data.byte(187) = 26; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 20*2; + context.data.word(kReeltowatch) = 181; + context.data.word(kEndwatchreel) = 197; + context.data.byte(kNewlocation) = 26; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12573,10 +12573,10 @@ void callhotellift(Context & context) { context.al = 12; playchannel1(context); showfirstuse(context); - context.data.byte(38) = 8; - context.data.byte(102) = 1; - context.data.byte(477) = 5; - context.data.byte(476) = 5; + context.data.byte(kCounttoopen) = 8; + context.data.byte(kGetback) = 1; + context.data.byte(kDestination) = 5; + context.data.byte(kFinaldest) = 5; autosetwalk(context); context.al = 4; turnpathon(context); @@ -12585,19 +12585,19 @@ void callhotellift(Context & context) { void calledenslift(Context & context) { showfirstuse(context); - context.data.byte(38) = 8; - context.data.byte(102) = 1; + context.data.byte(kCounttoopen) = 8; + context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); return; } void calledensdlift(Context & context) { - context._cmp(context.data.byte(34), 1); + context._cmp(context.data.byte(kLiftflag), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); - context.data.byte(38) = 8; - context.data.byte(102) = 1; + context.data.byte(kCounttoopen) = 8; + context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); return; @@ -12608,13 +12608,13 @@ edensdhere: } void usepoolreader(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto poolwith; withwhat(context); return; poolwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'M'; context.ch = 'E'; context.dl = 'M'; @@ -12627,7 +12627,7 @@ poolwith: putbackobstuff(context); return; openpool: - context._cmp(context.data.byte(47), 1); + context._cmp(context.data.byte(kTalkedtoattendant), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); @@ -12636,19 +12636,19 @@ canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); - context.data.byte(38) = 6; - context.data.byte(102) = 1; + context.data.byte(kCounttoopen) = 6; + context.data.byte(kGetback) = 1; return; } void uselighter(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); return; gotlighterwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'S'; context.ch = 'M'; context.dl = 'K'; @@ -12662,10 +12662,10 @@ cigarette: context.cx = 300; context.al = 9; showpuztext(context); - context.al = context.data.byte(94); + context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+2) = 255; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -12681,13 +12681,13 @@ void showseconduse(Context & context) { } void usecardreader1(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); return; gotreader1with: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12700,9 +12700,9 @@ gotreader1with: putbackobstuff(context); return; correctcard: - context._cmp(context.data.byte(48), 0); + context._cmp(context.data.byte(kTalkedtosparky), 0); if (context.flags.z()) goto notyet; - context._cmp(context.data.word(14), 0); + context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto getscash; context.cx = 300; context.al = 17; @@ -12715,9 +12715,9 @@ getscash: context.cx = 300; context.al = 18; showpuztext(context); - context._add(context.data.byte(1), 1); - context.data.word(14) = 12432; - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kCard1money) = 12432; + context.data.byte(kGetback) = 1; return; notyet: showfirstuse(context); @@ -12726,13 +12726,13 @@ notyet: } void usecardreader2(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); return; gotreader2with: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12745,11 +12745,11 @@ gotreader2with: putbackobstuff(context); return; correctcard2: - context._cmp(context.data.byte(49), 0); + context._cmp(context.data.byte(kTalkedtoboss), 0); if (context.flags.z()) goto notyetboss; - context._cmp(context.data.word(14), 0); + context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto nocash; - context._cmp(context.data.byte(45), 2); + context._cmp(context.data.byte(kGunpassflag), 2); if (context.flags.z()) goto alreadygotnew; context.al = 18; playchannel1(context); @@ -12758,10 +12758,10 @@ correctcard2: showpuztext(context); context.al = 94; placesetobject(context); - context.data.byte(45) = 1; - context._sub(context.data.word(14), 2000); - context._add(context.data.byte(1), 1); - context.data.byte(102) = 1; + context.data.byte(kGunpassflag) = 1; + context._sub(context.data.word(kCard1money), 2000); + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kGetback) = 1; return; nocash: context.cx = 300; @@ -12782,13 +12782,13 @@ notyetboss: } void usecardreader3(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); return; gotreader3with: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'S'; context.dl = 'H'; @@ -12801,19 +12801,19 @@ gotreader3with: putbackobstuff(context); return; rightcard: - context._cmp(context.data.byte(50), 0); + context._cmp(context.data.byte(kTalkedtorecep), 0); if (context.flags.z()) goto notyetrecep; - context._cmp(context.data.byte(51), 0); + context._cmp(context.data.byte(kCardpassflag), 0); if (!context.flags.z()) goto alreadyusedit; context.al = 16; playchannel1(context); context.cx = 300; context.al = 25; showpuztext(context); - context._add(context.data.byte(1), 1); - context._sub(context.data.word(14), 8300); - context.data.byte(51) = 1; - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context._sub(context.data.word(kCard1money), 8300); + context.data.byte(kCardpassflag) = 1; + context.data.byte(kGetback) = 1; return; alreadyusedit: context.cx = 300; @@ -12836,11 +12836,11 @@ void usecashcard(Context & context) { showman(context); context.di = 114; context.bx = 120-3; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 39; context.ah = 0; showframe(context); - context.ax = context.data.word(14); + context.ax = context.data.word(kCard1money); moneypoke(context); getobtextstart(context); nextcolon(context); @@ -12855,7 +12855,7 @@ void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3385; - context.data.word(69) = 91*2+75; + context.data.word(kCharshift) = 91*2+75; context.al = 0; context.ah = 0; context.dl = 240; @@ -12864,12 +12864,12 @@ void usecashcard(Context & context) { context.bx = 155; context.es = context.cs; context.si = 3390; - context.data.word(69) = 91*2+85; + context.data.word(kCharshift) = 91*2+85; context.al = 0; context.ah = 0; context.dl = 240; printdirect(context); - context.data.word(69) = 0; + context.data.word(kCharshift) = 0; worktoscreenm(context); context.cx = 400; hangonp(context); @@ -12880,13 +12880,13 @@ void usecashcard(Context & context) { } void lookatcard(Context & context) { - context.data.byte(130) = 1; + context.data.byte(kManisoffscreen) = 1; getridofreels(context); loadkeypad(context); createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 42; context.ah = 128; showframe(context); @@ -12908,7 +12908,7 @@ void lookatcard(Context & context) { createpanel2(context); context.di = 160; context.bx = 80; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 42; context.ah = 128; showframe(context); @@ -12923,7 +12923,7 @@ void lookatcard(Context & context) { worktoscreenm(context); context.cx = 200; hangonw(context); - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; getridoftemp(context); restorereels(context); putbackobstuff(context); @@ -12970,31 +12970,31 @@ numberpoke3: } void usecontrol(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); return; gotcontrolwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'E'; context.dl = 'Y'; context.dh = 'A'; compare(context); if (context.flags.z()) goto rightkey; - context._cmp(context.data.byte(183), 21); + context._cmp(context.data.byte(kReallocation), 21); if (!context.flags.z()) goto balls; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto jimmycontrols; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13008,26 +13008,26 @@ balls: rightkey: context.al = 16; playchannel1(context); - context._cmp(context.data.byte(8), 21); + context._cmp(context.data.byte(kLocation), 21); if (context.flags.z()) goto goingdown; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(187) = 21; - context.data.byte(39) = 8; - context.data.byte(38) = 0; - context.data.word(19) = 80; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 21; + context.data.byte(kCounttoclose) = 8; + context.data.byte(kCounttoopen) = 0; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; return; goingdown: context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(187) = 30; - context.data.byte(39) = 8; - context.data.byte(38) = 0; - context.data.word(19) = 80; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 30; + context.data.byte(kCounttoclose) = 8; + context.data.byte(kCounttoopen) = 0; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; return; jimmycontrols: context.al = 50; @@ -13047,41 +13047,41 @@ jimmycontrols: context.cx = 300; context.al = 10; showpuztext(context); - context._add(context.data.byte(1), 1); - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kGetback) = 1; return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); - context._add(context.data.byte(1), 1); + context._add(context.data.byte(kProgresspoints), 1); putbackobstuff(context); return; } void usehatch(Context & context) { showfirstuse(context); - context.data.byte(187) = 40; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 40; + context.data.byte(kGetback) = 1; return; } void usewire(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); return; gotwirewith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; context.dh = 'E'; compare(context); if (context.flags.z()) goto wireknife; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13107,8 +13107,8 @@ wireknife: context.cx = 300; context.al = 11; showpuztext(context); - context._add(context.data.byte(1), 1); - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kGetback) = 1; return; } @@ -13124,21 +13124,21 @@ void usehandle(Context & context) { context.cx = 300; context.al = 12; showpuztext(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; havecutwire: context.cx = 300; context.al = 13; showpuztext(context); - context.data.byte(187) = 22; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 22; + context.data.byte(kGetback) = 1; return; } void useelevator1(Context & context) { showfirstuse(context); selectlocation(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } @@ -13154,47 +13154,47 @@ void showfirstuse(Context & context) { void useelevator3(Context & context) { showfirstuse(context); - context.data.byte(39) = 20; - context.data.byte(187) = 34; - context.data.word(21) = 46; - context.data.word(23) = 63; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.word(19) = 80; - context.data.byte(102) = 1; + context.data.byte(kCounttoclose) = 20; + context.data.byte(kNewlocation) = 34; + context.data.word(kReeltowatch) = 46; + context.data.word(kEndwatchreel) = 63; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; return; } void useelevator4(Context & context) { showfirstuse(context); - context.data.word(21) = 0; - context.data.word(23) = 11; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(39) = 20; - context.data.word(19) = 80; - context.data.byte(102) = 1; - context.data.byte(187) = 24; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 11; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kCounttoclose) = 20; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; + context.data.byte(kNewlocation) = 24; return; } void useelevator2(Context & context) { - context._cmp(context.data.byte(8), 23); + context._cmp(context.data.byte(kLocation), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); - context.data.byte(187) = 23; - context.data.byte(39) = 20; - context.data.byte(38) = 0; - context.data.word(19) = 80; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 23; + context.data.byte(kCounttoclose) = 20; + context.data.byte(kCounttoopen) = 0; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; return; inpoolhall: showfirstuse(context); - context.data.byte(187) = 31; - context.data.byte(39) = 20; - context.data.byte(38) = 0; - context.data.word(19) = 80; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 31; + context.data.byte(kCounttoclose) = 20; + context.data.byte(kCounttoopen) = 0; + context.data.word(kWatchingtime) = 80; + context.data.byte(kGetback) = 1; return; } @@ -13203,20 +13203,20 @@ void useelevator5(Context & context) { placesetobject(context); context.al = 0; removesetobject(context); - context.data.byte(187) = 20; - context.data.word(19) = 80; - context.data.byte(34) = 1; - context.data.byte(39) = 8; - context.data.byte(102) = 1; + context.data.byte(kNewlocation) = 20; + context.data.word(kWatchingtime) = 80; + context.data.byte(kLiftflag) = 1; + context.data.byte(kCounttoclose) = 8; + context.data.byte(kGetback) = 1; return; } void usekey(Context & context) { - context._cmp(context.data.byte(8), 5); + context._cmp(context.data.byte(kLocation), 5); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(8), 30); + context._cmp(context.data.byte(kLocation), 30); if (context.flags.z()) goto usekey1; - context._cmp(context.data.byte(8), 21); + context._cmp(context.data.byte(kLocation), 21); if (context.flags.z()) goto usekey2; context.cx = 200; context.al = 1; @@ -13224,25 +13224,25 @@ void usekey(Context & context) { putbackobstuff(context); return; usekey1: - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(148), 10); + context._cmp(context.data.byte(kMapy), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 0; showpuztext(context); - context.data.byte(39) = 100; - context.data.byte(102) = 1; + context.data.byte(kCounttoclose) = 100; + context.data.byte(kGetback) = 1; return; usekey2: - context._cmp(context.data.byte(147), 11); + context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto wrongroom1; - context._cmp(context.data.byte(148), 10); + context._cmp(context.data.byte(kMapy), 10); if (!context.flags.z()) goto wrongroom1; context.cx = 300; context.al = 3; showpuztext(context); - context.data.byte(187) = 30; + context.data.byte(kNewlocation) = 30; context.al = 2; fadescreendown(context); showfirstuse(context); @@ -13257,7 +13257,7 @@ wrongroom1: } void usestereo(Context & context) { - context._cmp(context.data.byte(8), 0); + context._cmp(context.data.byte(kLocation), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; @@ -13265,9 +13265,9 @@ void usestereo(Context & context) { putbackobstuff(context); return; stereook: - context._cmp(context.data.byte(147), 11); + context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto stereonotok; - context._cmp(context.data.byte(148), 0); + context._cmp(context.data.byte(kMapy), 0); if (context.flags.z()) goto stereook2; stereonotok: context.cx = 400; @@ -13314,8 +13314,8 @@ stereoon: } void usecooker(Context & context) { - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); checkinside(context); context._cmp(context.cl, 114); if (!context.flags.z()) goto foodinside; @@ -13329,14 +13329,14 @@ foodinside: } void useaxe(Context & context) { - context._cmp(context.data.byte(183), 22); + context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpool; - context._cmp(context.data.byte(148), 10); + context._cmp(context.data.byte(kMapy), 10); if (context.flags.z()) goto axeondoor; showseconduse(context); - context._add(context.data.byte(1), 1); - context.data.byte(64) = 2; - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kLastweapon) = 2; + context.data.byte(kGetback) = 1; removeobfrominv(context); return; notinpool: @@ -13347,25 +13347,25 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(1), 1); - context.data.word(19) = 46*2; - context.data.word(21) = 31; - context.data.word(23) = 77; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 46*2; + context.data.word(kReeltowatch) = 31; + context.data.word(kEndwatchreel) = 77; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; return; } void useelvdoor(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); return; gotdoorwith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'A'; context.ch = 'X'; context.dl = 'E'; @@ -13381,13 +13381,13 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(1), 1); - context.data.word(19) = 46*2; - context.data.word(21) = 31; - context.data.word(23) = 77; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.word(kWatchingtime) = 46*2; + context.data.word(kReeltowatch) = 31; + context.data.word(kEndwatchreel) = 77; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } @@ -13396,8 +13396,8 @@ void withwhat(Context & context) { showpanel(context); showman(context); showexit(context); - context.al = context.data.byte(98); - context.ah = context.data.byte(101); + context.al = context.data.byte(kCommand); + context.ah = context.data.byte(kObjecttype); context.es = context.cs; context.di = 5674; copyname(context); @@ -13407,7 +13407,7 @@ void withwhat(Context & context) { context.al = 63; context.ah = 2; printmessage2(context); - context.di = context.data.word(82); + context.di = context.data.word(kLastxpos); context._add(context.di, 5); context.bx = 21; context.es = context.cs; @@ -13416,7 +13416,7 @@ void withwhat(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - context.di = context.data.word(82); + context.di = context.data.word(kLastxpos); context._add(context.di, 5); context.bx = 21; context.dl = 200; @@ -13424,12 +13424,12 @@ void withwhat(Context & context) { context.ah = 3; printmessage2(context); fillryan(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(103) = 2; + context.data.byte(kInvopen) = 2; return; } @@ -13441,21 +13441,21 @@ void selectob(Context & context) { blank(context); return; canselectob: - context.data.byte(94) = context.al; - context.data.byte(95) = context.ah; - context._cmp(context.ax, context.data.word(92)); + context.data.byte(kWithobject) = context.al; + context.data.byte(kWithtype) = context.ah; + context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto diffsub3; - context._cmp(context.data.byte(99), 221); + context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadyselob; - context.data.byte(99) = 221; + context.data.byte(kCommandtype) = 221; diffsub3: - context.data.word(92) = context.ax; + context.data.word(kOldsubject) = context.ax; context.bx = context.ax; context.al = 0; commandwithob(context); alreadyselob: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notselob; context._and(context.ax, 1); if (!context.flags.z()) goto doselob; @@ -13463,7 +13463,7 @@ notselob: return; doselob: delpointer(context); - context.data.byte(103) = 0; + context.data.byte(kInvopen) = 0; useroutine(context); return; } @@ -13490,7 +13490,7 @@ void findsetobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(426); + context.es = context.data.word(kSetdat); context.bx = 0; context.dl = 0; findsetloop: @@ -13518,7 +13518,7 @@ void findexobject(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.bx = 0+2080+30000; context.dl = 0; findexloop: @@ -13546,7 +13546,7 @@ void isryanholding(Context & context) { context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.bx = 0+2080+30000; context.dl = 0; searchinv: @@ -13574,7 +13574,7 @@ nofindininv: } void checkinside(Context & context) { - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.bx = 0+2080+30000; context.cl = 0; insideloop: @@ -13620,7 +13620,7 @@ void putbackobstuff(Context & context) { obpicture(context); describeob(context); undertextline(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); showpointer(context); worktoscreen(context); @@ -13655,7 +13655,7 @@ void findpuztext(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(452); + context.es = context.data.word(kPuzzletext); context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -13725,8 +13725,8 @@ void removefreeobject(Context & context) { void findormake(Context & context) { context.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); context.push(context.ax); - context.es = context.data.word(410); - context.ah = context.data.byte(183); + context.es = context.data.word(kBuffers); + context.ah = context.data.byte(kReallocation); changeloop: context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto haventfound; @@ -13749,17 +13749,17 @@ haventfound: } void switchryanon(Context & context) { - context.data.byte(62) = 255; + context.data.byte(kRyanon) = 255; return; } void switchryanoff(Context & context) { - context.data.byte(62) = 1; + context.data.byte(kRyanon) = 1; return; } void setallchanges(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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); setallloop: context.ax = context.es.word(context.bx); @@ -13767,7 +13767,7 @@ setallloop: if (context.flags.z()) goto endsetloop; context.cx = context.es.word(context.bx+2); context._add(context.bx, 4); - context._cmp(context.ah, context.data.byte(183)); + context._cmp(context.ah, context.data.byte(kReallocation)); if (!context.flags.z()) goto setallloop; context.push(context.es); context.push(context.bx); @@ -13799,7 +13799,7 @@ path: context.bx = context.pop(); context._add(context.bx, context.ax); context._add(context.bx, 0); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.cx = context.pop(); context.es.byte(context.bx+6) = context.cl; nopath: @@ -13822,20 +13822,20 @@ beenpickedup: } void autoappear(Context & context) { - context._cmp(context.data.byte(8), 32); + context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notinalley; context.al = 5; resetlocation(context); context.al = 10; setlocation(context); - context.data.byte(182) = 10; + context.data.byte(kDestpos) = 10; return; notinalley: - context._cmp(context.data.byte(183), 24); + context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedens; - context._cmp(context.data.byte(41), 1); + context._cmp(context.data.byte(kGeneraldead), 1); if (!context.flags.z()) goto edenspart2; - context._add(context.data.byte(41), 1); + context._add(context.data.byte(kGeneraldead), 1); context.al = 44; placesetobject(context); context.al = 18; @@ -13854,7 +13854,7 @@ notinalley: removesetobject(context); return; edenspart2: - context._cmp(context.data.byte(42), 1); + context._cmp(context.data.byte(kSartaindead), 1); if (!context.flags.z()) goto notedens2; context.al = 44; removesetobject(context); @@ -13862,23 +13862,23 @@ edenspart2: removesetobject(context); context.al = 55; placesetobject(context); - context._add(context.data.byte(42), 1); + context._add(context.data.byte(kSartaindead), 1); notedens2: return; notinedens: - context._cmp(context.data.byte(183), 25); + context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto notonsartroof; - context.data.byte(33) = 3; + context.data.byte(kNewsitem) = 3; context.al = 6; resetlocation(context); context.al = 11; setlocation(context); - context.data.byte(182) = 11; + context.data.byte(kDestpos) = 11; return; notonsartroof: - context._cmp(context.data.byte(183), 2); + context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notinlouiss; - context._cmp(context.data.byte(40), 0); + context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) goto notinlouiss; context.al = 23; placesetobject(context); @@ -13887,153 +13887,153 @@ notinlouiss: } void getundertimed(Context & context) { - context.al = context.data.byte(334); + context.al = context.data.byte(kTimedy); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(335); + context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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(context); return; } void putundertimed(Context & context) { - context.al = context.data.byte(334); + context.al = context.data.byte(kTimedy); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(335); + context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; context.ch = 30; context.cl = 240; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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(context); return; } void dumptimedtext(Context & context) { - context._cmp(context.data.byte(336), 1); + context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) goto nodumptimed; - context.al = context.data.byte(334); + context.al = context.data.byte(kTimedy); context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; - context.al = context.data.byte(335); + context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; context.cl = 240; context.ch = 30; multidump(context); - context.data.byte(336) = 0; + context.data.byte(kNeedtodumptimed) = 0; nodumptimed: return; } void setuptimeduse(Context & context) { - context._cmp(context.data.word(326), 0); + context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup; - context.data.byte(334) = context.bh; - context.data.byte(335) = context.bl; - context.data.word(328) = context.cx; + context.data.byte(kTimedy) = context.bh; + context.data.byte(kTimedx) = context.bl; + context.data.word(kCounttotimed) = context.cx; context._add(context.dx, context.cx); - context.data.word(326) = context.dx; + context.data.word(kTimecount) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(452); + context.es = context.data.word(kPuzzletext); context.cx = 66*2; context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(330) = context.es; - context.data.word(332) = context.bx; + context.data.word(kTimedseg) = context.es; + context.data.word(kTimedoffset) = context.bx; cantsetup: return; } void setuptimedtemp(Context & context) { - context._cmp(context.data.word(326), 0); + context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup2; - context.data.byte(334) = context.bh; - context.data.byte(335) = context.bl; - context.data.word(328) = context.cx; + context.data.byte(kTimedy) = context.bh; + context.data.byte(kTimedx) = context.bl; + context.data.word(kCounttotimed) = context.cx; context._add(context.dx, context.cx); - context.data.word(326) = context.dx; + context.data.word(kTimecount) = context.dx; context.bl = context.al; context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.cx = 66*2; context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; - context.data.word(330) = context.es; - context.data.word(332) = context.bx; + context.data.word(kTimedseg) = context.es; + context.data.word(kTimedoffset) = context.bx; cantsetup2: return; } void usetimedtext(Context & context) { - context._cmp(context.data.word(326), 0); + context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto notext; - context._sub(context.data.word(326), 1); - context._cmp(context.data.word(326), 0); + context._sub(context.data.word(kTimecount), 1); + context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto deltimedtext; - context.ax = context.data.word(326); - context._cmp(context.ax, context.data.word(328)); + context.ax = context.data.word(kTimecount); + context._cmp(context.ax, context.data.word(kCounttotimed)); if (context.flags.z()) goto firsttimed; if (!context.flags.c()) goto notext; goto notfirsttimed; firsttimed: getundertimed(context); notfirsttimed: - context.bl = context.data.byte(334); + context.bl = context.data.byte(kTimedy); context.bh = 0; - context.al = context.data.byte(335); + context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; - context.es = context.data.word(330); - context.si = context.data.word(332); + context.es = context.data.word(kTimedseg); + context.si = context.data.word(kTimedoffset); context.dl = 237; context.ah = 0; printdirect(context); - context.data.byte(336) = 1; + context.data.byte(kNeedtodumptimed) = 1; notext: return; deltimedtext: putundertimed(context); - context.data.byte(336) = 1; + context.data.byte(kNeedtodumptimed) = 1; return; } void edenscdplayer(Context & context) { showfirstuse(context); - context.data.word(19) = 18*2; - context.data.word(21) = 25; - context.data.word(23) = 42; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 18*2; + context.data.word(kReeltowatch) = 25; + context.data.word(kEndwatchreel) = 42; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; return; } void usewall(Context & context) { showfirstuse(context); - context._cmp(context.data.byte(474), 3); + context._cmp(context.data.byte(kManspath), 3); if (context.flags.z()) goto gobackover; - context.data.word(19) = 30*2; - context.data.word(21) = 2; - context.data.word(23) = 31; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 30*2; + context.data.word(kReeltowatch) = 2; + context.data.word(kEndwatchreel) = 31; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; context.al = 3; turnpathon(context); context.al = 4; @@ -14046,19 +14046,19 @@ void usewall(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context.data.byte(474) = 3; - context.data.byte(476) = 3; + context.data.byte(kManspath) = 3; + context.data.byte(kFinaldest) = 3; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; switchryanoff(context); return; gobackover: - context.data.word(19) = 30*2; - context.data.word(21) = 34; - context.data.word(23) = 60; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; + context.data.word(kWatchingtime) = 30*2; + context.data.word(kReeltowatch) = 34; + context.data.word(kEndwatchreel) = 60; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; context.al = 3; turnpathoff(context); context.al = 4; @@ -14071,22 +14071,22 @@ gobackover: turnpathon(context); context.al = 5; turnpathon(context); - context.data.byte(474) = 5; - context.data.byte(476) = 5; + context.data.byte(kManspath) = 5; + context.data.byte(kFinaldest) = 5; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; switchryanoff(context); return; } void usechurchgate(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gatewith; withwhat(context); return; gatewith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'C'; context.ch = 'U'; context.dl = 'T'; @@ -14100,16 +14100,16 @@ gatewith: return; cutgate: showfirstuse(context); - context.data.word(19) = 64*2; - context.data.word(21) = 4; - context.data.word(23) = 70; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.word(kWatchingtime) = 64*2; + context.data.word(kReeltowatch) = 4; + context.data.word(kEndwatchreel) = 70; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); context.al = 3; turnpathon(context); - context._cmp(context.data.byte(43), 0); + context._cmp(context.data.byte(kAidedead), 0); if (context.flags.z()) goto notopenchurch; context.al = 2; turnpathon(context); @@ -14118,153 +14118,153 @@ notopenchurch: } void usegun(Context & context) { - context._cmp(context.data.byte(101), 4); + context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); return; istakengun: - context._cmp(context.data.byte(183), 22); + context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpoolroom; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(64) = 1; - context.data.byte(63) = 39; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.byte(kLastweapon) = 1; + context.data.byte(kCombatcount) = 39; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; notinpoolroom: - context._cmp(context.data.byte(183), 25); + context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto nothelicopter; context.cx = 300; context.al = 34; showpuztext(context); - context.data.byte(64) = 1; - context.data.byte(63) = 19; - context.data.byte(102) = 1; - context.data.byte(65) = 2; - context.data.byte(66) = 38; - context.data.byte(42) = 1; - context._add(context.data.byte(1), 1); + context.data.byte(kLastweapon) = 1; + context.data.byte(kCombatcount) = 19; + context.data.byte(kGetback) = 1; + context.data.byte(kDreamnumber) = 2; + context.data.byte(kRoomafterdream) = 38; + context.data.byte(kSartaindead) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; nothelicopter: - context._cmp(context.data.byte(183), 27); + context._cmp(context.data.byte(kReallocation), 27); if (!context.flags.z()) goto notinrockroom; context.cx = 300; context.al = 46; showpuztext(context); - context.data.byte(233) = 2; - context.data.byte(40) = 1; - context.data.byte(64) = 1; - context.data.byte(33) = 1; - context.data.byte(102) = 1; - context.data.byte(66) = 32; - context.data.byte(65) = 0; - context._add(context.data.byte(1), 1); + context.data.byte(kPointermode) = 2; + context.data.byte(kRockstardead) = 1; + context.data.byte(kLastweapon) = 1; + context.data.byte(kNewsitem) = 1; + context.data.byte(kGetback) = 1; + context.data.byte(kRoomafterdream) = 32; + context.data.byte(kDreamnumber) = 0; + context._add(context.data.byte(kProgresspoints), 1); return; notinrockroom: - context._cmp(context.data.byte(183), 8); + context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(148), 40); + context._cmp(context.data.byte(kMapy), 40); if (!context.flags.z()) goto notbystudio; context.al = 92; issetobonmap(context); if (context.flags.z()) goto notbystudio; - context._cmp(context.data.byte(474), 9); + context._cmp(context.data.byte(kManspath), 9); if (context.flags.z()) goto notbystudio; - context.data.byte(477) = 9; - context.data.byte(476) = 9; + context.data.byte(kDestination) = 9; + context.data.byte(kFinaldest) = 9; autosetwalk(context); - context.data.byte(64) = 1; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.byte(kLastweapon) = 1; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; notbystudio: - context._cmp(context.data.byte(183), 6); + context._cmp(context.data.byte(kReallocation), 6); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(147), 11); + context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto notsarters; - context._cmp(context.data.byte(148), 20); + context._cmp(context.data.byte(kMapy), 20); if (!context.flags.z()) goto notsarters; context.al = 5; issetobonmap(context); if (!context.flags.z()) goto notsarters; - context.data.byte(477) = 1; - context.data.byte(476) = 1; + context.data.byte(kDestination) = 1; + context.data.byte(kFinaldest) = 1; autosetwalk(context); context.al = 5; removesetobject(context); context.al = 6; placesetobject(context); context.al = 1; - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._sub(context.ah, 1); turnanypathon(context); - context.data.byte(34) = 1; - context.data.word(19) = 40*2; - context.data.word(21) = 4; - context.data.word(23) = 43; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.byte(kLiftflag) = 1; + context.data.word(kWatchingtime) = 40*2; + context.data.word(kReeltowatch) = 4; + context.data.word(kEndwatchreel) = 43; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; notsarters: - context._cmp(context.data.byte(183), 29); + context._cmp(context.data.byte(kReallocation), 29); if (!context.flags.z()) goto notaide; - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; context.al = 13; resetlocation(context); context.al = 12; setlocation(context); - context.data.byte(182) = 12; - context.data.byte(477) = 2; - context.data.byte(476) = 2; + context.data.byte(kDestpos) = 12; + context.data.byte(kDestination) = 2; + context.data.byte(kFinaldest) = 2; autosetwalk(context); - context.data.word(19) = 164*2; - context.data.word(21) = 3; - context.data.word(23) = 164; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(43) = 1; - context.data.byte(65) = 3; - context.data.byte(66) = 33; - context._add(context.data.byte(1), 1); + context.data.word(kWatchingtime) = 164*2; + context.data.word(kReeltowatch) = 3; + context.data.word(kEndwatchreel) = 164; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kAidedead) = 1; + context.data.byte(kDreamnumber) = 3; + context.data.byte(kRoomafterdream) = 33; + context._add(context.data.byte(kProgresspoints), 1); return; notaide: - context._cmp(context.data.byte(183), 23); + context._cmp(context.data.byte(kReallocation), 23); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(147), 0); + context._cmp(context.data.byte(kMapx), 0); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(148), 50); + context._cmp(context.data.byte(kMapy), 50); if (!context.flags.z()) goto notwithboss; - context._cmp(context.data.byte(474), 5); + context._cmp(context.data.byte(kManspath), 5); if (context.flags.z()) goto pathokboss; - context.data.byte(477) = 5; - context.data.byte(476) = 5; + context.data.byte(kDestination) = 5; + context.data.byte(kFinaldest) = 5; autosetwalk(context); pathokboss: - context.data.byte(64) = 1; - context.data.byte(102) = 1; + context.data.byte(kLastweapon) = 1; + context.data.byte(kGetback) = 1; return; notwithboss: - context._cmp(context.data.byte(183), 8); + context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(147), 11); + context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(148), 10); + context._cmp(context.data.byte(kMapy), 10); if (!context.flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(474), 2); + context._cmp(context.data.byte(kManspath), 2); if (context.flags.z()) goto pathoktv; - context.data.byte(477) = 2; - context.data.byte(476) = 2; + context.data.byte(kDestination) = 2; + context.data.byte(kFinaldest) = 2; autosetwalk(context); pathoktv: - context.data.byte(64) = 1; - context.data.byte(102) = 1; + context.data.byte(kLastweapon) = 1; + context.data.byte(kGetback) = 1; return; nottvsoldier: showfirstuse(context); @@ -14273,14 +14273,14 @@ nottvsoldier: } void useshield(Context & context) { - context._cmp(context.data.byte(183), 20); + context._cmp(context.data.byte(kReallocation), 20); if (!context.flags.z()) goto notinsartroom; - context._cmp(context.data.byte(63), 0); + context._cmp(context.data.byte(kCombatcount), 0); if (context.flags.z()) goto notinsartroom; - context.data.byte(64) = 3; + context.data.byte(kLastweapon) = 3; showseconduse(context); - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); removeobfrominv(context); return; notinsartroom: @@ -14295,20 +14295,20 @@ void usebuttona(Context & context) { if (context.flags.z()) goto donethisbit; showfirstuse(context); context.al = 0; - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._sub(context.ah, 1); turnanypathon(context); context.al = 9; removesetobject(context); context.al = 95; placesetobject(context); - context.data.word(19) = 15*2; - context.data.word(21) = 71; - context.data.word(23) = 85; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.word(kWatchingtime) = 15*2; + context.data.word(kReeltowatch) = 71; + context.data.word(kEndwatchreel) = 85; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; donethisbit: showseconduse(context); @@ -14317,21 +14317,21 @@ donethisbit: } void useplate(Context & context) { - context._cmp(context.data.byte(94), 255); + context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto platewith; withwhat(context); return; platewith: - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'S'; context.ch = 'C'; context.dl = 'R'; context.dh = 'W'; compare(context); if (context.flags.z()) goto unscrewplate; - context.al = context.data.byte(94); - context.ah = context.data.byte(95); + context.al = context.data.byte(kWithobject); + context.ah = context.data.byte(kWithtype); context.cl = 'K'; context.ch = 'N'; context.dl = 'F'; @@ -14355,8 +14355,8 @@ unscrewplate: removesetobject(context); context.al = 0; placefreeobject(context); - context._add(context.data.byte(1), 1); - context.data.byte(102) = 1; + context._add(context.data.byte(kProgresspoints), 1); + context.data.byte(kGetback) = 1; return; triedknife: context.cx = 300; @@ -14380,19 +14380,19 @@ void usewinch(Context & context) { context.dh = 'E'; compare(context); if (!context.flags.z()) goto nowinch; - context.data.word(19) = 217*2; - context.data.word(21) = 0; - context.data.word(23) = 217; - context.data.byte(26) = 1; - context.data.byte(25) = 1; - context.data.byte(182) = 1; - context.data.byte(187) = 45; - context.data.byte(65) = 1; - context.data.byte(66) = 44; - context.data.byte(41) = 1; - context.data.byte(33) = 2; - context.data.byte(102) = 1; - context._add(context.data.byte(1), 1); + context.data.word(kWatchingtime) = 217*2; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 217; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; + context.data.byte(kDestpos) = 1; + context.data.byte(kNewlocation) = 45; + context.data.byte(kDreamnumber) = 1; + context.data.byte(kRoomafterdream) = 44; + context.data.byte(kGeneraldead) = 1; + context.data.byte(kNewsitem) = 2; + context.data.byte(kGetback) = 1; + context._add(context.data.byte(kProgresspoints), 1); return; nowinch: showfirstuse(context); @@ -14401,8 +14401,8 @@ nowinch: } void entercode(Context & context) { - context.data.word(282) = context.ax; - context.data.word(284) = context.cx; + context.data.word(kKeypadax) = context.ax; + context.data.word(kKeypadcx) = context.cx; getridofreels(context); loadkeypad(context); createpanel(context); @@ -14413,20 +14413,20 @@ void entercode(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.word(278) = 0; - context.data.byte(102) = 0; + context.data.word(kPresspointer) = 0; + context.data.byte(kGetback) = 0; keypadloop: delpointer(context); readmouse(context); showkeypad(context); showpointer(context); - context._cmp(context.data.byte(281), 0); + context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nopresses; - context._sub(context.data.byte(281), 1); + context._sub(context.data.byte(kPresscount), 1); goto afterpress; nopresses: - context.data.byte(277) = 255; - context.data.byte(280) = 255; + context.data.byte(kPressed) = 255; + context.data.byte(kGraphicpress) = 255; vsync(context); afterpress: dumppointer(context); @@ -14434,37 +14434,37 @@ afterpress: dumptextline(context); context.bx = 3393; checkcoords(context); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (context.flags.z()) goto numberright; - context._cmp(context.data.byte(286), 1); + context._cmp(context.data.byte(kLightcount), 1); if (!context.flags.z()) goto notendkey; - context._cmp(context.data.byte(36), 0); + context._cmp(context.data.byte(kLockstatus), 0); if (context.flags.z()) goto numberright; goto keypadloop; notendkey: - context._cmp(context.data.byte(281), 40); + context._cmp(context.data.byte(kPresscount), 40); if (!context.flags.z()) goto keypadloop; addtopresslist(context); - context._cmp(context.data.byte(277), 11); + context._cmp(context.data.byte(kPressed), 11); if (!context.flags.z()) goto keypadloop; - context.ax = context.data.word(282); - context.cx = context.data.word(284); + context.ax = context.data.word(kKeypadax); + context.cx = context.data.word(kKeypadcx); isitright(context); if (!context.flags.z()) goto incorrect; - context.data.byte(36) = 0; + context.data.byte(kLockstatus) = 0; context.al = 11; playchannel1(context); - context.data.byte(286) = 120; - context.data.word(278) = 0; + context.data.byte(kLightcount) = 120; + context.data.word(kPresspointer) = 0; goto keypadloop; incorrect: context.al = 11; playchannel1(context); - context.data.byte(286) = 120; - context.data.word(278) = 0; + context.data.byte(kLightcount) = 120; + context.data.word(kPresspointer) = 0; goto keypadloop; numberright: - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; getridoftemp(context); restorereels(context); redrawmainscrn(context); @@ -14479,38 +14479,38 @@ void loadkeypad(Context & context) { } void quitkey(Context & context) { - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyqk; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 4; commandonly(context); alreadyqk: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notqk; context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: return; doqk: - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void addtopresslist(Context & context) { - context._cmp(context.data.word(278), 5); + context._cmp(context.data.word(kPresspointer), 5); if (context.flags.z()) goto nomorekeys; - context.al = context.data.byte(277); + context.al = context.data.byte(kPressed); context._cmp(context.al, 10); if (!context.flags.z()) goto not10; context.al = 0; not10: - context.bx = context.data.word(278); + context.bx = context.data.word(kPresspointer); context.dx = context.ds; context.es = context.dx; context._add(context.bx, 8344); context.es.byte(context.bx) = context.al; - context._add(context.data.word(278), 1); + context._add(context.data.word(kPresspointer), 1); nomorekeys: return; } @@ -14584,27 +14584,27 @@ void buttonenter(Context & context) { void buttonpress(Context & context) { context.ch = context.cl; context._add(context.ch, 100); - context._cmp(context.data.byte(99), context.ch); + context._cmp(context.data.byte(kCommandtype), context.ch); if (context.flags.z()) goto alreadyb; - context.data.byte(99) = context.ch; + context.data.byte(kCommandtype) = context.ch; context.al = context.cl; context._add(context.al, 4); context.push(context.cx); commandonly(context); context.cx = context.pop(); alreadyb: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notb; context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: return; dob: - context.data.byte(277) = context.cl; + context.data.byte(kPressed) = context.cl; context._add(context.cl, 21); - context.data.byte(280) = context.cl; - context.data.byte(281) = 40; + context.data.byte(kGraphicpress) = context.cl; + context.data.byte(kPresscount) = 40; context._cmp(context.cl, 32); if (context.flags.z()) goto nonoise; context.al = 10; @@ -14616,13 +14616,13 @@ nonoise: void showouterpad(Context & context) { context.di = 36+112-3; context.bx = 72-4; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 1; context.ah = 0; showframe(context); context.di = 36+112+74; context.bx = 72+76; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.al = 37; context.ah = 0; showframe(context); @@ -14674,23 +14674,23 @@ void showkeypad(Context & context) { context.di = 36+112+31; context.bx = 72+59; singlekey(context); - context._cmp(context.data.byte(286), 0); + context._cmp(context.data.byte(kLightcount), 0); if (context.flags.z()) goto notenter; - context._sub(context.data.byte(286), 1); + context._sub(context.data.byte(kLightcount), 1); context.al = 36; context.bx = 72-1+63; - context._cmp(context.data.byte(36), 0); + context._cmp(context.data.byte(kLockstatus), 0); if (!context.flags.z()) goto changelight; context.al = 41; context.bx = 72+4+63; changelight: - context._cmp(context.data.byte(286), 60); + context._cmp(context.data.byte(kLightcount), 60); if (context.flags.c()) goto gotlight; - context._cmp(context.data.byte(286), 100); + context._cmp(context.data.byte(kLightcount), 100); if (!context.flags.c()) goto gotlight; context._sub(context.al, 1); gotlight: - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 0; context.di = 36+112+60; showframe(context); @@ -14699,14 +14699,14 @@ notenter: } void singlekey(Context & context) { - context._cmp(context.data.byte(280), context.al); + context._cmp(context.data.byte(kGraphicpress), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); - context._cmp(context.data.byte(281), 8); + context._cmp(context.data.byte(kPresscount), 8); if (!context.flags.c()) goto gotkey; context._sub(context.al, 11); gotkey: - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context._sub(context.al, 20); context.ah = 0; showframe(context); @@ -14728,24 +14728,24 @@ void usemenu(Context & context) { createpanel(context); showpanel(context); showicon(context); - context.data.byte(61) = 0; + context.data.byte(kNewobs) = 0; drawfloor(context); printsprites(context); context.al = 4; context.ah = 0; context.di = 80+40-48; context.bx = 60-4; - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); showframe(context); getundermenu(context); context.al = 5; context.ah = 0; context.di = 80+40+54; context.bx = 60+72; - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); showframe(context); worktoscreenm(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; menuloop: delpointer(context); putundermenu(context); @@ -14758,9 +14758,9 @@ menuloop: dumptextline(context); context.bx = 3525; checkcoords(context); - context._cmp(context.data.byte(102), 1); + context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto menuloop; - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); getridoftemp(context); getridoftemp2(context); @@ -14785,7 +14785,7 @@ void getundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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(context); return; @@ -14796,7 +14796,7 @@ void putundermenu(Context & context) { context.bx = 60; context.cl = 48; context.ch = 48; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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(context); return; @@ -14807,41 +14807,41 @@ void showoutermenu(Context & context) { context.ah = 0; context.di = 80+40-34; context.bx = 60-40; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 41; context.ah = 0; context.di = 80+40+64-34; context.bx = 60-40; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 42; context.ah = 0; context.di = 80+40-26; context.bx = 60+57-40; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 43; context.ah = 0; context.di = 80+40+64-26; context.bx = 60+57-40; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); return; } void showmenu(Context & context) { - context._add(context.data.byte(289), 1); - context._cmp(context.data.byte(289), 37*2); + context._add(context.data.byte(kMenucount), 1); + context._cmp(context.data.byte(kMenucount), 37*2); if (!context.flags.z()) goto menuframeok; - context.data.byte(289) = 0; + context.data.byte(kMenucount) = 0; menuframeok: - context.al = context.data.byte(289); + context.al = context.data.byte(kMenucount); context._shr(context.al, 1); context.ah = 0; context.di = 80+40; context.bx = 60; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); return; } @@ -14855,13 +14855,13 @@ void loadmenu(Context & context) { } void viewfolder(Context & context) { - context.data.byte(130) = 1; + context.data.byte(kManisoffscreen) = 1; getridofall(context); loadfolder(context); - context.data.byte(287) = 0; + context.data.byte(kFolderpage) = 0; showfolder(context); worktoscreenm(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; folderloop: delpointer(context); readmouse(context); @@ -14871,9 +14871,9 @@ folderloop: dumptextline(context); context.bx = 3547; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto folderloop; - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); @@ -14885,30 +14885,30 @@ folderloop: } void nextfolder(Context & context) { - context._cmp(context.data.byte(287), 12); + context._cmp(context.data.byte(kFolderpage), 12); if (!context.flags.z()) goto cannextf; blank(context); return; cannextf: - context._cmp(context.data.byte(99), 201); + context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadynextf; - context.data.byte(99) = 201; + context.data.byte(kCommandtype) = 201; context.al = 16; commandonly(context); alreadynextf: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notnextf; context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: return; donextf: - context._add(context.data.byte(287), 1); + context._add(context.data.byte(kFolderpage), 1); folderhints(context); delpointer(context); showfolder(context); - context.data.word(200) = 0; + context.data.word(kMousebutton) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -14916,9 +14916,9 @@ donextf: } void folderhints(Context & context) { - context._cmp(context.data.byte(287), 5); + context._cmp(context.data.byte(kFolderpage), 5); if (!context.flags.z()) goto notaideadd; - context._cmp(context.data.byte(43), 1); + context._cmp(context.data.byte(kAidedead), 1); if (context.flags.z()) goto notaideadd; context.al = 13; getlocation(context); @@ -14939,7 +14939,7 @@ void folderhints(Context & context) { hangonp(context); return; notaideadd: - context._cmp(context.data.byte(287), 9); + context._cmp(context.data.byte(kFolderpage), 9); if (!context.flags.z()) goto notaristoadd; context.al = 7; getlocation(context); @@ -14963,31 +14963,31 @@ notaristoadd: } void lastfolder(Context & context) { - context._cmp(context.data.byte(287), 0); + context._cmp(context.data.byte(kFolderpage), 0); if (!context.flags.z()) goto canlastf; blank(context); return; canlastf: - context._cmp(context.data.byte(99), 202); + context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadylastf; - context.data.byte(99) = 202; + context.data.byte(kCommandtype) = 202; context.al = 17; commandonly(context); alreadylastf: - context._cmp(context.data.byte(287), 0); + context._cmp(context.data.byte(kFolderpage), 0); if (context.flags.z()) goto notlastf; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notlastf; context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: return; dolastf: - context._sub(context.data.byte(287), 1); + context._sub(context.data.byte(kFolderpage), 1); delpointer(context); showfolder(context); - context.data.word(200) = 0; + context.data.word(kMousebutton) = 0; context.bx = 3547; checkcoords(context); worktoscreenm(context); @@ -15009,41 +15009,41 @@ void loadfolder(Context & context) { } void showfolder(Context & context) { - context.data.byte(99) = 255; - context._cmp(context.data.byte(287), 0); + context.data.byte(kCommandtype) = 255; + context._cmp(context.data.byte(kFolderpage), 0); if (context.flags.z()) goto closedfolder; usetempcharset(context); createpanel2(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 143; context.bx = 0; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 0; context.bx = 92; context.al = 2; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 143; context.bx = 92; context.al = 3; context.ah = 0; showframe(context); folderexit(context); - context._cmp(context.data.byte(287), 1); + context._cmp(context.data.byte(kFolderpage), 1); if (context.flags.z()) goto noleftpage; showleftpage(context); noleftpage: - context._cmp(context.data.byte(287), 12); + context._cmp(context.data.byte(kFolderpage), 12); if (context.flags.z()) goto norightpage; showrightpage(context); norightpage: @@ -15052,13 +15052,13 @@ norightpage: return; closedfolder: createpanel2(context); - context.ds = context.data.word(460); + context.ds = context.data.word(kTempgraphics3); context.di = 143-28; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(460); + context.ds = context.data.word(kTempgraphics3); context.di = 143-28; context.bx = 92; context.al = 1; @@ -15070,7 +15070,7 @@ closedfolder: } void folderexit(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 296; context.bx = 178; context.al = 6; @@ -15080,7 +15080,7 @@ void folderexit(Context & context) { } void showleftpage(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 0; context.bx = 12; context.al = 3; @@ -15091,7 +15091,7 @@ void showleftpage(Context & context) { leftpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 0; context.al = 4; context.ah = 0; @@ -15100,21 +15100,21 @@ leftpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto leftpageloop; - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 0; context.al = 5; context.ah = 0; showframe(context); - context.data.word(75) = 8; - context.data.word(69) = 91; - context.data.byte(71) = 1; - context.bl = context.data.byte(287); + context.data.word(kLinespacing) = 8; + context.data.word(kCharshift) = 91; + context.data.byte(kKerning) = 1; + context.bl = context.data.byte(kFolderpage); context._sub(context.bl, 1); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 2; @@ -15125,16 +15125,16 @@ twolotsleft: context.push(context.cx); contleftpage: printdirect(context); - context._add(context.bx, context.data.word(75)); + context._add(context.bx, context.data.word(kLinespacing)); context._cmp(context.al, 0); if (!context.flags.z()) goto contleftpage; context.cx = context.pop(); if (--context.cx) goto twolotsleft; - context.data.byte(71) = 0; - context.data.word(69) = 0; - context.data.word(75) = 10; - context.es = context.data.word(398); - context.ds = context.data.word(398); + context.data.byte(kKerning) = 0; + context.data.word(kCharshift) = 0; + context.data.word(kLinespacing) = 10; + context.es = context.data.word(kWorkspace); + context.ds = context.data.word(kWorkspace); context.di = (48*320)+2; context.si = (48*320)+2+130; context.cx = 120; @@ -15161,7 +15161,7 @@ flipfolderline: } void showrightpage(Context & context) { - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 143; context.bx = 12; context.al = 0; @@ -15172,7 +15172,7 @@ void showrightpage(Context & context) { rightpageloop: context.push(context.cx); context.push(context.bx); - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 143; context.al = 1; context.ah = 0; @@ -15181,19 +15181,19 @@ rightpageloop: context.cx = context.pop(); context._add(context.bx, 16); if (--context.cx) goto rightpageloop; - context.ds = context.data.word(458); + context.ds = context.data.word(kTempgraphics2); context.di = 143; context.al = 2; context.ah = 0; showframe(context); - context.data.word(75) = 8; - context.data.byte(71) = 1; - context.bl = context.data.byte(287); + context.data.word(kLinespacing) = 8; + context.data.byte(kKerning) = 1; + context.bl = context.data.byte(kFolderpage); context._sub(context.bl, 1); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.si = context.es.word(context.bx); context._add(context.si, 66*2); context.di = 152; @@ -15204,30 +15204,30 @@ twolotsright: context.push(context.cx); contrightpage: printdirect(context); - context._add(context.bx, context.data.word(75)); + context._add(context.bx, context.data.word(kLinespacing)); context._cmp(context.al, 0); if (!context.flags.z()) goto contrightpage; context.cx = context.pop(); if (--context.cx) goto twolotsright; - context.data.byte(71) = 0; - context.data.word(75) = 10; + context.data.byte(kKerning) = 0; + context.data.word(kLinespacing) = 10; return; } void entersymbol(Context & context) { - context.data.byte(130) = 1; + context.data.byte(kManisoffscreen) = 1; getridofreels(context); context.dx = 2338; loadintotemp(context); - context.data.byte(290) = 24; - context.data.byte(292) = 0; - context.data.byte(293) = 24; - context.data.byte(295) = 0; + context.data.byte(kSymboltopx) = 24; + context.data.byte(kSymboltopdir) = 0; + context.data.byte(kSymbolbotx) = 24; + context.data.byte(kSymbolbotdir) = 0; redrawmainscrn(context); showsymbol(context); undertextline(context); worktoscreenm(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; symbolloop: delpointer(context); updatesymboltop(context); @@ -15241,21 +15241,21 @@ symbolloop: dumpsymbol(context); context.bx = 3589; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto symbolloop; - context._cmp(context.data.byte(294), 3); + context._cmp(context.data.byte(kSymbolbotnum), 3); if (!context.flags.z()) goto symbolwrong; - context._cmp(context.data.byte(291), 5); + context._cmp(context.data.byte(kSymboltopnum), 5); if (!context.flags.z()) goto symbolwrong; context.al = 43; removesetobject(context); context.al = 46; placesetobject(context); - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._add(context.ah, 12); context.al = 0; turnanypathon(context); - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15268,11 +15268,11 @@ symbolwrong: removesetobject(context); context.al = 43; placesetobject(context); - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._add(context.ah, 12); context.al = 0; turnanypathoff(context); - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); getridoftemp(context); restorereels(context); @@ -15281,94 +15281,94 @@ symbolwrong: } void quitsymbol(Context & context) { - context._cmp(context.data.byte(290), 24); + context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(293), 24); + context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyqs; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 18; commandonly(context); alreadyqs: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notqs; context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: return; doqs: - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; return; } void settopleft(Context & context) { - context._cmp(context.data.byte(292), 0); + context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 210); + context._cmp(context.data.byte(kCommandtype), 210); if (context.flags.z()) goto alreadytopl; - context.data.byte(99) = 210; + context.data.byte(kCommandtype) = 210; context.al = 19; commandonly(context); alreadytopl: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto notopleft; - context.data.byte(292) = -1; + context.data.byte(kSymboltopdir) = -1; notopleft: return; } void settopright(Context & context) { - context._cmp(context.data.byte(292), 0); + context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 211); + context._cmp(context.data.byte(kCommandtype), 211); if (context.flags.z()) goto alreadytopr; - context.data.byte(99) = 211; + context.data.byte(kCommandtype) = 211; context.al = 20; commandonly(context); alreadytopr: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto notopright; - context.data.byte(292) = 1; + context.data.byte(kSymboltopdir) = 1; notopright: return; } void setbotleft(Context & context) { - context._cmp(context.data.byte(295), 0); + context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 212); + context._cmp(context.data.byte(kCommandtype), 212); if (context.flags.z()) goto alreadybotl; - context.data.byte(99) = 212; + context.data.byte(kCommandtype) = 212; context.al = 21; commandonly(context); alreadybotl: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto nobotleft; - context.data.byte(295) = -1; + context.data.byte(kSymbolbotdir) = -1; nobotleft: return; } void setbotright(Context & context) { - context._cmp(context.data.byte(295), 0); + context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 213); + context._cmp(context.data.byte(kCommandtype), 213); if (context.flags.z()) goto alreadybotr; - context.data.byte(99) = 213; + context.data.byte(kCommandtype) = 213; context.al = 22; commandonly(context); alreadybotr: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto nobotright; - context.data.byte(295) = 1; + context.data.byte(kSymbolbotdir) = 1; nobotright: return; } void dumpsymbol(Context & context) { - context.data.byte(108) = 0; + context.data.byte(kNewtextline) = 0; context.di = 64; context.bx = 56+20; context.cl = 104; @@ -15382,15 +15382,15 @@ void showsymbol(Context & context) { context.ah = 0; context.di = 64; context.bx = 56; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); - context.al = context.data.byte(290); + context.al = context.data.byte(kSymboltopx); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(291); + context.al = context.data.byte(kSymboltopnum); context.bx = 56+20; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15415,14 +15415,14 @@ void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - context.al = context.data.byte(293); + context.al = context.data.byte(kSymbolbotx); context.ah = 0; context.di = context.ax; context._add(context.di, 64-44); - context.al = context.data.byte(294); + context.al = context.data.byte(kSymbolbotnum); context._add(context.al, 6); context.bx = 56+49; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 32; context.push(context.ax); context.push(context.di); @@ -15466,88 +15466,88 @@ botwrap: } void updatesymboltop(Context & context) { - context._cmp(context.data.byte(292), 0); + context._cmp(context.data.byte(kSymboltopdir), 0); if (context.flags.z()) goto topfinished; - context._cmp(context.data.byte(292), -1); + context._cmp(context.data.byte(kSymboltopdir), -1); if (context.flags.z()) goto backwards; - context._add(context.data.byte(290), 1); - context._cmp(context.data.byte(290), 49); + context._add(context.data.byte(kSymboltopx), 1); + context._cmp(context.data.byte(kSymboltopx), 49); if (!context.flags.z()) goto notwrapfor; - context.data.byte(290) = 0; - context._sub(context.data.byte(291), 1); - context._cmp(context.data.byte(291), -1); + context.data.byte(kSymboltopx) = 0; + context._sub(context.data.byte(kSymboltopnum), 1); + context._cmp(context.data.byte(kSymboltopnum), -1); if (!context.flags.z()) goto topfinished; - context.data.byte(291) = 5; + context.data.byte(kSymboltopnum) = 5; return; notwrapfor: - context._cmp(context.data.byte(290), 24); + context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 0; + context.data.byte(kSymboltopdir) = 0; return; backwards: - context._sub(context.data.byte(290), 1); - context._cmp(context.data.byte(290), -1); + context._sub(context.data.byte(kSymboltopx), 1); + context._cmp(context.data.byte(kSymboltopx), -1); if (!context.flags.z()) goto notwrapback; - context.data.byte(290) = 48; - context._add(context.data.byte(291), 1); - context._cmp(context.data.byte(291), 6); + context.data.byte(kSymboltopx) = 48; + context._add(context.data.byte(kSymboltopnum), 1); + context._cmp(context.data.byte(kSymboltopnum), 6); if (!context.flags.z()) goto topfinished; - context.data.byte(291) = 0; + context.data.byte(kSymboltopnum) = 0; return; notwrapback: - context._cmp(context.data.byte(290), 24); + context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; - context.data.byte(292) = 0; + context.data.byte(kSymboltopdir) = 0; topfinished: return; } void updatesymbolbot(Context & context) { - context._cmp(context.data.byte(295), 0); + context._cmp(context.data.byte(kSymbolbotdir), 0); if (context.flags.z()) goto botfinished; - context._cmp(context.data.byte(295), -1); + context._cmp(context.data.byte(kSymbolbotdir), -1); if (context.flags.z()) goto backwardsbot; - context._add(context.data.byte(293), 1); - context._cmp(context.data.byte(293), 49); + context._add(context.data.byte(kSymbolbotx), 1); + context._cmp(context.data.byte(kSymbolbotx), 49); if (!context.flags.z()) goto notwrapforb; - context.data.byte(293) = 0; - context._sub(context.data.byte(294), 1); - context._cmp(context.data.byte(294), -1); + context.data.byte(kSymbolbotx) = 0; + context._sub(context.data.byte(kSymbolbotnum), 1); + context._cmp(context.data.byte(kSymbolbotnum), -1); if (!context.flags.z()) goto botfinished; - context.data.byte(294) = 5; + context.data.byte(kSymbolbotnum) = 5; return; notwrapforb: - context._cmp(context.data.byte(293), 24); + context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 0; + context.data.byte(kSymbolbotdir) = 0; return; backwardsbot: - context._sub(context.data.byte(293), 1); - context._cmp(context.data.byte(293), -1); + context._sub(context.data.byte(kSymbolbotx), 1); + context._cmp(context.data.byte(kSymbolbotx), -1); if (!context.flags.z()) goto notwrapbackb; - context.data.byte(293) = 48; - context._add(context.data.byte(294), 1); - context._cmp(context.data.byte(294), 6); + context.data.byte(kSymbolbotx) = 48; + context._add(context.data.byte(kSymbolbotnum), 1); + context._cmp(context.data.byte(kSymbolbotnum), 6); if (!context.flags.z()) goto botfinished; - context.data.byte(294) = 0; + context.data.byte(kSymbolbotnum) = 0; return; notwrapbackb: - context._cmp(context.data.byte(293), 24); + context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; - context.data.byte(295) = 0; + context.data.byte(kSymbolbotdir) = 0; botfinished: return; } void dumpsymbox(Context & context) { - context._cmp(context.data.word(301), -1); + context._cmp(context.data.word(kDumpx), -1); if (context.flags.z()) goto nodumpsym; - context.di = context.data.word(301); - context.bx = context.data.word(303); + context.di = context.data.word(kDumpx); + context.bx = context.data.word(kDumpy); context.cl = 30; context.ch = 77; multidump(context); - context.data.word(301) = -1; + context.data.word(kDumpx) = -1; nodumpsym: return; } @@ -15569,7 +15569,7 @@ void usediary(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; diaryloop: delpointer(context); readmouse(context); @@ -15581,13 +15581,13 @@ diaryloop: dumptextline(context); context.bx = 3651; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto diaryloop; getridoftemp(context); getridoftemptext(context); getridoftempcharset(context); restorereels(context); - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); worktoscreenm(context); return; @@ -15600,52 +15600,52 @@ void showdiary(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12+37; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 2; context.ah = 0; context.di = 68+24+176; context.bx = 48+12+108; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); return; } void showdiarykeys(Context & context) { - context._cmp(context.data.byte(281), 0); + context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; - context._sub(context.data.byte(281), 1); - context._cmp(context.data.byte(281), 0); + context._sub(context.data.byte(kPresscount), 1); + context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; - context._cmp(context.data.byte(277), 'N'); + context._cmp(context.data.byte(kPressed), 'N'); if (!context.flags.z()) goto nokeyn; context.al = 3; - context._cmp(context.data.byte(281), 1); + context._cmp(context.data.byte(kPresscount), 1); if (context.flags.z()) goto gotkeyn; context.al = 4; gotkeyn: context.ah = 0; context.di = 68+24+94; context.bx = 48+12+97; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); - context._cmp(context.data.byte(281), 1); + context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: return; nokeyn: context.al = 5; - context._cmp(context.data.byte(281), 1); + context._cmp(context.data.byte(kPresscount), 1); if (context.flags.z()) goto gotkeyp; context.al = 6; gotkeyp: context.ah = 0; context.di = 68+24+151; context.bx = 48+12+71; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); - context._cmp(context.data.byte(281), 1); + context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: @@ -15655,13 +15655,13 @@ nokeyatall: } void dumpdiarykeys(Context & context) { - context._cmp(context.data.byte(281), 1); + context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notdumpdiary; - context._cmp(context.data.byte(42), 1); + context._cmp(context.data.byte(kSartaindead), 1); if (context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(288), 5); + context._cmp(context.data.byte(kDiarypage), 5); if (!context.flags.z()) goto notsartadd; - context._cmp(context.data.byte(288), 5); + context._cmp(context.data.byte(kDiarypage), 5); if (!context.flags.z()) goto notsartadd; context.al = 6; getlocation(context); @@ -15708,53 +15708,53 @@ notdumpdiary: } void diarykeyp(Context & context) { - context._cmp(context.data.byte(99), 214); + context._cmp(context.data.byte(kCommandtype), 214); if (context.flags.z()) goto alreadykeyp; - context.data.byte(99) = 214; + context.data.byte(kCommandtype) = 214; context.al = 23; commandonly(context); alreadykeyp: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto notkeyp; - context.ax = context.data.word(210); - context._cmp(context.ax, context.data.word(200)); + context.ax = context.data.word(kOldbutton); + context._cmp(context.ax, context.data.word(kMousebutton)); if (context.flags.z()) goto notkeyp; - context._cmp(context.data.byte(281), 0); + context._cmp(context.data.byte(kPresscount), 0); if (!context.flags.z()) goto notkeyp; context.al = 16; playchannel1(context); - context.data.byte(281) = 12; - context.data.byte(277) = 'P'; - context._sub(context.data.byte(288), 1); - context._cmp(context.data.byte(288), -1); + context.data.byte(kPresscount) = 12; + context.data.byte(kPressed) = 'P'; + context._sub(context.data.byte(kDiarypage), 1); + context._cmp(context.data.byte(kDiarypage), -1); if (!context.flags.z()) goto notkeyp; - context.data.byte(288) = 11; + context.data.byte(kDiarypage) = 11; notkeyp: return; } void diarykeyn(Context & context) { - context._cmp(context.data.byte(99), 213); + context._cmp(context.data.byte(kCommandtype), 213); if (context.flags.z()) goto alreadykeyn; - context.data.byte(99) = 213; + context.data.byte(kCommandtype) = 213; context.al = 23; commandonly(context); alreadykeyn: - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto notkeyn; - context.ax = context.data.word(210); - context._cmp(context.ax, context.data.word(200)); + context.ax = context.data.word(kOldbutton); + context._cmp(context.ax, context.data.word(kMousebutton)); if (context.flags.z()) goto notkeyn; - context._cmp(context.data.byte(281), 0); + context._cmp(context.data.byte(kPresscount), 0); if (!context.flags.z()) goto notkeyn; context.al = 16; playchannel1(context); - context.data.byte(281) = 12; - context.data.byte(277) = 'N'; - context._add(context.data.byte(288), 1); - context._cmp(context.data.byte(288), 12); + context.data.byte(kPresscount) = 12; + context.data.byte(kPressed) = 'N'; + context._add(context.data.byte(kDiarypage), 1); + context._cmp(context.data.byte(kDiarypage), 12); if (!context.flags.z()) goto notkeyn; - context.data.byte(288) = 0; + context.data.byte(kDiarypage) = 0; notkeyn: return; } @@ -15764,17 +15764,17 @@ void showdiarypage(Context & context) { context.ah = 0; context.di = 68+24; context.bx = 48+12; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); showframe(context); - context.al = context.data.byte(288); + context.al = context.data.byte(kDiarypage); findtext1(context); - context.data.byte(71) = 1; + context.data.byte(kKerning) = 1; usetempcharset(context); context.di = 68+24+48; context.bx = 48+12+16; context.dl = 240; context.ah = 16; - context.data.word(69) = 91+91; + context.data.word(kCharshift) = 91+91; printdirect(context); context.di = 68+24+129; context.bx = 48+12+16; @@ -15786,8 +15786,8 @@ void showdiarypage(Context & context) { context.dl = 240; context.ah = 16; printdirect(context); - context.data.byte(71) = 0; - context.data.word(69) = 0; + context.data.byte(kKerning) = 0; + context.data.word(kCharshift) = 0; usecharset1(context); return; } @@ -15796,7 +15796,7 @@ void findtext1(Context & context) { context.ah = 0; context.si = context.ax; context._add(context.si, context.si); - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); context.ax = context.es.word(context.si); context._add(context.ax, 66*2); context.si = context.ax; @@ -15804,29 +15804,29 @@ void findtext1(Context & context) { } void zoomonoff(Context & context) { - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(233), 2); + context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyonoff; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 39; commandonly(context); alreadyonoff: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nozoomonoff; context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: return; dozoomonoff: - context.al = context.data.byte(7); + context.al = context.data.byte(kZoomon); context._xor(context.al, 1); - context.data.byte(7) = context.al; + context.data.byte(kZoomon) = context.al; createpanel(context); - context.data.byte(61) = 0; + context.data.byte(kNewobs) = 0; drawfloor(context); printsprites(context); reelsonscreen(context); @@ -15841,18 +15841,18 @@ dozoomonoff: } void saveload(Context & context) { - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(233), 2); + context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) { blank(context); return; }; - context._cmp(context.data.byte(99), 253); + context._cmp(context.data.byte(kCommandtype), 253); if (context.flags.z()) goto alreadyops; - context.data.byte(99) = 253; + context.data.byte(kCommandtype) = 253; context.al = 43; commandonly(context); alreadyops: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noops; context._and(context.ax, 1); if (context.flags.z()) goto noops; @@ -15862,11 +15862,11 @@ noops: } void dosaveload(Context & context) { - context.data.byte(230) = 0; - context.data.word(77) = 70; - context.data.word(79) = 182-8; - context.data.byte(81) = 181; - context.data.byte(130) = 1; + context.data.byte(kPointerframe) = 0; + context.data.word(kTextaddressx) = 70; + context.data.word(kTextaddressy) = 182-8; + context.data.byte(kTextlen) = 181; + context.data.byte(kManisoffscreen) = 1; clearwork(context); createpanel2(context); undertextline(context); @@ -15881,7 +15881,7 @@ restartops: showmainops(context); worktoscreenm(context); donefirstops: - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; waitops: readmouse(context); showpointer(context); @@ -15891,27 +15891,27 @@ waitops: delpointer(context); context.bx = 3693; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitops; - context._cmp(context.data.byte(102), 2); + context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) goto restartops; - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; - context._cmp(context.data.byte(102), 4); + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; + context._cmp(context.data.byte(kGetback), 4); if (context.flags.z()) goto justret; getridoftemp(context); restoreall(context); redrawmainscrn(context); worktoscreenm(context); - context.data.byte(99) = 200; + context.data.byte(kCommandtype) = 200; justret: - context.data.byte(130) = 0; + context.data.byte(kManisoffscreen) = 0; return; } void getbackfromops(Context & context) { - context._cmp(context.data.byte(55), 2); + context._cmp(context.data.byte(kMandead), 2); if (context.flags.z()) goto opsblock1; getback1(context); return; @@ -15921,19 +15921,19 @@ opsblock1: } void showmainops(Context & context) { - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+10; context.bx = 52+10; context.al = 8; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+59; context.bx = 52+30; context.al = 7; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+128+4; context.bx = 52+12; context.al = 1; @@ -15943,25 +15943,25 @@ void showmainops(Context & context) { } void showdiscops(Context & context) { - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+10; context.bx = 52+10; context.al = 9; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+59; context.bx = 52+30; context.al = 10; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -15977,30 +15977,30 @@ void loadsavebox(Context & context) { } void loadgame(Context & context) { - context._cmp(context.data.byte(99), 246); + context._cmp(context.data.byte(kCommandtype), 246); if (context.flags.z()) goto alreadyload; - context.data.byte(99) = 246; + context.data.byte(kCommandtype) = 246; context.al = 41; commandonly(context); alreadyload: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noload; context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: return; doload: - context.data.byte(339) = 1; + context.data.byte(kLoadingorsave) = 1; showopbox(context); showloadops(context); - context.data.byte(340) = 0; + context.data.byte(kCurrentslot) = 0; showslots(context); shownames(context); - context.data.byte(230) = 0; + context.data.byte(kPointerframe) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; loadops: delpointer(context); readmouse(context); @@ -16010,9 +16010,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(102), 2); + context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16020,30 +16020,30 @@ loadops: context.bx = 7750; startloading(context); loadroomssample(context); - context.data.byte(73) = 1; - context.data.byte(187) = 255; + context.data.byte(kRoomloaded) = 1; + context.data.byte(kNewlocation) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; startup(context); worktoscreen(context); - context.data.byte(102) = 4; + context.data.byte(kGetback) = 4; quitloaded: return; } void getbacktoops(Context & context) { - context._cmp(context.data.byte(99), 201); + context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadygetops; - context.data.byte(99) = 201; + context.data.byte(kCommandtype) = 201; context.al = 42; commandonly(context); alreadygetops: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nogetbackops; context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; @@ -16051,19 +16051,19 @@ nogetbackops: return; dogetbackops: oldtonames(context); - context.data.byte(102) = 2; + context.data.byte(kGetback) = 2; return; } void discops(Context & context) { - context._cmp(context.data.byte(99), 249); + context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadydiscops; - context.data.byte(99) = 249; + context.data.byte(kCommandtype) = 249; context.al = 43; commandonly(context); alreadydiscops: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodiscops; context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; @@ -16071,12 +16071,12 @@ nodiscops: return; dodiscops: scanfornames(context); - context.data.byte(339) = 2; + context.data.byte(kLoadingorsave) = 2; showopbox(context); showdiscops(context); - context.data.byte(340) = 0; + context.data.byte(kCurrentslot) = 0; worktoscreenm(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; discopsloop: delpointer(context); readmouse(context); @@ -16086,39 +16086,39 @@ discopsloop: dumptextline(context); context.bx = 3777; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto discopsloop; return; } void savegame(Context & context) { - context._cmp(context.data.byte(55), 2); + context._cmp(context.data.byte(kMandead), 2); if (!context.flags.z()) goto cansaveok; blank(context); return; cansaveok: - context._cmp(context.data.byte(99), 247); + context._cmp(context.data.byte(kCommandtype), 247); if (context.flags.z()) goto alreadysave; - context.data.byte(99) = 247; + context.data.byte(kCommandtype) = 247; context.al = 44; commandonly(context); alreadysave: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; return; dosave: - context.data.byte(339) = 2; + context.data.byte(kLoadingorsave) = 2; showopbox(context); showsaveops(context); - context.data.byte(340) = 0; + context.data.byte(kCurrentslot) = 0; showslots(context); shownames(context); worktoscreenm(context); namestoold(context); - context.data.word(392) = 0; - context.data.word(394) = 0; - context.data.byte(102) = 0; + context.data.word(kBufferin) = 0; + context.data.word(kBufferout) = 0; + context.data.byte(kGetback) = 0; saveops: delpointer(context); checkinput(context); @@ -16129,25 +16129,25 @@ saveops: dumptextline(context); context.bx = 3819; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto saveops; return; } void actualsave(Context & context) { - context._cmp(context.data.byte(99), 222); + context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyactsave; - context.data.byte(99) = 222; + context.data.byte(kCommandtype) = 222; context.al = 44; commandonly(context); alreadyactsave: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto noactsave; context.dx = context.ds; context.ds = context.dx; context.si = 8350; - context.al = context.data.byte(340); + context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16155,7 +16155,7 @@ alreadyactsave: context._add(context.si, 1); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto noactsave; - context.al = context.data.byte(8); + context.al = context.data.byte(kLocation); context.ah = 0; context.cx = 32; context._mul(context.cx); @@ -16167,49 +16167,49 @@ alreadyactsave: context.es = context.cs; context.cx = 16; while(--context.cx) context._movsw(); - context.al = context.data.byte(530); + context.al = context.data.byte(kRoomssample); context.es.byte(context.bx+13) = context.al; - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context.es.byte(context.bx+15) = context.al; - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.es.byte(context.bx+16) = context.al; - context.al = context.data.byte(34); + context.al = context.data.byte(kLiftflag); context.es.byte(context.bx+20) = context.al; - context.al = context.data.byte(474); + context.al = context.data.byte(kManspath); context.es.byte(context.bx+21) = context.al; - context.al = context.data.byte(132); + context.al = context.data.byte(kFacing); context.es.byte(context.bx+22) = context.al; context.al = 255; context.es.byte(context.bx+27) = context.al; saveposition(context); getridoftemp(context); restoreall(context); - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; redrawmainscrn(context); worktoscreenm(context); - context.data.byte(102) = 4; + context.data.byte(kGetback) = 4; noactsave: return; } void actualload(Context & context) { - context._cmp(context.data.byte(99), 221); + context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadyactload; - context.data.byte(99) = 221; + context.data.byte(kCommandtype) = 221; context.al = 41; commandonly(context); alreadyactload: - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto notactload; context._cmp(context.ax, 1); if (!context.flags.z()) goto notactload; context.dx = context.ds; context.ds = context.dx; context.si = 8350; - context.al = context.data.byte(340); + context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16218,48 +16218,48 @@ alreadyactload: context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto notactload; loadposition(context); - context.data.byte(102) = 1; + context.data.byte(kGetback) = 1; notactload: return; } void selectslot2(Context & context) { - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto noselslot2; - context.data.byte(339) = 2; + context.data.byte(kLoadingorsave) = 2; noselslot2: selectslot(context); return; } void checkinput(Context & context) { - context._cmp(context.data.byte(339), 3); + context._cmp(context.data.byte(kLoadingorsave), 3); if (context.flags.z()) goto nokeypress; readkey(context); - context.al = context.data.byte(141); + context.al = context.data.byte(kCurrentkey); context._cmp(context.al, 0); if (context.flags.z()) goto nokeypress; context._cmp(context.al, 13); if (!context.flags.z()) goto notret; - context.data.byte(339) = 3; + context.data.byte(kLoadingorsave) = 3; goto afterkey; notret: context._cmp(context.al, 8); if (!context.flags.z()) goto nodel2; - context._cmp(context.data.byte(341), 0); + context._cmp(context.data.byte(kCursorpos), 0); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._sub(context.data.byte(341), 1); + context._sub(context.data.byte(kCursorpos), 1); context.es.byte(context.bx) = 0; context.es.byte(context.bx+1) = 1; goto afterkey; nodel2: spacepress: - context._cmp(context.data.byte(341), 14); + context._cmp(context.data.byte(kCursorpos), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._add(context.data.byte(341), 1); - context.al = context.data.byte(141); + context._add(context.data.byte(kCursorpos), 1); + context.al = context.data.byte(kCurrentkey); context.es.byte(context.bx+1) = context.al; context.es.byte(context.bx+2) = 0; context.es.byte(context.bx+3) = 1; @@ -16276,7 +16276,7 @@ afterkey: } void getnamepos(Context & context) { - context.al = context.data.byte(340); + context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; context._mul(context.cx); @@ -16284,20 +16284,20 @@ void getnamepos(Context & context) { context.es = context.dx; context.bx = 8350; context._add(context.bx, context.ax); - context.al = context.data.byte(341); + context.al = context.data.byte(kCursorpos); context.ah = 0; context._add(context.bx, context.ax); return; } void showopbox(Context & context) { - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60; context.bx = 52; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60; context.bx = 52+55; context.al = 4; @@ -16307,13 +16307,13 @@ void showopbox(Context & context) { } void showloadops(Context & context) { - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16328,13 +16328,13 @@ void showloadops(Context & context) { } void showsaveops(Context & context) { - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+128+4; context.bx = 52+12; context.al = 1; context.ah = 0; showframe(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+176+2; context.bx = 52+60-4; context.al = 5; @@ -16349,35 +16349,35 @@ void showsaveops(Context & context) { } void selectslot(Context & context) { - context._cmp(context.data.byte(99), 244); + context._cmp(context.data.byte(kCommandtype), 244); if (context.flags.z()) goto alreadysel; - context.data.byte(99) = 244; + context.data.byte(kCommandtype) = 244; context.al = 45; commandonly(context); alreadysel: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) goto noselslot; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto noselslot; - context._cmp(context.data.byte(339), 3); + context._cmp(context.data.byte(kLoadingorsave), 3); if (!context.flags.z()) goto notnocurs; - context._sub(context.data.byte(339), 1); + context._sub(context.data.byte(kLoadingorsave), 1); notnocurs: oldtonames(context); - context.ax = context.data.word(198); + context.ax = context.data.word(kMousey); context._sub(context.ax, 52+4); context.cl = -1; getslotnum: context._add(context.cl, 1); context._sub(context.ax, 11); if (!context.flags.c()) goto getslotnum; - context.data.byte(340) = context.cl; + context.data.byte(kCurrentslot) = context.cl; delpointer(context); showopbox(context); showslots(context); shownames(context); - context._cmp(context.data.byte(339), 1); + context._cmp(context.data.byte(kLoadingorsave), 1); if (context.flags.z()) goto isloadmode; showsaveops(context); readmouse(context); @@ -16400,7 +16400,7 @@ void showslots(Context & context) { context.di = 60+7; context.bx = 52+8; context.al = 2; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 0; showframe(context); context.di = 60+10; @@ -16410,10 +16410,10 @@ slotloop: context.push(context.cx); context.push(context.di); context.push(context.bx); - context._cmp(context.cl, context.data.byte(340)); + context._cmp(context.cl, context.data.byte(kCurrentslot)); if (!context.flags.z()) goto nomatchslot; context.al = 3; - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.ah = 0; showframe(context); nomatchslot: @@ -16441,9 +16441,9 @@ shownameloop: context.push(context.bx); context.push(context.si); context.al = 4; - context._cmp(context.cl, context.data.byte(340)); + context._cmp(context.cl, context.data.byte(kCurrentslot)); if (!context.flags.z()) goto nomatchslot2; - context._cmp(context.data.byte(339), 2); + context._cmp(context.data.byte(kLoadingorsave), 2); if (!context.flags.z()) goto loadmode; context.dx = context.si; context.cx = 15; @@ -16455,7 +16455,7 @@ zerostill: if (!context.flags.z()) goto foundcharacter; goto zerostill; foundcharacter: - context.data.byte(341) = context.cl; + context.data.byte(kCursorpos) = context.cl; context.es.byte(context.si) = '/'; context.es.byte(context.si+1) = 0; context.push(context.si); @@ -16471,9 +16471,9 @@ loadmode: context.al = 0; context.dl = 200; context.ah = 0; - context.data.word(69) = 91; + context.data.word(kCharshift) = 91; printdirect(context); - context.data.word(69) = 0; + context.data.word(kCharshift) = 0; goto afterprintname; nomatchslot2: context.dl = 200; @@ -16497,7 +16497,7 @@ void namestoold(Context & context) { context.ds = context.cs; context.si = 8350; context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16507,7 +16507,7 @@ void oldtonames(Context & context) { context.es = context.cs; context.di = 8350; context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.cx = 17*4; while(--context.cx) context._movsb(); return; @@ -16559,18 +16559,18 @@ void decide(Context & context) { setmode(context); loadpalfromiff(context); clearpalette(context); - context.data.byte(233) = 0; - context.data.word(19) = 0; - context.data.byte(230) = 0; - context.data.word(77) = 70; - context.data.word(79) = 182-8; - context.data.byte(81) = 181; - context.data.byte(130) = 1; + context.data.byte(kPointermode) = 0; + context.data.word(kWatchingtime) = 0; + context.data.byte(kPointerframe) = 0; + context.data.word(kTextaddressx) = 70; + context.data.word(kTextaddressy) = 182-8; + context.data.byte(kTextlen) = 181; + context.data.byte(kManisoffscreen) = 1; loadsavebox(context); showdecisions(context); worktoscreen(context); fadescreenup(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; waitdecide: readmouse(context); showpointer(context); @@ -16580,22 +16580,22 @@ waitdecide: delpointer(context); context.bx = 4884; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitdecide; - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(kGetback), 4); if (context.flags.z()) goto hasloadedroom; getridoftemp(context); hasloadedroom: - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; return; } void showdecisions(Context & context) { createpanel2(context); showopbox(context); - context.ds = context.data.word(456); + context.ds = context.data.word(kTempgraphics); context.di = 60+17; context.bx = 52+13; context.al = 6; @@ -16606,31 +16606,31 @@ void showdecisions(Context & context) { } void newgame(Context & context) { - context._cmp(context.data.byte(99), 251); + context._cmp(context.data.byte(kCommandtype), 251); if (context.flags.z()) goto alreadynewgame; - context.data.byte(99) = 251; + context.data.byte(kCommandtype) = 251; context.al = 47; commandonly(context); alreadynewgame: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) goto nonewgame; - context.data.byte(102) = 3; + context.data.byte(kGetback) = 3; nonewgame: return; } void doload(Context & context) { - context.data.byte(339) = 1; + context.data.byte(kLoadingorsave) = 1; showopbox(context); showloadops(context); - context.data.byte(340) = 0; + context.data.byte(kCurrentslot) = 0; showslots(context); shownames(context); - context.data.byte(230) = 0; + context.data.byte(kPointerframe) = 0; worktoscreenm(context); namestoold(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; loadops: delpointer(context); readmouse(context); @@ -16640,9 +16640,9 @@ loadops: dumptextline(context); context.bx = 3735; checkcoords(context); - context._cmp(context.data.byte(102), 0); + context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto loadops; - context._cmp(context.data.byte(102), 2); + context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); context.dx = context.ds; @@ -16650,37 +16650,37 @@ loadops: context.bx = 7750; startloading(context); loadroomssample(context); - context.data.byte(73) = 1; - context.data.byte(187) = 255; + context.data.byte(kRoomloaded) = 1; + context.data.byte(kNewlocation) = 255; clearsprites(context); initman(context); initrain(context); - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; startup(context); worktoscreen(context); - context.data.byte(102) = 4; + context.data.byte(kGetback) = 4; quitloaded: return; } void loadold(Context & context) { - context._cmp(context.data.byte(99), 252); + context._cmp(context.data.byte(kCommandtype), 252); if (context.flags.z()) goto alreadyloadold; - context.data.byte(99) = 252; + context.data.byte(kCommandtype) = 252; context.al = 48; commandonly(context); alreadyloadold: - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto noloadold; doload(context); - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(kGetback), 4); if (context.flags.z()) goto noloadold; showdecisions(context); worktoscreenm(context); - context.data.byte(102) = 0; + context.data.byte(kGetback) = 0; noloadold: return; } @@ -16727,39 +16727,39 @@ tensc: } void trysoundalloc(Context & context) { - context._cmp(context.data.byte(357), 1); + context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) goto gotsoundbuff; - context._add(context.data.byte(356), 1); + context._add(context.data.byte(kSoundtimes), 1); context.bx = (16384+2048)/16; allocatemem(context); - context.data.word(351) = context.ax; + context.data.word(kSoundbuffer) = context.ax; context.push(context.ax); context.al = context.ah; context.cl = 4; context._shr(context.al, context.cl); - context.data.byte(355) = context.al; + context.data.byte(kSoundbufferpage) = context.al; context.ax = context.pop(); context.cl = 4; context._shl(context.ax, context.cl); - context.data.word(353) = context.ax; + context.data.word(kSoundbufferad) = context.ax; context._cmp(context.ax, 0x0b7ff); if (!context.flags.c()) goto soundfail; - context.es = context.data.word(351); + context.es = context.data.word(kSoundbuffer); context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; while(--context.cx) context._stosw(); - context.data.byte(357) = 1; + context.data.byte(kNeedsoundbuff) = 1; return; soundfail: - context.es = context.data.word(351); + context.es = context.data.word(kSoundbuffer); deallocatemem(context); gotsoundbuff: return; } void playchannel0(Context & context) { - context._cmp(context.data.byte(377), 255); + context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); context.push(context.ds); @@ -16767,14 +16767,14 @@ void playchannel0(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(506) = context.al; - context.es = context.data.word(418); + context.data.byte(kCh0playing) = context.al; + context.es = context.data.word(kSounddata); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank; - context.es = context.data.word(420); + context.es = context.data.word(kSounddata2); context._sub(context.al, 12); notsecondbank: - context.data.byte(507) = context.ah; + context.data.byte(kCh0repeat) = context.ah; context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; @@ -16782,19 +16782,19 @@ notsecondbank: context._add(context.bx, context.ax); context.al = context.es.byte(context.bx); context.ah = 0; - context.data.word(500) = context.ax; + context.data.word(kCh0emmpage) = context.ax; context.ax = context.es.word(context.bx+1); - context.data.word(502) = context.ax; + context.data.word(kCh0offset) = context.ax; context.ax = context.es.word(context.bx+3); - context.data.word(504) = context.ax; - context._cmp(context.data.byte(507), 0); + context.data.word(kCh0blockstocopy) = context.ax; + context._cmp(context.data.byte(kCh0repeat), 0); if (context.flags.z()) goto nosetloop; - context.ax = context.data.word(500); - context.data.word(508) = context.ax; - context.ax = context.data.word(502); - context.data.word(510) = context.ax; - context.ax = context.data.word(504); - context.data.word(512) = context.ax; + context.ax = context.data.word(kCh0emmpage); + context.data.word(kCh0oldemmpage) = context.ax; + context.ax = context.data.word(kCh0offset); + context.data.word(kCh0oldoffset) = context.ax; + context.ax = context.data.word(kCh0blockstocopy); + context.data.word(kCh0oldblockstocopy) = context.ax; nosetloop: context.si = context.pop(); context.di = context.pop(); @@ -16807,9 +16807,9 @@ dontbother4: } void playchannel1(Context & context) { - context._cmp(context.data.byte(377), 255); + context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother5; - context._cmp(context.data.byte(514), 7); + context._cmp(context.data.byte(kCh1playing), 7); if (context.flags.z()) goto dontbother5; context.push(context.es); context.push(context.ds); @@ -16817,11 +16817,11 @@ void playchannel1(Context & context) { context.push(context.cx); context.push(context.di); context.push(context.si); - context.data.byte(514) = context.al; - context.es = context.data.word(418); + context.data.byte(kCh1playing) = context.al; + context.es = context.data.word(kSounddata); context._cmp(context.al, 12); if (context.flags.c()) goto notsecondbank1; - context.es = context.data.word(420); + context.es = context.data.word(kSounddata2); context._sub(context.al, 12); notsecondbank1: context.ah = 0; @@ -16831,11 +16831,11 @@ notsecondbank1: context._add(context.bx, context.ax); context.al = context.es.byte(context.bx); context.ah = 0; - context.data.word(515) = context.ax; + context.data.word(kCh1emmpage) = context.ax; context.ax = context.es.word(context.bx+1); - context.data.word(517) = context.ax; + context.data.word(kCh1offset) = context.ax; context.ax = context.es.word(context.bx+3); - context.data.word(519) = context.ax; + context.data.word(kCh1blockstocopy) = context.ax; context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); @@ -16849,102 +16849,102 @@ dontbother5: void makenextblock(Context & context) { volumeadjust(context); loopchannel0(context); - context._cmp(context.data.word(519), 0); + context._cmp(context.data.word(kCh1blockstocopy), 0); if (context.flags.z()) goto mightbeonlych0; - context._cmp(context.data.word(504), 0); + context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto mightbeonlych1; - context._sub(context.data.word(504), 1); - context._sub(context.data.word(519), 1); + context._sub(context.data.word(kCh0blockstocopy), 1); + context._sub(context.data.word(kCh1blockstocopy), 1); bothchannels(context); return; mightbeonlych1: - context.data.byte(506) = 255; - context._cmp(context.data.word(519), 0); + context.data.byte(kCh0playing) = 255; + context._cmp(context.data.word(kCh1blockstocopy), 0); if (context.flags.z()) goto notch1only; - context._sub(context.data.word(519), 1); + context._sub(context.data.word(kCh1blockstocopy), 1); channel1only(context); notch1only: return; mightbeonlych0: - context.data.byte(514) = 255; - context._cmp(context.data.word(504), 0); + context.data.byte(kCh1playing) = 255; + context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto notch0only; - context._sub(context.data.word(504), 1); + context._sub(context.data.word(kCh0blockstocopy), 1); channel0only(context); return; notch0only: - context.es = context.data.word(351); - context.di = context.data.word(523); + context.es = context.data.word(kSoundbuffer); + context.di = context.data.word(kSoundbufferwrite); context.cx = 1024; context.ax = 0x7f7f; while(--context.cx) context._stosw(); context._and(context.di, 16384-1); - context.data.word(523) = context.di; + context.data.word(kSoundbufferwrite) = context.di; return; } void volumeadjust(Context & context) { - context.al = context.data.byte(387); + context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); if (context.flags.z()) goto volok; - context.al = context.data.byte(385); - context._cmp(context.al, context.data.byte(386)); + context.al = context.data.byte(kVolume); + context._cmp(context.al, context.data.byte(kVolumeto)); if (context.flags.z()) goto volfinish; - context._add(context.data.byte(388), 64); + context._add(context.data.byte(kVolumecount), 64); if (!context.flags.z()) goto volok; - context.al = context.data.byte(385); - context._add(context.al, context.data.byte(387)); - context.data.byte(385) = context.al; + context.al = context.data.byte(kVolume); + context._add(context.al, context.data.byte(kVolumedirection)); + context.data.byte(kVolume) = context.al; return; volfinish: - context.data.byte(387) = 0; + context.data.byte(kVolumedirection) = 0; volok: return; } void loopchannel0(Context & context) { - context._cmp(context.data.word(504), 0); + context._cmp(context.data.word(kCh0blockstocopy), 0); if (!context.flags.z()) goto notloop; - context._cmp(context.data.byte(507), 0); + context._cmp(context.data.byte(kCh0repeat), 0); if (context.flags.z()) goto notloop; - context._cmp(context.data.byte(507), 255); + context._cmp(context.data.byte(kCh0repeat), 255); if (context.flags.z()) goto endlessloop; - context._sub(context.data.byte(507), 1); + context._sub(context.data.byte(kCh0repeat), 1); endlessloop: - context.ax = context.data.word(508); - context.data.word(500) = context.ax; - context.ax = context.data.word(510); - context.data.word(502) = context.ax; - context.ax = context.data.word(504); - context._add(context.ax, context.data.word(512)); - context.data.word(504) = context.ax; + context.ax = context.data.word(kCh0oldemmpage); + context.data.word(kCh0emmpage) = context.ax; + context.ax = context.data.word(kCh0oldoffset); + context.data.word(kCh0offset) = context.ax; + context.ax = context.data.word(kCh0blockstocopy); + context._add(context.ax, context.data.word(kCh0oldblockstocopy)); + context.data.word(kCh0blockstocopy) = context.ax; return; notloop: return; } void cancelch0(Context & context) { - context.data.byte(507) = 0; - context.data.word(504) = 0; - context.data.byte(506) = 255; + context.data.byte(kCh0repeat) = 0; + context.data.word(kCh0blockstocopy) = 0; + context.data.byte(kCh0playing) = 255; return; } void cancelch1(Context & context) { - context.data.word(519) = 0; - context.data.byte(514) = 255; + context.data.word(kCh1blockstocopy) = 0; + context.data.byte(kCh1playing) = 255; return; } void channel0tran(Context & context) { - context._cmp(context.data.byte(385), 0); + context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(--context.cx) context._movsw(); return; lowvolumetran: context.cx = 1024; - context.bh = context.data.byte(385); + context.bh = context.data.byte(kVolume); context.bl = 0; context._add(context.bx, 16384-256); volloop: @@ -16959,7 +16959,7 @@ volloop: } void domix(Context & context) { - context._cmp(context.data.byte(385), 0); + context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumemix; slow: context._lodsb(); @@ -17004,7 +17004,7 @@ nodistort: lowvolumemix: context._lodsb(); context.push(context.bx); - context.bh = context.data.byte(385); + context.bh = context.data.byte(kVolume); context._add(context.bh, 63); context.bl = context.al; context.al = context.es.byte(context.bx); @@ -17051,7 +17051,7 @@ doneit: } void entrytexts(Context & context) { - context._cmp(context.data.byte(8), 21); + context._cmp(context.data.byte(kLocation), 21); if (!context.flags.z()) goto notloc15; context.al = 28; context.cx = 60; @@ -17061,7 +17061,7 @@ void entrytexts(Context & context) { setuptimeduse(context); return; notloc15: - context._cmp(context.data.byte(8), 30); + context._cmp(context.data.byte(kLocation), 30); if (!context.flags.z()) goto notloc43; context.al = 27; context.cx = 60; @@ -17071,7 +17071,7 @@ notloc15: setuptimeduse(context); return; notloc43: - context._cmp(context.data.byte(8), 23); + context._cmp(context.data.byte(kLocation), 23); if (!context.flags.z()) goto notloc23; context.al = 29; context.cx = 60; @@ -17081,7 +17081,7 @@ notloc43: setuptimeduse(context); return; notloc23: - context._cmp(context.data.byte(8), 31); + context._cmp(context.data.byte(kLocation), 31); if (!context.flags.z()) goto notloc44; context.al = 30; context.cx = 60; @@ -17091,7 +17091,7 @@ notloc23: setuptimeduse(context); return; notloc44: - context._cmp(context.data.byte(8), 20); + context._cmp(context.data.byte(kLocation), 20); if (!context.flags.z()) goto notsarters2; context.al = 31; context.cx = 60; @@ -17101,7 +17101,7 @@ notloc44: setuptimeduse(context); return; notsarters2: - context._cmp(context.data.byte(8), 24); + context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedenlob; context.al = 32; context.cx = 60; @@ -17111,7 +17111,7 @@ notsarters2: setuptimeduse(context); return; notedenlob: - context._cmp(context.data.byte(8), 34); + context._cmp(context.data.byte(kLocation), 34); if (!context.flags.z()) goto noteden2; context.al = 33; context.cx = 60; @@ -17125,71 +17125,71 @@ noteden2: } void entryanims(Context & context) { - context.data.word(21) = -1; - context.data.byte(31) = -1; - context._cmp(context.data.byte(8), 33); + context.data.word(kReeltowatch) = -1; + context.data.byte(kWatchmode) = -1; + context._cmp(context.data.byte(kLocation), 33); if (!context.flags.z()) goto notinthebeach; switchryanoff(context); - context.data.word(19) = 76*2; - context.data.word(21) = 0; - context.data.word(23) = 76; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 76*2; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 76; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; return; notinthebeach: - context._cmp(context.data.byte(8), 44); + context._cmp(context.data.byte(kLocation), 44); if (!context.flags.z()) goto notsparkys; context.al = 8; resetlocation(context); - context.data.word(19) = 50*2; - context.data.word(21) = 247; - context.data.word(23) = 297; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 50*2; + context.data.word(kReeltowatch) = 247; + context.data.word(kEndwatchreel) = 297; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; notsparkys: - context._cmp(context.data.byte(8), 22); + context._cmp(context.data.byte(kLocation), 22); if (!context.flags.z()) goto notinthelift; - context.data.word(19) = 31*2; - context.data.word(21) = 0; - context.data.word(23) = 30; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 31*2; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 30; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; notinthelift: - context._cmp(context.data.byte(8), 26); + context._cmp(context.data.byte(kLocation), 26); if (!context.flags.z()) goto notunderchurch; - context.data.byte(291) = 2; - context.data.byte(294) = 1; + context.data.byte(kSymboltopnum) = 2; + context.data.byte(kSymbolbotnum) = 1; return; notunderchurch: - context._cmp(context.data.byte(8), 45); + context._cmp(context.data.byte(kLocation), 45); if (!context.flags.z()) goto notenterdream; - context.data.byte(53) = 0; - context.data.word(19) = 296; - context.data.word(21) = 45; - context.data.word(23) = 198; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.byte(kKeeperflag) = 0; + context.data.word(kWatchingtime) = 296; + context.data.word(kReeltowatch) = 45; + context.data.word(kEndwatchreel) = 198; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; notenterdream: - context._cmp(context.data.byte(183), 46); + context._cmp(context.data.byte(kReallocation), 46); if (!context.flags.z()) goto notcrystal; - context._cmp(context.data.byte(42), 1); + context._cmp(context.data.byte(kSartaindead), 1); if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); return; notcrystal: - context._cmp(context.data.byte(8), 9); + context._cmp(context.data.byte(kLocation), 9); if (!context.flags.z()) goto nottopchurch; context.al = 2; checkifpathison(context); if (context.flags.z()) goto nottopchurch; - context._cmp(context.data.byte(43), 0); + context._cmp(context.data.byte(kAidedead), 0); if (context.flags.z()) goto nottopchurch; context.al = 3; checkifpathison(context); @@ -17203,7 +17203,7 @@ makedoorsopen: placesetobject(context); return; nottopchurch: - context._cmp(context.data.byte(8), 47); + context._cmp(context.data.byte(kLocation), 47); if (!context.flags.z()) goto notdreamcentre; context.al = 4; placesetobject(context); @@ -17211,30 +17211,30 @@ nottopchurch: placesetobject(context); return; notdreamcentre: - context._cmp(context.data.byte(8), 38); + context._cmp(context.data.byte(kLocation), 38); if (!context.flags.z()) goto notcarpark; - context.data.word(19) = 57*2; - context.data.word(21) = 4; - context.data.word(23) = 57; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 57*2; + context.data.word(kReeltowatch) = 4; + context.data.word(kEndwatchreel) = 57; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; notcarpark: - context._cmp(context.data.byte(8), 32); + context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notalley; - context.data.word(19) = 66*2; - context.data.word(21) = 0; - context.data.word(23) = 66; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.word(kWatchingtime) = 66*2; + context.data.word(kReeltowatch) = 0; + context.data.word(kEndwatchreel) = 66; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; notalley: - context._cmp(context.data.byte(8), 24); + context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedensagain; context.al = 2; - context.ah = context.data.byte(184); + context.ah = context.data.byte(kRoomnum); context._sub(context.ah, 1); turnanypathon(context); notedensagain: @@ -17242,7 +17242,7 @@ notedensagain: } void initialinv(Context & context) { - context._cmp(context.data.byte(183), 24); + context._cmp(context.data.byte(kReallocation), 24); if (context.flags.z()) goto isedens; return; isedens: @@ -17271,20 +17271,20 @@ isedens: context.al = 16; context.ah = 2; pickupob(context); - context.data.byte(31) = 1; - context.data.word(27) = 0; - context.data.word(29) = 6; - context.data.byte(26) = 1; - context.data.byte(25) = 1; + context.data.byte(kWatchmode) = 1; + context.data.word(kReeltohold) = 0; + context.data.word(kEndofholdreel) = 6; + context.data.byte(kWatchspeed) = 1; + context.data.byte(kSpeedcount) = 1; switchryanoff(context); return; } void pickupob(Context & context) { - context.data.byte(106) = context.ah; - context.data.byte(101) = 2; - context.data.byte(88) = context.al; - context.data.byte(98) = context.al; + context.data.byte(kLastinvpos) = context.ah; + context.data.byte(kObjecttype) = 2; + context.data.byte(kItemframe) = context.al; + context.data.byte(kCommand) = context.al; getanyad(context); transfertoex(context); return; @@ -17295,10 +17295,10 @@ void checkforemm(Context & context) { } void checkbasemem(Context & context) { - context.bx = context.data.word(532); + context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; - context.data.byte(531) = 5; + context.data.byte(kGameerror) = 5; { quickquit(context); return; }; enoughmem: return; @@ -17307,55 +17307,55 @@ enoughmem: void allocatebuffers(Context & context) { context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; allocatemem(context); - context.data.word(396) = context.ax; + context.data.word(kExtras) = context.ax; trysoundalloc(context); context.bx = 0+(66*60)/16; allocatemem(context); - context.data.word(416) = context.ax; + context.data.word(kMapdata) = context.ax; trysoundalloc(context); context.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(context); - context.data.word(410) = context.ax; + context.data.word(kBuffers) = context.ax; trysoundalloc(context); context.bx = 16*80/16; allocatemem(context); - context.data.word(424) = context.ax; + context.data.word(kFreedat) = context.ax; trysoundalloc(context); context.bx = 64*128/16; allocatemem(context); - context.data.word(426) = context.ax; + context.data.word(kSetdat) = context.ax; trysoundalloc(context); context.bx = 22*8*20*8/16; allocatemem(context); - context.data.word(400) = context.ax; + context.data.word(kMapstore) = context.ax; allocatework(context); context.bx = 2048/16; allocatemem(context); - context.data.word(418) = context.ax; + context.data.word(kSounddata) = context.ax; context.bx = 2048/16; allocatemem(context); - context.data.word(420) = context.ax; + context.data.word(kSounddata2) = context.ax; return; } void clearbuffers(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(396); + context.es = context.data.word(kExtras); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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); context.ds = context.cs; context.si = 534; context.cx = 991-534; while(--context.cx) context._movsb(); - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.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; context.ds = context.cs; context.si = 0; @@ -17366,27 +17366,27 @@ void clearbuffers(Context & context) { } void clearchanges(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.cx = 250*2; context.ax = 0x0ffff; context.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); while(--context.cx) context._stosw(); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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); context.es = context.cs; context.di = 534; context.cx = 991-534; while(--context.cx) context._movsb(); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.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; context.es = context.cs; context.di = 0; context.cx = 68-0; while(--context.cx) context._movsb(); - context.data.byte(9) = 0; - context.data.word(10) = 0; - context.data.word(12) = 0; - context.es = context.data.word(396); + context.data.byte(kExpos) = 0; + context.data.word(kExframepos) = 0; + context.data.word(kExtextpos) = 0; + context.es = context.data.word(kExtras); context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; context.ax = 0x0ffff; context.di = 0; @@ -17407,48 +17407,48 @@ void clearchanges(Context & context) { } void clearbeforeload(Context & context) { - context._cmp(context.data.byte(73), 1); + context._cmp(context.data.byte(kRoomloaded), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); - context.data.byte(73) = 0; + context.data.byte(kRoomloaded) = 0; noclear: return; } void clearreels(Context & context) { - context.es = context.data.word(428); + context.es = context.data.word(kReel1); deallocatemem(context); - context.es = context.data.word(430); + context.es = context.data.word(kReel2); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.data.word(kReel3); deallocatemem(context); return; } void clearrest(Context & context) { - context.es = context.data.word(416); + context.es = context.data.word(kMapdata); context.cx = 66*60/2; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); - context.es = context.data.word(414); + context.es = context.data.word(kBackdrop); deallocatemem(context); - context.es = context.data.word(442); + context.es = context.data.word(kSetframes); deallocatemem(context); - context.es = context.data.word(448); + context.es = context.data.word(kReels); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.data.word(kPeople); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.data.word(kSetdesc); deallocatemem(context); - context.es = context.data.word(440); + context.es = context.data.word(kBlockdesc); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.data.word(kRoomdesc); deallocatemem(context); - context.es = context.data.word(444); + context.es = context.data.word(kFreeframes); deallocatemem(context); - context.es = context.data.word(436); + context.es = context.data.word(kFreedesc); deallocatemem(context); return; } @@ -17486,13 +17486,13 @@ lookattail: issoundint: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(377) = context.al; + context.data.byte(kSoundint) = context.al; context._add(context.bx, 1); goto lookattail; isdma: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); - context.data.byte(378) = context.al; + context.data.byte(kSounddmachannel) = context.al; context._add(context.bx, 1); goto lookattail; isbaseadd: @@ -17503,16 +17503,16 @@ isbaseadd: context.cl = 4; context._shl(context.ax, context.cl); context._add(context.ax, 0x200); - context.data.word(370) = context.ax; + context.data.word(kSoundbaseadd) = context.ax; context.cx = context.pop(); context._add(context.bx, 1); goto lookattail; isbright: - context.data.byte(72) = 1; + context.data.byte(kBrightness) = 1; context._add(context.bx, 1); goto lookattail; isnosound: - context.data.byte(377) = 255; + context.data.byte(kSoundint) = 255; context._add(context.bx, 1); goto lookattail; endtail: @@ -17520,10 +17520,10 @@ endtail: } void startup(Context & context) { - context.data.byte(141) = 0; - context.data.byte(104) = 0; + context.data.byte(kCurrentkey) = 0; + context.data.byte(kMainmode) = 0; createpanel(context); - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17537,11 +17537,11 @@ void startup(Context & context) { void startup1(Context & context) { clearpalette(context); - context.data.byte(60) = 0; - context.data.byte(141) = '0'; - context.data.byte(104) = 0; + context.data.byte(kThroughdoor) = 0; + context.data.byte(kCurrentkey) = '0'; + context.data.byte(kMainmode) = 0; createpanel(context); - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); showicon(context); getunderzoom(context); @@ -17560,9 +17560,9 @@ void screenupdate(Context & context) { mainscreen(context); animpointer(context); showpointer(context); - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto iswatchingmode; - context._cmp(context.data.byte(187), 255); + context._cmp(context.data.byte(kNewlocation), 255); if (!context.flags.z()) goto finishearly; iswatchingmode: vsync(context); @@ -17575,7 +17575,7 @@ iswatchingmode: watchcount(context); zoom(context); showpointer(context); - context._cmp(context.data.byte(390), 0); + context._cmp(context.data.byte(kWongame), 0); if (!context.flags.z()) goto finishearly; vsync(context); readmouse2(context); @@ -17604,74 +17604,74 @@ finishearly: } void watchreel(Context & context) { - context._cmp(context.data.word(21), -1); + context._cmp(context.data.word(kReeltowatch), -1); if (context.flags.z()) goto notplayingreel; - context.al = context.data.byte(474); - context._cmp(context.al, context.data.byte(476)); + context.al = context.data.byte(kManspath); + context._cmp(context.al, context.data.byte(kFinaldest)); if (!context.flags.z()) goto waitstopwalk; - context.al = context.data.byte(134); - context._cmp(context.al, context.data.byte(132)); + context.al = context.data.byte(kTurntoface); + context._cmp(context.al, context.data.byte(kFacing)); if (context.flags.z()) goto notwatchpath; waitstopwalk: return; notwatchpath: - context._sub(context.data.byte(25), 1); - context._cmp(context.data.byte(25), -1); + context._sub(context.data.byte(kSpeedcount), 1); + context._cmp(context.data.byte(kSpeedcount), -1); if (!context.flags.z()) goto showwatchreel; - context.al = context.data.byte(26); - context.data.byte(25) = context.al; - context.ax = context.data.word(21); - context._cmp(context.ax, context.data.word(23)); + context.al = context.data.byte(kWatchspeed); + context.data.byte(kSpeedcount) = context.al; + context.ax = context.data.word(kReeltowatch); + context._cmp(context.ax, context.data.word(kEndwatchreel)); if (!context.flags.z()) goto ismorereel; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto showwatchreel; - context.data.word(21) = -1; - context.data.byte(31) = -1; - context._cmp(context.data.word(27), -1); + context.data.word(kReeltowatch) = -1; + context.data.byte(kWatchmode) = -1; + context._cmp(context.data.word(kReeltohold), -1); if (context.flags.z()) goto nomorereel; - context.data.byte(31) = 1; + context.data.byte(kWatchmode) = 1; goto notplayingreel; ismorereel: - context._add(context.data.word(21), 1); + context._add(context.data.word(kReeltowatch), 1); showwatchreel: - context.ax = context.data.word(21); - context.data.word(237) = context.ax; + context.ax = context.data.word(kReeltowatch); + context.data.word(kReelpointer) = context.ax; plotreel(context); - context.ax = context.data.word(237); - context.data.word(21) = context.ax; + context.ax = context.data.word(kReelpointer); + context.data.word(kReeltowatch) = context.ax; checkforshake(context); nomorereel: return; notplayingreel: - context._cmp(context.data.byte(31), 1); + context._cmp(context.data.byte(kWatchmode), 1); if (!context.flags.z()) goto notholdingreel; - context.ax = context.data.word(27); - context.data.word(237) = context.ax; + context.ax = context.data.word(kReeltohold); + context.data.word(kReelpointer) = context.ax; plotreel(context); return; notholdingreel: - context._cmp(context.data.byte(31), 2); + context._cmp(context.data.byte(kWatchmode), 2); if (!context.flags.z()) goto notreleasehold; - context._sub(context.data.byte(25), 1); - context._cmp(context.data.byte(25), -1); + context._sub(context.data.byte(kSpeedcount), 1); + context._cmp(context.data.byte(kSpeedcount), -1); if (!context.flags.z()) goto notlastspeed2; - context.al = context.data.byte(26); - context.data.byte(25) = context.al; - context._add(context.data.word(27), 1); + context.al = context.data.byte(kWatchspeed); + context.data.byte(kSpeedcount) = context.al; + context._add(context.data.word(kReeltohold), 1); notlastspeed2: - context.ax = context.data.word(27); - context._cmp(context.ax, context.data.word(29)); + context.ax = context.data.word(kReeltohold); + context._cmp(context.ax, context.data.word(kEndofholdreel)); if (!context.flags.z()) goto ismorereel2; - context.data.word(27) = -1; - context.data.byte(31) = -1; - context.al = context.data.byte(32); - context.data.byte(477) = context.al; - context.data.byte(476) = context.al; + context.data.word(kReeltohold) = -1; + context.data.byte(kWatchmode) = -1; + context.al = context.data.byte(kDestafterhold); + context.data.byte(kDestination) = context.al; + context.data.byte(kFinaldest) = context.al; autosetwalk(context); return; ismorereel2: - context.ax = context.data.word(27); - context.data.word(237) = context.ax; + context.ax = context.data.word(kReeltohold); + context.data.word(kReelpointer) = context.ax; plotreel(context); return; notreleasehold: @@ -17679,22 +17679,22 @@ notreleasehold: } void checkforshake(Context & context) { - context._cmp(context.data.byte(183), 26); + context._cmp(context.data.byte(kReallocation), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; - context.data.byte(67) = -1; + context.data.byte(kShakecounter) = -1; notstartshake: return; } void watchcount(Context & context) { - context._cmp(context.data.byte(2), 0); + context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatchworn; - context._add(context.data.byte(145), 1); - context._cmp(context.data.byte(145), 9); + context._add(context.data.byte(kTimercount), 1); + context._cmp(context.data.byte(kTimercount), 9); if (context.flags.z()) goto flashdots; - context._cmp(context.data.byte(145), 18); + context._cmp(context.data.byte(kTimercount), 18); if (context.flags.z()) goto uptime; nowatchworn: return; @@ -17702,89 +17702,89 @@ flashdots: context.ax = 91*3+21; context.di = 268+4; context.bx = 21; - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); showframe(context); goto finishwatch; uptime: - context.data.byte(145) = 0; - context._add(context.data.byte(4), 1); - context._cmp(context.data.byte(4), 60); + context.data.byte(kTimercount) = 0; + context._add(context.data.byte(kSecondcount), 1); + context._cmp(context.data.byte(kSecondcount), 60); if (!context.flags.z()) goto finishtime; - context.data.byte(4) = 0; - context._add(context.data.byte(5), 1); - context._cmp(context.data.byte(5), 60); + context.data.byte(kSecondcount) = 0; + context._add(context.data.byte(kMinutecount), 1); + context._cmp(context.data.byte(kMinutecount), 60); if (!context.flags.z()) goto finishtime; - context.data.byte(5) = 0; - context._add(context.data.byte(6), 1); - context._cmp(context.data.byte(6), 24); + context.data.byte(kMinutecount) = 0; + context._add(context.data.byte(kHourcount), 1); + context._cmp(context.data.byte(kHourcount), 24); if (!context.flags.z()) goto finishtime; - context.data.byte(6) = 0; + context.data.byte(kHourcount) = 0; finishtime: showtime(context); finishwatch: - context.data.byte(265) = 1; + context.data.byte(kWatchdump) = 1; return; } void showtime(Context & context) { - context._cmp(context.data.byte(2), 0); + context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatch; - context.al = context.data.byte(4); + context.al = context.data.byte(kSecondcount); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 282+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3+10); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 282+9; context.bx = 21; showframe(context); - context.al = context.data.byte(5); + context.al = context.data.byte(kMinutecount); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 270+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 270+11; context.bx = 21; showframe(context); - context.al = context.data.byte(6); + context.al = context.data.byte(kHourcount); context.cl = 0; twodigitnum(context); context.push(context.ax); context.al = context.ah; context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 256+5; context.bx = 21; showframe(context); context.ax = context.pop(); context.ah = 0; context._add(context.ax, 91*3); - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 256+11; context.bx = 21; showframe(context); context.ax = 91*3+20; - context.ds = context.data.word(402); + context.ds = context.data.word(kCharset1); context.di = 267+5; context.bx = 21; showframe(context); @@ -17793,14 +17793,14 @@ nowatch: } void dumpwatch(Context & context) { - context._cmp(context.data.byte(265), 1); + context._cmp(context.data.byte(kWatchdump), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; context.bx = 21; context.cl = 40; context.ch = 12; multidump(context); - context.data.byte(265) = 0; + context.data.byte(kWatchdump) = 0; nodumpwatch: return; } @@ -17905,57 +17905,57 @@ noconvnum: void walkandexamine(Context & context) { finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(306); - context.data.byte(99) = context.al; - context.al = context.data.byte(307); - context.data.byte(98) = context.al; - context.data.byte(305) = 0; - context._cmp(context.data.byte(99), 5); + context.al = context.data.byte(kWalkexamtype); + context.data.byte(kCommandtype) = context.al; + context.al = context.data.byte(kWalkexamnum); + context.data.byte(kCommand) = context.al; + context.data.byte(kWalkandexam) = 0; + context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(472) = 1; + context.data.byte(kReasseschanges) = 1; noobselect: return; diff: - context.data.byte(98) = context.al; - context.data.byte(99) = context.ah; + context.data.byte(kCommand) = context.al; + context.data.byte(kCommandtype) = context.ah; diff2: - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(132); - context._cmp(context.al, context.data.byte(134)); + context.al = context.data.byte(kFacing); + context._cmp(context.al, context.data.byte(kTurntoface)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(474); - context._cmp(context.bl, context.data.byte(473)); + context.bl = context.data.byte(kManspath); + context._cmp(context.bl, context.data.byte(kPointerspath)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(150); + context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); - context.ch = context.data.byte(151); + context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(152), 2); + context._cmp(context.data.byte(kLastflag), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(152), 128); + context._cmp(context.data.byte(kLastflag), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(474); - context._cmp(context.bl, context.data.byte(473)); + context.bl = context.data.byte(kManspath); + context._cmp(context.bl, context.data.byte(kPointerspath)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(99), 5); + context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -17974,14 +17974,14 @@ toofaraway: } void mainscreen(Context & context) { - context.data.byte(236) = 0; + context.data.byte(kInmaparea) = 0; context.bx = 4949; - context._cmp(context.data.byte(2), 1); + context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto checkmain; context.bx = 5011; checkmain: checkcoords(context); - context._cmp(context.data.byte(305), 0); + context._cmp(context.data.byte(kWalkandexam), 0); if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: @@ -17989,26 +17989,26 @@ finishmain: } void madmanrun(Context & context) { - context._cmp(context.data.byte(8), 14); + context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(233), 2); + context._cmp(context.data.byte(kPointermode), 2); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(52), 0); + context._cmp(context.data.byte(kMadmanflag), 0); if (!context.flags.z()) { identifyob(context); return; }; - context._cmp(context.data.byte(99), 211); + context._cmp(context.data.byte(kCommandtype), 211); if (context.flags.z()) goto alreadyrun; - context.data.byte(99) = 211; + context.data.byte(kCommandtype) = 211; context.al = 52; commandonly(context); alreadyrun: - context._cmp(context.data.word(200), 1); + context._cmp(context.data.word(kMousebutton), 1); if (!context.flags.z()) goto norun; - context.ax = context.data.word(200); - context._cmp(context.ax, context.data.word(210)); + context.ax = context.data.word(kMousebutton); + context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto norun; - context.data.byte(64) = 8; + context.data.byte(kLastweapon) = 8; norun: return; } @@ -18019,16 +18019,16 @@ loop048: context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nonefound; context.push(context.bx); - context._cmp(context.data.word(196), context.ax); + context._cmp(context.data.word(kMousex), context.ax); if (context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+2); - context._cmp(context.data.word(196), context.ax); + context._cmp(context.data.word(kMousex), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.cs.word(context.bx+4); - context._cmp(context.data.word(198), context.ax); + context._cmp(context.data.word(kMousey), context.ax); if (context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+6); - context._cmp(context.data.word(198), context.ax); + context._cmp(context.data.word(kMousey), context.ax); if (!context.flags.ge()) goto over045; context.ax = context.cs.word(context.bx+8); __dispatch_call(context, context.ax); @@ -18044,31 +18044,31 @@ nonefound: } void identifyob(Context & context) { - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; - context.ax = context.data.word(196); - context._sub(context.ax, context.data.word(115)); + context.ax = context.data.word(kMousex); + context._sub(context.ax, context.data.word(kMapadx)); context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); return; notover1: - context.bx = context.data.word(198); - context._sub(context.bx, context.data.word(117)); + context.bx = context.data.word(kMousey); + context._sub(context.bx, context.data.word(kMapady)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); return; notover2: - context.data.byte(236) = 1; + context.data.byte(kInmaparea) = 1; context.ah = context.bl; context.push(context.ax); findpathofpoint(context); - context.data.byte(473) = context.dl; + context.data.byte(kPointerspath) = context.dl; context.ax = context.pop(); context.push(context.ax); findfirstpath(context); - context.data.byte(475) = context.al; + context.data.byte(kPointerfirstpath) = context.al; context.ax = context.pop(); checkifex(context); if (!context.flags.z()) goto finishidentify; @@ -18078,16 +18078,16 @@ notover2: if (!context.flags.z()) goto finishidentify; checkifset(context); if (!context.flags.z()) goto finishidentify; - context.ax = context.data.word(196); - context._sub(context.ax, context.data.word(115)); + context.ax = context.data.word(kMousex); + context._sub(context.ax, context.data.word(kMapadx)); context.cl = context.al; - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); + context.ax = context.data.word(kMousey); + context._sub(context.ax, context.data.word(kMapady)); context.ch = context.al; checkone(context); context._cmp(context.al, 0); if (context.flags.z()) goto nothingund; - context._cmp(context.data.byte(55), 1); + context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto nothingund; context.ah = 3; obname(context); @@ -18099,7 +18099,7 @@ nothingund: } void checkifperson(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); context.cx = 12; identifyreel: @@ -18110,7 +18110,7 @@ identifyreel: context.push(context.bx); context.push(context.ax); context.ax = context.es.word(context.bx+0); - context.data.word(237) = context.ax; + context.data.word(kReelpointer) = context.ax; getreelstart(context); context._cmp(context.es.word(context.si+2), 0x0ffff); if (!context.flags.z()) goto notblankpers; @@ -18139,7 +18139,7 @@ notblankpers: if (!context.flags.c()) goto notareelid; context.cx = context.pop(); context.ax = context.es.word(context.bx+2); - context.data.word(247) = context.ax; + context.data.word(kPersondata) = context.ax; context.al = context.es.byte(context.bx+4); context.ah = 5; obname(context); @@ -18155,7 +18155,7 @@ notareelid: } void checkifset(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); context.cx = 127; identifyset: @@ -18188,7 +18188,7 @@ notasetid: } void checkifex(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); context.cx = 99; identifyex: @@ -18217,7 +18217,7 @@ notanexid: } void checkiffree(Context & context) { - context.es = context.data.word(410); + context.es = context.data.word(kBuffers); context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); context.cx = 79; identifyfree: @@ -18254,7 +18254,7 @@ void isitdescribed(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(438); + context.es = context.data.word(kSetdesc); context._add(context.bx, 0); context.ax = context.es.word(context.bx); context._add(context.ax, 0+(130*2)); @@ -18271,8 +18271,8 @@ void isitdescribed(Context & context) { void findpathofpoint(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(448); - context.al = context.data.byte(184); + context.es = context.data.word(kReels); + context.al = context.data.byte(kRoomnum); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18309,8 +18309,8 @@ gotvalidpath: void findfirstpath(Context & context) { context.push(context.ax); context.bx = 0; - context.es = context.data.word(448); - context.al = context.data.byte(184); + context.es = context.data.word(kReels); + context.al = context.data.byte(kRoomnum); context.ah = 0; context.cx = 144; context._mul(context.cx); @@ -18347,7 +18347,7 @@ void turnpathon(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 255; - context.ch = context.data.byte(184); + context.ch = context.data.byte(kRoomnum); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18370,7 +18370,7 @@ void turnpathoff(Context & context) { context.push(context.ax); context.push(context.ax); context.cl = 0; - context.ch = context.data.byte(184); + context.ch = context.data.byte(kRoomnum); context._add(context.ch, 100); findormake(context); context.ax = context.pop(); @@ -18401,7 +18401,7 @@ void turnanypathon(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18427,7 +18427,7 @@ void turnanypathoff(Context & context) { context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -18456,27 +18456,27 @@ void checkifpathison(Context & context) { } void afternewroom(Context & context) { - context._cmp(context.data.byte(185), 0); + context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnew; - context.data.word(326) = 0; + context.data.word(kTimecount) = 0; createpanel(context); - context.data.byte(99) = 0; + context.data.byte(kCommandtype) = 0; findroominloc(context); - context._cmp(context.data.byte(62), 1); + context._cmp(context.data.byte(kRyanon), 1); if (context.flags.z()) goto ryansoff; - context.al = context.data.byte(150); + context.al = context.data.byte(kRyanx); context._add(context.al, 12); - context.ah = context.data.byte(151); + context.ah = context.data.byte(kRyany); context._add(context.ah, 12); findpathofpoint(context); - context.data.byte(474) = context.dl; + context.data.byte(kManspath) = context.dl; findxyfrompath(context); - context.data.byte(186) = 1; + context.data.byte(kResetmanxy) = 1; ryansoff: - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); - context.data.word(96) = 160; - context.data.byte(185) = 0; + context.data.word(kLookcounter) = 160; + context.data.byte(kNowinnewroom) = 0; showicon(context); spriteupdate(context); printsprites(context); @@ -18494,50 +18494,50 @@ notnew: } void atmospheres(Context & context) { - context.cl = context.data.byte(147); - context.ch = context.data.byte(148); + context.cl = context.data.byte(kMapx); + context.ch = context.data.byte(kMapy); context.bx = 5073; nextatmos: context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto nomoreatmos; - context._cmp(context.al, context.data.byte(183)); + context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto wrongatmos; context.ax = context.cs.word(context.bx+1); context._cmp(context.ax, context.cx); if (!context.flags.z()) goto wrongatmos; context.ax = context.cs.word(context.bx+3); - context._cmp(context.al, context.data.byte(506)); + context._cmp(context.al, context.data.byte(kCh0playing)); if (context.flags.z()) goto playingalready; - context._cmp(context.data.byte(8), 45); + context._cmp(context.data.byte(kLocation), 45); if (!context.flags.z()) goto notweb; - context._cmp(context.data.word(21), 45); + context._cmp(context.data.word(kReeltowatch), 45); if (context.flags.z()) goto wrongatmos; notweb: playchannel0(context); - context._cmp(context.data.byte(183), 2); - context._cmp(context.data.byte(148), 0); + context._cmp(context.data.byte(kReallocation), 2); + context._cmp(context.data.byte(kMapy), 0); if (context.flags.z()) goto fullvol; if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(148), 10); + context._cmp(context.data.byte(kMapy), 10); if (!context.flags.z()) goto notlouisvol; - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto notlouisvol; - context.data.byte(385) = 5; + context.data.byte(kVolume) = 5; notlouisvol: playingalready: - context._cmp(context.data.byte(183), 2); + context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notlouisvol2; - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (context.flags.z()) goto louisvol; - context._cmp(context.data.byte(147), 11); + context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto notlouisvol2; fullvol: - context.data.byte(385) = 0; + context.data.byte(kVolume) = 0; notlouisvol2: return; louisvol: - context.data.byte(385) = 5; + context.data.byte(kVolume) = 5; return; wrongatmos: context._add(context.bx, 5); @@ -18548,126 +18548,126 @@ nomoreatmos: } void walkintoroom(Context & context) { - context._cmp(context.data.byte(8), 14); + context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) goto notlair; - context._cmp(context.data.byte(147), 22); + context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto notlair; - context.data.byte(477) = 1; - context.data.byte(476) = 1; + context.data.byte(kDestination) = 1; + context.data.byte(kFinaldest) = 1; autosetwalk(context); notlair: return; } void afterintroroom(Context & context) { - context._cmp(context.data.byte(185), 0); + context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnewintro; clearwork(context); findroominloc(context); - context.data.byte(61) = 1; + context.data.byte(kNewobs) = 1; drawfloor(context); reelsonscreen(context); spriteupdate(context); printsprites(context); worktoscreen(context); - context.data.byte(185) = 0; + context.data.byte(kNowinnewroom) = 0; notnewintro: return; } void obname(Context & context) { - context._cmp(context.data.byte(472), 0); + context._cmp(context.data.byte(kReasseschanges), 0); if (context.flags.z()) goto notnewpath; - context.data.byte(472) = 0; + context.data.byte(kReasseschanges) = 0; goto diff; notnewpath: - context._cmp(context.ah, context.data.byte(99)); + context._cmp(context.ah, context.data.byte(kCommandtype)); if (context.flags.z()) goto notdiffob; goto diff; notdiffob: - context._cmp(context.al, context.data.byte(98)); + context._cmp(context.al, context.data.byte(kCommand)); if (!context.flags.z()) goto diff; - context._cmp(context.data.byte(305), 1); + context._cmp(context.data.byte(kWalkandexam), 1); if (context.flags.z()) goto walkandexamine; - context._cmp(context.data.word(200), 0); + context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto noobselect; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (!context.flags.z()) goto isntblock; - context._cmp(context.data.byte(152), 2); + context._cmp(context.data.byte(kLastflag), 2); if (context.flags.c()) goto noobselect; isntblock: - context.bl = context.data.byte(474); - context._cmp(context.bl, context.data.byte(473)); + context.bl = context.data.byte(kManspath); + context._cmp(context.bl, context.data.byte(kPointerspath)); if (!context.flags.z()) goto wantstowalk; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto wantstowalk; finishedwalking(context); if (!context.flags.z()) goto noobselect; - context._cmp(context.data.byte(99), 5); + context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto wantstotalk; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; examineob(context); return; wantstotalk: - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; talk(context); return; walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; - context.al = context.data.byte(306); - context.data.byte(99) = context.al; - context.al = context.data.byte(307); - context.data.byte(98) = context.al; - context.data.byte(305) = 0; - context._cmp(context.data.byte(99), 5); + context.al = context.data.byte(kWalkexamtype); + context.data.byte(kCommandtype) = context.al; + context.al = context.data.byte(kWalkexamnum); + context.data.byte(kCommand) = context.al; + context.data.byte(kWalkandexam) = 0; + context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); return; wantstowalk: setwalk(context); - context.data.byte(472) = 1; + context.data.byte(kReasseschanges) = 1; noobselect: return; diff: - context.data.byte(98) = context.al; - context.data.byte(99) = context.ah; + context.data.byte(kCommand) = context.al; + context.data.byte(kCommandtype) = context.ah; diff2: - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto middleofwalk; - context.al = context.data.byte(132); - context._cmp(context.al, context.data.byte(134)); + context.al = context.data.byte(kFacing); + context._cmp(context.al, context.data.byte(kTurntoface)); if (!context.flags.z()) goto middleofwalk; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (!context.flags.z()) goto notblock; - context.bl = context.data.byte(474); - context._cmp(context.bl, context.data.byte(473)); + context.bl = context.data.byte(kManspath); + context._cmp(context.bl, context.data.byte(kPointerspath)); if (!context.flags.z()) goto dontcheck; - context.cl = context.data.byte(150); + context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); - context.ch = context.data.byte(151); + context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); if (context.flags.c()) goto isblock; dontcheck: getflagunderp(context); - context._cmp(context.data.byte(152), 2); + context._cmp(context.data.byte(kLastflag), 2); if (context.flags.c()) goto isblock; - context._cmp(context.data.byte(152), 128); + context._cmp(context.data.byte(kLastflag), 128); if (!context.flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(474); - context._cmp(context.bl, context.data.byte(473)); + context.bl = context.data.byte(kManspath); + context._cmp(context.bl, context.data.byte(kPointerspath)); if (!context.flags.z()) goto toofaraway; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto isblock; - context._cmp(context.data.byte(99), 5); + context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); return; @@ -18686,17 +18686,17 @@ toofaraway: } void finishedwalking(Context & context) { - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto iswalking; - context.al = context.data.byte(132); - context._cmp(context.al, context.data.byte(134)); + context.al = context.data.byte(kFacing); + context._cmp(context.al, context.data.byte(kTurntoface)); iswalking: return; } void examineobtext(Context & context) { - context.bl = context.data.byte(98); - context.bh = context.data.byte(99); + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kCommandtype); context.al = 1; commandwithob(context); return; @@ -18725,13 +18725,13 @@ void commandwithob(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(450); + context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(77); - context.bx = context.data.word(79); - context.dl = context.data.byte(81); + context.di = context.data.word(kTextaddressx); + context.bx = context.data.word(kTextaddressy); + context.dl = context.data.byte(kTextlen); context.al = 0; context.ah = 0; printdirect(context); @@ -18739,19 +18739,19 @@ void commandwithob(Context & context) { context.di = 5674; copyname(context); context.ax = context.pop(); - context.di = context.data.word(82); + context.di = context.data.word(kLastxpos); context._cmp(context.al, 0); if (context.flags.z()) goto noadd; context._add(context.di, 5); noadd: - context.bx = context.data.word(79); + context.bx = context.data.word(kTextaddressy); context.es = context.cs; context.si = 5674; - context.dl = context.data.byte(81); + context.dl = context.data.byte(kTextlen); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(108) = 1; + context.data.byte(kNewtextline) = 1; return; } @@ -18776,17 +18776,17 @@ void commandonly(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(450); + context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; - context.di = context.data.word(77); - context.bx = context.data.word(79); - context.dl = context.data.byte(81); + context.di = context.data.word(kTextaddressx); + context.bx = context.data.word(kTextaddressy); + context.dl = context.data.byte(kTextlen); context.al = 0; context.ah = 0; printdirect(context); - context.data.byte(108) = 1; + context.data.byte(kNewtextline) = 1; return; } @@ -18797,7 +18797,7 @@ void printmessage(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(450); + context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18818,7 +18818,7 @@ void printmessage2(Context & context) { context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; - context.es = context.data.word(450); + context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); context._add(context.ax, 66*2); context.si = context.ax; @@ -18839,63 +18839,63 @@ searchmess: } void blocknametext(Context & context) { - context.bl = context.data.byte(98); - context.bh = context.data.byte(99); + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kCommandtype); context.al = 0; commandwithob(context); return; } void personnametext(Context & context) { - context.bl = context.data.byte(98); + context.bl = context.data.byte(kCommand); context._and(context.bl, 127); - context.bh = context.data.byte(99); + context.bh = context.data.byte(kCommandtype); context.al = 2; commandwithob(context); return; } void walktotext(Context & context) { - context.bl = context.data.byte(98); - context.bh = context.data.byte(99); + context.bl = context.data.byte(kCommand); + context.bh = context.data.byte(kCommandtype); context.al = 3; commandwithob(context); return; } void getflagunderp(Context & context) { - context.cx = context.data.word(196); - context._sub(context.cx, context.data.word(115)); - context.ax = context.data.word(198); - context._sub(context.ax, context.data.word(117)); + context.cx = context.data.word(kMousex); + context._sub(context.cx, context.data.word(kMapadx)); + context.ax = context.data.word(kMousey); + context._sub(context.ax, context.data.word(kMapady)); context.ch = context.al; checkone(context); - context.data.byte(152) = context.cl; - context.data.byte(153) = context.ch; + context.data.byte(kLastflag) = context.cl; + context.data.byte(kLastflagex) = context.ch; return; } void setwalk(Context & context) { - context._cmp(context.data.byte(491), 254); + context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto alreadywalking; - context.al = context.data.byte(473); - context._cmp(context.al, context.data.byte(474)); + context.al = context.data.byte(kPointerspath); + context._cmp(context.al, context.data.byte(kManspath)); if (context.flags.z()) goto cantwalk2; - context._cmp(context.data.byte(31), 1); + context._cmp(context.data.byte(kWatchmode), 1); if (context.flags.z()) goto holdingreel; - context._cmp(context.data.byte(31), 2); + context._cmp(context.data.byte(kWatchmode), 2); if (context.flags.z()) goto cantwalk; - context.data.byte(477) = context.al; - context.data.byte(476) = context.al; - context._cmp(context.data.word(200), 2); + context.data.byte(kDestination) = context.al; + context.data.byte(kFinaldest) = context.al; + context._cmp(context.data.word(kMousebutton), 2); if (!context.flags.z()) goto notwalkandexam; - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto notwalkandexam; - context.data.byte(305) = 1; - context.al = context.data.byte(99); - context.data.byte(306) = context.al; - context.al = context.data.byte(98); - context.data.byte(307) = context.al; + context.data.byte(kWalkandexam) = 1; + context.al = context.data.byte(kCommandtype); + context.data.byte(kWalkexamtype) = context.al; + context.al = context.data.byte(kCommand); + context.data.byte(kWalkexamnum) = context.al; notwalkandexam: autosetwalk(context); cantwalk: @@ -18904,25 +18904,25 @@ cantwalk2: facerightway(context); return; alreadywalking: - context.al = context.data.byte(473); - context.data.byte(476) = context.al; + context.al = context.data.byte(kPointerspath); + context.data.byte(kFinaldest) = context.al; return; holdingreel: - context.data.byte(32) = context.al; - context.data.byte(31) = 2; + context.data.byte(kDestafterhold) = context.al; + context.data.byte(kWatchmode) = 2; return; } void autosetwalk(Context & context) { - context.al = context.data.byte(474); - context._cmp(context.data.byte(476), context.al); + context.al = context.data.byte(kManspath); + context._cmp(context.data.byte(kFinaldest), context.al); if (!context.flags.z()) goto notsamealready; return; notsamealready: getroomspaths(context); checkdest(context); context.push(context.bx); - context.al = context.data.byte(474); + context.al = context.data.byte(kManspath); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18931,13 +18931,13 @@ notsamealready: context.al = context.es.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(478) = context.ax; + context.data.word(kLinestartx) = context.ax; context.al = context.es.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(480) = context.ax; + context.data.word(kLinestarty) = context.ax; context.bx = context.pop(); - context.al = context.data.byte(477); + context.al = context.data.byte(kDestination); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18946,33 +18946,33 @@ notsamealready: context.al = context.es.byte(context.bx); context.ah = 0; context._sub(context.ax, 12); - context.data.word(482) = context.ax; + context.data.word(kLineendx) = context.ax; context.al = context.es.byte(context.bx+1); context.ah = 0; context._sub(context.ax, 12); - context.data.word(484) = context.ax; + context.data.word(kLineendy) = context.ax; bresenhams(context); - context._cmp(context.data.byte(492), 0); + context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalline; - context.al = context.data.byte(493); + context.al = context.data.byte(kLinelength); context._sub(context.al, 1); - context.data.byte(491) = context.al; - context.data.byte(492) = 1; + context.data.byte(kLinepointer) = context.al; + context.data.byte(kLinedirection) = 1; return; normalline: - context.data.byte(491) = 0; + context.data.byte(kLinepointer) = 0; return; } void checkdest(Context & context) { context.push(context.bx); context._add(context.bx, 12*8); - context.ah = context.data.byte(474); + context.ah = context.data.byte(kManspath); context.cl = 4; context._shl(context.ah, context.cl); - context.al = context.data.byte(477); + context.al = context.data.byte(kDestination); context.cl = 24; - context.ch = context.data.byte(477); + context.ch = context.data.byte(kDestination); checkdestloop: context.dh = context.es.byte(context.bx); context._and(context.dh, 0xf0); @@ -18982,7 +18982,7 @@ checkdestloop: if (!context.flags.z()) goto nextcheck; context.al = context.es.byte(context.bx+1); context._and(context.al, 15); - context.data.byte(477) = context.al; + context.data.byte(kDestination) = context.al; context.bx = context.pop(); return; nextcheck: @@ -19006,7 +19006,7 @@ nextcheck2: context._add(context.bx, 2); context._sub(context.cl, 1); if (!context.flags.z()) goto checkdestloop; - context.data.byte(477) = context.ch; + context.data.byte(kDestination) = context.ch; context.bx = context.pop(); return; } @@ -19017,60 +19017,60 @@ void bresenhams(Context & context) { context.es = context.dx; context.di = 7944; context.si = 1; - context.data.byte(492) = 0; - context.cx = context.data.word(482); - context._sub(context.cx, context.data.word(478)); + context.data.byte(kLinedirection) = 0; + context.cx = context.data.word(kLineendx); + context._sub(context.cx, context.data.word(kLinestartx)); if (context.flags.z()) goto vertline; if (!context.flags.s()) goto line1; context._neg(context.cx); - context.bx = context.data.word(482); - context._xchg(context.bx, context.data.word(478)); - context.data.word(482) = context.bx; - context.bx = context.data.word(484); - context._xchg(context.bx, context.data.word(480)); - context.data.word(484) = context.bx; - context.data.byte(492) = 1; + context.bx = context.data.word(kLineendx); + context._xchg(context.bx, context.data.word(kLinestartx)); + context.data.word(kLineendx) = context.bx; + context.bx = context.data.word(kLineendy); + context._xchg(context.bx, context.data.word(kLinestarty)); + context.data.word(kLineendy) = context.bx; + context.data.byte(kLinedirection) = 1; line1: - context.bx = context.data.word(484); - context._sub(context.bx, context.data.word(480)); + context.bx = context.data.word(kLineendy); + context._sub(context.bx, context.data.word(kLinestarty)); if (context.flags.z()) goto horizline; if (!context.flags.s()) goto line3; context._neg(context.bx); context._neg(context.si); line3: context.push(context.si); - context.data.byte(490) = 0; + context.data.byte(kLineroutine) = 0; context._cmp(context.bx, context.cx); if (context.flags.le()) goto line4; - context.data.byte(490) = 1; + context.data.byte(kLineroutine) = 1; context._xchg(context.bx, context.cx); line4: context._shl(context.bx, 1); - context.data.word(486) = context.bx; + context.data.word(kIncrement1) = context.bx; context._sub(context.bx, context.cx); context.si = context.bx; context._sub(context.bx, context.cx); - context.data.word(488) = context.bx; - context.ax = context.data.word(478); - context.bx = context.data.word(480); + context.data.word(kIncrement2) = context.bx; + context.ax = context.data.word(kLinestartx); + context.bx = context.data.word(kLinestarty); context.ah = context.bl; context._add(context.cx, 1); context.bx = context.pop(); - context._cmp(context.data.byte(490), 1); + context._cmp(context.data.byte(kLineroutine), 1); if (context.flags.z()) goto hislope; goto loslope; vertline: - context.ax = context.data.word(480); - context.bx = context.data.word(484); + context.ax = context.data.word(kLinestarty); + context.bx = context.data.word(kLineendy); context.cx = context.bx; context._sub(context.cx, context.ax); if (!context.flags.ge()) goto line31; context._neg(context.cx); context.ax = context.bx; - context.data.byte(492) = 1; + context.data.byte(kLinedirection) = 1; line31: context._add(context.cx, 1); - context.bx = context.data.word(478); + context.bx = context.data.word(kLinestartx); context._xchg(context.ax, context.bx); context.ah = context.bl; context.bx = context.si; @@ -19080,8 +19080,8 @@ line32: if (--context.cx) goto line32; goto lineexit; horizline: - context.ax = context.data.word(478); - context.bx = context.data.word(480); + context.ax = context.data.word(kLinestartx); + context.bx = context.data.word(kLinestarty); context.ah = context.bl; context._add(context.cx, 1); horizloop: @@ -19095,11 +19095,11 @@ loloop: context._add(context.al, 1); context._or(context.si, context.si); if (!context.flags.s()) goto line12; - context._add(context.si, context.data.word(486)); + context._add(context.si, context.data.word(kIncrement1)); if (--context.cx) goto loloop; goto lineexit; line12: - context._add(context.si, context.data.word(488)); + context._add(context.si, context.data.word(kIncrement2)); context._add(context.ah, context.bl); if (--context.cx) goto loloop; goto lineexit; @@ -19109,33 +19109,33 @@ hiloop: context._add(context.ah, context.bl); context._or(context.si, context.si); if (!context.flags.s()) goto line23; - context._add(context.si, context.data.word(486)); + context._add(context.si, context.data.word(kIncrement1)); if (--context.cx) goto hiloop; goto lineexit; line23: - context._add(context.si, context.data.word(488)); + context._add(context.si, context.data.word(kIncrement2)); context._add(context.al, 1); if (--context.cx) goto hiloop; lineexit: context._sub(context.di, 7944); context.ax = context.di; context._shr(context.ax, 1); - context.data.byte(493) = context.al; + context.data.byte(kLinelength) = context.al; return; } void workoutframes(Context & context) { - context.bx = context.data.word(478); + context.bx = context.data.word(kLinestartx); context._add(context.bx, 32); - context.ax = context.data.word(482); + context.ax = context.data.word(kLineendx); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (!context.flags.c()) goto notneg1; context._neg(context.bx); notneg1: - context.cx = context.data.word(480); + context.cx = context.data.word(kLinestarty); context._add(context.cx, 32); - context.ax = context.data.word(484); + context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto notneg2; @@ -19159,16 +19159,16 @@ tendstohoriz: context.dl = 1; goto gotquad; gotquad: - context.bx = context.data.word(478); + context.bx = context.data.word(kLinestartx); context._add(context.bx, 32); - context.ax = context.data.word(482); + context.ax = context.data.word(kLineendx); context._add(context.ax, 32); context._sub(context.bx, context.ax); if (context.flags.c()) goto isinright; isinleft: - context.cx = context.data.word(480); + context.cx = context.data.word(kLinestarty); context._add(context.cx, 32); - context.ax = context.data.word(484); + context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto topleft; @@ -19182,9 +19182,9 @@ topleft: context._add(context.dl, 6); goto success; isinright: - context.cx = context.data.word(480); + context.cx = context.data.word(kLinestarty); context._add(context.cx, 32); - context.ax = context.data.word(484); + context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); if (!context.flags.c()) goto botright; @@ -19197,17 +19197,17 @@ botright: noswap2: success: context._and(context.dl, 7); - context.data.byte(134) = context.dl; - context.data.byte(135) = 0; + context.data.byte(kTurntoface) = context.dl; + context.data.byte(kTurndirection) = 0; return; } void getroomspaths(Context & context) { - context.al = context.data.byte(184); + context.al = context.data.byte(kRoomnum); context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.bx = 0; context._add(context.bx, context.ax); return; @@ -19252,7 +19252,7 @@ void findobname(Context & context) { context.bx = 64*2; context._mul(context.bx); context.si = context.ax; - context.ds = context.data.word(446); + context.ds = context.data.word(kPeople); context._add(context.si, 0+24); context.cx = 0+24+(1026*2); context.ax = context.ds.word(context.si); @@ -19263,7 +19263,7 @@ void findobname(Context & context) { notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; - context.ds = context.data.word(396); + context.ds = context.data.word(kExtras); context._add(context.bx, 0+2080+30000+(16*114)); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); @@ -19272,7 +19272,7 @@ notpersonname: notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; - context.ds = context.data.word(436); + context.ds = context.data.word(kFreedesc); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(82*2)); @@ -19281,14 +19281,14 @@ notextraname: notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; - context.ds = context.data.word(438); + context.ds = context.data.word(kSetdesc); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(130*2)); context.si = context.ax; return; notsetname: - context.ds = context.data.word(440); + context.ds = context.data.word(kBlockdesc); context._add(context.bx, 0); context.ax = context.ds.word(context.bx); context._add(context.ax, 0+(98*2)); @@ -19297,7 +19297,7 @@ notsetname: } void showicon(Context & context) { - context._cmp(context.data.byte(183), 50); + context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) goto isdream1; showpanel(context); showman(context); @@ -19306,37 +19306,37 @@ void showicon(Context & context) { zoomicon(context); return; isdream1: - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 72; context.bx = 2; context.al = 45; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 72+47; context.bx = 2; context.al = 46; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 69-10; context.bx = 21; context.al = 49; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 160+88; context.bx = 2; context.al = 45; context.ah = 4; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 160+43; context.bx = 2; context.al = 46; context.ah = 4; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 160+101; context.bx = 21; context.al = 49; @@ -19347,25 +19347,25 @@ isdream1: } void middlepanel(Context & context) { - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 72+47+20; context.bx = 0; context.al = 48; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 72+19; context.bx = 21; context.al = 47; context.ah = 0; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 160+23; context.bx = 0; context.al = 48; context.ah = 4; showframe(context); - context.ds = context.data.word(462); + context.ds = context.data.word(kTempsprites); context.di = 160+71; context.bx = 21; context.al = 47; @@ -19375,21 +19375,21 @@ void middlepanel(Context & context) { } void showman(Context & context) { - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 0; context.bx = 0; context.al = 0; context.ah = 0; showframe(context); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 0; context.bx = 114; context.al = 1; context.ah = 0; showframe(context); - context._cmp(context.data.byte(3), 0); + context._cmp(context.data.byte(kShadeson), 0); if (context.flags.z()) goto notverycool; - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 28; context.bx = 25; context.al = 2; @@ -19400,13 +19400,13 @@ notverycool: } void showpanel(Context & context) { - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 72; context.bx = 0; context.al = 19; context.ah = 0; showframe(context); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 192; context.bx = 0; context.al = 19; @@ -19421,48 +19421,48 @@ void roomname(Context & context) { context.al = 53; context.dl = 240; printmessage(context); - context.bl = context.data.byte(184); + context.bl = context.data.byte(kRoomnum); context._cmp(context.bl, 32); if (context.flags.c()) goto notover32; context._sub(context.bl, 32); notover32: context.bh = 0; context._add(context.bx, context.bx); - context.es = context.data.word(434); + context.es = context.data.word(kRoomdesc); context._add(context.bx, 0); context.ax = context.es.word(context.bx); context._add(context.ax, 0+(38*2)); context.si = context.ax; - context.data.word(75) = 7; + context.data.word(kLinespacing) = 7; context.di = 88; context.bx = 25; context.dl = 120; - context._cmp(context.data.byte(2), 1); + context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto gotpl; context.dl = 160; gotpl: context.al = 0; context.ah = 0; printdirect(context); - context.data.word(75) = 10; + context.data.word(kLinespacing) = 10; usecharset1(context); return; } void usecharset1(Context & context) { - context.ax = context.data.word(402); - context.data.word(266) = context.ax; + context.ax = context.data.word(kCharset1); + context.data.word(kCurrentset) = context.ax; return; } void usetempcharset(Context & context) { - context.ax = context.data.word(404); - context.data.word(266) = context.ax; + context.ax = context.data.word(kTempcharset); + context.data.word(kCurrentset) = context.ax; return; } void showexit(Context & context) { - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 274; context.bx = 154; context.al = 11; @@ -19473,12 +19473,12 @@ void showexit(Context & context) { void panelicons1(Context & context) { context.di = 0; - context._cmp(context.data.byte(2), 1); + context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto watchison; context.di = 48; watchison: context.push(context.di); - context.ds = context.data.word(408); + context.ds = context.data.word(kIcons2); context._add(context.di, 204); context.bx = 4; context.al = 2; @@ -19486,9 +19486,9 @@ watchison: showframe(context); context.di = context.pop(); context.push(context.di); - context._cmp(context.data.byte(7), 1); + context._cmp(context.data.byte(kZoomon), 1); if (context.flags.z()) goto zoomisoff; - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context._add(context.di, 228); context.bx = 8; context.al = 5; @@ -19501,9 +19501,9 @@ zoomisoff: } void showwatch(Context & context) { - context._cmp(context.data.byte(2), 0); + context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowristwatch; - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 250; context.bx = 1; context.al = 6; @@ -19515,9 +19515,9 @@ nowristwatch: } void zoomicon(Context & context) { - context._cmp(context.data.byte(7), 0); + context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) goto nozoom1; - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 8; context.bx = 132-1; context.al = 8; @@ -19528,20 +19528,20 @@ nozoom1: } void showblink(Context & context) { - context._cmp(context.data.byte(130), 1); + context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) goto finblink1; - context._add(context.data.byte(471), 1); - context._cmp(context.data.byte(3), 0); + context._add(context.data.byte(kBlinkcount), 1); + context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto finblink1; - context._cmp(context.data.byte(183), 50); + context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) goto eyesshut; - context.al = context.data.byte(471); + context.al = context.data.byte(kBlinkcount); context._cmp(context.al, 3); if (!context.flags.z()) goto finblink1; - context.data.byte(471) = 0; - context.al = context.data.byte(470); + context.data.byte(kBlinkcount) = 0; + context.al = context.data.byte(kBlinkframe); context._add(context.al, 1); - context.data.byte(470) = context.al; + context.data.byte(kBlinkframe) = context.al; context._cmp(context.al, 6); if (context.flags.c()) goto nomorethan6; context.al = 6; @@ -19550,7 +19550,7 @@ nomorethan6: context.bx = 5691; context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.di = 44; context.bx = 32; context.ah = 0; @@ -19562,11 +19562,11 @@ eyesshut: } void dumpblink(Context & context) { - context._cmp(context.data.byte(3), 0); + context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto nodumpeye; - context._cmp(context.data.byte(471), 0); + context._cmp(context.data.byte(kBlinkcount), 0); if (!context.flags.z()) goto nodumpeye; - context.al = context.data.byte(470); + context.al = context.data.byte(kBlinkframe); context._cmp(context.al, 6); if (!context.flags.c()) goto nodumpeye; context.push(context.ds); @@ -19591,9 +19591,9 @@ void worktoscreenm(Context & context) { } void blank(Context & context) { - context._cmp(context.data.byte(99), 199); + context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.z()) goto alreadyblnk; - context.data.byte(99) = 199; + context.data.byte(kCommandtype) = 199; context.al = 0; commandonly(context); alreadyblnk: @@ -19612,14 +19612,14 @@ void hangonp(Context & context) { context._add(context.cx, context.cx); context.ax = context.pop(); context._add(context.cx, context.ax); - context.data.word(136) = 0; - context.al = context.data.byte(230); - context.ah = context.data.byte(105); + context.data.word(kMaintimer) = 0; + context.al = context.data.byte(kPointerframe); + context.ah = context.data.byte(kPickup); context.push(context.ax); - context.data.byte(233) = 3; - context.data.byte(105) = 0; + context.data.byte(kPointermode) = 3; + context.data.byte(kPickup) = 0; context.push(context.cx); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; readmouse(context); animpointer(context); showpointer(context); @@ -19635,19 +19635,19 @@ hangloop: vsync(context); dumppointer(context); context.cx = context.pop(); - context.ax = context.data.word(200); + context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 0); if (context.flags.z()) goto notpressed; - context._cmp(context.ax, context.data.word(210)); + context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto getoutofit; notpressed: if (--context.cx) goto hangloop; getoutofit: delpointer(context); context.ax = context.pop(); - context.data.byte(230) = context.al; - context.data.byte(105) = context.ah; - context.data.byte(233) = 0; + context.data.byte(kPointerframe) = context.al; + context.data.byte(kPickup) = context.ah; + context.data.byte(kPointermode) = 0; return; } @@ -19679,7 +19679,7 @@ monloop1: void getunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19688,7 +19688,7 @@ void getunderzoom(Context & context) { } void dumpzoom(Context & context) { - context._cmp(context.data.byte(7), 1); + context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) goto notzoomon; context.di = 8+5; context.bx = 132+4; @@ -19702,7 +19702,7 @@ notzoomon: void putunderzoom(Context & context) { context.di = 8+5; context.bx = 132+4; - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); context.cl = 46; context.ch = 40; @@ -19711,12 +19711,12 @@ void putunderzoom(Context & context) { } void crosshair(Context & context) { - context._cmp(context.data.byte(99), 3); + context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto nocross; - context._cmp(context.data.byte(99), 10); + context._cmp(context.data.byte(kCommandtype), 10); if (!context.flags.c()) goto nocross; - context.es = context.data.word(398); - context.ds = context.data.word(406); + context.es = context.data.word(kWorkspace); + context.ds = context.data.word(kIcons1); context.di = 8+24; context.bx = 132+19; context.al = 9; @@ -19724,8 +19724,8 @@ void crosshair(Context & context) { showframe(context); return; nocross: - context.es = context.data.word(398); - context.ds = context.data.word(406); + context.es = context.data.word(kWorkspace); + context.ds = context.data.word(kIcons1); context.di = 8+24; context.bx = 132+19; context.al = 29; @@ -19736,16 +19736,16 @@ nocross: void showpointer(Context & context) { showblink(context); - context.di = context.data.word(196); - context.data.word(218) = context.di; - context.bx = context.data.word(198); - context.data.word(220) = context.bx; - context._cmp(context.data.byte(105), 1); + context.di = context.data.word(kMousex); + context.data.word(kOldpointerx) = context.di; + context.bx = context.data.word(kMousey); + context.data.word(kOldpointery) = context.bx; + context._cmp(context.data.byte(kPickup), 1); if (context.flags.z()) goto itsanobject; context.push(context.bx); context.push(context.di); - context.ds = context.data.word(406); - context.al = context.data.byte(230); + context.ds = context.data.word(kIcons1); + context.al = context.data.byte(kPointerframe); context._add(context.al, 20); context.ah = 0; context._add(context.ax, context.ax); @@ -19761,10 +19761,10 @@ notsmallx: if (!context.flags.c()) goto notsmally; context.ch = 12; notsmally: - context.data.byte(226) = context.cl; - context.data.byte(227) = context.ch; + context.data.byte(kPointerxs) = context.cl; + context.data.byte(kPointerys) = context.ch; context.push(context.ds); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19772,7 +19772,7 @@ notsmally: context.bx = context.pop(); context.push(context.di); context.push(context.bx); - context.al = context.data.byte(230); + context.al = context.data.byte(kPointerframe); context._add(context.al, 20); context.ah = 0; showframe(context); @@ -19780,11 +19780,11 @@ notsmally: context.di = context.pop(); return; itsanobject: - context.al = context.data.byte(88); - context.ds = context.data.word(396); - context._cmp(context.data.byte(101), 4); + context.al = context.data.byte(kItemframe); + context.ds = context.data.word(kExtras); + context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto itsfrominv; - context.ds = context.data.word(444); + context.ds = context.data.word(kFreeframes); itsfrominv: context.cl = context.al; context._add(context.al, context.al); @@ -19806,8 +19806,8 @@ notsmallx2: if (!context.flags.c()) goto notsmally2; context.ch = 12; notsmally2: - context.data.byte(226) = context.cl; - context.data.byte(227) = context.ch; + context.data.byte(kPointerxs) = context.cl; + context.data.byte(kPointerys) = context.ch; context.ax = context.pop(); context.push(context.di); context.push(context.bx); @@ -19818,13 +19818,13 @@ notsmally2: context.al = context.cl; context.ah = 0; context._shr(context.ax, 1); - context._sub(context.data.word(218), context.ax); + context._sub(context.data.word(kOldpointerx), context.ax); context._sub(context.di, context.ax); context.al = context.ch; context._shr(context.ax, 1); - context._sub(context.data.word(220), context.ax); + context._sub(context.data.word(kOldpointery), context.ax); context._sub(context.bx, context.ax); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60; multiget(context); context.ds = context.pop(); @@ -19835,7 +19835,7 @@ notsmally2: showframe(context); context.bx = context.pop(); context.di = context.pop(); - context.ds = context.data.word(406); + context.ds = context.data.word(kIcons1); context.al = 3; context.ah = 128; showframe(context); @@ -19843,20 +19843,20 @@ notsmally2: } void delpointer(Context & context) { - context.ax = context.data.word(218); + context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; - context.data.word(222) = context.ax; - context.ax = context.data.word(220); - context.data.word(224) = context.ax; - context.cl = context.data.byte(226); - context.data.byte(228) = context.cl; - context.ch = context.data.byte(227); - context.data.byte(229) = context.ch; - context.ds = context.data.word(410); + context.data.word(kDelherex) = context.ax; + context.ax = context.data.word(kOldpointery); + context.data.word(kDelherey) = context.ax; + context.cl = context.data.byte(kPointerxs); + context.data.byte(kDelxs) = context.cl; + context.ch = context.data.byte(kPointerys); + context.data.byte(kDelys) = context.ch; + context.ds = context.data.word(kBuffers); context.si = 0+(228*13)+32+60; - context.di = context.data.word(222); - context.bx = context.data.word(224); + context.di = context.data.word(kDelherex); + context.bx = context.data.word(kDelherey); multiput(context); nevershown: return; @@ -19864,30 +19864,30 @@ nevershown: void dumppointer(Context & context) { dumpblink(context); - context.cl = context.data.byte(228); - context.ch = context.data.byte(229); - context.di = context.data.word(222); - context.bx = context.data.word(224); + context.cl = context.data.byte(kDelxs); + context.ch = context.data.byte(kDelys); + context.di = context.data.word(kDelherex); + context.bx = context.data.word(kDelherey); multidump(context); - context.bx = context.data.word(220); - context.di = context.data.word(218); - context._cmp(context.di, context.data.word(222)); + context.bx = context.data.word(kOldpointery); + context.di = context.data.word(kOldpointerx); + context._cmp(context.di, context.data.word(kDelherex)); if (!context.flags.z()) goto difffound; - context._cmp(context.bx, context.data.word(224)); + context._cmp(context.bx, context.data.word(kDelherey)); if (context.flags.z()) goto notboth; difffound: - context.cl = context.data.byte(226); - context.ch = context.data.byte(227); + context.cl = context.data.byte(kPointerxs); + context.ch = context.data.byte(kPointerys); multidump(context); notboth: return; } void undertextline(Context & context) { - context.di = context.data.word(77); - context.bx = context.data.word(79); + context.di = context.data.word(kTextaddressx); + context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0; context.cl = 228; context.ch = 13; @@ -19896,10 +19896,10 @@ void undertextline(Context & context) { } void deltextline(Context & context) { - context.di = context.data.word(77); - context.bx = context.data.word(79); + context.di = context.data.word(kTextaddressx); + context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); - context.ds = context.data.word(410); + context.ds = context.data.word(kBuffers); context.si = 0; context.cl = 228; context.ch = 13; @@ -19908,11 +19908,11 @@ void deltextline(Context & context) { } void dumptextline(Context & context) { - context._cmp(context.data.byte(108), 1); + context._cmp(context.data.byte(kNewtextline), 1); if (!context.flags.z()) goto nodumptextline; - context.data.byte(108) = 0; - context.di = context.data.word(77); - context.bx = context.data.word(79); + context.data.byte(kNewtextline) = 0; + context.di = context.data.word(kTextaddressx); + context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); context.cl = 228; context.ch = 13; @@ -19922,19 +19922,19 @@ nodumptextline: } void animpointer(Context & context) { - context._cmp(context.data.byte(233), 2); + context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) goto combathand; - context._cmp(context.data.byte(233), 3); + context._cmp(context.data.byte(kPointermode), 3); if (context.flags.z()) goto mousehand; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchpoint; - context.data.byte(230) = 11; + context.data.byte(kPointerframe) = 11; return; notwatchpoint: - context.data.byte(230) = 0; - context._cmp(context.data.byte(236), 0); + context.data.byte(kPointerframe) = 0; + context._cmp(context.data.byte(kInmaparea), 0); if (context.flags.z()) goto gothand; - context._cmp(context.data.byte(475), 0); + context._cmp(context.data.byte(kPointerfirstpath), 0); if (context.flags.z()) goto gothand; arrow: getflagunderp(context); @@ -19942,133 +19942,133 @@ arrow: if (context.flags.c()) goto gothand; context._cmp(context.cl, 128); if (!context.flags.c()) goto gothand; - context.data.byte(230) = 3; + context.data.byte(kPointerframe) = 3; context._test(context.cl, 4); if (!context.flags.z()) goto gothand; - context.data.byte(230) = 4; + context.data.byte(kPointerframe) = 4; context._test(context.cl, 16); if (!context.flags.z()) goto gothand; - context.data.byte(230) = 5; + context.data.byte(kPointerframe) = 5; context._test(context.cl, 2); if (!context.flags.z()) goto gothand; - context.data.byte(230) = 6; + context.data.byte(kPointerframe) = 6; context._test(context.cl, 8); if (!context.flags.z()) goto gothand; - context.data.byte(230) = 8; + context.data.byte(kPointerframe) = 8; gothand: return; mousehand: - context._cmp(context.data.byte(234), 0); + context._cmp(context.data.byte(kPointerspeed), 0); if (context.flags.z()) goto rightspeed3; - context._sub(context.data.byte(234), 1); + context._sub(context.data.byte(kPointerspeed), 1); goto finflashmouse; rightspeed3: - context.data.byte(234) = 5; - context._add(context.data.byte(235), 1); - context._cmp(context.data.byte(235), 16); + context.data.byte(kPointerspeed) = 5; + context._add(context.data.byte(kPointercount), 1); + context._cmp(context.data.byte(kPointercount), 16); if (!context.flags.z()) goto finflashmouse; - context.data.byte(235) = 0; + context.data.byte(kPointercount) = 0; finflashmouse: - context.al = context.data.byte(235); + context.al = context.data.byte(kPointercount); context.ah = 0; context.bx = 5698; context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); - context.data.byte(230) = context.al; + context.data.byte(kPointerframe) = context.al; return; combathand: - context.data.byte(230) = 0; - context._cmp(context.data.byte(183), 14); + context.data.byte(kPointerframe) = 0; + context._cmp(context.data.byte(kReallocation), 14); if (!context.flags.z()) goto notarrow; - context._cmp(context.data.byte(99), 211); + context._cmp(context.data.byte(kCommandtype), 211); if (!context.flags.z()) goto notarrow; - context.data.byte(230) = 5; + context.data.byte(kPointerframe) = 5; notarrow: return; } void readmouse(Context & context) { - context.ax = context.data.word(200); - context.data.word(210) = context.ax; - context.ax = context.data.word(196); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; + context.ax = context.data.word(kMousebutton); + context.data.word(kOldbutton) = context.ax; + context.ax = context.data.word(kMousex); + context.data.word(kOldx) = context.ax; + context.ax = context.data.word(kMousey); + context.data.word(kOldy) = context.ax; mousecall(context); - context.data.word(196) = context.cx; - context.data.word(198) = context.dx; - context.data.word(200) = context.bx; + context.data.word(kMousex) = context.cx; + context.data.word(kMousey) = context.dx; + context.data.word(kMousebutton) = context.bx; return; } void readmouse1(Context & context) { - context.ax = context.data.word(196); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; + context.ax = context.data.word(kMousex); + context.data.word(kOldx) = context.ax; + context.ax = context.data.word(kMousey); + context.data.word(kOldy) = context.ax; mousecall(context); - context.data.word(196) = context.cx; - context.data.word(198) = context.dx; - context.data.word(202) = context.bx; + context.data.word(kMousex) = context.cx; + context.data.word(kMousey) = context.dx; + context.data.word(kMousebutton1) = context.bx; return; } void readmouse2(Context & context) { - context.ax = context.data.word(196); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; + context.ax = context.data.word(kMousex); + context.data.word(kOldx) = context.ax; + context.ax = context.data.word(kMousey); + context.data.word(kOldy) = context.ax; mousecall(context); - context.data.word(196) = context.cx; - context.data.word(198) = context.dx; - context.data.word(204) = context.bx; + context.data.word(kMousex) = context.cx; + context.data.word(kMousey) = context.dx; + context.data.word(kMousebutton2) = context.bx; return; } void readmouse3(Context & context) { - context.ax = context.data.word(196); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; + context.ax = context.data.word(kMousex); + context.data.word(kOldx) = context.ax; + context.ax = context.data.word(kMousey); + context.data.word(kOldy) = context.ax; mousecall(context); - context.data.word(196) = context.cx; - context.data.word(198) = context.dx; - context.data.word(206) = context.bx; + context.data.word(kMousex) = context.cx; + context.data.word(kMousey) = context.dx; + context.data.word(kMousebutton3) = context.bx; return; } void readmouse4(Context & context) { - context.ax = context.data.word(200); - context.data.word(210) = context.ax; - context.ax = context.data.word(196); - context.data.word(212) = context.ax; - context.ax = context.data.word(198); - context.data.word(214) = context.ax; + context.ax = context.data.word(kMousebutton); + context.data.word(kOldbutton) = context.ax; + context.ax = context.data.word(kMousex); + context.data.word(kOldx) = context.ax; + context.ax = context.data.word(kMousey); + context.data.word(kOldy) = context.ax; mousecall(context); - context.data.word(196) = context.cx; - context.data.word(198) = context.dx; - context.ax = context.data.word(202); - context._or(context.ax, context.data.word(204)); - context._or(context.ax, context.data.word(206)); + context.data.word(kMousex) = context.cx; + context.data.word(kMousey) = context.dx; + context.ax = context.data.word(kMousebutton1); + context._or(context.ax, context.data.word(kMousebutton2)); + context._or(context.ax, context.data.word(kMousebutton3)); context._or(context.bx, context.ax); - context.data.word(200) = context.bx; + context.data.word(kMousebutton) = context.bx; return; } void readkey(Context & context) { - context.bx = context.data.word(394); - context._cmp(context.bx, context.data.word(392)); + context.bx = context.data.word(kBufferout); + context._cmp(context.bx, context.data.word(kBufferin)); if (context.flags.z()) goto nokey; context._add(context.bx, 1); context._and(context.bx, 15); - context.data.word(394) = context.bx; + context.data.word(kBufferout) = context.bx; context.di = 5715; context._add(context.di, context.bx); context.al = context.cs.byte(context.di); - context.data.byte(141) = context.al; + context.data.byte(kCurrentkey) = context.al; return; nokey: - context.data.byte(141) = 0; + context.data.byte(kCurrentkey) = 0; return; } @@ -20124,34 +20124,34 @@ hangonloop: void loadtraveltext(Context & context) { context.dx = 2234; standardload(context); - context.data.word(454) = context.ax; + context.data.word(kTraveltext) = context.ax; return; } void loadintotemp(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(456) = context.ax; + context.data.word(kTempgraphics) = context.ax; return; } void loadintotemp2(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(458) = context.ax; + context.data.word(kTempgraphics2) = context.ax; return; } void loadintotemp3(Context & context) { context.ds = context.cs; standardload(context); - context.data.word(460) = context.ax; + context.data.word(kTempgraphics3) = context.ax; return; } void loadtempcharset(Context & context) { standardload(context); - context.data.word(404) = context.ax; + context.data.word(kTempcharset) = context.ax; return; } @@ -20175,21 +20175,21 @@ void standardload(Context & context) { void loadtemptext(Context & context) { standardload(context); - context.data.word(464) = context.ax; + context.data.word(kTextfile1) = context.ax; return; } void loadroom(Context & context) { - context.data.byte(73) = 1; - context.data.word(326) = 0; - context.data.word(136) = 0; - context.data.word(119) = 104; - context.data.word(121) = 38; - context.data.word(77) = 13; - context.data.word(79) = 182; - context.data.byte(81) = 240; - context.al = context.data.byte(187); - context.data.byte(8) = context.al; + context.data.byte(kRoomloaded) = 1; + context.data.word(kTimecount) = 0; + context.data.word(kMaintimer) = 0; + context.data.word(kMapoffsetx) = 104; + context.data.word(kMapoffsety) = 38; + context.data.word(kTextaddressx) = 13; + context.data.word(kTextaddressy) = 182; + context.data.byte(kTextlen) = 240; + context.al = context.data.byte(kNewlocation); + context.data.byte(kLocation) = context.al; getroomdata(context); startloading(context); loadroomssample(context); @@ -20200,13 +20200,13 @@ void loadroom(Context & context) { } void loadroomssample(Context & context) { - context.al = context.data.byte(530); + context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; - context._cmp(context.al, context.data.byte(529)); + context._cmp(context.al, context.data.byte(kCurrentsample)); if (context.flags.z()) goto loadedalready; - context.data.byte(529) = context.al; - context.al = context.data.byte(529); + context.data.byte(kCurrentsample) = context.al; + context.al = context.data.byte(kCurrentsample); context.cl = '0'; twodigitnum(context); context.di = 1896; @@ -20219,50 +20219,50 @@ loadedalready: } void getridofreels(Context & context) { - context._cmp(context.data.byte(73), 0); + context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontgetrid; - context.es = context.data.word(428); + context.es = context.data.word(kReel1); deallocatemem(context); - context.es = context.data.word(430); + context.es = context.data.word(kReel2); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.data.word(kReel3); deallocatemem(context); dontgetrid: return; } void getridofall(Context & context) { - context.es = context.data.word(414); + context.es = context.data.word(kBackdrop); deallocatemem(context); - context.es = context.data.word(442); + context.es = context.data.word(kSetframes); deallocatemem(context); - context.es = context.data.word(428); + context.es = context.data.word(kReel1); deallocatemem(context); - context.es = context.data.word(430); + context.es = context.data.word(kReel2); deallocatemem(context); - context.es = context.data.word(432); + context.es = context.data.word(kReel3); deallocatemem(context); - context.es = context.data.word(448); + context.es = context.data.word(kReels); deallocatemem(context); - context.es = context.data.word(446); + context.es = context.data.word(kPeople); deallocatemem(context); - context.es = context.data.word(438); + context.es = context.data.word(kSetdesc); deallocatemem(context); - context.es = context.data.word(440); + context.es = context.data.word(kBlockdesc); deallocatemem(context); - context.es = context.data.word(434); + context.es = context.data.word(kRoomdesc); deallocatemem(context); - context.es = context.data.word(444); + context.es = context.data.word(kFreeframes); deallocatemem(context); - context.es = context.data.word(436); + context.es = context.data.word(kFreedesc); deallocatemem(context); return; } void restorereels(Context & context) { - context._cmp(context.data.byte(73), 0); + context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontrestore; - context.al = context.data.byte(183); + context.al = context.data.byte(kReallocation); getroomdata(context); context.dx = context.bx; openfile(context); @@ -20272,17 +20272,17 @@ void restorereels(Context & context) { dontloadseg(context); dontloadseg(context); allocateload(context); - context.data.word(428) = context.ax; + context.data.word(kReel1) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(kReel2) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(kReel3) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20292,17 +20292,17 @@ dontrestore: } void restoreall(Context & context) { - context.al = context.data.byte(8); + context.al = context.data.byte(kLocation); getroomdata(context); context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(414) = context.ax; + context.data.word(kBackdrop) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(398); + context.ds = context.data.word(kWorkspace); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20310,59 +20310,59 @@ void restoreall(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(442) = context.ax; + context.data.word(kSetframes) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(428) = context.ax; + context.data.word(kReel1) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(kReel2) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(kReel3) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.data.word(kReels) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.data.word(kPeople) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.data.word(kSetdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.data.word(kBlockdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.data.word(kRoomdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(444) = context.ax; + context.data.word(kFreeframes) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); dontloadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.data.word(kFreedesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20374,9 +20374,9 @@ void restoreall(Context & context) { void sortoutmap(Context & context) { context.push(context.es); context.push(context.di); - context.ds = context.data.word(398); + context.ds = context.data.word(kWorkspace); context.si = 0; - context.es = context.data.word(416); + context.es = context.data.word(kMapdata); context.di = 0; context.cx = 60; blimey: @@ -20394,43 +20394,43 @@ blimey: } void startloading(Context & context) { - context.data.byte(63) = 0; + context.data.byte(kCombatcount) = 0; context.al = context.cs.byte(context.bx+13); - context.data.byte(530) = context.al; + context.data.byte(kRoomssample) = context.al; context.al = context.cs.byte(context.bx+15); - context.data.byte(147) = context.al; + context.data.byte(kMapx) = context.al; context.al = context.cs.byte(context.bx+16); - context.data.byte(148) = context.al; + context.data.byte(kMapy) = context.al; context.al = context.cs.byte(context.bx+20); - context.data.byte(34) = context.al; + context.data.byte(kLiftflag) = context.al; context.al = context.cs.byte(context.bx+21); - context.data.byte(474) = context.al; - context.data.byte(477) = context.al; - context.data.byte(476) = context.al; + context.data.byte(kManspath) = context.al; + context.data.byte(kDestination) = context.al; + context.data.byte(kFinaldest) = context.al; context.al = context.cs.byte(context.bx+22); - context.data.byte(132) = context.al; - context.data.byte(134) = context.al; + context.data.byte(kFacing) = context.al; + context.data.byte(kTurntoface) = context.al; context.al = context.cs.byte(context.bx+23); - context.data.byte(38) = context.al; + context.data.byte(kCounttoopen) = context.al; context.al = context.cs.byte(context.bx+24); - context.data.byte(35) = context.al; + context.data.byte(kLiftpath) = context.al; context.al = context.cs.byte(context.bx+25); - context.data.byte(37) = context.al; - context.data.byte(64) = -1; + context.data.byte(kDoorpath) = context.al; + context.data.byte(kLastweapon) = -1; context.al = context.cs.byte(context.bx+27); context.push(context.ax); context.al = context.cs.byte(context.bx+31); - context.ah = context.data.byte(183); - context.data.byte(183) = context.al; + context.ah = context.data.byte(kReallocation); + context.data.byte(kReallocation) = context.al; context.dx = context.bx; openfile(context); readheader(context); allocateload(context); context.ds = context.ax; - context.data.word(414) = context.ax; + context.data.word(kBackdrop) = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(398); + context.ds = context.data.word(kWorkspace); context.dx = 0; context.cx = 132*66; context.al = 0; @@ -20438,69 +20438,69 @@ void startloading(Context & context) { loadseg(context); sortoutmap(context); allocateload(context); - context.data.word(442) = context.ax; + context.data.word(kSetframes) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(426); + context.ds = context.data.word(kSetdat); context.dx = 0; context.cx = 64*128; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(428) = context.ax; + context.data.word(kReel1) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(430) = context.ax; + context.data.word(kReel2) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(432) = context.ax; + context.data.word(kReel3) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(448) = context.ax; + context.data.word(kReels) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(446) = context.ax; + context.data.word(kPeople) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(438) = context.ax; + context.data.word(kSetdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(440) = context.ax; + context.data.word(kBlockdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(434) = context.ax; + context.data.word(kRoomdesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); allocateload(context); - context.data.word(444) = context.ax; + context.data.word(kFreeframes) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); - context.ds = context.data.word(424); + context.ds = context.data.word(kFreedat); context.dx = 0; context.cx = 16*80; context.al = 255; fillspace(context); loadseg(context); allocateload(context); - context.data.word(436) = context.ax; + context.data.word(kFreedesc) = context.ax; context.ds = context.ax; context.dx = 0; loadseg(context); @@ -20509,17 +20509,17 @@ void startloading(Context & context) { deletetaken(context); setallchanges(context); autoappear(context); - context.al = context.data.byte(187); + context.al = context.data.byte(kNewlocation); getroomdata(context); - context.data.byte(64) = -1; - context.data.byte(55) = 0; - context.data.word(96) = 160; - context.data.byte(187) = 255; - context.data.byte(491) = 254; + context.data.byte(kLastweapon) = -1; + context.data.byte(kMandead) = 0; + context.data.word(kLookcounter) = 160; + context.data.byte(kNewlocation) = 255; + context.data.byte(kLinepointer) = 254; context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) goto dontwalkin; - context.data.byte(474) = context.al; + context.data.byte(kManspath) = context.al; context.push(context.bx); autosetwalk(context); context.bx = context.pop(); @@ -20546,7 +20546,7 @@ lookx2: context.ah = 0; context.cx = 144; context._mul(context.cx); - context.es = context.data.word(448); + context.es = context.data.word(kReels); context.bx = 0; context._add(context.bx, context.ax); context.ax = context.pop(); @@ -20562,7 +20562,7 @@ lookx2: void findxyfrompath(Context & context) { getroomspaths(context); - context.al = context.data.byte(474); + context.al = context.data.byte(kManspath); context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -20571,25 +20571,25 @@ void findxyfrompath(Context & context) { context.ax = context.es.word(context.bx); context._sub(context.al, 12); context._sub(context.ah, 12); - context.data.byte(150) = context.al; - context.data.byte(151) = context.ah; + context.data.byte(kRyanx) = context.al; + context.data.byte(kRyany) = context.ah; return; } void findroominloc(Context & context) { - context.al = context.data.byte(148); + context.al = context.data.byte(kMapy); context.cx = -6; looky: context._add(context.cx, 6); context._sub(context.al, 10); if (!context.flags.c()) goto looky; - context.al = context.data.byte(147); + context.al = context.data.byte(kMapx); context._sub(context.cx, 1); lookx: context._add(context.cx, 1); context._sub(context.al, 11); if (!context.flags.c()) goto lookx; - context.data.byte(184) = context.cl; + context.data.byte(kRoomnum) = context.cl; return; } @@ -20642,37 +20642,37 @@ void fillspace(Context & context) { } void getridoftemp(Context & context) { - context.es = context.data.word(456); + context.es = context.data.word(kTempgraphics); deallocatemem(context); return; } void getridoftemptext(Context & context) { - context.es = context.data.word(464); + context.es = context.data.word(kTextfile1); deallocatemem(context); return; } void getridoftemp2(Context & context) { - context.es = context.data.word(458); + context.es = context.data.word(kTempgraphics2); deallocatemem(context); return; } void getridoftemp3(Context & context) { - context.es = context.data.word(460); + context.es = context.data.word(kTempgraphics3); deallocatemem(context); return; } void getridoftempcharset(Context & context) { - context.es = context.data.word(404); + context.es = context.data.word(kTempcharset); deallocatemem(context); return; } void getridoftempsp(Context & context) { - context.es = context.data.word(462); + context.es = context.data.word(kTempsprites); deallocatemem(context); return; } @@ -20680,30 +20680,30 @@ void getridoftempsp(Context & context) { void readsetdata(Context & context) { context.dx = 1857; standardload(context); - context.data.word(402) = context.ax; + context.data.word(kCharset1) = context.ax; context.dx = 1922; standardload(context); - context.data.word(406) = context.ax; + context.data.word(kIcons1) = context.ax; context.dx = 1935; standardload(context); - context.data.word(408) = context.ax; + context.data.word(kIcons2) = context.ax; context.dx = 1819; standardload(context); - context.data.word(412) = context.ax; + context.data.word(kMainsprites) = context.ax; context.dx = 2221; standardload(context); - context.data.word(452) = context.ax; + context.data.word(kPuzzletext) = context.ax; context.dx = 2273; standardload(context); - context.data.word(450) = context.ax; - context.ax = context.data.word(402); - context.data.word(266) = context.ax; - context._cmp(context.data.byte(377), 255); + context.data.word(kCommandtext) = context.ax; + context.ax = context.data.word(kCharset1); + context.data.word(kCurrentset) = context.ax; + context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto novolumeload; context.dx = 2286; openfile(context); context.cx = 2048-256; - context.ds = context.data.word(351); + context.ds = context.data.word(kSoundbuffer); context.dx = 16384; readfromfile(context); closefile(context); @@ -20725,7 +20725,7 @@ void dreamweb(Context & context) { clearpalette(context); set16colpalette(context); readsetdata(context); - context.data.byte(390) = 0; + context.data.byte(kWongame) = 0; context.dx = 1909; loadsample(context); setsoundoff(context); @@ -20741,7 +20741,7 @@ dodecisions: cls(context); setmode(context); decide(context); - context._cmp(context.data.byte(102), 4); + context._cmp(context.data.byte(kGetback), 4); if (context.flags.z()) goto mainloop; titles(context); credits(context); @@ -20749,22 +20749,22 @@ playgame: clearchanges(context); setmode(context); loadpalfromiff(context); - context.data.byte(8) = 255; - context.data.byte(66) = 1; - context.data.byte(187) = 35; - context.data.byte(385) = 7; + context.data.byte(kLocation) = 255; + context.data.byte(kRoomafterdream) = 1; + context.data.byte(kNewlocation) = 35; + context.data.byte(kVolume) = 7; loadroom(context); clearsprites(context); initman(context); entrytexts(context); entryanims(context); - context.data.byte(182) = 3; + context.data.byte(kDestpos) = 3; initialinv(context); - context.data.byte(152) = 32; + context.data.byte(kLastflag) = 32; startup1(context); - context.data.byte(386) = 0; - context.data.byte(387) = -1; - context.data.byte(99) = 255; + context.data.byte(kVolumeto) = 0; + context.data.byte(kVolumedirection) = -1; + context.data.byte(kCommandtype) = 255; goto mainloop; loadnew: clearbeforeload(context); @@ -20773,36 +20773,36 @@ loadnew: initman(context); entrytexts(context); entryanims(context); - context.data.byte(187) = 255; + context.data.byte(kNewlocation) = 255; startup(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; worktoscreenm(context); goto mainloop; alreadyloaded: - context.data.byte(187) = 255; + context.data.byte(kNewlocation) = 255; clearsprites(context); initman(context); startup(context); - context.data.byte(99) = 255; + context.data.byte(kCommandtype) = 255; mainloop: screenupdate(context); - context._cmp(context.data.byte(390), 0); + context._cmp(context.data.byte(kWongame), 0); if (!context.flags.z()) goto endofgame; - context._cmp(context.data.byte(55), 1); + context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(55), 2); + context._cmp(context.data.byte(kMandead), 2); if (context.flags.z()) goto gameover; - context._cmp(context.data.word(19), 0); + context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatching; - context.al = context.data.byte(476); - context._cmp(context.al, context.data.byte(474)); + context.al = context.data.byte(kFinaldest); + context._cmp(context.al, context.data.byte(kManspath)); if (!context.flags.z()) goto mainloop; - context._sub(context.data.word(19), 1); + context._sub(context.data.word(kWatchingtime), 1); if (!context.flags.z()) goto mainloop; notwatching: - context._cmp(context.data.byte(55), 4); + context._cmp(context.data.byte(kMandead), 4); if (context.flags.z()) goto gameover; - context._cmp(context.data.byte(187), 255); + context._cmp(context.data.byte(kNewlocation), 255); if (!context.flags.z()) goto loadnew; goto mainloop; gameover: -- cgit v1.2.3 From 07ad2efd80075c50be51d9120a5a93f6cf69cef7 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 01:30:07 +0400 Subject: DREAMWEB: fixed invalid register parts update --- engines/dreamweb/runtime.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 1def57a50d..45882a266d 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -13,7 +13,10 @@ namespace dreamgen { #undef random struct Register { - uint16 _value; + union { + uint16 _value; + uint8 _part[2]; + }; inline Register(): _value() {} inline Register& operator=(uint16 v) { _value = v; return *this; } inline operator uint16&() { return _value; } @@ -21,35 +24,38 @@ struct Register { if (_value & 0x80) _value |= 0xff00; else - _value &= 0xff; + _value &= 0x7f; } }; -template +template //from low to high struct RegisterPart { - Register &_reg; - uint8 _value; + uint8 &_value; - explicit inline RegisterPart(Register ®) : _reg(reg), _value(reg._value >> Shift) {} + explicit inline RegisterPart(Register ®) : _value(reg._part[kIndex]) {} inline operator uint8&() { return _value; } + inline RegisterPart& operator=(const RegisterPart& o) { _value = o._value; return *this; } + inline RegisterPart& operator=(uint8 v) { _value = v; return *this; } - inline ~RegisterPart() { - _reg._value = (_reg._value & ~Mask) | (_value << Shift); - } }; -typedef RegisterPart<0xff, 0> LowPartOfRegister; -typedef RegisterPart<0xff00, 8> HighPartOfRegister; +#ifdef SCUMM_LITTLE_ENDIAN + typedef RegisterPart<0> LowPartOfRegister; + typedef RegisterPart<1> HighPartOfRegister; +#else + typedef RegisterPart<1> LowPartOfRegister; + typedef RegisterPart<0> HighPartOfRegister; +#endif class WordRef { uint8 *_data; -- cgit v1.2.3 From 33bb7c3f72dcc6d3d6c1f23799976181ac1969da Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 01:48:46 +0400 Subject: DREAMWEB: fixed memory deallocation --- engines/dreamweb/dreamweb.cpp | 15 ++++++++------ engines/dreamweb/runtime.h | 46 ++++++++++++++++++++++++++++++++----------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 3493e5d1e0..65cd2a0c43 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -318,7 +318,8 @@ void allocatemem(Context &context) { } void deallocatemem(Context &context) { - ::error("deallocatemem"); + debug(1, "deallocating segment %04x", (uint16)context.es); + context.deallocateSegment(context.es); } void removeemm(Context &context) { @@ -400,16 +401,18 @@ void setsoundoff(Context &context) { warning("setsoundoff: STUB"); } - -void loadsecondsample(Context &context) { - ::error("loadsecondsample"); -} +void readheader(Context &context); void loadsample(Context &context) { warning("loadsample: STUB"); openfile(context); closefile(context); - //readheader(context); //add exports to tasm recompiler +} + +void loadsecondsample(Context &context) { + warning("loadsecondsample: STUB"); + openfile(context); + closefile(context); } void loadspeech(Context &context) { diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 45882a266d..0e106b9916 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -6,6 +6,8 @@ #include "common/array.h" #include "common/debug.h" #include "common/hashmap.h" +#include "common/list.h" +#include "common/ptr.h" namespace dreamgen { @@ -111,15 +113,17 @@ struct Segment { } }; +typedef Common::SharedPtr SegmentPtr; + class Context; class SegmentRef { - Context *_context; - uint16 _value; - Segment *_segment; + Context *_context; + uint16 _value; + SegmentPtr _segment; public: - SegmentRef(Context *ctx, uint16 value = 0, Segment *segment = 0): _context(ctx), _value(value), _segment(segment) { + SegmentRef(Context *ctx, uint16 value = 0, SegmentPtr segment = SegmentPtr()): _context(ctx), _value(value), _segment(segment) { } inline void reset(uint16 value); @@ -188,8 +192,11 @@ struct Flags { }; class Context { - typedef Common::HashMap SegmentMap; + typedef Common::HashMap SegmentMap; SegmentMap _segments; + + typedef Common::List FreeSegmentList; + FreeSegmentList _freeSegments; public: enum { kDefaultDataSegment = 0x1000, kVideoSegment = 0xa000 }; @@ -210,8 +217,9 @@ public: inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), cs(this), ds(this), es(this), data(this), video(this) { - _segments[kDefaultDataSegment] = Segment(); - _segments[kVideoSegment].data.resize(0x10000); + _segments[kDefaultDataSegment] = SegmentPtr(new Segment()); + _segments[kVideoSegment] = SegmentPtr(new Segment()); + _segments[kVideoSegment]->data.resize(0x10000); cs.reset(kDefaultDataSegment); ds.reset(kDefaultDataSegment); @@ -223,15 +231,29 @@ public: SegmentRef getSegment(uint16 value) { SegmentMap::iterator i = _segments.find(value); assert(i != _segments.end()); - return SegmentRef(this, value, &i->_value); + return SegmentRef(this, value, i->_value); } SegmentRef allocateSegment(uint size) { - unsigned id = kDefaultDataSegment + _segments.size(); + unsigned id; + if (_freeSegments.empty()) + id = kDefaultDataSegment + _segments.size(); + else { + id = _freeSegments.front(); + _freeSegments.pop_front(); + } assert(!_segments.contains(id)); - Segment &seg = _segments[id]; - seg.data.resize(size); - return SegmentRef(this, id, &seg); + 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); } inline void _cmp(uint8 a, uint8 b) { -- cgit v1.2.3 From 23736a02400c0649e50c07af87712d413cef6b83 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:18:21 +0400 Subject: DREAMWEB: output equ values in log --- devtools/tasmrecover/tasm/cpp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 0c1a4b4cec..53b847a23a 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -53,6 +53,7 @@ namespace %s { g = self.context.get_global(name) if isinstance(g, op.const): value = self.expand_equ(g.value) + print "equ: %s -> %s" %(name, value) elif isinstance(g, proc.proc): if self.indirection != -1: raise Exception("invalid proc label usage") -- cgit v1.2.3 From 25a937e1566974a0c920be8ab411c488201b8e53 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:18:57 +0400 Subject: DREAMWEB: added fadedos --- engines/dreamweb/dreamweb.cpp | 20 +++++++++++++++++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 65cd2a0c43..fe27f4f97c 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -202,6 +202,23 @@ void DreamWebEngine::setGraphicsMode() { initGraphics(320, 200, false); } +void DreamWebEngine::fadeDos() { + static const int startpal = 0+(228*13)+32+60+(32*32)+(11*10*3); //fixme: add equ to enum too + + PaletteManager *palette = _system->getPaletteManager(); + _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); + uint8 *dst = _context.es.ptr(startpal, 768); + palette->grabPalette(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]; + } + } + palette->setPalette(dst, 0, 64); + waitForVSync(); + } +} } // End of namespace DreamWeb @@ -485,7 +502,8 @@ void showgroup(Context &context) { } void fadedos(Context &context) { - warning("fadedos: STUB"); + vsync(context); + engine()->fadeDos(); } void doshake(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index d2fc447fee..ed4359f645 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -85,6 +85,7 @@ public: void mouseCall(); //fill mouse pos and button state void processEvents(); void setGraphicsMode(); + void fadeDos(); private: const DreamWebGameDescription *_gameDescription; -- cgit v1.2.3 From 9193f33aadae381cbb309272062cacebc50c24a7 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:29:05 +0400 Subject: DREAMWEB: replaced movsw with 2*movsb --- engines/dreamweb/runtime.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 0e106b9916..475647b69a 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -421,9 +421,8 @@ public: } inline void _movsw() { - es.word(di) = ds.word(si); - di += 2; - si += 2; + _movsb(); + _movsb(); } inline void _lodsb() { -- cgit v1.2.3 From f7a3a552f33d3f8c952e70d9d4c01ec420d220e5 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:31:18 +0400 Subject: DREAMWEB: fixed CF for neg instruction --- engines/dreamweb/runtime.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 475647b69a..525a4df5b9 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -405,15 +405,17 @@ public: } inline void _neg(uint8 &src) { + flags._c = src != 0; src = ~src; flags.update(src); - flags._c = flags._o = false; + flags._o = false; } inline void _neg(uint16 &src) { + flags._c = src != 0; src = ~src; flags.update(src); - flags._c = flags._o = false; + flags._o = false; } inline void _movsb() { -- cgit v1.2.3 From 451871934571552417a6d646011c522b52c59b11 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:47:27 +0400 Subject: DREAMWEB: added 'equ' const to public header --- devtools/tasmrecover/tasm/cpp.py | 7 +- engines/dreamweb/dreamgen.cpp | 930 +++++++++++++++++++-------------------- engines/dreamweb/dreamgen.h | 92 ++++ 3 files changed, 562 insertions(+), 467 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 53b847a23a..e94231f043 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -113,7 +113,8 @@ namespace %s { n = 1 while n > 0: expr, n = re.subn(r'\b[a-zA-Z_][a-zA-Z0-9_]+\b', self.expand_equ_cb, expr) - return expr + expr = re.sub(r'\b([0-9][a-fA-F0-9]*)h', '0x\\1', expr) + return "(%s)" %expr def expand(self, expr, def_size = 0): #print "EXPAND \"%s\"" %expr @@ -545,10 +546,12 @@ namespace %s { for k, v in self.context.get_globals().items(): if isinstance(v, op.var): offsets.append((k.capitalize(), v.offset)) + elif isinstance(v, op.const): + offsets.append((k.capitalize(), self.expand_equ(v.value))) #fixme: try to save all constants here offsets = sorted(offsets, key=lambda t: t[1]) for o in offsets: - offsets_decl += "\tconst static uint16 k%s = %d;\n" %o + offsets_decl += "\tconst static uint16 k%s = %s;\n" %o offsets_decl += "\n" self.hd.write(offsets_decl); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index f270ea6bf4..a4a35eb0e7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -1876,7 +1876,7 @@ void rollendcredits(Context & context) { context.si = 3*2; context.ax = context.es.word(context.si); context.si = context.ax; - context._add(context.si, 66*2); + context._add(context.si, (66*2)); context.cx = 254; endcredits1: context.push(context.cx); @@ -2429,20 +2429,20 @@ forcenext: void clearsprites(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; - context.cx = 32*16; + context.cx = (32)*16; while(--context.cx) context._stosb(); return; } void makesprite(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: context._cmp(context.es.byte(context.bx+15), 255); if (context.flags.z()) goto _tmp17a; - context._add(context.bx, 32); + context._add(context.bx, (32)); goto _tmp17; _tmp17a: context.es.word(context.bx) = context.cx; @@ -2457,7 +2457,7 @@ _tmp17a: void delsprite(Context & context) { context.di = context.bx; - context.cx = 32; + context.cx = (32); context.al = 255; while(--context.cx) context._stosb(); return; @@ -2465,11 +2465,11 @@ void delsprite(Context & context) { void spriteupdate(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = context.data.byte(kRyanon); context.es.byte(context.bx+31) = context.al; context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; _tmp18: context.push(context.cx); @@ -2489,7 +2489,7 @@ _tmp18a: context.cx = context.pop(); context._cmp(context.data.byte(kNowinnewroom), 1); if (context.flags.z()) goto _tmp18b; - context._add(context.bx, 32); + context._add(context.bx, (32)); if (--context.cx) goto _tmp18; _tmp18b: return; @@ -2501,7 +2501,7 @@ void printsprites(Context & context) { priorityloop: context.push(context.cx); context.data.byte(kPriority) = context.cl; - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; prtspriteloop: context.push(context.cx); @@ -2518,7 +2518,7 @@ prtspriteloop: skipsprite: context.bx = context.pop(); context.cx = context.pop(); - context._add(context.bx, 32); + context._add(context.bx, (32)); if (--context.cx) goto prtspriteloop; context.cx = context.pop(); context._add(context.cx, 1); @@ -2590,7 +2590,7 @@ void checkone(Context & context) { context._mul(context.cx); context.si = context.ax; context.ds = context.data.word(kBuffers); - context._add(context.si, 0+(228*13)+32+60+(32*32)); + context._add(context.si, (0+(228*13)+32+60+(32*32))); context._lodsw(); context.cx = context.ax; context._lodsb(); @@ -2983,7 +2983,7 @@ void reminders(Context & context) { context.cl = 'H'; context.ch = 'R'; findexobject(context); - context._cmp(context.al, 114); + context._cmp(context.al, (114)); if (context.flags.z()) goto forgotone; context.ax = context.es.word(context.bx+2); context._cmp(context.al, 4); @@ -3015,7 +3015,7 @@ notinedenslift: void initrain(Context & context) { context.es = context.data.word(kBuffers); - context.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); + context.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)); context.bx = 1113; checkmorerain: context.al = context.cs.byte(context.bx); @@ -3150,7 +3150,7 @@ void showrain(Context & context) { context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); - context.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); + context.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)); context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto nothunder; @@ -3646,7 +3646,7 @@ notnearly: void updatepeople(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; @@ -3884,7 +3884,7 @@ void getreelstart(Context & context) { context._mul(context.cx); context.es = context.data.word(kReels); context.si = context.ax; - context._add(context.si, 0+(36*144)); + context._add(context.si, (0+(36*144))); return; } @@ -3923,7 +3923,7 @@ bigroom: void dumpeverything(Context & context) { context.es = context.data.word(kBuffers); - context.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); + context.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)); dumpevery1: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); @@ -3951,7 +3951,7 @@ skip1: context._add(context.bx, 5); goto dumpevery1; finishevery1: - context.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)+(40*5); + context.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))+(40*5); dumpevery2: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); @@ -4012,7 +4012,7 @@ void loadpalfromiff(Context & context) { readfromfile(context); closefile(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.ds = context.data.word(kMapstore); context.si = 0x30; context.cx = 768; @@ -4049,10 +4049,10 @@ void cls(Context & context) { } void printundermon(Context & context) { - context.si = (320*43)+76; + context.si = ((320)*43)+76; context.di = context.si; context.es = context.data.word(kWorkspace); - context._add(context.si, 8*320); + context._add(context.si, 8*(320)); context.dx = 0x0a000; context.ds = context.dx; context.cx = 104; @@ -4076,8 +4076,8 @@ finmonscroll: context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); - context._add(context.si, 320); - context._add(context.di, 320); + context._add(context.si, (320)); + context._add(context.di, (320)); if (--context.cx) goto scrollmonloop1; return; } @@ -4152,7 +4152,7 @@ void pixelcheckset(Context & context) { getsetad(context); context.al = context.es.byte(context.bx+17); context.es = context.data.word(kSetframes); - context.bx = 0; + context.bx = (0); context.ah = 0; context.cx = 6; context._mul(context.cx); @@ -4169,7 +4169,7 @@ void pixelcheckset(Context & context) { context._add(context.ax, context.cx); context._add(context.ax, context.es.word(context.bx+2)); context.bx = context.ax; - context._add(context.bx, 0+2080); + context._add(context.bx, (0+2080)); context.al = context.es.byte(context.bx); context.dl = context.al; context.cx = context.pop(); @@ -4283,15 +4283,15 @@ cantzoom: zoomit: context.ax = context.data.word(kOldpointery); context._sub(context.ax, 9); - context.cx = 320; + context.cx = (320); context._mul(context.cx); context._add(context.ax, context.data.word(kOldpointerx)); context._sub(context.ax, 11); context.si = context.ax; - context.ax = 132+4; - context.cx = 320; + context.ax = (132)+4; + context.cx = (320); context._mul(context.cx); - context._add(context.ax, 8+5); + context._add(context.ax, (8)+5); context.di = context.ax; context.es = context.data.word(kWorkspace); context.ds = context.data.word(kWorkspace); @@ -4303,10 +4303,10 @@ zoomloop2: context._lodsb(); context.ah = context.al; context._stosw(); - context.es.word(context.di+320-2) = context.ax; + context.es.word(context.di+(320)-2) = context.ax; if (--context.cx) goto zoomloop2; - context._add(context.si, 320-23); - context._add(context.di, 320-46+320); + context._add(context.si, (320)-23); + context._add(context.di, (320)-46+(320)); context.cx = context.pop(); if (--context.cx) goto zoomloop; crosshair(context); @@ -4320,7 +4320,7 @@ void delthisone(Context & context) { context.al = context.ah; context.ah = 0; context._add(context.ax, context.data.word(kMapady)); - context.bx = 320; + context.bx = (320); context._mul(context.bx); context.bx = context.pop(); context.bh = 0; @@ -4341,7 +4341,7 @@ void delthisone(Context & context) { context.ds = context.data.word(kMapstore); context.dl = context.cl; context.dh = 0; - context.ax = 320; + context.ax = (320); context._sub(context.ax, context.dx); context._neg(context.dx); context._add(context.dx, 22*8); @@ -4359,7 +4359,7 @@ deloneloop: void multiget(Context & context) { context.ax = context.bx; - context.bx = 320; + context.bx = (320); context._mul(context.bx); context._add(context.di, context.ax); context.es = context.data.word(kWorkspace); @@ -4368,7 +4368,7 @@ void multiget(Context & context) { context._xchg(context.di, context.si); context.al = context.cl; context.ah = 0; - context.dx = 320; + context.dx = (320); context._sub(context.dx, context.ax); context.al = context.cl; context._and(context.al, 1); @@ -4403,13 +4403,13 @@ multiloop4: void multiput(Context & context) { context.ax = context.bx; - context.bx = 320; + context.bx = (320); context._mul(context.bx); context._add(context.di, context.ax); context.es = context.data.word(kWorkspace); context.al = context.cl; context.ah = 0; - context.dx = 320; + context.dx = (320); context._sub(context.dx, context.ax); context.al = context.cl; context._and(context.al, 1); @@ -4447,10 +4447,10 @@ void multidump(Context & context) { context.es = context.dx; context.ds = context.data.word(kWorkspace); context.ax = context.bx; - context.bx = 320; + context.bx = (320); context._mul(context.bx); context._add(context.di, context.ax); - context.dx = 320; + context.dx = (320); context.si = context.di; context.al = context.cl; context._and(context.al, 1); @@ -4481,7 +4481,7 @@ oddwidth: context.bl = context.cl; context.bh = 0; context._neg(context.bx); - context._add(context.bx, 320); + context._add(context.bx, (320)); context.cl = context.ch; context.ch = 0; multiloop2: @@ -4729,18 +4729,18 @@ void width160(Context & context) { void doblocks(Context & context) { context.es = context.data.word(kWorkspace); context.ax = context.data.word(kMapady); - context.cx = 320; + context.cx = (320); context._mul(context.cx); context.di = context.data.word(kMapadx); context._add(context.di, context.ax); context.al = context.data.byte(kMapy); context.ah = 0; - context.bx = 66; + context.bx = (66); context._mul(context.bx); context.bl = context.data.byte(kMapx); context.bh = 0; context._add(context.ax, context.bx); - context.si = 0; + context.si = (0); context._add(context.si, context.ax); context.cx = 10; loop120: @@ -4758,7 +4758,7 @@ loop124: if (context.flags.z()) goto zeroblock; context.ah = context.al; context.al = 0; - context.si = 0+192; + context.si = (0+192); context._add(context.si, context.ax); context.bh = 14; context.bh = 4; @@ -4771,7 +4771,7 @@ firstbitofblock: context._movsw(); context._movsw(); context._movsw(); - context._add(context.di, 320-16); + context._add(context.di, (320)-16); context._sub(context.bh, 1); if (!context.flags.z()) goto firstbitofblock; context.bh = 12; @@ -4787,7 +4787,7 @@ loop125: context.ax = 0x0dfdf; context._stosw(); context._stosw(); - context._add(context.di, 320-20); + context._add(context.di, (320)-20); context._sub(context.bh, 1); if (!context.flags.z()) goto loop125; context._add(context.di, 4); @@ -4800,7 +4800,7 @@ loop125: context._stosw(); context._stosw(); context._stosw(); - context._add(context.di, 320-16); + context._add(context.di, (320)-16); context._stosw(); context._stosw(); context._stosw(); @@ -4809,7 +4809,7 @@ loop125: context._stosw(); context._stosw(); context._stosw(); - context._add(context.di, 320-16); + context._add(context.di, (320)-16); context._stosw(); context._stosw(); context._stosw(); @@ -4818,7 +4818,7 @@ loop125: context._stosw(); context._stosw(); context._stosw(); - context._add(context.di, 320-16); + context._add(context.di, (320)-16); context._stosw(); context._stosw(); context._stosw(); @@ -4833,10 +4833,10 @@ zeroblock: context.cx = context.pop(); context._add(context.di, 16); if (--context.cx) goto loop124; - context._add(context.si, 66-11); + context._add(context.si, (66)-11); context.cx = context.pop(); context.di = context.pop(); - context._add(context.di, 320*16); + context._add(context.di, (320)*16); if (--context.cx) goto loop120; return; } @@ -4905,7 +4905,7 @@ notdiffdest: notprintlist: context._test(context.ah, 4); if (context.flags.z()) goto notflippedx; - context.dx = 320; + context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutfx(context); @@ -4914,7 +4914,7 @@ notprintlist: notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; - context.dx = 320; + context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutnm(context); @@ -4923,14 +4923,14 @@ notflippedx: notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; - context.dx = 320; + context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutbh(context); context.cx = context.pop(); return; noeffects: - context.dx = 320; + context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutv(context); @@ -5106,9 +5106,9 @@ void transferinv(Context & context) { context.cx = 6; context._mul(context.cx); context.es = context.data.word(kExtras); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); - context._add(context.di, 0+2080); + context._add(context.di, (0+2080)); context.push(context.bx); context.al = context.data.byte(kItemtotran); context.ah = 0; @@ -5119,9 +5119,9 @@ void transferinv(Context & context) { context.cx = 6; context._mul(context.cx); context.ds = context.data.word(kFreeframes); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); - context.si = 0+2080; + context.si = (0+2080); context.al = context.ds.byte(context.bx); context.ah = 0; context.cl = context.ds.byte(context.bx+1); @@ -5154,9 +5154,9 @@ void transfermap(Context & context) { context.cx = 6; context._mul(context.cx); context.es = context.data.word(kExtras); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); - context._add(context.di, 0+2080); + context._add(context.di, (0+2080)); context.push(context.bx); context.al = context.data.byte(kItemtotran); context.ah = 0; @@ -5166,9 +5166,9 @@ void transfermap(Context & context) { context.cx = 6; context._mul(context.cx); context.ds = context.data.word(kFreeframes); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); - context.si = 0+2080; + context.si = (0+2080); context.al = context.ds.byte(context.bx); context.ah = 0; context.cl = context.ds.byte(context.bx+1); @@ -5198,7 +5198,7 @@ void dofade(Context & context) { context.al = context.data.byte(kColourpos); context.ah = 0; context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); @@ -5215,7 +5215,7 @@ finishfade: void clearendpal(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; while(--context.cx) context._stosb(); @@ -5241,11 +5241,11 @@ void fadescreenup(Context & context) { void fadetowhite(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 63; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.al = 0; context._stosb(); context._stosb(); @@ -5260,11 +5260,11 @@ void fadetowhite(Context & context) { void fadefromwhite(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768; context.al = 63; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.al = 0; context._stosb(); context._stosb(); @@ -5292,7 +5292,7 @@ void fadescreendownhalf(Context & context) { paltoendpal(context); context.cx = 768; context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); halfend: context.al = context.es.byte(context.bx); context._shr(context.al, 1); @@ -5301,12 +5301,12 @@ halfend: if (--context.cx) goto halfend; context.ds = context.data.word(kBuffers); context.es = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(56*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(56*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3); context.cx = 3*5; while(--context.cx) context._movsb(); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(77*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(77*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3); context.cx = 3*2; while(--context.cx) context._movsb(); context.data.byte(kFadedirection) = 1; @@ -5348,7 +5348,7 @@ void fadescreendowns(Context & context) { void clearstartpal(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 256; wholeloop1: context.ax = 0; @@ -5430,7 +5430,7 @@ void rollem(Context & context) { context.si = 49*2; context.ax = context.es.word(context.si); context.si = context.ax; - context._add(context.si, 66*2); + context._add(context.si, (66*2)); context.cx = 80; endcredits21: context.push(context.cx); @@ -5511,8 +5511,8 @@ void fadecalculation(Context & context) { if (context.flags.z()) goto nomorefading; context.bl = context.data.byte(kFadecount); context.es = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; fadecolloop: context.al = context.es.byte(context.si); @@ -5541,8 +5541,8 @@ nomorefading: void greyscalesum(Context & context) { context.es = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 256; greysumloop1: context.push(context.cx); @@ -5597,8 +5597,8 @@ noaddb: void paltostartpal(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(--context.cx) context._movsw(); return; @@ -5607,8 +5607,8 @@ void paltostartpal(Context & context) { void endpaltostart(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(--context.cx) context._movsw(); return; @@ -5617,8 +5617,8 @@ void endpaltostart(Context & context) { void startpaltoend(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(--context.cx) context._movsw(); return; @@ -5627,8 +5627,8 @@ void startpaltoend(Context & context) { void paltoendpal(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(--context.cx) context._movsw(); return; @@ -5637,8 +5637,8 @@ void paltoendpal(Context & context) { void allpalette(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(--context.cx) context._movsw(); dumpcurrent(context); @@ -5646,7 +5646,7 @@ void allpalette(Context & context) { } void dumpcurrent(Context & context) { - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.ds = context.data.word(kBuffers); vsync(context); context.al = 0; @@ -5663,11 +5663,11 @@ void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5683,11 +5683,11 @@ void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5703,11 +5703,11 @@ void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(231*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5726,11 +5726,11 @@ void fadeupmonfirst(Context & context) { void fadeupyellows(Context & context) { paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(246*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5745,15 +5745,15 @@ void fadeupyellows(Context & context) { void initialmoncols(Context & context) { paltostartpal(context); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); context.cx = 3*9; context.ax = 0; while(--context.cx) context._stosb(); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(246*3); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); context.al = 230; context.cx = 18; showgroup(context); @@ -5805,7 +5805,7 @@ nextmonkspeak: context._add(context.si, context.si); context.es = context.data.word(kTextfile1); context.ax = context.es.word(context.si); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; nextbit: context.di = 36; @@ -6591,16 +6591,16 @@ nomod: void fillryan(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32; + context.di = (0+(228*13)+32); findallryan(context); - context.si = 0+(228*13)+32; + context.si = (0+(228*13)+32); context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 20; context._mul(context.cx); context._add(context.si, context.ax); - context.di = 80; - context.bx = 58; + context.di = (80); + context.bx = (58); context.cx = 2; ryanloop2: context.push(context.cx); @@ -6621,12 +6621,12 @@ ryanloop1: context.bx = context.pop(); context.di = context.pop(); context.cx = context.pop(); - context._add(context.di, 44); + context._add(context.di, (44)); if (--context.cx) goto ryanloop1; context.bx = context.pop(); context.di = context.pop(); context.cx = context.pop(); - context._add(context.bx, 44); + context._add(context.bx, (44)); if (--context.cx) goto ryanloop2; showryanpage(context); return; @@ -6642,11 +6642,11 @@ lessthanapage: context.al = 1; context.push(context.ax); context.es = context.data.word(kBuffers); - context.di = 0+(228*13); + context.di = (0+(228*13)); findallopen(context); - context.si = 0+(228*13); - context.di = 80; - context.bx = 58+96; + context.si = (0+(228*13)); + context.di = (80); + context.bx = (58)+96; context.cx = context.pop(); openloop1: context.push(context.cx); @@ -6665,7 +6665,7 @@ nextopenslot: context.bx = context.pop(); context.di = context.pop(); context.cx = context.pop(); - context._add(context.di, 44); + context._add(context.di, (44)); context._add(context.cl, 1); context._cmp(context.cl, 5); if (!context.flags.z()) goto openloop1; @@ -6681,7 +6681,7 @@ void findallryan(Context & context) { context.di = context.pop(); context.cl = 4; context.ds = context.data.word(kExtras); - context.bx = 0+2080+30000; + context.bx = (0+2080+30000); context.ch = 0; findryanloop: context._cmp(context.ds.byte(context.bx+2), context.cl); @@ -6700,7 +6700,7 @@ findryanloop: notinryaninv: context._add(context.bx, 16); context._add(context.ch, 1); - context._cmp(context.ch, 114); + context._cmp(context.ch, (114)); if (!context.flags.z()) goto findryanloop; return; } @@ -6714,7 +6714,7 @@ void findallopen(Context & context) { context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); context.ds = context.data.word(kExtras); - context.bx = 0+2080+30000; + context.bx = (0+2080+30000); context.ch = 0; findopen1: context._cmp(context.ds.byte(context.bx+3), context.cl); @@ -6739,7 +6739,7 @@ noloccheck: findopen2: context._add(context.bx, 16); context._add(context.ch, 1); - context._cmp(context.ch, 114); + context._cmp(context.ch, (114)); if (!context.flags.z()) goto findopen1; context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); @@ -6952,7 +6952,7 @@ noincryan: return; doincryan: context.ax = context.data.word(kMousex); - context._sub(context.ax, 80+167); + context._sub(context.ax, (80)+167); context.data.byte(kRyanpage) = -1; findnewpage: context._add(context.data.byte(kRyanpage), 1); @@ -6970,8 +6970,8 @@ findnewpage: void openinv(Context & context) { context.data.byte(kInvopen) = 1; context.al = 61; - context.di = 80; - context.bx = 58-10; + context.di = (80); + context.bx = (58)-10; context.dl = 240; printmessage(context); fillryan(context); @@ -6981,8 +6981,8 @@ void openinv(Context & context) { void showryanpage(Context & context) { context.ds = context.data.word(kIcons1); - context.di = 80+167; - context.bx = 58-12; + context.di = (80)+167; + context.bx = (58)-12; context.al = 12; context.ah = 0; showframe(context); @@ -6994,9 +6994,9 @@ void showryanpage(Context & context) { context.cx = 18; context._mul(context.cx); context.ds = context.data.word(kIcons1); - context.di = 80+167; + context.di = (80)+167; context._add(context.di, context.ax); - context.bx = 58-12; + context.bx = (58)-12; context.ax = context.pop(); context.ah = 0; showframe(context); @@ -7008,14 +7008,14 @@ void openob(Context & context) { context.ah = context.data.byte(kOpenedtype); context.di = 5674; copyname(context); - context.di = 80; - context.bx = 58+86; + context.di = (80); + context.bx = (58)+86; context.al = 62; context.dl = 240; printmessage(context); context.di = context.data.word(kLastxpos); context._add(context.di, 5); - context.bx = 58+86; + context.bx = (58)+86; context.es = context.cs; context.si = 5674; context.dl = 220; @@ -7026,9 +7026,9 @@ void openob(Context & context) { getopenedsize(context); context.al = context.ah; context.ah = 0; - context.cx = 44; + context.cx = (44); context._mul(context.cx); - context._add(context.ax, 80); + context._add(context.ax, (80)); context.bx = 2588; context.cs.word(context.bx) = context.ax; return; @@ -7191,18 +7191,18 @@ notlouiscard: void getobtextstart(Context & context) { context.es = context.data.word(kFreedesc); - context.si = 0; - context.cx = 0+(82*2); + context.si = (0); + context.cx = (0+(82*2)); context._cmp(context.data.byte(kObjecttype), 2); if (context.flags.z()) goto describe; context.es = context.data.word(kSetdesc); - context.si = 0; - context.cx = 0+(130*2); + context.si = (0); + context.cx = (0+(130*2)); context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto describe; context.es = context.data.word(kExtras); - context.si = 0+2080+30000+(16*114); - context.cx = 0+2080+30000+(16*114)+((114+2)*2); + context.si = (0+2080+30000+(16*114)); + context.cx = (0+2080+30000+(16*114)+((114+2)*2)); describe: context.al = context.data.byte(kCommand); context.ah = 0; @@ -7702,8 +7702,8 @@ void deletetaken(Context & context) { context.es = context.data.word(kFreedat); context.ah = context.data.byte(kReallocation); context.ds = context.data.word(kExtras); - context.si = 0+2080+30000; - context.cx = 114; + context.si = (0+2080+30000); + context.cx = (114); takenloop: context.al = context.ds.byte(context.si+11); context._cmp(context.al, context.ah); @@ -7787,7 +7787,7 @@ void getexad(Context & context) { context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kExtras); - context._add(context.bx, 0+2080+30000); + context._add(context.bx, (0+2080+30000)); return; } @@ -7871,18 +7871,18 @@ void getsetad(Context & context) { void findinvpos(Context & context) { context.cx = context.data.word(kMousex); - context._sub(context.cx, 80); + context._sub(context.cx, (80)); context.bx = -1; findinv1: context._add(context.bx, 1); - context._sub(context.cx, 44); + context._sub(context.cx, (44)); if (!context.flags.c()) goto findinv1; context.cx = context.data.word(kMousey); - context._sub(context.cx, 58); + context._sub(context.cx, (58)); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); - context._sub(context.cx, 44); + context._sub(context.cx, (44)); if (!context.flags.c()) goto findinv2; context.al = context.data.byte(kRyanpage); context.ah = 0; @@ -7893,23 +7893,23 @@ findinv2: context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); - context._add(context.bx, 0+(228*13)+32); + context._add(context.bx, (0+(228*13)+32)); return; } void findopenpos(Context & context) { context.cx = context.data.word(kMousex); - context._sub(context.cx, 80); + context._sub(context.cx, (80)); context.bx = -1; findopenp1: context._add(context.bx, 1); - context._sub(context.cx, 44); + context._sub(context.cx, (44)); if (!context.flags.c()) goto findopenp1; context.al = context.bl; context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); - context._add(context.bx, 0+(228*13)); + context._add(context.bx, (0+(228*13))); return; } @@ -8486,18 +8486,18 @@ void transfertext(Context & context) { context.al = context.data.byte(kExpos); context.ah = 0; context._add(context.ax, context.ax); - context.bx = 0+2080+30000+(16*114); + context.bx = (0+2080+30000+(16*114)); context._add(context.bx, context.ax); context.di = context.data.word(kExtextpos); context.es.word(context.bx) = context.di; - context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2))); context.al = context.data.byte(kItemtotran); context.ah = 0; context._add(context.ax, context.ax); context.ds = context.data.word(kFreedesc); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); - context.si = 0+(82*2); + context.si = (0+(82*2)); context.ax = context.ds.word(context.bx); context._add(context.si, context.ax); moretext: @@ -8512,13 +8512,13 @@ moretext: void getexpos(Context & context) { context.es = context.data.word(kExtras); context.al = 0; - context.di = 0+2080+30000; + context.di = (0+2080+30000); tryanotherex: context._cmp(context.es.byte(context.di+2), 255); if (context.flags.z()) goto foundnewex; context._add(context.di, 16); context._add(context.al, 1); - context._cmp(context.al, 114); + context._cmp(context.al, (114)); if (!context.flags.z()) goto tryanotherex; foundnewex: context.data.byte(kExpos) = context.al; @@ -8528,7 +8528,7 @@ foundnewex: void purgealocation(Context & context) { context.push(context.ax); context.es = context.data.word(kExtras); - context.di = 0+2080+30000; + context.di = (0+2080+30000); context.bx = context.pop(); context.cx = 0; purgeloc: @@ -8548,7 +8548,7 @@ purgeloc: dontpurge: context._add(context.di, 16); context._add(context.cx, 1); - context._cmp(context.cx, 114); + context._cmp(context.cx, (114)); if (!context.flags.z()) goto purgeloc; return; } @@ -8557,14 +8557,14 @@ void emergencypurge(Context & context) { checkpurgeagain: context.ax = context.data.word(kExframepos); context._add(context.ax, 4000); - context._cmp(context.ax, 30000); + context._cmp(context.ax, (30000)); if (context.flags.c()) goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: context.ax = context.data.word(kExtextpos); context._add(context.ax, 400); - context._cmp(context.ax, 18000); + context._cmp(context.ax, (18000)); if (context.flags.c()) goto notneartextend; purgeanitem(context); goto checkpurgeagain; @@ -8574,7 +8574,7 @@ notneartextend: void purgeanitem(Context & context) { context.es = context.data.word(kExtras); - context.di = 0+2080+30000; + context.di = (0+2080+30000); context.bl = context.data.byte(kReallocation); context.cx = 0; lookforpurge: @@ -8593,9 +8593,9 @@ iscup: cantpurge: context._add(context.di, 16); context._add(context.cx, 1); - context._cmp(context.cx, 114); + context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge; - context.di = 0+2080+30000; + context.di = (0+2080+30000); context.bl = context.data.byte(kReallocation); context.cx = 0; lookforpurge2: @@ -8609,7 +8609,7 @@ lookforpurge2: cantpurge2: context._add(context.di, 16); context._add(context.cx, 1); - context._cmp(context.cx, 114); + context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge2; return; } @@ -8638,7 +8638,7 @@ void deleteexobject(Context & context) { context.bx = context.pop(); context.bh = context.bl; context.bl = 4; - context.di = 0+2080+30000; + context.di = (0+2080+30000); context.cx = 0; deleteconts: context._cmp(context.es.word(context.di+2), context.bx); @@ -8653,13 +8653,13 @@ deleteconts: notinsideex: context._add(context.di, 16); context._add(context.cx, 1); - context._cmp(context.cx, 114); + context._cmp(context.cx, (114)); if (!context.flags.z()) goto deleteconts; return; } void deleteexframe(Context & context) { - context.di = 0; + context.di = (0); context.ah = 0; context._add(context.ax, context.ax); context._add(context.di, context.ax); @@ -8672,8 +8672,8 @@ void deleteexframe(Context & context) { context._mul(context.cx); context.si = context.es.word(context.di+2); context.push(context.si); - context._add(context.si, 0+2080); - context.cx = 30000; + context._add(context.si, (0+2080)); + context.cx = (30000); context._sub(context.cx, context.es.word(context.di+2)); context.di = context.si; context._add(context.si, context.ax); @@ -8683,8 +8683,8 @@ void deleteexframe(Context & context) { context.bx = context.pop(); context._sub(context.data.word(kExframepos), context.bx); context.si = context.pop(); - context.cx = 114*3; - context.di = 0; + context.cx = (114)*3; + context.di = (0); shuffleadsdown: context.ax = context.es.word(context.di+2); context._cmp(context.ax, context.si); @@ -8698,15 +8698,15 @@ beforethisone: } void deleteextext(Context & context) { - context.di = 0+2080+30000+(16*114); + context.di = (0+2080+30000+(16*114)); context.ah = 0; context._add(context.ax, context.ax); context._add(context.di, context.ax); context.ax = context.es.word(context.di); context.si = context.ax; context.di = context.ax; - context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2)); - context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.si, (0+2080+30000+(16*114)+((114+2)*2))); + context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2))); context.ax = 0; findlenextext: context.cl = context.es.byte(context.si); @@ -8714,9 +8714,9 @@ findlenextext: context._add(context.si, 1); context._cmp(context.cl, 0); if (!context.flags.z()) goto findlenextext; - context.cx = 18000; + context.cx = (18000); context.bx = context.si; - context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2)); + context._sub(context.bx, (0+2080+30000+(16*114)+((114+2)*2))); context.push(context.bx); context.push(context.ax); context._sub(context.cx, context.bx); @@ -8724,8 +8724,8 @@ findlenextext: context.bx = context.pop(); context._sub(context.data.word(kExtextpos), context.bx); context.si = context.pop(); - context.cx = 114; - context.di = 0+2080+30000+(16*114); + context.cx = (114); + context.di = (0+2080+30000+(16*114)); shuffletextads: context.ax = context.es.word(context.di); context._cmp(context.ax, context.si); @@ -8742,7 +8742,7 @@ void blockget(Context & context) { context.ah = context.al; context.al = 0; context.ds = context.data.word(kBackdrop); - context.si = 0+192; + context.si = (0+192); context._add(context.si, context.ax); return; } @@ -8794,7 +8794,7 @@ void calcmapad(Context & context) { void getdimension(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32); + context.bx = (0+(228*13)+32+60+(32*32)); context.ch = 0; dimloop1: addalong(context); @@ -8803,7 +8803,7 @@ dimloop1: context._add(context.ch, 1); goto dimloop1; finishdim1: - context.bx = 0+(228*13)+32+60+(32*32); + context.bx = (0+(228*13)+32+60+(32*32)); context.cl = 0; dimloop2: context.push(context.bx); @@ -8815,7 +8815,7 @@ dimloop2: context._add(context.bx, 3); goto dimloop2; finishdim2: - context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9); + context.bx = (0+(228*13)+32+60+(32*32))+(11*3*9); context.dh = 10; dimloop3: context.push(context.bx); @@ -8827,7 +8827,7 @@ dimloop3: context._sub(context.bx, 11*3); goto dimloop3; finishdim3: - context.bx = 0+(228*13)+32+60+(32*32)+(3*10); + context.bx = (0+(228*13)+32+60+(32*32))+(3*10); context.dl = 11; dimloop4: context.push(context.bx); @@ -8904,15 +8904,15 @@ gotlength: void drawflags(Context & context) { context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32); + context.di = (0+(228*13)+32+60+(32*32)); context.al = context.data.byte(kMapy); context.ah = 0; - context.cx = 66; + context.cx = (66); context._mul(context.cx); context.bl = context.data.byte(kMapx); context.bh = 0; context._add(context.ax, context.bx); - context.si = 0; + context.si = (0); context._add(context.si, context.ax); context.cx = 10; _tmp28: @@ -8926,14 +8926,14 @@ _tmp28a: context.push(context.ax); context.ah = 0; context._add(context.ax, context.ax); - context.si = 0; + context.si = (0); context._add(context.si, context.ax); context._movsw(); context.ax = context.pop(); context._stosb(); context.si = context.pop(); if (--context.cx) goto _tmp28a; - context._add(context.si, 66-11); + context._add(context.si, (66)-11); context.cx = context.pop(); if (--context.cx) goto _tmp28; return; @@ -8943,7 +8943,7 @@ void eraseoldobs(Context & context) { context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768; + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; oberase: context.push(context.cx); @@ -8953,12 +8953,12 @@ oberase: if (context.flags.z()) goto notthisob; context.di = context.bx; context.al = 255; - context.cx = 32; + context.cx = (32); while(--context.cx) context._stosb(); notthisob: context.bx = context.pop(); context.cx = context.pop(); - context._add(context.bx, 32); + context._add(context.bx, (32)); if (--context.cx) goto oberase; donterase: return; @@ -8966,7 +8966,7 @@ donterase: void showallobs(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); context.data.word(kListpos) = context.bx; context.di = context.bx; context.cx = 128*5; @@ -8974,9 +8974,9 @@ void showallobs(Context & context) { while(--context.cx) context._stosb(); context.es = context.data.word(kSetframes); context.data.word(kFrsegment) = context.es; - context.ax = 0; + context.ax = (0); context.data.word(kDataad) = context.ax; - context.ax = 0+2080; + context.ax = (0+2080); context.data.word(kFramesad) = context.ax; context.data.byte(kCurrentob) = 0; context.ds = context.data.word(kSetdat); @@ -9060,7 +9060,7 @@ void makebackob(Context & context) { context.si = context.ax; context.cx = 49520; context.dx = context.data.word(kSetframes); - context.di = 0; + context.di = (0); makesprite(context); context.ax = context.pop(); context.es.word(context.bx+20) = context.ax; @@ -9081,17 +9081,17 @@ nomake: void showallfree(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.data.word(kListpos) = context.bx; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.cx = 80*5; context.al = 255; while(--context.cx) context._stosb(); context.es = context.data.word(kFreeframes); context.data.word(kFrsegment) = context.es; - context.ax = 0; + context.ax = (0); context.data.word(kDataad) = context.ax; - context.ax = 0+2080; + context.ax = (0+2080); context.data.word(kFramesad) = context.ax; context.al = 0; context.data.byte(kCurrentfree) = context.al; @@ -9160,20 +9160,20 @@ finfree: void showallex(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.data.word(kListpos) = context.bx; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.cx = 100*5; context.al = 255; while(--context.cx) context._stosb(); context.es = context.data.word(kExtras); context.data.word(kFrsegment) = context.es; - context.ax = 0; + context.ax = (0); context.data.word(kDataad) = context.ax; - context.ax = 0+2080; + context.ax = (0+2080); context.data.word(kFramesad) = context.ax; context.data.byte(kCurrentex) = 0; - context.si = 0+2080+30000+2; + context.si = (0+2080+30000)+2; context.cx = 0; exloop: context.push(context.cx); @@ -9412,9 +9412,9 @@ void dolook(Context & context) { context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(kRoomdesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.si = context.es.word(context.bx); - context._add(context.si, 0+(38*2)); + context._add(context.si, (0+(38*2))); findnextcolon(context); context.di = 66; context._cmp(context.data.byte(kReallocation), 50); @@ -9545,7 +9545,7 @@ void getpersframe(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(kPeople); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.es.word(context.bx); return; } @@ -9579,8 +9579,8 @@ void getpersontext(Context & context) { context._mul(context.cx); context.si = context.ax; context.es = context.data.word(kPeople); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); + context._add(context.si, (0+24)); + context.cx = (0+24+(1026*2)); context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; @@ -9632,8 +9632,8 @@ watchtalk: context._add(context.ax, context.ax); context.si = context.ax; context.es = context.data.word(kPeople); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); + context._add(context.si, (0+24)); + context.cx = (0+24+(1026*2)); context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; @@ -9672,8 +9672,8 @@ watchtalk: context._add(context.ax, context.ax); context.si = context.ax; context.es = context.data.word(kPeople); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); + context._add(context.si, (0+24)); + context.cx = (0+24+(1026*2)); context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; @@ -9920,7 +9920,7 @@ alreadyinfo: context._add(context.bx, context.bx); context.es = context.data.word(kTraveltext); context.si = context.es.word(context.bx); - context._add(context.si, 66*2); + context._add(context.si, (66*2)); findnextcolon(context); context.di = 63; context.bx = 84+4; @@ -9998,7 +9998,7 @@ notinthisone: context._add(context.bx, context.bx); context.es = context.data.word(kTraveltext); context.si = context.es.word(context.bx); - context._add(context.si, 66*2); + context._add(context.si, (66*2)); context.di = 50; context.bx = 20; context.dl = 241; @@ -10441,7 +10441,7 @@ void lookininterface(Context & context) { findsetobject(context); context.ah = 1; checkinside(context); - context._cmp(context.cl, 114); + context._cmp(context.cl, (114)); if (context.flags.z()) goto emptyinterface; context.al = context.es.byte(context.bx+15); context._add(context.al, 1); @@ -10827,7 +10827,7 @@ dirroot: } void searchforfiles(Context & context) { - context.bx = 66*2; + context.bx = (66*2); directloop1: context.al = context.es.byte(context.bx); context._add(context.bx, 1); @@ -10975,21 +10975,21 @@ okcom: context.ax = context.data.word(kTextfile1); context.data.word(kMonsource) = context.ax; context.ds = context.ax; - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; context.ax = context.data.word(kTextfile2); context.data.word(kMonsource) = context.ax; context.ds = context.ax; - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; context.ax = context.data.word(kTextfile3); context.data.word(kMonsource) = context.ax; context.ds = context.ax; - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile2; @@ -11049,7 +11049,7 @@ void dirfile(Context & context) { context.push(context.es); context.push(context.di); context.ds = context.data.word(kTextfile1); - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile; @@ -11058,7 +11058,7 @@ void dirfile(Context & context) { context.push(context.es); context.push(context.di); context.ds = context.data.word(kTextfile2); - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile; @@ -11067,7 +11067,7 @@ void dirfile(Context & context) { context.push(context.es); context.push(context.di); context.ds = context.data.word(kTextfile3); - context.si = 66*2; + context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundfile; @@ -11323,7 +11323,7 @@ finishfile: void monmessage(Context & context) { context.es = context.data.word(kTextfile1); - context.bx = 66*2; + context.bx = (66*2); context.cl = context.al; context.ch = 0; monmessageloop: @@ -11410,7 +11410,7 @@ void printcurs(Context & context) { context._sub(context.bx, 3); context.ch = 11; context.ds = context.data.word(kBuffers); - context.si = 0; + context.si = (0); context.push(context.di); context.push(context.bx); multiget(context); @@ -11460,7 +11460,7 @@ void delcurs(Context & context) { context.push(context.bx); context.push(context.cx); context.ds = context.data.word(kBuffers); - context.si = 0; + context.si = (0); multiput(context); context.cx = context.pop(); context.bx = context.pop(); @@ -12265,14 +12265,14 @@ void usealtar(Context & context) { context.cl = 'D'; context.ch = 'A'; findexobject(context); - context._cmp(context.al, 114); + context._cmp(context.al, (114)); if (context.flags.z()) goto thingsonaltar; context.al = 'C'; context.ah = 'N'; context.cl = 'D'; context.ch = 'B'; findexobject(context); - context._cmp(context.al, 114); + context._cmp(context.al, (114)); if (context.flags.z()) goto thingsonaltar; context._cmp(context.data.byte(kCanmovealtar), 1); if (context.flags.z()) goto movealtar; @@ -13283,7 +13283,7 @@ stereook2: findsetobject(context); context.ah = 1; checkinside(context); - context._cmp(context.cl, 114); + context._cmp(context.cl, (114)); if (!context.flags.z()) goto cdinside; context.al = 6; context.cx = 400; @@ -13317,7 +13317,7 @@ void usecooker(Context & context) { context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); checkinside(context); - context._cmp(context.cl, 114); + context._cmp(context.cl, (114)); if (!context.flags.z()) goto foodinside; showfirstuse(context); putbackobstuff(context); @@ -13519,7 +13519,7 @@ void findexobject(Context & context) { context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); context.es = context.data.word(kExtras); - context.bx = 0+2080+30000; + context.bx = (0+2080+30000); context.dl = 0; findexloop: context._cmp(context.al, context.es.byte(context.bx+12)); @@ -13535,7 +13535,7 @@ findexloop: nofindex: context._add(context.bx, 16); context._add(context.dl, 1); - context._cmp(context.dl, 114); + context._cmp(context.dl, (114)); if (!context.flags.z()) goto findexloop; context.al = context.dl; return; @@ -13547,7 +13547,7 @@ void isryanholding(Context & context) { context._sub(context.cl, 'A'); context._sub(context.ch, 'A'); context.es = context.data.word(kExtras); - context.bx = 0+2080+30000; + context.bx = (0+2080+30000); context.dl = 0; searchinv: context._cmp(context.es.byte(context.bx+2), 4); @@ -13561,21 +13561,21 @@ searchinv: context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofindininv; context.al = context.dl; - context._cmp(context.al, 114); + context._cmp(context.al, (114)); return; nofindininv: context._add(context.bx, 16); context._add(context.dl, 1); - context._cmp(context.dl, 114); + context._cmp(context.dl, (114)); if (!context.flags.z()) goto searchinv; context.al = context.dl; - context._cmp(context.al, 114); + context._cmp(context.al, (114)); return; } void checkinside(Context & context) { context.es = context.data.word(kExtras); - context.bx = 0+2080+30000; + context.bx = (0+2080+30000); context.cl = 0; insideloop: context._cmp(context.al, context.es.byte(context.bx+3)); @@ -13586,7 +13586,7 @@ insideloop: notfoundinside: context._add(context.bx, 16); context._add(context.cl, 1); - context._cmp(context.cl, 114); + context._cmp(context.cl, (114)); if (!context.flags.z()) goto insideloop; return; } @@ -13657,7 +13657,7 @@ void findpuztext(Context & context) { context._add(context.si, context.si); context.es = context.data.word(kPuzzletext); context.ax = context.es.word(context.si); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; return; } @@ -13723,7 +13723,7 @@ void removefreeobject(Context & context) { } void findormake(Context & context) { - context.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); + context.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)); context.push(context.ax); context.es = context.data.word(kBuffers); context.ah = context.data.byte(kReallocation); @@ -13760,7 +13760,7 @@ void switchryanoff(Context & context) { void setallchanges(Context & context) { context.es = context.data.word(kBuffers); - context.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); + context.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)); setallloop: context.ax = context.es.word(context.bx); context._cmp(context.al, 255); @@ -13798,7 +13798,7 @@ path: context._mul(context.cx); context.bx = context.pop(); context._add(context.bx, context.ax); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.es = context.data.word(kReels); context.cx = context.pop(); context.es.byte(context.bx+6) = context.cl; @@ -13894,10 +13894,10 @@ void getundertimed(Context & context) { context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; - context.ch = 30; + context.ch = (30); context.cl = 240; context.ds = context.data.word(kBuffers); - context.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); + context.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(context); return; } @@ -13910,10 +13910,10 @@ void putundertimed(Context & context) { context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; - context.ch = 30; + context.ch = (30); context.cl = 240; context.ds = context.data.word(kBuffers); - context.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); + context.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(context); return; } @@ -13929,7 +13929,7 @@ void dumptimedtext(Context & context) { context.ah = 0; context.di = context.ax; context.cl = 240; - context.ch = 30; + context.ch = (30); multidump(context); context.data.byte(kNeedtodumptimed) = 0; nodumptimed: @@ -13948,7 +13948,7 @@ void setuptimeduse(Context & context) { context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(kPuzzletext); - context.cx = 66*2; + context.cx = (66*2); context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; @@ -13970,7 +13970,7 @@ void setuptimedtemp(Context & context) { context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(kTextfile1); - context.cx = 66*2; + context.cx = (66*2); context.ax = context.es.word(context.bx); context._add(context.ax, context.cx); context.bx = context.ax; @@ -14370,7 +14370,7 @@ void usewinch(Context & context) { context.al = 40; context.ah = 1; checkinside(context); - context._cmp(context.cl, 114); + context._cmp(context.cl, (114)); if (context.flags.z()) goto nowinch; context.al = context.cl; context.ah = 4; @@ -14614,14 +14614,14 @@ nonoise: } void showouterpad(Context & context) { - context.di = 36+112-3; - context.bx = 72-4; + context.di = (36+112)-3; + context.bx = (72)-4; context.ds = context.data.word(kTempgraphics); context.al = 1; context.ah = 0; showframe(context); - context.di = 36+112+74; - context.bx = 72+76; + context.di = (36+112)+74; + context.bx = (72)+76; context.ds = context.data.word(kTempgraphics); context.al = 37; context.ah = 0; @@ -14631,58 +14631,58 @@ void showouterpad(Context & context) { void showkeypad(Context & context) { context.al = 22; - context.di = 36+112+9; - context.bx = 72+5; + context.di = (36+112)+9; + context.bx = (72)+5; singlekey(context); context.al = 23; - context.di = 36+112+31; - context.bx = 72+5; + context.di = (36+112)+31; + context.bx = (72)+5; singlekey(context); context.al = 24; - context.di = 36+112+53; - context.bx = 72+5; + context.di = (36+112)+53; + context.bx = (72)+5; singlekey(context); context.al = 25; - context.di = 36+112+9; - context.bx = 72+23; + context.di = (36+112)+9; + context.bx = (72)+23; singlekey(context); context.al = 26; - context.di = 36+112+31; - context.bx = 72+23; + context.di = (36+112)+31; + context.bx = (72)+23; singlekey(context); context.al = 27; - context.di = 36+112+53; - context.bx = 72+23; + context.di = (36+112)+53; + context.bx = (72)+23; singlekey(context); context.al = 28; - context.di = 36+112+9; - context.bx = 72+41; + context.di = (36+112)+9; + context.bx = (72)+41; singlekey(context); context.al = 29; - context.di = 36+112+31; - context.bx = 72+41; + context.di = (36+112)+31; + context.bx = (72)+41; singlekey(context); context.al = 30; - context.di = 36+112+53; - context.bx = 72+41; + context.di = (36+112)+53; + context.bx = (72)+41; singlekey(context); context.al = 31; - context.di = 36+112+9; - context.bx = 72+59; + context.di = (36+112)+9; + context.bx = (72)+59; singlekey(context); context.al = 32; - context.di = 36+112+31; - context.bx = 72+59; + context.di = (36+112)+31; + context.bx = (72)+59; singlekey(context); context._cmp(context.data.byte(kLightcount), 0); if (context.flags.z()) goto notenter; context._sub(context.data.byte(kLightcount), 1); context.al = 36; - context.bx = 72-1+63; + context.bx = (72)-1+63; context._cmp(context.data.byte(kLockstatus), 0); if (!context.flags.z()) goto changelight; context.al = 41; - context.bx = 72+4+63; + context.bx = (72)+4+63; changelight: context._cmp(context.data.byte(kLightcount), 60); if (context.flags.c()) goto gotlight; @@ -14692,7 +14692,7 @@ changelight: gotlight: context.ds = context.data.word(kTempgraphics); context.ah = 0; - context.di = 36+112+60; + context.di = (36+112)+60; showframe(context); notenter: return; @@ -14714,8 +14714,8 @@ gotkey: } void dumpkeypad(Context & context) { - context.di = 36+112-3; - context.bx = 72-4; + context.di = (36+112)-3; + context.bx = (72)-4; context.cl = 120; context.ch = 90; multidump(context); @@ -14733,15 +14733,15 @@ void usemenu(Context & context) { printsprites(context); context.al = 4; context.ah = 0; - context.di = 80+40-48; - context.bx = 60-4; + context.di = (80+40)-48; + context.bx = (60)-4; context.ds = context.data.word(kTempgraphics2); showframe(context); getundermenu(context); context.al = 5; context.ah = 0; - context.di = 80+40+54; - context.bx = 60+72; + context.di = (80+40)+54; + context.bx = (60)+72; context.ds = context.data.word(kTempgraphics2); showframe(context); worktoscreenm(context); @@ -14772,8 +14772,8 @@ menulist: } void dumpmenu(Context & context) { - context.di = 80+40; - context.bx = 60; + context.di = (80+40); + context.bx = (60); context.cl = 48; context.ch = 48; multidump(context); @@ -14781,23 +14781,23 @@ void dumpmenu(Context & context) { } void getundermenu(Context & context) { - context.di = 80+40; - context.bx = 60; + context.di = (80+40); + context.bx = (60); context.cl = 48; context.ch = 48; context.ds = context.data.word(kBuffers); - context.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); + context.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(context); return; } void putundermenu(Context & context) { - context.di = 80+40; - context.bx = 60; + context.di = (80+40); + context.bx = (60); context.cl = 48; context.ch = 48; context.ds = context.data.word(kBuffers); - context.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); + context.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(context); return; } @@ -14805,26 +14805,26 @@ void putundermenu(Context & context) { void showoutermenu(Context & context) { context.al = 40; context.ah = 0; - context.di = 80+40-34; - context.bx = 60-40; + context.di = (80+40)-34; + context.bx = (60)-40; context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 41; context.ah = 0; - context.di = 80+40+64-34; - context.bx = 60-40; + context.di = (80+40)+64-34; + context.bx = (60)-40; context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 42; context.ah = 0; - context.di = 80+40-26; - context.bx = 60+57-40; + context.di = (80+40)-26; + context.bx = (60)+57-40; context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 43; context.ah = 0; - context.di = 80+40+64-26; - context.bx = 60+57-40; + context.di = (80+40)+64-26; + context.bx = (60)+57-40; context.ds = context.data.word(kTempgraphics); showframe(context); return; @@ -14839,8 +14839,8 @@ menuframeok: context.al = context.data.byte(kMenucount); context._shr(context.al, 1); context.ah = 0; - context.di = 80+40; - context.bx = 60; + context.di = (80+40); + context.bx = (60); context.ds = context.data.word(kTempgraphics); showframe(context); return; @@ -15369,8 +15369,8 @@ nobotright: void dumpsymbol(Context & context) { context.data.byte(kNewtextline) = 0; - context.di = 64; - context.bx = 56+20; + context.di = (64); + context.bx = (56)+20; context.cl = 104; context.ch = 60; multidump(context); @@ -15380,16 +15380,16 @@ void dumpsymbol(Context & context) { void showsymbol(Context & context) { context.al = 12; context.ah = 0; - context.di = 64; - context.bx = 56; + context.di = (64); + context.bx = (56); context.ds = context.data.word(kTempgraphics); showframe(context); context.al = context.data.byte(kSymboltopx); context.ah = 0; context.di = context.ax; - context._add(context.di, 64-44); + context._add(context.di, (64)-44); context.al = context.data.byte(kSymboltopnum); - context.bx = 56+20; + context.bx = (56)+20; context.ds = context.data.word(kTempgraphics); context.ah = 32; context.push(context.ax); @@ -15418,10 +15418,10 @@ void showsymbol(Context & context) { context.al = context.data.byte(kSymbolbotx); context.ah = 0; context.di = context.ax; - context._add(context.di, 64-44); + context._add(context.di, (64)-44); context.al = context.data.byte(kSymbolbotnum); context._add(context.al, 6); - context.bx = 56+49; + context.bx = (56)+49; context.ds = context.data.word(kTempgraphics); context.ah = 32; context.push(context.ax); @@ -15598,14 +15598,14 @@ diarylist: void showdiary(Context & context) { context.al = 1; context.ah = 0; - context.di = 68+24; - context.bx = 48+12+37; + context.di = (68+24); + context.bx = (48+12)+37; context.ds = context.data.word(kTempgraphics); showframe(context); context.al = 2; context.ah = 0; - context.di = 68+24+176; - context.bx = 48+12+108; + context.di = (68+24)+176; + context.bx = (48+12)+108; context.ds = context.data.word(kTempgraphics); showframe(context); return; @@ -15625,8 +15625,8 @@ void showdiarykeys(Context & context) { context.al = 4; gotkeyn: context.ah = 0; - context.di = 68+24+94; - context.bx = 48+12+97; + context.di = (68+24)+94; + context.bx = (48+12)+97; context.ds = context.data.word(kTempgraphics); showframe(context); context._cmp(context.data.byte(kPresscount), 1); @@ -15641,8 +15641,8 @@ nokeyn: context.al = 6; gotkeyp: context.ah = 0; - context.di = 68+24+151; - context.bx = 48+12+71; + context.di = (68+24)+151; + context.bx = (48+12)+71; context.ds = context.data.word(kTempgraphics); showframe(context); context._cmp(context.data.byte(kPresscount), 1); @@ -15688,19 +15688,19 @@ void dumpdiarykeys(Context & context) { showpointer(context); return; notsartadd: - context.di = 68+24+48; - context.bx = 48+12+15; + context.di = (68+24)+48; + context.bx = (48+12)+15; context.cl = 200; context.ch = 16; multidump(context); notdumpdiary: - context.di = 68+24+94; - context.bx = 48+12+97; + context.di = (68+24)+94; + context.bx = (48+12)+97; context.cl = 16; context.ch = 16; multidump(context); - context.di = 68+24+151; - context.bx = 48+12+71; + context.di = (68+24)+151; + context.bx = (48+12)+71; context.cl = 16; context.ch = 16; multidump(context); @@ -15762,27 +15762,27 @@ notkeyn: void showdiarypage(Context & context) { context.al = 0; context.ah = 0; - context.di = 68+24; - context.bx = 48+12; + context.di = (68+24); + context.bx = (48+12); context.ds = context.data.word(kTempgraphics); showframe(context); context.al = context.data.byte(kDiarypage); findtext1(context); context.data.byte(kKerning) = 1; usetempcharset(context); - context.di = 68+24+48; - context.bx = 48+12+16; + context.di = (68+24)+48; + context.bx = (48+12)+16; context.dl = 240; context.ah = 16; context.data.word(kCharshift) = 91+91; printdirect(context); - context.di = 68+24+129; - context.bx = 48+12+16; + context.di = (68+24)+129; + context.bx = (48+12)+16; context.dl = 240; context.ah = 16; printdirect(context); - context.di = 68+24+48; - context.bx = 48+12+23; + context.di = (68+24)+48; + context.bx = (48+12)+23; context.dl = 240; context.ah = 16; printdirect(context); @@ -15798,7 +15798,7 @@ void findtext1(Context & context) { context._add(context.si, context.si); context.es = context.data.word(kTextfile1); context.ax = context.es.word(context.si); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; return; } @@ -15922,20 +15922,20 @@ opsblock1: void showmainops(Context & context) { context.ds = context.data.word(kTempgraphics); - context.di = 60+10; - context.bx = 52+10; + context.di = (60)+10; + context.bx = (52)+10; context.al = 8; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+59; - context.bx = 52+30; + context.di = (60)+59; + context.bx = (52)+30; context.al = 7; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+128+4; - context.bx = 52+12; + context.di = (60)+128+4; + context.bx = (52)+12; context.al = 1; context.ah = 0; showframe(context); @@ -15944,26 +15944,26 @@ void showmainops(Context & context) { void showdiscops(Context & context) { context.ds = context.data.word(kTempgraphics); - context.di = 60+128+4; - context.bx = 52+12; + context.di = (60)+128+4; + context.bx = (52)+12; context.al = 1; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+10; - context.bx = 52+10; + context.di = (60)+10; + context.bx = (52)+10; context.al = 9; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+59; - context.bx = 52+30; + context.di = (60)+59; + context.bx = (52)+30; context.al = 10; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+176+2; - context.bx = 52+60-4; + context.di = (60)+176+2; + context.bx = (52)+60-4; context.al = 5; context.ah = 0; showframe(context); @@ -16292,14 +16292,14 @@ void getnamepos(Context & context) { void showopbox(Context & context) { context.ds = context.data.word(kTempgraphics); - context.di = 60; - context.bx = 52; + context.di = (60); + context.bx = (52); context.al = 0; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60; - context.bx = 52+55; + context.di = (60); + context.bx = (52)+55; context.al = 4; context.ah = 0; showframe(context); @@ -16308,19 +16308,19 @@ void showopbox(Context & context) { void showloadops(Context & context) { context.ds = context.data.word(kTempgraphics); - context.di = 60+128+4; - context.bx = 52+12; + context.di = (60)+128+4; + context.bx = (52)+12; context.al = 1; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+176+2; - context.bx = 52+60-4; + context.di = (60)+176+2; + context.bx = (52)+60-4; context.al = 5; context.ah = 0; showframe(context); - context.di = 60+104; - context.bx = 52+14; + context.di = (60)+104; + context.bx = (52)+14; context.al = 55; context.dl = 101; printmessage(context); @@ -16329,19 +16329,19 @@ void showloadops(Context & context) { void showsaveops(Context & context) { context.ds = context.data.word(kTempgraphics); - context.di = 60+128+4; - context.bx = 52+12; + context.di = (60)+128+4; + context.bx = (52)+12; context.al = 1; context.ah = 0; showframe(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+176+2; - context.bx = 52+60-4; + context.di = (60)+176+2; + context.bx = (52)+60-4; context.al = 5; context.ah = 0; showframe(context); - context.di = 60+104; - context.bx = 52+14; + context.di = (60)+104; + context.bx = (52)+14; context.al = 54; context.dl = 101; printmessage(context); @@ -16366,7 +16366,7 @@ alreadysel: notnocurs: oldtonames(context); context.ax = context.data.word(kMousey); - context._sub(context.ax, 52+4); + context._sub(context.ax, (52)+4); context.cl = -1; getslotnum: context._add(context.cl, 1); @@ -16397,14 +16397,14 @@ noselslot: } void showslots(Context & context) { - context.di = 60+7; - context.bx = 52+8; + context.di = (60)+7; + context.bx = (52)+8; context.al = 2; context.ds = context.data.word(kTempgraphics); context.ah = 0; showframe(context); - context.di = 60+10; - context.bx = 52+11; + context.di = (60)+10; + context.bx = (52)+11; context.cl = 0; slotloop: context.push(context.cx); @@ -16431,8 +16431,8 @@ void shownames(Context & context) { context.dx = context.ds; context.es = context.dx; context.si = 8350+1; - context.di = 60+21; - context.bx = 52+10; + context.di = (60)+21; + context.bx = (52)+10; context.cl = 0; shownameloop: context.push(context.cx); @@ -16496,7 +16496,7 @@ afterprintname: void namestoold(Context & context) { context.ds = context.cs; context.si = 8350; - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; while(--context.cx) context._movsb(); @@ -16506,7 +16506,7 @@ void namestoold(Context & context) { void oldtonames(Context & context) { context.es = context.cs; context.di = 8350; - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; while(--context.cx) context._movsb(); @@ -16519,15 +16519,15 @@ void makeheader(Context & context) { context.di = 5912; context.ax = 17; storeit(context); - context.ax = 68-0; + context.ax = (68-0); storeit(context); - context.ax = 0+2080+30000+(16*114)+((114+2)*2)+18000; + context.ax = (0+2080+30000+(16*114)+((114+2)*2)+18000); storeit(context); - context.ax = 250*4; + context.ax = (250)*4; storeit(context); context.ax = 48; storeit(context); - context.ax = 991-534; + context.ax = (991-534); storeit(context); return; } @@ -16596,8 +16596,8 @@ void showdecisions(Context & context) { createpanel2(context); showopbox(context); context.ds = context.data.word(kTempgraphics); - context.di = 60+17; - context.bx = 52+13; + context.di = (60)+17; + context.bx = (52)+13; context.al = 6; context.ah = 0; showframe(context); @@ -17305,27 +17305,27 @@ enoughmem: } void allocatebuffers(Context & context) { - context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16; + context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; allocatemem(context); context.data.word(kExtras) = context.ax; trysoundalloc(context); - context.bx = 0+(66*60)/16; + context.bx = (0+(66*60))/16; allocatemem(context); context.data.word(kMapdata) = context.ax; trysoundalloc(context); - context.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; + context.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(context); context.data.word(kBuffers) = context.ax; trysoundalloc(context); - context.bx = 16*80/16; + context.bx = (16*80)/16; allocatemem(context); context.data.word(kFreedat) = context.ax; trysoundalloc(context); - context.bx = 64*128/16; + context.bx = (64*128)/16; allocatemem(context); context.data.word(kSetdat) = context.ax; trysoundalloc(context); - context.bx = 22*8*20*8/16; + context.bx = (22*8*20*8)/16; allocatemem(context); context.data.word(kMapstore) = context.ax; allocatework(context); @@ -17340,26 +17340,26 @@ void allocatebuffers(Context & context) { void clearbuffers(Context & context) { context.es = context.data.word(kBuffers); - context.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; + context.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; context.ax = 0; context.di = 0; while(--context.cx) context._stosw(); context.es = context.data.word(kExtras); - context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); context.es = context.data.word(kBuffers); - context.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); + context.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)); context.ds = context.cs; context.si = 534; - context.cx = 991-534; + context.cx = (991-534); while(--context.cx) context._movsb(); context.es = context.data.word(kBuffers); - context.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; + context.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); context.ds = context.cs; context.si = 0; - context.cx = 68-0; + context.cx = (68-0); while(--context.cx) context._movsb(); clearchanges(context); return; @@ -17367,27 +17367,27 @@ void clearbuffers(Context & context) { void clearchanges(Context & context) { context.es = context.data.word(kBuffers); - context.cx = 250*2; + context.cx = (250)*2; context.ax = 0x0ffff; - context.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); + context.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)); while(--context.cx) context._stosw(); context.ds = context.data.word(kBuffers); - context.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); + context.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)); context.es = context.cs; context.di = 534; - context.cx = 991-534; + context.cx = (991-534); while(--context.cx) context._movsb(); context.ds = context.data.word(kBuffers); - context.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; + context.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); context.es = context.cs; context.di = 0; - context.cx = 68-0; + context.cx = (68-0); while(--context.cx) context._movsb(); context.data.byte(kExpos) = 0; context.data.word(kExframepos) = 0; context.data.word(kExtextpos) = 0; context.es = context.data.word(kExtras); - context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2; + context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; while(--context.cx) context._stosw(); @@ -17428,9 +17428,9 @@ void clearreels(Context & context) { void clearrest(Context & context) { context.es = context.data.word(kMapdata); - context.cx = 66*60/2; + context.cx = (66*60)/2; context.ax = 0; - context.di = 0; + context.di = (0); while(--context.cx) context._stosw(); context.es = context.data.word(kBackdrop); deallocatemem(context); @@ -18100,7 +18100,7 @@ nothingund: void checkifperson(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.cx = 12; identifyreel: context.push(context.cx); @@ -18156,7 +18156,7 @@ notareelid: void checkifset(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); context.cx = 127; identifyset: context._cmp(context.es.byte(context.bx+4), 255); @@ -18189,7 +18189,7 @@ notasetid: void checkifex(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); context.cx = 99; identifyex: context._cmp(context.es.byte(context.bx+4), 255); @@ -18218,7 +18218,7 @@ notanexid: void checkiffree(Context & context) { context.es = context.data.word(kBuffers); - context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5); + context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); context.cx = 79; identifyfree: context._cmp(context.es.byte(context.bx+4), 255); @@ -18255,9 +18255,9 @@ void isitdescribed(Context & context) { context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(kSetdesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.es.word(context.bx); - context._add(context.ax, 0+(130*2)); + context._add(context.ax, (0+(130*2))); context.bx = context.ax; context.dl = context.es.byte(context.bx); context.bx = context.pop(); @@ -18270,7 +18270,7 @@ void isitdescribed(Context & context) { void findpathofpoint(Context & context) { context.push(context.ax); - context.bx = 0; + context.bx = (0); context.es = context.data.word(kReels); context.al = context.data.byte(kRoomnum); context.ah = 0; @@ -18308,7 +18308,7 @@ gotvalidpath: void findfirstpath(Context & context) { context.push(context.ax); - context.bx = 0; + context.bx = (0); context.es = context.data.word(kReels); context.al = context.data.byte(kRoomnum); context.ah = 0; @@ -18402,7 +18402,7 @@ void turnanypathon(Context & context) { context.cx = 144; context._mul(context.cx); context.es = context.data.word(kReels); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); context.ax = context.pop(); context.ah = 0; @@ -18428,7 +18428,7 @@ void turnanypathoff(Context & context) { context.cx = 144; context._mul(context.cx); context.es = context.data.word(kReels); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); context.ax = context.pop(); context.ah = 0; @@ -18727,7 +18727,7 @@ void commandwithob(Context & context) { context.bx = context.ax; context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); @@ -18778,7 +18778,7 @@ void commandonly(Context & context) { context.bx = context.ax; context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); @@ -18799,7 +18799,7 @@ void printmessage(Context & context) { context.bx = context.ax; context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; context.di = context.pop(); context.bx = context.pop(); @@ -18820,7 +18820,7 @@ void printmessage2(Context & context) { context.bx = context.ax; context.es = context.data.word(kCommandtext); context.ax = context.es.word(context.bx); - context._add(context.ax, 66*2); + context._add(context.ax, (66*2)); context.si = context.ax; context.ax = context.pop(); searchmess: @@ -19208,7 +19208,7 @@ void getroomspaths(Context & context) { context.cx = 144; context._mul(context.cx); context.es = context.data.word(kReels); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); return; } @@ -19253,8 +19253,8 @@ void findobname(Context & context) { context._mul(context.bx); context.si = context.ax; context.ds = context.data.word(kPeople); - context._add(context.si, 0+24); - context.cx = 0+24+(1026*2); + context._add(context.si, (0+24)); + context.cx = (0+24+(1026*2)); context.ax = context.ds.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; @@ -19264,34 +19264,34 @@ notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; context.ds = context.data.word(kExtras); - context._add(context.bx, 0+2080+30000+(16*114)); + context._add(context.bx, (0+2080+30000+(16*114))); context.ax = context.ds.word(context.bx); - context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2)); + context._add(context.ax, (0+2080+30000+(16*114)+((114+2)*2))); context.si = context.ax; return; notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; context.ds = context.data.word(kFreedesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); - context._add(context.ax, 0+(82*2)); + context._add(context.ax, (0+(82*2))); context.si = context.ax; return; notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; context.ds = context.data.word(kSetdesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); - context._add(context.ax, 0+(130*2)); + context._add(context.ax, (0+(130*2))); context.si = context.ax; return; notsetname: context.ds = context.data.word(kBlockdesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); - context._add(context.ax, 0+(98*2)); + context._add(context.ax, (0+(98*2))); context.si = context.ax; return; } @@ -19429,9 +19429,9 @@ notover32: context.bh = 0; context._add(context.bx, context.bx); context.es = context.data.word(kRoomdesc); - context._add(context.bx, 0); + context._add(context.bx, (0)); context.ax = context.es.word(context.bx); - context._add(context.ax, 0+(38*2)); + context._add(context.ax, (0+(38*2))); context.si = context.ax; context.data.word(kLinespacing) = 7; context.di = 88; @@ -19518,8 +19518,8 @@ void zoomicon(Context & context) { context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) goto nozoom1; context.ds = context.data.word(kIcons1); - context.di = 8; - context.bx = 132-1; + context.di = (8); + context.bx = (132)-1; context.al = 8; context.ah = 0; showframe(context); @@ -19677,10 +19677,10 @@ monloop1: } void getunderzoom(Context & context) { - context.di = 8+5; - context.bx = 132+4; + context.di = (8)+5; + context.bx = (132)+4; context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.cl = 46; context.ch = 40; multiget(context); @@ -19690,8 +19690,8 @@ void getunderzoom(Context & context) { void dumpzoom(Context & context) { context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) goto notzoomon; - context.di = 8+5; - context.bx = 132+4; + context.di = (8)+5; + context.bx = (132)+4; context.cl = 46; context.ch = 40; multidump(context); @@ -19700,10 +19700,10 @@ notzoomon: } void putunderzoom(Context & context) { - context.di = 8+5; - context.bx = 132+4; + context.di = (8)+5; + context.bx = (132)+4; context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5); + context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.cl = 46; context.ch = 40; multiput(context); @@ -19717,8 +19717,8 @@ void crosshair(Context & context) { if (!context.flags.c()) goto nocross; context.es = context.data.word(kWorkspace); context.ds = context.data.word(kIcons1); - context.di = 8+24; - context.bx = 132+19; + context.di = (8)+24; + context.bx = (132)+19; context.al = 9; context.ah = 0; showframe(context); @@ -19726,8 +19726,8 @@ void crosshair(Context & context) { nocross: context.es = context.data.word(kWorkspace); context.ds = context.data.word(kIcons1); - context.di = 8+24; - context.bx = 132+19; + context.di = (8)+24; + context.bx = (132)+19; context.al = 29; context.ah = 0; showframe(context); @@ -19765,7 +19765,7 @@ notsmally: context.data.byte(kPointerys) = context.ch; context.push(context.ds); context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60; + context.si = (0+(228*13)+32+60); multiget(context); context.ds = context.pop(); context.di = context.pop(); @@ -19825,7 +19825,7 @@ notsmally2: context._sub(context.data.word(kOldpointery), context.ax); context._sub(context.bx, context.ax); context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60; + context.si = (0+(228*13)+32+60); multiget(context); context.ds = context.pop(); context.di = context.pop(); @@ -19854,7 +19854,7 @@ void delpointer(Context & context) { context.ch = context.data.byte(kPointerys); context.data.byte(kDelys) = context.ch; context.ds = context.data.word(kBuffers); - context.si = 0+(228*13)+32+60; + context.si = (0+(228*13)+32+60); context.di = context.data.word(kDelherex); context.bx = context.data.word(kDelherey); multiput(context); @@ -19888,9 +19888,9 @@ void undertextline(Context & context) { context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); context.ds = context.data.word(kBuffers); - context.si = 0; - context.cl = 228; - context.ch = 13; + context.si = (0); + context.cl = (228); + context.ch = (13); multiget(context); return; } @@ -19900,9 +19900,9 @@ void deltextline(Context & context) { context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); context.ds = context.data.word(kBuffers); - context.si = 0; - context.cl = 228; - context.ch = 13; + context.si = (0); + context.cl = (228); + context.ch = (13); multiput(context); return; } @@ -19914,8 +19914,8 @@ void dumptextline(Context & context) { context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context._sub(context.bx, 3); - context.cl = 228; - context.ch = 13; + context.cl = (228); + context.ch = (13); multidump(context); nodumptextline: return; @@ -20300,10 +20300,10 @@ void restoreall(Context & context) { allocateload(context); context.ds = context.ax; context.data.word(kBackdrop) = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); context.ds = context.data.word(kWorkspace); - context.dx = 0; + context.dx = (0); context.cx = 132*66; context.al = 0; fillspace(context); @@ -20312,7 +20312,7 @@ void restoreall(Context & context) { allocateload(context); context.data.word(kSetframes) = context.ax; context.ds = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); dontloadseg(context); allocateload(context); @@ -20364,7 +20364,7 @@ void restoreall(Context & context) { allocateload(context); context.data.word(kFreedesc) = context.ax; context.ds = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); closefile(context); setallchanges(context); @@ -20378,11 +20378,11 @@ void sortoutmap(Context & context) { context.si = 0; context.es = context.data.word(kMapdata); context.di = 0; - context.cx = 60; + context.cx = (60); blimey: context.push(context.cx); context.push(context.si); - context.cx = 66; + context.cx = (66); while(--context.cx) context._movsb(); context.si = context.pop(); context.cx = context.pop(); @@ -20428,10 +20428,10 @@ void startloading(Context & context) { allocateload(context); context.ds = context.ax; context.data.word(kBackdrop) = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); context.ds = context.data.word(kWorkspace); - context.dx = 0; + context.dx = (0); context.cx = 132*66; context.al = 0; fillspace(context); @@ -20440,11 +20440,11 @@ void startloading(Context & context) { allocateload(context); context.data.word(kSetframes) = context.ax; context.ds = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); context.ds = context.data.word(kSetdat); context.dx = 0; - context.cx = 64*128; + context.cx = (64*128); context.al = 255; fillspace(context); loadseg(context); @@ -20495,14 +20495,14 @@ void startloading(Context & context) { loadseg(context); context.ds = context.data.word(kFreedat); context.dx = 0; - context.cx = 16*80; + context.cx = (16*80); context.al = 255; fillspace(context); loadseg(context); allocateload(context); context.data.word(kFreedesc) = context.ax; context.ds = context.ax; - context.dx = 0; + context.dx = (0); loadseg(context); closefile(context); findroominloc(context); @@ -20547,7 +20547,7 @@ lookx2: context.cx = 144; context._mul(context.cx); context.es = context.data.word(kReels); - context.bx = 0; + context.bx = (0); context._add(context.bx, context.ax); context.ax = context.pop(); context.ah = 0; @@ -20605,7 +20605,7 @@ void getroomdata(Context & context) { void readheader(Context & context) { context.ds = context.cs; context.dx = 5862; - context.cx = 5958-5862; + context.cx = (5958-5862); readfromfile(context); context.es = context.cs; context.di = 5912; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 0380304be8..228bf14df8 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -542,6 +542,98 @@ namespace dreamgen { const static uint16 kSavefiles = 8469; const static uint16 kRecname = 8560; const static uint16 kStak = 8573; + const static uint16 kBlocktextdat = (0); + const static uint16 kPersonframes = (0); + const static uint16 kDebuglevel1 = (0); + const static uint16 kDebuglevel2 = (0); + const static uint16 kPlayback = (0); + const static uint16 kMap = (0); + const static uint16 kSettextdat = (0); + const static uint16 kFramedata = (0); + const static uint16 kRecording = (0); + const static uint16 kFlags = (0); + const static uint16 kGerman = (0); + const static uint16 kTextunder = (0); + const static uint16 kPathdata = (0); + const static uint16 kDemo = (0); + const static uint16 kExframedata = (0); + const static uint16 kCd = (0); + const static uint16 kIntextdat = (0); + const static uint16 kFreetextdat = (0); + const static uint16 kFrframedata = (0); + const static uint16 kSettext = (0+(130*2)); + const static uint16 kOpeninvlist = (0+(228*13)); + const static uint16 kRyaninvlist = (0+(228*13)+32); + const static uint16 kPointerback = (0+(228*13)+32+60); + const static uint16 kMapflags = (0+(228*13)+32+60+(32*32)); + const static uint16 kStartpal = (0+(228*13)+32+60+(32*32)+(11*10*3)); + const static uint16 kEndpal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + const static uint16 kMaingamepal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + const static uint16 kSpritetable = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + const static uint16 kSetlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + const static uint16 kFreelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + const static uint16 kExlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + const static uint16 kPeoplelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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); + const static 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); + const static uint16 kReellist = (0+(36*144)); + const static uint16 kIntext = (0+(38*2)); + const static uint16 kLengthofmap = (0+(66*60)); + const static uint16 kFreetext = (0+(82*2)); + const static uint16 kBlocktext = (0+(98*2)); + const static uint16 kBlocks = (0+192); + const static uint16 kFrframes = (0+2080); + const static uint16 kExframes = (0+2080); + const static uint16 kFrames = (0+2080); + const static uint16 kExdata = (0+2080+30000); + const static uint16 kExtextdat = (0+2080+30000+(16*114)); + const static uint16 kExtext = (0+2080+30000+(16*114)+((114+2)*2)); + const static uint16 kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000); + const static uint16 kPersontxtdat = (0+24); + const static uint16 kPersontext = (0+24+(1026*2)); + const static uint16 kInputport = (0x63); + const static uint16 kSpanish = (1); + const static uint16 kForeign = (1); + const static uint16 kNumexobjects = (114); + const static uint16 kUndertextsizey = (13); + const static uint16 kZoomy = (132); + const static uint16 kFreedatlen = (16*80); + const static uint16 kExtextlen = (18000); + const static uint16 kLenofmapstore = (22*8*20*8); + const static uint16 kUndertextsizex = (228); + const static uint16 kNumchanges = (250); + const static uint16 kUndertimedysize = (30); + const static uint16 kExframeslen = (30000); + const static uint16 kTablesize = (32); + const static uint16 kScreenwidth = (320); + const static uint16 kKeypadx = (36+112); + const static uint16 kItempicsize = (44); + const static uint16 kDiaryy = (48+12); + const static uint16 kOpsy = (52); + const static uint16 kSymboly = (56); + const static uint16 kInventy = (58); + const static uint16 kHeaderlen = (5958-5862); + const static uint16 kMenuy = (60); + const static uint16 kOpsx = (60); + const static uint16 kMaplength = (60); + const static uint16 kSymbolx = (64); + const static uint16 kSetdatlen = (64*128); + const static uint16 kMapwidth = (66); + const static uint16 kTextstart = (66*2); + const static uint16 kMaplen = (66*60); + const static uint16 kDiaryx = (68+24); + const static uint16 kLengthofvars = (68-0); + const static uint16 kKeypady = (72); + const static uint16 kZoomx = (8); + const static uint16 kInventx = (80); + const static uint16 kMenux = (80+40); + const static uint16 kLenofreelrouts = (991-534); } -- cgit v1.2.3 From 2cb4eac5e02b1445583195d5190ecb1498e4a391 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 02:48:11 +0400 Subject: DREAMWEB: removed hardcoded constant --- engines/dreamweb/dreamweb.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fe27f4f97c..94c6e7e6e7 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -203,11 +203,9 @@ void DreamWebEngine::setGraphicsMode() { } void DreamWebEngine::fadeDos() { - static const int startpal = 0+(228*13)+32+60+(32*32)+(11*10*3); //fixme: add equ to enum too - PaletteManager *palette = _system->getPaletteManager(); _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); - uint8 *dst = _context.es.ptr(startpal, 768); + uint8 *dst = _context.es.ptr(dreamgen::kStartpal, 768); palette->grabPalette(dst, 0, 64); for(int fade = 0; fade < 64; ++fade) { for(int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors -- cgit v1.2.3 From 9b761735734356cb3f24f4d80e95ecc2f912020c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 03:12:45 +0400 Subject: DREAMWEB: regenerating source --- engines/dreamweb/dreamgen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a4a35eb0e7..07a69f44be 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -6220,18 +6220,18 @@ afterslow: context._add(context.bx, 10); goto printloopslow6; finishslow: - context.cx = context.pop(); - context.si = context.pop(); context.es = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); context.al = 0; return; finishslow2: - context.cx = context.pop(); - context.si = context.pop(); context.es = context.pop(); + context.si = context.pop(); + context.cx = context.pop(); context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); -- cgit v1.2.3 From 97310ab904eea1a80c2b2235e0a31a01f1fbaaae Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 03:19:58 +0400 Subject: DREAMWEB: asserted invalid calls --- devtools/tasmrecover/tasm/cpp.py | 1 + engines/dreamweb/dreamgen.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index e94231f043..3caf21e6cf 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -564,6 +564,7 @@ namespace %s { self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1]) for name,addr in self.proc_addr: self.fd.write("\t\tcase 0x%04x: %s(context); break;\n" %(addr, name)) + self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)context.ax);") self.fd.write("\n\t}\n}\n\n} /*namespace*/\n") self.fd.close() diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 07a69f44be..c9fcfb3e6b 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -22131,7 +22131,7 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xcbac: walkandexamine(context); break; case 0xcbb0: doload(context); break; case 0xcbb4: generalerror(context); break; - + default: ::error("invalid call to %04x dispatched", (uint16)context.ax); } } -- cgit v1.2.3 From 8cc8e73d1f80065c6359f98722e1a4de2cb62654 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 09:53:35 +0400 Subject: DREAMWEB: blacklisted vga blitting functions --- devtools/tasmrecover/tasm-recover | 2 +- engines/dreamweb/dreamgen.cpp | 186 -------------------------------------- engines/dreamweb/dreamgen.h | 4 + engines/dreamweb/dreamweb.cpp | 16 ++++ 4 files changed, 21 insertions(+), 187 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 159acacca4..1763a2524d 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -7,5 +7,5 @@ p = parser() p.strip_path = 3 context = p.parse('dreamweb/dreamweb.asm') p.link() -generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2', 'seecommandtail']) +generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2', 'seecommandtail', 'multiget', 'multiput', 'multidump', 'frameoutnm']) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c9fcfb3e6b..b27c44e5bc 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -49,9 +49,6 @@ void switchryanon(Context &context); void drawflags(Context &context); void getdimension(Context &context); void getflagunderp(Context &context); -void multidump(Context &context); -void multiput(Context &context); -void multiget(Context &context); void dumpblink(Context &context); void showblink(Context &context); void showframe(Context &context); @@ -429,7 +426,6 @@ void rollendcredits2(Context &context); void clearstartpal(Context &context); void fadecalculation(Context &context); void frameoutfx(Context &context); -void frameoutnm(Context &context); void frameoutbh(Context &context); void frameoutv(Context &context); void putunderzoom(Context &context); @@ -4357,142 +4353,6 @@ deloneloop: return; } -void multiget(Context & context) { - context.ax = context.bx; - context.bx = (320); - context._mul(context.bx); - context._add(context.di, context.ax); - context.es = context.data.word(kWorkspace); - context.es = context.ds; - context.ds = context.es; - context._xchg(context.di, context.si); - context.al = context.cl; - context.ah = 0; - context.dx = (320); - context._sub(context.dx, context.ax); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth2; - context.bl = context.cl; - context.bh = 0; - context.ax = 1819; - context._shr(context.bx, 1); - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop3: - __dispatch_call(context, context.ax); - context._add(context.si, context.dx); - if (--context.cx) goto multiloop3; - return; -oddwidth2: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop4: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.si, context.dx); - if (--context.cx) goto multiloop4; - return; -} - -void multiput(Context & context) { - context.ax = context.bx; - context.bx = (320); - context._mul(context.bx); - context._add(context.di, context.ax); - context.es = context.data.word(kWorkspace); - context.al = context.cl; - context.ah = 0; - context.dx = (320); - context._sub(context.dx, context.ax); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth3; - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop5: - __dispatch_call(context, context.ax); - context._add(context.di, context.dx); - if (--context.cx) goto multiloop5; - return; -oddwidth3: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -multiloop6: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.dx); - if (--context.cx) goto multiloop6; - return; -} - -void multidump(Context & context) { - context.dx = 0x0a000; - context.es = context.dx; - context.ds = context.data.word(kWorkspace); - context.ax = context.bx; - context.bx = (320); - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = (320); - context.si = context.di; - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidth; - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.bl = context.cl; - context.bh = 0; - context._neg(context.bx); - context._add(context.bx, context.dx); - context.cl = context.ch; - context.ch = 0; -multiloop1: - __dispatch_call(context, context.ax); - context._add(context.di, context.bx); - context._add(context.si, context.bx); - if (--context.cx) goto multiloop1; - return; -oddwidth: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.bl = context.cl; - context.bh = 0; - context._neg(context.bx); - context._add(context.bx, (320)); - context.cl = context.ch; - context.ch = 0; -multiloop2: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.bx); - context._add(context.si, context.bx); - if (--context.cx) goto multiloop2; - return; -} - void width160(Context & context) { context._movsw(); context._movsw(); @@ -4978,48 +4838,6 @@ backtosolid: return; } -void frameoutnm(Context & context) { - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); - context.cx = context.pop(); - context.al = context.cl; - context._and(context.al, 1); - if (!context.flags.z()) goto oddwidthframe; - context.bl = context.cl; - context.bh = 0; - context.ax = 1819; - context._shr(context.bx, 1); - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -nmloop1: - __dispatch_call(context, context.ax); - context._add(context.di, context.dx); - if (--context.cx) goto nmloop1; - return; -oddwidthframe: - context.bl = context.cl; - context.bh = 0; - context._shr(context.bx, 1); - context.ax = 1819; - context._sub(context.ax, context.bx); - context.cl = context.ch; - context.ch = 0; -nmloop2: - __dispatch_call(context, context.ax); - context._movsb(); - context._add(context.di, context.dx); - if (--context.cx) goto nmloop2; - return; -} - void frameoutbh(Context & context) { context.push(context.dx); context.ax = context.bx; @@ -21517,14 +21335,10 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc20c: doshake(context); break; case 0xc210: zoom(context); break; case 0xc214: delthisone(context); break; - case 0xc218: multiget(context); break; - case 0xc21c: multiput(context); break; - case 0xc220: multidump(context); break; case 0xc224: width160(context); break; case 0xc228: doblocks(context); break; case 0xc22c: showframe(context); break; case 0xc230: frameoutv(context); break; - case 0xc234: frameoutnm(context); break; case 0xc238: frameoutbh(context); break; case 0xc23c: frameoutfx(context); break; case 0xc240: transferinv(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 228bf14df8..fcbf738a00 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -12,6 +12,10 @@ namespace dreamgen { void quickquit(Context &context); void quickquit2(Context &context); void seecommandtail(Context &context); + void multiget(Context &context); + void multiput(Context &context); + void multidump(Context &context); + void frameoutnm(Context &context); void keyboardread(Context &context); void resetkeyboard(Context &context); void setkeyboardint(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 94c6e7e6e7..adc2cbbaa2 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -227,6 +227,22 @@ static inline DreamWeb::DreamWebEngine *engine() { return DreamWeb::DreamWebEngine::instance(); } +void multiget(Context &context) { + ::error("multiget"); +} + +void multiput(Context &context) { + ::error("multiput"); +} + +void multidump(Context &context) { + ::error("multidump"); +} + +void frameoutnm(Context &context) { + ::error("frameoutnm"); +} + void seecommandtail(Context &context) { context.data.word(kSoundbaseadd) = 0x220; context.data.byte(kSoundint) = 5; -- cgit v1.2.3 From 4c54bf9799329da3a030d4df524c8e2b87b7a7fa Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 10:24:02 +0400 Subject: DREAMWEB: implemented multiXXX vga functions --- engines/dreamweb/dreamweb.cpp | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index adc2cbbaa2..68370ffa17 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -228,15 +228,46 @@ static inline DreamWeb::DreamWebEngine *engine() { } void multiget(Context &context) { - ::error("multiget"); + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned pitch = (uint16)context.data.word(kScreenwidth); + unsigned src = (uint16)context.di + (uint16)context.bx * pitch; + unsigned dst = (uint16)context.si; + context.es = context.ds; + context.ds = context.data.word(kWorkspace); + //debug(1, "multiget %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); + for(unsigned y = 0; y < h; ++y) { + uint8 *src_p = context.ds.ptr(src + pitch * y, w); + uint8 *dst_p = context.es.ptr(dst + w * y, w); + memcpy(src_p, dst_p, w); + } } void multiput(Context &context) { - ::error("multiput"); + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned pitch = (uint16)context.data.word(kScreenwidth); + unsigned src = (uint16)context.si; + unsigned dst = (uint16)context.di + (uint16)context.bx * pitch; + context.es = context.data.word(kWorkspace); + //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); + for(unsigned y = 0; y < h; ++y) { + uint8 *src_p = context.ds.ptr(src + w * y, w); + uint8 *dst_p = context.es.ptr(dst + pitch * y, w); + memcpy(src_p, dst_p, w); + } } void multidump(Context &context) { - ::error("multidump"); + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + context.es = 0xa000; + context.ds = context.data.word(kWorkspace); + //debug(1, "multidump %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); + unsigned pitch = (uint16)context.data.word(kScreenwidth); + unsigned offset = (uint16)context.di + (uint16)context.bx * pitch; + for(unsigned y = 0; y < h; ++y, offset += pitch * y) { + uint8 *src_p = context.ds.ptr(offset, w); + uint8 *dst_p = context.es.ptr(offset, w); + memcpy(src_p, dst_p, w); + } } void frameoutnm(Context &context) { -- cgit v1.2.3 From 8a72645c16a76937eaa5faf824fe5ae2eef8bebe Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 10:43:13 +0400 Subject: DREAMWEB: added setPalette instead of showgroup + framenm --- engines/dreamweb/dreamweb.cpp | 30 +++++++++++++++++++----------- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 68370ffa17..5480aa6ff5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -217,6 +217,14 @@ void DreamWebEngine::fadeDos() { waitForVSync(); } } +void DreamWebEngine::setPalette() { + PaletteManager *palette = _system->getPaletteManager(); + unsigned n = (uint16)_context.cx; + uint8 *colors = _context.ds.ptr(_context.si, n * 3); + palette->setPalette(colors, _context.al, n); + _context.si += n * 3; + _context.cx = 0; +} } // End of namespace DreamWeb @@ -271,7 +279,16 @@ void multidump(Context &context) { } void frameoutnm(Context &context) { - ::error("frameoutnm"); + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned pitch = (uint16)context.dx; + unsigned src = (uint16)context.si; + unsigned dst = (uint16)context.di + (uint16)context.bx * pitch; + //debug(1, "framenm %ux%u[pitch: %u] -> segment: %04x->%04x", w, h, pitch, (uint16)context.ds, (uint16)context.es); + for(unsigned y = 0; y < h; ++y) { + uint8 *src_p = context.ds.ptr(src + w * y, w); + uint8 *dst_p = context.es.ptr(dst + pitch * y, w); + memcpy(src_p, dst_p, w); + } } void seecommandtail(Context &context) { @@ -534,16 +551,7 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - debug(1, "setting palette entries %u, %u colors, ds: %04x", (uint8)context.al, (uint16)context.cx, (uint16)context.ds); - for(unsigned idx = context.al; context.cx--; ++idx) { - context._lodsb(); - unsigned r = context.al; - context._lodsb(); - unsigned g = context.al; - context._lodsb(); - unsigned b = context.al; - //debug(1, "%u -> (%u,%u,%u)", idx, r, g, b); - } + engine()->setPalette(); } void fadedos(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index ed4359f645..1e9ace932b 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -85,6 +85,7 @@ public: void mouseCall(); //fill mouse pos and button state void processEvents(); void setGraphicsMode(); + void setPalette(); void fadeDos(); private: -- cgit v1.2.3 From b04f5908980c3b042d8eeba8333f03a1b697b400 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 10:47:23 +0400 Subject: DREAMWEB: added forgotten updateScreen() --- engines/dreamweb/dreamweb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 5480aa6ff5..f8a8b55a81 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -95,6 +95,7 @@ void DreamWebEngine::waitForVSync() { memcpy(scanline, src, 320); } _system->unlockScreen(); + _system->updateScreen(); /* while (!_vSyncInterrupt) { _system->delayMillis(10); @@ -199,10 +200,12 @@ void DreamWebEngine::mouseCall() { } void DreamWebEngine::setGraphicsMode() { + processEvents(); initGraphics(320, 200, false); } void DreamWebEngine::fadeDos() { + //processEvents will be called from vsync PaletteManager *palette = _system->getPaletteManager(); _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); uint8 *dst = _context.es.ptr(dreamgen::kStartpal, 768); @@ -218,6 +221,7 @@ void DreamWebEngine::fadeDos() { } } void DreamWebEngine::setPalette() { + processEvents(); PaletteManager *palette = _system->getPaletteManager(); unsigned n = (uint16)_context.cx; uint8 *colors = _context.ds.ptr(_context.si, n * 3); -- cgit v1.2.3 From e535e6e2953ed91e3b66ee74d88af1a715a97f3d Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 11:30:11 +0400 Subject: DREAMWEB: added keyboard handling --- engines/dreamweb/dreamweb.cpp | 23 ++++++++++++++++++++--- engines/dreamweb/dreamweb.h | 3 +++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index f8a8b55a81..c36e27a760 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -138,6 +138,7 @@ void DreamWebEngine::processEvents() { } break; default: + keyPressed(event.kbd.ascii); break; } break; @@ -183,6 +184,19 @@ void DreamWebEngine::closeFile() { _file.close(); } +void DreamWebEngine::keyPressed(uint16 ascii) { + debug(1, "key pressed = %04x", ascii); + uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts + uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) % 0x0f; + uint16 out = _context.data.word(dreamgen::kBufferout); + if (in == out) { + warning("keyboard buffer is full"); + return; + } + _context.data.word(dreamgen::kBufferin) = in; + keybuf[in] = ascii; +} + void DreamWebEngine::mouseCall() { processEvents(); Common::Point pos = _mouse; @@ -215,8 +229,10 @@ void DreamWebEngine::fadeDos() { if (dst[c]) { --dst[c]; } + dst[c] = c / 3; } - palette->setPalette(dst, 0, 64); + //Common::hexdump(dst, 64 * 3); + //palette->setPalette(dst, 0, 64); waitForVSync(); } } @@ -225,7 +241,8 @@ void DreamWebEngine::setPalette() { PaletteManager *palette = _system->getPaletteManager(); unsigned n = (uint16)_context.cx; uint8 *colors = _context.ds.ptr(_context.si, n * 3); - palette->setPalette(colors, _context.al, n); + //Common::hexdump(colors, n * 3); + //palette->setPalette(colors, _context.al, n); _context.si += n * 3; _context.cx = 0; } @@ -318,7 +335,7 @@ void quickquit2(Context &context) { } void keyboardread(Context &context) { - ::error("keyboardread"); + ::error("keyboardread"); //this keyboard int handler, must never be called } void resetkeyboard(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 1e9ace932b..5d2b71b23a 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -89,6 +89,9 @@ public: void fadeDos(); private: + + void keyPressed(uint16 ascii); + const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; Common::Point _mouse; -- cgit v1.2.3 From 5c629e3849a8ca97adfd077284ffd224a0c879c3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 11:46:54 +0400 Subject: DREAMWEB: fixed invalid memcpys --- engines/dreamweb/dreamweb.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c36e27a760..249e80cfb5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -138,7 +138,8 @@ void DreamWebEngine::processEvents() { } break; default: - keyPressed(event.kbd.ascii); + if (event.kbd.ascii) + keyPressed(event.kbd.ascii); break; } break; @@ -229,20 +230,22 @@ void DreamWebEngine::fadeDos() { if (dst[c]) { --dst[c]; } - dst[c] = c / 3; } //Common::hexdump(dst, 64 * 3); //palette->setPalette(dst, 0, 64); - waitForVSync(); + //waitForVSync(); } } void DreamWebEngine::setPalette() { + uint8 colors[768]; processEvents(); PaletteManager *palette = _system->getPaletteManager(); unsigned n = (uint16)_context.cx; - uint8 *colors = _context.ds.ptr(_context.si, n * 3); + uint8 *src = _context.ds.ptr(_context.si, n * 3); + for(int i = 0; i < n * 3; ++i) + colors[i] = src[i] * 3; //Common::hexdump(colors, n * 3); - //palette->setPalette(colors, _context.al, n); + palette->setPalette(colors, _context.al, n); _context.si += n * 3; _context.cx = 0; } @@ -267,7 +270,7 @@ void multiget(Context &context) { for(unsigned y = 0; y < h; ++y) { uint8 *src_p = context.ds.ptr(src + pitch * y, w); uint8 *dst_p = context.es.ptr(dst + w * y, w); - memcpy(src_p, dst_p, w); + memcpy(dst_p, src_p, w); } } @@ -281,7 +284,7 @@ void multiput(Context &context) { for(unsigned y = 0; y < h; ++y) { uint8 *src_p = context.ds.ptr(src + w * y, w); uint8 *dst_p = context.es.ptr(dst + pitch * y, w); - memcpy(src_p, dst_p, w); + memcpy(dst_p, src_p, w); } } @@ -295,7 +298,7 @@ void multidump(Context &context) { for(unsigned y = 0; y < h; ++y, offset += pitch * y) { uint8 *src_p = context.ds.ptr(offset, w); uint8 *dst_p = context.es.ptr(offset, w); - memcpy(src_p, dst_p, w); + memcpy(dst_p, src_p, w); } } @@ -308,7 +311,7 @@ void frameoutnm(Context &context) { for(unsigned y = 0; y < h; ++y) { uint8 *src_p = context.ds.ptr(src + w * y, w); uint8 *dst_p = context.es.ptr(dst + pitch * y, w); - memcpy(src_p, dst_p, w); + memcpy(dst_p, src_p, w); } } -- cgit v1.2.3 From 9109f36c042518ab78c1085ce8794e8aa3e4e87b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 10 Jun 2011 11:59:27 +0400 Subject: DREAMWEB: fixed typo in multidump --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 249e80cfb5..98efb3b85d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -295,7 +295,7 @@ void multidump(Context &context) { //debug(1, "multidump %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); unsigned pitch = (uint16)context.data.word(kScreenwidth); unsigned offset = (uint16)context.di + (uint16)context.bx * pitch; - for(unsigned y = 0; y < h; ++y, offset += pitch * y) { + for(unsigned y = 0; y < h; ++y, offset += pitch) { uint8 *src_p = context.ds.ptr(offset, w); uint8 *dst_p = context.es.ptr(offset, w); memcpy(dst_p, src_p, w); -- cgit v1.2.3 From 47ed2ce38578cc2148507815ebd60e205576c6d9 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Fri, 10 Jun 2011 20:19:26 +0200 Subject: DREAMWEB: Fix typo --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 98efb3b85d..39baa68e50 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -652,7 +652,7 @@ sameline: readabyte(context); context.cx = context.pop(); context._add(context.bx, context.cx); - if (--context.cx) context._stosb(); + while (--context.cx) context._stosb(); context._cmp(context.bx, 4 * 80); if (!context.flags.z()) goto sameline; goto endline; -- cgit v1.2.3 From 038f19dfe98756da94cbe3de47940951fae90e03 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 11 Jun 2011 11:29:02 +0200 Subject: DREAMWEB: The PCX decode works now. There will be cleanups, and quite possibly a complete rewrite, later. For now, this is encouraging enough. (The image looks wrong, but that's because something else draws over it almost immediately.) It currently cheats and sets the palette, where the original seems to just store it in a buffer. I don't know where this should be done. --- engines/dreamweb/dreamweb.cpp | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 39baa68e50..556ed11839 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -605,6 +605,9 @@ void readoneblock(Context &context) { void readabyte(Context & context); void showpcx(Context &context) { + Graphics::Surface *s = g_system->lockScreen(); + int y = 0; + openfile(context); context.ds = context.data.word(kWorkspace); context.cx = 128; @@ -616,6 +619,7 @@ void showpcx(Context &context) { context.cx = 48; context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; + uint8 *pal = context.es.ptr(context.di, 768); pcxpal: context.push(context.cx); readabyte(context); @@ -626,7 +630,18 @@ pcxpal: if (--context.cx) goto pcxpal; context.cx = 768 - 48; context.ax = 0x0ffff; - while (--context.cx) context._stosw(); + while (context.cx--) context._stosw(); + + // TODO: I think this is wrong. I mean, it's the right palette but I + // don't think this is the place to set it in the backend. + + byte pal16[48]; + for (int i = 0; i < 48; i++) { + pal16[i] = 4 * pal[i]; + } + + PaletteManager *palette = g_system->getPaletteManager(); + palette->setPalette(pal16, 0, 256); readoneblock(context); context.si = 0; @@ -639,6 +654,9 @@ convertpcx: context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60; context.bx = 0; + + uint8 *src = context.es.ptr(context.di, 320); + sameline: readabyte(context); context.ah = context.al; @@ -652,7 +670,7 @@ sameline: readabyte(context); context.cx = context.pop(); context._add(context.bx, context.cx); - while (--context.cx) context._stosb(); + while (context.cx--) context._stosb(); context._cmp(context.bx, 4 * 80); if (!context.flags.z()) goto sameline; goto endline; @@ -670,14 +688,30 @@ endline: context.si = 0+(228*13)+32+60; context.ds = context.data.word(kBuffers); - // TODO: There's a bunch of code here which I assume draws data to the - // screen or something like that. + uint8 *dst = (uint8 *)s->getBasePtr(0, y); + memset(dst, 0, 640); + + for (int i = 0; i < 320; i++) { + int plane = i / 80; + int pos = i % 80; + + for (int j = 0; j < 8; j++) { + byte bit = (src[i] >> (7 - j)) & 1; + dst[8 * pos + j] |= (bit << plane); + } + } context.si = context.pop(); context.cx = context.pop(); + + y++; + if (--context.cx) goto convertpcx; closefile(context); + + g_system->unlockScreen(); + g_system->updateScreen(); } } /*namespace dreamgen */ -- cgit v1.2.3 From 3f592047bb6e3558d9aca19e2e50fa2f533d8331 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 15:40:04 +0400 Subject: DREAMWEB: fixed rep prefix --- devtools/tasmrecover/tasm/cpp.py | 2 +- engines/dreamweb/dreamgen.cpp | 116 +++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 3caf21e6cf..0e87656bcc 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -393,7 +393,7 @@ namespace %s { self.body += p def _rep(self): - self.body += "\twhile(--context.cx) "; + self.body += "\twhile(context.cx--) "; def _lodsb(self): self.body += "\tcontext._lodsb();\n"; diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b27c44e5bc..81d76fe3a4 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2428,7 +2428,7 @@ void clearsprites(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); return; } @@ -2455,7 +2455,7 @@ void delsprite(Context & context) { context.di = context.bx; context.cx = (32); context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); return; } @@ -3646,7 +3646,7 @@ void updatepeople(Context & context) { context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context._add(context.data.word(kMaintimer), 1); context.es = context.cs; context.bx = 534; @@ -4040,7 +4040,7 @@ void cls(Context & context) { context.di = 0; context.cx = 0x7fff; context.ax = 0; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); return; } @@ -4344,7 +4344,7 @@ void delthisone(Context & context) { deloneloop: context.push(context.cx); context.ch = 0; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.cx = context.pop(); context._add(context.di, context.ax); context._add(context.si, context.dx); @@ -4953,7 +4953,7 @@ void transferinv(Context & context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; @@ -5000,7 +5000,7 @@ void transfermap(Context & context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; @@ -5036,7 +5036,7 @@ void clearendpal(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); return; } @@ -5062,7 +5062,7 @@ void fadetowhite(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 63; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.al = 0; context._stosb(); @@ -5081,7 +5081,7 @@ void fadefromwhite(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768; context.al = 63; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.al = 0; context._stosb(); @@ -5122,11 +5122,11 @@ halfend: context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3); context.cx = 3*5; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3); context.cx = 3*2; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; @@ -5418,7 +5418,7 @@ void paltostartpal(Context & context) { context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); return; } @@ -5428,7 +5428,7 @@ void endpaltostart(Context & context) { context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); return; } @@ -5438,7 +5438,7 @@ void startpaltoend(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); return; } @@ -5448,7 +5448,7 @@ void paltoendpal(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); return; } @@ -5458,7 +5458,7 @@ void allpalette(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); dumpcurrent(context); return; } @@ -5484,7 +5484,7 @@ void fadedownmon(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5504,7 +5504,7 @@ void fadeupmon(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5524,7 +5524,7 @@ void fadeupmonfirst(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5547,7 +5547,7 @@ void fadeupyellows(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5566,7 +5566,7 @@ void initialmoncols(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); context.cx = 3*9; context.ax = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -6495,7 +6495,7 @@ void findallryan(Context & context) { context.push(context.di); context.cx = 30; context.ax = 0x0ffff; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.di = context.pop(); context.cl = 4; context.ds = context.data.word(kExtras); @@ -6527,7 +6527,7 @@ void findallopen(Context & context) { context.push(context.di); context.cx = 16; context.ax = 0x0ffff; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.di = context.pop(); context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); @@ -8205,7 +8205,7 @@ void transfertoex(Context & context) { context.ds = context.data.word(kFreedat); context.si = context.ax; context.cx = 8; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); context.di = context.pop(); context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; @@ -8280,7 +8280,7 @@ void transfercontoex(Context & context) { context.ds = context.pop(); context.push(context.di); context.cx = 8; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); context.di = context.pop(); context.dx = context.pop(); context.al = context.data.byte(kReallocation); @@ -8439,7 +8439,7 @@ void deleteexobject(Context & context) { context.push(context.cx); context.al = 255; context.cx = 16; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.ax = context.pop(); context.cl = context.al; context._add(context.al, context.al); @@ -8497,7 +8497,7 @@ void deleteexframe(Context & context) { context._add(context.si, context.ax); context.push(context.ax); context.ds = context.es; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.bx = context.pop(); context._sub(context.data.word(kExframepos), context.bx); context.si = context.pop(); @@ -8538,7 +8538,7 @@ findlenextext: context.push(context.bx); context.push(context.ax); context._sub(context.cx, context.bx); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.bx = context.pop(); context._sub(context.data.word(kExtextpos), context.bx); context.si = context.pop(); @@ -8772,7 +8772,7 @@ oberase: context.di = context.bx; context.al = 255; context.cx = (32); - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); notthisob: context.bx = context.pop(); context.cx = context.pop(); @@ -8789,7 +8789,7 @@ void showallobs(Context & context) { context.di = context.bx; context.cx = 128*5; context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.es = context.data.word(kSetframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -8904,7 +8904,7 @@ void showallfree(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.cx = 80*5; context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.es = context.data.word(kFreeframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -8983,7 +8983,7 @@ void showallex(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.cx = 100*5; context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.es = context.data.word(kExtras); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -10051,12 +10051,12 @@ void usemon(Context & context) { context.di = 2892+1; context.cx = 12; context.al = 32; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.es = context.cs; context.di = 2883+1; context.cx = 12; context.al = 32; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.es = context.cs; context.di = 2807; context.es.byte(context.di) = 1; @@ -10412,7 +10412,7 @@ void input(Context & context) { context.di = 7816; context.cx = 64; context.al = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.data.word(kCurpos) = 0; context.al = '>'; context.di = context.data.word(kMonadx); @@ -10629,7 +10629,7 @@ dirroot: context.di = 2892; context._add(context.di, 1); context.cx = 12; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); monitorlogo(context); scrollmonitor(context); context.al = 9; @@ -10909,7 +10909,7 @@ keyok2: context.es = context.cs; context.di = 2892+1; context.cx = 12; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); monitorlogo(context); scrollmonitor(context); context.al = 10; @@ -11019,7 +11019,7 @@ void parser(Context & context) { context.di = 2883; context.cx = 13; context.al = 0; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.di = 2883; context.al = '='; context._stosb(); @@ -15984,7 +15984,7 @@ alreadyactsave: context.bx = context.di; context.es = context.cs; context.cx = 16; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); context.al = context.data.byte(kRoomssample); context.es.byte(context.bx+13) = context.al; context.al = context.data.byte(kMapx); @@ -16317,7 +16317,7 @@ void namestoold(Context & context) { context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); return; } @@ -16327,7 +16327,7 @@ void oldtonames(Context & context) { context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); return; } @@ -16566,7 +16566,7 @@ void trysoundalloc(Context & context) { context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.data.byte(kNeedsoundbuff) = 1; return; soundfail: @@ -16695,7 +16695,7 @@ notch0only: context.di = context.data.word(kSoundbufferwrite); context.cx = 1024; context.ax = 0x7f7f; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; return; @@ -16758,7 +16758,7 @@ void channel0tran(Context & context) { context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; - while(--context.cx) context._movsw(); + while(context.cx--) context._movsw(); return; lowvolumetran: context.cx = 1024; @@ -17161,24 +17161,24 @@ void clearbuffers(Context & context) { context.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; context.ax = 0; context.di = 0; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.es = context.data.word(kExtras); context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.es = context.data.word(kBuffers); context.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)); context.ds = context.cs; context.si = 534; context.cx = (991-534); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.es = context.data.word(kBuffers); context.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); context.ds = context.cs; context.si = 0; context.cx = (68-0); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); clearchanges(context); return; } @@ -17188,19 +17188,19 @@ void clearchanges(Context & context) { context.cx = (250)*2; context.ax = 0x0ffff; context.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)); - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.ds = context.data.word(kBuffers); context.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)); context.es = context.cs; context.di = 534; context.cx = (991-534); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.ds = context.data.word(kBuffers); context.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); context.es = context.cs; context.di = 0; context.cx = (68-0); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.data.byte(kExpos) = 0; context.data.word(kExframepos) = 0; context.data.word(kExtextpos) = 0; @@ -17208,7 +17208,7 @@ void clearchanges(Context & context) { context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.es = context.cs; context.di = 7782; context.al = 1; @@ -17220,7 +17220,7 @@ void clearchanges(Context & context) { context._stosb(); context.ax = 0; context.cx = 6; - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); return; } @@ -17249,7 +17249,7 @@ void clearrest(Context & context) { context.cx = (66*60)/2; context.ax = 0; context.di = (0); - while(--context.cx) context._stosw(); + while(context.cx--) context._stosw(); context.es = context.data.word(kBackdrop); deallocatemem(context); context.es = context.data.word(kSetframes); @@ -19052,7 +19052,7 @@ finishmakename: context._stosb(); return; context.al = 255; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); return; } @@ -20201,7 +20201,7 @@ blimey: context.push(context.cx); context.push(context.si); context.cx = (66); - while(--context.cx) context._movsb(); + while(context.cx--) context._movsb(); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 132); @@ -20450,7 +20450,7 @@ void fillspace(Context & context) { context.push(context.bx); context.di = context.dx; context.es = context.ds; - while(--context.cx) context._stosb(); + while(context.cx--) context._stosb(); context.bx = context.pop(); context.di = context.pop(); context.dx = context.pop(); -- cgit v1.2.3 From 9034191796702956e84067fd6cdfbc2bae1bf768 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 16:08:30 +0400 Subject: DREAMWEB: removed dummy video segment, blacklisted video-related functions. --- devtools/tasmrecover/tasm-recover | 14 +++++++- engines/dreamweb/dreamgen.cpp | 72 --------------------------------------- engines/dreamweb/dreamgen.h | 3 ++ engines/dreamweb/dreamweb.cpp | 60 +++++++++++++++++--------------- engines/dreamweb/dreamweb.h | 2 ++ engines/dreamweb/runtime.h | 10 ++---- 6 files changed, 53 insertions(+), 108 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 1763a2524d..4c27cb5939 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -7,5 +7,17 @@ p = parser() p.strip_path = 3 context = p.parse('dreamweb/dreamweb.asm') p.link() -generator = cpp(context, "dreamgen", blacklist = ['randomnumber', 'quickquit', 'quickquit2', 'seecommandtail', 'multiget', 'multiput', 'multidump', 'frameoutnm']) +generator = cpp(context, "dreamgen", blacklist = [ + 'randomnumber', + 'quickquit', + 'quickquit2', + 'seecommandtail', + 'multiget', + 'multiput', + 'multidump', + 'frameoutnm', + 'cls', + 'printundermon', + 'worktoscreen', + ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 81d76fe3a4..2cb71e061e 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -10,7 +10,6 @@ void readsetdata(Context &context); void loadpalfromiff(Context &context); void titles(Context &context); void credits(Context &context); -void cls(Context &context); void decide(Context &context); void clearchanges(Context &context); void loadroom(Context &context); @@ -60,7 +59,6 @@ void animpointer(Context &context); void showpointer(Context &context); void dumppointer(Context &context); void commandonly(Context &context); -void worktoscreen(Context &context); void showtime(Context &context); void showwatch(Context &context); void printmessage(Context &context); @@ -279,7 +277,6 @@ void modifychar(Context &context); void printchar(Context &context); void showcurrentfile(Context &context); void printlogo(Context &context); -void printundermon(Context &context); void randomaccess(Context &context); void locklighton(Context &context); void locklightoff(Context &context); @@ -430,7 +427,6 @@ void frameoutbh(Context &context); void frameoutv(Context &context); void putunderzoom(Context &context); void crosshair(Context &context); -void width160(Context &context); void maptopanel(Context &context); void movemap(Context &context); void dealwithspecial(Context &context); @@ -4034,71 +4030,6 @@ nought: return; } -void cls(Context & context) { - context.ax = 0x0a000; - context.es = context.ax; - context.di = 0; - context.cx = 0x7fff; - context.ax = 0; - while(context.cx--) context._stosw(); - return; -} - -void printundermon(Context & context) { - context.si = ((320)*43)+76; - context.di = context.si; - context.es = context.data.word(kWorkspace); - context._add(context.si, 8*(320)); - context.dx = 0x0a000; - context.ds = context.dx; - context.cx = 104; -scrollmonloop1: - context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.cx = 170; -scrollmonloop2: - context._lodsb(); - context._cmp(context.al, 231); - if (!context.flags.c()) goto dontplace; -placeit: - context._stosb(); - if (--context.cx) goto scrollmonloop2; - goto finmonscroll; -dontplace: - context._add(context.di, 1); - if (--context.cx) goto scrollmonloop2; -finmonscroll: - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.si, (320)); - context._add(context.di, (320)); - if (--context.cx) goto scrollmonloop1; - return; -} - -void worktoscreen(Context & context) { - vsync(context); - context.si = 0; - context.di = 0; - context.cx = 25; - context.ds = context.data.word(kWorkspace); - context.dx = 0x0a000; - context.es = context.dx; -dumpallloop: - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - width160(context); - if (--context.cx) goto dumpallloop; - return; -} - void paneltomap(Context & context) { context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); @@ -21321,9 +21252,6 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc1d4: readoneblock(context); break; case 0xc1d8: loadpalfromiff(context); break; case 0xc1dc: setmode(context); break; - case 0xc1e0: cls(context); break; - case 0xc1e4: printundermon(context); break; - case 0xc1e8: worktoscreen(context); break; case 0xc1ec: paneltomap(context); break; case 0xc1f0: maptopanel(context); break; case 0xc1f4: dumpmap(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index fcbf738a00..40e3539a0d 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -16,6 +16,9 @@ namespace dreamgen { void multiput(Context &context); void multidump(Context &context); void frameoutnm(Context &context); + void cls(Context &context); + void printundermon(Context &context); + void worktoscreen(Context &context); void keyboardread(Context &context); void resetkeyboard(Context &context); void setkeyboardint(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 556ed11839..4e24c4917f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -86,16 +86,6 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) { void DreamWebEngine::waitForVSync() { processEvents(); - Graphics::Surface *s = _system->lockScreen(); - if (!s) - error("lockScreen failed"); - for(int y = 0; y < 200; ++y) { - uint8 *scanline = (uint8*)s->getBasePtr(0, y); - uint8 *src = _context.video.ptr(y * 320, 320); - memcpy(scanline, src, 320); - } - _system->unlockScreen(); - _system->updateScreen(); /* while (!_vSyncInterrupt) { _system->delayMillis(10); @@ -220,6 +210,7 @@ void DreamWebEngine::setGraphicsMode() { } void DreamWebEngine::fadeDos() { + waitForVSync(); //processEvents will be called from vsync PaletteManager *palette = _system->getPaletteManager(); _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); @@ -231,9 +222,8 @@ void DreamWebEngine::fadeDos() { --dst[c]; } } - //Common::hexdump(dst, 64 * 3); - //palette->setPalette(dst, 0, 64); - //waitForVSync(); + palette->setPalette(dst, 0, 64); + waitForVSync(); } } void DreamWebEngine::setPalette() { @@ -242,7 +232,7 @@ void DreamWebEngine::setPalette() { PaletteManager *palette = _system->getPaletteManager(); unsigned n = (uint16)_context.cx; uint8 *src = _context.ds.ptr(_context.si, n * 3); - for(int i = 0; i < n * 3; ++i) + for(unsigned i = 0; i < n * 3; ++i) colors[i] = src[i] * 3; //Common::hexdump(colors, n * 3); palette->setPalette(colors, _context.al, n); @@ -250,6 +240,15 @@ void DreamWebEngine::setPalette() { _context.cx = 0; } +void DreamWebEngine::blit(uint8 *src, int pitch, int x, int y, int w, int h) { + _system->copyRectToScreen(src, pitch, x, y, w, h); +} + +void DreamWebEngine::cls() { + _system->fillScreen(0); +} + + } // End of namespace DreamWeb @@ -289,17 +288,25 @@ void multiput(Context &context) { } void multidump(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - context.es = 0xa000; - context.ds = context.data.word(kWorkspace); + int w = (uint8)context.cl, h = (uint8)context.ch; + int x = (int16)context.di, y = (int16)context.bx; + int pitch = (uint16)context.data.word(kScreenwidth); + unsigned offset = x + y * pitch; //debug(1, "multidump %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); - unsigned pitch = (uint16)context.data.word(kScreenwidth); - unsigned offset = (uint16)context.di + (uint16)context.bx * pitch; - for(unsigned y = 0; y < h; ++y, offset += pitch) { - uint8 *src_p = context.ds.ptr(offset, w); - uint8 *dst_p = context.es.ptr(offset, w); - memcpy(dst_p, src_p, w); - } + engine()->blit(context.ds.ptr(offset, w * h), pitch, x, y, w, h); +} + +void worktoscreen(Context &context) { + context.ds = context.data.word(kWorkspace); + engine()->blit(context.ds.ptr(0, 320 * 200), 320, 0, 0, 320, 200); +} + +void printundermon(Context &context) { + warning("printundermon: STUB"); +} + +void cls(Context &context) { + engine()->cls(); } void frameoutnm(Context &context) { @@ -579,12 +586,11 @@ void showgroup(Context &context) { } void fadedos(Context &context) { - vsync(context); engine()->fadeDos(); } void doshake(Context &context) { - ::error("doshake"); + warning("doshake: STUB"); } void vsync(Context &context) { @@ -683,8 +689,6 @@ normal: endline: context.di = context.pop(); context.push(context.si); - context.dx = 0xa000; - context.es = context.dx; context.si = 0+(228*13)+32+60; context.ds = context.data.word(kBuffers); diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 5d2b71b23a..3038de3652 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -87,6 +87,8 @@ public: void setGraphicsMode(); void setPalette(); void fadeDos(); + void blit(uint8 *src, int pitch, int x, int y, int w, int h); + void cls(); private: diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 525a4df5b9..80ab8db384 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -199,7 +199,7 @@ class Context { FreeSegmentList _freeSegments; public: - enum { kDefaultDataSegment = 0x1000, kVideoSegment = 0xa000 }; + enum { kDefaultDataSegment = 0x1000 }; Register ax, dx, bx, cx, si, di; LowPartOfRegister al; @@ -211,21 +211,17 @@ public: LowPartOfRegister dl; HighPartOfRegister dh; - SegmentRef cs, ds, es, data, video; + SegmentRef cs, ds, es, data; //data == fake segment register always pointing to data segment Flags flags; inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), - cs(this), ds(this), es(this), data(this), video(this) { + cs(this), ds(this), es(this), data(this) { _segments[kDefaultDataSegment] = SegmentPtr(new Segment()); - _segments[kVideoSegment] = SegmentPtr(new Segment()); - _segments[kVideoSegment]->data.resize(0x10000); - cs.reset(kDefaultDataSegment); ds.reset(kDefaultDataSegment); es.reset(kDefaultDataSegment); data.reset(kDefaultDataSegment); - video.reset(kVideoSegment); } SegmentRef getSegment(uint16 value) { -- cgit v1.2.3 From c8be54bbd85c0d86452cdd1f3b614e12dd52c7f0 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 11 Jun 2011 14:02:01 +0200 Subject: DREAMWEB: Cleaned up the PCX decoder slightly --- engines/dreamweb/dreamweb.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 4e24c4917f..788f98f148 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -612,7 +612,6 @@ void readabyte(Context & context); void showpcx(Context &context) { Graphics::Surface *s = g_system->lockScreen(); - int y = 0; openfile(context); context.ds = context.data.word(kWorkspace); @@ -688,11 +687,9 @@ normal: endline: context.di = context.pop(); - context.push(context.si); - context.si = 0+(228*13)+32+60; - context.ds = context.data.word(kBuffers); + context.cx = context.pop(); - uint8 *dst = (uint8 *)s->getBasePtr(0, y); + uint8 *dst = (uint8 *)s->getBasePtr(0, 480 - (uint16)context.cx); memset(dst, 0, 640); for (int i = 0; i < 320; i++) { @@ -705,16 +702,13 @@ endline: } } - context.si = context.pop(); - context.cx = context.pop(); - - y++; - if (--context.cx) goto convertpcx; closefile(context); g_system->unlockScreen(); + + // TODO: This is probably not the right place to do this g_system->updateScreen(); } -- cgit v1.2.3 From d70bc05b8e2afb87a9a0033119fd312073905485 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 16:15:06 +0400 Subject: DREAMWEB: added assertion --- engines/dreamweb/dreamweb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 788f98f148..9445f7f432 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -689,6 +689,7 @@ endline: context.di = context.pop(); context.cx = context.pop(); + assert((uint16)context.cx <= 480); uint8 *dst = (uint8 *)s->getBasePtr(0, 480 - (uint16)context.cx); memset(dst, 0, 640); -- cgit v1.2.3 From fd1360096b88156eb0eb4ef8305b5d62216c8248 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 16:27:36 +0400 Subject: DREAMWEB: replace pitch with kScreenwidth --- engines/dreamweb/dreamweb.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 9445f7f432..e0ed987e99 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -260,14 +260,13 @@ static inline DreamWeb::DreamWebEngine *engine() { void multiget(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned pitch = (uint16)context.data.word(kScreenwidth); - unsigned src = (uint16)context.di + (uint16)context.bx * pitch; + unsigned src = (uint16)context.di + (uint16)context.bx * kScreenwidth; unsigned dst = (uint16)context.si; context.es = context.ds; context.ds = context.data.word(kWorkspace); //debug(1, "multiget %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); for(unsigned y = 0; y < h; ++y) { - uint8 *src_p = context.ds.ptr(src + pitch * y, w); + uint8 *src_p = context.ds.ptr(src + kScreenwidth * y, w); uint8 *dst_p = context.es.ptr(dst + w * y, w); memcpy(dst_p, src_p, w); } @@ -275,14 +274,13 @@ void multiget(Context &context) { void multiput(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned pitch = (uint16)context.data.word(kScreenwidth); unsigned src = (uint16)context.si; - unsigned dst = (uint16)context.di + (uint16)context.bx * pitch; + unsigned dst = (uint16)context.di + (uint16)context.bx * kScreenwidth; context.es = context.data.word(kWorkspace); //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); for(unsigned y = 0; y < h; ++y) { uint8 *src_p = context.ds.ptr(src + w * y, w); - uint8 *dst_p = context.es.ptr(dst + pitch * y, w); + uint8 *dst_p = context.es.ptr(dst + kScreenwidth * y, w); memcpy(dst_p, src_p, w); } } @@ -290,10 +288,9 @@ void multiput(Context &context) { void multidump(Context &context) { int w = (uint8)context.cl, h = (uint8)context.ch; int x = (int16)context.di, y = (int16)context.bx; - int pitch = (uint16)context.data.word(kScreenwidth); - unsigned offset = x + y * pitch; - //debug(1, "multidump %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); - engine()->blit(context.ds.ptr(offset, w * h), pitch, x, y, w, h); + unsigned offset = x + y * kScreenwidth; + debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); + engine()->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); } void worktoscreen(Context &context) { -- cgit v1.2.3 From 938c14ddacbeb3669012bc64eab92a0f2d0654a9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 16:52:05 +0400 Subject: DREAMWEB: increased vga frequency to 70Hz, fixed data segments --- engines/dreamweb/dreamweb.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index e0ed987e99..cab9863911 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -86,12 +86,12 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) { void DreamWebEngine::waitForVSync() { processEvents(); -/* + while (!_vSyncInterrupt) { _system->delayMillis(10); } setVSyncInterrupt(false); -*/ + // doshake // dofade } @@ -144,7 +144,8 @@ Common::Error DreamWebEngine::run() { _mouseState = 0; _console = new DreamWebConsole(this); - getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this); + getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); + //http://martin.hinner.info/vga/timing.html dreamgen::__start(_context); @@ -226,6 +227,7 @@ void DreamWebEngine::fadeDos() { waitForVSync(); } } + void DreamWebEngine::setPalette() { uint8 colors[768]; processEvents(); @@ -286,7 +288,10 @@ void multiput(Context &context) { } void multidump(Context &context) { + context.ds = context.data.word(kWorkspace); int w = (uint8)context.cl, h = (uint8)context.ch; + if (w == 0 || h == 0) + return; int x = (int16)context.di, y = (int16)context.bx; unsigned offset = x + y * kScreenwidth; debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); -- cgit v1.2.3 From d0404f4b617730024d28d56632821ea403bf8cb0 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 17:20:00 +0400 Subject: DREAMWEB: moved palette fixes into set/getPalette --- engines/dreamweb/dreamweb.cpp | 30 ++++++++++++++++++++---------- engines/dreamweb/dreamweb.h | 5 ++++- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index cab9863911..12a43a9a22 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -213,36 +213,46 @@ void DreamWebEngine::setGraphicsMode() { void DreamWebEngine::fadeDos() { waitForVSync(); //processEvents will be called from vsync - PaletteManager *palette = _system->getPaletteManager(); _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); uint8 *dst = _context.es.ptr(dreamgen::kStartpal, 768); - palette->grabPalette(dst, 0, 64); + 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]; } } - palette->setPalette(dst, 0, 64); + setPalette(dst, 0, 64); waitForVSync(); } } void DreamWebEngine::setPalette() { - uint8 colors[768]; processEvents(); - PaletteManager *palette = _system->getPaletteManager(); unsigned n = (uint16)_context.cx; uint8 *src = _context.ds.ptr(_context.si, n * 3); - for(unsigned i = 0; i < n * 3; ++i) - colors[i] = src[i] * 3; - //Common::hexdump(colors, n * 3); - palette->setPalette(colors, _context.al, n); + setPalette(src, _context.al, n); _context.si += n * 3; _context.cx = 0; } -void DreamWebEngine::blit(uint8 *src, int pitch, int x, int y, int w, int h) { +void DreamWebEngine::getPalette(uint8 *data, uint start, uint count) { + _system->getPaletteManager()->grabPalette(data, start, 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) { + 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) { _system->copyRectToScreen(src, pitch, x, y, w, h); } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 3038de3652..0666bb8518 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -87,8 +87,11 @@ public: void setGraphicsMode(); void setPalette(); void fadeDos(); - void blit(uint8 *src, int pitch, int x, int y, int w, int h); + 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); private: -- cgit v1.2.3 From b01af82d09973ec72ff9d81ec2fd0f719465f133 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 11 Jun 2011 16:55:57 +0200 Subject: DREAMWEB: Make it easier to quit (albeit not yet very gracefully) --- engines/dreamweb/dreamweb.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 12a43a9a22..da6c5903d5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -99,11 +99,12 @@ void DreamWebEngine::waitForVSync() { void DreamWebEngine::processEvents() { Common::EventManager *event_manager = _system->getEventManager(); Common::Event event; + if (event_manager->shouldQuit()) { + warning("Engine should quit gracefully (but doesn't yet)"); + g_system->quit(); + } while (event_manager->pollEvent(event)) { switch(event.type) { - case Common::EVENT_RTL: - warning("quit requested"); - return; case Common::EVENT_LBUTTONDOWN: _mouseState |= 1; break; -- cgit v1.2.3 From 9b7b93e8ea19c878544458f50c9469e24468963a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 19:22:21 +0400 Subject: DREAMWEB: fixed fades and palette setting --- engines/dreamweb/dreamweb.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index da6c5903d5..3de79a6e5d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -44,6 +44,11 @@ #include "dreamweb/dreamweb.h" #include "dreamweb/dreamgen.h" +namespace dreamgen { + void doshake(dreamgen::Context &context); + void dofade(dreamgen::Context &context); +} + namespace DreamWeb { DreamWebEngine *DreamWebEngine::_instance; @@ -92,8 +97,9 @@ void DreamWebEngine::waitForVSync() { } setVSyncInterrupt(false); - // doshake - // dofade + dreamgen::doshake(_context); + dreamgen::dofade(_context); + _system->updateScreen(); } void DreamWebEngine::processEvents() { @@ -212,6 +218,7 @@ void DreamWebEngine::setGraphicsMode() { } void DreamWebEngine::fadeDos() { + return; //fixme later waitForVSync(); //processEvents will be called from vsync _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); @@ -603,7 +610,7 @@ void fadedos(Context &context) { } void doshake(Context &context) { - warning("doshake: STUB"); + //warning("doshake: STUB"); } void vsync(Context &context) { @@ -611,6 +618,7 @@ void vsync(Context &context) { } void setmode(Context &context) { + vsync(context); engine()->setGraphicsMode(); } @@ -637,7 +645,7 @@ void showpcx(Context &context) { context.cx = 48; context.es = context.data.word(kBuffers); context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - uint8 *pal = context.es.ptr(context.di, 768); + pcxpal: context.push(context.cx); readabyte(context); @@ -649,18 +657,6 @@ pcxpal: context.cx = 768 - 48; context.ax = 0x0ffff; while (context.cx--) context._stosw(); - - // TODO: I think this is wrong. I mean, it's the right palette but I - // don't think this is the place to set it in the backend. - - byte pal16[48]; - for (int i = 0; i < 48; i++) { - pal16[i] = 4 * pal[i]; - } - - PaletteManager *palette = g_system->getPaletteManager(); - palette->setPalette(pal16, 0, 256); - readoneblock(context); context.si = 0; context.di = 0; -- cgit v1.2.3 From 3ecd3f9ca1a1b530bc01d5090ff91ed5d8dbe306 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 11 Jun 2011 19:23:43 +0400 Subject: DREAMWEB: commented out noisy debug --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 3de79a6e5d..5b5f2c241f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -312,7 +312,7 @@ void multidump(Context &context) { return; int x = (int16)context.di, y = (int16)context.bx; unsigned offset = x + y * kScreenwidth; - debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); + //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); engine()->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); } -- cgit v1.2.3 From 985d2facf23718bf2dc6672914fc6dd4a59e8193 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 11 Jun 2011 20:44:58 +0200 Subject: DREAMWEB: Notice when the user presses ESC. Unfortunately, skipping the intro does not work because of a stack underrun. I have no idea what's wrong. --- engines/dreamweb/dreamweb.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 5b5f2c241f..6eee2e1e10 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -135,6 +135,16 @@ void DreamWebEngine::processEvents() { } break; default: + // As far as I can see, the only keys checked + // for in 'lasthardkey' are 1 (ESC) and 57 + // (space) so add special cases for them and + // treat everything else as 0. + if (event.kbd.keycode == Common::KEYCODE_ESCAPE) + _context.data.byte(dreamgen::kLasthardkey) = 1; + else if (event.kbd.keycode == Common::KEYCODE_SPACE) + _context.data.byte(dreamgen::kLasthardkey) = 57; + else + _context.data.byte(dreamgen::kLasthardkey) = 0; if (event.kbd.ascii) keyPressed(event.kbd.ascii); break; -- cgit v1.2.3 From 92e2dc8899080a591e322bca3ec3e99e2ab12e6b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 00:55:23 +0400 Subject: DREAMWEB: cut rendering box to the screen size --- engines/dreamweb/dreamweb.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6eee2e1e10..7a9619d1c6 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -271,6 +271,12 @@ void DreamWebEngine::setPalette(const uint8 *data, uint start, uint count) { void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int h) { + if (y + h > 200) + h = 200 - y; + if (x + w > 320) + w = 320 - x; + if (h <= 0 || w <= 0) + return; _system->copyRectToScreen(src, pitch, x, y, w, h); } @@ -318,8 +324,6 @@ void multiput(Context &context) { void multidump(Context &context) { context.ds = context.data.word(kWorkspace); int w = (uint8)context.cl, h = (uint8)context.ch; - if (w == 0 || h == 0) - return; int x = (int16)context.di, y = (int16)context.bx; unsigned offset = x + y * kScreenwidth; //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); -- cgit v1.2.3 From 3e605f3cc41639d6d39a9ec7d1cc4369e50f24a2 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 01:37:12 +0400 Subject: DREAMWEB: regenerated sources --- engines/dreamweb/dreamgen.cpp | 56 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2cb71e061e..56d57bee71 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5622,12 +5622,19 @@ void biblequote(Context & context) { fadescreenups(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto biblequotearly; context.cx = 560; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto biblequotearly; fadescreendowns(context); context.cx = 200; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto biblequotearly; cancelch0(context); +biblequotearly: return; } @@ -5639,10 +5646,7 @@ hangonloope: context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; - return; hangonearly: - context.ax = context.pop(); - context.ax = context.pop(); return; } @@ -5662,21 +5666,30 @@ void intro(Context & context) { playchannel0(context); fadescreenups(context); runintroseq(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto introearly; clearbeforeload(context); context.data.byte(kNewlocation) = 52; loadintroroom(context); runintroseq(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto introearly; clearbeforeload(context); context.data.byte(kNewlocation) = 53; loadintroroom(context); runintroseq(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto introearly; clearbeforeload(context); allpalette(context); context.data.byte(kNewlocation) = 54; loadintroroom(context); runintroseq(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto introearly; getridoftemptext(context); clearbeforeload(context); +introearly: return; } @@ -5707,8 +5720,6 @@ moreintroseq: if (!context.flags.z()) goto moreintroseq; return; earlyendrun: - context.ax = context.pop(); - context.ax = context.pop(); getridoftemptext(context); clearbeforeload(context); return; @@ -5769,12 +5780,18 @@ void realcredits(Context & context) { playchannel0(context); context.cx = 2; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.dx = 2403; showpcx(context); context.al = 12; @@ -5782,12 +5799,18 @@ void realcredits(Context & context) { playchannel0(context); context.cx = 2; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.dx = 2416; showpcx(context); context.al = 12; @@ -5795,12 +5818,18 @@ void realcredits(Context & context) { playchannel0(context); context.cx = 2; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.dx = 2429; showpcx(context); context.al = 12; @@ -5808,12 +5837,18 @@ void realcredits(Context & context) { playchannel0(context); context.cx = 2; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.dx = 2442; showpcx(context); context.al = 12; @@ -5821,25 +5856,36 @@ void realcredits(Context & context) { playchannel0(context); context.cx = 2; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.dx = 2455; showpcx(context); fadescreenups(context); context.cx = 60; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; context.al = 13; context.ah = 0; playchannel0(context); context.cx = 350; hangone(context); + context._cmp(context.data.byte(kLasthardkey), 1); + if (context.flags.z()) goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); +realcreditsearly: return; } -- cgit v1.2.3 From 53e49d1a508e6864a67582716b9752d2edafdd55 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 01:42:42 +0400 Subject: DREAMWEB: removed unused file --- devtools/tasmrecover/runtime.h | 330 ----------------------------------------- 1 file changed, 330 deletions(-) delete mode 100644 devtools/tasmrecover/runtime.h diff --git a/devtools/tasmrecover/runtime.h b/devtools/tasmrecover/runtime.h deleted file mode 100644 index 5824728283..0000000000 --- a/devtools/tasmrecover/runtime.h +++ /dev/null @@ -1,330 +0,0 @@ -#ifndef TASM_RECOVER_H__ -#define TASM_RECOVER_H__ - -#include -#include -#include - -typedef uint16_t uint16; -typedef uint8_t uint8; -typedef int16_t int16; -typedef int8_t int8; - -//little endian -#define REG_LOW 0 -#define REG_HIGH 1 - -struct Register { - union { - uint16 _value; - uint8 _part[2]; - }; - inline Register(): _value() {} - inline Register& operator=(uint16_t v) { _value = v; return *this; } - inline operator uint16&() { return _value; } - inline void cbw() { - if (_value & 0x80) - _value |= 0xff00; - else - _value &= 0xff; - } -}; - -template -struct RegisterPart { - uint8_t &_part; - - inline RegisterPart(Register ®) : _part(reg._part[PART]) {} - - inline operator uint8&() { - return _part; - } - inline RegisterPart& operator=(const RegisterPart& o) { - _part = o._part; - return *this; - } - inline RegisterPart& operator=(uint8_t v) { - _part = v; - return *this; - } -}; - -struct WordRef { - std::vector &data; - unsigned index; - bool changed; - uint16_t value; - - inline WordRef(std::vector &data, unsigned index) : data(data), index(index), changed(false) { - assert(index + 1 < data.size()); - value = data[index] | (data[index + 1] << 8); - } - inline WordRef& operator=(const WordRef &ref) { - changed = true; - value = ref.value; - return *this; - } - inline WordRef& operator=(uint16_t v) { - changed = true; - value = v; - return *this; - } - inline operator uint16_t() const { - return value; - } - inline operator uint16_t&() { - return value; - } - inline ~WordRef() { - if (changed) { - data[index] = value & 0xff; - data[index + 1] = value >> 8; - } - } -}; - -struct Segment { - std::vector data; - inline uint8_t &byte(unsigned index) { - assert(index < data.size()); - return data[index]; - } - inline uint16_t word(unsigned index) const { - assert(index + 1 < data.size()); - return data[index] | (data[index + 1] << 8); - } - - inline WordRef word(unsigned index) { - return WordRef(data, index); - } -}; - - -struct SegmentRef { - public: - uint16_t value; - std::vector *data; - inline SegmentRef& operator=(const SegmentRef &o) { - data = o.data; - return *this; - } - inline SegmentRef& operator=(const uint16_t id) { - return *this; - } - inline uint8_t &byte(unsigned index) { - assert(index < data->size()); - return (*data)[index]; - } - inline uint16_t word(unsigned index) const { - assert(index + 1 < data->size()); - return (*data)[index] | ((*data)[index + 1] << 8); - } - - inline operator uint16_t() const { - return value; - } - - inline WordRef word(unsigned index) { - return WordRef(*data, index); - } -}; - -struct Flags { - bool _z, _c, _s, _o; - inline Flags(): _z(true), _c(false), _s(false), _o(false) {} - - inline bool z() const { return _z; } - inline bool c() const { return _c; } - inline bool s() const { return _s; } - //complex flags: - inline bool g() const { return !_z && _s == _o; } - inline bool ge() const { return _z || _s == _o; } - inline bool l() const { return !_z && _s != _o; } - inline bool le() const { return _z || _s != _o; } - - inline void update_sign(uint8 v) { - bool s = v & 0x80; - _o = s != _s; - _s = s; - _z = v == 0; - } - - inline void update(uint16 v) { - bool s = v & 0x8000; - _o = s != _s; - _s = s; - _z = v == 0; - } -}; - -template -struct RegisterContext { - Register ax, dx, bx, cx, si, di; - RegisterPart al; - RegisterPart ah; - RegisterPart bl; - RegisterPart bh; - RegisterPart cl; - RegisterPart ch; - RegisterPart dl; - RegisterPart dh; - - SegmentRef cs, ds, es; - Flags flags; - - inline RegisterContext(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx) {} - - inline void _cmp(uint8 a, uint8 b) { - uint8 x = a; - _sub(x, b); - } - inline void _cmp(uint16 a, uint16 b) { - uint16 x = a; - _sub(x, b); - } - inline void _test(uint8 a, uint8 b) { - uint8 x = a; - _and(x, b); - } - inline void _test(uint16 a, uint16 b) { - uint16 x = a; - _and(x, b); - } - - inline void _add(uint8 &dst, uint8 src) { - flags._c = dst + src < dst; - dst += src; - flags.update(dst); - } - inline void _add(uint16 &dst, uint16 src) { - flags._c = dst + src < dst; - dst += src; - flags.update(dst); - } - inline void _sub(uint8 &dst, uint8 src) { - flags._c = dst < src; - dst -= src; - flags.update(dst); - } - inline void _sub(uint16 &dst, uint16 src) { - flags._c = dst < src; - dst -= src; - flags.update(dst); - } - - inline void _and(uint8 &dst, uint8 src) { - dst &= src; - flags._c = false; - flags.update(dst); - } - inline void _and(uint16 &dst, uint16 src) { - dst &= src; - flags._c = false; - flags.update(dst); - } - inline void _or(uint8 &dst, uint8 src) { - dst |= src; - flags._c = false; - flags.update(dst); - } - inline void _or(uint16 &dst, uint16 src) { - dst |= src; - flags._c = false; - flags.update(dst); - } - - inline void _xor(uint8 &dst, uint8 src) { - dst ^= src; - flags._c = false; - flags.update(dst); - } - inline void _xor(uint16 &dst, uint16 src) { - dst ^= src; - flags._c = false; - flags.update(dst); - } - - inline void _shr(uint8 &dst, uint8 src) {} - inline void _shr(uint16 &dst, uint8 src) {} - inline void _shl(uint8 &dst, uint8 src) {} - inline void _shl(uint16 &dst, uint8 src) {} - inline void _mul(uint8 src) { - unsigned r = unsigned(al) * src; - ax = (uint16)r; - flags._c = r >= 0x10000; - flags._z = r == 0; - bool s = r & 0x8000; - flags._o = s != flags._s; - flags._s = s; - } - inline void _mul(uint16 src) { - unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits - dx = (r >> 16) & 0xffff; - ax = r & 0xffff; - flags._c = false;//fixme - flags._z = r == 0; - bool s = r & 0x80000000; - flags._o = s != flags._s; - flags._s = s; - } - inline void _neg(uint8 &src) { - src = ~src; - flags._c = false; - flags.update(src); - } - inline void _neg(uint16 &src) { - src = ~src; - flags._c = false; - flags.update(src); - } - - inline void _movsb() { - es.byte(di++) = ds.byte(si++); - } - inline void _movsw() { - es.word(di) = ds.word(si); - di += 2; - si += 2; - } - inline void _lodsb() { - al = ds.byte(si++); - } - inline void _lodsw() { - ax = ds.word(si); - si += 2; - } - inline void _stosb() { - es.byte(di++) = al; - } - inline void _stosw() { - es.word(di) = al; - di += 2; - } - - inline void _xchg(uint16 &a, uint16 &b) { - uint16 x = a; - a = b; - b = x; - } - - inline void _xchg(uint8 &a, uint8 &b) { - uint8 t = a; - a = b; - b = t; - } - - std::vector stack; - inline void push(uint16 v) { - stack.push_back(v); - } - inline uint16 pop() { - uint16 v = stack.back(); - stack.pop_back(); - return v; - } - - Data data; -}; - -#endif - -- cgit v1.2.3 From f7b56a0d94bcf710ca52292577457a999d2a9fa8 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 01:57:07 +0400 Subject: DREAMWEB: fixed OF register handling once again --- engines/dreamweb/runtime.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 80ab8db384..b08d564b8e 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -177,17 +177,17 @@ struct Flags { _z = v == 0; } - inline void update_o(uint8 v, uint8 old) { - _o = (old & 0x80) != (v & 0x80); - } - inline void update(uint16 v) { _s = v & 0x8000; _z = v == 0; } + inline void update_o(uint8 v, uint8 old) { + _o = (old & 0x80) != (v & 0x80); + } + inline void update_o(uint16 v, uint16 old) { - _o = (old & 0x8000) == (v & 0x8000); + _o = (old & 0x8000) != (v & 0x8000); } }; -- cgit v1.2.3 From 4ccd7fd791e117117034925870dc4db2bfdad7b3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 02:11:10 +0400 Subject: DREAMWEB: fixed l/le/g/ge condition checks --- engines/dreamweb/runtime.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index b08d564b8e..9890f950b6 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -167,10 +167,10 @@ struct Flags { inline bool c() const { return _c; } inline bool s() const { return _s; } //complex flags: - inline bool g() const { return !_z && _s == _o; } - inline bool ge() const { return _s == _o; } - inline bool l() const { return _s != _o; } - inline bool le() const { return _z || _s != _o; } + inline bool g() const { return !_z && _o; } + inline bool ge() const { return _o; } + inline bool l() const { return !_o; } + inline bool le() const { return _z || !_o; } inline void update(uint8 v) { _s = v & 0x80; -- cgit v1.2.3 From 2bcc06f9eae89dcdc45a5430aa0e0395c2fa576e Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 02:20:28 +0400 Subject: DREAMWEB: cleanup frameoutnm --- engines/dreamweb/dreamweb.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 7a9619d1c6..b5e2a1328c 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -347,11 +347,12 @@ void frameoutnm(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; unsigned pitch = (uint16)context.dx; unsigned src = (uint16)context.si; - unsigned dst = (uint16)context.di + (uint16)context.bx * pitch; - //debug(1, "framenm %ux%u[pitch: %u] -> segment: %04x->%04x", w, h, pitch, (uint16)context.ds, (uint16)context.es); - for(unsigned y = 0; y < h; ++y) { - uint8 *src_p = context.ds.ptr(src + w * y, w); - uint8 *dst_p = context.es.ptr(dst + pitch * y, w); + int x = (uint16)context.di, y = (uint16)context.bx; + unsigned dst = x + y * pitch; + //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)context.ds, (uint16)context.es); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + w * l, w); + uint8 *dst_p = context.es.ptr(dst + pitch * l, w); memcpy(dst_p, src_p, w); } } -- cgit v1.2.3 From 99a4bb86ddc6ab58d11c1cbab2ca2ff01aa8f835 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 11:44:34 +0400 Subject: DREAMWEB: fixed invalid generated jump instructions --- devtools/tasmrecover/tasm/cpp.py | 4 ++-- engines/dreamweb/dreamgen.cpp | 6 +++--- engines/dreamweb/runtime.h | 22 ++++++++++------------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 0e87656bcc..20af0ea632 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -353,13 +353,13 @@ namespace %s { self.body += "\tif (context.flags.l()) %s;\n" %(self.jump_to_label(label)) def _jg(self, label): - self.body += "\tif (!context.flags.g()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.le()) %s;\n" %(self.jump_to_label(label)) def _jle(self, label): self.body += "\tif (context.flags.le()) %s;\n" %(self.jump_to_label(label)) def _jge(self, label): - self.body += "\tif (!context.flags.ge()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.l()) %s;\n" %(self.jump_to_label(label)) def _jc(self, label): self.body += "\tif (context.flags.c()) %s;\n" %(self.jump_to_label(label)) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 56d57bee71..16e4958c89 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -17818,13 +17818,13 @@ loop048: if (context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+2); context._cmp(context.data.word(kMousex), context.ax); - if (!context.flags.ge()) goto over045; + if (!context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+4); context._cmp(context.data.word(kMousey), context.ax); if (context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+6); context._cmp(context.data.word(kMousey), context.ax); - if (!context.flags.ge()) goto over045; + if (!context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+8); __dispatch_call(context, context.ax); finished: @@ -18859,7 +18859,7 @@ vertline: context.bx = context.data.word(kLineendy); context.cx = context.bx; context._sub(context.cx, context.ax); - if (!context.flags.ge()) goto line31; + if (!context.flags.l()) goto line31; context._neg(context.cx); context.ax = context.bx; context.data.byte(kLinedirection) = 1; diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 9890f950b6..d92a8d6a2b 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -166,11 +166,9 @@ struct Flags { inline bool z() const { return _z; } inline bool c() const { return _c; } inline bool s() const { return _s; } - //complex flags: - inline bool g() const { return !_z && _o; } - inline bool ge() const { return _o; } - inline bool l() const { return !_o; } - inline bool le() const { return _z || !_o; } + + inline bool l() const { return _o; } + inline bool le() const { return _o || _z; } inline void update(uint8 v) { _s = v & 0x80; @@ -270,7 +268,7 @@ public: inline void _add(uint8 &dst, uint8 src) { unsigned r = (unsigned)dst + src; - flags.update_o(r, dst); + flags.update_o((uint8)r, dst); flags._c = r >= 0x100; dst = r; flags.update(dst); @@ -278,21 +276,21 @@ public: inline void _add(uint16 &dst, uint16 src) { unsigned r = (unsigned)dst + src; - flags.update_o(r, dst); + flags.update_o((uint16)r, dst); flags._c = r >= 0x10000; dst = r; flags.update(dst); } inline void _sub(uint8 &dst, uint8 src) { - flags.update_o(dst - src, dst); + flags.update_o(uint8(dst - src), dst); flags._c = dst < src; dst -= src; flags.update(dst); } inline void _sub(uint16 &dst, uint16 src) { - flags.update_o(dst - src, dst); + flags.update_o(uint16(dst - src), dst); flags._c = dst < src; dst -= src; flags.update(dst); @@ -383,21 +381,21 @@ public: inline void _mul(uint8 src) { unsigned r = unsigned(al) * src; - flags.update_o(r, al); ax = (uint16)r; flags._c = r >= 0x10000; flags._z = r == 0; flags._s = r & 0x8000; + flags._o = ah != 0; } inline void _mul(uint16 src) { unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits - flags.update_o(r, ax); dx = (r >> 16) & 0xffff; ax = r & 0xffff; - flags._c = false;//fixme + flags._c = false; flags._z = r == 0; flags._s = r & 0x80000000; + flags._o = dx != 0; } inline void _neg(uint8 &src) { -- cgit v1.2.3 From 8ea7a7a3d1e92bfd9b8f4836cba4492bb91fc8da Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 12:05:59 +0400 Subject: DREAMWEB: fixed seg XXX construction in generator --- devtools/tasmrecover/tasm/cpp.py | 2 +- engines/dreamweb/dreamgen.cpp | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 20af0ea632..5126cd6d4f 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -125,7 +125,7 @@ namespace %s { m = re.match(r'seg\s+(.*?)$', expr) if m is not None: - return "context.ds" + return "context.data" match_id = True m = re.match(r'offset\s+(.*?)$', expr) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 16e4958c89..cad1987df4 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2760,7 +2760,7 @@ continuewalk: context._add(context.ax, context.ax); context.push(context.es); context.push(context.bx); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.bx = 7944; context._add(context.bx, context.ax); @@ -9807,14 +9807,14 @@ void getdestinfo(Context & context) { context.al = context.data.byte(kDestpos); context.ah = 0; context.push(context.ax); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.si = 7782; context._add(context.si, context.ax); context.cl = context.es.byte(context.si); context.ax = context.pop(); context.push(context.cx); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.si = 7798; context._add(context.si, context.ax); @@ -9942,7 +9942,7 @@ notrav: void getlocation(Context & context) { context.ah = 0; context.bx = context.ax; - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context._add(context.bx, 7782); context.al = context.es.byte(context.bx); @@ -9952,7 +9952,7 @@ void getlocation(Context & context) { void setlocation(Context & context) { context.ah = 0; context.bx = context.ax; - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context._add(context.bx, 7782); context.es.byte(context.bx) = 1; @@ -9999,7 +9999,7 @@ clearedlocations: context.ax = context.pop(); context.ah = 0; context.bx = context.ax; - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context._add(context.bx, 7782); context.es.byte(context.bx) = 0; @@ -11303,7 +11303,7 @@ powerok: context.data.byte(kPointerpower) = 0; nodream7: getanyad(context); - context.dx = context.ds; + context.dx = context.data; context.ds = context.dx; context.si = 2895; checkuselist: @@ -12248,7 +12248,7 @@ void opensarters(Context & context) { } void isitright(Context & context) { - context.bx = context.ds; + context.bx = context.data; context.es = context.bx; context.bx = 8344; context._cmp(context.es.byte(context.bx+0), context.al); @@ -14301,7 +14301,7 @@ void addtopresslist(Context & context) { context.al = 0; not10: context.bx = context.data.word(kPresspointer); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context._add(context.bx, 8344); context.es.byte(context.bx) = context.al; @@ -15810,7 +15810,7 @@ loadops: context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.bx = 7750; startloading(context); @@ -15939,7 +15939,7 @@ alreadyactsave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) goto noactsave; - context.dx = context.ds; + context.dx = context.data; context.ds = context.dx; context.si = 8350; context.al = context.data.byte(kCurrentslot); @@ -16001,7 +16001,7 @@ alreadyactload: if (context.flags.z()) goto notactload; context._cmp(context.ax, 1); if (!context.flags.z()) goto notactload; - context.dx = context.ds; + context.dx = context.data; context.ds = context.dx; context.si = 8350; context.al = context.data.byte(kCurrentslot); @@ -16075,7 +16075,7 @@ void getnamepos(Context & context) { context.ah = 0; context.cx = 17; context._mul(context.cx); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.bx = 8350; context._add(context.bx, context.ax); @@ -16223,7 +16223,7 @@ nomatchslot: } void shownames(Context & context) { - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.si = 8350+1; context.di = (60)+21; @@ -16309,7 +16309,7 @@ void oldtonames(Context & context) { } void makeheader(Context & context) { - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.di = 5912; context.ax = 17; @@ -16440,7 +16440,7 @@ loadops: context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) goto quitloaded; getridoftemp(context); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.bx = 7750; startloading(context); @@ -18808,7 +18808,7 @@ nextcheck2: void bresenhams(Context & context) { workoutframes(context); - context.dx = context.ds; + context.dx = context.data; context.es = context.dx; context.di = 7944; context.si = 1; -- cgit v1.2.3 From 7eb8e0bbe7151a09bec7e3a4afb4f4e6ffd8b335 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 13:06:27 +0400 Subject: DREAMWEB: unstubbed dontloadseg --- engines/dreamweb/dreamweb.cpp | 14 +++++++++++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b5e2a1328c..fb65e71abf 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -181,6 +181,12 @@ void DreamWebEngine::openFile(const Common::String &name) { } } +uint32 DreamWebEngine::skipBytes(uint32 bytes) { + if (!_file.seek(bytes, SEEK_CUR)) + error("seekk failed"); + return _file.pos(); +} + uint32 DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { processEvents(); if (!_file.isOpen()) @@ -427,7 +433,13 @@ void createfile(Context &context) { } void dontloadseg(Context &context) { - ::error("dontloadseg"); + context.ax = context.es.word(context.di); + context._add(context.di, 2); + context.dx = context.ax; + context.cx = 0; + unsigned pos = engine()->skipBytes(context.dx); + context.dx = pos >> 16; + context.ax = pos & 0xffff; } void mousecall(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 0666bb8518..78c8960b79 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -80,6 +80,7 @@ public: void openFile(const Common::String &name); uint32 readFromFile(uint8 *dst, unsigned size); + uint32 skipBytes(uint32 bytes); void closeFile(); void mouseCall(); //fill mouse pos and button state -- cgit v1.2.3 From a3e9cef4d0dd1acf7e075cb7bda10905da7949cf Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 13:20:58 +0400 Subject: DREAMWEB: fixed a typo --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fb65e71abf..c1e885bc46 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -183,7 +183,7 @@ void DreamWebEngine::openFile(const Common::String &name) { uint32 DreamWebEngine::skipBytes(uint32 bytes) { if (!_file.seek(bytes, SEEK_CUR)) - error("seekk failed"); + error("seek failed"); return _file.pos(); } -- cgit v1.2.3 From fdcb21ffee2688fec1c1b34ebf4a0a14fe4fcbf1 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 12 Jun 2011 12:49:47 +0200 Subject: DREAMWEB: Unstub dosreturn(). Note that clicking on the "Return to DOS" button still calls a stub function, but at least it no longer dies on mouse-over. --- engines/dreamweb/dreamweb.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c1e885bc46..db49b74da2 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -613,8 +613,21 @@ void generalerror(Context &context) { ::error("generalerror"); } +void commandonly(Context &context); + void dosreturn(Context &context) { - ::error("dosreturn"); + context._cmp(context.data.byte(kCommandtype), 250); + if (context.flags.z()) goto alreadydos; + context.data.byte(kCommandtype) = 250; + context.al = 46; + commandonly(context); +alreadydos: + context.ax = context.data.word(kMousebutton); + context._and(context.ax, 1); + if (context.flags.z()) return; + + quickquit2(context); + quickquit(context); } void set16colpalette(Context &context) { -- cgit v1.2.3 From 8ddbbc0c504893dad7fbde6a48b6edb668b249f9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 17:11:51 +0400 Subject: DREAMWEB: moved out file write/read from sources --- engines/dreamweb/dreamgen.cpp | 540 +++++++++++++++++++++++++----------------- engines/dreamweb/dreamgen.h | 4 +- engines/dreamweb/dreamweb.cpp | 17 +- engines/dreamweb/dreamweb.h | 6 +- 4 files changed, 332 insertions(+), 235 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index cad1987df4..10766a7599 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -178,6 +178,8 @@ void showsaveops(Context &context); void readkey(Context &context); void getnamepos(Context &context); void selectslot(Context &context); +void loadposition(Context &context); +void saveposition(Context &context); void restoreall(Context &context); void redrawmainscrn(Context &context); void checkinput(Context &context); @@ -16308,6 +16310,106 @@ void oldtonames(Context & context) { return; } +void saveposition(Context & context) { + makeheader(context); + context.al = context.data.byte(kCurrentslot); + context.ah = 0; + context.push(context.ax); + context.cx = 13; + context._mul(context.cx); + context.dx = context.data; + context.ds = context.dx; + context.dx = 8469; + context._add(context.dx, context.ax); + openforsave(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 5862; + context.cx = (5958-5862); + savefilewrite(context); + context.dx = context.data; + context.es = context.dx; + context.di = 5912; + context.ax = context.pop(); + context.cx = 17; + context._mul(context.cx); + context.dx = context.data; + context.ds = context.dx; + context.dx = 8350; + context._add(context.dx, context.ax); + saveseg(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 0; + saveseg(context); + context.ds = context.data.word(kExtras); + context.dx = (0); + saveseg(context); + context.ds = context.data.word(kBuffers); + context.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(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 7750; + saveseg(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 534; + saveseg(context); +fquit: + closefile(context); + return; +} + +void loadposition(Context & context) { + context.data.word(kTimecount) = 0; + clearchanges(context); + context.al = context.data.byte(kCurrentslot); + context.ah = 0; + context.push(context.ax); + context.cx = 13; + context._mul(context.cx); + context.dx = context.data; + context.ds = context.dx; + context.dx = 8469; + context._add(context.dx, context.ax); + openfile(context); + context.ah = 0x3f; + context.ds = context.cs; + context.dx = 5862; + context.cx = (5958-5862); + savefileread(context); + context.es = context.cs; + context.di = 5912; + context.ax = context.pop(); + context.cx = 17; + context._mul(context.cx); + context.dx = context.data; + context.ds = context.dx; + context.dx = 8350; + context._add(context.dx, context.ax); + loadseg(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 0; + loadseg(context); + context.ds = context.data.word(kExtras); + context.dx = (0); + loadseg(context); + context.ds = context.data.word(kBuffers); + context.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(context); + context.dx = context.data; + context.ds = context.dx; + context.dx = 7750; + loadseg(context); + context.ds = context.cs; + context.dx = 534; + loadseg(context); + closefile(context); + return; +} + void makeheader(Context & context) { context.dx = context.data; context.es = context.dx; @@ -20779,21 +20881,21 @@ void __start(Context &context) { 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, 0x84, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xe0, 0xc3, 0x90, 0x00, 0xb0, 0x00, 0x40, 0x00, 0x60, 0x00, 0x84, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x88, 0xc3, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xcc, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, 0xca, 0x00, 0xe4, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x9c, 0xc3, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xc0, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0xf0, 0x00, + 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0xf0, 0x00, 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x98, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0x9c, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, + 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xd0, 0xc4, 0x18, 0x01, 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb4, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, 0xd4, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, 0x40, 0x01, - 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, + 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, @@ -20840,28 +20942,28 @@ void __start(Context &context) { 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, 0x82, 0x00, 0x7c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xb3, 0x00, 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x84, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, 0x54, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0x9c, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x54, 0xc7, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, + 0x00, 0xa4, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x54, 0xc7, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x54, 0xc7, 0x8f, 0x00, 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xbc, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, 0xc4, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0x9c, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xe0, 0xc7, 0x40, + 0x00, 0xa4, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xe0, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe8, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, 0x74, 0x00, 0xa8, - 0x00, 0x6a, 0x00, 0x88, 0x00, 0xf0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, + 0x00, 0x6a, 0x00, 0x88, 0x00, 0xf0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x20, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x1c, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x54, - 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, + 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x38, 0xc8, 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x50, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, - 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, + 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x5c, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, - 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, + 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x54, 0xc8, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, 0xc8, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0x9c, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x00, 0xa4, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, @@ -20925,18 +21027,18 @@ void __start(Context &context) { 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xbc, 0xc8, 0x50, 0x00, + 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc4, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, - 0xc0, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0x9c, 0xca, 0xff, 0xff, 0x53, 0x50, + 0xc8, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x2c, 0xc8, 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, - 0x01, 0x64, 0x00, 0x7c, 0x00, 0xc8, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd0, + 0x01, 0x64, 0x00, 0x7c, 0x00, 0xd0, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd8, 0xc9, 0xff, 0xff, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x2c, 0xc8, 0x12, 0x01, 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, - 0x00, 0x7c, 0x00, 0xc8, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd0, 0xc9, 0xff, + 0x00, 0x7c, 0x00, 0xd0, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd8, 0xc9, 0xff, 0xff, 0x00, 0x21, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, @@ -21720,205 +21822,207 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc888: error(context); break; case 0xc88c: namestoold(context); break; case 0xc890: oldtonames(context); break; - case 0xc894: saveposition(context); break; - case 0xc898: loadposition(context); break; - case 0xc89c: loadseg(context); break; - case 0xc8a0: makeheader(context); break; - case 0xc8a4: storeit(context); break; - case 0xc8a8: saveseg(context); break; - case 0xc8ac: findlen(context); break; - case 0xc8b0: scanfornames(context); break; - case 0xc8b4: decide(context); break; - case 0xc8b8: showdecisions(context); break; - case 0xc8bc: newgame(context); break; - case 0xc8c0: loadold(context); break; - case 0xc8c4: loadspeech(context); break; - case 0xc8c8: createname(context); break; - case 0xc8cc: loadsample(context); break; - case 0xc8d0: loadsecondsample(context); break; - case 0xc8d4: soundstartup(context); break; - case 0xc8d8: trysoundalloc(context); break; - case 0xc8dc: setsoundoff(context); break; - case 0xc8e0: checksoundint(context); break; - case 0xc8e4: enablesoundint(context); break; - case 0xc8e8: disablesoundint(context); break; - case 0xc8ec: interupttest(context); break; - case 0xc8f0: soundend(context); break; - case 0xc8f4: out22c(context); break; - case 0xc8f8: playchannel0(context); break; - case 0xc8fc: playchannel1(context); break; - case 0xc900: makenextblock(context); break; - case 0xc904: volumeadjust(context); break; - case 0xc908: loopchannel0(context); break; - case 0xc90c: cancelch0(context); break; - case 0xc910: cancelch1(context); break; - case 0xc914: channel0only(context); break; - case 0xc918: channel1only(context); break; - case 0xc91c: channel0tran(context); break; - case 0xc920: bothchannels(context); break; - case 0xc924: saveems(context); break; - case 0xc928: restoreems(context); break; - case 0xc92c: domix(context); break; - case 0xc930: dmaend(context); break; - case 0xc934: startdmablock(context); break; - case 0xc938: setuppit(context); break; - case 0xc93c: getridofpit(context); break; - case 0xc940: pitinterupt(context); break; - case 0xc944: dreamweb(context); break; - case 0xc948: entrytexts(context); break; - case 0xc94c: entryanims(context); break; - case 0xc950: initialinv(context); break; - case 0xc954: pickupob(context); break; - case 0xc958: setupemm(context); break; - case 0xc95c: removeemm(context); break; - case 0xc960: checkforemm(context); break; - case 0xc964: checkbasemem(context); break; - case 0xc968: allocatebuffers(context); break; - case 0xc96c: clearbuffers(context); break; - case 0xc970: clearchanges(context); break; - case 0xc974: clearbeforeload(context); break; - case 0xc978: clearreels(context); break; - case 0xc97c: clearrest(context); break; - case 0xc980: deallocatemem(context); break; - case 0xc984: allocatemem(context); break; - case 0xc98c: parseblaster(context); break; - case 0xc990: startup(context); break; - case 0xc994: startup1(context); break; - case 0xc998: screenupdate(context); break; - case 0xc99c: watchreel(context); break; - case 0xc9a0: checkforshake(context); break; - case 0xc9a4: watchcount(context); break; - case 0xc9a8: showtime(context); break; - case 0xc9ac: dumpwatch(context); break; - case 0xc9b0: showbyte(context); break; - case 0xc9b4: onedigit(context); break; - case 0xc9b8: twodigitnum(context); break; - case 0xc9bc: showword(context); break; - case 0xc9c0: convnum(context); break; - case 0xc9c4: mainscreen(context); break; - case 0xc9c8: madmanrun(context); break; - case 0xc9cc: checkcoords(context); break; - case 0xc9d0: identifyob(context); break; - case 0xc9d4: checkifperson(context); break; - case 0xc9d8: checkifset(context); break; - case 0xc9dc: checkifex(context); break; - case 0xc9e0: checkiffree(context); break; - case 0xc9e4: isitdescribed(context); break; - case 0xc9e8: findpathofpoint(context); break; - case 0xc9ec: findfirstpath(context); break; - case 0xc9f0: turnpathon(context); break; - case 0xc9f4: turnpathoff(context); break; - case 0xc9f8: turnanypathon(context); break; - case 0xc9fc: turnanypathoff(context); break; - case 0xca00: checkifpathison(context); break; - case 0xca04: afternewroom(context); break; - case 0xca08: atmospheres(context); break; - case 0xca0c: walkintoroom(context); break; - case 0xca10: afterintroroom(context); break; - case 0xca14: obname(context); break; - case 0xca18: finishedwalking(context); break; - case 0xca1c: examineobtext(context); break; - case 0xca20: commandwithob(context); break; - case 0xca24: commandonly(context); break; - case 0xca28: printmessage(context); break; - case 0xca2c: printmessage2(context); break; - case 0xca30: blocknametext(context); break; - case 0xca34: personnametext(context); break; - case 0xca38: walktotext(context); break; - case 0xca3c: getflagunderp(context); break; - case 0xca40: setwalk(context); break; - case 0xca44: autosetwalk(context); break; - case 0xca48: checkdest(context); break; - case 0xca4c: bresenhams(context); break; - case 0xca50: workoutframes(context); break; - case 0xca54: getroomspaths(context); break; - case 0xca58: copyname(context); break; - case 0xca5c: findobname(context); break; - case 0xca60: showicon(context); break; - case 0xca64: middlepanel(context); break; - case 0xca68: showman(context); break; - case 0xca6c: showpanel(context); break; - case 0xca70: roomname(context); break; - case 0xca74: usecharset1(context); break; - case 0xca78: usetempcharset(context); break; - case 0xca7c: showexit(context); break; - case 0xca80: panelicons1(context); break; - case 0xca84: showwatch(context); break; - case 0xca88: gettime(context); break; - case 0xca8c: zoomicon(context); break; - case 0xca90: showblink(context); break; - case 0xca94: dumpblink(context); break; - case 0xca98: worktoscreenm(context); break; - case 0xca9c: blank(context); break; - case 0xcaa0: allpointer(context); break; - case 0xcaa4: hangonp(context); break; - case 0xcaa8: hangonw(context); break; - case 0xcaac: hangoncurs(context); break; - case 0xcab0: getunderzoom(context); break; - case 0xcab4: dumpzoom(context); break; - case 0xcab8: putunderzoom(context); break; - case 0xcabc: crosshair(context); break; - case 0xcac0: showpointer(context); break; - case 0xcac4: delpointer(context); break; - case 0xcac8: dumppointer(context); break; - case 0xcacc: undertextline(context); break; - case 0xcad0: deltextline(context); break; - case 0xcad4: dumptextline(context); break; - case 0xcad8: animpointer(context); break; - case 0xcadc: setmouse(context); break; - case 0xcae0: readmouse(context); break; - case 0xcae4: mousecall(context); break; - case 0xcae8: readmouse1(context); break; - case 0xcaec: readmouse2(context); break; - case 0xcaf0: readmouse3(context); break; - case 0xcaf4: readmouse4(context); break; - case 0xcaf8: readkey(context); break; - case 0xcafc: convertkey(context); break; - case 0xcb00: randomnum1(context); break; - case 0xcb04: randomnum2(context); break; - case 0xcb0c: hangon(context); break; - case 0xcb10: loadtraveltext(context); break; - case 0xcb14: loadintotemp(context); break; - case 0xcb18: loadintotemp2(context); break; - case 0xcb1c: loadintotemp3(context); break; - case 0xcb20: loadtempcharset(context); break; - case 0xcb24: standardload(context); break; - case 0xcb28: loadtemptext(context); break; - case 0xcb2c: loadroom(context); break; - case 0xcb30: loadroomssample(context); break; - case 0xcb34: getridofreels(context); break; - case 0xcb38: getridofall(context); break; - case 0xcb3c: restorereels(context); break; - case 0xcb40: restoreall(context); break; - case 0xcb44: sortoutmap(context); break; - case 0xcb48: startloading(context); break; - case 0xcb4c: disablepath(context); break; - case 0xcb50: findxyfrompath(context); break; - case 0xcb54: findroominloc(context); break; - case 0xcb58: getroomdata(context); break; - case 0xcb5c: readheader(context); break; - case 0xcb60: dontloadseg(context); break; - case 0xcb64: allocateload(context); break; - case 0xcb68: fillspace(context); break; - case 0xcb6c: getridoftemp(context); break; - case 0xcb70: getridoftemptext(context); break; - case 0xcb74: getridoftemp2(context); break; - case 0xcb78: getridoftemp3(context); break; - case 0xcb7c: getridoftempcharset(context); break; - case 0xcb80: getridoftempsp(context); break; - case 0xcb84: readsetdata(context); break; - case 0xcb88: createfile(context); break; - case 0xcb8c: openfile(context); break; - case 0xcb90: openfilenocheck(context); break; - case 0xcb94: openforsave(context); break; - case 0xcb98: closefile(context); break; - case 0xcb9c: readfromfile(context); break; - case 0xcba0: setkeyboardint(context); break; - case 0xcba4: resetkeyboard(context); break; - case 0xcba8: keyboardread(context); break; - case 0xcbac: walkandexamine(context); break; - case 0xcbb0: doload(context); break; - case 0xcbb4: generalerror(context); break; + case 0xc894: savefilewrite(context); break; + case 0xc898: savefileread(context); break; + case 0xc89c: saveposition(context); break; + case 0xc8a0: loadposition(context); break; + case 0xc8a4: loadseg(context); break; + case 0xc8a8: makeheader(context); break; + case 0xc8ac: storeit(context); break; + case 0xc8b0: saveseg(context); break; + case 0xc8b4: findlen(context); break; + case 0xc8b8: scanfornames(context); break; + case 0xc8bc: decide(context); break; + case 0xc8c0: showdecisions(context); break; + case 0xc8c4: newgame(context); break; + case 0xc8c8: loadold(context); break; + case 0xc8cc: loadspeech(context); break; + case 0xc8d0: createname(context); break; + case 0xc8d4: loadsample(context); break; + case 0xc8d8: loadsecondsample(context); break; + case 0xc8dc: soundstartup(context); break; + case 0xc8e0: trysoundalloc(context); break; + case 0xc8e4: setsoundoff(context); break; + case 0xc8e8: checksoundint(context); break; + case 0xc8ec: enablesoundint(context); break; + case 0xc8f0: disablesoundint(context); break; + case 0xc8f4: interupttest(context); break; + case 0xc8f8: soundend(context); break; + case 0xc8fc: out22c(context); break; + case 0xc900: playchannel0(context); break; + case 0xc904: playchannel1(context); break; + case 0xc908: makenextblock(context); break; + case 0xc90c: volumeadjust(context); break; + case 0xc910: loopchannel0(context); break; + case 0xc914: cancelch0(context); break; + case 0xc918: cancelch1(context); break; + case 0xc91c: channel0only(context); break; + case 0xc920: channel1only(context); break; + case 0xc924: channel0tran(context); break; + case 0xc928: bothchannels(context); break; + case 0xc92c: saveems(context); break; + case 0xc930: restoreems(context); break; + case 0xc934: domix(context); break; + case 0xc938: dmaend(context); break; + case 0xc93c: startdmablock(context); break; + case 0xc940: setuppit(context); break; + case 0xc944: getridofpit(context); break; + case 0xc948: pitinterupt(context); break; + case 0xc94c: dreamweb(context); break; + case 0xc950: entrytexts(context); break; + case 0xc954: entryanims(context); break; + case 0xc958: initialinv(context); break; + case 0xc95c: pickupob(context); break; + case 0xc960: setupemm(context); break; + case 0xc964: removeemm(context); break; + case 0xc968: checkforemm(context); break; + case 0xc96c: checkbasemem(context); break; + case 0xc970: allocatebuffers(context); break; + case 0xc974: clearbuffers(context); break; + case 0xc978: clearchanges(context); break; + case 0xc97c: clearbeforeload(context); break; + case 0xc980: clearreels(context); break; + case 0xc984: clearrest(context); break; + case 0xc988: deallocatemem(context); break; + case 0xc98c: allocatemem(context); break; + case 0xc994: parseblaster(context); break; + case 0xc998: startup(context); break; + case 0xc99c: startup1(context); break; + case 0xc9a0: screenupdate(context); break; + case 0xc9a4: watchreel(context); break; + case 0xc9a8: checkforshake(context); break; + case 0xc9ac: watchcount(context); break; + case 0xc9b0: showtime(context); break; + case 0xc9b4: dumpwatch(context); break; + case 0xc9b8: showbyte(context); break; + case 0xc9bc: onedigit(context); break; + case 0xc9c0: twodigitnum(context); break; + case 0xc9c4: showword(context); break; + case 0xc9c8: convnum(context); break; + case 0xc9cc: mainscreen(context); break; + case 0xc9d0: madmanrun(context); break; + case 0xc9d4: checkcoords(context); break; + case 0xc9d8: identifyob(context); break; + case 0xc9dc: checkifperson(context); break; + case 0xc9e0: checkifset(context); break; + case 0xc9e4: checkifex(context); break; + case 0xc9e8: checkiffree(context); break; + case 0xc9ec: isitdescribed(context); break; + case 0xc9f0: findpathofpoint(context); break; + case 0xc9f4: findfirstpath(context); break; + case 0xc9f8: turnpathon(context); break; + case 0xc9fc: turnpathoff(context); break; + case 0xca00: turnanypathon(context); break; + case 0xca04: turnanypathoff(context); break; + case 0xca08: checkifpathison(context); break; + case 0xca0c: afternewroom(context); break; + case 0xca10: atmospheres(context); break; + case 0xca14: walkintoroom(context); break; + case 0xca18: afterintroroom(context); break; + case 0xca1c: obname(context); break; + case 0xca20: finishedwalking(context); break; + case 0xca24: examineobtext(context); break; + case 0xca28: commandwithob(context); break; + case 0xca2c: commandonly(context); break; + case 0xca30: printmessage(context); break; + case 0xca34: printmessage2(context); break; + case 0xca38: blocknametext(context); break; + case 0xca3c: personnametext(context); break; + case 0xca40: walktotext(context); break; + case 0xca44: getflagunderp(context); break; + case 0xca48: setwalk(context); break; + case 0xca4c: autosetwalk(context); break; + case 0xca50: checkdest(context); break; + case 0xca54: bresenhams(context); break; + case 0xca58: workoutframes(context); break; + case 0xca5c: getroomspaths(context); break; + case 0xca60: copyname(context); break; + case 0xca64: findobname(context); break; + case 0xca68: showicon(context); break; + case 0xca6c: middlepanel(context); break; + case 0xca70: showman(context); break; + case 0xca74: showpanel(context); break; + case 0xca78: roomname(context); break; + case 0xca7c: usecharset1(context); break; + case 0xca80: usetempcharset(context); break; + case 0xca84: showexit(context); break; + case 0xca88: panelicons1(context); break; + case 0xca8c: showwatch(context); break; + case 0xca90: gettime(context); break; + case 0xca94: zoomicon(context); break; + case 0xca98: showblink(context); break; + case 0xca9c: dumpblink(context); break; + case 0xcaa0: worktoscreenm(context); break; + case 0xcaa4: blank(context); break; + case 0xcaa8: allpointer(context); break; + case 0xcaac: hangonp(context); break; + case 0xcab0: hangonw(context); break; + case 0xcab4: hangoncurs(context); break; + case 0xcab8: getunderzoom(context); break; + case 0xcabc: dumpzoom(context); break; + case 0xcac0: putunderzoom(context); break; + case 0xcac4: crosshair(context); break; + case 0xcac8: showpointer(context); break; + case 0xcacc: delpointer(context); break; + case 0xcad0: dumppointer(context); break; + case 0xcad4: undertextline(context); break; + case 0xcad8: deltextline(context); break; + case 0xcadc: dumptextline(context); break; + case 0xcae0: animpointer(context); break; + case 0xcae4: setmouse(context); break; + case 0xcae8: readmouse(context); break; + case 0xcaec: mousecall(context); break; + case 0xcaf0: readmouse1(context); break; + case 0xcaf4: readmouse2(context); break; + case 0xcaf8: readmouse3(context); break; + case 0xcafc: readmouse4(context); break; + case 0xcb00: readkey(context); break; + case 0xcb04: convertkey(context); break; + case 0xcb08: randomnum1(context); break; + case 0xcb0c: randomnum2(context); break; + case 0xcb14: hangon(context); break; + case 0xcb18: loadtraveltext(context); break; + case 0xcb1c: loadintotemp(context); break; + case 0xcb20: loadintotemp2(context); break; + case 0xcb24: loadintotemp3(context); break; + case 0xcb28: loadtempcharset(context); break; + case 0xcb2c: standardload(context); break; + case 0xcb30: loadtemptext(context); break; + case 0xcb34: loadroom(context); break; + case 0xcb38: loadroomssample(context); break; + case 0xcb3c: getridofreels(context); break; + case 0xcb40: getridofall(context); break; + case 0xcb44: restorereels(context); break; + case 0xcb48: restoreall(context); break; + case 0xcb4c: sortoutmap(context); break; + case 0xcb50: startloading(context); break; + case 0xcb54: disablepath(context); break; + case 0xcb58: findxyfrompath(context); break; + case 0xcb5c: findroominloc(context); break; + case 0xcb60: getroomdata(context); break; + case 0xcb64: readheader(context); break; + case 0xcb68: dontloadseg(context); break; + case 0xcb6c: allocateload(context); break; + case 0xcb70: fillspace(context); break; + case 0xcb74: getridoftemp(context); break; + case 0xcb78: getridoftemptext(context); break; + case 0xcb7c: getridoftemp2(context); break; + case 0xcb80: getridoftemp3(context); break; + case 0xcb84: getridoftempcharset(context); break; + case 0xcb88: getridoftempsp(context); break; + case 0xcb8c: readsetdata(context); break; + case 0xcb90: createfile(context); break; + case 0xcb94: openfile(context); break; + case 0xcb98: openfilenocheck(context); break; + case 0xcb9c: openforsave(context); break; + case 0xcba0: closefile(context); break; + case 0xcba4: readfromfile(context); break; + case 0xcba8: setkeyboardint(context); break; + case 0xcbac: resetkeyboard(context); break; + case 0xcbb0: keyboardread(context); break; + case 0xcbb4: walkandexamine(context); break; + case 0xcbb8: doload(context); break; + case 0xcbbc: generalerror(context); break; default: ::error("invalid call to %04x dispatched", (uint16)context.ax); } } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 40e3539a0d..d2db7f2ae6 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -60,8 +60,8 @@ namespace dreamgen { void scanfornames(Context &context); void saveseg(Context &context); void loadseg(Context &context); - void loadposition(Context &context); - void saveposition(Context &context); + void savefileread(Context &context); + void savefilewrite(Context &context); void error(Context &context); void generalerror(Context &context); void dosreturn(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index db49b74da2..2c03e369e1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -29,7 +29,7 @@ #include "common/EventRecorder.h" #include "common/file.h" #include "common/func.h" -#include "common/iff_container.h" +#include "common/savefile.h" #include "common/system.h" #include "common/timer.h" #include "common/util.h" @@ -290,7 +290,6 @@ void DreamWebEngine::cls() { _system->fillScreen(0); } - } // End of namespace DreamWeb @@ -585,6 +584,12 @@ void saveseg(Context &context) { ::error("saveseg"); } +void savefilewrite(Context &context) { +} + +void savefileread(Context &context) { +} + void loadseg(Context &context) { context.ax = context.es.word(context.di); context.di += 2; @@ -597,14 +602,6 @@ void loadseg(Context &context) { context.flags._c = false; } -void loadposition(Context &context) { - ::error("loadposition"); -} - -void saveposition(Context &context) { - ::error("saveposition"); -} - void error(Context &context) { ::error("error"); } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 78c8960b79..633d5075e0 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -36,10 +36,6 @@ #include "dreamweb/dreamgen.h" #include "dreamweb/console.h" -namespace Graphics { - class Surface; -} - namespace DreamWeb { // Engine Debug Flags @@ -79,7 +75,7 @@ public: uint8 randomNumber() { return _rnd.getRandomNumber(255); } void openFile(const Common::String &name); - uint32 readFromFile(uint8 *dst, unsigned size); + uint32 readFromFile(uint8 *data, unsigned size); uint32 skipBytes(uint32 bytes); void closeFile(); -- cgit v1.2.3 From c5ab591b791d96783d9fdb7796a162cbe246b08b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 17:39:15 +0400 Subject: DREAMWEB: unstabbed save --- engines/dreamweb/dreamweb.cpp | 27 +++++++++++++++++++++++---- engines/dreamweb/dreamweb.h | 5 +++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 2c03e369e1..817496d73b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -29,7 +29,6 @@ #include "common/EventRecorder.h" #include "common/file.h" #include "common/func.h" -#include "common/savefile.h" #include "common/system.h" #include "common/timer.h" #include "common/util.h" @@ -196,7 +195,22 @@ uint32 DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { void DreamWebEngine::closeFile() { processEvents(); - _file.close(); + if (_file.isOpen()) + _file.close(); + delete _saveFile; + _saveFile = 0; +} + +void DreamWebEngine::openSaveFile(const Common::String &name) { + processEvents(); + _saveFile = _system->getSavefileManager()->openForSaving(name); +} + +uint DreamWebEngine::writeToSaveFile(const uint8 *data, uint size) { + processEvents(); + if (!_saveFile) + error("save file was not opened"); + return _saveFile->write(data, size); } void DreamWebEngine::keyPressed(uint16 ascii) { @@ -408,7 +422,9 @@ void closefile(Context &context) { } void openforsave(Context &context) { - ::error("openforsave"); + const char *name = (const char *)context.ds.ptr(context.dx, 13); + debug(1, "openforsave(%s)", name); + engine()->openSaveFile(name); } void openfilenocheck(Context &context) { @@ -581,10 +597,13 @@ void scanfornames(Context &context) { } void saveseg(Context &context) { - ::error("saveseg"); + context.cx = context.es.word(context.di); + context._add(context.di, 2); + savefilewrite(context); } void savefilewrite(Context &context) { + engine()->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); } void savefileread(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 633d5075e0..7e99bf5e78 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -30,6 +30,7 @@ #include "common/file.h" #include "common/random.h" #include "common/rect.h" +#include "common/savefile.h" #include "common/scummsys.h" #include "engines/engine.h" @@ -89,6 +90,9 @@ public: void getPalette(uint8 *data, uint start, uint count); void setPalette(const uint8 *data, uint start, uint count); + + void openSaveFile(const Common::String &name); + uint writeToSaveFile(const uint8 *data, uint size); private: @@ -100,6 +104,7 @@ private: unsigned _mouseState; Common::File _file; + Common::OutSaveFile *_saveFile; dreamgen::Context _context; }; -- cgit v1.2.3 From f592fe188117e3f56cd19409afbed5b94c6d4d4a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 17:44:07 +0400 Subject: DREAMWEB: unstubbed scanfornames --- engines/dreamweb/dreamgen.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++- engines/dreamweb/dreamgen.h | 1 - engines/dreamweb/dreamweb.cpp | 5 ----- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 10766a7599..604ff90aaf 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -7,6 +7,7 @@ void allocatebuffers(Context &context); void clearbuffers(Context &context); void clearpalette(Context &context); void readsetdata(Context &context); +void scanfornames(Context &context); void loadpalfromiff(Context &context); void titles(Context &context); void credits(Context &context); @@ -16374,7 +16375,6 @@ void loadposition(Context & context) { context.dx = 8469; context._add(context.dx, context.ax); openfile(context); - context.ah = 0x3f; context.ds = context.cs; context.dx = 5862; context.cx = (5958-5862); @@ -16452,6 +16452,54 @@ foundlen: return; } +void scanfornames(Context & context) { + context.dx = context.data; + context.es = context.dx; + context.di = 8350; + context.dx = context.data; + context.ds = context.dx; + context.dx = 8469; + context.cx = 7; +scanloop: + context.push(context.es); + context.push(context.ds); + context.push(context.di); + context.push(context.dx); + context.push(context.cx); + openfilenocheck(context); + if (context.flags.c()) goto notexist; + context.cx = context.pop(); + context._add(context.ch, 1); + context.push(context.cx); + context.push(context.di); + context.push(context.es); + context.dx = context.data; + context.ds = context.dx; + context.dx = 5862; + context.cx = (5958-5862); + savefileread(context); + context.dx = context.data; + context.es = context.dx; + context.di = 5912; + context.ds = context.pop(); + context.dx = context.pop(); + loadseg(context); + context.bx = context.data.word(kHandle); + closefile(context); +notexist: + context.cx = context.pop(); + context.dx = context.pop(); + context.di = context.pop(); + context.ds = context.pop(); + context.es = context.pop(); + context._add(context.dx, 13); + context._add(context.di, 17); + context._sub(context.cl, 1); + if (!context.flags.z()) goto scanloop; + context.al = context.ch; + return; +} + void decide(Context & context) { setmode(context); loadpalfromiff(context); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index d2db7f2ae6..da4bbb6610 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -57,7 +57,6 @@ namespace dreamgen { void loadsecondsample(Context &context); void loadsample(Context &context); void loadspeech(Context &context); - void scanfornames(Context &context); void saveseg(Context &context); void loadseg(Context &context); void savefileread(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 817496d73b..26c7afe294 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -591,11 +591,6 @@ void loadspeech(Context &context) { ::error("loadspeech"); } -void scanfornames(Context &context) { - warning("scanfornames: STUB"); - context.ch = 0; -} - void saveseg(Context &context) { context.cx = context.es.word(context.di); context._add(context.di, 2); -- cgit v1.2.3 From b673130bf4cf0c77a106770e32c5125dbb7fccf1 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 17:56:48 +0400 Subject: DREAMWEB: implemented somewhat hackish read from currently open file --- engines/dreamweb/dreamweb.cpp | 52 ++++++++++++++++++++++++++++++++----------- engines/dreamweb/dreamweb.h | 8 +++++-- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 26c7afe294..159462ee9f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -65,6 +65,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); _instance = this; + _outSaveFile = 0; + _inSaveFile = 0; } DreamWebEngine::~DreamWebEngine() { @@ -188,31 +190,51 @@ uint32 DreamWebEngine::skipBytes(uint32 bytes) { uint32 DreamWebEngine::readFromFile(uint8 *dst, unsigned size) { processEvents(); - if (!_file.isOpen()) - error("file was not opened (read before open)"); - return _file.read(dst, size); + if (_file.isOpen()) + return _file.read(dst, size); + if (_inSaveFile) + return _inSaveFile->read(dst, size); + error("file was not opened (read before open)"); } void DreamWebEngine::closeFile() { processEvents(); if (_file.isOpen()) _file.close(); - delete _saveFile; - _saveFile = 0; + delete _inSaveFile; + _inSaveFile = 0; + delete _outSaveFile; + _outSaveFile = 0; } -void DreamWebEngine::openSaveFile(const Common::String &name) { +void DreamWebEngine::openSaveFileForWriting(const Common::String &name) { processEvents(); - _saveFile = _system->getSavefileManager()->openForSaving(name); + 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 (!_saveFile) - error("save file was not opened"); - return _saveFile->write(data, size); + 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); +} + + void DreamWebEngine::keyPressed(uint16 ascii) { debug(1, "key pressed = %04x", ascii); uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts @@ -424,11 +446,14 @@ void closefile(Context &context) { void openforsave(Context &context) { const char *name = (const char *)context.ds.ptr(context.dx, 13); debug(1, "openforsave(%s)", name); - engine()->openSaveFile(name); + engine()->openSaveFileForWriting(name); } void openfilenocheck(Context &context) { - ::error("openfilenocheck"); + const char *name = (const char *)context.ds.ptr(context.dx, 13); + debug(1, "checksavefile(%s)", name); + bool ok = engine()->openSaveFileForReading(name); + context.flags._c = !ok; } void openfile(Context &context) { @@ -598,10 +623,11 @@ void saveseg(Context &context) { } void savefilewrite(Context &context) { - engine()->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); + context.ax = engine()->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); } void savefileread(Context &context) { + context.ax = engine()->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); } void loadseg(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 7e99bf5e78..440a27bba5 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -91,9 +91,12 @@ public: void getPalette(uint8 *data, uint start, uint count); void setPalette(const uint8 *data, uint start, uint count); - void openSaveFile(const Common::String &name); + 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); + private: void keyPressed(uint16 ascii); @@ -104,7 +107,8 @@ private: unsigned _mouseState; Common::File _file; - Common::OutSaveFile *_saveFile; + Common::OutSaveFile *_outSaveFile; + Common::InSaveFile *_inSaveFile; dreamgen::Context _context; }; -- cgit v1.2.3 From 5fda321a80c006f6c55abcd48790165b25e678aa Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 18:02:58 +0400 Subject: DREAMWEB: added the same magic for opening files --- engines/dreamweb/dreamweb.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 159462ee9f..21baa8b1a5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -174,12 +174,13 @@ Common::Error DreamWebEngine::run() { void DreamWebEngine::openFile(const Common::String &name) { processEvents(); - if (_file.isOpen()) { - _file.close(); - } - if (!_file.open(name)) { - error("cannot open file %s", name.c_str()); - } + closeFile(); + if (_file.open(name)) + return; + _inSaveFile = _system->getSavefileManager()->openForLoading(name); + if (_inSaveFile) + return; + error("cannot open file %s", name.c_str()); } uint32 DreamWebEngine::skipBytes(uint32 bytes) { -- cgit v1.2.3 From bd285645944861771f7a9f1b2ddc4778a60c50f7 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 18:15:06 +0400 Subject: DREAMWEB: removed ugly static engine --- engines/dreamweb/dreamweb.cpp | 45 +++++++++++++++++++------------------------ engines/dreamweb/dreamweb.h | 2 -- engines/dreamweb/runtime.h | 14 ++++++++++---- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 21baa8b1a5..0b8146a44d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -50,10 +50,10 @@ namespace dreamgen { namespace DreamWeb { -DreamWebEngine *DreamWebEngine::_instance; - DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb") { + + _context.engine = this; // Setup mixer _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); @@ -64,7 +64,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"); - _instance = this; _outSaveFile = 0; _inSaveFile = 0; } @@ -332,10 +331,6 @@ void DreamWebEngine::cls() { namespace dreamgen { -static inline DreamWeb::DreamWebEngine *engine() { - return DreamWeb::DreamWebEngine::instance(); -} - void multiget(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; unsigned src = (uint16)context.di + (uint16)context.bx * kScreenwidth; @@ -369,12 +364,12 @@ void multidump(Context &context) { int x = (int16)context.di, y = (int16)context.bx; unsigned offset = x + y * kScreenwidth; //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); - engine()->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); + context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); } void worktoscreen(Context &context) { context.ds = context.data.word(kWorkspace); - engine()->blit(context.ds.ptr(0, 320 * 200), 320, 0, 0, 320, 200); + context.engine->blit(context.ds.ptr(0, 320 * 200), 320, 0, 0, 320, 200); } void printundermon(Context &context) { @@ -382,7 +377,7 @@ void printundermon(Context &context) { } void cls(Context &context) { - engine()->cls(); + context.engine->cls(); } void frameoutnm(Context &context) { @@ -408,7 +403,7 @@ void seecommandtail(Context &context) { } void randomnumber(Context &context) { - context.al = engine()->randomNumber(); + context.al = context.engine->randomNumber(); } void quickquit(Context &context) { @@ -435,25 +430,25 @@ void readfromfile(Context &context) { uint16 dst_offset = context.dx; uint16 size = context.cx; debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); + context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; } void closefile(Context &context) { - engine()->closeFile(); + context.engine->closeFile(); context.data.byte(kHandle) = 0; } void openforsave(Context &context) { const char *name = (const char *)context.ds.ptr(context.dx, 13); debug(1, "openforsave(%s)", name); - engine()->openSaveFileForWriting(name); + context.engine->openSaveFileForWriting(name); } void openfilenocheck(Context &context) { const char *name = (const char *)context.ds.ptr(context.dx, 13); debug(1, "checksavefile(%s)", name); - bool ok = engine()->openSaveFileForReading(name); + bool ok = context.engine->openSaveFileForReading(name); context.flags._c = !ok; } @@ -464,7 +459,7 @@ void openfile(Context &context) { while((c = context.cs.byte(name_ptr++)) != 0) name += (char)c; debug(1, "opening file: %s", name.c_str()); - engine()->openFile(name); + context.engine->openFile(name); context.cs.word(kHandle) = 1; //only one handle context.flags._c = false; } @@ -478,13 +473,13 @@ void dontloadseg(Context &context) { context._add(context.di, 2); context.dx = context.ax; context.cx = 0; - unsigned pos = engine()->skipBytes(context.dx); + unsigned pos = context.engine->skipBytes(context.dx); context.dx = pos >> 16; context.ax = pos & 0xffff; } void mousecall(Context &context) { - engine()->mouseCall(); + context.engine->mouseCall(); } void setmouse(Context &context) { @@ -624,11 +619,11 @@ void saveseg(Context &context) { } void savefilewrite(Context &context) { - context.ax = engine()->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); + context.ax = context.engine->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); } void savefileread(Context &context) { - context.ax = engine()->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); + context.ax = context.engine->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); } void loadseg(Context &context) { @@ -639,7 +634,7 @@ void loadseg(Context &context) { uint16 size = context.ax; debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = engine()->readFromFile(context.ds.ptr(dst_offset, size), size); + context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); context.flags._c = false; } @@ -680,11 +675,11 @@ void mode640x480(Context &context) { } void showgroup(Context &context) { - engine()->setPalette(); + context.engine->setPalette(); } void fadedos(Context &context) { - engine()->fadeDos(); + context.engine->fadeDos(); } void doshake(Context &context) { @@ -692,12 +687,12 @@ void doshake(Context &context) { } void vsync(Context &context) { - engine()->waitForVSync(); + context.engine->waitForVSync(); } void setmode(Context &context) { vsync(context); - engine()->setGraphicsMode(); + context.engine->setGraphicsMode(); } void readoneblock(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 440a27bba5..c0bd9d9d63 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -51,7 +51,6 @@ class DreamWebEngine : public Engine { private: DreamWebConsole *_console; bool _vSyncInterrupt; - static DreamWebEngine *_instance; protected: // Engine APIs @@ -61,7 +60,6 @@ protected: public: DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc); virtual ~DreamWebEngine(); - static DreamWebEngine* instance() { return _instance; } void setVSyncInterrupt(bool flag); void waitForVSync(); diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index d92a8d6a2b..3adc99b35f 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -9,6 +9,10 @@ #include "common/list.h" #include "common/ptr.h" +namespace DreamWeb { + class DreamWebEngine; +} + namespace dreamgen { //fixme: name clash @@ -195,10 +199,12 @@ class Context { typedef Common::List FreeSegmentList; FreeSegmentList _freeSegments; - + public: + DreamWeb::DreamWebEngine *engine; + enum { kDefaultDataSegment = 0x1000 }; - + Register ax, dx, bx, cx, si, di; LowPartOfRegister al; HighPartOfRegister ah; @@ -208,12 +214,12 @@ public: HighPartOfRegister ch; LowPartOfRegister dl; HighPartOfRegister dh; - + SegmentRef cs, ds, es, data; //data == fake segment register always pointing to data segment Flags flags; - inline Context(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), + 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); -- cgit v1.2.3 From 04ee3aefae8ced07e69f42490859b3408d2c8cd8 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 18:42:51 +0400 Subject: DREAMWEB: implemented doshake --- engines/dreamweb/dreamweb.cpp | 27 ++++++++++++++++++++++++++- engines/dreamweb/dreamweb.h | 10 ++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0b8146a44d..60462dc463 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -683,7 +683,32 @@ void fadedos(Context &context) { } void doshake(Context &context) { - //warning("doshake: STUB"); + uint8 &counter = context.data.byte(kShakecounter); + context._cmp(counter, 48); + if (context.flags.z()) + return; + + context._add(counter, 1); + static const int shakeTable[] = { + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 0, + }; + context.engine->setShakePos(shakeTable[counter]); } void vsync(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index c0bd9d9d63..8cd489cc7e 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -85,16 +85,18 @@ public: 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); + void setShakePos(int pos) { _system->setShakePos(pos); } + private: void keyPressed(uint16 ascii); @@ -103,11 +105,11 @@ private: Common::RandomSource _rnd; Common::Point _mouse; unsigned _mouseState; - + Common::File _file; Common::OutSaveFile *_outSaveFile; Common::InSaveFile *_inSaveFile; - + dreamgen::Context _context; }; -- cgit v1.2.3 From 4ba74f73e1315430de0d86e3712a8ad2298f16f8 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 18:58:00 +0400 Subject: DREAMWEB: moved quit() into engine's method --- engines/dreamweb/dreamweb.cpp | 17 ++++++++++------- engines/dreamweb/dreamweb.h | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 60462dc463..68cb902ea1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -102,13 +102,18 @@ void DreamWebEngine::waitForVSync() { _system->updateScreen(); } +void DreamWebEngine::quit() { + warning("Engine should quit gracefully (but doesn't yet)"); + g_system->quit(); +} + void DreamWebEngine::processEvents() { Common::EventManager *event_manager = _system->getEventManager(); - Common::Event event; if (event_manager->shouldQuit()) { - warning("Engine should quit gracefully (but doesn't yet)"); - g_system->quit(); + quit(); + return; } + Common::Event event; while (event_manager->pollEvent(event)) { switch(event.type) { case Common::EVENT_LBUTTONDOWN: @@ -407,13 +412,11 @@ void randomnumber(Context &context) { } void quickquit(Context &context) { - assert(0); - ::error("quickquit"); + context.engine->quit(); } void quickquit2(Context &context) { - assert(0); - ::error("quickquit2"); + context.engine->quit(); } void keyboardread(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 8cd489cc7e..455791d2c3 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -97,6 +97,8 @@ public: void setShakePos(int pos) { _system->setShakePos(pos); } + void quit(); + private: void keyPressed(uint16 ascii); -- cgit v1.2.3 From 1ac23aa8584bb8de523cb67abc125b078e0e29c0 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 19:11:24 +0400 Subject: DREAMWEB: added middle mouse key handling --- engines/dreamweb/dreamweb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 68cb902ea1..fc2f5a8075 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -128,6 +128,12 @@ void DreamWebEngine::processEvents() { case Common::EVENT_RBUTTONUP: _mouseState &= ~2; break; + case Common::EVENT_MBUTTONDOWN: + _mouseState |= 4; + break; + case Common::EVENT_MBUTTONUP: + _mouseState &= ~4; + break; case Common::EVENT_MOUSEMOVE: _mouse = event.mouse; break; -- cgit v1.2.3 From 3f53cb924463e37fac5973affa498f97569ba80c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 19:35:59 +0400 Subject: DREAMWEB: removed warning about 16 colors palette, initialize mouseState --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fc2f5a8075..7e6e5e6a17 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -62,6 +62,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _vSyncInterrupt = false; _console = 0; + _mouseState = 0; DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); _outSaveFile = 0; @@ -673,7 +674,6 @@ alreadydos: } void set16colpalette(Context &context) { - warning("set16colpalette: STUB"); } void mode640x480(Context &context) { -- cgit v1.2.3 From 562f1ed8b89fa251f843ee2d8d6565429ea193d5 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 12 Jun 2011 19:41:08 +0200 Subject: DREAMWEB: Rewrite the PCX decoder i C++ --- engines/dreamweb/dreamweb.cpp | 144 +++++++++++++++++++----------------------- 1 file changed, 64 insertions(+), 80 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 7e6e5e6a17..086aee2e9a 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -739,94 +739,78 @@ void readoneblock(Context &context) { void readabyte(Context & context); void showpcx(Context &context) { - Graphics::Surface *s = g_system->lockScreen(); + uint16 name_ptr = context.dx; + Common::String name; + uint8 c; + while((c = context.cs.byte(name_ptr++)) != 0) + name += (char)c; - openfile(context); - context.ds = context.data.word(kWorkspace); - context.cx = 128; - context.dx = 0; - readfromfile(context); + Common::File pcxFile; - context.ds = context.data.word(kWorkspace); - context.si = 16; - context.cx = 48; - context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768; - -pcxpal: - context.push(context.cx); - readabyte(context); - context._shr(context.al, 1); - context._shr(context.al, 1); - context._stosb(); - context.cx = context.pop(); - if (--context.cx) goto pcxpal; - context.cx = 768 - 48; - context.ax = 0x0ffff; - while (context.cx--) context._stosw(); - readoneblock(context); - context.si = 0; - context.di = 0; - context.cx = 480; -convertpcx: - context.push(context.cx); - context.push(context.di); - context.ds = context.data.word(kWorkspace); + if (!pcxFile.open(name)) { + warning("showpcx: Could not open '%s'", name.c_str()); + return; + } + + 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); context.es = context.data.word(kBuffers); - context.di = 0+(228*13)+32+60; - context.bx = 0; - - uint8 *src = context.es.ptr(context.di, 320); - -sameline: - readabyte(context); - context.ah = context.al; - context._and(context.ah, 0xc0); - context._cmp(context.ah, 0xc0); - if (!context.flags.z()) goto normal; - context.cl = context.al; - context._and(context.cl, 0x3f); - context.ch = 0; - context.push(context.cx); - readabyte(context); - context.cx = context.pop(); - context._add(context.bx, context.cx); - while (context.cx--) context._stosb(); - context._cmp(context.bx, 4 * 80); - if (!context.flags.z()) goto sameline; - goto endline; -normal: - context._stosb(); - context._add(context.bx, 1); - context._cmp(context.bx, 4 * 80); - if (!context.flags.z()) goto sameline; - -endline: - context.di = context.pop(); - context.cx = context.pop(); - - assert((uint16)context.cx <= 480); - uint8 *dst = (uint8 *)s->getBasePtr(0, 480 - (uint16)context.cx); - memset(dst, 0, 640); - - for (int i = 0; i < 320; i++) { - int plane = i / 80; - int pos = i % 80; - - for (int j = 0; j < 8; j++) { - byte bit = (src[i] >> (7 - j)) & 1; - dst[8 * pos + j] |= (bit << plane); - } + maingamepal = context.es.ptr(5946, 768); + pcxFile.read(maingamepal, 48); + + memset(maingamepal + 48, 0xff, 720); + for (i = 0; i < 48; i++) { + maingamepal[i] >>= 2; } - if (--context.cx) goto convertpcx; + // Decode the image data. - closefile(context); + Graphics::Surface *s = g_system->lockScreen(); + Common::Rect rect(640, 480); - g_system->unlockScreen(); + s->fillRect(rect, 0); + pcxFile.seek(128, SEEK_SET); + + for (int y = 0; y < 480; y++) { + byte *dst = (byte *)s->getBasePtr(0, y); + int decoded = 0; + + while (decoded < 320) { + byte col = pcxFile.readByte(); + byte len; + + if ((col & 0xc0) == 0xc0) { + len = col & 0x3f; + col = pcxFile.readByte(); + } else { + len = 1; + } - // TODO: This is probably not the right place to do this - g_system->updateScreen(); + // The image uses 16 colors and is stored as four bit + // planes, one for each bit of the color, least + // significant bit plane first. + + for (i = 0; i < len; i++) { + int plane = decoded / 80; + int pos = decoded % 80; + + for (j = 0; j < 8; j++) { + byte bit = (col >> (7 - j)) & 1; + dst[8 * pos + j] |= (bit << plane); + } + + decoded++; + } + } + } + + g_system->unlockScreen(); + pcxFile.close(); } } /*namespace dreamgen */ -- cgit v1.2.3 From f8422b56a99fe288719c3df592b12d742c0dabe0 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 19:53:48 +0400 Subject: DREAMWEB: renamed update to update_zs --- engines/dreamweb/runtime.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 3adc99b35f..f99563f358 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -174,12 +174,12 @@ struct Flags { inline bool l() const { return _o; } inline bool le() const { return _o || _z; } - inline void update(uint8 v) { + inline void update_zs(uint8 v) { _s = v & 0x80; _z = v == 0; } - inline void update(uint16 v) { + inline void update_zs(uint16 v) { _s = v & 0x8000; _z = v == 0; } @@ -277,7 +277,7 @@ public: flags.update_o((uint8)r, dst); flags._c = r >= 0x100; dst = r; - flags.update(dst); + flags.update_zs(dst); } inline void _add(uint16 &dst, uint16 src) { @@ -285,56 +285,56 @@ public: flags.update_o((uint16)r, dst); flags._c = r >= 0x10000; dst = r; - flags.update(dst); + flags.update_zs(dst); } inline void _sub(uint8 &dst, uint8 src) { flags.update_o(uint8(dst - src), dst); flags._c = dst < src; dst -= src; - flags.update(dst); + flags.update_zs(dst); } inline void _sub(uint16 &dst, uint16 src) { flags.update_o(uint16(dst - src), dst); flags._c = dst < src; dst -= src; - flags.update(dst); + flags.update_zs(dst); } inline void _and(uint8 &dst, uint8 src) { dst &= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } inline void _and(uint16 &dst, uint16 src) { dst &= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } inline void _or(uint8 &dst, uint8 src) { dst |= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } inline void _or(uint16 &dst, uint16 src) { dst |= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } inline void _xor(uint8 &dst, uint8 src) { dst ^= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } inline void _xor(uint16 &dst, uint16 src) { dst ^= src; - flags.update(dst); + flags.update_zs(dst); flags._c = flags._o = false; } @@ -344,8 +344,8 @@ public: dst >>= (src - 1); flags._c = dst & 1; dst >>= 1; + flags.update_zs(dst); } - flags.update(dst); if (src == 1) flags._o = dst & 0x80; } @@ -356,8 +356,8 @@ public: dst >>= (src - 1); flags._c = dst & 1; dst >>= 1; + flags.update_zs(dst); } - flags.update(dst); if (src == 1) flags._o = dst & 0x8000; } @@ -368,8 +368,8 @@ public: dst <<= (src - 1); flags._c = dst & 0x80; dst <<= 1; + flags.update_zs(dst); } - flags.update(dst); if (src == 1) flags._o = ((dst & 0x80) != 0) == flags._c; } @@ -379,8 +379,8 @@ public: dst <<= (src - 1); flags._c = dst & 0x8000; dst <<= 1; + flags.update_zs(dst); } - flags.update(dst); if (src == 1) flags._o = ((dst & 0x8000) != 0) == flags._c; } @@ -407,14 +407,14 @@ public: inline void _neg(uint8 &src) { flags._c = src != 0; src = ~src; - flags.update(src); + flags.update_zs(src); flags._o = false; } inline void _neg(uint16 &src) { flags._c = src != 0; src = ~src; - flags.update(src); + flags.update_zs(src); flags._o = false; } -- cgit v1.2.3 From bf80a8a3ac6f40000a042e94af2e257dc67ec6e0 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 20:10:17 +0400 Subject: DREAMWEB: added inc/dec instructions. --- devtools/tasmrecover/tasm/cpp.py | 20 +- engines/dreamweb/dreamgen.cpp | 720 +++++++++++++++++++-------------------- engines/dreamweb/runtime.h | 24 ++ 3 files changed, 394 insertions(+), 370 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 5126cd6d4f..52f21bda33 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -303,17 +303,17 @@ namespace %s { def _shl(self, dst, src): self.body += "\tcontext._shl(%s, %s);\n" %self.parse2(dst, src) - def _sar(self, dst, src): - self.body += "\tcontext._sar(%s%s);\n" %self.parse2(dst, src) + #def _sar(self, dst, src): + # self.body += "\tcontext._sar(%s%s);\n" %self.parse2(dst, src) - def _sal(self, dst, src): - self.body += "\tcontext._sal(%s, %s);\n" %self.parse2(dst, src) + #def _sal(self, dst, src): + # self.body += "\tcontext._sal(%s, %s);\n" %self.parse2(dst, src) - def _rcl(self, dst, src): - self.body += "\tcontext._rcl(%s, %s);\n" %self.parse2(dst, src) + #def _rcl(self, dst, src): + # self.body += "\tcontext._rcl(%s, %s);\n" %self.parse2(dst, src) - def _rcr(self, dst, src): - self.body += "\tcontext._rcr(%s, %s);\n" %self.parse2(dst, src) + #def _rcr(self, dst, src): + # self.body += "\tcontext._rcr(%s, %s);\n" %self.parse2(dst, src) def _mul(self, src): src = self.expand(src) @@ -325,11 +325,11 @@ namespace %s { def _inc(self, dst): dst = self.expand(dst) - self.body += "\tcontext._add(%s, 1);\n" %(dst) + self.body += "\tcontext._inc(%s);\n" %(dst) def _dec(self, dst): dst = self.expand(dst) - self.body += "\tcontext._sub(%s, 1);\n" %(dst) + self.body += "\tcontext._dec(%s);\n" %(dst) def _cmp(self, a, b): self.body += "\tcontext._cmp(%s, %s);\n" %self.parse2(a, b) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 604ff90aaf..b27de1f750 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -477,7 +477,7 @@ void intro1text(Context &context); void alleybarksound(Context & context) { context.ax = context.es.word(context.bx+3); - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.ax, 0); if (!context.flags.z()) goto nobark; context.push(context.bx); @@ -511,7 +511,7 @@ void receptionist(Context & context) { if (!context.flags.z()) goto gotrecep; context._cmp(context.data.byte(kCardpassflag), 1); if (!context.flags.z()) goto notsetcard; - context._add(context.data.byte(kCardpassflag), 1); + context._inc(context.data.byte(kCardpassflag)); context.es.byte(context.bx+7) = 1; context.es.word(context.bx+3) = 64; notsetcard: @@ -536,7 +536,7 @@ notdes2: context.es.word(context.bx+3) = 53; goto gotrecep; notendcard: - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); gotrecep: showgamereel(context); addtopeoplelist(context); @@ -576,7 +576,7 @@ notsmokeb1: context.es.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb2: - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); gotsmokeb: showgamereel(context); addtopeoplelist(context); @@ -654,7 +654,7 @@ void louischair(Context & context) { checkspeed(context); if (!context.flags.z()) goto notlouisanim; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 191); if (context.flags.z()) goto restartlouis; context._cmp(context.ax, 185); @@ -700,7 +700,7 @@ void tattooman(Context & context) { void drinker(Context & context) { checkspeed(context); if (!context.flags.z()) goto gotdrinker; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); context._cmp(context.es.word(context.bx+3), 115); if (!context.flags.z()) goto notdrinker1; context.es.word(context.bx+3) = 105; @@ -734,7 +734,7 @@ notsmoket1: context.es.word(context.bx+3) = 81; goto gotsmoket; notsmoket2: - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); gotsmoket: showgamereel(context); context._cmp(context.data.byte(kGunpassflag), 1); @@ -760,7 +760,7 @@ void barwoman(Context & context) { void interviewer(Context & context) { context._cmp(context.data.word(kReeltowatch), 68); if (!context.flags.z()) goto notgeneralstart; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); notgeneralstart: context._cmp(context.es.word(context.bx+3), 250); if (context.flags.z()) goto talking; @@ -768,7 +768,7 @@ notgeneralstart: if (!context.flags.z()) goto talking; context._cmp(context.es.word(context.bx+3), 259); if (context.flags.z()) goto talking; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); talking: showgamereel(context); return; @@ -780,7 +780,7 @@ void soldier1(Context & context) { context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 30); if (!context.flags.z()) goto notaftersshot; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotsoldframe; context.data.byte(kMandead) = 2; @@ -788,7 +788,7 @@ void soldier1(Context & context) { notaftersshot: checkspeed(context); if (!context.flags.z()) goto gotsoldframe; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); goto gotsoldframe; soldierwait: context._cmp(context.data.byte(kLastweapon), 1); @@ -798,7 +798,7 @@ soldierwait: if (!context.flags.z()) goto gotsoldframe; context._cmp(context.data.byte(kFacing), 4); if (!context.flags.z()) goto gotsoldframe; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); context.data.byte(kLastweapon) = -1; context.data.byte(kCombatcount) = 0; gotsoldframe: @@ -816,7 +816,7 @@ void rockstar(Context & context) { checkspeed(context); if (!context.flags.z()) goto rockspeed; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 118); if (!context.flags.z()) goto notbeforedead; context.data.byte(kMandead) = 2; @@ -824,14 +824,14 @@ void rockstar(Context & context) { notbeforedead: context._cmp(context.ax, 79); if (!context.flags.z()) goto gotrockframe; - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonrock; context.data.byte(kLastweapon) = -1; context.ax = 123; goto gotrockframe; notgunonrock: - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotrockframe; context.data.byte(kCombatcount) = 0; @@ -865,10 +865,10 @@ void helicopter(Context & context) { checkspeed(context); if (!context.flags.z()) goto helispeed; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 53); if (!context.flags.z()) goto notbeforehdead; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 8); if (context.flags.c()) goto waitabit; context.data.byte(kMandead) = 2; @@ -878,7 +878,7 @@ waitabit: notbeforehdead: context._cmp(context.ax, 9); if (!context.flags.z()) goto gotheliframe; - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonheli; context.data.byte(kLastweapon) = -1; @@ -886,7 +886,7 @@ notbeforehdead: goto gotheliframe; notgunonheli: context.ax = 5; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 20); if (!context.flags.z()) goto gotheliframe; context.data.byte(kCombatcount) = 0; @@ -927,7 +927,7 @@ void mugger(Context & context) { havesetwatch: checkspeed(context); if (!context.flags.z()) goto notmugger; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); notmugger: showgamereel(context); context.al = context.data.byte(kMapx); @@ -1020,7 +1020,7 @@ notfirstbiz: checkspeed(context); if (!context.flags.z()) goto busspeed; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 48); if (!context.flags.z()) goto notbeforedeadb; context.data.byte(kMandead) = 2; @@ -1028,7 +1028,7 @@ notfirstbiz: notbeforedeadb: context._cmp(context.ax, 15); if (!context.flags.z()) goto buscombatwon; - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 3); if (!context.flags.z()) goto notshieldonbus; context.data.byte(kLastweapon) = -1; @@ -1036,7 +1036,7 @@ notbeforedeadb: context.ax = 51; goto gotbusframe; notshieldonbus: - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 20); if (!context.flags.z()) goto gotbusframe; context.data.byte(kCombatcount) = 0; @@ -1099,17 +1099,17 @@ notfirstpool: checkspeed(context); if (!context.flags.z()) goto guardspeed; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 122); if (!context.flags.z()) goto notendguard1; - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 2); if (!context.flags.z()) goto notaxeonpool; context.data.byte(kLastweapon) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotguardframe; context.data.byte(kCombatcount) = 0; @@ -1118,14 +1118,14 @@ notaxeonpool: notendguard1: context._cmp(context.ax, 147); if (!context.flags.z()) goto gotguardframe; - context._sub(context.ax, 1); + context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); if (!context.flags.z()) goto notgunonpool; context.data.byte(kLastweapon) = -1; context.ax = 147; goto gotguardframe; notgunonpool: - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); if (!context.flags.z()) goto gotguardframe; context.data.byte(kCombatcount) = 0; @@ -1158,7 +1158,7 @@ combatover2: showgamereel(context); context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 100); if (context.flags.c()) goto doneover2; context.data.word(kWatchingtime) = 0; @@ -1177,7 +1177,7 @@ notaftersec: context.data.word(kWatchingtime) = 10; checkspeed(context); if (!context.flags.z()) goto gotsecurframe; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); goto gotsecurframe; securwait: context._cmp(context.data.byte(kLastweapon), 1); @@ -1188,7 +1188,7 @@ securwait: context._cmp(context.data.byte(kFacing), 0); if (!context.flags.z()) goto gotsecurframe; context.data.byte(kLastweapon) = -1; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); gotsecurframe: showgamereel(context); addtopeoplelist(context); @@ -1204,7 +1204,7 @@ void heavy(Context & context) { context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 70); if (!context.flags.z()) goto notafterhshot; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 80); if (!context.flags.z()) goto gotheavyframe; context.data.byte(kMandead) = 2; @@ -1212,7 +1212,7 @@ void heavy(Context & context) { notafterhshot: checkspeed(context); if (!context.flags.z()) goto gotheavyframe; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); goto gotheavyframe; heavywait: context._cmp(context.data.byte(kLastweapon), 1); @@ -1222,7 +1222,7 @@ heavywait: context._cmp(context.data.byte(kFacing), 4); if (!context.flags.z()) goto gotheavyframe; context.data.byte(kLastweapon) = -1; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); context.data.byte(kCombatcount) = 0; gotheavyframe: showgamereel(context); @@ -1234,7 +1234,7 @@ void bossman(Context & context) { checkspeed(context); if (!context.flags.z()) goto notboss; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 4); if (context.flags.z()) goto firstdes; context._cmp(context.ax, 20); @@ -1242,7 +1242,7 @@ void bossman(Context & context) { context._cmp(context.ax, 41); if (!context.flags.z()) goto gotallboss; context.ax = 0; - context._add(context.data.byte(kGunpassflag), 1); + context._inc(context.data.byte(kGunpassflag)); context.es.byte(context.bx+7) = 10; goto gotallboss; firstdes: @@ -1316,7 +1316,7 @@ void keeper(Context & context) { if (!context.flags.z()) goto notwaiting; context._cmp(context.data.word(kReeltowatch), 190); if (context.flags.c()) goto waiting; - context._add(context.data.byte(kKeeperflag), 1); + context._inc(context.data.byte(kKeeperflag)); context.ah = context.es.byte(context.bx+7); context._and(context.ah, 127); context._cmp(context.ah, context.data.byte(kDreamnumber)); @@ -1336,7 +1336,7 @@ void candles1(Context & context) { checkspeed(context); if (!context.flags.z()) goto candle1; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 44); if (!context.flags.z()) goto notendcandle1; context.ax = 39; @@ -1351,7 +1351,7 @@ void smallcandle(Context & context) { checkspeed(context); if (!context.flags.z()) goto smallcandlef; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 37); if (!context.flags.z()) goto notendsmallcandle; context.ax = 25; @@ -1366,7 +1366,7 @@ void intromagic1(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm1fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 145); if (!context.flags.z()) goto gotintrom1; context.ax = 121; @@ -1374,7 +1374,7 @@ gotintrom1: context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); if (!context.flags.z()) goto introm1fin; - context._add(context.data.byte(kIntrocount), 1); + context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); intro1text(context); @@ -1393,7 +1393,7 @@ void candles(Context & context) { checkspeed(context); if (!context.flags.z()) goto candlesfin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 167); if (!context.flags.z()) goto gotcandles; context.ax = 162; @@ -1408,7 +1408,7 @@ void candles2(Context & context) { checkspeed(context); if (!context.flags.z()) goto candles2fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 238); if (!context.flags.z()) goto gotcandles2; context.ax = 233; @@ -1423,7 +1423,7 @@ void gates(Context & context) { checkspeed(context); if (!context.flags.z()) goto gatesfin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 116); if (!context.flags.z()) goto notbang; context.push(context.ax); @@ -1459,7 +1459,7 @@ void intromagic2(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm2fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 216); if (!context.flags.z()) goto gotintrom2; context.ax = 192; @@ -1474,7 +1474,7 @@ void intromagic3(Context & context) { checkspeed(context); if (!context.flags.z()) goto introm3fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 218); if (!context.flags.z()) goto gotintrom3; context.data.byte(kGetback) = 1; @@ -1491,7 +1491,7 @@ void intromonks1(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk1fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 80); if (!context.flags.z()) goto notendmonk1; context._add(context.data.byte(kMapy), 10); @@ -1535,10 +1535,10 @@ void intromonks2(Context & context) { checkspeed(context); if (!context.flags.z()) goto intromonk2fin; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 87); if (!context.flags.z()) goto nottalk1; - context._add(context.data.byte(kIntrocount), 1); + context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); monks2text(context); @@ -1554,7 +1554,7 @@ notlasttalk1: nottalk1: context._cmp(context.ax, 110); if (!context.flags.z()) goto notraisearm; - context._add(context.data.byte(kIntrocount), 1); + context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); monks2text(context); @@ -1775,10 +1775,10 @@ void monkandryan(Context & context) { checkspeed(context); if (!context.flags.z()) goto notmonkryan; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 83); if (!context.flags.z()) goto gotmonkryan; - context._add(context.data.byte(kIntrocount), 1); + context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); textformonk(context); @@ -1800,12 +1800,12 @@ void endgameseq(Context & context) { checkspeed(context); if (!context.flags.z()) goto notendseq; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 51); if (!context.flags.z()) goto gotendseq; context._cmp(context.data.byte(kIntrocount), 140); if (context.flags.z()) goto gotendseq; - context._add(context.data.byte(kIntrocount), 1); + context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); textforend(context); @@ -1921,12 +1921,12 @@ onelot: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._sub(context.bx, 1); + context._dec(context.bx); if (--context.cx) goto endcredits2; context.cx = context.pop(); looknext: context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext; context._cmp(context.al, 0); @@ -1948,7 +1948,7 @@ void priest(Context & context) { context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) goto priestwait; - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); context.push(context.es); context.push(context.bx); priesttext(context); @@ -1962,7 +1962,7 @@ priestspoken: void madmanstelly(Context & context) { context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 307); if (!context.flags.z()) goto notendtelly; context.ax = 300; @@ -1992,12 +1992,12 @@ void madman(Context & context) { context.data.byte(kCombatcount) = -1; context.data.byte(kSpeechcount) = 0; notfirstmad: - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 294); if (context.flags.z()) goto madmanspoken; context._cmp(context.ax, 66); if (!context.flags.z()) goto nomadspeak; - context._add(context.data.byte(kCombatcount), 1); + context._inc(context.data.byte(kCombatcount)); context.push(context.es); context.push(context.bx); madmantext(context); @@ -2262,7 +2262,7 @@ void advisor(Context & context) { if (!context.flags.z()) goto noadvisor; goto noadvisor; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 123); if (!context.flags.z()) goto notendadvis; context.ax = 106; @@ -2289,7 +2289,7 @@ void copper(Context & context) { checkspeed(context); if (!context.flags.z()) goto nocopper; context.ax = context.es.word(context.bx+3); - context._add(context.ax, 1); + context._inc(context.ax); context._cmp(context.ax, 94); if (!context.flags.z()) goto notendcopper; context.ax = 64; @@ -2306,7 +2306,7 @@ mightwait: context.ax = context.pop(); context._cmp(context.cl, 7); if (context.flags.c()) goto gotcopframe; - context._sub(context.ax, 1); + context._dec(context.ax); gotcopframe: context.es.word(context.bx+3) = context.ax; nocopper: @@ -2336,7 +2336,7 @@ notsparky1: context.es.word(context.bx+3) = 27; goto finishsparky; dosparky: - context._add(context.es.word(context.bx+3), 1); + context._inc(context.es.word(context.bx+3)); finishsparky: showgamereel(context); addtopeoplelist(context); @@ -2353,7 +2353,7 @@ void train(Context & context) { context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 21); if (!context.flags.c()) goto notrainyet; - context._add(context.ax, 1); + context._inc(context.ax); goto gottrainframe; notrainyet: randomnumber(context); @@ -2408,7 +2408,7 @@ noshow: void checkspeed(Context & context) { context._cmp(context.data.byte(kLastweapon), -1); if (!context.flags.z()) goto forcenext; - context._add(context.es.byte(context.bx+6), 1); + context._inc(context.es.byte(context.bx+6)); context.al = context.es.byte(context.bx+6); context._cmp(context.al, context.es.byte(context.bx+5)); if (!context.flags.z()) goto notspeed; @@ -2516,7 +2516,7 @@ skipsprite: context._add(context.bx, (32)); if (--context.cx) goto prtspriteloop; context.cx = context.pop(); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, 7); if (!context.flags.z()) goto priorityloop; return; @@ -2636,7 +2636,7 @@ void mainman(Context & context) { context.es.byte(context.bx+29) = 0; goto executewalk; notinnewroom: - context._sub(context.es.byte(context.bx+22), 1); + context._dec(context.es.byte(context.bx+22)); context._cmp(context.es.byte(context.bx+22), -1); if (context.flags.z()) goto executewalk; return; @@ -2665,7 +2665,7 @@ alreadyturned: goto notwalk; walkman: context.al = context.es.byte(context.bx+29); - context._add(context.al, 1); + context._inc(context.al); context._cmp(context.al, 11); if (!context.flags.z()) goto notanimend1; context.al = 1; @@ -2728,7 +2728,7 @@ higher: incdir: context.data.byte(kTurndirection) = 1; context.al = context.data.byte(kFacing); - context._add(context.al, 1); + context._inc(context.al); context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; @@ -2736,7 +2736,7 @@ incdir: decdir: context.data.byte(kTurndirection) = -1; context.al = context.data.byte(kFacing); - context._sub(context.al, 1); + context._dec(context.al); context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; @@ -2747,14 +2747,14 @@ void walking(Context & context) { context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalwalk; context.al = context.data.byte(kLinepointer); - context._sub(context.al, 1); + context._dec(context.al); context.data.byte(kLinepointer) = context.al; context._cmp(context.al, 200); if (!context.flags.c()) goto endofline; goto continuewalk; normalwalk: context.al = context.data.byte(kLinepointer); - context._add(context.al, 1); + context._inc(context.al); context.data.byte(kLinepointer) = context.al; context._cmp(context.al, context.data.byte(kLinelength)); if (!context.flags.c()) goto endofline; @@ -2842,7 +2842,7 @@ notnewdirect: isryanholding(context); context.bx = context.pop(); if (context.flags.z()) goto noshoe1; - context._add(context.bl, 1); + context._inc(context.bl); noshoe1: context.push(context.bx); context.al = 'W'; @@ -2852,14 +2852,14 @@ noshoe1: isryanholding(context); context.bx = context.pop(); if (context.flags.z()) goto noshoe2; - context._add(context.bl, 1); + context._inc(context.bl); noshoe2: context._cmp(context.bl, 2); if (context.flags.z()) goto notlouis; context.al = 42; context._cmp(context.bl, 0); if (context.flags.z()) goto notravmessage; - context._add(context.al, 1); + context._inc(context.al); notravmessage: context.cx = 80; context.dx = 10; @@ -2993,7 +2993,7 @@ void reminders(Context & context) { compare(context); if (!context.flags.z()) goto forgotone; havegotcard: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); notfirst: return; forgotone: @@ -3047,7 +3047,7 @@ initraintop: goto initraintop; initrainside: context.cl = context.data.byte(kMapxsize); - context._sub(context.cl, 1); + context._dec(context.cl); initrainside2: randomnumber(context); context._and(context.al, 31); @@ -3072,8 +3072,8 @@ lookforlinestart: getblockofpixel(context); context._cmp(context.al, 0); if (!context.flags.z()) goto foundlinestart; - context._sub(context.cl, 1); - context._add(context.ch, 1); + context._dec(context.cl); + context._inc(context.ch); context._cmp(context.cl, 0); if (context.flags.z()) goto endofthisline; context._cmp(context.ch, context.data.byte(kMapysize)); @@ -3086,13 +3086,13 @@ lookforlineend: getblockofpixel(context); context._cmp(context.al, 0); if (context.flags.z()) goto foundlineend; - context._sub(context.cl, 1); - context._add(context.ch, 1); + context._dec(context.cl); + context._inc(context.ch); context._cmp(context.cl, 0); if (context.flags.z()) goto foundlineend; context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) goto foundlineend; - context._add(context.bh, 1); + context._inc(context.bh); goto lookforlineend; foundlineend: context.push(context.cx); @@ -3222,7 +3222,7 @@ void backobject(Context & context) { context.al = context.es.byte(context.bx+18); context._cmp(context.al, 0); if (context.flags.z()) goto _tmp48z; - context._sub(context.al, 1); + context._dec(context.al); context.es.byte(context.bx+18) = context.al; goto finishback; _tmp48z: @@ -3275,7 +3275,7 @@ void liftsprite(Context & context) { context.al = context.es.byte(context.bx+19); context._cmp(context.al, 0); if (context.flags.z()) goto finishclose; - context._sub(context.al, 1); + context._dec(context.al); context._cmp(context.al, 11); if (!context.flags.z()) goto pokelift; context.push(context.ax); @@ -3290,7 +3290,7 @@ openlift: context.al = context.es.byte(context.bx+19); context._cmp(context.al, 12); if (context.flags.z()) goto endoflist; - context._add(context.al, 1); + context._inc(context.al); context._cmp(context.al, 1); if (!context.flags.z()) goto pokelift; context.push(context.ax); @@ -3319,7 +3319,7 @@ liftopen: context.es = context.pop(); context._cmp(context.data.byte(kCounttoclose), 0); if (context.flags.z()) goto nocountclose; - context._sub(context.data.byte(kCounttoclose), 1); + context._dec(context.data.byte(kCounttoclose)); context._cmp(context.data.byte(kCounttoclose), 0); if (!context.flags.z()) goto nocountclose; context.data.byte(kLiftflag) = 2; @@ -3335,7 +3335,7 @@ liftclosed: context.es = context.pop(); context._cmp(context.data.byte(kCounttoopen), 0); if (context.flags.z()) goto nocountopen; - context._sub(context.data.byte(kCounttoopen), 1); + context._dec(context.data.byte(kCounttoopen)); context._cmp(context.data.byte(kCounttoopen), 0); if (!context.flags.z()) goto nocountopen; context.data.byte(kLiftflag) = 3; @@ -3377,7 +3377,7 @@ void steady(Context & context) { } void constant(Context & context) { - context._add(context.es.byte(context.bx+19), 1); + context._inc(context.es.byte(context.bx+19)); context.cl = context.es.byte(context.bx+19); context.ch = 0; context._add(context.di, context.cx); @@ -3446,7 +3446,7 @@ opendoor: if (!context.flags.z()) goto notthrough; context.cl = 6; notthrough: - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, 1); if (!context.flags.z()) goto notdoorsound2; context.al = 0; @@ -3462,8 +3462,8 @@ notdoorsound2: context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); if (!context.flags.z()) goto atlast1; - context._sub(context.di, 1); - context._sub(context.cl, 1); + context._dec(context.di); + context._dec(context.cl); atlast1: context.es.byte(context.bx+19) = context.cl; context.al = context.ds.byte(context.di+18); @@ -3485,7 +3485,7 @@ nothoteldoor1: notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; - context._sub(context.cl, 1); + context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; @@ -3556,15 +3556,15 @@ noturnonyet: if (!context.flags.z()) goto notthrough2; context.cl = 6; notthrough2: - context._add(context.cl, 1); + context._inc(context.cl); context.ch = 0; context.push(context.di); context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); if (!context.flags.z()) goto atlast3; - context._sub(context.di, 1); - context._sub(context.cl, 1); + context._dec(context.di); + context._dec(context.cl); atlast3: context.es.byte(context.bx+19) = context.cl; context.al = context.ds.byte(context.di+18); @@ -3585,7 +3585,7 @@ shutdoor2: notdoorsound3: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast4; - context._sub(context.cl, 1); + context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast4: context.ch = 0; @@ -3621,7 +3621,7 @@ nothoteldoor1: notdoorsound1: context._cmp(context.cl, 0); if (context.flags.z()) goto atlast2; - context._sub(context.cl, 1); + context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast2: context.ch = 0; @@ -3646,7 +3646,7 @@ void updatepeople(Context & context) { context.cx = 12*5; context.al = 255; while(context.cx--) context._stosb(); - context._add(context.data.word(kMaintimer), 1); + context._inc(context.data.word(kMaintimer)); context.es = context.cs; context.bx = 534; context.di = 991; @@ -3709,7 +3709,7 @@ retryreel: context._cmp(context.al, 255); if (context.flags.z()) goto normalreel; dealwithspecial(context); - context._add(context.data.word(kReelpointer), 1); + context._inc(context.data.word(kReelpointer)); context.si = context.pop(); context.es = context.pop(); context._add(context.si, 40); @@ -4282,7 +4282,7 @@ deloneloop: context.cx = context.pop(); context._add(context.di, context.ax); context._add(context.si, context.dx); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto deloneloop; return; } @@ -4566,7 +4566,7 @@ firstbitofblock: context._movsw(); context._movsw(); context._add(context.di, (320)-16); - context._sub(context.bh, 1); + context._dec(context.bh); if (!context.flags.z()) goto firstbitofblock; context.bh = 12; loop125: @@ -4582,7 +4582,7 @@ loop125: context._stosw(); context._stosw(); context._add(context.di, (320)-20); - context._sub(context.bh, 1); + context._dec(context.bh); if (!context.flags.z()) goto loop125; context._add(context.di, 4); context.ax = 0x0dfdf; @@ -4751,11 +4751,11 @@ frameloop2: context._cmp(context.al, 0); if (!context.flags.z()) goto backtosolid; backtoother: - context._add(context.di, 1); + context._inc(context.di); if (--context.cx) goto frameloop2; context.cx = context.pop(); context._add(context.di, context.dx); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto frameloop1; return; frameloop3: @@ -4767,7 +4767,7 @@ backtosolid: if (--context.cx) goto frameloop3; context.cx = context.pop(); context._add(context.di, context.dx); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto frameloop1; return; } @@ -4794,13 +4794,13 @@ bhloop1: if (--context.cx) goto bhloop1; goto nextline; nofill: - context._add(context.di, 1); - context._add(context.si, 1); + context._inc(context.di); + context._inc(context.si); if (--context.cx) goto bhloop1; nextline: context._add(context.di, context.dx); context.cx = context.pop(); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto bhloop2; return; } @@ -4824,11 +4824,11 @@ frameloopfx2: context._cmp(context.al, 0); if (!context.flags.z()) goto backtosolidfx; backtootherfx: - context._sub(context.di, 1); + context._dec(context.di); if (--context.cx) goto frameloopfx2; context.cx = context.pop(); context._add(context.di, context.dx); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; return; frameloopfx3: @@ -4837,11 +4837,11 @@ frameloopfx3: if (context.flags.z()) goto backtootherfx; backtosolidfx: context.es.byte(context.di) = context.al; - context._sub(context.di, 1); + context._dec(context.di); if (--context.cx) goto frameloopfx3; context.cx = context.pop(); context._add(context.di, context.dx); - context._sub(context.ch, 1); + context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; return; } @@ -4854,7 +4854,7 @@ void transferinv(Context & context) { context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); - context._add(context.ax, 1); + context._inc(context.ax); context.cx = 6; context._mul(context.cx); context.es = context.data.word(kExtras); @@ -4867,7 +4867,7 @@ void transferinv(Context & context) { context.bx = context.ax; context._add(context.ax, context.ax); context._add(context.ax, context.bx); - context._add(context.ax, 1); + context._inc(context.ax); context.cx = 6; context._mul(context.cx); context.ds = context.data.word(kFreeframes); @@ -5049,7 +5049,7 @@ halfend: context.al = context.es.byte(context.bx); context._shr(context.al, 1); context.es.byte(context.bx) = context.al; - context._add(context.bx, 1); + context._inc(context.bx); if (--context.cx) goto halfend; context.ds = context.data.word(kBuffers); context.es = context.data.word(kBuffers); @@ -5234,12 +5234,12 @@ onelot2: context.cx = context.pop(); context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) goto endearly2; - context._sub(context.bx, 1); + context._dec(context.bx); if (--context.cx) goto endcredits22; context.cx = context.pop(); looknext2: context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, ':'); if (context.flags.z()) goto gotnext2; context._cmp(context.al, 0); @@ -5272,19 +5272,19 @@ fadecolloop: context._cmp(context.al, context.ah); if (context.flags.z()) goto gotthere; if (context.flags.c()) goto lesscolour; - context._sub(context.es.byte(context.si), 1); + context._dec(context.es.byte(context.si)); goto gotthere; lesscolour: context._cmp(context.bl, context.ah); if (context.flags.z()) goto withit; if (!context.flags.c()) goto gotthere; withit: - context._add(context.es.byte(context.si), 1); + context._inc(context.es.byte(context.si)); gotthere: - context._add(context.si, 1); - context._add(context.di, 1); + context._inc(context.si); + context._inc(context.di); if (--context.cx) goto fadecolloop; - context._sub(context.data.byte(kFadecount), 1); + context._dec(context.data.byte(kFadecount)); return; nomorefading: context.data.byte(kFadedirection) = 0; @@ -5316,7 +5316,7 @@ greysumloop1: context._add(context.bx, context.ax); context.al = -1; greysumloop2: - context._add(context.al, 1); + context._inc(context.al); context._sub(context.bx, 100); if (!context.flags.c()) goto greysumloop2; context.bl = context.al; @@ -5578,7 +5578,7 @@ nextbit: context._cmp(context.al, 0); if (!context.flags.z()) goto nextbit; context.ax = context.pop(); - context._add(context.al, 1); + context._inc(context.al); context._cmp(context.al, 44); if (!context.flags.z()) goto nextmonkspeak; context.data.byte(kVolumedirection) = 1; @@ -5939,7 +5939,7 @@ iskern: if (context.flags.z()) goto kernit; return; kernit: - context._sub(context.cl, 1); + context._dec(context.cl); return; } @@ -5971,7 +5971,7 @@ printloopslow5: context.cx = context.pop(); context.bx = context.pop(); context.ax = context.es.word(context.si+1); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto finishslow; context._cmp(context.al, ':'); @@ -6010,7 +6010,7 @@ afterslow: context.es = context.pop(); context.si = context.pop(); context.cx = context.pop(); - context._add(context.si, 1); + context._inc(context.si); if (--context.cx) goto printloopslow5; context.dx = context.pop(); context.di = context.pop(); @@ -6085,7 +6085,7 @@ printloop6: context.ch = 0; printloop5: context.ax = context.es.word(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto finishdirct; context._cmp(context.al, ':'); @@ -6125,7 +6125,7 @@ printloop8: context.ch = 0; printloop7: context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, ':'); if (context.flags.z()) goto finishmon2; context._cmp(context.al, 0); @@ -6137,8 +6137,8 @@ printloop7: context._cmp(context.al, '%'); if (!context.flags.z()) goto nottrigger; context.ah = context.es.byte(context.si); - context._add(context.si, 1); - context._add(context.si, 1); + context._inc(context.si); + context._inc(context.si); goto finishmon; nottrigger: context.push(context.cx); @@ -6296,8 +6296,8 @@ void getnextword(Context & context) { context.bx = 0; getloop: context.ax = context.es.word(context.di); - context._add(context.di, 1); - context._add(context.bh, 1); + context._inc(context.di); + context._inc(context.bh); context._cmp(context.al, ':'); if (context.flags.z()) goto endall; context._cmp(context.al, 0); @@ -6464,7 +6464,7 @@ nextopenslot: context.di = context.pop(); context.cx = context.pop(); context._add(context.di, (44)); - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, 5); if (!context.flags.z()) goto openloop1; undertextline(context); @@ -6497,7 +6497,7 @@ findryanloop: context.di = context.pop(); notinryaninv: context._add(context.bx, 16); - context._add(context.ch, 1); + context._inc(context.ch); context._cmp(context.ch, (114)); if (!context.flags.z()) goto findryanloop; return; @@ -6536,7 +6536,7 @@ noloccheck: context.di = context.pop(); findopen2: context._add(context.bx, 16); - context._add(context.ch, 1); + context._inc(context.ch); context._cmp(context.ch, (114)); if (!context.flags.z()) goto findopen1; context.cl = context.data.byte(kOpenedob); @@ -6562,7 +6562,7 @@ findopen1a: context.di = context.pop(); findopen2a: context._add(context.bx, 16); - context._add(context.ch, 1); + context._inc(context.ch); context._cmp(context.ch, 80); if (!context.flags.z()) goto findopen1a; return; @@ -6598,7 +6598,7 @@ isanextra: context.cl = context.al; context._add(context.al, context.al); context._add(context.al, context.cl); - context._add(context.al, 1); + context._inc(context.al); context.ah = 128; context._add(context.bx, 19); context._add(context.di, 18); @@ -6753,7 +6753,7 @@ doincryan: context._sub(context.ax, (80)+167); context.data.byte(kRyanpage) = -1; findnewpage: - context._add(context.data.byte(kRyanpage), 1); + context._inc(context.data.byte(kRyanpage)); context._sub(context.ax, 18); if (!context.flags.c()) goto findnewpage; delpointer(context); @@ -6876,7 +6876,7 @@ void obpicture(Context & context) { context.cl = context.al; context._add(context.al, context.al); context._add(context.al, context.cl); - context._add(context.al, 1); + context._inc(context.al); context.ah = 128; showframe(context); return; @@ -6889,7 +6889,7 @@ exframe: context.cl = context.al; context._add(context.al, context.al); context._add(context.al, context.cl); - context._add(context.al, 1); + context._inc(context.al); context.ah = 128; showframe(context); return; @@ -7033,13 +7033,13 @@ findsometext: void searchforsame(Context & context) { context.si = context.cx; searchagain: - context._add(context.si, 1); + context._inc(context.si); context.al = context.es.byte(context.bx); search: context._cmp(context.es.byte(context.si), context.al); if (context.flags.z()) goto gotstartletter; - context._add(context.cx, 1); - context._add(context.si, 1); + context._inc(context.cx); + context._inc(context.si); context._cmp(context.si, 8000); if (context.flags.c()) goto search; context.si = context.bx; @@ -7049,8 +7049,8 @@ gotstartletter: context.push(context.bx); context.push(context.si); keepchecking: - context._add(context.si, 1); - context._add(context.bx, 1); + context._inc(context.si); + context._inc(context.bx); context.al = context.es.byte(context.bx); context.ah = context.es.byte(context.si); context._cmp(context.al, ':'); @@ -7071,7 +7071,7 @@ foundmatch: void findnextcolon(Context & context) { isntcolon: context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto endofcolon; context._cmp(context.al, ':'); @@ -7672,7 +7672,7 @@ void findinvpos(Context & context) { context._sub(context.cx, (80)); context.bx = -1; findinv1: - context._add(context.bx, 1); + context._inc(context.bx); context._sub(context.cx, (44)); if (!context.flags.c()) goto findinv1; context.cx = context.data.word(kMousey); @@ -7700,7 +7700,7 @@ void findopenpos(Context & context) { context._sub(context.cx, (80)); context.bx = -1; findopenp1: - context._add(context.bx, 1); + context._inc(context.bx); context._sub(context.cx, (44)); if (!context.flags.c()) goto findopenp1; context.al = context.bl; @@ -8242,7 +8242,7 @@ notinsidethis: context.es = context.pop(); context.cx = context.pop(); context._add(context.bx, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, 80); if (!context.flags.z()) goto pickupcontloop; notopenable: @@ -8301,7 +8301,7 @@ void transfertext(Context & context) { moretext: context._lodsb(); context._stosb(); - context._add(context.data.word(kExtextpos), 1); + context._inc(context.data.word(kExtextpos)); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; return; @@ -8315,7 +8315,7 @@ tryanotherex: context._cmp(context.es.byte(context.di+2), 255); if (context.flags.z()) goto foundnewex; context._add(context.di, 16); - context._add(context.al, 1); + context._inc(context.al); context._cmp(context.al, (114)); if (!context.flags.z()) goto tryanotherex; foundnewex: @@ -8345,7 +8345,7 @@ purgeloc: context.di = context.pop(); dontpurge: context._add(context.di, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto purgeloc; return; @@ -8390,7 +8390,7 @@ iscup: return; cantpurge: context._add(context.di, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge; context.di = (0+2080+30000); @@ -8406,7 +8406,7 @@ lookforpurge2: return; cantpurge2: context._add(context.di, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge2; return; @@ -8429,7 +8429,7 @@ void deleteexobject(Context & context) { context.cl = context.al; context._add(context.al, context.al); context._add(context.al, context.cl); - context._add(context.al, 1); + context._inc(context.al); deleteexframe(context); context.ax = context.pop(); deleteextext(context); @@ -8450,7 +8450,7 @@ deleteconts: context.bx = context.pop(); notinsideex: context._add(context.di, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto deleteconts; return; @@ -8508,8 +8508,8 @@ void deleteextext(Context & context) { context.ax = 0; findlenextext: context.cl = context.es.byte(context.si); - context._add(context.ax, 1); - context._add(context.si, 1); + context._inc(context.ax); + context._inc(context.si); context._cmp(context.cl, 0); if (!context.flags.z()) goto findlenextext; context.cx = (18000); @@ -8598,7 +8598,7 @@ dimloop1: addalong(context); context._cmp(context.al, 0); if (!context.flags.z()) goto finishdim1; - context._add(context.ch, 1); + context._inc(context.ch); goto dimloop1; finishdim1: context.bx = (0+(228*13)+32+60+(32*32)); @@ -8609,7 +8609,7 @@ dimloop2: context.bx = context.pop(); context._cmp(context.al, 0); if (!context.flags.z()) goto finishdim2; - context._add(context.cl, 1); + context._inc(context.cl); context._add(context.bx, 3); goto dimloop2; finishdim2: @@ -8621,7 +8621,7 @@ dimloop3: context.bx = context.pop(); context._cmp(context.al, 0); if (!context.flags.z()) goto finishdim3; - context._sub(context.dh, 1); + context._dec(context.dh); context._sub(context.bx, 11*3); goto dimloop3; finishdim3: @@ -8633,7 +8633,7 @@ dimloop4: context.bx = context.pop(); context._cmp(context.al, 0); if (!context.flags.z()) goto finishdim4; - context._sub(context.dl, 1); + context._dec(context.dl); context._sub(context.bx, 3); goto dimloop4; finishdim4: @@ -8676,7 +8676,7 @@ addloop: context._cmp(context.es.byte(context.bx), 0); if (!context.flags.z()) goto gotalong; context._add(context.bx, 3); - context._sub(context.ah, 1); + context._dec(context.ah); if (!context.flags.z()) goto addloop; context.al = 0; return; @@ -8691,7 +8691,7 @@ addloop2: context._cmp(context.es.byte(context.bx), 0); if (!context.flags.z()) goto gotlength; context._add(context.bx, 3*11); - context._sub(context.ah, 1); + context._dec(context.ah); if (!context.flags.z()) goto addloop2; context.al = 0; return; @@ -8833,11 +8833,11 @@ drawnsetob: context._add(context.si, 5); context.data.word(kListpos) = context.si; blankframe: - context._add(context.data.byte(kCurrentob), 1); + context._inc(context.data.byte(kCurrentob)); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 64); - context._sub(context.cx, 1); + context._dec(context.cx); if (context.flags.z()) goto finishedsetobs; goto showobsloop; finishedsetobs: @@ -8944,11 +8944,11 @@ loop127: context._add(context.si, 5); context.data.word(kListpos) = context.si; over138: - context._add(context.data.byte(kCurrentfree), 1); + context._inc(context.data.byte(kCurrentfree)); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, 80); if (context.flags.z()) goto finfree; goto loop127; @@ -9028,11 +9028,11 @@ notinroom: context._add(context.si, 5); context.data.word(kListpos) = context.si; blankex: - context._add(context.data.byte(kCurrentex), 1); + context._inc(context.data.byte(kCurrentex)); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 16); - context._add(context.cx, 1); + context._inc(context.cx); context._cmp(context.cx, 100); if (context.flags.z()) goto finex; goto exloop; @@ -9115,11 +9115,11 @@ over146: void getxad(Context & context) { context.cl = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context.ah = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.cl, 0); if (!context.flags.z()) goto over148; context._sub(context.al, context.data.byte(kMapx)); @@ -9139,9 +9139,9 @@ over148: void getyad(Context & context) { context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context.ah = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._sub(context.al, context.data.byte(kMapy)); if (context.flags.c()) goto over147; context._cmp(context.al, 10); @@ -9164,7 +9164,7 @@ void autolook(Context & context) { context.ax = context.data.word(kMousey); context._cmp(context.ax, context.data.word(kOldy)); if (!context.flags.z()) goto diffmouse; - context._sub(context.data.word(kLookcounter), 1); + context._dec(context.data.word(kLookcounter)); context._cmp(context.data.word(kLookcounter), 0); if (!context.flags.z()) goto noautolook; context._cmp(context.data.word(kWatchingtime), 0); @@ -9456,7 +9456,7 @@ watchtalk: worktoscreenm(context); context.cx = 180; hangonpq(context); - context._add(context.data.byte(kTalkpos), 1); + context._inc(context.data.byte(kTalkpos)); context.al = context.data.byte(kTalkpos); context.al = context.data.byte(kCharacter); context._and(context.al, 127); @@ -9501,7 +9501,7 @@ watchtalk: context.cx = 180; hangonpq(context); skiptalk: - context._add(context.data.byte(kTalkpos), 1); + context._inc(context.data.byte(kTalkpos)); goto watchtalk; endwatchtalk: context.data.byte(kPointermode) = 0; @@ -9531,7 +9531,7 @@ hangloopq: if (!context.flags.z()) goto notspeaking; context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto notspeaking; - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.bx, 40); if (context.flags.z()) goto finishconv; notspeaking: @@ -9861,7 +9861,7 @@ alreadydu: context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodu; searchdestup: - context._add(context.data.byte(kDestpos), 1); + context._inc(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), 15); if (!context.flags.z()) goto notlastdest; context.data.byte(kDestpos) = 0; @@ -9899,7 +9899,7 @@ alreadydd: context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) goto nodd; searchdestdown: - context._sub(context.data.byte(kDestpos), 1); + context._dec(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), -1); if (!context.flags.z()) goto notfirstdest; context.data.byte(kDestpos) = 15; @@ -10242,7 +10242,7 @@ void lookininterface(Context & context) { context._cmp(context.cl, (114)); if (context.flags.z()) goto emptyinterface; context.al = context.es.byte(context.bx+15); - context._add(context.al, 1); + context._inc(context.al); return; emptyinterface: context.al = 0; @@ -10469,7 +10469,7 @@ notleadingspace: context.es.byte(context.si+1) = context.cl; context.ch = 0; context._add(context.data.word(kMonadx), context.cx); - context._add(context.data.word(kCurpos), 1); + context._inc(context.data.word(kCurpos)); context._add(context.data.word(kCurslocx), context.cx); goto waitkey; endofinput: @@ -10485,7 +10485,7 @@ notupperc: } void delchar(Context & context) { - context._sub(context.data.word(kCurpos), 1); + context._dec(context.data.word(kCurpos)); context.si = context.data.word(kCurpos); context._add(context.si, context.si); context.es = context.cs; @@ -10531,7 +10531,7 @@ comloop2: context.al = context.ds.byte(context.si); context._add(context.si, 2); context.ah = context.es.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.ah, 32); if (context.flags.z()) goto foundcom; context._cmp(context.al, context.ah); @@ -10539,7 +10539,7 @@ comloop2: context.si = context.pop(); context.bx = context.pop(); context._add(context.bx, 10); - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, 6); if (!context.flags.z()) goto comloop; neterror(context); @@ -10604,10 +10604,10 @@ dirroot: context.data.byte(kLogonum) = 0; context.ds = context.cs; context.si = 2885; - context._add(context.si, 1); + context._inc(context.si); context.es = context.cs; context.di = 2892; - context._add(context.di, 1); + context._inc(context.di); context.cx = 12; while(context.cx--) context._movsb(); monitorlogo(context); @@ -10628,7 +10628,7 @@ void searchforfiles(Context & context) { context.bx = (66*2); directloop1: context.al = context.es.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.al, '*'); if (context.flags.z()) goto endofdir; context._cmp(context.al, 34); @@ -10641,7 +10641,7 @@ endofdir: void signon(Context & context) { parser(context); - context._add(context.di, 1); + context._inc(context.di); context.ds = context.cs; context.si = 2807; context.cx = 4; @@ -10657,7 +10657,7 @@ signonloop2: if (context.flags.z()) goto foundsign; makecaps(context); context.ah = context.es.byte(context.di); - context._add(context.di, 1); + context._inc(context.di); context._cmp(context.al, context.ah); if (!context.flags.z()) goto nomatch; if (--context.cx) goto signonloop2; @@ -10706,7 +10706,7 @@ notyetassigned: checkpass: context._lodsw(); context.ah = context.es.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.ah, 32); if (context.flags.z()) goto passpassed; context._cmp(context.al, context.ah); @@ -10812,7 +10812,7 @@ keyok1: monmessage(context); return; findtopictext: - context._add(context.bx, 1); + context._inc(context.bx); context.push(context.es); context.push(context.bx); monitorlogo(context); @@ -10898,7 +10898,7 @@ keyok2: context.es = context.pop(); directloop2: context.al = context.es.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.al, 34); if (context.flags.z()) goto endofdir2; context._cmp(context.al, '*'); @@ -10913,7 +10913,7 @@ endofdir2: } void getkeyandlogo(Context & context) { - context._add(context.bx, 1); + context._inc(context.bx); context.al = context.es.byte(context.bx); context._sub(context.al, 48); context.data.byte(kNewlogonum) = context.al; @@ -10921,7 +10921,7 @@ void getkeyandlogo(Context & context) { context.al = context.es.byte(context.bx); context._sub(context.al, 48); context.data.byte(kKeynum) = context.al; - context._add(context.bx, 1); + context._inc(context.bx); context.push(context.es); context.push(context.bx); context.al = context.data.byte(kKeynum); @@ -10976,13 +10976,13 @@ nofindingtopic: context.ah = context.es.byte(context.di); context._cmp(context.al, context.dl); if (!context.flags.z()) goto notbracket; - context._add(context.dh, 1); + context._inc(context.dh); context._cmp(context.dh, 2); if (context.flags.z()) goto complete; notbracket: context._cmp(context.al, context.ah); if (!context.flags.z()) goto restartlook; - context._add(context.di, 1); + context._inc(context.di); goto keeplooking; complete: context.es = context.ds; @@ -11107,7 +11107,7 @@ curfileloop: context.al = context.cs.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) goto finishfile; - context._add(context.si, 1); + context._inc(context.si); context.push(context.si); modifychar(context); context.ds = context.data.word(kTempcharset); @@ -11126,7 +11126,7 @@ void monmessage(Context & context) { context.ch = 0; monmessageloop: context.al = context.es.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.al, '+'); if (!context.flags.z()) goto monmessageloop; if (--context.cx) goto monmessageloop; @@ -11216,7 +11216,7 @@ void printcurs(Context & context) { context.di = context.pop(); context.push(context.bx); context.push(context.di); - context._add(context.data.word(kMaintimer), 1); + context._inc(context.data.word(kMaintimer)); context.ax = context.data.word(kMaintimer); context._and(context.al, 16); if (!context.flags.z()) goto flashcurs; @@ -11456,7 +11456,7 @@ void hotelbell(Context & context) { } void opentomb(Context & context) { - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 35*2; context.data.word(kReeltowatch) = 1; @@ -11471,7 +11471,7 @@ void usetrainer(Context & context) { getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); makeworn(context); showseconduse(context); putbackobstuff(context); @@ -11545,7 +11545,7 @@ alreadyfull: } void usefullcart(Context & context) { - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.al = 2; context.ah = context.data.byte(kRoomnum); context._add(context.ah, 6); @@ -11584,7 +11584,7 @@ plinthwith: putbackobstuff(context); return; isrightkey: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showseconduse(context); context.data.word(kWatchingtime) = 220; context.data.word(kReeltowatch) = 0; @@ -11643,7 +11643,7 @@ void slabdoora(Context & context) { context.data.word(kReeltowatch) = 13; context._cmp(context.data.byte(kDreamnumber), 3); if (!context.flags.z()) goto slabawrong; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 42; context.data.byte(kNewlocation) = 47; @@ -11672,7 +11672,7 @@ void slabdoorb(Context & context) { return; gotcrystal: showfirstuse(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; @@ -11702,7 +11702,7 @@ void slabdoord(Context & context) { context.data.word(kReeltowatch) = 75; context._cmp(context.data.byte(kDreamnumber), 0); if (!context.flags.z()) goto slabcwrong; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 102; context.data.byte(kNewlocation) = 47; @@ -11723,7 +11723,7 @@ void slabdoorc(Context & context) { context.data.word(kReeltowatch) = 108; context._cmp(context.data.byte(kDreamnumber), 4); if (!context.flags.z()) goto slabdwrong; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 135; context.data.byte(kNewlocation) = 47; @@ -11744,7 +11744,7 @@ void slabdoore(Context & context) { context.data.word(kReeltowatch) = 141; context._cmp(context.data.byte(kDreamnumber), 5); if (!context.flags.z()) goto slabewrong; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 168; context.data.byte(kNewlocation) = 47; @@ -11765,7 +11765,7 @@ void slabdoorf(Context & context) { context.data.word(kReeltowatch) = 171; context._cmp(context.data.byte(kDreamnumber), 2); if (!context.flags.z()) goto slabfwrong; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 197; context.data.byte(kNewlocation) = 47; @@ -11805,7 +11805,7 @@ nextslab: context.push(context.ax); removesetobject(context); context.ax = context.pop(); - context._add(context.al, 1); + context._inc(context.al); context.push(context.ax); placesetobject(context); context.ax = context.pop(); @@ -11819,7 +11819,7 @@ nextslab: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; notlastslab: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kGetback) = 1; return; @@ -11852,9 +11852,9 @@ nextcart: context.push(context.ax); removesetobject(context); context.ax = context.pop(); - context._add(context.al, 1); + context._inc(context.al); placesetobject(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.al = 17; playchannel1(context); showfirstuse(context); @@ -11882,7 +11882,7 @@ clearboxwith: putbackobstuff(context); return; openbox: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 80; context.data.word(kReeltowatch) = 67; @@ -11894,7 +11894,7 @@ openbox: } void usecoveredbox(Context & context) { - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 50; context.data.word(kReeltowatch) = 41; @@ -11942,7 +11942,7 @@ openboxwith: showfirstuse(context); return; destoryopenbox: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.cx = 300; context.al = 37; showpuztext(context); @@ -12080,7 +12080,7 @@ void usealtar(Context & context) { context.data.byte(kGetback) = 1; return; movealtar: - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showseconduse(context); context.data.word(kWatchingtime) = 160; context.data.word(kReeltowatch) = 81; @@ -12148,7 +12148,7 @@ void openlouis(Context & context) { void nextcolon(Context & context) { lookcolon: context.al = context.es.byte(context.si); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; return; @@ -12167,7 +12167,7 @@ void openyourneighbour(Context & context) { void usewindow(Context & context) { context._cmp(context.data.byte(kManspath), 6); if (!context.flags.z()) goto notonbalc; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kNewlocation) = 29; context.data.byte(kGetback) = 1; @@ -12194,7 +12194,7 @@ void usebalcony(Context & context) { turnpathoff(context); context.al = 5; turnpathoff(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kManspath) = 6; context.data.byte(kDestination) = 6; context.data.byte(kFinaldest) = 6; @@ -12354,7 +12354,7 @@ dograf: } void trapdoor(Context & context) { - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); switchryanoff(context); context.data.word(kWatchingtime) = 20*2; @@ -12513,7 +12513,7 @@ getscash: context.cx = 300; context.al = 18; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kCard1money) = 12432; context.data.byte(kGetback) = 1; return; @@ -12558,7 +12558,7 @@ correctcard2: placesetobject(context); context.data.byte(kGunpassflag) = 1; context._sub(context.data.word(kCard1money), 2000); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; return; nocash: @@ -12608,7 +12608,7 @@ rightcard: context.cx = 300; context.al = 25; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context._sub(context.data.word(kCard1money), 8300); context.data.byte(kCardpassflag) = 1; context.data.byte(kGetback) = 1; @@ -12732,31 +12732,31 @@ void moneypoke(Context & context) { context.bx = 3385; context.cl = 48-1; numberpoke0: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 10000); if (!context.flags.c()) goto numberpoke0; context._add(context.ax, 10000); context.cs.byte(context.bx) = context.cl; - context._add(context.bx, 1); + context._inc(context.bx); context.cl = 48-1; numberpoke1: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 1000); if (!context.flags.c()) goto numberpoke1; context._add(context.ax, 1000); context.cs.byte(context.bx) = context.cl; - context._add(context.bx, 1); + context._inc(context.bx); context.cl = 48-1; numberpoke2: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 100); if (!context.flags.c()) goto numberpoke2; context._add(context.ax, 100); context.cs.byte(context.bx) = context.cl; - context._add(context.bx, 1); + context._inc(context.bx); context.cl = 48-1; numberpoke3: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 10); if (!context.flags.c()) goto numberpoke3; context._add(context.ax, 10); @@ -12845,14 +12845,14 @@ jimmycontrols: context.cx = 300; context.al = 10; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); putbackobstuff(context); return; } @@ -12905,7 +12905,7 @@ wireknife: context.cx = 300; context.al = 11; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; return; } @@ -13132,7 +13132,7 @@ void useaxe(Context & context) { context._cmp(context.data.byte(kMapy), 10); if (context.flags.z()) goto axeondoor; showseconduse(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kLastweapon) = 2; context.data.byte(kGetback) = 1; removeobfrominv(context); @@ -13145,7 +13145,7 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 46*2; context.data.word(kReeltowatch) = 31; context.data.word(kEndwatchreel) = 77; @@ -13179,7 +13179,7 @@ axeondoor: context.al = 15; context.cx = 300; showpuztext(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 46*2; context.data.word(kReeltowatch) = 31; context.data.word(kEndwatchreel) = 77; @@ -13304,7 +13304,7 @@ findsetloop: return; nofind: context._add(context.bx, 64); - context._add(context.dl, 1); + context._inc(context.dl); context._cmp(context.dl, 128); if (!context.flags.z()) goto findsetloop; context.al = context.dl; @@ -13332,7 +13332,7 @@ findexloop: return; nofindex: context._add(context.bx, 16); - context._add(context.dl, 1); + context._inc(context.dl); context._cmp(context.dl, (114)); if (!context.flags.z()) goto findexloop; context.al = context.dl; @@ -13363,7 +13363,7 @@ searchinv: return; nofindininv: context._add(context.bx, 16); - context._add(context.dl, 1); + context._inc(context.dl); context._cmp(context.dl, (114)); if (!context.flags.z()) goto searchinv; context.al = context.dl; @@ -13383,7 +13383,7 @@ insideloop: return; notfoundinside: context._add(context.bx, 16); - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, (114)); if (!context.flags.z()) goto insideloop; return; @@ -13633,7 +13633,7 @@ notinalley: if (!context.flags.z()) goto notinedens; context._cmp(context.data.byte(kGeneraldead), 1); if (!context.flags.z()) goto edenspart2; - context._add(context.data.byte(kGeneraldead), 1); + context._inc(context.data.byte(kGeneraldead)); context.al = 44; placesetobject(context); context.al = 18; @@ -13660,7 +13660,7 @@ edenspart2: removesetobject(context); context.al = 55; placesetobject(context); - context._add(context.data.byte(kSartaindead), 1); + context._inc(context.data.byte(kSartaindead)); notedens2: return; notinedens: @@ -13781,7 +13781,7 @@ cantsetup2: void usetimedtext(Context & context) { context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto notext; - context._sub(context.data.word(kTimecount), 1); + context._dec(context.data.word(kTimecount)); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto deltimedtext; context.ax = context.data.word(kTimecount); @@ -13904,7 +13904,7 @@ cutgate: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.al = 3; turnpathon(context); context._cmp(context.data.byte(kAidedead), 0); @@ -13930,7 +13930,7 @@ istakengun: context.data.byte(kLastweapon) = 1; context.data.byte(kCombatcount) = 39; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; notinpoolroom: context._cmp(context.data.byte(kReallocation), 25); @@ -13944,7 +13944,7 @@ notinpoolroom: context.data.byte(kDreamnumber) = 2; context.data.byte(kRoomafterdream) = 38; context.data.byte(kSartaindead) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; nothelicopter: context._cmp(context.data.byte(kReallocation), 27); @@ -13959,7 +13959,7 @@ nothelicopter: context.data.byte(kGetback) = 1; context.data.byte(kRoomafterdream) = 32; context.data.byte(kDreamnumber) = 0; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; notinrockroom: context._cmp(context.data.byte(kReallocation), 8); @@ -13978,7 +13978,7 @@ notinrockroom: autosetwalk(context); context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; notbystudio: context._cmp(context.data.byte(kReallocation), 6); @@ -13999,7 +13999,7 @@ notbystudio: placesetobject(context); context.al = 1; context.ah = context.data.byte(kRoomnum); - context._sub(context.ah, 1); + context._dec(context.ah); turnanypathon(context); context.data.byte(kLiftflag) = 1; context.data.word(kWatchingtime) = 40*2; @@ -14008,7 +14008,7 @@ notbystudio: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; notsarters: context._cmp(context.data.byte(kReallocation), 29); @@ -14030,7 +14030,7 @@ notsarters: context.data.byte(kAidedead) = 1; context.data.byte(kDreamnumber) = 3; context.data.byte(kRoomafterdream) = 33; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; notaide: context._cmp(context.data.byte(kReallocation), 23); @@ -14078,7 +14078,7 @@ void useshield(Context & context) { context.data.byte(kLastweapon) = 3; showseconduse(context); context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); removeobfrominv(context); return; notinsartroom: @@ -14094,7 +14094,7 @@ void usebuttona(Context & context) { showfirstuse(context); context.al = 0; context.ah = context.data.byte(kRoomnum); - context._sub(context.ah, 1); + context._dec(context.ah); turnanypathon(context); context.al = 9; removesetobject(context); @@ -14106,7 +14106,7 @@ void usebuttona(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; donethisbit: showseconduse(context); @@ -14153,7 +14153,7 @@ unscrewplate: removesetobject(context); context.al = 0; placefreeobject(context); - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; return; triedknife: @@ -14190,7 +14190,7 @@ void usewinch(Context & context) { context.data.byte(kGeneraldead) = 1; context.data.byte(kNewsitem) = 2; context.data.byte(kGetback) = 1; - context._add(context.data.byte(kProgresspoints), 1); + context._inc(context.data.byte(kProgresspoints)); return; nowinch: showfirstuse(context); @@ -14220,7 +14220,7 @@ keypadloop: showpointer(context); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nopresses; - context._sub(context.data.byte(kPresscount), 1); + context._dec(context.data.byte(kPresscount)); goto afterpress; nopresses: context.data.byte(kPressed) = 255; @@ -14308,7 +14308,7 @@ not10: context.es = context.dx; context._add(context.bx, 8344); context.es.byte(context.bx) = context.al; - context._add(context.data.word(kPresspointer), 1); + context._inc(context.data.word(kPresspointer)); nomorekeys: return; } @@ -14474,7 +14474,7 @@ void showkeypad(Context & context) { singlekey(context); context._cmp(context.data.byte(kLightcount), 0); if (context.flags.z()) goto notenter; - context._sub(context.data.byte(kLightcount), 1); + context._dec(context.data.byte(kLightcount)); context.al = 36; context.bx = (72)-1+63; context._cmp(context.data.byte(kLockstatus), 0); @@ -14486,7 +14486,7 @@ changelight: if (context.flags.c()) goto gotlight; context._cmp(context.data.byte(kLightcount), 100); if (!context.flags.c()) goto gotlight; - context._sub(context.al, 1); + context._dec(context.al); gotlight: context.ds = context.data.word(kTempgraphics); context.ah = 0; @@ -14629,7 +14629,7 @@ void showoutermenu(Context & context) { } void showmenu(Context & context) { - context._add(context.data.byte(kMenucount), 1); + context._inc(context.data.byte(kMenucount)); context._cmp(context.data.byte(kMenucount), 37*2); if (!context.flags.z()) goto menuframeok; context.data.byte(kMenucount) = 0; @@ -14702,7 +14702,7 @@ alreadynextf: notnextf: return; donextf: - context._add(context.data.byte(kFolderpage), 1); + context._inc(context.data.byte(kFolderpage)); folderhints(context); delpointer(context); showfolder(context); @@ -14782,7 +14782,7 @@ alreadylastf: notlastf: return; dolastf: - context._sub(context.data.byte(kFolderpage), 1); + context._dec(context.data.byte(kFolderpage)); delpointer(context); showfolder(context); context.data.word(kMousebutton) = 0; @@ -14907,8 +14907,8 @@ leftpageloop: context.data.word(kCharshift) = 91; context.data.byte(kKerning) = 1; context.bl = context.data.byte(kFolderpage); - context._sub(context.bl, 1); - context._sub(context.bl, 1); + context._dec(context.bl); + context._dec(context.bl); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); @@ -14946,8 +14946,8 @@ flipfolderline: context.ah = context.es.byte(context.si); context.es.byte(context.di) = context.ah; context.es.byte(context.si) = context.al; - context._sub(context.si, 1); - context._add(context.di, 1); + context._dec(context.si); + context._inc(context.di); if (--context.cx) goto flipfolderline; context.si = context.pop(); context.di = context.pop(); @@ -14987,7 +14987,7 @@ rightpageloop: context.data.word(kLinespacing) = 8; context.data.byte(kKerning) = 1; context.bl = context.data.byte(kFolderpage); - context._sub(context.bl, 1); + context._dec(context.bl); context._add(context.bl, context.bl); context.bh = 0; context._add(context.bx, context.bx); @@ -15249,7 +15249,7 @@ void showsymbol(Context & context) { } void nextsymbol(Context & context) { - context._add(context.al, 1); + context._inc(context.al); context._cmp(context.al, 6); if (context.flags.z()) goto topwrap; context._cmp(context.al, 12); @@ -15268,11 +15268,11 @@ void updatesymboltop(Context & context) { if (context.flags.z()) goto topfinished; context._cmp(context.data.byte(kSymboltopdir), -1); if (context.flags.z()) goto backwards; - context._add(context.data.byte(kSymboltopx), 1); + context._inc(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), 49); if (!context.flags.z()) goto notwrapfor; context.data.byte(kSymboltopx) = 0; - context._sub(context.data.byte(kSymboltopnum), 1); + context._dec(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), -1); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 5; @@ -15283,11 +15283,11 @@ notwrapfor: context.data.byte(kSymboltopdir) = 0; return; backwards: - context._sub(context.data.byte(kSymboltopx), 1); + context._dec(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), -1); if (!context.flags.z()) goto notwrapback; context.data.byte(kSymboltopx) = 48; - context._add(context.data.byte(kSymboltopnum), 1); + context._inc(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), 6); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 0; @@ -15305,11 +15305,11 @@ void updatesymbolbot(Context & context) { if (context.flags.z()) goto botfinished; context._cmp(context.data.byte(kSymbolbotdir), -1); if (context.flags.z()) goto backwardsbot; - context._add(context.data.byte(kSymbolbotx), 1); + context._inc(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), 49); if (!context.flags.z()) goto notwrapforb; context.data.byte(kSymbolbotx) = 0; - context._sub(context.data.byte(kSymbolbotnum), 1); + context._dec(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), -1); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 5; @@ -15320,11 +15320,11 @@ notwrapforb: context.data.byte(kSymbolbotdir) = 0; return; backwardsbot: - context._sub(context.data.byte(kSymbolbotx), 1); + context._dec(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), -1); if (!context.flags.z()) goto notwrapbackb; context.data.byte(kSymbolbotx) = 48; - context._add(context.data.byte(kSymbolbotnum), 1); + context._inc(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), 6); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 0; @@ -15412,7 +15412,7 @@ void showdiary(Context & context) { void showdiarykeys(Context & context) { context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; - context._sub(context.data.byte(kPresscount), 1); + context._dec(context.data.byte(kPresscount)); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; context._cmp(context.data.byte(kPressed), 'N'); @@ -15523,7 +15523,7 @@ alreadykeyp: playchannel1(context); context.data.byte(kPresscount) = 12; context.data.byte(kPressed) = 'P'; - context._sub(context.data.byte(kDiarypage), 1); + context._dec(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), -1); if (!context.flags.z()) goto notkeyp; context.data.byte(kDiarypage) = 11; @@ -15549,7 +15549,7 @@ alreadykeyn: playchannel1(context); context.data.byte(kPresscount) = 12; context.data.byte(kPressed) = 'N'; - context._add(context.data.byte(kDiarypage), 1); + context._inc(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), 12); if (!context.flags.z()) goto notkeyn; context.data.byte(kDiarypage) = 0; @@ -15950,7 +15950,7 @@ alreadyactsave: context.cx = 17; context._mul(context.cx); context._add(context.si, context.ax); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto noactsave; context.al = context.data.byte(kLocation); @@ -16012,7 +16012,7 @@ alreadyactload: context.cx = 17; context._mul(context.cx); context._add(context.si, context.ax); - context._add(context.si, 1); + context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) goto notactload; loadposition(context); @@ -16047,7 +16047,7 @@ notret: context._cmp(context.data.byte(kCursorpos), 0); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._sub(context.data.byte(kCursorpos), 1); + context._dec(context.data.byte(kCursorpos)); context.es.byte(context.bx) = 0; context.es.byte(context.bx+1) = 1; goto afterkey; @@ -16056,7 +16056,7 @@ spacepress: context._cmp(context.data.byte(kCursorpos), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); - context._add(context.data.byte(kCursorpos), 1); + context._inc(context.data.byte(kCursorpos)); context.al = context.data.byte(kCurrentkey); context.es.byte(context.bx+1) = context.al; context.es.byte(context.bx+2) = 0; @@ -16160,14 +16160,14 @@ alreadysel: if (context.flags.z()) goto noselslot; context._cmp(context.data.byte(kLoadingorsave), 3); if (!context.flags.z()) goto notnocurs; - context._sub(context.data.byte(kLoadingorsave), 1); + context._dec(context.data.byte(kLoadingorsave)); notnocurs: oldtonames(context); context.ax = context.data.word(kMousey); context._sub(context.ax, (52)+4); context.cl = -1; getslotnum: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 11); if (!context.flags.c()) goto getslotnum; context.data.byte(kCurrentslot) = context.cl; @@ -16219,7 +16219,7 @@ nomatchslot: context.di = context.pop(); context.cx = context.pop(); context._add(context.bx, 10); - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto slotloop; return; @@ -16247,8 +16247,8 @@ shownameloop: context.cx = 15; context._add(context.si, 15); zerostill: - context._sub(context.si, 1); - context._sub(context.cl, 1); + context._dec(context.si); + context._dec(context.cl); context._cmp(context.es.byte(context.si), 1); if (!context.flags.z()) goto foundcharacter; goto zerostill; @@ -16285,7 +16285,7 @@ afterprintname: context.cx = context.pop(); context._add(context.si, 17); context._add(context.bx, 10); - context._add(context.cl, 1); + context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto shownameloop; return; @@ -16432,20 +16432,20 @@ void makeheader(Context & context) { void storeit(Context & context) { context._cmp(context.ax, 0); if (!context.flags.z()) goto isntblank; - context._add(context.ax, 1); + context._inc(context.ax); isntblank: context._stosw(); return; } void findlen(Context & context) { - context._sub(context.bx, 1); + context._dec(context.bx); context._add(context.bx, context.ax); nextone: context._cmp(context.cl, context.ds.byte(context.bx)); if (!context.flags.z()) goto foundlen; - context._sub(context.bx, 1); - context._sub(context.ax, 1); + context._dec(context.bx); + context._dec(context.ax); context._cmp(context.ax, 0); if (!context.flags.z()) goto nextone; foundlen: @@ -16469,7 +16469,7 @@ scanloop: openfilenocheck(context); if (context.flags.c()) goto notexist; context.cx = context.pop(); - context._add(context.ch, 1); + context._inc(context.ch); context.push(context.cx); context.push(context.di); context.push(context.es); @@ -16494,7 +16494,7 @@ notexist: context.es = context.pop(); context._add(context.dx, 13); context._add(context.di, 17); - context._sub(context.cl, 1); + context._dec(context.cl); if (!context.flags.z()) goto scanloop; context.al = context.ch; return; @@ -16638,7 +16638,7 @@ void createname(Context & context) { context.al = context.dh; context.ah = '0'-1; findten: - context._add(context.ah, 1); + context._inc(context.ah); context._sub(context.al, 10); if (!context.flags.c()) goto findten; context.cs.byte(context.di+1) = context.ah; @@ -16647,21 +16647,21 @@ findten: context.ax = context.pop(); context.cl = '0'-1; thousandsc: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 1000); if (!context.flags.c()) goto thousandsc; context._add(context.ax, 1000); context.cs.byte(context.di+4) = context.cl; context.cl = '0'-1; hundredsc: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 100); if (!context.flags.c()) goto hundredsc; context._add(context.ax, 100); context.cs.byte(context.di+5) = context.cl; context.cl = '0'-1; tensc: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, 10); if (!context.flags.c()) goto tensc; context._add(context.ax, 10); @@ -16674,7 +16674,7 @@ tensc: void trysoundalloc(Context & context) { context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) goto gotsoundbuff; - context._add(context.data.byte(kSoundtimes), 1); + context._inc(context.data.byte(kSoundtimes)); context.bx = (16384+2048)/16; allocatemem(context); context.data.word(kSoundbuffer) = context.ax; @@ -16798,15 +16798,15 @@ void makenextblock(Context & context) { if (context.flags.z()) goto mightbeonlych0; context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto mightbeonlych1; - context._sub(context.data.word(kCh0blockstocopy), 1); - context._sub(context.data.word(kCh1blockstocopy), 1); + context._dec(context.data.word(kCh0blockstocopy)); + context._dec(context.data.word(kCh1blockstocopy)); bothchannels(context); return; mightbeonlych1: context.data.byte(kCh0playing) = 255; context._cmp(context.data.word(kCh1blockstocopy), 0); if (context.flags.z()) goto notch1only; - context._sub(context.data.word(kCh1blockstocopy), 1); + context._dec(context.data.word(kCh1blockstocopy)); channel1only(context); notch1only: return; @@ -16814,7 +16814,7 @@ mightbeonlych0: context.data.byte(kCh1playing) = 255; context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto notch0only; - context._sub(context.data.word(kCh0blockstocopy), 1); + context._dec(context.data.word(kCh0blockstocopy)); channel0only(context); return; notch0only: @@ -16854,7 +16854,7 @@ void loopchannel0(Context & context) { if (context.flags.z()) goto notloop; context._cmp(context.data.byte(kCh0repeat), 255); if (context.flags.z()) goto endlessloop; - context._sub(context.data.byte(kCh0repeat), 1); + context._dec(context.data.byte(kCh0repeat)); endlessloop: context.ax = context.data.word(kCh0oldemmpage); context.data.word(kCh0emmpage) = context.ax; @@ -16909,7 +16909,7 @@ void domix(Context & context) { slow: context._lodsb(); context.ah = context.ds.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplot; botlot: @@ -16955,7 +16955,7 @@ lowvolumemix: context.al = context.es.byte(context.bx); context.bx = context.pop(); context.ah = context.ds.byte(context.bx); - context._add(context.bx, 1); + context._inc(context.bx); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplotv; botlotv: @@ -17180,7 +17180,7 @@ notalley: if (!context.flags.z()) goto notedensagain; context.al = 2; context.ah = context.data.byte(kRoomnum); - context._sub(context.ah, 1); + context._dec(context.ah); turnanypathon(context); notedensagain: return; @@ -17425,20 +17425,20 @@ lookattail: if (context.flags.z()) goto isdma; context._cmp(context.al, 'D'); if (context.flags.z()) goto isdma; - context._add(context.bx, 1); + context._inc(context.bx); if (--context.cx) goto lookattail; return; issoundint: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); context.data.byte(kSoundint) = context.al; - context._add(context.bx, 1); + context._inc(context.bx); goto lookattail; isdma: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); context.data.byte(kSounddmachannel) = context.al; - context._add(context.bx, 1); + context._inc(context.bx); goto lookattail; isbaseadd: context.push(context.cx); @@ -17450,15 +17450,15 @@ isbaseadd: context._add(context.ax, 0x200); context.data.word(kSoundbaseadd) = context.ax; context.cx = context.pop(); - context._add(context.bx, 1); + context._inc(context.bx); goto lookattail; isbright: context.data.byte(kBrightness) = 1; - context._add(context.bx, 1); + context._inc(context.bx); goto lookattail; isnosound: context.data.byte(kSoundint) = 255; - context._add(context.bx, 1); + context._inc(context.bx); goto lookattail; endtail: return; @@ -17560,7 +17560,7 @@ void watchreel(Context & context) { waitstopwalk: return; notwatchpath: - context._sub(context.data.byte(kSpeedcount), 1); + context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); if (!context.flags.z()) goto showwatchreel; context.al = context.data.byte(kWatchspeed); @@ -17577,7 +17577,7 @@ notwatchpath: context.data.byte(kWatchmode) = 1; goto notplayingreel; ismorereel: - context._add(context.data.word(kReeltowatch), 1); + context._inc(context.data.word(kReeltowatch)); showwatchreel: context.ax = context.data.word(kReeltowatch); context.data.word(kReelpointer) = context.ax; @@ -17597,12 +17597,12 @@ notplayingreel: notholdingreel: context._cmp(context.data.byte(kWatchmode), 2); if (!context.flags.z()) goto notreleasehold; - context._sub(context.data.byte(kSpeedcount), 1); + context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); if (!context.flags.z()) goto notlastspeed2; context.al = context.data.byte(kWatchspeed); context.data.byte(kSpeedcount) = context.al; - context._add(context.data.word(kReeltohold), 1); + context._inc(context.data.word(kReeltohold)); notlastspeed2: context.ax = context.data.word(kReeltohold); context._cmp(context.ax, context.data.word(kEndofholdreel)); @@ -17636,7 +17636,7 @@ notstartshake: void watchcount(Context & context) { context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatchworn; - context._add(context.data.byte(kTimercount), 1); + context._inc(context.data.byte(kTimercount)); context._cmp(context.data.byte(kTimercount), 9); if (context.flags.z()) goto flashdots; context._cmp(context.data.byte(kTimercount), 18); @@ -17656,11 +17656,11 @@ uptime: context._cmp(context.data.byte(kSecondcount), 60); if (!context.flags.z()) goto finishtime; context.data.byte(kSecondcount) = 0; - context._add(context.data.byte(kMinutecount), 1); + context._inc(context.data.byte(kMinutecount)); context._cmp(context.data.byte(kMinutecount), 60); if (!context.flags.z()) goto finishtime; context.data.byte(kMinutecount) = 0; - context._add(context.data.byte(kHourcount), 1); + context._inc(context.data.byte(kHourcount)); context._cmp(context.data.byte(kHourcount), 24); if (!context.flags.z()) goto finishtime; context.data.byte(kHourcount) = 0; @@ -17779,9 +17779,9 @@ morethan10: void twodigitnum(Context & context) { context.ah = context.cl; - context._sub(context.ah, 1); + context._dec(context.ah); numloop1: - context._add(context.ah, 1); + context._inc(context.ah); context._sub(context.al, 10); if (!context.flags.c()) goto numloop1; context._add(context.al, 10); @@ -17794,7 +17794,7 @@ void showword(Context & context) { context.bx = 10000; context.cl = 47; word1: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, context.bx); if (!context.flags.c()) goto word1; context._add(context.ax, context.bx); @@ -17803,7 +17803,7 @@ word1: context.bx = 1000; context.cl = 47; word2: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, context.bx); if (!context.flags.c()) goto word2; context._add(context.ax, context.bx); @@ -17812,7 +17812,7 @@ word2: context.bx = 100; context.cl = 47; word3: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, context.bx); if (!context.flags.c()) goto word3; context._add(context.ax, context.bx); @@ -17821,7 +17821,7 @@ word3: context.bx = 10; context.cl = 47; word4: - context._add(context.cl, 1); + context._inc(context.cl); context._sub(context.ax, context.bx); if (!context.flags.c()) goto word4; context._add(context.ax, context.bx); @@ -18094,7 +18094,7 @@ notblankpers: notareelid: context.cx = context.pop(); context._add(context.bx, 5); - context._sub(context.cx, 1); + context._dec(context.cx); if (!context.flags.z()) goto identifyreel; return; } @@ -18126,7 +18126,7 @@ identifyset: return; notasetid: context._sub(context.bx, 5); - context._sub(context.cx, 1); + context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyset; return; @@ -18155,7 +18155,7 @@ identifyex: return; notanexid: context._sub(context.bx, 5); - context._sub(context.cx, 1); + context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyex; return; @@ -18184,7 +18184,7 @@ identifyfree: return; notafreeid: context._sub(context.bx, 5); - context._sub(context.cx, 1); + context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyfree; return; @@ -18243,7 +18243,7 @@ pathloop: goto gotvalidpath; flunkedit: context._add(context.bx, 8); - context._add(context.dl, 1); + context._inc(context.dl); context._cmp(context.dl, 12); if (!context.flags.z()) goto pathloop; context.dl = 255; @@ -18278,7 +18278,7 @@ fpathloop: goto gotfirst; nofirst: context._add(context.bx, 8); - context._add(context.dl, 1); + context._inc(context.dl); context._cmp(context.dl, 12); if (!context.flags.z()) goto fpathloop; context.al = 0; @@ -18772,7 +18772,7 @@ searchmess: context.push(context.ax); findnextcolon(context); context.ax = context.pop(); - context._sub(context.ah, 1); + context._dec(context.ah); if (!context.flags.z()) goto searchmess; context.di = context.pop(); context.bx = context.pop(); @@ -18900,7 +18900,7 @@ notsamealready: context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalline; context.al = context.data.byte(kLinelength); - context._sub(context.al, 1); + context._dec(context.al); context.data.byte(kLinepointer) = context.al; context.data.byte(kLinedirection) = 1; return; @@ -18949,7 +18949,7 @@ nextcheck: context._and(context.ch, 15); nextcheck2: context._add(context.bx, 2); - context._sub(context.cl, 1); + context._dec(context.cl); if (!context.flags.z()) goto checkdestloop; context.data.byte(kDestination) = context.ch; context.bx = context.pop(); @@ -18999,7 +18999,7 @@ line4: context.ax = context.data.word(kLinestartx); context.bx = context.data.word(kLinestarty); context.ah = context.bl; - context._add(context.cx, 1); + context._inc(context.cx); context.bx = context.pop(); context._cmp(context.data.byte(kLineroutine), 1); if (context.flags.z()) goto hislope; @@ -19014,7 +19014,7 @@ vertline: context.ax = context.bx; context.data.byte(kLinedirection) = 1; line31: - context._add(context.cx, 1); + context._inc(context.cx); context.bx = context.data.word(kLinestartx); context._xchg(context.ax, context.bx); context.ah = context.bl; @@ -19028,16 +19028,16 @@ horizline: context.ax = context.data.word(kLinestartx); context.bx = context.data.word(kLinestarty); context.ah = context.bl; - context._add(context.cx, 1); + context._inc(context.cx); horizloop: context._stosw(); - context._add(context.al, 1); + context._inc(context.al); if (--context.cx) goto horizloop; goto lineexit; loslope: loloop: context._stosw(); - context._add(context.al, 1); + context._inc(context.al); context._or(context.si, context.si); if (!context.flags.s()) goto line12; context._add(context.si, context.data.word(kIncrement1)); @@ -19059,7 +19059,7 @@ hiloop: goto lineexit; line23: context._add(context.si, context.data.word(kIncrement2)); - context._add(context.al, 1); + context._inc(context.al); if (--context.cx) goto hiloop; lineexit: context._sub(context.di, 7944); @@ -19174,7 +19174,7 @@ make: context._stosb(); if (--context.cx) goto make; finishmakename: - context._add(context.cx, 1); + context._inc(context.cx); context.al = 0; context._stosb(); return; @@ -19475,7 +19475,7 @@ nozoom1: void showblink(Context & context) { context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) goto finblink1; - context._add(context.data.byte(kBlinkcount), 1); + context._inc(context.data.byte(kBlinkcount)); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto finblink1; context._cmp(context.data.byte(kReallocation), 50); @@ -19485,7 +19485,7 @@ void showblink(Context & context) { if (!context.flags.z()) goto finblink1; context.data.byte(kBlinkcount) = 0; context.al = context.data.byte(kBlinkframe); - context._add(context.al, 1); + context._inc(context.al); context.data.byte(kBlinkframe) = context.al; context._cmp(context.al, 6); if (context.flags.c()) goto nomorethan6; @@ -19734,7 +19734,7 @@ itsfrominv: context.cl = context.al; context._add(context.al, context.al); context._add(context.al, context.cl); - context._add(context.al, 1); + context._inc(context.al); context.ah = 0; context.push(context.ax); context._add(context.ax, context.ax); @@ -19905,11 +19905,11 @@ gothand: mousehand: context._cmp(context.data.byte(kPointerspeed), 0); if (context.flags.z()) goto rightspeed3; - context._sub(context.data.byte(kPointerspeed), 1); + context._dec(context.data.byte(kPointerspeed)); goto finflashmouse; rightspeed3: context.data.byte(kPointerspeed) = 5; - context._add(context.data.byte(kPointercount), 1); + context._inc(context.data.byte(kPointercount)); context._cmp(context.data.byte(kPointercount), 16); if (!context.flags.z()) goto finflashmouse; context.data.byte(kPointercount) = 0; @@ -20004,7 +20004,7 @@ void readkey(Context & context) { context.bx = context.data.word(kBufferout); context._cmp(context.bx, context.data.word(kBufferin)); if (context.flags.z()) goto nokey; - context._add(context.bx, 1); + context._inc(context.bx); context._and(context.bx, 15); context.data.word(kBufferout) = context.bx; context.di = 5715; @@ -20482,9 +20482,9 @@ looky2: context._sub(context.al, 10); if (!context.flags.c()) goto looky2; context.al = context.ah; - context._sub(context.cx, 1); + context._dec(context.cx); lookx2: - context._add(context.cx, 1); + context._inc(context.cx); context._sub(context.al, 11); if (!context.flags.c()) goto lookx2; context.al = context.cl; @@ -20529,9 +20529,9 @@ looky: context._sub(context.al, 10); if (!context.flags.c()) goto looky; context.al = context.data.byte(kMapx); - context._sub(context.cx, 1); + context._dec(context.cx); lookx: - context._add(context.cx, 1); + context._inc(context.cx); context._sub(context.al, 11); if (!context.flags.c()) goto lookx; context.data.byte(kRoomnum) = context.cl; @@ -20742,7 +20742,7 @@ mainloop: context.al = context.data.byte(kFinaldest); context._cmp(context.al, context.data.byte(kManspath)); if (!context.flags.z()) goto mainloop; - context._sub(context.data.word(kWatchingtime), 1); + context._dec(context.data.word(kWatchingtime)); if (!context.flags.z()) goto mainloop; notwatching: context._cmp(context.data.byte(kMandead), 4); diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index f99563f358..aaed6866bc 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -302,6 +302,30 @@ public: flags.update_zs(dst); } + inline void _inc(uint8 &dst) { + flags.update_o((uint8)(dst + 1), dst); + ++dst; + flags.update_zs(dst); + } + + inline void _inc(uint16 &dst) { + flags.update_o((uint16)(dst + 1), dst); + ++dst; + flags.update_zs(dst); + } + + inline void _dec(uint8 &dst) { + flags.update_o(uint8(dst - 1), dst); + --dst; + flags.update_zs(dst); + } + + inline void _dec(uint16 &dst) { + flags.update_o(uint16(dst - 1), dst); + --dst; + flags.update_zs(dst); + } + inline void _and(uint8 &dst, uint8 src) { dst &= src; flags.update_zs(dst); -- cgit v1.2.3 From c330f5d0b893a9f303addc3e7f20aa20678fc651 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 20:21:41 +0400 Subject: DREAMWEB: modify register after raster operations --- engines/dreamweb/dreamweb.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 086aee2e9a..2ca38ce9a4 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -355,6 +355,9 @@ void multiget(Context &context) { uint8 *dst_p = context.es.ptr(dst + w * y, w); memcpy(dst_p, src_p, w); } + context.si += w * h; + context.di = src + kScreenwidth * h; + context.cx = 0; } void multiput(Context &context) { @@ -368,6 +371,9 @@ void multiput(Context &context) { uint8 *dst_p = context.es.ptr(dst + kScreenwidth * y, w); memcpy(dst_p, src_p, w); } + context.si += w * h; + context.di = dst + kScreenwidth * h; + context.cx = 0; } void multidump(Context &context) { @@ -377,11 +383,14 @@ void multidump(Context &context) { unsigned offset = x + y * kScreenwidth; //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); + context.si = context.di = offset + h * kScreenwidth; + context.cx = 0; } void worktoscreen(Context &context) { context.ds = context.data.word(kWorkspace); context.engine->blit(context.ds.ptr(0, 320 * 200), 320, 0, 0, 320, 200); + context.cx = 0; } void printundermon(Context &context) { -- cgit v1.2.3 From 70bbb1a2aeb6f545cc73bbd3ba9ccf7646a665eb Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 20:49:33 +0400 Subject: DREAMWEB: switched off foreign/spanish flags for recompilation --- engines/dreamweb/dreamgen.cpp | 1581 +++++++++++++++++++---------------------- engines/dreamweb/dreamgen.h | 50 +- 2 files changed, 769 insertions(+), 862 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b27de1f750..01992eda6c 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -276,7 +276,6 @@ void isryanholding(Context &context); void nothelderror(Context &context); void triggermessage(Context &context); void monprint(Context &context); -void modifychar(Context &context); void printchar(Context &context); void showcurrentfile(Context &context); void printlogo(Context &context); @@ -2424,7 +2423,7 @@ forcenext: void clearsprites(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; while(context.cx--) context._stosb(); @@ -2433,7 +2432,7 @@ void clearsprites(Context & context) { void makesprite(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: context._cmp(context.es.byte(context.bx+15), 255); if (context.flags.z()) goto _tmp17a; @@ -2460,11 +2459,11 @@ void delsprite(Context & context) { void spriteupdate(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = context.data.byte(kRyanon); context.es.byte(context.bx+31) = context.al; context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; _tmp18: context.push(context.cx); @@ -2496,7 +2495,7 @@ void printsprites(Context & context) { priorityloop: context.push(context.cx); context.data.byte(kPriority) = context.cl; - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; prtspriteloop: context.push(context.cx); @@ -2585,7 +2584,7 @@ void checkone(Context & context) { context._mul(context.cx); context.si = context.ax; context.ds = context.data.word(kBuffers); - context._add(context.si, (0+(228*13)+32+60+(32*32))); + context._add(context.si, (0+(180*10)+32+60+(32*32))); context._lodsw(); context.cx = context.ax; context._lodsb(); @@ -3010,7 +3009,7 @@ notinedenslift: void initrain(Context & context) { context.es = context.data.word(kBuffers); - context.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)); + context.di = (0+(180*10)+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*24)); context.bx = 1113; checkmorerain: context.al = context.cs.byte(context.bx); @@ -3145,7 +3144,7 @@ void showrain(Context & context) { context.ax = context.ds.word(context.si+2); context.si = context.ax; context._add(context.si, 2080); - context.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)); + context.bx = (0+(180*10)+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*24)); context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) goto nothunder; @@ -3641,7 +3640,7 @@ notnearly: void updatepeople(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; @@ -3783,10 +3782,6 @@ void reconstruct(Context & context) { drawfloor(context); spriteupdate(context); printsprites(context); - context._cmp(context.data.byte(kReallocation), 20); - if (!context.flags.z()) goto notfudge; - undertextline(context); -notfudge: context.data.byte(kHavedoneobs) = 0; noneedtorecon: return; @@ -3918,7 +3913,7 @@ bigroom: void dumpeverything(Context & context) { context.es = context.data.word(kBuffers); - context.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)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); dumpevery1: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); @@ -3946,7 +3941,7 @@ skip1: context._add(context.bx, 5); goto dumpevery1; finishevery1: - context.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))+(40*5); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5); dumpevery2: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); @@ -4007,7 +4002,7 @@ void loadpalfromiff(Context & context) { readfromfile(context); closefile(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.ds = context.data.word(kMapstore); context.si = 0x30; context.cx = 768; @@ -4950,7 +4945,7 @@ void dofade(Context & context) { context.al = context.data.byte(kColourpos); context.ah = 0; context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context._add(context.si, context.ax); context._add(context.si, context.ax); context._add(context.si, context.ax); @@ -4967,7 +4962,7 @@ finishfade: void clearendpal(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; while(context.cx--) context._stosb(); @@ -4993,11 +4988,11 @@ void fadescreenup(Context & context) { void fadetowhite(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 63; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.al = 0; context._stosb(); context._stosb(); @@ -5012,11 +5007,11 @@ void fadetowhite(Context & context) { void fadefromwhite(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768; context.al = 63; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.al = 0; context._stosb(); context._stosb(); @@ -5044,7 +5039,7 @@ void fadescreendownhalf(Context & context) { paltoendpal(context); context.cx = 768; context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); halfend: context.al = context.es.byte(context.bx); context._shr(context.al, 1); @@ -5053,12 +5048,12 @@ halfend: if (--context.cx) goto halfend; context.ds = context.data.word(kBuffers); context.es = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); context.cx = 3*5; while(context.cx--) context._movsb(); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); context.cx = 3*2; while(context.cx--) context._movsb(); context.data.byte(kFadedirection) = 1; @@ -5100,7 +5095,7 @@ void fadescreendowns(Context & context) { void clearstartpal(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 256; wholeloop1: context.ax = 0; @@ -5263,8 +5258,8 @@ void fadecalculation(Context & context) { if (context.flags.z()) goto nomorefading; context.bl = context.data.byte(kFadecount); context.es = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; fadecolloop: context.al = context.es.byte(context.si); @@ -5293,8 +5288,8 @@ nomorefading: void greyscalesum(Context & context) { context.es = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 256; greysumloop1: context.push(context.cx); @@ -5349,8 +5344,8 @@ noaddb: void paltostartpal(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); return; @@ -5359,8 +5354,8 @@ void paltostartpal(Context & context) { void endpaltostart(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); return; @@ -5369,8 +5364,8 @@ void endpaltostart(Context & context) { void startpaltoend(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); return; @@ -5379,8 +5374,8 @@ void startpaltoend(Context & context) { void paltoendpal(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(context.cx--) context._movsw(); return; @@ -5389,8 +5384,8 @@ void paltoendpal(Context & context) { void allpalette(Context & context) { context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(context.cx--) context._movsw(); dumpcurrent(context); @@ -5398,7 +5393,7 @@ void allpalette(Context & context) { } void dumpcurrent(Context & context) { - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.ds = context.data.word(kBuffers); vsync(context); context.al = 0; @@ -5415,11 +5410,11 @@ void fadedownmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5435,11 +5430,11 @@ void fadeupmon(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5455,11 +5450,11 @@ void fadeupmonfirst(Context & context) { paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5478,11 +5473,11 @@ void fadeupmonfirst(Context & context) { void fadeupyellows(Context & context) { paltoendpal(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); context.data.byte(kFadedirection) = 1; @@ -5497,15 +5492,15 @@ void fadeupyellows(Context & context) { void initialmoncols(Context & context) { paltostartpal(context); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); context.cx = 3*9; context.ax = 0; while(context.cx--) context._stosb(); - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); context.al = 230; context.cx = 18; showgroup(context); @@ -5898,7 +5893,6 @@ void printchar(Context & context) { context.push(context.si); context.push(context.bx); context.push(context.di); - context._sub(context.bx, 3); context.push(context.ax); context._sub(context.al, 32); context.ah = 0; @@ -5963,7 +5957,6 @@ printloopslow5: context.push(context.es); context.push(context.si); context.push(context.ds); - modifychar(context); printboth(context); context.ds = context.pop(); context.si = context.pop(); @@ -5984,7 +5977,6 @@ printloopslow5: context.push(context.cx); context.push(context.es); context.push(context.si); - modifychar(context); context.data.word(kCharshift) = 91; printboth(context); context.data.word(kCharshift) = 0; @@ -6092,7 +6084,6 @@ printloop5: if (context.flags.z()) goto finishdirct; context.push(context.cx); context.push(context.es); - modifychar(context); printchar(context); context.data.word(kLastxpos) = context.di; context.es = context.pop(); @@ -6143,7 +6134,6 @@ printloop7: nottrigger: context.push(context.cx); context.push(context.es); - modifychar(context); printchar(context); context.data.word(kCurslocx) = context.di; context.data.word(kCurslocy) = context.bx; @@ -6304,7 +6294,6 @@ getloop: if (context.flags.z()) goto endall; context._cmp(context.al, 32); if (context.flags.z()) goto endword; - modifychar(context); context._cmp(context.al, 255); if (context.flags.z()) goto getloop; context.push(context.ax); @@ -6330,68 +6319,11 @@ endall: return; } -void modifychar(Context & context) { - context._cmp(context.al, 128); - if (context.flags.c()) goto nomod; - context._cmp(context.al, 160); - if (!context.flags.z()) goto not160; - context.al = 'Z'+1; - return; -not160: - context._cmp(context.al, 130); - if (!context.flags.z()) goto not130; - context.al = 'Z'+2; - return; -not130: - context._cmp(context.al, 161); - if (!context.flags.z()) goto not161; - context.al = 'Z'+3; - return; -not161: - context._cmp(context.al, 162); - if (!context.flags.z()) goto not162; - context.al = 'Z'+4; - return; -not162: - context._cmp(context.al, 163); - if (!context.flags.z()) goto not163; - context.al = 'Z'+5; - return; -not163: - context._cmp(context.al, 164); - if (!context.flags.z()) goto not164; - context.al = 'Z'+6; - return; -not164: - context._cmp(context.al, 165); - if (!context.flags.z()) goto not165; - context.al = ','-1; - return; -not165: - context._cmp(context.al, 168); - if (!context.flags.z()) goto not168; - context.al = 'A'-1; - return; -not168: - context._cmp(context.al, 173); - if (!context.flags.z()) goto not173; - context.al = 'A'-4; - return; -not173: - context._cmp(context.al, 129); - if (!context.flags.z()) goto not129; - context.al = 'A'-5; -not129: - return; -nomod: - return; -} - void fillryan(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32); + context.di = (0+(180*10)+32); findallryan(context); - context.si = (0+(228*13)+32); + context.si = (0+(180*10)+32); context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 20; @@ -6440,9 +6372,9 @@ lessthanapage: context.al = 1; context.push(context.ax); context.es = context.data.word(kBuffers); - context.di = (0+(228*13)); + context.di = (0+(180*10)); findallopen(context); - context.si = (0+(228*13)); + context.si = (0+(180*10)); context.di = (80); context.bx = (58)+96; context.cx = context.pop(); @@ -6899,10 +6831,6 @@ void describeob(Context & context) { getobtextstart(context); context.di = 33; context.bx = 92; - context._cmp(context.data.byte(kObjecttype), 1); - if (!context.flags.z()) goto notsetd; - context.bx = 82; -notsetd: context.dl = 241; context.ah = 16; context.data.word(kCharshift) = 91+91; @@ -6910,10 +6838,6 @@ notsetd: context.data.word(kCharshift) = 0; context.di = 36; context.bx = 104; - context._cmp(context.data.byte(kObjecttype), 1); - if (!context.flags.z()) goto notsetd2; - context.bx = 94; -notsetd2: context.dl = 241; context.ah = 0; printdirect(context); @@ -7691,7 +7615,7 @@ findinv2: context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); - context._add(context.bx, (0+(228*13)+32)); + context._add(context.bx, (0+(180*10)+32)); return; } @@ -7707,7 +7631,7 @@ findopenp1: context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); - context._add(context.bx, (0+(228*13))); + context._add(context.bx, (0+(180*10))); return; } @@ -8592,7 +8516,7 @@ void calcmapad(Context & context) { void getdimension(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)); + context.bx = (0+(180*10)+32+60+(32*32)); context.ch = 0; dimloop1: addalong(context); @@ -8601,7 +8525,7 @@ dimloop1: context._inc(context.ch); goto dimloop1; finishdim1: - context.bx = (0+(228*13)+32+60+(32*32)); + context.bx = (0+(180*10)+32+60+(32*32)); context.cl = 0; dimloop2: context.push(context.bx); @@ -8613,7 +8537,7 @@ dimloop2: context._add(context.bx, 3); goto dimloop2; finishdim2: - context.bx = (0+(228*13)+32+60+(32*32))+(11*3*9); + context.bx = (0+(180*10)+32+60+(32*32))+(11*3*9); context.dh = 10; dimloop3: context.push(context.bx); @@ -8625,7 +8549,7 @@ dimloop3: context._sub(context.bx, 11*3); goto dimloop3; finishdim3: - context.bx = (0+(228*13)+32+60+(32*32))+(3*10); + context.bx = (0+(180*10)+32+60+(32*32))+(3*10); context.dl = 11; dimloop4: context.push(context.bx); @@ -8702,7 +8626,7 @@ gotlength: void drawflags(Context & context) { context.es = context.data.word(kBuffers); - context.di = (0+(228*13)+32+60+(32*32)); + context.di = (0+(180*10)+32+60+(32*32)); context.al = context.data.byte(kMapy); context.ah = 0; context.cx = (66); @@ -8741,7 +8665,7 @@ void eraseoldobs(Context & context) { context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; oberase: context.push(context.cx); @@ -8764,7 +8688,7 @@ donterase: void showallobs(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); context.data.word(kListpos) = context.bx; context.di = context.bx; context.cx = 128*5; @@ -8879,9 +8803,9 @@ nomake: void showallfree(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.data.word(kListpos) = context.bx; - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.cx = 80*5; context.al = 255; while(context.cx--) context._stosb(); @@ -8958,9 +8882,9 @@ finfree: void showallex(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.data.word(kListpos) = context.bx; - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.cx = 100*5; context.al = 255; while(context.cx--) context._stosb(); @@ -9708,11 +9632,6 @@ alreadyinfo: context.di = 60; context.bx = 72+55; showframe(context); - context.al = 4; - context.ah = 0; - context.di = 60; - context.bx = 72+55+21; - showframe(context); context.bx = context.pop(); context.bh = 0; context._add(context.bx, context.bx); @@ -9721,7 +9640,7 @@ alreadyinfo: context._add(context.si, (66*2)); findnextcolon(context); context.di = 63; - context.bx = 84+4; + context.bx = 84; context.dl = 191; context.al = 0; context.ah = 0; @@ -11109,7 +11028,6 @@ curfileloop: if (context.flags.z()) goto finishfile; context._inc(context.si); context.push(context.si); - modifychar(context); context.ds = context.data.word(kTempcharset); context.ah = 0; printchar(context); @@ -11205,8 +11123,6 @@ void printcurs(Context & context) { context.bx = context.data.word(kCurslocy); context.cl = 6; context.ch = 8; - context._sub(context.bx, 3); - context.ch = 11; context.ds = context.data.word(kBuffers); context.si = (0); context.push(context.di); @@ -11230,7 +11146,7 @@ flashcurs: context.bx = context.pop(); context._sub(context.di, 6); context.cl = 12; - context.ch = 11; + context.ch = 8; multidump(context); context.es = context.pop(); context.bx = context.pop(); @@ -11252,8 +11168,6 @@ void delcurs(Context & context) { context.bx = context.data.word(kCurslocy); context.cl = 6; context.ch = 8; - context._sub(context.bx, 3); - context.ch = 11; context.push(context.di); context.push(context.bx); context.push(context.cx); @@ -12633,7 +12547,7 @@ void usecashcard(Context & context) { showexit(context); showman(context); context.di = 114; - context.bx = 120-3; + context.bx = 120; context.ds = context.data.word(kTempgraphics); context.al = 39; context.ah = 0; @@ -13521,7 +13435,7 @@ void removefreeobject(Context & context) { } void findormake(Context & context) { - context.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)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); context.push(context.ax); context.es = context.data.word(kBuffers); context.ah = context.data.byte(kReallocation); @@ -13558,7 +13472,7 @@ void switchryanoff(Context & context) { void setallchanges(Context & context) { context.es = context.data.word(kBuffers); - context.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)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); setallloop: context.ax = context.es.word(context.bx); context._cmp(context.al, 255); @@ -13686,32 +13600,30 @@ notinlouiss: void getundertimed(Context & context) { context.al = context.data.byte(kTimedy); - context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; - context.ch = (30); + context.ch = (24); context.cl = 240; context.ds = context.data.word(kBuffers); - context.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)); + context.si = (0+(180*10)+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(context); return; } void putundertimed(Context & context) { context.al = context.data.byte(kTimedy); - context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; - context.ch = (30); + context.ch = (24); context.cl = 240; context.ds = context.data.word(kBuffers); - context.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)); + context.si = (0+(180*10)+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(context); return; } @@ -13720,14 +13632,13 @@ void dumptimedtext(Context & context) { context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) goto nodumptimed; context.al = context.data.byte(kTimedy); - context._sub(context.al, 3); context.ah = 0; context.bx = context.ax; context.al = context.data.byte(kTimedx); context.ah = 0; context.di = context.ax; context.cl = 240; - context.ch = (30); + context.ch = (24); multidump(context); context.data.byte(kNeedtodumptimed) = 0; nodumptimed: @@ -14584,7 +14495,7 @@ void getundermenu(Context & context) { context.cl = 48; context.ch = 48; context.ds = context.data.word(kBuffers); - context.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)); + context.si = (0+(180*10)+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(context); return; } @@ -14595,7 +14506,7 @@ void putundermenu(Context & context) { context.cl = 48; context.ch = 48; context.ds = context.data.word(kBuffers); - context.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)); + context.si = (0+(180*10)+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(context); return; } @@ -16294,7 +16205,7 @@ afterprintname: void namestoold(Context & context) { context.ds = context.cs; context.si = 8350; - context.di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); @@ -16304,7 +16215,7 @@ void namestoold(Context & context) { void oldtonames(Context & context) { context.es = context.cs; context.di = 8350; - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); @@ -16347,7 +16258,7 @@ void saveposition(Context & context) { context.dx = (0); saveseg(context); context.ds = context.data.word(kBuffers); - context.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)); + context.dx = (0+(180*10)+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(context); context.dx = context.data; context.ds = context.dx; @@ -16397,7 +16308,7 @@ void loadposition(Context & context) { context.dx = (0); loadseg(context); context.ds = context.data.word(kBuffers); - context.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)); + context.dx = (0+(180*10)+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(context); context.dx = context.data; context.ds = context.dx; @@ -17258,7 +17169,7 @@ void allocatebuffers(Context & context) { allocatemem(context); context.data.word(kMapdata) = context.ax; trysoundalloc(context); - context.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; + context.bx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/16; allocatemem(context); context.data.word(kBuffers) = context.ax; trysoundalloc(context); @@ -17285,7 +17196,7 @@ void allocatebuffers(Context & context) { void clearbuffers(Context & context) { context.es = context.data.word(kBuffers); - context.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; + context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; context.ax = 0; context.di = 0; while(context.cx--) context._stosw(); @@ -17295,13 +17206,13 @@ void clearbuffers(Context & context) { context.di = 0; while(context.cx--) context._stosw(); context.es = context.data.word(kBuffers); - context.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)); + context.di = (0+(180*10)+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*24)+(6*64)); context.ds = context.cs; context.si = 534; context.cx = (991-534); while(context.cx--) context._movsb(); context.es = context.data.word(kBuffers); - context.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); + context.di = (0+(180*10)+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*24)+(6*64)+991-534); context.ds = context.cs; context.si = 0; context.cx = (68-0); @@ -17314,16 +17225,16 @@ void clearchanges(Context & context) { context.es = context.data.word(kBuffers); context.cx = (250)*2; context.ax = 0x0ffff; - context.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)); + context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); while(context.cx--) context._stosw(); context.ds = context.data.word(kBuffers); - context.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)); + context.si = (0+(180*10)+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*24)+(6*64)); context.es = context.cs; context.di = 534; context.cx = (991-534); while(context.cx--) context._movsb(); context.ds = context.data.word(kBuffers); - context.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); + context.si = (0+(180*10)+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*24)+(6*64)+991-534); context.es = context.cs; context.di = 0; context.cx = (68-0); @@ -18045,7 +17956,7 @@ nothingund: void checkifperson(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.cx = 12; identifyreel: context.push(context.cx); @@ -18101,7 +18012,7 @@ notareelid: void checkifset(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); context.cx = 127; identifyset: context._cmp(context.es.byte(context.bx+4), 255); @@ -18134,7 +18045,7 @@ notasetid: void checkifex(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); context.cx = 99; identifyex: context._cmp(context.es.byte(context.bx+4), 255); @@ -18163,7 +18074,7 @@ notanexid: void checkiffree(Context & context) { context.es = context.data.word(kBuffers); - context.bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); + context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); context.cx = 79; identifyfree: context._cmp(context.es.byte(context.bx+4), 255); @@ -19625,7 +19536,7 @@ void getunderzoom(Context & context) { context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.cl = 46; context.ch = 40; multiget(context); @@ -19648,7 +19559,7 @@ void putunderzoom(Context & context) { context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.cl = 46; context.ch = 40; multiput(context); @@ -19710,7 +19621,7 @@ notsmally: context.data.byte(kPointerys) = context.ch; context.push(context.ds); context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60); + context.si = (0+(180*10)+32+60); multiget(context); context.ds = context.pop(); context.di = context.pop(); @@ -19770,7 +19681,7 @@ notsmally2: context._sub(context.data.word(kOldpointery), context.ax); context._sub(context.bx, context.ax); context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60); + context.si = (0+(180*10)+32+60); multiget(context); context.ds = context.pop(); context.di = context.pop(); @@ -19799,7 +19710,7 @@ void delpointer(Context & context) { context.ch = context.data.byte(kPointerys); context.data.byte(kDelys) = context.ch; context.ds = context.data.word(kBuffers); - context.si = (0+(228*13)+32+60); + context.si = (0+(180*10)+32+60); context.di = context.data.word(kDelherex); context.bx = context.data.word(kDelherey); multiput(context); @@ -19831,11 +19742,10 @@ notboth: void undertextline(Context & context) { context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); - context._sub(context.bx, 3); context.ds = context.data.word(kBuffers); context.si = (0); - context.cl = (228); - context.ch = (13); + context.cl = (180); + context.ch = (10); multiget(context); return; } @@ -19843,11 +19753,10 @@ void undertextline(Context & context) { void deltextline(Context & context) { context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); - context._sub(context.bx, 3); context.ds = context.data.word(kBuffers); context.si = (0); - context.cl = (228); - context.ch = (13); + context.cl = (180); + context.ch = (10); multiput(context); return; } @@ -19858,9 +19767,8 @@ void dumptextline(Context & context) { context.data.byte(kNewtextline) = 0; context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); - context._sub(context.bx, 3); - context.cl = (228); - context.ch = (13); + context.cl = (180); + context.ch = (10); multidump(context); nodumptextline: return; @@ -20926,24 +20834,24 @@ void __start(Context &context) { 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, - 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, - 0x84, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xe0, 0xc3, 0x90, 0x00, 0xb0, 0x00, - 0x40, 0x00, 0x60, 0x00, 0x84, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x88, 0xc3, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, - 0x9d, 0x00, 0xc6, 0x00, 0x48, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xcc, 0xc3, - 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, - 0xca, 0x00, 0xe4, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x9c, 0xc3, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, - 0xc6, 0x00, 0x48, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x4c, 0xc3, 0x50, 0x00, - 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xc0, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0xf0, 0x00, - 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x98, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa4, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, - 0x2c, 0x00, 0xcc, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xd0, 0xc4, 0x18, 0x01, - 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb4, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, - 0xd4, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x80, 0xc4, 0x00, 0x00, 0x40, 0x01, - 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, + 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, + 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, + 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, + 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, + 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, + 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, + 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, + 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, + 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, + 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, + 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, + 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, + 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, @@ -20951,67 +20859,67 @@ void __start(Context &context) { 0x4e, 0x44, 0x52, 0x49, 0x58, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x00, 0xff, 0xff, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x00, 0x22, 0x20, 0x00, 0x4e, - 0x45, 0x54, 0x57, 0xec, 0xc4, 0x45, 0x4c, 0x56, 0x41, 0x90, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0xa0, - 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x45, 0x9c, 0xc6, 0x45, 0x4c, 0x56, - 0x46, 0xa4, 0xc6, 0x43, 0x47, 0x41, 0x54, 0x34, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xac, 0xc6, 0x42, - 0x55, 0x54, 0x41, 0x40, 0xc7, 0x43, 0x42, 0x4f, 0x58, 0x48, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x60, - 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x44, 0xc7, 0x4c, 0x49, 0x46, 0x54, 0x80, 0xc6, 0x57, 0x49, 0x52, - 0x45, 0x88, 0xc6, 0x48, 0x4e, 0x44, 0x4c, 0x8c, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x84, 0xc6, 0x44, - 0x4f, 0x4f, 0x52, 0xb8, 0xc6, 0x43, 0x53, 0x48, 0x52, 0x74, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x38, - 0xc7, 0x43, 0x52, 0x41, 0x41, 0x68, 0xc6, 0x43, 0x52, 0x42, 0x42, 0x6c, 0xc6, 0x43, 0x52, 0x43, - 0x43, 0x70, 0xc6, 0x53, 0x45, 0x41, 0x54, 0xfc, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x9c, 0xc7, 0x43, - 0x4f, 0x4f, 0x4b, 0xb0, 0xc6, 0x45, 0x4c, 0x43, 0x41, 0x50, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x54, - 0xc6, 0x44, 0x44, 0x43, 0x41, 0x58, 0xc6, 0x41, 0x4c, 0x54, 0x52, 0x08, 0xc6, 0x4c, 0x4f, 0x4b, - 0x41, 0x40, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, 0x44, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x14, 0xc6, 0x45, - 0x4e, 0x54, 0x42, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x45, 0x2c, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x1c, - 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x30, 0xc6, 0x45, 0x4e, 0x54, 0x48, 0x34, 0xc6, 0x57, 0x57, 0x41, - 0x54, 0xf4, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, 0x5c, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf8, 0xc5, 0x47, - 0x52, 0x41, 0x46, 0x48, 0xc6, 0x54, 0x52, 0x41, 0x50, 0x4c, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x2c, - 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x45, 0x04, 0xc6, 0x44, 0x52, 0x59, - 0x52, 0x10, 0xc6, 0x48, 0x4f, 0x4c, 0x59, 0x00, 0xc6, 0x57, 0x41, 0x4c, 0x4c, 0x30, 0xc7, 0x42, - 0x4f, 0x4f, 0x4b, 0x0c, 0xc8, 0x41, 0x58, 0x45, 0x44, 0xb4, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x3c, - 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xec, 0xc5, 0x4c, 0x49, 0x44, 0x43, 0xe8, 0xc5, 0x4c, 0x49, 0x44, - 0x55, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x4f, 0xf0, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xac, 0xc5, 0x42, - 0x41, 0x4c, 0x43, 0x24, 0xc6, 0x57, 0x49, 0x4e, 0x44, 0x20, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb8, - 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa4, 0xc5, 0x55, 0x57, 0x54, 0x42, 0xa4, 0xc5, 0x53, 0x54, 0x41, - 0x54, 0xdc, 0xc7, 0x54, 0x4c, 0x49, 0x44, 0xa0, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xdc, 0xc5, 0x43, - 0x41, 0x52, 0x54, 0xe0, 0xc5, 0x46, 0x43, 0x41, 0x52, 0xb0, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc4, - 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x43, 0xd0, 0xc5, 0x53, 0x4c, 0x42, - 0x44, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x45, 0xd4, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd8, 0xc5, 0x50, - 0x4c, 0x49, 0x4e, 0xb4, 0xc5, 0x4c, 0x41, 0x44, 0x44, 0xbc, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xc0, - 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb8, 0xc5, 0x53, 0x51, 0x45, 0x45, 0x8c, 0xc5, 0x54, 0x41, 0x50, - 0x50, 0x90, 0xc5, 0x47, 0x55, 0x49, 0x54, 0x94, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x98, 0xc5, 0x42, - 0x45, 0x4c, 0x4c, 0x9c, 0xc5, 0x8c, 0x8c, 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, - 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, - 0x00, 0x5e, 0x00, 0x60, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x64, 0xc7, 0x9d, - 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, - 0x00, 0x6c, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x70, 0xc7, 0x9d, 0x00, 0xb2, - 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x78, - 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, 0x82, 0x00, 0x7c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, - 0x00, 0x91, 0x00, 0x80, 0xc7, 0xb3, 0x00, 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x84, 0xc7, 0xdc, - 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, 0x54, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa4, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x54, 0xc7, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, - 0x00, 0xc8, 0x00, 0x54, 0xc7, 0x8f, 0x00, 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xbc, 0xc7, 0x00, - 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, 0xc4, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa4, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xe0, 0xc7, 0x40, - 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, - 0x00, 0xe8, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, 0x74, 0x00, 0xa8, - 0x00, 0x6a, 0x00, 0x88, 0x00, 0xf0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, - 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x20, 0xc8, 0xf3, 0x00, 0x03, - 0x01, 0x83, 0x00, 0x93, 0x00, 0x1c, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x54, - 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, - 0x00, 0x52, 0x00, 0x80, 0x00, 0x38, 0xc8, 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, - 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x50, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, - 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, - 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x5c, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, - 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, - 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, - 0x00, 0x6f, 0x00, 0x54, 0xc8, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x4c, 0xc8, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, - 0x00, 0x80, 0x00, 0x4c, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x58, 0xc8, 0x3e, - 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x78, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa4, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, + 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, + 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, + 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, + 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, + 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, + 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, + 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, + 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, + 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, + 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, + 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, + 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, + 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, + 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, + 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, + 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, + 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, + 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, + 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, + 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, + 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, + 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, + 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, + 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, + 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, + 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, + 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, + 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, + 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, + 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, + 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, + 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, + 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, + 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, + 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, + 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, + 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, + 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, + 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, + 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, + 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, + 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, + 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, + 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, + 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, + 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, + 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, + 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, + 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, + 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, + 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, + 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, + 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, + 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, + 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, + 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, @@ -21075,18 +20983,18 @@ void __start(Context &context) { 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc4, 0xc8, 0x50, 0x00, - 0x93, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x84, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, - 0xc8, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa4, 0xca, 0xff, 0xff, 0x53, 0x50, + 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, + 0x93, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, + 0xc4, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, - 0x00, 0x87, 0x83, 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, - 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, - 0x00, 0x2c, 0xc8, 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, - 0x01, 0x64, 0x00, 0x7c, 0x00, 0xd0, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd8, - 0xc9, 0xff, 0xff, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x74, 0xc4, 0x00, 0x00, 0x32, - 0x00, 0x00, 0x00, 0xb4, 0x00, 0x80, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x2c, - 0xc8, 0x12, 0x01, 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x30, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, - 0x00, 0x7c, 0x00, 0xd0, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd8, 0xc9, 0xff, + 0x00, 0x87, 0x83, 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, + 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, + 0x00, 0x28, 0xc8, 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, + 0x01, 0x64, 0x00, 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, + 0xc9, 0xff, 0xff, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, + 0x00, 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, + 0xc8, 0x12, 0x01, 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, + 0x00, 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, @@ -21521,556 +21429,555 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc314: monprint(context); break; case 0xc318: getnumber(context); break; case 0xc31c: getnextword(context); break; - case 0xc320: modifychar(context); break; - case 0xc324: fillryan(context); break; - case 0xc328: fillopen(context); break; - case 0xc32c: findallryan(context); break; - case 0xc330: findallopen(context); break; - case 0xc334: obtoinv(context); break; - case 0xc338: isitworn(context); break; - case 0xc33c: makeworn(context); break; - case 0xc340: examineob(context); break; - case 0xc344: makemainscreen(context); break; - case 0xc348: getbackfromob(context); break; - case 0xc34c: incryanpage(context); break; - case 0xc350: openinv(context); break; - case 0xc354: showryanpage(context); break; - case 0xc358: openob(context); break; - case 0xc35c: obicons(context); break; - case 0xc360: examicon(context); break; - case 0xc364: obpicture(context); break; - case 0xc368: describeob(context); break; - case 0xc36c: additionaltext(context); break; - case 0xc370: obsthatdothings(context); break; - case 0xc374: getobtextstart(context); break; - case 0xc378: searchforsame(context); break; - case 0xc37c: findnextcolon(context); break; - case 0xc380: inventory(context); break; - case 0xc384: setpickup(context); break; - case 0xc388: examinventory(context); break; - case 0xc38c: reexfrominv(context); break; - case 0xc390: reexfromopen(context); break; - case 0xc394: swapwithinv(context); break; - case 0xc398: swapwithopen(context); break; - case 0xc39c: intoinv(context); break; - case 0xc3a0: deletetaken(context); break; - case 0xc3a4: outofinv(context); break; - case 0xc3a8: getfreead(context); break; - case 0xc3ac: getexad(context); break; - case 0xc3b0: geteitherad(context); break; - case 0xc3b4: getanyad(context); break; - case 0xc3b8: getanyaddir(context); break; - case 0xc3bc: getopenedsize(context); break; - case 0xc3c0: getsetad(context); break; - case 0xc3c4: findinvpos(context); break; - case 0xc3c8: findopenpos(context); break; - case 0xc3cc: dropobject(context); break; - case 0xc3d0: droperror(context); break; - case 0xc3d4: cantdrop(context); break; - case 0xc3d8: wornerror(context); break; - case 0xc3dc: removeobfrominv(context); break; - case 0xc3e0: selectopenob(context); break; - case 0xc3e4: useopened(context); break; - case 0xc3e8: errormessage1(context); break; - case 0xc3ec: errormessage2(context); break; - case 0xc3f0: errormessage3(context); break; - case 0xc3f4: checkobjectsize(context); break; - case 0xc3f8: outofopen(context); break; - case 0xc3fc: transfertoex(context); break; - case 0xc400: pickupconts(context); break; - case 0xc404: transfercontoex(context); break; - case 0xc408: transfertext(context); break; - case 0xc40c: getexpos(context); break; - case 0xc410: purgealocation(context); break; - case 0xc414: emergencypurge(context); break; - case 0xc418: purgeanitem(context); break; - case 0xc41c: deleteexobject(context); break; - case 0xc420: deleteexframe(context); break; - case 0xc424: deleteextext(context); break; - case 0xc428: blockget(context); break; - case 0xc42c: drawfloor(context); break; - case 0xc430: calcmapad(context); break; - case 0xc434: getdimension(context); break; - case 0xc438: addalong(context); break; - case 0xc43c: addlength(context); break; - case 0xc440: drawflags(context); break; - case 0xc444: eraseoldobs(context); break; - case 0xc448: showallobs(context); break; - case 0xc44c: makebackob(context); break; - case 0xc450: showallfree(context); break; - case 0xc454: showallex(context); break; - case 0xc458: calcfrframe(context); break; - case 0xc45c: finalframe(context); break; - case 0xc460: adjustlen(context); break; - case 0xc464: getmapad(context); break; - case 0xc468: getxad(context); break; - case 0xc46c: getyad(context); break; - case 0xc470: autolook(context); break; - case 0xc474: look(context); break; - case 0xc478: dolook(context); break; - case 0xc47c: redrawmainscrn(context); break; - case 0xc480: getback1(context); break; - case 0xc484: talk(context); break; - case 0xc488: convicons(context); break; - case 0xc48c: getpersframe(context); break; - case 0xc490: starttalk(context); break; - case 0xc494: getpersontext(context); break; - case 0xc498: moretalk(context); break; - case 0xc49c: dosometalk(context); break; - case 0xc4a0: hangonpq(context); break; - case 0xc4a4: redes(context); break; - case 0xc4a8: newplace(context); break; - case 0xc4ac: selectlocation(context); break; - case 0xc4b0: showcity(context); break; - case 0xc4b4: lookatplace(context); break; - case 0xc4b8: getundercentre(context); break; - case 0xc4bc: putundercentre(context); break; - case 0xc4c0: locationpic(context); break; - case 0xc4c4: getdestinfo(context); break; - case 0xc4c8: showarrows(context); break; - case 0xc4cc: nextdest(context); break; - case 0xc4d0: lastdest(context); break; - case 0xc4d4: destselect(context); break; - case 0xc4d8: getlocation(context); break; - case 0xc4dc: setlocation(context); break; - case 0xc4e0: resetlocation(context); break; - case 0xc4e4: readdesticon(context); break; - case 0xc4e8: readcitypic(context); break; - case 0xc4ec: usemon(context); break; - case 0xc4f0: printoutermon(context); break; - case 0xc4f4: loadpersonal(context); break; - case 0xc4f8: loadnews(context); break; - case 0xc4fc: loadcart(context); break; - case 0xc500: lookininterface(context); break; - case 0xc504: turnonpower(context); break; - case 0xc508: randomaccess(context); break; - case 0xc50c: powerlighton(context); break; - case 0xc510: powerlightoff(context); break; - case 0xc514: accesslighton(context); break; - case 0xc518: accesslightoff(context); break; - case 0xc51c: locklighton(context); break; - case 0xc520: locklightoff(context); break; - case 0xc524: input(context); break; - case 0xc528: makecaps(context); break; - case 0xc52c: delchar(context); break; - case 0xc530: execcommand(context); break; - case 0xc534: neterror(context); break; - case 0xc538: dircom(context); break; - case 0xc53c: searchforfiles(context); break; - case 0xc540: signon(context); break; - case 0xc544: showkeys(context); break; - case 0xc548: read(context); break; - case 0xc54c: dirfile(context); break; - case 0xc550: getkeyandlogo(context); break; - case 0xc554: searchforstring(context); break; - case 0xc558: parser(context); break; - case 0xc55c: scrollmonitor(context); break; - case 0xc560: lockmon(context); break; - case 0xc564: monitorlogo(context); break; - case 0xc568: printlogo(context); break; - case 0xc56c: showcurrentfile(context); break; - case 0xc570: monmessage(context); break; - case 0xc574: processtrigger(context); break; - case 0xc578: triggermessage(context); break; - case 0xc57c: printcurs(context); break; - case 0xc580: delcurs(context); break; - case 0xc584: useobject(context); break; - case 0xc588: useroutine(context); break; - case 0xc58c: wheelsound(context); break; - case 0xc590: runtap(context); break; - case 0xc594: playguitar(context); break; - case 0xc598: hotelcontrol(context); break; - case 0xc59c: hotelbell(context); break; - case 0xc5a0: opentomb(context); break; - case 0xc5a4: usetrainer(context); break; - case 0xc5a8: nothelderror(context); break; - case 0xc5ac: usepipe(context); break; - case 0xc5b0: usefullcart(context); break; - case 0xc5b4: useplinth(context); break; - case 0xc5b8: chewy(context); break; - case 0xc5bc: useladder(context); break; - case 0xc5c0: useladderb(context); break; - case 0xc5c4: slabdoora(context); break; - case 0xc5c8: slabdoorb(context); break; - case 0xc5cc: slabdoord(context); break; - case 0xc5d0: slabdoorc(context); break; - case 0xc5d4: slabdoore(context); break; - case 0xc5d8: slabdoorf(context); break; - case 0xc5dc: useslab(context); break; - case 0xc5e0: usecart(context); break; - case 0xc5e4: useclearbox(context); break; - case 0xc5e8: usecoveredbox(context); break; - case 0xc5ec: userailing(context); break; - case 0xc5f0: useopenbox(context); break; - case 0xc5f4: wearwatch(context); break; - case 0xc5f8: wearshades(context); break; - case 0xc5fc: sitdowninbar(context); break; - case 0xc600: usechurchhole(context); break; - case 0xc604: usehole(context); break; - case 0xc608: usealtar(context); break; - case 0xc60c: opentvdoor(context); break; - case 0xc610: usedryer(context); break; - case 0xc614: openlouis(context); break; - case 0xc618: nextcolon(context); break; - case 0xc61c: openyourneighbour(context); break; - case 0xc620: usewindow(context); break; - case 0xc624: usebalcony(context); break; - case 0xc628: openryan(context); break; - case 0xc62c: openpoolboss(context); break; - case 0xc630: openeden(context); break; - case 0xc634: opensarters(context); break; - case 0xc638: isitright(context); break; - case 0xc63c: drawitall(context); break; - case 0xc640: openhoteldoor(context); break; - case 0xc644: openhoteldoor2(context); break; - case 0xc648: grafittidoor(context); break; - case 0xc64c: trapdoor(context); break; - case 0xc650: callhotellift(context); break; - case 0xc654: calledenslift(context); break; - case 0xc658: calledensdlift(context); break; - case 0xc65c: usepoolreader(context); break; - case 0xc660: uselighter(context); break; - case 0xc664: showseconduse(context); break; - case 0xc668: usecardreader1(context); break; - case 0xc66c: usecardreader2(context); break; - case 0xc670: usecardreader3(context); break; - case 0xc674: usecashcard(context); break; - case 0xc678: lookatcard(context); break; - case 0xc67c: moneypoke(context); break; - case 0xc680: usecontrol(context); break; - case 0xc684: usehatch(context); break; - case 0xc688: usewire(context); break; - case 0xc68c: usehandle(context); break; - case 0xc690: useelevator1(context); break; - case 0xc694: showfirstuse(context); break; - case 0xc698: useelevator3(context); break; - case 0xc69c: useelevator4(context); break; - case 0xc6a0: useelevator2(context); break; - case 0xc6a4: useelevator5(context); break; - case 0xc6a8: usekey(context); break; - case 0xc6ac: usestereo(context); break; - case 0xc6b0: usecooker(context); break; - case 0xc6b4: useaxe(context); break; - case 0xc6b8: useelvdoor(context); break; - case 0xc6bc: withwhat(context); break; - case 0xc6c0: selectob(context); break; - case 0xc6c4: compare(context); break; - case 0xc6c8: findsetobject(context); break; - case 0xc6cc: findexobject(context); break; - case 0xc6d0: isryanholding(context); break; - case 0xc6d4: checkinside(context); break; - case 0xc6d8: usetext(context); break; - case 0xc6dc: putbackobstuff(context); break; - case 0xc6e0: showpuztext(context); break; - case 0xc6e4: findpuztext(context); break; - case 0xc6e8: placesetobject(context); break; - case 0xc6ec: removesetobject(context); break; - case 0xc6f0: issetobonmap(context); break; - case 0xc6f4: placefreeobject(context); break; - case 0xc6f8: removefreeobject(context); break; - case 0xc6fc: findormake(context); break; - case 0xc700: switchryanon(context); break; - case 0xc704: switchryanoff(context); break; - case 0xc708: setallchanges(context); break; - case 0xc70c: dochange(context); break; - case 0xc710: autoappear(context); break; - case 0xc714: getundertimed(context); break; - case 0xc718: putundertimed(context); break; - case 0xc71c: dumptimedtext(context); break; - case 0xc720: setuptimeduse(context); break; - case 0xc724: setuptimedtemp(context); break; - case 0xc728: usetimedtext(context); break; - case 0xc72c: edenscdplayer(context); break; - case 0xc730: usewall(context); break; - case 0xc734: usechurchgate(context); break; - case 0xc738: usegun(context); break; - case 0xc73c: useshield(context); break; - case 0xc740: usebuttona(context); break; - case 0xc744: useplate(context); break; - case 0xc748: usewinch(context); break; - case 0xc74c: entercode(context); break; - case 0xc750: loadkeypad(context); break; - case 0xc754: quitkey(context); break; - case 0xc758: addtopresslist(context); break; - case 0xc75c: buttonone(context); break; - case 0xc760: buttontwo(context); break; - case 0xc764: buttonthree(context); break; - case 0xc768: buttonfour(context); break; - case 0xc76c: buttonfive(context); break; - case 0xc770: buttonsix(context); break; - case 0xc774: buttonseven(context); break; - case 0xc778: buttoneight(context); break; - case 0xc77c: buttonnine(context); break; - case 0xc780: buttonnought(context); break; - case 0xc784: buttonenter(context); break; - case 0xc788: buttonpress(context); break; - case 0xc78c: showouterpad(context); break; - case 0xc790: showkeypad(context); break; - case 0xc794: singlekey(context); break; - case 0xc798: dumpkeypad(context); break; - case 0xc79c: usemenu(context); break; - case 0xc7a0: dumpmenu(context); break; - case 0xc7a4: getundermenu(context); break; - case 0xc7a8: putundermenu(context); break; - case 0xc7ac: showoutermenu(context); break; - case 0xc7b0: showmenu(context); break; - case 0xc7b4: loadmenu(context); break; - case 0xc7b8: viewfolder(context); break; - case 0xc7bc: nextfolder(context); break; - case 0xc7c0: folderhints(context); break; - case 0xc7c4: lastfolder(context); break; - case 0xc7c8: loadfolder(context); break; - case 0xc7cc: showfolder(context); break; - case 0xc7d0: folderexit(context); break; - case 0xc7d4: showleftpage(context); break; - case 0xc7d8: showrightpage(context); break; - case 0xc7dc: entersymbol(context); break; - case 0xc7e0: quitsymbol(context); break; - case 0xc7e4: settopleft(context); break; - case 0xc7e8: settopright(context); break; - case 0xc7ec: setbotleft(context); break; - case 0xc7f0: setbotright(context); break; - case 0xc7f4: dumpsymbol(context); break; - case 0xc7f8: showsymbol(context); break; - case 0xc7fc: nextsymbol(context); break; - case 0xc800: updatesymboltop(context); break; - case 0xc804: updatesymbolbot(context); break; - case 0xc808: dumpsymbox(context); break; - case 0xc80c: usediary(context); break; - case 0xc810: showdiary(context); break; - case 0xc814: showdiarykeys(context); break; - case 0xc818: dumpdiarykeys(context); break; - case 0xc81c: diarykeyp(context); break; - case 0xc820: diarykeyn(context); break; - case 0xc824: showdiarypage(context); break; - case 0xc828: findtext1(context); break; - case 0xc82c: zoomonoff(context); break; - case 0xc830: saveload(context); break; - case 0xc834: dosaveload(context); break; - case 0xc838: getbackfromops(context); break; - case 0xc83c: showmainops(context); break; - case 0xc840: showdiscops(context); break; - case 0xc844: loadsavebox(context); break; - case 0xc848: loadgame(context); break; - case 0xc84c: getbacktoops(context); break; - case 0xc850: discops(context); break; - case 0xc854: savegame(context); break; - case 0xc858: actualsave(context); break; - case 0xc85c: actualload(context); break; - case 0xc860: selectslot2(context); break; - case 0xc864: checkinput(context); break; - case 0xc868: getnamepos(context); break; - case 0xc86c: showopbox(context); break; - case 0xc870: showloadops(context); break; - case 0xc874: showsaveops(context); break; - case 0xc878: selectslot(context); break; - case 0xc87c: showslots(context); break; - case 0xc880: shownames(context); break; - case 0xc884: dosreturn(context); break; - case 0xc888: error(context); break; - case 0xc88c: namestoold(context); break; - case 0xc890: oldtonames(context); break; - case 0xc894: savefilewrite(context); break; - case 0xc898: savefileread(context); break; - case 0xc89c: saveposition(context); break; - case 0xc8a0: loadposition(context); break; - case 0xc8a4: loadseg(context); break; - case 0xc8a8: makeheader(context); break; - case 0xc8ac: storeit(context); break; - case 0xc8b0: saveseg(context); break; - case 0xc8b4: findlen(context); break; - case 0xc8b8: scanfornames(context); break; - case 0xc8bc: decide(context); break; - case 0xc8c0: showdecisions(context); break; - case 0xc8c4: newgame(context); break; - case 0xc8c8: loadold(context); break; - case 0xc8cc: loadspeech(context); break; - case 0xc8d0: createname(context); break; - case 0xc8d4: loadsample(context); break; - case 0xc8d8: loadsecondsample(context); break; - case 0xc8dc: soundstartup(context); break; - case 0xc8e0: trysoundalloc(context); break; - case 0xc8e4: setsoundoff(context); break; - case 0xc8e8: checksoundint(context); break; - case 0xc8ec: enablesoundint(context); break; - case 0xc8f0: disablesoundint(context); break; - case 0xc8f4: interupttest(context); break; - case 0xc8f8: soundend(context); break; - case 0xc8fc: out22c(context); break; - case 0xc900: playchannel0(context); break; - case 0xc904: playchannel1(context); break; - case 0xc908: makenextblock(context); break; - case 0xc90c: volumeadjust(context); break; - case 0xc910: loopchannel0(context); break; - case 0xc914: cancelch0(context); break; - case 0xc918: cancelch1(context); break; - case 0xc91c: channel0only(context); break; - case 0xc920: channel1only(context); break; - case 0xc924: channel0tran(context); break; - case 0xc928: bothchannels(context); break; - case 0xc92c: saveems(context); break; - case 0xc930: restoreems(context); break; - case 0xc934: domix(context); break; - case 0xc938: dmaend(context); break; - case 0xc93c: startdmablock(context); break; - case 0xc940: setuppit(context); break; - case 0xc944: getridofpit(context); break; - case 0xc948: pitinterupt(context); break; - case 0xc94c: dreamweb(context); break; - case 0xc950: entrytexts(context); break; - case 0xc954: entryanims(context); break; - case 0xc958: initialinv(context); break; - case 0xc95c: pickupob(context); break; - case 0xc960: setupemm(context); break; - case 0xc964: removeemm(context); break; - case 0xc968: checkforemm(context); break; - case 0xc96c: checkbasemem(context); break; - case 0xc970: allocatebuffers(context); break; - case 0xc974: clearbuffers(context); break; - case 0xc978: clearchanges(context); break; - case 0xc97c: clearbeforeload(context); break; - case 0xc980: clearreels(context); break; - case 0xc984: clearrest(context); break; - case 0xc988: deallocatemem(context); break; - case 0xc98c: allocatemem(context); break; - case 0xc994: parseblaster(context); break; - case 0xc998: startup(context); break; - case 0xc99c: startup1(context); break; - case 0xc9a0: screenupdate(context); break; - case 0xc9a4: watchreel(context); break; - case 0xc9a8: checkforshake(context); break; - case 0xc9ac: watchcount(context); break; - case 0xc9b0: showtime(context); break; - case 0xc9b4: dumpwatch(context); break; - case 0xc9b8: showbyte(context); break; - case 0xc9bc: onedigit(context); break; - case 0xc9c0: twodigitnum(context); break; - case 0xc9c4: showword(context); break; - case 0xc9c8: convnum(context); break; - case 0xc9cc: mainscreen(context); break; - case 0xc9d0: madmanrun(context); break; - case 0xc9d4: checkcoords(context); break; - case 0xc9d8: identifyob(context); break; - case 0xc9dc: checkifperson(context); break; - case 0xc9e0: checkifset(context); break; - case 0xc9e4: checkifex(context); break; - case 0xc9e8: checkiffree(context); break; - case 0xc9ec: isitdescribed(context); break; - case 0xc9f0: findpathofpoint(context); break; - case 0xc9f4: findfirstpath(context); break; - case 0xc9f8: turnpathon(context); break; - case 0xc9fc: turnpathoff(context); break; - case 0xca00: turnanypathon(context); break; - case 0xca04: turnanypathoff(context); break; - case 0xca08: checkifpathison(context); break; - case 0xca0c: afternewroom(context); break; - case 0xca10: atmospheres(context); break; - case 0xca14: walkintoroom(context); break; - case 0xca18: afterintroroom(context); break; - case 0xca1c: obname(context); break; - case 0xca20: finishedwalking(context); break; - case 0xca24: examineobtext(context); break; - case 0xca28: commandwithob(context); break; - case 0xca2c: commandonly(context); break; - case 0xca30: printmessage(context); break; - case 0xca34: printmessage2(context); break; - case 0xca38: blocknametext(context); break; - case 0xca3c: personnametext(context); break; - case 0xca40: walktotext(context); break; - case 0xca44: getflagunderp(context); break; - case 0xca48: setwalk(context); break; - case 0xca4c: autosetwalk(context); break; - case 0xca50: checkdest(context); break; - case 0xca54: bresenhams(context); break; - case 0xca58: workoutframes(context); break; - case 0xca5c: getroomspaths(context); break; - case 0xca60: copyname(context); break; - case 0xca64: findobname(context); break; - case 0xca68: showicon(context); break; - case 0xca6c: middlepanel(context); break; - case 0xca70: showman(context); break; - case 0xca74: showpanel(context); break; - case 0xca78: roomname(context); break; - case 0xca7c: usecharset1(context); break; - case 0xca80: usetempcharset(context); break; - case 0xca84: showexit(context); break; - case 0xca88: panelicons1(context); break; - case 0xca8c: showwatch(context); break; - case 0xca90: gettime(context); break; - case 0xca94: zoomicon(context); break; - case 0xca98: showblink(context); break; - case 0xca9c: dumpblink(context); break; - case 0xcaa0: worktoscreenm(context); break; - case 0xcaa4: blank(context); break; - case 0xcaa8: allpointer(context); break; - case 0xcaac: hangonp(context); break; - case 0xcab0: hangonw(context); break; - case 0xcab4: hangoncurs(context); break; - case 0xcab8: getunderzoom(context); break; - case 0xcabc: dumpzoom(context); break; - case 0xcac0: putunderzoom(context); break; - case 0xcac4: crosshair(context); break; - case 0xcac8: showpointer(context); break; - case 0xcacc: delpointer(context); break; - case 0xcad0: dumppointer(context); break; - case 0xcad4: undertextline(context); break; - case 0xcad8: deltextline(context); break; - case 0xcadc: dumptextline(context); break; - case 0xcae0: animpointer(context); break; - case 0xcae4: setmouse(context); break; - case 0xcae8: readmouse(context); break; - case 0xcaec: mousecall(context); break; - case 0xcaf0: readmouse1(context); break; - case 0xcaf4: readmouse2(context); break; - case 0xcaf8: readmouse3(context); break; - case 0xcafc: readmouse4(context); break; - case 0xcb00: readkey(context); break; - case 0xcb04: convertkey(context); break; - case 0xcb08: randomnum1(context); break; - case 0xcb0c: randomnum2(context); break; - case 0xcb14: hangon(context); break; - case 0xcb18: loadtraveltext(context); break; - case 0xcb1c: loadintotemp(context); break; - case 0xcb20: loadintotemp2(context); break; - case 0xcb24: loadintotemp3(context); break; - case 0xcb28: loadtempcharset(context); break; - case 0xcb2c: standardload(context); break; - case 0xcb30: loadtemptext(context); break; - case 0xcb34: loadroom(context); break; - case 0xcb38: loadroomssample(context); break; - case 0xcb3c: getridofreels(context); break; - case 0xcb40: getridofall(context); break; - case 0xcb44: restorereels(context); break; - case 0xcb48: restoreall(context); break; - case 0xcb4c: sortoutmap(context); break; - case 0xcb50: startloading(context); break; - case 0xcb54: disablepath(context); break; - case 0xcb58: findxyfrompath(context); break; - case 0xcb5c: findroominloc(context); break; - case 0xcb60: getroomdata(context); break; - case 0xcb64: readheader(context); break; - case 0xcb68: dontloadseg(context); break; - case 0xcb6c: allocateload(context); break; - case 0xcb70: fillspace(context); break; - case 0xcb74: getridoftemp(context); break; - case 0xcb78: getridoftemptext(context); break; - case 0xcb7c: getridoftemp2(context); break; - case 0xcb80: getridoftemp3(context); break; - case 0xcb84: getridoftempcharset(context); break; - case 0xcb88: getridoftempsp(context); break; - case 0xcb8c: readsetdata(context); break; - case 0xcb90: createfile(context); break; - case 0xcb94: openfile(context); break; - case 0xcb98: openfilenocheck(context); break; - case 0xcb9c: openforsave(context); break; - case 0xcba0: closefile(context); break; - case 0xcba4: readfromfile(context); break; - case 0xcba8: setkeyboardint(context); break; - case 0xcbac: resetkeyboard(context); break; - case 0xcbb0: keyboardread(context); break; - case 0xcbb4: walkandexamine(context); break; - case 0xcbb8: doload(context); break; - case 0xcbbc: generalerror(context); break; + case 0xc320: fillryan(context); break; + case 0xc324: fillopen(context); break; + case 0xc328: findallryan(context); break; + case 0xc32c: findallopen(context); break; + case 0xc330: obtoinv(context); break; + case 0xc334: isitworn(context); break; + case 0xc338: makeworn(context); break; + case 0xc33c: examineob(context); break; + case 0xc340: makemainscreen(context); break; + case 0xc344: getbackfromob(context); break; + case 0xc348: incryanpage(context); break; + case 0xc34c: openinv(context); break; + case 0xc350: showryanpage(context); break; + case 0xc354: openob(context); break; + case 0xc358: obicons(context); break; + case 0xc35c: examicon(context); break; + case 0xc360: obpicture(context); break; + case 0xc364: describeob(context); break; + case 0xc368: additionaltext(context); break; + case 0xc36c: obsthatdothings(context); break; + case 0xc370: getobtextstart(context); break; + case 0xc374: searchforsame(context); break; + case 0xc378: findnextcolon(context); break; + case 0xc37c: inventory(context); break; + case 0xc380: setpickup(context); break; + case 0xc384: examinventory(context); break; + case 0xc388: reexfrominv(context); break; + case 0xc38c: reexfromopen(context); break; + case 0xc390: swapwithinv(context); break; + case 0xc394: swapwithopen(context); break; + case 0xc398: intoinv(context); break; + case 0xc39c: deletetaken(context); break; + case 0xc3a0: outofinv(context); break; + case 0xc3a4: getfreead(context); break; + case 0xc3a8: getexad(context); break; + case 0xc3ac: geteitherad(context); break; + case 0xc3b0: getanyad(context); break; + case 0xc3b4: getanyaddir(context); break; + case 0xc3b8: getopenedsize(context); break; + case 0xc3bc: getsetad(context); break; + case 0xc3c0: findinvpos(context); break; + case 0xc3c4: findopenpos(context); break; + case 0xc3c8: dropobject(context); break; + case 0xc3cc: droperror(context); break; + case 0xc3d0: cantdrop(context); break; + case 0xc3d4: wornerror(context); break; + case 0xc3d8: removeobfrominv(context); break; + case 0xc3dc: selectopenob(context); break; + case 0xc3e0: useopened(context); break; + case 0xc3e4: errormessage1(context); break; + case 0xc3e8: errormessage2(context); break; + case 0xc3ec: errormessage3(context); break; + case 0xc3f0: checkobjectsize(context); break; + case 0xc3f4: outofopen(context); break; + case 0xc3f8: transfertoex(context); break; + case 0xc3fc: pickupconts(context); break; + case 0xc400: transfercontoex(context); break; + case 0xc404: transfertext(context); break; + case 0xc408: getexpos(context); break; + case 0xc40c: purgealocation(context); break; + case 0xc410: emergencypurge(context); break; + case 0xc414: purgeanitem(context); break; + case 0xc418: deleteexobject(context); break; + case 0xc41c: deleteexframe(context); break; + case 0xc420: deleteextext(context); break; + case 0xc424: blockget(context); break; + case 0xc428: drawfloor(context); break; + case 0xc42c: calcmapad(context); break; + case 0xc430: getdimension(context); break; + case 0xc434: addalong(context); break; + case 0xc438: addlength(context); break; + case 0xc43c: drawflags(context); break; + case 0xc440: eraseoldobs(context); break; + case 0xc444: showallobs(context); break; + case 0xc448: makebackob(context); break; + case 0xc44c: showallfree(context); break; + case 0xc450: showallex(context); break; + case 0xc454: calcfrframe(context); break; + case 0xc458: finalframe(context); break; + case 0xc45c: adjustlen(context); break; + case 0xc460: getmapad(context); break; + case 0xc464: getxad(context); break; + case 0xc468: getyad(context); break; + case 0xc46c: autolook(context); break; + case 0xc470: look(context); break; + case 0xc474: dolook(context); break; + case 0xc478: redrawmainscrn(context); break; + case 0xc47c: getback1(context); break; + case 0xc480: talk(context); break; + case 0xc484: convicons(context); break; + case 0xc488: getpersframe(context); break; + case 0xc48c: starttalk(context); break; + case 0xc490: getpersontext(context); break; + case 0xc494: moretalk(context); break; + case 0xc498: dosometalk(context); break; + case 0xc49c: hangonpq(context); break; + case 0xc4a0: redes(context); break; + case 0xc4a4: newplace(context); break; + case 0xc4a8: selectlocation(context); break; + case 0xc4ac: showcity(context); break; + case 0xc4b0: lookatplace(context); break; + case 0xc4b4: getundercentre(context); break; + case 0xc4b8: putundercentre(context); break; + case 0xc4bc: locationpic(context); break; + case 0xc4c0: getdestinfo(context); break; + case 0xc4c4: showarrows(context); break; + case 0xc4c8: nextdest(context); break; + case 0xc4cc: lastdest(context); break; + case 0xc4d0: destselect(context); break; + case 0xc4d4: getlocation(context); break; + case 0xc4d8: setlocation(context); break; + case 0xc4dc: resetlocation(context); break; + case 0xc4e0: readdesticon(context); break; + case 0xc4e4: readcitypic(context); break; + case 0xc4e8: usemon(context); break; + case 0xc4ec: printoutermon(context); break; + case 0xc4f0: loadpersonal(context); break; + case 0xc4f4: loadnews(context); break; + case 0xc4f8: loadcart(context); break; + case 0xc4fc: lookininterface(context); break; + case 0xc500: turnonpower(context); break; + case 0xc504: randomaccess(context); break; + case 0xc508: powerlighton(context); break; + case 0xc50c: powerlightoff(context); break; + case 0xc510: accesslighton(context); break; + case 0xc514: accesslightoff(context); break; + case 0xc518: locklighton(context); break; + case 0xc51c: locklightoff(context); break; + case 0xc520: input(context); break; + case 0xc524: makecaps(context); break; + case 0xc528: delchar(context); break; + case 0xc52c: execcommand(context); break; + case 0xc530: neterror(context); break; + case 0xc534: dircom(context); break; + case 0xc538: searchforfiles(context); break; + case 0xc53c: signon(context); break; + case 0xc540: showkeys(context); break; + case 0xc544: read(context); break; + case 0xc548: dirfile(context); break; + case 0xc54c: getkeyandlogo(context); break; + case 0xc550: searchforstring(context); break; + case 0xc554: parser(context); break; + case 0xc558: scrollmonitor(context); break; + case 0xc55c: lockmon(context); break; + case 0xc560: monitorlogo(context); break; + case 0xc564: printlogo(context); break; + case 0xc568: showcurrentfile(context); break; + case 0xc56c: monmessage(context); break; + case 0xc570: processtrigger(context); break; + case 0xc574: triggermessage(context); break; + case 0xc578: printcurs(context); break; + case 0xc57c: delcurs(context); break; + case 0xc580: useobject(context); break; + case 0xc584: useroutine(context); break; + case 0xc588: wheelsound(context); break; + case 0xc58c: runtap(context); break; + case 0xc590: playguitar(context); break; + case 0xc594: hotelcontrol(context); break; + case 0xc598: hotelbell(context); break; + case 0xc59c: opentomb(context); break; + case 0xc5a0: usetrainer(context); break; + case 0xc5a4: nothelderror(context); break; + case 0xc5a8: usepipe(context); break; + case 0xc5ac: usefullcart(context); break; + case 0xc5b0: useplinth(context); break; + case 0xc5b4: chewy(context); break; + case 0xc5b8: useladder(context); break; + case 0xc5bc: useladderb(context); break; + case 0xc5c0: slabdoora(context); break; + case 0xc5c4: slabdoorb(context); break; + case 0xc5c8: slabdoord(context); break; + case 0xc5cc: slabdoorc(context); break; + case 0xc5d0: slabdoore(context); break; + case 0xc5d4: slabdoorf(context); break; + case 0xc5d8: useslab(context); break; + case 0xc5dc: usecart(context); break; + case 0xc5e0: useclearbox(context); break; + case 0xc5e4: usecoveredbox(context); break; + case 0xc5e8: userailing(context); break; + case 0xc5ec: useopenbox(context); break; + case 0xc5f0: wearwatch(context); break; + case 0xc5f4: wearshades(context); break; + case 0xc5f8: sitdowninbar(context); break; + case 0xc5fc: usechurchhole(context); break; + case 0xc600: usehole(context); break; + case 0xc604: usealtar(context); break; + case 0xc608: opentvdoor(context); break; + case 0xc60c: usedryer(context); break; + case 0xc610: openlouis(context); break; + case 0xc614: nextcolon(context); break; + case 0xc618: openyourneighbour(context); break; + case 0xc61c: usewindow(context); break; + case 0xc620: usebalcony(context); break; + case 0xc624: openryan(context); break; + case 0xc628: openpoolboss(context); break; + case 0xc62c: openeden(context); break; + case 0xc630: opensarters(context); break; + case 0xc634: isitright(context); break; + case 0xc638: drawitall(context); break; + case 0xc63c: openhoteldoor(context); break; + case 0xc640: openhoteldoor2(context); break; + case 0xc644: grafittidoor(context); break; + case 0xc648: trapdoor(context); break; + case 0xc64c: callhotellift(context); break; + case 0xc650: calledenslift(context); break; + case 0xc654: calledensdlift(context); break; + case 0xc658: usepoolreader(context); break; + case 0xc65c: uselighter(context); break; + case 0xc660: showseconduse(context); break; + case 0xc664: usecardreader1(context); break; + case 0xc668: usecardreader2(context); break; + case 0xc66c: usecardreader3(context); break; + case 0xc670: usecashcard(context); break; + case 0xc674: lookatcard(context); break; + case 0xc678: moneypoke(context); break; + case 0xc67c: usecontrol(context); break; + case 0xc680: usehatch(context); break; + case 0xc684: usewire(context); break; + case 0xc688: usehandle(context); break; + case 0xc68c: useelevator1(context); break; + case 0xc690: showfirstuse(context); break; + case 0xc694: useelevator3(context); break; + case 0xc698: useelevator4(context); break; + case 0xc69c: useelevator2(context); break; + case 0xc6a0: useelevator5(context); break; + case 0xc6a4: usekey(context); break; + case 0xc6a8: usestereo(context); break; + case 0xc6ac: usecooker(context); break; + case 0xc6b0: useaxe(context); break; + case 0xc6b4: useelvdoor(context); break; + case 0xc6b8: withwhat(context); break; + case 0xc6bc: selectob(context); break; + case 0xc6c0: compare(context); break; + case 0xc6c4: findsetobject(context); break; + case 0xc6c8: findexobject(context); break; + case 0xc6cc: isryanholding(context); break; + case 0xc6d0: checkinside(context); break; + case 0xc6d4: usetext(context); break; + case 0xc6d8: putbackobstuff(context); break; + case 0xc6dc: showpuztext(context); break; + case 0xc6e0: findpuztext(context); break; + case 0xc6e4: placesetobject(context); break; + case 0xc6e8: removesetobject(context); break; + case 0xc6ec: issetobonmap(context); break; + case 0xc6f0: placefreeobject(context); break; + case 0xc6f4: removefreeobject(context); break; + case 0xc6f8: findormake(context); break; + case 0xc6fc: switchryanon(context); break; + case 0xc700: switchryanoff(context); break; + case 0xc704: setallchanges(context); break; + case 0xc708: dochange(context); break; + case 0xc70c: autoappear(context); break; + case 0xc710: getundertimed(context); break; + case 0xc714: putundertimed(context); break; + case 0xc718: dumptimedtext(context); break; + case 0xc71c: setuptimeduse(context); break; + case 0xc720: setuptimedtemp(context); break; + case 0xc724: usetimedtext(context); break; + case 0xc728: edenscdplayer(context); break; + case 0xc72c: usewall(context); break; + case 0xc730: usechurchgate(context); break; + case 0xc734: usegun(context); break; + case 0xc738: useshield(context); break; + case 0xc73c: usebuttona(context); break; + case 0xc740: useplate(context); break; + case 0xc744: usewinch(context); break; + case 0xc748: entercode(context); break; + case 0xc74c: loadkeypad(context); break; + case 0xc750: quitkey(context); break; + case 0xc754: addtopresslist(context); break; + case 0xc758: buttonone(context); break; + case 0xc75c: buttontwo(context); break; + case 0xc760: buttonthree(context); break; + case 0xc764: buttonfour(context); break; + case 0xc768: buttonfive(context); break; + case 0xc76c: buttonsix(context); break; + case 0xc770: buttonseven(context); break; + case 0xc774: buttoneight(context); break; + case 0xc778: buttonnine(context); break; + case 0xc77c: buttonnought(context); break; + case 0xc780: buttonenter(context); break; + case 0xc784: buttonpress(context); break; + case 0xc788: showouterpad(context); break; + case 0xc78c: showkeypad(context); break; + case 0xc790: singlekey(context); break; + case 0xc794: dumpkeypad(context); break; + case 0xc798: usemenu(context); break; + case 0xc79c: dumpmenu(context); break; + case 0xc7a0: getundermenu(context); break; + case 0xc7a4: putundermenu(context); break; + case 0xc7a8: showoutermenu(context); break; + case 0xc7ac: showmenu(context); break; + case 0xc7b0: loadmenu(context); break; + case 0xc7b4: viewfolder(context); break; + case 0xc7b8: nextfolder(context); break; + case 0xc7bc: folderhints(context); break; + case 0xc7c0: lastfolder(context); break; + case 0xc7c4: loadfolder(context); break; + case 0xc7c8: showfolder(context); break; + case 0xc7cc: folderexit(context); break; + case 0xc7d0: showleftpage(context); break; + case 0xc7d4: showrightpage(context); break; + case 0xc7d8: entersymbol(context); break; + case 0xc7dc: quitsymbol(context); break; + case 0xc7e0: settopleft(context); break; + case 0xc7e4: settopright(context); break; + case 0xc7e8: setbotleft(context); break; + case 0xc7ec: setbotright(context); break; + case 0xc7f0: dumpsymbol(context); break; + case 0xc7f4: showsymbol(context); break; + case 0xc7f8: nextsymbol(context); break; + case 0xc7fc: updatesymboltop(context); break; + case 0xc800: updatesymbolbot(context); break; + case 0xc804: dumpsymbox(context); break; + case 0xc808: usediary(context); break; + case 0xc80c: showdiary(context); break; + case 0xc810: showdiarykeys(context); break; + case 0xc814: dumpdiarykeys(context); break; + case 0xc818: diarykeyp(context); break; + case 0xc81c: diarykeyn(context); break; + case 0xc820: showdiarypage(context); break; + case 0xc824: findtext1(context); break; + case 0xc828: zoomonoff(context); break; + case 0xc82c: saveload(context); break; + case 0xc830: dosaveload(context); break; + case 0xc834: getbackfromops(context); break; + case 0xc838: showmainops(context); break; + case 0xc83c: showdiscops(context); break; + case 0xc840: loadsavebox(context); break; + case 0xc844: loadgame(context); break; + case 0xc848: getbacktoops(context); break; + case 0xc84c: discops(context); break; + case 0xc850: savegame(context); break; + case 0xc854: actualsave(context); break; + case 0xc858: actualload(context); break; + case 0xc85c: selectslot2(context); break; + case 0xc860: checkinput(context); break; + case 0xc864: getnamepos(context); break; + case 0xc868: showopbox(context); break; + case 0xc86c: showloadops(context); break; + case 0xc870: showsaveops(context); break; + case 0xc874: selectslot(context); break; + case 0xc878: showslots(context); break; + case 0xc87c: shownames(context); break; + case 0xc880: dosreturn(context); break; + case 0xc884: error(context); break; + case 0xc888: namestoold(context); break; + case 0xc88c: oldtonames(context); break; + case 0xc890: savefilewrite(context); break; + case 0xc894: savefileread(context); break; + case 0xc898: saveposition(context); break; + case 0xc89c: loadposition(context); break; + case 0xc8a0: loadseg(context); break; + case 0xc8a4: makeheader(context); break; + case 0xc8a8: storeit(context); break; + case 0xc8ac: saveseg(context); break; + case 0xc8b0: findlen(context); break; + case 0xc8b4: scanfornames(context); break; + case 0xc8b8: decide(context); break; + case 0xc8bc: showdecisions(context); break; + case 0xc8c0: newgame(context); break; + case 0xc8c4: loadold(context); break; + case 0xc8c8: loadspeech(context); break; + case 0xc8cc: createname(context); break; + case 0xc8d0: loadsample(context); break; + case 0xc8d4: loadsecondsample(context); break; + case 0xc8d8: soundstartup(context); break; + case 0xc8dc: trysoundalloc(context); break; + case 0xc8e0: setsoundoff(context); break; + case 0xc8e4: checksoundint(context); break; + case 0xc8e8: enablesoundint(context); break; + case 0xc8ec: disablesoundint(context); break; + case 0xc8f0: interupttest(context); break; + case 0xc8f4: soundend(context); break; + case 0xc8f8: out22c(context); break; + case 0xc8fc: playchannel0(context); break; + case 0xc900: playchannel1(context); break; + case 0xc904: makenextblock(context); break; + case 0xc908: volumeadjust(context); break; + case 0xc90c: loopchannel0(context); break; + case 0xc910: cancelch0(context); break; + case 0xc914: cancelch1(context); break; + case 0xc918: channel0only(context); break; + case 0xc91c: channel1only(context); break; + case 0xc920: channel0tran(context); break; + case 0xc924: bothchannels(context); break; + case 0xc928: saveems(context); break; + case 0xc92c: restoreems(context); break; + case 0xc930: domix(context); break; + case 0xc934: dmaend(context); break; + case 0xc938: startdmablock(context); break; + case 0xc93c: setuppit(context); break; + case 0xc940: getridofpit(context); break; + case 0xc944: pitinterupt(context); break; + case 0xc948: dreamweb(context); break; + case 0xc94c: entrytexts(context); break; + case 0xc950: entryanims(context); break; + case 0xc954: initialinv(context); break; + case 0xc958: pickupob(context); break; + case 0xc95c: setupemm(context); break; + case 0xc960: removeemm(context); break; + case 0xc964: checkforemm(context); break; + case 0xc968: checkbasemem(context); break; + case 0xc96c: allocatebuffers(context); break; + case 0xc970: clearbuffers(context); break; + case 0xc974: clearchanges(context); break; + case 0xc978: clearbeforeload(context); break; + case 0xc97c: clearreels(context); break; + case 0xc980: clearrest(context); break; + case 0xc984: deallocatemem(context); break; + case 0xc988: allocatemem(context); break; + case 0xc990: parseblaster(context); break; + case 0xc994: startup(context); break; + case 0xc998: startup1(context); break; + case 0xc99c: screenupdate(context); break; + case 0xc9a0: watchreel(context); break; + case 0xc9a4: checkforshake(context); break; + case 0xc9a8: watchcount(context); break; + case 0xc9ac: showtime(context); break; + case 0xc9b0: dumpwatch(context); break; + case 0xc9b4: showbyte(context); break; + case 0xc9b8: onedigit(context); break; + case 0xc9bc: twodigitnum(context); break; + case 0xc9c0: showword(context); break; + case 0xc9c4: convnum(context); break; + case 0xc9c8: mainscreen(context); break; + case 0xc9cc: madmanrun(context); break; + case 0xc9d0: checkcoords(context); break; + case 0xc9d4: identifyob(context); break; + case 0xc9d8: checkifperson(context); break; + case 0xc9dc: checkifset(context); break; + case 0xc9e0: checkifex(context); break; + case 0xc9e4: checkiffree(context); break; + case 0xc9e8: isitdescribed(context); break; + case 0xc9ec: findpathofpoint(context); break; + case 0xc9f0: findfirstpath(context); break; + case 0xc9f4: turnpathon(context); break; + case 0xc9f8: turnpathoff(context); break; + case 0xc9fc: turnanypathon(context); break; + case 0xca00: turnanypathoff(context); break; + case 0xca04: checkifpathison(context); break; + case 0xca08: afternewroom(context); break; + case 0xca0c: atmospheres(context); break; + case 0xca10: walkintoroom(context); break; + case 0xca14: afterintroroom(context); break; + case 0xca18: obname(context); break; + case 0xca1c: finishedwalking(context); break; + case 0xca20: examineobtext(context); break; + case 0xca24: commandwithob(context); break; + case 0xca28: commandonly(context); break; + case 0xca2c: printmessage(context); break; + case 0xca30: printmessage2(context); break; + case 0xca34: blocknametext(context); break; + case 0xca38: personnametext(context); break; + case 0xca3c: walktotext(context); break; + case 0xca40: getflagunderp(context); break; + case 0xca44: setwalk(context); break; + case 0xca48: autosetwalk(context); break; + case 0xca4c: checkdest(context); break; + case 0xca50: bresenhams(context); break; + case 0xca54: workoutframes(context); break; + case 0xca58: getroomspaths(context); break; + case 0xca5c: copyname(context); break; + case 0xca60: findobname(context); break; + case 0xca64: showicon(context); break; + case 0xca68: middlepanel(context); break; + case 0xca6c: showman(context); break; + case 0xca70: showpanel(context); break; + case 0xca74: roomname(context); break; + case 0xca78: usecharset1(context); break; + case 0xca7c: usetempcharset(context); break; + case 0xca80: showexit(context); break; + case 0xca84: panelicons1(context); break; + case 0xca88: showwatch(context); break; + case 0xca8c: gettime(context); break; + case 0xca90: zoomicon(context); break; + case 0xca94: showblink(context); break; + case 0xca98: dumpblink(context); break; + case 0xca9c: worktoscreenm(context); break; + case 0xcaa0: blank(context); break; + case 0xcaa4: allpointer(context); break; + case 0xcaa8: hangonp(context); break; + case 0xcaac: hangonw(context); break; + case 0xcab0: hangoncurs(context); break; + case 0xcab4: getunderzoom(context); break; + case 0xcab8: dumpzoom(context); break; + case 0xcabc: putunderzoom(context); break; + case 0xcac0: crosshair(context); break; + case 0xcac4: showpointer(context); break; + case 0xcac8: delpointer(context); break; + case 0xcacc: dumppointer(context); break; + case 0xcad0: undertextline(context); break; + case 0xcad4: deltextline(context); break; + case 0xcad8: dumptextline(context); break; + case 0xcadc: animpointer(context); break; + case 0xcae0: setmouse(context); break; + case 0xcae4: readmouse(context); break; + case 0xcae8: mousecall(context); break; + case 0xcaec: readmouse1(context); break; + case 0xcaf0: readmouse2(context); break; + case 0xcaf4: readmouse3(context); break; + case 0xcaf8: readmouse4(context); break; + case 0xcafc: readkey(context); break; + case 0xcb00: convertkey(context); break; + case 0xcb04: randomnum1(context); break; + case 0xcb08: randomnum2(context); break; + case 0xcb10: hangon(context); break; + case 0xcb14: loadtraveltext(context); break; + case 0xcb18: loadintotemp(context); break; + case 0xcb1c: loadintotemp2(context); break; + case 0xcb20: loadintotemp3(context); break; + case 0xcb24: loadtempcharset(context); break; + case 0xcb28: standardload(context); break; + case 0xcb2c: loadtemptext(context); break; + case 0xcb30: loadroom(context); break; + case 0xcb34: loadroomssample(context); break; + case 0xcb38: getridofreels(context); break; + case 0xcb3c: getridofall(context); break; + case 0xcb40: restorereels(context); break; + case 0xcb44: restoreall(context); break; + case 0xcb48: sortoutmap(context); break; + case 0xcb4c: startloading(context); break; + case 0xcb50: disablepath(context); break; + case 0xcb54: findxyfrompath(context); break; + case 0xcb58: findroominloc(context); break; + case 0xcb5c: getroomdata(context); break; + case 0xcb60: readheader(context); break; + case 0xcb64: dontloadseg(context); break; + case 0xcb68: allocateload(context); break; + case 0xcb6c: fillspace(context); break; + case 0xcb70: getridoftemp(context); break; + case 0xcb74: getridoftemptext(context); break; + case 0xcb78: getridoftemp2(context); break; + case 0xcb7c: getridoftemp3(context); break; + case 0xcb80: getridoftempcharset(context); break; + case 0xcb84: getridoftempsp(context); break; + case 0xcb88: readsetdata(context); break; + case 0xcb8c: createfile(context); break; + case 0xcb90: openfile(context); break; + case 0xcb94: openfilenocheck(context); break; + case 0xcb98: openforsave(context); break; + case 0xcb9c: closefile(context); break; + case 0xcba0: readfromfile(context); break; + case 0xcba4: setkeyboardint(context); break; + case 0xcba8: resetkeyboard(context); break; + case 0xcbac: keyboardread(context); break; + case 0xcbb0: walkandexamine(context); break; + case 0xcbb4: doload(context); break; + case 0xcbb8: generalerror(context); break; default: ::error("invalid call to %04x dispatched", (uint16)context.ax); } } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index da4bbb6610..621c0c2c8d 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -555,11 +555,13 @@ namespace dreamgen { const static uint16 kPlayback = (0); const static uint16 kMap = (0); const static uint16 kSettextdat = (0); + const static uint16 kSpanish = (0); const static uint16 kFramedata = (0); const static uint16 kRecording = (0); const static uint16 kFlags = (0); const static uint16 kGerman = (0); const static uint16 kTextunder = (0); + const static uint16 kForeign = (0); const static uint16 kPathdata = (0); const static uint16 kDemo = (0); const static uint16 kExframedata = (0); @@ -568,26 +570,26 @@ namespace dreamgen { const static uint16 kFreetextdat = (0); const static uint16 kFrframedata = (0); const static uint16 kSettext = (0+(130*2)); - const static uint16 kOpeninvlist = (0+(228*13)); - const static uint16 kRyaninvlist = (0+(228*13)+32); - const static uint16 kPointerback = (0+(228*13)+32+60); - const static uint16 kMapflags = (0+(228*13)+32+60+(32*32)); - const static uint16 kStartpal = (0+(228*13)+32+60+(32*32)+(11*10*3)); - const static uint16 kEndpal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); - const static uint16 kMaingamepal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); - const static uint16 kSpritetable = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); - const static uint16 kSetlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); - const static uint16 kFreelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - const static uint16 kExlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); - const static uint16 kPeoplelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); - const static 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)); - const static 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)); - const static 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)); - const static 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)); - const static 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)); - const static 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)); - const static 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); - const static 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); + const static uint16 kOpeninvlist = (0+(180*10)); + const static uint16 kRyaninvlist = (0+(180*10)+32); + const static uint16 kPointerback = (0+(180*10)+32+60); + const static uint16 kMapflags = (0+(180*10)+32+60+(32*32)); + const static uint16 kStartpal = (0+(180*10)+32+60+(32*32)+(11*10*3)); + const static uint16 kEndpal = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + const static uint16 kMaingamepal = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + const static uint16 kSpritetable = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + const static uint16 kSetlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + const static uint16 kFreelist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + const static uint16 kExlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + const static uint16 kPeoplelist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + const static uint16 kZoomspace = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + const static uint16 kPrintedlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); + const static uint16 kListofchanges = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + const static uint16 kUndertimedtext = (0+(180*10)+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)); + const static uint16 kRainlist = (0+(180*10)+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*24)); + const static uint16 kInitialreelrouts = (0+(180*10)+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*24)+(6*64)); + const static uint16 kInitialvars = (0+(180*10)+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*24)+(6*64)+991-534); + const static uint16 kLengthofbuffer = (0+(180*10)+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*24)+(6*64)+991-534+68-0); const static uint16 kReellist = (0+(36*144)); const static uint16 kIntext = (0+(38*2)); const static uint16 kLengthofmap = (0+(66*60)); @@ -604,17 +606,15 @@ namespace dreamgen { const static uint16 kPersontxtdat = (0+24); const static uint16 kPersontext = (0+24+(1026*2)); const static uint16 kInputport = (0x63); - const static uint16 kSpanish = (1); - const static uint16 kForeign = (1); + const static uint16 kUndertextsizey = (10); const static uint16 kNumexobjects = (114); - const static uint16 kUndertextsizey = (13); const static uint16 kZoomy = (132); const static uint16 kFreedatlen = (16*80); + const static uint16 kUndertextsizex = (180); const static uint16 kExtextlen = (18000); const static uint16 kLenofmapstore = (22*8*20*8); - const static uint16 kUndertextsizex = (228); + const static uint16 kUndertimedysize = (24); const static uint16 kNumchanges = (250); - const static uint16 kUndertimedysize = (30); const static uint16 kExframeslen = (30000); const static uint16 kTablesize = (32); const static uint16 kScreenwidth = (320); -- cgit v1.2.3 From 0f8eacf0bdab45f574f0e02af89633cf8d9c8300 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 12 Jun 2011 19:52:08 +0200 Subject: DREAMWEB: Fix the maingamepal offset. (It changed recently.) --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 2ca38ce9a4..c72215292b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -769,7 +769,7 @@ void showpcx(Context &context) { pcxFile.seek(16, SEEK_SET); context.es = context.data.word(kBuffers); - maingamepal = context.es.ptr(5946, 768); + maingamepal = context.es.ptr(4782, 768); pcxFile.read(maingamepal, 48); memset(maingamepal + 48, 0xff, 720); -- cgit v1.2.3 From d65083ecaed475f88fac11ff99c72ad8c956ced3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 21:45:29 +0400 Subject: DREAMWEB: fixed neg instruction --- engines/dreamweb/runtime.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index aaed6866bc..573179d2a1 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -429,17 +429,15 @@ public: } inline void _neg(uint8 &src) { - flags._c = src != 0; - src = ~src; - flags.update_zs(src); - flags._o = false; + uint8 r = 0; + _sub(r, src); + src = r; } inline void _neg(uint16 &src) { - flags._c = src != 0; - src = ~src; - flags.update_zs(src); - flags._o = false; + uint16 r = 0; + _sub(r, src); + src = r; } inline void _movsb() { -- cgit v1.2.3 From de65cf35c10e7b3dcd5eba64c5a922428518f626 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 12 Jun 2011 20:41:30 +0200 Subject: DREAMWEB: Simplify the tracking of the mouse position and buttons The event manager keeps track of the mouse position and button state, so using that should be both simpler and more reliable than tracking it ourselves. This loses the support for middle-clicking, but it's not clear that this is needed anyway. (If necessary, it could be added to the event manager.) --- engines/dreamweb/dreamweb.cpp | 28 +++------------------------- engines/dreamweb/dreamweb.h | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index c72215292b..4fe9b41d97 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -62,7 +62,6 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _vSyncInterrupt = false; _console = 0; - _mouseState = 0; DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag"); DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); _outSaveFile = 0; @@ -117,27 +116,6 @@ void DreamWebEngine::processEvents() { Common::Event event; while (event_manager->pollEvent(event)) { switch(event.type) { - case Common::EVENT_LBUTTONDOWN: - _mouseState |= 1; - break; - case Common::EVENT_LBUTTONUP: - _mouseState &= ~1; - break; - case Common::EVENT_RBUTTONDOWN: - _mouseState |= 2; - break; - case Common::EVENT_RBUTTONUP: - _mouseState &= ~2; - break; - case Common::EVENT_MBUTTONDOWN: - _mouseState |= 4; - break; - case Common::EVENT_MBUTTONUP: - _mouseState &= ~4; - break; - case Common::EVENT_MOUSEMOVE: - _mouse = event.mouse; - break; case Common::EVENT_KEYDOWN: switch (event.kbd.keycode) { case Common::KEYCODE_d: @@ -170,7 +148,6 @@ void DreamWebEngine::processEvents() { Common::Error DreamWebEngine::run() { - _mouseState = 0; _console = new DreamWebConsole(this); getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); @@ -262,7 +239,8 @@ void DreamWebEngine::keyPressed(uint16 ascii) { void DreamWebEngine::mouseCall() { processEvents(); - Common::Point pos = _mouse; + Common::EventManager *eventMan = _system->getEventManager(); + Common::Point pos = eventMan->getMousePos(); if (pos.x > 298) pos.x = 298; if (pos.x < 15) @@ -273,7 +251,7 @@ void DreamWebEngine::mouseCall() { pos.y = 184; _context.cx = pos.x; _context.dx = pos.y; - _context.bx = _mouseState; + _context.bx = eventMan->getButtonState(); } void DreamWebEngine::setGraphicsMode() { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 455791d2c3..f459d8bcf9 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -105,8 +105,6 @@ private: const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; - Common::Point _mouse; - unsigned _mouseState; Common::File _file; Common::OutSaveFile *_outSaveFile; -- cgit v1.2.3 From 39d8f43bf3371f6617b831a98c9947a0d6b1a55a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 23:08:19 +0400 Subject: DREAMWEB: hopefully fixed OF value --- engines/dreamweb/runtime.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 573179d2a1..adbf333bd6 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -171,8 +171,8 @@ struct Flags { inline bool c() const { return _c; } inline bool s() const { return _s; } - inline bool l() const { return _o; } - inline bool le() const { return _o || _z; } + inline bool l() const { return _o != _s; } + inline bool le() const { return _o != _s|| _z; } inline void update_zs(uint8 v) { _s = v & 0x80; @@ -184,12 +184,14 @@ struct Flags { _z = v == 0; } - inline void update_o(uint8 v, uint8 old) { - _o = (old & 0x80) != (v & 0x80); + inline void update_o(uint8 v, uint8 a, uint8 b) { + uint8 s1 = a & 0x80, s2 = b & 0x80; + _o = (s1 == s2) && (v & 0x80) != s1; } - inline void update_o(uint16 v, uint16 old) { - _o = (old & 0x8000) != (v & 0x8000); + inline void update_o(uint16 v, uint16 a, uint16 b) { + uint16 s1 = a & 0x8000, s2 = b & 0x8000; + _o = (s1 == s2) && (v & 0x8000) != s1; } }; @@ -274,7 +276,7 @@ public: inline void _add(uint8 &dst, uint8 src) { unsigned r = (unsigned)dst + src; - flags.update_o((uint8)r, dst); + flags.update_o((uint8)r, dst, src); flags._c = r >= 0x100; dst = r; flags.update_zs(dst); @@ -282,46 +284,46 @@ public: inline void _add(uint16 &dst, uint16 src) { unsigned r = (unsigned)dst + src; - flags.update_o((uint16)r, dst); + flags.update_o((uint16)r, dst, src); flags._c = r >= 0x10000; dst = r; flags.update_zs(dst); } inline void _sub(uint8 &dst, uint8 src) { - flags.update_o(uint8(dst - src), dst); + flags.update_o(uint8(dst - src), dst, (uint8)-src); flags._c = dst < src; dst -= src; flags.update_zs(dst); } inline void _sub(uint16 &dst, uint16 src) { - flags.update_o(uint16(dst - src), dst); + flags.update_o(uint16(dst - src), dst, (uint16)-src); flags._c = dst < src; dst -= src; flags.update_zs(dst); } inline void _inc(uint8 &dst) { - flags.update_o((uint8)(dst + 1), dst); + flags.update_o((uint8)(dst + 1), dst, 1); ++dst; flags.update_zs(dst); } inline void _inc(uint16 &dst) { - flags.update_o((uint16)(dst + 1), dst); + flags.update_o((uint16)(dst + 1), dst, 1); ++dst; flags.update_zs(dst); } inline void _dec(uint8 &dst) { - flags.update_o(uint8(dst - 1), dst); + flags.update_o(uint8(dst - 1), dst, 1); --dst; flags.update_zs(dst); } inline void _dec(uint16 &dst) { - flags.update_o(uint16(dst - 1), dst); + flags.update_o(uint16(dst - 1), dst, 1); --dst; flags.update_zs(dst); } -- cgit v1.2.3 From 6deff847492e33bf270806cacb85ae4db3cc530c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 23:21:09 +0400 Subject: DREAMWEB: fixed crash on room changing --- engines/dreamweb/dreamgen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 01992eda6c..29b0955f07 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -17870,6 +17870,9 @@ norun: } void checkcoords(Context & context) { + context._cmp(context.data.byte(kNewlocation), 255); + if (context.flags.z()) goto loop048; + return; loop048: context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); -- cgit v1.2.3 From edf7d9b42bb4f88b8681e0d3732b4e2daad377c9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 23:50:19 +0400 Subject: DREAMWEB: unstubbed printundermon --- engines/dreamweb/dreamweb.cpp | 25 ++++++++++++++++++++++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 4fe9b41d97..6883580b74 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -312,6 +312,29 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int _system->copyRectToScreen(src, pitch, x, y, w, h); } +void DreamWebEngine::printUnderMonitor() { + _context.di = dreamgen::kScreenwidth * 43 + 76; + _context.si = _context.di + 8 * dreamgen::kScreenwidth; + _context.es = _context.data.word(dreamgen::kWorkspace); + + Graphics::Surface *s = _system->lockScreen(); + if (!s) + error("lockScreen failed"); + + for(uint y = 0; y < 104; ++y) { + uint8 *src = (uint8 *)s->getBasePtr(76 + 8, 43 + y); + uint8 *dst = _context.es.ptr(_context.di, 170); + for(uint x = 0; x < 170; ++x) { + if (*src < 231) + *dst++ = *src++; + } + _context._add(_context.di, dreamgen::kScreenwidth); + _context._add(_context.si, dreamgen::kScreenwidth); + } + _system->unlockScreen(); +} + + void DreamWebEngine::cls() { _system->fillScreen(0); } @@ -372,7 +395,7 @@ void worktoscreen(Context &context) { } void printundermon(Context &context) { - warning("printundermon: STUB"); + context.engine->printUnderMonitor(); } void cls(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index f459d8bcf9..33a88e0408 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -96,6 +96,7 @@ public: uint readFromSaveFile(uint8 *data, uint size); void setShakePos(int pos) { _system->setShakePos(pos); } + void printUnderMonitor(); void quit(); -- cgit v1.2.3 From 6fb25cdde4381233f3aa98f92f7dfa62aa10b2fa Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 12 Jun 2011 23:55:14 +0400 Subject: DREAMWEB: added stack depth check to code generator --- devtools/tasmrecover/tasm/cpp.py | 4 +- engines/dreamweb/dreamgen.cpp | 2876 +++++++++++++++++++++++--------------- 2 files changed, 1784 insertions(+), 1096 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 52f21bda33..9d42dd9cde 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -257,7 +257,7 @@ namespace %s { self.schedule(name) def _ret(self): - self.body += "\treturn;\n" + self.body += "\t{assert(stack_depth == context.stack.size()); return; }\n" def parse2(self, dst, src): dst_size, src_size = self.get_size(dst), self.get_size(src) @@ -437,7 +437,7 @@ namespace %s { self.proc_addr.append((name, self.proc.offset)) self.body = str() - self.body += "void %s(Context & context) {\n" %name; + self.body += "void %s(Context & context) {\n\tuint stack_depth = context.stack.size();\n" %name; self.proc.optimize() self.unbounded = [] self.proc.visit(self, skip) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 29b0955f07..de9a7c1c38 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -475,6 +475,7 @@ void intro3text(Context &context); void intro1text(Context &context); void alleybarksound(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._dec(context.ax); context._cmp(context.ax, 0); @@ -488,24 +489,27 @@ void alleybarksound(Context & context) { context.ax = 1000; nobark: context.es.word(context.bx+3) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void intromusic(Context & context) { - return; + uint stack_depth = context.stack.size(); + {assert(stack_depth == context.stack.size()); return; } } void foghornsound(Context & context) { + uint stack_depth = context.stack.size(); randomnumber(context); context._cmp(context.al, 198); if (!context.flags.z()) goto nofog; context.al = 13; playchannel1(context); nofog: - return; + {assert(stack_depth == context.stack.size()); return; } } void receptionist(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto gotrecep; context._cmp(context.data.byte(kCardpassflag), 1); @@ -544,10 +548,11 @@ gotrecep: if (context.flags.z()) goto nottalkedrecep; context.data.byte(kTalkedtorecep) = 1; nottalkedrecep: - return; + {assert(stack_depth == context.stack.size()); return; } } void smokebloke(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notspokento; context.al = context.es.byte(context.bx+7); @@ -579,10 +584,11 @@ notsmokeb2: gotsmokeb: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void attendant(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); context.al = context.es.byte(context.bx+7); @@ -590,28 +596,31 @@ void attendant(Context & context) { if (context.flags.z()) goto nottalked; context.data.byte(kTalkedtoattendant) = 1; nottalked: - return; + {assert(stack_depth == context.stack.size()); return; } } void manasleep(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void eden(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); notinbed: - return; + {assert(stack_depth == context.stack.size()); return; } } void edeninbath(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kGeneraldead), 0); if (context.flags.z()) goto notinbed; context._cmp(context.data.byte(kSartaindead), 0); @@ -619,35 +628,39 @@ void edeninbath(Context & context) { showgamereel(context); addtopeoplelist(context); notinbath: - return; + {assert(stack_depth == context.stack.size()); return; } /*continuing to unbounded code: notinbed from eden:5-6*/ notinbed: - return; - return; + {assert(stack_depth == context.stack.size()); return; } + {assert(stack_depth == context.stack.size()); return; } } void malefan(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void femalefan(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void louis(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); notlouis1: - return; + {assert(stack_depth == context.stack.size()); return; } } void louischair(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); @@ -672,31 +685,35 @@ notlouisanim: showgamereel(context); addtopeoplelist(context); notlouis2: - return; + {assert(stack_depth == context.stack.size()); return; } } void manasleep2(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void mansatstill(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void tattooman(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void drinker(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto gotdrinker; context._inc(context.es.word(context.bx+3)); @@ -714,10 +731,11 @@ notdrinker1: gotdrinker: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void bartender(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto gotsmoket; context._cmp(context.es.word(context.bx+3), 86); @@ -741,22 +759,25 @@ gotsmoket: context.es.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void othersmoker(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void barwoman(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void interviewer(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kReeltowatch), 68); if (!context.flags.z()) goto notgeneralstart; context._inc(context.es.word(context.bx+3)); @@ -770,10 +791,11 @@ notgeneralstart: context._inc(context.es.word(context.bx+3)); talking: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void soldier1(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.es.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; context.data.word(kWatchingtime) = 10; @@ -803,10 +825,11 @@ soldierwait: gotsoldframe: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void rockstar(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; @@ -844,20 +867,21 @@ rockspeed: addtopeoplelist(context); context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } notalkrock: context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } rockcombatend: context.data.byte(kNewlocation) = 45; showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void helicopter(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; @@ -904,17 +928,18 @@ helicombatend: if (context.flags.c()) goto notwaitingheli; context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } notwaitingheli: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } heliwon: context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void mugger(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; @@ -931,7 +956,7 @@ notmugger: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } endmugger1: context.push(context.es); context.push(context.bx); @@ -982,18 +1007,20 @@ endmugger1: context.data.byte(kBeenmugged) = 1; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } endmugger2: - return; + {assert(stack_depth == context.stack.size()); return; } } void aide(Context & context) { + uint stack_depth = context.stack.size(); showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void businessman(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; context.ax = context.es.word(context.bx+3); @@ -1073,16 +1100,17 @@ busspeed: if (!context.flags.z()) goto buscombatend; context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } buscombatend: - return; + {assert(stack_depth == context.stack.size()); return; } buscombatwonend: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void poolguard(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; @@ -1140,11 +1168,11 @@ guardspeed: if (context.flags.z()) goto iswaitingpool; context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } iswaitingpool: context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } combatover1: context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 0; @@ -1152,7 +1180,7 @@ combatover1: turnpathon(context); context.al = 1; turnpathoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } combatover2: showgamereel(context); context.data.word(kWatchingtime) = 2; @@ -1163,15 +1191,16 @@ combatover2: context.data.word(kWatchingtime) = 0; context.data.byte(kMandead) = 2; doneover2: - return; + {assert(stack_depth == context.stack.size()); return; } } void security(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.es.word(context.bx+3), 32); if (context.flags.z()) goto securwait; context._cmp(context.es.word(context.bx+3), 69); if (!context.flags.z()) goto notaftersec; - return; + {assert(stack_depth == context.stack.size()); return; } notaftersec: context.data.word(kWatchingtime) = 10; checkspeed(context); @@ -1191,10 +1220,11 @@ securwait: gotsecurframe: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void heavy(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; @@ -1226,10 +1256,11 @@ heavywait: gotheavyframe: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void bossman(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto notboss; context.ax = context.es.word(context.bx+3); @@ -1269,10 +1300,11 @@ notboss: if (context.flags.z()) goto nottalkedboss; context.data.byte(kTalkedtoboss) = 1; nottalkedboss: - return; + {assert(stack_depth == context.stack.size()); return; } } void gamer(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto gamerfin; gameragain: @@ -1288,29 +1320,32 @@ gameragain: gamerfin: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void sparkydrip(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto cantdrip; context.al = 14; context.ah = 0; playchannel0(context); cantdrip: - return; + {assert(stack_depth == context.stack.size()); return; } } void carparkdrip(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto cantdrip2; context.al = 14; playchannel1(context); cantdrip2: - return; + {assert(stack_depth == context.stack.size()); return; } } void keeper(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kKeeperflag), 0); if (!context.flags.z()) goto notwaiting; context._cmp(context.data.word(kReeltowatch), 190); @@ -1323,15 +1358,16 @@ void keeper(Context & context) { context.al = context.data.byte(kDreamnumber); context.es.byte(context.bx+7) = context.al; notdiff: - return; + {assert(stack_depth == context.stack.size()); return; } notwaiting: addtopeoplelist(context); showgamereel(context); waiting: - return; + {assert(stack_depth == context.stack.size()); return; } } void candles1(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto candle1; context.ax = context.es.word(context.bx+3); @@ -1343,10 +1379,11 @@ notendcandle1: context.es.word(context.bx+3) = context.ax; candle1: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void smallcandle(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto smallcandlef; context.ax = context.es.word(context.bx+3); @@ -1358,10 +1395,11 @@ notendsmallcandle: context.es.word(context.bx+3) = context.ax; smallcandlef: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intromagic1(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto introm1fin; context.ax = context.es.word(context.bx+3); @@ -1385,10 +1423,11 @@ gotintrom1: context.data.byte(kNowinnewroom) = 1; introm1fin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void candles(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto candlesfin; context.ax = context.es.word(context.bx+3); @@ -1400,10 +1439,11 @@ gotcandles: context.es.word(context.bx+3) = context.ax; candlesfin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void candles2(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto candles2fin; context.ax = context.es.word(context.bx+3); @@ -1415,10 +1455,11 @@ gotcandles2: context.es.word(context.bx+3) = context.ax; candles2fin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void gates(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto gatesfin; context.ax = context.es.word(context.bx+3); @@ -1451,10 +1492,11 @@ gotgates: context.es = context.pop(); gatesfin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intromagic2(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto introm2fin; context.ax = context.es.word(context.bx+3); @@ -1466,10 +1508,11 @@ gotintrom2: context.es.word(context.bx+3) = context.ax; introm2fin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intromagic3(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto introm3fin; context.ax = context.es.word(context.bx+3); @@ -1483,10 +1526,11 @@ introm3fin: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void intromonks1(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto intromonk1fin; context.ax = context.es.word(context.bx+3); @@ -1496,7 +1540,7 @@ void intromonks1(Context & context) { context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; @@ -1527,10 +1571,11 @@ intromonk1fin: showgamereel(context); context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void intromonks2(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto intromonk2fin; context.ax = context.es.word(context.bx+3); @@ -1579,14 +1624,16 @@ gotintromonk2: context.es.word(context.bx+3) = context.ax; intromonk2fin: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void handclap(Context & context) { - return; + uint stack_depth = context.stack.size(); + {assert(stack_depth == context.stack.size()); return; } } void monks2text(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; @@ -1677,16 +1724,17 @@ notmonk2text10: context.cx = 100; goto gotmonks2text; notmonk2text11: - return; + {assert(stack_depth == context.stack.size()); return; } gotmonks2text: context.dx = 1; context.cx = 120; context.ah = 82; setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intro1text(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kIntrocount), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; @@ -1711,16 +1759,17 @@ notintro1text2: context.cx = 90; goto gotintro1text; notintro1text3: - return; + {assert(stack_depth == context.stack.size()); return; } gotintro1text: context.dx = 1; context.ah = 82; oktalk2: setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intro2text(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ax, 5); if (!context.flags.z()) goto notintro2text1; context.al = 43; @@ -1737,15 +1786,16 @@ notintro2text1: context.cx = 90; goto gotintro2text; notintro2text2: - return; + {assert(stack_depth == context.stack.size()); return; } gotintro2text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intro3text(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ax, 107); if (!context.flags.z()) goto notintro3text1; context.al = 45; @@ -1762,15 +1812,16 @@ notintro3text1: context.cx = 100; goto gotintro3text; notintro3text2: - return; + {assert(stack_depth == context.stack.size()); return; } gotintro3text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void monkandryan(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto notmonkryan; context.ax = context.es.word(context.bx+3); @@ -1787,15 +1838,16 @@ void monkandryan(Context & context) { context._cmp(context.data.byte(kIntrocount), 57); if (!context.flags.z()) goto gotmonkryan; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } gotmonkryan: context.es.word(context.bx+3) = context.ax; notmonkryan: showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void endgameseq(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto notendseq; context.ax = context.es.word(context.bx+3); @@ -1849,10 +1901,11 @@ notendseq: context.es.word(context.bx+3) = 146; rollendcredits(context); notendcreds: - return; + {assert(stack_depth == context.stack.size()); return; } } void rollendcredits(Context & context) { + uint stack_depth = context.stack.size(); context.al = 16; context.ah = 255; playchannel0(context); @@ -1937,10 +1990,11 @@ gotnext: hangon(context); paneltomap(context); fadescreenuphalf(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void priest(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; context.data.byte(kPointermode) = 0; @@ -1954,12 +2008,13 @@ void priest(Context & context) { context.bx = context.pop(); context.es = context.pop(); priestwait: - return; + {assert(stack_depth == context.stack.size()); return; } priestspoken: - return; + {assert(stack_depth == context.stack.size()); return; } } void madmanstelly(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 307); @@ -1968,10 +2023,11 @@ void madmanstelly(Context & context) { notendtelly: context.es.word(context.bx+3) = context.ax; showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void madman(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; @@ -2023,7 +2079,7 @@ nomadspeed: context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; madmode(context); - return; + {assert(stack_depth == context.stack.size()); return; } madmanspoken: context._cmp(context.data.byte(kWongame), 1); if (context.flags.z()) goto alreadywon; @@ -2034,14 +2090,15 @@ madmanspoken: context.bx = context.pop(); context.es = context.pop(); alreadywon: - return; + {assert(stack_depth == context.stack.size()); return; } ryansded: context.data.byte(kMandead) = 2; showgamereel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void madmantext(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCombatcount), 61); if (!context.flags.c()) goto nomadtext; context.al = context.data.byte(kCombatcount); @@ -2058,10 +2115,11 @@ void madmantext(Context & context) { context.ah = 82; setuptimedtemp(context); nomadtext: - return; + {assert(stack_depth == context.stack.size()); return; } } void madmode(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; context._cmp(context.data.byte(kCombatcount), 63); @@ -2070,10 +2128,11 @@ void madmode(Context & context) { if (!context.flags.c()) goto iswatchmad; context.data.byte(kPointermode) = 2; iswatchmad: - return; + {assert(stack_depth == context.stack.size()); return; } } void priesttext(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.es.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; context._cmp(context.es.word(context.bx+3), 7); @@ -2090,10 +2149,11 @@ void priesttext(Context & context) { context.dx = 1; setuptimeduse(context); nopriesttext: - return; + {assert(stack_depth == context.stack.size()); return; } } void textforend(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kIntrocount), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; @@ -2118,15 +2178,16 @@ notendtext2: context.cx = 60; goto gotendtext; notendtext3: - return; + {assert(stack_depth == context.stack.size()); return; } gotendtext: context.dx = 1; context.ah = 83; setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void textformonk(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; @@ -2235,16 +2296,17 @@ notmonktext13: if (!context.flags.z()) goto notendtitles; fadescreendowns(context); notendtitles: - return; + {assert(stack_depth == context.stack.size()); return; } gotmonktext: context.dx = 1; context.ah = 82; oktalk: setuptimedtemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void drunk(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto trampgone; context.al = context.es.byte(context.bx+7); @@ -2253,10 +2315,11 @@ void drunk(Context & context) { showgamereel(context); addtopeoplelist(context); trampgone: - return; + {assert(stack_depth == context.stack.size()); return; } } void advisor(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; @@ -2281,10 +2344,11 @@ gotadvframe: noadvisor: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void copper(Context & context) { + uint stack_depth = context.stack.size(); checkspeed(context); if (!context.flags.z()) goto nocopper; context.ax = context.es.word(context.bx+3); @@ -2311,10 +2375,11 @@ gotcopframe: nocopper: showgamereel(context); addtopeoplelist(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void sparky(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto animsparky; context.es.byte(context.bx+7) = 3; @@ -2344,11 +2409,12 @@ finishsparky: if (context.flags.z()) goto nottalkedsparky; context.data.byte(kTalkedtosparky) = 1; nottalkedsparky: - return; + {assert(stack_depth == context.stack.size()); return; } } void train(Context & context) { - return; + uint stack_depth = context.stack.size(); + {assert(stack_depth == context.stack.size()); return; } context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 21); if (!context.flags.c()) goto notrainyet; @@ -2367,10 +2433,11 @@ gottrainframe: context.es.word(context.bx+3) = context.ax; showgamereel(context); notrainatall: - return; + {assert(stack_depth == context.stack.size()); return; } } void addtopeoplelist(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.push(context.bx); @@ -2385,10 +2452,11 @@ void addtopeoplelist(Context & context) { context.bx = context.pop(); context.es = context.pop(); context._add(context.data.word(kListpos), 5); - return; + {assert(stack_depth == context.stack.size()); return; } } void showgamereel(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; @@ -2401,10 +2469,11 @@ void showgamereel(Context & context) { context.ax = context.data.word(kReelpointer); context.es.word(context.bx+3) = context.ax; noshow: - return; + {assert(stack_depth == context.stack.size()); return; } } void checkspeed(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLastweapon), -1); if (!context.flags.z()) goto forcenext; context._inc(context.es.byte(context.bx+6)); @@ -2415,22 +2484,24 @@ void checkspeed(Context & context) { context.es.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); notspeed: - return; + {assert(stack_depth == context.stack.size()); return; } forcenext: context._cmp(context.al, context.al); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearsprites(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; while(context.cx--) context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void makesprite(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: @@ -2446,18 +2517,20 @@ _tmp17a: context.es.word(context.bx+2) = 0x0ffff; context.es.byte(context.bx+15) = 0; context.es.byte(context.bx+18) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void delsprite(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.bx; context.cx = (32); context.al = 255; while(context.cx--) context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void spriteupdate(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = context.data.byte(kRyanon); @@ -2486,10 +2559,11 @@ _tmp18a: context._add(context.bx, (32)); if (--context.cx) goto _tmp18; _tmp18b: - return; + {assert(stack_depth == context.stack.size()); return; } } void printsprites(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.cx = 0; priorityloop: @@ -2518,10 +2592,11 @@ skipsprite: context._inc(context.cx); context._cmp(context.cx, 7); if (!context.flags.z()) goto priorityloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void printasprite(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.si = context.bx; @@ -2554,10 +2629,11 @@ notquickp: showframe(context); context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkone(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); context.al = context.ch; context.ah = 0; @@ -2589,29 +2665,31 @@ void checkone(Context & context) { context.cx = context.ax; context._lodsb(); context.dx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void findsource(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kCurrentframe); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; context.ds = context.data.word(kReel1); context.data.word(kTakeoff) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; context.ds = context.data.word(kReel2); context.data.word(kTakeoff) = 160; - return; + {assert(stack_depth == context.stack.size()); return; } over1001: context.ds = context.data.word(kReel3); context.data.word(kTakeoff) = 320; - return; + {assert(stack_depth == context.stack.size()); return; } } void initman(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.si = context.ax; @@ -2622,10 +2700,11 @@ void initman(Context & context) { context.es.byte(context.bx+23) = 4; context.es.byte(context.bx+22) = 0; context.es.byte(context.bx+29) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void mainman(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kResetmanxy), 1); if (!context.flags.z()) goto notinnewroom; context.data.byte(kResetmanxy) = 0; @@ -2638,7 +2717,7 @@ notinnewroom: context._dec(context.es.byte(context.bx+22)); context._cmp(context.es.byte(context.bx+22), -1); if (context.flags.z()) goto executewalk; - return; + {assert(stack_depth == context.stack.size()); return; } executewalk: context.es.byte(context.bx+22) = 0; context.al = context.data.byte(kTurntoface); @@ -2705,10 +2784,11 @@ notwalk: context.ax = context.es.word(context.bx+10); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - return; + {assert(stack_depth == context.stack.size()); return; } } void aboutturn(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kTurndirection), 1); if (context.flags.z()) goto incdir; context._cmp(context.data.byte(kTurndirection), -1); @@ -2731,7 +2811,7 @@ incdir: context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } decdir: context.data.byte(kTurndirection) = -1; context.al = context.data.byte(kFacing); @@ -2739,10 +2819,11 @@ decdir: context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void walking(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalwalk; context.al = context.data.byte(kLinepointer); @@ -2771,7 +2852,7 @@ continuewalk: context.es = context.pop(); stillline: context.es.word(context.bx+10) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } endofline: context.data.byte(kLinepointer) = 254; context.al = context.data.byte(kDestination); @@ -2785,13 +2866,14 @@ endofline: autosetwalk(context); context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } finishedwalk: facerightway(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void facerightway(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); getroomspaths(context); @@ -2806,10 +2888,11 @@ void facerightway(Context & context) { context.data.byte(kLeavedirection) = context.al; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkforexit(Context & context) { + uint stack_depth = context.stack.size(); context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); context.ch = context.data.byte(kRyany); @@ -2824,7 +2907,7 @@ void checkforexit(Context & context) { if (context.flags.z()) goto notnewdirect; context.al = context.data.byte(kLastflagex); context.data.byte(kAutolocation) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; @@ -2871,37 +2954,38 @@ notravmessage: context.data.byte(kTurntoface) = context.al; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } notlouis: context.bx = context.pop(); context.es = context.pop(); context.data.byte(kNeedtotravel) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notleave: context._test(context.al, 4); if (context.flags.z()) goto notaleft; adjustleft(context); - return; + {assert(stack_depth == context.stack.size()); return; } notaleft: context._test(context.al, 2); if (context.flags.z()) goto notaright; adjustright(context); - return; + {assert(stack_depth == context.stack.size()); return; } notaright: context._test(context.al, 8); if (context.flags.z()) goto notadown; adjustdown(context); - return; + {assert(stack_depth == context.stack.size()); return; } notadown: context._test(context.al, 16); if (context.flags.z()) goto notanup; adjustup(context); - return; + {assert(stack_depth == context.stack.size()); return; } notanup: - return; + {assert(stack_depth == context.stack.size()); return; } } void adjustdown(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context._add(context.data.byte(kMapy), 10); @@ -2912,10 +2996,11 @@ void adjustdown(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void adjustup(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context._sub(context.data.byte(kMapy), 10); @@ -2926,10 +3011,11 @@ void adjustup(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void adjustleft(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.data.byte(kLastflag) = 0; @@ -2941,10 +3027,11 @@ void adjustleft(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void adjustright(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context._add(context.data.byte(kMapx), 11); @@ -2956,10 +3043,11 @@ void adjustright(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void reminders(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedenslift; context._cmp(context.data.byte(kMapx), 44); @@ -2994,7 +3082,7 @@ void reminders(Context & context) { havegotcard: context._inc(context.data.byte(kProgresspoints)); notfirst: - return; + {assert(stack_depth == context.stack.size()); return; } forgotone: context.al = 50; context.bl = 54; @@ -3002,12 +3090,13 @@ forgotone: context.cx = 48; context.dx = 8; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notinedenslift: - return; + {assert(stack_depth == context.stack.size()); return; } } void initrain(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)); context.bx = 1113; @@ -3063,10 +3152,11 @@ initrainside2: finishinitrain: context.al = 255; context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void splitintolines(Context & context) { + uint stack_depth = context.stack.size(); lookforlinestart: getblockofpixel(context); context._cmp(context.al, 0); @@ -3112,10 +3202,11 @@ foundlineend: if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: - return; + {assert(stack_depth == context.stack.size()); return; } } void getblockofpixel(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); context.push(context.es); context.push(context.di); @@ -3129,16 +3220,17 @@ void getblockofpixel(Context & context) { context.di = context.pop(); context.es = context.pop(); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } failrain: context.di = context.pop(); context.es = context.pop(); context.cx = context.pop(); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void showrain(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kMainsprites); context.si = 6*58; context.ax = context.ds.word(context.si+2); @@ -3212,10 +3304,11 @@ notlouisthund: isthunder1: playchannel1(context); nothunder: - return; + {assert(stack_depth == context.stack.size()); return; } } void backobject(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kSetdat); context.di = context.es.word(context.bx+20); context.al = context.es.byte(context.bx+18); @@ -3260,10 +3353,11 @@ notdoor: steadyob: steady(context); finishback: - return; + {assert(stack_depth == context.stack.size()); return; } } void liftsprite(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kLiftflag); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; @@ -3284,7 +3378,7 @@ void liftsprite(Context & context) { goto pokelift; finishclose: context.data.byte(kLiftflag) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } openlift: context.al = context.es.byte(context.bx+19); context._cmp(context.al, 12); @@ -3305,10 +3399,10 @@ pokelift: context.di = context.pop(); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } endoflist: context.data.byte(kLiftflag) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } liftopen: context.al = context.data.byte(kLiftpath); context.push(context.es); @@ -3344,19 +3438,21 @@ nocountopen: } void liftnoise(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 5); if (context.flags.z()) goto hissnoise; context._cmp(context.data.byte(kReallocation), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); - return; + {assert(stack_depth == context.stack.size()); return; } hissnoise: context.al = 13; playchannel1(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void random(Context & context) { + uint stack_depth = context.stack.size(); randomnum1(context); context.push(context.di); context._and(context.ax, 7); @@ -3365,17 +3461,19 @@ void random(Context & context) { context.al = context.ds.byte(context.di); context.di = context.pop(); context.es.byte(context.bx+15) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void steady(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; context.es.byte(context.bx+15) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void constant(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.es.byte(context.bx+19)); context.cl = context.es.byte(context.bx+19); context.ch = 0; @@ -3390,28 +3488,31 @@ gotconst: context._sub(context.di, context.cx); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void doorway(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 10; context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 10; dodoor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void widedoor(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 24; context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 24; dodoor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dodoor(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); @@ -3470,7 +3571,7 @@ atlast1: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context.data.byte(kThroughdoor) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } shutdoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); @@ -3498,10 +3599,11 @@ atlast2: if (!context.flags.z()) goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void lockeddoorway(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); @@ -3574,7 +3676,7 @@ atlast3: if (!context.flags.z()) goto justshutting; context.data.byte(kThroughdoor) = 1; justshutting: - return; + {assert(stack_depth == context.stack.size()); return; } shutdoor2: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); @@ -3605,7 +3707,7 @@ atlast4: context.es = context.pop(); context.data.byte(kLockstatus) = 1; notlocky: - return; + {assert(stack_depth == context.stack.size()); return; } /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: context.cl = context.es.byte(context.bx+19); @@ -3634,11 +3736,12 @@ atlast2: if (!context.flags.z()) goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: - return; - return; + {assert(stack_depth == context.stack.size()); return; } + {assert(stack_depth == context.stack.size()); return; } } void updatepeople(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.data.word(kListpos) = context.di; @@ -3669,10 +3772,11 @@ notinthisroom: context._add(context.di, 2); goto updateloop; endupdate: - return; + {assert(stack_depth == context.stack.size()); return; } } void getreelframeax(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ds); context.data.word(kCurrentframe) = context.ax; findsource(context); @@ -3685,19 +3789,21 @@ void getreelframeax(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.cx); context.bx = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void reelsonscreen(Context & context) { + uint stack_depth = context.stack.size(); reconstruct(context); updatepeople(context); watchreel(context); showrain(context); usetimedtext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void plotreel(Context & context) { + uint stack_depth = context.stack.size(); getreelstart(context); retryreel: context.push(context.es); @@ -3732,10 +3838,11 @@ notplot: soundonreels(context); context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void soundonreels(Context & context) { + uint stack_depth = context.stack.size(); context.bl = context.data.byte(kReallocation); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); @@ -3772,10 +3879,11 @@ endreelsound: if (context.flags.z()) goto nochange2; context.data.word(kLastsoundreel) = -1; nochange2: - return; + {assert(stack_depth == context.stack.size()); return; } } void reconstruct(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kHavedoneobs), 0); if (context.flags.z()) goto noneedtorecon; context.data.byte(kNewobs) = 1; @@ -3784,101 +3892,105 @@ void reconstruct(Context & context) { printsprites(context); context.data.byte(kHavedoneobs) = 0; noneedtorecon: - return; + {assert(stack_depth == context.stack.size()); return; } } void dealwithspecial(Context & context) { + uint stack_depth = context.stack.size(); context._sub(context.al, 220); context._cmp(context.al, 0); if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); context.data.byte(kHavedoneobs) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); context.data.byte(kHavedoneobs) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); context.data.byte(kHavedoneobs) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); context.data.byte(kHavedoneobs) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notremfree: context._cmp(context.al, 4); if (!context.flags.z()) goto notryanoff; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; context.data.byte(kTurntoface) = context.ah; context.data.byte(kFacing) = context.ah; switchryanon(context); - return; + {assert(stack_depth == context.stack.size()); return; } notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; context.data.byte(kNewlocation) = context.ah; - return; + {assert(stack_depth == context.stack.size()); return; } notchangeloc: movemap(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void movemap(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; context._sub(context.data.byte(kMapy), 20); context.data.byte(kNowinnewroom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; context._sub(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; context._add(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notmaprightspec: context._sub(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void getreelstart(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kReelpointer); context.cx = 40; context._mul(context.cx); context.es = context.data.word(kReels); context.si = context.ax; context._add(context.si, (0+(36*144))); - return; + {assert(stack_depth == context.stack.size()); return; } } void showreelframe(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.si+2); context.ah = 0; context.di = context.ax; @@ -3893,25 +4005,27 @@ void showreelframe(Context & context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 8; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void deleverything(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kMapysize); context.ah = 0; context._add(context.ax, context.data.word(kMapoffsety)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); - return; + {assert(stack_depth == context.stack.size()); return; } bigroom: context._sub(context.data.byte(kMapysize), 8); maptopanel(context); context._add(context.data.byte(kMapysize), 8); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpeverything(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); dumpevery1: @@ -3963,17 +4077,19 @@ dumpevery2: context._add(context.bx, 5); goto dumpevery2; finishevery2: - return; + {assert(stack_depth == context.stack.size()); return; } } void allocatework(Context & context) { + uint stack_depth = context.stack.size(); context.bx = 0x1000; allocatemem(context); context.data.word(kWorkspace) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void readabyte(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.si, 30000); if (!context.flags.z()) goto notendblock; context.push(context.bx); @@ -3990,10 +4106,11 @@ void readabyte(Context & context) { context.si = 0; notendblock: context._lodsb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadpalfromiff(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2481; openfile(context); context.cx = 2000; @@ -4025,10 +4142,11 @@ palloop: nought: context._stosb(); if (--context.cx) goto palloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void paneltomap(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4038,10 +4156,11 @@ void paneltomap(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiget(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void maptopanel(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4051,10 +4170,11 @@ void maptopanel(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiput(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpmap(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4062,10 +4182,11 @@ void dumpmap(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void pixelcheckset(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context._sub(context.al, context.es.byte(context.bx)); context._sub(context.ah, context.es.byte(context.bx+1)); @@ -4102,10 +4223,11 @@ void pixelcheckset(Context & context) { context.es = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - return; + {assert(stack_depth == context.stack.size()); return; } } void createpanel(Context & context) { + uint stack_depth = context.stack.size(); context.di = 0; context.bx = 8; context.ds = context.data.word(kIcons2); @@ -4130,10 +4252,11 @@ void createpanel(Context & context) { context.al = 0; context.ah = 2; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void createpanel2(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); context.di = 0; context.bx = 0; @@ -4147,10 +4270,11 @@ void createpanel2(Context & context) { context.al = 5; context.ah = 2; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearwork(Context & context) { + uint stack_depth = context.stack.size(); context.ax = 0x0; context.es = context.data.word(kWorkspace); context.di = 0; @@ -4189,22 +4313,23 @@ clearloop: context._stosw(); context._stosw(); if (--context.cx) goto clearloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void zoom(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto inwatching; context._cmp(context.data.byte(kZoomon), 1); if (context.flags.z()) goto zoomswitch; inwatching: - return; + {assert(stack_depth == context.stack.size()); return; } zoomswitch: context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); - return; + {assert(stack_depth == context.stack.size()); return; } zoomit: context.ax = context.data.word(kOldpointery); context._sub(context.ax, 9); @@ -4236,10 +4361,11 @@ zoomloop2: if (--context.cx) goto zoomloop; crosshair(context); context.data.byte(kDidzoom) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void delthisone(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.al = context.ah; @@ -4279,10 +4405,11 @@ deloneloop: context._add(context.si, context.dx); context._dec(context.ch); if (!context.flags.z()) goto deloneloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void width160(Context & context) { + uint stack_depth = context.stack.size(); context._movsw(); context._movsw(); context._movsw(); @@ -4512,10 +4639,11 @@ void width160(Context & context) { width1: context._movsw(); width0: - return; + {assert(stack_depth == context.stack.size()); return; } } void doblocks(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kWorkspace); context.ax = context.data.word(kMapady); context.cx = (320); @@ -4627,10 +4755,11 @@ zeroblock: context.di = context.pop(); context._add(context.di, (320)*16); if (--context.cx) goto loop120; - return; + {assert(stack_depth == context.stack.size()); return; } } void showframe(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.push(context.ax); context.cx = context.ax; @@ -4642,7 +4771,7 @@ void showframe(Context & context) { context._cmp(context.ds.word(context.si), 0); if (!context.flags.z()) goto notblankshow; context.cx = 0; - return; + {assert(stack_depth == context.stack.size()); return; } notblankshow: context._test(context.ah, 128); if (!context.flags.z()) goto skipoffsets; @@ -4679,7 +4808,7 @@ notcentred: context.push(context.cx); frameoutfx(context); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } notdiffdest: context._test(context.ah, 8); if (context.flags.z()) goto notprintlist; @@ -4699,7 +4828,7 @@ notprintlist: context.push(context.cx); frameoutfx(context); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; @@ -4708,7 +4837,7 @@ notflippedx: context.push(context.cx); frameoutnm(context); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; @@ -4717,17 +4846,18 @@ notnomask: context.push(context.cx); frameoutbh(context); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } noeffects: context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutv(context); context.cx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void frameoutv(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4752,7 +4882,7 @@ backtoother: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloop1; - return; + {assert(stack_depth == context.stack.size()); return; } frameloop3: context._lodsb(); context._cmp(context.al, 0); @@ -4764,10 +4894,11 @@ backtosolid: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloop1; - return; + {assert(stack_depth == context.stack.size()); return; } } void frameoutbh(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4797,10 +4928,11 @@ nextline: context.cx = context.pop(); context._dec(context.ch); if (!context.flags.z()) goto bhloop2; - return; + {assert(stack_depth == context.stack.size()); return; } } void frameoutfx(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4825,7 +4957,7 @@ backtootherfx: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; - return; + {assert(stack_depth == context.stack.size()); return; } frameloopfx3: context._lodsb(); context._cmp(context.al, 0); @@ -4838,10 +4970,11 @@ backtosolidfx: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; - return; + {assert(stack_depth == context.stack.size()); return; } } void transferinv(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kExframepos); context.push(context.di); context.al = context.data.byte(kExpos); @@ -4887,10 +5020,11 @@ void transferinv(Context & context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - return; + {assert(stack_depth == context.stack.size()); return; } } void transfermap(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kExframepos); context.push(context.di); context.al = context.data.byte(kExpos); @@ -4934,10 +5068,11 @@ void transfermap(Context & context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - return; + {assert(stack_depth == context.stack.size()); return; } } void dofade(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kFadedirection), 0); if (context.flags.z()) goto finishfade; context.cl = context.data.byte(kNumtofade); @@ -4957,36 +5092,40 @@ void dofade(Context & context) { if (!context.flags.z()) goto finishfade; fadecalculation(context); finishfade: - return; + {assert(stack_depth == context.stack.size()); return; } } void clearendpal(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; while(context.cx--) context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearpalette(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kFadedirection) = 0; clearstartpal(context); dumpcurrent(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreenup(Context & context) { + uint stack_depth = context.stack.size(); clearstartpal(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadetowhite(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; @@ -5002,10 +5141,11 @@ void fadetowhite(Context & context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadefromwhite(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768; @@ -5021,20 +5161,22 @@ void fadefromwhite(Context & context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreenups(Context & context) { + uint stack_depth = context.stack.size(); clearstartpal(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreendownhalf(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); paltoendpal(context); context.cx = 768; @@ -5060,40 +5202,44 @@ halfend: context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreenuphalf(Context & context) { + uint stack_depth = context.stack.size(); endpaltostart(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreendown(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); clearendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; + {assert(stack_depth == context.stack.size()); return; } } void fadescreendowns(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); clearendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - return; + {assert(stack_depth == context.stack.size()); return; } } void clearstartpal(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 256; @@ -5103,10 +5249,11 @@ wholeloop1: context.al = 0; context._stosb(); if (--context.cx) goto wholeloop1; - return; + {assert(stack_depth == context.stack.size()); return; } } void showgun(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kAddtored) = 0; context.data.byte(kAddtogreen) = 0; context.data.byte(kAddtoblue) = 0; @@ -5157,15 +5304,17 @@ void showgun(Context & context) { loadtemptext(context); rollendcredits2(context); getridoftemptext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void rollendcredits2(Context & context) { + uint stack_depth = context.stack.size(); rollem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void rollem(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 160; context.ch = 160; context.di = 25; @@ -5246,14 +5395,15 @@ gotnext2: if (--context.cx) goto endcredits21; context.cx = 120; hangone(context); - return; + {assert(stack_depth == context.stack.size()); return; } endearly2: context.cx = context.pop(); endearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void fadecalculation(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kFadecount), 0); if (context.flags.z()) goto nomorefading; context.bl = context.data.byte(kFadecount); @@ -5280,13 +5430,14 @@ gotthere: context._inc(context.di); if (--context.cx) goto fadecolloop; context._dec(context.data.byte(kFadecount)); - return; + {assert(stack_depth == context.stack.size()); return; } nomorefading: context.data.byte(kFadedirection) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void greyscalesum(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); @@ -5338,50 +5489,55 @@ noaddb: context._add(context.si, 3); context.cx = context.pop(); if (--context.cx) goto greysumloop1; - return; + {assert(stack_depth == context.stack.size()); return; } } void paltostartpal(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void endpaltostart(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void startpaltoend(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void paltoendpal(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(context.cx--) context._movsw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void allpalette(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); @@ -5389,10 +5545,11 @@ void allpalette(Context & context) { context.cx = 768/2; while(context.cx--) context._movsw(); dumpcurrent(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpcurrent(Context & context) { + uint stack_depth = context.stack.size(); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.ds = context.data.word(kBuffers); vsync(context); @@ -5403,10 +5560,11 @@ void dumpcurrent(Context & context) { context.al = 128; context.cx = 128; showgroup(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fadedownmon(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5423,10 +5581,11 @@ void fadedownmon(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 64; hangon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fadeupmon(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5443,10 +5602,11 @@ void fadeupmon(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fadeupmonfirst(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5467,10 +5627,11 @@ void fadeupmonfirst(Context & context) { playchannel1(context); context.cx = 64; hangon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fadeupyellows(Context & context) { + uint stack_depth = context.stack.size(); paltoendpal(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); @@ -5486,10 +5647,11 @@ void fadeupyellows(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void initialmoncols(Context & context) { + uint stack_depth = context.stack.size(); paltostartpal(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); @@ -5504,17 +5666,19 @@ void initialmoncols(Context & context) { context.al = 230; context.cx = 18; showgroup(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void titles(Context & context) { + uint stack_depth = context.stack.size(); clearpalette(context); biblequote(context); intro(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void endgame(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2260; loadtemptext(context); monkspeaking(context); @@ -5524,10 +5688,11 @@ void endgame(Context & context) { context.data.byte(kVolumedirection) = 1; context.cx = 200; hangon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void monkspeaking(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kRoomssample) = 35; loadroomssample(context); context.dx = 2364; @@ -5582,20 +5747,22 @@ nextbit: context.cx = 300; hangon(context); getridoftemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showmonk(Context & context) { + uint stack_depth = context.stack.size(); context.al = 0; context.ah = 128; context.di = 160; context.bx = 72; context.ds = context.data.word(kTempgraphics); showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void gettingshot(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kNewlocation) = 55; clearpalette(context); loadintroroom(context); @@ -5604,16 +5771,18 @@ void gettingshot(Context & context) { context.data.byte(kVolumedirection) = -1; runendseq(context); clearbeforeload(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void credits(Context & context) { + uint stack_depth = context.stack.size(); clearpalette(context); realcredits(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void biblequote(Context & context) { + uint stack_depth = context.stack.size(); mode640x480(context); context.dx = 2377; showpcx(context); @@ -5633,10 +5802,11 @@ void biblequote(Context & context) { if (context.flags.z()) goto biblequotearly; cancelch0(context); biblequotearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void hangone(Context & context) { + uint stack_depth = context.stack.size(); hangonloope: context.push(context.cx); vsync(context); @@ -5645,10 +5815,11 @@ hangonloope: if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; hangonearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void intro(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2247; loadtemptext(context); loadpalfromiff(context); @@ -5688,10 +5859,11 @@ void intro(Context & context) { getridoftemptext(context); clearbeforeload(context); introearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void runintroseq(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kGetback) = 0; moreintroseq: vsync(context); @@ -5716,14 +5888,15 @@ moreintroseq: if (context.flags.z()) goto earlyendrun; context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreintroseq; - return; + {assert(stack_depth == context.stack.size()); return; } earlyendrun: getridoftemptext(context); clearbeforeload(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void runendseq(Context & context) { + uint stack_depth = context.stack.size(); atmospheres(context); context.data.byte(kGetback) = 0; moreendseq: @@ -5741,10 +5914,11 @@ moreendseq: vsync(context); context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreendseq; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadintroroom(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kIntrocount) = 0; context.data.byte(kLocation) = 255; loadroom(context); @@ -5761,10 +5935,11 @@ void loadintroroom(Context & context) { spriteupdate(context); printsprites(context); worktoscreen(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void realcredits(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kRoomssample) = 33; loadroomssample(context); context.data.byte(kVolume) = 0; @@ -5884,10 +6059,11 @@ void realcredits(Context & context) { context.cx = 256; hangone(context); realcreditsearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void printchar(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.al, 255); if (context.flags.z()) goto ignoreit; context.push(context.si); @@ -5911,15 +6087,16 @@ nokern: context._add(context.di, context.cx); context.cx = context.pop(); ignoreit: - return; + {assert(stack_depth == context.stack.size()); return; } } void kernchars(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.al, 'a'); if (context.flags.z()) goto iskern; context._cmp(context.al, 'u'); if (context.flags.z()) goto iskern; - return; + {assert(stack_depth == context.stack.size()); return; } iskern: context._cmp(context.ah, 'n'); if (context.flags.z()) goto kernit; @@ -5931,13 +6108,14 @@ iskern: if (context.flags.z()) goto kernit; context._cmp(context.ah, 'l'); if (context.flags.z()) goto kernit; - return; + {assert(stack_depth == context.stack.size()); return; } kernit: context._dec(context.cl); - return; + {assert(stack_depth == context.stack.size()); return; } } void printslow(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kPointerframe) = 1; context.data.byte(kPointermode) = 3; context.ds = context.data.word(kCharset1); @@ -6017,7 +6195,7 @@ finishslow: context.di = context.pop(); context.bx = context.pop(); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } finishslow2: context.es = context.pop(); context.si = context.pop(); @@ -6026,10 +6204,11 @@ finishslow2: context.di = context.pop(); context.bx = context.pop(); context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void waitframes(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.di); context.push(context.bx); context.push(context.es); @@ -6046,10 +6225,11 @@ void waitframes(Context & context) { context.es = context.pop(); context.bx = context.pop(); context.di = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void printboth(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.cx); context.push(context.bx); @@ -6063,10 +6243,11 @@ void printboth(Context & context) { context.bx = context.pop(); context.cx = context.pop(); context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void printdirect(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kLastxpos) = context.di; context.ds = context.data.word(kCurrentset); printloop6: @@ -6098,10 +6279,11 @@ finishdirct: context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void monprint(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kKerning) = 1; context.si = context.bx; context.dl = 166; @@ -6176,10 +6358,11 @@ nottrigger2: scrollmonitor(context); context.bx = context.si; context.data.byte(kKerning) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void getnumber(Context & context) { + uint stack_depth = context.stack.size(); context.cx = 0; context.push(context.si); context.push(context.bx); @@ -6228,7 +6411,7 @@ gotoverend: context.si = context.pop(); context._add(context.di, context.ax); context.cl = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } notcentre: context.es = context.pop(); context.ds = context.pop(); @@ -6236,7 +6419,7 @@ notcentre: context.bx = context.pop(); context.si = context.pop(); context.cl = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } endoftext: context.al = context.cl; context.ah = 0; @@ -6271,7 +6454,7 @@ gotoverend2: context.si = context.pop(); context._add(context.di, context.ax); context.cl = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } notcent2: context.es = context.pop(); context.ds = context.pop(); @@ -6279,10 +6462,11 @@ notcent2: context.bx = context.pop(); context.si = context.pop(); context.cl = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } } void getnextword(Context & context) { + uint stack_depth = context.stack.size(); context.bx = 0; getloop: context.ax = context.es.word(context.di); @@ -6312,14 +6496,15 @@ getloop: endword: context._add(context.bl, 6); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } endall: context._add(context.bl, 6); context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void fillryan(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32); findallryan(context); @@ -6359,10 +6544,11 @@ ryanloop1: context._add(context.bx, (44)); if (--context.cx) goto ryanloop2; showryanpage(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void fillopen(Context & context) { + uint stack_depth = context.stack.size(); deltextline(context); getopenedsize(context); context._cmp(context.ah, 4); @@ -6400,10 +6586,11 @@ nextopenslot: context._cmp(context.cl, 5); if (!context.flags.z()) goto openloop1; undertextline(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void findallryan(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.di); context.cx = 30; context.ax = 0x0ffff; @@ -6432,10 +6619,11 @@ notinryaninv: context._inc(context.ch); context._cmp(context.ch, (114)); if (!context.flags.z()) goto findryanloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void findallopen(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.di); context.cx = 16; context.ax = 0x0ffff; @@ -6497,10 +6685,11 @@ findopen2a: context._inc(context.ch); context._cmp(context.ch, 80); if (!context.flags.z()) goto findopen1a; - return; + {assert(stack_depth == context.stack.size()); return; } } void obtoinv(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.bx); context.push(context.es); context.push(context.si); @@ -6554,26 +6743,29 @@ finishfill: context.si = context.pop(); context.es = context.pop(); context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void isitworn(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) goto notworn; context.al = context.es.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); notworn: - return; + {assert(stack_depth == context.stack.size()); return; } } void makeworn(Context & context) { + uint stack_depth = context.stack.size(); context.es.byte(context.bx+12) = 'W'-'A'; context.es.byte(context.bx+13) = 'E'-'A'; - return; + {assert(stack_depth == context.stack.size()); return; } } void examineob(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kPointermode) = 0; context.data.word(kTimecount) = 0; examineagain: @@ -6631,14 +6823,15 @@ iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void makemainscreen(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); context.data.byte(kNewobs) = 1; drawfloor(context); @@ -6653,20 +6846,22 @@ void makemainscreen(Context & context) { worktoscreenm(context); context.data.byte(kCommandtype) = 200; context.data.byte(kManisoffscreen) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void getbackfromob(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPickup), 1); if (!context.flags.z()) goto notheldob; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } notheldob: getback1(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void incryanpage(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyincryan; context.data.byte(kCommandtype) = 222; @@ -6679,7 +6874,7 @@ alreadyincryan: context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: - return; + {assert(stack_depth == context.stack.size()); return; } doincryan: context.ax = context.data.word(kMousex); context._sub(context.ax, (80)+167); @@ -6694,10 +6889,11 @@ findnewpage: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void openinv(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kInvopen) = 1; context.al = 61; context.di = (80); @@ -6706,10 +6902,11 @@ void openinv(Context & context) { printmessage(context); fillryan(context); context.data.byte(kCommandtype) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void showryanpage(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kIcons1); context.di = (80)+167; context.bx = (58)-12; @@ -6730,10 +6927,11 @@ void showryanpage(Context & context) { context.ax = context.pop(); context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void openob(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kOpenedob); context.ah = context.data.byte(kOpenedtype); context.di = 5674; @@ -6761,10 +6959,11 @@ void openob(Context & context) { context._add(context.ax, (80)); context.bx = 2588; context.cs.word(context.bx) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void obicons(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); @@ -6782,20 +6981,22 @@ cantopenit: context.al = 1; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void examicon(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kIcons2); context.di = 254; context.bx = 5; context.al = 3; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void obpicture(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context._cmp(context.ah, 1); @@ -6811,9 +7012,9 @@ void obpicture(Context & context) { context._inc(context.al); context.ah = 128; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } setframe: - return; + {assert(stack_depth == context.stack.size()); return; } exframe: context.ds = context.data.word(kExtras); context.di = 160; @@ -6824,10 +7025,11 @@ exframe: context._inc(context.al); context.ah = 128; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void describeob(Context & context) { + uint stack_depth = context.stack.size(); getobtextstart(context); context.di = 33; context.bx = 92; @@ -6845,10 +7047,11 @@ void describeob(Context & context) { obsthatdothings(context); context.bx = context.pop(); additionaltext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void additionaltext(Context & context) { + uint stack_depth = context.stack.size(); context._add(context.bx, 10); context.push(context.bx); context.al = context.data.byte(kCommand); @@ -6868,7 +7071,7 @@ void additionaltext(Context & context) { compare(context); if (context.flags.z()) goto fullcup; context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } emptycup: context.al = 40; findpuztext(context); @@ -6877,7 +7080,7 @@ emptycup: context.dl = 241; context.ah = 0; printdirect(context); - return; + {assert(stack_depth == context.stack.size()); return; } fullcup: context.al = 39; findpuztext(context); @@ -6886,10 +7089,11 @@ fullcup: context.dl = 241; context.ah = 0; printdirect(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void obsthatdothings(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context.cl = 'M'; @@ -6906,12 +7110,13 @@ void obsthatdothings(Context & context) { setlocation(context); lookatcard(context); seencard: - return; + {assert(stack_depth == context.stack.size()); return; } notlouiscard: - return; + {assert(stack_depth == context.stack.size()); return; } } void getobtextstart(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kFreedesc); context.si = (0); context.cx = (0+(82*2)); @@ -6947,14 +7152,15 @@ tryagain: context._cmp(context.al, ':'); if (context.flags.z()) goto findsometext; cantmakeoneup: - return; + {assert(stack_depth == context.stack.size()); return; } findsometext: searchforsame(context); goto tryagain; - return; + {assert(stack_depth == context.stack.size()); return; } } void searchforsame(Context & context) { + uint stack_depth = context.stack.size(); context.si = context.cx; searchagain: context._inc(context.si); @@ -6968,7 +7174,7 @@ search: if (context.flags.c()) goto search; context.si = context.bx; context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } gotstartletter: context.push(context.bx); context.push(context.si); @@ -6989,10 +7195,11 @@ keepchecking: foundmatch: context.si = context.pop(); context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void findnextcolon(Context & context) { + uint stack_depth = context.stack.size(); isntcolon: context.al = context.es.byte(context.si); context._inc(context.si); @@ -7001,17 +7208,18 @@ isntcolon: context._cmp(context.al, ':'); if (!context.flags.z()) goto isntcolon; endofcolon: - return; + {assert(stack_depth == context.stack.size()); return; } } void inventory(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto iswatchinv; context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } notwatchinv: context._cmp(context.data.byte(kCommandtype), 239); if (context.flags.z()) goto alreadyopinv; @@ -7025,7 +7233,7 @@ alreadyopinv: context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: - return; + {assert(stack_depth == context.stack.size()); return; } doopeninv: context.data.word(kTimecount) = 0; context.data.byte(kPointermode) = 0; @@ -7102,19 +7310,20 @@ iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } examlist: invlist1: openchangesize: withlist1: - return; + {assert(stack_depth == context.stack.size()); return; } } void setpickup(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto cantpick; context._cmp(context.data.byte(kObjecttype), 3); @@ -7125,7 +7334,7 @@ void setpickup(Context & context) { if (!context.flags.z()) goto canpick; cantpick: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canpick: context._cmp(context.data.byte(kCommandtype), 209); if (context.flags.z()) goto alreadysp; @@ -7141,7 +7350,7 @@ alreadysp: context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto dosetpick; nosetpick: - return; + {assert(stack_depth == context.stack.size()); return; } dosetpick: createpanel(context); showpanel(context); @@ -7163,17 +7372,18 @@ dosetpick: context.es.byte(context.bx+3) = 255; openinv(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } pickupexob: context.al = context.data.byte(kCommand); context.data.byte(kItemframe) = context.al; context.data.byte(kOpenedob) = 255; openinv(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void examinventory(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadyexinv; context.data.byte(kCommandtype) = 249; @@ -7183,7 +7393,7 @@ alreadyexinv: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; - return; + {assert(stack_depth == context.stack.size()); return; } doexinv: createpanel(context); showpanel(context); @@ -7194,31 +7404,34 @@ doexinv: context.data.byte(kInvopen) = 2; openinv(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void reexfrominv(Context & context) { + uint stack_depth = context.stack.size(); findinvpos(context); context.ax = context.es.word(context.bx); context.data.byte(kCommandtype) = context.ah; context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void reexfromopen(Context & context) { - return; + uint stack_depth = context.stack.size(); + {assert(stack_depth == context.stack.size()); return; } findopenpos(context); context.ax = context.es.word(context.bx); context.data.byte(kCommandtype) = context.ah; context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void swapwithinv(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); @@ -7238,7 +7451,7 @@ alreadyswap1: context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: - return; + {assert(stack_depth == context.stack.size()); return; } doswap1: context.ah = context.data.byte(kObjecttype); context.al = context.data.byte(kItemframe); @@ -7272,10 +7485,11 @@ doswap1: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void swapwithopen(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); @@ -7295,13 +7509,13 @@ alreadyswap2: context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; cantswap2: - return; + {assert(stack_depth == context.stack.size()); return; } doswap2: geteitherad(context); isitworn(context); if (!context.flags.z()) goto notwornswap; wornerror(context); - return; + {assert(stack_depth == context.stack.size()); return; } notwornswap: delpointer(context); context.al = context.data.byte(kItemframe); @@ -7311,12 +7525,12 @@ notwornswap: context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame2; errormessage1(context); - return; + {assert(stack_depth == context.stack.size()); return; } isntsame2: checkobjectsize(context); context._cmp(context.al, 0); if (context.flags.z()) goto sizeok2; - return; + {assert(stack_depth == context.stack.size()); return; } sizeok2: context.ah = context.data.byte(kObjecttype); context.al = context.data.byte(kItemframe); @@ -7366,21 +7580,22 @@ actuallyswap: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void intoinv(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout; outofinv(context); - return; + {assert(stack_depth == context.stack.size()); return; } notout: findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace1; swapwithinv(context); - return; + {assert(stack_depth == context.stack.size()); return; } canplace1: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -7401,7 +7616,7 @@ alreadyplce: context._and(context.ax, 1); if (!context.flags.z()) goto doplace; notletgo2: - return; + {assert(stack_depth == context.stack.size()); return; } doplace: delpointer(context); context.al = context.data.byte(kItemframe); @@ -7417,10 +7632,11 @@ doplace: outofinv(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void deletetaken(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kFreedat); context.ah = context.data.byte(kReallocation); context.ds = context.data.word(kExtras); @@ -7440,22 +7656,23 @@ takenloop: notinhere: context._add(context.si, 16); if (--context.cx) goto takenloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void outofinv(Context & context) { + uint stack_depth = context.stack.size(); findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick2; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canpick2: context.bx = context.data.word(kMousebutton); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); - return; + {assert(stack_depth == context.stack.size()); return; } canpick2a: context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub3; @@ -7474,7 +7691,7 @@ alreadygrab: context._and(context.ax, 1); if (!context.flags.z()) goto dograb; notletgo: - return; + {assert(stack_depth == context.stack.size()); return; } dograb: delpointer(context); context.data.byte(kPickup) = 1; @@ -7491,41 +7708,45 @@ dograb: intoinv(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getfreead(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; context.es = context.data.word(kFreedat); - return; + {assert(stack_depth == context.stack.size()); return; } } void getexad(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.bx = 16; context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kExtras); context._add(context.bx, (0+2080+30000)); - return; + {assert(stack_depth == context.stack.size()); return; } } void geteitherad(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isinexlist; context.al = context.data.byte(kItemframe); getfreead(context); - return; + {assert(stack_depth == context.stack.size()); return; } isinexlist: context.al = context.data.byte(kItemframe); getexad(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getanyad(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isex; context._cmp(context.data.byte(kObjecttype), 2); @@ -7533,35 +7754,37 @@ void getanyad(Context & context) { context.al = context.data.byte(kCommand); getsetad(context); context.ax = context.es.word(context.bx+4); - return; + {assert(stack_depth == context.stack.size()); return; } isfree: context.al = context.data.byte(kCommand); getfreead(context); context.ax = context.es.word(context.bx+7); - return; + {assert(stack_depth == context.stack.size()); return; } isex: context.al = context.data.byte(kCommand); getexad(context); context.ax = context.es.word(context.bx+7); - return; + {assert(stack_depth == context.stack.size()); return; } } void getanyaddir(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ah, 4); if (context.flags.z()) goto isex3; context._cmp(context.ah, 2); if (context.flags.z()) goto isfree3; getsetad(context); - return; + {assert(stack_depth == context.stack.size()); return; } isfree3: getfreead(context); - return; + {assert(stack_depth == context.stack.size()); return; } isex3: getexad(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getopenedsize(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kOpenedtype), 4); if (context.flags.z()) goto isex2; context._cmp(context.data.byte(kOpenedtype), 2); @@ -7569,29 +7792,31 @@ void getopenedsize(Context & context) { context.al = context.data.byte(kOpenedob); getsetad(context); context.ax = context.es.word(context.bx+3); - return; + {assert(stack_depth == context.stack.size()); return; } isfree2: context.al = context.data.byte(kOpenedob); getfreead(context); context.ax = context.es.word(context.bx+7); - return; + {assert(stack_depth == context.stack.size()); return; } isex2: context.al = context.data.byte(kOpenedob); getexad(context); context.ax = context.es.word(context.bx+7); - return; + {assert(stack_depth == context.stack.size()); return; } } void getsetad(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.bx = 64; context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kSetdat); - return; + {assert(stack_depth == context.stack.size()); return; } } void findinvpos(Context & context) { + uint stack_depth = context.stack.size(); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); context.bx = -1; @@ -7616,10 +7841,11 @@ findinv2: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10)+32)); - return; + {assert(stack_depth == context.stack.size()); return; } } void findopenpos(Context & context) { + uint stack_depth = context.stack.size(); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); context.bx = -1; @@ -7632,10 +7858,11 @@ findopenp1: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10))); - return; + {assert(stack_depth == context.stack.size()); return; } } void dropobject(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 223); if (context.flags.z()) goto alreadydrop; context.data.byte(kCommandtype) = 223; @@ -7652,13 +7879,13 @@ alreadydrop: context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; nodrop: - return; + {assert(stack_depth == context.stack.size()); return; } dodrop: geteitherad(context); isitworn(context); if (!context.flags.z()) goto nowornerror; wornerror(context); - return; + {assert(stack_depth == context.stack.size()); return; } nowornerror: context._cmp(context.data.byte(kReallocation), 47); if (context.flags.z()) goto nodrop2; @@ -7671,14 +7898,14 @@ nowornerror: if (context.flags.c()) goto nodroperror; nodrop2: droperror(context); - return; + {assert(stack_depth == context.stack.size()); return; } nodroperror: context._cmp(context.data.byte(kMapxsize), 64); if (!context.flags.z()) goto notinlift; context._cmp(context.data.byte(kMapysize), 64); if (!context.flags.z()) goto notinlift; droperror(context); - return; + {assert(stack_depth == context.stack.size()); return; } notinlift: context.al = context.data.byte(kItemframe); context.ah = 4; @@ -7723,10 +7950,11 @@ notinlift: context.data.byte(kPickup) = 0; context.al = context.data.byte(kReallocation); context.es.byte(context.bx) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void droperror(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7742,10 +7970,11 @@ void droperror(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void cantdrop(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7761,10 +7990,11 @@ void cantdrop(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void wornerror(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7780,10 +8010,11 @@ void wornerror(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void removeobfrominv(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommand), 100); if (context.flags.z()) goto obnotexist; getanyad(context); @@ -7792,16 +8023,17 @@ void removeobfrominv(Context & context) { context.ch = 0; deleteexobject(context); obnotexist: - return; + {assert(stack_depth == context.stack.size()); return; } } void selectopenob(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canopenit1: context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyopob; @@ -7817,7 +8049,7 @@ alreadyopob: context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: - return; + {assert(stack_depth == context.stack.size()); return; } doopenob: context.al = context.data.byte(kCommand); context.data.byte(kOpenedob) = context.al; @@ -7835,16 +8067,17 @@ doopenob: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useopened(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cannotuseopen; context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout2; outofopen(context); - return; + {assert(stack_depth == context.stack.size()); return; } notout2: findopenpos(context); context.ax = context.es.word(context.bx); @@ -7852,12 +8085,12 @@ notout2: if (context.flags.z()) goto canplace3; swapwithopen(context); cannotuseopen: - return; + {assert(stack_depth == context.stack.size()); return; } canplace3: context._cmp(context.data.byte(kPickup), 1); if (context.flags.z()) goto intoopen; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } intoopen: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -7878,13 +8111,13 @@ alreadyplc2: context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; notletgo3: - return; + {assert(stack_depth == context.stack.size()); return; } doplace2: geteitherad(context); isitworn(context); if (!context.flags.z()) goto notworntoopen; wornerror(context); - return; + {assert(stack_depth == context.stack.size()); return; } notworntoopen: delpointer(context); context.al = context.data.byte(kItemframe); @@ -7894,12 +8127,12 @@ notworntoopen: context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame; errormessage1(context); - return; + {assert(stack_depth == context.stack.size()); return; } isntsame: checkobjectsize(context); context._cmp(context.al, 0); if (context.flags.z()) goto sizeok1; - return; + {assert(stack_depth == context.stack.size()); return; } sizeok1: context.data.byte(kPickup) = 0; context.al = context.data.byte(kItemframe); @@ -7919,10 +8152,11 @@ sizeok1: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void errormessage1(Context & context) { + uint stack_depth = context.stack.size(); delpointer(context); context.di = 76; context.bx = 21; @@ -7943,10 +8177,11 @@ void errormessage1(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void errormessage2(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7968,10 +8203,11 @@ void errormessage2(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void errormessage3(Context & context) { + uint stack_depth = context.stack.size(); delpointer(context); context.di = 76; context.bx = 21; @@ -7989,10 +8225,11 @@ void errormessage3(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkobjectsize(Context & context) { + uint stack_depth = context.stack.size(); getopenedsize(context); context.push(context.ax); context.al = context.data.byte(kItemframe); @@ -8027,13 +8264,14 @@ bothspecial: errormessage3(context); sizewrong: context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } sizeok: context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void outofopen(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); @@ -8042,7 +8280,7 @@ void outofopen(Context & context) { if (!context.flags.z()) goto canpick4; cantuseopen: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canpick4: context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub4; @@ -8064,7 +8302,7 @@ alreadygrb: if (!context.flags.z()) goto notletgo4; reexfromopen(context); notletgo4: - return; + {assert(stack_depth == context.stack.size()); return; } dogrb: delpointer(context); context.data.byte(kPickup) = 1; @@ -8093,10 +8331,11 @@ actuallyout: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void transfertoex(Context & context) { + uint stack_depth = context.stack.size(); emergencypurge(context); getexpos(context); context.al = context.data.byte(kExpos); @@ -8134,10 +8373,11 @@ void transfertoex(Context & context) { context.ds.byte(context.si+2) = 254; pickupconts(context); context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void pickupconts(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; @@ -8170,10 +8410,11 @@ notinsidethis: context._cmp(context.cx, 80); if (!context.flags.z()) goto pickupcontloop; notopenable: - return; + {assert(stack_depth == context.stack.size()); return; } } void transfercontoex(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.push(context.dx); @@ -8200,10 +8441,11 @@ void transfercontoex(Context & context) { context.si = context.pop(); context.ds = context.pop(); context.ds.byte(context.si+2) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void transfertext(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kExtras); context.al = context.data.byte(kExpos); context.ah = 0; @@ -8228,10 +8470,11 @@ moretext: context._inc(context.data.word(kExtextpos)); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; - return; + {assert(stack_depth == context.stack.size()); return; } } void getexpos(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kExtras); context.al = 0; context.di = (0+2080+30000); @@ -8244,10 +8487,11 @@ tryanotherex: if (!context.flags.z()) goto tryanotherex; foundnewex: context.data.byte(kExpos) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void purgealocation(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.es = context.data.word(kExtras); context.di = (0+2080+30000); @@ -8272,10 +8516,11 @@ dontpurge: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto purgeloc; - return; + {assert(stack_depth == context.stack.size()); return; } } void emergencypurge(Context & context) { + uint stack_depth = context.stack.size(); checkpurgeagain: context.ax = context.data.word(kExframepos); context._add(context.ax, 4000); @@ -8291,10 +8536,11 @@ notnearframeend: purgeanitem(context); goto checkpurgeagain; notneartextend: - return; + {assert(stack_depth == context.stack.size()); return; } } void purgeanitem(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kExtras); context.di = (0+2080+30000); context.bl = context.data.byte(kReallocation); @@ -8311,7 +8557,7 @@ iscup: context._cmp(context.es.byte(context.di+11), context.bl); if (context.flags.z()) goto cantpurge; deleteexobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } cantpurge: context._add(context.di, 16); context._inc(context.cx); @@ -8327,16 +8573,17 @@ lookforpurge2: context._cmp(context.es.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge2; deleteexobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } cantpurge2: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge2; - return; + {assert(stack_depth == context.stack.size()); return; } } void deleteexobject(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); context.push(context.cx); context.push(context.cx); @@ -8377,10 +8624,11 @@ notinsideex: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto deleteconts; - return; + {assert(stack_depth == context.stack.size()); return; } } void deleteexframe(Context & context) { + uint stack_depth = context.stack.size(); context.di = (0); context.ah = 0; context._add(context.ax, context.ax); @@ -8416,10 +8664,11 @@ beforethisone: context.es.word(context.di+2) = context.ax; context._add(context.di, 6); if (--context.cx) goto shuffleadsdown; - return; + {assert(stack_depth == context.stack.size()); return; } } void deleteextext(Context & context) { + uint stack_depth = context.stack.size(); context.di = (0+2080+30000+(16*114)); context.ah = 0; context._add(context.ax, context.ax); @@ -8457,19 +8706,21 @@ beforethistext: context.es.word(context.di) = context.ax; context._add(context.di, 2); if (--context.cx) goto shuffletextads; - return; + {assert(stack_depth == context.stack.size()); return; } } void blockget(Context & context) { + uint stack_depth = context.stack.size(); context.ah = context.al; context.al = 0; context.ds = context.data.word(kBackdrop); context.si = (0+192); context._add(context.si, context.ax); - return; + {assert(stack_depth == context.stack.size()); return; } } void drawfloor(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); eraseoldobs(context); @@ -8484,10 +8735,11 @@ void drawfloor(Context & context) { context.data.byte(kNewobs) = 0; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void calcmapad(Context & context) { + uint stack_depth = context.stack.size(); getdimension(context); context.push(context.cx); context.push(context.dx); @@ -8511,10 +8763,11 @@ void calcmapad(Context & context) { context._mul(context.bx); context._add(context.ax, context.data.word(kMapoffsety)); context.data.word(kMapady) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void getdimension(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)); context.ch = 0; @@ -8591,10 +8844,11 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context.data.byte(kMapysize) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void addalong(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 11; addloop: context._cmp(context.es.byte(context.bx), 0); @@ -8603,13 +8857,14 @@ addloop: context._dec(context.ah); if (!context.flags.z()) goto addloop; context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } gotalong: context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void addlength(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 10; addloop2: context._cmp(context.es.byte(context.bx), 0); @@ -8618,13 +8873,14 @@ addloop2: context._dec(context.ah); if (!context.flags.z()) goto addloop2; context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } gotlength: context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void drawflags(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)); context.al = context.data.byte(kMapy); @@ -8658,10 +8914,11 @@ _tmp28a: context._add(context.si, (66)-11); context.cx = context.pop(); if (--context.cx) goto _tmp28; - return; + {assert(stack_depth == context.stack.size()); return; } } void eraseoldobs(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; context.es = context.data.word(kBuffers); @@ -8683,10 +8940,11 @@ notthisob: context._add(context.bx, (32)); if (--context.cx) goto oberase; donterase: - return; + {assert(stack_depth == context.stack.size()); return; } } void showallobs(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); context.data.word(kListpos) = context.bx; @@ -8765,10 +9023,11 @@ blankframe: if (context.flags.z()) goto finishedsetobs; goto showobsloop; finishedsetobs: - return; + {assert(stack_depth == context.stack.size()); return; } } void makebackob(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto nomake; context.al = context.es.byte(context.si+5); @@ -8798,10 +9057,11 @@ usedpriority: context.es.byte(context.bx+19) = 0; context.si = context.pop(); nomake: - return; + {assert(stack_depth == context.stack.size()); return; } } void showallfree(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.data.word(kListpos) = context.bx; @@ -8877,10 +9137,11 @@ over138: if (context.flags.z()) goto finfree; goto loop127; finfree: - return; + {assert(stack_depth == context.stack.size()); return; } } void showallex(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.data.word(kListpos) = context.bx; @@ -8961,10 +9222,11 @@ blankex: if (context.flags.z()) goto finex; goto exloop; finex: - return; + {assert(stack_depth == context.stack.size()); return; } } void calcfrframe(Context & context) { + uint stack_depth = context.stack.size(); context.dx = context.data.word(kFrsegment); context.ax = context.data.word(kFramesad); context.push(context.ax); @@ -8991,15 +9253,16 @@ void calcfrframe(Context & context) { context.al = context.ah; context.ah = 0; context.data.word(kOffsety) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } nullframe: context.ax = context.pop(); context.cx = 0; context.data.word(kSavesize) = context.cx; - return; + {assert(stack_depth == context.stack.size()); return; } } void finalframe(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kObjecty); context._add(context.ax, context.data.word(kOffsety)); context.bx = context.data.word(kObjectx); @@ -9008,10 +9271,11 @@ void finalframe(Context & context) { context.data.byte(kSavey) = context.al; context.di = context.data.word(kObjectx); context.bx = context.data.word(kObjecty); - return; + {assert(stack_depth == context.stack.size()); return; } } void adjustlen(Context & context) { + uint stack_depth = context.stack.size(); context.ah = context.al; context._add(context.al, context.ch); context._cmp(context.al, 100); @@ -9020,10 +9284,11 @@ void adjustlen(Context & context) { context._sub(context.al, context.ch); context.ch = context.al; over242: - return; + {assert(stack_depth == context.stack.size()); return; } } void getmapad(Context & context) { + uint stack_depth = context.stack.size(); getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; @@ -9034,10 +9299,11 @@ void getmapad(Context & context) { context.data.word(kObjecty) = context.ax; context.ch = 1; over146: - return; + {assert(stack_depth == context.stack.size()); return; } } void getxad(Context & context) { + uint stack_depth = context.stack.size(); context.cl = context.es.byte(context.si); context._inc(context.si); context.al = context.es.byte(context.si); @@ -9055,13 +9321,14 @@ void getxad(Context & context) { context._or(context.al, context.ah); context.ah = 0; context.ch = 1; - return; + {assert(stack_depth == context.stack.size()); return; } over148: context.ch = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void getyad(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.es.byte(context.si); context._inc(context.si); context.ah = context.es.byte(context.si); @@ -9075,13 +9342,14 @@ void getyad(Context & context) { context._or(context.al, context.ah); context.ah = 0; context.ch = 1; - return; + {assert(stack_depth == context.stack.size()); return; } over147: context.ch = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void autolook(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousex); context._cmp(context.ax, context.data.word(kOldx)); if (!context.flags.z()) goto diffmouse; @@ -9095,13 +9363,14 @@ void autolook(Context & context) { if (!context.flags.z()) goto noautolook; dolook(context); noautolook: - return; + {assert(stack_depth == context.stack.size()); return; } diffmouse: context.data.word(kLookcounter) = 1000; - return; + {assert(stack_depth == context.stack.size()); return; } } void look(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -9119,10 +9388,11 @@ alreadylook: if (context.flags.z()) goto nolook; dolook(context); nolook: - return; + {assert(stack_depth == context.stack.size()); return; } } void dolook(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); showicon(context); undertextline(context); @@ -9155,10 +9425,11 @@ afterlook: context.data.byte(kCommandtype) = 0; redrawmainscrn(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void redrawmainscrn(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kTimecount) = 0; createpanel(context); context.data.byte(kNewobs) = 0; @@ -9170,14 +9441,15 @@ void redrawmainscrn(Context & context) { undertextline(context); readmouse(context); context.data.byte(kCommandtype) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void getback1(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPickup), 0); if (context.flags.z()) goto notgotobject; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } notgotobject: context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadyget; @@ -9191,14 +9463,15 @@ alreadyget: context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: - return; + {assert(stack_depth == context.stack.size()); return; } dogetback: context.data.byte(kGetback) = 1; context.data.byte(kPickup) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void talk(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kTalkpos) = 0; context.data.byte(kInmaparea) = 0; context.al = context.data.byte(kCommand); @@ -9244,10 +9517,11 @@ notnexttalk: context.data.byte(kVolumedirection) = -1; context.data.byte(kVolumeto) = 0; nospeech: - return; + {assert(stack_depth == context.stack.size()); return; } } void convicons(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCharacter); context._and(context.al, 127); getpersframe(context); @@ -9259,20 +9533,22 @@ void convicons(Context & context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getpersframe(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(kPeople); context._add(context.bx, (0)); context.ax = context.es.word(context.bx); - return; + {assert(stack_depth == context.stack.size()); return; } } void starttalk(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kTalkmode) = 0; context.al = context.data.byte(kCharacter); context._and(context.al, 127); @@ -9292,10 +9568,11 @@ void starttalk(Context & context) { context.ah = 0; printdirect(context); nospeech1: - return; + {assert(stack_depth == context.stack.size()); return; } } void getpersontext(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.cx = 64*2; context._mul(context.cx); @@ -9306,14 +9583,15 @@ void getpersontext(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void moretalk(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kTalkmode), 0); if (context.flags.z()) goto canmore; redes(context); - return; + {assert(stack_depth == context.stack.size()); return; } canmore: context._cmp(context.data.byte(kCommandtype), 215); if (context.flags.z()) goto alreadymore; @@ -9327,7 +9605,7 @@ alreadymore: context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: - return; + {assert(stack_depth == context.stack.size()); return; } domoretalk: context.data.byte(kTalkmode) = 2; context.data.byte(kTalkpos) = 4; @@ -9336,10 +9614,11 @@ domoretalk: context.data.byte(kTalkpos) = 48; notsecondpart: dosometalk(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dosometalk(Context & context) { + uint stack_depth = context.stack.size(); watchtalk: context.al = context.data.byte(kTalkpos); context.al = context.data.byte(kCharacter); @@ -9429,10 +9708,11 @@ skiptalk: goto watchtalk; endwatchtalk: context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void hangonpq(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kGetback) = 0; context.bx = 0; hangloopq: @@ -9466,23 +9746,24 @@ notspeaking: finishconv: delpointer(context); context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } quitconv: delpointer(context); context.data.byte(kPointermode) = 0; context.ax = context.pop(); cancelch1(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void redes(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto cantredes; context._cmp(context.data.byte(kTalkmode), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canredes: context._cmp(context.data.byte(kCommandtype), 217); if (context.flags.z()) goto alreadyreds; @@ -9493,7 +9774,7 @@ alreadyreds: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; - return; + {assert(stack_depth == context.stack.size()); return; } doredes: delpointer(context); createpanel(context); @@ -9506,27 +9787,29 @@ doredes: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void newplace(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNeedtotravel), 1); if (context.flags.z()) goto istravel; context._cmp(context.data.byte(kAutolocation), -1); if (!context.flags.z()) goto isautoloc; - return; + {assert(stack_depth == context.stack.size()); return; } isautoloc: context.al = context.data.byte(kAutolocation); context.data.byte(kNewlocation) = context.al; context.data.byte(kAutolocation) = -1; - return; + {assert(stack_depth == context.stack.size()); return; } istravel: context.data.byte(kNeedtotravel) = 0; selectlocation(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void selectlocation(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kInmaparea) = 0; clearbeforeload(context); context.data.byte(kGetback) = 0; @@ -9572,7 +9855,7 @@ select: getridoftemp3(context); context.es = context.data.word(kTraveltext); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } quittravel: context.al = context.data.byte(kReallocation); context.data.byte(kNewlocation) = context.al; @@ -9582,10 +9865,11 @@ quittravel: getridoftemp3(context); context.es = context.data.word(kTraveltext); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showcity(Context & context) { + uint stack_depth = context.stack.size(); clearwork(context); context.ds = context.data.word(kTempgraphics); context.di = 57; @@ -9599,10 +9883,11 @@ void showcity(Context & context) { context.al = 1; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void lookatplace(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyinfo; context.data.byte(kCommandtype) = 224; @@ -9654,10 +9939,11 @@ afterinfo: putundercentre(context); worktoscreenm(context); noinfo: - return; + {assert(stack_depth == context.stack.size()); return; } } void getundercentre(Context & context) { + uint stack_depth = context.stack.size(); context.di = 58; context.bx = 72; context.ds = context.data.word(kMapstore); @@ -9665,10 +9951,11 @@ void getundercentre(Context & context) { context.cl = 254; context.ch = 110; multiget(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void putundercentre(Context & context) { + uint stack_depth = context.stack.size(); context.di = 58; context.bx = 72; context.ds = context.data.word(kMapstore); @@ -9676,10 +9963,11 @@ void putundercentre(Context & context) { context.cl = 254; context.ch = 110; multiput(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void locationpic(Context & context) { + uint stack_depth = context.stack.size(); getdestinfo(context); context.al = context.es.byte(context.si); context.push(context.es); @@ -9722,10 +10010,11 @@ notinthisone: context.al = 0; context.ah = 0; printdirect(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getdestinfo(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kDestpos); context.ah = 0; context.push(context.ax); @@ -9741,10 +10030,11 @@ void getdestinfo(Context & context) { context.si = 7798; context._add(context.si, context.ax); context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void showarrows(Context & context) { + uint stack_depth = context.stack.size(); context.di = 116-12; context.bx = 16; context.ds = context.data.word(kTempgraphics); @@ -9763,10 +10053,11 @@ void showarrows(Context & context) { context.al = 2; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void nextdest(Context & context) { + uint stack_depth = context.stack.size(); duok: context._cmp(context.data.byte(kCommandtype), 218); if (context.flags.z()) goto alreadydu; @@ -9801,10 +10092,11 @@ notlastdest: worktoscreen(context); delpointer(context); nodu: - return; + {assert(stack_depth == context.stack.size()); return; } } void lastdest(Context & context) { + uint stack_depth = context.stack.size(); ddok: context._cmp(context.data.byte(kCommandtype), 219); if (context.flags.z()) goto alreadydd; @@ -9839,10 +10131,11 @@ notfirstdest: worktoscreen(context); delpointer(context); nodd: - return; + {assert(stack_depth == context.stack.size()); return; } } void destselect(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadytrav; context.data.byte(kCommandtype) = 222; @@ -9858,30 +10151,33 @@ alreadytrav: context.al = context.data.byte(kDestpos); context.data.byte(kNewlocation) = context.al; notrav: - return; + {assert(stack_depth == context.stack.size()); return; } } void getlocation(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.bx = context.ax; context.dx = context.data; context.es = context.dx; context._add(context.bx, 7782); context.al = context.es.byte(context.bx); - return; + {assert(stack_depth == context.stack.size()); return; } } void setlocation(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.bx = context.ax; context.dx = context.data; context.es = context.dx; context._add(context.bx, 7782); context.es.byte(context.bx) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void resetlocation(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context._cmp(context.al, 5); if (!context.flags.z()) goto notdelhotel; @@ -9925,26 +10221,29 @@ clearedlocations: context.es = context.dx; context._add(context.bx, 7782); context.es.byte(context.bx) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void readdesticon(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2013; loadintotemp(context); context.dx = 2026; loadintotemp2(context); context.dx = 1961; loadintotemp3(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void readcitypic(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2000; loadintotemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usemon(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kLasttrigger) = 0; context.es = context.cs; context.di = 2892+1; @@ -10031,10 +10330,11 @@ endmon: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void printoutermon(Context & context) { + uint stack_depth = context.stack.size(); context.di = 40; context.bx = 32; context.ds = context.data.word(kTempgraphics); @@ -10059,10 +10359,11 @@ void printoutermon(Context & context) { context.al = 4; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadpersonal(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kLocation); context.dx = 2052; context._cmp(context.al, 0); @@ -10086,10 +10387,11 @@ foundpersonal: context.dx = 0; readfromfile(context); closefile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadnews(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kNewsitem); context.dx = 2078; context._cmp(context.al, 0); @@ -10115,10 +10417,11 @@ foundnews: context.dx = 0; readfromfile(context); closefile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadcart(Context & context) { + uint stack_depth = context.stack.size(); lookininterface(context); context.dx = 2130; context._cmp(context.al, 0); @@ -10147,10 +10450,11 @@ gotcart: context.dx = 0; readfromfile(context); closefile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void lookininterface(Context & context) { + uint stack_depth = context.stack.size(); context.al = 'I'; context.ah = 'N'; context.cl = 'T'; @@ -10162,13 +10466,14 @@ void lookininterface(Context & context) { if (context.flags.z()) goto emptyinterface; context.al = context.es.byte(context.bx+15); context._inc(context.al); - return; + {assert(stack_depth == context.stack.size()); return; } emptyinterface: context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void turnonpower(Context & context) { + uint stack_depth = context.stack.size(); context.cx = 3; powerloop: context.push(context.cx); @@ -10181,10 +10486,11 @@ powerloop: context.cx = context.pop(); if (--context.cx) goto powerloop; powerlighton(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void randomaccess(Context & context) { + uint stack_depth = context.stack.size(); accessloop: context.push(context.cx); vsync(context); @@ -10201,10 +10507,11 @@ chosenaccess: context.cx = context.pop(); if (--context.cx) goto accessloop; accesslightoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void powerlighton(Context & context) { + uint stack_depth = context.stack.size(); context.di = 257+4; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10218,10 +10525,11 @@ void powerlighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void powerlightoff(Context & context) { + uint stack_depth = context.stack.size(); context.di = 257+4; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10235,10 +10543,11 @@ void powerlightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void accesslighton(Context & context) { + uint stack_depth = context.stack.size(); context.di = 74; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10252,10 +10561,11 @@ void accesslighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void accesslightoff(Context & context) { + uint stack_depth = context.stack.size(); context.di = 74; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10269,10 +10579,11 @@ void accesslightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void locklighton(Context & context) { + uint stack_depth = context.stack.size(); context.di = 56; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10286,10 +10597,11 @@ void locklighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void locklightoff(Context & context) { + uint stack_depth = context.stack.size(); context.di = 56; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10303,10 +10615,11 @@ void locklightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void input(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.cs; context.di = 7816; context.cx = 64; @@ -10392,18 +10705,20 @@ notleadingspace: context._add(context.data.word(kCurslocx), context.cx); goto waitkey; endofinput: - return; + {assert(stack_depth == context.stack.size()); return; } } void makecaps(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.al, 'a'); if (context.flags.c()) goto notupperc; context._sub(context.al, 32); notupperc: - return; + {assert(stack_depth == context.stack.size()); return; } } void delchar(Context & context) { + uint stack_depth = context.stack.size(); context._dec(context.data.word(kCurpos)); context.si = context.data.word(kCurpos); context._add(context.si, context.si); @@ -10428,10 +10743,11 @@ void delchar(Context & context) { context.cl = context.al; context.ch = 8; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void execcommand(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.cs; context.bx = 2776; context.ds = context.cs; @@ -10440,7 +10756,7 @@ void execcommand(Context & context) { context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } notblankinp: context.cl = 0; comloop: @@ -10463,7 +10779,7 @@ comloop2: if (!context.flags.z()) goto comloop; neterror(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } foundcom: context.si = context.pop(); context.bx = context.pop(); @@ -10481,44 +10797,46 @@ foundcom: directory: dircom(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } signoncom: signon(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } accesscom: read(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } keyscom: showkeys(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } testcom: context.al = 6; monmessage(context); context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } quitcom: context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void neterror(Context & context) { + uint stack_depth = context.stack.size(); context.al = 5; monmessage(context); scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dircom(Context & context) { + uint stack_depth = context.stack.size(); context.cx = 30; randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); if (context.flags.z()) goto dirroot; dirfile(context); - return; + {assert(stack_depth == context.stack.size()); return; } dirroot: context.data.byte(kLogonum) = 0; context.ds = context.cs; @@ -10540,10 +10858,11 @@ dirroot: context.es = context.data.word(kTextfile3); searchforfiles(context); scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void searchforfiles(Context & context) { + uint stack_depth = context.stack.size(); context.bx = (66*2); directloop1: context.al = context.es.byte(context.bx); @@ -10555,10 +10874,11 @@ directloop1: monprint(context); goto directloop1; endofdir: - return; + {assert(stack_depth == context.stack.size()); return; } } void signon(Context & context) { + uint stack_depth = context.stack.size(); parser(context); context._inc(context.di); context.ds = context.cs; @@ -10588,7 +10908,7 @@ nomatch: if (--context.cx) goto signonloop; context.al = 13; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } foundsign: context.di = context.pop(); context.si = context.pop(); @@ -10599,7 +10919,7 @@ foundsign: if (context.flags.z()) goto notyetassigned; context.al = 17; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } notyetassigned: context.push(context.es); context.push(context.bx); @@ -10636,7 +10956,7 @@ passerror: scrollmonitor(context); context.al = 16; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } passpassed: context.al = 14; monmessage(context); @@ -10650,10 +10970,11 @@ passpassed: context.bx = context.pop(); context.es = context.pop(); context.es.byte(context.bx) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void showkeys(Context & context) { + uint stack_depth = context.stack.size(); context.cx = 10; randomaccess(context); scrollmonitor(context); @@ -10675,17 +10996,18 @@ notheld: context._add(context.bx, 26); if (--context.cx) goto keysloop; scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void read(Context & context) { + uint stack_depth = context.stack.size(); context.cx = 40; randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); if (!context.flags.z()) goto okcom; neterror(context); - return; + {assert(stack_depth == context.stack.size()); return; } okcom: context.es = context.cs; context.di = 2892; @@ -10712,12 +11034,12 @@ okcom: if (context.flags.z()) goto foundfile2; context.al = 7; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } foundfile2: getkeyandlogo(context); context._cmp(context.al, 0); if (context.flags.z()) goto keyok1; - return; + {assert(stack_depth == context.stack.size()); return; } keyok1: context.es = context.cs; context.di = 2883; @@ -10729,7 +11051,7 @@ keyok1: context.data.byte(kLogonum) = context.al; context.al = 11; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } findtopictext: context._inc(context.bx); context.push(context.es); @@ -10757,10 +11079,11 @@ moretopic: goto moretopic; endoftopic: scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dirfile(Context & context) { + uint stack_depth = context.stack.size(); context.al = 34; context.es.byte(context.di) = context.al; context.push(context.es); @@ -10792,14 +11115,14 @@ void dirfile(Context & context) { context.es = context.pop(); context.al = 7; monmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } foundfile: context.ax = context.pop(); context.ax = context.pop(); getkeyandlogo(context); context._cmp(context.al, 0); if (context.flags.z()) goto keyok2; - return; + {assert(stack_depth == context.stack.size()); return; } keyok2: context.push(context.es); context.push(context.bx); @@ -10828,10 +11151,11 @@ directloop2: goto directloop2; endofdir2: scrollmonitor(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getkeyandlogo(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.bx); context.al = context.es.byte(context.bx); context._sub(context.al, 48); @@ -10865,17 +11189,18 @@ void getkeyandlogo(Context & context) { context.bx = context.pop(); context.es = context.pop(); context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } keyok: context.bx = context.pop(); context.es = context.pop(); context.al = context.data.byte(kNewlogonum); context.data.byte(kLogonum) = context.al; context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void searchforstring(Context & context) { + uint stack_depth = context.stack.size(); context.dl = context.es.byte(context.di); context.cx = context.di; restartlook: @@ -10907,13 +11232,14 @@ complete: context.es = context.ds; context.al = 0; context.bx = context.si; - return; + {assert(stack_depth == context.stack.size()); return; } notfound: context.al = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void parser(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.cs; context.di = 2883; context.cx = 13; @@ -10944,10 +11270,11 @@ copyin1: if (!context.flags.z()) goto copyin1; finishpars: context.di = 2883; - return; + {assert(stack_depth == context.stack.size()); return; } } void scrollmonitor(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -10972,10 +11299,11 @@ void scrollmonitor(Context & context) { context.cx = context.pop(); context.bx = context.pop(); context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void lockmon(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLasthardkey), 57); if (!context.flags.z()) goto notlock; locklighton(context); @@ -10984,10 +11312,11 @@ lockloop: if (context.flags.z()) goto lockloop; locklightoff(context); notlock: - return; + {assert(stack_depth == context.stack.size()); return; } } void monitorlogo(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kLogonum); context._cmp(context.al, context.data.byte(kOldlogonum)); if (context.flags.z()) goto notnewlogo; @@ -11001,13 +11330,14 @@ void monitorlogo(Context & context) { playchannel1(context); context.cx = 20; randomaccess(context); - return; + {assert(stack_depth == context.stack.size()); return; } notnewlogo: printlogo(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void printlogo(Context & context) { + uint stack_depth = context.stack.size(); context.di = 56; context.bx = 32; context.ds = context.data.word(kTempgraphics); @@ -11015,10 +11345,11 @@ void printlogo(Context & context) { context.ah = 0; showframe(context); showcurrentfile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showcurrentfile(Context & context) { + uint stack_depth = context.stack.size(); context.di = 178; context.bx = 37; context.si = 2892+1; @@ -11034,10 +11365,11 @@ curfileloop: context.si = context.pop(); goto curfileloop; finishfile: - return; + {assert(stack_depth == context.stack.size()); return; } } void monmessage(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTextfile1); context.bx = (66*2); context.cl = context.al; @@ -11049,17 +11381,18 @@ monmessageloop: if (!context.flags.z()) goto monmessageloop; if (--context.cx) goto monmessageloop; monprint(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void processtrigger(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLasttrigger), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); context.al = 45; triggermessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } notfirsttrigger: context._cmp(context.data.byte(kLasttrigger), '2'); if (!context.flags.z()) goto notsecondtrigger; @@ -11067,7 +11400,7 @@ notfirsttrigger: setlocation(context); context.al = 55; triggermessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } notsecondtrigger: context._cmp(context.data.byte(kLasttrigger), '3'); if (!context.flags.z()) goto notthirdtrigger; @@ -11076,10 +11409,11 @@ notsecondtrigger: context.al = 59; triggermessage(context); notthirdtrigger: - return; + {assert(stack_depth == context.stack.size()); return; } } void triggermessage(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.di = 174; context.bx = 153; @@ -11109,10 +11443,11 @@ void triggermessage(Context & context) { multiput(context); worktoscreen(context); context.data.byte(kLasttrigger) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void printcurs(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.si); context.push(context.di); context.push(context.ds); @@ -11154,10 +11489,11 @@ flashcurs: context.ds = context.pop(); context.di = context.pop(); context.si = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void delcurs(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.push(context.di); @@ -11185,10 +11521,11 @@ finishcurdel: context.di = context.pop(); context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void useobject(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kWithobject) = 255; context._cmp(context.data.byte(kCommandtype), 229); if (context.flags.z()) goto alreadyuse; @@ -11204,18 +11541,19 @@ alreadyuse: context._and(context.ax, 1); if (!context.flags.z()) goto douse; nouse: - return; + {assert(stack_depth == context.stack.size()); return; } douse: useroutine(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useroutine(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 50); if (context.flags.c()) goto nodream7; context._cmp(context.data.byte(kPointerpower), 0); if (!context.flags.z()) goto powerok; - return; + {assert(stack_depth == context.stack.size()); return; } powerok: context.data.byte(kPointerpower) = 0; nodream7: @@ -11244,7 +11582,7 @@ checkuselist: context._lodsw(); context.si = context.pop(); __dispatch_call(context, context.ax); - return; + {assert(stack_depth == context.stack.size()); return; } failed: context.si = context.pop(); context._add(context.si, 6); @@ -11265,7 +11603,7 @@ failed: context.cx = 400; hangonp(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } cantuse2: createpanel(context); showpanel(context); @@ -11282,22 +11620,24 @@ cantuse2: hangonp(context); putbackobstuff(context); context.data.byte(kCommandtype) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void wheelsound(Context & context) { + uint stack_depth = context.stack.size(); context.al = 17; playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void runtap(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tapwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } tapwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11319,7 +11659,7 @@ tapwith: context.al = 56; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } fillcupfromtap: context.al = context.data.byte(kWithobject); getexad(context); @@ -11330,46 +11670,50 @@ fillcupfromtap: context.al = 57; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } cupfromtapfull: context.cx = 300; context.al = 58; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void playguitar(Context & context) { + uint stack_depth = context.stack.size(); context.al = 14; playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void hotelcontrol(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 21); if (!context.flags.z()) goto notrightcont; context._cmp(context.data.byte(kMapx), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notrightcont: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void hotelbell(Context & context) { + uint stack_depth = context.stack.size(); context.al = 12; playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void opentomb(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 35*2; @@ -11378,10 +11722,11 @@ void opentomb(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usetrainer(Context & context) { + uint stack_depth = context.stack.size(); getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; @@ -11389,13 +11734,14 @@ void usetrainer(Context & context) { makeworn(context); showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notheldtrainer: nothelderror(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void nothelderror(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); showpanel(context); showman(context); @@ -11411,14 +11757,15 @@ void nothelderror(Context & context) { context.cx = 50; hangonp(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usepipe(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto pipewith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } pipewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11440,7 +11787,7 @@ pipewith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } fillcup: context.cx = 300; context.al = 36; @@ -11449,16 +11796,17 @@ fillcup: context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+15) = 'F'-'A'; - return; + {assert(stack_depth == context.stack.size()); return; } alreadyfull: context.cx = 300; context.al = 35; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usefullcart(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.data.byte(kProgresspoints)); context.al = 2; context.ah = context.data.byte(kRoomnum); @@ -11477,14 +11825,15 @@ void usefullcart(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useplinth(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } plinthwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11496,7 +11845,7 @@ plinthwith: if (context.flags.z()) goto isrightkey; showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } isrightkey: context._inc(context.data.byte(kProgresspoints)); showseconduse(context); @@ -11508,18 +11857,20 @@ isrightkey: context.data.byte(kGetback) = 1; context.al = context.data.byte(kRoomafterdream); context.data.byte(kNewlocation) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void chewy(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); getanyad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useladder(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context._sub(context.data.byte(kMapx), 11); findroominloc(context); @@ -11531,10 +11882,11 @@ void useladder(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useladderb(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context._add(context.data.byte(kMapx), 11); findroominloc(context); @@ -11546,10 +11898,11 @@ void useladderb(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoora(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11561,16 +11914,17 @@ void slabdoora(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 42; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabawrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 34; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoorb(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kDreamnumber), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; @@ -11583,7 +11937,7 @@ void slabdoorb(Context & context) { context.cx = 200; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotcrystal: showfirstuse(context); context._inc(context.data.byte(kProgresspoints)); @@ -11594,7 +11948,7 @@ gotcrystal: context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 71; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabbwrong: showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11605,10 +11959,11 @@ slabbwrong: context.data.word(kEndwatchreel) = 63; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoord(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11620,16 +11975,17 @@ void slabdoord(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 102; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabcwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 94; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoorc(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11641,16 +11997,17 @@ void slabdoorc(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 135; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabdwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 127; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoore(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11662,16 +12019,17 @@ void slabdoore(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 168; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabewrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 160; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void slabdoorf(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11683,20 +12041,21 @@ void slabdoorf(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 197; context.data.byte(kNewlocation) = 47; - return; + {assert(stack_depth == context.stack.size()); return; } slabfwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 189; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useslab(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto slabwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } slabwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11710,7 +12069,7 @@ slabwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } nextslab: context.al = context.data.byte(kWithobject); getexad(context); @@ -11736,14 +12095,15 @@ notlastslab: context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usecart(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto cartwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } cartwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11757,7 +12117,7 @@ cartwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } nextcart: context.al = context.data.byte(kWithobject); getexad(context); @@ -11773,14 +12133,15 @@ nextcart: playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useclearbox(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } clearboxwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11794,7 +12155,7 @@ clearboxwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } openbox: context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); @@ -11804,10 +12165,11 @@ openbox: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usecoveredbox(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 50; @@ -11816,10 +12178,11 @@ void usecoveredbox(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void userailing(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.word(kWatchingtime) = 80; context.data.word(kReeltowatch) = 0; @@ -11828,14 +12191,15 @@ void userailing(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context.data.byte(kMandead) = 4; - return; + {assert(stack_depth == context.stack.size()); return; } } void useopenbox(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } openboxwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11854,7 +12218,7 @@ openboxwith: compare(context); if (context.flags.z()) goto openboxwrong; showfirstuse(context); - return; + {assert(stack_depth == context.stack.size()); return; } destoryopenbox: context._inc(context.data.byte(kProgresspoints)); context.cx = 300; @@ -11871,16 +12235,17 @@ destoryopenbox: context.al = 4; turnpathon(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } openboxwrong: context.cx = 300; context.al = 38; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void wearwatch(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); @@ -11888,14 +12253,15 @@ void wearwatch(Context & context) { context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); - return; + {assert(stack_depth == context.stack.size()); return; } wearingwatch: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void wearshades(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kShadeson), 1); if (context.flags.z()) goto wearingshades; context.data.byte(kShadeson) = 1; @@ -11903,14 +12269,15 @@ void wearshades(Context & context) { context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); - return; + {assert(stack_depth == context.stack.size()); return; } wearingshades: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void sitdowninbar(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchmode), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); @@ -11922,14 +12289,15 @@ void sitdowninbar(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } satdown: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usechurchhole(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.word(kWatchingtime) = 28; @@ -11937,14 +12305,15 @@ void usechurchhole(Context & context) { context.data.word(kEndwatchreel) = 26; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usehole(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto holewith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } holewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11958,7 +12327,7 @@ holewith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } righthand: showfirstuse(context); context.al = 86; @@ -11968,10 +12337,11 @@ righthand: context.es.byte(context.bx+2) = 255; context.data.byte(kCanmovealtar) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usealtar(Context & context) { + uint stack_depth = context.stack.size(); context.al = 'C'; context.ah = 'N'; context.cl = 'D'; @@ -11992,7 +12362,7 @@ void usealtar(Context & context) { context.al = 23; showpuztext(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } movealtar: context._inc(context.data.byte(kProgresspoints)); showseconduse(context); @@ -12008,18 +12378,19 @@ movealtar: context.dx = 98; setuptimeduse(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } thingsonaltar: showfirstuse(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void opentvdoor(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } tvdoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12033,66 +12404,72 @@ tvdoorwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } keyontv: showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usedryer(Context & context) { + uint stack_depth = context.stack.size(); context.al = 12; playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void openlouis(Context & context) { + uint stack_depth = context.stack.size(); context.al = 5; context.ah = 2; context.cl = 3; context.ch = 8; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void nextcolon(Context & context) { + uint stack_depth = context.stack.size(); lookcolon: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; - return; + {assert(stack_depth == context.stack.size()); return; } } void openyourneighbour(Context & context) { + uint stack_depth = context.stack.size(); context.al = 255; context.ah = 255; context.cl = 255; context.ch = 255; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usewindow(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kManspath), 6); if (!context.flags.z()) goto notonbalc; context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kNewlocation) = 29; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notonbalc: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usebalcony(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.al = 6; turnpathon(context); @@ -12121,50 +12498,55 @@ void usebalcony(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void openryan(Context & context) { + uint stack_depth = context.stack.size(); context.al = 5; context.ah = 1; context.cl = 0; context.ch = 6; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void openpoolboss(Context & context) { + uint stack_depth = context.stack.size(); context.al = 5; context.ah = 2; context.cl = 2; context.ch = 2; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void openeden(Context & context) { + uint stack_depth = context.stack.size(); context.al = 2; context.ah = 8; context.cl = 6; context.ch = 5; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void opensarters(Context & context) { + uint stack_depth = context.stack.size(); context.al = 7; context.ah = 8; context.cl = 3; context.ch = 3; entercode(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void isitright(Context & context) { + uint stack_depth = context.stack.size(); context.bx = context.data; context.es = context.bx; context.bx = 8344; @@ -12176,22 +12558,24 @@ void isitright(Context & context) { if (!context.flags.z()) goto notright; context._cmp(context.es.byte(context.bx+3), context.ch); notright: - return; + {assert(stack_depth == context.stack.size()); return; } } void drawitall(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); drawfloor(context); printsprites(context); showicon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void openhoteldoor(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } hoteldoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12205,21 +12589,22 @@ hoteldoorwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void openhoteldoor2(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } hoteldoorwith2: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12233,20 +12618,21 @@ hoteldoorwith2: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } keyonhotel2: context.al = 16; playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void grafittidoor(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto grafwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } grafwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12260,14 +12646,15 @@ grafwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } dograf: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void trapdoor(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); switchryanoff(context); @@ -12278,10 +12665,11 @@ void trapdoor(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void callhotellift(Context & context) { + uint stack_depth = context.stack.size(); context.al = 12; playchannel1(context); showfirstuse(context); @@ -12292,19 +12680,21 @@ void callhotellift(Context & context) { autosetwalk(context); context.al = 4; turnpathon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void calledenslift(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kCounttoopen) = 8; context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void calledensdlift(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLiftflag), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); @@ -12312,18 +12702,19 @@ void calledensdlift(Context & context) { context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); - return; + {assert(stack_depth == context.stack.size()); return; } edensdhere: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usepoolreader(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto poolwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } poolwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12337,27 +12728,28 @@ poolwith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } openpool: context._cmp(context.data.byte(kTalkedtoattendant), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); context.data.byte(kCounttoopen) = 6; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void uselighter(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotlighterwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12369,7 +12761,7 @@ gotlighterwith: if (context.flags.z()) goto cigarette; showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } cigarette: context.cx = 300; context.al = 9; @@ -12378,10 +12770,11 @@ cigarette: getexad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void showseconduse(Context & context) { + uint stack_depth = context.stack.size(); getobtextstart(context); nextcolon(context); nextcolon(context); @@ -12389,14 +12782,15 @@ void showseconduse(Context & context) { usetext(context); context.cx = 400; hangonp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecardreader1(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotreader1with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12410,7 +12804,7 @@ gotreader1with: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } correctcard: context._cmp(context.data.byte(kTalkedtosparky), 0); if (context.flags.z()) goto notyet; @@ -12420,7 +12814,7 @@ correctcard: context.al = 17; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } getscash: context.al = 16; playchannel1(context); @@ -12430,18 +12824,19 @@ getscash: context._inc(context.data.byte(kProgresspoints)); context.data.word(kCard1money) = 12432; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notyet: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecardreader2(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotreader2with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12455,7 +12850,7 @@ gotreader2with: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } correctcard2: context._cmp(context.data.byte(kTalkedtoboss), 0); if (context.flags.z()) goto notyetboss; @@ -12474,30 +12869,31 @@ correctcard2: context._sub(context.data.word(kCard1money), 2000); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } nocash: context.cx = 300; context.al = 20; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } alreadygotnew: context.cx = 300; context.al = 22; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notyetboss: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecardreader3(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotreader3with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12511,7 +12907,7 @@ gotreader3with: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } rightcard: context._cmp(context.data.byte(kTalkedtorecep), 0); if (context.flags.z()) goto notyetrecep; @@ -12526,20 +12922,21 @@ rightcard: context._sub(context.data.word(kCard1money), 8300); context.data.byte(kCardpassflag) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } alreadyusedit: context.cx = 300; context.al = 26; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notyetrecep: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecashcard(Context & context) { + uint stack_depth = context.stack.size(); getridofreels(context); loadkeypad(context); createpanel(context); @@ -12588,10 +12985,11 @@ void usecashcard(Context & context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void lookatcard(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kManisoffscreen) = 1; getridofreels(context); loadkeypad(context); @@ -12639,10 +13037,11 @@ void lookatcard(Context & context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void moneypoke(Context & context) { + uint stack_depth = context.stack.size(); context.bx = 3385; context.cl = 48-1; numberpoke0: @@ -12678,14 +13077,15 @@ numberpoke3: context.bx = 3390; context._add(context.al, 48); context.cs.byte(context.bx) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void usecontrol(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotcontrolwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12716,7 +13116,7 @@ gotcontrolwith: balls: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } rightkey: context.al = 16; playchannel1(context); @@ -12730,7 +13130,7 @@ rightkey: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } goingdown: context.cx = 300; context.al = 3; @@ -12740,7 +13140,7 @@ goingdown: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } jimmycontrols: context.al = 50; placesetobject(context); @@ -12761,28 +13161,30 @@ jimmycontrols: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); context._inc(context.data.byte(kProgresspoints)); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usehatch(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kNewlocation) = 40; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usewire(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotwirewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12804,13 +13206,13 @@ gotwirewith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } wireaxe: context.cx = 300; context.al = 16; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } wireknife: context.al = 51; removesetobject(context); @@ -12821,10 +13223,11 @@ wireknife: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usehandle(Context & context) { + uint stack_depth = context.stack.size(); context.al = 'C'; context.ah = 'U'; context.cl = 'T'; @@ -12837,34 +13240,37 @@ void usehandle(Context & context) { context.al = 12; showpuztext(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } havecutwire: context.cx = 300; context.al = 13; showpuztext(context); context.data.byte(kNewlocation) = 22; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useelevator1(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); selectlocation(context); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void showfirstuse(Context & context) { + uint stack_depth = context.stack.size(); getobtextstart(context); findnextcolon(context); findnextcolon(context); usetext(context); context.cx = 400; hangonp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useelevator3(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.byte(kCounttoclose) = 20; context.data.byte(kNewlocation) = 34; @@ -12874,10 +13280,11 @@ void useelevator3(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useelevator4(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.word(kReeltowatch) = 0; context.data.word(kEndwatchreel) = 11; @@ -12887,10 +13294,11 @@ void useelevator4(Context & context) { context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; context.data.byte(kNewlocation) = 24; - return; + {assert(stack_depth == context.stack.size()); return; } } void useelevator2(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); @@ -12899,7 +13307,7 @@ void useelevator2(Context & context) { context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } inpoolhall: showfirstuse(context); context.data.byte(kNewlocation) = 31; @@ -12907,10 +13315,11 @@ inpoolhall: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void useelevator5(Context & context) { + uint stack_depth = context.stack.size(); context.al = 4; placesetobject(context); context.al = 0; @@ -12920,10 +13329,11 @@ void useelevator5(Context & context) { context.data.byte(kLiftflag) = 1; context.data.byte(kCounttoclose) = 8; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usekey(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 5); if (context.flags.z()) goto usekey1; context._cmp(context.data.byte(kLocation), 30); @@ -12934,7 +13344,7 @@ void usekey(Context & context) { context.al = 1; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } usekey1: context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto wrongroom1; @@ -12945,7 +13355,7 @@ usekey1: showpuztext(context); context.data.byte(kCounttoclose) = 100; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } usekey2: context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto wrongroom1; @@ -12959,23 +13369,24 @@ usekey2: fadescreendown(context); showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } wrongroom1: context.cx = 200; context.al = 2; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usestereo(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } stereook: context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto stereonotok; @@ -12986,7 +13397,7 @@ stereonotok: context.al = 5; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } stereook2: context.al = 'C'; context.ah = 'D'; @@ -13004,7 +13415,7 @@ stereook2: getanyad(context); context.al = 255; context.es.byte(context.bx+10) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } cdinside: getanyad(context); context.al = context.es.byte(context.bx+10); @@ -13016,16 +13427,17 @@ cdinside: context.cx = 400; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } stereoon: context.al = 8; context.cx = 400; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecooker(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); checkinside(context); @@ -13033,14 +13445,15 @@ void usecooker(Context & context) { if (!context.flags.z()) goto foodinside; showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } foodinside: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useaxe(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpool; context._cmp(context.data.byte(kMapy), 10); @@ -13050,10 +13463,10 @@ void useaxe(Context & context) { context.data.byte(kLastweapon) = 2; context.data.byte(kGetback) = 1; removeobfrominv(context); - return; + {assert(stack_depth == context.stack.size()); return; } notinpool: showfirstuse(context); - return; + {assert(stack_depth == context.stack.size()); return; } /*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ axeondoor: context.al = 15; @@ -13066,15 +13479,16 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; - return; + {assert(stack_depth == context.stack.size()); return; } + {assert(stack_depth == context.stack.size()); return; } } void useelvdoor(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gotdoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -13088,7 +13502,7 @@ gotdoorwith: context.cx = 300; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } axeondoor: context.al = 15; context.cx = 300; @@ -13100,10 +13514,11 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void withwhat(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); showpanel(context); showman(context); @@ -13142,16 +13557,17 @@ void withwhat(Context & context) { worktoscreen(context); delpointer(context); context.data.byte(kInvopen) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } } void selectob(Context & context) { + uint stack_depth = context.stack.size(); findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canselectob; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canselectob: context.data.byte(kWithobject) = context.al; context.data.byte(kWithtype) = context.ah; @@ -13172,15 +13588,16 @@ alreadyselob: context._and(context.ax, 1); if (!context.flags.z()) goto doselob; notselob: - return; + {assert(stack_depth == context.stack.size()); return; } doselob: delpointer(context); context.data.byte(kInvopen) = 0; useroutine(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void compare(Context & context) { + uint stack_depth = context.stack.size(); context._sub(context.dl, 'A'); context._sub(context.dh, 'A'); context._sub(context.cl, 'A'); @@ -13194,10 +13611,11 @@ void compare(Context & context) { if (!context.flags.z()) goto comparefin; context._cmp(context.es.word(context.bx+14), context.dx); comparefin: - return; + {assert(stack_depth == context.stack.size()); return; } } void findsetobject(Context & context) { + uint stack_depth = context.stack.size(); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13215,17 +13633,18 @@ findsetloop: context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofind; context.al = context.dl; - return; + {assert(stack_depth == context.stack.size()); return; } nofind: context._add(context.bx, 64); context._inc(context.dl); context._cmp(context.dl, 128); if (!context.flags.z()) goto findsetloop; context.al = context.dl; - return; + {assert(stack_depth == context.stack.size()); return; } } void findexobject(Context & context) { + uint stack_depth = context.stack.size(); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13243,17 +13662,18 @@ findexloop: context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofindex; context.al = context.dl; - return; + {assert(stack_depth == context.stack.size()); return; } nofindex: context._add(context.bx, 16); context._inc(context.dl); context._cmp(context.dl, (114)); if (!context.flags.z()) goto findexloop; context.al = context.dl; - return; + {assert(stack_depth == context.stack.size()); return; } } void isryanholding(Context & context) { + uint stack_depth = context.stack.size(); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13274,7 +13694,7 @@ searchinv: if (!context.flags.z()) goto nofindininv; context.al = context.dl; context._cmp(context.al, (114)); - return; + {assert(stack_depth == context.stack.size()); return; } nofindininv: context._add(context.bx, 16); context._inc(context.dl); @@ -13282,10 +13702,11 @@ nofindininv: if (!context.flags.z()) goto searchinv; context.al = context.dl; context._cmp(context.al, (114)); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkinside(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kExtras); context.bx = (0+2080+30000); context.cl = 0; @@ -13294,16 +13715,17 @@ insideloop: if (!context.flags.z()) goto notfoundinside; context._cmp(context.ah, context.es.byte(context.bx+2)); if (!context.flags.z()) goto notfoundinside; - return; + {assert(stack_depth == context.stack.size()); return; } notfoundinside: context._add(context.bx, 16); context._inc(context.cl); context._cmp(context.cl, (114)); if (!context.flags.z()) goto insideloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void usetext(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.si); createpanel(context); @@ -13320,10 +13742,11 @@ void usetext(Context & context) { context.ah = 0; printdirect(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void putbackobstuff(Context & context) { + uint stack_depth = context.stack.size(); createpanel(context); showpanel(context); showman(context); @@ -13337,10 +13760,11 @@ void putbackobstuff(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showpuztext(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); findpuztext(context); context.push(context.es); @@ -13360,10 +13784,11 @@ void showpuztext(Context & context) { worktoscreenm(context); context.cx = context.pop(); hangonp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void findpuztext(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -13371,10 +13796,11 @@ void findpuztext(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void placesetobject(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13384,10 +13810,11 @@ void placesetobject(Context & context) { context.es.byte(context.bx+58) = 0; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void removesetobject(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.cl = 255; @@ -13397,10 +13824,11 @@ void removesetobject(Context & context) { context.es.byte(context.bx+58) = 255; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void issetobonmap(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); getsetad(context); @@ -13408,10 +13836,11 @@ void issetobonmap(Context & context) { context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, 0); - return; + {assert(stack_depth == context.stack.size()); return; } } void placefreeobject(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13421,20 +13850,22 @@ void placefreeobject(Context & context) { context.es.byte(context.bx+2) = 0; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void removefreeobject(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.bx); getfreead(context); context.es.byte(context.bx+2) = 255; context.bx = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void findormake(Context & context) { + uint stack_depth = context.stack.size(); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); context.push(context.ax); context.es = context.data.word(kBuffers); @@ -13452,25 +13883,28 @@ nofoundchange: foundchange: context.ax = context.pop(); context.es.byte(context.bx+2) = context.cl; - return; + {assert(stack_depth == context.stack.size()); return; } haventfound: context.es.word(context.bx) = context.ax; context.es.word(context.bx+2) = context.cx; context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void switchryanon(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kRyanon) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void switchryanoff(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kRyanon) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void setallchanges(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); setallloop: @@ -13488,10 +13922,11 @@ setallloop: context.es = context.pop(); goto setallloop; endsetloop: - return; + {assert(stack_depth == context.stack.size()); return; } } void dochange(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ch, 0); if (context.flags.z()) goto object; context._cmp(context.ch, 1); @@ -13515,13 +13950,13 @@ path: context.cx = context.pop(); context.es.byte(context.bx+6) = context.cl; nopath: - return; + {assert(stack_depth == context.stack.size()); return; } object: context.push(context.cx); getsetad(context); context.cx = context.pop(); context.es.byte(context.bx+58) = context.cl; - return; + {assert(stack_depth == context.stack.size()); return; } freeobject: context.push(context.cx); getfreead(context); @@ -13530,10 +13965,11 @@ freeobject: if (!context.flags.z()) goto beenpickedup; context.es.byte(context.bx+2) = context.cl; beenpickedup: - return; + {assert(stack_depth == context.stack.size()); return; } } void autoappear(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notinalley; context.al = 5; @@ -13541,7 +13977,7 @@ void autoappear(Context & context) { context.al = 10; setlocation(context); context.data.byte(kDestpos) = 10; - return; + {assert(stack_depth == context.stack.size()); return; } notinalley: context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedens; @@ -13564,7 +14000,7 @@ notinalley: removesetobject(context); context.al = 85; removesetobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } edenspart2: context._cmp(context.data.byte(kSartaindead), 1); if (!context.flags.z()) goto notedens2; @@ -13576,7 +14012,7 @@ edenspart2: placesetobject(context); context._inc(context.data.byte(kSartaindead)); notedens2: - return; + {assert(stack_depth == context.stack.size()); return; } notinedens: context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto notonsartroof; @@ -13586,7 +14022,7 @@ notinedens: context.al = 11; setlocation(context); context.data.byte(kDestpos) = 11; - return; + {assert(stack_depth == context.stack.size()); return; } notonsartroof: context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notinlouiss; @@ -13595,10 +14031,11 @@ notonsartroof: context.al = 23; placesetobject(context); notinlouiss: - return; + {assert(stack_depth == context.stack.size()); return; } } void getundertimed(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -13610,10 +14047,11 @@ void getundertimed(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void putundertimed(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -13625,10 +14063,11 @@ void putundertimed(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumptimedtext(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) goto nodumptimed; context.al = context.data.byte(kTimedy); @@ -13642,10 +14081,11 @@ void dumptimedtext(Context & context) { multidump(context); context.data.byte(kNeedtodumptimed) = 0; nodumptimed: - return; + {assert(stack_depth == context.stack.size()); return; } } void setuptimeduse(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup; context.data.byte(kTimedy) = context.bh; @@ -13664,10 +14104,11 @@ void setuptimeduse(Context & context) { context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; cantsetup: - return; + {assert(stack_depth == context.stack.size()); return; } } void setuptimedtemp(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup2; context.data.byte(kTimedy) = context.bh; @@ -13686,10 +14127,11 @@ void setuptimedtemp(Context & context) { context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; cantsetup2: - return; + {assert(stack_depth == context.stack.size()); return; } } void usetimedtext(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto notext; context._dec(context.data.word(kTimecount)); @@ -13715,14 +14157,15 @@ notfirsttimed: printdirect(context); context.data.byte(kNeedtodumptimed) = 1; notext: - return; + {assert(stack_depth == context.stack.size()); return; } deltimedtext: putundertimed(context); context.data.byte(kNeedtodumptimed) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void edenscdplayer(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context.data.word(kWatchingtime) = 18*2; context.data.word(kReeltowatch) = 25; @@ -13730,10 +14173,11 @@ void edenscdplayer(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void usewall(Context & context) { + uint stack_depth = context.stack.size(); showfirstuse(context); context._cmp(context.data.byte(kManspath), 3); if (context.flags.z()) goto gobackover; @@ -13760,7 +14204,7 @@ void usewall(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } gobackover: context.data.word(kWatchingtime) = 30*2; context.data.word(kReeltowatch) = 34; @@ -13785,14 +14229,15 @@ gobackover: findxyfrompath(context); context.data.byte(kResetmanxy) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usechurchgate(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gatewith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } gatewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -13806,7 +14251,7 @@ gatewith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } cutgate: showfirstuse(context); context.data.word(kWatchingtime) = 64*2; @@ -13823,15 +14268,16 @@ cutgate: context.al = 2; turnpathon(context); notopenchurch: - return; + {assert(stack_depth == context.stack.size()); return; } } void usegun(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } istakengun: context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpoolroom; @@ -13842,7 +14288,7 @@ istakengun: context.data.byte(kCombatcount) = 39; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } notinpoolroom: context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto nothelicopter; @@ -13856,7 +14302,7 @@ notinpoolroom: context.data.byte(kRoomafterdream) = 38; context.data.byte(kSartaindead) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } nothelicopter: context._cmp(context.data.byte(kReallocation), 27); if (!context.flags.z()) goto notinrockroom; @@ -13871,7 +14317,7 @@ nothelicopter: context.data.byte(kRoomafterdream) = 32; context.data.byte(kDreamnumber) = 0; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } notinrockroom: context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto notbystudio; @@ -13890,7 +14336,7 @@ notinrockroom: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } notbystudio: context._cmp(context.data.byte(kReallocation), 6); if (!context.flags.z()) goto notsarters; @@ -13920,7 +14366,7 @@ notbystudio: context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } notsarters: context._cmp(context.data.byte(kReallocation), 29); if (!context.flags.z()) goto notaide; @@ -13942,7 +14388,7 @@ notsarters: context.data.byte(kDreamnumber) = 3; context.data.byte(kRoomafterdream) = 33; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } notaide: context._cmp(context.data.byte(kReallocation), 23); if (!context.flags.z()) goto notwithboss; @@ -13958,7 +14404,7 @@ notaide: pathokboss: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notwithboss: context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto nottvsoldier; @@ -13974,14 +14420,15 @@ notwithboss: pathoktv: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } nottvsoldier: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useshield(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 20); if (!context.flags.z()) goto notinsartroom; context._cmp(context.data.byte(kCombatcount), 0); @@ -13991,14 +14438,15 @@ void useshield(Context & context) { context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); removeobfrominv(context); - return; + {assert(stack_depth == context.stack.size()); return; } notinsartroom: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usebuttona(Context & context) { + uint stack_depth = context.stack.size(); context.al = 95; issetobonmap(context); if (context.flags.z()) goto donethisbit; @@ -14018,18 +14466,19 @@ void usebuttona(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } donethisbit: showseconduse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void useplate(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto platewith; withwhat(context); - return; + {assert(stack_depth == context.stack.size()); return; } platewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -14051,7 +14500,7 @@ platewith: context.al = 14; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } unscrewplate: context.al = 20; playchannel1(context); @@ -14066,16 +14515,17 @@ unscrewplate: placefreeobject(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } triedknife: context.cx = 300; context.al = 54; showpuztext(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usewinch(Context & context) { + uint stack_depth = context.stack.size(); context.al = 40; context.ah = 1; checkinside(context); @@ -14102,14 +14552,15 @@ void usewinch(Context & context) { context.data.byte(kNewsitem) = 2; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - return; + {assert(stack_depth == context.stack.size()); return; } nowinch: showfirstuse(context); putbackobstuff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void entercode(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kKeypadax) = context.ax; context.data.word(kKeypadcx) = context.cx; getridofreels(context); @@ -14178,16 +14629,18 @@ numberright: restorereels(context); redrawmainscrn(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadkeypad(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 1948; loadintotemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void quitkey(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyqk; context.data.byte(kCommandtype) = 222; @@ -14200,13 +14653,14 @@ alreadyqk: context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: - return; + {assert(stack_depth == context.stack.size()); return; } doqk: context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void addtopresslist(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kPresspointer), 5); if (context.flags.z()) goto nomorekeys; context.al = context.data.byte(kPressed); @@ -14221,76 +14675,88 @@ not10: context.es.byte(context.bx) = context.al; context._inc(context.data.word(kPresspointer)); nomorekeys: - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonone(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 1; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttontwo(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 2; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonthree(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 3; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonfour(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 4; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonfive(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 5; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonsix(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 6; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonseven(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 7; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttoneight(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 8; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonnine(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 9; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonnought(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 10; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonenter(Context & context) { + uint stack_depth = context.stack.size(); context.cl = 11; buttonpress(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void buttonpress(Context & context) { + uint stack_depth = context.stack.size(); context.ch = context.cl; context._add(context.ch, 100); context._cmp(context.data.byte(kCommandtype), context.ch); @@ -14308,7 +14774,7 @@ alreadyb: context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: - return; + {assert(stack_depth == context.stack.size()); return; } dob: context.data.byte(kPressed) = context.cl; context._add(context.cl, 21); @@ -14319,10 +14785,11 @@ dob: context.al = 10; playchannel1(context); nonoise: - return; + {assert(stack_depth == context.stack.size()); return; } } void showouterpad(Context & context) { + uint stack_depth = context.stack.size(); context.di = (36+112)-3; context.bx = (72)-4; context.ds = context.data.word(kTempgraphics); @@ -14335,10 +14802,11 @@ void showouterpad(Context & context) { context.al = 37; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showkeypad(Context & context) { + uint stack_depth = context.stack.size(); context.al = 22; context.di = (36+112)+9; context.bx = (72)+5; @@ -14404,10 +14872,11 @@ gotlight: context.di = (36+112)+60; showframe(context); notenter: - return; + {assert(stack_depth == context.stack.size()); return; } } void singlekey(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kGraphicpress), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); @@ -14419,19 +14888,21 @@ gotkey: context._sub(context.al, 20); context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpkeypad(Context & context) { + uint stack_depth = context.stack.size(); context.di = (36+112)-3; context.bx = (72)-4; context.cl = 120; context.ch = 90; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usemenu(Context & context) { + uint stack_depth = context.stack.size(); getridofreels(context); loadmenu(context); createpanel(context); @@ -14475,21 +14946,23 @@ menuloop: getridoftemp2(context); restorereels(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } menulist: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpmenu(Context & context) { + uint stack_depth = context.stack.size(); context.di = (80+40); context.bx = (60); context.cl = 48; context.ch = 48; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getundermenu(Context & context) { + uint stack_depth = context.stack.size(); context.di = (80+40); context.bx = (60); context.cl = 48; @@ -14497,10 +14970,11 @@ void getundermenu(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void putundermenu(Context & context) { + uint stack_depth = context.stack.size(); context.di = (80+40); context.bx = (60); context.cl = 48; @@ -14508,10 +14982,11 @@ void putundermenu(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showoutermenu(Context & context) { + uint stack_depth = context.stack.size(); context.al = 40; context.ah = 0; context.di = (80+40)-34; @@ -14536,10 +15011,11 @@ void showoutermenu(Context & context) { context.bx = (60)+57-40; context.ds = context.data.word(kTempgraphics); showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showmenu(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.data.byte(kMenucount)); context._cmp(context.data.byte(kMenucount), 37*2); if (!context.flags.z()) goto menuframeok; @@ -14552,18 +15028,20 @@ menuframeok: context.bx = (60); context.ds = context.data.word(kTempgraphics); showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadmenu(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 1832; loadintotemp(context); context.dx = 1987; loadintotemp2(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void viewfolder(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kManisoffscreen) = 1; getridofall(context); loadfolder(context); @@ -14590,14 +15068,15 @@ folderloop: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void nextfolder(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kFolderpage), 12); if (!context.flags.z()) goto cannextf; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } cannextf: context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadynextf; @@ -14611,7 +15090,7 @@ alreadynextf: context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: - return; + {assert(stack_depth == context.stack.size()); return; } donextf: context._inc(context.data.byte(kFolderpage)); folderhints(context); @@ -14621,10 +15100,11 @@ donextf: context.bx = 3547; checkcoords(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void folderhints(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kFolderpage), 5); if (!context.flags.z()) goto notaideadd; context._cmp(context.data.byte(kAidedead), 1); @@ -14646,7 +15126,7 @@ void folderhints(Context & context) { worktoscreenm(context); context.cx = 200; hangonp(context); - return; + {assert(stack_depth == context.stack.size()); return; } notaideadd: context._cmp(context.data.byte(kFolderpage), 9); if (!context.flags.z()) goto notaristoadd; @@ -14668,14 +15148,15 @@ notaideadd: context.cx = 200; hangonp(context); notaristoadd: - return; + {assert(stack_depth == context.stack.size()); return; } } void lastfolder(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kFolderpage), 0); if (!context.flags.z()) goto canlastf; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } canlastf: context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadylastf; @@ -14691,7 +15172,7 @@ alreadylastf: context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: - return; + {assert(stack_depth == context.stack.size()); return; } dolastf: context._dec(context.data.byte(kFolderpage)); delpointer(context); @@ -14700,10 +15181,11 @@ dolastf: context.bx = 3547; checkcoords(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadfolder(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2299; loadintotemp(context); context.dx = 2312; @@ -14714,10 +15196,11 @@ void loadfolder(Context & context) { loadtempcharset(context); context.dx = 2195; loadtemptext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showfolder(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCommandtype) = 255; context._cmp(context.data.byte(kFolderpage), 0); if (context.flags.z()) goto closedfolder; @@ -14758,7 +15241,7 @@ noleftpage: norightpage: usecharset1(context); undertextline(context); - return; + {assert(stack_depth == context.stack.size()); return; } closedfolder: createpanel2(context); context.ds = context.data.word(kTempgraphics3); @@ -14775,20 +15258,22 @@ closedfolder: showframe(context); folderexit(context); undertextline(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void folderexit(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics2); context.di = 296; context.bx = 178; context.al = 6; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showleftpage(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics2); context.di = 0; context.bx = 12; @@ -14866,10 +15351,11 @@ flipfolderline: context._add(context.si, 320); context._add(context.di, 320); if (--context.cx) goto flipfolder; - return; + {assert(stack_depth == context.stack.size()); return; } } void showrightpage(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics2); context.di = 143; context.bx = 12; @@ -14920,10 +15406,11 @@ contrightpage: if (--context.cx) goto twolotsright; context.data.byte(kKerning) = 0; context.data.word(kLinespacing) = 10; - return; + {assert(stack_depth == context.stack.size()); return; } } void entersymbol(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kManisoffscreen) = 1; getridofreels(context); context.dx = 2338; @@ -14971,7 +15458,7 @@ symbolloop: worktoscreenm(context); context.al = 13; playchannel1(context); - return; + {assert(stack_depth == context.stack.size()); return; } symbolwrong: context.al = 46; removesetobject(context); @@ -14986,10 +15473,11 @@ symbolwrong: getridoftemp(context); restorereels(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void quitsymbol(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kSymbolbotx), 24); @@ -15006,13 +15494,14 @@ alreadyqs: context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: - return; + {assert(stack_depth == context.stack.size()); return; } doqs: context.data.byte(kGetback) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void settopleft(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 210); @@ -15025,10 +15514,11 @@ alreadytopl: if (context.flags.z()) goto notopleft; context.data.byte(kSymboltopdir) = -1; notopleft: - return; + {assert(stack_depth == context.stack.size()); return; } } void settopright(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 211); @@ -15041,10 +15531,11 @@ alreadytopr: if (context.flags.z()) goto notopright; context.data.byte(kSymboltopdir) = 1; notopright: - return; + {assert(stack_depth == context.stack.size()); return; } } void setbotleft(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 212); @@ -15057,10 +15548,11 @@ alreadybotl: if (context.flags.z()) goto nobotleft; context.data.byte(kSymbolbotdir) = -1; nobotleft: - return; + {assert(stack_depth == context.stack.size()); return; } } void setbotright(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 213); @@ -15073,20 +15565,22 @@ alreadybotr: if (context.flags.z()) goto nobotright; context.data.byte(kSymbolbotdir) = 1; nobotright: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpsymbol(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kNewtextline) = 0; context.di = (64); context.bx = (56)+20; context.cl = 104; context.ch = 60; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showsymbol(Context & context) { + uint stack_depth = context.stack.size(); context.al = 12; context.ah = 0; context.di = (64); @@ -15156,25 +15650,27 @@ void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void nextsymbol(Context & context) { + uint stack_depth = context.stack.size(); context._inc(context.al); context._cmp(context.al, 6); if (context.flags.z()) goto topwrap; context._cmp(context.al, 12); if (context.flags.z()) goto botwrap; - return; + {assert(stack_depth == context.stack.size()); return; } topwrap: context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } botwrap: context.al = 6; - return; + {assert(stack_depth == context.stack.size()); return; } } void updatesymboltop(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymboltopdir), 0); if (context.flags.z()) goto topfinished; context._cmp(context.data.byte(kSymboltopdir), -1); @@ -15187,12 +15683,12 @@ void updatesymboltop(Context & context) { context._cmp(context.data.byte(kSymboltopnum), -1); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 5; - return; + {assert(stack_depth == context.stack.size()); return; } notwrapfor: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopdir) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } backwards: context._dec(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), -1); @@ -15202,16 +15698,17 @@ backwards: context._cmp(context.data.byte(kSymboltopnum), 6); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } notwrapback: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopdir) = 0; topfinished: - return; + {assert(stack_depth == context.stack.size()); return; } } void updatesymbolbot(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSymbolbotdir), 0); if (context.flags.z()) goto botfinished; context._cmp(context.data.byte(kSymbolbotdir), -1); @@ -15224,12 +15721,12 @@ void updatesymbolbot(Context & context) { context._cmp(context.data.byte(kSymbolbotnum), -1); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 5; - return; + {assert(stack_depth == context.stack.size()); return; } notwrapforb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotdir) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } backwardsbot: context._dec(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), -1); @@ -15239,16 +15736,17 @@ backwardsbot: context._cmp(context.data.byte(kSymbolbotnum), 6); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } notwrapbackb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotdir) = 0; botfinished: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpsymbox(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kDumpx), -1); if (context.flags.z()) goto nodumpsym; context.di = context.data.word(kDumpx); @@ -15258,10 +15756,11 @@ void dumpsymbox(Context & context) { multidump(context); context.data.word(kDumpx) = -1; nodumpsym: - return; + {assert(stack_depth == context.stack.size()); return; } } void usediary(Context & context) { + uint stack_depth = context.stack.size(); getridofreels(context); context.dx = 2039; loadintotemp(context); @@ -15299,12 +15798,13 @@ diaryloop: context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } diarylist: - return; + {assert(stack_depth == context.stack.size()); return; } } void showdiary(Context & context) { + uint stack_depth = context.stack.size(); context.al = 1; context.ah = 0; context.di = (68+24); @@ -15317,10 +15817,11 @@ void showdiary(Context & context) { context.bx = (48+12)+108; context.ds = context.data.word(kTempgraphics); showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showdiarykeys(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; context._dec(context.data.byte(kPresscount)); @@ -15342,7 +15843,7 @@ gotkeyn: if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: - return; + {assert(stack_depth == context.stack.size()); return; } nokeyn: context.al = 5; context._cmp(context.data.byte(kPresscount), 1); @@ -15358,12 +15859,13 @@ gotkeyp: if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: - return; + {assert(stack_depth == context.stack.size()); return; } nokeyatall: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpdiarykeys(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notdumpdiary; context._cmp(context.data.byte(kSartaindead), 1); @@ -15395,7 +15897,7 @@ void dumpdiarykeys(Context & context) { showdiarypage(context); worktoscreenm(context); showpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } notsartadd: context.di = (68+24)+48; context.bx = (48+12)+15; @@ -15413,10 +15915,11 @@ notdumpdiary: context.cl = 16; context.ch = 16; multidump(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void diarykeyp(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 214); if (context.flags.z()) goto alreadykeyp; context.data.byte(kCommandtype) = 214; @@ -15439,10 +15942,11 @@ alreadykeyp: if (!context.flags.z()) goto notkeyp; context.data.byte(kDiarypage) = 11; notkeyp: - return; + {assert(stack_depth == context.stack.size()); return; } } void diarykeyn(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 213); if (context.flags.z()) goto alreadykeyn; context.data.byte(kCommandtype) = 213; @@ -15465,10 +15969,11 @@ alreadykeyn: if (!context.flags.z()) goto notkeyn; context.data.byte(kDiarypage) = 0; notkeyn: - return; + {assert(stack_depth == context.stack.size()); return; } } void showdiarypage(Context & context) { + uint stack_depth = context.stack.size(); context.al = 0; context.ah = 0; context.di = (68+24); @@ -15498,10 +16003,11 @@ void showdiarypage(Context & context) { context.data.byte(kKerning) = 0; context.data.word(kCharshift) = 0; usecharset1(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void findtext1(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -15509,10 +16015,11 @@ void findtext1(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void zoomonoff(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -15529,7 +16036,7 @@ alreadyonoff: context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: - return; + {assert(stack_depth == context.stack.size()); return; } dozoomonoff: context.al = context.data.byte(kZoomon); context._xor(context.al, 1); @@ -15546,10 +16053,11 @@ dozoomonoff: commandonly(context); readmouse(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void saveload(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -15567,10 +16075,11 @@ alreadyops: if (context.flags.z()) goto noops; dosaveload(context); noops: - return; + {assert(stack_depth == context.stack.size()); return; } } void dosaveload(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kPointerframe) = 0; context.data.word(kTextaddressx) = 70; context.data.word(kTextaddressy) = 182-8; @@ -15616,20 +16125,22 @@ waitops: context.data.byte(kCommandtype) = 200; justret: context.data.byte(kManisoffscreen) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void getbackfromops(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kMandead), 2); if (context.flags.z()) goto opsblock1; getback1(context); - return; + {assert(stack_depth == context.stack.size()); return; } opsblock1: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showmainops(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics); context.di = (60)+10; context.bx = (52)+10; @@ -15648,10 +16159,11 @@ void showmainops(Context & context) { context.al = 1; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showdiscops(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -15676,16 +16188,18 @@ void showdiscops(Context & context) { context.al = 5; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadsavebox(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 1961; loadintotemp(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadgame(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 246); if (context.flags.z()) goto alreadyload; context.data.byte(kCommandtype) = 246; @@ -15698,7 +16212,7 @@ alreadyload: context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: - return; + {assert(stack_depth == context.stack.size()); return; } doload: context.data.byte(kLoadingorsave) = 1; showopbox(context); @@ -15741,10 +16255,11 @@ loadops: worktoscreen(context); context.data.byte(kGetback) = 4; quitloaded: - return; + {assert(stack_depth == context.stack.size()); return; } } void getbacktoops(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadygetops; context.data.byte(kCommandtype) = 201; @@ -15757,14 +16272,15 @@ alreadygetops: context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; nogetbackops: - return; + {assert(stack_depth == context.stack.size()); return; } dogetbackops: oldtonames(context); context.data.byte(kGetback) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } } void discops(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadydiscops; context.data.byte(kCommandtype) = 249; @@ -15777,7 +16293,7 @@ alreadydiscops: context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; nodiscops: - return; + {assert(stack_depth == context.stack.size()); return; } dodiscops: scanfornames(context); context.data.byte(kLoadingorsave) = 2; @@ -15797,14 +16313,15 @@ discopsloop: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto discopsloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void savegame(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kMandead), 2); if (!context.flags.z()) goto cansaveok; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } cansaveok: context._cmp(context.data.byte(kCommandtype), 247); if (context.flags.z()) goto alreadysave; @@ -15815,7 +16332,7 @@ alreadysave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; - return; + {assert(stack_depth == context.stack.size()); return; } dosave: context.data.byte(kLoadingorsave) = 2; showopbox(context); @@ -15840,10 +16357,11 @@ saveops: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto saveops; - return; + {assert(stack_depth == context.stack.size()); return; } } void actualsave(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyactsave; context.data.byte(kCommandtype) = 222; @@ -15900,10 +16418,11 @@ alreadyactsave: worktoscreenm(context); context.data.byte(kGetback) = 4; noactsave: - return; + {assert(stack_depth == context.stack.size()); return; } } void actualload(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadyactload; context.data.byte(kCommandtype) = 221; @@ -15929,19 +16448,21 @@ alreadyactload: loadposition(context); context.data.byte(kGetback) = 1; notactload: - return; + {assert(stack_depth == context.stack.size()); return; } } void selectslot2(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto noselslot2; context.data.byte(kLoadingorsave) = 2; noselslot2: selectslot(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkinput(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLoadingorsave), 3); if (context.flags.z()) goto nokeypress; readkey(context); @@ -15974,17 +16495,18 @@ spacepress: context.es.byte(context.bx+3) = 1; goto afterkey; nokeypress: - return; + {assert(stack_depth == context.stack.size()); return; } afterkey: showopbox(context); shownames(context); showslots(context); showsaveops(context); worktoscreenm(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getnamepos(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -15996,10 +16518,11 @@ void getnamepos(Context & context) { context.al = context.data.byte(kCursorpos); context.ah = 0; context._add(context.bx, context.ax); - return; + {assert(stack_depth == context.stack.size()); return; } } void showopbox(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics); context.di = (60); context.bx = (52); @@ -16012,10 +16535,11 @@ void showopbox(Context & context) { context.al = 4; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showloadops(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -16033,10 +16557,11 @@ void showloadops(Context & context) { context.al = 55; context.dl = 101; printmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showsaveops(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -16054,10 +16579,11 @@ void showsaveops(Context & context) { context.al = 54; context.dl = 101; printmessage(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void selectslot(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 244); if (context.flags.z()) goto alreadysel; context.data.byte(kCommandtype) = 244; @@ -16093,19 +16619,20 @@ getslotnum: showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } isloadmode: showloadops(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } noselslot: - return; + {assert(stack_depth == context.stack.size()); return; } } void showslots(Context & context) { + uint stack_depth = context.stack.size(); context.di = (60)+7; context.bx = (52)+8; context.al = 2; @@ -16133,10 +16660,11 @@ nomatchslot: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto slotloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void shownames(Context & context) { + uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; context.si = 8350+1; @@ -16199,30 +16727,33 @@ afterprintname: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto shownameloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void namestoold(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.cs; context.si = 8350; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void oldtonames(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.cs; context.di = 8350; context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void saveposition(Context & context) { + uint stack_depth = context.stack.size(); makeheader(context); context.al = context.data.byte(kCurrentslot); context.ah = 0; @@ -16270,10 +16801,11 @@ void saveposition(Context & context) { saveseg(context); fquit: closefile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadposition(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kTimecount) = 0; clearchanges(context); context.al = context.data.byte(kCurrentslot); @@ -16318,10 +16850,11 @@ void loadposition(Context & context) { context.dx = 534; loadseg(context); closefile(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void makeheader(Context & context) { + uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; context.di = 5912; @@ -16337,19 +16870,21 @@ void makeheader(Context & context) { storeit(context); context.ax = (991-534); storeit(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void storeit(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ax, 0); if (!context.flags.z()) goto isntblank; context._inc(context.ax); isntblank: context._stosw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void findlen(Context & context) { + uint stack_depth = context.stack.size(); context._dec(context.bx); context._add(context.bx, context.ax); nextone: @@ -16360,10 +16895,11 @@ nextone: context._cmp(context.ax, 0); if (!context.flags.z()) goto nextone; foundlen: - return; + {assert(stack_depth == context.stack.size()); return; } } void scanfornames(Context & context) { + uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; context.di = 8350; @@ -16408,10 +16944,11 @@ notexist: context._dec(context.cl); if (!context.flags.z()) goto scanloop; context.al = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } } void decide(Context & context) { + uint stack_depth = context.stack.size(); setmode(context); loadpalfromiff(context); clearpalette(context); @@ -16445,10 +16982,11 @@ hasloadedroom: context.data.word(kTextaddressx) = 13; context.data.word(kTextaddressy) = 182; context.data.byte(kTextlen) = 240; - return; + {assert(stack_depth == context.stack.size()); return; } } void showdecisions(Context & context) { + uint stack_depth = context.stack.size(); createpanel2(context); showopbox(context); context.ds = context.data.word(kTempgraphics); @@ -16458,10 +16996,11 @@ void showdecisions(Context & context) { context.ah = 0; showframe(context); undertextline(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void newgame(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 251); if (context.flags.z()) goto alreadynewgame; context.data.byte(kCommandtype) = 251; @@ -16473,10 +17012,11 @@ alreadynewgame: if (!context.flags.z()) goto nonewgame; context.data.byte(kGetback) = 3; nonewgame: - return; + {assert(stack_depth == context.stack.size()); return; } } void doload(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kLoadingorsave) = 1; showopbox(context); showloadops(context); @@ -16518,10 +17058,11 @@ loadops: worktoscreen(context); context.data.byte(kGetback) = 4; quitloaded: - return; + {assert(stack_depth == context.stack.size()); return; } } void loadold(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 252); if (context.flags.z()) goto alreadyloadold; context.data.byte(kCommandtype) = 252; @@ -16538,10 +17079,11 @@ alreadyloadold: worktoscreenm(context); context.data.byte(kGetback) = 0; noloadold: - return; + {assert(stack_depth == context.stack.size()); return; } } void createname(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.di = 4932; context.cs.byte(context.di+0) = context.dl; @@ -16579,10 +17121,11 @@ tensc: context.cs.byte(context.di+6) = context.cl; context._add(context.al, '0'); context.cs.byte(context.di+7) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void trysoundalloc(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) goto gotsoundbuff; context._inc(context.data.byte(kSoundtimes)); @@ -16606,15 +17149,16 @@ void trysoundalloc(Context & context) { context.ax = 0x7f7f; while(context.cx--) context._stosw(); context.data.byte(kNeedsoundbuff) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } soundfail: context.es = context.data.word(kSoundbuffer); deallocatemem(context); gotsoundbuff: - return; + {assert(stack_depth == context.stack.size()); return; } } void playchannel0(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); @@ -16659,10 +17203,11 @@ nosetloop: context.ds = context.pop(); context.es = context.pop(); dontbother4: - return; + {assert(stack_depth == context.stack.size()); return; } } void playchannel1(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother5; context._cmp(context.data.byte(kCh1playing), 7); @@ -16699,10 +17244,11 @@ notsecondbank1: context.ds = context.pop(); context.es = context.pop(); dontbother5: - return; + {assert(stack_depth == context.stack.size()); return; } } void makenextblock(Context & context) { + uint stack_depth = context.stack.size(); volumeadjust(context); loopchannel0(context); context._cmp(context.data.word(kCh1blockstocopy), 0); @@ -16712,7 +17258,7 @@ void makenextblock(Context & context) { context._dec(context.data.word(kCh0blockstocopy)); context._dec(context.data.word(kCh1blockstocopy)); bothchannels(context); - return; + {assert(stack_depth == context.stack.size()); return; } mightbeonlych1: context.data.byte(kCh0playing) = 255; context._cmp(context.data.word(kCh1blockstocopy), 0); @@ -16720,14 +17266,14 @@ mightbeonlych1: context._dec(context.data.word(kCh1blockstocopy)); channel1only(context); notch1only: - return; + {assert(stack_depth == context.stack.size()); return; } mightbeonlych0: context.data.byte(kCh1playing) = 255; context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto notch0only; context._dec(context.data.word(kCh0blockstocopy)); channel0only(context); - return; + {assert(stack_depth == context.stack.size()); return; } notch0only: context.es = context.data.word(kSoundbuffer); context.di = context.data.word(kSoundbufferwrite); @@ -16736,10 +17282,11 @@ notch0only: while(context.cx--) context._stosw(); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; - return; + {assert(stack_depth == context.stack.size()); return; } } void volumeadjust(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); if (context.flags.z()) goto volok; @@ -16751,14 +17298,15 @@ void volumeadjust(Context & context) { context.al = context.data.byte(kVolume); context._add(context.al, context.data.byte(kVolumedirection)); context.data.byte(kVolume) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } volfinish: context.data.byte(kVolumedirection) = 0; volok: - return; + {assert(stack_depth == context.stack.size()); return; } } void loopchannel0(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kCh0blockstocopy), 0); if (!context.flags.z()) goto notloop; context._cmp(context.data.byte(kCh0repeat), 0); @@ -16774,30 +17322,33 @@ endlessloop: context.ax = context.data.word(kCh0blockstocopy); context._add(context.ax, context.data.word(kCh0oldblockstocopy)); context.data.word(kCh0blockstocopy) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } notloop: - return; + {assert(stack_depth == context.stack.size()); return; } } void cancelch0(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCh0repeat) = 0; context.data.word(kCh0blockstocopy) = 0; context.data.byte(kCh0playing) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void cancelch1(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kCh1blockstocopy) = 0; context.data.byte(kCh1playing) = 255; - return; + {assert(stack_depth == context.stack.size()); return; } } void channel0tran(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(context.cx--) context._movsw(); - return; + {assert(stack_depth == context.stack.size()); return; } lowvolumetran: context.cx = 1024; context.bh = context.data.byte(kVolume); @@ -16811,10 +17362,11 @@ volloop: context.ah = context.es.byte(context.bx); context._stosw(); if (--context.cx) goto volloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void domix(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumemix; slow: @@ -16903,10 +17455,11 @@ nodistortv: context._stosb(); if (--context.cx) goto lowvolumemix; doneit: - return; + {assert(stack_depth == context.stack.size()); return; } } void entrytexts(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 21); if (!context.flags.z()) goto notloc15; context.al = 28; @@ -16915,7 +17468,7 @@ void entrytexts(Context & context) { context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notloc15: context._cmp(context.data.byte(kLocation), 30); if (!context.flags.z()) goto notloc43; @@ -16925,7 +17478,7 @@ notloc15: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notloc43: context._cmp(context.data.byte(kLocation), 23); if (!context.flags.z()) goto notloc23; @@ -16935,7 +17488,7 @@ notloc43: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notloc23: context._cmp(context.data.byte(kLocation), 31); if (!context.flags.z()) goto notloc44; @@ -16945,7 +17498,7 @@ notloc23: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notloc44: context._cmp(context.data.byte(kLocation), 20); if (!context.flags.z()) goto notsarters2; @@ -16955,7 +17508,7 @@ notloc44: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notsarters2: context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedenlob; @@ -16965,7 +17518,7 @@ notsarters2: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } notedenlob: context._cmp(context.data.byte(kLocation), 34); if (!context.flags.z()) goto noteden2; @@ -16975,12 +17528,13 @@ notedenlob: context.bl = 68; context.bh = 64; setuptimeduse(context); - return; + {assert(stack_depth == context.stack.size()); return; } noteden2: - return; + {assert(stack_depth == context.stack.size()); return; } } void entryanims(Context & context) { + uint stack_depth = context.stack.size(); context.data.word(kReeltowatch) = -1; context.data.byte(kWatchmode) = -1; context._cmp(context.data.byte(kLocation), 33); @@ -16991,7 +17545,7 @@ void entryanims(Context & context) { context.data.word(kEndwatchreel) = 76; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notinthebeach: context._cmp(context.data.byte(kLocation), 44); if (!context.flags.z()) goto notsparkys; @@ -17003,7 +17557,7 @@ notinthebeach: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notsparkys: context._cmp(context.data.byte(kLocation), 22); if (!context.flags.z()) goto notinthelift; @@ -17013,13 +17567,13 @@ notsparkys: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notinthelift: context._cmp(context.data.byte(kLocation), 26); if (!context.flags.z()) goto notunderchurch; context.data.byte(kSymboltopnum) = 2; context.data.byte(kSymbolbotnum) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } notunderchurch: context._cmp(context.data.byte(kLocation), 45); if (!context.flags.z()) goto notenterdream; @@ -17030,7 +17584,7 @@ notunderchurch: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notenterdream: context._cmp(context.data.byte(kReallocation), 46); if (!context.flags.z()) goto notcrystal; @@ -17038,7 +17592,7 @@ notenterdream: if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } notcrystal: context._cmp(context.data.byte(kLocation), 9); if (!context.flags.z()) goto nottopchurch; @@ -17057,7 +17611,7 @@ makedoorsopen: removesetobject(context); context.al = 5; placesetobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } nottopchurch: context._cmp(context.data.byte(kLocation), 47); if (!context.flags.z()) goto notdreamcentre; @@ -17065,7 +17619,7 @@ nottopchurch: placesetobject(context); context.al = 5; placesetobject(context); - return; + {assert(stack_depth == context.stack.size()); return; } notdreamcentre: context._cmp(context.data.byte(kLocation), 38); if (!context.flags.z()) goto notcarpark; @@ -17075,7 +17629,7 @@ notdreamcentre: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notcarpark: context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notalley; @@ -17085,7 +17639,7 @@ notcarpark: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } notalley: context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedensagain; @@ -17094,13 +17648,14 @@ notalley: context._dec(context.ah); turnanypathon(context); notedensagain: - return; + {assert(stack_depth == context.stack.size()); return; } } void initialinv(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 24); if (context.flags.z()) goto isedens; - return; + {assert(stack_depth == context.stack.size()); return; } isedens: context.al = 11; context.ah = 5; @@ -17133,34 +17688,38 @@ isedens: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void pickupob(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kLastinvpos) = context.ah; context.data.byte(kObjecttype) = 2; context.data.byte(kItemframe) = context.al; context.data.byte(kCommand) = context.al; getanyad(context); transfertoex(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkforemm(Context & context) { - return; + uint stack_depth = context.stack.size(); + {assert(stack_depth == context.stack.size()); return; } } void checkbasemem(Context & context) { + uint stack_depth = context.stack.size(); context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; context.data.byte(kGameerror) = 5; { quickquit(context); return; }; enoughmem: - return; + {assert(stack_depth == context.stack.size()); return; } } void allocatebuffers(Context & context) { + uint stack_depth = context.stack.size(); context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; allocatemem(context); context.data.word(kExtras) = context.ax; @@ -17191,10 +17750,11 @@ void allocatebuffers(Context & context) { context.bx = 2048/16; allocatemem(context); context.data.word(kSounddata2) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void clearbuffers(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; context.ax = 0; @@ -17218,10 +17778,11 @@ void clearbuffers(Context & context) { context.cx = (68-0); while(context.cx--) context._movsb(); clearchanges(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearchanges(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.cx = (250)*2; context.ax = 0x0ffff; @@ -17259,30 +17820,33 @@ void clearchanges(Context & context) { context.ax = 0; context.cx = 6; while(context.cx--) context._stosw(); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearbeforeload(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRoomloaded), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); context.data.byte(kRoomloaded) = 0; noclear: - return; + {assert(stack_depth == context.stack.size()); return; } } void clearreels(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kReel1); deallocatemem(context); context.es = context.data.word(kReel2); deallocatemem(context); context.es = context.data.word(kReel3); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void clearrest(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kMapdata); context.cx = (66*60)/2; context.ax = 0; @@ -17306,10 +17870,11 @@ void clearrest(Context & context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void parseblaster(Context & context) { + uint stack_depth = context.stack.size(); lookattail: context.al = context.es.byte(context.bx); context._cmp(context.al, 0); @@ -17338,7 +17903,7 @@ lookattail: if (context.flags.z()) goto isdma; context._inc(context.bx); if (--context.cx) goto lookattail; - return; + {assert(stack_depth == context.stack.size()); return; } issoundint: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); @@ -17372,10 +17937,11 @@ isnosound: context._inc(context.bx); goto lookattail; endtail: - return; + {assert(stack_depth == context.stack.size()); return; } } void startup(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCurrentkey) = 0; context.data.byte(kMainmode) = 0; createpanel(context); @@ -17388,10 +17954,11 @@ void startup(Context & context) { undertextline(context); reelsonscreen(context); atmospheres(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void startup1(Context & context) { + uint stack_depth = context.stack.size(); clearpalette(context); context.data.byte(kThroughdoor) = 0; context.data.byte(kCurrentkey) = '0'; @@ -17408,10 +17975,11 @@ void startup1(Context & context) { atmospheres(context); worktoscreen(context); fadescreenup(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void screenupdate(Context & context) { + uint stack_depth = context.stack.size(); newplace(context); mainscreen(context); animpointer(context); @@ -17456,10 +18024,11 @@ iswatchingmode: dumpwatch(context); delpointer(context); finishearly: - return; + {assert(stack_depth == context.stack.size()); return; } } void watchreel(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kReeltowatch), -1); if (context.flags.z()) goto notplayingreel; context.al = context.data.byte(kManspath); @@ -17469,7 +18038,7 @@ void watchreel(Context & context) { context._cmp(context.al, context.data.byte(kFacing)); if (context.flags.z()) goto notwatchpath; waitstopwalk: - return; + {assert(stack_depth == context.stack.size()); return; } notwatchpath: context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); @@ -17497,14 +18066,14 @@ showwatchreel: context.data.word(kReeltowatch) = context.ax; checkforshake(context); nomorereel: - return; + {assert(stack_depth == context.stack.size()); return; } notplayingreel: context._cmp(context.data.byte(kWatchmode), 1); if (!context.flags.z()) goto notholdingreel; context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); - return; + {assert(stack_depth == context.stack.size()); return; } notholdingreel: context._cmp(context.data.byte(kWatchmode), 2); if (!context.flags.z()) goto notreleasehold; @@ -17524,27 +18093,29 @@ notlastspeed2: context.data.byte(kDestination) = context.al; context.data.byte(kFinaldest) = context.al; autosetwalk(context); - return; + {assert(stack_depth == context.stack.size()); return; } ismorereel2: context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); - return; + {assert(stack_depth == context.stack.size()); return; } notreleasehold: - return; + {assert(stack_depth == context.stack.size()); return; } } void checkforshake(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; context.data.byte(kShakecounter) = -1; notstartshake: - return; + {assert(stack_depth == context.stack.size()); return; } } void watchcount(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatchworn; context._inc(context.data.byte(kTimercount)); @@ -17553,7 +18124,7 @@ void watchcount(Context & context) { context._cmp(context.data.byte(kTimercount), 18); if (context.flags.z()) goto uptime; nowatchworn: - return; + {assert(stack_depth == context.stack.size()); return; } flashdots: context.ax = 91*3+21; context.di = 268+4; @@ -17579,10 +18150,11 @@ finishtime: showtime(context); finishwatch: context.data.byte(kWatchdump) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void showtime(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatch; context.al = context.data.byte(kSecondcount); @@ -17645,10 +18217,11 @@ void showtime(Context & context) { context.bx = 21; showframe(context); nowatch: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpwatch(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchdump), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; @@ -17658,10 +18231,11 @@ void dumpwatch(Context & context) { multidump(context); context.data.byte(kWatchdump) = 0; nodumpwatch: - return; + {assert(stack_depth == context.stack.size()); return; } } void showbyte(Context & context) { + uint stack_depth = context.stack.size(); context.dl = context.al; context._shr(context.dl, 1); context._shr(context.dl, 1); @@ -17674,21 +18248,23 @@ void showbyte(Context & context) { onedigit(context); context.es.byte(context.di+1) = context.dl; context._add(context.di, 3); - return; + {assert(stack_depth == context.stack.size()); return; } } void onedigit(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.dl, 10); if (!context.flags.c()) goto morethan10; context._add(context.dl, '0'); - return; + {assert(stack_depth == context.stack.size()); return; } morethan10: context._sub(context.dl, 10); context._add(context.dl, 'A'); - return; + {assert(stack_depth == context.stack.size()); return; } } void twodigitnum(Context & context) { + uint stack_depth = context.stack.size(); context.ah = context.cl; context._dec(context.ah); numloop1: @@ -17697,10 +18273,11 @@ numloop1: if (!context.flags.c()) goto numloop1; context._add(context.al, 10); context._add(context.al, context.cl); - return; + {assert(stack_depth == context.stack.size()); return; } } void showword(Context & context) { + uint stack_depth = context.stack.size(); context.ch = 0; context.bx = 10000; context.cl = 47; @@ -17742,10 +18319,11 @@ word4: context.cl = context.al; convnum(context); context.cs.byte(context.di+4) = context.cl; - return; + {assert(stack_depth == context.stack.size()); return; } } void convnum(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.ch, 0); if (!context.flags.z()) goto noconvnum; context._cmp(context.cl, '0'); @@ -17755,10 +18333,11 @@ void convnum(Context & context) { notzeronum: context.ch = 1; noconvnum: - return; + {assert(stack_depth == context.stack.size()); return; } } void walkandexamine(Context & context) { + uint stack_depth = context.stack.size(); finishedwalking(context); if (!context.flags.z()) goto noobselect; context.al = context.data.byte(kWalkexamtype); @@ -17769,12 +18348,12 @@ void walkandexamine(Context & context) { context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); - return; + {assert(stack_depth == context.stack.size()); return; } wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; noobselect: - return; + {assert(stack_depth == context.stack.size()); return; } diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; @@ -17814,22 +18393,23 @@ notblock: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); - return; + {assert(stack_depth == context.stack.size()); return; } middleofwalk: blocknametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } isblock: blocknametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } isaperson: personnametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } toofaraway: walktotext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void mainscreen(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kInmaparea) = 0; context.bx = 4949; context._cmp(context.data.byte(kWatchon), 1); @@ -17841,10 +18421,11 @@ checkmain: if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: - return; + {assert(stack_depth == context.stack.size()); return; } } void madmanrun(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) { identifyob(context); return; }; context._cmp(context.data.byte(kMapx), 22); @@ -17866,13 +18447,14 @@ alreadyrun: if (context.flags.z()) goto norun; context.data.byte(kLastweapon) = 8; norun: - return; + {assert(stack_depth == context.stack.size()); return; } } void checkcoords(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNewlocation), 255); if (context.flags.z()) goto loop048; - return; + {assert(stack_depth == context.stack.size()); return; } loop048: context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); @@ -17893,16 +18475,17 @@ loop048: __dispatch_call(context, context.ax); finished: context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } over045: context.bx = context.pop(); context._add(context.bx, 10); goto loop048; nonefound: - return; + {assert(stack_depth == context.stack.size()); return; } } void identifyob(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context.ax = context.data.word(kMousex); @@ -17910,14 +18493,14 @@ void identifyob(Context & context) { context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } notover1: context.bx = context.data.word(kMousey); context._sub(context.bx, context.data.word(kMapady)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } notover2: context.data.byte(kInmaparea) = 1; context.ah = context.bl; @@ -17951,13 +18534,14 @@ notover2: context.ah = 3; obname(context); finishidentify: - return; + {assert(stack_depth == context.stack.size()); return; } nothingund: blank(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void checkifperson(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.cx = 12; @@ -18004,16 +18588,17 @@ notblankpers: obname(context); context.al = 0; context._cmp(context.al, 1); - return; + {assert(stack_depth == context.stack.size()); return; } notareelid: context.cx = context.pop(); context._add(context.bx, 5); context._dec(context.cx); if (!context.flags.z()) goto identifyreel; - return; + {assert(stack_depth == context.stack.size()); return; } } void checkifset(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); context.cx = 127; @@ -18037,16 +18622,17 @@ identifyset: obname(context); context.al = 0; context._cmp(context.al, 1); - return; + {assert(stack_depth == context.stack.size()); return; } notasetid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyset; - return; + {assert(stack_depth == context.stack.size()); return; } } void checkifex(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); context.cx = 99; @@ -18066,16 +18652,17 @@ identifyex: obname(context); context.al = 1; context._cmp(context.al, 0); - return; + {assert(stack_depth == context.stack.size()); return; } notanexid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyex; - return; + {assert(stack_depth == context.stack.size()); return; } } void checkiffree(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); context.cx = 79; @@ -18095,16 +18682,17 @@ identifyfree: obname(context); context.al = 0; context._cmp(context.al, 1); - return; + {assert(stack_depth == context.stack.size()); return; } notafreeid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyfree; - return; + {assert(stack_depth == context.stack.size()); return; } } void isitdescribed(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.cx); context.push(context.es); @@ -18124,10 +18712,11 @@ void isitdescribed(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - return; + {assert(stack_depth == context.stack.size()); return; } } void findpathofpoint(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.bx = (0); context.es = context.data.word(kReels); @@ -18162,10 +18751,11 @@ flunkedit: if (!context.flags.z()) goto pathloop; context.dl = 255; gotvalidpath: - return; + {assert(stack_depth == context.stack.size()); return; } } void findfirstpath(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.bx = (0); context.es = context.data.word(kReels); @@ -18196,13 +18786,14 @@ nofirst: context._cmp(context.dl, 12); if (!context.flags.z()) goto fpathloop; context.al = 0; - return; + {assert(stack_depth == context.stack.size()); return; } gotfirst: context.al = context.es.byte(context.bx+6); - return; + {assert(stack_depth == context.stack.size()); return; } } void turnpathon(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18222,10 +18813,11 @@ void turnpathon(Context & context) { context.al = 255; context.es.byte(context.bx+6) = context.al; nopathon: - return; + {assert(stack_depth == context.stack.size()); return; } } void turnpathoff(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18245,10 +18837,11 @@ void turnpathoff(Context & context) { context.al = 0; context.es.byte(context.bx+6) = context.al; nopathoff: - return; + {assert(stack_depth == context.stack.size()); return; } } void turnanypathon(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18271,10 +18864,11 @@ void turnanypathon(Context & context) { context._add(context.bx, context.ax); context.al = 255; context.es.byte(context.bx+6) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void turnanypathoff(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18297,10 +18891,11 @@ void turnanypathoff(Context & context) { context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void checkifpathison(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); getroomspaths(context); context.ax = context.pop(); @@ -18311,10 +18906,11 @@ void checkifpathison(Context & context) { context._add(context.bx, context.ax); context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); - return; + {assert(stack_depth == context.stack.size()); return; } } void afternewroom(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnew; context.data.word(kTimecount) = 0; @@ -18349,10 +18945,11 @@ ryansoff: reminders(context); atmospheres(context); notnew: - return; + {assert(stack_depth == context.stack.size()); return; } } void atmospheres(Context & context) { + uint stack_depth = context.stack.size(); context.cl = context.data.byte(kMapx); context.ch = context.data.byte(kMapy); context.bx = 5073; @@ -18394,19 +18991,20 @@ playingalready: fullvol: context.data.byte(kVolume) = 0; notlouisvol2: - return; + {assert(stack_depth == context.stack.size()); return; } louisvol: context.data.byte(kVolume) = 5; - return; + {assert(stack_depth == context.stack.size()); return; } wrongatmos: context._add(context.bx, 5); goto nextatmos; nomoreatmos: cancelch0(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void walkintoroom(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) goto notlair; context._cmp(context.data.byte(kMapx), 22); @@ -18415,10 +19013,11 @@ void walkintoroom(Context & context) { context.data.byte(kFinaldest) = 1; autosetwalk(context); notlair: - return; + {assert(stack_depth == context.stack.size()); return; } } void afterintroroom(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnewintro; clearwork(context); @@ -18431,10 +19030,11 @@ void afterintroroom(Context & context) { worktoscreen(context); context.data.byte(kNowinnewroom) = 0; notnewintro: - return; + {assert(stack_depth == context.stack.size()); return; } } void obname(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReasseschanges), 0); if (context.flags.z()) goto notnewpath; context.data.byte(kReasseschanges) = 0; @@ -18467,12 +19067,12 @@ isntblock: context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; examineob(context); - return; + {assert(stack_depth == context.stack.size()); return; } wantstotalk: context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; talk(context); - return; + {assert(stack_depth == context.stack.size()); return; } walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; @@ -18484,12 +19084,12 @@ walkandexamine: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); - return; + {assert(stack_depth == context.stack.size()); return; } wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; noobselect: - return; + {assert(stack_depth == context.stack.size()); return; } diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; @@ -18529,39 +19129,42 @@ notblock: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); - return; + {assert(stack_depth == context.stack.size()); return; } middleofwalk: blocknametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } isblock: blocknametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } isaperson: personnametext(context); - return; + {assert(stack_depth == context.stack.size()); return; } toofaraway: walktotext(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void finishedwalking(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto iswalking; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); iswalking: - return; + {assert(stack_depth == context.stack.size()); return; } } void examineobtext(Context & context) { + uint stack_depth = context.stack.size(); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 1; commandwithob(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void commandwithob(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.ax); context.push(context.bx); @@ -18611,10 +19214,11 @@ noadd: context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void commandonly(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -18646,10 +19250,11 @@ void commandonly(Context & context) { context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } } void printmessage(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -18666,10 +19271,11 @@ void printmessage(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void printmessage2(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -18694,35 +19300,39 @@ searchmess: context.al = 0; context.ah = 0; printdirect(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void blocknametext(Context & context) { + uint stack_depth = context.stack.size(); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 0; commandwithob(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void personnametext(Context & context) { + uint stack_depth = context.stack.size(); context.bl = context.data.byte(kCommand); context._and(context.bl, 127); context.bh = context.data.byte(kCommandtype); context.al = 2; commandwithob(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void walktotext(Context & context) { + uint stack_depth = context.stack.size(); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 3; commandwithob(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getflagunderp(Context & context) { + uint stack_depth = context.stack.size(); context.cx = context.data.word(kMousex); context._sub(context.cx, context.data.word(kMapadx)); context.ax = context.data.word(kMousey); @@ -18731,10 +19341,11 @@ void getflagunderp(Context & context) { checkone(context); context.data.byte(kLastflag) = context.cl; context.data.byte(kLastflagex) = context.ch; - return; + {assert(stack_depth == context.stack.size()); return; } } void setwalk(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto alreadywalking; context.al = context.data.byte(kPointerspath); @@ -18758,25 +19369,26 @@ void setwalk(Context & context) { notwalkandexam: autosetwalk(context); cantwalk: - return; + {assert(stack_depth == context.stack.size()); return; } cantwalk2: facerightway(context); - return; + {assert(stack_depth == context.stack.size()); return; } alreadywalking: context.al = context.data.byte(kPointerspath); context.data.byte(kFinaldest) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } holdingreel: context.data.byte(kDestafterhold) = context.al; context.data.byte(kWatchmode) = 2; - return; + {assert(stack_depth == context.stack.size()); return; } } void autosetwalk(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kManspath); context._cmp(context.data.byte(kFinaldest), context.al); if (!context.flags.z()) goto notsamealready; - return; + {assert(stack_depth == context.stack.size()); return; } notsamealready: getroomspaths(context); checkdest(context); @@ -18817,13 +19429,14 @@ notsamealready: context._dec(context.al); context.data.byte(kLinepointer) = context.al; context.data.byte(kLinedirection) = 1; - return; + {assert(stack_depth == context.stack.size()); return; } normalline: context.data.byte(kLinepointer) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void checkdest(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.bx); context._add(context.bx, 12*8); context.ah = context.data.byte(kManspath); @@ -18843,7 +19456,7 @@ checkdestloop: context._and(context.al, 15); context.data.byte(kDestination) = context.al; context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } nextcheck: context.dl = context.es.byte(context.bx); context._and(context.dl, 0xf0); @@ -18867,10 +19480,11 @@ nextcheck2: if (!context.flags.z()) goto checkdestloop; context.data.byte(kDestination) = context.ch; context.bx = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void bresenhams(Context & context) { + uint stack_depth = context.stack.size(); workoutframes(context); context.dx = context.data; context.es = context.dx; @@ -18980,10 +19594,11 @@ lineexit: context.ax = context.di; context._shr(context.ax, 1); context.data.byte(kLinelength) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void workoutframes(Context & context) { + uint stack_depth = context.stack.size(); context.bx = context.data.word(kLinestartx); context._add(context.bx, 32); context.ax = context.data.word(kLineendx); @@ -19058,10 +19673,11 @@ success: context._and(context.dl, 7); context.data.byte(kTurntoface) = context.dl; context.data.byte(kTurndirection) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void getroomspaths(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kRoomnum); context.ah = 0; context.cx = 144; @@ -19069,10 +19685,11 @@ void getroomspaths(Context & context) { context.es = context.data.word(kReels); context.bx = (0); context._add(context.bx, context.ax); - return; + {assert(stack_depth == context.stack.size()); return; } } void copyname(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.di); findobname(context); context.di = context.pop(); @@ -19091,13 +19708,14 @@ finishmakename: context._inc(context.cx); context.al = 0; context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } context.al = 255; while(context.cx--) context._stosb(); - return; + {assert(stack_depth == context.stack.size()); return; } } void findobname(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ax); context.ah = 0; context._add(context.ax, context.ax); @@ -19118,7 +19736,7 @@ void findobname(Context & context) { context._add(context.ax, context.cx); context.si = context.ax; context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; @@ -19127,7 +19745,7 @@ notpersonname: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+2080+30000+(16*114)+((114+2)*2))); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; @@ -19136,7 +19754,7 @@ notextraname: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(82*2))); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; @@ -19145,17 +19763,18 @@ notfreename: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(130*2))); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } notsetname: context.ds = context.data.word(kBlockdesc); context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(98*2))); context.si = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void showicon(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) goto isdream1; showpanel(context); @@ -19163,7 +19782,7 @@ void showicon(Context & context) { roomname(context); panelicons1(context); zoomicon(context); - return; + {assert(stack_depth == context.stack.size()); return; } isdream1: context.ds = context.data.word(kTempsprites); context.di = 72; @@ -19202,10 +19821,11 @@ isdream1: context.ah = 4; showframe(context); middlepanel(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void middlepanel(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kTempsprites); context.di = 72+47+20; context.bx = 0; @@ -19230,10 +19850,11 @@ void middlepanel(Context & context) { context.al = 47; context.ah = 4; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showman(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kIcons1); context.di = 0; context.bx = 0; @@ -19255,10 +19876,11 @@ void showman(Context & context) { context.ah = 0; showframe(context); notverycool: - return; + {assert(stack_depth == context.stack.size()); return; } } void showpanel(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kIcons1); context.di = 72; context.bx = 0; @@ -19271,10 +19893,11 @@ void showpanel(Context & context) { context.al = 19; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void roomname(Context & context) { + uint stack_depth = context.stack.size(); context.di = 88; context.bx = 18; context.al = 53; @@ -19305,32 +19928,36 @@ gotpl: printdirect(context); context.data.word(kLinespacing) = 10; usecharset1(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void usecharset1(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kCharset1); context.data.word(kCurrentset) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void usetempcharset(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kTempcharset); context.data.word(kCurrentset) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void showexit(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.data.word(kIcons1); context.di = 274; context.bx = 154; context.al = 11; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void panelicons1(Context & context) { + uint stack_depth = context.stack.size(); context.di = 0; context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto watchison; @@ -19356,10 +19983,11 @@ watchison: zoomisoff: context.di = context.pop(); showwatch(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showwatch(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowristwatch; context.ds = context.data.word(kIcons1); @@ -19370,10 +19998,11 @@ void showwatch(Context & context) { showframe(context); showtime(context); nowristwatch: - return; + {assert(stack_depth == context.stack.size()); return; } } void zoomicon(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) goto nozoom1; context.ds = context.data.word(kIcons1); @@ -19383,10 +20012,11 @@ void zoomicon(Context & context) { context.ah = 0; showframe(context); nozoom1: - return; + {assert(stack_depth == context.stack.size()); return; } } void showblink(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) goto finblink1; context._inc(context.data.byte(kBlinkcount)); @@ -19415,12 +20045,13 @@ nomorethan6: context.ah = 0; showframe(context); finblink1: - return; + {assert(stack_depth == context.stack.size()); return; } eyesshut: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpblink(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto nodumpeye; context._cmp(context.data.byte(kBlinkcount), 0); @@ -19436,37 +20067,41 @@ void dumpblink(Context & context) { multidump(context); context.ds = context.pop(); nodumpeye: - return; + {assert(stack_depth == context.stack.size()); return; } } void worktoscreenm(Context & context) { + uint stack_depth = context.stack.size(); animpointer(context); readmouse(context); showpointer(context); vsync(context); worktoscreen(context); delpointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void blank(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.z()) goto alreadyblnk; context.data.byte(kCommandtype) = 199; context.al = 0; commandonly(context); alreadyblnk: - return; + {assert(stack_depth == context.stack.size()); return; } } void allpointer(Context & context) { + uint stack_depth = context.stack.size(); readmouse(context); showpointer(context); dumppointer(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void hangonp(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); context._add(context.cx, context.cx); context.ax = context.pop(); @@ -19507,10 +20142,11 @@ getoutofit: context.data.byte(kPointerframe) = context.al; context.data.byte(kPickup) = context.ah; context.data.byte(kPointermode) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void hangonw(Context & context) { + uint stack_depth = context.stack.size(); hangloopw: context.push(context.cx); delpointer(context); @@ -19521,10 +20157,11 @@ hangloopw: dumppointer(context); context.cx = context.pop(); if (--context.cx) goto hangloopw; - return; + {assert(stack_depth == context.stack.size()); return; } } void hangoncurs(Context & context) { + uint stack_depth = context.stack.size(); monloop1: context.push(context.cx); printcurs(context); @@ -19532,10 +20169,11 @@ monloop1: delcurs(context); context.cx = context.pop(); if (--context.cx) goto monloop1; - return; + {assert(stack_depth == context.stack.size()); return; } } void getunderzoom(Context & context) { + uint stack_depth = context.stack.size(); context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); @@ -19543,10 +20181,11 @@ void getunderzoom(Context & context) { context.cl = 46; context.ch = 40; multiget(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumpzoom(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) goto notzoomon; context.di = (8)+5; @@ -19555,10 +20194,11 @@ void dumpzoom(Context & context) { context.ch = 40; multidump(context); notzoomon: - return; + {assert(stack_depth == context.stack.size()); return; } } void putunderzoom(Context & context) { + uint stack_depth = context.stack.size(); context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); @@ -19566,10 +20206,11 @@ void putunderzoom(Context & context) { context.cl = 46; context.ch = 40; multiput(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void crosshair(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto nocross; context._cmp(context.data.byte(kCommandtype), 10); @@ -19581,7 +20222,7 @@ void crosshair(Context & context) { context.al = 9; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } nocross: context.es = context.data.word(kWorkspace); context.ds = context.data.word(kIcons1); @@ -19590,10 +20231,11 @@ nocross: context.al = 29; context.ah = 0; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void showpointer(Context & context) { + uint stack_depth = context.stack.size(); showblink(context); context.di = context.data.word(kMousex); context.data.word(kOldpointerx) = context.di; @@ -19637,7 +20279,7 @@ notsmally: showframe(context); context.bx = context.pop(); context.di = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } itsanobject: context.al = context.data.byte(kItemframe); context.ds = context.data.word(kExtras); @@ -19698,10 +20340,11 @@ notsmally2: context.al = 3; context.ah = 128; showframe(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void delpointer(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; @@ -19718,10 +20361,11 @@ void delpointer(Context & context) { context.bx = context.data.word(kDelherey); multiput(context); nevershown: - return; + {assert(stack_depth == context.stack.size()); return; } } void dumppointer(Context & context) { + uint stack_depth = context.stack.size(); dumpblink(context); context.cl = context.data.byte(kDelxs); context.ch = context.data.byte(kDelys); @@ -19739,10 +20383,11 @@ difffound: context.ch = context.data.byte(kPointerys); multidump(context); notboth: - return; + {assert(stack_depth == context.stack.size()); return; } } void undertextline(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context.ds = context.data.word(kBuffers); @@ -19750,10 +20395,11 @@ void undertextline(Context & context) { context.cl = (180); context.ch = (10); multiget(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void deltextline(Context & context) { + uint stack_depth = context.stack.size(); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context.ds = context.data.word(kBuffers); @@ -19761,10 +20407,11 @@ void deltextline(Context & context) { context.cl = (180); context.ch = (10); multiput(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void dumptextline(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kNewtextline), 1); if (!context.flags.z()) goto nodumptextline; context.data.byte(kNewtextline) = 0; @@ -19774,10 +20421,11 @@ void dumptextline(Context & context) { context.ch = (10); multidump(context); nodumptextline: - return; + {assert(stack_depth == context.stack.size()); return; } } void animpointer(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) goto combathand; context._cmp(context.data.byte(kPointermode), 3); @@ -19785,7 +20433,7 @@ void animpointer(Context & context) { context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchpoint; context.data.byte(kPointerframe) = 11; - return; + {assert(stack_depth == context.stack.size()); return; } notwatchpoint: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kInmaparea), 0); @@ -19812,7 +20460,7 @@ arrow: if (!context.flags.z()) goto gothand; context.data.byte(kPointerframe) = 8; gothand: - return; + {assert(stack_depth == context.stack.size()); return; } mousehand: context._cmp(context.data.byte(kPointerspeed), 0); if (context.flags.z()) goto rightspeed3; @@ -19831,7 +20479,7 @@ finflashmouse: context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); context.data.byte(kPointerframe) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } combathand: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kReallocation), 14); @@ -19840,10 +20488,11 @@ combathand: if (!context.flags.z()) goto notarrow; context.data.byte(kPointerframe) = 5; notarrow: - return; + {assert(stack_depth == context.stack.size()); return; } } void readmouse(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; context.ax = context.data.word(kMousex); @@ -19854,10 +20503,11 @@ void readmouse(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton) = context.bx; - return; + {assert(stack_depth == context.stack.size()); return; } } void readmouse1(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -19866,10 +20516,11 @@ void readmouse1(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton1) = context.bx; - return; + {assert(stack_depth == context.stack.size()); return; } } void readmouse2(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -19878,10 +20529,11 @@ void readmouse2(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton2) = context.bx; - return; + {assert(stack_depth == context.stack.size()); return; } } void readmouse3(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -19890,10 +20542,11 @@ void readmouse3(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton3) = context.bx; - return; + {assert(stack_depth == context.stack.size()); return; } } void readmouse4(Context & context) { + uint stack_depth = context.stack.size(); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; context.ax = context.data.word(kMousex); @@ -19908,10 +20561,11 @@ void readmouse4(Context & context) { context._or(context.ax, context.data.word(kMousebutton3)); context._or(context.bx, context.ax); context.data.word(kMousebutton) = context.bx; - return; + {assert(stack_depth == context.stack.size()); return; } } void readkey(Context & context) { + uint stack_depth = context.stack.size(); context.bx = context.data.word(kBufferout); context._cmp(context.bx, context.data.word(kBufferin)); if (context.flags.z()) goto nokey; @@ -19922,22 +20576,24 @@ void readkey(Context & context) { context._add(context.di, context.bx); context.al = context.cs.byte(context.di); context.data.byte(kCurrentkey) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } nokey: context.data.byte(kCurrentkey) = 0; - return; + {assert(stack_depth == context.stack.size()); return; } } void convertkey(Context & context) { + uint stack_depth = context.stack.size(); context._and(context.al, 127); context.ah = 0; context.di = 5731; context._add(context.di, context.ax); context.al = context.cs.byte(context.di); - return; + {assert(stack_depth == context.stack.size()); return; } } void randomnum1(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ds); context.push(context.es); context.push(context.di); @@ -19949,10 +20605,11 @@ void randomnum1(Context & context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void randomnum2(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.ds); context.push(context.es); context.push(context.di); @@ -19965,53 +20622,60 @@ void randomnum2(Context & context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void hangon(Context & context) { + uint stack_depth = context.stack.size(); hangonloop: context.push(context.cx); vsync(context); context.cx = context.pop(); if (--context.cx) goto hangonloop; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadtraveltext(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 2234; standardload(context); context.data.word(kTraveltext) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadintotemp(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadintotemp2(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics2) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadintotemp3(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics3) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadtempcharset(Context & context) { + uint stack_depth = context.stack.size(); standardload(context); context.data.word(kTempcharset) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void standardload(Context & context) { + uint stack_depth = context.stack.size(); openfile(context); readheader(context); context.bx = context.es.word(context.di); @@ -20026,16 +20690,18 @@ void standardload(Context & context) { readfromfile(context); closefile(context); context.ax = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadtemptext(Context & context) { + uint stack_depth = context.stack.size(); standardload(context); context.data.word(kTextfile1) = context.ax; - return; + {assert(stack_depth == context.stack.size()); return; } } void loadroom(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kRoomloaded) = 1; context.data.word(kTimecount) = 0; context.data.word(kMaintimer) = 0; @@ -20052,10 +20718,11 @@ void loadroom(Context & context) { switchryanon(context); drawflags(context); getdimension(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void loadroomssample(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; @@ -20071,10 +20738,11 @@ void loadroomssample(Context & context) { context.dx = context.di; loadsecondsample(context); loadedalready: - return; + {assert(stack_depth == context.stack.size()); return; } } void getridofreels(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontgetrid; context.es = context.data.word(kReel1); @@ -20084,10 +20752,11 @@ void getridofreels(Context & context) { context.es = context.data.word(kReel3); deallocatemem(context); dontgetrid: - return; + {assert(stack_depth == context.stack.size()); return; } } void getridofall(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kBackdrop); deallocatemem(context); context.es = context.data.word(kSetframes); @@ -20112,10 +20781,11 @@ void getridofall(Context & context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void restorereels(Context & context) { + uint stack_depth = context.stack.size(); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontrestore; context.al = context.data.byte(kReallocation); @@ -20144,10 +20814,11 @@ void restorereels(Context & context) { loadseg(context); closefile(context); dontrestore: - return; + {assert(stack_depth == context.stack.size()); return; } } void restoreall(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kLocation); getroomdata(context); context.dx = context.bx; @@ -20224,10 +20895,11 @@ void restoreall(Context & context) { loadseg(context); closefile(context); setallchanges(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void sortoutmap(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.di); context.ds = context.data.word(kWorkspace); @@ -20246,10 +20918,11 @@ blimey: if (--context.cx) goto blimey; context.di = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void startloading(Context & context) { + uint stack_depth = context.stack.size(); context.data.byte(kCombatcount) = 0; context.al = context.cs.byte(context.bx+13); context.data.byte(kRoomssample) = context.al; @@ -20381,10 +21054,11 @@ void startloading(Context & context) { context.bx = context.pop(); dontwalkin: findxyfrompath(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void disablepath(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.cx); context._xchg(context.al, context.ah); context.cx = -6; @@ -20413,10 +21087,11 @@ lookx2: context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - return; + {assert(stack_depth == context.stack.size()); return; } } void findxyfrompath(Context & context) { + uint stack_depth = context.stack.size(); getroomspaths(context); context.al = context.data.byte(kManspath); context.ah = 0; @@ -20429,10 +21104,11 @@ void findxyfrompath(Context & context) { context._sub(context.ah, 12); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - return; + {assert(stack_depth == context.stack.size()); return; } } void findroominloc(Context & context) { + uint stack_depth = context.stack.size(); context.al = context.data.byte(kMapy); context.cx = -6; looky: @@ -20446,29 +21122,32 @@ lookx: context._sub(context.al, 11); if (!context.flags.c()) goto lookx; context.data.byte(kRoomnum) = context.cl; - return; + {assert(stack_depth == context.stack.size()); return; } } void getroomdata(Context & context) { + uint stack_depth = context.stack.size(); context.ah = 0; context.cx = 32; context._mul(context.cx); context.bx = 5958; context._add(context.bx, context.ax); - return; + {assert(stack_depth == context.stack.size()); return; } } void readheader(Context & context) { + uint stack_depth = context.stack.size(); context.ds = context.cs; context.dx = 5862; context.cx = (5958-5862); readfromfile(context); context.es = context.cs; context.di = 5912; - return; + {assert(stack_depth == context.stack.size()); return; } } void allocateload(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.di); context.bx = context.es.word(context.di); @@ -20477,10 +21156,11 @@ void allocateload(Context & context) { allocatemem(context); context.di = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void fillspace(Context & context) { + uint stack_depth = context.stack.size(); context.push(context.es); context.push(context.ds); context.push(context.dx); @@ -20494,46 +21174,53 @@ void fillspace(Context & context) { context.dx = context.pop(); context.ds = context.pop(); context.es = context.pop(); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftemp(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTempgraphics); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftemptext(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTextfile1); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftemp2(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTempgraphics2); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftemp3(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTempgraphics3); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftempcharset(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTempcharset); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void getridoftempsp(Context & context) { + uint stack_depth = context.stack.size(); context.es = context.data.word(kTempsprites); deallocatemem(context); - return; + {assert(stack_depth == context.stack.size()); return; } } void readsetdata(Context & context) { + uint stack_depth = context.stack.size(); context.dx = 1857; standardload(context); context.data.word(kCharset1) = context.ax; @@ -20564,10 +21251,11 @@ void readsetdata(Context & context) { readfromfile(context); closefile(context); novolumeload: - return; + {assert(stack_depth == context.stack.size()); return; } } void dreamweb(Context & context) { + uint stack_depth = context.stack.size(); seecommandtail(context); checkbasemem(context); soundstartup(context); -- cgit v1.2.3 From 4547e7314cd64777c7807595dcacc369be338583 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 12 Jun 2011 22:24:52 +0200 Subject: DREAMWEB: Make it possible to type the letter D --- engines/dreamweb/dreamweb.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6883580b74..02e93e1b39 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -115,6 +115,7 @@ void DreamWebEngine::processEvents() { } Common::Event event; while (event_manager->pollEvent(event)) { + bool keyHandled = false; switch(event.type) { case Common::EVENT_KEYDOWN: switch (event.kbd.keycode) { @@ -122,9 +123,14 @@ void DreamWebEngine::processEvents() { if (event.kbd.flags & Common::KBD_CTRL) { _console->attach(); _console->onFrame(); + keyHandled = true; } break; default: + break; + } + + if (!keyHandled) { // As far as I can see, the only keys checked // for in 'lasthardkey' are 1 (ESC) and 57 // (space) so add special cases for them and @@ -137,8 +143,8 @@ void DreamWebEngine::processEvents() { _context.data.byte(dreamgen::kLasthardkey) = 0; if (event.kbd.ascii) keyPressed(event.kbd.ascii); - break; } + break; default: break; -- cgit v1.2.3 From c808844ad6ac37171db1fa56cc0eeb96142a59b1 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 02:50:07 +0400 Subject: DREAMWEB: regenerated the source --- engines/dreamweb/dreamgen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index de9a7c1c38..b17d469cb7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4770,6 +4770,8 @@ void showframe(Context & context) { context._add(context.si, context.cx); context._cmp(context.ds.word(context.si), 0); if (!context.flags.z()) goto notblankshow; + context.ax = context.pop(); + context.dx = context.pop(); context.cx = 0; {assert(stack_depth == context.stack.size()); return; } notblankshow: -- cgit v1.2.3 From 92a11ea59d36e46a2a0cc0beaeac98310efed433 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 13 Jun 2011 06:10:25 +0200 Subject: DREAMWEB: Make new function for getting name of file to open. --- engines/dreamweb/dreamweb.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 02e93e1b39..ecab4337c1 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -350,6 +350,15 @@ void DreamWebEngine::cls() { namespace dreamgen { +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 multiget(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; unsigned src = (uint16)context.di + (uint16)context.bx * kScreenwidth; @@ -479,11 +488,7 @@ void openfilenocheck(Context &context) { } void openfile(Context &context) { - uint16 name_ptr = context.dx; - Common::String name; - uint8 c; - while((c = context.cs.byte(name_ptr++)) != 0) - name += (char)c; + Common::String name = getFilename(context); debug(1, "opening file: %s", name.c_str()); context.engine->openFile(name); context.cs.word(kHandle) = 1; //only one handle @@ -755,12 +760,7 @@ void readoneblock(Context &context) { void readabyte(Context & context); void showpcx(Context &context) { - uint16 name_ptr = context.dx; - Common::String name; - uint8 c; - while((c = context.cs.byte(name_ptr++)) != 0) - name += (char)c; - + Common::String name = getFilename(context); Common::File pcxFile; if (!pcxFile.open(name)) { -- cgit v1.2.3 From 308fcf0953ab4974d997710debdaa72b0b44ed3e Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 11:35:58 +0400 Subject: DREAMWEB: added setSpeed, CTRL-F shortcut and removed erik's comment because it's good idea :) --- engines/dreamweb/dreamweb.cpp | 21 +++++++++++++++++---- engines/dreamweb/dreamweb.h | 4 ++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index ecab4337c1..b3bae38d24 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -66,6 +66,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function"); _outSaveFile = 0; _inSaveFile = 0; + _speed = 1; } DreamWebEngine::~DreamWebEngine() { @@ -73,10 +74,6 @@ DreamWebEngine::~DreamWebEngine() { delete _console; } -// Let's see if it's a good idea to emulate VSYNC interrupts with a timer like -// this. There's a chance we'll miss interrupts, which could be countered by -// counting them instead of just flagging them, but we'll see... - static void vSyncInterrupt(void *refCon) { DreamWebEngine *vm = (DreamWebEngine *)refCon; @@ -126,6 +123,15 @@ void DreamWebEngine::processEvents() { keyHandled = true; } break; + case Common::KEYCODE_f: + if (event.kbd.flags & Common::KBD_CTRL) { + if (_speed != 10) + setSpeed(10); + else + setSpeed(1); + keyHandled = true; + } + break; default: break; } @@ -166,6 +172,13 @@ Common::Error DreamWebEngine::run() { return Common::kNoError; } +void DreamWebEngine::setSpeed(uint speed) { + debug(0, "setting speed %u", speed); + _speed = speed; + getTimerManager()->removeTimerProc(vSyncInterrupt); + getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this); +} + void DreamWebEngine::openFile(const Common::String &name) { processEvents(); closeFile(); diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 33a88e0408..50d2779327 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -104,6 +104,8 @@ private: void keyPressed(uint16 ascii); + void setSpeed(uint speed); + const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; @@ -111,6 +113,8 @@ private: Common::OutSaveFile *_outSaveFile; Common::InSaveFile *_inSaveFile; + uint _speed; + dreamgen::Context _context; }; -- cgit v1.2.3 From 77624071bcb8c4b938dd054db05dd512d5e73edb Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 11:59:21 +0400 Subject: DREAMWEB: removed detection params --- engines/dreamweb/detection.cpp | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index f0d0f9e840..10ff15da11 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -49,34 +49,15 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { #include "dreamweb/detection_tables.h" -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)DreamWeb::gameDescriptions, - // Size of that superset structure - sizeof(DreamWeb::DreamWebGameDescription), - // Number of bytes to compute MD5 sum for - 5000, - // List of all engine targets - dreamWebGames, - // Structure for autoupgrading obsolete targets - obsoleteGameIDsTable, - // Name of single gameid (optional) - "dreamweb", - // List of files for file-based fallback detection (optional) - 0, - // Flags - 0, - // Additional GUI options (for every game} - Common::GUIO_NOMIDI, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class DreamWebMetaEngine : public AdvancedMetaEngine { public: - DreamWebMetaEngine() : AdvancedMetaEngine(detectionParams) {} + DreamWebMetaEngine(): + AdvancedMetaEngine(DreamWeb::gameDescriptions, + sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames) { + params.obsoleteList = obsoleteGameIDsTable; + params.singleid = "dreamweb"; + params.guioptions = Common::GUIO_NOMIDI; + } virtual const char *getName() const { return "DreamWeb engine"; -- cgit v1.2.3 From 55c366b988e4e49342690f0fc4b180822f005272 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 12:22:48 +0400 Subject: DREAMWEB: fixed monitor scrolling --- engines/dreamweb/dreamweb.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b3bae38d24..af7ccc83e3 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -332,24 +332,28 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int } void DreamWebEngine::printUnderMonitor() { + _context.es = _context.data.word(dreamgen::kWorkspace); _context.di = dreamgen::kScreenwidth * 43 + 76; _context.si = _context.di + 8 * dreamgen::kScreenwidth; - _context.es = _context.data.word(dreamgen::kWorkspace); Graphics::Surface *s = _system->lockScreen(); if (!s) error("lockScreen failed"); for(uint y = 0; y < 104; ++y) { - uint8 *src = (uint8 *)s->getBasePtr(76 + 8, 43 + 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) { if (*src < 231) *dst++ = *src++; + else { + ++dst; ++src; + } } _context._add(_context.di, dreamgen::kScreenwidth); _context._add(_context.si, dreamgen::kScreenwidth); } + _context.cx = 0; _system->unlockScreen(); } -- cgit v1.2.3 From d69e437d42b50273eabd8d77fc76ec7a9216326c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 12:56:28 +0400 Subject: DREAMWEB: do not return invalid register from the deallocate memory --- engines/dreamweb/dreamweb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index af7ccc83e3..6b9fda8882 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -561,6 +561,7 @@ void allocatemem(Context &context) { void deallocatemem(Context &context) { debug(1, "deallocating segment %04x", (uint16)context.es); context.deallocateSegment(context.es); + context.es = context.data; } void removeemm(Context &context) { -- cgit v1.2.3 From 93cf9993eaeb26f2dcb8f60a7c74559007f7a014 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 13:30:02 +0400 Subject: DREAMWEB: report click only once, this fixes phantom clicks after loading or between screens. --- engines/dreamweb/dreamweb.cpp | 6 +++++- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6b9fda8882..3d74570da2 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -67,6 +67,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _outSaveFile = 0; _inSaveFile = 0; _speed = 1; + _oldMouseState = 0; } DreamWebEngine::~DreamWebEngine() { @@ -270,7 +271,10 @@ void DreamWebEngine::mouseCall() { pos.y = 184; _context.cx = pos.x; _context.dx = pos.y; - _context.bx = eventMan->getButtonState(); + + unsigned state = eventMan->getButtonState(); + _context.bx = state == _oldMouseState? 0: state; + _oldMouseState = state; } void DreamWebEngine::setGraphicsMode() { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 50d2779327..f61c113e30 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -114,6 +114,7 @@ private: Common::InSaveFile *_inSaveFile; uint _speed; + uint _oldMouseState; dreamgen::Context _context; }; -- cgit v1.2.3 From 167d401ad70868479613e3f8a2d66e8667c5f4c4 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 14:20:56 +0400 Subject: DREAMWEB: fix registers on exit from stubs --- engines/dreamweb/dreamweb.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 3d74570da2..6bf0fff665 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -275,6 +275,7 @@ void DreamWebEngine::mouseCall() { unsigned state = eventMan->getButtonState(); _context.bx = state == _oldMouseState? 0: state; _oldMouseState = state; + _context.flags._c = false; } void DreamWebEngine::setGraphicsMode() { @@ -426,7 +427,9 @@ void multidump(Context &context) { void worktoscreen(Context &context) { context.ds = context.data.word(kWorkspace); - context.engine->blit(context.ds.ptr(0, 320 * 200), 320, 0, 0, 320, 200); + uint size = 320 * 200; + context.engine->blit(context.ds.ptr(0, size), 320, 0, 0, 320, 200); + context.di = context.si = size; context.cx = 0; } @@ -450,6 +453,9 @@ void frameoutnm(Context &context) { uint8 *dst_p = context.es.ptr(dst + pitch * l, w); memcpy(dst_p, src_p, w); } + context.di += dst + pitch * h; + context.si += w * h; + context.cx = 0; } void seecommandtail(Context &context) { @@ -528,6 +534,7 @@ void dontloadseg(Context &context) { unsigned pos = context.engine->skipBytes(context.dx); context.dx = pos >> 16; context.ax = pos & 0xffff; + context.flags._c = false; } void mousecall(Context &context) { -- cgit v1.2.3 From cf6b88b174d7f81a38beaa5b8420b71649e0747a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 14:35:48 +0400 Subject: DREAMWEB: report uppercased letters to the code --- engines/dreamweb/dreamweb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6bf0fff665..8b0d710301 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -245,6 +245,8 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { void DreamWebEngine::keyPressed(uint16 ascii) { + if (ascii >= 'a' && ascii <= 'z') + ascii = (ascii - 'a') + 'A'; debug(1, "key pressed = %04x", ascii); uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) % 0x0f; -- cgit v1.2.3 From f46a889e6df85a9046a7468ce7acc0c4c34bf1e4 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 14:41:28 +0400 Subject: DREAMWEB: fixed invalid buffer len --- engines/dreamweb/dreamweb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8b0d710301..3af867552d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -249,7 +249,7 @@ void DreamWebEngine::keyPressed(uint16 ascii) { ascii = (ascii - 'a') + 'A'; debug(1, "key pressed = %04x", ascii); uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts - uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) % 0x0f; + uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) & 0x0f; uint16 out = _context.data.word(dreamgen::kBufferout); if (in == out) { warning("keyboard buffer is full"); @@ -286,10 +286,10 @@ void DreamWebEngine::setGraphicsMode() { } void DreamWebEngine::fadeDos() { + _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); return; //fixme later waitForVSync(); //processEvents will be called from vsync - _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); uint8 *dst = _context.es.ptr(dreamgen::kStartpal, 768); getPalette(dst, 0, 64); for(int fade = 0; fade < 64; ++fade) { -- cgit v1.2.3 From 49e7c7a7355b78a3dc4e0aae120a95dba9600bbf Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 15:22:14 +0400 Subject: DREAMWEB: fixed occasional stripping of the strings in data segment --- devtools/tasmrecover/tasm/lex.py | 2 +- devtools/tasmrecover/tasm/parser.py | 16 +- engines/dreamweb/dreamgen.cpp | 843 ++++++++++++++++++------------------ engines/dreamweb/dreamgen.h | 36 +- engines/dreamweb/dreamweb.cpp | 4 +- 5 files changed, 459 insertions(+), 442 deletions(-) diff --git a/devtools/tasmrecover/tasm/lex.py b/devtools/tasmrecover/tasm/lex.py index ba66611bce..cf7e6e19bf 100644 --- a/devtools/tasmrecover/tasm/lex.py +++ b/devtools/tasmrecover/tasm/lex.py @@ -41,7 +41,7 @@ def parse_args(text): break token += c - token = token.strip() + #token = token.strip() if len(token): result.append(token) #print result diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index b1d7995597..0583d851b4 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -169,15 +169,17 @@ class parser: if len(line) == 0 or line[0] == ';' or line[0] == chr(0x1a): continue - #print cmd + #print line m = re.match('(\w+)\s*?:', line) if m is not None: - line = line[len(m.group(0)):] + line = line[len(m.group(0)):].strip() if self.visible(): name = m.group(1) if self.proc is not None: self.proc.add_label(name) + print "offset %s -> %d" %(name, len(self.binary_data)) self.set_offset(name, (len(self.binary_data), self.proc, len(self.proc.stmts) if self.proc is not None else 0)) + #print line cmd = line.split() if len(cmd) == 0: @@ -198,8 +200,8 @@ class parser: continue if cmd0 == 'db' or cmd0 == 'dw' or cmd0 == 'dd': - arg = " ".join(cmd[1:]) - print "%d: %s" %(len(self.binary_data), line) #fixme: COPYPASTE + arg = line[len(cmd0):].strip() + print "%d:1: %s" %(len(self.binary_data), arg) #fixme: COPYPASTE binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd0[1]] self.binary_data += self.compact_data(binary_width, lex.parse_args(arg)) continue @@ -223,10 +225,12 @@ class parser: v = cmd[2] self.set_global(cmd0, op.const(self.fix_dollar(v))) elif cmd1 == 'db' or cmd1 == 'dw' or cmd1 == 'dd': - print "%d: %s" %(len(self.binary_data), line) binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd1[1]] offset = len(self.binary_data) - self.binary_data += self.compact_data(binary_width, lex.parse_args(" ".join(cmd[2:]))) + arg = line[len(cmd0):].strip() + arg = arg[len(cmd1):].strip() + print "%d: %s" %(offset, arg) + self.binary_data += self.compact_data(binary_width, lex.parse_args(arg)) self.set_global(cmd0.lower(), op.var(binary_width, offset)) continue elif cmd1 == 'proc': diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b17d469cb7..dca8d5fa17 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2845,7 +2845,7 @@ continuewalk: context.push(context.bx); context.dx = context.data; context.es = context.dx; - context.bx = 7944; + context.bx = 8141; context._add(context.bx, context.ax); context.ax = context.es.word(context.bx); context.bx = context.pop(); @@ -6936,7 +6936,7 @@ void openob(Context & context) { uint stack_depth = context.stack.size(); context.al = context.data.byte(kOpenedob); context.ah = context.data.byte(kOpenedtype); - context.di = 5674; + context.di = 5847; copyname(context); context.di = (80); context.bx = (58)+86; @@ -6947,7 +6947,7 @@ void openob(Context & context) { context._add(context.di, 5); context.bx = (58)+86; context.es = context.cs; - context.si = 5674; + context.si = 5847; context.dl = 220; context.al = 0; context.ah = 0; @@ -10022,14 +10022,14 @@ void getdestinfo(Context & context) { context.push(context.ax); context.dx = context.data; context.es = context.dx; - context.si = 7782; + context.si = 7979; context._add(context.si, context.ax); context.cl = context.es.byte(context.si); context.ax = context.pop(); context.push(context.cx); context.dx = context.data; context.es = context.dx; - context.si = 7798; + context.si = 7995; context._add(context.si, context.ax); context.ax = context.pop(); {assert(stack_depth == context.stack.size()); return; } @@ -10162,7 +10162,7 @@ void getlocation(Context & context) { context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7782); + context._add(context.bx, 7979); context.al = context.es.byte(context.bx); {assert(stack_depth == context.stack.size()); return; } } @@ -10173,7 +10173,7 @@ void setlocation(Context & context) { context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7782); + context._add(context.bx, 7979); context.es.byte(context.bx) = 1; {assert(stack_depth == context.stack.size()); return; } } @@ -10221,7 +10221,7 @@ clearedlocations: context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7782); + context._add(context.bx, 7979); context.es.byte(context.bx) = 0; {assert(stack_depth == context.stack.size()); return; } } @@ -10248,17 +10248,17 @@ void usemon(Context & context) { uint stack_depth = context.stack.size(); context.data.byte(kLasttrigger) = 0; context.es = context.cs; - context.di = 2892+1; + context.di = 2970+1; context.cx = 12; context.al = 32; while(context.cx--) context._stosb(); context.es = context.cs; - context.di = 2883+1; + context.di = 2942+1; context.cx = 12; context.al = 32; while(context.cx--) context._stosb(); context.es = context.cs; - context.di = 2807; + context.di = 2836; context.es.byte(context.di) = 1; context._add(context.di, 26); context.cx = 3; @@ -10623,7 +10623,7 @@ void locklightoff(Context & context) { void input(Context & context) { uint stack_depth = context.stack.size(); context.es = context.cs; - context.di = 7816; + context.di = 8013; context.cx = 64; context.al = 0; while(context.cx--) context._stosb(); @@ -10672,7 +10672,7 @@ notleadingspace: context.es = context.cs; context.si = context.data.word(kCurpos); context._add(context.si, context.si); - context._add(context.si, 7816); + context._add(context.si, 8013); context.es.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); if (!context.flags.c()) goto waitkey; @@ -10725,7 +10725,7 @@ void delchar(Context & context) { context.si = context.data.word(kCurpos); context._add(context.si, context.si); context.es = context.cs; - context._add(context.si, 7816); + context._add(context.si, 8013); context.es.byte(context.si) = 0; context.al = context.es.byte(context.si+1); context.ah = 0; @@ -10753,7 +10753,7 @@ void execcommand(Context & context) { context.es = context.cs; context.bx = 2776; context.ds = context.cs; - context.si = 7816; + context.si = 8013; context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; @@ -10842,10 +10842,10 @@ void dircom(Context & context) { dirroot: context.data.byte(kLogonum) = 0; context.ds = context.cs; - context.si = 2885; + context.si = 2956; context._inc(context.si); context.es = context.cs; - context.di = 2892; + context.di = 2970; context._inc(context.di); context.cx = 12; while(context.cx--) context._movsb(); @@ -10884,7 +10884,7 @@ void signon(Context & context) { parser(context); context._inc(context.di); context.ds = context.cs; - context.si = 2807; + context.si = 2836; context.cx = 4; signonloop: context.push(context.cx); @@ -10943,7 +10943,7 @@ notyetassigned: context.push(context.bx); context._add(context.bx, 2); context.ds = context.cs; - context.si = 7816; + context.si = 8013; checkpass: context._lodsw(); context.ah = context.es.byte(context.bx); @@ -10983,7 +10983,7 @@ void showkeys(Context & context) { context.al = 18; monmessage(context); context.es = context.cs; - context.bx = 2807; + context.bx = 2836; context.cx = 4; keysloop: context.push(context.cx); @@ -11012,7 +11012,7 @@ void read(Context & context) { {assert(stack_depth == context.stack.size()); return; } okcom: context.es = context.cs; - context.di = 2892; + context.di = 2970; context.ax = context.data.word(kTextfile1); context.data.word(kMonsource) = context.ax; context.ds = context.ax; @@ -11044,7 +11044,7 @@ foundfile2: {assert(stack_depth == context.stack.size()); return; } keyok1: context.es = context.cs; - context.di = 2883; + context.di = 2942; context.ds = context.data.word(kMonsource); searchforstring(context); context._cmp(context.al, 0); @@ -11129,9 +11129,9 @@ keyok2: context.push(context.es); context.push(context.bx); context.ds = context.cs; - context.si = 2883+1; + context.si = 2942+1; context.es = context.cs; - context.di = 2892+1; + context.di = 2970+1; context.cx = 12; while(context.cx--) context._movsb(); monitorlogo(context); @@ -11174,7 +11174,7 @@ void getkeyandlogo(Context & context) { context.cx = 26; context._mul(context.cx); context.es = context.cs; - context.bx = 2807; + context.bx = 2836; context._add(context.bx, context.ax); context.al = context.es.byte(context.bx); context._cmp(context.al, 1); @@ -11243,15 +11243,15 @@ notfound: void parser(Context & context) { uint stack_depth = context.stack.size(); context.es = context.cs; - context.di = 2883; + context.di = 2942; context.cx = 13; context.al = 0; while(context.cx--) context._stosb(); - context.di = 2883; + context.di = 2942; context.al = '='; context._stosb(); context.ds = context.cs; - context.si = 7816; + context.si = 8013; notspace1: context._lodsw(); context._cmp(context.al, 32); @@ -11271,7 +11271,7 @@ copyin1: context._cmp(context.al, 32); if (!context.flags.z()) goto copyin1; finishpars: - context.di = 2883; + context.di = 2942; {assert(stack_depth == context.stack.size()); return; } } @@ -11354,7 +11354,7 @@ void showcurrentfile(Context & context) { uint stack_depth = context.stack.size(); context.di = 178; context.bx = 37; - context.si = 2892+1; + context.si = 2970+1; curfileloop: context.al = context.cs.byte(context.si); context._cmp(context.al, 0); @@ -11562,7 +11562,7 @@ nodream7: getanyad(context); context.dx = context.data; context.ds = context.dx; - context.si = 2895; + context.si = 2984; checkuselist: context.push(context.si); context._lodsb(); @@ -12551,7 +12551,7 @@ void isitright(Context & context) { uint stack_depth = context.stack.size(); context.bx = context.data; context.es = context.bx; - context.bx = 8344; + context.bx = 8541; context._cmp(context.es.byte(context.bx+0), context.al); if (!context.flags.z()) goto notright; context._cmp(context.es.byte(context.bx+1), context.ah); @@ -12965,7 +12965,7 @@ void usecashcard(Context & context) { context.di = 160; context.bx = 155; context.es = context.cs; - context.si = 3385; + context.si = 3474; context.data.word(kCharshift) = 91*2+75; context.al = 0; context.ah = 0; @@ -12974,7 +12974,7 @@ void usecashcard(Context & context) { context.di = 187; context.bx = 155; context.es = context.cs; - context.si = 3390; + context.si = 3479; context.data.word(kCharshift) = 91*2+85; context.al = 0; context.ah = 0; @@ -13044,7 +13044,7 @@ void lookatcard(Context & context) { void moneypoke(Context & context) { uint stack_depth = context.stack.size(); - context.bx = 3385; + context.bx = 3474; context.cl = 48-1; numberpoke0: context._inc(context.cl); @@ -13076,7 +13076,7 @@ numberpoke3: if (!context.flags.c()) goto numberpoke3; context._add(context.ax, 10); context.cs.byte(context.bx) = context.cl; - context.bx = 3390; + context.bx = 3479; context._add(context.al, 48); context.cs.byte(context.bx) = context.al; {assert(stack_depth == context.stack.size()); return; } @@ -13528,7 +13528,7 @@ void withwhat(Context & context) { context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context.es = context.cs; - context.di = 5674; + context.di = 5847; copyname(context); context.di = 100; context.bx = 21; @@ -13540,7 +13540,7 @@ void withwhat(Context & context) { context._add(context.di, 5); context.bx = 21; context.es = context.cs; - context.si = 5674; + context.si = 5847; context.dl = 220; context.al = 0; context.ah = 0; @@ -14594,7 +14594,7 @@ afterpress: dumppointer(context); dumpkeypad(context); dumptextline(context); - context.bx = 3393; + context.bx = 3482; checkcoords(context); context._cmp(context.data.byte(kGetback), 1); if (context.flags.z()) goto numberright; @@ -14673,7 +14673,7 @@ not10: context.bx = context.data.word(kPresspointer); context.dx = context.data; context.es = context.dx; - context._add(context.bx, 8344); + context._add(context.bx, 8541); context.es.byte(context.bx) = context.al; context._inc(context.data.word(kPresspointer)); nomorekeys: @@ -14938,7 +14938,7 @@ menuloop: dumppointer(context); dumpmenu(context); dumptextline(context); - context.bx = 3525; + context.bx = 3614; checkcoords(context); context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto menuloop; @@ -15058,7 +15058,7 @@ folderloop: vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3547; + context.bx = 3636; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto folderloop; @@ -15099,7 +15099,7 @@ donextf: delpointer(context); showfolder(context); context.data.word(kMousebutton) = 0; - context.bx = 3547; + context.bx = 3636; checkcoords(context); worktoscreenm(context); {assert(stack_depth == context.stack.size()); return; } @@ -15180,7 +15180,7 @@ dolastf: delpointer(context); showfolder(context); context.data.word(kMousebutton) = 0; - context.bx = 3547; + context.bx = 3636; checkcoords(context); worktoscreenm(context); {assert(stack_depth == context.stack.size()); return; } @@ -15437,7 +15437,7 @@ symbolloop: dumppointer(context); dumptextline(context); dumpsymbol(context); - context.bx = 3589; + context.bx = 3678; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto symbolloop; @@ -15789,7 +15789,7 @@ diaryloop: dumppointer(context); dumpdiarykeys(context); dumptextline(context); - context.bx = 3651; + context.bx = 3740; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto diaryloop; @@ -16109,7 +16109,7 @@ waitops: dumppointer(context); dumptextline(context); delpointer(context); - context.bx = 3693; + context.bx = 3782; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitops; @@ -16233,7 +16233,7 @@ loadops: vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3735; + context.bx = 3824; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto loadops; @@ -16242,7 +16242,7 @@ loadops: getridoftemp(context); context.dx = context.data; context.es = context.dx; - context.bx = 7750; + context.bx = 7947; startloading(context); loadroomssample(context); context.data.byte(kRoomloaded) = 1; @@ -16311,7 +16311,7 @@ discopsloop: vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3777; + context.bx = 3866; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto discopsloop; @@ -16355,7 +16355,7 @@ saveops: vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3819; + context.bx = 3908; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto saveops; @@ -16375,7 +16375,7 @@ alreadyactsave: if (context.flags.z()) goto noactsave; context.dx = context.data; context.ds = context.dx; - context.si = 8350; + context.si = 8547; context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -16389,9 +16389,9 @@ alreadyactsave: context.cx = 32; context._mul(context.cx); context.ds = context.cs; - context.si = 5958; + context.si = 6155; context._add(context.si, context.ax); - context.di = 7750; + context.di = 7947; context.bx = context.di; context.es = context.cs; context.cx = 16; @@ -16438,7 +16438,7 @@ alreadyactload: if (!context.flags.z()) goto notactload; context.dx = context.data; context.ds = context.dx; - context.si = 8350; + context.si = 8547; context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -16515,7 +16515,7 @@ void getnamepos(Context & context) { context._mul(context.cx); context.dx = context.data; context.es = context.dx; - context.bx = 8350; + context.bx = 8547; context._add(context.bx, context.ax); context.al = context.data.byte(kCursorpos); context.ah = 0; @@ -16669,7 +16669,7 @@ void shownames(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.si = 8350+1; + context.si = 8547+1; context.di = (60)+21; context.bx = (52)+10; context.cl = 0; @@ -16735,7 +16735,7 @@ afterprintname: void namestoold(Context & context) { uint stack_depth = context.stack.size(); context.ds = context.cs; - context.si = 8350; + context.si = 8547; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; @@ -16746,7 +16746,7 @@ void namestoold(Context & context) { void oldtonames(Context & context) { uint stack_depth = context.stack.size(); context.es = context.cs; - context.di = 8350; + context.di = 8547; context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; @@ -16764,23 +16764,23 @@ void saveposition(Context & context) { context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8469; + context.dx = 8666; context._add(context.dx, context.ax); openforsave(context); context.dx = context.data; context.ds = context.dx; - context.dx = 5862; - context.cx = (5958-5862); + context.dx = 6059; + context.cx = (6155-6059); savefilewrite(context); context.dx = context.data; context.es = context.dx; - context.di = 5912; + context.di = 6109; context.ax = context.pop(); context.cx = 17; context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8350; + context.dx = 8547; context._add(context.dx, context.ax); saveseg(context); context.dx = context.data; @@ -16795,7 +16795,7 @@ void saveposition(Context & context) { saveseg(context); context.dx = context.data; context.ds = context.dx; - context.dx = 7750; + context.dx = 7947; saveseg(context); context.dx = context.data; context.ds = context.dx; @@ -16817,21 +16817,21 @@ void loadposition(Context & context) { context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8469; + context.dx = 8666; context._add(context.dx, context.ax); openfile(context); context.ds = context.cs; - context.dx = 5862; - context.cx = (5958-5862); + context.dx = 6059; + context.cx = (6155-6059); savefileread(context); context.es = context.cs; - context.di = 5912; + context.di = 6109; context.ax = context.pop(); context.cx = 17; context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8350; + context.dx = 8547; context._add(context.dx, context.ax); loadseg(context); context.dx = context.data; @@ -16846,7 +16846,7 @@ void loadposition(Context & context) { loadseg(context); context.dx = context.data; context.ds = context.dx; - context.dx = 7750; + context.dx = 7947; loadseg(context); context.ds = context.cs; context.dx = 534; @@ -16859,7 +16859,7 @@ void makeheader(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.di = 5912; + context.di = 6109; context.ax = 17; storeit(context); context.ax = (68-0); @@ -16904,10 +16904,10 @@ void scanfornames(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.di = 8350; + context.di = 8547; context.dx = context.data; context.ds = context.dx; - context.dx = 8469; + context.dx = 8666; context.cx = 7; scanloop: context.push(context.es); @@ -16924,12 +16924,12 @@ scanloop: context.push(context.es); context.dx = context.data; context.ds = context.dx; - context.dx = 5862; - context.cx = (5958-5862); + context.dx = 6059; + context.cx = (6155-6059); savefileread(context); context.dx = context.data; context.es = context.dx; - context.di = 5912; + context.di = 6109; context.ds = context.pop(); context.dx = context.pop(); loadseg(context); @@ -16973,7 +16973,7 @@ waitdecide: dumppointer(context); dumptextline(context); delpointer(context); - context.bx = 4884; + context.bx = 5057; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waitdecide; @@ -17036,7 +17036,7 @@ loadops: vsync(context); dumppointer(context); dumptextline(context); - context.bx = 3735; + context.bx = 3824; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto loadops; @@ -17045,7 +17045,7 @@ loadops: getridoftemp(context); context.dx = context.data; context.es = context.dx; - context.bx = 7750; + context.bx = 7947; startloading(context); loadroomssample(context); context.data.byte(kRoomloaded) = 1; @@ -17087,7 +17087,7 @@ noloadold: void createname(Context & context) { uint stack_depth = context.stack.size(); context.push(context.ax); - context.di = 4932; + context.di = 5105; context.cs.byte(context.di+0) = context.dl; context.cs.byte(context.di+3) = context.cl; context.al = context.dh; @@ -17811,7 +17811,7 @@ void clearchanges(Context & context) { context.di = 0; while(context.cx--) context._stosw(); context.es = context.cs; - context.di = 7782; + context.di = 7979; context.al = 1; context._stosb(); context._stosb(); @@ -18413,10 +18413,10 @@ toofaraway: void mainscreen(Context & context) { uint stack_depth = context.stack.size(); context.data.byte(kInmaparea) = 0; - context.bx = 4949; + context.bx = 5122; context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto checkmain; - context.bx = 5011; + context.bx = 5184; checkmain: checkcoords(context); context._cmp(context.data.byte(kWalkandexam), 0); @@ -18954,7 +18954,7 @@ void atmospheres(Context & context) { uint stack_depth = context.stack.size(); context.cl = context.data.byte(kMapx); context.ch = context.data.byte(kMapy); - context.bx = 5073; + context.bx = 5246; nextatmos: context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); @@ -19200,7 +19200,7 @@ void commandwithob(Context & context) { context.ah = 0; printdirect(context); context.ax = context.pop(); - context.di = 5674; + context.di = 5847; copyname(context); context.ax = context.pop(); context.di = context.data.word(kLastxpos); @@ -19210,7 +19210,7 @@ void commandwithob(Context & context) { noadd: context.bx = context.data.word(kTextaddressy); context.es = context.cs; - context.si = 5674; + context.si = 5847; context.dl = context.data.byte(kTextlen); context.al = 0; context.ah = 0; @@ -19490,7 +19490,7 @@ void bresenhams(Context & context) { workoutframes(context); context.dx = context.data; context.es = context.dx; - context.di = 7944; + context.di = 8141; context.si = 1; context.data.byte(kLinedirection) = 0; context.cx = context.data.word(kLineendx); @@ -19592,7 +19592,7 @@ line23: context._inc(context.al); if (--context.cx) goto hiloop; lineexit: - context._sub(context.di, 7944); + context._sub(context.di, 8141); context.ax = context.di; context._shr(context.ax, 1); context.data.byte(kLinelength) = context.al; @@ -20038,7 +20038,7 @@ void showblink(Context & context) { context.al = 6; nomorethan6: context.ah = 0; - context.bx = 5691; + context.bx = 5888; context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); context.ds = context.data.word(kIcons1); @@ -20477,7 +20477,7 @@ rightspeed3: finflashmouse: context.al = context.data.byte(kPointercount); context.ah = 0; - context.bx = 5698; + context.bx = 5895; context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); context.data.byte(kPointerframe) = context.al; @@ -20574,7 +20574,7 @@ void readkey(Context & context) { context._inc(context.bx); context._and(context.bx, 15); context.data.word(kBufferout) = context.bx; - context.di = 5715; + context.di = 5912; context._add(context.di, context.bx); context.al = context.cs.byte(context.di); context.data.byte(kCurrentkey) = context.al; @@ -20588,7 +20588,7 @@ void convertkey(Context & context) { uint stack_depth = context.stack.size(); context._and(context.al, 127); context.ah = 0; - context.di = 5731; + context.di = 5928; context._add(context.di, context.ax); context.al = context.cs.byte(context.di); {assert(stack_depth == context.stack.size()); return; } @@ -21132,7 +21132,7 @@ void getroomdata(Context & context) { context.ah = 0; context.cx = 32; context._mul(context.cx); - context.bx = 5958; + context.bx = 6155; context._add(context.bx, context.ax); {assert(stack_depth == context.stack.size()); return; } } @@ -21140,11 +21140,11 @@ void getroomdata(Context & context) { void readheader(Context & context) { uint stack_depth = context.stack.size(); context.ds = context.cs; - context.dx = 5862; - context.cx = (5958-5862); + context.dx = 6059; + context.cx = (6155-6059); readfromfile(context); context.es = context.cs; - context.di = 5912; + context.di = 6109; {assert(stack_depth == context.stack.size()); return; } } @@ -21544,236 +21544,248 @@ void __start(Context &context) { 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, - 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x48, 0x45, 0x4c, - 0x50, 0x20, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x4c, 0x4f, 0x47, 0x4f, - 0x4e, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, - 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, - 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, - 0x4e, 0x44, 0x52, 0x49, 0x58, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x00, 0x00, 0x00, 0x53, - 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, - 0x00, 0xff, 0xff, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x00, 0x22, 0x20, 0x00, 0x4e, - 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, - 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, - 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, - 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, - 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, - 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, - 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, - 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, - 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, - 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, - 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, - 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, - 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, - 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, - 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, - 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, - 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, - 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, - 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, - 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, - 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, - 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, - 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, - 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, - 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, - 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, - 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, - 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, - 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, - 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, - 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, - 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, - 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, - 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, - 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, - 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, - 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, - 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, - 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, - 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, - 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, - 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, - 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, - 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, - 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, - 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, - 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, - 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, - 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, - 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, - 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, - 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, - 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, - 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, - 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, - 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, - 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, - 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, - 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, - 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, - 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, - 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, - 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, - 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, - 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, + 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, + 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, + 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, + 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, + 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, + 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, + 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, + 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, + 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, + 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, + 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, + 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, + 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, + 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, + 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, + 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, + 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, + 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, + 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, + 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, + 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, + 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, + 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, + 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, + 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, + 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, + 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, + 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, + 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, + 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, + 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, + 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, + 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, + 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, + 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, + 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, + 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, + 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, + 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, + 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, + 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, + 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, + 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, + 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, + 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, + 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, + 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, + 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, + 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, + 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, + 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, + 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, + 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, + 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, + 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, + 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, + 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, + 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, + 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, + 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, + 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, - 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, - 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, - 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, - 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, - 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, - 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, - 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, - 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, - 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, - 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, - 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, - 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, - 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, - 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, - 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, - 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, - 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, - 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, - 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, - 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, - 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, - 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, - 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, - 0x44, 0x31, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, - 0x65, 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, - 0x0d, 0x0a, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, - 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, - 0x30, 0x68, 0x0d, 0x0a, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x49, 0x35, - 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, - 0x6f, 0x66, 0x20, 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, - 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, - 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, - 0x75, 0x72, 0x20, 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, - 0x93, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, - 0xc4, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, - 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, - 0x00, 0x87, 0x83, 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, - 0x00, 0x32, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, - 0x00, 0x28, 0xc8, 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, - 0x01, 0x64, 0x00, 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, - 0xc9, 0xff, 0xff, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, - 0x00, 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, - 0xc8, 0x12, 0x01, 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, - 0x00, 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, - 0xff, 0x00, 0x21, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, - 0x00, 0x0b, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, - 0x2c, 0x0a, 0x06, 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, - 0x00, 0x05, 0xff, 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, - 0x0f, 0xff, 0x03, 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, - 0xff, 0x04, 0x16, 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, - 0x0a, 0x16, 0x1e, 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, - 0x16, 0x1e, 0x10, 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, - 0x1e, 0x06, 0xff, 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, - 0x0f, 0xff, 0x06, 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, - 0xff, 0x07, 0x00, 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, - 0x05, 0x16, 0x1e, 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, - 0x16, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, - 0x0a, 0x0f, 0xff, 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, - 0x06, 0xff, 0x08, 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, - 0xff, 0x08, 0x21, 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, - 0x0b, 0x0b, 0x14, 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, - 0x16, 0x1e, 0x0c, 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, - 0x14, 0x0c, 0xff, 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, - 0x0c, 0xff, 0x0e, 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, - 0xff, 0x0e, 0x16, 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, - 0x14, 0x00, 0x1e, 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, - 0x0b, 0x28, 0x10, 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, - 0x14, 0x0f, 0xff, 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, - 0x0f, 0xff, 0x15, 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, - 0xff, 0x17, 0x16, 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, - 0x17, 0x0b, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, - 0x0b, 0x28, 0x10, 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, - 0x14, 0x10, 0xff, 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, - 0x0c, 0xff, 0x2d, 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, - 0xff, 0x2e, 0x0b, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, - 0x2f, 0x00, 0x00, 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, - 0x21, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, - 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, - 0x10, 0xff, 0x1a, 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, - 0xff, 0x1a, 0x0b, 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, - 0x1c, 0x00, 0x28, 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, - 0x16, 0x1e, 0x0f, 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, - 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, - 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30, 0x2d, - 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, 0x4f, 0x50, 0x00, 0x00, 0x0d, - 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, - 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, + 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, + 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, + 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, + 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, + 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, + 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, + 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, + 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, + 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, + 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, + 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, + 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, + 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, + 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, + 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, + 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, + 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, + 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, + 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, + 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, + 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, + 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, + 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, + 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, + 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, + 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, + 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, + 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, + 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, + 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, + 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, + 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, + 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, + 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, + 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, + 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, + 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, + 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, + 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, + 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, + 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, + 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, + 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, + 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, + 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, + 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, + 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, + 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, + 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, + 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, + 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, + 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, + 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, + 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, + 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, + 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, + 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, + 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, + 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, + 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, + 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, + 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, + 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, + 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, + 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, + 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, + 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, + 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, + 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, + 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x44, - 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, - 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x56, 0x45, - 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, + 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, + 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0xff, 0x03, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x07, 0x02, 0xff, 0xff, 0xff, - 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, - 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0x00, 0x02, 0x04, - 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x00, 0x05, 0xff, - 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x00, 0x04, 0xff, - 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x01, 0x02, - 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0xff, 0xff, 0xff, - 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0xff, 0xff, 0xff, - 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x04, 0x06, 0xff, 0xff, 0xff, - 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x02, 0x00, 0xff, 0xff, 0x02, - 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -21781,85 +21793,85 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x01, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0x01, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x03, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0x0f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x04, 0x02, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x01, 0x0f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x06, 0x02, 0xff, 0x04, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0x00, 0xff, 0xff, - 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0x02, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x01, 0x04, 0x02, 0x0f, 0x01, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x02, 0x02, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, 0x03, 0x06, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x04, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x52, - 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, - 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, + 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -21867,7 +21879,8 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 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, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -21892,21 +21905,21 @@ void __start(Context &context) { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, - 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x31, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, - 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x36, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, 0x4d, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, + 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -21922,7 +21935,7 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; + 0x00, 0x00, }; context.ds.assign(src, src + sizeof(src)); dreamweb(context); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 621c0c2c8d..f97099d697 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -531,23 +531,23 @@ namespace dreamgen { const static uint16 kTitle6graphics = 2455; const static uint16 kTitle7graphics = 2468; const static uint16 kPalettescreen = 2481; - const static uint16 kCurrentfile = 2892; - const static uint16 kDmaaddresses = 4945; - const static uint16 kFileheader = 5862; - const static uint16 kFiledata = 5912; - const static uint16 kExtradata = 5952; - const static uint16 kRoomdata = 5958; - const static uint16 kMadeuproomdat = 7750; - const static uint16 kRoomscango = 7782; - const static uint16 kRoompics = 7798; - const static uint16 kOplist = 7813; - const static uint16 kInputline = 7816; - const static uint16 kLinedata = 7944; - const static uint16 kPresslist = 8344; - const static uint16 kSavenames = 8350; - const static uint16 kSavefiles = 8469; - const static uint16 kRecname = 8560; - const static uint16 kStak = 8573; + const static uint16 kCurrentfile = 2970; + const static uint16 kDmaaddresses = 5118; + const static uint16 kFileheader = 6059; + const static uint16 kFiledata = 6109; + const static uint16 kExtradata = 6149; + const static uint16 kRoomdata = 6155; + const static uint16 kMadeuproomdat = 7947; + const static uint16 kRoomscango = 7979; + const static uint16 kRoompics = 7995; + const static uint16 kOplist = 8010; + const static uint16 kInputline = 8013; + const static uint16 kLinedata = 8141; + const static uint16 kPresslist = 8541; + const static uint16 kSavenames = 8547; + const static uint16 kSavefiles = 8666; + const static uint16 kRecname = 8757; + const static uint16 kStak = 8770; const static uint16 kBlocktextdat = (0); const static uint16 kPersonframes = (0); const static uint16 kDebuglevel1 = (0); @@ -624,10 +624,10 @@ namespace dreamgen { const static uint16 kOpsy = (52); const static uint16 kSymboly = (56); const static uint16 kInventy = (58); - const static uint16 kHeaderlen = (5958-5862); const static uint16 kMenuy = (60); const static uint16 kOpsx = (60); const static uint16 kMaplength = (60); + const static uint16 kHeaderlen = (6155-6059); const static uint16 kSymbolx = (64); const static uint16 kSetdatlen = (64*128); const static uint16 kMapwidth = (66); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 3af867552d..8925817dcf 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -248,7 +248,7 @@ void DreamWebEngine::keyPressed(uint16 ascii) { if (ascii >= 'a' && ascii <= 'z') ascii = (ascii - 'a') + 'A'; debug(1, "key pressed = %04x", ascii); - uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts + uint8* keybuf = _context.data.ptr(5912, 16); //fixme: some hardcoded offsets are not added as consts uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) & 0x0f; uint16 out = _context.data.word(dreamgen::kBufferout); if (in == out) { @@ -807,7 +807,7 @@ void showpcx(Context &context) { pcxFile.seek(16, SEEK_SET); context.es = context.data.word(kBuffers); - maingamepal = context.es.ptr(4782, 768); + maingamepal = context.es.ptr(4782, 768); //fixme: hardcoded offset pcxFile.read(maingamepal, 48); memset(maingamepal + 48, 0xff, 720); -- cgit v1.2.3 From ff128eae14276f5ce92f2222088e1b47b905ce28 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 15:26:08 +0400 Subject: DREAMWEB: fixed crash after exit of the monitor --- engines/dreamweb/dreamgen.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index dca8d5fa17..de1a204e02 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -10330,8 +10330,6 @@ endmon: playchannel1(context); context.data.byte(kManisoffscreen) = 0; restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); {assert(stack_depth == context.stack.size()); return; } } -- cgit v1.2.3 From e7b6859274cf20d665be151253fcef635e06774c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 15:50:16 +0400 Subject: DREAMWEB: fixed memory corruption in multiput/multiget --- engines/dreamweb/dreamweb.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8925817dcf..dbc2a8f5e9 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -247,7 +247,7 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { void DreamWebEngine::keyPressed(uint16 ascii) { if (ascii >= 'a' && ascii <= 'z') ascii = (ascii - 'a') + 'A'; - debug(1, "key pressed = %04x", 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::kBufferin) + 1) & 0x0f; uint16 out = _context.data.word(dreamgen::kBufferout); @@ -385,14 +385,19 @@ Common::String getFilename(Context &context) { void multiget(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned src = (uint16)context.di + (uint16)context.bx * kScreenwidth; + unsigned x = (uint16)context.di, y = (uint16)context.bx; + unsigned src = x + y * kScreenwidth; unsigned dst = (uint16)context.si; context.es = context.ds; context.ds = context.data.word(kWorkspace); - //debug(1, "multiget %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); - for(unsigned y = 0; y < h; ++y) { - uint8 *src_p = context.ds.ptr(src + kScreenwidth * y, w); - uint8 *dst_p = context.es.ptr(dst + w * y, w); + if (y + h > 200) + 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)context.ds, (uint16)context.es); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + kScreenwidth * l, w); + uint8 *dst_p = context.es.ptr(dst + w * l, w); memcpy(dst_p, src_p, w); } context.si += w * h; @@ -402,13 +407,18 @@ void multiget(Context &context) { void multiput(Context &context) { unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned x = (uint16)context.di, y = (uint16)context.bx; unsigned src = (uint16)context.si; - unsigned dst = (uint16)context.di + (uint16)context.bx * kScreenwidth; + unsigned dst = x + y * kScreenwidth; context.es = context.data.word(kWorkspace); + if (y + h > 200) + h = 200 - y; + if (x + w > 320) + w = 320 - x; //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); - for(unsigned y = 0; y < h; ++y) { - uint8 *src_p = context.ds.ptr(src + w * y, w); - uint8 *dst_p = context.es.ptr(dst + kScreenwidth * y, w); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + w * l, w); + uint8 *dst_p = context.es.ptr(dst + kScreenwidth * l, w); memcpy(dst_p, src_p, w); } context.si += w * h; -- cgit v1.2.3 From 09346f01d7caa18dbfeed94f4913686e5f00169d Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 17:33:44 +0400 Subject: DREAMWEB: added sound handling stub --- engines/dreamweb/dreamweb.cpp | 59 +++++++++++++++++++++++++++++++++++++++---- engines/dreamweb/dreamweb.h | 6 +++-- 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index dbc2a8f5e9..6b7eef1591 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -111,6 +111,7 @@ void DreamWebEngine::processEvents() { quit(); return; } + soundHandler(); Common::Event event; while (event_manager->pollEvent(event)) { bool keyHandled = false; @@ -364,11 +365,28 @@ void DreamWebEngine::printUnderMonitor() { _system->unlockScreen(); } - void DreamWebEngine::cls() { _system->fillScreen(0); } +void DreamWebEngine::soundHandler() { + uint volume = _context.data.byte(dreamgen::kVolume); + uint ch0 = _context.data.byte(dreamgen::kCh0playing); + if (ch0 == 255) + ch0 = 0; + uint ch1 = _context.data.byte(dreamgen::kCh1playing); + if (ch1 == 255) + ch1 = 0; + uint ch0loop = _context.data.byte(dreamgen::kCh0repeat); + if (ch0 || ch1) + debug("volume: %u, samples: %u, %u, loop0: %u", volume, ch0, ch1, ch0loop); +} + +void DreamWebEngine::loadSounds(uint bank, const Common::String &file) { + debug(1, "loadSounds(%u, %s)", bank, file.c_str()); +} + + } // End of namespace DreamWeb @@ -669,15 +687,46 @@ void setsoundoff(Context &context) { void readheader(Context &context); void loadsample(Context &context) { - warning("loadsample: STUB"); + context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); + /* openfile(context); + readheader(context); + context.bx = context.es.word(context.di); + context.push(context.es); + context.push(context.di); + context.push(context.bx); + context.ds = context.data.word(kSounddata); + context.cx = context.pop(); + context.dx = 0; + readfromfile(context); + context.di = context.pop(); + context.es = context.pop(); + context._add(context.di, 2); + context.bx = 0; + context.dx = context.es.word(context.di); + context._add(context.dx, 1); + context._shr(context.dx, 1); + //debug(1, "dx = %u", (uint16)context.dx); + uint32 size = 0x8000 * context.dx; + debug(1, "file size = %u", size); + context.engine->loadSounds(0, size); + closefile(context); + */ } +void cancelch0(Context &context); +void cancelch1(Context &context); + + void loadsecondsample(Context &context) { - warning("loadsecondsample: STUB"); - openfile(context); - closefile(context); + uint8 ch0 = context.data.byte(kCh0playing); + if (ch0 >= 12 && ch0 != 255) + cancelch0(context); + uint8 ch1 = context.data.byte(kCh1playing); + if (ch1 >= 12) + cancelch1(context); + context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); } void loadspeech(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index f61c113e30..507a3a906a 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -100,11 +100,12 @@ public: void quit(); -private: + void loadSounds(uint bank, const Common::String &file); +private: void keyPressed(uint16 ascii); - void setSpeed(uint speed); + void soundHandler(); const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; @@ -115,6 +116,7 @@ private: uint _speed; uint _oldMouseState; + Common::Array _samples[2]; dreamgen::Context _context; }; -- cgit v1.2.3 From 5a8b1dbfff587fe0eb689d81eed60fe879fb8f36 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 19:05:59 +0400 Subject: DREAMWEB: catch the sample changing, more stubs --- engines/dreamweb/dreamweb.cpp | 19 +++++++++++++++++-- engines/dreamweb/dreamweb.h | 5 +++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 6b7eef1591..0c2f7b4a61 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -68,6 +68,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _inSaveFile = 0; _speed = 1; _oldMouseState = 0; + _channel0 = 0; + _channel1 = 0; } DreamWebEngine::~DreamWebEngine() { @@ -378,8 +380,21 @@ void DreamWebEngine::soundHandler() { if (ch1 == 255) ch1 = 0; uint ch0loop = _context.data.byte(dreamgen::kCh0repeat); - if (ch0 || ch1) - debug("volume: %u, samples: %u, %u, loop0: %u", volume, ch0, ch1, ch0loop); + + if (_channel0 != ch0) { + _channel0 = ch0; + if (ch0) { + //Audio::AudioStream *stream = LoopingAudioStream(Audio::makeRawStream(data, size, 22050, 0), ch0loops); + //_mixer->playStream(Audio::Mixer::kMusicType, &_musicHandle, stream); //dispose is YES by default + debug(1, "playing sound %u at channel 0, loop: %u", ch0, ch0loop); + } + } + if (_channel1 != ch1) { + _channel1 = ch1; + if (ch1) { + debug(1, "playing sound %u at channel 1", ch1); + } + } } void DreamWebEngine::loadSounds(uint bank, const Common::String &file) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 507a3a906a..7dabbc80c5 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -33,6 +33,9 @@ #include "common/savefile.h" #include "common/scummsys.h" +#include "audio/audiostream.h" +#include "audio/mixer.h" + #include "engines/engine.h" #include "dreamweb/dreamgen.h" #include "dreamweb/console.h" @@ -117,6 +120,8 @@ private: uint _speed; uint _oldMouseState; Common::Array _samples[2]; + Audio::SoundHandle _musicHandle, _soundHandle; + uint _channel0, _channel1; dreamgen::Context _context; }; -- cgit v1.2.3 From 74dfc349373e04d4243f3449c3f4939f8027c54f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 20:19:27 +0400 Subject: DREAMWEB: added sounds loading --- engines/dreamweb/dreamweb.cpp | 32 +++++++++++++++++++++++++++++--- engines/dreamweb/dreamweb.h | 14 +++++++++++++- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0c2f7b4a61..4614637151 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -372,7 +372,7 @@ void DreamWebEngine::cls() { } void DreamWebEngine::soundHandler() { - uint volume = _context.data.byte(dreamgen::kVolume); + //uint volume = _context.data.byte(dreamgen::kVolume); uint ch0 = _context.data.byte(dreamgen::kCh0playing); if (ch0 == 255) ch0 = 0; @@ -397,8 +397,34 @@ void DreamWebEngine::soundHandler() { } } -void DreamWebEngine::loadSounds(uint bank, const Common::String &file) { - debug(1, "loadSounds(%u, %s)", bank, file.c_str()); +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(); } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 7dabbc80c5..eff955c990 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -119,7 +119,19 @@ private: uint _speed; uint _oldMouseState; - Common::Array _samples[2]; + + struct Sample { + uint offset; + uint size; + }; + + struct SoundData { + Common::Array samples; + Common::Array data; + }; + + SoundData _soundData[2]; + Audio::SoundHandle _musicHandle, _soundHandle; uint _channel0, _channel1; -- cgit v1.2.3 From 1955df129fc1dc17181b1ec18c3fa7c98a18f79f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 20:50:21 +0400 Subject: DREAMWEB: added sound support --- engines/dreamweb/dreamweb.cpp | 46 +++++++++++++++++++++++++++++++++++++++---- engines/dreamweb/dreamweb.h | 6 +++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 4614637151..0996aaee7a 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -36,6 +36,7 @@ #include "engines/util.h" #include "audio/mixer.h" +#include "audio/decoders/raw.h" #include "graphics/palette.h" #include "graphics/surface.h" @@ -371,15 +372,50 @@ void DreamWebEngine::cls() { _system->fillScreen(0); } +void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { + const SoundData &data = _soundData[id >= 12? 1: 0]; + + Audio::Mixer::SoundType type; + if (id >= 12) { + id -= 12; + type = Audio::Mixer::kSFXSoundType; + } else + type = Audio::Mixer::kMusicSoundType; + + if (id >= data.samples.size()) { + 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); + + Audio::SeekableAudioStream *raw = Audio::makeRawStream( + buffer, + sample.size, 22050, Audio::FLAG_UNSIGNED); + + Audio::AudioStream *stream; + if (loops > 1) { + stream = new Audio::LoopingAudioStream(raw, loops < 255? loops: 0); + } else + stream = raw; + + _mixer->playStream(type, &_channelHandle[channel], stream); +} + void DreamWebEngine::soundHandler() { - //uint volume = _context.data.byte(dreamgen::kVolume); - uint ch0 = _context.data.byte(dreamgen::kCh0playing); + //uint8 volume = _context.data.byte(dreamgen::kVolume); + uint8 ch0 = _context.data.byte(dreamgen::kCh0playing); if (ch0 == 255) ch0 = 0; - uint ch1 = _context.data.byte(dreamgen::kCh1playing); + uint8 ch1 = _context.data.byte(dreamgen::kCh1playing); if (ch1 == 255) ch1 = 0; - uint ch0loop = _context.data.byte(dreamgen::kCh0repeat); + uint8 ch0loop = _context.data.byte(dreamgen::kCh0repeat); if (_channel0 != ch0) { _channel0 = ch0; @@ -387,12 +423,14 @@ void DreamWebEngine::soundHandler() { //Audio::AudioStream *stream = LoopingAudioStream(Audio::makeRawStream(data, size, 22050, 0), ch0loops); //_mixer->playStream(Audio::Mixer::kMusicType, &_musicHandle, stream); //dispose is YES by default debug(1, "playing sound %u at channel 0, loop: %u", ch0, ch0loop); + playSound(0, ch0, ch0loop); } } if (_channel1 != ch1) { _channel1 = ch1; if (ch1) { debug(1, "playing sound %u at channel 1", ch1); + playSound(1, ch1, ch0loop); } } } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index eff955c990..447aff931f 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -109,6 +109,7 @@ private: void keyPressed(uint16 ascii); void setSpeed(uint speed); void soundHandler(); + void playSound(uint8 channel, uint8 id, uint8 loops); const DreamWebGameDescription *_gameDescription; Common::RandomSource _rnd; @@ -129,11 +130,10 @@ private: Common::Array samples; Common::Array data; }; - SoundData _soundData[2]; - Audio::SoundHandle _musicHandle, _soundHandle; - uint _channel0, _channel1; + Audio::SoundHandle _channelHandle[2]; + uint8 _channel0, _channel1; dreamgen::Context _context; }; -- cgit v1.2.3 From 7e7152df286c84b9e6592d3d6823bde87a557659 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 20:52:54 +0400 Subject: DREAMWEB: removed looping on channel1 --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0996aaee7a..b318c856c5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -430,7 +430,7 @@ void DreamWebEngine::soundHandler() { _channel1 = ch1; if (ch1) { debug(1, "playing sound %u at channel 1", ch1); - playSound(1, ch1, ch0loop); + playSound(1, ch1, 1); } } } -- cgit v1.2.3 From daab18a7be8b5302699dc55f6dd3505195396852 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 21:00:40 +0400 Subject: DREAMWEB: stop previous sound if it's still active --- engines/dreamweb/dreamweb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b318c856c5..b36a372905 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -404,6 +404,8 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { } else stream = raw; + if (_mixer->isSoundHandleActive(_channelHandle[channel])) + _mixer->stopHandle(_channelHandle[channel]); _mixer->playStream(type, &_channelHandle[channel], stream); } -- cgit v1.2.3 From 8ede458e7766e0c3335e59129bc3ef29509a01cd Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 22:24:53 +0400 Subject: DREAMWEB: fixed invalid channel, removed junk --- engines/dreamweb/dreamweb.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index b36a372905..01bedbf077 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -768,32 +768,7 @@ void setsoundoff(Context &context) { void readheader(Context &context); void loadsample(Context &context) { - context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); - /* - openfile(context); - readheader(context); - context.bx = context.es.word(context.di); - context.push(context.es); - context.push(context.di); - context.push(context.bx); - context.ds = context.data.word(kSounddata); - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - context.di = context.pop(); - context.es = context.pop(); - context._add(context.di, 2); - context.bx = 0; - context.dx = context.es.word(context.di); - context._add(context.dx, 1); - context._shr(context.dx, 1); - //debug(1, "dx = %u", (uint16)context.dx); - uint32 size = 0x8000 * context.dx; - debug(1, "file size = %u", size); - context.engine->loadSounds(0, size); - - closefile(context); - */ + context.engine->loadSounds(0, (const char *)context.data.ptr(context.dx, 13)); } void cancelch0(Context &context); -- cgit v1.2.3 From 0946aa81bd2bf8c02a4f2d75b01709173fcda3da Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 22:25:34 +0400 Subject: DREAMWEB: added operator= for segmentref --- engines/dreamweb/runtime.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index adbf333bd6..e9caf37368 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -137,6 +137,13 @@ public: 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); -- cgit v1.2.3 From 5cccea42e5a9bccdb85a764253d5fba2ed9fa3f3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 22:25:48 +0400 Subject: DREAMWEB: regenerated the source --- engines/dreamweb/dreamgen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index de1a204e02..5891e719a0 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -20819,6 +20819,7 @@ dontrestore: void restoreall(Context & context) { uint stack_depth = context.stack.size(); + clearsprites(context); context.al = context.data.byte(kLocation); getroomdata(context); context.dx = context.bx; -- cgit v1.2.3 From 8c9d00966fa061f44db6ceb3b14bed931157f46c Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 22:41:51 +0400 Subject: DREAMWEB: removed hacks, regenerated source --- engines/dreamweb/dreamgen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 5891e719a0..dca8d5fa17 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -10330,6 +10330,8 @@ endmon: playchannel1(context); context.data.byte(kManisoffscreen) = 0; restoreall(context); + redrawmainscrn(context); + worktoscreenm(context); {assert(stack_depth == context.stack.size()); return; } } @@ -20819,7 +20821,6 @@ dontrestore: void restoreall(Context & context) { uint stack_depth = context.stack.size(); - clearsprites(context); context.al = context.data.byte(kLocation); getroomdata(context); context.dx = context.bx; -- cgit v1.2.3 From 78b1a6061147b4f47d5ac61d1b50a83784e58ea7 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 22:42:12 +0400 Subject: DREAMWEB: patch sprite table after deallocating segment with sprites. --- engines/dreamweb/dreamweb.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 01bedbf077..eea3b725db 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -681,9 +681,25 @@ void allocatemem(Context &context) { } void deallocatemem(Context &context) { - debug(1, "deallocating segment %04x", (uint16)context.es); - context.deallocateSegment(context.es); + uint16 id = (uint16)context.es; + debug(1, "deallocating segment %04x", id); + context.deallocateSegment(id); + + //fixing invalid entries in the sprite table context.es = context.data; + uint tsize = 16 * 32; + uint16 bseg = context.data.word(kBuffers); + if (!bseg) + return; + SegmentRef buffers(&context); + buffers = bseg; + uint8 *ptr = buffers.ptr(kSpritetable, tsize); + 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) + memset(ptr + i, 0xff, 32); + } } void removeemm(Context &context) { -- cgit v1.2.3 From bf28698bca958081481f189b01aaf8a20a1d4f36 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 13 Jun 2011 23:33:31 +0400 Subject: DREAMWEB: fixed shakeTable to do not pass negative values into backend, added CTRL-c statue puzzle solver shortcut --- engines/dreamweb/dreamweb.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index eea3b725db..2daf905b3e 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -137,6 +137,13 @@ void DreamWebEngine::processEvents() { keyHandled = true; } break; + case Common::KEYCODE_c: //skip statue puzzle + if (event.kbd.flags & Common::KBD_CTRL) { + _context.data.byte(dreamgen::kSymbolbotnum) = 3; + _context.data.byte(dreamgen::kSymboltopnum) = 5; + keyHandled = true; + } + break; default: break; } @@ -900,7 +907,8 @@ void doshake(Context &context) { 0, -2, 3, -2, 0, 2, 4, -1, 1, -3, 3, 0, }; - context.engine->setShakePos(shakeTable[counter]); + int offset = shakeTable[counter]; + context.engine->setShakePos(offset >= 0? offset: -offset); } void vsync(Context &context) { -- cgit v1.2.3 From 932abf8c3bf023d635e8903ae7132c7c2b388762 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 00:53:14 +0400 Subject: DREAMWEB: regenerated sources with CD option on --- engines/dreamweb/dreamgen.cpp | 321 +++++++++++++++++++++++++++--------------- engines/dreamweb/dreamgen.h | 35 ++--- engines/dreamweb/dreamweb.cpp | 79 ++++++++--- engines/dreamweb/dreamweb.h | 3 + 4 files changed, 285 insertions(+), 153 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index dca8d5fa17..187f1f9981 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -29,6 +29,7 @@ void fadescreendown(Context &context); void hangon(Context &context); void fadescreendowns(Context &context); void endgame(Context &context); +void makename(Context &context); void standardload(Context &context); void getroomspaths(Context &context); void readheader(Context &context); @@ -1660,6 +1661,7 @@ notmonk2text2: notmonk2text3: context._cmp(context.data.byte(kIntrocount), 10); if (!context.flags.z()) goto notmonk2text4; + context.data.byte(kIntrocount) = 12; context.al = 11; context.bl = 0; context.bh = 105; @@ -1668,6 +1670,8 @@ notmonk2text3: notmonk2text4: context._cmp(context.data.byte(kIntrocount), 13); if (!context.flags.z()) goto notmonk2text5; + context.data.byte(kIntrocount) = 17; + {assert(stack_depth == context.stack.size()); return; } context.al = 12; context.bl = 0; context.bh = 120; @@ -1708,7 +1712,7 @@ notmonk2text8: context.cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.data.byte(kIntrocount), 28); + context._cmp(context.data.byte(kIntrocount), 27); if (!context.flags.z()) goto notmonk2text10; context.al = 17; context.bl = 36; @@ -1763,6 +1767,10 @@ notintro1text3: gotintro1text: context.dx = 1; context.ah = 82; + context._cmp(context.data.byte(kCh1playing), 255); + if (context.flags.z()) goto oktalk2; + context._dec(context.data.byte(kIntrocount)); + {assert(stack_depth == context.stack.size()); return; } oktalk2: setuptimedtemp(context); {assert(stack_depth == context.stack.size()); return; } @@ -1804,7 +1812,7 @@ void intro3text(Context & context) { context.cx = 100; goto gotintro3text; notintro3text1: - context._cmp(context.ax, 109); + context._cmp(context.ax, 108); if (!context.flags.z()) goto notintro3text2; context.al = 46; context.bl = 36; @@ -2059,13 +2067,13 @@ notfirstmad: context.bx = context.pop(); context.es = context.pop(); context.ax = 53; - context._cmp(context.data.byte(kCombatcount), 62); + context._cmp(context.data.byte(kCombatcount), 64); if (context.flags.c()) goto nomadspeak; - context._cmp(context.data.byte(kCombatcount), 68); + context._cmp(context.data.byte(kCombatcount), 70); if (context.flags.z()) goto killryan; context._cmp(context.data.byte(kLastweapon), 8); if (!context.flags.z()) goto nomadspeak; - context.data.byte(kCombatcount) = 70; + context.data.byte(kCombatcount) = 72; context.data.byte(kLastweapon) = -1; context.data.byte(kMadmanflag) = 1; context.ax = 67; @@ -2099,14 +2107,12 @@ ryansded: void madmantext(Context & context) { uint stack_depth = context.stack.size(); - context._cmp(context.data.byte(kCombatcount), 61); + context._cmp(context.data.byte(kSpeechcount), 63); if (!context.flags.c()) goto nomadtext; - context.al = context.data.byte(kCombatcount); - context._and(context.al, 3); + context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto nomadtext; - context.al = context.data.byte(kCombatcount); - context._shr(context.al, 1); - context._shr(context.al, 1); + context.al = context.data.byte(kSpeechcount); + context._inc(context.data.byte(kSpeechcount)); context._add(context.al, 47); context.bl = 72; context.bh = 80; @@ -2122,9 +2128,9 @@ void madmode(Context & context) { uint stack_depth = context.stack.size(); context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; - context._cmp(context.data.byte(kCombatcount), 63); + context._cmp(context.data.byte(kCombatcount), 65); if (context.flags.c()) goto iswatchmad; - context._cmp(context.data.byte(kCombatcount), 68); + context._cmp(context.data.byte(kCombatcount), 70); if (!context.flags.c()) goto iswatchmad; context.data.byte(kPointermode) = 2; iswatchmad: @@ -2162,7 +2168,7 @@ void textforend(Context & context) { context.cx = 60; goto gotendtext; notendtext1: - context._cmp(context.data.byte(kIntrocount), 65); + context._cmp(context.data.byte(kIntrocount), 50); if (!context.flags.z()) goto notendtext2; context.al = 1; context.bl = 34; @@ -2170,7 +2176,7 @@ notendtext1: context.cx = 60; goto gotendtext; notendtext2: - context._cmp(context.data.byte(kIntrocount), 110); + context._cmp(context.data.byte(kIntrocount), 85); if (!context.flags.z()) goto notendtext3; context.al = 2; context.bl = 34; @@ -2220,7 +2226,7 @@ notmonktext3: context.cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.data.byte(kIntrocount), 17); + context._cmp(context.data.byte(kIntrocount), 15); if (!context.flags.z()) goto notmonktext5; context.al = 23; context.bl = 68; @@ -2284,7 +2290,7 @@ notmonktext11: context.cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.data.byte(kIntrocount), 49); + context._cmp(context.data.byte(kIntrocount), 52); if (!context.flags.z()) goto notmonktext13; context.al = 31; context.bl = 68; @@ -2295,11 +2301,17 @@ notmonktext13: context._cmp(context.data.byte(kIntrocount), 53); if (!context.flags.z()) goto notendtitles; fadescreendowns(context); + context.data.byte(kVolumeto) = 7; + context.data.byte(kVolumedirection) = 1; notendtitles: {assert(stack_depth == context.stack.size()); return; } gotmonktext: context.dx = 1; context.ah = 82; + context._cmp(context.data.byte(kCh1playing), 255); + if (context.flags.z()) goto oktalk; + context._dec(context.data.byte(kIntrocount)); + {assert(stack_depth == context.stack.size()); return; } oktalk: setuptimedtemp(context); {assert(stack_depth == context.stack.size()); return; } @@ -2845,7 +2857,7 @@ continuewalk: context.push(context.bx); context.dx = context.data; context.es = context.dx; - context.bx = 8141; + context.bx = 8173; context._add(context.bx, context.ax); context.ax = context.es.word(context.bx); context.bx = context.pop(); @@ -5704,7 +5716,7 @@ void monkspeaking(Context & context) { worktoscreen(context); context.data.byte(kVolume) = 7; context.data.byte(kVolumedirection) = -1; - context.data.byte(kVolumeto) = 0; + context.data.byte(kVolumeto) = 5; context.al = 12; context.ah = 255; playchannel0(context); @@ -5712,37 +5724,22 @@ void monkspeaking(Context & context) { context.cx = 300; hangon(context); context.al = 40; -nextmonkspeak: +loadspeech2: context.push(context.ax); + context.dl = 'T'; + context.dh = 83; + context.cl = 'T'; context.ah = 0; - context.si = context.ax; - context._add(context.si, context.si); - context.es = context.data.word(kTextfile1); - context.ax = context.es.word(context.si); - context._add(context.ax, (66*2)); - context.si = context.ax; -nextbit: - context.di = 36; - context.bx = 140; - context.dl = 239; - printdirect(context); - context.push(context.ax); - context.push(context.si); - context.push(context.es); - worktoscreen(context); - clearwork(context); - showmonk(context); - context.cx = 240; - hangon(context); - context.es = context.pop(); - context.si = context.pop(); - context.ax = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) goto nextbit; + loadspeech(context); + context.al = 50+12; + playchannel1(context); +notloadspeech2: + context._cmp(context.data.byte(kCh1playing), 255); + if (!context.flags.z()) goto notloadspeech2; context.ax = context.pop(); context._inc(context.al); - context._cmp(context.al, 44); - if (!context.flags.z()) goto nextmonkspeak; + context._cmp(context.al, 48); + if (!context.flags.z()) goto loadspeech2; context.data.byte(kVolumedirection) = 1; context.data.byte(kVolumeto) = 7; fadescreendowns(context); @@ -5831,7 +5828,7 @@ void intro(Context & context) { loadintroroom(context); context.data.byte(kVolume) = 7; context.data.byte(kVolumedirection) = -1; - context.data.byte(kVolumeto) = 0; + context.data.byte(kVolumeto) = 4; context.al = 12; context.ah = 255; playchannel0(context); @@ -9569,6 +9566,22 @@ void starttalk(Context & context) { context.al = 0; context.ah = 0; printdirect(context); + context.data.byte(kSpeechloaded) = 0; + context.al = context.data.byte(kCharacter); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cl = 'C'; + context.dl = 'R'; + context.dh = context.data.byte(kReallocation); + loadspeech(context); + context._cmp(context.data.byte(kSpeechloaded), 1); + if (!context.flags.z()) goto nospeech1; + context.data.byte(kVolumedirection) = 1; + context.data.byte(kVolumeto) = 6; + context.al = 50+12; + playchannel1(context); nospeech1: {assert(stack_depth == context.stack.size()); return; } } @@ -9621,7 +9634,7 @@ notsecondpart: void dosometalk(Context & context) { uint stack_depth = context.stack.size(); -watchtalk: +dospeech: context.al = context.data.byte(kTalkpos); context.al = context.data.byte(kCharacter); context._and(context.al, 127); @@ -9641,7 +9654,7 @@ watchtalk: context._add(context.ax, context.cx); context.si = context.ax; context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) goto endwatchtalk; + if (context.flags.z()) goto endheartalk; context.push(context.es); context.push(context.si); createpanel(context); @@ -9657,6 +9670,23 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); + context.al = context.data.byte(kCharacter); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cl = context.data.byte(kTalkpos); + context.ch = 0; + context._add(context.ax, context.cx); + context.cl = 'C'; + context.dl = 'R'; + context.dh = context.data.byte(kReallocation); + loadspeech(context); + context._cmp(context.data.byte(kSpeechloaded), 0); + if (context.flags.z()) goto noplay1; + context.al = 62; + playchannel1(context); +noplay1: context.data.byte(kPointermode) = 3; worktoscreenm(context); context.cx = 180; @@ -9681,11 +9711,11 @@ watchtalk: context._add(context.ax, context.cx); context.si = context.ax; context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) goto endwatchtalk; + if (context.flags.z()) goto endheartalk; context._cmp(context.es.byte(context.si), ':'); - if (context.flags.z()) goto skiptalk; + if (context.flags.z()) goto skiptalk2; context._cmp(context.es.byte(context.si), 32); - if (context.flags.z()) goto skiptalk; + if (context.flags.z()) goto skiptalk2; context.push(context.es); context.push(context.si); createpanel(context); @@ -9701,14 +9731,31 @@ watchtalk: context.al = 0; context.ah = 0; printdirect(context); + context.al = context.data.byte(kCharacter); + context._and(context.al, 127); + context.ah = 0; + context.cx = 64; + context._mul(context.cx); + context.cl = context.data.byte(kTalkpos); + context.ch = 0; + context._add(context.ax, context.cx); + context.cl = 'C'; + context.dl = 'R'; + context.dh = context.data.byte(kReallocation); + loadspeech(context); + context._cmp(context.data.byte(kSpeechloaded), 0); + if (context.flags.z()) goto noplay2; + context.al = 62; + playchannel1(context); +noplay2: context.data.byte(kPointermode) = 3; worktoscreenm(context); context.cx = 180; hangonpq(context); -skiptalk: +skiptalk2: context._inc(context.data.byte(kTalkpos)); - goto watchtalk; -endwatchtalk: + goto dospeech; +endheartalk: context.data.byte(kPointermode) = 0; {assert(stack_depth == context.stack.size()); return; } } @@ -10022,14 +10069,14 @@ void getdestinfo(Context & context) { context.push(context.ax); context.dx = context.data; context.es = context.dx; - context.si = 7979; + context.si = 8011; context._add(context.si, context.ax); context.cl = context.es.byte(context.si); context.ax = context.pop(); context.push(context.cx); context.dx = context.data; context.es = context.dx; - context.si = 7995; + context.si = 8027; context._add(context.si, context.ax); context.ax = context.pop(); {assert(stack_depth == context.stack.size()); return; } @@ -10162,7 +10209,7 @@ void getlocation(Context & context) { context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7979); + context._add(context.bx, 8011); context.al = context.es.byte(context.bx); {assert(stack_depth == context.stack.size()); return; } } @@ -10173,7 +10220,7 @@ void setlocation(Context & context) { context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7979); + context._add(context.bx, 8011); context.es.byte(context.bx) = 1; {assert(stack_depth == context.stack.size()); return; } } @@ -10221,7 +10268,7 @@ clearedlocations: context.bx = context.ax; context.dx = context.data; context.es = context.dx; - context._add(context.bx, 7979); + context._add(context.bx, 8011); context.es.byte(context.bx) = 0; {assert(stack_depth == context.stack.size()); return; } } @@ -10623,7 +10670,7 @@ void locklightoff(Context & context) { void input(Context & context) { uint stack_depth = context.stack.size(); context.es = context.cs; - context.di = 8013; + context.di = 8045; context.cx = 64; context.al = 0; while(context.cx--) context._stosb(); @@ -10672,7 +10719,7 @@ notleadingspace: context.es = context.cs; context.si = context.data.word(kCurpos); context._add(context.si, context.si); - context._add(context.si, 8013); + context._add(context.si, 8045); context.es.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); if (!context.flags.c()) goto waitkey; @@ -10725,7 +10772,7 @@ void delchar(Context & context) { context.si = context.data.word(kCurpos); context._add(context.si, context.si); context.es = context.cs; - context._add(context.si, 8013); + context._add(context.si, 8045); context.es.byte(context.si) = 0; context.al = context.es.byte(context.si+1); context.ah = 0; @@ -10753,7 +10800,7 @@ void execcommand(Context & context) { context.es = context.cs; context.bx = 2776; context.ds = context.cs; - context.si = 8013; + context.si = 8045; context.al = context.ds.byte(context.si); context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; @@ -10943,7 +10990,7 @@ notyetassigned: context.push(context.bx); context._add(context.bx, 2); context.ds = context.cs; - context.si = 8013; + context.si = 8045; checkpass: context._lodsw(); context.ah = context.es.byte(context.bx); @@ -11251,7 +11298,7 @@ void parser(Context & context) { context.al = '='; context._stosb(); context.ds = context.cs; - context.si = 8013; + context.si = 8045; notspace1: context._lodsw(); context._cmp(context.al, 32); @@ -12551,7 +12598,7 @@ void isitright(Context & context) { uint stack_depth = context.stack.size(); context.bx = context.data; context.es = context.bx; - context.bx = 8541; + context.bx = 8573; context._cmp(context.es.byte(context.bx+0), context.al); if (!context.flags.z()) goto notright; context._cmp(context.es.byte(context.bx+1), context.ah); @@ -14111,6 +14158,19 @@ cantsetup: void setuptimedtemp(Context & context) { uint stack_depth = context.stack.size(); + context._cmp(context.ah, 0); + if (context.flags.z()) goto notloadspeech3; + context.dl = 'T'; + context.dh = context.ah; + context.cl = 'T'; + context.ah = 0; + loadspeech(context); + context._cmp(context.data.byte(kSpeechloaded), 1); + if (!context.flags.z()) goto notloadspeech3; + context.al = 50+12; + playchannel1(context); + {assert(stack_depth == context.stack.size()); return; } +notloadspeech3: context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup2; context.data.byte(kTimedy) = context.bh; @@ -14673,7 +14733,7 @@ not10: context.bx = context.data.word(kPresspointer); context.dx = context.data; context.es = context.dx; - context._add(context.bx, 8541); + context._add(context.bx, 8573); context.es.byte(context.bx) = context.al; context._inc(context.data.word(kPresspointer)); nomorekeys: @@ -16242,7 +16302,7 @@ loadops: getridoftemp(context); context.dx = context.data; context.es = context.dx; - context.bx = 7947; + context.bx = 7979; startloading(context); loadroomssample(context); context.data.byte(kRoomloaded) = 1; @@ -16375,7 +16435,7 @@ alreadyactsave: if (context.flags.z()) goto noactsave; context.dx = context.data; context.ds = context.dx; - context.si = 8547; + context.si = 8579; context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -16389,9 +16449,9 @@ alreadyactsave: context.cx = 32; context._mul(context.cx); context.ds = context.cs; - context.si = 6155; + context.si = 6187; context._add(context.si, context.ax); - context.di = 7947; + context.di = 7979; context.bx = context.di; context.es = context.cs; context.cx = 16; @@ -16438,7 +16498,7 @@ alreadyactload: if (!context.flags.z()) goto notactload; context.dx = context.data; context.ds = context.dx; - context.si = 8547; + context.si = 8579; context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -16515,7 +16575,7 @@ void getnamepos(Context & context) { context._mul(context.cx); context.dx = context.data; context.es = context.dx; - context.bx = 8547; + context.bx = 8579; context._add(context.bx, context.ax); context.al = context.data.byte(kCursorpos); context.ah = 0; @@ -16669,7 +16729,7 @@ void shownames(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.si = 8547+1; + context.si = 8579+1; context.di = (60)+21; context.bx = (52)+10; context.cl = 0; @@ -16735,7 +16795,7 @@ afterprintname: void namestoold(Context & context) { uint stack_depth = context.stack.size(); context.ds = context.cs; - context.si = 8547; + context.si = 8579; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; @@ -16746,7 +16806,7 @@ void namestoold(Context & context) { void oldtonames(Context & context) { uint stack_depth = context.stack.size(); context.es = context.cs; - context.di = 8547; + context.di = 8579; context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; @@ -16764,23 +16824,23 @@ void saveposition(Context & context) { context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8666; + context.dx = 8698; context._add(context.dx, context.ax); openforsave(context); context.dx = context.data; context.ds = context.dx; - context.dx = 6059; - context.cx = (6155-6059); + context.dx = 6091; + context.cx = (6187-6091); savefilewrite(context); context.dx = context.data; context.es = context.dx; - context.di = 6109; + context.di = 6141; context.ax = context.pop(); context.cx = 17; context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8547; + context.dx = 8579; context._add(context.dx, context.ax); saveseg(context); context.dx = context.data; @@ -16795,7 +16855,7 @@ void saveposition(Context & context) { saveseg(context); context.dx = context.data; context.ds = context.dx; - context.dx = 7947; + context.dx = 7979; saveseg(context); context.dx = context.data; context.ds = context.dx; @@ -16817,21 +16877,21 @@ void loadposition(Context & context) { context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8666; + context.dx = 8698; context._add(context.dx, context.ax); - openfile(context); + openfilefromc(context); context.ds = context.cs; - context.dx = 6059; - context.cx = (6155-6059); + context.dx = 6091; + context.cx = (6187-6091); savefileread(context); context.es = context.cs; - context.di = 6109; + context.di = 6141; context.ax = context.pop(); context.cx = 17; context._mul(context.cx); context.dx = context.data; context.ds = context.dx; - context.dx = 8547; + context.dx = 8579; context._add(context.dx, context.ax); loadseg(context); context.dx = context.data; @@ -16846,7 +16906,7 @@ void loadposition(Context & context) { loadseg(context); context.dx = context.data; context.ds = context.dx; - context.dx = 7947; + context.dx = 7979; loadseg(context); context.ds = context.cs; context.dx = 534; @@ -16859,7 +16919,7 @@ void makeheader(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.di = 6109; + context.di = 6141; context.ax = 17; storeit(context); context.ax = (68-0); @@ -16904,10 +16964,10 @@ void scanfornames(Context & context) { uint stack_depth = context.stack.size(); context.dx = context.data; context.es = context.dx; - context.di = 8547; + context.di = 8579; context.dx = context.data; context.ds = context.dx; - context.dx = 8666; + context.dx = 8698; context.cx = 7; scanloop: context.push(context.es); @@ -16915,7 +16975,7 @@ scanloop: context.push(context.di); context.push(context.dx); context.push(context.cx); - openfilenocheck(context); + openfilefromc(context); if (context.flags.c()) goto notexist; context.cx = context.pop(); context._inc(context.ch); @@ -16924,12 +16984,12 @@ scanloop: context.push(context.es); context.dx = context.data; context.ds = context.dx; - context.dx = 6059; - context.cx = (6155-6059); + context.dx = 6091; + context.cx = (6187-6091); savefileread(context); context.dx = context.data; context.es = context.dx; - context.di = 6109; + context.di = 6141; context.ds = context.pop(); context.dx = context.pop(); loadseg(context); @@ -17045,7 +17105,7 @@ loadops: getridoftemp(context); context.dx = context.data; context.es = context.dx; - context.bx = 7947; + context.bx = 7979; startloading(context); loadroomssample(context); context.data.byte(kRoomloaded) = 1; @@ -17811,7 +17871,7 @@ void clearchanges(Context & context) { context.di = 0; while(context.cx--) context._stosw(); context.es = context.cs; - context.di = 7979; + context.di = 8011; context.al = 1; context._stosb(); context._stosb(); @@ -18983,6 +19043,18 @@ notweb: if (!context.flags.z()) goto notlouisvol; context.data.byte(kVolume) = 5; notlouisvol: + context._cmp(context.data.byte(kReallocation), 14); + if (!context.flags.z()) goto notmad1; + context._cmp(context.data.byte(kMapx), 33); + if (context.flags.z()) goto ismad2; + context._cmp(context.data.byte(kMapx), 22); + if (!context.flags.z()) goto notmad1; + context.data.byte(kVolume) = 5; + {assert(stack_depth == context.stack.size()); return; } +ismad2: + context.data.byte(kVolume) = 0; + {assert(stack_depth == context.stack.size()); return; } +notmad1: playingalready: context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notlouisvol2; @@ -19490,7 +19562,7 @@ void bresenhams(Context & context) { workoutframes(context); context.dx = context.data; context.es = context.dx; - context.di = 8141; + context.di = 8173; context.si = 1; context.data.byte(kLinedirection) = 0; context.cx = context.data.word(kLineendx); @@ -19592,7 +19664,7 @@ line23: context._inc(context.al); if (--context.cx) goto hiloop; lineexit: - context._sub(context.di, 8141); + context._sub(context.di, 8173); context.ax = context.di; context._shr(context.ax, 1); context.data.byte(kLinelength) = context.al; @@ -21132,7 +21204,7 @@ void getroomdata(Context & context) { context.ah = 0; context.cx = 32; context._mul(context.cx); - context.bx = 6155; + context.bx = 6187; context._add(context.bx, context.ax); {assert(stack_depth == context.stack.size()); return; } } @@ -21140,11 +21212,11 @@ void getroomdata(Context & context) { void readheader(Context & context) { uint stack_depth = context.stack.size(); context.ds = context.cs; - context.dx = 6059; - context.cx = (6155-6059); + context.dx = 6091; + context.cx = (6187-6091); readfromfile(context); context.es = context.cs; - context.di = 6109; + context.di = 6141; {assert(stack_depth == context.stack.size()); return; } } @@ -21256,6 +21328,21 @@ novolumeload: {assert(stack_depth == context.stack.size()); return; } } +void makename(Context & context) { + uint stack_depth = context.stack.size(); + context.si = context.dx; + context.di = 6061; +transfer: + context.al = context.cs.byte(context.si); + context.cs.byte(context.di) = context.al; + context._inc(context.si); + context._inc(context.di); + context._cmp(context.al, 0); + if (!context.flags.z()) goto transfer; + context.dx = 6059; + {assert(stack_depth == context.stack.size()); return; } +} + void dreamweb(Context & context) { uint stack_depth = context.stack.size(); seecommandtail(context); @@ -21749,6 +21836,8 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, @@ -22674,16 +22763,18 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xcb88: readsetdata(context); break; case 0xcb8c: createfile(context); break; case 0xcb90: openfile(context); break; - case 0xcb94: openfilenocheck(context); break; - case 0xcb98: openforsave(context); break; - case 0xcb9c: closefile(context); break; - case 0xcba0: readfromfile(context); break; - case 0xcba4: setkeyboardint(context); break; - case 0xcba8: resetkeyboard(context); break; - case 0xcbac: keyboardread(context); break; - case 0xcbb0: walkandexamine(context); break; - case 0xcbb4: doload(context); break; - case 0xcbb8: generalerror(context); break; + case 0xcb94: openfilefromc(context); break; + case 0xcb98: makename(context); break; + case 0xcb9c: openfilenocheck(context); break; + case 0xcba0: openforsave(context); break; + case 0xcba4: closefile(context); break; + case 0xcba8: readfromfile(context); break; + case 0xcbac: setkeyboardint(context); break; + case 0xcbb0: resetkeyboard(context); break; + case 0xcbb4: keyboardread(context); break; + case 0xcbb8: walkandexamine(context); break; + case 0xcbbc: doload(context); break; + case 0xcbc0: generalerror(context); break; default: ::error("invalid call to %04x dispatched", (uint16)context.ax); } } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f97099d697..a09fb7b08c 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -26,6 +26,7 @@ namespace dreamgen { void closefile(Context &context); void openforsave(Context &context); void openfilenocheck(Context &context); + void openfilefromc(Context &context); void openfile(Context &context); void createfile(Context &context); void dontloadseg(Context &context); @@ -533,21 +534,21 @@ namespace dreamgen { const static uint16 kPalettescreen = 2481; const static uint16 kCurrentfile = 2970; const static uint16 kDmaaddresses = 5118; - const static uint16 kFileheader = 6059; - const static uint16 kFiledata = 6109; - const static uint16 kExtradata = 6149; - const static uint16 kRoomdata = 6155; - const static uint16 kMadeuproomdat = 7947; - const static uint16 kRoomscango = 7979; - const static uint16 kRoompics = 7995; - const static uint16 kOplist = 8010; - const static uint16 kInputline = 8013; - const static uint16 kLinedata = 8141; - const static uint16 kPresslist = 8541; - const static uint16 kSavenames = 8547; - const static uint16 kSavefiles = 8666; - const static uint16 kRecname = 8757; - const static uint16 kStak = 8770; + const static uint16 kFileheader = 6091; + const static uint16 kFiledata = 6141; + const static uint16 kExtradata = 6181; + const static uint16 kRoomdata = 6187; + const static uint16 kMadeuproomdat = 7979; + const static uint16 kRoomscango = 8011; + const static uint16 kRoompics = 8027; + const static uint16 kOplist = 8042; + const static uint16 kInputline = 8045; + const static uint16 kLinedata = 8173; + const static uint16 kPresslist = 8573; + const static uint16 kSavenames = 8579; + const static uint16 kSavefiles = 8698; + const static uint16 kRecname = 8789; + const static uint16 kStak = 8802; const static uint16 kBlocktextdat = (0); const static uint16 kPersonframes = (0); const static uint16 kDebuglevel1 = (0); @@ -565,7 +566,6 @@ namespace dreamgen { const static uint16 kPathdata = (0); const static uint16 kDemo = (0); const static uint16 kExframedata = (0); - const static uint16 kCd = (0); const static uint16 kIntextdat = (0); const static uint16 kFreetextdat = (0); const static uint16 kFrframedata = (0); @@ -606,6 +606,7 @@ namespace dreamgen { const static uint16 kPersontxtdat = (0+24); const static uint16 kPersontext = (0+24+(1026*2)); const static uint16 kInputport = (0x63); + const static uint16 kCd = (1); const static uint16 kUndertextsizey = (10); const static uint16 kNumexobjects = (114); const static uint16 kZoomy = (132); @@ -627,7 +628,7 @@ namespace dreamgen { const static uint16 kMenuy = (60); const static uint16 kOpsx = (60); const static uint16 kMaplength = (60); - const static uint16 kHeaderlen = (6155-6059); + const static uint16 kHeaderlen = (6187-6091); const static uint16 kSymbolx = (64); const static uint16 kSetdatlen = (64*128); const static uint16 kMapwidth = (66); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 2daf905b3e..fc8753f77c 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -380,30 +380,45 @@ void DreamWebEngine::cls() { } void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { + debug(1, "playSound(%u, %u, %u)", channel, id, loops); const SoundData &data = _soundData[id >= 12? 1: 0]; Audio::Mixer::SoundType type; + bool speech = id == 62; //actually 50 if (id >= 12) { id -= 12; type = Audio::Mixer::kSFXSoundType; - } else + } else if (speech) + type = Audio::Mixer::kSpeechSoundType; + else type = Audio::Mixer::kMusicSoundType; - if (id >= data.samples.size()) { - 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); + Audio::SeekableAudioStream *raw; + if (!speech) { + if (id >= data.samples.size() || data.samples[id].size == 0) { + warning("invalid sample #%u played", id); + return; + } - Audio::SeekableAudioStream *raw = Audio::makeRawStream( - buffer, - sample.size, 22050, Audio::FLAG_UNSIGNED); + 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) { @@ -416,6 +431,21 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { _mixer->playStream(type, &_channelHandle[channel], stream); } +bool DreamWebEngine::playSpeech(const Common::String &filename) { + debug(1, "playSpeech(%s)", filename.c_str()); + Common::File file; + if (!file.open("speech/" + filename)) + return false; + + debug(1, "\tfound speech file"); + uint size = file.size(); + _speechData.resize(size); + file.read(_speechData.begin(), size); + file.close(); + return true; +} + + void DreamWebEngine::soundHandler() { //uint8 volume = _context.data.byte(dreamgen::kVolume); uint8 ch0 = _context.data.byte(dreamgen::kCh0playing); @@ -429,16 +459,12 @@ void DreamWebEngine::soundHandler() { if (_channel0 != ch0) { _channel0 = ch0; if (ch0) { - //Audio::AudioStream *stream = LoopingAudioStream(Audio::makeRawStream(data, size, 22050, 0), ch0loops); - //_mixer->playStream(Audio::Mixer::kMusicType, &_musicHandle, stream); //dispose is YES by default - debug(1, "playing sound %u at channel 0, loop: %u", ch0, ch0loop); playSound(0, ch0, ch0loop); } } if (_channel1 != ch1) { _channel1 = ch1; if (ch1) { - debug(1, "playing sound %u at channel 1", ch1); playSound(1, ch1, 1); } } @@ -632,6 +658,10 @@ void openfilenocheck(Context &context) { context.flags._c = !ok; } +void openfilefromc(Context &context) { + openfile(context); +} + void openfile(Context &context) { Common::String name = getFilename(context); debug(1, "opening file: %s", name.c_str()); @@ -797,7 +827,6 @@ void loadsample(Context &context) { void cancelch0(Context &context); void cancelch1(Context &context); - void loadsecondsample(Context &context) { uint8 ch0 = context.data.byte(kCh0playing); if (ch0 >= 12 && ch0 != 255) @@ -808,8 +837,16 @@ void loadsecondsample(Context &context) { context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); } +void createname(Context &context); + void loadspeech(Context &context) { - ::error("loadspeech"); + cancelch1(context); + context.data.byte(kSpeechloaded) = 0; + createname(context); + const char *name = (const char *)context.data.ptr(context.di, 13); + //warning("name = %s", name); + if (context.engine->playSpeech(name)) + context.data.byte(kSpeechloaded) = 1; } void saveseg(Context &context) { diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 447aff931f..0645fbaa9f 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -104,6 +104,7 @@ public: void quit(); void loadSounds(uint bank, const Common::String &file); + bool playSpeech(const Common::String &filename); private: void keyPressed(uint16 ascii); @@ -124,6 +125,7 @@ private: struct Sample { uint offset; uint size; + Sample(): offset(), size() {} }; struct SoundData { @@ -131,6 +133,7 @@ private: Common::Array data; }; SoundData _soundData[2]; + Common::Array _speechData; Audio::SoundHandle _channelHandle[2]; uint8 _channel0, _channel1; -- cgit v1.2.3 From 074436985f8c706915c567e31362f0dbb4026008 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 00:57:41 +0400 Subject: DREAMWEB: renamed playSpeech to loadSpeech --- engines/dreamweb/dreamweb.cpp | 6 +++--- engines/dreamweb/dreamweb.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fc8753f77c..cf8205c784 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -431,8 +431,8 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { _mixer->playStream(type, &_channelHandle[channel], stream); } -bool DreamWebEngine::playSpeech(const Common::String &filename) { - debug(1, "playSpeech(%s)", filename.c_str()); +bool DreamWebEngine::loadSpeech(const Common::String &filename) { + debug(1, "loadSpeech(%s)", filename.c_str()); Common::File file; if (!file.open("speech/" + filename)) return false; @@ -845,7 +845,7 @@ void loadspeech(Context &context) { createname(context); const char *name = (const char *)context.data.ptr(context.di, 13); //warning("name = %s", name); - if (context.engine->playSpeech(name)) + if (context.engine->loadSpeech(name)) context.data.byte(kSpeechloaded) = 1; } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 0645fbaa9f..f683fca4d5 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -104,7 +104,7 @@ public: void quit(); void loadSounds(uint bank, const Common::String &file); - bool playSpeech(const Common::String &filename); + bool loadSpeech(const Common::String &filename); private: void keyPressed(uint16 ascii); -- cgit v1.2.3 From 25824b20edf81a52a0648fc55d64d6f5973af2c6 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 01:04:09 +0400 Subject: DREAMWEB: added sound status check --- engines/dreamweb/dreamweb.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index cf8205c784..5ec60b4249 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -432,12 +432,12 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { } bool DreamWebEngine::loadSpeech(const Common::String &filename) { - debug(1, "loadSpeech(%s)", filename.c_str()); Common::File file; if (!file.open("speech/" + filename)) return false; - debug(1, "\tfound speech file"); + debug(1, "loadSpeech(%s)", filename.c_str()); + uint size = file.size(); _speechData.resize(size); file.read(_speechData.begin(), size); @@ -468,6 +468,10 @@ void DreamWebEngine::soundHandler() { playSound(1, ch1, 1); } } + if (!_mixer->isSoundHandleActive(_channelHandle[0])) + _context.data.byte(dreamgen::kCh0playing) = 255; + if (!_mixer->isSoundHandleActive(_channelHandle[1])) + _context.data.byte(dreamgen::kCh1playing) = 255; } void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { -- cgit v1.2.3 From 84745add6e92d33949e71e53f253fea5c5ce4a0a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 01:27:52 +0400 Subject: DREAMWEB: added volume support (stubs for now) --- engines/dreamweb/dreamweb.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 5ec60b4249..8a144b2175 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -47,6 +47,7 @@ namespace dreamgen { void doshake(dreamgen::Context &context); void dofade(dreamgen::Context &context); + void volumeadjust(dreamgen::Context &context); } namespace DreamWeb { @@ -447,7 +448,13 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) { void DreamWebEngine::soundHandler() { - //uint8 volume = _context.data.byte(dreamgen::kVolume); + _context.push(_context.ax); + volumeadjust(_context); + _context.ax = _context.pop(); + + uint8 volume = _context.data.byte(dreamgen::kVolume); + //if (volume) + // debug(1, "volume = %u", volume); uint8 ch0 = _context.data.byte(dreamgen::kCh0playing); if (ch0 == 255) ch0 = 0; -- cgit v1.2.3 From dca78aa964f3ddce337f218c649219753eafc513 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 01:32:19 +0400 Subject: DREAMWEB: fixed cd-version without savefiles --- engines/dreamweb/dreamweb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8a144b2175..1e4558ed54 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -670,7 +670,7 @@ void openfilenocheck(Context &context) { } void openfilefromc(Context &context) { - openfile(context); + openfilenocheck(context); } void openfile(Context &context) { -- cgit v1.2.3 From 9008f2c4426a65fb248e4d96e5094490fb125b45 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 01:41:04 +0400 Subject: DREAMWEB: added volume setting (maybe wrong) --- engines/dreamweb/dreamweb.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 1e4558ed54..fd56c2dd1b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -452,9 +452,10 @@ void DreamWebEngine::soundHandler() { volumeadjust(_context); _context.ax = _context.pop(); - uint8 volume = _context.data.byte(dreamgen::kVolume); - //if (volume) - // debug(1, "volume = %u", volume); + uint volume = _context.data.byte(dreamgen::kVolume); + volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; + _mixer->setChannelVolume(_channelHandle[0], volume); + uint8 ch0 = _context.data.byte(dreamgen::kCh0playing); if (ch0 == 255) ch0 = 0; -- cgit v1.2.3 From 8a878356383d039f225acfe330aa999322a128e0 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 10:32:00 +0400 Subject: DREAMWEB: added comment about volumes --- engines/dreamweb/dreamweb.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index fd56c2dd1b..818c864127 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -453,6 +453,16 @@ void DreamWebEngine::soundHandler() { _context.ax = _context.pop(); uint volume = _context.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 volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; _mixer->setChannelVolume(_channelHandle[0], volume); -- cgit v1.2.3 From 5826ae88aee4f682d7a5b74b093e419db9b35f9f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 10:33:52 +0400 Subject: DREAMWEB: cut upper volume limit --- engines/dreamweb/dreamweb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 818c864127..bbf25a7bcc 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -463,6 +463,8 @@ void DreamWebEngine::soundHandler() { //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); -- cgit v1.2.3 From cf942d930884be0c71f654403a15065385d61eb3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 12:07:59 +0400 Subject: DREAMWEB: cleanup keys handling, added turbo shortcut --- engines/dreamweb/dreamweb.cpp | 77 +++++++++++++++++++++---------------------- engines/dreamweb/dreamweb.h | 1 + 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index bbf25a7bcc..ea347d10a9 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -69,6 +69,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _outSaveFile = 0; _inSaveFile = 0; _speed = 1; + _turbo = false; _oldMouseState = 0; _channel0 = 0; _channel1 = 0; @@ -94,10 +95,12 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) { void DreamWebEngine::waitForVSync() { processEvents(); - while (!_vSyncInterrupt) { - _system->delayMillis(10); + if (!_turbo) { + while (!_vSyncInterrupt) { + _system->delayMillis(10); + } + setVSyncInterrupt(false); } - setVSyncInterrupt(false); dreamgen::doshake(_context); dreamgen::dofade(_context); @@ -118,52 +121,48 @@ void DreamWebEngine::processEvents() { soundHandler(); Common::Event event; while (event_manager->pollEvent(event)) { - bool keyHandled = false; switch(event.type) { case Common::EVENT_KEYDOWN: - switch (event.kbd.keycode) { - case Common::KEYCODE_d: - if (event.kbd.flags & Common::KBD_CTRL) { + if (event.kbd.flags & Common::KBD_CTRL) { + switch (event.kbd.keycode) { + + case Common::KEYCODE_d: _console->attach(); _console->onFrame(); - keyHandled = true; - } - break; - case Common::KEYCODE_f: - if (event.kbd.flags & Common::KBD_CTRL) { - if (_speed != 10) - setSpeed(10); - else - setSpeed(1); - keyHandled = true; - } - break; - case Common::KEYCODE_c: //skip statue puzzle - if (event.kbd.flags & Common::KBD_CTRL) { + break; + + case Common::KEYCODE_f: + setSpeed(_speed != 20? 20: 1); + break; + + case Common::KEYCODE_g: + _turbo = !_turbo; + break; + + case Common::KEYCODE_c: //skip statue puzzle _context.data.byte(dreamgen::kSymbolbotnum) = 3; _context.data.byte(dreamgen::kSymboltopnum) = 5; - keyHandled = true; + break; + + default: + break; } - break; - default: - break; - } - if (!keyHandled) { - // As far as I can see, the only keys checked - // for in 'lasthardkey' are 1 (ESC) and 57 - // (space) so add special cases for them and - // treat everything else as 0. - if (event.kbd.keycode == Common::KEYCODE_ESCAPE) - _context.data.byte(dreamgen::kLasthardkey) = 1; - else if (event.kbd.keycode == Common::KEYCODE_SPACE) - _context.data.byte(dreamgen::kLasthardkey) = 57; - else - _context.data.byte(dreamgen::kLasthardkey) = 0; - if (event.kbd.ascii) - keyPressed(event.kbd.ascii); + return; //do not pass ctrl + key to the engine } + // As far as I can see, the only keys checked + // for in 'lasthardkey' are 1 (ESC) and 57 + // (space) so add special cases for them and + // treat everything else as 0. + if (event.kbd.keycode == Common::KEYCODE_ESCAPE) + _context.data.byte(dreamgen::kLasthardkey) = 1; + else if (event.kbd.keycode == Common::KEYCODE_SPACE) + _context.data.byte(dreamgen::kLasthardkey) = 57; + else + _context.data.byte(dreamgen::kLasthardkey) = 0; + if (event.kbd.ascii) + keyPressed(event.kbd.ascii); break; default: break; diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index f683fca4d5..0f5e5bdc98 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -120,6 +120,7 @@ private: Common::InSaveFile *_inSaveFile; uint _speed; + bool _turbo; uint _oldMouseState; struct Sample { -- cgit v1.2.3 From 7d93f81aba271fea54bc739870d82d822ad5d363 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 22:51:56 +0400 Subject: DREAMWEB: added detection of the cd version --- engines/dreamweb/detection_tables.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 394236a72a..1062b50d6b 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -35,14 +35,32 @@ static const DreamWebGameDescription gameDescriptions[] = { { "dreamweb", "", - AD_ENTRY1s("dreamweb.r00", "3b5c87717fc40cc5a5ae19c155662ee3", 152918), + { + {"dreamweb.r00", 0, "3b5c87717fc40cc5a5ae19c155662ee3", 152918}, + {"dreamweb.r02", 0, "28458718167a040d7e988cf7d2298eae", 210466}, + AD_LISTEND + }, Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO_NONE }, }, - + { + { + "dreamweb", + "CD", + { + {"dreamweb.r00", 0, "3b5c87717fc40cc5a5ae19c155662ee3", 152918}, + {"dreamweb.r02", 0, "d6fe5e3590ec1eea42ff65c10b023e0f", 198681}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformPC, + ADGF_CD, + GUIO_NONE + }, + }, { AD_TABLE_END_MARKER } }; -- cgit v1.2.3 From f4936e6b42a8a1a0346375928e8f74605780b729 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 23:21:17 +0400 Subject: DREAMWEB: implemented stc/clc, fixed preliminary exit from the dialogue --- devtools/tasmrecover/tasm/cpp.py | 6 ++++++ devtools/tasmrecover/tasm/op.py | 12 ++++++++++++ engines/dreamweb/dreamgen.cpp | 12 +++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 9d42dd9cde..888f0bf9bd 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -413,6 +413,12 @@ namespace %s { def _movsw(self): self.body += "\tcontext._movsw();\n "; + def _stc(self): + self.body += "\tcontext.flags._c = true;\n "; + + def _clc(self): + self.body += "\tcontext.flags._c = false;\n "; + def __proc(self, name, def_skip = 0): try: skip = def_skip diff --git a/devtools/tasmrecover/tasm/op.py b/devtools/tasmrecover/tasm/op.py index c77eda2b7e..33f79c3e5c 100644 --- a/devtools/tasmrecover/tasm/op.py +++ b/devtools/tasmrecover/tasm/op.py @@ -386,6 +386,18 @@ class _nop(baseop): def visit(self, visitor): pass +class _stc(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._stc() + +class _clc(baseop): + def __init__(self, arg): + pass + def visit(self, visitor): + visitor._clc() + class label(baseop): def __init__(self, name): self.name = name diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 187f1f9981..2591c36564 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -9691,6 +9691,9 @@ noplay1: worktoscreenm(context); context.cx = 180; hangonpq(context); + if (!context.flags.c()) goto _tmp1; + {assert(stack_depth == context.stack.size()); return; } +_tmp1: context._inc(context.data.byte(kTalkpos)); context.al = context.data.byte(kTalkpos); context.al = context.data.byte(kCharacter); @@ -9752,6 +9755,8 @@ noplay2: worktoscreenm(context); context.cx = 180; hangonpq(context); + if (!context.flags.c()) goto skiptalk2; + {assert(stack_depth == context.stack.size()); return; } skiptalk2: context._inc(context.data.byte(kTalkpos)); goto dospeech; @@ -9795,13 +9800,14 @@ notspeaking: finishconv: delpointer(context); context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + context.flags._c = false; + {assert(stack_depth == context.stack.size()); return; } quitconv: delpointer(context); context.data.byte(kPointermode) = 0; - context.ax = context.pop(); cancelch1(context); - {assert(stack_depth == context.stack.size()); return; } + context.flags._c = true; + {assert(stack_depth == context.stack.size()); return; } } void redes(Context & context) { -- cgit v1.2.3 From cd4b0a8b6a389913986ac386a812e0dc16c760bd Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 14 Jun 2011 23:52:17 +0400 Subject: DREAMWEB: cleaned up keys handling --- engines/dreamweb/dreamweb.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index ea347d10a9..f53b7bdc14 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -155,14 +155,17 @@ void DreamWebEngine::processEvents() { // for in 'lasthardkey' are 1 (ESC) and 57 // (space) so add special cases for them and // treat everything else as 0. - if (event.kbd.keycode == Common::KEYCODE_ESCAPE) + switch(event.kbd.keycode) { + case Common::KEYCODE_ESCAPE: _context.data.byte(dreamgen::kLasthardkey) = 1; - else if (event.kbd.keycode == Common::KEYCODE_SPACE) + break; + case Common::KEYCODE_SPACE: _context.data.byte(dreamgen::kLasthardkey) = 57; - else + break; + default: _context.data.byte(dreamgen::kLasthardkey) = 0; - if (event.kbd.ascii) - keyPressed(event.kbd.ascii); + break; + } break; default: break; -- cgit v1.2.3 From cde28452f793858878fac66d20e7f9caf5f3e974 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Tue, 14 Jun 2011 21:16:57 +0200 Subject: DREAMWEB: The readabyte() function is no longer needed. --- engines/dreamweb/dreamweb.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index f53b7bdc14..478e13491f 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -990,8 +990,6 @@ void readoneblock(Context &context) { readfromfile(context); } -void readabyte(Context & context); - void showpcx(Context &context) { Common::String name = getFilename(context); Common::File pcxFile; -- cgit v1.2.3 From dfaa1e32b770257b43348ac042a2d7aa5a28bcfd Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Tue, 14 Jun 2011 21:53:48 +0200 Subject: DREAMWEB: Filter out "illegal" characters This is fairly restrictive (just like the original) so we may went to let through a few more characters eventually. For now, let's be conservative. It was possible to enter characters that would show up in the save dialog as weird or underlined characters. --- engines/dreamweb/dreamweb.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 478e13491f..789db03615 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -120,6 +120,7 @@ void DreamWebEngine::processEvents() { } soundHandler(); Common::Event event; + int key = 0; while (event_manager->pollEvent(event)) { switch(event.type) { case Common::EVENT_KEYDOWN: @@ -166,6 +167,33 @@ void DreamWebEngine::processEvents() { _context.data.byte(dreamgen::kLasthardkey) = 0; break; } + + // This is pretty much the equivalent of convertkey(), + // but we can't use that one because we don't get the + // same key codes as input. Eventually, we may want to + // be a bit more permissive than the original, but for + // now let's be conservative. + + if (event.kbd.keycode >= Common::KEYCODE_a && event.kbd.keycode <= Common::KEYCODE_z) { + key = event.kbd.ascii & ~0x20; + } else if (event.kbd.keycode == Common::KEYCODE_MINUS || + event.kbd.keycode == Common::KEYCODE_SPACE || + (event.kbd.keycode >= Common::KEYCODE_0 && event.kbd.keycode <= Common::KEYCODE_9)) { + key = event.kbd.ascii; + } else if (event.kbd.keycode >= Common::KEYCODE_KP0 && event.kbd.keycode <= Common::KEYCODE_KP9) { + key = event.kbd.keycode - Common::KEYCODE_KP0 + '0'; + } else if (event.kbd.keycode == Common::KEYCODE_KP_MINUS) { + key = '-'; + } else if (event.kbd.keycode == Common::KEYCODE_BACKSPACE || + event.kbd.keycode == Common::KEYCODE_DELETE) { + key = 8; + } else if (event.kbd.keycode == Common::KEYCODE_RETURN + || event.kbd.keycode == Common::KEYCODE_KP_ENTER) { + key = 13; + } + + if (key) + keyPressed(key); break; default: break; @@ -259,8 +287,6 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { void DreamWebEngine::keyPressed(uint16 ascii) { - if (ascii >= 'a' && ascii <= 'z') - ascii = (ascii - 'a') + 'A'; 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::kBufferin) + 1) & 0x0f; -- cgit v1.2.3 From 9c7c46bfde46f9b6994822a9ea8db6f5b68dd607 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 00:32:49 +0400 Subject: DREAMWEB: fixed final scene, better sound channel handling --- engines/dreamweb/dreamgen.cpp | 1 + engines/dreamweb/dreamweb.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2591c36564..bcca8ae2aa 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5734,6 +5734,7 @@ loadspeech2: context.al = 50+12; playchannel1(context); notloadspeech2: + vsync(context); context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto notloadspeech2; context.ax = context.pop(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 789db03615..7d035c916d 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -516,10 +516,15 @@ void DreamWebEngine::soundHandler() { playSound(1, ch1, 1); } } - if (!_mixer->isSoundHandleActive(_channelHandle[0])) + if (!_mixer->isSoundHandleActive(_channelHandle[0])) { _context.data.byte(dreamgen::kCh0playing) = 255; - if (!_mixer->isSoundHandleActive(_channelHandle[1])) + _channel0 = 0; + } + if (!_mixer->isSoundHandleActive(_channelHandle[1])) { _context.data.byte(dreamgen::kCh1playing) = 255; + _channel1 = 0; + } + } void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { -- cgit v1.2.3 From 1cafd2de983210fec07267cbb4d261affd4a33f4 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Tue, 14 Jun 2011 22:23:37 +0200 Subject: DREAMWEB: Reinstate some "hardware key" handling that got lost It's still not quite as the original. In the original, Ctrl- would be treated as . Is that worth fixing? Probably not. --- engines/dreamweb/dreamweb.cpp | 51 ++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 7d035c916d..19bb6b09cb 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -120,7 +120,7 @@ void DreamWebEngine::processEvents() { } soundHandler(); Common::Event event; - int key = 0; + int softKey, hardKey; while (event_manager->pollEvent(event)) { switch(event.type) { case Common::EVENT_KEYDOWN: @@ -152,48 +152,55 @@ void DreamWebEngine::processEvents() { return; //do not pass ctrl + key to the engine } - // As far as I can see, the only keys checked - // for in 'lasthardkey' are 1 (ESC) and 57 - // (space) so add special cases for them and - // treat everything else as 0. - switch(event.kbd.keycode) { + // Some parts of the ASM code uses the hardware key + // code directly. We don't have that code, so we fake + // it for the keys where it's needed and assume it's + // 0 (which is actually an invalid value, as far as I + // know) otherwise. + + hardKey = 0; + + switch (event.kbd.keycode) { case Common::KEYCODE_ESCAPE: - _context.data.byte(dreamgen::kLasthardkey) = 1; + hardKey = 1; break; case Common::KEYCODE_SPACE: - _context.data.byte(dreamgen::kLasthardkey) = 57; + hardKey = 57; break; default: - _context.data.byte(dreamgen::kLasthardkey) = 0; + hardKey = 0; break; } - // This is pretty much the equivalent of convertkey(), - // but we can't use that one because we don't get the - // same key codes as input. Eventually, we may want to - // be a bit more permissive than the original, but for - // now let's be conservative. + _context.data.byte(dreamgen::kLasthardkey) = hardKey; + + // The rest of the keys are converted to ASCII. This + // is fairly restrictive, and eventually we may want + // to let through more keys. I think this is mostly to + // keep weird glyphs out of savegame names. + + softKey = 0; if (event.kbd.keycode >= Common::KEYCODE_a && event.kbd.keycode <= Common::KEYCODE_z) { - key = event.kbd.ascii & ~0x20; + softKey = event.kbd.ascii & ~0x20; } else if (event.kbd.keycode == Common::KEYCODE_MINUS || event.kbd.keycode == Common::KEYCODE_SPACE || (event.kbd.keycode >= Common::KEYCODE_0 && event.kbd.keycode <= Common::KEYCODE_9)) { - key = event.kbd.ascii; + softKey = event.kbd.ascii; } else if (event.kbd.keycode >= Common::KEYCODE_KP0 && event.kbd.keycode <= Common::KEYCODE_KP9) { - key = event.kbd.keycode - Common::KEYCODE_KP0 + '0'; + softKey = event.kbd.keycode - Common::KEYCODE_KP0 + '0'; } else if (event.kbd.keycode == Common::KEYCODE_KP_MINUS) { - key = '-'; + softKey = '-'; } else if (event.kbd.keycode == Common::KEYCODE_BACKSPACE || event.kbd.keycode == Common::KEYCODE_DELETE) { - key = 8; + softKey = 8; } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_KP_ENTER) { - key = 13; + softKey = 13; } - if (key) - keyPressed(key); + if (softKey) + keyPressed(softKey); break; default: break; -- cgit v1.2.3 From c760405a4ee846275c1c191867ff57cb4e8dd8d3 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 00:44:10 +0400 Subject: DREAMWEB: ported engine to the new metaengine api --- engines/dreamweb/detection.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 10ff15da11..10f727f02e 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -43,10 +43,6 @@ static const PlainGameDescriptor dreamWebGames[] = { { 0, 0 } }; -static const ADObsoleteGameID obsoleteGameIDsTable[] = { - { 0, 0, Common::kPlatformUnknown } -}; - #include "dreamweb/detection_tables.h" class DreamWebMetaEngine : public AdvancedMetaEngine { @@ -54,9 +50,8 @@ public: DreamWebMetaEngine(): AdvancedMetaEngine(DreamWeb::gameDescriptions, sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "dreamweb"; - params.guioptions = Common::GUIO_NOMIDI; + _singleid = "dreamweb"; + _guioptions = Common::GUIO_NOMIDI; } virtual const char *getName() const { -- cgit v1.2.3 From ae8edebd65deafc1376a9c3a51331929815b6c64 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 10:23:18 +0400 Subject: DREAMWEB: fixed title skipping --- engines/dreamweb/dreamgen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index bcca8ae2aa..331c8abbd7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5802,6 +5802,7 @@ void biblequote(Context & context) { if (context.flags.z()) goto biblequotearly; cancelch0(context); biblequotearly: + context.data.byte(kLasthardkey) = 0; {assert(stack_depth == context.stack.size()); return; } } @@ -5859,6 +5860,7 @@ void intro(Context & context) { getridoftemptext(context); clearbeforeload(context); introearly: + context.data.byte(kLasthardkey) = 0; {assert(stack_depth == context.stack.size()); return; } } @@ -6059,6 +6061,7 @@ void realcredits(Context & context) { context.cx = 256; hangone(context); realcreditsearly: + context.data.byte(kLasthardkey) = 0; {assert(stack_depth == context.stack.size()); return; } } -- cgit v1.2.3 From 9599894a4b2f79672fc3e2ca5a93ef9c7d457c08 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 17:53:45 +0400 Subject: DREAMWEB: Added original sources. Released with permission from Neil Dodwell. --- devtools/tasmrecover/.gitignore | 1 - devtools/tasmrecover/dreamweb/LICENSE | 339 ++ devtools/tasmrecover/dreamweb/backdrop.asm | 877 ++++ devtools/tasmrecover/dreamweb/debug.asm | 382 ++ devtools/tasmrecover/dreamweb/dreamweb.asm | 6262 ++++++++++++++++++++++++++++ devtools/tasmrecover/dreamweb/keypad.asm | 1758 ++++++++ devtools/tasmrecover/dreamweb/look.asm | 167 + devtools/tasmrecover/dreamweb/monitor.asm | 1496 +++++++ devtools/tasmrecover/dreamweb/newplace.asm | 581 +++ devtools/tasmrecover/dreamweb/object.asm | 2608 ++++++++++++ devtools/tasmrecover/dreamweb/print.asm | 591 +++ devtools/tasmrecover/dreamweb/saveload.asm | 1495 +++++++ devtools/tasmrecover/dreamweb/sblaster.asm | 1293 ++++++ devtools/tasmrecover/dreamweb/sprite.asm | 5034 ++++++++++++++++++++++ devtools/tasmrecover/dreamweb/talk.asm | 580 +++ devtools/tasmrecover/dreamweb/titles.asm | 583 +++ devtools/tasmrecover/dreamweb/use.asm | 3810 +++++++++++++++++ devtools/tasmrecover/dreamweb/vars.asm | 564 +++ devtools/tasmrecover/dreamweb/vgafades.asm | 867 ++++ devtools/tasmrecover/dreamweb/vgagrafx.asm | 1763 ++++++++ 20 files changed, 31050 insertions(+), 1 deletion(-) create mode 100644 devtools/tasmrecover/dreamweb/LICENSE create mode 100644 devtools/tasmrecover/dreamweb/backdrop.asm create mode 100644 devtools/tasmrecover/dreamweb/debug.asm create mode 100644 devtools/tasmrecover/dreamweb/dreamweb.asm create mode 100644 devtools/tasmrecover/dreamweb/keypad.asm create mode 100644 devtools/tasmrecover/dreamweb/look.asm create mode 100644 devtools/tasmrecover/dreamweb/monitor.asm create mode 100644 devtools/tasmrecover/dreamweb/newplace.asm create mode 100644 devtools/tasmrecover/dreamweb/object.asm create mode 100644 devtools/tasmrecover/dreamweb/print.asm create mode 100644 devtools/tasmrecover/dreamweb/saveload.asm create mode 100644 devtools/tasmrecover/dreamweb/sblaster.asm create mode 100644 devtools/tasmrecover/dreamweb/sprite.asm create mode 100644 devtools/tasmrecover/dreamweb/talk.asm create mode 100644 devtools/tasmrecover/dreamweb/titles.asm create mode 100644 devtools/tasmrecover/dreamweb/use.asm create mode 100644 devtools/tasmrecover/dreamweb/vars.asm create mode 100644 devtools/tasmrecover/dreamweb/vgafades.asm create mode 100644 devtools/tasmrecover/dreamweb/vgagrafx.asm diff --git a/devtools/tasmrecover/.gitignore b/devtools/tasmrecover/.gitignore index c1b0a4c6eb..f2bff8e8d9 100644 --- a/devtools/tasmrecover/.gitignore +++ b/devtools/tasmrecover/.gitignore @@ -1,5 +1,4 @@ *.pyc -dreamweb dreamgen.* _stubs* diff --git a/devtools/tasmrecover/dreamweb/LICENSE b/devtools/tasmrecover/dreamweb/LICENSE new file mode 100644 index 0000000000..d159169d10 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm new file mode 100644 index 0000000000..189199db91 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/backdrop.asm @@ -0,0 +1,877 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;----------------------------------------------Code to draw floor and panel---- + +Blockget proc near + + mov ah,al + mov al,0 + mov ds,backdrop + mov si,blocks + add si,ax + ret + + endp + + + + + + + + + + + + + + + + +;--------------------------------------------------------Background display---- + + + + + + + + +Drawfloor proc near + + push es bx ;in case this was called during + call eraseoldobs ;some sprite update. + call drawflags + call calcmapad + call doblocks + call showallobs + call showallfree + call showallex + call paneltomap + call initrain + mov newobs,0 + pop bx es + ret + + endp + + + + + + + + + + + + + + + + + + +Calcmapad proc near + + call getdimension + + push cx dx + + mov al,11 + sub al,dl + sub al,cl + sub al,cl + cbw + mov bx,8 + mul bx + add ax,mapoffsetx + mov mapadx,ax + pop dx cx + + mov al,10 + sub al,dh + sub al,ch + sub al,ch + cbw + mov bx,8 + mul bx + add ax,mapoffsety + mov mapady,ax + ret + + endp + + + + + + + + + +Getdimension proc near ;Routine finds width, length + ;and top corner of room + + mov es,buffers + mov bx,mapflags + mov ch,0 +dimloop1: call addalong + cmp al,0 + jnz finishdim1 + inc ch + jmp dimloop1 ;ch holds y of top corner + +finishdim1: mov bx,mapflags + mov cl,0 +dimloop2: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim2 + inc cl + add bx,3 + jmp dimloop2 ;cl holds x of top corner + +finishdim2: mov bx,mapflags+(11*3*9) + mov dh,10 +dimloop3: push bx + call addalong + pop bx + cmp al,0 + jnz finishdim3 + dec dh + sub bx,11*3 + jmp dimloop3 ;dh holds y of bottom corner + +finishdim3: mov bx,mapflags+(3*10) + mov dl,11 +dimloop4: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim4 + dec dl + sub bx,3 + jmp dimloop4 ;dl holds x of bottom corner + +finishdim4: mov al,cl ;cl holds x start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxstart,ax + mov al,ch ;ch holds y start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapystart,ax + + sub dl,cl + sub dh,ch + ;dx holds x and y size of room + mov al,dl ;dl holds x size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxsize,al + mov al,dh ;dh holds y size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapysize,al ;cx still holds top left corner + ret + + endp + + + + + + + + + + + + +Addalong proc near + + mov ah,11 +addloop: cmp byte ptr [es:bx],0 + jnz gotalong + add bx,3 + dec ah + jnz addloop + mov al,0 + ret +gotalong: mov al,1 + ret + + endp + + + + + +Addlength proc near + + mov ah,10 +addloop2: cmp byte ptr [es:bx],0 + jnz gotlength + add bx,3*11 + dec ah + jnz addloop2 + mov al,0 + ret +gotlength: mov al,1 + ret + + endp + + + + + + + + + + + + + + + + + + + + +Drawflags proc near + + mov es,buffers + mov di,mapflags + mov al,mapy + mov ah,0 + mov cx,mapwidth + mul cx + mov bl,mapx + mov bh,0 + add ax,bx + mov si,map + add si,ax + + mov cx,10 +$28: push cx + mov cx,11 +$28a: mov ds,mapdata + lodsb + mov ds,backdrop + push si ax + mov ah,0 + add ax,ax + mov si,flags + add si,ax + movsw + pop ax + stosb + pop si + loop $28a + add si,mapwidth-11 + pop cx + loop $28 + ret + + endp + + + + + + + + + + + + + + +;-------------------------------------------------------Set object printing---- + +Eraseoldobs proc near + + cmp newobs,0 + jz donterase + + mov es,buffers + mov bx,spritetable + + mov cx,16 +oberase: push cx bx + mov ax,[es:bx+20] + cmp ax,0ffffh + jz notthisob + mov di,bx + mov al,255 + mov cx,tablesize + rep stosb +notthisob: pop bx cx + add bx,tablesize + loop oberase + +donterase: ret + + endp + + + + + + + + + + + + + + + + + + + + +Showallobs proc near + + mov es,buffers + mov bx,setlist + mov listpos,bx + mov di,bx + mov cx,128*5 + mov al,255 + rep stosb + + mov es,setframes + mov frsegment,es + mov ax,framedata + mov dataad,ax + mov ax,frames + mov framesad,ax + mov currentob,0 + + mov ds,setdat + mov si,0 + + mov cx,128 +showobsloop: push cx si + + push si + add si,58 + mov es,setdat + call getmapad + pop si + cmp ch,0 + jz blankframe + + mov al,[es:si+18] + mov ah,0 + mov currentframe,ax + cmp al,255 + jz blankframe + + push es si + call calcfrframe + call finalframe + pop si es + + mov al,[es:si+18] + mov [es:si+17],al + cmp byte ptr [es:si+8],0 + jnz animating + cmp byte ptr [es:si+5],5 + jz animating + cmp byte ptr [es:si+5],6 + jz animating + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + jmp drawnsetob + +animating: call makebackob + +drawnsetob: mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + mov al,currentob + mov [es:si+4],al + add si,5 + mov listpos,si + +blankframe: inc currentob + pop si cx + add si,64 + dec cx + jz finishedsetobs + jmp showobsloop + +finishedsetobs: ret + + endp + + + + + + + + + + + + + + +Makebackob proc near + + cmp newobs,0 + jz nomake + + mov al,[es:si+5] ; priority + mov ah,[es:si+8] ; type - steady, constant,random,door etc. + push si ax si + mov ax,objectx + mov bx,objecty + mov ah,bl + mov si,ax + mov cx,offset cs:backobject + mov dx,setframes + mov di,framedata + call makesprite + pop ax + mov [es:bx+20],ax + pop ax + cmp al,255 + jnz usedpriority ; forgotten to specify priority + mov al,0 +usedpriority: mov [es:bx+23],al + mov [es:bx+30],ah + mov byte ptr [es:bx+16],0 + mov byte ptr [es:bx+18],0 + mov byte ptr [es:bx+19],0 + pop si +nomake: ret + + endp + + + + +;------------------------------------------------------Free object printing---- + +Showallfree proc near + + mov es,buffers + mov bx,freelist + mov listpos,bx + mov di,freelist + mov cx,80*5 + mov al,255 + rep stosb + + mov es,freeframes + mov frsegment,es + mov ax,frframedata + mov dataad,ax + mov ax,frframes + mov framesad,ax + mov al,0 + mov currentfree,al + + mov ds,freedat + mov si,2 + + mov cx,0 +loop127: push cx si + + push si + mov es,freedat + call getmapad + pop si + cmp ch,0 + jz over138 + + mov al,currentfree + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz over138 + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +over138: inc currentfree + pop si cx + add si,16 + inc cx + cmp cx,80 + jz finfree + jmp loop127 + +finfree: ret + + endp + + + + + + + + + + + + +Showallex proc near + + mov es,buffers + mov bx,exlist + mov listpos,bx + mov di,exlist + mov cx,100*5 + mov al,255 + rep stosb + + mov es,extras + mov frsegment,es + mov ax,exframedata + mov dataad,ax + mov ax,exframes + mov framesad,ax + mov currentex,0 + + mov si,exdata+2 + + mov cx,0 +exloop: push cx si + + mov es,extras + + push si + mov ch,0 + cmp byte ptr [es:si],255 + jz notinroom + mov al,[es:si-2] + cmp al,reallocation + jnz notinroom + call getmapad +notinroom: pop si + cmp ch,0 + jz blankex + + mov al,currentex + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz blankex + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +blankex: inc currentex + pop si cx + add si,16 + inc cx + cmp cx,100 + jz finex + jmp exloop + +finex: ret + + endp + + + + + + + +Calcfrframe proc near + + mov dx,frsegment + mov ax,framesad + push ax + mov cx,dataad + mov ax,currentframe + mov ds,dx + mov bx,6 + mul bx + add ax,cx + mov bx,ax + mov cx,[bx] + mov ax,[bx+2] + mov dx,[bx+4] + pop bx + push dx + add ax,bx ;ax=source add, cx=x,y + ;need this later + mov savesource,ax + mov savesize,cx + pop ax + push ax + mov ah,0 + mov offsetx,ax + pop ax + mov al,ah + mov ah,0 + mov offsety,ax + ret +nullframe: pop ax + mov cx,0 + mov savesize,cx + ret + + endp + + + + + + + + + + + + + + + + + + +Finalframe proc near + + mov ax,objecty + add ax,offsety + mov bx,objectx + add bx,offsetx + mov savex,bl + mov savey,al + mov di,objectx + mov bx,objecty + ret + + endp + + + + + + + + + + + + + +Adjustlen proc near + + mov ah,al + add al,ch + cmp al,100 + jc over242 + mov al,224 + sub al,ch + mov ch,al +over242: ret + + endp + + + + + + + + + +Getmapad proc near + + call getxad + cmp ch,0 + jz over146 + mov objectx,ax + call getyad + cmp ch,0 + jz over146 + mov objecty,ax + mov ch,1 +over146: ret + + endp + + + + + + + + + +Getxad proc near + + mov cl,[es:si] + inc si + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + cmp cl,0 + jnz over148 + sub al,mapx + jc over148 + cmp al,11 + jnc over148 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret +over148: mov ch,0 + ret + + endp + + + + + + + + + +Getyad proc near + + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + sub al,mapy + jc over147 + cmp al,10 + jnc over147 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret + +over147: mov ch,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm new file mode 100644 index 0000000000..3c24913b2e --- /dev/null +++ b/devtools/tasmrecover/dreamweb/debug.asm @@ -0,0 +1,382 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + if debuglevel2 + + +Debugkeys proc near + + ret + + endp + + + +Debugstart proc near + + call allpalette + mov reeltohold,-1 + mov newlocation,23 + mov dreamnumber,0 + mov al,"W" + mov ah,"S" + mov cl,"H" + mov ch,"D" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"C"-"A" + mov byte ptr [es:bx+14],"R"-"A" + mov byte ptr [es:bx+15],"W"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov byte ptr [es:bx+12],"G"-"A" + mov byte ptr [es:bx+13],"U"-"A" + mov byte ptr [es:bx+14],"N"-"A" + mov byte ptr [es:bx+15],"A"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"H"-"A" + mov byte ptr [es:bx+14],"L"-"A" + mov byte ptr [es:bx+15],"D"-"A" + mov card1money,12342 + + ret + + endp + + + + + +Debuggreen proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,63 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + + + + + +Debugred proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,63 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + +Debugblue proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,63 + out dx,al + pop dx ax + ret + + endp + + + + + +Debugblack proc near + + push dx ax + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop ax dx + ret + + endp + + + + + + + + + + + +Debug proc near + + push ds dx cx + mov ah,3ch + mov cx,0 + mov dx,seg filenamed + mov ds,dx + mov dx,offset filenamed + int 21h + mov bx,ax + pop cx dx ds + push bx + mov ah,40h + int 21h + pop bx + mov ah,3eh + int 21h + ret + +filenamed db "DREAMWEB.TXT",0 + + endp + + + + + + + + +Shout proc near + + push ax bx cx dx si di es ds + call debugblue + mov cx,50 + call hangon + call debugblack + mov cx,10 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + +Shoutred proc near + + push ax bx cx dx si di es ds + call debugred + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + +Shoutgreen proc near + + push ax bx cx dx si di es ds + call debuggreen + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + + + + + + + +;Checkmemingame proc near + +; cmp charset1,0 +; jz nodebug +; mov bx,60000 +; mov ah,48h +; int 21h +; mov ax,bx +; mov cl,6 +; shr ax,cl +; mov di,offset cs:debugtextig +; call showword + +; mov ax,soundbufferwrite +; ;mov ax,exframepos +; mov di,offset cs:debugtextex +; call showword + +; ;mov ax,extextpos +; ;mov di,offset cs:debugtextex2 +; ;call showword + +; push cs +; pop es +; mov si,offset cs:debugtextig +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,14 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,22 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex2 +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,30 +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +;nodebug: ret + + endp + +debugtextig: db "00000K",0 + +debugtextex: db "00000b",0 + +debugtextex2: db "00000b",0 + + + + + + + if recording + + mov ax,recordpos + mov di,offset cs:debugtextr + call showword + + mov al,0 + call print + dw 4,4,100 +debugtextr: db "00000",0 + + mov si,0 + mov di,0 + mov cl,40 + mov ch,12 + call multidump + + endif + + ret + + endp + + + + + + + + + + + + + + + + + + +;Debugax proc near +; +; push ax +; call showpanel +; pop ax +; mov di,offset cs:debugaxtext +; call showword +; +; mov di,204 +; mov bx,14 +; mov al,0 +; mov ah,0 +; mov dl,100 +; push cs +; pop es +; mov si,offset cs:debugaxtext +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +; ret +; +;debugaxtext db "00000 ",0 +; +; endp + + + + + + + + endif + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm new file mode 100644 index 0000000000..2b98b97b34 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -0,0 +1,6262 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + + + + + + + + +;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ +;³ ³ +;³ DREAMWEB ³ +;³ ³ +;³ ³ +;³ ³ +;³ ³ +;³ Written by Neil Dodwell. Graphics by Dave Dew. ³ +;³ ³ +;³ Started on Friday 28 December 1990 at 1:20 pm ³ +;³ ³ +;³ Copyright 1990/1991 Creative Reality ³ ³ +;³ ³ +;³ ³ +;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + + + + + + + + + + + + + + +;----------------------------------------------------------Assembly options---- + +JUMPS + +playback equ 0 +recording equ 0 +debuglevel1 equ 0 ;memory debug on +debuglevel2 equ 0 ;debug keys on+shouts +demo equ 0 +CD equ 1 +Foreign equ 0 +Spanish equ 0 +German equ 0 + +;----------------------------------------------------------------Code start---- + +DREAMWEBPROG segment para public 'CODE' + + assume cs:DREAMWEBPROG,ss:STACKSPACE + + + + +;------------------------------------------------------------------Includes---- + +include \pc\dreamweb\vars.asm ;variables and equates +include \pc\dreamweb\sprite.asm ;sprite routines +include \pc\dreamweb\vgagrafx.asm ;screen routines for vga +include \pc\dreamweb\vgafades.asm ;fade routines +include \pc\dreamweb\titles.asm ;guess! +include \pc\dreamweb\print.asm ;text printing routines +include \pc\dreamweb\object.asm ;pickup +include \pc\dreamweb\backdrop.asm ;draws floor etc. +include \pc\dreamweb\look.asm ;look command +include \pc\dreamweb\talk.asm ;conversations +include \pc\dreamweb\newplace.asm ;travel +include \pc\dreamweb\monitor.asm ;network machine +include \pc\dreamweb\use.asm ;individual use routines +include \pc\dreamweb\keypad.asm ;accept code with keypad +include \pc\dreamweb\saveload.asm ;in game options +include \pc\dreamweb\sblaster.asm + if debuglevel1 +include \pc\dreamweb\debug.asm + else + if debuglevel2 +include \pc\dreamweb\debug.asm + endif + endif + +;-----------------------------------------------------------------Main loop---- + + +Dreamweb proc near + + call seecommandtail + + call checkbasemem + call soundstartup + call setkeyboardint + call setupemm + call allocatebuffers + call setmouse + call fadedos + call gettime + + call clearbuffers + call clearpalette + call set16colpalette + call readsetdata + if demo + call changeroomnums + endif + mov wongame,0 + + mov dx,offset cs:basicsample + call loadsample + call setsoundoff + + if demo + else + call scanfornames + cmp al,0 + jnz dodecisions + endif + + call setmode + call loadpalfromiff + + call titles + call credits + jmp playgame + +dodecisions: call cls + call setmode + call decide + cmp getback,4 + jz mainloop + + call titles + call credits + +playgame: call clearchanges + call setmode + call loadpalfromiff + mov location,255 + mov roomafterdream,1 + if demo + mov newlocation,5 + else + mov newlocation,35 + endif + mov volume,7 + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov destpos,3 + call initialinv + mov lastflag,32 + call startup1 + mov volumeto,0 + mov volumedirection,-1 + mov commandtype,255 + jmp mainloop + +loadnew: if demo + cmp newlocation,27 + jnz not27 + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame +not27: + endif + call clearbeforeload + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov newlocation,255 + call startup + mov commandtype,255 + call worktoscreenm + jmp mainloop + +alreadyloaded: mov newlocation,255 + call clearsprites + call initman + call startup + mov commandtype,255 + +mainloop: call screenupdate + cmp wongame,0 + jnz endofgame + cmp mandead,1 + jz gameover + cmp mandead,2 + jz gameover + cmp watchingtime,0 + jz notwatching + mov al,finaldest + cmp al,manspath + jnz mainloop + dec watchingtime + jnz mainloop + +notwatching: cmp mandead,4 + jz gameover + cmp newlocation,255 + jnz loadnew + jmp mainloop + +gameover: if demo + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame + endif + call clearbeforeload + call showgun + call fadescreendown + mov cx,100 + call hangon + jmp dodecisions + +endofgame: call clearbeforeload + call fadescreendowns + mov cx,200 + call hangon + call endgame + jmp quickquit2 + + endp + + + + + endp + + + + if demo + +Changeroomnums proc near + + mov di,offset cs:roomdata+10 + mov cx,50 +changenumloop: mov al,[cs:di] + cmp al,"0" + jnz nochange + mov al,[cs:di+1] + cmp al,"5" + jnz nochange + mov al,"6" + mov ah,"0" + mov [cs:di],ax +nochange: add di,32 + loop changenumloop + ret + + endp + + endif + + + + +Entrytexts proc near + + cmp location,21 + jnz notloc15 + mov al,28 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc15: cmp location,30 + jnz notloc43 + mov al,27 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc43: cmp location,23 + jnz notloc23 + mov al,29 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc23: cmp location,31 + jnz notloc44 + mov al,30 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc44: cmp location,20 + jnz notsarters2 + mov al,31 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notsarters2: cmp location,24 + jnz notedenlob + mov al,32 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notedenlob: cmp location,34 + jnz noteden2 + mov al,33 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +noteden2: ret + + endp + + + + + + + + +Entryanims proc near + + mov reeltowatch,-1 + mov watchmode,-1 + cmp location,33 + jnz notinthebeach + call switchryanoff + mov watchingtime,76*2 + mov reeltowatch,0 + mov endwatchreel,76 + mov watchspeed,1 + mov speedcount,1 + ret +notinthebeach: cmp location,44 + jnz notsparkys + mov al,8 + call resetlocation + mov watchingtime,50*2 + mov reeltowatch,247 + mov endwatchreel,297 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notsparkys: cmp location,22 + jnz notinthelift + mov watchingtime,31*2 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notinthelift: cmp location,26 + jnz notunderchurch + mov symboltopnum,2 + mov symbolbotnum,1 + ret +notunderchurch: cmp location,45 + jnz notenterdream + mov keeperflag,0 + mov watchingtime,296 + mov reeltowatch,45 + mov endwatchreel,198 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notenterdream: cmp reallocation,46 + jnz notcrystal + cmp sartaindead,1 + jnz notcrystal + mov al,0 + call removefreeobject + ret +notcrystal: cmp location,9 + jnz nottopchurch + mov al,2 + call checkifpathison + jz nottopchurch + cmp aidedead,0 + jz nottopchurch + mov al,3 + call checkifpathison + jnz makedoorsopen + mov al,2 + call turnpathon +makedoorsopen: mov al,4 + call removesetobject + mov al,5 + call placesetobject + ret +nottopchurch: cmp location,47 + jnz notdreamcentre + mov al,4 + call placesetobject + mov al,5 + call placesetobject + ret +notdreamcentre: cmp location,38 + jnz notcarpark + mov watchingtime,57*2 + mov reeltowatch,4 + mov endwatchreel,57 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notcarpark: cmp location,32 + jnz notalley + mov watchingtime,66*2 + mov reeltowatch,0 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notalley: cmp location,24 + jnz notedensagain + mov al,2 + mov ah,roomnum + dec ah + call turnanypathon +notedensagain: ret + + endp + + + + + + + if demo +Initialinv proc near + + mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov al,2 + mov ah,4 + call pickupob + + mov al,29 + mov ah,10 + call pickupob + mov al,33 + mov ah,11 + call pickupob + mov al,44 + mov ah,12 + call pickupob + mov card1money,12342 + ret + + endp + else +Initialinv proc near + + cmp reallocation,24 + jz isedens + ret + +isedens: mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov watchmode,1 + mov reeltohold,0 + mov endofholdreel,6 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret + + endp + + endif + + + + + + + + + + + +Pickupob proc near + + mov lastinvpos,ah + mov objecttype,2 + mov itemframe,al + mov command,al + call getanyad + call transfertoex + ret + + endp + + + + + + + + + + + + + + + +;---------------------------------------------------------Memory allocation---- + + + + +Setupemm proc near + + cmp soundint,255 + jz noneedforemm + call checkforemm + + mov ah,43h ;allocate handle and 160 pages + mov bx,176 ;was 176 + int 67h + cmp ah,0 + jnz emmerror1 ;if there's an error drop to DOS + mov emmhandle,dx + mov ah,41h ;get the page frame base address + int 67h + cmp ah,0 + jnz emmerror1 + mov emmpageframe,bx + mov ax,bx + mov cl,12 + shr ax,cl + mov emmhardwarepage,al +noneedforemm: ret +emmerror1: mov gameerror,1 + jmp quickquit2 + + endp + + + + + + + + +Removeemm proc near + + cmp soundint,255 + jz noneedtoremove + mov ah,45h + mov dx,emmhandle + int 67h +noneedtoremove: ret + + endp + + + + + +Checkforemm proc near + + ret + + endp + + + + +Checkbasemem proc near + + mov bx,howmuchalloc + cmp bx,9360h + jnc enoughmem + mov gameerror,5 + jmp quickquit +enoughmem: ret + + endp + + + +Allocatebuffers proc near + + mov bx,lengthofextra/16 + call allocatemem + mov extras,ax + + call trysoundalloc + mov bx,lengthofmap/16 + call allocatemem + mov mapdata,ax + + call trysoundalloc + mov bx,lengthofbuffer/16 + call allocatemem + mov buffers,ax + + call trysoundalloc + mov bx,freedatlen/16 + call allocatemem + mov freedat,ax + + call trysoundalloc + mov bx,setdatlen/16 + call allocatemem + mov setdat,ax + + call trysoundalloc + mov bx,lenofmapstore/16 + call allocatemem + mov mapstore,ax + + if recording + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + if playback + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + call allocatework + + mov bx,2048/16 + call allocatemem + mov sounddata,ax + + mov bx,2048/16 + call allocatemem + mov sounddata2,ax + ret + + endp + + + + + + + + + + +Clearbuffers proc near + + mov es,buffers + mov cx,lengthofbuffer/2 + mov ax,0 + mov di,0 + rep stosw + + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + mov es,buffers + mov di,initialreelrouts + push cs + pop ds + mov si,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov es,buffers + mov di,initialvars + push cs + pop ds + mov si,offset cs:startvars + mov cx,lengthofvars + rep movsb + call clearchanges + ret + + endp + + + + + + +Clearchanges proc near + + mov es,buffers + mov cx,numchanges*2 + mov ax,0ffffh + mov di,listofchanges + rep stosw + mov ds,buffers + mov si,initialreelrouts + push cs + pop es + mov di,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov ds,buffers + mov si,initialvars + push cs + pop es + mov di,offset cs:startvars + mov cx,lengthofvars + rep movsb + + mov expos,0 + mov exframepos,0 + mov extextpos,0 + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + push cs + pop es + mov di,offset cs:roomscango + mov al,1 + stosb + stosb + mov al,0 + stosb + mov al,1 + stosb + mov ax,0 + mov cx,6 + rep stosw + ret + + endp + + + + + + + +Clearbeforeload proc near ;deallocates variable buffers + ;and clears out fixed ones + cmp roomloaded,1 + jnz noclear + call clearreels + call clearrest + mov roomloaded,0 +noclear: ret + + endp + + + +;Clearnoreels proc near +; +; cmp roomloaded,1 +; jnz noclear2 +; call clearrest +; mov roomloaded,0 +;noclear2: ret +; +; endp + + + + + + +Clearreels proc near + + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + ret + + endp + + + +Clearrest proc near + + mov es,mapdata + mov cx,maplen/2 + mov ax,0 + mov di,map + rep stosw + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + + +Deallocatemem proc near + + mov ah,49h + int 21h + jc deallerror + ret +deallerror: mov gameerror,4 + jmp quickquit2 + ret + + endp + + + + + + + + +Allocatemem proc near + + add bx,2 + mov ah,48h + int 21h + jc memerror + ret + +memerror: mov gameerror,3 + jmp quickquit2 + + endp + + + + +Seecommandtail proc near + + mov soundbaseadd,220h + mov soundint,5 + mov sounddmachannel,1 + mov brightness,0 + + mov bx,2 + mov ax,[es:bx] + mov dx,es + sub ax,dx + mov howmuchalloc,ax + + mov bx,02ch + mov ax,[es:bx] + push es bx + + mov es,ax + mov bx,0 +findblaster: mov ax,[es:bx] + cmp ax,0 + jz endofenvironment + cmp al,"B" + jnz notblast + cmp ah,"L" + jnz notblast + cmp byte ptr [es:bx+2],"A" + jnz notblast + cmp byte ptr [es:bx+3],"S" + jnz notblast + cmp byte ptr [es:bx+4],"T" + jnz notblast + cmp byte ptr [es:bx+5],"E" + jnz notblast + cmp byte ptr [es:bx+6],"R" + jnz notblast + add bx,7 + call parseblaster + jmp endofenvironment +notblast: inc bx + jmp findblaster + +endofenvironment: pop bx es + mov bx,81h + call parseblaster + ret + + endp + + + +Parseblaster proc near + +lookattail: mov al,[es:bx] + cmp al,0 + jz endtail + cmp al,13 + jz endtail + cmp al,"i" + jz issoundint + cmp al,"I" + jz issoundint + cmp al,"b" + jz isbright + cmp al,"B" + jz isbright + cmp al,"a" + jz isbaseadd + cmp al,"A" + jz isbaseadd + cmp al,"n" + jz isnosound + cmp al,"N" + jz isnosound + cmp al,"d" + jz isdma + cmp al,"D" + jz isdma + inc bx + loop lookattail + ret + +issoundint: mov al,[es:bx+1] + sub al,"0" + mov soundint,al + inc bx + jmp lookattail +isdma: mov al,[es:bx+1] + sub al,"0" + mov sounddmachannel,al + inc bx + jmp lookattail +isbaseadd: push cx + mov al,[es:bx+2] + sub al,"0" + mov ah,0 + mov cl,4 + shl ax,cl + add ax,200h + mov soundbaseadd,ax + pop cx + inc bx + jmp lookattail +isbright: mov brightness,1 + inc bx + jmp lookattail +isnosound: mov soundint,255 + inc bx + jmp lookattail +endtail: ret + + endp + + + + +;-------------------------------------------------------High level routines---- + +Startup proc near + + mov currentkey,0 + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + ret + + endp + + + + +Startup1 proc near + + + call clearpalette + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + call worktoscreen + call fadescreenup + ret + + endp + + + + + + + + +;--------------------------------------------------Scroll location routines---- + + + + + +Screenupdate proc near + + call newplace + call mainscreen + call animpointer + call showpointer + cmp watchingtime,0 + jnz iswatchingmode + cmp newlocation,255 + jnz finishearly +iswatchingmode: call vsync + call readmouse1 + call dumppointer + call dumptextline + call delpointer + call autolook + call spriteupdate + call watchcount + call zoom + call showpointer + cmp wongame,0 + jnz finishearly + + call vsync + call readmouse2 + call dumppointer + call dumpzoom + call delpointer + call deleverything + call printsprites + call reelsonscreen + call afternewroom + call showpointer + + call vsync + call readmouse3 + call dumppointer + call dumpmap + call dumptimedtext + call delpointer + call showpointer + + call vsync + call readmouse4 + call dumppointer + call dumpwatch + call delpointer + +finishearly: ret + + endp + + + + + + + + + + + + + + + +Watchreel proc near + + cmp reeltowatch,-1 + jz notplayingreel + mov al,manspath + cmp al,finaldest + jnz waitstopwalk + mov al,turntoface + cmp al,facing + jz notwatchpath +waitstopwalk: ret + +notwatchpath: dec speedcount + cmp speedcount,-1 + jnz showwatchreel + mov al,watchspeed + mov speedcount,al + mov ax,reeltowatch + cmp ax,endwatchreel + jnz ismorereel + cmp watchingtime,0 + jnz showwatchreel + mov reeltowatch,-1 + mov watchmode,-1 + cmp reeltohold,-1 + jz nomorereel + mov watchmode,1 + jmp notplayingreel +ismorereel: inc reeltowatch +showwatchreel: mov ax,reeltowatch + mov reelpointer,ax + call plotreel + mov ax,reelpointer + mov reeltowatch,ax + call checkforshake +nomorereel: ret + + +notplayingreel: cmp watchmode,1 + jnz notholdingreel + mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notholdingreel: cmp watchmode,2 + jnz notreleasehold + dec speedcount + cmp speedcount,-1 + jnz notlastspeed2 + mov al,watchspeed + mov speedcount,al + inc reeltohold +notlastspeed2: mov ax,reeltohold + cmp ax,endofholdreel + jnz ismorereel2 + mov reeltohold,-1 + mov watchmode,-1 + mov al,destafterhold + mov destination,al + mov finaldest,al + call autosetwalk + ret +ismorereel2: mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notreleasehold: ret + + endp + + + + + +Checkforshake proc near + + cmp reallocation,26 + jnz notstartshake + cmp ax,104 + jnz notstartshake + mov shakecounter,-1 +notstartshake: ret + + endp + + + + + +Watchcount proc near + + cmp watchon,0 + jz nowatchworn + inc timercount + cmp timercount,9 + jz flashdots + cmp timercount,18 + jz uptime +nowatchworn: ret + +flashdots: mov ax,91*3+21 + mov di,268+4 + mov bx,21 + mov ds,charset1 + call showframe + jmp finishwatch + +uptime: mov timercount,0 + add secondcount,1 + cmp secondcount,60 + jnz finishtime + mov secondcount,0 + inc minutecount + cmp minutecount,60 + jnz finishtime + mov minutecount,0 + inc hourcount + cmp hourcount,24 + jnz finishtime + mov hourcount,0 + +finishtime: call showtime +finishwatch: mov watchdump,1 + ret + + endp + + + +Showtime proc near + + cmp watchon,0 + jz nowatch + + mov al,secondcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+9 + mov bx,21 + call showframe + + mov al,minutecount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+11 + mov bx,21 + call showframe + + mov al,hourcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+11 + mov bx,21 + call showframe + + mov ax,91*3+20 + mov ds,charset1 + mov di,267+5 + mov bx,21 + call showframe +nowatch: ret + + + endp + + + + +Dumpwatch proc near + + cmp watchdump,1 + jnz nodumpwatch + mov di,256 + mov bx,21 + mov cl,40 + mov ch,12 + call multidump + mov watchdump,0 +nodumpwatch: ret + + endp + + + + +Showbyte proc near + + mov dl,al + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + call onedigit + mov [es:di],dl + mov dl,al + and dl,15 + call onedigit + mov [es:di+1],dl + add di,3 + ret + + endp + + +Onedigit proc near + + cmp dl,10 + jnc morethan10 + add dl,"0" + ret +morethan10: sub dl,10 + add dl,"A" + ret + + endp + + + + + +Twodigitnum proc near + + mov ah,cl + dec ah +numloop1: inc ah + sub al,10 + jnc numloop1 + add al,10 + add al,cl + ret + + endp + + + + + +Showword proc near + + mov ch,0 + mov bx,10000 + mov cl,47 +word1: inc cl + sub ax,bx + jnc word1 + add ax,bx + call convnum + mov [cs:di],cl + mov bx,1000 + mov cl,47 +word2: inc cl + sub ax,bx + jnc word2 + add ax,bx + call convnum + mov [cs:di+1],cl + mov bx,100 + mov cl,47 +word3: inc cl + sub ax,bx + jnc word3 + add ax,bx + call convnum + mov [cs:di+2],cl + mov bx,10 + mov cl,47 +word4: inc cl + sub ax,bx + jnc word4 + add ax,bx + call convnum + mov [cs:di+3],cl + add al,48 + mov cl,al + call convnum + mov [cs:di+4],cl + ret + + endp + + + + +Convnum proc near + + cmp ch,0 + jnz noconvnum + cmp cl,"0" + jnz notzeronum + mov cl,32 + jmp noconvnum +notzeronum: mov ch,1 +noconvnum: ret + + endp + + + + + + + + +;---------------------------------------------Handling of pointer on screen---- + +Mainscreen proc near + + mov inmaparea,0 + mov bx,offset cs:mainlist + cmp watchon,1 + jz checkmain + mov bx,offset cs:mainlist2 +checkmain: call checkcoords + cmp walkandexam,0 + jz finishmain + call walkandexamine +finishmain: ret + +mainlist: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226,244,10,26,zoomonoff + dw 226,244,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + +mainlist2: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226+48,244+48,10,26,zoomonoff + dw 226+48,244+48,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + + endp + + + + + + +Madmanrun proc near + + cmp location,14 + jnz identifyob + cmp mapx,22 + jnz identifyob + cmp pointermode,2 + jnz identifyob + cmp madmanflag,0 + jnz identifyob + + cmp commandtype,211 + jz alreadyrun + mov commandtype,211 + mov al,52 + call commandonly +alreadyrun: cmp mousebutton,1 + jnz norun + mov ax,mousebutton + cmp ax,oldbutton + jz norun + mov lastweapon,8 +norun: ret + + endp + + + + + + +Checkcoords proc near + cmp newlocation,255 ;objects keep enumerated even in loading state, fixme + jz loop048 + ret + +loop048: mov ax,[cs:bx] + cmp ax,0ffffh + jz nonefound + push bx + cmp mousex,ax + jl over045 + mov ax,[cs:bx+2] + cmp mousex,ax + jge over045 + mov ax,[cs:bx+4] + cmp mousey,ax + jl over045 + mov ax,[cs:bx+6] + cmp mousey,ax + jge over045 + mov ax,[cs:bx+8] + call ax +finished: pop ax + ret +over045: pop bx + add bx,10 + jmp loop048 +nonefound: ret + + endp + + + + + +;-------------------------------------------Printing of icons during scroll---- + + + + + +Identifyob proc near + + cmp watchingtime,0 + jnz blank + + mov ax,mousex + sub ax,mapadx + cmp ax,22*8 + jc notover1 + call blank + ret + +notover1: mov bx,mousey + sub bx,mapady + cmp bx,20*8 + jc notover2 + call blank + ret + +notover2: mov inmaparea,1 + mov ah,bl + push ax + call findpathofpoint + mov pointerspath,dl + pop ax + push ax + call findfirstpath + mov pointerfirstpath,al + pop ax + + call checkifex + jnz finishidentify + call checkiffree + jnz finishidentify + call checkifperson + jnz finishidentify + call checkifset + jnz finishidentify + + mov ax,mousex + sub ax,mapadx + mov cl,al + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + cmp al,0 + jz nothingund + ;cmp watchingtime,0 + ;jnz nothingund + cmp mandead,1 + jz nothingund + mov ah,3 + call obname +finishidentify: ret + +nothingund: call blank + ret + + endp + + + + + + + + +Checkifperson proc near + + mov es,buffers + mov bx,peoplelist + mov cx,12 +identifyreel: push cx + + cmp byte ptr [es:bx+4],255 + jz notareelid + + push es bx ax + mov ax,[es:bx+0] + mov reelpointer,ax + call getreelstart + cmp [es:si+2],0ffffh + jnz notblankpers + add si,5 +notblankpers: mov cx,[es:si+2] ;x,y of reel slot + mov ax,[es:si+0] ;frame number + push cx + call getreelframeax + pop cx + add cl,[es:bx+4] + add ch,[es:bx+5] + mov dx,cx + add dl,[es:bx+0] + add dh,[es:bx+1] + pop ax bx es + + cmp al,cl + jc notareelid + cmp ah,ch + jc notareelid + cmp al,dl + jnc notareelid + cmp ah,dh + jnc notareelid + + pop cx + mov ax,[es:bx+2] + mov persondata,ax + mov al,[es:bx+4] + mov ah,5 + call obname + mov al,0 + cmp al,1 + ret + +notareelid: pop cx + add bx,5 + dec cx + jnz identifyreel + ret + + endp + + + + + + + + +Checkifset proc near + + mov es,buffers + mov bx,setlist+(127*5) + mov cx,127 +identifyset: cmp byte ptr [es:bx+4],255 + jz notasetid + cmp al,[es:bx] + jc notasetid + cmp al,[es:bx+2] + jnc notasetid + cmp ah,[es:bx+1] + jc notasetid + cmp ah,[es:bx+3] + jnc notasetid + call pixelcheckset + jz notasetid + call isitdescribed + jz notasetid + mov al,[es:bx+4] + mov ah,1 + call obname + mov al,0 + cmp al,1 + ret +notasetid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyset + ret + + endp + + + + + + + + + + +Checkifex proc near + + mov es,buffers + mov bx,exlist+(99*5) + mov cx,99 +identifyex: cmp byte ptr [es:bx+4],255 + jz notanexid + cmp al,[es:bx] + jc notanexid + cmp al,[es:bx+2] + jnc notanexid + cmp ah,[es:bx+1] + jc notanexid + cmp ah,[es:bx+3] + jnc notanexid + mov al,[es:bx+4] + mov ah,4 + call obname + mov al,1 + cmp al,0 + ret +notanexid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyex + ret + + endp + + + + + + +Checkiffree proc near + + mov es,buffers + mov bx,freelist+(79*5) + mov cx,79 +identifyfree: cmp byte ptr [es:bx+4],255 + jz notafreeid + cmp al,[es:bx] + jc notafreeid + cmp al,[es:bx+2] + jnc notafreeid + cmp ah,[es:bx+1] + jc notafreeid + cmp ah,[es:bx+3] + jnc notafreeid + mov al,[es:bx+4] + mov ah,2 + call obname + mov al,0 + cmp al,1 + ret +notafreeid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyfree + ret + + endp + + + + + + +Isitdescribed proc near + + push ax cx es bx + mov al,[es:bx+4] ;get object number + mov ah,0 + add ax,ax + mov bx,ax + mov es,setdesc + add bx,settextdat + mov ax,[es:bx] + add ax,settext + mov bx,ax + mov dl,[es:bx] + pop bx es cx ax + cmp dl,0 + ret + + endp + + + + + + + + +;Getcurrentpath proc near ;routine finds out which path +; ;block the pointer is in. +; push ax ;used to see if an object is +; call findpathofpoint ;close or not +; pop ax +; mov pointerspath,dl +; ret +; +; endp + + + + + +Findpathofpoint proc near + + push ax + mov bx,pathdata + mov es,reels + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +pathloop: mov al,[es:bx+6] + cmp al,255 + jnz flunkedit + mov ax,[es:bx+2] + cmp ax,0ffffh + jz flunkedit + cmp cl,al + jc flunkedit + cmp ch,ah + jc flunkedit + mov ax,[es:bx+4] + cmp cl,al + jnc flunkedit + cmp ch,ah + jnc flunkedit + jmp gotvalidpath +flunkedit: add bx,8 + inc dl + cmp dl,12 + jnz pathloop + mov dl,255 +gotvalidpath: ret + + endp + + + + + +Findfirstpath proc near ;similar to last routine, but it + ;searches each path to see if + push ax ;pointer is within it, regardless + mov bx,pathdata ;of whether the path is on or off + mov es,reels ;it returns the on or off state in + mov al,roomnum ;al (255=on 0=off) 0 if no path + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +fpathloop: mov ax,[es:bx+2] + cmp ax,0ffffh + jz nofirst + cmp cl,al + jc nofirst + cmp ch,ah + jc nofirst + mov ax,[es:bx+4] + cmp cl,al + jnc nofirst + cmp ch,ah + jnc nofirst + jmp gotfirst +nofirst: add bx,8 + inc dl + cmp dl,12 + jnz fpathloop + mov al,0 + ret +gotfirst: mov al,[es:bx+6] + ret + + endp + + + + + + + + +Turnpathon proc near ;turns path on permanently + + push ax ax + mov cl,255 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathon + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al +nopathon: ret + + endp + + + + + + + +Turnpathoff proc near ;turns path on permanently + + push ax ax + mov cl,0 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathoff + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al +nopathoff: ret + + endp + + + + + + + + + + + + + + + +Turnanypathon proc near + + push ax ax + mov cl,255 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al + ret + + endp + + + + + + +Turnanypathoff proc near + + push ax ax + mov cl,0 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + +Checkifpathison proc near + + push ax + call getroomspaths + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+6] + cmp al,255 + ret + + endp + + + + + +Afternewroom proc near + + cmp nowinnewroom,0 + jz notnew + mov timecount,0 + call createpanel + mov commandtype,0 + call findroominloc + + cmp ryanon,1 + jz ryansoff + + mov al,ryanx + add al,12 + mov ah,ryany + add ah,12 + call findpathofpoint + mov manspath,dl + call findxyfrompath + mov resetmanxy,1 + +ryansoff: mov newobs,1 + call drawfloor + mov lookcounter,160 + mov nowinnewroom,0 + + call showicon + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call mainscreen + call getunderzoom + call zoom + call worktoscreenm + call walkintoroom + call reminders + call atmospheres +notnew: ret + + endp + + + + + + +Atmospheres proc near + + mov cl,mapx + mov ch,mapy + mov bx,offset cs:atmospherelist +nextatmos: mov al,[cs:bx] + cmp al,255 + jz nomoreatmos + cmp al,reallocation + jnz wrongatmos + mov ax,[cs:bx+1] + cmp ax,cx + jnz wrongatmos + mov ax,[cs:bx+3] + cmp al,ch0playing + jz playingalready + cmp location,45 + jnz notweb + cmp reeltowatch,45 + jz wrongatmos +notweb: call playchannel0 + cmp reallocation,2 + cmp mapy,0 + jz fullvol + jnz notlouisvol + cmp mapy,10 + jnz notlouisvol + cmp mapx,22 + jnz notlouisvol + mov volume,5 +notlouisvol: if cd + cmp reallocation,14 + jnz notmad1 + cmp mapx,33 + jz ismad2 + cmp mapx,22 + jnz notmad1 + mov volume,5 + ret +ismad2: mov volume,0 + ret +notmad1: endif +playingalready: cmp reallocation,2 + jnz notlouisvol2 + cmp mapx,22 + jz louisvol + cmp mapx,11 + jnz notlouisvol2 +fullvol: mov volume,0 +notlouisvol2: ret +louisvol: mov volume,5 + ret +wrongatmos: add bx,5 + jmp nextatmos +nomoreatmos: call cancelch0 + ret + +atmospherelist: db 0,33,10,15,255 + db 0,22,10,15,255 + db 0,22,0,15,255 + db 0,11,0,15,255 + db 0,11,10,15,255 + db 0,0,10,15,255 + + db 1,44,10,6,255 ;location,map x,y,sound,repeat + db 1,44,0,13,255 + + db 2,33,0,6,255 + db 2,22,0,5,255 + db 2,22,10,16,255 + db 2,11,10,16,255 + + db 3,44,0,15,255 + db 3,33,10,6,255 + db 3,33,0,5,255 + + db 4,11,30,6,255 + db 4,22,30,5,255 + db 4,22,20,13,255 + + db 10,33,30,6,255 + db 10,22,30,6,255 + + db 9,22,10,6,255 + db 9,22,20,16,255 + db 9,22,30,16,255 + db 9,22,40,16,255 + db 9,22,50,16,255 + + db 6,11,30,6,255 + db 6,0,10,15,255 + db 6,0,20,15,255 + db 6,11,20,15,255 + db 6,22,20,15,255 + + db 7,11,20,6,255 + db 7,0,20,6,255 + db 7,0,30,6,255 + + db 55,44,0,5,255 + db 55,44,10,5,255 + + db 5,22,30,6,255 + if demo + db 5,22,20,16,255 + db 5,22,10,16,255 + else + db 5,22,20,15,255 + db 5,22,10,15,255 + endif + + db 24,22,0,15,255 + db 24,33,0,15,255 + db 24,44,0,15,255 + db 24,33,10,15,255 + + db 8,0,10,6,255 + db 8,11,10,6,255 + db 8,22,10,6,255 + db 8,33,10,6,255 + db 8,33,20,6,255 + db 8,33,30,6,255 + db 8,33,40,6,255 + db 8,22,40,6,255 + db 8,11,40,6,255 + + db 11,11,20,12,255 + db 11,11,30,12,255 + db 11,22,20,12,255 + db 11,22,30,12,255 + + db 12,22,20,12,255 + db 13,22,20,12,255 + db 13,33,20,12,255 + + db 14,44,20,12,255 + db 14,33,0,12,255 + db 14,33,10,12,255 + db 14,33,20,12,255 + db 14,33,30,12,255 + db 14,33,40,12,255 + db 14,22,0,16,255 + + db 19,0,0,12,255 + + db 20,0,20,16,255 + db 20,0,30,16,255 + db 20,11,30,16,255 + db 20,0,40,16,255 + db 20,11,40,16,255 + + if demo + db 21,11,10,16,255 + db 21,11,20,16,255 + db 21,0,20,16,255 + db 21,22,20,16,255 + db 21,33,20,16,255 + db 21,44,20,16,255 + db 21,44,10,16,255 + else + db 21,11,10,15,255 + db 21,11,20,15,255 + db 21,0,20,15,255 + db 21,22,20,15,255 + db 21,33,20,15,255 + db 21,44,20,15,255 + db 21,44,10,15,255 + endif + + db 22,22,10,16,255 + db 22,22,20,16,255 + + db 23,22,30,13,255 + db 23,22,40,13,255 + db 23,33,40,13,255 + db 23,11,40,13,255 + db 23,0,40,13,255 + db 23,0,50,13,255 + + db 25,11,40,16,255 + db 25,11,50,16,255 + db 25,0,50,16,255 + + db 27,11,20,16,255 + db 27,11,30,16,255 + + db 29,11,10,16,255 + + db 45,22,30,12,255 + db 45,22,40,12,255 + db 45,22,50,12,255 + + db 46,22,40,12,255 + db 46,11,50,12,255 + db 46,22,50,12,255 + db 46,33,50,12,255 + + db 47,0,0,12,255 + + db 26,22,20,16,255 + db 26,33,10,16,255 + db 26,33,20,16,255 + db 26,33,30,16,255 + db 26,44,30,16,255 + db 26,22,30,16,255 + db 26,11,30,16,255 + db 26,11,20,16,255 + db 26,0,20,16,255 + db 26,11,40,16,255 + db 26,0,40,16,255 + db 26,22,40,16,255 + db 26,11,50,16,255 + + db 28,0,30,15,255 + db 28,0,20,15,255 + db 28,0,40,15,255 + db 28,11,30,15,255 + db 28,11,20,15,255 + db 28,22,30,15,255 + db 28,22,20,15,255 + + db 255 + + endp + + + + + + +Walkintoroom proc near + + cmp location,14 + jnz notlair + cmp mapx,22 + jnz notlair + mov destination,1 + mov finaldest,1 + call autosetwalk +notlair: ret + + endp + + + + + + + + + + + + +Afterintroroom proc near + + cmp nowinnewroom,0 + jz notnewintro + call clearwork + call findroominloc + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + mov nowinnewroom,0 +notnewintro: ret + + endp + + + + + + + + + + + +Obname proc near + + cmp reasseschanges,0 + jz notnewpath + mov reasseschanges,0 + jmp diff + +notnewpath: cmp ah,commandtype + jz notdiffob + jmp diff +notdiffob: cmp al,command + jnz diff + cmp walkandexam,1 + jz walkandexamine + cmp mousebutton,0 + jz noobselect + cmp commandtype,3 + jnz isntblock + cmp lastflag,2 + jc noobselect +isntblock: mov bl,manspath + cmp bl,pointerspath + jnz wantstowalk + cmp commandtype,3 + jz wantstowalk + call finishedwalking + jnz noobselect + cmp commandtype,5 + jz wantstotalk + cmp watchingtime,0 + jnz noobselect + call examineob + ret +wantstotalk: cmp watchingtime,0 + jnz noobselect + call talk + ret +walkandexamine: call finishedwalking + jnz noobselect + mov al,walkexamtype + mov commandtype,al + mov al,walkexamnum + mov command,al + mov walkandexam,0 + cmp commandtype,5 + jz noobselect + call examineob + ret +wantstowalk: call setwalk + mov reasseschanges,1 +noobselect: ret + + +diff: mov command,al + mov commandtype,ah +diff2: cmp linepointer,254 + jnz middleofwalk + cmp watchingtime,0 + jnz middleofwalk + mov al,facing + cmp al,turntoface + jnz middleofwalk + cmp commandtype,3 + jnz notblock + mov bl,manspath + cmp bl,pointerspath + jnz dontcheck + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc isblock +dontcheck: call getflagunderp + cmp lastflag,2 + jc isblock + cmp lastflag,128 + jnc isblock + jmp toofaraway ; only here for turning on doorstep +notblock: mov bl,manspath + cmp bl,pointerspath + jnz toofaraway + cmp commandtype,3 + jz isblock + cmp commandtype,5 + jz isaperson + call examineobtext + ret +middleofwalk: call blocknametext + ret +isblock: call blocknametext + ret +isaperson: call personnametext + ret +toofaraway: call walktotext + ret + + endp + + + + + + + +Finishedwalking proc near + + cmp linepointer,254 + jnz iswalking + mov al,facing + cmp al,turntoface +iswalking: ret + + endp + + + + + + + +Examineobtext proc near + + mov bl,command + mov bh,commandtype + mov al,1 + call commandwithob + ret + + endp + + + + + +Commandwithob proc near + + push ax + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + push bx + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + + pop ax + mov di,offset cs:commandline + call copyname + pop ax + + mov di,lastxpos + cmp al,0 + jz noadd + add di,5 +noadd: mov bx,textaddressy + push cs + pop es + mov si,offset cs:commandline + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + +commandline: db "OBJECT NAME ONE ",0 + + endp + + + + +Commandonly proc near + + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + + endp + + + + + +Printmessage proc near + + push dx bx di + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + +Printmessage2 proc near + + push dx bx di + push ax + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop ax + +searchmess: push ax + call findnextcolon + pop ax + dec ah + jnz searchmess + + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + +Blocknametext proc near + + mov bl,command + mov bh,commandtype + mov al,0 + call commandwithob + ret + + endp + + + + +Personnametext proc near + + mov bl,command + and bl,127 + mov bh,commandtype + mov al,2 + call commandwithob + ret + + endp + + + + + + + +Walktotext proc near + + mov bl,command + mov bh,commandtype + mov al,3 + call commandwithob + ret + + endp + + + + + +Getflagunderp proc near + + mov cx,mousex + sub cx,mapadx + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + mov lastflag,cl + mov lastflagex,ch + ret + + endp + + + + + +Setwalk proc near + + cmp linepointer,254 + jnz alreadywalking + mov al,pointerspath + cmp al,manspath + jz cantwalk2 + cmp watchmode,1 + jz holdingreel + cmp watchmode,2 + jz cantwalk + mov destination,al + mov finaldest,al + cmp mousebutton,2 + jnz notwalkandexam + cmp commandtype,3 + jz notwalkandexam + mov walkandexam,1 + mov al,commandtype + mov walkexamtype,al + mov al,command + mov walkexamnum,al +notwalkandexam: call autosetwalk +cantwalk: ret +cantwalk2: call facerightway + ret +alreadywalking: mov al,pointerspath + mov finaldest,al + ret + +holdingreel: mov destafterhold,al + mov watchmode,2 + ret + + endp + + + + + + + +Autosetwalk proc near + + mov al,manspath + cmp finaldest,al + jnz notsamealready + ret +notsamealready: call getroomspaths + call checkdest + push bx + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov linestartx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov linestarty,ax + pop bx + + mov al,destination + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov lineendx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov lineendy,ax + call bresenhams + + cmp linedirection,0 + jz normalline + mov al,linelength + dec al + mov linepointer,al + mov linedirection,1 + ret + +normalline: mov linepointer,0 + ret + + endp + + + + + + + + +Checkdest proc near + + push bx + add bx,12*8 + mov ah,manspath + mov cl,4 + shl ah,cl + mov al,destination + + mov cl,24 + mov ch,destination +checkdestloop: mov dh,[es:bx] + and dh,11110000b + mov dl,[es:bx] + and dl,00001111b + cmp ax,dx + jnz nextcheck + mov al,[es:bx+1] + and al,15 + mov destination,al + pop bx + ret +nextcheck: mov dl,[es:bx] + and dl,11110000b + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + mov dh,[es:bx] + and dh,00001111b + shl dh,1 + shl dh,1 + shl dh,1 + shl dh,1 + cmp ax,dx + jnz nextcheck2 + mov ch,[es:bx+1] + and ch,15 +nextcheck2: add bx,2 + dec cl + jnz checkdestloop + mov destination,ch + pop bx + ret + + endp + + + + + + + + + + + + + + +Bresenhams proc near + + call workoutframes + + mov dx,seg linedata + mov es,dx + mov di,offset es:linedata + mov si,1 + mov linedirection,0 + + mov cx,lineendx + sub cx,linestartx + jz vertline + jns line1 + + neg cx + mov bx,lineendx + xchg bx,linestartx + mov lineendx,bx + + mov bx,lineendy + xchg bx,linestarty + mov lineendy,bx + mov linedirection,1 + +line1: mov bx,lineendy + sub bx,linestarty + jz horizline + jns line3 + + neg bx + neg si + +line3: push si + mov lineroutine,0 ; means lo slope + cmp bx,cx + jle line4 + mov lineroutine,1 ; means hi slope + xchg bx,cx + +line4: shl bx,1 + mov increment1,bx + sub bx,cx + mov si,bx + sub bx,cx + mov increment2,bx + + mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx + pop bx + cmp lineroutine,1 + jz hislope + jmp loslope + +vertline: mov ax,linestarty + mov bx,lineendy + mov cx,bx + sub cx,ax + jge line31 + + neg cx + mov ax,bx + mov linedirection,1 + +line31: inc cx + mov bx,linestartx + xchg ax,bx + mov ah,bl + mov bx,si +line32: stosw + add ah,bl + loop line32 + jmp lineexit + + +horizline: mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx +horizloop: stosw + inc al + loop horizloop + jmp lineexit + + +loslope: +loloop: stosw + inc al + or si,si + jns line12 + add si,increment1 + loop loloop + jmp lineexit + +line12: add si,increment2 + add ah,bl + loop loloop + jmp lineexit + + + +hislope: +hiloop: stosw + add ah,bl + or si,si + jns line23 + add si,increment1 + loop hiloop + jmp lineexit + +line23: add si,increment2 + inc al + loop hiloop + +lineexit: sub di,offset es:linedata + mov ax,di + shr ax,1 + mov linelength,al + ret + + endp + + + + + + + +Workoutframes proc near + + mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jnc notneg1 + neg bx +notneg1: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc notneg2 + neg cx +notneg2: cmp bx,cx + jnc tendstohoriz + mov dl,2 + mov ax,cx + shr ax,1 + cmp bx,ax + jc gotquad + mov dl,1 + jmp gotquad +tendstohoriz: mov dl,0 + mov ax,bx + shr ax,1 + cmp cx,ax + jc gotquad + mov dl,1 + jmp gotquad + +gotquad: mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jc isinright +isinleft: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc topleft + cmp dl,1 + jz noswap1 + xor dl,2 +noswap1: add dl,4 + jmp success +topleft: add dl,6 + jmp success + +isinright: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc botright + add dl,2 + jmp success +botright: cmp dl,1 + jz noswap2 + xor dl,2 +noswap2: + +success: and dl,7 + mov turntoface,dl + mov turndirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + +;Multiply8 proc near +; +; mov ah,0 +; mov cx,8 +; mul cx +; ret +; +; endp + + + + + + +Getroomspaths proc near + + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + ret + + endp + + + + + + + + + + + + + + + + +Copyname proc near + + push di + call findobname + pop di + push cs + pop es + +copytext: mov cx,28 +make: lodsb + cmp al,":" + jz finishmakename + cmp al,0 + jz finishmakename + stosb + loop make + +finishmakename: inc cx + mov al,0 + stosb + ret + mov al,255 + rep stosb + ret + + endp + + + + + + + + + +Findobname proc near + + push ax + mov ah,0 + add ax,ax + mov bx,ax + pop ax + + cmp ah,5 + jnz notpersonname + + push ax + and al,127 + mov ah,0 + mov bx,64*2 + mul bx + mov si,ax + mov ds,people + add si,persontxtdat + mov cx,persontext + mov ax,[si] + add ax,cx + mov si,ax + pop ax + ret + +notpersonname: cmp ah,4 + jnz notextraname + mov ds,extras + add bx,extextdat + mov ax,[bx] + add ax,extext + mov si,ax + ret + +notextraname: cmp ah,2 + jnz notfreename + mov ds,freedesc + add bx,freetextdat + mov ax,[bx] + add ax,freetext + mov si,ax + ret + +notfreename: cmp ah,1 + jnz notsetname + mov ds,setdesc + add bx,settextdat + mov ax,[bx] + add ax,settext + mov si,ax + ret + +notsetname: mov ds,blockdesc + add bx,blocktextdat + mov ax,[bx] + add ax,blocktext + mov si,ax + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------Printing of non scrolling icons---- + +Showicon proc near + + cmp reallocation,50 + jnc isdream1 + call showpanel + call showman + call roomname + call panelicons1 + call zoomicon + ret + +isdream1: mov ds,tempsprites + mov di,72 + mov bx,2 + mov al,45 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+47 + mov bx,2 + mov al,46 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,69-10 + mov bx,21 + mov al,49 + mov ah,0 + call showframe + + mov ds,tempsprites + mov di,160+88 + mov bx,2 + mov al,45 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+43 + mov bx,2 + mov al,46 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+101 + mov bx,21 + mov al,49 + mov ah,4 + call showframe + call middlepanel + ret + + endp + + + + + +Middlepanel proc near + + mov ds,tempsprites + mov di,72+47+20 + mov bx,0 + mov al,48 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+19 + mov bx,21 + mov al,47 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,160+23 + mov bx,0 + mov al,48 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+71 + mov bx,21 + mov al,47 + mov ah,4 + call showframe + ret + + endp + + + + + + + + + + +Showman proc near + + mov ds,icons1 + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,icons1 + mov di,0 + mov bx,114 + mov al,1 + mov ah,0 + call showframe + + cmp shadeson,0 + jz notverycool + + mov ds,icons1 + mov di,28 + mov bx,25 + mov al,2 + mov ah,0 + call showframe +notverycool: ret + + endp + + + + + + + + + + + + + + + + + + + +Showpanel proc near + + mov ds,icons1 + mov di,72 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + mov ds,icons1 + mov di,192 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Roomname proc near + + mov di,88 + mov bx,18 + mov al,53 + mov dl,240 + call printmessage + + mov bl,roomnum + cmp bl,32 + jc notover32 + sub bl,32 + +notover32: mov bh,0 + add bx,bx + mov es,roomdesc + add bx,intextdat + mov ax,[es:bx] + add ax,intext + mov si,ax + + mov linespacing,7 + mov di,88 + mov bx,25 + mov dl,120 + cmp watchon,1 + jz gotpl + mov dl,160 +gotpl: mov al,0 + mov ah,0 + call printdirect + mov linespacing,10 + + call usecharset1 + ret + + endp + + + + + + +Usecharset1 proc near + + mov ax,charset1 + mov currentset,ax + ret + + endp + + + + + + + + + + + +Usetempcharset proc near + + mov ax,tempcharset + mov currentset,ax + ret + + endp + + + + + +Showexit proc near + + mov ds,icons1 + mov di,274 + mov bx,154 + mov al,11 + mov ah,0 + call showframe + ret + + endp + + + + +Panelicons1 proc near + + mov di,0 + cmp watchon,1 + jz watchison + mov di,48 +watchison: push di + mov ds,icons2 + add di,204 + mov bx,4 + mov al,2 + mov ah,0 + call showframe + pop di + push di + cmp zoomon,1 + jz zoomisoff + mov ds,icons1 + add di,228 + mov bx,8 + mov al,5 + mov ah,0 + call showframe +zoomisoff: pop di + call showwatch + ret + + endp + + + + + + + + + + + + +Showwatch proc near + + cmp watchon,0 + jz nowristwatch + mov ds,icons1 + mov di,250 + mov bx,1 + mov al,6 + mov ah,0 + call showframe + call showtime +nowristwatch: ret + + endp + + +Gettime proc near + + mov ah,2ch + int 21h + mov secondcount,dh + mov minutecount,cl + mov hourcount,ch + ret + + endp + + + + + +Zoomicon proc near + + cmp zoomon,0 + jz nozoom1 + mov ds,icons1 + mov di,zoomx + mov bx,zoomy-1 + mov al,8 + mov ah,0 + call showframe +nozoom1: ret + + endp + + + + + + +Showblink proc near + + cmp manisoffscreen,1 + jz finblink1 + inc blinkcount + cmp shadeson,0 + jnz finblink1 + cmp reallocation,50 + jnc eyesshut + mov al,blinkcount + cmp al,3 + jnz finblink1 + mov blinkcount,0 + mov al,blinkframe + inc al + mov blinkframe,al + cmp al,6 + jc nomorethan6 + mov al,6 +nomorethan6: mov ah,0 + mov bx,offset cs:blinktab + add bx,ax + + mov al,[cs:bx] + mov ds,icons1 + mov di,44 + mov bx,32 + mov ah,0 + call showframe +finblink1: ret + +eyesshut: ;mov al,32 + ;mov ds,icons1 + ;mov di,44 + ;mov bx,32 + ;mov ah,0 + ;call showframe + ret + +blinktab: db 16,18,18,17,16,16,16 + + endp + + + + + + +Dumpblink proc near + + cmp shadeson,0 + jnz nodumpeye + cmp blinkcount,0 + jnz nodumpeye + mov al,blinkframe + cmp al,6 + jnc nodumpeye + push ds + mov di,44 + mov bx,32 + mov cl,16 + mov ch,12 + call multidump + pop ds +nodumpeye: ret + + endp + + + + + + + + + + + + + + + + + + +Worktoscreenm proc near + + call animpointer + call readmouse + call showpointer + call vsync + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------------------------Blank routine---- + + + + +Blank proc near + + cmp commandtype,199 + jz alreadyblnk + mov commandtype,199 + mov al,0 + call commandonly +alreadyblnk: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +;---------------------------------------------------------Standard routines---- + + + + + + + + + + + + + +Allpointer proc near + + call readmouse + call showpointer + call dumppointer + ret + + endp + + + + + + + +Hangonp proc near + + push cx + add cx,cx + pop ax + add cx,ax + mov maintimer,0 + mov al,pointerframe + mov ah,pickup + push ax + mov pointermode,3 + mov pickup,0 + push cx + mov commandtype,255 + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + +hangloop: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + mov ax,mousebutton + cmp ax,0 + jz notpressed + cmp ax,oldbutton + jnz getoutofit +notpressed: loop hangloop + +getoutofit: call delpointer + pop ax + mov pointerframe,al + mov pickup,ah + mov pointermode,0 + ret + + endp + + + + + +Hangonw proc near + +hangloopw: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + loop hangloopw + ret + + endp + + + + +Hangoncurs proc near + +monloop1: push cx + call printcurs + call vsync + call delcurs + pop cx + loop monloop1 + ret + + endp + + + + + + + + +Getunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiget + ret + + endp + + + + + +Dumpzoom proc near + + cmp zoomon,1 + jnz notzoomon + mov di,zoomx+5 + mov bx,zoomy+4 + mov cl,46 + mov ch,40 + call multidump +notzoomon: ret + + endp + + + + + + + +Putunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiput + ret + + endp + + + + + +Crosshair proc near + + cmp commandtype,3 + jz nocross + cmp commandtype,10 + jnc nocross + + mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,9 + mov ah,0 + call showframe + ret + +nocross: mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,29 + mov ah,0 + call showframe + ret + + endp + + + + + + +Showpointer proc near + + call showblink + mov di,mousex + mov oldpointerx,di + mov bx,mousey + mov oldpointery,bx + cmp pickup,1 + jz itsanobject + + push bx di + mov ds,icons1 + mov al,pointerframe + add al,20 + mov ah,0 + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cx,[si] + cmp cl,12 + jnc notsmallx + mov cl,12 +notsmallx: cmp ch,12 + jnc notsmally + mov ch,12 +notsmally: mov pointerxs,cl + mov pointerys,ch + push ds + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx + push di bx + mov al,pointerframe + add al,20 + mov ah,0 + call showframe + pop bx di + ret + +itsanobject: mov al,itemframe + mov ds,extras + cmp objecttype,4 + jz itsfrominv + mov ds,freeframes +itsfrominv: mov cl,al + add al,al + add al,cl + inc al + mov ah,0 + + push ax + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov ax,2080 + mov cx,[si] + cmp cl,12 + jnc notsmallx2 + mov cl,12 +notsmallx2: cmp ch,12 + jnc notsmally2 + mov ch,12 +notsmally2: mov pointerxs,cl + mov pointerys,ch + pop ax + + push di bx + push ax bx di ds + mov al,cl + mov ah,0 + shr ax,1 + sub oldpointerx,ax + sub di,ax + mov al,ch + shr ax,1 + sub oldpointery,ax + sub bx,ax + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx ax + mov ah,128 + call showframe + pop bx di + mov ds,icons1 + mov al,3 + mov ah,128 + call showframe + ret + + endp + + + + + + + +Delpointer proc near + + mov ax,oldpointerx + cmp ax,0ffffh + jz nevershown + mov delherex,ax + mov ax,oldpointery + mov delherey,ax + mov cl,pointerxs + mov delxs,cl + mov ch,pointerys + mov delys,ch + mov ds,buffers + mov si,pointerback + mov di,delherex + mov bx,delherey + call multiput +nevershown: ret + + endp + + + + + + + + + +Dumppointer proc near + + call dumpblink + mov cl,delxs + mov ch,delys + mov di,delherex + mov bx,delherey + call multidump + + mov bx,oldpointery + mov di,oldpointerx + cmp di,delherex + jnz difffound + cmp bx,delherey + jz notboth +difffound: mov cl,pointerxs + mov ch,pointerys + call multidump +notboth: ret + + endp + + + + + + + + + + + +Undertextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiget + ret + + endp + + + + + + + + +Deltextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiput + ret + + endp + + + + + +Dumptextline proc near + + cmp newtextline,1 + jnz nodumptextline + mov newtextline,0 + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov cl,undertextsizex + mov ch,undertextsizey + call multidump +nodumptextline: ret + + endp + + + + + + + + + + + + + + + + + +Animpointer proc near + + cmp pointermode,2 + jz combathand + cmp pointermode,3 + jz mousehand + + cmp watchingtime,0 + jz notwatchpoint + mov pointerframe,11 + ret +notwatchpoint: mov pointerframe,0 + cmp inmaparea,0 + jz gothand + cmp pointerfirstpath,0 + jz gothand +arrow: call getflagunderp + cmp cl,2 + jc gothand + cmp cl,128 + jnc gothand + mov pointerframe,3 + test cl,4 + jnz gothand + mov pointerframe,4 + test cl,16 + jnz gothand + mov pointerframe,5 + test cl,2 + jnz gothand + mov pointerframe,6 + test cl,8 + jnz gothand + mov pointerframe,8 +gothand: ret + +mousehand: cmp pointerspeed,0 + jz rightspeed3 + dec pointerspeed + jmp finflashmouse +rightspeed3: mov pointerspeed,5 + inc pointercount + cmp pointercount,16 + jnz finflashmouse + mov pointercount,0 +finflashmouse: mov al,pointercount + mov ah,0 + mov bx,offset cs:flashmousetab + add bx,ax + mov al,[cs:bx] + mov pointerframe,al + ret + +combathand: mov pointerframe,0 + cmp reallocation,14 + jnz notarrow + cmp commandtype,211 + jnz notarrow + mov pointerframe,5 +notarrow: ret + +flashmousetab: db 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2 + + endp + + + + +;------------------------------------------------Mouse and keyboard-readers---- + +Setmouse proc near + + if recording + mov recordpos,-8 + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov rechandle,ax + endif + + if playback + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov ah,3dh + mov al,2 + int 21h + mov rechandle,ax + call loadrec + endif + + mov oldpointerx,0ffffh + + mov ax,0 + int 33h + mov ax,8 + mov cx,15 + mov dx,184 + int 33h + mov ax,7 + mov cx,15 + mov dx,298*2 + int 33h + ret + + endp + + + + + +Readmouse proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton,bx + ret + + endp + + + + + + + +Mousecall proc near + + if playback + call playmouse + ret + endif + + mov ax,3 + int 33h + shr cx,1 + cmp cx,298 + jc notxover + mov cx,298 +notxover: cmp cx,15 + jnc notxover2 + mov cx,15 +notxover2: cmp dx,184 + jc notyover + mov dx,184 +notyover: cmp dx,15 + jnc notyover2 + mov dx,15 +notyover2: + if recording + call recmouse + endif + ret + + endp + + + + + + + if playback + +Playmouse proc near + + mov es,recordspace + mov di,recordpos + cmp word ptr [es:di+6],0 + jnz isthisplay + add di,8 + add recordpos,8 + cmp di,16384 + jnz isthisplay + call loadrec +isthisplay: mov cx,[es:di] + mov dx,[es:di+2] + mov bx,[es:di+4] + dec word ptr [es:di+6] + ret + + endp + + endif + + if recording + +Recmouse proc near + + mov es,recordspace + mov di,recordpos + cmp di,-8 + jz diffrec + cmp [es:di],cx + jnz diffrec + cmp [es:di+2],dx + jnz diffrec + cmp [es:di+4],bx + jnz diffrec + inc word ptr [es:di+6] + cmp word ptr [es:di+5],0ffffh + jz diffrec + ret +diffrec: add recordpos,8 + add di,8 + cmp di,16384 + jnz notsaverec + push cx dx bx + call saverec + pop bx dx cx +notsaverec: mov [es:di],cx + mov [es:di+2],dx + mov [es:di+4],bx + mov word ptr [es:di+6],1 + ret + + endp + + + + + +Saverec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,recordpos + add cx,8 + mov ah,40h + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + + + + +Loadrec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,16384+8 + mov ah,3fh + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + endif + + + + + + + +Readmouse1 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton1,bx + ret + + endp + + + +Readmouse2 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton2,bx + ret + + endp + + +Readmouse3 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton3,bx + ret + + endp + + + + + + +Readmouse4 proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov ax,mousebutton1 + or ax,mousebutton2 + or ax,mousebutton3 + or bx,ax + mov mousebutton,bx + ret + + endp + + + + + +Readkey proc near + + mov bx,bufferout + cmp bx,bufferin + jz nokey + inc bx + and bx,15 + mov bufferout,bx + mov di,offset cs:keybuffer + add di,bx + mov al,[cs:di] + mov currentkey,al + ret +nokey: mov currentkey,0 + ret + + + endp + +keybuffer: db 16 dup (0) + + + +Convertkey proc near + + and al,127 + mov ah,0 + mov di,offset cs:keyconverttab + add di,ax + mov al,[cs:di] + ret + +keyconverttab: db 0,0,"1","2","3","4","5","6","7","8","9","0","-",0,8,0 + db "Q","W","E","R","T","Y","U","I","O","P",0,0,13,0,"A","S" + db "D","F","G","H","J","K","L",0,0,0,0,0,"Z","X","C","V","B","N","M" + db 0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + endp + + + + +;-------------------------------------------------------------Miscellaneous---- + +Randomnum1 proc near + + push ds es di bx cx + call randomnumber + pop cx bx di es ds + ret + + endp + + + + + +Randomnum2 proc near + + push ds es di bx ax + call randomnumber + mov cl,al + pop ax bx di es ds + ret + + endp + + + + + +Randomnumber proc near + + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + + mov al,seed + ret + + endp + + + + + + +Hangon proc near + +hangonloop: push cx + call vsync + pop cx + loop hangonloop + ret + + endp + + + + + +;-------------------------------------------------------------Disc handling---- + + +Loadtraveltext proc near + + mov dx,offset cs:traveltextname + call standardload + mov traveltext,ax + ret + + endp + + + + + + +Loadintotemp proc near + + push cs + pop ds + call standardload + mov tempgraphics,ax + ret + + endp + + + + + + +Loadintotemp2 proc near + + push cs + pop ds + call standardload + mov tempgraphics2,ax + ret + + endp + + + + +Loadintotemp3 proc near + + push cs + pop ds + call standardload + mov tempgraphics3,ax + ret + + endp + + + +Loadtempcharset proc near + + call standardload + mov tempcharset,ax + ret + + endp + + + + + + +Standardload proc near + + call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov ds,ax + pop cx + push ax + mov dx,0 + call readfromfile + call closefile + pop ax + ret + + endp + + + + + + +Loadtemptext proc near + + call standardload + mov textfile1,ax + ret + + endp + + + + + + + +Loadroom proc near + + mov roomloaded,1 + mov timecount,0 + mov maintimer,0 + mov mapoffsetx,104 + mov mapoffsety,38 + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + mov al,newlocation + mov location,al + call getroomdata + call startloading + call loadroomssample + call switchryanon + call drawflags + call getdimension + ret + + endp + + + + +Loadroomssample proc near + + mov al,roomssample + cmp al,255 + jz loadedalready + cmp al,currentsample + jz loadedalready + mov currentsample,al + mov al,currentsample + mov cl,"0" + call twodigitnum + mov di,offset cs:samplename + xchg al,ah + mov [cs:di+10],ax + mov dx,di + call loadsecondsample +loadedalready: ret + + endp + + + + + +Getridofreels proc near + + cmp roomloaded,0 + jz dontgetrid + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem +dontgetrid: ret + + endp + + + + + +Getridofall proc near + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + +Restorereels proc near + + cmp roomloaded,0 + jz dontrestore + mov al,reallocation + call getroomdata + mov dx,bx + call openfile + call readheader + + call dontloadseg + call dontloadseg + call dontloadseg + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + call closefile +dontrestore: ret + + endp + + + + + + + +Restoreall proc near + + mov al,location + call getroomdata + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + ;mov ds,setdat + ;mov dx,0 + ;mov cx,setdatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + ;call bloc + ;BIG FIXME: undefined bloc, replaced with loadseg. dunno! + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + ;mov ds,freedat + ;mov dx,0 + ;mov cx,freedatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + call setallchanges + ret + + endp + + + +Sortoutmap proc near + + push es di + mov ds,workspace + mov si,0 + mov es,mapdata + mov di,0 + + mov cx,maplength +blimey: push cx si + mov cx,mapwidth + rep movsb + pop si cx + add si,132 + loop blimey + pop di es + ret + + endp + + + + +Startloading proc near + + mov combatcount,0 + mov al,[cs:bx+13] + mov roomssample,al + mov al,[cs:bx+15] + mov mapx,al + mov al,[cs:bx+16] + mov mapy,al + + mov al,[cs:bx+20] ; start path pos + mov liftflag,al + mov al,[cs:bx+21] ; start path pos + mov manspath,al + mov destination,al + mov finaldest,al + mov al,[cs:bx+22] + mov facing,al + mov turntoface,al + mov al,[cs:bx+23] + mov counttoopen,al + mov al,[cs:bx+24] + mov liftpath,al + mov al,[cs:bx+25] + mov doorpath,al + mov lastweapon,-1 + mov al,[cs:bx+27] + push ax + + mov al,[cs:bx+31] + mov ah,reallocation + mov reallocation,al + + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + mov ds,setdat + mov dx,0 + mov cx,setdatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + mov ds,freedat + mov dx,0 + mov cx,freedatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + + call findroominloc + call deletetaken + call setallchanges + call autoappear + mov al,newlocation + call getroomdata + mov lastweapon,-1 + mov mandead,0 + mov lookcounter,160 + mov newlocation,255 + mov linepointer,254 + pop ax + cmp al,255 + jz dontwalkin + mov manspath,al + push bx + call autosetwalk + pop bx +dontwalkin: call findxyfrompath + ret + + endp + + + + + + + + + + +Disablepath proc near ;needs al,ah map x,y cl=path + + push cx + xchg al,ah + mov cx,-6 +looky2: add cx,6 + sub al,10 + jnc looky2 + mov al,ah + dec cx +lookx2: inc cx + sub al,11 + jnc lookx2 + mov al,cl + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + + + + +Findxyfrompath proc near ;path number was found from + ;room data. Fill ryanxy from + call getroomspaths ;the pathdata. + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov ax,[es:bx] + sub al,12 + sub ah,12 + mov ryanx,al + mov ryany,ah + ret + + endp + + + + + +Findroominloc proc near + + mov al,mapy + mov cx,-6 +looky: add cx,6 + sub al,10 + jnc looky + mov al,mapx + dec cx +lookx: inc cx + sub al,11 + jnc lookx + mov roomnum,cl + ret + + endp + + + + + + +Getroomdata proc near + + mov ah,0 + mov cx,32 + mul cx + mov bx,offset cs:roomdata + add bx,ax + ret + + endp + + + + + + + + + + + + + +Readheader proc near + + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen + call readfromfile + push cs + pop es + mov di,offset cs:filedata + ret + + endp + + + + + + + + +Dontloadseg proc neqr + + mov ax,[es:di] + add di,2 + push bx di es + mov cx,0 + mov dx,ax + mov al,1 + mov ah,42h + int 21h + pop es di bx + ret + + endp + + + + + + +Allocateload proc near + + push es di + mov bx,[es:di] + mov cl,4 + shr bx,cl + call allocatemem + pop di es + ret + + endp + + + + +Fillspace proc near + + push es ds dx di bx + mov di,dx + push ds + pop es + rep stosb + pop bx di dx ds es + ret + + endp + + + + + + + +Getridoftemp proc near + + mov es,tempgraphics + call deallocatemem + ret + + endp + + + + + +Getridoftemptext proc near + + mov es,textfile1 + call deallocatemem + ret + + endp + + + + + +Getridoftemp2 proc near + + mov es,tempgraphics2 + call deallocatemem + ret + + endp + + + +Getridoftemp3 proc near + + mov es,tempgraphics3 + call deallocatemem + ret + + endp + + + +Getridoftempcharset proc near + + mov es,tempcharset + call deallocatemem + ret + + endp + + + +Getridoftempsp proc near + + mov es,tempsprites + call deallocatemem + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + +Readsetdata proc near + + mov dx,offset cs:characterset1 + call standardload + mov charset1,ax + + mov dx,offset cs:icongraphics0 + call standardload + mov icons1,ax + + mov dx,offset cs:icongraphics1 + call standardload + mov icons2,ax + + mov dx,offset cs:spritename1 + call standardload + mov mainsprites,ax + + mov dx,offset cs:puzzletextname + call standardload + mov puzzletext,ax + + mov dx,offset cs:commandtextname + call standardload + mov commandtext,ax + + mov ax,charset1 + mov currentset,ax + + cmp soundint,255 + jz novolumeload + mov dx,offset cs:volumetabname + call openfile + mov cx,2048-256 + mov ds,soundbuffer + mov dx,16384 + call readfromfile + call closefile +novolumeload: ret + + endp + + + + + + + + + + + +Createfile proc near + + mov ah,3ch + mov cx,0 + int 21h + mov bx,ax + ret + + endp + + + + + + + +Openfile proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + jc fileerror + mov handle,ax + ret +fileerror: mov gameerror,8 + jmp quickquit2 + + endp + + + if cd +Openfilefromc proc near + + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + mov handle,ax + ret + + endp + endif + + + if cd +Makename proc near + + if demo + ret + endif + mov si,dx + mov di,offset cs:place +transfer: mov al,[cs:si] + mov [cs:di],al + inc si + inc di + cmp al,0 + jnz transfer + mov dx,offset cs:id + ret +id: db "D:\" +place: db 30 dup (0) + + endp + endif + + + + + +Openfilenocheck proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Openforsave proc near + + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Closefile proc near + + mov bx,handle + mov ah,3eh + int 21h + ret + + endp + + + + +Readfromfile proc near + + mov bx,handle + mov ah,3fh + int 21h + ret + + endp + + + + +Setkeyboardint proc near + + mov ah,35h + mov al,9 + int 21h + mov oldint9seg,es ; Save es:bx to temp memory + mov oldint9add,bx + push cs + pop ds + mov dx,offset cs:keyboardread + mov ah,25h + mov al,9 + int 21h ; Set to new + ret + + endp + + + + +Resetkeyboard proc near + + cmp oldint9add,-1 + jz noreset + mov dx,oldint9add ;Restore old interupt vector + mov ax,oldint9seg ;for keys + mov ds,ax + mov ah,25h + mov al,9 + int 21h +noreset: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Keyboardread proc near + + push ax dx di ds es + in al,60h + cmp al,lasthardkey + jz same + mov lasthardkey,al + cmp al,128 + jnc same + mov dx,bufferin + inc dx + and dx,15 + cmp dx,bufferout + jz same ;buffer is full + mov bufferin,dx + call convertkey + mov di,offset cs:keybuffer + mov dx,bufferin + add di,dx + mov [cs:di],al +same: in al,61h + mov ah,al + or al,80h ; Mask for Akn + out 61h,al ; Set Akn. + and al,7fh + out 61h,al + cli + mov al,20h ; 8259 end of interrupt + out 20h,al + pop es ds di dx ax + iret + + endp + + + +;------------------------------------------------------Text and tables data---- + + + +Fileheader db "DREAMWEB DATA FILE " + db "COPYRIGHT 1992 " + db "CREATIVE REALITY" +Filedata dw 20 dup (0) +Extradata db 6 dup (0) +Headerlen equ $-Fileheader + + +Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment + db 5,255,33,10 + db 255,255,255,0 + db 1,6,2,255,3,255,255,255,255,255,0 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 7,2,255,255,255,255,6,255,255,255,1 + + db "DREAMWEB.R02",0 + db 2,255,33,0 + db 255,255,255,0 + db 1,0,255,255,1,255,3,255,255,255,2 + + db "DREAMWEB.R03",0 + db 5,255,33,10 + db 255,255,255,0 + db 2,2,0,2,4,255,0,255,255,255,3 + + db "DREAMWEB.R04",0 + db 23,255,11,30 + db 255,255,255,0 + db 1,4,0,5,255,255,3,255,255,255,4 + + db "DREAMWEB.R05",0 + if demo + db 22,255,22,30 + else + db 5,255,22,30 + endif + db 255,255,255,0 + db 1,2,0,4,255,255,3,255,255,255,5 + + db "DREAMWEB.R06",0 + db 5,255,11,30 + db 255,255,255,0 + db 1,0,0,1,2,255,0,255,255,255,6 + + db "DREAMWEB.R07",0 + db 255,255,0,20 + db 255,255,255,0 + db 2,2,255,255,255,255,0,255,255,255,7 + + db "DREAMWEB.R08",0 + db 8,255,0,10 + db 255,255,255,0 + db 1,2,255,255,255,255,0,11,40,0,8 + + db "DREAMWEB.R09",0 + db 9,255,22,10 + db 255,255,255,0 + db 4,6,255,255,255,255,0,255,255,255,9 + + db "DREAMWEB.R10",0 + db 10,255,33,30 + db 255,255,255,0 + db 2,0,255,255,2,2,4,22,30,255,10 ;22,30,0 switches + ;off path 0 in skip + db "DREAMWEB.R11",0 + db 11,255,11,20 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R12",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R13",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,13 + + db "DREAMWEB.R14",0 + db 14,255,44,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,14 + + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R20",0 + db 22,255,0,20 + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,20 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R22",0 + db 22,255,22,10 + db 255,255,255,0 + db 0,4,255,255,1,255,255,255,255,255,22 + + db "DREAMWEB.R23",0 + db 23,255,22,30 + db 255,255,255,0 + db 1,4,2,15,3,255,255,255,255,255,23 + + db "DREAMWEB.R24",0 + db 5,255,44,0 + db 255,255,255,0 + db 1,6,2,15,255,255,255,255,255,255,24 + + db "DREAMWEB.R25",0 + db 22,255,11,40 + db 255,255,255,0 + db 1,0,255,255,255,255,255,255,255,255,25 + + db "DREAMWEB.R26",0 + db 9,255,22,20 + db 255,255,255,0 + db 4,2,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R27",0 + db 22,255,11,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,27 + + db "DREAMWEB.R28",0 + db 5,255,11,30 + db 255,255,255,0 + db 0,0,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R29",0 + db 22,255,11,10 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,29 + + + + db "DREAMWEB.R05",0 ;Duplicate of hotel lobby, + if demo + db 22,255,22,10 ;but emerging from the lift. + else + db 5,255,22,10 + endif + db 255,255,255,0 + db 1,4,1,15,255,255,255,255,255,255,5 + + db "DREAMWEB.R04",0 ;Duplicate of pool hall lobby, + db 23,255,22,20 ;but emerging from the lift. + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,4 + + db "DREAMWEB.R10",0 ;entering alley via skip + db 10,255,22,30 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,10 + + db "DREAMWEB.R12",0 ;on the beach, getting up. + db 12,255,22,20 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R03",0 ;Duplicate of Eden's lobby + db 5,255,44,0 ;but emerging from the lift + db 255,255,255,0 + db 1,6,2,255,4,255,255,255,255,255,3 + + db "DREAMWEB.R24",0 ;Duplicate of Eden's flat + db 5,255,22,0 ;but starting on the bed + db 255,255,255,0 + db 3,6,0,255,255,255,255,33,0,3,24 ; 33,0,3 turns off + ; path for lift + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 ;coming out of bedroom + db 0,2,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R11",0 ;Duplicate + db 11,255,22,30 ;of carpark but getting + db 255,255,255,0 ;up off the floor + db 0,0,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R28",0 + db 5,255,11,20 + db 255,255,255,0 + db 0,6,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R26",0 + db 9,255,0,40 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 2,2,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R08",0 ;leaving tvstudio into street + db 8,255,11,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,8 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,1 + + + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + db "DREAMWEB.R47",0 ;Dream room + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,47 + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 4,0,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,50 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + + + db "DREAMWEB.R50",0 ; Intro sequence one + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,50 + + db "DREAMWEB.R51",0 ; Intro sequence two + db 35,255,11,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,51 + + db "DREAMWEB.R52",0 ; Intro sequence three + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,52 + + db "DREAMWEB.R53",0 ; Intro sequence four + db 35,255,33,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,53 + + db "DREAMWEB.R54",0 ; Intro sequence five - wasteland + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,54 + + db "DREAMWEB.R55",0 ; End sequence + db 14,255,44,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,55 + + +Madeuproomdat db 32 dup (0) + +Roomscango db 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0 + +Roompics db 5,0,3,2,4,1,10,9,8,6,11,4,7,7,0 + +Oplist db 3 dup (0) + +Inputline db 128 dup (0) + +linedata dw 200 dup (0ffffh) + +presslist db 6 dup (255) + +savenames db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + + + +savefiles db "DREAMWEB.D00",0 + db "DREAMWEB.D01",0 + db "DREAMWEB.D02",0 + db "DREAMWEB.D03",0 + db "DREAMWEB.D04",0 + db "DREAMWEB.D05",0 + db "DREAMWEB.D06",0 + +Recname db "DREAMWEB.DEM",0 + + +;-------------------------------------------------------End of code segment---- + +DREAMWEBPROG ends + + + + +;---------------------------------------------------------------Stack space----s + +STACKSPACE segment para stack 'STACK' + +stak db 256 dup (?) + +STACKSPACE ends + + + +;-----------------------------------------------------------End of all code---- + + end Dreamweb + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm new file mode 100644 index 0000000000..9ddce697f2 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -0,0 +1,1758 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Entercode proc near + + mov keypadax,ax + mov keypadcx,cx + call getridofreels + call loadkeypad + call createpanel + call showicon + call showouterpad + call showkeypad + call readmouse + call showpointer + call worktoscreen + call delpointer + mov presspointer,0 + mov getback,0 + +keypadloop: call delpointer + call readmouse + call showkeypad + call showpointer + cmp presscount,0 + jz nopresses + dec presscount + jmp afterpress +nopresses: mov pressed,255 + mov graphicpress,255 + call vsync + +afterpress: call dumppointer + call dumpkeypad + call dumptextline + mov bx,offset cs:keypadlist + call checkcoords + cmp getback,1 + jz numberright + + cmp lightcount,1 + jnz notendkey + cmp lockstatus,0 + jz numberright + jmp keypadloop + +notendkey: cmp presscount,40 + jnz keypadloop + call addtopresslist + cmp pressed,11 + jnz keypadloop + mov ax,keypadax + mov cx,keypadcx + call isitright + jnz incorrect + mov lockstatus,0 + mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop +incorrect: mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop + +numberright: mov manisoffscreen,0 + call getridoftemp + call restorereels + call redrawmainscrn + call worktoscreenm + ret + +keypadlist: dw keypadx+9,keypadx+30,keypady+9,keypady+22,buttonone + dw keypadx+31,keypadx+52,keypady+9,keypady+22,buttontwo + dw keypadx+53,keypadx+74,keypady+9,keypady+22,buttonthree + dw keypadx+9,keypadx+30,keypady+23,keypady+40,buttonfour + dw keypadx+31,keypadx+52,keypady+23,keypady+40,buttonfive + dw keypadx+53,keypadx+74,keypady+23,keypady+40,buttonsix + dw keypadx+9,keypadx+30,keypady+41,keypady+58,buttonseven + dw keypadx+31,keypadx+52,keypady+41,keypady+58,buttoneight + dw keypadx+53,keypadx+74,keypady+41,keypady+58,buttonnine + dw keypadx+9,keypadx+30,keypady+59,keypady+73,buttonnought + dw keypadx+31,keypadx+74,keypady+59,keypady+73,buttonenter + dw keypadx+72,keypadx+86,keypady+80,keypady+94,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Loadkeypad proc near + + mov dx,offset cs:extragraphics1 + call loadintotemp + ret + + endp + + + + +Quitkey proc near + + cmp commandtype,222 + jz alreadyqk + mov commandtype,222 + mov al,4 + call commandonly +alreadyqk: mov ax,mousebutton + cmp ax,oldbutton + jz notqk + and ax,1 + jnz doqk +notqk: ret + +doqk: mov getback,1 + ret + + endp + + + + + + + + + + + + + + + + + + +Addtopresslist proc near + + cmp presspointer,5 + jz nomorekeys + mov al,pressed + cmp al,10 + jnz not10 + mov al,0 +not10: mov bx,presspointer + mov dx,seg presslist + mov es,dx + add bx,offset es:presslist + mov [es:bx],al + inc presspointer +nomorekeys: ret + + endp + + + + +Buttonone proc near + + mov cl,1 + call buttonpress + ret + + endp + + +Buttontwo proc near + + mov cl,2 + call buttonpress + ret + + endp + + + +Buttonthree proc near + + mov cl,3 + call buttonpress + ret + + endp + + + +Buttonfour proc near + + mov cl,4 + call buttonpress + ret + + endp + + +Buttonfive proc near + + mov cl,5 + call buttonpress + ret + + endp + + + +Buttonsix proc near + + mov cl,6 + call buttonpress + ret + + endp + + +Buttonseven proc near + + mov cl,7 + call buttonpress + ret + + endp + + +Buttoneight proc near + + mov cl,8 + call buttonpress + ret + + endp + +Buttonnine proc near + + mov cl,9 + call buttonpress + ret + + endp + + + +Buttonnought proc near + + mov cl,10 + call buttonpress + ret + + endp + + + + + + +Buttonenter proc near + + mov cl,11 + call buttonpress + ret + + endp + + + +Buttonpress proc near + + mov ch,cl + add ch,100 + cmp commandtype,ch + jz alreadyb + mov commandtype,ch + mov al,cl + add al,4 + push cx + call commandonly + pop cx +alreadyb: mov ax,mousebutton + cmp ax,oldbutton + jz notb + and ax,1 + jnz dob +notb: ret + +dob: mov pressed,cl + add cl,21 + mov graphicpress,cl + mov presscount,40 + cmp cl,32 + jz nonoise + mov al,10 + call playchannel1 +nonoise: ret + + endp + + + + + + + + + + + + + + +Showouterpad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,keypadx+74 + mov bx,keypady+76 + mov ds,tempgraphics + mov al,37 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + +Showkeypad proc near + + mov al,22 + mov di,keypadx+9 + mov bx,keypady+5 + call singlekey + mov al,23 + mov di,keypadx+31 + mov bx,keypady+5 + call singlekey + mov al,24 + mov di,keypadx+53 + mov bx,keypady+5 + call singlekey + + mov al,25 + mov di,keypadx+9 + mov bx,keypady+23 + call singlekey + mov al,26 + mov di,keypadx+31 + mov bx,keypady+23 + call singlekey + mov al,27 + mov di,keypadx+53 + mov bx,keypady+23 + call singlekey + + mov al,28 + mov di,keypadx+9 + mov bx,keypady+41 + call singlekey + mov al,29 + mov di,keypadx+31 + mov bx,keypady+41 + call singlekey + mov al,30 + mov di,keypadx+53 + mov bx,keypady+41 + call singlekey + + mov al,31 + mov di,keypadx+9 + mov bx,keypady+59 + call singlekey + mov al,32 + mov di,keypadx+31 + mov bx,keypady+59 + call singlekey + + cmp lightcount,0 + jz notenter + dec lightcount + mov al,36 + mov bx,keypady-1+63 + cmp lockstatus,0 + jnz changelight + mov al,41 + mov bx,keypady+4+63 +changelight: cmp lightcount,60 + jc gotlight + cmp lightcount,100 + jnc gotlight + dec al +gotlight: mov ds,tempgraphics + mov ah,0 + mov di,keypadx+60 + call showframe + +notenter: ret + + endp + + + + + +Singlekey proc near + + cmp graphicpress,al + jnz gotkey + add al,11 + cmp presscount,8 + jnc gotkey + sub al,11 +; cmp presscount,10 +; jnc gotkey +; sub al,11 +gotkey: mov ds,tempgraphics + sub al,20 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Dumpkeypad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov cl,120 + mov ch,90 + call multidump + ret + + endp + + + + + +;--------------------------------- + + + + +Usemenu proc near + + call getridofreels + call loadmenu + call createpanel + call showpanel + call showicon + mov newobs,0 + call drawfloor + call printsprites + + mov al,4 + mov ah,0 + mov di,menux-48 + mov bx,menuy-4 + mov ds,tempgraphics2 + call showframe + call getundermenu + mov al,5 + mov ah,0 + mov di,menux+54 + mov bx,menuy+72 + mov ds,tempgraphics2 + call showframe + + + call worktoscreenm + mov getback,0 + +menuloop: call delpointer + call putundermenu + call showmenu + call readmouse + call showpointer + call vsync + call dumppointer + call dumpmenu + call dumptextline + mov bx,offset cs:menulist + call checkcoords + cmp getback,1 + jnz menuloop + + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call getridoftemp2 + call restorereels + call worktoscreenm + ret + +menulist: dw menux+54,menux+68,menuy+72,menuy+88,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Dumpmenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + call multidump + ret + + endp + + + + + + +Getundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + + + + + +Putundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + +Showoutermenu proc near + + mov al,40 + mov ah,0 + mov di,menux-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,41 + mov ah,0 + mov di,menux+64-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,42 + mov ah,0 + mov di,menux-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + mov al,43 + mov ah,0 + mov di,menux+64-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + ret + + endp + + + + + + + + +Showmenu proc near + + inc menucount + cmp menucount,37*2 + jnz menuframeok + mov menucount,0 +menuframeok: mov al,menucount + shr al,1 + mov ah,0 + mov di,menux + mov bx,menuy + mov ds,tempgraphics + call showframe + ret + + endp + + + +Loadmenu proc near + + mov dx,offset cs:spritename3 + call loadintotemp + mov dx,offset cs:mongraphics2 + call loadintotemp2 + ret + + endp + + + + + + + + + + + + + + + + +Viewfolder proc near + + mov manisoffscreen,1 + call getridofall + call loadfolder + mov folderpage,0 + call showfolder + call worktoscreenm + mov getback,0 + +folderloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:folderlist + call checkcoords + cmp getback,0 + jz folderloop + + mov manisoffscreen,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + call getridoftempcharset + call restoreall + call redrawmainscrn + call worktoscreenm + ret + +folderlist: dw 280,320,160,200,quitkey + dw 143,300,6,194,nextfolder + dw 0,143,6,194,lastfolder + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + +Nextfolder proc near + + cmp folderpage,12 + jnz cannextf + call blank + ret +cannextf: cmp commandtype,201 + jz alreadynextf + mov commandtype,201 + mov al,16 + call commandonly +alreadynextf: mov ax,mousebutton + cmp ax,oldbutton + jz notnextf + cmp ax,1 + jz donextf +notnextf: ret +donextf: inc folderpage + call folderhints + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + + +Folderhints proc near + + cmp folderpage,5 + jnz notaideadd + cmp aidedead,1 + jz notaideadd + mov al,13 + call getlocation + cmp al,1 + jz notaideadd + mov al,13 + call setlocation + call showfolder + mov al,30 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp + ret + +notaideadd: cmp folderpage,9 + jnz notaristoadd + mov al,7 + call getlocation + cmp al,1 + jz notaristoadd + mov al,7 + call setlocation + call showfolder + mov al,31 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp +notaristoadd: ret + + endp + + + +Lastfolder proc near + + cmp folderpage,0 + jnz canlastf + call blank + ret +canlastf: cmp commandtype,202 + jz alreadylastf + mov commandtype,202 + mov al,17 + call commandonly +alreadylastf: cmp folderpage,0 + jz notlastf + mov ax,mousebutton + cmp ax,oldbutton + jz notlastf + cmp ax,1 + jz dolastf +notlastf: ret +dolastf: dec folderpage + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + +Loadfolder proc near + + mov dx,offset cs:foldergraphic1 + call loadintotemp + mov dx,offset cs:foldergraphic2 + call loadintotemp2 + mov dx,offset cs:foldergraphic3 + call loadintotemp3 + mov dx,offset cs:characterset3 + call loadtempcharset + mov dx,offset cs:foldertext + call loadtemptext + ret + + endp + + + + +Showfolder proc near + + mov commandtype,255 + cmp folderpage,0 + jz closedfolder + call usetempcharset + call createpanel2 + mov ds,tempgraphics + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,0 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,0 + mov bx,92 + mov al,2 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,92 + mov al,3 + mov ah,0 + call showframe + call folderexit + + cmp folderpage,1 + jz noleftpage + call showleftpage +noleftpage: cmp folderpage,12 + jz norightpage + call showrightpage +norightpage: call usecharset1 + call undertextline + ret + +closedfolder: call createpanel2 + mov ds,tempgraphics3 + mov di,143-28 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics3 + mov di,143-28 + mov bx,92 + mov al,1 + mov ah,0 + call showframe + call folderexit + call undertextline + ret + + endp + + + + + + + + +Folderexit proc near + + mov ds,tempgraphics2 + mov di,296 + mov bx,178 + mov al,6 + mov ah,0 + call showframe + ret + + endp + + + + + +Showleftpage proc near + + mov ds,tempgraphics2 + mov di,0 + mov bx,12 + mov al,3 + mov ah,0 + call showframe + + mov bx,12+5 + mov cx,9 +leftpageloop: push cx bx + mov ds,tempgraphics2 + mov di,0 + mov al,4 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop leftpageloop + + mov ds,tempgraphics2 + mov di,0 + mov al,5 + mov ah,0 + call showframe + + mov linespacing,8 + mov charshift,91 + mov kerning,1 + mov bl,folderpage + dec bl + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,2 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsleft: push cx +contleftpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contleftpage + pop cx + loop twolotsleft + + mov kerning,0 + mov charshift,0 + mov linespacing,10 + + mov es,workspace + mov ds,workspace + mov di,(48*320)+2 + mov si,(48*320)+2+130 + mov cx,120 +flipfolder: push cx di si + mov cx,65 +flipfolderline: mov al,[es:di] + mov ah,[es:si] + mov [es:di],ah + mov [es:si],al + dec si + inc di + loop flipfolderline + pop si di cx + add si,320 + add di,320 + loop flipfolder + ret + + endp + + + +Showrightpage proc near + + mov ds,tempgraphics2 + mov di,143 + mov bx,12 + mov al,0 + mov ah,0 + call showframe + + mov bx,12+37 + mov cx,7 +rightpageloop: push cx bx + mov ds,tempgraphics2 + mov di,143 + mov al,1 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop rightpageloop + + mov ds,tempgraphics2 + mov di,143 + mov al,2 + mov ah,0 + call showframe + + mov linespacing,8 + mov kerning,1 + mov bl,folderpage + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,152 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsright: push cx +contrightpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contrightpage + pop cx + loop twolotsright + + mov kerning,0 + mov linespacing,10 + ret + + endp + + + + + + + + + +Entersymbol proc near + + mov manisoffscreen,1 + call getridofreels + mov dx,offset cs:symbolgraphic + call loadintotemp + mov symboltopx,24 + mov symboltopdir,0 + mov symbolbotx,24 + mov symbolbotdir,0 + call redrawmainscrn + call showsymbol + call undertextline + call worktoscreenm + mov getback,0 + +symbolloop: call delpointer + call updatesymboltop + call updatesymbolbot + call showsymbol + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call dumpsymbol + mov bx,offset cs:symbollist + call checkcoords + cmp getback,0 + jz symbolloop + + cmp symbolbotnum,3 + jnz symbolwrong + cmp symboltopnum,5 + jnz symbolwrong + mov al,43 + call removesetobject + mov al,46 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathon + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + mov al,13 + call playchannel1 + ret + +symbolwrong: mov al,46 + call removesetobject + mov al,43 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathoff + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + ret + +symbollist: dw symbolx+40,symbolx+64,symboly+2,symboly+16,quitsymbol + dw symbolx,symbolx+52,symboly+20,symboly+50,settopleft + dw symbolx+52,symbolx+104,symboly+20,symboly+50,settopright + dw symbolx,symbolx+52,symboly+50,symboly+80,setbotleft + dw symbolx+52,symbolx+104,symboly+50,symboly+80,setbotright + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + + + + + +Quitsymbol proc near + + cmp symboltopx,24 + jnz blank + cmp symbolbotx,24 + jnz blank + cmp commandtype,222 + jz alreadyqs + mov commandtype,222 + mov al,18 + call commandonly +alreadyqs: mov ax,mousebutton + cmp ax,oldbutton + jz notqs + and ax,1 + jnz doqs +notqs: ret + +doqs: mov getback,1 + ret + + endp + + + + +Settopleft proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,210 + jz alreadytopl + mov commandtype,210 + mov al,19 + call commandonly +alreadytopl: cmp mousebutton,0 + jz notopleft + mov symboltopdir,-1 +notopleft: ret + + endp + + + +Settopright proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,211 + jz alreadytopr + mov commandtype,211 + mov al,20 + call commandonly +alreadytopr: cmp mousebutton,0 + jz notopright + mov symboltopdir,1 +notopright: ret + + endp + + + + +Setbotleft proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,212 + jz alreadybotl + mov commandtype,212 + mov al,21 + call commandonly +alreadybotl: cmp mousebutton,0 + jz nobotleft + mov symbolbotdir,-1 +nobotleft: ret + + endp + + + +Setbotright proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,213 + jz alreadybotr + mov commandtype,213 + mov al,22 + call commandonly +alreadybotr: cmp mousebutton,0 + jz nobotright + mov symbolbotdir,1 +nobotright: ret + + endp + + + + + + + +Dumpsymbol proc near + + mov newtextline,0 + mov di,symbolx + mov bx,symboly+20 + mov cl,104 + mov ch,60 + call multidump + ret + + endp + + + + +Showsymbol proc near + + mov al,12 + mov ah,0 + mov di,symbolx + mov bx,symboly + mov ds,tempgraphics + call showframe + + mov al,symboltopx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symboltopnum + mov bx,symboly+20 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + + mov al,symbolbotx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symbolbotnum + add al,6 + mov bx,symboly+49 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + ret + + endp + + + + + + +Nextsymbol proc near + + inc al + cmp al,6 + jz topwrap + cmp al,12 + jz botwrap + ret +topwrap: mov al,0 + ret +botwrap: mov al,6 + ret + + endp + + + +Updatesymboltop proc near + + cmp symboltopdir,0 + jz topfinished + cmp symboltopdir,-1 + jz backwards + + inc symboltopx + cmp symboltopx,49 + jnz notwrapfor + mov symboltopx,0 + dec symboltopnum + cmp symboltopnum,-1 + jnz topfinished + mov symboltopnum,5 + ret +notwrapfor: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 + ret + +backwards: dec symboltopx + cmp symboltopx,-1 + jnz notwrapback + mov symboltopx,48 + inc symboltopnum + cmp symboltopnum,6 + jnz topfinished + mov symboltopnum,0 + ret +notwrapback: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 +topfinished: ret + + endp + + + +Updatesymbolbot proc near + + cmp symbolbotdir,0 + jz botfinished + cmp symbolbotdir,-1 + jz backwardsbot + + inc symbolbotx + cmp symbolbotx,49 + jnz notwrapforb + mov symbolbotx,0 + dec symbolbotnum + cmp symbolbotnum,-1 + jnz botfinished + mov symbolbotnum,5 + ret +notwrapforb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 + ret + +backwardsbot: dec symbolbotx + cmp symbolbotx,-1 + jnz notwrapbackb + mov symbolbotx,48 + inc symbolbotnum + cmp symbolbotnum,6 + jnz botfinished + mov symbolbotnum,0 + ret +notwrapbackb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 +botfinished: ret + + endp + + + + + + + + + + +Dumpsymbox proc near + + cmp dumpx,-1 + jz nodumpsym + mov di,dumpx + mov bx,dumpy + mov cl,30 + mov ch,77;30 + call multidump + mov dumpx,-1 +nodumpsym: ret + + endp + + + + + + + +Usediary proc near + + call getridofreels + mov dx,offset cs:diarygraphic + call loadintotemp + mov dx,offset cs:diarytext + call loadtemptext + + mov dx,offset cs:characterset3 + call loadtempcharset + call createpanel + call showicon + call showdiary + call undertextline + call showdiarypage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov getback,0 + +diaryloop: call delpointer + call readmouse + call showdiarykeys + call showpointer + call vsync + call dumppointer + call dumpdiarykeys + call dumptextline + mov bx,offset cs:diarylist + call checkcoords + cmp getback,0 + jz diaryloop + + call getridoftemp + call getridoftemptext + call getridoftempcharset + call restorereels + mov manisoffscreen,0 + call redrawmainscrn + call worktoscreenm + ret + +diarylist: dw diaryx+94,diaryx+110,diaryy+97,diaryy+113,diarykeyn + dw diaryx+151,diaryx+167,diaryy+71,diaryy+87,diarykeyp + dw diaryx+176,diaryx+192,diaryy+108,diaryy+124,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Showdiary proc near + + mov al,1 + mov ah,0 + mov di,diaryx + mov bx,diaryy+37 + mov ds,tempgraphics + call showframe + mov al,2 + mov ah,0 + mov di,diaryx+176 + mov bx,diaryy+108 + mov ds,tempgraphics + call showframe + ret + + endp + + + + +Showdiarykeys proc near + + cmp presscount,0 + jz nokeyatall + dec presscount + cmp presscount,0 + jz nokeyatall + cmp pressed,"N" + jnz nokeyn + mov al,3 + cmp presscount,1 + jz gotkeyn + mov al,4 +gotkeyn: mov ah,0 + mov di,diaryx+94 + mov bx,diaryy+97 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshown + call showdiarypage +notshown: ret + +nokeyn: mov al,5 + cmp presscount,1 + jz gotkeyp + mov al,6 +gotkeyp: mov ah,0 + mov di,diaryx+151 + mov bx,diaryy+71 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshowp + call showdiarypage +notshowp: ret + +nokeyatall: ret + + endp + + + + + + +Dumpdiarykeys proc near + + cmp presscount,1 + jnz notdumpdiary + cmp sartaindead,1 + jz notsartadd + cmp diarypage,5 + jnz notsartadd + cmp diarypage,5 + jnz notsartadd + mov al,6 + call getlocation + cmp al,1 + jz notsartadd + mov al,6 + call setlocation + + call delpointer + mov al,12 + call findtext1 + mov di,70 ;diaryx+48 + mov bx,106 ;diaryy+16 + mov dl,241 + mov ah,16 + call printdirect + + call worktoscreenm + mov cx,200 + call hangonp + call createpanel + call showicon + call showdiary + call showdiarypage + call worktoscreenm + call showpointer + ret + +notsartadd: mov di,diaryx+48 + mov bx,diaryy+15 + mov cl,200 + mov ch,16 + call multidump +notdumpdiary: mov di,diaryx+94 + mov bx,diaryy+97 + mov cl,16 + mov ch,16 + call multidump + mov di,diaryx+151 + mov bx,diaryy+71 + mov cl,16 + mov ch,16 + call multidump + ret + + endp + + + +Diarykeyp proc near + + cmp commandtype,214 + jz alreadykeyp + mov commandtype,214 + mov al,23 + call commandonly +alreadykeyp: cmp mousebutton,0 + jz notkeyp + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyp + cmp presscount,0 + jnz notkeyp + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"P" + dec diarypage + cmp diarypage,-1 + jnz notkeyp + mov diarypage,11 +notkeyp: ret + + endp + + + +Diarykeyn proc near + + cmp commandtype,213 + jz alreadykeyn + mov commandtype,213 + mov al,23 + call commandonly +alreadykeyn: cmp mousebutton,0 + jz notkeyn + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyn + cmp presscount,0 + jnz notkeyn + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"N" + inc diarypage + cmp diarypage,12 + jnz notkeyn + mov diarypage,0 +notkeyn: ret + + endp + + + + + + +Showdiarypage proc near + + mov al,0 + mov ah,0 + mov di,diaryx + mov bx,diaryy + mov ds,tempgraphics + call showframe + + mov al,diarypage + call findtext1 + + mov kerning,1 + call usetempcharset + mov di,diaryx+48 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + mov charshift,91+91 + call printdirect + + mov di,diaryx+129 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + call printdirect + + mov di,diaryx+48 + mov bx,diaryy+23 + mov dl,240 + mov ah,16 + call printdirect + + mov kerning,0 + mov charshift,0 + call usecharset1 + ret + + endp + + + + + +Findtext1 proc near + + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/look.asm b/devtools/tasmrecover/dreamweb/look.asm new file mode 100644 index 0000000000..11ee24beb6 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/look.asm @@ -0,0 +1,167 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------------------Look-routine---- + +Autolook proc near + + mov ax,mousex + cmp ax,oldx + jnz diffmouse + mov ax,mousey + cmp ax,oldy + jnz diffmouse + + dec lookcounter + cmp lookcounter,0 + jnz noautolook + cmp watchingtime,0 + jnz noautolook + call dolook +noautolook: ret + +diffmouse: mov lookcounter,1000 + ret + + endp + + + + +Look proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + + cmp commandtype,241 + jz alreadylook + mov commandtype,241 + mov al,25 + call commandonly +alreadylook: cmp mousebutton,1 + jnz nolook + mov ax,mousebutton + cmp ax,oldbutton + jz nolook + call dolook +nolook: ret + + endp + + + + + +Dolook proc near + + call createpanel + call showicon + call undertextline + call worktoscreenm + + mov commandtype,255 + call dumptextline + + mov bl,roomnum + and bl,31 + mov bh,0 + add bx,bx + + mov es,roomdesc + add bx,intextdat + + mov si,[es:bx] + add si,intext + + call findnextcolon + + mov di,66 + cmp reallocation,50 + jc notdream3 + mov di,40 +notdream3: mov bx,80 + mov dl,241 + call printslow + + cmp al,1 + jz afterlook + mov cx,400 + call hangonp + +afterlook: mov pointermode,0 + mov commandtype,0 + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Redrawmainscrn proc near + + mov timecount,0 + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + call readmouse + mov commandtype,255 + ret + + endp + + + + + + + + + + + + + + + +Getback1 proc near + + cmp pickup,0 + jz notgotobject + call blank + ret + +notgotobject: cmp commandtype,202 + jz alreadyget + mov commandtype,202 + mov al,26 + call commandonly +alreadyget: mov ax,mousebutton + cmp ax,oldbutton + jz nogetback + and ax,1 + jnz dogetback +nogetback: ret + +dogetback: mov getback,1 + mov pickup,0 + ret + + endp + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm new file mode 100644 index 0000000000..65b68cb94c --- /dev/null +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -0,0 +1,1496 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Usemon proc near + + mov lasttrigger,0 + + push cs ;start off with no file name + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + mov al,32 + rep stosb + push cs ;start off with no file name + pop es + mov di,offset cs:operand1+1 + mov cx,12 + mov al,32 + rep stosb + + push cs ;clear all keys + pop es + mov di,offset cs:keys + mov byte ptr [es:di],1 + add di,26 + mov cx,3 +keyloop: mov byte ptr [es:di],0 + add di,26 + loop keyloop + + call createpanel + call showpanel + call showicon + call drawfloor + call getridofall ;reels + + mov dx,offset cs:mongraphicname + call loadintotemp + call loadpersonal + call loadnews + call loadcart + mov dx,offset cs:characterset2 + call loadtempcharset + + call printoutermon + call initialmoncols + call printlogo + call worktoscreen + call turnonpower + call fadeupyellows + call fadeupmonfirst + + mov monadx,76 + mov monady,141 + mov al,1 + call monmessage + mov cx,120 + call hangoncurs + mov al,2 + call monmessage + mov cx,60 + call randomaccess + mov al,3 + call monmessage + mov cx,100 + call hangoncurs + call printlogo + call scrollmonitor + mov bufferin,0 + mov bufferout,0 + +moreinput: mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + call execcommand + cmp al,0 + jz moreinput + +endmon: call getridoftemp + call getridoftempcharset + mov es,textfile1 + call deallocatemem + mov es,textfile2 + call deallocatemem + mov es,textfile3 + call deallocatemem + mov getback,1 + mov al,26 + call playchannel1 + mov manisoffscreen,0 + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Printoutermon proc near + + mov di,40 + mov bx,32 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,264 + mov bx,32 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + mov di,40 + mov bx,12 + mov ds,tempgraphics + mov al,3 + mov ah,0 + call showframe + mov di,40 + mov bx,164 + mov ds,tempgraphics + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Loadpersonal proc near + + mov al,location + mov dx,offset cs:monitorfile1 + cmp al,0 + jz foundpersonal + cmp al,42 + jz foundpersonal + mov dx,offset cs:monitorfile2 + cmp al,2 + jz foundpersonal + +foundpersonal: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile1,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + +Loadnews proc near ;textfile2 holds information + ;accessable by anyone + mov al,newsitem + mov dx,offset cs:monitorfile10 + cmp al,0 + jz foundnews + mov dx,offset cs:monitorfile11 + cmp al,1 + jz foundnews + mov dx,offset cs:monitorfile12 + cmp al,2 + jz foundnews + mov dx,offset cs:monitorfile13 +foundnews: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile2,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Loadcart proc near + + call lookininterface + + mov dx,offset cs:monitorfile20 + cmp al,0 + jz gotcart + mov dx,offset cs:monitorfile21 + cmp al,1 + jz gotcart + mov dx,offset cs:monitorfile22 + cmp al,2 + jz gotcart + mov dx,offset cs:monitorfile23 + cmp al,3 + jz gotcart + mov dx,offset cs:monitorfile24 +gotcart: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile3,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Lookininterface proc near + + mov al,"I" + mov ah,"N" + mov cl,"T" + mov ch,"F" + call findsetobject ;this bit searches set obs + ;until the interface is found + ;al holds object number + mov ah,1 ;ah holds type, 1=set object + call checkinside ;this searches for any extra + ;object inside the interface.. + cmp cl,numexobjects + jz emptyinterface + mov al,[es:bx+15] ;get the last letter of ID code + inc al + ret +emptyinterface: mov al,0 + ret + + endp + + + + + + + +Turnonpower proc near + + mov cx,3 +powerloop: push cx + call powerlighton + mov cx,30 + call hangon + call powerlightoff + mov cx,30 + call hangon + pop cx + loop powerloop + call powerlighton + ret + + endp + + + + + +Randomaccess proc near + +accessloop: push cx + call vsync + call vsync + call randomnum1 + and al,15 + cmp al,10 + jc off + call accesslighton + jmp chosenaccess +off: call accesslightoff +chosenaccess: pop cx + loop accessloop + call accesslightoff + ret + + endp + + + +Powerlighton proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,6 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Powerlightoff proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,5 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslighton proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,8 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslightoff proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,7 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + +Locklighton proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,10 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Locklightoff proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,9 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + + + + + + +Input proc near + + push cs + pop es + mov di,offset cs:inputline + mov cx,64 + mov al,0 + rep stosb + + mov curpos,0 + mov al,">" + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + mov di,monadx + mov bx,monady + mov cl,6 + mov ch,8 + call multidump + add monadx,6 + mov ax,monadx + mov curslocx,ax + mov ax,monady + mov curslocy,ax + +waitkey: call printcurs + call vsync + call delcurs + call readkey + mov al,currentkey + cmp al,0 + jz waitkey + cmp al,13 + jz endofinput + cmp al,8 + jnz notdel + cmp curpos,0 + jz waitkey + call delchar + jmp waitkey +notdel: cmp curpos,28 + jz waitkey + cmp currentkey,32 + jnz notleadingspace + cmp curpos,0 + jz waitkey +notleadingspace: call makecaps + push cs + pop es + mov si,curpos + add si,si + add si,offset cs:inputline + mov [es:si],al + + cmp al,"Z"+1 + jnc waitkey + + push ax es si + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiget + pop si es ax + + push es si + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + pop si es + ;dec cx + mov [es:si+1],cl + mov ch,0 + add monadx,cx + inc curpos + add curslocx,cx + jmp waitkey + +endofinput: ret + + endp + + + + + + + + +Makecaps proc near + + cmp al,"a" + jc notupperc + sub al,32 +notupperc: ret + + endp + + + + + + + + + +Delchar proc near + + dec curpos + mov si,curpos + add si,si + push cs + pop es + add si,offset cs:inputline + mov byte ptr [es:si],0 + mov al,[es:si+1] + mov ah,0 + sub monadx,ax + sub curslocx,ax + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiput + mov di,monadx + mov bx,monady + mov cl,al + mov ch,8 + call multidump + ret + + endp + + + + + + + +Execcommand proc near + + push cs + pop es + mov bx,offset cs:comlist + push cs + pop ds + mov si,offset cs:inputline + mov al,[si] + cmp al,0 + jnz notblankinp + call scrollmonitor + ret + +notblankinp: mov cl,0 +comloop: push bx si +comloop2: mov al,[si] + add si,2 + mov ah,[es:bx] + inc bx + cmp ah,32 + jz foundcom + cmp al,ah + jz comloop2 + pop si bx + add bx,10 + inc cl + cmp cl,6 + jnz comloop + call neterror + mov al,0 + ret +foundcom: pop si bx + cmp cl,1 + jz testcom + cmp cl,2 + jz directory + cmp cl,3 + jz accesscom + cmp cl,4 + jz signoncom + cmp cl,5 + jz keyscom + jmp quitcom + +directory: call dircom + mov al,0 + ret + +signoncom: call signon + mov al,0 + ret + +accesscom: call read + mov al,0 + ret + +keyscom: call showkeys + mov al,0 + ret + +testcom: mov al,6 + call monmessage + mov al,0 + ret + +quitcom: mov al,1 + ret + +comlist: db "EXIT " + db "HELP " + db "LIST " + db "READ " + db "LOGON " + db "KEYS " + +keys: db 1,0,"PUBLIC PUBLIC ",0 + db 0,0,"BLACKDRAGON RYAN ",0 + db 0,0,"HENDRIX LOUIS ",0 + db 0,0,"SEPTIMUS BECKETT ",0 + db 255,255 + +operand1: db " ",0 +rootdir: db 34,"ROOT ",0 +currentfile db 34," ",0 + + endp + + + + + + + +Neterror proc near + + mov al,5 + call monmessage + call scrollmonitor + ret + + endp + + + + + + + + + +Dircom proc near + + mov cx,30 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jz dirroot + call dirfile + ret + +dirroot: mov logonum,0 + push cs + pop ds + mov si,offset cs:rootdir + inc si + push cs + pop es + mov di,offset cs:currentfile + inc di + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + + mov al,9 + call monmessage + + mov es,textfile1 + call searchforfiles + mov es,textfile2 + call searchforfiles + mov es,textfile3 + call searchforfiles + + call scrollmonitor + ret + + endp + + + + + + +Searchforfiles proc near + + mov bx,textstart +directloop1: mov al,[es:bx] + inc bx + cmp al,"*" + jz endofdir + cmp al,34 + jnz directloop1 + call monprint + jmp directloop1 +endofdir: ret + + endp + + + + + + + + + + + + +Signon proc near + + call parser + inc di + push cs + pop ds + mov si,offset cs:keys + mov cx,4 +signonloop: push cx si di + add si,14 + mov cx,11 +signonloop2: lodsb + cmp al,32 + jz foundsign + call makecaps + mov ah,[es:di] + inc di + cmp al,ah + jnz nomatch + loop signonloop2 +nomatch: pop di si cx + add si,26 + loop signonloop + mov al,13 + call monmessage + ret + +foundsign: pop di si cx ;ds:si contains ad of key matched + mov bx,si + push ds + pop es ;now ds:si is in es:bx + + cmp byte ptr [es:bx],0 + jz notyetassigned + + mov al,17 + call monmessage + ret + +notyetassigned: push es bx + call scrollmonitor + mov al,15 + call monmessage + mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + pop bx es + push es bx + + add bx,2 + push cs + pop ds + mov si,offset cs:inputline +checkpass: lodsw + mov ah,[es:bx] + inc bx + ;cmp al,0 + cmp ah,32 + jz passpassed + cmp al,ah + jz checkpass +passerror: pop bx es + call scrollmonitor + mov al,16 + call monmessage + ret + +passpassed: mov al,14 + call monmessage + pop bx es + push es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov byte ptr [es:bx],1 + ret + + endp + + + + + + + +Showkeys proc near + + mov cx,10 + call randomaccess + call scrollmonitor + mov al,18 + call monmessage + + push cs + pop es + mov bx,offset cs:keys + mov cx,4 +keysloop: push cx bx + cmp byte ptr [es:bx],0 + jz notheld + add bx,14 + call monprint +notheld: pop bx cx + add bx,26 + loop keysloop + call scrollmonitor + ret + + endp + + + + + + + + + + + +Read proc near + + mov cx,40 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jnz okcom + call neterror + ret +okcom: push cs + pop es + mov di,offset cs:currentfile + mov ax,textfile1 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile2 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile3 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov al,7 + call monmessage + ret +foundfile2: call getkeyandlogo + cmp al,0 + jz keyok1 + ret +keyok1: push cs + pop es + mov di,offset cs:operand1 + mov ds,monsource + call searchforstring + cmp al,0 + jz findtopictext + mov al,oldlogonum + mov logonum,al + mov al,11 + call monmessage + ret + +findtopictext: inc bx + push es bx + call monitorlogo + call scrollmonitor + pop bx es +moretopic: call monprint + mov al,[es:bx] + cmp al,34 + jz endoftopic + cmp al,"=" + jz endoftopic + cmp al,"*" + jz endoftopic + push es bx + call processtrigger + mov cx,24 + call randomaccess + pop bx es + jmp moretopic + +endoftopic: call scrollmonitor + ret + + endp + + + + + + + + + +Dirfile proc near + + mov al,34 + mov [es:di],al + push es di ;save start point held in es:di + mov ds,textfile1 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile2 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile3 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + + pop di es + mov al,7 + call monmessage + ret + +foundfile: pop ax ax ;discard old values of es:di + call getkeyandlogo + cmp al,0 + jz keyok2 + ret + +keyok2: push es bx + push cs + pop ds + mov si,offset cs:operand1+1 + push cs + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + mov al,10 + call monmessage + pop bx es + + +directloop2: mov al,[es:bx] + inc bx + cmp al,34 + jz endofdir2 + cmp al,"*" + jz endofdir2 + cmp al,"=" + jnz directloop2 + call monprint + jmp directloop2 + +endofdir2: call scrollmonitor + ret + + endp + + + + + + +Getkeyandlogo proc near + + inc bx + mov al,[es:bx] + sub al,48 + mov newlogonum,al + add bx,2 + mov al,[es:bx] + sub al,48 + mov keynum,al + inc bx + push es bx + mov al,keynum + mov ah,0 + mov cx,26 + mul cx + push cs + pop es + mov bx,offset cs:keys + add bx,ax + mov al,[es:bx] + cmp al,1 + jz keyok + push bx es + mov al,12 + call monmessage + pop es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov al,1 + ret + +keyok: pop bx es + mov al,newlogonum + mov logonum,al + mov al,0 + ret + + endp + + + + + + + + + +Searchforstring proc near ;finds string at es:di in + ;text at ds:si + + mov dl,[es:di] ;needs to know first character + ;if it's an equals then we must + ;stop at the next quotation mark + mov cx,di ;need to remember starting point + +restartlook: mov di,cx + mov bx,si + + mov dh,0 ;dh holds count of brackets + ;brackets are either " or = +keeplooking: lodsb + call makecaps + cmp al,"*" + jz notfound + cmp dl,"=" + jnz nofindingtopic ;are we looking for a topic? + cmp al,34 ;if YES, check we haven't reached + jz notfound ;the end of this file. +nofindingtopic: mov ah,[es:di] + cmp al,dl ;all searches bracketed by same thing + jnz notbracket + inc dh + cmp dh,2 + jz complete +notbracket: cmp al,ah + jnz restartlook + inc di + jmp keeplooking +complete: push ds ;es:bx returns found string + pop es + mov al,0 + mov bx,si + ret +notfound: mov al,1 + ret + + endp + + + + + + +Parser proc near + + push cs + pop es + mov di,offset cs:operand1 + mov cx,13 + mov al,0 + rep stosb + + mov di,offset cs:operand1 + mov al,"=" + stosb + + push cs + pop ds + mov si,offset cs:inputline + +notspace1: lodsw + cmp al,32 + jz stillspace1 + cmp al,0 + jnz notspace1 + jmp finishpars + +stillspace1: lodsw + cmp al,32 + jz stillspace1 + +copyin1: stosb + lodsw + cmp al,0 + jz finishpars + cmp al,32 + jnz copyin1 + +finishpars: mov di,offset cs:operand1 + ret + + endp + + + + + + +Scrollmonitor proc near + + push ax bx cx dx di si es ds + + call printlogo + mov di,monadx + mov bx,monady + call printundermon + mov ax,monady + call worktoscreen + mov al,25 + call playchannel1 + + pop ds es si di dx cx bx ax + ret + + endp + + + + + + + + + + + + + + +Lockmon proc near + + cmp lasthardkey,57 + jnz notlock + call locklighton +lockloop: cmp lasthardkey,57 + jz lockloop + call locklightoff +notlock: ret + + endp + + + + + +Monitorlogo proc near + + mov al,logonum + cmp al,oldlogonum + jz notnewlogo + mov oldlogonum,al + ;call fadedownmon + call printlogo + call printundermon + call worktoscreen + call printlogo + ;call fadeupmon + call printlogo + mov al,26 + call playchannel1 + mov cx,20 + call randomaccess + ret +notnewlogo: call printlogo + ret + + endp + + + + + + + + +Printlogo proc near + + mov di,56 + mov bx,32 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + call showcurrentfile + ret + + endp + + + + + + +Showcurrentfile proc near + + mov di,178 ;99 + mov bx,37 + mov si,offset cs:currentfile+1 +curfileloop: mov al,[cs:si] + cmp al,0 + jz finishfile + inc si + push si + if foreign + call modifychar + endif + mov ds,tempcharset + mov ah,0 + call printchar + pop si + jmp curfileloop +finishfile: ret + + endp + + + + + + + + + +Monmessage proc near + + mov es,textfile1 + mov bx,textstart + mov cl,al + mov ch,0 +monmessageloop: mov al,[es:bx] + inc bx + cmp al,"+" + jnz monmessageloop + loop monmessageloop + call monprint + ret + + endp + + + + + + +Processtrigger proc near + + cmp lasttrigger,"1" + jnz notfirsttrigger + mov al,8 + call setlocation + mov al,45 + call triggermessage + ret + +notfirsttrigger: cmp lasttrigger,"2" + jnz notsecondtrigger + mov al,9 + call setlocation + mov al,55 + call triggermessage + ret + +notsecondtrigger: cmp lasttrigger,"3" + jnz notthirdtrigger + mov al,2 + call setlocation + mov al,59 + call triggermessage + +notthirdtrigger: ret + + endp + + + + +Triggermessage proc near + + push ax + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiget + pop ax + call findpuztext + mov di,174 + mov bx,156 + mov dl,141 + mov ah,16 + call printdirect + mov cx,140 + call hangon + call worktoscreen + mov cx,340 + call hangon + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiput + call worktoscreen + mov lasttrigger,0 + ret + + endp + + + + + + +Printcurs proc near + + push si di ds dx bx es + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + mov ds,buffers + mov si,textunder + push di bx + call multiget + pop bx di + + push bx di + inc maintimer + mov ax,maintimer + and al,16 + jnz flashcurs + mov al,"/" + sub al,32 + mov ah,0 + mov ds,tempcharset + call showframe + +flashcurs: pop di bx + sub di,6 + mov cl,12 + if foreign + mov ch,11 + else + mov ch,8 + endif + call multidump + + pop es bx dx ds di si + ret + + endp + + + + + + +Delcurs proc near + + push es bx di ds dx si + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + push di bx cx + mov ds,buffers + mov si,textunder + call multiput + pop cx bx di + call multidump +finishcurdel: + pop si dx ds di bx es + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm new file mode 100644 index 0000000000..8a1e97367c --- /dev/null +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -0,0 +1,581 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;----------------------------------------------------Choosing a new location---- + +Newplace proc near + + cmp needtotravel,1 + jz istravel + cmp autolocation,-1 + jnz isautoloc + ret + +isautoloc: mov al,autolocation + mov newlocation,al + mov autolocation,-1 + ret + +istravel: mov needtotravel,0 + call selectlocation + ret + + endp + + + + +Selectlocation proc near + + mov inmaparea,0 + call clearbeforeload + mov getback,0 + mov pointerframe,22 + + call readcitypic + call showcity + call getridoftemp + call readdesticon + call loadtraveltext + call showpanel + call showman + call showarrows + call showexit + call locationpic + call undertextline + mov commandtype,255 + call readmouse + mov pointerframe,0 + call showpointer + call worktoscreen + mov al,9 + mov ah,255 + call playchannel0 + mov newlocation,255 + +select: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + cmp getback,1 + jz quittravel + mov bx,offset cs:destlist + call checkcoords + cmp newlocation,255 + jz select + mov al,newlocation + cmp al,location + jz quittravel + + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +quittravel: mov al,reallocation ; was just location + mov newlocation,al + mov getback,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +destlist: dw 238,258,4,44,nextdest + dw 104,124,4,44,lastdest + dw 280,308,4,44,lookatplace + dw 104,216,138,192,destselect + dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Showcity proc near + + call clearwork + mov ds,tempgraphics + mov di,57 + mov bx,32 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,120+57 + mov bx,32 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + +Lookatplace proc near + + cmp commandtype,224 + jz alreadyinfo + mov commandtype,224 + mov al,27 + call commandonly +alreadyinfo: mov ax,mousebutton + and ax,1 + jz noinfo + cmp ax,oldbutton + jz noinfo + + mov bl,destpos + cmp bl,15 + jnc noinfo + + push bx + call delpointer + call deltextline + call getundercentre + mov ds,tempgraphics3 + mov al,0 + mov ah,0 + mov di,60 + mov bx,72 + call showframe + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55 + call showframe + if foreign + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55+21 + call showframe + endif + pop bx + + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + call findnextcolon + + mov di,63 + if foreign + mov bx,84+4 + else + mov bx,84 + endif + mov dl,191 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,500 + call hangonp + +afterinfo: mov pointermode,0 + mov pointerframe,0 + call putundercentre + call worktoscreenm + +noinfo: ret + + endp + + + + +Getundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiget + ret + + endp + + + + + + + + + + +Putundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiput + ret + + endp + + + + + + + +Locationpic proc near + + call getdestinfo + mov al,[es:si] + push es si + mov di,0 + cmp al,6 + jnc secondlot + mov ds,tempgraphics + add al,4 + jmp gotgraphic +secondlot: sub al,6 + mov ds,tempgraphics2 +gotgraphic: add di,104 + mov bx,138+14 + mov ah,0 + call showframe + pop si es + mov al,destpos + cmp al,reallocation + jnz notinthisone + mov al,3 + mov di,104 + mov bx,140+14 + mov ds,tempgraphics + mov ah,0 + call showframe +notinthisone: mov bl,destpos + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + mov di,50 + mov bx,20 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + +Getdestinfo proc near + + mov al,destpos + mov ah,0 + push ax + mov dx,seg roomscango + mov es,dx + mov si,offset es:roomscango + add si,ax + mov cl,[es:si] + pop ax + push cx + mov dx,seg roompics + mov es,dx + mov si,offset es:roompics + add si,ax + pop ax + ret + + endp + + + + + + +Showarrows proc near + + mov di,116-12 + mov bx,16 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + mov di,226+12 + mov bx,16 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,280 + mov bx,14 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Nextdest proc near + +duok: cmp commandtype,218 + jz alreadydu + mov commandtype,218 + mov al,28 + call commandonly +alreadydu: mov ax,mousebutton + and ax,1 + jz nodu + cmp ax,oldbutton + jz nodu + +searchdestup: inc destpos + cmp destpos,15 + jnz notlastdest + mov destpos,0 +notlastdest: call getdestinfo + cmp al,0 + jz searchdestup + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodu: ret + + endp + + + + + + + +Lastdest proc near + +ddok: cmp commandtype,219 + jz alreadydd + mov commandtype,219 + mov al,29 + call commandonly +alreadydd: mov ax,mousebutton + and ax,1 + jz nodd + cmp ax,oldbutton + jz nodd + +searchdestdown: dec destpos + cmp destpos,-1 + jnz notfirstdest + mov destpos,15 +notfirstdest: call getdestinfo + cmp al,0 + jz searchdestdown + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodd: ret + + endp + + + + + + + + +Destselect proc near + + cmp commandtype,222 + jz alreadytrav + mov commandtype,222 + mov al,30 + call commandonly +alreadytrav: mov ax,mousebutton + and ax,1 + jz notrav + cmp ax,oldbutton + jz notrav + + call getdestinfo + mov al,destpos + mov newlocation,al +notrav: ret + + endp + + + + + + + + + + + + + + + + + + + +Getlocation proc near + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov al,[es:bx] + ret + + endp + + +Setlocation proc near ;makes a location accessable + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],1 + ret + + endp + + + + +Resetlocation proc near ;makes a location inaccessable + + push ax + cmp al,5 + jnz notdelhotel + call purgealocation + mov al,21 + call purgealocation + mov al,22 + call purgealocation + mov al,27 + call purgealocation + jmp clearedlocations + +notdelhotel: cmp al,8 + jnz notdeltvstud + call purgealocation + mov al,28 + call purgealocation + jmp clearedlocations + +notdeltvstud: cmp al,6 + jnz notdelsarters + call purgealocation + mov al,20 + call purgealocation + mov al,25 + call purgealocation + jmp clearedlocations + +notdelsarters: cmp al,13 + jnz notdelboathouse + call purgealocation + mov al,29 + call purgealocation + jmp clearedlocations + +notdelboathouse: + +clearedlocations: pop ax + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],0 + ret + + endp + + + + +Readdesticon proc near + + mov dx,offset cs:travelgraphic1 + call loadintotemp + + mov dx,offset cs:travelgraphic2 + call loadintotemp2 + + mov dx,offset cs:icongraphics8 + call loadintotemp3 + ret + + endp + + + + +Readcitypic proc near + + mov dx,offset cs:cityname + call loadintotemp + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm new file mode 100644 index 0000000000..19265bb4ac --- /dev/null +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -0,0 +1,2608 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------------Inventory printer---- + +Fillryan proc near + ; cx=what to search for + mov es,buffers + mov di,ryaninvlist + call findallryan + mov si,ryaninvlist + mov al,ryanpage + mov ah,0 + mov cx,20 + mul cx + add si,ax + + mov di,inventx + mov bx,inventy + + mov cx,2 +ryanloop2: push cx di bx + mov cx,5 +ryanloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + call obtoinv + pop es si + pop bx di cx + add di,itempicsize + loop ryanloop1 + pop bx di cx + add bx,itempicsize + loop ryanloop2 + + call showryanpage + ret + + endp + + + + + + + + + + + +Fillopen proc near + + call deltextline + + call getopenedsize ;find out how many slots + cmp ah,4 ;ah=slots, al=size holdable + jc lessthanapage + mov ah,4 +lessthanapage: mov al,1 + + push ax + mov es,buffers + mov di,openinvlist + call findallopen + mov si,openinvlist + mov di,inventx + mov bx,inventy+96 + pop cx + +openloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + cmp ch,cl + jc nextopenslot + call obtoinv +nextopenslot: pop es si + pop bx di cx + add di,itempicsize + inc cl + cmp cl,5 + jnz openloop1 + + call undertextline + ret + + endp + + + + + + + + + + + + + + + + +Findallryan proc near + + push di + mov cx,30 + mov ax,0ffffh + rep stosw + pop di + + mov cl,4 + mov ds,extras + mov bx,exdata + mov ch,0 +findryanloop: cmp [bx+2],cl + jnz notinryaninv + cmp byte ptr [bx+3],255 + jnz notinryaninv + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 ;means it is an exchanged object ie:not free or set + stosw + pop di +notinryaninv: add bx,16 + inc ch + cmp ch,numexobjects + jnz findryanloop + ret + + endp + + + + + + + +Findallopen proc near + + push di + mov cx,16 + mov ax,0ffffh + rep stosw + pop di + + mov cl,openedob + mov dl,openedtype + mov ds,extras + mov bx,exdata + mov ch,0 +findopen1: cmp [bx+3],cl + jnz findopen2 + cmp [bx+2],dl + jnz findopen2 + cmp openedtype,4 + jz noloccheck + mov al,[bx+5] + cmp al,reallocation + jnz findopen2 +noloccheck: mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 + stosw + pop di +findopen2: add bx,16 + inc ch + cmp ch,numexobjects + jnz findopen1 + + mov cl,openedob + mov dl,openedtype + push dx + mov ds,freedat + pop dx + mov bx,0 + mov ch,0 +findopen1a: cmp [bx+3],cl + jnz findopen2a + cmp [bx+2],dl + jnz findopen2a + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,2 ; means it's in a free ob + stosw + pop di +findopen2a: add bx,16 + inc ch + cmp ch,80 + jnz findopen1a + ret + + endp + + + + + + +Obtoinv proc near + + push bx es si ax + + push ax di bx + mov ds,icons1 + sub di,2 + sub bx,1 + mov al,10 + mov ah,0 + call showframe + pop bx di ax + cmp al,255 + jz finishfill + + push bx di ax + mov ds,extras + cmp ah,4 + jz isanextra + mov ds,freeframes +isanextra: mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + add bx,19 + add di,18 + call showframe + pop ax di bx + + push bx + call getanyaddir + call isitworn + pop bx + jnz finishfill + mov ds,icons1 ;Print wearing logo + sub di,3 + sub bx,2 + mov al,7 + mov ah,0 + call showframe + +finishfill: pop ax si es bx + ret + + endp + + + + + +Isitworn proc near ;zero if yes + + mov al,[es:bx+12] + cmp al,"W"-"A" + jnz notworn + mov al,[es:bx+13] + cmp al,"E"-"A" +notworn: ret + + endp + + + +Makeworn proc near + + mov byte ptr [es:bx+12],"W"-"A" + mov byte ptr [es:bx+13],"E"-"A" + ret + + endp + + + + + + +;-------------------------------------------------------Examining an object---- + +Examineob proc near + + mov pointermode,0 + mov timecount,0 + +examineagain: mov inmaparea,0 + mov examagain,0 + mov openedob,255 + mov openedtype,255 + mov invopen,0 + mov al,commandtype + mov objecttype,al + mov itemframe,0 + mov pointerframe,0 + + call createpanel + call showpanel + call showman + call showexit + call obicons + call obpicture + call describeob + call undertextline + + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + +waitexam: ;call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + + mov getback,0 + mov bx,offset cs:examlist + cmp invopen,0 + jz notuseinv + mov bx,offset cs:invlist1 + cmp invopen,1 + jz notuseinv + mov bx,offset cs:withlist1 +notuseinv: call checkcoords + cmp examagain,0 + jz norex + jmp examineagain +norex: cmp getback,0 + jz waitexam + + mov pickup,0 + cmp watchingtime,0 + jnz iswatching + cmp newlocation,255 + jnz justgetback + +iswatching: call makemainscreen + mov invopen,0 + mov openedob,255 + ret + +justgetback: mov invopen,0 + mov openedob,255 + ret + +examlist: dw 273,320,157,198,getbackfromob + dw 260,300,0,44,useobject + dw 210,254,0,44,selectopenob + dw 144,176,64,96,setpickup + dw 0,50,50,200,examinventory + dw 0,320,0,200,blank + dw 0ffffh + +invlist1: dw 273,320,157,198,getbackfromob + dw 255,294,0,24,dropobject + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx +openchangesize: dw inventx+(4*itempicsize) + dw inventy+100,inventy+100+itempicsize,useopened + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),intoinv + dw 0,320,0,200,blank + dw 0ffffh + +withlist1: dw 273,320,157,198,getbackfromob + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),selectob + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Makemainscreen proc near + + call createpanel + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov commandtype,255 + call animpointer + call worktoscreenm + mov commandtype,200 + mov manisoffscreen,0 + ret + + endp + + + + +Getbackfromob proc near + + cmp pickup,1 + jnz notheldob + call blank + ret +notheldob: call getback1 + ret + + endp + + + + + + + + + + + + + + + + +Incryanpage proc near + + cmp commandtype,222 + jz alreadyincryan + mov commandtype,222 + mov al,31 + call commandonly +alreadyincryan: mov ax,mousebutton + cmp ax,oldbutton + jz noincryan + and ax,1 + jnz doincryan +noincryan: ret + +doincryan: mov ax,mousex + sub ax,inventx+167 + mov ryanpage,-1 +findnewpage: inc ryanpage + sub ax,18 + jnc findnewpage + call delpointer + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Openinv proc near + + mov invopen,1 + mov al,61 + mov di,inventx + mov bx,inventy-10 + mov dl,240 + call printmessage + call fillryan + mov commandtype,255 + ret + + endp + + + + + + + +Showryanpage proc near + + mov ds,icons1 + mov di,inventx+167 + mov bx,inventy-12 + mov al,12 + mov ah,0 + call showframe + + mov al,13 + add al,ryanpage + push ax + mov al,ryanpage + mov ah,0 + mov cx,18 + mul cx + mov ds,icons1 + mov di,inventx+167 + add di,ax + mov bx,inventy-12 + pop ax + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Openob proc near + + mov al,openedob + mov ah,openedtype + mov di,offset cs:commandline + call copyname + + mov di,inventx + mov bx,inventy+86 + mov al,62 + mov dl,240 + call printmessage + + mov di,lastxpos + add di,5 + mov bx,inventy+86 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + call fillopen + call getopenedsize + mov al,ah + mov ah,0 + mov cx,itempicsize + mul cx + add ax,inventx + mov bx,offset cs:openchangesize + mov [cs:bx],ax + ret + + endp + + + + + + +Obicons proc near + + mov al,command + call getanyad + cmp al,255 + jz cantopenit + + mov ds,icons2 + mov di,210 + mov bx,1 + mov al,4 + mov ah,0 + call showframe + +cantopenit: mov ds,icons2 + mov di,260 + mov bx,1 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Examicon proc near + + mov ds,icons2 + mov di,254 + mov bx,5 + mov al,3 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Obpicture proc near + + mov al,command + mov ah,objecttype + cmp ah,1 + jz setframe + cmp ah,4 + jz exframe + + mov ds,freeframes + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + +setframe: ret + +exframe: mov ds,extras + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + + endp + + + + + + + + + + +Describeob proc near + + call getobtextstart + + mov di,33 + mov bx,92 + if foreign + cmp objecttype,1 + jnz notsetd + mov bx,82 +notsetd: endif + mov dl,241 + mov ah,16 + mov charshift,91+91 + call printdirect + mov charshift,0 + mov di,36 + mov bx,104 + if foreign + cmp objecttype,1 + jnz notsetd2 + mov bx,94 +notsetd2: endif + mov dl,241 + mov ah,0 + call printdirect + push bx + call obsthatdothings + pop bx + call additionaltext + ret + + + endp + + + + + +Additionaltext proc near + + add bx,10 + push bx + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz emptycup + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz fullcup + pop bx + ret +emptycup: mov al,40 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret +fullcup: mov al,39 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + + + +Obsthatdothings proc near + + mov al,command + mov ah,objecttype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jnz notlouiscard + mov al,4 + call getlocation + cmp al,1 + jz seencard + mov al,4 + call setlocation + call lookatcard +seencard: ret +notlouiscard: ret + + endp + + + + + + + +Getobtextstart proc near + + mov es,freedesc + mov si,freetextdat + mov cx,freetext + cmp objecttype,2 + jz describe + mov es,setdesc + mov si,settextdat + mov cx,settext + cmp objecttype,1 + jz describe + mov es,extras + mov si,extextdat + mov cx,extext + +describe: mov al,command + mov ah,0 + add ax,ax + add si,ax + mov ax,[es:si] + add ax,cx + mov si,ax + mov bx,ax +tryagain: push si + call findnextcolon + mov al,[es:si] + mov cx,si + pop si + cmp objecttype,1 + jnz cantmakeoneup + cmp al,0 + jz findsometext + cmp al,":" + jz findsometext +cantmakeoneup: ret + +findsometext: call searchforsame + jmp tryagain + ret + + endp + + + + + + +Searchforsame proc near + + mov si,cx +searchagain: inc si + mov al,[es:bx] +search: cmp [es:si],al + jz gotstartletter + inc cx + inc si + cmp si,8000 ;arbitrary give-up + jc search ;counter. + mov si,bx + pop ax + ret + +gotstartletter: push bx si +keepchecking: inc si + inc bx + mov al,[es:bx] + mov ah,[es:si] + cmp al,":" + jz foundmatch + cmp al,0 + jz foundmatch + cmp al,ah + jz keepchecking + pop si bx + jmp searchagain + +foundmatch: pop si bx + ret + + endp + + + + + + + +;-----------------------------------------------------------Using an object---- + + + + + +Findnextcolon proc near + +isntcolon: mov al,[es:si] + inc si + cmp al,0 + jz endofcolon + cmp al,":" + jnz isntcolon +endofcolon: ret + + endp + + +;------------------------------------------------------Taking, dropping etc---- + + + + + + +Inventory proc near + + cmp mandead,1 + jz iswatchinv + cmp watchingtime,0 + jz notwatchinv +iswatchinv: call blank + ret +notwatchinv: cmp commandtype,239 + jz alreadyopinv + mov commandtype,239 + mov al,32 + call commandonly +alreadyopinv: mov ax,mousebutton + cmp ax,oldbutton + jz cantopinv + and ax,1 + jnz doopeninv +cantopinv: ret + +doopeninv: mov timecount,0 + mov pointermode,0 + mov inmaparea,0 + call animpointer + call createpanel + call showpanel + call examicon + call showman + call showexit + call undertextline + mov pickup,0 + mov invopen,2 + call openinv + call readmouse + call showpointer + call worktoscreen + call delpointer + mov openedob,255 + jmp waitexam ; very naughty! + + endp + + + + + + +Setpickup proc near + + cmp objecttype,1 + jz cantpick + cmp objecttype,3 + jz cantpick + call getanyad + mov al,[es:bx+2] + cmp al,4 + jnz canpick +cantpick: call blank + ret + +canpick: cmp commandtype,209 + jz alreadysp + mov commandtype,209 + + mov bl,command + mov bh,objecttype + mov al,33 + call commandwithob +alreadysp: mov ax,mousebutton + cmp ax,1 + jnz nosetpick + cmp ax,oldbutton + jnz dosetpick +nosetpick: ret + +dosetpick: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,1 + mov invopen,2 + cmp objecttype,4 + jz pickupexob + + mov al,command + mov itemframe,al + mov openedob,255 + call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + call openinv + call worktoscreenm + ret + +pickupexob: mov al,command + mov itemframe,al + mov openedob,255 + call openinv + call worktoscreenm + ret + + endp + + + + + +Examinventory proc near + + cmp commandtype,249 + jz alreadyexinv + mov commandtype,249 + mov al,32 + call commandonly +alreadyexinv: mov ax,mousebutton + and ax,1 + jnz doexinv + ret + +doexinv: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,0 + mov invopen,2 + call openinv + call worktoscreenm + ret + + endp + + + + + +Reexfrominv proc near + + call findinvpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + +Reexfromopen proc near + + ret + call findopenpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + + + + + + + + + + + + + +Swapwithinv proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub7 + cmp commandtype,243 + jz alreadyswap1 + mov commandtype,243 + +difsub7: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap1: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap1 + and ax,1 + jnz doswap1 +cantswap1: ret + +doswap1: mov ah,objecttype + mov al,itemframe + push ax + + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + mov bl,itemframe + mov bh,objecttype + + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findinvpos ;NONE OF THIS IS NEEDED + call delpointer ;ONLY EXTRAS CAN BE IN + mov al,itemframe + call geteitherad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Swapwithopen proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub8 + cmp commandtype,242 + jz alreadyswap2 + mov commandtype,242 + +difsub8: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap2: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap2 + and ax,1 + jnz doswap2 +cantswap2: ret + +doswap2: call geteitherad + call isitworn + jnz notwornswap + call wornerror + ret +notwornswap: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame2 + mov al,objecttype + cmp al,openedtype + jnz isntsame2 + call errormessage1 + ret + +isntsame2: call checkobjectsize + cmp al,0 + jz sizeok2 + ret + +sizeok2: mov ah,objecttype + mov al,itemframe + push ax + + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeswapex + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + jmp actuallyswap + +makeswapex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + +actuallyswap: mov bl,itemframe + mov bh,objecttype + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findopenpos + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillopen + call fillryan + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + +Intoinv proc near + + cmp pickup,0 + jnz notout + call outofinv + ret + +notout: call findinvpos + mov ax,[es:bx] + cmp al,255 + jz canplace1 + call swapwithinv + ret + +canplace1: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub1 + cmp commandtype,220 + jz alreadyplce + mov commandtype,220 + +difsub1: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplce: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo2 + and ax,1 + jnz doplace +notletgo2: ret + +doplace: call delpointer + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + mov pickup,0 + call fillryan + call readmouse + call showpointer + call outofinv + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Deletetaken proc near ;gets rid of objects that were + ;transfered to exlist ages ago + mov es,freedat + mov ah,reallocation + mov ds,extras + mov si,exdata + + mov cx,numexobjects +takenloop: mov al,[si+11] + cmp al,ah + jnz notinhere + mov bl,[si+1] + mov bh,0 + add bx,bx + add bx,bx + add bx,bx + add bx,bx + mov byte ptr [es:bx+2],254 ; was 255 + +notinhere: add si,16 + loop takenloop + + ret + + endp + + + + + + +Outofinv proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canpick2 + call blank + ret + +canpick2: mov bx,mousebutton + cmp bx,2 + jnz canpick2a + call reexfrominv + ret + +canpick2a: cmp ax,oldsubject + jnz difsub3 + cmp commandtype,221 + jz alreadygrab + mov commandtype,221 + +difsub3: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrab: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo + and ax,1 + jnz dograb +notletgo: ret + +dograb: call delpointer + mov pickup,1 + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call getexad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + call fillryan + call readmouse + call showpointer + call intoinv + call worktoscreen + call delpointer + ret + + endp + + + + + +Getfreead proc near + + mov ah,0 + mov cl,4 + shl ax,cl + mov bx,ax + mov es,freedat + ret + + endp + + + + + + + + +Getexad proc near + + mov ah,0 + mov bx,16 + mul bx + mov bx,ax + mov es,extras + add bx,exdata + ret + + endp + + + + + + +Geteitherad proc near + + cmp objecttype,4 + jz isinexlist + mov al,itemframe + call getfreead + ret +isinexlist: mov al,itemframe + call getexad + ret + + endp + + + + + + +Getanyad proc near ;nearly same as above + ;but uses command + cmp objecttype,4 + jz isex + cmp objecttype,2 + jz isfree + mov al,command + call getsetad + mov ax,[es:bx+4] + ret +isfree: mov al,command + call getfreead + mov ax,[es:bx+7] + ret +isex: mov al,command + call getexad + mov ax,[es:bx+7] + ret + + endp + + + +Getanyaddir proc near ;nearly same as above + ;but uses ax + cmp ah,4 + jz isex3 + cmp ah,2 + jz isfree3 + call getsetad + ret +isfree3: call getfreead + ret +isex3: call getexad + ret + + endp + + + + + + +Getopenedsize proc near ;nearly same as above again + ;but finds ad of opened ob + cmp openedtype,4 + jz isex2 + cmp openedtype,2 + jz isfree2 + mov al,openedob + call getsetad + mov ax,[es:bx+3] + ret +isfree2: mov al,openedob + call getfreead + mov ax,[es:bx+7] + ret +isex2: mov al,openedob + call getexad + mov ax,[es:bx+7] + ret + + endp + + + + + + + + +Getsetad proc near + + mov ah,0 + mov bx,64 + mul bx + mov bx,ax + mov es,setdat + ret + + endp + + + + + + +Findinvpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findinv1: inc bx + sub cx,itempicsize + jnc findinv1 + + mov cx,mousey + sub cx,inventy + sub bx,5 +findinv2: add bx,5 + sub cx,itempicsize + jnc findinv2 + + mov al,ryanpage + mov ah,0 + mov cx,10 + mul cx + add bx,ax + + mov al,bl + mov lastinvpos,al + add bx,bx + + mov es,buffers + add bx,ryaninvlist + ret + + endp + + + + + + + + + +Findopenpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findopenp1: inc bx + sub cx,itempicsize + jnc findopenp1 + + mov al,bl + mov lastinvpos,al + + add bx,bx + mov es,buffers + add bx,openinvlist + ret + + endp + + + + + + + + + + + + +;--------------------------------------------------------Dropping an object---- + +Dropobject proc near + + cmp commandtype,223 + jz alreadydrop + mov commandtype,223 + cmp pickup,0 + jz blank + + mov bl,itemframe + mov bh,objecttype + mov al,37 + call commandwithob +alreadydrop: mov ax,mousebutton + cmp ax,oldbutton + jz nodrop + and ax,1 + jnz dodrop +nodrop: ret + +dodrop: call geteitherad + call isitworn + jnz nowornerror + call wornerror + ret +nowornerror: cmp reallocation,47 + jz nodrop2 + mov cl,ryanx + add cl,12 + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc nodroperror +nodrop2: call droperror + ret +nodroperror: cmp mapxsize,64 + jnz notinlift + cmp mapysize,64 + jnz notinlift + call droperror + ret +notinlift: mov al,itemframe + mov ah,4 + mov cl,"G" + mov ch,"U" + mov dl,"N" + mov dh,"A" + call compare + jz cantdrop + mov al,itemframe + mov ah,4 + mov cl,"S" + mov ch,"H" + mov dl,"L" + mov dh,"D" + call compare + jz cantdrop + mov objecttype,4 + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],0 + mov al,ryanx + add al,4 + mov cl,4 + shr al,cl + add al,mapx + mov ah,ryany + add ah,8 + mov cl,4 + shr ah,cl + add ah,mapy + mov byte ptr [es:bx+3],al + mov byte ptr [es:bx+5],ah + mov al,ryanx + add al,4 + and al,15 + mov ah,ryany + add ah,8 + and ah,15 + mov byte ptr [es:bx+4],al + mov byte ptr [es:bx+6],ah + mov pickup,0 + mov al,reallocation + mov [es:bx],al + ret + + endp + + + + +Droperror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,56 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + +Cantdrop proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,24 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + +Wornerror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,57 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + + + + + + + +Removeobfrominv proc near + + cmp command,100 + jz obnotexist + call getanyad + mov di,bx + mov cl,command + mov ch,0 + call deleteexobject + ;mov byte ptr [es:bx+2],0 +obnotexist: ret + + endp + + + + +;---------------------------------------------------------Opening an object---- + +Selectopenob proc near + + mov al,command + call getanyad + cmp al,255 + jnz canopenit1 + call blank + ret + +canopenit1: cmp commandtype,224 + jz alreadyopob + mov commandtype,224 + + mov bl,command + mov bh,objecttype + mov al,38 + call commandwithob +alreadyopob: mov ax,mousebutton + cmp ax,oldbutton + jz noopenob + and ax,1 + jnz doopenob +noopenob: ret + +doopenob: mov al,command + mov openedob,al + mov al,objecttype + mov openedtype,al + + call createpanel + call showpanel + call showman + call examicon + call showexit + call openinv + call openob + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Useopened proc near + + cmp openedob,255 + jz cannotuseopen + cmp pickup,0 + jnz notout2 + call outofopen + ret + +notout2: call findopenpos + mov ax,[es:bx] + cmp al,255 + jz canplace3 + call swapwithopen +cannotuseopen: ret + +canplace3: cmp pickup,1 + jz intoopen + call blank + ret + +intoopen: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub2 + cmp commandtype,227 + jz alreadyplc2 + mov commandtype,227 + +difsub2: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplc2: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo3 + cmp ax,1 + jz doplace2 +notletgo3: ret + +doplace2: call geteitherad + call isitworn + jnz notworntoopen + call wornerror + ret +notworntoopen: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame + mov al,objecttype + cmp al,openedtype + jnz isntsame + call errormessage1 + ret + +isntsame: call checkobjectsize + cmp al,0 + jz sizeok1 + ret + +sizeok1: mov pickup,0 + mov al,itemframe + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + +Errormessage1 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,58 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Errormessage2 proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,59 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Errormessage3 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,60 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + +Checkobjectsize proc near + + call getopenedsize + push ax + mov al,itemframe + call geteitherad + mov al,[es:bx+9] + pop cx + + cmp al,255 ;gives a size of 6 if no + jnz notunsized ;size was defined in the editor + mov al,6 ;could be a bad idea +notunsized: + + + cmp al,100 + jnc specialcase + cmp cl,100 + jc isntspecial + call errormessage3 + jmp sizewrong +isntspecial: cmp cl,al + jnc sizeok +specialcase: sub al,100 + cmp cl,100 + jnc bothspecial + cmp cl,al + jnc sizeok + call errormessage2 + jmp sizewrong +bothspecial: sub cl,100 + cmp al,cl + jz sizeok + call errormessage3 +sizewrong: mov al,1 + ret +sizeok: mov al,0 + ret + + endp + + + + + + + + +Outofopen proc near + + cmp openedob,255 + jz cantuseopen + call findopenpos + mov ax,[es:bx] + cmp al,255 + jnz canpick4 +cantuseopen: call blank + ret + +canpick4: cmp ax,oldsubject + jnz difsub4 + cmp commandtype,228 + jz alreadygrb + mov commandtype,228 + +difsub4: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrb: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo4 + cmp ax,1 + jz dogrb + cmp ax,2 + jnz notletgo4 + call reexfromopen +notletgo4: ret + +dogrb: call delpointer + mov pickup,1 + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeintoex + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + jmp actuallyout + +makeintoex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + +actuallyout: call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + +;All Extra object code - adding and removing plus purge routines ------------- + + + + + + +Transfertoex proc near + + call emergencypurge + + call getexpos + mov al,expos + push ax + + push di + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov cx,8 + rep movsw + pop di + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemframe + mov [es:di+1],al + mov byte ptr [es:di+2],4 + mov byte ptr [es:di+3],255 + mov al,lastinvpos + mov [es:di+4],al + + mov al,itemframe + mov itemtotran,al + call transfermap + call transferinv + call transfertext + + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov byte ptr [si+2],254 ; was 255 + call pickupconts + + pop ax + ret + + endp + + + + + + + + + + + + + + +Pickupconts proc near + + mov al,[si+7] + cmp al,255 + jz notopenable + + mov al,itemframe + mov ah,objecttype + mov dl,expos + ;dec dl + mov es,freedat + mov bx,0 + mov cx,0 +pickupcontloop: push cx es bx dx ax + + cmp byte ptr [es:bx+2],ah + jnz notinsidethis + cmp byte ptr [es:bx+3],al + jnz notinsidethis + + mov itemtotran,cl + call transfercontoex + +notinsidethis: pop ax dx bx es cx + add bx,16 + inc cx + cmp cx,80 + jnz pickupcontloop + +notopenable: ret + + endp + + + + + + + +Transfercontoex proc near + + push es bx + + push dx es bx + call getexpos + pop si ds + + push di + mov cx,8 + rep movsw + pop di + pop dx + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemtotran + mov [es:di+1],al + mov [es:di+3],dl + mov byte ptr [es:di+2],4 + + call transfermap + call transferinv + call transfertext + ;inc expos + + pop si ds + mov byte ptr [si+2],255 + ret + + endp + + + + + + + + + + + + + + + + + + +Transfertext proc near + + mov es,extras + mov al,expos + mov ah,0 + add ax,ax + mov bx,extextdat + add bx,ax + mov di,extextpos + mov [es:bx],di + add di,extext + + mov al,itemtotran + mov ah,0 + add ax,ax + mov ds,freedesc + mov bx,freetextdat + add bx,ax + mov si,freetext + mov ax,[bx] + add si,ax + +moretext: lodsb + stosb + inc extextpos + cmp al,0 + jnz moretext + ret + + endp + + + + + + + + + + +Getexpos proc near + + + mov es,extras + mov al,0 + mov di,exdata +tryanotherex: cmp byte ptr [es:di+2],255 + jz foundnewex + add di,16 + inc al + cmp al,numexobjects + jnz tryanotherex +foundnewex: mov expos,al + ret + + endp + + + + + + + + + +Purgealocation proc near + + push ax + mov es,extras + mov di,exdata + pop bx + mov cx,0 +purgeloc: cmp bl,[es:di+0] + jnz dontpurge + cmp byte ptr [es:di+2],0 + jnz dontpurge + push di es bx cx + call deleteexobject + pop cx bx es di +dontpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz purgeloc + ret + + endp + + + + + +Emergencypurge proc near + +checkpurgeagain: mov ax,exframepos + add ax,4000 + cmp ax,exframeslen + jc notnearframeend + call purgeanitem + jmp checkpurgeagain +notnearframeend: mov ax,extextpos + add ax,400 + cmp ax,extextlen + jc notneartextend + call purgeanitem + jmp checkpurgeagain +notneartextend: ret + + endp + + + + + + +Purgeanitem proc near + + mov es,extras ;first time try and + mov di,exdata ;find an object in a + mov bl,reallocation ;location other than + mov cx,0 ;the one the player is +lookforpurge: mov al,[es:di+2] ;in + cmp al,0 + jnz cantpurge + cmp byte ptr [es:di+12],2 + jz iscup + cmp byte ptr [es:di+12],255 + jnz cantpurge +iscup: cmp byte ptr [es:di+11],bl + jz cantpurge + call deleteexobject + ret +cantpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge + + mov di,exdata + mov bl,reallocation + mov cx,0 +lookforpurge2: mov al,[es:di+2] + cmp al,0 + jnz cantpurge2 + cmp byte ptr [es:di+12],255 + jnz cantpurge2 + call deleteexobject + ret +cantpurge2: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge2 + ret + + endp + + + + + +Deleteexobject proc near ;es:di holds data ad + ;cx holds number + push cx cx cx cx + mov al,255 + mov cx,16 + rep stosb + pop ax + mov cl,al + add al,al + add al,cl + call deleteexframe + pop ax + mov cl,al + add al,al + add al,cl + inc al + call deleteexframe + pop ax + call deleteextext + + pop bx + mov bh,bl + mov bl,4 + mov di,exdata + mov cx,0 +deleteconts: cmp [es:di+2],bx + jnz notinsideex + push bx cx di + call deleteexobject ;Oooh missus! + pop di cx bx ;Recursive code! +notinsideex: add di,16 + inc cx + cmp cx,numexobjects + jnz deleteconts + ret + + endp + + + + + +Deleteexframe proc near ;al holds frame to delete + + mov di,exframedata + mov ah,0 + add ax,ax + add di,ax + add ax,ax + add di,ax + mov al,[es:di] + mov ah,0 + mov cl,[es:di+1] + mov ch,0 + mul cx ;ax holds size of this + ;frame in bytes + mov si,[es:di+2] + push si + add si,exframes + mov cx,exframeslen + sub cx,[es:di+2] + mov di,si ;di/si hold start of frame + add si,ax ;si holds end of frame + push ax + push es + pop ds + rep movsb + pop bx ;bx holds size now + sub exframepos,bx + pop si ;si holds start of frame + ;(offset only) + mov cx,numexobjects*3 + mov di,exframedata +shuffleadsdown: mov ax,[es:di+2] + cmp ax,si + jc beforethisone + sub ax,bx +beforethisone: mov [es:di+2],ax + add di,6 + loop shuffleadsdown + ret + + endp + + + + +Deleteextext proc near + + mov di,extextdat + mov ah,0 + add ax,ax + add di,ax + mov ax,[es:di] + mov si,ax + mov di,ax + add si,extext + add di,extext + mov ax,0 +findlenextext: mov cl,[es:si] + inc ax + inc si + cmp cl,0 + jnz findlenextext + + mov cx,extextlen + mov bx,si + sub bx,extext + push bx ax + sub cx,bx + rep movsb + pop bx + sub extextpos,bx + + pop si + mov cx,numexobjects + mov di,extextdat +shuffletextads: mov ax,[es:di] + cmp ax,si + jc beforethistext + sub ax,bx +beforethistext: mov [es:di],ax + add di,2 + loop shuffletextads + ret + + endp + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm new file mode 100644 index 0000000000..2dbf616efc --- /dev/null +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -0,0 +1,591 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Printchar proc near + + cmp al,255 + jz ignoreit + push si bx di + if foreign + sub bx,3 + endif + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + call showframe + pop ax di bx si + cmp kerning,0 + jnz nokern + call kernchars +nokern: push cx + mov ch,0 + add di,cx + pop cx + ;dec di +ignoreit: ret + + endp + + + + + + + + + + +Kernchars proc near + + ;sub al,13 + cmp al,"a" + jz iskern + cmp al,"u" + jz iskern + ret +iskern: cmp ah,"n" + jz kernit + cmp ah,"t" + jz kernit + cmp ah,"r" + jz kernit + cmp ah,"i" + jz kernit + cmp ah,"l" + jz kernit + ret +kernit: dec cl + ret + + endp + + + + + + +;------------------------------------------------Proportional text printing---- + + +;Memprint proc near +; +; call usecharset1 +; +; push ax bx cx dx es ds si di +; call deltextline +; pop di si ds es dx cx bx ax +; +; pop si +; push cs +; pop es +; inc si +; mov ds,currentset +; mov di,textaddressx +; mov bx,textaddressy +; mov dl,textlen +; mov al,0 +; mov ah,0 +; call printdirect +; push si + +; mov newtextline,1 +; ret + +; endp + + + + + + +;------------------------------------------------Proportional text printing---- + +;Print proc near +; +; pop si +; mov bx,[cs:si+2] +; mov di,[cs:si+0] +; mov dl,[cs:si+4] +; add si,6 +; mov ds,currentset +; +;printloop2: push bx di dx +; push es cs +; pop es +; call getnumber +; pop es +; mov ch,0 +;printloop1: mov ax,[cs:si] +; inc si +; cmp al,0 +; jz finishprint +; push cx es +; call modifychar +; call printchar +; pop es cx +; loop printloop1 +; pop dx di bx +; add bx,linespacing +; jmp printloop2 + +;finishprint: pop dx di bx + ; push si + ; ret + + ; endp + + + + + + + + + +Printslow proc near + + mov pointerframe,1 + mov pointermode,3 + mov ds,charset1 +printloopslow6: push bx di dx + call getnumber + + mov ch,0 +printloopslow5: push cx si es + mov ax,[es:si] + push bx cx es si ds + if foreign + call modifychar + endif + call printboth + pop ds si es cx bx + mov ax,[es:si+1] + inc si + cmp al,0 + jz finishslow + cmp al,":" + jz finishslow + cmp cl,1 + jz afterslow + push di ds bx cx es si + if foreign + call modifychar + endif + mov charshift,91 + call printboth + mov charshift,0 + pop si es cx bx ds di + call waitframes + cmp ax,0 + jz keepgoing + cmp ax,oldbutton + jnz finishslow2 +keepgoing: call waitframes +noslow: cmp ax,0 + jz afterslow + cmp ax,oldbutton + jnz finishslow2 ;used to finish early +afterslow: pop es si cx + inc si + loop printloopslow5 + + pop dx di bx + add bx,10 + jmp printloopslow6 + +finishslow: pop es si cx dx di bx + mov al,0 + ret + +finishslow2: pop es si cx dx di bx + mov al,1 + ret + + endp + + + +Waitframes proc near + + push di bx es si ds + call readmouse + call showpointer + call vsync + call dumppointer + call delpointer + mov ax,mousebutton + pop ds si es bx di + ret + + endp + + + + +Printboth proc near + + push ax cx bx + push di + call printchar + pop ax + push di + mov di,ax + call multidump + pop di + pop bx cx ax + ret + + endp + + + + + + +Printdirect proc near + + mov lastxpos,di + mov ds,currentset +printloop6: push bx di dx + call getnumber + mov ch,0 +printloop5: mov ax,[es:si] + inc si + cmp al,0 + jz finishdirct + cmp al,":" + jz finishdirct + push cx es + if foreign + call modifychar + endif + call printchar + mov lastxpos,di + pop es cx + loop printloop5 + pop dx di bx + add bx,linespacing + jmp printloop6 + +finishdirct: pop dx di bx + ret + + endp + + + + + + + + + + + + + + +Monprint proc near + + mov kerning,1 + mov si,bx + mov dl,166 + mov di,monadx + mov bx,monady + mov ds,tempcharset + +printloop8: push bx di dx + call getnumber + mov ch,0 +printloop7: mov al,[es:si] + inc si + + cmp al,":" + jz finishmon2 + cmp al,0 + jz finishmon + cmp al,34 + jz finishmon + cmp al,"=" + jz finishmon + cmp al,"%" + jnz nottrigger + mov ah,[es:si] + inc si + inc si + jmp finishmon +nottrigger: push cx es + if foreign + call modifychar + endif + call printchar + mov curslocx,di + mov curslocy,bx + mov maintimer,1 + call printcurs + + call vsync + push si dx ds es bx di + call lockmon + pop di bx es ds dx si + call delcurs + pop es cx + loop printloop7 + +finishmon2: pop dx di bx + call scrollmonitor + mov curslocx,di + jmp printloop8 + +finishmon: pop dx di bx + cmp al,"%" + jnz nottrigger2 + mov lasttrigger,ah +nottrigger2: mov curslocx,di + call scrollmonitor + mov bx,si + mov kerning,0 + ret + + endp + + + + + + + + + +Getnumber proc near + + mov cx,0 + push si bx di ds es + mov di,si + +wordloop: push cx dx + call getnextword + pop dx cx + cmp al,1 + jz endoftext + mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend + add cl,bl + add ch,bh + jmp wordloop + +gotoverend: mov al,dl + and al,1 + jz notcentre + push cx + mov al,dl + and al,11111110b + mov ah,0 + mov ch,0 + sub ax,cx + add ax,20 + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcentre: pop es ds di bx si + mov cl,ch + ret + + + +endoftext: mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend2 + add cl,bl + add ch,bh + +gotoverend2: mov al,dl + and al,1 + jz notcent2 + push cx + mov al,dl + and al,11111110b + add al,2 + mov ah,0 + mov ch,0 + add ax,20 + sub ax,cx + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcent2: pop es ds di bx si + mov cl,ch + ret + + endp + + + + + +Getnextword proc near + + mov bx,0 +getloop: mov ax,[es:di] + inc di + inc bh + cmp al,":" + jz endall + cmp al,0 + jz endall + cmp al,32 + jz endword + if foreign + call modifychar + endif + cmp al,255 + jz getloop + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cl,[si+0] + pop ax + call kernchars + add bl,cl + ;dec bl + jmp getloop + +endword: add bl,6 + mov al,0 + ret + +endall: add bl,6 + mov al,1 + ret + + endp + + + + + + if german + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,129 + jnz not129 + mov al,"Z"+3 + ret +not129: cmp al,132 + jnz not132 + mov al,"Z"+1 + ret +not132: cmp al,142 + jnz not142 + mov al,"Z"+4 + ret +not142: cmp al,154 + jnz not154 + mov al,"Z"+6 + ret +not154: cmp al,225 + jnz not225 + mov al,"A"-1 + ret +not225: cmp al,153 + jnz not153 + mov al,"Z"+5 + ret +not153: cmp al,148 + jnz not148 + mov al,"Z"+2 + ret +not148: ret + +nomod: ret + + endp + + endif + + + + + if spanish + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,160 + jnz not160 + mov al,"Z"+1 + ret +not160: cmp al,130 + jnz not130 + mov al,"Z"+2 + ret +not130: cmp al,161 + jnz not161 + mov al,"Z"+3 + ret +not161: cmp al,162 + jnz not162 + mov al,"Z"+4 + ret +not162: cmp al,163 + jnz not163 + mov al,"Z"+5 + ret +not163: cmp al,164 + jnz not164 + mov al,"Z"+6 + ret +not164: cmp al,165 + jnz not165 + mov al,","-1 + ret +not165: cmp al,168 + jnz not168 + mov al,"A"-1 + ret +not168: cmp al,173 + jnz not173 + mov al,"A"-4 + ret +not173: cmp al,129 + jnz not129 + mov al,"A"-5 +not129: ret + +nomod: ret + + endp + + endif + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm new file mode 100644 index 0000000000..a814c50bd6 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -0,0 +1,1495 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + + +Zoomonoff proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,222 + jz alreadyonoff + mov commandtype,222 + mov al,39 + call commandonly +alreadyonoff: mov ax,mousebutton + cmp ax,oldbutton + jz nozoomonoff + and ax,1 + jnz dozoomonoff +nozoomonoff: ret + +dozoomonoff: mov al,zoomon + xor al,1 + mov zoomon,al + + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov al,39 + call commandonly + call readmouse + call worktoscreenm + ret + + endp + + + + + + + + + + + + +Saveload proc near + + if demo + call dosreturn + ret + else + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,253 + jz alreadyops + mov commandtype,253 + mov al,43 + call commandonly +alreadyops: mov ax,mousebutton + cmp ax,oldbutton + jz noops + and ax,1 + jz noops + call dosaveload +noops: ret + endif + + endp + + + + + + + + + + + +Dosaveload proc near + + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call clearwork + call createpanel2 + call undertextline + call getridofall ;reels + call loadsavebox + call showopbox + call showmainops + call worktoscreen ;2 + jmp donefirstops + +restartops: call showopbox + call showmainops + call worktoscreenm +donefirstops: mov getback,0 +waitops: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:opslist + call checkcoords + cmp getback,0 + jz waitops + cmp getback,2 + jz restartops + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + cmp getback,4 + jz justret + call getridoftemp + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + mov commandtype,200 +justret: mov manisoffscreen,0 + ret + +opslist: dw opsx+59,opsx+114,opsy+30,opsy+76,getbackfromops + dw opsx+10,opsx+77,opsy+10,opsy+59,dosreturn + dw opsx+128,opsx+190,opsy+16,opsy+100,discops + dw 0,320,0,200,blank + dw 0ffffh + + + endp + + + +Getbackfromops proc near + + cmp mandead,2 + jz opsblock1 + call getback1 + ret +opsblock1: call blank + ret + + endp + + + + + +Showmainops proc near + + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,8 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,7 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + +Showdiscops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,9 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,10 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + ret + + endp + + + + +Loadsavebox proc near + + mov dx,offset cs:icongraphics8 + call loadintotemp + ret + + endp + + + + + + + + +Loadgame proc near + + cmp commandtype,246 + jz alreadyload + mov commandtype,246 + mov al,41 + call commandonly +alreadyload: mov ax,mousebutton + cmp ax,oldbutton + jz noload + cmp ax,1 + jz doload +noload: ret + +doload: mov loadingorsave,1 + call showopbox + call showloadops + mov currentslot,0 + call showslots + call shownames + mov pointerframe,0 + call worktoscreenm + call namestoold + mov getback,0 + +loadops: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:loadlist + call checkcoords + cmp getback,0 + jz loadops + cmp getback,2 + jz quitloaded + call getridoftemp + ;call clearnoreels + mov dx,seg madeuproomdat + mov es,dx + mov bx,offset es:madeuproomdat + call startloading + call loadroomssample + mov roomloaded,1 + mov newlocation,255 + call clearsprites + call initman + call initrain + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call startup + call worktoscreen + mov getback,4 +quitloaded: ret + +loadlist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualload + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + +Getbacktoops proc near + + cmp commandtype,201 + jz alreadygetops + mov commandtype,201 + mov al,42 + call commandonly +alreadygetops: mov ax,mousebutton + cmp ax,oldbutton + jz nogetbackops + and ax,1 + jnz dogetbackops +nogetbackops: ret + +dogetbackops: call oldtonames + mov getback,2 + ret + + endp + + + + + + + +Discops proc near + + cmp commandtype,249 + jz alreadydiscops + mov commandtype,249 + mov al,43 + call commandonly +alreadydiscops: mov ax,mousebutton + cmp ax,oldbutton + jz nodiscops + and ax,1 + jnz dodiscops +nodiscops: ret +dodiscops: call scanfornames + mov loadingorsave,2 + call showopbox + call showdiscops + mov currentslot,0 + call worktoscreenm + + mov getback,0 +discopsloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:discopslist + call checkcoords + cmp getback,0 + jz discopsloop + ret + +discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame + dw opsx+10,opsx+79,opsy+10,opsy+59,savegame + dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Savegame proc near + + cmp mandead,2 + jnz cansaveok + call blank + ret + +cansaveok: cmp commandtype,247 + jz alreadysave + mov commandtype,247 + mov al,44 + call commandonly +alreadysave: mov ax,mousebutton + and ax,1 + jnz dosave + ret +dosave: mov loadingorsave,2 + call showopbox + call showsaveops + mov currentslot,0 + call showslots + call shownames + call worktoscreenm + + call namestoold + mov bufferin,0 + mov bufferout,0 + + mov getback,0 + +saveops: call delpointer + call checkinput + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:savelist + call checkcoords + cmp getback,0 + jz saveops + ret + +savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualsave + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Actualsave proc near + + cmp commandtype,222 + jz alreadyactsave + mov commandtype,222 + mov al,44 + call commandonly +alreadyactsave: mov ax,mousebutton + and ax,1 + jz noactsave + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz noactsave + + mov al,location + mov ah,0 + mov cx,32 + mul cx + push cs + pop ds + mov si,offset cs:roomdata + add si,ax + + mov di,offset cs:madeuproomdat + mov bx,di + push cs + pop es + mov cx,16 + rep movsw + + mov al,roomssample + mov [es:bx+13],al + mov al,mapx + mov [es:bx+15],al + mov al,mapy + mov [es:bx+16],al + mov al,liftflag + mov [es:bx+20],al + mov al,manspath + mov [es:bx+21],al + mov al,facing + mov [es:bx+22],al + mov al,255 + mov [es:bx+27],al + call saveposition + call getridoftemp + call restoreall ;reels + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call redrawmainscrn + call worktoscreenm + mov getback,4 +noactsave: ret + + endp + + + + +Actualload proc near + + cmp commandtype,221 + jz alreadyactload + mov commandtype,221 + mov al,41 + call commandonly +alreadyactload: mov ax,mousebutton + cmp ax,oldbutton + jz notactload + cmp ax,1 + jnz notactload + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz notactload + call loadposition + mov getback,1 +notactload: ret + + endp + + + + +Selectslot2 proc near + + cmp mousebutton,0 + jz noselslot2 + mov loadingorsave,2 +noselslot2: call selectslot + ret + + endp + + + + + +Checkinput proc near + + cmp loadingorsave,3 + jz nokeypress + call readkey + mov al,currentkey + cmp al,0 + jz nokeypress + cmp al,13 + jnz notret + mov loadingorsave,3 + jmp afterkey +notret: cmp al,8 + jnz nodel2 + cmp cursorpos,0 + jz nokeypress + call getnamepos + dec cursorpos + mov byte ptr [es:bx],0 + mov byte ptr [es:bx+1],1 + jmp afterkey +nodel2: ;cmp al,32 + ;jz spacepress + ;cmp al,"A" + ;jc nokeypress + ;cmp al,"Z"+1 + ;jnc nokeypress +spacepress: cmp cursorpos,14 + jz nokeypress + call getnamepos + inc cursorpos + mov al,currentkey + mov [es:bx+1],al + mov byte ptr [es:bx+2],0 + mov byte ptr [es:bx+3],1 + jmp afterkey + +nokeypress: ret + +afterkey: call showopbox + call shownames + call showslots + call showsaveops + call worktoscreenm + ret + + endp + + + + + +Getnamepos proc near + + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + mov dx,seg savenames + mov es,dx + mov bx,offset es:savenames + add bx,ax + mov al,cursorpos + mov ah,0 + add bx,ax + ret + + endp + + + + + + + + +Showopbox proc near + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy + mov al,0 + mov ah,0 + call showframe + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy+55 + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Showloadops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,55 + mov dl,101 + call printmessage + ret + + endp + + + + +Showsaveops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,54 + mov dl,101 + call printmessage + ret + + endp + + + + + +Selectslot proc near + + cmp commandtype,244 + jz alreadysel + mov commandtype,244 + mov al,45 + call commandonly +alreadysel: mov ax,mousebutton + cmp ax,1 + jnz noselslot + cmp ax,oldbutton + jz noselslot + + cmp loadingorsave,3 + jnz notnocurs + dec loadingorsave +notnocurs: call oldtonames + mov ax,mousey + sub ax,opsy+4 + mov cl,-1 +getslotnum: inc cl + sub ax,11 + jnc getslotnum + mov currentslot,cl + call delpointer + call showopbox + call showslots + call shownames + cmp loadingorsave,1 + jz isloadmode + call showsaveops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret +isloadmode: call showloadops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + +noselslot: ret + + endp + + + + + + + + + + +Showslots proc near + + mov di,opsx+7 + mov bx,opsy+8 + mov al,2 + mov ds,tempgraphics + mov ah,0 + call showframe + + mov di,opsx+10 + mov bx,opsy+11 + mov cl,0 +slotloop: push cx di bx + + cmp cl,currentslot + jnz nomatchslot + mov al,3 + mov ds,tempgraphics + mov ah,0 + call showframe + +nomatchslot: pop bx di cx + add bx,10 + inc cl + cmp cl,7 + jnz slotloop + ret + + endp + + + + + +Shownames proc near + + mov dx,seg savenames + mov es,dx + mov si,offset es:savenames+1 + mov di,opsx+21 + mov bx,opsy+10 + mov cl,0 + +shownameloop: push cx di es bx si + mov al,4 + cmp cl,currentslot + jnz nomatchslot2 + + cmp loadingorsave,2 + jnz loadmode + + mov dx,si + mov cx,15 + add si,15 +zerostill: dec si + dec cl + cmp byte ptr [es:si],1 + jnz foundcharacter + jmp zerostill +foundcharacter: mov cursorpos,cl + mov byte ptr [es:si],"/" + mov byte ptr [es:si+1],0 + push si + mov si,dx + mov dl,200 + mov ah,0 + call printdirect + pop si + mov byte ptr [es:si],0 + mov byte ptr [es:si+1],1 + jmp afterprintname + +loadmode: mov al,0 + mov dl,200 + mov ah,0 + mov charshift,91 + call printdirect + mov charshift,0 + jmp afterprintname + +nomatchslot2: mov dl,200 + mov ah,0 + call printdirect + +afterprintname: pop si bx es di cx + add si,17 + add bx,10 + inc cl + cmp cl,7 + jnz shownameloop + ret + + endp + + + + + + + + + + + + + + + + + + +Dosreturn proc near + + cmp commandtype,250 + jz alreadydos + mov commandtype,250 + mov al,46 + call commandonly +alreadydos: mov ax,mousebutton + and ax,1 + jz nodos + +quickquit2: call soundend + call removeemm + +quickquit: if recording + call saverec + mov bx,rechandle + mov ah,3eh + int 21h + endif + if playback + mov bx,rechandle + mov ah,3eh + int 21h + endif + + call resetkeyboard + mov bl,31h + mov al,0 + mov ah,12h + int 10h + call vsync + + mov ah,0 + mov al,3 + int 10h + call error + mov ax,4c00h + int 21h + ret + + endp + + + +Error proc near + + cmp gameerror,1 + jz error1 + cmp gameerror,2 + jz error2 + cmp gameerror,3 + jz error3 + cmp gameerror,4 + jz error4 + cmp gameerror,5 + jz error5 + cmp gameerror,6 + jz error6 + cmp gameerror,7 + jz error7 + cmp gameerror,8 + jz error8 + ret + +error1: mov dx,offset cs:gameerror1 + jmp generalerror + +error2: mov ax,soundbaseadd + sub ax,200h + mov cl,4 + shr ax,cl + add al,"0" + mov bx,offset cs:error2patch + mov [cs:bx+1],al + mov dx,offset cs:gameerror2 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error3: mov dx,offset cs:gameerror3 + jmp generalerror + +error4: mov dx,offset cs:gameerror4 + jmp generalerror + +error5: mov dx,offset cs:gameerror5 + jmp generalerror + +error6: mov al,soundint + add al,"0" + mov bx,offset cs:error6patch + mov [cs:bx],al + mov dx,offset cs:gameerror6 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error7: mov dx,offset cs:gameerror7 + jmp generalerror + +error8: mov dx,offset cs:gameerror8 + jmp generalerror + +generalerror: mov ah,9h + push cs + pop ds + int 21h + ret + +nodos: ret + +gameerror1: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to allocate Expanded Memory." + db 13,10,13,10 + db 24h +gameerror2: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster card not found at address " +error2patch: db "220 Hex." + db 13,10,13,10 + db 24h +gameerror3: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Out of Base Memory." + db 13,10,13,10 + db 24h +gameerror4: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Memory Deallocation problem." + db 13,10,13,10 + db 24h +gameerror5: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "At least 590K of base memory is required." + db 13,10,13,10 + db 24h +gameerror6: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster not found on interupt " +error6patch: db "0" + db 13,10,13,10 + db 24h +gameerror7: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to select EMM page." + db 13,10,13,10 + db 24h +gameerror8: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "File not found.c" +error8patch: db 13,10,13,10 + db 24h + +gameinfo: db "Dreamweb looks for Sound Blaster information in",13,10 + db "the BLASTER environment variable (in your AUTOEXEC.BAT)",13,10 + db 13,10,"If this is not found then IRQ 7, DMA channel 1 and base",13,10 + db "address 220h are assumed.",13,10,13,10 + + db "To alter any or all of these settings you can specify them",13,10 + db "on the command line. For example:",13,10,13,10 + db "Type DREAMWEB I7 A220 D1 to run Dreamweb on IRQ 7, DMA",13,10 + db " channel 1 and base address 220h" + db 13,10 + db " DREAMWEB I5 to run Dreamweb on IRQ 5 and",13,10 + db " default address of 220h, DMA 1",13,10 + db 13,10 + db 24h + +endgametext1: db 13,10,13,10 + db "Try the Dreamweb CD in your stereo....",13,10 + db 13,10,13,10 + db 24h + + endp + + + + + + + + +Namestoold proc near + + push cs + pop ds + mov si,offset cs:savenames + mov di,zoomspace + mov es,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + +Oldtonames proc near + + push cs + pop es + mov di,offset cs:savenames + mov si,zoomspace + mov ds,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + +Savefilewrite proc near + mov bx,handle + mov ah,40h + int 21h + ret + endp + +Savefileread proc near + mov bx,handle + mov ah,3fh + int 21h + ret + endp + +Saveposition proc near + + call makeheader + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + call openforsave + + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen + call savefilewrite + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call saveseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call saveseg + + mov ds,extras + mov dx,exframedata + call saveseg + + mov ds,buffers + mov dx,listofchanges + call saveseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call saveseg + + mov dx,seg reelroutines + mov ds,dx + mov dx,offset reelroutines + call saveseg + +fquit: call closefile + ret + + endp + + + + + + +Loadposition proc near + + mov timecount,0 + call clearchanges + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + if cd + call openfilefromc + else + call openfile + endif + + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen + call savefileread + push cs + pop es + mov di,offset cs:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call loadseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call loadseg + + mov ds,extras + mov dx,exframedata + call loadseg + + mov ds,buffers + mov dx,listofchanges + call loadseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call loadseg + + push cs + pop ds + mov dx,offset cs:reelroutines + call loadseg + + call closefile + ret + + endp + + + + + +Loadseg proc near + + mov bx,handle + mov ax,[es:di] + add di,2 + push di + push es + mov cx,ax + mov ah,3fh + int 21h + pop es + pop di + ret + + endp + + + + + +Makeheader proc near + + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + mov ax,17 + call storeit + mov ax,lengthofvars + call storeit + mov ax,lengthofextra + call storeit + mov ax,numchanges*4 + call storeit + mov ax,48 + call storeit + mov ax,lenofreelrouts + call storeit + ret + + endp + + + + + +Storeit proc near + + cmp ax,0 + jnz isntblank + inc ax +isntblank: stosw + ret + + endp + + + + +Saveseg proc near + + mov cx,[es:di] + add di,2 + push di es + mov bx,handle + mov ah,40h + int 21h + pop es di + ret + + endp + + + +Findlen proc near + + dec bx + add bx,ax +nextone: cmp cl,[bx] + jnz foundlen + dec bx + dec ax + cmp ax,0 + jnz nextone +foundlen: ret + + endp + + + + + +Scanfornames proc near + + mov dx,seg savenames + mov es,dx + mov di,offset es:savenames + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + mov cx,7 +scanloop: push es ds di dx cx + + if cd + call openfilefromc + else + call openfilenocheck + endif + jc notexist + pop cx + inc ch + push cx + push di es + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen + call savefileread + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + pop ds dx + call loadseg + mov bx,handle + call closefile + +notexist: pop cx dx di ds es + add dx,13 + add di,17 + dec cl + jnz scanloop + mov al,ch + ret + + endp + + + + + +Decide proc near + + call setmode + call loadpalfromiff + call clearpalette + mov pointermode,0 + mov watchingtime,0 + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call loadsavebox + call showdecisions + call worktoscreen + call fadescreenup + mov getback,0 + +waitdecide: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:decidelist + call checkcoords + cmp getback,0 + jz waitdecide + cmp getback,4 + jz hasloadedroom + call getridoftemp +hasloadedroom: mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + ret + +decidelist: dw opsx+69,opsx+124,opsy+30,opsy+76,newgame + dw opsx+20,opsx+87,opsy+10,opsy+59,dosreturn + dw opsx+123,opsx+190,opsy+10,opsy+59,loadold + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Showdecisions proc near + + call createpanel2 + call showopbox + mov ds,tempgraphics + mov di,opsx+17 + mov bx,opsy+13 + mov al,6 + mov ah,0 + call showframe + call undertextline + ret + + endp + + + + + +Newgame proc near + + cmp commandtype,251 + jz alreadynewgame + mov commandtype,251 + mov al,47 + call commandonly +alreadynewgame: mov ax,mousebutton + cmp ax,1 + jnz nonewgame + mov getback,3 +nonewgame: ret + + endp + + + + + + + +Loadold proc near + + cmp commandtype,252 + jz alreadyloadold + mov commandtype,252 + mov al,48 + call commandonly +alreadyloadold: mov ax,mousebutton + and ax,1 + jz noloadold + call doload + cmp getback,4 + jz noloadold + call showdecisions + call worktoscreenm + mov getback,0 +noloadold: ret + + endp + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm new file mode 100644 index 0000000000..113bdd9548 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/sblaster.asm @@ -0,0 +1,1293 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +; Creative Reality Sound Blaster Drivers . (C) 1994 Creative Reality + +; Very sparsly commented. + + + +;These drivers are not stand alone. We had them as an integral part of the +;game. +; +;Put interupt no. into SOUNDINT, base address (eg 220h) into SOUNDBASEADD. +;If interupt is 255 then no card is assumed. +; +;Call soundstartup at beginning of program to test card and initialise. +; +;This code assumes that EMS has been initialised +;Emm page frame is in variable EMMPAGEFRAME. Handle is in EMMHANDLE. +; +;Call loadsample with a filename in CS:DX (ie. in the code somewhere) +; +;To play a sample call playchannel0 or playchannel1 with sound no. in al. +; +;Call endsample to restore interupts and halt sound. +; +; + + + + +;------------------------------------------- Initial sound set up and end --- + +Loadspeech proc near + + cmp soundint,255 + jz dontbother8 + + call cancelch1 + + mov speechloaded,0 + call createname + + mov speechlength,0 + mov dx,offset cs:speechfilename + call openfilenocheck + jc dontbother8 + + mov bx,speechemmpage + +moreloadspeech: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + mov es,emmpageframe + mov di,8000h + mov cx,4000h + mov ax,0 + rep stosw + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + mov cl,11 + shr ax,cl + add speechlength,ax + pop bx dx + add bx,2 + cmp ax,0 + jnz moreloadspeech + call closefile + + mov es,sounddata2 + mov di,50*6 + mov ax,speechemmpage + mov [es:di],al + mov ax,0 + mov [es:di+1],ax + mov ax,speechlength + mov [es:di+3],ax + mov speechloaded,1 +dontbother8: ret + +speechfilename: db "SPEECH\" +speechfile: db "R24C0005.RAW",0 + + endp + + + +Createname proc near + + push ax + mov di,offset cs:speechfile + mov byte ptr [cs:di+0],dl ;"R" + mov [cs:di+3],cl + + mov al,dh ;reallocation + mov ah,"0"-1 +findten: inc ah + sub al,10 + jnc findten + mov [cs:di+1],ah + add al,10+"0" + mov [cs:di+2],al + pop ax + + mov cl,"0"-1 +thousandsc: inc cl + sub ax,1000 + jnc thousandsc + add ax,1000 + mov [cs:di+4],cl + mov cl,"0"-1 +hundredsc: inc cl + sub ax,100 + jnc hundredsc + add ax,100 + mov [cs:di+5],cl + mov cl,"0"-1 +tensc: inc cl + sub ax,10 + jnc tensc + add ax,10 + mov [cs:di+6],cl + add al,"0" + mov [cs:di+7],al + ret + + endp + + + + + + +Loadsample proc near + + cmp soundint,255 + jz dontbother + + call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata + pop cx + mov dx,0 + call readfromfile + pop di es + + add di,2 + mov bx,0 + mov dx,[es:di] + add dx,1 + shr dx,1 + + mov soundemmpage,0 + +moreload: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add soundemmpage,2 + dec dx + jnz moreload + ;inc soundemmpage + call closefile +dontbother: ret + +emmerror: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Loadsecondsample proc near + + cmp soundint,255 + jz dontbother9 + + cmp ch0playing,12 + jc ch0oksecond + cmp ch0playing,255 + jz ch0oksecond + call cancelch0 + ;mov cx,100 + ;call hangon + jmp ch0oksecond +justcancel: call cancelch0 +ch0oksecond: cmp ch1playing,12 + jc ch1oksecond + call cancelch1 + +ch1oksecond: call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata2 + pop cx + mov dx,0 + call readfromfile + + mov cx,100 + mov di,0 + mov es,sounddata2 + mov bx,soundemmpage +adjustemmpage: mov al,[es:di] + add al,bl + mov [es:di],al + add di,6 + loop adjustemmpage + + pop di es + + add di,2 + mov bx,soundemmpage + mov speechemmpage,bx + mov dx,[es:di] + add dx,1 + shr dx,1 + +moreload2: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add speechemmpage,2 + dec dx + jnz moreload2 + call closefile +dontbother9: ret + +emmerror2: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Soundstartup proc near + + cmp soundint,255 + jz dontbother2 + + mov dx,soundbaseadd + add dx,0eh + mov DSP_status,dx + mov dx,soundbaseadd + add dx,0ch + mov DSP_write,dx + + mov al,1 + mov dx,soundbaseadd + add dx,0006h + out dx,al + push ax ax ax ax ax ax ax ax + pop ax ax ax ax ax ax ax ax + mov al,0 + out dx,al + + mov dx,DSP_status + mov cx,2000 +waitinit: in al,dx + and al,128 + jz waitinit + mov dx,soundbaseadd + add dx,000ah + in al,dx + cmp al,0aah + jz dspready + loop waitinit + mov gameerror,2 + jmp quickquit + +dspready: call trysoundalloc + + cli + mov ah,40h ;set sample rate + call out22c + mov ah,210 ;of 22050Hz + call out22c + sti + + call checksoundint + + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es ; Save es:bx to temp memory + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:dmaend + mov ah,25h + mov al,soundint + add al,8 + int 21h ; Set to new + + call enablesoundint + + mov al,sounddmachannel + xor ah,ah + mov bx,offset cs:dmaaddresses + add bx,ax + mov al,[cs:bx] + mov dmaaddress,al + + mov ah,0d1h ;speaker on + call out22c + mov ah,0d0h + call out22c + +dontbother2: ret + +dmaaddresses db 87h,83h,81h,82h + + endp + + + + + +Trysoundalloc proc near + + cmp needsoundbuff,1 + jz gotsoundbuff + inc soundtimes + mov bx,(16384+2048)/16 + call allocatemem + mov soundbuffer,ax + push ax + mov al,ah + mov cl,4 + shr al,cl + mov soundbufferpage,al + pop ax + mov cl,4 + shl ax,cl + mov soundbufferad,ax + cmp ax,0b7ffh + jnc soundfail + + mov es,soundbuffer + mov di,0 + mov cx,16384/2 + mov ax,7f7fh + rep stosw + mov needsoundbuff,1 + ret + +soundfail: mov es,soundbuffer + call deallocatemem +gotsoundbuff: ret + + endp + + + + + + +Setsoundoff proc near + + cmp soundint,255 + jz dontbother28 + mov soundbufferwrite,0 + cli + call setupPIT + mov soundbufferwrite,4096 + call startdmablock + sti +dontbother28: ret + + endp + + + + + + +Checksoundint proc near + + mov ah,0d3h ;speaker off + call out22c + + mov testresult,0 + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:interupttest + mov ah,25h + mov al,soundint + add al,8 + int 21h + + call enablesoundint + + mov ah,0f2h + call out22c + + mov cx,20 + call hangon + + call disablesoundint + + mov dx,oldsoundintseg + mov ds,dx + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + + cmp testresult,1 + jz interuptworked + mov gameerror,6 ;interupt wrong + jmp quickquit ;exit to DOS with error + +interuptworked: ret + + endp + + + + + +Enablesoundint proc near + + mov dx,21h ; Enable int? + in al,dx + mov currentirq,al + mov ah,11111110b + mov cl,soundint + rol ah,cl + and al,ah + out dx,al + ret + + endp + + + + + +Disablesoundint proc near + + mov al,soundint + mov dx,21h + mov al,currentirq + out dx,al + ret + + endp + + + + +Interupttest proc near + + cli + push ax dx + mov testresult,1 + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx ax + iret + + endp + + + + + +Soundend proc near + + cmp soundint,255 + jz dontbother3 + + call getridofPIT + + mov ah,0d0h + call out22c + + call disablesoundint + + mov ds,oldsoundintseg ;for keys + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + +dontbother3: ret + + endp + + + + + +Out22c proc near + + mov dx,DSP_write +notclear: in al,dx + or al,al + js notclear + mov al,ah + out dx,al + ret + + endp + + + + + +;--------------------------------------------------------------------------- + + + + +Playchannel0 proc near ;al=sound no + ;ah=times to repeat + cmp soundint,255 + jz dontbother4 + + push es ds bx cx di si + + mov ch0playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank + mov es,sounddata2 + sub al,12 +notsecondbank: mov ch0repeat,ah + mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch0emmpage,ax + mov ax,[es:bx+1] + mov ch0offset,ax + mov ax,[es:bx+3] + mov ch0blockstocopy,ax + + cmp ch0repeat,0 + jz nosetloop + mov ax,ch0emmpage + mov ch0oldemmpage,ax + mov ax,ch0offset + mov ch0oldoffset,ax + mov ax,ch0blockstocopy + mov ch0oldblockstocopy,ax + +nosetloop: pop si di cx bx ds es + +dontbother4: ret + + endp + + + + + + + +Playchannel1 proc near ;al=sound no + + cmp soundint,255 + jz dontbother5 + cmp ch1playing,7 + jz dontbother5 + push es ds bx cx di si + + mov ch1playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank1 + mov es,sounddata2 + sub al,12 +notsecondbank1: mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch1emmpage,ax + mov ax,[es:bx+1] + mov ch1offset,ax + mov ax,[es:bx+3] + mov ch1blockstocopy,ax + + pop si di cx bx ds es + +dontbother5: ret + + endp + + + + + + + + +Makenextblock proc near + + call volumeadjust + + call loopchannel0 + cmp ch1blockstocopy,0 + jz mightbeonlych0 + cmp ch0blockstocopy,0 + jz mightbeonlych1 + + dec ch0blockstocopy + dec ch1blockstocopy + call bothchannels + ret + +mightbeonlych1: mov ch0playing,255 + cmp ch1blockstocopy,0 + jz notch1only + dec ch1blockstocopy + call channel1only +notch1only: ret + +mightbeonlych0: mov ch1playing,255 + cmp ch0blockstocopy,0 + jz notch0only + dec ch0blockstocopy + call channel0only + ret +notch0only: mov es,soundbuffer + mov di,soundbufferwrite + mov cx,1024 + mov ax,7f7fh + rep stosw + and di,16384-1 + mov soundbufferwrite,di + ret + + endp + + + + +Volumeadjust proc near + + mov al,volumedirection + cmp al,0 + jz volok + mov al,volume + cmp al,volumeto + jz volfinish + add volumecount,64 + jnz volok + mov al,volume + add al,volumedirection + mov volume,al + ret +volfinish: mov volumedirection,0 +volok: ret + + endp + + + +Loopchannel0 proc near + + cmp ch0blockstocopy,0 + jnz notloop + cmp ch0repeat,0 + jz notloop + cmp ch0repeat,255 + jz endlessloop + dec ch0repeat +endlessloop: mov ax,ch0oldemmpage + mov ch0emmpage,ax + mov ax,ch0oldoffset + mov ch0offset,ax + mov ax,ch0blockstocopy + add ax,ch0oldblockstocopy + mov ch0blockstocopy,ax + ret +notloop: ret + + endp + + + + + + + +Cancelch0 proc near + + mov ch0repeat,0 + mov ch0blockstocopy,0 + mov ch0playing,255 + ret + + endp + + + +Cancelch1 proc near + + mov ch1blockstocopy,0 + mov ch1playing,255 + ret + + endp + + + + +Channel0only proc near + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + + call channel0tran + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notch0endofpage0 + inc ch0emmpage +notch0endofpage0: ret + + endp + + + + +Channel1only proc near + + call saveems + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch1offset + add si,16384 + + mov cx,1024 + rep movsw + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notch1endofpage1 + inc ch1emmpage +notch1endofpage1: ret + + endp + + + + + +Channel0tran proc near + + cmp volume,0 + jnz lowvolumetran + mov cx,1024 + rep movsw + ret + +lowvolumetran: mov cx,1024 + mov bh,volume + mov bl,0 + add bx,16384-256 +volloop: lodsw + mov bl,al + mov al,[es:bx] + mov bl,ah + mov ah,[es:bx] + stosw + loop volloop + ret + + + endp + + + + + + + + +Bothchannels proc near ;rather slow routine + ;to mix two channels + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + mov bx,ch1offset + add bx,16384 + mov cx,2048 + mov dh,128 + mov dl,255 + + call domix + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + + mov si,ch0offset + add si,2048 + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notbothendofpage0 + inc ch0emmpage +notbothendofpage0: mov si,ch1offset + add si,2048 + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notbothendofpage1 + inc ch1emmpage +notbothendofpage1: ret + + endp + + + +Saveems proc near + + mov ah,4eh + mov al,0 + mov es,soundbuffer + mov di,16384+2048-256 + int 67h + ret + + endp + + +Restoreems proc near + + push si di + mov ah,4eh + mov al,1 + mov ds,soundbuffer + mov si,16384+2048-256 + int 67h + pop di si + ret + + endp + + + +Domix proc near + + cmp volume,0 + jnz lowvolumemix + +slow: lodsb + mov ah,[bx] + inc bx + cmp al,dh + jnc toplot + +botlot: cmp ah,dh + jnc nodistort + add al,ah + js botok + xor al,al + stosb + loop slow + jmp doneit +botok: xor al,dh + stosb + loop slow + jmp doneit + +toplot: cmp ah,dh + jc nodistort + add al,ah + jns topok + mov al,dl + stosb + loop slow + jmp doneit +topok: xor al,dh + stosb + loop slow + jmp doneit + +nodistort: add al,ah + xor al,dh + stosb + loop slow + jmp doneit + + +lowvolumemix: lodsb + push bx + mov bh,volume + add bh,63 + mov bl,al + mov al,[es:bx] + pop bx + + mov ah,[bx] + inc bx + cmp al,dh + jnc toplotv + +botlotv: cmp ah,dh + jnc nodistortv + add al,ah + js botokv + xor al,al + stosb + loop lowvolumemix + jmp doneit +botokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +toplotv: cmp ah,dh + jc nodistortv + add al,ah + jns topokv + mov al,dl + stosb + loop lowvolumemix + jmp doneit +topokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +nodistortv: add al,ah + xor al,dh + stosb + loop lowvolumemix +doneit: ret + + + endp + + + + + + + +Dmaend proc near + + cli + push ax cx dx + call startdmablock + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx cx ax + iret + + endp + + + + + + + + + + + + + + + + +Startdmablock proc near + + mov al,sounddmachannel ;cx=length + or al,4 ;bx=offset + out 0ah,al + xor al,al + out 0ch,al + + mov al,48h + or al,sounddmachannel + out 0bh,al + + mov cx,soundbufferad + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov dl,dmaaddress + mov al,soundbufferpage ;hardware page + out dx,al + + mov dl,sounddmachannel + shl dl,1 + inc dl + mov cx,16384-1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov al,sounddmachannel + out 0ah,al ;dmac programmed + + mov dx,DSP_write +notclear1: in al,dx + or al,al + js notclear1 + mov al,14h + out dx,al +notclear2: in al,dx + or al,al + js notclear2 + mov al,cl + out dx,al +notclear3: in al,dx + or al,al + js notclear3 + mov al,ch + out dx,al + + ret + + + endp + + + + + + + + + + + + + + + +SetupPIT proc near + + mov ah,35h + mov al,8 + int 21h + mov oldint8seg,es ; Save es:bx to temp memory + mov oldint8add,bx + push cs + pop ds + mov dx,offset cs:PITinterupt + mov ah,25h + mov al,8 + int 21h ; Set to new + + mov al,34h + out 43h,al + mov al,0h + out 40h,al + mov al,0dah + out 40h,al + ret + + endp + + + + + + +Getridofpit proc near + + cmp oldint8seg,-1 + jz noresetPIT + mov dx,oldint8add + mov ax,oldint8seg + mov ds,ax + mov ah,25h + mov al,8 + int 21h + mov al,34h + out 43h,al + mov al,0 + out 40h,al + mov al,0 + out 40h,al +noresetPIT: ret + + endp + + + + + + +PITinterupt proc near + + cli + push ax dx cx + + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + in al,dx + mov cl,al + in al,dx + mov ch,al + sub cx,soundbufferad + mov ax,soundbufferwrite + sub ax,cx + and ax,3fffh + sti + cmp ax,8192 + jnc mustgo + cmp ax,2048 + jnc nopitflip + +mustgo: push bx si di es ds + call makenextblock + pop ds es di si bx + +nopitflip: cli + mov al,20h + out 20h,al + pop cx dx ax + iret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm new file mode 100644 index 0000000000..31325fc2b3 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -0,0 +1,5034 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;------------------------------------------------------------People Routines---- + + + +Reelroutines db 1,44,0 ;Room number and x,y + dw 20 ;reel pointer + db 2,0,1 ;speed,speed count,convers. no. + + db 1,55,0 + dw 0 + db 50,20,0 + + db 24,22,0 + dw 74 + db 1,0,0 + + db 24,33,10 + dw 75 + db 1,0,1 + + db 1,44,0 + dw 27 + db 2,0,2 + + db 1,44,0 + dw 96 + db 3,0,4 + + db 1,44,0 + dw 118 + db 2,0,5 + + db 1,44,10 + dw 0 + db 2,0,0 + + db 5,22,20 + dw 53 + db 3,0,0 + + db 5,22,20 + dw 40 + db 1,0,2 + + db 5,22,20 + dw 50 + db 1,0,3 + + db 2,11,10 + dw 192 + db 1,0,0 + + db 2,11,10 + dw 182 + db 2,0,1 + + db 8,11,10 + dw 0 + db 2,0,1 + + db 23,0,50 + dw 0 + db 3,0,0 + + db 28,11,20 + dw 250 + db 4,0,0 + + db 23,0,50 + dw 43 + db 2,0,8 + + db 23,11,40 + dw 130 + db 2,0,1 + + db 23,22,40 + dw 122 + db 2,0,2 + + db 23,22,40 + dw 105 + db 2,0,3 + + db 23,22,40 + dw 81 + db 2,0,4 + + db 23,11,40 + dw 135 + db 2,0,5 + + db 23,22,40 + dw 145 + db 2,0,6 + + db 4,22,30 + dw 0 + db 2,0,0 + + db 45,22,30 + dw 200 + db 0,0,20 + + db 45,22,30 + dw 39 + db 2,0,0 + + db 45,22,30 + dw 25 + db 2,0,0 + + db 8,22,40 + dw 32 + db 2,0,0 + + db 7,11,20 + dw 64 + db 2,0,0 + + db 22,22,20 + dw 82 + db 2,0,0 + + db 27,11,30 + dw 0 + db 2,0,0 + + db 20,0,30 + dw 0 + db 2,0,0 + + db 14,33,40 + dw 21 + db 1,0,0 + + db 29,11,10 + dw 0 + db 1,0,0 + + db 2,22,0 + dw 2 + db 2,0,0 + + db 25,0,50 + dw 4 + db 2,0,0 + + db 50,22,30 + dw 121 + db 2,0,0 + + db 50,22,30 + dw 0 + db 20,0,0 + + db 52,22,30 + dw 192 + db 2,0,0 + + db 52,22,30 + dw 233 + db 2,0,0 + + db 50,22,40 + dw 104 + if cd + if german + db 65,0,0 + else + db 55,0,0 + endif + else + db 55,0,0 + endif + + db 53,33,0 + dw 99 + db 2,0,0 + + db 50,22,40 + dw 0 + db 3,0,0 + + db 50,22,30 + dw 162 + db 2,0,0 + + db 52,22,30 + dw 57 + db 2,0,0 + + db 52,22,30 + dw 0 + db 2,0,0 + + db 54,0,0 + dw 72 + db 3,0,0 + + db 55,44,0 + dw 0 + db 2,0,0 + + db 19,0,0 + dw 0 + db 28,0,0 + + db 14,22,0 + dw 2 + db 2,0,0 + + db 14,22,0 + dw 300 + db 1,0,0 + + db 10,22,30 + dw 174 + db 0,0,0 + + db 12,22,20 + dw 0 + db 1,0,0 + + db 11,11,20 + dw 0 + db 50,20,0 + + db 11,11,30 + dw 0 + db 50,20,0 + + db 11,22,20 + dw 0 + db 50,20,0 + + db 14,33,40 + dw 0 + db 50,20,0 + + db 255 + + +Lenofreelrouts equ $-reelroutines + + +Reelcalls dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke + dw manasleep,drunk,receptionist,malefan,femalefan + dw louis,louischair,soldier1,bossman,interviewer + dw heavy,manasleep2,mansatstill,drinker,bartender + dw othersmoker,tattooman,attendant,keeper,candles1 + dw smallcandle,security,copper,poolguard,rockstar + dw businessman,train,aide,mugger,helicopter + dw intromagic1,intromusic,intromagic2,candles2,gates + dw intromagic3,intromonks1,candles,intromonks2 + dw handclap,monkandryan,endgameseq,priest,madman + dw madmanstelly,alleybarksound,foghornsound + dw carparkdrip,carparkdrip,carparkdrip,carparkdrip + + + +;---------------------------------------------------------Character updates---- + + + +Alleybarksound proc near + + mov ax,[es:bx+3] + dec ax + cmp ax,0 + jnz nobark + push bx es + mov al,14 + call playchannel1 + pop es bx + mov ax,1000 +nobark: mov [es:bx+3],ax + ret + + endp + + + + +Intromusic proc near + + ret + + endp + + +Foghornsound proc near + + call randomnumber + cmp al,198 + jnz nofog + mov al,13 + call playchannel1 +nofog: ret + + endp + + + + +Receptionist proc near + + call checkspeed + jnz gotrecep + cmp cardpassflag,1 + jnz notsetcard + inc cardpassflag + mov byte ptr [es:bx+7],1 + mov word ptr [es:bx+3],64 +notsetcard: cmp word ptr [es:bx+3],58 + jnz notdes1 + call randomnumber + cmp al,30 + jc notdes2 + mov word ptr [es:bx+3],55 + jmp gotrecep + +notdes1: cmp word ptr [es:bx+3],60 + jnz notdes2 + call randomnumber + cmp al,240 + jc gotrecep + mov word ptr [es:bx+3],53 + jmp gotrecep + +notdes2: cmp word ptr [es:bx+3],88 + jnz notendcard + mov word ptr [es:bx+3],53 + jmp gotrecep + +notendcard: inc word ptr [es:bx+3] +gotrecep: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedrecep + mov talkedtorecep,1 +nottalkedrecep: ret + + endp + + + + +Smokebloke proc near + + cmp rockstardead,0 + jnz notspokento + mov al,[es:bx+7] + and al,128 + jz notspokento + push es bx + mov al,5 + call setlocation + pop bx es +notspokento: ;mov al,[es:bx+7] + ;and al,127 + ;mov [es:bx+7],al + call checkspeed + jnz gotsmokeb + cmp word ptr [es:bx+3],100 + jnz notsmokeb1 + call randomnumber + cmp al,30 + jc notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb1: cmp word ptr [es:bx+3],117 + jnz notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb2: inc word ptr [es:bx+3] +gotsmokeb: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Attendant proc near + + call showgamereel + call addtopeoplelist + mov al,[es:bx+7] + and al,128 + jz nottalked + mov talkedtoattendant,1 +nottalked: ret + + endp + + + + + + +Manasleep proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + +Eden proc near + + cmp generaldead,0 + jnz notinbed + call showgamereel + call addtopeoplelist +notinbed: ret + + endp + + + +Edeninbath proc near + + cmp generaldead,0 + jz notinbed + cmp sartaindead,0 + jnz notinbath + call showgamereel + call addtopeoplelist +notinbath: ret + + endp + + + +Malefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + +Femalefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Louis proc near + + cmp rockstardead,0 + jnz notlouis1 + call showgamereel + call addtopeoplelist +notlouis1: ret + + endp + + + + +Louischair proc near + + cmp rockstardead,0 + jz notlouis2 + call checkspeed + jnz notlouisanim + mov ax,[es:bx+3] + inc ax + cmp ax,191 + jz restartlouis + cmp ax,185 + jz randomlouis + mov [es:bx+3],ax + jmp notlouisanim +randomlouis: mov [es:bx+3],ax + call randomnumber + cmp al,245 + jnc notlouisanim +restartlouis: mov ax,182 + mov [es:bx+3],ax +notlouisanim: call showgamereel + call addtopeoplelist +notlouis2: ret + + endp + + + +Manasleep2 proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Mansatstill proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Tattooman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Drinker proc near + + call checkspeed + jnz gotdrinker + inc word ptr [es:bx+3] + cmp word ptr [es:bx+3],115 + jnz notdrinker1 + mov word ptr [es:bx+3],105 + jmp gotdrinker + +notdrinker1: cmp word ptr [es:bx+3],106 + jnz gotdrinker + call randomnumber + cmp al,3 + jc gotdrinker + mov word ptr [es:bx+3],105 + +gotdrinker: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Bartender proc near + + call checkspeed + jnz gotsmoket + cmp word ptr [es:bx+3],86 + jnz notsmoket1 + call randomnumber + cmp al,18 + jc notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket1: cmp word ptr [es:bx+3],103 + jnz notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket2: inc word ptr [es:bx+3] +gotsmoket: call showgamereel + cmp gunpassflag,1 + jnz notgotgun + mov byte ptr [es:bx+7],9 +notgotgun: call addtopeoplelist + ret + + endp + + + + + + + +Othersmoker proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Barwoman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + +Interviewer proc near + + cmp reeltowatch,68 + jnz notgeneralstart + inc word ptr [es:bx+3] +notgeneralstart: cmp word ptr [es:bx+3],250 + jz talking + call checkspeed + jnz talking + cmp word ptr [es:bx+3],259 + jz talking + inc word ptr [es:bx+3] +talking: call showgamereel + ret + + endp + + + + + +Soldier1 proc near + + cmp word ptr [es:bx+3],0 + jz soldierwait + mov watchingtime,10 + cmp word ptr [es:bx+3],30 + jnz notaftersshot + inc combatcount + cmp combatcount,40 + jnz gotsoldframe + mov mandead,2 + jmp gotsoldframe +notaftersshot: call checkspeed + jnz gotsoldframe + inc word ptr [es:bx+3] + jmp gotsoldframe +soldierwait: cmp lastweapon,1 + jnz gotsoldframe + mov watchingtime,10 + cmp manspath,2 + jnz gotsoldframe + cmp facing,4 + jnz gotsoldframe + inc word ptr [es:bx+3] + mov lastweapon,-1 + mov combatcount,0 +gotsoldframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + +Rockstar proc near + + mov ax,[es:bx+3] + cmp ax,303 + jz rockcombatend + cmp ax,118 + jz rockcombatend + call checkspeed + jnz rockspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,118 + jnz notbeforedead + mov mandead,2 + jmp gotrockframe + +notbeforedead: cmp ax,79 + jnz gotrockframe + dec ax + cmp lastweapon,1 + jnz notgunonrock + mov lastweapon,-1 + mov ax,123 + jmp gotrockframe +notgunonrock: inc combatcount + cmp combatcount,40 + jnz gotrockframe + mov combatcount,0 + mov ax,79 + +gotrockframe: mov [es:bx+3],ax +rockspeed: call showgamereel + cmp word ptr [es:bx+3],78 + jnz notalkrock + call addtopeoplelist + mov pointermode,2 + mov watchingtime,0 + ret + +notalkrock: mov watchingtime,2 + mov pointermode,0 + mov al,mapy + mov [es:bx+2],al + ret + +rockcombatend: mov newlocation,45 + call showgamereel + ret + + endp + + + + + + + + + + + + + + + +Helicopter proc near + + mov ax,[es:bx+3] + cmp ax,203 + jz heliwon + ;cmp ax,53 + ;jz helicombatend + call checkspeed + jnz helispeed + + mov ax,[es:bx+3] + inc ax + cmp ax,53 + jnz notbeforehdead + inc combatcount + cmp combatcount,8 + jc waitabit + mov mandead,2 +waitabit: mov ax,49 + jmp gotheliframe + +notbeforehdead: cmp ax,9 + jnz gotheliframe + dec ax + cmp lastweapon,1 + jnz notgunonheli + mov lastweapon,-1 + mov ax,55 + jmp gotheliframe +notgunonheli: mov ax,5 + inc combatcount + cmp combatcount,20 + jnz gotheliframe + mov combatcount,0 + mov ax,9 + +gotheliframe: mov [es:bx+3],ax +helispeed: call showgamereel + mov al,mapx + mov [es:bx+1],al +helicombatend: mov ax,[es:bx+3] + cmp ax,9 ;8 + jnc notwaitingheli + cmp combatcount,7 + jc notwaitingheli + mov pointermode,2 + mov watchingtime,0 + ret +notwaitingheli: mov pointermode,0 + mov watchingtime,2 + ret + +heliwon: mov pointermode,0 + ret + + endp + + +Mugger proc near + + mov ax,[es:bx+3] + cmp ax,138 + jz endmugger1 + cmp ax,176 + jz endmugger2 + cmp ax,2 + jnz havesetwatch + mov watchingtime,175*2 +havesetwatch: call checkspeed + jnz notmugger + inc word ptr [es:bx+3] +notmugger: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + +endmugger1: push es bx + call createpanel2 + call showicon + mov al,41 + call findpuztext + mov di,33+20 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreen + mov cx,300 + call hangon + pop bx es + push es bx + mov word ptr [es:bx+3],140 + mov manspath,2 + mov finaldest,2 + call findxyfrompath + mov resetmanxy,1 + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + call makemainscreen + mov al,48 + mov bl,68-32 + mov bh,54+64 + mov cx,70 ; time on screen + mov dx,10 ; pause before show + call setuptimeduse + mov beenmugged,1 + pop bx es + ret + +endmugger2: ret + + + endp + + + + + + + + +Aide proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Businessman proc near + + mov pointermode,0 + mov watchingtime,2 + mov ax,[es:bx+3] + cmp ax,2 + jnz notfirstbiz + push ax bx es + mov al,49 + mov cx,30 + mov dx,1 + mov bl,68 + mov bh,174 + call setuptimeduse + pop es bx ax + +notfirstbiz: cmp ax,95 + jz buscombatwonend + cmp ax,49 + jz buscombatend + + call checkspeed + jnz busspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,48 + jnz notbeforedeadb + mov mandead,2 + jmp gotbusframe + +notbeforedeadb: cmp ax,15 + jnz buscombatwon + dec ax + cmp lastweapon,3 + jnz notshieldonbus + mov lastweapon,-1 + mov combatcount,0 + mov ax,51 + jmp gotbusframe +notshieldonbus: inc combatcount + cmp combatcount,20 + jnz gotbusframe + mov combatcount,0 + mov ax,15 + jmp gotbusframe + +buscombatwon: cmp ax,91 + jnz gotbusframe + push bx es + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,3 + call turnpathoff + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + pop es bx + mov ax,92 + jmp gotbusframe + +gotbusframe: mov [es:bx+3],ax +busspeed: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,14 + jnz buscombatend + mov watchingtime,0 + mov pointermode,2 + ret + +buscombatend: ret + +buscombatwonend: mov pointermode,0 + mov watchingtime,0 + ret + + endp + + + + + + +Poolguard proc near + + mov ax,[es:bx+3] + cmp ax,214 + jz combatover2 + cmp ax,258 + jz combatover2 + cmp ax,185 + jz combatover1 + cmp ax,0 + jnz notfirstpool + mov al,0 + call turnpathon +notfirstpool: call checkspeed + jnz guardspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,122 + jnz notendguard1 + dec ax + cmp lastweapon,2 + jnz notaxeonpool + mov lastweapon,-1 + mov ax,122 + jmp gotguardframe +notaxeonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,195 + jmp gotguardframe + +notendguard1: cmp ax,147 + jnz gotguardframe + dec ax + cmp lastweapon,1 + jnz notgunonpool + mov lastweapon,-1 + mov ax,147 + jmp gotguardframe +notgunonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,220 + +gotguardframe: mov [es:bx+3],ax +guardspeed: call showgamereel + mov ax,[es:bx+3] + cmp ax,121 + jz iswaitingpool + cmp ax,146 + jz iswaitingpool + mov pointermode,0 + mov watchingtime,2 + ret +iswaitingpool: mov pointermode,2 + mov watchingtime,0 + ret + +combatover1: mov watchingtime,0 + mov pointermode,0 + mov al,0 + call turnpathon + mov al,1 + call turnpathoff + ret + +combatover2: call showgamereel + mov watchingtime,2 + mov pointermode,0 + inc combatcount + cmp combatcount,100 + jc doneover2 + mov watchingtime,0 + mov mandead,2 +doneover2: ret + + endp + + + + + + + + + + +Security proc near + + cmp word ptr [es:bx+3],32 + jz securwait + cmp word ptr [es:bx+3],69 + jnz notaftersec + ret +notaftersec: mov watchingtime,10 + call checkspeed + jnz gotsecurframe + inc word ptr [es:bx+3] + jmp gotsecurframe +securwait: cmp lastweapon,1 + jnz gotsecurframe + mov watchingtime,10 + cmp manspath,9 + jnz gotsecurframe + cmp facing,0 + jnz gotsecurframe + mov lastweapon,-1 + inc word ptr [es:bx+3] +gotsecurframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Heavy proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + cmp word ptr [es:bx+3],43 + jz heavywait + mov watchingtime,10 + cmp word ptr [es:bx+3],70 + jnz notafterhshot + inc combatcount + cmp combatcount,80 + jnz gotheavyframe + mov mandead,2 + jmp gotheavyframe +notafterhshot: call checkspeed + jnz gotheavyframe + inc word ptr [es:bx+3] + jmp gotheavyframe +heavywait: cmp lastweapon,1 + jnz gotheavyframe + cmp manspath,5 + jnz gotheavyframe + cmp facing,4 + jnz gotheavyframe + mov lastweapon,-1 + inc word ptr [es:bx+3] + mov combatcount,0 +gotheavyframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + +Bossman proc near + + call checkspeed + jnz notboss + mov ax,[es:bx+3] + inc ax + cmp ax,4 + jz firstdes + cmp ax,20 + jz secdes + cmp ax,41 + jnz gotallboss + mov ax,0 + inc gunpassflag + mov byte ptr [es:bx+7],10 + jmp gotallboss +firstdes: cmp gunpassflag,1 + jz gotallboss + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,10 + jc gotallboss + mov ax,0 + jmp gotallboss +secdes: cmp gunpassflag,1 + jz gotallboss + mov ax,0 +gotallboss: mov [es:bx+3],ax +notboss: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedboss + mov talkedtoboss,1 +nottalkedboss: ret + + endp + + + + + +Gamer proc near + + call checkspeed + jnz gamerfin +gameragain: call randomnum1 + and al,7 + cmp al,5 + jnc gameragain + add al,20 + cmp al,[es:bx+3] + jz gameragain + mov ah,0 + mov [es:bx+3],ax +gamerfin: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Sparkydrip proc near + + call checkspeed + jnz cantdrip + mov al,14 + mov ah,0 + call playchannel0 +cantdrip: ret + + endp + + + +Carparkdrip proc near + + call checkspeed + jnz cantdrip2 + mov al,14 + call playchannel1 +cantdrip2: ret + + endp + + + +Keeper proc near + + cmp keeperflag,0 + jnz notwaiting + cmp reeltowatch,190 + jc waiting + inc keeperflag + mov ah,[es:bx+7] + and ah,127 + cmp ah,dreamnumber + jz notdiff + mov al,dreamnumber + mov [es:bx+7],al +notdiff: ret +notwaiting: call addtopeoplelist + call showgamereel +waiting: ret + + endp + + + +Candles1 proc near + + call checkspeed + jnz candle1 + mov ax,[es:bx+3] + inc ax + cmp ax,44 + jnz notendcandle1 + mov ax,39 +notendcandle1: mov [es:bx+3],ax +candle1: call showgamereel + ret + + endp + + + +Smallcandle proc near + + call checkspeed + jnz smallcandlef + mov ax,[es:bx+3] + inc ax + cmp ax,37 + jnz notendsmallcandle + mov ax,25 +notendsmallcandle: mov [es:bx+3],ax +smallcandlef: call showgamereel + ret + + endp + + + + + + + + + + + +Intromagic1 proc near + + call checkspeed + jnz introm1fin + mov ax,[es:bx+3] + inc ax + cmp ax,145 + jnz gotintrom1 + mov ax,121 +gotintrom1: mov [es:bx+3],ax + cmp ax,121 + jnz introm1fin + inc introcount + push es bx + call intro1text + pop bx es + cmp introcount,8 ; was 7 + jnz introm1fin + add mapy,10 + mov nowinnewroom,1 +introm1fin: call showgamereel + ret + + endp + + + + +Candles proc near + + call checkspeed + jnz candlesfin + mov ax,[es:bx+3] + inc ax + cmp ax,167 + jnz gotcandles + mov ax,162 +gotcandles: mov [es:bx+3],ax +candlesfin: call showgamereel + ret + + endp + + + +Candles2 proc near + + call checkspeed + jnz candles2fin + mov ax,[es:bx+3] + inc ax + cmp ax,238 + jnz gotcandles2 + mov ax,233 +gotcandles2: mov [es:bx+3],ax +candles2fin: call showgamereel + ret + + endp + + + +Gates proc near + + call checkspeed + jnz gatesfin + mov ax,[es:bx+3] + inc ax + cmp ax,116 + jnz notbang + push ax bx es + mov al,17 ;12 + call playchannel1 + pop es bx ax +notbang: cmp ax,110 + jc slowgates + mov byte ptr [es:bx+5],2 +slowgates: cmp ax,120 + jnz gotgates + mov getback,1 + mov ax,119 +gotgates: mov [es:bx+3],ax + push es bx + call intro3text + pop bx es +gatesfin: call showgamereel + ret + + endp + + + + +Intromagic2 proc near + + call checkspeed + jnz introm2fin + mov ax,[es:bx+3] + inc ax + cmp ax,216 + jnz gotintrom2 + mov ax,192 +gotintrom2: mov [es:bx+3],ax +introm2fin: call showgamereel + ret + + endp + + + + +Intromagic3 proc near + + call checkspeed + jnz introm3fin + mov ax,[es:bx+3] + inc ax + cmp ax,218 + jnz gotintrom3 + mov getback,1 +gotintrom3: mov [es:bx+3],ax +introm3fin: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + + endp + + + + + + + +Intromonks1 proc near + + call checkspeed + jnz intromonk1fin + mov ax,[es:bx+3] + inc ax + cmp ax,80 + jnz notendmonk1 + add mapy,10 + mov nowinnewroom,1 + call showgamereel + ret +notendmonk1: cmp ax,30 + jnz gotintromonk1 + sub mapy,10 + mov nowinnewroom,1 + mov ax,51 +gotintromonk1: mov [es:bx+3],ax + cmp ax,5 + jz waitstep + cmp ax,15 + jz waitstep + cmp ax,25 + jz waitstep + cmp ax,61 + jz waitstep + cmp ax,71 + jz waitstep + jmp intromonk1fin +waitstep: push es bx + call intro2text + pop bx es + mov byte ptr [es:bx+6],-20 +intromonk1fin: call showgamereel + mov al,mapy + mov [es:bx+2],al + ret + + endp + + + + +Intromonks2 proc near + + call checkspeed + jnz intromonk2fin + mov ax,[es:bx+3] + inc ax + cmp ax,87 + jnz nottalk1 + inc introcount + push es bx + call monks2text + pop bx es + cmp introcount,19 + jnz notlasttalk1 + mov ax,87 + jmp gotintromonk2 +notlasttalk1: mov ax,74 + jmp gotintromonk2 + +nottalk1: cmp ax,110 + jnz notraisearm + inc introcount + push es bx + call monks2text + pop bx es + if cd + if german + cmp introcount,42 + else + cmp introcount,35 + endif + else + cmp introcount,35 + endif + jnz notlastraise + mov ax,111 + jmp gotintromonk2 +notlastraise: mov ax,98 + jmp gotintromonk2 + +notraisearm: cmp ax,176 + jnz notendmonk2 + mov getback,1 + jmp gotintromonk2 +notendmonk2: cmp ax,125 + jnz gotintromonk2 + mov ax,140 +gotintromonk2: mov [es:bx+3],ax +intromonk2fin: call showgamereel + ret + + endp + + + + + +Handclap proc near + + ret + + endp + + + + + if german + if cd + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,5 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,9 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,13 + jnz notmonk2text4 + mov introcount,14 + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,23 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,27 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: cmp introcount,30 + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,35 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + + endif + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + endif + + + + + + +Intro1text proc near + + cmp introcount,2 + jnz notintro1text1 + mov al,40 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text1: cmp introcount,4 + jnz notintro1text2 + mov al,41 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text2: cmp introcount,6 + jnz notintro1text3 + mov al,42 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text3: ret + +gotintro1text: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk2 + dec introcount + ret + endif +oktalk2: call setuptimedtemp + ret + + endp + + + +Intro2text proc near + + cmp ax,5 + jnz notintro2text1 + mov al,43 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text1: cmp ax,15 + jnz notintro2text2 + mov al,44 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text2: ret + +gotintro2text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + +Intro3text proc near + + cmp ax,107 + jnz notintro3text1 + mov al,45 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text1: if cd + cmp ax,108 + else + cmp ax,109 + endif + jnz notintro3text2 + mov al,46 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text2: ret + +gotintro3text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + + +Monkandryan proc near + + call checkspeed + jnz notmonkryan + mov ax,[es:bx+3] + inc ax + cmp ax,83 + jnz gotmonkryan + inc introcount + push es bx + call textformonk + pop bx es + mov ax,77 + cmp introcount,57 + jnz gotmonkryan + mov getback,1 + ret +gotmonkryan: mov [es:bx+3],ax +notmonkryan: call showgamereel + ret + + endp + + + + + +Endgameseq proc near + + call checkspeed + jnz notendseq + mov ax,[es:bx+3] + inc ax + cmp ax,51 + jnz gotendseq + cmp introcount,140 + jz gotendseq + inc introcount + push es bx + call textforend + pop bx es + mov ax,50 +gotendseq: mov [es:bx+3],ax + cmp ax,134 + jnz notfadedown + push es bx ax + call fadescreendownhalf + pop ax bx es + jmp notendseq +notfadedown: cmp ax,324 + jnz notfadeend + push es bx ax + call fadescreendowns + mov volumeto,7 + mov volumedirection,1 + pop ax bx es +notfadeend: cmp ax,340 + jnz notendseq + mov getback,1 +notendseq: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,145 + jnz notendcreds + mov word ptr [es:bx+3],146 + call rollendcredits +notendcreds: ret + + endp + + + + + + +Rollendcredits proc near + + mov al,16 + mov ah,255 + call playchannel0 + mov volume,7 + mov volumeto,0 + mov volumedirection,-1 + + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,3*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,254 +endcredits1: push cx + + mov bx,10 + mov cx,linespacing +endcredits2: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot: push cx + mov di,75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + call multidump + + pop bx es di si cx + dec bx + loop endcredits2 + pop cx +looknext: mov al,[es:si] + inc si + cmp al,":" + jz gotnext + cmp al,0 + jz gotnext + jmp looknext +gotnext: loop endcredits1 + + mov cx,100 + call hangon + call paneltomap + call fadescreenuphalf + ret + + endp + + + + + + +Priest proc near + + cmp word ptr [es:bx+3],8 + jz priestspoken + mov pointermode,0 + mov watchingtime,2 + call checkspeed + jnz priestwait + inc word ptr [es:bx+3] + push es bx + call priesttext + pop bx es +priestwait: ret + +priestspoken: ret + + endp + + + + + + +Madmanstelly proc near + + mov ax,[es:bx+3] + inc ax + cmp ax,307 + jnz notendtelly + mov ax,300 +notendtelly: mov [es:bx+3],ax + call showgamereel + ret + + endp + + + + + +Madman proc near + + mov watchingtime,2 + call checkspeed + jnz nomadspeed + mov ax,[es:bx+3] + cmp ax,364 + jnc ryansded + cmp ax,10 + jnz notfirstmad + push es bx ax + mov dx,offset cs:introtextname + call loadtemptext + pop ax bx es + mov combatcount,-1 + mov speechcount,0 +notfirstmad: inc ax + cmp ax,294 + jz madmanspoken + cmp ax,66 + jnz nomadspeak + inc combatcount + push es bx + call madmantext + pop bx es + mov ax,53 + if cd + cmp combatcount,64 + else + cmp combatcount,62 + endif + jc nomadspeak + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jz killryan + cmp lastweapon,8 + jnz nomadspeak + if cd + mov combatcount,72 + else + mov combatcount,70 + endif + mov lastweapon,-1 + mov madmanflag,1 + mov ax,67 + jmp nomadspeak +killryan: mov ax,310 +nomadspeak: mov [es:bx+3],ax +nomadspeed: call showgamereel + mov al,mapx + mov [es:bx+1],al + call madmode + ret +madmanspoken: cmp wongame,1 + jz alreadywon + mov wongame,1 + push es bx + call getridoftemptext + pop bx es +alreadywon: ret + +ryansded: mov mandead,2 + call showgamereel + ret + + endp + + + + + + + + + + if cd +Madmantext proc near + + cmp speechcount,63 + jnc nomadtext + cmp ch1playing,255 + jnz nomadtext + + mov al,speechcount + inc speechcount + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + + else + +Madmantext proc near + + cmp combatcount,61 + jnc nomadtext + mov al,combatcount + and al,3 + jnz nomadtext + mov al,combatcount + shr al,1 + shr al,1 + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + endif + + + + +Madmode proc near + + mov watchingtime,2 + mov pointermode,0 + if cd + cmp combatcount,65 + else + cmp combatcount,63 + endif + jc iswatchmad + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jnc iswatchmad + mov pointermode,2 +iswatchmad: ret + + endp + + + + + +Priesttext proc near + + cmp word ptr [es:bx+3],2 + jc nopriesttext + cmp word ptr [es:bx+3],7 + jnc nopriesttext + mov al,[es:bx+3] + and al,1 + jnz nopriesttext + mov al,[es:bx+3] + shr al,1 + add al,50 + mov bl,72 + mov bh,80 + mov cx,54 + mov dx,1 + call setuptimeduse +nopriesttext: ret + + endp + + + + +Textforend proc near + + cmp introcount,20 + jnz notendtext1 + mov al,0 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext1: if cd + cmp introcount,50 + else + cmp introcount,65 + endif + jnz notendtext2 + mov al,1 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext2: if cd + cmp introcount,85 + else + cmp introcount,110 + endif + jnz notendtext3 + mov al,2 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext3: ret + +gotendtext: mov dx,1 + mov ah,83 + call setuptimedtemp + ret + + endp + + + + + + + + +Textformonk proc near + + cmp introcount,1 + jnz notmonktext1 + mov al,19 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext1: cmp introcount,5 + jnz notmonktext2 + mov al,20 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext2: cmp introcount,9 + jnz notmonktext3 + mov al,21 + mov bl,48 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext3: cmp introcount,13 + jnz notmonktext4 + mov al,22 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext4: if cd + cmp introcount,15 + else + cmp introcount,17 + endif + jnz notmonktext5 + mov al,23 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext5: cmp introcount,21 + jnz notmonktext6 + mov al,24 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext6: cmp introcount,25 + jnz notmonktext7 + mov al,25 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext7: cmp introcount,29 + jnz notmonktext8 + mov al,26 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext8: cmp introcount,33 + jnz notmonktext9 + mov al,27 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext9: cmp introcount,37 + jnz notmonktext10 + mov al,28 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext10: cmp introcount,41 + jnz notmonktext11 + mov al,29 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext11: cmp introcount,45 + jnz notmonktext12 + mov al,30 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext12: if cd + cmp introcount,52 + else + cmp introcount,49 + endif + jnz notmonktext13 + mov al,31 + mov bl,68 + mov bh,154 + mov cx,220 ;132 + jmp gotmonktext +notmonktext13: cmp introcount,53 + jnz notendtitles + call fadescreendowns + if cd + mov volumeto,7 + mov volumedirection,1 + endif +notendtitles: ret + +gotmonktext: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk + dec introcount + ret + endif +oktalk: call setuptimedtemp + ret + + endp + + + + + + + + + + +Drunk proc near + + cmp generaldead,0 + jnz trampgone + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist +trampgone: ret + + endp + + +Advisor proc near + + call checkspeed + jnz noadvisor + jmp noadvisor + mov ax,[es:bx+3] + inc ax + cmp ax,123 + jnz notendadvis + mov ax,106 + jmp gotadvframe +notendadvis: cmp ax,108 + jnz gotadvframe + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,3 + jc gotadvframe + mov ax,106 +gotadvframe: mov [es:bx+3],ax +noadvisor: call showgamereel + call addtopeoplelist + ret + + endp + + + +Copper proc near + + call checkspeed + jnz nocopper + mov ax,[es:bx+3] + inc ax + cmp ax,94 + jnz notendcopper + mov ax,64 + jmp gotcopframe +notendcopper: cmp ax,81 + jz mightwait + cmp ax,66 + jnz gotcopframe +mightwait: push ax + call randomnumber + mov cl,al + pop ax + cmp cl,7 + jc gotcopframe + dec ax +gotcopframe: mov [es:bx+3],ax +nocopper: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Sparky proc near + + cmp card1money,0 + jz animsparky + mov byte ptr [es:bx+7],3 + jmp animsparky + +animsparky: call checkspeed + jnz finishsparky + cmp word ptr [es:bx+3],34 + jnz notsparky1 + call randomnumber + cmp al,30 + jc dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +notsparky1: cmp word ptr [es:bx+3],48 + jnz dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +dosparky: inc word ptr [es:bx+3] +finishsparky: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedsparky + mov talkedtosparky,1 +nottalkedsparky: ret + + endp + + + + + +Train proc near + + ret + mov ax,[es:bx+3] + cmp ax,21 + jnc notrainyet + inc ax + jmp gottrainframe +notrainyet: call randomnumber + cmp al,253 + jc notrainatall + cmp manspath,5 + jnz notrainatall + cmp finaldest,5 + jnz notrainatall + mov ax,5 +gottrainframe: mov [es:bx+3],ax + call showgamereel +notrainatall: ret + + endp + + + + + + + +Addtopeoplelist proc near + + push es bx bx + mov cl,[es:bx+7] + mov ax,[es:bx+3] + mov bx,listpos + mov es,buffers + mov [es:bx],ax ;reel pointer position + pop ax + mov [es:bx+2],ax + mov [es:bx+4],cl ;coversation number + pop bx es + add listpos,5 + ret + + endp + + + +Showgamereel proc near + + mov ax,[es:bx+3] + cmp ax,512 + jnc noshow + mov reelpointer,ax + push es bx + call plotreel + pop bx es + mov ax,reelpointer + mov [es:bx+3],ax +noshow: ret + + endp + + + + + + +Checkspeed proc near + + cmp lastweapon,-1 + jnz forcenext + inc byte ptr [es:bx+6] + mov al,[es:bx+6] + cmp al,[es:bx+5] + jnz notspeed + mov al,0 + mov [es:bx+6],al + cmp al,al +notspeed: ret + +forcenext: cmp al,al + ret + + endp + + + + + + + + + + +;------------------------------------------------------------Sprite Routines---- + + + +Clearsprites proc near + + mov es,buffers + mov di,spritetable + mov al,255 + mov cx,tablesize*16 + rep stosb + ret + + endp + + + + +Makesprite proc near ;si holds x,y cx holds update + ;di,dx holds data offset,seg + mov es,buffers + mov bx,spritetable +$17: cmp byte ptr [es:bx+15],255 + jz $17a + add bx,tablesize + jmp $17 + +$17a: mov [es:bx],cx + mov [es:bx+10],si + mov [es:bx+6],dx + mov [es:bx+8],di + mov [es:bx+2],0ffffh + mov byte ptr [es:bx+15],0 + mov byte ptr [es:bx+18],0 + ret + + endp + + + + + + + + + + +Delsprite proc near + + mov di,bx + mov cx,tablesize + mov al,255 + rep stosb + ret + + endp + + + + + + + + + + +Spriteupdate proc near + + mov es,buffers + mov bx,spritetable + mov al,ryanon + mov byte ptr [es:bx+31],al + + mov es,buffers + mov bx,spritetable + mov cx,16 +$18: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz $18a + push es ds + mov cx,[es:bx+2] + mov [es:bx+24],cx + call ax + pop ds es +$18a: pop bx cx + cmp nowinnewroom,1 + jz $18b + add bx,tablesize + loop $18 + +$18b: ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Printsprites proc near + + mov es,buffers + mov cx,0 +priorityloop: push cx + mov priority,cl + mov bx,spritetable + mov cx,16 +prtspriteloop: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz skipsprite + mov al,priority + cmp al,[es:bx+23] + jnz skipsprite + cmp byte ptr [es:bx+31],1 + jz skipsprite + call printasprite +skipsprite: pop bx cx + add bx,tablesize + loop prtspriteloop + pop cx + inc cx + cmp cx,7 + jnz priorityloop + ret + + endp + + + + + + + + + + +Printasprite proc near + + push es bx + mov si,bx + mov ds,[es:si+6] + mov al,[es:si+11] + mov ah,0 + cmp al,220 + jc notnegative1 + mov ah,255 +notnegative1: mov bx,ax + add bx,mapady + mov al,[es:si+10] + mov ah,0 + cmp al,220 + jc notnegative2 + mov ah,255 +notnegative2: mov di,ax + add di,mapadx + mov al,[es:si+15] + mov ah,0 + cmp byte ptr [es:si+30],0 + jz steadyframe + mov ah,8 +steadyframe: cmp priority,6 + jnz notquickp +notquickp: call showframe + pop bx es + ret + + endp + + + + +;cmp priority,6 +; ;jz quicksprite ; WIll NEED TO DO THIS LATER!!!!! +;Quicksprite: mov cl,al +; mov ch,0 +; mov dx,[es:bx+6] +; mov es,workspace +; mov ds,dx +; mov bx,ax +; mov dx,vgawidth +; +;printquickloop: push di si +; +; push si +; add si,cx +; dec si +; jmp startzero +;zeroloop: dec si +; dec cl +;startzero: cmp [si],ch +; jz zeroloop +; pop si +; +;;printquickline: cmp [si],ch +; jnz foundfirstpix +; inc si +; inc di +; dec cl +; jnz printquickline +; +;foundfirstpix: cmp cl,0 +; jz finquickspr +; rep movsb +; +;finquickspr: pop si di +; mov cl,bl +; add si,cx +; add di,dx +; dec bh +; jnz printquickloop +; +; pop bx ds es +; ret + + + + + + + +;Calcframe proc near +; +; ret +; +; mov al,[es:bx+15] +; mov ah,0 +; mov cx,6 +; mul cx +; add ax,[es:bx+8] +; +; mov dx,[es:bx+6] +; push bx +; mov ds,dx +; mov bx,ax +; mov ax,[bx] +; mov cx,[bx+2] +; mov dx,[bx+4] +; pop bx +; mov [es:bx+2],ax +; add cx,[es:bx+8] +; add cx,2080 +; mov [es:bx+4],cx ;calculates frame data +; +; mov al,[es:bx+10] ;this bit calculates the actual +; add al,dl ;x and y (including any offset) +; mov [es:bx+12],al +; mov al,[es:bx+11] +; add al,dh +; mov [es:bx+13],al +; ret +; +; endp + + + + + + + + + + + + + + + + + + + + +Checkone proc near ;cx=x,y to check + + push cx + mov al,ch + mov ah,0 + mov cl,4 + shr ax,cl + mov dl,al + pop cx + mov al,cl + mov ah,0 + mov cl,4 + shr ax,cl + mov ah,dl ; al,ah holds x,y in blocks + + push ax + mov ch,0 + mov cl,al + push cx + mov al,ah + mov ah,0 + mov cx,11 + mul cx + pop cx + add ax,cx + + mov cx,3 + mul cx + mov si,ax + + mov ds,buffers + add si,mapflags + lodsw + mov cx,ax + lodsb + pop dx + ret + + + endp + + + + + + + + + + + + + + + + + + +Findsource proc near + + mov ax,currentframe + cmp ax,160 + jnc over1000 + mov ds,reel1 + mov takeoff,0 + ret +over1000: cmp ax,320 + jnc over1001 + mov ds,reel2 + mov takeoff,160 + ret +over1001: mov ds,reel3 + mov takeoff,320 + ret + + endp + + + + + + + + + + + +;---------------------------------------------------------Routines for Ryan---- + + +Initman proc near + + ;mov linepointer,254 + mov al,ryanx + mov ah,ryany + mov si,ax + mov cx,offset cs:mainman + mov dx,mainsprites + mov di,0 + call makesprite + mov byte ptr [es:bx+23],4 + mov byte ptr [es:bx+22],0 + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + +Mainman proc near + + cmp resetmanxy,1 + jnz notinnewroom + mov resetmanxy,0 + mov al,ryanx + mov ah,ryany + mov [es:bx+10],ax + mov byte ptr [es:bx+29],0 + jmp executewalk +notinnewroom: dec byte ptr [es:bx+22] + cmp byte ptr [es:bx+22],-1 + jz executewalk + ret + + +executewalk: mov byte ptr [es:bx+22],0 ; speed + mov al,turntoface + cmp al,facing + jz facingok + call aboutturn + jmp notwalk + +facingok: cmp turndirection,0 + jz alreadyturned + cmp linepointer,254 + jnz alreadyturned + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz alreadyturned + call checkforexit +alreadyturned: mov turndirection,0 + cmp linepointer,254 + jnz walkman + mov byte ptr [es:bx+29],0 + jmp notwalk + +walkman: mov al,[es:bx+29] + inc al + cmp al,11 + jnz notanimend1 + mov al,1 +notanimend1: mov [es:bx+29],al + + call walking + cmp linepointer,254 + jz afterwalk + + mov al,facing + and al,1 + jz isdouble + mov al,[es:bx+29] + cmp al,2 + jz afterwalk + cmp al,7 + jz afterwalk +isdouble: call walking +afterwalk: cmp linepointer,254 + jnz notwalk + mov al,turntoface + cmp al,facing + jnz notwalk + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz notwalk + call checkforexit + +notwalk: mov al,facing + mov ah,0 + mov di,offset cs:facelist + add di,ax + mov al,[cs:di] + add al,[es:bx+29] + mov [es:bx+15],al + mov ax,[es:bx+10] + mov ryanx,al + mov ryany,ah + ret + +facelist: db 0,60,33,71,11,82,22,93 + + endp + + + + + + + + + + +Aboutturn proc near + + cmp turndirection,1 + jz incdir + cmp turndirection,-1 + jz decdir + mov al,facing + sub al,turntoface + jnc higher + neg al + cmp al,4 + jnc decdir + jmp incdir +higher: cmp al,4 + jnc incdir + jmp decdir + +incdir: mov turndirection,1 + mov al,facing + inc al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + +decdir: mov turndirection,-1 + mov al,facing + dec al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + + +Walking proc near + + cmp linedirection,0 + jz normalwalk + mov al,linepointer + dec al + mov linepointer,al + cmp al,200 + jnc endofline + jmp continuewalk + +normalwalk: mov al,linepointer + inc al + mov linepointer,al + cmp al,linelength + jnc endofline + +continuewalk: mov ah,0 + add ax,ax + push es bx + mov dx,seg linedata + mov es,dx + mov bx,offset es:linedata + add bx,ax + mov ax,[es:bx] + pop bx es +stillline: mov [es:bx+10],ax + ret + +endofline: mov linepointer,254 + mov al,destination + mov manspath,al + cmp al,finaldest + jz finishedwalk + mov al,finaldest + mov destination,al + push es bx + call autosetwalk + pop bx es + ret + +finishedwalk: call facerightway + ret + + endp + + + + + + + +Facerightway proc near + + push es bx ;Face object when finished + call getroomspaths ;walking + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+7] + mov turntoface,al + mov leavedirection,al + pop bx es + ret + + endp + + + + + + + +Checkforexit proc near + + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + mov lastflag,cl + mov lastflagex,ch + mov flagx,dl + mov flagy,dh + mov al,lastflag + + test al,64 + jz notnewdirect + mov al,lastflagex + mov autolocation,al + ret + +notnewdirect: test al,32 + jz notleave + push es bx + cmp reallocation,2 + jnz notlouis + mov bl,0 + push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call isryanholding + pop bx + jz noshoe1 + inc bl +noshoe1: push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call isryanholding + pop bx + jz noshoe2 + inc bl +noshoe2: cmp bl,2 + jz notlouis + mov al,42 + cmp bl,0 + jz notravmessage + inc al +notravmessage: mov cx,80 + mov dx,10 + mov bl,68 + mov bh,64 + call setuptimeduse + mov al,facing + add al,4 + and al,7 + mov turntoface,al + pop bx es + ret + +notlouis: pop bx es + mov needtotravel,1 + ret + + + +notleave: test al,4 + jz notaleft + call adjustleft + ret + +notaleft: test al,2 + jz notaright + call adjustright + ret + +notaright: test al,8 + jz notadown + call adjustdown + ret + +notadown: test al,16 + jz notanup + call adjustup + ret + +notanup: ret + + endp + + + + + +Adjustdown proc near + + push es bx + add mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + +Adjustup proc near + + push es bx + sub mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Adjustleft proc near + + push es bx + mov lastflag,0 + sub mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + + +Adjustright proc near + + push es bx + add mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + sub al,2 + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Reminders proc nar + + cmp reallocation,24 + jnz notinedenslift + cmp mapx,44 + jnz notinedenslift + cmp progresspoints,0 + jnz notfirst + mov al,"D" + mov ah,"K" + mov cl,"E" + mov ch,"Y" + call isryanholding + jz forgotone + mov al,"C" + mov ah,"S" + mov cl,"H" + mov ch,"R" + call findexobject + cmp al,numexobjects + jz forgotone + mov ax,[es:bx+2] + cmp al,4 + jnz forgotone ;card is in inventory + cmp ah,255 + jz havegotcard ;card must be in an ex + mov cl,"P" ;object + mov ch,"U" + mov dl,"R" + mov dh,"S" + xchg al,ah + call compare + jnz forgotone ;is it in wallet? +havegotcard: inc progresspoints +notfirst: ret + +forgotone: mov al,50 ;message number + mov bl,54 ;x pos of message + mov bh,70 ;and y pos + mov cx,48 ;time on screen + mov dx,8 ;pause before show + call setuptimeduse + ret +notinedenslift: ret + + endp + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for rain effect +; +;--------------------------------------------------------------------------- + + + + +Initrain proc near + + mov es,buffers + mov di,rainlist + mov bx,offset cs:rainlocations +checkmorerain: mov al,[cs:bx] + cmp al,255 + jz finishinitrain + cmp al,reallocation + jnz checkrain + mov al,[cs:bx+1] + cmp al,mapx + jnz checkrain + mov al,[cs:bx+2] + cmp al,mapy + jnz checkrain + mov al,[cs:bx+3] + mov rainspace,al + jmp dorain +checkrain: add bx,4 + jmp checkmorerain + +dorain: mov cx,4 +initraintop: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initraintop + add cl,al + cmp cl,mapxsize + jnc initrainside + push cx + call splitintolines + pop cx + jmp initraintop + +initrainside: mov cl,mapxsize + dec cl +initrainside2: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initrainside2 + add ch,al + cmp ch,mapysize + jnc finishinitrain + push cx + call splitintolines + pop cx + jmp initrainside2 +finishinitrain: mov al,255 + stosb + ret + +rainlocations: db 1,44,10,16 ;location,map x,y,seed + db 4,11,30,14 + db 4,22,30,14 + db 3,33,10,14 + db 10,33,30,14 + db 10,22,30,24 + db 9,22,10,14 + db 2,33,0,14 + db 2,22,0,14 + db 6,11,30,14 + db 7,11,20,18 + db 7,0,20,18 + db 7,0,30,18 + db 55,44,0,14 + db 5,22,30,14 + + db 8,0,10,18 + db 8,11,10,18 + db 8,22,10,18 + db 8,33,10,18 + db 8,33,20,18 + db 8,33,30,18 + db 8,33,40,18 + db 8,22,40,18 + db 8,11,40,18 + + db 21,44,20,18 + db 255 + + endp + + + + + + + + + + +Splitintolines proc near + + +lookforlinestart: call getblockofpixel + cmp al,0 + jnz foundlinestart + dec cl + inc ch + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +foundlinestart: mov [es:di],cx + mov bh,1 +lookforlineend: call getblockofpixel + cmp al,0 + jz foundlineend + dec cl + inc ch + cmp cl,0 + jz foundlineend + cmp ch,mapysize + jnc foundlineend + inc bh + jmp lookforlineend + +foundlineend: push cx + mov [es:di+2],bh + call randomnumber + mov [es:di+3],al + call randomnumber + mov [es:di+4],al + call randomnumber + and al,3 + add al,4 + mov [es:di+5],al + add di,6 + pop cx + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +endofthisline: ret + + endp + + + + +Getblockofpixel proc near + + push cx es di + mov ax,mapxstart + add cl,al + mov ax,mapystart + add ch,al + call checkone + and cl,1 + jnz failrain + pop di es cx + ret +failrain: pop di es cx + mov al,0 + ret + + endp + + + + +Showrain proc near + + mov ds,mainsprites + mov si,6*58 + mov ax,[si+2] + mov si,ax + add si,2080 + + mov bx,rainlist + mov es,buffers + cmp byte ptr [es:bx],255 + jz nothunder + +morerain: mov es,buffers + cmp byte ptr [es:bx],255 + jz finishrain + + mov al,[es:bx+1] + mov ah,0 + add ax,mapady + add ax,mapystart + mov cx,320 + mul cx + mov cl,[es:bx] + mov ch,0 + add ax,cx + add ax,mapadx + add ax,mapxstart + mov di,ax + + mov cl,[es:bx+2] + mov ch,0 + mov ax,[es:bx+3] + mov dl,[es:bx+5] + mov dh,0 + sub ax,dx + and ax,511 + mov [es:bx+3],ax + add bx,6 + + push si + add si,ax + mov es,workspace + mov ah,0 + mov dx,320-2 +rainloop: lodsb + cmp al,ah + jz noplot + stosb + add di,dx + loop rainloop + pop si + jmp morerain +noplot: add di,320-1 + loop rainloop + pop si + jmp morerain + +finishrain: cmp ch1blockstocopy,0 + jnz nothunder + cmp reallocation,2 + jnz notlouisthund + cmp beenmugged,1 + jnz nothunder +notlouisthund: cmp reallocation,55 + jz nothunder + call randomnum1 + cmp al,1 + jnc nothunder + mov al,7 + cmp ch0playing,6 + jz isthunder1 + mov al,4 +isthunder1: call playchannel1 +nothunder: ret + + endp + + + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for background objects +; +;--------------------------------------------------------------------------- + + + + + + +Backobject proc near + + mov ds,setdat + mov di,[es:bx+20] + + mov al,[es:bx+18] + cmp al,0 + jz $48z + dec al + mov [es:bx+18],al + jmp finishback + +$48z: mov al,[di+7] + mov [es:bx+18],al + mov al,[di+8] + cmp al,6 + jnz notwidedoor + call widedoor + jmp finishback + +notwidedoor: cmp al,5 + jnz notrandom + call random + jmp finishback + +notrandom: cmp al,4 + jnz notlockdoor + call lockeddoorway + jmp finishback + +notlockdoor: cmp al,3 + jnz notlift + call liftsprite + jmp finishback + +notlift: cmp al,2 + jnz notdoor + call doorway + jmp finishback + +notdoor: cmp al,1 + jnz steadyob + call constant + jmp finishback + +steadyob: call steady + +finishback: ;call calcframe + ret + + endp + + + + + + + + + +Liftsprite proc near + + mov al,liftflag + cmp al,0 + jz liftclosed + cmp al,1 + jz liftopen + cmp al,3 + jz openlift + + mov al,[es:bx+19] + cmp al,0 + jz finishclose + dec al + cmp al,11 + jnz pokelift + push ax + mov al,3 + call liftnoise + pop ax + jmp pokelift +finishclose: mov liftflag,0 + ret + +openlift: mov al,[es:bx+19] + cmp al,12 + jz endoflist + inc al + cmp al,1 + jnz pokelift + push ax + mov al,2 + call liftnoise + pop ax +pokelift: mov [es:bx+19],al + mov ah,0 + push di + add di,ax + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + ret + +endoflist: mov liftflag,1 + ret + +liftopen: mov al,liftpath + push es bx + call turnpathon + pop bx es + cmp counttoclose,0 + jz nocountclose + dec counttoclose + cmp counttoclose,0 + jnz nocountclose + mov liftflag,2 +nocountclose: mov al,12 + jmp pokelift + +liftclosed: mov al,liftpath + push es bx + call turnpathoff + pop bx es + cmp counttoopen,0 + jz nocountopen + dec counttoopen + cmp counttoopen,0 + jnz nocountopen + mov liftflag,3 +nocountopen: mov al,0 + jmp pokelift + + endp + + +Liftnoise proc near + + cmp reallocation,5 + jz hissnoise + cmp reallocation,21 + jz hissnoise + call playchannel1 + ret +hissnoise: if demo + mov al,25 + else + mov al,13 + endif + call playchannel1 + ret + + endp + + + + +Random proc near + + call randomnum1 + push di + and ax,7 + add di,18 + add di,ax + mov al,[di] + pop di + mov [es:bx+15],al + ret + + endp + + + + + + + + +Steady proc near + + mov al,[di+18] + mov [di+17],al + mov [es:bx+15],al + ret + + endp + + + + + +Constant proc near + + inc byte ptr [es:bx+19] + mov cl,[es:bx+19] + mov ch,0 + add di,cx + cmp byte ptr [di+18],255 + jnz gotconst + sub di,cx + mov cx,0 + mov [es:bx+19],cl +gotconst: mov al,[di+18] + sub di,cx + mov [es:bx+15],al + mov [di+17],al + ret + + endp + + + + + + + + + + + + + + +Doorway proc near + + mov doorcheck1,-24 + mov doorcheck2,10 + mov doorcheck3,-30 + mov doorcheck4,10 + call dodoor + ret + + endp + + + +Widedoor proc near + + mov doorcheck1,-24 + mov doorcheck2,24 + mov doorcheck3,-30 + mov doorcheck4,24 + call dodoor + ret + + endp + + + + + + + + + +Dodoor proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor + sub al,cl + cmp al,doorcheck1 + jnc upordown + jmp shutdoor +rtofdoor: sub al,cl + cmp al,doorcheck2 + jnc shutdoor + +upordown: cmp ah,ch + jnc botofdoor + sub ah,ch + cmp ah,doorcheck3 + jc shutdoor + jmp opendoor +botofdoor: sub ah,ch + cmp ah,doorcheck4 + jnc shutdoor + +opendoor: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough + cmp cl,0 + jnz notthrough + mov cl,6 +notthrough: inc cl + cmp cl,1 + jnz notdoorsound2 + mov al,0 + cmp reallocation,5 + jnz nothoteldoor2 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor2: call playchannel1 +notdoorsound2: mov ch,0 + + push di + add di,cx + mov al,[di+18] ; must be a better way than this + cmp al,255 + jnz atlast1 + dec di + dec cl +atlast1: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + mov throughdoor,1 + ret + + +shutdoor: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound1 + mov al,1 + cmp reallocation,5 + jnz nothoteldoor1 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor1: call playchannel1 +notdoorsound1: cmp cl,0 + jz atlast2 + dec cl + mov [es:bx+19],cl +atlast2: mov ch,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz notnearly + mov throughdoor,0 +notnearly: ret + + endp + + + + + + + + +Lockeddoorway proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor2 + sub al,cl + cmp al,-24 + jnc upordown2 + jmp shutdoor2 +rtofdoor2: sub al,cl + cmp al,10 + jnc shutdoor2 + +upordown2: cmp ah,ch + jnc botofdoor2 + sub ah,ch + cmp ah,-30 + jc shutdoor2 + jmp opendoor2 +botofdoor2: sub ah,ch + cmp ah,12 + jnc shutdoor2 + +opendoor2: cmp throughdoor,1 + jz mustbeopen + cmp lockstatus,1 + jz shutdoor +mustbeopen: mov cl,[es:bx+19] + cmp cl,1 + jnz notdoorsound4 + mov al,0 + call playchannel1 +notdoorsound4: cmp cl,6 ; was 3 + jnz noturnonyet + mov al,doorpath + push es bx + call turnpathon + pop bx es + +noturnonyet: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough2 + cmp cl,0 + jnz notthrough2 + mov cl,6 +notthrough2: inc cl + mov ch,0 + + push di + add di,cx + mov al,[di+18] + cmp al,255 + jnz atlast3 + dec di + dec cl +atlast3: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz justshutting + mov throughdoor,1 +justshutting: ret + + + +shutdoor2: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound3 + mov al,1 + call playchannel1 +notdoorsound3: cmp cl,0 + jz atlast4 + dec cl + mov [es:bx+19],cl +atlast4: mov ch,0 + mov throughdoor,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,0 ;1 + jnz notlocky + mov al,doorpath + push es bx + call turnpathoff + pop bx es + mov lockstatus,1 +notlocky: ret + + endp + + + + + + + + + + +;------------------------------------------------------------People handler---- + +Updatepeople proc near + + mov es,buffers + mov di,peoplelist + mov listpos,di + mov cx,12*5 + mov al,255 + rep stosb + + inc maintimer + push cs + pop es + mov bx,offset cs:reelroutines + mov di,offset cs:reelcalls +updateloop: mov al,[es:bx] + cmp al,255 + jz endupdate + cmp al,reallocation + jnz notinthisroom + mov cx,[es:bx+1] + cmp cl,mapx + jnz notinthisroom + cmp ch,mapy + jnz notinthisroom + push di + mov ax,[cs:di] + call ax + pop di +notinthisroom: add bx,8 + add di,2 + jmp updateloop +endupdate: ret + + endp + + + + + + + + + + + + + + +Getreelframeax proc near + + push ds + mov currentframe,ax + call findsource + push ds + pop es + pop ds + mov ax,currentframe + sub ax,takeoff + add ax,ax + mov cx,ax + add ax,ax + add ax,cx + mov bx,ax + ret + + endp + + + + + + + + + + +Reelsonscreen proc near + + call reconstruct + call updatepeople + call watchreel + call showrain + call usetimedtext + ret + + endp + + + + + + +Plotreel proc near + + call getreelstart +retryreel: push es si + mov ax,[es:si+2] + cmp al,220 + jc normalreel + cmp al,255 + jz normalreel + call dealwithspecial + inc reelpointer + pop si es + add si,40 + jmp retryreel + +normalreel: mov cx,8 +plotloop: push cx es si + mov ax,[es:si] + cmp ax,0ffffh + jz notplot + call showreelframe +notplot: pop si es cx + add si,5 + loop plotloop + call soundonreels + pop bx es + ret + + endp + + + + + +Soundonreels proc near + + mov bl,reallocation + add bl,bl + xor bh,bh + add bx,offset cs:roombyroom + mov si,[cs:bx] + +reelsoundloop: mov al,[cs:si] + cmp al,255 + jz endreelsound + mov ax,[cs:si+1] + cmp ax,reelpointer + jnz skipreelsound + + cmp ax,lastsoundreel + jz skipreelsound + + mov lastsoundreel,ax + mov al,[cs:si] + cmp al,64 + jc playchannel1 + cmp al,128 + jc channel0once + and al,63 + mov ah,255 + jmp playchannel0 +channel0once: and al,63 + mov ah,0 + jmp playchannel0 +skipreelsound: add si,3 + jmp reelsoundloop +endreelsound: mov ax,lastsoundreel + cmp ax,reelpointer + jz nochange2 + mov lastsoundreel,-1 +nochange2: ret + +roombyroom dw r0,r1,r2,r0,r0,r0,r6,r0,r8,r9,r10,r11,r12,r13,r14,r0,r0,r0,r0,r0 + dw r20,r0,r22,r23,r0,r25,r26,r27,r28,r29,r0,r0,r0,r0,r0 + dw r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r45,r46,r47,r0,r0,r0,r0,r52,r53,r0,r55 + +r0 db 255 + +r1 db 15 + dw 257 + db 255 + +r2 db 12 + dw 5 + db 13 + dw 21 + db 15 ;hitting floor? + dw 35 + db 17 + dw 50 + db 18 + dw 103 + db 19 + dw 108 + db 255 + +r6 db 18 + dw 19 + db 19 + dw 23 + db 255 + +r8 db 12 + dw 51 + db 13 + dw 53 + db 14 + dw 14 + db 15 + dw 20 + db 0 + dw 78 + db 255 + +r9 db 12 + dw 119 + db 12 + dw 145 + db 255 + +r10 db 13 + dw 16 + db 255 + +r11 db 13 + dw 20 + db 255 + +r12 db 14 + dw 16 + db 255 + +r13 db 15 + dw 4 + db 16 + dw 8 + db 17 + dw 134 + db 18 + dw 153 + db 255 + +r14 db 13 + dw 108 + db 15 + dw 326 + db 15 + dw 331 + db 15 + dw 336 + db 15 + dw 342 + db 15 + dw 348 + db 15 + dw 354 + db 18 + dw 159 + db 18 + dw 178 + db 19+128 + dw 217 + db 20+64 + dw 228 + db 255 + +r20 db 13 + dw 20 + db 13 + dw 21 + db 15 + dw 34 + db 13 + dw 52 + db 13 + dw 55 + db 25 + dw 57 + db 21 + dw 73 + db 255 + +r22 db 13 ;room,sample + dw 196 ;reelpointer + db 13 + dw 234 + db 13 + dw 156 + db 14 + dw 129 + db 13 + dw 124 + db 15 + dw 162 + db 15 + dw 200 + db 15 + dw 239 + db 17 + dw 99 + db 12 + dw 52 + db 255 + +r23 db 15 + dw 56 + db 16 + dw 64 + db 19 + dw 22 + db 20 + dw 33 + db 255 + +r25 db 20 + dw 11 + db 20 + dw 15 + db 15 + dw 28 + db 13 + dw 80 + db 21 + dw 82 + db 19+128 + dw 87 + db 23+64 + dw 128 + db 255 + +r26 db 12 + dw 13 + db 14 + dw 39 + db 12 + dw 67 + db 12 + dw 75 + db 12 + dw 83 + db 12 + dw 91 + db 15 + dw 102 ; was 90, should be mine cart + db 255 + +r27 db 22 + dw 36 + db 13 + dw 125 + db 18 + dw 88 + db 15 + dw 107 + db 14 + dw 127 + db 14 + dw 154 + db 19+128 + dw 170 + db 23+64 + dw 232 + db 255 + +r28 db 21 + dw 16 + db 21 + dw 72 + db 21 + dw 205 + db 22 + dw 63 ;65 + db 23+128 + dw 99 + db 24+64 + dw 158 + db 255 + +r29 db 13 + dw 21 + db 14 + dw 24 + db 19+128 + dw 50 + db 23+64 + dw 75 + if german + else + db 24 + dw 128 + endif + db 255 + +r45 db 19+64 + dw 46 + db 16 + dw 167 + db 255 + +r46 db 16 + dw 19 + db 14 + dw 36 + db 16 + dw 50 + db 14 + dw 65 + db 16 + dw 81 + db 14 + dw 96 + db 16 + dw 114 + db 14 + dw 129 + db 16 + dw 147 + db 14 + dw 162 + db 16 + dw 177 + db 14 + dw 191 + db 255 + +r47 db 13 + dw 48 + db 14 + dw 41 + db 15 + dw 78 + db 16 + dw 92 + db 255 + +r52 db 16 + dw 115 + db 255 + +r53 db 21 + dw 103 + db 20 + dw 199 + db 255 + +r55 db 17 + dw 53 + db 17 + dw 54 + db 17 + dw 55 + db 17 + dw 56 + db 17 + dw 57 + db 17 + dw 58 + db 17 + dw 59 + db 17 + dw 61 + db 17 + dw 63 + db 17 + dw 64 + db 17 + dw 65 + db 255 + + endp + + + + + + + + + +Reconstruct proc near + + cmp havedoneobs,0 + jz noneedtorecon + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + if foreign + cmp reallocation,20 + jnz notfudge + call undertextline +notfudge: + endif + mov havedoneobs,0 +noneedtorecon: ret + + endp + + + + + + + + + + +Dealwithspecial proc near + + sub al,220 + cmp al,0 + jnz notplset + mov al,ah + call placesetobject + mov havedoneobs,1 + ret +notplset: cmp al,1 + jnz notremset + mov al,ah + call removesetobject + mov havedoneobs,1 + ret +notremset: cmp al,2 + jnz notplfree + mov al,ah + call placefreeobject + mov havedoneobs,1 + ret +notplfree: cmp al,3 + jnz notremfree + mov al,ah + call removefreeobject + mov havedoneobs,1 + ret +notremfree: cmp al,4 + jnz notryanoff + call switchryanoff + ret +notryanoff: cmp al,5 + jnz notryanon + mov turntoface,ah + mov facing,ah + call switchryanon + ret +notryanon: cmp al,6 + jnz notchangeloc + mov newlocation,ah ; was new loc in watch + ;call switchryanon + ret +notchangeloc: call movemap + ret + + endp + + + +Movemap proc near + + cmp ah,32 + jnz notmapup2 + sub mapy,20 + mov nowinnewroom,1 + ret + +notmapup2: cmp ah,16 + jnz notmapupspec + sub mapy,10 + mov nowinnewroom,1 + ret + +notmapupspec: cmp ah,8 + jnz notmapdownspec + add mapy,10 + mov nowinnewroom,1 + ret + +notmapdownspec: cmp ah,2 + jnz notmaprightspec + add mapx,11 + mov nowinnewroom,1 + ret + +notmaprightspec: sub mapx,11 + mov nowinnewroom,1 + ret + + endp + + + + +Getreelstart proc near + + mov ax,reelpointer + mov cx,40 + mul cx + mov es,reels + mov si,ax + add si,reellist + ret + + endp + + + + + +;------------------------------------------------------Printing a reel frame---- + + + +Showreelframe proc near + + mov al,[es:si+2] + mov ah,0 + mov di,ax + add di,mapadx + mov al,[es:si+3] + mov bx,ax + add bx,mapady + mov ax,[es:si] + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,8 + call showframe + ret + + endp + + + + + + +;------------------------------------------------------------------------------- + + + + + + + + + +Deleverything proc near + + mov al,mapysize + mov ah,0 + add ax,mapoffsety + cmp ax,182 + jnc bigroom + call maptopanel + ret +bigroom: sub mapysize,8 + call maptopanel + add mapysize,8 + ret + + endp + + + + + + + + + + + +Dumpeverything proc near + + mov es,buffers + mov bx,printedlist +dumpevery1: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery1 + cmp ax,[es:bx+(40*5)] + jnz notskip1 + cmp cx,[es:bx+(40*5)+2] + jz skip1 + +notskip1: push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + +skip1: add bx,5 + jmp dumpevery1 + +finishevery1: mov bx,printedlist+(40*5) +dumpevery2: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery2 + + push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + add bx,5 + jmp dumpevery2 + +finishevery2: ret + + endp + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm new file mode 100644 index 0000000000..cb100f6602 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -0,0 +1,580 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Talk proc near + + mov talkpos,0 + mov inmaparea,0 + mov al,command + mov character,al + call createpanel + call showpanel + call showman + call showexit + call undertextline + call convicons + call starttalk + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen +waittalk: call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov getback,0 + mov bx,offset cs:talklist + call checkcoords + cmp getback,0 + jz waittalk +finishtalk: mov bx,persondata + push cs + pop es + cmp talkpos,4 + jc notnexttalk + mov al,[es:bx+7] + or al,128 + mov [es:bx+7],al +notnexttalk: call redrawmainscrn + call worktoscreenm + cmp speechloaded,1 + jnz nospeech + call cancelch1 + mov volumedirection,-1 ;fade (louder) + mov volumeto,0 ;up to 0 (max) +nospeech: ret + +talklist: dw 273,320,157,198,getback1 + dw 240,290,2,44,moretalk + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + +Convicons proc near + + mov al,character + and al,127 + call getpersframe + mov di,234 + mov bx,2 + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Getpersframe proc near + + mov ah,0 + add ax,ax + mov bx,ax + mov es,people + add bx,personframes + mov ax,[es:bx] + ret + + endp + + + + + +Starttalk proc near + + mov talkmode,0 + mov al,character + and al,127 + call getpersontext + mov charshift,91+91 + mov di,66 + mov bx,64 + mov dl,241 + mov al,0 + mov ah,79 + call printdirect + mov charshift,0 + mov di,66 + mov bx,80 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + if cd + mov speechloaded,0 + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,1 + jnz nospeech1 + mov volumedirection,1 ;quieter + mov volumeto,6 ;quite quiet! + mov al,50+12 + call playchannel1 + endif +nospeech1: ret + + endp + + + + + +Getpersontext proc near + + mov ah,0 + mov cx,64*2 + mul cx + mov si,ax + mov es,people + add si,persontxtdat + mov cx,persontext + mov ax,[es:si] + add ax,cx + mov si,ax + ret + + endp + + + + + + + +Moretalk proc near + + ;cmp ch1playing,255 + ;jnz cantredes + cmp talkmode,0 + jz canmore + call redes + ret + +canmore: cmp commandtype,215 + jz alreadymore + mov commandtype,215 + mov al,49 + call commandonly +alreadymore: mov ax,mousebutton + cmp ax,oldbutton + jz nomore + and ax,1 + jnz domoretalk +nomore: ret + +domoretalk: mov talkmode,2 + mov talkpos,4 + cmp character,100 + jc notsecondpart + mov talkpos,48 +notsecondpart: call dosometalk + ret + + endp + + + + + + + + + + + + + + +Dosometalk proc near + + if cd +dospeech: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay1 + mov al,62 + call playchannel1 + +noplay1: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + jnc $1 + ret + +$1: + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + cmp byte ptr [es:si],":" + jz skiptalk2 + cmp byte ptr [es:si],32 + jz skiptalk2 + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay2 + mov al,62 + call playchannel1 + +noplay2: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + jnc skiptalk2 + ret + +skiptalk2: inc talkpos + jmp dospeech + +endheartalk: mov pointermode,0 + ret + + else + +watchtalk: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + jnc $1 + ret +$1: + + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + cmp byte ptr [es:si],":" + jz skiptalk + cmp byte ptr [es:si],32 + jz skiptalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq + jnc skiptalk + ret + +skiptalk: inc talkpos + jmp watchtalk + +endwatchtalk: mov pointermode,0 + ret + + endif + + endp + + + + + + + +Hangonpq proc near + + mov getback,0 + mov bx,0 +hangloopq: push cx bx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:quitlist + call checkcoords + pop bx cx + cmp getback,1 + jz quitconv + cmp speechloaded,1 + jnz notspeaking + cmp ch1playing,255 + jnz notspeaking + inc bx + cmp bx,40 ;pause after speech ends + jz finishconv +notspeaking: cmp mousebutton,0 + jz hangloopq + cmp oldbutton,0 + jnz hangloopq +finishconv: call delpointer + mov pointermode,0 + clc + ret + +quitconv: call delpointer + mov pointermode,0 + call cancelch1 + stc + ret + +quitlist: dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + +Redes proc near + + cmp ch1playing,255 + jnz cantredes + cmp talkmode,2 + jz canredes +cantredes: call blank + ret + +canredes: cmp commandtype,217 + jz alreadyreds + mov commandtype,217 + mov al,50 + call commandonly +alreadyreds: mov ax,mousebutton + and ax,1 + jnz doredes + ret + +doredes: call delpointer + call createpanel + call showpanel + call showman + call showexit + call convicons + call starttalk + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm new file mode 100644 index 0000000000..b4ca4d1c49 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -0,0 +1,583 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + +Titles proc near + + if demo + ret + else + call clearpalette + call biblequote + call intro + ret + endif + + endp + + + + +Endgame proc near + + mov dx,offset cs:endtextname + call loadtemptext + call monkspeaking + call gettingshot + call getridoftemptext + mov volumeto,7 + mov volumedirection,1 + mov cx,200 + call hangon + ret + + endp + + + if cd + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,5 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +loadspeech2: push ax + mov dl,"T" + mov dh,83 + mov cl,"T" + mov ah,0 + call loadspeech + mov al,50+12 + call playchannel1 +notloadspeech2: + call vsync + cmp ch1playing,255 + jnz notloadspeech2 + pop ax + inc al + cmp al,48 + jnz loadspeech2 + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + else + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,0 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +nextmonkspeak: push ax + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax +nextbit: mov di,36 + mov bx,140 + mov dl,239 + call printdirect + push ax si es + call worktoscreen + call clearwork + call showmonk + mov cx,240 + call hangon + pop es si ax + cmp al,0 + jnz nextbit + pop ax + inc al + cmp al,44 + jnz nextmonkspeak + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + endif + + + + +Showmonk proc near + + mov al,0 + mov ah,128 + mov di,160 + mov bx,72 + mov ds,tempgraphics + call showframe + ret + + endp + + +Gettingshot proc near + + mov newlocation,55 + call clearpalette + call loadintroroom + call fadescreenups + mov volumeto,0 + mov volumedirection,-1 + call runendseq + call clearbeforeload + ret + + endp + + + + + + +Credits proc near + + call clearpalette + call realcredits + ret + + endp + + + +Biblequote proc near + + call mode640x480 + mov dx,offset cs:title0graphics + call showpcx + call fadescreenups + mov cx,80 + call hangone + cmp lasthardkey,1 + jz biblequotearly + mov cx,560 + call hangone + cmp lasthardkey,1 + jz biblequotearly + call fadescreendowns + mov cx,200 ;128 + call hangone + cmp lasthardkey,1 + jz biblequotearly + call cancelch0 +biblequotearly: + mov lasthardkey,0 + ret + + endp + + + + +Hangone proc near + +hangonloope: push cx + call vsync + pop cx + cmp lasthardkey,1 + jz hangonearly + loop hangonloope +hangonearly: + ret + + endp + + + + + + +Intro proc near + + mov dx,offset cs:introtextname + call loadtemptext + + call loadpalfromiff + call setmode + + mov newlocation,50 + call clearpalette + call loadintroroom + mov volume,7 + mov volumedirection,-1 + if cd + mov volumeto,4 + else + mov volumeto,0 + endif + mov al,12 ;4 + mov ah,255 + call playchannel0 + call fadescreenups + call runintroseq + cmp lasthardkey,1 + jz introearly + +;waitsound: cmp ch1blockstoplay,0 +; jnz waitsound + call clearbeforeload + + mov newlocation,52 + call loadintroroom + call runintroseq + cmp lasthardkey,1 + jz introearly + call clearbeforeload + + mov newlocation,53 + call loadintroroom + call runintroseq + cmp lasthardkey,1 + jz introearly + call clearbeforeload + + call allpalette + mov newlocation,54 + call loadintroroom + ;mov al,12 + ;mov ah,255 + ;call playchannel0 + call runintroseq + cmp lasthardkey,1 + jz introearly + + call getridoftemptext + call clearbeforeload +introearly: + mov lasthardkey, 0 + ret + + endp + + + + + + + + +Runintroseq proc near + + mov getback,0 + +moreintroseq: call vsync + cmp lasthardkey,1 + jz earlyendrun + call spriteupdate + call vsync + cmp lasthardkey,1 + jz earlyendrun + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + call dumpmap + call dumptimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + cmp getback,1 + jnz moreintroseq + ret +earlyendrun: + call getridoftemptext + call clearbeforeload + ret + + endp + + + + + +Runendseq proc near + + call atmospheres + mov getback,0 +moreendseq: call vsync + call spriteupdate + call vsync + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + call dumpmap + call dumptimedtext + call vsync + cmp getback,1 + jnz moreendseq + ret + + endp + + + + +Loadintroroom proc near + + mov introcount,0 + mov location,255 + call loadroom + mov mapoffsetx,72 + mov mapoffsety,16 + call clearsprites + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call clearwork + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + ret + + endp + + + + + + +Mode640x480 proc near + + mov al,12h+128 + mov ah,0 + int 10h + ;call clearpalette + ret + + endp + + + +Set16colpalette proc near + + mov cx,16 + mov bl,0 + mov bh,0 + mov al,0 + mov ah,10h +set16palloop2: push ax bx cx + int 10h + pop cx bx ax + inc bl + inc bh + loop set16palloop2 + + mov bl,31h + mov al,1 + mov ah,12h + int 10h + ret + + endp + + + + + +RealCredits proc near + + mov roomssample,33 + call loadroomssample + mov volume,0 + + call mode640x480 + mov cx,35 + call hangon + + mov dx,offset cs:title1graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title2graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + if demo + else + mov dx,offset cs:title3graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title4graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title5graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + endif + + mov dx,offset cs:title6graphics + call showpcx + call fadescreenups + mov cx,60 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + mov al,13 + mov ah,0 + call playchannel0 + mov cx,350 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone +realcreditsearly: + mov lasthardkey, 0 + ret + + endp + + + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm new file mode 100644 index 0000000000..4b82f946f0 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -0,0 +1,3810 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text + +Useobject proc near + + mov withobject,255 + + cmp commandtype,229 + jz alreadyuse + mov commandtype,229 + + mov bl,command + mov bh,objecttype + mov al,51 + call commandwithob +alreadyuse: mov ax,mousebutton + cmp ax,oldbutton + jz nouse + and ax,1 + jnz douse +nouse: ret + +douse: call useroutine + ret + + endp + + + + + + + +Useroutine proc near + + cmp reallocation,50 + jc nodream7 + cmp pointerpower,0 + jnz powerok + ret +powerok: mov pointerpower,0 + +nodream7: call getanyad + mov dx,seg uselist + mov ds,dx + mov si,offset uselist +checkuselist: push si + lodsb + sub al,"A" + cmp al,[es:bx+12] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+13] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+14] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+15] + jnz failed + lodsw + pop si + call ax + ret +failed: pop si + add si,6 + cmp byte ptr [si],140 + jnz checkuselist + + call delpointer + call getobtextstart + call findnextcolon + cmp al,0 + jz cantuse2 + call findnextcolon + cmp al,0 + jz cantuse2 + mov al,[es:si] + cmp al,0 + jz cantuse2 + call usetext + mov cx,400 + call hangonp + call putbackobstuff + ret +cantuse2: call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,33 + mov bx,100 + mov al,63 + mov dl,241 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + mov commandtype,255 + ret + +Uselist: db "NETW" + dw usemon + db "ELVA" + dw useelevator1 + db "ELVB" + dw useelevator2 + db "ELVC" + dw useelevator3 + db "ELVE" + dw useelevator4 + db "ELVF" + dw useelevator5 + db "CGAT" + dw usechurchgate + db "REMO" + dw usestereo + db "BUTA" + dw usebuttona + db "CBOX" + dw usewinch + db "LITE" + dw uselighter + db "PLAT" + dw useplate + db "LIFT" + dw usecontrol + db "WIRE" + dw usewire + db "HNDL" + dw usehandle + db "HACH" + dw usehatch + db "DOOR" + dw useelvdoor + db "CSHR" + dw usecashcard + db "GUNA" + dw usegun + db "CRAA" + dw usecardreader1 + db "CRBB" + dw usecardreader2 + db "CRCC" + dw usecardreader3 + db "SEAT" + dw sitdowninbar + db "MENU" + dw usemenu + db "COOK" + dw usecooker + db "ELCA" + dw callhotellift + db "EDCA" + dw calledenslift + db "DDCA" + dw calledensdlift + db "ALTR" + dw usealtar + db "LOKA" + dw openhoteldoor + db "LOKB" + dw openhoteldoor2 + db "ENTA" + dw openlouis + db "ENTB" + dw openryan + db "ENTE" + dw openpoolboss + db "ENTC" + dw openyourneighbour + db "ENTD" + dw openeden + db "ENTH" + dw opensarters + db "WWAT" + dw wearwatch + db "POOL" + dw usepoolreader + db "WSHD" + dw wearshades + db "GRAF" + dw grafittidoor + db "TRAP" + dw trapdoor + db "CDPE" + dw edenscdplayer + + db "DLOK" + dw opentvdoor + + db "HOLE" + dw usehole + + db "DRYR" + dw usedryer + + db "HOLY" + dw usechurchhole + + db "WALL" + dw usewall + db "BOOK" + dw usediary + + db "AXED" + dw useaxe + db "SHLD" + dw useshield + + db "BCNY" + dw userailing + db "LIDC" + dw usecoveredbox + db "LIDU" + dw useclearbox + db "LIDO" + dw useopenbox + db "PIPE" + dw usepipe + + db "BALC" + dw usebalcony + db "WIND" + dw usewindow + db "PAPR" + dw viewfolder + + db "UWTA" + dw usetrainer + db "UWTB" + dw usetrainer + + db "STAT" + dw entersymbol + db "TLID" + dw opentomb + db "SLAB" + dw useslab + db "CART" + dw usecart + db "FCAR" + dw usefullcart + + + db "SLBA" + dw slabdoora + db "SLBB" + dw slabdoorb + db "SLBC" + dw slabdoorc + db "SLBD" + dw slabdoord + db "SLBE" + dw slabdoore + db "SLBF" + dw slabdoorf + db "PLIN" + dw useplinth + + db "LADD" + dw useladder + db "LADB" + dw useladderb + + db "GUMA" + dw chewy + + db "SQEE" + dw wheelsound + db "TAPP" + dw runtap + db "GUIT" + dw playguitar + db "CONT" + dw hotelcontrol + + db "BELL" + dw hotelbell + + db 140,140,140,140 + + endp + + + + + + +;-----------------------------------------------------------Puzzle routines---- + + +Wheelsound proc near + + mov al,17 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + +Runtap proc near + + cmp withobject,255 + jnz tapwith + call withwhat + ret +tapwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcupfromtap + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz cupfromtapfull + mov cx,300 + mov al,56 + call showpuztext + call putbackobstuff + ret + +fillcupfromtap: mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + mov al,8 + call playchannel1 + mov cx,300 + mov al,57 + call showpuztext + call putbackobstuff + ret + +cupfromtapfull: mov cx,300 + mov al,58 + call showpuztext + call putbackobstuff + ret + + + endp + + + +Playguitar proc near + + mov al,14 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + +Hotelcontrol proc near + + cmp reallocation,21 + jnz notrightcont + cmp mapx,33 + jnz notrightcont + call showfirstuse + call putbackobstuff + ret +notrightcont: call showseconduse + call putbackobstuff + ret + + endp + + + + +Hotelbell proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Opentomb proc near + + inc progresspoints + call showfirstuse + mov watchingtime,35*2 + mov reeltowatch,1 + mov endwatchreel,33 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Usetrainer proc near + + call getanyad + cmp byte ptr [es:bx+2],4 + jnz notheldtrainer + inc progresspoints + call makeworn + call showseconduse + call putbackobstuff + ret +notheldtrainer: call nothelderror + ret + + endp + + + +Nothelderror proc near + + call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,64 + mov bx,100 + mov al,63 + mov ah,1 + mov dl,201 + call printmessage2 + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + ret + + endp + + + +Usepipe proc near + + cmp withobject,255 + jnz pipewith + call withwhat + ret +pipewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcup + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz alreadyfull + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +fillcup: mov cx,300 + mov al,36 + call showpuztext + call putbackobstuff + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + ret + +alreadyfull: mov cx,300 + mov al,35 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + +Usefullcart proc near + + inc progresspoints + mov al,2 + mov ah,roomnum + add ah,6 + call turnanypathon + mov manspath,4 + mov facing,4 + mov turntoface,4 + mov finaldest,4 + call findxyfrompath + mov resetmanxy,1 + call showfirstuse + mov watchingtime,72*2 + mov reeltowatch,58 + mov endwatchreel,142 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + + + +Useplinth proc near + + cmp withobject,255 + jnz plinthwith + call withwhat + ret + +plinthwith: mov al,withobject + mov ah,withtype + mov cl,"D" + mov ch,"K" + mov dl,"E" + mov dh,"Y" + call compare + jz isrightkey + call showfirstuse + call putbackobstuff + ret + +isrightkey: inc progresspoints + call showseconduse + mov watchingtime,220 + mov reeltowatch,0 + mov endwatchreel,104 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,roomafterdream + mov newlocation,al + ret + + endp + + + +Chewy proc near + + call showfirstuse + call getanyad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + +Useladder proc near + + call showfirstuse + sub mapx,11 + call findroominloc + mov facing,6 + mov turntoface,6 + mov manspath,0 + mov destination,0 + mov finaldest,0 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Useladderb proc near + + call showfirstuse + add mapx,11 + call findroominloc + mov facing,2 + mov turntoface,2 + mov manspath,1 + mov destination,1 + mov finaldest,1 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Slabdoora proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,13 + cmp dreamnumber,3 + jnz slabawrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,42 + mov newlocation,47 + ret +slabawrong: mov watchingtime,40 + mov endwatchreel,34 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + +Slabdoorb proc near + + cmp dreamnumber,1 + jnz slabbwrong + mov al,"S" + mov ah,"H" + mov cl,"L" + mov ch,"D" + call isryanholding + jnz gotcrystal + mov al,44 + mov cx,200 + call showpuztext + call putbackobstuff + ret +gotcrystal: call showfirstuse + inc progresspoints + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,60 + mov endwatchreel,71 + mov newlocation,47 + ret +slabbwrong: call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,40 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoord proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,75 + cmp dreamnumber,0 + jnz slabcwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,102 + mov newlocation,47 + ret +slabcwrong: mov watchingtime,40 + mov endwatchreel,94 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorc proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,108 + cmp dreamnumber,4 + jnz slabdwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,135 + mov newlocation,47 + ret +slabdwrong: mov watchingtime,40 + mov endwatchreel,127 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoore proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,141 + cmp dreamnumber,5 + jnz slabewrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,168 + mov newlocation,47 + ret +slabewrong: mov watchingtime,40 + mov endwatchreel,160 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorf proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,171 + cmp dreamnumber,2 + jnz slabfwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,197 + mov newlocation,47 + ret +slabfwrong: mov watchingtime,40 + mov endwatchreel,189 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + + + +Useslab proc near + + cmp withobject,255 + jnz slabwith + call withwhat + ret +slabwith: mov al,withobject + mov ah,withtype + mov cl,"J" + mov ch,"E" + mov dl,"W" + mov dh,"L" + call compare + jz nextslab + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextslab: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + push ax + call placesetobject + pop ax + cmp al,54 + jnz notlastslab + mov al,0 + call turnpathon + mov watchingtime,22 + mov reeltowatch,35 + mov endwatchreel,48 + mov watchspeed,1 + mov speedcount,1 +notlastslab: inc progresspoints + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Usecart proc near + + cmp withobject,255 + jnz cartwith + call withwhat + ret +cartwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"O" + mov dl,"C" + mov dh,"K" + call compare + jz nextcart + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextcart: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + call placesetobject + inc progresspoints + mov al,17 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + +Useclearbox proc near + + cmp withobject,255 + jnz clearboxwith + call withwhat + ret +clearboxwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"A" + mov dl,"I" + mov dh,"L" + call compare + jz openbox + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openbox: inc progresspoints + call showfirstuse + mov watchingtime,80 + mov reeltowatch,67 + mov endwatchreel,105 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usecoveredbox proc near + + inc progresspoints + call showfirstuse + mov watchingtime,50 + mov reeltowatch,41 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Userailing proc near + + call showfirstuse + mov watchingtime,80 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov mandead,4 + ret + + endp + + + + + +Useopenbox proc near + + cmp withobject,255 + jnz openboxwith + call withwhat + ret +openboxwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz destoryopenbox + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz openboxwrong + call showfirstuse + ret + +destoryopenbox: inc progresspoints + mov cx,300 + mov al,37 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"E"-"A" + mov watchingtime,140 + mov reeltowatch,105 + mov endwatchreel,181 + mov watchspeed,1 + mov speedcount,1 + mov al,4 + call turnpathon + mov getback,1 + ret + +openboxwrong: mov cx,300 + mov al,38 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + +Wearwatch proc near + + cmp watchon,1 + jz wearingwatch + call showfirstuse + mov watchon,1 + mov getback,1 + call getanyad + call makeworn + ret +wearingwatch: call showseconduse + call putbackobstuff + ret + + endp + + + + +Wearshades proc near + + cmp shadeson,1 + jz wearingshades + mov shadeson,1 + call showfirstuse + mov getback,1 + call getanyad + call makeworn + ret +wearingshades: call showseconduse + call putbackobstuff + ret + + endp + + + +Sitdowninbar proc near + + cmp watchmode,-1 + jnz satdown + call showfirstuse + mov watchingtime,50 + mov reeltowatch,55 + mov endwatchreel,71 + mov reeltohold,73 + mov endofholdreel,83 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret +satdown: call showseconduse + call putbackobstuff + ret + + endp + + + +Usechurchhole proc near + + call showfirstuse + mov getback,1 + mov watchingtime,28 + mov reeltowatch,13 + mov endwatchreel,26 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Usehole proc near + + cmp withobject,255 + jnz holewith + call withwhat + ret +holewith: mov al,withobject + mov ah,withtype + mov cl,"H" + mov ch,"N" + mov dl,"D" + mov dh,"A" + call compare + jz righthand + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +righthand: call showfirstuse + mov al,86 + call removesetobject + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov canmovealtar,1 + mov getback,1 + ret + + endp + + + + +Usealtar proc near + + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"A" + call findexobject + cmp al,numexobjects + jz thingsonaltar + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"B" + call findexobject + cmp al,numexobjects + jz thingsonaltar + cmp canmovealtar,1 + jz movealtar + mov cx,300 + mov al,23 + call showpuztext + mov getback,1 + ret + +movealtar: inc progresspoints + call showseconduse + mov watchingtime,160 + mov reeltowatch,81 + mov endwatchreel,174 + mov watchspeed,1 + mov speedcount,1 + + mov al,47 ;message number + mov bl,52 ;x pos of message + mov bh,76 ;and y pos + mov cx,32 ;time on screen + mov dx,98 ;pause before show + call setuptimeduse + mov getback,1 + ret + +thingsonaltar: call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + + +Opentvdoor proc near + + cmp withobject,255 + jnz tvdoorwith + call withwhat + ret +tvdoorwith: mov al,withobject + mov ah,withtype + mov cl,"U" + mov ch,"L" + mov dl,"O" + mov dh,"K" + call compare + jz keyontv + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyontv: call showfirstuse + mov lockstatus,0 + mov getback,1 + ret + + endp + + + + + + + +Usedryer proc near + + mov al,12 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Openlouis proc near + + mov al,5 + mov ah,2 + mov cl,3 + mov ch,8 + call entercode + mov getback,1 + ret + + endp + + + + +Nextcolon proc near + +lookcolon: mov al,[es:si] + inc si + cmp al,":" + jnz lookcolon + ret + + endp + + + + +Openyourneighbour proc near + + mov al,255 + mov ah,255 + mov cl,255 + mov ch,255 + call entercode + mov getback,1 + ret + + endp + + + +Usewindow proc near + + cmp manspath,6 + jnz notonbalc + inc progresspoints + call showfirstuse + mov newlocation,29 + mov getback,1 + ret +notonbalc: call showseconduse + call putbackobstuff + ret + + endp + + + +Usebalcony proc near + + call showfirstuse + mov al,6 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,5 + call turnpathoff + inc progresspoints + mov manspath,6 + mov destination,6 + mov finaldest,6 + call findxyfrompath + call switchryanoff + mov resetmanxy,1 + + mov watchingtime,30*2 + mov reeltowatch,183 + mov endwatchreel,212 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Openryan proc near + + mov al,5 + mov ah,1 + mov cl,0 + mov ch,6 + call entercode + mov getback,1 + ret + + endp + + + +Openpoolboss proc near + + mov al,5 + mov ah,2 + mov cl,2 + mov ch,2 + call entercode + mov getback,1 + ret + + endp + + + + +Openeden proc near + + mov al,2 + mov ah,8 + mov cl,6 + mov ch,5 + call entercode + mov getback,1 + ret + + endp + + +Opensarters proc near + + mov al,7 + mov ah,8 + mov cl,3 + mov ch,3 + call entercode + mov getback,1 + ret + + endp + + + + +Isitright proc near + + mov bx,seg presslist + mov es,bx + mov bx,offset es:presslist + cmp [es:bx+0],al + jnz notright + cmp [es:bx+1],ah + jnz notright + cmp [es:bx+2],cl + jnz notright + cmp [es:bx+3],ch +notright: ret + + endp + + + + +Drawitall proc near + + call createpanel + call drawfloor + ;call dumpallmap + call printsprites + call showicon + ret + + endp + + + + +Openhoteldoor proc near + + cmp withobject,255 + jnz hoteldoorwith + call withwhat + ret +hoteldoorwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel1 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel1: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + ;mov destination,1 + ;mov finaldest,1 + ;call autosetwalk + mov lockstatus,0 + mov getback,1 + ret + + endp + + + +Openhoteldoor2 proc near + + cmp withobject,255 + jnz hoteldoorwith2 + call withwhat + ret +hoteldoorwith2: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel2: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Grafittidoor proc near + + cmp withobject,255 + jnz grafwith + call withwhat + ret +grafwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"P" + mov dl,"E" + mov dh,"N" + call compare + jz dograf + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +dograf: call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Trapdoor proc near + + inc progresspoints + call showfirstuse + call switchryanoff + mov watchingtime,20*2 + mov reeltowatch,181 + mov endwatchreel,197 + mov newlocation,26 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + +Callhotellift proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov destination,5 + mov finaldest,5 + call autosetwalk + mov al,4 + call turnpathon + ret + + endp + + + + +Calledenslift proc near + + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret + + endp + + + +Calledensdlift proc near + + cmp liftflag,1 + jz edensdhere + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret +edensdhere: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Usepoolreader proc near + + cmp withobject,255 + jnz poolwith + call withwhat + ret +poolwith: mov al,withobject + mov ah,withtype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jz openpool + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openpool: cmp talkedtoattendant,1 + jz canopenpool + call showseconduse + call putbackobstuff + ret + +canopenpool: mov al,17 + call playchannel1 + call showfirstuse + mov counttoopen,6 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Uselighter proc near + + cmp withobject,255 + jnz gotlighterwith + call withwhat + ret +gotlighterwith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"M" + mov dl,"K" + mov dh,"E" + call compare + jz cigarette + call showfirstuse + call putbackobstuff + ret +cigarette: mov cx,300 + mov al,9 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Showseconduse proc near + + call getobtextstart + call nextcolon + call nextcolon + call nextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + + +Usecardreader1 proc near + + cmp withobject,255 + jnz gotreader1with + call withwhat + ret +gotreader1with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +correctcard: cmp talkedtosparky,0 + jz notyet + cmp card1money,0 + jz getscash + mov cx,300 + mov al,17 + call showpuztext + call putbackobstuff + ret +getscash: mov al,16 + call playchannel1 + mov cx,300 + mov al,18 + call showpuztext + inc progresspoints + mov card1money,12432 + mov getback,1 + ret +notyet: call showfirstuse + call putbackobstuff + ret + + endp + + + + +Usecardreader2 proc near + + cmp withobject,255 + jnz gotreader2with + call withwhat + ret +gotreader2with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +correctcard2: cmp talkedtoboss,0 + jz notyetboss + cmp card1money,0 + jz nocash + cmp gunpassflag,2 + jz alreadygotnew + mov al,18 + call playchannel1 + mov cx,300 + mov al,19 + call showpuztext + mov al,94 + call placesetobject + mov gunpassflag,1 + sub card1money,2000 + inc progresspoints + mov getback,1 + ret +nocash: mov cx,300 + mov al,20 + call showpuztext + call putbackobstuff + ret +alreadygotnew: mov cx,300 + mov al,22 + call showpuztext + call putbackobstuff + ret +notyetboss: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Usecardreader3 proc near + + cmp withobject,255 + jnz gotreader3with + call withwhat + ret +gotreader3with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz rightcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +rightcard: cmp talkedtorecep,0 + jz notyetrecep + cmp cardpassflag,0 + jnz alreadyusedit + if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + mov cx,300 + mov al,25 + call showpuztext + inc progresspoints + sub card1money,8300 + mov cardpassflag,1 + mov getback,1 + ret +alreadyusedit: mov cx,300 + mov al,26 + call showpuztext + call putbackobstuff + ret +notyetrecep: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + +Usecashcard proc near + + call getridofreels + call loadkeypad + call createpanel + call showpanel + call showexit + call showman + + mov di,114 + if foreign + mov bx,120-3 + else + mov bx,120 + endif + mov ds,tempgraphics + mov al,39 + mov ah,0 + call showframe + + mov ax,card1money + call moneypoke + + call getobtextstart + call nextcolon + call nextcolon + + mov di,36 + mov bx,98 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + mov di,160 + mov bx,155 + push cs + pop es + mov si,offset cs:money1poke + mov charshift,91*2+75 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov di,187 + mov bx,155 + push cs + pop es + mov si,offset cs:money2poke + mov charshift,91*2+85 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov charshift,0 + call worktoscreenm + mov cx,400 + call hangonp + call getridoftemp + call restorereels + call putbackobstuff + ret + +money1poke: db "0000",0 +money2poke: db "00",0 + + endp + + + + +Lookatcard proc near + + mov manisoffscreen,1 + call getridofreels + call loadkeypad + + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + + call getobtextstart + call findnextcolon + call findnextcolon + call findnextcolon + mov di,36 + mov bx,124 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + push es si + call worktoscreenm + mov cx,280 + call hangonw + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + pop si es + + mov di,36 + mov bx,130 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,200 + call hangonw + mov manisoffscreen,0 + call getridoftemp + call restorereels + call putbackobstuff + ret + + endp + + + + + +Moneypoke proc near + + mov bx,offset cs:money1poke + mov cl,48-1 +numberpoke0: inc cl + sub ax,10000 + jnc numberpoke0 + add ax,10000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke1: inc cl + sub ax,1000 + jnc numberpoke1 + add ax,1000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke2: inc cl + sub ax,100 + jnc numberpoke2 + add ax,100 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke3: inc cl + sub ax,10 + jnc numberpoke3 + add ax,10 + mov [cs:bx],cl + + mov bx,offset cs:money2poke + add al,48 + mov [cs:bx],al + ret + + endp + + + + + + + +Usecontrol proc near + + cmp withobject,255 + jnz gotcontrolwith + call withwhat + ret +gotcontrolwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz rightkey + cmp reallocation,21 + jnz balls + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz jimmycontrols + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeoncontrols + +balls: call showfirstuse + call putbackobstuff + ret + +rightkey: mov al,16 + call playchannel1 + cmp location,21 + jz goingdown + mov cx,300 + mov al,0 + call showpuztext + mov newlocation,21 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +goingdown: mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +jimmycontrols: mov al,50 + call placesetobject + mov al,51 + call placesetobject + mov al,26 + call placesetobject + mov al,30 + call placesetobject + mov al,16 + call removesetobject + mov al,17 + call removesetobject + if demo + mov al,26 + else + mov al,14 + endif + call playchannel1 + mov cx,300 + mov al,10 + call showpuztext + inc progresspoints + mov getback,1 + ret + +axeoncontrols: mov cx,300 + mov al,16 + call showpuztext + inc progresspoints + call putbackobstuff + ret + + endp + + + + + + +Usehatch proc near + + call showfirstuse + mov newlocation,40 + mov getback,1 + ret + + endp + + + + + +Usewire proc near + + cmp withobject,255 + jnz gotwirewith + call withwhat + ret +gotwirewith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz wireknife + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz wireaxe + + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +wireaxe: mov cx,300 + mov al,16 + call showpuztext + call putbackobstuff + ret + +wireknife: mov al,51 + call removesetobject + mov al,52 + call placesetobject + mov cx,300 + mov al,11 + call showpuztext + inc progresspoints + mov getback,1 + ret + + endp + + + + + + + +Usehandle proc near + + mov al,"C" + mov ah,"U" + mov cl,"T" + mov ch,"W" + call findsetobject + mov al,[es:bx+58] + cmp al,255 + jnz havecutwire + mov cx,300 + mov al,12 + call showpuztext + mov getback,1 + ret + +havecutwire: mov cx,300 + mov al,13 + call showpuztext + mov newlocation,22 + mov getback,1 + ret + + endp + + + + + + + + +Useelevator1 proc near + + call showfirstuse + call selectlocation + mov getback,1 + ret + + endp + + + + + + +Showfirstuse proc near ;shows but does not delete the + ;first bit of text after the + call getobtextstart ;description + call findnextcolon + call findnextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + +Useelevator3 proc near + + call showfirstuse + mov counttoclose,20 + mov newlocation,34 + mov reeltowatch,46 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + mov watchingtime,80 ;40 + mov getback,1 + ret + + endp + + + + +Useelevator4 proc near + + call showfirstuse + mov reeltowatch,0 + mov endwatchreel,11 + mov watchspeed,1 + mov speedcount,1 + mov counttoclose,20 + mov watchingtime,80 ;40 + mov getback,1 + mov newlocation,24 + ret + + endp + + + +Useelevator2 proc near + + cmp location,23 + jz inpoolhall + call showfirstuse + mov newlocation,23 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret +inpoolhall: call showfirstuse + mov newlocation,31 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + + endp + + + + +Useelevator5 proc near + + mov al,4 + call placesetobject + mov al,0 + call removesetobject + mov newlocation,20 + mov watchingtime,80 + mov liftflag,1 + mov counttoclose,8 + mov getback,1 + ret + + endp + + + + + +Usekey proc near + + cmp location,5 + jz usekey1 + cmp location,30 + jz usekey1 + cmp location,21 + jz usekey2 + mov cx,200 + mov al,1 + call showpuztext + call putbackobstuff + ret + +usekey1: cmp mapx,22 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,0 + call showpuztext + mov counttoclose,100 + mov getback,1 + ret + +usekey2: cmp mapx,11 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov al,2 + call fadescreendown + call showfirstuse + call putbackobstuff + ret + +wrongroom1: mov cx,200 + mov al,2 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + +Usestereo proc near + + cmp location,0 + jz stereook + mov cx,400 ;Ryan isn't in his flat. + mov al,4 + call showpuztext + call putbackobstuff + ret + +stereook: cmp mapx,11 + jnz stereonotok + cmp mapy,0 + jz stereook2 +stereonotok: mov cx,400 ;Ryan isn't in his bedroom. + mov al,5 + call showpuztext + call putbackobstuff + ret + +stereook2: mov al,"C" + mov ah,"D" + mov cl,"P" + mov ch,"L" + call findsetobject ;find object number of CD player + mov ah,1 ;searching for inside a set ob + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz cdinside + mov al,6 ;Need a CD inside + mov cx,400 + call showpuztext + call putbackobstuff + call getanyad ;if the CD's been taken out, + mov al,255 ;make sure the player isn't still + mov [es:bx+10],al ;playing, ie:reset the puzzle + ret ;flag for the remote. + +cdinside: call getanyad + mov al,[es:bx+10] + xor al,1 + mov [es:bx+10],al + cmp al,255 + jz stereoon + mov al,7 ;The stereo works + mov cx,400 + call showpuztext + call putbackobstuff + ret + +stereoon: mov al,8 ;Stereo was already on, + mov cx,400 ;so switch it off + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + + +Usecooker proc near + + mov al,command + mov ah,objecttype + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz foodinside + call showfirstuse + call putbackobstuff + ret ;flag for the remote. + +foodinside: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Useaxe proc near + + cmp reallocation,22 + jnz notinpool + cmp mapy,10 + jz axeondoor + call showseconduse + inc progresspoints + mov lastweapon,2 + mov getback,1 + call removeobfrominv + ret + +notinpool: call showfirstuse + ret + + endp + + + + + + + + +Useelvdoor proc near + + cmp withobject,255 + jnz gotdoorwith + call withwhat + ret +gotdoorwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeondoor + mov al,14 + mov cx,300 + call showpuztext + call putbackobstuff + ret + +axeondoor: mov al,15 + mov cx,300 + call showpuztext + inc progresspoints + + mov watchingtime,46*2 + mov reeltowatch,31 + mov endwatchreel,77 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + +;------------------------------------------------------------------------------ + +Withwhat proc near ;Gets player to identify object + ;to use selected item with. + call createpanel + call showpanel + call showman + call showexit + mov al,command + mov ah,objecttype + push cs + pop es + mov di,offset cs:commandline + call copyname + + mov di,100 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,2 + call printmessage2 + + mov di,lastxpos + add di,5 + mov bx,21 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + mov di,lastxpos + add di,5 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,3 + call printmessage2 + + call fillryan + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + mov invopen,2 + ret + + endp + + + + + +Selectob proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canselectob + call blank + ret + +canselectob: mov withobject,al + mov withtype,ah + cmp ax,oldsubject + jnz diffsub3 + cmp commandtype,221 + jz alreadyselob + mov commandtype,221 + +diffsub3: mov oldsubject,ax + mov bx,ax + mov al,0 + call commandwithob +alreadyselob: mov ax,mousebutton + cmp ax,oldbutton + jz notselob + and ax,1 + jnz doselob +notselob: ret + +doselob: call delpointer + mov invopen,0 + call useroutine + ret + + endp + + + + + + + + +Compare proc near + + sub dl,"A" + sub dh,"A" + sub cl,"A" + sub ch,"A" + push cx dx + call getanyaddir + pop dx cx + cmp [es:bx+12],cx + jnz comparefin + cmp [es:bx+14],dx +comparefin: ret + + endp + + + + + + + + + + + +Findsetobject proc near ;searches set object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,setdat + mov bx,0 + mov dl,0 ;dl counts object number +findsetloop: cmp al,[es:bx+12] + jnz nofind + cmp ah,[es:bx+13] + jnz nofind + cmp cl,[es:bx+14] + jnz nofind + cmp ch,[es:bx+15] + jnz nofind + mov al,dl + ret +nofind: add bx,64 + inc dl + cmp dl,128 ;number of objects to search + jnz findsetloop + mov al,dl + ret + + endp + + + + + + +Findexobject proc near ;searches ex object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +findexloop: cmp al,[es:bx+12] + jnz nofindex + cmp ah,[es:bx+13] + jnz nofindex + cmp cl,[es:bx+14] + jnz nofindex + cmp ch,[es:bx+15] + jnz nofindex + mov al,dl + ret +nofindex: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz findexloop + mov al,dl + ret + + endp + + + +Isryanholding proc near + + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +searchinv: cmp byte ptr [es:bx+2],4 + jnz nofindininv + cmp al,[es:bx+12] + jnz nofindininv + cmp ah,[es:bx+13] + jnz nofindininv + cmp cl,[es:bx+14] + jnz nofindininv + cmp ch,[es:bx+15] + jnz nofindininv + mov al,dl + cmp al,numexobjects + ret +nofindininv: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz searchinv + mov al,dl + cmp al,numexobjects ;if not zero he is holding + ret ;if zero, he is not holding + + endp + + + + +Checkinside proc near ;finds an extra object inside + ;object number al, type ah + + mov es,extras + mov bx,exdata + mov cl,0 +insideloop: cmp al,[es:bx+3] ;OI! might need to check room number!!! + jnz notfoundinside + cmp ah,[es:bx+2] + jnz notfoundinside + ret +notfoundinside: add bx,16 + inc cl + cmp cl,numexobjects + jnz insideloop + ret ;ch returns the object number + ;in the extras list + endp + + + + + + + + + + + + +Usetext proc near + + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + + mov di,36 + mov bx,104 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + call worktoscreenm + ret + + endp + + + + + +Putbackobstuff proc near + + call createpanel + call showpanel + call showman + call obicons + call showexit + call obpicture + call describeob + call undertextline + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Showpuztext proc near + + push cx + call findpuztext + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + mov di,36 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreenm + pop cx + call hangonp + ret + + endp + + + +Findpuztext proc near + + mov ah,0 + mov si,ax + add si,si + mov es,puzzletext + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp + + + +;------------------------------------------------------------------------------- + +Placesetobject proc near + + push es bx + mov cl,0 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],0 + pop bx es + ret + + endp + + + + +Removesetobject proc near + + push es bx + mov cl,255 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],255 + pop bx es + ret + + endp + + + + +Issetobonmap proc near + + push es bx + call getsetad + mov al,[es:bx+58] + pop bx es + cmp al,0 + ret + + endp + + + + + + +Placefreeobject proc near + + push es bx + mov cl,0 + mov ch,1 + call findormake + call getfreead + mov byte ptr [es:bx+2],0 + pop bx es + ret + + endp + + + + + +Removefreeobject proc near + + push es bx + ;mov cl,255 + ;mov ch,1 + ;call findormake + call getfreead + mov byte ptr [es:bx+2],255 + pop bx es + ret + + endp + + + + + + + + + + +Findormake proc near + + mov bx,listofchanges + push ax + mov es,buffers + mov ah,reallocation +changeloop: cmp byte ptr [es:bx],255 + jz haventfound + cmp ax,[es:bx] + jnz nofoundchange + cmp ch,[es:bx+3] + jz foundchange +nofoundchange: add bx,4 + jmp changeloop +foundchange: pop ax + mov [es:bx+2],cl + ret +haventfound: mov [es:bx],ax + mov [es:bx+2],cx + pop ax + ret + + endp + + + + + + + + +Switchryanon proc near + + mov ryanon,255 + ret + + endp + + + + + +Switchryanoff proc near + + mov ryanon,1 + ret + + endp + + + +Setallchanges proc near + + mov es,buffers + mov bx,listofchanges +setallloop: mov ax,[es:bx] + cmp al,255 + jz endsetloop + mov cx,[es:bx+2] + add bx,4 + cmp ah,reallocation + jnz setallloop + push es bx + call dochange + pop bx es + jmp setallloop +endsetloop: ret + + endp + + + + + + +Dochange proc near + + cmp ch,0 + jz object + cmp ch,1 + jz freeobject + +path: push cx + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + push ax + mov al,ch + sub al,100 + mov ah,0 + mov cx,144 + mul cx + pop bx + add bx,ax + add bx,pathdata + mov es,reels + pop cx + mov byte ptr [es:bx+6],cl +nopath: ret + +object: push cx + call getsetad + pop cx + mov [es:bx+58],cl + ret + +freeobject: push cx + call getfreead + pop cx + cmp byte ptr [es:bx+2],255 + jnz beenpickedup + mov [es:bx+2],cl +beenpickedup: ret + + endp + + + +Autoappear proc near ;places objects that appear + ;in rooms after certain + cmp location,32 ;conditions are met. + jnz notinalley + mov al,5 ;switch off travel to + call resetlocation ;hotel after kill + mov al,10 + call setlocation + mov destpos,10 + ret +notinalley: cmp reallocation,24 + jnz notinedens + cmp generaldead,1 + jnz edenspart2 + inc generaldead + mov al,44 + call placesetobject + mov al,18 + call placesetobject + mov al,93 + call placesetobject + mov al,92 + call removesetobject + mov al,55 + call removesetobject + mov al,75 + call removesetobject + mov al,84 + call removesetobject + mov al,85 + call removesetobject + ret +edenspart2: cmp sartaindead,1 + jnz notedens2 + mov al,44 + call removesetobject + mov al,93 + call removesetobject + mov al,55 + call placesetobject + inc sartaindead +notedens2: ret +notinedens: cmp reallocation,25 + jnz notonsartroof + mov newsitem,3 + mov al,6 + call resetlocation ;turn off Sartain Industries + mov al,11 + call setlocation ;turn on carpark for later + mov destpos,11 + ret +notonsartroof: cmp reallocation,2 + jnz notinlouiss + cmp rockstardead,0 + jz notinlouiss + mov al,23 + call placesetobject +notinlouiss: ret + + endp + + + + + + + + + + +;--------------------------------------------------------- Timed text stuff ---- + + + +Getundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + +Putundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + + + + +Dumptimedtext proc near + + cmp needtodumptimed,1 + jnz nodumptimed + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov cl,240 + mov ch,undertimedysize + call multidump + mov needtodumptimed,0 +nodumptimed: ret + + endp + + + + + + + + +Setuptimeduse proc near + + cmp timecount,0 + jnz cantsetup + + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,puzzletext + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup: ret + + endp + + + +Setuptimedtemp proc near + + if cd + cmp ah,0 + jz notloadspeech3 + mov dl,"T" + mov dh,ah + mov cl,"T" + mov ah,0 + call loadspeech + cmp speechloaded,1 + jnz notloadspeech3 + mov al,50+12 + call playchannel1 + ret +notloadspeech3: + endif + cmp timecount,0 + jnz cantsetup2 + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,textfile1 + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup2: ret + + endp + + + + + + + +Usetimedtext proc near + + cmp timecount,0 + jz notext + dec timecount + cmp timecount,0 + jz deltimedtext + mov ax,timecount + cmp ax,counttotimed + jz firsttimed + jnc notext + jmp notfirsttimed +firsttimed: call getundertimed +notfirsttimed: mov bl,timedy + mov bh,0 + mov al,timedx + mov ah,0 + mov di,ax + mov es,timedseg + mov si,timedoffset + mov dl,237 + mov ah,0 + call printdirect + mov needtodumptimed,1 +notext: ret + +deltimedtext: call putundertimed + mov needtodumptimed,1 + ret + + endp + + + + + + + + + + + + +Edenscdplayer proc near + + call showfirstuse + mov watchingtime,18*2 + mov reeltowatch,25 + mov endwatchreel,42 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usewall proc near + + call showfirstuse + cmp manspath,3 + jz gobackover + mov watchingtime,30*2 + mov reeltowatch,2 + mov endwatchreel,31 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathon + mov al,4 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,5 + call turnpathoff + mov manspath,3 + mov finaldest,3 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret +gobackover: mov watchingtime,30*2 + mov reeltowatch,34 + mov endwatchreel,60 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,5 + call turnpathon + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret + + endp + + + + + + + +Usechurchgate proc near + + cmp withobject,255 + jnz gatewith + call withwhat + ret +gatewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"T" + mov dh,"T" + call compare + jz cutgate + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +cutgate: call showfirstuse + mov watchingtime,64*2 + mov reeltowatch,4 + mov endwatchreel,70 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + mov al,3 + call turnpathon + cmp aidedead,0 + jz notopenchurch + mov al,2 + call turnpathon +notopenchurch: ret + + endp + + + + + +Usegun proc near + + cmp objecttype,4 + jz istakengun + call showseconduse + call putbackobstuff + ret +istakengun: cmp reallocation,22 + jnz notinpoolroom + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,39 + mov getback,1 + inc progresspoints + ret +notinpoolroom: cmp reallocation,25 + jnz nothelicopter + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,19 + mov getback,1 + mov dreamnumber,2 + mov roomafterdream,38 + mov sartaindead,1 + inc progresspoints + ret +nothelicopter: cmp reallocation,27 + jnz notinrockroom + mov cx,300 + mov al,46 + call showpuztext + mov pointermode,2 ;0 + mov rockstardead,1 + mov lastweapon,1 + mov newsitem,1 + mov getback,1 + mov roomafterdream,32 ; skip + mov dreamnumber,0 + inc progresspoints + ret +notinrockroom: cmp reallocation,8 + jnz notbystudio + cmp mapx,22 + jnz notbystudio + cmp mapy,40 + jnz notbystudio + mov al,92 + call issetobonmap + jz notbystudio + cmp manspath,9 + jz notbystudio + mov destination,9 + mov finaldest,9 + call autosetwalk + mov lastweapon,1 + mov getback,1 + inc progresspoints + ret +notbystudio: cmp reallocation,6 + jnz notsarters + cmp mapx,11 + jnz notsarters + cmp mapy,20 + jnz notsarters + mov al,5 + call issetobonmap + jnz notsarters + mov destination,1 + mov finaldest,1 + call autosetwalk + mov al,5 + call removesetobject + mov al,6 + call placesetobject + mov al,1 + mov ah,roomnum + dec ah + call turnanypathon + mov liftflag,1 + mov watchingtime,40*2 + mov reeltowatch,4 + mov endwatchreel,43 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + ret +notsarters: cmp reallocation,29 + jnz notaide + mov getback,1 + mov al,13 + call resetlocation + mov al,12 + call setlocation + mov destpos,12 + mov destination,2 + mov finaldest,2 + call autosetwalk + mov watchingtime,164*2 + mov reeltowatch,3 + mov endwatchreel,164 + mov watchspeed,1 + mov speedcount,1 + mov aidedead,1 + mov dreamnumber,3 + mov roomafterdream,33 + inc progresspoints + ret +notaide: cmp reallocation,23 + jnz notwithboss + cmp mapx,0 + jnz notwithboss + cmp mapy,50 + jnz notwithboss + cmp manspath,5 + jz pathokboss + mov destination,5 + mov finaldest,5 + call autosetwalk +pathokboss: mov lastweapon,1 + mov getback,1 + ret +notwithboss: cmp reallocation,8 + jnz nottvsoldier + cmp mapx,11 + jnz nottvsoldier + cmp mapy,10 + jnz nottvsoldier + cmp manspath,2 + jz pathoktv + mov destination,2 + mov finaldest,2 + call autosetwalk +pathoktv: mov lastweapon,1 + mov getback,1 + ret +nottvsoldier: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Useshield proc near + + cmp reallocation,20 + jnz notinsartroom + cmp combatcount,0 + jz notinsartroom + mov lastweapon,3 + call showseconduse + mov getback,1 + inc progresspoints + call removeobfrominv + ret +notinsartroom: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Usebuttona proc near + + mov al,95 + call issetobonmap + jz donethisbit + + call showfirstuse + mov al,0 + mov ah,roomnum + dec ah + call turnanypathon + mov al,9 + call removesetobject + mov al,95 + call placesetobject + + mov watchingtime,15*2 + mov reeltowatch,71 + mov endwatchreel,85 + mov watchspeed,1 + mov speedcount,1 + + mov getback,1 + inc progresspoints + ret +donethisbit: call showseconduse + call putbackobstuff + ret + + endp + + + + +Useplate proc near + + cmp withobject,255 + jnz platewith + call withwhat + ret +platewith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"C" + mov dl,"R" + mov dh,"W" + call compare + jz unscrewplate + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz triedknife + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +unscrewplate: mov al,20 + call playchannel1 + call showfirstuse + mov al,28 + call placesetobject + mov al,24 + call placesetobject + mov al,25 + call removesetobject + mov al,0 + call placefreeobject + inc progresspoints + mov getback,1 + ret + +triedknife: mov cx,300 + mov al,54 + call showpuztext + call putbackobstuff + ret + + endp + + + + + +Usewinch proc near + + mov al,40 + mov ah,1 + call checkinside + cmp cl,numexobjects + jz nowinch + mov al,cl + mov ah,4 + mov cl,"F" + mov ch,"U" + mov dl,"S" + mov dh,"E" + call compare + jnz nowinch + + mov watchingtime,217*2 + mov reeltowatch,0 + mov endwatchreel,217 + mov watchspeed,1 + mov speedcount,1 + mov destpos,1 + mov newlocation,45 + mov dreamnumber,1 + mov roomafterdream,44 + mov generaldead,1 + mov newsitem,2 + mov getback,1 + inc progresspoints + ret + +nowinch: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + + + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm new file mode 100644 index 0000000000..b72f180d74 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -0,0 +1,564 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +;---------------------------------------------------Equates and definitions---- + +Inputport equ 63h +Mapwidth equ 66 ;132/2 +Maplength equ 60 ;6/2 +Tablesize equ 32 ;size of each entry in spritetable +Itempicsize equ 44 ;size of inventory slots +Opsy equ 52 +Opsx equ 60 +Inventx equ 80 +Inventy equ 58 +Zoomx equ 8 +Zoomy equ 132 +Keypadx equ 36+112 +Keypady equ 72 +Diaryx equ 68+24 +Diaryy equ 48+12 +Symbolx equ 64 +Symboly equ 56 +Menux equ 80+40 +Menuy equ 60 + + if foreign +Undertextsizex equ 228 +Undertextsizey equ 13 +Undertimedysize equ 30 + else +Undertextsizex equ 180 +Undertextsizey equ 10 +Undertimedysize equ 24 + endif + +Numchanges equ 250 + +Textunder equ 0 ;offsets for items in buffer segment +Openinvlist equ textunder+(undertextsizex*undertextsizey) +Ryaninvlist equ openinvlist+32 +Pointerback equ ryaninvlist+60 +Mapflags equ pointerback+(32*32) +Startpal equ mapflags+(11*10*3) +Endpal equ startpal+768 +Maingamepal equ endpal+768 +Spritetable equ maingamepal+768 +Setlist equ spritetable+(32*tablesize) +Freelist equ setlist+(128*5) +Exlist equ freelist+(80*5) +Peoplelist equ exlist+(100*5) +Zoomspace equ peoplelist+(12*5) +Printedlist equ zoomspace+(46*40) +Listofchanges equ printedlist+(5*80) +Undertimedtext equ listofchanges+(numchanges*4) +Rainlist equ undertimedtext+(256*undertimedysize) +Initialreelrouts equ rainlist+(6*64) +Initialvars equ initialreelrouts+lenofreelrouts +Lengthofbuffer equ initialvars+lengthofvars + +Flags equ 0 ;offsets of items in backdrop segment +Blocks equ flags+192 +Map equ 0 +Lengthofmap equ map+(mapwidth*maplength) + +Intextdat equ 0 +Intext equ intextdat+(38*2) +Blocktextdat equ 0 +Blocktext equ blocktextdat+(98*2) +Settextdat equ 0 +Settext equ settextdat+(130*2) +Freetextdat equ 0 +Freetext equ freetextdat+(82*2) + +Numexobjects equ 114 +Exframeslen equ 30000 +Extextlen equ 18000 + +Exframedata equ 0 +Exframes equ exframedata+2080 +Exdata equ exframes+exframeslen +Extextdat equ exdata+(16*numexobjects) +Extext equ extextdat+((numexobjects+2)*2) +Lengthofextra equ extext+extextlen + +Framedata equ 0 +Frames equ framedata+2080 + +Frframedata equ 0 +Frframes equ frframedata+2080 + +Personframes equ 0 +Persontxtdat equ personframes+24 +Persontext equ persontxtdat+(1026*2) + +Pathdata equ 0 +Reellist equ pathdata+(36*144) + +Lenofmapstore equ 22*8*20*8 +Maplen equ mapwidth*maplength +Freedatlen equ 16*80 +Setdatlen equ 64*128 +Textstart equ 66*2 + +;-----------------------------------------------------------------Variables---- + + +startvars db 0 +progresspoints db 0 +watchon db 0 +shadeson db 0 +secondcount db 0 +minutecount db 30 +hourcount db 19 +zoomon db 1 +location db 0 +expos db 0 +exframepos dw 0 +extextpos dw 0 +card1money dw 0 +listpos dw 0 +ryanpage db 0 + + +watchingtime dw 0 +reeltowatch dw -1 ;reel plays from here in mode 0 +endwatchreel dw 0 ;and stops here. Mode set to 1 +speedcount db 0 +watchspeed db 0 +reeltohold dw -1 ;if mode is 1 hold on this reel +endofholdreel dw -1 ;if mode is 2 then play to end of +watchmode db -1 ;hold reel. Set mode back to -1 +destafterhold db 0 ;set walking destination. + +newsitem db 0 + +liftflag db 0 +liftpath db 0 +lockstatus db 1 +doorpath db 0 +counttoopen db 0 +counttoclose db 0 +rockstardead db 0 +generaldead db 0 +sartaindead db 0 +aidedead db 0 +beenmugged db 0 + +gunpassflag db 0 +canmovealtar db 0 +talkedtoattendant db 0 +talkedtosparky db 0 +talkedtoboss db 0 +talkedtorecep db 0 +cardpassflag db 0 +madmanflag db 0 +keeperflag db 0 +lasttrigger db 0 +mandead db 0 +seed db 1,2,3 +needtotravel db 0 +throughdoor db 0 +newobs db 0 +ryanon db 255 +combatcount db 0 +lastweapon db -1 + +dreamnumber db 0 +roomafterdream db 0 + +shakecounter db 48 + +lengthofvars equ $-startvars + + +speechcount db 0 + +charshift dw 0 +kerning db 0 + +brightness db 0 + +roomloaded db 0 + +didzoom db 0 + +linespacing dw 10 +textaddressx dw 13 +textaddressy dw 182 ;address on screen for text +textlen db 0 +lastxpos dw 0 + +icontop dw 0 +iconleft dw 0 +itemframe db 0 +itemtotran db 0 +roomad dw 0 +oldsubject dw 0 + +withobject db 0 +withtype db 0 + +lookcounter dw 0 + +command db 0 +commandtype db 0 +oldcommandtype db 0 +objecttype db 0 +getback db 0 +invopen db 0 +mainmode db 0 +pickup db 0 +lastinvpos db 0 +examagain db 0 +newtextline db 0 + +openedob db 0 +openedtype db 0 + +oldmapadx dw 0 +oldmapady dw 0 +mapadx dw 0 +mapady dw 0 +mapoffsetx dw 104 +mapoffsety dw 38 + +mapxstart dw 0 +mapystart dw 0 +mapxsize db 0 +mapysize db 0 + +havedoneobs db 0 +manisoffscreen db 0 +rainspace db 0 + +facing db 0 +leavedirection db 0 +turntoface db 0 +turndirection db 0 + +maintimer dw 0 +introcount db 0 +arrowad dw 0 +currentkey db 0 +oldkey db 0 +useddirection db 0 +currentkey2 db 0 + +timercount db 0 +oldtimercount db 0 + +mapx db 0 +mapy db 0 +newscreen db 0 +ryanx db 0 +ryany db 0 +lastflag db 0 +lastflagex db 0 +flagx db 0 +flagy db 0 + +currentex db 0 +currentfree db 0 +currentframe dw 0 +framesad dw 0 +dataad dw 0 +frsegment dw 0 +objectx dw 0 +objecty dw 0 +offsetx dw 0 +offsety dw 0 +savesize dw 0 +savesource dw 0 +savex db 0 +savey db 0 +currentob db 0 +priority db 0 + +destpos db 0 + +reallocation db 0 ;----------;some rooms have more than one +roomnum db 0 ;place in the Roomdata list, to + ;account for different start points +nowinnewroom db 0 ;this variable holds the rooms +resetmanxy db 0 ;real value - ie:which file it's in +newlocation db -1 ;if set then room is loaded at end of watch mode, or straight away if not in watch mode +autolocation db -1 +mustload db 0 +answered db 0 +saidno db 0 + +doorcheck1 db 0 +doorcheck2 db 0 +doorcheck3 db 0 +doorcheck4 db 0 + +mousex dw 0 +mousey dw 0 +mousebutton dw 0 +mousebutton1 dw 0 +mousebutton2 dw 0 +mousebutton3 dw 0 +mousebutton4 dw 0 +oldbutton dw 0 +oldx dw 0 +oldy dw 0 +lastbutton dw 0 +oldpointerx dw 0 +oldpointery dw 0 +delherex dw 0 +delherey dw 0 +pointerxs db 32 +pointerys db 32 +delxs db 0 +delys db 0 +pointerframe db 0 +pointerpower db 0 +auxpointerframe db 0 +pointermode db 0 +pointerspeed db 0 +pointercount db 0 +inmaparea db 0 + +reelpointer dw 0 +slotdata db 0 +thisslot db 0 +slotflags db 0 +takeoff dw 0 + +talkmode db 0 +talkpos db 0 +character db 0 +persondata dw 0 +talknum db 0 +numberinroom db 0 + +currentcel db 0 +oldselection db 0 + +stopwalking db 0 + +mouseon db 0 +played dw 0 +timer1 db 0 +timer2 db 0 +timer3 db 0 +wholetimer dw 0 +timer1to db 0 +timer2to db 0 +timer3to db 0 + +watchdump db 0 + +currentset dw 0 + +logonum db 0 +oldlogonum db 0 +newlogonum db 0 +netseg dw 0 +netpoint dw 0 +keynum db 0 +cursorstate db 0 + +pressed db 0 +presspointer dw 0 +graphicpress db 0 +presscount db 0 +keypadax dw 0 +keypadcx dw 0 +lightcount db 0 +folderpage db 0 +diarypage db 0 +menucount db 0 +symboltopx db 0 +symboltopnum db 0 +symboltopdir db 0 +symbolbotx db 0 +symbolbotnum db 0 +symbolbotdir db 0 + +symboltolight db 0 +symbol1 db 0 +symbol2 db 0 +symbol3 db 0 +symbolnum db 0 +dumpx dw 0 +dumpy dw 0 + +walkandexam db 0 +walkexamtype db 0 +walkexamnum db 0 + +cursloc dw 0 +curslocx dw 0 +curslocy dw 0 +curpos dw 0 +monadx dw 0 +monady dw 0 +gotfrom dw 0 + +monsource dw 0 +numtodo dw 0 + +timecount dw 0 +counttotimed dw 0 +timedseg dw 0 +timedoffset dw 0 +timedy db 0 +timedx db 0 +needtodumptimed db 0 + +;recordpos dw 0 +;rechandle dw 0 +handle dw 0 + +loadingorsave db 0 ;1 if load 2 if save +currentslot db 0 +cursorpos db 0 + +colourpos db 0 +fadedirection db 0 +numtofade db 0 +fadecount db 0 +addtogreen db 0 +addtored db 0 +addtoblue db 0 + + +lastsoundreel dw 0 + +soundbuffer dw 0 +soundbufferad dw 0 +soundbufferpage db 0 +soundtimes db 0 +needsoundbuff db 0 + +oldint9seg dw -1 +oldint9add dw -1 +oldint8seg dw -1 +oldint8add dw -1 +oldsoundintseg dw 0 +oldsoundintadd dw 0 +soundbaseadd dw 0 +dsp_status dw 0 +dsp_write dw 0 +dmaaddress db 0 +soundint db 5 +sounddmachannel db 1 +sampleplaying db 255 +testresult db 0 +currentirq db 0 +speechloaded db 0 +speechlength dw 0 +volume db 0 +volumeto db 0 +volumedirection db 0 +volumecount db 0 + +playblock db 0 + +wongame db 0 + +lasthardkey db 0 +bufferin dw 0 +bufferout dw 0 + +extras dw 0 ;for allocated memory +workspace dw 0 ;allocated mem for screen buffer +mapstore dw 0 ;allocated mem for copy of room +charset1 dw 0 ;allocated mem for normal charset +tempcharset dw 0 ;monitor char set +icons1 dw 0 ;allocated mem for on screen stuff +icons2 dw 0 +buffers dw 0 ;allocated mem for buffers +mainsprites dw 0 ;allocated mem for Ryan sprites +backdrop dw 0 +mapdata dw 0 + +sounddata dw 0 +sounddata2 dw 0 + +recordspace dw 0 + +freedat dw 0 +setdat dw 0 + +reel1 dw -1 +reel2 dw -1 +reel3 dw -1 +roomdesc dw -1 +freedesc dw -1 +setdesc dw -1 +blockdesc dw -1 +setframes dw -1 +freeframes dw -1 +people dw -1 +reels dw -1 +commandtext dw -1 +puzzletext dw -1 +traveltext dw -1 +tempgraphics dw -1 +tempgraphics2 dw -1 +tempgraphics3 dw -1 +tempsprites dw -1 + +textfile1 dw -1 +textfile2 dw -1 +textfile3 dw -1 + +blinkframe db 23 +blinkcount db 0 + + +reasseschanges db 0 ; if it's a 1 then obname will assume that +pointerspath db 0 ;the command has changed. +manspath db 0 ;ie. from "walk to" to "Examine" +pointerfirstpath db 0 +finaldest db 0 +destination db 0 +linestartx dw 0 +linestarty dw 0 +lineendx dw 0 +lineendy dw 0 +increment1 dw 0 +increment2 dw 0 +lineroutine db 0 +linepointer db 0 +linedirection db 0 +linelength db 0 + +liftsoundcount db 0 + +emmhandle dw 0 +emmpageframe dw 0 +emmhardwarepage db 0 + +ch0emmpage dw 0 +ch0offset dw 0 +ch0blockstocopy dw 0 + +ch0playing db 0 +ch0repeat db 0 +ch0oldemmpage dw 0 +ch0oldoffset dw 0 +ch0oldblockstocopy dw 0 + +ch1playing db 255 +ch1emmpage dw 0 +ch1offset dw 0 +ch1blockstocopy dw 0 +ch1blocksplayed dw 0 + +soundbufferwrite dw 0 + +soundemmpage dw 0 +speechemmpage dw 0 + +currentsample db -1 +roomssample db 0 + +gameerror db 0 + +howmuchalloc dw 0 + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm new file mode 100644 index 0000000000..e4a5b97c45 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vgafades.asm @@ -0,0 +1,867 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Fadedos proc near + + call vsync + mov es,buffers + mov di,startpal + mov al,0 + mov dx,3c7h + out dx,al + mov dx,3c9h + mov cx,768/4 +dos1: in al,dx + stosb + loop dos1 + + mov cx,64 +fadedosloop: push cx + + mov ds,buffers + mov si,startpal + mov cx,768 +dos3: lodsb + cmp al,0 + jz nodown + dec al +nodown: mov [si-1],al + loop dos3 + + call vsync + mov ds,buffers + mov si,startpal + mov al,0 + mov dx,3c8h + out dx,al + inc dx + mov cx,768/4 +dos2: lodsb + out dx,al + loop dos2 + + pop cx + loop fadedosloop + ret + + endp + + + + + + + + + + + +Dofade proc near + + cmp fadedirection,0 + jz finishfade + mov cl,numtofade + mov ch,0 + mov al,colourpos + mov ah,0 + mov ds,buffers + mov si,startpal + add si,ax + add si,ax + add si,ax + call showgroup + mov al,numtofade + add al,colourpos + mov colourpos,al + cmp al,0 + jnz finishfade + call fadecalculation +finishfade: ret + + endp + + + + + + + +Clearendpal proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,0 + rep stosb + ret + + endp + + + + +Clearpalette proc near + + mov fadedirection,0 + call clearstartpal + call dumpcurrent + ret + + endp + + + + + + + + + + +Fadescreenup proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + +Fadetowhite proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,63 + rep stosb + mov di,endpal + mov al,0 + stosb + stosb + stosb + call paltostartpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadefromwhite proc near + + mov es,buffers + mov di,startpal + mov cx,768 + mov al,63 + rep stosb + mov di,startpal + mov al,0 + stosb + stosb + stosb + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + + + + + + +Fadescreenups proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + +Fadescreendownhalf proc near + + call paltostartpal + call paltoendpal + mov cx,768 + mov es,buffers + mov bx,endpal +halfend: mov al,[es:bx] + shr al,1 + mov [es:bx],al + inc bx + loop halfend + + mov ds,buffers + mov es,buffers + mov si,startpal+(56*3) + mov di,endpal+(56*3) + mov cx,3*5 + rep movsb + mov si,startpal+(77*3) + mov di,endpal+(77*3) + mov cx,3*2 + rep movsb + + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + +Fadescreenuphalf proc near + + call endpaltostart + call paltoendpal + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + + + + + + + + + +Fadescreendown proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadescreendowns proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + + + + + + +Clearstartpal proc near + + mov es,buffers + mov di,startpal + mov cx,256 +wholeloop1: mov ax,0 + stosw + mov al,0 + stosb + loop wholeloop1 + ret + + endp + + + + + + +Showgun proc near + + mov addtored,0 ;12 + mov addtogreen,0 + mov addtoblue,0 + call paltostartpal + call paltoendpal + call greyscalesum + +; mov es,buffers +; mov di,endpal+3 +; mov cx,255 +; mov ax,0 +;reds: mov byte ptr [es:di],63 +; inc di +; stosw +; loop reds + + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,130 + call hangon + call endpaltostart + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,200 + call hangon + mov roomssample,34 + call loadroomssample + mov volume,0 + mov dx,offset cs:gungraphic + call loadintotemp + call createpanel2 + mov ds,tempgraphics + mov al,0 + mov ah,0 + mov di,100 + mov bx,4 + call showframe + mov ds,tempgraphics + mov al,1 + mov ah,0 + mov di,158 + mov bx,106 + call showframe + call worktoscreen + call getridoftemp + call fadescreenup + mov cx,160 + call hangon + mov al,12 + mov ah,0 + call playchannel0 + mov dx,offset cs:endtextname + call loadtemptext + call rollendcredits2 + call getridoftemptext + ret + + endp + + + + + +Rollendcredits2 proc near + + call rollem + ret + + endp + + + + +Rollem proc near + + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,49*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,80 +endcredits21: push cx + + mov bx,10 + mov cx,linespacing +endcredits22: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot2: push cx + mov di,25 ;75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot2 + + call vsync + mov cl,160 + mov ch,160 + mov di,25 ;75 + mov bx,20 + call multidump + + pop bx es di si cx + cmp lasthardkey,1 + jz endearly2 + dec bx + loop endcredits22 + pop cx +looknext2: mov al,[es:si] + inc si + cmp al,":" + jz gotnext2 + cmp al,0 + jz gotnext2 + jmp looknext2 +gotnext2: cmp lasthardkey,1 + jz endearly + loop endcredits21 + + mov cx,120 + call hangone + ret +endearly2: pop cx +endearly: ret + + endp + + + + + + + + + +Fadecalculation proc near + + cmp fadecount,0 + jz nomorefading + mov bl,fadecount + mov es,buffers + mov si,startpal + mov di,endpal + mov cx,768 +fadecolloop: mov al,[es:si] + mov ah,[es:di] + cmp al,ah + jz gotthere + jc lesscolour + dec byte ptr [es:si] + jmp gotthere +lesscolour: cmp bl,ah + jz withit + jnc gotthere +withit: inc byte ptr [es:si] +gotthere: inc si + inc di + loop fadecolloop + dec fadecount + ret +nomorefading: mov fadedirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + +Greyscalesum proc near ;converts palette to grey scale + ;summed using formula: + mov es,buffers ; .20xred + .59xGreen + .11xBlue + mov si,maingamepal + mov di,endpal + mov cx,256 ;convert 256 colours + +greysumloop1: push cx + mov bx,0 + mov al,[es:si] + mov ah,0 + mov cx,20 + mul cx + add bx,ax + mov al,[es:si+1] + mov ah,0 + mov cx,59 + mul cx + add bx,ax + mov al,[es:si+2] + mov ah,0 + mov cx,11 + mul cx + add bx,ax ;bx holds equationx100 + + mov al,-1 ;divide result by 100 +greysumloop2: inc al + sub bx,100 + jnc greysumloop2 ;ah holds grey scale number + mov bl,al + + mov al,bl + mov ah,addtored + cmp al,0 + ;jz noaddr + add al,ah +noaddr: stosb + mov ah,addtogreen + mov al,bl + cmp al,0 + jz noaddg + add al,ah +noaddg: stosb ;store result in red, green and + mov ah,addtoblue + mov al,bl + cmp al,0 + jz noaddb + add al,ah +noaddb: stosb ;blue portions of palette. + + add si,3 + pop cx + loop greysumloop1 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Showgroup proc near + + mov dx,3c8h + out dx,al + mov dx,3c9h +showgroup1: lodsb + out dx,al + lodsb + out dx,al + lodsb + out dx,al + loop showgroup1 + ret + + endp + + + + + +Paltostartpal proc near + + mov es,buffers + mov ds,buffers + mov si,maingamepal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + +Endpaltostart proc near + + mov es,buffers + mov ds,buffers + mov si,endpal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + +Startpaltoend proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + +Paltoendpal proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,maingamepal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + + + + + + +Allpalette proc near + + mov es,buffers + mov ds,buffers + mov di,startpal + mov si,maingamepal + mov cx,768/2 + rep movsw + call dumpcurrent + ret + + endp + + + + + +Dumpcurrent proc near + + mov si,startpal + mov ds,buffers + call vsync + mov al,0 + mov cx,128 + call showgroup + call vsync + mov al,128 + mov cx,128 + call showgroup + ret + + endp + + + + + + + + + + + +Fadedownmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 ;100 + call hangon ;curs + ret + + endp + + + + + +Fadeupmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon ;curs + ret + + endp + + + + + +Fadeupmonfirst proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 + call hangon + mov al,26 + call playchannel1 + mov cx,64 + call hangon + + ret + + endp + + + + + + + +Fadeupyellows proc near + + ;call startpaltoend + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon + ret + + endp + + + +Initialmoncols proc near + + call paltostartpal + mov es,buffers + mov di,startpal+(230*3) + mov cx,3*9 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov ds,buffers + mov si,startpal+(230*3) + mov al,230 + mov cx,18 + call showgroup + ret + + endp + + + \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm new file mode 100644 index 0000000000..4c89412952 --- /dev/null +++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm @@ -0,0 +1,1763 @@ +;Copyright (c) 1990-2011 by Neil Dodwell +;Released with permission from Neil Dodwell under GPLv2 +;See LICENSE file for full license text +Screenwidth equ 320 ;physical width of screen + + + +Allocatework proc near + + mov bx,1000h + call allocatemem + mov workspace,ax + ret + + endp + + + + + +Showpcx proc near + + call openfile + mov bx,handle + mov ds,workspace + mov ah,3fh + mov cx,128 + mov dx,0 + int 21h + + mov ds,workspace + mov si,16 + mov cx,48 + mov es,buffers + mov di,maingamepal +pcxpal: push cx + call readabyte + shr al,1 + shr al,1 + stosb + pop cx + loop pcxpal + mov cx,768-48 + mov ax,0ffffh + rep stosw + + call readoneblock + mov si,0 + mov di,0 + mov cx,480 +convertpcx: push cx + push di + mov ds,workspace + mov es,buffers + mov di,pointerback + mov bx,0 +sameline: call readabyte + mov ah,al + and ah,11000000b + cmp ah,11000000b + jnz normal + mov cl,al + and cl,00111111b + mov ch,0 + push cx + call readabyte + pop cx + add bx,cx + rep stosb + cmp bx,4*80 + jnz sameline + jmp endline +normal: stosb + inc bx + cmp bx,4*80 + jnz sameline + +endline: pop di + push si + mov dx,0a000h + mov es,dx + mov si,pointerback + mov ds,buffers + + mov dx,03c4h + mov al,2 + mov ah,1 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,2 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,4 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,8 + out dx,ax + mov cx,40 + rep movsw + + pop si + pop cx + loop convertpcx + + mov bx,handle + call closefile + ret + + endp + + + + +Readabyte proc near + + cmp si,30000 + jnz notendblock + push bx es di ds si + call readoneblock + pop si ds di es bx + mov si,0 +notendblock: lodsb + ret + + endp + + + + +Readoneblock proc near + + mov bx,handle + mov ah,3fh + mov ds,workspace + mov ah,3fh + mov cx,30000 + mov dx,0 + int 21h + ret + + endp + + + + + + + + +Loadpalfromiff proc near + + mov dx,offset cs:palettescreen + call openfile + mov cx,2000 + mov ds,mapstore + mov dx,0 + call readfromfile + call closefile + mov es,buffers + mov di,maingamepal + mov ds,mapstore + mov si,30h + mov cx,768 +palloop: lodsb + shr al,1 + shr al,1 + + cmp brightness,1 + jnz nought + cmp al,0 + jz nought + mov ah,al + shr ah,1 + add al,ah + shr ah,1 + add al,ah + cmp al,64 + jc nought + mov al,63 + +nought: stosb + loop palloop + ret + + endp + + + + + + +Setmode proc near + + call vsync + mov ah,12h + mov al,1 + mov bl,33h + int 10h + + mov ah,0 + mov al,13h + int 10h + + mov al,6 ; sets graphic controller + mov dx,3ceh ; register 6 (MM) to 1 - 64K + out dx,al + inc dx + in al,dx + and al,11110011b + or al,00000100b + out dx,al + + mov al,4 ; sets sequencer + mov dx,3c4h ; register 4 (EM) to 1 - >64K + out dx,al + inc dx + in al,dx + and al,11111101b + or al,00000010b + out dx,al + + mov al,13h ;give screen 16 extra hidden + mov dx,3d4h ;pixels at one side + out dx,al + inc dx + mov al,screenwidth/8 ; width of screen + out dx,al + + mov al,8h + mov dx,3d4h + out dx,al + inc dx + mov al,00000000b + out dx,al + + mov al,11h + mov dx,3d4h + out dx,al + inc dx + in al,dx + or al,128 + out dx,al + + mov al,00 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + mov al,01 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + ret + + endp + + + +Cls proc near + + mov ax,0a000h + mov es,ax + mov di,0 + mov cx,7fffh + mov ax,0 + rep stosw + ret + + endp + + + +Printundermon proc near ;prints workspace through the text + + mov si,(screenwidth*43)+76 + mov di,si + mov es,workspace + add si,8*screenwidth + mov dx,0a000h + mov ds,dx + mov cx,104 +scrollmonloop1: push cx di si + mov cx,170 +scrollmonloop2: lodsb + cmp al,231 + jnc dontplace +placeit: stosb + loop scrollmonloop2 + jmp finmonscroll +dontplace: inc di + loop scrollmonloop2 + +finmonscroll: pop si di cx + add si,screenwidth + add di,screenwidth + loop scrollmonloop1 + ret + + endp + + + + + + + + +Worktoscreen proc near + + call vsync + mov si,0 + mov di,0 + mov cx,25 + mov ds,workspace + mov dx,0a000h + mov es,dx + +dumpallloop: call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + loop dumpallloop + + ret + + endp + + + + + + + + + +; +;Worktoscreen2 proc near +; +; call showpointer +; +; mov ds,workspace +; mov dx,0a000h +; mov es,dx +; +; mov si,320-16 +; mov di,320-16 +; mov bl,33 +; mov cx,16 +;screen2loop1: push di si cx +; call vsync +; cmp bl,21 +; jc screen2loop2 +; sub cx,16 +; jz isoneblock +;screen2loop2: movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; add di,320-15 +; add si,320-15 +; loop screen2loop2 +;isoneblock: mov cx,16 +; mov ax,320-15 +;oneblockloop: push cx +; rep movsb +; pop cx +; add si,ax +; add di,ax +; inc ax +; loop oneblockloop +; +; pop cx si di +; add cx,16 +; cmp cx,200 +; jc itsallright +; mov cx,200 +;itsallright: sub si,16 +; sub di,16 +; dec bl +; jnz screen2loop1 +; +; call delpointer +; ret +; +; endp +; +; +; +; + + + + +Paneltomap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiget + ret + + endp + + + +Maptopanel proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiput + + ret + + endp + + + + + +Dumpmap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov cl,mapxsize + mov ch,mapysize + call multidump + ret + + endp + + + + +Pixelcheckset proc near ;al=x, ah=y, es:bx=setlist pos + ;checks exact pixel in a frame + push ax + sub al,[es:bx] ;for detection. + sub ah,[es:bx+1] ;al,ah now holds offset within + ;the frame + push es bx cx ax + mov al,[es:bx+4] ;object number + call getsetad + mov al,[es:bx+17] ;finds frame number + mov es,setframes + mov bx,framedata + mov ah,0 + mov cx,6 + mul cx + add bx,ax ;get data for this frame in es:bx + pop ax + + push ax + mov al,ah + mov ah,0 + mov cl,[es:bx] + mov ch,0 + mul cx + pop cx + mov ch,0 + add ax,cx ;ax now holds offset from corner + ;of the frame + add ax,[es:bx+2] + mov bx,ax ;es:bx now holds offset of pixel! + add bx,frames + + mov al,[es:bx] + mov dl,al + pop cx bx es ax + cmp dl,0 + ret + + endp + + + + + + + + + + + + +Createpanel proc near + + mov di,0 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,0 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + ret + + endp + + + +Createpanel2 proc near + + call createpanel + mov di,0 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + mov di,160 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + ret + + endp + + + + + + +;Showspritef proc near +; +; mov ax,bx +; mov bx,screenwidth +; mul bx +; add di,ax +; mov dx,screenwidth +; mov es,workspace +; mov si,2080 +; mov ah,0 +; add ax,ax +; mov bx,ax +; add ax,ax +; add bx,ax +; add si,[bx+2] +; mov cx,[bx+0] +;spritefloop: push cx di +; call width80 +; pop di cx +; add di,dx +; dec ch +; jnz spritefloop +; ret +; +; endp +; +; + + + + + + + + +Clearwork proc near + + mov ax,0h + mov es,workspace + mov di,0 + mov cx,(200*320)/64 +clearloop: stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + loop clearloop + ret + + endp + + + + + + +Vsync proc near + + push ax bx cx dx si di ds es + + mov dx,03dah +loop2: in al,dx + test al,8 + jz loop2 +loop1: in al,dx + test al,8 + jnz loop1 + + call doshake + call dofade + if debuglevel2 + call debugkeys + endif + pop es ds di si dx cx bx ax + ret + + endp + + + +Doshake proc near + + cmp shakecounter,48 + jz finishshake + inc shakecounter + mov bl,shakecounter + mov bh,0 + add bx,offset cs:shaketable + mov al,10h + mov dx,3d4h + out dx,al + inc dx + mov al,[cs:bx] + out dx,al +finishshake: ret + +shaketable: db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9ch + + endp + + + + + + +Zoom proc near + + cmp watchingtime,0 + jnz inwatching + cmp zoomon,1 + jz zoomswitch +inwatching: ret + +zoomswitch: cmp commandtype,199 + jc zoomit +cantzoom: call putunderzoom + ret + +zoomit: mov ax,oldpointery + sub ax,9 + mov cx,screenwidth + mul cx + add ax,oldpointerx + sub ax,11 + mov si,ax + + mov ax,zoomy+4 + mov cx,screenwidth + mul cx + add ax,zoomx+5 + mov di,ax + mov es,workspace + mov ds,workspace + + mov cx,20 +zoomloop: push cx + mov cx,23 +zoomloop2: lodsb + mov ah,al + stosw + mov [es:di+screenwidth-2],ax + loop zoomloop2 + add si,screenwidth-23 + add di,screenwidth-46+screenwidth + pop cx + loop zoomloop + + call crosshair + mov didzoom,1 + ret + + endp + + + + + + + + + +Delthisone proc near + + push ax + push ax + mov al,ah + mov ah,0 + add ax,mapady + mov bx,screenwidth + mul bx + pop bx + mov bh,0 + add bx,mapadx + add ax,bx + mov di,ax + pop ax + push ax + mov al,ah + mov ah,0 + mov bx,22*8 + mul bx + pop bx + mov bh,0 + add ax,bx + mov si,ax + + mov es,workspace + mov ds,mapstore + mov dl,cl + mov dh,0 + mov ax,screenwidth + sub ax,dx + neg dx + add dx,22*8 +deloneloop: push cx + mov ch,0 + rep movsb + pop cx + add di,ax + add si,dx + dec ch + jnz deloneloop + ret + + endp + + + + + + + +;------------------------------------------------------------Pointer update---- + + +Multiget proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + push es ds + pop es ds + xchg di,si + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth2 + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop3: call ax + add si,dx + loop multiloop3 + ret + +oddwidth2: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop4: call ax + movsb + add si,dx + loop multiloop4 + ret + + endp + + + + + + + +Multiput proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth3 + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop5: call ax + add di,dx + loop multiloop5 + ret + +oddwidth3: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop6: call ax + movsb + add di,dx + loop multiloop6 + ret + + + endp + + + + + + + + + +Multidump proc near ;di,bx = dest x,y + ;cl,ch = size + mov dx,0a000h + mov es,dx + mov ds,workspace + + mov ax,bx + mov bx,screenwidth + mul bx + add di,ax + mov dx,screenwidth + mov si,di + + mov al,cl + and al,1 + jnz oddwidth + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,dx + mov cl,ch + mov ch,0 +multiloop1: call ax + add di,bx + add si,bx + loop multiloop1 + ret + +oddwidth: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,screenwidth + mov cl,ch + mov ch,0 +multiloop2: call ax + movsb + add di,bx + add si,bx + loop multiloop2 + ret + + endp + + + + + +Width160 proc near + + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width128: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width110: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width88: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width80: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width63: movsw +width62: movsw +width61: movsw +width60: movsw +width59: movsw +width58: movsw +width57: movsw +width56: movsw +width55: movsw +width54: movsw +width53: movsw +width52: movsw +width51: movsw +width50: movsw +width49: movsw +width48: movsw +width47: movsw +width46: movsw +width45: movsw +width44: movsw +width43: movsw +width42: movsw +width41: movsw +width40: movsw +width39: movsw +width38: movsw +width37: movsw +width36: movsw +width35: movsw +width34: movsw +width33: movsw +width32: movsw +width31: movsw +width30: movsw +width29: movsw +width28: movsw +width27: movsw +width26: movsw +width25: movsw +width24: movsw +width23: movsw +width22: movsw +width21: movsw +width20: movsw +width19: movsw +width18: movsw +width17: movsw +width16: movsw +width15: movsw +width14: movsw +width13: movsw +width12: movsw +width11: movsw +width10: movsw +width9: movsw +width8: movsw +width7: movsw +width6: movsw +width5: movsw +width4: movsw +width3: movsw +width2: movsw +width1: movsw +width0: ret + + endp + + + + + + + + + +Doblocks proc near + + mov es,workspace + mov ax,mapady + mov cx,screenwidth + mul cx + mov di,mapadx + add di,ax + + mov al,mapy + mov ah,0 + mov bx,mapwidth + mul bx + mov bl,mapx + mov bh,0 + add ax,bx + + mov si,map + add si,ax + + mov cx,10 +loop120: push di cx + mov cx,11 +loop124: push cx di + + mov ds,mapdata + lodsb + mov ds,backdrop + + push si + cmp al,0 + jz zeroblock + mov ah,al + mov al,0 + mov si,blocks + add si,ax + mov bh,14 + + + mov bh,4 +firstbitofblock: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + add di,screenwidth-16 + dec bh + jnz firstbitofblock + + mov bh,12 +loop125: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + mov ax,0dfdfh + stosw + stosw + + add di,screenwidth-20 + dec bh + jnz loop125 + + add di,4 + mov ax,0dfdfh + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + + +zeroblock: pop si + + pop di cx + add di,16 + loop loop124 + add si,mapwidth-11 + pop cx di + add di,screenwidth*16 + loop loop120 + ret + + endp + + + + + + + +;----------------------------------------------General sprite output routine---- + +Showframe proc near ; shows a frame from sprites + + push dx ax ; es=destination + mov cx,ax ; ds=source + and cx,511 ; di=x, bx=y + add cx,cx ; al=frame number + mov si,cx ; ah=effects flag + add cx,cx + add si,cx + cmp word ptr [si],0 + jnz notblankshow + pop ax dx + mov cx,0 + ret + +notblankshow: test ah,128 + jnz skipoffsets + mov al,[si+4] + mov ah,0 + add di,ax + mov al,[si+5] + mov ah,0 + add bx,ax +skipoffsets: mov cx,[si+0] + mov ax,[si+2] + add ax,2080 + mov si,ax + pop ax dx + cmp ah,0 + jz noeffects + + test ah,128 + jz notcentred + push ax + mov al,cl + mov ah,0 + shr ax,1 + sub di,ax + mov al,ch + mov ah,0 + shr ax,1 + sub bx,ax + pop ax + +notcentred: test ah,64 + jz notdiffdest + push cx + call frameoutfx + pop cx + ret + +notdiffdest: test ah,8 + jz notprintlist + push ax + mov ax,di + sub ax,mapadx + push bx + sub bx,mapady + mov ah,bl + pop bx + ;call addtoprintlist + pop ax + +notprintlist: test ah,4 + jz notflippedx + mov dx,screenwidth + mov es,workspace + push cx + call frameoutfx + pop cx + ret + +notflippedx: test ah,2 + jz notnomask + mov dx,screenwidth + mov es,workspace + push cx + call frameoutnm + pop cx + ret + +notnomask: test ah,32 + jz noeffects + mov dx,screenwidth + mov es,workspace + push cx + call frameoutbh + pop cx + ret + +noeffects: mov dx,screenwidth + mov es,workspace + push cx + call frameoutv + pop cx ; returns size printed in cx + ret + + endp + + + + + + + + + + +Frameoutv proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +frameloop1: push cx + mov ch,0 + +frameloop2: lodsb + cmp al,0 + jnz backtosolid +backtoother: inc di + loop frameloop2 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + +frameloop3: lodsb + cmp al,0 + jz backtoother +backtosolid: stosb + loop frameloop3 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + + endp + + + + + + +Frameoutnm proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + + mov al,cl + and al,1 + jnz oddwidthframe + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop1: call ax + add di,dx + loop nmloop1 + ret + +oddwidthframe: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop2: call ax + movsb + add di,dx + loop nmloop2 + ret + + endp + + + + + + +Frameoutbh proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +bhloop2: push cx + mov ch,0 + mov ah,255 +bhloop1: cmp [es:di],ah + jnz nofill + movsb + loop bhloop1 + jmp nextline +nofill: inc di + inc si + loop bhloop1 +nextline: add di,dx + pop cx + dec ch + jnz bhloop2 + ret + + endp + + + + + + + +Frameoutfx proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + add dx,cx + pop cx + +frameloopfx1: push cx + mov ch,0 + +frameloopfx2: lodsb + cmp al,0 + jnz backtosolidfx +backtootherfx: dec di + loop frameloopfx2 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + +frameloopfx3: lodsb + cmp al,0 + jz backtootherfx +backtosolidfx: mov [es:di],al + dec di + loop frameloopfx3 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + + endp + + + + +;---------------------------------------------------Transfers for extra data---- + +Transferinv proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + + + + + + + + + +Transfermap proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + +;------------------------------------------------------------------Filenames---- + + +Spritename1 db "DREAMWEB.S00",0 +Spritename3 db "DREAMWEB.S02",0 + +Idname db "INSTALL.DAT",0 + +Characterset1 db "DREAMWEB.C00",0 +Characterset2 db "DREAMWEB.C01",0 +Characterset3 db "DREAMWEB.C02",0 + +Samplename db "DREAMWEB.V00",0 + +Basicsample db "DREAMWEB.V99",0 + +Icongraphics0 db "DREAMWEB.G00",0 +Icongraphics1 db "DREAMWEB.G01",0 +Extragraphics1 db "DREAMWEB.G02",0 +Icongraphics8 db "DREAMWEB.G08",0 +Mongraphicname db "DREAMWEB.G03",0 +Mongraphics2 db "DREAMWEB.G07",0 +Cityname db "DREAMWEB.G04",0 +Travelgraphic1 db "DREAMWEB.G05",0 +Travelgraphic2 db "DREAMWEB.G06",0 +Diarygraphic db "DREAMWEB.G14",0 + +Monitorfile1 db "DREAMWEB.T01",0 +Monitorfile2 db "DREAMWEB.T02",0 +Monitorfile10 db "DREAMWEB.T10",0 ;News items 10-13 +Monitorfile11 db "DREAMWEB.T11",0 +Monitorfile12 db "DREAMWEB.T12",0 +Monitorfile13 db "DREAMWEB.T13",0 +Monitorfile20 db "DREAMWEB.T20",0 +Monitorfile21 db "DREAMWEB.T21",0 ;Ryan's private stuff +Monitorfile22 db "DREAMWEB.T22",0 ;Use for blank carts +Monitorfile23 db "DREAMWEB.T23",0 ;Use for edens cart +Monitorfile24 db "DREAMWEB.T24",0 ;Use for church cart +Foldertext db "DREAMWEB.T50",0 +Diarytext db "DREAMWEB.T51",0 +Puzzletextname db "DREAMWEB.T80",0 ;puzzle text +Traveltextname db "DREAMWEB.T81",0 ;location descriptions +Introtextname db "DREAMWEB.T82",0 ;intro sequence +Endtextname db "DREAMWEB.T83",0 ;end sequence/credits +Commandtextname db "DREAMWEB.T84",0 ;commands + +Volumetabname db "DREAMWEB.VOL",0 + +Foldergraphic1 db "DREAMWEB.G09",0 +Foldergraphic2 db "DREAMWEB.G10",0 +Foldergraphic3 db "DREAMWEB.G11",0 +Symbolgraphic db "DREAMWEB.G12",0 +Gungraphic db "DREAMWEB.G13",0 +Monkface db "DREAMWEB.G15",0 + +Title0graphics db "DREAMWEB.I00",0 +Title1graphics db "DREAMWEB.I01",0 +Title2graphics db "DREAMWEB.I02",0 +Title3graphics db "DREAMWEB.I03",0 +Title4graphics db "DREAMWEB.I04",0 +Title5graphics db "DREAMWEB.I05",0 +Title6graphics db "DREAMWEB.I06",0 +Title7graphics db "DREAMWEB.I07",0 + +Palettescreen db "DREAMWEB.PAL",0 + + + \ No newline at end of file -- cgit v1.2.3 From b97a5dcfb2e71d358274e017e4f1fdca02db4fa7 Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 15 Jun 2011 19:09:50 +0200 Subject: CONFIGURE: Fix cxx test linking for Android Libraries are now properly detected by configure again. --- configure | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/configure b/configure index e7a4335a52..cb06643b34 100755 --- a/configure +++ b/configure @@ -2208,16 +2208,9 @@ fi # case $_backend in android) - # ssp at this point so the cxxtests link - if test "$_debug_build" = yes; then - CXXFLAGS="$CXXFLAGS -fstack-protector" - else - CXXFLAGS="$CXXFLAGS -fno-stack-protector" - fi + DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" CXXFLAGS="$CXXFLAGS -Wa,--noexecstack" LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" - - DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE" ;; dc) INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc' @@ -3178,6 +3171,13 @@ fi # case $_backend in android) + # ssp at this point so the cxxtests link + if test "$_debug_build" = yes; then + CXXFLAGS="$CXXFLAGS -fstack-protector" + else + CXXFLAGS="$CXXFLAGS -fno-stack-protector" + fi + static_libs='' system_libs='' for lib in $LIBS; do -- cgit v1.2.3 From dfe83466b56a6bf382903c37aa520f282052b47f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 21:52:54 +0400 Subject: DREAMWEB: converted line endings to the unix format --- devtools/tasmrecover/dreamweb/backdrop.asm | 1746 ++-- devtools/tasmrecover/dreamweb/debug.asm | 756 +- devtools/tasmrecover/dreamweb/dreamweb.asm | 12506 +++++++++++++-------------- devtools/tasmrecover/dreamweb/keypad.asm | 3508 ++++---- devtools/tasmrecover/dreamweb/look.asm | 326 +- devtools/tasmrecover/dreamweb/monitor.asm | 2984 +++---- devtools/tasmrecover/dreamweb/newplace.asm | 1154 +-- devtools/tasmrecover/dreamweb/object.asm | 5208 +++++------ devtools/tasmrecover/dreamweb/print.asm | 1174 +-- devtools/tasmrecover/dreamweb/saveload.asm | 2964 +++---- devtools/tasmrecover/dreamweb/sblaster.asm | 2578 +++--- devtools/tasmrecover/dreamweb/sprite.asm | 10060 ++++++++++----------- devtools/tasmrecover/dreamweb/talk.asm | 1128 +-- devtools/tasmrecover/dreamweb/titles.asm | 1148 +-- devtools/tasmrecover/dreamweb/use.asm | 7612 ++++++++-------- devtools/tasmrecover/dreamweb/vars.asm | 1120 +-- devtools/tasmrecover/dreamweb/vgafades.asm | 1726 ++-- devtools/tasmrecover/dreamweb/vgagrafx.asm | 3516 ++++---- 18 files changed, 30607 insertions(+), 30607 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm index 189199db91..c02d95bbe9 100644 --- a/devtools/tasmrecover/dreamweb/backdrop.asm +++ b/devtools/tasmrecover/dreamweb/backdrop.asm @@ -1,877 +1,877 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;----------------------------------------------Code to draw floor and panel---- - -Blockget proc near - - mov ah,al - mov al,0 - mov ds,backdrop - mov si,blocks - add si,ax - ret - - endp - - - - - - - - - - - - - - - - -;--------------------------------------------------------Background display---- - - - - - - - - -Drawfloor proc near - - push es bx ;in case this was called during - call eraseoldobs ;some sprite update. - call drawflags - call calcmapad - call doblocks - call showallobs - call showallfree - call showallex - call paneltomap - call initrain - mov newobs,0 - pop bx es - ret - - endp - - - - - - - - - - - - - - - - - - -Calcmapad proc near - - call getdimension - - push cx dx - - mov al,11 - sub al,dl - sub al,cl - sub al,cl - cbw - mov bx,8 - mul bx - add ax,mapoffsetx - mov mapadx,ax - pop dx cx - - mov al,10 - sub al,dh - sub al,ch - sub al,ch - cbw - mov bx,8 - mul bx - add ax,mapoffsety - mov mapady,ax - ret - - endp - - - - - - - - - -Getdimension proc near ;Routine finds width, length - ;and top corner of room - - mov es,buffers - mov bx,mapflags - mov ch,0 -dimloop1: call addalong - cmp al,0 - jnz finishdim1 - inc ch - jmp dimloop1 ;ch holds y of top corner - -finishdim1: mov bx,mapflags - mov cl,0 -dimloop2: push bx - call addlength - pop bx - cmp al,0 - jnz finishdim2 - inc cl - add bx,3 - jmp dimloop2 ;cl holds x of top corner - -finishdim2: mov bx,mapflags+(11*3*9) - mov dh,10 -dimloop3: push bx - call addalong - pop bx - cmp al,0 - jnz finishdim3 - dec dh - sub bx,11*3 - jmp dimloop3 ;dh holds y of bottom corner - -finishdim3: mov bx,mapflags+(3*10) - mov dl,11 -dimloop4: push bx - call addlength - pop bx - cmp al,0 - jnz finishdim4 - dec dl - sub bx,3 - jmp dimloop4 ;dl holds x of bottom corner - -finishdim4: mov al,cl ;cl holds x start - mov ah,0 - shl ax,1 - shl ax,1 - shl ax,1 - shl ax,1 - mov mapxstart,ax - mov al,ch ;ch holds y start - mov ah,0 - shl ax,1 - shl ax,1 - shl ax,1 - shl ax,1 - mov mapystart,ax - - sub dl,cl - sub dh,ch - ;dx holds x and y size of room - mov al,dl ;dl holds x size - mov ah,0 - shl ax,1 - shl ax,1 - shl ax,1 - shl ax,1 - mov mapxsize,al - mov al,dh ;dh holds y size - mov ah,0 - shl ax,1 - shl ax,1 - shl ax,1 - shl ax,1 - mov mapysize,al ;cx still holds top left corner - ret - - endp - - - - - - - - - - - - -Addalong proc near - - mov ah,11 -addloop: cmp byte ptr [es:bx],0 - jnz gotalong - add bx,3 - dec ah - jnz addloop - mov al,0 - ret -gotalong: mov al,1 - ret - - endp - - - - - -Addlength proc near - - mov ah,10 -addloop2: cmp byte ptr [es:bx],0 - jnz gotlength - add bx,3*11 - dec ah - jnz addloop2 - mov al,0 - ret -gotlength: mov al,1 - ret - - endp - - - - - - - - - - - - - - - - - - - - -Drawflags proc near - - mov es,buffers - mov di,mapflags - mov al,mapy - mov ah,0 - mov cx,mapwidth - mul cx - mov bl,mapx - mov bh,0 - add ax,bx - mov si,map - add si,ax - - mov cx,10 -$28: push cx - mov cx,11 -$28a: mov ds,mapdata - lodsb - mov ds,backdrop - push si ax - mov ah,0 - add ax,ax - mov si,flags - add si,ax - movsw - pop ax - stosb - pop si - loop $28a - add si,mapwidth-11 - pop cx - loop $28 - ret - - endp - - - - - - - - - - - - - - -;-------------------------------------------------------Set object printing---- - -Eraseoldobs proc near - - cmp newobs,0 - jz donterase - - mov es,buffers - mov bx,spritetable - - mov cx,16 -oberase: push cx bx - mov ax,[es:bx+20] - cmp ax,0ffffh - jz notthisob - mov di,bx - mov al,255 - mov cx,tablesize - rep stosb -notthisob: pop bx cx - add bx,tablesize - loop oberase - -donterase: ret - - endp - - - - - - - - - - - - - - - - - - - - -Showallobs proc near - - mov es,buffers - mov bx,setlist - mov listpos,bx - mov di,bx - mov cx,128*5 - mov al,255 - rep stosb - - mov es,setframes - mov frsegment,es - mov ax,framedata - mov dataad,ax - mov ax,frames - mov framesad,ax - mov currentob,0 - - mov ds,setdat - mov si,0 - - mov cx,128 -showobsloop: push cx si - - push si - add si,58 - mov es,setdat - call getmapad - pop si - cmp ch,0 - jz blankframe - - mov al,[es:si+18] - mov ah,0 - mov currentframe,ax - cmp al,255 - jz blankframe - - push es si - call calcfrframe - call finalframe - pop si es - - mov al,[es:si+18] - mov [es:si+17],al - cmp byte ptr [es:si+8],0 - jnz animating - cmp byte ptr [es:si+5],5 - jz animating - cmp byte ptr [es:si+5],6 - jz animating - mov ax,currentframe - mov ah,0 - add di,mapadx - add bx,mapady - call showframe - jmp drawnsetob - -animating: call makebackob - -drawnsetob: mov si,listpos - mov es,buffers - mov al,savex - mov ah,savey - mov [es:si],ax - mov cx,ax - mov ax,savesize - add al,cl - add ah,ch - mov [es:si+2],ax - mov al,currentob - mov [es:si+4],al - add si,5 - mov listpos,si - -blankframe: inc currentob - pop si cx - add si,64 - dec cx - jz finishedsetobs - jmp showobsloop - -finishedsetobs: ret - - endp - - - - - - - - - - - - - - -Makebackob proc near - - cmp newobs,0 - jz nomake - - mov al,[es:si+5] ; priority - mov ah,[es:si+8] ; type - steady, constant,random,door etc. - push si ax si - mov ax,objectx - mov bx,objecty - mov ah,bl - mov si,ax - mov cx,offset cs:backobject - mov dx,setframes - mov di,framedata - call makesprite - pop ax - mov [es:bx+20],ax - pop ax - cmp al,255 - jnz usedpriority ; forgotten to specify priority - mov al,0 -usedpriority: mov [es:bx+23],al - mov [es:bx+30],ah - mov byte ptr [es:bx+16],0 - mov byte ptr [es:bx+18],0 - mov byte ptr [es:bx+19],0 - pop si -nomake: ret - - endp - - - - -;------------------------------------------------------Free object printing---- - -Showallfree proc near - - mov es,buffers - mov bx,freelist - mov listpos,bx - mov di,freelist - mov cx,80*5 - mov al,255 - rep stosb - - mov es,freeframes - mov frsegment,es - mov ax,frframedata - mov dataad,ax - mov ax,frframes - mov framesad,ax - mov al,0 - mov currentfree,al - - mov ds,freedat - mov si,2 - - mov cx,0 -loop127: push cx si - - push si - mov es,freedat - call getmapad - pop si - cmp ch,0 - jz over138 - - mov al,currentfree - mov ah,0 - mov dx,ax - add ax,ax - add ax,dx - mov currentframe,ax - - push es si - call calcfrframe - mov es,mapstore - mov ds,frsegment - call finalframe - pop si es - cmp cx,0 - jz over138 - - mov ax,currentframe - mov ah,0 - add di,mapadx - add bx,mapady - call showframe - mov si,listpos - mov es,buffers - mov al,savex - mov ah,savey - mov [es:si],ax - mov cx,ax - mov ax,savesize - add al,cl - add ah,ch - mov [es:si+2],ax - pop ax cx - push cx ax - mov [es:si+4],cl - add si,5 - mov listpos,si - -over138: inc currentfree - pop si cx - add si,16 - inc cx - cmp cx,80 - jz finfree - jmp loop127 - -finfree: ret - - endp - - - - - - - - - - - - -Showallex proc near - - mov es,buffers - mov bx,exlist - mov listpos,bx - mov di,exlist - mov cx,100*5 - mov al,255 - rep stosb - - mov es,extras - mov frsegment,es - mov ax,exframedata - mov dataad,ax - mov ax,exframes - mov framesad,ax - mov currentex,0 - - mov si,exdata+2 - - mov cx,0 -exloop: push cx si - - mov es,extras - - push si - mov ch,0 - cmp byte ptr [es:si],255 - jz notinroom - mov al,[es:si-2] - cmp al,reallocation - jnz notinroom - call getmapad -notinroom: pop si - cmp ch,0 - jz blankex - - mov al,currentex - mov ah,0 - mov dx,ax - add ax,ax - add ax,dx - mov currentframe,ax - - push es si - call calcfrframe - mov es,mapstore - mov ds,frsegment - call finalframe - pop si es - cmp cx,0 - jz blankex - - mov ax,currentframe - mov ah,0 - add di,mapadx - add bx,mapady - call showframe - mov si,listpos - mov es,buffers - mov al,savex - mov ah,savey - mov [es:si],ax - mov cx,ax - mov ax,savesize - add al,cl - add ah,ch - mov [es:si+2],ax - pop ax cx - push cx ax - mov [es:si+4],cl - add si,5 - mov listpos,si - -blankex: inc currentex - pop si cx - add si,16 - inc cx - cmp cx,100 - jz finex - jmp exloop - -finex: ret - - endp - - - - - - - -Calcfrframe proc near - - mov dx,frsegment - mov ax,framesad - push ax - mov cx,dataad - mov ax,currentframe - mov ds,dx - mov bx,6 - mul bx - add ax,cx - mov bx,ax - mov cx,[bx] - mov ax,[bx+2] - mov dx,[bx+4] - pop bx - push dx - add ax,bx ;ax=source add, cx=x,y - ;need this later - mov savesource,ax - mov savesize,cx - pop ax - push ax - mov ah,0 - mov offsetx,ax - pop ax - mov al,ah - mov ah,0 - mov offsety,ax - ret -nullframe: pop ax - mov cx,0 - mov savesize,cx - ret - - endp - - - - - - - - - - - - - - - - - - -Finalframe proc near - - mov ax,objecty - add ax,offsety - mov bx,objectx - add bx,offsetx - mov savex,bl - mov savey,al - mov di,objectx - mov bx,objecty - ret - - endp - - - - - - - - - - - - - -Adjustlen proc near - - mov ah,al - add al,ch - cmp al,100 - jc over242 - mov al,224 - sub al,ch - mov ch,al -over242: ret - - endp - - - - - - - - - -Getmapad proc near - - call getxad - cmp ch,0 - jz over146 - mov objectx,ax - call getyad - cmp ch,0 - jz over146 - mov objecty,ax - mov ch,1 -over146: ret - - endp - - - - - - - - - -Getxad proc near - - mov cl,[es:si] - inc si - mov al,[es:si] - inc si - mov ah,[es:si] - inc si - cmp cl,0 - jnz over148 - sub al,mapx - jc over148 - cmp al,11 - jnc over148 - mov cl,4 - shl al,cl - or al,ah - mov ah,0 - mov ch,1 - ret -over148: mov ch,0 - ret - - endp - - - - - - - - - -Getyad proc near - - mov al,[es:si] - inc si - mov ah,[es:si] - inc si - sub al,mapy - jc over147 - cmp al,10 - jnc over147 - mov cl,4 - shl al,cl - or al,ah - mov ah,0 - mov ch,1 - ret - -over147: mov ch,0 - ret - - endp - - - - - - - - - - - - - - - - - - - - - - - - +;----------------------------------------------Code to draw floor and panel---- + +Blockget proc near + + mov ah,al + mov al,0 + mov ds,backdrop + mov si,blocks + add si,ax + ret + + endp + + + + + + + + + + + + + + + + +;--------------------------------------------------------Background display---- + + + + + + + + +Drawfloor proc near + + push es bx ;in case this was called during + call eraseoldobs ;some sprite update. + call drawflags + call calcmapad + call doblocks + call showallobs + call showallfree + call showallex + call paneltomap + call initrain + mov newobs,0 + pop bx es + ret + + endp + + + + + + + + + + + + + + + + + + +Calcmapad proc near + + call getdimension + + push cx dx + + mov al,11 + sub al,dl + sub al,cl + sub al,cl + cbw + mov bx,8 + mul bx + add ax,mapoffsetx + mov mapadx,ax + pop dx cx + + mov al,10 + sub al,dh + sub al,ch + sub al,ch + cbw + mov bx,8 + mul bx + add ax,mapoffsety + mov mapady,ax + ret + + endp + + + + + + + + + +Getdimension proc near ;Routine finds width, length + ;and top corner of room + + mov es,buffers + mov bx,mapflags + mov ch,0 +dimloop1: call addalong + cmp al,0 + jnz finishdim1 + inc ch + jmp dimloop1 ;ch holds y of top corner + +finishdim1: mov bx,mapflags + mov cl,0 +dimloop2: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim2 + inc cl + add bx,3 + jmp dimloop2 ;cl holds x of top corner + +finishdim2: mov bx,mapflags+(11*3*9) + mov dh,10 +dimloop3: push bx + call addalong + pop bx + cmp al,0 + jnz finishdim3 + dec dh + sub bx,11*3 + jmp dimloop3 ;dh holds y of bottom corner + +finishdim3: mov bx,mapflags+(3*10) + mov dl,11 +dimloop4: push bx + call addlength + pop bx + cmp al,0 + jnz finishdim4 + dec dl + sub bx,3 + jmp dimloop4 ;dl holds x of bottom corner + +finishdim4: mov al,cl ;cl holds x start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxstart,ax + mov al,ch ;ch holds y start + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapystart,ax + + sub dl,cl + sub dh,ch + ;dx holds x and y size of room + mov al,dl ;dl holds x size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapxsize,al + mov al,dh ;dh holds y size + mov ah,0 + shl ax,1 + shl ax,1 + shl ax,1 + shl ax,1 + mov mapysize,al ;cx still holds top left corner + ret + + endp + + + + + + + + + + + + +Addalong proc near + + mov ah,11 +addloop: cmp byte ptr [es:bx],0 + jnz gotalong + add bx,3 + dec ah + jnz addloop + mov al,0 + ret +gotalong: mov al,1 + ret + + endp + + + + + +Addlength proc near + + mov ah,10 +addloop2: cmp byte ptr [es:bx],0 + jnz gotlength + add bx,3*11 + dec ah + jnz addloop2 + mov al,0 + ret +gotlength: mov al,1 + ret + + endp + + + + + + + + + + + + + + + + + + + + +Drawflags proc near + + mov es,buffers + mov di,mapflags + mov al,mapy + mov ah,0 + mov cx,mapwidth + mul cx + mov bl,mapx + mov bh,0 + add ax,bx + mov si,map + add si,ax + + mov cx,10 +$28: push cx + mov cx,11 +$28a: mov ds,mapdata + lodsb + mov ds,backdrop + push si ax + mov ah,0 + add ax,ax + mov si,flags + add si,ax + movsw + pop ax + stosb + pop si + loop $28a + add si,mapwidth-11 + pop cx + loop $28 + ret + + endp + + + + + + + + + + + + + + +;-------------------------------------------------------Set object printing---- + +Eraseoldobs proc near + + cmp newobs,0 + jz donterase + + mov es,buffers + mov bx,spritetable + + mov cx,16 +oberase: push cx bx + mov ax,[es:bx+20] + cmp ax,0ffffh + jz notthisob + mov di,bx + mov al,255 + mov cx,tablesize + rep stosb +notthisob: pop bx cx + add bx,tablesize + loop oberase + +donterase: ret + + endp + + + + + + + + + + + + + + + + + + + + +Showallobs proc near + + mov es,buffers + mov bx,setlist + mov listpos,bx + mov di,bx + mov cx,128*5 + mov al,255 + rep stosb + + mov es,setframes + mov frsegment,es + mov ax,framedata + mov dataad,ax + mov ax,frames + mov framesad,ax + mov currentob,0 + + mov ds,setdat + mov si,0 + + mov cx,128 +showobsloop: push cx si + + push si + add si,58 + mov es,setdat + call getmapad + pop si + cmp ch,0 + jz blankframe + + mov al,[es:si+18] + mov ah,0 + mov currentframe,ax + cmp al,255 + jz blankframe + + push es si + call calcfrframe + call finalframe + pop si es + + mov al,[es:si+18] + mov [es:si+17],al + cmp byte ptr [es:si+8],0 + jnz animating + cmp byte ptr [es:si+5],5 + jz animating + cmp byte ptr [es:si+5],6 + jz animating + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + jmp drawnsetob + +animating: call makebackob + +drawnsetob: mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + mov al,currentob + mov [es:si+4],al + add si,5 + mov listpos,si + +blankframe: inc currentob + pop si cx + add si,64 + dec cx + jz finishedsetobs + jmp showobsloop + +finishedsetobs: ret + + endp + + + + + + + + + + + + + + +Makebackob proc near + + cmp newobs,0 + jz nomake + + mov al,[es:si+5] ; priority + mov ah,[es:si+8] ; type - steady, constant,random,door etc. + push si ax si + mov ax,objectx + mov bx,objecty + mov ah,bl + mov si,ax + mov cx,offset cs:backobject + mov dx,setframes + mov di,framedata + call makesprite + pop ax + mov [es:bx+20],ax + pop ax + cmp al,255 + jnz usedpriority ; forgotten to specify priority + mov al,0 +usedpriority: mov [es:bx+23],al + mov [es:bx+30],ah + mov byte ptr [es:bx+16],0 + mov byte ptr [es:bx+18],0 + mov byte ptr [es:bx+19],0 + pop si +nomake: ret + + endp + + + + +;------------------------------------------------------Free object printing---- + +Showallfree proc near + + mov es,buffers + mov bx,freelist + mov listpos,bx + mov di,freelist + mov cx,80*5 + mov al,255 + rep stosb + + mov es,freeframes + mov frsegment,es + mov ax,frframedata + mov dataad,ax + mov ax,frframes + mov framesad,ax + mov al,0 + mov currentfree,al + + mov ds,freedat + mov si,2 + + mov cx,0 +loop127: push cx si + + push si + mov es,freedat + call getmapad + pop si + cmp ch,0 + jz over138 + + mov al,currentfree + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz over138 + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +over138: inc currentfree + pop si cx + add si,16 + inc cx + cmp cx,80 + jz finfree + jmp loop127 + +finfree: ret + + endp + + + + + + + + + + + + +Showallex proc near + + mov es,buffers + mov bx,exlist + mov listpos,bx + mov di,exlist + mov cx,100*5 + mov al,255 + rep stosb + + mov es,extras + mov frsegment,es + mov ax,exframedata + mov dataad,ax + mov ax,exframes + mov framesad,ax + mov currentex,0 + + mov si,exdata+2 + + mov cx,0 +exloop: push cx si + + mov es,extras + + push si + mov ch,0 + cmp byte ptr [es:si],255 + jz notinroom + mov al,[es:si-2] + cmp al,reallocation + jnz notinroom + call getmapad +notinroom: pop si + cmp ch,0 + jz blankex + + mov al,currentex + mov ah,0 + mov dx,ax + add ax,ax + add ax,dx + mov currentframe,ax + + push es si + call calcfrframe + mov es,mapstore + mov ds,frsegment + call finalframe + pop si es + cmp cx,0 + jz blankex + + mov ax,currentframe + mov ah,0 + add di,mapadx + add bx,mapady + call showframe + mov si,listpos + mov es,buffers + mov al,savex + mov ah,savey + mov [es:si],ax + mov cx,ax + mov ax,savesize + add al,cl + add ah,ch + mov [es:si+2],ax + pop ax cx + push cx ax + mov [es:si+4],cl + add si,5 + mov listpos,si + +blankex: inc currentex + pop si cx + add si,16 + inc cx + cmp cx,100 + jz finex + jmp exloop + +finex: ret + + endp + + + + + + + +Calcfrframe proc near + + mov dx,frsegment + mov ax,framesad + push ax + mov cx,dataad + mov ax,currentframe + mov ds,dx + mov bx,6 + mul bx + add ax,cx + mov bx,ax + mov cx,[bx] + mov ax,[bx+2] + mov dx,[bx+4] + pop bx + push dx + add ax,bx ;ax=source add, cx=x,y + ;need this later + mov savesource,ax + mov savesize,cx + pop ax + push ax + mov ah,0 + mov offsetx,ax + pop ax + mov al,ah + mov ah,0 + mov offsety,ax + ret +nullframe: pop ax + mov cx,0 + mov savesize,cx + ret + + endp + + + + + + + + + + + + + + + + + + +Finalframe proc near + + mov ax,objecty + add ax,offsety + mov bx,objectx + add bx,offsetx + mov savex,bl + mov savey,al + mov di,objectx + mov bx,objecty + ret + + endp + + + + + + + + + + + + + +Adjustlen proc near + + mov ah,al + add al,ch + cmp al,100 + jc over242 + mov al,224 + sub al,ch + mov ch,al +over242: ret + + endp + + + + + + + + + +Getmapad proc near + + call getxad + cmp ch,0 + jz over146 + mov objectx,ax + call getyad + cmp ch,0 + jz over146 + mov objecty,ax + mov ch,1 +over146: ret + + endp + + + + + + + + + +Getxad proc near + + mov cl,[es:si] + inc si + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + cmp cl,0 + jnz over148 + sub al,mapx + jc over148 + cmp al,11 + jnc over148 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret +over148: mov ch,0 + ret + + endp + + + + + + + + + +Getyad proc near + + mov al,[es:si] + inc si + mov ah,[es:si] + inc si + sub al,mapy + jc over147 + cmp al,10 + jnc over147 + mov cl,4 + shl al,cl + or al,ah + mov ah,0 + mov ch,1 + ret + +over147: mov ch,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm index 3c24913b2e..991e240fd1 100644 --- a/devtools/tasmrecover/dreamweb/debug.asm +++ b/devtools/tasmrecover/dreamweb/debug.asm @@ -1,382 +1,382 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text - - if debuglevel2 - - -Debugkeys proc near - - ret - - endp - - - -Debugstart proc near - - call allpalette - mov reeltohold,-1 - mov newlocation,23 - mov dreamnumber,0 - mov al,"W" - mov ah,"S" - mov cl,"H" - mov ch,"D" - call findexobject - mov byte ptr [es:bx+12],"S"-"A" - mov byte ptr [es:bx+13],"C"-"A" - mov byte ptr [es:bx+14],"R"-"A" - mov byte ptr [es:bx+15],"W"-"A" - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"A" - call findexobject - mov byte ptr [es:bx+12],"G"-"A" - mov byte ptr [es:bx+13],"U"-"A" - mov byte ptr [es:bx+14],"N"-"A" - mov byte ptr [es:bx+15],"A"-"A" - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"B" - call findexobject - mov byte ptr [es:bx+12],"S"-"A" - mov byte ptr [es:bx+13],"H"-"A" - mov byte ptr [es:bx+14],"L"-"A" - mov byte ptr [es:bx+15],"D"-"A" - mov card1money,12342 - - ret - - endp - - - - - -Debuggreen proc near - - push ax dx - mov al,0 - mov dx,3c8h - out dx,al - mov dx,3c9h - mov al,0 - out dx,al - mov al,63 - out dx,al - mov al,0 - out dx,al - pop dx ax - ret - - endp - - - - - - - - -Debugred proc near - - push ax dx - mov al,0 - mov dx,3c8h - out dx,al - mov dx,3c9h - mov al,63 - out dx,al - mov al,0 - out dx,al - mov al,0 - out dx,al - pop dx ax - ret - - endp - - - - -Debugblue proc near - - push ax dx - mov al,0 - mov dx,3c8h - out dx,al - mov dx,3c9h - mov al,0 - out dx,al - mov al,0 - out dx,al - mov al,63 - out dx,al - pop dx ax - ret - - endp - - - - - -Debugblack proc near - - push dx ax - mov al,0 - mov dx,3c8h - out dx,al - mov dx,3c9h - mov al,0 - out dx,al - mov al,0 - out dx,al - mov al,0 - out dx,al - pop ax dx - ret - - endp - - - - - - - - - - - -Debug proc near - - push ds dx cx - mov ah,3ch - mov cx,0 - mov dx,seg filenamed - mov ds,dx - mov dx,offset filenamed - int 21h - mov bx,ax - pop cx dx ds - push bx - mov ah,40h - int 21h - pop bx - mov ah,3eh - int 21h - ret - -filenamed db "DREAMWEB.TXT",0 - - endp - - - - - - - - -Shout proc near - - push ax bx cx dx si di es ds - call debugblue - mov cx,50 - call hangon - call debugblack - mov cx,10 - call hangon - pop ds es di si dx cx bx ax - ret - - endp - - -Shoutred proc near - - push ax bx cx dx si di es ds - call debugred - mov cx,4 - call hangon - call debugblack - mov cx,40 - call hangon - pop ds es di si dx cx bx ax - ret - - endp - - - -Shoutgreen proc near - - push ax bx cx dx si di es ds - call debuggreen - mov cx,4 - call hangon - call debugblack - mov cx,40 - call hangon - pop ds es di si dx cx bx ax - ret - - endp - - - - - - - - - -;Checkmemingame proc near - -; cmp charset1,0 -; jz nodebug -; mov bx,60000 -; mov ah,48h -; int 21h -; mov ax,bx -; mov cl,6 -; shr ax,cl -; mov di,offset cs:debugtextig -; call showword - -; mov ax,soundbufferwrite -; ;mov ax,exframepos -; mov di,offset cs:debugtextex -; call showword - -; ;mov ax,extextpos -; ;mov di,offset cs:debugtextex2 -; ;call showword - -; push cs -; pop es -; mov si,offset cs:debugtextig -; mov al,0 -; mov ah,0 -; mov dl,100 -; mov di,204 -; mov bx,14 -; call printdirect -; push cs -; pop es -; mov si,offset cs:debugtextex -; mov al,0 -; mov ah,0 -; mov dl,100 -; mov di,204 -; mov bx,22 -; call printdirect -; push cs -; pop es -; mov si,offset cs:debugtextex2 -; mov al,0 -; mov ah,0 -; mov dl,100 -; mov di,204 -; mov bx,30 -; call printdirect -; mov di,204 -; mov bx,14 -; mov cl,40 -; mov ch,24 -; call multidump -;nodebug: ret - - endp - -debugtextig: db "00000K",0 - -debugtextex: db "00000b",0 - -debugtextex2: db "00000b",0 - - - - - - - if recording - - mov ax,recordpos - mov di,offset cs:debugtextr - call showword - - mov al,0 - call print - dw 4,4,100 -debugtextr: db "00000",0 - - mov si,0 - mov di,0 - mov cl,40 - mov ch,12 - call multidump - - endif - - ret - - endp - - - - - - - - - - - - - - - - - - -;Debugax proc near -; -; push ax -; call showpanel -; pop ax -; mov di,offset cs:debugaxtext -; call showword -; -; mov di,204 -; mov bx,14 -; mov al,0 -; mov ah,0 -; mov dl,100 -; push cs -; pop es -; mov si,offset cs:debugaxtext -; call printdirect -; mov di,204 -; mov bx,14 -; mov cl,40 -; mov ch,24 -; call multidump -; ret -; -;debugaxtext db "00000 ",0 -; -; endp - - - - - - - - endif + + if debuglevel2 + + +Debugkeys proc near + + ret + + endp + + + +Debugstart proc near + + call allpalette + mov reeltohold,-1 + mov newlocation,23 + mov dreamnumber,0 + mov al,"W" + mov ah,"S" + mov cl,"H" + mov ch,"D" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"C"-"A" + mov byte ptr [es:bx+14],"R"-"A" + mov byte ptr [es:bx+15],"W"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov byte ptr [es:bx+12],"G"-"A" + mov byte ptr [es:bx+13],"U"-"A" + mov byte ptr [es:bx+14],"N"-"A" + mov byte ptr [es:bx+15],"A"-"A" + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov byte ptr [es:bx+12],"S"-"A" + mov byte ptr [es:bx+13],"H"-"A" + mov byte ptr [es:bx+14],"L"-"A" + mov byte ptr [es:bx+15],"D"-"A" + mov card1money,12342 + + ret + + endp + + + + + +Debuggreen proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,63 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + + + + + +Debugred proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,63 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop dx ax + ret + + endp + + + + +Debugblue proc near + + push ax dx + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,63 + out dx,al + pop dx ax + ret + + endp + + + + + +Debugblack proc near + + push dx ax + mov al,0 + mov dx,3c8h + out dx,al + mov dx,3c9h + mov al,0 + out dx,al + mov al,0 + out dx,al + mov al,0 + out dx,al + pop ax dx + ret + + endp + + + + + + + + + + + +Debug proc near + + push ds dx cx + mov ah,3ch + mov cx,0 + mov dx,seg filenamed + mov ds,dx + mov dx,offset filenamed + int 21h + mov bx,ax + pop cx dx ds + push bx + mov ah,40h + int 21h + pop bx + mov ah,3eh + int 21h + ret + +filenamed db "DREAMWEB.TXT",0 + + endp + + + + + + + + +Shout proc near + + push ax bx cx dx si di es ds + call debugblue + mov cx,50 + call hangon + call debugblack + mov cx,10 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + +Shoutred proc near + + push ax bx cx dx si di es ds + call debugred + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + +Shoutgreen proc near + + push ax bx cx dx si di es ds + call debuggreen + mov cx,4 + call hangon + call debugblack + mov cx,40 + call hangon + pop ds es di si dx cx bx ax + ret + + endp + + + + + + + + + +;Checkmemingame proc near + +; cmp charset1,0 +; jz nodebug +; mov bx,60000 +; mov ah,48h +; int 21h +; mov ax,bx +; mov cl,6 +; shr ax,cl +; mov di,offset cs:debugtextig +; call showword + +; mov ax,soundbufferwrite +; ;mov ax,exframepos +; mov di,offset cs:debugtextex +; call showword + +; ;mov ax,extextpos +; ;mov di,offset cs:debugtextex2 +; ;call showword + +; push cs +; pop es +; mov si,offset cs:debugtextig +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,14 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,22 +; call printdirect +; push cs +; pop es +; mov si,offset cs:debugtextex2 +; mov al,0 +; mov ah,0 +; mov dl,100 +; mov di,204 +; mov bx,30 +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +;nodebug: ret + + endp + +debugtextig: db "00000K",0 + +debugtextex: db "00000b",0 + +debugtextex2: db "00000b",0 + + + + + + + if recording + + mov ax,recordpos + mov di,offset cs:debugtextr + call showword + + mov al,0 + call print + dw 4,4,100 +debugtextr: db "00000",0 + + mov si,0 + mov di,0 + mov cl,40 + mov ch,12 + call multidump + + endif + + ret + + endp + + + + + + + + + + + + + + + + + + +;Debugax proc near +; +; push ax +; call showpanel +; pop ax +; mov di,offset cs:debugaxtext +; call showword +; +; mov di,204 +; mov bx,14 +; mov al,0 +; mov ah,0 +; mov dl,100 +; push cs +; pop es +; mov si,offset cs:debugaxtext +; call printdirect +; mov di,204 +; mov bx,14 +; mov cl,40 +; mov ch,24 +; call multidump +; ret +; +;debugaxtext db "00000 ",0 +; +; endp + + + + + + + + endif  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index 2b98b97b34..ea61338ae3 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -1,6262 +1,6262 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text - - - - - - - - - -;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -;³ ³ -;³ DREAMWEB ³ -;³ ³ -;³ ³ -;³ ³ -;³ ³ -;³ Written by Neil Dodwell. Graphics by Dave Dew. ³ -;³ ³ -;³ Started on Friday 28 December 1990 at 1:20 pm ³ -;³ ³ -;³ Copyright 1990/1991 Creative Reality ³ ³ -;³ ³ -;³ ³ -;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - - - - - - - - - - - - - - - -;----------------------------------------------------------Assembly options---- - -JUMPS - -playback equ 0 -recording equ 0 -debuglevel1 equ 0 ;memory debug on -debuglevel2 equ 0 ;debug keys on+shouts -demo equ 0 -CD equ 1 -Foreign equ 0 -Spanish equ 0 -German equ 0 - -;----------------------------------------------------------------Code start---- - -DREAMWEBPROG segment para public 'CODE' - - assume cs:DREAMWEBPROG,ss:STACKSPACE - - - - -;------------------------------------------------------------------Includes---- - -include \pc\dreamweb\vars.asm ;variables and equates -include \pc\dreamweb\sprite.asm ;sprite routines -include \pc\dreamweb\vgagrafx.asm ;screen routines for vga -include \pc\dreamweb\vgafades.asm ;fade routines -include \pc\dreamweb\titles.asm ;guess! -include \pc\dreamweb\print.asm ;text printing routines -include \pc\dreamweb\object.asm ;pickup -include \pc\dreamweb\backdrop.asm ;draws floor etc. -include \pc\dreamweb\look.asm ;look command -include \pc\dreamweb\talk.asm ;conversations -include \pc\dreamweb\newplace.asm ;travel -include \pc\dreamweb\monitor.asm ;network machine -include \pc\dreamweb\use.asm ;individual use routines -include \pc\dreamweb\keypad.asm ;accept code with keypad -include \pc\dreamweb\saveload.asm ;in game options -include \pc\dreamweb\sblaster.asm - if debuglevel1 -include \pc\dreamweb\debug.asm - else - if debuglevel2 -include \pc\dreamweb\debug.asm - endif - endif - -;-----------------------------------------------------------------Main loop---- - - -Dreamweb proc near - - call seecommandtail - - call checkbasemem - call soundstartup - call setkeyboardint - call setupemm - call allocatebuffers - call setmouse - call fadedos - call gettime - - call clearbuffers - call clearpalette - call set16colpalette - call readsetdata - if demo - call changeroomnums - endif - mov wongame,0 - - mov dx,offset cs:basicsample - call loadsample - call setsoundoff - - if demo - else - call scanfornames - cmp al,0 - jnz dodecisions - endif - - call setmode - call loadpalfromiff - - call titles - call credits - jmp playgame - -dodecisions: call cls - call setmode - call decide - cmp getback,4 - jz mainloop - - call titles - call credits - -playgame: call clearchanges - call setmode - call loadpalfromiff - mov location,255 - mov roomafterdream,1 - if demo - mov newlocation,5 - else - mov newlocation,35 - endif - mov volume,7 - call loadroom - call clearsprites - call initman - call entrytexts - call entryanims - mov destpos,3 - call initialinv - mov lastflag,32 - call startup1 - mov volumeto,0 - mov volumedirection,-1 - mov commandtype,255 - jmp mainloop - -loadnew: if demo - cmp newlocation,27 - jnz not27 - call fadescreendowns - mov cx,260 - call hangon - call clearbeforeload - jmp playgame -not27: - endif - call clearbeforeload - call loadroom - call clearsprites - call initman - call entrytexts - call entryanims - mov newlocation,255 - call startup - mov commandtype,255 - call worktoscreenm - jmp mainloop - -alreadyloaded: mov newlocation,255 - call clearsprites - call initman - call startup - mov commandtype,255 - -mainloop: call screenupdate - cmp wongame,0 - jnz endofgame - cmp mandead,1 - jz gameover - cmp mandead,2 - jz gameover - cmp watchingtime,0 - jz notwatching - mov al,finaldest - cmp al,manspath - jnz mainloop - dec watchingtime - jnz mainloop - -notwatching: cmp mandead,4 - jz gameover - cmp newlocation,255 - jnz loadnew - jmp mainloop - -gameover: if demo - call fadescreendowns - mov cx,260 - call hangon - call clearbeforeload - jmp playgame - endif - call clearbeforeload - call showgun - call fadescreendown - mov cx,100 - call hangon - jmp dodecisions - -endofgame: call clearbeforeload - call fadescreendowns - mov cx,200 - call hangon - call endgame - jmp quickquit2 - - endp - - - - - endp - - - - if demo - -Changeroomnums proc near - - mov di,offset cs:roomdata+10 - mov cx,50 -changenumloop: mov al,[cs:di] - cmp al,"0" - jnz nochange - mov al,[cs:di+1] - cmp al,"5" - jnz nochange - mov al,"6" - mov ah,"0" - mov [cs:di],ax -nochange: add di,32 - loop changenumloop - ret - - endp - - endif - - - - -Entrytexts proc near - - cmp location,21 - jnz notloc15 - mov al,28 - mov cx,60 - mov dx,11 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notloc15: cmp location,30 - jnz notloc43 - mov al,27 - mov cx,60 - mov dx,11 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notloc43: cmp location,23 - jnz notloc23 - mov al,29 - mov cx,60 - mov dx,11 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notloc23: cmp location,31 - jnz notloc44 - mov al,30 - mov cx,60 - mov dx,11 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notloc44: cmp location,20 - jnz notsarters2 - mov al,31 - mov cx,60 - mov dx,11 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notsarters2: cmp location,24 - jnz notedenlob - mov al,32 - mov cx,60 - mov dx,3 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -notedenlob: cmp location,34 - jnz noteden2 - mov al,33 - mov cx,60 - mov dx,3 - mov bl,68 - mov bh,64 - call setuptimeduse - ret -noteden2: ret - - endp - - - - - - - - -Entryanims proc near - - mov reeltowatch,-1 - mov watchmode,-1 - cmp location,33 - jnz notinthebeach - call switchryanoff - mov watchingtime,76*2 - mov reeltowatch,0 - mov endwatchreel,76 - mov watchspeed,1 - mov speedcount,1 - ret -notinthebeach: cmp location,44 - jnz notsparkys - mov al,8 - call resetlocation - mov watchingtime,50*2 - mov reeltowatch,247 - mov endwatchreel,297 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret -notsparkys: cmp location,22 - jnz notinthelift - mov watchingtime,31*2 - mov reeltowatch,0 - mov endwatchreel,30 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret -notinthelift: cmp location,26 - jnz notunderchurch - mov symboltopnum,2 - mov symbolbotnum,1 - ret -notunderchurch: cmp location,45 - jnz notenterdream - mov keeperflag,0 - mov watchingtime,296 - mov reeltowatch,45 - mov endwatchreel,198 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret -notenterdream: cmp reallocation,46 - jnz notcrystal - cmp sartaindead,1 - jnz notcrystal - mov al,0 - call removefreeobject - ret -notcrystal: cmp location,9 - jnz nottopchurch - mov al,2 - call checkifpathison - jz nottopchurch - cmp aidedead,0 - jz nottopchurch - mov al,3 - call checkifpathison - jnz makedoorsopen - mov al,2 - call turnpathon -makedoorsopen: mov al,4 - call removesetobject - mov al,5 - call placesetobject - ret -nottopchurch: cmp location,47 - jnz notdreamcentre - mov al,4 - call placesetobject - mov al,5 - call placesetobject - ret -notdreamcentre: cmp location,38 - jnz notcarpark - mov watchingtime,57*2 - mov reeltowatch,4 - mov endwatchreel,57 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret -notcarpark: cmp location,32 - jnz notalley - mov watchingtime,66*2 - mov reeltowatch,0 - mov endwatchreel,66 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret -notalley: cmp location,24 - jnz notedensagain - mov al,2 - mov ah,roomnum - dec ah - call turnanypathon -notedensagain: ret - - endp - - - - - - - if demo -Initialinv proc near - - mov al,11 - mov ah,5 - call pickupob - mov al,12 - mov ah,6 - call pickupob - mov al,13 - mov ah,7 - call pickupob - mov al,14 - mov ah,8 - call pickupob - mov al,18 - mov ah,0 - call pickupob - mov al,19 - mov ah,1 - call pickupob - mov al,20 - mov ah,9 - call pickupob - mov al,16 - mov ah,2 - call pickupob - - mov al,2 - mov ah,4 - call pickupob - - mov al,29 - mov ah,10 - call pickupob - mov al,33 - mov ah,11 - call pickupob - mov al,44 - mov ah,12 - call pickupob - mov card1money,12342 - ret - - endp - else -Initialinv proc near - - cmp reallocation,24 - jz isedens - ret - -isedens: mov al,11 - mov ah,5 - call pickupob - mov al,12 - mov ah,6 - call pickupob - mov al,13 - mov ah,7 - call pickupob - mov al,14 - mov ah,8 - call pickupob - mov al,18 - mov al,18 - mov ah,0 - call pickupob - mov al,19 - mov ah,1 - call pickupob - mov al,20 - mov ah,9 - call pickupob - mov al,16 - mov ah,2 - call pickupob - - mov watchmode,1 - mov reeltohold,0 - mov endofholdreel,6 - mov watchspeed,1 - mov speedcount,1 - call switchryanoff - ret - - endp - - endif - - - - - - - - - - - -Pickupob proc near - - mov lastinvpos,ah - mov objecttype,2 - mov itemframe,al - mov command,al - call getanyad - call transfertoex - ret - - endp - - - - - - - - - - - - - - - -;---------------------------------------------------------Memory allocation---- - - - - -Setupemm proc near - - cmp soundint,255 - jz noneedforemm - call checkforemm - - mov ah,43h ;allocate handle and 160 pages - mov bx,176 ;was 176 - int 67h - cmp ah,0 - jnz emmerror1 ;if there's an error drop to DOS - mov emmhandle,dx - mov ah,41h ;get the page frame base address - int 67h - cmp ah,0 - jnz emmerror1 - mov emmpageframe,bx - mov ax,bx - mov cl,12 - shr ax,cl - mov emmhardwarepage,al -noneedforemm: ret -emmerror1: mov gameerror,1 - jmp quickquit2 - - endp - - - - - - - - -Removeemm proc near - - cmp soundint,255 - jz noneedtoremove - mov ah,45h - mov dx,emmhandle - int 67h -noneedtoremove: ret - - endp - - - - - -Checkforemm proc near - - ret - - endp - - - - -Checkbasemem proc near - - mov bx,howmuchalloc - cmp bx,9360h - jnc enoughmem - mov gameerror,5 - jmp quickquit -enoughmem: ret - - endp - - - -Allocatebuffers proc near - - mov bx,lengthofextra/16 - call allocatemem - mov extras,ax - - call trysoundalloc - mov bx,lengthofmap/16 - call allocatemem - mov mapdata,ax - - call trysoundalloc - mov bx,lengthofbuffer/16 - call allocatemem - mov buffers,ax - - call trysoundalloc - mov bx,freedatlen/16 - call allocatemem - mov freedat,ax - - call trysoundalloc - mov bx,setdatlen/16 - call allocatemem - mov setdat,ax - - call trysoundalloc - mov bx,lenofmapstore/16 - call allocatemem - mov mapstore,ax - - if recording - mov bx,1028 - call allocatemem - mov recordspace,ax - endif - - if playback - mov bx,1028 - call allocatemem - mov recordspace,ax - endif - - call allocatework - - mov bx,2048/16 - call allocatemem - mov sounddata,ax - - mov bx,2048/16 - call allocatemem - mov sounddata2,ax - ret - - endp - - - - - - - - - - -Clearbuffers proc near - - mov es,buffers - mov cx,lengthofbuffer/2 - mov ax,0 - mov di,0 - rep stosw - - mov es,extras - mov cx,lengthofextra/2 - mov ax,0ffffh - mov di,0 - rep stosw - - mov es,buffers - mov di,initialreelrouts - push cs - pop ds - mov si,offset cs:reelroutines - mov cx,lenofreelrouts - rep movsb - - mov es,buffers - mov di,initialvars - push cs - pop ds - mov si,offset cs:startvars - mov cx,lengthofvars - rep movsb - call clearchanges - ret - - endp - - - - - - -Clearchanges proc near - - mov es,buffers - mov cx,numchanges*2 - mov ax,0ffffh - mov di,listofchanges - rep stosw - mov ds,buffers - mov si,initialreelrouts - push cs - pop es - mov di,offset cs:reelroutines - mov cx,lenofreelrouts - rep movsb - - mov ds,buffers - mov si,initialvars - push cs - pop es - mov di,offset cs:startvars - mov cx,lengthofvars - rep movsb - - mov expos,0 - mov exframepos,0 - mov extextpos,0 - mov es,extras - mov cx,lengthofextra/2 - mov ax,0ffffh - mov di,0 - rep stosw - - push cs - pop es - mov di,offset cs:roomscango - mov al,1 - stosb - stosb - mov al,0 - stosb - mov al,1 - stosb - mov ax,0 - mov cx,6 - rep stosw - ret - - endp - - - - - - - -Clearbeforeload proc near ;deallocates variable buffers - ;and clears out fixed ones - cmp roomloaded,1 - jnz noclear - call clearreels - call clearrest - mov roomloaded,0 -noclear: ret - - endp - - - -;Clearnoreels proc near -; -; cmp roomloaded,1 -; jnz noclear2 -; call clearrest -; mov roomloaded,0 -;noclear2: ret -; -; endp - - - - - - -Clearreels proc near - - mov es,reel1 - call deallocatemem - mov es,reel2 - call deallocatemem - mov es,reel3 - call deallocatemem - ret - - endp - - - -Clearrest proc near - - mov es,mapdata - mov cx,maplen/2 - mov ax,0 - mov di,map - rep stosw - - mov es,backdrop - call deallocatemem - mov es,setframes - call deallocatemem - mov es,reels - call deallocatemem - mov es,people - call deallocatemem - mov es,setdesc - call deallocatemem - mov es,blockdesc - call deallocatemem - mov es,roomdesc - call deallocatemem - mov es,freeframes - call deallocatemem - mov es,freedesc - call deallocatemem - ret - - endp - - - - - - -Deallocatemem proc near - - mov ah,49h - int 21h - jc deallerror - ret -deallerror: mov gameerror,4 - jmp quickquit2 - ret - - endp - - - - - - - - -Allocatemem proc near - - add bx,2 - mov ah,48h - int 21h - jc memerror - ret - -memerror: mov gameerror,3 - jmp quickquit2 - - endp - - - - -Seecommandtail proc near - - mov soundbaseadd,220h - mov soundint,5 - mov sounddmachannel,1 - mov brightness,0 - - mov bx,2 - mov ax,[es:bx] - mov dx,es - sub ax,dx - mov howmuchalloc,ax - - mov bx,02ch - mov ax,[es:bx] - push es bx - - mov es,ax - mov bx,0 -findblaster: mov ax,[es:bx] - cmp ax,0 - jz endofenvironment - cmp al,"B" - jnz notblast - cmp ah,"L" - jnz notblast - cmp byte ptr [es:bx+2],"A" - jnz notblast - cmp byte ptr [es:bx+3],"S" - jnz notblast - cmp byte ptr [es:bx+4],"T" - jnz notblast - cmp byte ptr [es:bx+5],"E" - jnz notblast - cmp byte ptr [es:bx+6],"R" - jnz notblast - add bx,7 - call parseblaster - jmp endofenvironment -notblast: inc bx - jmp findblaster - -endofenvironment: pop bx es - mov bx,81h - call parseblaster - ret - - endp - - - -Parseblaster proc near - -lookattail: mov al,[es:bx] - cmp al,0 - jz endtail - cmp al,13 - jz endtail - cmp al,"i" - jz issoundint - cmp al,"I" - jz issoundint - cmp al,"b" - jz isbright - cmp al,"B" - jz isbright - cmp al,"a" - jz isbaseadd - cmp al,"A" - jz isbaseadd - cmp al,"n" - jz isnosound - cmp al,"N" - jz isnosound - cmp al,"d" - jz isdma - cmp al,"D" - jz isdma - inc bx - loop lookattail - ret - -issoundint: mov al,[es:bx+1] - sub al,"0" - mov soundint,al - inc bx - jmp lookattail -isdma: mov al,[es:bx+1] - sub al,"0" - mov sounddmachannel,al - inc bx - jmp lookattail -isbaseadd: push cx - mov al,[es:bx+2] - sub al,"0" - mov ah,0 - mov cl,4 - shl ax,cl - add ax,200h - mov soundbaseadd,ax - pop cx - inc bx - jmp lookattail -isbright: mov brightness,1 - inc bx - jmp lookattail -isnosound: mov soundint,255 - inc bx - jmp lookattail -endtail: ret - - endp - - - - -;-------------------------------------------------------High level routines---- - -Startup proc near - - mov currentkey,0 - mov mainmode,0 - call createpanel - mov newobs,1 - call drawfloor - call showicon - call getunderzoom - call spriteupdate - call printsprites - call undertextline - call reelsonscreen - call atmospheres - ret - - endp - - - - -Startup1 proc near - - - call clearpalette - mov throughdoor,0 - mov currentkey,"0" - mov mainmode,0 - call createpanel - mov newobs,1 - call drawfloor - - call showicon - call getunderzoom - call spriteupdate - call printsprites - call undertextline - call reelsonscreen - call atmospheres - call worktoscreen - call fadescreenup - ret - - endp - - - - - - - - -;--------------------------------------------------Scroll location routines---- - - - - - -Screenupdate proc near - - call newplace - call mainscreen - call animpointer - call showpointer - cmp watchingtime,0 - jnz iswatchingmode - cmp newlocation,255 - jnz finishearly -iswatchingmode: call vsync - call readmouse1 - call dumppointer - call dumptextline - call delpointer - call autolook - call spriteupdate - call watchcount - call zoom - call showpointer - cmp wongame,0 - jnz finishearly - - call vsync - call readmouse2 - call dumppointer - call dumpzoom - call delpointer - call deleverything - call printsprites - call reelsonscreen - call afternewroom - call showpointer - - call vsync - call readmouse3 - call dumppointer - call dumpmap - call dumptimedtext - call delpointer - call showpointer - - call vsync - call readmouse4 - call dumppointer - call dumpwatch - call delpointer - -finishearly: ret - - endp - - - - - - - - - - - - - - - -Watchreel proc near - - cmp reeltowatch,-1 - jz notplayingreel - mov al,manspath - cmp al,finaldest - jnz waitstopwalk - mov al,turntoface - cmp al,facing - jz notwatchpath -waitstopwalk: ret - -notwatchpath: dec speedcount - cmp speedcount,-1 - jnz showwatchreel - mov al,watchspeed - mov speedcount,al - mov ax,reeltowatch - cmp ax,endwatchreel - jnz ismorereel - cmp watchingtime,0 - jnz showwatchreel - mov reeltowatch,-1 - mov watchmode,-1 - cmp reeltohold,-1 - jz nomorereel - mov watchmode,1 - jmp notplayingreel -ismorereel: inc reeltowatch -showwatchreel: mov ax,reeltowatch - mov reelpointer,ax - call plotreel - mov ax,reelpointer - mov reeltowatch,ax - call checkforshake -nomorereel: ret - - -notplayingreel: cmp watchmode,1 - jnz notholdingreel - mov ax,reeltohold - mov reelpointer,ax - call plotreel - ret - -notholdingreel: cmp watchmode,2 - jnz notreleasehold - dec speedcount - cmp speedcount,-1 - jnz notlastspeed2 - mov al,watchspeed - mov speedcount,al - inc reeltohold -notlastspeed2: mov ax,reeltohold - cmp ax,endofholdreel - jnz ismorereel2 - mov reeltohold,-1 - mov watchmode,-1 - mov al,destafterhold - mov destination,al - mov finaldest,al - call autosetwalk - ret -ismorereel2: mov ax,reeltohold - mov reelpointer,ax - call plotreel - ret - -notreleasehold: ret - - endp - - - - - -Checkforshake proc near - - cmp reallocation,26 - jnz notstartshake - cmp ax,104 - jnz notstartshake - mov shakecounter,-1 -notstartshake: ret - - endp - - - - - -Watchcount proc near - - cmp watchon,0 - jz nowatchworn - inc timercount - cmp timercount,9 - jz flashdots - cmp timercount,18 - jz uptime -nowatchworn: ret - -flashdots: mov ax,91*3+21 - mov di,268+4 - mov bx,21 - mov ds,charset1 - call showframe - jmp finishwatch - -uptime: mov timercount,0 - add secondcount,1 - cmp secondcount,60 - jnz finishtime - mov secondcount,0 - inc minutecount - cmp minutecount,60 - jnz finishtime - mov minutecount,0 - inc hourcount - cmp hourcount,24 - jnz finishtime - mov hourcount,0 - -finishtime: call showtime -finishwatch: mov watchdump,1 - ret - - endp - - - -Showtime proc near - - cmp watchon,0 - jz nowatch - - mov al,secondcount - mov cl,0 - call twodigitnum - push ax - mov al,ah - mov ah,0 - add ax,91*3+10 - mov ds,charset1 - mov di,282+5 - mov bx,21 - call showframe - pop ax - mov ah,0 - add ax,91*3+10 - mov ds,charset1 - mov di,282+9 - mov bx,21 - call showframe - - mov al,minutecount - mov cl,0 - call twodigitnum - push ax - mov al,ah - mov ah,0 - add ax,91*3 - mov ds,charset1 - mov di,270+5 - mov bx,21 - call showframe - pop ax - mov ah,0 - add ax,91*3 - mov ds,charset1 - mov di,270+11 - mov bx,21 - call showframe - - mov al,hourcount - mov cl,0 - call twodigitnum - push ax - mov al,ah - mov ah,0 - add ax,91*3 - mov ds,charset1 - mov di,256+5 - mov bx,21 - call showframe - pop ax - mov ah,0 - add ax,91*3 - mov ds,charset1 - mov di,256+11 - mov bx,21 - call showframe - - mov ax,91*3+20 - mov ds,charset1 - mov di,267+5 - mov bx,21 - call showframe -nowatch: ret - - - endp - - - - -Dumpwatch proc near - - cmp watchdump,1 - jnz nodumpwatch - mov di,256 - mov bx,21 - mov cl,40 - mov ch,12 - call multidump - mov watchdump,0 -nodumpwatch: ret - - endp - - - - -Showbyte proc near - - mov dl,al - shr dl,1 - shr dl,1 - shr dl,1 - shr dl,1 - call onedigit - mov [es:di],dl - mov dl,al - and dl,15 - call onedigit - mov [es:di+1],dl - add di,3 - ret - - endp - - -Onedigit proc near - - cmp dl,10 - jnc morethan10 - add dl,"0" - ret -morethan10: sub dl,10 - add dl,"A" - ret - - endp - - - - - -Twodigitnum proc near - - mov ah,cl - dec ah -numloop1: inc ah - sub al,10 - jnc numloop1 - add al,10 - add al,cl - ret - - endp - - - - - -Showword proc near - - mov ch,0 - mov bx,10000 - mov cl,47 -word1: inc cl - sub ax,bx - jnc word1 - add ax,bx - call convnum - mov [cs:di],cl - mov bx,1000 - mov cl,47 -word2: inc cl - sub ax,bx - jnc word2 - add ax,bx - call convnum - mov [cs:di+1],cl - mov bx,100 - mov cl,47 -word3: inc cl - sub ax,bx - jnc word3 - add ax,bx - call convnum - mov [cs:di+2],cl - mov bx,10 - mov cl,47 -word4: inc cl - sub ax,bx - jnc word4 - add ax,bx - call convnum - mov [cs:di+3],cl - add al,48 - mov cl,al - call convnum - mov [cs:di+4],cl - ret - - endp - - - - -Convnum proc near - - cmp ch,0 - jnz noconvnum - cmp cl,"0" - jnz notzeronum - mov cl,32 - jmp noconvnum -notzeronum: mov ch,1 -noconvnum: ret - - endp - - - - - - - - -;---------------------------------------------Handling of pointer on screen---- - -Mainscreen proc near - - mov inmaparea,0 - mov bx,offset cs:mainlist - cmp watchon,1 - jz checkmain - mov bx,offset cs:mainlist2 -checkmain: call checkcoords - cmp walkandexam,0 - jz finishmain - call walkandexamine -finishmain: ret - -mainlist: dw 44,70,32,46,look - dw 0,50,0,180,inventory - dw 226,244,10,26,zoomonoff - dw 226,244,26,40,saveload - dw 240,260,100,124,madmanrun - dw 0,320,0,200,identifyob - dw 0ffffh - -mainlist2: dw 44,70,32,46,look - dw 0,50,0,180,inventory - dw 226+48,244+48,10,26,zoomonoff - dw 226+48,244+48,26,40,saveload - dw 240,260,100,124,madmanrun - dw 0,320,0,200,identifyob - dw 0ffffh - - endp - - - - - - -Madmanrun proc near - - cmp location,14 - jnz identifyob - cmp mapx,22 - jnz identifyob - cmp pointermode,2 - jnz identifyob - cmp madmanflag,0 - jnz identifyob - - cmp commandtype,211 - jz alreadyrun - mov commandtype,211 - mov al,52 - call commandonly -alreadyrun: cmp mousebutton,1 - jnz norun - mov ax,mousebutton - cmp ax,oldbutton - jz norun - mov lastweapon,8 -norun: ret - - endp - - - - - - -Checkcoords proc near + + + + + + + + + +;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ +;³ ³ +;³ DREAMWEB ³ +;³ ³ +;³ ³ +;³ ³ +;³ ³ +;³ Written by Neil Dodwell. Graphics by Dave Dew. ³ +;³ ³ +;³ Started on Friday 28 December 1990 at 1:20 pm ³ +;³ ³ +;³ Copyright 1990/1991 Creative Reality ³ ³ +;³ ³ +;³ ³ +;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + + + + + + + + + + + + + + + +;----------------------------------------------------------Assembly options---- + +JUMPS + +playback equ 0 +recording equ 0 +debuglevel1 equ 0 ;memory debug on +debuglevel2 equ 0 ;debug keys on+shouts +demo equ 0 +CD equ 1 +Foreign equ 0 +Spanish equ 0 +German equ 0 + +;----------------------------------------------------------------Code start---- + +DREAMWEBPROG segment para public 'CODE' + + assume cs:DREAMWEBPROG,ss:STACKSPACE + + + + +;------------------------------------------------------------------Includes---- + +include \pc\dreamweb\vars.asm ;variables and equates +include \pc\dreamweb\sprite.asm ;sprite routines +include \pc\dreamweb\vgagrafx.asm ;screen routines for vga +include \pc\dreamweb\vgafades.asm ;fade routines +include \pc\dreamweb\titles.asm ;guess! +include \pc\dreamweb\print.asm ;text printing routines +include \pc\dreamweb\object.asm ;pickup +include \pc\dreamweb\backdrop.asm ;draws floor etc. +include \pc\dreamweb\look.asm ;look command +include \pc\dreamweb\talk.asm ;conversations +include \pc\dreamweb\newplace.asm ;travel +include \pc\dreamweb\monitor.asm ;network machine +include \pc\dreamweb\use.asm ;individual use routines +include \pc\dreamweb\keypad.asm ;accept code with keypad +include \pc\dreamweb\saveload.asm ;in game options +include \pc\dreamweb\sblaster.asm + if debuglevel1 +include \pc\dreamweb\debug.asm + else + if debuglevel2 +include \pc\dreamweb\debug.asm + endif + endif + +;-----------------------------------------------------------------Main loop---- + + +Dreamweb proc near + + call seecommandtail + + call checkbasemem + call soundstartup + call setkeyboardint + call setupemm + call allocatebuffers + call setmouse + call fadedos + call gettime + + call clearbuffers + call clearpalette + call set16colpalette + call readsetdata + if demo + call changeroomnums + endif + mov wongame,0 + + mov dx,offset cs:basicsample + call loadsample + call setsoundoff + + if demo + else + call scanfornames + cmp al,0 + jnz dodecisions + endif + + call setmode + call loadpalfromiff + + call titles + call credits + jmp playgame + +dodecisions: call cls + call setmode + call decide + cmp getback,4 + jz mainloop + + call titles + call credits + +playgame: call clearchanges + call setmode + call loadpalfromiff + mov location,255 + mov roomafterdream,1 + if demo + mov newlocation,5 + else + mov newlocation,35 + endif + mov volume,7 + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov destpos,3 + call initialinv + mov lastflag,32 + call startup1 + mov volumeto,0 + mov volumedirection,-1 + mov commandtype,255 + jmp mainloop + +loadnew: if demo + cmp newlocation,27 + jnz not27 + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame +not27: + endif + call clearbeforeload + call loadroom + call clearsprites + call initman + call entrytexts + call entryanims + mov newlocation,255 + call startup + mov commandtype,255 + call worktoscreenm + jmp mainloop + +alreadyloaded: mov newlocation,255 + call clearsprites + call initman + call startup + mov commandtype,255 + +mainloop: call screenupdate + cmp wongame,0 + jnz endofgame + cmp mandead,1 + jz gameover + cmp mandead,2 + jz gameover + cmp watchingtime,0 + jz notwatching + mov al,finaldest + cmp al,manspath + jnz mainloop + dec watchingtime + jnz mainloop + +notwatching: cmp mandead,4 + jz gameover + cmp newlocation,255 + jnz loadnew + jmp mainloop + +gameover: if demo + call fadescreendowns + mov cx,260 + call hangon + call clearbeforeload + jmp playgame + endif + call clearbeforeload + call showgun + call fadescreendown + mov cx,100 + call hangon + jmp dodecisions + +endofgame: call clearbeforeload + call fadescreendowns + mov cx,200 + call hangon + call endgame + jmp quickquit2 + + endp + + + + + endp + + + + if demo + +Changeroomnums proc near + + mov di,offset cs:roomdata+10 + mov cx,50 +changenumloop: mov al,[cs:di] + cmp al,"0" + jnz nochange + mov al,[cs:di+1] + cmp al,"5" + jnz nochange + mov al,"6" + mov ah,"0" + mov [cs:di],ax +nochange: add di,32 + loop changenumloop + ret + + endp + + endif + + + + +Entrytexts proc near + + cmp location,21 + jnz notloc15 + mov al,28 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc15: cmp location,30 + jnz notloc43 + mov al,27 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc43: cmp location,23 + jnz notloc23 + mov al,29 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc23: cmp location,31 + jnz notloc44 + mov al,30 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notloc44: cmp location,20 + jnz notsarters2 + mov al,31 + mov cx,60 + mov dx,11 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notsarters2: cmp location,24 + jnz notedenlob + mov al,32 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +notedenlob: cmp location,34 + jnz noteden2 + mov al,33 + mov cx,60 + mov dx,3 + mov bl,68 + mov bh,64 + call setuptimeduse + ret +noteden2: ret + + endp + + + + + + + + +Entryanims proc near + + mov reeltowatch,-1 + mov watchmode,-1 + cmp location,33 + jnz notinthebeach + call switchryanoff + mov watchingtime,76*2 + mov reeltowatch,0 + mov endwatchreel,76 + mov watchspeed,1 + mov speedcount,1 + ret +notinthebeach: cmp location,44 + jnz notsparkys + mov al,8 + call resetlocation + mov watchingtime,50*2 + mov reeltowatch,247 + mov endwatchreel,297 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notsparkys: cmp location,22 + jnz notinthelift + mov watchingtime,31*2 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notinthelift: cmp location,26 + jnz notunderchurch + mov symboltopnum,2 + mov symbolbotnum,1 + ret +notunderchurch: cmp location,45 + jnz notenterdream + mov keeperflag,0 + mov watchingtime,296 + mov reeltowatch,45 + mov endwatchreel,198 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notenterdream: cmp reallocation,46 + jnz notcrystal + cmp sartaindead,1 + jnz notcrystal + mov al,0 + call removefreeobject + ret +notcrystal: cmp location,9 + jnz nottopchurch + mov al,2 + call checkifpathison + jz nottopchurch + cmp aidedead,0 + jz nottopchurch + mov al,3 + call checkifpathison + jnz makedoorsopen + mov al,2 + call turnpathon +makedoorsopen: mov al,4 + call removesetobject + mov al,5 + call placesetobject + ret +nottopchurch: cmp location,47 + jnz notdreamcentre + mov al,4 + call placesetobject + mov al,5 + call placesetobject + ret +notdreamcentre: cmp location,38 + jnz notcarpark + mov watchingtime,57*2 + mov reeltowatch,4 + mov endwatchreel,57 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notcarpark: cmp location,32 + jnz notalley + mov watchingtime,66*2 + mov reeltowatch,0 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret +notalley: cmp location,24 + jnz notedensagain + mov al,2 + mov ah,roomnum + dec ah + call turnanypathon +notedensagain: ret + + endp + + + + + + + if demo +Initialinv proc near + + mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov al,2 + mov ah,4 + call pickupob + + mov al,29 + mov ah,10 + call pickupob + mov al,33 + mov ah,11 + call pickupob + mov al,44 + mov ah,12 + call pickupob + mov card1money,12342 + ret + + endp + else +Initialinv proc near + + cmp reallocation,24 + jz isedens + ret + +isedens: mov al,11 + mov ah,5 + call pickupob + mov al,12 + mov ah,6 + call pickupob + mov al,13 + mov ah,7 + call pickupob + mov al,14 + mov ah,8 + call pickupob + mov al,18 + mov al,18 + mov ah,0 + call pickupob + mov al,19 + mov ah,1 + call pickupob + mov al,20 + mov ah,9 + call pickupob + mov al,16 + mov ah,2 + call pickupob + + mov watchmode,1 + mov reeltohold,0 + mov endofholdreel,6 + mov watchspeed,1 + mov speedcount,1 + call switchryanoff + ret + + endp + + endif + + + + + + + + + + + +Pickupob proc near + + mov lastinvpos,ah + mov objecttype,2 + mov itemframe,al + mov command,al + call getanyad + call transfertoex + ret + + endp + + + + + + + + + + + + + + + +;---------------------------------------------------------Memory allocation---- + + + + +Setupemm proc near + + cmp soundint,255 + jz noneedforemm + call checkforemm + + mov ah,43h ;allocate handle and 160 pages + mov bx,176 ;was 176 + int 67h + cmp ah,0 + jnz emmerror1 ;if there's an error drop to DOS + mov emmhandle,dx + mov ah,41h ;get the page frame base address + int 67h + cmp ah,0 + jnz emmerror1 + mov emmpageframe,bx + mov ax,bx + mov cl,12 + shr ax,cl + mov emmhardwarepage,al +noneedforemm: ret +emmerror1: mov gameerror,1 + jmp quickquit2 + + endp + + + + + + + + +Removeemm proc near + + cmp soundint,255 + jz noneedtoremove + mov ah,45h + mov dx,emmhandle + int 67h +noneedtoremove: ret + + endp + + + + + +Checkforemm proc near + + ret + + endp + + + + +Checkbasemem proc near + + mov bx,howmuchalloc + cmp bx,9360h + jnc enoughmem + mov gameerror,5 + jmp quickquit +enoughmem: ret + + endp + + + +Allocatebuffers proc near + + mov bx,lengthofextra/16 + call allocatemem + mov extras,ax + + call trysoundalloc + mov bx,lengthofmap/16 + call allocatemem + mov mapdata,ax + + call trysoundalloc + mov bx,lengthofbuffer/16 + call allocatemem + mov buffers,ax + + call trysoundalloc + mov bx,freedatlen/16 + call allocatemem + mov freedat,ax + + call trysoundalloc + mov bx,setdatlen/16 + call allocatemem + mov setdat,ax + + call trysoundalloc + mov bx,lenofmapstore/16 + call allocatemem + mov mapstore,ax + + if recording + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + if playback + mov bx,1028 + call allocatemem + mov recordspace,ax + endif + + call allocatework + + mov bx,2048/16 + call allocatemem + mov sounddata,ax + + mov bx,2048/16 + call allocatemem + mov sounddata2,ax + ret + + endp + + + + + + + + + + +Clearbuffers proc near + + mov es,buffers + mov cx,lengthofbuffer/2 + mov ax,0 + mov di,0 + rep stosw + + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + mov es,buffers + mov di,initialreelrouts + push cs + pop ds + mov si,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov es,buffers + mov di,initialvars + push cs + pop ds + mov si,offset cs:startvars + mov cx,lengthofvars + rep movsb + call clearchanges + ret + + endp + + + + + + +Clearchanges proc near + + mov es,buffers + mov cx,numchanges*2 + mov ax,0ffffh + mov di,listofchanges + rep stosw + mov ds,buffers + mov si,initialreelrouts + push cs + pop es + mov di,offset cs:reelroutines + mov cx,lenofreelrouts + rep movsb + + mov ds,buffers + mov si,initialvars + push cs + pop es + mov di,offset cs:startvars + mov cx,lengthofvars + rep movsb + + mov expos,0 + mov exframepos,0 + mov extextpos,0 + mov es,extras + mov cx,lengthofextra/2 + mov ax,0ffffh + mov di,0 + rep stosw + + push cs + pop es + mov di,offset cs:roomscango + mov al,1 + stosb + stosb + mov al,0 + stosb + mov al,1 + stosb + mov ax,0 + mov cx,6 + rep stosw + ret + + endp + + + + + + + +Clearbeforeload proc near ;deallocates variable buffers + ;and clears out fixed ones + cmp roomloaded,1 + jnz noclear + call clearreels + call clearrest + mov roomloaded,0 +noclear: ret + + endp + + + +;Clearnoreels proc near +; +; cmp roomloaded,1 +; jnz noclear2 +; call clearrest +; mov roomloaded,0 +;noclear2: ret +; +; endp + + + + + + +Clearreels proc near + + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + ret + + endp + + + +Clearrest proc near + + mov es,mapdata + mov cx,maplen/2 + mov ax,0 + mov di,map + rep stosw + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + + +Deallocatemem proc near + + mov ah,49h + int 21h + jc deallerror + ret +deallerror: mov gameerror,4 + jmp quickquit2 + ret + + endp + + + + + + + + +Allocatemem proc near + + add bx,2 + mov ah,48h + int 21h + jc memerror + ret + +memerror: mov gameerror,3 + jmp quickquit2 + + endp + + + + +Seecommandtail proc near + + mov soundbaseadd,220h + mov soundint,5 + mov sounddmachannel,1 + mov brightness,0 + + mov bx,2 + mov ax,[es:bx] + mov dx,es + sub ax,dx + mov howmuchalloc,ax + + mov bx,02ch + mov ax,[es:bx] + push es bx + + mov es,ax + mov bx,0 +findblaster: mov ax,[es:bx] + cmp ax,0 + jz endofenvironment + cmp al,"B" + jnz notblast + cmp ah,"L" + jnz notblast + cmp byte ptr [es:bx+2],"A" + jnz notblast + cmp byte ptr [es:bx+3],"S" + jnz notblast + cmp byte ptr [es:bx+4],"T" + jnz notblast + cmp byte ptr [es:bx+5],"E" + jnz notblast + cmp byte ptr [es:bx+6],"R" + jnz notblast + add bx,7 + call parseblaster + jmp endofenvironment +notblast: inc bx + jmp findblaster + +endofenvironment: pop bx es + mov bx,81h + call parseblaster + ret + + endp + + + +Parseblaster proc near + +lookattail: mov al,[es:bx] + cmp al,0 + jz endtail + cmp al,13 + jz endtail + cmp al,"i" + jz issoundint + cmp al,"I" + jz issoundint + cmp al,"b" + jz isbright + cmp al,"B" + jz isbright + cmp al,"a" + jz isbaseadd + cmp al,"A" + jz isbaseadd + cmp al,"n" + jz isnosound + cmp al,"N" + jz isnosound + cmp al,"d" + jz isdma + cmp al,"D" + jz isdma + inc bx + loop lookattail + ret + +issoundint: mov al,[es:bx+1] + sub al,"0" + mov soundint,al + inc bx + jmp lookattail +isdma: mov al,[es:bx+1] + sub al,"0" + mov sounddmachannel,al + inc bx + jmp lookattail +isbaseadd: push cx + mov al,[es:bx+2] + sub al,"0" + mov ah,0 + mov cl,4 + shl ax,cl + add ax,200h + mov soundbaseadd,ax + pop cx + inc bx + jmp lookattail +isbright: mov brightness,1 + inc bx + jmp lookattail +isnosound: mov soundint,255 + inc bx + jmp lookattail +endtail: ret + + endp + + + + +;-------------------------------------------------------High level routines---- + +Startup proc near + + mov currentkey,0 + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + ret + + endp + + + + +Startup1 proc near + + + call clearpalette + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call createpanel + mov newobs,1 + call drawfloor + + call showicon + call getunderzoom + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call atmospheres + call worktoscreen + call fadescreenup + ret + + endp + + + + + + + + +;--------------------------------------------------Scroll location routines---- + + + + + +Screenupdate proc near + + call newplace + call mainscreen + call animpointer + call showpointer + cmp watchingtime,0 + jnz iswatchingmode + cmp newlocation,255 + jnz finishearly +iswatchingmode: call vsync + call readmouse1 + call dumppointer + call dumptextline + call delpointer + call autolook + call spriteupdate + call watchcount + call zoom + call showpointer + cmp wongame,0 + jnz finishearly + + call vsync + call readmouse2 + call dumppointer + call dumpzoom + call delpointer + call deleverything + call printsprites + call reelsonscreen + call afternewroom + call showpointer + + call vsync + call readmouse3 + call dumppointer + call dumpmap + call dumptimedtext + call delpointer + call showpointer + + call vsync + call readmouse4 + call dumppointer + call dumpwatch + call delpointer + +finishearly: ret + + endp + + + + + + + + + + + + + + + +Watchreel proc near + + cmp reeltowatch,-1 + jz notplayingreel + mov al,manspath + cmp al,finaldest + jnz waitstopwalk + mov al,turntoface + cmp al,facing + jz notwatchpath +waitstopwalk: ret + +notwatchpath: dec speedcount + cmp speedcount,-1 + jnz showwatchreel + mov al,watchspeed + mov speedcount,al + mov ax,reeltowatch + cmp ax,endwatchreel + jnz ismorereel + cmp watchingtime,0 + jnz showwatchreel + mov reeltowatch,-1 + mov watchmode,-1 + cmp reeltohold,-1 + jz nomorereel + mov watchmode,1 + jmp notplayingreel +ismorereel: inc reeltowatch +showwatchreel: mov ax,reeltowatch + mov reelpointer,ax + call plotreel + mov ax,reelpointer + mov reeltowatch,ax + call checkforshake +nomorereel: ret + + +notplayingreel: cmp watchmode,1 + jnz notholdingreel + mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notholdingreel: cmp watchmode,2 + jnz notreleasehold + dec speedcount + cmp speedcount,-1 + jnz notlastspeed2 + mov al,watchspeed + mov speedcount,al + inc reeltohold +notlastspeed2: mov ax,reeltohold + cmp ax,endofholdreel + jnz ismorereel2 + mov reeltohold,-1 + mov watchmode,-1 + mov al,destafterhold + mov destination,al + mov finaldest,al + call autosetwalk + ret +ismorereel2: mov ax,reeltohold + mov reelpointer,ax + call plotreel + ret + +notreleasehold: ret + + endp + + + + + +Checkforshake proc near + + cmp reallocation,26 + jnz notstartshake + cmp ax,104 + jnz notstartshake + mov shakecounter,-1 +notstartshake: ret + + endp + + + + + +Watchcount proc near + + cmp watchon,0 + jz nowatchworn + inc timercount + cmp timercount,9 + jz flashdots + cmp timercount,18 + jz uptime +nowatchworn: ret + +flashdots: mov ax,91*3+21 + mov di,268+4 + mov bx,21 + mov ds,charset1 + call showframe + jmp finishwatch + +uptime: mov timercount,0 + add secondcount,1 + cmp secondcount,60 + jnz finishtime + mov secondcount,0 + inc minutecount + cmp minutecount,60 + jnz finishtime + mov minutecount,0 + inc hourcount + cmp hourcount,24 + jnz finishtime + mov hourcount,0 + +finishtime: call showtime +finishwatch: mov watchdump,1 + ret + + endp + + + +Showtime proc near + + cmp watchon,0 + jz nowatch + + mov al,secondcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3+10 + mov ds,charset1 + mov di,282+9 + mov bx,21 + call showframe + + mov al,minutecount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,270+11 + mov bx,21 + call showframe + + mov al,hourcount + mov cl,0 + call twodigitnum + push ax + mov al,ah + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+5 + mov bx,21 + call showframe + pop ax + mov ah,0 + add ax,91*3 + mov ds,charset1 + mov di,256+11 + mov bx,21 + call showframe + + mov ax,91*3+20 + mov ds,charset1 + mov di,267+5 + mov bx,21 + call showframe +nowatch: ret + + + endp + + + + +Dumpwatch proc near + + cmp watchdump,1 + jnz nodumpwatch + mov di,256 + mov bx,21 + mov cl,40 + mov ch,12 + call multidump + mov watchdump,0 +nodumpwatch: ret + + endp + + + + +Showbyte proc near + + mov dl,al + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + call onedigit + mov [es:di],dl + mov dl,al + and dl,15 + call onedigit + mov [es:di+1],dl + add di,3 + ret + + endp + + +Onedigit proc near + + cmp dl,10 + jnc morethan10 + add dl,"0" + ret +morethan10: sub dl,10 + add dl,"A" + ret + + endp + + + + + +Twodigitnum proc near + + mov ah,cl + dec ah +numloop1: inc ah + sub al,10 + jnc numloop1 + add al,10 + add al,cl + ret + + endp + + + + + +Showword proc near + + mov ch,0 + mov bx,10000 + mov cl,47 +word1: inc cl + sub ax,bx + jnc word1 + add ax,bx + call convnum + mov [cs:di],cl + mov bx,1000 + mov cl,47 +word2: inc cl + sub ax,bx + jnc word2 + add ax,bx + call convnum + mov [cs:di+1],cl + mov bx,100 + mov cl,47 +word3: inc cl + sub ax,bx + jnc word3 + add ax,bx + call convnum + mov [cs:di+2],cl + mov bx,10 + mov cl,47 +word4: inc cl + sub ax,bx + jnc word4 + add ax,bx + call convnum + mov [cs:di+3],cl + add al,48 + mov cl,al + call convnum + mov [cs:di+4],cl + ret + + endp + + + + +Convnum proc near + + cmp ch,0 + jnz noconvnum + cmp cl,"0" + jnz notzeronum + mov cl,32 + jmp noconvnum +notzeronum: mov ch,1 +noconvnum: ret + + endp + + + + + + + + +;---------------------------------------------Handling of pointer on screen---- + +Mainscreen proc near + + mov inmaparea,0 + mov bx,offset cs:mainlist + cmp watchon,1 + jz checkmain + mov bx,offset cs:mainlist2 +checkmain: call checkcoords + cmp walkandexam,0 + jz finishmain + call walkandexamine +finishmain: ret + +mainlist: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226,244,10,26,zoomonoff + dw 226,244,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + +mainlist2: dw 44,70,32,46,look + dw 0,50,0,180,inventory + dw 226+48,244+48,10,26,zoomonoff + dw 226+48,244+48,26,40,saveload + dw 240,260,100,124,madmanrun + dw 0,320,0,200,identifyob + dw 0ffffh + + endp + + + + + + +Madmanrun proc near + + cmp location,14 + jnz identifyob + cmp mapx,22 + jnz identifyob + cmp pointermode,2 + jnz identifyob + cmp madmanflag,0 + jnz identifyob + + cmp commandtype,211 + jz alreadyrun + mov commandtype,211 + mov al,52 + call commandonly +alreadyrun: cmp mousebutton,1 + jnz norun + mov ax,mousebutton + cmp ax,oldbutton + jz norun + mov lastweapon,8 +norun: ret + + endp + + + + + + +Checkcoords proc near cmp newlocation,255 ;objects keep enumerated even in loading state, fixme jz loop048 ret - -loop048: mov ax,[cs:bx] - cmp ax,0ffffh - jz nonefound - push bx - cmp mousex,ax - jl over045 - mov ax,[cs:bx+2] - cmp mousex,ax - jge over045 - mov ax,[cs:bx+4] - cmp mousey,ax - jl over045 - mov ax,[cs:bx+6] - cmp mousey,ax - jge over045 - mov ax,[cs:bx+8] - call ax -finished: pop ax - ret -over045: pop bx - add bx,10 - jmp loop048 -nonefound: ret - - endp - - - - - -;-------------------------------------------Printing of icons during scroll---- - - - - - -Identifyob proc near - - cmp watchingtime,0 - jnz blank - - mov ax,mousex - sub ax,mapadx - cmp ax,22*8 - jc notover1 - call blank - ret - -notover1: mov bx,mousey - sub bx,mapady - cmp bx,20*8 - jc notover2 - call blank - ret - -notover2: mov inmaparea,1 - mov ah,bl - push ax - call findpathofpoint - mov pointerspath,dl - pop ax - push ax - call findfirstpath - mov pointerfirstpath,al - pop ax - - call checkifex - jnz finishidentify - call checkiffree - jnz finishidentify - call checkifperson - jnz finishidentify - call checkifset - jnz finishidentify - - mov ax,mousex - sub ax,mapadx - mov cl,al - mov ax,mousey - sub ax,mapady - mov ch,al - call checkone - cmp al,0 - jz nothingund - ;cmp watchingtime,0 - ;jnz nothingund - cmp mandead,1 - jz nothingund - mov ah,3 - call obname -finishidentify: ret - -nothingund: call blank - ret - - endp - - - - - - - - -Checkifperson proc near - - mov es,buffers - mov bx,peoplelist - mov cx,12 -identifyreel: push cx - - cmp byte ptr [es:bx+4],255 - jz notareelid - - push es bx ax - mov ax,[es:bx+0] - mov reelpointer,ax - call getreelstart - cmp [es:si+2],0ffffh - jnz notblankpers - add si,5 -notblankpers: mov cx,[es:si+2] ;x,y of reel slot - mov ax,[es:si+0] ;frame number - push cx - call getreelframeax - pop cx - add cl,[es:bx+4] - add ch,[es:bx+5] - mov dx,cx - add dl,[es:bx+0] - add dh,[es:bx+1] - pop ax bx es - - cmp al,cl - jc notareelid - cmp ah,ch - jc notareelid - cmp al,dl - jnc notareelid - cmp ah,dh - jnc notareelid - - pop cx - mov ax,[es:bx+2] - mov persondata,ax - mov al,[es:bx+4] - mov ah,5 - call obname - mov al,0 - cmp al,1 - ret - -notareelid: pop cx - add bx,5 - dec cx - jnz identifyreel - ret - - endp - - - - - - - - -Checkifset proc near - - mov es,buffers - mov bx,setlist+(127*5) - mov cx,127 -identifyset: cmp byte ptr [es:bx+4],255 - jz notasetid - cmp al,[es:bx] - jc notasetid - cmp al,[es:bx+2] - jnc notasetid - cmp ah,[es:bx+1] - jc notasetid - cmp ah,[es:bx+3] - jnc notasetid - call pixelcheckset - jz notasetid - call isitdescribed - jz notasetid - mov al,[es:bx+4] - mov ah,1 - call obname - mov al,0 - cmp al,1 - ret -notasetid: sub bx,5 - dec cx - cmp cx,-1 - jnz identifyset - ret - - endp - - - - - - - - - - -Checkifex proc near - - mov es,buffers - mov bx,exlist+(99*5) - mov cx,99 -identifyex: cmp byte ptr [es:bx+4],255 - jz notanexid - cmp al,[es:bx] - jc notanexid - cmp al,[es:bx+2] - jnc notanexid - cmp ah,[es:bx+1] - jc notanexid - cmp ah,[es:bx+3] - jnc notanexid - mov al,[es:bx+4] - mov ah,4 - call obname - mov al,1 - cmp al,0 - ret -notanexid: sub bx,5 - dec cx - cmp cx,-1 - jnz identifyex - ret - - endp - - - - - - -Checkiffree proc near - - mov es,buffers - mov bx,freelist+(79*5) - mov cx,79 -identifyfree: cmp byte ptr [es:bx+4],255 - jz notafreeid - cmp al,[es:bx] - jc notafreeid - cmp al,[es:bx+2] - jnc notafreeid - cmp ah,[es:bx+1] - jc notafreeid - cmp ah,[es:bx+3] - jnc notafreeid - mov al,[es:bx+4] - mov ah,2 - call obname - mov al,0 - cmp al,1 - ret -notafreeid: sub bx,5 - dec cx - cmp cx,-1 - jnz identifyfree - ret - - endp - - - - - - -Isitdescribed proc near - - push ax cx es bx - mov al,[es:bx+4] ;get object number - mov ah,0 - add ax,ax - mov bx,ax - mov es,setdesc - add bx,settextdat - mov ax,[es:bx] - add ax,settext - mov bx,ax - mov dl,[es:bx] - pop bx es cx ax - cmp dl,0 - ret - - endp - - - - - - - - -;Getcurrentpath proc near ;routine finds out which path -; ;block the pointer is in. -; push ax ;used to see if an object is -; call findpathofpoint ;close or not -; pop ax -; mov pointerspath,dl -; ret -; -; endp - - - - - -Findpathofpoint proc near - - push ax - mov bx,pathdata - mov es,reels - mov al,roomnum - mov ah,0 - mov cx,144 - mul cx - add bx,ax - pop cx - - mov dl,0 -pathloop: mov al,[es:bx+6] - cmp al,255 - jnz flunkedit - mov ax,[es:bx+2] - cmp ax,0ffffh - jz flunkedit - cmp cl,al - jc flunkedit - cmp ch,ah - jc flunkedit - mov ax,[es:bx+4] - cmp cl,al - jnc flunkedit - cmp ch,ah - jnc flunkedit - jmp gotvalidpath -flunkedit: add bx,8 - inc dl - cmp dl,12 - jnz pathloop - mov dl,255 -gotvalidpath: ret - - endp - - - - - -Findfirstpath proc near ;similar to last routine, but it - ;searches each path to see if - push ax ;pointer is within it, regardless - mov bx,pathdata ;of whether the path is on or off - mov es,reels ;it returns the on or off state in - mov al,roomnum ;al (255=on 0=off) 0 if no path - mov ah,0 - mov cx,144 - mul cx - add bx,ax - pop cx - - mov dl,0 -fpathloop: mov ax,[es:bx+2] - cmp ax,0ffffh - jz nofirst - cmp cl,al - jc nofirst - cmp ch,ah - jc nofirst - mov ax,[es:bx+4] - cmp cl,al - jnc nofirst - cmp ch,ah - jnc nofirst - jmp gotfirst -nofirst: add bx,8 - inc dl - cmp dl,12 - jnz fpathloop - mov al,0 - ret -gotfirst: mov al,[es:bx+6] - ret - - endp - - - - - - - - -Turnpathon proc near ;turns path on permanently - - push ax ax - mov cl,255 - mov ch,roomnum - add ch,100 - call findormake - pop ax - call getroomspaths - pop ax - cmp al,255 - jz nopathon - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,255 - mov [es:bx+6],al -nopathon: ret - - endp - - - - - - - -Turnpathoff proc near ;turns path on permanently - - push ax ax - mov cl,0 - mov ch,roomnum - add ch,100 - call findormake - pop ax - call getroomspaths - pop ax - cmp al,255 - jz nopathoff - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,0 - mov [es:bx+6],al -nopathoff: ret - - endp - - - - - - - - - - - - - - - -Turnanypathon proc near - - push ax ax - mov cl,255 - mov ch,ah - add ch,100 - call findormake - pop ax - mov al,ah - mov ah,0 - mov cx,144 - mul cx - mov es,reels - mov bx,pathdata - add bx,ax - pop ax - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,255 - mov [es:bx+6],al - ret - - endp - - - - - - -Turnanypathoff proc near - - push ax ax - mov cl,0 - mov ch,ah - add ch,100 - call findormake - pop ax - mov al,ah - mov ah,0 - mov cx,144 - mul cx - mov es,reels - mov bx,pathdata - add bx,ax - pop ax - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,0 - mov [es:bx+6],al - ret - - endp - - - - - -Checkifpathison proc near - - push ax - call getroomspaths - pop ax - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,[es:bx+6] - cmp al,255 - ret - - endp - - - - - -Afternewroom proc near - - cmp nowinnewroom,0 - jz notnew - mov timecount,0 - call createpanel - mov commandtype,0 - call findroominloc - - cmp ryanon,1 - jz ryansoff - - mov al,ryanx - add al,12 - mov ah,ryany - add ah,12 - call findpathofpoint - mov manspath,dl - call findxyfrompath - mov resetmanxy,1 - -ryansoff: mov newobs,1 - call drawfloor - mov lookcounter,160 - mov nowinnewroom,0 - - call showicon - call spriteupdate - call printsprites - call undertextline - call reelsonscreen - call mainscreen - call getunderzoom - call zoom - call worktoscreenm - call walkintoroom - call reminders - call atmospheres -notnew: ret - - endp - - - - - - -Atmospheres proc near - - mov cl,mapx - mov ch,mapy - mov bx,offset cs:atmospherelist -nextatmos: mov al,[cs:bx] - cmp al,255 - jz nomoreatmos - cmp al,reallocation - jnz wrongatmos - mov ax,[cs:bx+1] - cmp ax,cx - jnz wrongatmos - mov ax,[cs:bx+3] - cmp al,ch0playing - jz playingalready - cmp location,45 - jnz notweb - cmp reeltowatch,45 - jz wrongatmos -notweb: call playchannel0 - cmp reallocation,2 - cmp mapy,0 - jz fullvol - jnz notlouisvol - cmp mapy,10 - jnz notlouisvol - cmp mapx,22 - jnz notlouisvol - mov volume,5 -notlouisvol: if cd - cmp reallocation,14 - jnz notmad1 - cmp mapx,33 - jz ismad2 - cmp mapx,22 - jnz notmad1 - mov volume,5 - ret -ismad2: mov volume,0 - ret -notmad1: endif -playingalready: cmp reallocation,2 - jnz notlouisvol2 - cmp mapx,22 - jz louisvol - cmp mapx,11 - jnz notlouisvol2 -fullvol: mov volume,0 -notlouisvol2: ret -louisvol: mov volume,5 - ret -wrongatmos: add bx,5 - jmp nextatmos -nomoreatmos: call cancelch0 - ret - -atmospherelist: db 0,33,10,15,255 - db 0,22,10,15,255 - db 0,22,0,15,255 - db 0,11,0,15,255 - db 0,11,10,15,255 - db 0,0,10,15,255 - - db 1,44,10,6,255 ;location,map x,y,sound,repeat - db 1,44,0,13,255 - - db 2,33,0,6,255 - db 2,22,0,5,255 - db 2,22,10,16,255 - db 2,11,10,16,255 - - db 3,44,0,15,255 - db 3,33,10,6,255 - db 3,33,0,5,255 - - db 4,11,30,6,255 - db 4,22,30,5,255 - db 4,22,20,13,255 - - db 10,33,30,6,255 - db 10,22,30,6,255 - - db 9,22,10,6,255 - db 9,22,20,16,255 - db 9,22,30,16,255 - db 9,22,40,16,255 - db 9,22,50,16,255 - - db 6,11,30,6,255 - db 6,0,10,15,255 - db 6,0,20,15,255 - db 6,11,20,15,255 - db 6,22,20,15,255 - - db 7,11,20,6,255 - db 7,0,20,6,255 - db 7,0,30,6,255 - - db 55,44,0,5,255 - db 55,44,10,5,255 - - db 5,22,30,6,255 - if demo - db 5,22,20,16,255 - db 5,22,10,16,255 - else - db 5,22,20,15,255 - db 5,22,10,15,255 - endif - - db 24,22,0,15,255 - db 24,33,0,15,255 - db 24,44,0,15,255 - db 24,33,10,15,255 - - db 8,0,10,6,255 - db 8,11,10,6,255 - db 8,22,10,6,255 - db 8,33,10,6,255 - db 8,33,20,6,255 - db 8,33,30,6,255 - db 8,33,40,6,255 - db 8,22,40,6,255 - db 8,11,40,6,255 - - db 11,11,20,12,255 - db 11,11,30,12,255 - db 11,22,20,12,255 - db 11,22,30,12,255 - - db 12,22,20,12,255 - db 13,22,20,12,255 - db 13,33,20,12,255 - - db 14,44,20,12,255 - db 14,33,0,12,255 - db 14,33,10,12,255 - db 14,33,20,12,255 - db 14,33,30,12,255 - db 14,33,40,12,255 - db 14,22,0,16,255 - - db 19,0,0,12,255 - - db 20,0,20,16,255 - db 20,0,30,16,255 - db 20,11,30,16,255 - db 20,0,40,16,255 - db 20,11,40,16,255 - - if demo - db 21,11,10,16,255 - db 21,11,20,16,255 - db 21,0,20,16,255 - db 21,22,20,16,255 - db 21,33,20,16,255 - db 21,44,20,16,255 - db 21,44,10,16,255 - else - db 21,11,10,15,255 - db 21,11,20,15,255 - db 21,0,20,15,255 - db 21,22,20,15,255 - db 21,33,20,15,255 - db 21,44,20,15,255 - db 21,44,10,15,255 - endif - - db 22,22,10,16,255 - db 22,22,20,16,255 - - db 23,22,30,13,255 - db 23,22,40,13,255 - db 23,33,40,13,255 - db 23,11,40,13,255 - db 23,0,40,13,255 - db 23,0,50,13,255 - - db 25,11,40,16,255 - db 25,11,50,16,255 - db 25,0,50,16,255 - - db 27,11,20,16,255 - db 27,11,30,16,255 - - db 29,11,10,16,255 - - db 45,22,30,12,255 - db 45,22,40,12,255 - db 45,22,50,12,255 - - db 46,22,40,12,255 - db 46,11,50,12,255 - db 46,22,50,12,255 - db 46,33,50,12,255 - - db 47,0,0,12,255 - - db 26,22,20,16,255 - db 26,33,10,16,255 - db 26,33,20,16,255 - db 26,33,30,16,255 - db 26,44,30,16,255 - db 26,22,30,16,255 - db 26,11,30,16,255 - db 26,11,20,16,255 - db 26,0,20,16,255 - db 26,11,40,16,255 - db 26,0,40,16,255 - db 26,22,40,16,255 - db 26,11,50,16,255 - - db 28,0,30,15,255 - db 28,0,20,15,255 - db 28,0,40,15,255 - db 28,11,30,15,255 - db 28,11,20,15,255 - db 28,22,30,15,255 - db 28,22,20,15,255 - - db 255 - - endp - - - - - - -Walkintoroom proc near - - cmp location,14 - jnz notlair - cmp mapx,22 - jnz notlair - mov destination,1 - mov finaldest,1 - call autosetwalk -notlair: ret - - endp - - - - - - - - - - - - -Afterintroroom proc near - - cmp nowinnewroom,0 - jz notnewintro - call clearwork - call findroominloc - mov newobs,1 - call drawfloor - call reelsonscreen - call spriteupdate - call printsprites - call worktoscreen - mov nowinnewroom,0 -notnewintro: ret - - endp - - - - - - - - - - - -Obname proc near - - cmp reasseschanges,0 - jz notnewpath - mov reasseschanges,0 - jmp diff - -notnewpath: cmp ah,commandtype - jz notdiffob - jmp diff -notdiffob: cmp al,command - jnz diff - cmp walkandexam,1 - jz walkandexamine - cmp mousebutton,0 - jz noobselect - cmp commandtype,3 - jnz isntblock - cmp lastflag,2 - jc noobselect -isntblock: mov bl,manspath - cmp bl,pointerspath - jnz wantstowalk - cmp commandtype,3 - jz wantstowalk - call finishedwalking - jnz noobselect - cmp commandtype,5 - jz wantstotalk - cmp watchingtime,0 - jnz noobselect - call examineob - ret -wantstotalk: cmp watchingtime,0 - jnz noobselect - call talk - ret -walkandexamine: call finishedwalking - jnz noobselect - mov al,walkexamtype - mov commandtype,al - mov al,walkexamnum - mov command,al - mov walkandexam,0 - cmp commandtype,5 - jz noobselect - call examineob - ret -wantstowalk: call setwalk - mov reasseschanges,1 -noobselect: ret - - -diff: mov command,al - mov commandtype,ah -diff2: cmp linepointer,254 - jnz middleofwalk - cmp watchingtime,0 - jnz middleofwalk - mov al,facing - cmp al,turntoface - jnz middleofwalk - cmp commandtype,3 - jnz notblock - mov bl,manspath - cmp bl,pointerspath - jnz dontcheck - mov cl,ryanx ;look under feet to see if - add cl,12 ;any flags are there - mov ch,ryany - add ch,12 - call checkone - cmp cl,2 - jc isblock -dontcheck: call getflagunderp - cmp lastflag,2 - jc isblock - cmp lastflag,128 - jnc isblock - jmp toofaraway ; only here for turning on doorstep -notblock: mov bl,manspath - cmp bl,pointerspath - jnz toofaraway - cmp commandtype,3 - jz isblock - cmp commandtype,5 - jz isaperson - call examineobtext - ret -middleofwalk: call blocknametext - ret -isblock: call blocknametext - ret -isaperson: call personnametext - ret -toofaraway: call walktotext - ret - - endp - - - - - - - -Finishedwalking proc near - - cmp linepointer,254 - jnz iswalking - mov al,facing - cmp al,turntoface -iswalking: ret - - endp - - - - - - - -Examineobtext proc near - - mov bl,command - mov bh,commandtype - mov al,1 - call commandwithob - ret - - endp - - - - - -Commandwithob proc near - - push ax - push ax bx cx dx es ds si di - call deltextline - pop di si ds es dx cx bx ax - - push bx - mov ah,0 - add ax,ax - mov bx,ax - mov es,commandtext - mov ax,[es:bx] - add ax,textstart - mov si,ax - - mov di,textaddressx - mov bx,textaddressy - mov dl,textlen - mov al,0 - mov ah,0 - call printdirect - - pop ax - mov di,offset cs:commandline - call copyname - pop ax - - mov di,lastxpos - cmp al,0 - jz noadd - add di,5 -noadd: mov bx,textaddressy - push cs - pop es - mov si,offset cs:commandline - mov dl,textlen - mov al,0 - mov ah,0 - call printdirect - mov newtextline,1 - ret - -commandline: db "OBJECT NAME ONE ",0 - - endp - - - - -Commandonly proc near - - push ax bx cx dx es ds si di - call deltextline - pop di si ds es dx cx bx ax - - mov ah,0 - add ax,ax - mov bx,ax - mov es,commandtext - mov ax,[es:bx] - add ax,textstart - mov si,ax - - mov di,textaddressx - mov bx,textaddressy - mov dl,textlen - mov al,0 - mov ah,0 - call printdirect - mov newtextline,1 - ret - - endp - - - - - -Printmessage proc near - - push dx bx di - mov ah,0 - add ax,ax - mov bx,ax - mov es,commandtext - mov ax,[es:bx] - add ax,textstart - mov si,ax - pop di bx dx - mov al,0 - mov ah,0 - call printdirect - ret - - endp - - - -Printmessage2 proc near - - push dx bx di - push ax - mov ah,0 - add ax,ax - mov bx,ax - mov es,commandtext - mov ax,[es:bx] - add ax,textstart - mov si,ax - pop ax - -searchmess: push ax - call findnextcolon - pop ax - dec ah - jnz searchmess - - pop di bx dx - mov al,0 - mov ah,0 - call printdirect - ret - - endp - - - - - - - - - -Blocknametext proc near - - mov bl,command - mov bh,commandtype - mov al,0 - call commandwithob - ret - - endp - - - - -Personnametext proc near - - mov bl,command - and bl,127 - mov bh,commandtype - mov al,2 - call commandwithob - ret - - endp - - - - - - - -Walktotext proc near - - mov bl,command - mov bh,commandtype - mov al,3 - call commandwithob - ret - - endp - - - - - -Getflagunderp proc near - - mov cx,mousex - sub cx,mapadx - mov ax,mousey - sub ax,mapady - mov ch,al - call checkone - mov lastflag,cl - mov lastflagex,ch - ret - - endp - - - - - -Setwalk proc near - - cmp linepointer,254 - jnz alreadywalking - mov al,pointerspath - cmp al,manspath - jz cantwalk2 - cmp watchmode,1 - jz holdingreel - cmp watchmode,2 - jz cantwalk - mov destination,al - mov finaldest,al - cmp mousebutton,2 - jnz notwalkandexam - cmp commandtype,3 - jz notwalkandexam - mov walkandexam,1 - mov al,commandtype - mov walkexamtype,al - mov al,command - mov walkexamnum,al -notwalkandexam: call autosetwalk -cantwalk: ret -cantwalk2: call facerightway - ret -alreadywalking: mov al,pointerspath - mov finaldest,al - ret - -holdingreel: mov destafterhold,al - mov watchmode,2 - ret - - endp - - - - - - - -Autosetwalk proc near - - mov al,manspath - cmp finaldest,al - jnz notsamealready - ret -notsamealready: call getroomspaths - call checkdest - push bx - mov al,manspath - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,[es:bx] - mov ah,0 - sub ax,12 - mov linestartx,ax - mov al,[es:bx+1] - mov ah,0 - sub ax,12 - mov linestarty,ax - pop bx - - mov al,destination - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,[es:bx] - mov ah,0 - sub ax,12 - mov lineendx,ax - mov al,[es:bx+1] - mov ah,0 - sub ax,12 - mov lineendy,ax - call bresenhams - - cmp linedirection,0 - jz normalline - mov al,linelength - dec al - mov linepointer,al - mov linedirection,1 - ret - -normalline: mov linepointer,0 - ret - - endp - - - - - - - - -Checkdest proc near - - push bx - add bx,12*8 - mov ah,manspath - mov cl,4 - shl ah,cl - mov al,destination - - mov cl,24 - mov ch,destination -checkdestloop: mov dh,[es:bx] - and dh,11110000b - mov dl,[es:bx] - and dl,00001111b - cmp ax,dx - jnz nextcheck - mov al,[es:bx+1] - and al,15 - mov destination,al - pop bx - ret -nextcheck: mov dl,[es:bx] - and dl,11110000b - shr dl,1 - shr dl,1 - shr dl,1 - shr dl,1 - mov dh,[es:bx] - and dh,00001111b - shl dh,1 - shl dh,1 - shl dh,1 - shl dh,1 - cmp ax,dx - jnz nextcheck2 - mov ch,[es:bx+1] - and ch,15 -nextcheck2: add bx,2 - dec cl - jnz checkdestloop - mov destination,ch - pop bx - ret - - endp - - - - - - - - - - - - - - -Bresenhams proc near - - call workoutframes - - mov dx,seg linedata - mov es,dx - mov di,offset es:linedata - mov si,1 - mov linedirection,0 - - mov cx,lineendx - sub cx,linestartx - jz vertline - jns line1 - - neg cx - mov bx,lineendx - xchg bx,linestartx - mov lineendx,bx - - mov bx,lineendy - xchg bx,linestarty - mov lineendy,bx - mov linedirection,1 - -line1: mov bx,lineendy - sub bx,linestarty - jz horizline - jns line3 - - neg bx - neg si - -line3: push si - mov lineroutine,0 ; means lo slope - cmp bx,cx - jle line4 - mov lineroutine,1 ; means hi slope - xchg bx,cx - -line4: shl bx,1 - mov increment1,bx - sub bx,cx - mov si,bx - sub bx,cx - mov increment2,bx - - mov ax,linestartx - mov bx,linestarty - mov ah,bl - inc cx - pop bx - cmp lineroutine,1 - jz hislope - jmp loslope - -vertline: mov ax,linestarty - mov bx,lineendy - mov cx,bx - sub cx,ax - jge line31 - - neg cx - mov ax,bx - mov linedirection,1 - -line31: inc cx - mov bx,linestartx - xchg ax,bx - mov ah,bl - mov bx,si -line32: stosw - add ah,bl - loop line32 - jmp lineexit - - -horizline: mov ax,linestartx - mov bx,linestarty - mov ah,bl - inc cx -horizloop: stosw - inc al - loop horizloop - jmp lineexit - - -loslope: -loloop: stosw - inc al - or si,si - jns line12 - add si,increment1 - loop loloop - jmp lineexit - -line12: add si,increment2 - add ah,bl - loop loloop - jmp lineexit - - - -hislope: -hiloop: stosw - add ah,bl - or si,si - jns line23 - add si,increment1 - loop hiloop - jmp lineexit - -line23: add si,increment2 - inc al - loop hiloop - -lineexit: sub di,offset es:linedata - mov ax,di - shr ax,1 - mov linelength,al - ret - - endp - - - - - - - -Workoutframes proc near - - mov bx,linestartx - add bx,32 - mov ax,lineendx - add ax,32 - sub bx,ax - jnc notneg1 - neg bx -notneg1: mov cx,linestarty - add cx,32 - mov ax,lineendy - add ax,32 - sub cx,ax - jnc notneg2 - neg cx -notneg2: cmp bx,cx - jnc tendstohoriz - mov dl,2 - mov ax,cx - shr ax,1 - cmp bx,ax - jc gotquad - mov dl,1 - jmp gotquad -tendstohoriz: mov dl,0 - mov ax,bx - shr ax,1 - cmp cx,ax - jc gotquad - mov dl,1 - jmp gotquad - -gotquad: mov bx,linestartx - add bx,32 - mov ax,lineendx - add ax,32 - sub bx,ax - jc isinright -isinleft: mov cx,linestarty - add cx,32 - mov ax,lineendy - add ax,32 - sub cx,ax - jnc topleft - cmp dl,1 - jz noswap1 - xor dl,2 -noswap1: add dl,4 - jmp success -topleft: add dl,6 - jmp success - -isinright: mov cx,linestarty - add cx,32 - mov ax,lineendy - add ax,32 - sub cx,ax - jnc botright - add dl,2 - jmp success -botright: cmp dl,1 - jz noswap2 - xor dl,2 -noswap2: - -success: and dl,7 - mov turntoface,dl - mov turndirection,0 - ret - - endp - - - - - - - - - - - - - - - - - - -;Multiply8 proc near -; -; mov ah,0 -; mov cx,8 -; mul cx -; ret -; -; endp - - - - - - -Getroomspaths proc near - - mov al,roomnum - mov ah,0 - mov cx,144 - mul cx - mov es,reels - mov bx,pathdata - add bx,ax - ret - - endp - - - - - - - - - - - - - - - - -Copyname proc near - - push di - call findobname - pop di - push cs - pop es - -copytext: mov cx,28 -make: lodsb - cmp al,":" - jz finishmakename - cmp al,0 - jz finishmakename - stosb - loop make - -finishmakename: inc cx - mov al,0 - stosb - ret - mov al,255 - rep stosb - ret - - endp - - - - - - - - - -Findobname proc near - - push ax - mov ah,0 - add ax,ax - mov bx,ax - pop ax - - cmp ah,5 - jnz notpersonname - - push ax - and al,127 - mov ah,0 - mov bx,64*2 - mul bx - mov si,ax - mov ds,people - add si,persontxtdat - mov cx,persontext - mov ax,[si] - add ax,cx - mov si,ax - pop ax - ret - -notpersonname: cmp ah,4 - jnz notextraname - mov ds,extras - add bx,extextdat - mov ax,[bx] - add ax,extext - mov si,ax - ret - -notextraname: cmp ah,2 - jnz notfreename - mov ds,freedesc - add bx,freetextdat - mov ax,[bx] - add ax,freetext - mov si,ax - ret - -notfreename: cmp ah,1 - jnz notsetname - mov ds,setdesc - add bx,settextdat - mov ax,[bx] - add ax,settext - mov si,ax - ret - -notsetname: mov ds,blockdesc - add bx,blocktextdat - mov ax,[bx] - add ax,blocktext - mov si,ax - ret - - endp - - - - - - - - - - - - - -;-------------------------------------------Printing of non scrolling icons---- - -Showicon proc near - - cmp reallocation,50 - jnc isdream1 - call showpanel - call showman - call roomname - call panelicons1 - call zoomicon - ret - -isdream1: mov ds,tempsprites - mov di,72 - mov bx,2 - mov al,45 - mov ah,0 - call showframe - mov ds,tempsprites - mov di,72+47 - mov bx,2 - mov al,46 - mov ah,0 - call showframe - mov ds,tempsprites - mov di,69-10 - mov bx,21 - mov al,49 - mov ah,0 - call showframe - - mov ds,tempsprites - mov di,160+88 - mov bx,2 - mov al,45 - mov ah,4 - call showframe - mov ds,tempsprites - mov di,160+43 - mov bx,2 - mov al,46 - mov ah,4 - call showframe - mov ds,tempsprites - mov di,160+101 - mov bx,21 - mov al,49 - mov ah,4 - call showframe - call middlepanel - ret - - endp - - - - - -Middlepanel proc near - - mov ds,tempsprites - mov di,72+47+20 - mov bx,0 - mov al,48 - mov ah,0 - call showframe - mov ds,tempsprites - mov di,72+19 - mov bx,21 - mov al,47 - mov ah,0 - call showframe - mov ds,tempsprites - mov di,160+23 - mov bx,0 - mov al,48 - mov ah,4 - call showframe - mov ds,tempsprites - mov di,160+71 - mov bx,21 - mov al,47 - mov ah,4 - call showframe - ret - - endp - - - - - - - - - - -Showman proc near - - mov ds,icons1 - mov di,0 - mov bx,0 - mov al,0 - mov ah,0 - call showframe - mov ds,icons1 - mov di,0 - mov bx,114 - mov al,1 - mov ah,0 - call showframe - - cmp shadeson,0 - jz notverycool - - mov ds,icons1 - mov di,28 - mov bx,25 - mov al,2 - mov ah,0 - call showframe -notverycool: ret - - endp - - - - - - - - - - - - - - - - - - - -Showpanel proc near - - mov ds,icons1 - mov di,72 - mov bx,0 - mov al,19 - mov ah,0 - call showframe - mov ds,icons1 - mov di,192 - mov bx,0 - mov al,19 - mov ah,0 - call showframe - ret - - endp - - - - - - - - - - - - - - - - - - - - - - -Roomname proc near - - mov di,88 - mov bx,18 - mov al,53 - mov dl,240 - call printmessage - - mov bl,roomnum - cmp bl,32 - jc notover32 - sub bl,32 - -notover32: mov bh,0 - add bx,bx - mov es,roomdesc - add bx,intextdat - mov ax,[es:bx] - add ax,intext - mov si,ax - - mov linespacing,7 - mov di,88 - mov bx,25 - mov dl,120 - cmp watchon,1 - jz gotpl - mov dl,160 -gotpl: mov al,0 - mov ah,0 - call printdirect - mov linespacing,10 - - call usecharset1 - ret - - endp - - - - - - -Usecharset1 proc near - - mov ax,charset1 - mov currentset,ax - ret - - endp - - - - - - - - - - - -Usetempcharset proc near - - mov ax,tempcharset - mov currentset,ax - ret - - endp - - - - - -Showexit proc near - - mov ds,icons1 - mov di,274 - mov bx,154 - mov al,11 - mov ah,0 - call showframe - ret - - endp - - - - -Panelicons1 proc near - - mov di,0 - cmp watchon,1 - jz watchison - mov di,48 -watchison: push di - mov ds,icons2 - add di,204 - mov bx,4 - mov al,2 - mov ah,0 - call showframe - pop di - push di - cmp zoomon,1 - jz zoomisoff - mov ds,icons1 - add di,228 - mov bx,8 - mov al,5 - mov ah,0 - call showframe -zoomisoff: pop di - call showwatch - ret - - endp - - - - - - - - - - - - -Showwatch proc near - - cmp watchon,0 - jz nowristwatch - mov ds,icons1 - mov di,250 - mov bx,1 - mov al,6 - mov ah,0 - call showframe - call showtime -nowristwatch: ret - - endp - - -Gettime proc near - - mov ah,2ch - int 21h - mov secondcount,dh - mov minutecount,cl - mov hourcount,ch - ret - - endp - - - - - -Zoomicon proc near - - cmp zoomon,0 - jz nozoom1 - mov ds,icons1 - mov di,zoomx - mov bx,zoomy-1 - mov al,8 - mov ah,0 - call showframe -nozoom1: ret - - endp - - - - - - -Showblink proc near - - cmp manisoffscreen,1 - jz finblink1 - inc blinkcount - cmp shadeson,0 - jnz finblink1 - cmp reallocation,50 - jnc eyesshut - mov al,blinkcount - cmp al,3 - jnz finblink1 - mov blinkcount,0 - mov al,blinkframe - inc al - mov blinkframe,al - cmp al,6 - jc nomorethan6 - mov al,6 -nomorethan6: mov ah,0 - mov bx,offset cs:blinktab - add bx,ax - - mov al,[cs:bx] - mov ds,icons1 - mov di,44 - mov bx,32 - mov ah,0 - call showframe -finblink1: ret - -eyesshut: ;mov al,32 - ;mov ds,icons1 - ;mov di,44 - ;mov bx,32 - ;mov ah,0 - ;call showframe - ret - -blinktab: db 16,18,18,17,16,16,16 - - endp - - - - - - -Dumpblink proc near - - cmp shadeson,0 - jnz nodumpeye - cmp blinkcount,0 - jnz nodumpeye - mov al,blinkframe - cmp al,6 - jnc nodumpeye - push ds - mov di,44 - mov bx,32 - mov cl,16 - mov ch,12 - call multidump - pop ds -nodumpeye: ret - - endp - - - - - - - - - - - - - - - - - - -Worktoscreenm proc near - - call animpointer - call readmouse - call showpointer - call vsync - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - - - - -;-------------------------------------------------------------Blank routine---- - - - - -Blank proc near - - cmp commandtype,199 - jz alreadyblnk - mov commandtype,199 - mov al,0 - call commandonly -alreadyblnk: ret - - endp - - - - - - - - - - - - - - - - - - - - - - -;---------------------------------------------------------Standard routines---- - - - - - - - - - - - - - -Allpointer proc near - - call readmouse - call showpointer - call dumppointer - ret - - endp - - - - - - - -Hangonp proc near - - push cx - add cx,cx - pop ax - add cx,ax - mov maintimer,0 - mov al,pointerframe - mov ah,pickup - push ax - mov pointermode,3 - mov pickup,0 - push cx - mov commandtype,255 - call readmouse - call animpointer - call showpointer - call vsync - call dumppointer - pop cx - -hangloop: push cx - call delpointer - call readmouse - call animpointer - call showpointer - call vsync - call dumppointer - pop cx - mov ax,mousebutton - cmp ax,0 - jz notpressed - cmp ax,oldbutton - jnz getoutofit -notpressed: loop hangloop - -getoutofit: call delpointer - pop ax - mov pointerframe,al - mov pickup,ah - mov pointermode,0 - ret - - endp - - - - - -Hangonw proc near - -hangloopw: push cx - call delpointer - call readmouse - call animpointer - call showpointer - call vsync - call dumppointer - pop cx - loop hangloopw - ret - - endp - - - - -Hangoncurs proc near - -monloop1: push cx - call printcurs - call vsync - call delcurs - pop cx - loop monloop1 - ret - - endp - - - - - - - - -Getunderzoom proc near - - mov di,zoomx+5 - mov bx,zoomy+4 - mov ds,buffers - mov si,zoomspace - mov cl,46 - mov ch,40 - call multiget - ret - - endp - - - - - -Dumpzoom proc near - - cmp zoomon,1 - jnz notzoomon - mov di,zoomx+5 - mov bx,zoomy+4 - mov cl,46 - mov ch,40 - call multidump -notzoomon: ret - - endp - - - - - - - -Putunderzoom proc near - - mov di,zoomx+5 - mov bx,zoomy+4 - mov ds,buffers - mov si,zoomspace - mov cl,46 - mov ch,40 - call multiput - ret - - endp - - - - - -Crosshair proc near - - cmp commandtype,3 - jz nocross - cmp commandtype,10 - jnc nocross - - mov es,workspace - mov ds,icons1 - mov di,zoomx+24 - mov bx,zoomy+19 - mov al,9 - mov ah,0 - call showframe - ret - -nocross: mov es,workspace - mov ds,icons1 - mov di,zoomx+24 - mov bx,zoomy+19 - mov al,29 - mov ah,0 - call showframe - ret - - endp - - - - - - -Showpointer proc near - - call showblink - mov di,mousex - mov oldpointerx,di - mov bx,mousey - mov oldpointery,bx - cmp pickup,1 - jz itsanobject - - push bx di - mov ds,icons1 - mov al,pointerframe - add al,20 - mov ah,0 - add ax,ax - mov si,ax - add ax,ax - add si,ax - mov cx,[si] - cmp cl,12 - jnc notsmallx - mov cl,12 -notsmallx: cmp ch,12 - jnc notsmally - mov ch,12 -notsmally: mov pointerxs,cl - mov pointerys,ch - push ds - mov ds,buffers - mov si,pointerback - call multiget - pop ds di bx - push di bx - mov al,pointerframe - add al,20 - mov ah,0 - call showframe - pop bx di - ret - -itsanobject: mov al,itemframe - mov ds,extras - cmp objecttype,4 - jz itsfrominv - mov ds,freeframes -itsfrominv: mov cl,al - add al,al - add al,cl - inc al - mov ah,0 - - push ax - add ax,ax - mov si,ax - add ax,ax - add si,ax - mov ax,2080 - mov cx,[si] - cmp cl,12 - jnc notsmallx2 - mov cl,12 -notsmallx2: cmp ch,12 - jnc notsmally2 - mov ch,12 -notsmally2: mov pointerxs,cl - mov pointerys,ch - pop ax - - push di bx - push ax bx di ds - mov al,cl - mov ah,0 - shr ax,1 - sub oldpointerx,ax - sub di,ax - mov al,ch - shr ax,1 - sub oldpointery,ax - sub bx,ax - mov ds,buffers - mov si,pointerback - call multiget - pop ds di bx ax - mov ah,128 - call showframe - pop bx di - mov ds,icons1 - mov al,3 - mov ah,128 - call showframe - ret - - endp - - - - - - - -Delpointer proc near - - mov ax,oldpointerx - cmp ax,0ffffh - jz nevershown - mov delherex,ax - mov ax,oldpointery - mov delherey,ax - mov cl,pointerxs - mov delxs,cl - mov ch,pointerys - mov delys,ch - mov ds,buffers - mov si,pointerback - mov di,delherex - mov bx,delherey - call multiput -nevershown: ret - - endp - - - - - - - - - -Dumppointer proc near - - call dumpblink - mov cl,delxs - mov ch,delys - mov di,delherex - mov bx,delherey - call multidump - - mov bx,oldpointery - mov di,oldpointerx - cmp di,delherex - jnz difffound - cmp bx,delherey - jz notboth -difffound: mov cl,pointerxs - mov ch,pointerys - call multidump -notboth: ret - - endp - - - - - - - - - - - -Undertextline proc near - - mov di,textaddressx - mov bx,textaddressy - if foreign - sub bx,3 - endif - mov ds,buffers - mov si,textunder - mov cl,undertextsizex - mov ch,undertextsizey - call multiget - ret - - endp - - - - - - - - -Deltextline proc near - - mov di,textaddressx - mov bx,textaddressy - if foreign - sub bx,3 - endif - mov ds,buffers - mov si,textunder - mov cl,undertextsizex - mov ch,undertextsizey - call multiput - ret - - endp - - - - - -Dumptextline proc near - - cmp newtextline,1 - jnz nodumptextline - mov newtextline,0 - mov di,textaddressx - mov bx,textaddressy - if foreign - sub bx,3 - endif - mov cl,undertextsizex - mov ch,undertextsizey - call multidump -nodumptextline: ret - - endp - - - - - - - - - - - - - - - - - -Animpointer proc near - - cmp pointermode,2 - jz combathand - cmp pointermode,3 - jz mousehand - - cmp watchingtime,0 - jz notwatchpoint - mov pointerframe,11 - ret -notwatchpoint: mov pointerframe,0 - cmp inmaparea,0 - jz gothand - cmp pointerfirstpath,0 - jz gothand -arrow: call getflagunderp - cmp cl,2 - jc gothand - cmp cl,128 - jnc gothand - mov pointerframe,3 - test cl,4 - jnz gothand - mov pointerframe,4 - test cl,16 - jnz gothand - mov pointerframe,5 - test cl,2 - jnz gothand - mov pointerframe,6 - test cl,8 - jnz gothand - mov pointerframe,8 -gothand: ret - -mousehand: cmp pointerspeed,0 - jz rightspeed3 - dec pointerspeed - jmp finflashmouse -rightspeed3: mov pointerspeed,5 - inc pointercount - cmp pointercount,16 - jnz finflashmouse - mov pointercount,0 -finflashmouse: mov al,pointercount - mov ah,0 - mov bx,offset cs:flashmousetab - add bx,ax - mov al,[cs:bx] - mov pointerframe,al - ret - -combathand: mov pointerframe,0 - cmp reallocation,14 - jnz notarrow - cmp commandtype,211 - jnz notarrow - mov pointerframe,5 -notarrow: ret - -flashmousetab: db 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2 - - endp - - - - -;------------------------------------------------Mouse and keyboard-readers---- - -Setmouse proc near - - if recording - mov recordpos,-8 - mov dx,seg recname - mov ds,dx - mov dx,offset recname - mov cx,0 - mov ah,3ch - mov al,2 - int 21h - mov rechandle,ax - endif - - if playback - mov dx,seg recname - mov ds,dx - mov dx,offset recname - mov ah,3dh - mov al,2 - int 21h - mov rechandle,ax - call loadrec - endif - - mov oldpointerx,0ffffh - - mov ax,0 - int 33h - mov ax,8 - mov cx,15 - mov dx,184 - int 33h - mov ax,7 - mov cx,15 - mov dx,298*2 - int 33h - ret - - endp - - - - - -Readmouse proc near - - mov ax,mousebutton - mov oldbutton,ax - mov ax,mousex - mov oldx,ax - mov ax,mousey - mov oldy,ax - call mousecall - mov mousex,cx - mov mousey,dx - mov mousebutton,bx - ret - - endp - - - - - - - -Mousecall proc near - - if playback - call playmouse - ret - endif - - mov ax,3 - int 33h - shr cx,1 - cmp cx,298 - jc notxover - mov cx,298 -notxover: cmp cx,15 - jnc notxover2 - mov cx,15 -notxover2: cmp dx,184 - jc notyover - mov dx,184 -notyover: cmp dx,15 - jnc notyover2 - mov dx,15 -notyover2: - if recording - call recmouse - endif - ret - - endp - - - - - - - if playback - -Playmouse proc near - - mov es,recordspace - mov di,recordpos - cmp word ptr [es:di+6],0 - jnz isthisplay - add di,8 - add recordpos,8 - cmp di,16384 - jnz isthisplay - call loadrec -isthisplay: mov cx,[es:di] - mov dx,[es:di+2] - mov bx,[es:di+4] - dec word ptr [es:di+6] - ret - - endp - - endif - - if recording - -Recmouse proc near - - mov es,recordspace - mov di,recordpos - cmp di,-8 - jz diffrec - cmp [es:di],cx - jnz diffrec - cmp [es:di+2],dx - jnz diffrec - cmp [es:di+4],bx - jnz diffrec - inc word ptr [es:di+6] - cmp word ptr [es:di+5],0ffffh - jz diffrec - ret -diffrec: add recordpos,8 - add di,8 - cmp di,16384 - jnz notsaverec - push cx dx bx - call saverec - pop bx dx cx -notsaverec: mov [es:di],cx - mov [es:di+2],dx - mov [es:di+4],bx - mov word ptr [es:di+6],1 - ret - - endp - - - - - -Saverec proc near - - mov bx,rechandle - mov ds,recordspace - mov dx,0 - mov cx,recordpos - add cx,8 - mov ah,40h - int 21h - mov di,0 - mov recordpos,0 - ret - - endp - - - - - - -Loadrec proc near - - mov bx,rechandle - mov ds,recordspace - mov dx,0 - mov cx,16384+8 - mov ah,3fh - int 21h - mov di,0 - mov recordpos,0 - ret - - endp - - - endif - - - - - - - -Readmouse1 proc near - - mov ax,mousex - mov oldx,ax - mov ax,mousey - mov oldy,ax - call mousecall - mov mousex,cx - mov mousey,dx - mov mousebutton1,bx - ret - - endp - - - -Readmouse2 proc near - - mov ax,mousex - mov oldx,ax - mov ax,mousey - mov oldy,ax - call mousecall - mov mousex,cx - mov mousey,dx - mov mousebutton2,bx - ret - - endp - - -Readmouse3 proc near - - mov ax,mousex - mov oldx,ax - mov ax,mousey - mov oldy,ax - call mousecall - mov mousex,cx - mov mousey,dx - mov mousebutton3,bx - ret - - endp - - - - - - -Readmouse4 proc near - - mov ax,mousebutton - mov oldbutton,ax - mov ax,mousex - mov oldx,ax - mov ax,mousey - mov oldy,ax - call mousecall - mov mousex,cx - mov mousey,dx - mov ax,mousebutton1 - or ax,mousebutton2 - or ax,mousebutton3 - or bx,ax - mov mousebutton,bx - ret - - endp - - - - - -Readkey proc near - - mov bx,bufferout - cmp bx,bufferin - jz nokey - inc bx - and bx,15 - mov bufferout,bx - mov di,offset cs:keybuffer - add di,bx - mov al,[cs:di] - mov currentkey,al - ret -nokey: mov currentkey,0 - ret - - - endp - -keybuffer: db 16 dup (0) - - - -Convertkey proc near - - and al,127 - mov ah,0 - mov di,offset cs:keyconverttab - add di,ax - mov al,[cs:di] - ret - -keyconverttab: db 0,0,"1","2","3","4","5","6","7","8","9","0","-",0,8,0 - db "Q","W","E","R","T","Y","U","I","O","P",0,0,13,0,"A","S" - db "D","F","G","H","J","K","L",0,0,0,0,0,"Z","X","C","V","B","N","M" - db 0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - endp - - - - -;-------------------------------------------------------------Miscellaneous---- - -Randomnum1 proc near - - push ds es di bx cx - call randomnumber - pop cx bx di es ds - ret - - endp - - - - - -Randomnum2 proc near - - push ds es di bx ax - call randomnumber - mov cl,al - pop ax bx di es ds - ret - - endp - - - - - -Randomnumber proc near - - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - mov al,seed - and al,48h - add al,38h - sal al,1 - sal al,1 - rcl seed+2,1 - rcl seed+1,1 - rcl seed+0,1 - - mov al,seed - ret - - endp - - - - - - -Hangon proc near - -hangonloop: push cx - call vsync - pop cx - loop hangonloop - ret - - endp - - - - - -;-------------------------------------------------------------Disc handling---- - - -Loadtraveltext proc near - - mov dx,offset cs:traveltextname - call standardload - mov traveltext,ax - ret - - endp - - - - - - -Loadintotemp proc near - - push cs - pop ds - call standardload - mov tempgraphics,ax - ret - - endp - - - - - - -Loadintotemp2 proc near - - push cs - pop ds - call standardload - mov tempgraphics2,ax - ret - - endp - - - - -Loadintotemp3 proc near - - push cs - pop ds - call standardload - mov tempgraphics3,ax - ret - - endp - - - -Loadtempcharset proc near - - call standardload - mov tempcharset,ax - ret - - endp - - - - - - -Standardload proc near - - call openfile - call readheader - mov bx,[es:di] - push bx - mov cl,4 - shr bx,cl - call allocatemem - mov ds,ax - pop cx - push ax - mov dx,0 - call readfromfile - call closefile - pop ax - ret - - endp - - - - - - -Loadtemptext proc near - - call standardload - mov textfile1,ax - ret - - endp - - - - - - - -Loadroom proc near - - mov roomloaded,1 - mov timecount,0 - mov maintimer,0 - mov mapoffsetx,104 - mov mapoffsety,38 - mov textaddressx,13 - mov textaddressy,182 - mov textlen,240 - mov al,newlocation - mov location,al - call getroomdata - call startloading - call loadroomssample - call switchryanon - call drawflags - call getdimension - ret - - endp - - - - -Loadroomssample proc near - - mov al,roomssample - cmp al,255 - jz loadedalready - cmp al,currentsample - jz loadedalready - mov currentsample,al - mov al,currentsample - mov cl,"0" - call twodigitnum - mov di,offset cs:samplename - xchg al,ah - mov [cs:di+10],ax - mov dx,di - call loadsecondsample -loadedalready: ret - - endp - - - - - -Getridofreels proc near - - cmp roomloaded,0 - jz dontgetrid - mov es,reel1 - call deallocatemem - mov es,reel2 - call deallocatemem - mov es,reel3 - call deallocatemem -dontgetrid: ret - - endp - - - - - -Getridofall proc near - - mov es,backdrop - call deallocatemem - mov es,setframes - call deallocatemem - mov es,reel1 - call deallocatemem - mov es,reel2 - call deallocatemem - mov es,reel3 - call deallocatemem - mov es,reels - call deallocatemem - mov es,people - call deallocatemem - mov es,setdesc - call deallocatemem - mov es,blockdesc - call deallocatemem - mov es,roomdesc - call deallocatemem - mov es,freeframes - call deallocatemem - mov es,freedesc - call deallocatemem - ret - - endp - - - - - -Restorereels proc near - - cmp roomloaded,0 - jz dontrestore - mov al,reallocation - call getroomdata - mov dx,bx - call openfile - call readheader - - call dontloadseg - call dontloadseg - call dontloadseg - call dontloadseg - - call allocateload - mov reel1,ax - mov ds,ax - mov dx,0 - call loadseg - call allocateload - mov reel2,ax - mov ds,ax - mov dx,0 - call loadseg - call allocateload - mov reel3,ax - mov ds,ax - mov dx,0 - call loadseg - call closefile -dontrestore: ret - - endp - - - - - - - -Restoreall proc near - - mov al,location - call getroomdata - mov dx,bx - call openfile - call readheader - - call allocateload - mov ds,ax - mov backdrop,ax - mov dx,flags - call loadseg - - mov ds,workspace ;mapdata - mov dx,map - mov cx,132*66 ;maplen - mov al,0 - call fillspace - call loadseg - call sortoutmap - - call allocateload - mov setframes,ax - mov ds,ax - mov dx,framedata - call loadseg - - ;mov ds,setdat - ;mov dx,0 - ;mov cx,setdatlen - ;mov al,255 - ;call fillspace - call dontloadseg - - call allocateload - mov reel1,ax - mov ds,ax - mov dx,0 - ;call bloc + +loop048: mov ax,[cs:bx] + cmp ax,0ffffh + jz nonefound + push bx + cmp mousex,ax + jl over045 + mov ax,[cs:bx+2] + cmp mousex,ax + jge over045 + mov ax,[cs:bx+4] + cmp mousey,ax + jl over045 + mov ax,[cs:bx+6] + cmp mousey,ax + jge over045 + mov ax,[cs:bx+8] + call ax +finished: pop ax + ret +over045: pop bx + add bx,10 + jmp loop048 +nonefound: ret + + endp + + + + + +;-------------------------------------------Printing of icons during scroll---- + + + + + +Identifyob proc near + + cmp watchingtime,0 + jnz blank + + mov ax,mousex + sub ax,mapadx + cmp ax,22*8 + jc notover1 + call blank + ret + +notover1: mov bx,mousey + sub bx,mapady + cmp bx,20*8 + jc notover2 + call blank + ret + +notover2: mov inmaparea,1 + mov ah,bl + push ax + call findpathofpoint + mov pointerspath,dl + pop ax + push ax + call findfirstpath + mov pointerfirstpath,al + pop ax + + call checkifex + jnz finishidentify + call checkiffree + jnz finishidentify + call checkifperson + jnz finishidentify + call checkifset + jnz finishidentify + + mov ax,mousex + sub ax,mapadx + mov cl,al + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + cmp al,0 + jz nothingund + ;cmp watchingtime,0 + ;jnz nothingund + cmp mandead,1 + jz nothingund + mov ah,3 + call obname +finishidentify: ret + +nothingund: call blank + ret + + endp + + + + + + + + +Checkifperson proc near + + mov es,buffers + mov bx,peoplelist + mov cx,12 +identifyreel: push cx + + cmp byte ptr [es:bx+4],255 + jz notareelid + + push es bx ax + mov ax,[es:bx+0] + mov reelpointer,ax + call getreelstart + cmp [es:si+2],0ffffh + jnz notblankpers + add si,5 +notblankpers: mov cx,[es:si+2] ;x,y of reel slot + mov ax,[es:si+0] ;frame number + push cx + call getreelframeax + pop cx + add cl,[es:bx+4] + add ch,[es:bx+5] + mov dx,cx + add dl,[es:bx+0] + add dh,[es:bx+1] + pop ax bx es + + cmp al,cl + jc notareelid + cmp ah,ch + jc notareelid + cmp al,dl + jnc notareelid + cmp ah,dh + jnc notareelid + + pop cx + mov ax,[es:bx+2] + mov persondata,ax + mov al,[es:bx+4] + mov ah,5 + call obname + mov al,0 + cmp al,1 + ret + +notareelid: pop cx + add bx,5 + dec cx + jnz identifyreel + ret + + endp + + + + + + + + +Checkifset proc near + + mov es,buffers + mov bx,setlist+(127*5) + mov cx,127 +identifyset: cmp byte ptr [es:bx+4],255 + jz notasetid + cmp al,[es:bx] + jc notasetid + cmp al,[es:bx+2] + jnc notasetid + cmp ah,[es:bx+1] + jc notasetid + cmp ah,[es:bx+3] + jnc notasetid + call pixelcheckset + jz notasetid + call isitdescribed + jz notasetid + mov al,[es:bx+4] + mov ah,1 + call obname + mov al,0 + cmp al,1 + ret +notasetid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyset + ret + + endp + + + + + + + + + + +Checkifex proc near + + mov es,buffers + mov bx,exlist+(99*5) + mov cx,99 +identifyex: cmp byte ptr [es:bx+4],255 + jz notanexid + cmp al,[es:bx] + jc notanexid + cmp al,[es:bx+2] + jnc notanexid + cmp ah,[es:bx+1] + jc notanexid + cmp ah,[es:bx+3] + jnc notanexid + mov al,[es:bx+4] + mov ah,4 + call obname + mov al,1 + cmp al,0 + ret +notanexid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyex + ret + + endp + + + + + + +Checkiffree proc near + + mov es,buffers + mov bx,freelist+(79*5) + mov cx,79 +identifyfree: cmp byte ptr [es:bx+4],255 + jz notafreeid + cmp al,[es:bx] + jc notafreeid + cmp al,[es:bx+2] + jnc notafreeid + cmp ah,[es:bx+1] + jc notafreeid + cmp ah,[es:bx+3] + jnc notafreeid + mov al,[es:bx+4] + mov ah,2 + call obname + mov al,0 + cmp al,1 + ret +notafreeid: sub bx,5 + dec cx + cmp cx,-1 + jnz identifyfree + ret + + endp + + + + + + +Isitdescribed proc near + + push ax cx es bx + mov al,[es:bx+4] ;get object number + mov ah,0 + add ax,ax + mov bx,ax + mov es,setdesc + add bx,settextdat + mov ax,[es:bx] + add ax,settext + mov bx,ax + mov dl,[es:bx] + pop bx es cx ax + cmp dl,0 + ret + + endp + + + + + + + + +;Getcurrentpath proc near ;routine finds out which path +; ;block the pointer is in. +; push ax ;used to see if an object is +; call findpathofpoint ;close or not +; pop ax +; mov pointerspath,dl +; ret +; +; endp + + + + + +Findpathofpoint proc near + + push ax + mov bx,pathdata + mov es,reels + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +pathloop: mov al,[es:bx+6] + cmp al,255 + jnz flunkedit + mov ax,[es:bx+2] + cmp ax,0ffffh + jz flunkedit + cmp cl,al + jc flunkedit + cmp ch,ah + jc flunkedit + mov ax,[es:bx+4] + cmp cl,al + jnc flunkedit + cmp ch,ah + jnc flunkedit + jmp gotvalidpath +flunkedit: add bx,8 + inc dl + cmp dl,12 + jnz pathloop + mov dl,255 +gotvalidpath: ret + + endp + + + + + +Findfirstpath proc near ;similar to last routine, but it + ;searches each path to see if + push ax ;pointer is within it, regardless + mov bx,pathdata ;of whether the path is on or off + mov es,reels ;it returns the on or off state in + mov al,roomnum ;al (255=on 0=off) 0 if no path + mov ah,0 + mov cx,144 + mul cx + add bx,ax + pop cx + + mov dl,0 +fpathloop: mov ax,[es:bx+2] + cmp ax,0ffffh + jz nofirst + cmp cl,al + jc nofirst + cmp ch,ah + jc nofirst + mov ax,[es:bx+4] + cmp cl,al + jnc nofirst + cmp ch,ah + jnc nofirst + jmp gotfirst +nofirst: add bx,8 + inc dl + cmp dl,12 + jnz fpathloop + mov al,0 + ret +gotfirst: mov al,[es:bx+6] + ret + + endp + + + + + + + + +Turnpathon proc near ;turns path on permanently + + push ax ax + mov cl,255 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathon + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al +nopathon: ret + + endp + + + + + + + +Turnpathoff proc near ;turns path on permanently + + push ax ax + mov cl,0 + mov ch,roomnum + add ch,100 + call findormake + pop ax + call getroomspaths + pop ax + cmp al,255 + jz nopathoff + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al +nopathoff: ret + + endp + + + + + + + + + + + + + + + +Turnanypathon proc near + + push ax ax + mov cl,255 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,255 + mov [es:bx+6],al + ret + + endp + + + + + + +Turnanypathoff proc near + + push ax ax + mov cl,0 + mov ch,ah + add ch,100 + call findormake + pop ax + mov al,ah + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + +Checkifpathison proc near + + push ax + call getroomspaths + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+6] + cmp al,255 + ret + + endp + + + + + +Afternewroom proc near + + cmp nowinnewroom,0 + jz notnew + mov timecount,0 + call createpanel + mov commandtype,0 + call findroominloc + + cmp ryanon,1 + jz ryansoff + + mov al,ryanx + add al,12 + mov ah,ryany + add ah,12 + call findpathofpoint + mov manspath,dl + call findxyfrompath + mov resetmanxy,1 + +ryansoff: mov newobs,1 + call drawfloor + mov lookcounter,160 + mov nowinnewroom,0 + + call showicon + call spriteupdate + call printsprites + call undertextline + call reelsonscreen + call mainscreen + call getunderzoom + call zoom + call worktoscreenm + call walkintoroom + call reminders + call atmospheres +notnew: ret + + endp + + + + + + +Atmospheres proc near + + mov cl,mapx + mov ch,mapy + mov bx,offset cs:atmospherelist +nextatmos: mov al,[cs:bx] + cmp al,255 + jz nomoreatmos + cmp al,reallocation + jnz wrongatmos + mov ax,[cs:bx+1] + cmp ax,cx + jnz wrongatmos + mov ax,[cs:bx+3] + cmp al,ch0playing + jz playingalready + cmp location,45 + jnz notweb + cmp reeltowatch,45 + jz wrongatmos +notweb: call playchannel0 + cmp reallocation,2 + cmp mapy,0 + jz fullvol + jnz notlouisvol + cmp mapy,10 + jnz notlouisvol + cmp mapx,22 + jnz notlouisvol + mov volume,5 +notlouisvol: if cd + cmp reallocation,14 + jnz notmad1 + cmp mapx,33 + jz ismad2 + cmp mapx,22 + jnz notmad1 + mov volume,5 + ret +ismad2: mov volume,0 + ret +notmad1: endif +playingalready: cmp reallocation,2 + jnz notlouisvol2 + cmp mapx,22 + jz louisvol + cmp mapx,11 + jnz notlouisvol2 +fullvol: mov volume,0 +notlouisvol2: ret +louisvol: mov volume,5 + ret +wrongatmos: add bx,5 + jmp nextatmos +nomoreatmos: call cancelch0 + ret + +atmospherelist: db 0,33,10,15,255 + db 0,22,10,15,255 + db 0,22,0,15,255 + db 0,11,0,15,255 + db 0,11,10,15,255 + db 0,0,10,15,255 + + db 1,44,10,6,255 ;location,map x,y,sound,repeat + db 1,44,0,13,255 + + db 2,33,0,6,255 + db 2,22,0,5,255 + db 2,22,10,16,255 + db 2,11,10,16,255 + + db 3,44,0,15,255 + db 3,33,10,6,255 + db 3,33,0,5,255 + + db 4,11,30,6,255 + db 4,22,30,5,255 + db 4,22,20,13,255 + + db 10,33,30,6,255 + db 10,22,30,6,255 + + db 9,22,10,6,255 + db 9,22,20,16,255 + db 9,22,30,16,255 + db 9,22,40,16,255 + db 9,22,50,16,255 + + db 6,11,30,6,255 + db 6,0,10,15,255 + db 6,0,20,15,255 + db 6,11,20,15,255 + db 6,22,20,15,255 + + db 7,11,20,6,255 + db 7,0,20,6,255 + db 7,0,30,6,255 + + db 55,44,0,5,255 + db 55,44,10,5,255 + + db 5,22,30,6,255 + if demo + db 5,22,20,16,255 + db 5,22,10,16,255 + else + db 5,22,20,15,255 + db 5,22,10,15,255 + endif + + db 24,22,0,15,255 + db 24,33,0,15,255 + db 24,44,0,15,255 + db 24,33,10,15,255 + + db 8,0,10,6,255 + db 8,11,10,6,255 + db 8,22,10,6,255 + db 8,33,10,6,255 + db 8,33,20,6,255 + db 8,33,30,6,255 + db 8,33,40,6,255 + db 8,22,40,6,255 + db 8,11,40,6,255 + + db 11,11,20,12,255 + db 11,11,30,12,255 + db 11,22,20,12,255 + db 11,22,30,12,255 + + db 12,22,20,12,255 + db 13,22,20,12,255 + db 13,33,20,12,255 + + db 14,44,20,12,255 + db 14,33,0,12,255 + db 14,33,10,12,255 + db 14,33,20,12,255 + db 14,33,30,12,255 + db 14,33,40,12,255 + db 14,22,0,16,255 + + db 19,0,0,12,255 + + db 20,0,20,16,255 + db 20,0,30,16,255 + db 20,11,30,16,255 + db 20,0,40,16,255 + db 20,11,40,16,255 + + if demo + db 21,11,10,16,255 + db 21,11,20,16,255 + db 21,0,20,16,255 + db 21,22,20,16,255 + db 21,33,20,16,255 + db 21,44,20,16,255 + db 21,44,10,16,255 + else + db 21,11,10,15,255 + db 21,11,20,15,255 + db 21,0,20,15,255 + db 21,22,20,15,255 + db 21,33,20,15,255 + db 21,44,20,15,255 + db 21,44,10,15,255 + endif + + db 22,22,10,16,255 + db 22,22,20,16,255 + + db 23,22,30,13,255 + db 23,22,40,13,255 + db 23,33,40,13,255 + db 23,11,40,13,255 + db 23,0,40,13,255 + db 23,0,50,13,255 + + db 25,11,40,16,255 + db 25,11,50,16,255 + db 25,0,50,16,255 + + db 27,11,20,16,255 + db 27,11,30,16,255 + + db 29,11,10,16,255 + + db 45,22,30,12,255 + db 45,22,40,12,255 + db 45,22,50,12,255 + + db 46,22,40,12,255 + db 46,11,50,12,255 + db 46,22,50,12,255 + db 46,33,50,12,255 + + db 47,0,0,12,255 + + db 26,22,20,16,255 + db 26,33,10,16,255 + db 26,33,20,16,255 + db 26,33,30,16,255 + db 26,44,30,16,255 + db 26,22,30,16,255 + db 26,11,30,16,255 + db 26,11,20,16,255 + db 26,0,20,16,255 + db 26,11,40,16,255 + db 26,0,40,16,255 + db 26,22,40,16,255 + db 26,11,50,16,255 + + db 28,0,30,15,255 + db 28,0,20,15,255 + db 28,0,40,15,255 + db 28,11,30,15,255 + db 28,11,20,15,255 + db 28,22,30,15,255 + db 28,22,20,15,255 + + db 255 + + endp + + + + + + +Walkintoroom proc near + + cmp location,14 + jnz notlair + cmp mapx,22 + jnz notlair + mov destination,1 + mov finaldest,1 + call autosetwalk +notlair: ret + + endp + + + + + + + + + + + + +Afterintroroom proc near + + cmp nowinnewroom,0 + jz notnewintro + call clearwork + call findroominloc + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + mov nowinnewroom,0 +notnewintro: ret + + endp + + + + + + + + + + + +Obname proc near + + cmp reasseschanges,0 + jz notnewpath + mov reasseschanges,0 + jmp diff + +notnewpath: cmp ah,commandtype + jz notdiffob + jmp diff +notdiffob: cmp al,command + jnz diff + cmp walkandexam,1 + jz walkandexamine + cmp mousebutton,0 + jz noobselect + cmp commandtype,3 + jnz isntblock + cmp lastflag,2 + jc noobselect +isntblock: mov bl,manspath + cmp bl,pointerspath + jnz wantstowalk + cmp commandtype,3 + jz wantstowalk + call finishedwalking + jnz noobselect + cmp commandtype,5 + jz wantstotalk + cmp watchingtime,0 + jnz noobselect + call examineob + ret +wantstotalk: cmp watchingtime,0 + jnz noobselect + call talk + ret +walkandexamine: call finishedwalking + jnz noobselect + mov al,walkexamtype + mov commandtype,al + mov al,walkexamnum + mov command,al + mov walkandexam,0 + cmp commandtype,5 + jz noobselect + call examineob + ret +wantstowalk: call setwalk + mov reasseschanges,1 +noobselect: ret + + +diff: mov command,al + mov commandtype,ah +diff2: cmp linepointer,254 + jnz middleofwalk + cmp watchingtime,0 + jnz middleofwalk + mov al,facing + cmp al,turntoface + jnz middleofwalk + cmp commandtype,3 + jnz notblock + mov bl,manspath + cmp bl,pointerspath + jnz dontcheck + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc isblock +dontcheck: call getflagunderp + cmp lastflag,2 + jc isblock + cmp lastflag,128 + jnc isblock + jmp toofaraway ; only here for turning on doorstep +notblock: mov bl,manspath + cmp bl,pointerspath + jnz toofaraway + cmp commandtype,3 + jz isblock + cmp commandtype,5 + jz isaperson + call examineobtext + ret +middleofwalk: call blocknametext + ret +isblock: call blocknametext + ret +isaperson: call personnametext + ret +toofaraway: call walktotext + ret + + endp + + + + + + + +Finishedwalking proc near + + cmp linepointer,254 + jnz iswalking + mov al,facing + cmp al,turntoface +iswalking: ret + + endp + + + + + + + +Examineobtext proc near + + mov bl,command + mov bh,commandtype + mov al,1 + call commandwithob + ret + + endp + + + + + +Commandwithob proc near + + push ax + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + push bx + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + + pop ax + mov di,offset cs:commandline + call copyname + pop ax + + mov di,lastxpos + cmp al,0 + jz noadd + add di,5 +noadd: mov bx,textaddressy + push cs + pop es + mov si,offset cs:commandline + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + +commandline: db "OBJECT NAME ONE ",0 + + endp + + + + +Commandonly proc near + + push ax bx cx dx es ds si di + call deltextline + pop di si ds es dx cx bx ax + + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + + mov di,textaddressx + mov bx,textaddressy + mov dl,textlen + mov al,0 + mov ah,0 + call printdirect + mov newtextline,1 + ret + + endp + + + + + +Printmessage proc near + + push dx bx di + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + +Printmessage2 proc near + + push dx bx di + push ax + mov ah,0 + add ax,ax + mov bx,ax + mov es,commandtext + mov ax,[es:bx] + add ax,textstart + mov si,ax + pop ax + +searchmess: push ax + call findnextcolon + pop ax + dec ah + jnz searchmess + + pop di bx dx + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + +Blocknametext proc near + + mov bl,command + mov bh,commandtype + mov al,0 + call commandwithob + ret + + endp + + + + +Personnametext proc near + + mov bl,command + and bl,127 + mov bh,commandtype + mov al,2 + call commandwithob + ret + + endp + + + + + + + +Walktotext proc near + + mov bl,command + mov bh,commandtype + mov al,3 + call commandwithob + ret + + endp + + + + + +Getflagunderp proc near + + mov cx,mousex + sub cx,mapadx + mov ax,mousey + sub ax,mapady + mov ch,al + call checkone + mov lastflag,cl + mov lastflagex,ch + ret + + endp + + + + + +Setwalk proc near + + cmp linepointer,254 + jnz alreadywalking + mov al,pointerspath + cmp al,manspath + jz cantwalk2 + cmp watchmode,1 + jz holdingreel + cmp watchmode,2 + jz cantwalk + mov destination,al + mov finaldest,al + cmp mousebutton,2 + jnz notwalkandexam + cmp commandtype,3 + jz notwalkandexam + mov walkandexam,1 + mov al,commandtype + mov walkexamtype,al + mov al,command + mov walkexamnum,al +notwalkandexam: call autosetwalk +cantwalk: ret +cantwalk2: call facerightway + ret +alreadywalking: mov al,pointerspath + mov finaldest,al + ret + +holdingreel: mov destafterhold,al + mov watchmode,2 + ret + + endp + + + + + + + +Autosetwalk proc near + + mov al,manspath + cmp finaldest,al + jnz notsamealready + ret +notsamealready: call getroomspaths + call checkdest + push bx + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov linestartx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov linestarty,ax + pop bx + + mov al,destination + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx] + mov ah,0 + sub ax,12 + mov lineendx,ax + mov al,[es:bx+1] + mov ah,0 + sub ax,12 + mov lineendy,ax + call bresenhams + + cmp linedirection,0 + jz normalline + mov al,linelength + dec al + mov linepointer,al + mov linedirection,1 + ret + +normalline: mov linepointer,0 + ret + + endp + + + + + + + + +Checkdest proc near + + push bx + add bx,12*8 + mov ah,manspath + mov cl,4 + shl ah,cl + mov al,destination + + mov cl,24 + mov ch,destination +checkdestloop: mov dh,[es:bx] + and dh,11110000b + mov dl,[es:bx] + and dl,00001111b + cmp ax,dx + jnz nextcheck + mov al,[es:bx+1] + and al,15 + mov destination,al + pop bx + ret +nextcheck: mov dl,[es:bx] + and dl,11110000b + shr dl,1 + shr dl,1 + shr dl,1 + shr dl,1 + mov dh,[es:bx] + and dh,00001111b + shl dh,1 + shl dh,1 + shl dh,1 + shl dh,1 + cmp ax,dx + jnz nextcheck2 + mov ch,[es:bx+1] + and ch,15 +nextcheck2: add bx,2 + dec cl + jnz checkdestloop + mov destination,ch + pop bx + ret + + endp + + + + + + + + + + + + + + +Bresenhams proc near + + call workoutframes + + mov dx,seg linedata + mov es,dx + mov di,offset es:linedata + mov si,1 + mov linedirection,0 + + mov cx,lineendx + sub cx,linestartx + jz vertline + jns line1 + + neg cx + mov bx,lineendx + xchg bx,linestartx + mov lineendx,bx + + mov bx,lineendy + xchg bx,linestarty + mov lineendy,bx + mov linedirection,1 + +line1: mov bx,lineendy + sub bx,linestarty + jz horizline + jns line3 + + neg bx + neg si + +line3: push si + mov lineroutine,0 ; means lo slope + cmp bx,cx + jle line4 + mov lineroutine,1 ; means hi slope + xchg bx,cx + +line4: shl bx,1 + mov increment1,bx + sub bx,cx + mov si,bx + sub bx,cx + mov increment2,bx + + mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx + pop bx + cmp lineroutine,1 + jz hislope + jmp loslope + +vertline: mov ax,linestarty + mov bx,lineendy + mov cx,bx + sub cx,ax + jge line31 + + neg cx + mov ax,bx + mov linedirection,1 + +line31: inc cx + mov bx,linestartx + xchg ax,bx + mov ah,bl + mov bx,si +line32: stosw + add ah,bl + loop line32 + jmp lineexit + + +horizline: mov ax,linestartx + mov bx,linestarty + mov ah,bl + inc cx +horizloop: stosw + inc al + loop horizloop + jmp lineexit + + +loslope: +loloop: stosw + inc al + or si,si + jns line12 + add si,increment1 + loop loloop + jmp lineexit + +line12: add si,increment2 + add ah,bl + loop loloop + jmp lineexit + + + +hislope: +hiloop: stosw + add ah,bl + or si,si + jns line23 + add si,increment1 + loop hiloop + jmp lineexit + +line23: add si,increment2 + inc al + loop hiloop + +lineexit: sub di,offset es:linedata + mov ax,di + shr ax,1 + mov linelength,al + ret + + endp + + + + + + + +Workoutframes proc near + + mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jnc notneg1 + neg bx +notneg1: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc notneg2 + neg cx +notneg2: cmp bx,cx + jnc tendstohoriz + mov dl,2 + mov ax,cx + shr ax,1 + cmp bx,ax + jc gotquad + mov dl,1 + jmp gotquad +tendstohoriz: mov dl,0 + mov ax,bx + shr ax,1 + cmp cx,ax + jc gotquad + mov dl,1 + jmp gotquad + +gotquad: mov bx,linestartx + add bx,32 + mov ax,lineendx + add ax,32 + sub bx,ax + jc isinright +isinleft: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc topleft + cmp dl,1 + jz noswap1 + xor dl,2 +noswap1: add dl,4 + jmp success +topleft: add dl,6 + jmp success + +isinright: mov cx,linestarty + add cx,32 + mov ax,lineendy + add ax,32 + sub cx,ax + jnc botright + add dl,2 + jmp success +botright: cmp dl,1 + jz noswap2 + xor dl,2 +noswap2: + +success: and dl,7 + mov turntoface,dl + mov turndirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + +;Multiply8 proc near +; +; mov ah,0 +; mov cx,8 +; mul cx +; ret +; +; endp + + + + + + +Getroomspaths proc near + + mov al,roomnum + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + ret + + endp + + + + + + + + + + + + + + + + +Copyname proc near + + push di + call findobname + pop di + push cs + pop es + +copytext: mov cx,28 +make: lodsb + cmp al,":" + jz finishmakename + cmp al,0 + jz finishmakename + stosb + loop make + +finishmakename: inc cx + mov al,0 + stosb + ret + mov al,255 + rep stosb + ret + + endp + + + + + + + + + +Findobname proc near + + push ax + mov ah,0 + add ax,ax + mov bx,ax + pop ax + + cmp ah,5 + jnz notpersonname + + push ax + and al,127 + mov ah,0 + mov bx,64*2 + mul bx + mov si,ax + mov ds,people + add si,persontxtdat + mov cx,persontext + mov ax,[si] + add ax,cx + mov si,ax + pop ax + ret + +notpersonname: cmp ah,4 + jnz notextraname + mov ds,extras + add bx,extextdat + mov ax,[bx] + add ax,extext + mov si,ax + ret + +notextraname: cmp ah,2 + jnz notfreename + mov ds,freedesc + add bx,freetextdat + mov ax,[bx] + add ax,freetext + mov si,ax + ret + +notfreename: cmp ah,1 + jnz notsetname + mov ds,setdesc + add bx,settextdat + mov ax,[bx] + add ax,settext + mov si,ax + ret + +notsetname: mov ds,blockdesc + add bx,blocktextdat + mov ax,[bx] + add ax,blocktext + mov si,ax + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------Printing of non scrolling icons---- + +Showicon proc near + + cmp reallocation,50 + jnc isdream1 + call showpanel + call showman + call roomname + call panelicons1 + call zoomicon + ret + +isdream1: mov ds,tempsprites + mov di,72 + mov bx,2 + mov al,45 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+47 + mov bx,2 + mov al,46 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,69-10 + mov bx,21 + mov al,49 + mov ah,0 + call showframe + + mov ds,tempsprites + mov di,160+88 + mov bx,2 + mov al,45 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+43 + mov bx,2 + mov al,46 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+101 + mov bx,21 + mov al,49 + mov ah,4 + call showframe + call middlepanel + ret + + endp + + + + + +Middlepanel proc near + + mov ds,tempsprites + mov di,72+47+20 + mov bx,0 + mov al,48 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,72+19 + mov bx,21 + mov al,47 + mov ah,0 + call showframe + mov ds,tempsprites + mov di,160+23 + mov bx,0 + mov al,48 + mov ah,4 + call showframe + mov ds,tempsprites + mov di,160+71 + mov bx,21 + mov al,47 + mov ah,4 + call showframe + ret + + endp + + + + + + + + + + +Showman proc near + + mov ds,icons1 + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,icons1 + mov di,0 + mov bx,114 + mov al,1 + mov ah,0 + call showframe + + cmp shadeson,0 + jz notverycool + + mov ds,icons1 + mov di,28 + mov bx,25 + mov al,2 + mov ah,0 + call showframe +notverycool: ret + + endp + + + + + + + + + + + + + + + + + + + +Showpanel proc near + + mov ds,icons1 + mov di,72 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + mov ds,icons1 + mov di,192 + mov bx,0 + mov al,19 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Roomname proc near + + mov di,88 + mov bx,18 + mov al,53 + mov dl,240 + call printmessage + + mov bl,roomnum + cmp bl,32 + jc notover32 + sub bl,32 + +notover32: mov bh,0 + add bx,bx + mov es,roomdesc + add bx,intextdat + mov ax,[es:bx] + add ax,intext + mov si,ax + + mov linespacing,7 + mov di,88 + mov bx,25 + mov dl,120 + cmp watchon,1 + jz gotpl + mov dl,160 +gotpl: mov al,0 + mov ah,0 + call printdirect + mov linespacing,10 + + call usecharset1 + ret + + endp + + + + + + +Usecharset1 proc near + + mov ax,charset1 + mov currentset,ax + ret + + endp + + + + + + + + + + + +Usetempcharset proc near + + mov ax,tempcharset + mov currentset,ax + ret + + endp + + + + + +Showexit proc near + + mov ds,icons1 + mov di,274 + mov bx,154 + mov al,11 + mov ah,0 + call showframe + ret + + endp + + + + +Panelicons1 proc near + + mov di,0 + cmp watchon,1 + jz watchison + mov di,48 +watchison: push di + mov ds,icons2 + add di,204 + mov bx,4 + mov al,2 + mov ah,0 + call showframe + pop di + push di + cmp zoomon,1 + jz zoomisoff + mov ds,icons1 + add di,228 + mov bx,8 + mov al,5 + mov ah,0 + call showframe +zoomisoff: pop di + call showwatch + ret + + endp + + + + + + + + + + + + +Showwatch proc near + + cmp watchon,0 + jz nowristwatch + mov ds,icons1 + mov di,250 + mov bx,1 + mov al,6 + mov ah,0 + call showframe + call showtime +nowristwatch: ret + + endp + + +Gettime proc near + + mov ah,2ch + int 21h + mov secondcount,dh + mov minutecount,cl + mov hourcount,ch + ret + + endp + + + + + +Zoomicon proc near + + cmp zoomon,0 + jz nozoom1 + mov ds,icons1 + mov di,zoomx + mov bx,zoomy-1 + mov al,8 + mov ah,0 + call showframe +nozoom1: ret + + endp + + + + + + +Showblink proc near + + cmp manisoffscreen,1 + jz finblink1 + inc blinkcount + cmp shadeson,0 + jnz finblink1 + cmp reallocation,50 + jnc eyesshut + mov al,blinkcount + cmp al,3 + jnz finblink1 + mov blinkcount,0 + mov al,blinkframe + inc al + mov blinkframe,al + cmp al,6 + jc nomorethan6 + mov al,6 +nomorethan6: mov ah,0 + mov bx,offset cs:blinktab + add bx,ax + + mov al,[cs:bx] + mov ds,icons1 + mov di,44 + mov bx,32 + mov ah,0 + call showframe +finblink1: ret + +eyesshut: ;mov al,32 + ;mov ds,icons1 + ;mov di,44 + ;mov bx,32 + ;mov ah,0 + ;call showframe + ret + +blinktab: db 16,18,18,17,16,16,16 + + endp + + + + + + +Dumpblink proc near + + cmp shadeson,0 + jnz nodumpeye + cmp blinkcount,0 + jnz nodumpeye + mov al,blinkframe + cmp al,6 + jnc nodumpeye + push ds + mov di,44 + mov bx,32 + mov cl,16 + mov ch,12 + call multidump + pop ds +nodumpeye: ret + + endp + + + + + + + + + + + + + + + + + + +Worktoscreenm proc near + + call animpointer + call readmouse + call showpointer + call vsync + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + +;-------------------------------------------------------------Blank routine---- + + + + +Blank proc near + + cmp commandtype,199 + jz alreadyblnk + mov commandtype,199 + mov al,0 + call commandonly +alreadyblnk: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +;---------------------------------------------------------Standard routines---- + + + + + + + + + + + + + +Allpointer proc near + + call readmouse + call showpointer + call dumppointer + ret + + endp + + + + + + + +Hangonp proc near + + push cx + add cx,cx + pop ax + add cx,ax + mov maintimer,0 + mov al,pointerframe + mov ah,pickup + push ax + mov pointermode,3 + mov pickup,0 + push cx + mov commandtype,255 + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + +hangloop: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + mov ax,mousebutton + cmp ax,0 + jz notpressed + cmp ax,oldbutton + jnz getoutofit +notpressed: loop hangloop + +getoutofit: call delpointer + pop ax + mov pointerframe,al + mov pickup,ah + mov pointermode,0 + ret + + endp + + + + + +Hangonw proc near + +hangloopw: push cx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + pop cx + loop hangloopw + ret + + endp + + + + +Hangoncurs proc near + +monloop1: push cx + call printcurs + call vsync + call delcurs + pop cx + loop monloop1 + ret + + endp + + + + + + + + +Getunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiget + ret + + endp + + + + + +Dumpzoom proc near + + cmp zoomon,1 + jnz notzoomon + mov di,zoomx+5 + mov bx,zoomy+4 + mov cl,46 + mov ch,40 + call multidump +notzoomon: ret + + endp + + + + + + + +Putunderzoom proc near + + mov di,zoomx+5 + mov bx,zoomy+4 + mov ds,buffers + mov si,zoomspace + mov cl,46 + mov ch,40 + call multiput + ret + + endp + + + + + +Crosshair proc near + + cmp commandtype,3 + jz nocross + cmp commandtype,10 + jnc nocross + + mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,9 + mov ah,0 + call showframe + ret + +nocross: mov es,workspace + mov ds,icons1 + mov di,zoomx+24 + mov bx,zoomy+19 + mov al,29 + mov ah,0 + call showframe + ret + + endp + + + + + + +Showpointer proc near + + call showblink + mov di,mousex + mov oldpointerx,di + mov bx,mousey + mov oldpointery,bx + cmp pickup,1 + jz itsanobject + + push bx di + mov ds,icons1 + mov al,pointerframe + add al,20 + mov ah,0 + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cx,[si] + cmp cl,12 + jnc notsmallx + mov cl,12 +notsmallx: cmp ch,12 + jnc notsmally + mov ch,12 +notsmally: mov pointerxs,cl + mov pointerys,ch + push ds + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx + push di bx + mov al,pointerframe + add al,20 + mov ah,0 + call showframe + pop bx di + ret + +itsanobject: mov al,itemframe + mov ds,extras + cmp objecttype,4 + jz itsfrominv + mov ds,freeframes +itsfrominv: mov cl,al + add al,al + add al,cl + inc al + mov ah,0 + + push ax + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov ax,2080 + mov cx,[si] + cmp cl,12 + jnc notsmallx2 + mov cl,12 +notsmallx2: cmp ch,12 + jnc notsmally2 + mov ch,12 +notsmally2: mov pointerxs,cl + mov pointerys,ch + pop ax + + push di bx + push ax bx di ds + mov al,cl + mov ah,0 + shr ax,1 + sub oldpointerx,ax + sub di,ax + mov al,ch + shr ax,1 + sub oldpointery,ax + sub bx,ax + mov ds,buffers + mov si,pointerback + call multiget + pop ds di bx ax + mov ah,128 + call showframe + pop bx di + mov ds,icons1 + mov al,3 + mov ah,128 + call showframe + ret + + endp + + + + + + + +Delpointer proc near + + mov ax,oldpointerx + cmp ax,0ffffh + jz nevershown + mov delherex,ax + mov ax,oldpointery + mov delherey,ax + mov cl,pointerxs + mov delxs,cl + mov ch,pointerys + mov delys,ch + mov ds,buffers + mov si,pointerback + mov di,delherex + mov bx,delherey + call multiput +nevershown: ret + + endp + + + + + + + + + +Dumppointer proc near + + call dumpblink + mov cl,delxs + mov ch,delys + mov di,delherex + mov bx,delherey + call multidump + + mov bx,oldpointery + mov di,oldpointerx + cmp di,delherex + jnz difffound + cmp bx,delherey + jz notboth +difffound: mov cl,pointerxs + mov ch,pointerys + call multidump +notboth: ret + + endp + + + + + + + + + + + +Undertextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiget + ret + + endp + + + + + + + + +Deltextline proc near + + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov ds,buffers + mov si,textunder + mov cl,undertextsizex + mov ch,undertextsizey + call multiput + ret + + endp + + + + + +Dumptextline proc near + + cmp newtextline,1 + jnz nodumptextline + mov newtextline,0 + mov di,textaddressx + mov bx,textaddressy + if foreign + sub bx,3 + endif + mov cl,undertextsizex + mov ch,undertextsizey + call multidump +nodumptextline: ret + + endp + + + + + + + + + + + + + + + + + +Animpointer proc near + + cmp pointermode,2 + jz combathand + cmp pointermode,3 + jz mousehand + + cmp watchingtime,0 + jz notwatchpoint + mov pointerframe,11 + ret +notwatchpoint: mov pointerframe,0 + cmp inmaparea,0 + jz gothand + cmp pointerfirstpath,0 + jz gothand +arrow: call getflagunderp + cmp cl,2 + jc gothand + cmp cl,128 + jnc gothand + mov pointerframe,3 + test cl,4 + jnz gothand + mov pointerframe,4 + test cl,16 + jnz gothand + mov pointerframe,5 + test cl,2 + jnz gothand + mov pointerframe,6 + test cl,8 + jnz gothand + mov pointerframe,8 +gothand: ret + +mousehand: cmp pointerspeed,0 + jz rightspeed3 + dec pointerspeed + jmp finflashmouse +rightspeed3: mov pointerspeed,5 + inc pointercount + cmp pointercount,16 + jnz finflashmouse + mov pointercount,0 +finflashmouse: mov al,pointercount + mov ah,0 + mov bx,offset cs:flashmousetab + add bx,ax + mov al,[cs:bx] + mov pointerframe,al + ret + +combathand: mov pointerframe,0 + cmp reallocation,14 + jnz notarrow + cmp commandtype,211 + jnz notarrow + mov pointerframe,5 +notarrow: ret + +flashmousetab: db 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2 + + endp + + + + +;------------------------------------------------Mouse and keyboard-readers---- + +Setmouse proc near + + if recording + mov recordpos,-8 + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov rechandle,ax + endif + + if playback + mov dx,seg recname + mov ds,dx + mov dx,offset recname + mov ah,3dh + mov al,2 + int 21h + mov rechandle,ax + call loadrec + endif + + mov oldpointerx,0ffffh + + mov ax,0 + int 33h + mov ax,8 + mov cx,15 + mov dx,184 + int 33h + mov ax,7 + mov cx,15 + mov dx,298*2 + int 33h + ret + + endp + + + + + +Readmouse proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton,bx + ret + + endp + + + + + + + +Mousecall proc near + + if playback + call playmouse + ret + endif + + mov ax,3 + int 33h + shr cx,1 + cmp cx,298 + jc notxover + mov cx,298 +notxover: cmp cx,15 + jnc notxover2 + mov cx,15 +notxover2: cmp dx,184 + jc notyover + mov dx,184 +notyover: cmp dx,15 + jnc notyover2 + mov dx,15 +notyover2: + if recording + call recmouse + endif + ret + + endp + + + + + + + if playback + +Playmouse proc near + + mov es,recordspace + mov di,recordpos + cmp word ptr [es:di+6],0 + jnz isthisplay + add di,8 + add recordpos,8 + cmp di,16384 + jnz isthisplay + call loadrec +isthisplay: mov cx,[es:di] + mov dx,[es:di+2] + mov bx,[es:di+4] + dec word ptr [es:di+6] + ret + + endp + + endif + + if recording + +Recmouse proc near + + mov es,recordspace + mov di,recordpos + cmp di,-8 + jz diffrec + cmp [es:di],cx + jnz diffrec + cmp [es:di+2],dx + jnz diffrec + cmp [es:di+4],bx + jnz diffrec + inc word ptr [es:di+6] + cmp word ptr [es:di+5],0ffffh + jz diffrec + ret +diffrec: add recordpos,8 + add di,8 + cmp di,16384 + jnz notsaverec + push cx dx bx + call saverec + pop bx dx cx +notsaverec: mov [es:di],cx + mov [es:di+2],dx + mov [es:di+4],bx + mov word ptr [es:di+6],1 + ret + + endp + + + + + +Saverec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,recordpos + add cx,8 + mov ah,40h + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + + + + +Loadrec proc near + + mov bx,rechandle + mov ds,recordspace + mov dx,0 + mov cx,16384+8 + mov ah,3fh + int 21h + mov di,0 + mov recordpos,0 + ret + + endp + + + endif + + + + + + + +Readmouse1 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton1,bx + ret + + endp + + + +Readmouse2 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton2,bx + ret + + endp + + +Readmouse3 proc near + + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov mousebutton3,bx + ret + + endp + + + + + + +Readmouse4 proc near + + mov ax,mousebutton + mov oldbutton,ax + mov ax,mousex + mov oldx,ax + mov ax,mousey + mov oldy,ax + call mousecall + mov mousex,cx + mov mousey,dx + mov ax,mousebutton1 + or ax,mousebutton2 + or ax,mousebutton3 + or bx,ax + mov mousebutton,bx + ret + + endp + + + + + +Readkey proc near + + mov bx,bufferout + cmp bx,bufferin + jz nokey + inc bx + and bx,15 + mov bufferout,bx + mov di,offset cs:keybuffer + add di,bx + mov al,[cs:di] + mov currentkey,al + ret +nokey: mov currentkey,0 + ret + + + endp + +keybuffer: db 16 dup (0) + + + +Convertkey proc near + + and al,127 + mov ah,0 + mov di,offset cs:keyconverttab + add di,ax + mov al,[cs:di] + ret + +keyconverttab: db 0,0,"1","2","3","4","5","6","7","8","9","0","-",0,8,0 + db "Q","W","E","R","T","Y","U","I","O","P",0,0,13,0,"A","S" + db "D","F","G","H","J","K","L",0,0,0,0,0,"Z","X","C","V","B","N","M" + db 0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + + endp + + + + +;-------------------------------------------------------------Miscellaneous---- + +Randomnum1 proc near + + push ds es di bx cx + call randomnumber + pop cx bx di es ds + ret + + endp + + + + + +Randomnum2 proc near + + push ds es di bx ax + call randomnumber + mov cl,al + pop ax bx di es ds + ret + + endp + + + + + +Randomnumber proc near + + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + mov al,seed + and al,48h + add al,38h + sal al,1 + sal al,1 + rcl seed+2,1 + rcl seed+1,1 + rcl seed+0,1 + + mov al,seed + ret + + endp + + + + + + +Hangon proc near + +hangonloop: push cx + call vsync + pop cx + loop hangonloop + ret + + endp + + + + + +;-------------------------------------------------------------Disc handling---- + + +Loadtraveltext proc near + + mov dx,offset cs:traveltextname + call standardload + mov traveltext,ax + ret + + endp + + + + + + +Loadintotemp proc near + + push cs + pop ds + call standardload + mov tempgraphics,ax + ret + + endp + + + + + + +Loadintotemp2 proc near + + push cs + pop ds + call standardload + mov tempgraphics2,ax + ret + + endp + + + + +Loadintotemp3 proc near + + push cs + pop ds + call standardload + mov tempgraphics3,ax + ret + + endp + + + +Loadtempcharset proc near + + call standardload + mov tempcharset,ax + ret + + endp + + + + + + +Standardload proc near + + call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov ds,ax + pop cx + push ax + mov dx,0 + call readfromfile + call closefile + pop ax + ret + + endp + + + + + + +Loadtemptext proc near + + call standardload + mov textfile1,ax + ret + + endp + + + + + + + +Loadroom proc near + + mov roomloaded,1 + mov timecount,0 + mov maintimer,0 + mov mapoffsetx,104 + mov mapoffsety,38 + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + mov al,newlocation + mov location,al + call getroomdata + call startloading + call loadroomssample + call switchryanon + call drawflags + call getdimension + ret + + endp + + + + +Loadroomssample proc near + + mov al,roomssample + cmp al,255 + jz loadedalready + cmp al,currentsample + jz loadedalready + mov currentsample,al + mov al,currentsample + mov cl,"0" + call twodigitnum + mov di,offset cs:samplename + xchg al,ah + mov [cs:di+10],ax + mov dx,di + call loadsecondsample +loadedalready: ret + + endp + + + + + +Getridofreels proc near + + cmp roomloaded,0 + jz dontgetrid + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem +dontgetrid: ret + + endp + + + + + +Getridofall proc near + + mov es,backdrop + call deallocatemem + mov es,setframes + call deallocatemem + mov es,reel1 + call deallocatemem + mov es,reel2 + call deallocatemem + mov es,reel3 + call deallocatemem + mov es,reels + call deallocatemem + mov es,people + call deallocatemem + mov es,setdesc + call deallocatemem + mov es,blockdesc + call deallocatemem + mov es,roomdesc + call deallocatemem + mov es,freeframes + call deallocatemem + mov es,freedesc + call deallocatemem + ret + + endp + + + + + +Restorereels proc near + + cmp roomloaded,0 + jz dontrestore + mov al,reallocation + call getroomdata + mov dx,bx + call openfile + call readheader + + call dontloadseg + call dontloadseg + call dontloadseg + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + call closefile +dontrestore: ret + + endp + + + + + + + +Restoreall proc near + + mov al,location + call getroomdata + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + ;mov ds,setdat + ;mov dx,0 + ;mov cx,setdatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + ;call bloc ;BIG FIXME: undefined bloc, replaced with loadseg. dunno! call loadseg - call allocateload - mov reel2,ax - mov ds,ax - mov dx,0 - call loadseg - call allocateload - mov reel3,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov reels,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov people,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov setdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov blockdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov roomdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov freeframes,ax - mov ds,ax - mov dx,0 - call loadseg - - ;mov ds,freedat - ;mov dx,0 - ;mov cx,freedatlen - ;mov al,255 - ;call fillspace - call dontloadseg - - call allocateload - mov freedesc,ax - mov ds,ax - mov dx,freetextdat - call loadseg - - call closefile - - call setallchanges - ret - - endp - - - -Sortoutmap proc near - - push es di - mov ds,workspace - mov si,0 - mov es,mapdata - mov di,0 - - mov cx,maplength -blimey: push cx si - mov cx,mapwidth - rep movsb - pop si cx - add si,132 - loop blimey - pop di es - ret - - endp - - - - -Startloading proc near - - mov combatcount,0 - mov al,[cs:bx+13] - mov roomssample,al - mov al,[cs:bx+15] - mov mapx,al - mov al,[cs:bx+16] - mov mapy,al - - mov al,[cs:bx+20] ; start path pos - mov liftflag,al - mov al,[cs:bx+21] ; start path pos - mov manspath,al - mov destination,al - mov finaldest,al - mov al,[cs:bx+22] - mov facing,al - mov turntoface,al - mov al,[cs:bx+23] - mov counttoopen,al - mov al,[cs:bx+24] - mov liftpath,al - mov al,[cs:bx+25] - mov doorpath,al - mov lastweapon,-1 - mov al,[cs:bx+27] - push ax - - mov al,[cs:bx+31] - mov ah,reallocation - mov reallocation,al - - mov dx,bx - call openfile - call readheader - - call allocateload - mov ds,ax - mov backdrop,ax - mov dx,flags - call loadseg - - mov ds,workspace ;mapdata - mov dx,map - mov cx,132*66 ;maplen - mov al,0 - call fillspace - call loadseg - call sortoutmap - - call allocateload - mov setframes,ax - mov ds,ax - mov dx,framedata - call loadseg - - mov ds,setdat - mov dx,0 - mov cx,setdatlen - mov al,255 - call fillspace - call loadseg - - call allocateload - mov reel1,ax - mov ds,ax - mov dx,0 - call loadseg - call allocateload - mov reel2,ax - mov ds,ax - mov dx,0 - call loadseg - call allocateload - mov reel3,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov reels,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov people,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov setdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov blockdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov roomdesc,ax - mov ds,ax - mov dx,0 - call loadseg - - call allocateload - mov freeframes,ax - mov ds,ax - mov dx,0 - call loadseg - - mov ds,freedat - mov dx,0 - mov cx,freedatlen - mov al,255 - call fillspace - call loadseg - - call allocateload - mov freedesc,ax - mov ds,ax - mov dx,freetextdat - call loadseg - - call closefile - - - call findroominloc - call deletetaken - call setallchanges - call autoappear - mov al,newlocation - call getroomdata - mov lastweapon,-1 - mov mandead,0 - mov lookcounter,160 - mov newlocation,255 - mov linepointer,254 - pop ax - cmp al,255 - jz dontwalkin - mov manspath,al - push bx - call autosetwalk - pop bx -dontwalkin: call findxyfrompath - ret - - endp - - - - - - - - - - -Disablepath proc near ;needs al,ah map x,y cl=path - - push cx - xchg al,ah - mov cx,-6 -looky2: add cx,6 - sub al,10 - jnc looky2 - mov al,ah - dec cx -lookx2: inc cx - sub al,11 - jnc lookx2 - mov al,cl - mov ah,0 - mov cx,144 - mul cx - mov es,reels - mov bx,pathdata - add bx,ax - pop ax - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,0 - mov [es:bx+6],al - ret - - endp - - - - - - - - -Findxyfrompath proc near ;path number was found from - ;room data. Fill ryanxy from - call getroomspaths ;the pathdata. - mov al,manspath - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov ax,[es:bx] - sub al,12 - sub ah,12 - mov ryanx,al - mov ryany,ah - ret - - endp - - - - - -Findroominloc proc near - - mov al,mapy - mov cx,-6 -looky: add cx,6 - sub al,10 - jnc looky - mov al,mapx - dec cx -lookx: inc cx - sub al,11 - jnc lookx - mov roomnum,cl - ret - - endp - - - - - - -Getroomdata proc near - - mov ah,0 - mov cx,32 - mul cx - mov bx,offset cs:roomdata - add bx,ax - ret - - endp - - - - - - - - - - - - - -Readheader proc near - - push cs - pop ds - mov dx,offset cs:fileheader - mov cx,headerlen - call readfromfile - push cs - pop es - mov di,offset cs:filedata - ret - - endp - - - - - - - - -Dontloadseg proc neqr - - mov ax,[es:di] - add di,2 - push bx di es - mov cx,0 - mov dx,ax - mov al,1 - mov ah,42h - int 21h - pop es di bx - ret - - endp - - - - - - -Allocateload proc near - - push es di - mov bx,[es:di] - mov cl,4 - shr bx,cl - call allocatemem - pop di es - ret - - endp - - - - -Fillspace proc near - - push es ds dx di bx - mov di,dx - push ds - pop es - rep stosb - pop bx di dx ds es - ret - - endp - - - - - - - -Getridoftemp proc near - - mov es,tempgraphics - call deallocatemem - ret - - endp - - - - - -Getridoftemptext proc near - - mov es,textfile1 - call deallocatemem - ret - - endp - - - - - -Getridoftemp2 proc near - - mov es,tempgraphics2 - call deallocatemem - ret - - endp - - - -Getridoftemp3 proc near - - mov es,tempgraphics3 - call deallocatemem - ret - - endp - - - -Getridoftempcharset proc near - - mov es,tempcharset - call deallocatemem - ret - - endp - - - -Getridoftempsp proc near - - mov es,tempsprites - call deallocatemem - ret - - endp - - - - - - - - - - - - - - - - - - - - - - - -Readsetdata proc near - - mov dx,offset cs:characterset1 - call standardload - mov charset1,ax - - mov dx,offset cs:icongraphics0 - call standardload - mov icons1,ax - - mov dx,offset cs:icongraphics1 - call standardload - mov icons2,ax - - mov dx,offset cs:spritename1 - call standardload - mov mainsprites,ax - - mov dx,offset cs:puzzletextname - call standardload - mov puzzletext,ax - - mov dx,offset cs:commandtextname - call standardload - mov commandtext,ax - - mov ax,charset1 - mov currentset,ax - - cmp soundint,255 - jz novolumeload - mov dx,offset cs:volumetabname - call openfile - mov cx,2048-256 - mov ds,soundbuffer - mov dx,16384 - call readfromfile - call closefile -novolumeload: ret - - endp - - - - - - - - - - - -Createfile proc near - - mov ah,3ch - mov cx,0 - int 21h - mov bx,ax - ret - - endp - - - - - - - -Openfile proc near - - if cd - call makename - endif - push cs - pop ds - mov ah,3dh - mov al,2 - push dx - int 21h - pop dx - jc fileerror - mov handle,ax - ret -fileerror: mov gameerror,8 - jmp quickquit2 - - endp - - - if cd -Openfilefromc proc near - - push cs - pop ds - mov ah,3dh - mov al,2 - push dx - int 21h - pop dx - mov handle,ax - ret - - endp - endif - - - if cd -Makename proc near - - if demo - ret - endif - mov si,dx - mov di,offset cs:place -transfer: mov al,[cs:si] - mov [cs:di],al - inc si - inc di - cmp al,0 - jnz transfer - mov dx,offset cs:id - ret -id: db "D:\" -place: db 30 dup (0) - - endp - endif - - - - - -Openfilenocheck proc near - - if cd - call makename - endif - push cs - pop ds - mov ah,3dh - mov al,2 - int 21h - mov handle,ax - ret - - endp - - - -Openforsave proc near - - mov cx,0 - mov ah,3ch - mov al,2 - int 21h - mov handle,ax - ret - - endp - - - -Closefile proc near - - mov bx,handle - mov ah,3eh - int 21h - ret - - endp - - - - -Readfromfile proc near - - mov bx,handle - mov ah,3fh - int 21h - ret - - endp - - - - -Setkeyboardint proc near - - mov ah,35h - mov al,9 - int 21h - mov oldint9seg,es ; Save es:bx to temp memory - mov oldint9add,bx - push cs - pop ds - mov dx,offset cs:keyboardread - mov ah,25h - mov al,9 - int 21h ; Set to new - ret - - endp - - - - -Resetkeyboard proc near - - cmp oldint9add,-1 - jz noreset - mov dx,oldint9add ;Restore old interupt vector - mov ax,oldint9seg ;for keys - mov ds,ax - mov ah,25h - mov al,9 - int 21h -noreset: ret - - endp - - - - - - - - - - - - - - - - - - - - - - -Keyboardread proc near - - push ax dx di ds es - in al,60h - cmp al,lasthardkey - jz same - mov lasthardkey,al - cmp al,128 - jnc same - mov dx,bufferin - inc dx - and dx,15 - cmp dx,bufferout - jz same ;buffer is full - mov bufferin,dx - call convertkey - mov di,offset cs:keybuffer - mov dx,bufferin - add di,dx - mov [cs:di],al -same: in al,61h - mov ah,al - or al,80h ; Mask for Akn - out 61h,al ; Set Akn. - and al,7fh - out 61h,al - cli - mov al,20h ; 8259 end of interrupt - out 20h,al - pop es ds di dx ax - iret - - endp - - - -;------------------------------------------------------Text and tables data---- - - - -Fileheader db "DREAMWEB DATA FILE " - db "COPYRIGHT 1992 " - db "CREATIVE REALITY" -Filedata dw 20 dup (0) -Extradata db 6 dup (0) -Headerlen equ $-Fileheader - - -Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment - db 5,255,33,10 - db 255,255,255,0 - db 1,6,2,255,3,255,255,255,255,255,0 - - db "DREAMWEB.R01",0 - db 1,255,44,10 - db 255,255,255,0 - db 7,2,255,255,255,255,6,255,255,255,1 - - db "DREAMWEB.R02",0 - db 2,255,33,0 - db 255,255,255,0 - db 1,0,255,255,1,255,3,255,255,255,2 - - db "DREAMWEB.R03",0 - db 5,255,33,10 - db 255,255,255,0 - db 2,2,0,2,4,255,0,255,255,255,3 - - db "DREAMWEB.R04",0 - db 23,255,11,30 - db 255,255,255,0 - db 1,4,0,5,255,255,3,255,255,255,4 - - db "DREAMWEB.R05",0 - if demo - db 22,255,22,30 - else - db 5,255,22,30 - endif - db 255,255,255,0 - db 1,2,0,4,255,255,3,255,255,255,5 - - db "DREAMWEB.R06",0 - db 5,255,11,30 - db 255,255,255,0 - db 1,0,0,1,2,255,0,255,255,255,6 - - db "DREAMWEB.R07",0 - db 255,255,0,20 - db 255,255,255,0 - db 2,2,255,255,255,255,0,255,255,255,7 - - db "DREAMWEB.R08",0 - db 8,255,0,10 - db 255,255,255,0 - db 1,2,255,255,255,255,0,11,40,0,8 - - db "DREAMWEB.R09",0 - db 9,255,22,10 - db 255,255,255,0 - db 4,6,255,255,255,255,0,255,255,255,9 - - db "DREAMWEB.R10",0 - db 10,255,33,30 - db 255,255,255,0 - db 2,0,255,255,2,2,4,22,30,255,10 ;22,30,0 switches - ;off path 0 in skip - db "DREAMWEB.R11",0 - db 11,255,11,20 - db 255,255,255,0 - db 0,4,255,255,255,255,255,255,255,255,11 - - db "DREAMWEB.R12",0 - db 12,255,22,20 - db 255,255,255,0 - db 1,4,255,255,255,255,255,255,255,255,12 - - db "DREAMWEB.R13",0 - db 12,255,22,20 - db 255,255,255,0 - db 1,4,255,255,255,255,255,255,255,255,13 - - db "DREAMWEB.R14",0 - db 14,255,44,20 - db 255,255,255,0 - db 0,6,255,255,255,255,255,255,255,255,14 - - db 32 dup (0) - db 32 dup (0) - db 32 dup (0) - db 32 dup (0) - - db "DREAMWEB.R19",0 - db 19,255,0,0 - db 255,255,255,0 - db 0,4,255,255,255,255,255,255,255,255,19 - - db "DREAMWEB.R20",0 - db 22,255,0,20 - db 255,255,255,0 - db 1,4,2,15,255,255,255,255,255,255,20 - - db "DREAMWEB.R21",0 - if demo - db 22,255,11,10 - else - db 5,255,11,10 - endif - db 255,255,255,0 - db 1,4,2,15,1,255,255,255,255,255,21 - - db "DREAMWEB.R22",0 - db 22,255,22,10 - db 255,255,255,0 - db 0,4,255,255,1,255,255,255,255,255,22 - - db "DREAMWEB.R23",0 - db 23,255,22,30 - db 255,255,255,0 - db 1,4,2,15,3,255,255,255,255,255,23 - - db "DREAMWEB.R24",0 - db 5,255,44,0 - db 255,255,255,0 - db 1,6,2,15,255,255,255,255,255,255,24 - - db "DREAMWEB.R25",0 - db 22,255,11,40 - db 255,255,255,0 - db 1,0,255,255,255,255,255,255,255,255,25 - - db "DREAMWEB.R26",0 - db 9,255,22,20 - db 255,255,255,0 - db 4,2,255,255,255,255,255,255,255,255,26 - - db "DREAMWEB.R27",0 - db 22,255,11,20 - db 255,255,255,0 - db 0,6,255,255,255,255,255,255,255,255,27 - - db "DREAMWEB.R28",0 - db 5,255,11,30 - db 255,255,255,0 - db 0,0,255,255,2,255,255,255,255,255,28 - - db "DREAMWEB.R29",0 - db 22,255,11,10 - db 255,255,255,0 - db 0,2,255,255,255,255,255,255,255,255,29 - - - - db "DREAMWEB.R05",0 ;Duplicate of hotel lobby, - if demo - db 22,255,22,10 ;but emerging from the lift. - else - db 5,255,22,10 - endif - db 255,255,255,0 - db 1,4,1,15,255,255,255,255,255,255,5 - - db "DREAMWEB.R04",0 ;Duplicate of pool hall lobby, - db 23,255,22,20 ;but emerging from the lift. - db 255,255,255,0 - db 1,4,2,15,255,255,255,255,255,255,4 - - db "DREAMWEB.R10",0 ;entering alley via skip - db 10,255,22,30 - db 255,255,255,0 - db 3,6,255,255,255,255,255,255,255,255,10 - - db "DREAMWEB.R12",0 ;on the beach, getting up. - db 12,255,22,20 - db 255,255,255,0 - db 0,2,255,255,255,255,255,255,255,255,12 - - db "DREAMWEB.R03",0 ;Duplicate of Eden's lobby - db 5,255,44,0 ;but emerging from the lift - db 255,255,255,0 - db 1,6,2,255,4,255,255,255,255,255,3 - - db "DREAMWEB.R24",0 ;Duplicate of Eden's flat - db 5,255,22,0 ;but starting on the bed - db 255,255,255,0 - db 3,6,0,255,255,255,255,33,0,3,24 ; 33,0,3 turns off - ; path for lift - db "DREAMWEB.R22",0 ;Duplicate - db 22,255,22,20 ;of hotel but in pool room - db 255,255,255,0 - db 1,4,255,255,255,255,255,255,255,255,22 - - db "DREAMWEB.R22",0 ;Duplicate - db 22,255,22,20 ;of hotel but in pool room - db 255,255,255,0 ;coming out of bedroom - db 0,2,255,255,255,255,255,255,255,255,22 - - db "DREAMWEB.R11",0 ;Duplicate - db 11,255,22,30 ;of carpark but getting - db 255,255,255,0 ;up off the floor - db 0,0,255,255,255,255,255,255,255,255,11 - - db "DREAMWEB.R28",0 - db 5,255,11,20 - db 255,255,255,0 - db 0,6,255,255,2,255,255,255,255,255,28 - - db "DREAMWEB.R21",0 - if demo - db 22,255,11,10 - else - db 5,255,11,10 - endif - db 255,255,255,0 - db 1,4,2,15,1,255,255,255,255,255,21 - - db "DREAMWEB.R26",0 - db 9,255,0,40 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,26 - - db "DREAMWEB.R19",0 - db 19,255,0,0 - db 255,255,255,0 - db 2,2,255,255,255,255,255,255,255,255,19 - - db "DREAMWEB.R08",0 ;leaving tvstudio into street - db 8,255,11,40 - db 255,255,255,0 - db 0,4,255,255,255,255,255,255,255,255,8 - - db "DREAMWEB.R01",0 - db 1,255,44,10 - db 255,255,255,0 - db 3,6,255,255,255,255,255,255,255,255,1 - - - - db "DREAMWEB.R45",0 ;Dream room - db 35,255,22,30 - db 255,255,255,0 - db 0,6,255,255,255,255,255,255,255,255,45 - - db "DREAMWEB.R46",0 ;Dream room - db 35,255,22,40 - db 255,255,255,0 - db 0,4,255,255,255,255,255,255,255,255,46 - - db "DREAMWEB.R47",0 ;Dream room - db 35,255,0,0 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,47 - - db "DREAMWEB.R45",0 ;Dream room - db 35,255,22,30 - db 255,255,255,0 - db 4,0,255,255,255,255,255,255,255,255,45 - - db "DREAMWEB.R46",0 ;Dream room - db 35,255,22,50 - db 255,255,255,0 - db 0,4,255,255,255,255,255,255,255,255,46 - - - - db "DREAMWEB.R50",0 ; Intro sequence one - db 35,255,22,30 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,50 - - db "DREAMWEB.R51",0 ; Intro sequence two - db 35,255,11,30 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,51 - - db "DREAMWEB.R52",0 ; Intro sequence three - db 35,255,22,30 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,52 - - db "DREAMWEB.R53",0 ; Intro sequence four - db 35,255,33,0 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,53 - - db "DREAMWEB.R54",0 ; Intro sequence five - wasteland - db 35,255,0,0 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,54 - - db "DREAMWEB.R55",0 ; End sequence - db 14,255,44,0 - db 255,255,255,0 - db 0,0,255,255,255,255,255,255,255,255,55 - - -Madeuproomdat db 32 dup (0) - -Roomscango db 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0 - -Roompics db 5,0,3,2,4,1,10,9,8,6,11,4,7,7,0 - -Oplist db 3 dup (0) - -Inputline db 128 dup (0) - -linedata dw 200 dup (0ffffh) - -presslist db 6 dup (255) - -savenames db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - - - -savefiles db "DREAMWEB.D00",0 - db "DREAMWEB.D01",0 - db "DREAMWEB.D02",0 - db "DREAMWEB.D03",0 - db "DREAMWEB.D04",0 - db "DREAMWEB.D05",0 - db "DREAMWEB.D06",0 - -Recname db "DREAMWEB.DEM",0 - - -;-------------------------------------------------------End of code segment---- - -DREAMWEBPROG ends - - - - -;---------------------------------------------------------------Stack space----s - -STACKSPACE segment para stack 'STACK' - -stak db 256 dup (?) - -STACKSPACE ends - - - -;-----------------------------------------------------------End of all code---- - - end Dreamweb - - - - - - - - - - - - - - - - - - - + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + ;mov ds,freedat + ;mov dx,0 + ;mov cx,freedatlen + ;mov al,255 + ;call fillspace + call dontloadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + call setallchanges + ret + + endp + + + +Sortoutmap proc near + + push es di + mov ds,workspace + mov si,0 + mov es,mapdata + mov di,0 + + mov cx,maplength +blimey: push cx si + mov cx,mapwidth + rep movsb + pop si cx + add si,132 + loop blimey + pop di es + ret + + endp + + + + +Startloading proc near + + mov combatcount,0 + mov al,[cs:bx+13] + mov roomssample,al + mov al,[cs:bx+15] + mov mapx,al + mov al,[cs:bx+16] + mov mapy,al + + mov al,[cs:bx+20] ; start path pos + mov liftflag,al + mov al,[cs:bx+21] ; start path pos + mov manspath,al + mov destination,al + mov finaldest,al + mov al,[cs:bx+22] + mov facing,al + mov turntoface,al + mov al,[cs:bx+23] + mov counttoopen,al + mov al,[cs:bx+24] + mov liftpath,al + mov al,[cs:bx+25] + mov doorpath,al + mov lastweapon,-1 + mov al,[cs:bx+27] + push ax + + mov al,[cs:bx+31] + mov ah,reallocation + mov reallocation,al + + mov dx,bx + call openfile + call readheader + + call allocateload + mov ds,ax + mov backdrop,ax + mov dx,flags + call loadseg + + mov ds,workspace ;mapdata + mov dx,map + mov cx,132*66 ;maplen + mov al,0 + call fillspace + call loadseg + call sortoutmap + + call allocateload + mov setframes,ax + mov ds,ax + mov dx,framedata + call loadseg + + mov ds,setdat + mov dx,0 + mov cx,setdatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov reel1,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel2,ax + mov ds,ax + mov dx,0 + call loadseg + call allocateload + mov reel3,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov reels,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov people,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov setdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov blockdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov roomdesc,ax + mov ds,ax + mov dx,0 + call loadseg + + call allocateload + mov freeframes,ax + mov ds,ax + mov dx,0 + call loadseg + + mov ds,freedat + mov dx,0 + mov cx,freedatlen + mov al,255 + call fillspace + call loadseg + + call allocateload + mov freedesc,ax + mov ds,ax + mov dx,freetextdat + call loadseg + + call closefile + + + call findroominloc + call deletetaken + call setallchanges + call autoappear + mov al,newlocation + call getroomdata + mov lastweapon,-1 + mov mandead,0 + mov lookcounter,160 + mov newlocation,255 + mov linepointer,254 + pop ax + cmp al,255 + jz dontwalkin + mov manspath,al + push bx + call autosetwalk + pop bx +dontwalkin: call findxyfrompath + ret + + endp + + + + + + + + + + +Disablepath proc near ;needs al,ah map x,y cl=path + + push cx + xchg al,ah + mov cx,-6 +looky2: add cx,6 + sub al,10 + jnc looky2 + mov al,ah + dec cx +lookx2: inc cx + sub al,11 + jnc lookx2 + mov al,cl + mov ah,0 + mov cx,144 + mul cx + mov es,reels + mov bx,pathdata + add bx,ax + pop ax + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,0 + mov [es:bx+6],al + ret + + endp + + + + + + + + +Findxyfrompath proc near ;path number was found from + ;room data. Fill ryanxy from + call getroomspaths ;the pathdata. + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov ax,[es:bx] + sub al,12 + sub ah,12 + mov ryanx,al + mov ryany,ah + ret + + endp + + + + + +Findroominloc proc near + + mov al,mapy + mov cx,-6 +looky: add cx,6 + sub al,10 + jnc looky + mov al,mapx + dec cx +lookx: inc cx + sub al,11 + jnc lookx + mov roomnum,cl + ret + + endp + + + + + + +Getroomdata proc near + + mov ah,0 + mov cx,32 + mul cx + mov bx,offset cs:roomdata + add bx,ax + ret + + endp + + + + + + + + + + + + + +Readheader proc near + + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen + call readfromfile + push cs + pop es + mov di,offset cs:filedata + ret + + endp + + + + + + + + +Dontloadseg proc neqr + + mov ax,[es:di] + add di,2 + push bx di es + mov cx,0 + mov dx,ax + mov al,1 + mov ah,42h + int 21h + pop es di bx + ret + + endp + + + + + + +Allocateload proc near + + push es di + mov bx,[es:di] + mov cl,4 + shr bx,cl + call allocatemem + pop di es + ret + + endp + + + + +Fillspace proc near + + push es ds dx di bx + mov di,dx + push ds + pop es + rep stosb + pop bx di dx ds es + ret + + endp + + + + + + + +Getridoftemp proc near + + mov es,tempgraphics + call deallocatemem + ret + + endp + + + + + +Getridoftemptext proc near + + mov es,textfile1 + call deallocatemem + ret + + endp + + + + + +Getridoftemp2 proc near + + mov es,tempgraphics2 + call deallocatemem + ret + + endp + + + +Getridoftemp3 proc near + + mov es,tempgraphics3 + call deallocatemem + ret + + endp + + + +Getridoftempcharset proc near + + mov es,tempcharset + call deallocatemem + ret + + endp + + + +Getridoftempsp proc near + + mov es,tempsprites + call deallocatemem + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + +Readsetdata proc near + + mov dx,offset cs:characterset1 + call standardload + mov charset1,ax + + mov dx,offset cs:icongraphics0 + call standardload + mov icons1,ax + + mov dx,offset cs:icongraphics1 + call standardload + mov icons2,ax + + mov dx,offset cs:spritename1 + call standardload + mov mainsprites,ax + + mov dx,offset cs:puzzletextname + call standardload + mov puzzletext,ax + + mov dx,offset cs:commandtextname + call standardload + mov commandtext,ax + + mov ax,charset1 + mov currentset,ax + + cmp soundint,255 + jz novolumeload + mov dx,offset cs:volumetabname + call openfile + mov cx,2048-256 + mov ds,soundbuffer + mov dx,16384 + call readfromfile + call closefile +novolumeload: ret + + endp + + + + + + + + + + + +Createfile proc near + + mov ah,3ch + mov cx,0 + int 21h + mov bx,ax + ret + + endp + + + + + + + +Openfile proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + jc fileerror + mov handle,ax + ret +fileerror: mov gameerror,8 + jmp quickquit2 + + endp + + + if cd +Openfilefromc proc near + + push cs + pop ds + mov ah,3dh + mov al,2 + push dx + int 21h + pop dx + mov handle,ax + ret + + endp + endif + + + if cd +Makename proc near + + if demo + ret + endif + mov si,dx + mov di,offset cs:place +transfer: mov al,[cs:si] + mov [cs:di],al + inc si + inc di + cmp al,0 + jnz transfer + mov dx,offset cs:id + ret +id: db "D:\" +place: db 30 dup (0) + + endp + endif + + + + + +Openfilenocheck proc near + + if cd + call makename + endif + push cs + pop ds + mov ah,3dh + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Openforsave proc near + + mov cx,0 + mov ah,3ch + mov al,2 + int 21h + mov handle,ax + ret + + endp + + + +Closefile proc near + + mov bx,handle + mov ah,3eh + int 21h + ret + + endp + + + + +Readfromfile proc near + + mov bx,handle + mov ah,3fh + int 21h + ret + + endp + + + + +Setkeyboardint proc near + + mov ah,35h + mov al,9 + int 21h + mov oldint9seg,es ; Save es:bx to temp memory + mov oldint9add,bx + push cs + pop ds + mov dx,offset cs:keyboardread + mov ah,25h + mov al,9 + int 21h ; Set to new + ret + + endp + + + + +Resetkeyboard proc near + + cmp oldint9add,-1 + jz noreset + mov dx,oldint9add ;Restore old interupt vector + mov ax,oldint9seg ;for keys + mov ds,ax + mov ah,25h + mov al,9 + int 21h +noreset: ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Keyboardread proc near + + push ax dx di ds es + in al,60h + cmp al,lasthardkey + jz same + mov lasthardkey,al + cmp al,128 + jnc same + mov dx,bufferin + inc dx + and dx,15 + cmp dx,bufferout + jz same ;buffer is full + mov bufferin,dx + call convertkey + mov di,offset cs:keybuffer + mov dx,bufferin + add di,dx + mov [cs:di],al +same: in al,61h + mov ah,al + or al,80h ; Mask for Akn + out 61h,al ; Set Akn. + and al,7fh + out 61h,al + cli + mov al,20h ; 8259 end of interrupt + out 20h,al + pop es ds di dx ax + iret + + endp + + + +;------------------------------------------------------Text and tables data---- + + + +Fileheader db "DREAMWEB DATA FILE " + db "COPYRIGHT 1992 " + db "CREATIVE REALITY" +Filedata dw 20 dup (0) +Extradata db 6 dup (0) +Headerlen equ $-Fileheader + + +Roomdata db "DREAMWEB.R00",0 ;Ryan's apartment + db 5,255,33,10 + db 255,255,255,0 + db 1,6,2,255,3,255,255,255,255,255,0 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 7,2,255,255,255,255,6,255,255,255,1 + + db "DREAMWEB.R02",0 + db 2,255,33,0 + db 255,255,255,0 + db 1,0,255,255,1,255,3,255,255,255,2 + + db "DREAMWEB.R03",0 + db 5,255,33,10 + db 255,255,255,0 + db 2,2,0,2,4,255,0,255,255,255,3 + + db "DREAMWEB.R04",0 + db 23,255,11,30 + db 255,255,255,0 + db 1,4,0,5,255,255,3,255,255,255,4 + + db "DREAMWEB.R05",0 + if demo + db 22,255,22,30 + else + db 5,255,22,30 + endif + db 255,255,255,0 + db 1,2,0,4,255,255,3,255,255,255,5 + + db "DREAMWEB.R06",0 + db 5,255,11,30 + db 255,255,255,0 + db 1,0,0,1,2,255,0,255,255,255,6 + + db "DREAMWEB.R07",0 + db 255,255,0,20 + db 255,255,255,0 + db 2,2,255,255,255,255,0,255,255,255,7 + + db "DREAMWEB.R08",0 + db 8,255,0,10 + db 255,255,255,0 + db 1,2,255,255,255,255,0,11,40,0,8 + + db "DREAMWEB.R09",0 + db 9,255,22,10 + db 255,255,255,0 + db 4,6,255,255,255,255,0,255,255,255,9 + + db "DREAMWEB.R10",0 + db 10,255,33,30 + db 255,255,255,0 + db 2,0,255,255,2,2,4,22,30,255,10 ;22,30,0 switches + ;off path 0 in skip + db "DREAMWEB.R11",0 + db 11,255,11,20 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R12",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R13",0 + db 12,255,22,20 + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,13 + + db "DREAMWEB.R14",0 + db 14,255,44,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,14 + + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + db 32 dup (0) + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R20",0 + db 22,255,0,20 + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,20 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R22",0 + db 22,255,22,10 + db 255,255,255,0 + db 0,4,255,255,1,255,255,255,255,255,22 + + db "DREAMWEB.R23",0 + db 23,255,22,30 + db 255,255,255,0 + db 1,4,2,15,3,255,255,255,255,255,23 + + db "DREAMWEB.R24",0 + db 5,255,44,0 + db 255,255,255,0 + db 1,6,2,15,255,255,255,255,255,255,24 + + db "DREAMWEB.R25",0 + db 22,255,11,40 + db 255,255,255,0 + db 1,0,255,255,255,255,255,255,255,255,25 + + db "DREAMWEB.R26",0 + db 9,255,22,20 + db 255,255,255,0 + db 4,2,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R27",0 + db 22,255,11,20 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,27 + + db "DREAMWEB.R28",0 + db 5,255,11,30 + db 255,255,255,0 + db 0,0,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R29",0 + db 22,255,11,10 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,29 + + + + db "DREAMWEB.R05",0 ;Duplicate of hotel lobby, + if demo + db 22,255,22,10 ;but emerging from the lift. + else + db 5,255,22,10 + endif + db 255,255,255,0 + db 1,4,1,15,255,255,255,255,255,255,5 + + db "DREAMWEB.R04",0 ;Duplicate of pool hall lobby, + db 23,255,22,20 ;but emerging from the lift. + db 255,255,255,0 + db 1,4,2,15,255,255,255,255,255,255,4 + + db "DREAMWEB.R10",0 ;entering alley via skip + db 10,255,22,30 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,10 + + db "DREAMWEB.R12",0 ;on the beach, getting up. + db 12,255,22,20 + db 255,255,255,0 + db 0,2,255,255,255,255,255,255,255,255,12 + + db "DREAMWEB.R03",0 ;Duplicate of Eden's lobby + db 5,255,44,0 ;but emerging from the lift + db 255,255,255,0 + db 1,6,2,255,4,255,255,255,255,255,3 + + db "DREAMWEB.R24",0 ;Duplicate of Eden's flat + db 5,255,22,0 ;but starting on the bed + db 255,255,255,0 + db 3,6,0,255,255,255,255,33,0,3,24 ; 33,0,3 turns off + ; path for lift + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 + db 1,4,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R22",0 ;Duplicate + db 22,255,22,20 ;of hotel but in pool room + db 255,255,255,0 ;coming out of bedroom + db 0,2,255,255,255,255,255,255,255,255,22 + + db "DREAMWEB.R11",0 ;Duplicate + db 11,255,22,30 ;of carpark but getting + db 255,255,255,0 ;up off the floor + db 0,0,255,255,255,255,255,255,255,255,11 + + db "DREAMWEB.R28",0 + db 5,255,11,20 + db 255,255,255,0 + db 0,6,255,255,2,255,255,255,255,255,28 + + db "DREAMWEB.R21",0 + if demo + db 22,255,11,10 + else + db 5,255,11,10 + endif + db 255,255,255,0 + db 1,4,2,15,1,255,255,255,255,255,21 + + db "DREAMWEB.R26",0 + db 9,255,0,40 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,26 + + db "DREAMWEB.R19",0 + db 19,255,0,0 + db 255,255,255,0 + db 2,2,255,255,255,255,255,255,255,255,19 + + db "DREAMWEB.R08",0 ;leaving tvstudio into street + db 8,255,11,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,8 + + db "DREAMWEB.R01",0 + db 1,255,44,10 + db 255,255,255,0 + db 3,6,255,255,255,255,255,255,255,255,1 + + + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 0,6,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,40 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + db "DREAMWEB.R47",0 ;Dream room + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,47 + + db "DREAMWEB.R45",0 ;Dream room + db 35,255,22,30 + db 255,255,255,0 + db 4,0,255,255,255,255,255,255,255,255,45 + + db "DREAMWEB.R46",0 ;Dream room + db 35,255,22,50 + db 255,255,255,0 + db 0,4,255,255,255,255,255,255,255,255,46 + + + + db "DREAMWEB.R50",0 ; Intro sequence one + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,50 + + db "DREAMWEB.R51",0 ; Intro sequence two + db 35,255,11,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,51 + + db "DREAMWEB.R52",0 ; Intro sequence three + db 35,255,22,30 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,52 + + db "DREAMWEB.R53",0 ; Intro sequence four + db 35,255,33,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,53 + + db "DREAMWEB.R54",0 ; Intro sequence five - wasteland + db 35,255,0,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,54 + + db "DREAMWEB.R55",0 ; End sequence + db 14,255,44,0 + db 255,255,255,0 + db 0,0,255,255,255,255,255,255,255,255,55 + + +Madeuproomdat db 32 dup (0) + +Roomscango db 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0 + +Roompics db 5,0,3,2,4,1,10,9,8,6,11,4,7,7,0 + +Oplist db 3 dup (0) + +Inputline db 128 dup (0) + +linedata dw 200 dup (0ffffh) + +presslist db 6 dup (255) + +savenames db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + + + +savefiles db "DREAMWEB.D00",0 + db "DREAMWEB.D01",0 + db "DREAMWEB.D02",0 + db "DREAMWEB.D03",0 + db "DREAMWEB.D04",0 + db "DREAMWEB.D05",0 + db "DREAMWEB.D06",0 + +Recname db "DREAMWEB.DEM",0 + + +;-------------------------------------------------------End of code segment---- + +DREAMWEBPROG ends + + + + +;---------------------------------------------------------------Stack space----s + +STACKSPACE segment para stack 'STACK' + +stak db 256 dup (?) + +STACKSPACE ends + + + +;-----------------------------------------------------------End of all code---- + + end Dreamweb + + + + + + + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm index 9ddce697f2..d75a4fde82 100644 --- a/devtools/tasmrecover/dreamweb/keypad.asm +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -1,1758 +1,1758 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Entercode proc near - - mov keypadax,ax - mov keypadcx,cx - call getridofreels - call loadkeypad - call createpanel - call showicon - call showouterpad - call showkeypad - call readmouse - call showpointer - call worktoscreen - call delpointer - mov presspointer,0 - mov getback,0 - -keypadloop: call delpointer - call readmouse - call showkeypad - call showpointer - cmp presscount,0 - jz nopresses - dec presscount - jmp afterpress -nopresses: mov pressed,255 - mov graphicpress,255 - call vsync - -afterpress: call dumppointer - call dumpkeypad - call dumptextline - mov bx,offset cs:keypadlist - call checkcoords - cmp getback,1 - jz numberright - - cmp lightcount,1 - jnz notendkey - cmp lockstatus,0 - jz numberright - jmp keypadloop - -notendkey: cmp presscount,40 - jnz keypadloop - call addtopresslist - cmp pressed,11 - jnz keypadloop - mov ax,keypadax - mov cx,keypadcx - call isitright - jnz incorrect - mov lockstatus,0 - mov al,11 - call playchannel1 - mov lightcount,120 - mov presspointer,0 - jmp keypadloop -incorrect: mov al,11 - call playchannel1 - mov lightcount,120 - mov presspointer,0 - jmp keypadloop - -numberright: mov manisoffscreen,0 - call getridoftemp - call restorereels - call redrawmainscrn - call worktoscreenm - ret - -keypadlist: dw keypadx+9,keypadx+30,keypady+9,keypady+22,buttonone - dw keypadx+31,keypadx+52,keypady+9,keypady+22,buttontwo - dw keypadx+53,keypadx+74,keypady+9,keypady+22,buttonthree - dw keypadx+9,keypadx+30,keypady+23,keypady+40,buttonfour - dw keypadx+31,keypadx+52,keypady+23,keypady+40,buttonfive - dw keypadx+53,keypadx+74,keypady+23,keypady+40,buttonsix - dw keypadx+9,keypadx+30,keypady+41,keypady+58,buttonseven - dw keypadx+31,keypadx+52,keypady+41,keypady+58,buttoneight - dw keypadx+53,keypadx+74,keypady+41,keypady+58,buttonnine - dw keypadx+9,keypadx+30,keypady+59,keypady+73,buttonnought - dw keypadx+31,keypadx+74,keypady+59,keypady+73,buttonenter - dw keypadx+72,keypadx+86,keypady+80,keypady+94,quitkey - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - - -Loadkeypad proc near - - mov dx,offset cs:extragraphics1 - call loadintotemp - ret - - endp - - - - -Quitkey proc near - - cmp commandtype,222 - jz alreadyqk - mov commandtype,222 - mov al,4 - call commandonly -alreadyqk: mov ax,mousebutton - cmp ax,oldbutton - jz notqk - and ax,1 - jnz doqk -notqk: ret - -doqk: mov getback,1 - ret - - endp - - - - - - - - - - - - - - - - - - -Addtopresslist proc near - - cmp presspointer,5 - jz nomorekeys - mov al,pressed - cmp al,10 - jnz not10 - mov al,0 -not10: mov bx,presspointer - mov dx,seg presslist - mov es,dx - add bx,offset es:presslist - mov [es:bx],al - inc presspointer -nomorekeys: ret - - endp - - - - -Buttonone proc near - - mov cl,1 - call buttonpress - ret - - endp - - -Buttontwo proc near - - mov cl,2 - call buttonpress - ret - - endp - - - -Buttonthree proc near - - mov cl,3 - call buttonpress - ret - - endp - - - -Buttonfour proc near - - mov cl,4 - call buttonpress - ret - - endp - - -Buttonfive proc near - - mov cl,5 - call buttonpress - ret - - endp - - - -Buttonsix proc near - - mov cl,6 - call buttonpress - ret - - endp - - -Buttonseven proc near - - mov cl,7 - call buttonpress - ret - - endp - - -Buttoneight proc near - - mov cl,8 - call buttonpress - ret - - endp - -Buttonnine proc near - - mov cl,9 - call buttonpress - ret - - endp - - - -Buttonnought proc near - - mov cl,10 - call buttonpress - ret - - endp - - - - - - -Buttonenter proc near - - mov cl,11 - call buttonpress - ret - - endp - - - -Buttonpress proc near - - mov ch,cl - add ch,100 - cmp commandtype,ch - jz alreadyb - mov commandtype,ch - mov al,cl - add al,4 - push cx - call commandonly - pop cx -alreadyb: mov ax,mousebutton - cmp ax,oldbutton - jz notb - and ax,1 - jnz dob -notb: ret - -dob: mov pressed,cl - add cl,21 - mov graphicpress,cl - mov presscount,40 - cmp cl,32 - jz nonoise - mov al,10 - call playchannel1 -nonoise: ret - - endp - - - - - - - - - - - - - - -Showouterpad proc near - - mov di,keypadx-3 - mov bx,keypady-4 - mov ds,tempgraphics - mov al,1 - mov ah,0 - call showframe - mov di,keypadx+74 - mov bx,keypady+76 - mov ds,tempgraphics - mov al,37 - mov ah,0 - call showframe - ret - - endp - - - - - - - - - - -Showkeypad proc near - - mov al,22 - mov di,keypadx+9 - mov bx,keypady+5 - call singlekey - mov al,23 - mov di,keypadx+31 - mov bx,keypady+5 - call singlekey - mov al,24 - mov di,keypadx+53 - mov bx,keypady+5 - call singlekey - - mov al,25 - mov di,keypadx+9 - mov bx,keypady+23 - call singlekey - mov al,26 - mov di,keypadx+31 - mov bx,keypady+23 - call singlekey - mov al,27 - mov di,keypadx+53 - mov bx,keypady+23 - call singlekey - - mov al,28 - mov di,keypadx+9 - mov bx,keypady+41 - call singlekey - mov al,29 - mov di,keypadx+31 - mov bx,keypady+41 - call singlekey - mov al,30 - mov di,keypadx+53 - mov bx,keypady+41 - call singlekey - - mov al,31 - mov di,keypadx+9 - mov bx,keypady+59 - call singlekey - mov al,32 - mov di,keypadx+31 - mov bx,keypady+59 - call singlekey - - cmp lightcount,0 - jz notenter - dec lightcount - mov al,36 - mov bx,keypady-1+63 - cmp lockstatus,0 - jnz changelight - mov al,41 - mov bx,keypady+4+63 -changelight: cmp lightcount,60 - jc gotlight - cmp lightcount,100 - jnc gotlight - dec al -gotlight: mov ds,tempgraphics - mov ah,0 - mov di,keypadx+60 - call showframe - -notenter: ret - - endp - - - - - -Singlekey proc near - - cmp graphicpress,al - jnz gotkey - add al,11 - cmp presscount,8 - jnc gotkey - sub al,11 -; cmp presscount,10 -; jnc gotkey -; sub al,11 -gotkey: mov ds,tempgraphics - sub al,20 - mov ah,0 - call showframe - ret - - endp - - - - - - - - - -Dumpkeypad proc near - - mov di,keypadx-3 - mov bx,keypady-4 - mov cl,120 - mov ch,90 - call multidump - ret - - endp - - - - - -;--------------------------------- - - - - -Usemenu proc near - - call getridofreels - call loadmenu - call createpanel - call showpanel - call showicon - mov newobs,0 - call drawfloor - call printsprites - - mov al,4 - mov ah,0 - mov di,menux-48 - mov bx,menuy-4 - mov ds,tempgraphics2 - call showframe - call getundermenu - mov al,5 - mov ah,0 - mov di,menux+54 - mov bx,menuy+72 - mov ds,tempgraphics2 - call showframe - - - call worktoscreenm - mov getback,0 - -menuloop: call delpointer - call putundermenu - call showmenu - call readmouse - call showpointer - call vsync - call dumppointer - call dumpmenu - call dumptextline - mov bx,offset cs:menulist - call checkcoords - cmp getback,1 - jnz menuloop - - mov manisoffscreen,0 - call redrawmainscrn - call getridoftemp - call getridoftemp2 - call restorereels - call worktoscreenm - ret - -menulist: dw menux+54,menux+68,menuy+72,menuy+88,quitkey - dw 0,320,0,200,blank - dw 0ffffh - - ret - - endp - - - - - - - -Dumpmenu proc near - - mov di,menux - mov bx,menuy - mov cl,48 - mov ch,48 - call multidump - ret - - endp - - - - - - -Getundermenu proc near - - mov di,menux - mov bx,menuy - mov cl,48 - mov ch,48 - mov ds,buffers - mov si,undertimedtext - call multiget - ret - - endp - - - - - - - - -Putundermenu proc near - - mov di,menux - mov bx,menuy - mov cl,48 - mov ch,48 - mov ds,buffers - mov si,undertimedtext - call multiput - ret - - endp - - - -Showoutermenu proc near - - mov al,40 - mov ah,0 - mov di,menux-34 - mov bx,menuy-40 - mov ds,tempgraphics - call showframe - mov al,41 - mov ah,0 - mov di,menux+64-34 - mov bx,menuy-40 - mov ds,tempgraphics - call showframe - mov al,42 - mov ah,0 - mov di,menux-26 - mov bx,menuy+57-40 - mov ds,tempgraphics - call showframe - mov al,43 - mov ah,0 - mov di,menux+64-26 - mov bx,menuy+57-40 - mov ds,tempgraphics - call showframe - ret - - endp - - - - - - - - -Showmenu proc near - - inc menucount - cmp menucount,37*2 - jnz menuframeok - mov menucount,0 -menuframeok: mov al,menucount - shr al,1 - mov ah,0 - mov di,menux - mov bx,menuy - mov ds,tempgraphics - call showframe - ret - - endp - - - -Loadmenu proc near - - mov dx,offset cs:spritename3 - call loadintotemp - mov dx,offset cs:mongraphics2 - call loadintotemp2 - ret - - endp - - - - - - - - - - - - - - - - -Viewfolder proc near - - mov manisoffscreen,1 - call getridofall - call loadfolder - mov folderpage,0 - call showfolder - call worktoscreenm - mov getback,0 - -folderloop: call delpointer - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - mov bx,offset cs:folderlist - call checkcoords - cmp getback,0 - jz folderloop - - mov manisoffscreen,0 - call getridoftemp - call getridoftemp2 - call getridoftemp3 - call getridoftempcharset - call restoreall - call redrawmainscrn - call worktoscreenm - ret - -folderlist: dw 280,320,160,200,quitkey - dw 143,300,6,194,nextfolder - dw 0,143,6,194,lastfolder - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - -Nextfolder proc near - - cmp folderpage,12 - jnz cannextf - call blank - ret -cannextf: cmp commandtype,201 - jz alreadynextf - mov commandtype,201 - mov al,16 - call commandonly -alreadynextf: mov ax,mousebutton - cmp ax,oldbutton - jz notnextf - cmp ax,1 - jz donextf -notnextf: ret -donextf: inc folderpage - call folderhints - call delpointer - call showfolder - mov mousebutton,0 - mov bx,offset cs:folderlist - call checkcoords - call worktoscreenm - ret - - endp - - - - -Folderhints proc near - - cmp folderpage,5 - jnz notaideadd - cmp aidedead,1 - jz notaideadd - mov al,13 - call getlocation - cmp al,1 - jz notaideadd - mov al,13 - call setlocation - call showfolder - mov al,30 - call findtext1 - mov di,0 - mov bx,86 - mov dl,141 - mov ah,16 - call printdirect - call worktoscreenm - mov cx,200 - call hangonp - ret - -notaideadd: cmp folderpage,9 - jnz notaristoadd - mov al,7 - call getlocation - cmp al,1 - jz notaristoadd - mov al,7 - call setlocation - call showfolder - mov al,31 - call findtext1 - mov di,0 - mov bx,86 - mov dl,141 - mov ah,16 - call printdirect - call worktoscreenm - mov cx,200 - call hangonp -notaristoadd: ret - - endp - - - -Lastfolder proc near - - cmp folderpage,0 - jnz canlastf - call blank - ret -canlastf: cmp commandtype,202 - jz alreadylastf - mov commandtype,202 - mov al,17 - call commandonly -alreadylastf: cmp folderpage,0 - jz notlastf - mov ax,mousebutton - cmp ax,oldbutton - jz notlastf - cmp ax,1 - jz dolastf -notlastf: ret -dolastf: dec folderpage - call delpointer - call showfolder - mov mousebutton,0 - mov bx,offset cs:folderlist - call checkcoords - call worktoscreenm - ret - - endp - - - -Loadfolder proc near - - mov dx,offset cs:foldergraphic1 - call loadintotemp - mov dx,offset cs:foldergraphic2 - call loadintotemp2 - mov dx,offset cs:foldergraphic3 - call loadintotemp3 - mov dx,offset cs:characterset3 - call loadtempcharset - mov dx,offset cs:foldertext - call loadtemptext - ret - - endp - - - - -Showfolder proc near - - mov commandtype,255 - cmp folderpage,0 - jz closedfolder - call usetempcharset - call createpanel2 - mov ds,tempgraphics - mov di,0 - mov bx,0 - mov al,0 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,143 - mov bx,0 - mov al,1 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,0 - mov bx,92 - mov al,2 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,143 - mov bx,92 - mov al,3 - mov ah,0 - call showframe - call folderexit - - cmp folderpage,1 - jz noleftpage - call showleftpage -noleftpage: cmp folderpage,12 - jz norightpage - call showrightpage -norightpage: call usecharset1 - call undertextline - ret - -closedfolder: call createpanel2 - mov ds,tempgraphics3 - mov di,143-28 - mov bx,0 - mov al,0 - mov ah,0 - call showframe - mov ds,tempgraphics3 - mov di,143-28 - mov bx,92 - mov al,1 - mov ah,0 - call showframe - call folderexit - call undertextline - ret - - endp - - - - - - - - -Folderexit proc near - - mov ds,tempgraphics2 - mov di,296 - mov bx,178 - mov al,6 - mov ah,0 - call showframe - ret - - endp - - - - - -Showleftpage proc near - - mov ds,tempgraphics2 - mov di,0 - mov bx,12 - mov al,3 - mov ah,0 - call showframe - - mov bx,12+5 - mov cx,9 -leftpageloop: push cx bx - mov ds,tempgraphics2 - mov di,0 - mov al,4 - mov ah,0 - call showframe - pop bx cx - add bx,16 - loop leftpageloop - - mov ds,tempgraphics2 - mov di,0 - mov al,5 - mov ah,0 - call showframe - - mov linespacing,8 - mov charshift,91 - mov kerning,1 - mov bl,folderpage - dec bl - dec bl - add bl,bl - mov bh,0 - add bx,bx - mov es,textfile1 - mov si,[es:bx] - add si,66*2 - mov di,2 - mov bx,48 - mov dl,140 - mov cx,2 -twolotsleft: push cx -contleftpage: call printdirect - add bx,linespacing - cmp al,0 - jnz contleftpage - pop cx - loop twolotsleft - - mov kerning,0 - mov charshift,0 - mov linespacing,10 - - mov es,workspace - mov ds,workspace - mov di,(48*320)+2 - mov si,(48*320)+2+130 - mov cx,120 -flipfolder: push cx di si - mov cx,65 -flipfolderline: mov al,[es:di] - mov ah,[es:si] - mov [es:di],ah - mov [es:si],al - dec si - inc di - loop flipfolderline - pop si di cx - add si,320 - add di,320 - loop flipfolder - ret - - endp - - - -Showrightpage proc near - - mov ds,tempgraphics2 - mov di,143 - mov bx,12 - mov al,0 - mov ah,0 - call showframe - - mov bx,12+37 - mov cx,7 -rightpageloop: push cx bx - mov ds,tempgraphics2 - mov di,143 - mov al,1 - mov ah,0 - call showframe - pop bx cx - add bx,16 - loop rightpageloop - - mov ds,tempgraphics2 - mov di,143 - mov al,2 - mov ah,0 - call showframe - - mov linespacing,8 - mov kerning,1 - mov bl,folderpage - dec bl - add bl,bl - mov bh,0 - add bx,bx - mov es,textfile1 - mov si,[es:bx] - add si,66*2 - mov di,152 - mov bx,48 - mov dl,140 - mov cx,2 -twolotsright: push cx -contrightpage: call printdirect - add bx,linespacing - cmp al,0 - jnz contrightpage - pop cx - loop twolotsright - - mov kerning,0 - mov linespacing,10 - ret - - endp - - - - - - - - - -Entersymbol proc near - - mov manisoffscreen,1 - call getridofreels - mov dx,offset cs:symbolgraphic - call loadintotemp - mov symboltopx,24 - mov symboltopdir,0 - mov symbolbotx,24 - mov symbolbotdir,0 - call redrawmainscrn - call showsymbol - call undertextline - call worktoscreenm - mov getback,0 - -symbolloop: call delpointer - call updatesymboltop - call updatesymbolbot - call showsymbol - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - call dumpsymbol - mov bx,offset cs:symbollist - call checkcoords - cmp getback,0 - jz symbolloop - - cmp symbolbotnum,3 - jnz symbolwrong - cmp symboltopnum,5 - jnz symbolwrong - mov al,43 - call removesetobject - mov al,46 - call placesetobject - mov ah,roomnum - add ah,12 - mov al,0 - call turnanypathon - mov manisoffscreen,0 - call redrawmainscrn - call getridoftemp - call restorereels - call worktoscreenm - mov al,13 - call playchannel1 - ret - -symbolwrong: mov al,46 - call removesetobject - mov al,43 - call placesetobject - mov ah,roomnum - add ah,12 - mov al,0 - call turnanypathoff - mov manisoffscreen,0 - call redrawmainscrn - call getridoftemp - call restorereels - call worktoscreenm - ret - -symbollist: dw symbolx+40,symbolx+64,symboly+2,symboly+16,quitsymbol - dw symbolx,symbolx+52,symboly+20,symboly+50,settopleft - dw symbolx+52,symbolx+104,symboly+20,symboly+50,settopright - dw symbolx,symbolx+52,symboly+50,symboly+80,setbotleft - dw symbolx+52,symbolx+104,symboly+50,symboly+80,setbotright - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - - - - - - - - - - -Quitsymbol proc near - - cmp symboltopx,24 - jnz blank - cmp symbolbotx,24 - jnz blank - cmp commandtype,222 - jz alreadyqs - mov commandtype,222 - mov al,18 - call commandonly -alreadyqs: mov ax,mousebutton - cmp ax,oldbutton - jz notqs - and ax,1 - jnz doqs -notqs: ret - -doqs: mov getback,1 - ret - - endp - - - - -Settopleft proc near - - cmp symboltopdir,0 - jnz blank - cmp commandtype,210 - jz alreadytopl - mov commandtype,210 - mov al,19 - call commandonly -alreadytopl: cmp mousebutton,0 - jz notopleft - mov symboltopdir,-1 -notopleft: ret - - endp - - - -Settopright proc near - - cmp symboltopdir,0 - jnz blank - cmp commandtype,211 - jz alreadytopr - mov commandtype,211 - mov al,20 - call commandonly -alreadytopr: cmp mousebutton,0 - jz notopright - mov symboltopdir,1 -notopright: ret - - endp - - - - -Setbotleft proc near - - cmp symbolbotdir,0 - jnz blank - cmp commandtype,212 - jz alreadybotl - mov commandtype,212 - mov al,21 - call commandonly -alreadybotl: cmp mousebutton,0 - jz nobotleft - mov symbolbotdir,-1 -nobotleft: ret - - endp - - - -Setbotright proc near - - cmp symbolbotdir,0 - jnz blank - cmp commandtype,213 - jz alreadybotr - mov commandtype,213 - mov al,22 - call commandonly -alreadybotr: cmp mousebutton,0 - jz nobotright - mov symbolbotdir,1 -nobotright: ret - - endp - - - - - - - -Dumpsymbol proc near - - mov newtextline,0 - mov di,symbolx - mov bx,symboly+20 - mov cl,104 - mov ch,60 - call multidump - ret - - endp - - - - -Showsymbol proc near - - mov al,12 - mov ah,0 - mov di,symbolx - mov bx,symboly - mov ds,tempgraphics - call showframe - - mov al,symboltopx - mov ah,0 - mov di,ax - add di,symbolx-44 - mov al,symboltopnum - mov bx,symboly+20 - mov ds,tempgraphics - mov ah,32 - push ax di bx ds - call showframe - pop ds bx di ax - call nextsymbol - add di,49 - push ax di bx ds - call showframe - pop ds bx di ax - call nextsymbol - add di,49 - call showframe - - mov al,symbolbotx - mov ah,0 - mov di,ax - add di,symbolx-44 - mov al,symbolbotnum - add al,6 - mov bx,symboly+49 - mov ds,tempgraphics - mov ah,32 - push ax di bx ds - call showframe - pop ds bx di ax - call nextsymbol - add di,49 - push ax di bx ds - call showframe - pop ds bx di ax - call nextsymbol - add di,49 - call showframe - ret - - endp - - - - - - -Nextsymbol proc near - - inc al - cmp al,6 - jz topwrap - cmp al,12 - jz botwrap - ret -topwrap: mov al,0 - ret -botwrap: mov al,6 - ret - - endp - - - -Updatesymboltop proc near - - cmp symboltopdir,0 - jz topfinished - cmp symboltopdir,-1 - jz backwards - - inc symboltopx - cmp symboltopx,49 - jnz notwrapfor - mov symboltopx,0 - dec symboltopnum - cmp symboltopnum,-1 - jnz topfinished - mov symboltopnum,5 - ret -notwrapfor: cmp symboltopx,24 - jnz topfinished - mov symboltopdir,0 - ret - -backwards: dec symboltopx - cmp symboltopx,-1 - jnz notwrapback - mov symboltopx,48 - inc symboltopnum - cmp symboltopnum,6 - jnz topfinished - mov symboltopnum,0 - ret -notwrapback: cmp symboltopx,24 - jnz topfinished - mov symboltopdir,0 -topfinished: ret - - endp - - - -Updatesymbolbot proc near - - cmp symbolbotdir,0 - jz botfinished - cmp symbolbotdir,-1 - jz backwardsbot - - inc symbolbotx - cmp symbolbotx,49 - jnz notwrapforb - mov symbolbotx,0 - dec symbolbotnum - cmp symbolbotnum,-1 - jnz botfinished - mov symbolbotnum,5 - ret -notwrapforb: cmp symbolbotx,24 - jnz botfinished - mov symbolbotdir,0 - ret - -backwardsbot: dec symbolbotx - cmp symbolbotx,-1 - jnz notwrapbackb - mov symbolbotx,48 - inc symbolbotnum - cmp symbolbotnum,6 - jnz botfinished - mov symbolbotnum,0 - ret -notwrapbackb: cmp symbolbotx,24 - jnz botfinished - mov symbolbotdir,0 -botfinished: ret - - endp - - - - - - - - - - -Dumpsymbox proc near - - cmp dumpx,-1 - jz nodumpsym - mov di,dumpx - mov bx,dumpy - mov cl,30 - mov ch,77;30 - call multidump - mov dumpx,-1 -nodumpsym: ret - - endp - - - - - - - -Usediary proc near - - call getridofreels - mov dx,offset cs:diarygraphic - call loadintotemp - mov dx,offset cs:diarytext - call loadtemptext - - mov dx,offset cs:characterset3 - call loadtempcharset - call createpanel - call showicon - call showdiary - call undertextline - call showdiarypage - call readmouse - call showpointer - call worktoscreen - call delpointer - mov getback,0 - -diaryloop: call delpointer - call readmouse - call showdiarykeys - call showpointer - call vsync - call dumppointer - call dumpdiarykeys - call dumptextline - mov bx,offset cs:diarylist - call checkcoords - cmp getback,0 - jz diaryloop - - call getridoftemp - call getridoftemptext - call getridoftempcharset - call restorereels - mov manisoffscreen,0 - call redrawmainscrn - call worktoscreenm - ret - -diarylist: dw diaryx+94,diaryx+110,diaryy+97,diaryy+113,diarykeyn - dw diaryx+151,diaryx+167,diaryy+71,diaryy+87,diarykeyp - dw diaryx+176,diaryx+192,diaryy+108,diaryy+124,quitkey - dw 0,320,0,200,blank - dw 0ffffh - - ret - - endp - - - - - - - -Showdiary proc near - - mov al,1 - mov ah,0 - mov di,diaryx - mov bx,diaryy+37 - mov ds,tempgraphics - call showframe - mov al,2 - mov ah,0 - mov di,diaryx+176 - mov bx,diaryy+108 - mov ds,tempgraphics - call showframe - ret - - endp - - - - -Showdiarykeys proc near - - cmp presscount,0 - jz nokeyatall - dec presscount - cmp presscount,0 - jz nokeyatall - cmp pressed,"N" - jnz nokeyn - mov al,3 - cmp presscount,1 - jz gotkeyn - mov al,4 -gotkeyn: mov ah,0 - mov di,diaryx+94 - mov bx,diaryy+97 - mov ds,tempgraphics - call showframe - cmp presscount,1 - jnz notshown - call showdiarypage -notshown: ret - -nokeyn: mov al,5 - cmp presscount,1 - jz gotkeyp - mov al,6 -gotkeyp: mov ah,0 - mov di,diaryx+151 - mov bx,diaryy+71 - mov ds,tempgraphics - call showframe - cmp presscount,1 - jnz notshowp - call showdiarypage -notshowp: ret - -nokeyatall: ret - - endp - - - - - - -Dumpdiarykeys proc near - - cmp presscount,1 - jnz notdumpdiary - cmp sartaindead,1 - jz notsartadd - cmp diarypage,5 - jnz notsartadd - cmp diarypage,5 - jnz notsartadd - mov al,6 - call getlocation - cmp al,1 - jz notsartadd - mov al,6 - call setlocation - - call delpointer - mov al,12 - call findtext1 - mov di,70 ;diaryx+48 - mov bx,106 ;diaryy+16 - mov dl,241 - mov ah,16 - call printdirect - - call worktoscreenm - mov cx,200 - call hangonp - call createpanel - call showicon - call showdiary - call showdiarypage - call worktoscreenm - call showpointer - ret - -notsartadd: mov di,diaryx+48 - mov bx,diaryy+15 - mov cl,200 - mov ch,16 - call multidump -notdumpdiary: mov di,diaryx+94 - mov bx,diaryy+97 - mov cl,16 - mov ch,16 - call multidump - mov di,diaryx+151 - mov bx,diaryy+71 - mov cl,16 - mov ch,16 - call multidump - ret - - endp - - - -Diarykeyp proc near - - cmp commandtype,214 - jz alreadykeyp - mov commandtype,214 - mov al,23 - call commandonly -alreadykeyp: cmp mousebutton,0 - jz notkeyp - mov ax,oldbutton - cmp ax,mousebutton - jz notkeyp - cmp presscount,0 - jnz notkeyp - mov al,16 - call playchannel1 - mov presscount,12 - mov pressed,"P" - dec diarypage - cmp diarypage,-1 - jnz notkeyp - mov diarypage,11 -notkeyp: ret - - endp - - - -Diarykeyn proc near - - cmp commandtype,213 - jz alreadykeyn - mov commandtype,213 - mov al,23 - call commandonly -alreadykeyn: cmp mousebutton,0 - jz notkeyn - mov ax,oldbutton - cmp ax,mousebutton - jz notkeyn - cmp presscount,0 - jnz notkeyn - mov al,16 - call playchannel1 - mov presscount,12 - mov pressed,"N" - inc diarypage - cmp diarypage,12 - jnz notkeyn - mov diarypage,0 -notkeyn: ret - - endp - - - - - - -Showdiarypage proc near - - mov al,0 - mov ah,0 - mov di,diaryx - mov bx,diaryy - mov ds,tempgraphics - call showframe - - mov al,diarypage - call findtext1 - - mov kerning,1 - call usetempcharset - mov di,diaryx+48 - mov bx,diaryy+16 - mov dl,240 - mov ah,16 - mov charshift,91+91 - call printdirect - - mov di,diaryx+129 - mov bx,diaryy+16 - mov dl,240 - mov ah,16 - call printdirect - - mov di,diaryx+48 - mov bx,diaryy+23 - mov dl,240 - mov ah,16 - call printdirect - - mov kerning,0 - mov charshift,0 - call usecharset1 - ret - - endp - - - - - -Findtext1 proc near - - mov ah,0 - mov si,ax - add si,si - mov es,textfile1 - mov ax,[es:si] - add ax,textstart - mov si,ax - ret - - endp - +Entercode proc near + + mov keypadax,ax + mov keypadcx,cx + call getridofreels + call loadkeypad + call createpanel + call showicon + call showouterpad + call showkeypad + call readmouse + call showpointer + call worktoscreen + call delpointer + mov presspointer,0 + mov getback,0 + +keypadloop: call delpointer + call readmouse + call showkeypad + call showpointer + cmp presscount,0 + jz nopresses + dec presscount + jmp afterpress +nopresses: mov pressed,255 + mov graphicpress,255 + call vsync + +afterpress: call dumppointer + call dumpkeypad + call dumptextline + mov bx,offset cs:keypadlist + call checkcoords + cmp getback,1 + jz numberright + + cmp lightcount,1 + jnz notendkey + cmp lockstatus,0 + jz numberright + jmp keypadloop + +notendkey: cmp presscount,40 + jnz keypadloop + call addtopresslist + cmp pressed,11 + jnz keypadloop + mov ax,keypadax + mov cx,keypadcx + call isitright + jnz incorrect + mov lockstatus,0 + mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop +incorrect: mov al,11 + call playchannel1 + mov lightcount,120 + mov presspointer,0 + jmp keypadloop + +numberright: mov manisoffscreen,0 + call getridoftemp + call restorereels + call redrawmainscrn + call worktoscreenm + ret + +keypadlist: dw keypadx+9,keypadx+30,keypady+9,keypady+22,buttonone + dw keypadx+31,keypadx+52,keypady+9,keypady+22,buttontwo + dw keypadx+53,keypadx+74,keypady+9,keypady+22,buttonthree + dw keypadx+9,keypadx+30,keypady+23,keypady+40,buttonfour + dw keypadx+31,keypadx+52,keypady+23,keypady+40,buttonfive + dw keypadx+53,keypadx+74,keypady+23,keypady+40,buttonsix + dw keypadx+9,keypadx+30,keypady+41,keypady+58,buttonseven + dw keypadx+31,keypadx+52,keypady+41,keypady+58,buttoneight + dw keypadx+53,keypadx+74,keypady+41,keypady+58,buttonnine + dw keypadx+9,keypadx+30,keypady+59,keypady+73,buttonnought + dw keypadx+31,keypadx+74,keypady+59,keypady+73,buttonenter + dw keypadx+72,keypadx+86,keypady+80,keypady+94,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Loadkeypad proc near + + mov dx,offset cs:extragraphics1 + call loadintotemp + ret + + endp + + + + +Quitkey proc near + + cmp commandtype,222 + jz alreadyqk + mov commandtype,222 + mov al,4 + call commandonly +alreadyqk: mov ax,mousebutton + cmp ax,oldbutton + jz notqk + and ax,1 + jnz doqk +notqk: ret + +doqk: mov getback,1 + ret + + endp + + + + + + + + + + + + + + + + + + +Addtopresslist proc near + + cmp presspointer,5 + jz nomorekeys + mov al,pressed + cmp al,10 + jnz not10 + mov al,0 +not10: mov bx,presspointer + mov dx,seg presslist + mov es,dx + add bx,offset es:presslist + mov [es:bx],al + inc presspointer +nomorekeys: ret + + endp + + + + +Buttonone proc near + + mov cl,1 + call buttonpress + ret + + endp + + +Buttontwo proc near + + mov cl,2 + call buttonpress + ret + + endp + + + +Buttonthree proc near + + mov cl,3 + call buttonpress + ret + + endp + + + +Buttonfour proc near + + mov cl,4 + call buttonpress + ret + + endp + + +Buttonfive proc near + + mov cl,5 + call buttonpress + ret + + endp + + + +Buttonsix proc near + + mov cl,6 + call buttonpress + ret + + endp + + +Buttonseven proc near + + mov cl,7 + call buttonpress + ret + + endp + + +Buttoneight proc near + + mov cl,8 + call buttonpress + ret + + endp + +Buttonnine proc near + + mov cl,9 + call buttonpress + ret + + endp + + + +Buttonnought proc near + + mov cl,10 + call buttonpress + ret + + endp + + + + + + +Buttonenter proc near + + mov cl,11 + call buttonpress + ret + + endp + + + +Buttonpress proc near + + mov ch,cl + add ch,100 + cmp commandtype,ch + jz alreadyb + mov commandtype,ch + mov al,cl + add al,4 + push cx + call commandonly + pop cx +alreadyb: mov ax,mousebutton + cmp ax,oldbutton + jz notb + and ax,1 + jnz dob +notb: ret + +dob: mov pressed,cl + add cl,21 + mov graphicpress,cl + mov presscount,40 + cmp cl,32 + jz nonoise + mov al,10 + call playchannel1 +nonoise: ret + + endp + + + + + + + + + + + + + + +Showouterpad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,keypadx+74 + mov bx,keypady+76 + mov ds,tempgraphics + mov al,37 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + + +Showkeypad proc near + + mov al,22 + mov di,keypadx+9 + mov bx,keypady+5 + call singlekey + mov al,23 + mov di,keypadx+31 + mov bx,keypady+5 + call singlekey + mov al,24 + mov di,keypadx+53 + mov bx,keypady+5 + call singlekey + + mov al,25 + mov di,keypadx+9 + mov bx,keypady+23 + call singlekey + mov al,26 + mov di,keypadx+31 + mov bx,keypady+23 + call singlekey + mov al,27 + mov di,keypadx+53 + mov bx,keypady+23 + call singlekey + + mov al,28 + mov di,keypadx+9 + mov bx,keypady+41 + call singlekey + mov al,29 + mov di,keypadx+31 + mov bx,keypady+41 + call singlekey + mov al,30 + mov di,keypadx+53 + mov bx,keypady+41 + call singlekey + + mov al,31 + mov di,keypadx+9 + mov bx,keypady+59 + call singlekey + mov al,32 + mov di,keypadx+31 + mov bx,keypady+59 + call singlekey + + cmp lightcount,0 + jz notenter + dec lightcount + mov al,36 + mov bx,keypady-1+63 + cmp lockstatus,0 + jnz changelight + mov al,41 + mov bx,keypady+4+63 +changelight: cmp lightcount,60 + jc gotlight + cmp lightcount,100 + jnc gotlight + dec al +gotlight: mov ds,tempgraphics + mov ah,0 + mov di,keypadx+60 + call showframe + +notenter: ret + + endp + + + + + +Singlekey proc near + + cmp graphicpress,al + jnz gotkey + add al,11 + cmp presscount,8 + jnc gotkey + sub al,11 +; cmp presscount,10 +; jnc gotkey +; sub al,11 +gotkey: mov ds,tempgraphics + sub al,20 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Dumpkeypad proc near + + mov di,keypadx-3 + mov bx,keypady-4 + mov cl,120 + mov ch,90 + call multidump + ret + + endp + + + + + +;--------------------------------- + + + + +Usemenu proc near + + call getridofreels + call loadmenu + call createpanel + call showpanel + call showicon + mov newobs,0 + call drawfloor + call printsprites + + mov al,4 + mov ah,0 + mov di,menux-48 + mov bx,menuy-4 + mov ds,tempgraphics2 + call showframe + call getundermenu + mov al,5 + mov ah,0 + mov di,menux+54 + mov bx,menuy+72 + mov ds,tempgraphics2 + call showframe + + + call worktoscreenm + mov getback,0 + +menuloop: call delpointer + call putundermenu + call showmenu + call readmouse + call showpointer + call vsync + call dumppointer + call dumpmenu + call dumptextline + mov bx,offset cs:menulist + call checkcoords + cmp getback,1 + jnz menuloop + + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call getridoftemp2 + call restorereels + call worktoscreenm + ret + +menulist: dw menux+54,menux+68,menuy+72,menuy+88,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Dumpmenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + call multidump + ret + + endp + + + + + + +Getundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + + + + + +Putundermenu proc near + + mov di,menux + mov bx,menuy + mov cl,48 + mov ch,48 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + +Showoutermenu proc near + + mov al,40 + mov ah,0 + mov di,menux-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,41 + mov ah,0 + mov di,menux+64-34 + mov bx,menuy-40 + mov ds,tempgraphics + call showframe + mov al,42 + mov ah,0 + mov di,menux-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + mov al,43 + mov ah,0 + mov di,menux+64-26 + mov bx,menuy+57-40 + mov ds,tempgraphics + call showframe + ret + + endp + + + + + + + + +Showmenu proc near + + inc menucount + cmp menucount,37*2 + jnz menuframeok + mov menucount,0 +menuframeok: mov al,menucount + shr al,1 + mov ah,0 + mov di,menux + mov bx,menuy + mov ds,tempgraphics + call showframe + ret + + endp + + + +Loadmenu proc near + + mov dx,offset cs:spritename3 + call loadintotemp + mov dx,offset cs:mongraphics2 + call loadintotemp2 + ret + + endp + + + + + + + + + + + + + + + + +Viewfolder proc near + + mov manisoffscreen,1 + call getridofall + call loadfolder + mov folderpage,0 + call showfolder + call worktoscreenm + mov getback,0 + +folderloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:folderlist + call checkcoords + cmp getback,0 + jz folderloop + + mov manisoffscreen,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + call getridoftempcharset + call restoreall + call redrawmainscrn + call worktoscreenm + ret + +folderlist: dw 280,320,160,200,quitkey + dw 143,300,6,194,nextfolder + dw 0,143,6,194,lastfolder + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + +Nextfolder proc near + + cmp folderpage,12 + jnz cannextf + call blank + ret +cannextf: cmp commandtype,201 + jz alreadynextf + mov commandtype,201 + mov al,16 + call commandonly +alreadynextf: mov ax,mousebutton + cmp ax,oldbutton + jz notnextf + cmp ax,1 + jz donextf +notnextf: ret +donextf: inc folderpage + call folderhints + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + + +Folderhints proc near + + cmp folderpage,5 + jnz notaideadd + cmp aidedead,1 + jz notaideadd + mov al,13 + call getlocation + cmp al,1 + jz notaideadd + mov al,13 + call setlocation + call showfolder + mov al,30 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp + ret + +notaideadd: cmp folderpage,9 + jnz notaristoadd + mov al,7 + call getlocation + cmp al,1 + jz notaristoadd + mov al,7 + call setlocation + call showfolder + mov al,31 + call findtext1 + mov di,0 + mov bx,86 + mov dl,141 + mov ah,16 + call printdirect + call worktoscreenm + mov cx,200 + call hangonp +notaristoadd: ret + + endp + + + +Lastfolder proc near + + cmp folderpage,0 + jnz canlastf + call blank + ret +canlastf: cmp commandtype,202 + jz alreadylastf + mov commandtype,202 + mov al,17 + call commandonly +alreadylastf: cmp folderpage,0 + jz notlastf + mov ax,mousebutton + cmp ax,oldbutton + jz notlastf + cmp ax,1 + jz dolastf +notlastf: ret +dolastf: dec folderpage + call delpointer + call showfolder + mov mousebutton,0 + mov bx,offset cs:folderlist + call checkcoords + call worktoscreenm + ret + + endp + + + +Loadfolder proc near + + mov dx,offset cs:foldergraphic1 + call loadintotemp + mov dx,offset cs:foldergraphic2 + call loadintotemp2 + mov dx,offset cs:foldergraphic3 + call loadintotemp3 + mov dx,offset cs:characterset3 + call loadtempcharset + mov dx,offset cs:foldertext + call loadtemptext + ret + + endp + + + + +Showfolder proc near + + mov commandtype,255 + cmp folderpage,0 + jz closedfolder + call usetempcharset + call createpanel2 + mov ds,tempgraphics + mov di,0 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,0 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,0 + mov bx,92 + mov al,2 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,143 + mov bx,92 + mov al,3 + mov ah,0 + call showframe + call folderexit + + cmp folderpage,1 + jz noleftpage + call showleftpage +noleftpage: cmp folderpage,12 + jz norightpage + call showrightpage +norightpage: call usecharset1 + call undertextline + ret + +closedfolder: call createpanel2 + mov ds,tempgraphics3 + mov di,143-28 + mov bx,0 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics3 + mov di,143-28 + mov bx,92 + mov al,1 + mov ah,0 + call showframe + call folderexit + call undertextline + ret + + endp + + + + + + + + +Folderexit proc near + + mov ds,tempgraphics2 + mov di,296 + mov bx,178 + mov al,6 + mov ah,0 + call showframe + ret + + endp + + + + + +Showleftpage proc near + + mov ds,tempgraphics2 + mov di,0 + mov bx,12 + mov al,3 + mov ah,0 + call showframe + + mov bx,12+5 + mov cx,9 +leftpageloop: push cx bx + mov ds,tempgraphics2 + mov di,0 + mov al,4 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop leftpageloop + + mov ds,tempgraphics2 + mov di,0 + mov al,5 + mov ah,0 + call showframe + + mov linespacing,8 + mov charshift,91 + mov kerning,1 + mov bl,folderpage + dec bl + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,2 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsleft: push cx +contleftpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contleftpage + pop cx + loop twolotsleft + + mov kerning,0 + mov charshift,0 + mov linespacing,10 + + mov es,workspace + mov ds,workspace + mov di,(48*320)+2 + mov si,(48*320)+2+130 + mov cx,120 +flipfolder: push cx di si + mov cx,65 +flipfolderline: mov al,[es:di] + mov ah,[es:si] + mov [es:di],ah + mov [es:si],al + dec si + inc di + loop flipfolderline + pop si di cx + add si,320 + add di,320 + loop flipfolder + ret + + endp + + + +Showrightpage proc near + + mov ds,tempgraphics2 + mov di,143 + mov bx,12 + mov al,0 + mov ah,0 + call showframe + + mov bx,12+37 + mov cx,7 +rightpageloop: push cx bx + mov ds,tempgraphics2 + mov di,143 + mov al,1 + mov ah,0 + call showframe + pop bx cx + add bx,16 + loop rightpageloop + + mov ds,tempgraphics2 + mov di,143 + mov al,2 + mov ah,0 + call showframe + + mov linespacing,8 + mov kerning,1 + mov bl,folderpage + dec bl + add bl,bl + mov bh,0 + add bx,bx + mov es,textfile1 + mov si,[es:bx] + add si,66*2 + mov di,152 + mov bx,48 + mov dl,140 + mov cx,2 +twolotsright: push cx +contrightpage: call printdirect + add bx,linespacing + cmp al,0 + jnz contrightpage + pop cx + loop twolotsright + + mov kerning,0 + mov linespacing,10 + ret + + endp + + + + + + + + + +Entersymbol proc near + + mov manisoffscreen,1 + call getridofreels + mov dx,offset cs:symbolgraphic + call loadintotemp + mov symboltopx,24 + mov symboltopdir,0 + mov symbolbotx,24 + mov symbolbotdir,0 + call redrawmainscrn + call showsymbol + call undertextline + call worktoscreenm + mov getback,0 + +symbolloop: call delpointer + call updatesymboltop + call updatesymbolbot + call showsymbol + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call dumpsymbol + mov bx,offset cs:symbollist + call checkcoords + cmp getback,0 + jz symbolloop + + cmp symbolbotnum,3 + jnz symbolwrong + cmp symboltopnum,5 + jnz symbolwrong + mov al,43 + call removesetobject + mov al,46 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathon + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + mov al,13 + call playchannel1 + ret + +symbolwrong: mov al,46 + call removesetobject + mov al,43 + call placesetobject + mov ah,roomnum + add ah,12 + mov al,0 + call turnanypathoff + mov manisoffscreen,0 + call redrawmainscrn + call getridoftemp + call restorereels + call worktoscreenm + ret + +symbollist: dw symbolx+40,symbolx+64,symboly+2,symboly+16,quitsymbol + dw symbolx,symbolx+52,symboly+20,symboly+50,settopleft + dw symbolx+52,symbolx+104,symboly+20,symboly+50,settopright + dw symbolx,symbolx+52,symboly+50,symboly+80,setbotleft + dw symbolx+52,symbolx+104,symboly+50,symboly+80,setbotright + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + + + + + +Quitsymbol proc near + + cmp symboltopx,24 + jnz blank + cmp symbolbotx,24 + jnz blank + cmp commandtype,222 + jz alreadyqs + mov commandtype,222 + mov al,18 + call commandonly +alreadyqs: mov ax,mousebutton + cmp ax,oldbutton + jz notqs + and ax,1 + jnz doqs +notqs: ret + +doqs: mov getback,1 + ret + + endp + + + + +Settopleft proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,210 + jz alreadytopl + mov commandtype,210 + mov al,19 + call commandonly +alreadytopl: cmp mousebutton,0 + jz notopleft + mov symboltopdir,-1 +notopleft: ret + + endp + + + +Settopright proc near + + cmp symboltopdir,0 + jnz blank + cmp commandtype,211 + jz alreadytopr + mov commandtype,211 + mov al,20 + call commandonly +alreadytopr: cmp mousebutton,0 + jz notopright + mov symboltopdir,1 +notopright: ret + + endp + + + + +Setbotleft proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,212 + jz alreadybotl + mov commandtype,212 + mov al,21 + call commandonly +alreadybotl: cmp mousebutton,0 + jz nobotleft + mov symbolbotdir,-1 +nobotleft: ret + + endp + + + +Setbotright proc near + + cmp symbolbotdir,0 + jnz blank + cmp commandtype,213 + jz alreadybotr + mov commandtype,213 + mov al,22 + call commandonly +alreadybotr: cmp mousebutton,0 + jz nobotright + mov symbolbotdir,1 +nobotright: ret + + endp + + + + + + + +Dumpsymbol proc near + + mov newtextline,0 + mov di,symbolx + mov bx,symboly+20 + mov cl,104 + mov ch,60 + call multidump + ret + + endp + + + + +Showsymbol proc near + + mov al,12 + mov ah,0 + mov di,symbolx + mov bx,symboly + mov ds,tempgraphics + call showframe + + mov al,symboltopx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symboltopnum + mov bx,symboly+20 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + + mov al,symbolbotx + mov ah,0 + mov di,ax + add di,symbolx-44 + mov al,symbolbotnum + add al,6 + mov bx,symboly+49 + mov ds,tempgraphics + mov ah,32 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + push ax di bx ds + call showframe + pop ds bx di ax + call nextsymbol + add di,49 + call showframe + ret + + endp + + + + + + +Nextsymbol proc near + + inc al + cmp al,6 + jz topwrap + cmp al,12 + jz botwrap + ret +topwrap: mov al,0 + ret +botwrap: mov al,6 + ret + + endp + + + +Updatesymboltop proc near + + cmp symboltopdir,0 + jz topfinished + cmp symboltopdir,-1 + jz backwards + + inc symboltopx + cmp symboltopx,49 + jnz notwrapfor + mov symboltopx,0 + dec symboltopnum + cmp symboltopnum,-1 + jnz topfinished + mov symboltopnum,5 + ret +notwrapfor: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 + ret + +backwards: dec symboltopx + cmp symboltopx,-1 + jnz notwrapback + mov symboltopx,48 + inc symboltopnum + cmp symboltopnum,6 + jnz topfinished + mov symboltopnum,0 + ret +notwrapback: cmp symboltopx,24 + jnz topfinished + mov symboltopdir,0 +topfinished: ret + + endp + + + +Updatesymbolbot proc near + + cmp symbolbotdir,0 + jz botfinished + cmp symbolbotdir,-1 + jz backwardsbot + + inc symbolbotx + cmp symbolbotx,49 + jnz notwrapforb + mov symbolbotx,0 + dec symbolbotnum + cmp symbolbotnum,-1 + jnz botfinished + mov symbolbotnum,5 + ret +notwrapforb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 + ret + +backwardsbot: dec symbolbotx + cmp symbolbotx,-1 + jnz notwrapbackb + mov symbolbotx,48 + inc symbolbotnum + cmp symbolbotnum,6 + jnz botfinished + mov symbolbotnum,0 + ret +notwrapbackb: cmp symbolbotx,24 + jnz botfinished + mov symbolbotdir,0 +botfinished: ret + + endp + + + + + + + + + + +Dumpsymbox proc near + + cmp dumpx,-1 + jz nodumpsym + mov di,dumpx + mov bx,dumpy + mov cl,30 + mov ch,77;30 + call multidump + mov dumpx,-1 +nodumpsym: ret + + endp + + + + + + + +Usediary proc near + + call getridofreels + mov dx,offset cs:diarygraphic + call loadintotemp + mov dx,offset cs:diarytext + call loadtemptext + + mov dx,offset cs:characterset3 + call loadtempcharset + call createpanel + call showicon + call showdiary + call undertextline + call showdiarypage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov getback,0 + +diaryloop: call delpointer + call readmouse + call showdiarykeys + call showpointer + call vsync + call dumppointer + call dumpdiarykeys + call dumptextline + mov bx,offset cs:diarylist + call checkcoords + cmp getback,0 + jz diaryloop + + call getridoftemp + call getridoftemptext + call getridoftempcharset + call restorereels + mov manisoffscreen,0 + call redrawmainscrn + call worktoscreenm + ret + +diarylist: dw diaryx+94,diaryx+110,diaryy+97,diaryy+113,diarykeyn + dw diaryx+151,diaryx+167,diaryy+71,diaryy+87,diarykeyp + dw diaryx+176,diaryx+192,diaryy+108,diaryy+124,quitkey + dw 0,320,0,200,blank + dw 0ffffh + + ret + + endp + + + + + + + +Showdiary proc near + + mov al,1 + mov ah,0 + mov di,diaryx + mov bx,diaryy+37 + mov ds,tempgraphics + call showframe + mov al,2 + mov ah,0 + mov di,diaryx+176 + mov bx,diaryy+108 + mov ds,tempgraphics + call showframe + ret + + endp + + + + +Showdiarykeys proc near + + cmp presscount,0 + jz nokeyatall + dec presscount + cmp presscount,0 + jz nokeyatall + cmp pressed,"N" + jnz nokeyn + mov al,3 + cmp presscount,1 + jz gotkeyn + mov al,4 +gotkeyn: mov ah,0 + mov di,diaryx+94 + mov bx,diaryy+97 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshown + call showdiarypage +notshown: ret + +nokeyn: mov al,5 + cmp presscount,1 + jz gotkeyp + mov al,6 +gotkeyp: mov ah,0 + mov di,diaryx+151 + mov bx,diaryy+71 + mov ds,tempgraphics + call showframe + cmp presscount,1 + jnz notshowp + call showdiarypage +notshowp: ret + +nokeyatall: ret + + endp + + + + + + +Dumpdiarykeys proc near + + cmp presscount,1 + jnz notdumpdiary + cmp sartaindead,1 + jz notsartadd + cmp diarypage,5 + jnz notsartadd + cmp diarypage,5 + jnz notsartadd + mov al,6 + call getlocation + cmp al,1 + jz notsartadd + mov al,6 + call setlocation + + call delpointer + mov al,12 + call findtext1 + mov di,70 ;diaryx+48 + mov bx,106 ;diaryy+16 + mov dl,241 + mov ah,16 + call printdirect + + call worktoscreenm + mov cx,200 + call hangonp + call createpanel + call showicon + call showdiary + call showdiarypage + call worktoscreenm + call showpointer + ret + +notsartadd: mov di,diaryx+48 + mov bx,diaryy+15 + mov cl,200 + mov ch,16 + call multidump +notdumpdiary: mov di,diaryx+94 + mov bx,diaryy+97 + mov cl,16 + mov ch,16 + call multidump + mov di,diaryx+151 + mov bx,diaryy+71 + mov cl,16 + mov ch,16 + call multidump + ret + + endp + + + +Diarykeyp proc near + + cmp commandtype,214 + jz alreadykeyp + mov commandtype,214 + mov al,23 + call commandonly +alreadykeyp: cmp mousebutton,0 + jz notkeyp + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyp + cmp presscount,0 + jnz notkeyp + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"P" + dec diarypage + cmp diarypage,-1 + jnz notkeyp + mov diarypage,11 +notkeyp: ret + + endp + + + +Diarykeyn proc near + + cmp commandtype,213 + jz alreadykeyn + mov commandtype,213 + mov al,23 + call commandonly +alreadykeyn: cmp mousebutton,0 + jz notkeyn + mov ax,oldbutton + cmp ax,mousebutton + jz notkeyn + cmp presscount,0 + jnz notkeyn + mov al,16 + call playchannel1 + mov presscount,12 + mov pressed,"N" + inc diarypage + cmp diarypage,12 + jnz notkeyn + mov diarypage,0 +notkeyn: ret + + endp + + + + + + +Showdiarypage proc near + + mov al,0 + mov ah,0 + mov di,diaryx + mov bx,diaryy + mov ds,tempgraphics + call showframe + + mov al,diarypage + call findtext1 + + mov kerning,1 + call usetempcharset + mov di,diaryx+48 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + mov charshift,91+91 + call printdirect + + mov di,diaryx+129 + mov bx,diaryy+16 + mov dl,240 + mov ah,16 + call printdirect + + mov di,diaryx+48 + mov bx,diaryy+23 + mov dl,240 + mov ah,16 + call printdirect + + mov kerning,0 + mov charshift,0 + call usecharset1 + ret + + endp + + + + + +Findtext1 proc near + + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/look.asm b/devtools/tasmrecover/dreamweb/look.asm index 11ee24beb6..b5bc913a73 100644 --- a/devtools/tasmrecover/dreamweb/look.asm +++ b/devtools/tasmrecover/dreamweb/look.asm @@ -1,167 +1,167 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;---------------------------------------------------------------Look-routine---- - -Autolook proc near - - mov ax,mousex - cmp ax,oldx - jnz diffmouse - mov ax,mousey - cmp ax,oldy - jnz diffmouse - - dec lookcounter - cmp lookcounter,0 - jnz noautolook - cmp watchingtime,0 - jnz noautolook - call dolook -noautolook: ret - -diffmouse: mov lookcounter,1000 - ret - - endp - - - - -Look proc near - - cmp watchingtime,0 - jnz blank - cmp pointermode,2 - jz blank - - cmp commandtype,241 - jz alreadylook - mov commandtype,241 - mov al,25 - call commandonly -alreadylook: cmp mousebutton,1 - jnz nolook - mov ax,mousebutton - cmp ax,oldbutton - jz nolook - call dolook -nolook: ret - - endp - - - - - -Dolook proc near - - call createpanel - call showicon - call undertextline - call worktoscreenm - - mov commandtype,255 - call dumptextline - - mov bl,roomnum - and bl,31 - mov bh,0 - add bx,bx - - mov es,roomdesc - add bx,intextdat - - mov si,[es:bx] - add si,intext - - call findnextcolon - - mov di,66 - cmp reallocation,50 - jc notdream3 - mov di,40 -notdream3: mov bx,80 - mov dl,241 - call printslow - - cmp al,1 - jz afterlook - mov cx,400 - call hangonp - -afterlook: mov pointermode,0 - mov commandtype,0 - call redrawmainscrn - call worktoscreenm - ret - - endp - - - - - - -Redrawmainscrn proc near - - mov timecount,0 - call createpanel - mov newobs,0 - call drawfloor - call printsprites - call reelsonscreen - call showicon - call getunderzoom - call undertextline - call readmouse - mov commandtype,255 - ret - - endp - - - - - - - - - - - - - - - -Getback1 proc near - - cmp pickup,0 - jz notgotobject - call blank - ret - -notgotobject: cmp commandtype,202 - jz alreadyget - mov commandtype,202 - mov al,26 - call commandonly -alreadyget: mov ax,mousebutton - cmp ax,oldbutton - jz nogetback - and ax,1 - jnz dogetback -nogetback: ret - -dogetback: mov getback,1 - mov pickup,0 - ret - - endp - - - - - - +;---------------------------------------------------------------Look-routine---- + +Autolook proc near + + mov ax,mousex + cmp ax,oldx + jnz diffmouse + mov ax,mousey + cmp ax,oldy + jnz diffmouse + + dec lookcounter + cmp lookcounter,0 + jnz noautolook + cmp watchingtime,0 + jnz noautolook + call dolook +noautolook: ret + +diffmouse: mov lookcounter,1000 + ret + + endp + + + + +Look proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + + cmp commandtype,241 + jz alreadylook + mov commandtype,241 + mov al,25 + call commandonly +alreadylook: cmp mousebutton,1 + jnz nolook + mov ax,mousebutton + cmp ax,oldbutton + jz nolook + call dolook +nolook: ret + + endp + + + + + +Dolook proc near + + call createpanel + call showicon + call undertextline + call worktoscreenm + + mov commandtype,255 + call dumptextline + + mov bl,roomnum + and bl,31 + mov bh,0 + add bx,bx + + mov es,roomdesc + add bx,intextdat + + mov si,[es:bx] + add si,intext + + call findnextcolon + + mov di,66 + cmp reallocation,50 + jc notdream3 + mov di,40 +notdream3: mov bx,80 + mov dl,241 + call printslow + + cmp al,1 + jz afterlook + mov cx,400 + call hangonp + +afterlook: mov pointermode,0 + mov commandtype,0 + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Redrawmainscrn proc near + + mov timecount,0 + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + call readmouse + mov commandtype,255 + ret + + endp + + + + + + + + + + + + + + + +Getback1 proc near + + cmp pickup,0 + jz notgotobject + call blank + ret + +notgotobject: cmp commandtype,202 + jz alreadyget + mov commandtype,202 + mov al,26 + call commandonly +alreadyget: mov ax,mousebutton + cmp ax,oldbutton + jz nogetback + and ax,1 + jnz dogetback +nogetback: ret + +dogetback: mov getback,1 + mov pickup,0 + ret + + endp + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm index 65b68cb94c..7cc1a5a4dd 100644 --- a/devtools/tasmrecover/dreamweb/monitor.asm +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -1,1496 +1,1496 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Usemon proc near - - mov lasttrigger,0 - - push cs ;start off with no file name - pop es - mov di,offset cs:currentfile+1 - mov cx,12 - mov al,32 - rep stosb - push cs ;start off with no file name - pop es - mov di,offset cs:operand1+1 - mov cx,12 - mov al,32 - rep stosb - - push cs ;clear all keys - pop es - mov di,offset cs:keys - mov byte ptr [es:di],1 - add di,26 - mov cx,3 -keyloop: mov byte ptr [es:di],0 - add di,26 - loop keyloop - - call createpanel - call showpanel - call showicon - call drawfloor - call getridofall ;reels - - mov dx,offset cs:mongraphicname - call loadintotemp - call loadpersonal - call loadnews - call loadcart - mov dx,offset cs:characterset2 - call loadtempcharset - - call printoutermon - call initialmoncols - call printlogo - call worktoscreen - call turnonpower - call fadeupyellows - call fadeupmonfirst - - mov monadx,76 - mov monady,141 - mov al,1 - call monmessage - mov cx,120 - call hangoncurs - mov al,2 - call monmessage - mov cx,60 - call randomaccess - mov al,3 - call monmessage - mov cx,100 - call hangoncurs - call printlogo - call scrollmonitor - mov bufferin,0 - mov bufferout,0 - -moreinput: mov di,monadx - mov bx,monady - push di bx - call input - pop bx di - mov monadx,di - mov monady,bx - call execcommand - cmp al,0 - jz moreinput - -endmon: call getridoftemp - call getridoftempcharset - mov es,textfile1 - call deallocatemem - mov es,textfile2 - call deallocatemem - mov es,textfile3 - call deallocatemem - mov getback,1 - mov al,26 - call playchannel1 - mov manisoffscreen,0 - call restoreall ;reels - call redrawmainscrn - call worktoscreenm - ret - - endp - - - - - - -Printoutermon proc near - - mov di,40 - mov bx,32 - mov ds,tempgraphics - mov al,1 - mov ah,0 - call showframe - mov di,264 - mov bx,32 - mov ds,tempgraphics - mov al,2 - mov ah,0 - call showframe - mov di,40 - mov bx,12 - mov ds,tempgraphics - mov al,3 - mov ah,0 - call showframe - mov di,40 - mov bx,164 - mov ds,tempgraphics - mov al,4 - mov ah,0 - call showframe - ret - - endp - - - - - - - -Loadpersonal proc near - - mov al,location - mov dx,offset cs:monitorfile1 - cmp al,0 - jz foundpersonal - cmp al,42 - jz foundpersonal - mov dx,offset cs:monitorfile2 - cmp al,2 - jz foundpersonal - -foundpersonal: call openfile - call readheader - mov bx,[es:di] - push bx - mov cl,4 - shr bx,cl - call allocatemem - mov textfile1,ax - mov ds,ax - pop cx - mov dx,0 - call readfromfile - call closefile - ret - - endp - - - - -Loadnews proc near ;textfile2 holds information - ;accessable by anyone - mov al,newsitem - mov dx,offset cs:monitorfile10 - cmp al,0 - jz foundnews - mov dx,offset cs:monitorfile11 - cmp al,1 - jz foundnews - mov dx,offset cs:monitorfile12 - cmp al,2 - jz foundnews - mov dx,offset cs:monitorfile13 -foundnews: call openfile - call readheader - mov bx,[es:di] - push bx - mov cl,4 - shr bx,cl - call allocatemem - mov textfile2,ax - mov ds,ax - pop cx - mov dx,0 - call readfromfile - call closefile - ret - - endp - - - - - - -Loadcart proc near - - call lookininterface - - mov dx,offset cs:monitorfile20 - cmp al,0 - jz gotcart - mov dx,offset cs:monitorfile21 - cmp al,1 - jz gotcart - mov dx,offset cs:monitorfile22 - cmp al,2 - jz gotcart - mov dx,offset cs:monitorfile23 - cmp al,3 - jz gotcart - mov dx,offset cs:monitorfile24 -gotcart: call openfile - call readheader - mov bx,[es:di] - push bx - mov cl,4 - shr bx,cl - call allocatemem - mov textfile3,ax - mov ds,ax - pop cx - mov dx,0 - call readfromfile - call closefile - ret - - endp - - - - - - -Lookininterface proc near - - mov al,"I" - mov ah,"N" - mov cl,"T" - mov ch,"F" - call findsetobject ;this bit searches set obs - ;until the interface is found - ;al holds object number - mov ah,1 ;ah holds type, 1=set object - call checkinside ;this searches for any extra - ;object inside the interface.. - cmp cl,numexobjects - jz emptyinterface - mov al,[es:bx+15] ;get the last letter of ID code - inc al - ret -emptyinterface: mov al,0 - ret - - endp - - - - - - - -Turnonpower proc near - - mov cx,3 -powerloop: push cx - call powerlighton - mov cx,30 - call hangon - call powerlightoff - mov cx,30 - call hangon - pop cx - loop powerloop - call powerlighton - ret - - endp - - - - - -Randomaccess proc near - -accessloop: push cx - call vsync - call vsync - call randomnum1 - and al,15 - cmp al,10 - jc off - call accesslighton - jmp chosenaccess -off: call accesslightoff -chosenaccess: pop cx - loop accessloop - call accesslightoff - ret - - endp - - - -Powerlighton proc near - - mov di,257+4 - mov bx,182 - mov ds,tempgraphics - mov al,6 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - -Powerlightoff proc near - - mov di,257+4 - mov bx,182 - mov ds,tempgraphics - mov al,5 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - -Accesslighton proc near - - mov di,74 - mov bx,182 - mov ds,tempgraphics - mov al,8 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - -Accesslightoff proc near - - mov di,74 - mov bx,182 - mov ds,tempgraphics - mov al,7 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - - -Locklighton proc near - - mov di,56 - mov bx,182 - mov ds,tempgraphics - mov al,10 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - -Locklightoff proc near - - mov di,56 - mov bx,182 - mov ds,tempgraphics - mov al,9 - mov ah,0 - push di bx - call showframe - pop bx di - mov cl,12 - mov ch,8 - call multidump - ret - - endp - - - - - - - - - - -Input proc near - - push cs - pop es - mov di,offset cs:inputline - mov cx,64 - mov al,0 - rep stosb - - mov curpos,0 - mov al,">" - mov di,monadx - mov bx,monady - mov ds,tempcharset - mov ah,0 - call printchar - mov di,monadx - mov bx,monady - mov cl,6 - mov ch,8 - call multidump - add monadx,6 - mov ax,monadx - mov curslocx,ax - mov ax,monady - mov curslocy,ax - -waitkey: call printcurs - call vsync - call delcurs - call readkey - mov al,currentkey - cmp al,0 - jz waitkey - cmp al,13 - jz endofinput - cmp al,8 - jnz notdel - cmp curpos,0 - jz waitkey - call delchar - jmp waitkey -notdel: cmp curpos,28 - jz waitkey - cmp currentkey,32 - jnz notleadingspace - cmp curpos,0 - jz waitkey -notleadingspace: call makecaps - push cs - pop es - mov si,curpos - add si,si - add si,offset cs:inputline - mov [es:si],al - - cmp al,"Z"+1 - jnc waitkey - - push ax es si - mov di,monadx - mov bx,monady - mov ds,mapstore - mov ax,curpos - xchg al,ah - mov si,ax - mov cl,8 - mov ch,8 - call multiget - pop si es ax - - push es si - mov di,monadx - mov bx,monady - mov ds,tempcharset - mov ah,0 - call printchar - pop si es - ;dec cx - mov [es:si+1],cl - mov ch,0 - add monadx,cx - inc curpos - add curslocx,cx - jmp waitkey - -endofinput: ret - - endp - - - - - - - - -Makecaps proc near - - cmp al,"a" - jc notupperc - sub al,32 -notupperc: ret - - endp - - - - - - - - - -Delchar proc near - - dec curpos - mov si,curpos - add si,si - push cs - pop es - add si,offset cs:inputline - mov byte ptr [es:si],0 - mov al,[es:si+1] - mov ah,0 - sub monadx,ax - sub curslocx,ax - mov di,monadx - mov bx,monady - mov ds,mapstore - mov ax,curpos - xchg al,ah - mov si,ax - mov cl,8 - mov ch,8 - call multiput - mov di,monadx - mov bx,monady - mov cl,al - mov ch,8 - call multidump - ret - - endp - - - - - - - -Execcommand proc near - - push cs - pop es - mov bx,offset cs:comlist - push cs - pop ds - mov si,offset cs:inputline - mov al,[si] - cmp al,0 - jnz notblankinp - call scrollmonitor - ret - -notblankinp: mov cl,0 -comloop: push bx si -comloop2: mov al,[si] - add si,2 - mov ah,[es:bx] - inc bx - cmp ah,32 - jz foundcom - cmp al,ah - jz comloop2 - pop si bx - add bx,10 - inc cl - cmp cl,6 - jnz comloop - call neterror - mov al,0 - ret -foundcom: pop si bx - cmp cl,1 - jz testcom - cmp cl,2 - jz directory - cmp cl,3 - jz accesscom - cmp cl,4 - jz signoncom - cmp cl,5 - jz keyscom - jmp quitcom - -directory: call dircom - mov al,0 - ret - -signoncom: call signon - mov al,0 - ret - -accesscom: call read - mov al,0 - ret - -keyscom: call showkeys - mov al,0 - ret - -testcom: mov al,6 - call monmessage - mov al,0 - ret - -quitcom: mov al,1 - ret - -comlist: db "EXIT " - db "HELP " - db "LIST " - db "READ " - db "LOGON " - db "KEYS " - -keys: db 1,0,"PUBLIC PUBLIC ",0 - db 0,0,"BLACKDRAGON RYAN ",0 - db 0,0,"HENDRIX LOUIS ",0 - db 0,0,"SEPTIMUS BECKETT ",0 - db 255,255 - -operand1: db " ",0 -rootdir: db 34,"ROOT ",0 -currentfile db 34," ",0 - - endp - - - - - - - -Neterror proc near - - mov al,5 - call monmessage - call scrollmonitor - ret - - endp - - - - - - - - - -Dircom proc near - - mov cx,30 - call randomaccess - call parser - cmp byte ptr [es:di+1],0 - jz dirroot - call dirfile - ret - -dirroot: mov logonum,0 - push cs - pop ds - mov si,offset cs:rootdir - inc si - push cs - pop es - mov di,offset cs:currentfile - inc di - mov cx,12 - rep movsb - call monitorlogo - call scrollmonitor - - mov al,9 - call monmessage - - mov es,textfile1 - call searchforfiles - mov es,textfile2 - call searchforfiles - mov es,textfile3 - call searchforfiles - - call scrollmonitor - ret - - endp - - - - - - -Searchforfiles proc near - - mov bx,textstart -directloop1: mov al,[es:bx] - inc bx - cmp al,"*" - jz endofdir - cmp al,34 - jnz directloop1 - call monprint - jmp directloop1 -endofdir: ret - - endp - - - - - - - - - - - - -Signon proc near - - call parser - inc di - push cs - pop ds - mov si,offset cs:keys - mov cx,4 -signonloop: push cx si di - add si,14 - mov cx,11 -signonloop2: lodsb - cmp al,32 - jz foundsign - call makecaps - mov ah,[es:di] - inc di - cmp al,ah - jnz nomatch - loop signonloop2 -nomatch: pop di si cx - add si,26 - loop signonloop - mov al,13 - call monmessage - ret - -foundsign: pop di si cx ;ds:si contains ad of key matched - mov bx,si - push ds - pop es ;now ds:si is in es:bx - - cmp byte ptr [es:bx],0 - jz notyetassigned - - mov al,17 - call monmessage - ret - -notyetassigned: push es bx - call scrollmonitor - mov al,15 - call monmessage - mov di,monadx - mov bx,monady - push di bx - call input - pop bx di - mov monadx,di - mov monady,bx - pop bx es - push es bx - - add bx,2 - push cs - pop ds - mov si,offset cs:inputline -checkpass: lodsw - mov ah,[es:bx] - inc bx - ;cmp al,0 - cmp ah,32 - jz passpassed - cmp al,ah - jz checkpass -passerror: pop bx es - call scrollmonitor - mov al,16 - call monmessage - ret - -passpassed: mov al,14 - call monmessage - pop bx es - push es bx - add bx,14 - call monprint - call scrollmonitor - pop bx es - mov byte ptr [es:bx],1 - ret - - endp - - - - - - - -Showkeys proc near - - mov cx,10 - call randomaccess - call scrollmonitor - mov al,18 - call monmessage - - push cs - pop es - mov bx,offset cs:keys - mov cx,4 -keysloop: push cx bx - cmp byte ptr [es:bx],0 - jz notheld - add bx,14 - call monprint -notheld: pop bx cx - add bx,26 - loop keysloop - call scrollmonitor - ret - - endp - - - - - - - - - - - -Read proc near - - mov cx,40 - call randomaccess - call parser - cmp byte ptr [es:di+1],0 - jnz okcom - call neterror - ret -okcom: push cs - pop es - mov di,offset cs:currentfile - mov ax,textfile1 - mov monsource,ax - mov ds,ax - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile2 - mov ax,textfile2 - mov monsource,ax - mov ds,ax - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile2 - mov ax,textfile3 - mov monsource,ax - mov ds,ax - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile2 - mov al,7 - call monmessage - ret -foundfile2: call getkeyandlogo - cmp al,0 - jz keyok1 - ret -keyok1: push cs - pop es - mov di,offset cs:operand1 - mov ds,monsource - call searchforstring - cmp al,0 - jz findtopictext - mov al,oldlogonum - mov logonum,al - mov al,11 - call monmessage - ret - -findtopictext: inc bx - push es bx - call monitorlogo - call scrollmonitor - pop bx es -moretopic: call monprint - mov al,[es:bx] - cmp al,34 - jz endoftopic - cmp al,"=" - jz endoftopic - cmp al,"*" - jz endoftopic - push es bx - call processtrigger - mov cx,24 - call randomaccess - pop bx es - jmp moretopic - -endoftopic: call scrollmonitor - ret - - endp - - - - - - - - - -Dirfile proc near - - mov al,34 - mov [es:di],al - push es di ;save start point held in es:di - mov ds,textfile1 - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile - pop di es - push es di - mov ds,textfile2 - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile - pop di es - push es di - mov ds,textfile3 - mov si,textstart - call searchforstring - cmp al,0 - jz foundfile - - pop di es - mov al,7 - call monmessage - ret - -foundfile: pop ax ax ;discard old values of es:di - call getkeyandlogo - cmp al,0 - jz keyok2 - ret - -keyok2: push es bx - push cs - pop ds - mov si,offset cs:operand1+1 - push cs - pop es - mov di,offset cs:currentfile+1 - mov cx,12 - rep movsb - call monitorlogo - call scrollmonitor - mov al,10 - call monmessage - pop bx es - - -directloop2: mov al,[es:bx] - inc bx - cmp al,34 - jz endofdir2 - cmp al,"*" - jz endofdir2 - cmp al,"=" - jnz directloop2 - call monprint - jmp directloop2 - -endofdir2: call scrollmonitor - ret - - endp - - - - - - -Getkeyandlogo proc near - - inc bx - mov al,[es:bx] - sub al,48 - mov newlogonum,al - add bx,2 - mov al,[es:bx] - sub al,48 - mov keynum,al - inc bx - push es bx - mov al,keynum - mov ah,0 - mov cx,26 - mul cx - push cs - pop es - mov bx,offset cs:keys - add bx,ax - mov al,[es:bx] - cmp al,1 - jz keyok - push bx es - mov al,12 - call monmessage - pop es bx - add bx,14 - call monprint - call scrollmonitor - pop bx es - mov al,1 - ret - -keyok: pop bx es - mov al,newlogonum - mov logonum,al - mov al,0 - ret - - endp - - - - - - - - - -Searchforstring proc near ;finds string at es:di in - ;text at ds:si - - mov dl,[es:di] ;needs to know first character - ;if it's an equals then we must - ;stop at the next quotation mark - mov cx,di ;need to remember starting point - -restartlook: mov di,cx - mov bx,si - - mov dh,0 ;dh holds count of brackets - ;brackets are either " or = -keeplooking: lodsb - call makecaps - cmp al,"*" - jz notfound - cmp dl,"=" - jnz nofindingtopic ;are we looking for a topic? - cmp al,34 ;if YES, check we haven't reached - jz notfound ;the end of this file. -nofindingtopic: mov ah,[es:di] - cmp al,dl ;all searches bracketed by same thing - jnz notbracket - inc dh - cmp dh,2 - jz complete -notbracket: cmp al,ah - jnz restartlook - inc di - jmp keeplooking -complete: push ds ;es:bx returns found string - pop es - mov al,0 - mov bx,si - ret -notfound: mov al,1 - ret - - endp - - - - - - -Parser proc near - - push cs - pop es - mov di,offset cs:operand1 - mov cx,13 - mov al,0 - rep stosb - - mov di,offset cs:operand1 - mov al,"=" - stosb - - push cs - pop ds - mov si,offset cs:inputline - -notspace1: lodsw - cmp al,32 - jz stillspace1 - cmp al,0 - jnz notspace1 - jmp finishpars - -stillspace1: lodsw - cmp al,32 - jz stillspace1 - -copyin1: stosb - lodsw - cmp al,0 - jz finishpars - cmp al,32 - jnz copyin1 - -finishpars: mov di,offset cs:operand1 - ret - - endp - - - - - - -Scrollmonitor proc near - - push ax bx cx dx di si es ds - - call printlogo - mov di,monadx - mov bx,monady - call printundermon - mov ax,monady - call worktoscreen - mov al,25 - call playchannel1 - - pop ds es si di dx cx bx ax - ret - - endp - - - - - - - - - - - - - - -Lockmon proc near - - cmp lasthardkey,57 - jnz notlock - call locklighton -lockloop: cmp lasthardkey,57 - jz lockloop - call locklightoff -notlock: ret - - endp - - - - - -Monitorlogo proc near - - mov al,logonum - cmp al,oldlogonum - jz notnewlogo - mov oldlogonum,al - ;call fadedownmon - call printlogo - call printundermon - call worktoscreen - call printlogo - ;call fadeupmon - call printlogo - mov al,26 - call playchannel1 - mov cx,20 - call randomaccess - ret -notnewlogo: call printlogo - ret - - endp - - - - - - - - -Printlogo proc near - - mov di,56 - mov bx,32 - mov ds,tempgraphics - mov al,0 - mov ah,0 - call showframe - call showcurrentfile - ret - - endp - - - - - - -Showcurrentfile proc near - - mov di,178 ;99 - mov bx,37 - mov si,offset cs:currentfile+1 -curfileloop: mov al,[cs:si] - cmp al,0 - jz finishfile - inc si - push si - if foreign - call modifychar - endif - mov ds,tempcharset - mov ah,0 - call printchar - pop si - jmp curfileloop -finishfile: ret - - endp - - - - - - - - - -Monmessage proc near - - mov es,textfile1 - mov bx,textstart - mov cl,al - mov ch,0 -monmessageloop: mov al,[es:bx] - inc bx - cmp al,"+" - jnz monmessageloop - loop monmessageloop - call monprint - ret - - endp - - - - - - -Processtrigger proc near - - cmp lasttrigger,"1" - jnz notfirsttrigger - mov al,8 - call setlocation - mov al,45 - call triggermessage - ret - -notfirsttrigger: cmp lasttrigger,"2" - jnz notsecondtrigger - mov al,9 - call setlocation - mov al,55 - call triggermessage - ret - -notsecondtrigger: cmp lasttrigger,"3" - jnz notthirdtrigger - mov al,2 - call setlocation - mov al,59 - call triggermessage - -notthirdtrigger: ret - - endp - - - - -Triggermessage proc near - - push ax - mov di,174 - mov bx,153 - mov cl,200 - mov ch,63 - mov ds,mapstore - mov si,0 - call multiget - pop ax - call findpuztext - mov di,174 - mov bx,156 - mov dl,141 - mov ah,16 - call printdirect - mov cx,140 - call hangon - call worktoscreen - mov cx,340 - call hangon - mov di,174 - mov bx,153 - mov cl,200 - mov ch,63 - mov ds,mapstore - mov si,0 - call multiput - call worktoscreen - mov lasttrigger,0 - ret - - endp - - - - - - -Printcurs proc near - - push si di ds dx bx es - mov di,curslocx - mov bx,curslocy - mov cl,6 - mov ch,8 - if foreign - sub bx,3 - mov ch,11 - endif - mov ds,buffers - mov si,textunder - push di bx - call multiget - pop bx di - - push bx di - inc maintimer - mov ax,maintimer - and al,16 - jnz flashcurs - mov al,"/" - sub al,32 - mov ah,0 - mov ds,tempcharset - call showframe - -flashcurs: pop di bx - sub di,6 - mov cl,12 - if foreign - mov ch,11 - else - mov ch,8 - endif - call multidump - - pop es bx dx ds di si - ret - - endp - - - - - - -Delcurs proc near - - push es bx di ds dx si - mov di,curslocx - mov bx,curslocy - mov cl,6 - mov ch,8 - if foreign - sub bx,3 - mov ch,11 - endif - push di bx cx - mov ds,buffers - mov si,textunder - call multiput - pop cx bx di - call multidump -finishcurdel: - pop si dx ds di bx es - ret - - endp - - - - - +Usemon proc near + + mov lasttrigger,0 + + push cs ;start off with no file name + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + mov al,32 + rep stosb + push cs ;start off with no file name + pop es + mov di,offset cs:operand1+1 + mov cx,12 + mov al,32 + rep stosb + + push cs ;clear all keys + pop es + mov di,offset cs:keys + mov byte ptr [es:di],1 + add di,26 + mov cx,3 +keyloop: mov byte ptr [es:di],0 + add di,26 + loop keyloop + + call createpanel + call showpanel + call showicon + call drawfloor + call getridofall ;reels + + mov dx,offset cs:mongraphicname + call loadintotemp + call loadpersonal + call loadnews + call loadcart + mov dx,offset cs:characterset2 + call loadtempcharset + + call printoutermon + call initialmoncols + call printlogo + call worktoscreen + call turnonpower + call fadeupyellows + call fadeupmonfirst + + mov monadx,76 + mov monady,141 + mov al,1 + call monmessage + mov cx,120 + call hangoncurs + mov al,2 + call monmessage + mov cx,60 + call randomaccess + mov al,3 + call monmessage + mov cx,100 + call hangoncurs + call printlogo + call scrollmonitor + mov bufferin,0 + mov bufferout,0 + +moreinput: mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + call execcommand + cmp al,0 + jz moreinput + +endmon: call getridoftemp + call getridoftempcharset + mov es,textfile1 + call deallocatemem + mov es,textfile2 + call deallocatemem + mov es,textfile3 + call deallocatemem + mov getback,1 + mov al,26 + call playchannel1 + mov manisoffscreen,0 + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + ret + + endp + + + + + + +Printoutermon proc near + + mov di,40 + mov bx,32 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,264 + mov bx,32 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + mov di,40 + mov bx,12 + mov ds,tempgraphics + mov al,3 + mov ah,0 + call showframe + mov di,40 + mov bx,164 + mov ds,tempgraphics + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Loadpersonal proc near + + mov al,location + mov dx,offset cs:monitorfile1 + cmp al,0 + jz foundpersonal + cmp al,42 + jz foundpersonal + mov dx,offset cs:monitorfile2 + cmp al,2 + jz foundpersonal + +foundpersonal: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile1,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + +Loadnews proc near ;textfile2 holds information + ;accessable by anyone + mov al,newsitem + mov dx,offset cs:monitorfile10 + cmp al,0 + jz foundnews + mov dx,offset cs:monitorfile11 + cmp al,1 + jz foundnews + mov dx,offset cs:monitorfile12 + cmp al,2 + jz foundnews + mov dx,offset cs:monitorfile13 +foundnews: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile2,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Loadcart proc near + + call lookininterface + + mov dx,offset cs:monitorfile20 + cmp al,0 + jz gotcart + mov dx,offset cs:monitorfile21 + cmp al,1 + jz gotcart + mov dx,offset cs:monitorfile22 + cmp al,2 + jz gotcart + mov dx,offset cs:monitorfile23 + cmp al,3 + jz gotcart + mov dx,offset cs:monitorfile24 +gotcart: call openfile + call readheader + mov bx,[es:di] + push bx + mov cl,4 + shr bx,cl + call allocatemem + mov textfile3,ax + mov ds,ax + pop cx + mov dx,0 + call readfromfile + call closefile + ret + + endp + + + + + + +Lookininterface proc near + + mov al,"I" + mov ah,"N" + mov cl,"T" + mov ch,"F" + call findsetobject ;this bit searches set obs + ;until the interface is found + ;al holds object number + mov ah,1 ;ah holds type, 1=set object + call checkinside ;this searches for any extra + ;object inside the interface.. + cmp cl,numexobjects + jz emptyinterface + mov al,[es:bx+15] ;get the last letter of ID code + inc al + ret +emptyinterface: mov al,0 + ret + + endp + + + + + + + +Turnonpower proc near + + mov cx,3 +powerloop: push cx + call powerlighton + mov cx,30 + call hangon + call powerlightoff + mov cx,30 + call hangon + pop cx + loop powerloop + call powerlighton + ret + + endp + + + + + +Randomaccess proc near + +accessloop: push cx + call vsync + call vsync + call randomnum1 + and al,15 + cmp al,10 + jc off + call accesslighton + jmp chosenaccess +off: call accesslightoff +chosenaccess: pop cx + loop accessloop + call accesslightoff + ret + + endp + + + +Powerlighton proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,6 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Powerlightoff proc near + + mov di,257+4 + mov bx,182 + mov ds,tempgraphics + mov al,5 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslighton proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,8 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Accesslightoff proc near + + mov di,74 + mov bx,182 + mov ds,tempgraphics + mov al,7 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + +Locklighton proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,10 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + +Locklightoff proc near + + mov di,56 + mov bx,182 + mov ds,tempgraphics + mov al,9 + mov ah,0 + push di bx + call showframe + pop bx di + mov cl,12 + mov ch,8 + call multidump + ret + + endp + + + + + + + + + + +Input proc near + + push cs + pop es + mov di,offset cs:inputline + mov cx,64 + mov al,0 + rep stosb + + mov curpos,0 + mov al,">" + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + mov di,monadx + mov bx,monady + mov cl,6 + mov ch,8 + call multidump + add monadx,6 + mov ax,monadx + mov curslocx,ax + mov ax,monady + mov curslocy,ax + +waitkey: call printcurs + call vsync + call delcurs + call readkey + mov al,currentkey + cmp al,0 + jz waitkey + cmp al,13 + jz endofinput + cmp al,8 + jnz notdel + cmp curpos,0 + jz waitkey + call delchar + jmp waitkey +notdel: cmp curpos,28 + jz waitkey + cmp currentkey,32 + jnz notleadingspace + cmp curpos,0 + jz waitkey +notleadingspace: call makecaps + push cs + pop es + mov si,curpos + add si,si + add si,offset cs:inputline + mov [es:si],al + + cmp al,"Z"+1 + jnc waitkey + + push ax es si + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiget + pop si es ax + + push es si + mov di,monadx + mov bx,monady + mov ds,tempcharset + mov ah,0 + call printchar + pop si es + ;dec cx + mov [es:si+1],cl + mov ch,0 + add monadx,cx + inc curpos + add curslocx,cx + jmp waitkey + +endofinput: ret + + endp + + + + + + + + +Makecaps proc near + + cmp al,"a" + jc notupperc + sub al,32 +notupperc: ret + + endp + + + + + + + + + +Delchar proc near + + dec curpos + mov si,curpos + add si,si + push cs + pop es + add si,offset cs:inputline + mov byte ptr [es:si],0 + mov al,[es:si+1] + mov ah,0 + sub monadx,ax + sub curslocx,ax + mov di,monadx + mov bx,monady + mov ds,mapstore + mov ax,curpos + xchg al,ah + mov si,ax + mov cl,8 + mov ch,8 + call multiput + mov di,monadx + mov bx,monady + mov cl,al + mov ch,8 + call multidump + ret + + endp + + + + + + + +Execcommand proc near + + push cs + pop es + mov bx,offset cs:comlist + push cs + pop ds + mov si,offset cs:inputline + mov al,[si] + cmp al,0 + jnz notblankinp + call scrollmonitor + ret + +notblankinp: mov cl,0 +comloop: push bx si +comloop2: mov al,[si] + add si,2 + mov ah,[es:bx] + inc bx + cmp ah,32 + jz foundcom + cmp al,ah + jz comloop2 + pop si bx + add bx,10 + inc cl + cmp cl,6 + jnz comloop + call neterror + mov al,0 + ret +foundcom: pop si bx + cmp cl,1 + jz testcom + cmp cl,2 + jz directory + cmp cl,3 + jz accesscom + cmp cl,4 + jz signoncom + cmp cl,5 + jz keyscom + jmp quitcom + +directory: call dircom + mov al,0 + ret + +signoncom: call signon + mov al,0 + ret + +accesscom: call read + mov al,0 + ret + +keyscom: call showkeys + mov al,0 + ret + +testcom: mov al,6 + call monmessage + mov al,0 + ret + +quitcom: mov al,1 + ret + +comlist: db "EXIT " + db "HELP " + db "LIST " + db "READ " + db "LOGON " + db "KEYS " + +keys: db 1,0,"PUBLIC PUBLIC ",0 + db 0,0,"BLACKDRAGON RYAN ",0 + db 0,0,"HENDRIX LOUIS ",0 + db 0,0,"SEPTIMUS BECKETT ",0 + db 255,255 + +operand1: db " ",0 +rootdir: db 34,"ROOT ",0 +currentfile db 34," ",0 + + endp + + + + + + + +Neterror proc near + + mov al,5 + call monmessage + call scrollmonitor + ret + + endp + + + + + + + + + +Dircom proc near + + mov cx,30 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jz dirroot + call dirfile + ret + +dirroot: mov logonum,0 + push cs + pop ds + mov si,offset cs:rootdir + inc si + push cs + pop es + mov di,offset cs:currentfile + inc di + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + + mov al,9 + call monmessage + + mov es,textfile1 + call searchforfiles + mov es,textfile2 + call searchforfiles + mov es,textfile3 + call searchforfiles + + call scrollmonitor + ret + + endp + + + + + + +Searchforfiles proc near + + mov bx,textstart +directloop1: mov al,[es:bx] + inc bx + cmp al,"*" + jz endofdir + cmp al,34 + jnz directloop1 + call monprint + jmp directloop1 +endofdir: ret + + endp + + + + + + + + + + + + +Signon proc near + + call parser + inc di + push cs + pop ds + mov si,offset cs:keys + mov cx,4 +signonloop: push cx si di + add si,14 + mov cx,11 +signonloop2: lodsb + cmp al,32 + jz foundsign + call makecaps + mov ah,[es:di] + inc di + cmp al,ah + jnz nomatch + loop signonloop2 +nomatch: pop di si cx + add si,26 + loop signonloop + mov al,13 + call monmessage + ret + +foundsign: pop di si cx ;ds:si contains ad of key matched + mov bx,si + push ds + pop es ;now ds:si is in es:bx + + cmp byte ptr [es:bx],0 + jz notyetassigned + + mov al,17 + call monmessage + ret + +notyetassigned: push es bx + call scrollmonitor + mov al,15 + call monmessage + mov di,monadx + mov bx,monady + push di bx + call input + pop bx di + mov monadx,di + mov monady,bx + pop bx es + push es bx + + add bx,2 + push cs + pop ds + mov si,offset cs:inputline +checkpass: lodsw + mov ah,[es:bx] + inc bx + ;cmp al,0 + cmp ah,32 + jz passpassed + cmp al,ah + jz checkpass +passerror: pop bx es + call scrollmonitor + mov al,16 + call monmessage + ret + +passpassed: mov al,14 + call monmessage + pop bx es + push es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov byte ptr [es:bx],1 + ret + + endp + + + + + + + +Showkeys proc near + + mov cx,10 + call randomaccess + call scrollmonitor + mov al,18 + call monmessage + + push cs + pop es + mov bx,offset cs:keys + mov cx,4 +keysloop: push cx bx + cmp byte ptr [es:bx],0 + jz notheld + add bx,14 + call monprint +notheld: pop bx cx + add bx,26 + loop keysloop + call scrollmonitor + ret + + endp + + + + + + + + + + + +Read proc near + + mov cx,40 + call randomaccess + call parser + cmp byte ptr [es:di+1],0 + jnz okcom + call neterror + ret +okcom: push cs + pop es + mov di,offset cs:currentfile + mov ax,textfile1 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile2 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov ax,textfile3 + mov monsource,ax + mov ds,ax + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile2 + mov al,7 + call monmessage + ret +foundfile2: call getkeyandlogo + cmp al,0 + jz keyok1 + ret +keyok1: push cs + pop es + mov di,offset cs:operand1 + mov ds,monsource + call searchforstring + cmp al,0 + jz findtopictext + mov al,oldlogonum + mov logonum,al + mov al,11 + call monmessage + ret + +findtopictext: inc bx + push es bx + call monitorlogo + call scrollmonitor + pop bx es +moretopic: call monprint + mov al,[es:bx] + cmp al,34 + jz endoftopic + cmp al,"=" + jz endoftopic + cmp al,"*" + jz endoftopic + push es bx + call processtrigger + mov cx,24 + call randomaccess + pop bx es + jmp moretopic + +endoftopic: call scrollmonitor + ret + + endp + + + + + + + + + +Dirfile proc near + + mov al,34 + mov [es:di],al + push es di ;save start point held in es:di + mov ds,textfile1 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile2 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + pop di es + push es di + mov ds,textfile3 + mov si,textstart + call searchforstring + cmp al,0 + jz foundfile + + pop di es + mov al,7 + call monmessage + ret + +foundfile: pop ax ax ;discard old values of es:di + call getkeyandlogo + cmp al,0 + jz keyok2 + ret + +keyok2: push es bx + push cs + pop ds + mov si,offset cs:operand1+1 + push cs + pop es + mov di,offset cs:currentfile+1 + mov cx,12 + rep movsb + call monitorlogo + call scrollmonitor + mov al,10 + call monmessage + pop bx es + + +directloop2: mov al,[es:bx] + inc bx + cmp al,34 + jz endofdir2 + cmp al,"*" + jz endofdir2 + cmp al,"=" + jnz directloop2 + call monprint + jmp directloop2 + +endofdir2: call scrollmonitor + ret + + endp + + + + + + +Getkeyandlogo proc near + + inc bx + mov al,[es:bx] + sub al,48 + mov newlogonum,al + add bx,2 + mov al,[es:bx] + sub al,48 + mov keynum,al + inc bx + push es bx + mov al,keynum + mov ah,0 + mov cx,26 + mul cx + push cs + pop es + mov bx,offset cs:keys + add bx,ax + mov al,[es:bx] + cmp al,1 + jz keyok + push bx es + mov al,12 + call monmessage + pop es bx + add bx,14 + call monprint + call scrollmonitor + pop bx es + mov al,1 + ret + +keyok: pop bx es + mov al,newlogonum + mov logonum,al + mov al,0 + ret + + endp + + + + + + + + + +Searchforstring proc near ;finds string at es:di in + ;text at ds:si + + mov dl,[es:di] ;needs to know first character + ;if it's an equals then we must + ;stop at the next quotation mark + mov cx,di ;need to remember starting point + +restartlook: mov di,cx + mov bx,si + + mov dh,0 ;dh holds count of brackets + ;brackets are either " or = +keeplooking: lodsb + call makecaps + cmp al,"*" + jz notfound + cmp dl,"=" + jnz nofindingtopic ;are we looking for a topic? + cmp al,34 ;if YES, check we haven't reached + jz notfound ;the end of this file. +nofindingtopic: mov ah,[es:di] + cmp al,dl ;all searches bracketed by same thing + jnz notbracket + inc dh + cmp dh,2 + jz complete +notbracket: cmp al,ah + jnz restartlook + inc di + jmp keeplooking +complete: push ds ;es:bx returns found string + pop es + mov al,0 + mov bx,si + ret +notfound: mov al,1 + ret + + endp + + + + + + +Parser proc near + + push cs + pop es + mov di,offset cs:operand1 + mov cx,13 + mov al,0 + rep stosb + + mov di,offset cs:operand1 + mov al,"=" + stosb + + push cs + pop ds + mov si,offset cs:inputline + +notspace1: lodsw + cmp al,32 + jz stillspace1 + cmp al,0 + jnz notspace1 + jmp finishpars + +stillspace1: lodsw + cmp al,32 + jz stillspace1 + +copyin1: stosb + lodsw + cmp al,0 + jz finishpars + cmp al,32 + jnz copyin1 + +finishpars: mov di,offset cs:operand1 + ret + + endp + + + + + + +Scrollmonitor proc near + + push ax bx cx dx di si es ds + + call printlogo + mov di,monadx + mov bx,monady + call printundermon + mov ax,monady + call worktoscreen + mov al,25 + call playchannel1 + + pop ds es si di dx cx bx ax + ret + + endp + + + + + + + + + + + + + + +Lockmon proc near + + cmp lasthardkey,57 + jnz notlock + call locklighton +lockloop: cmp lasthardkey,57 + jz lockloop + call locklightoff +notlock: ret + + endp + + + + + +Monitorlogo proc near + + mov al,logonum + cmp al,oldlogonum + jz notnewlogo + mov oldlogonum,al + ;call fadedownmon + call printlogo + call printundermon + call worktoscreen + call printlogo + ;call fadeupmon + call printlogo + mov al,26 + call playchannel1 + mov cx,20 + call randomaccess + ret +notnewlogo: call printlogo + ret + + endp + + + + + + + + +Printlogo proc near + + mov di,56 + mov bx,32 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + call showcurrentfile + ret + + endp + + + + + + +Showcurrentfile proc near + + mov di,178 ;99 + mov bx,37 + mov si,offset cs:currentfile+1 +curfileloop: mov al,[cs:si] + cmp al,0 + jz finishfile + inc si + push si + if foreign + call modifychar + endif + mov ds,tempcharset + mov ah,0 + call printchar + pop si + jmp curfileloop +finishfile: ret + + endp + + + + + + + + + +Monmessage proc near + + mov es,textfile1 + mov bx,textstart + mov cl,al + mov ch,0 +monmessageloop: mov al,[es:bx] + inc bx + cmp al,"+" + jnz monmessageloop + loop monmessageloop + call monprint + ret + + endp + + + + + + +Processtrigger proc near + + cmp lasttrigger,"1" + jnz notfirsttrigger + mov al,8 + call setlocation + mov al,45 + call triggermessage + ret + +notfirsttrigger: cmp lasttrigger,"2" + jnz notsecondtrigger + mov al,9 + call setlocation + mov al,55 + call triggermessage + ret + +notsecondtrigger: cmp lasttrigger,"3" + jnz notthirdtrigger + mov al,2 + call setlocation + mov al,59 + call triggermessage + +notthirdtrigger: ret + + endp + + + + +Triggermessage proc near + + push ax + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiget + pop ax + call findpuztext + mov di,174 + mov bx,156 + mov dl,141 + mov ah,16 + call printdirect + mov cx,140 + call hangon + call worktoscreen + mov cx,340 + call hangon + mov di,174 + mov bx,153 + mov cl,200 + mov ch,63 + mov ds,mapstore + mov si,0 + call multiput + call worktoscreen + mov lasttrigger,0 + ret + + endp + + + + + + +Printcurs proc near + + push si di ds dx bx es + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + mov ds,buffers + mov si,textunder + push di bx + call multiget + pop bx di + + push bx di + inc maintimer + mov ax,maintimer + and al,16 + jnz flashcurs + mov al,"/" + sub al,32 + mov ah,0 + mov ds,tempcharset + call showframe + +flashcurs: pop di bx + sub di,6 + mov cl,12 + if foreign + mov ch,11 + else + mov ch,8 + endif + call multidump + + pop es bx dx ds di si + ret + + endp + + + + + + +Delcurs proc near + + push es bx di ds dx si + mov di,curslocx + mov bx,curslocy + mov cl,6 + mov ch,8 + if foreign + sub bx,3 + mov ch,11 + endif + push di bx cx + mov ds,buffers + mov si,textunder + call multiput + pop cx bx di + call multidump +finishcurdel: + pop si dx ds di bx es + ret + + endp + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm index 8a1e97367c..cac6e100a7 100644 --- a/devtools/tasmrecover/dreamweb/newplace.asm +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -1,581 +1,581 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;----------------------------------------------------Choosing a new location---- - -Newplace proc near - - cmp needtotravel,1 - jz istravel - cmp autolocation,-1 - jnz isautoloc - ret - -isautoloc: mov al,autolocation - mov newlocation,al - mov autolocation,-1 - ret - -istravel: mov needtotravel,0 - call selectlocation - ret - - endp - - - - -Selectlocation proc near - - mov inmaparea,0 - call clearbeforeload - mov getback,0 - mov pointerframe,22 - - call readcitypic - call showcity - call getridoftemp - call readdesticon - call loadtraveltext - call showpanel - call showman - call showarrows - call showexit - call locationpic - call undertextline - mov commandtype,255 - call readmouse - mov pointerframe,0 - call showpointer - call worktoscreen - mov al,9 - mov ah,255 - call playchannel0 - mov newlocation,255 - -select: call delpointer - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - cmp getback,1 - jz quittravel - mov bx,offset cs:destlist - call checkcoords - cmp newlocation,255 - jz select - mov al,newlocation - cmp al,location - jz quittravel - - call getridoftemp - call getridoftemp2 - call getridoftemp3 - mov es,traveltext - call deallocatemem - ret - -quittravel: mov al,reallocation ; was just location - mov newlocation,al - mov getback,0 - call getridoftemp - call getridoftemp2 - call getridoftemp3 - mov es,traveltext - call deallocatemem - ret - -destlist: dw 238,258,4,44,nextdest - dw 104,124,4,44,lastdest - dw 280,308,4,44,lookatplace - dw 104,216,138,192,destselect - dw 273,320,157,198,getback1 - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - -Showcity proc near - - call clearwork - mov ds,tempgraphics - mov di,57 - mov bx,32 - mov al,0 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,120+57 - mov bx,32 - mov al,1 - mov ah,0 - call showframe - ret - - endp - - - - - -Lookatplace proc near - - cmp commandtype,224 - jz alreadyinfo - mov commandtype,224 - mov al,27 - call commandonly -alreadyinfo: mov ax,mousebutton - and ax,1 - jz noinfo - cmp ax,oldbutton - jz noinfo - - mov bl,destpos - cmp bl,15 - jnc noinfo - - push bx - call delpointer - call deltextline - call getundercentre - mov ds,tempgraphics3 - mov al,0 - mov ah,0 - mov di,60 - mov bx,72 - call showframe - mov al,4 - mov ah,0 - mov di,60 - mov bx,72+55 - call showframe - if foreign - mov al,4 - mov ah,0 - mov di,60 - mov bx,72+55+21 - call showframe - endif - pop bx - - mov bh,0 - add bx,bx - mov es,traveltext - mov si,[es:bx] - add si,textstart - call findnextcolon - - mov di,63 - if foreign - mov bx,84+4 - else - mov bx,84 - endif - mov dl,191 - mov al,0 - mov ah,0 - call printdirect - call worktoscreenm - - mov cx,500 - call hangonp - -afterinfo: mov pointermode,0 - mov pointerframe,0 - call putundercentre - call worktoscreenm - -noinfo: ret - - endp - - - - -Getundercentre proc near - - mov di,58 - mov bx,72 - mov ds,mapstore - mov si,0 - mov cl,254 - mov ch,110 - call multiget - ret - - endp - - - - - - - - - - -Putundercentre proc near - - mov di,58 - mov bx,72 - mov ds,mapstore - mov si,0 - mov cl,254 - mov ch,110 - call multiput - ret - - endp - - - - - - - -Locationpic proc near - - call getdestinfo - mov al,[es:si] - push es si - mov di,0 - cmp al,6 - jnc secondlot - mov ds,tempgraphics - add al,4 - jmp gotgraphic -secondlot: sub al,6 - mov ds,tempgraphics2 -gotgraphic: add di,104 - mov bx,138+14 - mov ah,0 - call showframe - pop si es - mov al,destpos - cmp al,reallocation - jnz notinthisone - mov al,3 - mov di,104 - mov bx,140+14 - mov ds,tempgraphics - mov ah,0 - call showframe -notinthisone: mov bl,destpos - mov bh,0 - add bx,bx - mov es,traveltext - mov si,[es:bx] - add si,textstart - mov di,50 - mov bx,20 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - ret - - endp - - - - -Getdestinfo proc near - - mov al,destpos - mov ah,0 - push ax - mov dx,seg roomscango - mov es,dx - mov si,offset es:roomscango - add si,ax - mov cl,[es:si] - pop ax - push cx - mov dx,seg roompics - mov es,dx - mov si,offset es:roompics - add si,ax - pop ax - ret - - endp - - - - - - -Showarrows proc near - - mov di,116-12 - mov bx,16 - mov ds,tempgraphics - mov al,0 - mov ah,0 - call showframe - mov di,226+12 - mov bx,16 - mov ds,tempgraphics - mov al,1 - mov ah,0 - call showframe - mov di,280 - mov bx,14 - mov ds,tempgraphics - mov al,2 - mov ah,0 - call showframe - ret - - endp - - - - - - - - - -Nextdest proc near - -duok: cmp commandtype,218 - jz alreadydu - mov commandtype,218 - mov al,28 - call commandonly -alreadydu: mov ax,mousebutton - and ax,1 - jz nodu - cmp ax,oldbutton - jz nodu - -searchdestup: inc destpos - cmp destpos,15 - jnz notlastdest - mov destpos,0 -notlastdest: call getdestinfo - cmp al,0 - jz searchdestup - - mov newtextline,1 - call deltextline - call delpointer - call showpanel - call showman - call showarrows - call locationpic - call undertextline - call readmouse - call showpointer - call worktoscreen - call delpointer -nodu: ret - - endp - - - - - - - -Lastdest proc near - -ddok: cmp commandtype,219 - jz alreadydd - mov commandtype,219 - mov al,29 - call commandonly -alreadydd: mov ax,mousebutton - and ax,1 - jz nodd - cmp ax,oldbutton - jz nodd - -searchdestdown: dec destpos - cmp destpos,-1 - jnz notfirstdest - mov destpos,15 -notfirstdest: call getdestinfo - cmp al,0 - jz searchdestdown - - mov newtextline,1 - call deltextline - call delpointer - call showpanel - call showman - call showarrows - call locationpic - call undertextline - call readmouse - call showpointer - call worktoscreen - call delpointer -nodd: ret - - endp - - - - - - - - -Destselect proc near - - cmp commandtype,222 - jz alreadytrav - mov commandtype,222 - mov al,30 - call commandonly -alreadytrav: mov ax,mousebutton - and ax,1 - jz notrav - cmp ax,oldbutton - jz notrav - - call getdestinfo - mov al,destpos - mov newlocation,al -notrav: ret - - endp - - - - - - - - - - - - - - - - - - - -Getlocation proc near - - mov ah,0 - mov bx,ax - mov dx,seg roomscango - mov es,dx - add bx,offset es:roomscango - mov al,[es:bx] - ret - - endp - - -Setlocation proc near ;makes a location accessable - - mov ah,0 - mov bx,ax - mov dx,seg roomscango - mov es,dx - add bx,offset es:roomscango - mov byte ptr [es:bx],1 - ret - - endp - - - - -Resetlocation proc near ;makes a location inaccessable - - push ax - cmp al,5 - jnz notdelhotel - call purgealocation - mov al,21 - call purgealocation - mov al,22 - call purgealocation - mov al,27 - call purgealocation - jmp clearedlocations - -notdelhotel: cmp al,8 - jnz notdeltvstud - call purgealocation - mov al,28 - call purgealocation - jmp clearedlocations - -notdeltvstud: cmp al,6 - jnz notdelsarters - call purgealocation - mov al,20 - call purgealocation - mov al,25 - call purgealocation - jmp clearedlocations - -notdelsarters: cmp al,13 - jnz notdelboathouse - call purgealocation - mov al,29 - call purgealocation - jmp clearedlocations - -notdelboathouse: - -clearedlocations: pop ax - mov ah,0 - mov bx,ax - mov dx,seg roomscango - mov es,dx - add bx,offset es:roomscango - mov byte ptr [es:bx],0 - ret - - endp - - - - -Readdesticon proc near - - mov dx,offset cs:travelgraphic1 - call loadintotemp - - mov dx,offset cs:travelgraphic2 - call loadintotemp2 - - mov dx,offset cs:icongraphics8 - call loadintotemp3 - ret - - endp - - - - -Readcitypic proc near - - mov dx,offset cs:cityname - call loadintotemp - ret - - endp - - - - - +;----------------------------------------------------Choosing a new location---- + +Newplace proc near + + cmp needtotravel,1 + jz istravel + cmp autolocation,-1 + jnz isautoloc + ret + +isautoloc: mov al,autolocation + mov newlocation,al + mov autolocation,-1 + ret + +istravel: mov needtotravel,0 + call selectlocation + ret + + endp + + + + +Selectlocation proc near + + mov inmaparea,0 + call clearbeforeload + mov getback,0 + mov pointerframe,22 + + call readcitypic + call showcity + call getridoftemp + call readdesticon + call loadtraveltext + call showpanel + call showman + call showarrows + call showexit + call locationpic + call undertextline + mov commandtype,255 + call readmouse + mov pointerframe,0 + call showpointer + call worktoscreen + mov al,9 + mov ah,255 + call playchannel0 + mov newlocation,255 + +select: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + cmp getback,1 + jz quittravel + mov bx,offset cs:destlist + call checkcoords + cmp newlocation,255 + jz select + mov al,newlocation + cmp al,location + jz quittravel + + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +quittravel: mov al,reallocation ; was just location + mov newlocation,al + mov getback,0 + call getridoftemp + call getridoftemp2 + call getridoftemp3 + mov es,traveltext + call deallocatemem + ret + +destlist: dw 238,258,4,44,nextdest + dw 104,124,4,44,lastdest + dw 280,308,4,44,lookatplace + dw 104,216,138,192,destselect + dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Showcity proc near + + call clearwork + mov ds,tempgraphics + mov di,57 + mov bx,32 + mov al,0 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,120+57 + mov bx,32 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + +Lookatplace proc near + + cmp commandtype,224 + jz alreadyinfo + mov commandtype,224 + mov al,27 + call commandonly +alreadyinfo: mov ax,mousebutton + and ax,1 + jz noinfo + cmp ax,oldbutton + jz noinfo + + mov bl,destpos + cmp bl,15 + jnc noinfo + + push bx + call delpointer + call deltextline + call getundercentre + mov ds,tempgraphics3 + mov al,0 + mov ah,0 + mov di,60 + mov bx,72 + call showframe + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55 + call showframe + if foreign + mov al,4 + mov ah,0 + mov di,60 + mov bx,72+55+21 + call showframe + endif + pop bx + + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + call findnextcolon + + mov di,63 + if foreign + mov bx,84+4 + else + mov bx,84 + endif + mov dl,191 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,500 + call hangonp + +afterinfo: mov pointermode,0 + mov pointerframe,0 + call putundercentre + call worktoscreenm + +noinfo: ret + + endp + + + + +Getundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiget + ret + + endp + + + + + + + + + + +Putundercentre proc near + + mov di,58 + mov bx,72 + mov ds,mapstore + mov si,0 + mov cl,254 + mov ch,110 + call multiput + ret + + endp + + + + + + + +Locationpic proc near + + call getdestinfo + mov al,[es:si] + push es si + mov di,0 + cmp al,6 + jnc secondlot + mov ds,tempgraphics + add al,4 + jmp gotgraphic +secondlot: sub al,6 + mov ds,tempgraphics2 +gotgraphic: add di,104 + mov bx,138+14 + mov ah,0 + call showframe + pop si es + mov al,destpos + cmp al,reallocation + jnz notinthisone + mov al,3 + mov di,104 + mov bx,140+14 + mov ds,tempgraphics + mov ah,0 + call showframe +notinthisone: mov bl,destpos + mov bh,0 + add bx,bx + mov es,traveltext + mov si,[es:bx] + add si,textstart + mov di,50 + mov bx,20 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + ret + + endp + + + + +Getdestinfo proc near + + mov al,destpos + mov ah,0 + push ax + mov dx,seg roomscango + mov es,dx + mov si,offset es:roomscango + add si,ax + mov cl,[es:si] + pop ax + push cx + mov dx,seg roompics + mov es,dx + mov si,offset es:roompics + add si,ax + pop ax + ret + + endp + + + + + + +Showarrows proc near + + mov di,116-12 + mov bx,16 + mov ds,tempgraphics + mov al,0 + mov ah,0 + call showframe + mov di,226+12 + mov bx,16 + mov ds,tempgraphics + mov al,1 + mov ah,0 + call showframe + mov di,280 + mov bx,14 + mov ds,tempgraphics + mov al,2 + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Nextdest proc near + +duok: cmp commandtype,218 + jz alreadydu + mov commandtype,218 + mov al,28 + call commandonly +alreadydu: mov ax,mousebutton + and ax,1 + jz nodu + cmp ax,oldbutton + jz nodu + +searchdestup: inc destpos + cmp destpos,15 + jnz notlastdest + mov destpos,0 +notlastdest: call getdestinfo + cmp al,0 + jz searchdestup + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodu: ret + + endp + + + + + + + +Lastdest proc near + +ddok: cmp commandtype,219 + jz alreadydd + mov commandtype,219 + mov al,29 + call commandonly +alreadydd: mov ax,mousebutton + and ax,1 + jz nodd + cmp ax,oldbutton + jz nodd + +searchdestdown: dec destpos + cmp destpos,-1 + jnz notfirstdest + mov destpos,15 +notfirstdest: call getdestinfo + cmp al,0 + jz searchdestdown + + mov newtextline,1 + call deltextline + call delpointer + call showpanel + call showman + call showarrows + call locationpic + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer +nodd: ret + + endp + + + + + + + + +Destselect proc near + + cmp commandtype,222 + jz alreadytrav + mov commandtype,222 + mov al,30 + call commandonly +alreadytrav: mov ax,mousebutton + and ax,1 + jz notrav + cmp ax,oldbutton + jz notrav + + call getdestinfo + mov al,destpos + mov newlocation,al +notrav: ret + + endp + + + + + + + + + + + + + + + + + + + +Getlocation proc near + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov al,[es:bx] + ret + + endp + + +Setlocation proc near ;makes a location accessable + + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],1 + ret + + endp + + + + +Resetlocation proc near ;makes a location inaccessable + + push ax + cmp al,5 + jnz notdelhotel + call purgealocation + mov al,21 + call purgealocation + mov al,22 + call purgealocation + mov al,27 + call purgealocation + jmp clearedlocations + +notdelhotel: cmp al,8 + jnz notdeltvstud + call purgealocation + mov al,28 + call purgealocation + jmp clearedlocations + +notdeltvstud: cmp al,6 + jnz notdelsarters + call purgealocation + mov al,20 + call purgealocation + mov al,25 + call purgealocation + jmp clearedlocations + +notdelsarters: cmp al,13 + jnz notdelboathouse + call purgealocation + mov al,29 + call purgealocation + jmp clearedlocations + +notdelboathouse: + +clearedlocations: pop ax + mov ah,0 + mov bx,ax + mov dx,seg roomscango + mov es,dx + add bx,offset es:roomscango + mov byte ptr [es:bx],0 + ret + + endp + + + + +Readdesticon proc near + + mov dx,offset cs:travelgraphic1 + call loadintotemp + + mov dx,offset cs:travelgraphic2 + call loadintotemp2 + + mov dx,offset cs:icongraphics8 + call loadintotemp3 + ret + + endp + + + + +Readcitypic proc near + + mov dx,offset cs:cityname + call loadintotemp + ret + + endp + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index 19265bb4ac..93710d3c23 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -1,2608 +1,2608 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;---------------------------------------------------------Inventory printer---- - -Fillryan proc near - ; cx=what to search for - mov es,buffers - mov di,ryaninvlist - call findallryan - mov si,ryaninvlist - mov al,ryanpage - mov ah,0 - mov cx,20 - mul cx - add si,ax - - mov di,inventx - mov bx,inventy - - mov cx,2 -ryanloop2: push cx di bx - mov cx,5 -ryanloop1: push cx di bx - mov ax,[es:si] - add si,2 - push si es - call obtoinv - pop es si - pop bx di cx - add di,itempicsize - loop ryanloop1 - pop bx di cx - add bx,itempicsize - loop ryanloop2 - - call showryanpage - ret - - endp - - - - - - - - - - - -Fillopen proc near - - call deltextline - - call getopenedsize ;find out how many slots - cmp ah,4 ;ah=slots, al=size holdable - jc lessthanapage - mov ah,4 -lessthanapage: mov al,1 - - push ax - mov es,buffers - mov di,openinvlist - call findallopen - mov si,openinvlist - mov di,inventx - mov bx,inventy+96 - pop cx - -openloop1: push cx di bx - mov ax,[es:si] - add si,2 - push si es - cmp ch,cl - jc nextopenslot - call obtoinv -nextopenslot: pop es si - pop bx di cx - add di,itempicsize - inc cl - cmp cl,5 - jnz openloop1 - - call undertextline - ret - - endp - - - - - - - - - - - - - - - - -Findallryan proc near - - push di - mov cx,30 - mov ax,0ffffh - rep stosw - pop di - - mov cl,4 - mov ds,extras - mov bx,exdata - mov ch,0 -findryanloop: cmp [bx+2],cl - jnz notinryaninv - cmp byte ptr [bx+3],255 - jnz notinryaninv - mov al,[bx+4] - mov ah,0 - push di - add di,ax - add di,ax - mov al,ch - mov ah,4 ;means it is an exchanged object ie:not free or set - stosw - pop di -notinryaninv: add bx,16 - inc ch - cmp ch,numexobjects - jnz findryanloop - ret - - endp - - - - - - - -Findallopen proc near - - push di - mov cx,16 - mov ax,0ffffh - rep stosw - pop di - - mov cl,openedob - mov dl,openedtype - mov ds,extras - mov bx,exdata - mov ch,0 -findopen1: cmp [bx+3],cl - jnz findopen2 - cmp [bx+2],dl - jnz findopen2 - cmp openedtype,4 - jz noloccheck - mov al,[bx+5] - cmp al,reallocation - jnz findopen2 -noloccheck: mov al,[bx+4] - mov ah,0 - push di - add di,ax - add di,ax - mov al,ch - mov ah,4 - stosw - pop di -findopen2: add bx,16 - inc ch - cmp ch,numexobjects - jnz findopen1 - - mov cl,openedob - mov dl,openedtype - push dx - mov ds,freedat - pop dx - mov bx,0 - mov ch,0 -findopen1a: cmp [bx+3],cl - jnz findopen2a - cmp [bx+2],dl - jnz findopen2a - mov al,[bx+4] - mov ah,0 - push di - add di,ax - add di,ax - mov al,ch - mov ah,2 ; means it's in a free ob - stosw - pop di -findopen2a: add bx,16 - inc ch - cmp ch,80 - jnz findopen1a - ret - - endp - - - - - - -Obtoinv proc near - - push bx es si ax - - push ax di bx - mov ds,icons1 - sub di,2 - sub bx,1 - mov al,10 - mov ah,0 - call showframe - pop bx di ax - cmp al,255 - jz finishfill - - push bx di ax - mov ds,extras - cmp ah,4 - jz isanextra - mov ds,freeframes -isanextra: mov cl,al - add al,al - add al,cl - inc al - mov ah,128 - add bx,19 - add di,18 - call showframe - pop ax di bx - - push bx - call getanyaddir - call isitworn - pop bx - jnz finishfill - mov ds,icons1 ;Print wearing logo - sub di,3 - sub bx,2 - mov al,7 - mov ah,0 - call showframe - -finishfill: pop ax si es bx - ret - - endp - - - - - -Isitworn proc near ;zero if yes - - mov al,[es:bx+12] - cmp al,"W"-"A" - jnz notworn - mov al,[es:bx+13] - cmp al,"E"-"A" -notworn: ret - - endp - - - -Makeworn proc near - - mov byte ptr [es:bx+12],"W"-"A" - mov byte ptr [es:bx+13],"E"-"A" - ret - - endp - - - - - - -;-------------------------------------------------------Examining an object---- - -Examineob proc near - - mov pointermode,0 - mov timecount,0 - -examineagain: mov inmaparea,0 - mov examagain,0 - mov openedob,255 - mov openedtype,255 - mov invopen,0 - mov al,commandtype - mov objecttype,al - mov itemframe,0 - mov pointerframe,0 - - call createpanel - call showpanel - call showman - call showexit - call obicons - call obpicture - call describeob - call undertextline - - mov commandtype,255 - call readmouse - call showpointer - call worktoscreen - call delpointer - -waitexam: ;call delpointer - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - call delpointer - - mov getback,0 - mov bx,offset cs:examlist - cmp invopen,0 - jz notuseinv - mov bx,offset cs:invlist1 - cmp invopen,1 - jz notuseinv - mov bx,offset cs:withlist1 -notuseinv: call checkcoords - cmp examagain,0 - jz norex - jmp examineagain -norex: cmp getback,0 - jz waitexam - - mov pickup,0 - cmp watchingtime,0 - jnz iswatching - cmp newlocation,255 - jnz justgetback - -iswatching: call makemainscreen - mov invopen,0 - mov openedob,255 - ret - -justgetback: mov invopen,0 - mov openedob,255 - ret - -examlist: dw 273,320,157,198,getbackfromob - dw 260,300,0,44,useobject - dw 210,254,0,44,selectopenob - dw 144,176,64,96,setpickup - dw 0,50,50,200,examinventory - dw 0,320,0,200,blank - dw 0ffffh - -invlist1: dw 273,320,157,198,getbackfromob - dw 255,294,0,24,dropobject - dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage - dw inventx -openchangesize: dw inventx+(4*itempicsize) - dw inventy+100,inventy+100+itempicsize,useopened - dw inventx,inventx+(5*itempicsize) - dw inventy,inventy+(2*itempicsize),intoinv - dw 0,320,0,200,blank - dw 0ffffh - -withlist1: dw 273,320,157,198,getbackfromob - dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage - dw inventx,inventx+(5*itempicsize) - dw inventy,inventy+(2*itempicsize),selectob - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - -Makemainscreen proc near - - call createpanel - mov newobs,1 - call drawfloor - call spriteupdate - call printsprites - call reelsonscreen - call showicon - call getunderzoom - call undertextline - mov commandtype,255 - call animpointer - call worktoscreenm - mov commandtype,200 - mov manisoffscreen,0 - ret - - endp - - - - -Getbackfromob proc near - - cmp pickup,1 - jnz notheldob - call blank - ret -notheldob: call getback1 - ret - - endp - - - - - - - - - - - - - - - - -Incryanpage proc near - - cmp commandtype,222 - jz alreadyincryan - mov commandtype,222 - mov al,31 - call commandonly -alreadyincryan: mov ax,mousebutton - cmp ax,oldbutton - jz noincryan - and ax,1 - jnz doincryan -noincryan: ret - -doincryan: mov ax,mousex - sub ax,inventx+167 - mov ryanpage,-1 -findnewpage: inc ryanpage - sub ax,18 - jnc findnewpage - call delpointer - call fillryan - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - -Openinv proc near - - mov invopen,1 - mov al,61 - mov di,inventx - mov bx,inventy-10 - mov dl,240 - call printmessage - call fillryan - mov commandtype,255 - ret - - endp - - - - - - - -Showryanpage proc near - - mov ds,icons1 - mov di,inventx+167 - mov bx,inventy-12 - mov al,12 - mov ah,0 - call showframe - - mov al,13 - add al,ryanpage - push ax - mov al,ryanpage - mov ah,0 - mov cx,18 - mul cx - mov ds,icons1 - mov di,inventx+167 - add di,ax - mov bx,inventy-12 - pop ax - mov ah,0 - call showframe - ret - - endp - - - - - - - - - -Openob proc near - - mov al,openedob - mov ah,openedtype - mov di,offset cs:commandline - call copyname - - mov di,inventx - mov bx,inventy+86 - mov al,62 - mov dl,240 - call printmessage - - mov di,lastxpos - add di,5 - mov bx,inventy+86 - push cs - pop es - mov si,offset cs:commandline - mov dl,220 - mov al,0 - mov ah,0 - call printdirect - - call fillopen - call getopenedsize - mov al,ah - mov ah,0 - mov cx,itempicsize - mul cx - add ax,inventx - mov bx,offset cs:openchangesize - mov [cs:bx],ax - ret - - endp - - - - - - -Obicons proc near - - mov al,command - call getanyad - cmp al,255 - jz cantopenit - - mov ds,icons2 - mov di,210 - mov bx,1 - mov al,4 - mov ah,0 - call showframe - -cantopenit: mov ds,icons2 - mov di,260 - mov bx,1 - mov al,1 - mov ah,0 - call showframe - ret - - endp - - - - - - - -Examicon proc near - - mov ds,icons2 - mov di,254 - mov bx,5 - mov al,3 - mov ah,0 - call showframe - ret - - endp - - - - - - - -Obpicture proc near - - mov al,command - mov ah,objecttype - cmp ah,1 - jz setframe - cmp ah,4 - jz exframe - - mov ds,freeframes - mov di,160 - mov bx,68 - mov cl,al - add al,al - add al,cl - inc al - mov ah,128 - call showframe - ret - -setframe: ret - -exframe: mov ds,extras - mov di,160 - mov bx,68 - mov cl,al - add al,al - add al,cl - inc al - mov ah,128 - call showframe - ret - - endp - - - - - - - - - - -Describeob proc near - - call getobtextstart - - mov di,33 - mov bx,92 - if foreign - cmp objecttype,1 - jnz notsetd - mov bx,82 -notsetd: endif - mov dl,241 - mov ah,16 - mov charshift,91+91 - call printdirect - mov charshift,0 - mov di,36 - mov bx,104 - if foreign - cmp objecttype,1 - jnz notsetd2 - mov bx,94 -notsetd2: endif - mov dl,241 - mov ah,0 - call printdirect - push bx - call obsthatdothings - pop bx - call additionaltext - ret - - - endp - - - - - -Additionaltext proc near - - add bx,10 - push bx - mov al,command - mov ah,objecttype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"E" - call compare - jz emptycup - mov al,command - mov ah,objecttype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"F" - call compare - jz fullcup - pop bx - ret -emptycup: mov al,40 - call findpuztext - pop bx - mov di,36 - mov dl,241 - mov ah,0 - call printdirect - ret -fullcup: mov al,39 - call findpuztext - pop bx - mov di,36 - mov dl,241 - mov ah,0 - call printdirect - ret - - endp - - - - - - - - - - - -Obsthatdothings proc near - - mov al,command - mov ah,objecttype - mov cl,"M" - mov ch,"E" - mov dl,"M" - mov dh,"B" - call compare - jnz notlouiscard - mov al,4 - call getlocation - cmp al,1 - jz seencard - mov al,4 - call setlocation - call lookatcard -seencard: ret -notlouiscard: ret - - endp - - - - - - - -Getobtextstart proc near - - mov es,freedesc - mov si,freetextdat - mov cx,freetext - cmp objecttype,2 - jz describe - mov es,setdesc - mov si,settextdat - mov cx,settext - cmp objecttype,1 - jz describe - mov es,extras - mov si,extextdat - mov cx,extext - -describe: mov al,command - mov ah,0 - add ax,ax - add si,ax - mov ax,[es:si] - add ax,cx - mov si,ax - mov bx,ax -tryagain: push si - call findnextcolon - mov al,[es:si] - mov cx,si - pop si - cmp objecttype,1 - jnz cantmakeoneup - cmp al,0 - jz findsometext - cmp al,":" - jz findsometext -cantmakeoneup: ret - -findsometext: call searchforsame - jmp tryagain - ret - - endp - - - - - - -Searchforsame proc near - - mov si,cx -searchagain: inc si - mov al,[es:bx] -search: cmp [es:si],al - jz gotstartletter - inc cx - inc si - cmp si,8000 ;arbitrary give-up - jc search ;counter. - mov si,bx - pop ax - ret - -gotstartletter: push bx si -keepchecking: inc si - inc bx - mov al,[es:bx] - mov ah,[es:si] - cmp al,":" - jz foundmatch - cmp al,0 - jz foundmatch - cmp al,ah - jz keepchecking - pop si bx - jmp searchagain - -foundmatch: pop si bx - ret - - endp - - - - - - - -;-----------------------------------------------------------Using an object---- - - - - - -Findnextcolon proc near - -isntcolon: mov al,[es:si] - inc si - cmp al,0 - jz endofcolon - cmp al,":" - jnz isntcolon -endofcolon: ret - - endp - - -;------------------------------------------------------Taking, dropping etc---- - - - - - - -Inventory proc near - - cmp mandead,1 - jz iswatchinv - cmp watchingtime,0 - jz notwatchinv -iswatchinv: call blank - ret -notwatchinv: cmp commandtype,239 - jz alreadyopinv - mov commandtype,239 - mov al,32 - call commandonly -alreadyopinv: mov ax,mousebutton - cmp ax,oldbutton - jz cantopinv - and ax,1 - jnz doopeninv -cantopinv: ret - -doopeninv: mov timecount,0 - mov pointermode,0 - mov inmaparea,0 - call animpointer - call createpanel - call showpanel - call examicon - call showman - call showexit - call undertextline - mov pickup,0 - mov invopen,2 - call openinv - call readmouse - call showpointer - call worktoscreen - call delpointer - mov openedob,255 - jmp waitexam ; very naughty! - - endp - - - - - - -Setpickup proc near - - cmp objecttype,1 - jz cantpick - cmp objecttype,3 - jz cantpick - call getanyad - mov al,[es:bx+2] - cmp al,4 - jnz canpick -cantpick: call blank - ret - -canpick: cmp commandtype,209 - jz alreadysp - mov commandtype,209 - - mov bl,command - mov bh,objecttype - mov al,33 - call commandwithob -alreadysp: mov ax,mousebutton - cmp ax,1 - jnz nosetpick - cmp ax,oldbutton - jnz dosetpick -nosetpick: ret - -dosetpick: call createpanel - call showpanel - call showman - call showexit - call examicon - mov pickup,1 - mov invopen,2 - cmp objecttype,4 - jz pickupexob - - mov al,command - mov itemframe,al - mov openedob,255 - call transfertoex - mov itemframe,al - mov objecttype,4 - call geteitherad - mov byte ptr [es:bx+2],20 ; means it is in transit - mov byte ptr [es:bx+3],255 - call openinv - call worktoscreenm - ret - -pickupexob: mov al,command - mov itemframe,al - mov openedob,255 - call openinv - call worktoscreenm - ret - - endp - - - - - -Examinventory proc near - - cmp commandtype,249 - jz alreadyexinv - mov commandtype,249 - mov al,32 - call commandonly -alreadyexinv: mov ax,mousebutton - and ax,1 - jnz doexinv - ret - -doexinv: call createpanel - call showpanel - call showman - call showexit - call examicon - mov pickup,0 - mov invopen,2 - call openinv - call worktoscreenm - ret - - endp - - - - - -Reexfrominv proc near - - call findinvpos - mov ax,[es:bx] - mov commandtype,ah - mov command,al - mov examagain,1 - mov pointermode,0 - ret - - endp - - - - - - - -Reexfromopen proc near - - ret - call findopenpos - mov ax,[es:bx] - mov commandtype,ah - mov command,al - mov examagain,1 - mov pointermode,0 - ret - - endp - - - - - - - - - - - - - - - - - - - -Swapwithinv proc near - - mov al,itemframe - mov ah,objecttype - cmp ax,oldsubject - jnz difsub7 - cmp commandtype,243 - jz alreadyswap1 - mov commandtype,243 - -difsub7: mov oldsubject,ax - mov bx,ax - mov al,34 - call commandwithob -alreadyswap1: mov ax,mousebutton - cmp ax,oldbutton - jz cantswap1 - and ax,1 - jnz doswap1 -cantswap1: ret - -doswap1: mov ah,objecttype - mov al,itemframe - push ax - - call findinvpos - mov ax,[es:bx] - mov itemframe,al - mov objecttype,ah - call geteitherad - mov byte ptr [es:bx+2],20 ; means unplaced object - mov byte ptr [es:bx+3],255 - mov bl,itemframe - mov bh,objecttype - - pop ax - mov objecttype,ah - mov itemframe,al - push bx - - call findinvpos ;NONE OF THIS IS NEEDED - call delpointer ;ONLY EXTRAS CAN BE IN - mov al,itemframe - call geteitherad - mov byte ptr [es:bx+2],4 - mov byte ptr [es:bx+3],255 - mov al,lastinvpos - mov [es:bx+4],al - - pop ax - mov objecttype,ah - mov itemframe,al - call fillryan - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - -Swapwithopen proc near - - mov al,itemframe - mov ah,objecttype - cmp ax,oldsubject - jnz difsub8 - cmp commandtype,242 - jz alreadyswap2 - mov commandtype,242 - -difsub8: mov oldsubject,ax - mov bx,ax - mov al,34 - call commandwithob -alreadyswap2: mov ax,mousebutton - cmp ax,oldbutton - jz cantswap2 - and ax,1 - jnz doswap2 -cantswap2: ret - -doswap2: call geteitherad - call isitworn - jnz notwornswap - call wornerror - ret -notwornswap: call delpointer - mov al,itemframe - cmp al,openedob - jnz isntsame2 - mov al,objecttype - cmp al,openedtype - jnz isntsame2 - call errormessage1 - ret - -isntsame2: call checkobjectsize - cmp al,0 - jz sizeok2 - ret - -sizeok2: mov ah,objecttype - mov al,itemframe - push ax - - call findopenpos - mov ax,[es:bx] - mov itemframe,al - mov objecttype,ah - - cmp ah,4 - jnz makeswapex - call geteitherad - mov byte ptr [es:bx+2],20 - mov byte ptr [es:bx+3],255 - jmp actuallyswap - -makeswapex: call transfertoex - mov itemframe,al - mov objecttype,4 - call geteitherad - mov byte ptr [es:bx+2],20 - mov byte ptr [es:bx+3],255 - -actuallyswap: mov bl,itemframe - mov bh,objecttype - pop ax - mov objecttype,ah - mov itemframe,al - push bx - - call findopenpos - call geteitherad - mov al,openedtype - mov byte ptr [es:bx+2],al - mov al,openedob - mov byte ptr [es:bx+3],al - mov al,lastinvpos - mov [es:bx+4],al - mov al,reallocation - mov [es:bx+5],al - - pop ax - mov objecttype,ah - mov itemframe,al - call fillopen - call fillryan - call undertextline - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - - -Intoinv proc near - - cmp pickup,0 - jnz notout - call outofinv - ret - -notout: call findinvpos - mov ax,[es:bx] - cmp al,255 - jz canplace1 - call swapwithinv - ret - -canplace1: mov al,itemframe - mov ah,objecttype - cmp ax,oldsubject - jnz difsub1 - cmp commandtype,220 - jz alreadyplce - mov commandtype,220 - -difsub1: mov oldsubject,ax - mov bx,ax - mov al,35 - call commandwithob -alreadyplce: mov ax,mousebutton - cmp ax,oldbutton - jz notletgo2 - and ax,1 - jnz doplace -notletgo2: ret - -doplace: call delpointer - mov al,itemframe - call getexad - mov byte ptr [es:bx+2],4 - mov byte ptr [es:bx+3],255 - mov al,lastinvpos - mov [es:bx+4],al - - mov pickup,0 - call fillryan - call readmouse - call showpointer - call outofinv - call worktoscreen - call delpointer - ret - - endp - - - - - - - -Deletetaken proc near ;gets rid of objects that were - ;transfered to exlist ages ago - mov es,freedat - mov ah,reallocation - mov ds,extras - mov si,exdata - - mov cx,numexobjects -takenloop: mov al,[si+11] - cmp al,ah - jnz notinhere - mov bl,[si+1] - mov bh,0 - add bx,bx - add bx,bx - add bx,bx - add bx,bx - mov byte ptr [es:bx+2],254 ; was 255 - -notinhere: add si,16 - loop takenloop - - ret - - endp - - - - - - -Outofinv proc near - - call findinvpos - mov ax,[es:bx] - cmp al,255 - jnz canpick2 - call blank - ret - -canpick2: mov bx,mousebutton - cmp bx,2 - jnz canpick2a - call reexfrominv - ret - -canpick2a: cmp ax,oldsubject - jnz difsub3 - cmp commandtype,221 - jz alreadygrab - mov commandtype,221 - -difsub3: mov oldsubject,ax - mov bx,ax - mov al,36 - call commandwithob -alreadygrab: mov ax,mousebutton - cmp ax,oldbutton - jz notletgo - and ax,1 - jnz dograb -notletgo: ret - -dograb: call delpointer - mov pickup,1 - call findinvpos - mov ax,[es:bx] - mov itemframe,al - mov objecttype,ah - call getexad - mov byte ptr [es:bx+2],20 ; means unplaced object - mov byte ptr [es:bx+3],255 - call fillryan - call readmouse - call showpointer - call intoinv - call worktoscreen - call delpointer - ret - - endp - - - - - -Getfreead proc near - - mov ah,0 - mov cl,4 - shl ax,cl - mov bx,ax - mov es,freedat - ret - - endp - - - - - - - - -Getexad proc near - - mov ah,0 - mov bx,16 - mul bx - mov bx,ax - mov es,extras - add bx,exdata - ret - - endp - - - - - - -Geteitherad proc near - - cmp objecttype,4 - jz isinexlist - mov al,itemframe - call getfreead - ret -isinexlist: mov al,itemframe - call getexad - ret - - endp - - - - - - -Getanyad proc near ;nearly same as above - ;but uses command - cmp objecttype,4 - jz isex - cmp objecttype,2 - jz isfree - mov al,command - call getsetad - mov ax,[es:bx+4] - ret -isfree: mov al,command - call getfreead - mov ax,[es:bx+7] - ret -isex: mov al,command - call getexad - mov ax,[es:bx+7] - ret - - endp - - - -Getanyaddir proc near ;nearly same as above - ;but uses ax - cmp ah,4 - jz isex3 - cmp ah,2 - jz isfree3 - call getsetad - ret -isfree3: call getfreead - ret -isex3: call getexad - ret - - endp - - - - - - -Getopenedsize proc near ;nearly same as above again - ;but finds ad of opened ob - cmp openedtype,4 - jz isex2 - cmp openedtype,2 - jz isfree2 - mov al,openedob - call getsetad - mov ax,[es:bx+3] - ret -isfree2: mov al,openedob - call getfreead - mov ax,[es:bx+7] - ret -isex2: mov al,openedob - call getexad - mov ax,[es:bx+7] - ret - - endp - - - - - - - - -Getsetad proc near - - mov ah,0 - mov bx,64 - mul bx - mov bx,ax - mov es,setdat - ret - - endp - - - - - - -Findinvpos proc near - - mov cx,mousex - sub cx,inventx - mov bx,-1 -findinv1: inc bx - sub cx,itempicsize - jnc findinv1 - - mov cx,mousey - sub cx,inventy - sub bx,5 -findinv2: add bx,5 - sub cx,itempicsize - jnc findinv2 - - mov al,ryanpage - mov ah,0 - mov cx,10 - mul cx - add bx,ax - - mov al,bl - mov lastinvpos,al - add bx,bx - - mov es,buffers - add bx,ryaninvlist - ret - - endp - - - - - - - - - -Findopenpos proc near - - mov cx,mousex - sub cx,inventx - mov bx,-1 -findopenp1: inc bx - sub cx,itempicsize - jnc findopenp1 - - mov al,bl - mov lastinvpos,al - - add bx,bx - mov es,buffers - add bx,openinvlist - ret - - endp - - - - - - - - - - - - -;--------------------------------------------------------Dropping an object---- - -Dropobject proc near - - cmp commandtype,223 - jz alreadydrop - mov commandtype,223 - cmp pickup,0 - jz blank - - mov bl,itemframe - mov bh,objecttype - mov al,37 - call commandwithob -alreadydrop: mov ax,mousebutton - cmp ax,oldbutton - jz nodrop - and ax,1 - jnz dodrop -nodrop: ret - -dodrop: call geteitherad - call isitworn - jnz nowornerror - call wornerror - ret -nowornerror: cmp reallocation,47 - jz nodrop2 - mov cl,ryanx - add cl,12 - mov ch,ryany - add ch,12 - call checkone - cmp cl,2 - jc nodroperror -nodrop2: call droperror - ret -nodroperror: cmp mapxsize,64 - jnz notinlift - cmp mapysize,64 - jnz notinlift - call droperror - ret -notinlift: mov al,itemframe - mov ah,4 - mov cl,"G" - mov ch,"U" - mov dl,"N" - mov dh,"A" - call compare - jz cantdrop - mov al,itemframe - mov ah,4 - mov cl,"S" - mov ch,"H" - mov dl,"L" - mov dh,"D" - call compare - jz cantdrop - mov objecttype,4 - mov al,itemframe - call getexad - mov byte ptr [es:bx+2],0 - mov al,ryanx - add al,4 - mov cl,4 - shr al,cl - add al,mapx - mov ah,ryany - add ah,8 - mov cl,4 - shr ah,cl - add ah,mapy - mov byte ptr [es:bx+3],al - mov byte ptr [es:bx+5],ah - mov al,ryanx - add al,4 - and al,15 - mov ah,ryany - add ah,8 - and ah,15 - mov byte ptr [es:bx+4],al - mov byte ptr [es:bx+6],ah - mov pickup,0 - mov al,reallocation - mov [es:bx],al - ret - - endp - - - - -Droperror proc near - - mov commandtype,255 - call delpointer - mov di,76 - mov bx,21 - mov al,56 - mov dl,240 - call printmessage - call worktoscreenm - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - mov commandtype,255 - call worktoscreenm - ret - - endp - - - - -Cantdrop proc near - - mov commandtype,255 - call delpointer - mov di,76 - mov bx,21 - mov al,24 - mov dl,240 - call printmessage - call worktoscreenm - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - mov commandtype,255 - call worktoscreenm - ret - - endp - - - -Wornerror proc near - - mov commandtype,255 - call delpointer - mov di,76 - mov bx,21 - mov al,57 - mov dl,240 - call printmessage - call worktoscreenm - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - mov commandtype,255 - call worktoscreenm - ret - - endp - - - - - - - - - - -Removeobfrominv proc near - - cmp command,100 - jz obnotexist - call getanyad - mov di,bx - mov cl,command - mov ch,0 - call deleteexobject - ;mov byte ptr [es:bx+2],0 -obnotexist: ret - - endp - - - - -;---------------------------------------------------------Opening an object---- - -Selectopenob proc near - - mov al,command - call getanyad - cmp al,255 - jnz canopenit1 - call blank - ret - -canopenit1: cmp commandtype,224 - jz alreadyopob - mov commandtype,224 - - mov bl,command - mov bh,objecttype - mov al,38 - call commandwithob -alreadyopob: mov ax,mousebutton - cmp ax,oldbutton - jz noopenob - and ax,1 - jnz doopenob -noopenob: ret - -doopenob: mov al,command - mov openedob,al - mov al,objecttype - mov openedtype,al - - call createpanel - call showpanel - call showman - call examicon - call showexit - call openinv - call openob - call undertextline - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - -Useopened proc near - - cmp openedob,255 - jz cannotuseopen - cmp pickup,0 - jnz notout2 - call outofopen - ret - -notout2: call findopenpos - mov ax,[es:bx] - cmp al,255 - jz canplace3 - call swapwithopen -cannotuseopen: ret - -canplace3: cmp pickup,1 - jz intoopen - call blank - ret - -intoopen: mov al,itemframe - mov ah,objecttype - cmp ax,oldsubject - jnz difsub2 - cmp commandtype,227 - jz alreadyplc2 - mov commandtype,227 - -difsub2: mov oldsubject,ax - mov bx,ax - mov al,35 - call commandwithob -alreadyplc2: mov ax,mousebutton - cmp ax,oldbutton - jz notletgo3 - cmp ax,1 - jz doplace2 -notletgo3: ret - -doplace2: call geteitherad - call isitworn - jnz notworntoopen - call wornerror - ret -notworntoopen: call delpointer - mov al,itemframe - cmp al,openedob - jnz isntsame - mov al,objecttype - cmp al,openedtype - jnz isntsame - call errormessage1 - ret - -isntsame: call checkobjectsize - cmp al,0 - jz sizeok1 - ret - -sizeok1: mov pickup,0 - mov al,itemframe - call geteitherad - mov al,openedtype - mov byte ptr [es:bx+2],al - mov al,openedob - mov byte ptr [es:bx+3],al - mov al,lastinvpos - mov [es:bx+4],al - mov al,reallocation - mov [es:bx+5],al - call fillopen - call undertextline - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - -Errormessage1 proc near - - call delpointer - mov di,76 - mov bx,21 - mov al,58 - mov dl,240 - call printmessage - call readmouse - call showpointer - call worktoscreen - call delpointer - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - -Errormessage2 proc near - - mov commandtype,255 - call delpointer - mov di,76 - mov bx,21 - mov al,59 - mov dl,240 - call printmessage - call readmouse - call showpointer - call worktoscreen - call delpointer - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - -Errormessage3 proc near - - call delpointer - mov di,76 - mov bx,21 - mov al,60 - mov dl,240 - call printmessage - call worktoscreenm - mov cx,50 - call hangonp - call showpanel - call showman - call examicon - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - -Checkobjectsize proc near - - call getopenedsize - push ax - mov al,itemframe - call geteitherad - mov al,[es:bx+9] - pop cx - - cmp al,255 ;gives a size of 6 if no - jnz notunsized ;size was defined in the editor - mov al,6 ;could be a bad idea -notunsized: - - - cmp al,100 - jnc specialcase - cmp cl,100 - jc isntspecial - call errormessage3 - jmp sizewrong -isntspecial: cmp cl,al - jnc sizeok -specialcase: sub al,100 - cmp cl,100 - jnc bothspecial - cmp cl,al - jnc sizeok - call errormessage2 - jmp sizewrong -bothspecial: sub cl,100 - cmp al,cl - jz sizeok - call errormessage3 -sizewrong: mov al,1 - ret -sizeok: mov al,0 - ret - - endp - - - - - - - - -Outofopen proc near - - cmp openedob,255 - jz cantuseopen - call findopenpos - mov ax,[es:bx] - cmp al,255 - jnz canpick4 -cantuseopen: call blank - ret - -canpick4: cmp ax,oldsubject - jnz difsub4 - cmp commandtype,228 - jz alreadygrb - mov commandtype,228 - -difsub4: mov oldsubject,ax - mov bx,ax - mov al,36 - call commandwithob -alreadygrb: mov ax,mousebutton - cmp ax,oldbutton - jz notletgo4 - cmp ax,1 - jz dogrb - cmp ax,2 - jnz notletgo4 - call reexfromopen -notletgo4: ret - -dogrb: call delpointer - mov pickup,1 - call findopenpos - mov ax,[es:bx] - mov itemframe,al - mov objecttype,ah - - cmp ah,4 - jnz makeintoex - call geteitherad - mov byte ptr [es:bx+2],20 ; means unplaced object - mov byte ptr [es:bx+3],255 - jmp actuallyout - -makeintoex: call transfertoex - mov itemframe,al - mov objecttype,4 - call geteitherad - mov byte ptr [es:bx+2],20 ; means it is in transit - mov byte ptr [es:bx+3],255 - -actuallyout: call fillopen - call undertextline - call readmouse - call useopened - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - -;All Extra object code - adding and removing plus purge routines ------------- - - - - - - -Transfertoex proc near - - call emergencypurge - - call getexpos - mov al,expos - push ax - - push di - mov al,itemframe - mov ah,0 - mov bx,16 - mul bx - mov ds,freedat - mov si,ax - mov cx,8 - rep movsw - pop di - - mov al,reallocation - mov [es:di],al - mov [es:di+11],al - mov al,itemframe - mov [es:di+1],al - mov byte ptr [es:di+2],4 - mov byte ptr [es:di+3],255 - mov al,lastinvpos - mov [es:di+4],al - - mov al,itemframe - mov itemtotran,al - call transfermap - call transferinv - call transfertext - - mov al,itemframe - mov ah,0 - mov bx,16 - mul bx - mov ds,freedat - mov si,ax - mov byte ptr [si+2],254 ; was 255 - call pickupconts - - pop ax - ret - - endp - - - - - - - - - - - - - - -Pickupconts proc near - - mov al,[si+7] - cmp al,255 - jz notopenable - - mov al,itemframe - mov ah,objecttype - mov dl,expos - ;dec dl - mov es,freedat - mov bx,0 - mov cx,0 -pickupcontloop: push cx es bx dx ax - - cmp byte ptr [es:bx+2],ah - jnz notinsidethis - cmp byte ptr [es:bx+3],al - jnz notinsidethis - - mov itemtotran,cl - call transfercontoex - -notinsidethis: pop ax dx bx es cx - add bx,16 - inc cx - cmp cx,80 - jnz pickupcontloop - -notopenable: ret - - endp - - - - - - - -Transfercontoex proc near - - push es bx - - push dx es bx - call getexpos - pop si ds - - push di - mov cx,8 - rep movsw - pop di - pop dx - - mov al,reallocation - mov [es:di],al - mov [es:di+11],al - mov al,itemtotran - mov [es:di+1],al - mov [es:di+3],dl - mov byte ptr [es:di+2],4 - - call transfermap - call transferinv - call transfertext - ;inc expos - - pop si ds - mov byte ptr [si+2],255 - ret - - endp - - - - - - - - - - - - - - - - - - -Transfertext proc near - - mov es,extras - mov al,expos - mov ah,0 - add ax,ax - mov bx,extextdat - add bx,ax - mov di,extextpos - mov [es:bx],di - add di,extext - - mov al,itemtotran - mov ah,0 - add ax,ax - mov ds,freedesc - mov bx,freetextdat - add bx,ax - mov si,freetext - mov ax,[bx] - add si,ax - -moretext: lodsb - stosb - inc extextpos - cmp al,0 - jnz moretext - ret - - endp - - - - - - - - - - -Getexpos proc near - - - mov es,extras - mov al,0 - mov di,exdata -tryanotherex: cmp byte ptr [es:di+2],255 - jz foundnewex - add di,16 - inc al - cmp al,numexobjects - jnz tryanotherex -foundnewex: mov expos,al - ret - - endp - - - - - - - - - -Purgealocation proc near - - push ax - mov es,extras - mov di,exdata - pop bx - mov cx,0 -purgeloc: cmp bl,[es:di+0] - jnz dontpurge - cmp byte ptr [es:di+2],0 - jnz dontpurge - push di es bx cx - call deleteexobject - pop cx bx es di -dontpurge: add di,16 - inc cx - cmp cx,numexobjects - jnz purgeloc - ret - - endp - - - - - -Emergencypurge proc near - -checkpurgeagain: mov ax,exframepos - add ax,4000 - cmp ax,exframeslen - jc notnearframeend - call purgeanitem - jmp checkpurgeagain -notnearframeend: mov ax,extextpos - add ax,400 - cmp ax,extextlen - jc notneartextend - call purgeanitem - jmp checkpurgeagain -notneartextend: ret - - endp - - - - - - -Purgeanitem proc near - - mov es,extras ;first time try and - mov di,exdata ;find an object in a - mov bl,reallocation ;location other than - mov cx,0 ;the one the player is -lookforpurge: mov al,[es:di+2] ;in - cmp al,0 - jnz cantpurge - cmp byte ptr [es:di+12],2 - jz iscup - cmp byte ptr [es:di+12],255 - jnz cantpurge -iscup: cmp byte ptr [es:di+11],bl - jz cantpurge - call deleteexobject - ret -cantpurge: add di,16 - inc cx - cmp cx,numexobjects - jnz lookforpurge - - mov di,exdata - mov bl,reallocation - mov cx,0 -lookforpurge2: mov al,[es:di+2] - cmp al,0 - jnz cantpurge2 - cmp byte ptr [es:di+12],255 - jnz cantpurge2 - call deleteexobject - ret -cantpurge2: add di,16 - inc cx - cmp cx,numexobjects - jnz lookforpurge2 - ret - - endp - - - - - -Deleteexobject proc near ;es:di holds data ad - ;cx holds number - push cx cx cx cx - mov al,255 - mov cx,16 - rep stosb - pop ax - mov cl,al - add al,al - add al,cl - call deleteexframe - pop ax - mov cl,al - add al,al - add al,cl - inc al - call deleteexframe - pop ax - call deleteextext - - pop bx - mov bh,bl - mov bl,4 - mov di,exdata - mov cx,0 -deleteconts: cmp [es:di+2],bx - jnz notinsideex - push bx cx di - call deleteexobject ;Oooh missus! - pop di cx bx ;Recursive code! -notinsideex: add di,16 - inc cx - cmp cx,numexobjects - jnz deleteconts - ret - - endp - - - - - -Deleteexframe proc near ;al holds frame to delete - - mov di,exframedata - mov ah,0 - add ax,ax - add di,ax - add ax,ax - add di,ax - mov al,[es:di] - mov ah,0 - mov cl,[es:di+1] - mov ch,0 - mul cx ;ax holds size of this - ;frame in bytes - mov si,[es:di+2] - push si - add si,exframes - mov cx,exframeslen - sub cx,[es:di+2] - mov di,si ;di/si hold start of frame - add si,ax ;si holds end of frame - push ax - push es - pop ds - rep movsb - pop bx ;bx holds size now - sub exframepos,bx - pop si ;si holds start of frame - ;(offset only) - mov cx,numexobjects*3 - mov di,exframedata -shuffleadsdown: mov ax,[es:di+2] - cmp ax,si - jc beforethisone - sub ax,bx -beforethisone: mov [es:di+2],ax - add di,6 - loop shuffleadsdown - ret - - endp - - - - -Deleteextext proc near - - mov di,extextdat - mov ah,0 - add ax,ax - add di,ax - mov ax,[es:di] - mov si,ax - mov di,ax - add si,extext - add di,extext - mov ax,0 -findlenextext: mov cl,[es:si] - inc ax - inc si - cmp cl,0 - jnz findlenextext - - mov cx,extextlen - mov bx,si - sub bx,extext - push bx ax - sub cx,bx - rep movsb - pop bx - sub extextpos,bx - - pop si - mov cx,numexobjects - mov di,extextdat -shuffletextads: mov ax,[es:di] - cmp ax,si - jc beforethistext - sub ax,bx -beforethistext: mov [es:di],ax - add di,2 - loop shuffletextads - ret - - endp - - - - - +;---------------------------------------------------------Inventory printer---- + +Fillryan proc near + ; cx=what to search for + mov es,buffers + mov di,ryaninvlist + call findallryan + mov si,ryaninvlist + mov al,ryanpage + mov ah,0 + mov cx,20 + mul cx + add si,ax + + mov di,inventx + mov bx,inventy + + mov cx,2 +ryanloop2: push cx di bx + mov cx,5 +ryanloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + call obtoinv + pop es si + pop bx di cx + add di,itempicsize + loop ryanloop1 + pop bx di cx + add bx,itempicsize + loop ryanloop2 + + call showryanpage + ret + + endp + + + + + + + + + + + +Fillopen proc near + + call deltextline + + call getopenedsize ;find out how many slots + cmp ah,4 ;ah=slots, al=size holdable + jc lessthanapage + mov ah,4 +lessthanapage: mov al,1 + + push ax + mov es,buffers + mov di,openinvlist + call findallopen + mov si,openinvlist + mov di,inventx + mov bx,inventy+96 + pop cx + +openloop1: push cx di bx + mov ax,[es:si] + add si,2 + push si es + cmp ch,cl + jc nextopenslot + call obtoinv +nextopenslot: pop es si + pop bx di cx + add di,itempicsize + inc cl + cmp cl,5 + jnz openloop1 + + call undertextline + ret + + endp + + + + + + + + + + + + + + + + +Findallryan proc near + + push di + mov cx,30 + mov ax,0ffffh + rep stosw + pop di + + mov cl,4 + mov ds,extras + mov bx,exdata + mov ch,0 +findryanloop: cmp [bx+2],cl + jnz notinryaninv + cmp byte ptr [bx+3],255 + jnz notinryaninv + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 ;means it is an exchanged object ie:not free or set + stosw + pop di +notinryaninv: add bx,16 + inc ch + cmp ch,numexobjects + jnz findryanloop + ret + + endp + + + + + + + +Findallopen proc near + + push di + mov cx,16 + mov ax,0ffffh + rep stosw + pop di + + mov cl,openedob + mov dl,openedtype + mov ds,extras + mov bx,exdata + mov ch,0 +findopen1: cmp [bx+3],cl + jnz findopen2 + cmp [bx+2],dl + jnz findopen2 + cmp openedtype,4 + jz noloccheck + mov al,[bx+5] + cmp al,reallocation + jnz findopen2 +noloccheck: mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,4 + stosw + pop di +findopen2: add bx,16 + inc ch + cmp ch,numexobjects + jnz findopen1 + + mov cl,openedob + mov dl,openedtype + push dx + mov ds,freedat + pop dx + mov bx,0 + mov ch,0 +findopen1a: cmp [bx+3],cl + jnz findopen2a + cmp [bx+2],dl + jnz findopen2a + mov al,[bx+4] + mov ah,0 + push di + add di,ax + add di,ax + mov al,ch + mov ah,2 ; means it's in a free ob + stosw + pop di +findopen2a: add bx,16 + inc ch + cmp ch,80 + jnz findopen1a + ret + + endp + + + + + + +Obtoinv proc near + + push bx es si ax + + push ax di bx + mov ds,icons1 + sub di,2 + sub bx,1 + mov al,10 + mov ah,0 + call showframe + pop bx di ax + cmp al,255 + jz finishfill + + push bx di ax + mov ds,extras + cmp ah,4 + jz isanextra + mov ds,freeframes +isanextra: mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + add bx,19 + add di,18 + call showframe + pop ax di bx + + push bx + call getanyaddir + call isitworn + pop bx + jnz finishfill + mov ds,icons1 ;Print wearing logo + sub di,3 + sub bx,2 + mov al,7 + mov ah,0 + call showframe + +finishfill: pop ax si es bx + ret + + endp + + + + + +Isitworn proc near ;zero if yes + + mov al,[es:bx+12] + cmp al,"W"-"A" + jnz notworn + mov al,[es:bx+13] + cmp al,"E"-"A" +notworn: ret + + endp + + + +Makeworn proc near + + mov byte ptr [es:bx+12],"W"-"A" + mov byte ptr [es:bx+13],"E"-"A" + ret + + endp + + + + + + +;-------------------------------------------------------Examining an object---- + +Examineob proc near + + mov pointermode,0 + mov timecount,0 + +examineagain: mov inmaparea,0 + mov examagain,0 + mov openedob,255 + mov openedtype,255 + mov invopen,0 + mov al,commandtype + mov objecttype,al + mov itemframe,0 + mov pointerframe,0 + + call createpanel + call showpanel + call showman + call showexit + call obicons + call obpicture + call describeob + call undertextline + + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + +waitexam: ;call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + + mov getback,0 + mov bx,offset cs:examlist + cmp invopen,0 + jz notuseinv + mov bx,offset cs:invlist1 + cmp invopen,1 + jz notuseinv + mov bx,offset cs:withlist1 +notuseinv: call checkcoords + cmp examagain,0 + jz norex + jmp examineagain +norex: cmp getback,0 + jz waitexam + + mov pickup,0 + cmp watchingtime,0 + jnz iswatching + cmp newlocation,255 + jnz justgetback + +iswatching: call makemainscreen + mov invopen,0 + mov openedob,255 + ret + +justgetback: mov invopen,0 + mov openedob,255 + ret + +examlist: dw 273,320,157,198,getbackfromob + dw 260,300,0,44,useobject + dw 210,254,0,44,selectopenob + dw 144,176,64,96,setpickup + dw 0,50,50,200,examinventory + dw 0,320,0,200,blank + dw 0ffffh + +invlist1: dw 273,320,157,198,getbackfromob + dw 255,294,0,24,dropobject + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx +openchangesize: dw inventx+(4*itempicsize) + dw inventy+100,inventy+100+itempicsize,useopened + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),intoinv + dw 0,320,0,200,blank + dw 0ffffh + +withlist1: dw 273,320,157,198,getbackfromob + dw inventx+167,inventx+167+(18*3),inventy-18,inventy-2,incryanpage + dw inventx,inventx+(5*itempicsize) + dw inventy,inventy+(2*itempicsize),selectob + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Makemainscreen proc near + + call createpanel + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov commandtype,255 + call animpointer + call worktoscreenm + mov commandtype,200 + mov manisoffscreen,0 + ret + + endp + + + + +Getbackfromob proc near + + cmp pickup,1 + jnz notheldob + call blank + ret +notheldob: call getback1 + ret + + endp + + + + + + + + + + + + + + + + +Incryanpage proc near + + cmp commandtype,222 + jz alreadyincryan + mov commandtype,222 + mov al,31 + call commandonly +alreadyincryan: mov ax,mousebutton + cmp ax,oldbutton + jz noincryan + and ax,1 + jnz doincryan +noincryan: ret + +doincryan: mov ax,mousex + sub ax,inventx+167 + mov ryanpage,-1 +findnewpage: inc ryanpage + sub ax,18 + jnc findnewpage + call delpointer + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Openinv proc near + + mov invopen,1 + mov al,61 + mov di,inventx + mov bx,inventy-10 + mov dl,240 + call printmessage + call fillryan + mov commandtype,255 + ret + + endp + + + + + + + +Showryanpage proc near + + mov ds,icons1 + mov di,inventx+167 + mov bx,inventy-12 + mov al,12 + mov ah,0 + call showframe + + mov al,13 + add al,ryanpage + push ax + mov al,ryanpage + mov ah,0 + mov cx,18 + mul cx + mov ds,icons1 + mov di,inventx+167 + add di,ax + mov bx,inventy-12 + pop ax + mov ah,0 + call showframe + ret + + endp + + + + + + + + + +Openob proc near + + mov al,openedob + mov ah,openedtype + mov di,offset cs:commandline + call copyname + + mov di,inventx + mov bx,inventy+86 + mov al,62 + mov dl,240 + call printmessage + + mov di,lastxpos + add di,5 + mov bx,inventy+86 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + call fillopen + call getopenedsize + mov al,ah + mov ah,0 + mov cx,itempicsize + mul cx + add ax,inventx + mov bx,offset cs:openchangesize + mov [cs:bx],ax + ret + + endp + + + + + + +Obicons proc near + + mov al,command + call getanyad + cmp al,255 + jz cantopenit + + mov ds,icons2 + mov di,210 + mov bx,1 + mov al,4 + mov ah,0 + call showframe + +cantopenit: mov ds,icons2 + mov di,260 + mov bx,1 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Examicon proc near + + mov ds,icons2 + mov di,254 + mov bx,5 + mov al,3 + mov ah,0 + call showframe + ret + + endp + + + + + + + +Obpicture proc near + + mov al,command + mov ah,objecttype + cmp ah,1 + jz setframe + cmp ah,4 + jz exframe + + mov ds,freeframes + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + +setframe: ret + +exframe: mov ds,extras + mov di,160 + mov bx,68 + mov cl,al + add al,al + add al,cl + inc al + mov ah,128 + call showframe + ret + + endp + + + + + + + + + + +Describeob proc near + + call getobtextstart + + mov di,33 + mov bx,92 + if foreign + cmp objecttype,1 + jnz notsetd + mov bx,82 +notsetd: endif + mov dl,241 + mov ah,16 + mov charshift,91+91 + call printdirect + mov charshift,0 + mov di,36 + mov bx,104 + if foreign + cmp objecttype,1 + jnz notsetd2 + mov bx,94 +notsetd2: endif + mov dl,241 + mov ah,0 + call printdirect + push bx + call obsthatdothings + pop bx + call additionaltext + ret + + + endp + + + + + +Additionaltext proc near + + add bx,10 + push bx + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz emptycup + mov al,command + mov ah,objecttype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz fullcup + pop bx + ret +emptycup: mov al,40 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret +fullcup: mov al,39 + call findpuztext + pop bx + mov di,36 + mov dl,241 + mov ah,0 + call printdirect + ret + + endp + + + + + + + + + + + +Obsthatdothings proc near + + mov al,command + mov ah,objecttype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jnz notlouiscard + mov al,4 + call getlocation + cmp al,1 + jz seencard + mov al,4 + call setlocation + call lookatcard +seencard: ret +notlouiscard: ret + + endp + + + + + + + +Getobtextstart proc near + + mov es,freedesc + mov si,freetextdat + mov cx,freetext + cmp objecttype,2 + jz describe + mov es,setdesc + mov si,settextdat + mov cx,settext + cmp objecttype,1 + jz describe + mov es,extras + mov si,extextdat + mov cx,extext + +describe: mov al,command + mov ah,0 + add ax,ax + add si,ax + mov ax,[es:si] + add ax,cx + mov si,ax + mov bx,ax +tryagain: push si + call findnextcolon + mov al,[es:si] + mov cx,si + pop si + cmp objecttype,1 + jnz cantmakeoneup + cmp al,0 + jz findsometext + cmp al,":" + jz findsometext +cantmakeoneup: ret + +findsometext: call searchforsame + jmp tryagain + ret + + endp + + + + + + +Searchforsame proc near + + mov si,cx +searchagain: inc si + mov al,[es:bx] +search: cmp [es:si],al + jz gotstartletter + inc cx + inc si + cmp si,8000 ;arbitrary give-up + jc search ;counter. + mov si,bx + pop ax + ret + +gotstartletter: push bx si +keepchecking: inc si + inc bx + mov al,[es:bx] + mov ah,[es:si] + cmp al,":" + jz foundmatch + cmp al,0 + jz foundmatch + cmp al,ah + jz keepchecking + pop si bx + jmp searchagain + +foundmatch: pop si bx + ret + + endp + + + + + + + +;-----------------------------------------------------------Using an object---- + + + + + +Findnextcolon proc near + +isntcolon: mov al,[es:si] + inc si + cmp al,0 + jz endofcolon + cmp al,":" + jnz isntcolon +endofcolon: ret + + endp + + +;------------------------------------------------------Taking, dropping etc---- + + + + + + +Inventory proc near + + cmp mandead,1 + jz iswatchinv + cmp watchingtime,0 + jz notwatchinv +iswatchinv: call blank + ret +notwatchinv: cmp commandtype,239 + jz alreadyopinv + mov commandtype,239 + mov al,32 + call commandonly +alreadyopinv: mov ax,mousebutton + cmp ax,oldbutton + jz cantopinv + and ax,1 + jnz doopeninv +cantopinv: ret + +doopeninv: mov timecount,0 + mov pointermode,0 + mov inmaparea,0 + call animpointer + call createpanel + call showpanel + call examicon + call showman + call showexit + call undertextline + mov pickup,0 + mov invopen,2 + call openinv + call readmouse + call showpointer + call worktoscreen + call delpointer + mov openedob,255 + jmp waitexam ; very naughty! + + endp + + + + + + +Setpickup proc near + + cmp objecttype,1 + jz cantpick + cmp objecttype,3 + jz cantpick + call getanyad + mov al,[es:bx+2] + cmp al,4 + jnz canpick +cantpick: call blank + ret + +canpick: cmp commandtype,209 + jz alreadysp + mov commandtype,209 + + mov bl,command + mov bh,objecttype + mov al,33 + call commandwithob +alreadysp: mov ax,mousebutton + cmp ax,1 + jnz nosetpick + cmp ax,oldbutton + jnz dosetpick +nosetpick: ret + +dosetpick: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,1 + mov invopen,2 + cmp objecttype,4 + jz pickupexob + + mov al,command + mov itemframe,al + mov openedob,255 + call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + call openinv + call worktoscreenm + ret + +pickupexob: mov al,command + mov itemframe,al + mov openedob,255 + call openinv + call worktoscreenm + ret + + endp + + + + + +Examinventory proc near + + cmp commandtype,249 + jz alreadyexinv + mov commandtype,249 + mov al,32 + call commandonly +alreadyexinv: mov ax,mousebutton + and ax,1 + jnz doexinv + ret + +doexinv: call createpanel + call showpanel + call showman + call showexit + call examicon + mov pickup,0 + mov invopen,2 + call openinv + call worktoscreenm + ret + + endp + + + + + +Reexfrominv proc near + + call findinvpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + +Reexfromopen proc near + + ret + call findopenpos + mov ax,[es:bx] + mov commandtype,ah + mov command,al + mov examagain,1 + mov pointermode,0 + ret + + endp + + + + + + + + + + + + + + + + + + + +Swapwithinv proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub7 + cmp commandtype,243 + jz alreadyswap1 + mov commandtype,243 + +difsub7: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap1: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap1 + and ax,1 + jnz doswap1 +cantswap1: ret + +doswap1: mov ah,objecttype + mov al,itemframe + push ax + + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + mov bl,itemframe + mov bh,objecttype + + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findinvpos ;NONE OF THIS IS NEEDED + call delpointer ;ONLY EXTRAS CAN BE IN + mov al,itemframe + call geteitherad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillryan + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Swapwithopen proc near + + mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub8 + cmp commandtype,242 + jz alreadyswap2 + mov commandtype,242 + +difsub8: mov oldsubject,ax + mov bx,ax + mov al,34 + call commandwithob +alreadyswap2: mov ax,mousebutton + cmp ax,oldbutton + jz cantswap2 + and ax,1 + jnz doswap2 +cantswap2: ret + +doswap2: call geteitherad + call isitworn + jnz notwornswap + call wornerror + ret +notwornswap: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame2 + mov al,objecttype + cmp al,openedtype + jnz isntsame2 + call errormessage1 + ret + +isntsame2: call checkobjectsize + cmp al,0 + jz sizeok2 + ret + +sizeok2: mov ah,objecttype + mov al,itemframe + push ax + + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeswapex + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + jmp actuallyswap + +makeswapex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 + mov byte ptr [es:bx+3],255 + +actuallyswap: mov bl,itemframe + mov bh,objecttype + pop ax + mov objecttype,ah + mov itemframe,al + push bx + + call findopenpos + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + + pop ax + mov objecttype,ah + mov itemframe,al + call fillopen + call fillryan + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + +Intoinv proc near + + cmp pickup,0 + jnz notout + call outofinv + ret + +notout: call findinvpos + mov ax,[es:bx] + cmp al,255 + jz canplace1 + call swapwithinv + ret + +canplace1: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub1 + cmp commandtype,220 + jz alreadyplce + mov commandtype,220 + +difsub1: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplce: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo2 + and ax,1 + jnz doplace +notletgo2: ret + +doplace: call delpointer + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],4 + mov byte ptr [es:bx+3],255 + mov al,lastinvpos + mov [es:bx+4],al + + mov pickup,0 + call fillryan + call readmouse + call showpointer + call outofinv + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Deletetaken proc near ;gets rid of objects that were + ;transfered to exlist ages ago + mov es,freedat + mov ah,reallocation + mov ds,extras + mov si,exdata + + mov cx,numexobjects +takenloop: mov al,[si+11] + cmp al,ah + jnz notinhere + mov bl,[si+1] + mov bh,0 + add bx,bx + add bx,bx + add bx,bx + add bx,bx + mov byte ptr [es:bx+2],254 ; was 255 + +notinhere: add si,16 + loop takenloop + + ret + + endp + + + + + + +Outofinv proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canpick2 + call blank + ret + +canpick2: mov bx,mousebutton + cmp bx,2 + jnz canpick2a + call reexfrominv + ret + +canpick2a: cmp ax,oldsubject + jnz difsub3 + cmp commandtype,221 + jz alreadygrab + mov commandtype,221 + +difsub3: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrab: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo + and ax,1 + jnz dograb +notletgo: ret + +dograb: call delpointer + mov pickup,1 + call findinvpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + call getexad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + call fillryan + call readmouse + call showpointer + call intoinv + call worktoscreen + call delpointer + ret + + endp + + + + + +Getfreead proc near + + mov ah,0 + mov cl,4 + shl ax,cl + mov bx,ax + mov es,freedat + ret + + endp + + + + + + + + +Getexad proc near + + mov ah,0 + mov bx,16 + mul bx + mov bx,ax + mov es,extras + add bx,exdata + ret + + endp + + + + + + +Geteitherad proc near + + cmp objecttype,4 + jz isinexlist + mov al,itemframe + call getfreead + ret +isinexlist: mov al,itemframe + call getexad + ret + + endp + + + + + + +Getanyad proc near ;nearly same as above + ;but uses command + cmp objecttype,4 + jz isex + cmp objecttype,2 + jz isfree + mov al,command + call getsetad + mov ax,[es:bx+4] + ret +isfree: mov al,command + call getfreead + mov ax,[es:bx+7] + ret +isex: mov al,command + call getexad + mov ax,[es:bx+7] + ret + + endp + + + +Getanyaddir proc near ;nearly same as above + ;but uses ax + cmp ah,4 + jz isex3 + cmp ah,2 + jz isfree3 + call getsetad + ret +isfree3: call getfreead + ret +isex3: call getexad + ret + + endp + + + + + + +Getopenedsize proc near ;nearly same as above again + ;but finds ad of opened ob + cmp openedtype,4 + jz isex2 + cmp openedtype,2 + jz isfree2 + mov al,openedob + call getsetad + mov ax,[es:bx+3] + ret +isfree2: mov al,openedob + call getfreead + mov ax,[es:bx+7] + ret +isex2: mov al,openedob + call getexad + mov ax,[es:bx+7] + ret + + endp + + + + + + + + +Getsetad proc near + + mov ah,0 + mov bx,64 + mul bx + mov bx,ax + mov es,setdat + ret + + endp + + + + + + +Findinvpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findinv1: inc bx + sub cx,itempicsize + jnc findinv1 + + mov cx,mousey + sub cx,inventy + sub bx,5 +findinv2: add bx,5 + sub cx,itempicsize + jnc findinv2 + + mov al,ryanpage + mov ah,0 + mov cx,10 + mul cx + add bx,ax + + mov al,bl + mov lastinvpos,al + add bx,bx + + mov es,buffers + add bx,ryaninvlist + ret + + endp + + + + + + + + + +Findopenpos proc near + + mov cx,mousex + sub cx,inventx + mov bx,-1 +findopenp1: inc bx + sub cx,itempicsize + jnc findopenp1 + + mov al,bl + mov lastinvpos,al + + add bx,bx + mov es,buffers + add bx,openinvlist + ret + + endp + + + + + + + + + + + + +;--------------------------------------------------------Dropping an object---- + +Dropobject proc near + + cmp commandtype,223 + jz alreadydrop + mov commandtype,223 + cmp pickup,0 + jz blank + + mov bl,itemframe + mov bh,objecttype + mov al,37 + call commandwithob +alreadydrop: mov ax,mousebutton + cmp ax,oldbutton + jz nodrop + and ax,1 + jnz dodrop +nodrop: ret + +dodrop: call geteitherad + call isitworn + jnz nowornerror + call wornerror + ret +nowornerror: cmp reallocation,47 + jz nodrop2 + mov cl,ryanx + add cl,12 + mov ch,ryany + add ch,12 + call checkone + cmp cl,2 + jc nodroperror +nodrop2: call droperror + ret +nodroperror: cmp mapxsize,64 + jnz notinlift + cmp mapysize,64 + jnz notinlift + call droperror + ret +notinlift: mov al,itemframe + mov ah,4 + mov cl,"G" + mov ch,"U" + mov dl,"N" + mov dh,"A" + call compare + jz cantdrop + mov al,itemframe + mov ah,4 + mov cl,"S" + mov ch,"H" + mov dl,"L" + mov dh,"D" + call compare + jz cantdrop + mov objecttype,4 + mov al,itemframe + call getexad + mov byte ptr [es:bx+2],0 + mov al,ryanx + add al,4 + mov cl,4 + shr al,cl + add al,mapx + mov ah,ryany + add ah,8 + mov cl,4 + shr ah,cl + add ah,mapy + mov byte ptr [es:bx+3],al + mov byte ptr [es:bx+5],ah + mov al,ryanx + add al,4 + and al,15 + mov ah,ryany + add ah,8 + and ah,15 + mov byte ptr [es:bx+4],al + mov byte ptr [es:bx+6],ah + mov pickup,0 + mov al,reallocation + mov [es:bx],al + ret + + endp + + + + +Droperror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,56 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + +Cantdrop proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,24 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + +Wornerror proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,57 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + mov commandtype,255 + call worktoscreenm + ret + + endp + + + + + + + + + + +Removeobfrominv proc near + + cmp command,100 + jz obnotexist + call getanyad + mov di,bx + mov cl,command + mov ch,0 + call deleteexobject + ;mov byte ptr [es:bx+2],0 +obnotexist: ret + + endp + + + + +;---------------------------------------------------------Opening an object---- + +Selectopenob proc near + + mov al,command + call getanyad + cmp al,255 + jnz canopenit1 + call blank + ret + +canopenit1: cmp commandtype,224 + jz alreadyopob + mov commandtype,224 + + mov bl,command + mov bh,objecttype + mov al,38 + call commandwithob +alreadyopob: mov ax,mousebutton + cmp ax,oldbutton + jz noopenob + and ax,1 + jnz doopenob +noopenob: ret + +doopenob: mov al,command + mov openedob,al + mov al,objecttype + mov openedtype,al + + call createpanel + call showpanel + call showman + call examicon + call showexit + call openinv + call openob + call undertextline + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Useopened proc near + + cmp openedob,255 + jz cannotuseopen + cmp pickup,0 + jnz notout2 + call outofopen + ret + +notout2: call findopenpos + mov ax,[es:bx] + cmp al,255 + jz canplace3 + call swapwithopen +cannotuseopen: ret + +canplace3: cmp pickup,1 + jz intoopen + call blank + ret + +intoopen: mov al,itemframe + mov ah,objecttype + cmp ax,oldsubject + jnz difsub2 + cmp commandtype,227 + jz alreadyplc2 + mov commandtype,227 + +difsub2: mov oldsubject,ax + mov bx,ax + mov al,35 + call commandwithob +alreadyplc2: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo3 + cmp ax,1 + jz doplace2 +notletgo3: ret + +doplace2: call geteitherad + call isitworn + jnz notworntoopen + call wornerror + ret +notworntoopen: call delpointer + mov al,itemframe + cmp al,openedob + jnz isntsame + mov al,objecttype + cmp al,openedtype + jnz isntsame + call errormessage1 + ret + +isntsame: call checkobjectsize + cmp al,0 + jz sizeok1 + ret + +sizeok1: mov pickup,0 + mov al,itemframe + call geteitherad + mov al,openedtype + mov byte ptr [es:bx+2],al + mov al,openedob + mov byte ptr [es:bx+3],al + mov al,lastinvpos + mov [es:bx+4],al + mov al,reallocation + mov [es:bx+5],al + call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + +Errormessage1 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,58 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Errormessage2 proc near + + mov commandtype,255 + call delpointer + mov di,76 + mov bx,21 + mov al,59 + mov dl,240 + call printmessage + call readmouse + call showpointer + call worktoscreen + call delpointer + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + +Errormessage3 proc near + + call delpointer + mov di,76 + mov bx,21 + mov al,60 + mov dl,240 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call showpanel + call showman + call examicon + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + +Checkobjectsize proc near + + call getopenedsize + push ax + mov al,itemframe + call geteitherad + mov al,[es:bx+9] + pop cx + + cmp al,255 ;gives a size of 6 if no + jnz notunsized ;size was defined in the editor + mov al,6 ;could be a bad idea +notunsized: + + + cmp al,100 + jnc specialcase + cmp cl,100 + jc isntspecial + call errormessage3 + jmp sizewrong +isntspecial: cmp cl,al + jnc sizeok +specialcase: sub al,100 + cmp cl,100 + jnc bothspecial + cmp cl,al + jnc sizeok + call errormessage2 + jmp sizewrong +bothspecial: sub cl,100 + cmp al,cl + jz sizeok + call errormessage3 +sizewrong: mov al,1 + ret +sizeok: mov al,0 + ret + + endp + + + + + + + + +Outofopen proc near + + cmp openedob,255 + jz cantuseopen + call findopenpos + mov ax,[es:bx] + cmp al,255 + jnz canpick4 +cantuseopen: call blank + ret + +canpick4: cmp ax,oldsubject + jnz difsub4 + cmp commandtype,228 + jz alreadygrb + mov commandtype,228 + +difsub4: mov oldsubject,ax + mov bx,ax + mov al,36 + call commandwithob +alreadygrb: mov ax,mousebutton + cmp ax,oldbutton + jz notletgo4 + cmp ax,1 + jz dogrb + cmp ax,2 + jnz notletgo4 + call reexfromopen +notletgo4: ret + +dogrb: call delpointer + mov pickup,1 + call findopenpos + mov ax,[es:bx] + mov itemframe,al + mov objecttype,ah + + cmp ah,4 + jnz makeintoex + call geteitherad + mov byte ptr [es:bx+2],20 ; means unplaced object + mov byte ptr [es:bx+3],255 + jmp actuallyout + +makeintoex: call transfertoex + mov itemframe,al + mov objecttype,4 + call geteitherad + mov byte ptr [es:bx+2],20 ; means it is in transit + mov byte ptr [es:bx+3],255 + +actuallyout: call fillopen + call undertextline + call readmouse + call useopened + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + +;All Extra object code - adding and removing plus purge routines ------------- + + + + + + +Transfertoex proc near + + call emergencypurge + + call getexpos + mov al,expos + push ax + + push di + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov cx,8 + rep movsw + pop di + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemframe + mov [es:di+1],al + mov byte ptr [es:di+2],4 + mov byte ptr [es:di+3],255 + mov al,lastinvpos + mov [es:di+4],al + + mov al,itemframe + mov itemtotran,al + call transfermap + call transferinv + call transfertext + + mov al,itemframe + mov ah,0 + mov bx,16 + mul bx + mov ds,freedat + mov si,ax + mov byte ptr [si+2],254 ; was 255 + call pickupconts + + pop ax + ret + + endp + + + + + + + + + + + + + + +Pickupconts proc near + + mov al,[si+7] + cmp al,255 + jz notopenable + + mov al,itemframe + mov ah,objecttype + mov dl,expos + ;dec dl + mov es,freedat + mov bx,0 + mov cx,0 +pickupcontloop: push cx es bx dx ax + + cmp byte ptr [es:bx+2],ah + jnz notinsidethis + cmp byte ptr [es:bx+3],al + jnz notinsidethis + + mov itemtotran,cl + call transfercontoex + +notinsidethis: pop ax dx bx es cx + add bx,16 + inc cx + cmp cx,80 + jnz pickupcontloop + +notopenable: ret + + endp + + + + + + + +Transfercontoex proc near + + push es bx + + push dx es bx + call getexpos + pop si ds + + push di + mov cx,8 + rep movsw + pop di + pop dx + + mov al,reallocation + mov [es:di],al + mov [es:di+11],al + mov al,itemtotran + mov [es:di+1],al + mov [es:di+3],dl + mov byte ptr [es:di+2],4 + + call transfermap + call transferinv + call transfertext + ;inc expos + + pop si ds + mov byte ptr [si+2],255 + ret + + endp + + + + + + + + + + + + + + + + + + +Transfertext proc near + + mov es,extras + mov al,expos + mov ah,0 + add ax,ax + mov bx,extextdat + add bx,ax + mov di,extextpos + mov [es:bx],di + add di,extext + + mov al,itemtotran + mov ah,0 + add ax,ax + mov ds,freedesc + mov bx,freetextdat + add bx,ax + mov si,freetext + mov ax,[bx] + add si,ax + +moretext: lodsb + stosb + inc extextpos + cmp al,0 + jnz moretext + ret + + endp + + + + + + + + + + +Getexpos proc near + + + mov es,extras + mov al,0 + mov di,exdata +tryanotherex: cmp byte ptr [es:di+2],255 + jz foundnewex + add di,16 + inc al + cmp al,numexobjects + jnz tryanotherex +foundnewex: mov expos,al + ret + + endp + + + + + + + + + +Purgealocation proc near + + push ax + mov es,extras + mov di,exdata + pop bx + mov cx,0 +purgeloc: cmp bl,[es:di+0] + jnz dontpurge + cmp byte ptr [es:di+2],0 + jnz dontpurge + push di es bx cx + call deleteexobject + pop cx bx es di +dontpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz purgeloc + ret + + endp + + + + + +Emergencypurge proc near + +checkpurgeagain: mov ax,exframepos + add ax,4000 + cmp ax,exframeslen + jc notnearframeend + call purgeanitem + jmp checkpurgeagain +notnearframeend: mov ax,extextpos + add ax,400 + cmp ax,extextlen + jc notneartextend + call purgeanitem + jmp checkpurgeagain +notneartextend: ret + + endp + + + + + + +Purgeanitem proc near + + mov es,extras ;first time try and + mov di,exdata ;find an object in a + mov bl,reallocation ;location other than + mov cx,0 ;the one the player is +lookforpurge: mov al,[es:di+2] ;in + cmp al,0 + jnz cantpurge + cmp byte ptr [es:di+12],2 + jz iscup + cmp byte ptr [es:di+12],255 + jnz cantpurge +iscup: cmp byte ptr [es:di+11],bl + jz cantpurge + call deleteexobject + ret +cantpurge: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge + + mov di,exdata + mov bl,reallocation + mov cx,0 +lookforpurge2: mov al,[es:di+2] + cmp al,0 + jnz cantpurge2 + cmp byte ptr [es:di+12],255 + jnz cantpurge2 + call deleteexobject + ret +cantpurge2: add di,16 + inc cx + cmp cx,numexobjects + jnz lookforpurge2 + ret + + endp + + + + + +Deleteexobject proc near ;es:di holds data ad + ;cx holds number + push cx cx cx cx + mov al,255 + mov cx,16 + rep stosb + pop ax + mov cl,al + add al,al + add al,cl + call deleteexframe + pop ax + mov cl,al + add al,al + add al,cl + inc al + call deleteexframe + pop ax + call deleteextext + + pop bx + mov bh,bl + mov bl,4 + mov di,exdata + mov cx,0 +deleteconts: cmp [es:di+2],bx + jnz notinsideex + push bx cx di + call deleteexobject ;Oooh missus! + pop di cx bx ;Recursive code! +notinsideex: add di,16 + inc cx + cmp cx,numexobjects + jnz deleteconts + ret + + endp + + + + + +Deleteexframe proc near ;al holds frame to delete + + mov di,exframedata + mov ah,0 + add ax,ax + add di,ax + add ax,ax + add di,ax + mov al,[es:di] + mov ah,0 + mov cl,[es:di+1] + mov ch,0 + mul cx ;ax holds size of this + ;frame in bytes + mov si,[es:di+2] + push si + add si,exframes + mov cx,exframeslen + sub cx,[es:di+2] + mov di,si ;di/si hold start of frame + add si,ax ;si holds end of frame + push ax + push es + pop ds + rep movsb + pop bx ;bx holds size now + sub exframepos,bx + pop si ;si holds start of frame + ;(offset only) + mov cx,numexobjects*3 + mov di,exframedata +shuffleadsdown: mov ax,[es:di+2] + cmp ax,si + jc beforethisone + sub ax,bx +beforethisone: mov [es:di+2],ax + add di,6 + loop shuffleadsdown + ret + + endp + + + + +Deleteextext proc near + + mov di,extextdat + mov ah,0 + add ax,ax + add di,ax + mov ax,[es:di] + mov si,ax + mov di,ax + add si,extext + add di,extext + mov ax,0 +findlenextext: mov cl,[es:si] + inc ax + inc si + cmp cl,0 + jnz findlenextext + + mov cx,extextlen + mov bx,si + sub bx,extext + push bx ax + sub cx,bx + rep movsb + pop bx + sub extextpos,bx + + pop si + mov cx,numexobjects + mov di,extextdat +shuffletextads: mov ax,[es:di] + cmp ax,si + jc beforethistext + sub ax,bx +beforethistext: mov [es:di],ax + add di,2 + loop shuffletextads + ret + + endp + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm index 2dbf616efc..e1c2d451c9 100644 --- a/devtools/tasmrecover/dreamweb/print.asm +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -1,591 +1,591 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Printchar proc near - - cmp al,255 - jz ignoreit - push si bx di - if foreign - sub bx,3 - endif - push ax - sub al,32 ;"A" - mov ah,0 - add ax,charshift - call showframe - pop ax di bx si - cmp kerning,0 - jnz nokern - call kernchars -nokern: push cx - mov ch,0 - add di,cx - pop cx - ;dec di -ignoreit: ret - - endp - - - - - - - - - - -Kernchars proc near - - ;sub al,13 - cmp al,"a" - jz iskern - cmp al,"u" - jz iskern - ret -iskern: cmp ah,"n" - jz kernit - cmp ah,"t" - jz kernit - cmp ah,"r" - jz kernit - cmp ah,"i" - jz kernit - cmp ah,"l" - jz kernit - ret -kernit: dec cl - ret - - endp - - - - - - -;------------------------------------------------Proportional text printing---- - - -;Memprint proc near -; -; call usecharset1 -; -; push ax bx cx dx es ds si di -; call deltextline -; pop di si ds es dx cx bx ax -; -; pop si -; push cs -; pop es -; inc si -; mov ds,currentset -; mov di,textaddressx -; mov bx,textaddressy -; mov dl,textlen -; mov al,0 -; mov ah,0 -; call printdirect -; push si - -; mov newtextline,1 -; ret - -; endp - - - - - - -;------------------------------------------------Proportional text printing---- - -;Print proc near -; -; pop si -; mov bx,[cs:si+2] -; mov di,[cs:si+0] -; mov dl,[cs:si+4] -; add si,6 -; mov ds,currentset -; -;printloop2: push bx di dx -; push es cs -; pop es -; call getnumber -; pop es -; mov ch,0 -;printloop1: mov ax,[cs:si] -; inc si -; cmp al,0 -; jz finishprint -; push cx es -; call modifychar -; call printchar -; pop es cx -; loop printloop1 -; pop dx di bx -; add bx,linespacing -; jmp printloop2 - -;finishprint: pop dx di bx - ; push si - ; ret - - ; endp - - - - - - - - - -Printslow proc near - - mov pointerframe,1 - mov pointermode,3 - mov ds,charset1 -printloopslow6: push bx di dx - call getnumber - - mov ch,0 -printloopslow5: push cx si es - mov ax,[es:si] - push bx cx es si ds - if foreign - call modifychar - endif - call printboth - pop ds si es cx bx - mov ax,[es:si+1] - inc si - cmp al,0 - jz finishslow - cmp al,":" - jz finishslow - cmp cl,1 - jz afterslow - push di ds bx cx es si - if foreign - call modifychar - endif - mov charshift,91 - call printboth - mov charshift,0 - pop si es cx bx ds di - call waitframes - cmp ax,0 - jz keepgoing - cmp ax,oldbutton - jnz finishslow2 -keepgoing: call waitframes -noslow: cmp ax,0 - jz afterslow - cmp ax,oldbutton - jnz finishslow2 ;used to finish early -afterslow: pop es si cx - inc si - loop printloopslow5 - - pop dx di bx - add bx,10 - jmp printloopslow6 - -finishslow: pop es si cx dx di bx - mov al,0 - ret - -finishslow2: pop es si cx dx di bx - mov al,1 - ret - - endp - - - -Waitframes proc near - - push di bx es si ds - call readmouse - call showpointer - call vsync - call dumppointer - call delpointer - mov ax,mousebutton - pop ds si es bx di - ret - - endp - - - - -Printboth proc near - - push ax cx bx - push di - call printchar - pop ax - push di - mov di,ax - call multidump - pop di - pop bx cx ax - ret - - endp - - - - - - -Printdirect proc near - - mov lastxpos,di - mov ds,currentset -printloop6: push bx di dx - call getnumber - mov ch,0 -printloop5: mov ax,[es:si] - inc si - cmp al,0 - jz finishdirct - cmp al,":" - jz finishdirct - push cx es - if foreign - call modifychar - endif - call printchar - mov lastxpos,di - pop es cx - loop printloop5 - pop dx di bx - add bx,linespacing - jmp printloop6 - -finishdirct: pop dx di bx - ret - - endp - - - - - - - - - - - - - - -Monprint proc near - - mov kerning,1 - mov si,bx - mov dl,166 - mov di,monadx - mov bx,monady - mov ds,tempcharset - -printloop8: push bx di dx - call getnumber - mov ch,0 -printloop7: mov al,[es:si] - inc si - - cmp al,":" - jz finishmon2 - cmp al,0 - jz finishmon - cmp al,34 - jz finishmon - cmp al,"=" - jz finishmon - cmp al,"%" - jnz nottrigger - mov ah,[es:si] - inc si - inc si - jmp finishmon -nottrigger: push cx es - if foreign - call modifychar - endif - call printchar - mov curslocx,di - mov curslocy,bx - mov maintimer,1 - call printcurs - - call vsync - push si dx ds es bx di - call lockmon - pop di bx es ds dx si - call delcurs - pop es cx - loop printloop7 - -finishmon2: pop dx di bx - call scrollmonitor - mov curslocx,di - jmp printloop8 - -finishmon: pop dx di bx - cmp al,"%" - jnz nottrigger2 - mov lasttrigger,ah -nottrigger2: mov curslocx,di - call scrollmonitor - mov bx,si - mov kerning,0 - ret - - endp - - - - - - - - - -Getnumber proc near - - mov cx,0 - push si bx di ds es - mov di,si - -wordloop: push cx dx - call getnextword - pop dx cx - cmp al,1 - jz endoftext - mov al,cl - mov ah,0 - push bx - mov bh,0 - add ax,bx - pop bx - sub ax,10 - mov dh,0 - cmp ax,dx - jnc gotoverend - add cl,bl - add ch,bh - jmp wordloop - -gotoverend: mov al,dl - and al,1 - jz notcentre - push cx - mov al,dl - and al,11111110b - mov ah,0 - mov ch,0 - sub ax,cx - add ax,20 - shr ax,1 - pop cx - pop es ds di bx si - add di,ax - mov cl,ch - ret -notcentre: pop es ds di bx si - mov cl,ch - ret - - - -endoftext: mov al,cl - mov ah,0 - push bx - mov bh,0 - add ax,bx - pop bx - sub ax,10 - mov dh,0 - cmp ax,dx - jnc gotoverend2 - add cl,bl - add ch,bh - -gotoverend2: mov al,dl - and al,1 - jz notcent2 - push cx - mov al,dl - and al,11111110b - add al,2 - mov ah,0 - mov ch,0 - add ax,20 - sub ax,cx - shr ax,1 - pop cx - pop es ds di bx si - add di,ax - mov cl,ch - ret -notcent2: pop es ds di bx si - mov cl,ch - ret - - endp - - - - - -Getnextword proc near - - mov bx,0 -getloop: mov ax,[es:di] - inc di - inc bh - cmp al,":" - jz endall - cmp al,0 - jz endall - cmp al,32 - jz endword - if foreign - call modifychar - endif - cmp al,255 - jz getloop - push ax - sub al,32 ;"A" - mov ah,0 - add ax,charshift - add ax,ax - mov si,ax - add ax,ax - add si,ax - mov cl,[si+0] - pop ax - call kernchars - add bl,cl - ;dec bl - jmp getloop - -endword: add bl,6 - mov al,0 - ret - -endall: add bl,6 - mov al,1 - ret - - endp - - - - - - if german - -Modifychar proc near - - cmp al,128 - jc nomod - cmp al,129 - jnz not129 - mov al,"Z"+3 - ret -not129: cmp al,132 - jnz not132 - mov al,"Z"+1 - ret -not132: cmp al,142 - jnz not142 - mov al,"Z"+4 - ret -not142: cmp al,154 - jnz not154 - mov al,"Z"+6 - ret -not154: cmp al,225 - jnz not225 - mov al,"A"-1 - ret -not225: cmp al,153 - jnz not153 - mov al,"Z"+5 - ret -not153: cmp al,148 - jnz not148 - mov al,"Z"+2 - ret -not148: ret - -nomod: ret - - endp - - endif - - - - - if spanish - -Modifychar proc near - - cmp al,128 - jc nomod - cmp al,160 - jnz not160 - mov al,"Z"+1 - ret -not160: cmp al,130 - jnz not130 - mov al,"Z"+2 - ret -not130: cmp al,161 - jnz not161 - mov al,"Z"+3 - ret -not161: cmp al,162 - jnz not162 - mov al,"Z"+4 - ret -not162: cmp al,163 - jnz not163 - mov al,"Z"+5 - ret -not163: cmp al,164 - jnz not164 - mov al,"Z"+6 - ret -not164: cmp al,165 - jnz not165 - mov al,","-1 - ret -not165: cmp al,168 - jnz not168 - mov al,"A"-1 - ret -not168: cmp al,173 - jnz not173 - mov al,"A"-4 - ret -not173: cmp al,129 - jnz not129 - mov al,"A"-5 -not129: ret - -nomod: ret - - endp - - endif +Printchar proc near + + cmp al,255 + jz ignoreit + push si bx di + if foreign + sub bx,3 + endif + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + call showframe + pop ax di bx si + cmp kerning,0 + jnz nokern + call kernchars +nokern: push cx + mov ch,0 + add di,cx + pop cx + ;dec di +ignoreit: ret + + endp + + + + + + + + + + +Kernchars proc near + + ;sub al,13 + cmp al,"a" + jz iskern + cmp al,"u" + jz iskern + ret +iskern: cmp ah,"n" + jz kernit + cmp ah,"t" + jz kernit + cmp ah,"r" + jz kernit + cmp ah,"i" + jz kernit + cmp ah,"l" + jz kernit + ret +kernit: dec cl + ret + + endp + + + + + + +;------------------------------------------------Proportional text printing---- + + +;Memprint proc near +; +; call usecharset1 +; +; push ax bx cx dx es ds si di +; call deltextline +; pop di si ds es dx cx bx ax +; +; pop si +; push cs +; pop es +; inc si +; mov ds,currentset +; mov di,textaddressx +; mov bx,textaddressy +; mov dl,textlen +; mov al,0 +; mov ah,0 +; call printdirect +; push si + +; mov newtextline,1 +; ret + +; endp + + + + + + +;------------------------------------------------Proportional text printing---- + +;Print proc near +; +; pop si +; mov bx,[cs:si+2] +; mov di,[cs:si+0] +; mov dl,[cs:si+4] +; add si,6 +; mov ds,currentset +; +;printloop2: push bx di dx +; push es cs +; pop es +; call getnumber +; pop es +; mov ch,0 +;printloop1: mov ax,[cs:si] +; inc si +; cmp al,0 +; jz finishprint +; push cx es +; call modifychar +; call printchar +; pop es cx +; loop printloop1 +; pop dx di bx +; add bx,linespacing +; jmp printloop2 + +;finishprint: pop dx di bx + ; push si + ; ret + + ; endp + + + + + + + + + +Printslow proc near + + mov pointerframe,1 + mov pointermode,3 + mov ds,charset1 +printloopslow6: push bx di dx + call getnumber + + mov ch,0 +printloopslow5: push cx si es + mov ax,[es:si] + push bx cx es si ds + if foreign + call modifychar + endif + call printboth + pop ds si es cx bx + mov ax,[es:si+1] + inc si + cmp al,0 + jz finishslow + cmp al,":" + jz finishslow + cmp cl,1 + jz afterslow + push di ds bx cx es si + if foreign + call modifychar + endif + mov charshift,91 + call printboth + mov charshift,0 + pop si es cx bx ds di + call waitframes + cmp ax,0 + jz keepgoing + cmp ax,oldbutton + jnz finishslow2 +keepgoing: call waitframes +noslow: cmp ax,0 + jz afterslow + cmp ax,oldbutton + jnz finishslow2 ;used to finish early +afterslow: pop es si cx + inc si + loop printloopslow5 + + pop dx di bx + add bx,10 + jmp printloopslow6 + +finishslow: pop es si cx dx di bx + mov al,0 + ret + +finishslow2: pop es si cx dx di bx + mov al,1 + ret + + endp + + + +Waitframes proc near + + push di bx es si ds + call readmouse + call showpointer + call vsync + call dumppointer + call delpointer + mov ax,mousebutton + pop ds si es bx di + ret + + endp + + + + +Printboth proc near + + push ax cx bx + push di + call printchar + pop ax + push di + mov di,ax + call multidump + pop di + pop bx cx ax + ret + + endp + + + + + + +Printdirect proc near + + mov lastxpos,di + mov ds,currentset +printloop6: push bx di dx + call getnumber + mov ch,0 +printloop5: mov ax,[es:si] + inc si + cmp al,0 + jz finishdirct + cmp al,":" + jz finishdirct + push cx es + if foreign + call modifychar + endif + call printchar + mov lastxpos,di + pop es cx + loop printloop5 + pop dx di bx + add bx,linespacing + jmp printloop6 + +finishdirct: pop dx di bx + ret + + endp + + + + + + + + + + + + + + +Monprint proc near + + mov kerning,1 + mov si,bx + mov dl,166 + mov di,monadx + mov bx,monady + mov ds,tempcharset + +printloop8: push bx di dx + call getnumber + mov ch,0 +printloop7: mov al,[es:si] + inc si + + cmp al,":" + jz finishmon2 + cmp al,0 + jz finishmon + cmp al,34 + jz finishmon + cmp al,"=" + jz finishmon + cmp al,"%" + jnz nottrigger + mov ah,[es:si] + inc si + inc si + jmp finishmon +nottrigger: push cx es + if foreign + call modifychar + endif + call printchar + mov curslocx,di + mov curslocy,bx + mov maintimer,1 + call printcurs + + call vsync + push si dx ds es bx di + call lockmon + pop di bx es ds dx si + call delcurs + pop es cx + loop printloop7 + +finishmon2: pop dx di bx + call scrollmonitor + mov curslocx,di + jmp printloop8 + +finishmon: pop dx di bx + cmp al,"%" + jnz nottrigger2 + mov lasttrigger,ah +nottrigger2: mov curslocx,di + call scrollmonitor + mov bx,si + mov kerning,0 + ret + + endp + + + + + + + + + +Getnumber proc near + + mov cx,0 + push si bx di ds es + mov di,si + +wordloop: push cx dx + call getnextword + pop dx cx + cmp al,1 + jz endoftext + mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend + add cl,bl + add ch,bh + jmp wordloop + +gotoverend: mov al,dl + and al,1 + jz notcentre + push cx + mov al,dl + and al,11111110b + mov ah,0 + mov ch,0 + sub ax,cx + add ax,20 + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcentre: pop es ds di bx si + mov cl,ch + ret + + + +endoftext: mov al,cl + mov ah,0 + push bx + mov bh,0 + add ax,bx + pop bx + sub ax,10 + mov dh,0 + cmp ax,dx + jnc gotoverend2 + add cl,bl + add ch,bh + +gotoverend2: mov al,dl + and al,1 + jz notcent2 + push cx + mov al,dl + and al,11111110b + add al,2 + mov ah,0 + mov ch,0 + add ax,20 + sub ax,cx + shr ax,1 + pop cx + pop es ds di bx si + add di,ax + mov cl,ch + ret +notcent2: pop es ds di bx si + mov cl,ch + ret + + endp + + + + + +Getnextword proc near + + mov bx,0 +getloop: mov ax,[es:di] + inc di + inc bh + cmp al,":" + jz endall + cmp al,0 + jz endall + cmp al,32 + jz endword + if foreign + call modifychar + endif + cmp al,255 + jz getloop + push ax + sub al,32 ;"A" + mov ah,0 + add ax,charshift + add ax,ax + mov si,ax + add ax,ax + add si,ax + mov cl,[si+0] + pop ax + call kernchars + add bl,cl + ;dec bl + jmp getloop + +endword: add bl,6 + mov al,0 + ret + +endall: add bl,6 + mov al,1 + ret + + endp + + + + + + if german + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,129 + jnz not129 + mov al,"Z"+3 + ret +not129: cmp al,132 + jnz not132 + mov al,"Z"+1 + ret +not132: cmp al,142 + jnz not142 + mov al,"Z"+4 + ret +not142: cmp al,154 + jnz not154 + mov al,"Z"+6 + ret +not154: cmp al,225 + jnz not225 + mov al,"A"-1 + ret +not225: cmp al,153 + jnz not153 + mov al,"Z"+5 + ret +not153: cmp al,148 + jnz not148 + mov al,"Z"+2 + ret +not148: ret + +nomod: ret + + endp + + endif + + + + + if spanish + +Modifychar proc near + + cmp al,128 + jc nomod + cmp al,160 + jnz not160 + mov al,"Z"+1 + ret +not160: cmp al,130 + jnz not130 + mov al,"Z"+2 + ret +not130: cmp al,161 + jnz not161 + mov al,"Z"+3 + ret +not161: cmp al,162 + jnz not162 + mov al,"Z"+4 + ret +not162: cmp al,163 + jnz not163 + mov al,"Z"+5 + ret +not163: cmp al,164 + jnz not164 + mov al,"Z"+6 + ret +not164: cmp al,165 + jnz not165 + mov al,","-1 + ret +not165: cmp al,168 + jnz not168 + mov al,"A"-1 + ret +not168: cmp al,173 + jnz not173 + mov al,"A"-4 + ret +not173: cmp al,129 + jnz not129 + mov al,"A"-5 +not129: ret + +nomod: ret + + endp + + endif  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm index a814c50bd6..f10d87149d 100644 --- a/devtools/tasmrecover/dreamweb/saveload.asm +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -1,1495 +1,1495 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text - - -Zoomonoff proc near - - cmp watchingtime,0 - jnz blank - cmp pointermode,2 - jz blank - cmp commandtype,222 - jz alreadyonoff - mov commandtype,222 - mov al,39 - call commandonly -alreadyonoff: mov ax,mousebutton - cmp ax,oldbutton - jz nozoomonoff - and ax,1 - jnz dozoomonoff -nozoomonoff: ret - -dozoomonoff: mov al,zoomon - xor al,1 - mov zoomon,al - - call createpanel - mov newobs,0 - call drawfloor - call printsprites - call reelsonscreen - call showicon - call getunderzoom - call undertextline - mov al,39 - call commandonly - call readmouse - call worktoscreenm - ret - - endp - - - - - - - - - - - - -Saveload proc near - - if demo - call dosreturn - ret - else - cmp watchingtime,0 - jnz blank - cmp pointermode,2 - jz blank - cmp commandtype,253 - jz alreadyops - mov commandtype,253 - mov al,43 - call commandonly -alreadyops: mov ax,mousebutton - cmp ax,oldbutton - jz noops - and ax,1 - jz noops - call dosaveload -noops: ret - endif - - endp - - - - - - - - - - - -Dosaveload proc near - - mov pointerframe,0 - mov textaddressx,70 - mov textaddressy,182-8 - mov textlen,181 - mov manisoffscreen,1 - call clearwork - call createpanel2 - call undertextline - call getridofall ;reels - call loadsavebox - call showopbox - call showmainops - call worktoscreen ;2 - jmp donefirstops - -restartops: call showopbox - call showmainops - call worktoscreenm -donefirstops: mov getback,0 -waitops: call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - call delpointer - mov bx,offset cs:opslist - call checkcoords - cmp getback,0 - jz waitops - cmp getback,2 - jz restartops - mov textaddressx,13 - mov textaddressy,182 - mov textlen,240 - cmp getback,4 - jz justret - call getridoftemp - call restoreall ;reels - call redrawmainscrn - call worktoscreenm - mov commandtype,200 -justret: mov manisoffscreen,0 - ret - -opslist: dw opsx+59,opsx+114,opsy+30,opsy+76,getbackfromops - dw opsx+10,opsx+77,opsy+10,opsy+59,dosreturn - dw opsx+128,opsx+190,opsy+16,opsy+100,discops - dw 0,320,0,200,blank - dw 0ffffh - - - endp - - - -Getbackfromops proc near - - cmp mandead,2 - jz opsblock1 - call getback1 - ret -opsblock1: call blank - ret - - endp - - - - - -Showmainops proc near - - mov ds,tempgraphics - mov di,opsx+10 - mov bx,opsy+10 - mov al,8 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+59 - mov bx,opsy+30 - mov al,7 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+128+4 - mov bx,opsy+12 - mov al,1 - mov ah,0 - call showframe - ret - - endp - - - - -Showdiscops proc near - - mov ds,tempgraphics - mov di,opsx+128+4 - mov bx,opsy+12 - mov al,1 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+10 - mov bx,opsy+10 - mov al,9 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+59 - mov bx,opsy+30 - mov al,10 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+176+2 - mov bx,opsy+60-4 - mov al,5 - mov ah,0 - call showframe - ret - - endp - - - - -Loadsavebox proc near - - mov dx,offset cs:icongraphics8 - call loadintotemp - ret - - endp - - - - - - - - -Loadgame proc near - - cmp commandtype,246 - jz alreadyload - mov commandtype,246 - mov al,41 - call commandonly -alreadyload: mov ax,mousebutton - cmp ax,oldbutton - jz noload - cmp ax,1 - jz doload -noload: ret - -doload: mov loadingorsave,1 - call showopbox - call showloadops - mov currentslot,0 - call showslots - call shownames - mov pointerframe,0 - call worktoscreenm - call namestoold - mov getback,0 - -loadops: call delpointer - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - - mov bx,offset cs:loadlist - call checkcoords - cmp getback,0 - jz loadops - cmp getback,2 - jz quitloaded - call getridoftemp - ;call clearnoreels - mov dx,seg madeuproomdat - mov es,dx - mov bx,offset es:madeuproomdat - call startloading - call loadroomssample - mov roomloaded,1 - mov newlocation,255 - call clearsprites - call initman - call initrain - mov textaddressx,13 - mov textaddressy,182 - mov textlen,240 - call startup - call worktoscreen - mov getback,4 -quitloaded: ret - -loadlist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops - dw opsx+128,opsx+190,opsy+12,opsy+100,actualload - dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - -Getbacktoops proc near - - cmp commandtype,201 - jz alreadygetops - mov commandtype,201 - mov al,42 - call commandonly -alreadygetops: mov ax,mousebutton - cmp ax,oldbutton - jz nogetbackops - and ax,1 - jnz dogetbackops -nogetbackops: ret - -dogetbackops: call oldtonames - mov getback,2 - ret - - endp - - - - - - - -Discops proc near - - cmp commandtype,249 - jz alreadydiscops - mov commandtype,249 - mov al,43 - call commandonly -alreadydiscops: mov ax,mousebutton - cmp ax,oldbutton - jz nodiscops - and ax,1 - jnz dodiscops -nodiscops: ret -dodiscops: call scanfornames - mov loadingorsave,2 - call showopbox - call showdiscops - mov currentslot,0 - call worktoscreenm - - mov getback,0 -discopsloop: call delpointer - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - mov bx,offset cs:discopslist - call checkcoords - cmp getback,0 - jz discopsloop - ret - -discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame - dw opsx+10,opsx+79,opsy+10,opsy+59,savegame - dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - - -Savegame proc near - - cmp mandead,2 - jnz cansaveok - call blank - ret - -cansaveok: cmp commandtype,247 - jz alreadysave - mov commandtype,247 - mov al,44 - call commandonly -alreadysave: mov ax,mousebutton - and ax,1 - jnz dosave - ret -dosave: mov loadingorsave,2 - call showopbox - call showsaveops - mov currentslot,0 - call showslots - call shownames - call worktoscreenm - - call namestoold - mov bufferin,0 - mov bufferout,0 - - mov getback,0 - -saveops: call delpointer - call checkinput - call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - - mov bx,offset cs:savelist - call checkcoords - cmp getback,0 - jz saveops - ret - -savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops - dw opsx+128,opsx+190,opsy+12,opsy+100,actualsave - dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - -Actualsave proc near - - cmp commandtype,222 - jz alreadyactsave - mov commandtype,222 - mov al,44 - call commandonly -alreadyactsave: mov ax,mousebutton - and ax,1 - jz noactsave - - mov dx,seg savenames - mov ds,dx - mov si,offset savenames - mov al,currentslot - mov ah,0 - mov cx,17 - mul cx - add si,ax - inc si - cmp byte ptr [si],0 - jz noactsave - - mov al,location - mov ah,0 - mov cx,32 - mul cx - push cs - pop ds - mov si,offset cs:roomdata - add si,ax - - mov di,offset cs:madeuproomdat - mov bx,di - push cs - pop es - mov cx,16 - rep movsw - - mov al,roomssample - mov [es:bx+13],al - mov al,mapx - mov [es:bx+15],al - mov al,mapy - mov [es:bx+16],al - mov al,liftflag - mov [es:bx+20],al - mov al,manspath - mov [es:bx+21],al - mov al,facing - mov [es:bx+22],al - mov al,255 - mov [es:bx+27],al - call saveposition - call getridoftemp - call restoreall ;reels - mov textaddressx,13 - mov textaddressy,182 - mov textlen,240 - call redrawmainscrn - call worktoscreenm - mov getback,4 -noactsave: ret - - endp - - - - -Actualload proc near - - cmp commandtype,221 - jz alreadyactload - mov commandtype,221 - mov al,41 - call commandonly -alreadyactload: mov ax,mousebutton - cmp ax,oldbutton - jz notactload - cmp ax,1 - jnz notactload - - mov dx,seg savenames - mov ds,dx - mov si,offset savenames - mov al,currentslot - mov ah,0 - mov cx,17 - mul cx - add si,ax - inc si - cmp byte ptr [si],0 - jz notactload - call loadposition - mov getback,1 -notactload: ret - - endp - - - - -Selectslot2 proc near - - cmp mousebutton,0 - jz noselslot2 - mov loadingorsave,2 -noselslot2: call selectslot - ret - - endp - - - - - -Checkinput proc near - - cmp loadingorsave,3 - jz nokeypress - call readkey - mov al,currentkey - cmp al,0 - jz nokeypress - cmp al,13 - jnz notret - mov loadingorsave,3 - jmp afterkey -notret: cmp al,8 - jnz nodel2 - cmp cursorpos,0 - jz nokeypress - call getnamepos - dec cursorpos - mov byte ptr [es:bx],0 - mov byte ptr [es:bx+1],1 - jmp afterkey -nodel2: ;cmp al,32 - ;jz spacepress - ;cmp al,"A" - ;jc nokeypress - ;cmp al,"Z"+1 - ;jnc nokeypress -spacepress: cmp cursorpos,14 - jz nokeypress - call getnamepos - inc cursorpos - mov al,currentkey - mov [es:bx+1],al - mov byte ptr [es:bx+2],0 - mov byte ptr [es:bx+3],1 - jmp afterkey - -nokeypress: ret - -afterkey: call showopbox - call shownames - call showslots - call showsaveops - call worktoscreenm - ret - - endp - - - - - -Getnamepos proc near - - mov al,currentslot - mov ah,0 - mov cx,17 - mul cx - mov dx,seg savenames - mov es,dx - mov bx,offset es:savenames - add bx,ax - mov al,cursorpos - mov ah,0 - add bx,ax - ret - - endp - - - - - - - - -Showopbox proc near - - mov ds,tempgraphics - mov di,opsx - mov bx,opsy - mov al,0 - mov ah,0 - call showframe - - mov ds,tempgraphics - mov di,opsx - mov bx,opsy+55 - mov al,4 - mov ah,0 - call showframe - ret - - endp - - - - - - - - -Showloadops proc near - - mov ds,tempgraphics - mov di,opsx+128+4 - mov bx,opsy+12 - mov al,1 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+176+2 - mov bx,opsy+60-4 - mov al,5 - mov ah,0 - call showframe - - mov di,opsx+104 - mov bx,opsy+14 - mov al,55 - mov dl,101 - call printmessage - ret - - endp - - - - -Showsaveops proc near - - mov ds,tempgraphics - mov di,opsx+128+4 - mov bx,opsy+12 - mov al,1 - mov ah,0 - call showframe - mov ds,tempgraphics - mov di,opsx+176+2 - mov bx,opsy+60-4 - mov al,5 - mov ah,0 - call showframe - - mov di,opsx+104 - mov bx,opsy+14 - mov al,54 - mov dl,101 - call printmessage - ret - - endp - - - - - -Selectslot proc near - - cmp commandtype,244 - jz alreadysel - mov commandtype,244 - mov al,45 - call commandonly -alreadysel: mov ax,mousebutton - cmp ax,1 - jnz noselslot - cmp ax,oldbutton - jz noselslot - - cmp loadingorsave,3 - jnz notnocurs - dec loadingorsave -notnocurs: call oldtonames - mov ax,mousey - sub ax,opsy+4 - mov cl,-1 -getslotnum: inc cl - sub ax,11 - jnc getslotnum - mov currentslot,cl - call delpointer - call showopbox - call showslots - call shownames - cmp loadingorsave,1 - jz isloadmode - call showsaveops - call readmouse - call showpointer - call worktoscreen - call delpointer - ret -isloadmode: call showloadops - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - -noselslot: ret - - endp - - - - - - - - - - -Showslots proc near - - mov di,opsx+7 - mov bx,opsy+8 - mov al,2 - mov ds,tempgraphics - mov ah,0 - call showframe - - mov di,opsx+10 - mov bx,opsy+11 - mov cl,0 -slotloop: push cx di bx - - cmp cl,currentslot - jnz nomatchslot - mov al,3 - mov ds,tempgraphics - mov ah,0 - call showframe - -nomatchslot: pop bx di cx - add bx,10 - inc cl - cmp cl,7 - jnz slotloop - ret - - endp - - - - - -Shownames proc near - - mov dx,seg savenames - mov es,dx - mov si,offset es:savenames+1 - mov di,opsx+21 - mov bx,opsy+10 - mov cl,0 - -shownameloop: push cx di es bx si - mov al,4 - cmp cl,currentslot - jnz nomatchslot2 - - cmp loadingorsave,2 - jnz loadmode - - mov dx,si - mov cx,15 - add si,15 -zerostill: dec si - dec cl - cmp byte ptr [es:si],1 - jnz foundcharacter - jmp zerostill -foundcharacter: mov cursorpos,cl - mov byte ptr [es:si],"/" - mov byte ptr [es:si+1],0 - push si - mov si,dx - mov dl,200 - mov ah,0 - call printdirect - pop si - mov byte ptr [es:si],0 - mov byte ptr [es:si+1],1 - jmp afterprintname - -loadmode: mov al,0 - mov dl,200 - mov ah,0 - mov charshift,91 - call printdirect - mov charshift,0 - jmp afterprintname - -nomatchslot2: mov dl,200 - mov ah,0 - call printdirect - -afterprintname: pop si bx es di cx - add si,17 - add bx,10 - inc cl - cmp cl,7 - jnz shownameloop - ret - - endp - - - - - - - - - - - - - - - - - - -Dosreturn proc near - - cmp commandtype,250 - jz alreadydos - mov commandtype,250 - mov al,46 - call commandonly -alreadydos: mov ax,mousebutton - and ax,1 - jz nodos - -quickquit2: call soundend - call removeemm - -quickquit: if recording - call saverec - mov bx,rechandle - mov ah,3eh - int 21h - endif - if playback - mov bx,rechandle - mov ah,3eh - int 21h - endif - - call resetkeyboard - mov bl,31h - mov al,0 - mov ah,12h - int 10h - call vsync - - mov ah,0 - mov al,3 - int 10h - call error - mov ax,4c00h - int 21h - ret - - endp - - - -Error proc near - - cmp gameerror,1 - jz error1 - cmp gameerror,2 - jz error2 - cmp gameerror,3 - jz error3 - cmp gameerror,4 - jz error4 - cmp gameerror,5 - jz error5 - cmp gameerror,6 - jz error6 - cmp gameerror,7 - jz error7 - cmp gameerror,8 - jz error8 - ret - -error1: mov dx,offset cs:gameerror1 - jmp generalerror - -error2: mov ax,soundbaseadd - sub ax,200h - mov cl,4 - shr ax,cl - add al,"0" - mov bx,offset cs:error2patch - mov [cs:bx+1],al - mov dx,offset cs:gameerror2 - call generalerror - mov dx,offset cs:gameinfo - jmp generalerror - -error3: mov dx,offset cs:gameerror3 - jmp generalerror - -error4: mov dx,offset cs:gameerror4 - jmp generalerror - -error5: mov dx,offset cs:gameerror5 - jmp generalerror - -error6: mov al,soundint - add al,"0" - mov bx,offset cs:error6patch - mov [cs:bx],al - mov dx,offset cs:gameerror6 - call generalerror - mov dx,offset cs:gameinfo - jmp generalerror - -error7: mov dx,offset cs:gameerror7 - jmp generalerror - -error8: mov dx,offset cs:gameerror8 - jmp generalerror - -generalerror: mov ah,9h - push cs - pop ds - int 21h - ret - -nodos: ret - -gameerror1: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Unable to allocate Expanded Memory." - db 13,10,13,10 - db 24h -gameerror2: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Sound Blaster card not found at address " -error2patch: db "220 Hex." - db 13,10,13,10 - db 24h -gameerror3: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Out of Base Memory." - db 13,10,13,10 - db 24h -gameerror4: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Memory Deallocation problem." - db 13,10,13,10 - db 24h -gameerror5: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "At least 590K of base memory is required." - db 13,10,13,10 - db 24h -gameerror6: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Sound Blaster not found on interupt " -error6patch: db "0" - db 13,10,13,10 - db 24h -gameerror7: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "Unable to select EMM page." - db 13,10,13,10 - db 24h -gameerror8: db 13,10,13,10 - db "Dreamweb has an Error:",13,10 - db "File not found.c" -error8patch: db 13,10,13,10 - db 24h - -gameinfo: db "Dreamweb looks for Sound Blaster information in",13,10 - db "the BLASTER environment variable (in your AUTOEXEC.BAT)",13,10 - db 13,10,"If this is not found then IRQ 7, DMA channel 1 and base",13,10 - db "address 220h are assumed.",13,10,13,10 - - db "To alter any or all of these settings you can specify them",13,10 - db "on the command line. For example:",13,10,13,10 - db "Type DREAMWEB I7 A220 D1 to run Dreamweb on IRQ 7, DMA",13,10 - db " channel 1 and base address 220h" - db 13,10 - db " DREAMWEB I5 to run Dreamweb on IRQ 5 and",13,10 - db " default address of 220h, DMA 1",13,10 - db 13,10 - db 24h - -endgametext1: db 13,10,13,10 - db "Try the Dreamweb CD in your stereo....",13,10 - db 13,10,13,10 - db 24h - - endp - - - - - - - - -Namestoold proc near - - push cs - pop ds - mov si,offset cs:savenames - mov di,zoomspace - mov es,buffers - mov cx,17*4 - rep movsb - ret - - endp - - - -Oldtonames proc near - - push cs - pop es - mov di,offset cs:savenames - mov si,zoomspace - mov ds,buffers - mov cx,17*4 - rep movsb - ret - - endp - - - + + +Zoomonoff proc near + + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,222 + jz alreadyonoff + mov commandtype,222 + mov al,39 + call commandonly +alreadyonoff: mov ax,mousebutton + cmp ax,oldbutton + jz nozoomonoff + and ax,1 + jnz dozoomonoff +nozoomonoff: ret + +dozoomonoff: mov al,zoomon + xor al,1 + mov zoomon,al + + call createpanel + mov newobs,0 + call drawfloor + call printsprites + call reelsonscreen + call showicon + call getunderzoom + call undertextline + mov al,39 + call commandonly + call readmouse + call worktoscreenm + ret + + endp + + + + + + + + + + + + +Saveload proc near + + if demo + call dosreturn + ret + else + cmp watchingtime,0 + jnz blank + cmp pointermode,2 + jz blank + cmp commandtype,253 + jz alreadyops + mov commandtype,253 + mov al,43 + call commandonly +alreadyops: mov ax,mousebutton + cmp ax,oldbutton + jz noops + and ax,1 + jz noops + call dosaveload +noops: ret + endif + + endp + + + + + + + + + + + +Dosaveload proc near + + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call clearwork + call createpanel2 + call undertextline + call getridofall ;reels + call loadsavebox + call showopbox + call showmainops + call worktoscreen ;2 + jmp donefirstops + +restartops: call showopbox + call showmainops + call worktoscreenm +donefirstops: mov getback,0 +waitops: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:opslist + call checkcoords + cmp getback,0 + jz waitops + cmp getback,2 + jz restartops + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + cmp getback,4 + jz justret + call getridoftemp + call restoreall ;reels + call redrawmainscrn + call worktoscreenm + mov commandtype,200 +justret: mov manisoffscreen,0 + ret + +opslist: dw opsx+59,opsx+114,opsy+30,opsy+76,getbackfromops + dw opsx+10,opsx+77,opsy+10,opsy+59,dosreturn + dw opsx+128,opsx+190,opsy+16,opsy+100,discops + dw 0,320,0,200,blank + dw 0ffffh + + + endp + + + +Getbackfromops proc near + + cmp mandead,2 + jz opsblock1 + call getback1 + ret +opsblock1: call blank + ret + + endp + + + + + +Showmainops proc near + + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,8 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,7 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + ret + + endp + + + + +Showdiscops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+10 + mov bx,opsy+10 + mov al,9 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+59 + mov bx,opsy+30 + mov al,10 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + ret + + endp + + + + +Loadsavebox proc near + + mov dx,offset cs:icongraphics8 + call loadintotemp + ret + + endp + + + + + + + + +Loadgame proc near + + cmp commandtype,246 + jz alreadyload + mov commandtype,246 + mov al,41 + call commandonly +alreadyload: mov ax,mousebutton + cmp ax,oldbutton + jz noload + cmp ax,1 + jz doload +noload: ret + +doload: mov loadingorsave,1 + call showopbox + call showloadops + mov currentslot,0 + call showslots + call shownames + mov pointerframe,0 + call worktoscreenm + call namestoold + mov getback,0 + +loadops: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:loadlist + call checkcoords + cmp getback,0 + jz loadops + cmp getback,2 + jz quitloaded + call getridoftemp + ;call clearnoreels + mov dx,seg madeuproomdat + mov es,dx + mov bx,offset es:madeuproomdat + call startloading + call loadroomssample + mov roomloaded,1 + mov newlocation,255 + call clearsprites + call initman + call initrain + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call startup + call worktoscreen + mov getback,4 +quitloaded: ret + +loadlist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualload + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + +Getbacktoops proc near + + cmp commandtype,201 + jz alreadygetops + mov commandtype,201 + mov al,42 + call commandonly +alreadygetops: mov ax,mousebutton + cmp ax,oldbutton + jz nogetbackops + and ax,1 + jnz dogetbackops +nogetbackops: ret + +dogetbackops: call oldtonames + mov getback,2 + ret + + endp + + + + + + + +Discops proc near + + cmp commandtype,249 + jz alreadydiscops + mov commandtype,249 + mov al,43 + call commandonly +alreadydiscops: mov ax,mousebutton + cmp ax,oldbutton + jz nodiscops + and ax,1 + jnz dodiscops +nodiscops: ret +dodiscops: call scanfornames + mov loadingorsave,2 + call showopbox + call showdiscops + mov currentslot,0 + call worktoscreenm + + mov getback,0 +discopsloop: call delpointer + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:discopslist + call checkcoords + cmp getback,0 + jz discopsloop + ret + +discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame + dw opsx+10,opsx+79,opsy+10,opsy+59,savegame + dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + +Savegame proc near + + cmp mandead,2 + jnz cansaveok + call blank + ret + +cansaveok: cmp commandtype,247 + jz alreadysave + mov commandtype,247 + mov al,44 + call commandonly +alreadysave: mov ax,mousebutton + and ax,1 + jnz dosave + ret +dosave: mov loadingorsave,2 + call showopbox + call showsaveops + mov currentslot,0 + call showslots + call shownames + call worktoscreenm + + call namestoold + mov bufferin,0 + mov bufferout,0 + + mov getback,0 + +saveops: call delpointer + call checkinput + call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + + mov bx,offset cs:savelist + call checkcoords + cmp getback,0 + jz saveops + ret + +savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops + dw opsx+128,opsx+190,opsy+12,opsy+100,actualsave + dw opsx+2,opsx+92,opsy+4,opsy+81,selectslot + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + +Actualsave proc near + + cmp commandtype,222 + jz alreadyactsave + mov commandtype,222 + mov al,44 + call commandonly +alreadyactsave: mov ax,mousebutton + and ax,1 + jz noactsave + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz noactsave + + mov al,location + mov ah,0 + mov cx,32 + mul cx + push cs + pop ds + mov si,offset cs:roomdata + add si,ax + + mov di,offset cs:madeuproomdat + mov bx,di + push cs + pop es + mov cx,16 + rep movsw + + mov al,roomssample + mov [es:bx+13],al + mov al,mapx + mov [es:bx+15],al + mov al,mapy + mov [es:bx+16],al + mov al,liftflag + mov [es:bx+20],al + mov al,manspath + mov [es:bx+21],al + mov al,facing + mov [es:bx+22],al + mov al,255 + mov [es:bx+27],al + call saveposition + call getridoftemp + call restoreall ;reels + mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + call redrawmainscrn + call worktoscreenm + mov getback,4 +noactsave: ret + + endp + + + + +Actualload proc near + + cmp commandtype,221 + jz alreadyactload + mov commandtype,221 + mov al,41 + call commandonly +alreadyactload: mov ax,mousebutton + cmp ax,oldbutton + jz notactload + cmp ax,1 + jnz notactload + + mov dx,seg savenames + mov ds,dx + mov si,offset savenames + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + add si,ax + inc si + cmp byte ptr [si],0 + jz notactload + call loadposition + mov getback,1 +notactload: ret + + endp + + + + +Selectslot2 proc near + + cmp mousebutton,0 + jz noselslot2 + mov loadingorsave,2 +noselslot2: call selectslot + ret + + endp + + + + + +Checkinput proc near + + cmp loadingorsave,3 + jz nokeypress + call readkey + mov al,currentkey + cmp al,0 + jz nokeypress + cmp al,13 + jnz notret + mov loadingorsave,3 + jmp afterkey +notret: cmp al,8 + jnz nodel2 + cmp cursorpos,0 + jz nokeypress + call getnamepos + dec cursorpos + mov byte ptr [es:bx],0 + mov byte ptr [es:bx+1],1 + jmp afterkey +nodel2: ;cmp al,32 + ;jz spacepress + ;cmp al,"A" + ;jc nokeypress + ;cmp al,"Z"+1 + ;jnc nokeypress +spacepress: cmp cursorpos,14 + jz nokeypress + call getnamepos + inc cursorpos + mov al,currentkey + mov [es:bx+1],al + mov byte ptr [es:bx+2],0 + mov byte ptr [es:bx+3],1 + jmp afterkey + +nokeypress: ret + +afterkey: call showopbox + call shownames + call showslots + call showsaveops + call worktoscreenm + ret + + endp + + + + + +Getnamepos proc near + + mov al,currentslot + mov ah,0 + mov cx,17 + mul cx + mov dx,seg savenames + mov es,dx + mov bx,offset es:savenames + add bx,ax + mov al,cursorpos + mov ah,0 + add bx,ax + ret + + endp + + + + + + + + +Showopbox proc near + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy + mov al,0 + mov ah,0 + call showframe + + mov ds,tempgraphics + mov di,opsx + mov bx,opsy+55 + mov al,4 + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Showloadops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,55 + mov dl,101 + call printmessage + ret + + endp + + + + +Showsaveops proc near + + mov ds,tempgraphics + mov di,opsx+128+4 + mov bx,opsy+12 + mov al,1 + mov ah,0 + call showframe + mov ds,tempgraphics + mov di,opsx+176+2 + mov bx,opsy+60-4 + mov al,5 + mov ah,0 + call showframe + + mov di,opsx+104 + mov bx,opsy+14 + mov al,54 + mov dl,101 + call printmessage + ret + + endp + + + + + +Selectslot proc near + + cmp commandtype,244 + jz alreadysel + mov commandtype,244 + mov al,45 + call commandonly +alreadysel: mov ax,mousebutton + cmp ax,1 + jnz noselslot + cmp ax,oldbutton + jz noselslot + + cmp loadingorsave,3 + jnz notnocurs + dec loadingorsave +notnocurs: call oldtonames + mov ax,mousey + sub ax,opsy+4 + mov cl,-1 +getslotnum: inc cl + sub ax,11 + jnc getslotnum + mov currentslot,cl + call delpointer + call showopbox + call showslots + call shownames + cmp loadingorsave,1 + jz isloadmode + call showsaveops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret +isloadmode: call showloadops + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + +noselslot: ret + + endp + + + + + + + + + + +Showslots proc near + + mov di,opsx+7 + mov bx,opsy+8 + mov al,2 + mov ds,tempgraphics + mov ah,0 + call showframe + + mov di,opsx+10 + mov bx,opsy+11 + mov cl,0 +slotloop: push cx di bx + + cmp cl,currentslot + jnz nomatchslot + mov al,3 + mov ds,tempgraphics + mov ah,0 + call showframe + +nomatchslot: pop bx di cx + add bx,10 + inc cl + cmp cl,7 + jnz slotloop + ret + + endp + + + + + +Shownames proc near + + mov dx,seg savenames + mov es,dx + mov si,offset es:savenames+1 + mov di,opsx+21 + mov bx,opsy+10 + mov cl,0 + +shownameloop: push cx di es bx si + mov al,4 + cmp cl,currentslot + jnz nomatchslot2 + + cmp loadingorsave,2 + jnz loadmode + + mov dx,si + mov cx,15 + add si,15 +zerostill: dec si + dec cl + cmp byte ptr [es:si],1 + jnz foundcharacter + jmp zerostill +foundcharacter: mov cursorpos,cl + mov byte ptr [es:si],"/" + mov byte ptr [es:si+1],0 + push si + mov si,dx + mov dl,200 + mov ah,0 + call printdirect + pop si + mov byte ptr [es:si],0 + mov byte ptr [es:si+1],1 + jmp afterprintname + +loadmode: mov al,0 + mov dl,200 + mov ah,0 + mov charshift,91 + call printdirect + mov charshift,0 + jmp afterprintname + +nomatchslot2: mov dl,200 + mov ah,0 + call printdirect + +afterprintname: pop si bx es di cx + add si,17 + add bx,10 + inc cl + cmp cl,7 + jnz shownameloop + ret + + endp + + + + + + + + + + + + + + + + + + +Dosreturn proc near + + cmp commandtype,250 + jz alreadydos + mov commandtype,250 + mov al,46 + call commandonly +alreadydos: mov ax,mousebutton + and ax,1 + jz nodos + +quickquit2: call soundend + call removeemm + +quickquit: if recording + call saverec + mov bx,rechandle + mov ah,3eh + int 21h + endif + if playback + mov bx,rechandle + mov ah,3eh + int 21h + endif + + call resetkeyboard + mov bl,31h + mov al,0 + mov ah,12h + int 10h + call vsync + + mov ah,0 + mov al,3 + int 10h + call error + mov ax,4c00h + int 21h + ret + + endp + + + +Error proc near + + cmp gameerror,1 + jz error1 + cmp gameerror,2 + jz error2 + cmp gameerror,3 + jz error3 + cmp gameerror,4 + jz error4 + cmp gameerror,5 + jz error5 + cmp gameerror,6 + jz error6 + cmp gameerror,7 + jz error7 + cmp gameerror,8 + jz error8 + ret + +error1: mov dx,offset cs:gameerror1 + jmp generalerror + +error2: mov ax,soundbaseadd + sub ax,200h + mov cl,4 + shr ax,cl + add al,"0" + mov bx,offset cs:error2patch + mov [cs:bx+1],al + mov dx,offset cs:gameerror2 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error3: mov dx,offset cs:gameerror3 + jmp generalerror + +error4: mov dx,offset cs:gameerror4 + jmp generalerror + +error5: mov dx,offset cs:gameerror5 + jmp generalerror + +error6: mov al,soundint + add al,"0" + mov bx,offset cs:error6patch + mov [cs:bx],al + mov dx,offset cs:gameerror6 + call generalerror + mov dx,offset cs:gameinfo + jmp generalerror + +error7: mov dx,offset cs:gameerror7 + jmp generalerror + +error8: mov dx,offset cs:gameerror8 + jmp generalerror + +generalerror: mov ah,9h + push cs + pop ds + int 21h + ret + +nodos: ret + +gameerror1: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to allocate Expanded Memory." + db 13,10,13,10 + db 24h +gameerror2: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster card not found at address " +error2patch: db "220 Hex." + db 13,10,13,10 + db 24h +gameerror3: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Out of Base Memory." + db 13,10,13,10 + db 24h +gameerror4: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Memory Deallocation problem." + db 13,10,13,10 + db 24h +gameerror5: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "At least 590K of base memory is required." + db 13,10,13,10 + db 24h +gameerror6: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Sound Blaster not found on interupt " +error6patch: db "0" + db 13,10,13,10 + db 24h +gameerror7: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "Unable to select EMM page." + db 13,10,13,10 + db 24h +gameerror8: db 13,10,13,10 + db "Dreamweb has an Error:",13,10 + db "File not found.c" +error8patch: db 13,10,13,10 + db 24h + +gameinfo: db "Dreamweb looks for Sound Blaster information in",13,10 + db "the BLASTER environment variable (in your AUTOEXEC.BAT)",13,10 + db 13,10,"If this is not found then IRQ 7, DMA channel 1 and base",13,10 + db "address 220h are assumed.",13,10,13,10 + + db "To alter any or all of these settings you can specify them",13,10 + db "on the command line. For example:",13,10,13,10 + db "Type DREAMWEB I7 A220 D1 to run Dreamweb on IRQ 7, DMA",13,10 + db " channel 1 and base address 220h" + db 13,10 + db " DREAMWEB I5 to run Dreamweb on IRQ 5 and",13,10 + db " default address of 220h, DMA 1",13,10 + db 13,10 + db 24h + +endgametext1: db 13,10,13,10 + db "Try the Dreamweb CD in your stereo....",13,10 + db 13,10,13,10 + db 24h + + endp + + + + + + + + +Namestoold proc near + + push cs + pop ds + mov si,offset cs:savenames + mov di,zoomspace + mov es,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + +Oldtonames proc near + + push cs + pop es + mov di,offset cs:savenames + mov si,zoomspace + mov ds,buffers + mov cx,17*4 + rep movsb + ret + + endp + + + Savefilewrite proc near - mov bx,handle - mov ah,40h - int 21h + mov bx,handle + mov ah,40h + int 21h ret endp - + Savefileread proc near - mov bx,handle - mov ah,3fh - int 21h + mov bx,handle + mov ah,3fh + int 21h ret endp - -Saveposition proc near - - call makeheader - - mov al,currentslot - mov ah,0 - push ax - mov cx,13 - mul cx - mov dx,seg savefiles - mov ds,dx - mov dx,offset savefiles - add dx,ax - call openforsave - - mov dx,seg fileheader - mov ds,dx - mov dx,offset fileheader - mov cx,headerlen + +Saveposition proc near + + call makeheader + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + call openforsave + + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen call savefilewrite - mov dx,seg fileheader - mov es,dx - mov di,offset es:filedata - - pop ax - mov cx,17 - mul cx - mov dx,seg savenames - mov ds,dx - mov dx,offset savenames - add dx,ax - call saveseg - - mov dx,seg startvars - mov ds,dx - mov dx,offset startvars - call saveseg - - mov ds,extras - mov dx,exframedata - call saveseg - - mov ds,buffers - mov dx,listofchanges - call saveseg - - mov dx,seg madeuproomdat - mov ds,dx - mov dx,offset madeuproomdat - call saveseg - - mov dx,seg reelroutines - mov ds,dx - mov dx,offset reelroutines - call saveseg - -fquit: call closefile - ret - - endp - - - - - - -Loadposition proc near - - mov timecount,0 - call clearchanges - - mov al,currentslot - mov ah,0 - push ax - mov cx,13 - mul cx - mov dx,seg savefiles - mov ds,dx - mov dx,offset savefiles - add dx,ax - if cd - call openfilefromc - else - call openfile - endif - - push cs - pop ds - mov dx,offset cs:fileheader - mov cx,headerlen + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call saveseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call saveseg + + mov ds,extras + mov dx,exframedata + call saveseg + + mov ds,buffers + mov dx,listofchanges + call saveseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call saveseg + + mov dx,seg reelroutines + mov ds,dx + mov dx,offset reelroutines + call saveseg + +fquit: call closefile + ret + + endp + + + + + + +Loadposition proc near + + mov timecount,0 + call clearchanges + + mov al,currentslot + mov ah,0 + push ax + mov cx,13 + mul cx + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + add dx,ax + if cd + call openfilefromc + else + call openfile + endif + + push cs + pop ds + mov dx,offset cs:fileheader + mov cx,headerlen call savefileread - push cs - pop es - mov di,offset cs:filedata - - pop ax - mov cx,17 - mul cx - mov dx,seg savenames - mov ds,dx - mov dx,offset savenames - add dx,ax - call loadseg - - mov dx,seg startvars - mov ds,dx - mov dx,offset startvars - call loadseg - - mov ds,extras - mov dx,exframedata - call loadseg - - mov ds,buffers - mov dx,listofchanges - call loadseg - - mov dx,seg madeuproomdat - mov ds,dx - mov dx,offset madeuproomdat - call loadseg - - push cs - pop ds - mov dx,offset cs:reelroutines - call loadseg - - call closefile - ret - - endp - - - - - -Loadseg proc near - - mov bx,handle - mov ax,[es:di] - add di,2 - push di - push es - mov cx,ax - mov ah,3fh - int 21h - pop es - pop di - ret - - endp - - - - - -Makeheader proc near - - mov dx,seg fileheader - mov es,dx - mov di,offset es:filedata - mov ax,17 - call storeit - mov ax,lengthofvars - call storeit - mov ax,lengthofextra - call storeit - mov ax,numchanges*4 - call storeit - mov ax,48 - call storeit - mov ax,lenofreelrouts - call storeit - ret - - endp - - - - - -Storeit proc near - - cmp ax,0 - jnz isntblank - inc ax -isntblank: stosw - ret - - endp - - - - -Saveseg proc near - - mov cx,[es:di] - add di,2 - push di es - mov bx,handle - mov ah,40h - int 21h - pop es di - ret - - endp - - - -Findlen proc near - - dec bx - add bx,ax -nextone: cmp cl,[bx] - jnz foundlen - dec bx - dec ax - cmp ax,0 - jnz nextone -foundlen: ret - - endp - - - - - -Scanfornames proc near - - mov dx,seg savenames - mov es,dx - mov di,offset es:savenames - mov dx,seg savefiles - mov ds,dx - mov dx,offset savefiles - mov cx,7 -scanloop: push es ds di dx cx - - if cd - call openfilefromc - else - call openfilenocheck - endif - jc notexist - pop cx - inc ch - push cx - push di es - mov dx,seg fileheader - mov ds,dx - mov dx,offset fileheader - mov cx,headerlen + push cs + pop es + mov di,offset cs:filedata + + pop ax + mov cx,17 + mul cx + mov dx,seg savenames + mov ds,dx + mov dx,offset savenames + add dx,ax + call loadseg + + mov dx,seg startvars + mov ds,dx + mov dx,offset startvars + call loadseg + + mov ds,extras + mov dx,exframedata + call loadseg + + mov ds,buffers + mov dx,listofchanges + call loadseg + + mov dx,seg madeuproomdat + mov ds,dx + mov dx,offset madeuproomdat + call loadseg + + push cs + pop ds + mov dx,offset cs:reelroutines + call loadseg + + call closefile + ret + + endp + + + + + +Loadseg proc near + + mov bx,handle + mov ax,[es:di] + add di,2 + push di + push es + mov cx,ax + mov ah,3fh + int 21h + pop es + pop di + ret + + endp + + + + + +Makeheader proc near + + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + mov ax,17 + call storeit + mov ax,lengthofvars + call storeit + mov ax,lengthofextra + call storeit + mov ax,numchanges*4 + call storeit + mov ax,48 + call storeit + mov ax,lenofreelrouts + call storeit + ret + + endp + + + + + +Storeit proc near + + cmp ax,0 + jnz isntblank + inc ax +isntblank: stosw + ret + + endp + + + + +Saveseg proc near + + mov cx,[es:di] + add di,2 + push di es + mov bx,handle + mov ah,40h + int 21h + pop es di + ret + + endp + + + +Findlen proc near + + dec bx + add bx,ax +nextone: cmp cl,[bx] + jnz foundlen + dec bx + dec ax + cmp ax,0 + jnz nextone +foundlen: ret + + endp + + + + + +Scanfornames proc near + + mov dx,seg savenames + mov es,dx + mov di,offset es:savenames + mov dx,seg savefiles + mov ds,dx + mov dx,offset savefiles + mov cx,7 +scanloop: push es ds di dx cx + + if cd + call openfilefromc + else + call openfilenocheck + endif + jc notexist + pop cx + inc ch + push cx + push di es + mov dx,seg fileheader + mov ds,dx + mov dx,offset fileheader + mov cx,headerlen call savefileread - mov dx,seg fileheader - mov es,dx - mov di,offset es:filedata - pop ds dx - call loadseg - mov bx,handle - call closefile - -notexist: pop cx dx di ds es - add dx,13 - add di,17 - dec cl - jnz scanloop - mov al,ch - ret - - endp - - - - - -Decide proc near - - call setmode - call loadpalfromiff - call clearpalette - mov pointermode,0 - mov watchingtime,0 - mov pointerframe,0 - mov textaddressx,70 - mov textaddressy,182-8 - mov textlen,181 - mov manisoffscreen,1 - call loadsavebox - call showdecisions - call worktoscreen - call fadescreenup - mov getback,0 - -waitdecide: call readmouse - call showpointer - call vsync - call dumppointer - call dumptextline - call delpointer - mov bx,offset cs:decidelist - call checkcoords - cmp getback,0 - jz waitdecide - cmp getback,4 - jz hasloadedroom - call getridoftemp -hasloadedroom: mov textaddressx,13 - mov textaddressy,182 - mov textlen,240 - ret - -decidelist: dw opsx+69,opsx+124,opsy+30,opsy+76,newgame - dw opsx+20,opsx+87,opsy+10,opsy+59,dosreturn - dw opsx+123,opsx+190,opsy+10,opsy+59,loadold - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - -Showdecisions proc near - - call createpanel2 - call showopbox - mov ds,tempgraphics - mov di,opsx+17 - mov bx,opsy+13 - mov al,6 - mov ah,0 - call showframe - call undertextline - ret - - endp - - - - - -Newgame proc near - - cmp commandtype,251 - jz alreadynewgame - mov commandtype,251 - mov al,47 - call commandonly -alreadynewgame: mov ax,mousebutton - cmp ax,1 - jnz nonewgame - mov getback,3 -nonewgame: ret - - endp - - - - - - - -Loadold proc near - - cmp commandtype,252 - jz alreadyloadold - mov commandtype,252 - mov al,48 - call commandonly -alreadyloadold: mov ax,mousebutton - and ax,1 - jz noloadold - call doload - cmp getback,4 - jz noloadold - call showdecisions - call worktoscreenm - mov getback,0 -noloadold: ret - - endp - - - - + mov dx,seg fileheader + mov es,dx + mov di,offset es:filedata + pop ds dx + call loadseg + mov bx,handle + call closefile + +notexist: pop cx dx di ds es + add dx,13 + add di,17 + dec cl + jnz scanloop + mov al,ch + ret + + endp + + + + + +Decide proc near + + call setmode + call loadpalfromiff + call clearpalette + mov pointermode,0 + mov watchingtime,0 + mov pointerframe,0 + mov textaddressx,70 + mov textaddressy,182-8 + mov textlen,181 + mov manisoffscreen,1 + call loadsavebox + call showdecisions + call worktoscreen + call fadescreenup + mov getback,0 + +waitdecide: call readmouse + call showpointer + call vsync + call dumppointer + call dumptextline + call delpointer + mov bx,offset cs:decidelist + call checkcoords + cmp getback,0 + jz waitdecide + cmp getback,4 + jz hasloadedroom + call getridoftemp +hasloadedroom: mov textaddressx,13 + mov textaddressy,182 + mov textlen,240 + ret + +decidelist: dw opsx+69,opsx+124,opsy+30,opsy+76,newgame + dw opsx+20,opsx+87,opsy+10,opsy+59,dosreturn + dw opsx+123,opsx+190,opsy+10,opsy+59,loadold + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + +Showdecisions proc near + + call createpanel2 + call showopbox + mov ds,tempgraphics + mov di,opsx+17 + mov bx,opsy+13 + mov al,6 + mov ah,0 + call showframe + call undertextline + ret + + endp + + + + + +Newgame proc near + + cmp commandtype,251 + jz alreadynewgame + mov commandtype,251 + mov al,47 + call commandonly +alreadynewgame: mov ax,mousebutton + cmp ax,1 + jnz nonewgame + mov getback,3 +nonewgame: ret + + endp + + + + + + + +Loadold proc near + + cmp commandtype,252 + jz alreadyloadold + mov commandtype,252 + mov al,48 + call commandonly +alreadyloadold: mov ax,mousebutton + and ax,1 + jz noloadold + call doload + cmp getback,4 + jz noloadold + call showdecisions + call worktoscreenm + mov getback,0 +noloadold: ret + + endp + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm index 113bdd9548..9eb9afc08f 100644 --- a/devtools/tasmrecover/dreamweb/sblaster.asm +++ b/devtools/tasmrecover/dreamweb/sblaster.asm @@ -1,1293 +1,1293 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -; Creative Reality Sound Blaster Drivers . (C) 1994 Creative Reality - -; Very sparsly commented. - - - -;These drivers are not stand alone. We had them as an integral part of the -;game. -; -;Put interupt no. into SOUNDINT, base address (eg 220h) into SOUNDBASEADD. -;If interupt is 255 then no card is assumed. -; -;Call soundstartup at beginning of program to test card and initialise. -; -;This code assumes that EMS has been initialised -;Emm page frame is in variable EMMPAGEFRAME. Handle is in EMMHANDLE. -; -;Call loadsample with a filename in CS:DX (ie. in the code somewhere) -; -;To play a sample call playchannel0 or playchannel1 with sound no. in al. -; -;Call endsample to restore interupts and halt sound. -; -; - - - - -;------------------------------------------- Initial sound set up and end --- - -Loadspeech proc near - - cmp soundint,255 - jz dontbother8 - - call cancelch1 - - mov speechloaded,0 - call createname - - mov speechlength,0 - mov dx,offset cs:speechfilename - call openfilenocheck - jc dontbother8 - - mov bx,speechemmpage - -moreloadspeech: push dx bx - - push es di bx - mov al,2 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror - mov ds,emmpageframe - pop bx di es - inc bx - push es di - mov al,3 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror - mov ds,emmpageframe - mov es,emmpageframe - mov di,8000h - mov cx,4000h - mov ax,0 - rep stosw - pop di es - - mov cx,8000h - mov dx,8000h - call readfromfile - mov cl,11 - shr ax,cl - add speechlength,ax - pop bx dx - add bx,2 - cmp ax,0 - jnz moreloadspeech - call closefile - - mov es,sounddata2 - mov di,50*6 - mov ax,speechemmpage - mov [es:di],al - mov ax,0 - mov [es:di+1],ax - mov ax,speechlength - mov [es:di+3],ax - mov speechloaded,1 -dontbother8: ret - -speechfilename: db "SPEECH\" -speechfile: db "R24C0005.RAW",0 - - endp - - - -Createname proc near - - push ax - mov di,offset cs:speechfile - mov byte ptr [cs:di+0],dl ;"R" - mov [cs:di+3],cl - - mov al,dh ;reallocation - mov ah,"0"-1 -findten: inc ah - sub al,10 - jnc findten - mov [cs:di+1],ah - add al,10+"0" - mov [cs:di+2],al - pop ax - - mov cl,"0"-1 -thousandsc: inc cl - sub ax,1000 - jnc thousandsc - add ax,1000 - mov [cs:di+4],cl - mov cl,"0"-1 -hundredsc: inc cl - sub ax,100 - jnc hundredsc - add ax,100 - mov [cs:di+5],cl - mov cl,"0"-1 -tensc: inc cl - sub ax,10 - jnc tensc - add ax,10 - mov [cs:di+6],cl - add al,"0" - mov [cs:di+7],al - ret - - endp - - - - - - -Loadsample proc near - - cmp soundint,255 - jz dontbother - - call openfile - call readheader - mov bx,[es:di] - push es di bx - mov ds,sounddata - pop cx - mov dx,0 - call readfromfile - pop di es - - add di,2 - mov bx,0 - mov dx,[es:di] - add dx,1 - shr dx,1 - - mov soundemmpage,0 - -moreload: push dx bx - - push es di bx - mov al,2 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror - mov ds,emmpageframe - pop bx di es - inc bx - push es di - mov al,3 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror - mov ds,emmpageframe - pop di es - - mov cx,8000h - mov dx,8000h - call readfromfile - pop bx dx - add bx,2 - add soundemmpage,2 - dec dx - jnz moreload - ;inc soundemmpage - call closefile -dontbother: ret - -emmerror: mov gameerror,7 - jmp quickquit2 - - endp - - - - - - -Loadsecondsample proc near - - cmp soundint,255 - jz dontbother9 - - cmp ch0playing,12 - jc ch0oksecond - cmp ch0playing,255 - jz ch0oksecond - call cancelch0 - ;mov cx,100 - ;call hangon - jmp ch0oksecond -justcancel: call cancelch0 -ch0oksecond: cmp ch1playing,12 - jc ch1oksecond - call cancelch1 - -ch1oksecond: call openfile - call readheader - mov bx,[es:di] - push es di bx - mov ds,sounddata2 - pop cx - mov dx,0 - call readfromfile - - mov cx,100 - mov di,0 - mov es,sounddata2 - mov bx,soundemmpage -adjustemmpage: mov al,[es:di] - add al,bl - mov [es:di],al - add di,6 - loop adjustemmpage - - pop di es - - add di,2 - mov bx,soundemmpage - mov speechemmpage,bx - mov dx,[es:di] - add dx,1 - shr dx,1 - -moreload2: push dx bx - - push es di bx - mov al,2 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror2 - mov ds,emmpageframe - pop bx di es - inc bx - push es di - mov al,3 - mov dx,emmhandle - mov ah,44h - int 67h - cmp ah,0 - jnz emmerror2 - mov ds,emmpageframe - pop di es - - mov cx,8000h - mov dx,8000h - call readfromfile - pop bx dx - add bx,2 - add speechemmpage,2 - dec dx - jnz moreload2 - call closefile -dontbother9: ret - -emmerror2: mov gameerror,7 - jmp quickquit2 - - endp - - - - - - -Soundstartup proc near - - cmp soundint,255 - jz dontbother2 - - mov dx,soundbaseadd - add dx,0eh - mov DSP_status,dx - mov dx,soundbaseadd - add dx,0ch - mov DSP_write,dx - - mov al,1 - mov dx,soundbaseadd - add dx,0006h - out dx,al - push ax ax ax ax ax ax ax ax - pop ax ax ax ax ax ax ax ax - mov al,0 - out dx,al - - mov dx,DSP_status - mov cx,2000 -waitinit: in al,dx - and al,128 - jz waitinit - mov dx,soundbaseadd - add dx,000ah - in al,dx - cmp al,0aah - jz dspready - loop waitinit - mov gameerror,2 - jmp quickquit - -dspready: call trysoundalloc - - cli - mov ah,40h ;set sample rate - call out22c - mov ah,210 ;of 22050Hz - call out22c - sti - - call checksoundint - - mov ah,35h - mov al,soundint - add al,8 - int 21h - mov oldsoundintseg,es ; Save es:bx to temp memory - mov oldsoundintadd,bx - push cs - pop ds - mov dx,offset cs:dmaend - mov ah,25h - mov al,soundint - add al,8 - int 21h ; Set to new - - call enablesoundint - - mov al,sounddmachannel - xor ah,ah - mov bx,offset cs:dmaaddresses - add bx,ax - mov al,[cs:bx] - mov dmaaddress,al - - mov ah,0d1h ;speaker on - call out22c - mov ah,0d0h - call out22c - -dontbother2: ret - -dmaaddresses db 87h,83h,81h,82h - - endp - - - - - -Trysoundalloc proc near - - cmp needsoundbuff,1 - jz gotsoundbuff - inc soundtimes - mov bx,(16384+2048)/16 - call allocatemem - mov soundbuffer,ax - push ax - mov al,ah - mov cl,4 - shr al,cl - mov soundbufferpage,al - pop ax - mov cl,4 - shl ax,cl - mov soundbufferad,ax - cmp ax,0b7ffh - jnc soundfail - - mov es,soundbuffer - mov di,0 - mov cx,16384/2 - mov ax,7f7fh - rep stosw - mov needsoundbuff,1 - ret - -soundfail: mov es,soundbuffer - call deallocatemem -gotsoundbuff: ret - - endp - - - - - - -Setsoundoff proc near - - cmp soundint,255 - jz dontbother28 - mov soundbufferwrite,0 - cli - call setupPIT - mov soundbufferwrite,4096 - call startdmablock - sti -dontbother28: ret - - endp - - - - - - -Checksoundint proc near - - mov ah,0d3h ;speaker off - call out22c - - mov testresult,0 - mov ah,35h - mov al,soundint - add al,8 - int 21h - mov oldsoundintseg,es - mov oldsoundintadd,bx - push cs - pop ds - mov dx,offset cs:interupttest - mov ah,25h - mov al,soundint - add al,8 - int 21h - - call enablesoundint - - mov ah,0f2h - call out22c - - mov cx,20 - call hangon - - call disablesoundint - - mov dx,oldsoundintseg - mov ds,dx - mov dx,oldsoundintadd ;Restore old interupt vector - mov ah,25h - mov al,soundint - add al,8 - int 21h - - cmp testresult,1 - jz interuptworked - mov gameerror,6 ;interupt wrong - jmp quickquit ;exit to DOS with error - -interuptworked: ret - - endp - - - - - -Enablesoundint proc near - - mov dx,21h ; Enable int? - in al,dx - mov currentirq,al - mov ah,11111110b - mov cl,soundint - rol ah,cl - and al,ah - out dx,al - ret - - endp - - - - - -Disablesoundint proc near - - mov al,soundint - mov dx,21h - mov al,currentirq - out dx,al - ret - - endp - - - - -Interupttest proc near - - cli - push ax dx - mov testresult,1 - mov dx,DSP_status - in al,dx - mov al,20h - out 20h,al - pop dx ax - iret - - endp - - - - - -Soundend proc near - - cmp soundint,255 - jz dontbother3 - - call getridofPIT - - mov ah,0d0h - call out22c - - call disablesoundint - - mov ds,oldsoundintseg ;for keys - mov dx,oldsoundintadd ;Restore old interupt vector - mov ah,25h - mov al,soundint - add al,8 - int 21h - -dontbother3: ret - - endp - - - - - -Out22c proc near - - mov dx,DSP_write -notclear: in al,dx - or al,al - js notclear - mov al,ah - out dx,al - ret - - endp - - - - - -;--------------------------------------------------------------------------- - - - - -Playchannel0 proc near ;al=sound no - ;ah=times to repeat - cmp soundint,255 - jz dontbother4 - - push es ds bx cx di si - - mov ch0playing,al - mov es,sounddata - cmp al,12 - jc notsecondbank - mov es,sounddata2 - sub al,12 -notsecondbank: mov ch0repeat,ah - mov ah,0 - add ax,ax - mov bx,ax - add ax,ax - add bx,ax - - mov al,[es:bx] - mov ah,0 - mov ch0emmpage,ax - mov ax,[es:bx+1] - mov ch0offset,ax - mov ax,[es:bx+3] - mov ch0blockstocopy,ax - - cmp ch0repeat,0 - jz nosetloop - mov ax,ch0emmpage - mov ch0oldemmpage,ax - mov ax,ch0offset - mov ch0oldoffset,ax - mov ax,ch0blockstocopy - mov ch0oldblockstocopy,ax - -nosetloop: pop si di cx bx ds es - -dontbother4: ret - - endp - - - - - - - -Playchannel1 proc near ;al=sound no - - cmp soundint,255 - jz dontbother5 - cmp ch1playing,7 - jz dontbother5 - push es ds bx cx di si - - mov ch1playing,al - mov es,sounddata - cmp al,12 - jc notsecondbank1 - mov es,sounddata2 - sub al,12 -notsecondbank1: mov ah,0 - add ax,ax - mov bx,ax - add ax,ax - add bx,ax - - mov al,[es:bx] - mov ah,0 - mov ch1emmpage,ax - mov ax,[es:bx+1] - mov ch1offset,ax - mov ax,[es:bx+3] - mov ch1blockstocopy,ax - - pop si di cx bx ds es - -dontbother5: ret - - endp - - - - - - - - -Makenextblock proc near - - call volumeadjust - - call loopchannel0 - cmp ch1blockstocopy,0 - jz mightbeonlych0 - cmp ch0blockstocopy,0 - jz mightbeonlych1 - - dec ch0blockstocopy - dec ch1blockstocopy - call bothchannels - ret - -mightbeonlych1: mov ch0playing,255 - cmp ch1blockstocopy,0 - jz notch1only - dec ch1blockstocopy - call channel1only -notch1only: ret - -mightbeonlych0: mov ch1playing,255 - cmp ch0blockstocopy,0 - jz notch0only - dec ch0blockstocopy - call channel0only - ret -notch0only: mov es,soundbuffer - mov di,soundbufferwrite - mov cx,1024 - mov ax,7f7fh - rep stosw - and di,16384-1 - mov soundbufferwrite,di - ret - - endp - - - - -Volumeadjust proc near - - mov al,volumedirection - cmp al,0 - jz volok - mov al,volume - cmp al,volumeto - jz volfinish - add volumecount,64 - jnz volok - mov al,volume - add al,volumedirection - mov volume,al - ret -volfinish: mov volumedirection,0 -volok: ret - - endp - - - -Loopchannel0 proc near - - cmp ch0blockstocopy,0 - jnz notloop - cmp ch0repeat,0 - jz notloop - cmp ch0repeat,255 - jz endlessloop - dec ch0repeat -endlessloop: mov ax,ch0oldemmpage - mov ch0emmpage,ax - mov ax,ch0oldoffset - mov ch0offset,ax - mov ax,ch0blockstocopy - add ax,ch0oldblockstocopy - mov ch0blockstocopy,ax - ret -notloop: ret - - endp - - - - - - - -Cancelch0 proc near - - mov ch0repeat,0 - mov ch0blockstocopy,0 - mov ch0playing,255 - ret - - endp - - - -Cancelch1 proc near - - mov ch1blockstocopy,0 - mov ch1playing,255 - ret - - endp - - - - -Channel0only proc near - - call saveems - mov al,0 - mov bx,ch0emmpage - mov dx,emmhandle - mov ah,44h - int 67h - - mov es,soundbuffer - mov ds,emmpageframe - mov di,soundbufferwrite - mov si,ch0offset - - call channel0tran - call restoreems - - and di,16384-1 - mov soundbufferwrite,di - and si,16384-1 - mov ch0offset,si - cmp si,0 - jnz notch0endofpage0 - inc ch0emmpage -notch0endofpage0: ret - - endp - - - - -Channel1only proc near - - call saveems - mov al,1 - mov bx,ch1emmpage - mov dx,emmhandle - mov ah,44h - int 67h - - mov es,soundbuffer - mov ds,emmpageframe - mov di,soundbufferwrite - mov si,ch1offset - add si,16384 - - mov cx,1024 - rep movsw - call restoreems - - and di,16384-1 - mov soundbufferwrite,di - and si,16384-1 - mov ch1offset,si - cmp si,0 - jnz notch1endofpage1 - inc ch1emmpage -notch1endofpage1: ret - - endp - - - - - -Channel0tran proc near - - cmp volume,0 - jnz lowvolumetran - mov cx,1024 - rep movsw - ret - -lowvolumetran: mov cx,1024 - mov bh,volume - mov bl,0 - add bx,16384-256 -volloop: lodsw - mov bl,al - mov al,[es:bx] - mov bl,ah - mov ah,[es:bx] - stosw - loop volloop - ret - - - endp - - - - - - - - -Bothchannels proc near ;rather slow routine - ;to mix two channels - - call saveems - mov al,0 - mov bx,ch0emmpage - mov dx,emmhandle - mov ah,44h - int 67h - mov al,1 - mov bx,ch1emmpage - mov dx,emmhandle - mov ah,44h - int 67h - - mov es,soundbuffer - mov ds,emmpageframe - mov di,soundbufferwrite - mov si,ch0offset - mov bx,ch1offset - add bx,16384 - mov cx,2048 - mov dh,128 - mov dl,255 - - call domix - call restoreems - - and di,16384-1 - mov soundbufferwrite,di - - mov si,ch0offset - add si,2048 - and si,16384-1 - mov ch0offset,si - cmp si,0 - jnz notbothendofpage0 - inc ch0emmpage -notbothendofpage0: mov si,ch1offset - add si,2048 - and si,16384-1 - mov ch1offset,si - cmp si,0 - jnz notbothendofpage1 - inc ch1emmpage -notbothendofpage1: ret - - endp - - - -Saveems proc near - - mov ah,4eh - mov al,0 - mov es,soundbuffer - mov di,16384+2048-256 - int 67h - ret - - endp - - -Restoreems proc near - - push si di - mov ah,4eh - mov al,1 - mov ds,soundbuffer - mov si,16384+2048-256 - int 67h - pop di si - ret - - endp - - - -Domix proc near - - cmp volume,0 - jnz lowvolumemix - -slow: lodsb - mov ah,[bx] - inc bx - cmp al,dh - jnc toplot - -botlot: cmp ah,dh - jnc nodistort - add al,ah - js botok - xor al,al - stosb - loop slow - jmp doneit -botok: xor al,dh - stosb - loop slow - jmp doneit - -toplot: cmp ah,dh - jc nodistort - add al,ah - jns topok - mov al,dl - stosb - loop slow - jmp doneit -topok: xor al,dh - stosb - loop slow - jmp doneit - -nodistort: add al,ah - xor al,dh - stosb - loop slow - jmp doneit - - -lowvolumemix: lodsb - push bx - mov bh,volume - add bh,63 - mov bl,al - mov al,[es:bx] - pop bx - - mov ah,[bx] - inc bx - cmp al,dh - jnc toplotv - -botlotv: cmp ah,dh - jnc nodistortv - add al,ah - js botokv - xor al,al - stosb - loop lowvolumemix - jmp doneit -botokv: xor al,dh - stosb - loop lowvolumemix - jmp doneit - -toplotv: cmp ah,dh - jc nodistortv - add al,ah - jns topokv - mov al,dl - stosb - loop lowvolumemix - jmp doneit -topokv: xor al,dh - stosb - loop lowvolumemix - jmp doneit - -nodistortv: add al,ah - xor al,dh - stosb - loop lowvolumemix -doneit: ret - - - endp - - - - - - - -Dmaend proc near - - cli - push ax cx dx - call startdmablock - mov dx,DSP_status - in al,dx - mov al,20h - out 20h,al - pop dx cx ax - iret - - endp - - - - - - - - - - - - - - - - -Startdmablock proc near - - mov al,sounddmachannel ;cx=length - or al,4 ;bx=offset - out 0ah,al - xor al,al - out 0ch,al - - mov al,48h - or al,sounddmachannel - out 0bh,al - - mov cx,soundbufferad - xor dh,dh - mov dl,sounddmachannel - shl dl,1 - mov al,cl - out dx,al - mov al,ch - out dx,al - - mov dl,dmaaddress - mov al,soundbufferpage ;hardware page - out dx,al - - mov dl,sounddmachannel - shl dl,1 - inc dl - mov cx,16384-1 - mov al,cl - out dx,al - mov al,ch - out dx,al - - mov al,sounddmachannel - out 0ah,al ;dmac programmed - - mov dx,DSP_write -notclear1: in al,dx - or al,al - js notclear1 - mov al,14h - out dx,al -notclear2: in al,dx - or al,al - js notclear2 - mov al,cl - out dx,al -notclear3: in al,dx - or al,al - js notclear3 - mov al,ch - out dx,al - - ret - - - endp - - - - - - - - - - - - - - - -SetupPIT proc near - - mov ah,35h - mov al,8 - int 21h - mov oldint8seg,es ; Save es:bx to temp memory - mov oldint8add,bx - push cs - pop ds - mov dx,offset cs:PITinterupt - mov ah,25h - mov al,8 - int 21h ; Set to new - - mov al,34h - out 43h,al - mov al,0h - out 40h,al - mov al,0dah - out 40h,al - ret - - endp - - - - - - -Getridofpit proc near - - cmp oldint8seg,-1 - jz noresetPIT - mov dx,oldint8add - mov ax,oldint8seg - mov ds,ax - mov ah,25h - mov al,8 - int 21h - mov al,34h - out 43h,al - mov al,0 - out 40h,al - mov al,0 - out 40h,al -noresetPIT: ret - - endp - - - - - - -PITinterupt proc near - - cli - push ax dx cx - - xor dh,dh - mov dl,sounddmachannel - shl dl,1 - in al,dx - mov cl,al - in al,dx - mov ch,al - sub cx,soundbufferad - mov ax,soundbufferwrite - sub ax,cx - and ax,3fffh - sti - cmp ax,8192 - jnc mustgo - cmp ax,2048 - jnc nopitflip - -mustgo: push bx si di es ds - call makenextblock - pop ds es di si bx - -nopitflip: cli - mov al,20h - out 20h,al - pop cx dx ax - iret - - endp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; Creative Reality Sound Blaster Drivers . (C) 1994 Creative Reality + +; Very sparsly commented. + + + +;These drivers are not stand alone. We had them as an integral part of the +;game. +; +;Put interupt no. into SOUNDINT, base address (eg 220h) into SOUNDBASEADD. +;If interupt is 255 then no card is assumed. +; +;Call soundstartup at beginning of program to test card and initialise. +; +;This code assumes that EMS has been initialised +;Emm page frame is in variable EMMPAGEFRAME. Handle is in EMMHANDLE. +; +;Call loadsample with a filename in CS:DX (ie. in the code somewhere) +; +;To play a sample call playchannel0 or playchannel1 with sound no. in al. +; +;Call endsample to restore interupts and halt sound. +; +; + + + + +;------------------------------------------- Initial sound set up and end --- + +Loadspeech proc near + + cmp soundint,255 + jz dontbother8 + + call cancelch1 + + mov speechloaded,0 + call createname + + mov speechlength,0 + mov dx,offset cs:speechfilename + call openfilenocheck + jc dontbother8 + + mov bx,speechemmpage + +moreloadspeech: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + mov es,emmpageframe + mov di,8000h + mov cx,4000h + mov ax,0 + rep stosw + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + mov cl,11 + shr ax,cl + add speechlength,ax + pop bx dx + add bx,2 + cmp ax,0 + jnz moreloadspeech + call closefile + + mov es,sounddata2 + mov di,50*6 + mov ax,speechemmpage + mov [es:di],al + mov ax,0 + mov [es:di+1],ax + mov ax,speechlength + mov [es:di+3],ax + mov speechloaded,1 +dontbother8: ret + +speechfilename: db "SPEECH\" +speechfile: db "R24C0005.RAW",0 + + endp + + + +Createname proc near + + push ax + mov di,offset cs:speechfile + mov byte ptr [cs:di+0],dl ;"R" + mov [cs:di+3],cl + + mov al,dh ;reallocation + mov ah,"0"-1 +findten: inc ah + sub al,10 + jnc findten + mov [cs:di+1],ah + add al,10+"0" + mov [cs:di+2],al + pop ax + + mov cl,"0"-1 +thousandsc: inc cl + sub ax,1000 + jnc thousandsc + add ax,1000 + mov [cs:di+4],cl + mov cl,"0"-1 +hundredsc: inc cl + sub ax,100 + jnc hundredsc + add ax,100 + mov [cs:di+5],cl + mov cl,"0"-1 +tensc: inc cl + sub ax,10 + jnc tensc + add ax,10 + mov [cs:di+6],cl + add al,"0" + mov [cs:di+7],al + ret + + endp + + + + + + +Loadsample proc near + + cmp soundint,255 + jz dontbother + + call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata + pop cx + mov dx,0 + call readfromfile + pop di es + + add di,2 + mov bx,0 + mov dx,[es:di] + add dx,1 + shr dx,1 + + mov soundemmpage,0 + +moreload: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add soundemmpage,2 + dec dx + jnz moreload + ;inc soundemmpage + call closefile +dontbother: ret + +emmerror: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Loadsecondsample proc near + + cmp soundint,255 + jz dontbother9 + + cmp ch0playing,12 + jc ch0oksecond + cmp ch0playing,255 + jz ch0oksecond + call cancelch0 + ;mov cx,100 + ;call hangon + jmp ch0oksecond +justcancel: call cancelch0 +ch0oksecond: cmp ch1playing,12 + jc ch1oksecond + call cancelch1 + +ch1oksecond: call openfile + call readheader + mov bx,[es:di] + push es di bx + mov ds,sounddata2 + pop cx + mov dx,0 + call readfromfile + + mov cx,100 + mov di,0 + mov es,sounddata2 + mov bx,soundemmpage +adjustemmpage: mov al,[es:di] + add al,bl + mov [es:di],al + add di,6 + loop adjustemmpage + + pop di es + + add di,2 + mov bx,soundemmpage + mov speechemmpage,bx + mov dx,[es:di] + add dx,1 + shr dx,1 + +moreload2: push dx bx + + push es di bx + mov al,2 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop bx di es + inc bx + push es di + mov al,3 + mov dx,emmhandle + mov ah,44h + int 67h + cmp ah,0 + jnz emmerror2 + mov ds,emmpageframe + pop di es + + mov cx,8000h + mov dx,8000h + call readfromfile + pop bx dx + add bx,2 + add speechemmpage,2 + dec dx + jnz moreload2 + call closefile +dontbother9: ret + +emmerror2: mov gameerror,7 + jmp quickquit2 + + endp + + + + + + +Soundstartup proc near + + cmp soundint,255 + jz dontbother2 + + mov dx,soundbaseadd + add dx,0eh + mov DSP_status,dx + mov dx,soundbaseadd + add dx,0ch + mov DSP_write,dx + + mov al,1 + mov dx,soundbaseadd + add dx,0006h + out dx,al + push ax ax ax ax ax ax ax ax + pop ax ax ax ax ax ax ax ax + mov al,0 + out dx,al + + mov dx,DSP_status + mov cx,2000 +waitinit: in al,dx + and al,128 + jz waitinit + mov dx,soundbaseadd + add dx,000ah + in al,dx + cmp al,0aah + jz dspready + loop waitinit + mov gameerror,2 + jmp quickquit + +dspready: call trysoundalloc + + cli + mov ah,40h ;set sample rate + call out22c + mov ah,210 ;of 22050Hz + call out22c + sti + + call checksoundint + + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es ; Save es:bx to temp memory + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:dmaend + mov ah,25h + mov al,soundint + add al,8 + int 21h ; Set to new + + call enablesoundint + + mov al,sounddmachannel + xor ah,ah + mov bx,offset cs:dmaaddresses + add bx,ax + mov al,[cs:bx] + mov dmaaddress,al + + mov ah,0d1h ;speaker on + call out22c + mov ah,0d0h + call out22c + +dontbother2: ret + +dmaaddresses db 87h,83h,81h,82h + + endp + + + + + +Trysoundalloc proc near + + cmp needsoundbuff,1 + jz gotsoundbuff + inc soundtimes + mov bx,(16384+2048)/16 + call allocatemem + mov soundbuffer,ax + push ax + mov al,ah + mov cl,4 + shr al,cl + mov soundbufferpage,al + pop ax + mov cl,4 + shl ax,cl + mov soundbufferad,ax + cmp ax,0b7ffh + jnc soundfail + + mov es,soundbuffer + mov di,0 + mov cx,16384/2 + mov ax,7f7fh + rep stosw + mov needsoundbuff,1 + ret + +soundfail: mov es,soundbuffer + call deallocatemem +gotsoundbuff: ret + + endp + + + + + + +Setsoundoff proc near + + cmp soundint,255 + jz dontbother28 + mov soundbufferwrite,0 + cli + call setupPIT + mov soundbufferwrite,4096 + call startdmablock + sti +dontbother28: ret + + endp + + + + + + +Checksoundint proc near + + mov ah,0d3h ;speaker off + call out22c + + mov testresult,0 + mov ah,35h + mov al,soundint + add al,8 + int 21h + mov oldsoundintseg,es + mov oldsoundintadd,bx + push cs + pop ds + mov dx,offset cs:interupttest + mov ah,25h + mov al,soundint + add al,8 + int 21h + + call enablesoundint + + mov ah,0f2h + call out22c + + mov cx,20 + call hangon + + call disablesoundint + + mov dx,oldsoundintseg + mov ds,dx + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + + cmp testresult,1 + jz interuptworked + mov gameerror,6 ;interupt wrong + jmp quickquit ;exit to DOS with error + +interuptworked: ret + + endp + + + + + +Enablesoundint proc near + + mov dx,21h ; Enable int? + in al,dx + mov currentirq,al + mov ah,11111110b + mov cl,soundint + rol ah,cl + and al,ah + out dx,al + ret + + endp + + + + + +Disablesoundint proc near + + mov al,soundint + mov dx,21h + mov al,currentirq + out dx,al + ret + + endp + + + + +Interupttest proc near + + cli + push ax dx + mov testresult,1 + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx ax + iret + + endp + + + + + +Soundend proc near + + cmp soundint,255 + jz dontbother3 + + call getridofPIT + + mov ah,0d0h + call out22c + + call disablesoundint + + mov ds,oldsoundintseg ;for keys + mov dx,oldsoundintadd ;Restore old interupt vector + mov ah,25h + mov al,soundint + add al,8 + int 21h + +dontbother3: ret + + endp + + + + + +Out22c proc near + + mov dx,DSP_write +notclear: in al,dx + or al,al + js notclear + mov al,ah + out dx,al + ret + + endp + + + + + +;--------------------------------------------------------------------------- + + + + +Playchannel0 proc near ;al=sound no + ;ah=times to repeat + cmp soundint,255 + jz dontbother4 + + push es ds bx cx di si + + mov ch0playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank + mov es,sounddata2 + sub al,12 +notsecondbank: mov ch0repeat,ah + mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch0emmpage,ax + mov ax,[es:bx+1] + mov ch0offset,ax + mov ax,[es:bx+3] + mov ch0blockstocopy,ax + + cmp ch0repeat,0 + jz nosetloop + mov ax,ch0emmpage + mov ch0oldemmpage,ax + mov ax,ch0offset + mov ch0oldoffset,ax + mov ax,ch0blockstocopy + mov ch0oldblockstocopy,ax + +nosetloop: pop si di cx bx ds es + +dontbother4: ret + + endp + + + + + + + +Playchannel1 proc near ;al=sound no + + cmp soundint,255 + jz dontbother5 + cmp ch1playing,7 + jz dontbother5 + push es ds bx cx di si + + mov ch1playing,al + mov es,sounddata + cmp al,12 + jc notsecondbank1 + mov es,sounddata2 + sub al,12 +notsecondbank1: mov ah,0 + add ax,ax + mov bx,ax + add ax,ax + add bx,ax + + mov al,[es:bx] + mov ah,0 + mov ch1emmpage,ax + mov ax,[es:bx+1] + mov ch1offset,ax + mov ax,[es:bx+3] + mov ch1blockstocopy,ax + + pop si di cx bx ds es + +dontbother5: ret + + endp + + + + + + + + +Makenextblock proc near + + call volumeadjust + + call loopchannel0 + cmp ch1blockstocopy,0 + jz mightbeonlych0 + cmp ch0blockstocopy,0 + jz mightbeonlych1 + + dec ch0blockstocopy + dec ch1blockstocopy + call bothchannels + ret + +mightbeonlych1: mov ch0playing,255 + cmp ch1blockstocopy,0 + jz notch1only + dec ch1blockstocopy + call channel1only +notch1only: ret + +mightbeonlych0: mov ch1playing,255 + cmp ch0blockstocopy,0 + jz notch0only + dec ch0blockstocopy + call channel0only + ret +notch0only: mov es,soundbuffer + mov di,soundbufferwrite + mov cx,1024 + mov ax,7f7fh + rep stosw + and di,16384-1 + mov soundbufferwrite,di + ret + + endp + + + + +Volumeadjust proc near + + mov al,volumedirection + cmp al,0 + jz volok + mov al,volume + cmp al,volumeto + jz volfinish + add volumecount,64 + jnz volok + mov al,volume + add al,volumedirection + mov volume,al + ret +volfinish: mov volumedirection,0 +volok: ret + + endp + + + +Loopchannel0 proc near + + cmp ch0blockstocopy,0 + jnz notloop + cmp ch0repeat,0 + jz notloop + cmp ch0repeat,255 + jz endlessloop + dec ch0repeat +endlessloop: mov ax,ch0oldemmpage + mov ch0emmpage,ax + mov ax,ch0oldoffset + mov ch0offset,ax + mov ax,ch0blockstocopy + add ax,ch0oldblockstocopy + mov ch0blockstocopy,ax + ret +notloop: ret + + endp + + + + + + + +Cancelch0 proc near + + mov ch0repeat,0 + mov ch0blockstocopy,0 + mov ch0playing,255 + ret + + endp + + + +Cancelch1 proc near + + mov ch1blockstocopy,0 + mov ch1playing,255 + ret + + endp + + + + +Channel0only proc near + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + + call channel0tran + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notch0endofpage0 + inc ch0emmpage +notch0endofpage0: ret + + endp + + + + +Channel1only proc near + + call saveems + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch1offset + add si,16384 + + mov cx,1024 + rep movsw + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notch1endofpage1 + inc ch1emmpage +notch1endofpage1: ret + + endp + + + + + +Channel0tran proc near + + cmp volume,0 + jnz lowvolumetran + mov cx,1024 + rep movsw + ret + +lowvolumetran: mov cx,1024 + mov bh,volume + mov bl,0 + add bx,16384-256 +volloop: lodsw + mov bl,al + mov al,[es:bx] + mov bl,ah + mov ah,[es:bx] + stosw + loop volloop + ret + + + endp + + + + + + + + +Bothchannels proc near ;rather slow routine + ;to mix two channels + + call saveems + mov al,0 + mov bx,ch0emmpage + mov dx,emmhandle + mov ah,44h + int 67h + mov al,1 + mov bx,ch1emmpage + mov dx,emmhandle + mov ah,44h + int 67h + + mov es,soundbuffer + mov ds,emmpageframe + mov di,soundbufferwrite + mov si,ch0offset + mov bx,ch1offset + add bx,16384 + mov cx,2048 + mov dh,128 + mov dl,255 + + call domix + call restoreems + + and di,16384-1 + mov soundbufferwrite,di + + mov si,ch0offset + add si,2048 + and si,16384-1 + mov ch0offset,si + cmp si,0 + jnz notbothendofpage0 + inc ch0emmpage +notbothendofpage0: mov si,ch1offset + add si,2048 + and si,16384-1 + mov ch1offset,si + cmp si,0 + jnz notbothendofpage1 + inc ch1emmpage +notbothendofpage1: ret + + endp + + + +Saveems proc near + + mov ah,4eh + mov al,0 + mov es,soundbuffer + mov di,16384+2048-256 + int 67h + ret + + endp + + +Restoreems proc near + + push si di + mov ah,4eh + mov al,1 + mov ds,soundbuffer + mov si,16384+2048-256 + int 67h + pop di si + ret + + endp + + + +Domix proc near + + cmp volume,0 + jnz lowvolumemix + +slow: lodsb + mov ah,[bx] + inc bx + cmp al,dh + jnc toplot + +botlot: cmp ah,dh + jnc nodistort + add al,ah + js botok + xor al,al + stosb + loop slow + jmp doneit +botok: xor al,dh + stosb + loop slow + jmp doneit + +toplot: cmp ah,dh + jc nodistort + add al,ah + jns topok + mov al,dl + stosb + loop slow + jmp doneit +topok: xor al,dh + stosb + loop slow + jmp doneit + +nodistort: add al,ah + xor al,dh + stosb + loop slow + jmp doneit + + +lowvolumemix: lodsb + push bx + mov bh,volume + add bh,63 + mov bl,al + mov al,[es:bx] + pop bx + + mov ah,[bx] + inc bx + cmp al,dh + jnc toplotv + +botlotv: cmp ah,dh + jnc nodistortv + add al,ah + js botokv + xor al,al + stosb + loop lowvolumemix + jmp doneit +botokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +toplotv: cmp ah,dh + jc nodistortv + add al,ah + jns topokv + mov al,dl + stosb + loop lowvolumemix + jmp doneit +topokv: xor al,dh + stosb + loop lowvolumemix + jmp doneit + +nodistortv: add al,ah + xor al,dh + stosb + loop lowvolumemix +doneit: ret + + + endp + + + + + + + +Dmaend proc near + + cli + push ax cx dx + call startdmablock + mov dx,DSP_status + in al,dx + mov al,20h + out 20h,al + pop dx cx ax + iret + + endp + + + + + + + + + + + + + + + + +Startdmablock proc near + + mov al,sounddmachannel ;cx=length + or al,4 ;bx=offset + out 0ah,al + xor al,al + out 0ch,al + + mov al,48h + or al,sounddmachannel + out 0bh,al + + mov cx,soundbufferad + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov dl,dmaaddress + mov al,soundbufferpage ;hardware page + out dx,al + + mov dl,sounddmachannel + shl dl,1 + inc dl + mov cx,16384-1 + mov al,cl + out dx,al + mov al,ch + out dx,al + + mov al,sounddmachannel + out 0ah,al ;dmac programmed + + mov dx,DSP_write +notclear1: in al,dx + or al,al + js notclear1 + mov al,14h + out dx,al +notclear2: in al,dx + or al,al + js notclear2 + mov al,cl + out dx,al +notclear3: in al,dx + or al,al + js notclear3 + mov al,ch + out dx,al + + ret + + + endp + + + + + + + + + + + + + + + +SetupPIT proc near + + mov ah,35h + mov al,8 + int 21h + mov oldint8seg,es ; Save es:bx to temp memory + mov oldint8add,bx + push cs + pop ds + mov dx,offset cs:PITinterupt + mov ah,25h + mov al,8 + int 21h ; Set to new + + mov al,34h + out 43h,al + mov al,0h + out 40h,al + mov al,0dah + out 40h,al + ret + + endp + + + + + + +Getridofpit proc near + + cmp oldint8seg,-1 + jz noresetPIT + mov dx,oldint8add + mov ax,oldint8seg + mov ds,ax + mov ah,25h + mov al,8 + int 21h + mov al,34h + out 43h,al + mov al,0 + out 40h,al + mov al,0 + out 40h,al +noresetPIT: ret + + endp + + + + + + +PITinterupt proc near + + cli + push ax dx cx + + xor dh,dh + mov dl,sounddmachannel + shl dl,1 + in al,dx + mov cl,al + in al,dx + mov ch,al + sub cx,soundbufferad + mov ax,soundbufferwrite + sub ax,cx + and ax,3fffh + sti + cmp ax,8192 + jnc mustgo + cmp ax,2048 + jnc nopitflip + +mustgo: push bx si di es ds + call makenextblock + pop ds es di si bx + +nopitflip: cli + mov al,20h + out 20h,al + pop cx dx ax + iret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm index 31325fc2b3..bb7ba402f8 100644 --- a/devtools/tasmrecover/dreamweb/sprite.asm +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -1,5034 +1,5034 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;------------------------------------------------------------People Routines---- - - - -Reelroutines db 1,44,0 ;Room number and x,y - dw 20 ;reel pointer - db 2,0,1 ;speed,speed count,convers. no. - - db 1,55,0 - dw 0 - db 50,20,0 - - db 24,22,0 - dw 74 - db 1,0,0 - - db 24,33,10 - dw 75 - db 1,0,1 - - db 1,44,0 - dw 27 - db 2,0,2 - - db 1,44,0 - dw 96 - db 3,0,4 - - db 1,44,0 - dw 118 - db 2,0,5 - - db 1,44,10 - dw 0 - db 2,0,0 - - db 5,22,20 - dw 53 - db 3,0,0 - - db 5,22,20 - dw 40 - db 1,0,2 - - db 5,22,20 - dw 50 - db 1,0,3 - - db 2,11,10 - dw 192 - db 1,0,0 - - db 2,11,10 - dw 182 - db 2,0,1 - - db 8,11,10 - dw 0 - db 2,0,1 - - db 23,0,50 - dw 0 - db 3,0,0 - - db 28,11,20 - dw 250 - db 4,0,0 - - db 23,0,50 - dw 43 - db 2,0,8 - - db 23,11,40 - dw 130 - db 2,0,1 - - db 23,22,40 - dw 122 - db 2,0,2 - - db 23,22,40 - dw 105 - db 2,0,3 - - db 23,22,40 - dw 81 - db 2,0,4 - - db 23,11,40 - dw 135 - db 2,0,5 - - db 23,22,40 - dw 145 - db 2,0,6 - - db 4,22,30 - dw 0 - db 2,0,0 - - db 45,22,30 - dw 200 - db 0,0,20 - - db 45,22,30 - dw 39 - db 2,0,0 - - db 45,22,30 - dw 25 - db 2,0,0 - - db 8,22,40 - dw 32 - db 2,0,0 - - db 7,11,20 - dw 64 - db 2,0,0 - - db 22,22,20 - dw 82 - db 2,0,0 - - db 27,11,30 - dw 0 - db 2,0,0 - - db 20,0,30 - dw 0 - db 2,0,0 - - db 14,33,40 - dw 21 - db 1,0,0 - - db 29,11,10 - dw 0 - db 1,0,0 - - db 2,22,0 - dw 2 - db 2,0,0 - - db 25,0,50 - dw 4 - db 2,0,0 - - db 50,22,30 - dw 121 - db 2,0,0 - - db 50,22,30 - dw 0 - db 20,0,0 - - db 52,22,30 - dw 192 - db 2,0,0 - - db 52,22,30 - dw 233 - db 2,0,0 - - db 50,22,40 - dw 104 - if cd - if german - db 65,0,0 - else - db 55,0,0 - endif - else - db 55,0,0 - endif - - db 53,33,0 - dw 99 - db 2,0,0 - - db 50,22,40 - dw 0 - db 3,0,0 - - db 50,22,30 - dw 162 - db 2,0,0 - - db 52,22,30 - dw 57 - db 2,0,0 - - db 52,22,30 - dw 0 - db 2,0,0 - - db 54,0,0 - dw 72 - db 3,0,0 - - db 55,44,0 - dw 0 - db 2,0,0 - - db 19,0,0 - dw 0 - db 28,0,0 - - db 14,22,0 - dw 2 - db 2,0,0 - - db 14,22,0 - dw 300 - db 1,0,0 - - db 10,22,30 - dw 174 - db 0,0,0 - - db 12,22,20 - dw 0 - db 1,0,0 - - db 11,11,20 - dw 0 - db 50,20,0 - - db 11,11,30 - dw 0 - db 50,20,0 - - db 11,22,20 - dw 0 - db 50,20,0 - - db 14,33,40 - dw 0 - db 50,20,0 - - db 255 - - -Lenofreelrouts equ $-reelroutines - - -Reelcalls dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke - dw manasleep,drunk,receptionist,malefan,femalefan - dw louis,louischair,soldier1,bossman,interviewer - dw heavy,manasleep2,mansatstill,drinker,bartender - dw othersmoker,tattooman,attendant,keeper,candles1 - dw smallcandle,security,copper,poolguard,rockstar - dw businessman,train,aide,mugger,helicopter - dw intromagic1,intromusic,intromagic2,candles2,gates - dw intromagic3,intromonks1,candles,intromonks2 - dw handclap,monkandryan,endgameseq,priest,madman - dw madmanstelly,alleybarksound,foghornsound - dw carparkdrip,carparkdrip,carparkdrip,carparkdrip - - - -;---------------------------------------------------------Character updates---- - - - -Alleybarksound proc near - - mov ax,[es:bx+3] - dec ax - cmp ax,0 - jnz nobark - push bx es - mov al,14 - call playchannel1 - pop es bx - mov ax,1000 -nobark: mov [es:bx+3],ax - ret - - endp - - - - -Intromusic proc near - - ret - - endp - - -Foghornsound proc near - - call randomnumber - cmp al,198 - jnz nofog - mov al,13 - call playchannel1 -nofog: ret - - endp - - - - -Receptionist proc near - - call checkspeed - jnz gotrecep - cmp cardpassflag,1 - jnz notsetcard - inc cardpassflag - mov byte ptr [es:bx+7],1 - mov word ptr [es:bx+3],64 -notsetcard: cmp word ptr [es:bx+3],58 - jnz notdes1 - call randomnumber - cmp al,30 - jc notdes2 - mov word ptr [es:bx+3],55 - jmp gotrecep - -notdes1: cmp word ptr [es:bx+3],60 - jnz notdes2 - call randomnumber - cmp al,240 - jc gotrecep - mov word ptr [es:bx+3],53 - jmp gotrecep - -notdes2: cmp word ptr [es:bx+3],88 - jnz notendcard - mov word ptr [es:bx+3],53 - jmp gotrecep - -notendcard: inc word ptr [es:bx+3] -gotrecep: call showgamereel - call addtopeoplelist - - mov al,[es:bx+7] - and al,128 - jz nottalkedrecep - mov talkedtorecep,1 -nottalkedrecep: ret - - endp - - - - -Smokebloke proc near - - cmp rockstardead,0 - jnz notspokento - mov al,[es:bx+7] - and al,128 - jz notspokento - push es bx - mov al,5 - call setlocation - pop bx es -notspokento: ;mov al,[es:bx+7] - ;and al,127 - ;mov [es:bx+7],al - call checkspeed - jnz gotsmokeb - cmp word ptr [es:bx+3],100 - jnz notsmokeb1 - call randomnumber - cmp al,30 - jc notsmokeb2 - mov word ptr [es:bx+3],96 - jmp gotsmokeb - -notsmokeb1: cmp word ptr [es:bx+3],117 - jnz notsmokeb2 - mov word ptr [es:bx+3],96 - jmp gotsmokeb - -notsmokeb2: inc word ptr [es:bx+3] -gotsmokeb: call showgamereel - call addtopeoplelist - ret - - endp - - - - - - - - - - -Attendant proc near - - call showgamereel - call addtopeoplelist - mov al,[es:bx+7] - and al,128 - jz nottalked - mov talkedtoattendant,1 -nottalked: ret - - endp - - - - - - -Manasleep proc near - - mov al,[es:bx+7] - and al,127 - mov [es:bx+7],al - call showgamereel - call addtopeoplelist - ret - - endp - - - -Eden proc near - - cmp generaldead,0 - jnz notinbed - call showgamereel - call addtopeoplelist -notinbed: ret - - endp - - - -Edeninbath proc near - - cmp generaldead,0 - jz notinbed - cmp sartaindead,0 - jnz notinbath - call showgamereel - call addtopeoplelist -notinbath: ret - - endp - - - -Malefan proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - - -Femalefan proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - - - -Louis proc near - - cmp rockstardead,0 - jnz notlouis1 - call showgamereel - call addtopeoplelist -notlouis1: ret - - endp - - - - -Louischair proc near - - cmp rockstardead,0 - jz notlouis2 - call checkspeed - jnz notlouisanim - mov ax,[es:bx+3] - inc ax - cmp ax,191 - jz restartlouis - cmp ax,185 - jz randomlouis - mov [es:bx+3],ax - jmp notlouisanim -randomlouis: mov [es:bx+3],ax - call randomnumber - cmp al,245 - jnc notlouisanim -restartlouis: mov ax,182 - mov [es:bx+3],ax -notlouisanim: call showgamereel - call addtopeoplelist -notlouis2: ret - - endp - - - -Manasleep2 proc near - - mov al,[es:bx+7] - and al,127 - mov [es:bx+7],al - call showgamereel - call addtopeoplelist - ret - - endp - - - - -Mansatstill proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - -Tattooman proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - -Drinker proc near - - call checkspeed - jnz gotdrinker - inc word ptr [es:bx+3] - cmp word ptr [es:bx+3],115 - jnz notdrinker1 - mov word ptr [es:bx+3],105 - jmp gotdrinker - -notdrinker1: cmp word ptr [es:bx+3],106 - jnz gotdrinker - call randomnumber - cmp al,3 - jc gotdrinker - mov word ptr [es:bx+3],105 - -gotdrinker: call showgamereel - call addtopeoplelist - ret - - endp - - - - - -Bartender proc near - - call checkspeed - jnz gotsmoket - cmp word ptr [es:bx+3],86 - jnz notsmoket1 - call randomnumber - cmp al,18 - jc notsmoket2 - mov word ptr [es:bx+3],81 - jmp gotsmoket - -notsmoket1: cmp word ptr [es:bx+3],103 - jnz notsmoket2 - mov word ptr [es:bx+3],81 - jmp gotsmoket - -notsmoket2: inc word ptr [es:bx+3] -gotsmoket: call showgamereel - cmp gunpassflag,1 - jnz notgotgun - mov byte ptr [es:bx+7],9 -notgotgun: call addtopeoplelist - ret - - endp - - - - - - - -Othersmoker proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - - - - - -Barwoman proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - - - - - - - - -Interviewer proc near - - cmp reeltowatch,68 - jnz notgeneralstart - inc word ptr [es:bx+3] -notgeneralstart: cmp word ptr [es:bx+3],250 - jz talking - call checkspeed - jnz talking - cmp word ptr [es:bx+3],259 - jz talking - inc word ptr [es:bx+3] -talking: call showgamereel - ret - - endp - - - - - -Soldier1 proc near - - cmp word ptr [es:bx+3],0 - jz soldierwait - mov watchingtime,10 - cmp word ptr [es:bx+3],30 - jnz notaftersshot - inc combatcount - cmp combatcount,40 - jnz gotsoldframe - mov mandead,2 - jmp gotsoldframe -notaftersshot: call checkspeed - jnz gotsoldframe - inc word ptr [es:bx+3] - jmp gotsoldframe -soldierwait: cmp lastweapon,1 - jnz gotsoldframe - mov watchingtime,10 - cmp manspath,2 - jnz gotsoldframe - cmp facing,4 - jnz gotsoldframe - inc word ptr [es:bx+3] - mov lastweapon,-1 - mov combatcount,0 -gotsoldframe: call showgamereel - call addtopeoplelist - ret - - endp - - - - - - - - -Rockstar proc near - - mov ax,[es:bx+3] - cmp ax,303 - jz rockcombatend - cmp ax,118 - jz rockcombatend - call checkspeed - jnz rockspeed - - mov ax,[es:bx+3] - inc ax - cmp ax,118 - jnz notbeforedead - mov mandead,2 - jmp gotrockframe - -notbeforedead: cmp ax,79 - jnz gotrockframe - dec ax - cmp lastweapon,1 - jnz notgunonrock - mov lastweapon,-1 - mov ax,123 - jmp gotrockframe -notgunonrock: inc combatcount - cmp combatcount,40 - jnz gotrockframe - mov combatcount,0 - mov ax,79 - -gotrockframe: mov [es:bx+3],ax -rockspeed: call showgamereel - cmp word ptr [es:bx+3],78 - jnz notalkrock - call addtopeoplelist - mov pointermode,2 - mov watchingtime,0 - ret - -notalkrock: mov watchingtime,2 - mov pointermode,0 - mov al,mapy - mov [es:bx+2],al - ret - -rockcombatend: mov newlocation,45 - call showgamereel - ret - - endp - - - - - - - - - - - - - - - -Helicopter proc near - - mov ax,[es:bx+3] - cmp ax,203 - jz heliwon - ;cmp ax,53 - ;jz helicombatend - call checkspeed - jnz helispeed - - mov ax,[es:bx+3] - inc ax - cmp ax,53 - jnz notbeforehdead - inc combatcount - cmp combatcount,8 - jc waitabit - mov mandead,2 -waitabit: mov ax,49 - jmp gotheliframe - -notbeforehdead: cmp ax,9 - jnz gotheliframe - dec ax - cmp lastweapon,1 - jnz notgunonheli - mov lastweapon,-1 - mov ax,55 - jmp gotheliframe -notgunonheli: mov ax,5 - inc combatcount - cmp combatcount,20 - jnz gotheliframe - mov combatcount,0 - mov ax,9 - -gotheliframe: mov [es:bx+3],ax -helispeed: call showgamereel - mov al,mapx - mov [es:bx+1],al -helicombatend: mov ax,[es:bx+3] - cmp ax,9 ;8 - jnc notwaitingheli - cmp combatcount,7 - jc notwaitingheli - mov pointermode,2 - mov watchingtime,0 - ret -notwaitingheli: mov pointermode,0 - mov watchingtime,2 - ret - -heliwon: mov pointermode,0 - ret - - endp - - -Mugger proc near - - mov ax,[es:bx+3] - cmp ax,138 - jz endmugger1 - cmp ax,176 - jz endmugger2 - cmp ax,2 - jnz havesetwatch - mov watchingtime,175*2 -havesetwatch: call checkspeed - jnz notmugger - inc word ptr [es:bx+3] -notmugger: call showgamereel - mov al,mapx - mov [es:bx+1],al - ret - -endmugger1: push es bx - call createpanel2 - call showicon - mov al,41 - call findpuztext - mov di,33+20 - mov bx,104 - mov dl,241 - mov ah,0 - call printdirect - call worktoscreen - mov cx,300 - call hangon - pop bx es - push es bx - mov word ptr [es:bx+3],140 - mov manspath,2 - mov finaldest,2 - call findxyfrompath - mov resetmanxy,1 - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"A" - call findexobject - mov command,al - mov objecttype,4 - call removeobfrominv - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"B" - call findexobject - mov command,al - mov objecttype,4 - call removeobfrominv - call makemainscreen - mov al,48 - mov bl,68-32 - mov bh,54+64 - mov cx,70 ; time on screen - mov dx,10 ; pause before show - call setuptimeduse - mov beenmugged,1 - pop bx es - ret - -endmugger2: ret - - - endp - - - - - - - - -Aide proc near - - call showgamereel - call addtopeoplelist - ret - - endp - - - - - - -Businessman proc near - - mov pointermode,0 - mov watchingtime,2 - mov ax,[es:bx+3] - cmp ax,2 - jnz notfirstbiz - push ax bx es - mov al,49 - mov cx,30 - mov dx,1 - mov bl,68 - mov bh,174 - call setuptimeduse - pop es bx ax - -notfirstbiz: cmp ax,95 - jz buscombatwonend - cmp ax,49 - jz buscombatend - - call checkspeed - jnz busspeed - - mov ax,[es:bx+3] - inc ax - cmp ax,48 - jnz notbeforedeadb - mov mandead,2 - jmp gotbusframe - -notbeforedeadb: cmp ax,15 - jnz buscombatwon - dec ax - cmp lastweapon,3 - jnz notshieldonbus - mov lastweapon,-1 - mov combatcount,0 - mov ax,51 - jmp gotbusframe -notshieldonbus: inc combatcount - cmp combatcount,20 - jnz gotbusframe - mov combatcount,0 - mov ax,15 - jmp gotbusframe - -buscombatwon: cmp ax,91 - jnz gotbusframe - push bx es - mov al,0 - call turnpathon - mov al,1 - call turnpathon - mov al,2 - call turnpathon - mov al,3 - call turnpathoff - mov manspath,5 - mov finaldest,5 - call findxyfrompath - mov resetmanxy,1 - pop es bx - mov ax,92 - jmp gotbusframe - -gotbusframe: mov [es:bx+3],ax -busspeed: call showgamereel - mov al,mapy - mov [es:bx+2],al - mov ax,[es:bx+3] - cmp ax,14 - jnz buscombatend - mov watchingtime,0 - mov pointermode,2 - ret - -buscombatend: ret - -buscombatwonend: mov pointermode,0 - mov watchingtime,0 - ret - - endp - - - - - - -Poolguard proc near - - mov ax,[es:bx+3] - cmp ax,214 - jz combatover2 - cmp ax,258 - jz combatover2 - cmp ax,185 - jz combatover1 - cmp ax,0 - jnz notfirstpool - mov al,0 - call turnpathon -notfirstpool: call checkspeed - jnz guardspeed - - mov ax,[es:bx+3] - inc ax - cmp ax,122 - jnz notendguard1 - dec ax - cmp lastweapon,2 - jnz notaxeonpool - mov lastweapon,-1 - mov ax,122 - jmp gotguardframe -notaxeonpool: inc combatcount - cmp combatcount,40 - jnz gotguardframe - mov combatcount,0 - mov ax,195 - jmp gotguardframe - -notendguard1: cmp ax,147 - jnz gotguardframe - dec ax - cmp lastweapon,1 - jnz notgunonpool - mov lastweapon,-1 - mov ax,147 - jmp gotguardframe -notgunonpool: inc combatcount - cmp combatcount,40 - jnz gotguardframe - mov combatcount,0 - mov ax,220 - -gotguardframe: mov [es:bx+3],ax -guardspeed: call showgamereel - mov ax,[es:bx+3] - cmp ax,121 - jz iswaitingpool - cmp ax,146 - jz iswaitingpool - mov pointermode,0 - mov watchingtime,2 - ret -iswaitingpool: mov pointermode,2 - mov watchingtime,0 - ret - -combatover1: mov watchingtime,0 - mov pointermode,0 - mov al,0 - call turnpathon - mov al,1 - call turnpathoff - ret - -combatover2: call showgamereel - mov watchingtime,2 - mov pointermode,0 - inc combatcount - cmp combatcount,100 - jc doneover2 - mov watchingtime,0 - mov mandead,2 -doneover2: ret - - endp - - - - - - - - - - -Security proc near - - cmp word ptr [es:bx+3],32 - jz securwait - cmp word ptr [es:bx+3],69 - jnz notaftersec - ret -notaftersec: mov watchingtime,10 - call checkspeed - jnz gotsecurframe - inc word ptr [es:bx+3] - jmp gotsecurframe -securwait: cmp lastweapon,1 - jnz gotsecurframe - mov watchingtime,10 - cmp manspath,9 - jnz gotsecurframe - cmp facing,0 - jnz gotsecurframe - mov lastweapon,-1 - inc word ptr [es:bx+3] -gotsecurframe: call showgamereel - call addtopeoplelist - ret - - endp - - - - - - -Heavy proc near - - mov al,[es:bx+7] - and al,127 - mov [es:bx+7],al - cmp word ptr [es:bx+3],43 - jz heavywait - mov watchingtime,10 - cmp word ptr [es:bx+3],70 - jnz notafterhshot - inc combatcount - cmp combatcount,80 - jnz gotheavyframe - mov mandead,2 - jmp gotheavyframe -notafterhshot: call checkspeed - jnz gotheavyframe - inc word ptr [es:bx+3] - jmp gotheavyframe -heavywait: cmp lastweapon,1 - jnz gotheavyframe - cmp manspath,5 - jnz gotheavyframe - cmp facing,4 - jnz gotheavyframe - mov lastweapon,-1 - inc word ptr [es:bx+3] - mov combatcount,0 -gotheavyframe: call showgamereel - call addtopeoplelist - ret - - endp - - - - -Bossman proc near - - call checkspeed - jnz notboss - mov ax,[es:bx+3] - inc ax - cmp ax,4 - jz firstdes - cmp ax,20 - jz secdes - cmp ax,41 - jnz gotallboss - mov ax,0 - inc gunpassflag - mov byte ptr [es:bx+7],10 - jmp gotallboss -firstdes: cmp gunpassflag,1 - jz gotallboss - push ax - call randomnumber - mov cl,al - pop ax - cmp cl,10 - jc gotallboss - mov ax,0 - jmp gotallboss -secdes: cmp gunpassflag,1 - jz gotallboss - mov ax,0 -gotallboss: mov [es:bx+3],ax -notboss: call showgamereel - call addtopeoplelist - - mov al,[es:bx+7] - and al,128 - jz nottalkedboss - mov talkedtoboss,1 -nottalkedboss: ret - - endp - - - - - -Gamer proc near - - call checkspeed - jnz gamerfin -gameragain: call randomnum1 - and al,7 - cmp al,5 - jnc gameragain - add al,20 - cmp al,[es:bx+3] - jz gameragain - mov ah,0 - mov [es:bx+3],ax -gamerfin: call showgamereel - call addtopeoplelist - ret - - endp - - - - - -Sparkydrip proc near - - call checkspeed - jnz cantdrip - mov al,14 - mov ah,0 - call playchannel0 -cantdrip: ret - - endp - - - -Carparkdrip proc near - - call checkspeed - jnz cantdrip2 - mov al,14 - call playchannel1 -cantdrip2: ret - - endp - - - -Keeper proc near - - cmp keeperflag,0 - jnz notwaiting - cmp reeltowatch,190 - jc waiting - inc keeperflag - mov ah,[es:bx+7] - and ah,127 - cmp ah,dreamnumber - jz notdiff - mov al,dreamnumber - mov [es:bx+7],al -notdiff: ret -notwaiting: call addtopeoplelist - call showgamereel -waiting: ret - - endp - - - -Candles1 proc near - - call checkspeed - jnz candle1 - mov ax,[es:bx+3] - inc ax - cmp ax,44 - jnz notendcandle1 - mov ax,39 -notendcandle1: mov [es:bx+3],ax -candle1: call showgamereel - ret - - endp - - - -Smallcandle proc near - - call checkspeed - jnz smallcandlef - mov ax,[es:bx+3] - inc ax - cmp ax,37 - jnz notendsmallcandle - mov ax,25 -notendsmallcandle: mov [es:bx+3],ax -smallcandlef: call showgamereel - ret - - endp - - - - - - - - - - - -Intromagic1 proc near - - call checkspeed - jnz introm1fin - mov ax,[es:bx+3] - inc ax - cmp ax,145 - jnz gotintrom1 - mov ax,121 -gotintrom1: mov [es:bx+3],ax - cmp ax,121 - jnz introm1fin - inc introcount - push es bx - call intro1text - pop bx es - cmp introcount,8 ; was 7 - jnz introm1fin - add mapy,10 - mov nowinnewroom,1 -introm1fin: call showgamereel - ret - - endp - - - - -Candles proc near - - call checkspeed - jnz candlesfin - mov ax,[es:bx+3] - inc ax - cmp ax,167 - jnz gotcandles - mov ax,162 -gotcandles: mov [es:bx+3],ax -candlesfin: call showgamereel - ret - - endp - - - -Candles2 proc near - - call checkspeed - jnz candles2fin - mov ax,[es:bx+3] - inc ax - cmp ax,238 - jnz gotcandles2 - mov ax,233 -gotcandles2: mov [es:bx+3],ax -candles2fin: call showgamereel - ret - - endp - - - -Gates proc near - - call checkspeed - jnz gatesfin - mov ax,[es:bx+3] - inc ax - cmp ax,116 - jnz notbang - push ax bx es - mov al,17 ;12 - call playchannel1 - pop es bx ax -notbang: cmp ax,110 - jc slowgates - mov byte ptr [es:bx+5],2 -slowgates: cmp ax,120 - jnz gotgates - mov getback,1 - mov ax,119 -gotgates: mov [es:bx+3],ax - push es bx - call intro3text - pop bx es -gatesfin: call showgamereel - ret - - endp - - - - -Intromagic2 proc near - - call checkspeed - jnz introm2fin - mov ax,[es:bx+3] - inc ax - cmp ax,216 - jnz gotintrom2 - mov ax,192 -gotintrom2: mov [es:bx+3],ax -introm2fin: call showgamereel - ret - - endp - - - - -Intromagic3 proc near - - call checkspeed - jnz introm3fin - mov ax,[es:bx+3] - inc ax - cmp ax,218 - jnz gotintrom3 - mov getback,1 -gotintrom3: mov [es:bx+3],ax -introm3fin: call showgamereel - mov al,mapx - mov [es:bx+1],al - ret - - endp - - - - - - - -Intromonks1 proc near - - call checkspeed - jnz intromonk1fin - mov ax,[es:bx+3] - inc ax - cmp ax,80 - jnz notendmonk1 - add mapy,10 - mov nowinnewroom,1 - call showgamereel - ret -notendmonk1: cmp ax,30 - jnz gotintromonk1 - sub mapy,10 - mov nowinnewroom,1 - mov ax,51 -gotintromonk1: mov [es:bx+3],ax - cmp ax,5 - jz waitstep - cmp ax,15 - jz waitstep - cmp ax,25 - jz waitstep - cmp ax,61 - jz waitstep - cmp ax,71 - jz waitstep - jmp intromonk1fin -waitstep: push es bx - call intro2text - pop bx es - mov byte ptr [es:bx+6],-20 -intromonk1fin: call showgamereel - mov al,mapy - mov [es:bx+2],al - ret - - endp - - - - -Intromonks2 proc near - - call checkspeed - jnz intromonk2fin - mov ax,[es:bx+3] - inc ax - cmp ax,87 - jnz nottalk1 - inc introcount - push es bx - call monks2text - pop bx es - cmp introcount,19 - jnz notlasttalk1 - mov ax,87 - jmp gotintromonk2 -notlasttalk1: mov ax,74 - jmp gotintromonk2 - -nottalk1: cmp ax,110 - jnz notraisearm - inc introcount - push es bx - call monks2text - pop bx es - if cd - if german - cmp introcount,42 - else - cmp introcount,35 - endif - else - cmp introcount,35 - endif - jnz notlastraise - mov ax,111 - jmp gotintromonk2 -notlastraise: mov ax,98 - jmp gotintromonk2 - -notraisearm: cmp ax,176 - jnz notendmonk2 - mov getback,1 - jmp gotintromonk2 -notendmonk2: cmp ax,125 - jnz gotintromonk2 - mov ax,140 -gotintromonk2: mov [es:bx+3],ax -intromonk2fin: call showgamereel - ret - - endp - - - - - -Handclap proc near - - ret - - endp - - - - - if german - if cd - -Monks2text proc near - - cmp introcount,1 - jnz notmonk2text1 - mov al,8 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text1: cmp introcount,5 - jnz notmonk2text2 - mov al,9 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text2: cmp introcount,9 - jnz notmonk2text3 - mov al,10 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text3: cmp introcount,13 - jnz notmonk2text4 - mov introcount,14 - mov al,11 - mov bl,0 - mov bh,105 - mov cx,100 - jmp gotmonks2text -notmonk2text4: cmp introcount,19 - jnz notmonk2text7 - mov al,14 - mov bl,36 - mov bh,160 - mov cx,100 ;32 - mov dx,1 - mov ah,82 - jmp setuptimedtemp -notmonk2text7: cmp introcount,23 - jnz notmonk2text8 - mov al,15 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text8: cmp introcount,27 - jnz notmonk2text9 - mov al,16 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text9: cmp introcount,30 - jnz notmonk2text10 - mov al,17 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text10: cmp introcount,35 - jnz notmonk2text11 - mov al,18 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text11: ret - -gotmonks2text: mov dx,1 - mov cx,120 - mov ah,82 - call setuptimedtemp - ret - - endp - - else - -Monks2text proc near - - cmp introcount,1 - jnz notmonk2text1 - mov al,8 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text1: cmp introcount,4 - jnz notmonk2text2 - mov al,9 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text2: cmp introcount,7 - jnz notmonk2text3 - mov al,10 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text3: cmp introcount,10 - jnz notmonk2text4 - if cd - mov introcount,12 - endif - mov al,11 - mov bl,0 - mov bh,105 - mov cx,100 - jmp gotmonks2text -notmonk2text4: cmp introcount,13 - jnz notmonk2text5 - if cd - mov introcount,17; 18 - ret - endif - mov al,12 - mov bl,0 - mov bh,120 - mov cx,100 - jmp gotmonks2text -notmonk2text5: cmp introcount,16 - jnz notmonk2text6 - mov al,13 - mov bl,0 - mov bh,135 - mov cx,100 - jmp gotmonks2text -notmonk2text6: cmp introcount,19 - jnz notmonk2text7 - mov al,14 - mov bl,36 - mov bh,160 - mov cx,100 ;32 - mov dx,1 - mov ah,82 - jmp setuptimedtemp -notmonk2text7: cmp introcount,22 - jnz notmonk2text8 - mov al,15 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text8: cmp introcount,25 - jnz notmonk2text9 - mov al,16 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text9: if cd - cmp introcount,27 - else - cmp introcount,28 - endif - jnz notmonk2text10 - mov al,17 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text10: cmp introcount,31 - jnz notmonk2text11 - mov al,18 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text11: ret - -gotmonks2text: mov dx,1 - mov cx,120 - mov ah,82 - call setuptimedtemp - ret - - endp - - - endif - else - -Monks2text proc near - - cmp introcount,1 - jnz notmonk2text1 - mov al,8 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text1: cmp introcount,4 - jnz notmonk2text2 - mov al,9 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text2: cmp introcount,7 - jnz notmonk2text3 - mov al,10 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text3: cmp introcount,10 - jnz notmonk2text4 - if cd - mov introcount,12 - endif - mov al,11 - mov bl,0 - mov bh,105 - mov cx,100 - jmp gotmonks2text -notmonk2text4: cmp introcount,13 - jnz notmonk2text5 - if cd - mov introcount,17; 18 - ret - endif - mov al,12 - mov bl,0 - mov bh,120 - mov cx,100 - jmp gotmonks2text -notmonk2text5: cmp introcount,16 - jnz notmonk2text6 - mov al,13 - mov bl,0 - mov bh,135 - mov cx,100 - jmp gotmonks2text -notmonk2text6: cmp introcount,19 - jnz notmonk2text7 - mov al,14 - mov bl,36 - mov bh,160 - mov cx,100 ;32 - mov dx,1 - mov ah,82 - jmp setuptimedtemp -notmonk2text7: cmp introcount,22 - jnz notmonk2text8 - mov al,15 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text8: cmp introcount,25 - jnz notmonk2text9 - mov al,16 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text9: if cd - cmp introcount,27 - else - cmp introcount,28 - endif - jnz notmonk2text10 - mov al,17 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text10: cmp introcount,31 - jnz notmonk2text11 - mov al,18 - mov bl,36 - mov bh,160 - mov cx,100 - jmp gotmonks2text -notmonk2text11: ret - -gotmonks2text: mov dx,1 - mov cx,120 - mov ah,82 - call setuptimedtemp - ret - - endp - - endif - - - - - - -Intro1text proc near - - cmp introcount,2 - jnz notintro1text1 - mov al,40 - mov bl,34 - mov bh,130 - mov cx,90 - jmp gotintro1text -notintro1text1: cmp introcount,4 - jnz notintro1text2 - mov al,41 - mov bl,34 - mov bh,130 - mov cx,90 - jmp gotintro1text -notintro1text2: cmp introcount,6 - jnz notintro1text3 - mov al,42 - mov bl,34 - mov bh,130 - mov cx,90 - jmp gotintro1text -notintro1text3: ret - -gotintro1text: mov dx,1 - mov ah,82 - if cd - cmp ch1playing,255 - jz oktalk2 - dec introcount - ret - endif -oktalk2: call setuptimedtemp - ret - - endp - - - -Intro2text proc near - - cmp ax,5 - jnz notintro2text1 - mov al,43 - mov bl,34 - mov bh,40 - mov cx,90 - jmp gotintro2text -notintro2text1: cmp ax,15 - jnz notintro2text2 - mov al,44 - mov bl,34 - mov bh,40 - mov cx,90 - jmp gotintro2text -notintro2text2: ret - -gotintro2text: mov dx,1 - mov ah,82 - call setuptimedtemp - ret - - endp - - - - - - -Intro3text proc near - - cmp ax,107 - jnz notintro3text1 - mov al,45 - mov bl,36 - mov bh,56 - mov cx,100 - jmp gotintro3text -notintro3text1: if cd - cmp ax,108 - else - cmp ax,109 - endif - jnz notintro3text2 - mov al,46 - mov bl,36 - mov bh,56 - mov cx,100 - jmp gotintro3text -notintro3text2: ret - -gotintro3text: mov dx,1 - mov ah,82 - call setuptimedtemp - ret - - endp - - - - - - - -Monkandryan proc near - - call checkspeed - jnz notmonkryan - mov ax,[es:bx+3] - inc ax - cmp ax,83 - jnz gotmonkryan - inc introcount - push es bx - call textformonk - pop bx es - mov ax,77 - cmp introcount,57 - jnz gotmonkryan - mov getback,1 - ret -gotmonkryan: mov [es:bx+3],ax -notmonkryan: call showgamereel - ret - - endp - - - - - -Endgameseq proc near - - call checkspeed - jnz notendseq - mov ax,[es:bx+3] - inc ax - cmp ax,51 - jnz gotendseq - cmp introcount,140 - jz gotendseq - inc introcount - push es bx - call textforend - pop bx es - mov ax,50 -gotendseq: mov [es:bx+3],ax - cmp ax,134 - jnz notfadedown - push es bx ax - call fadescreendownhalf - pop ax bx es - jmp notendseq -notfadedown: cmp ax,324 - jnz notfadeend - push es bx ax - call fadescreendowns - mov volumeto,7 - mov volumedirection,1 - pop ax bx es -notfadeend: cmp ax,340 - jnz notendseq - mov getback,1 -notendseq: call showgamereel - mov al,mapy - mov [es:bx+2],al - mov ax,[es:bx+3] - cmp ax,145 - jnz notendcreds - mov word ptr [es:bx+3],146 - call rollendcredits -notendcreds: ret - - endp - - - - - - -Rollendcredits proc near - - mov al,16 - mov ah,255 - call playchannel0 - mov volume,7 - mov volumeto,0 - mov volumedirection,-1 - - mov cl,160 - mov ch,160 - mov di,75 - mov bx,20 - mov ds,mapstore - mov si,0 - call multiget - - mov es,textfile1 - mov si,3*2 - mov ax,[es:si] - mov si,ax - add si,textstart - - mov cx,254 -endcredits1: push cx - - mov bx,10 - mov cx,linespacing -endcredits2: push cx si di es bx - - call vsync - mov cl,160 - mov ch,160 - mov di,75 - mov bx,20 - mov ds,mapstore - mov si,0 - call multiput - call vsync - pop bx es di si - push si di es bx - - mov cx,18 -onelot: push cx - mov di,75 - mov dx,161 - mov ax,0 - call printdirect - add bx,linespacing - pop cx - loop onelot - - call vsync - mov cl,160 - mov ch,160 - mov di,75 - mov bx,20 - call multidump - - pop bx es di si cx - dec bx - loop endcredits2 - pop cx -looknext: mov al,[es:si] - inc si - cmp al,":" - jz gotnext - cmp al,0 - jz gotnext - jmp looknext -gotnext: loop endcredits1 - - mov cx,100 - call hangon - call paneltomap - call fadescreenuphalf - ret - - endp - - - - - - -Priest proc near - - cmp word ptr [es:bx+3],8 - jz priestspoken - mov pointermode,0 - mov watchingtime,2 - call checkspeed - jnz priestwait - inc word ptr [es:bx+3] - push es bx - call priesttext - pop bx es -priestwait: ret - -priestspoken: ret - - endp - - - - - - -Madmanstelly proc near - - mov ax,[es:bx+3] - inc ax - cmp ax,307 - jnz notendtelly - mov ax,300 -notendtelly: mov [es:bx+3],ax - call showgamereel - ret - - endp - - - - - -Madman proc near - - mov watchingtime,2 - call checkspeed - jnz nomadspeed - mov ax,[es:bx+3] - cmp ax,364 - jnc ryansded - cmp ax,10 - jnz notfirstmad - push es bx ax - mov dx,offset cs:introtextname - call loadtemptext - pop ax bx es - mov combatcount,-1 - mov speechcount,0 -notfirstmad: inc ax - cmp ax,294 - jz madmanspoken - cmp ax,66 - jnz nomadspeak - inc combatcount - push es bx - call madmantext - pop bx es - mov ax,53 - if cd - cmp combatcount,64 - else - cmp combatcount,62 - endif - jc nomadspeak - if cd - cmp combatcount,70 - else - cmp combatcount,68 - endif - jz killryan - cmp lastweapon,8 - jnz nomadspeak - if cd - mov combatcount,72 - else - mov combatcount,70 - endif - mov lastweapon,-1 - mov madmanflag,1 - mov ax,67 - jmp nomadspeak -killryan: mov ax,310 -nomadspeak: mov [es:bx+3],ax -nomadspeed: call showgamereel - mov al,mapx - mov [es:bx+1],al - call madmode - ret -madmanspoken: cmp wongame,1 - jz alreadywon - mov wongame,1 - push es bx - call getridoftemptext - pop bx es -alreadywon: ret - -ryansded: mov mandead,2 - call showgamereel - ret - - endp - - - - - - - - - - if cd -Madmantext proc near - - cmp speechcount,63 - jnc nomadtext - cmp ch1playing,255 - jnz nomadtext - - mov al,speechcount - inc speechcount - add al,47 - mov bl,72 - mov bh,80 - mov cx,90 - mov dx,1 - mov ah,82 - call setuptimedtemp -nomadtext: ret - - endp - - else - -Madmantext proc near - - cmp combatcount,61 - jnc nomadtext - mov al,combatcount - and al,3 - jnz nomadtext - mov al,combatcount - shr al,1 - shr al,1 - add al,47 - mov bl,72 - mov bh,80 - mov cx,90 - mov dx,1 - mov ah,82 - call setuptimedtemp -nomadtext: ret - - endp - endif - - - - -Madmode proc near - - mov watchingtime,2 - mov pointermode,0 - if cd - cmp combatcount,65 - else - cmp combatcount,63 - endif - jc iswatchmad - if cd - cmp combatcount,70 - else - cmp combatcount,68 - endif - jnc iswatchmad - mov pointermode,2 -iswatchmad: ret - - endp - - - - - -Priesttext proc near - - cmp word ptr [es:bx+3],2 - jc nopriesttext - cmp word ptr [es:bx+3],7 - jnc nopriesttext - mov al,[es:bx+3] - and al,1 - jnz nopriesttext - mov al,[es:bx+3] - shr al,1 - add al,50 - mov bl,72 - mov bh,80 - mov cx,54 - mov dx,1 - call setuptimeduse -nopriesttext: ret - - endp - - - - -Textforend proc near - - cmp introcount,20 - jnz notendtext1 - mov al,0 - mov bl,34 - mov bh,20 - mov cx,60 - jmp gotendtext -notendtext1: if cd - cmp introcount,50 - else - cmp introcount,65 - endif - jnz notendtext2 - mov al,1 - mov bl,34 - mov bh,20 - mov cx,60 - jmp gotendtext -notendtext2: if cd - cmp introcount,85 - else - cmp introcount,110 - endif - jnz notendtext3 - mov al,2 - mov bl,34 - mov bh,20 - mov cx,60 - jmp gotendtext -notendtext3: ret - -gotendtext: mov dx,1 - mov ah,83 - call setuptimedtemp - ret - - endp - - - - - - - - -Textformonk proc near - - cmp introcount,1 - jnz notmonktext1 - mov al,19 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext1: cmp introcount,5 - jnz notmonktext2 - mov al,20 - mov bl,68 - mov bh,38 - mov cx,120 - jmp gotmonktext -notmonktext2: cmp introcount,9 - jnz notmonktext3 - mov al,21 - mov bl,48 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext3: cmp introcount,13 - jnz notmonktext4 - mov al,22 - mov bl,68 - mov bh,38 - mov cx,120 - jmp gotmonktext -notmonktext4: if cd - cmp introcount,15 - else - cmp introcount,17 - endif - jnz notmonktext5 - mov al,23 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext5: cmp introcount,21 - jnz notmonktext6 - mov al,24 - mov bl,68 - mov bh,38 - mov cx,120 - jmp gotmonktext -notmonktext6: cmp introcount,25 - jnz notmonktext7 - mov al,25 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext7: cmp introcount,29 - jnz notmonktext8 - mov al,26 - mov bl,68 - mov bh,38 - mov cx,120 - jmp gotmonktext -notmonktext8: cmp introcount,33 - jnz notmonktext9 - mov al,27 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext9: cmp introcount,37 - jnz notmonktext10 - mov al,28 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext10: cmp introcount,41 - jnz notmonktext11 - mov al,29 - mov bl,68 - mov bh,38 - mov cx,120 - jmp gotmonktext -notmonktext11: cmp introcount,45 - jnz notmonktext12 - mov al,30 - mov bl,68 - mov bh,154 - mov cx,120 - jmp gotmonktext -notmonktext12: if cd - cmp introcount,52 - else - cmp introcount,49 - endif - jnz notmonktext13 - mov al,31 - mov bl,68 - mov bh,154 - mov cx,220 ;132 - jmp gotmonktext -notmonktext13: cmp introcount,53 - jnz notendtitles - call fadescreendowns - if cd - mov volumeto,7 - mov volumedirection,1 - endif -notendtitles: ret - -gotmonktext: mov dx,1 - mov ah,82 - if cd - cmp ch1playing,255 - jz oktalk - dec introcount - ret - endif -oktalk: call setuptimedtemp - ret - - endp - - - - - - - - - - -Drunk proc near - - cmp generaldead,0 - jnz trampgone - mov al,[es:bx+7] - and al,127 - mov [es:bx+7],al - call showgamereel - call addtopeoplelist -trampgone: ret - - endp - - -Advisor proc near - - call checkspeed - jnz noadvisor - jmp noadvisor - mov ax,[es:bx+3] - inc ax - cmp ax,123 - jnz notendadvis - mov ax,106 - jmp gotadvframe -notendadvis: cmp ax,108 - jnz gotadvframe - push ax - call randomnumber - mov cl,al - pop ax - cmp cl,3 - jc gotadvframe - mov ax,106 -gotadvframe: mov [es:bx+3],ax -noadvisor: call showgamereel - call addtopeoplelist - ret - - endp - - - -Copper proc near - - call checkspeed - jnz nocopper - mov ax,[es:bx+3] - inc ax - cmp ax,94 - jnz notendcopper - mov ax,64 - jmp gotcopframe -notendcopper: cmp ax,81 - jz mightwait - cmp ax,66 - jnz gotcopframe -mightwait: push ax - call randomnumber - mov cl,al - pop ax - cmp cl,7 - jc gotcopframe - dec ax -gotcopframe: mov [es:bx+3],ax -nocopper: call showgamereel - call addtopeoplelist - ret - - endp - - - - - - - - - - -Sparky proc near - - cmp card1money,0 - jz animsparky - mov byte ptr [es:bx+7],3 - jmp animsparky - -animsparky: call checkspeed - jnz finishsparky - cmp word ptr [es:bx+3],34 - jnz notsparky1 - call randomnumber - cmp al,30 - jc dosparky - mov word ptr [es:bx+3],27 - jmp finishsparky - -notsparky1: cmp word ptr [es:bx+3],48 - jnz dosparky - mov word ptr [es:bx+3],27 - jmp finishsparky - -dosparky: inc word ptr [es:bx+3] -finishsparky: call showgamereel - call addtopeoplelist - - mov al,[es:bx+7] - and al,128 - jz nottalkedsparky - mov talkedtosparky,1 -nottalkedsparky: ret - - endp - - - - - -Train proc near - - ret - mov ax,[es:bx+3] - cmp ax,21 - jnc notrainyet - inc ax - jmp gottrainframe -notrainyet: call randomnumber - cmp al,253 - jc notrainatall - cmp manspath,5 - jnz notrainatall - cmp finaldest,5 - jnz notrainatall - mov ax,5 -gottrainframe: mov [es:bx+3],ax - call showgamereel -notrainatall: ret - - endp - - - - - - - -Addtopeoplelist proc near - - push es bx bx - mov cl,[es:bx+7] - mov ax,[es:bx+3] - mov bx,listpos - mov es,buffers - mov [es:bx],ax ;reel pointer position - pop ax - mov [es:bx+2],ax - mov [es:bx+4],cl ;coversation number - pop bx es - add listpos,5 - ret - - endp - - - -Showgamereel proc near - - mov ax,[es:bx+3] - cmp ax,512 - jnc noshow - mov reelpointer,ax - push es bx - call plotreel - pop bx es - mov ax,reelpointer - mov [es:bx+3],ax -noshow: ret - - endp - - - - - - -Checkspeed proc near - - cmp lastweapon,-1 - jnz forcenext - inc byte ptr [es:bx+6] - mov al,[es:bx+6] - cmp al,[es:bx+5] - jnz notspeed - mov al,0 - mov [es:bx+6],al - cmp al,al -notspeed: ret - -forcenext: cmp al,al - ret - - endp - - - - - - - - - - -;------------------------------------------------------------Sprite Routines---- - - - -Clearsprites proc near - - mov es,buffers - mov di,spritetable - mov al,255 - mov cx,tablesize*16 - rep stosb - ret - - endp - - - - -Makesprite proc near ;si holds x,y cx holds update - ;di,dx holds data offset,seg - mov es,buffers - mov bx,spritetable -$17: cmp byte ptr [es:bx+15],255 - jz $17a - add bx,tablesize - jmp $17 - -$17a: mov [es:bx],cx - mov [es:bx+10],si - mov [es:bx+6],dx - mov [es:bx+8],di - mov [es:bx+2],0ffffh - mov byte ptr [es:bx+15],0 - mov byte ptr [es:bx+18],0 - ret - - endp - - - - - - - - - - -Delsprite proc near - - mov di,bx - mov cx,tablesize - mov al,255 - rep stosb - ret - - endp - - - - - - - - - - -Spriteupdate proc near - - mov es,buffers - mov bx,spritetable - mov al,ryanon - mov byte ptr [es:bx+31],al - - mov es,buffers - mov bx,spritetable - mov cx,16 -$18: push cx bx - mov ax,[es:bx] - cmp ax,0ffffh - jz $18a - push es ds - mov cx,[es:bx+2] - mov [es:bx+24],cx - call ax - pop ds es -$18a: pop bx cx - cmp nowinnewroom,1 - jz $18b - add bx,tablesize - loop $18 - -$18b: ret - - endp - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Printsprites proc near - - mov es,buffers - mov cx,0 -priorityloop: push cx - mov priority,cl - mov bx,spritetable - mov cx,16 -prtspriteloop: push cx bx - mov ax,[es:bx] - cmp ax,0ffffh - jz skipsprite - mov al,priority - cmp al,[es:bx+23] - jnz skipsprite - cmp byte ptr [es:bx+31],1 - jz skipsprite - call printasprite -skipsprite: pop bx cx - add bx,tablesize - loop prtspriteloop - pop cx - inc cx - cmp cx,7 - jnz priorityloop - ret - - endp - - - - - - - - - - -Printasprite proc near - - push es bx - mov si,bx - mov ds,[es:si+6] - mov al,[es:si+11] - mov ah,0 - cmp al,220 - jc notnegative1 - mov ah,255 -notnegative1: mov bx,ax - add bx,mapady - mov al,[es:si+10] - mov ah,0 - cmp al,220 - jc notnegative2 - mov ah,255 -notnegative2: mov di,ax - add di,mapadx - mov al,[es:si+15] - mov ah,0 - cmp byte ptr [es:si+30],0 - jz steadyframe - mov ah,8 -steadyframe: cmp priority,6 - jnz notquickp -notquickp: call showframe - pop bx es - ret - - endp - - - - -;cmp priority,6 -; ;jz quicksprite ; WIll NEED TO DO THIS LATER!!!!! -;Quicksprite: mov cl,al -; mov ch,0 -; mov dx,[es:bx+6] -; mov es,workspace -; mov ds,dx -; mov bx,ax -; mov dx,vgawidth -; -;printquickloop: push di si -; -; push si -; add si,cx -; dec si -; jmp startzero -;zeroloop: dec si -; dec cl -;startzero: cmp [si],ch -; jz zeroloop -; pop si -; -;;printquickline: cmp [si],ch -; jnz foundfirstpix -; inc si -; inc di -; dec cl -; jnz printquickline -; -;foundfirstpix: cmp cl,0 -; jz finquickspr -; rep movsb -; -;finquickspr: pop si di -; mov cl,bl -; add si,cx -; add di,dx -; dec bh -; jnz printquickloop -; -; pop bx ds es -; ret - - - - - - - -;Calcframe proc near -; -; ret -; -; mov al,[es:bx+15] -; mov ah,0 -; mov cx,6 -; mul cx -; add ax,[es:bx+8] -; -; mov dx,[es:bx+6] -; push bx -; mov ds,dx -; mov bx,ax -; mov ax,[bx] -; mov cx,[bx+2] -; mov dx,[bx+4] -; pop bx -; mov [es:bx+2],ax -; add cx,[es:bx+8] -; add cx,2080 -; mov [es:bx+4],cx ;calculates frame data -; -; mov al,[es:bx+10] ;this bit calculates the actual -; add al,dl ;x and y (including any offset) -; mov [es:bx+12],al -; mov al,[es:bx+11] -; add al,dh -; mov [es:bx+13],al -; ret -; -; endp - - - - - - - - - - - - - - - - - - - - -Checkone proc near ;cx=x,y to check - - push cx - mov al,ch - mov ah,0 - mov cl,4 - shr ax,cl - mov dl,al - pop cx - mov al,cl - mov ah,0 - mov cl,4 - shr ax,cl - mov ah,dl ; al,ah holds x,y in blocks - - push ax - mov ch,0 - mov cl,al - push cx - mov al,ah - mov ah,0 - mov cx,11 - mul cx - pop cx - add ax,cx - - mov cx,3 - mul cx - mov si,ax - - mov ds,buffers - add si,mapflags - lodsw - mov cx,ax - lodsb - pop dx - ret - - - endp - - - - - - - - - - - - - - - - - - -Findsource proc near - - mov ax,currentframe - cmp ax,160 - jnc over1000 - mov ds,reel1 - mov takeoff,0 - ret -over1000: cmp ax,320 - jnc over1001 - mov ds,reel2 - mov takeoff,160 - ret -over1001: mov ds,reel3 - mov takeoff,320 - ret - - endp - - - - - - - - - - - -;---------------------------------------------------------Routines for Ryan---- - - -Initman proc near - - ;mov linepointer,254 - mov al,ryanx - mov ah,ryany - mov si,ax - mov cx,offset cs:mainman - mov dx,mainsprites - mov di,0 - call makesprite - mov byte ptr [es:bx+23],4 - mov byte ptr [es:bx+22],0 - mov byte ptr [es:bx+29],0 - ret - - endp - - - - - - - -Mainman proc near - - cmp resetmanxy,1 - jnz notinnewroom - mov resetmanxy,0 - mov al,ryanx - mov ah,ryany - mov [es:bx+10],ax - mov byte ptr [es:bx+29],0 - jmp executewalk -notinnewroom: dec byte ptr [es:bx+22] - cmp byte ptr [es:bx+22],-1 - jz executewalk - ret - - -executewalk: mov byte ptr [es:bx+22],0 ; speed - mov al,turntoface - cmp al,facing - jz facingok - call aboutturn - jmp notwalk - -facingok: cmp turndirection,0 - jz alreadyturned - cmp linepointer,254 - jnz alreadyturned - mov reasseschanges,1 - mov al,facing - cmp al,leavedirection - jnz alreadyturned - call checkforexit -alreadyturned: mov turndirection,0 - cmp linepointer,254 - jnz walkman - mov byte ptr [es:bx+29],0 - jmp notwalk - -walkman: mov al,[es:bx+29] - inc al - cmp al,11 - jnz notanimend1 - mov al,1 -notanimend1: mov [es:bx+29],al - - call walking - cmp linepointer,254 - jz afterwalk - - mov al,facing - and al,1 - jz isdouble - mov al,[es:bx+29] - cmp al,2 - jz afterwalk - cmp al,7 - jz afterwalk -isdouble: call walking -afterwalk: cmp linepointer,254 - jnz notwalk - mov al,turntoface - cmp al,facing - jnz notwalk - mov reasseschanges,1 - mov al,facing - cmp al,leavedirection - jnz notwalk - call checkforexit - -notwalk: mov al,facing - mov ah,0 - mov di,offset cs:facelist - add di,ax - mov al,[cs:di] - add al,[es:bx+29] - mov [es:bx+15],al - mov ax,[es:bx+10] - mov ryanx,al - mov ryany,ah - ret - -facelist: db 0,60,33,71,11,82,22,93 - - endp - - - - - - - - - - -Aboutturn proc near - - cmp turndirection,1 - jz incdir - cmp turndirection,-1 - jz decdir - mov al,facing - sub al,turntoface - jnc higher - neg al - cmp al,4 - jnc decdir - jmp incdir -higher: cmp al,4 - jnc incdir - jmp decdir - -incdir: mov turndirection,1 - mov al,facing - inc al - and al,7 - mov facing,al - mov byte ptr [es:bx+29],0 - ret - -decdir: mov turndirection,-1 - mov al,facing - dec al - and al,7 - mov facing,al - mov byte ptr [es:bx+29],0 - ret - - endp - - - - - - - - -Walking proc near - - cmp linedirection,0 - jz normalwalk - mov al,linepointer - dec al - mov linepointer,al - cmp al,200 - jnc endofline - jmp continuewalk - -normalwalk: mov al,linepointer - inc al - mov linepointer,al - cmp al,linelength - jnc endofline - -continuewalk: mov ah,0 - add ax,ax - push es bx - mov dx,seg linedata - mov es,dx - mov bx,offset es:linedata - add bx,ax - mov ax,[es:bx] - pop bx es -stillline: mov [es:bx+10],ax - ret - -endofline: mov linepointer,254 - mov al,destination - mov manspath,al - cmp al,finaldest - jz finishedwalk - mov al,finaldest - mov destination,al - push es bx - call autosetwalk - pop bx es - ret - -finishedwalk: call facerightway - ret - - endp - - - - - - - -Facerightway proc near - - push es bx ;Face object when finished - call getroomspaths ;walking - mov al,manspath - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - add bx,ax - mov al,[es:bx+7] - mov turntoface,al - mov leavedirection,al - pop bx es - ret - - endp - - - - - - - -Checkforexit proc near - - mov cl,ryanx ;look under feet to see if - add cl,12 ;any flags are there - mov ch,ryany - add ch,12 - call checkone - mov lastflag,cl - mov lastflagex,ch - mov flagx,dl - mov flagy,dh - mov al,lastflag - - test al,64 - jz notnewdirect - mov al,lastflagex - mov autolocation,al - ret - -notnewdirect: test al,32 - jz notleave - push es bx - cmp reallocation,2 - jnz notlouis - mov bl,0 - push bx - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"A" - call isryanholding - pop bx - jz noshoe1 - inc bl -noshoe1: push bx - mov al,"W" - mov ah,"E" - mov cl,"T" - mov ch,"B" - call isryanholding - pop bx - jz noshoe2 - inc bl -noshoe2: cmp bl,2 - jz notlouis - mov al,42 - cmp bl,0 - jz notravmessage - inc al -notravmessage: mov cx,80 - mov dx,10 - mov bl,68 - mov bh,64 - call setuptimeduse - mov al,facing - add al,4 - and al,7 - mov turntoface,al - pop bx es - ret - -notlouis: pop bx es - mov needtotravel,1 - ret - - - -notleave: test al,4 - jz notaleft - call adjustleft - ret - -notaleft: test al,2 - jz notaright - call adjustright - ret - -notaright: test al,8 - jz notadown - call adjustdown - ret - -notadown: test al,16 - jz notanup - call adjustup - ret - -notanup: ret - - endp - - - - - -Adjustdown proc near - - push es bx - add mapy,10 - mov al,lastflagex - mov cl,16 - mul cl - mov [es:bx+11],al - mov nowinnewroom,1 - pop bx es - ret - - endp - - - - -Adjustup proc near - - push es bx - sub mapy,10 - mov al,lastflagex - mov cl,16 - mul cl - mov [es:bx+11],al - mov nowinnewroom,1 - pop bx es - ret - - endp - - - - - -Adjustleft proc near - - push es bx - mov lastflag,0 - sub mapx,11 - mov al,lastflagex - mov cl,16 - mul cl - mov [es:bx+10],al - mov nowinnewroom,1 - pop bx es - ret - - endp - - - - - - -Adjustright proc near - - push es bx - add mapx,11 - mov al,lastflagex - mov cl,16 - mul cl - sub al,2 - mov [es:bx+10],al - mov nowinnewroom,1 - pop bx es - ret - - endp - - - - - -Reminders proc nar - - cmp reallocation,24 - jnz notinedenslift - cmp mapx,44 - jnz notinedenslift - cmp progresspoints,0 - jnz notfirst - mov al,"D" - mov ah,"K" - mov cl,"E" - mov ch,"Y" - call isryanholding - jz forgotone - mov al,"C" - mov ah,"S" - mov cl,"H" - mov ch,"R" - call findexobject - cmp al,numexobjects - jz forgotone - mov ax,[es:bx+2] - cmp al,4 - jnz forgotone ;card is in inventory - cmp ah,255 - jz havegotcard ;card must be in an ex - mov cl,"P" ;object - mov ch,"U" - mov dl,"R" - mov dh,"S" - xchg al,ah - call compare - jnz forgotone ;is it in wallet? -havegotcard: inc progresspoints -notfirst: ret - -forgotone: mov al,50 ;message number - mov bl,54 ;x pos of message - mov bh,70 ;and y pos - mov cx,48 ;time on screen - mov dx,8 ;pause before show - call setuptimeduse - ret -notinedenslift: ret - - endp - - - - - -;--------------------------------------------------------------------------- -; -; Sprite update routines for rain effect -; -;--------------------------------------------------------------------------- - - - - -Initrain proc near - - mov es,buffers - mov di,rainlist - mov bx,offset cs:rainlocations -checkmorerain: mov al,[cs:bx] - cmp al,255 - jz finishinitrain - cmp al,reallocation - jnz checkrain - mov al,[cs:bx+1] - cmp al,mapx - jnz checkrain - mov al,[cs:bx+2] - cmp al,mapy - jnz checkrain - mov al,[cs:bx+3] - mov rainspace,al - jmp dorain -checkrain: add bx,4 - jmp checkmorerain - -dorain: mov cx,4 -initraintop: call randomnumber - and al,31 - add al,3 - cmp al,rainspace - jnc initraintop - add cl,al - cmp cl,mapxsize - jnc initrainside - push cx - call splitintolines - pop cx - jmp initraintop - -initrainside: mov cl,mapxsize - dec cl -initrainside2: call randomnumber - and al,31 - add al,3 - cmp al,rainspace - jnc initrainside2 - add ch,al - cmp ch,mapysize - jnc finishinitrain - push cx - call splitintolines - pop cx - jmp initrainside2 -finishinitrain: mov al,255 - stosb - ret - -rainlocations: db 1,44,10,16 ;location,map x,y,seed - db 4,11,30,14 - db 4,22,30,14 - db 3,33,10,14 - db 10,33,30,14 - db 10,22,30,24 - db 9,22,10,14 - db 2,33,0,14 - db 2,22,0,14 - db 6,11,30,14 - db 7,11,20,18 - db 7,0,20,18 - db 7,0,30,18 - db 55,44,0,14 - db 5,22,30,14 - - db 8,0,10,18 - db 8,11,10,18 - db 8,22,10,18 - db 8,33,10,18 - db 8,33,20,18 - db 8,33,30,18 - db 8,33,40,18 - db 8,22,40,18 - db 8,11,40,18 - - db 21,44,20,18 - db 255 - - endp - - - - - - - - - - -Splitintolines proc near - - -lookforlinestart: call getblockofpixel - cmp al,0 - jnz foundlinestart - dec cl - inc ch - cmp cl,0 - jz endofthisline - cmp ch,mapysize - jnc endofthisline - jmp lookforlinestart - -foundlinestart: mov [es:di],cx - mov bh,1 -lookforlineend: call getblockofpixel - cmp al,0 - jz foundlineend - dec cl - inc ch - cmp cl,0 - jz foundlineend - cmp ch,mapysize - jnc foundlineend - inc bh - jmp lookforlineend - -foundlineend: push cx - mov [es:di+2],bh - call randomnumber - mov [es:di+3],al - call randomnumber - mov [es:di+4],al - call randomnumber - and al,3 - add al,4 - mov [es:di+5],al - add di,6 - pop cx - cmp cl,0 - jz endofthisline - cmp ch,mapysize - jnc endofthisline - jmp lookforlinestart - -endofthisline: ret - - endp - - - - -Getblockofpixel proc near - - push cx es di - mov ax,mapxstart - add cl,al - mov ax,mapystart - add ch,al - call checkone - and cl,1 - jnz failrain - pop di es cx - ret -failrain: pop di es cx - mov al,0 - ret - - endp - - - - -Showrain proc near - - mov ds,mainsprites - mov si,6*58 - mov ax,[si+2] - mov si,ax - add si,2080 - - mov bx,rainlist - mov es,buffers - cmp byte ptr [es:bx],255 - jz nothunder - -morerain: mov es,buffers - cmp byte ptr [es:bx],255 - jz finishrain - - mov al,[es:bx+1] - mov ah,0 - add ax,mapady - add ax,mapystart - mov cx,320 - mul cx - mov cl,[es:bx] - mov ch,0 - add ax,cx - add ax,mapadx - add ax,mapxstart - mov di,ax - - mov cl,[es:bx+2] - mov ch,0 - mov ax,[es:bx+3] - mov dl,[es:bx+5] - mov dh,0 - sub ax,dx - and ax,511 - mov [es:bx+3],ax - add bx,6 - - push si - add si,ax - mov es,workspace - mov ah,0 - mov dx,320-2 -rainloop: lodsb - cmp al,ah - jz noplot - stosb - add di,dx - loop rainloop - pop si - jmp morerain -noplot: add di,320-1 - loop rainloop - pop si - jmp morerain - -finishrain: cmp ch1blockstocopy,0 - jnz nothunder - cmp reallocation,2 - jnz notlouisthund - cmp beenmugged,1 - jnz nothunder -notlouisthund: cmp reallocation,55 - jz nothunder - call randomnum1 - cmp al,1 - jnc nothunder - mov al,7 - cmp ch0playing,6 - jz isthunder1 - mov al,4 -isthunder1: call playchannel1 -nothunder: ret - - endp - - - - - - - -;--------------------------------------------------------------------------- -; -; Sprite update routines for background objects -; -;--------------------------------------------------------------------------- - - - - - - -Backobject proc near - - mov ds,setdat - mov di,[es:bx+20] - - mov al,[es:bx+18] - cmp al,0 - jz $48z - dec al - mov [es:bx+18],al - jmp finishback - -$48z: mov al,[di+7] - mov [es:bx+18],al - mov al,[di+8] - cmp al,6 - jnz notwidedoor - call widedoor - jmp finishback - -notwidedoor: cmp al,5 - jnz notrandom - call random - jmp finishback - -notrandom: cmp al,4 - jnz notlockdoor - call lockeddoorway - jmp finishback - -notlockdoor: cmp al,3 - jnz notlift - call liftsprite - jmp finishback - -notlift: cmp al,2 - jnz notdoor - call doorway - jmp finishback - -notdoor: cmp al,1 - jnz steadyob - call constant - jmp finishback - -steadyob: call steady - -finishback: ;call calcframe - ret - - endp - - - - - - - - - -Liftsprite proc near - - mov al,liftflag - cmp al,0 - jz liftclosed - cmp al,1 - jz liftopen - cmp al,3 - jz openlift - - mov al,[es:bx+19] - cmp al,0 - jz finishclose - dec al - cmp al,11 - jnz pokelift - push ax - mov al,3 - call liftnoise - pop ax - jmp pokelift -finishclose: mov liftflag,0 - ret - -openlift: mov al,[es:bx+19] - cmp al,12 - jz endoflist - inc al - cmp al,1 - jnz pokelift - push ax - mov al,2 - call liftnoise - pop ax -pokelift: mov [es:bx+19],al - mov ah,0 - push di - add di,ax - mov al,[di+18] - pop di - mov [es:bx+15],al - mov [di+17],al - ret - -endoflist: mov liftflag,1 - ret - -liftopen: mov al,liftpath - push es bx - call turnpathon - pop bx es - cmp counttoclose,0 - jz nocountclose - dec counttoclose - cmp counttoclose,0 - jnz nocountclose - mov liftflag,2 -nocountclose: mov al,12 - jmp pokelift - -liftclosed: mov al,liftpath - push es bx - call turnpathoff - pop bx es - cmp counttoopen,0 - jz nocountopen - dec counttoopen - cmp counttoopen,0 - jnz nocountopen - mov liftflag,3 -nocountopen: mov al,0 - jmp pokelift - - endp - - -Liftnoise proc near - - cmp reallocation,5 - jz hissnoise - cmp reallocation,21 - jz hissnoise - call playchannel1 - ret -hissnoise: if demo - mov al,25 - else - mov al,13 - endif - call playchannel1 - ret - - endp - - - - -Random proc near - - call randomnum1 - push di - and ax,7 - add di,18 - add di,ax - mov al,[di] - pop di - mov [es:bx+15],al - ret - - endp - - - - - - - - -Steady proc near - - mov al,[di+18] - mov [di+17],al - mov [es:bx+15],al - ret - - endp - - - - - -Constant proc near - - inc byte ptr [es:bx+19] - mov cl,[es:bx+19] - mov ch,0 - add di,cx - cmp byte ptr [di+18],255 - jnz gotconst - sub di,cx - mov cx,0 - mov [es:bx+19],cl -gotconst: mov al,[di+18] - sub di,cx - mov [es:bx+15],al - mov [di+17],al - ret - - endp - - - - - - - - - - - - - - -Doorway proc near - - mov doorcheck1,-24 - mov doorcheck2,10 - mov doorcheck3,-30 - mov doorcheck4,10 - call dodoor - ret - - endp - - - -Widedoor proc near - - mov doorcheck1,-24 - mov doorcheck2,24 - mov doorcheck3,-30 - mov doorcheck4,24 - call dodoor - ret - - endp - - - - - - - - - -Dodoor proc near - - mov al,ryanx - mov ah,ryany - mov cl,[es:bx+10] - mov ch,[es:bx+11] - - cmp al,cl - jnc rtofdoor - sub al,cl - cmp al,doorcheck1 - jnc upordown - jmp shutdoor -rtofdoor: sub al,cl - cmp al,doorcheck2 - jnc shutdoor - -upordown: cmp ah,ch - jnc botofdoor - sub ah,ch - cmp ah,doorcheck3 - jc shutdoor - jmp opendoor -botofdoor: sub ah,ch - cmp ah,doorcheck4 - jnc shutdoor - -opendoor: mov cl,[es:bx+19] - cmp throughdoor,1 - jnz notthrough - cmp cl,0 - jnz notthrough - mov cl,6 -notthrough: inc cl - cmp cl,1 - jnz notdoorsound2 - mov al,0 - cmp reallocation,5 - jnz nothoteldoor2 - if demo - mov al,25 - else - mov al,13 - endif -nothoteldoor2: call playchannel1 -notdoorsound2: mov ch,0 - - push di - add di,cx - mov al,[di+18] ; must be a better way than this - cmp al,255 - jnz atlast1 - dec di - dec cl -atlast1: mov [es:bx+19],cl - mov al,[di+18] - pop di - mov [es:bx+15],al - mov [di+17],al - mov throughdoor,1 - ret - - -shutdoor: mov cl,[es:bx+19] - cmp cl,5 - jnz notdoorsound1 - mov al,1 - cmp reallocation,5 - jnz nothoteldoor1 - if demo - mov al,25 - else - mov al,13 - endif -nothoteldoor1: call playchannel1 -notdoorsound1: cmp cl,0 - jz atlast2 - dec cl - mov [es:bx+19],cl -atlast2: mov ch,0 - push di - add di,cx - mov al,[di+18] - pop di - mov [es:bx+15],al - mov [di+17],al - cmp cl,5 - jnz notnearly - mov throughdoor,0 -notnearly: ret - - endp - - - - - - - - -Lockeddoorway proc near - - mov al,ryanx - mov ah,ryany - mov cl,[es:bx+10] - mov ch,[es:bx+11] - - cmp al,cl - jnc rtofdoor2 - sub al,cl - cmp al,-24 - jnc upordown2 - jmp shutdoor2 -rtofdoor2: sub al,cl - cmp al,10 - jnc shutdoor2 - -upordown2: cmp ah,ch - jnc botofdoor2 - sub ah,ch - cmp ah,-30 - jc shutdoor2 - jmp opendoor2 -botofdoor2: sub ah,ch - cmp ah,12 - jnc shutdoor2 - -opendoor2: cmp throughdoor,1 - jz mustbeopen - cmp lockstatus,1 - jz shutdoor -mustbeopen: mov cl,[es:bx+19] - cmp cl,1 - jnz notdoorsound4 - mov al,0 - call playchannel1 -notdoorsound4: cmp cl,6 ; was 3 - jnz noturnonyet - mov al,doorpath - push es bx - call turnpathon - pop bx es - -noturnonyet: mov cl,[es:bx+19] - cmp throughdoor,1 - jnz notthrough2 - cmp cl,0 - jnz notthrough2 - mov cl,6 -notthrough2: inc cl - mov ch,0 - - push di - add di,cx - mov al,[di+18] - cmp al,255 - jnz atlast3 - dec di - dec cl -atlast3: mov [es:bx+19],cl - mov al,[di+18] - pop di - mov [es:bx+15],al - mov [di+17],al - cmp cl,5 - jnz justshutting - mov throughdoor,1 -justshutting: ret - - - -shutdoor2: mov cl,[es:bx+19] - cmp cl,5 - jnz notdoorsound3 - mov al,1 - call playchannel1 -notdoorsound3: cmp cl,0 - jz atlast4 - dec cl - mov [es:bx+19],cl -atlast4: mov ch,0 - mov throughdoor,0 - push di - add di,cx - mov al,[di+18] - pop di - mov [es:bx+15],al - mov [di+17],al - cmp cl,0 ;1 - jnz notlocky - mov al,doorpath - push es bx - call turnpathoff - pop bx es - mov lockstatus,1 -notlocky: ret - - endp - - - - - - - - - - -;------------------------------------------------------------People handler---- - -Updatepeople proc near - - mov es,buffers - mov di,peoplelist - mov listpos,di - mov cx,12*5 - mov al,255 - rep stosb - - inc maintimer - push cs - pop es - mov bx,offset cs:reelroutines - mov di,offset cs:reelcalls -updateloop: mov al,[es:bx] - cmp al,255 - jz endupdate - cmp al,reallocation - jnz notinthisroom - mov cx,[es:bx+1] - cmp cl,mapx - jnz notinthisroom - cmp ch,mapy - jnz notinthisroom - push di - mov ax,[cs:di] - call ax - pop di -notinthisroom: add bx,8 - add di,2 - jmp updateloop -endupdate: ret - - endp - - - - - - - - - - - - - - -Getreelframeax proc near - - push ds - mov currentframe,ax - call findsource - push ds - pop es - pop ds - mov ax,currentframe - sub ax,takeoff - add ax,ax - mov cx,ax - add ax,ax - add ax,cx - mov bx,ax - ret - - endp - - - - - - - - - - -Reelsonscreen proc near - - call reconstruct - call updatepeople - call watchreel - call showrain - call usetimedtext - ret - - endp - - - - - - -Plotreel proc near - - call getreelstart -retryreel: push es si - mov ax,[es:si+2] - cmp al,220 - jc normalreel - cmp al,255 - jz normalreel - call dealwithspecial - inc reelpointer - pop si es - add si,40 - jmp retryreel - -normalreel: mov cx,8 -plotloop: push cx es si - mov ax,[es:si] - cmp ax,0ffffh - jz notplot - call showreelframe -notplot: pop si es cx - add si,5 - loop plotloop - call soundonreels - pop bx es - ret - - endp - - - - - -Soundonreels proc near - - mov bl,reallocation - add bl,bl - xor bh,bh - add bx,offset cs:roombyroom - mov si,[cs:bx] - -reelsoundloop: mov al,[cs:si] - cmp al,255 - jz endreelsound - mov ax,[cs:si+1] - cmp ax,reelpointer - jnz skipreelsound - - cmp ax,lastsoundreel - jz skipreelsound - - mov lastsoundreel,ax - mov al,[cs:si] - cmp al,64 - jc playchannel1 - cmp al,128 - jc channel0once - and al,63 - mov ah,255 - jmp playchannel0 -channel0once: and al,63 - mov ah,0 - jmp playchannel0 -skipreelsound: add si,3 - jmp reelsoundloop -endreelsound: mov ax,lastsoundreel - cmp ax,reelpointer - jz nochange2 - mov lastsoundreel,-1 -nochange2: ret - -roombyroom dw r0,r1,r2,r0,r0,r0,r6,r0,r8,r9,r10,r11,r12,r13,r14,r0,r0,r0,r0,r0 - dw r20,r0,r22,r23,r0,r25,r26,r27,r28,r29,r0,r0,r0,r0,r0 - dw r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r45,r46,r47,r0,r0,r0,r0,r52,r53,r0,r55 - -r0 db 255 - -r1 db 15 - dw 257 - db 255 - -r2 db 12 - dw 5 - db 13 - dw 21 - db 15 ;hitting floor? - dw 35 - db 17 - dw 50 - db 18 - dw 103 - db 19 - dw 108 - db 255 - -r6 db 18 - dw 19 - db 19 - dw 23 - db 255 - -r8 db 12 - dw 51 - db 13 - dw 53 - db 14 - dw 14 - db 15 - dw 20 - db 0 - dw 78 - db 255 - -r9 db 12 - dw 119 - db 12 - dw 145 - db 255 - -r10 db 13 - dw 16 - db 255 - -r11 db 13 - dw 20 - db 255 - -r12 db 14 - dw 16 - db 255 - -r13 db 15 - dw 4 - db 16 - dw 8 - db 17 - dw 134 - db 18 - dw 153 - db 255 - -r14 db 13 - dw 108 - db 15 - dw 326 - db 15 - dw 331 - db 15 - dw 336 - db 15 - dw 342 - db 15 - dw 348 - db 15 - dw 354 - db 18 - dw 159 - db 18 - dw 178 - db 19+128 - dw 217 - db 20+64 - dw 228 - db 255 - -r20 db 13 - dw 20 - db 13 - dw 21 - db 15 - dw 34 - db 13 - dw 52 - db 13 - dw 55 - db 25 - dw 57 - db 21 - dw 73 - db 255 - -r22 db 13 ;room,sample - dw 196 ;reelpointer - db 13 - dw 234 - db 13 - dw 156 - db 14 - dw 129 - db 13 - dw 124 - db 15 - dw 162 - db 15 - dw 200 - db 15 - dw 239 - db 17 - dw 99 - db 12 - dw 52 - db 255 - -r23 db 15 - dw 56 - db 16 - dw 64 - db 19 - dw 22 - db 20 - dw 33 - db 255 - -r25 db 20 - dw 11 - db 20 - dw 15 - db 15 - dw 28 - db 13 - dw 80 - db 21 - dw 82 - db 19+128 - dw 87 - db 23+64 - dw 128 - db 255 - -r26 db 12 - dw 13 - db 14 - dw 39 - db 12 - dw 67 - db 12 - dw 75 - db 12 - dw 83 - db 12 - dw 91 - db 15 - dw 102 ; was 90, should be mine cart - db 255 - -r27 db 22 - dw 36 - db 13 - dw 125 - db 18 - dw 88 - db 15 - dw 107 - db 14 - dw 127 - db 14 - dw 154 - db 19+128 - dw 170 - db 23+64 - dw 232 - db 255 - -r28 db 21 - dw 16 - db 21 - dw 72 - db 21 - dw 205 - db 22 - dw 63 ;65 - db 23+128 - dw 99 - db 24+64 - dw 158 - db 255 - -r29 db 13 - dw 21 - db 14 - dw 24 - db 19+128 - dw 50 - db 23+64 - dw 75 - if german - else - db 24 - dw 128 - endif - db 255 - -r45 db 19+64 - dw 46 - db 16 - dw 167 - db 255 - -r46 db 16 - dw 19 - db 14 - dw 36 - db 16 - dw 50 - db 14 - dw 65 - db 16 - dw 81 - db 14 - dw 96 - db 16 - dw 114 - db 14 - dw 129 - db 16 - dw 147 - db 14 - dw 162 - db 16 - dw 177 - db 14 - dw 191 - db 255 - -r47 db 13 - dw 48 - db 14 - dw 41 - db 15 - dw 78 - db 16 - dw 92 - db 255 - -r52 db 16 - dw 115 - db 255 - -r53 db 21 - dw 103 - db 20 - dw 199 - db 255 - -r55 db 17 - dw 53 - db 17 - dw 54 - db 17 - dw 55 - db 17 - dw 56 - db 17 - dw 57 - db 17 - dw 58 - db 17 - dw 59 - db 17 - dw 61 - db 17 - dw 63 - db 17 - dw 64 - db 17 - dw 65 - db 255 - - endp - - - - - - - - - -Reconstruct proc near - - cmp havedoneobs,0 - jz noneedtorecon - mov newobs,1 - call drawfloor - call spriteupdate - call printsprites - if foreign - cmp reallocation,20 - jnz notfudge - call undertextline -notfudge: - endif - mov havedoneobs,0 -noneedtorecon: ret - - endp - - - - - - - - - - -Dealwithspecial proc near - - sub al,220 - cmp al,0 - jnz notplset - mov al,ah - call placesetobject - mov havedoneobs,1 - ret -notplset: cmp al,1 - jnz notremset - mov al,ah - call removesetobject - mov havedoneobs,1 - ret -notremset: cmp al,2 - jnz notplfree - mov al,ah - call placefreeobject - mov havedoneobs,1 - ret -notplfree: cmp al,3 - jnz notremfree - mov al,ah - call removefreeobject - mov havedoneobs,1 - ret -notremfree: cmp al,4 - jnz notryanoff - call switchryanoff - ret -notryanoff: cmp al,5 - jnz notryanon - mov turntoface,ah - mov facing,ah - call switchryanon - ret -notryanon: cmp al,6 - jnz notchangeloc - mov newlocation,ah ; was new loc in watch - ;call switchryanon - ret -notchangeloc: call movemap - ret - - endp - - - -Movemap proc near - - cmp ah,32 - jnz notmapup2 - sub mapy,20 - mov nowinnewroom,1 - ret - -notmapup2: cmp ah,16 - jnz notmapupspec - sub mapy,10 - mov nowinnewroom,1 - ret - -notmapupspec: cmp ah,8 - jnz notmapdownspec - add mapy,10 - mov nowinnewroom,1 - ret - -notmapdownspec: cmp ah,2 - jnz notmaprightspec - add mapx,11 - mov nowinnewroom,1 - ret - -notmaprightspec: sub mapx,11 - mov nowinnewroom,1 - ret - - endp - - - - -Getreelstart proc near - - mov ax,reelpointer - mov cx,40 - mul cx - mov es,reels - mov si,ax - add si,reellist - ret - - endp - - - - - -;------------------------------------------------------Printing a reel frame---- - - - -Showreelframe proc near - - mov al,[es:si+2] - mov ah,0 - mov di,ax - add di,mapadx - mov al,[es:si+3] - mov bx,ax - add bx,mapady - mov ax,[es:si] - mov currentframe,ax - call findsource - mov ax,currentframe - sub ax,takeoff - mov ah,8 - call showframe - ret - - endp - - - - - - -;------------------------------------------------------------------------------- - - - - - - - - - -Deleverything proc near - - mov al,mapysize - mov ah,0 - add ax,mapoffsety - cmp ax,182 - jnc bigroom - call maptopanel - ret -bigroom: sub mapysize,8 - call maptopanel - add mapysize,8 - ret - - endp - - - - - - - - - - - -Dumpeverything proc near - - mov es,buffers - mov bx,printedlist -dumpevery1: mov ax,[es:bx] - mov cx,[es:bx+2] - cmp ax,0ffffh - jz finishevery1 - cmp ax,[es:bx+(40*5)] - jnz notskip1 - cmp cx,[es:bx+(40*5)+2] - jz skip1 - -notskip1: push bx es ds - mov bl,ah - mov bh,0 - mov ah,0 - mov di,ax - add di,mapadx - add bx,mapady - call multidump - pop ds es bx - -skip1: add bx,5 - jmp dumpevery1 - -finishevery1: mov bx,printedlist+(40*5) -dumpevery2: mov ax,[es:bx] - mov cx,[es:bx+2] - cmp ax,0ffffh - jz finishevery2 - - push bx es ds - mov bl,ah - mov bh,0 - mov ah,0 - mov di,ax - add di,mapadx - add bx,mapady - call multidump - pop ds es bx - add bx,5 - jmp dumpevery2 - -finishevery2: ret - - endp - - - - - - - - - - - - - - +;------------------------------------------------------------People Routines---- + + + +Reelroutines db 1,44,0 ;Room number and x,y + dw 20 ;reel pointer + db 2,0,1 ;speed,speed count,convers. no. + + db 1,55,0 + dw 0 + db 50,20,0 + + db 24,22,0 + dw 74 + db 1,0,0 + + db 24,33,10 + dw 75 + db 1,0,1 + + db 1,44,0 + dw 27 + db 2,0,2 + + db 1,44,0 + dw 96 + db 3,0,4 + + db 1,44,0 + dw 118 + db 2,0,5 + + db 1,44,10 + dw 0 + db 2,0,0 + + db 5,22,20 + dw 53 + db 3,0,0 + + db 5,22,20 + dw 40 + db 1,0,2 + + db 5,22,20 + dw 50 + db 1,0,3 + + db 2,11,10 + dw 192 + db 1,0,0 + + db 2,11,10 + dw 182 + db 2,0,1 + + db 8,11,10 + dw 0 + db 2,0,1 + + db 23,0,50 + dw 0 + db 3,0,0 + + db 28,11,20 + dw 250 + db 4,0,0 + + db 23,0,50 + dw 43 + db 2,0,8 + + db 23,11,40 + dw 130 + db 2,0,1 + + db 23,22,40 + dw 122 + db 2,0,2 + + db 23,22,40 + dw 105 + db 2,0,3 + + db 23,22,40 + dw 81 + db 2,0,4 + + db 23,11,40 + dw 135 + db 2,0,5 + + db 23,22,40 + dw 145 + db 2,0,6 + + db 4,22,30 + dw 0 + db 2,0,0 + + db 45,22,30 + dw 200 + db 0,0,20 + + db 45,22,30 + dw 39 + db 2,0,0 + + db 45,22,30 + dw 25 + db 2,0,0 + + db 8,22,40 + dw 32 + db 2,0,0 + + db 7,11,20 + dw 64 + db 2,0,0 + + db 22,22,20 + dw 82 + db 2,0,0 + + db 27,11,30 + dw 0 + db 2,0,0 + + db 20,0,30 + dw 0 + db 2,0,0 + + db 14,33,40 + dw 21 + db 1,0,0 + + db 29,11,10 + dw 0 + db 1,0,0 + + db 2,22,0 + dw 2 + db 2,0,0 + + db 25,0,50 + dw 4 + db 2,0,0 + + db 50,22,30 + dw 121 + db 2,0,0 + + db 50,22,30 + dw 0 + db 20,0,0 + + db 52,22,30 + dw 192 + db 2,0,0 + + db 52,22,30 + dw 233 + db 2,0,0 + + db 50,22,40 + dw 104 + if cd + if german + db 65,0,0 + else + db 55,0,0 + endif + else + db 55,0,0 + endif + + db 53,33,0 + dw 99 + db 2,0,0 + + db 50,22,40 + dw 0 + db 3,0,0 + + db 50,22,30 + dw 162 + db 2,0,0 + + db 52,22,30 + dw 57 + db 2,0,0 + + db 52,22,30 + dw 0 + db 2,0,0 + + db 54,0,0 + dw 72 + db 3,0,0 + + db 55,44,0 + dw 0 + db 2,0,0 + + db 19,0,0 + dw 0 + db 28,0,0 + + db 14,22,0 + dw 2 + db 2,0,0 + + db 14,22,0 + dw 300 + db 1,0,0 + + db 10,22,30 + dw 174 + db 0,0,0 + + db 12,22,20 + dw 0 + db 1,0,0 + + db 11,11,20 + dw 0 + db 50,20,0 + + db 11,11,30 + dw 0 + db 50,20,0 + + db 11,22,20 + dw 0 + db 50,20,0 + + db 14,33,40 + dw 0 + db 50,20,0 + + db 255 + + +Lenofreelrouts equ $-reelroutines + + +Reelcalls dw gamer,sparkydrip,eden,edeninbath,sparky,smokebloke + dw manasleep,drunk,receptionist,malefan,femalefan + dw louis,louischair,soldier1,bossman,interviewer + dw heavy,manasleep2,mansatstill,drinker,bartender + dw othersmoker,tattooman,attendant,keeper,candles1 + dw smallcandle,security,copper,poolguard,rockstar + dw businessman,train,aide,mugger,helicopter + dw intromagic1,intromusic,intromagic2,candles2,gates + dw intromagic3,intromonks1,candles,intromonks2 + dw handclap,monkandryan,endgameseq,priest,madman + dw madmanstelly,alleybarksound,foghornsound + dw carparkdrip,carparkdrip,carparkdrip,carparkdrip + + + +;---------------------------------------------------------Character updates---- + + + +Alleybarksound proc near + + mov ax,[es:bx+3] + dec ax + cmp ax,0 + jnz nobark + push bx es + mov al,14 + call playchannel1 + pop es bx + mov ax,1000 +nobark: mov [es:bx+3],ax + ret + + endp + + + + +Intromusic proc near + + ret + + endp + + +Foghornsound proc near + + call randomnumber + cmp al,198 + jnz nofog + mov al,13 + call playchannel1 +nofog: ret + + endp + + + + +Receptionist proc near + + call checkspeed + jnz gotrecep + cmp cardpassflag,1 + jnz notsetcard + inc cardpassflag + mov byte ptr [es:bx+7],1 + mov word ptr [es:bx+3],64 +notsetcard: cmp word ptr [es:bx+3],58 + jnz notdes1 + call randomnumber + cmp al,30 + jc notdes2 + mov word ptr [es:bx+3],55 + jmp gotrecep + +notdes1: cmp word ptr [es:bx+3],60 + jnz notdes2 + call randomnumber + cmp al,240 + jc gotrecep + mov word ptr [es:bx+3],53 + jmp gotrecep + +notdes2: cmp word ptr [es:bx+3],88 + jnz notendcard + mov word ptr [es:bx+3],53 + jmp gotrecep + +notendcard: inc word ptr [es:bx+3] +gotrecep: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedrecep + mov talkedtorecep,1 +nottalkedrecep: ret + + endp + + + + +Smokebloke proc near + + cmp rockstardead,0 + jnz notspokento + mov al,[es:bx+7] + and al,128 + jz notspokento + push es bx + mov al,5 + call setlocation + pop bx es +notspokento: ;mov al,[es:bx+7] + ;and al,127 + ;mov [es:bx+7],al + call checkspeed + jnz gotsmokeb + cmp word ptr [es:bx+3],100 + jnz notsmokeb1 + call randomnumber + cmp al,30 + jc notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb1: cmp word ptr [es:bx+3],117 + jnz notsmokeb2 + mov word ptr [es:bx+3],96 + jmp gotsmokeb + +notsmokeb2: inc word ptr [es:bx+3] +gotsmokeb: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Attendant proc near + + call showgamereel + call addtopeoplelist + mov al,[es:bx+7] + and al,128 + jz nottalked + mov talkedtoattendant,1 +nottalked: ret + + endp + + + + + + +Manasleep proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + +Eden proc near + + cmp generaldead,0 + jnz notinbed + call showgamereel + call addtopeoplelist +notinbed: ret + + endp + + + +Edeninbath proc near + + cmp generaldead,0 + jz notinbed + cmp sartaindead,0 + jnz notinbath + call showgamereel + call addtopeoplelist +notinbath: ret + + endp + + + +Malefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + +Femalefan proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Louis proc near + + cmp rockstardead,0 + jnz notlouis1 + call showgamereel + call addtopeoplelist +notlouis1: ret + + endp + + + + +Louischair proc near + + cmp rockstardead,0 + jz notlouis2 + call checkspeed + jnz notlouisanim + mov ax,[es:bx+3] + inc ax + cmp ax,191 + jz restartlouis + cmp ax,185 + jz randomlouis + mov [es:bx+3],ax + jmp notlouisanim +randomlouis: mov [es:bx+3],ax + call randomnumber + cmp al,245 + jnc notlouisanim +restartlouis: mov ax,182 + mov [es:bx+3],ax +notlouisanim: call showgamereel + call addtopeoplelist +notlouis2: ret + + endp + + + +Manasleep2 proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist + ret + + endp + + + + +Mansatstill proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Tattooman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + +Drinker proc near + + call checkspeed + jnz gotdrinker + inc word ptr [es:bx+3] + cmp word ptr [es:bx+3],115 + jnz notdrinker1 + mov word ptr [es:bx+3],105 + jmp gotdrinker + +notdrinker1: cmp word ptr [es:bx+3],106 + jnz gotdrinker + call randomnumber + cmp al,3 + jc gotdrinker + mov word ptr [es:bx+3],105 + +gotdrinker: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Bartender proc near + + call checkspeed + jnz gotsmoket + cmp word ptr [es:bx+3],86 + jnz notsmoket1 + call randomnumber + cmp al,18 + jc notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket1: cmp word ptr [es:bx+3],103 + jnz notsmoket2 + mov word ptr [es:bx+3],81 + jmp gotsmoket + +notsmoket2: inc word ptr [es:bx+3] +gotsmoket: call showgamereel + cmp gunpassflag,1 + jnz notgotgun + mov byte ptr [es:bx+7],9 +notgotgun: call addtopeoplelist + ret + + endp + + + + + + + +Othersmoker proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Barwoman proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + +Interviewer proc near + + cmp reeltowatch,68 + jnz notgeneralstart + inc word ptr [es:bx+3] +notgeneralstart: cmp word ptr [es:bx+3],250 + jz talking + call checkspeed + jnz talking + cmp word ptr [es:bx+3],259 + jz talking + inc word ptr [es:bx+3] +talking: call showgamereel + ret + + endp + + + + + +Soldier1 proc near + + cmp word ptr [es:bx+3],0 + jz soldierwait + mov watchingtime,10 + cmp word ptr [es:bx+3],30 + jnz notaftersshot + inc combatcount + cmp combatcount,40 + jnz gotsoldframe + mov mandead,2 + jmp gotsoldframe +notaftersshot: call checkspeed + jnz gotsoldframe + inc word ptr [es:bx+3] + jmp gotsoldframe +soldierwait: cmp lastweapon,1 + jnz gotsoldframe + mov watchingtime,10 + cmp manspath,2 + jnz gotsoldframe + cmp facing,4 + jnz gotsoldframe + inc word ptr [es:bx+3] + mov lastweapon,-1 + mov combatcount,0 +gotsoldframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + +Rockstar proc near + + mov ax,[es:bx+3] + cmp ax,303 + jz rockcombatend + cmp ax,118 + jz rockcombatend + call checkspeed + jnz rockspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,118 + jnz notbeforedead + mov mandead,2 + jmp gotrockframe + +notbeforedead: cmp ax,79 + jnz gotrockframe + dec ax + cmp lastweapon,1 + jnz notgunonrock + mov lastweapon,-1 + mov ax,123 + jmp gotrockframe +notgunonrock: inc combatcount + cmp combatcount,40 + jnz gotrockframe + mov combatcount,0 + mov ax,79 + +gotrockframe: mov [es:bx+3],ax +rockspeed: call showgamereel + cmp word ptr [es:bx+3],78 + jnz notalkrock + call addtopeoplelist + mov pointermode,2 + mov watchingtime,0 + ret + +notalkrock: mov watchingtime,2 + mov pointermode,0 + mov al,mapy + mov [es:bx+2],al + ret + +rockcombatend: mov newlocation,45 + call showgamereel + ret + + endp + + + + + + + + + + + + + + + +Helicopter proc near + + mov ax,[es:bx+3] + cmp ax,203 + jz heliwon + ;cmp ax,53 + ;jz helicombatend + call checkspeed + jnz helispeed + + mov ax,[es:bx+3] + inc ax + cmp ax,53 + jnz notbeforehdead + inc combatcount + cmp combatcount,8 + jc waitabit + mov mandead,2 +waitabit: mov ax,49 + jmp gotheliframe + +notbeforehdead: cmp ax,9 + jnz gotheliframe + dec ax + cmp lastweapon,1 + jnz notgunonheli + mov lastweapon,-1 + mov ax,55 + jmp gotheliframe +notgunonheli: mov ax,5 + inc combatcount + cmp combatcount,20 + jnz gotheliframe + mov combatcount,0 + mov ax,9 + +gotheliframe: mov [es:bx+3],ax +helispeed: call showgamereel + mov al,mapx + mov [es:bx+1],al +helicombatend: mov ax,[es:bx+3] + cmp ax,9 ;8 + jnc notwaitingheli + cmp combatcount,7 + jc notwaitingheli + mov pointermode,2 + mov watchingtime,0 + ret +notwaitingheli: mov pointermode,0 + mov watchingtime,2 + ret + +heliwon: mov pointermode,0 + ret + + endp + + +Mugger proc near + + mov ax,[es:bx+3] + cmp ax,138 + jz endmugger1 + cmp ax,176 + jz endmugger2 + cmp ax,2 + jnz havesetwatch + mov watchingtime,175*2 +havesetwatch: call checkspeed + jnz notmugger + inc word ptr [es:bx+3] +notmugger: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + +endmugger1: push es bx + call createpanel2 + call showicon + mov al,41 + call findpuztext + mov di,33+20 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreen + mov cx,300 + call hangon + pop bx es + push es bx + mov word ptr [es:bx+3],140 + mov manspath,2 + mov finaldest,2 + call findxyfrompath + mov resetmanxy,1 + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call findexobject + mov command,al + mov objecttype,4 + call removeobfrominv + call makemainscreen + mov al,48 + mov bl,68-32 + mov bh,54+64 + mov cx,70 ; time on screen + mov dx,10 ; pause before show + call setuptimeduse + mov beenmugged,1 + pop bx es + ret + +endmugger2: ret + + + endp + + + + + + + + +Aide proc near + + call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Businessman proc near + + mov pointermode,0 + mov watchingtime,2 + mov ax,[es:bx+3] + cmp ax,2 + jnz notfirstbiz + push ax bx es + mov al,49 + mov cx,30 + mov dx,1 + mov bl,68 + mov bh,174 + call setuptimeduse + pop es bx ax + +notfirstbiz: cmp ax,95 + jz buscombatwonend + cmp ax,49 + jz buscombatend + + call checkspeed + jnz busspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,48 + jnz notbeforedeadb + mov mandead,2 + jmp gotbusframe + +notbeforedeadb: cmp ax,15 + jnz buscombatwon + dec ax + cmp lastweapon,3 + jnz notshieldonbus + mov lastweapon,-1 + mov combatcount,0 + mov ax,51 + jmp gotbusframe +notshieldonbus: inc combatcount + cmp combatcount,20 + jnz gotbusframe + mov combatcount,0 + mov ax,15 + jmp gotbusframe + +buscombatwon: cmp ax,91 + jnz gotbusframe + push bx es + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,3 + call turnpathoff + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + pop es bx + mov ax,92 + jmp gotbusframe + +gotbusframe: mov [es:bx+3],ax +busspeed: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,14 + jnz buscombatend + mov watchingtime,0 + mov pointermode,2 + ret + +buscombatend: ret + +buscombatwonend: mov pointermode,0 + mov watchingtime,0 + ret + + endp + + + + + + +Poolguard proc near + + mov ax,[es:bx+3] + cmp ax,214 + jz combatover2 + cmp ax,258 + jz combatover2 + cmp ax,185 + jz combatover1 + cmp ax,0 + jnz notfirstpool + mov al,0 + call turnpathon +notfirstpool: call checkspeed + jnz guardspeed + + mov ax,[es:bx+3] + inc ax + cmp ax,122 + jnz notendguard1 + dec ax + cmp lastweapon,2 + jnz notaxeonpool + mov lastweapon,-1 + mov ax,122 + jmp gotguardframe +notaxeonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,195 + jmp gotguardframe + +notendguard1: cmp ax,147 + jnz gotguardframe + dec ax + cmp lastweapon,1 + jnz notgunonpool + mov lastweapon,-1 + mov ax,147 + jmp gotguardframe +notgunonpool: inc combatcount + cmp combatcount,40 + jnz gotguardframe + mov combatcount,0 + mov ax,220 + +gotguardframe: mov [es:bx+3],ax +guardspeed: call showgamereel + mov ax,[es:bx+3] + cmp ax,121 + jz iswaitingpool + cmp ax,146 + jz iswaitingpool + mov pointermode,0 + mov watchingtime,2 + ret +iswaitingpool: mov pointermode,2 + mov watchingtime,0 + ret + +combatover1: mov watchingtime,0 + mov pointermode,0 + mov al,0 + call turnpathon + mov al,1 + call turnpathoff + ret + +combatover2: call showgamereel + mov watchingtime,2 + mov pointermode,0 + inc combatcount + cmp combatcount,100 + jc doneover2 + mov watchingtime,0 + mov mandead,2 +doneover2: ret + + endp + + + + + + + + + + +Security proc near + + cmp word ptr [es:bx+3],32 + jz securwait + cmp word ptr [es:bx+3],69 + jnz notaftersec + ret +notaftersec: mov watchingtime,10 + call checkspeed + jnz gotsecurframe + inc word ptr [es:bx+3] + jmp gotsecurframe +securwait: cmp lastweapon,1 + jnz gotsecurframe + mov watchingtime,10 + cmp manspath,9 + jnz gotsecurframe + cmp facing,0 + jnz gotsecurframe + mov lastweapon,-1 + inc word ptr [es:bx+3] +gotsecurframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + +Heavy proc near + + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + cmp word ptr [es:bx+3],43 + jz heavywait + mov watchingtime,10 + cmp word ptr [es:bx+3],70 + jnz notafterhshot + inc combatcount + cmp combatcount,80 + jnz gotheavyframe + mov mandead,2 + jmp gotheavyframe +notafterhshot: call checkspeed + jnz gotheavyframe + inc word ptr [es:bx+3] + jmp gotheavyframe +heavywait: cmp lastweapon,1 + jnz gotheavyframe + cmp manspath,5 + jnz gotheavyframe + cmp facing,4 + jnz gotheavyframe + mov lastweapon,-1 + inc word ptr [es:bx+3] + mov combatcount,0 +gotheavyframe: call showgamereel + call addtopeoplelist + ret + + endp + + + + +Bossman proc near + + call checkspeed + jnz notboss + mov ax,[es:bx+3] + inc ax + cmp ax,4 + jz firstdes + cmp ax,20 + jz secdes + cmp ax,41 + jnz gotallboss + mov ax,0 + inc gunpassflag + mov byte ptr [es:bx+7],10 + jmp gotallboss +firstdes: cmp gunpassflag,1 + jz gotallboss + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,10 + jc gotallboss + mov ax,0 + jmp gotallboss +secdes: cmp gunpassflag,1 + jz gotallboss + mov ax,0 +gotallboss: mov [es:bx+3],ax +notboss: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedboss + mov talkedtoboss,1 +nottalkedboss: ret + + endp + + + + + +Gamer proc near + + call checkspeed + jnz gamerfin +gameragain: call randomnum1 + and al,7 + cmp al,5 + jnc gameragain + add al,20 + cmp al,[es:bx+3] + jz gameragain + mov ah,0 + mov [es:bx+3],ax +gamerfin: call showgamereel + call addtopeoplelist + ret + + endp + + + + + +Sparkydrip proc near + + call checkspeed + jnz cantdrip + mov al,14 + mov ah,0 + call playchannel0 +cantdrip: ret + + endp + + + +Carparkdrip proc near + + call checkspeed + jnz cantdrip2 + mov al,14 + call playchannel1 +cantdrip2: ret + + endp + + + +Keeper proc near + + cmp keeperflag,0 + jnz notwaiting + cmp reeltowatch,190 + jc waiting + inc keeperflag + mov ah,[es:bx+7] + and ah,127 + cmp ah,dreamnumber + jz notdiff + mov al,dreamnumber + mov [es:bx+7],al +notdiff: ret +notwaiting: call addtopeoplelist + call showgamereel +waiting: ret + + endp + + + +Candles1 proc near + + call checkspeed + jnz candle1 + mov ax,[es:bx+3] + inc ax + cmp ax,44 + jnz notendcandle1 + mov ax,39 +notendcandle1: mov [es:bx+3],ax +candle1: call showgamereel + ret + + endp + + + +Smallcandle proc near + + call checkspeed + jnz smallcandlef + mov ax,[es:bx+3] + inc ax + cmp ax,37 + jnz notendsmallcandle + mov ax,25 +notendsmallcandle: mov [es:bx+3],ax +smallcandlef: call showgamereel + ret + + endp + + + + + + + + + + + +Intromagic1 proc near + + call checkspeed + jnz introm1fin + mov ax,[es:bx+3] + inc ax + cmp ax,145 + jnz gotintrom1 + mov ax,121 +gotintrom1: mov [es:bx+3],ax + cmp ax,121 + jnz introm1fin + inc introcount + push es bx + call intro1text + pop bx es + cmp introcount,8 ; was 7 + jnz introm1fin + add mapy,10 + mov nowinnewroom,1 +introm1fin: call showgamereel + ret + + endp + + + + +Candles proc near + + call checkspeed + jnz candlesfin + mov ax,[es:bx+3] + inc ax + cmp ax,167 + jnz gotcandles + mov ax,162 +gotcandles: mov [es:bx+3],ax +candlesfin: call showgamereel + ret + + endp + + + +Candles2 proc near + + call checkspeed + jnz candles2fin + mov ax,[es:bx+3] + inc ax + cmp ax,238 + jnz gotcandles2 + mov ax,233 +gotcandles2: mov [es:bx+3],ax +candles2fin: call showgamereel + ret + + endp + + + +Gates proc near + + call checkspeed + jnz gatesfin + mov ax,[es:bx+3] + inc ax + cmp ax,116 + jnz notbang + push ax bx es + mov al,17 ;12 + call playchannel1 + pop es bx ax +notbang: cmp ax,110 + jc slowgates + mov byte ptr [es:bx+5],2 +slowgates: cmp ax,120 + jnz gotgates + mov getback,1 + mov ax,119 +gotgates: mov [es:bx+3],ax + push es bx + call intro3text + pop bx es +gatesfin: call showgamereel + ret + + endp + + + + +Intromagic2 proc near + + call checkspeed + jnz introm2fin + mov ax,[es:bx+3] + inc ax + cmp ax,216 + jnz gotintrom2 + mov ax,192 +gotintrom2: mov [es:bx+3],ax +introm2fin: call showgamereel + ret + + endp + + + + +Intromagic3 proc near + + call checkspeed + jnz introm3fin + mov ax,[es:bx+3] + inc ax + cmp ax,218 + jnz gotintrom3 + mov getback,1 +gotintrom3: mov [es:bx+3],ax +introm3fin: call showgamereel + mov al,mapx + mov [es:bx+1],al + ret + + endp + + + + + + + +Intromonks1 proc near + + call checkspeed + jnz intromonk1fin + mov ax,[es:bx+3] + inc ax + cmp ax,80 + jnz notendmonk1 + add mapy,10 + mov nowinnewroom,1 + call showgamereel + ret +notendmonk1: cmp ax,30 + jnz gotintromonk1 + sub mapy,10 + mov nowinnewroom,1 + mov ax,51 +gotintromonk1: mov [es:bx+3],ax + cmp ax,5 + jz waitstep + cmp ax,15 + jz waitstep + cmp ax,25 + jz waitstep + cmp ax,61 + jz waitstep + cmp ax,71 + jz waitstep + jmp intromonk1fin +waitstep: push es bx + call intro2text + pop bx es + mov byte ptr [es:bx+6],-20 +intromonk1fin: call showgamereel + mov al,mapy + mov [es:bx+2],al + ret + + endp + + + + +Intromonks2 proc near + + call checkspeed + jnz intromonk2fin + mov ax,[es:bx+3] + inc ax + cmp ax,87 + jnz nottalk1 + inc introcount + push es bx + call monks2text + pop bx es + cmp introcount,19 + jnz notlasttalk1 + mov ax,87 + jmp gotintromonk2 +notlasttalk1: mov ax,74 + jmp gotintromonk2 + +nottalk1: cmp ax,110 + jnz notraisearm + inc introcount + push es bx + call monks2text + pop bx es + if cd + if german + cmp introcount,42 + else + cmp introcount,35 + endif + else + cmp introcount,35 + endif + jnz notlastraise + mov ax,111 + jmp gotintromonk2 +notlastraise: mov ax,98 + jmp gotintromonk2 + +notraisearm: cmp ax,176 + jnz notendmonk2 + mov getback,1 + jmp gotintromonk2 +notendmonk2: cmp ax,125 + jnz gotintromonk2 + mov ax,140 +gotintromonk2: mov [es:bx+3],ax +intromonk2fin: call showgamereel + ret + + endp + + + + + +Handclap proc near + + ret + + endp + + + + + if german + if cd + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,5 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,9 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,13 + jnz notmonk2text4 + mov introcount,14 + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,23 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,27 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: cmp introcount,30 + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,35 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + + endif + else + +Monks2text proc near + + cmp introcount,1 + jnz notmonk2text1 + mov al,8 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text1: cmp introcount,4 + jnz notmonk2text2 + mov al,9 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text2: cmp introcount,7 + jnz notmonk2text3 + mov al,10 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text3: cmp introcount,10 + jnz notmonk2text4 + if cd + mov introcount,12 + endif + mov al,11 + mov bl,0 + mov bh,105 + mov cx,100 + jmp gotmonks2text +notmonk2text4: cmp introcount,13 + jnz notmonk2text5 + if cd + mov introcount,17; 18 + ret + endif + mov al,12 + mov bl,0 + mov bh,120 + mov cx,100 + jmp gotmonks2text +notmonk2text5: cmp introcount,16 + jnz notmonk2text6 + mov al,13 + mov bl,0 + mov bh,135 + mov cx,100 + jmp gotmonks2text +notmonk2text6: cmp introcount,19 + jnz notmonk2text7 + mov al,14 + mov bl,36 + mov bh,160 + mov cx,100 ;32 + mov dx,1 + mov ah,82 + jmp setuptimedtemp +notmonk2text7: cmp introcount,22 + jnz notmonk2text8 + mov al,15 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text8: cmp introcount,25 + jnz notmonk2text9 + mov al,16 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text9: if cd + cmp introcount,27 + else + cmp introcount,28 + endif + jnz notmonk2text10 + mov al,17 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text10: cmp introcount,31 + jnz notmonk2text11 + mov al,18 + mov bl,36 + mov bh,160 + mov cx,100 + jmp gotmonks2text +notmonk2text11: ret + +gotmonks2text: mov dx,1 + mov cx,120 + mov ah,82 + call setuptimedtemp + ret + + endp + + endif + + + + + + +Intro1text proc near + + cmp introcount,2 + jnz notintro1text1 + mov al,40 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text1: cmp introcount,4 + jnz notintro1text2 + mov al,41 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text2: cmp introcount,6 + jnz notintro1text3 + mov al,42 + mov bl,34 + mov bh,130 + mov cx,90 + jmp gotintro1text +notintro1text3: ret + +gotintro1text: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk2 + dec introcount + ret + endif +oktalk2: call setuptimedtemp + ret + + endp + + + +Intro2text proc near + + cmp ax,5 + jnz notintro2text1 + mov al,43 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text1: cmp ax,15 + jnz notintro2text2 + mov al,44 + mov bl,34 + mov bh,40 + mov cx,90 + jmp gotintro2text +notintro2text2: ret + +gotintro2text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + +Intro3text proc near + + cmp ax,107 + jnz notintro3text1 + mov al,45 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text1: if cd + cmp ax,108 + else + cmp ax,109 + endif + jnz notintro3text2 + mov al,46 + mov bl,36 + mov bh,56 + mov cx,100 + jmp gotintro3text +notintro3text2: ret + +gotintro3text: mov dx,1 + mov ah,82 + call setuptimedtemp + ret + + endp + + + + + + + +Monkandryan proc near + + call checkspeed + jnz notmonkryan + mov ax,[es:bx+3] + inc ax + cmp ax,83 + jnz gotmonkryan + inc introcount + push es bx + call textformonk + pop bx es + mov ax,77 + cmp introcount,57 + jnz gotmonkryan + mov getback,1 + ret +gotmonkryan: mov [es:bx+3],ax +notmonkryan: call showgamereel + ret + + endp + + + + + +Endgameseq proc near + + call checkspeed + jnz notendseq + mov ax,[es:bx+3] + inc ax + cmp ax,51 + jnz gotendseq + cmp introcount,140 + jz gotendseq + inc introcount + push es bx + call textforend + pop bx es + mov ax,50 +gotendseq: mov [es:bx+3],ax + cmp ax,134 + jnz notfadedown + push es bx ax + call fadescreendownhalf + pop ax bx es + jmp notendseq +notfadedown: cmp ax,324 + jnz notfadeend + push es bx ax + call fadescreendowns + mov volumeto,7 + mov volumedirection,1 + pop ax bx es +notfadeend: cmp ax,340 + jnz notendseq + mov getback,1 +notendseq: call showgamereel + mov al,mapy + mov [es:bx+2],al + mov ax,[es:bx+3] + cmp ax,145 + jnz notendcreds + mov word ptr [es:bx+3],146 + call rollendcredits +notendcreds: ret + + endp + + + + + + +Rollendcredits proc near + + mov al,16 + mov ah,255 + call playchannel0 + mov volume,7 + mov volumeto,0 + mov volumedirection,-1 + + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,3*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,254 +endcredits1: push cx + + mov bx,10 + mov cx,linespacing +endcredits2: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot: push cx + mov di,75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot + + call vsync + mov cl,160 + mov ch,160 + mov di,75 + mov bx,20 + call multidump + + pop bx es di si cx + dec bx + loop endcredits2 + pop cx +looknext: mov al,[es:si] + inc si + cmp al,":" + jz gotnext + cmp al,0 + jz gotnext + jmp looknext +gotnext: loop endcredits1 + + mov cx,100 + call hangon + call paneltomap + call fadescreenuphalf + ret + + endp + + + + + + +Priest proc near + + cmp word ptr [es:bx+3],8 + jz priestspoken + mov pointermode,0 + mov watchingtime,2 + call checkspeed + jnz priestwait + inc word ptr [es:bx+3] + push es bx + call priesttext + pop bx es +priestwait: ret + +priestspoken: ret + + endp + + + + + + +Madmanstelly proc near + + mov ax,[es:bx+3] + inc ax + cmp ax,307 + jnz notendtelly + mov ax,300 +notendtelly: mov [es:bx+3],ax + call showgamereel + ret + + endp + + + + + +Madman proc near + + mov watchingtime,2 + call checkspeed + jnz nomadspeed + mov ax,[es:bx+3] + cmp ax,364 + jnc ryansded + cmp ax,10 + jnz notfirstmad + push es bx ax + mov dx,offset cs:introtextname + call loadtemptext + pop ax bx es + mov combatcount,-1 + mov speechcount,0 +notfirstmad: inc ax + cmp ax,294 + jz madmanspoken + cmp ax,66 + jnz nomadspeak + inc combatcount + push es bx + call madmantext + pop bx es + mov ax,53 + if cd + cmp combatcount,64 + else + cmp combatcount,62 + endif + jc nomadspeak + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jz killryan + cmp lastweapon,8 + jnz nomadspeak + if cd + mov combatcount,72 + else + mov combatcount,70 + endif + mov lastweapon,-1 + mov madmanflag,1 + mov ax,67 + jmp nomadspeak +killryan: mov ax,310 +nomadspeak: mov [es:bx+3],ax +nomadspeed: call showgamereel + mov al,mapx + mov [es:bx+1],al + call madmode + ret +madmanspoken: cmp wongame,1 + jz alreadywon + mov wongame,1 + push es bx + call getridoftemptext + pop bx es +alreadywon: ret + +ryansded: mov mandead,2 + call showgamereel + ret + + endp + + + + + + + + + + if cd +Madmantext proc near + + cmp speechcount,63 + jnc nomadtext + cmp ch1playing,255 + jnz nomadtext + + mov al,speechcount + inc speechcount + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + + else + +Madmantext proc near + + cmp combatcount,61 + jnc nomadtext + mov al,combatcount + and al,3 + jnz nomadtext + mov al,combatcount + shr al,1 + shr al,1 + add al,47 + mov bl,72 + mov bh,80 + mov cx,90 + mov dx,1 + mov ah,82 + call setuptimedtemp +nomadtext: ret + + endp + endif + + + + +Madmode proc near + + mov watchingtime,2 + mov pointermode,0 + if cd + cmp combatcount,65 + else + cmp combatcount,63 + endif + jc iswatchmad + if cd + cmp combatcount,70 + else + cmp combatcount,68 + endif + jnc iswatchmad + mov pointermode,2 +iswatchmad: ret + + endp + + + + + +Priesttext proc near + + cmp word ptr [es:bx+3],2 + jc nopriesttext + cmp word ptr [es:bx+3],7 + jnc nopriesttext + mov al,[es:bx+3] + and al,1 + jnz nopriesttext + mov al,[es:bx+3] + shr al,1 + add al,50 + mov bl,72 + mov bh,80 + mov cx,54 + mov dx,1 + call setuptimeduse +nopriesttext: ret + + endp + + + + +Textforend proc near + + cmp introcount,20 + jnz notendtext1 + mov al,0 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext1: if cd + cmp introcount,50 + else + cmp introcount,65 + endif + jnz notendtext2 + mov al,1 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext2: if cd + cmp introcount,85 + else + cmp introcount,110 + endif + jnz notendtext3 + mov al,2 + mov bl,34 + mov bh,20 + mov cx,60 + jmp gotendtext +notendtext3: ret + +gotendtext: mov dx,1 + mov ah,83 + call setuptimedtemp + ret + + endp + + + + + + + + +Textformonk proc near + + cmp introcount,1 + jnz notmonktext1 + mov al,19 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext1: cmp introcount,5 + jnz notmonktext2 + mov al,20 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext2: cmp introcount,9 + jnz notmonktext3 + mov al,21 + mov bl,48 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext3: cmp introcount,13 + jnz notmonktext4 + mov al,22 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext4: if cd + cmp introcount,15 + else + cmp introcount,17 + endif + jnz notmonktext5 + mov al,23 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext5: cmp introcount,21 + jnz notmonktext6 + mov al,24 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext6: cmp introcount,25 + jnz notmonktext7 + mov al,25 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext7: cmp introcount,29 + jnz notmonktext8 + mov al,26 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext8: cmp introcount,33 + jnz notmonktext9 + mov al,27 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext9: cmp introcount,37 + jnz notmonktext10 + mov al,28 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext10: cmp introcount,41 + jnz notmonktext11 + mov al,29 + mov bl,68 + mov bh,38 + mov cx,120 + jmp gotmonktext +notmonktext11: cmp introcount,45 + jnz notmonktext12 + mov al,30 + mov bl,68 + mov bh,154 + mov cx,120 + jmp gotmonktext +notmonktext12: if cd + cmp introcount,52 + else + cmp introcount,49 + endif + jnz notmonktext13 + mov al,31 + mov bl,68 + mov bh,154 + mov cx,220 ;132 + jmp gotmonktext +notmonktext13: cmp introcount,53 + jnz notendtitles + call fadescreendowns + if cd + mov volumeto,7 + mov volumedirection,1 + endif +notendtitles: ret + +gotmonktext: mov dx,1 + mov ah,82 + if cd + cmp ch1playing,255 + jz oktalk + dec introcount + ret + endif +oktalk: call setuptimedtemp + ret + + endp + + + + + + + + + + +Drunk proc near + + cmp generaldead,0 + jnz trampgone + mov al,[es:bx+7] + and al,127 + mov [es:bx+7],al + call showgamereel + call addtopeoplelist +trampgone: ret + + endp + + +Advisor proc near + + call checkspeed + jnz noadvisor + jmp noadvisor + mov ax,[es:bx+3] + inc ax + cmp ax,123 + jnz notendadvis + mov ax,106 + jmp gotadvframe +notendadvis: cmp ax,108 + jnz gotadvframe + push ax + call randomnumber + mov cl,al + pop ax + cmp cl,3 + jc gotadvframe + mov ax,106 +gotadvframe: mov [es:bx+3],ax +noadvisor: call showgamereel + call addtopeoplelist + ret + + endp + + + +Copper proc near + + call checkspeed + jnz nocopper + mov ax,[es:bx+3] + inc ax + cmp ax,94 + jnz notendcopper + mov ax,64 + jmp gotcopframe +notendcopper: cmp ax,81 + jz mightwait + cmp ax,66 + jnz gotcopframe +mightwait: push ax + call randomnumber + mov cl,al + pop ax + cmp cl,7 + jc gotcopframe + dec ax +gotcopframe: mov [es:bx+3],ax +nocopper: call showgamereel + call addtopeoplelist + ret + + endp + + + + + + + + + + +Sparky proc near + + cmp card1money,0 + jz animsparky + mov byte ptr [es:bx+7],3 + jmp animsparky + +animsparky: call checkspeed + jnz finishsparky + cmp word ptr [es:bx+3],34 + jnz notsparky1 + call randomnumber + cmp al,30 + jc dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +notsparky1: cmp word ptr [es:bx+3],48 + jnz dosparky + mov word ptr [es:bx+3],27 + jmp finishsparky + +dosparky: inc word ptr [es:bx+3] +finishsparky: call showgamereel + call addtopeoplelist + + mov al,[es:bx+7] + and al,128 + jz nottalkedsparky + mov talkedtosparky,1 +nottalkedsparky: ret + + endp + + + + + +Train proc near + + ret + mov ax,[es:bx+3] + cmp ax,21 + jnc notrainyet + inc ax + jmp gottrainframe +notrainyet: call randomnumber + cmp al,253 + jc notrainatall + cmp manspath,5 + jnz notrainatall + cmp finaldest,5 + jnz notrainatall + mov ax,5 +gottrainframe: mov [es:bx+3],ax + call showgamereel +notrainatall: ret + + endp + + + + + + + +Addtopeoplelist proc near + + push es bx bx + mov cl,[es:bx+7] + mov ax,[es:bx+3] + mov bx,listpos + mov es,buffers + mov [es:bx],ax ;reel pointer position + pop ax + mov [es:bx+2],ax + mov [es:bx+4],cl ;coversation number + pop bx es + add listpos,5 + ret + + endp + + + +Showgamereel proc near + + mov ax,[es:bx+3] + cmp ax,512 + jnc noshow + mov reelpointer,ax + push es bx + call plotreel + pop bx es + mov ax,reelpointer + mov [es:bx+3],ax +noshow: ret + + endp + + + + + + +Checkspeed proc near + + cmp lastweapon,-1 + jnz forcenext + inc byte ptr [es:bx+6] + mov al,[es:bx+6] + cmp al,[es:bx+5] + jnz notspeed + mov al,0 + mov [es:bx+6],al + cmp al,al +notspeed: ret + +forcenext: cmp al,al + ret + + endp + + + + + + + + + + +;------------------------------------------------------------Sprite Routines---- + + + +Clearsprites proc near + + mov es,buffers + mov di,spritetable + mov al,255 + mov cx,tablesize*16 + rep stosb + ret + + endp + + + + +Makesprite proc near ;si holds x,y cx holds update + ;di,dx holds data offset,seg + mov es,buffers + mov bx,spritetable +$17: cmp byte ptr [es:bx+15],255 + jz $17a + add bx,tablesize + jmp $17 + +$17a: mov [es:bx],cx + mov [es:bx+10],si + mov [es:bx+6],dx + mov [es:bx+8],di + mov [es:bx+2],0ffffh + mov byte ptr [es:bx+15],0 + mov byte ptr [es:bx+18],0 + ret + + endp + + + + + + + + + + +Delsprite proc near + + mov di,bx + mov cx,tablesize + mov al,255 + rep stosb + ret + + endp + + + + + + + + + + +Spriteupdate proc near + + mov es,buffers + mov bx,spritetable + mov al,ryanon + mov byte ptr [es:bx+31],al + + mov es,buffers + mov bx,spritetable + mov cx,16 +$18: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz $18a + push es ds + mov cx,[es:bx+2] + mov [es:bx+24],cx + call ax + pop ds es +$18a: pop bx cx + cmp nowinnewroom,1 + jz $18b + add bx,tablesize + loop $18 + +$18b: ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Printsprites proc near + + mov es,buffers + mov cx,0 +priorityloop: push cx + mov priority,cl + mov bx,spritetable + mov cx,16 +prtspriteloop: push cx bx + mov ax,[es:bx] + cmp ax,0ffffh + jz skipsprite + mov al,priority + cmp al,[es:bx+23] + jnz skipsprite + cmp byte ptr [es:bx+31],1 + jz skipsprite + call printasprite +skipsprite: pop bx cx + add bx,tablesize + loop prtspriteloop + pop cx + inc cx + cmp cx,7 + jnz priorityloop + ret + + endp + + + + + + + + + + +Printasprite proc near + + push es bx + mov si,bx + mov ds,[es:si+6] + mov al,[es:si+11] + mov ah,0 + cmp al,220 + jc notnegative1 + mov ah,255 +notnegative1: mov bx,ax + add bx,mapady + mov al,[es:si+10] + mov ah,0 + cmp al,220 + jc notnegative2 + mov ah,255 +notnegative2: mov di,ax + add di,mapadx + mov al,[es:si+15] + mov ah,0 + cmp byte ptr [es:si+30],0 + jz steadyframe + mov ah,8 +steadyframe: cmp priority,6 + jnz notquickp +notquickp: call showframe + pop bx es + ret + + endp + + + + +;cmp priority,6 +; ;jz quicksprite ; WIll NEED TO DO THIS LATER!!!!! +;Quicksprite: mov cl,al +; mov ch,0 +; mov dx,[es:bx+6] +; mov es,workspace +; mov ds,dx +; mov bx,ax +; mov dx,vgawidth +; +;printquickloop: push di si +; +; push si +; add si,cx +; dec si +; jmp startzero +;zeroloop: dec si +; dec cl +;startzero: cmp [si],ch +; jz zeroloop +; pop si +; +;;printquickline: cmp [si],ch +; jnz foundfirstpix +; inc si +; inc di +; dec cl +; jnz printquickline +; +;foundfirstpix: cmp cl,0 +; jz finquickspr +; rep movsb +; +;finquickspr: pop si di +; mov cl,bl +; add si,cx +; add di,dx +; dec bh +; jnz printquickloop +; +; pop bx ds es +; ret + + + + + + + +;Calcframe proc near +; +; ret +; +; mov al,[es:bx+15] +; mov ah,0 +; mov cx,6 +; mul cx +; add ax,[es:bx+8] +; +; mov dx,[es:bx+6] +; push bx +; mov ds,dx +; mov bx,ax +; mov ax,[bx] +; mov cx,[bx+2] +; mov dx,[bx+4] +; pop bx +; mov [es:bx+2],ax +; add cx,[es:bx+8] +; add cx,2080 +; mov [es:bx+4],cx ;calculates frame data +; +; mov al,[es:bx+10] ;this bit calculates the actual +; add al,dl ;x and y (including any offset) +; mov [es:bx+12],al +; mov al,[es:bx+11] +; add al,dh +; mov [es:bx+13],al +; ret +; +; endp + + + + + + + + + + + + + + + + + + + + +Checkone proc near ;cx=x,y to check + + push cx + mov al,ch + mov ah,0 + mov cl,4 + shr ax,cl + mov dl,al + pop cx + mov al,cl + mov ah,0 + mov cl,4 + shr ax,cl + mov ah,dl ; al,ah holds x,y in blocks + + push ax + mov ch,0 + mov cl,al + push cx + mov al,ah + mov ah,0 + mov cx,11 + mul cx + pop cx + add ax,cx + + mov cx,3 + mul cx + mov si,ax + + mov ds,buffers + add si,mapflags + lodsw + mov cx,ax + lodsb + pop dx + ret + + + endp + + + + + + + + + + + + + + + + + + +Findsource proc near + + mov ax,currentframe + cmp ax,160 + jnc over1000 + mov ds,reel1 + mov takeoff,0 + ret +over1000: cmp ax,320 + jnc over1001 + mov ds,reel2 + mov takeoff,160 + ret +over1001: mov ds,reel3 + mov takeoff,320 + ret + + endp + + + + + + + + + + + +;---------------------------------------------------------Routines for Ryan---- + + +Initman proc near + + ;mov linepointer,254 + mov al,ryanx + mov ah,ryany + mov si,ax + mov cx,offset cs:mainman + mov dx,mainsprites + mov di,0 + call makesprite + mov byte ptr [es:bx+23],4 + mov byte ptr [es:bx+22],0 + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + +Mainman proc near + + cmp resetmanxy,1 + jnz notinnewroom + mov resetmanxy,0 + mov al,ryanx + mov ah,ryany + mov [es:bx+10],ax + mov byte ptr [es:bx+29],0 + jmp executewalk +notinnewroom: dec byte ptr [es:bx+22] + cmp byte ptr [es:bx+22],-1 + jz executewalk + ret + + +executewalk: mov byte ptr [es:bx+22],0 ; speed + mov al,turntoface + cmp al,facing + jz facingok + call aboutturn + jmp notwalk + +facingok: cmp turndirection,0 + jz alreadyturned + cmp linepointer,254 + jnz alreadyturned + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz alreadyturned + call checkforexit +alreadyturned: mov turndirection,0 + cmp linepointer,254 + jnz walkman + mov byte ptr [es:bx+29],0 + jmp notwalk + +walkman: mov al,[es:bx+29] + inc al + cmp al,11 + jnz notanimend1 + mov al,1 +notanimend1: mov [es:bx+29],al + + call walking + cmp linepointer,254 + jz afterwalk + + mov al,facing + and al,1 + jz isdouble + mov al,[es:bx+29] + cmp al,2 + jz afterwalk + cmp al,7 + jz afterwalk +isdouble: call walking +afterwalk: cmp linepointer,254 + jnz notwalk + mov al,turntoface + cmp al,facing + jnz notwalk + mov reasseschanges,1 + mov al,facing + cmp al,leavedirection + jnz notwalk + call checkforexit + +notwalk: mov al,facing + mov ah,0 + mov di,offset cs:facelist + add di,ax + mov al,[cs:di] + add al,[es:bx+29] + mov [es:bx+15],al + mov ax,[es:bx+10] + mov ryanx,al + mov ryany,ah + ret + +facelist: db 0,60,33,71,11,82,22,93 + + endp + + + + + + + + + + +Aboutturn proc near + + cmp turndirection,1 + jz incdir + cmp turndirection,-1 + jz decdir + mov al,facing + sub al,turntoface + jnc higher + neg al + cmp al,4 + jnc decdir + jmp incdir +higher: cmp al,4 + jnc incdir + jmp decdir + +incdir: mov turndirection,1 + mov al,facing + inc al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + +decdir: mov turndirection,-1 + mov al,facing + dec al + and al,7 + mov facing,al + mov byte ptr [es:bx+29],0 + ret + + endp + + + + + + + + +Walking proc near + + cmp linedirection,0 + jz normalwalk + mov al,linepointer + dec al + mov linepointer,al + cmp al,200 + jnc endofline + jmp continuewalk + +normalwalk: mov al,linepointer + inc al + mov linepointer,al + cmp al,linelength + jnc endofline + +continuewalk: mov ah,0 + add ax,ax + push es bx + mov dx,seg linedata + mov es,dx + mov bx,offset es:linedata + add bx,ax + mov ax,[es:bx] + pop bx es +stillline: mov [es:bx+10],ax + ret + +endofline: mov linepointer,254 + mov al,destination + mov manspath,al + cmp al,finaldest + jz finishedwalk + mov al,finaldest + mov destination,al + push es bx + call autosetwalk + pop bx es + ret + +finishedwalk: call facerightway + ret + + endp + + + + + + + +Facerightway proc near + + push es bx ;Face object when finished + call getroomspaths ;walking + mov al,manspath + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + add bx,ax + mov al,[es:bx+7] + mov turntoface,al + mov leavedirection,al + pop bx es + ret + + endp + + + + + + + +Checkforexit proc near + + mov cl,ryanx ;look under feet to see if + add cl,12 ;any flags are there + mov ch,ryany + add ch,12 + call checkone + mov lastflag,cl + mov lastflagex,ch + mov flagx,dl + mov flagy,dh + mov al,lastflag + + test al,64 + jz notnewdirect + mov al,lastflagex + mov autolocation,al + ret + +notnewdirect: test al,32 + jz notleave + push es bx + cmp reallocation,2 + jnz notlouis + mov bl,0 + push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"A" + call isryanholding + pop bx + jz noshoe1 + inc bl +noshoe1: push bx + mov al,"W" + mov ah,"E" + mov cl,"T" + mov ch,"B" + call isryanholding + pop bx + jz noshoe2 + inc bl +noshoe2: cmp bl,2 + jz notlouis + mov al,42 + cmp bl,0 + jz notravmessage + inc al +notravmessage: mov cx,80 + mov dx,10 + mov bl,68 + mov bh,64 + call setuptimeduse + mov al,facing + add al,4 + and al,7 + mov turntoface,al + pop bx es + ret + +notlouis: pop bx es + mov needtotravel,1 + ret + + + +notleave: test al,4 + jz notaleft + call adjustleft + ret + +notaleft: test al,2 + jz notaright + call adjustright + ret + +notaright: test al,8 + jz notadown + call adjustdown + ret + +notadown: test al,16 + jz notanup + call adjustup + ret + +notanup: ret + + endp + + + + + +Adjustdown proc near + + push es bx + add mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + +Adjustup proc near + + push es bx + sub mapy,10 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+11],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Adjustleft proc near + + push es bx + mov lastflag,0 + sub mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + + +Adjustright proc near + + push es bx + add mapx,11 + mov al,lastflagex + mov cl,16 + mul cl + sub al,2 + mov [es:bx+10],al + mov nowinnewroom,1 + pop bx es + ret + + endp + + + + + +Reminders proc nar + + cmp reallocation,24 + jnz notinedenslift + cmp mapx,44 + jnz notinedenslift + cmp progresspoints,0 + jnz notfirst + mov al,"D" + mov ah,"K" + mov cl,"E" + mov ch,"Y" + call isryanholding + jz forgotone + mov al,"C" + mov ah,"S" + mov cl,"H" + mov ch,"R" + call findexobject + cmp al,numexobjects + jz forgotone + mov ax,[es:bx+2] + cmp al,4 + jnz forgotone ;card is in inventory + cmp ah,255 + jz havegotcard ;card must be in an ex + mov cl,"P" ;object + mov ch,"U" + mov dl,"R" + mov dh,"S" + xchg al,ah + call compare + jnz forgotone ;is it in wallet? +havegotcard: inc progresspoints +notfirst: ret + +forgotone: mov al,50 ;message number + mov bl,54 ;x pos of message + mov bh,70 ;and y pos + mov cx,48 ;time on screen + mov dx,8 ;pause before show + call setuptimeduse + ret +notinedenslift: ret + + endp + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for rain effect +; +;--------------------------------------------------------------------------- + + + + +Initrain proc near + + mov es,buffers + mov di,rainlist + mov bx,offset cs:rainlocations +checkmorerain: mov al,[cs:bx] + cmp al,255 + jz finishinitrain + cmp al,reallocation + jnz checkrain + mov al,[cs:bx+1] + cmp al,mapx + jnz checkrain + mov al,[cs:bx+2] + cmp al,mapy + jnz checkrain + mov al,[cs:bx+3] + mov rainspace,al + jmp dorain +checkrain: add bx,4 + jmp checkmorerain + +dorain: mov cx,4 +initraintop: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initraintop + add cl,al + cmp cl,mapxsize + jnc initrainside + push cx + call splitintolines + pop cx + jmp initraintop + +initrainside: mov cl,mapxsize + dec cl +initrainside2: call randomnumber + and al,31 + add al,3 + cmp al,rainspace + jnc initrainside2 + add ch,al + cmp ch,mapysize + jnc finishinitrain + push cx + call splitintolines + pop cx + jmp initrainside2 +finishinitrain: mov al,255 + stosb + ret + +rainlocations: db 1,44,10,16 ;location,map x,y,seed + db 4,11,30,14 + db 4,22,30,14 + db 3,33,10,14 + db 10,33,30,14 + db 10,22,30,24 + db 9,22,10,14 + db 2,33,0,14 + db 2,22,0,14 + db 6,11,30,14 + db 7,11,20,18 + db 7,0,20,18 + db 7,0,30,18 + db 55,44,0,14 + db 5,22,30,14 + + db 8,0,10,18 + db 8,11,10,18 + db 8,22,10,18 + db 8,33,10,18 + db 8,33,20,18 + db 8,33,30,18 + db 8,33,40,18 + db 8,22,40,18 + db 8,11,40,18 + + db 21,44,20,18 + db 255 + + endp + + + + + + + + + + +Splitintolines proc near + + +lookforlinestart: call getblockofpixel + cmp al,0 + jnz foundlinestart + dec cl + inc ch + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +foundlinestart: mov [es:di],cx + mov bh,1 +lookforlineend: call getblockofpixel + cmp al,0 + jz foundlineend + dec cl + inc ch + cmp cl,0 + jz foundlineend + cmp ch,mapysize + jnc foundlineend + inc bh + jmp lookforlineend + +foundlineend: push cx + mov [es:di+2],bh + call randomnumber + mov [es:di+3],al + call randomnumber + mov [es:di+4],al + call randomnumber + and al,3 + add al,4 + mov [es:di+5],al + add di,6 + pop cx + cmp cl,0 + jz endofthisline + cmp ch,mapysize + jnc endofthisline + jmp lookforlinestart + +endofthisline: ret + + endp + + + + +Getblockofpixel proc near + + push cx es di + mov ax,mapxstart + add cl,al + mov ax,mapystart + add ch,al + call checkone + and cl,1 + jnz failrain + pop di es cx + ret +failrain: pop di es cx + mov al,0 + ret + + endp + + + + +Showrain proc near + + mov ds,mainsprites + mov si,6*58 + mov ax,[si+2] + mov si,ax + add si,2080 + + mov bx,rainlist + mov es,buffers + cmp byte ptr [es:bx],255 + jz nothunder + +morerain: mov es,buffers + cmp byte ptr [es:bx],255 + jz finishrain + + mov al,[es:bx+1] + mov ah,0 + add ax,mapady + add ax,mapystart + mov cx,320 + mul cx + mov cl,[es:bx] + mov ch,0 + add ax,cx + add ax,mapadx + add ax,mapxstart + mov di,ax + + mov cl,[es:bx+2] + mov ch,0 + mov ax,[es:bx+3] + mov dl,[es:bx+5] + mov dh,0 + sub ax,dx + and ax,511 + mov [es:bx+3],ax + add bx,6 + + push si + add si,ax + mov es,workspace + mov ah,0 + mov dx,320-2 +rainloop: lodsb + cmp al,ah + jz noplot + stosb + add di,dx + loop rainloop + pop si + jmp morerain +noplot: add di,320-1 + loop rainloop + pop si + jmp morerain + +finishrain: cmp ch1blockstocopy,0 + jnz nothunder + cmp reallocation,2 + jnz notlouisthund + cmp beenmugged,1 + jnz nothunder +notlouisthund: cmp reallocation,55 + jz nothunder + call randomnum1 + cmp al,1 + jnc nothunder + mov al,7 + cmp ch0playing,6 + jz isthunder1 + mov al,4 +isthunder1: call playchannel1 +nothunder: ret + + endp + + + + + + + +;--------------------------------------------------------------------------- +; +; Sprite update routines for background objects +; +;--------------------------------------------------------------------------- + + + + + + +Backobject proc near + + mov ds,setdat + mov di,[es:bx+20] + + mov al,[es:bx+18] + cmp al,0 + jz $48z + dec al + mov [es:bx+18],al + jmp finishback + +$48z: mov al,[di+7] + mov [es:bx+18],al + mov al,[di+8] + cmp al,6 + jnz notwidedoor + call widedoor + jmp finishback + +notwidedoor: cmp al,5 + jnz notrandom + call random + jmp finishback + +notrandom: cmp al,4 + jnz notlockdoor + call lockeddoorway + jmp finishback + +notlockdoor: cmp al,3 + jnz notlift + call liftsprite + jmp finishback + +notlift: cmp al,2 + jnz notdoor + call doorway + jmp finishback + +notdoor: cmp al,1 + jnz steadyob + call constant + jmp finishback + +steadyob: call steady + +finishback: ;call calcframe + ret + + endp + + + + + + + + + +Liftsprite proc near + + mov al,liftflag + cmp al,0 + jz liftclosed + cmp al,1 + jz liftopen + cmp al,3 + jz openlift + + mov al,[es:bx+19] + cmp al,0 + jz finishclose + dec al + cmp al,11 + jnz pokelift + push ax + mov al,3 + call liftnoise + pop ax + jmp pokelift +finishclose: mov liftflag,0 + ret + +openlift: mov al,[es:bx+19] + cmp al,12 + jz endoflist + inc al + cmp al,1 + jnz pokelift + push ax + mov al,2 + call liftnoise + pop ax +pokelift: mov [es:bx+19],al + mov ah,0 + push di + add di,ax + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + ret + +endoflist: mov liftflag,1 + ret + +liftopen: mov al,liftpath + push es bx + call turnpathon + pop bx es + cmp counttoclose,0 + jz nocountclose + dec counttoclose + cmp counttoclose,0 + jnz nocountclose + mov liftflag,2 +nocountclose: mov al,12 + jmp pokelift + +liftclosed: mov al,liftpath + push es bx + call turnpathoff + pop bx es + cmp counttoopen,0 + jz nocountopen + dec counttoopen + cmp counttoopen,0 + jnz nocountopen + mov liftflag,3 +nocountopen: mov al,0 + jmp pokelift + + endp + + +Liftnoise proc near + + cmp reallocation,5 + jz hissnoise + cmp reallocation,21 + jz hissnoise + call playchannel1 + ret +hissnoise: if demo + mov al,25 + else + mov al,13 + endif + call playchannel1 + ret + + endp + + + + +Random proc near + + call randomnum1 + push di + and ax,7 + add di,18 + add di,ax + mov al,[di] + pop di + mov [es:bx+15],al + ret + + endp + + + + + + + + +Steady proc near + + mov al,[di+18] + mov [di+17],al + mov [es:bx+15],al + ret + + endp + + + + + +Constant proc near + + inc byte ptr [es:bx+19] + mov cl,[es:bx+19] + mov ch,0 + add di,cx + cmp byte ptr [di+18],255 + jnz gotconst + sub di,cx + mov cx,0 + mov [es:bx+19],cl +gotconst: mov al,[di+18] + sub di,cx + mov [es:bx+15],al + mov [di+17],al + ret + + endp + + + + + + + + + + + + + + +Doorway proc near + + mov doorcheck1,-24 + mov doorcheck2,10 + mov doorcheck3,-30 + mov doorcheck4,10 + call dodoor + ret + + endp + + + +Widedoor proc near + + mov doorcheck1,-24 + mov doorcheck2,24 + mov doorcheck3,-30 + mov doorcheck4,24 + call dodoor + ret + + endp + + + + + + + + + +Dodoor proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor + sub al,cl + cmp al,doorcheck1 + jnc upordown + jmp shutdoor +rtofdoor: sub al,cl + cmp al,doorcheck2 + jnc shutdoor + +upordown: cmp ah,ch + jnc botofdoor + sub ah,ch + cmp ah,doorcheck3 + jc shutdoor + jmp opendoor +botofdoor: sub ah,ch + cmp ah,doorcheck4 + jnc shutdoor + +opendoor: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough + cmp cl,0 + jnz notthrough + mov cl,6 +notthrough: inc cl + cmp cl,1 + jnz notdoorsound2 + mov al,0 + cmp reallocation,5 + jnz nothoteldoor2 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor2: call playchannel1 +notdoorsound2: mov ch,0 + + push di + add di,cx + mov al,[di+18] ; must be a better way than this + cmp al,255 + jnz atlast1 + dec di + dec cl +atlast1: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + mov throughdoor,1 + ret + + +shutdoor: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound1 + mov al,1 + cmp reallocation,5 + jnz nothoteldoor1 + if demo + mov al,25 + else + mov al,13 + endif +nothoteldoor1: call playchannel1 +notdoorsound1: cmp cl,0 + jz atlast2 + dec cl + mov [es:bx+19],cl +atlast2: mov ch,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz notnearly + mov throughdoor,0 +notnearly: ret + + endp + + + + + + + + +Lockeddoorway proc near + + mov al,ryanx + mov ah,ryany + mov cl,[es:bx+10] + mov ch,[es:bx+11] + + cmp al,cl + jnc rtofdoor2 + sub al,cl + cmp al,-24 + jnc upordown2 + jmp shutdoor2 +rtofdoor2: sub al,cl + cmp al,10 + jnc shutdoor2 + +upordown2: cmp ah,ch + jnc botofdoor2 + sub ah,ch + cmp ah,-30 + jc shutdoor2 + jmp opendoor2 +botofdoor2: sub ah,ch + cmp ah,12 + jnc shutdoor2 + +opendoor2: cmp throughdoor,1 + jz mustbeopen + cmp lockstatus,1 + jz shutdoor +mustbeopen: mov cl,[es:bx+19] + cmp cl,1 + jnz notdoorsound4 + mov al,0 + call playchannel1 +notdoorsound4: cmp cl,6 ; was 3 + jnz noturnonyet + mov al,doorpath + push es bx + call turnpathon + pop bx es + +noturnonyet: mov cl,[es:bx+19] + cmp throughdoor,1 + jnz notthrough2 + cmp cl,0 + jnz notthrough2 + mov cl,6 +notthrough2: inc cl + mov ch,0 + + push di + add di,cx + mov al,[di+18] + cmp al,255 + jnz atlast3 + dec di + dec cl +atlast3: mov [es:bx+19],cl + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,5 + jnz justshutting + mov throughdoor,1 +justshutting: ret + + + +shutdoor2: mov cl,[es:bx+19] + cmp cl,5 + jnz notdoorsound3 + mov al,1 + call playchannel1 +notdoorsound3: cmp cl,0 + jz atlast4 + dec cl + mov [es:bx+19],cl +atlast4: mov ch,0 + mov throughdoor,0 + push di + add di,cx + mov al,[di+18] + pop di + mov [es:bx+15],al + mov [di+17],al + cmp cl,0 ;1 + jnz notlocky + mov al,doorpath + push es bx + call turnpathoff + pop bx es + mov lockstatus,1 +notlocky: ret + + endp + + + + + + + + + + +;------------------------------------------------------------People handler---- + +Updatepeople proc near + + mov es,buffers + mov di,peoplelist + mov listpos,di + mov cx,12*5 + mov al,255 + rep stosb + + inc maintimer + push cs + pop es + mov bx,offset cs:reelroutines + mov di,offset cs:reelcalls +updateloop: mov al,[es:bx] + cmp al,255 + jz endupdate + cmp al,reallocation + jnz notinthisroom + mov cx,[es:bx+1] + cmp cl,mapx + jnz notinthisroom + cmp ch,mapy + jnz notinthisroom + push di + mov ax,[cs:di] + call ax + pop di +notinthisroom: add bx,8 + add di,2 + jmp updateloop +endupdate: ret + + endp + + + + + + + + + + + + + + +Getreelframeax proc near + + push ds + mov currentframe,ax + call findsource + push ds + pop es + pop ds + mov ax,currentframe + sub ax,takeoff + add ax,ax + mov cx,ax + add ax,ax + add ax,cx + mov bx,ax + ret + + endp + + + + + + + + + + +Reelsonscreen proc near + + call reconstruct + call updatepeople + call watchreel + call showrain + call usetimedtext + ret + + endp + + + + + + +Plotreel proc near + + call getreelstart +retryreel: push es si + mov ax,[es:si+2] + cmp al,220 + jc normalreel + cmp al,255 + jz normalreel + call dealwithspecial + inc reelpointer + pop si es + add si,40 + jmp retryreel + +normalreel: mov cx,8 +plotloop: push cx es si + mov ax,[es:si] + cmp ax,0ffffh + jz notplot + call showreelframe +notplot: pop si es cx + add si,5 + loop plotloop + call soundonreels + pop bx es + ret + + endp + + + + + +Soundonreels proc near + + mov bl,reallocation + add bl,bl + xor bh,bh + add bx,offset cs:roombyroom + mov si,[cs:bx] + +reelsoundloop: mov al,[cs:si] + cmp al,255 + jz endreelsound + mov ax,[cs:si+1] + cmp ax,reelpointer + jnz skipreelsound + + cmp ax,lastsoundreel + jz skipreelsound + + mov lastsoundreel,ax + mov al,[cs:si] + cmp al,64 + jc playchannel1 + cmp al,128 + jc channel0once + and al,63 + mov ah,255 + jmp playchannel0 +channel0once: and al,63 + mov ah,0 + jmp playchannel0 +skipreelsound: add si,3 + jmp reelsoundloop +endreelsound: mov ax,lastsoundreel + cmp ax,reelpointer + jz nochange2 + mov lastsoundreel,-1 +nochange2: ret + +roombyroom dw r0,r1,r2,r0,r0,r0,r6,r0,r8,r9,r10,r11,r12,r13,r14,r0,r0,r0,r0,r0 + dw r20,r0,r22,r23,r0,r25,r26,r27,r28,r29,r0,r0,r0,r0,r0 + dw r0,r0,r0,r0,r0,r0,r0,r0,r0,r0,r45,r46,r47,r0,r0,r0,r0,r52,r53,r0,r55 + +r0 db 255 + +r1 db 15 + dw 257 + db 255 + +r2 db 12 + dw 5 + db 13 + dw 21 + db 15 ;hitting floor? + dw 35 + db 17 + dw 50 + db 18 + dw 103 + db 19 + dw 108 + db 255 + +r6 db 18 + dw 19 + db 19 + dw 23 + db 255 + +r8 db 12 + dw 51 + db 13 + dw 53 + db 14 + dw 14 + db 15 + dw 20 + db 0 + dw 78 + db 255 + +r9 db 12 + dw 119 + db 12 + dw 145 + db 255 + +r10 db 13 + dw 16 + db 255 + +r11 db 13 + dw 20 + db 255 + +r12 db 14 + dw 16 + db 255 + +r13 db 15 + dw 4 + db 16 + dw 8 + db 17 + dw 134 + db 18 + dw 153 + db 255 + +r14 db 13 + dw 108 + db 15 + dw 326 + db 15 + dw 331 + db 15 + dw 336 + db 15 + dw 342 + db 15 + dw 348 + db 15 + dw 354 + db 18 + dw 159 + db 18 + dw 178 + db 19+128 + dw 217 + db 20+64 + dw 228 + db 255 + +r20 db 13 + dw 20 + db 13 + dw 21 + db 15 + dw 34 + db 13 + dw 52 + db 13 + dw 55 + db 25 + dw 57 + db 21 + dw 73 + db 255 + +r22 db 13 ;room,sample + dw 196 ;reelpointer + db 13 + dw 234 + db 13 + dw 156 + db 14 + dw 129 + db 13 + dw 124 + db 15 + dw 162 + db 15 + dw 200 + db 15 + dw 239 + db 17 + dw 99 + db 12 + dw 52 + db 255 + +r23 db 15 + dw 56 + db 16 + dw 64 + db 19 + dw 22 + db 20 + dw 33 + db 255 + +r25 db 20 + dw 11 + db 20 + dw 15 + db 15 + dw 28 + db 13 + dw 80 + db 21 + dw 82 + db 19+128 + dw 87 + db 23+64 + dw 128 + db 255 + +r26 db 12 + dw 13 + db 14 + dw 39 + db 12 + dw 67 + db 12 + dw 75 + db 12 + dw 83 + db 12 + dw 91 + db 15 + dw 102 ; was 90, should be mine cart + db 255 + +r27 db 22 + dw 36 + db 13 + dw 125 + db 18 + dw 88 + db 15 + dw 107 + db 14 + dw 127 + db 14 + dw 154 + db 19+128 + dw 170 + db 23+64 + dw 232 + db 255 + +r28 db 21 + dw 16 + db 21 + dw 72 + db 21 + dw 205 + db 22 + dw 63 ;65 + db 23+128 + dw 99 + db 24+64 + dw 158 + db 255 + +r29 db 13 + dw 21 + db 14 + dw 24 + db 19+128 + dw 50 + db 23+64 + dw 75 + if german + else + db 24 + dw 128 + endif + db 255 + +r45 db 19+64 + dw 46 + db 16 + dw 167 + db 255 + +r46 db 16 + dw 19 + db 14 + dw 36 + db 16 + dw 50 + db 14 + dw 65 + db 16 + dw 81 + db 14 + dw 96 + db 16 + dw 114 + db 14 + dw 129 + db 16 + dw 147 + db 14 + dw 162 + db 16 + dw 177 + db 14 + dw 191 + db 255 + +r47 db 13 + dw 48 + db 14 + dw 41 + db 15 + dw 78 + db 16 + dw 92 + db 255 + +r52 db 16 + dw 115 + db 255 + +r53 db 21 + dw 103 + db 20 + dw 199 + db 255 + +r55 db 17 + dw 53 + db 17 + dw 54 + db 17 + dw 55 + db 17 + dw 56 + db 17 + dw 57 + db 17 + dw 58 + db 17 + dw 59 + db 17 + dw 61 + db 17 + dw 63 + db 17 + dw 64 + db 17 + dw 65 + db 255 + + endp + + + + + + + + + +Reconstruct proc near + + cmp havedoneobs,0 + jz noneedtorecon + mov newobs,1 + call drawfloor + call spriteupdate + call printsprites + if foreign + cmp reallocation,20 + jnz notfudge + call undertextline +notfudge: + endif + mov havedoneobs,0 +noneedtorecon: ret + + endp + + + + + + + + + + +Dealwithspecial proc near + + sub al,220 + cmp al,0 + jnz notplset + mov al,ah + call placesetobject + mov havedoneobs,1 + ret +notplset: cmp al,1 + jnz notremset + mov al,ah + call removesetobject + mov havedoneobs,1 + ret +notremset: cmp al,2 + jnz notplfree + mov al,ah + call placefreeobject + mov havedoneobs,1 + ret +notplfree: cmp al,3 + jnz notremfree + mov al,ah + call removefreeobject + mov havedoneobs,1 + ret +notremfree: cmp al,4 + jnz notryanoff + call switchryanoff + ret +notryanoff: cmp al,5 + jnz notryanon + mov turntoface,ah + mov facing,ah + call switchryanon + ret +notryanon: cmp al,6 + jnz notchangeloc + mov newlocation,ah ; was new loc in watch + ;call switchryanon + ret +notchangeloc: call movemap + ret + + endp + + + +Movemap proc near + + cmp ah,32 + jnz notmapup2 + sub mapy,20 + mov nowinnewroom,1 + ret + +notmapup2: cmp ah,16 + jnz notmapupspec + sub mapy,10 + mov nowinnewroom,1 + ret + +notmapupspec: cmp ah,8 + jnz notmapdownspec + add mapy,10 + mov nowinnewroom,1 + ret + +notmapdownspec: cmp ah,2 + jnz notmaprightspec + add mapx,11 + mov nowinnewroom,1 + ret + +notmaprightspec: sub mapx,11 + mov nowinnewroom,1 + ret + + endp + + + + +Getreelstart proc near + + mov ax,reelpointer + mov cx,40 + mul cx + mov es,reels + mov si,ax + add si,reellist + ret + + endp + + + + + +;------------------------------------------------------Printing a reel frame---- + + + +Showreelframe proc near + + mov al,[es:si+2] + mov ah,0 + mov di,ax + add di,mapadx + mov al,[es:si+3] + mov bx,ax + add bx,mapady + mov ax,[es:si] + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,8 + call showframe + ret + + endp + + + + + + +;------------------------------------------------------------------------------- + + + + + + + + + +Deleverything proc near + + mov al,mapysize + mov ah,0 + add ax,mapoffsety + cmp ax,182 + jnc bigroom + call maptopanel + ret +bigroom: sub mapysize,8 + call maptopanel + add mapysize,8 + ret + + endp + + + + + + + + + + + +Dumpeverything proc near + + mov es,buffers + mov bx,printedlist +dumpevery1: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery1 + cmp ax,[es:bx+(40*5)] + jnz notskip1 + cmp cx,[es:bx+(40*5)+2] + jz skip1 + +notskip1: push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + +skip1: add bx,5 + jmp dumpevery1 + +finishevery1: mov bx,printedlist+(40*5) +dumpevery2: mov ax,[es:bx] + mov cx,[es:bx+2] + cmp ax,0ffffh + jz finishevery2 + + push bx es ds + mov bl,ah + mov bh,0 + mov ah,0 + mov di,ax + add di,mapadx + add bx,mapady + call multidump + pop ds es bx + add bx,5 + jmp dumpevery2 + +finishevery2: ret + + endp + + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm index cb100f6602..d2c27f059b 100644 --- a/devtools/tasmrecover/dreamweb/talk.asm +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -1,580 +1,580 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Talk proc near - - mov talkpos,0 - mov inmaparea,0 - mov al,command - mov character,al - call createpanel - call showpanel - call showman - call showexit - call undertextline - call convicons - call starttalk - mov commandtype,255 - call readmouse - call showpointer - call worktoscreen -waittalk: call delpointer - call readmouse - call animpointer - call showpointer - call vsync - call dumppointer - call dumptextline - mov getback,0 - mov bx,offset cs:talklist - call checkcoords - cmp getback,0 - jz waittalk -finishtalk: mov bx,persondata - push cs - pop es - cmp talkpos,4 - jc notnexttalk - mov al,[es:bx+7] - or al,128 - mov [es:bx+7],al -notnexttalk: call redrawmainscrn - call worktoscreenm - cmp speechloaded,1 - jnz nospeech - call cancelch1 - mov volumedirection,-1 ;fade (louder) - mov volumeto,0 ;up to 0 (max) -nospeech: ret - -talklist: dw 273,320,157,198,getback1 - dw 240,290,2,44,moretalk - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - - - - - - -Convicons proc near - - mov al,character - and al,127 - call getpersframe - mov di,234 - mov bx,2 - mov currentframe,ax - call findsource - mov ax,currentframe - sub ax,takeoff - mov ah,0 - call showframe - ret - - endp - - - - - - - - -Getpersframe proc near - - mov ah,0 - add ax,ax - mov bx,ax - mov es,people - add bx,personframes - mov ax,[es:bx] - ret - - endp - - - - - -Starttalk proc near - - mov talkmode,0 - mov al,character - and al,127 - call getpersontext - mov charshift,91+91 - mov di,66 - mov bx,64 - mov dl,241 - mov al,0 - mov ah,79 - call printdirect - mov charshift,0 - mov di,66 - mov bx,80 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - - if cd - mov speechloaded,0 - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cl,"C" - mov dl,"R" - mov dh,reallocation - call loadspeech - cmp speechloaded,1 - jnz nospeech1 - mov volumedirection,1 ;quieter - mov volumeto,6 ;quite quiet! - mov al,50+12 - call playchannel1 - endif -nospeech1: ret - - endp - - - - - -Getpersontext proc near - - mov ah,0 - mov cx,64*2 - mul cx - mov si,ax - mov es,people - add si,persontxtdat - mov cx,persontext - mov ax,[es:si] - add ax,cx - mov si,ax - ret - - endp - - - - - - - -Moretalk proc near - - ;cmp ch1playing,255 - ;jnz cantredes - cmp talkmode,0 - jz canmore - call redes - ret - -canmore: cmp commandtype,215 - jz alreadymore - mov commandtype,215 - mov al,49 - call commandonly -alreadymore: mov ax,mousebutton - cmp ax,oldbutton - jz nomore - and ax,1 - jnz domoretalk -nomore: ret - -domoretalk: mov talkmode,2 - mov talkpos,4 - cmp character,100 - jc notsecondpart - mov talkpos,48 -notsecondpart: call dosometalk - ret - - endp - - - - - - - - - - - - - - -Dosometalk proc near - - if cd -dospeech: mov al,talkpos - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cx,ax - mov al,talkpos - mov ah,0 - add ax,cx - add ax,ax - mov si,ax - - mov es,people - add si,persontxtdat - mov cx,persontext - - mov ax,[es:si] - add ax,cx - mov si,ax - cmp byte ptr [es:si],0 - jz endheartalk - - push es si - call createpanel - call showpanel - call showman - call showexit - call convicons - pop si es - - mov di,164 - mov bx,64 - mov dl,144 - mov al,0 - mov ah,0 - call printdirect - - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cl,talkpos - mov ch,0 - add ax,cx - mov cl,"C" - mov dl,"R" - mov dh,reallocation - call loadspeech - cmp speechloaded,0 - jz noplay1 - mov al,62 - call playchannel1 - -noplay1: mov pointermode,3 - call worktoscreenm - mov cx,180 - call hangonpq +Talk proc near + + mov talkpos,0 + mov inmaparea,0 + mov al,command + mov character,al + call createpanel + call showpanel + call showman + call showexit + call undertextline + call convicons + call starttalk + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen +waittalk: call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov getback,0 + mov bx,offset cs:talklist + call checkcoords + cmp getback,0 + jz waittalk +finishtalk: mov bx,persondata + push cs + pop es + cmp talkpos,4 + jc notnexttalk + mov al,[es:bx+7] + or al,128 + mov [es:bx+7],al +notnexttalk: call redrawmainscrn + call worktoscreenm + cmp speechloaded,1 + jnz nospeech + call cancelch1 + mov volumedirection,-1 ;fade (louder) + mov volumeto,0 ;up to 0 (max) +nospeech: ret + +talklist: dw 273,320,157,198,getback1 + dw 240,290,2,44,moretalk + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + + + + +Convicons proc near + + mov al,character + and al,127 + call getpersframe + mov di,234 + mov bx,2 + mov currentframe,ax + call findsource + mov ax,currentframe + sub ax,takeoff + mov ah,0 + call showframe + ret + + endp + + + + + + + + +Getpersframe proc near + + mov ah,0 + add ax,ax + mov bx,ax + mov es,people + add bx,personframes + mov ax,[es:bx] + ret + + endp + + + + + +Starttalk proc near + + mov talkmode,0 + mov al,character + and al,127 + call getpersontext + mov charshift,91+91 + mov di,66 + mov bx,64 + mov dl,241 + mov al,0 + mov ah,79 + call printdirect + mov charshift,0 + mov di,66 + mov bx,80 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + if cd + mov speechloaded,0 + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,1 + jnz nospeech1 + mov volumedirection,1 ;quieter + mov volumeto,6 ;quite quiet! + mov al,50+12 + call playchannel1 + endif +nospeech1: ret + + endp + + + + + +Getpersontext proc near + + mov ah,0 + mov cx,64*2 + mul cx + mov si,ax + mov es,people + add si,persontxtdat + mov cx,persontext + mov ax,[es:si] + add ax,cx + mov si,ax + ret + + endp + + + + + + + +Moretalk proc near + + ;cmp ch1playing,255 + ;jnz cantredes + cmp talkmode,0 + jz canmore + call redes + ret + +canmore: cmp commandtype,215 + jz alreadymore + mov commandtype,215 + mov al,49 + call commandonly +alreadymore: mov ax,mousebutton + cmp ax,oldbutton + jz nomore + and ax,1 + jnz domoretalk +nomore: ret + +domoretalk: mov talkmode,2 + mov talkpos,4 + cmp character,100 + jc notsecondpart + mov talkpos,48 +notsecondpart: call dosometalk + ret + + endp + + + + + + + + + + + + + + +Dosometalk proc near + + if cd +dospeech: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay1 + mov al,62 + call playchannel1 + +noplay1: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq jnc $1 ret - + $1: - inc talkpos - - mov al,talkpos - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cx,ax - mov al,talkpos - mov ah,0 - add ax,cx - add ax,ax - mov si,ax - - mov es,people - add si,persontxtdat - mov cx,persontext - - mov ax,[es:si] - add ax,cx - mov si,ax - cmp byte ptr [es:si],0 - jz endheartalk - cmp byte ptr [es:si],":" - jz skiptalk2 - cmp byte ptr [es:si],32 - jz skiptalk2 - - push es si - call createpanel - call showpanel - call showman - call showexit - call convicons - pop si es - - mov di,48 - mov bx,128 - mov dl,144 - mov al,0 - mov ah,0 - call printdirect - - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cl,talkpos - mov ch,0 - add ax,cx - mov cl,"C" - mov dl,"R" - mov dh,reallocation - call loadspeech - cmp speechloaded,0 - jz noplay2 - mov al,62 - call playchannel1 - -noplay2: mov pointermode,3 - call worktoscreenm - mov cx,180 - call hangonpq + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endheartalk + cmp byte ptr [es:si],":" + jz skiptalk2 + cmp byte ptr [es:si],32 + jz skiptalk2 + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cl,talkpos + mov ch,0 + add ax,cx + mov cl,"C" + mov dl,"R" + mov dh,reallocation + call loadspeech + cmp speechloaded,0 + jz noplay2 + mov al,62 + call playchannel1 + +noplay2: mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq jnc skiptalk2 ret - -skiptalk2: inc talkpos - jmp dospeech - -endheartalk: mov pointermode,0 - ret - - else - -watchtalk: mov al,talkpos - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cx,ax - mov al,talkpos - mov ah,0 - add ax,cx - add ax,ax - mov si,ax - - mov es,people - add si,persontxtdat - mov cx,persontext - - mov ax,[es:si] - add ax,cx - mov si,ax - cmp byte ptr [es:si],0 - jz endwatchtalk - - push es si - call createpanel - call showpanel - call showman - call showexit - call convicons - pop si es - - mov di,164 - mov bx,64 - mov dl,144 - mov al,0 - mov ah,0 - call printdirect - - mov pointermode,3 - call worktoscreenm - mov cx,180 - call hangonpq + +skiptalk2: inc talkpos + jmp dospeech + +endheartalk: mov pointermode,0 + ret + + else + +watchtalk: mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,164 + mov bx,64 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq jnc $1 ret $1: - - inc talkpos - - mov al,talkpos - mov al,character - and al,127 - mov ah,0 - mov cx,64 - mul cx - mov cx,ax - mov al,talkpos - mov ah,0 - add ax,cx - add ax,ax - mov si,ax - - mov es,people - add si,persontxtdat - mov cx,persontext - - mov ax,[es:si] - add ax,cx - mov si,ax - cmp byte ptr [es:si],0 - jz endwatchtalk - cmp byte ptr [es:si],":" - jz skiptalk - cmp byte ptr [es:si],32 - jz skiptalk - - push es si - call createpanel - call showpanel - call showman - call showexit - call convicons - pop si es - - mov di,48 - mov bx,128 - mov dl,144 - mov al,0 - mov ah,0 - call printdirect - - mov pointermode,3 - call worktoscreenm - mov cx,180 - call hangonpq + + inc talkpos + + mov al,talkpos + mov al,character + and al,127 + mov ah,0 + mov cx,64 + mul cx + mov cx,ax + mov al,talkpos + mov ah,0 + add ax,cx + add ax,ax + mov si,ax + + mov es,people + add si,persontxtdat + mov cx,persontext + + mov ax,[es:si] + add ax,cx + mov si,ax + cmp byte ptr [es:si],0 + jz endwatchtalk + cmp byte ptr [es:si],":" + jz skiptalk + cmp byte ptr [es:si],32 + jz skiptalk + + push es si + call createpanel + call showpanel + call showman + call showexit + call convicons + pop si es + + mov di,48 + mov bx,128 + mov dl,144 + mov al,0 + mov ah,0 + call printdirect + + mov pointermode,3 + call worktoscreenm + mov cx,180 + call hangonpq jnc skiptalk ret - -skiptalk: inc talkpos - jmp watchtalk - -endwatchtalk: mov pointermode,0 - ret - - endif - - endp - - - - - - - -Hangonpq proc near - - mov getback,0 - mov bx,0 -hangloopq: push cx bx - call delpointer - call readmouse - call animpointer - call showpointer - call vsync - call dumppointer - call dumptextline - mov bx,offset cs:quitlist - call checkcoords - pop bx cx - cmp getback,1 - jz quitconv - cmp speechloaded,1 - jnz notspeaking - cmp ch1playing,255 - jnz notspeaking - inc bx - cmp bx,40 ;pause after speech ends - jz finishconv -notspeaking: cmp mousebutton,0 - jz hangloopq - cmp oldbutton,0 - jnz hangloopq -finishconv: call delpointer - mov pointermode,0 + +skiptalk: inc talkpos + jmp watchtalk + +endwatchtalk: mov pointermode,0 + ret + + endif + + endp + + + + + + + +Hangonpq proc near + + mov getback,0 + mov bx,0 +hangloopq: push cx bx + call delpointer + call readmouse + call animpointer + call showpointer + call vsync + call dumppointer + call dumptextline + mov bx,offset cs:quitlist + call checkcoords + pop bx cx + cmp getback,1 + jz quitconv + cmp speechloaded,1 + jnz notspeaking + cmp ch1playing,255 + jnz notspeaking + inc bx + cmp bx,40 ;pause after speech ends + jz finishconv +notspeaking: cmp mousebutton,0 + jz hangloopq + cmp oldbutton,0 + jnz hangloopq +finishconv: call delpointer + mov pointermode,0 clc - ret - -quitconv: call delpointer - mov pointermode,0 - call cancelch1 + ret + +quitconv: call delpointer + mov pointermode,0 + call cancelch1 stc - ret - -quitlist: dw 273,320,157,198,getback1 - dw 0,320,0,200,blank - dw 0ffffh - - endp - - - - - - - - - -Redes proc near - - cmp ch1playing,255 - jnz cantredes - cmp talkmode,2 - jz canredes -cantredes: call blank - ret - -canredes: cmp commandtype,217 - jz alreadyreds - mov commandtype,217 - mov al,50 - call commandonly -alreadyreds: mov ax,mousebutton - and ax,1 - jnz doredes - ret - -doredes: call delpointer - call createpanel - call showpanel - call showman - call showexit - call convicons - call starttalk - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - - - - - - - - - - - - + ret + +quitlist: dw 273,320,157,198,getback1 + dw 0,320,0,200,blank + dw 0ffffh + + endp + + + + + + + + + +Redes proc near + + cmp ch1playing,255 + jnz cantredes + cmp talkmode,2 + jz canredes +cantredes: call blank + ret + +canredes: cmp commandtype,217 + jz alreadyreds + mov commandtype,217 + mov al,50 + call commandonly +alreadyreds: mov ax,mousebutton + and ax,1 + jnz doredes + ret + +doredes: call delpointer + call createpanel + call showpanel + call showman + call showexit + call convicons + call starttalk + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm index b4ca4d1c49..a47f31a327 100644 --- a/devtools/tasmrecover/dreamweb/titles.asm +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -1,583 +1,583 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text - -Titles proc near - - if demo - ret - else - call clearpalette - call biblequote - call intro - ret - endif - - endp - - - - -Endgame proc near - - mov dx,offset cs:endtextname - call loadtemptext - call monkspeaking - call gettingshot - call getridoftemptext - mov volumeto,7 - mov volumedirection,1 - mov cx,200 - call hangon - ret - - endp - - - if cd - -Monkspeaking proc near - - mov roomssample,35 - call loadroomssample - mov dx,offset cs:monkface - call loadintotemp - call clearwork ;createpanel2 - call showmonk - call worktoscreen - mov volume,7 - mov volumedirection,-1 - mov volumeto,5 - mov al,12 - mov ah,255 - call playchannel0 - call fadescreenups - mov cx,300 - call hangon - - mov al,40 -loadspeech2: push ax - mov dl,"T" - mov dh,83 - mov cl,"T" - mov ah,0 - call loadspeech - mov al,50+12 - call playchannel1 + +Titles proc near + + if demo + ret + else + call clearpalette + call biblequote + call intro + ret + endif + + endp + + + + +Endgame proc near + + mov dx,offset cs:endtextname + call loadtemptext + call monkspeaking + call gettingshot + call getridoftemptext + mov volumeto,7 + mov volumedirection,1 + mov cx,200 + call hangon + ret + + endp + + + if cd + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,5 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +loadspeech2: push ax + mov dl,"T" + mov dh,83 + mov cl,"T" + mov ah,0 + call loadspeech + mov al,50+12 + call playchannel1 notloadspeech2: call vsync - cmp ch1playing,255 - jnz notloadspeech2 - pop ax - inc al - cmp al,48 - jnz loadspeech2 - - mov volumedirection,1 - mov volumeto,7 - call fadescreendowns - mov cx,300 - call hangon - call getridoftemp - ret - - endp - - else - -Monkspeaking proc near - - mov roomssample,35 - call loadroomssample - mov dx,offset cs:monkface - call loadintotemp - call clearwork ;createpanel2 - call showmonk - call worktoscreen - mov volume,7 - mov volumedirection,-1 - mov volumeto,0 - mov al,12 - mov ah,255 - call playchannel0 - call fadescreenups - mov cx,300 - call hangon - - mov al,40 -nextmonkspeak: push ax - mov ah,0 - mov si,ax - add si,si - mov es,textfile1 - mov ax,[es:si] - add ax,textstart - mov si,ax -nextbit: mov di,36 - mov bx,140 - mov dl,239 - call printdirect - push ax si es - call worktoscreen - call clearwork - call showmonk - mov cx,240 - call hangon - pop es si ax - cmp al,0 - jnz nextbit - pop ax - inc al - cmp al,44 - jnz nextmonkspeak - - mov volumedirection,1 - mov volumeto,7 - call fadescreendowns - mov cx,300 - call hangon - call getridoftemp - ret - - endp - - endif - - - - -Showmonk proc near - - mov al,0 - mov ah,128 - mov di,160 - mov bx,72 - mov ds,tempgraphics - call showframe - ret - - endp - - -Gettingshot proc near - - mov newlocation,55 - call clearpalette - call loadintroroom - call fadescreenups - mov volumeto,0 - mov volumedirection,-1 - call runendseq - call clearbeforeload - ret - - endp - - - - - - -Credits proc near - - call clearpalette - call realcredits - ret - - endp - - - -Biblequote proc near - - call mode640x480 - mov dx,offset cs:title0graphics - call showpcx - call fadescreenups - mov cx,80 - call hangone - cmp lasthardkey,1 - jz biblequotearly - mov cx,560 - call hangone - cmp lasthardkey,1 - jz biblequotearly - call fadescreendowns - mov cx,200 ;128 - call hangone - cmp lasthardkey,1 - jz biblequotearly - call cancelch0 -biblequotearly: + cmp ch1playing,255 + jnz notloadspeech2 + pop ax + inc al + cmp al,48 + jnz loadspeech2 + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + else + +Monkspeaking proc near + + mov roomssample,35 + call loadroomssample + mov dx,offset cs:monkface + call loadintotemp + call clearwork ;createpanel2 + call showmonk + call worktoscreen + mov volume,7 + mov volumedirection,-1 + mov volumeto,0 + mov al,12 + mov ah,255 + call playchannel0 + call fadescreenups + mov cx,300 + call hangon + + mov al,40 +nextmonkspeak: push ax + mov ah,0 + mov si,ax + add si,si + mov es,textfile1 + mov ax,[es:si] + add ax,textstart + mov si,ax +nextbit: mov di,36 + mov bx,140 + mov dl,239 + call printdirect + push ax si es + call worktoscreen + call clearwork + call showmonk + mov cx,240 + call hangon + pop es si ax + cmp al,0 + jnz nextbit + pop ax + inc al + cmp al,44 + jnz nextmonkspeak + + mov volumedirection,1 + mov volumeto,7 + call fadescreendowns + mov cx,300 + call hangon + call getridoftemp + ret + + endp + + endif + + + + +Showmonk proc near + + mov al,0 + mov ah,128 + mov di,160 + mov bx,72 + mov ds,tempgraphics + call showframe + ret + + endp + + +Gettingshot proc near + + mov newlocation,55 + call clearpalette + call loadintroroom + call fadescreenups + mov volumeto,0 + mov volumedirection,-1 + call runendseq + call clearbeforeload + ret + + endp + + + + + + +Credits proc near + + call clearpalette + call realcredits + ret + + endp + + + +Biblequote proc near + + call mode640x480 + mov dx,offset cs:title0graphics + call showpcx + call fadescreenups + mov cx,80 + call hangone + cmp lasthardkey,1 + jz biblequotearly + mov cx,560 + call hangone + cmp lasthardkey,1 + jz biblequotearly + call fadescreendowns + mov cx,200 ;128 + call hangone + cmp lasthardkey,1 + jz biblequotearly + call cancelch0 +biblequotearly: mov lasthardkey,0 - ret - - endp - - - - -Hangone proc near - -hangonloope: push cx - call vsync - pop cx - cmp lasthardkey,1 - jz hangonearly - loop hangonloope -hangonearly: - ret - - endp - - - - - - -Intro proc near - - mov dx,offset cs:introtextname - call loadtemptext - - call loadpalfromiff - call setmode - - mov newlocation,50 - call clearpalette - call loadintroroom - mov volume,7 - mov volumedirection,-1 - if cd - mov volumeto,4 - else - mov volumeto,0 - endif - mov al,12 ;4 - mov ah,255 - call playchannel0 - call fadescreenups - call runintroseq - cmp lasthardkey,1 - jz introearly - -;waitsound: cmp ch1blockstoplay,0 -; jnz waitsound - call clearbeforeload - - mov newlocation,52 - call loadintroroom - call runintroseq - cmp lasthardkey,1 - jz introearly - call clearbeforeload - - mov newlocation,53 - call loadintroroom - call runintroseq - cmp lasthardkey,1 - jz introearly - call clearbeforeload - - call allpalette - mov newlocation,54 - call loadintroroom - ;mov al,12 - ;mov ah,255 - ;call playchannel0 - call runintroseq - cmp lasthardkey,1 - jz introearly - - call getridoftemptext - call clearbeforeload -introearly: + ret + + endp + + + + +Hangone proc near + +hangonloope: push cx + call vsync + pop cx + cmp lasthardkey,1 + jz hangonearly + loop hangonloope +hangonearly: + ret + + endp + + + + + + +Intro proc near + + mov dx,offset cs:introtextname + call loadtemptext + + call loadpalfromiff + call setmode + + mov newlocation,50 + call clearpalette + call loadintroroom + mov volume,7 + mov volumedirection,-1 + if cd + mov volumeto,4 + else + mov volumeto,0 + endif + mov al,12 ;4 + mov ah,255 + call playchannel0 + call fadescreenups + call runintroseq + cmp lasthardkey,1 + jz introearly + +;waitsound: cmp ch1blockstoplay,0 +; jnz waitsound + call clearbeforeload + + mov newlocation,52 + call loadintroroom + call runintroseq + cmp lasthardkey,1 + jz introearly + call clearbeforeload + + mov newlocation,53 + call loadintroroom + call runintroseq + cmp lasthardkey,1 + jz introearly + call clearbeforeload + + call allpalette + mov newlocation,54 + call loadintroroom + ;mov al,12 + ;mov ah,255 + ;call playchannel0 + call runintroseq + cmp lasthardkey,1 + jz introearly + + call getridoftemptext + call clearbeforeload +introearly: mov lasthardkey, 0 - ret - - endp - - - - - - - - -Runintroseq proc near - - mov getback,0 - -moreintroseq: call vsync - cmp lasthardkey,1 - jz earlyendrun - call spriteupdate - call vsync - cmp lasthardkey,1 - jz earlyendrun - call deleverything - call printsprites - call reelsonscreen - call afterintroroom - call usetimedtext - call vsync - cmp lasthardkey,1 - jz earlyendrun - call dumpmap - call dumptimedtext - call vsync - cmp lasthardkey,1 - jz earlyendrun - cmp getback,1 - jnz moreintroseq - ret -earlyendrun: - call getridoftemptext - call clearbeforeload - ret - - endp - - - - - -Runendseq proc near - - call atmospheres - mov getback,0 -moreendseq: call vsync - call spriteupdate - call vsync - call deleverything - call printsprites - call reelsonscreen - call afterintroroom - call usetimedtext - call vsync - call dumpmap - call dumptimedtext - call vsync - cmp getback,1 - jnz moreendseq - ret - - endp - - - - -Loadintroroom proc near - - mov introcount,0 - mov location,255 - call loadroom - mov mapoffsetx,72 - mov mapoffsety,16 - call clearsprites - mov throughdoor,0 - mov currentkey,"0" - mov mainmode,0 - call clearwork - mov newobs,1 - call drawfloor - call reelsonscreen - call spriteupdate - call printsprites - call worktoscreen - ret - - endp - - - - - - -Mode640x480 proc near - - mov al,12h+128 - mov ah,0 - int 10h - ;call clearpalette - ret - - endp - - - -Set16colpalette proc near - - mov cx,16 - mov bl,0 - mov bh,0 - mov al,0 - mov ah,10h -set16palloop2: push ax bx cx - int 10h - pop cx bx ax - inc bl - inc bh - loop set16palloop2 - - mov bl,31h - mov al,1 - mov ah,12h - int 10h - ret - - endp - - - - - -RealCredits proc near - - mov roomssample,33 - call loadroomssample - mov volume,0 - - call mode640x480 - mov cx,35 - call hangon - - mov dx,offset cs:title1graphics - call showpcx - mov al,12 - mov ah,0 - call playchannel0 - mov cx,2 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call allpalette - mov cx,80 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - - mov dx,offset cs:title2graphics - call showpcx - mov al,12 - mov ah,0 - call playchannel0 - mov cx,2 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call allpalette - mov cx,80 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - - if demo - else - mov dx,offset cs:title3graphics - call showpcx - mov al,12 - mov ah,0 - call playchannel0 - mov cx,2 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call allpalette - mov cx,80 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - - mov dx,offset cs:title4graphics - call showpcx - mov al,12 - mov ah,0 - call playchannel0 - mov cx,2 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call allpalette - mov cx,80 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - - mov dx,offset cs:title5graphics - call showpcx - mov al,12 - mov ah,0 - call playchannel0 - mov cx,2 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call allpalette - mov cx,80 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - endif - - mov dx,offset cs:title6graphics - call showpcx - call fadescreenups - mov cx,60 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - mov al,13 - mov ah,0 - call playchannel0 - mov cx,350 - call hangone - cmp lasthardkey,1 - jz realcreditsearly - call fadescreendowns - mov cx,256 - call hangone -realcreditsearly: + ret + + endp + + + + + + + + +Runintroseq proc near + + mov getback,0 + +moreintroseq: call vsync + cmp lasthardkey,1 + jz earlyendrun + call spriteupdate + call vsync + cmp lasthardkey,1 + jz earlyendrun + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + call dumpmap + call dumptimedtext + call vsync + cmp lasthardkey,1 + jz earlyendrun + cmp getback,1 + jnz moreintroseq + ret +earlyendrun: + call getridoftemptext + call clearbeforeload + ret + + endp + + + + + +Runendseq proc near + + call atmospheres + mov getback,0 +moreendseq: call vsync + call spriteupdate + call vsync + call deleverything + call printsprites + call reelsonscreen + call afterintroroom + call usetimedtext + call vsync + call dumpmap + call dumptimedtext + call vsync + cmp getback,1 + jnz moreendseq + ret + + endp + + + + +Loadintroroom proc near + + mov introcount,0 + mov location,255 + call loadroom + mov mapoffsetx,72 + mov mapoffsety,16 + call clearsprites + mov throughdoor,0 + mov currentkey,"0" + mov mainmode,0 + call clearwork + mov newobs,1 + call drawfloor + call reelsonscreen + call spriteupdate + call printsprites + call worktoscreen + ret + + endp + + + + + + +Mode640x480 proc near + + mov al,12h+128 + mov ah,0 + int 10h + ;call clearpalette + ret + + endp + + + +Set16colpalette proc near + + mov cx,16 + mov bl,0 + mov bh,0 + mov al,0 + mov ah,10h +set16palloop2: push ax bx cx + int 10h + pop cx bx ax + inc bl + inc bh + loop set16palloop2 + + mov bl,31h + mov al,1 + mov ah,12h + int 10h + ret + + endp + + + + + +RealCredits proc near + + mov roomssample,33 + call loadroomssample + mov volume,0 + + call mode640x480 + mov cx,35 + call hangon + + mov dx,offset cs:title1graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title2graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + if demo + else + mov dx,offset cs:title3graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title4graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + + mov dx,offset cs:title5graphics + call showpcx + mov al,12 + mov ah,0 + call playchannel0 + mov cx,2 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call allpalette + mov cx,80 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + endif + + mov dx,offset cs:title6graphics + call showpcx + call fadescreenups + mov cx,60 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + mov al,13 + mov ah,0 + call playchannel0 + mov cx,350 + call hangone + cmp lasthardkey,1 + jz realcreditsearly + call fadescreendowns + mov cx,256 + call hangone +realcreditsearly: mov lasthardkey, 0 - ret - - endp - - - - - - - - - - - - - + ret + + endp + + + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm index 4b82f946f0..250aa00240 100644 --- a/devtools/tasmrecover/dreamweb/use.asm +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -1,3810 +1,3810 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text - -Useobject proc near - - mov withobject,255 - - cmp commandtype,229 - jz alreadyuse - mov commandtype,229 - - mov bl,command - mov bh,objecttype - mov al,51 - call commandwithob -alreadyuse: mov ax,mousebutton - cmp ax,oldbutton - jz nouse - and ax,1 - jnz douse -nouse: ret - -douse: call useroutine - ret - - endp - - - - - - - -Useroutine proc near - - cmp reallocation,50 - jc nodream7 - cmp pointerpower,0 - jnz powerok - ret -powerok: mov pointerpower,0 - -nodream7: call getanyad - mov dx,seg uselist - mov ds,dx - mov si,offset uselist -checkuselist: push si - lodsb - sub al,"A" - cmp al,[es:bx+12] - jnz failed - lodsb - sub al,"A" - cmp al,[es:bx+13] - jnz failed - lodsb - sub al,"A" - cmp al,[es:bx+14] - jnz failed - lodsb - sub al,"A" - cmp al,[es:bx+15] - jnz failed - lodsw - pop si - call ax - ret -failed: pop si - add si,6 - cmp byte ptr [si],140 - jnz checkuselist - - call delpointer - call getobtextstart - call findnextcolon - cmp al,0 - jz cantuse2 - call findnextcolon - cmp al,0 - jz cantuse2 - mov al,[es:si] - cmp al,0 - jz cantuse2 - call usetext - mov cx,400 - call hangonp - call putbackobstuff - ret -cantuse2: call createpanel - call showpanel - call showman - call showexit - call obicons - mov di,33 - mov bx,100 - mov al,63 - mov dl,241 - call printmessage - call worktoscreenm - mov cx,50 - call hangonp - call putbackobstuff - mov commandtype,255 - ret - -Uselist: db "NETW" - dw usemon - db "ELVA" - dw useelevator1 - db "ELVB" - dw useelevator2 - db "ELVC" - dw useelevator3 - db "ELVE" - dw useelevator4 - db "ELVF" - dw useelevator5 - db "CGAT" - dw usechurchgate - db "REMO" - dw usestereo - db "BUTA" - dw usebuttona - db "CBOX" - dw usewinch - db "LITE" - dw uselighter - db "PLAT" - dw useplate - db "LIFT" - dw usecontrol - db "WIRE" - dw usewire - db "HNDL" - dw usehandle - db "HACH" - dw usehatch - db "DOOR" - dw useelvdoor - db "CSHR" - dw usecashcard - db "GUNA" - dw usegun - db "CRAA" - dw usecardreader1 - db "CRBB" - dw usecardreader2 - db "CRCC" - dw usecardreader3 - db "SEAT" - dw sitdowninbar - db "MENU" - dw usemenu - db "COOK" - dw usecooker - db "ELCA" - dw callhotellift - db "EDCA" - dw calledenslift - db "DDCA" - dw calledensdlift - db "ALTR" - dw usealtar - db "LOKA" - dw openhoteldoor - db "LOKB" - dw openhoteldoor2 - db "ENTA" - dw openlouis - db "ENTB" - dw openryan - db "ENTE" - dw openpoolboss - db "ENTC" - dw openyourneighbour - db "ENTD" - dw openeden - db "ENTH" - dw opensarters - db "WWAT" - dw wearwatch - db "POOL" - dw usepoolreader - db "WSHD" - dw wearshades - db "GRAF" - dw grafittidoor - db "TRAP" - dw trapdoor - db "CDPE" - dw edenscdplayer - - db "DLOK" - dw opentvdoor - - db "HOLE" - dw usehole - - db "DRYR" - dw usedryer - - db "HOLY" - dw usechurchhole - - db "WALL" - dw usewall - db "BOOK" - dw usediary - - db "AXED" - dw useaxe - db "SHLD" - dw useshield - - db "BCNY" - dw userailing - db "LIDC" - dw usecoveredbox - db "LIDU" - dw useclearbox - db "LIDO" - dw useopenbox - db "PIPE" - dw usepipe - - db "BALC" - dw usebalcony - db "WIND" - dw usewindow - db "PAPR" - dw viewfolder - - db "UWTA" - dw usetrainer - db "UWTB" - dw usetrainer - - db "STAT" - dw entersymbol - db "TLID" - dw opentomb - db "SLAB" - dw useslab - db "CART" - dw usecart - db "FCAR" - dw usefullcart - - - db "SLBA" - dw slabdoora - db "SLBB" - dw slabdoorb - db "SLBC" - dw slabdoorc - db "SLBD" - dw slabdoord - db "SLBE" - dw slabdoore - db "SLBF" - dw slabdoorf - db "PLIN" - dw useplinth - - db "LADD" - dw useladder - db "LADB" - dw useladderb - - db "GUMA" - dw chewy - - db "SQEE" - dw wheelsound - db "TAPP" - dw runtap - db "GUIT" - dw playguitar - db "CONT" - dw hotelcontrol - - db "BELL" - dw hotelbell - - db 140,140,140,140 - - endp - - - - - - -;-----------------------------------------------------------Puzzle routines---- - - -Wheelsound proc near - - mov al,17 - call playchannel1 - call showfirstuse - call putbackobstuff - ret - - endp - - - - -Runtap proc near - - cmp withobject,255 - jnz tapwith - call withwhat - ret -tapwith: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"E" - call compare - jz fillcupfromtap - mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"F" - call compare - jz cupfromtapfull - mov cx,300 - mov al,56 - call showpuztext - call putbackobstuff - ret - -fillcupfromtap: mov al,withobject - call getexad - mov byte ptr [es:bx+15],"F"-"A" - mov al,8 - call playchannel1 - mov cx,300 - mov al,57 - call showpuztext - call putbackobstuff - ret - -cupfromtapfull: mov cx,300 - mov al,58 - call showpuztext - call putbackobstuff - ret - - - endp - - - -Playguitar proc near - - mov al,14 - call playchannel1 - call showfirstuse - call putbackobstuff - ret - - endp - - - -Hotelcontrol proc near - - cmp reallocation,21 - jnz notrightcont - cmp mapx,33 - jnz notrightcont - call showfirstuse - call putbackobstuff - ret -notrightcont: call showseconduse - call putbackobstuff - ret - - endp - - - - -Hotelbell proc near - - if demo - mov al,24 - else - mov al,12 - endif - call playchannel1 - call showfirstuse - call putbackobstuff - ret - - endp - - - - - -Opentomb proc near - - inc progresspoints - call showfirstuse - mov watchingtime,35*2 - mov reeltowatch,1 - mov endwatchreel,33 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - -Usetrainer proc near - - call getanyad - cmp byte ptr [es:bx+2],4 - jnz notheldtrainer - inc progresspoints - call makeworn - call showseconduse - call putbackobstuff - ret -notheldtrainer: call nothelderror - ret - - endp - - - -Nothelderror proc near - - call createpanel - call showpanel - call showman - call showexit - call obicons - mov di,64 - mov bx,100 - mov al,63 - mov ah,1 - mov dl,201 - call printmessage2 - call worktoscreenm - mov cx,50 - call hangonp - call putbackobstuff - ret - - endp - - - -Usepipe proc near - - cmp withobject,255 - jnz pipewith - call withwhat - ret -pipewith: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"E" - call compare - jz fillcup - mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"F" - call compare - jz alreadyfull - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -fillcup: mov cx,300 - mov al,36 - call showpuztext - call putbackobstuff - mov al,withobject - call getexad - mov byte ptr [es:bx+15],"F"-"A" - ret - -alreadyfull: mov cx,300 - mov al,35 - call showpuztext - call putbackobstuff - ret - - endp - - - - - - -Usefullcart proc near - - inc progresspoints - mov al,2 - mov ah,roomnum - add ah,6 - call turnanypathon - mov manspath,4 - mov facing,4 - mov turntoface,4 - mov finaldest,4 - call findxyfrompath - mov resetmanxy,1 - call showfirstuse - mov watchingtime,72*2 - mov reeltowatch,58 - mov endwatchreel,142 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - - - - - -Useplinth proc near - - cmp withobject,255 - jnz plinthwith - call withwhat - ret - -plinthwith: mov al,withobject - mov ah,withtype - mov cl,"D" - mov ch,"K" - mov dl,"E" - mov dh,"Y" - call compare - jz isrightkey - call showfirstuse - call putbackobstuff - ret - -isrightkey: inc progresspoints - call showseconduse - mov watchingtime,220 - mov reeltowatch,0 - mov endwatchreel,104 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - mov al,roomafterdream - mov newlocation,al - ret - - endp - - - -Chewy proc near - - call showfirstuse - call getanyad - mov byte ptr [es:bx+2],255 - mov getback,1 - ret - - endp - - - - - -Useladder proc near - - call showfirstuse - sub mapx,11 - call findroominloc - mov facing,6 - mov turntoface,6 - mov manspath,0 - mov destination,0 - mov finaldest,0 - call findxyfrompath - mov resetmanxy,1 - mov getback,1 - ret - - endp - - - - - -Useladderb proc near - - call showfirstuse - add mapx,11 - call findroominloc - mov facing,2 - mov turntoface,2 - mov manspath,1 - mov destination,1 - mov finaldest,1 - call findxyfrompath - mov resetmanxy,1 - mov getback,1 - ret - - endp - - - - - -Slabdoora proc near - - call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,13 - cmp dreamnumber,3 - jnz slabawrong - inc progresspoints - mov watchingtime,60 - mov endwatchreel,42 - mov newlocation,47 - ret -slabawrong: mov watchingtime,40 - mov endwatchreel,34 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - - -Slabdoorb proc near - - cmp dreamnumber,1 - jnz slabbwrong - mov al,"S" - mov ah,"H" - mov cl,"L" - mov ch,"D" - call isryanholding - jnz gotcrystal - mov al,44 - mov cx,200 - call showpuztext - call putbackobstuff - ret -gotcrystal: call showfirstuse - inc progresspoints - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,44 - mov watchingtime,60 - mov endwatchreel,71 - mov newlocation,47 - ret -slabbwrong: call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,44 - mov watchingtime,40 - mov endwatchreel,63 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - -Slabdoord proc near - - call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,75 - cmp dreamnumber,0 - jnz slabcwrong - inc progresspoints - mov watchingtime,60 - mov endwatchreel,102 - mov newlocation,47 - ret -slabcwrong: mov watchingtime,40 - mov endwatchreel,94 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - -Slabdoorc proc near - - call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,108 - cmp dreamnumber,4 - jnz slabdwrong - inc progresspoints - mov watchingtime,60 - mov endwatchreel,135 - mov newlocation,47 - ret -slabdwrong: mov watchingtime,40 - mov endwatchreel,127 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - -Slabdoore proc near - - call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,141 - cmp dreamnumber,5 - jnz slabewrong - inc progresspoints - mov watchingtime,60 - mov endwatchreel,168 - mov newlocation,47 - ret -slabewrong: mov watchingtime,40 - mov endwatchreel,160 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - -Slabdoorf proc near - - call showfirstuse - mov getback,1 - mov watchspeed,1 - mov speedcount,1 - mov reeltowatch,171 - cmp dreamnumber,2 - jnz slabfwrong - inc progresspoints - mov watchingtime,60 - mov endwatchreel,197 - mov newlocation,47 - ret -slabfwrong: mov watchingtime,40 - mov endwatchreel,189 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - - - - -Useslab proc near - - cmp withobject,255 - jnz slabwith - call withwhat - ret -slabwith: mov al,withobject - mov ah,withtype - mov cl,"J" - mov ch,"E" - mov dl,"W" - mov dh,"L" - call compare - jz nextslab - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret -nextslab: mov al,withobject - call getexad - mov byte ptr [es:bx+2],0 - mov al,command - push ax - call removesetobject - pop ax - inc al - push ax - call placesetobject - pop ax - cmp al,54 - jnz notlastslab - mov al,0 - call turnpathon - mov watchingtime,22 - mov reeltowatch,35 - mov endwatchreel,48 - mov watchspeed,1 - mov speedcount,1 -notlastslab: inc progresspoints - call showfirstuse - mov getback,1 - ret - - endp - - - - - -Usecart proc near - - cmp withobject,255 - jnz cartwith - call withwhat - ret -cartwith: mov al,withobject - mov ah,withtype - mov cl,"R" - mov ch,"O" - mov dl,"C" - mov dh,"K" - call compare - jz nextcart - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret -nextcart: mov al,withobject - call getexad - mov byte ptr [es:bx+2],0 - mov al,command - push ax - call removesetobject - pop ax - inc al - call placesetobject - inc progresspoints - mov al,17 - call playchannel1 - call showfirstuse - mov getback,1 - ret - - endp - - - - - - - - -Useclearbox proc near - - cmp withobject,255 - jnz clearboxwith - call withwhat - ret -clearboxwith: mov al,withobject - mov ah,withtype - mov cl,"R" - mov ch,"A" - mov dl,"I" - mov dh,"L" - call compare - jz openbox - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -openbox: inc progresspoints - call showfirstuse - mov watchingtime,80 - mov reeltowatch,67 - mov endwatchreel,105 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - - - -Usecoveredbox proc near - - inc progresspoints - call showfirstuse - mov watchingtime,50 - mov reeltowatch,41 - mov endwatchreel,66 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - -Userailing proc near - - call showfirstuse - mov watchingtime,80 - mov reeltowatch,0 - mov endwatchreel,30 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - mov mandead,4 - ret - - endp - - - - - -Useopenbox proc near - - cmp withobject,255 - jnz openboxwith - call withwhat - ret -openboxwith: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"F" - call compare - jz destoryopenbox - mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"P" - mov dh,"E" - call compare - jz openboxwrong - call showfirstuse - ret - -destoryopenbox: inc progresspoints - mov cx,300 - mov al,37 - call showpuztext - mov al,withobject - call getexad - mov byte ptr [es:bx+15],"E"-"A" - mov watchingtime,140 - mov reeltowatch,105 - mov endwatchreel,181 - mov watchspeed,1 - mov speedcount,1 - mov al,4 - call turnpathon - mov getback,1 - ret - -openboxwrong: mov cx,300 - mov al,38 - call showpuztext - call putbackobstuff - ret - - endp - - - - - - - - - - - - - - -Wearwatch proc near - - cmp watchon,1 - jz wearingwatch - call showfirstuse - mov watchon,1 - mov getback,1 - call getanyad - call makeworn - ret -wearingwatch: call showseconduse - call putbackobstuff - ret - - endp - - - - -Wearshades proc near - - cmp shadeson,1 - jz wearingshades - mov shadeson,1 - call showfirstuse - mov getback,1 - call getanyad - call makeworn - ret -wearingshades: call showseconduse - call putbackobstuff - ret - - endp - - - -Sitdowninbar proc near - - cmp watchmode,-1 - jnz satdown - call showfirstuse - mov watchingtime,50 - mov reeltowatch,55 - mov endwatchreel,71 - mov reeltohold,73 - mov endofholdreel,83 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret -satdown: call showseconduse - call putbackobstuff - ret - - endp - - - -Usechurchhole proc near - - call showfirstuse - mov getback,1 - mov watchingtime,28 - mov reeltowatch,13 - mov endwatchreel,26 - mov watchspeed,1 - mov speedcount,1 - ret - - endp - - - -Usehole proc near - - cmp withobject,255 - jnz holewith - call withwhat - ret -holewith: mov al,withobject - mov ah,withtype - mov cl,"H" - mov ch,"N" - mov dl,"D" - mov dh,"A" - call compare - jz righthand - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -righthand: call showfirstuse - mov al,86 - call removesetobject - mov al,withobject - call getexad - mov byte ptr [es:bx+2],255 - mov canmovealtar,1 - mov getback,1 - ret - - endp - - - - -Usealtar proc near - - mov al,"C" - mov ah,"N" - mov cl,"D" - mov ch,"A" - call findexobject - cmp al,numexobjects - jz thingsonaltar - mov al,"C" - mov ah,"N" - mov cl,"D" - mov ch,"B" - call findexobject - cmp al,numexobjects - jz thingsonaltar - cmp canmovealtar,1 - jz movealtar - mov cx,300 - mov al,23 - call showpuztext - mov getback,1 - ret - -movealtar: inc progresspoints - call showseconduse - mov watchingtime,160 - mov reeltowatch,81 - mov endwatchreel,174 - mov watchspeed,1 - mov speedcount,1 - - mov al,47 ;message number - mov bl,52 ;x pos of message - mov bh,76 ;and y pos - mov cx,32 ;time on screen - mov dx,98 ;pause before show - call setuptimeduse - mov getback,1 - ret - -thingsonaltar: call showfirstuse - mov getback,1 - ret - - endp - - - - - - - - - -Opentvdoor proc near - - cmp withobject,255 - jnz tvdoorwith - call withwhat - ret -tvdoorwith: mov al,withobject - mov ah,withtype - mov cl,"U" - mov ch,"L" - mov dl,"O" - mov dh,"K" - call compare - jz keyontv - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -keyontv: call showfirstuse - mov lockstatus,0 - mov getback,1 - ret - - endp - - - - - - - -Usedryer proc near - - mov al,12 - call playchannel1 - call showfirstuse - mov getback,1 - ret - - endp - - - - - -Openlouis proc near - - mov al,5 - mov ah,2 - mov cl,3 - mov ch,8 - call entercode - mov getback,1 - ret - - endp - - - - -Nextcolon proc near - -lookcolon: mov al,[es:si] - inc si - cmp al,":" - jnz lookcolon - ret - - endp - - - - -Openyourneighbour proc near - - mov al,255 - mov ah,255 - mov cl,255 - mov ch,255 - call entercode - mov getback,1 - ret - - endp - - - -Usewindow proc near - - cmp manspath,6 - jnz notonbalc - inc progresspoints - call showfirstuse - mov newlocation,29 - mov getback,1 - ret -notonbalc: call showseconduse - call putbackobstuff - ret - - endp - - - -Usebalcony proc near - - call showfirstuse - mov al,6 - call turnpathon - mov al,0 - call turnpathoff - mov al,1 - call turnpathoff - mov al,2 - call turnpathoff - mov al,3 - call turnpathoff - mov al,4 - call turnpathoff - mov al,5 - call turnpathoff - inc progresspoints - mov manspath,6 - mov destination,6 - mov finaldest,6 - call findxyfrompath - call switchryanoff - mov resetmanxy,1 - - mov watchingtime,30*2 - mov reeltowatch,183 - mov endwatchreel,212 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - -Openryan proc near - - mov al,5 - mov ah,1 - mov cl,0 - mov ch,6 - call entercode - mov getback,1 - ret - - endp - - - -Openpoolboss proc near - - mov al,5 - mov ah,2 - mov cl,2 - mov ch,2 - call entercode - mov getback,1 - ret - - endp - - - - -Openeden proc near - - mov al,2 - mov ah,8 - mov cl,6 - mov ch,5 - call entercode - mov getback,1 - ret - - endp - - -Opensarters proc near - - mov al,7 - mov ah,8 - mov cl,3 - mov ch,3 - call entercode - mov getback,1 - ret - - endp - - - - -Isitright proc near - - mov bx,seg presslist - mov es,bx - mov bx,offset es:presslist - cmp [es:bx+0],al - jnz notright - cmp [es:bx+1],ah - jnz notright - cmp [es:bx+2],cl - jnz notright - cmp [es:bx+3],ch -notright: ret - - endp - - - - -Drawitall proc near - - call createpanel - call drawfloor - ;call dumpallmap - call printsprites - call showicon - ret - - endp - - - - -Openhoteldoor proc near - - cmp withobject,255 - jnz hoteldoorwith - call withwhat - ret -hoteldoorwith: mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"E" - mov dl,"Y" - mov dh,"A" - call compare - jz keyonhotel1 - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -keyonhotel1: if demo - mov al,27 - else - mov al,16 - endif - call playchannel1 - call showfirstuse - ;mov destination,1 - ;mov finaldest,1 - ;call autosetwalk - mov lockstatus,0 - mov getback,1 - ret - - endp - - - -Openhoteldoor2 proc near - - cmp withobject,255 - jnz hoteldoorwith2 - call withwhat - ret -hoteldoorwith2: mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"E" - mov dl,"Y" - mov dh,"A" - call compare - jz keyonhotel2 - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -keyonhotel2: if demo - mov al,27 - else - mov al,16 - endif - call playchannel1 - call showfirstuse - call putbackobstuff - ret - - endp - - - - - - -Grafittidoor proc near - - cmp withobject,255 - jnz grafwith - call withwhat - ret -grafwith: mov al,withobject - mov ah,withtype - mov cl,"A" - mov ch,"P" - mov dl,"E" - mov dh,"N" - call compare - jz dograf - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -dograf: call showfirstuse - call putbackobstuff - ret - - endp - - - - - -Trapdoor proc near - - inc progresspoints - call showfirstuse - call switchryanoff - mov watchingtime,20*2 - mov reeltowatch,181 - mov endwatchreel,197 - mov newlocation,26 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - - -Callhotellift proc near - - if demo - mov al,24 - else - mov al,12 - endif - call playchannel1 - call showfirstuse - mov counttoopen,8 - mov getback,1 - mov destination,5 - mov finaldest,5 - call autosetwalk - mov al,4 - call turnpathon - ret - - endp - - - - -Calledenslift proc near - - call showfirstuse - mov counttoopen,8 - mov getback,1 - mov al,2 - call turnpathon - ret - - endp - - - -Calledensdlift proc near - - cmp liftflag,1 - jz edensdhere - call showfirstuse - mov counttoopen,8 - mov getback,1 - mov al,2 - call turnpathon - ret -edensdhere: call showseconduse - call putbackobstuff - ret - - endp - - - - - - -Usepoolreader proc near - - cmp withobject,255 - jnz poolwith - call withwhat - ret -poolwith: mov al,withobject - mov ah,withtype - mov cl,"M" - mov ch,"E" - mov dl,"M" - mov dh,"B" - call compare - jz openpool - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -openpool: cmp talkedtoattendant,1 - jz canopenpool - call showseconduse - call putbackobstuff - ret - -canopenpool: mov al,17 - call playchannel1 - call showfirstuse - mov counttoopen,6 - mov getback,1 - ret - - endp - - - - - - - - - - - - - -Uselighter proc near - - cmp withobject,255 - jnz gotlighterwith - call withwhat - ret -gotlighterwith: mov al,withobject - mov ah,withtype - mov cl,"S" - mov ch,"M" - mov dl,"K" - mov dh,"E" - call compare - jz cigarette - call showfirstuse - call putbackobstuff - ret -cigarette: mov cx,300 - mov al,9 - call showpuztext - mov al,withobject - call getexad - mov byte ptr [es:bx+2],255 - mov getback,1 - ret - - endp - - - - - - - - - - - - - -Showseconduse proc near - - call getobtextstart - call nextcolon - call nextcolon - call nextcolon - call usetext - mov cx,400 - call hangonp - ret - - endp - - - - - - -Usecardreader1 proc near - - cmp withobject,255 - jnz gotreader1with - call withwhat - ret -gotreader1with: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"S" - mov dl,"H" - mov dh,"R" - call compare - jz correctcard - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret -correctcard: cmp talkedtosparky,0 - jz notyet - cmp card1money,0 - jz getscash - mov cx,300 - mov al,17 - call showpuztext - call putbackobstuff - ret -getscash: mov al,16 - call playchannel1 - mov cx,300 - mov al,18 - call showpuztext - inc progresspoints - mov card1money,12432 - mov getback,1 - ret -notyet: call showfirstuse - call putbackobstuff - ret - - endp - - - - -Usecardreader2 proc near - - cmp withobject,255 - jnz gotreader2with - call withwhat - ret -gotreader2with: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"S" - mov dl,"H" - mov dh,"R" - call compare - jz correctcard2 - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -correctcard2: cmp talkedtoboss,0 - jz notyetboss - cmp card1money,0 - jz nocash - cmp gunpassflag,2 - jz alreadygotnew - mov al,18 - call playchannel1 - mov cx,300 - mov al,19 - call showpuztext - mov al,94 - call placesetobject - mov gunpassflag,1 - sub card1money,2000 - inc progresspoints - mov getback,1 - ret -nocash: mov cx,300 - mov al,20 - call showpuztext - call putbackobstuff - ret -alreadygotnew: mov cx,300 - mov al,22 - call showpuztext - call putbackobstuff - ret -notyetboss: call showfirstuse - call putbackobstuff - ret - - endp - - - - - - - -Usecardreader3 proc near - - cmp withobject,255 - jnz gotreader3with - call withwhat - ret -gotreader3with: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"S" - mov dl,"H" - mov dh,"R" - call compare - jz rightcard - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -rightcard: cmp talkedtorecep,0 - jz notyetrecep - cmp cardpassflag,0 - jnz alreadyusedit - if demo - mov al,27 - else - mov al,16 - endif - call playchannel1 - mov cx,300 - mov al,25 - call showpuztext - inc progresspoints - sub card1money,8300 - mov cardpassflag,1 - mov getback,1 - ret -alreadyusedit: mov cx,300 - mov al,26 - call showpuztext - call putbackobstuff - ret -notyetrecep: call showfirstuse - call putbackobstuff - ret - - endp - - - - - - - - -Usecashcard proc near - - call getridofreels - call loadkeypad - call createpanel - call showpanel - call showexit - call showman - - mov di,114 - if foreign - mov bx,120-3 - else - mov bx,120 - endif - mov ds,tempgraphics - mov al,39 - mov ah,0 - call showframe - - mov ax,card1money - call moneypoke - - call getobtextstart - call nextcolon - call nextcolon - - mov di,36 - mov bx,98 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - - mov di,160 - mov bx,155 - push cs - pop es - mov si,offset cs:money1poke - mov charshift,91*2+75 - mov al,0 - mov ah,0 - mov dl,240 - call printdirect - mov di,187 - mov bx,155 - push cs - pop es - mov si,offset cs:money2poke - mov charshift,91*2+85 - mov al,0 - mov ah,0 - mov dl,240 - call printdirect - mov charshift,0 - call worktoscreenm - mov cx,400 - call hangonp - call getridoftemp - call restorereels - call putbackobstuff - ret - -money1poke: db "0000",0 -money2poke: db "00",0 - - endp - - - - -Lookatcard proc near - - mov manisoffscreen,1 - call getridofreels - call loadkeypad - - call createpanel2 - mov di,160 - mov bx,80 - mov ds,tempgraphics - mov al,42 - mov ah,128 - call showframe - - call getobtextstart - call findnextcolon - call findnextcolon - call findnextcolon - mov di,36 - mov bx,124 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - - push es si - call worktoscreenm - mov cx,280 - call hangonw - call createpanel2 - mov di,160 - mov bx,80 - mov ds,tempgraphics - mov al,42 - mov ah,128 - call showframe - pop si es - - mov di,36 - mov bx,130 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - call worktoscreenm - - mov cx,200 - call hangonw - mov manisoffscreen,0 - call getridoftemp - call restorereels - call putbackobstuff - ret - - endp - - - - - -Moneypoke proc near - - mov bx,offset cs:money1poke - mov cl,48-1 -numberpoke0: inc cl - sub ax,10000 - jnc numberpoke0 - add ax,10000 - mov [cs:bx],cl - inc bx - - mov cl,48-1 -numberpoke1: inc cl - sub ax,1000 - jnc numberpoke1 - add ax,1000 - mov [cs:bx],cl - inc bx - - mov cl,48-1 -numberpoke2: inc cl - sub ax,100 - jnc numberpoke2 - add ax,100 - mov [cs:bx],cl - inc bx - - mov cl,48-1 -numberpoke3: inc cl - sub ax,10 - jnc numberpoke3 - add ax,10 - mov [cs:bx],cl - - mov bx,offset cs:money2poke - add al,48 - mov [cs:bx],al - ret - - endp - - - - - - - -Usecontrol proc near - - cmp withobject,255 - jnz gotcontrolwith - call withwhat - ret -gotcontrolwith: mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"E" - mov dl,"Y" - mov dh,"A" - call compare - jz rightkey - cmp reallocation,21 - jnz balls - mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"N" - mov dl,"F" - mov dh,"E" - call compare - jz jimmycontrols - mov al,withobject - mov ah,withtype - mov cl,"A" - mov ch,"X" - mov dl,"E" - mov dh,"D" - call compare - jz axeoncontrols - -balls: call showfirstuse - call putbackobstuff - ret - -rightkey: mov al,16 - call playchannel1 - cmp location,21 - jz goingdown - mov cx,300 - mov al,0 - call showpuztext - mov newlocation,21 - mov counttoclose,8 - mov counttoopen,0 - mov watchingtime,80 - mov getback,1 - ret - -goingdown: mov cx,300 - mov al,3 - call showpuztext - mov newlocation,30 - mov counttoclose,8 - mov counttoopen,0 - mov watchingtime,80 - mov getback,1 - ret - -jimmycontrols: mov al,50 - call placesetobject - mov al,51 - call placesetobject - mov al,26 - call placesetobject - mov al,30 - call placesetobject - mov al,16 - call removesetobject - mov al,17 - call removesetobject - if demo - mov al,26 - else - mov al,14 - endif - call playchannel1 - mov cx,300 - mov al,10 - call showpuztext - inc progresspoints - mov getback,1 - ret - -axeoncontrols: mov cx,300 - mov al,16 - call showpuztext - inc progresspoints - call putbackobstuff - ret - - endp - - - - - - -Usehatch proc near - - call showfirstuse - mov newlocation,40 - mov getback,1 - ret - - endp - - - - - -Usewire proc near - - cmp withobject,255 - jnz gotwirewith - call withwhat - ret -gotwirewith: mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"N" - mov dl,"F" - mov dh,"E" - call compare - jz wireknife - mov al,withobject - mov ah,withtype - mov cl,"A" - mov ch,"X" - mov dl,"E" - mov dh,"D" - call compare - jz wireaxe - - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -wireaxe: mov cx,300 - mov al,16 - call showpuztext - call putbackobstuff - ret - -wireknife: mov al,51 - call removesetobject - mov al,52 - call placesetobject - mov cx,300 - mov al,11 - call showpuztext - inc progresspoints - mov getback,1 - ret - - endp - - - - - - - -Usehandle proc near - - mov al,"C" - mov ah,"U" - mov cl,"T" - mov ch,"W" - call findsetobject - mov al,[es:bx+58] - cmp al,255 - jnz havecutwire - mov cx,300 - mov al,12 - call showpuztext - mov getback,1 - ret - -havecutwire: mov cx,300 - mov al,13 - call showpuztext - mov newlocation,22 - mov getback,1 - ret - - endp - - - - - - - - -Useelevator1 proc near - - call showfirstuse - call selectlocation - mov getback,1 - ret - - endp - - - - - - -Showfirstuse proc near ;shows but does not delete the - ;first bit of text after the - call getobtextstart ;description - call findnextcolon - call findnextcolon - call usetext - mov cx,400 - call hangonp - ret - - endp - - - - - -Useelevator3 proc near - - call showfirstuse - mov counttoclose,20 - mov newlocation,34 - mov reeltowatch,46 - mov endwatchreel,63 - mov watchspeed,1 - mov speedcount,1 - mov watchingtime,80 ;40 - mov getback,1 - ret - - endp - - - - -Useelevator4 proc near - - call showfirstuse - mov reeltowatch,0 - mov endwatchreel,11 - mov watchspeed,1 - mov speedcount,1 - mov counttoclose,20 - mov watchingtime,80 ;40 - mov getback,1 - mov newlocation,24 - ret - - endp - - - -Useelevator2 proc near - - cmp location,23 - jz inpoolhall - call showfirstuse - mov newlocation,23 - mov counttoclose,20 - mov counttoopen,0 - mov watchingtime,80 - mov getback,1 - ret -inpoolhall: call showfirstuse - mov newlocation,31 - mov counttoclose,20 - mov counttoopen,0 - mov watchingtime,80 - mov getback,1 - ret - - endp - - - - -Useelevator5 proc near - - mov al,4 - call placesetobject - mov al,0 - call removesetobject - mov newlocation,20 - mov watchingtime,80 - mov liftflag,1 - mov counttoclose,8 - mov getback,1 - ret - - endp - - - - - -Usekey proc near - - cmp location,5 - jz usekey1 - cmp location,30 - jz usekey1 - cmp location,21 - jz usekey2 - mov cx,200 - mov al,1 - call showpuztext - call putbackobstuff - ret - -usekey1: cmp mapx,22 - jnz wrongroom1 - cmp mapy,10 - jnz wrongroom1 - mov cx,300 - mov al,0 - call showpuztext - mov counttoclose,100 - mov getback,1 - ret - -usekey2: cmp mapx,11 - jnz wrongroom1 - cmp mapy,10 - jnz wrongroom1 - mov cx,300 - mov al,3 - call showpuztext - mov newlocation,30 - mov al,2 - call fadescreendown - call showfirstuse - call putbackobstuff - ret - -wrongroom1: mov cx,200 - mov al,2 - call showpuztext - call putbackobstuff - ret - - endp - - - - - - - -Usestereo proc near - - cmp location,0 - jz stereook - mov cx,400 ;Ryan isn't in his flat. - mov al,4 - call showpuztext - call putbackobstuff - ret - -stereook: cmp mapx,11 - jnz stereonotok - cmp mapy,0 - jz stereook2 -stereonotok: mov cx,400 ;Ryan isn't in his bedroom. - mov al,5 - call showpuztext - call putbackobstuff - ret - -stereook2: mov al,"C" - mov ah,"D" - mov cl,"P" - mov ch,"L" - call findsetobject ;find object number of CD player - mov ah,1 ;searching for inside a set ob - call checkinside ;see if there is anything inside - cmp cl,numexobjects - jnz cdinside - mov al,6 ;Need a CD inside - mov cx,400 - call showpuztext - call putbackobstuff - call getanyad ;if the CD's been taken out, - mov al,255 ;make sure the player isn't still - mov [es:bx+10],al ;playing, ie:reset the puzzle - ret ;flag for the remote. - -cdinside: call getanyad - mov al,[es:bx+10] - xor al,1 - mov [es:bx+10],al - cmp al,255 - jz stereoon - mov al,7 ;The stereo works - mov cx,400 - call showpuztext - call putbackobstuff - ret - -stereoon: mov al,8 ;Stereo was already on, - mov cx,400 ;so switch it off - call showpuztext - call putbackobstuff - ret - - endp - - - - - - - - - - - - - - - -Usecooker proc near - - mov al,command - mov ah,objecttype - call checkinside ;see if there is anything inside - cmp cl,numexobjects - jnz foodinside - call showfirstuse - call putbackobstuff - ret ;flag for the remote. - -foodinside: call showseconduse - call putbackobstuff - ret - - endp - - - - - - -Useaxe proc near - - cmp reallocation,22 - jnz notinpool - cmp mapy,10 - jz axeondoor - call showseconduse - inc progresspoints - mov lastweapon,2 - mov getback,1 - call removeobfrominv - ret - -notinpool: call showfirstuse - ret - - endp - - - - - - - - -Useelvdoor proc near - - cmp withobject,255 - jnz gotdoorwith - call withwhat - ret -gotdoorwith: mov al,withobject - mov ah,withtype - mov cl,"A" - mov ch,"X" - mov dl,"E" - mov dh,"D" - call compare - jz axeondoor - mov al,14 - mov cx,300 - call showpuztext - call putbackobstuff - ret - -axeondoor: mov al,15 - mov cx,300 - call showpuztext - inc progresspoints - - mov watchingtime,46*2 - mov reeltowatch,31 - mov endwatchreel,77 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - -;------------------------------------------------------------------------------ - -Withwhat proc near ;Gets player to identify object - ;to use selected item with. - call createpanel - call showpanel - call showman - call showexit - mov al,command - mov ah,objecttype - push cs - pop es - mov di,offset cs:commandline - call copyname - - mov di,100 - mov bx,21 - mov dl,200 - mov al,63 - mov ah,2 - call printmessage2 - - mov di,lastxpos - add di,5 - mov bx,21 - push cs - pop es - mov si,offset cs:commandline - mov dl,220 - mov al,0 - mov ah,0 - call printdirect - - mov di,lastxpos - add di,5 - mov bx,21 - mov dl,200 - mov al,63 - mov ah,3 - call printmessage2 - - call fillryan - mov commandtype,255 - call readmouse - call showpointer - call worktoscreen - call delpointer - mov invopen,2 - ret - - endp - - - - - -Selectob proc near - - call findinvpos - mov ax,[es:bx] - cmp al,255 - jnz canselectob - call blank - ret - -canselectob: mov withobject,al - mov withtype,ah - cmp ax,oldsubject - jnz diffsub3 - cmp commandtype,221 - jz alreadyselob - mov commandtype,221 - -diffsub3: mov oldsubject,ax - mov bx,ax - mov al,0 - call commandwithob -alreadyselob: mov ax,mousebutton - cmp ax,oldbutton - jz notselob - and ax,1 - jnz doselob -notselob: ret - -doselob: call delpointer - mov invopen,0 - call useroutine - ret - - endp - - - - - - - - -Compare proc near - - sub dl,"A" - sub dh,"A" - sub cl,"A" - sub ch,"A" - push cx dx - call getanyaddir - pop dx cx - cmp [es:bx+12],cx - jnz comparefin - cmp [es:bx+14],dx -comparefin: ret - - endp - - - - - - - - - - - -Findsetobject proc near ;searches set object ID's - ;for contents of ax,cx - sub al,"A" ;returns number in al and data - sub ah,"A" ;start point in es:bx - sub cl,"A" - sub ch,"A" - mov es,setdat - mov bx,0 - mov dl,0 ;dl counts object number -findsetloop: cmp al,[es:bx+12] - jnz nofind - cmp ah,[es:bx+13] - jnz nofind - cmp cl,[es:bx+14] - jnz nofind - cmp ch,[es:bx+15] - jnz nofind - mov al,dl - ret -nofind: add bx,64 - inc dl - cmp dl,128 ;number of objects to search - jnz findsetloop - mov al,dl - ret - - endp - - - - - - -Findexobject proc near ;searches ex object ID's - ;for contents of ax,cx - sub al,"A" ;returns number in al and data - sub ah,"A" ;start point in es:bx - sub cl,"A" - sub ch,"A" - mov es,extras - mov bx,exdata - mov dl,0 ;dl counts object number -findexloop: cmp al,[es:bx+12] - jnz nofindex - cmp ah,[es:bx+13] - jnz nofindex - cmp cl,[es:bx+14] - jnz nofindex - cmp ch,[es:bx+15] - jnz nofindex - mov al,dl - ret -nofindex: add bx,16 - inc dl - cmp dl,numexobjects ;number of objects to search - jnz findexloop - mov al,dl - ret - - endp - - - -Isryanholding proc near - - sub al,"A" ;returns number in al and data - sub ah,"A" ;start point in es:bx - sub cl,"A" - sub ch,"A" - mov es,extras - mov bx,exdata - mov dl,0 ;dl counts object number -searchinv: cmp byte ptr [es:bx+2],4 - jnz nofindininv - cmp al,[es:bx+12] - jnz nofindininv - cmp ah,[es:bx+13] - jnz nofindininv - cmp cl,[es:bx+14] - jnz nofindininv - cmp ch,[es:bx+15] - jnz nofindininv - mov al,dl - cmp al,numexobjects - ret -nofindininv: add bx,16 - inc dl - cmp dl,numexobjects ;number of objects to search - jnz searchinv - mov al,dl - cmp al,numexobjects ;if not zero he is holding - ret ;if zero, he is not holding - - endp - - - - -Checkinside proc near ;finds an extra object inside - ;object number al, type ah - - mov es,extras - mov bx,exdata - mov cl,0 -insideloop: cmp al,[es:bx+3] ;OI! might need to check room number!!! - jnz notfoundinside - cmp ah,[es:bx+2] - jnz notfoundinside - ret -notfoundinside: add bx,16 - inc cl - cmp cl,numexobjects - jnz insideloop - ret ;ch returns the object number - ;in the extras list - endp - - - - - - - - - - - - -Usetext proc near - - push es si - call createpanel - call showpanel - call showman - call showexit - call obicons - pop si es - - mov di,36 - mov bx,104 - mov dl,241 - mov al,0 - mov ah,0 - call printdirect - - call worktoscreenm - ret - - endp - - - - - -Putbackobstuff proc near - - call createpanel - call showpanel - call showman - call obicons - call showexit - call obpicture - call describeob - call undertextline - mov commandtype,255 - call readmouse - call showpointer - call worktoscreen - call delpointer - ret - - endp - - - - - - - -Showpuztext proc near - - push cx - call findpuztext - push es si - call createpanel - call showpanel - call showman - call showexit - call obicons - pop si es - mov di,36 - mov bx,104 - mov dl,241 - mov ah,0 - call printdirect - call worktoscreenm - pop cx - call hangonp - ret - - endp - - - -Findpuztext proc near - - mov ah,0 - mov si,ax - add si,si - mov es,puzzletext - mov ax,[es:si] - add ax,textstart - mov si,ax - ret - - endp - - - -;------------------------------------------------------------------------------- - -Placesetobject proc near - - push es bx - mov cl,0 - mov ch,0 - call findormake - call getsetad - mov byte ptr [es:bx+58],0 - pop bx es - ret - - endp - - - - -Removesetobject proc near - - push es bx - mov cl,255 - mov ch,0 - call findormake - call getsetad - mov byte ptr [es:bx+58],255 - pop bx es - ret - - endp - - - - -Issetobonmap proc near - - push es bx - call getsetad - mov al,[es:bx+58] - pop bx es - cmp al,0 - ret - - endp - - - - - - -Placefreeobject proc near - - push es bx - mov cl,0 - mov ch,1 - call findormake - call getfreead - mov byte ptr [es:bx+2],0 - pop bx es - ret - - endp - - - - - -Removefreeobject proc near - - push es bx - ;mov cl,255 - ;mov ch,1 - ;call findormake - call getfreead - mov byte ptr [es:bx+2],255 - pop bx es - ret - - endp - - - - - - - - - - -Findormake proc near - - mov bx,listofchanges - push ax - mov es,buffers - mov ah,reallocation -changeloop: cmp byte ptr [es:bx],255 - jz haventfound - cmp ax,[es:bx] - jnz nofoundchange - cmp ch,[es:bx+3] - jz foundchange -nofoundchange: add bx,4 - jmp changeloop -foundchange: pop ax - mov [es:bx+2],cl - ret -haventfound: mov [es:bx],ax - mov [es:bx+2],cx - pop ax - ret - - endp - - - - - - - - -Switchryanon proc near - - mov ryanon,255 - ret - - endp - - - - - -Switchryanoff proc near - - mov ryanon,1 - ret - - endp - - - -Setallchanges proc near - - mov es,buffers - mov bx,listofchanges -setallloop: mov ax,[es:bx] - cmp al,255 - jz endsetloop - mov cx,[es:bx+2] - add bx,4 - cmp ah,reallocation - jnz setallloop - push es bx - call dochange - pop bx es - jmp setallloop -endsetloop: ret - - endp - - - - - - -Dochange proc near - - cmp ch,0 - jz object - cmp ch,1 - jz freeobject - -path: push cx - mov ah,0 - add ax,ax - add ax,ax - add ax,ax - push ax - mov al,ch - sub al,100 - mov ah,0 - mov cx,144 - mul cx - pop bx - add bx,ax - add bx,pathdata - mov es,reels - pop cx - mov byte ptr [es:bx+6],cl -nopath: ret - -object: push cx - call getsetad - pop cx - mov [es:bx+58],cl - ret - -freeobject: push cx - call getfreead - pop cx - cmp byte ptr [es:bx+2],255 - jnz beenpickedup - mov [es:bx+2],cl -beenpickedup: ret - - endp - - - -Autoappear proc near ;places objects that appear - ;in rooms after certain - cmp location,32 ;conditions are met. - jnz notinalley - mov al,5 ;switch off travel to - call resetlocation ;hotel after kill - mov al,10 - call setlocation - mov destpos,10 - ret -notinalley: cmp reallocation,24 - jnz notinedens - cmp generaldead,1 - jnz edenspart2 - inc generaldead - mov al,44 - call placesetobject - mov al,18 - call placesetobject - mov al,93 - call placesetobject - mov al,92 - call removesetobject - mov al,55 - call removesetobject - mov al,75 - call removesetobject - mov al,84 - call removesetobject - mov al,85 - call removesetobject - ret -edenspart2: cmp sartaindead,1 - jnz notedens2 - mov al,44 - call removesetobject - mov al,93 - call removesetobject - mov al,55 - call placesetobject - inc sartaindead -notedens2: ret -notinedens: cmp reallocation,25 - jnz notonsartroof - mov newsitem,3 - mov al,6 - call resetlocation ;turn off Sartain Industries - mov al,11 - call setlocation ;turn on carpark for later - mov destpos,11 - ret -notonsartroof: cmp reallocation,2 - jnz notinlouiss - cmp rockstardead,0 - jz notinlouiss - mov al,23 - call placesetobject -notinlouiss: ret - - endp - - - - - - - - - - -;--------------------------------------------------------- Timed text stuff ---- - - - -Getundertimed proc near - - mov al,timedy - if foreign - sub al,3 - endif - mov ah,0 - mov bx,ax - mov al,timedx - mov ah,0 - mov di,ax - mov ch,undertimedysize - mov cl,240 - mov ds,buffers - mov si,undertimedtext - call multiget - ret - - endp - - - - -Putundertimed proc near - - mov al,timedy - if foreign - sub al,3 - endif - mov ah,0 - mov bx,ax - mov al,timedx - mov ah,0 - mov di,ax - mov ch,undertimedysize - mov cl,240 - mov ds,buffers - mov si,undertimedtext - call multiput - ret - - endp - - - - - - -Dumptimedtext proc near - - cmp needtodumptimed,1 - jnz nodumptimed - mov al,timedy - if foreign - sub al,3 - endif - mov ah,0 - mov bx,ax - mov al,timedx - mov ah,0 - mov di,ax - mov cl,240 - mov ch,undertimedysize - call multidump - mov needtodumptimed,0 -nodumptimed: ret - - endp - - - - - - - - -Setuptimeduse proc near - - cmp timecount,0 - jnz cantsetup - - mov timedy,bh - mov timedx,bl - mov counttotimed,cx - add dx,cx - mov timecount,dx - mov bl,al - mov bh,0 - add bx,bx - mov es,puzzletext - mov cx,textstart - mov ax,[es:bx] - add ax,cx - mov bx,ax - mov timedseg,es - mov timedoffset,bx -cantsetup: ret - - endp - - - -Setuptimedtemp proc near - - if cd - cmp ah,0 - jz notloadspeech3 - mov dl,"T" - mov dh,ah - mov cl,"T" - mov ah,0 - call loadspeech - cmp speechloaded,1 - jnz notloadspeech3 - mov al,50+12 - call playchannel1 - ret -notloadspeech3: - endif - cmp timecount,0 - jnz cantsetup2 - mov timedy,bh - mov timedx,bl - mov counttotimed,cx - add dx,cx - mov timecount,dx - mov bl,al - mov bh,0 - add bx,bx - mov es,textfile1 - mov cx,textstart - mov ax,[es:bx] - add ax,cx - mov bx,ax - mov timedseg,es - mov timedoffset,bx -cantsetup2: ret - - endp - - - - - - - -Usetimedtext proc near - - cmp timecount,0 - jz notext - dec timecount - cmp timecount,0 - jz deltimedtext - mov ax,timecount - cmp ax,counttotimed - jz firsttimed - jnc notext - jmp notfirsttimed -firsttimed: call getundertimed -notfirsttimed: mov bl,timedy - mov bh,0 - mov al,timedx - mov ah,0 - mov di,ax - mov es,timedseg - mov si,timedoffset - mov dl,237 - mov ah,0 - call printdirect - mov needtodumptimed,1 -notext: ret - -deltimedtext: call putundertimed - mov needtodumptimed,1 - ret - - endp - - - - - - - - - - - - -Edenscdplayer proc near - - call showfirstuse - mov watchingtime,18*2 - mov reeltowatch,25 - mov endwatchreel,42 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - ret - - endp - - - - - -Usewall proc near - - call showfirstuse - cmp manspath,3 - jz gobackover - mov watchingtime,30*2 - mov reeltowatch,2 - mov endwatchreel,31 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - mov al,3 - call turnpathon - mov al,4 - call turnpathon - mov al,0 - call turnpathoff - mov al,1 - call turnpathoff - mov al,2 - call turnpathoff - mov al,5 - call turnpathoff - mov manspath,3 - mov finaldest,3 - call findxyfrompath - mov resetmanxy,1 - call switchryanoff - ret -gobackover: mov watchingtime,30*2 - mov reeltowatch,34 - mov endwatchreel,60 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - mov al,3 - call turnpathoff - mov al,4 - call turnpathoff - mov al,0 - call turnpathon - mov al,1 - call turnpathon - mov al,2 - call turnpathon - mov al,5 - call turnpathon - mov manspath,5 - mov finaldest,5 - call findxyfrompath - mov resetmanxy,1 - call switchryanoff - ret - - endp - - - - - - - -Usechurchgate proc near - - cmp withobject,255 - jnz gatewith - call withwhat - ret -gatewith: mov al,withobject - mov ah,withtype - mov cl,"C" - mov ch,"U" - mov dl,"T" - mov dh,"T" - call compare - jz cutgate - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -cutgate: call showfirstuse - mov watchingtime,64*2 - mov reeltowatch,4 - mov endwatchreel,70 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - inc progresspoints - mov al,3 - call turnpathon - cmp aidedead,0 - jz notopenchurch - mov al,2 - call turnpathon -notopenchurch: ret - - endp - - - - - -Usegun proc near - - cmp objecttype,4 - jz istakengun - call showseconduse - call putbackobstuff - ret -istakengun: cmp reallocation,22 - jnz notinpoolroom - mov cx,300 - mov al,34 - call showpuztext - mov lastweapon,1 - mov combatcount,39 - mov getback,1 - inc progresspoints - ret -notinpoolroom: cmp reallocation,25 - jnz nothelicopter - mov cx,300 - mov al,34 - call showpuztext - mov lastweapon,1 - mov combatcount,19 - mov getback,1 - mov dreamnumber,2 - mov roomafterdream,38 - mov sartaindead,1 - inc progresspoints - ret -nothelicopter: cmp reallocation,27 - jnz notinrockroom - mov cx,300 - mov al,46 - call showpuztext - mov pointermode,2 ;0 - mov rockstardead,1 - mov lastweapon,1 - mov newsitem,1 - mov getback,1 - mov roomafterdream,32 ; skip - mov dreamnumber,0 - inc progresspoints - ret -notinrockroom: cmp reallocation,8 - jnz notbystudio - cmp mapx,22 - jnz notbystudio - cmp mapy,40 - jnz notbystudio - mov al,92 - call issetobonmap - jz notbystudio - cmp manspath,9 - jz notbystudio - mov destination,9 - mov finaldest,9 - call autosetwalk - mov lastweapon,1 - mov getback,1 - inc progresspoints - ret -notbystudio: cmp reallocation,6 - jnz notsarters - cmp mapx,11 - jnz notsarters - cmp mapy,20 - jnz notsarters - mov al,5 - call issetobonmap - jnz notsarters - mov destination,1 - mov finaldest,1 - call autosetwalk - mov al,5 - call removesetobject - mov al,6 - call placesetobject - mov al,1 - mov ah,roomnum - dec ah - call turnanypathon - mov liftflag,1 - mov watchingtime,40*2 - mov reeltowatch,4 - mov endwatchreel,43 - mov watchspeed,1 - mov speedcount,1 - mov getback,1 - inc progresspoints - ret -notsarters: cmp reallocation,29 - jnz notaide - mov getback,1 - mov al,13 - call resetlocation - mov al,12 - call setlocation - mov destpos,12 - mov destination,2 - mov finaldest,2 - call autosetwalk - mov watchingtime,164*2 - mov reeltowatch,3 - mov endwatchreel,164 - mov watchspeed,1 - mov speedcount,1 - mov aidedead,1 - mov dreamnumber,3 - mov roomafterdream,33 - inc progresspoints - ret -notaide: cmp reallocation,23 - jnz notwithboss - cmp mapx,0 - jnz notwithboss - cmp mapy,50 - jnz notwithboss - cmp manspath,5 - jz pathokboss - mov destination,5 - mov finaldest,5 - call autosetwalk -pathokboss: mov lastweapon,1 - mov getback,1 - ret -notwithboss: cmp reallocation,8 - jnz nottvsoldier - cmp mapx,11 - jnz nottvsoldier - cmp mapy,10 - jnz nottvsoldier - cmp manspath,2 - jz pathoktv - mov destination,2 - mov finaldest,2 - call autosetwalk -pathoktv: mov lastweapon,1 - mov getback,1 - ret -nottvsoldier: call showfirstuse - call putbackobstuff - ret - - endp - - - - - - - -Useshield proc near - - cmp reallocation,20 - jnz notinsartroom - cmp combatcount,0 - jz notinsartroom - mov lastweapon,3 - call showseconduse - mov getback,1 - inc progresspoints - call removeobfrominv - ret -notinsartroom: call showfirstuse - call putbackobstuff - ret - - endp - - - - - - -Usebuttona proc near - - mov al,95 - call issetobonmap - jz donethisbit - - call showfirstuse - mov al,0 - mov ah,roomnum - dec ah - call turnanypathon - mov al,9 - call removesetobject - mov al,95 - call placesetobject - - mov watchingtime,15*2 - mov reeltowatch,71 - mov endwatchreel,85 - mov watchspeed,1 - mov speedcount,1 - - mov getback,1 - inc progresspoints - ret -donethisbit: call showseconduse - call putbackobstuff - ret - - endp - - - - -Useplate proc near - - cmp withobject,255 - jnz platewith - call withwhat - ret -platewith: mov al,withobject - mov ah,withtype - mov cl,"S" - mov ch,"C" - mov dl,"R" - mov dh,"W" - call compare - jz unscrewplate - mov al,withobject - mov ah,withtype - mov cl,"K" - mov ch,"N" - mov dl,"F" - mov dh,"E" - call compare - jz triedknife - mov cx,300 - mov al,14 - call showpuztext - call putbackobstuff - ret - -unscrewplate: mov al,20 - call playchannel1 - call showfirstuse - mov al,28 - call placesetobject - mov al,24 - call placesetobject - mov al,25 - call removesetobject - mov al,0 - call placefreeobject - inc progresspoints - mov getback,1 - ret - -triedknife: mov cx,300 - mov al,54 - call showpuztext - call putbackobstuff - ret - - endp - - - - - -Usewinch proc near - - mov al,40 - mov ah,1 - call checkinside - cmp cl,numexobjects - jz nowinch - mov al,cl - mov ah,4 - mov cl,"F" - mov ch,"U" - mov dl,"S" - mov dh,"E" - call compare - jnz nowinch - - mov watchingtime,217*2 - mov reeltowatch,0 - mov endwatchreel,217 - mov watchspeed,1 - mov speedcount,1 - mov destpos,1 - mov newlocation,45 - mov dreamnumber,1 - mov roomafterdream,44 - mov generaldead,1 - mov newsitem,2 - mov getback,1 - inc progresspoints - ret - -nowinch: call showfirstuse - call putbackobstuff - ret - - endp - - - - - - - - - - - + +Useobject proc near + + mov withobject,255 + + cmp commandtype,229 + jz alreadyuse + mov commandtype,229 + + mov bl,command + mov bh,objecttype + mov al,51 + call commandwithob +alreadyuse: mov ax,mousebutton + cmp ax,oldbutton + jz nouse + and ax,1 + jnz douse +nouse: ret + +douse: call useroutine + ret + + endp + + + + + + + +Useroutine proc near + + cmp reallocation,50 + jc nodream7 + cmp pointerpower,0 + jnz powerok + ret +powerok: mov pointerpower,0 + +nodream7: call getanyad + mov dx,seg uselist + mov ds,dx + mov si,offset uselist +checkuselist: push si + lodsb + sub al,"A" + cmp al,[es:bx+12] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+13] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+14] + jnz failed + lodsb + sub al,"A" + cmp al,[es:bx+15] + jnz failed + lodsw + pop si + call ax + ret +failed: pop si + add si,6 + cmp byte ptr [si],140 + jnz checkuselist + + call delpointer + call getobtextstart + call findnextcolon + cmp al,0 + jz cantuse2 + call findnextcolon + cmp al,0 + jz cantuse2 + mov al,[es:si] + cmp al,0 + jz cantuse2 + call usetext + mov cx,400 + call hangonp + call putbackobstuff + ret +cantuse2: call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,33 + mov bx,100 + mov al,63 + mov dl,241 + call printmessage + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + mov commandtype,255 + ret + +Uselist: db "NETW" + dw usemon + db "ELVA" + dw useelevator1 + db "ELVB" + dw useelevator2 + db "ELVC" + dw useelevator3 + db "ELVE" + dw useelevator4 + db "ELVF" + dw useelevator5 + db "CGAT" + dw usechurchgate + db "REMO" + dw usestereo + db "BUTA" + dw usebuttona + db "CBOX" + dw usewinch + db "LITE" + dw uselighter + db "PLAT" + dw useplate + db "LIFT" + dw usecontrol + db "WIRE" + dw usewire + db "HNDL" + dw usehandle + db "HACH" + dw usehatch + db "DOOR" + dw useelvdoor + db "CSHR" + dw usecashcard + db "GUNA" + dw usegun + db "CRAA" + dw usecardreader1 + db "CRBB" + dw usecardreader2 + db "CRCC" + dw usecardreader3 + db "SEAT" + dw sitdowninbar + db "MENU" + dw usemenu + db "COOK" + dw usecooker + db "ELCA" + dw callhotellift + db "EDCA" + dw calledenslift + db "DDCA" + dw calledensdlift + db "ALTR" + dw usealtar + db "LOKA" + dw openhoteldoor + db "LOKB" + dw openhoteldoor2 + db "ENTA" + dw openlouis + db "ENTB" + dw openryan + db "ENTE" + dw openpoolboss + db "ENTC" + dw openyourneighbour + db "ENTD" + dw openeden + db "ENTH" + dw opensarters + db "WWAT" + dw wearwatch + db "POOL" + dw usepoolreader + db "WSHD" + dw wearshades + db "GRAF" + dw grafittidoor + db "TRAP" + dw trapdoor + db "CDPE" + dw edenscdplayer + + db "DLOK" + dw opentvdoor + + db "HOLE" + dw usehole + + db "DRYR" + dw usedryer + + db "HOLY" + dw usechurchhole + + db "WALL" + dw usewall + db "BOOK" + dw usediary + + db "AXED" + dw useaxe + db "SHLD" + dw useshield + + db "BCNY" + dw userailing + db "LIDC" + dw usecoveredbox + db "LIDU" + dw useclearbox + db "LIDO" + dw useopenbox + db "PIPE" + dw usepipe + + db "BALC" + dw usebalcony + db "WIND" + dw usewindow + db "PAPR" + dw viewfolder + + db "UWTA" + dw usetrainer + db "UWTB" + dw usetrainer + + db "STAT" + dw entersymbol + db "TLID" + dw opentomb + db "SLAB" + dw useslab + db "CART" + dw usecart + db "FCAR" + dw usefullcart + + + db "SLBA" + dw slabdoora + db "SLBB" + dw slabdoorb + db "SLBC" + dw slabdoorc + db "SLBD" + dw slabdoord + db "SLBE" + dw slabdoore + db "SLBF" + dw slabdoorf + db "PLIN" + dw useplinth + + db "LADD" + dw useladder + db "LADB" + dw useladderb + + db "GUMA" + dw chewy + + db "SQEE" + dw wheelsound + db "TAPP" + dw runtap + db "GUIT" + dw playguitar + db "CONT" + dw hotelcontrol + + db "BELL" + dw hotelbell + + db 140,140,140,140 + + endp + + + + + + +;-----------------------------------------------------------Puzzle routines---- + + +Wheelsound proc near + + mov al,17 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + +Runtap proc near + + cmp withobject,255 + jnz tapwith + call withwhat + ret +tapwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcupfromtap + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz cupfromtapfull + mov cx,300 + mov al,56 + call showpuztext + call putbackobstuff + ret + +fillcupfromtap: mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + mov al,8 + call playchannel1 + mov cx,300 + mov al,57 + call showpuztext + call putbackobstuff + ret + +cupfromtapfull: mov cx,300 + mov al,58 + call showpuztext + call putbackobstuff + ret + + + endp + + + +Playguitar proc near + + mov al,14 + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + +Hotelcontrol proc near + + cmp reallocation,21 + jnz notrightcont + cmp mapx,33 + jnz notrightcont + call showfirstuse + call putbackobstuff + ret +notrightcont: call showseconduse + call putbackobstuff + ret + + endp + + + + +Hotelbell proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Opentomb proc near + + inc progresspoints + call showfirstuse + mov watchingtime,35*2 + mov reeltowatch,1 + mov endwatchreel,33 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Usetrainer proc near + + call getanyad + cmp byte ptr [es:bx+2],4 + jnz notheldtrainer + inc progresspoints + call makeworn + call showseconduse + call putbackobstuff + ret +notheldtrainer: call nothelderror + ret + + endp + + + +Nothelderror proc near + + call createpanel + call showpanel + call showman + call showexit + call obicons + mov di,64 + mov bx,100 + mov al,63 + mov ah,1 + mov dl,201 + call printmessage2 + call worktoscreenm + mov cx,50 + call hangonp + call putbackobstuff + ret + + endp + + + +Usepipe proc near + + cmp withobject,255 + jnz pipewith + call withwhat + ret +pipewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz fillcup + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz alreadyfull + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +fillcup: mov cx,300 + mov al,36 + call showpuztext + call putbackobstuff + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"F"-"A" + ret + +alreadyfull: mov cx,300 + mov al,35 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + +Usefullcart proc near + + inc progresspoints + mov al,2 + mov ah,roomnum + add ah,6 + call turnanypathon + mov manspath,4 + mov facing,4 + mov turntoface,4 + mov finaldest,4 + call findxyfrompath + mov resetmanxy,1 + call showfirstuse + mov watchingtime,72*2 + mov reeltowatch,58 + mov endwatchreel,142 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + + + +Useplinth proc near + + cmp withobject,255 + jnz plinthwith + call withwhat + ret + +plinthwith: mov al,withobject + mov ah,withtype + mov cl,"D" + mov ch,"K" + mov dl,"E" + mov dh,"Y" + call compare + jz isrightkey + call showfirstuse + call putbackobstuff + ret + +isrightkey: inc progresspoints + call showseconduse + mov watchingtime,220 + mov reeltowatch,0 + mov endwatchreel,104 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,roomafterdream + mov newlocation,al + ret + + endp + + + +Chewy proc near + + call showfirstuse + call getanyad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + +Useladder proc near + + call showfirstuse + sub mapx,11 + call findroominloc + mov facing,6 + mov turntoface,6 + mov manspath,0 + mov destination,0 + mov finaldest,0 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Useladderb proc near + + call showfirstuse + add mapx,11 + call findroominloc + mov facing,2 + mov turntoface,2 + mov manspath,1 + mov destination,1 + mov finaldest,1 + call findxyfrompath + mov resetmanxy,1 + mov getback,1 + ret + + endp + + + + + +Slabdoora proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,13 + cmp dreamnumber,3 + jnz slabawrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,42 + mov newlocation,47 + ret +slabawrong: mov watchingtime,40 + mov endwatchreel,34 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + +Slabdoorb proc near + + cmp dreamnumber,1 + jnz slabbwrong + mov al,"S" + mov ah,"H" + mov cl,"L" + mov ch,"D" + call isryanholding + jnz gotcrystal + mov al,44 + mov cx,200 + call showpuztext + call putbackobstuff + ret +gotcrystal: call showfirstuse + inc progresspoints + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,60 + mov endwatchreel,71 + mov newlocation,47 + ret +slabbwrong: call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,44 + mov watchingtime,40 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoord proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,75 + cmp dreamnumber,0 + jnz slabcwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,102 + mov newlocation,47 + ret +slabcwrong: mov watchingtime,40 + mov endwatchreel,94 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorc proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,108 + cmp dreamnumber,4 + jnz slabdwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,135 + mov newlocation,47 + ret +slabdwrong: mov watchingtime,40 + mov endwatchreel,127 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoore proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,141 + cmp dreamnumber,5 + jnz slabewrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,168 + mov newlocation,47 + ret +slabewrong: mov watchingtime,40 + mov endwatchreel,160 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Slabdoorf proc near + + call showfirstuse + mov getback,1 + mov watchspeed,1 + mov speedcount,1 + mov reeltowatch,171 + cmp dreamnumber,2 + jnz slabfwrong + inc progresspoints + mov watchingtime,60 + mov endwatchreel,197 + mov newlocation,47 + ret +slabfwrong: mov watchingtime,40 + mov endwatchreel,189 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + + + + +Useslab proc near + + cmp withobject,255 + jnz slabwith + call withwhat + ret +slabwith: mov al,withobject + mov ah,withtype + mov cl,"J" + mov ch,"E" + mov dl,"W" + mov dh,"L" + call compare + jz nextslab + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextslab: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + push ax + call placesetobject + pop ax + cmp al,54 + jnz notlastslab + mov al,0 + call turnpathon + mov watchingtime,22 + mov reeltowatch,35 + mov endwatchreel,48 + mov watchspeed,1 + mov speedcount,1 +notlastslab: inc progresspoints + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Usecart proc near + + cmp withobject,255 + jnz cartwith + call withwhat + ret +cartwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"O" + mov dl,"C" + mov dh,"K" + call compare + jz nextcart + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +nextcart: mov al,withobject + call getexad + mov byte ptr [es:bx+2],0 + mov al,command + push ax + call removesetobject + pop ax + inc al + call placesetobject + inc progresspoints + mov al,17 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + +Useclearbox proc near + + cmp withobject,255 + jnz clearboxwith + call withwhat + ret +clearboxwith: mov al,withobject + mov ah,withtype + mov cl,"R" + mov ch,"A" + mov dl,"I" + mov dh,"L" + call compare + jz openbox + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openbox: inc progresspoints + call showfirstuse + mov watchingtime,80 + mov reeltowatch,67 + mov endwatchreel,105 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usecoveredbox proc near + + inc progresspoints + call showfirstuse + mov watchingtime,50 + mov reeltowatch,41 + mov endwatchreel,66 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Userailing proc near + + call showfirstuse + mov watchingtime,80 + mov reeltowatch,0 + mov endwatchreel,30 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov mandead,4 + ret + + endp + + + + + +Useopenbox proc near + + cmp withobject,255 + jnz openboxwith + call withwhat + ret +openboxwith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"F" + call compare + jz destoryopenbox + mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"P" + mov dh,"E" + call compare + jz openboxwrong + call showfirstuse + ret + +destoryopenbox: inc progresspoints + mov cx,300 + mov al,37 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+15],"E"-"A" + mov watchingtime,140 + mov reeltowatch,105 + mov endwatchreel,181 + mov watchspeed,1 + mov speedcount,1 + mov al,4 + call turnpathon + mov getback,1 + ret + +openboxwrong: mov cx,300 + mov al,38 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + +Wearwatch proc near + + cmp watchon,1 + jz wearingwatch + call showfirstuse + mov watchon,1 + mov getback,1 + call getanyad + call makeworn + ret +wearingwatch: call showseconduse + call putbackobstuff + ret + + endp + + + + +Wearshades proc near + + cmp shadeson,1 + jz wearingshades + mov shadeson,1 + call showfirstuse + mov getback,1 + call getanyad + call makeworn + ret +wearingshades: call showseconduse + call putbackobstuff + ret + + endp + + + +Sitdowninbar proc near + + cmp watchmode,-1 + jnz satdown + call showfirstuse + mov watchingtime,50 + mov reeltowatch,55 + mov endwatchreel,71 + mov reeltohold,73 + mov endofholdreel,83 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret +satdown: call showseconduse + call putbackobstuff + ret + + endp + + + +Usechurchhole proc near + + call showfirstuse + mov getback,1 + mov watchingtime,28 + mov reeltowatch,13 + mov endwatchreel,26 + mov watchspeed,1 + mov speedcount,1 + ret + + endp + + + +Usehole proc near + + cmp withobject,255 + jnz holewith + call withwhat + ret +holewith: mov al,withobject + mov ah,withtype + mov cl,"H" + mov ch,"N" + mov dl,"D" + mov dh,"A" + call compare + jz righthand + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +righthand: call showfirstuse + mov al,86 + call removesetobject + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov canmovealtar,1 + mov getback,1 + ret + + endp + + + + +Usealtar proc near + + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"A" + call findexobject + cmp al,numexobjects + jz thingsonaltar + mov al,"C" + mov ah,"N" + mov cl,"D" + mov ch,"B" + call findexobject + cmp al,numexobjects + jz thingsonaltar + cmp canmovealtar,1 + jz movealtar + mov cx,300 + mov al,23 + call showpuztext + mov getback,1 + ret + +movealtar: inc progresspoints + call showseconduse + mov watchingtime,160 + mov reeltowatch,81 + mov endwatchreel,174 + mov watchspeed,1 + mov speedcount,1 + + mov al,47 ;message number + mov bl,52 ;x pos of message + mov bh,76 ;and y pos + mov cx,32 ;time on screen + mov dx,98 ;pause before show + call setuptimeduse + mov getback,1 + ret + +thingsonaltar: call showfirstuse + mov getback,1 + ret + + endp + + + + + + + + + +Opentvdoor proc near + + cmp withobject,255 + jnz tvdoorwith + call withwhat + ret +tvdoorwith: mov al,withobject + mov ah,withtype + mov cl,"U" + mov ch,"L" + mov dl,"O" + mov dh,"K" + call compare + jz keyontv + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyontv: call showfirstuse + mov lockstatus,0 + mov getback,1 + ret + + endp + + + + + + + +Usedryer proc near + + mov al,12 + call playchannel1 + call showfirstuse + mov getback,1 + ret + + endp + + + + + +Openlouis proc near + + mov al,5 + mov ah,2 + mov cl,3 + mov ch,8 + call entercode + mov getback,1 + ret + + endp + + + + +Nextcolon proc near + +lookcolon: mov al,[es:si] + inc si + cmp al,":" + jnz lookcolon + ret + + endp + + + + +Openyourneighbour proc near + + mov al,255 + mov ah,255 + mov cl,255 + mov ch,255 + call entercode + mov getback,1 + ret + + endp + + + +Usewindow proc near + + cmp manspath,6 + jnz notonbalc + inc progresspoints + call showfirstuse + mov newlocation,29 + mov getback,1 + ret +notonbalc: call showseconduse + call putbackobstuff + ret + + endp + + + +Usebalcony proc near + + call showfirstuse + mov al,6 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,5 + call turnpathoff + inc progresspoints + mov manspath,6 + mov destination,6 + mov finaldest,6 + call findxyfrompath + call switchryanoff + mov resetmanxy,1 + + mov watchingtime,30*2 + mov reeltowatch,183 + mov endwatchreel,212 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + +Openryan proc near + + mov al,5 + mov ah,1 + mov cl,0 + mov ch,6 + call entercode + mov getback,1 + ret + + endp + + + +Openpoolboss proc near + + mov al,5 + mov ah,2 + mov cl,2 + mov ch,2 + call entercode + mov getback,1 + ret + + endp + + + + +Openeden proc near + + mov al,2 + mov ah,8 + mov cl,6 + mov ch,5 + call entercode + mov getback,1 + ret + + endp + + +Opensarters proc near + + mov al,7 + mov ah,8 + mov cl,3 + mov ch,3 + call entercode + mov getback,1 + ret + + endp + + + + +Isitright proc near + + mov bx,seg presslist + mov es,bx + mov bx,offset es:presslist + cmp [es:bx+0],al + jnz notright + cmp [es:bx+1],ah + jnz notright + cmp [es:bx+2],cl + jnz notright + cmp [es:bx+3],ch +notright: ret + + endp + + + + +Drawitall proc near + + call createpanel + call drawfloor + ;call dumpallmap + call printsprites + call showicon + ret + + endp + + + + +Openhoteldoor proc near + + cmp withobject,255 + jnz hoteldoorwith + call withwhat + ret +hoteldoorwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel1 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel1: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + ;mov destination,1 + ;mov finaldest,1 + ;call autosetwalk + mov lockstatus,0 + mov getback,1 + ret + + endp + + + +Openhoteldoor2 proc near + + cmp withobject,255 + jnz hoteldoorwith2 + call withwhat + ret +hoteldoorwith2: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz keyonhotel2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +keyonhotel2: if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Grafittidoor proc near + + cmp withobject,255 + jnz grafwith + call withwhat + ret +grafwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"P" + mov dl,"E" + mov dh,"N" + call compare + jz dograf + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +dograf: call showfirstuse + call putbackobstuff + ret + + endp + + + + + +Trapdoor proc near + + inc progresspoints + call showfirstuse + call switchryanoff + mov watchingtime,20*2 + mov reeltowatch,181 + mov endwatchreel,197 + mov newlocation,26 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + +Callhotellift proc near + + if demo + mov al,24 + else + mov al,12 + endif + call playchannel1 + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov destination,5 + mov finaldest,5 + call autosetwalk + mov al,4 + call turnpathon + ret + + endp + + + + +Calledenslift proc near + + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret + + endp + + + +Calledensdlift proc near + + cmp liftflag,1 + jz edensdhere + call showfirstuse + mov counttoopen,8 + mov getback,1 + mov al,2 + call turnpathon + ret +edensdhere: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Usepoolreader proc near + + cmp withobject,255 + jnz poolwith + call withwhat + ret +poolwith: mov al,withobject + mov ah,withtype + mov cl,"M" + mov ch,"E" + mov dl,"M" + mov dh,"B" + call compare + jz openpool + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +openpool: cmp talkedtoattendant,1 + jz canopenpool + call showseconduse + call putbackobstuff + ret + +canopenpool: mov al,17 + call playchannel1 + call showfirstuse + mov counttoopen,6 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Uselighter proc near + + cmp withobject,255 + jnz gotlighterwith + call withwhat + ret +gotlighterwith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"M" + mov dl,"K" + mov dh,"E" + call compare + jz cigarette + call showfirstuse + call putbackobstuff + ret +cigarette: mov cx,300 + mov al,9 + call showpuztext + mov al,withobject + call getexad + mov byte ptr [es:bx+2],255 + mov getback,1 + ret + + endp + + + + + + + + + + + + + +Showseconduse proc near + + call getobtextstart + call nextcolon + call nextcolon + call nextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + + +Usecardreader1 proc near + + cmp withobject,255 + jnz gotreader1with + call withwhat + ret +gotreader1with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret +correctcard: cmp talkedtosparky,0 + jz notyet + cmp card1money,0 + jz getscash + mov cx,300 + mov al,17 + call showpuztext + call putbackobstuff + ret +getscash: mov al,16 + call playchannel1 + mov cx,300 + mov al,18 + call showpuztext + inc progresspoints + mov card1money,12432 + mov getback,1 + ret +notyet: call showfirstuse + call putbackobstuff + ret + + endp + + + + +Usecardreader2 proc near + + cmp withobject,255 + jnz gotreader2with + call withwhat + ret +gotreader2with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz correctcard2 + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +correctcard2: cmp talkedtoboss,0 + jz notyetboss + cmp card1money,0 + jz nocash + cmp gunpassflag,2 + jz alreadygotnew + mov al,18 + call playchannel1 + mov cx,300 + mov al,19 + call showpuztext + mov al,94 + call placesetobject + mov gunpassflag,1 + sub card1money,2000 + inc progresspoints + mov getback,1 + ret +nocash: mov cx,300 + mov al,20 + call showpuztext + call putbackobstuff + ret +alreadygotnew: mov cx,300 + mov al,22 + call showpuztext + call putbackobstuff + ret +notyetboss: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Usecardreader3 proc near + + cmp withobject,255 + jnz gotreader3with + call withwhat + ret +gotreader3with: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"S" + mov dl,"H" + mov dh,"R" + call compare + jz rightcard + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +rightcard: cmp talkedtorecep,0 + jz notyetrecep + cmp cardpassflag,0 + jnz alreadyusedit + if demo + mov al,27 + else + mov al,16 + endif + call playchannel1 + mov cx,300 + mov al,25 + call showpuztext + inc progresspoints + sub card1money,8300 + mov cardpassflag,1 + mov getback,1 + ret +alreadyusedit: mov cx,300 + mov al,26 + call showpuztext + call putbackobstuff + ret +notyetrecep: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + +Usecashcard proc near + + call getridofreels + call loadkeypad + call createpanel + call showpanel + call showexit + call showman + + mov di,114 + if foreign + mov bx,120-3 + else + mov bx,120 + endif + mov ds,tempgraphics + mov al,39 + mov ah,0 + call showframe + + mov ax,card1money + call moneypoke + + call getobtextstart + call nextcolon + call nextcolon + + mov di,36 + mov bx,98 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + mov di,160 + mov bx,155 + push cs + pop es + mov si,offset cs:money1poke + mov charshift,91*2+75 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov di,187 + mov bx,155 + push cs + pop es + mov si,offset cs:money2poke + mov charshift,91*2+85 + mov al,0 + mov ah,0 + mov dl,240 + call printdirect + mov charshift,0 + call worktoscreenm + mov cx,400 + call hangonp + call getridoftemp + call restorereels + call putbackobstuff + ret + +money1poke: db "0000",0 +money2poke: db "00",0 + + endp + + + + +Lookatcard proc near + + mov manisoffscreen,1 + call getridofreels + call loadkeypad + + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + + call getobtextstart + call findnextcolon + call findnextcolon + call findnextcolon + mov di,36 + mov bx,124 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + push es si + call worktoscreenm + mov cx,280 + call hangonw + call createpanel2 + mov di,160 + mov bx,80 + mov ds,tempgraphics + mov al,42 + mov ah,128 + call showframe + pop si es + + mov di,36 + mov bx,130 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + call worktoscreenm + + mov cx,200 + call hangonw + mov manisoffscreen,0 + call getridoftemp + call restorereels + call putbackobstuff + ret + + endp + + + + + +Moneypoke proc near + + mov bx,offset cs:money1poke + mov cl,48-1 +numberpoke0: inc cl + sub ax,10000 + jnc numberpoke0 + add ax,10000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke1: inc cl + sub ax,1000 + jnc numberpoke1 + add ax,1000 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke2: inc cl + sub ax,100 + jnc numberpoke2 + add ax,100 + mov [cs:bx],cl + inc bx + + mov cl,48-1 +numberpoke3: inc cl + sub ax,10 + jnc numberpoke3 + add ax,10 + mov [cs:bx],cl + + mov bx,offset cs:money2poke + add al,48 + mov [cs:bx],al + ret + + endp + + + + + + + +Usecontrol proc near + + cmp withobject,255 + jnz gotcontrolwith + call withwhat + ret +gotcontrolwith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"E" + mov dl,"Y" + mov dh,"A" + call compare + jz rightkey + cmp reallocation,21 + jnz balls + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz jimmycontrols + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeoncontrols + +balls: call showfirstuse + call putbackobstuff + ret + +rightkey: mov al,16 + call playchannel1 + cmp location,21 + jz goingdown + mov cx,300 + mov al,0 + call showpuztext + mov newlocation,21 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +goingdown: mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov counttoclose,8 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + +jimmycontrols: mov al,50 + call placesetobject + mov al,51 + call placesetobject + mov al,26 + call placesetobject + mov al,30 + call placesetobject + mov al,16 + call removesetobject + mov al,17 + call removesetobject + if demo + mov al,26 + else + mov al,14 + endif + call playchannel1 + mov cx,300 + mov al,10 + call showpuztext + inc progresspoints + mov getback,1 + ret + +axeoncontrols: mov cx,300 + mov al,16 + call showpuztext + inc progresspoints + call putbackobstuff + ret + + endp + + + + + + +Usehatch proc near + + call showfirstuse + mov newlocation,40 + mov getback,1 + ret + + endp + + + + + +Usewire proc near + + cmp withobject,255 + jnz gotwirewith + call withwhat + ret +gotwirewith: mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz wireknife + mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz wireaxe + + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +wireaxe: mov cx,300 + mov al,16 + call showpuztext + call putbackobstuff + ret + +wireknife: mov al,51 + call removesetobject + mov al,52 + call placesetobject + mov cx,300 + mov al,11 + call showpuztext + inc progresspoints + mov getback,1 + ret + + endp + + + + + + + +Usehandle proc near + + mov al,"C" + mov ah,"U" + mov cl,"T" + mov ch,"W" + call findsetobject + mov al,[es:bx+58] + cmp al,255 + jnz havecutwire + mov cx,300 + mov al,12 + call showpuztext + mov getback,1 + ret + +havecutwire: mov cx,300 + mov al,13 + call showpuztext + mov newlocation,22 + mov getback,1 + ret + + endp + + + + + + + + +Useelevator1 proc near + + call showfirstuse + call selectlocation + mov getback,1 + ret + + endp + + + + + + +Showfirstuse proc near ;shows but does not delete the + ;first bit of text after the + call getobtextstart ;description + call findnextcolon + call findnextcolon + call usetext + mov cx,400 + call hangonp + ret + + endp + + + + + +Useelevator3 proc near + + call showfirstuse + mov counttoclose,20 + mov newlocation,34 + mov reeltowatch,46 + mov endwatchreel,63 + mov watchspeed,1 + mov speedcount,1 + mov watchingtime,80 ;40 + mov getback,1 + ret + + endp + + + + +Useelevator4 proc near + + call showfirstuse + mov reeltowatch,0 + mov endwatchreel,11 + mov watchspeed,1 + mov speedcount,1 + mov counttoclose,20 + mov watchingtime,80 ;40 + mov getback,1 + mov newlocation,24 + ret + + endp + + + +Useelevator2 proc near + + cmp location,23 + jz inpoolhall + call showfirstuse + mov newlocation,23 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret +inpoolhall: call showfirstuse + mov newlocation,31 + mov counttoclose,20 + mov counttoopen,0 + mov watchingtime,80 + mov getback,1 + ret + + endp + + + + +Useelevator5 proc near + + mov al,4 + call placesetobject + mov al,0 + call removesetobject + mov newlocation,20 + mov watchingtime,80 + mov liftflag,1 + mov counttoclose,8 + mov getback,1 + ret + + endp + + + + + +Usekey proc near + + cmp location,5 + jz usekey1 + cmp location,30 + jz usekey1 + cmp location,21 + jz usekey2 + mov cx,200 + mov al,1 + call showpuztext + call putbackobstuff + ret + +usekey1: cmp mapx,22 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,0 + call showpuztext + mov counttoclose,100 + mov getback,1 + ret + +usekey2: cmp mapx,11 + jnz wrongroom1 + cmp mapy,10 + jnz wrongroom1 + mov cx,300 + mov al,3 + call showpuztext + mov newlocation,30 + mov al,2 + call fadescreendown + call showfirstuse + call putbackobstuff + ret + +wrongroom1: mov cx,200 + mov al,2 + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + +Usestereo proc near + + cmp location,0 + jz stereook + mov cx,400 ;Ryan isn't in his flat. + mov al,4 + call showpuztext + call putbackobstuff + ret + +stereook: cmp mapx,11 + jnz stereonotok + cmp mapy,0 + jz stereook2 +stereonotok: mov cx,400 ;Ryan isn't in his bedroom. + mov al,5 + call showpuztext + call putbackobstuff + ret + +stereook2: mov al,"C" + mov ah,"D" + mov cl,"P" + mov ch,"L" + call findsetobject ;find object number of CD player + mov ah,1 ;searching for inside a set ob + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz cdinside + mov al,6 ;Need a CD inside + mov cx,400 + call showpuztext + call putbackobstuff + call getanyad ;if the CD's been taken out, + mov al,255 ;make sure the player isn't still + mov [es:bx+10],al ;playing, ie:reset the puzzle + ret ;flag for the remote. + +cdinside: call getanyad + mov al,[es:bx+10] + xor al,1 + mov [es:bx+10],al + cmp al,255 + jz stereoon + mov al,7 ;The stereo works + mov cx,400 + call showpuztext + call putbackobstuff + ret + +stereoon: mov al,8 ;Stereo was already on, + mov cx,400 ;so switch it off + call showpuztext + call putbackobstuff + ret + + endp + + + + + + + + + + + + + + + +Usecooker proc near + + mov al,command + mov ah,objecttype + call checkinside ;see if there is anything inside + cmp cl,numexobjects + jnz foodinside + call showfirstuse + call putbackobstuff + ret ;flag for the remote. + +foodinside: call showseconduse + call putbackobstuff + ret + + endp + + + + + + +Useaxe proc near + + cmp reallocation,22 + jnz notinpool + cmp mapy,10 + jz axeondoor + call showseconduse + inc progresspoints + mov lastweapon,2 + mov getback,1 + call removeobfrominv + ret + +notinpool: call showfirstuse + ret + + endp + + + + + + + + +Useelvdoor proc near + + cmp withobject,255 + jnz gotdoorwith + call withwhat + ret +gotdoorwith: mov al,withobject + mov ah,withtype + mov cl,"A" + mov ch,"X" + mov dl,"E" + mov dh,"D" + call compare + jz axeondoor + mov al,14 + mov cx,300 + call showpuztext + call putbackobstuff + ret + +axeondoor: mov al,15 + mov cx,300 + call showpuztext + inc progresspoints + + mov watchingtime,46*2 + mov reeltowatch,31 + mov endwatchreel,77 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + +;------------------------------------------------------------------------------ + +Withwhat proc near ;Gets player to identify object + ;to use selected item with. + call createpanel + call showpanel + call showman + call showexit + mov al,command + mov ah,objecttype + push cs + pop es + mov di,offset cs:commandline + call copyname + + mov di,100 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,2 + call printmessage2 + + mov di,lastxpos + add di,5 + mov bx,21 + push cs + pop es + mov si,offset cs:commandline + mov dl,220 + mov al,0 + mov ah,0 + call printdirect + + mov di,lastxpos + add di,5 + mov bx,21 + mov dl,200 + mov al,63 + mov ah,3 + call printmessage2 + + call fillryan + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + mov invopen,2 + ret + + endp + + + + + +Selectob proc near + + call findinvpos + mov ax,[es:bx] + cmp al,255 + jnz canselectob + call blank + ret + +canselectob: mov withobject,al + mov withtype,ah + cmp ax,oldsubject + jnz diffsub3 + cmp commandtype,221 + jz alreadyselob + mov commandtype,221 + +diffsub3: mov oldsubject,ax + mov bx,ax + mov al,0 + call commandwithob +alreadyselob: mov ax,mousebutton + cmp ax,oldbutton + jz notselob + and ax,1 + jnz doselob +notselob: ret + +doselob: call delpointer + mov invopen,0 + call useroutine + ret + + endp + + + + + + + + +Compare proc near + + sub dl,"A" + sub dh,"A" + sub cl,"A" + sub ch,"A" + push cx dx + call getanyaddir + pop dx cx + cmp [es:bx+12],cx + jnz comparefin + cmp [es:bx+14],dx +comparefin: ret + + endp + + + + + + + + + + + +Findsetobject proc near ;searches set object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,setdat + mov bx,0 + mov dl,0 ;dl counts object number +findsetloop: cmp al,[es:bx+12] + jnz nofind + cmp ah,[es:bx+13] + jnz nofind + cmp cl,[es:bx+14] + jnz nofind + cmp ch,[es:bx+15] + jnz nofind + mov al,dl + ret +nofind: add bx,64 + inc dl + cmp dl,128 ;number of objects to search + jnz findsetloop + mov al,dl + ret + + endp + + + + + + +Findexobject proc near ;searches ex object ID's + ;for contents of ax,cx + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +findexloop: cmp al,[es:bx+12] + jnz nofindex + cmp ah,[es:bx+13] + jnz nofindex + cmp cl,[es:bx+14] + jnz nofindex + cmp ch,[es:bx+15] + jnz nofindex + mov al,dl + ret +nofindex: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz findexloop + mov al,dl + ret + + endp + + + +Isryanholding proc near + + sub al,"A" ;returns number in al and data + sub ah,"A" ;start point in es:bx + sub cl,"A" + sub ch,"A" + mov es,extras + mov bx,exdata + mov dl,0 ;dl counts object number +searchinv: cmp byte ptr [es:bx+2],4 + jnz nofindininv + cmp al,[es:bx+12] + jnz nofindininv + cmp ah,[es:bx+13] + jnz nofindininv + cmp cl,[es:bx+14] + jnz nofindininv + cmp ch,[es:bx+15] + jnz nofindininv + mov al,dl + cmp al,numexobjects + ret +nofindininv: add bx,16 + inc dl + cmp dl,numexobjects ;number of objects to search + jnz searchinv + mov al,dl + cmp al,numexobjects ;if not zero he is holding + ret ;if zero, he is not holding + + endp + + + + +Checkinside proc near ;finds an extra object inside + ;object number al, type ah + + mov es,extras + mov bx,exdata + mov cl,0 +insideloop: cmp al,[es:bx+3] ;OI! might need to check room number!!! + jnz notfoundinside + cmp ah,[es:bx+2] + jnz notfoundinside + ret +notfoundinside: add bx,16 + inc cl + cmp cl,numexobjects + jnz insideloop + ret ;ch returns the object number + ;in the extras list + endp + + + + + + + + + + + + +Usetext proc near + + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + + mov di,36 + mov bx,104 + mov dl,241 + mov al,0 + mov ah,0 + call printdirect + + call worktoscreenm + ret + + endp + + + + + +Putbackobstuff proc near + + call createpanel + call showpanel + call showman + call obicons + call showexit + call obpicture + call describeob + call undertextline + mov commandtype,255 + call readmouse + call showpointer + call worktoscreen + call delpointer + ret + + endp + + + + + + + +Showpuztext proc near + + push cx + call findpuztext + push es si + call createpanel + call showpanel + call showman + call showexit + call obicons + pop si es + mov di,36 + mov bx,104 + mov dl,241 + mov ah,0 + call printdirect + call worktoscreenm + pop cx + call hangonp + ret + + endp + + + +Findpuztext proc near + + mov ah,0 + mov si,ax + add si,si + mov es,puzzletext + mov ax,[es:si] + add ax,textstart + mov si,ax + ret + + endp + + + +;------------------------------------------------------------------------------- + +Placesetobject proc near + + push es bx + mov cl,0 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],0 + pop bx es + ret + + endp + + + + +Removesetobject proc near + + push es bx + mov cl,255 + mov ch,0 + call findormake + call getsetad + mov byte ptr [es:bx+58],255 + pop bx es + ret + + endp + + + + +Issetobonmap proc near + + push es bx + call getsetad + mov al,[es:bx+58] + pop bx es + cmp al,0 + ret + + endp + + + + + + +Placefreeobject proc near + + push es bx + mov cl,0 + mov ch,1 + call findormake + call getfreead + mov byte ptr [es:bx+2],0 + pop bx es + ret + + endp + + + + + +Removefreeobject proc near + + push es bx + ;mov cl,255 + ;mov ch,1 + ;call findormake + call getfreead + mov byte ptr [es:bx+2],255 + pop bx es + ret + + endp + + + + + + + + + + +Findormake proc near + + mov bx,listofchanges + push ax + mov es,buffers + mov ah,reallocation +changeloop: cmp byte ptr [es:bx],255 + jz haventfound + cmp ax,[es:bx] + jnz nofoundchange + cmp ch,[es:bx+3] + jz foundchange +nofoundchange: add bx,4 + jmp changeloop +foundchange: pop ax + mov [es:bx+2],cl + ret +haventfound: mov [es:bx],ax + mov [es:bx+2],cx + pop ax + ret + + endp + + + + + + + + +Switchryanon proc near + + mov ryanon,255 + ret + + endp + + + + + +Switchryanoff proc near + + mov ryanon,1 + ret + + endp + + + +Setallchanges proc near + + mov es,buffers + mov bx,listofchanges +setallloop: mov ax,[es:bx] + cmp al,255 + jz endsetloop + mov cx,[es:bx+2] + add bx,4 + cmp ah,reallocation + jnz setallloop + push es bx + call dochange + pop bx es + jmp setallloop +endsetloop: ret + + endp + + + + + + +Dochange proc near + + cmp ch,0 + jz object + cmp ch,1 + jz freeobject + +path: push cx + mov ah,0 + add ax,ax + add ax,ax + add ax,ax + push ax + mov al,ch + sub al,100 + mov ah,0 + mov cx,144 + mul cx + pop bx + add bx,ax + add bx,pathdata + mov es,reels + pop cx + mov byte ptr [es:bx+6],cl +nopath: ret + +object: push cx + call getsetad + pop cx + mov [es:bx+58],cl + ret + +freeobject: push cx + call getfreead + pop cx + cmp byte ptr [es:bx+2],255 + jnz beenpickedup + mov [es:bx+2],cl +beenpickedup: ret + + endp + + + +Autoappear proc near ;places objects that appear + ;in rooms after certain + cmp location,32 ;conditions are met. + jnz notinalley + mov al,5 ;switch off travel to + call resetlocation ;hotel after kill + mov al,10 + call setlocation + mov destpos,10 + ret +notinalley: cmp reallocation,24 + jnz notinedens + cmp generaldead,1 + jnz edenspart2 + inc generaldead + mov al,44 + call placesetobject + mov al,18 + call placesetobject + mov al,93 + call placesetobject + mov al,92 + call removesetobject + mov al,55 + call removesetobject + mov al,75 + call removesetobject + mov al,84 + call removesetobject + mov al,85 + call removesetobject + ret +edenspart2: cmp sartaindead,1 + jnz notedens2 + mov al,44 + call removesetobject + mov al,93 + call removesetobject + mov al,55 + call placesetobject + inc sartaindead +notedens2: ret +notinedens: cmp reallocation,25 + jnz notonsartroof + mov newsitem,3 + mov al,6 + call resetlocation ;turn off Sartain Industries + mov al,11 + call setlocation ;turn on carpark for later + mov destpos,11 + ret +notonsartroof: cmp reallocation,2 + jnz notinlouiss + cmp rockstardead,0 + jz notinlouiss + mov al,23 + call placesetobject +notinlouiss: ret + + endp + + + + + + + + + + +;--------------------------------------------------------- Timed text stuff ---- + + + +Getundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiget + ret + + endp + + + + +Putundertimed proc near + + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov ch,undertimedysize + mov cl,240 + mov ds,buffers + mov si,undertimedtext + call multiput + ret + + endp + + + + + + +Dumptimedtext proc near + + cmp needtodumptimed,1 + jnz nodumptimed + mov al,timedy + if foreign + sub al,3 + endif + mov ah,0 + mov bx,ax + mov al,timedx + mov ah,0 + mov di,ax + mov cl,240 + mov ch,undertimedysize + call multidump + mov needtodumptimed,0 +nodumptimed: ret + + endp + + + + + + + + +Setuptimeduse proc near + + cmp timecount,0 + jnz cantsetup + + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,puzzletext + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup: ret + + endp + + + +Setuptimedtemp proc near + + if cd + cmp ah,0 + jz notloadspeech3 + mov dl,"T" + mov dh,ah + mov cl,"T" + mov ah,0 + call loadspeech + cmp speechloaded,1 + jnz notloadspeech3 + mov al,50+12 + call playchannel1 + ret +notloadspeech3: + endif + cmp timecount,0 + jnz cantsetup2 + mov timedy,bh + mov timedx,bl + mov counttotimed,cx + add dx,cx + mov timecount,dx + mov bl,al + mov bh,0 + add bx,bx + mov es,textfile1 + mov cx,textstart + mov ax,[es:bx] + add ax,cx + mov bx,ax + mov timedseg,es + mov timedoffset,bx +cantsetup2: ret + + endp + + + + + + + +Usetimedtext proc near + + cmp timecount,0 + jz notext + dec timecount + cmp timecount,0 + jz deltimedtext + mov ax,timecount + cmp ax,counttotimed + jz firsttimed + jnc notext + jmp notfirsttimed +firsttimed: call getundertimed +notfirsttimed: mov bl,timedy + mov bh,0 + mov al,timedx + mov ah,0 + mov di,ax + mov es,timedseg + mov si,timedoffset + mov dl,237 + mov ah,0 + call printdirect + mov needtodumptimed,1 +notext: ret + +deltimedtext: call putundertimed + mov needtodumptimed,1 + ret + + endp + + + + + + + + + + + + +Edenscdplayer proc near + + call showfirstuse + mov watchingtime,18*2 + mov reeltowatch,25 + mov endwatchreel,42 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + ret + + endp + + + + + +Usewall proc near + + call showfirstuse + cmp manspath,3 + jz gobackover + mov watchingtime,30*2 + mov reeltowatch,2 + mov endwatchreel,31 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathon + mov al,4 + call turnpathon + mov al,0 + call turnpathoff + mov al,1 + call turnpathoff + mov al,2 + call turnpathoff + mov al,5 + call turnpathoff + mov manspath,3 + mov finaldest,3 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret +gobackover: mov watchingtime,30*2 + mov reeltowatch,34 + mov endwatchreel,60 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + mov al,3 + call turnpathoff + mov al,4 + call turnpathoff + mov al,0 + call turnpathon + mov al,1 + call turnpathon + mov al,2 + call turnpathon + mov al,5 + call turnpathon + mov manspath,5 + mov finaldest,5 + call findxyfrompath + mov resetmanxy,1 + call switchryanoff + ret + + endp + + + + + + + +Usechurchgate proc near + + cmp withobject,255 + jnz gatewith + call withwhat + ret +gatewith: mov al,withobject + mov ah,withtype + mov cl,"C" + mov ch,"U" + mov dl,"T" + mov dh,"T" + call compare + jz cutgate + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +cutgate: call showfirstuse + mov watchingtime,64*2 + mov reeltowatch,4 + mov endwatchreel,70 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + mov al,3 + call turnpathon + cmp aidedead,0 + jz notopenchurch + mov al,2 + call turnpathon +notopenchurch: ret + + endp + + + + + +Usegun proc near + + cmp objecttype,4 + jz istakengun + call showseconduse + call putbackobstuff + ret +istakengun: cmp reallocation,22 + jnz notinpoolroom + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,39 + mov getback,1 + inc progresspoints + ret +notinpoolroom: cmp reallocation,25 + jnz nothelicopter + mov cx,300 + mov al,34 + call showpuztext + mov lastweapon,1 + mov combatcount,19 + mov getback,1 + mov dreamnumber,2 + mov roomafterdream,38 + mov sartaindead,1 + inc progresspoints + ret +nothelicopter: cmp reallocation,27 + jnz notinrockroom + mov cx,300 + mov al,46 + call showpuztext + mov pointermode,2 ;0 + mov rockstardead,1 + mov lastweapon,1 + mov newsitem,1 + mov getback,1 + mov roomafterdream,32 ; skip + mov dreamnumber,0 + inc progresspoints + ret +notinrockroom: cmp reallocation,8 + jnz notbystudio + cmp mapx,22 + jnz notbystudio + cmp mapy,40 + jnz notbystudio + mov al,92 + call issetobonmap + jz notbystudio + cmp manspath,9 + jz notbystudio + mov destination,9 + mov finaldest,9 + call autosetwalk + mov lastweapon,1 + mov getback,1 + inc progresspoints + ret +notbystudio: cmp reallocation,6 + jnz notsarters + cmp mapx,11 + jnz notsarters + cmp mapy,20 + jnz notsarters + mov al,5 + call issetobonmap + jnz notsarters + mov destination,1 + mov finaldest,1 + call autosetwalk + mov al,5 + call removesetobject + mov al,6 + call placesetobject + mov al,1 + mov ah,roomnum + dec ah + call turnanypathon + mov liftflag,1 + mov watchingtime,40*2 + mov reeltowatch,4 + mov endwatchreel,43 + mov watchspeed,1 + mov speedcount,1 + mov getback,1 + inc progresspoints + ret +notsarters: cmp reallocation,29 + jnz notaide + mov getback,1 + mov al,13 + call resetlocation + mov al,12 + call setlocation + mov destpos,12 + mov destination,2 + mov finaldest,2 + call autosetwalk + mov watchingtime,164*2 + mov reeltowatch,3 + mov endwatchreel,164 + mov watchspeed,1 + mov speedcount,1 + mov aidedead,1 + mov dreamnumber,3 + mov roomafterdream,33 + inc progresspoints + ret +notaide: cmp reallocation,23 + jnz notwithboss + cmp mapx,0 + jnz notwithboss + cmp mapy,50 + jnz notwithboss + cmp manspath,5 + jz pathokboss + mov destination,5 + mov finaldest,5 + call autosetwalk +pathokboss: mov lastweapon,1 + mov getback,1 + ret +notwithboss: cmp reallocation,8 + jnz nottvsoldier + cmp mapx,11 + jnz nottvsoldier + cmp mapy,10 + jnz nottvsoldier + cmp manspath,2 + jz pathoktv + mov destination,2 + mov finaldest,2 + call autosetwalk +pathoktv: mov lastweapon,1 + mov getback,1 + ret +nottvsoldier: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + +Useshield proc near + + cmp reallocation,20 + jnz notinsartroom + cmp combatcount,0 + jz notinsartroom + mov lastweapon,3 + call showseconduse + mov getback,1 + inc progresspoints + call removeobfrominv + ret +notinsartroom: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + +Usebuttona proc near + + mov al,95 + call issetobonmap + jz donethisbit + + call showfirstuse + mov al,0 + mov ah,roomnum + dec ah + call turnanypathon + mov al,9 + call removesetobject + mov al,95 + call placesetobject + + mov watchingtime,15*2 + mov reeltowatch,71 + mov endwatchreel,85 + mov watchspeed,1 + mov speedcount,1 + + mov getback,1 + inc progresspoints + ret +donethisbit: call showseconduse + call putbackobstuff + ret + + endp + + + + +Useplate proc near + + cmp withobject,255 + jnz platewith + call withwhat + ret +platewith: mov al,withobject + mov ah,withtype + mov cl,"S" + mov ch,"C" + mov dl,"R" + mov dh,"W" + call compare + jz unscrewplate + mov al,withobject + mov ah,withtype + mov cl,"K" + mov ch,"N" + mov dl,"F" + mov dh,"E" + call compare + jz triedknife + mov cx,300 + mov al,14 + call showpuztext + call putbackobstuff + ret + +unscrewplate: mov al,20 + call playchannel1 + call showfirstuse + mov al,28 + call placesetobject + mov al,24 + call placesetobject + mov al,25 + call removesetobject + mov al,0 + call placefreeobject + inc progresspoints + mov getback,1 + ret + +triedknife: mov cx,300 + mov al,54 + call showpuztext + call putbackobstuff + ret + + endp + + + + + +Usewinch proc near + + mov al,40 + mov ah,1 + call checkinside + cmp cl,numexobjects + jz nowinch + mov al,cl + mov ah,4 + mov cl,"F" + mov ch,"U" + mov dl,"S" + mov dh,"E" + call compare + jnz nowinch + + mov watchingtime,217*2 + mov reeltowatch,0 + mov endwatchreel,217 + mov watchspeed,1 + mov speedcount,1 + mov destpos,1 + mov newlocation,45 + mov dreamnumber,1 + mov roomafterdream,44 + mov generaldead,1 + mov newsitem,2 + mov getback,1 + inc progresspoints + ret + +nowinch: call showfirstuse + call putbackobstuff + ret + + endp + + + + + + + + + + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm index b72f180d74..e38470a7de 100644 --- a/devtools/tasmrecover/dreamweb/vars.asm +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -1,564 +1,564 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -;---------------------------------------------------Equates and definitions---- - -Inputport equ 63h -Mapwidth equ 66 ;132/2 -Maplength equ 60 ;6/2 -Tablesize equ 32 ;size of each entry in spritetable -Itempicsize equ 44 ;size of inventory slots -Opsy equ 52 -Opsx equ 60 -Inventx equ 80 -Inventy equ 58 -Zoomx equ 8 -Zoomy equ 132 -Keypadx equ 36+112 -Keypady equ 72 -Diaryx equ 68+24 -Diaryy equ 48+12 -Symbolx equ 64 -Symboly equ 56 -Menux equ 80+40 -Menuy equ 60 - - if foreign -Undertextsizex equ 228 -Undertextsizey equ 13 -Undertimedysize equ 30 - else -Undertextsizex equ 180 -Undertextsizey equ 10 -Undertimedysize equ 24 - endif - -Numchanges equ 250 - -Textunder equ 0 ;offsets for items in buffer segment -Openinvlist equ textunder+(undertextsizex*undertextsizey) -Ryaninvlist equ openinvlist+32 -Pointerback equ ryaninvlist+60 -Mapflags equ pointerback+(32*32) -Startpal equ mapflags+(11*10*3) -Endpal equ startpal+768 -Maingamepal equ endpal+768 -Spritetable equ maingamepal+768 -Setlist equ spritetable+(32*tablesize) -Freelist equ setlist+(128*5) -Exlist equ freelist+(80*5) -Peoplelist equ exlist+(100*5) -Zoomspace equ peoplelist+(12*5) -Printedlist equ zoomspace+(46*40) -Listofchanges equ printedlist+(5*80) -Undertimedtext equ listofchanges+(numchanges*4) -Rainlist equ undertimedtext+(256*undertimedysize) -Initialreelrouts equ rainlist+(6*64) -Initialvars equ initialreelrouts+lenofreelrouts -Lengthofbuffer equ initialvars+lengthofvars - -Flags equ 0 ;offsets of items in backdrop segment -Blocks equ flags+192 -Map equ 0 -Lengthofmap equ map+(mapwidth*maplength) - -Intextdat equ 0 -Intext equ intextdat+(38*2) -Blocktextdat equ 0 -Blocktext equ blocktextdat+(98*2) -Settextdat equ 0 -Settext equ settextdat+(130*2) -Freetextdat equ 0 -Freetext equ freetextdat+(82*2) - -Numexobjects equ 114 -Exframeslen equ 30000 -Extextlen equ 18000 - -Exframedata equ 0 -Exframes equ exframedata+2080 -Exdata equ exframes+exframeslen -Extextdat equ exdata+(16*numexobjects) -Extext equ extextdat+((numexobjects+2)*2) -Lengthofextra equ extext+extextlen - -Framedata equ 0 -Frames equ framedata+2080 - -Frframedata equ 0 -Frframes equ frframedata+2080 - -Personframes equ 0 -Persontxtdat equ personframes+24 -Persontext equ persontxtdat+(1026*2) - -Pathdata equ 0 -Reellist equ pathdata+(36*144) - -Lenofmapstore equ 22*8*20*8 -Maplen equ mapwidth*maplength -Freedatlen equ 16*80 -Setdatlen equ 64*128 -Textstart equ 66*2 - -;-----------------------------------------------------------------Variables---- - - -startvars db 0 -progresspoints db 0 -watchon db 0 -shadeson db 0 -secondcount db 0 -minutecount db 30 -hourcount db 19 -zoomon db 1 -location db 0 -expos db 0 -exframepos dw 0 -extextpos dw 0 -card1money dw 0 -listpos dw 0 -ryanpage db 0 - - -watchingtime dw 0 -reeltowatch dw -1 ;reel plays from here in mode 0 -endwatchreel dw 0 ;and stops here. Mode set to 1 -speedcount db 0 -watchspeed db 0 -reeltohold dw -1 ;if mode is 1 hold on this reel -endofholdreel dw -1 ;if mode is 2 then play to end of -watchmode db -1 ;hold reel. Set mode back to -1 -destafterhold db 0 ;set walking destination. - -newsitem db 0 - -liftflag db 0 -liftpath db 0 -lockstatus db 1 -doorpath db 0 -counttoopen db 0 -counttoclose db 0 -rockstardead db 0 -generaldead db 0 -sartaindead db 0 -aidedead db 0 -beenmugged db 0 - -gunpassflag db 0 -canmovealtar db 0 -talkedtoattendant db 0 -talkedtosparky db 0 -talkedtoboss db 0 -talkedtorecep db 0 -cardpassflag db 0 -madmanflag db 0 -keeperflag db 0 -lasttrigger db 0 -mandead db 0 -seed db 1,2,3 -needtotravel db 0 -throughdoor db 0 -newobs db 0 -ryanon db 255 -combatcount db 0 -lastweapon db -1 - -dreamnumber db 0 -roomafterdream db 0 - -shakecounter db 48 - -lengthofvars equ $-startvars - - -speechcount db 0 - -charshift dw 0 -kerning db 0 - -brightness db 0 - -roomloaded db 0 - -didzoom db 0 - -linespacing dw 10 -textaddressx dw 13 -textaddressy dw 182 ;address on screen for text -textlen db 0 -lastxpos dw 0 - -icontop dw 0 -iconleft dw 0 -itemframe db 0 -itemtotran db 0 -roomad dw 0 -oldsubject dw 0 - -withobject db 0 -withtype db 0 - -lookcounter dw 0 - -command db 0 -commandtype db 0 -oldcommandtype db 0 -objecttype db 0 -getback db 0 -invopen db 0 -mainmode db 0 -pickup db 0 -lastinvpos db 0 -examagain db 0 -newtextline db 0 - -openedob db 0 -openedtype db 0 - -oldmapadx dw 0 -oldmapady dw 0 -mapadx dw 0 -mapady dw 0 -mapoffsetx dw 104 -mapoffsety dw 38 - -mapxstart dw 0 -mapystart dw 0 -mapxsize db 0 -mapysize db 0 - -havedoneobs db 0 -manisoffscreen db 0 -rainspace db 0 - -facing db 0 -leavedirection db 0 -turntoface db 0 -turndirection db 0 - -maintimer dw 0 -introcount db 0 -arrowad dw 0 -currentkey db 0 -oldkey db 0 -useddirection db 0 -currentkey2 db 0 - -timercount db 0 -oldtimercount db 0 - -mapx db 0 -mapy db 0 -newscreen db 0 -ryanx db 0 -ryany db 0 -lastflag db 0 -lastflagex db 0 -flagx db 0 -flagy db 0 - -currentex db 0 -currentfree db 0 -currentframe dw 0 -framesad dw 0 -dataad dw 0 -frsegment dw 0 -objectx dw 0 -objecty dw 0 -offsetx dw 0 -offsety dw 0 -savesize dw 0 -savesource dw 0 -savex db 0 -savey db 0 -currentob db 0 -priority db 0 - -destpos db 0 - -reallocation db 0 ;----------;some rooms have more than one -roomnum db 0 ;place in the Roomdata list, to - ;account for different start points -nowinnewroom db 0 ;this variable holds the rooms -resetmanxy db 0 ;real value - ie:which file it's in -newlocation db -1 ;if set then room is loaded at end of watch mode, or straight away if not in watch mode -autolocation db -1 -mustload db 0 -answered db 0 -saidno db 0 - -doorcheck1 db 0 -doorcheck2 db 0 -doorcheck3 db 0 -doorcheck4 db 0 - -mousex dw 0 -mousey dw 0 -mousebutton dw 0 -mousebutton1 dw 0 -mousebutton2 dw 0 -mousebutton3 dw 0 -mousebutton4 dw 0 -oldbutton dw 0 -oldx dw 0 -oldy dw 0 -lastbutton dw 0 -oldpointerx dw 0 -oldpointery dw 0 -delherex dw 0 -delherey dw 0 -pointerxs db 32 -pointerys db 32 -delxs db 0 -delys db 0 -pointerframe db 0 -pointerpower db 0 -auxpointerframe db 0 -pointermode db 0 -pointerspeed db 0 -pointercount db 0 -inmaparea db 0 - -reelpointer dw 0 -slotdata db 0 -thisslot db 0 -slotflags db 0 -takeoff dw 0 - -talkmode db 0 -talkpos db 0 -character db 0 -persondata dw 0 -talknum db 0 -numberinroom db 0 - -currentcel db 0 -oldselection db 0 - -stopwalking db 0 - -mouseon db 0 -played dw 0 -timer1 db 0 -timer2 db 0 -timer3 db 0 -wholetimer dw 0 -timer1to db 0 -timer2to db 0 -timer3to db 0 - -watchdump db 0 - -currentset dw 0 - -logonum db 0 -oldlogonum db 0 -newlogonum db 0 -netseg dw 0 -netpoint dw 0 -keynum db 0 -cursorstate db 0 - -pressed db 0 -presspointer dw 0 -graphicpress db 0 -presscount db 0 -keypadax dw 0 -keypadcx dw 0 -lightcount db 0 -folderpage db 0 -diarypage db 0 -menucount db 0 -symboltopx db 0 -symboltopnum db 0 -symboltopdir db 0 -symbolbotx db 0 -symbolbotnum db 0 -symbolbotdir db 0 - -symboltolight db 0 -symbol1 db 0 -symbol2 db 0 -symbol3 db 0 -symbolnum db 0 -dumpx dw 0 -dumpy dw 0 - -walkandexam db 0 -walkexamtype db 0 -walkexamnum db 0 - -cursloc dw 0 -curslocx dw 0 -curslocy dw 0 -curpos dw 0 -monadx dw 0 -monady dw 0 -gotfrom dw 0 - -monsource dw 0 -numtodo dw 0 - -timecount dw 0 -counttotimed dw 0 -timedseg dw 0 -timedoffset dw 0 -timedy db 0 -timedx db 0 -needtodumptimed db 0 - -;recordpos dw 0 -;rechandle dw 0 -handle dw 0 - -loadingorsave db 0 ;1 if load 2 if save -currentslot db 0 -cursorpos db 0 - -colourpos db 0 -fadedirection db 0 -numtofade db 0 -fadecount db 0 -addtogreen db 0 -addtored db 0 -addtoblue db 0 - - -lastsoundreel dw 0 - -soundbuffer dw 0 -soundbufferad dw 0 -soundbufferpage db 0 -soundtimes db 0 -needsoundbuff db 0 - -oldint9seg dw -1 -oldint9add dw -1 -oldint8seg dw -1 -oldint8add dw -1 -oldsoundintseg dw 0 -oldsoundintadd dw 0 -soundbaseadd dw 0 -dsp_status dw 0 -dsp_write dw 0 -dmaaddress db 0 -soundint db 5 -sounddmachannel db 1 -sampleplaying db 255 -testresult db 0 -currentirq db 0 -speechloaded db 0 -speechlength dw 0 -volume db 0 -volumeto db 0 -volumedirection db 0 -volumecount db 0 - -playblock db 0 - -wongame db 0 - -lasthardkey db 0 -bufferin dw 0 -bufferout dw 0 - -extras dw 0 ;for allocated memory -workspace dw 0 ;allocated mem for screen buffer -mapstore dw 0 ;allocated mem for copy of room -charset1 dw 0 ;allocated mem for normal charset -tempcharset dw 0 ;monitor char set -icons1 dw 0 ;allocated mem for on screen stuff -icons2 dw 0 -buffers dw 0 ;allocated mem for buffers -mainsprites dw 0 ;allocated mem for Ryan sprites -backdrop dw 0 -mapdata dw 0 - -sounddata dw 0 -sounddata2 dw 0 - -recordspace dw 0 - -freedat dw 0 -setdat dw 0 - -reel1 dw -1 -reel2 dw -1 -reel3 dw -1 -roomdesc dw -1 -freedesc dw -1 -setdesc dw -1 -blockdesc dw -1 -setframes dw -1 -freeframes dw -1 -people dw -1 -reels dw -1 -commandtext dw -1 -puzzletext dw -1 -traveltext dw -1 -tempgraphics dw -1 -tempgraphics2 dw -1 -tempgraphics3 dw -1 -tempsprites dw -1 - -textfile1 dw -1 -textfile2 dw -1 -textfile3 dw -1 - -blinkframe db 23 -blinkcount db 0 - - -reasseschanges db 0 ; if it's a 1 then obname will assume that -pointerspath db 0 ;the command has changed. -manspath db 0 ;ie. from "walk to" to "Examine" -pointerfirstpath db 0 -finaldest db 0 -destination db 0 -linestartx dw 0 -linestarty dw 0 -lineendx dw 0 -lineendy dw 0 -increment1 dw 0 -increment2 dw 0 -lineroutine db 0 -linepointer db 0 -linedirection db 0 -linelength db 0 - -liftsoundcount db 0 - -emmhandle dw 0 -emmpageframe dw 0 -emmhardwarepage db 0 - -ch0emmpage dw 0 -ch0offset dw 0 -ch0blockstocopy dw 0 - -ch0playing db 0 -ch0repeat db 0 -ch0oldemmpage dw 0 -ch0oldoffset dw 0 -ch0oldblockstocopy dw 0 - -ch1playing db 255 -ch1emmpage dw 0 -ch1offset dw 0 -ch1blockstocopy dw 0 -ch1blocksplayed dw 0 - -soundbufferwrite dw 0 - -soundemmpage dw 0 -speechemmpage dw 0 - -currentsample db -1 -roomssample db 0 - -gameerror db 0 - -howmuchalloc dw 0 - +;---------------------------------------------------Equates and definitions---- + +Inputport equ 63h +Mapwidth equ 66 ;132/2 +Maplength equ 60 ;6/2 +Tablesize equ 32 ;size of each entry in spritetable +Itempicsize equ 44 ;size of inventory slots +Opsy equ 52 +Opsx equ 60 +Inventx equ 80 +Inventy equ 58 +Zoomx equ 8 +Zoomy equ 132 +Keypadx equ 36+112 +Keypady equ 72 +Diaryx equ 68+24 +Diaryy equ 48+12 +Symbolx equ 64 +Symboly equ 56 +Menux equ 80+40 +Menuy equ 60 + + if foreign +Undertextsizex equ 228 +Undertextsizey equ 13 +Undertimedysize equ 30 + else +Undertextsizex equ 180 +Undertextsizey equ 10 +Undertimedysize equ 24 + endif + +Numchanges equ 250 + +Textunder equ 0 ;offsets for items in buffer segment +Openinvlist equ textunder+(undertextsizex*undertextsizey) +Ryaninvlist equ openinvlist+32 +Pointerback equ ryaninvlist+60 +Mapflags equ pointerback+(32*32) +Startpal equ mapflags+(11*10*3) +Endpal equ startpal+768 +Maingamepal equ endpal+768 +Spritetable equ maingamepal+768 +Setlist equ spritetable+(32*tablesize) +Freelist equ setlist+(128*5) +Exlist equ freelist+(80*5) +Peoplelist equ exlist+(100*5) +Zoomspace equ peoplelist+(12*5) +Printedlist equ zoomspace+(46*40) +Listofchanges equ printedlist+(5*80) +Undertimedtext equ listofchanges+(numchanges*4) +Rainlist equ undertimedtext+(256*undertimedysize) +Initialreelrouts equ rainlist+(6*64) +Initialvars equ initialreelrouts+lenofreelrouts +Lengthofbuffer equ initialvars+lengthofvars + +Flags equ 0 ;offsets of items in backdrop segment +Blocks equ flags+192 +Map equ 0 +Lengthofmap equ map+(mapwidth*maplength) + +Intextdat equ 0 +Intext equ intextdat+(38*2) +Blocktextdat equ 0 +Blocktext equ blocktextdat+(98*2) +Settextdat equ 0 +Settext equ settextdat+(130*2) +Freetextdat equ 0 +Freetext equ freetextdat+(82*2) + +Numexobjects equ 114 +Exframeslen equ 30000 +Extextlen equ 18000 + +Exframedata equ 0 +Exframes equ exframedata+2080 +Exdata equ exframes+exframeslen +Extextdat equ exdata+(16*numexobjects) +Extext equ extextdat+((numexobjects+2)*2) +Lengthofextra equ extext+extextlen + +Framedata equ 0 +Frames equ framedata+2080 + +Frframedata equ 0 +Frframes equ frframedata+2080 + +Personframes equ 0 +Persontxtdat equ personframes+24 +Persontext equ persontxtdat+(1026*2) + +Pathdata equ 0 +Reellist equ pathdata+(36*144) + +Lenofmapstore equ 22*8*20*8 +Maplen equ mapwidth*maplength +Freedatlen equ 16*80 +Setdatlen equ 64*128 +Textstart equ 66*2 + +;-----------------------------------------------------------------Variables---- + + +startvars db 0 +progresspoints db 0 +watchon db 0 +shadeson db 0 +secondcount db 0 +minutecount db 30 +hourcount db 19 +zoomon db 1 +location db 0 +expos db 0 +exframepos dw 0 +extextpos dw 0 +card1money dw 0 +listpos dw 0 +ryanpage db 0 + + +watchingtime dw 0 +reeltowatch dw -1 ;reel plays from here in mode 0 +endwatchreel dw 0 ;and stops here. Mode set to 1 +speedcount db 0 +watchspeed db 0 +reeltohold dw -1 ;if mode is 1 hold on this reel +endofholdreel dw -1 ;if mode is 2 then play to end of +watchmode db -1 ;hold reel. Set mode back to -1 +destafterhold db 0 ;set walking destination. + +newsitem db 0 + +liftflag db 0 +liftpath db 0 +lockstatus db 1 +doorpath db 0 +counttoopen db 0 +counttoclose db 0 +rockstardead db 0 +generaldead db 0 +sartaindead db 0 +aidedead db 0 +beenmugged db 0 + +gunpassflag db 0 +canmovealtar db 0 +talkedtoattendant db 0 +talkedtosparky db 0 +talkedtoboss db 0 +talkedtorecep db 0 +cardpassflag db 0 +madmanflag db 0 +keeperflag db 0 +lasttrigger db 0 +mandead db 0 +seed db 1,2,3 +needtotravel db 0 +throughdoor db 0 +newobs db 0 +ryanon db 255 +combatcount db 0 +lastweapon db -1 + +dreamnumber db 0 +roomafterdream db 0 + +shakecounter db 48 + +lengthofvars equ $-startvars + + +speechcount db 0 + +charshift dw 0 +kerning db 0 + +brightness db 0 + +roomloaded db 0 + +didzoom db 0 + +linespacing dw 10 +textaddressx dw 13 +textaddressy dw 182 ;address on screen for text +textlen db 0 +lastxpos dw 0 + +icontop dw 0 +iconleft dw 0 +itemframe db 0 +itemtotran db 0 +roomad dw 0 +oldsubject dw 0 + +withobject db 0 +withtype db 0 + +lookcounter dw 0 + +command db 0 +commandtype db 0 +oldcommandtype db 0 +objecttype db 0 +getback db 0 +invopen db 0 +mainmode db 0 +pickup db 0 +lastinvpos db 0 +examagain db 0 +newtextline db 0 + +openedob db 0 +openedtype db 0 + +oldmapadx dw 0 +oldmapady dw 0 +mapadx dw 0 +mapady dw 0 +mapoffsetx dw 104 +mapoffsety dw 38 + +mapxstart dw 0 +mapystart dw 0 +mapxsize db 0 +mapysize db 0 + +havedoneobs db 0 +manisoffscreen db 0 +rainspace db 0 + +facing db 0 +leavedirection db 0 +turntoface db 0 +turndirection db 0 + +maintimer dw 0 +introcount db 0 +arrowad dw 0 +currentkey db 0 +oldkey db 0 +useddirection db 0 +currentkey2 db 0 + +timercount db 0 +oldtimercount db 0 + +mapx db 0 +mapy db 0 +newscreen db 0 +ryanx db 0 +ryany db 0 +lastflag db 0 +lastflagex db 0 +flagx db 0 +flagy db 0 + +currentex db 0 +currentfree db 0 +currentframe dw 0 +framesad dw 0 +dataad dw 0 +frsegment dw 0 +objectx dw 0 +objecty dw 0 +offsetx dw 0 +offsety dw 0 +savesize dw 0 +savesource dw 0 +savex db 0 +savey db 0 +currentob db 0 +priority db 0 + +destpos db 0 + +reallocation db 0 ;----------;some rooms have more than one +roomnum db 0 ;place in the Roomdata list, to + ;account for different start points +nowinnewroom db 0 ;this variable holds the rooms +resetmanxy db 0 ;real value - ie:which file it's in +newlocation db -1 ;if set then room is loaded at end of watch mode, or straight away if not in watch mode +autolocation db -1 +mustload db 0 +answered db 0 +saidno db 0 + +doorcheck1 db 0 +doorcheck2 db 0 +doorcheck3 db 0 +doorcheck4 db 0 + +mousex dw 0 +mousey dw 0 +mousebutton dw 0 +mousebutton1 dw 0 +mousebutton2 dw 0 +mousebutton3 dw 0 +mousebutton4 dw 0 +oldbutton dw 0 +oldx dw 0 +oldy dw 0 +lastbutton dw 0 +oldpointerx dw 0 +oldpointery dw 0 +delherex dw 0 +delherey dw 0 +pointerxs db 32 +pointerys db 32 +delxs db 0 +delys db 0 +pointerframe db 0 +pointerpower db 0 +auxpointerframe db 0 +pointermode db 0 +pointerspeed db 0 +pointercount db 0 +inmaparea db 0 + +reelpointer dw 0 +slotdata db 0 +thisslot db 0 +slotflags db 0 +takeoff dw 0 + +talkmode db 0 +talkpos db 0 +character db 0 +persondata dw 0 +talknum db 0 +numberinroom db 0 + +currentcel db 0 +oldselection db 0 + +stopwalking db 0 + +mouseon db 0 +played dw 0 +timer1 db 0 +timer2 db 0 +timer3 db 0 +wholetimer dw 0 +timer1to db 0 +timer2to db 0 +timer3to db 0 + +watchdump db 0 + +currentset dw 0 + +logonum db 0 +oldlogonum db 0 +newlogonum db 0 +netseg dw 0 +netpoint dw 0 +keynum db 0 +cursorstate db 0 + +pressed db 0 +presspointer dw 0 +graphicpress db 0 +presscount db 0 +keypadax dw 0 +keypadcx dw 0 +lightcount db 0 +folderpage db 0 +diarypage db 0 +menucount db 0 +symboltopx db 0 +symboltopnum db 0 +symboltopdir db 0 +symbolbotx db 0 +symbolbotnum db 0 +symbolbotdir db 0 + +symboltolight db 0 +symbol1 db 0 +symbol2 db 0 +symbol3 db 0 +symbolnum db 0 +dumpx dw 0 +dumpy dw 0 + +walkandexam db 0 +walkexamtype db 0 +walkexamnum db 0 + +cursloc dw 0 +curslocx dw 0 +curslocy dw 0 +curpos dw 0 +monadx dw 0 +monady dw 0 +gotfrom dw 0 + +monsource dw 0 +numtodo dw 0 + +timecount dw 0 +counttotimed dw 0 +timedseg dw 0 +timedoffset dw 0 +timedy db 0 +timedx db 0 +needtodumptimed db 0 + +;recordpos dw 0 +;rechandle dw 0 +handle dw 0 + +loadingorsave db 0 ;1 if load 2 if save +currentslot db 0 +cursorpos db 0 + +colourpos db 0 +fadedirection db 0 +numtofade db 0 +fadecount db 0 +addtogreen db 0 +addtored db 0 +addtoblue db 0 + + +lastsoundreel dw 0 + +soundbuffer dw 0 +soundbufferad dw 0 +soundbufferpage db 0 +soundtimes db 0 +needsoundbuff db 0 + +oldint9seg dw -1 +oldint9add dw -1 +oldint8seg dw -1 +oldint8add dw -1 +oldsoundintseg dw 0 +oldsoundintadd dw 0 +soundbaseadd dw 0 +dsp_status dw 0 +dsp_write dw 0 +dmaaddress db 0 +soundint db 5 +sounddmachannel db 1 +sampleplaying db 255 +testresult db 0 +currentirq db 0 +speechloaded db 0 +speechlength dw 0 +volume db 0 +volumeto db 0 +volumedirection db 0 +volumecount db 0 + +playblock db 0 + +wongame db 0 + +lasthardkey db 0 +bufferin dw 0 +bufferout dw 0 + +extras dw 0 ;for allocated memory +workspace dw 0 ;allocated mem for screen buffer +mapstore dw 0 ;allocated mem for copy of room +charset1 dw 0 ;allocated mem for normal charset +tempcharset dw 0 ;monitor char set +icons1 dw 0 ;allocated mem for on screen stuff +icons2 dw 0 +buffers dw 0 ;allocated mem for buffers +mainsprites dw 0 ;allocated mem for Ryan sprites +backdrop dw 0 +mapdata dw 0 + +sounddata dw 0 +sounddata2 dw 0 + +recordspace dw 0 + +freedat dw 0 +setdat dw 0 + +reel1 dw -1 +reel2 dw -1 +reel3 dw -1 +roomdesc dw -1 +freedesc dw -1 +setdesc dw -1 +blockdesc dw -1 +setframes dw -1 +freeframes dw -1 +people dw -1 +reels dw -1 +commandtext dw -1 +puzzletext dw -1 +traveltext dw -1 +tempgraphics dw -1 +tempgraphics2 dw -1 +tempgraphics3 dw -1 +tempsprites dw -1 + +textfile1 dw -1 +textfile2 dw -1 +textfile3 dw -1 + +blinkframe db 23 +blinkcount db 0 + + +reasseschanges db 0 ; if it's a 1 then obname will assume that +pointerspath db 0 ;the command has changed. +manspath db 0 ;ie. from "walk to" to "Examine" +pointerfirstpath db 0 +finaldest db 0 +destination db 0 +linestartx dw 0 +linestarty dw 0 +lineendx dw 0 +lineendy dw 0 +increment1 dw 0 +increment2 dw 0 +lineroutine db 0 +linepointer db 0 +linedirection db 0 +linelength db 0 + +liftsoundcount db 0 + +emmhandle dw 0 +emmpageframe dw 0 +emmhardwarepage db 0 + +ch0emmpage dw 0 +ch0offset dw 0 +ch0blockstocopy dw 0 + +ch0playing db 0 +ch0repeat db 0 +ch0oldemmpage dw 0 +ch0oldoffset dw 0 +ch0oldblockstocopy dw 0 + +ch1playing db 255 +ch1emmpage dw 0 +ch1offset dw 0 +ch1blockstocopy dw 0 +ch1blocksplayed dw 0 + +soundbufferwrite dw 0 + +soundemmpage dw 0 +speechemmpage dw 0 + +currentsample db -1 +roomssample db 0 + +gameerror db 0 + +howmuchalloc dw 0 +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm index e4a5b97c45..26874a428f 100644 --- a/devtools/tasmrecover/dreamweb/vgafades.asm +++ b/devtools/tasmrecover/dreamweb/vgafades.asm @@ -1,867 +1,867 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Fadedos proc near - - call vsync - mov es,buffers - mov di,startpal - mov al,0 - mov dx,3c7h - out dx,al - mov dx,3c9h - mov cx,768/4 -dos1: in al,dx - stosb - loop dos1 - - mov cx,64 -fadedosloop: push cx - - mov ds,buffers - mov si,startpal - mov cx,768 -dos3: lodsb - cmp al,0 - jz nodown - dec al -nodown: mov [si-1],al - loop dos3 - - call vsync - mov ds,buffers - mov si,startpal - mov al,0 - mov dx,3c8h - out dx,al - inc dx - mov cx,768/4 -dos2: lodsb - out dx,al - loop dos2 - - pop cx - loop fadedosloop - ret - - endp - - - - - - - - - - - -Dofade proc near - - cmp fadedirection,0 - jz finishfade - mov cl,numtofade - mov ch,0 - mov al,colourpos - mov ah,0 - mov ds,buffers - mov si,startpal - add si,ax - add si,ax - add si,ax - call showgroup - mov al,numtofade - add al,colourpos - mov colourpos,al - cmp al,0 - jnz finishfade - call fadecalculation -finishfade: ret - - endp - - - - - - - -Clearendpal proc near - - mov es,buffers - mov di,endpal - mov cx,768 - mov al,0 - rep stosb - ret - - endp - - - - -Clearpalette proc near - - mov fadedirection,0 - call clearstartpal - call dumpcurrent - ret - - endp - - - - - - - - - - -Fadescreenup proc near - - call clearstartpal - call paltoendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - ret - - endp - - - - -Fadetowhite proc near - - mov es,buffers - mov di,endpal - mov cx,768 - mov al,63 - rep stosb - mov di,endpal - mov al,0 - stosb - stosb - stosb - call paltostartpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - ret - - endp - - - -Fadefromwhite proc near - - mov es,buffers - mov di,startpal - mov cx,768 - mov al,63 - rep stosb - mov di,startpal - mov al,0 - stosb - stosb - stosb - call paltoendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - ret - - endp - - - - - - - - - -Fadescreenups proc near - - call clearstartpal - call paltoendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,64 - ret - - endp - - - -Fadescreendownhalf proc near - - call paltostartpal - call paltoendpal - mov cx,768 - mov es,buffers - mov bx,endpal -halfend: mov al,[es:bx] - shr al,1 - mov [es:bx],al - inc bx - loop halfend - - mov ds,buffers - mov es,buffers - mov si,startpal+(56*3) - mov di,endpal+(56*3) - mov cx,3*5 - rep movsb - mov si,startpal+(77*3) - mov di,endpal+(77*3) - mov cx,3*2 - rep movsb - - mov fadedirection,1 - mov fadecount,31 - mov colourpos,0 - mov numtofade,32 - ret - - endp - - -Fadescreenuphalf proc near - - call endpaltostart - call paltoendpal - mov fadedirection,1 - mov fadecount,31 - mov colourpos,0 - mov numtofade,32 - ret - - endp - - - - - - - - - - -Fadescreendown proc near - - call paltostartpal - call clearendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - ret - - endp - - - -Fadescreendowns proc near - - call paltostartpal - call clearendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,64 - ret - - endp - - - - - - - - -Clearstartpal proc near - - mov es,buffers - mov di,startpal - mov cx,256 -wholeloop1: mov ax,0 - stosw - mov al,0 - stosb - loop wholeloop1 - ret - - endp - - - - - - -Showgun proc near - - mov addtored,0 ;12 - mov addtogreen,0 - mov addtoblue,0 - call paltostartpal - call paltoendpal - call greyscalesum - -; mov es,buffers -; mov di,endpal+3 -; mov cx,255 -; mov ax,0 -;reds: mov byte ptr [es:di],63 -; inc di -; stosw -; loop reds - - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,130 - call hangon - call endpaltostart - call clearendpal - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,200 - call hangon - mov roomssample,34 - call loadroomssample - mov volume,0 - mov dx,offset cs:gungraphic - call loadintotemp - call createpanel2 - mov ds,tempgraphics - mov al,0 - mov ah,0 - mov di,100 - mov bx,4 - call showframe - mov ds,tempgraphics - mov al,1 - mov ah,0 - mov di,158 - mov bx,106 - call showframe - call worktoscreen - call getridoftemp - call fadescreenup - mov cx,160 - call hangon - mov al,12 - mov ah,0 - call playchannel0 - mov dx,offset cs:endtextname - call loadtemptext - call rollendcredits2 - call getridoftemptext - ret - - endp - - - - - -Rollendcredits2 proc near - - call rollem - ret - - endp - - - - -Rollem proc near - - mov cl,160 - mov ch,160 - mov di,25 - mov bx,20 - mov ds,mapstore - mov si,0 - call multiget - - mov es,textfile1 - mov si,49*2 - mov ax,[es:si] - mov si,ax - add si,textstart - - mov cx,80 -endcredits21: push cx - - mov bx,10 - mov cx,linespacing -endcredits22: push cx si di es bx - - call vsync - mov cl,160 - mov ch,160 - mov di,25 - mov bx,20 - mov ds,mapstore - mov si,0 - call multiput - call vsync - pop bx es di si - push si di es bx - - mov cx,18 -onelot2: push cx - mov di,25 ;75 - mov dx,161 - mov ax,0 - call printdirect - add bx,linespacing - pop cx - loop onelot2 - - call vsync - mov cl,160 - mov ch,160 - mov di,25 ;75 - mov bx,20 - call multidump - - pop bx es di si cx - cmp lasthardkey,1 - jz endearly2 - dec bx - loop endcredits22 - pop cx -looknext2: mov al,[es:si] - inc si - cmp al,":" - jz gotnext2 - cmp al,0 - jz gotnext2 - jmp looknext2 -gotnext2: cmp lasthardkey,1 - jz endearly - loop endcredits21 - - mov cx,120 - call hangone - ret -endearly2: pop cx -endearly: ret - - endp - - - - - - - - - -Fadecalculation proc near - - cmp fadecount,0 - jz nomorefading - mov bl,fadecount - mov es,buffers - mov si,startpal - mov di,endpal - mov cx,768 -fadecolloop: mov al,[es:si] - mov ah,[es:di] - cmp al,ah - jz gotthere - jc lesscolour - dec byte ptr [es:si] - jmp gotthere -lesscolour: cmp bl,ah - jz withit - jnc gotthere -withit: inc byte ptr [es:si] -gotthere: inc si - inc di - loop fadecolloop - dec fadecount - ret -nomorefading: mov fadedirection,0 - ret - - endp - - - - - - - - - - - - - - - - - - - - - - - - -Greyscalesum proc near ;converts palette to grey scale - ;summed using formula: - mov es,buffers ; .20xred + .59xGreen + .11xBlue - mov si,maingamepal - mov di,endpal - mov cx,256 ;convert 256 colours - -greysumloop1: push cx - mov bx,0 - mov al,[es:si] - mov ah,0 - mov cx,20 - mul cx - add bx,ax - mov al,[es:si+1] - mov ah,0 - mov cx,59 - mul cx - add bx,ax - mov al,[es:si+2] - mov ah,0 - mov cx,11 - mul cx - add bx,ax ;bx holds equationx100 - - mov al,-1 ;divide result by 100 -greysumloop2: inc al - sub bx,100 - jnc greysumloop2 ;ah holds grey scale number - mov bl,al - - mov al,bl - mov ah,addtored - cmp al,0 - ;jz noaddr - add al,ah -noaddr: stosb - mov ah,addtogreen - mov al,bl - cmp al,0 - jz noaddg - add al,ah -noaddg: stosb ;store result in red, green and - mov ah,addtoblue - mov al,bl - cmp al,0 - jz noaddb - add al,ah -noaddb: stosb ;blue portions of palette. - - add si,3 - pop cx - loop greysumloop1 - ret - - endp - - - - - - - - - - - - - - - - - - - - - - -Showgroup proc near - - mov dx,3c8h - out dx,al - mov dx,3c9h -showgroup1: lodsb - out dx,al - lodsb - out dx,al - lodsb - out dx,al - loop showgroup1 - ret - - endp - - - - - -Paltostartpal proc near - - mov es,buffers - mov ds,buffers - mov si,maingamepal - mov di,startpal - mov cx,768/2 - rep movsw - ret - - endp - - - -Endpaltostart proc near - - mov es,buffers - mov ds,buffers - mov si,endpal - mov di,startpal - mov cx,768/2 - rep movsw - ret - - endp - - -Startpaltoend proc near - - mov es,buffers - mov ds,buffers - mov di,endpal - mov si,startpal - mov cx,768/2 - rep movsw - ret - - endp - - - - - - - - -Paltoendpal proc near - - mov es,buffers - mov ds,buffers - mov di,endpal - mov si,maingamepal - mov cx,768/2 - rep movsw - ret - - endp - - - - - - - - - - - - - -Allpalette proc near - - mov es,buffers - mov ds,buffers - mov di,startpal - mov si,maingamepal - mov cx,768/2 - rep movsw - call dumpcurrent - ret - - endp - - - - - -Dumpcurrent proc near - - mov si,startpal - mov ds,buffers - call vsync - mov al,0 - mov cx,128 - call showgroup - call vsync - mov al,128 - mov cx,128 - call showgroup - ret - - endp - - - - - - - - - - - -Fadedownmon proc near - - call paltostartpal - call paltoendpal - mov es,buffers - mov di,endpal+(231*3) - mov cx,3*8 - mov ax,0 - rep stosb - mov di,endpal+(246*3) - stosb - stosw - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,64 ;100 - call hangon ;curs - ret - - endp - - - - - -Fadeupmon proc near - - call paltostartpal - call paltoendpal - mov es,buffers - mov di,startpal+(231*3) - mov cx,3*8 - mov ax,0 - rep stosb - mov di,startpal+(246*3) - stosb - stosw - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,128 - call hangon ;curs - ret - - endp - - - - - -Fadeupmonfirst proc near - - call paltostartpal - call paltoendpal - mov es,buffers - mov di,startpal+(231*3) - mov cx,3*8 - mov ax,0 - rep stosb - mov di,startpal+(246*3) - stosb - stosw - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,64 - call hangon - mov al,26 - call playchannel1 - mov cx,64 - call hangon - - ret - - endp - - - - - - - -Fadeupyellows proc near - - ;call startpaltoend - call paltoendpal - mov es,buffers - mov di,endpal+(231*3) - mov cx,3*8 - mov ax,0 - rep stosb - mov di,endpal+(246*3) - stosb - stosw - mov fadedirection,1 - mov fadecount,63 - mov colourpos,0 - mov numtofade,128 - mov cx,128 - call hangon - ret - - endp - - - -Initialmoncols proc near - - call paltostartpal - mov es,buffers - mov di,startpal+(230*3) - mov cx,3*9 - mov ax,0 - rep stosb - mov di,startpal+(246*3) - stosb - stosw - mov ds,buffers - mov si,startpal+(230*3) - mov al,230 - mov cx,18 - call showgroup - ret - - endp - - +Fadedos proc near + + call vsync + mov es,buffers + mov di,startpal + mov al,0 + mov dx,3c7h + out dx,al + mov dx,3c9h + mov cx,768/4 +dos1: in al,dx + stosb + loop dos1 + + mov cx,64 +fadedosloop: push cx + + mov ds,buffers + mov si,startpal + mov cx,768 +dos3: lodsb + cmp al,0 + jz nodown + dec al +nodown: mov [si-1],al + loop dos3 + + call vsync + mov ds,buffers + mov si,startpal + mov al,0 + mov dx,3c8h + out dx,al + inc dx + mov cx,768/4 +dos2: lodsb + out dx,al + loop dos2 + + pop cx + loop fadedosloop + ret + + endp + + + + + + + + + + + +Dofade proc near + + cmp fadedirection,0 + jz finishfade + mov cl,numtofade + mov ch,0 + mov al,colourpos + mov ah,0 + mov ds,buffers + mov si,startpal + add si,ax + add si,ax + add si,ax + call showgroup + mov al,numtofade + add al,colourpos + mov colourpos,al + cmp al,0 + jnz finishfade + call fadecalculation +finishfade: ret + + endp + + + + + + + +Clearendpal proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,0 + rep stosb + ret + + endp + + + + +Clearpalette proc near + + mov fadedirection,0 + call clearstartpal + call dumpcurrent + ret + + endp + + + + + + + + + + +Fadescreenup proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + +Fadetowhite proc near + + mov es,buffers + mov di,endpal + mov cx,768 + mov al,63 + rep stosb + mov di,endpal + mov al,0 + stosb + stosb + stosb + call paltostartpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadefromwhite proc near + + mov es,buffers + mov di,startpal + mov cx,768 + mov al,63 + rep stosb + mov di,startpal + mov al,0 + stosb + stosb + stosb + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + + + + + + + +Fadescreenups proc near + + call clearstartpal + call paltoendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + +Fadescreendownhalf proc near + + call paltostartpal + call paltoendpal + mov cx,768 + mov es,buffers + mov bx,endpal +halfend: mov al,[es:bx] + shr al,1 + mov [es:bx],al + inc bx + loop halfend + + mov ds,buffers + mov es,buffers + mov si,startpal+(56*3) + mov di,endpal+(56*3) + mov cx,3*5 + rep movsb + mov si,startpal+(77*3) + mov di,endpal+(77*3) + mov cx,3*2 + rep movsb + + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + +Fadescreenuphalf proc near + + call endpaltostart + call paltoendpal + mov fadedirection,1 + mov fadecount,31 + mov colourpos,0 + mov numtofade,32 + ret + + endp + + + + + + + + + + +Fadescreendown proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + ret + + endp + + + +Fadescreendowns proc near + + call paltostartpal + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,64 + ret + + endp + + + + + + + + +Clearstartpal proc near + + mov es,buffers + mov di,startpal + mov cx,256 +wholeloop1: mov ax,0 + stosw + mov al,0 + stosb + loop wholeloop1 + ret + + endp + + + + + + +Showgun proc near + + mov addtored,0 ;12 + mov addtogreen,0 + mov addtoblue,0 + call paltostartpal + call paltoendpal + call greyscalesum + +; mov es,buffers +; mov di,endpal+3 +; mov cx,255 +; mov ax,0 +;reds: mov byte ptr [es:di],63 +; inc di +; stosw +; loop reds + + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,130 + call hangon + call endpaltostart + call clearendpal + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,200 + call hangon + mov roomssample,34 + call loadroomssample + mov volume,0 + mov dx,offset cs:gungraphic + call loadintotemp + call createpanel2 + mov ds,tempgraphics + mov al,0 + mov ah,0 + mov di,100 + mov bx,4 + call showframe + mov ds,tempgraphics + mov al,1 + mov ah,0 + mov di,158 + mov bx,106 + call showframe + call worktoscreen + call getridoftemp + call fadescreenup + mov cx,160 + call hangon + mov al,12 + mov ah,0 + call playchannel0 + mov dx,offset cs:endtextname + call loadtemptext + call rollendcredits2 + call getridoftemptext + ret + + endp + + + + + +Rollendcredits2 proc near + + call rollem + ret + + endp + + + + +Rollem proc near + + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiget + + mov es,textfile1 + mov si,49*2 + mov ax,[es:si] + mov si,ax + add si,textstart + + mov cx,80 +endcredits21: push cx + + mov bx,10 + mov cx,linespacing +endcredits22: push cx si di es bx + + call vsync + mov cl,160 + mov ch,160 + mov di,25 + mov bx,20 + mov ds,mapstore + mov si,0 + call multiput + call vsync + pop bx es di si + push si di es bx + + mov cx,18 +onelot2: push cx + mov di,25 ;75 + mov dx,161 + mov ax,0 + call printdirect + add bx,linespacing + pop cx + loop onelot2 + + call vsync + mov cl,160 + mov ch,160 + mov di,25 ;75 + mov bx,20 + call multidump + + pop bx es di si cx + cmp lasthardkey,1 + jz endearly2 + dec bx + loop endcredits22 + pop cx +looknext2: mov al,[es:si] + inc si + cmp al,":" + jz gotnext2 + cmp al,0 + jz gotnext2 + jmp looknext2 +gotnext2: cmp lasthardkey,1 + jz endearly + loop endcredits21 + + mov cx,120 + call hangone + ret +endearly2: pop cx +endearly: ret + + endp + + + + + + + + + +Fadecalculation proc near + + cmp fadecount,0 + jz nomorefading + mov bl,fadecount + mov es,buffers + mov si,startpal + mov di,endpal + mov cx,768 +fadecolloop: mov al,[es:si] + mov ah,[es:di] + cmp al,ah + jz gotthere + jc lesscolour + dec byte ptr [es:si] + jmp gotthere +lesscolour: cmp bl,ah + jz withit + jnc gotthere +withit: inc byte ptr [es:si] +gotthere: inc si + inc di + loop fadecolloop + dec fadecount + ret +nomorefading: mov fadedirection,0 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + + + +Greyscalesum proc near ;converts palette to grey scale + ;summed using formula: + mov es,buffers ; .20xred + .59xGreen + .11xBlue + mov si,maingamepal + mov di,endpal + mov cx,256 ;convert 256 colours + +greysumloop1: push cx + mov bx,0 + mov al,[es:si] + mov ah,0 + mov cx,20 + mul cx + add bx,ax + mov al,[es:si+1] + mov ah,0 + mov cx,59 + mul cx + add bx,ax + mov al,[es:si+2] + mov ah,0 + mov cx,11 + mul cx + add bx,ax ;bx holds equationx100 + + mov al,-1 ;divide result by 100 +greysumloop2: inc al + sub bx,100 + jnc greysumloop2 ;ah holds grey scale number + mov bl,al + + mov al,bl + mov ah,addtored + cmp al,0 + ;jz noaddr + add al,ah +noaddr: stosb + mov ah,addtogreen + mov al,bl + cmp al,0 + jz noaddg + add al,ah +noaddg: stosb ;store result in red, green and + mov ah,addtoblue + mov al,bl + cmp al,0 + jz noaddb + add al,ah +noaddb: stosb ;blue portions of palette. + + add si,3 + pop cx + loop greysumloop1 + ret + + endp + + + + + + + + + + + + + + + + + + + + + + +Showgroup proc near + + mov dx,3c8h + out dx,al + mov dx,3c9h +showgroup1: lodsb + out dx,al + lodsb + out dx,al + lodsb + out dx,al + loop showgroup1 + ret + + endp + + + + + +Paltostartpal proc near + + mov es,buffers + mov ds,buffers + mov si,maingamepal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + +Endpaltostart proc near + + mov es,buffers + mov ds,buffers + mov si,endpal + mov di,startpal + mov cx,768/2 + rep movsw + ret + + endp + + +Startpaltoend proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,startpal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + +Paltoendpal proc near + + mov es,buffers + mov ds,buffers + mov di,endpal + mov si,maingamepal + mov cx,768/2 + rep movsw + ret + + endp + + + + + + + + + + + + + +Allpalette proc near + + mov es,buffers + mov ds,buffers + mov di,startpal + mov si,maingamepal + mov cx,768/2 + rep movsw + call dumpcurrent + ret + + endp + + + + + +Dumpcurrent proc near + + mov si,startpal + mov ds,buffers + call vsync + mov al,0 + mov cx,128 + call showgroup + call vsync + mov al,128 + mov cx,128 + call showgroup + ret + + endp + + + + + + + + + + + +Fadedownmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 ;100 + call hangon ;curs + ret + + endp + + + + + +Fadeupmon proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon ;curs + ret + + endp + + + + + +Fadeupmonfirst proc near + + call paltostartpal + call paltoendpal + mov es,buffers + mov di,startpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,64 + call hangon + mov al,26 + call playchannel1 + mov cx,64 + call hangon + + ret + + endp + + + + + + + +Fadeupyellows proc near + + ;call startpaltoend + call paltoendpal + mov es,buffers + mov di,endpal+(231*3) + mov cx,3*8 + mov ax,0 + rep stosb + mov di,endpal+(246*3) + stosb + stosw + mov fadedirection,1 + mov fadecount,63 + mov colourpos,0 + mov numtofade,128 + mov cx,128 + call hangon + ret + + endp + + + +Initialmoncols proc near + + call paltostartpal + mov es,buffers + mov di,startpal+(230*3) + mov cx,3*9 + mov ax,0 + rep stosb + mov di,startpal+(246*3) + stosb + stosw + mov ds,buffers + mov si,startpal+(230*3) + mov al,230 + mov cx,18 + call showgroup + ret + + endp + +  \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm index 4c89412952..1d8e5f5dc7 100644 --- a/devtools/tasmrecover/dreamweb/vgagrafx.asm +++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm @@ -1,1763 +1,1763 @@ ;Copyright (c) 1990-2011 by Neil Dodwell ;Released with permission from Neil Dodwell under GPLv2 ;See LICENSE file for full license text -Screenwidth equ 320 ;physical width of screen - - - -Allocatework proc near - - mov bx,1000h - call allocatemem - mov workspace,ax - ret - - endp - - - - - -Showpcx proc near - - call openfile - mov bx,handle - mov ds,workspace - mov ah,3fh - mov cx,128 - mov dx,0 - int 21h - - mov ds,workspace - mov si,16 - mov cx,48 - mov es,buffers - mov di,maingamepal -pcxpal: push cx - call readabyte - shr al,1 - shr al,1 - stosb - pop cx - loop pcxpal - mov cx,768-48 - mov ax,0ffffh - rep stosw - - call readoneblock - mov si,0 - mov di,0 - mov cx,480 -convertpcx: push cx - push di - mov ds,workspace - mov es,buffers - mov di,pointerback - mov bx,0 -sameline: call readabyte - mov ah,al - and ah,11000000b - cmp ah,11000000b - jnz normal - mov cl,al - and cl,00111111b - mov ch,0 - push cx - call readabyte - pop cx - add bx,cx - rep stosb - cmp bx,4*80 - jnz sameline - jmp endline -normal: stosb - inc bx - cmp bx,4*80 - jnz sameline - -endline: pop di - push si - mov dx,0a000h - mov es,dx - mov si,pointerback - mov ds,buffers - - mov dx,03c4h - mov al,2 - mov ah,1 - out dx,ax - mov cx,40 - push di - rep movsw - pop di - mov ah,2 - out dx,ax - mov cx,40 - push di - rep movsw - pop di - mov ah,4 - out dx,ax - mov cx,40 - push di - rep movsw - pop di - mov ah,8 - out dx,ax - mov cx,40 - rep movsw - - pop si - pop cx - loop convertpcx - - mov bx,handle - call closefile - ret - - endp - - - - -Readabyte proc near - - cmp si,30000 - jnz notendblock - push bx es di ds si - call readoneblock - pop si ds di es bx - mov si,0 -notendblock: lodsb - ret - - endp - - - - -Readoneblock proc near - - mov bx,handle - mov ah,3fh - mov ds,workspace - mov ah,3fh - mov cx,30000 - mov dx,0 - int 21h - ret - - endp - - - - - - - - -Loadpalfromiff proc near - - mov dx,offset cs:palettescreen - call openfile - mov cx,2000 - mov ds,mapstore - mov dx,0 - call readfromfile - call closefile - mov es,buffers - mov di,maingamepal - mov ds,mapstore - mov si,30h - mov cx,768 -palloop: lodsb - shr al,1 - shr al,1 - - cmp brightness,1 - jnz nought - cmp al,0 - jz nought - mov ah,al - shr ah,1 - add al,ah - shr ah,1 - add al,ah - cmp al,64 - jc nought - mov al,63 - -nought: stosb - loop palloop - ret - - endp - - - - - - -Setmode proc near - - call vsync - mov ah,12h - mov al,1 - mov bl,33h - int 10h - - mov ah,0 - mov al,13h - int 10h - - mov al,6 ; sets graphic controller - mov dx,3ceh ; register 6 (MM) to 1 - 64K - out dx,al - inc dx - in al,dx - and al,11110011b - or al,00000100b - out dx,al - - mov al,4 ; sets sequencer - mov dx,3c4h ; register 4 (EM) to 1 - >64K - out dx,al - inc dx - in al,dx - and al,11111101b - or al,00000010b - out dx,al - - mov al,13h ;give screen 16 extra hidden - mov dx,3d4h ;pixels at one side - out dx,al - inc dx - mov al,screenwidth/8 ; width of screen - out dx,al - - mov al,8h - mov dx,3d4h - out dx,al - inc dx - mov al,00000000b - out dx,al - - mov al,11h - mov dx,3d4h - out dx,al - inc dx - in al,dx - or al,128 - out dx,al - - mov al,00 - mov dx,3d4h - out dx,al - inc dx - mov al,3fh - out dx,al - mov al,01 - mov dx,3d4h - out dx,al - inc dx - mov al,3fh - out dx,al - ret - - endp - - - -Cls proc near - - mov ax,0a000h - mov es,ax - mov di,0 - mov cx,7fffh - mov ax,0 - rep stosw - ret - - endp - - - -Printundermon proc near ;prints workspace through the text - - mov si,(screenwidth*43)+76 - mov di,si - mov es,workspace - add si,8*screenwidth - mov dx,0a000h - mov ds,dx - mov cx,104 -scrollmonloop1: push cx di si - mov cx,170 -scrollmonloop2: lodsb - cmp al,231 - jnc dontplace -placeit: stosb - loop scrollmonloop2 - jmp finmonscroll -dontplace: inc di - loop scrollmonloop2 - -finmonscroll: pop si di cx - add si,screenwidth - add di,screenwidth - loop scrollmonloop1 - ret - - endp - - - - - - - - -Worktoscreen proc near - - call vsync - mov si,0 - mov di,0 - mov cx,25 - mov ds,workspace - mov dx,0a000h - mov es,dx - -dumpallloop: call width160 - call width160 - call width160 - call width160 - call width160 - call width160 - call width160 - call width160 - loop dumpallloop - - ret - - endp - - - - - - - - - -; -;Worktoscreen2 proc near -; -; call showpointer -; -; mov ds,workspace -; mov dx,0a000h -; mov es,dx -; -; mov si,320-16 -; mov di,320-16 -; mov bl,33 -; mov cx,16 -;screen2loop1: push di si cx -; call vsync -; cmp bl,21 -; jc screen2loop2 -; sub cx,16 -; jz isoneblock -;screen2loop2: movsw -; movsw -; movsw -; movsw -; movsw -; movsw -; movsw -; movsw -; add di,320-15 -; add si,320-15 -; loop screen2loop2 -;isoneblock: mov cx,16 -; mov ax,320-15 -;oneblockloop: push cx -; rep movsb -; pop cx -; add si,ax -; add di,ax -; inc ax -; loop oneblockloop -; -; pop cx si di -; add cx,16 -; cmp cx,200 -; jc itsallright -; mov cx,200 -;itsallright: sub si,16 -; sub di,16 -; dec bl -; jnz screen2loop1 -; -; call delpointer -; ret -; -; endp -; -; -; -; - - - - -Paneltomap proc near - - mov di,mapxstart - add di,mapadx - mov bx,mapystart - add bx,mapady - mov ds,mapstore - mov si,0 - mov cl,mapxsize - mov ch,mapysize - call multiget - ret - - endp - - - -Maptopanel proc near - - mov di,mapxstart - add di,mapadx - mov bx,mapystart - add bx,mapady - mov ds,mapstore - mov si,0 - mov cl,mapxsize - mov ch,mapysize - call multiput - - ret - - endp - - - - - -Dumpmap proc near - - mov di,mapxstart - add di,mapadx - mov bx,mapystart - add bx,mapady - mov cl,mapxsize - mov ch,mapysize - call multidump - ret - - endp - - - - -Pixelcheckset proc near ;al=x, ah=y, es:bx=setlist pos - ;checks exact pixel in a frame - push ax - sub al,[es:bx] ;for detection. - sub ah,[es:bx+1] ;al,ah now holds offset within - ;the frame - push es bx cx ax - mov al,[es:bx+4] ;object number - call getsetad - mov al,[es:bx+17] ;finds frame number - mov es,setframes - mov bx,framedata - mov ah,0 - mov cx,6 - mul cx - add bx,ax ;get data for this frame in es:bx - pop ax - - push ax - mov al,ah - mov ah,0 - mov cl,[es:bx] - mov ch,0 - mul cx - pop cx - mov ch,0 - add ax,cx ;ax now holds offset from corner - ;of the frame - add ax,[es:bx+2] - mov bx,ax ;es:bx now holds offset of pixel! - add bx,frames - - mov al,[es:bx] - mov dl,al - pop cx bx es ax - cmp dl,0 - ret - - endp - - - - - - - - - - - - -Createpanel proc near - - mov di,0 - mov bx,8 - mov ds,icons2 - mov al,0 - mov ah,2 - call showframe ;spritef - mov di,160 - mov bx,8 - mov ds,icons2 - mov al,0 - mov ah,2 - call showframe ;spritef - mov di,0 - mov bx,104 - mov ds,icons2 - mov al,0 - mov ah,2 - call showframe ;spritef - mov di,160 - mov bx,104 - mov ds,icons2 - mov al,0 - mov ah,2 - call showframe ;spritef - ret - - endp - - - -Createpanel2 proc near - - call createpanel - mov di,0 - mov bx,0 - mov ds,icons2 - mov al,5 - mov ah,2 - call showframe - mov di,160 - mov bx,0 - mov ds,icons2 - mov al,5 - mov ah,2 - call showframe - ret - - endp - - - - - - -;Showspritef proc near -; -; mov ax,bx -; mov bx,screenwidth -; mul bx -; add di,ax -; mov dx,screenwidth -; mov es,workspace -; mov si,2080 -; mov ah,0 -; add ax,ax -; mov bx,ax -; add ax,ax -; add bx,ax -; add si,[bx+2] -; mov cx,[bx+0] -;spritefloop: push cx di -; call width80 -; pop di cx -; add di,dx -; dec ch -; jnz spritefloop -; ret -; -; endp -; -; - - - - - - - - -Clearwork proc near - - mov ax,0h - mov es,workspace - mov di,0 - mov cx,(200*320)/64 -clearloop: stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - loop clearloop - ret - - endp - - - - - - -Vsync proc near - - push ax bx cx dx si di ds es - - mov dx,03dah -loop2: in al,dx - test al,8 - jz loop2 -loop1: in al,dx - test al,8 - jnz loop1 - - call doshake - call dofade - if debuglevel2 - call debugkeys - endif - pop es ds di si dx cx bx ax - ret - - endp - - - -Doshake proc near - - cmp shakecounter,48 - jz finishshake - inc shakecounter - mov bl,shakecounter - mov bh,0 - add bx,offset cs:shaketable - mov al,10h - mov dx,3d4h - out dx,al - inc dx - mov al,[cs:bx] - out dx,al -finishshake: ret - -shaketable: db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh - db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9ch - - endp - - - - - - -Zoom proc near - - cmp watchingtime,0 - jnz inwatching - cmp zoomon,1 - jz zoomswitch -inwatching: ret - -zoomswitch: cmp commandtype,199 - jc zoomit -cantzoom: call putunderzoom - ret - -zoomit: mov ax,oldpointery - sub ax,9 - mov cx,screenwidth - mul cx - add ax,oldpointerx - sub ax,11 - mov si,ax - - mov ax,zoomy+4 - mov cx,screenwidth - mul cx - add ax,zoomx+5 - mov di,ax - mov es,workspace - mov ds,workspace - - mov cx,20 -zoomloop: push cx - mov cx,23 -zoomloop2: lodsb - mov ah,al - stosw - mov [es:di+screenwidth-2],ax - loop zoomloop2 - add si,screenwidth-23 - add di,screenwidth-46+screenwidth - pop cx - loop zoomloop - - call crosshair - mov didzoom,1 - ret - - endp - - - - - - - - - -Delthisone proc near - - push ax - push ax - mov al,ah - mov ah,0 - add ax,mapady - mov bx,screenwidth - mul bx - pop bx - mov bh,0 - add bx,mapadx - add ax,bx - mov di,ax - pop ax - push ax - mov al,ah - mov ah,0 - mov bx,22*8 - mul bx - pop bx - mov bh,0 - add ax,bx - mov si,ax - - mov es,workspace - mov ds,mapstore - mov dl,cl - mov dh,0 - mov ax,screenwidth - sub ax,dx - neg dx - add dx,22*8 -deloneloop: push cx - mov ch,0 - rep movsb - pop cx - add di,ax - add si,dx - dec ch - jnz deloneloop - ret - - endp - - - - - - - -;------------------------------------------------------------Pointer update---- - - -Multiget proc near ;di,bx = dest x,y - ;cl,ch = size - mov ax,bx ;si,di = storage - mov bx,screenwidth - mul bx - add di,ax - - mov es,workspace - push es ds - pop es ds - xchg di,si - mov al,cl - mov ah,0 - mov dx,screenwidth - sub dx,ax - - mov al,cl - and al,1 - jnz oddwidth2 - - mov bl,cl - mov bh,0 - mov ax,offset cs:width0 - shr bx,1 - sub ax,bx - mov cl,ch - mov ch,0 -multiloop3: call ax - add si,dx - loop multiloop3 - ret - -oddwidth2: mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov cl,ch - mov ch,0 -multiloop4: call ax - movsb - add si,dx - loop multiloop4 - ret - - endp - - - - - - - -Multiput proc near ;di,bx = dest x,y - ;cl,ch = size - mov ax,bx ;si,di = storage - mov bx,screenwidth - mul bx - add di,ax - - mov es,workspace - mov al,cl - mov ah,0 - mov dx,screenwidth - sub dx,ax - - mov al,cl - and al,1 - jnz oddwidth3 - - mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov cl,ch - mov ch,0 -multiloop5: call ax - add di,dx - loop multiloop5 - ret - -oddwidth3: mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov cl,ch - mov ch,0 -multiloop6: call ax - movsb - add di,dx - loop multiloop6 - ret - - - endp - - - - - - - - - -Multidump proc near ;di,bx = dest x,y - ;cl,ch = size - mov dx,0a000h - mov es,dx - mov ds,workspace - - mov ax,bx - mov bx,screenwidth - mul bx - add di,ax - mov dx,screenwidth - mov si,di - - mov al,cl - and al,1 - jnz oddwidth - - mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov bl,cl - mov bh,0 - neg bx - add bx,dx - mov cl,ch - mov ch,0 -multiloop1: call ax - add di,bx - add si,bx - loop multiloop1 - ret - -oddwidth: mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov bl,cl - mov bh,0 - neg bx - add bx,screenwidth - mov cl,ch - mov ch,0 -multiloop2: call ax - movsb - add di,bx - add si,bx - loop multiloop2 - ret - - endp - - - - - -Width160 proc near - - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw -width128: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw -width110: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw -width88: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw -width80: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw -width63: movsw -width62: movsw -width61: movsw -width60: movsw -width59: movsw -width58: movsw -width57: movsw -width56: movsw -width55: movsw -width54: movsw -width53: movsw -width52: movsw -width51: movsw -width50: movsw -width49: movsw -width48: movsw -width47: movsw -width46: movsw -width45: movsw -width44: movsw -width43: movsw -width42: movsw -width41: movsw -width40: movsw -width39: movsw -width38: movsw -width37: movsw -width36: movsw -width35: movsw -width34: movsw -width33: movsw -width32: movsw -width31: movsw -width30: movsw -width29: movsw -width28: movsw -width27: movsw -width26: movsw -width25: movsw -width24: movsw -width23: movsw -width22: movsw -width21: movsw -width20: movsw -width19: movsw -width18: movsw -width17: movsw -width16: movsw -width15: movsw -width14: movsw -width13: movsw -width12: movsw -width11: movsw -width10: movsw -width9: movsw -width8: movsw -width7: movsw -width6: movsw -width5: movsw -width4: movsw -width3: movsw -width2: movsw -width1: movsw -width0: ret - - endp - - - - - - - - - -Doblocks proc near - - mov es,workspace - mov ax,mapady - mov cx,screenwidth - mul cx - mov di,mapadx - add di,ax - - mov al,mapy - mov ah,0 - mov bx,mapwidth - mul bx - mov bl,mapx - mov bh,0 - add ax,bx - - mov si,map - add si,ax - - mov cx,10 -loop120: push di cx - mov cx,11 -loop124: push cx di - - mov ds,mapdata - lodsb - mov ds,backdrop - - push si - cmp al,0 - jz zeroblock - mov ah,al - mov al,0 - mov si,blocks - add si,ax - mov bh,14 - - - mov bh,4 -firstbitofblock: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - add di,screenwidth-16 - dec bh - jnz firstbitofblock - - mov bh,12 -loop125: movsw - movsw - movsw - movsw - movsw - movsw - movsw - movsw - mov ax,0dfdfh - stosw - stosw - - add di,screenwidth-20 - dec bh - jnz loop125 - - add di,4 - mov ax,0dfdfh - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - add di,screenwidth-16 - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - add di,screenwidth-16 - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - add di,screenwidth-16 - stosw - stosw - stosw - stosw - stosw - stosw - stosw - stosw - - -zeroblock: pop si - - pop di cx - add di,16 - loop loop124 - add si,mapwidth-11 - pop cx di - add di,screenwidth*16 - loop loop120 - ret - - endp - - - - - - - -;----------------------------------------------General sprite output routine---- - -Showframe proc near ; shows a frame from sprites - - push dx ax ; es=destination - mov cx,ax ; ds=source - and cx,511 ; di=x, bx=y - add cx,cx ; al=frame number - mov si,cx ; ah=effects flag - add cx,cx - add si,cx - cmp word ptr [si],0 - jnz notblankshow +Screenwidth equ 320 ;physical width of screen + + + +Allocatework proc near + + mov bx,1000h + call allocatemem + mov workspace,ax + ret + + endp + + + + + +Showpcx proc near + + call openfile + mov bx,handle + mov ds,workspace + mov ah,3fh + mov cx,128 + mov dx,0 + int 21h + + mov ds,workspace + mov si,16 + mov cx,48 + mov es,buffers + mov di,maingamepal +pcxpal: push cx + call readabyte + shr al,1 + shr al,1 + stosb + pop cx + loop pcxpal + mov cx,768-48 + mov ax,0ffffh + rep stosw + + call readoneblock + mov si,0 + mov di,0 + mov cx,480 +convertpcx: push cx + push di + mov ds,workspace + mov es,buffers + mov di,pointerback + mov bx,0 +sameline: call readabyte + mov ah,al + and ah,11000000b + cmp ah,11000000b + jnz normal + mov cl,al + and cl,00111111b + mov ch,0 + push cx + call readabyte + pop cx + add bx,cx + rep stosb + cmp bx,4*80 + jnz sameline + jmp endline +normal: stosb + inc bx + cmp bx,4*80 + jnz sameline + +endline: pop di + push si + mov dx,0a000h + mov es,dx + mov si,pointerback + mov ds,buffers + + mov dx,03c4h + mov al,2 + mov ah,1 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,2 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,4 + out dx,ax + mov cx,40 + push di + rep movsw + pop di + mov ah,8 + out dx,ax + mov cx,40 + rep movsw + + pop si + pop cx + loop convertpcx + + mov bx,handle + call closefile + ret + + endp + + + + +Readabyte proc near + + cmp si,30000 + jnz notendblock + push bx es di ds si + call readoneblock + pop si ds di es bx + mov si,0 +notendblock: lodsb + ret + + endp + + + + +Readoneblock proc near + + mov bx,handle + mov ah,3fh + mov ds,workspace + mov ah,3fh + mov cx,30000 + mov dx,0 + int 21h + ret + + endp + + + + + + + + +Loadpalfromiff proc near + + mov dx,offset cs:palettescreen + call openfile + mov cx,2000 + mov ds,mapstore + mov dx,0 + call readfromfile + call closefile + mov es,buffers + mov di,maingamepal + mov ds,mapstore + mov si,30h + mov cx,768 +palloop: lodsb + shr al,1 + shr al,1 + + cmp brightness,1 + jnz nought + cmp al,0 + jz nought + mov ah,al + shr ah,1 + add al,ah + shr ah,1 + add al,ah + cmp al,64 + jc nought + mov al,63 + +nought: stosb + loop palloop + ret + + endp + + + + + + +Setmode proc near + + call vsync + mov ah,12h + mov al,1 + mov bl,33h + int 10h + + mov ah,0 + mov al,13h + int 10h + + mov al,6 ; sets graphic controller + mov dx,3ceh ; register 6 (MM) to 1 - 64K + out dx,al + inc dx + in al,dx + and al,11110011b + or al,00000100b + out dx,al + + mov al,4 ; sets sequencer + mov dx,3c4h ; register 4 (EM) to 1 - >64K + out dx,al + inc dx + in al,dx + and al,11111101b + or al,00000010b + out dx,al + + mov al,13h ;give screen 16 extra hidden + mov dx,3d4h ;pixels at one side + out dx,al + inc dx + mov al,screenwidth/8 ; width of screen + out dx,al + + mov al,8h + mov dx,3d4h + out dx,al + inc dx + mov al,00000000b + out dx,al + + mov al,11h + mov dx,3d4h + out dx,al + inc dx + in al,dx + or al,128 + out dx,al + + mov al,00 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + mov al,01 + mov dx,3d4h + out dx,al + inc dx + mov al,3fh + out dx,al + ret + + endp + + + +Cls proc near + + mov ax,0a000h + mov es,ax + mov di,0 + mov cx,7fffh + mov ax,0 + rep stosw + ret + + endp + + + +Printundermon proc near ;prints workspace through the text + + mov si,(screenwidth*43)+76 + mov di,si + mov es,workspace + add si,8*screenwidth + mov dx,0a000h + mov ds,dx + mov cx,104 +scrollmonloop1: push cx di si + mov cx,170 +scrollmonloop2: lodsb + cmp al,231 + jnc dontplace +placeit: stosb + loop scrollmonloop2 + jmp finmonscroll +dontplace: inc di + loop scrollmonloop2 + +finmonscroll: pop si di cx + add si,screenwidth + add di,screenwidth + loop scrollmonloop1 + ret + + endp + + + + + + + + +Worktoscreen proc near + + call vsync + mov si,0 + mov di,0 + mov cx,25 + mov ds,workspace + mov dx,0a000h + mov es,dx + +dumpallloop: call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + call width160 + loop dumpallloop + + ret + + endp + + + + + + + + + +; +;Worktoscreen2 proc near +; +; call showpointer +; +; mov ds,workspace +; mov dx,0a000h +; mov es,dx +; +; mov si,320-16 +; mov di,320-16 +; mov bl,33 +; mov cx,16 +;screen2loop1: push di si cx +; call vsync +; cmp bl,21 +; jc screen2loop2 +; sub cx,16 +; jz isoneblock +;screen2loop2: movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; movsw +; add di,320-15 +; add si,320-15 +; loop screen2loop2 +;isoneblock: mov cx,16 +; mov ax,320-15 +;oneblockloop: push cx +; rep movsb +; pop cx +; add si,ax +; add di,ax +; inc ax +; loop oneblockloop +; +; pop cx si di +; add cx,16 +; cmp cx,200 +; jc itsallright +; mov cx,200 +;itsallright: sub si,16 +; sub di,16 +; dec bl +; jnz screen2loop1 +; +; call delpointer +; ret +; +; endp +; +; +; +; + + + + +Paneltomap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiget + ret + + endp + + + +Maptopanel proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov ds,mapstore + mov si,0 + mov cl,mapxsize + mov ch,mapysize + call multiput + + ret + + endp + + + + + +Dumpmap proc near + + mov di,mapxstart + add di,mapadx + mov bx,mapystart + add bx,mapady + mov cl,mapxsize + mov ch,mapysize + call multidump + ret + + endp + + + + +Pixelcheckset proc near ;al=x, ah=y, es:bx=setlist pos + ;checks exact pixel in a frame + push ax + sub al,[es:bx] ;for detection. + sub ah,[es:bx+1] ;al,ah now holds offset within + ;the frame + push es bx cx ax + mov al,[es:bx+4] ;object number + call getsetad + mov al,[es:bx+17] ;finds frame number + mov es,setframes + mov bx,framedata + mov ah,0 + mov cx,6 + mul cx + add bx,ax ;get data for this frame in es:bx + pop ax + + push ax + mov al,ah + mov ah,0 + mov cl,[es:bx] + mov ch,0 + mul cx + pop cx + mov ch,0 + add ax,cx ;ax now holds offset from corner + ;of the frame + add ax,[es:bx+2] + mov bx,ax ;es:bx now holds offset of pixel! + add bx,frames + + mov al,[es:bx] + mov dl,al + pop cx bx es ax + cmp dl,0 + ret + + endp + + + + + + + + + + + + +Createpanel proc near + + mov di,0 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,8 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,0 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + mov di,160 + mov bx,104 + mov ds,icons2 + mov al,0 + mov ah,2 + call showframe ;spritef + ret + + endp + + + +Createpanel2 proc near + + call createpanel + mov di,0 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + mov di,160 + mov bx,0 + mov ds,icons2 + mov al,5 + mov ah,2 + call showframe + ret + + endp + + + + + + +;Showspritef proc near +; +; mov ax,bx +; mov bx,screenwidth +; mul bx +; add di,ax +; mov dx,screenwidth +; mov es,workspace +; mov si,2080 +; mov ah,0 +; add ax,ax +; mov bx,ax +; add ax,ax +; add bx,ax +; add si,[bx+2] +; mov cx,[bx+0] +;spritefloop: push cx di +; call width80 +; pop di cx +; add di,dx +; dec ch +; jnz spritefloop +; ret +; +; endp +; +; + + + + + + + + +Clearwork proc near + + mov ax,0h + mov es,workspace + mov di,0 + mov cx,(200*320)/64 +clearloop: stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + loop clearloop + ret + + endp + + + + + + +Vsync proc near + + push ax bx cx dx si di ds es + + mov dx,03dah +loop2: in al,dx + test al,8 + jz loop2 +loop1: in al,dx + test al,8 + jnz loop1 + + call doshake + call dofade + if debuglevel2 + call debugkeys + endif + pop es ds di si dx cx bx ax + ret + + endp + + + +Doshake proc near + + cmp shakecounter,48 + jz finishshake + inc shakecounter + mov bl,shakecounter + mov bh,0 + add bx,offset cs:shaketable + mov al,10h + mov dx,3d4h + out dx,al + inc dx + mov al,[cs:bx] + out dx,al +finishshake: ret + +shaketable: db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9eh + db 9ch,9ah,9fh,9ah,9ch,9eh,0a0h,9bh,9dh,99h,9fh,9ch + + endp + + + + + + +Zoom proc near + + cmp watchingtime,0 + jnz inwatching + cmp zoomon,1 + jz zoomswitch +inwatching: ret + +zoomswitch: cmp commandtype,199 + jc zoomit +cantzoom: call putunderzoom + ret + +zoomit: mov ax,oldpointery + sub ax,9 + mov cx,screenwidth + mul cx + add ax,oldpointerx + sub ax,11 + mov si,ax + + mov ax,zoomy+4 + mov cx,screenwidth + mul cx + add ax,zoomx+5 + mov di,ax + mov es,workspace + mov ds,workspace + + mov cx,20 +zoomloop: push cx + mov cx,23 +zoomloop2: lodsb + mov ah,al + stosw + mov [es:di+screenwidth-2],ax + loop zoomloop2 + add si,screenwidth-23 + add di,screenwidth-46+screenwidth + pop cx + loop zoomloop + + call crosshair + mov didzoom,1 + ret + + endp + + + + + + + + + +Delthisone proc near + + push ax + push ax + mov al,ah + mov ah,0 + add ax,mapady + mov bx,screenwidth + mul bx + pop bx + mov bh,0 + add bx,mapadx + add ax,bx + mov di,ax + pop ax + push ax + mov al,ah + mov ah,0 + mov bx,22*8 + mul bx + pop bx + mov bh,0 + add ax,bx + mov si,ax + + mov es,workspace + mov ds,mapstore + mov dl,cl + mov dh,0 + mov ax,screenwidth + sub ax,dx + neg dx + add dx,22*8 +deloneloop: push cx + mov ch,0 + rep movsb + pop cx + add di,ax + add si,dx + dec ch + jnz deloneloop + ret + + endp + + + + + + + +;------------------------------------------------------------Pointer update---- + + +Multiget proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + push es ds + pop es ds + xchg di,si + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth2 + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop3: call ax + add si,dx + loop multiloop3 + ret + +oddwidth2: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop4: call ax + movsb + add si,dx + loop multiloop4 + ret + + endp + + + + + + + +Multiput proc near ;di,bx = dest x,y + ;cl,ch = size + mov ax,bx ;si,di = storage + mov bx,screenwidth + mul bx + add di,ax + + mov es,workspace + mov al,cl + mov ah,0 + mov dx,screenwidth + sub dx,ax + + mov al,cl + and al,1 + jnz oddwidth3 + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop5: call ax + add di,dx + loop multiloop5 + ret + +oddwidth3: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +multiloop6: call ax + movsb + add di,dx + loop multiloop6 + ret + + + endp + + + + + + + + + +Multidump proc near ;di,bx = dest x,y + ;cl,ch = size + mov dx,0a000h + mov es,dx + mov ds,workspace + + mov ax,bx + mov bx,screenwidth + mul bx + add di,ax + mov dx,screenwidth + mov si,di + + mov al,cl + and al,1 + jnz oddwidth + + mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,dx + mov cl,ch + mov ch,0 +multiloop1: call ax + add di,bx + add si,bx + loop multiloop1 + ret + +oddwidth: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov bl,cl + mov bh,0 + neg bx + add bx,screenwidth + mov cl,ch + mov ch,0 +multiloop2: call ax + movsb + add di,bx + add si,bx + loop multiloop2 + ret + + endp + + + + + +Width160 proc near + + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width128: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width110: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width88: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width80: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw +width63: movsw +width62: movsw +width61: movsw +width60: movsw +width59: movsw +width58: movsw +width57: movsw +width56: movsw +width55: movsw +width54: movsw +width53: movsw +width52: movsw +width51: movsw +width50: movsw +width49: movsw +width48: movsw +width47: movsw +width46: movsw +width45: movsw +width44: movsw +width43: movsw +width42: movsw +width41: movsw +width40: movsw +width39: movsw +width38: movsw +width37: movsw +width36: movsw +width35: movsw +width34: movsw +width33: movsw +width32: movsw +width31: movsw +width30: movsw +width29: movsw +width28: movsw +width27: movsw +width26: movsw +width25: movsw +width24: movsw +width23: movsw +width22: movsw +width21: movsw +width20: movsw +width19: movsw +width18: movsw +width17: movsw +width16: movsw +width15: movsw +width14: movsw +width13: movsw +width12: movsw +width11: movsw +width10: movsw +width9: movsw +width8: movsw +width7: movsw +width6: movsw +width5: movsw +width4: movsw +width3: movsw +width2: movsw +width1: movsw +width0: ret + + endp + + + + + + + + + +Doblocks proc near + + mov es,workspace + mov ax,mapady + mov cx,screenwidth + mul cx + mov di,mapadx + add di,ax + + mov al,mapy + mov ah,0 + mov bx,mapwidth + mul bx + mov bl,mapx + mov bh,0 + add ax,bx + + mov si,map + add si,ax + + mov cx,10 +loop120: push di cx + mov cx,11 +loop124: push cx di + + mov ds,mapdata + lodsb + mov ds,backdrop + + push si + cmp al,0 + jz zeroblock + mov ah,al + mov al,0 + mov si,blocks + add si,ax + mov bh,14 + + + mov bh,4 +firstbitofblock: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + add di,screenwidth-16 + dec bh + jnz firstbitofblock + + mov bh,12 +loop125: movsw + movsw + movsw + movsw + movsw + movsw + movsw + movsw + mov ax,0dfdfh + stosw + stosw + + add di,screenwidth-20 + dec bh + jnz loop125 + + add di,4 + mov ax,0dfdfh + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + add di,screenwidth-16 + stosw + stosw + stosw + stosw + stosw + stosw + stosw + stosw + + +zeroblock: pop si + + pop di cx + add di,16 + loop loop124 + add si,mapwidth-11 + pop cx di + add di,screenwidth*16 + loop loop120 + ret + + endp + + + + + + + +;----------------------------------------------General sprite output routine---- + +Showframe proc near ; shows a frame from sprites + + push dx ax ; es=destination + mov cx,ax ; ds=source + and cx,511 ; di=x, bx=y + add cx,cx ; al=frame number + mov si,cx ; ah=effects flag + add cx,cx + add si,cx + cmp word ptr [si],0 + jnz notblankshow pop ax dx - mov cx,0 - ret - -notblankshow: test ah,128 - jnz skipoffsets - mov al,[si+4] - mov ah,0 - add di,ax - mov al,[si+5] - mov ah,0 - add bx,ax -skipoffsets: mov cx,[si+0] - mov ax,[si+2] - add ax,2080 - mov si,ax - pop ax dx - cmp ah,0 - jz noeffects - - test ah,128 - jz notcentred - push ax - mov al,cl - mov ah,0 - shr ax,1 - sub di,ax - mov al,ch - mov ah,0 - shr ax,1 - sub bx,ax - pop ax - -notcentred: test ah,64 - jz notdiffdest - push cx - call frameoutfx - pop cx - ret - -notdiffdest: test ah,8 - jz notprintlist - push ax - mov ax,di - sub ax,mapadx - push bx - sub bx,mapady - mov ah,bl - pop bx - ;call addtoprintlist - pop ax - -notprintlist: test ah,4 - jz notflippedx - mov dx,screenwidth - mov es,workspace - push cx - call frameoutfx - pop cx - ret - -notflippedx: test ah,2 - jz notnomask - mov dx,screenwidth - mov es,workspace - push cx - call frameoutnm - pop cx - ret - -notnomask: test ah,32 - jz noeffects - mov dx,screenwidth - mov es,workspace - push cx - call frameoutbh - pop cx - ret - -noeffects: mov dx,screenwidth - mov es,workspace - push cx - call frameoutv - pop cx ; returns size printed in cx - ret - - endp - - - - - - - - - - -Frameoutv proc near - - push dx - mov ax,bx - mov bx,dx - mul bx - add di,ax - pop dx - - push cx - mov ch,0 - sub dx,cx - pop cx - -frameloop1: push cx - mov ch,0 - -frameloop2: lodsb - cmp al,0 - jnz backtosolid -backtoother: inc di - loop frameloop2 - pop cx - add di,dx - dec ch - jnz frameloop1 - ret - -frameloop3: lodsb - cmp al,0 - jz backtoother -backtosolid: stosb - loop frameloop3 - pop cx - add di,dx - dec ch - jnz frameloop1 - ret - - endp - - - - - - -Frameoutnm proc near - - push dx - mov ax,bx - mov bx,dx - mul bx - add di,ax - pop dx - - push cx - mov ch,0 - sub dx,cx - pop cx - - mov al,cl - and al,1 - jnz oddwidthframe - - mov bl,cl - mov bh,0 - mov ax,offset cs:width0 - shr bx,1 - sub ax,bx - mov cl,ch - mov ch,0 -nmloop1: call ax - add di,dx - loop nmloop1 - ret - -oddwidthframe: mov bl,cl - mov bh,0 - shr bx,1 - mov ax,offset cs:width0 - sub ax,bx - mov cl,ch - mov ch,0 -nmloop2: call ax - movsb - add di,dx - loop nmloop2 - ret - - endp - - - - - - -Frameoutbh proc near - - push dx - mov ax,bx - mov bx,dx - mul bx - add di,ax - pop dx - - push cx - mov ch,0 - sub dx,cx - pop cx - -bhloop2: push cx - mov ch,0 - mov ah,255 -bhloop1: cmp [es:di],ah - jnz nofill - movsb - loop bhloop1 - jmp nextline -nofill: inc di - inc si - loop bhloop1 -nextline: add di,dx - pop cx - dec ch - jnz bhloop2 - ret - - endp - - - - - - - -Frameoutfx proc near - - push dx - mov ax,bx - mov bx,dx - mul bx - add di,ax - pop dx - - push cx - mov ch,0 - add dx,cx - pop cx - -frameloopfx1: push cx - mov ch,0 - -frameloopfx2: lodsb - cmp al,0 - jnz backtosolidfx -backtootherfx: dec di - loop frameloopfx2 - pop cx - add di,dx - dec ch - jnz frameloopfx1 - ret - -frameloopfx3: lodsb - cmp al,0 - jz backtootherfx -backtosolidfx: mov [es:di],al - dec di - loop frameloopfx3 - pop cx - add di,dx - dec ch - jnz frameloopfx1 - ret - - endp - - - - -;---------------------------------------------------Transfers for extra data---- - -Transferinv proc near - - mov di,exframepos - push di - mov al,expos - mov ah,0 - mov bx,ax - add ax,ax - add ax,bx - inc ax - mov cx,6 - mul cx - mov es,extras - mov bx,exframedata - add bx,ax - add di,exframes - - push bx - mov al,itemtotran - mov ah,0 - mov bx,ax - add ax,ax - add ax,bx - inc ax - mov cx,6 - mul cx - mov ds,freeframes - mov bx,frframedata - add bx,ax - mov si,frframes - mov al,[bx] - mov ah,0 - mov cl,[bx+1] - mov ch,0 - add si,[bx+2] ;we have si, and length - mov dx,[bx+4] - pop bx - mov [es:bx+0],al - mov [es:bx+1],cl - mov [es:bx+4],dx - - mul cx - mov cx,ax - push cx - rep movsb - pop cx - pop ax - mov [es:bx+2],ax - add exframepos,cx - ret - - endp - - - - - - - - - - -Transfermap proc near - - mov di,exframepos - push di - mov al,expos - mov ah,0 - mov bx,ax - add ax,ax - add ax,bx - mov cx,6 - mul cx - mov es,extras - mov bx,exframedata - add bx,ax - add di,exframes - - push bx - mov al,itemtotran - mov ah,0 - mov bx,ax - add ax,ax - add ax,bx - mov cx,6 - mul cx - mov ds,freeframes - mov bx,frframedata - add bx,ax - mov si,frframes - mov al,[bx] - mov ah,0 - mov cl,[bx+1] - mov ch,0 - add si,[bx+2] ;we have si, and length - mov dx,[bx+4] - pop bx - mov [es:bx+0],al - mov [es:bx+1],cl - mov [es:bx+4],dx - - mul cx - mov cx,ax - push cx - rep movsb - pop cx - pop ax - mov [es:bx+2],ax - add exframepos,cx - ret - - endp - - -;------------------------------------------------------------------Filenames---- - - -Spritename1 db "DREAMWEB.S00",0 -Spritename3 db "DREAMWEB.S02",0 - -Idname db "INSTALL.DAT",0 - -Characterset1 db "DREAMWEB.C00",0 -Characterset2 db "DREAMWEB.C01",0 -Characterset3 db "DREAMWEB.C02",0 - -Samplename db "DREAMWEB.V00",0 - -Basicsample db "DREAMWEB.V99",0 - -Icongraphics0 db "DREAMWEB.G00",0 -Icongraphics1 db "DREAMWEB.G01",0 -Extragraphics1 db "DREAMWEB.G02",0 -Icongraphics8 db "DREAMWEB.G08",0 -Mongraphicname db "DREAMWEB.G03",0 -Mongraphics2 db "DREAMWEB.G07",0 -Cityname db "DREAMWEB.G04",0 -Travelgraphic1 db "DREAMWEB.G05",0 -Travelgraphic2 db "DREAMWEB.G06",0 -Diarygraphic db "DREAMWEB.G14",0 - -Monitorfile1 db "DREAMWEB.T01",0 -Monitorfile2 db "DREAMWEB.T02",0 -Monitorfile10 db "DREAMWEB.T10",0 ;News items 10-13 -Monitorfile11 db "DREAMWEB.T11",0 -Monitorfile12 db "DREAMWEB.T12",0 -Monitorfile13 db "DREAMWEB.T13",0 -Monitorfile20 db "DREAMWEB.T20",0 -Monitorfile21 db "DREAMWEB.T21",0 ;Ryan's private stuff -Monitorfile22 db "DREAMWEB.T22",0 ;Use for blank carts -Monitorfile23 db "DREAMWEB.T23",0 ;Use for edens cart -Monitorfile24 db "DREAMWEB.T24",0 ;Use for church cart -Foldertext db "DREAMWEB.T50",0 -Diarytext db "DREAMWEB.T51",0 -Puzzletextname db "DREAMWEB.T80",0 ;puzzle text -Traveltextname db "DREAMWEB.T81",0 ;location descriptions -Introtextname db "DREAMWEB.T82",0 ;intro sequence -Endtextname db "DREAMWEB.T83",0 ;end sequence/credits -Commandtextname db "DREAMWEB.T84",0 ;commands - -Volumetabname db "DREAMWEB.VOL",0 - -Foldergraphic1 db "DREAMWEB.G09",0 -Foldergraphic2 db "DREAMWEB.G10",0 -Foldergraphic3 db "DREAMWEB.G11",0 -Symbolgraphic db "DREAMWEB.G12",0 -Gungraphic db "DREAMWEB.G13",0 -Monkface db "DREAMWEB.G15",0 - -Title0graphics db "DREAMWEB.I00",0 -Title1graphics db "DREAMWEB.I01",0 -Title2graphics db "DREAMWEB.I02",0 -Title3graphics db "DREAMWEB.I03",0 -Title4graphics db "DREAMWEB.I04",0 -Title5graphics db "DREAMWEB.I05",0 -Title6graphics db "DREAMWEB.I06",0 -Title7graphics db "DREAMWEB.I07",0 - -Palettescreen db "DREAMWEB.PAL",0 - - + mov cx,0 + ret + +notblankshow: test ah,128 + jnz skipoffsets + mov al,[si+4] + mov ah,0 + add di,ax + mov al,[si+5] + mov ah,0 + add bx,ax +skipoffsets: mov cx,[si+0] + mov ax,[si+2] + add ax,2080 + mov si,ax + pop ax dx + cmp ah,0 + jz noeffects + + test ah,128 + jz notcentred + push ax + mov al,cl + mov ah,0 + shr ax,1 + sub di,ax + mov al,ch + mov ah,0 + shr ax,1 + sub bx,ax + pop ax + +notcentred: test ah,64 + jz notdiffdest + push cx + call frameoutfx + pop cx + ret + +notdiffdest: test ah,8 + jz notprintlist + push ax + mov ax,di + sub ax,mapadx + push bx + sub bx,mapady + mov ah,bl + pop bx + ;call addtoprintlist + pop ax + +notprintlist: test ah,4 + jz notflippedx + mov dx,screenwidth + mov es,workspace + push cx + call frameoutfx + pop cx + ret + +notflippedx: test ah,2 + jz notnomask + mov dx,screenwidth + mov es,workspace + push cx + call frameoutnm + pop cx + ret + +notnomask: test ah,32 + jz noeffects + mov dx,screenwidth + mov es,workspace + push cx + call frameoutbh + pop cx + ret + +noeffects: mov dx,screenwidth + mov es,workspace + push cx + call frameoutv + pop cx ; returns size printed in cx + ret + + endp + + + + + + + + + + +Frameoutv proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +frameloop1: push cx + mov ch,0 + +frameloop2: lodsb + cmp al,0 + jnz backtosolid +backtoother: inc di + loop frameloop2 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + +frameloop3: lodsb + cmp al,0 + jz backtoother +backtosolid: stosb + loop frameloop3 + pop cx + add di,dx + dec ch + jnz frameloop1 + ret + + endp + + + + + + +Frameoutnm proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + + mov al,cl + and al,1 + jnz oddwidthframe + + mov bl,cl + mov bh,0 + mov ax,offset cs:width0 + shr bx,1 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop1: call ax + add di,dx + loop nmloop1 + ret + +oddwidthframe: mov bl,cl + mov bh,0 + shr bx,1 + mov ax,offset cs:width0 + sub ax,bx + mov cl,ch + mov ch,0 +nmloop2: call ax + movsb + add di,dx + loop nmloop2 + ret + + endp + + + + + + +Frameoutbh proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + sub dx,cx + pop cx + +bhloop2: push cx + mov ch,0 + mov ah,255 +bhloop1: cmp [es:di],ah + jnz nofill + movsb + loop bhloop1 + jmp nextline +nofill: inc di + inc si + loop bhloop1 +nextline: add di,dx + pop cx + dec ch + jnz bhloop2 + ret + + endp + + + + + + + +Frameoutfx proc near + + push dx + mov ax,bx + mov bx,dx + mul bx + add di,ax + pop dx + + push cx + mov ch,0 + add dx,cx + pop cx + +frameloopfx1: push cx + mov ch,0 + +frameloopfx2: lodsb + cmp al,0 + jnz backtosolidfx +backtootherfx: dec di + loop frameloopfx2 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + +frameloopfx3: lodsb + cmp al,0 + jz backtootherfx +backtosolidfx: mov [es:di],al + dec di + loop frameloopfx3 + pop cx + add di,dx + dec ch + jnz frameloopfx1 + ret + + endp + + + + +;---------------------------------------------------Transfers for extra data---- + +Transferinv proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + inc ax + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + + + + + + + + + +Transfermap proc near + + mov di,exframepos + push di + mov al,expos + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov es,extras + mov bx,exframedata + add bx,ax + add di,exframes + + push bx + mov al,itemtotran + mov ah,0 + mov bx,ax + add ax,ax + add ax,bx + mov cx,6 + mul cx + mov ds,freeframes + mov bx,frframedata + add bx,ax + mov si,frframes + mov al,[bx] + mov ah,0 + mov cl,[bx+1] + mov ch,0 + add si,[bx+2] ;we have si, and length + mov dx,[bx+4] + pop bx + mov [es:bx+0],al + mov [es:bx+1],cl + mov [es:bx+4],dx + + mul cx + mov cx,ax + push cx + rep movsb + pop cx + pop ax + mov [es:bx+2],ax + add exframepos,cx + ret + + endp + + +;------------------------------------------------------------------Filenames---- + + +Spritename1 db "DREAMWEB.S00",0 +Spritename3 db "DREAMWEB.S02",0 + +Idname db "INSTALL.DAT",0 + +Characterset1 db "DREAMWEB.C00",0 +Characterset2 db "DREAMWEB.C01",0 +Characterset3 db "DREAMWEB.C02",0 + +Samplename db "DREAMWEB.V00",0 + +Basicsample db "DREAMWEB.V99",0 + +Icongraphics0 db "DREAMWEB.G00",0 +Icongraphics1 db "DREAMWEB.G01",0 +Extragraphics1 db "DREAMWEB.G02",0 +Icongraphics8 db "DREAMWEB.G08",0 +Mongraphicname db "DREAMWEB.G03",0 +Mongraphics2 db "DREAMWEB.G07",0 +Cityname db "DREAMWEB.G04",0 +Travelgraphic1 db "DREAMWEB.G05",0 +Travelgraphic2 db "DREAMWEB.G06",0 +Diarygraphic db "DREAMWEB.G14",0 + +Monitorfile1 db "DREAMWEB.T01",0 +Monitorfile2 db "DREAMWEB.T02",0 +Monitorfile10 db "DREAMWEB.T10",0 ;News items 10-13 +Monitorfile11 db "DREAMWEB.T11",0 +Monitorfile12 db "DREAMWEB.T12",0 +Monitorfile13 db "DREAMWEB.T13",0 +Monitorfile20 db "DREAMWEB.T20",0 +Monitorfile21 db "DREAMWEB.T21",0 ;Ryan's private stuff +Monitorfile22 db "DREAMWEB.T22",0 ;Use for blank carts +Monitorfile23 db "DREAMWEB.T23",0 ;Use for edens cart +Monitorfile24 db "DREAMWEB.T24",0 ;Use for church cart +Foldertext db "DREAMWEB.T50",0 +Diarytext db "DREAMWEB.T51",0 +Puzzletextname db "DREAMWEB.T80",0 ;puzzle text +Traveltextname db "DREAMWEB.T81",0 ;location descriptions +Introtextname db "DREAMWEB.T82",0 ;intro sequence +Endtextname db "DREAMWEB.T83",0 ;end sequence/credits +Commandtextname db "DREAMWEB.T84",0 ;commands + +Volumetabname db "DREAMWEB.VOL",0 + +Foldergraphic1 db "DREAMWEB.G09",0 +Foldergraphic2 db "DREAMWEB.G10",0 +Foldergraphic3 db "DREAMWEB.G11",0 +Symbolgraphic db "DREAMWEB.G12",0 +Gungraphic db "DREAMWEB.G13",0 +Monkface db "DREAMWEB.G15",0 + +Title0graphics db "DREAMWEB.I00",0 +Title1graphics db "DREAMWEB.I01",0 +Title2graphics db "DREAMWEB.I02",0 +Title3graphics db "DREAMWEB.I03",0 +Title4graphics db "DREAMWEB.I04",0 +Title5graphics db "DREAMWEB.I05",0 +Title6graphics db "DREAMWEB.I06",0 +Title7graphics db "DREAMWEB.I07",0 + +Palettescreen db "DREAMWEB.PAL",0 + +  \ No newline at end of file -- cgit v1.2.3 From 4b3f775efa628db08f93630e20cf50f7fbb32f4d Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 22:02:18 +0400 Subject: DREAMWEB: removed asserts, added STACK_CHECK as suggested by Max --- devtools/tasmrecover/tasm/cpp.py | 4 +- engines/dreamweb/dreamgen.cpp | 3584 +++++++++++++++++++------------------- engines/dreamweb/runtime.h | 15 + 3 files changed, 1809 insertions(+), 1794 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 888f0bf9bd..12b14fb6bc 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -257,7 +257,7 @@ namespace %s { self.schedule(name) def _ret(self): - self.body += "\t{assert(stack_depth == context.stack.size()); return; }\n" + self.body += "\treturn;\n" def parse2(self, dst, src): dst_size, src_size = self.get_size(dst), self.get_size(src) @@ -443,7 +443,7 @@ namespace %s { self.proc_addr.append((name, self.proc.offset)) self.body = str() - self.body += "void %s(Context & context) {\n\tuint stack_depth = context.stack.size();\n" %name; + self.body += "void %s(Context & context) {\n\tSTACK_CHECK(context);\n" %name; self.proc.optimize() self.unbounded = [] self.proc.visit(self, skip) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 331c8abbd7..c71a37c5b9 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -476,7 +476,7 @@ void intro3text(Context &context); void intro1text(Context &context); void alleybarksound(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._dec(context.ax); context._cmp(context.ax, 0); @@ -490,27 +490,27 @@ void alleybarksound(Context & context) { context.ax = 1000; nobark: context.es.word(context.bx+3) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void intromusic(Context & context) { - uint stack_depth = context.stack.size(); - {assert(stack_depth == context.stack.size()); return; } + STACK_CHECK(context); + return; } void foghornsound(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); randomnumber(context); context._cmp(context.al, 198); if (!context.flags.z()) goto nofog; context.al = 13; playchannel1(context); nofog: - {assert(stack_depth == context.stack.size()); return; } + return; } void receptionist(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotrecep; context._cmp(context.data.byte(kCardpassflag), 1); @@ -549,11 +549,11 @@ gotrecep: if (context.flags.z()) goto nottalkedrecep; context.data.byte(kTalkedtorecep) = 1; nottalkedrecep: - {assert(stack_depth == context.stack.size()); return; } + return; } void smokebloke(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notspokento; context.al = context.es.byte(context.bx+7); @@ -585,11 +585,11 @@ notsmokeb2: gotsmokeb: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void attendant(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); context.al = context.es.byte(context.bx+7); @@ -597,31 +597,31 @@ void attendant(Context & context) { if (context.flags.z()) goto nottalked; context.data.byte(kTalkedtoattendant) = 1; nottalked: - {assert(stack_depth == context.stack.size()); return; } + return; } void manasleep(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void eden(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto notinbed; showgamereel(context); addtopeoplelist(context); notinbed: - {assert(stack_depth == context.stack.size()); return; } + return; } void edeninbath(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (context.flags.z()) goto notinbed; context._cmp(context.data.byte(kSartaindead), 0); @@ -629,39 +629,39 @@ void edeninbath(Context & context) { showgamereel(context); addtopeoplelist(context); notinbath: - {assert(stack_depth == context.stack.size()); return; } + return; /*continuing to unbounded code: notinbed from eden:5-6*/ notinbed: - {assert(stack_depth == context.stack.size()); return; } - {assert(stack_depth == context.stack.size()); return; } + return; + return; } void malefan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void femalefan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void louis(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notlouis1; showgamereel(context); addtopeoplelist(context); notlouis1: - {assert(stack_depth == context.stack.size()); return; } + return; } void louischair(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) goto notlouis2; checkspeed(context); @@ -686,35 +686,35 @@ notlouisanim: showgamereel(context); addtopeoplelist(context); notlouis2: - {assert(stack_depth == context.stack.size()); return; } + return; } void manasleep2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void mansatstill(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void tattooman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void drinker(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotdrinker; context._inc(context.es.word(context.bx+3)); @@ -732,11 +732,11 @@ notdrinker1: gotdrinker: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void bartender(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotsmoket; context._cmp(context.es.word(context.bx+3), 86); @@ -760,25 +760,25 @@ gotsmoket: context.es.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void othersmoker(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void barwoman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void interviewer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), 68); if (!context.flags.z()) goto notgeneralstart; context._inc(context.es.word(context.bx+3)); @@ -792,11 +792,11 @@ notgeneralstart: context._inc(context.es.word(context.bx+3)); talking: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void soldier1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; context.data.word(kWatchingtime) = 10; @@ -826,11 +826,11 @@ soldierwait: gotsoldframe: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void rockstar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 303); if (context.flags.z()) goto rockcombatend; @@ -868,21 +868,21 @@ rockspeed: addtopeoplelist(context); context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notalkrock: context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; rockcombatend: context.data.byte(kNewlocation) = 45; showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void helicopter(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 203); if (context.flags.z()) goto heliwon; @@ -929,18 +929,18 @@ helicombatend: if (context.flags.c()) goto notwaitingheli; context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notwaitingheli: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; heliwon: context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void mugger(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 138); if (context.flags.z()) goto endmugger1; @@ -957,7 +957,7 @@ notmugger: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; endmugger1: context.push(context.es); context.push(context.bx); @@ -1008,20 +1008,20 @@ endmugger1: context.data.byte(kBeenmugged) = 1; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; endmugger2: - {assert(stack_depth == context.stack.size()); return; } + return; } void aide(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void businessman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; context.ax = context.es.word(context.bx+3); @@ -1101,17 +1101,17 @@ busspeed: if (!context.flags.z()) goto buscombatend; context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; buscombatend: - {assert(stack_depth == context.stack.size()); return; } + return; buscombatwonend: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void poolguard(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 214); if (context.flags.z()) goto combatover2; @@ -1169,11 +1169,11 @@ guardspeed: if (context.flags.z()) goto iswaitingpool; context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; iswaitingpool: context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; combatover1: context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 0; @@ -1181,7 +1181,7 @@ combatover1: turnpathon(context); context.al = 1; turnpathoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; combatover2: showgamereel(context); context.data.word(kWatchingtime) = 2; @@ -1192,16 +1192,16 @@ combatover2: context.data.word(kWatchingtime) = 0; context.data.byte(kMandead) = 2; doneover2: - {assert(stack_depth == context.stack.size()); return; } + return; } void security(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 32); if (context.flags.z()) goto securwait; context._cmp(context.es.word(context.bx+3), 69); if (!context.flags.z()) goto notaftersec; - {assert(stack_depth == context.stack.size()); return; } + return; notaftersec: context.data.word(kWatchingtime) = 10; checkspeed(context); @@ -1221,11 +1221,11 @@ securwait: gotsecurframe: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void heavy(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; @@ -1257,11 +1257,11 @@ heavywait: gotheavyframe: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void bossman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notboss; context.ax = context.es.word(context.bx+3); @@ -1301,11 +1301,11 @@ notboss: if (context.flags.z()) goto nottalkedboss; context.data.byte(kTalkedtoboss) = 1; nottalkedboss: - {assert(stack_depth == context.stack.size()); return; } + return; } void gamer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gamerfin; gameragain: @@ -1321,32 +1321,32 @@ gameragain: gamerfin: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void sparkydrip(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto cantdrip; context.al = 14; context.ah = 0; playchannel0(context); cantdrip: - {assert(stack_depth == context.stack.size()); return; } + return; } void carparkdrip(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto cantdrip2; context.al = 14; playchannel1(context); cantdrip2: - {assert(stack_depth == context.stack.size()); return; } + return; } void keeper(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kKeeperflag), 0); if (!context.flags.z()) goto notwaiting; context._cmp(context.data.word(kReeltowatch), 190); @@ -1359,16 +1359,16 @@ void keeper(Context & context) { context.al = context.data.byte(kDreamnumber); context.es.byte(context.bx+7) = context.al; notdiff: - {assert(stack_depth == context.stack.size()); return; } + return; notwaiting: addtopeoplelist(context); showgamereel(context); waiting: - {assert(stack_depth == context.stack.size()); return; } + return; } void candles1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candle1; context.ax = context.es.word(context.bx+3); @@ -1380,11 +1380,11 @@ notendcandle1: context.es.word(context.bx+3) = context.ax; candle1: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void smallcandle(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto smallcandlef; context.ax = context.es.word(context.bx+3); @@ -1396,11 +1396,11 @@ notendsmallcandle: context.es.word(context.bx+3) = context.ax; smallcandlef: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intromagic1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm1fin; context.ax = context.es.word(context.bx+3); @@ -1424,11 +1424,11 @@ gotintrom1: context.data.byte(kNowinnewroom) = 1; introm1fin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void candles(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candlesfin; context.ax = context.es.word(context.bx+3); @@ -1440,11 +1440,11 @@ gotcandles: context.es.word(context.bx+3) = context.ax; candlesfin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void candles2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candles2fin; context.ax = context.es.word(context.bx+3); @@ -1456,11 +1456,11 @@ gotcandles2: context.es.word(context.bx+3) = context.ax; candles2fin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void gates(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gatesfin; context.ax = context.es.word(context.bx+3); @@ -1493,11 +1493,11 @@ gotgates: context.es = context.pop(); gatesfin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intromagic2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm2fin; context.ax = context.es.word(context.bx+3); @@ -1509,11 +1509,11 @@ gotintrom2: context.es.word(context.bx+3) = context.ax; introm2fin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intromagic3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm3fin; context.ax = context.es.word(context.bx+3); @@ -1527,11 +1527,11 @@ introm3fin: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void intromonks1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto intromonk1fin; context.ax = context.es.word(context.bx+3); @@ -1541,7 +1541,7 @@ void intromonks1(Context & context) { context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; notendmonk1: context._cmp(context.ax, 30); if (!context.flags.z()) goto gotintromonk1; @@ -1572,11 +1572,11 @@ intromonk1fin: showgamereel(context); context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void intromonks2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto intromonk2fin; context.ax = context.es.word(context.bx+3); @@ -1625,16 +1625,16 @@ gotintromonk2: context.es.word(context.bx+3) = context.ax; intromonk2fin: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void handclap(Context & context) { - uint stack_depth = context.stack.size(); - {assert(stack_depth == context.stack.size()); return; } + STACK_CHECK(context); + return; } void monks2text(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonk2text1; context.al = 8; @@ -1671,7 +1671,7 @@ notmonk2text4: context._cmp(context.data.byte(kIntrocount), 13); if (!context.flags.z()) goto notmonk2text5; context.data.byte(kIntrocount) = 17; - {assert(stack_depth == context.stack.size()); return; } + return; context.al = 12; context.bl = 0; context.bh = 120; @@ -1728,17 +1728,17 @@ notmonk2text10: context.cx = 100; goto gotmonks2text; notmonk2text11: - {assert(stack_depth == context.stack.size()); return; } + return; gotmonks2text: context.dx = 1; context.cx = 120; context.ah = 82; setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intro1text(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 2); if (!context.flags.z()) goto notintro1text1; context.al = 40; @@ -1763,21 +1763,21 @@ notintro1text2: context.cx = 90; goto gotintro1text; notintro1text3: - {assert(stack_depth == context.stack.size()); return; } + return; gotintro1text: context.dx = 1; context.ah = 82; context._cmp(context.data.byte(kCh1playing), 255); if (context.flags.z()) goto oktalk2; context._dec(context.data.byte(kIntrocount)); - {assert(stack_depth == context.stack.size()); return; } + return; oktalk2: setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intro2text(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ax, 5); if (!context.flags.z()) goto notintro2text1; context.al = 43; @@ -1794,16 +1794,16 @@ notintro2text1: context.cx = 90; goto gotintro2text; notintro2text2: - {assert(stack_depth == context.stack.size()); return; } + return; gotintro2text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intro3text(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ax, 107); if (!context.flags.z()) goto notintro3text1; context.al = 45; @@ -1820,16 +1820,16 @@ notintro3text1: context.cx = 100; goto gotintro3text; notintro3text2: - {assert(stack_depth == context.stack.size()); return; } + return; gotintro3text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void monkandryan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notmonkryan; context.ax = context.es.word(context.bx+3); @@ -1846,16 +1846,16 @@ void monkandryan(Context & context) { context._cmp(context.data.byte(kIntrocount), 57); if (!context.flags.z()) goto gotmonkryan; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; gotmonkryan: context.es.word(context.bx+3) = context.ax; notmonkryan: showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void endgameseq(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notendseq; context.ax = context.es.word(context.bx+3); @@ -1909,11 +1909,11 @@ notendseq: context.es.word(context.bx+3) = 146; rollendcredits(context); notendcreds: - {assert(stack_depth == context.stack.size()); return; } + return; } void rollendcredits(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 16; context.ah = 255; playchannel0(context); @@ -1998,11 +1998,11 @@ gotnext: hangon(context); paneltomap(context); fadescreenuphalf(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void priest(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; context.data.byte(kPointermode) = 0; @@ -2016,13 +2016,13 @@ void priest(Context & context) { context.bx = context.pop(); context.es = context.pop(); priestwait: - {assert(stack_depth == context.stack.size()); return; } + return; priestspoken: - {assert(stack_depth == context.stack.size()); return; } + return; } void madmanstelly(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 307); @@ -2031,11 +2031,11 @@ void madmanstelly(Context & context) { notendtelly: context.es.word(context.bx+3) = context.ax; showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void madman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) goto nomadspeed; @@ -2087,7 +2087,7 @@ nomadspeed: context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; madmode(context); - {assert(stack_depth == context.stack.size()); return; } + return; madmanspoken: context._cmp(context.data.byte(kWongame), 1); if (context.flags.z()) goto alreadywon; @@ -2098,15 +2098,15 @@ madmanspoken: context.bx = context.pop(); context.es = context.pop(); alreadywon: - {assert(stack_depth == context.stack.size()); return; } + return; ryansded: context.data.byte(kMandead) = 2; showgamereel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void madmantext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSpeechcount), 63); if (!context.flags.c()) goto nomadtext; context._cmp(context.data.byte(kCh1playing), 255); @@ -2121,11 +2121,11 @@ void madmantext(Context & context) { context.ah = 82; setuptimedtemp(context); nomadtext: - {assert(stack_depth == context.stack.size()); return; } + return; } void madmode(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; context._cmp(context.data.byte(kCombatcount), 65); @@ -2134,11 +2134,11 @@ void madmode(Context & context) { if (!context.flags.c()) goto iswatchmad; context.data.byte(kPointermode) = 2; iswatchmad: - {assert(stack_depth == context.stack.size()); return; } + return; } void priesttext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; context._cmp(context.es.word(context.bx+3), 7); @@ -2155,11 +2155,11 @@ void priesttext(Context & context) { context.dx = 1; setuptimeduse(context); nopriesttext: - {assert(stack_depth == context.stack.size()); return; } + return; } void textforend(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 20); if (!context.flags.z()) goto notendtext1; context.al = 0; @@ -2184,16 +2184,16 @@ notendtext2: context.cx = 60; goto gotendtext; notendtext3: - {assert(stack_depth == context.stack.size()); return; } + return; gotendtext: context.dx = 1; context.ah = 83; setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void textformonk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonktext1; context.al = 19; @@ -2304,21 +2304,21 @@ notmonktext13: context.data.byte(kVolumeto) = 7; context.data.byte(kVolumedirection) = 1; notendtitles: - {assert(stack_depth == context.stack.size()); return; } + return; gotmonktext: context.dx = 1; context.ah = 82; context._cmp(context.data.byte(kCh1playing), 255); if (context.flags.z()) goto oktalk; context._dec(context.data.byte(kIntrocount)); - {assert(stack_depth == context.stack.size()); return; } + return; oktalk: setuptimedtemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void drunk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto trampgone; context.al = context.es.byte(context.bx+7); @@ -2327,11 +2327,11 @@ void drunk(Context & context) { showgamereel(context); addtopeoplelist(context); trampgone: - {assert(stack_depth == context.stack.size()); return; } + return; } void advisor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto noadvisor; goto noadvisor; @@ -2356,11 +2356,11 @@ gotadvframe: noadvisor: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void copper(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto nocopper; context.ax = context.es.word(context.bx+3); @@ -2387,11 +2387,11 @@ gotcopframe: nocopper: showgamereel(context); addtopeoplelist(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void sparky(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto animsparky; context.es.byte(context.bx+7) = 3; @@ -2421,12 +2421,12 @@ finishsparky: if (context.flags.z()) goto nottalkedsparky; context.data.byte(kTalkedtosparky) = 1; nottalkedsparky: - {assert(stack_depth == context.stack.size()); return; } + return; } void train(Context & context) { - uint stack_depth = context.stack.size(); - {assert(stack_depth == context.stack.size()); return; } + STACK_CHECK(context); + return; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 21); if (!context.flags.c()) goto notrainyet; @@ -2445,11 +2445,11 @@ gottrainframe: context.es.word(context.bx+3) = context.ax; showgamereel(context); notrainatall: - {assert(stack_depth == context.stack.size()); return; } + return; } void addtopeoplelist(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.push(context.bx); @@ -2464,11 +2464,11 @@ void addtopeoplelist(Context & context) { context.bx = context.pop(); context.es = context.pop(); context._add(context.data.word(kListpos), 5); - {assert(stack_depth == context.stack.size()); return; } + return; } void showgamereel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) goto noshow; @@ -2481,11 +2481,11 @@ void showgamereel(Context & context) { context.ax = context.data.word(kReelpointer); context.es.word(context.bx+3) = context.ax; noshow: - {assert(stack_depth == context.stack.size()); return; } + return; } void checkspeed(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLastweapon), -1); if (!context.flags.z()) goto forcenext; context._inc(context.es.byte(context.bx+6)); @@ -2496,24 +2496,24 @@ void checkspeed(Context & context) { context.es.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); notspeed: - {assert(stack_depth == context.stack.size()); return; } + return; forcenext: context._cmp(context.al, context.al); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearsprites(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; while(context.cx--) context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void makesprite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: @@ -2529,20 +2529,20 @@ _tmp17a: context.es.word(context.bx+2) = 0x0ffff; context.es.byte(context.bx+15) = 0; context.es.byte(context.bx+18) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void delsprite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.bx; context.cx = (32); context.al = 255; while(context.cx--) context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void spriteupdate(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = context.data.byte(kRyanon); @@ -2571,11 +2571,11 @@ _tmp18a: context._add(context.bx, (32)); if (--context.cx) goto _tmp18; _tmp18b: - {assert(stack_depth == context.stack.size()); return; } + return; } void printsprites(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = 0; priorityloop: @@ -2604,11 +2604,11 @@ skipsprite: context._inc(context.cx); context._cmp(context.cx, 7); if (!context.flags.z()) goto priorityloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void printasprite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.si = context.bx; @@ -2641,11 +2641,11 @@ notquickp: showframe(context); context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkone(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); context.al = context.ch; context.ah = 0; @@ -2677,31 +2677,31 @@ void checkone(Context & context) { context.cx = context.ax; context._lodsb(); context.dx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void findsource(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kCurrentframe); context._cmp(context.ax, 160); if (!context.flags.c()) goto over1000; context.ds = context.data.word(kReel1); context.data.word(kTakeoff) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; over1000: context._cmp(context.ax, 320); if (!context.flags.c()) goto over1001; context.ds = context.data.word(kReel2); context.data.word(kTakeoff) = 160; - {assert(stack_depth == context.stack.size()); return; } + return; over1001: context.ds = context.data.word(kReel3); context.data.word(kTakeoff) = 320; - {assert(stack_depth == context.stack.size()); return; } + return; } void initman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.si = context.ax; @@ -2712,11 +2712,11 @@ void initman(Context & context) { context.es.byte(context.bx+23) = 4; context.es.byte(context.bx+22) = 0; context.es.byte(context.bx+29) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void mainman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kResetmanxy), 1); if (!context.flags.z()) goto notinnewroom; context.data.byte(kResetmanxy) = 0; @@ -2729,7 +2729,7 @@ notinnewroom: context._dec(context.es.byte(context.bx+22)); context._cmp(context.es.byte(context.bx+22), -1); if (context.flags.z()) goto executewalk; - {assert(stack_depth == context.stack.size()); return; } + return; executewalk: context.es.byte(context.bx+22) = 0; context.al = context.data.byte(kTurntoface); @@ -2796,11 +2796,11 @@ notwalk: context.ax = context.es.word(context.bx+10); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - {assert(stack_depth == context.stack.size()); return; } + return; } void aboutturn(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kTurndirection), 1); if (context.flags.z()) goto incdir; context._cmp(context.data.byte(kTurndirection), -1); @@ -2823,7 +2823,7 @@ incdir: context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; decdir: context.data.byte(kTurndirection) = -1; context.al = context.data.byte(kFacing); @@ -2831,11 +2831,11 @@ decdir: context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void walking(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalwalk; context.al = context.data.byte(kLinepointer); @@ -2864,7 +2864,7 @@ continuewalk: context.es = context.pop(); stillline: context.es.word(context.bx+10) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; endofline: context.data.byte(kLinepointer) = 254; context.al = context.data.byte(kDestination); @@ -2878,14 +2878,14 @@ endofline: autosetwalk(context); context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; finishedwalk: facerightway(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void facerightway(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); getroomspaths(context); @@ -2900,11 +2900,11 @@ void facerightway(Context & context) { context.data.byte(kLeavedirection) = context.al; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkforexit(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); context.ch = context.data.byte(kRyany); @@ -2919,7 +2919,7 @@ void checkforexit(Context & context) { if (context.flags.z()) goto notnewdirect; context.al = context.data.byte(kLastflagex); context.data.byte(kAutolocation) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; notnewdirect: context._test(context.al, 32); if (context.flags.z()) goto notleave; @@ -2966,38 +2966,38 @@ notravmessage: context.data.byte(kTurntoface) = context.al; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; notlouis: context.bx = context.pop(); context.es = context.pop(); context.data.byte(kNeedtotravel) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notleave: context._test(context.al, 4); if (context.flags.z()) goto notaleft; adjustleft(context); - {assert(stack_depth == context.stack.size()); return; } + return; notaleft: context._test(context.al, 2); if (context.flags.z()) goto notaright; adjustright(context); - {assert(stack_depth == context.stack.size()); return; } + return; notaright: context._test(context.al, 8); if (context.flags.z()) goto notadown; adjustdown(context); - {assert(stack_depth == context.stack.size()); return; } + return; notadown: context._test(context.al, 16); if (context.flags.z()) goto notanup; adjustup(context); - {assert(stack_depth == context.stack.size()); return; } + return; notanup: - {assert(stack_depth == context.stack.size()); return; } + return; } void adjustdown(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context._add(context.data.byte(kMapy), 10); @@ -3008,11 +3008,11 @@ void adjustdown(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void adjustup(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context._sub(context.data.byte(kMapy), 10); @@ -3023,11 +3023,11 @@ void adjustup(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void adjustleft(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.data.byte(kLastflag) = 0; @@ -3039,11 +3039,11 @@ void adjustleft(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void adjustright(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context._add(context.data.byte(kMapx), 11); @@ -3055,11 +3055,11 @@ void adjustright(Context & context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void reminders(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedenslift; context._cmp(context.data.byte(kMapx), 44); @@ -3094,7 +3094,7 @@ void reminders(Context & context) { havegotcard: context._inc(context.data.byte(kProgresspoints)); notfirst: - {assert(stack_depth == context.stack.size()); return; } + return; forgotone: context.al = 50; context.bl = 54; @@ -3102,13 +3102,13 @@ forgotone: context.cx = 48; context.dx = 8; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notinedenslift: - {assert(stack_depth == context.stack.size()); return; } + return; } void initrain(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)); context.bx = 1113; @@ -3164,11 +3164,11 @@ initrainside2: finishinitrain: context.al = 255; context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void splitintolines(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); lookforlinestart: getblockofpixel(context); context._cmp(context.al, 0); @@ -3214,11 +3214,11 @@ foundlineend: if (!context.flags.c()) goto endofthisline; goto lookforlinestart; endofthisline: - {assert(stack_depth == context.stack.size()); return; } + return; } void getblockofpixel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); context.push(context.es); context.push(context.di); @@ -3232,17 +3232,17 @@ void getblockofpixel(Context & context) { context.di = context.pop(); context.es = context.pop(); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; failrain: context.di = context.pop(); context.es = context.pop(); context.cx = context.pop(); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void showrain(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kMainsprites); context.si = 6*58; context.ax = context.ds.word(context.si+2); @@ -3316,11 +3316,11 @@ notlouisthund: isthunder1: playchannel1(context); nothunder: - {assert(stack_depth == context.stack.size()); return; } + return; } void backobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kSetdat); context.di = context.es.word(context.bx+20); context.al = context.es.byte(context.bx+18); @@ -3365,11 +3365,11 @@ notdoor: steadyob: steady(context); finishback: - {assert(stack_depth == context.stack.size()); return; } + return; } void liftsprite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kLiftflag); context._cmp(context.al, 0); if (context.flags.z()) goto liftclosed; @@ -3390,7 +3390,7 @@ void liftsprite(Context & context) { goto pokelift; finishclose: context.data.byte(kLiftflag) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; openlift: context.al = context.es.byte(context.bx+19); context._cmp(context.al, 12); @@ -3411,10 +3411,10 @@ pokelift: context.di = context.pop(); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; endoflist: context.data.byte(kLiftflag) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; liftopen: context.al = context.data.byte(kLiftpath); context.push(context.es); @@ -3450,21 +3450,21 @@ nocountopen: } void liftnoise(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 5); if (context.flags.z()) goto hissnoise; context._cmp(context.data.byte(kReallocation), 21); if (context.flags.z()) goto hissnoise; playchannel1(context); - {assert(stack_depth == context.stack.size()); return; } + return; hissnoise: context.al = 13; playchannel1(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void random(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); randomnum1(context); context.push(context.di); context._and(context.ax, 7); @@ -3473,19 +3473,19 @@ void random(Context & context) { context.al = context.ds.byte(context.di); context.di = context.pop(); context.es.byte(context.bx+15) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void steady(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; context.es.byte(context.bx+15) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void constant(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.es.byte(context.bx+19)); context.cl = context.es.byte(context.bx+19); context.ch = 0; @@ -3500,31 +3500,31 @@ gotconst: context._sub(context.di, context.cx); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void doorway(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 10; context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 10; dodoor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void widedoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 24; context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 24; dodoor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dodoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); @@ -3583,7 +3583,7 @@ atlast1: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context.data.byte(kThroughdoor) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; shutdoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); @@ -3611,11 +3611,11 @@ atlast2: if (!context.flags.z()) goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: - {assert(stack_depth == context.stack.size()); return; } + return; } void lockeddoorway(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); context.cl = context.es.byte(context.bx+10); @@ -3688,7 +3688,7 @@ atlast3: if (!context.flags.z()) goto justshutting; context.data.byte(kThroughdoor) = 1; justshutting: - {assert(stack_depth == context.stack.size()); return; } + return; shutdoor2: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); @@ -3719,7 +3719,7 @@ atlast4: context.es = context.pop(); context.data.byte(kLockstatus) = 1; notlocky: - {assert(stack_depth == context.stack.size()); return; } + return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: context.cl = context.es.byte(context.bx+19); @@ -3748,12 +3748,12 @@ atlast2: if (!context.flags.z()) goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: - {assert(stack_depth == context.stack.size()); return; } - {assert(stack_depth == context.stack.size()); return; } + return; + return; } void updatepeople(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.data.word(kListpos) = context.di; @@ -3784,11 +3784,11 @@ notinthisroom: context._add(context.di, 2); goto updateloop; endupdate: - {assert(stack_depth == context.stack.size()); return; } + return; } void getreelframeax(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ds); context.data.word(kCurrentframe) = context.ax; findsource(context); @@ -3801,21 +3801,21 @@ void getreelframeax(Context & context) { context._add(context.ax, context.ax); context._add(context.ax, context.cx); context.bx = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void reelsonscreen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); reconstruct(context); updatepeople(context); watchreel(context); showrain(context); usetimedtext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void plotreel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getreelstart(context); retryreel: context.push(context.es); @@ -3850,11 +3850,11 @@ notplot: soundonreels(context); context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void soundonreels(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bl = context.data.byte(kReallocation); context._add(context.bl, context.bl); context._xor(context.bh, context.bh); @@ -3891,11 +3891,11 @@ endreelsound: if (context.flags.z()) goto nochange2; context.data.word(kLastsoundreel) = -1; nochange2: - {assert(stack_depth == context.stack.size()); return; } + return; } void reconstruct(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kHavedoneobs), 0); if (context.flags.z()) goto noneedtorecon; context.data.byte(kNewobs) = 1; @@ -3904,105 +3904,105 @@ void reconstruct(Context & context) { printsprites(context); context.data.byte(kHavedoneobs) = 0; noneedtorecon: - {assert(stack_depth == context.stack.size()); return; } + return; } void dealwithspecial(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._sub(context.al, 220); context._cmp(context.al, 0); if (!context.flags.z()) goto notplset; context.al = context.ah; placesetobject(context); context.data.byte(kHavedoneobs) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notplset: context._cmp(context.al, 1); if (!context.flags.z()) goto notremset; context.al = context.ah; removesetobject(context); context.data.byte(kHavedoneobs) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notremset: context._cmp(context.al, 2); if (!context.flags.z()) goto notplfree; context.al = context.ah; placefreeobject(context); context.data.byte(kHavedoneobs) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notplfree: context._cmp(context.al, 3); if (!context.flags.z()) goto notremfree; context.al = context.ah; removefreeobject(context); context.data.byte(kHavedoneobs) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notremfree: context._cmp(context.al, 4); if (!context.flags.z()) goto notryanoff; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notryanoff: context._cmp(context.al, 5); if (!context.flags.z()) goto notryanon; context.data.byte(kTurntoface) = context.ah; context.data.byte(kFacing) = context.ah; switchryanon(context); - {assert(stack_depth == context.stack.size()); return; } + return; notryanon: context._cmp(context.al, 6); if (!context.flags.z()) goto notchangeloc; context.data.byte(kNewlocation) = context.ah; - {assert(stack_depth == context.stack.size()); return; } + return; notchangeloc: movemap(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void movemap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; context._sub(context.data.byte(kMapy), 20); context.data.byte(kNowinnewroom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notmapup2: context._cmp(context.ah, 16); if (!context.flags.z()) goto notmapupspec; context._sub(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notmapupspec: context._cmp(context.ah, 8); if (!context.flags.z()) goto notmapdownspec; context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notmapdownspec: context._cmp(context.ah, 2); if (!context.flags.z()) goto notmaprightspec; context._add(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notmaprightspec: context._sub(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void getreelstart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kReelpointer); context.cx = 40; context._mul(context.cx); context.es = context.data.word(kReels); context.si = context.ax; context._add(context.si, (0+(36*144))); - {assert(stack_depth == context.stack.size()); return; } + return; } void showreelframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.si+2); context.ah = 0; context.di = context.ax; @@ -4017,27 +4017,27 @@ void showreelframe(Context & context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 8; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void deleverything(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kMapysize); context.ah = 0; context._add(context.ax, context.data.word(kMapoffsety)); context._cmp(context.ax, 182); if (!context.flags.c()) goto bigroom; maptopanel(context); - {assert(stack_depth == context.stack.size()); return; } + return; bigroom: context._sub(context.data.byte(kMapysize), 8); maptopanel(context); context._add(context.data.byte(kMapysize), 8); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpeverything(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); dumpevery1: @@ -4089,19 +4089,19 @@ dumpevery2: context._add(context.bx, 5); goto dumpevery2; finishevery2: - {assert(stack_depth == context.stack.size()); return; } + return; } void allocatework(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = 0x1000; allocatemem(context); context.data.word(kWorkspace) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void readabyte(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.si, 30000); if (!context.flags.z()) goto notendblock; context.push(context.bx); @@ -4118,11 +4118,11 @@ void readabyte(Context & context) { context.si = 0; notendblock: context._lodsb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadpalfromiff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2481; openfile(context); context.cx = 2000; @@ -4154,11 +4154,11 @@ palloop: nought: context._stosb(); if (--context.cx) goto palloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void paneltomap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4168,11 +4168,11 @@ void paneltomap(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiget(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void maptopanel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4182,11 +4182,11 @@ void maptopanel(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiput(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpmap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); context.bx = context.data.word(kMapystart); @@ -4194,11 +4194,11 @@ void dumpmap(Context & context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void pixelcheckset(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context._sub(context.al, context.es.byte(context.bx)); context._sub(context.ah, context.es.byte(context.bx+1)); @@ -4235,11 +4235,11 @@ void pixelcheckset(Context & context) { context.es = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - {assert(stack_depth == context.stack.size()); return; } + return; } void createpanel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 0; context.bx = 8; context.ds = context.data.word(kIcons2); @@ -4264,11 +4264,11 @@ void createpanel(Context & context) { context.al = 0; context.ah = 2; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void createpanel2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); context.di = 0; context.bx = 0; @@ -4282,11 +4282,11 @@ void createpanel2(Context & context) { context.al = 5; context.ah = 2; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearwork(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = 0x0; context.es = context.data.word(kWorkspace); context.di = 0; @@ -4325,23 +4325,23 @@ clearloop: context._stosw(); context._stosw(); if (--context.cx) goto clearloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void zoom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto inwatching; context._cmp(context.data.byte(kZoomon), 1); if (context.flags.z()) goto zoomswitch; inwatching: - {assert(stack_depth == context.stack.size()); return; } + return; zoomswitch: context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.c()) goto zoomit; cantzoom: putunderzoom(context); - {assert(stack_depth == context.stack.size()); return; } + return; zoomit: context.ax = context.data.word(kOldpointery); context._sub(context.ax, 9); @@ -4373,11 +4373,11 @@ zoomloop2: if (--context.cx) goto zoomloop; crosshair(context); context.data.byte(kDidzoom) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void delthisone(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.al = context.ah; @@ -4417,11 +4417,11 @@ deloneloop: context._add(context.si, context.dx); context._dec(context.ch); if (!context.flags.z()) goto deloneloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void width160(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._movsw(); context._movsw(); context._movsw(); @@ -4651,11 +4651,11 @@ void width160(Context & context) { width1: context._movsw(); width0: - {assert(stack_depth == context.stack.size()); return; } + return; } void doblocks(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kWorkspace); context.ax = context.data.word(kMapady); context.cx = (320); @@ -4767,11 +4767,11 @@ zeroblock: context.di = context.pop(); context._add(context.di, (320)*16); if (--context.cx) goto loop120; - {assert(stack_depth == context.stack.size()); return; } + return; } void showframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.push(context.ax); context.cx = context.ax; @@ -4785,7 +4785,7 @@ void showframe(Context & context) { context.ax = context.pop(); context.dx = context.pop(); context.cx = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notblankshow: context._test(context.ah, 128); if (!context.flags.z()) goto skipoffsets; @@ -4822,7 +4822,7 @@ notcentred: context.push(context.cx); frameoutfx(context); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; notdiffdest: context._test(context.ah, 8); if (context.flags.z()) goto notprintlist; @@ -4842,7 +4842,7 @@ notprintlist: context.push(context.cx); frameoutfx(context); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; notflippedx: context._test(context.ah, 2); if (context.flags.z()) goto notnomask; @@ -4851,7 +4851,7 @@ notflippedx: context.push(context.cx); frameoutnm(context); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; notnomask: context._test(context.ah, 32); if (context.flags.z()) goto noeffects; @@ -4860,18 +4860,18 @@ notnomask: context.push(context.cx); frameoutbh(context); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; noeffects: context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); frameoutv(context); context.cx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void frameoutv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4896,7 +4896,7 @@ backtoother: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloop1; - {assert(stack_depth == context.stack.size()); return; } + return; frameloop3: context._lodsb(); context._cmp(context.al, 0); @@ -4908,11 +4908,11 @@ backtosolid: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloop1; - {assert(stack_depth == context.stack.size()); return; } + return; } void frameoutbh(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4942,11 +4942,11 @@ nextline: context.cx = context.pop(); context._dec(context.ch); if (!context.flags.z()) goto bhloop2; - {assert(stack_depth == context.stack.size()); return; } + return; } void frameoutfx(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; context.bx = context.dx; @@ -4971,7 +4971,7 @@ backtootherfx: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; - {assert(stack_depth == context.stack.size()); return; } + return; frameloopfx3: context._lodsb(); context._cmp(context.al, 0); @@ -4984,11 +4984,11 @@ backtosolidfx: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; - {assert(stack_depth == context.stack.size()); return; } + return; } void transferinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kExframepos); context.push(context.di); context.al = context.data.byte(kExpos); @@ -5034,11 +5034,11 @@ void transferinv(Context & context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - {assert(stack_depth == context.stack.size()); return; } + return; } void transfermap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kExframepos); context.push(context.di); context.al = context.data.byte(kExpos); @@ -5082,11 +5082,11 @@ void transfermap(Context & context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - {assert(stack_depth == context.stack.size()); return; } + return; } void dofade(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kFadedirection), 0); if (context.flags.z()) goto finishfade; context.cl = context.data.byte(kNumtofade); @@ -5106,40 +5106,40 @@ void dofade(Context & context) { if (!context.flags.z()) goto finishfade; fadecalculation(context); finishfade: - {assert(stack_depth == context.stack.size()); return; } + return; } void clearendpal(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; while(context.cx--) context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearpalette(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kFadedirection) = 0; clearstartpal(context); dumpcurrent(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreenup(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearstartpal(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadetowhite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; @@ -5155,11 +5155,11 @@ void fadetowhite(Context & context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadefromwhite(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768; @@ -5175,22 +5175,22 @@ void fadefromwhite(Context & context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreenups(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearstartpal(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreendownhalf(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); paltoendpal(context); context.cx = 768; @@ -5216,44 +5216,44 @@ halfend: context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreenuphalf(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); endpaltostart(context); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreendown(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); clearendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - {assert(stack_depth == context.stack.size()); return; } + return; } void fadescreendowns(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); clearendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - {assert(stack_depth == context.stack.size()); return; } + return; } void clearstartpal(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 256; @@ -5263,11 +5263,11 @@ wholeloop1: context.al = 0; context._stosb(); if (--context.cx) goto wholeloop1; - {assert(stack_depth == context.stack.size()); return; } + return; } void showgun(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kAddtored) = 0; context.data.byte(kAddtogreen) = 0; context.data.byte(kAddtoblue) = 0; @@ -5318,17 +5318,17 @@ void showgun(Context & context) { loadtemptext(context); rollendcredits2(context); getridoftemptext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void rollendcredits2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); rollem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void rollem(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 160; context.ch = 160; context.di = 25; @@ -5409,15 +5409,15 @@ gotnext2: if (--context.cx) goto endcredits21; context.cx = 120; hangone(context); - {assert(stack_depth == context.stack.size()); return; } + return; endearly2: context.cx = context.pop(); endearly: - {assert(stack_depth == context.stack.size()); return; } + return; } void fadecalculation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kFadecount), 0); if (context.flags.z()) goto nomorefading; context.bl = context.data.byte(kFadecount); @@ -5444,14 +5444,14 @@ gotthere: context._inc(context.di); if (--context.cx) goto fadecolloop; context._dec(context.data.byte(kFadecount)); - {assert(stack_depth == context.stack.size()); return; } + return; nomorefading: context.data.byte(kFadedirection) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void greyscalesum(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); @@ -5503,55 +5503,55 @@ noaddb: context._add(context.si, 3); context.cx = context.pop(); if (--context.cx) goto greysumloop1; - {assert(stack_depth == context.stack.size()); return; } + return; } void paltostartpal(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void endpaltostart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void startpaltoend(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void paltoendpal(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(context.cx--) context._movsw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void allpalette(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); @@ -5559,11 +5559,11 @@ void allpalette(Context & context) { context.cx = 768/2; while(context.cx--) context._movsw(); dumpcurrent(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpcurrent(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.ds = context.data.word(kBuffers); vsync(context); @@ -5574,11 +5574,11 @@ void dumpcurrent(Context & context) { context.al = 128; context.cx = 128; showgroup(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fadedownmon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5595,11 +5595,11 @@ void fadedownmon(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 64; hangon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fadeupmon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5616,11 +5616,11 @@ void fadeupmon(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fadeupmonfirst(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5641,11 +5641,11 @@ void fadeupmonfirst(Context & context) { playchannel1(context); context.cx = 64; hangon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fadeupyellows(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltoendpal(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); @@ -5661,11 +5661,11 @@ void fadeupyellows(Context & context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void initialmoncols(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); paltostartpal(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); @@ -5680,19 +5680,19 @@ void initialmoncols(Context & context) { context.al = 230; context.cx = 18; showgroup(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void titles(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearpalette(context); biblequote(context); intro(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void endgame(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2260; loadtemptext(context); monkspeaking(context); @@ -5702,11 +5702,11 @@ void endgame(Context & context) { context.data.byte(kVolumedirection) = 1; context.cx = 200; hangon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void monkspeaking(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kRoomssample) = 35; loadroomssample(context); context.dx = 2364; @@ -5747,22 +5747,22 @@ notloadspeech2: context.cx = 300; hangon(context); getridoftemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showmonk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 0; context.ah = 128; context.di = 160; context.bx = 72; context.ds = context.data.word(kTempgraphics); showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void gettingshot(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kNewlocation) = 55; clearpalette(context); loadintroroom(context); @@ -5771,18 +5771,18 @@ void gettingshot(Context & context) { context.data.byte(kVolumedirection) = -1; runendseq(context); clearbeforeload(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void credits(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearpalette(context); realcredits(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void biblequote(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); mode640x480(context); context.dx = 2377; showpcx(context); @@ -5803,11 +5803,11 @@ void biblequote(Context & context) { cancelch0(context); biblequotearly: context.data.byte(kLasthardkey) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void hangone(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); hangonloope: context.push(context.cx); vsync(context); @@ -5816,11 +5816,11 @@ hangonloope: if (context.flags.z()) goto hangonearly; if (--context.cx) goto hangonloope; hangonearly: - {assert(stack_depth == context.stack.size()); return; } + return; } void intro(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2247; loadtemptext(context); loadpalfromiff(context); @@ -5861,11 +5861,11 @@ void intro(Context & context) { clearbeforeload(context); introearly: context.data.byte(kLasthardkey) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void runintroseq(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kGetback) = 0; moreintroseq: vsync(context); @@ -5890,15 +5890,15 @@ moreintroseq: if (context.flags.z()) goto earlyendrun; context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreintroseq; - {assert(stack_depth == context.stack.size()); return; } + return; earlyendrun: getridoftemptext(context); clearbeforeload(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void runendseq(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); atmospheres(context); context.data.byte(kGetback) = 0; moreendseq: @@ -5916,11 +5916,11 @@ moreendseq: vsync(context); context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreendseq; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadintroroom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kIntrocount) = 0; context.data.byte(kLocation) = 255; loadroom(context); @@ -5937,11 +5937,11 @@ void loadintroroom(Context & context) { spriteupdate(context); printsprites(context); worktoscreen(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void realcredits(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kRoomssample) = 33; loadroomssample(context); context.data.byte(kVolume) = 0; @@ -6062,11 +6062,11 @@ void realcredits(Context & context) { hangone(context); realcreditsearly: context.data.byte(kLasthardkey) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void printchar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.al, 255); if (context.flags.z()) goto ignoreit; context.push(context.si); @@ -6090,16 +6090,16 @@ nokern: context._add(context.di, context.cx); context.cx = context.pop(); ignoreit: - {assert(stack_depth == context.stack.size()); return; } + return; } void kernchars(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.al, 'a'); if (context.flags.z()) goto iskern; context._cmp(context.al, 'u'); if (context.flags.z()) goto iskern; - {assert(stack_depth == context.stack.size()); return; } + return; iskern: context._cmp(context.ah, 'n'); if (context.flags.z()) goto kernit; @@ -6111,14 +6111,14 @@ iskern: if (context.flags.z()) goto kernit; context._cmp(context.ah, 'l'); if (context.flags.z()) goto kernit; - {assert(stack_depth == context.stack.size()); return; } + return; kernit: context._dec(context.cl); - {assert(stack_depth == context.stack.size()); return; } + return; } void printslow(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kPointerframe) = 1; context.data.byte(kPointermode) = 3; context.ds = context.data.word(kCharset1); @@ -6198,7 +6198,7 @@ finishslow: context.di = context.pop(); context.bx = context.pop(); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; finishslow2: context.es = context.pop(); context.si = context.pop(); @@ -6207,11 +6207,11 @@ finishslow2: context.di = context.pop(); context.bx = context.pop(); context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void waitframes(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.di); context.push(context.bx); context.push(context.es); @@ -6228,11 +6228,11 @@ void waitframes(Context & context) { context.es = context.pop(); context.bx = context.pop(); context.di = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void printboth(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.cx); context.push(context.bx); @@ -6246,11 +6246,11 @@ void printboth(Context & context) { context.bx = context.pop(); context.cx = context.pop(); context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void printdirect(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kLastxpos) = context.di; context.ds = context.data.word(kCurrentset); printloop6: @@ -6282,11 +6282,11 @@ finishdirct: context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void monprint(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kKerning) = 1; context.si = context.bx; context.dl = 166; @@ -6361,11 +6361,11 @@ nottrigger2: scrollmonitor(context); context.bx = context.si; context.data.byte(kKerning) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void getnumber(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = 0; context.push(context.si); context.push(context.bx); @@ -6414,7 +6414,7 @@ gotoverend: context.si = context.pop(); context._add(context.di, context.ax); context.cl = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; notcentre: context.es = context.pop(); context.ds = context.pop(); @@ -6422,7 +6422,7 @@ notcentre: context.bx = context.pop(); context.si = context.pop(); context.cl = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; endoftext: context.al = context.cl; context.ah = 0; @@ -6457,7 +6457,7 @@ gotoverend2: context.si = context.pop(); context._add(context.di, context.ax); context.cl = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; notcent2: context.es = context.pop(); context.ds = context.pop(); @@ -6465,11 +6465,11 @@ notcent2: context.bx = context.pop(); context.si = context.pop(); context.cl = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; } void getnextword(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = 0; getloop: context.ax = context.es.word(context.di); @@ -6499,15 +6499,15 @@ getloop: endword: context._add(context.bl, 6); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; endall: context._add(context.bl, 6); context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void fillryan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32); findallryan(context); @@ -6547,11 +6547,11 @@ ryanloop1: context._add(context.bx, (44)); if (--context.cx) goto ryanloop2; showryanpage(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void fillopen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); deltextline(context); getopenedsize(context); context._cmp(context.ah, 4); @@ -6589,11 +6589,11 @@ nextopenslot: context._cmp(context.cl, 5); if (!context.flags.z()) goto openloop1; undertextline(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void findallryan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.di); context.cx = 30; context.ax = 0x0ffff; @@ -6622,11 +6622,11 @@ notinryaninv: context._inc(context.ch); context._cmp(context.ch, (114)); if (!context.flags.z()) goto findryanloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void findallopen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.di); context.cx = 16; context.ax = 0x0ffff; @@ -6688,11 +6688,11 @@ findopen2a: context._inc(context.ch); context._cmp(context.ch, 80); if (!context.flags.z()) goto findopen1a; - {assert(stack_depth == context.stack.size()); return; } + return; } void obtoinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.bx); context.push(context.es); context.push(context.si); @@ -6746,29 +6746,29 @@ finishfill: context.si = context.pop(); context.es = context.pop(); context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void isitworn(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) goto notworn; context.al = context.es.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); notworn: - {assert(stack_depth == context.stack.size()); return; } + return; } void makeworn(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es.byte(context.bx+12) = 'W'-'A'; context.es.byte(context.bx+13) = 'E'-'A'; - {assert(stack_depth == context.stack.size()); return; } + return; } void examineob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kPointermode) = 0; context.data.word(kTimecount) = 0; examineagain: @@ -6826,15 +6826,15 @@ iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void makemainscreen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); context.data.byte(kNewobs) = 1; drawfloor(context); @@ -6849,22 +6849,22 @@ void makemainscreen(Context & context) { worktoscreenm(context); context.data.byte(kCommandtype) = 200; context.data.byte(kManisoffscreen) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void getbackfromob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 1); if (!context.flags.z()) goto notheldob; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; notheldob: getback1(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void incryanpage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyincryan; context.data.byte(kCommandtype) = 222; @@ -6877,7 +6877,7 @@ alreadyincryan: context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; noincryan: - {assert(stack_depth == context.stack.size()); return; } + return; doincryan: context.ax = context.data.word(kMousex); context._sub(context.ax, (80)+167); @@ -6892,11 +6892,11 @@ findnewpage: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void openinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kInvopen) = 1; context.al = 61; context.di = (80); @@ -6905,11 +6905,11 @@ void openinv(Context & context) { printmessage(context); fillryan(context); context.data.byte(kCommandtype) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void showryanpage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = (80)+167; context.bx = (58)-12; @@ -6930,11 +6930,11 @@ void showryanpage(Context & context) { context.ax = context.pop(); context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void openob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kOpenedob); context.ah = context.data.byte(kOpenedtype); context.di = 5847; @@ -6962,11 +6962,11 @@ void openob(Context & context) { context._add(context.ax, (80)); context.bx = 2588; context.cs.word(context.bx) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void obicons(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); @@ -6984,22 +6984,22 @@ cantopenit: context.al = 1; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void examicon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kIcons2); context.di = 254; context.bx = 5; context.al = 3; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void obpicture(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context._cmp(context.ah, 1); @@ -7015,9 +7015,9 @@ void obpicture(Context & context) { context._inc(context.al); context.ah = 128; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; setframe: - {assert(stack_depth == context.stack.size()); return; } + return; exframe: context.ds = context.data.word(kExtras); context.di = 160; @@ -7028,11 +7028,11 @@ exframe: context._inc(context.al); context.ah = 128; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void describeob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getobtextstart(context); context.di = 33; context.bx = 92; @@ -7050,11 +7050,11 @@ void describeob(Context & context) { obsthatdothings(context); context.bx = context.pop(); additionaltext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void additionaltext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._add(context.bx, 10); context.push(context.bx); context.al = context.data.byte(kCommand); @@ -7074,7 +7074,7 @@ void additionaltext(Context & context) { compare(context); if (context.flags.z()) goto fullcup; context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; emptycup: context.al = 40; findpuztext(context); @@ -7083,7 +7083,7 @@ emptycup: context.dl = 241; context.ah = 0; printdirect(context); - {assert(stack_depth == context.stack.size()); return; } + return; fullcup: context.al = 39; findpuztext(context); @@ -7092,11 +7092,11 @@ fullcup: context.dl = 241; context.ah = 0; printdirect(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void obsthatdothings(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context.cl = 'M'; @@ -7113,13 +7113,13 @@ void obsthatdothings(Context & context) { setlocation(context); lookatcard(context); seencard: - {assert(stack_depth == context.stack.size()); return; } + return; notlouiscard: - {assert(stack_depth == context.stack.size()); return; } + return; } void getobtextstart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kFreedesc); context.si = (0); context.cx = (0+(82*2)); @@ -7155,15 +7155,15 @@ tryagain: context._cmp(context.al, ':'); if (context.flags.z()) goto findsometext; cantmakeoneup: - {assert(stack_depth == context.stack.size()); return; } + return; findsometext: searchforsame(context); goto tryagain; - {assert(stack_depth == context.stack.size()); return; } + return; } void searchforsame(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.si = context.cx; searchagain: context._inc(context.si); @@ -7177,7 +7177,7 @@ search: if (context.flags.c()) goto search; context.si = context.bx; context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; gotstartletter: context.push(context.bx); context.push(context.si); @@ -7198,11 +7198,11 @@ keepchecking: foundmatch: context.si = context.pop(); context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void findnextcolon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); isntcolon: context.al = context.es.byte(context.si); context._inc(context.si); @@ -7211,18 +7211,18 @@ isntcolon: context._cmp(context.al, ':'); if (!context.flags.z()) goto isntcolon; endofcolon: - {assert(stack_depth == context.stack.size()); return; } + return; } void inventory(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto iswatchinv; context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchinv; iswatchinv: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; notwatchinv: context._cmp(context.data.byte(kCommandtype), 239); if (context.flags.z()) goto alreadyopinv; @@ -7236,7 +7236,7 @@ alreadyopinv: context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; cantopinv: - {assert(stack_depth == context.stack.size()); return; } + return; doopeninv: context.data.word(kTimecount) = 0; context.data.byte(kPointermode) = 0; @@ -7313,20 +7313,20 @@ iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; examlist: invlist1: openchangesize: withlist1: - {assert(stack_depth == context.stack.size()); return; } + return; } void setpickup(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto cantpick; context._cmp(context.data.byte(kObjecttype), 3); @@ -7337,7 +7337,7 @@ void setpickup(Context & context) { if (!context.flags.z()) goto canpick; cantpick: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canpick: context._cmp(context.data.byte(kCommandtype), 209); if (context.flags.z()) goto alreadysp; @@ -7353,7 +7353,7 @@ alreadysp: context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto dosetpick; nosetpick: - {assert(stack_depth == context.stack.size()); return; } + return; dosetpick: createpanel(context); showpanel(context); @@ -7375,18 +7375,18 @@ dosetpick: context.es.byte(context.bx+3) = 255; openinv(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; pickupexob: context.al = context.data.byte(kCommand); context.data.byte(kItemframe) = context.al; context.data.byte(kOpenedob) = 255; openinv(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void examinventory(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadyexinv; context.data.byte(kCommandtype) = 249; @@ -7396,7 +7396,7 @@ alreadyexinv: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doexinv; - {assert(stack_depth == context.stack.size()); return; } + return; doexinv: createpanel(context); showpanel(context); @@ -7407,34 +7407,34 @@ doexinv: context.data.byte(kInvopen) = 2; openinv(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void reexfrominv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); context.data.byte(kCommandtype) = context.ah; context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void reexfromopen(Context & context) { - uint stack_depth = context.stack.size(); - {assert(stack_depth == context.stack.size()); return; } + STACK_CHECK(context); + return; findopenpos(context); context.ax = context.es.word(context.bx); context.data.byte(kCommandtype) = context.ah; context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void swapwithinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); @@ -7454,7 +7454,7 @@ alreadyswap1: context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; cantswap1: - {assert(stack_depth == context.stack.size()); return; } + return; doswap1: context.ah = context.data.byte(kObjecttype); context.al = context.data.byte(kItemframe); @@ -7488,11 +7488,11 @@ doswap1: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void swapwithopen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); @@ -7512,13 +7512,13 @@ alreadyswap2: context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; cantswap2: - {assert(stack_depth == context.stack.size()); return; } + return; doswap2: geteitherad(context); isitworn(context); if (!context.flags.z()) goto notwornswap; wornerror(context); - {assert(stack_depth == context.stack.size()); return; } + return; notwornswap: delpointer(context); context.al = context.data.byte(kItemframe); @@ -7528,12 +7528,12 @@ notwornswap: context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame2; errormessage1(context); - {assert(stack_depth == context.stack.size()); return; } + return; isntsame2: checkobjectsize(context); context._cmp(context.al, 0); if (context.flags.z()) goto sizeok2; - {assert(stack_depth == context.stack.size()); return; } + return; sizeok2: context.ah = context.data.byte(kObjecttype); context.al = context.data.byte(kItemframe); @@ -7583,22 +7583,22 @@ actuallyswap: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void intoinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout; outofinv(context); - {assert(stack_depth == context.stack.size()); return; } + return; notout: findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) goto canplace1; swapwithinv(context); - {assert(stack_depth == context.stack.size()); return; } + return; canplace1: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -7619,7 +7619,7 @@ alreadyplce: context._and(context.ax, 1); if (!context.flags.z()) goto doplace; notletgo2: - {assert(stack_depth == context.stack.size()); return; } + return; doplace: delpointer(context); context.al = context.data.byte(kItemframe); @@ -7635,11 +7635,11 @@ doplace: outofinv(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void deletetaken(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kFreedat); context.ah = context.data.byte(kReallocation); context.ds = context.data.word(kExtras); @@ -7659,23 +7659,23 @@ takenloop: notinhere: context._add(context.si, 16); if (--context.cx) goto takenloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void outofinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canpick2; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canpick2: context.bx = context.data.word(kMousebutton); context._cmp(context.bx, 2); if (!context.flags.z()) goto canpick2a; reexfrominv(context); - {assert(stack_depth == context.stack.size()); return; } + return; canpick2a: context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub3; @@ -7694,7 +7694,7 @@ alreadygrab: context._and(context.ax, 1); if (!context.flags.z()) goto dograb; notletgo: - {assert(stack_depth == context.stack.size()); return; } + return; dograb: delpointer(context); context.data.byte(kPickup) = 1; @@ -7711,45 +7711,45 @@ dograb: intoinv(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getfreead(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.cl = 4; context._shl(context.ax, context.cl); context.bx = context.ax; context.es = context.data.word(kFreedat); - {assert(stack_depth == context.stack.size()); return; } + return; } void getexad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.bx = 16; context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kExtras); context._add(context.bx, (0+2080+30000)); - {assert(stack_depth == context.stack.size()); return; } + return; } void geteitherad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isinexlist; context.al = context.data.byte(kItemframe); getfreead(context); - {assert(stack_depth == context.stack.size()); return; } + return; isinexlist: context.al = context.data.byte(kItemframe); getexad(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getanyad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isex; context._cmp(context.data.byte(kObjecttype), 2); @@ -7757,37 +7757,37 @@ void getanyad(Context & context) { context.al = context.data.byte(kCommand); getsetad(context); context.ax = context.es.word(context.bx+4); - {assert(stack_depth == context.stack.size()); return; } + return; isfree: context.al = context.data.byte(kCommand); getfreead(context); context.ax = context.es.word(context.bx+7); - {assert(stack_depth == context.stack.size()); return; } + return; isex: context.al = context.data.byte(kCommand); getexad(context); context.ax = context.es.word(context.bx+7); - {assert(stack_depth == context.stack.size()); return; } + return; } void getanyaddir(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ah, 4); if (context.flags.z()) goto isex3; context._cmp(context.ah, 2); if (context.flags.z()) goto isfree3; getsetad(context); - {assert(stack_depth == context.stack.size()); return; } + return; isfree3: getfreead(context); - {assert(stack_depth == context.stack.size()); return; } + return; isex3: getexad(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getopenedsize(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kOpenedtype), 4); if (context.flags.z()) goto isex2; context._cmp(context.data.byte(kOpenedtype), 2); @@ -7795,31 +7795,31 @@ void getopenedsize(Context & context) { context.al = context.data.byte(kOpenedob); getsetad(context); context.ax = context.es.word(context.bx+3); - {assert(stack_depth == context.stack.size()); return; } + return; isfree2: context.al = context.data.byte(kOpenedob); getfreead(context); context.ax = context.es.word(context.bx+7); - {assert(stack_depth == context.stack.size()); return; } + return; isex2: context.al = context.data.byte(kOpenedob); getexad(context); context.ax = context.es.word(context.bx+7); - {assert(stack_depth == context.stack.size()); return; } + return; } void getsetad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.bx = 64; context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kSetdat); - {assert(stack_depth == context.stack.size()); return; } + return; } void findinvpos(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); context.bx = -1; @@ -7844,11 +7844,11 @@ findinv2: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10)+32)); - {assert(stack_depth == context.stack.size()); return; } + return; } void findopenpos(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); context.bx = -1; @@ -7861,11 +7861,11 @@ findopenp1: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10))); - {assert(stack_depth == context.stack.size()); return; } + return; } void dropobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 223); if (context.flags.z()) goto alreadydrop; context.data.byte(kCommandtype) = 223; @@ -7882,13 +7882,13 @@ alreadydrop: context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; nodrop: - {assert(stack_depth == context.stack.size()); return; } + return; dodrop: geteitherad(context); isitworn(context); if (!context.flags.z()) goto nowornerror; wornerror(context); - {assert(stack_depth == context.stack.size()); return; } + return; nowornerror: context._cmp(context.data.byte(kReallocation), 47); if (context.flags.z()) goto nodrop2; @@ -7901,14 +7901,14 @@ nowornerror: if (context.flags.c()) goto nodroperror; nodrop2: droperror(context); - {assert(stack_depth == context.stack.size()); return; } + return; nodroperror: context._cmp(context.data.byte(kMapxsize), 64); if (!context.flags.z()) goto notinlift; context._cmp(context.data.byte(kMapysize), 64); if (!context.flags.z()) goto notinlift; droperror(context); - {assert(stack_depth == context.stack.size()); return; } + return; notinlift: context.al = context.data.byte(kItemframe); context.ah = 4; @@ -7953,11 +7953,11 @@ notinlift: context.data.byte(kPickup) = 0; context.al = context.data.byte(kReallocation); context.es.byte(context.bx) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void droperror(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7973,11 +7973,11 @@ void droperror(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void cantdrop(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -7993,11 +7993,11 @@ void cantdrop(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void wornerror(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -8013,11 +8013,11 @@ void wornerror(Context & context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void removeobfrominv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommand), 100); if (context.flags.z()) goto obnotexist; getanyad(context); @@ -8026,17 +8026,17 @@ void removeobfrominv(Context & context) { context.ch = 0; deleteexobject(context); obnotexist: - {assert(stack_depth == context.stack.size()); return; } + return; } void selectopenob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); if (!context.flags.z()) goto canopenit1; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canopenit1: context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyopob; @@ -8052,7 +8052,7 @@ alreadyopob: context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; noopenob: - {assert(stack_depth == context.stack.size()); return; } + return; doopenob: context.al = context.data.byte(kCommand); context.data.byte(kOpenedob) = context.al; @@ -8070,17 +8070,17 @@ doopenob: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useopened(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cannotuseopen; context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout2; outofopen(context); - {assert(stack_depth == context.stack.size()); return; } + return; notout2: findopenpos(context); context.ax = context.es.word(context.bx); @@ -8088,12 +8088,12 @@ notout2: if (context.flags.z()) goto canplace3; swapwithopen(context); cannotuseopen: - {assert(stack_depth == context.stack.size()); return; } + return; canplace3: context._cmp(context.data.byte(kPickup), 1); if (context.flags.z()) goto intoopen; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; intoopen: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -8114,13 +8114,13 @@ alreadyplc2: context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; notletgo3: - {assert(stack_depth == context.stack.size()); return; } + return; doplace2: geteitherad(context); isitworn(context); if (!context.flags.z()) goto notworntoopen; wornerror(context); - {assert(stack_depth == context.stack.size()); return; } + return; notworntoopen: delpointer(context); context.al = context.data.byte(kItemframe); @@ -8130,12 +8130,12 @@ notworntoopen: context._cmp(context.al, context.data.byte(kOpenedtype)); if (!context.flags.z()) goto isntsame; errormessage1(context); - {assert(stack_depth == context.stack.size()); return; } + return; isntsame: checkobjectsize(context); context._cmp(context.al, 0); if (context.flags.z()) goto sizeok1; - {assert(stack_depth == context.stack.size()); return; } + return; sizeok1: context.data.byte(kPickup) = 0; context.al = context.data.byte(kItemframe); @@ -8155,11 +8155,11 @@ sizeok1: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void errormessage1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); delpointer(context); context.di = 76; context.bx = 21; @@ -8180,11 +8180,11 @@ void errormessage1(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void errormessage2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); context.di = 76; @@ -8206,11 +8206,11 @@ void errormessage2(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void errormessage3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); delpointer(context); context.di = 76; context.bx = 21; @@ -8228,11 +8228,11 @@ void errormessage3(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkobjectsize(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getopenedsize(context); context.push(context.ax); context.al = context.data.byte(kItemframe); @@ -8267,14 +8267,14 @@ bothspecial: errormessage3(context); sizewrong: context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; sizeok: context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void outofopen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cantuseopen; findopenpos(context); @@ -8283,7 +8283,7 @@ void outofopen(Context & context) { if (!context.flags.z()) goto canpick4; cantuseopen: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canpick4: context._cmp(context.ax, context.data.word(kOldsubject)); if (!context.flags.z()) goto difsub4; @@ -8305,7 +8305,7 @@ alreadygrb: if (!context.flags.z()) goto notletgo4; reexfromopen(context); notletgo4: - {assert(stack_depth == context.stack.size()); return; } + return; dogrb: delpointer(context); context.data.byte(kPickup) = 1; @@ -8334,11 +8334,11 @@ actuallyout: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void transfertoex(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); emergencypurge(context); getexpos(context); context.al = context.data.byte(kExpos); @@ -8376,11 +8376,11 @@ void transfertoex(Context & context) { context.ds.byte(context.si+2) = 254; pickupconts(context); context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void pickupconts(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) goto notopenable; @@ -8413,11 +8413,11 @@ notinsidethis: context._cmp(context.cx, 80); if (!context.flags.z()) goto pickupcontloop; notopenable: - {assert(stack_depth == context.stack.size()); return; } + return; } void transfercontoex(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.push(context.dx); @@ -8444,11 +8444,11 @@ void transfercontoex(Context & context) { context.si = context.pop(); context.ds = context.pop(); context.ds.byte(context.si+2) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void transfertext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kExtras); context.al = context.data.byte(kExpos); context.ah = 0; @@ -8473,11 +8473,11 @@ moretext: context._inc(context.data.word(kExtextpos)); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; - {assert(stack_depth == context.stack.size()); return; } + return; } void getexpos(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kExtras); context.al = 0; context.di = (0+2080+30000); @@ -8490,11 +8490,11 @@ tryanotherex: if (!context.flags.z()) goto tryanotherex; foundnewex: context.data.byte(kExpos) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void purgealocation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.es = context.data.word(kExtras); context.di = (0+2080+30000); @@ -8519,11 +8519,11 @@ dontpurge: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto purgeloc; - {assert(stack_depth == context.stack.size()); return; } + return; } void emergencypurge(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); checkpurgeagain: context.ax = context.data.word(kExframepos); context._add(context.ax, 4000); @@ -8539,11 +8539,11 @@ notnearframeend: purgeanitem(context); goto checkpurgeagain; notneartextend: - {assert(stack_depth == context.stack.size()); return; } + return; } void purgeanitem(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kExtras); context.di = (0+2080+30000); context.bl = context.data.byte(kReallocation); @@ -8560,7 +8560,7 @@ iscup: context._cmp(context.es.byte(context.di+11), context.bl); if (context.flags.z()) goto cantpurge; deleteexobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; cantpurge: context._add(context.di, 16); context._inc(context.cx); @@ -8576,17 +8576,17 @@ lookforpurge2: context._cmp(context.es.byte(context.di+12), 255); if (!context.flags.z()) goto cantpurge2; deleteexobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; cantpurge2: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge2; - {assert(stack_depth == context.stack.size()); return; } + return; } void deleteexobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); context.push(context.cx); context.push(context.cx); @@ -8627,11 +8627,11 @@ notinsideex: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto deleteconts; - {assert(stack_depth == context.stack.size()); return; } + return; } void deleteexframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (0); context.ah = 0; context._add(context.ax, context.ax); @@ -8667,11 +8667,11 @@ beforethisone: context.es.word(context.di+2) = context.ax; context._add(context.di, 6); if (--context.cx) goto shuffleadsdown; - {assert(stack_depth == context.stack.size()); return; } + return; } void deleteextext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (0+2080+30000+(16*114)); context.ah = 0; context._add(context.ax, context.ax); @@ -8709,21 +8709,21 @@ beforethistext: context.es.word(context.di) = context.ax; context._add(context.di, 2); if (--context.cx) goto shuffletextads; - {assert(stack_depth == context.stack.size()); return; } + return; } void blockget(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = context.al; context.al = 0; context.ds = context.data.word(kBackdrop); context.si = (0+192); context._add(context.si, context.ax); - {assert(stack_depth == context.stack.size()); return; } + return; } void drawfloor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); eraseoldobs(context); @@ -8738,11 +8738,11 @@ void drawfloor(Context & context) { context.data.byte(kNewobs) = 0; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void calcmapad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getdimension(context); context.push(context.cx); context.push(context.dx); @@ -8766,11 +8766,11 @@ void calcmapad(Context & context) { context._mul(context.bx); context._add(context.ax, context.data.word(kMapoffsety)); context.data.word(kMapady) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void getdimension(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)); context.ch = 0; @@ -8847,11 +8847,11 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context.data.byte(kMapysize) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void addalong(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 11; addloop: context._cmp(context.es.byte(context.bx), 0); @@ -8860,14 +8860,14 @@ addloop: context._dec(context.ah); if (!context.flags.z()) goto addloop; context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; gotalong: context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void addlength(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 10; addloop2: context._cmp(context.es.byte(context.bx), 0); @@ -8876,14 +8876,14 @@ addloop2: context._dec(context.ah); if (!context.flags.z()) goto addloop2; context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; gotlength: context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void drawflags(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)); context.al = context.data.byte(kMapy); @@ -8917,11 +8917,11 @@ _tmp28a: context._add(context.si, (66)-11); context.cx = context.pop(); if (--context.cx) goto _tmp28; - {assert(stack_depth == context.stack.size()); return; } + return; } void eraseoldobs(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; context.es = context.data.word(kBuffers); @@ -8943,11 +8943,11 @@ notthisob: context._add(context.bx, (32)); if (--context.cx) goto oberase; donterase: - {assert(stack_depth == context.stack.size()); return; } + return; } void showallobs(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); context.data.word(kListpos) = context.bx; @@ -9026,11 +9026,11 @@ blankframe: if (context.flags.z()) goto finishedsetobs; goto showobsloop; finishedsetobs: - {assert(stack_depth == context.stack.size()); return; } + return; } void makebackob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto nomake; context.al = context.es.byte(context.si+5); @@ -9060,11 +9060,11 @@ usedpriority: context.es.byte(context.bx+19) = 0; context.si = context.pop(); nomake: - {assert(stack_depth == context.stack.size()); return; } + return; } void showallfree(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.data.word(kListpos) = context.bx; @@ -9140,11 +9140,11 @@ over138: if (context.flags.z()) goto finfree; goto loop127; finfree: - {assert(stack_depth == context.stack.size()); return; } + return; } void showallex(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.data.word(kListpos) = context.bx; @@ -9225,11 +9225,11 @@ blankex: if (context.flags.z()) goto finex; goto exloop; finex: - {assert(stack_depth == context.stack.size()); return; } + return; } void calcfrframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = context.data.word(kFrsegment); context.ax = context.data.word(kFramesad); context.push(context.ax); @@ -9256,16 +9256,16 @@ void calcfrframe(Context & context) { context.al = context.ah; context.ah = 0; context.data.word(kOffsety) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; nullframe: context.ax = context.pop(); context.cx = 0; context.data.word(kSavesize) = context.cx; - {assert(stack_depth == context.stack.size()); return; } + return; } void finalframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kObjecty); context._add(context.ax, context.data.word(kOffsety)); context.bx = context.data.word(kObjectx); @@ -9274,11 +9274,11 @@ void finalframe(Context & context) { context.data.byte(kSavey) = context.al; context.di = context.data.word(kObjectx); context.bx = context.data.word(kObjecty); - {assert(stack_depth == context.stack.size()); return; } + return; } void adjustlen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = context.al; context._add(context.al, context.ch); context._cmp(context.al, 100); @@ -9287,11 +9287,11 @@ void adjustlen(Context & context) { context._sub(context.al, context.ch); context.ch = context.al; over242: - {assert(stack_depth == context.stack.size()); return; } + return; } void getmapad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) goto over146; @@ -9302,11 +9302,11 @@ void getmapad(Context & context) { context.data.word(kObjecty) = context.ax; context.ch = 1; over146: - {assert(stack_depth == context.stack.size()); return; } + return; } void getxad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = context.es.byte(context.si); context._inc(context.si); context.al = context.es.byte(context.si); @@ -9324,14 +9324,14 @@ void getxad(Context & context) { context._or(context.al, context.ah); context.ah = 0; context.ch = 1; - {assert(stack_depth == context.stack.size()); return; } + return; over148: context.ch = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void getyad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.es.byte(context.si); context._inc(context.si); context.ah = context.es.byte(context.si); @@ -9345,14 +9345,14 @@ void getyad(Context & context) { context._or(context.al, context.ah); context.ah = 0; context.ch = 1; - {assert(stack_depth == context.stack.size()); return; } + return; over147: context.ch = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void autolook(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousex); context._cmp(context.ax, context.data.word(kOldx)); if (!context.flags.z()) goto diffmouse; @@ -9366,14 +9366,14 @@ void autolook(Context & context) { if (!context.flags.z()) goto noautolook; dolook(context); noautolook: - {assert(stack_depth == context.stack.size()); return; } + return; diffmouse: context.data.word(kLookcounter) = 1000; - {assert(stack_depth == context.stack.size()); return; } + return; } void look(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -9391,11 +9391,11 @@ alreadylook: if (context.flags.z()) goto nolook; dolook(context); nolook: - {assert(stack_depth == context.stack.size()); return; } + return; } void dolook(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); showicon(context); undertextline(context); @@ -9428,11 +9428,11 @@ afterlook: context.data.byte(kCommandtype) = 0; redrawmainscrn(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void redrawmainscrn(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kTimecount) = 0; createpanel(context); context.data.byte(kNewobs) = 0; @@ -9444,15 +9444,15 @@ void redrawmainscrn(Context & context) { undertextline(context); readmouse(context); context.data.byte(kCommandtype) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void getback1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); if (context.flags.z()) goto notgotobject; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; notgotobject: context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadyget; @@ -9466,15 +9466,15 @@ alreadyget: context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; nogetback: - {assert(stack_depth == context.stack.size()); return; } + return; dogetback: context.data.byte(kGetback) = 1; context.data.byte(kPickup) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void talk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kTalkpos) = 0; context.data.byte(kInmaparea) = 0; context.al = context.data.byte(kCommand); @@ -9520,11 +9520,11 @@ notnexttalk: context.data.byte(kVolumedirection) = -1; context.data.byte(kVolumeto) = 0; nospeech: - {assert(stack_depth == context.stack.size()); return; } + return; } void convicons(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCharacter); context._and(context.al, 127); getpersframe(context); @@ -9536,22 +9536,22 @@ void convicons(Context & context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getpersframe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context._add(context.ax, context.ax); context.bx = context.ax; context.es = context.data.word(kPeople); context._add(context.bx, (0)); context.ax = context.es.word(context.bx); - {assert(stack_depth == context.stack.size()); return; } + return; } void starttalk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kTalkmode) = 0; context.al = context.data.byte(kCharacter); context._and(context.al, 127); @@ -9587,11 +9587,11 @@ void starttalk(Context & context) { context.al = 50+12; playchannel1(context); nospeech1: - {assert(stack_depth == context.stack.size()); return; } + return; } void getpersontext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.cx = 64*2; context._mul(context.cx); @@ -9602,15 +9602,15 @@ void getpersontext(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void moretalk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kTalkmode), 0); if (context.flags.z()) goto canmore; redes(context); - {assert(stack_depth == context.stack.size()); return; } + return; canmore: context._cmp(context.data.byte(kCommandtype), 215); if (context.flags.z()) goto alreadymore; @@ -9624,7 +9624,7 @@ alreadymore: context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; nomore: - {assert(stack_depth == context.stack.size()); return; } + return; domoretalk: context.data.byte(kTalkmode) = 2; context.data.byte(kTalkpos) = 4; @@ -9633,11 +9633,11 @@ domoretalk: context.data.byte(kTalkpos) = 48; notsecondpart: dosometalk(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dosometalk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); dospeech: context.al = context.data.byte(kTalkpos); context.al = context.data.byte(kCharacter); @@ -9696,7 +9696,7 @@ noplay1: context.cx = 180; hangonpq(context); if (!context.flags.c()) goto _tmp1; - {assert(stack_depth == context.stack.size()); return; } + return; _tmp1: context._inc(context.data.byte(kTalkpos)); context.al = context.data.byte(kTalkpos); @@ -9760,17 +9760,17 @@ noplay2: context.cx = 180; hangonpq(context); if (!context.flags.c()) goto skiptalk2; - {assert(stack_depth == context.stack.size()); return; } + return; skiptalk2: context._inc(context.data.byte(kTalkpos)); goto dospeech; endheartalk: context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void hangonpq(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kGetback) = 0; context.bx = 0; hangloopq: @@ -9805,24 +9805,24 @@ finishconv: delpointer(context); context.data.byte(kPointermode) = 0; context.flags._c = false; - {assert(stack_depth == context.stack.size()); return; } + return; quitconv: delpointer(context); context.data.byte(kPointermode) = 0; cancelch1(context); context.flags._c = true; - {assert(stack_depth == context.stack.size()); return; } + return; } void redes(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto cantredes; context._cmp(context.data.byte(kTalkmode), 2); if (context.flags.z()) goto canredes; cantredes: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canredes: context._cmp(context.data.byte(kCommandtype), 217); if (context.flags.z()) goto alreadyreds; @@ -9833,7 +9833,7 @@ alreadyreds: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto doredes; - {assert(stack_depth == context.stack.size()); return; } + return; doredes: delpointer(context); createpanel(context); @@ -9846,29 +9846,29 @@ doredes: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void newplace(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNeedtotravel), 1); if (context.flags.z()) goto istravel; context._cmp(context.data.byte(kAutolocation), -1); if (!context.flags.z()) goto isautoloc; - {assert(stack_depth == context.stack.size()); return; } + return; isautoloc: context.al = context.data.byte(kAutolocation); context.data.byte(kNewlocation) = context.al; context.data.byte(kAutolocation) = -1; - {assert(stack_depth == context.stack.size()); return; } + return; istravel: context.data.byte(kNeedtotravel) = 0; selectlocation(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void selectlocation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kInmaparea) = 0; clearbeforeload(context); context.data.byte(kGetback) = 0; @@ -9914,7 +9914,7 @@ select: getridoftemp3(context); context.es = context.data.word(kTraveltext); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; quittravel: context.al = context.data.byte(kReallocation); context.data.byte(kNewlocation) = context.al; @@ -9924,11 +9924,11 @@ quittravel: getridoftemp3(context); context.es = context.data.word(kTraveltext); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showcity(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearwork(context); context.ds = context.data.word(kTempgraphics); context.di = 57; @@ -9942,11 +9942,11 @@ void showcity(Context & context) { context.al = 1; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void lookatplace(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyinfo; context.data.byte(kCommandtype) = 224; @@ -9998,11 +9998,11 @@ afterinfo: putundercentre(context); worktoscreenm(context); noinfo: - {assert(stack_depth == context.stack.size()); return; } + return; } void getundercentre(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 58; context.bx = 72; context.ds = context.data.word(kMapstore); @@ -10010,11 +10010,11 @@ void getundercentre(Context & context) { context.cl = 254; context.ch = 110; multiget(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void putundercentre(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 58; context.bx = 72; context.ds = context.data.word(kMapstore); @@ -10022,11 +10022,11 @@ void putundercentre(Context & context) { context.cl = 254; context.ch = 110; multiput(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void locationpic(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getdestinfo(context); context.al = context.es.byte(context.si); context.push(context.es); @@ -10069,11 +10069,11 @@ notinthisone: context.al = 0; context.ah = 0; printdirect(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getdestinfo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kDestpos); context.ah = 0; context.push(context.ax); @@ -10089,11 +10089,11 @@ void getdestinfo(Context & context) { context.si = 8027; context._add(context.si, context.ax); context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void showarrows(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 116-12; context.bx = 16; context.ds = context.data.word(kTempgraphics); @@ -10112,11 +10112,11 @@ void showarrows(Context & context) { context.al = 2; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void nextdest(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); duok: context._cmp(context.data.byte(kCommandtype), 218); if (context.flags.z()) goto alreadydu; @@ -10151,11 +10151,11 @@ notlastdest: worktoscreen(context); delpointer(context); nodu: - {assert(stack_depth == context.stack.size()); return; } + return; } void lastdest(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); ddok: context._cmp(context.data.byte(kCommandtype), 219); if (context.flags.z()) goto alreadydd; @@ -10190,11 +10190,11 @@ notfirstdest: worktoscreen(context); delpointer(context); nodd: - {assert(stack_depth == context.stack.size()); return; } + return; } void destselect(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadytrav; context.data.byte(kCommandtype) = 222; @@ -10210,33 +10210,33 @@ alreadytrav: context.al = context.data.byte(kDestpos); context.data.byte(kNewlocation) = context.al; notrav: - {assert(stack_depth == context.stack.size()); return; } + return; } void getlocation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.bx = context.ax; context.dx = context.data; context.es = context.dx; context._add(context.bx, 8011); context.al = context.es.byte(context.bx); - {assert(stack_depth == context.stack.size()); return; } + return; } void setlocation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.bx = context.ax; context.dx = context.data; context.es = context.dx; context._add(context.bx, 8011); context.es.byte(context.bx) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void resetlocation(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context._cmp(context.al, 5); if (!context.flags.z()) goto notdelhotel; @@ -10280,29 +10280,29 @@ clearedlocations: context.es = context.dx; context._add(context.bx, 8011); context.es.byte(context.bx) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void readdesticon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2013; loadintotemp(context); context.dx = 2026; loadintotemp2(context); context.dx = 1961; loadintotemp3(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void readcitypic(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2000; loadintotemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usemon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kLasttrigger) = 0; context.es = context.cs; context.di = 2970+1; @@ -10389,11 +10389,11 @@ endmon: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void printoutermon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 40; context.bx = 32; context.ds = context.data.word(kTempgraphics); @@ -10418,11 +10418,11 @@ void printoutermon(Context & context) { context.al = 4; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadpersonal(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kLocation); context.dx = 2052; context._cmp(context.al, 0); @@ -10446,11 +10446,11 @@ foundpersonal: context.dx = 0; readfromfile(context); closefile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadnews(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kNewsitem); context.dx = 2078; context._cmp(context.al, 0); @@ -10476,11 +10476,11 @@ foundnews: context.dx = 0; readfromfile(context); closefile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadcart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); lookininterface(context); context.dx = 2130; context._cmp(context.al, 0); @@ -10509,11 +10509,11 @@ gotcart: context.dx = 0; readfromfile(context); closefile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void lookininterface(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 'I'; context.ah = 'N'; context.cl = 'T'; @@ -10525,14 +10525,14 @@ void lookininterface(Context & context) { if (context.flags.z()) goto emptyinterface; context.al = context.es.byte(context.bx+15); context._inc(context.al); - {assert(stack_depth == context.stack.size()); return; } + return; emptyinterface: context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void turnonpower(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = 3; powerloop: context.push(context.cx); @@ -10545,11 +10545,11 @@ powerloop: context.cx = context.pop(); if (--context.cx) goto powerloop; powerlighton(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void randomaccess(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); accessloop: context.push(context.cx); vsync(context); @@ -10566,11 +10566,11 @@ chosenaccess: context.cx = context.pop(); if (--context.cx) goto accessloop; accesslightoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void powerlighton(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 257+4; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10584,11 +10584,11 @@ void powerlighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void powerlightoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 257+4; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10602,11 +10602,11 @@ void powerlightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void accesslighton(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 74; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10620,11 +10620,11 @@ void accesslighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void accesslightoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 74; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10638,11 +10638,11 @@ void accesslightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void locklighton(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 56; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10656,11 +10656,11 @@ void locklighton(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void locklightoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 56; context.bx = 182; context.ds = context.data.word(kTempgraphics); @@ -10674,11 +10674,11 @@ void locklightoff(Context & context) { context.cl = 12; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void input(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.cs; context.di = 8045; context.cx = 64; @@ -10764,20 +10764,20 @@ notleadingspace: context._add(context.data.word(kCurslocx), context.cx); goto waitkey; endofinput: - {assert(stack_depth == context.stack.size()); return; } + return; } void makecaps(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.al, 'a'); if (context.flags.c()) goto notupperc; context._sub(context.al, 32); notupperc: - {assert(stack_depth == context.stack.size()); return; } + return; } void delchar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._dec(context.data.word(kCurpos)); context.si = context.data.word(kCurpos); context._add(context.si, context.si); @@ -10802,11 +10802,11 @@ void delchar(Context & context) { context.cl = context.al; context.ch = 8; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void execcommand(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.cs; context.bx = 2776; context.ds = context.cs; @@ -10815,7 +10815,7 @@ void execcommand(Context & context) { context._cmp(context.al, 0); if (!context.flags.z()) goto notblankinp; scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; notblankinp: context.cl = 0; comloop: @@ -10838,7 +10838,7 @@ comloop2: if (!context.flags.z()) goto comloop; neterror(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; foundcom: context.si = context.pop(); context.bx = context.pop(); @@ -10856,46 +10856,46 @@ foundcom: directory: dircom(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; signoncom: signon(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; accesscom: read(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; keyscom: showkeys(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; testcom: context.al = 6; monmessage(context); context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; quitcom: context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void neterror(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 5; monmessage(context); scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dircom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = 30; randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); if (context.flags.z()) goto dirroot; dirfile(context); - {assert(stack_depth == context.stack.size()); return; } + return; dirroot: context.data.byte(kLogonum) = 0; context.ds = context.cs; @@ -10917,11 +10917,11 @@ dirroot: context.es = context.data.word(kTextfile3); searchforfiles(context); scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void searchforfiles(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = (66*2); directloop1: context.al = context.es.byte(context.bx); @@ -10933,11 +10933,11 @@ directloop1: monprint(context); goto directloop1; endofdir: - {assert(stack_depth == context.stack.size()); return; } + return; } void signon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); parser(context); context._inc(context.di); context.ds = context.cs; @@ -10967,7 +10967,7 @@ nomatch: if (--context.cx) goto signonloop; context.al = 13; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; foundsign: context.di = context.pop(); context.si = context.pop(); @@ -10978,7 +10978,7 @@ foundsign: if (context.flags.z()) goto notyetassigned; context.al = 17; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; notyetassigned: context.push(context.es); context.push(context.bx); @@ -11015,7 +11015,7 @@ passerror: scrollmonitor(context); context.al = 16; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; passpassed: context.al = 14; monmessage(context); @@ -11029,11 +11029,11 @@ passpassed: context.bx = context.pop(); context.es = context.pop(); context.es.byte(context.bx) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void showkeys(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = 10; randomaccess(context); scrollmonitor(context); @@ -11055,18 +11055,18 @@ notheld: context._add(context.bx, 26); if (--context.cx) goto keysloop; scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void read(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = 40; randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); if (!context.flags.z()) goto okcom; neterror(context); - {assert(stack_depth == context.stack.size()); return; } + return; okcom: context.es = context.cs; context.di = 2970; @@ -11093,12 +11093,12 @@ okcom: if (context.flags.z()) goto foundfile2; context.al = 7; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; foundfile2: getkeyandlogo(context); context._cmp(context.al, 0); if (context.flags.z()) goto keyok1; - {assert(stack_depth == context.stack.size()); return; } + return; keyok1: context.es = context.cs; context.di = 2942; @@ -11110,7 +11110,7 @@ keyok1: context.data.byte(kLogonum) = context.al; context.al = 11; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; findtopictext: context._inc(context.bx); context.push(context.es); @@ -11138,11 +11138,11 @@ moretopic: goto moretopic; endoftopic: scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dirfile(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 34; context.es.byte(context.di) = context.al; context.push(context.es); @@ -11174,14 +11174,14 @@ void dirfile(Context & context) { context.es = context.pop(); context.al = 7; monmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; foundfile: context.ax = context.pop(); context.ax = context.pop(); getkeyandlogo(context); context._cmp(context.al, 0); if (context.flags.z()) goto keyok2; - {assert(stack_depth == context.stack.size()); return; } + return; keyok2: context.push(context.es); context.push(context.bx); @@ -11210,11 +11210,11 @@ directloop2: goto directloop2; endofdir2: scrollmonitor(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getkeyandlogo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.bx); context.al = context.es.byte(context.bx); context._sub(context.al, 48); @@ -11248,18 +11248,18 @@ void getkeyandlogo(Context & context) { context.bx = context.pop(); context.es = context.pop(); context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; keyok: context.bx = context.pop(); context.es = context.pop(); context.al = context.data.byte(kNewlogonum); context.data.byte(kLogonum) = context.al; context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void searchforstring(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dl = context.es.byte(context.di); context.cx = context.di; restartlook: @@ -11291,14 +11291,14 @@ complete: context.es = context.ds; context.al = 0; context.bx = context.si; - {assert(stack_depth == context.stack.size()); return; } + return; notfound: context.al = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void parser(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.cs; context.di = 2942; context.cx = 13; @@ -11329,11 +11329,11 @@ copyin1: if (!context.flags.z()) goto copyin1; finishpars: context.di = 2942; - {assert(stack_depth == context.stack.size()); return; } + return; } void scrollmonitor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -11358,11 +11358,11 @@ void scrollmonitor(Context & context) { context.cx = context.pop(); context.bx = context.pop(); context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void lockmon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLasthardkey), 57); if (!context.flags.z()) goto notlock; locklighton(context); @@ -11371,11 +11371,11 @@ lockloop: if (context.flags.z()) goto lockloop; locklightoff(context); notlock: - {assert(stack_depth == context.stack.size()); return; } + return; } void monitorlogo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kLogonum); context._cmp(context.al, context.data.byte(kOldlogonum)); if (context.flags.z()) goto notnewlogo; @@ -11389,14 +11389,14 @@ void monitorlogo(Context & context) { playchannel1(context); context.cx = 20; randomaccess(context); - {assert(stack_depth == context.stack.size()); return; } + return; notnewlogo: printlogo(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void printlogo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 56; context.bx = 32; context.ds = context.data.word(kTempgraphics); @@ -11404,11 +11404,11 @@ void printlogo(Context & context) { context.ah = 0; showframe(context); showcurrentfile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showcurrentfile(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 178; context.bx = 37; context.si = 2970+1; @@ -11424,11 +11424,11 @@ curfileloop: context.si = context.pop(); goto curfileloop; finishfile: - {assert(stack_depth == context.stack.size()); return; } + return; } void monmessage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTextfile1); context.bx = (66*2); context.cl = context.al; @@ -11440,18 +11440,18 @@ monmessageloop: if (!context.flags.z()) goto monmessageloop; if (--context.cx) goto monmessageloop; monprint(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void processtrigger(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLasttrigger), '1'); if (!context.flags.z()) goto notfirsttrigger; context.al = 8; setlocation(context); context.al = 45; triggermessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; notfirsttrigger: context._cmp(context.data.byte(kLasttrigger), '2'); if (!context.flags.z()) goto notsecondtrigger; @@ -11459,7 +11459,7 @@ notfirsttrigger: setlocation(context); context.al = 55; triggermessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; notsecondtrigger: context._cmp(context.data.byte(kLasttrigger), '3'); if (!context.flags.z()) goto notthirdtrigger; @@ -11468,11 +11468,11 @@ notsecondtrigger: context.al = 59; triggermessage(context); notthirdtrigger: - {assert(stack_depth == context.stack.size()); return; } + return; } void triggermessage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.di = 174; context.bx = 153; @@ -11502,11 +11502,11 @@ void triggermessage(Context & context) { multiput(context); worktoscreen(context); context.data.byte(kLasttrigger) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void printcurs(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.si); context.push(context.di); context.push(context.ds); @@ -11548,11 +11548,11 @@ flashcurs: context.ds = context.pop(); context.di = context.pop(); context.si = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void delcurs(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.push(context.di); @@ -11580,11 +11580,11 @@ finishcurdel: context.di = context.pop(); context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void useobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kWithobject) = 255; context._cmp(context.data.byte(kCommandtype), 229); if (context.flags.z()) goto alreadyuse; @@ -11600,19 +11600,19 @@ alreadyuse: context._and(context.ax, 1); if (!context.flags.z()) goto douse; nouse: - {assert(stack_depth == context.stack.size()); return; } + return; douse: useroutine(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useroutine(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); if (context.flags.c()) goto nodream7; context._cmp(context.data.byte(kPointerpower), 0); if (!context.flags.z()) goto powerok; - {assert(stack_depth == context.stack.size()); return; } + return; powerok: context.data.byte(kPointerpower) = 0; nodream7: @@ -11641,7 +11641,7 @@ checkuselist: context._lodsw(); context.si = context.pop(); __dispatch_call(context, context.ax); - {assert(stack_depth == context.stack.size()); return; } + return; failed: context.si = context.pop(); context._add(context.si, 6); @@ -11662,7 +11662,7 @@ failed: context.cx = 400; hangonp(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; cantuse2: createpanel(context); showpanel(context); @@ -11679,24 +11679,24 @@ cantuse2: hangonp(context); putbackobstuff(context); context.data.byte(kCommandtype) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void wheelsound(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 17; playchannel1(context); showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void runtap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tapwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; tapwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11718,7 +11718,7 @@ tapwith: context.al = 56; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; fillcupfromtap: context.al = context.data.byte(kWithobject); getexad(context); @@ -11729,50 +11729,50 @@ fillcupfromtap: context.al = 57; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; cupfromtapfull: context.cx = 300; context.al = 58; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void playguitar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 14; playchannel1(context); showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void hotelcontrol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 21); if (!context.flags.z()) goto notrightcont; context._cmp(context.data.byte(kMapx), 33); if (!context.flags.z()) goto notrightcont; showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notrightcont: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void hotelbell(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 12; playchannel1(context); showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void opentomb(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 35*2; @@ -11781,11 +11781,11 @@ void opentomb(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usetrainer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); if (!context.flags.z()) goto notheldtrainer; @@ -11793,14 +11793,14 @@ void usetrainer(Context & context) { makeworn(context); showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notheldtrainer: nothelderror(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void nothelderror(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); showpanel(context); showman(context); @@ -11816,15 +11816,15 @@ void nothelderror(Context & context) { context.cx = 50; hangonp(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usepipe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto pipewith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; pipewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11846,7 +11846,7 @@ pipewith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; fillcup: context.cx = 300; context.al = 36; @@ -11855,17 +11855,17 @@ fillcup: context.al = context.data.byte(kWithobject); getexad(context); context.es.byte(context.bx+15) = 'F'-'A'; - {assert(stack_depth == context.stack.size()); return; } + return; alreadyfull: context.cx = 300; context.al = 35; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usefullcart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); context.al = 2; context.ah = context.data.byte(kRoomnum); @@ -11884,15 +11884,15 @@ void usefullcart(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useplinth(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto plinthwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; plinthwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -11904,7 +11904,7 @@ plinthwith: if (context.flags.z()) goto isrightkey; showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; isrightkey: context._inc(context.data.byte(kProgresspoints)); showseconduse(context); @@ -11916,20 +11916,20 @@ isrightkey: context.data.byte(kGetback) = 1; context.al = context.data.byte(kRoomafterdream); context.data.byte(kNewlocation) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void chewy(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); getanyad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useladder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context._sub(context.data.byte(kMapx), 11); findroominloc(context); @@ -11941,11 +11941,11 @@ void useladder(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useladderb(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context._add(context.data.byte(kMapx), 11); findroominloc(context); @@ -11957,11 +11957,11 @@ void useladderb(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoora(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -11973,17 +11973,17 @@ void slabdoora(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 42; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabawrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 34; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoorb(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kDreamnumber), 1); if (!context.flags.z()) goto slabbwrong; context.al = 'S'; @@ -11996,7 +11996,7 @@ void slabdoorb(Context & context) { context.cx = 200; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotcrystal: showfirstuse(context); context._inc(context.data.byte(kProgresspoints)); @@ -12007,7 +12007,7 @@ gotcrystal: context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 71; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabbwrong: showfirstuse(context); context.data.byte(kGetback) = 1; @@ -12018,11 +12018,11 @@ slabbwrong: context.data.word(kEndwatchreel) = 63; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoord(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -12034,17 +12034,17 @@ void slabdoord(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 102; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabcwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 94; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoorc(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -12056,17 +12056,17 @@ void slabdoorc(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 135; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabdwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 127; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoore(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -12078,17 +12078,17 @@ void slabdoore(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 168; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabewrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 160; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void slabdoorf(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.byte(kWatchspeed) = 1; @@ -12100,21 +12100,21 @@ void slabdoorf(Context & context) { context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 197; context.data.byte(kNewlocation) = 47; - {assert(stack_depth == context.stack.size()); return; } + return; slabfwrong: context.data.word(kWatchingtime) = 40; context.data.word(kEndwatchreel) = 189; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useslab(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto slabwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; slabwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12128,7 +12128,7 @@ slabwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; nextslab: context.al = context.data.byte(kWithobject); getexad(context); @@ -12154,15 +12154,15 @@ notlastslab: context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usecart(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto cartwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; cartwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12176,7 +12176,7 @@ cartwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; nextcart: context.al = context.data.byte(kWithobject); getexad(context); @@ -12192,15 +12192,15 @@ nextcart: playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useclearbox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto clearboxwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; clearboxwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12214,7 +12214,7 @@ clearboxwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; openbox: context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); @@ -12224,11 +12224,11 @@ openbox: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usecoveredbox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.word(kWatchingtime) = 50; @@ -12237,11 +12237,11 @@ void usecoveredbox(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void userailing(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.word(kWatchingtime) = 80; context.data.word(kReeltowatch) = 0; @@ -12250,15 +12250,15 @@ void userailing(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context.data.byte(kMandead) = 4; - {assert(stack_depth == context.stack.size()); return; } + return; } void useopenbox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto openboxwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; openboxwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12277,7 +12277,7 @@ openboxwith: compare(context); if (context.flags.z()) goto openboxwrong; showfirstuse(context); - {assert(stack_depth == context.stack.size()); return; } + return; destoryopenbox: context._inc(context.data.byte(kProgresspoints)); context.cx = 300; @@ -12294,17 +12294,17 @@ destoryopenbox: context.al = 4; turnpathon(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; openboxwrong: context.cx = 300; context.al = 38; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void wearwatch(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto wearingwatch; showfirstuse(context); @@ -12312,15 +12312,15 @@ void wearwatch(Context & context) { context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); - {assert(stack_depth == context.stack.size()); return; } + return; wearingwatch: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void wearshades(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 1); if (context.flags.z()) goto wearingshades; context.data.byte(kShadeson) = 1; @@ -12328,15 +12328,15 @@ void wearshades(Context & context) { context.data.byte(kGetback) = 1; getanyad(context); makeworn(context); - {assert(stack_depth == context.stack.size()); return; } + return; wearingshades: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void sitdowninbar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchmode), -1); if (!context.flags.z()) goto satdown; showfirstuse(context); @@ -12348,15 +12348,15 @@ void sitdowninbar(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; satdown: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usechurchhole(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; context.data.word(kWatchingtime) = 28; @@ -12364,15 +12364,15 @@ void usechurchhole(Context & context) { context.data.word(kEndwatchreel) = 26; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usehole(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto holewith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; holewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12386,7 +12386,7 @@ holewith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; righthand: showfirstuse(context); context.al = 86; @@ -12396,11 +12396,11 @@ righthand: context.es.byte(context.bx+2) = 255; context.data.byte(kCanmovealtar) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usealtar(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 'C'; context.ah = 'N'; context.cl = 'D'; @@ -12421,7 +12421,7 @@ void usealtar(Context & context) { context.al = 23; showpuztext(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; movealtar: context._inc(context.data.byte(kProgresspoints)); showseconduse(context); @@ -12437,19 +12437,19 @@ movealtar: context.dx = 98; setuptimeduse(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; thingsonaltar: showfirstuse(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void opentvdoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tvdoorwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; tvdoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12463,72 +12463,72 @@ tvdoorwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; keyontv: showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usedryer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 12; playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void openlouis(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 5; context.ah = 2; context.cl = 3; context.ch = 8; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void nextcolon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); lookcolon: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; - {assert(stack_depth == context.stack.size()); return; } + return; } void openyourneighbour(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 255; context.ah = 255; context.cl = 255; context.ch = 255; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usewindow(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kManspath), 6); if (!context.flags.z()) goto notonbalc; context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kNewlocation) = 29; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notonbalc: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usebalcony(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.al = 6; turnpathon(context); @@ -12557,55 +12557,55 @@ void usebalcony(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void openryan(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 5; context.ah = 1; context.cl = 0; context.ch = 6; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void openpoolboss(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 5; context.ah = 2; context.cl = 2; context.ch = 2; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void openeden(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 2; context.ah = 8; context.cl = 6; context.ch = 5; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void opensarters(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 7; context.ah = 8; context.cl = 3; context.ch = 3; entercode(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void isitright(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = context.data; context.es = context.bx; context.bx = 8573; @@ -12617,24 +12617,24 @@ void isitright(Context & context) { if (!context.flags.z()) goto notright; context._cmp(context.es.byte(context.bx+3), context.ch); notright: - {assert(stack_depth == context.stack.size()); return; } + return; } void drawitall(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); drawfloor(context); printsprites(context); showicon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void openhoteldoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; hoteldoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12648,22 +12648,22 @@ hoteldoorwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; keyonhotel1: context.al = 16; playchannel1(context); showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void openhoteldoor2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith2; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; hoteldoorwith2: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12677,21 +12677,21 @@ hoteldoorwith2: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; keyonhotel2: context.al = 16; playchannel1(context); showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void grafittidoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto grafwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; grafwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12705,15 +12705,15 @@ grafwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; dograf: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void trapdoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); switchryanoff(context); @@ -12724,11 +12724,11 @@ void trapdoor(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void callhotellift(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 12; playchannel1(context); showfirstuse(context); @@ -12739,21 +12739,21 @@ void callhotellift(Context & context) { autosetwalk(context); context.al = 4; turnpathon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void calledenslift(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kCounttoopen) = 8; context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void calledensdlift(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLiftflag), 1); if (context.flags.z()) goto edensdhere; showfirstuse(context); @@ -12761,19 +12761,19 @@ void calledensdlift(Context & context) { context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); - {assert(stack_depth == context.stack.size()); return; } + return; edensdhere: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usepoolreader(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto poolwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; poolwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12787,28 +12787,28 @@ poolwith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; openpool: context._cmp(context.data.byte(kTalkedtoattendant), 1); if (context.flags.z()) goto canopenpool; showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; canopenpool: context.al = 17; playchannel1(context); showfirstuse(context); context.data.byte(kCounttoopen) = 6; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void uselighter(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotlighterwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotlighterwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12820,7 +12820,7 @@ gotlighterwith: if (context.flags.z()) goto cigarette; showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; cigarette: context.cx = 300; context.al = 9; @@ -12829,11 +12829,11 @@ cigarette: getexad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void showseconduse(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getobtextstart(context); nextcolon(context); nextcolon(context); @@ -12841,15 +12841,15 @@ void showseconduse(Context & context) { usetext(context); context.cx = 400; hangonp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecardreader1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader1with; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotreader1with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12863,7 +12863,7 @@ gotreader1with: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; correctcard: context._cmp(context.data.byte(kTalkedtosparky), 0); if (context.flags.z()) goto notyet; @@ -12873,7 +12873,7 @@ correctcard: context.al = 17; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; getscash: context.al = 16; playchannel1(context); @@ -12883,19 +12883,19 @@ getscash: context._inc(context.data.byte(kProgresspoints)); context.data.word(kCard1money) = 12432; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notyet: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecardreader2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader2with; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotreader2with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12909,7 +12909,7 @@ gotreader2with: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; correctcard2: context._cmp(context.data.byte(kTalkedtoboss), 0); if (context.flags.z()) goto notyetboss; @@ -12928,31 +12928,31 @@ correctcard2: context._sub(context.data.word(kCard1money), 2000); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; nocash: context.cx = 300; context.al = 20; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; alreadygotnew: context.cx = 300; context.al = 22; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notyetboss: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecardreader3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader3with; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotreader3with: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -12966,7 +12966,7 @@ gotreader3with: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; rightcard: context._cmp(context.data.byte(kTalkedtorecep), 0); if (context.flags.z()) goto notyetrecep; @@ -12981,21 +12981,21 @@ rightcard: context._sub(context.data.word(kCard1money), 8300); context.data.byte(kCardpassflag) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; alreadyusedit: context.cx = 300; context.al = 26; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notyetrecep: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecashcard(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getridofreels(context); loadkeypad(context); createpanel(context); @@ -13044,11 +13044,11 @@ void usecashcard(Context & context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void lookatcard(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofreels(context); loadkeypad(context); @@ -13096,11 +13096,11 @@ void lookatcard(Context & context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void moneypoke(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = 3474; context.cl = 48-1; numberpoke0: @@ -13136,15 +13136,15 @@ numberpoke3: context.bx = 3479; context._add(context.al, 48); context.cs.byte(context.bx) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void usecontrol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotcontrolwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotcontrolwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -13175,7 +13175,7 @@ gotcontrolwith: balls: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; rightkey: context.al = 16; playchannel1(context); @@ -13189,7 +13189,7 @@ rightkey: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; goingdown: context.cx = 300; context.al = 3; @@ -13199,7 +13199,7 @@ goingdown: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; jimmycontrols: context.al = 50; placesetobject(context); @@ -13220,30 +13220,30 @@ jimmycontrols: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; axeoncontrols: context.cx = 300; context.al = 16; showpuztext(context); context._inc(context.data.byte(kProgresspoints)); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usehatch(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kNewlocation) = 40; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usewire(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotwirewith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotwirewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -13265,13 +13265,13 @@ gotwirewith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; wireaxe: context.cx = 300; context.al = 16; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; wireknife: context.al = 51; removesetobject(context); @@ -13282,11 +13282,11 @@ wireknife: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usehandle(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 'C'; context.ah = 'U'; context.cl = 'T'; @@ -13299,37 +13299,37 @@ void usehandle(Context & context) { context.al = 12; showpuztext(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; havecutwire: context.cx = 300; context.al = 13; showpuztext(context); context.data.byte(kNewlocation) = 22; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useelevator1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); selectlocation(context); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void showfirstuse(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getobtextstart(context); findnextcolon(context); findnextcolon(context); usetext(context); context.cx = 400; hangonp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useelevator3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.byte(kCounttoclose) = 20; context.data.byte(kNewlocation) = 34; @@ -13339,11 +13339,11 @@ void useelevator3(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useelevator4(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.word(kReeltowatch) = 0; context.data.word(kEndwatchreel) = 11; @@ -13353,11 +13353,11 @@ void useelevator4(Context & context) { context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; context.data.byte(kNewlocation) = 24; - {assert(stack_depth == context.stack.size()); return; } + return; } void useelevator2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 23); if (context.flags.z()) goto inpoolhall; showfirstuse(context); @@ -13366,7 +13366,7 @@ void useelevator2(Context & context) { context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; inpoolhall: showfirstuse(context); context.data.byte(kNewlocation) = 31; @@ -13374,11 +13374,11 @@ inpoolhall: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void useelevator5(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 4; placesetobject(context); context.al = 0; @@ -13388,11 +13388,11 @@ void useelevator5(Context & context) { context.data.byte(kLiftflag) = 1; context.data.byte(kCounttoclose) = 8; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usekey(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 5); if (context.flags.z()) goto usekey1; context._cmp(context.data.byte(kLocation), 30); @@ -13403,7 +13403,7 @@ void usekey(Context & context) { context.al = 1; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; usekey1: context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto wrongroom1; @@ -13414,7 +13414,7 @@ usekey1: showpuztext(context); context.data.byte(kCounttoclose) = 100; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; usekey2: context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto wrongroom1; @@ -13428,24 +13428,24 @@ usekey2: fadescreendown(context); showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; wrongroom1: context.cx = 200; context.al = 2; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usestereo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 0); if (context.flags.z()) goto stereook; context.cx = 400; context.al = 4; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; stereook: context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) goto stereonotok; @@ -13456,7 +13456,7 @@ stereonotok: context.al = 5; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; stereook2: context.al = 'C'; context.ah = 'D'; @@ -13474,7 +13474,7 @@ stereook2: getanyad(context); context.al = 255; context.es.byte(context.bx+10) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; cdinside: getanyad(context); context.al = context.es.byte(context.bx+10); @@ -13486,17 +13486,17 @@ cdinside: context.cx = 400; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; stereoon: context.al = 8; context.cx = 400; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecooker(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); checkinside(context); @@ -13504,15 +13504,15 @@ void usecooker(Context & context) { if (!context.flags.z()) goto foodinside; showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; foodinside: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useaxe(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpool; context._cmp(context.data.byte(kMapy), 10); @@ -13522,10 +13522,10 @@ void useaxe(Context & context) { context.data.byte(kLastweapon) = 2; context.data.byte(kGetback) = 1; removeobfrominv(context); - {assert(stack_depth == context.stack.size()); return; } + return; notinpool: showfirstuse(context); - {assert(stack_depth == context.stack.size()); return; } + return; /*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ axeondoor: context.al = 15; @@ -13538,16 +13538,16 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } - {assert(stack_depth == context.stack.size()); return; } + return; + return; } void useelvdoor(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotdoorwith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gotdoorwith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -13561,7 +13561,7 @@ gotdoorwith: context.cx = 300; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; axeondoor: context.al = 15; context.cx = 300; @@ -13573,11 +13573,11 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void withwhat(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); showpanel(context); showman(context); @@ -13616,17 +13616,17 @@ void withwhat(Context & context) { worktoscreen(context); delpointer(context); context.data.byte(kInvopen) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; } void selectob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (!context.flags.z()) goto canselectob; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canselectob: context.data.byte(kWithobject) = context.al; context.data.byte(kWithtype) = context.ah; @@ -13647,16 +13647,16 @@ alreadyselob: context._and(context.ax, 1); if (!context.flags.z()) goto doselob; notselob: - {assert(stack_depth == context.stack.size()); return; } + return; doselob: delpointer(context); context.data.byte(kInvopen) = 0; useroutine(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void compare(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._sub(context.dl, 'A'); context._sub(context.dh, 'A'); context._sub(context.cl, 'A'); @@ -13670,11 +13670,11 @@ void compare(Context & context) { if (!context.flags.z()) goto comparefin; context._cmp(context.es.word(context.bx+14), context.dx); comparefin: - {assert(stack_depth == context.stack.size()); return; } + return; } void findsetobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13692,18 +13692,18 @@ findsetloop: context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofind; context.al = context.dl; - {assert(stack_depth == context.stack.size()); return; } + return; nofind: context._add(context.bx, 64); context._inc(context.dl); context._cmp(context.dl, 128); if (!context.flags.z()) goto findsetloop; context.al = context.dl; - {assert(stack_depth == context.stack.size()); return; } + return; } void findexobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13721,18 +13721,18 @@ findexloop: context._cmp(context.ch, context.es.byte(context.bx+15)); if (!context.flags.z()) goto nofindex; context.al = context.dl; - {assert(stack_depth == context.stack.size()); return; } + return; nofindex: context._add(context.bx, 16); context._inc(context.dl); context._cmp(context.dl, (114)); if (!context.flags.z()) goto findexloop; context.al = context.dl; - {assert(stack_depth == context.stack.size()); return; } + return; } void isryanholding(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); context._sub(context.cl, 'A'); @@ -13753,7 +13753,7 @@ searchinv: if (!context.flags.z()) goto nofindininv; context.al = context.dl; context._cmp(context.al, (114)); - {assert(stack_depth == context.stack.size()); return; } + return; nofindininv: context._add(context.bx, 16); context._inc(context.dl); @@ -13761,11 +13761,11 @@ nofindininv: if (!context.flags.z()) goto searchinv; context.al = context.dl; context._cmp(context.al, (114)); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkinside(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kExtras); context.bx = (0+2080+30000); context.cl = 0; @@ -13774,17 +13774,17 @@ insideloop: if (!context.flags.z()) goto notfoundinside; context._cmp(context.ah, context.es.byte(context.bx+2)); if (!context.flags.z()) goto notfoundinside; - {assert(stack_depth == context.stack.size()); return; } + return; notfoundinside: context._add(context.bx, 16); context._inc(context.cl); context._cmp(context.cl, (114)); if (!context.flags.z()) goto insideloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void usetext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.si); createpanel(context); @@ -13801,11 +13801,11 @@ void usetext(Context & context) { context.ah = 0; printdirect(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void putbackobstuff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel(context); showpanel(context); showman(context); @@ -13819,11 +13819,11 @@ void putbackobstuff(Context & context) { showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showpuztext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); findpuztext(context); context.push(context.es); @@ -13843,11 +13843,11 @@ void showpuztext(Context & context) { worktoscreenm(context); context.cx = context.pop(); hangonp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void findpuztext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -13855,11 +13855,11 @@ void findpuztext(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void placesetobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13869,11 +13869,11 @@ void placesetobject(Context & context) { context.es.byte(context.bx+58) = 0; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void removesetobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.cl = 255; @@ -13883,11 +13883,11 @@ void removesetobject(Context & context) { context.es.byte(context.bx+58) = 255; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void issetobonmap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); getsetad(context); @@ -13895,11 +13895,11 @@ void issetobonmap(Context & context) { context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, 0); - {assert(stack_depth == context.stack.size()); return; } + return; } void placefreeobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); context.cl = 0; @@ -13909,22 +13909,22 @@ void placefreeobject(Context & context) { context.es.byte(context.bx+2) = 0; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void removefreeobject(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.bx); getfreead(context); context.es.byte(context.bx+2) = 255; context.bx = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void findormake(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); context.push(context.ax); context.es = context.data.word(kBuffers); @@ -13942,28 +13942,28 @@ nofoundchange: foundchange: context.ax = context.pop(); context.es.byte(context.bx+2) = context.cl; - {assert(stack_depth == context.stack.size()); return; } + return; haventfound: context.es.word(context.bx) = context.ax; context.es.word(context.bx+2) = context.cx; context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void switchryanon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kRyanon) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void switchryanoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kRyanon) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void setallchanges(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); setallloop: @@ -13981,11 +13981,11 @@ setallloop: context.es = context.pop(); goto setallloop; endsetloop: - {assert(stack_depth == context.stack.size()); return; } + return; } void dochange(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ch, 0); if (context.flags.z()) goto object; context._cmp(context.ch, 1); @@ -14009,13 +14009,13 @@ path: context.cx = context.pop(); context.es.byte(context.bx+6) = context.cl; nopath: - {assert(stack_depth == context.stack.size()); return; } + return; object: context.push(context.cx); getsetad(context); context.cx = context.pop(); context.es.byte(context.bx+58) = context.cl; - {assert(stack_depth == context.stack.size()); return; } + return; freeobject: context.push(context.cx); getfreead(context); @@ -14024,11 +14024,11 @@ freeobject: if (!context.flags.z()) goto beenpickedup; context.es.byte(context.bx+2) = context.cl; beenpickedup: - {assert(stack_depth == context.stack.size()); return; } + return; } void autoappear(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notinalley; context.al = 5; @@ -14036,7 +14036,7 @@ void autoappear(Context & context) { context.al = 10; setlocation(context); context.data.byte(kDestpos) = 10; - {assert(stack_depth == context.stack.size()); return; } + return; notinalley: context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedens; @@ -14059,7 +14059,7 @@ notinalley: removesetobject(context); context.al = 85; removesetobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; edenspart2: context._cmp(context.data.byte(kSartaindead), 1); if (!context.flags.z()) goto notedens2; @@ -14071,7 +14071,7 @@ edenspart2: placesetobject(context); context._inc(context.data.byte(kSartaindead)); notedens2: - {assert(stack_depth == context.stack.size()); return; } + return; notinedens: context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto notonsartroof; @@ -14081,7 +14081,7 @@ notinedens: context.al = 11; setlocation(context); context.data.byte(kDestpos) = 11; - {assert(stack_depth == context.stack.size()); return; } + return; notonsartroof: context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notinlouiss; @@ -14090,11 +14090,11 @@ notonsartroof: context.al = 23; placesetobject(context); notinlouiss: - {assert(stack_depth == context.stack.size()); return; } + return; } void getundertimed(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -14106,11 +14106,11 @@ void getundertimed(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void putundertimed(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -14122,11 +14122,11 @@ void putundertimed(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumptimedtext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) goto nodumptimed; context.al = context.data.byte(kTimedy); @@ -14140,11 +14140,11 @@ void dumptimedtext(Context & context) { multidump(context); context.data.byte(kNeedtodumptimed) = 0; nodumptimed: - {assert(stack_depth == context.stack.size()); return; } + return; } void setuptimeduse(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup; context.data.byte(kTimedy) = context.bh; @@ -14163,11 +14163,11 @@ void setuptimeduse(Context & context) { context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; cantsetup: - {assert(stack_depth == context.stack.size()); return; } + return; } void setuptimedtemp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ah, 0); if (context.flags.z()) goto notloadspeech3; context.dl = 'T'; @@ -14179,7 +14179,7 @@ void setuptimedtemp(Context & context) { if (!context.flags.z()) goto notloadspeech3; context.al = 50+12; playchannel1(context); - {assert(stack_depth == context.stack.size()); return; } + return; notloadspeech3: context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup2; @@ -14199,11 +14199,11 @@ notloadspeech3: context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; cantsetup2: - {assert(stack_depth == context.stack.size()); return; } + return; } void usetimedtext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto notext; context._dec(context.data.word(kTimecount)); @@ -14229,15 +14229,15 @@ notfirsttimed: printdirect(context); context.data.byte(kNeedtodumptimed) = 1; notext: - {assert(stack_depth == context.stack.size()); return; } + return; deltimedtext: putundertimed(context); context.data.byte(kNeedtodumptimed) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void edenscdplayer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context.data.word(kWatchingtime) = 18*2; context.data.word(kReeltowatch) = 25; @@ -14245,11 +14245,11 @@ void edenscdplayer(Context & context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void usewall(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showfirstuse(context); context._cmp(context.data.byte(kManspath), 3); if (context.flags.z()) goto gobackover; @@ -14276,7 +14276,7 @@ void usewall(Context & context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; gobackover: context.data.word(kWatchingtime) = 30*2; context.data.word(kReeltowatch) = 34; @@ -14301,15 +14301,15 @@ gobackover: findxyfrompath(context); context.data.byte(kResetmanxy) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usechurchgate(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gatewith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; gatewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -14323,7 +14323,7 @@ gatewith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; cutgate: showfirstuse(context); context.data.word(kWatchingtime) = 64*2; @@ -14340,16 +14340,16 @@ cutgate: context.al = 2; turnpathon(context); notopenchurch: - {assert(stack_depth == context.stack.size()); return; } + return; } void usegun(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto istakengun; showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; istakengun: context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpoolroom; @@ -14360,7 +14360,7 @@ istakengun: context.data.byte(kCombatcount) = 39; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; notinpoolroom: context._cmp(context.data.byte(kReallocation), 25); if (!context.flags.z()) goto nothelicopter; @@ -14374,7 +14374,7 @@ notinpoolroom: context.data.byte(kRoomafterdream) = 38; context.data.byte(kSartaindead) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; nothelicopter: context._cmp(context.data.byte(kReallocation), 27); if (!context.flags.z()) goto notinrockroom; @@ -14389,7 +14389,7 @@ nothelicopter: context.data.byte(kRoomafterdream) = 32; context.data.byte(kDreamnumber) = 0; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; notinrockroom: context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto notbystudio; @@ -14408,7 +14408,7 @@ notinrockroom: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; notbystudio: context._cmp(context.data.byte(kReallocation), 6); if (!context.flags.z()) goto notsarters; @@ -14438,7 +14438,7 @@ notbystudio: context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; notsarters: context._cmp(context.data.byte(kReallocation), 29); if (!context.flags.z()) goto notaide; @@ -14460,7 +14460,7 @@ notsarters: context.data.byte(kDreamnumber) = 3; context.data.byte(kRoomafterdream) = 33; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; notaide: context._cmp(context.data.byte(kReallocation), 23); if (!context.flags.z()) goto notwithboss; @@ -14476,7 +14476,7 @@ notaide: pathokboss: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notwithboss: context._cmp(context.data.byte(kReallocation), 8); if (!context.flags.z()) goto nottvsoldier; @@ -14492,15 +14492,15 @@ notwithboss: pathoktv: context.data.byte(kLastweapon) = 1; context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; nottvsoldier: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useshield(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 20); if (!context.flags.z()) goto notinsartroom; context._cmp(context.data.byte(kCombatcount), 0); @@ -14510,15 +14510,15 @@ void useshield(Context & context) { context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); removeobfrominv(context); - {assert(stack_depth == context.stack.size()); return; } + return; notinsartroom: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usebuttona(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 95; issetobonmap(context); if (context.flags.z()) goto donethisbit; @@ -14538,19 +14538,19 @@ void usebuttona(Context & context) { context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; donethisbit: showseconduse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void useplate(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto platewith; withwhat(context); - {assert(stack_depth == context.stack.size()); return; } + return; platewith: context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); @@ -14572,7 +14572,7 @@ platewith: context.al = 14; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; unscrewplate: context.al = 20; playchannel1(context); @@ -14587,17 +14587,17 @@ unscrewplate: placefreeobject(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; triedknife: context.cx = 300; context.al = 54; showpuztext(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usewinch(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 40; context.ah = 1; checkinside(context); @@ -14624,15 +14624,15 @@ void usewinch(Context & context) { context.data.byte(kNewsitem) = 2; context.data.byte(kGetback) = 1; context._inc(context.data.byte(kProgresspoints)); - {assert(stack_depth == context.stack.size()); return; } + return; nowinch: showfirstuse(context); putbackobstuff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void entercode(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kKeypadax) = context.ax; context.data.word(kKeypadcx) = context.cx; getridofreels(context); @@ -14701,18 +14701,18 @@ numberright: restorereels(context); redrawmainscrn(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadkeypad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 1948; loadintotemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void quitkey(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyqk; context.data.byte(kCommandtype) = 222; @@ -14725,14 +14725,14 @@ alreadyqk: context._and(context.ax, 1); if (!context.flags.z()) goto doqk; notqk: - {assert(stack_depth == context.stack.size()); return; } + return; doqk: context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void addtopresslist(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kPresspointer), 5); if (context.flags.z()) goto nomorekeys; context.al = context.data.byte(kPressed); @@ -14747,88 +14747,88 @@ not10: context.es.byte(context.bx) = context.al; context._inc(context.data.word(kPresspointer)); nomorekeys: - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonone(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 1; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttontwo(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 2; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonthree(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 3; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonfour(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 4; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonfive(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 5; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonsix(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 6; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonseven(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 7; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttoneight(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 8; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonnine(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 9; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonnought(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 10; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonenter(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = 11; buttonpress(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void buttonpress(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ch = context.cl; context._add(context.ch, 100); context._cmp(context.data.byte(kCommandtype), context.ch); @@ -14846,7 +14846,7 @@ alreadyb: context._and(context.ax, 1); if (!context.flags.z()) goto dob; notb: - {assert(stack_depth == context.stack.size()); return; } + return; dob: context.data.byte(kPressed) = context.cl; context._add(context.cl, 21); @@ -14857,11 +14857,11 @@ dob: context.al = 10; playchannel1(context); nonoise: - {assert(stack_depth == context.stack.size()); return; } + return; } void showouterpad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (36+112)-3; context.bx = (72)-4; context.ds = context.data.word(kTempgraphics); @@ -14874,11 +14874,11 @@ void showouterpad(Context & context) { context.al = 37; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showkeypad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 22; context.di = (36+112)+9; context.bx = (72)+5; @@ -14944,11 +14944,11 @@ gotlight: context.di = (36+112)+60; showframe(context); notenter: - {assert(stack_depth == context.stack.size()); return; } + return; } void singlekey(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kGraphicpress), context.al); if (!context.flags.z()) goto gotkey; context._add(context.al, 11); @@ -14960,21 +14960,21 @@ gotkey: context._sub(context.al, 20); context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpkeypad(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (36+112)-3; context.bx = (72)-4; context.cl = 120; context.ch = 90; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usemenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getridofreels(context); loadmenu(context); createpanel(context); @@ -15018,23 +15018,23 @@ menuloop: getridoftemp2(context); restorereels(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; menulist: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpmenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (80+40); context.bx = (60); context.cl = 48; context.ch = 48; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getundermenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (80+40); context.bx = (60); context.cl = 48; @@ -15042,11 +15042,11 @@ void getundermenu(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void putundermenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (80+40); context.bx = (60); context.cl = 48; @@ -15054,11 +15054,11 @@ void putundermenu(Context & context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showoutermenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 40; context.ah = 0; context.di = (80+40)-34; @@ -15083,11 +15083,11 @@ void showoutermenu(Context & context) { context.bx = (60)+57-40; context.ds = context.data.word(kTempgraphics); showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showmenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.data.byte(kMenucount)); context._cmp(context.data.byte(kMenucount), 37*2); if (!context.flags.z()) goto menuframeok; @@ -15100,20 +15100,20 @@ menuframeok: context.bx = (60); context.ds = context.data.word(kTempgraphics); showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadmenu(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 1832; loadintotemp(context); context.dx = 1987; loadintotemp2(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void viewfolder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofall(context); loadfolder(context); @@ -15140,15 +15140,15 @@ folderloop: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void nextfolder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 12); if (!context.flags.z()) goto cannextf; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; cannextf: context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadynextf; @@ -15162,7 +15162,7 @@ alreadynextf: context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; notnextf: - {assert(stack_depth == context.stack.size()); return; } + return; donextf: context._inc(context.data.byte(kFolderpage)); folderhints(context); @@ -15172,11 +15172,11 @@ donextf: context.bx = 3636; checkcoords(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void folderhints(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 5); if (!context.flags.z()) goto notaideadd; context._cmp(context.data.byte(kAidedead), 1); @@ -15198,7 +15198,7 @@ void folderhints(Context & context) { worktoscreenm(context); context.cx = 200; hangonp(context); - {assert(stack_depth == context.stack.size()); return; } + return; notaideadd: context._cmp(context.data.byte(kFolderpage), 9); if (!context.flags.z()) goto notaristoadd; @@ -15220,15 +15220,15 @@ notaideadd: context.cx = 200; hangonp(context); notaristoadd: - {assert(stack_depth == context.stack.size()); return; } + return; } void lastfolder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 0); if (!context.flags.z()) goto canlastf; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; canlastf: context._cmp(context.data.byte(kCommandtype), 202); if (context.flags.z()) goto alreadylastf; @@ -15244,7 +15244,7 @@ alreadylastf: context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; notlastf: - {assert(stack_depth == context.stack.size()); return; } + return; dolastf: context._dec(context.data.byte(kFolderpage)); delpointer(context); @@ -15253,11 +15253,11 @@ dolastf: context.bx = 3636; checkcoords(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadfolder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2299; loadintotemp(context); context.dx = 2312; @@ -15268,11 +15268,11 @@ void loadfolder(Context & context) { loadtempcharset(context); context.dx = 2195; loadtemptext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showfolder(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCommandtype) = 255; context._cmp(context.data.byte(kFolderpage), 0); if (context.flags.z()) goto closedfolder; @@ -15313,7 +15313,7 @@ noleftpage: norightpage: usecharset1(context); undertextline(context); - {assert(stack_depth == context.stack.size()); return; } + return; closedfolder: createpanel2(context); context.ds = context.data.word(kTempgraphics3); @@ -15330,22 +15330,22 @@ closedfolder: showframe(context); folderexit(context); undertextline(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void folderexit(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 296; context.bx = 178; context.al = 6; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showleftpage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 0; context.bx = 12; @@ -15423,11 +15423,11 @@ flipfolderline: context._add(context.si, 320); context._add(context.di, 320); if (--context.cx) goto flipfolder; - {assert(stack_depth == context.stack.size()); return; } + return; } void showrightpage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 143; context.bx = 12; @@ -15478,11 +15478,11 @@ contrightpage: if (--context.cx) goto twolotsright; context.data.byte(kKerning) = 0; context.data.word(kLinespacing) = 10; - {assert(stack_depth == context.stack.size()); return; } + return; } void entersymbol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofreels(context); context.dx = 2338; @@ -15530,7 +15530,7 @@ symbolloop: worktoscreenm(context); context.al = 13; playchannel1(context); - {assert(stack_depth == context.stack.size()); return; } + return; symbolwrong: context.al = 46; removesetobject(context); @@ -15545,11 +15545,11 @@ symbolwrong: getridoftemp(context); restorereels(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void quitsymbol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kSymbolbotx), 24); @@ -15566,14 +15566,14 @@ alreadyqs: context._and(context.ax, 1); if (!context.flags.z()) goto doqs; notqs: - {assert(stack_depth == context.stack.size()); return; } + return; doqs: context.data.byte(kGetback) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void settopleft(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 210); @@ -15586,11 +15586,11 @@ alreadytopl: if (context.flags.z()) goto notopleft; context.data.byte(kSymboltopdir) = -1; notopleft: - {assert(stack_depth == context.stack.size()); return; } + return; } void settopright(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 211); @@ -15603,11 +15603,11 @@ alreadytopr: if (context.flags.z()) goto notopright; context.data.byte(kSymboltopdir) = 1; notopright: - {assert(stack_depth == context.stack.size()); return; } + return; } void setbotleft(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 212); @@ -15620,11 +15620,11 @@ alreadybotl: if (context.flags.z()) goto nobotleft; context.data.byte(kSymbolbotdir) = -1; nobotleft: - {assert(stack_depth == context.stack.size()); return; } + return; } void setbotright(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 213); @@ -15637,22 +15637,22 @@ alreadybotr: if (context.flags.z()) goto nobotright; context.data.byte(kSymbolbotdir) = 1; nobotright: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpsymbol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kNewtextline) = 0; context.di = (64); context.bx = (56)+20; context.cl = 104; context.ch = 60; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showsymbol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 12; context.ah = 0; context.di = (64); @@ -15722,27 +15722,27 @@ void showsymbol(Context & context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void nextsymbol(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._inc(context.al); context._cmp(context.al, 6); if (context.flags.z()) goto topwrap; context._cmp(context.al, 12); if (context.flags.z()) goto botwrap; - {assert(stack_depth == context.stack.size()); return; } + return; topwrap: context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; botwrap: context.al = 6; - {assert(stack_depth == context.stack.size()); return; } + return; } void updatesymboltop(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (context.flags.z()) goto topfinished; context._cmp(context.data.byte(kSymboltopdir), -1); @@ -15755,12 +15755,12 @@ void updatesymboltop(Context & context) { context._cmp(context.data.byte(kSymboltopnum), -1); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 5; - {assert(stack_depth == context.stack.size()); return; } + return; notwrapfor: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopdir) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; backwards: context._dec(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), -1); @@ -15770,17 +15770,17 @@ backwards: context._cmp(context.data.byte(kSymboltopnum), 6); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopnum) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notwrapback: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) goto topfinished; context.data.byte(kSymboltopdir) = 0; topfinished: - {assert(stack_depth == context.stack.size()); return; } + return; } void updatesymbolbot(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (context.flags.z()) goto botfinished; context._cmp(context.data.byte(kSymbolbotdir), -1); @@ -15793,12 +15793,12 @@ void updatesymbolbot(Context & context) { context._cmp(context.data.byte(kSymbolbotnum), -1); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 5; - {assert(stack_depth == context.stack.size()); return; } + return; notwrapforb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotdir) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; backwardsbot: context._dec(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), -1); @@ -15808,17 +15808,17 @@ backwardsbot: context._cmp(context.data.byte(kSymbolbotnum), 6); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotnum) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notwrapbackb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) goto botfinished; context.data.byte(kSymbolbotdir) = 0; botfinished: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpsymbox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kDumpx), -1); if (context.flags.z()) goto nodumpsym; context.di = context.data.word(kDumpx); @@ -15828,11 +15828,11 @@ void dumpsymbox(Context & context) { multidump(context); context.data.word(kDumpx) = -1; nodumpsym: - {assert(stack_depth == context.stack.size()); return; } + return; } void usediary(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getridofreels(context); context.dx = 2039; loadintotemp(context); @@ -15870,13 +15870,13 @@ diaryloop: context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; diarylist: - {assert(stack_depth == context.stack.size()); return; } + return; } void showdiary(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 1; context.ah = 0; context.di = (68+24); @@ -15889,11 +15889,11 @@ void showdiary(Context & context) { context.bx = (48+12)+108; context.ds = context.data.word(kTempgraphics); showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showdiarykeys(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; context._dec(context.data.byte(kPresscount)); @@ -15915,7 +15915,7 @@ gotkeyn: if (!context.flags.z()) goto notshown; showdiarypage(context); notshown: - {assert(stack_depth == context.stack.size()); return; } + return; nokeyn: context.al = 5; context._cmp(context.data.byte(kPresscount), 1); @@ -15931,13 +15931,13 @@ gotkeyp: if (!context.flags.z()) goto notshowp; showdiarypage(context); notshowp: - {assert(stack_depth == context.stack.size()); return; } + return; nokeyatall: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpdiarykeys(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notdumpdiary; context._cmp(context.data.byte(kSartaindead), 1); @@ -15969,7 +15969,7 @@ void dumpdiarykeys(Context & context) { showdiarypage(context); worktoscreenm(context); showpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; notsartadd: context.di = (68+24)+48; context.bx = (48+12)+15; @@ -15987,11 +15987,11 @@ notdumpdiary: context.cl = 16; context.ch = 16; multidump(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void diarykeyp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 214); if (context.flags.z()) goto alreadykeyp; context.data.byte(kCommandtype) = 214; @@ -16014,11 +16014,11 @@ alreadykeyp: if (!context.flags.z()) goto notkeyp; context.data.byte(kDiarypage) = 11; notkeyp: - {assert(stack_depth == context.stack.size()); return; } + return; } void diarykeyn(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 213); if (context.flags.z()) goto alreadykeyn; context.data.byte(kCommandtype) = 213; @@ -16041,11 +16041,11 @@ alreadykeyn: if (!context.flags.z()) goto notkeyn; context.data.byte(kDiarypage) = 0; notkeyn: - {assert(stack_depth == context.stack.size()); return; } + return; } void showdiarypage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = 0; context.ah = 0; context.di = (68+24); @@ -16075,11 +16075,11 @@ void showdiarypage(Context & context) { context.data.byte(kKerning) = 0; context.data.word(kCharshift) = 0; usecharset1(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void findtext1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.si = context.ax; context._add(context.si, context.si); @@ -16087,11 +16087,11 @@ void findtext1(Context & context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void zoomonoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -16108,7 +16108,7 @@ alreadyonoff: context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; nozoomonoff: - {assert(stack_depth == context.stack.size()); return; } + return; dozoomonoff: context.al = context.data.byte(kZoomon); context._xor(context.al, 1); @@ -16125,11 +16125,11 @@ dozoomonoff: commandonly(context); readmouse(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void saveload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); @@ -16147,11 +16147,11 @@ alreadyops: if (context.flags.z()) goto noops; dosaveload(context); noops: - {assert(stack_depth == context.stack.size()); return; } + return; } void dosaveload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kPointerframe) = 0; context.data.word(kTextaddressx) = 70; context.data.word(kTextaddressy) = 182-8; @@ -16197,22 +16197,22 @@ waitops: context.data.byte(kCommandtype) = 200; justret: context.data.byte(kManisoffscreen) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void getbackfromops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); if (context.flags.z()) goto opsblock1; getback1(context); - {assert(stack_depth == context.stack.size()); return; } + return; opsblock1: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showmainops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+10; context.bx = (52)+10; @@ -16231,11 +16231,11 @@ void showmainops(Context & context) { context.al = 1; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showdiscops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -16260,18 +16260,18 @@ void showdiscops(Context & context) { context.al = 5; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadsavebox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 1961; loadintotemp(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadgame(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 246); if (context.flags.z()) goto alreadyload; context.data.byte(kCommandtype) = 246; @@ -16284,7 +16284,7 @@ alreadyload: context._cmp(context.ax, 1); if (context.flags.z()) goto doload; noload: - {assert(stack_depth == context.stack.size()); return; } + return; doload: context.data.byte(kLoadingorsave) = 1; showopbox(context); @@ -16327,11 +16327,11 @@ loadops: worktoscreen(context); context.data.byte(kGetback) = 4; quitloaded: - {assert(stack_depth == context.stack.size()); return; } + return; } void getbacktoops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadygetops; context.data.byte(kCommandtype) = 201; @@ -16344,15 +16344,15 @@ alreadygetops: context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; nogetbackops: - {assert(stack_depth == context.stack.size()); return; } + return; dogetbackops: oldtonames(context); context.data.byte(kGetback) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; } void discops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadydiscops; context.data.byte(kCommandtype) = 249; @@ -16365,7 +16365,7 @@ alreadydiscops: context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; nodiscops: - {assert(stack_depth == context.stack.size()); return; } + return; dodiscops: scanfornames(context); context.data.byte(kLoadingorsave) = 2; @@ -16385,15 +16385,15 @@ discopsloop: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto discopsloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void savegame(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); if (!context.flags.z()) goto cansaveok; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; cansaveok: context._cmp(context.data.byte(kCommandtype), 247); if (context.flags.z()) goto alreadysave; @@ -16404,7 +16404,7 @@ alreadysave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (!context.flags.z()) goto dosave; - {assert(stack_depth == context.stack.size()); return; } + return; dosave: context.data.byte(kLoadingorsave) = 2; showopbox(context); @@ -16429,11 +16429,11 @@ saveops: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto saveops; - {assert(stack_depth == context.stack.size()); return; } + return; } void actualsave(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyactsave; context.data.byte(kCommandtype) = 222; @@ -16490,11 +16490,11 @@ alreadyactsave: worktoscreenm(context); context.data.byte(kGetback) = 4; noactsave: - {assert(stack_depth == context.stack.size()); return; } + return; } void actualload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadyactload; context.data.byte(kCommandtype) = 221; @@ -16520,21 +16520,21 @@ alreadyactload: loadposition(context); context.data.byte(kGetback) = 1; notactload: - {assert(stack_depth == context.stack.size()); return; } + return; } void selectslot2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto noselslot2; context.data.byte(kLoadingorsave) = 2; noselslot2: selectslot(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkinput(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLoadingorsave), 3); if (context.flags.z()) goto nokeypress; readkey(context); @@ -16567,18 +16567,18 @@ spacepress: context.es.byte(context.bx+3) = 1; goto afterkey; nokeypress: - {assert(stack_depth == context.stack.size()); return; } + return; afterkey: showopbox(context); shownames(context); showslots(context); showsaveops(context); worktoscreenm(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getnamepos(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kCurrentslot); context.ah = 0; context.cx = 17; @@ -16590,11 +16590,11 @@ void getnamepos(Context & context) { context.al = context.data.byte(kCursorpos); context.ah = 0; context._add(context.bx, context.ax); - {assert(stack_depth == context.stack.size()); return; } + return; } void showopbox(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60); context.bx = (52); @@ -16607,11 +16607,11 @@ void showopbox(Context & context) { context.al = 4; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showloadops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -16629,11 +16629,11 @@ void showloadops(Context & context) { context.al = 55; context.dl = 101; printmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showsaveops(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; context.bx = (52)+12; @@ -16651,11 +16651,11 @@ void showsaveops(Context & context) { context.al = 54; context.dl = 101; printmessage(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void selectslot(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 244); if (context.flags.z()) goto alreadysel; context.data.byte(kCommandtype) = 244; @@ -16691,20 +16691,20 @@ getslotnum: showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; isloadmode: showloadops(context); readmouse(context); showpointer(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; noselslot: - {assert(stack_depth == context.stack.size()); return; } + return; } void showslots(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (60)+7; context.bx = (52)+8; context.al = 2; @@ -16732,11 +16732,11 @@ nomatchslot: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto slotloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void shownames(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = context.data; context.es = context.dx; context.si = 8579+1; @@ -16799,33 +16799,33 @@ afterprintname: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto shownameloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void namestoold(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.cs; context.si = 8579; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void oldtonames(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.cs; context.di = 8579; context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void saveposition(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); makeheader(context); context.al = context.data.byte(kCurrentslot); context.ah = 0; @@ -16873,11 +16873,11 @@ void saveposition(Context & context) { saveseg(context); fquit: closefile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadposition(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kTimecount) = 0; clearchanges(context); context.al = context.data.byte(kCurrentslot); @@ -16922,11 +16922,11 @@ void loadposition(Context & context) { context.dx = 534; loadseg(context); closefile(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void makeheader(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = context.data; context.es = context.dx; context.di = 6141; @@ -16942,21 +16942,21 @@ void makeheader(Context & context) { storeit(context); context.ax = (991-534); storeit(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void storeit(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ax, 0); if (!context.flags.z()) goto isntblank; context._inc(context.ax); isntblank: context._stosw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void findlen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._dec(context.bx); context._add(context.bx, context.ax); nextone: @@ -16967,11 +16967,11 @@ nextone: context._cmp(context.ax, 0); if (!context.flags.z()) goto nextone; foundlen: - {assert(stack_depth == context.stack.size()); return; } + return; } void scanfornames(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = context.data; context.es = context.dx; context.di = 8579; @@ -17016,11 +17016,11 @@ notexist: context._dec(context.cl); if (!context.flags.z()) goto scanloop; context.al = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; } void decide(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); setmode(context); loadpalfromiff(context); clearpalette(context); @@ -17054,11 +17054,11 @@ hasloadedroom: context.data.word(kTextaddressx) = 13; context.data.word(kTextaddressy) = 182; context.data.byte(kTextlen) = 240; - {assert(stack_depth == context.stack.size()); return; } + return; } void showdecisions(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); createpanel2(context); showopbox(context); context.ds = context.data.word(kTempgraphics); @@ -17068,11 +17068,11 @@ void showdecisions(Context & context) { context.ah = 0; showframe(context); undertextline(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void newgame(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 251); if (context.flags.z()) goto alreadynewgame; context.data.byte(kCommandtype) = 251; @@ -17084,11 +17084,11 @@ alreadynewgame: if (!context.flags.z()) goto nonewgame; context.data.byte(kGetback) = 3; nonewgame: - {assert(stack_depth == context.stack.size()); return; } + return; } void doload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kLoadingorsave) = 1; showopbox(context); showloadops(context); @@ -17130,11 +17130,11 @@ loadops: worktoscreen(context); context.data.byte(kGetback) = 4; quitloaded: - {assert(stack_depth == context.stack.size()); return; } + return; } void loadold(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 252); if (context.flags.z()) goto alreadyloadold; context.data.byte(kCommandtype) = 252; @@ -17151,11 +17151,11 @@ alreadyloadold: worktoscreenm(context); context.data.byte(kGetback) = 0; noloadold: - {assert(stack_depth == context.stack.size()); return; } + return; } void createname(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.di = 5105; context.cs.byte(context.di+0) = context.dl; @@ -17193,11 +17193,11 @@ tensc: context.cs.byte(context.di+6) = context.cl; context._add(context.al, '0'); context.cs.byte(context.di+7) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void trysoundalloc(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) goto gotsoundbuff; context._inc(context.data.byte(kSoundtimes)); @@ -17221,16 +17221,16 @@ void trysoundalloc(Context & context) { context.ax = 0x7f7f; while(context.cx--) context._stosw(); context.data.byte(kNeedsoundbuff) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; soundfail: context.es = context.data.word(kSoundbuffer); deallocatemem(context); gotsoundbuff: - {assert(stack_depth == context.stack.size()); return; } + return; } void playchannel0(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother4; context.push(context.es); @@ -17275,11 +17275,11 @@ nosetloop: context.ds = context.pop(); context.es = context.pop(); dontbother4: - {assert(stack_depth == context.stack.size()); return; } + return; } void playchannel1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother5; context._cmp(context.data.byte(kCh1playing), 7); @@ -17316,11 +17316,11 @@ notsecondbank1: context.ds = context.pop(); context.es = context.pop(); dontbother5: - {assert(stack_depth == context.stack.size()); return; } + return; } void makenextblock(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); volumeadjust(context); loopchannel0(context); context._cmp(context.data.word(kCh1blockstocopy), 0); @@ -17330,7 +17330,7 @@ void makenextblock(Context & context) { context._dec(context.data.word(kCh0blockstocopy)); context._dec(context.data.word(kCh1blockstocopy)); bothchannels(context); - {assert(stack_depth == context.stack.size()); return; } + return; mightbeonlych1: context.data.byte(kCh0playing) = 255; context._cmp(context.data.word(kCh1blockstocopy), 0); @@ -17338,14 +17338,14 @@ mightbeonlych1: context._dec(context.data.word(kCh1blockstocopy)); channel1only(context); notch1only: - {assert(stack_depth == context.stack.size()); return; } + return; mightbeonlych0: context.data.byte(kCh1playing) = 255; context._cmp(context.data.word(kCh0blockstocopy), 0); if (context.flags.z()) goto notch0only; context._dec(context.data.word(kCh0blockstocopy)); channel0only(context); - {assert(stack_depth == context.stack.size()); return; } + return; notch0only: context.es = context.data.word(kSoundbuffer); context.di = context.data.word(kSoundbufferwrite); @@ -17354,11 +17354,11 @@ notch0only: while(context.cx--) context._stosw(); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; - {assert(stack_depth == context.stack.size()); return; } + return; } void volumeadjust(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); if (context.flags.z()) goto volok; @@ -17370,15 +17370,15 @@ void volumeadjust(Context & context) { context.al = context.data.byte(kVolume); context._add(context.al, context.data.byte(kVolumedirection)); context.data.byte(kVolume) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; volfinish: context.data.byte(kVolumedirection) = 0; volok: - {assert(stack_depth == context.stack.size()); return; } + return; } void loopchannel0(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kCh0blockstocopy), 0); if (!context.flags.z()) goto notloop; context._cmp(context.data.byte(kCh0repeat), 0); @@ -17394,33 +17394,33 @@ endlessloop: context.ax = context.data.word(kCh0blockstocopy); context._add(context.ax, context.data.word(kCh0oldblockstocopy)); context.data.word(kCh0blockstocopy) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; notloop: - {assert(stack_depth == context.stack.size()); return; } + return; } void cancelch0(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCh0repeat) = 0; context.data.word(kCh0blockstocopy) = 0; context.data.byte(kCh0playing) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void cancelch1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kCh1blockstocopy) = 0; context.data.byte(kCh1playing) = 255; - {assert(stack_depth == context.stack.size()); return; } + return; } void channel0tran(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; while(context.cx--) context._movsw(); - {assert(stack_depth == context.stack.size()); return; } + return; lowvolumetran: context.cx = 1024; context.bh = context.data.byte(kVolume); @@ -17434,11 +17434,11 @@ volloop: context.ah = context.es.byte(context.bx); context._stosw(); if (--context.cx) goto volloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void domix(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumemix; slow: @@ -17527,11 +17527,11 @@ nodistortv: context._stosb(); if (--context.cx) goto lowvolumemix; doneit: - {assert(stack_depth == context.stack.size()); return; } + return; } void entrytexts(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 21); if (!context.flags.z()) goto notloc15; context.al = 28; @@ -17540,7 +17540,7 @@ void entrytexts(Context & context) { context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notloc15: context._cmp(context.data.byte(kLocation), 30); if (!context.flags.z()) goto notloc43; @@ -17550,7 +17550,7 @@ notloc15: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notloc43: context._cmp(context.data.byte(kLocation), 23); if (!context.flags.z()) goto notloc23; @@ -17560,7 +17560,7 @@ notloc43: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notloc23: context._cmp(context.data.byte(kLocation), 31); if (!context.flags.z()) goto notloc44; @@ -17570,7 +17570,7 @@ notloc23: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notloc44: context._cmp(context.data.byte(kLocation), 20); if (!context.flags.z()) goto notsarters2; @@ -17580,7 +17580,7 @@ notloc44: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notsarters2: context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedenlob; @@ -17590,7 +17590,7 @@ notsarters2: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; notedenlob: context._cmp(context.data.byte(kLocation), 34); if (!context.flags.z()) goto noteden2; @@ -17600,13 +17600,13 @@ notedenlob: context.bl = 68; context.bh = 64; setuptimeduse(context); - {assert(stack_depth == context.stack.size()); return; } + return; noteden2: - {assert(stack_depth == context.stack.size()); return; } + return; } void entryanims(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.word(kReeltowatch) = -1; context.data.byte(kWatchmode) = -1; context._cmp(context.data.byte(kLocation), 33); @@ -17617,7 +17617,7 @@ void entryanims(Context & context) { context.data.word(kEndwatchreel) = 76; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notinthebeach: context._cmp(context.data.byte(kLocation), 44); if (!context.flags.z()) goto notsparkys; @@ -17629,7 +17629,7 @@ notinthebeach: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notsparkys: context._cmp(context.data.byte(kLocation), 22); if (!context.flags.z()) goto notinthelift; @@ -17639,13 +17639,13 @@ notsparkys: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notinthelift: context._cmp(context.data.byte(kLocation), 26); if (!context.flags.z()) goto notunderchurch; context.data.byte(kSymboltopnum) = 2; context.data.byte(kSymbolbotnum) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; notunderchurch: context._cmp(context.data.byte(kLocation), 45); if (!context.flags.z()) goto notenterdream; @@ -17656,7 +17656,7 @@ notunderchurch: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notenterdream: context._cmp(context.data.byte(kReallocation), 46); if (!context.flags.z()) goto notcrystal; @@ -17664,7 +17664,7 @@ notenterdream: if (!context.flags.z()) goto notcrystal; context.al = 0; removefreeobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; notcrystal: context._cmp(context.data.byte(kLocation), 9); if (!context.flags.z()) goto nottopchurch; @@ -17683,7 +17683,7 @@ makedoorsopen: removesetobject(context); context.al = 5; placesetobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; nottopchurch: context._cmp(context.data.byte(kLocation), 47); if (!context.flags.z()) goto notdreamcentre; @@ -17691,7 +17691,7 @@ nottopchurch: placesetobject(context); context.al = 5; placesetobject(context); - {assert(stack_depth == context.stack.size()); return; } + return; notdreamcentre: context._cmp(context.data.byte(kLocation), 38); if (!context.flags.z()) goto notcarpark; @@ -17701,7 +17701,7 @@ notdreamcentre: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notcarpark: context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notalley; @@ -17711,7 +17711,7 @@ notcarpark: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; notalley: context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) goto notedensagain; @@ -17720,14 +17720,14 @@ notalley: context._dec(context.ah); turnanypathon(context); notedensagain: - {assert(stack_depth == context.stack.size()); return; } + return; } void initialinv(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); if (context.flags.z()) goto isedens; - {assert(stack_depth == context.stack.size()); return; } + return; isedens: context.al = 11; context.ah = 5; @@ -17760,38 +17760,38 @@ isedens: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void pickupob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kLastinvpos) = context.ah; context.data.byte(kObjecttype) = 2; context.data.byte(kItemframe) = context.al; context.data.byte(kCommand) = context.al; getanyad(context); transfertoex(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkforemm(Context & context) { - uint stack_depth = context.stack.size(); - {assert(stack_depth == context.stack.size()); return; } + STACK_CHECK(context); + return; } void checkbasemem(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); if (!context.flags.c()) goto enoughmem; context.data.byte(kGameerror) = 5; { quickquit(context); return; }; enoughmem: - {assert(stack_depth == context.stack.size()); return; } + return; } void allocatebuffers(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; allocatemem(context); context.data.word(kExtras) = context.ax; @@ -17822,11 +17822,11 @@ void allocatebuffers(Context & context) { context.bx = 2048/16; allocatemem(context); context.data.word(kSounddata2) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void clearbuffers(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; context.ax = 0; @@ -17850,11 +17850,11 @@ void clearbuffers(Context & context) { context.cx = (68-0); while(context.cx--) context._movsb(); clearchanges(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearchanges(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = (250)*2; context.ax = 0x0ffff; @@ -17892,33 +17892,33 @@ void clearchanges(Context & context) { context.ax = 0; context.cx = 6; while(context.cx--) context._stosw(); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearbeforeload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 1); if (!context.flags.z()) goto noclear; clearreels(context); clearrest(context); context.data.byte(kRoomloaded) = 0; noclear: - {assert(stack_depth == context.stack.size()); return; } + return; } void clearreels(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kReel1); deallocatemem(context); context.es = context.data.word(kReel2); deallocatemem(context); context.es = context.data.word(kReel3); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void clearrest(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kMapdata); context.cx = (66*60)/2; context.ax = 0; @@ -17942,11 +17942,11 @@ void clearrest(Context & context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void parseblaster(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); lookattail: context.al = context.es.byte(context.bx); context._cmp(context.al, 0); @@ -17975,7 +17975,7 @@ lookattail: if (context.flags.z()) goto isdma; context._inc(context.bx); if (--context.cx) goto lookattail; - {assert(stack_depth == context.stack.size()); return; } + return; issoundint: context.al = context.es.byte(context.bx+1); context._sub(context.al, '0'); @@ -18009,11 +18009,11 @@ isnosound: context._inc(context.bx); goto lookattail; endtail: - {assert(stack_depth == context.stack.size()); return; } + return; } void startup(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCurrentkey) = 0; context.data.byte(kMainmode) = 0; createpanel(context); @@ -18026,11 +18026,11 @@ void startup(Context & context) { undertextline(context); reelsonscreen(context); atmospheres(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void startup1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); clearpalette(context); context.data.byte(kThroughdoor) = 0; context.data.byte(kCurrentkey) = '0'; @@ -18047,11 +18047,11 @@ void startup1(Context & context) { atmospheres(context); worktoscreen(context); fadescreenup(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void screenupdate(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); newplace(context); mainscreen(context); animpointer(context); @@ -18096,11 +18096,11 @@ iswatchingmode: dumpwatch(context); delpointer(context); finishearly: - {assert(stack_depth == context.stack.size()); return; } + return; } void watchreel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), -1); if (context.flags.z()) goto notplayingreel; context.al = context.data.byte(kManspath); @@ -18110,7 +18110,7 @@ void watchreel(Context & context) { context._cmp(context.al, context.data.byte(kFacing)); if (context.flags.z()) goto notwatchpath; waitstopwalk: - {assert(stack_depth == context.stack.size()); return; } + return; notwatchpath: context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); @@ -18138,14 +18138,14 @@ showwatchreel: context.data.word(kReeltowatch) = context.ax; checkforshake(context); nomorereel: - {assert(stack_depth == context.stack.size()); return; } + return; notplayingreel: context._cmp(context.data.byte(kWatchmode), 1); if (!context.flags.z()) goto notholdingreel; context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); - {assert(stack_depth == context.stack.size()); return; } + return; notholdingreel: context._cmp(context.data.byte(kWatchmode), 2); if (!context.flags.z()) goto notreleasehold; @@ -18165,29 +18165,29 @@ notlastspeed2: context.data.byte(kDestination) = context.al; context.data.byte(kFinaldest) = context.al; autosetwalk(context); - {assert(stack_depth == context.stack.size()); return; } + return; ismorereel2: context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); - {assert(stack_depth == context.stack.size()); return; } + return; notreleasehold: - {assert(stack_depth == context.stack.size()); return; } + return; } void checkforshake(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 26); if (!context.flags.z()) goto notstartshake; context._cmp(context.ax, 104); if (!context.flags.z()) goto notstartshake; context.data.byte(kShakecounter) = -1; notstartshake: - {assert(stack_depth == context.stack.size()); return; } + return; } void watchcount(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatchworn; context._inc(context.data.byte(kTimercount)); @@ -18196,7 +18196,7 @@ void watchcount(Context & context) { context._cmp(context.data.byte(kTimercount), 18); if (context.flags.z()) goto uptime; nowatchworn: - {assert(stack_depth == context.stack.size()); return; } + return; flashdots: context.ax = 91*3+21; context.di = 268+4; @@ -18222,11 +18222,11 @@ finishtime: showtime(context); finishwatch: context.data.byte(kWatchdump) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void showtime(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatch; context.al = context.data.byte(kSecondcount); @@ -18289,11 +18289,11 @@ void showtime(Context & context) { context.bx = 21; showframe(context); nowatch: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpwatch(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchdump), 1); if (!context.flags.z()) goto nodumpwatch; context.di = 256; @@ -18303,11 +18303,11 @@ void dumpwatch(Context & context) { multidump(context); context.data.byte(kWatchdump) = 0; nodumpwatch: - {assert(stack_depth == context.stack.size()); return; } + return; } void showbyte(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dl = context.al; context._shr(context.dl, 1); context._shr(context.dl, 1); @@ -18320,23 +18320,23 @@ void showbyte(Context & context) { onedigit(context); context.es.byte(context.di+1) = context.dl; context._add(context.di, 3); - {assert(stack_depth == context.stack.size()); return; } + return; } void onedigit(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.dl, 10); if (!context.flags.c()) goto morethan10; context._add(context.dl, '0'); - {assert(stack_depth == context.stack.size()); return; } + return; morethan10: context._sub(context.dl, 10); context._add(context.dl, 'A'); - {assert(stack_depth == context.stack.size()); return; } + return; } void twodigitnum(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = context.cl; context._dec(context.ah); numloop1: @@ -18345,11 +18345,11 @@ numloop1: if (!context.flags.c()) goto numloop1; context._add(context.al, 10); context._add(context.al, context.cl); - {assert(stack_depth == context.stack.size()); return; } + return; } void showword(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ch = 0; context.bx = 10000; context.cl = 47; @@ -18391,11 +18391,11 @@ word4: context.cl = context.al; convnum(context); context.cs.byte(context.di+4) = context.cl; - {assert(stack_depth == context.stack.size()); return; } + return; } void convnum(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.ch, 0); if (!context.flags.z()) goto noconvnum; context._cmp(context.cl, '0'); @@ -18405,11 +18405,11 @@ void convnum(Context & context) { notzeronum: context.ch = 1; noconvnum: - {assert(stack_depth == context.stack.size()); return; } + return; } void walkandexamine(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); finishedwalking(context); if (!context.flags.z()) goto noobselect; context.al = context.data.byte(kWalkexamtype); @@ -18420,12 +18420,12 @@ void walkandexamine(Context & context) { context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); - {assert(stack_depth == context.stack.size()); return; } + return; wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; noobselect: - {assert(stack_depth == context.stack.size()); return; } + return; diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; @@ -18465,23 +18465,23 @@ notblock: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); - {assert(stack_depth == context.stack.size()); return; } + return; middleofwalk: blocknametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; isblock: blocknametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; isaperson: personnametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; toofaraway: walktotext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void mainscreen(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kInmaparea) = 0; context.bx = 5122; context._cmp(context.data.byte(kWatchon), 1); @@ -18493,11 +18493,11 @@ checkmain: if (context.flags.z()) goto finishmain; walkandexamine(context); finishmain: - {assert(stack_depth == context.stack.size()); return; } + return; } void madmanrun(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) { identifyob(context); return; }; context._cmp(context.data.byte(kMapx), 22); @@ -18519,14 +18519,14 @@ alreadyrun: if (context.flags.z()) goto norun; context.data.byte(kLastweapon) = 8; norun: - {assert(stack_depth == context.stack.size()); return; } + return; } void checkcoords(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNewlocation), 255); if (context.flags.z()) goto loop048; - {assert(stack_depth == context.stack.size()); return; } + return; loop048: context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); @@ -18547,17 +18547,17 @@ loop048: __dispatch_call(context, context.ax); finished: context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; over045: context.bx = context.pop(); context._add(context.bx, 10); goto loop048; nonefound: - {assert(stack_depth == context.stack.size()); return; } + return; } void identifyob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; context.ax = context.data.word(kMousex); @@ -18565,14 +18565,14 @@ void identifyob(Context & context) { context._cmp(context.ax, 22*8); if (context.flags.c()) goto notover1; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; notover1: context.bx = context.data.word(kMousey); context._sub(context.bx, context.data.word(kMapady)); context._cmp(context.bx, 20*8); if (context.flags.c()) goto notover2; blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; notover2: context.data.byte(kInmaparea) = 1; context.ah = context.bl; @@ -18606,14 +18606,14 @@ notover2: context.ah = 3; obname(context); finishidentify: - {assert(stack_depth == context.stack.size()); return; } + return; nothingund: blank(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void checkifperson(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); context.cx = 12; @@ -18660,17 +18660,17 @@ notblankpers: obname(context); context.al = 0; context._cmp(context.al, 1); - {assert(stack_depth == context.stack.size()); return; } + return; notareelid: context.cx = context.pop(); context._add(context.bx, 5); context._dec(context.cx); if (!context.flags.z()) goto identifyreel; - {assert(stack_depth == context.stack.size()); return; } + return; } void checkifset(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); context.cx = 127; @@ -18694,17 +18694,17 @@ identifyset: obname(context); context.al = 0; context._cmp(context.al, 1); - {assert(stack_depth == context.stack.size()); return; } + return; notasetid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyset; - {assert(stack_depth == context.stack.size()); return; } + return; } void checkifex(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); context.cx = 99; @@ -18724,17 +18724,17 @@ identifyex: obname(context); context.al = 1; context._cmp(context.al, 0); - {assert(stack_depth == context.stack.size()); return; } + return; notanexid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyex; - {assert(stack_depth == context.stack.size()); return; } + return; } void checkiffree(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); context.cx = 79; @@ -18754,17 +18754,17 @@ identifyfree: obname(context); context.al = 0; context._cmp(context.al, 1); - {assert(stack_depth == context.stack.size()); return; } + return; notafreeid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyfree; - {assert(stack_depth == context.stack.size()); return; } + return; } void isitdescribed(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.cx); context.push(context.es); @@ -18784,11 +18784,11 @@ void isitdescribed(Context & context) { context.cx = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - {assert(stack_depth == context.stack.size()); return; } + return; } void findpathofpoint(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.bx = (0); context.es = context.data.word(kReels); @@ -18823,11 +18823,11 @@ flunkedit: if (!context.flags.z()) goto pathloop; context.dl = 255; gotvalidpath: - {assert(stack_depth == context.stack.size()); return; } + return; } void findfirstpath(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.bx = (0); context.es = context.data.word(kReels); @@ -18858,14 +18858,14 @@ nofirst: context._cmp(context.dl, 12); if (!context.flags.z()) goto fpathloop; context.al = 0; - {assert(stack_depth == context.stack.size()); return; } + return; gotfirst: context.al = context.es.byte(context.bx+6); - {assert(stack_depth == context.stack.size()); return; } + return; } void turnpathon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18885,11 +18885,11 @@ void turnpathon(Context & context) { context.al = 255; context.es.byte(context.bx+6) = context.al; nopathon: - {assert(stack_depth == context.stack.size()); return; } + return; } void turnpathoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18909,11 +18909,11 @@ void turnpathoff(Context & context) { context.al = 0; context.es.byte(context.bx+6) = context.al; nopathoff: - {assert(stack_depth == context.stack.size()); return; } + return; } void turnanypathon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.cl = 255; @@ -18936,11 +18936,11 @@ void turnanypathon(Context & context) { context._add(context.bx, context.ax); context.al = 255; context.es.byte(context.bx+6) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void turnanypathoff(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.cl = 0; @@ -18963,11 +18963,11 @@ void turnanypathoff(Context & context) { context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void checkifpathison(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); getroomspaths(context); context.ax = context.pop(); @@ -18978,11 +18978,11 @@ void checkifpathison(Context & context) { context._add(context.bx, context.ax); context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); - {assert(stack_depth == context.stack.size()); return; } + return; } void afternewroom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnew; context.data.word(kTimecount) = 0; @@ -19017,11 +19017,11 @@ ryansoff: reminders(context); atmospheres(context); notnew: - {assert(stack_depth == context.stack.size()); return; } + return; } void atmospheres(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cl = context.data.byte(kMapx); context.ch = context.data.byte(kMapy); context.bx = 5246; @@ -19060,10 +19060,10 @@ notlouisvol: context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) goto notmad1; context.data.byte(kVolume) = 5; - {assert(stack_depth == context.stack.size()); return; } + return; ismad2: context.data.byte(kVolume) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; notmad1: playingalready: context._cmp(context.data.byte(kReallocation), 2); @@ -19075,20 +19075,20 @@ playingalready: fullvol: context.data.byte(kVolume) = 0; notlouisvol2: - {assert(stack_depth == context.stack.size()); return; } + return; louisvol: context.data.byte(kVolume) = 5; - {assert(stack_depth == context.stack.size()); return; } + return; wrongatmos: context._add(context.bx, 5); goto nextatmos; nomoreatmos: cancelch0(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void walkintoroom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) goto notlair; context._cmp(context.data.byte(kMapx), 22); @@ -19097,11 +19097,11 @@ void walkintoroom(Context & context) { context.data.byte(kFinaldest) = 1; autosetwalk(context); notlair: - {assert(stack_depth == context.stack.size()); return; } + return; } void afterintroroom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnewintro; clearwork(context); @@ -19114,11 +19114,11 @@ void afterintroroom(Context & context) { worktoscreen(context); context.data.byte(kNowinnewroom) = 0; notnewintro: - {assert(stack_depth == context.stack.size()); return; } + return; } void obname(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReasseschanges), 0); if (context.flags.z()) goto notnewpath; context.data.byte(kReasseschanges) = 0; @@ -19151,12 +19151,12 @@ isntblock: context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; examineob(context); - {assert(stack_depth == context.stack.size()); return; } + return; wantstotalk: context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto noobselect; talk(context); - {assert(stack_depth == context.stack.size()); return; } + return; walkandexamine: finishedwalking(context); if (!context.flags.z()) goto noobselect; @@ -19168,12 +19168,12 @@ walkandexamine: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto noobselect; examineob(context); - {assert(stack_depth == context.stack.size()); return; } + return; wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; noobselect: - {assert(stack_depth == context.stack.size()); return; } + return; diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; @@ -19213,42 +19213,42 @@ notblock: context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto isaperson; examineobtext(context); - {assert(stack_depth == context.stack.size()); return; } + return; middleofwalk: blocknametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; isblock: blocknametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; isaperson: personnametext(context); - {assert(stack_depth == context.stack.size()); return; } + return; toofaraway: walktotext(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void finishedwalking(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto iswalking; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); iswalking: - {assert(stack_depth == context.stack.size()); return; } + return; } void examineobtext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 1; commandwithob(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void commandwithob(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.ax); context.push(context.bx); @@ -19298,11 +19298,11 @@ noadd: context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void commandonly(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.push(context.bx); context.push(context.cx); @@ -19334,11 +19334,11 @@ void commandonly(Context & context) { context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; } void printmessage(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -19355,11 +19355,11 @@ void printmessage(Context & context) { context.al = 0; context.ah = 0; printdirect(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void printmessage2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.dx); context.push(context.bx); context.push(context.di); @@ -19384,39 +19384,39 @@ searchmess: context.al = 0; context.ah = 0; printdirect(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void blocknametext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 0; commandwithob(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void personnametext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bl = context.data.byte(kCommand); context._and(context.bl, 127); context.bh = context.data.byte(kCommandtype); context.al = 2; commandwithob(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void walktotext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); context.al = 3; commandwithob(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getflagunderp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, context.data.word(kMapadx)); context.ax = context.data.word(kMousey); @@ -19425,11 +19425,11 @@ void getflagunderp(Context & context) { checkone(context); context.data.byte(kLastflag) = context.cl; context.data.byte(kLastflagex) = context.ch; - {assert(stack_depth == context.stack.size()); return; } + return; } void setwalk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto alreadywalking; context.al = context.data.byte(kPointerspath); @@ -19453,26 +19453,26 @@ void setwalk(Context & context) { notwalkandexam: autosetwalk(context); cantwalk: - {assert(stack_depth == context.stack.size()); return; } + return; cantwalk2: facerightway(context); - {assert(stack_depth == context.stack.size()); return; } + return; alreadywalking: context.al = context.data.byte(kPointerspath); context.data.byte(kFinaldest) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; holdingreel: context.data.byte(kDestafterhold) = context.al; context.data.byte(kWatchmode) = 2; - {assert(stack_depth == context.stack.size()); return; } + return; } void autosetwalk(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kManspath); context._cmp(context.data.byte(kFinaldest), context.al); if (!context.flags.z()) goto notsamealready; - {assert(stack_depth == context.stack.size()); return; } + return; notsamealready: getroomspaths(context); checkdest(context); @@ -19513,14 +19513,14 @@ notsamealready: context._dec(context.al); context.data.byte(kLinepointer) = context.al; context.data.byte(kLinedirection) = 1; - {assert(stack_depth == context.stack.size()); return; } + return; normalline: context.data.byte(kLinepointer) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void checkdest(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.bx); context._add(context.bx, 12*8); context.ah = context.data.byte(kManspath); @@ -19540,7 +19540,7 @@ checkdestloop: context._and(context.al, 15); context.data.byte(kDestination) = context.al; context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; nextcheck: context.dl = context.es.byte(context.bx); context._and(context.dl, 0xf0); @@ -19564,11 +19564,11 @@ nextcheck2: if (!context.flags.z()) goto checkdestloop; context.data.byte(kDestination) = context.ch; context.bx = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void bresenhams(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); workoutframes(context); context.dx = context.data; context.es = context.dx; @@ -19678,11 +19678,11 @@ lineexit: context.ax = context.di; context._shr(context.ax, 1); context.data.byte(kLinelength) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void workoutframes(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = context.data.word(kLinestartx); context._add(context.bx, 32); context.ax = context.data.word(kLineendx); @@ -19757,11 +19757,11 @@ success: context._and(context.dl, 7); context.data.byte(kTurntoface) = context.dl; context.data.byte(kTurndirection) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void getroomspaths(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kRoomnum); context.ah = 0; context.cx = 144; @@ -19769,11 +19769,11 @@ void getroomspaths(Context & context) { context.es = context.data.word(kReels); context.bx = (0); context._add(context.bx, context.ax); - {assert(stack_depth == context.stack.size()); return; } + return; } void copyname(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.di); findobname(context); context.di = context.pop(); @@ -19792,14 +19792,14 @@ finishmakename: context._inc(context.cx); context.al = 0; context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; context.al = 255; while(context.cx--) context._stosb(); - {assert(stack_depth == context.stack.size()); return; } + return; } void findobname(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ax); context.ah = 0; context._add(context.ax, context.ax); @@ -19820,7 +19820,7 @@ void findobname(Context & context) { context._add(context.ax, context.cx); context.si = context.ax; context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; notpersonname: context._cmp(context.ah, 4); if (!context.flags.z()) goto notextraname; @@ -19829,7 +19829,7 @@ notpersonname: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+2080+30000+(16*114)+((114+2)*2))); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; notextraname: context._cmp(context.ah, 2); if (!context.flags.z()) goto notfreename; @@ -19838,7 +19838,7 @@ notextraname: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(82*2))); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; notfreename: context._cmp(context.ah, 1); if (!context.flags.z()) goto notsetname; @@ -19847,18 +19847,18 @@ notfreename: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(130*2))); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; notsetname: context.ds = context.data.word(kBlockdesc); context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(98*2))); context.si = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void showicon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) goto isdream1; showpanel(context); @@ -19866,7 +19866,7 @@ void showicon(Context & context) { roomname(context); panelicons1(context); zoomicon(context); - {assert(stack_depth == context.stack.size()); return; } + return; isdream1: context.ds = context.data.word(kTempsprites); context.di = 72; @@ -19905,11 +19905,11 @@ isdream1: context.ah = 4; showframe(context); middlepanel(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void middlepanel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kTempsprites); context.di = 72+47+20; context.bx = 0; @@ -19934,11 +19934,11 @@ void middlepanel(Context & context) { context.al = 47; context.ah = 4; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showman(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 0; context.bx = 0; @@ -19960,11 +19960,11 @@ void showman(Context & context) { context.ah = 0; showframe(context); notverycool: - {assert(stack_depth == context.stack.size()); return; } + return; } void showpanel(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 72; context.bx = 0; @@ -19977,11 +19977,11 @@ void showpanel(Context & context) { context.al = 19; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void roomname(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 88; context.bx = 18; context.al = 53; @@ -20012,36 +20012,36 @@ gotpl: printdirect(context); context.data.word(kLinespacing) = 10; usecharset1(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void usecharset1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kCharset1); context.data.word(kCurrentset) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void usetempcharset(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kTempcharset); context.data.word(kCurrentset) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void showexit(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 274; context.bx = 154; context.al = 11; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void panelicons1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = 0; context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto watchison; @@ -20067,11 +20067,11 @@ watchison: zoomisoff: context.di = context.pop(); showwatch(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showwatch(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowristwatch; context.ds = context.data.word(kIcons1); @@ -20082,11 +20082,11 @@ void showwatch(Context & context) { showframe(context); showtime(context); nowristwatch: - {assert(stack_depth == context.stack.size()); return; } + return; } void zoomicon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) goto nozoom1; context.ds = context.data.word(kIcons1); @@ -20096,11 +20096,11 @@ void zoomicon(Context & context) { context.ah = 0; showframe(context); nozoom1: - {assert(stack_depth == context.stack.size()); return; } + return; } void showblink(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) goto finblink1; context._inc(context.data.byte(kBlinkcount)); @@ -20129,13 +20129,13 @@ nomorethan6: context.ah = 0; showframe(context); finblink1: - {assert(stack_depth == context.stack.size()); return; } + return; eyesshut: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpblink(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto nodumpeye; context._cmp(context.data.byte(kBlinkcount), 0); @@ -20151,41 +20151,41 @@ void dumpblink(Context & context) { multidump(context); context.ds = context.pop(); nodumpeye: - {assert(stack_depth == context.stack.size()); return; } + return; } void worktoscreenm(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); animpointer(context); readmouse(context); showpointer(context); vsync(context); worktoscreen(context); delpointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void blank(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.z()) goto alreadyblnk; context.data.byte(kCommandtype) = 199; context.al = 0; commandonly(context); alreadyblnk: - {assert(stack_depth == context.stack.size()); return; } + return; } void allpointer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); readmouse(context); showpointer(context); dumppointer(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void hangonp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); context._add(context.cx, context.cx); context.ax = context.pop(); @@ -20226,11 +20226,11 @@ getoutofit: context.data.byte(kPointerframe) = context.al; context.data.byte(kPickup) = context.ah; context.data.byte(kPointermode) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void hangonw(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); hangloopw: context.push(context.cx); delpointer(context); @@ -20241,11 +20241,11 @@ hangloopw: dumppointer(context); context.cx = context.pop(); if (--context.cx) goto hangloopw; - {assert(stack_depth == context.stack.size()); return; } + return; } void hangoncurs(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); monloop1: context.push(context.cx); printcurs(context); @@ -20253,11 +20253,11 @@ monloop1: delcurs(context); context.cx = context.pop(); if (--context.cx) goto monloop1; - {assert(stack_depth == context.stack.size()); return; } + return; } void getunderzoom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); @@ -20265,11 +20265,11 @@ void getunderzoom(Context & context) { context.cl = 46; context.ch = 40; multiget(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumpzoom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) goto notzoomon; context.di = (8)+5; @@ -20278,11 +20278,11 @@ void dumpzoom(Context & context) { context.ch = 40; multidump(context); notzoomon: - {assert(stack_depth == context.stack.size()); return; } + return; } void putunderzoom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = (8)+5; context.bx = (132)+4; context.ds = context.data.word(kBuffers); @@ -20290,11 +20290,11 @@ void putunderzoom(Context & context) { context.cl = 46; context.ch = 40; multiput(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void crosshair(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto nocross; context._cmp(context.data.byte(kCommandtype), 10); @@ -20306,7 +20306,7 @@ void crosshair(Context & context) { context.al = 9; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; nocross: context.es = context.data.word(kWorkspace); context.ds = context.data.word(kIcons1); @@ -20315,11 +20315,11 @@ nocross: context.al = 29; context.ah = 0; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void showpointer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); showblink(context); context.di = context.data.word(kMousex); context.data.word(kOldpointerx) = context.di; @@ -20363,7 +20363,7 @@ notsmally: showframe(context); context.bx = context.pop(); context.di = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; itsanobject: context.al = context.data.byte(kItemframe); context.ds = context.data.word(kExtras); @@ -20424,11 +20424,11 @@ notsmally2: context.al = 3; context.ah = 128; showframe(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void delpointer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) goto nevershown; @@ -20445,11 +20445,11 @@ void delpointer(Context & context) { context.bx = context.data.word(kDelherey); multiput(context); nevershown: - {assert(stack_depth == context.stack.size()); return; } + return; } void dumppointer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); dumpblink(context); context.cl = context.data.byte(kDelxs); context.ch = context.data.byte(kDelys); @@ -20467,11 +20467,11 @@ difffound: context.ch = context.data.byte(kPointerys); multidump(context); notboth: - {assert(stack_depth == context.stack.size()); return; } + return; } void undertextline(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context.ds = context.data.word(kBuffers); @@ -20479,11 +20479,11 @@ void undertextline(Context & context) { context.cl = (180); context.ch = (10); multiget(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void deltextline(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context.ds = context.data.word(kBuffers); @@ -20491,11 +20491,11 @@ void deltextline(Context & context) { context.cl = (180); context.ch = (10); multiput(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void dumptextline(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kNewtextline), 1); if (!context.flags.z()) goto nodumptextline; context.data.byte(kNewtextline) = 0; @@ -20505,11 +20505,11 @@ void dumptextline(Context & context) { context.ch = (10); multidump(context); nodumptextline: - {assert(stack_depth == context.stack.size()); return; } + return; } void animpointer(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) goto combathand; context._cmp(context.data.byte(kPointermode), 3); @@ -20517,7 +20517,7 @@ void animpointer(Context & context) { context._cmp(context.data.word(kWatchingtime), 0); if (context.flags.z()) goto notwatchpoint; context.data.byte(kPointerframe) = 11; - {assert(stack_depth == context.stack.size()); return; } + return; notwatchpoint: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kInmaparea), 0); @@ -20544,7 +20544,7 @@ arrow: if (!context.flags.z()) goto gothand; context.data.byte(kPointerframe) = 8; gothand: - {assert(stack_depth == context.stack.size()); return; } + return; mousehand: context._cmp(context.data.byte(kPointerspeed), 0); if (context.flags.z()) goto rightspeed3; @@ -20563,7 +20563,7 @@ finflashmouse: context._add(context.bx, context.ax); context.al = context.cs.byte(context.bx); context.data.byte(kPointerframe) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; combathand: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kReallocation), 14); @@ -20572,11 +20572,11 @@ combathand: if (!context.flags.z()) goto notarrow; context.data.byte(kPointerframe) = 5; notarrow: - {assert(stack_depth == context.stack.size()); return; } + return; } void readmouse(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; context.ax = context.data.word(kMousex); @@ -20587,11 +20587,11 @@ void readmouse(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton) = context.bx; - {assert(stack_depth == context.stack.size()); return; } + return; } void readmouse1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -20600,11 +20600,11 @@ void readmouse1(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton1) = context.bx; - {assert(stack_depth == context.stack.size()); return; } + return; } void readmouse2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -20613,11 +20613,11 @@ void readmouse2(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton2) = context.bx; - {assert(stack_depth == context.stack.size()); return; } + return; } void readmouse3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; context.ax = context.data.word(kMousey); @@ -20626,11 +20626,11 @@ void readmouse3(Context & context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton3) = context.bx; - {assert(stack_depth == context.stack.size()); return; } + return; } void readmouse4(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; context.ax = context.data.word(kMousex); @@ -20645,11 +20645,11 @@ void readmouse4(Context & context) { context._or(context.ax, context.data.word(kMousebutton3)); context._or(context.bx, context.ax); context.data.word(kMousebutton) = context.bx; - {assert(stack_depth == context.stack.size()); return; } + return; } void readkey(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.bx = context.data.word(kBufferout); context._cmp(context.bx, context.data.word(kBufferin)); if (context.flags.z()) goto nokey; @@ -20660,24 +20660,24 @@ void readkey(Context & context) { context._add(context.di, context.bx); context.al = context.cs.byte(context.di); context.data.byte(kCurrentkey) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; nokey: context.data.byte(kCurrentkey) = 0; - {assert(stack_depth == context.stack.size()); return; } + return; } void convertkey(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._and(context.al, 127); context.ah = 0; context.di = 5928; context._add(context.di, context.ax); context.al = context.cs.byte(context.di); - {assert(stack_depth == context.stack.size()); return; } + return; } void randomnum1(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ds); context.push(context.es); context.push(context.di); @@ -20689,11 +20689,11 @@ void randomnum1(Context & context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void randomnum2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.ds); context.push(context.es); context.push(context.di); @@ -20706,60 +20706,60 @@ void randomnum2(Context & context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void hangon(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); hangonloop: context.push(context.cx); vsync(context); context.cx = context.pop(); if (--context.cx) goto hangonloop; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadtraveltext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 2234; standardload(context); context.data.word(kTraveltext) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadintotemp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadintotemp2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics2) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadintotemp3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.cs; standardload(context); context.data.word(kTempgraphics3) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadtempcharset(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); standardload(context); context.data.word(kTempcharset) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void standardload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); openfile(context); readheader(context); context.bx = context.es.word(context.di); @@ -20774,18 +20774,18 @@ void standardload(Context & context) { readfromfile(context); closefile(context); context.ax = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadtemptext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); standardload(context); context.data.word(kTextfile1) = context.ax; - {assert(stack_depth == context.stack.size()); return; } + return; } void loadroom(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kRoomloaded) = 1; context.data.word(kTimecount) = 0; context.data.word(kMaintimer) = 0; @@ -20802,11 +20802,11 @@ void loadroom(Context & context) { switchryanon(context); drawflags(context); getdimension(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void loadroomssample(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); if (context.flags.z()) goto loadedalready; @@ -20822,11 +20822,11 @@ void loadroomssample(Context & context) { context.dx = context.di; loadsecondsample(context); loadedalready: - {assert(stack_depth == context.stack.size()); return; } + return; } void getridofreels(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontgetrid; context.es = context.data.word(kReel1); @@ -20836,11 +20836,11 @@ void getridofreels(Context & context) { context.es = context.data.word(kReel3); deallocatemem(context); dontgetrid: - {assert(stack_depth == context.stack.size()); return; } + return; } void getridofall(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kBackdrop); deallocatemem(context); context.es = context.data.word(kSetframes); @@ -20865,11 +20865,11 @@ void getridofall(Context & context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void restorereels(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontrestore; context.al = context.data.byte(kReallocation); @@ -20898,11 +20898,11 @@ void restorereels(Context & context) { loadseg(context); closefile(context); dontrestore: - {assert(stack_depth == context.stack.size()); return; } + return; } void restoreall(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kLocation); getroomdata(context); context.dx = context.bx; @@ -20979,11 +20979,11 @@ void restoreall(Context & context) { loadseg(context); closefile(context); setallchanges(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void sortoutmap(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.di); context.ds = context.data.word(kWorkspace); @@ -21002,11 +21002,11 @@ blimey: if (--context.cx) goto blimey; context.di = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void startloading(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.data.byte(kCombatcount) = 0; context.al = context.cs.byte(context.bx+13); context.data.byte(kRoomssample) = context.al; @@ -21138,11 +21138,11 @@ void startloading(Context & context) { context.bx = context.pop(); dontwalkin: findxyfrompath(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void disablepath(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.cx); context._xchg(context.al, context.ah); context.cx = -6; @@ -21171,11 +21171,11 @@ lookx2: context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - {assert(stack_depth == context.stack.size()); return; } + return; } void findxyfrompath(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); getroomspaths(context); context.al = context.data.byte(kManspath); context.ah = 0; @@ -21188,11 +21188,11 @@ void findxyfrompath(Context & context) { context._sub(context.ah, 12); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - {assert(stack_depth == context.stack.size()); return; } + return; } void findroominloc(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.al = context.data.byte(kMapy); context.cx = -6; looky: @@ -21206,32 +21206,32 @@ lookx: context._sub(context.al, 11); if (!context.flags.c()) goto lookx; context.data.byte(kRoomnum) = context.cl; - {assert(stack_depth == context.stack.size()); return; } + return; } void getroomdata(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ah = 0; context.cx = 32; context._mul(context.cx); context.bx = 6187; context._add(context.bx, context.ax); - {assert(stack_depth == context.stack.size()); return; } + return; } void readheader(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.ds = context.cs; context.dx = 6091; context.cx = (6187-6091); readfromfile(context); context.es = context.cs; context.di = 6141; - {assert(stack_depth == context.stack.size()); return; } + return; } void allocateload(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.di); context.bx = context.es.word(context.di); @@ -21240,11 +21240,11 @@ void allocateload(Context & context) { allocatemem(context); context.di = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void fillspace(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.push(context.es); context.push(context.ds); context.push(context.dx); @@ -21258,53 +21258,53 @@ void fillspace(Context & context) { context.dx = context.pop(); context.ds = context.pop(); context.es = context.pop(); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftemp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTempgraphics); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftemptext(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTextfile1); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftemp2(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTempgraphics2); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftemp3(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTempgraphics3); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftempcharset(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTempcharset); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void getridoftempsp(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.es = context.data.word(kTempsprites); deallocatemem(context); - {assert(stack_depth == context.stack.size()); return; } + return; } void readsetdata(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.dx = 1857; standardload(context); context.data.word(kCharset1) = context.ax; @@ -21335,11 +21335,11 @@ void readsetdata(Context & context) { readfromfile(context); closefile(context); novolumeload: - {assert(stack_depth == context.stack.size()); return; } + return; } void makename(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); context.si = context.dx; context.di = 6061; transfer: @@ -21350,11 +21350,11 @@ transfer: context._cmp(context.al, 0); if (!context.flags.z()) goto transfer; context.dx = 6059; - {assert(stack_depth == context.stack.size()); return; } + return; } void dreamweb(Context & context) { - uint stack_depth = context.stack.size(); + STACK_CHECK(context); seecommandtail(context); checkbasemem(context); soundstartup(context); diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index e9caf37368..1fb232c187 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -505,6 +505,21 @@ inline void SegmentRef::reset(uint16 value) { *this = _context->getSegment(value); } +class StackChecker { + const Context &_context; + const uint _stackDepth; + +public: + StackChecker(const Context &context): _context(context), _stackDepth(context.stack.size()) {} + ~StackChecker() { assert(_context.stack.size() == _stackDepth); } +}; + +#ifndef NDEBUG +# define STACK_CHECK(context) StackChecker checker(context) +#else +# define STACK_CHECK(context) do {} while (0) +#endif + } #endif -- cgit v1.2.3 From d609d980757dbfd7c322f564af03388f3157ddf9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 22:08:13 +0400 Subject: DREAMWEB: removed width160 for now --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 235 -------------------------------------- engines/dreamweb/dreamgen.h | 1 + 3 files changed, 2 insertions(+), 235 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 4c27cb5939..4284d56de1 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -19,5 +19,6 @@ generator = cpp(context, "dreamgen", blacklist = [ 'cls', 'printundermon', 'worktoscreen', + 'width160' ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c71a37c5b9..9c1e2e7954 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4420,240 +4420,6 @@ deloneloop: return; } -void width160(Context & context) { - STACK_CHECK(context); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width128: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width110: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width88: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width80: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - width63: - context._movsw(); - width62: - context._movsw(); - width61: - context._movsw(); - width60: - context._movsw(); - width59: - context._movsw(); - width58: - context._movsw(); - width57: - context._movsw(); - width56: - context._movsw(); - width55: - context._movsw(); - width54: - context._movsw(); - width53: - context._movsw(); - width52: - context._movsw(); - width51: - context._movsw(); - width50: - context._movsw(); - width49: - context._movsw(); - width48: - context._movsw(); - width47: - context._movsw(); - width46: - context._movsw(); - width45: - context._movsw(); - width44: - context._movsw(); - width43: - context._movsw(); - width42: - context._movsw(); - width41: - context._movsw(); - width40: - context._movsw(); - width39: - context._movsw(); - width38: - context._movsw(); - width37: - context._movsw(); - width36: - context._movsw(); - width35: - context._movsw(); - width34: - context._movsw(); - width33: - context._movsw(); - width32: - context._movsw(); - width31: - context._movsw(); - width30: - context._movsw(); - width29: - context._movsw(); - width28: - context._movsw(); - width27: - context._movsw(); - width26: - context._movsw(); - width25: - context._movsw(); - width24: - context._movsw(); - width23: - context._movsw(); - width22: - context._movsw(); - width21: - context._movsw(); - width20: - context._movsw(); - width19: - context._movsw(); - width18: - context._movsw(); - width17: - context._movsw(); - width16: - context._movsw(); - width15: - context._movsw(); - width14: - context._movsw(); - width13: - context._movsw(); - width12: - context._movsw(); - width11: - context._movsw(); - width10: - context._movsw(); - width9: - context._movsw(); - width8: - context._movsw(); - width7: - context._movsw(); - width6: - context._movsw(); - width5: - context._movsw(); - width4: - context._movsw(); - width3: - context._movsw(); - width2: - context._movsw(); - width1: - context._movsw(); - width0: - return; -} - void doblocks(Context & context) { STACK_CHECK(context); context.es = context.data.word(kWorkspace); @@ -22172,7 +21938,6 @@ void __dispatch_call(Context &context, unsigned addr) { case 0xc20c: doshake(context); break; case 0xc210: zoom(context); break; case 0xc214: delthisone(context); break; - case 0xc224: width160(context); break; case 0xc228: doblocks(context); break; case 0xc22c: showframe(context); break; case 0xc230: frameoutv(context); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index a09fb7b08c..38c04a3c92 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -19,6 +19,7 @@ namespace dreamgen { void cls(Context &context); void printundermon(Context &context); void worktoscreen(Context &context); + void width160(Context &context); void keyboardread(Context &context); void resetkeyboard(Context &context); void setkeyboardint(Context &context); -- cgit v1.2.3 From eb80d05b64d5d3bff942416a726a165301ce5959 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 22:09:31 +0400 Subject: DREAMWEB: fixed code formatting --- devtools/tasmrecover/tasm/cpp.py | 2 +- engines/dreamweb/dreamgen.cpp | 1376 +++++++++++++++++++------------------- 2 files changed, 689 insertions(+), 689 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 12b14fb6bc..fe9e39c092 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -443,7 +443,7 @@ namespace %s { self.proc_addr.append((name, self.proc.offset)) self.body = str() - self.body += "void %s(Context & context) {\n\tSTACK_CHECK(context);\n" %name; + self.body += "void %s(Context &context) {\n\tSTACK_CHECK(context);\n" %name; self.proc.optimize() self.unbounded = [] self.proc.visit(self, skip) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9c1e2e7954..e578fe4d3f 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -475,7 +475,7 @@ void intro2text(Context &context); void intro3text(Context &context); void intro1text(Context &context); -void alleybarksound(Context & context) { +void alleybarksound(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._dec(context.ax); @@ -493,12 +493,12 @@ nobark: return; } -void intromusic(Context & context) { +void intromusic(Context &context) { STACK_CHECK(context); return; } -void foghornsound(Context & context) { +void foghornsound(Context &context) { STACK_CHECK(context); randomnumber(context); context._cmp(context.al, 198); @@ -509,7 +509,7 @@ nofog: return; } -void receptionist(Context & context) { +void receptionist(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotrecep; @@ -552,7 +552,7 @@ nottalkedrecep: return; } -void smokebloke(Context & context) { +void smokebloke(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notspokento; @@ -588,7 +588,7 @@ gotsmokeb: return; } -void attendant(Context & context) { +void attendant(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); @@ -600,7 +600,7 @@ nottalked: return; } -void manasleep(Context & context) { +void manasleep(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); @@ -610,7 +610,7 @@ void manasleep(Context & context) { return; } -void eden(Context & context) { +void eden(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto notinbed; @@ -620,7 +620,7 @@ notinbed: return; } -void edeninbath(Context & context) { +void edeninbath(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (context.flags.z()) goto notinbed; @@ -636,21 +636,21 @@ notinbed: return; } -void malefan(Context & context) { +void malefan(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void femalefan(Context & context) { +void femalefan(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void louis(Context & context) { +void louis(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) goto notlouis1; @@ -660,7 +660,7 @@ notlouis1: return; } -void louischair(Context & context) { +void louischair(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) goto notlouis2; @@ -689,7 +689,7 @@ notlouis2: return; } -void manasleep2(Context & context) { +void manasleep2(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); @@ -699,21 +699,21 @@ void manasleep2(Context & context) { return; } -void mansatstill(Context & context) { +void mansatstill(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void tattooman(Context & context) { +void tattooman(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void drinker(Context & context) { +void drinker(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotdrinker; @@ -735,7 +735,7 @@ gotdrinker: return; } -void bartender(Context & context) { +void bartender(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gotsmoket; @@ -763,21 +763,21 @@ notgotgun: return; } -void othersmoker(Context & context) { +void othersmoker(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void barwoman(Context & context) { +void barwoman(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void interviewer(Context & context) { +void interviewer(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), 68); if (!context.flags.z()) goto notgeneralstart; @@ -795,7 +795,7 @@ talking: return; } -void soldier1(Context & context) { +void soldier1(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 0); if (context.flags.z()) goto soldierwait; @@ -829,7 +829,7 @@ gotsoldframe: return; } -void rockstar(Context & context) { +void rockstar(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 303); @@ -881,7 +881,7 @@ rockcombatend: return; } -void helicopter(Context & context) { +void helicopter(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 203); @@ -939,7 +939,7 @@ heliwon: return; } -void mugger(Context & context) { +void mugger(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 138); @@ -1013,14 +1013,14 @@ endmugger2: return; } -void aide(Context & context) { +void aide(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); return; } -void businessman(Context & context) { +void businessman(Context &context) { STACK_CHECK(context); context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; @@ -1110,7 +1110,7 @@ buscombatwonend: return; } -void poolguard(Context & context) { +void poolguard(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 214); @@ -1195,7 +1195,7 @@ doneover2: return; } -void security(Context & context) { +void security(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 32); if (context.flags.z()) goto securwait; @@ -1224,7 +1224,7 @@ gotsecurframe: return; } -void heavy(Context & context) { +void heavy(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 127); @@ -1260,7 +1260,7 @@ gotheavyframe: return; } -void bossman(Context & context) { +void bossman(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notboss; @@ -1304,7 +1304,7 @@ nottalkedboss: return; } -void gamer(Context & context) { +void gamer(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gamerfin; @@ -1324,7 +1324,7 @@ gamerfin: return; } -void sparkydrip(Context & context) { +void sparkydrip(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto cantdrip; @@ -1335,7 +1335,7 @@ cantdrip: return; } -void carparkdrip(Context & context) { +void carparkdrip(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto cantdrip2; @@ -1345,7 +1345,7 @@ cantdrip2: return; } -void keeper(Context & context) { +void keeper(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kKeeperflag), 0); if (!context.flags.z()) goto notwaiting; @@ -1367,7 +1367,7 @@ waiting: return; } -void candles1(Context & context) { +void candles1(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candle1; @@ -1383,7 +1383,7 @@ candle1: return; } -void smallcandle(Context & context) { +void smallcandle(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto smallcandlef; @@ -1399,7 +1399,7 @@ smallcandlef: return; } -void intromagic1(Context & context) { +void intromagic1(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm1fin; @@ -1427,7 +1427,7 @@ introm1fin: return; } -void candles(Context & context) { +void candles(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candlesfin; @@ -1443,7 +1443,7 @@ candlesfin: return; } -void candles2(Context & context) { +void candles2(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto candles2fin; @@ -1459,7 +1459,7 @@ candles2fin: return; } -void gates(Context & context) { +void gates(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto gatesfin; @@ -1496,7 +1496,7 @@ gatesfin: return; } -void intromagic2(Context & context) { +void intromagic2(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm2fin; @@ -1512,7 +1512,7 @@ introm2fin: return; } -void intromagic3(Context & context) { +void intromagic3(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto introm3fin; @@ -1530,7 +1530,7 @@ introm3fin: return; } -void intromonks1(Context & context) { +void intromonks1(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto intromonk1fin; @@ -1575,7 +1575,7 @@ intromonk1fin: return; } -void intromonks2(Context & context) { +void intromonks2(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto intromonk2fin; @@ -1628,12 +1628,12 @@ intromonk2fin: return; } -void handclap(Context & context) { +void handclap(Context &context) { STACK_CHECK(context); return; } -void monks2text(Context & context) { +void monks2text(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonk2text1; @@ -1737,7 +1737,7 @@ gotmonks2text: return; } -void intro1text(Context & context) { +void intro1text(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 2); if (!context.flags.z()) goto notintro1text1; @@ -1776,7 +1776,7 @@ oktalk2: return; } -void intro2text(Context & context) { +void intro2text(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 5); if (!context.flags.z()) goto notintro2text1; @@ -1802,7 +1802,7 @@ gotintro2text: return; } -void intro3text(Context & context) { +void intro3text(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 107); if (!context.flags.z()) goto notintro3text1; @@ -1828,7 +1828,7 @@ gotintro3text: return; } -void monkandryan(Context & context) { +void monkandryan(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notmonkryan; @@ -1854,7 +1854,7 @@ notmonkryan: return; } -void endgameseq(Context & context) { +void endgameseq(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto notendseq; @@ -1912,7 +1912,7 @@ notendcreds: return; } -void rollendcredits(Context & context) { +void rollendcredits(Context &context) { STACK_CHECK(context); context.al = 16; context.ah = 255; @@ -2001,7 +2001,7 @@ gotnext: return; } -void priest(Context & context) { +void priest(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) goto priestspoken; @@ -2021,7 +2021,7 @@ priestspoken: return; } -void madmanstelly(Context & context) { +void madmanstelly(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._inc(context.ax); @@ -2034,7 +2034,7 @@ notendtelly: return; } -void madman(Context & context) { +void madman(Context &context) { STACK_CHECK(context); context.data.word(kWatchingtime) = 2; checkspeed(context); @@ -2105,7 +2105,7 @@ ryansded: return; } -void madmantext(Context & context) { +void madmantext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSpeechcount), 63); if (!context.flags.c()) goto nomadtext; @@ -2124,7 +2124,7 @@ nomadtext: return; } -void madmode(Context & context) { +void madmode(Context &context) { STACK_CHECK(context); context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; @@ -2137,7 +2137,7 @@ iswatchmad: return; } -void priesttext(Context & context) { +void priesttext(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 2); if (context.flags.c()) goto nopriesttext; @@ -2158,7 +2158,7 @@ nopriesttext: return; } -void textforend(Context & context) { +void textforend(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 20); if (!context.flags.z()) goto notendtext1; @@ -2192,7 +2192,7 @@ gotendtext: return; } -void textformonk(Context & context) { +void textformonk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); if (!context.flags.z()) goto notmonktext1; @@ -2317,7 +2317,7 @@ oktalk: return; } -void drunk(Context & context) { +void drunk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) goto trampgone; @@ -2330,7 +2330,7 @@ trampgone: return; } -void advisor(Context & context) { +void advisor(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto noadvisor; @@ -2359,7 +2359,7 @@ noadvisor: return; } -void copper(Context & context) { +void copper(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) goto nocopper; @@ -2390,7 +2390,7 @@ nocopper: return; } -void sparky(Context & context) { +void sparky(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kCard1money), 0); if (context.flags.z()) goto animsparky; @@ -2424,7 +2424,7 @@ nottalkedsparky: return; } -void train(Context & context) { +void train(Context &context) { STACK_CHECK(context); return; context.ax = context.es.word(context.bx+3); @@ -2448,7 +2448,7 @@ notrainatall: return; } -void addtopeoplelist(Context & context) { +void addtopeoplelist(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -2467,7 +2467,7 @@ void addtopeoplelist(Context & context) { return; } -void showgamereel(Context & context) { +void showgamereel(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); @@ -2484,7 +2484,7 @@ noshow: return; } -void checkspeed(Context & context) { +void checkspeed(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLastweapon), -1); if (!context.flags.z()) goto forcenext; @@ -2502,7 +2502,7 @@ forcenext: return; } -void clearsprites(Context & context) { +void clearsprites(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); @@ -2512,7 +2512,7 @@ void clearsprites(Context & context) { return; } -void makesprite(Context & context) { +void makesprite(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); @@ -2532,7 +2532,7 @@ _tmp17a: return; } -void delsprite(Context & context) { +void delsprite(Context &context) { STACK_CHECK(context); context.di = context.bx; context.cx = (32); @@ -2541,7 +2541,7 @@ void delsprite(Context & context) { return; } -void spriteupdate(Context & context) { +void spriteupdate(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); @@ -2574,7 +2574,7 @@ _tmp18b: return; } -void printsprites(Context & context) { +void printsprites(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = 0; @@ -2607,7 +2607,7 @@ skipsprite: return; } -void printasprite(Context & context) { +void printasprite(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -2644,7 +2644,7 @@ notquickp: return; } -void checkone(Context & context) { +void checkone(Context &context) { STACK_CHECK(context); context.push(context.cx); context.al = context.ch; @@ -2680,7 +2680,7 @@ void checkone(Context & context) { return; } -void findsource(Context & context) { +void findsource(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kCurrentframe); context._cmp(context.ax, 160); @@ -2700,7 +2700,7 @@ over1001: return; } -void initman(Context & context) { +void initman(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); @@ -2715,7 +2715,7 @@ void initman(Context & context) { return; } -void mainman(Context & context) { +void mainman(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kResetmanxy), 1); if (!context.flags.z()) goto notinnewroom; @@ -2799,7 +2799,7 @@ notwalk: return; } -void aboutturn(Context & context) { +void aboutturn(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kTurndirection), 1); if (context.flags.z()) goto incdir; @@ -2834,7 +2834,7 @@ decdir: return; } -void walking(Context & context) { +void walking(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinedirection), 0); if (context.flags.z()) goto normalwalk; @@ -2884,7 +2884,7 @@ finishedwalk: return; } -void facerightway(Context & context) { +void facerightway(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -2903,7 +2903,7 @@ void facerightway(Context & context) { return; } -void checkforexit(Context & context) { +void checkforexit(Context &context) { STACK_CHECK(context); context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); @@ -2996,7 +2996,7 @@ notanup: return; } -void adjustdown(Context & context) { +void adjustdown(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -3011,7 +3011,7 @@ void adjustdown(Context & context) { return; } -void adjustup(Context & context) { +void adjustup(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -3026,7 +3026,7 @@ void adjustup(Context & context) { return; } -void adjustleft(Context & context) { +void adjustleft(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -3042,7 +3042,7 @@ void adjustleft(Context & context) { return; } -void adjustright(Context & context) { +void adjustright(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -3058,7 +3058,7 @@ void adjustright(Context & context) { return; } -void reminders(Context & context) { +void reminders(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) goto notinedenslift; @@ -3107,7 +3107,7 @@ notinedenslift: return; } -void initrain(Context & context) { +void initrain(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)); @@ -3167,7 +3167,7 @@ finishinitrain: return; } -void splitintolines(Context & context) { +void splitintolines(Context &context) { STACK_CHECK(context); lookforlinestart: getblockofpixel(context); @@ -3217,7 +3217,7 @@ endofthisline: return; } -void getblockofpixel(Context & context) { +void getblockofpixel(Context &context) { STACK_CHECK(context); context.push(context.cx); context.push(context.es); @@ -3241,7 +3241,7 @@ failrain: return; } -void showrain(Context & context) { +void showrain(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kMainsprites); context.si = 6*58; @@ -3319,7 +3319,7 @@ nothunder: return; } -void backobject(Context & context) { +void backobject(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kSetdat); context.di = context.es.word(context.bx+20); @@ -3368,7 +3368,7 @@ finishback: return; } -void liftsprite(Context & context) { +void liftsprite(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLiftflag); context._cmp(context.al, 0); @@ -3449,7 +3449,7 @@ nocountopen: goto pokelift; } -void liftnoise(Context & context) { +void liftnoise(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 5); if (context.flags.z()) goto hissnoise; @@ -3463,7 +3463,7 @@ hissnoise: return; } -void random(Context & context) { +void random(Context &context) { STACK_CHECK(context); randomnum1(context); context.push(context.di); @@ -3476,7 +3476,7 @@ void random(Context & context) { return; } -void steady(Context & context) { +void steady(Context &context) { STACK_CHECK(context); context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; @@ -3484,7 +3484,7 @@ void steady(Context & context) { return; } -void constant(Context & context) { +void constant(Context &context) { STACK_CHECK(context); context._inc(context.es.byte(context.bx+19)); context.cl = context.es.byte(context.bx+19); @@ -3503,7 +3503,7 @@ gotconst: return; } -void doorway(Context & context) { +void doorway(Context &context) { STACK_CHECK(context); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 10; @@ -3513,7 +3513,7 @@ void doorway(Context & context) { return; } -void widedoor(Context & context) { +void widedoor(Context &context) { STACK_CHECK(context); context.data.byte(kDoorcheck1) = -24; context.data.byte(kDoorcheck2) = 24; @@ -3523,7 +3523,7 @@ void widedoor(Context & context) { return; } -void dodoor(Context & context) { +void dodoor(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); @@ -3614,7 +3614,7 @@ notnearly: return; } -void lockeddoorway(Context & context) { +void lockeddoorway(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); @@ -3752,7 +3752,7 @@ notnearly: return; } -void updatepeople(Context & context) { +void updatepeople(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); @@ -3787,7 +3787,7 @@ endupdate: return; } -void getreelframeax(Context & context) { +void getreelframeax(Context &context) { STACK_CHECK(context); context.push(context.ds); context.data.word(kCurrentframe) = context.ax; @@ -3804,7 +3804,7 @@ void getreelframeax(Context & context) { return; } -void reelsonscreen(Context & context) { +void reelsonscreen(Context &context) { STACK_CHECK(context); reconstruct(context); updatepeople(context); @@ -3814,7 +3814,7 @@ void reelsonscreen(Context & context) { return; } -void plotreel(Context & context) { +void plotreel(Context &context) { STACK_CHECK(context); getreelstart(context); retryreel: @@ -3853,7 +3853,7 @@ notplot: return; } -void soundonreels(Context & context) { +void soundonreels(Context &context) { STACK_CHECK(context); context.bl = context.data.byte(kReallocation); context._add(context.bl, context.bl); @@ -3894,7 +3894,7 @@ nochange2: return; } -void reconstruct(Context & context) { +void reconstruct(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kHavedoneobs), 0); if (context.flags.z()) goto noneedtorecon; @@ -3907,7 +3907,7 @@ noneedtorecon: return; } -void dealwithspecial(Context & context) { +void dealwithspecial(Context &context) { STACK_CHECK(context); context._sub(context.al, 220); context._cmp(context.al, 0); @@ -3959,7 +3959,7 @@ notchangeloc: return; } -void movemap(Context & context) { +void movemap(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 32); if (!context.flags.z()) goto notmapup2; @@ -3990,7 +3990,7 @@ notmaprightspec: return; } -void getreelstart(Context & context) { +void getreelstart(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kReelpointer); context.cx = 40; @@ -4001,7 +4001,7 @@ void getreelstart(Context & context) { return; } -void showreelframe(Context & context) { +void showreelframe(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.si+2); context.ah = 0; @@ -4020,7 +4020,7 @@ void showreelframe(Context & context) { return; } -void deleverything(Context & context) { +void deleverything(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kMapysize); context.ah = 0; @@ -4036,7 +4036,7 @@ bigroom: return; } -void dumpeverything(Context & context) { +void dumpeverything(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); @@ -4092,7 +4092,7 @@ finishevery2: return; } -void allocatework(Context & context) { +void allocatework(Context &context) { STACK_CHECK(context); context.bx = 0x1000; allocatemem(context); @@ -4100,7 +4100,7 @@ void allocatework(Context & context) { return; } -void readabyte(Context & context) { +void readabyte(Context &context) { STACK_CHECK(context); context._cmp(context.si, 30000); if (!context.flags.z()) goto notendblock; @@ -4121,7 +4121,7 @@ notendblock: return; } -void loadpalfromiff(Context & context) { +void loadpalfromiff(Context &context) { STACK_CHECK(context); context.dx = 2481; openfile(context); @@ -4157,7 +4157,7 @@ nought: return; } -void paneltomap(Context & context) { +void paneltomap(Context &context) { STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); @@ -4171,7 +4171,7 @@ void paneltomap(Context & context) { return; } -void maptopanel(Context & context) { +void maptopanel(Context &context) { STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); @@ -4185,7 +4185,7 @@ void maptopanel(Context & context) { return; } -void dumpmap(Context & context) { +void dumpmap(Context &context) { STACK_CHECK(context); context.di = context.data.word(kMapxstart); context._add(context.di, context.data.word(kMapadx)); @@ -4197,7 +4197,7 @@ void dumpmap(Context & context) { return; } -void pixelcheckset(Context & context) { +void pixelcheckset(Context &context) { STACK_CHECK(context); context.push(context.ax); context._sub(context.al, context.es.byte(context.bx)); @@ -4238,7 +4238,7 @@ void pixelcheckset(Context & context) { return; } -void createpanel(Context & context) { +void createpanel(Context &context) { STACK_CHECK(context); context.di = 0; context.bx = 8; @@ -4267,7 +4267,7 @@ void createpanel(Context & context) { return; } -void createpanel2(Context & context) { +void createpanel2(Context &context) { STACK_CHECK(context); createpanel(context); context.di = 0; @@ -4285,7 +4285,7 @@ void createpanel2(Context & context) { return; } -void clearwork(Context & context) { +void clearwork(Context &context) { STACK_CHECK(context); context.ax = 0x0; context.es = context.data.word(kWorkspace); @@ -4328,7 +4328,7 @@ clearloop: return; } -void zoom(Context & context) { +void zoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) goto inwatching; @@ -4376,7 +4376,7 @@ zoomloop2: return; } -void delthisone(Context & context) { +void delthisone(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -4420,7 +4420,7 @@ deloneloop: return; } -void doblocks(Context & context) { +void doblocks(Context &context) { STACK_CHECK(context); context.es = context.data.word(kWorkspace); context.ax = context.data.word(kMapady); @@ -4536,7 +4536,7 @@ zeroblock: return; } -void showframe(Context & context) { +void showframe(Context &context) { STACK_CHECK(context); context.push(context.dx); context.push(context.ax); @@ -4636,7 +4636,7 @@ noeffects: return; } -void frameoutv(Context & context) { +void frameoutv(Context &context) { STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; @@ -4677,7 +4677,7 @@ backtosolid: return; } -void frameoutbh(Context & context) { +void frameoutbh(Context &context) { STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; @@ -4711,7 +4711,7 @@ nextline: return; } -void frameoutfx(Context & context) { +void frameoutfx(Context &context) { STACK_CHECK(context); context.push(context.dx); context.ax = context.bx; @@ -4753,7 +4753,7 @@ backtosolidfx: return; } -void transferinv(Context & context) { +void transferinv(Context &context) { STACK_CHECK(context); context.di = context.data.word(kExframepos); context.push(context.di); @@ -4803,7 +4803,7 @@ void transferinv(Context & context) { return; } -void transfermap(Context & context) { +void transfermap(Context &context) { STACK_CHECK(context); context.di = context.data.word(kExframepos); context.push(context.di); @@ -4851,7 +4851,7 @@ void transfermap(Context & context) { return; } -void dofade(Context & context) { +void dofade(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFadedirection), 0); if (context.flags.z()) goto finishfade; @@ -4875,7 +4875,7 @@ finishfade: return; } -void clearendpal(Context & context) { +void clearendpal(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); @@ -4885,7 +4885,7 @@ void clearendpal(Context & context) { return; } -void clearpalette(Context & context) { +void clearpalette(Context &context) { STACK_CHECK(context); context.data.byte(kFadedirection) = 0; clearstartpal(context); @@ -4893,7 +4893,7 @@ void clearpalette(Context & context) { return; } -void fadescreenup(Context & context) { +void fadescreenup(Context &context) { STACK_CHECK(context); clearstartpal(context); paltoendpal(context); @@ -4904,7 +4904,7 @@ void fadescreenup(Context & context) { return; } -void fadetowhite(Context & context) { +void fadetowhite(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); @@ -4924,7 +4924,7 @@ void fadetowhite(Context & context) { return; } -void fadefromwhite(Context & context) { +void fadefromwhite(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); @@ -4944,7 +4944,7 @@ void fadefromwhite(Context & context) { return; } -void fadescreenups(Context & context) { +void fadescreenups(Context &context) { STACK_CHECK(context); clearstartpal(context); paltoendpal(context); @@ -4955,7 +4955,7 @@ void fadescreenups(Context & context) { return; } -void fadescreendownhalf(Context & context) { +void fadescreendownhalf(Context &context) { STACK_CHECK(context); paltostartpal(context); paltoendpal(context); @@ -4985,7 +4985,7 @@ halfend: return; } -void fadescreenuphalf(Context & context) { +void fadescreenuphalf(Context &context) { STACK_CHECK(context); endpaltostart(context); paltoendpal(context); @@ -4996,7 +4996,7 @@ void fadescreenuphalf(Context & context) { return; } -void fadescreendown(Context & context) { +void fadescreendown(Context &context) { STACK_CHECK(context); paltostartpal(context); clearendpal(context); @@ -5007,7 +5007,7 @@ void fadescreendown(Context & context) { return; } -void fadescreendowns(Context & context) { +void fadescreendowns(Context &context) { STACK_CHECK(context); paltostartpal(context); clearendpal(context); @@ -5018,7 +5018,7 @@ void fadescreendowns(Context & context) { return; } -void clearstartpal(Context & context) { +void clearstartpal(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); @@ -5032,7 +5032,7 @@ wholeloop1: return; } -void showgun(Context & context) { +void showgun(Context &context) { STACK_CHECK(context); context.data.byte(kAddtored) = 0; context.data.byte(kAddtogreen) = 0; @@ -5087,13 +5087,13 @@ void showgun(Context & context) { return; } -void rollendcredits2(Context & context) { +void rollendcredits2(Context &context) { STACK_CHECK(context); rollem(context); return; } -void rollem(Context & context) { +void rollem(Context &context) { STACK_CHECK(context); context.cl = 160; context.ch = 160; @@ -5182,7 +5182,7 @@ endearly: return; } -void fadecalculation(Context & context) { +void fadecalculation(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFadecount), 0); if (context.flags.z()) goto nomorefading; @@ -5216,7 +5216,7 @@ nomorefading: return; } -void greyscalesum(Context & context) { +void greyscalesum(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); @@ -5272,7 +5272,7 @@ noaddb: return; } -void paltostartpal(Context & context) { +void paltostartpal(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); @@ -5283,7 +5283,7 @@ void paltostartpal(Context & context) { return; } -void endpaltostart(Context & context) { +void endpaltostart(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); @@ -5294,7 +5294,7 @@ void endpaltostart(Context & context) { return; } -void startpaltoend(Context & context) { +void startpaltoend(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); @@ -5305,7 +5305,7 @@ void startpaltoend(Context & context) { return; } -void paltoendpal(Context & context) { +void paltoendpal(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); @@ -5316,7 +5316,7 @@ void paltoendpal(Context & context) { return; } -void allpalette(Context & context) { +void allpalette(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.ds = context.data.word(kBuffers); @@ -5328,7 +5328,7 @@ void allpalette(Context & context) { return; } -void dumpcurrent(Context & context) { +void dumpcurrent(Context &context) { STACK_CHECK(context); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.ds = context.data.word(kBuffers); @@ -5343,7 +5343,7 @@ void dumpcurrent(Context & context) { return; } -void fadedownmon(Context & context) { +void fadedownmon(Context &context) { STACK_CHECK(context); paltostartpal(context); paltoendpal(context); @@ -5364,7 +5364,7 @@ void fadedownmon(Context & context) { return; } -void fadeupmon(Context & context) { +void fadeupmon(Context &context) { STACK_CHECK(context); paltostartpal(context); paltoendpal(context); @@ -5385,7 +5385,7 @@ void fadeupmon(Context & context) { return; } -void fadeupmonfirst(Context & context) { +void fadeupmonfirst(Context &context) { STACK_CHECK(context); paltostartpal(context); paltoendpal(context); @@ -5410,7 +5410,7 @@ void fadeupmonfirst(Context & context) { return; } -void fadeupyellows(Context & context) { +void fadeupyellows(Context &context) { STACK_CHECK(context); paltoendpal(context); context.es = context.data.word(kBuffers); @@ -5430,7 +5430,7 @@ void fadeupyellows(Context & context) { return; } -void initialmoncols(Context & context) { +void initialmoncols(Context &context) { STACK_CHECK(context); paltostartpal(context); context.es = context.data.word(kBuffers); @@ -5449,7 +5449,7 @@ void initialmoncols(Context & context) { return; } -void titles(Context & context) { +void titles(Context &context) { STACK_CHECK(context); clearpalette(context); biblequote(context); @@ -5457,7 +5457,7 @@ void titles(Context & context) { return; } -void endgame(Context & context) { +void endgame(Context &context) { STACK_CHECK(context); context.dx = 2260; loadtemptext(context); @@ -5471,7 +5471,7 @@ void endgame(Context & context) { return; } -void monkspeaking(Context & context) { +void monkspeaking(Context &context) { STACK_CHECK(context); context.data.byte(kRoomssample) = 35; loadroomssample(context); @@ -5516,7 +5516,7 @@ notloadspeech2: return; } -void showmonk(Context & context) { +void showmonk(Context &context) { STACK_CHECK(context); context.al = 0; context.ah = 128; @@ -5527,7 +5527,7 @@ void showmonk(Context & context) { return; } -void gettingshot(Context & context) { +void gettingshot(Context &context) { STACK_CHECK(context); context.data.byte(kNewlocation) = 55; clearpalette(context); @@ -5540,14 +5540,14 @@ void gettingshot(Context & context) { return; } -void credits(Context & context) { +void credits(Context &context) { STACK_CHECK(context); clearpalette(context); realcredits(context); return; } -void biblequote(Context & context) { +void biblequote(Context &context) { STACK_CHECK(context); mode640x480(context); context.dx = 2377; @@ -5572,7 +5572,7 @@ biblequotearly: return; } -void hangone(Context & context) { +void hangone(Context &context) { STACK_CHECK(context); hangonloope: context.push(context.cx); @@ -5585,7 +5585,7 @@ hangonearly: return; } -void intro(Context & context) { +void intro(Context &context) { STACK_CHECK(context); context.dx = 2247; loadtemptext(context); @@ -5630,7 +5630,7 @@ introearly: return; } -void runintroseq(Context & context) { +void runintroseq(Context &context) { STACK_CHECK(context); context.data.byte(kGetback) = 0; moreintroseq: @@ -5663,7 +5663,7 @@ earlyendrun: return; } -void runendseq(Context & context) { +void runendseq(Context &context) { STACK_CHECK(context); atmospheres(context); context.data.byte(kGetback) = 0; @@ -5685,7 +5685,7 @@ moreendseq: return; } -void loadintroroom(Context & context) { +void loadintroroom(Context &context) { STACK_CHECK(context); context.data.byte(kIntrocount) = 0; context.data.byte(kLocation) = 255; @@ -5706,7 +5706,7 @@ void loadintroroom(Context & context) { return; } -void realcredits(Context & context) { +void realcredits(Context &context) { STACK_CHECK(context); context.data.byte(kRoomssample) = 33; loadroomssample(context); @@ -5831,7 +5831,7 @@ realcreditsearly: return; } -void printchar(Context & context) { +void printchar(Context &context) { STACK_CHECK(context); context._cmp(context.al, 255); if (context.flags.z()) goto ignoreit; @@ -5859,7 +5859,7 @@ ignoreit: return; } -void kernchars(Context & context) { +void kernchars(Context &context) { STACK_CHECK(context); context._cmp(context.al, 'a'); if (context.flags.z()) goto iskern; @@ -5883,7 +5883,7 @@ kernit: return; } -void printslow(Context & context) { +void printslow(Context &context) { STACK_CHECK(context); context.data.byte(kPointerframe) = 1; context.data.byte(kPointermode) = 3; @@ -5976,7 +5976,7 @@ finishslow2: return; } -void waitframes(Context & context) { +void waitframes(Context &context) { STACK_CHECK(context); context.push(context.di); context.push(context.bx); @@ -5997,7 +5997,7 @@ void waitframes(Context & context) { return; } -void printboth(Context & context) { +void printboth(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.cx); @@ -6015,7 +6015,7 @@ void printboth(Context & context) { return; } -void printdirect(Context & context) { +void printdirect(Context &context) { STACK_CHECK(context); context.data.word(kLastxpos) = context.di; context.ds = context.data.word(kCurrentset); @@ -6051,7 +6051,7 @@ finishdirct: return; } -void monprint(Context & context) { +void monprint(Context &context) { STACK_CHECK(context); context.data.byte(kKerning) = 1; context.si = context.bx; @@ -6130,7 +6130,7 @@ nottrigger2: return; } -void getnumber(Context & context) { +void getnumber(Context &context) { STACK_CHECK(context); context.cx = 0; context.push(context.si); @@ -6234,7 +6234,7 @@ notcent2: return; } -void getnextword(Context & context) { +void getnextword(Context &context) { STACK_CHECK(context); context.bx = 0; getloop: @@ -6272,7 +6272,7 @@ endall: return; } -void fillryan(Context & context) { +void fillryan(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32); @@ -6316,7 +6316,7 @@ ryanloop1: return; } -void fillopen(Context & context) { +void fillopen(Context &context) { STACK_CHECK(context); deltextline(context); getopenedsize(context); @@ -6358,7 +6358,7 @@ nextopenslot: return; } -void findallryan(Context & context) { +void findallryan(Context &context) { STACK_CHECK(context); context.push(context.di); context.cx = 30; @@ -6391,7 +6391,7 @@ notinryaninv: return; } -void findallopen(Context & context) { +void findallopen(Context &context) { STACK_CHECK(context); context.push(context.di); context.cx = 16; @@ -6457,7 +6457,7 @@ findopen2a: return; } -void obtoinv(Context & context) { +void obtoinv(Context &context) { STACK_CHECK(context); context.push(context.bx); context.push(context.es); @@ -6515,7 +6515,7 @@ finishfill: return; } -void isitworn(Context & context) { +void isitworn(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); @@ -6526,14 +6526,14 @@ notworn: return; } -void makeworn(Context & context) { +void makeworn(Context &context) { STACK_CHECK(context); context.es.byte(context.bx+12) = 'W'-'A'; context.es.byte(context.bx+13) = 'E'-'A'; return; } -void examineob(Context & context) { +void examineob(Context &context) { STACK_CHECK(context); context.data.byte(kPointermode) = 0; context.data.word(kTimecount) = 0; @@ -6599,7 +6599,7 @@ justgetback: return; } -void makemainscreen(Context & context) { +void makemainscreen(Context &context) { STACK_CHECK(context); createpanel(context); context.data.byte(kNewobs) = 1; @@ -6618,7 +6618,7 @@ void makemainscreen(Context & context) { return; } -void getbackfromob(Context & context) { +void getbackfromob(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 1); if (!context.flags.z()) goto notheldob; @@ -6629,7 +6629,7 @@ notheldob: return; } -void incryanpage(Context & context) { +void incryanpage(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyincryan; @@ -6661,7 +6661,7 @@ findnewpage: return; } -void openinv(Context & context) { +void openinv(Context &context) { STACK_CHECK(context); context.data.byte(kInvopen) = 1; context.al = 61; @@ -6674,7 +6674,7 @@ void openinv(Context & context) { return; } -void showryanpage(Context & context) { +void showryanpage(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = (80)+167; @@ -6699,7 +6699,7 @@ void showryanpage(Context & context) { return; } -void openob(Context & context) { +void openob(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kOpenedob); context.ah = context.data.byte(kOpenedtype); @@ -6731,7 +6731,7 @@ void openob(Context & context) { return; } -void obicons(Context & context) { +void obicons(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCommand); getanyad(context); @@ -6753,7 +6753,7 @@ cantopenit: return; } -void examicon(Context & context) { +void examicon(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kIcons2); context.di = 254; @@ -6764,7 +6764,7 @@ void examicon(Context & context) { return; } -void obpicture(Context & context) { +void obpicture(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); @@ -6797,7 +6797,7 @@ exframe: return; } -void describeob(Context & context) { +void describeob(Context &context) { STACK_CHECK(context); getobtextstart(context); context.di = 33; @@ -6819,7 +6819,7 @@ void describeob(Context & context) { return; } -void additionaltext(Context & context) { +void additionaltext(Context &context) { STACK_CHECK(context); context._add(context.bx, 10); context.push(context.bx); @@ -6861,7 +6861,7 @@ fullcup: return; } -void obsthatdothings(Context & context) { +void obsthatdothings(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); @@ -6884,7 +6884,7 @@ notlouiscard: return; } -void getobtextstart(Context & context) { +void getobtextstart(Context &context) { STACK_CHECK(context); context.es = context.data.word(kFreedesc); context.si = (0); @@ -6928,7 +6928,7 @@ findsometext: return; } -void searchforsame(Context & context) { +void searchforsame(Context &context) { STACK_CHECK(context); context.si = context.cx; searchagain: @@ -6967,7 +6967,7 @@ foundmatch: return; } -void findnextcolon(Context & context) { +void findnextcolon(Context &context) { STACK_CHECK(context); isntcolon: context.al = context.es.byte(context.si); @@ -6980,7 +6980,7 @@ endofcolon: return; } -void inventory(Context & context) { +void inventory(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 1); if (context.flags.z()) goto iswatchinv; @@ -7091,7 +7091,7 @@ withlist1: return; } -void setpickup(Context & context) { +void setpickup(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 1); if (context.flags.z()) goto cantpick; @@ -7151,7 +7151,7 @@ pickupexob: return; } -void examinventory(Context & context) { +void examinventory(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadyexinv; @@ -7176,7 +7176,7 @@ doexinv: return; } -void reexfrominv(Context & context) { +void reexfrominv(Context &context) { STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); @@ -7187,7 +7187,7 @@ void reexfrominv(Context & context) { return; } -void reexfromopen(Context & context) { +void reexfromopen(Context &context) { STACK_CHECK(context); return; findopenpos(context); @@ -7199,7 +7199,7 @@ void reexfromopen(Context & context) { return; } -void swapwithinv(Context & context) { +void swapwithinv(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -7257,7 +7257,7 @@ doswap1: return; } -void swapwithopen(Context & context) { +void swapwithopen(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); @@ -7352,7 +7352,7 @@ actuallyswap: return; } -void intoinv(Context & context) { +void intoinv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout; @@ -7404,7 +7404,7 @@ doplace: return; } -void deletetaken(Context & context) { +void deletetaken(Context &context) { STACK_CHECK(context); context.es = context.data.word(kFreedat); context.ah = context.data.byte(kReallocation); @@ -7428,7 +7428,7 @@ notinhere: return; } -void outofinv(Context & context) { +void outofinv(Context &context) { STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); @@ -7480,7 +7480,7 @@ dograb: return; } -void getfreead(Context & context) { +void getfreead(Context &context) { STACK_CHECK(context); context.ah = 0; context.cl = 4; @@ -7490,7 +7490,7 @@ void getfreead(Context & context) { return; } -void getexad(Context & context) { +void getexad(Context &context) { STACK_CHECK(context); context.ah = 0; context.bx = 16; @@ -7501,7 +7501,7 @@ void getexad(Context & context) { return; } -void geteitherad(Context & context) { +void geteitherad(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isinexlist; @@ -7514,7 +7514,7 @@ isinexlist: return; } -void getanyad(Context & context) { +void getanyad(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto isex; @@ -7536,7 +7536,7 @@ isex: return; } -void getanyaddir(Context & context) { +void getanyaddir(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 4); if (context.flags.z()) goto isex3; @@ -7552,7 +7552,7 @@ isex3: return; } -void getopenedsize(Context & context) { +void getopenedsize(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedtype), 4); if (context.flags.z()) goto isex2; @@ -7574,7 +7574,7 @@ isex2: return; } -void getsetad(Context & context) { +void getsetad(Context &context) { STACK_CHECK(context); context.ah = 0; context.bx = 64; @@ -7584,7 +7584,7 @@ void getsetad(Context & context) { return; } -void findinvpos(Context & context) { +void findinvpos(Context &context) { STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); @@ -7613,7 +7613,7 @@ findinv2: return; } -void findopenpos(Context & context) { +void findopenpos(Context &context) { STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, (80)); @@ -7630,7 +7630,7 @@ findopenp1: return; } -void dropobject(Context & context) { +void dropobject(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 223); if (context.flags.z()) goto alreadydrop; @@ -7722,7 +7722,7 @@ notinlift: return; } -void droperror(Context & context) { +void droperror(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); @@ -7742,7 +7742,7 @@ void droperror(Context & context) { return; } -void cantdrop(Context & context) { +void cantdrop(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); @@ -7762,7 +7762,7 @@ void cantdrop(Context & context) { return; } -void wornerror(Context & context) { +void wornerror(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); @@ -7782,7 +7782,7 @@ void wornerror(Context & context) { return; } -void removeobfrominv(Context & context) { +void removeobfrominv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommand), 100); if (context.flags.z()) goto obnotexist; @@ -7795,7 +7795,7 @@ obnotexist: return; } -void selectopenob(Context & context) { +void selectopenob(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCommand); getanyad(context); @@ -7839,7 +7839,7 @@ doopenob: return; } -void useopened(Context & context) { +void useopened(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cannotuseopen; @@ -7924,7 +7924,7 @@ sizeok1: return; } -void errormessage1(Context & context) { +void errormessage1(Context &context) { STACK_CHECK(context); delpointer(context); context.di = 76; @@ -7949,7 +7949,7 @@ void errormessage1(Context & context) { return; } -void errormessage2(Context & context) { +void errormessage2(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; delpointer(context); @@ -7975,7 +7975,7 @@ void errormessage2(Context & context) { return; } -void errormessage3(Context & context) { +void errormessage3(Context &context) { STACK_CHECK(context); delpointer(context); context.di = 76; @@ -7997,7 +7997,7 @@ void errormessage3(Context & context) { return; } -void checkobjectsize(Context & context) { +void checkobjectsize(Context &context) { STACK_CHECK(context); getopenedsize(context); context.push(context.ax); @@ -8039,7 +8039,7 @@ sizeok: return; } -void outofopen(Context & context) { +void outofopen(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) goto cantuseopen; @@ -8103,7 +8103,7 @@ actuallyout: return; } -void transfertoex(Context & context) { +void transfertoex(Context &context) { STACK_CHECK(context); emergencypurge(context); getexpos(context); @@ -8145,7 +8145,7 @@ void transfertoex(Context & context) { return; } -void pickupconts(Context & context) { +void pickupconts(Context &context) { STACK_CHECK(context); context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); @@ -8182,7 +8182,7 @@ notopenable: return; } -void transfercontoex(Context & context) { +void transfercontoex(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -8213,7 +8213,7 @@ void transfercontoex(Context & context) { return; } -void transfertext(Context & context) { +void transfertext(Context &context) { STACK_CHECK(context); context.es = context.data.word(kExtras); context.al = context.data.byte(kExpos); @@ -8242,7 +8242,7 @@ moretext: return; } -void getexpos(Context & context) { +void getexpos(Context &context) { STACK_CHECK(context); context.es = context.data.word(kExtras); context.al = 0; @@ -8259,7 +8259,7 @@ foundnewex: return; } -void purgealocation(Context & context) { +void purgealocation(Context &context) { STACK_CHECK(context); context.push(context.ax); context.es = context.data.word(kExtras); @@ -8288,7 +8288,7 @@ dontpurge: return; } -void emergencypurge(Context & context) { +void emergencypurge(Context &context) { STACK_CHECK(context); checkpurgeagain: context.ax = context.data.word(kExframepos); @@ -8308,7 +8308,7 @@ notneartextend: return; } -void purgeanitem(Context & context) { +void purgeanitem(Context &context) { STACK_CHECK(context); context.es = context.data.word(kExtras); context.di = (0+2080+30000); @@ -8351,7 +8351,7 @@ cantpurge2: return; } -void deleteexobject(Context & context) { +void deleteexobject(Context &context) { STACK_CHECK(context); context.push(context.cx); context.push(context.cx); @@ -8396,7 +8396,7 @@ notinsideex: return; } -void deleteexframe(Context & context) { +void deleteexframe(Context &context) { STACK_CHECK(context); context.di = (0); context.ah = 0; @@ -8436,7 +8436,7 @@ beforethisone: return; } -void deleteextext(Context & context) { +void deleteextext(Context &context) { STACK_CHECK(context); context.di = (0+2080+30000+(16*114)); context.ah = 0; @@ -8478,7 +8478,7 @@ beforethistext: return; } -void blockget(Context & context) { +void blockget(Context &context) { STACK_CHECK(context); context.ah = context.al; context.al = 0; @@ -8488,7 +8488,7 @@ void blockget(Context & context) { return; } -void drawfloor(Context & context) { +void drawfloor(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -8507,7 +8507,7 @@ void drawfloor(Context & context) { return; } -void calcmapad(Context & context) { +void calcmapad(Context &context) { STACK_CHECK(context); getdimension(context); context.push(context.cx); @@ -8535,7 +8535,7 @@ void calcmapad(Context & context) { return; } -void getdimension(Context & context) { +void getdimension(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)); @@ -8616,7 +8616,7 @@ finishdim4: return; } -void addalong(Context & context) { +void addalong(Context &context) { STACK_CHECK(context); context.ah = 11; addloop: @@ -8632,7 +8632,7 @@ gotalong: return; } -void addlength(Context & context) { +void addlength(Context &context) { STACK_CHECK(context); context.ah = 10; addloop2: @@ -8648,7 +8648,7 @@ gotlength: return; } -void drawflags(Context & context) { +void drawflags(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+32+60+(32*32)); @@ -8686,7 +8686,7 @@ _tmp28a: return; } -void eraseoldobs(Context & context) { +void eraseoldobs(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto donterase; @@ -8712,7 +8712,7 @@ donterase: return; } -void showallobs(Context & context) { +void showallobs(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); @@ -8795,7 +8795,7 @@ finishedsetobs: return; } -void makebackob(Context & context) { +void makebackob(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) goto nomake; @@ -8829,7 +8829,7 @@ nomake: return; } -void showallfree(Context & context) { +void showallfree(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); @@ -8909,7 +8909,7 @@ finfree: return; } -void showallex(Context & context) { +void showallex(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); @@ -8994,7 +8994,7 @@ finex: return; } -void calcfrframe(Context & context) { +void calcfrframe(Context &context) { STACK_CHECK(context); context.dx = context.data.word(kFrsegment); context.ax = context.data.word(kFramesad); @@ -9030,7 +9030,7 @@ nullframe: return; } -void finalframe(Context & context) { +void finalframe(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kObjecty); context._add(context.ax, context.data.word(kOffsety)); @@ -9043,7 +9043,7 @@ void finalframe(Context & context) { return; } -void adjustlen(Context & context) { +void adjustlen(Context &context) { STACK_CHECK(context); context.ah = context.al; context._add(context.al, context.ch); @@ -9056,7 +9056,7 @@ over242: return; } -void getmapad(Context & context) { +void getmapad(Context &context) { STACK_CHECK(context); getxad(context); context._cmp(context.ch, 0); @@ -9071,7 +9071,7 @@ over146: return; } -void getxad(Context & context) { +void getxad(Context &context) { STACK_CHECK(context); context.cl = context.es.byte(context.si); context._inc(context.si); @@ -9096,7 +9096,7 @@ over148: return; } -void getyad(Context & context) { +void getyad(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.si); context._inc(context.si); @@ -9117,7 +9117,7 @@ over147: return; } -void autolook(Context & context) { +void autolook(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousex); context._cmp(context.ax, context.data.word(kOldx)); @@ -9138,7 +9138,7 @@ diffmouse: return; } -void look(Context & context) { +void look(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; @@ -9160,7 +9160,7 @@ nolook: return; } -void dolook(Context & context) { +void dolook(Context &context) { STACK_CHECK(context); createpanel(context); showicon(context); @@ -9197,7 +9197,7 @@ afterlook: return; } -void redrawmainscrn(Context & context) { +void redrawmainscrn(Context &context) { STACK_CHECK(context); context.data.word(kTimecount) = 0; createpanel(context); @@ -9213,7 +9213,7 @@ void redrawmainscrn(Context & context) { return; } -void getback1(Context & context) { +void getback1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); if (context.flags.z()) goto notgotobject; @@ -9239,7 +9239,7 @@ dogetback: return; } -void talk(Context & context) { +void talk(Context &context) { STACK_CHECK(context); context.data.byte(kTalkpos) = 0; context.data.byte(kInmaparea) = 0; @@ -9289,7 +9289,7 @@ nospeech: return; } -void convicons(Context & context) { +void convicons(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCharacter); context._and(context.al, 127); @@ -9305,7 +9305,7 @@ void convicons(Context & context) { return; } -void getpersframe(Context & context) { +void getpersframe(Context &context) { STACK_CHECK(context); context.ah = 0; context._add(context.ax, context.ax); @@ -9316,7 +9316,7 @@ void getpersframe(Context & context) { return; } -void starttalk(Context & context) { +void starttalk(Context &context) { STACK_CHECK(context); context.data.byte(kTalkmode) = 0; context.al = context.data.byte(kCharacter); @@ -9356,7 +9356,7 @@ nospeech1: return; } -void getpersontext(Context & context) { +void getpersontext(Context &context) { STACK_CHECK(context); context.ah = 0; context.cx = 64*2; @@ -9371,7 +9371,7 @@ void getpersontext(Context & context) { return; } -void moretalk(Context & context) { +void moretalk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kTalkmode), 0); if (context.flags.z()) goto canmore; @@ -9402,7 +9402,7 @@ notsecondpart: return; } -void dosometalk(Context & context) { +void dosometalk(Context &context) { STACK_CHECK(context); dospeech: context.al = context.data.byte(kTalkpos); @@ -9535,7 +9535,7 @@ endheartalk: return; } -void hangonpq(Context & context) { +void hangonpq(Context &context) { STACK_CHECK(context); context.data.byte(kGetback) = 0; context.bx = 0; @@ -9580,7 +9580,7 @@ quitconv: return; } -void redes(Context & context) { +void redes(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) goto cantredes; @@ -9615,7 +9615,7 @@ doredes: return; } -void newplace(Context & context) { +void newplace(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedtotravel), 1); if (context.flags.z()) goto istravel; @@ -9633,7 +9633,7 @@ istravel: return; } -void selectlocation(Context & context) { +void selectlocation(Context &context) { STACK_CHECK(context); context.data.byte(kInmaparea) = 0; clearbeforeload(context); @@ -9693,7 +9693,7 @@ quittravel: return; } -void showcity(Context & context) { +void showcity(Context &context) { STACK_CHECK(context); clearwork(context); context.ds = context.data.word(kTempgraphics); @@ -9711,7 +9711,7 @@ void showcity(Context & context) { return; } -void lookatplace(Context & context) { +void lookatplace(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 224); if (context.flags.z()) goto alreadyinfo; @@ -9767,7 +9767,7 @@ noinfo: return; } -void getundercentre(Context & context) { +void getundercentre(Context &context) { STACK_CHECK(context); context.di = 58; context.bx = 72; @@ -9779,7 +9779,7 @@ void getundercentre(Context & context) { return; } -void putundercentre(Context & context) { +void putundercentre(Context &context) { STACK_CHECK(context); context.di = 58; context.bx = 72; @@ -9791,7 +9791,7 @@ void putundercentre(Context & context) { return; } -void locationpic(Context & context) { +void locationpic(Context &context) { STACK_CHECK(context); getdestinfo(context); context.al = context.es.byte(context.si); @@ -9838,7 +9838,7 @@ notinthisone: return; } -void getdestinfo(Context & context) { +void getdestinfo(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kDestpos); context.ah = 0; @@ -9858,7 +9858,7 @@ void getdestinfo(Context & context) { return; } -void showarrows(Context & context) { +void showarrows(Context &context) { STACK_CHECK(context); context.di = 116-12; context.bx = 16; @@ -9881,7 +9881,7 @@ void showarrows(Context & context) { return; } -void nextdest(Context & context) { +void nextdest(Context &context) { STACK_CHECK(context); duok: context._cmp(context.data.byte(kCommandtype), 218); @@ -9920,7 +9920,7 @@ nodu: return; } -void lastdest(Context & context) { +void lastdest(Context &context) { STACK_CHECK(context); ddok: context._cmp(context.data.byte(kCommandtype), 219); @@ -9959,7 +9959,7 @@ nodd: return; } -void destselect(Context & context) { +void destselect(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadytrav; @@ -9979,7 +9979,7 @@ notrav: return; } -void getlocation(Context & context) { +void getlocation(Context &context) { STACK_CHECK(context); context.ah = 0; context.bx = context.ax; @@ -9990,7 +9990,7 @@ void getlocation(Context & context) { return; } -void setlocation(Context & context) { +void setlocation(Context &context) { STACK_CHECK(context); context.ah = 0; context.bx = context.ax; @@ -10001,7 +10001,7 @@ void setlocation(Context & context) { return; } -void resetlocation(Context & context) { +void resetlocation(Context &context) { STACK_CHECK(context); context.push(context.ax); context._cmp(context.al, 5); @@ -10049,7 +10049,7 @@ clearedlocations: return; } -void readdesticon(Context & context) { +void readdesticon(Context &context) { STACK_CHECK(context); context.dx = 2013; loadintotemp(context); @@ -10060,14 +10060,14 @@ void readdesticon(Context & context) { return; } -void readcitypic(Context & context) { +void readcitypic(Context &context) { STACK_CHECK(context); context.dx = 2000; loadintotemp(context); return; } -void usemon(Context & context) { +void usemon(Context &context) { STACK_CHECK(context); context.data.byte(kLasttrigger) = 0; context.es = context.cs; @@ -10158,7 +10158,7 @@ endmon: return; } -void printoutermon(Context & context) { +void printoutermon(Context &context) { STACK_CHECK(context); context.di = 40; context.bx = 32; @@ -10187,7 +10187,7 @@ void printoutermon(Context & context) { return; } -void loadpersonal(Context & context) { +void loadpersonal(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLocation); context.dx = 2052; @@ -10215,7 +10215,7 @@ foundpersonal: return; } -void loadnews(Context & context) { +void loadnews(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kNewsitem); context.dx = 2078; @@ -10245,7 +10245,7 @@ foundnews: return; } -void loadcart(Context & context) { +void loadcart(Context &context) { STACK_CHECK(context); lookininterface(context); context.dx = 2130; @@ -10278,7 +10278,7 @@ gotcart: return; } -void lookininterface(Context & context) { +void lookininterface(Context &context) { STACK_CHECK(context); context.al = 'I'; context.ah = 'N'; @@ -10297,7 +10297,7 @@ emptyinterface: return; } -void turnonpower(Context & context) { +void turnonpower(Context &context) { STACK_CHECK(context); context.cx = 3; powerloop: @@ -10314,7 +10314,7 @@ powerloop: return; } -void randomaccess(Context & context) { +void randomaccess(Context &context) { STACK_CHECK(context); accessloop: context.push(context.cx); @@ -10335,7 +10335,7 @@ chosenaccess: return; } -void powerlighton(Context & context) { +void powerlighton(Context &context) { STACK_CHECK(context); context.di = 257+4; context.bx = 182; @@ -10353,7 +10353,7 @@ void powerlighton(Context & context) { return; } -void powerlightoff(Context & context) { +void powerlightoff(Context &context) { STACK_CHECK(context); context.di = 257+4; context.bx = 182; @@ -10371,7 +10371,7 @@ void powerlightoff(Context & context) { return; } -void accesslighton(Context & context) { +void accesslighton(Context &context) { STACK_CHECK(context); context.di = 74; context.bx = 182; @@ -10389,7 +10389,7 @@ void accesslighton(Context & context) { return; } -void accesslightoff(Context & context) { +void accesslightoff(Context &context) { STACK_CHECK(context); context.di = 74; context.bx = 182; @@ -10407,7 +10407,7 @@ void accesslightoff(Context & context) { return; } -void locklighton(Context & context) { +void locklighton(Context &context) { STACK_CHECK(context); context.di = 56; context.bx = 182; @@ -10425,7 +10425,7 @@ void locklighton(Context & context) { return; } -void locklightoff(Context & context) { +void locklightoff(Context &context) { STACK_CHECK(context); context.di = 56; context.bx = 182; @@ -10443,7 +10443,7 @@ void locklightoff(Context & context) { return; } -void input(Context & context) { +void input(Context &context) { STACK_CHECK(context); context.es = context.cs; context.di = 8045; @@ -10533,7 +10533,7 @@ endofinput: return; } -void makecaps(Context & context) { +void makecaps(Context &context) { STACK_CHECK(context); context._cmp(context.al, 'a'); if (context.flags.c()) goto notupperc; @@ -10542,7 +10542,7 @@ notupperc: return; } -void delchar(Context & context) { +void delchar(Context &context) { STACK_CHECK(context); context._dec(context.data.word(kCurpos)); context.si = context.data.word(kCurpos); @@ -10571,7 +10571,7 @@ void delchar(Context & context) { return; } -void execcommand(Context & context) { +void execcommand(Context &context) { STACK_CHECK(context); context.es = context.cs; context.bx = 2776; @@ -10645,7 +10645,7 @@ quitcom: return; } -void neterror(Context & context) { +void neterror(Context &context) { STACK_CHECK(context); context.al = 5; monmessage(context); @@ -10653,7 +10653,7 @@ void neterror(Context & context) { return; } -void dircom(Context & context) { +void dircom(Context &context) { STACK_CHECK(context); context.cx = 30; randomaccess(context); @@ -10686,7 +10686,7 @@ dirroot: return; } -void searchforfiles(Context & context) { +void searchforfiles(Context &context) { STACK_CHECK(context); context.bx = (66*2); directloop1: @@ -10702,7 +10702,7 @@ endofdir: return; } -void signon(Context & context) { +void signon(Context &context) { STACK_CHECK(context); parser(context); context._inc(context.di); @@ -10798,7 +10798,7 @@ passpassed: return; } -void showkeys(Context & context) { +void showkeys(Context &context) { STACK_CHECK(context); context.cx = 10; randomaccess(context); @@ -10824,7 +10824,7 @@ notheld: return; } -void read(Context & context) { +void read(Context &context) { STACK_CHECK(context); context.cx = 40; randomaccess(context); @@ -10907,7 +10907,7 @@ endoftopic: return; } -void dirfile(Context & context) { +void dirfile(Context &context) { STACK_CHECK(context); context.al = 34; context.es.byte(context.di) = context.al; @@ -10979,7 +10979,7 @@ endofdir2: return; } -void getkeyandlogo(Context & context) { +void getkeyandlogo(Context &context) { STACK_CHECK(context); context._inc(context.bx); context.al = context.es.byte(context.bx); @@ -11024,7 +11024,7 @@ keyok: return; } -void searchforstring(Context & context) { +void searchforstring(Context &context) { STACK_CHECK(context); context.dl = context.es.byte(context.di); context.cx = context.di; @@ -11063,7 +11063,7 @@ notfound: return; } -void parser(Context & context) { +void parser(Context &context) { STACK_CHECK(context); context.es = context.cs; context.di = 2942; @@ -11098,7 +11098,7 @@ finishpars: return; } -void scrollmonitor(Context & context) { +void scrollmonitor(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.bx); @@ -11127,7 +11127,7 @@ void scrollmonitor(Context & context) { return; } -void lockmon(Context & context) { +void lockmon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLasthardkey), 57); if (!context.flags.z()) goto notlock; @@ -11140,7 +11140,7 @@ notlock: return; } -void monitorlogo(Context & context) { +void monitorlogo(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLogonum); context._cmp(context.al, context.data.byte(kOldlogonum)); @@ -11161,7 +11161,7 @@ notnewlogo: return; } -void printlogo(Context & context) { +void printlogo(Context &context) { STACK_CHECK(context); context.di = 56; context.bx = 32; @@ -11173,7 +11173,7 @@ void printlogo(Context & context) { return; } -void showcurrentfile(Context & context) { +void showcurrentfile(Context &context) { STACK_CHECK(context); context.di = 178; context.bx = 37; @@ -11193,7 +11193,7 @@ finishfile: return; } -void monmessage(Context & context) { +void monmessage(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTextfile1); context.bx = (66*2); @@ -11209,7 +11209,7 @@ monmessageloop: return; } -void processtrigger(Context & context) { +void processtrigger(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLasttrigger), '1'); if (!context.flags.z()) goto notfirsttrigger; @@ -11237,7 +11237,7 @@ notthirdtrigger: return; } -void triggermessage(Context & context) { +void triggermessage(Context &context) { STACK_CHECK(context); context.push(context.ax); context.di = 174; @@ -11271,7 +11271,7 @@ void triggermessage(Context & context) { return; } -void printcurs(Context & context) { +void printcurs(Context &context) { STACK_CHECK(context); context.push(context.si); context.push(context.di); @@ -11317,7 +11317,7 @@ flashcurs: return; } -void delcurs(Context & context) { +void delcurs(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -11349,7 +11349,7 @@ finishcurdel: return; } -void useobject(Context & context) { +void useobject(Context &context) { STACK_CHECK(context); context.data.byte(kWithobject) = 255; context._cmp(context.data.byte(kCommandtype), 229); @@ -11372,7 +11372,7 @@ douse: return; } -void useroutine(Context & context) { +void useroutine(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); if (context.flags.c()) goto nodream7; @@ -11448,7 +11448,7 @@ cantuse2: return; } -void wheelsound(Context & context) { +void wheelsound(Context &context) { STACK_CHECK(context); context.al = 17; playchannel1(context); @@ -11457,7 +11457,7 @@ void wheelsound(Context & context) { return; } -void runtap(Context & context) { +void runtap(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tapwith; @@ -11504,7 +11504,7 @@ cupfromtapfull: return; } -void playguitar(Context & context) { +void playguitar(Context &context) { STACK_CHECK(context); context.al = 14; playchannel1(context); @@ -11513,7 +11513,7 @@ void playguitar(Context & context) { return; } -void hotelcontrol(Context & context) { +void hotelcontrol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 21); if (!context.flags.z()) goto notrightcont; @@ -11528,7 +11528,7 @@ notrightcont: return; } -void hotelbell(Context & context) { +void hotelbell(Context &context) { STACK_CHECK(context); context.al = 12; playchannel1(context); @@ -11537,7 +11537,7 @@ void hotelbell(Context & context) { return; } -void opentomb(Context & context) { +void opentomb(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); @@ -11550,7 +11550,7 @@ void opentomb(Context & context) { return; } -void usetrainer(Context & context) { +void usetrainer(Context &context) { STACK_CHECK(context); getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); @@ -11565,7 +11565,7 @@ notheldtrainer: return; } -void nothelderror(Context & context) { +void nothelderror(Context &context) { STACK_CHECK(context); createpanel(context); showpanel(context); @@ -11585,7 +11585,7 @@ void nothelderror(Context & context) { return; } -void usepipe(Context & context) { +void usepipe(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto pipewith; @@ -11630,7 +11630,7 @@ alreadyfull: return; } -void usefullcart(Context & context) { +void usefullcart(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); context.al = 2; @@ -11653,7 +11653,7 @@ void usefullcart(Context & context) { return; } -void useplinth(Context & context) { +void useplinth(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto plinthwith; @@ -11685,7 +11685,7 @@ isrightkey: return; } -void chewy(Context & context) { +void chewy(Context &context) { STACK_CHECK(context); showfirstuse(context); getanyad(context); @@ -11694,7 +11694,7 @@ void chewy(Context & context) { return; } -void useladder(Context & context) { +void useladder(Context &context) { STACK_CHECK(context); showfirstuse(context); context._sub(context.data.byte(kMapx), 11); @@ -11710,7 +11710,7 @@ void useladder(Context & context) { return; } -void useladderb(Context & context) { +void useladderb(Context &context) { STACK_CHECK(context); showfirstuse(context); context._add(context.data.byte(kMapx), 11); @@ -11726,7 +11726,7 @@ void useladderb(Context & context) { return; } -void slabdoora(Context & context) { +void slabdoora(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11748,7 +11748,7 @@ slabawrong: return; } -void slabdoorb(Context & context) { +void slabdoorb(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kDreamnumber), 1); if (!context.flags.z()) goto slabbwrong; @@ -11787,7 +11787,7 @@ slabbwrong: return; } -void slabdoord(Context & context) { +void slabdoord(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11809,7 +11809,7 @@ slabcwrong: return; } -void slabdoorc(Context & context) { +void slabdoorc(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11831,7 +11831,7 @@ slabdwrong: return; } -void slabdoore(Context & context) { +void slabdoore(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11853,7 +11853,7 @@ slabewrong: return; } -void slabdoorf(Context & context) { +void slabdoorf(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11875,7 +11875,7 @@ slabfwrong: return; } -void useslab(Context & context) { +void useslab(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto slabwith; @@ -11923,7 +11923,7 @@ notlastslab: return; } -void usecart(Context & context) { +void usecart(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto cartwith; @@ -11961,7 +11961,7 @@ nextcart: return; } -void useclearbox(Context & context) { +void useclearbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto clearboxwith; @@ -11993,7 +11993,7 @@ openbox: return; } -void usecoveredbox(Context & context) { +void usecoveredbox(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); @@ -12006,7 +12006,7 @@ void usecoveredbox(Context & context) { return; } -void userailing(Context & context) { +void userailing(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.word(kWatchingtime) = 80; @@ -12019,7 +12019,7 @@ void userailing(Context & context) { return; } -void useopenbox(Context & context) { +void useopenbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto openboxwith; @@ -12069,7 +12069,7 @@ openboxwrong: return; } -void wearwatch(Context & context) { +void wearwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 1); if (context.flags.z()) goto wearingwatch; @@ -12085,7 +12085,7 @@ wearingwatch: return; } -void wearshades(Context & context) { +void wearshades(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 1); if (context.flags.z()) goto wearingshades; @@ -12101,7 +12101,7 @@ wearingshades: return; } -void sitdowninbar(Context & context) { +void sitdowninbar(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchmode), -1); if (!context.flags.z()) goto satdown; @@ -12121,7 +12121,7 @@ satdown: return; } -void usechurchhole(Context & context) { +void usechurchhole(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kGetback) = 1; @@ -12133,7 +12133,7 @@ void usechurchhole(Context & context) { return; } -void usehole(Context & context) { +void usehole(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto holewith; @@ -12165,7 +12165,7 @@ righthand: return; } -void usealtar(Context & context) { +void usealtar(Context &context) { STACK_CHECK(context); context.al = 'C'; context.ah = 'N'; @@ -12210,7 +12210,7 @@ thingsonaltar: return; } -void opentvdoor(Context & context) { +void opentvdoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto tvdoorwith; @@ -12237,7 +12237,7 @@ keyontv: return; } -void usedryer(Context & context) { +void usedryer(Context &context) { STACK_CHECK(context); context.al = 12; playchannel1(context); @@ -12246,7 +12246,7 @@ void usedryer(Context & context) { return; } -void openlouis(Context & context) { +void openlouis(Context &context) { STACK_CHECK(context); context.al = 5; context.ah = 2; @@ -12257,7 +12257,7 @@ void openlouis(Context & context) { return; } -void nextcolon(Context & context) { +void nextcolon(Context &context) { STACK_CHECK(context); lookcolon: context.al = context.es.byte(context.si); @@ -12267,7 +12267,7 @@ lookcolon: return; } -void openyourneighbour(Context & context) { +void openyourneighbour(Context &context) { STACK_CHECK(context); context.al = 255; context.ah = 255; @@ -12278,7 +12278,7 @@ void openyourneighbour(Context & context) { return; } -void usewindow(Context & context) { +void usewindow(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kManspath), 6); if (!context.flags.z()) goto notonbalc; @@ -12293,7 +12293,7 @@ notonbalc: return; } -void usebalcony(Context & context) { +void usebalcony(Context &context) { STACK_CHECK(context); showfirstuse(context); context.al = 6; @@ -12326,7 +12326,7 @@ void usebalcony(Context & context) { return; } -void openryan(Context & context) { +void openryan(Context &context) { STACK_CHECK(context); context.al = 5; context.ah = 1; @@ -12337,7 +12337,7 @@ void openryan(Context & context) { return; } -void openpoolboss(Context & context) { +void openpoolboss(Context &context) { STACK_CHECK(context); context.al = 5; context.ah = 2; @@ -12348,7 +12348,7 @@ void openpoolboss(Context & context) { return; } -void openeden(Context & context) { +void openeden(Context &context) { STACK_CHECK(context); context.al = 2; context.ah = 8; @@ -12359,7 +12359,7 @@ void openeden(Context & context) { return; } -void opensarters(Context & context) { +void opensarters(Context &context) { STACK_CHECK(context); context.al = 7; context.ah = 8; @@ -12370,7 +12370,7 @@ void opensarters(Context & context) { return; } -void isitright(Context & context) { +void isitright(Context &context) { STACK_CHECK(context); context.bx = context.data; context.es = context.bx; @@ -12386,7 +12386,7 @@ notright: return; } -void drawitall(Context & context) { +void drawitall(Context &context) { STACK_CHECK(context); createpanel(context); drawfloor(context); @@ -12395,7 +12395,7 @@ void drawitall(Context & context) { return; } -void openhoteldoor(Context & context) { +void openhoteldoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith; @@ -12424,7 +12424,7 @@ keyonhotel1: return; } -void openhoteldoor2(Context & context) { +void openhoteldoor2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto hoteldoorwith2; @@ -12452,7 +12452,7 @@ keyonhotel2: return; } -void grafittidoor(Context & context) { +void grafittidoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto grafwith; @@ -12478,7 +12478,7 @@ dograf: return; } -void trapdoor(Context & context) { +void trapdoor(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); @@ -12493,7 +12493,7 @@ void trapdoor(Context & context) { return; } -void callhotellift(Context & context) { +void callhotellift(Context &context) { STACK_CHECK(context); context.al = 12; playchannel1(context); @@ -12508,7 +12508,7 @@ void callhotellift(Context & context) { return; } -void calledenslift(Context & context) { +void calledenslift(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kCounttoopen) = 8; @@ -12518,7 +12518,7 @@ void calledenslift(Context & context) { return; } -void calledensdlift(Context & context) { +void calledensdlift(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLiftflag), 1); if (context.flags.z()) goto edensdhere; @@ -12534,7 +12534,7 @@ edensdhere: return; } -void usepoolreader(Context & context) { +void usepoolreader(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto poolwith; @@ -12569,7 +12569,7 @@ canopenpool: return; } -void uselighter(Context & context) { +void uselighter(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotlighterwith; @@ -12598,7 +12598,7 @@ cigarette: return; } -void showseconduse(Context & context) { +void showseconduse(Context &context) { STACK_CHECK(context); getobtextstart(context); nextcolon(context); @@ -12610,7 +12610,7 @@ void showseconduse(Context & context) { return; } -void usecardreader1(Context & context) { +void usecardreader1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader1with; @@ -12656,7 +12656,7 @@ notyet: return; } -void usecardreader2(Context & context) { +void usecardreader2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader2with; @@ -12713,7 +12713,7 @@ notyetboss: return; } -void usecardreader3(Context & context) { +void usecardreader3(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotreader3with; @@ -12760,7 +12760,7 @@ notyetrecep: return; } -void usecashcard(Context & context) { +void usecashcard(Context &context) { STACK_CHECK(context); getridofreels(context); loadkeypad(context); @@ -12813,7 +12813,7 @@ void usecashcard(Context & context) { return; } -void lookatcard(Context & context) { +void lookatcard(Context &context) { STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofreels(context); @@ -12865,7 +12865,7 @@ void lookatcard(Context & context) { return; } -void moneypoke(Context & context) { +void moneypoke(Context &context) { STACK_CHECK(context); context.bx = 3474; context.cl = 48-1; @@ -12905,7 +12905,7 @@ numberpoke3: return; } -void usecontrol(Context & context) { +void usecontrol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotcontrolwith; @@ -12996,7 +12996,7 @@ axeoncontrols: return; } -void usehatch(Context & context) { +void usehatch(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kNewlocation) = 40; @@ -13004,7 +13004,7 @@ void usehatch(Context & context) { return; } -void usewire(Context & context) { +void usewire(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotwirewith; @@ -13051,7 +13051,7 @@ wireknife: return; } -void usehandle(Context & context) { +void usehandle(Context &context) { STACK_CHECK(context); context.al = 'C'; context.ah = 'U'; @@ -13075,7 +13075,7 @@ havecutwire: return; } -void useelevator1(Context & context) { +void useelevator1(Context &context) { STACK_CHECK(context); showfirstuse(context); selectlocation(context); @@ -13083,7 +13083,7 @@ void useelevator1(Context & context) { return; } -void showfirstuse(Context & context) { +void showfirstuse(Context &context) { STACK_CHECK(context); getobtextstart(context); findnextcolon(context); @@ -13094,7 +13094,7 @@ void showfirstuse(Context & context) { return; } -void useelevator3(Context & context) { +void useelevator3(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.byte(kCounttoclose) = 20; @@ -13108,7 +13108,7 @@ void useelevator3(Context & context) { return; } -void useelevator4(Context & context) { +void useelevator4(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.word(kReeltowatch) = 0; @@ -13122,7 +13122,7 @@ void useelevator4(Context & context) { return; } -void useelevator2(Context & context) { +void useelevator2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 23); if (context.flags.z()) goto inpoolhall; @@ -13143,7 +13143,7 @@ inpoolhall: return; } -void useelevator5(Context & context) { +void useelevator5(Context &context) { STACK_CHECK(context); context.al = 4; placesetobject(context); @@ -13157,7 +13157,7 @@ void useelevator5(Context & context) { return; } -void usekey(Context & context) { +void usekey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 5); if (context.flags.z()) goto usekey1; @@ -13203,7 +13203,7 @@ wrongroom1: return; } -void usestereo(Context & context) { +void usestereo(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 0); if (context.flags.z()) goto stereook; @@ -13261,7 +13261,7 @@ stereoon: return; } -void usecooker(Context & context) { +void usecooker(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); @@ -13277,7 +13277,7 @@ foodinside: return; } -void useaxe(Context & context) { +void useaxe(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 22); if (!context.flags.z()) goto notinpool; @@ -13308,7 +13308,7 @@ axeondoor: return; } -void useelvdoor(Context & context) { +void useelvdoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gotdoorwith; @@ -13342,7 +13342,7 @@ axeondoor: return; } -void withwhat(Context & context) { +void withwhat(Context &context) { STACK_CHECK(context); createpanel(context); showpanel(context); @@ -13385,7 +13385,7 @@ void withwhat(Context & context) { return; } -void selectob(Context & context) { +void selectob(Context &context) { STACK_CHECK(context); findinvpos(context); context.ax = context.es.word(context.bx); @@ -13421,7 +13421,7 @@ doselob: return; } -void compare(Context & context) { +void compare(Context &context) { STACK_CHECK(context); context._sub(context.dl, 'A'); context._sub(context.dh, 'A'); @@ -13439,7 +13439,7 @@ comparefin: return; } -void findsetobject(Context & context) { +void findsetobject(Context &context) { STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); @@ -13468,7 +13468,7 @@ nofind: return; } -void findexobject(Context & context) { +void findexobject(Context &context) { STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); @@ -13497,7 +13497,7 @@ nofindex: return; } -void isryanholding(Context & context) { +void isryanholding(Context &context) { STACK_CHECK(context); context._sub(context.al, 'A'); context._sub(context.ah, 'A'); @@ -13530,7 +13530,7 @@ nofindininv: return; } -void checkinside(Context & context) { +void checkinside(Context &context) { STACK_CHECK(context); context.es = context.data.word(kExtras); context.bx = (0+2080+30000); @@ -13549,7 +13549,7 @@ notfoundinside: return; } -void usetext(Context & context) { +void usetext(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.si); @@ -13570,7 +13570,7 @@ void usetext(Context & context) { return; } -void putbackobstuff(Context & context) { +void putbackobstuff(Context &context) { STACK_CHECK(context); createpanel(context); showpanel(context); @@ -13588,7 +13588,7 @@ void putbackobstuff(Context & context) { return; } -void showpuztext(Context & context) { +void showpuztext(Context &context) { STACK_CHECK(context); context.push(context.cx); findpuztext(context); @@ -13612,7 +13612,7 @@ void showpuztext(Context & context) { return; } -void findpuztext(Context & context) { +void findpuztext(Context &context) { STACK_CHECK(context); context.ah = 0; context.si = context.ax; @@ -13624,7 +13624,7 @@ void findpuztext(Context & context) { return; } -void placesetobject(Context & context) { +void placesetobject(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -13638,7 +13638,7 @@ void placesetobject(Context & context) { return; } -void removesetobject(Context & context) { +void removesetobject(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -13652,7 +13652,7 @@ void removesetobject(Context & context) { return; } -void issetobonmap(Context & context) { +void issetobonmap(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -13664,7 +13664,7 @@ void issetobonmap(Context & context) { return; } -void placefreeobject(Context & context) { +void placefreeobject(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -13678,7 +13678,7 @@ void placefreeobject(Context & context) { return; } -void removefreeobject(Context & context) { +void removefreeobject(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.bx); @@ -13689,7 +13689,7 @@ void removefreeobject(Context & context) { return; } -void findormake(Context & context) { +void findormake(Context &context) { STACK_CHECK(context); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); context.push(context.ax); @@ -13716,19 +13716,19 @@ haventfound: return; } -void switchryanon(Context & context) { +void switchryanon(Context &context) { STACK_CHECK(context); context.data.byte(kRyanon) = 255; return; } -void switchryanoff(Context & context) { +void switchryanoff(Context &context) { STACK_CHECK(context); context.data.byte(kRyanon) = 1; return; } -void setallchanges(Context & context) { +void setallchanges(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); @@ -13750,7 +13750,7 @@ endsetloop: return; } -void dochange(Context & context) { +void dochange(Context &context) { STACK_CHECK(context); context._cmp(context.ch, 0); if (context.flags.z()) goto object; @@ -13793,7 +13793,7 @@ beenpickedup: return; } -void autoappear(Context & context) { +void autoappear(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 32); if (!context.flags.z()) goto notinalley; @@ -13859,7 +13859,7 @@ notinlouiss: return; } -void getundertimed(Context & context) { +void getundertimed(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kTimedy); context.ah = 0; @@ -13875,7 +13875,7 @@ void getundertimed(Context & context) { return; } -void putundertimed(Context & context) { +void putundertimed(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kTimedy); context.ah = 0; @@ -13891,7 +13891,7 @@ void putundertimed(Context & context) { return; } -void dumptimedtext(Context & context) { +void dumptimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) goto nodumptimed; @@ -13909,7 +13909,7 @@ nodumptimed: return; } -void setuptimeduse(Context & context) { +void setuptimeduse(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) goto cantsetup; @@ -13932,7 +13932,7 @@ cantsetup: return; } -void setuptimedtemp(Context & context) { +void setuptimedtemp(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 0); if (context.flags.z()) goto notloadspeech3; @@ -13968,7 +13968,7 @@ cantsetup2: return; } -void usetimedtext(Context & context) { +void usetimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) goto notext; @@ -14002,7 +14002,7 @@ deltimedtext: return; } -void edenscdplayer(Context & context) { +void edenscdplayer(Context &context) { STACK_CHECK(context); showfirstuse(context); context.data.word(kWatchingtime) = 18*2; @@ -14014,7 +14014,7 @@ void edenscdplayer(Context & context) { return; } -void usewall(Context & context) { +void usewall(Context &context) { STACK_CHECK(context); showfirstuse(context); context._cmp(context.data.byte(kManspath), 3); @@ -14070,7 +14070,7 @@ gobackover: return; } -void usechurchgate(Context & context) { +void usechurchgate(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto gatewith; @@ -14109,7 +14109,7 @@ notopenchurch: return; } -void usegun(Context & context) { +void usegun(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); if (context.flags.z()) goto istakengun; @@ -14265,7 +14265,7 @@ nottvsoldier: return; } -void useshield(Context & context) { +void useshield(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 20); if (!context.flags.z()) goto notinsartroom; @@ -14283,7 +14283,7 @@ notinsartroom: return; } -void usebuttona(Context & context) { +void usebuttona(Context &context) { STACK_CHECK(context); context.al = 95; issetobonmap(context); @@ -14311,7 +14311,7 @@ donethisbit: return; } -void useplate(Context & context) { +void useplate(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); if (!context.flags.z()) goto platewith; @@ -14362,7 +14362,7 @@ triedknife: return; } -void usewinch(Context & context) { +void usewinch(Context &context) { STACK_CHECK(context); context.al = 40; context.ah = 1; @@ -14397,7 +14397,7 @@ nowinch: return; } -void entercode(Context & context) { +void entercode(Context &context) { STACK_CHECK(context); context.data.word(kKeypadax) = context.ax; context.data.word(kKeypadcx) = context.cx; @@ -14470,14 +14470,14 @@ numberright: return; } -void loadkeypad(Context & context) { +void loadkeypad(Context &context) { STACK_CHECK(context); context.dx = 1948; loadintotemp(context); return; } -void quitkey(Context & context) { +void quitkey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyqk; @@ -14497,7 +14497,7 @@ doqk: return; } -void addtopresslist(Context & context) { +void addtopresslist(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kPresspointer), 5); if (context.flags.z()) goto nomorekeys; @@ -14516,84 +14516,84 @@ nomorekeys: return; } -void buttonone(Context & context) { +void buttonone(Context &context) { STACK_CHECK(context); context.cl = 1; buttonpress(context); return; } -void buttontwo(Context & context) { +void buttontwo(Context &context) { STACK_CHECK(context); context.cl = 2; buttonpress(context); return; } -void buttonthree(Context & context) { +void buttonthree(Context &context) { STACK_CHECK(context); context.cl = 3; buttonpress(context); return; } -void buttonfour(Context & context) { +void buttonfour(Context &context) { STACK_CHECK(context); context.cl = 4; buttonpress(context); return; } -void buttonfive(Context & context) { +void buttonfive(Context &context) { STACK_CHECK(context); context.cl = 5; buttonpress(context); return; } -void buttonsix(Context & context) { +void buttonsix(Context &context) { STACK_CHECK(context); context.cl = 6; buttonpress(context); return; } -void buttonseven(Context & context) { +void buttonseven(Context &context) { STACK_CHECK(context); context.cl = 7; buttonpress(context); return; } -void buttoneight(Context & context) { +void buttoneight(Context &context) { STACK_CHECK(context); context.cl = 8; buttonpress(context); return; } -void buttonnine(Context & context) { +void buttonnine(Context &context) { STACK_CHECK(context); context.cl = 9; buttonpress(context); return; } -void buttonnought(Context & context) { +void buttonnought(Context &context) { STACK_CHECK(context); context.cl = 10; buttonpress(context); return; } -void buttonenter(Context & context) { +void buttonenter(Context &context) { STACK_CHECK(context); context.cl = 11; buttonpress(context); return; } -void buttonpress(Context & context) { +void buttonpress(Context &context) { STACK_CHECK(context); context.ch = context.cl; context._add(context.ch, 100); @@ -14626,7 +14626,7 @@ nonoise: return; } -void showouterpad(Context & context) { +void showouterpad(Context &context) { STACK_CHECK(context); context.di = (36+112)-3; context.bx = (72)-4; @@ -14643,7 +14643,7 @@ void showouterpad(Context & context) { return; } -void showkeypad(Context & context) { +void showkeypad(Context &context) { STACK_CHECK(context); context.al = 22; context.di = (36+112)+9; @@ -14713,7 +14713,7 @@ notenter: return; } -void singlekey(Context & context) { +void singlekey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGraphicpress), context.al); if (!context.flags.z()) goto gotkey; @@ -14729,7 +14729,7 @@ gotkey: return; } -void dumpkeypad(Context & context) { +void dumpkeypad(Context &context) { STACK_CHECK(context); context.di = (36+112)-3; context.bx = (72)-4; @@ -14739,7 +14739,7 @@ void dumpkeypad(Context & context) { return; } -void usemenu(Context & context) { +void usemenu(Context &context) { STACK_CHECK(context); getridofreels(context); loadmenu(context); @@ -14789,7 +14789,7 @@ menulist: return; } -void dumpmenu(Context & context) { +void dumpmenu(Context &context) { STACK_CHECK(context); context.di = (80+40); context.bx = (60); @@ -14799,7 +14799,7 @@ void dumpmenu(Context & context) { return; } -void getundermenu(Context & context) { +void getundermenu(Context &context) { STACK_CHECK(context); context.di = (80+40); context.bx = (60); @@ -14811,7 +14811,7 @@ void getundermenu(Context & context) { return; } -void putundermenu(Context & context) { +void putundermenu(Context &context) { STACK_CHECK(context); context.di = (80+40); context.bx = (60); @@ -14823,7 +14823,7 @@ void putundermenu(Context & context) { return; } -void showoutermenu(Context & context) { +void showoutermenu(Context &context) { STACK_CHECK(context); context.al = 40; context.ah = 0; @@ -14852,7 +14852,7 @@ void showoutermenu(Context & context) { return; } -void showmenu(Context & context) { +void showmenu(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kMenucount)); context._cmp(context.data.byte(kMenucount), 37*2); @@ -14869,7 +14869,7 @@ menuframeok: return; } -void loadmenu(Context & context) { +void loadmenu(Context &context) { STACK_CHECK(context); context.dx = 1832; loadintotemp(context); @@ -14878,7 +14878,7 @@ void loadmenu(Context & context) { return; } -void viewfolder(Context & context) { +void viewfolder(Context &context) { STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofall(context); @@ -14909,7 +14909,7 @@ folderloop: return; } -void nextfolder(Context & context) { +void nextfolder(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 12); if (!context.flags.z()) goto cannextf; @@ -14941,7 +14941,7 @@ donextf: return; } -void folderhints(Context & context) { +void folderhints(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 5); if (!context.flags.z()) goto notaideadd; @@ -14989,7 +14989,7 @@ notaristoadd: return; } -void lastfolder(Context & context) { +void lastfolder(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 0); if (!context.flags.z()) goto canlastf; @@ -15022,7 +15022,7 @@ dolastf: return; } -void loadfolder(Context & context) { +void loadfolder(Context &context) { STACK_CHECK(context); context.dx = 2299; loadintotemp(context); @@ -15037,7 +15037,7 @@ void loadfolder(Context & context) { return; } -void showfolder(Context & context) { +void showfolder(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; context._cmp(context.data.byte(kFolderpage), 0); @@ -15099,7 +15099,7 @@ closedfolder: return; } -void folderexit(Context & context) { +void folderexit(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 296; @@ -15110,7 +15110,7 @@ void folderexit(Context & context) { return; } -void showleftpage(Context & context) { +void showleftpage(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 0; @@ -15192,7 +15192,7 @@ flipfolderline: return; } -void showrightpage(Context & context) { +void showrightpage(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics2); context.di = 143; @@ -15247,7 +15247,7 @@ contrightpage: return; } -void entersymbol(Context & context) { +void entersymbol(Context &context) { STACK_CHECK(context); context.data.byte(kManisoffscreen) = 1; getridofreels(context); @@ -15314,7 +15314,7 @@ symbolwrong: return; } -void quitsymbol(Context & context) { +void quitsymbol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) { blank(context); return; }; @@ -15338,7 +15338,7 @@ doqs: return; } -void settopleft(Context & context) { +void settopleft(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15355,7 +15355,7 @@ notopleft: return; } -void settopright(Context & context) { +void settopright(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15372,7 +15372,7 @@ notopright: return; } -void setbotleft(Context & context) { +void setbotleft(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15389,7 +15389,7 @@ nobotleft: return; } -void setbotright(Context & context) { +void setbotright(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15406,7 +15406,7 @@ nobotright: return; } -void dumpsymbol(Context & context) { +void dumpsymbol(Context &context) { STACK_CHECK(context); context.data.byte(kNewtextline) = 0; context.di = (64); @@ -15417,7 +15417,7 @@ void dumpsymbol(Context & context) { return; } -void showsymbol(Context & context) { +void showsymbol(Context &context) { STACK_CHECK(context); context.al = 12; context.ah = 0; @@ -15491,7 +15491,7 @@ void showsymbol(Context & context) { return; } -void nextsymbol(Context & context) { +void nextsymbol(Context &context) { STACK_CHECK(context); context._inc(context.al); context._cmp(context.al, 6); @@ -15507,7 +15507,7 @@ botwrap: return; } -void updatesymboltop(Context & context) { +void updatesymboltop(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (context.flags.z()) goto topfinished; @@ -15545,7 +15545,7 @@ topfinished: return; } -void updatesymbolbot(Context & context) { +void updatesymbolbot(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (context.flags.z()) goto botfinished; @@ -15583,7 +15583,7 @@ botfinished: return; } -void dumpsymbox(Context & context) { +void dumpsymbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kDumpx), -1); if (context.flags.z()) goto nodumpsym; @@ -15597,7 +15597,7 @@ nodumpsym: return; } -void usediary(Context & context) { +void usediary(Context &context) { STACK_CHECK(context); getridofreels(context); context.dx = 2039; @@ -15641,7 +15641,7 @@ diarylist: return; } -void showdiary(Context & context) { +void showdiary(Context &context) { STACK_CHECK(context); context.al = 1; context.ah = 0; @@ -15658,7 +15658,7 @@ void showdiary(Context & context) { return; } -void showdiarykeys(Context & context) { +void showdiarykeys(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) goto nokeyatall; @@ -15702,7 +15702,7 @@ nokeyatall: return; } -void dumpdiarykeys(Context & context) { +void dumpdiarykeys(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) goto notdumpdiary; @@ -15756,7 +15756,7 @@ notdumpdiary: return; } -void diarykeyp(Context & context) { +void diarykeyp(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 214); if (context.flags.z()) goto alreadykeyp; @@ -15783,7 +15783,7 @@ notkeyp: return; } -void diarykeyn(Context & context) { +void diarykeyn(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 213); if (context.flags.z()) goto alreadykeyn; @@ -15810,7 +15810,7 @@ notkeyn: return; } -void showdiarypage(Context & context) { +void showdiarypage(Context &context) { STACK_CHECK(context); context.al = 0; context.ah = 0; @@ -15844,7 +15844,7 @@ void showdiarypage(Context & context) { return; } -void findtext1(Context & context) { +void findtext1(Context &context) { STACK_CHECK(context); context.ah = 0; context.si = context.ax; @@ -15856,7 +15856,7 @@ void findtext1(Context & context) { return; } -void zoomonoff(Context & context) { +void zoomonoff(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15894,7 +15894,7 @@ dozoomonoff: return; } -void saveload(Context & context) { +void saveload(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; @@ -15916,7 +15916,7 @@ noops: return; } -void dosaveload(Context & context) { +void dosaveload(Context &context) { STACK_CHECK(context); context.data.byte(kPointerframe) = 0; context.data.word(kTextaddressx) = 70; @@ -15966,7 +15966,7 @@ justret: return; } -void getbackfromops(Context & context) { +void getbackfromops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); if (context.flags.z()) goto opsblock1; @@ -15977,7 +15977,7 @@ opsblock1: return; } -void showmainops(Context & context) { +void showmainops(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+10; @@ -16000,7 +16000,7 @@ void showmainops(Context & context) { return; } -void showdiscops(Context & context) { +void showdiscops(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; @@ -16029,14 +16029,14 @@ void showdiscops(Context & context) { return; } -void loadsavebox(Context & context) { +void loadsavebox(Context &context) { STACK_CHECK(context); context.dx = 1961; loadintotemp(context); return; } -void loadgame(Context & context) { +void loadgame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 246); if (context.flags.z()) goto alreadyload; @@ -16096,7 +16096,7 @@ quitloaded: return; } -void getbacktoops(Context & context) { +void getbacktoops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 201); if (context.flags.z()) goto alreadygetops; @@ -16117,7 +16117,7 @@ dogetbackops: return; } -void discops(Context & context) { +void discops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); if (context.flags.z()) goto alreadydiscops; @@ -16154,7 +16154,7 @@ discopsloop: return; } -void savegame(Context & context) { +void savegame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); if (!context.flags.z()) goto cansaveok; @@ -16198,7 +16198,7 @@ saveops: return; } -void actualsave(Context & context) { +void actualsave(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); if (context.flags.z()) goto alreadyactsave; @@ -16259,7 +16259,7 @@ noactsave: return; } -void actualload(Context & context) { +void actualload(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 221); if (context.flags.z()) goto alreadyactload; @@ -16289,7 +16289,7 @@ notactload: return; } -void selectslot2(Context & context) { +void selectslot2(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) goto noselslot2; @@ -16299,7 +16299,7 @@ noselslot2: return; } -void checkinput(Context & context) { +void checkinput(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLoadingorsave), 3); if (context.flags.z()) goto nokeypress; @@ -16343,7 +16343,7 @@ afterkey: return; } -void getnamepos(Context & context) { +void getnamepos(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kCurrentslot); context.ah = 0; @@ -16359,7 +16359,7 @@ void getnamepos(Context & context) { return; } -void showopbox(Context & context) { +void showopbox(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60); @@ -16376,7 +16376,7 @@ void showopbox(Context & context) { return; } -void showloadops(Context & context) { +void showloadops(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; @@ -16398,7 +16398,7 @@ void showloadops(Context & context) { return; } -void showsaveops(Context & context) { +void showsaveops(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempgraphics); context.di = (60)+128+4; @@ -16420,7 +16420,7 @@ void showsaveops(Context & context) { return; } -void selectslot(Context & context) { +void selectslot(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 244); if (context.flags.z()) goto alreadysel; @@ -16469,7 +16469,7 @@ noselslot: return; } -void showslots(Context & context) { +void showslots(Context &context) { STACK_CHECK(context); context.di = (60)+7; context.bx = (52)+8; @@ -16501,7 +16501,7 @@ nomatchslot: return; } -void shownames(Context & context) { +void shownames(Context &context) { STACK_CHECK(context); context.dx = context.data; context.es = context.dx; @@ -16568,7 +16568,7 @@ afterprintname: return; } -void namestoold(Context & context) { +void namestoold(Context &context) { STACK_CHECK(context); context.ds = context.cs; context.si = 8579; @@ -16579,7 +16579,7 @@ void namestoold(Context & context) { return; } -void oldtonames(Context & context) { +void oldtonames(Context &context) { STACK_CHECK(context); context.es = context.cs; context.di = 8579; @@ -16590,7 +16590,7 @@ void oldtonames(Context & context) { return; } -void saveposition(Context & context) { +void saveposition(Context &context) { STACK_CHECK(context); makeheader(context); context.al = context.data.byte(kCurrentslot); @@ -16642,7 +16642,7 @@ fquit: return; } -void loadposition(Context & context) { +void loadposition(Context &context) { STACK_CHECK(context); context.data.word(kTimecount) = 0; clearchanges(context); @@ -16691,7 +16691,7 @@ void loadposition(Context & context) { return; } -void makeheader(Context & context) { +void makeheader(Context &context) { STACK_CHECK(context); context.dx = context.data; context.es = context.dx; @@ -16711,7 +16711,7 @@ void makeheader(Context & context) { return; } -void storeit(Context & context) { +void storeit(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 0); if (!context.flags.z()) goto isntblank; @@ -16721,7 +16721,7 @@ isntblank: return; } -void findlen(Context & context) { +void findlen(Context &context) { STACK_CHECK(context); context._dec(context.bx); context._add(context.bx, context.ax); @@ -16736,7 +16736,7 @@ foundlen: return; } -void scanfornames(Context & context) { +void scanfornames(Context &context) { STACK_CHECK(context); context.dx = context.data; context.es = context.dx; @@ -16785,7 +16785,7 @@ notexist: return; } -void decide(Context & context) { +void decide(Context &context) { STACK_CHECK(context); setmode(context); loadpalfromiff(context); @@ -16823,7 +16823,7 @@ hasloadedroom: return; } -void showdecisions(Context & context) { +void showdecisions(Context &context) { STACK_CHECK(context); createpanel2(context); showopbox(context); @@ -16837,7 +16837,7 @@ void showdecisions(Context & context) { return; } -void newgame(Context & context) { +void newgame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 251); if (context.flags.z()) goto alreadynewgame; @@ -16853,7 +16853,7 @@ nonewgame: return; } -void doload(Context & context) { +void doload(Context &context) { STACK_CHECK(context); context.data.byte(kLoadingorsave) = 1; showopbox(context); @@ -16899,7 +16899,7 @@ quitloaded: return; } -void loadold(Context & context) { +void loadold(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 252); if (context.flags.z()) goto alreadyloadold; @@ -16920,7 +16920,7 @@ noloadold: return; } -void createname(Context & context) { +void createname(Context &context) { STACK_CHECK(context); context.push(context.ax); context.di = 5105; @@ -16962,7 +16962,7 @@ tensc: return; } -void trysoundalloc(Context & context) { +void trysoundalloc(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) goto gotsoundbuff; @@ -16995,7 +16995,7 @@ gotsoundbuff: return; } -void playchannel0(Context & context) { +void playchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother4; @@ -17044,7 +17044,7 @@ dontbother4: return; } -void playchannel1(Context & context) { +void playchannel1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) goto dontbother5; @@ -17085,7 +17085,7 @@ dontbother5: return; } -void makenextblock(Context & context) { +void makenextblock(Context &context) { STACK_CHECK(context); volumeadjust(context); loopchannel0(context); @@ -17123,7 +17123,7 @@ notch0only: return; } -void volumeadjust(Context & context) { +void volumeadjust(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); @@ -17143,7 +17143,7 @@ volok: return; } -void loopchannel0(Context & context) { +void loopchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kCh0blockstocopy), 0); if (!context.flags.z()) goto notloop; @@ -17165,7 +17165,7 @@ notloop: return; } -void cancelch0(Context & context) { +void cancelch0(Context &context) { STACK_CHECK(context); context.data.byte(kCh0repeat) = 0; context.data.word(kCh0blockstocopy) = 0; @@ -17173,14 +17173,14 @@ void cancelch0(Context & context) { return; } -void cancelch1(Context & context) { +void cancelch1(Context &context) { STACK_CHECK(context); context.data.word(kCh1blockstocopy) = 0; context.data.byte(kCh1playing) = 255; return; } -void channel0tran(Context & context) { +void channel0tran(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumetran; @@ -17203,7 +17203,7 @@ volloop: return; } -void domix(Context & context) { +void domix(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); if (!context.flags.z()) goto lowvolumemix; @@ -17296,7 +17296,7 @@ doneit: return; } -void entrytexts(Context & context) { +void entrytexts(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 21); if (!context.flags.z()) goto notloc15; @@ -17371,7 +17371,7 @@ noteden2: return; } -void entryanims(Context & context) { +void entryanims(Context &context) { STACK_CHECK(context); context.data.word(kReeltowatch) = -1; context.data.byte(kWatchmode) = -1; @@ -17489,7 +17489,7 @@ notedensagain: return; } -void initialinv(Context & context) { +void initialinv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); if (context.flags.z()) goto isedens; @@ -17529,7 +17529,7 @@ isedens: return; } -void pickupob(Context & context) { +void pickupob(Context &context) { STACK_CHECK(context); context.data.byte(kLastinvpos) = context.ah; context.data.byte(kObjecttype) = 2; @@ -17540,12 +17540,12 @@ void pickupob(Context & context) { return; } -void checkforemm(Context & context) { +void checkforemm(Context &context) { STACK_CHECK(context); return; } -void checkbasemem(Context & context) { +void checkbasemem(Context &context) { STACK_CHECK(context); context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); @@ -17556,7 +17556,7 @@ enoughmem: return; } -void allocatebuffers(Context & context) { +void allocatebuffers(Context &context) { STACK_CHECK(context); context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; allocatemem(context); @@ -17591,7 +17591,7 @@ void allocatebuffers(Context & context) { return; } -void clearbuffers(Context & context) { +void clearbuffers(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; @@ -17619,7 +17619,7 @@ void clearbuffers(Context & context) { return; } -void clearchanges(Context & context) { +void clearchanges(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.cx = (250)*2; @@ -17661,7 +17661,7 @@ void clearchanges(Context & context) { return; } -void clearbeforeload(Context & context) { +void clearbeforeload(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 1); if (!context.flags.z()) goto noclear; @@ -17672,7 +17672,7 @@ noclear: return; } -void clearreels(Context & context) { +void clearreels(Context &context) { STACK_CHECK(context); context.es = context.data.word(kReel1); deallocatemem(context); @@ -17683,7 +17683,7 @@ void clearreels(Context & context) { return; } -void clearrest(Context & context) { +void clearrest(Context &context) { STACK_CHECK(context); context.es = context.data.word(kMapdata); context.cx = (66*60)/2; @@ -17711,7 +17711,7 @@ void clearrest(Context & context) { return; } -void parseblaster(Context & context) { +void parseblaster(Context &context) { STACK_CHECK(context); lookattail: context.al = context.es.byte(context.bx); @@ -17778,7 +17778,7 @@ endtail: return; } -void startup(Context & context) { +void startup(Context &context) { STACK_CHECK(context); context.data.byte(kCurrentkey) = 0; context.data.byte(kMainmode) = 0; @@ -17795,7 +17795,7 @@ void startup(Context & context) { return; } -void startup1(Context & context) { +void startup1(Context &context) { STACK_CHECK(context); clearpalette(context); context.data.byte(kThroughdoor) = 0; @@ -17816,7 +17816,7 @@ void startup1(Context & context) { return; } -void screenupdate(Context & context) { +void screenupdate(Context &context) { STACK_CHECK(context); newplace(context); mainscreen(context); @@ -17865,7 +17865,7 @@ finishearly: return; } -void watchreel(Context & context) { +void watchreel(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), -1); if (context.flags.z()) goto notplayingreel; @@ -17941,7 +17941,7 @@ notreleasehold: return; } -void checkforshake(Context & context) { +void checkforshake(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 26); if (!context.flags.z()) goto notstartshake; @@ -17952,7 +17952,7 @@ notstartshake: return; } -void watchcount(Context & context) { +void watchcount(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatchworn; @@ -17991,7 +17991,7 @@ finishwatch: return; } -void showtime(Context & context) { +void showtime(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowatch; @@ -18058,7 +18058,7 @@ nowatch: return; } -void dumpwatch(Context & context) { +void dumpwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchdump), 1); if (!context.flags.z()) goto nodumpwatch; @@ -18072,7 +18072,7 @@ nodumpwatch: return; } -void showbyte(Context & context) { +void showbyte(Context &context) { STACK_CHECK(context); context.dl = context.al; context._shr(context.dl, 1); @@ -18089,7 +18089,7 @@ void showbyte(Context & context) { return; } -void onedigit(Context & context) { +void onedigit(Context &context) { STACK_CHECK(context); context._cmp(context.dl, 10); if (!context.flags.c()) goto morethan10; @@ -18101,7 +18101,7 @@ morethan10: return; } -void twodigitnum(Context & context) { +void twodigitnum(Context &context) { STACK_CHECK(context); context.ah = context.cl; context._dec(context.ah); @@ -18114,7 +18114,7 @@ numloop1: return; } -void showword(Context & context) { +void showword(Context &context) { STACK_CHECK(context); context.ch = 0; context.bx = 10000; @@ -18160,7 +18160,7 @@ word4: return; } -void convnum(Context & context) { +void convnum(Context &context) { STACK_CHECK(context); context._cmp(context.ch, 0); if (!context.flags.z()) goto noconvnum; @@ -18174,7 +18174,7 @@ noconvnum: return; } -void walkandexamine(Context & context) { +void walkandexamine(Context &context) { STACK_CHECK(context); finishedwalking(context); if (!context.flags.z()) goto noobselect; @@ -18246,7 +18246,7 @@ toofaraway: return; } -void mainscreen(Context & context) { +void mainscreen(Context &context) { STACK_CHECK(context); context.data.byte(kInmaparea) = 0; context.bx = 5122; @@ -18262,7 +18262,7 @@ finishmain: return; } -void madmanrun(Context & context) { +void madmanrun(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) { identifyob(context); return; }; @@ -18288,7 +18288,7 @@ norun: return; } -void checkcoords(Context & context) { +void checkcoords(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewlocation), 255); if (context.flags.z()) goto loop048; @@ -18322,7 +18322,7 @@ nonefound: return; } -void identifyob(Context & context) { +void identifyob(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) { blank(context); return; }; @@ -18378,7 +18378,7 @@ nothingund: return; } -void checkifperson(Context & context) { +void checkifperson(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); @@ -18435,7 +18435,7 @@ notareelid: return; } -void checkifset(Context & context) { +void checkifset(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); @@ -18469,7 +18469,7 @@ notasetid: return; } -void checkifex(Context & context) { +void checkifex(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); @@ -18499,7 +18499,7 @@ notanexid: return; } -void checkiffree(Context & context) { +void checkiffree(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); @@ -18529,7 +18529,7 @@ notafreeid: return; } -void isitdescribed(Context & context) { +void isitdescribed(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.cx); @@ -18553,7 +18553,7 @@ void isitdescribed(Context & context) { return; } -void findpathofpoint(Context & context) { +void findpathofpoint(Context &context) { STACK_CHECK(context); context.push(context.ax); context.bx = (0); @@ -18592,7 +18592,7 @@ gotvalidpath: return; } -void findfirstpath(Context & context) { +void findfirstpath(Context &context) { STACK_CHECK(context); context.push(context.ax); context.bx = (0); @@ -18630,7 +18630,7 @@ gotfirst: return; } -void turnpathon(Context & context) { +void turnpathon(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -18654,7 +18654,7 @@ nopathon: return; } -void turnpathoff(Context & context) { +void turnpathoff(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -18678,7 +18678,7 @@ nopathoff: return; } -void turnanypathon(Context & context) { +void turnanypathon(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -18705,7 +18705,7 @@ void turnanypathon(Context & context) { return; } -void turnanypathoff(Context & context) { +void turnanypathoff(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -18732,7 +18732,7 @@ void turnanypathoff(Context & context) { return; } -void checkifpathison(Context & context) { +void checkifpathison(Context &context) { STACK_CHECK(context); context.push(context.ax); getroomspaths(context); @@ -18747,7 +18747,7 @@ void checkifpathison(Context & context) { return; } -void afternewroom(Context & context) { +void afternewroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnew; @@ -18786,7 +18786,7 @@ notnew: return; } -void atmospheres(Context & context) { +void atmospheres(Context &context) { STACK_CHECK(context); context.cl = context.data.byte(kMapx); context.ch = context.data.byte(kMapy); @@ -18853,7 +18853,7 @@ nomoreatmos: return; } -void walkintoroom(Context & context) { +void walkintoroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) goto notlair; @@ -18866,7 +18866,7 @@ notlair: return; } -void afterintroroom(Context & context) { +void afterintroroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) goto notnewintro; @@ -18883,7 +18883,7 @@ notnewintro: return; } -void obname(Context & context) { +void obname(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReasseschanges), 0); if (context.flags.z()) goto notnewpath; @@ -18994,7 +18994,7 @@ toofaraway: return; } -void finishedwalking(Context & context) { +void finishedwalking(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto iswalking; @@ -19004,7 +19004,7 @@ iswalking: return; } -void examineobtext(Context & context) { +void examineobtext(Context &context) { STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); @@ -19013,7 +19013,7 @@ void examineobtext(Context & context) { return; } -void commandwithob(Context & context) { +void commandwithob(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.ax); @@ -19067,7 +19067,7 @@ noadd: return; } -void commandonly(Context & context) { +void commandonly(Context &context) { STACK_CHECK(context); context.push(context.ax); context.push(context.bx); @@ -19103,7 +19103,7 @@ void commandonly(Context & context) { return; } -void printmessage(Context & context) { +void printmessage(Context &context) { STACK_CHECK(context); context.push(context.dx); context.push(context.bx); @@ -19124,7 +19124,7 @@ void printmessage(Context & context) { return; } -void printmessage2(Context & context) { +void printmessage2(Context &context) { STACK_CHECK(context); context.push(context.dx); context.push(context.bx); @@ -19153,7 +19153,7 @@ searchmess: return; } -void blocknametext(Context & context) { +void blocknametext(Context &context) { STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); @@ -19162,7 +19162,7 @@ void blocknametext(Context & context) { return; } -void personnametext(Context & context) { +void personnametext(Context &context) { STACK_CHECK(context); context.bl = context.data.byte(kCommand); context._and(context.bl, 127); @@ -19172,7 +19172,7 @@ void personnametext(Context & context) { return; } -void walktotext(Context & context) { +void walktotext(Context &context) { STACK_CHECK(context); context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kCommandtype); @@ -19181,7 +19181,7 @@ void walktotext(Context & context) { return; } -void getflagunderp(Context & context) { +void getflagunderp(Context &context) { STACK_CHECK(context); context.cx = context.data.word(kMousex); context._sub(context.cx, context.data.word(kMapadx)); @@ -19194,7 +19194,7 @@ void getflagunderp(Context & context) { return; } -void setwalk(Context & context) { +void setwalk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto alreadywalking; @@ -19233,7 +19233,7 @@ holdingreel: return; } -void autosetwalk(Context & context) { +void autosetwalk(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kManspath); context._cmp(context.data.byte(kFinaldest), context.al); @@ -19285,7 +19285,7 @@ normalline: return; } -void checkdest(Context & context) { +void checkdest(Context &context) { STACK_CHECK(context); context.push(context.bx); context._add(context.bx, 12*8); @@ -19333,7 +19333,7 @@ nextcheck2: return; } -void bresenhams(Context & context) { +void bresenhams(Context &context) { STACK_CHECK(context); workoutframes(context); context.dx = context.data; @@ -19447,7 +19447,7 @@ lineexit: return; } -void workoutframes(Context & context) { +void workoutframes(Context &context) { STACK_CHECK(context); context.bx = context.data.word(kLinestartx); context._add(context.bx, 32); @@ -19526,7 +19526,7 @@ success: return; } -void getroomspaths(Context & context) { +void getroomspaths(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRoomnum); context.ah = 0; @@ -19538,7 +19538,7 @@ void getroomspaths(Context & context) { return; } -void copyname(Context & context) { +void copyname(Context &context) { STACK_CHECK(context); context.push(context.di); findobname(context); @@ -19564,7 +19564,7 @@ finishmakename: return; } -void findobname(Context & context) { +void findobname(Context &context) { STACK_CHECK(context); context.push(context.ax); context.ah = 0; @@ -19623,7 +19623,7 @@ notsetname: return; } -void showicon(Context & context) { +void showicon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) goto isdream1; @@ -19674,7 +19674,7 @@ isdream1: return; } -void middlepanel(Context & context) { +void middlepanel(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kTempsprites); context.di = 72+47+20; @@ -19703,7 +19703,7 @@ void middlepanel(Context & context) { return; } -void showman(Context & context) { +void showman(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 0; @@ -19729,7 +19729,7 @@ notverycool: return; } -void showpanel(Context & context) { +void showpanel(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 72; @@ -19746,7 +19746,7 @@ void showpanel(Context & context) { return; } -void roomname(Context & context) { +void roomname(Context &context) { STACK_CHECK(context); context.di = 88; context.bx = 18; @@ -19781,21 +19781,21 @@ gotpl: return; } -void usecharset1(Context & context) { +void usecharset1(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kCharset1); context.data.word(kCurrentset) = context.ax; return; } -void usetempcharset(Context & context) { +void usetempcharset(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kTempcharset); context.data.word(kCurrentset) = context.ax; return; } -void showexit(Context & context) { +void showexit(Context &context) { STACK_CHECK(context); context.ds = context.data.word(kIcons1); context.di = 274; @@ -19806,7 +19806,7 @@ void showexit(Context & context) { return; } -void panelicons1(Context & context) { +void panelicons1(Context &context) { STACK_CHECK(context); context.di = 0; context._cmp(context.data.byte(kWatchon), 1); @@ -19836,7 +19836,7 @@ zoomisoff: return; } -void showwatch(Context & context) { +void showwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) goto nowristwatch; @@ -19851,7 +19851,7 @@ nowristwatch: return; } -void zoomicon(Context & context) { +void zoomicon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) goto nozoom1; @@ -19865,7 +19865,7 @@ nozoom1: return; } -void showblink(Context & context) { +void showblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) goto finblink1; @@ -19900,7 +19900,7 @@ eyesshut: return; } -void dumpblink(Context & context) { +void dumpblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) goto nodumpeye; @@ -19920,7 +19920,7 @@ nodumpeye: return; } -void worktoscreenm(Context & context) { +void worktoscreenm(Context &context) { STACK_CHECK(context); animpointer(context); readmouse(context); @@ -19931,7 +19931,7 @@ void worktoscreenm(Context & context) { return; } -void blank(Context & context) { +void blank(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.z()) goto alreadyblnk; @@ -19942,7 +19942,7 @@ alreadyblnk: return; } -void allpointer(Context & context) { +void allpointer(Context &context) { STACK_CHECK(context); readmouse(context); showpointer(context); @@ -19950,7 +19950,7 @@ void allpointer(Context & context) { return; } -void hangonp(Context & context) { +void hangonp(Context &context) { STACK_CHECK(context); context.push(context.cx); context._add(context.cx, context.cx); @@ -19995,7 +19995,7 @@ getoutofit: return; } -void hangonw(Context & context) { +void hangonw(Context &context) { STACK_CHECK(context); hangloopw: context.push(context.cx); @@ -20010,7 +20010,7 @@ hangloopw: return; } -void hangoncurs(Context & context) { +void hangoncurs(Context &context) { STACK_CHECK(context); monloop1: context.push(context.cx); @@ -20022,7 +20022,7 @@ monloop1: return; } -void getunderzoom(Context & context) { +void getunderzoom(Context &context) { STACK_CHECK(context); context.di = (8)+5; context.bx = (132)+4; @@ -20034,7 +20034,7 @@ void getunderzoom(Context & context) { return; } -void dumpzoom(Context & context) { +void dumpzoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) goto notzoomon; @@ -20047,7 +20047,7 @@ notzoomon: return; } -void putunderzoom(Context & context) { +void putunderzoom(Context &context) { STACK_CHECK(context); context.di = (8)+5; context.bx = (132)+4; @@ -20059,7 +20059,7 @@ void putunderzoom(Context & context) { return; } -void crosshair(Context & context) { +void crosshair(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 3); if (context.flags.z()) goto nocross; @@ -20084,7 +20084,7 @@ nocross: return; } -void showpointer(Context & context) { +void showpointer(Context &context) { STACK_CHECK(context); showblink(context); context.di = context.data.word(kMousex); @@ -20193,7 +20193,7 @@ notsmally2: return; } -void delpointer(Context & context) { +void delpointer(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); @@ -20214,7 +20214,7 @@ nevershown: return; } -void dumppointer(Context & context) { +void dumppointer(Context &context) { STACK_CHECK(context); dumpblink(context); context.cl = context.data.byte(kDelxs); @@ -20236,7 +20236,7 @@ notboth: return; } -void undertextline(Context & context) { +void undertextline(Context &context) { STACK_CHECK(context); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); @@ -20248,7 +20248,7 @@ void undertextline(Context & context) { return; } -void deltextline(Context & context) { +void deltextline(Context &context) { STACK_CHECK(context); context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); @@ -20260,7 +20260,7 @@ void deltextline(Context & context) { return; } -void dumptextline(Context & context) { +void dumptextline(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewtextline), 1); if (!context.flags.z()) goto nodumptextline; @@ -20274,7 +20274,7 @@ nodumptextline: return; } -void animpointer(Context & context) { +void animpointer(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPointermode), 2); if (context.flags.z()) goto combathand; @@ -20341,7 +20341,7 @@ notarrow: return; } -void readmouse(Context & context) { +void readmouse(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; @@ -20356,7 +20356,7 @@ void readmouse(Context & context) { return; } -void readmouse1(Context & context) { +void readmouse1(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; @@ -20369,7 +20369,7 @@ void readmouse1(Context & context) { return; } -void readmouse2(Context & context) { +void readmouse2(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; @@ -20382,7 +20382,7 @@ void readmouse2(Context & context) { return; } -void readmouse3(Context & context) { +void readmouse3(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousex); context.data.word(kOldx) = context.ax; @@ -20395,7 +20395,7 @@ void readmouse3(Context & context) { return; } -void readmouse4(Context & context) { +void readmouse4(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousebutton); context.data.word(kOldbutton) = context.ax; @@ -20414,7 +20414,7 @@ void readmouse4(Context & context) { return; } -void readkey(Context & context) { +void readkey(Context &context) { STACK_CHECK(context); context.bx = context.data.word(kBufferout); context._cmp(context.bx, context.data.word(kBufferin)); @@ -20432,7 +20432,7 @@ nokey: return; } -void convertkey(Context & context) { +void convertkey(Context &context) { STACK_CHECK(context); context._and(context.al, 127); context.ah = 0; @@ -20442,7 +20442,7 @@ void convertkey(Context & context) { return; } -void randomnum1(Context & context) { +void randomnum1(Context &context) { STACK_CHECK(context); context.push(context.ds); context.push(context.es); @@ -20458,7 +20458,7 @@ void randomnum1(Context & context) { return; } -void randomnum2(Context & context) { +void randomnum2(Context &context) { STACK_CHECK(context); context.push(context.ds); context.push(context.es); @@ -20475,7 +20475,7 @@ void randomnum2(Context & context) { return; } -void hangon(Context & context) { +void hangon(Context &context) { STACK_CHECK(context); hangonloop: context.push(context.cx); @@ -20485,7 +20485,7 @@ hangonloop: return; } -void loadtraveltext(Context & context) { +void loadtraveltext(Context &context) { STACK_CHECK(context); context.dx = 2234; standardload(context); @@ -20493,7 +20493,7 @@ void loadtraveltext(Context & context) { return; } -void loadintotemp(Context & context) { +void loadintotemp(Context &context) { STACK_CHECK(context); context.ds = context.cs; standardload(context); @@ -20501,7 +20501,7 @@ void loadintotemp(Context & context) { return; } -void loadintotemp2(Context & context) { +void loadintotemp2(Context &context) { STACK_CHECK(context); context.ds = context.cs; standardload(context); @@ -20509,7 +20509,7 @@ void loadintotemp2(Context & context) { return; } -void loadintotemp3(Context & context) { +void loadintotemp3(Context &context) { STACK_CHECK(context); context.ds = context.cs; standardload(context); @@ -20517,14 +20517,14 @@ void loadintotemp3(Context & context) { return; } -void loadtempcharset(Context & context) { +void loadtempcharset(Context &context) { STACK_CHECK(context); standardload(context); context.data.word(kTempcharset) = context.ax; return; } -void standardload(Context & context) { +void standardload(Context &context) { STACK_CHECK(context); openfile(context); readheader(context); @@ -20543,14 +20543,14 @@ void standardload(Context & context) { return; } -void loadtemptext(Context & context) { +void loadtemptext(Context &context) { STACK_CHECK(context); standardload(context); context.data.word(kTextfile1) = context.ax; return; } -void loadroom(Context & context) { +void loadroom(Context &context) { STACK_CHECK(context); context.data.byte(kRoomloaded) = 1; context.data.word(kTimecount) = 0; @@ -20571,7 +20571,7 @@ void loadroom(Context & context) { return; } -void loadroomssample(Context & context) { +void loadroomssample(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); @@ -20591,7 +20591,7 @@ loadedalready: return; } -void getridofreels(Context & context) { +void getridofreels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontgetrid; @@ -20605,7 +20605,7 @@ dontgetrid: return; } -void getridofall(Context & context) { +void getridofall(Context &context) { STACK_CHECK(context); context.es = context.data.word(kBackdrop); deallocatemem(context); @@ -20634,7 +20634,7 @@ void getridofall(Context & context) { return; } -void restorereels(Context & context) { +void restorereels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) goto dontrestore; @@ -20667,7 +20667,7 @@ dontrestore: return; } -void restoreall(Context & context) { +void restoreall(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLocation); getroomdata(context); @@ -20748,7 +20748,7 @@ void restoreall(Context & context) { return; } -void sortoutmap(Context & context) { +void sortoutmap(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.di); @@ -20771,7 +20771,7 @@ blimey: return; } -void startloading(Context & context) { +void startloading(Context &context) { STACK_CHECK(context); context.data.byte(kCombatcount) = 0; context.al = context.cs.byte(context.bx+13); @@ -20907,7 +20907,7 @@ dontwalkin: return; } -void disablepath(Context & context) { +void disablepath(Context &context) { STACK_CHECK(context); context.push(context.cx); context._xchg(context.al, context.ah); @@ -20940,7 +20940,7 @@ lookx2: return; } -void findxyfrompath(Context & context) { +void findxyfrompath(Context &context) { STACK_CHECK(context); getroomspaths(context); context.al = context.data.byte(kManspath); @@ -20957,7 +20957,7 @@ void findxyfrompath(Context & context) { return; } -void findroominloc(Context & context) { +void findroominloc(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kMapy); context.cx = -6; @@ -20975,7 +20975,7 @@ lookx: return; } -void getroomdata(Context & context) { +void getroomdata(Context &context) { STACK_CHECK(context); context.ah = 0; context.cx = 32; @@ -20985,7 +20985,7 @@ void getroomdata(Context & context) { return; } -void readheader(Context & context) { +void readheader(Context &context) { STACK_CHECK(context); context.ds = context.cs; context.dx = 6091; @@ -20996,7 +20996,7 @@ void readheader(Context & context) { return; } -void allocateload(Context & context) { +void allocateload(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.di); @@ -21009,7 +21009,7 @@ void allocateload(Context & context) { return; } -void fillspace(Context & context) { +void fillspace(Context &context) { STACK_CHECK(context); context.push(context.es); context.push(context.ds); @@ -21027,49 +21027,49 @@ void fillspace(Context & context) { return; } -void getridoftemp(Context & context) { +void getridoftemp(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics); deallocatemem(context); return; } -void getridoftemptext(Context & context) { +void getridoftemptext(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTextfile1); deallocatemem(context); return; } -void getridoftemp2(Context & context) { +void getridoftemp2(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics2); deallocatemem(context); return; } -void getridoftemp3(Context & context) { +void getridoftemp3(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics3); deallocatemem(context); return; } -void getridoftempcharset(Context & context) { +void getridoftempcharset(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempcharset); deallocatemem(context); return; } -void getridoftempsp(Context & context) { +void getridoftempsp(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempsprites); deallocatemem(context); return; } -void readsetdata(Context & context) { +void readsetdata(Context &context) { STACK_CHECK(context); context.dx = 1857; standardload(context); @@ -21104,7 +21104,7 @@ novolumeload: return; } -void makename(Context & context) { +void makename(Context &context) { STACK_CHECK(context); context.si = context.dx; context.di = 6061; @@ -21119,7 +21119,7 @@ transfer: return; } -void dreamweb(Context & context) { +void dreamweb(Context &context) { STACK_CHECK(context); seecommandtail(context); checkbasemem(context); -- cgit v1.2.3 From 7a47b09379818237b392ee035e1d0179b1c4593b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 22:25:16 +0400 Subject: DREAMWEB: uncommented simple ret stripping --- devtools/tasmrecover/tasm/proc.py | 6 +- engines/dreamweb/dreamgen.cpp | 562 +------------------------------------- 2 files changed, 11 insertions(+), 557 deletions(-) diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 4337d4c936..3a82a74413 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -23,9 +23,9 @@ class proc: while len(self.stmts) and isinstance(self.stmts[-1], op.label): print "stripping last label" self.stmts.pop() - #if isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): - # print "stripping last ret" - # self.stmts.pop() + if isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): + print "stripping last ret" + self.stmts.pop() #merging push ax pop bx constructs i = 0 while i + 1 < len(self.stmts): diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index e578fe4d3f..06de8814ca 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -490,12 +490,10 @@ void alleybarksound(Context &context) { context.ax = 1000; nobark: context.es.word(context.bx+3) = context.ax; - return; } void intromusic(Context &context) { STACK_CHECK(context); - return; } void foghornsound(Context &context) { @@ -585,7 +583,6 @@ notsmokeb2: gotsmokeb: showgamereel(context); addtopeoplelist(context); - return; } void attendant(Context &context) { @@ -607,7 +604,6 @@ void manasleep(Context &context) { context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - return; } void eden(Context &context) { @@ -640,14 +636,12 @@ void malefan(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void femalefan(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void louis(Context &context) { @@ -696,21 +690,18 @@ void manasleep2(Context &context) { context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); - return; } void mansatstill(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void tattooman(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void drinker(Context &context) { @@ -732,7 +723,6 @@ notdrinker1: gotdrinker: showgamereel(context); addtopeoplelist(context); - return; } void bartender(Context &context) { @@ -760,21 +750,18 @@ gotsmoket: context.es.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); - return; } void othersmoker(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void barwoman(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void interviewer(Context &context) { @@ -792,7 +779,6 @@ notgeneralstart: context._inc(context.es.word(context.bx+3)); talking: showgamereel(context); - return; } void soldier1(Context &context) { @@ -826,7 +812,6 @@ soldierwait: gotsoldframe: showgamereel(context); addtopeoplelist(context); - return; } void rockstar(Context &context) { @@ -878,7 +863,6 @@ notalkrock: rockcombatend: context.data.byte(kNewlocation) = 45; showgamereel(context); - return; } void helicopter(Context &context) { @@ -936,7 +920,6 @@ notwaitingheli: return; heliwon: context.data.byte(kPointermode) = 0; - return; } void mugger(Context &context) { @@ -1017,7 +1000,6 @@ void aide(Context &context) { STACK_CHECK(context); showgamereel(context); addtopeoplelist(context); - return; } void businessman(Context &context) { @@ -1107,7 +1089,6 @@ buscombatend: buscombatwonend: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 0; - return; } void poolguard(Context &context) { @@ -1221,7 +1202,6 @@ securwait: gotsecurframe: showgamereel(context); addtopeoplelist(context); - return; } void heavy(Context &context) { @@ -1257,7 +1237,6 @@ heavywait: gotheavyframe: showgamereel(context); addtopeoplelist(context); - return; } void bossman(Context &context) { @@ -1321,7 +1300,6 @@ gameragain: gamerfin: showgamereel(context); addtopeoplelist(context); - return; } void sparkydrip(Context &context) { @@ -1380,7 +1358,6 @@ notendcandle1: context.es.word(context.bx+3) = context.ax; candle1: showgamereel(context); - return; } void smallcandle(Context &context) { @@ -1396,7 +1373,6 @@ notendsmallcandle: context.es.word(context.bx+3) = context.ax; smallcandlef: showgamereel(context); - return; } void intromagic1(Context &context) { @@ -1424,7 +1400,6 @@ gotintrom1: context.data.byte(kNowinnewroom) = 1; introm1fin: showgamereel(context); - return; } void candles(Context &context) { @@ -1440,7 +1415,6 @@ gotcandles: context.es.word(context.bx+3) = context.ax; candlesfin: showgamereel(context); - return; } void candles2(Context &context) { @@ -1456,7 +1430,6 @@ gotcandles2: context.es.word(context.bx+3) = context.ax; candles2fin: showgamereel(context); - return; } void gates(Context &context) { @@ -1493,7 +1466,6 @@ gotgates: context.es = context.pop(); gatesfin: showgamereel(context); - return; } void intromagic2(Context &context) { @@ -1509,7 +1481,6 @@ gotintrom2: context.es.word(context.bx+3) = context.ax; introm2fin: showgamereel(context); - return; } void intromagic3(Context &context) { @@ -1527,7 +1498,6 @@ introm3fin: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; - return; } void intromonks1(Context &context) { @@ -1572,7 +1542,6 @@ intromonk1fin: showgamereel(context); context.al = context.data.byte(kMapy); context.es.byte(context.bx+2) = context.al; - return; } void intromonks2(Context &context) { @@ -1625,12 +1594,10 @@ gotintromonk2: context.es.word(context.bx+3) = context.ax; intromonk2fin: showgamereel(context); - return; } void handclap(Context &context) { STACK_CHECK(context); - return; } void monks2text(Context &context) { @@ -1734,7 +1701,6 @@ gotmonks2text: context.cx = 120; context.ah = 82; setuptimedtemp(context); - return; } void intro1text(Context &context) { @@ -1773,7 +1739,6 @@ gotintro1text: return; oktalk2: setuptimedtemp(context); - return; } void intro2text(Context &context) { @@ -1799,7 +1764,6 @@ gotintro2text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - return; } void intro3text(Context &context) { @@ -1825,7 +1789,6 @@ gotintro3text: context.dx = 1; context.ah = 82; setuptimedtemp(context); - return; } void monkandryan(Context &context) { @@ -1851,7 +1814,6 @@ gotmonkryan: context.es.word(context.bx+3) = context.ax; notmonkryan: showgamereel(context); - return; } void endgameseq(Context &context) { @@ -1998,7 +1960,6 @@ gotnext: hangon(context); paneltomap(context); fadescreenuphalf(context); - return; } void priest(Context &context) { @@ -2031,7 +1992,6 @@ void madmanstelly(Context &context) { notendtelly: context.es.word(context.bx+3) = context.ax; showgamereel(context); - return; } void madman(Context &context) { @@ -2102,7 +2062,6 @@ alreadywon: ryansded: context.data.byte(kMandead) = 2; showgamereel(context); - return; } void madmantext(Context &context) { @@ -2189,7 +2148,6 @@ gotendtext: context.dx = 1; context.ah = 83; setuptimedtemp(context); - return; } void textformonk(Context &context) { @@ -2314,7 +2272,6 @@ gotmonktext: return; oktalk: setuptimedtemp(context); - return; } void drunk(Context &context) { @@ -2356,7 +2313,6 @@ gotadvframe: noadvisor: showgamereel(context); addtopeoplelist(context); - return; } void copper(Context &context) { @@ -2387,7 +2343,6 @@ gotcopframe: nocopper: showgamereel(context); addtopeoplelist(context); - return; } void sparky(Context &context) { @@ -2464,7 +2419,6 @@ void addtopeoplelist(Context &context) { context.bx = context.pop(); context.es = context.pop(); context._add(context.data.word(kListpos), 5); - return; } void showgamereel(Context &context) { @@ -2499,7 +2453,6 @@ notspeed: return; forcenext: context._cmp(context.al, context.al); - return; } void clearsprites(Context &context) { @@ -2509,7 +2462,6 @@ void clearsprites(Context &context) { context.al = 255; context.cx = (32)*16; while(context.cx--) context._stosb(); - return; } void makesprite(Context &context) { @@ -2529,7 +2481,6 @@ _tmp17a: context.es.word(context.bx+2) = 0x0ffff; context.es.byte(context.bx+15) = 0; context.es.byte(context.bx+18) = 0; - return; } void delsprite(Context &context) { @@ -2538,7 +2489,6 @@ void delsprite(Context &context) { context.cx = (32); context.al = 255; while(context.cx--) context._stosb(); - return; } void spriteupdate(Context &context) { @@ -2604,7 +2554,6 @@ skipsprite: context._inc(context.cx); context._cmp(context.cx, 7); if (!context.flags.z()) goto priorityloop; - return; } void printasprite(Context &context) { @@ -2641,7 +2590,6 @@ notquickp: showframe(context); context.bx = context.pop(); context.es = context.pop(); - return; } void checkone(Context &context) { @@ -2677,7 +2625,6 @@ void checkone(Context &context) { context.cx = context.ax; context._lodsb(); context.dx = context.pop(); - return; } void findsource(Context &context) { @@ -2697,7 +2644,6 @@ over1000: over1001: context.ds = context.data.word(kReel3); context.data.word(kTakeoff) = 320; - return; } void initman(Context &context) { @@ -2712,7 +2658,6 @@ void initman(Context &context) { context.es.byte(context.bx+23) = 4; context.es.byte(context.bx+22) = 0; context.es.byte(context.bx+29) = 0; - return; } void mainman(Context &context) { @@ -2796,7 +2741,6 @@ notwalk: context.ax = context.es.word(context.bx+10); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - return; } void aboutturn(Context &context) { @@ -2831,7 +2775,6 @@ decdir: context._and(context.al, 7); context.data.byte(kFacing) = context.al; context.es.byte(context.bx+29) = 0; - return; } void walking(Context &context) { @@ -2881,7 +2824,6 @@ endofline: return; finishedwalk: facerightway(context); - return; } void facerightway(Context &context) { @@ -2900,7 +2842,6 @@ void facerightway(Context &context) { context.data.byte(kLeavedirection) = context.al; context.bx = context.pop(); context.es = context.pop(); - return; } void checkforexit(Context &context) { @@ -3008,7 +2949,6 @@ void adjustdown(Context &context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; } void adjustup(Context &context) { @@ -3023,7 +2963,6 @@ void adjustup(Context &context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; } void adjustleft(Context &context) { @@ -3039,7 +2978,6 @@ void adjustleft(Context &context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; } void adjustright(Context &context) { @@ -3055,7 +2993,6 @@ void adjustright(Context &context) { context.data.byte(kNowinnewroom) = 1; context.bx = context.pop(); context.es = context.pop(); - return; } void reminders(Context &context) { @@ -3164,7 +3101,6 @@ initrainside2: finishinitrain: context.al = 255; context._stosb(); - return; } void splitintolines(Context &context) { @@ -3238,7 +3174,6 @@ failrain: context.es = context.pop(); context.cx = context.pop(); context.al = 0; - return; } void showrain(Context &context) { @@ -3460,7 +3395,6 @@ void liftnoise(Context &context) { hissnoise: context.al = 13; playchannel1(context); - return; } void random(Context &context) { @@ -3473,7 +3407,6 @@ void random(Context &context) { context.al = context.ds.byte(context.di); context.di = context.pop(); context.es.byte(context.bx+15) = context.al; - return; } void steady(Context &context) { @@ -3481,7 +3414,6 @@ void steady(Context &context) { context.al = context.ds.byte(context.di+18); context.ds.byte(context.di+17) = context.al; context.es.byte(context.bx+15) = context.al; - return; } void constant(Context &context) { @@ -3500,7 +3432,6 @@ gotconst: context._sub(context.di, context.cx); context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; - return; } void doorway(Context &context) { @@ -3510,7 +3441,6 @@ void doorway(Context &context) { context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 10; dodoor(context); - return; } void widedoor(Context &context) { @@ -3520,7 +3450,6 @@ void widedoor(Context &context) { context.data.byte(kDoorcheck3) = -30; context.data.byte(kDoorcheck4) = 24; dodoor(context); - return; } void dodoor(Context &context) { @@ -3801,7 +3730,6 @@ void getreelframeax(Context &context) { context._add(context.ax, context.ax); context._add(context.ax, context.cx); context.bx = context.ax; - return; } void reelsonscreen(Context &context) { @@ -3811,7 +3739,6 @@ void reelsonscreen(Context &context) { watchreel(context); showrain(context); usetimedtext(context); - return; } void plotreel(Context &context) { @@ -3850,7 +3777,6 @@ notplot: soundonreels(context); context.bx = context.pop(); context.es = context.pop(); - return; } void soundonreels(Context &context) { @@ -3956,7 +3882,6 @@ notryanon: return; notchangeloc: movemap(context); - return; } void movemap(Context &context) { @@ -3987,7 +3912,6 @@ notmapdownspec: notmaprightspec: context._sub(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; - return; } void getreelstart(Context &context) { @@ -3998,7 +3922,6 @@ void getreelstart(Context &context) { context.es = context.data.word(kReels); context.si = context.ax; context._add(context.si, (0+(36*144))); - return; } void showreelframe(Context &context) { @@ -4017,7 +3940,6 @@ void showreelframe(Context &context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 8; showframe(context); - return; } void deleverything(Context &context) { @@ -4033,7 +3955,6 @@ bigroom: context._sub(context.data.byte(kMapysize), 8); maptopanel(context); context._add(context.data.byte(kMapysize), 8); - return; } void dumpeverything(Context &context) { @@ -4097,7 +4018,6 @@ void allocatework(Context &context) { context.bx = 0x1000; allocatemem(context); context.data.word(kWorkspace) = context.ax; - return; } void readabyte(Context &context) { @@ -4118,7 +4038,6 @@ void readabyte(Context &context) { context.si = 0; notendblock: context._lodsb(); - return; } void loadpalfromiff(Context &context) { @@ -4154,7 +4073,6 @@ palloop: nought: context._stosb(); if (--context.cx) goto palloop; - return; } void paneltomap(Context &context) { @@ -4168,7 +4086,6 @@ void paneltomap(Context &context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiget(context); - return; } void maptopanel(Context &context) { @@ -4182,7 +4099,6 @@ void maptopanel(Context &context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multiput(context); - return; } void dumpmap(Context &context) { @@ -4194,7 +4110,6 @@ void dumpmap(Context &context) { context.cl = context.data.byte(kMapxsize); context.ch = context.data.byte(kMapysize); multidump(context); - return; } void pixelcheckset(Context &context) { @@ -4235,7 +4150,6 @@ void pixelcheckset(Context &context) { context.es = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - return; } void createpanel(Context &context) { @@ -4264,7 +4178,6 @@ void createpanel(Context &context) { context.al = 0; context.ah = 2; showframe(context); - return; } void createpanel2(Context &context) { @@ -4282,7 +4195,6 @@ void createpanel2(Context &context) { context.al = 5; context.ah = 2; showframe(context); - return; } void clearwork(Context &context) { @@ -4325,7 +4237,6 @@ clearloop: context._stosw(); context._stosw(); if (--context.cx) goto clearloop; - return; } void zoom(Context &context) { @@ -4373,7 +4284,6 @@ zoomloop2: if (--context.cx) goto zoomloop; crosshair(context); context.data.byte(kDidzoom) = 1; - return; } void delthisone(Context &context) { @@ -4417,7 +4327,6 @@ deloneloop: context._add(context.si, context.dx); context._dec(context.ch); if (!context.flags.z()) goto deloneloop; - return; } void doblocks(Context &context) { @@ -4533,7 +4442,6 @@ zeroblock: context.di = context.pop(); context._add(context.di, (320)*16); if (--context.cx) goto loop120; - return; } void showframe(Context &context) { @@ -4633,7 +4541,6 @@ noeffects: context.push(context.cx); frameoutv(context); context.cx = context.pop(); - return; } void frameoutv(Context &context) { @@ -4674,7 +4581,6 @@ backtosolid: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloop1; - return; } void frameoutbh(Context &context) { @@ -4708,7 +4614,6 @@ nextline: context.cx = context.pop(); context._dec(context.ch); if (!context.flags.z()) goto bhloop2; - return; } void frameoutfx(Context &context) { @@ -4750,7 +4655,6 @@ backtosolidfx: context._add(context.di, context.dx); context._dec(context.ch); if (!context.flags.z()) goto frameloopfx1; - return; } void transferinv(Context &context) { @@ -4800,7 +4704,6 @@ void transferinv(Context &context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - return; } void transfermap(Context &context) { @@ -4848,7 +4751,6 @@ void transfermap(Context &context) { context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); - return; } void dofade(Context &context) { @@ -4882,7 +4784,6 @@ void clearendpal(Context &context) { context.cx = 768; context.al = 0; while(context.cx--) context._stosb(); - return; } void clearpalette(Context &context) { @@ -4890,7 +4791,6 @@ void clearpalette(Context &context) { context.data.byte(kFadedirection) = 0; clearstartpal(context); dumpcurrent(context); - return; } void fadescreenup(Context &context) { @@ -4901,7 +4801,6 @@ void fadescreenup(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; } void fadetowhite(Context &context) { @@ -4921,7 +4820,6 @@ void fadetowhite(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; } void fadefromwhite(Context &context) { @@ -4941,7 +4839,6 @@ void fadefromwhite(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; } void fadescreenups(Context &context) { @@ -4952,7 +4849,6 @@ void fadescreenups(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - return; } void fadescreendownhalf(Context &context) { @@ -4982,7 +4878,6 @@ halfend: context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - return; } void fadescreenuphalf(Context &context) { @@ -4993,7 +4888,6 @@ void fadescreenuphalf(Context &context) { context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; - return; } void fadescreendown(Context &context) { @@ -5004,7 +4898,6 @@ void fadescreendown(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 128; - return; } void fadescreendowns(Context &context) { @@ -5015,7 +4908,6 @@ void fadescreendowns(Context &context) { context.data.byte(kFadecount) = 63; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 64; - return; } void clearstartpal(Context &context) { @@ -5029,7 +4921,6 @@ wholeloop1: context.al = 0; context._stosb(); if (--context.cx) goto wholeloop1; - return; } void showgun(Context &context) { @@ -5084,13 +4975,11 @@ void showgun(Context &context) { loadtemptext(context); rollendcredits2(context); getridoftemptext(context); - return; } void rollendcredits2(Context &context) { STACK_CHECK(context); rollem(context); - return; } void rollem(Context &context) { @@ -5213,7 +5102,6 @@ gotthere: return; nomorefading: context.data.byte(kFadedirection) = 0; - return; } void greyscalesum(Context &context) { @@ -5269,7 +5157,6 @@ noaddb: context._add(context.si, 3); context.cx = context.pop(); if (--context.cx) goto greysumloop1; - return; } void paltostartpal(Context &context) { @@ -5280,8 +5167,7 @@ void paltostartpal(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; -} + } void endpaltostart(Context &context) { STACK_CHECK(context); @@ -5291,8 +5177,7 @@ void endpaltostart(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; -} + } void startpaltoend(Context &context) { STACK_CHECK(context); @@ -5302,8 +5187,7 @@ void startpaltoend(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; while(context.cx--) context._movsw(); - return; -} + } void paltoendpal(Context &context) { STACK_CHECK(context); @@ -5313,8 +5197,7 @@ void paltoendpal(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; while(context.cx--) context._movsw(); - return; -} + } void allpalette(Context &context) { STACK_CHECK(context); @@ -5325,7 +5208,6 @@ void allpalette(Context &context) { context.cx = 768/2; while(context.cx--) context._movsw(); dumpcurrent(context); - return; } void dumpcurrent(Context &context) { @@ -5340,7 +5222,6 @@ void dumpcurrent(Context &context) { context.al = 128; context.cx = 128; showgroup(context); - return; } void fadedownmon(Context &context) { @@ -5361,7 +5242,6 @@ void fadedownmon(Context &context) { context.data.byte(kNumtofade) = 128; context.cx = 64; hangon(context); - return; } void fadeupmon(Context &context) { @@ -5382,7 +5262,6 @@ void fadeupmon(Context &context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - return; } void fadeupmonfirst(Context &context) { @@ -5407,7 +5286,6 @@ void fadeupmonfirst(Context &context) { playchannel1(context); context.cx = 64; hangon(context); - return; } void fadeupyellows(Context &context) { @@ -5427,7 +5305,6 @@ void fadeupyellows(Context &context) { context.data.byte(kNumtofade) = 128; context.cx = 128; hangon(context); - return; } void initialmoncols(Context &context) { @@ -5446,7 +5323,6 @@ void initialmoncols(Context &context) { context.al = 230; context.cx = 18; showgroup(context); - return; } void titles(Context &context) { @@ -5454,7 +5330,6 @@ void titles(Context &context) { clearpalette(context); biblequote(context); intro(context); - return; } void endgame(Context &context) { @@ -5468,7 +5343,6 @@ void endgame(Context &context) { context.data.byte(kVolumedirection) = 1; context.cx = 200; hangon(context); - return; } void monkspeaking(Context &context) { @@ -5513,7 +5387,6 @@ notloadspeech2: context.cx = 300; hangon(context); getridoftemp(context); - return; } void showmonk(Context &context) { @@ -5524,7 +5397,6 @@ void showmonk(Context &context) { context.bx = 72; context.ds = context.data.word(kTempgraphics); showframe(context); - return; } void gettingshot(Context &context) { @@ -5537,14 +5409,12 @@ void gettingshot(Context &context) { context.data.byte(kVolumedirection) = -1; runendseq(context); clearbeforeload(context); - return; } void credits(Context &context) { STACK_CHECK(context); clearpalette(context); realcredits(context); - return; } void biblequote(Context &context) { @@ -5569,7 +5439,6 @@ void biblequote(Context &context) { cancelch0(context); biblequotearly: context.data.byte(kLasthardkey) = 0; - return; } void hangone(Context &context) { @@ -5627,7 +5496,6 @@ void intro(Context &context) { clearbeforeload(context); introearly: context.data.byte(kLasthardkey) = 0; - return; } void runintroseq(Context &context) { @@ -5660,7 +5528,6 @@ moreintroseq: earlyendrun: getridoftemptext(context); clearbeforeload(context); - return; } void runendseq(Context &context) { @@ -5682,7 +5549,6 @@ moreendseq: vsync(context); context._cmp(context.data.byte(kGetback), 1); if (!context.flags.z()) goto moreendseq; - return; } void loadintroroom(Context &context) { @@ -5703,7 +5569,6 @@ void loadintroroom(Context &context) { spriteupdate(context); printsprites(context); worktoscreen(context); - return; } void realcredits(Context &context) { @@ -5828,7 +5693,6 @@ void realcredits(Context &context) { hangone(context); realcreditsearly: context.data.byte(kLasthardkey) = 0; - return; } void printchar(Context &context) { @@ -5880,7 +5744,6 @@ iskern: return; kernit: context._dec(context.cl); - return; } void printslow(Context &context) { @@ -5973,7 +5836,6 @@ finishslow2: context.di = context.pop(); context.bx = context.pop(); context.al = 1; - return; } void waitframes(Context &context) { @@ -5994,7 +5856,6 @@ void waitframes(Context &context) { context.es = context.pop(); context.bx = context.pop(); context.di = context.pop(); - return; } void printboth(Context &context) { @@ -6012,7 +5873,6 @@ void printboth(Context &context) { context.bx = context.pop(); context.cx = context.pop(); context.ax = context.pop(); - return; } void printdirect(Context &context) { @@ -6048,7 +5908,6 @@ finishdirct: context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); - return; } void monprint(Context &context) { @@ -6127,7 +5986,6 @@ nottrigger2: scrollmonitor(context); context.bx = context.si; context.data.byte(kKerning) = 0; - return; } void getnumber(Context &context) { @@ -6231,7 +6089,6 @@ notcent2: context.bx = context.pop(); context.si = context.pop(); context.cl = context.ch; - return; } void getnextword(Context &context) { @@ -6269,7 +6126,6 @@ endword: endall: context._add(context.bl, 6); context.al = 1; - return; } void fillryan(Context &context) { @@ -6313,7 +6169,6 @@ ryanloop1: context._add(context.bx, (44)); if (--context.cx) goto ryanloop2; showryanpage(context); - return; } void fillopen(Context &context) { @@ -6355,7 +6210,6 @@ nextopenslot: context._cmp(context.cl, 5); if (!context.flags.z()) goto openloop1; undertextline(context); - return; } void findallryan(Context &context) { @@ -6388,7 +6242,6 @@ notinryaninv: context._inc(context.ch); context._cmp(context.ch, (114)); if (!context.flags.z()) goto findryanloop; - return; } void findallopen(Context &context) { @@ -6454,7 +6307,6 @@ findopen2a: context._inc(context.ch); context._cmp(context.ch, 80); if (!context.flags.z()) goto findopen1a; - return; } void obtoinv(Context &context) { @@ -6512,7 +6364,6 @@ finishfill: context.si = context.pop(); context.es = context.pop(); context.bx = context.pop(); - return; } void isitworn(Context &context) { @@ -6530,7 +6381,6 @@ void makeworn(Context &context) { STACK_CHECK(context); context.es.byte(context.bx+12) = 'W'-'A'; context.es.byte(context.bx+13) = 'E'-'A'; - return; } void examineob(Context &context) { @@ -6596,7 +6446,6 @@ iswatching: justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; } void makemainscreen(Context &context) { @@ -6615,7 +6464,6 @@ void makemainscreen(Context &context) { worktoscreenm(context); context.data.byte(kCommandtype) = 200; context.data.byte(kManisoffscreen) = 0; - return; } void getbackfromob(Context &context) { @@ -6626,7 +6474,6 @@ void getbackfromob(Context &context) { return; notheldob: getback1(context); - return; } void incryanpage(Context &context) { @@ -6658,7 +6505,6 @@ findnewpage: showpointer(context); worktoscreen(context); delpointer(context); - return; } void openinv(Context &context) { @@ -6671,7 +6517,6 @@ void openinv(Context &context) { printmessage(context); fillryan(context); context.data.byte(kCommandtype) = 255; - return; } void showryanpage(Context &context) { @@ -6696,7 +6541,6 @@ void showryanpage(Context &context) { context.ax = context.pop(); context.ah = 0; showframe(context); - return; } void openob(Context &context) { @@ -6728,7 +6572,6 @@ void openob(Context &context) { context._add(context.ax, (80)); context.bx = 2588; context.cs.word(context.bx) = context.ax; - return; } void obicons(Context &context) { @@ -6750,7 +6593,6 @@ cantopenit: context.al = 1; context.ah = 0; showframe(context); - return; } void examicon(Context &context) { @@ -6761,7 +6603,6 @@ void examicon(Context &context) { context.al = 3; context.ah = 0; showframe(context); - return; } void obpicture(Context &context) { @@ -6794,7 +6635,6 @@ exframe: context._inc(context.al); context.ah = 128; showframe(context); - return; } void describeob(Context &context) { @@ -6816,7 +6656,6 @@ void describeob(Context &context) { obsthatdothings(context); context.bx = context.pop(); additionaltext(context); - return; } void additionaltext(Context &context) { @@ -6858,7 +6697,6 @@ fullcup: context.dl = 241; context.ah = 0; printdirect(context); - return; } void obsthatdothings(Context &context) { @@ -6925,7 +6763,6 @@ cantmakeoneup: findsometext: searchforsame(context); goto tryagain; - return; } void searchforsame(Context &context) { @@ -6964,7 +6801,6 @@ keepchecking: foundmatch: context.si = context.pop(); context.bx = context.pop(); - return; } void findnextcolon(Context &context) { @@ -7148,7 +6984,6 @@ pickupexob: context.data.byte(kOpenedob) = 255; openinv(context); worktoscreenm(context); - return; } void examinventory(Context &context) { @@ -7173,7 +7008,6 @@ doexinv: context.data.byte(kInvopen) = 2; openinv(context); worktoscreenm(context); - return; } void reexfrominv(Context &context) { @@ -7184,7 +7018,6 @@ void reexfrominv(Context &context) { context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - return; } void reexfromopen(Context &context) { @@ -7196,7 +7029,6 @@ void reexfromopen(Context &context) { context.data.byte(kCommand) = context.al; context.data.byte(kExamagain) = 1; context.data.byte(kPointermode) = 0; - return; } void swapwithinv(Context &context) { @@ -7254,7 +7086,6 @@ doswap1: showpointer(context); worktoscreen(context); delpointer(context); - return; } void swapwithopen(Context &context) { @@ -7349,7 +7180,6 @@ actuallyswap: showpointer(context); worktoscreen(context); delpointer(context); - return; } void intoinv(Context &context) { @@ -7401,7 +7231,6 @@ doplace: outofinv(context); worktoscreen(context); delpointer(context); - return; } void deletetaken(Context &context) { @@ -7425,7 +7254,6 @@ takenloop: notinhere: context._add(context.si, 16); if (--context.cx) goto takenloop; - return; } void outofinv(Context &context) { @@ -7477,7 +7305,6 @@ dograb: intoinv(context); worktoscreen(context); delpointer(context); - return; } void getfreead(Context &context) { @@ -7487,7 +7314,6 @@ void getfreead(Context &context) { context._shl(context.ax, context.cl); context.bx = context.ax; context.es = context.data.word(kFreedat); - return; } void getexad(Context &context) { @@ -7498,7 +7324,6 @@ void getexad(Context &context) { context.bx = context.ax; context.es = context.data.word(kExtras); context._add(context.bx, (0+2080+30000)); - return; } void geteitherad(Context &context) { @@ -7511,7 +7336,6 @@ void geteitherad(Context &context) { isinexlist: context.al = context.data.byte(kItemframe); getexad(context); - return; } void getanyad(Context &context) { @@ -7533,7 +7357,6 @@ isex: context.al = context.data.byte(kCommand); getexad(context); context.ax = context.es.word(context.bx+7); - return; } void getanyaddir(Context &context) { @@ -7549,7 +7372,6 @@ isfree3: return; isex3: getexad(context); - return; } void getopenedsize(Context &context) { @@ -7571,7 +7393,6 @@ isex2: context.al = context.data.byte(kOpenedob); getexad(context); context.ax = context.es.word(context.bx+7); - return; } void getsetad(Context &context) { @@ -7581,7 +7402,6 @@ void getsetad(Context &context) { context._mul(context.bx); context.bx = context.ax; context.es = context.data.word(kSetdat); - return; } void findinvpos(Context &context) { @@ -7610,7 +7430,6 @@ findinv2: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10)+32)); - return; } void findopenpos(Context &context) { @@ -7627,7 +7446,6 @@ findopenp1: context._add(context.bx, context.bx); context.es = context.data.word(kBuffers); context._add(context.bx, (0+(180*10))); - return; } void dropobject(Context &context) { @@ -7719,7 +7537,6 @@ notinlift: context.data.byte(kPickup) = 0; context.al = context.data.byte(kReallocation); context.es.byte(context.bx) = context.al; - return; } void droperror(Context &context) { @@ -7739,7 +7556,6 @@ void droperror(Context &context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; } void cantdrop(Context &context) { @@ -7759,7 +7575,6 @@ void cantdrop(Context &context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; } void wornerror(Context &context) { @@ -7779,7 +7594,6 @@ void wornerror(Context &context) { examicon(context); context.data.byte(kCommandtype) = 255; worktoscreenm(context); - return; } void removeobfrominv(Context &context) { @@ -7836,7 +7650,6 @@ doopenob: showpointer(context); worktoscreen(context); delpointer(context); - return; } void useopened(Context &context) { @@ -7921,7 +7734,6 @@ sizeok1: showpointer(context); worktoscreen(context); delpointer(context); - return; } void errormessage1(Context &context) { @@ -7946,7 +7758,6 @@ void errormessage1(Context &context) { showpointer(context); worktoscreen(context); delpointer(context); - return; } void errormessage2(Context &context) { @@ -7972,7 +7783,6 @@ void errormessage2(Context &context) { showpointer(context); worktoscreen(context); delpointer(context); - return; } void errormessage3(Context &context) { @@ -7994,7 +7804,6 @@ void errormessage3(Context &context) { showpointer(context); worktoscreen(context); delpointer(context); - return; } void checkobjectsize(Context &context) { @@ -8036,7 +7845,6 @@ sizewrong: return; sizeok: context.al = 0; - return; } void outofopen(Context &context) { @@ -8100,7 +7908,6 @@ actuallyout: showpointer(context); worktoscreen(context); delpointer(context); - return; } void transfertoex(Context &context) { @@ -8142,7 +7949,6 @@ void transfertoex(Context &context) { context.ds.byte(context.si+2) = 254; pickupconts(context); context.ax = context.pop(); - return; } void pickupconts(Context &context) { @@ -8210,7 +8016,6 @@ void transfercontoex(Context &context) { context.si = context.pop(); context.ds = context.pop(); context.ds.byte(context.si+2) = 255; - return; } void transfertext(Context &context) { @@ -8239,7 +8044,6 @@ moretext: context._inc(context.data.word(kExtextpos)); context._cmp(context.al, 0); if (!context.flags.z()) goto moretext; - return; } void getexpos(Context &context) { @@ -8256,7 +8060,6 @@ tryanotherex: if (!context.flags.z()) goto tryanotherex; foundnewex: context.data.byte(kExpos) = context.al; - return; } void purgealocation(Context &context) { @@ -8285,7 +8088,6 @@ dontpurge: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto purgeloc; - return; } void emergencypurge(Context &context) { @@ -8348,7 +8150,6 @@ cantpurge2: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto lookforpurge2; - return; } void deleteexobject(Context &context) { @@ -8393,7 +8194,6 @@ notinsideex: context._inc(context.cx); context._cmp(context.cx, (114)); if (!context.flags.z()) goto deleteconts; - return; } void deleteexframe(Context &context) { @@ -8433,7 +8233,6 @@ beforethisone: context.es.word(context.di+2) = context.ax; context._add(context.di, 6); if (--context.cx) goto shuffleadsdown; - return; } void deleteextext(Context &context) { @@ -8475,7 +8274,6 @@ beforethistext: context.es.word(context.di) = context.ax; context._add(context.di, 2); if (--context.cx) goto shuffletextads; - return; } void blockget(Context &context) { @@ -8485,7 +8283,6 @@ void blockget(Context &context) { context.ds = context.data.word(kBackdrop); context.si = (0+192); context._add(context.si, context.ax); - return; } void drawfloor(Context &context) { @@ -8504,7 +8301,6 @@ void drawfloor(Context &context) { context.data.byte(kNewobs) = 0; context.bx = context.pop(); context.es = context.pop(); - return; } void calcmapad(Context &context) { @@ -8532,7 +8328,6 @@ void calcmapad(Context &context) { context._mul(context.bx); context._add(context.ax, context.data.word(kMapoffsety)); context.data.word(kMapady) = context.ax; - return; } void getdimension(Context &context) { @@ -8613,7 +8408,6 @@ finishdim4: context._shl(context.ax, 1); context._shl(context.ax, 1); context.data.byte(kMapysize) = context.al; - return; } void addalong(Context &context) { @@ -8629,7 +8423,6 @@ addloop: return; gotalong: context.al = 1; - return; } void addlength(Context &context) { @@ -8645,7 +8438,6 @@ addloop2: return; gotlength: context.al = 1; - return; } void drawflags(Context &context) { @@ -8683,7 +8475,6 @@ _tmp28a: context._add(context.si, (66)-11); context.cx = context.pop(); if (--context.cx) goto _tmp28; - return; } void eraseoldobs(Context &context) { @@ -9027,7 +8818,6 @@ nullframe: context.ax = context.pop(); context.cx = 0; context.data.word(kSavesize) = context.cx; - return; } void finalframe(Context &context) { @@ -9040,7 +8830,6 @@ void finalframe(Context &context) { context.data.byte(kSavey) = context.al; context.di = context.data.word(kObjectx); context.bx = context.data.word(kObjecty); - return; } void adjustlen(Context &context) { @@ -9093,7 +8882,6 @@ void getxad(Context &context) { return; over148: context.ch = 0; - return; } void getyad(Context &context) { @@ -9114,7 +8902,6 @@ void getyad(Context &context) { return; over147: context.ch = 0; - return; } void autolook(Context &context) { @@ -9135,7 +8922,6 @@ noautolook: return; diffmouse: context.data.word(kLookcounter) = 1000; - return; } void look(Context &context) { @@ -9194,7 +8980,6 @@ afterlook: context.data.byte(kCommandtype) = 0; redrawmainscrn(context); worktoscreenm(context); - return; } void redrawmainscrn(Context &context) { @@ -9210,7 +8995,6 @@ void redrawmainscrn(Context &context) { undertextline(context); readmouse(context); context.data.byte(kCommandtype) = 255; - return; } void getback1(Context &context) { @@ -9236,7 +9020,6 @@ nogetback: dogetback: context.data.byte(kGetback) = 1; context.data.byte(kPickup) = 0; - return; } void talk(Context &context) { @@ -9302,7 +9085,6 @@ void convicons(Context &context) { context._sub(context.ax, context.data.word(kTakeoff)); context.ah = 0; showframe(context); - return; } void getpersframe(Context &context) { @@ -9313,7 +9095,6 @@ void getpersframe(Context &context) { context.es = context.data.word(kPeople); context._add(context.bx, (0)); context.ax = context.es.word(context.bx); - return; } void starttalk(Context &context) { @@ -9368,7 +9149,6 @@ void getpersontext(Context &context) { context.ax = context.es.word(context.si); context._add(context.ax, context.cx); context.si = context.ax; - return; } void moretalk(Context &context) { @@ -9399,7 +9179,6 @@ domoretalk: context.data.byte(kTalkpos) = 48; notsecondpart: dosometalk(context); - return; } void dosometalk(Context &context) { @@ -9532,7 +9311,6 @@ skiptalk2: goto dospeech; endheartalk: context.data.byte(kPointermode) = 0; - return; } void hangonpq(Context &context) { @@ -9577,8 +9355,7 @@ quitconv: context.data.byte(kPointermode) = 0; cancelch1(context); context.flags._c = true; - return; -} + } void redes(Context &context) { STACK_CHECK(context); @@ -9612,7 +9389,6 @@ doredes: showpointer(context); worktoscreen(context); delpointer(context); - return; } void newplace(Context &context) { @@ -9630,7 +9406,6 @@ isautoloc: istravel: context.data.byte(kNeedtotravel) = 0; selectlocation(context); - return; } void selectlocation(Context &context) { @@ -9690,7 +9465,6 @@ quittravel: getridoftemp3(context); context.es = context.data.word(kTraveltext); deallocatemem(context); - return; } void showcity(Context &context) { @@ -9708,7 +9482,6 @@ void showcity(Context &context) { context.al = 1; context.ah = 0; showframe(context); - return; } void lookatplace(Context &context) { @@ -9776,7 +9549,6 @@ void getundercentre(Context &context) { context.cl = 254; context.ch = 110; multiget(context); - return; } void putundercentre(Context &context) { @@ -9788,7 +9560,6 @@ void putundercentre(Context &context) { context.cl = 254; context.ch = 110; multiput(context); - return; } void locationpic(Context &context) { @@ -9835,7 +9606,6 @@ notinthisone: context.al = 0; context.ah = 0; printdirect(context); - return; } void getdestinfo(Context &context) { @@ -9855,7 +9625,6 @@ void getdestinfo(Context &context) { context.si = 8027; context._add(context.si, context.ax); context.ax = context.pop(); - return; } void showarrows(Context &context) { @@ -9878,7 +9647,6 @@ void showarrows(Context &context) { context.al = 2; context.ah = 0; showframe(context); - return; } void nextdest(Context &context) { @@ -9987,7 +9755,6 @@ void getlocation(Context &context) { context.es = context.dx; context._add(context.bx, 8011); context.al = context.es.byte(context.bx); - return; } void setlocation(Context &context) { @@ -9998,7 +9765,6 @@ void setlocation(Context &context) { context.es = context.dx; context._add(context.bx, 8011); context.es.byte(context.bx) = 1; - return; } void resetlocation(Context &context) { @@ -10046,7 +9812,6 @@ clearedlocations: context.es = context.dx; context._add(context.bx, 8011); context.es.byte(context.bx) = 0; - return; } void readdesticon(Context &context) { @@ -10057,14 +9822,12 @@ void readdesticon(Context &context) { loadintotemp2(context); context.dx = 1961; loadintotemp3(context); - return; } void readcitypic(Context &context) { STACK_CHECK(context); context.dx = 2000; loadintotemp(context); - return; } void usemon(Context &context) { @@ -10155,7 +9918,6 @@ endmon: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - return; } void printoutermon(Context &context) { @@ -10184,7 +9946,6 @@ void printoutermon(Context &context) { context.al = 4; context.ah = 0; showframe(context); - return; } void loadpersonal(Context &context) { @@ -10212,7 +9973,6 @@ foundpersonal: context.dx = 0; readfromfile(context); closefile(context); - return; } void loadnews(Context &context) { @@ -10242,7 +10002,6 @@ foundnews: context.dx = 0; readfromfile(context); closefile(context); - return; } void loadcart(Context &context) { @@ -10275,7 +10034,6 @@ gotcart: context.dx = 0; readfromfile(context); closefile(context); - return; } void lookininterface(Context &context) { @@ -10294,7 +10052,6 @@ void lookininterface(Context &context) { return; emptyinterface: context.al = 0; - return; } void turnonpower(Context &context) { @@ -10311,7 +10068,6 @@ powerloop: context.cx = context.pop(); if (--context.cx) goto powerloop; powerlighton(context); - return; } void randomaccess(Context &context) { @@ -10332,7 +10088,6 @@ chosenaccess: context.cx = context.pop(); if (--context.cx) goto accessloop; accesslightoff(context); - return; } void powerlighton(Context &context) { @@ -10350,7 +10105,6 @@ void powerlighton(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void powerlightoff(Context &context) { @@ -10368,7 +10122,6 @@ void powerlightoff(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void accesslighton(Context &context) { @@ -10386,7 +10139,6 @@ void accesslighton(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void accesslightoff(Context &context) { @@ -10404,7 +10156,6 @@ void accesslightoff(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void locklighton(Context &context) { @@ -10422,7 +10173,6 @@ void locklighton(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void locklightoff(Context &context) { @@ -10440,7 +10190,6 @@ void locklightoff(Context &context) { context.cl = 12; context.ch = 8; multidump(context); - return; } void input(Context &context) { @@ -10568,7 +10317,6 @@ void delchar(Context &context) { context.cl = context.al; context.ch = 8; multidump(context); - return; } void execcommand(Context &context) { @@ -10642,7 +10390,6 @@ testcom: return; quitcom: context.al = 1; - return; } void neterror(Context &context) { @@ -10650,7 +10397,6 @@ void neterror(Context &context) { context.al = 5; monmessage(context); scrollmonitor(context); - return; } void dircom(Context &context) { @@ -10683,7 +10429,6 @@ dirroot: context.es = context.data.word(kTextfile3); searchforfiles(context); scrollmonitor(context); - return; } void searchforfiles(Context &context) { @@ -10795,7 +10540,6 @@ passpassed: context.bx = context.pop(); context.es = context.pop(); context.es.byte(context.bx) = 1; - return; } void showkeys(Context &context) { @@ -10821,7 +10565,6 @@ notheld: context._add(context.bx, 26); if (--context.cx) goto keysloop; scrollmonitor(context); - return; } void read(Context &context) { @@ -10904,7 +10647,6 @@ moretopic: goto moretopic; endoftopic: scrollmonitor(context); - return; } void dirfile(Context &context) { @@ -10976,7 +10718,6 @@ directloop2: goto directloop2; endofdir2: scrollmonitor(context); - return; } void getkeyandlogo(Context &context) { @@ -11021,7 +10762,6 @@ keyok: context.al = context.data.byte(kNewlogonum); context.data.byte(kLogonum) = context.al; context.al = 0; - return; } void searchforstring(Context &context) { @@ -11060,7 +10800,6 @@ complete: return; notfound: context.al = 1; - return; } void parser(Context &context) { @@ -11095,7 +10834,6 @@ copyin1: if (!context.flags.z()) goto copyin1; finishpars: context.di = 2942; - return; } void scrollmonitor(Context &context) { @@ -11124,7 +10862,6 @@ void scrollmonitor(Context &context) { context.cx = context.pop(); context.bx = context.pop(); context.ax = context.pop(); - return; } void lockmon(Context &context) { @@ -11158,7 +10895,6 @@ void monitorlogo(Context &context) { return; notnewlogo: printlogo(context); - return; } void printlogo(Context &context) { @@ -11170,7 +10906,6 @@ void printlogo(Context &context) { context.ah = 0; showframe(context); showcurrentfile(context); - return; } void showcurrentfile(Context &context) { @@ -11206,7 +10941,6 @@ monmessageloop: if (!context.flags.z()) goto monmessageloop; if (--context.cx) goto monmessageloop; monprint(context); - return; } void processtrigger(Context &context) { @@ -11268,7 +11002,6 @@ void triggermessage(Context &context) { multiput(context); worktoscreen(context); context.data.byte(kLasttrigger) = 0; - return; } void printcurs(Context &context) { @@ -11314,7 +11047,6 @@ flashcurs: context.ds = context.pop(); context.di = context.pop(); context.si = context.pop(); - return; } void delcurs(Context &context) { @@ -11346,7 +11078,6 @@ finishcurdel: context.di = context.pop(); context.bx = context.pop(); context.es = context.pop(); - return; } void useobject(Context &context) { @@ -11369,7 +11100,6 @@ nouse: return; douse: useroutine(context); - return; } void useroutine(Context &context) { @@ -11445,7 +11175,6 @@ cantuse2: hangonp(context); putbackobstuff(context); context.data.byte(kCommandtype) = 255; - return; } void wheelsound(Context &context) { @@ -11454,7 +11183,6 @@ void wheelsound(Context &context) { playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; } void runtap(Context &context) { @@ -11501,7 +11229,6 @@ cupfromtapfull: context.al = 58; showpuztext(context); putbackobstuff(context); - return; } void playguitar(Context &context) { @@ -11510,7 +11237,6 @@ void playguitar(Context &context) { playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; } void hotelcontrol(Context &context) { @@ -11525,7 +11251,6 @@ void hotelcontrol(Context &context) { notrightcont: showseconduse(context); putbackobstuff(context); - return; } void hotelbell(Context &context) { @@ -11534,7 +11259,6 @@ void hotelbell(Context &context) { playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; } void opentomb(Context &context) { @@ -11547,7 +11271,6 @@ void opentomb(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void usetrainer(Context &context) { @@ -11562,7 +11285,6 @@ void usetrainer(Context &context) { return; notheldtrainer: nothelderror(context); - return; } void nothelderror(Context &context) { @@ -11582,7 +11304,6 @@ void nothelderror(Context &context) { context.cx = 50; hangonp(context); putbackobstuff(context); - return; } void usepipe(Context &context) { @@ -11627,7 +11348,6 @@ alreadyfull: context.al = 35; showpuztext(context); putbackobstuff(context); - return; } void usefullcart(Context &context) { @@ -11650,7 +11370,6 @@ void usefullcart(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void useplinth(Context &context) { @@ -11682,7 +11401,6 @@ isrightkey: context.data.byte(kGetback) = 1; context.al = context.data.byte(kRoomafterdream); context.data.byte(kNewlocation) = context.al; - return; } void chewy(Context &context) { @@ -11691,7 +11409,6 @@ void chewy(Context &context) { getanyad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - return; } void useladder(Context &context) { @@ -11707,7 +11424,6 @@ void useladder(Context &context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - return; } void useladderb(Context &context) { @@ -11723,7 +11439,6 @@ void useladderb(Context &context) { findxyfrompath(context); context.data.byte(kResetmanxy) = 1; context.data.byte(kGetback) = 1; - return; } void slabdoora(Context &context) { @@ -11745,7 +11460,6 @@ slabawrong: context.data.word(kEndwatchreel) = 34; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void slabdoorb(Context &context) { @@ -11784,7 +11498,6 @@ slabbwrong: context.data.word(kEndwatchreel) = 63; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void slabdoord(Context &context) { @@ -11806,7 +11519,6 @@ slabcwrong: context.data.word(kEndwatchreel) = 94; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void slabdoorc(Context &context) { @@ -11828,7 +11540,6 @@ slabdwrong: context.data.word(kEndwatchreel) = 127; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void slabdoore(Context &context) { @@ -11850,7 +11561,6 @@ slabewrong: context.data.word(kEndwatchreel) = 160; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void slabdoorf(Context &context) { @@ -11872,7 +11582,6 @@ slabfwrong: context.data.word(kEndwatchreel) = 189; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void useslab(Context &context) { @@ -11920,7 +11629,6 @@ notlastslab: context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kGetback) = 1; - return; } void usecart(Context &context) { @@ -11958,7 +11666,6 @@ nextcart: playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - return; } void useclearbox(Context &context) { @@ -11990,7 +11697,6 @@ openbox: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void usecoveredbox(Context &context) { @@ -12003,7 +11709,6 @@ void usecoveredbox(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void userailing(Context &context) { @@ -12016,7 +11721,6 @@ void userailing(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; context.data.byte(kMandead) = 4; - return; } void useopenbox(Context &context) { @@ -12066,7 +11770,6 @@ openboxwrong: context.al = 38; showpuztext(context); putbackobstuff(context); - return; } void wearwatch(Context &context) { @@ -12082,7 +11785,6 @@ void wearwatch(Context &context) { wearingwatch: showseconduse(context); putbackobstuff(context); - return; } void wearshades(Context &context) { @@ -12098,7 +11800,6 @@ void wearshades(Context &context) { wearingshades: showseconduse(context); putbackobstuff(context); - return; } void sitdowninbar(Context &context) { @@ -12118,7 +11819,6 @@ void sitdowninbar(Context &context) { satdown: showseconduse(context); putbackobstuff(context); - return; } void usechurchhole(Context &context) { @@ -12130,7 +11830,6 @@ void usechurchhole(Context &context) { context.data.word(kEndwatchreel) = 26; context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; - return; } void usehole(Context &context) { @@ -12162,7 +11861,6 @@ righthand: context.es.byte(context.bx+2) = 255; context.data.byte(kCanmovealtar) = 1; context.data.byte(kGetback) = 1; - return; } void usealtar(Context &context) { @@ -12207,7 +11905,6 @@ movealtar: thingsonaltar: showfirstuse(context); context.data.byte(kGetback) = 1; - return; } void opentvdoor(Context &context) { @@ -12234,7 +11931,6 @@ keyontv: showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - return; } void usedryer(Context &context) { @@ -12243,7 +11939,6 @@ void usedryer(Context &context) { playchannel1(context); showfirstuse(context); context.data.byte(kGetback) = 1; - return; } void openlouis(Context &context) { @@ -12254,7 +11949,6 @@ void openlouis(Context &context) { context.ch = 8; entercode(context); context.data.byte(kGetback) = 1; - return; } void nextcolon(Context &context) { @@ -12264,7 +11958,6 @@ lookcolon: context._inc(context.si); context._cmp(context.al, ':'); if (!context.flags.z()) goto lookcolon; - return; } void openyourneighbour(Context &context) { @@ -12275,7 +11968,6 @@ void openyourneighbour(Context &context) { context.ch = 255; entercode(context); context.data.byte(kGetback) = 1; - return; } void usewindow(Context &context) { @@ -12290,7 +11982,6 @@ void usewindow(Context &context) { notonbalc: showseconduse(context); putbackobstuff(context); - return; } void usebalcony(Context &context) { @@ -12323,7 +12014,6 @@ void usebalcony(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void openryan(Context &context) { @@ -12334,7 +12024,6 @@ void openryan(Context &context) { context.ch = 6; entercode(context); context.data.byte(kGetback) = 1; - return; } void openpoolboss(Context &context) { @@ -12345,7 +12034,6 @@ void openpoolboss(Context &context) { context.ch = 2; entercode(context); context.data.byte(kGetback) = 1; - return; } void openeden(Context &context) { @@ -12356,7 +12044,6 @@ void openeden(Context &context) { context.ch = 5; entercode(context); context.data.byte(kGetback) = 1; - return; } void opensarters(Context &context) { @@ -12367,7 +12054,6 @@ void opensarters(Context &context) { context.ch = 3; entercode(context); context.data.byte(kGetback) = 1; - return; } void isitright(Context &context) { @@ -12392,7 +12078,6 @@ void drawitall(Context &context) { drawfloor(context); printsprites(context); showicon(context); - return; } void openhoteldoor(Context &context) { @@ -12421,7 +12106,6 @@ keyonhotel1: showfirstuse(context); context.data.byte(kLockstatus) = 0; context.data.byte(kGetback) = 1; - return; } void openhoteldoor2(Context &context) { @@ -12449,7 +12133,6 @@ keyonhotel2: playchannel1(context); showfirstuse(context); putbackobstuff(context); - return; } void grafittidoor(Context &context) { @@ -12475,7 +12158,6 @@ grafwith: dograf: showfirstuse(context); putbackobstuff(context); - return; } void trapdoor(Context &context) { @@ -12490,7 +12172,6 @@ void trapdoor(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void callhotellift(Context &context) { @@ -12505,7 +12186,6 @@ void callhotellift(Context &context) { autosetwalk(context); context.al = 4; turnpathon(context); - return; } void calledenslift(Context &context) { @@ -12515,7 +12195,6 @@ void calledenslift(Context &context) { context.data.byte(kGetback) = 1; context.al = 2; turnpathon(context); - return; } void calledensdlift(Context &context) { @@ -12531,7 +12210,6 @@ void calledensdlift(Context &context) { edensdhere: showseconduse(context); putbackobstuff(context); - return; } void usepoolreader(Context &context) { @@ -12566,7 +12244,6 @@ canopenpool: showfirstuse(context); context.data.byte(kCounttoopen) = 6; context.data.byte(kGetback) = 1; - return; } void uselighter(Context &context) { @@ -12595,7 +12272,6 @@ cigarette: getexad(context); context.es.byte(context.bx+2) = 255; context.data.byte(kGetback) = 1; - return; } void showseconduse(Context &context) { @@ -12607,7 +12283,6 @@ void showseconduse(Context &context) { usetext(context); context.cx = 400; hangonp(context); - return; } void usecardreader1(Context &context) { @@ -12653,7 +12328,6 @@ getscash: notyet: showfirstuse(context); putbackobstuff(context); - return; } void usecardreader2(Context &context) { @@ -12710,7 +12384,6 @@ alreadygotnew: notyetboss: showfirstuse(context); putbackobstuff(context); - return; } void usecardreader3(Context &context) { @@ -12757,7 +12430,6 @@ alreadyusedit: notyetrecep: showfirstuse(context); putbackobstuff(context); - return; } void usecashcard(Context &context) { @@ -12810,7 +12482,6 @@ void usecashcard(Context &context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - return; } void lookatcard(Context &context) { @@ -12862,7 +12533,6 @@ void lookatcard(Context &context) { getridoftemp(context); restorereels(context); putbackobstuff(context); - return; } void moneypoke(Context &context) { @@ -12902,7 +12572,6 @@ numberpoke3: context.bx = 3479; context._add(context.al, 48); context.cs.byte(context.bx) = context.al; - return; } void usecontrol(Context &context) { @@ -12993,7 +12662,6 @@ axeoncontrols: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); putbackobstuff(context); - return; } void usehatch(Context &context) { @@ -13001,7 +12669,6 @@ void usehatch(Context &context) { showfirstuse(context); context.data.byte(kNewlocation) = 40; context.data.byte(kGetback) = 1; - return; } void usewire(Context &context) { @@ -13048,7 +12715,6 @@ wireknife: showpuztext(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kGetback) = 1; - return; } void usehandle(Context &context) { @@ -13072,7 +12738,6 @@ havecutwire: showpuztext(context); context.data.byte(kNewlocation) = 22; context.data.byte(kGetback) = 1; - return; } void useelevator1(Context &context) { @@ -13080,7 +12745,6 @@ void useelevator1(Context &context) { showfirstuse(context); selectlocation(context); context.data.byte(kGetback) = 1; - return; } void showfirstuse(Context &context) { @@ -13091,7 +12755,6 @@ void showfirstuse(Context &context) { usetext(context); context.cx = 400; hangonp(context); - return; } void useelevator3(Context &context) { @@ -13105,7 +12768,6 @@ void useelevator3(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; } void useelevator4(Context &context) { @@ -13119,7 +12781,6 @@ void useelevator4(Context &context) { context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; context.data.byte(kNewlocation) = 24; - return; } void useelevator2(Context &context) { @@ -13140,7 +12801,6 @@ inpoolhall: context.data.byte(kCounttoopen) = 0; context.data.word(kWatchingtime) = 80; context.data.byte(kGetback) = 1; - return; } void useelevator5(Context &context) { @@ -13154,7 +12814,6 @@ void useelevator5(Context &context) { context.data.byte(kLiftflag) = 1; context.data.byte(kCounttoclose) = 8; context.data.byte(kGetback) = 1; - return; } void usekey(Context &context) { @@ -13200,7 +12859,6 @@ wrongroom1: context.al = 2; showpuztext(context); putbackobstuff(context); - return; } void usestereo(Context &context) { @@ -13258,7 +12916,6 @@ stereoon: context.cx = 400; showpuztext(context); putbackobstuff(context); - return; } void usecooker(Context &context) { @@ -13274,7 +12931,6 @@ void usecooker(Context &context) { foodinside: showseconduse(context); putbackobstuff(context); - return; } void useaxe(Context &context) { @@ -13291,8 +12947,7 @@ void useaxe(Context &context) { return; notinpool: showfirstuse(context); - return; -/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ +/*continuing to unbounded code: axeondoor from useelvdoor:19-29*/ axeondoor: context.al = 15; context.cx = 300; @@ -13305,7 +12960,6 @@ axeondoor: context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; return; - return; } void useelvdoor(Context &context) { @@ -13339,7 +12993,6 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void withwhat(Context &context) { @@ -13382,7 +13035,6 @@ void withwhat(Context &context) { worktoscreen(context); delpointer(context); context.data.byte(kInvopen) = 2; - return; } void selectob(Context &context) { @@ -13418,7 +13070,6 @@ doselob: delpointer(context); context.data.byte(kInvopen) = 0; useroutine(context); - return; } void compare(Context &context) { @@ -13465,7 +13116,6 @@ nofind: context._cmp(context.dl, 128); if (!context.flags.z()) goto findsetloop; context.al = context.dl; - return; } void findexobject(Context &context) { @@ -13494,7 +13144,6 @@ nofindex: context._cmp(context.dl, (114)); if (!context.flags.z()) goto findexloop; context.al = context.dl; - return; } void isryanholding(Context &context) { @@ -13527,7 +13176,6 @@ nofindininv: if (!context.flags.z()) goto searchinv; context.al = context.dl; context._cmp(context.al, (114)); - return; } void checkinside(Context &context) { @@ -13546,7 +13194,6 @@ notfoundinside: context._inc(context.cl); context._cmp(context.cl, (114)); if (!context.flags.z()) goto insideloop; - return; } void usetext(Context &context) { @@ -13567,7 +13214,6 @@ void usetext(Context &context) { context.ah = 0; printdirect(context); worktoscreenm(context); - return; } void putbackobstuff(Context &context) { @@ -13585,7 +13231,6 @@ void putbackobstuff(Context &context) { showpointer(context); worktoscreen(context); delpointer(context); - return; } void showpuztext(Context &context) { @@ -13609,7 +13254,6 @@ void showpuztext(Context &context) { worktoscreenm(context); context.cx = context.pop(); hangonp(context); - return; } void findpuztext(Context &context) { @@ -13621,7 +13265,6 @@ void findpuztext(Context &context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - return; } void placesetobject(Context &context) { @@ -13635,7 +13278,6 @@ void placesetobject(Context &context) { context.es.byte(context.bx+58) = 0; context.bx = context.pop(); context.es = context.pop(); - return; } void removesetobject(Context &context) { @@ -13649,7 +13291,6 @@ void removesetobject(Context &context) { context.es.byte(context.bx+58) = 255; context.bx = context.pop(); context.es = context.pop(); - return; } void issetobonmap(Context &context) { @@ -13661,7 +13302,6 @@ void issetobonmap(Context &context) { context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, 0); - return; } void placefreeobject(Context &context) { @@ -13675,7 +13315,6 @@ void placefreeobject(Context &context) { context.es.byte(context.bx+2) = 0; context.bx = context.pop(); context.es = context.pop(); - return; } void removefreeobject(Context &context) { @@ -13686,7 +13325,6 @@ void removefreeobject(Context &context) { context.es.byte(context.bx+2) = 255; context.bx = context.pop(); context.es = context.pop(); - return; } void findormake(Context &context) { @@ -13713,19 +13351,16 @@ haventfound: context.es.word(context.bx) = context.ax; context.es.word(context.bx+2) = context.cx; context.ax = context.pop(); - return; } void switchryanon(Context &context) { STACK_CHECK(context); context.data.byte(kRyanon) = 255; - return; } void switchryanoff(Context &context) { STACK_CHECK(context); context.data.byte(kRyanon) = 1; - return; } void setallchanges(Context &context) { @@ -13872,7 +13507,6 @@ void getundertimed(Context &context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; } void putundertimed(Context &context) { @@ -13888,7 +13522,6 @@ void putundertimed(Context &context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; } void dumptimedtext(Context &context) { @@ -13999,7 +13632,6 @@ notext: deltimedtext: putundertimed(context); context.data.byte(kNeedtodumptimed) = 1; - return; } void edenscdplayer(Context &context) { @@ -14011,7 +13643,6 @@ void edenscdplayer(Context &context) { context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void usewall(Context &context) { @@ -14067,7 +13698,6 @@ gobackover: findxyfrompath(context); context.data.byte(kResetmanxy) = 1; switchryanoff(context); - return; } void usechurchgate(Context &context) { @@ -14262,7 +13892,6 @@ pathoktv: nottvsoldier: showfirstuse(context); putbackobstuff(context); - return; } void useshield(Context &context) { @@ -14280,7 +13909,6 @@ void useshield(Context &context) { notinsartroom: showfirstuse(context); putbackobstuff(context); - return; } void usebuttona(Context &context) { @@ -14308,7 +13936,6 @@ void usebuttona(Context &context) { donethisbit: showseconduse(context); putbackobstuff(context); - return; } void useplate(Context &context) { @@ -14359,7 +13986,6 @@ triedknife: context.al = 54; showpuztext(context); putbackobstuff(context); - return; } void usewinch(Context &context) { @@ -14394,7 +14020,6 @@ void usewinch(Context &context) { nowinch: showfirstuse(context); putbackobstuff(context); - return; } void entercode(Context &context) { @@ -14467,14 +14092,12 @@ numberright: restorereels(context); redrawmainscrn(context); worktoscreenm(context); - return; } void loadkeypad(Context &context) { STACK_CHECK(context); context.dx = 1948; loadintotemp(context); - return; } void quitkey(Context &context) { @@ -14494,7 +14117,6 @@ notqk: return; doqk: context.data.byte(kGetback) = 1; - return; } void addtopresslist(Context &context) { @@ -14520,77 +14142,66 @@ void buttonone(Context &context) { STACK_CHECK(context); context.cl = 1; buttonpress(context); - return; } void buttontwo(Context &context) { STACK_CHECK(context); context.cl = 2; buttonpress(context); - return; } void buttonthree(Context &context) { STACK_CHECK(context); context.cl = 3; buttonpress(context); - return; } void buttonfour(Context &context) { STACK_CHECK(context); context.cl = 4; buttonpress(context); - return; } void buttonfive(Context &context) { STACK_CHECK(context); context.cl = 5; buttonpress(context); - return; } void buttonsix(Context &context) { STACK_CHECK(context); context.cl = 6; buttonpress(context); - return; } void buttonseven(Context &context) { STACK_CHECK(context); context.cl = 7; buttonpress(context); - return; } void buttoneight(Context &context) { STACK_CHECK(context); context.cl = 8; buttonpress(context); - return; } void buttonnine(Context &context) { STACK_CHECK(context); context.cl = 9; buttonpress(context); - return; } void buttonnought(Context &context) { STACK_CHECK(context); context.cl = 10; buttonpress(context); - return; } void buttonenter(Context &context) { STACK_CHECK(context); context.cl = 11; buttonpress(context); - return; } void buttonpress(Context &context) { @@ -14640,7 +14251,6 @@ void showouterpad(Context &context) { context.al = 37; context.ah = 0; showframe(context); - return; } void showkeypad(Context &context) { @@ -14726,7 +14336,6 @@ gotkey: context._sub(context.al, 20); context.ah = 0; showframe(context); - return; } void dumpkeypad(Context &context) { @@ -14736,7 +14345,6 @@ void dumpkeypad(Context &context) { context.cl = 120; context.ch = 90; multidump(context); - return; } void usemenu(Context &context) { @@ -14796,7 +14404,6 @@ void dumpmenu(Context &context) { context.cl = 48; context.ch = 48; multidump(context); - return; } void getundermenu(Context &context) { @@ -14808,7 +14415,6 @@ void getundermenu(Context &context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; } void putundermenu(Context &context) { @@ -14820,7 +14426,6 @@ void putundermenu(Context &context) { context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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(context); - return; } void showoutermenu(Context &context) { @@ -14849,7 +14454,6 @@ void showoutermenu(Context &context) { context.bx = (60)+57-40; context.ds = context.data.word(kTempgraphics); showframe(context); - return; } void showmenu(Context &context) { @@ -14866,7 +14470,6 @@ menuframeok: context.bx = (60); context.ds = context.data.word(kTempgraphics); showframe(context); - return; } void loadmenu(Context &context) { @@ -14875,7 +14478,6 @@ void loadmenu(Context &context) { loadintotemp(context); context.dx = 1987; loadintotemp2(context); - return; } void viewfolder(Context &context) { @@ -14906,7 +14508,6 @@ folderloop: restoreall(context); redrawmainscrn(context); worktoscreenm(context); - return; } void nextfolder(Context &context) { @@ -14938,7 +14539,6 @@ donextf: context.bx = 3636; checkcoords(context); worktoscreenm(context); - return; } void folderhints(Context &context) { @@ -15019,7 +14619,6 @@ dolastf: context.bx = 3636; checkcoords(context); worktoscreenm(context); - return; } void loadfolder(Context &context) { @@ -15034,7 +14633,6 @@ void loadfolder(Context &context) { loadtempcharset(context); context.dx = 2195; loadtemptext(context); - return; } void showfolder(Context &context) { @@ -15096,7 +14694,6 @@ closedfolder: showframe(context); folderexit(context); undertextline(context); - return; } void folderexit(Context &context) { @@ -15107,7 +14704,6 @@ void folderexit(Context &context) { context.al = 6; context.ah = 0; showframe(context); - return; } void showleftpage(Context &context) { @@ -15189,7 +14785,6 @@ flipfolderline: context._add(context.si, 320); context._add(context.di, 320); if (--context.cx) goto flipfolder; - return; } void showrightpage(Context &context) { @@ -15244,7 +14839,6 @@ contrightpage: if (--context.cx) goto twolotsright; context.data.byte(kKerning) = 0; context.data.word(kLinespacing) = 10; - return; } void entersymbol(Context &context) { @@ -15311,7 +14905,6 @@ symbolwrong: getridoftemp(context); restorereels(context); worktoscreenm(context); - return; } void quitsymbol(Context &context) { @@ -15335,7 +14928,6 @@ notqs: return; doqs: context.data.byte(kGetback) = 1; - return; } void settopleft(Context &context) { @@ -15414,7 +15006,6 @@ void dumpsymbol(Context &context) { context.cl = 104; context.ch = 60; multidump(context); - return; } void showsymbol(Context &context) { @@ -15488,7 +15079,6 @@ void showsymbol(Context &context) { nextsymbol(context); context._add(context.di, 49); showframe(context); - return; } void nextsymbol(Context &context) { @@ -15504,7 +15094,6 @@ topwrap: return; botwrap: context.al = 6; - return; } void updatesymboltop(Context &context) { @@ -15655,7 +15244,6 @@ void showdiary(Context &context) { context.bx = (48+12)+108; context.ds = context.data.word(kTempgraphics); showframe(context); - return; } void showdiarykeys(Context &context) { @@ -15753,7 +15341,6 @@ notdumpdiary: context.cl = 16; context.ch = 16; multidump(context); - return; } void diarykeyp(Context &context) { @@ -15841,7 +15428,6 @@ void showdiarypage(Context &context) { context.data.byte(kKerning) = 0; context.data.word(kCharshift) = 0; usecharset1(context); - return; } void findtext1(Context &context) { @@ -15853,7 +15439,6 @@ void findtext1(Context &context) { context.ax = context.es.word(context.si); context._add(context.ax, (66*2)); context.si = context.ax; - return; } void zoomonoff(Context &context) { @@ -15891,7 +15476,6 @@ dozoomonoff: commandonly(context); readmouse(context); worktoscreenm(context); - return; } void saveload(Context &context) { @@ -15963,7 +15547,6 @@ waitops: context.data.byte(kCommandtype) = 200; justret: context.data.byte(kManisoffscreen) = 0; - return; } void getbackfromops(Context &context) { @@ -15974,7 +15557,6 @@ void getbackfromops(Context &context) { return; opsblock1: blank(context); - return; } void showmainops(Context &context) { @@ -15997,7 +15579,6 @@ void showmainops(Context &context) { context.al = 1; context.ah = 0; showframe(context); - return; } void showdiscops(Context &context) { @@ -16026,14 +15607,12 @@ void showdiscops(Context &context) { context.al = 5; context.ah = 0; showframe(context); - return; } void loadsavebox(Context &context) { STACK_CHECK(context); context.dx = 1961; loadintotemp(context); - return; } void loadgame(Context &context) { @@ -16114,7 +15693,6 @@ nogetbackops: dogetbackops: oldtonames(context); context.data.byte(kGetback) = 2; - return; } void discops(Context &context) { @@ -16151,7 +15729,6 @@ discopsloop: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto discopsloop; - return; } void savegame(Context &context) { @@ -16195,7 +15772,6 @@ saveops: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto saveops; - return; } void actualsave(Context &context) { @@ -16296,7 +15872,6 @@ void selectslot2(Context &context) { context.data.byte(kLoadingorsave) = 2; noselslot2: selectslot(context); - return; } void checkinput(Context &context) { @@ -16340,7 +15915,6 @@ afterkey: showslots(context); showsaveops(context); worktoscreenm(context); - return; } void getnamepos(Context &context) { @@ -16356,7 +15930,6 @@ void getnamepos(Context &context) { context.al = context.data.byte(kCursorpos); context.ah = 0; context._add(context.bx, context.ax); - return; } void showopbox(Context &context) { @@ -16373,7 +15946,6 @@ void showopbox(Context &context) { context.al = 4; context.ah = 0; showframe(context); - return; } void showloadops(Context &context) { @@ -16395,7 +15967,6 @@ void showloadops(Context &context) { context.al = 55; context.dl = 101; printmessage(context); - return; } void showsaveops(Context &context) { @@ -16417,7 +15988,6 @@ void showsaveops(Context &context) { context.al = 54; context.dl = 101; printmessage(context); - return; } void selectslot(Context &context) { @@ -16498,7 +16068,6 @@ nomatchslot: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto slotloop; - return; } void shownames(Context &context) { @@ -16565,7 +16134,6 @@ afterprintname: context._inc(context.cl); context._cmp(context.cl, 7); if (!context.flags.z()) goto shownameloop; - return; } void namestoold(Context &context) { @@ -16576,8 +16144,7 @@ void namestoold(Context &context) { context.es = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - return; -} + } void oldtonames(Context &context) { STACK_CHECK(context); @@ -16587,8 +16154,7 @@ void oldtonames(Context &context) { context.ds = context.data.word(kBuffers); context.cx = 17*4; while(context.cx--) context._movsb(); - return; -} + } void saveposition(Context &context) { STACK_CHECK(context); @@ -16639,7 +16205,6 @@ void saveposition(Context &context) { saveseg(context); fquit: closefile(context); - return; } void loadposition(Context &context) { @@ -16688,7 +16253,6 @@ void loadposition(Context &context) { context.dx = 534; loadseg(context); closefile(context); - return; } void makeheader(Context &context) { @@ -16708,7 +16272,6 @@ void makeheader(Context &context) { storeit(context); context.ax = (991-534); storeit(context); - return; } void storeit(Context &context) { @@ -16718,7 +16281,6 @@ void storeit(Context &context) { context._inc(context.ax); isntblank: context._stosw(); - return; } void findlen(Context &context) { @@ -16782,7 +16344,6 @@ notexist: context._dec(context.cl); if (!context.flags.z()) goto scanloop; context.al = context.ch; - return; } void decide(Context &context) { @@ -16820,7 +16381,6 @@ hasloadedroom: context.data.word(kTextaddressx) = 13; context.data.word(kTextaddressy) = 182; context.data.byte(kTextlen) = 240; - return; } void showdecisions(Context &context) { @@ -16834,7 +16394,6 @@ void showdecisions(Context &context) { context.ah = 0; showframe(context); undertextline(context); - return; } void newgame(Context &context) { @@ -16959,7 +16518,6 @@ tensc: context.cs.byte(context.di+6) = context.cl; context._add(context.al, '0'); context.cs.byte(context.di+7) = context.al; - return; } void trysoundalloc(Context &context) { @@ -17120,7 +16678,6 @@ notch0only: while(context.cx--) context._stosw(); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; - return; } void volumeadjust(Context &context) { @@ -17170,14 +16727,12 @@ void cancelch0(Context &context) { context.data.byte(kCh0repeat) = 0; context.data.word(kCh0blockstocopy) = 0; context.data.byte(kCh0playing) = 255; - return; } void cancelch1(Context &context) { STACK_CHECK(context); context.data.word(kCh1blockstocopy) = 0; context.data.byte(kCh1playing) = 255; - return; } void channel0tran(Context &context) { @@ -17200,7 +16755,6 @@ volloop: context.ah = context.es.byte(context.bx); context._stosw(); if (--context.cx) goto volloop; - return; } void domix(Context &context) { @@ -17526,7 +17080,6 @@ isedens: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; switchryanoff(context); - return; } void pickupob(Context &context) { @@ -17537,12 +17090,10 @@ void pickupob(Context &context) { context.data.byte(kCommand) = context.al; getanyad(context); transfertoex(context); - return; } void checkforemm(Context &context) { STACK_CHECK(context); - return; } void checkbasemem(Context &context) { @@ -17588,7 +17139,6 @@ void allocatebuffers(Context &context) { context.bx = 2048/16; allocatemem(context); context.data.word(kSounddata2) = context.ax; - return; } void clearbuffers(Context &context) { @@ -17616,7 +17166,6 @@ void clearbuffers(Context &context) { context.cx = (68-0); while(context.cx--) context._movsb(); clearchanges(context); - return; } void clearchanges(Context &context) { @@ -17658,7 +17207,6 @@ void clearchanges(Context &context) { context.ax = 0; context.cx = 6; while(context.cx--) context._stosw(); - return; } void clearbeforeload(Context &context) { @@ -17680,7 +17228,6 @@ void clearreels(Context &context) { deallocatemem(context); context.es = context.data.word(kReel3); deallocatemem(context); - return; } void clearrest(Context &context) { @@ -17708,7 +17255,6 @@ void clearrest(Context &context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - return; } void parseblaster(Context &context) { @@ -17792,7 +17338,6 @@ void startup(Context &context) { undertextline(context); reelsonscreen(context); atmospheres(context); - return; } void startup1(Context &context) { @@ -17813,7 +17358,6 @@ void startup1(Context &context) { atmospheres(context); worktoscreen(context); fadescreenup(context); - return; } void screenupdate(Context &context) { @@ -17988,7 +17532,6 @@ finishtime: showtime(context); finishwatch: context.data.byte(kWatchdump) = 1; - return; } void showtime(Context &context) { @@ -18086,7 +17629,6 @@ void showbyte(Context &context) { onedigit(context); context.es.byte(context.di+1) = context.dl; context._add(context.di, 3); - return; } void onedigit(Context &context) { @@ -18098,7 +17640,6 @@ void onedigit(Context &context) { morethan10: context._sub(context.dl, 10); context._add(context.dl, 'A'); - return; } void twodigitnum(Context &context) { @@ -18111,7 +17652,6 @@ numloop1: if (!context.flags.c()) goto numloop1; context._add(context.al, 10); context._add(context.al, context.cl); - return; } void showword(Context &context) { @@ -18157,7 +17697,6 @@ word4: context.cl = context.al; convnum(context); context.cs.byte(context.di+4) = context.cl; - return; } void convnum(Context &context) { @@ -18243,7 +17782,6 @@ isaperson: return; toofaraway: walktotext(context); - return; } void mainscreen(Context &context) { @@ -18375,7 +17913,6 @@ finishidentify: return; nothingund: blank(context); - return; } void checkifperson(Context &context) { @@ -18432,7 +17969,6 @@ notareelid: context._add(context.bx, 5); context._dec(context.cx); if (!context.flags.z()) goto identifyreel; - return; } void checkifset(Context &context) { @@ -18466,7 +18002,6 @@ notasetid: context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyset; - return; } void checkifex(Context &context) { @@ -18496,7 +18031,6 @@ notanexid: context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyex; - return; } void checkiffree(Context &context) { @@ -18526,7 +18060,6 @@ notafreeid: context._dec(context.cx); context._cmp(context.cx, -1); if (!context.flags.z()) goto identifyfree; - return; } void isitdescribed(Context &context) { @@ -18550,7 +18083,6 @@ void isitdescribed(Context &context) { context.cx = context.pop(); context.ax = context.pop(); context._cmp(context.dl, 0); - return; } void findpathofpoint(Context &context) { @@ -18627,7 +18159,6 @@ nofirst: return; gotfirst: context.al = context.es.byte(context.bx+6); - return; } void turnpathon(Context &context) { @@ -18702,7 +18233,6 @@ void turnanypathon(Context &context) { context._add(context.bx, context.ax); context.al = 255; context.es.byte(context.bx+6) = context.al; - return; } void turnanypathoff(Context &context) { @@ -18729,7 +18259,6 @@ void turnanypathoff(Context &context) { context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - return; } void checkifpathison(Context &context) { @@ -18744,7 +18273,6 @@ void checkifpathison(Context &context) { context._add(context.bx, context.ax); context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); - return; } void afternewroom(Context &context) { @@ -18850,7 +18378,6 @@ wrongatmos: goto nextatmos; nomoreatmos: cancelch0(context); - return; } void walkintoroom(Context &context) { @@ -18991,7 +18518,6 @@ isaperson: return; toofaraway: walktotext(context); - return; } void finishedwalking(Context &context) { @@ -19010,7 +18536,6 @@ void examineobtext(Context &context) { context.bh = context.data.byte(kCommandtype); context.al = 1; commandwithob(context); - return; } void commandwithob(Context &context) { @@ -19064,7 +18589,6 @@ noadd: context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - return; } void commandonly(Context &context) { @@ -19100,7 +18624,6 @@ void commandonly(Context &context) { context.ah = 0; printdirect(context); context.data.byte(kNewtextline) = 1; - return; } void printmessage(Context &context) { @@ -19121,7 +18644,6 @@ void printmessage(Context &context) { context.al = 0; context.ah = 0; printdirect(context); - return; } void printmessage2(Context &context) { @@ -19150,7 +18672,6 @@ searchmess: context.al = 0; context.ah = 0; printdirect(context); - return; } void blocknametext(Context &context) { @@ -19159,7 +18680,6 @@ void blocknametext(Context &context) { context.bh = context.data.byte(kCommandtype); context.al = 0; commandwithob(context); - return; } void personnametext(Context &context) { @@ -19169,7 +18689,6 @@ void personnametext(Context &context) { context.bh = context.data.byte(kCommandtype); context.al = 2; commandwithob(context); - return; } void walktotext(Context &context) { @@ -19178,7 +18697,6 @@ void walktotext(Context &context) { context.bh = context.data.byte(kCommandtype); context.al = 3; commandwithob(context); - return; } void getflagunderp(Context &context) { @@ -19191,7 +18709,6 @@ void getflagunderp(Context &context) { checkone(context); context.data.byte(kLastflag) = context.cl; context.data.byte(kLastflagex) = context.ch; - return; } void setwalk(Context &context) { @@ -19230,7 +18747,6 @@ alreadywalking: holdingreel: context.data.byte(kDestafterhold) = context.al; context.data.byte(kWatchmode) = 2; - return; } void autosetwalk(Context &context) { @@ -19282,7 +18798,6 @@ notsamealready: return; normalline: context.data.byte(kLinepointer) = 0; - return; } void checkdest(Context &context) { @@ -19330,7 +18845,6 @@ nextcheck2: if (!context.flags.z()) goto checkdestloop; context.data.byte(kDestination) = context.ch; context.bx = context.pop(); - return; } void bresenhams(Context &context) { @@ -19444,7 +18958,6 @@ lineexit: context.ax = context.di; context._shr(context.ax, 1); context.data.byte(kLinelength) = context.al; - return; } void workoutframes(Context &context) { @@ -19523,7 +19036,6 @@ success: context._and(context.dl, 7); context.data.byte(kTurntoface) = context.dl; context.data.byte(kTurndirection) = 0; - return; } void getroomspaths(Context &context) { @@ -19535,7 +19047,6 @@ void getroomspaths(Context &context) { context.es = context.data.word(kReels); context.bx = (0); context._add(context.bx, context.ax); - return; } void copyname(Context &context) { @@ -19561,7 +19072,6 @@ finishmakename: return; context.al = 255; while(context.cx--) context._stosb(); - return; } void findobname(Context &context) { @@ -19620,7 +19130,6 @@ notsetname: context.ax = context.ds.word(context.bx); context._add(context.ax, (0+(98*2))); context.si = context.ax; - return; } void showicon(Context &context) { @@ -19671,7 +19180,6 @@ isdream1: context.ah = 4; showframe(context); middlepanel(context); - return; } void middlepanel(Context &context) { @@ -19700,7 +19208,6 @@ void middlepanel(Context &context) { context.al = 47; context.ah = 4; showframe(context); - return; } void showman(Context &context) { @@ -19743,7 +19250,6 @@ void showpanel(Context &context) { context.al = 19; context.ah = 0; showframe(context); - return; } void roomname(Context &context) { @@ -19778,21 +19284,18 @@ gotpl: printdirect(context); context.data.word(kLinespacing) = 10; usecharset1(context); - return; } void usecharset1(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kCharset1); context.data.word(kCurrentset) = context.ax; - return; } void usetempcharset(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kTempcharset); context.data.word(kCurrentset) = context.ax; - return; } void showexit(Context &context) { @@ -19803,7 +19306,6 @@ void showexit(Context &context) { context.al = 11; context.ah = 0; showframe(context); - return; } void panelicons1(Context &context) { @@ -19833,7 +19335,6 @@ watchison: zoomisoff: context.di = context.pop(); showwatch(context); - return; } void showwatch(Context &context) { @@ -19928,7 +19429,6 @@ void worktoscreenm(Context &context) { vsync(context); worktoscreen(context); delpointer(context); - return; } void blank(Context &context) { @@ -19947,7 +19447,6 @@ void allpointer(Context &context) { readmouse(context); showpointer(context); dumppointer(context); - return; } void hangonp(Context &context) { @@ -19992,7 +19491,6 @@ getoutofit: context.data.byte(kPointerframe) = context.al; context.data.byte(kPickup) = context.ah; context.data.byte(kPointermode) = 0; - return; } void hangonw(Context &context) { @@ -20007,7 +19505,6 @@ hangloopw: dumppointer(context); context.cx = context.pop(); if (--context.cx) goto hangloopw; - return; } void hangoncurs(Context &context) { @@ -20019,7 +19516,6 @@ monloop1: delcurs(context); context.cx = context.pop(); if (--context.cx) goto monloop1; - return; } void getunderzoom(Context &context) { @@ -20031,7 +19527,6 @@ void getunderzoom(Context &context) { context.cl = 46; context.ch = 40; multiget(context); - return; } void dumpzoom(Context &context) { @@ -20056,7 +19551,6 @@ void putunderzoom(Context &context) { context.cl = 46; context.ch = 40; multiput(context); - return; } void crosshair(Context &context) { @@ -20081,7 +19575,6 @@ nocross: context.al = 29; context.ah = 0; showframe(context); - return; } void showpointer(Context &context) { @@ -20190,7 +19683,6 @@ notsmally2: context.al = 3; context.ah = 128; showframe(context); - return; } void delpointer(Context &context) { @@ -20245,7 +19737,6 @@ void undertextline(Context &context) { context.cl = (180); context.ch = (10); multiget(context); - return; } void deltextline(Context &context) { @@ -20257,7 +19748,6 @@ void deltextline(Context &context) { context.cl = (180); context.ch = (10); multiput(context); - return; } void dumptextline(Context &context) { @@ -20353,7 +19843,6 @@ void readmouse(Context &context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton) = context.bx; - return; } void readmouse1(Context &context) { @@ -20366,7 +19855,6 @@ void readmouse1(Context &context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton1) = context.bx; - return; } void readmouse2(Context &context) { @@ -20379,7 +19867,6 @@ void readmouse2(Context &context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton2) = context.bx; - return; } void readmouse3(Context &context) { @@ -20392,7 +19879,6 @@ void readmouse3(Context &context) { context.data.word(kMousex) = context.cx; context.data.word(kMousey) = context.dx; context.data.word(kMousebutton3) = context.bx; - return; } void readmouse4(Context &context) { @@ -20411,7 +19897,6 @@ void readmouse4(Context &context) { context._or(context.ax, context.data.word(kMousebutton3)); context._or(context.bx, context.ax); context.data.word(kMousebutton) = context.bx; - return; } void readkey(Context &context) { @@ -20429,7 +19914,6 @@ void readkey(Context &context) { return; nokey: context.data.byte(kCurrentkey) = 0; - return; } void convertkey(Context &context) { @@ -20439,7 +19923,6 @@ void convertkey(Context &context) { context.di = 5928; context._add(context.di, context.ax); context.al = context.cs.byte(context.di); - return; } void randomnum1(Context &context) { @@ -20455,7 +19938,6 @@ void randomnum1(Context &context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - return; } void randomnum2(Context &context) { @@ -20472,7 +19954,6 @@ void randomnum2(Context &context) { context.di = context.pop(); context.es = context.pop(); context.ds = context.pop(); - return; } void hangon(Context &context) { @@ -20482,7 +19963,6 @@ hangonloop: vsync(context); context.cx = context.pop(); if (--context.cx) goto hangonloop; - return; } void loadtraveltext(Context &context) { @@ -20490,7 +19970,6 @@ void loadtraveltext(Context &context) { context.dx = 2234; standardload(context); context.data.word(kTraveltext) = context.ax; - return; } void loadintotemp(Context &context) { @@ -20498,7 +19977,6 @@ void loadintotemp(Context &context) { context.ds = context.cs; standardload(context); context.data.word(kTempgraphics) = context.ax; - return; } void loadintotemp2(Context &context) { @@ -20506,7 +19984,6 @@ void loadintotemp2(Context &context) { context.ds = context.cs; standardload(context); context.data.word(kTempgraphics2) = context.ax; - return; } void loadintotemp3(Context &context) { @@ -20514,14 +19991,12 @@ void loadintotemp3(Context &context) { context.ds = context.cs; standardload(context); context.data.word(kTempgraphics3) = context.ax; - return; } void loadtempcharset(Context &context) { STACK_CHECK(context); standardload(context); context.data.word(kTempcharset) = context.ax; - return; } void standardload(Context &context) { @@ -20540,14 +20015,12 @@ void standardload(Context &context) { readfromfile(context); closefile(context); context.ax = context.pop(); - return; } void loadtemptext(Context &context) { STACK_CHECK(context); standardload(context); context.data.word(kTextfile1) = context.ax; - return; } void loadroom(Context &context) { @@ -20568,7 +20041,6 @@ void loadroom(Context &context) { switchryanon(context); drawflags(context); getdimension(context); - return; } void loadroomssample(Context &context) { @@ -20631,7 +20103,6 @@ void getridofall(Context &context) { deallocatemem(context); context.es = context.data.word(kFreedesc); deallocatemem(context); - return; } void restorereels(Context &context) { @@ -20745,7 +20216,6 @@ void restoreall(Context &context) { loadseg(context); closefile(context); setallchanges(context); - return; } void sortoutmap(Context &context) { @@ -20768,7 +20238,6 @@ blimey: if (--context.cx) goto blimey; context.di = context.pop(); context.es = context.pop(); - return; } void startloading(Context &context) { @@ -20904,7 +20373,6 @@ void startloading(Context &context) { context.bx = context.pop(); dontwalkin: findxyfrompath(context); - return; } void disablepath(Context &context) { @@ -20937,7 +20405,6 @@ lookx2: context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; - return; } void findxyfrompath(Context &context) { @@ -20954,7 +20421,6 @@ void findxyfrompath(Context &context) { context._sub(context.ah, 12); context.data.byte(kRyanx) = context.al; context.data.byte(kRyany) = context.ah; - return; } void findroominloc(Context &context) { @@ -20972,7 +20438,6 @@ lookx: context._sub(context.al, 11); if (!context.flags.c()) goto lookx; context.data.byte(kRoomnum) = context.cl; - return; } void getroomdata(Context &context) { @@ -20982,7 +20447,6 @@ void getroomdata(Context &context) { context._mul(context.cx); context.bx = 6187; context._add(context.bx, context.ax); - return; } void readheader(Context &context) { @@ -20993,7 +20457,6 @@ void readheader(Context &context) { readfromfile(context); context.es = context.cs; context.di = 6141; - return; } void allocateload(Context &context) { @@ -21006,7 +20469,6 @@ void allocateload(Context &context) { allocatemem(context); context.di = context.pop(); context.es = context.pop(); - return; } void fillspace(Context &context) { @@ -21024,49 +20486,42 @@ void fillspace(Context &context) { context.dx = context.pop(); context.ds = context.pop(); context.es = context.pop(); - return; } void getridoftemp(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics); deallocatemem(context); - return; } void getridoftemptext(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTextfile1); deallocatemem(context); - return; } void getridoftemp2(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics2); deallocatemem(context); - return; } void getridoftemp3(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempgraphics3); deallocatemem(context); - return; } void getridoftempcharset(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempcharset); deallocatemem(context); - return; } void getridoftempsp(Context &context) { STACK_CHECK(context); context.es = context.data.word(kTempsprites); deallocatemem(context); - return; } void readsetdata(Context &context) { @@ -21116,7 +20571,6 @@ transfer: context._cmp(context.al, 0); if (!context.flags.z()) goto transfer; context.dx = 6059; - return; } void dreamweb(Context &context) { -- cgit v1.2.3 From 4e75c4bfd2aca2ef08d649ba95e5dbe90767ecb1 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 22:26:47 +0400 Subject: DREAMWEB: marked global as used from get_global() --- devtools/tasmrecover/tasm/parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 0583d851b4..4cea496722 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -46,7 +46,9 @@ class parser: def get_global(self, name): name = name.lower() - return self.__globals[name] + g = self.__globals[name] + g.used = True + return g def get_globals(self): return self.__globals -- cgit v1.2.3 From 3b85dede39f6d0f4836788adb6df0ff868434885 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 23:00:05 +0400 Subject: DREAMWEB: added banner to autogenerated files --- devtools/tasmrecover/tasm/cpp.py | 20 +++++++++++++------- engines/dreamweb/README | 12 ++++++++++++ engines/dreamweb/dreamgen.cpp | 2 ++ engines/dreamweb/dreamgen.h | 5 ++++- 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 engines/dreamweb/README diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index fe9e39c092..4e37dc8e5b 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -16,8 +16,16 @@ class cpp: self.namespace = namespace fname = namespace + ".cpp" header = namespace + ".h" + banner = "/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */" self.fd = open(fname, "wt") self.hd = open(header, "wt") + hid = "TASMRECOVER_%s_STUBS_H__" %namespace.upper() + self.hd.write("""#ifndef %s +#define %s + +%s + +""" %(hid, hid, banner)) self.context = context self.data_seg = context.binary_data self.procs = context.proc_list @@ -29,11 +37,13 @@ class cpp: self.translated = [] self.proc_addr = [] self.forwards = [] - self.fd.write("""#include \"%s\" + self.fd.write("""%s + +#include \"%s\" namespace %s { -""" %(header, namespace)) +""" %(banner, header, namespace)) def expand_cb(self, match): name = match.group(0).lower() @@ -531,12 +541,8 @@ namespace %s { if (n & 0xf) == 0: data_impl += "\n\t\t" data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src));\n" - hid = "TASMRECOVER_%s_STUBS_H__" %self.namespace.upper() - self.hd.write("""#ifndef %s -#define %s -""" %(hid, hid)) self.hd.write( -"""\n#\tinclude "runtime.h" +"""\n#include "dreamweb/runtime.h" namespace %s { diff --git a/engines/dreamweb/README b/engines/dreamweb/README new file mode 100644 index 0000000000..d184613249 --- /dev/null +++ b/engines/dreamweb/README @@ -0,0 +1,12 @@ + +WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING + +Some files(dreamgen.*) in this directory is auto-generated. This means +(at least for some time) any changes to them will be lost. + +Please look into /devtools/tasmrecover directory, patch assembler source +or translator and run ./tasm-recover script. + +Then copy dreamgen.cpp/dreamgen.h to engine/dreamweb and check the diffs. + +If you'd like to reimplement something, blacklist it, then run script. diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 06de8814ca..211418e22f 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -1,3 +1,5 @@ +/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */ + #include "dreamgen.h" namespace dreamgen { diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 38c04a3c92..5ded297e36 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -1,7 +1,10 @@ #ifndef TASMRECOVER_DREAMGEN_STUBS_H__ #define TASMRECOVER_DREAMGEN_STUBS_H__ -# include "runtime.h" +/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */ + + +#include "dreamweb/runtime.h" namespace dreamgen { -- cgit v1.2.3 From c1b9adb69122d86665079c619a535095d7fe1507 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 15 Jun 2011 23:38:44 +0400 Subject: DREAMWEB: added unused label elimination. Does not work for some labels, but the most ones are gone. --- devtools/tasmrecover/tasm/proc.py | 26 +++++++++++++++++++++++++- engines/dreamweb/dreamgen.cpp | 28 ---------------------------- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 3a82a74413..57f17518fb 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -16,6 +16,16 @@ class proc: def add_label(self, label): self.stmts.append(op.label(label)) self.labels.add(label) + + def remove_label(self, label): + try: + self.labels.remove(label) + except: + pass + for l in self.stmts: + if isinstance(l, op.label) and l.name == label: + self.stmts.remove(l) + return def optimize(self): print "optimizing..." @@ -47,7 +57,21 @@ class proc: self.stmts.pop(i) else: i += 1 - #fixme: add local? + + #eliminating unused labels + for s in list(self.stmts): + if not isinstance(s, op.label): + continue + print "checking label %s..." %s.name + used = False + for j in self.stmts: + if isinstance(j, op.basejmp) and j.label == s.name: + print "used" + used = True + break + if not used: + print self.labels + self.remove_label(s.name) def add(self, stmt): #print stmt diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 211418e22f..cbdb25256c 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -907,7 +907,6 @@ helispeed: showgamereel(context); context.al = context.data.byte(kMapx); context.es.byte(context.bx+1) = context.al; -helicombatend: context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 9); if (!context.flags.c()) goto notwaitingheli; @@ -2807,7 +2806,6 @@ continuewalk: context.ax = context.es.word(context.bx); context.bx = context.pop(); context.es = context.pop(); -stillline: context.es.word(context.bx+10) = context.ax; return; endofline: @@ -4252,7 +4250,6 @@ inwatching: zoomswitch: context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.c()) goto zoomit; -cantzoom: putunderzoom(context); return; zoomit: @@ -5140,7 +5137,6 @@ greysumloop2: context.ah = context.data.byte(kAddtored); context._cmp(context.al, 0); context._add(context.al, context.ah); -noaddr: context._stosb(); context.ah = context.data.byte(kAddtogreen); context.al = context.bl; @@ -5805,7 +5801,6 @@ printloopslow5: if (!context.flags.z()) goto finishslow2; keepgoing: waitframes(context); -noslow: context._cmp(context.ax, 0); if (context.flags.z()) goto afterslow; context._cmp(context.ax, context.data.word(kOldbutton)); @@ -8816,7 +8811,6 @@ void calcfrframe(Context &context) { context.ah = 0; context.data.word(kOffsety) = context.ax; return; -nullframe: context.ax = context.pop(); context.cx = 0; context.data.word(kSavesize) = context.cx; @@ -9054,7 +9048,6 @@ waittalk: checkcoords(context); context._cmp(context.data.byte(kGetback), 0); if (context.flags.z()) goto waittalk; -finishtalk: context.bx = context.data.word(kPersondata); context.es = context.cs; context._cmp(context.data.byte(kTalkpos), 4); @@ -9533,7 +9526,6 @@ alreadyinfo: worktoscreenm(context); context.cx = 500; hangonp(context); -afterinfo: context.data.byte(kPointermode) = 0; context.data.byte(kPointerframe) = 0; putundercentre(context); @@ -9653,7 +9645,6 @@ void showarrows(Context &context) { void nextdest(Context &context) { STACK_CHECK(context); -duok: context._cmp(context.data.byte(kCommandtype), 218); if (context.flags.z()) goto alreadydu; context.data.byte(kCommandtype) = 218; @@ -9692,7 +9683,6 @@ nodu: void lastdest(Context &context) { STACK_CHECK(context); -ddok: context._cmp(context.data.byte(kCommandtype), 219); if (context.flags.z()) goto alreadydd; context.data.byte(kCommandtype) = 219; @@ -9904,7 +9894,6 @@ moreinput: execcommand(context); context._cmp(context.al, 0); if (context.flags.z()) goto moreinput; -endmon: getridoftemp(context); getridoftempcharset(context); context.es = context.data.word(kTextfile1); @@ -10522,7 +10511,6 @@ checkpass: if (context.flags.z()) goto passpassed; context._cmp(context.al, context.ah); if (context.flags.z()) goto checkpass; -passerror: context.bx = context.pop(); context.es = context.pop(); scrollmonitor(context); @@ -11073,7 +11061,6 @@ void delcurs(Context &context) { context.bx = context.pop(); context.di = context.pop(); multidump(context); -finishcurdel: context.si = context.pop(); context.dx = context.pop(); context.ds = context.pop(); @@ -13393,7 +13380,6 @@ void dochange(Context &context) { if (context.flags.z()) goto object; context._cmp(context.ch, 1); if (context.flags.z()) goto freeobject; -path: context.push(context.cx); context.ah = 0; context._add(context.ax, context.ax); @@ -13411,7 +13397,6 @@ path: context.es = context.data.word(kReels); context.cx = context.pop(); context.es.byte(context.bx+6) = context.cl; -nopath: return; object: context.push(context.cx); @@ -14395,7 +14380,6 @@ menuloop: restorereels(context); worktoscreenm(context); return; -menulist: return; } @@ -15228,7 +15212,6 @@ diaryloop: redrawmainscrn(context); worktoscreenm(context); return; -diarylist: return; } @@ -15899,7 +15882,6 @@ notret: context.es.byte(context.bx+1) = 1; goto afterkey; nodel2: -spacepress: context._cmp(context.data.byte(kCursorpos), 14); if (context.flags.z()) goto nokeypress; getnamepos(context); @@ -16205,7 +16187,6 @@ void saveposition(Context &context) { context.ds = context.dx; context.dx = 534; saveseg(context); -fquit: closefile(context); } @@ -16769,7 +16750,6 @@ slow: context._inc(context.bx); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplot; -botlot: context._cmp(context.ah, context.dh); if (!context.flags.c()) goto nodistort; context._add(context.al, context.ah); @@ -16815,7 +16795,6 @@ lowvolumemix: context._inc(context.bx); context._cmp(context.al, context.dh); if (!context.flags.c()) goto toplotv; -botlotv: context._cmp(context.ah, context.dh); if (!context.flags.c()) goto nodistortv; context._add(context.al, context.ah); @@ -17736,7 +17715,6 @@ noobselect: diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; -diff2: context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto middleofwalk; context._cmp(context.data.word(kWatchingtime), 0); @@ -17851,7 +17829,6 @@ loop048: if (!context.flags.l()) goto over045; context.ax = context.cs.word(context.bx+8); __dispatch_call(context, context.ax); -finished: context.ax = context.pop(); return; over045: @@ -18472,7 +18449,6 @@ noobselect: diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; -diff2: context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) goto middleofwalk; context._cmp(context.data.word(kWatchingtime), 0); @@ -19004,7 +18980,6 @@ gotquad: context._add(context.ax, 32); context._sub(context.bx, context.ax); if (context.flags.c()) goto isinright; -isinleft: context.cx = context.data.word(kLinestarty); context._add(context.cx, 32); context.ax = context.data.word(kLineendy); @@ -19057,7 +19032,6 @@ void copyname(Context &context) { findobname(context); context.di = context.pop(); context.es = context.cs; -copytext: context.cx = 28; make: context._lodsb(); @@ -19782,7 +19756,6 @@ notwatchpoint: if (context.flags.z()) goto gothand; context._cmp(context.data.byte(kPointerfirstpath), 0); if (context.flags.z()) goto gothand; -arrow: getflagunderp(context); context._cmp(context.cl, 2); if (context.flags.c()) goto gothand; @@ -20643,7 +20616,6 @@ loadnew: context.data.byte(kCommandtype) = 255; worktoscreenm(context); goto mainloop; -alreadyloaded: context.data.byte(kNewlocation) = 255; clearsprites(context); initman(context); -- cgit v1.2.3 From e0efde7cf65e0f22d5afa830339fb1dc6ca91479 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 00:20:30 +0400 Subject: DREAMWEB: optimized consequtive movsb/w and stosb/w --- devtools/tasmrecover/tasm/cpp.py | 26 +++++----- devtools/tasmrecover/tasm/op.py | 16 +++--- devtools/tasmrecover/tasm/proc.py | 29 +++++++++++ engines/dreamweb/dreamgen.cpp | 101 +++++--------------------------------- engines/dreamweb/runtime.h | 45 +++++++++++++---- 5 files changed, 97 insertions(+), 120 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 4e37dc8e5b..2420829869 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -403,31 +403,31 @@ namespace %s { self.body += p def _rep(self): - self.body += "\twhile(context.cx--) "; + self.body += "\twhile(context.cx--) " def _lodsb(self): - self.body += "\tcontext._lodsb();\n"; + self.body += "\tcontext._lodsb();\n" def _lodsw(self): - self.body += "\tcontext._lodsw();\n"; + self.body += "\tcontext._lodsw();\n" - def _stosb(self): - self.body += "\tcontext._stosb();\n"; + def _stosb(self, n): + self.body += "\tcontext._stosb(%s);\n" %("" if n == 1 else n) - def _stosw(self): - self.body += "\tcontext._stosw();\n"; + def _stosw(self, n): + self.body += "\tcontext._stosw(%s);\n" %("" if n == 1 else n) - def _movsb(self): - self.body += "\tcontext._movsb();\n "; + def _movsb(self, n): + self.body += "\tcontext._movsb(%s);\n " %("" if n == 1 else n) - def _movsw(self): - self.body += "\tcontext._movsw();\n "; + def _movsw(self, n): + self.body += "\tcontext._movsw(%s);\n " %("" if n == 1 else n) def _stc(self): - self.body += "\tcontext.flags._c = true;\n "; + self.body += "\tcontext.flags._c = true;\n " def _clc(self): - self.body += "\tcontext.flags._c = false;\n "; + self.body += "\tcontext.flags._c = false;\n " def __proc(self, name, def_skip = 0): try: diff --git a/devtools/tasmrecover/tasm/op.py b/devtools/tasmrecover/tasm/op.py index 33f79c3e5c..9baebccfc3 100644 --- a/devtools/tasmrecover/tasm/op.py +++ b/devtools/tasmrecover/tasm/op.py @@ -316,27 +316,27 @@ class _lodsw(baseop): class _stosw(baseop): def __init__(self, arg): - pass + self.repeat = 1 def visit(self, visitor): - visitor._stosw() + visitor._stosw(self.repeat) class _stosb(baseop): def __init__(self, arg): - pass + self.repeat = 1 def visit(self, visitor): - visitor._stosb() + visitor._stosb(self.repeat) class _movsw(baseop): def __init__(self, arg): - pass + self.repeat = 1 def visit(self, visitor): - visitor._movsw() + visitor._movsw(self.repeat) class _movsb(baseop): def __init__(self, arg): - pass + self.repeat = 1 def visit(self, visitor): - visitor._movsb() + visitor._movsb(self.repeat) class _in(baseop): def __init__(self, arg): diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 57f17518fb..3c4ac21372 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -27,6 +27,30 @@ class proc: self.stmts.remove(l) return + def optimize_sequence(self, cls): + i = 0 + stmts = self.stmts + while i < len(stmts): + if not isinstance(stmts[i], cls): + i += 1 + continue + j = i + 1 + + while j < len(stmts): + if not isinstance(stmts[j], cls): + break + j = j + 1 + + n = j - i + if n > 1: + print "Eliminate consequtive storage instructions at %u-%u" %(i, j) + del stmts[i + 1:j] + stmts[i].repeat = n + else: + i = j + + return + def optimize(self): print "optimizing..." #trivial simplifications, removing last ret @@ -72,6 +96,11 @@ class proc: if not used: print self.labels self.remove_label(s.name) + + self.optimize_sequence(op._stosb); + self.optimize_sequence(op._stosw); + self.optimize_sequence(op._movsb); + self.optimize_sequence(op._movsw); def add(self, stmt): #print stmt diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index cbdb25256c..f76a3a5b58 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4204,38 +4204,7 @@ void clearwork(Context &context) { context.di = 0; context.cx = (200*320)/64; clearloop: - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); + context._stosw(32); if (--context.cx) goto clearloop; } @@ -4366,70 +4335,27 @@ loop124: context.bh = 14; context.bh = 4; firstbitofblock: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); + context._movsw(8); context._add(context.di, (320)-16); context._dec(context.bh); if (!context.flags.z()) goto firstbitofblock; context.bh = 12; loop125: - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); - context._movsw(); + context._movsw(8); context.ax = 0x0dfdf; - context._stosw(); - context._stosw(); + context._stosw(2); context._add(context.di, (320)-20); context._dec(context.bh); if (!context.flags.z()) goto loop125; context._add(context.di, 4); context.ax = 0x0dfdf; - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); + context._stosw(8); context._add(context.di, (320)-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); + context._stosw(8); context._add(context.di, (320)-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); + context._stosw(8); context._add(context.di, (320)-16); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); - context._stosw(); + context._stosw(8); zeroblock: context.si = context.pop(); context.di = context.pop(); @@ -4811,9 +4737,7 @@ void fadetowhite(Context &context) { while(context.cx--) context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.al = 0; - context._stosb(); - context._stosb(); - context._stosb(); + context._stosb(3); paltostartpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; @@ -4830,9 +4754,7 @@ void fadefromwhite(Context &context) { while(context.cx--) context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.al = 0; - context._stosb(); - context._stosb(); - context._stosb(); + context._stosb(3); paltoendpal(context); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 63; @@ -17179,8 +17101,7 @@ void clearchanges(Context &context) { context.es = context.cs; context.di = 8011; context.al = 1; - context._stosb(); - context._stosb(); + context._stosb(2); context.al = 0; context._stosb(); context.al = 1; diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 1fb232c187..3b97ce1930 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -449,31 +449,58 @@ public: src = r; } + inline void _lodsb() { + al = ds.byte(si++); + } + + inline void _lodsw() { + ax = ds.word(si); + si += 2; + } + inline void _movsb() { es.byte(di++) = ds.byte(si++); } + inline void _movsb(uint size) { + uint8 *dst = es.ptr(di, size); + uint8 *src = ds.ptr(si, size); + memcpy(dst, src, size); + di += size; + si += size; + } + inline void _movsw() { _movsb(); _movsb(); } - inline void _lodsb() { - al = ds.byte(si++); - } - - inline void _lodsw() { - ax = ds.word(si); - si += 2; + inline void _movsw(uint size) { + _movsb(size * 2); } inline void _stosb() { es.byte(di++) = al; } + inline void _stosb(uint size) { + uint8 *dst = es.ptr(di, size); + memset(dst, al, size); + di += size; + } + inline void _stosw() { - es.word(di) = ax; - di += 2; + es.byte(di++) = al; + es.byte(di++) = ah; + } + + inline void _stosw(uint size) { + uint8 *dst = es.ptr(di, size); + di += 2 * size; + while(size--) { + *dst++ = al; + *dst++ = ah; + } } inline void _xchg(uint16 &a, uint16 &b) { -- cgit v1.2.3 From 0a42a7d6257cedfe461ef65de565b8007e3a0c72 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 15 Jun 2011 22:01:24 +0200 Subject: SCUMM: hopefully fix 16bit mode support for SCUMM FM-TOWNS games and LOOM PCE on Android This mostly reverts 5b7754e3f095eb8a469dd4b7de5a6379f8e13c27. Instead, we try to use other 16bit modes after 555 fails. --- engines/scumm/cursor.cpp | 24 +++++++++------------- engines/scumm/gfx.cpp | 2 +- engines/scumm/gfx.h | 4 ++-- engines/scumm/gfx_towns.cpp | 34 ++++++++++++++----------------- engines/scumm/palette.cpp | 20 +++++++----------- engines/scumm/saveload.cpp | 2 +- engines/scumm/scumm.cpp | 49 ++++++++++++++++++++++++++++----------------- engines/scumm/scumm.h | 2 +- 8 files changed, 68 insertions(+), 69 deletions(-) diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 8676c857ea..a8adb4d5c5 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -114,21 +114,17 @@ void ScummEngine_v6::setCursorTransparency(int a) { void ScummEngine::updateCursor() { int transColor = (_game.heversion >= 80) ? 5 : 255; #ifdef USE_RGB_COLOR - if (_bytesPerPixelOutput == 2) { - Graphics::PixelFormat format = _system->getScreenFormat(); - CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, - _cursor.hotspotX, _cursor.hotspotY, - (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), - (_game.heversion == 70 ? 2 : 1), - &format); - } else { -#endif + Graphics::PixelFormat format = _system->getScreenFormat(); + CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, + _cursor.hotspotX, _cursor.hotspotY, + (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), + (_game.heversion == 70 ? 2 : 1), + &format); +#else CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height, _cursor.hotspotX, _cursor.hotspotY, (_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor), (_game.heversion == 70 ? 2 : 1)); -#ifdef USE_RGB_COLOR - } #endif } @@ -555,7 +551,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { uint16 color; const uint16 *src = _cursorImages[_currentCursor]; - if (_bytesPerPixelOutput == 2) { + if (_outputPixelFormat.bytesPerPixel == 2) { if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) { byte r, g, b; colorPCEToRGB(default_pce_cursor_colors[idx], &r, &g, &b); @@ -581,14 +577,14 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { _cursor.width = 16 * _textSurfaceMultiplier; _cursor.height = 16 * _textSurfaceMultiplier; - int scl = _bytesPerPixelOutput * _textSurfaceMultiplier; + int scl = _outputPixelFormat.bytesPerPixel * _textSurfaceMultiplier; for (i = 0; i < 16; i++) { for (j = 0; j < 16; j++) { if (src[i] & (1 << j)) { byte *dst1 = _grabbedCursor + 16 * scl * i * _textSurfaceMultiplier + (15 - j) * scl; byte *dst2 = (_textSurfaceMultiplier == 2) ? dst1 + 16 * scl : dst1; - if (_bytesPerPixelOutput == 2) { + if (_outputPixelFormat.bytesPerPixel == 2) { for (int b = 0; b < scl; b += 2) { *((uint16*)dst1) = *((uint16*)dst2) = color; dst1 += 2; diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 1b913e16b4..98d447fdaf 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -661,7 +661,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i return; } else #endif - if (_bytesPerPixelOutput == 2) { + if (_outputPixelFormat.bytesPerPixel == 2) { const byte *srcPtr = (const byte *)src; const byte *textPtr = (byte *)_textSurface.getBasePtr(x * m, y * m); byte *dstPtr = _compositeBuf; diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 6da07efd18..54ce724da1 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -443,7 +443,7 @@ public: // switching graphics layers on and off). class TownsScreen { public: - TownsScreen(OSystem *system, int width, int height, int bpp); + TownsScreen(OSystem *system, int width, int height, Graphics::PixelFormat &format); ~TownsScreen(); void setupLayer(int layer, int width, int height, int numCol, void *srcPal = 0); @@ -490,7 +490,7 @@ private: int _height; int _width; int _pitch; - int _bpp; + Graphics::PixelFormat _pixelFormat; int _numDirtyRects; Common::List _dirtyRects; diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index cdccd3e193..3c96be8b9c 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -50,10 +50,10 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in if (vs->number == kMainVirtScreen || _game.id == GID_INDY3 || _game.id == GID_ZAK) { for (int h = 0; h < height; ++h) { - if (_bytesPerPixelOutput == 2) { + if (_outputPixelFormat.bytesPerPixel == 2) { for (int w = 0; w < width; ++w) { *(uint16*)dst1 = _16BitPalette[*src1++]; - dst1 += _bytesPerPixelOutput; + dst1 += _outputPixelFormat.bytesPerPixel; } src1 += sp1; @@ -197,8 +197,8 @@ const uint8 ScummEngine::_townsLayer2Mask[] = { #define DIRTY_RECTS_MAX 20 #define FULL_REDRAW (DIRTY_RECTS_MAX + 1) -TownsScreen::TownsScreen(OSystem *system, int width, int height, int bpp) : - _system(system), _width(width), _height(height), _bpp(bpp), _pitch(width * bpp) { +TownsScreen::TownsScreen(OSystem *system, int width, int height, Graphics::PixelFormat &format) : + _system(system), _width(width), _height(height), _pixelFormat(format), _pitch(width * format.bytesPerPixel) { memset(&_layers[0], 0, sizeof(TownsScreenLayer)); memset(&_layers[1], 0, sizeof(TownsScreenLayer)); _outBuffer = new byte[_pitch * _height]; @@ -247,7 +247,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->pitch = width * l->bpp; l->palette = (uint8*)pal; - if (l->palette && _bpp == 1) + if (l->palette && _pixelFormat.bytesPerPixel == 1) warning("TownsScreen::setupLayer(): Layer palette usage requires 16 bit graphics setting.\nLayer palette will be ignored."); delete[] l->pixels; @@ -267,7 +267,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->bltInternY[i] = l->pixels + (i / l->scaleH) * l->pitch; delete[] l->bltTmpPal; - l->bltTmpPal = (l->bpp == 1 && _bpp == 2) ? new uint16[l->numCol] : 0; + l->bltTmpPal = (l->bpp == 1 && _pixelFormat.bytesPerPixel == 2) ? new uint16[l->numCol] : 0; l->enabled = true; _layers[0].onBottom = true; @@ -449,20 +449,20 @@ void TownsScreen::updateOutputBuffer() { if (!l->enabled || !l->ready) continue; - uint8 *dst = _outBuffer + r->top * _pitch + r->left * _bpp; - int ptch = _pitch - (r->right - r->left + 1) * _bpp; + uint8 *dst = _outBuffer + r->top * _pitch + r->left * _pixelFormat.bytesPerPixel; + int ptch = _pitch - (r->right - r->left + 1) * _pixelFormat.bytesPerPixel; - if (_bpp == 2 && l->bpp == 1) { + if (_pixelFormat.bytesPerPixel == 2 && l->bpp == 1) { for (int ic = 0; ic < l->numCol; ic++) l->bltTmpPal[ic] = calc16BitColor(&l->palette[ic * 3]); } for (int y = r->top; y <= r->bottom; ++y) { - if (l->bpp == _bpp && l->scaleW == 1 && l->onBottom && l->numCol & 0xff00) { - memcpy(dst, &l->bltInternY[y][l->bltInternX[r->left]], (r->right + 1 - r->left) * _bpp); + if (l->bpp == _pixelFormat.bytesPerPixel && l->scaleW == 1 && l->onBottom && l->numCol & 0xff00) { + memcpy(dst, &l->bltInternY[y][l->bltInternX[r->left]], (r->right + 1 - r->left) * _pixelFormat.bytesPerPixel); dst += _pitch; - } else if (_bpp == 2) { + } else if (_pixelFormat.bytesPerPixel == 2) { for (int x = r->left; x <= r->right; ++x) { uint8 *src = &l->bltInternY[y][l->bltInternX[x]]; if (l->bpp == 1) { @@ -498,17 +498,13 @@ void TownsScreen::updateOutputBuffer() { void TownsScreen::outputToScreen() { for (Common::List::iterator i = _dirtyRects.begin(); i != _dirtyRects.end(); ++i) - _system->copyRectToScreen(_outBuffer + i->top * _pitch + i->left * _bpp, _pitch, i->left, i->top, i->right - i->left + 1, i->bottom - i->top + 1); + _system->copyRectToScreen(_outBuffer + i->top * _pitch + i->left * _pixelFormat.bytesPerPixel, _pitch, i->left, i->top, i->right - i->left + 1, i->bottom - i->top + 1); _dirtyRects.clear(); _numDirtyRects = 0; } -uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) { - uint16 ar = (palEntry[0] & 0xf8) << 7; - uint16 ag = (palEntry[1] & 0xf8) << 2; - uint16 ab = (palEntry[2] >> 3); - uint16 col = ar | ag | ab; - return col; +uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) { + return _pixelFormat.RGBToColor(palEntry[0], palEntry[1], palEntry[2]); } #undef DIRTY_RECTS_MAX diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index 3e8c35cfd8..51ba2195d7 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -48,11 +48,7 @@ uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) { } uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) { - uint16 ar = (r >> 3) << 10; - uint16 ag = (g >> 3) << 5; - uint16 ab = (b >> 3) << 0; - uint16 col = ar | ag | ab; - return col; + return _outputPixelFormat.RGBToColor(r, g, b); } void ScummEngine::resetPalette() { @@ -222,12 +218,10 @@ void ScummEngine::resetPalette() { if (_game.id == GID_INDY4 || _game.id == GID_MONKEY2) _townsClearLayerFlag = 0; #ifdef USE_RGB_COLOR - else if (_bytesPerPixelOutput == 2) { - if (_game.id == GID_LOOM) - towns_setTextPaletteFromPtr(tableTownsLoomPalette); - else if (_game.version == 3) - towns_setTextPaletteFromPtr(tableTownsV3Palette); - } + else if (_game.id == GID_LOOM) + towns_setTextPaletteFromPtr(tableTownsLoomPalette); + else if (_game.version == 3) + towns_setTextPaletteFromPtr(tableTownsV3Palette); #endif _townsScreen->toggleLayers(_townsActiveLayerFlags); @@ -1016,7 +1010,7 @@ void ScummEngine::setCurrentPalette(int palindex) { setPCEPaletteFromPtr(pals); #ifdef USE_RGB_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - } else if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) { + } else if (_game.platform == Common::kPlatformFMTowns) { towns_setPaletteFromPtr(pals); #endif #endif @@ -1119,7 +1113,7 @@ void ScummEngine::updatePalette() { #ifdef USE_RGB_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) { + if (_game.platform == Common::kPlatformFMTowns) { p = palette_colors; for (i = first; i < first + num; ++i) { _16BitPalette[i] = get16BitColor(p[0], p[1], p[2]); diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 19834cb35d..2be032d496 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1489,7 +1489,7 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { // Reset cursors for old FM-Towns savegames saved with 256 color setting. // Otherwise the cursor will be messed up when displayed in the new hi color setting. - if (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2 && s->isLoading() && s->getVersion() < VER(82)) { + if (_game.platform == Common::kPlatformFMTowns && _outputPixelFormat.bytesPerPixel == 2 && s->isLoading() && s->getVersion() < VER(82)) { if (_game.id == GID_LOOM) { redefineBuiltinCursorFromChar(1, 1); redefineBuiltinCursorHotspot(1, 0, 0); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 97dd68af7c..d4983397e4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -260,7 +260,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _switchRoomEffect2 = 0; _switchRoomEffect = 0; - _bytesPerPixelOutput = _bytesPerPixel = 1; + _bytesPerPixel = 1; _doEffect = false; _snapScroll = false; _currentLights = 0; @@ -545,18 +545,19 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _screenHeight = 200; } - _bytesPerPixelOutput = _bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1; + _bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1; + uint8 sizeMult = _bytesPerPixel; #ifdef USE_RGB_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) - _bytesPerPixelOutput = 2; + sizeMult = 2; #endif #endif // Allocate gfx compositing buffer (not needed for V7/V8 games). if (_game.version < 7) - _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * _bytesPerPixelOutput); + _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight * sizeMult); else _compositeBuf = 0; @@ -1154,17 +1155,27 @@ Common::Error ScummEngine::init() { #endif ) { #ifdef USE_RGB_COLOR - Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); - initGraphics(screenWidth, screenHeight, screenWidth > 320, &format); - if (format != _system->getScreenFormat()) { - if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { - warning("Your ScummVM build does not support the type of 16bit color mode required by this target.\nStarting game in 8bit color mode...\nYou may experience color glitches"); - _bytesPerPixelOutput = 1; - initGraphics(screenWidth, screenHeight, (screenWidth > 320)); - } else { - return Common::kUnsupportedColorMode; - } + _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); + Common::List tryModes = _system->getSupportedFormats(); + // Try default 555 mode first + tryModes.push_front(_outputPixelFormat); + + for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { + if (g->bytesPerPixel != 2 || g->aBits()) + continue; + _outputPixelFormat = *g; + initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat); + // athrxx-06/15/2011: To avoid regressions I add support for other modes than 555 only + // for FM-TOWNS games and for LOOM PCE atm. + // TODO: Someone knowledgeable about HE games might check whether other modes can be + // supported for these games, too. Quick tests with SPYOZON indicate that this should + // not be a problem. + if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine)) + break; } + + if (_outputPixelFormat != _system->getScreenFormat()) + return Common::kUnsupportedColorMode; #else if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { warning("Starting game without the required 16bit color support.\nYou may experience color glitches"); @@ -1182,6 +1193,8 @@ Common::Error ScummEngine::init() { } } + _outputPixelFormat = _system->getScreenFormat(); + setupScumm(); readIndexFile(); @@ -1290,7 +1303,7 @@ void ScummEngine::setupScumm() { _res->setHeapThreshold(400000, maxHeapThreshold); free(_compositeBuf); - _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier * _bytesPerPixelOutput); + _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier * _outputPixelFormat.bytesPerPixel); } #ifdef ENABLE_SCUMM_7_8 @@ -1371,7 +1384,7 @@ void ScummEngine::resetScumm() { #ifdef USE_RGB_COLOR if (_game.features & GF_16BIT_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - || (_game.platform == Common::kPlatformFMTowns && _bytesPerPixelOutput == 2) + || (_game.platform == Common::kPlatformFMTowns) #endif ) _16BitPalette = (uint16 *)calloc(512, sizeof(uint16)); @@ -1380,8 +1393,8 @@ void ScummEngine::resetScumm() { #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) { delete _townsScreen; - _townsScreen = new TownsScreen(_system, _screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, _bytesPerPixelOutput); - _townsScreen->setupLayer(0, _screenWidth, _screenHeight, (_bytesPerPixelOutput == 2) ? 32767 : 256); + _townsScreen = new TownsScreen(_system, _screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, _outputPixelFormat); + _townsScreen->setupLayer(0, _screenWidth, _screenHeight, (_outputPixelFormat.bytesPerPixel == 2) ? 32767 : 256); _townsScreen->setupLayer(1, _screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, 16, _textPalette); } #endif diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 6e75f47d77..5700271911 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -897,7 +897,7 @@ public: Common::RenderMode _renderMode; uint8 _bytesPerPixel; - uint8 _bytesPerPixelOutput; + Graphics::PixelFormat _outputPixelFormat; protected: ColorCycle _colorCycle[16]; // Palette cycles -- cgit v1.2.3 From 89f14d38dd947d7f4c6035c843dfeefd60188821 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 15 Jun 2011 22:54:38 +0200 Subject: SCUMM: change comment in last commit --- engines/scumm/scumm.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d4983397e4..c74e4d1824 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1165,11 +1165,8 @@ Common::Error ScummEngine::init() { continue; _outputPixelFormat = *g; initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat); - // athrxx-06/15/2011: To avoid regressions I add support for other modes than 555 only - // for FM-TOWNS games and for LOOM PCE atm. - // TODO: Someone knowledgeable about HE games might check whether other modes can be - // supported for these games, too. Quick tests with SPYOZON indicate that this should - // not be a problem. + // Other modes than 555 are only supported for FM-TOWNS games and LOOM PCE. + // Especially the HE games require 555. if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine)) break; } -- cgit v1.2.3 From 14121a6f574299a4d27f5eebe188592be2453cda Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 01:03:00 +0400 Subject: DREAMWEB: moved stubs into stubs.cpp --- engines/dreamweb/dreamweb.cpp | 538 ------------------------------------------ engines/dreamweb/dreamweb.h | 2 +- engines/dreamweb/module.mk | 3 +- engines/dreamweb/stubs.cpp | 535 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 538 insertions(+), 540 deletions(-) create mode 100644 engines/dreamweb/stubs.cpp diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 19bb6b09cb..619f0dddfe 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -33,8 +33,6 @@ #include "common/timer.h" #include "common/util.h" -#include "engines/util.h" - #include "audio/mixer.h" #include "audio/decoders/raw.h" @@ -327,11 +325,6 @@ void DreamWebEngine::mouseCall() { _context.flags._c = false; } -void DreamWebEngine::setGraphicsMode() { - processEvents(); - initGraphics(320, 200, false); -} - void DreamWebEngine::fadeDos() { _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); return; //fixme later @@ -568,534 +561,3 @@ void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { } // End of namespace DreamWeb -namespace dreamgen { - -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 multiget(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned x = (uint16)context.di, y = (uint16)context.bx; - unsigned src = x + y * kScreenwidth; - unsigned dst = (uint16)context.si; - context.es = context.ds; - context.ds = context.data.word(kWorkspace); - if (y + h > 200) - 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)context.ds, (uint16)context.es); - for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = context.ds.ptr(src + kScreenwidth * l, w); - uint8 *dst_p = context.es.ptr(dst + w * l, w); - memcpy(dst_p, src_p, w); - } - context.si += w * h; - context.di = src + kScreenwidth * h; - context.cx = 0; -} - -void multiput(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned x = (uint16)context.di, y = (uint16)context.bx; - unsigned src = (uint16)context.si; - unsigned dst = x + y * kScreenwidth; - context.es = context.data.word(kWorkspace); - if (y + h > 200) - h = 200 - y; - if (x + w > 320) - w = 320 - x; - //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); - for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = context.ds.ptr(src + w * l, w); - uint8 *dst_p = context.es.ptr(dst + kScreenwidth * l, w); - memcpy(dst_p, src_p, w); - } - context.si += w * h; - context.di = dst + kScreenwidth * h; - context.cx = 0; -} - -void multidump(Context &context) { - context.ds = context.data.word(kWorkspace); - int w = (uint8)context.cl, h = (uint8)context.ch; - int x = (int16)context.di, y = (int16)context.bx; - unsigned offset = x + y * kScreenwidth; - //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); - context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); - context.si = context.di = offset + h * kScreenwidth; - context.cx = 0; -} - -void worktoscreen(Context &context) { - context.ds = context.data.word(kWorkspace); - uint size = 320 * 200; - context.engine->blit(context.ds.ptr(0, size), 320, 0, 0, 320, 200); - context.di = context.si = size; - context.cx = 0; -} - -void printundermon(Context &context) { - context.engine->printUnderMonitor(); -} - -void cls(Context &context) { - context.engine->cls(); -} - -void frameoutnm(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned pitch = (uint16)context.dx; - unsigned src = (uint16)context.si; - int x = (uint16)context.di, y = (uint16)context.bx; - unsigned dst = x + y * pitch; - //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)context.ds, (uint16)context.es); - for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = context.ds.ptr(src + w * l, w); - uint8 *dst_p = context.es.ptr(dst + pitch * l, w); - memcpy(dst_p, src_p, w); - } - context.di += dst + pitch * h; - context.si += w * h; - context.cx = 0; -} - -void seecommandtail(Context &context) { - context.data.word(kSoundbaseadd) = 0x220; - context.data.byte(kSoundint) = 5; - context.data.byte(kSounddmachannel) = 1; - context.data.byte(kBrightness) = 1; - context.data.word(kHowmuchalloc) = 0x9360; -} - -void randomnumber(Context &context) { - context.al = context.engine->randomNumber(); -} - -void quickquit(Context &context) { - context.engine->quit(); -} - -void quickquit2(Context &context) { - context.engine->quit(); -} - -void keyboardread(Context &context) { - ::error("keyboardread"); //this keyboard int handler, must never be called -} - -void resetkeyboard(Context &context) { -} - -void setkeyboardint(Context &context) { -} - -void readfromfile(Context &context) { - uint16 dst_offset = context.dx; - uint16 size = context.cx; - debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); - context.flags._c = false; -} - -void closefile(Context &context) { - context.engine->closeFile(); - context.data.byte(kHandle) = 0; -} - -void openforsave(Context &context) { - const char *name = (const char *)context.ds.ptr(context.dx, 13); - debug(1, "openforsave(%s)", name); - context.engine->openSaveFileForWriting(name); -} - -void openfilenocheck(Context &context) { - const char *name = (const char *)context.ds.ptr(context.dx, 13); - debug(1, "checksavefile(%s)", name); - bool ok = context.engine->openSaveFileForReading(name); - context.flags._c = !ok; -} - -void openfilefromc(Context &context) { - openfilenocheck(context); -} - -void openfile(Context &context) { - Common::String name = getFilename(context); - debug(1, "opening file: %s", name.c_str()); - context.engine->openFile(name); - context.cs.word(kHandle) = 1; //only one handle - context.flags._c = false; -} - -void createfile(Context &context) { - ::error("createfile"); -} - -void dontloadseg(Context &context) { - context.ax = context.es.word(context.di); - context._add(context.di, 2); - context.dx = context.ax; - context.cx = 0; - unsigned pos = context.engine->skipBytes(context.dx); - context.dx = pos >> 16; - context.ax = pos & 0xffff; - context.flags._c = false; -} - -void mousecall(Context &context) { - context.engine->mouseCall(); -} - -void setmouse(Context &context) { - context.data.word(kOldpointerx) = 0xffff; - //warning("setmouse: fixme: add range setting"); - //set vertical range to 15-184 - //set horizontal range to 15-298*2 -} - -void gettime(Context &context) { - TimeDate t; - g_system->getTimeAndDate(t); - debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); - context.ch = t.tm_hour; - context.cl = t.tm_min; - context.dh = t.tm_sec; - context.data.byte(kSecondcount) = context.dh; - context.data.byte(kMinutecount) = context.cl; - context.data.byte(kHourcount) = context.ch; -} - -void allocatemem(Context &context) { - uint size = (context.bx + 2) * 16; - debug(1, "allocate mem, %u bytes", size); - context.flags._c = false; - SegmentRef seg = context.allocateSegment(size); - context.ax = (uint16)seg; - debug(1, "\tsegment address -> %04x", (uint16)context.ax); -} - -void deallocatemem(Context &context) { - uint16 id = (uint16)context.es; - debug(1, "deallocating segment %04x", id); - context.deallocateSegment(id); - - //fixing invalid entries in the sprite table - context.es = context.data; - uint tsize = 16 * 32; - uint16 bseg = context.data.word(kBuffers); - if (!bseg) - return; - SegmentRef buffers(&context); - buffers = bseg; - uint8 *ptr = buffers.ptr(kSpritetable, tsize); - 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) - memset(ptr + i, 0xff, 32); - } -} - -void removeemm(Context &context) { - ::error("removeemm"); -} - -void setupemm(Context &context) { - //fixme: double check this, but it seems that emm pages used only for sound -} - -void pitinterupt(Context &context) { - ::error("pitinterupt"); -} - -void getridofpit(Context &context) { - ::error("getridofpit"); -} - -void setuppit(Context &context) { - ::error("setuppit"); -} - -void startdmablock(Context &context) { - ::error("startdmablock"); -} - -void dmaend(Context &context) { - ::error("dmaend"); -} - -void restoreems(Context &context) { - ::error("restoreems"); -} - -void saveems(Context &context) { - ::error("saveems"); -} - -void bothchannels(Context &context) { - ::error("bothchannels"); -} - -void channel1only(Context &context) { - ::error("channel1only"); -} - -void channel0only(Context &context) { - ::error("channel0only"); -} - -void out22c(Context &context) { - ::error("out22c"); -} - -void soundstartup(Context &context) { -} - -void soundend(Context &context) { -} - -void interupttest(Context &context) { - ::error("interupttest"); -} - -void disablesoundint(Context &context) { - warning("disablesoundint: STUB"); -} - -void enablesoundint(Context &context) { - warning("enablesoundint: STUB"); -} - -void checksoundint(Context &context) { - context.data.byte(kTestresult) = 1; - warning("checksoundint: STUB"); -} - -void setsoundoff(Context &context) { - warning("setsoundoff: STUB"); -} - -void readheader(Context &context); - -void loadsample(Context &context) { - context.engine->loadSounds(0, (const char *)context.data.ptr(context.dx, 13)); -} - -void cancelch0(Context &context); -void cancelch1(Context &context); - -void loadsecondsample(Context &context) { - uint8 ch0 = context.data.byte(kCh0playing); - if (ch0 >= 12 && ch0 != 255) - cancelch0(context); - uint8 ch1 = context.data.byte(kCh1playing); - if (ch1 >= 12) - cancelch1(context); - context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); -} - -void createname(Context &context); - -void loadspeech(Context &context) { - cancelch1(context); - context.data.byte(kSpeechloaded) = 0; - createname(context); - const char *name = (const char *)context.data.ptr(context.di, 13); - //warning("name = %s", name); - if (context.engine->loadSpeech(name)) - context.data.byte(kSpeechloaded) = 1; -} - -void saveseg(Context &context) { - context.cx = context.es.word(context.di); - context._add(context.di, 2); - savefilewrite(context); -} - -void savefilewrite(Context &context) { - context.ax = context.engine->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); -} - -void savefileread(Context &context) { - context.ax = context.engine->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); -} - -void loadseg(Context &context) { - context.ax = context.es.word(context.di); - context.di += 2; - - uint16 dst_offset = context.dx; - uint16 size = context.ax; - - debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); - context.flags._c = false; -} - -void error(Context &context) { - ::error("error"); -} - -void generalerror(Context &context) { - ::error("generalerror"); -} - -void commandonly(Context &context); - -void dosreturn(Context &context) { - context._cmp(context.data.byte(kCommandtype), 250); - if (context.flags.z()) goto alreadydos; - context.data.byte(kCommandtype) = 250; - context.al = 46; - commandonly(context); -alreadydos: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) return; - - quickquit2(context); - quickquit(context); -} - -void set16colpalette(Context &context) { -} - -void mode640x480(Context &context) { - // Video mode 12h: 640x480 pixels, 16 colors, I believe - context.al = 0x12 + 128; - context.ah = 0; - initGraphics(640, 480, true); -} - -void showgroup(Context &context) { - context.engine->setPalette(); -} - -void fadedos(Context &context) { - context.engine->fadeDos(); -} - -void doshake(Context &context) { - uint8 &counter = context.data.byte(kShakecounter); - context._cmp(counter, 48); - if (context.flags.z()) - return; - - context._add(counter, 1); - static const int shakeTable[] = { - 0, -2, 3, -2, 0, 2, 4, -1, - 1, -3, 3, 2, 0, -2, 3, -2, - 0, 2, 4, -1, 1, -3, 3, 2, - 0, -2, 3, -2, 0, 2, 4, -1, - - 1, -3, 3, 2, 0, -2, 3, -2, - 0, 2, 4, -1, 1, -3, 3, 2, - 0, -2, 3, -2, 0, 2, 4, -1, - 1, -3, 3, 2, 0, -2, 3, -2, - - 0, 2, 4, -1, 1, -3, 3, 2, - 0, -2, 3, -2, 0, 2, 4, -1, - 1, -3, 3, 2, 0, -2, 3, -2, - 0, 2, 4, -1, 1, -3, 3, 2, - - 0, -2, 3, -2, 0, 2, 4, -1, - 1, -3, 3, 0, - }; - int offset = shakeTable[counter]; - context.engine->setShakePos(offset >= 0? offset: -offset); -} - -void vsync(Context &context) { - context.engine->waitForVSync(); -} - -void setmode(Context &context) { - vsync(context); - context.engine->setGraphicsMode(); -} - -void readoneblock(Context &context) { - context.ds = context.data.word(kWorkspace); - context.cx = 30000; - context.dx = 0; - readfromfile(context); -} - -void showpcx(Context &context) { - Common::String name = getFilename(context); - Common::File pcxFile; - - if (!pcxFile.open(name)) { - warning("showpcx: Could not open '%s'", name.c_str()); - return; - } - - 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); - context.es = context.data.word(kBuffers); - maingamepal = context.es.ptr(4782, 768); //fixme: hardcoded offset - pcxFile.read(maingamepal, 48); - - memset(maingamepal + 48, 0xff, 720); - for (i = 0; i < 48; i++) { - maingamepal[i] >>= 2; - } - - // Decode the image data. - - Graphics::Surface *s = g_system->lockScreen(); - Common::Rect rect(640, 480); - - s->fillRect(rect, 0); - pcxFile.seek(128, SEEK_SET); - - for (int y = 0; y < 480; y++) { - byte *dst = (byte *)s->getBasePtr(0, y); - int decoded = 0; - - while (decoded < 320) { - byte col = pcxFile.readByte(); - byte len; - - if ((col & 0xc0) == 0xc0) { - len = col & 0x3f; - col = pcxFile.readByte(); - } else { - len = 1; - } - - // The image uses 16 colors and is stored as four bit - // planes, one for each bit of the color, least - // significant bit plane first. - - for (i = 0; i < len; i++) { - int plane = decoded / 80; - int pos = decoded % 80; - - for (j = 0; j < 8; j++) { - byte bit = (col >> (7 - j)) & 1; - dst[8 * pos + j] |= (bit << plane); - } - - decoded++; - } - } - } - - g_system->unlockScreen(); - pcxFile.close(); -} - -} /*namespace dreamgen */ diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 0f5e5bdc98..9ed02b6283 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -32,6 +32,7 @@ #include "common/rect.h" #include "common/savefile.h" #include "common/scummsys.h" +#include "common/system.h" #include "audio/audiostream.h" #include "audio/mixer.h" @@ -83,7 +84,6 @@ public: void mouseCall(); //fill mouse pos and button state void processEvents(); - void setGraphicsMode(); void setPalette(); void fadeDos(); void blit(const uint8 *src, int pitch, int x, int y, int w, int h); diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk index d39270bde6..3b0c7f3325 100644 --- a/engines/dreamweb/module.mk +++ b/engines/dreamweb/module.mk @@ -4,7 +4,8 @@ MODULE_OBJS := \ console.o \ detection.o \ dreamweb.o \ - dreamgen.o + dreamgen.o \ + stubs.o # This module can be built as a plugin ifeq ($(ENABLE_DREAMWEB), DYNAMIC_PLUGIN) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp new file mode 100644 index 0000000000..1a6cb7685d --- /dev/null +++ b/engines/dreamweb/stubs.cpp @@ -0,0 +1,535 @@ +#include "dreamweb/dreamweb.h" +#include "engines/util.h" +#include "graphics/surface.h" + +namespace dreamgen { + +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 multiget(Context &context) { + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned x = (uint16)context.di, y = (uint16)context.bx; + unsigned src = x + y * kScreenwidth; + unsigned dst = (uint16)context.si; + context.es = context.ds; + context.ds = context.data.word(kWorkspace); + if (y + h > 200) + 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)context.ds, (uint16)context.es); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + kScreenwidth * l, w); + uint8 *dst_p = context.es.ptr(dst + w * l, w); + memcpy(dst_p, src_p, w); + } + context.si += w * h; + context.di = src + kScreenwidth * h; + context.cx = 0; +} + +void multiput(Context &context) { + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned x = (uint16)context.di, y = (uint16)context.bx; + unsigned src = (uint16)context.si; + unsigned dst = x + y * kScreenwidth; + context.es = context.data.word(kWorkspace); + if (y + h > 200) + h = 200 - y; + if (x + w > 320) + w = 320 - x; + //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + w * l, w); + uint8 *dst_p = context.es.ptr(dst + kScreenwidth * l, w); + memcpy(dst_p, src_p, w); + } + context.si += w * h; + context.di = dst + kScreenwidth * h; + context.cx = 0; +} + +void multidump(Context &context) { + context.ds = context.data.word(kWorkspace); + int w = (uint8)context.cl, h = (uint8)context.ch; + int x = (int16)context.di, y = (int16)context.bx; + unsigned offset = x + y * kScreenwidth; + //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); + context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); + context.si = context.di = offset + h * kScreenwidth; + context.cx = 0; +} + +void worktoscreen(Context &context) { + context.ds = context.data.word(kWorkspace); + uint size = 320 * 200; + context.engine->blit(context.ds.ptr(0, size), 320, 0, 0, 320, 200); + context.di = context.si = size; + context.cx = 0; +} + +void printundermon(Context &context) { + context.engine->printUnderMonitor(); +} + +void cls(Context &context) { + context.engine->cls(); +} + +void frameoutnm(Context &context) { + unsigned w = (uint8)context.cl, h = (uint8)context.ch; + unsigned pitch = (uint16)context.dx; + unsigned src = (uint16)context.si; + int x = (uint16)context.di, y = (uint16)context.bx; + unsigned dst = x + y * pitch; + //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)context.ds, (uint16)context.es); + for(unsigned l = 0; l < h; ++l) { + uint8 *src_p = context.ds.ptr(src + w * l, w); + uint8 *dst_p = context.es.ptr(dst + pitch * l, w); + memcpy(dst_p, src_p, w); + } + context.di += dst + pitch * h; + context.si += w * h; + context.cx = 0; +} + +void seecommandtail(Context &context) { + context.data.word(kSoundbaseadd) = 0x220; + context.data.byte(kSoundint) = 5; + context.data.byte(kSounddmachannel) = 1; + context.data.byte(kBrightness) = 1; + context.data.word(kHowmuchalloc) = 0x9360; +} + +void randomnumber(Context &context) { + context.al = context.engine->randomNumber(); +} + +void quickquit(Context &context) { + context.engine->quit(); +} + +void quickquit2(Context &context) { + context.engine->quit(); +} + +void keyboardread(Context &context) { + ::error("keyboardread"); //this keyboard int handler, must never be called +} + +void resetkeyboard(Context &context) { +} + +void setkeyboardint(Context &context) { +} + +void readfromfile(Context &context) { + uint16 dst_offset = context.dx; + uint16 size = context.cx; + debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); + context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); + context.flags._c = false; +} + +void closefile(Context &context) { + context.engine->closeFile(); + context.data.byte(kHandle) = 0; +} + +void openforsave(Context &context) { + const char *name = (const char *)context.ds.ptr(context.dx, 13); + debug(1, "openforsave(%s)", name); + context.engine->openSaveFileForWriting(name); +} + +void openfilenocheck(Context &context) { + const char *name = (const char *)context.ds.ptr(context.dx, 13); + debug(1, "checksavefile(%s)", name); + bool ok = context.engine->openSaveFileForReading(name); + context.flags._c = !ok; +} + +void openfilefromc(Context &context) { + openfilenocheck(context); +} + +void openfile(Context &context) { + Common::String name = getFilename(context); + debug(1, "opening file: %s", name.c_str()); + context.engine->openFile(name); + context.cs.word(kHandle) = 1; //only one handle + context.flags._c = false; +} + +void createfile(Context &context) { + ::error("createfile"); +} + +void dontloadseg(Context &context) { + context.ax = context.es.word(context.di); + context._add(context.di, 2); + context.dx = context.ax; + context.cx = 0; + unsigned pos = context.engine->skipBytes(context.dx); + context.dx = pos >> 16; + context.ax = pos & 0xffff; + context.flags._c = false; +} + +void mousecall(Context &context) { + context.engine->mouseCall(); +} + +void setmouse(Context &context) { + context.data.word(kOldpointerx) = 0xffff; + //warning("setmouse: fixme: add range setting"); + //set vertical range to 15-184 + //set horizontal range to 15-298*2 +} + +void gettime(Context &context) { + TimeDate t; + g_system->getTimeAndDate(t); + debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); + context.ch = t.tm_hour; + context.cl = t.tm_min; + context.dh = t.tm_sec; + context.data.byte(kSecondcount) = context.dh; + context.data.byte(kMinutecount) = context.cl; + context.data.byte(kHourcount) = context.ch; +} + +void allocatemem(Context &context) { + uint size = (context.bx + 2) * 16; + debug(1, "allocate mem, %u bytes", size); + context.flags._c = false; + SegmentRef seg = context.allocateSegment(size); + context.ax = (uint16)seg; + debug(1, "\tsegment address -> %04x", (uint16)context.ax); +} + +void deallocatemem(Context &context) { + uint16 id = (uint16)context.es; + debug(1, "deallocating segment %04x", id); + context.deallocateSegment(id); + + //fixing invalid entries in the sprite table + context.es = context.data; + uint tsize = 16 * 32; + uint16 bseg = context.data.word(kBuffers); + if (!bseg) + return; + SegmentRef buffers(&context); + buffers = bseg; + uint8 *ptr = buffers.ptr(kSpritetable, tsize); + 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) + memset(ptr + i, 0xff, 32); + } +} + +void removeemm(Context &context) { + ::error("removeemm"); +} + +void setupemm(Context &context) { + //fixme: double check this, but it seems that emm pages used only for sound +} + +void pitinterupt(Context &context) { + ::error("pitinterupt"); +} + +void getridofpit(Context &context) { + ::error("getridofpit"); +} + +void setuppit(Context &context) { + ::error("setuppit"); +} + +void startdmablock(Context &context) { + ::error("startdmablock"); +} + +void dmaend(Context &context) { + ::error("dmaend"); +} + +void restoreems(Context &context) { + ::error("restoreems"); +} + +void saveems(Context &context) { + ::error("saveems"); +} + +void bothchannels(Context &context) { + ::error("bothchannels"); +} + +void channel1only(Context &context) { + ::error("channel1only"); +} + +void channel0only(Context &context) { + ::error("channel0only"); +} + +void out22c(Context &context) { + ::error("out22c"); +} + +void soundstartup(Context &context) { +} + +void soundend(Context &context) { +} + +void interupttest(Context &context) { + ::error("interupttest"); +} + +void disablesoundint(Context &context) { + warning("disablesoundint: STUB"); +} + +void enablesoundint(Context &context) { + warning("enablesoundint: STUB"); +} + +void checksoundint(Context &context) { + context.data.byte(kTestresult) = 1; + warning("checksoundint: STUB"); +} + +void setsoundoff(Context &context) { + warning("setsoundoff: STUB"); +} + +void readheader(Context &context); + +void loadsample(Context &context) { + context.engine->loadSounds(0, (const char *)context.data.ptr(context.dx, 13)); +} + +void cancelch0(Context &context); +void cancelch1(Context &context); + +void loadsecondsample(Context &context) { + uint8 ch0 = context.data.byte(kCh0playing); + if (ch0 >= 12 && ch0 != 255) + cancelch0(context); + uint8 ch1 = context.data.byte(kCh1playing); + if (ch1 >= 12) + cancelch1(context); + context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); +} + +void createname(Context &context); + +void loadspeech(Context &context) { + cancelch1(context); + context.data.byte(kSpeechloaded) = 0; + createname(context); + const char *name = (const char *)context.data.ptr(context.di, 13); + //warning("name = %s", name); + if (context.engine->loadSpeech(name)) + context.data.byte(kSpeechloaded) = 1; +} + +void saveseg(Context &context) { + context.cx = context.es.word(context.di); + context._add(context.di, 2); + savefilewrite(context); +} + +void savefilewrite(Context &context) { + context.ax = context.engine->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); +} + +void savefileread(Context &context) { + context.ax = context.engine->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); +} + +void loadseg(Context &context) { + context.ax = context.es.word(context.di); + context.di += 2; + + uint16 dst_offset = context.dx; + uint16 size = context.ax; + + debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); + context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); + context.flags._c = false; +} + +void error(Context &context) { + ::error("error"); +} + +void generalerror(Context &context) { + ::error("generalerror"); +} + +void commandonly(Context &context); + +void dosreturn(Context &context) { + context._cmp(context.data.byte(kCommandtype), 250); + if (context.flags.z()) goto alreadydos; + context.data.byte(kCommandtype) = 250; + context.al = 46; + commandonly(context); +alreadydos: + context.ax = context.data.word(kMousebutton); + context._and(context.ax, 1); + if (context.flags.z()) return; + + quickquit2(context); + quickquit(context); +} + +void set16colpalette(Context &context) { +} + +void mode640x480(Context &context) { + // Video mode 12h: 640x480 pixels, 16 colors, I believe + context.al = 0x12 + 128; + context.ah = 0; + initGraphics(640, 480, true); +} + +void showgroup(Context &context) { + context.engine->setPalette(); +} + +void fadedos(Context &context) { + context.engine->fadeDos(); +} + +void doshake(Context &context) { + uint8 &counter = context.data.byte(kShakecounter); + context._cmp(counter, 48); + if (context.flags.z()) + return; + + context._add(counter, 1); + static const int shakeTable[] = { + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + + 0, 2, 4, -1, 1, -3, 3, 2, + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 2, 0, -2, 3, -2, + 0, 2, 4, -1, 1, -3, 3, 2, + + 0, -2, 3, -2, 0, 2, 4, -1, + 1, -3, 3, 0, + }; + int offset = shakeTable[counter]; + context.engine->setShakePos(offset >= 0? offset: -offset); +} + +void vsync(Context &context) { + context.engine->waitForVSync(); +} + +void setmode(Context &context) { + vsync(context); + initGraphics(320, 200, false); +} + +void readoneblock(Context &context) { + context.ds = context.data.word(kWorkspace); + context.cx = 30000; + context.dx = 0; + readfromfile(context); +} + +void showpcx(Context &context) { + Common::String name = getFilename(context); + Common::File pcxFile; + + if (!pcxFile.open(name)) { + warning("showpcx: Could not open '%s'", name.c_str()); + return; + } + + 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); + context.es = context.data.word(kBuffers); + maingamepal = context.es.ptr(4782, 768); //fixme: hardcoded offset + pcxFile.read(maingamepal, 48); + + memset(maingamepal + 48, 0xff, 720); + for (i = 0; i < 48; i++) { + maingamepal[i] >>= 2; + } + + // Decode the image data. + + Graphics::Surface *s = g_system->lockScreen(); + Common::Rect rect(640, 480); + + s->fillRect(rect, 0); + pcxFile.seek(128, SEEK_SET); + + for (int y = 0; y < 480; y++) { + byte *dst = (byte *)s->getBasePtr(0, y); + int decoded = 0; + + while (decoded < 320) { + byte col = pcxFile.readByte(); + byte len; + + if ((col & 0xc0) == 0xc0) { + len = col & 0x3f; + col = pcxFile.readByte(); + } else { + len = 1; + } + + // The image uses 16 colors and is stored as four bit + // planes, one for each bit of the color, least + // significant bit plane first. + + for (i = 0; i < len; i++) { + int plane = decoded / 80; + int pos = decoded % 80; + + for (j = 0; j < 8; j++) { + byte bit = (col >> (7 - j)) & 1; + dst[8 * pos + j] |= (bit << plane); + } + + decoded++; + } + } + } + + g_system->unlockScreen(); + pcxFile.close(); +} + +} /*namespace dreamgen */ -- cgit v1.2.3 From dc1c1d48d9aee7bbaca7f6643e46ec1228f3ac7f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 01:21:24 +0400 Subject: DREAMWEB: added savefiles enumeration --- engines/dreamweb/detection.cpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 10f727f02e..fac2fb7446 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -25,11 +25,13 @@ #include "base/plugins.h" -#include "engines/advancedDetector.h" +#include "common/algorithm.h" #include "common/system.h" #include "dreamweb/dreamweb.h" +#include "engines/advancedDetector.h" + namespace DreamWeb { struct DreamWebGameDescription { @@ -70,7 +72,14 @@ public: }; bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { - return false; + switch(f) { + case kSupportsListSaves: + case kSupportsLoadingDuringStartup: + case kSupportsDeleteSave: + return true; + default: + return false; + } } bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const { @@ -86,13 +95,29 @@ bool DreamWebMetaEngine::createInstance(OSystem *syst, Engine **engine, const AD } SaveStateList DreamWebMetaEngine::listSaves(const char *target) const { - //Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); + Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); + Common::StringArray files = saveFileMan->listSavefiles("DREAMWEB.D??"); + Common::sort(files.begin(), files.end()); + SaveStateList saveList; + for(uint i = 0; i < files.size(); ++i) { + const Common::String &file = files[i]; + Common::InSaveFile *stream = saveFileMan->openForLoading(file); + if (!stream) + error("cannot open save file %s", file.c_str()); + char name[13] = {}; + stream->seek(0x61); + stream->read(name, sizeof(name) - 1); + delete stream; + + SaveStateDescriptor sd(i, name); + saveList.push_back(sd); + } return saveList; } -int DreamWebMetaEngine::getMaximumSaveSlot() const { return 99; } +int DreamWebMetaEngine::getMaximumSaveSlot() const { return 6; } void DreamWebMetaEngine::removeSaveState(const char *target, int slot) const { } -- cgit v1.2.3 From 7be9a575243584ab0732098d57bdf448009f1533 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 15 Jun 2011 22:32:38 +0200 Subject: COMMON: Fix code formatting, rename stuff for consistency --- common/array.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/array.h b/common/array.h index ff32d3d94c..e5434091fb 100644 --- a/common/array.h +++ b/common/array.h @@ -252,11 +252,11 @@ public: _size = newSize; } - void assign(const T *srcBegin, const T *srcEnd) { - resize(distance(srcBegin, srcEnd)); //fixme: ineffective? + void assign(const_iterator first, const_iterator last) { + resize(distance(first, last)); // FIXME: ineffective? T *dst = _storage; - while(srcBegin != srcEnd) - *dst++ = *srcBegin++; + while (first != last) + *dst++ = *first++; } protected: -- cgit v1.2.3 From 6bb745c16e902b8f3f396711734f1548566fda22 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 16 Jun 2011 01:24:58 +0100 Subject: MOHAWK: Fix Memory Leak in PE Cursor Loading. --- engines/mohawk/cursors.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index f95084de8e..a797e4e127 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -274,6 +274,7 @@ void PECursorManager::setCursor(uint16 id) { Graphics::WinCursor *cursor = cursorGroup->cursors[0].cursor; CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor()); CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256); + delete cursorGroup; return; } } -- cgit v1.2.3 From 3da9bf5cc9134deaa108e6767371bdc44d31dee4 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 10:41:47 +0400 Subject: DREAMWEB: Fixed size of the save file title --- engines/dreamweb/detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index fac2fb7446..a5cb7b585f 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -105,7 +105,7 @@ SaveStateList DreamWebMetaEngine::listSaves(const char *target) const { Common::InSaveFile *stream = saveFileMan->openForLoading(file); if (!stream) error("cannot open save file %s", file.c_str()); - char name[13] = {}; + char name[17] = {}; stream->seek(0x61); stream->read(name, sizeof(name) - 1); delete stream; -- cgit v1.2.3 From 51905728c3f7ae94b54d5a364289cf266c886fae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Jun 2011 18:38:19 +1000 Subject: DREAMWEB: Added detection for second CD version --- engines/dreamweb/detection_tables.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 1062b50d6b..f9bc75b298 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -61,6 +61,24 @@ static const DreamWebGameDescription gameDescriptions[] = { GUIO_NONE }, }, + + // Second CD version + { + { + "dreamweb", + "CD", + { + {"dreamweb.r00", 0, "8acafd7f4418d08d0e16b65b8b10bc50", 152983}, + {"dreamweb.r02", 0, "c0c363715ddf14ab54f2379906a3aa01", 198707}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformPC, + ADGF_CD, + GUIO_NONE + }, + }, + { AD_TABLE_END_MARKER } }; -- cgit v1.2.3 From c6ae2acae5750674f8291624d99838281954ebe1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Jun 2011 18:44:37 +1000 Subject: TSAGE: Added correct 5000 byte MD5 for Ringworld Demo #2 --- engines/tsage/detection_tables.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index fb97e40449..4cd74ff13d 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -66,14 +66,13 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY | GF_DEMO }, -#if 0 - // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) + // Ringworld English Floppy Demo #2 version { { "ring", "Floppy Demo", - AD_ENTRY1s("demoring.rlb", "9ecf48e088a0d475778fab480b3dbdd0", 832206), + AD_ENTRY1s("demoring.rlb", "64050e1806203b15bb03876140eb4f56", 832206), Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, @@ -82,6 +81,7 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld, GF_FLOPPY | GF_DEMO | GF_ALT_REGIONS }, +#if 0 // FIXME: Compute new MD5s based on 5000 bytes instead of 0 (unlimited) // Blue Force floppy { -- cgit v1.2.3 From c48b90f7a3e43fdefe35950e573cf6df5fdb916f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Jun 2011 19:12:36 +1000 Subject: DREAMWEB: Clarified 2nd CD version as the US release --- engines/dreamweb/detection_tables.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index f9bc75b298..13184650ba 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -46,6 +46,8 @@ static const DreamWebGameDescription gameDescriptions[] = { GUIO_NONE }, }, + + // International CD release { { "dreamweb", @@ -62,7 +64,7 @@ static const DreamWebGameDescription gameDescriptions[] = { }, }, - // Second CD version + // US CD release { { "dreamweb", @@ -72,7 +74,7 @@ static const DreamWebGameDescription gameDescriptions[] = { {"dreamweb.r02", 0, "c0c363715ddf14ab54f2379906a3aa01", 198707}, AD_LISTEND }, - Common::EN_ANY, + Common::EN_USA, Common::kPlatformPC, ADGF_CD, GUIO_NONE -- cgit v1.2.3 From 15bc708610822d98133ff5fefb52ca55fa8ddd83 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Jun 2011 22:00:33 +1000 Subject: TSAGE: Bugfix for _sfRethinkVoiceTypes type 1 handling --- engines/tsage/sound.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index f8f0cf6019..61254bb21f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -778,6 +778,7 @@ void SoundManager::_sfRethinkVoiceTypes() { int maxPriority = 0; for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) maxPriority = MAX(maxPriority, vtStruct->_entries[idx]._type1._priority2); + if (!maxPriority) { _sfUpdateVoiceStructs2(); break; @@ -793,11 +794,11 @@ void SoundManager::_sfRethinkVoiceTypes() { } } while (chNumVoices > numVoices); - int voicesCtr = numVoices; + int voicesCtr = chNumVoices; for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) { if (!vtStruct->_entries[idx]._type1._sound2) { vtStruct->_entries[idx]._type1._sound2 = sound; - vtStruct->_entries[idx]._type1._channelNum2 = idx; + vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; vtStruct->_entries[idx]._type1._priority2 = foundPriority; --voicesCtr; } @@ -2509,7 +2510,17 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) { void AdlibSoundDriver::write(byte reg, byte value) { static int num = 1; -debug("%d [%x]=%x", num++, reg, value);//***DEBUG**** +/* + if (((num - 1) % 8) == 0) + debugN("\n9800:%.4x ", (num - 1) * 2 + 2); + + debugN("%.2x %.2x ", reg, value); + ++num; +*/ +debugN("%d [%x]=%x ", num++, reg, value);//***DEBUG**** + for (int idx = 0; idx < 16; ++idx) debugN("%d", _channelVoiced[idx] ? 1 : 0); + debugN("\n"); + _portContents[reg] = value; OPLWriteReg(_opl, reg, value); } -- cgit v1.2.3 From 3a1b1a081a9ecc06547d91e6f7ae1fff56da2d83 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 16:05:05 +0400 Subject: DREAMWEB: Added engine to the credits --- devtools/credits.pl | 5 +++++ gui/credits.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/devtools/credits.pl b/devtools/credits.pl index b0f40cbe6e..bf48304af3 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -523,6 +523,11 @@ begin_credits("Credits"); add_person("Paweł Kołodziejski", "aquadran", ""); end_section(); + begin_section("DreamWeb"); + add_person("Vladimir Menshakov", "whoozle", ""); + add_person("Torbjörn Andersson", "eriktorbjorn", ""); + end_section(); + begin_section("Gob"); add_person("Torbjörn Andersson", "eriktorbjorn", ""); add_person("Arnaud Boutonné", "Strangerke", ""); diff --git a/gui/credits.h b/gui/credits.h index 1b13b31829..ba679c433c 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -83,6 +83,10 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Pawel Kolodziejski", "", +"C1""DreamWeb", +"C0""Vladimir Menshakov", +"C0""Torbj\366rn Andersson", +"", "C1""Gob", "C0""Torbj\366rn Andersson", "C0""Arnaud Boutonn\351", -- cgit v1.2.3 From 5bd4e3ac6f1a1f09597dad3ca7e6c9df2c17e1be Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 16:20:51 +0400 Subject: DREAMWEB: added engine to AUTHORS --- AUTHORS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 89ad7dc1b2..feaa178e6e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -68,6 +68,10 @@ ScummVM Team Filippos Karapetis Pawel Kolodziejski + DreamWeb: + Vladimir Menshakov + Torbjorn Andersson + Gob: Torbjorn Andersson Arnaud Boutonne @@ -223,7 +227,7 @@ ScummVM Team PocketPC / WinCE: Nicolas Bacca - (retired) Ismail Khatib - Kostas Nakos - (retired) + Kostas Nakos - (retired) PlayStation 2: Robert Goeffringmann - (retired) -- cgit v1.2.3 From 4fd3cdf984567221035537e4bcab6ff8499d2c4a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 16:31:17 +0400 Subject: DREAMWEB: Improved code formatting --- devtools/tasmrecover/tasm-recover | 2 +- devtools/tasmrecover/tasm/cpp.py | 32 +- engines/dreamweb/dreamgen.cpp | 5218 ++++++++++++++++++++++++------------- engines/dreamweb/dreamgen.h | 2 +- engines/dreamweb/dreamweb.cpp | 52 +- engines/dreamweb/dreamweb.h | 3 +- engines/dreamweb/runtime.h | 2 +- engines/dreamweb/stubs.cpp | 2 +- 8 files changed, 3516 insertions(+), 1797 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 4284d56de1..35e20d20ab 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -7,7 +7,7 @@ p = parser() p.strip_path = 3 context = p.parse('dreamweb/dreamweb.asm') p.link() -generator = cpp(context, "dreamgen", blacklist = [ +generator = cpp(context, "DreamGen", blacklist = [ 'randomnumber', 'quickquit', 'quickquit2', diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 2420829869..3e5ae78438 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -14,8 +14,8 @@ def parse_bin(s): class cpp: def __init__(self, context, namespace, skip_first = 0, blacklist = []): self.namespace = namespace - fname = namespace + ".cpp" - header = namespace + ".h" + fname = namespace.lower() + ".cpp" + header = namespace.lower() + ".h" banner = "/* PLEASE DO NOT MODIFY THIS FILE. ALL CHANGES WILL BE LOST! LOOK FOR README FOR DETAILS */" self.fd = open(fname, "wt") self.hd = open(header, "wt") @@ -348,34 +348,34 @@ namespace %s { self.body += "\tcontext._test(%s, %s);\n" %self.parse2(a, b) def _js(self, label): - self.body += "\tif (context.flags.s()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jns(self, label): - self.body += "\tif (!context.flags.s()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jz(self, label): - self.body += "\tif (context.flags.z()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jnz(self, label): - self.body += "\tif (!context.flags.z()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jl(self, label): - self.body += "\tif (context.flags.l()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jg(self, label): - self.body += "\tif (!context.flags.le()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jle(self, label): - self.body += "\tif (context.flags.le()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jge(self, label): - self.body += "\tif (!context.flags.l()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jc(self, label): - self.body += "\tif (context.flags.c()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jnc(self, label): - self.body += "\tif (!context.flags.c()) %s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) def _xchg(self, dst, src): self.body += "\tcontext._xchg(%s, %s);\n" %self.parse2(dst, src) @@ -384,7 +384,7 @@ namespace %s { self.body += "\t%s;\n" %(self.jump_to_label(label)) def _loop(self, label): - self.body += "\tif (--context.cx) %s;\n" %self.jump_to_label(label) + self.body += "\tif (--context.cx)\n\t\t%s;\n" %self.jump_to_label(label) def _push(self, regs): p = str(); @@ -403,7 +403,7 @@ namespace %s { self.body += p def _rep(self): - self.body += "\twhile(context.cx--) " + self.body += "\twhile(context.cx--)\n\t" def _lodsb(self): self.body += "\tcontext._lodsb();\n" @@ -418,10 +418,10 @@ namespace %s { self.body += "\tcontext._stosw(%s);\n" %("" if n == 1 else n) def _movsb(self, n): - self.body += "\tcontext._movsb(%s);\n " %("" if n == 1 else n) + self.body += "\tcontext._movsb(%s);\n" %("" if n == 1 else n) def _movsw(self, n): - self.body += "\tcontext._movsw(%s);\n " %("" if n == 1 else n) + self.body += "\tcontext._movsw(%s);\n" %("" if n == 1 else n) def _stc(self): self.body += "\tcontext.flags._c = true;\n " diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index f76a3a5b58..e6b6d738fd 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2,7 +2,7 @@ #include "dreamgen.h" -namespace dreamgen { +namespace DreamGen { void checkbasemem(Context &context); void allocatebuffers(Context &context); @@ -482,7 +482,8 @@ void alleybarksound(Context &context) { context.ax = context.es.word(context.bx+3); context._dec(context.ax); context._cmp(context.ax, 0); - if (!context.flags.z()) goto nobark; + if (!context.flags.z()) + goto nobark; context.push(context.bx); context.push(context.es); context.al = 14; @@ -502,7 +503,8 @@ void foghornsound(Context &context) { STACK_CHECK(context); randomnumber(context); context._cmp(context.al, 198); - if (!context.flags.z()) goto nofog; + if (!context.flags.z()) + goto nofog; context.al = 13; playchannel1(context); nofog: @@ -512,31 +514,38 @@ nofog: void receptionist(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto gotrecep; + if (!context.flags.z()) + goto gotrecep; context._cmp(context.data.byte(kCardpassflag), 1); - if (!context.flags.z()) goto notsetcard; + if (!context.flags.z()) + goto notsetcard; context._inc(context.data.byte(kCardpassflag)); context.es.byte(context.bx+7) = 1; context.es.word(context.bx+3) = 64; notsetcard: context._cmp(context.es.word(context.bx+3), 58); - if (!context.flags.z()) goto notdes1; + if (!context.flags.z()) + goto notdes1; randomnumber(context); context._cmp(context.al, 30); - if (context.flags.c()) goto notdes2; + if (context.flags.c()) + goto notdes2; context.es.word(context.bx+3) = 55; goto gotrecep; notdes1: context._cmp(context.es.word(context.bx+3), 60); - if (!context.flags.z()) goto notdes2; + if (!context.flags.z()) + goto notdes2; randomnumber(context); context._cmp(context.al, 240); - if (context.flags.c()) goto gotrecep; + if (context.flags.c()) + goto gotrecep; context.es.word(context.bx+3) = 53; goto gotrecep; notdes2: context._cmp(context.es.word(context.bx+3), 88); - if (!context.flags.z()) goto notendcard; + if (!context.flags.z()) + goto notendcard; context.es.word(context.bx+3) = 53; goto gotrecep; notendcard: @@ -546,7 +555,8 @@ gotrecep: addtopeoplelist(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 128); - if (context.flags.z()) goto nottalkedrecep; + if (context.flags.z()) + goto nottalkedrecep; context.data.byte(kTalkedtorecep) = 1; nottalkedrecep: return; @@ -555,10 +565,12 @@ nottalkedrecep: void smokebloke(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); - if (!context.flags.z()) goto notspokento; + if (!context.flags.z()) + goto notspokento; context.al = context.es.byte(context.bx+7); context._and(context.al, 128); - if (context.flags.z()) goto notspokento; + if (context.flags.z()) + goto notspokento; context.push(context.es); context.push(context.bx); context.al = 5; @@ -567,17 +579,21 @@ void smokebloke(Context &context) { context.es = context.pop(); notspokento: checkspeed(context); - if (!context.flags.z()) goto gotsmokeb; + if (!context.flags.z()) + goto gotsmokeb; context._cmp(context.es.word(context.bx+3), 100); - if (!context.flags.z()) goto notsmokeb1; + if (!context.flags.z()) + goto notsmokeb1; randomnumber(context); context._cmp(context.al, 30); - if (context.flags.c()) goto notsmokeb2; + if (context.flags.c()) + goto notsmokeb2; context.es.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb1: context._cmp(context.es.word(context.bx+3), 117); - if (!context.flags.z()) goto notsmokeb2; + if (!context.flags.z()) + goto notsmokeb2; context.es.word(context.bx+3) = 96; goto gotsmokeb; notsmokeb2: @@ -593,7 +609,8 @@ void attendant(Context &context) { addtopeoplelist(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 128); - if (context.flags.z()) goto nottalked; + if (context.flags.z()) + goto nottalked; context.data.byte(kTalkedtoattendant) = 1; nottalked: return; @@ -611,7 +628,8 @@ void manasleep(Context &context) { void eden(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); - if (!context.flags.z()) goto notinbed; + if (!context.flags.z()) + goto notinbed; showgamereel(context); addtopeoplelist(context); notinbed: @@ -621,9 +639,11 @@ notinbed: void edeninbath(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); - if (context.flags.z()) goto notinbed; + if (context.flags.z()) + goto notinbed; context._cmp(context.data.byte(kSartaindead), 0); - if (!context.flags.z()) goto notinbath; + if (!context.flags.z()) + goto notinbath; showgamereel(context); addtopeoplelist(context); notinbath: @@ -649,7 +669,8 @@ void femalefan(Context &context) { void louis(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); - if (!context.flags.z()) goto notlouis1; + if (!context.flags.z()) + goto notlouis1; showgamereel(context); addtopeoplelist(context); notlouis1: @@ -659,22 +680,27 @@ notlouis1: void louischair(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); - if (context.flags.z()) goto notlouis2; + if (context.flags.z()) + goto notlouis2; checkspeed(context); - if (!context.flags.z()) goto notlouisanim; + if (!context.flags.z()) + goto notlouisanim; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 191); - if (context.flags.z()) goto restartlouis; + if (context.flags.z()) + goto restartlouis; context._cmp(context.ax, 185); - if (context.flags.z()) goto randomlouis; + if (context.flags.z()) + goto randomlouis; context.es.word(context.bx+3) = context.ax; goto notlouisanim; randomlouis: context.es.word(context.bx+3) = context.ax; randomnumber(context); context._cmp(context.al, 245); - if (!context.flags.c()) goto notlouisanim; + if (!context.flags.c()) + goto notlouisanim; restartlouis: context.ax = 182; context.es.word(context.bx+3) = context.ax; @@ -709,18 +735,22 @@ void tattooman(Context &context) { void drinker(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto gotdrinker; + if (!context.flags.z()) + goto gotdrinker; context._inc(context.es.word(context.bx+3)); context._cmp(context.es.word(context.bx+3), 115); - if (!context.flags.z()) goto notdrinker1; + if (!context.flags.z()) + goto notdrinker1; context.es.word(context.bx+3) = 105; goto gotdrinker; notdrinker1: context._cmp(context.es.word(context.bx+3), 106); - if (!context.flags.z()) goto gotdrinker; + if (!context.flags.z()) + goto gotdrinker; randomnumber(context); context._cmp(context.al, 3); - if (context.flags.c()) goto gotdrinker; + if (context.flags.c()) + goto gotdrinker; context.es.word(context.bx+3) = 105; gotdrinker: showgamereel(context); @@ -730,17 +760,21 @@ gotdrinker: void bartender(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto gotsmoket; + if (!context.flags.z()) + goto gotsmoket; context._cmp(context.es.word(context.bx+3), 86); - if (!context.flags.z()) goto notsmoket1; + if (!context.flags.z()) + goto notsmoket1; randomnumber(context); context._cmp(context.al, 18); - if (context.flags.c()) goto notsmoket2; + if (context.flags.c()) + goto notsmoket2; context.es.word(context.bx+3) = 81; goto gotsmoket; notsmoket1: context._cmp(context.es.word(context.bx+3), 103); - if (!context.flags.z()) goto notsmoket2; + if (!context.flags.z()) + goto notsmoket2; context.es.word(context.bx+3) = 81; goto gotsmoket; notsmoket2: @@ -748,7 +782,8 @@ notsmoket2: gotsmoket: showgamereel(context); context._cmp(context.data.byte(kGunpassflag), 1); - if (!context.flags.z()) goto notgotgun; + if (!context.flags.z()) + goto notgotgun; context.es.byte(context.bx+7) = 9; notgotgun: addtopeoplelist(context); @@ -769,15 +804,19 @@ void barwoman(Context &context) { void interviewer(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), 68); - if (!context.flags.z()) goto notgeneralstart; + if (!context.flags.z()) + goto notgeneralstart; context._inc(context.es.word(context.bx+3)); notgeneralstart: context._cmp(context.es.word(context.bx+3), 250); - if (context.flags.z()) goto talking; + if (context.flags.z()) + goto talking; checkspeed(context); - if (!context.flags.z()) goto talking; + if (!context.flags.z()) + goto talking; context._cmp(context.es.word(context.bx+3), 259); - if (context.flags.z()) goto talking; + if (context.flags.z()) + goto talking; context._inc(context.es.word(context.bx+3)); talking: showgamereel(context); @@ -786,28 +825,35 @@ talking: void soldier1(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 0); - if (context.flags.z()) goto soldierwait; + if (context.flags.z()) + goto soldierwait; context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 30); - if (!context.flags.z()) goto notaftersshot; + if (!context.flags.z()) + goto notaftersshot; context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) goto gotsoldframe; + if (!context.flags.z()) + goto gotsoldframe; context.data.byte(kMandead) = 2; goto gotsoldframe; notaftersshot: checkspeed(context); - if (!context.flags.z()) goto gotsoldframe; + if (!context.flags.z()) + goto gotsoldframe; context._inc(context.es.word(context.bx+3)); goto gotsoldframe; soldierwait: context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto gotsoldframe; + if (!context.flags.z()) + goto gotsoldframe; context.data.word(kWatchingtime) = 10; context._cmp(context.data.byte(kManspath), 2); - if (!context.flags.z()) goto gotsoldframe; + if (!context.flags.z()) + goto gotsoldframe; context._cmp(context.data.byte(kFacing), 4); - if (!context.flags.z()) goto gotsoldframe; + if (!context.flags.z()) + goto gotsoldframe; context._inc(context.es.word(context.bx+3)); context.data.byte(kLastweapon) = -1; context.data.byte(kCombatcount) = 0; @@ -820,30 +866,37 @@ void rockstar(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 303); - if (context.flags.z()) goto rockcombatend; + if (context.flags.z()) + goto rockcombatend; context._cmp(context.ax, 118); - if (context.flags.z()) goto rockcombatend; + if (context.flags.z()) + goto rockcombatend; checkspeed(context); - if (!context.flags.z()) goto rockspeed; + if (!context.flags.z()) + goto rockspeed; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 118); - if (!context.flags.z()) goto notbeforedead; + if (!context.flags.z()) + goto notbeforedead; context.data.byte(kMandead) = 2; goto gotrockframe; notbeforedead: context._cmp(context.ax, 79); - if (!context.flags.z()) goto gotrockframe; + if (!context.flags.z()) + goto gotrockframe; context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto notgunonrock; + if (!context.flags.z()) + goto notgunonrock; context.data.byte(kLastweapon) = -1; context.ax = 123; goto gotrockframe; notgunonrock: context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) goto gotrockframe; + if (!context.flags.z()) + goto gotrockframe; context.data.byte(kCombatcount) = 0; context.ax = 79; gotrockframe: @@ -851,7 +904,8 @@ gotrockframe: rockspeed: showgamereel(context); context._cmp(context.es.word(context.bx+3), 78); - if (!context.flags.z()) goto notalkrock; + if (!context.flags.z()) + goto notalkrock; addtopeoplelist(context); context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; @@ -871,26 +925,32 @@ void helicopter(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 203); - if (context.flags.z()) goto heliwon; + if (context.flags.z()) + goto heliwon; checkspeed(context); - if (!context.flags.z()) goto helispeed; + if (!context.flags.z()) + goto helispeed; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 53); - if (!context.flags.z()) goto notbeforehdead; + if (!context.flags.z()) + goto notbeforehdead; context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 8); - if (context.flags.c()) goto waitabit; + if (context.flags.c()) + goto waitabit; context.data.byte(kMandead) = 2; waitabit: context.ax = 49; goto gotheliframe; notbeforehdead: context._cmp(context.ax, 9); - if (!context.flags.z()) goto gotheliframe; + if (!context.flags.z()) + goto gotheliframe; context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto notgunonheli; + if (!context.flags.z()) + goto notgunonheli; context.data.byte(kLastweapon) = -1; context.ax = 55; goto gotheliframe; @@ -898,7 +958,8 @@ notgunonheli: context.ax = 5; context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 20); - if (!context.flags.z()) goto gotheliframe; + if (!context.flags.z()) + goto gotheliframe; context.data.byte(kCombatcount) = 0; context.ax = 9; gotheliframe: @@ -909,9 +970,11 @@ helispeed: context.es.byte(context.bx+1) = context.al; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 9); - if (!context.flags.c()) goto notwaitingheli; + if (!context.flags.c()) + goto notwaitingheli; context._cmp(context.data.byte(kCombatcount), 7); - if (context.flags.c()) goto notwaitingheli; + if (context.flags.c()) + goto notwaitingheli; context.data.byte(kPointermode) = 2; context.data.word(kWatchingtime) = 0; return; @@ -927,15 +990,19 @@ void mugger(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 138); - if (context.flags.z()) goto endmugger1; + if (context.flags.z()) + goto endmugger1; context._cmp(context.ax, 176); - if (context.flags.z()) goto endmugger2; + if (context.flags.z()) + goto endmugger2; context._cmp(context.ax, 2); - if (!context.flags.z()) goto havesetwatch; + if (!context.flags.z()) + goto havesetwatch; context.data.word(kWatchingtime) = 175*2; havesetwatch: checkspeed(context); - if (!context.flags.z()) goto notmugger; + if (!context.flags.z()) + goto notmugger; context._inc(context.es.word(context.bx+3)); notmugger: showgamereel(context); @@ -1009,7 +1076,8 @@ void businessman(Context &context) { context.data.word(kWatchingtime) = 2; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 2); - if (!context.flags.z()) goto notfirstbiz; + if (!context.flags.z()) + goto notfirstbiz; context.push(context.ax); context.push(context.bx); context.push(context.es); @@ -1024,23 +1092,29 @@ void businessman(Context &context) { context.ax = context.pop(); notfirstbiz: context._cmp(context.ax, 95); - if (context.flags.z()) goto buscombatwonend; + if (context.flags.z()) + goto buscombatwonend; context._cmp(context.ax, 49); - if (context.flags.z()) goto buscombatend; + if (context.flags.z()) + goto buscombatend; checkspeed(context); - if (!context.flags.z()) goto busspeed; + if (!context.flags.z()) + goto busspeed; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 48); - if (!context.flags.z()) goto notbeforedeadb; + if (!context.flags.z()) + goto notbeforedeadb; context.data.byte(kMandead) = 2; goto gotbusframe; notbeforedeadb: context._cmp(context.ax, 15); - if (!context.flags.z()) goto buscombatwon; + if (!context.flags.z()) + goto buscombatwon; context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 3); - if (!context.flags.z()) goto notshieldonbus; + if (!context.flags.z()) + goto notshieldonbus; context.data.byte(kLastweapon) = -1; context.data.byte(kCombatcount) = 0; context.ax = 51; @@ -1048,13 +1122,15 @@ notbeforedeadb: notshieldonbus: context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 20); - if (!context.flags.z()) goto gotbusframe; + if (!context.flags.z()) + goto gotbusframe; context.data.byte(kCombatcount) = 0; context.ax = 15; goto gotbusframe; buscombatwon: context._cmp(context.ax, 91); - if (!context.flags.z()) goto gotbusframe; + if (!context.flags.z()) + goto gotbusframe; context.push(context.bx); context.push(context.es); context.al = 0; @@ -1081,7 +1157,8 @@ busspeed: context.es.byte(context.bx+2) = context.al; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 14); - if (!context.flags.z()) goto buscombatend; + if (!context.flags.z()) + goto buscombatend; context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 2; return; @@ -1096,48 +1173,59 @@ void poolguard(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 214); - if (context.flags.z()) goto combatover2; + if (context.flags.z()) + goto combatover2; context._cmp(context.ax, 258); - if (context.flags.z()) goto combatover2; + if (context.flags.z()) + goto combatover2; context._cmp(context.ax, 185); - if (context.flags.z()) goto combatover1; + if (context.flags.z()) + goto combatover1; context._cmp(context.ax, 0); - if (!context.flags.z()) goto notfirstpool; + if (!context.flags.z()) + goto notfirstpool; context.al = 0; turnpathon(context); notfirstpool: checkspeed(context); - if (!context.flags.z()) goto guardspeed; + if (!context.flags.z()) + goto guardspeed; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 122); - if (!context.flags.z()) goto notendguard1; + if (!context.flags.z()) + goto notendguard1; context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 2); - if (!context.flags.z()) goto notaxeonpool; + if (!context.flags.z()) + goto notaxeonpool; context.data.byte(kLastweapon) = -1; context.ax = 122; goto gotguardframe; notaxeonpool: context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) goto gotguardframe; + if (!context.flags.z()) + goto gotguardframe; context.data.byte(kCombatcount) = 0; context.ax = 195; goto gotguardframe; notendguard1: context._cmp(context.ax, 147); - if (!context.flags.z()) goto gotguardframe; + if (!context.flags.z()) + goto gotguardframe; context._dec(context.ax); context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto notgunonpool; + if (!context.flags.z()) + goto notgunonpool; context.data.byte(kLastweapon) = -1; context.ax = 147; goto gotguardframe; notgunonpool: context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) goto gotguardframe; + if (!context.flags.z()) + goto gotguardframe; context.data.byte(kCombatcount) = 0; context.ax = 220; gotguardframe: @@ -1146,9 +1234,11 @@ guardspeed: showgamereel(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 121); - if (context.flags.z()) goto iswaitingpool; + if (context.flags.z()) + goto iswaitingpool; context._cmp(context.ax, 146); - if (context.flags.z()) goto iswaitingpool; + if (context.flags.z()) + goto iswaitingpool; context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; return; @@ -1170,7 +1260,8 @@ combatover2: context.data.byte(kPointermode) = 0; context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 100); - if (context.flags.c()) goto doneover2; + if (context.flags.c()) + goto doneover2; context.data.word(kWatchingtime) = 0; context.data.byte(kMandead) = 2; doneover2: @@ -1180,24 +1271,30 @@ doneover2: void security(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 32); - if (context.flags.z()) goto securwait; + if (context.flags.z()) + goto securwait; context._cmp(context.es.word(context.bx+3), 69); - if (!context.flags.z()) goto notaftersec; + if (!context.flags.z()) + goto notaftersec; return; notaftersec: context.data.word(kWatchingtime) = 10; checkspeed(context); - if (!context.flags.z()) goto gotsecurframe; + if (!context.flags.z()) + goto gotsecurframe; context._inc(context.es.word(context.bx+3)); goto gotsecurframe; securwait: context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto gotsecurframe; + if (!context.flags.z()) + goto gotsecurframe; context.data.word(kWatchingtime) = 10; context._cmp(context.data.byte(kManspath), 9); - if (!context.flags.z()) goto gotsecurframe; + if (!context.flags.z()) + goto gotsecurframe; context._cmp(context.data.byte(kFacing), 0); - if (!context.flags.z()) goto gotsecurframe; + if (!context.flags.z()) + goto gotsecurframe; context.data.byte(kLastweapon) = -1; context._inc(context.es.word(context.bx+3)); gotsecurframe: @@ -1211,27 +1308,34 @@ void heavy(Context &context) { context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; context._cmp(context.es.word(context.bx+3), 43); - if (context.flags.z()) goto heavywait; + if (context.flags.z()) + goto heavywait; context.data.word(kWatchingtime) = 10; context._cmp(context.es.word(context.bx+3), 70); - if (!context.flags.z()) goto notafterhshot; + if (!context.flags.z()) + goto notafterhshot; context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 80); - if (!context.flags.z()) goto gotheavyframe; + if (!context.flags.z()) + goto gotheavyframe; context.data.byte(kMandead) = 2; goto gotheavyframe; notafterhshot: checkspeed(context); - if (!context.flags.z()) goto gotheavyframe; + if (!context.flags.z()) + goto gotheavyframe; context._inc(context.es.word(context.bx+3)); goto gotheavyframe; heavywait: context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) goto gotheavyframe; + if (!context.flags.z()) + goto gotheavyframe; context._cmp(context.data.byte(kManspath), 5); - if (!context.flags.z()) goto gotheavyframe; + if (!context.flags.z()) + goto gotheavyframe; context._cmp(context.data.byte(kFacing), 4); - if (!context.flags.z()) goto gotheavyframe; + if (!context.flags.z()) + goto gotheavyframe; context.data.byte(kLastweapon) = -1; context._inc(context.es.word(context.bx+3)); context.data.byte(kCombatcount) = 0; @@ -1243,33 +1347,40 @@ gotheavyframe: void bossman(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto notboss; + if (!context.flags.z()) + goto notboss; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 4); - if (context.flags.z()) goto firstdes; + if (context.flags.z()) + goto firstdes; context._cmp(context.ax, 20); - if (context.flags.z()) goto secdes; + if (context.flags.z()) + goto secdes; context._cmp(context.ax, 41); - if (!context.flags.z()) goto gotallboss; + if (!context.flags.z()) + goto gotallboss; context.ax = 0; context._inc(context.data.byte(kGunpassflag)); context.es.byte(context.bx+7) = 10; goto gotallboss; firstdes: context._cmp(context.data.byte(kGunpassflag), 1); - if (context.flags.z()) goto gotallboss; + if (context.flags.z()) + goto gotallboss; context.push(context.ax); randomnumber(context); context.cl = context.al; context.ax = context.pop(); context._cmp(context.cl, 10); - if (context.flags.c()) goto gotallboss; + if (context.flags.c()) + goto gotallboss; context.ax = 0; goto gotallboss; secdes: context._cmp(context.data.byte(kGunpassflag), 1); - if (context.flags.z()) goto gotallboss; + if (context.flags.z()) + goto gotallboss; context.ax = 0; gotallboss: context.es.word(context.bx+3) = context.ax; @@ -1278,7 +1389,8 @@ notboss: addtopeoplelist(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 128); - if (context.flags.z()) goto nottalkedboss; + if (context.flags.z()) + goto nottalkedboss; context.data.byte(kTalkedtoboss) = 1; nottalkedboss: return; @@ -1287,15 +1399,18 @@ nottalkedboss: void gamer(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto gamerfin; + if (!context.flags.z()) + goto gamerfin; gameragain: randomnum1(context); context._and(context.al, 7); context._cmp(context.al, 5); - if (!context.flags.c()) goto gameragain; + if (!context.flags.c()) + goto gameragain; context._add(context.al, 20); context._cmp(context.al, context.es.byte(context.bx+3)); - if (context.flags.z()) goto gameragain; + if (context.flags.z()) + goto gameragain; context.ah = 0; context.es.word(context.bx+3) = context.ax; gamerfin: @@ -1306,7 +1421,8 @@ gamerfin: void sparkydrip(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto cantdrip; + if (!context.flags.z()) + goto cantdrip; context.al = 14; context.ah = 0; playchannel0(context); @@ -1317,7 +1433,8 @@ cantdrip: void carparkdrip(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto cantdrip2; + if (!context.flags.z()) + goto cantdrip2; context.al = 14; playchannel1(context); cantdrip2: @@ -1327,14 +1444,17 @@ cantdrip2: void keeper(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kKeeperflag), 0); - if (!context.flags.z()) goto notwaiting; + if (!context.flags.z()) + goto notwaiting; context._cmp(context.data.word(kReeltowatch), 190); - if (context.flags.c()) goto waiting; + if (context.flags.c()) + goto waiting; context._inc(context.data.byte(kKeeperflag)); context.ah = context.es.byte(context.bx+7); context._and(context.ah, 127); context._cmp(context.ah, context.data.byte(kDreamnumber)); - if (context.flags.z()) goto notdiff; + if (context.flags.z()) + goto notdiff; context.al = context.data.byte(kDreamnumber); context.es.byte(context.bx+7) = context.al; notdiff: @@ -1349,11 +1469,13 @@ waiting: void candles1(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto candle1; + if (!context.flags.z()) + goto candle1; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 44); - if (!context.flags.z()) goto notendcandle1; + if (!context.flags.z()) + goto notendcandle1; context.ax = 39; notendcandle1: context.es.word(context.bx+3) = context.ax; @@ -1364,11 +1486,13 @@ candle1: void smallcandle(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto smallcandlef; + if (!context.flags.z()) + goto smallcandlef; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 37); - if (!context.flags.z()) goto notendsmallcandle; + if (!context.flags.z()) + goto notendsmallcandle; context.ax = 25; notendsmallcandle: context.es.word(context.bx+3) = context.ax; @@ -1379,16 +1503,19 @@ smallcandlef: void intromagic1(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto introm1fin; + if (!context.flags.z()) + goto introm1fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 145); - if (!context.flags.z()) goto gotintrom1; + if (!context.flags.z()) + goto gotintrom1; context.ax = 121; gotintrom1: context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 121); - if (!context.flags.z()) goto introm1fin; + if (!context.flags.z()) + goto introm1fin; context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); @@ -1396,7 +1523,8 @@ gotintrom1: context.bx = context.pop(); context.es = context.pop(); context._cmp(context.data.byte(kIntrocount), 8); - if (!context.flags.z()) goto introm1fin; + if (!context.flags.z()) + goto introm1fin; context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; introm1fin: @@ -1406,11 +1534,13 @@ introm1fin: void candles(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto candlesfin; + if (!context.flags.z()) + goto candlesfin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 167); - if (!context.flags.z()) goto gotcandles; + if (!context.flags.z()) + goto gotcandles; context.ax = 162; gotcandles: context.es.word(context.bx+3) = context.ax; @@ -1421,11 +1551,13 @@ candlesfin: void candles2(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto candles2fin; + if (!context.flags.z()) + goto candles2fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 238); - if (!context.flags.z()) goto gotcandles2; + if (!context.flags.z()) + goto gotcandles2; context.ax = 233; gotcandles2: context.es.word(context.bx+3) = context.ax; @@ -1436,11 +1568,13 @@ candles2fin: void gates(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto gatesfin; + if (!context.flags.z()) + goto gatesfin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 116); - if (!context.flags.z()) goto notbang; + if (!context.flags.z()) + goto notbang; context.push(context.ax); context.push(context.bx); context.push(context.es); @@ -1451,11 +1585,13 @@ void gates(Context &context) { context.ax = context.pop(); notbang: context._cmp(context.ax, 110); - if (context.flags.c()) goto slowgates; + if (context.flags.c()) + goto slowgates; context.es.byte(context.bx+5) = 2; slowgates: context._cmp(context.ax, 120); - if (!context.flags.z()) goto gotgates; + if (!context.flags.z()) + goto gotgates; context.data.byte(kGetback) = 1; context.ax = 119; gotgates: @@ -1472,11 +1608,13 @@ gatesfin: void intromagic2(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto introm2fin; + if (!context.flags.z()) + goto introm2fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 216); - if (!context.flags.z()) goto gotintrom2; + if (!context.flags.z()) + goto gotintrom2; context.ax = 192; gotintrom2: context.es.word(context.bx+3) = context.ax; @@ -1487,11 +1625,13 @@ introm2fin: void intromagic3(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto introm3fin; + if (!context.flags.z()) + goto introm3fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 218); - if (!context.flags.z()) goto gotintrom3; + if (!context.flags.z()) + goto gotintrom3; context.data.byte(kGetback) = 1; gotintrom3: context.es.word(context.bx+3) = context.ax; @@ -1504,33 +1644,41 @@ introm3fin: void intromonks1(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto intromonk1fin; + if (!context.flags.z()) + goto intromonk1fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 80); - if (!context.flags.z()) goto notendmonk1; + if (!context.flags.z()) + goto notendmonk1; context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; showgamereel(context); return; notendmonk1: context._cmp(context.ax, 30); - if (!context.flags.z()) goto gotintromonk1; + if (!context.flags.z()) + goto gotintromonk1; context._sub(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; context.ax = 51; gotintromonk1: context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 5); - if (context.flags.z()) goto waitstep; + if (context.flags.z()) + goto waitstep; context._cmp(context.ax, 15); - if (context.flags.z()) goto waitstep; + if (context.flags.z()) + goto waitstep; context._cmp(context.ax, 25); - if (context.flags.z()) goto waitstep; + if (context.flags.z()) + goto waitstep; context._cmp(context.ax, 61); - if (context.flags.z()) goto waitstep; + if (context.flags.z()) + goto waitstep; context._cmp(context.ax, 71); - if (context.flags.z()) goto waitstep; + if (context.flags.z()) + goto waitstep; goto intromonk1fin; waitstep: context.push(context.es); @@ -1548,11 +1696,13 @@ intromonk1fin: void intromonks2(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto intromonk2fin; + if (!context.flags.z()) + goto intromonk2fin; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 87); - if (!context.flags.z()) goto nottalk1; + if (!context.flags.z()) + goto nottalk1; context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); @@ -1560,7 +1710,8 @@ void intromonks2(Context &context) { context.bx = context.pop(); context.es = context.pop(); context._cmp(context.data.byte(kIntrocount), 19); - if (!context.flags.z()) goto notlasttalk1; + if (!context.flags.z()) + goto notlasttalk1; context.ax = 87; goto gotintromonk2; notlasttalk1: @@ -1568,7 +1719,8 @@ notlasttalk1: goto gotintromonk2; nottalk1: context._cmp(context.ax, 110); - if (!context.flags.z()) goto notraisearm; + if (!context.flags.z()) + goto notraisearm; context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); @@ -1576,7 +1728,8 @@ nottalk1: context.bx = context.pop(); context.es = context.pop(); context._cmp(context.data.byte(kIntrocount), 35); - if (!context.flags.z()) goto notlastraise; + if (!context.flags.z()) + goto notlastraise; context.ax = 111; goto gotintromonk2; notlastraise: @@ -1584,12 +1737,14 @@ notlastraise: goto gotintromonk2; notraisearm: context._cmp(context.ax, 176); - if (!context.flags.z()) goto notendmonk2; + if (!context.flags.z()) + goto notendmonk2; context.data.byte(kGetback) = 1; goto gotintromonk2; notendmonk2: context._cmp(context.ax, 125); - if (!context.flags.z()) goto gotintromonk2; + if (!context.flags.z()) + goto gotintromonk2; context.ax = 140; gotintromonk2: context.es.word(context.bx+3) = context.ax; @@ -1604,7 +1759,8 @@ void handclap(Context &context) { void monks2text(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); - if (!context.flags.z()) goto notmonk2text1; + if (!context.flags.z()) + goto notmonk2text1; context.al = 8; context.bl = 36; context.bh = 160; @@ -1612,7 +1768,8 @@ void monks2text(Context &context) { goto gotmonks2text; notmonk2text1: context._cmp(context.data.byte(kIntrocount), 4); - if (!context.flags.z()) goto notmonk2text2; + if (!context.flags.z()) + goto notmonk2text2; context.al = 9; context.bl = 36; context.bh = 160; @@ -1620,7 +1777,8 @@ notmonk2text1: goto gotmonks2text; notmonk2text2: context._cmp(context.data.byte(kIntrocount), 7); - if (!context.flags.z()) goto notmonk2text3; + if (!context.flags.z()) + goto notmonk2text3; context.al = 10; context.bl = 36; context.bh = 160; @@ -1628,7 +1786,8 @@ notmonk2text2: goto gotmonks2text; notmonk2text3: context._cmp(context.data.byte(kIntrocount), 10); - if (!context.flags.z()) goto notmonk2text4; + if (!context.flags.z()) + goto notmonk2text4; context.data.byte(kIntrocount) = 12; context.al = 11; context.bl = 0; @@ -1637,7 +1796,8 @@ notmonk2text3: goto gotmonks2text; notmonk2text4: context._cmp(context.data.byte(kIntrocount), 13); - if (!context.flags.z()) goto notmonk2text5; + if (!context.flags.z()) + goto notmonk2text5; context.data.byte(kIntrocount) = 17; return; context.al = 12; @@ -1647,7 +1807,8 @@ notmonk2text4: goto gotmonks2text; notmonk2text5: context._cmp(context.data.byte(kIntrocount), 16); - if (!context.flags.z()) goto notmonk2text6; + if (!context.flags.z()) + goto notmonk2text6; context.al = 13; context.bl = 0; context.bh = 135; @@ -1655,7 +1816,8 @@ notmonk2text5: goto gotmonks2text; notmonk2text6: context._cmp(context.data.byte(kIntrocount), 19); - if (!context.flags.z()) goto notmonk2text7; + if (!context.flags.z()) + goto notmonk2text7; context.al = 14; context.bl = 36; context.bh = 160; @@ -1665,7 +1827,8 @@ notmonk2text6: { setuptimedtemp(context); return; }; notmonk2text7: context._cmp(context.data.byte(kIntrocount), 22); - if (!context.flags.z()) goto notmonk2text8; + if (!context.flags.z()) + goto notmonk2text8; context.al = 15; context.bl = 36; context.bh = 160; @@ -1673,7 +1836,8 @@ notmonk2text7: goto gotmonks2text; notmonk2text8: context._cmp(context.data.byte(kIntrocount), 25); - if (!context.flags.z()) goto notmonk2text9; + if (!context.flags.z()) + goto notmonk2text9; context.al = 16; context.bl = 36; context.bh = 160; @@ -1681,7 +1845,8 @@ notmonk2text8: goto gotmonks2text; notmonk2text9: context._cmp(context.data.byte(kIntrocount), 27); - if (!context.flags.z()) goto notmonk2text10; + if (!context.flags.z()) + goto notmonk2text10; context.al = 17; context.bl = 36; context.bh = 160; @@ -1689,7 +1854,8 @@ notmonk2text9: goto gotmonks2text; notmonk2text10: context._cmp(context.data.byte(kIntrocount), 31); - if (!context.flags.z()) goto notmonk2text11; + if (!context.flags.z()) + goto notmonk2text11; context.al = 18; context.bl = 36; context.bh = 160; @@ -1707,7 +1873,8 @@ gotmonks2text: void intro1text(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 2); - if (!context.flags.z()) goto notintro1text1; + if (!context.flags.z()) + goto notintro1text1; context.al = 40; context.bl = 34; context.bh = 130; @@ -1715,7 +1882,8 @@ void intro1text(Context &context) { goto gotintro1text; notintro1text1: context._cmp(context.data.byte(kIntrocount), 4); - if (!context.flags.z()) goto notintro1text2; + if (!context.flags.z()) + goto notintro1text2; context.al = 41; context.bl = 34; context.bh = 130; @@ -1723,7 +1891,8 @@ notintro1text1: goto gotintro1text; notintro1text2: context._cmp(context.data.byte(kIntrocount), 6); - if (!context.flags.z()) goto notintro1text3; + if (!context.flags.z()) + goto notintro1text3; context.al = 42; context.bl = 34; context.bh = 130; @@ -1735,7 +1904,8 @@ gotintro1text: context.dx = 1; context.ah = 82; context._cmp(context.data.byte(kCh1playing), 255); - if (context.flags.z()) goto oktalk2; + if (context.flags.z()) + goto oktalk2; context._dec(context.data.byte(kIntrocount)); return; oktalk2: @@ -1745,7 +1915,8 @@ oktalk2: void intro2text(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 5); - if (!context.flags.z()) goto notintro2text1; + if (!context.flags.z()) + goto notintro2text1; context.al = 43; context.bl = 34; context.bh = 40; @@ -1753,7 +1924,8 @@ void intro2text(Context &context) { goto gotintro2text; notintro2text1: context._cmp(context.ax, 15); - if (!context.flags.z()) goto notintro2text2; + if (!context.flags.z()) + goto notintro2text2; context.al = 44; context.bl = 34; context.bh = 40; @@ -1770,7 +1942,8 @@ gotintro2text: void intro3text(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 107); - if (!context.flags.z()) goto notintro3text1; + if (!context.flags.z()) + goto notintro3text1; context.al = 45; context.bl = 36; context.bh = 56; @@ -1778,7 +1951,8 @@ void intro3text(Context &context) { goto gotintro3text; notintro3text1: context._cmp(context.ax, 108); - if (!context.flags.z()) goto notintro3text2; + if (!context.flags.z()) + goto notintro3text2; context.al = 46; context.bl = 36; context.bh = 56; @@ -1795,11 +1969,13 @@ gotintro3text: void monkandryan(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto notmonkryan; + if (!context.flags.z()) + goto notmonkryan; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 83); - if (!context.flags.z()) goto gotmonkryan; + if (!context.flags.z()) + goto gotmonkryan; context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); @@ -1808,7 +1984,8 @@ void monkandryan(Context &context) { context.es = context.pop(); context.ax = 77; context._cmp(context.data.byte(kIntrocount), 57); - if (!context.flags.z()) goto gotmonkryan; + if (!context.flags.z()) + goto gotmonkryan; context.data.byte(kGetback) = 1; return; gotmonkryan: @@ -1820,13 +1997,16 @@ notmonkryan: void endgameseq(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto notendseq; + if (!context.flags.z()) + goto notendseq; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 51); - if (!context.flags.z()) goto gotendseq; + if (!context.flags.z()) + goto gotendseq; context._cmp(context.data.byte(kIntrocount), 140); - if (context.flags.z()) goto gotendseq; + if (context.flags.z()) + goto gotendseq; context._inc(context.data.byte(kIntrocount)); context.push(context.es); context.push(context.bx); @@ -1837,7 +2017,8 @@ void endgameseq(Context &context) { gotendseq: context.es.word(context.bx+3) = context.ax; context._cmp(context.ax, 134); - if (!context.flags.z()) goto notfadedown; + if (!context.flags.z()) + goto notfadedown; context.push(context.es); context.push(context.bx); context.push(context.ax); @@ -1848,7 +2029,8 @@ gotendseq: goto notendseq; notfadedown: context._cmp(context.ax, 324); - if (!context.flags.z()) goto notfadeend; + if (!context.flags.z()) + goto notfadeend; context.push(context.es); context.push(context.bx); context.push(context.ax); @@ -1860,7 +2042,8 @@ notfadedown: context.es = context.pop(); notfadeend: context._cmp(context.ax, 340); - if (!context.flags.z()) goto notendseq; + if (!context.flags.z()) + goto notendseq; context.data.byte(kGetback) = 1; notendseq: showgamereel(context); @@ -1868,7 +2051,8 @@ notendseq: context.es.byte(context.bx+2) = context.al; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 145); - if (!context.flags.z()) goto notendcreds; + if (!context.flags.z()) + goto notendcreds; context.es.word(context.bx+3) = 146; rollendcredits(context); notendcreds: @@ -1932,7 +2116,8 @@ onelot: printdirect(context); context._add(context.bx, context.data.word(kLinespacing)); context.cx = context.pop(); - if (--context.cx) goto onelot; + if (--context.cx) + goto onelot; vsync(context); context.cl = 160; context.ch = 160; @@ -1945,18 +2130,22 @@ onelot: context.si = context.pop(); context.cx = context.pop(); context._dec(context.bx); - if (--context.cx) goto endcredits2; + if (--context.cx) + goto endcredits2; context.cx = context.pop(); looknext: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); - if (context.flags.z()) goto gotnext; + if (context.flags.z()) + goto gotnext; context._cmp(context.al, 0); - if (context.flags.z()) goto gotnext; + if (context.flags.z()) + goto gotnext; goto looknext; gotnext: - if (--context.cx) goto endcredits1; + if (--context.cx) + goto endcredits1; context.cx = 100; hangon(context); paneltomap(context); @@ -1966,11 +2155,13 @@ gotnext: void priest(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 8); - if (context.flags.z()) goto priestspoken; + if (context.flags.z()) + goto priestspoken; context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; checkspeed(context); - if (!context.flags.z()) goto priestwait; + if (!context.flags.z()) + goto priestwait; context._inc(context.es.word(context.bx+3)); context.push(context.es); context.push(context.bx); @@ -1988,7 +2179,8 @@ void madmanstelly(Context &context) { context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 307); - if (!context.flags.z()) goto notendtelly; + if (!context.flags.z()) + goto notendtelly; context.ax = 300; notendtelly: context.es.word(context.bx+3) = context.ax; @@ -1999,12 +2191,15 @@ void madman(Context &context) { STACK_CHECK(context); context.data.word(kWatchingtime) = 2; checkspeed(context); - if (!context.flags.z()) goto nomadspeed; + if (!context.flags.z()) + goto nomadspeed; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 364); - if (!context.flags.c()) goto ryansded; + if (!context.flags.c()) + goto ryansded; context._cmp(context.ax, 10); - if (!context.flags.z()) goto notfirstmad; + if (!context.flags.z()) + goto notfirstmad; context.push(context.es); context.push(context.bx); context.push(context.ax); @@ -2018,9 +2213,11 @@ void madman(Context &context) { notfirstmad: context._inc(context.ax); context._cmp(context.ax, 294); - if (context.flags.z()) goto madmanspoken; + if (context.flags.z()) + goto madmanspoken; context._cmp(context.ax, 66); - if (!context.flags.z()) goto nomadspeak; + if (!context.flags.z()) + goto nomadspeak; context._inc(context.data.byte(kCombatcount)); context.push(context.es); context.push(context.bx); @@ -2029,11 +2226,14 @@ notfirstmad: context.es = context.pop(); context.ax = 53; context._cmp(context.data.byte(kCombatcount), 64); - if (context.flags.c()) goto nomadspeak; + if (context.flags.c()) + goto nomadspeak; context._cmp(context.data.byte(kCombatcount), 70); - if (context.flags.z()) goto killryan; + if (context.flags.z()) + goto killryan; context._cmp(context.data.byte(kLastweapon), 8); - if (!context.flags.z()) goto nomadspeak; + if (!context.flags.z()) + goto nomadspeak; context.data.byte(kCombatcount) = 72; context.data.byte(kLastweapon) = -1; context.data.byte(kMadmanflag) = 1; @@ -2051,7 +2251,8 @@ nomadspeed: return; madmanspoken: context._cmp(context.data.byte(kWongame), 1); - if (context.flags.z()) goto alreadywon; + if (context.flags.z()) + goto alreadywon; context.data.byte(kWongame) = 1; context.push(context.es); context.push(context.bx); @@ -2068,9 +2269,11 @@ ryansded: void madmantext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSpeechcount), 63); - if (!context.flags.c()) goto nomadtext; + if (!context.flags.c()) + goto nomadtext; context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) goto nomadtext; + if (!context.flags.z()) + goto nomadtext; context.al = context.data.byte(kSpeechcount); context._inc(context.data.byte(kSpeechcount)); context._add(context.al, 47); @@ -2089,9 +2292,11 @@ void madmode(Context &context) { context.data.word(kWatchingtime) = 2; context.data.byte(kPointermode) = 0; context._cmp(context.data.byte(kCombatcount), 65); - if (context.flags.c()) goto iswatchmad; + if (context.flags.c()) + goto iswatchmad; context._cmp(context.data.byte(kCombatcount), 70); - if (!context.flags.c()) goto iswatchmad; + if (!context.flags.c()) + goto iswatchmad; context.data.byte(kPointermode) = 2; iswatchmad: return; @@ -2100,12 +2305,15 @@ iswatchmad: void priesttext(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 2); - if (context.flags.c()) goto nopriesttext; + if (context.flags.c()) + goto nopriesttext; context._cmp(context.es.word(context.bx+3), 7); - if (!context.flags.c()) goto nopriesttext; + if (!context.flags.c()) + goto nopriesttext; context.al = context.es.byte(context.bx+3); context._and(context.al, 1); - if (!context.flags.z()) goto nopriesttext; + if (!context.flags.z()) + goto nopriesttext; context.al = context.es.byte(context.bx+3); context._shr(context.al, 1); context._add(context.al, 50); @@ -2121,7 +2329,8 @@ nopriesttext: void textforend(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 20); - if (!context.flags.z()) goto notendtext1; + if (!context.flags.z()) + goto notendtext1; context.al = 0; context.bl = 34; context.bh = 20; @@ -2129,7 +2338,8 @@ void textforend(Context &context) { goto gotendtext; notendtext1: context._cmp(context.data.byte(kIntrocount), 50); - if (!context.flags.z()) goto notendtext2; + if (!context.flags.z()) + goto notendtext2; context.al = 1; context.bl = 34; context.bh = 20; @@ -2137,7 +2347,8 @@ notendtext1: goto gotendtext; notendtext2: context._cmp(context.data.byte(kIntrocount), 85); - if (!context.flags.z()) goto notendtext3; + if (!context.flags.z()) + goto notendtext3; context.al = 2; context.bl = 34; context.bh = 20; @@ -2154,7 +2365,8 @@ gotendtext: void textformonk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kIntrocount), 1); - if (!context.flags.z()) goto notmonktext1; + if (!context.flags.z()) + goto notmonktext1; context.al = 19; context.bl = 68; context.bh = 154; @@ -2162,7 +2374,8 @@ void textformonk(Context &context) { goto gotmonktext; notmonktext1: context._cmp(context.data.byte(kIntrocount), 5); - if (!context.flags.z()) goto notmonktext2; + if (!context.flags.z()) + goto notmonktext2; context.al = 20; context.bl = 68; context.bh = 38; @@ -2170,7 +2383,8 @@ notmonktext1: goto gotmonktext; notmonktext2: context._cmp(context.data.byte(kIntrocount), 9); - if (!context.flags.z()) goto notmonktext3; + if (!context.flags.z()) + goto notmonktext3; context.al = 21; context.bl = 48; context.bh = 154; @@ -2178,7 +2392,8 @@ notmonktext2: goto gotmonktext; notmonktext3: context._cmp(context.data.byte(kIntrocount), 13); - if (!context.flags.z()) goto notmonktext4; + if (!context.flags.z()) + goto notmonktext4; context.al = 22; context.bl = 68; context.bh = 38; @@ -2186,7 +2401,8 @@ notmonktext3: goto gotmonktext; notmonktext4: context._cmp(context.data.byte(kIntrocount), 15); - if (!context.flags.z()) goto notmonktext5; + if (!context.flags.z()) + goto notmonktext5; context.al = 23; context.bl = 68; context.bh = 154; @@ -2194,7 +2410,8 @@ notmonktext4: goto gotmonktext; notmonktext5: context._cmp(context.data.byte(kIntrocount), 21); - if (!context.flags.z()) goto notmonktext6; + if (!context.flags.z()) + goto notmonktext6; context.al = 24; context.bl = 68; context.bh = 38; @@ -2202,7 +2419,8 @@ notmonktext5: goto gotmonktext; notmonktext6: context._cmp(context.data.byte(kIntrocount), 25); - if (!context.flags.z()) goto notmonktext7; + if (!context.flags.z()) + goto notmonktext7; context.al = 25; context.bl = 68; context.bh = 154; @@ -2210,7 +2428,8 @@ notmonktext6: goto gotmonktext; notmonktext7: context._cmp(context.data.byte(kIntrocount), 29); - if (!context.flags.z()) goto notmonktext8; + if (!context.flags.z()) + goto notmonktext8; context.al = 26; context.bl = 68; context.bh = 38; @@ -2218,7 +2437,8 @@ notmonktext7: goto gotmonktext; notmonktext8: context._cmp(context.data.byte(kIntrocount), 33); - if (!context.flags.z()) goto notmonktext9; + if (!context.flags.z()) + goto notmonktext9; context.al = 27; context.bl = 68; context.bh = 154; @@ -2226,7 +2446,8 @@ notmonktext8: goto gotmonktext; notmonktext9: context._cmp(context.data.byte(kIntrocount), 37); - if (!context.flags.z()) goto notmonktext10; + if (!context.flags.z()) + goto notmonktext10; context.al = 28; context.bl = 68; context.bh = 154; @@ -2234,7 +2455,8 @@ notmonktext9: goto gotmonktext; notmonktext10: context._cmp(context.data.byte(kIntrocount), 41); - if (!context.flags.z()) goto notmonktext11; + if (!context.flags.z()) + goto notmonktext11; context.al = 29; context.bl = 68; context.bh = 38; @@ -2242,7 +2464,8 @@ notmonktext10: goto gotmonktext; notmonktext11: context._cmp(context.data.byte(kIntrocount), 45); - if (!context.flags.z()) goto notmonktext12; + if (!context.flags.z()) + goto notmonktext12; context.al = 30; context.bl = 68; context.bh = 154; @@ -2250,7 +2473,8 @@ notmonktext11: goto gotmonktext; notmonktext12: context._cmp(context.data.byte(kIntrocount), 52); - if (!context.flags.z()) goto notmonktext13; + if (!context.flags.z()) + goto notmonktext13; context.al = 31; context.bl = 68; context.bh = 154; @@ -2258,7 +2482,8 @@ notmonktext12: goto gotmonktext; notmonktext13: context._cmp(context.data.byte(kIntrocount), 53); - if (!context.flags.z()) goto notendtitles; + if (!context.flags.z()) + goto notendtitles; fadescreendowns(context); context.data.byte(kVolumeto) = 7; context.data.byte(kVolumedirection) = 1; @@ -2268,7 +2493,8 @@ gotmonktext: context.dx = 1; context.ah = 82; context._cmp(context.data.byte(kCh1playing), 255); - if (context.flags.z()) goto oktalk; + if (context.flags.z()) + goto oktalk; context._dec(context.data.byte(kIntrocount)); return; oktalk: @@ -2278,7 +2504,8 @@ oktalk: void drunk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); - if (!context.flags.z()) goto trampgone; + if (!context.flags.z()) + goto trampgone; context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; @@ -2291,23 +2518,27 @@ trampgone: void advisor(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto noadvisor; + if (!context.flags.z()) + goto noadvisor; goto noadvisor; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 123); - if (!context.flags.z()) goto notendadvis; + if (!context.flags.z()) + goto notendadvis; context.ax = 106; goto gotadvframe; notendadvis: context._cmp(context.ax, 108); - if (!context.flags.z()) goto gotadvframe; + if (!context.flags.z()) + goto gotadvframe; context.push(context.ax); randomnumber(context); context.cl = context.al; context.ax = context.pop(); context._cmp(context.cl, 3); - if (context.flags.c()) goto gotadvframe; + if (context.flags.c()) + goto gotadvframe; context.ax = 106; gotadvframe: context.es.word(context.bx+3) = context.ax; @@ -2319,25 +2550,30 @@ noadvisor: void copper(Context &context) { STACK_CHECK(context); checkspeed(context); - if (!context.flags.z()) goto nocopper; + if (!context.flags.z()) + goto nocopper; context.ax = context.es.word(context.bx+3); context._inc(context.ax); context._cmp(context.ax, 94); - if (!context.flags.z()) goto notendcopper; + if (!context.flags.z()) + goto notendcopper; context.ax = 64; goto gotcopframe; notendcopper: context._cmp(context.ax, 81); - if (context.flags.z()) goto mightwait; + if (context.flags.z()) + goto mightwait; context._cmp(context.ax, 66); - if (!context.flags.z()) goto gotcopframe; + if (!context.flags.z()) + goto gotcopframe; mightwait: context.push(context.ax); randomnumber(context); context.cl = context.al; context.ax = context.pop(); context._cmp(context.cl, 7); - if (context.flags.c()) goto gotcopframe; + if (context.flags.c()) + goto gotcopframe; context._dec(context.ax); gotcopframe: context.es.word(context.bx+3) = context.ax; @@ -2349,22 +2585,27 @@ nocopper: void sparky(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) goto animsparky; + if (context.flags.z()) + goto animsparky; context.es.byte(context.bx+7) = 3; goto animsparky; animsparky: checkspeed(context); - if (!context.flags.z()) goto finishsparky; + if (!context.flags.z()) + goto finishsparky; context._cmp(context.es.word(context.bx+3), 34); - if (!context.flags.z()) goto notsparky1; + if (!context.flags.z()) + goto notsparky1; randomnumber(context); context._cmp(context.al, 30); - if (context.flags.c()) goto dosparky; + if (context.flags.c()) + goto dosparky; context.es.word(context.bx+3) = 27; goto finishsparky; notsparky1: context._cmp(context.es.word(context.bx+3), 48); - if (!context.flags.z()) goto dosparky; + if (!context.flags.z()) + goto dosparky; context.es.word(context.bx+3) = 27; goto finishsparky; dosparky: @@ -2374,7 +2615,8 @@ finishsparky: addtopeoplelist(context); context.al = context.es.byte(context.bx+7); context._and(context.al, 128); - if (context.flags.z()) goto nottalkedsparky; + if (context.flags.z()) + goto nottalkedsparky; context.data.byte(kTalkedtosparky) = 1; nottalkedsparky: return; @@ -2385,17 +2627,21 @@ void train(Context &context) { return; context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 21); - if (!context.flags.c()) goto notrainyet; + if (!context.flags.c()) + goto notrainyet; context._inc(context.ax); goto gottrainframe; notrainyet: randomnumber(context); context._cmp(context.al, 253); - if (context.flags.c()) goto notrainatall; + if (context.flags.c()) + goto notrainatall; context._cmp(context.data.byte(kManspath), 5); - if (!context.flags.z()) goto notrainatall; + if (!context.flags.z()) + goto notrainatall; context._cmp(context.data.byte(kFinaldest), 5); - if (!context.flags.z()) goto notrainatall; + if (!context.flags.z()) + goto notrainatall; context.ax = 5; gottrainframe: context.es.word(context.bx+3) = context.ax; @@ -2426,7 +2672,8 @@ void showgamereel(Context &context) { STACK_CHECK(context); context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); - if (!context.flags.c()) goto noshow; + if (!context.flags.c()) + goto noshow; context.data.word(kReelpointer) = context.ax; context.push(context.es); context.push(context.bx); @@ -2442,11 +2689,13 @@ noshow: void checkspeed(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLastweapon), -1); - if (!context.flags.z()) goto forcenext; + if (!context.flags.z()) + goto forcenext; context._inc(context.es.byte(context.bx+6)); context.al = context.es.byte(context.bx+6); context._cmp(context.al, context.es.byte(context.bx+5)); - if (!context.flags.z()) goto notspeed; + if (!context.flags.z()) + goto notspeed; context.al = 0; context.es.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); @@ -2462,7 +2711,8 @@ void clearsprites(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); } void makesprite(Context &context) { @@ -2471,7 +2721,8 @@ void makesprite(Context &context) { context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: context._cmp(context.es.byte(context.bx+15), 255); - if (context.flags.z()) goto _tmp17a; + if (context.flags.z()) + goto _tmp17a; context._add(context.bx, (32)); goto _tmp17; _tmp17a: @@ -2489,7 +2740,8 @@ void delsprite(Context &context) { context.di = context.bx; context.cx = (32); context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); } void spriteupdate(Context &context) { @@ -2506,7 +2758,8 @@ _tmp18: context.push(context.bx); context.ax = context.es.word(context.bx); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto _tmp18a; + if (context.flags.z()) + goto _tmp18a; context.push(context.es); context.push(context.ds); context.cx = context.es.word(context.bx+2); @@ -2518,9 +2771,11 @@ _tmp18a: context.bx = context.pop(); context.cx = context.pop(); context._cmp(context.data.byte(kNowinnewroom), 1); - if (context.flags.z()) goto _tmp18b; + if (context.flags.z()) + goto _tmp18b; context._add(context.bx, (32)); - if (--context.cx) goto _tmp18; + if (--context.cx) + goto _tmp18; _tmp18b: return; } @@ -2539,22 +2794,27 @@ prtspriteloop: context.push(context.bx); context.ax = context.es.word(context.bx); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto skipsprite; + if (context.flags.z()) + goto skipsprite; context.al = context.data.byte(kPriority); context._cmp(context.al, context.es.byte(context.bx+23)); - if (!context.flags.z()) goto skipsprite; + if (!context.flags.z()) + goto skipsprite; context._cmp(context.es.byte(context.bx+31), 1); - if (context.flags.z()) goto skipsprite; + if (context.flags.z()) + goto skipsprite; printasprite(context); skipsprite: context.bx = context.pop(); context.cx = context.pop(); context._add(context.bx, (32)); - if (--context.cx) goto prtspriteloop; + if (--context.cx) + goto prtspriteloop; context.cx = context.pop(); context._inc(context.cx); context._cmp(context.cx, 7); - if (!context.flags.z()) goto priorityloop; + if (!context.flags.z()) + goto priorityloop; } void printasprite(Context &context) { @@ -2566,7 +2826,8 @@ void printasprite(Context &context) { context.al = context.es.byte(context.si+11); context.ah = 0; context._cmp(context.al, 220); - if (context.flags.c()) goto notnegative1; + if (context.flags.c()) + goto notnegative1; context.ah = 255; notnegative1: context.bx = context.ax; @@ -2574,7 +2835,8 @@ notnegative1: context.al = context.es.byte(context.si+10); context.ah = 0; context._cmp(context.al, 220); - if (context.flags.c()) goto notnegative2; + if (context.flags.c()) + goto notnegative2; context.ah = 255; notnegative2: context.di = context.ax; @@ -2582,11 +2844,13 @@ notnegative2: context.al = context.es.byte(context.si+15); context.ah = 0; context._cmp(context.es.byte(context.si+30), 0); - if (context.flags.z()) goto steadyframe; + if (context.flags.z()) + goto steadyframe; context.ah = 8; steadyframe: context._cmp(context.data.byte(kPriority), 6); - if (!context.flags.z()) goto notquickp; + if (!context.flags.z()) + goto notquickp; notquickp: showframe(context); context.bx = context.pop(); @@ -2632,13 +2896,15 @@ void findsource(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kCurrentframe); context._cmp(context.ax, 160); - if (!context.flags.c()) goto over1000; + if (!context.flags.c()) + goto over1000; context.ds = context.data.word(kReel1); context.data.word(kTakeoff) = 0; return; over1000: context._cmp(context.ax, 320); - if (!context.flags.c()) goto over1001; + if (!context.flags.c()) + goto over1001; context.ds = context.data.word(kReel2); context.data.word(kTakeoff) = 160; return; @@ -2664,7 +2930,8 @@ void initman(Context &context) { void mainman(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kResetmanxy), 1); - if (!context.flags.z()) goto notinnewroom; + if (!context.flags.z()) + goto notinnewroom; context.data.byte(kResetmanxy) = 0; context.al = context.data.byte(kRyanx); context.ah = context.data.byte(kRyany); @@ -2674,62 +2941,76 @@ void mainman(Context &context) { notinnewroom: context._dec(context.es.byte(context.bx+22)); context._cmp(context.es.byte(context.bx+22), -1); - if (context.flags.z()) goto executewalk; + if (context.flags.z()) + goto executewalk; return; executewalk: context.es.byte(context.bx+22) = 0; context.al = context.data.byte(kTurntoface); context._cmp(context.al, context.data.byte(kFacing)); - if (context.flags.z()) goto facingok; + if (context.flags.z()) + goto facingok; aboutturn(context); goto notwalk; facingok: context._cmp(context.data.byte(kTurndirection), 0); - if (context.flags.z()) goto alreadyturned; + if (context.flags.z()) + goto alreadyturned; context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto alreadyturned; + if (!context.flags.z()) + goto alreadyturned; context.data.byte(kReasseschanges) = 1; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kLeavedirection)); - if (!context.flags.z()) goto alreadyturned; + if (!context.flags.z()) + goto alreadyturned; checkforexit(context); alreadyturned: context.data.byte(kTurndirection) = 0; context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto walkman; + if (!context.flags.z()) + goto walkman; context.es.byte(context.bx+29) = 0; goto notwalk; walkman: context.al = context.es.byte(context.bx+29); context._inc(context.al); context._cmp(context.al, 11); - if (!context.flags.z()) goto notanimend1; + if (!context.flags.z()) + goto notanimend1; context.al = 1; notanimend1: context.es.byte(context.bx+29) = context.al; walking(context); context._cmp(context.data.byte(kLinepointer), 254); - if (context.flags.z()) goto afterwalk; + if (context.flags.z()) + goto afterwalk; context.al = context.data.byte(kFacing); context._and(context.al, 1); - if (context.flags.z()) goto isdouble; + if (context.flags.z()) + goto isdouble; context.al = context.es.byte(context.bx+29); context._cmp(context.al, 2); - if (context.flags.z()) goto afterwalk; + if (context.flags.z()) + goto afterwalk; context._cmp(context.al, 7); - if (context.flags.z()) goto afterwalk; + if (context.flags.z()) + goto afterwalk; isdouble: walking(context); afterwalk: context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto notwalk; + if (!context.flags.z()) + goto notwalk; context.al = context.data.byte(kTurntoface); context._cmp(context.al, context.data.byte(kFacing)); - if (!context.flags.z()) goto notwalk; + if (!context.flags.z()) + goto notwalk; context.data.byte(kReasseschanges) = 1; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kLeavedirection)); - if (!context.flags.z()) goto notwalk; + if (!context.flags.z()) + goto notwalk; checkforexit(context); notwalk: context.al = context.data.byte(kFacing); @@ -2747,19 +3028,24 @@ notwalk: void aboutturn(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kTurndirection), 1); - if (context.flags.z()) goto incdir; + if (context.flags.z()) + goto incdir; context._cmp(context.data.byte(kTurndirection), -1); - if (context.flags.z()) goto decdir; + if (context.flags.z()) + goto decdir; context.al = context.data.byte(kFacing); context._sub(context.al, context.data.byte(kTurntoface)); - if (!context.flags.c()) goto higher; + if (!context.flags.c()) + goto higher; context._neg(context.al); context._cmp(context.al, 4); - if (!context.flags.c()) goto decdir; + if (!context.flags.c()) + goto decdir; goto incdir; higher: context._cmp(context.al, 4); - if (!context.flags.c()) goto incdir; + if (!context.flags.c()) + goto incdir; goto decdir; incdir: context.data.byte(kTurndirection) = 1; @@ -2781,19 +3067,22 @@ decdir: void walking(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinedirection), 0); - if (context.flags.z()) goto normalwalk; + if (context.flags.z()) + goto normalwalk; context.al = context.data.byte(kLinepointer); context._dec(context.al); context.data.byte(kLinepointer) = context.al; context._cmp(context.al, 200); - if (!context.flags.c()) goto endofline; + if (!context.flags.c()) + goto endofline; goto continuewalk; normalwalk: context.al = context.data.byte(kLinepointer); context._inc(context.al); context.data.byte(kLinepointer) = context.al; context._cmp(context.al, context.data.byte(kLinelength)); - if (!context.flags.c()) goto endofline; + if (!context.flags.c()) + goto endofline; continuewalk: context.ah = 0; context._add(context.ax, context.ax); @@ -2813,7 +3102,8 @@ endofline: context.al = context.data.byte(kDestination); context.data.byte(kManspath) = context.al; context._cmp(context.al, context.data.byte(kFinaldest)); - if (context.flags.z()) goto finishedwalk; + if (context.flags.z()) + goto finishedwalk; context.al = context.data.byte(kFinaldest); context.data.byte(kDestination) = context.al; context.push(context.es); @@ -2857,17 +3147,20 @@ void checkforexit(Context &context) { context.data.byte(kFlagy) = context.dh; context.al = context.data.byte(kLastflag); context._test(context.al, 64); - if (context.flags.z()) goto notnewdirect; + if (context.flags.z()) + goto notnewdirect; context.al = context.data.byte(kLastflagex); context.data.byte(kAutolocation) = context.al; return; notnewdirect: context._test(context.al, 32); - if (context.flags.z()) goto notleave; + if (context.flags.z()) + goto notleave; context.push(context.es); context.push(context.bx); context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) goto notlouis; + if (!context.flags.z()) + goto notlouis; context.bl = 0; context.push(context.bx); context.al = 'W'; @@ -2876,7 +3169,8 @@ notnewdirect: context.ch = 'A'; isryanholding(context); context.bx = context.pop(); - if (context.flags.z()) goto noshoe1; + if (context.flags.z()) + goto noshoe1; context._inc(context.bl); noshoe1: context.push(context.bx); @@ -2886,14 +3180,17 @@ noshoe1: context.ch = 'B'; isryanholding(context); context.bx = context.pop(); - if (context.flags.z()) goto noshoe2; + if (context.flags.z()) + goto noshoe2; context._inc(context.bl); noshoe2: context._cmp(context.bl, 2); - if (context.flags.z()) goto notlouis; + if (context.flags.z()) + goto notlouis; context.al = 42; context._cmp(context.bl, 0); - if (context.flags.z()) goto notravmessage; + if (context.flags.z()) + goto notravmessage; context._inc(context.al); notravmessage: context.cx = 80; @@ -2915,22 +3212,26 @@ notlouis: return; notleave: context._test(context.al, 4); - if (context.flags.z()) goto notaleft; + if (context.flags.z()) + goto notaleft; adjustleft(context); return; notaleft: context._test(context.al, 2); - if (context.flags.z()) goto notaright; + if (context.flags.z()) + goto notaright; adjustright(context); return; notaright: context._test(context.al, 8); - if (context.flags.z()) goto notadown; + if (context.flags.z()) + goto notadown; adjustdown(context); return; notadown: context._test(context.al, 16); - if (context.flags.z()) goto notanup; + if (context.flags.z()) + goto notanup; adjustup(context); return; notanup: @@ -2998,36 +3299,44 @@ void adjustright(Context &context) { void reminders(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); - if (!context.flags.z()) goto notinedenslift; + if (!context.flags.z()) + goto notinedenslift; context._cmp(context.data.byte(kMapx), 44); - if (!context.flags.z()) goto notinedenslift; + if (!context.flags.z()) + goto notinedenslift; context._cmp(context.data.byte(kProgresspoints), 0); - if (!context.flags.z()) goto notfirst; + if (!context.flags.z()) + goto notfirst; context.al = 'D'; context.ah = 'K'; context.cl = 'E'; context.ch = 'Y'; isryanholding(context); - if (context.flags.z()) goto forgotone; + if (context.flags.z()) + goto forgotone; context.al = 'C'; context.ah = 'S'; context.cl = 'H'; context.ch = 'R'; findexobject(context); context._cmp(context.al, (114)); - if (context.flags.z()) goto forgotone; + if (context.flags.z()) + goto forgotone; context.ax = context.es.word(context.bx+2); context._cmp(context.al, 4); - if (!context.flags.z()) goto forgotone; + if (!context.flags.z()) + goto forgotone; context._cmp(context.ah, 255); - if (context.flags.z()) goto havegotcard; + if (context.flags.z()) + goto havegotcard; context.cl = 'P'; context.ch = 'U'; context.dl = 'R'; context.dh = 'S'; context._xchg(context.al, context.ah); compare(context); - if (!context.flags.z()) goto forgotone; + if (!context.flags.z()) + goto forgotone; havegotcard: context._inc(context.data.byte(kProgresspoints)); notfirst: @@ -3052,15 +3361,19 @@ void initrain(Context &context) { checkmorerain: context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto finishinitrain; + if (context.flags.z()) + goto finishinitrain; context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto checkrain; + if (!context.flags.z()) + goto checkrain; context.al = context.cs.byte(context.bx+1); context._cmp(context.al, context.data.byte(kMapx)); - if (!context.flags.z()) goto checkrain; + if (!context.flags.z()) + goto checkrain; context.al = context.cs.byte(context.bx+2); context._cmp(context.al, context.data.byte(kMapy)); - if (!context.flags.z()) goto checkrain; + if (!context.flags.z()) + goto checkrain; context.al = context.cs.byte(context.bx+3); context.data.byte(kRainspace) = context.al; goto dorain; @@ -3074,10 +3387,12 @@ initraintop: context._and(context.al, 31); context._add(context.al, 3); context._cmp(context.al, context.data.byte(kRainspace)); - if (!context.flags.c()) goto initraintop; + if (!context.flags.c()) + goto initraintop; context._add(context.cl, context.al); context._cmp(context.cl, context.data.byte(kMapxsize)); - if (!context.flags.c()) goto initrainside; + if (!context.flags.c()) + goto initrainside; context.push(context.cx); splitintolines(context); context.cx = context.pop(); @@ -3090,10 +3405,12 @@ initrainside2: context._and(context.al, 31); context._add(context.al, 3); context._cmp(context.al, context.data.byte(kRainspace)); - if (!context.flags.c()) goto initrainside2; + if (!context.flags.c()) + goto initrainside2; context._add(context.ch, context.al); context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) goto finishinitrain; + if (!context.flags.c()) + goto finishinitrain; context.push(context.cx); splitintolines(context); context.cx = context.pop(); @@ -3108,13 +3425,16 @@ void splitintolines(Context &context) { lookforlinestart: getblockofpixel(context); context._cmp(context.al, 0); - if (!context.flags.z()) goto foundlinestart; + if (!context.flags.z()) + goto foundlinestart; context._dec(context.cl); context._inc(context.ch); context._cmp(context.cl, 0); - if (context.flags.z()) goto endofthisline; + if (context.flags.z()) + goto endofthisline; context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) goto endofthisline; + if (!context.flags.c()) + goto endofthisline; goto lookforlinestart; foundlinestart: context.es.word(context.di) = context.cx; @@ -3122,13 +3442,16 @@ foundlinestart: lookforlineend: getblockofpixel(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundlineend; + if (context.flags.z()) + goto foundlineend; context._dec(context.cl); context._inc(context.ch); context._cmp(context.cl, 0); - if (context.flags.z()) goto foundlineend; + if (context.flags.z()) + goto foundlineend; context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) goto foundlineend; + if (!context.flags.c()) + goto foundlineend; context._inc(context.bh); goto lookforlineend; foundlineend: @@ -3145,9 +3468,11 @@ foundlineend: context._add(context.di, 6); context.cx = context.pop(); context._cmp(context.cl, 0); - if (context.flags.z()) goto endofthisline; + if (context.flags.z()) + goto endofthisline; context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) goto endofthisline; + if (!context.flags.c()) + goto endofthisline; goto lookforlinestart; endofthisline: return; @@ -3164,7 +3489,8 @@ void getblockofpixel(Context &context) { context._add(context.ch, context.al); checkone(context); context._and(context.cl, 1); - if (!context.flags.z()) goto failrain; + if (!context.flags.z()) + goto failrain; context.di = context.pop(); context.es = context.pop(); context.cx = context.pop(); @@ -3186,11 +3512,13 @@ void showrain(Context &context) { context.bx = (0+(180*10)+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*24)); context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) goto nothunder; + if (context.flags.z()) + goto nothunder; morerain: context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) goto finishrain; + if (context.flags.z()) + goto finishrain; context.al = context.es.byte(context.bx+1); context.ah = 0; context._add(context.ax, context.data.word(kMapady)); @@ -3220,33 +3548,42 @@ morerain: rainloop: context._lodsb(); context._cmp(context.al, context.ah); - if (context.flags.z()) goto noplot; + if (context.flags.z()) + goto noplot; context._stosb(); context._add(context.di, context.dx); - if (--context.cx) goto rainloop; + if (--context.cx) + goto rainloop; context.si = context.pop(); goto morerain; noplot: context._add(context.di, 320-1); - if (--context.cx) goto rainloop; + if (--context.cx) + goto rainloop; context.si = context.pop(); goto morerain; finishrain: context._cmp(context.data.word(kCh1blockstocopy), 0); - if (!context.flags.z()) goto nothunder; + if (!context.flags.z()) + goto nothunder; context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) goto notlouisthund; + if (!context.flags.z()) + goto notlouisthund; context._cmp(context.data.byte(kBeenmugged), 1); - if (!context.flags.z()) goto nothunder; + if (!context.flags.z()) + goto nothunder; notlouisthund: context._cmp(context.data.byte(kReallocation), 55); - if (context.flags.z()) goto nothunder; + if (context.flags.z()) + goto nothunder; randomnum1(context); context._cmp(context.al, 1); - if (!context.flags.c()) goto nothunder; + if (!context.flags.c()) + goto nothunder; context.al = 7; context._cmp(context.data.byte(kCh0playing), 6); - if (context.flags.z()) goto isthunder1; + if (context.flags.z()) + goto isthunder1; context.al = 4; isthunder1: playchannel1(context); @@ -3260,7 +3597,8 @@ void backobject(Context &context) { context.di = context.es.word(context.bx+20); context.al = context.es.byte(context.bx+18); context._cmp(context.al, 0); - if (context.flags.z()) goto _tmp48z; + if (context.flags.z()) + goto _tmp48z; context._dec(context.al); context.es.byte(context.bx+18) = context.al; goto finishback; @@ -3269,32 +3607,38 @@ _tmp48z: context.es.byte(context.bx+18) = context.al; context.al = context.ds.byte(context.di+8); context._cmp(context.al, 6); - if (!context.flags.z()) goto notwidedoor; + if (!context.flags.z()) + goto notwidedoor; widedoor(context); goto finishback; notwidedoor: context._cmp(context.al, 5); - if (!context.flags.z()) goto notrandom; + if (!context.flags.z()) + goto notrandom; random(context); goto finishback; notrandom: context._cmp(context.al, 4); - if (!context.flags.z()) goto notlockdoor; + if (!context.flags.z()) + goto notlockdoor; lockeddoorway(context); goto finishback; notlockdoor: context._cmp(context.al, 3); - if (!context.flags.z()) goto notlift; + if (!context.flags.z()) + goto notlift; liftsprite(context); goto finishback; notlift: context._cmp(context.al, 2); - if (!context.flags.z()) goto notdoor; + if (!context.flags.z()) + goto notdoor; doorway(context); goto finishback; notdoor: context._cmp(context.al, 1); - if (!context.flags.z()) goto steadyob; + if (!context.flags.z()) + goto steadyob; constant(context); goto finishback; steadyob: @@ -3307,17 +3651,22 @@ void liftsprite(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLiftflag); context._cmp(context.al, 0); - if (context.flags.z()) goto liftclosed; + if (context.flags.z()) + goto liftclosed; context._cmp(context.al, 1); - if (context.flags.z()) goto liftopen; + if (context.flags.z()) + goto liftopen; context._cmp(context.al, 3); - if (context.flags.z()) goto openlift; + if (context.flags.z()) + goto openlift; context.al = context.es.byte(context.bx+19); context._cmp(context.al, 0); - if (context.flags.z()) goto finishclose; + if (context.flags.z()) + goto finishclose; context._dec(context.al); context._cmp(context.al, 11); - if (!context.flags.z()) goto pokelift; + if (!context.flags.z()) + goto pokelift; context.push(context.ax); context.al = 3; liftnoise(context); @@ -3329,10 +3678,12 @@ finishclose: openlift: context.al = context.es.byte(context.bx+19); context._cmp(context.al, 12); - if (context.flags.z()) goto endoflist; + if (context.flags.z()) + goto endoflist; context._inc(context.al); context._cmp(context.al, 1); - if (!context.flags.z()) goto pokelift; + if (!context.flags.z()) + goto pokelift; context.push(context.ax); context.al = 2; liftnoise(context); @@ -3358,10 +3709,12 @@ liftopen: context.bx = context.pop(); context.es = context.pop(); context._cmp(context.data.byte(kCounttoclose), 0); - if (context.flags.z()) goto nocountclose; + if (context.flags.z()) + goto nocountclose; context._dec(context.data.byte(kCounttoclose)); context._cmp(context.data.byte(kCounttoclose), 0); - if (!context.flags.z()) goto nocountclose; + if (!context.flags.z()) + goto nocountclose; context.data.byte(kLiftflag) = 2; nocountclose: context.al = 12; @@ -3374,10 +3727,12 @@ liftclosed: context.bx = context.pop(); context.es = context.pop(); context._cmp(context.data.byte(kCounttoopen), 0); - if (context.flags.z()) goto nocountopen; + if (context.flags.z()) + goto nocountopen; context._dec(context.data.byte(kCounttoopen)); context._cmp(context.data.byte(kCounttoopen), 0); - if (!context.flags.z()) goto nocountopen; + if (!context.flags.z()) + goto nocountopen; context.data.byte(kLiftflag) = 3; nocountopen: context.al = 0; @@ -3387,9 +3742,11 @@ nocountopen: void liftnoise(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 5); - if (context.flags.z()) goto hissnoise; + if (context.flags.z()) + goto hissnoise; context._cmp(context.data.byte(kReallocation), 21); - if (context.flags.z()) goto hissnoise; + if (context.flags.z()) + goto hissnoise; playchannel1(context); return; hissnoise: @@ -3423,7 +3780,8 @@ void constant(Context &context) { context.ch = 0; context._add(context.di, context.cx); context._cmp(context.ds.byte(context.di+18), 255); - if (!context.flags.z()) goto gotconst; + if (!context.flags.z()) + goto gotconst; context._sub(context.di, context.cx); context.cx = 0; context.es.byte(context.bx+19) = context.cl; @@ -3459,40 +3817,50 @@ void dodoor(Context &context) { context.cl = context.es.byte(context.bx+10); context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); - if (!context.flags.c()) goto rtofdoor; + if (!context.flags.c()) + goto rtofdoor; context._sub(context.al, context.cl); context._cmp(context.al, context.data.byte(kDoorcheck1)); - if (!context.flags.c()) goto upordown; + if (!context.flags.c()) + goto upordown; goto shutdoor; rtofdoor: context._sub(context.al, context.cl); context._cmp(context.al, context.data.byte(kDoorcheck2)); - if (!context.flags.c()) goto shutdoor; + if (!context.flags.c()) + goto shutdoor; upordown: context._cmp(context.ah, context.ch); - if (!context.flags.c()) goto botofdoor; + if (!context.flags.c()) + goto botofdoor; context._sub(context.ah, context.ch); context._cmp(context.ah, context.data.byte(kDoorcheck3)); - if (context.flags.c()) goto shutdoor; + if (context.flags.c()) + goto shutdoor; goto opendoor; botofdoor: context._sub(context.ah, context.ch); context._cmp(context.ah, context.data.byte(kDoorcheck4)); - if (!context.flags.c()) goto shutdoor; + if (!context.flags.c()) + goto shutdoor; opendoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.data.byte(kThroughdoor), 1); - if (!context.flags.z()) goto notthrough; + if (!context.flags.z()) + goto notthrough; context._cmp(context.cl, 0); - if (!context.flags.z()) goto notthrough; + if (!context.flags.z()) + goto notthrough; context.cl = 6; notthrough: context._inc(context.cl); context._cmp(context.cl, 1); - if (!context.flags.z()) goto notdoorsound2; + if (!context.flags.z()) + goto notdoorsound2; context.al = 0; context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) goto nothoteldoor2; + if (!context.flags.z()) + goto nothoteldoor2; context.al = 13; nothoteldoor2: playchannel1(context); @@ -3502,7 +3870,8 @@ notdoorsound2: context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); - if (!context.flags.z()) goto atlast1; + if (!context.flags.z()) + goto atlast1; context._dec(context.di); context._dec(context.cl); atlast1: @@ -3516,16 +3885,19 @@ atlast1: shutdoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); - if (!context.flags.z()) goto notdoorsound1; + if (!context.flags.z()) + goto notdoorsound1; context.al = 1; context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) goto nothoteldoor1; + if (!context.flags.z()) + goto nothoteldoor1; context.al = 13; nothoteldoor1: playchannel1(context); notdoorsound1: context._cmp(context.cl, 0); - if (context.flags.z()) goto atlast2; + if (context.flags.z()) + goto atlast2; context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast2: @@ -3537,7 +3909,8 @@ atlast2: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); - if (!context.flags.z()) goto notnearly; + if (!context.flags.z()) + goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: return; @@ -3550,40 +3923,50 @@ void lockeddoorway(Context &context) { context.cl = context.es.byte(context.bx+10); context.ch = context.es.byte(context.bx+11); context._cmp(context.al, context.cl); - if (!context.flags.c()) goto rtofdoor2; + if (!context.flags.c()) + goto rtofdoor2; context._sub(context.al, context.cl); context._cmp(context.al, -24); - if (!context.flags.c()) goto upordown2; + if (!context.flags.c()) + goto upordown2; goto shutdoor2; rtofdoor2: context._sub(context.al, context.cl); context._cmp(context.al, 10); - if (!context.flags.c()) goto shutdoor2; + if (!context.flags.c()) + goto shutdoor2; upordown2: context._cmp(context.ah, context.ch); - if (!context.flags.c()) goto botofdoor2; + if (!context.flags.c()) + goto botofdoor2; context._sub(context.ah, context.ch); context._cmp(context.ah, -30); - if (context.flags.c()) goto shutdoor2; + if (context.flags.c()) + goto shutdoor2; goto opendoor2; botofdoor2: context._sub(context.ah, context.ch); context._cmp(context.ah, 12); - if (!context.flags.c()) goto shutdoor2; + if (!context.flags.c()) + goto shutdoor2; opendoor2: context._cmp(context.data.byte(kThroughdoor), 1); - if (context.flags.z()) goto mustbeopen; + if (context.flags.z()) + goto mustbeopen; context._cmp(context.data.byte(kLockstatus), 1); - if (context.flags.z()) goto shutdoor; + if (context.flags.z()) + goto shutdoor; mustbeopen: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 1); - if (!context.flags.z()) goto notdoorsound4; + if (!context.flags.z()) + goto notdoorsound4; context.al = 0; playchannel1(context); notdoorsound4: context._cmp(context.cl, 6); - if (!context.flags.z()) goto noturnonyet; + if (!context.flags.z()) + goto noturnonyet; context.al = context.data.byte(kDoorpath); context.push(context.es); context.push(context.bx); @@ -3593,9 +3976,11 @@ notdoorsound4: noturnonyet: context.cl = context.es.byte(context.bx+19); context._cmp(context.data.byte(kThroughdoor), 1); - if (!context.flags.z()) goto notthrough2; + if (!context.flags.z()) + goto notthrough2; context._cmp(context.cl, 0); - if (!context.flags.z()) goto notthrough2; + if (!context.flags.z()) + goto notthrough2; context.cl = 6; notthrough2: context._inc(context.cl); @@ -3604,7 +3989,8 @@ notthrough2: context._add(context.di, context.cx); context.al = context.ds.byte(context.di+18); context._cmp(context.al, 255); - if (!context.flags.z()) goto atlast3; + if (!context.flags.z()) + goto atlast3; context._dec(context.di); context._dec(context.cl); atlast3: @@ -3614,19 +4000,22 @@ atlast3: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); - if (!context.flags.z()) goto justshutting; + if (!context.flags.z()) + goto justshutting; context.data.byte(kThroughdoor) = 1; justshutting: return; shutdoor2: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); - if (!context.flags.z()) goto notdoorsound3; + if (!context.flags.z()) + goto notdoorsound3; context.al = 1; playchannel1(context); notdoorsound3: context._cmp(context.cl, 0); - if (context.flags.z()) goto atlast4; + if (context.flags.z()) + goto atlast4; context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast4: @@ -3639,7 +4028,8 @@ atlast4: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); - if (!context.flags.z()) goto notlocky; + if (!context.flags.z()) + goto notlocky; context.al = context.data.byte(kDoorpath); context.push(context.es); context.push(context.bx); @@ -3653,16 +4043,19 @@ notlocky: shutdoor: context.cl = context.es.byte(context.bx+19); context._cmp(context.cl, 5); - if (!context.flags.z()) goto notdoorsound1; + if (!context.flags.z()) + goto notdoorsound1; context.al = 1; context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) goto nothoteldoor1; + if (!context.flags.z()) + goto nothoteldoor1; context.al = 13; nothoteldoor1: playchannel1(context); notdoorsound1: context._cmp(context.cl, 0); - if (context.flags.z()) goto atlast2; + if (context.flags.z()) + goto atlast2; context._dec(context.cl); context.es.byte(context.bx+19) = context.cl; atlast2: @@ -3674,7 +4067,8 @@ atlast2: context.es.byte(context.bx+15) = context.al; context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); - if (!context.flags.z()) goto notnearly; + if (!context.flags.z()) + goto notnearly; context.data.byte(kThroughdoor) = 0; notnearly: return; @@ -3688,7 +4082,8 @@ void updatepeople(Context &context) { context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context._inc(context.data.word(kMaintimer)); context.es = context.cs; context.bx = 534; @@ -3696,14 +4091,18 @@ void updatepeople(Context &context) { updateloop: context.al = context.es.byte(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto endupdate; + if (context.flags.z()) + goto endupdate; context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto notinthisroom; + if (!context.flags.z()) + goto notinthisroom; context.cx = context.es.word(context.bx+1); context._cmp(context.cl, context.data.byte(kMapx)); - if (!context.flags.z()) goto notinthisroom; + if (!context.flags.z()) + goto notinthisroom; context._cmp(context.ch, context.data.byte(kMapy)); - if (!context.flags.z()) goto notinthisroom; + if (!context.flags.z()) + goto notinthisroom; context.push(context.di); context.ax = context.cs.word(context.di); __dispatch_call(context, context.ax); @@ -3749,9 +4148,11 @@ retryreel: context.push(context.si); context.ax = context.es.word(context.si+2); context._cmp(context.al, 220); - if (context.flags.c()) goto normalreel; + if (context.flags.c()) + goto normalreel; context._cmp(context.al, 255); - if (context.flags.z()) goto normalreel; + if (context.flags.z()) + goto normalreel; dealwithspecial(context); context._inc(context.data.word(kReelpointer)); context.si = context.pop(); @@ -3766,14 +4167,16 @@ plotloop: context.push(context.si); context.ax = context.es.word(context.si); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto notplot; + if (context.flags.z()) + goto notplot; showreelframe(context); notplot: context.si = context.pop(); context.es = context.pop(); context.cx = context.pop(); context._add(context.si, 5); - if (--context.cx) goto plotloop; + if (--context.cx) + goto plotloop; soundonreels(context); context.bx = context.pop(); context.es = context.pop(); @@ -3789,18 +4192,23 @@ void soundonreels(Context &context) { reelsoundloop: context.al = context.cs.byte(context.si); context._cmp(context.al, 255); - if (context.flags.z()) goto endreelsound; + if (context.flags.z()) + goto endreelsound; context.ax = context.cs.word(context.si+1); context._cmp(context.ax, context.data.word(kReelpointer)); - if (!context.flags.z()) goto skipreelsound; + if (!context.flags.z()) + goto skipreelsound; context._cmp(context.ax, context.data.word(kLastsoundreel)); - if (context.flags.z()) goto skipreelsound; + if (context.flags.z()) + goto skipreelsound; context.data.word(kLastsoundreel) = context.ax; context.al = context.cs.byte(context.si); context._cmp(context.al, 64); - if (context.flags.c()) { playchannel1(context); return; }; + if (context.flags.c()) + { playchannel1(context); return; }; context._cmp(context.al, 128); - if (context.flags.c()) goto channel0once; + if (context.flags.c()) + goto channel0once; context._and(context.al, 63); context.ah = 255; { playchannel0(context); return; }; @@ -3814,7 +4222,8 @@ skipreelsound: endreelsound: context.ax = context.data.word(kLastsoundreel); context._cmp(context.ax, context.data.word(kReelpointer)); - if (context.flags.z()) goto nochange2; + if (context.flags.z()) + goto nochange2; context.data.word(kLastsoundreel) = -1; nochange2: return; @@ -3823,7 +4232,8 @@ nochange2: void reconstruct(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kHavedoneobs), 0); - if (context.flags.z()) goto noneedtorecon; + if (context.flags.z()) + goto noneedtorecon; context.data.byte(kNewobs) = 1; drawfloor(context); spriteupdate(context); @@ -3837,47 +4247,54 @@ void dealwithspecial(Context &context) { STACK_CHECK(context); context._sub(context.al, 220); context._cmp(context.al, 0); - if (!context.flags.z()) goto notplset; + if (!context.flags.z()) + goto notplset; context.al = context.ah; placesetobject(context); context.data.byte(kHavedoneobs) = 1; return; notplset: context._cmp(context.al, 1); - if (!context.flags.z()) goto notremset; + if (!context.flags.z()) + goto notremset; context.al = context.ah; removesetobject(context); context.data.byte(kHavedoneobs) = 1; return; notremset: context._cmp(context.al, 2); - if (!context.flags.z()) goto notplfree; + if (!context.flags.z()) + goto notplfree; context.al = context.ah; placefreeobject(context); context.data.byte(kHavedoneobs) = 1; return; notplfree: context._cmp(context.al, 3); - if (!context.flags.z()) goto notremfree; + if (!context.flags.z()) + goto notremfree; context.al = context.ah; removefreeobject(context); context.data.byte(kHavedoneobs) = 1; return; notremfree: context._cmp(context.al, 4); - if (!context.flags.z()) goto notryanoff; + if (!context.flags.z()) + goto notryanoff; switchryanoff(context); return; notryanoff: context._cmp(context.al, 5); - if (!context.flags.z()) goto notryanon; + if (!context.flags.z()) + goto notryanon; context.data.byte(kTurntoface) = context.ah; context.data.byte(kFacing) = context.ah; switchryanon(context); return; notryanon: context._cmp(context.al, 6); - if (!context.flags.z()) goto notchangeloc; + if (!context.flags.z()) + goto notchangeloc; context.data.byte(kNewlocation) = context.ah; return; notchangeloc: @@ -3887,25 +4304,29 @@ notchangeloc: void movemap(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 32); - if (!context.flags.z()) goto notmapup2; + if (!context.flags.z()) + goto notmapup2; context._sub(context.data.byte(kMapy), 20); context.data.byte(kNowinnewroom) = 1; return; notmapup2: context._cmp(context.ah, 16); - if (!context.flags.z()) goto notmapupspec; + if (!context.flags.z()) + goto notmapupspec; context._sub(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; return; notmapupspec: context._cmp(context.ah, 8); - if (!context.flags.z()) goto notmapdownspec; + if (!context.flags.z()) + goto notmapdownspec; context._add(context.data.byte(kMapy), 10); context.data.byte(kNowinnewroom) = 1; return; notmapdownspec: context._cmp(context.ah, 2); - if (!context.flags.z()) goto notmaprightspec; + if (!context.flags.z()) + goto notmaprightspec; context._add(context.data.byte(kMapx), 11); context.data.byte(kNowinnewroom) = 1; return; @@ -3948,7 +4369,8 @@ void deleverything(Context &context) { context.ah = 0; context._add(context.ax, context.data.word(kMapoffsety)); context._cmp(context.ax, 182); - if (!context.flags.c()) goto bigroom; + if (!context.flags.c()) + goto bigroom; maptopanel(context); return; bigroom: @@ -3965,11 +4387,14 @@ dumpevery1: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto finishevery1; + if (context.flags.z()) + goto finishevery1; context._cmp(context.ax, context.es.word(context.bx+(40*5))); - if (!context.flags.z()) goto notskip1; + if (!context.flags.z()) + goto notskip1; context._cmp(context.cx, context.es.word(context.bx+(40*5)+2)); - if (context.flags.z()) goto skip1; + if (context.flags.z()) + goto skip1; notskip1: context.push(context.bx); context.push(context.es); @@ -3993,7 +4418,8 @@ dumpevery2: context.ax = context.es.word(context.bx); context.cx = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto finishevery2; + if (context.flags.z()) + goto finishevery2; context.push(context.bx); context.push(context.es); context.push(context.ds); @@ -4023,7 +4449,8 @@ void allocatework(Context &context) { void readabyte(Context &context) { STACK_CHECK(context); context._cmp(context.si, 30000); - if (!context.flags.z()) goto notendblock; + if (!context.flags.z()) + goto notendblock; context.push(context.bx); context.push(context.es); context.push(context.di); @@ -4059,20 +4486,24 @@ palloop: context._shr(context.al, 1); context._shr(context.al, 1); context._cmp(context.data.byte(kBrightness), 1); - if (!context.flags.z()) goto nought; + if (!context.flags.z()) + goto nought; context._cmp(context.al, 0); - if (context.flags.z()) goto nought; + if (context.flags.z()) + goto nought; context.ah = context.al; context._shr(context.ah, 1); context._add(context.al, context.ah); context._shr(context.ah, 1); context._add(context.al, context.ah); context._cmp(context.al, 64); - if (context.flags.c()) goto nought; + if (context.flags.c()) + goto nought; context.al = 63; nought: context._stosb(); - if (--context.cx) goto palloop; + if (--context.cx) + goto palloop; } void paneltomap(Context &context) { @@ -4205,20 +4636,24 @@ void clearwork(Context &context) { context.cx = (200*320)/64; clearloop: context._stosw(32); - if (--context.cx) goto clearloop; + if (--context.cx) + goto clearloop; } void zoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto inwatching; + if (!context.flags.z()) + goto inwatching; context._cmp(context.data.byte(kZoomon), 1); - if (context.flags.z()) goto zoomswitch; + if (context.flags.z()) + goto zoomswitch; inwatching: return; zoomswitch: context._cmp(context.data.byte(kCommandtype), 199); - if (context.flags.c()) goto zoomit; + if (context.flags.c()) + goto zoomit; putunderzoom(context); return; zoomit: @@ -4245,11 +4680,13 @@ zoomloop2: context.ah = context.al; context._stosw(); context.es.word(context.di+(320)-2) = context.ax; - if (--context.cx) goto zoomloop2; + if (--context.cx) + goto zoomloop2; context._add(context.si, (320)-23); context._add(context.di, (320)-46+(320)); context.cx = context.pop(); - if (--context.cx) goto zoomloop; + if (--context.cx) + goto zoomloop; crosshair(context); context.data.byte(kDidzoom) = 1; } @@ -4289,12 +4726,14 @@ void delthisone(Context &context) { deloneloop: context.push(context.cx); context.ch = 0; - while(context.cx--) context._movsb(); - context.cx = context.pop(); + while(context.cx--) + context._movsb(); + context.cx = context.pop(); context._add(context.di, context.ax); context._add(context.si, context.dx); context._dec(context.ch); - if (!context.flags.z()) goto deloneloop; + if (!context.flags.z()) + goto deloneloop; } void doblocks(Context &context) { @@ -4327,7 +4766,8 @@ loop124: context.ds = context.data.word(kBackdrop); context.push(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto zeroblock; + if (context.flags.z()) + goto zeroblock; context.ah = context.al; context.al = 0; context.si = (0+192); @@ -4336,17 +4776,19 @@ loop124: context.bh = 4; firstbitofblock: context._movsw(8); - context._add(context.di, (320)-16); + context._add(context.di, (320)-16); context._dec(context.bh); - if (!context.flags.z()) goto firstbitofblock; + if (!context.flags.z()) + goto firstbitofblock; context.bh = 12; loop125: context._movsw(8); - context.ax = 0x0dfdf; + context.ax = 0x0dfdf; context._stosw(2); context._add(context.di, (320)-20); context._dec(context.bh); - if (!context.flags.z()) goto loop125; + if (!context.flags.z()) + goto loop125; context._add(context.di, 4); context.ax = 0x0dfdf; context._stosw(8); @@ -4361,12 +4803,14 @@ zeroblock: context.di = context.pop(); context.cx = context.pop(); context._add(context.di, 16); - if (--context.cx) goto loop124; + if (--context.cx) + goto loop124; context._add(context.si, (66)-11); context.cx = context.pop(); context.di = context.pop(); context._add(context.di, (320)*16); - if (--context.cx) goto loop120; + if (--context.cx) + goto loop120; } void showframe(Context &context) { @@ -4380,14 +4824,16 @@ void showframe(Context &context) { context._add(context.cx, context.cx); context._add(context.si, context.cx); context._cmp(context.ds.word(context.si), 0); - if (!context.flags.z()) goto notblankshow; + if (!context.flags.z()) + goto notblankshow; context.ax = context.pop(); context.dx = context.pop(); context.cx = 0; return; notblankshow: context._test(context.ah, 128); - if (!context.flags.z()) goto skipoffsets; + if (!context.flags.z()) + goto skipoffsets; context.al = context.ds.byte(context.si+4); context.ah = 0; context._add(context.di, context.ax); @@ -4402,9 +4848,11 @@ skipoffsets: context.ax = context.pop(); context.dx = context.pop(); context._cmp(context.ah, 0); - if (context.flags.z()) goto noeffects; + if (context.flags.z()) + goto noeffects; context._test(context.ah, 128); - if (context.flags.z()) goto notcentred; + if (context.flags.z()) + goto notcentred; context.push(context.ax); context.al = context.cl; context.ah = 0; @@ -4417,14 +4865,16 @@ skipoffsets: context.ax = context.pop(); notcentred: context._test(context.ah, 64); - if (context.flags.z()) goto notdiffdest; + if (context.flags.z()) + goto notdiffdest; context.push(context.cx); frameoutfx(context); context.cx = context.pop(); return; notdiffdest: context._test(context.ah, 8); - if (context.flags.z()) goto notprintlist; + if (context.flags.z()) + goto notprintlist; context.push(context.ax); context.ax = context.di; context._sub(context.ax, context.data.word(kMapadx)); @@ -4435,7 +4885,8 @@ notdiffdest: context.ax = context.pop(); notprintlist: context._test(context.ah, 4); - if (context.flags.z()) goto notflippedx; + if (context.flags.z()) + goto notflippedx; context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); @@ -4444,7 +4895,8 @@ notprintlist: return; notflippedx: context._test(context.ah, 2); - if (context.flags.z()) goto notnomask; + if (context.flags.z()) + goto notnomask; context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); @@ -4453,7 +4905,8 @@ notflippedx: return; notnomask: context._test(context.ah, 32); - if (context.flags.z()) goto noeffects; + if (context.flags.z()) + goto noeffects; context.dx = (320); context.es = context.data.word(kWorkspace); context.push(context.cx); @@ -4486,26 +4939,32 @@ frameloop1: frameloop2: context._lodsb(); context._cmp(context.al, 0); - if (!context.flags.z()) goto backtosolid; + if (!context.flags.z()) + goto backtosolid; backtoother: context._inc(context.di); - if (--context.cx) goto frameloop2; + if (--context.cx) + goto frameloop2; context.cx = context.pop(); context._add(context.di, context.dx); context._dec(context.ch); - if (!context.flags.z()) goto frameloop1; + if (!context.flags.z()) + goto frameloop1; return; frameloop3: context._lodsb(); context._cmp(context.al, 0); - if (context.flags.z()) goto backtoother; + if (context.flags.z()) + goto backtoother; backtosolid: context._stosb(); - if (--context.cx) goto frameloop3; + if (--context.cx) + goto frameloop3; context.cx = context.pop(); context._add(context.di, context.dx); context._dec(context.ch); - if (!context.flags.z()) goto frameloop1; + if (!context.flags.z()) + goto frameloop1; } void frameoutbh(Context &context) { @@ -4526,19 +4985,23 @@ bhloop2: context.ah = 255; bhloop1: context._cmp(context.es.byte(context.di), context.ah); - if (!context.flags.z()) goto nofill; + if (!context.flags.z()) + goto nofill; context._movsb(); - if (--context.cx) goto bhloop1; + if (--context.cx) + goto bhloop1; goto nextline; nofill: context._inc(context.di); context._inc(context.si); - if (--context.cx) goto bhloop1; + if (--context.cx) + goto bhloop1; nextline: context._add(context.di, context.dx); context.cx = context.pop(); context._dec(context.ch); - if (!context.flags.z()) goto bhloop2; + if (!context.flags.z()) + goto bhloop2; } void frameoutfx(Context &context) { @@ -4559,27 +5022,33 @@ frameloopfx1: frameloopfx2: context._lodsb(); context._cmp(context.al, 0); - if (!context.flags.z()) goto backtosolidfx; + if (!context.flags.z()) + goto backtosolidfx; backtootherfx: context._dec(context.di); - if (--context.cx) goto frameloopfx2; + if (--context.cx) + goto frameloopfx2; context.cx = context.pop(); context._add(context.di, context.dx); context._dec(context.ch); - if (!context.flags.z()) goto frameloopfx1; + if (!context.flags.z()) + goto frameloopfx1; return; frameloopfx3: context._lodsb(); context._cmp(context.al, 0); - if (context.flags.z()) goto backtootherfx; + if (context.flags.z()) + goto backtootherfx; backtosolidfx: context.es.byte(context.di) = context.al; context._dec(context.di); - if (--context.cx) goto frameloopfx3; + if (--context.cx) + goto frameloopfx3; context.cx = context.pop(); context._add(context.di, context.dx); context._dec(context.ch); - if (!context.flags.z()) goto frameloopfx1; + if (!context.flags.z()) + goto frameloopfx1; } void transferinv(Context &context) { @@ -4624,8 +5093,9 @@ void transferinv(Context &context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(context.cx--) context._movsb(); - context.cx = context.pop(); + while(context.cx--) + context._movsb(); + context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); @@ -4671,8 +5141,9 @@ void transfermap(Context &context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(context.cx--) context._movsb(); - context.cx = context.pop(); + while(context.cx--) + context._movsb(); + context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; context._add(context.data.word(kExframepos), context.cx); @@ -4681,7 +5152,8 @@ void transfermap(Context &context) { void dofade(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFadedirection), 0); - if (context.flags.z()) goto finishfade; + if (context.flags.z()) + goto finishfade; context.cl = context.data.byte(kNumtofade); context.ch = 0; context.al = context.data.byte(kColourpos); @@ -4696,7 +5168,8 @@ void dofade(Context &context) { context._add(context.al, context.data.byte(kColourpos)); context.data.byte(kColourpos) = context.al; context._cmp(context.al, 0); - if (!context.flags.z()) goto finishfade; + if (!context.flags.z()) + goto finishfade; fadecalculation(context); finishfade: return; @@ -4708,7 +5181,8 @@ void clearendpal(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); } void clearpalette(Context &context) { @@ -4734,7 +5208,8 @@ void fadetowhite(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 63; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.al = 0; context._stosb(3); @@ -4751,7 +5226,8 @@ void fadefromwhite(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768; context.al = 63; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.al = 0; context._stosb(3); @@ -4784,18 +5260,21 @@ halfend: context._shr(context.al, 1); context.es.byte(context.bx) = context.al; context._inc(context.bx); - if (--context.cx) goto halfend; + if (--context.cx) + goto halfend; context.ds = context.data.word(kBuffers); context.es = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); context.cx = 3*5; - while(context.cx--) context._movsb(); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); + while(context.cx--) + context._movsb(); + context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); context.cx = 3*2; - while(context.cx--) context._movsb(); - context.data.byte(kFadedirection) = 1; + while(context.cx--) + context._movsb(); + context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; context.data.byte(kNumtofade) = 32; @@ -4841,7 +5320,8 @@ wholeloop1: context._stosw(); context.al = 0; context._stosb(); - if (--context.cx) goto wholeloop1; + if (--context.cx) + goto wholeloop1; } void showgun(Context &context) { @@ -4954,7 +5434,8 @@ onelot2: printdirect(context); context._add(context.bx, context.data.word(kLinespacing)); context.cx = context.pop(); - if (--context.cx) goto onelot2; + if (--context.cx) + goto onelot2; vsync(context); context.cl = 160; context.ch = 160; @@ -4967,22 +5448,28 @@ onelot2: context.si = context.pop(); context.cx = context.pop(); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto endearly2; + if (context.flags.z()) + goto endearly2; context._dec(context.bx); - if (--context.cx) goto endcredits22; + if (--context.cx) + goto endcredits22; context.cx = context.pop(); looknext2: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); - if (context.flags.z()) goto gotnext2; + if (context.flags.z()) + goto gotnext2; context._cmp(context.al, 0); - if (context.flags.z()) goto gotnext2; + if (context.flags.z()) + goto gotnext2; goto looknext2; gotnext2: context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto endearly; - if (--context.cx) goto endcredits21; + if (context.flags.z()) + goto endearly; + if (--context.cx) + goto endcredits21; context.cx = 120; hangone(context); return; @@ -4995,7 +5482,8 @@ endearly: void fadecalculation(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFadecount), 0); - if (context.flags.z()) goto nomorefading; + if (context.flags.z()) + goto nomorefading; context.bl = context.data.byte(kFadecount); context.es = context.data.word(kBuffers); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); @@ -5005,20 +5493,25 @@ fadecolloop: context.al = context.es.byte(context.si); context.ah = context.es.byte(context.di); context._cmp(context.al, context.ah); - if (context.flags.z()) goto gotthere; - if (context.flags.c()) goto lesscolour; + if (context.flags.z()) + goto gotthere; + if (context.flags.c()) + goto lesscolour; context._dec(context.es.byte(context.si)); goto gotthere; lesscolour: context._cmp(context.bl, context.ah); - if (context.flags.z()) goto withit; - if (!context.flags.c()) goto gotthere; + if (context.flags.z()) + goto withit; + if (!context.flags.c()) + goto gotthere; withit: context._inc(context.es.byte(context.si)); gotthere: context._inc(context.si); context._inc(context.di); - if (--context.cx) goto fadecolloop; + if (--context.cx) + goto fadecolloop; context._dec(context.data.byte(kFadecount)); return; nomorefading: @@ -5053,7 +5546,8 @@ greysumloop1: greysumloop2: context._inc(context.al); context._sub(context.bx, 100); - if (!context.flags.c()) goto greysumloop2; + if (!context.flags.c()) + goto greysumloop2; context.bl = context.al; context.al = context.bl; context.ah = context.data.byte(kAddtored); @@ -5063,20 +5557,23 @@ greysumloop2: context.ah = context.data.byte(kAddtogreen); context.al = context.bl; context._cmp(context.al, 0); - if (context.flags.z()) goto noaddg; + if (context.flags.z()) + goto noaddg; context._add(context.al, context.ah); noaddg: context._stosb(); context.ah = context.data.byte(kAddtoblue); context.al = context.bl; context._cmp(context.al, 0); - if (context.flags.z()) goto noaddb; + if (context.flags.z()) + goto noaddb; context._add(context.al, context.ah); noaddb: context._stosb(); context._add(context.si, 3); context.cx = context.pop(); - if (--context.cx) goto greysumloop1; + if (--context.cx) + goto greysumloop1; } void paltostartpal(Context &context) { @@ -5086,8 +5583,9 @@ void paltostartpal(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) context._movsw(); - } + while(context.cx--) + context._movsw(); +} void endpaltostart(Context &context) { STACK_CHECK(context); @@ -5096,8 +5594,9 @@ void endpaltostart(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) context._movsw(); - } + while(context.cx--) + context._movsw(); +} void startpaltoend(Context &context) { STACK_CHECK(context); @@ -5106,8 +5605,9 @@ void startpaltoend(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) context._movsw(); - } + while(context.cx--) + context._movsw(); +} void paltoendpal(Context &context) { STACK_CHECK(context); @@ -5116,8 +5616,9 @@ void paltoendpal(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(context.cx--) context._movsw(); - } + while(context.cx--) + context._movsw(); +} void allpalette(Context &context) { STACK_CHECK(context); @@ -5126,8 +5627,9 @@ void allpalette(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(context.cx--) context._movsw(); - dumpcurrent(context); + while(context.cx--) + context._movsw(); + dumpcurrent(context); } void dumpcurrent(Context &context) { @@ -5152,7 +5654,8 @@ void fadedownmon(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5172,7 +5675,8 @@ void fadeupmon(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5192,7 +5696,8 @@ void fadeupmonfirst(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5215,7 +5720,8 @@ void fadeupyellows(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5234,7 +5740,8 @@ void initialmoncols(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); context.cx = 3*9; context.ax = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5296,11 +5803,13 @@ loadspeech2: notloadspeech2: vsync(context); context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) goto notloadspeech2; + if (!context.flags.z()) + goto notloadspeech2; context.ax = context.pop(); context._inc(context.al); context._cmp(context.al, 48); - if (!context.flags.z()) goto loadspeech2; + if (!context.flags.z()) + goto loadspeech2; context.data.byte(kVolumedirection) = 1; context.data.byte(kVolumeto) = 7; fadescreendowns(context); @@ -5346,16 +5855,19 @@ void biblequote(Context &context) { context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto biblequotearly; + if (context.flags.z()) + goto biblequotearly; context.cx = 560; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto biblequotearly; + if (context.flags.z()) + goto biblequotearly; fadescreendowns(context); context.cx = 200; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto biblequotearly; + if (context.flags.z()) + goto biblequotearly; cancelch0(context); biblequotearly: context.data.byte(kLasthardkey) = 0; @@ -5368,8 +5880,10 @@ hangonloope: vsync(context); context.cx = context.pop(); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto hangonearly; - if (--context.cx) goto hangonloope; + if (context.flags.z()) + goto hangonearly; + if (--context.cx) + goto hangonloope; hangonearly: return; } @@ -5392,26 +5906,30 @@ void intro(Context &context) { fadescreenups(context); runintroseq(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto introearly; + if (context.flags.z()) + goto introearly; clearbeforeload(context); context.data.byte(kNewlocation) = 52; loadintroroom(context); runintroseq(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto introearly; + if (context.flags.z()) + goto introearly; clearbeforeload(context); context.data.byte(kNewlocation) = 53; loadintroroom(context); runintroseq(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto introearly; + if (context.flags.z()) + goto introearly; clearbeforeload(context); allpalette(context); context.data.byte(kNewlocation) = 54; loadintroroom(context); runintroseq(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto introearly; + if (context.flags.z()) + goto introearly; getridoftemptext(context); clearbeforeload(context); introearly: @@ -5424,11 +5942,13 @@ void runintroseq(Context &context) { moreintroseq: vsync(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto earlyendrun; + if (context.flags.z()) + goto earlyendrun; spriteupdate(context); vsync(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto earlyendrun; + if (context.flags.z()) + goto earlyendrun; deleverything(context); printsprites(context); reelsonscreen(context); @@ -5436,14 +5956,17 @@ moreintroseq: usetimedtext(context); vsync(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto earlyendrun; + if (context.flags.z()) + goto earlyendrun; dumpmap(context); dumptimedtext(context); vsync(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto earlyendrun; + if (context.flags.z()) + goto earlyendrun; context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) goto moreintroseq; + if (!context.flags.z()) + goto moreintroseq; return; earlyendrun: getridoftemptext(context); @@ -5468,7 +5991,8 @@ moreendseq: dumptimedtext(context); vsync(context); context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) goto moreendseq; + if (!context.flags.z()) + goto moreendseq; } void loadintroroom(Context &context) { @@ -5507,17 +6031,20 @@ void realcredits(Context &context) { context.cx = 2; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.dx = 2403; showpcx(context); context.al = 12; @@ -5526,17 +6053,20 @@ void realcredits(Context &context) { context.cx = 2; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.dx = 2416; showpcx(context); context.al = 12; @@ -5545,17 +6075,20 @@ void realcredits(Context &context) { context.cx = 2; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.dx = 2429; showpcx(context); context.al = 12; @@ -5564,17 +6097,20 @@ void realcredits(Context &context) { context.cx = 2; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.dx = 2442; showpcx(context); context.al = 12; @@ -5583,31 +6119,36 @@ void realcredits(Context &context) { context.cx = 2; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; allpalette(context); context.cx = 80; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.dx = 2455; showpcx(context); fadescreenups(context); context.cx = 60; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; context.al = 13; context.ah = 0; playchannel0(context); context.cx = 350; hangone(context); context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) goto realcreditsearly; + if (context.flags.z()) + goto realcreditsearly; fadescreendowns(context); context.cx = 256; hangone(context); @@ -5618,7 +6159,8 @@ realcreditsearly: void printchar(Context &context) { STACK_CHECK(context); context._cmp(context.al, 255); - if (context.flags.z()) goto ignoreit; + if (context.flags.z()) + goto ignoreit; context.push(context.si); context.push(context.bx); context.push(context.di); @@ -5632,7 +6174,8 @@ void printchar(Context &context) { context.bx = context.pop(); context.si = context.pop(); context._cmp(context.data.byte(kKerning), 0); - if (!context.flags.z()) goto nokern; + if (!context.flags.z()) + goto nokern; kernchars(context); nokern: context.push(context.cx); @@ -5646,21 +6189,28 @@ ignoreit: void kernchars(Context &context) { STACK_CHECK(context); context._cmp(context.al, 'a'); - if (context.flags.z()) goto iskern; + if (context.flags.z()) + goto iskern; context._cmp(context.al, 'u'); - if (context.flags.z()) goto iskern; + if (context.flags.z()) + goto iskern; return; iskern: context._cmp(context.ah, 'n'); - if (context.flags.z()) goto kernit; + if (context.flags.z()) + goto kernit; context._cmp(context.ah, 't'); - if (context.flags.z()) goto kernit; + if (context.flags.z()) + goto kernit; context._cmp(context.ah, 'r'); - if (context.flags.z()) goto kernit; + if (context.flags.z()) + goto kernit; context._cmp(context.ah, 'i'); - if (context.flags.z()) goto kernit; + if (context.flags.z()) + goto kernit; context._cmp(context.ah, 'l'); - if (context.flags.z()) goto kernit; + if (context.flags.z()) + goto kernit; return; kernit: context._dec(context.cl); @@ -5696,11 +6246,14 @@ printloopslow5: context.ax = context.es.word(context.si+1); context._inc(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto finishslow; + if (context.flags.z()) + goto finishslow; context._cmp(context.al, ':'); - if (context.flags.z()) goto finishslow; + if (context.flags.z()) + goto finishslow; context._cmp(context.cl, 1); - if (context.flags.z()) goto afterslow; + if (context.flags.z()) + goto afterslow; context.push(context.di); context.push(context.ds); context.push(context.bx); @@ -5718,21 +6271,26 @@ printloopslow5: context.di = context.pop(); waitframes(context); context._cmp(context.ax, 0); - if (context.flags.z()) goto keepgoing; + if (context.flags.z()) + goto keepgoing; context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) goto finishslow2; + if (!context.flags.z()) + goto finishslow2; keepgoing: waitframes(context); context._cmp(context.ax, 0); - if (context.flags.z()) goto afterslow; + if (context.flags.z()) + goto afterslow; context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) goto finishslow2; + if (!context.flags.z()) + goto finishslow2; afterslow: context.es = context.pop(); context.si = context.pop(); context.cx = context.pop(); context._inc(context.si); - if (--context.cx) goto printloopslow5; + if (--context.cx) + goto printloopslow5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); @@ -5808,16 +6366,19 @@ printloop5: context.ax = context.es.word(context.si); context._inc(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto finishdirct; + if (context.flags.z()) + goto finishdirct; context._cmp(context.al, ':'); - if (context.flags.z()) goto finishdirct; + if (context.flags.z()) + goto finishdirct; context.push(context.cx); context.push(context.es); printchar(context); context.data.word(kLastxpos) = context.di; context.es = context.pop(); context.cx = context.pop(); - if (--context.cx) goto printloop5; + if (--context.cx) + goto printloop5; context.dx = context.pop(); context.di = context.pop(); context.bx = context.pop(); @@ -5847,15 +6408,20 @@ printloop7: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); - if (context.flags.z()) goto finishmon2; + if (context.flags.z()) + goto finishmon2; context._cmp(context.al, 0); - if (context.flags.z()) goto finishmon; + if (context.flags.z()) + goto finishmon; context._cmp(context.al, 34); - if (context.flags.z()) goto finishmon; + if (context.flags.z()) + goto finishmon; context._cmp(context.al, '='); - if (context.flags.z()) goto finishmon; + if (context.flags.z()) + goto finishmon; context._cmp(context.al, '%'); - if (!context.flags.z()) goto nottrigger; + if (!context.flags.z()) + goto nottrigger; context.ah = context.es.byte(context.si); context._inc(context.si); context._inc(context.si); @@ -5885,7 +6451,8 @@ nottrigger: delcurs(context); context.es = context.pop(); context.cx = context.pop(); - if (--context.cx) goto printloop7; + if (--context.cx) + goto printloop7; finishmon2: context.dx = context.pop(); context.di = context.pop(); @@ -5898,7 +6465,8 @@ finishmon: context.di = context.pop(); context.bx = context.pop(); context._cmp(context.al, '%'); - if (!context.flags.z()) goto nottrigger2; + if (!context.flags.z()) + goto nottrigger2; context.data.byte(kLasttrigger) = context.ah; nottrigger2: context.data.word(kCurslocx) = context.di; @@ -5923,7 +6491,8 @@ wordloop: context.dx = context.pop(); context.cx = context.pop(); context._cmp(context.al, 1); - if (context.flags.z()) goto endoftext; + if (context.flags.z()) + goto endoftext; context.al = context.cl; context.ah = 0; context.push(context.bx); @@ -5933,14 +6502,16 @@ wordloop: context._sub(context.ax, 10); context.dh = 0; context._cmp(context.ax, context.dx); - if (!context.flags.c()) goto gotoverend; + if (!context.flags.c()) + goto gotoverend; context._add(context.cl, context.bl); context._add(context.ch, context.bh); goto wordloop; gotoverend: context.al = context.dl; context._and(context.al, 1); - if (context.flags.z()) goto notcentre; + if (context.flags.z()) + goto notcentre; context.push(context.cx); context.al = context.dl; context._and(context.al, 0xfe); @@ -5976,13 +6547,15 @@ endoftext: context._sub(context.ax, 10); context.dh = 0; context._cmp(context.ax, context.dx); - if (!context.flags.c()) goto gotoverend2; + if (!context.flags.c()) + goto gotoverend2; context._add(context.cl, context.bl); context._add(context.ch, context.bh); gotoverend2: context.al = context.dl; context._and(context.al, 1); - if (context.flags.z()) goto notcent2; + if (context.flags.z()) + goto notcent2; context.push(context.cx); context.al = context.dl; context._and(context.al, 0xfe); @@ -6018,13 +6591,17 @@ getloop: context._inc(context.di); context._inc(context.bh); context._cmp(context.al, ':'); - if (context.flags.z()) goto endall; + if (context.flags.z()) + goto endall; context._cmp(context.al, 0); - if (context.flags.z()) goto endall; + if (context.flags.z()) + goto endall; context._cmp(context.al, 32); - if (context.flags.z()) goto endword; + if (context.flags.z()) + goto endword; context._cmp(context.al, 255); - if (context.flags.z()) goto getloop; + if (context.flags.z()) + goto getloop; context.push(context.ax); context._sub(context.al, 32); context.ah = 0; @@ -6081,12 +6658,14 @@ ryanloop1: context.di = context.pop(); context.cx = context.pop(); context._add(context.di, (44)); - if (--context.cx) goto ryanloop1; + if (--context.cx) + goto ryanloop1; context.bx = context.pop(); context.di = context.pop(); context.cx = context.pop(); context._add(context.bx, (44)); - if (--context.cx) goto ryanloop2; + if (--context.cx) + goto ryanloop2; showryanpage(context); } @@ -6095,7 +6674,8 @@ void fillopen(Context &context) { deltextline(context); getopenedsize(context); context._cmp(context.ah, 4); - if (context.flags.c()) goto lessthanapage; + if (context.flags.c()) + goto lessthanapage; context.ah = 4; lessthanapage: context.al = 1; @@ -6116,7 +6696,8 @@ openloop1: context.push(context.si); context.push(context.es); context._cmp(context.ch, context.cl); - if (context.flags.c()) goto nextopenslot; + if (context.flags.c()) + goto nextopenslot; obtoinv(context); nextopenslot: context.es = context.pop(); @@ -6127,7 +6708,8 @@ nextopenslot: context._add(context.di, (44)); context._inc(context.cl); context._cmp(context.cl, 5); - if (!context.flags.z()) goto openloop1; + if (!context.flags.z()) + goto openloop1; undertextline(context); } @@ -6136,7 +6718,8 @@ void findallryan(Context &context) { context.push(context.di); context.cx = 30; context.ax = 0x0ffff; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.di = context.pop(); context.cl = 4; context.ds = context.data.word(kExtras); @@ -6144,9 +6727,11 @@ void findallryan(Context &context) { context.ch = 0; findryanloop: context._cmp(context.ds.byte(context.bx+2), context.cl); - if (!context.flags.z()) goto notinryaninv; + if (!context.flags.z()) + goto notinryaninv; context._cmp(context.ds.byte(context.bx+3), 255); - if (!context.flags.z()) goto notinryaninv; + if (!context.flags.z()) + goto notinryaninv; context.al = context.ds.byte(context.bx+4); context.ah = 0; context.push(context.di); @@ -6160,7 +6745,8 @@ notinryaninv: context._add(context.bx, 16); context._inc(context.ch); context._cmp(context.ch, (114)); - if (!context.flags.z()) goto findryanloop; + if (!context.flags.z()) + goto findryanloop; } void findallopen(Context &context) { @@ -6168,7 +6754,8 @@ void findallopen(Context &context) { context.push(context.di); context.cx = 16; context.ax = 0x0ffff; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.di = context.pop(); context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); @@ -6177,14 +6764,18 @@ void findallopen(Context &context) { context.ch = 0; findopen1: context._cmp(context.ds.byte(context.bx+3), context.cl); - if (!context.flags.z()) goto findopen2; + if (!context.flags.z()) + goto findopen2; context._cmp(context.ds.byte(context.bx+2), context.dl); - if (!context.flags.z()) goto findopen2; + if (!context.flags.z()) + goto findopen2; context._cmp(context.data.byte(kOpenedtype), 4); - if (context.flags.z()) goto noloccheck; + if (context.flags.z()) + goto noloccheck; context.al = context.ds.byte(context.bx+5); context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto findopen2; + if (!context.flags.z()) + goto findopen2; noloccheck: context.al = context.ds.byte(context.bx+4); context.ah = 0; @@ -6199,7 +6790,8 @@ findopen2: context._add(context.bx, 16); context._inc(context.ch); context._cmp(context.ch, (114)); - if (!context.flags.z()) goto findopen1; + if (!context.flags.z()) + goto findopen1; context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); context.push(context.dx); @@ -6209,9 +6801,11 @@ findopen2: context.ch = 0; findopen1a: context._cmp(context.ds.byte(context.bx+3), context.cl); - if (!context.flags.z()) goto findopen2a; + if (!context.flags.z()) + goto findopen2a; context._cmp(context.ds.byte(context.bx+2), context.dl); - if (!context.flags.z()) goto findopen2a; + if (!context.flags.z()) + goto findopen2a; context.al = context.ds.byte(context.bx+4); context.ah = 0; context.push(context.di); @@ -6225,7 +6819,8 @@ findopen2a: context._add(context.bx, 16); context._inc(context.ch); context._cmp(context.ch, 80); - if (!context.flags.z()) goto findopen1a; + if (!context.flags.z()) + goto findopen1a; } void obtoinv(Context &context) { @@ -6247,13 +6842,15 @@ void obtoinv(Context &context) { context.di = context.pop(); context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto finishfill; + if (context.flags.z()) + goto finishfill; context.push(context.bx); context.push(context.di); context.push(context.ax); context.ds = context.data.word(kExtras); context._cmp(context.ah, 4); - if (context.flags.z()) goto isanextra; + if (context.flags.z()) + goto isanextra; context.ds = context.data.word(kFreeframes); isanextra: context.cl = context.al; @@ -6271,7 +6868,8 @@ isanextra: getanyaddir(context); isitworn(context); context.bx = context.pop(); - if (!context.flags.z()) goto finishfill; + if (!context.flags.z()) + goto finishfill; context.ds = context.data.word(kIcons1); context._sub(context.di, 3); context._sub(context.bx, 2); @@ -6289,7 +6887,8 @@ void isitworn(Context &context) { STACK_CHECK(context); context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); - if (!context.flags.z()) goto notworn; + if (!context.flags.z()) + goto notworn; context.al = context.es.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); notworn: @@ -6339,24 +6938,30 @@ waitexam: context.data.byte(kGetback) = 0; context.bx = 2494; context._cmp(context.data.byte(kInvopen), 0); - if (context.flags.z()) goto notuseinv; + if (context.flags.z()) + goto notuseinv; context.bx = 2556; context._cmp(context.data.byte(kInvopen), 1); - if (context.flags.z()) goto notuseinv; + if (context.flags.z()) + goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); context._cmp(context.data.byte(kExamagain), 0); - if (context.flags.z()) goto norex; + if (context.flags.z()) + goto norex; goto examineagain; norex: context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto waitexam; + if (context.flags.z()) + goto waitexam; context.data.byte(kPickup) = 0; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto iswatching; + if (!context.flags.z()) + goto iswatching; context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) goto justgetback; + if (!context.flags.z()) + goto justgetback; iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; @@ -6388,7 +6993,8 @@ void makemainscreen(Context &context) { void getbackfromob(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 1); - if (!context.flags.z()) goto notheldob; + if (!context.flags.z()) + goto notheldob; blank(context); return; notheldob: @@ -6398,16 +7004,19 @@ notheldob: void incryanpage(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadyincryan; + if (context.flags.z()) + goto alreadyincryan; context.data.byte(kCommandtype) = 222; context.al = 31; commandonly(context); alreadyincryan: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noincryan; + if (context.flags.z()) + goto noincryan; context._and(context.ax, 1); - if (!context.flags.z()) goto doincryan; + if (!context.flags.z()) + goto doincryan; noincryan: return; doincryan: @@ -6417,7 +7026,8 @@ doincryan: findnewpage: context._inc(context.data.byte(kRyanpage)); context._sub(context.ax, 18); - if (!context.flags.c()) goto findnewpage; + if (!context.flags.c()) + goto findnewpage; delpointer(context); fillryan(context); readmouse(context); @@ -6498,7 +7108,8 @@ void obicons(Context &context) { context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); - if (context.flags.z()) goto cantopenit; + if (context.flags.z()) + goto cantopenit; context.ds = context.data.word(kIcons2); context.di = 210; context.bx = 1; @@ -6529,9 +7140,11 @@ void obpicture(Context &context) { context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context._cmp(context.ah, 1); - if (context.flags.z()) goto setframe; + if (context.flags.z()) + goto setframe; context._cmp(context.ah, 4); - if (context.flags.z()) goto exframe; + if (context.flags.z()) + goto exframe; context.ds = context.data.word(kFreeframes); context.di = 160; context.bx = 68; @@ -6588,7 +7201,8 @@ void additionaltext(Context &context) { context.dl = 'P'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto emptycup; + if (context.flags.z()) + goto emptycup; context.al = context.data.byte(kCommand); context.ah = context.data.byte(kObjecttype); context.cl = 'C'; @@ -6596,7 +7210,8 @@ void additionaltext(Context &context) { context.dl = 'P'; context.dh = 'F'; compare(context); - if (context.flags.z()) goto fullcup; + if (context.flags.z()) + goto fullcup; context.bx = context.pop(); return; emptycup: @@ -6627,11 +7242,13 @@ void obsthatdothings(Context &context) { context.dl = 'M'; context.dh = 'B'; compare(context); - if (!context.flags.z()) goto notlouiscard; + if (!context.flags.z()) + goto notlouiscard; context.al = 4; getlocation(context); context._cmp(context.al, 1); - if (context.flags.z()) goto seencard; + if (context.flags.z()) + goto seencard; context.al = 4; setlocation(context); lookatcard(context); @@ -6647,12 +7264,14 @@ void getobtextstart(Context &context) { context.si = (0); context.cx = (0+(82*2)); context._cmp(context.data.byte(kObjecttype), 2); - if (context.flags.z()) goto describe; + if (context.flags.z()) + goto describe; context.es = context.data.word(kSetdesc); context.si = (0); context.cx = (0+(130*2)); context._cmp(context.data.byte(kObjecttype), 1); - if (context.flags.z()) goto describe; + if (context.flags.z()) + goto describe; context.es = context.data.word(kExtras); context.si = (0+2080+30000+(16*114)); context.cx = (0+2080+30000+(16*114)+((114+2)*2)); @@ -6672,11 +7291,14 @@ tryagain: context.cx = context.si; context.si = context.pop(); context._cmp(context.data.byte(kObjecttype), 1); - if (!context.flags.z()) goto cantmakeoneup; + if (!context.flags.z()) + goto cantmakeoneup; context._cmp(context.al, 0); - if (context.flags.z()) goto findsometext; + if (context.flags.z()) + goto findsometext; context._cmp(context.al, ':'); - if (context.flags.z()) goto findsometext; + if (context.flags.z()) + goto findsometext; cantmakeoneup: return; findsometext: @@ -6692,11 +7314,13 @@ searchagain: context.al = context.es.byte(context.bx); search: context._cmp(context.es.byte(context.si), context.al); - if (context.flags.z()) goto gotstartletter; + if (context.flags.z()) + goto gotstartletter; context._inc(context.cx); context._inc(context.si); context._cmp(context.si, 8000); - if (context.flags.c()) goto search; + if (context.flags.c()) + goto search; context.si = context.bx; context.ax = context.pop(); return; @@ -6709,11 +7333,14 @@ keepchecking: context.al = context.es.byte(context.bx); context.ah = context.es.byte(context.si); context._cmp(context.al, ':'); - if (context.flags.z()) goto foundmatch; + if (context.flags.z()) + goto foundmatch; context._cmp(context.al, 0); - if (context.flags.z()) goto foundmatch; + if (context.flags.z()) + goto foundmatch; context._cmp(context.al, context.ah); - if (context.flags.z()) goto keepchecking; + if (context.flags.z()) + goto keepchecking; context.si = context.pop(); context.bx = context.pop(); goto searchagain; @@ -6728,9 +7355,11 @@ isntcolon: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto endofcolon; + if (context.flags.z()) + goto endofcolon; context._cmp(context.al, ':'); - if (!context.flags.z()) goto isntcolon; + if (!context.flags.z()) + goto isntcolon; endofcolon: return; } @@ -6738,24 +7367,29 @@ endofcolon: void inventory(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) goto iswatchinv; + if (context.flags.z()) + goto iswatchinv; context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) goto notwatchinv; + if (context.flags.z()) + goto notwatchinv; iswatchinv: blank(context); return; notwatchinv: context._cmp(context.data.byte(kCommandtype), 239); - if (context.flags.z()) goto alreadyopinv; + if (context.flags.z()) + goto alreadyopinv; context.data.byte(kCommandtype) = 239; context.al = 32; commandonly(context); alreadyopinv: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto cantopinv; + if (context.flags.z()) + goto cantopinv; context._and(context.ax, 1); - if (!context.flags.z()) goto doopeninv; + if (!context.flags.z()) + goto doopeninv; cantopinv: return; doopeninv: @@ -6812,24 +7446,30 @@ waitexam: context.data.byte(kGetback) = 0; context.bx = 2494; context._cmp(context.data.byte(kInvopen), 0); - if (context.flags.z()) goto notuseinv; + if (context.flags.z()) + goto notuseinv; context.bx = 2556; context._cmp(context.data.byte(kInvopen), 1); - if (context.flags.z()) goto notuseinv; + if (context.flags.z()) + goto notuseinv; context.bx = 2618; notuseinv: checkcoords(context); context._cmp(context.data.byte(kExamagain), 0); - if (context.flags.z()) goto norex; + if (context.flags.z()) + goto norex; goto examineagain; norex: context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto waitexam; + if (context.flags.z()) + goto waitexam; context.data.byte(kPickup) = 0; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto iswatching; + if (!context.flags.z()) + goto iswatching; context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) goto justgetback; + if (!context.flags.z()) + goto justgetback; iswatching: makemainscreen(context); context.data.byte(kInvopen) = 0; @@ -6849,19 +7489,23 @@ withlist1: void setpickup(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 1); - if (context.flags.z()) goto cantpick; + if (context.flags.z()) + goto cantpick; context._cmp(context.data.byte(kObjecttype), 3); - if (context.flags.z()) goto cantpick; + if (context.flags.z()) + goto cantpick; getanyad(context); context.al = context.es.byte(context.bx+2); context._cmp(context.al, 4); - if (!context.flags.z()) goto canpick; + if (!context.flags.z()) + goto canpick; cantpick: blank(context); return; canpick: context._cmp(context.data.byte(kCommandtype), 209); - if (context.flags.z()) goto alreadysp; + if (context.flags.z()) + goto alreadysp; context.data.byte(kCommandtype) = 209; context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kObjecttype); @@ -6870,9 +7514,11 @@ canpick: alreadysp: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); - if (!context.flags.z()) goto nosetpick; + if (!context.flags.z()) + goto nosetpick; context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) goto dosetpick; + if (!context.flags.z()) + goto dosetpick; nosetpick: return; dosetpick: @@ -6884,7 +7530,8 @@ dosetpick: context.data.byte(kPickup) = 1; context.data.byte(kInvopen) = 2; context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) goto pickupexob; + if (context.flags.z()) + goto pickupexob; context.al = context.data.byte(kCommand); context.data.byte(kItemframe) = context.al; context.data.byte(kOpenedob) = 255; @@ -6908,14 +7555,16 @@ pickupexob: void examinventory(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); - if (context.flags.z()) goto alreadyexinv; + if (context.flags.z()) + goto alreadyexinv; context.data.byte(kCommandtype) = 249; context.al = 32; commandonly(context); alreadyexinv: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (!context.flags.z()) goto doexinv; + if (!context.flags.z()) + goto doexinv; return; doexinv: createpanel(context); @@ -6955,9 +7604,11 @@ void swapwithinv(Context &context) { context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub7; + if (!context.flags.z()) + goto difsub7; context._cmp(context.data.byte(kCommandtype), 243); - if (context.flags.z()) goto alreadyswap1; + if (context.flags.z()) + goto alreadyswap1; context.data.byte(kCommandtype) = 243; difsub7: context.data.word(kOldsubject) = context.ax; @@ -6967,9 +7618,11 @@ difsub7: alreadyswap1: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto cantswap1; + if (context.flags.z()) + goto cantswap1; context._and(context.ax, 1); - if (!context.flags.z()) goto doswap1; + if (!context.flags.z()) + goto doswap1; cantswap1: return; doswap1: @@ -7012,9 +7665,11 @@ void swapwithopen(Context &context) { context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub8; + if (!context.flags.z()) + goto difsub8; context._cmp(context.data.byte(kCommandtype), 242); - if (context.flags.z()) goto alreadyswap2; + if (context.flags.z()) + goto alreadyswap2; context.data.byte(kCommandtype) = 242; difsub8: context.data.word(kOldsubject) = context.ax; @@ -7024,31 +7679,37 @@ difsub8: alreadyswap2: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto cantswap2; + if (context.flags.z()) + goto cantswap2; context._and(context.ax, 1); - if (!context.flags.z()) goto doswap2; + if (!context.flags.z()) + goto doswap2; cantswap2: return; doswap2: geteitherad(context); isitworn(context); - if (!context.flags.z()) goto notwornswap; + if (!context.flags.z()) + goto notwornswap; wornerror(context); return; notwornswap: delpointer(context); context.al = context.data.byte(kItemframe); context._cmp(context.al, context.data.byte(kOpenedob)); - if (!context.flags.z()) goto isntsame2; + if (!context.flags.z()) + goto isntsame2; context.al = context.data.byte(kObjecttype); context._cmp(context.al, context.data.byte(kOpenedtype)); - if (!context.flags.z()) goto isntsame2; + if (!context.flags.z()) + goto isntsame2; errormessage1(context); return; isntsame2: checkobjectsize(context); context._cmp(context.al, 0); - if (context.flags.z()) goto sizeok2; + if (context.flags.z()) + goto sizeok2; return; sizeok2: context.ah = context.data.byte(kObjecttype); @@ -7059,7 +7720,8 @@ sizeok2: context.data.byte(kItemframe) = context.al; context.data.byte(kObjecttype) = context.ah; context._cmp(context.ah, 4); - if (!context.flags.z()) goto makeswapex; + if (!context.flags.z()) + goto makeswapex; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; @@ -7104,23 +7766,27 @@ actuallyswap: void intoinv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); - if (!context.flags.z()) goto notout; + if (!context.flags.z()) + goto notout; outofinv(context); return; notout: findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto canplace1; + if (context.flags.z()) + goto canplace1; swapwithinv(context); return; canplace1: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub1; + if (!context.flags.z()) + goto difsub1; context._cmp(context.data.byte(kCommandtype), 220); - if (context.flags.z()) goto alreadyplce; + if (context.flags.z()) + goto alreadyplce; context.data.byte(kCommandtype) = 220; difsub1: context.data.word(kOldsubject) = context.ax; @@ -7130,9 +7796,11 @@ difsub1: alreadyplce: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notletgo2; + if (context.flags.z()) + goto notletgo2; context._and(context.ax, 1); - if (!context.flags.z()) goto doplace; + if (!context.flags.z()) + goto doplace; notletgo2: return; doplace: @@ -7162,7 +7830,8 @@ void deletetaken(Context &context) { takenloop: context.al = context.ds.byte(context.si+11); context._cmp(context.al, context.ah); - if (!context.flags.z()) goto notinhere; + if (!context.flags.z()) + goto notinhere; context.bl = context.ds.byte(context.si+1); context.bh = 0; context._add(context.bx, context.bx); @@ -7172,7 +7841,8 @@ takenloop: context.es.byte(context.bx+2) = 254; notinhere: context._add(context.si, 16); - if (--context.cx) goto takenloop; + if (--context.cx) + goto takenloop; } void outofinv(Context &context) { @@ -7180,20 +7850,24 @@ void outofinv(Context &context) { findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (!context.flags.z()) goto canpick2; + if (!context.flags.z()) + goto canpick2; blank(context); return; canpick2: context.bx = context.data.word(kMousebutton); context._cmp(context.bx, 2); - if (!context.flags.z()) goto canpick2a; + if (!context.flags.z()) + goto canpick2a; reexfrominv(context); return; canpick2a: context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub3; + if (!context.flags.z()) + goto difsub3; context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) goto alreadygrab; + if (context.flags.z()) + goto alreadygrab; context.data.byte(kCommandtype) = 221; difsub3: context.data.word(kOldsubject) = context.ax; @@ -7203,9 +7877,11 @@ difsub3: alreadygrab: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notletgo; + if (context.flags.z()) + goto notletgo; context._and(context.ax, 1); - if (!context.flags.z()) goto dograb; + if (!context.flags.z()) + goto dograb; notletgo: return; dograb: @@ -7248,7 +7924,8 @@ void getexad(Context &context) { void geteitherad(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) goto isinexlist; + if (context.flags.z()) + goto isinexlist; context.al = context.data.byte(kItemframe); getfreead(context); return; @@ -7260,9 +7937,11 @@ isinexlist: void getanyad(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) goto isex; + if (context.flags.z()) + goto isex; context._cmp(context.data.byte(kObjecttype), 2); - if (context.flags.z()) goto isfree; + if (context.flags.z()) + goto isfree; context.al = context.data.byte(kCommand); getsetad(context); context.ax = context.es.word(context.bx+4); @@ -7281,9 +7960,11 @@ isex: void getanyaddir(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 4); - if (context.flags.z()) goto isex3; + if (context.flags.z()) + goto isex3; context._cmp(context.ah, 2); - if (context.flags.z()) goto isfree3; + if (context.flags.z()) + goto isfree3; getsetad(context); return; isfree3: @@ -7296,9 +7977,11 @@ isex3: void getopenedsize(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedtype), 4); - if (context.flags.z()) goto isex2; + if (context.flags.z()) + goto isex2; context._cmp(context.data.byte(kOpenedtype), 2); - if (context.flags.z()) goto isfree2; + if (context.flags.z()) + goto isfree2; context.al = context.data.byte(kOpenedob); getsetad(context); context.ax = context.es.word(context.bx+3); @@ -7331,14 +8014,16 @@ void findinvpos(Context &context) { findinv1: context._inc(context.bx); context._sub(context.cx, (44)); - if (!context.flags.c()) goto findinv1; + if (!context.flags.c()) + goto findinv1; context.cx = context.data.word(kMousey); context._sub(context.cx, (58)); context._sub(context.bx, 5); findinv2: context._add(context.bx, 5); context._sub(context.cx, (44)); - if (!context.flags.c()) goto findinv2; + if (!context.flags.c()) + goto findinv2; context.al = context.data.byte(kRyanpage); context.ah = 0; context.cx = 10; @@ -7359,7 +8044,8 @@ void findopenpos(Context &context) { findopenp1: context._inc(context.bx); context._sub(context.cx, (44)); - if (!context.flags.c()) goto findopenp1; + if (!context.flags.c()) + goto findopenp1; context.al = context.bl; context.data.byte(kLastinvpos) = context.al; context._add(context.bx, context.bx); @@ -7370,10 +8056,12 @@ findopenp1: void dropobject(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 223); - if (context.flags.z()) goto alreadydrop; + if (context.flags.z()) + goto alreadydrop; context.data.byte(kCommandtype) = 223; context._cmp(context.data.byte(kPickup), 0); - if (context.flags.z()) { blank(context); return; }; + if (context.flags.z()) + { blank(context); return; }; context.bl = context.data.byte(kItemframe); context.bh = context.data.byte(kObjecttype); context.al = 37; @@ -7381,35 +8069,42 @@ void dropobject(Context &context) { alreadydrop: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nodrop; + if (context.flags.z()) + goto nodrop; context._and(context.ax, 1); - if (!context.flags.z()) goto dodrop; + if (!context.flags.z()) + goto dodrop; nodrop: return; dodrop: geteitherad(context); isitworn(context); - if (!context.flags.z()) goto nowornerror; + if (!context.flags.z()) + goto nowornerror; wornerror(context); return; nowornerror: context._cmp(context.data.byte(kReallocation), 47); - if (context.flags.z()) goto nodrop2; + if (context.flags.z()) + goto nodrop2; context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); - if (context.flags.c()) goto nodroperror; + if (context.flags.c()) + goto nodroperror; nodrop2: droperror(context); return; nodroperror: context._cmp(context.data.byte(kMapxsize), 64); - if (!context.flags.z()) goto notinlift; + if (!context.flags.z()) + goto notinlift; context._cmp(context.data.byte(kMapysize), 64); - if (!context.flags.z()) goto notinlift; + if (!context.flags.z()) + goto notinlift; droperror(context); return; notinlift: @@ -7420,7 +8115,8 @@ notinlift: context.dl = 'N'; context.dh = 'A'; compare(context); - if (context.flags.z()) { cantdrop(context); return; }; + if (context.flags.z()) + { cantdrop(context); return; }; context.al = context.data.byte(kItemframe); context.ah = 4; context.cl = 'S'; @@ -7428,7 +8124,8 @@ notinlift: context.dl = 'L'; context.dh = 'D'; compare(context); - if (context.flags.z()) { cantdrop(context); return; }; + if (context.flags.z()) + { cantdrop(context); return; }; context.data.byte(kObjecttype) = 4; context.al = context.data.byte(kItemframe); getexad(context); @@ -7518,7 +8215,8 @@ void wornerror(Context &context) { void removeobfrominv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommand), 100); - if (context.flags.z()) goto obnotexist; + if (context.flags.z()) + goto obnotexist; getanyad(context); context.di = context.bx; context.cl = context.data.byte(kCommand); @@ -7533,12 +8231,14 @@ void selectopenob(Context &context) { context.al = context.data.byte(kCommand); getanyad(context); context._cmp(context.al, 255); - if (!context.flags.z()) goto canopenit1; + if (!context.flags.z()) + goto canopenit1; blank(context); return; canopenit1: context._cmp(context.data.byte(kCommandtype), 224); - if (context.flags.z()) goto alreadyopob; + if (context.flags.z()) + goto alreadyopob; context.data.byte(kCommandtype) = 224; context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kObjecttype); @@ -7547,9 +8247,11 @@ canopenit1: alreadyopob: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noopenob; + if (context.flags.z()) + goto noopenob; context._and(context.ax, 1); - if (!context.flags.z()) goto doopenob; + if (!context.flags.z()) + goto doopenob; noopenob: return; doopenob: @@ -7574,31 +8276,37 @@ doopenob: void useopened(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); - if (context.flags.z()) goto cannotuseopen; + if (context.flags.z()) + goto cannotuseopen; context._cmp(context.data.byte(kPickup), 0); - if (!context.flags.z()) goto notout2; + if (!context.flags.z()) + goto notout2; outofopen(context); return; notout2: findopenpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto canplace3; + if (context.flags.z()) + goto canplace3; swapwithopen(context); cannotuseopen: return; canplace3: context._cmp(context.data.byte(kPickup), 1); - if (context.flags.z()) goto intoopen; + if (context.flags.z()) + goto intoopen; blank(context); return; intoopen: context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub2; + if (!context.flags.z()) + goto difsub2; context._cmp(context.data.byte(kCommandtype), 227); - if (context.flags.z()) goto alreadyplc2; + if (context.flags.z()) + goto alreadyplc2; context.data.byte(kCommandtype) = 227; difsub2: context.data.word(kOldsubject) = context.ax; @@ -7608,31 +8316,37 @@ difsub2: alreadyplc2: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notletgo3; + if (context.flags.z()) + goto notletgo3; context._cmp(context.ax, 1); - if (context.flags.z()) goto doplace2; + if (context.flags.z()) + goto doplace2; notletgo3: return; doplace2: geteitherad(context); isitworn(context); - if (!context.flags.z()) goto notworntoopen; + if (!context.flags.z()) + goto notworntoopen; wornerror(context); return; notworntoopen: delpointer(context); context.al = context.data.byte(kItemframe); context._cmp(context.al, context.data.byte(kOpenedob)); - if (!context.flags.z()) goto isntsame; + if (!context.flags.z()) + goto isntsame; context.al = context.data.byte(kObjecttype); context._cmp(context.al, context.data.byte(kOpenedtype)); - if (!context.flags.z()) goto isntsame; + if (!context.flags.z()) + goto isntsame; errormessage1(context); return; isntsame: checkobjectsize(context); context._cmp(context.al, 0); - if (context.flags.z()) goto sizeok1; + if (context.flags.z()) + goto sizeok1; return; sizeok1: context.data.byte(kPickup) = 0; @@ -7734,30 +8448,37 @@ void checkobjectsize(Context &context) { context.al = context.es.byte(context.bx+9); context.cx = context.pop(); context._cmp(context.al, 255); - if (!context.flags.z()) goto notunsized; + if (!context.flags.z()) + goto notunsized; context.al = 6; notunsized: context._cmp(context.al, 100); - if (!context.flags.c()) goto specialcase; + if (!context.flags.c()) + goto specialcase; context._cmp(context.cl, 100); - if (context.flags.c()) goto isntspecial; + if (context.flags.c()) + goto isntspecial; errormessage3(context); goto sizewrong; isntspecial: context._cmp(context.cl, context.al); - if (!context.flags.c()) goto sizeok; + if (!context.flags.c()) + goto sizeok; specialcase: context._sub(context.al, 100); context._cmp(context.cl, 100); - if (!context.flags.c()) goto bothspecial; + if (!context.flags.c()) + goto bothspecial; context._cmp(context.cl, context.al); - if (!context.flags.c()) goto sizeok; + if (!context.flags.c()) + goto sizeok; errormessage2(context); goto sizewrong; bothspecial: context._sub(context.cl, 100); context._cmp(context.al, context.cl); - if (context.flags.z()) goto sizeok; + if (context.flags.z()) + goto sizeok; errormessage3(context); sizewrong: context.al = 1; @@ -7769,19 +8490,23 @@ sizeok: void outofopen(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); - if (context.flags.z()) goto cantuseopen; + if (context.flags.z()) + goto cantuseopen; findopenpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (!context.flags.z()) goto canpick4; + if (!context.flags.z()) + goto canpick4; cantuseopen: blank(context); return; canpick4: context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto difsub4; + if (!context.flags.z()) + goto difsub4; context._cmp(context.data.byte(kCommandtype), 228); - if (context.flags.z()) goto alreadygrb; + if (context.flags.z()) + goto alreadygrb; context.data.byte(kCommandtype) = 228; difsub4: context.data.word(kOldsubject) = context.ax; @@ -7791,11 +8516,14 @@ difsub4: alreadygrb: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notletgo4; + if (context.flags.z()) + goto notletgo4; context._cmp(context.ax, 1); - if (context.flags.z()) goto dogrb; + if (context.flags.z()) + goto dogrb; context._cmp(context.ax, 2); - if (!context.flags.z()) goto notletgo4; + if (!context.flags.z()) + goto notletgo4; reexfromopen(context); notletgo4: return; @@ -7807,7 +8535,8 @@ dogrb: context.data.byte(kItemframe) = context.al; context.data.byte(kObjecttype) = context.ah; context._cmp(context.ah, 4); - if (!context.flags.z()) goto makeintoex; + if (!context.flags.z()) + goto makeintoex; geteitherad(context); context.es.byte(context.bx+2) = 20; context.es.byte(context.bx+3) = 255; @@ -7843,8 +8572,9 @@ void transfertoex(Context &context) { context.ds = context.data.word(kFreedat); context.si = context.ax; context.cx = 8; - while(context.cx--) context._movsw(); - context.di = context.pop(); + while(context.cx--) + context._movsw(); + context.di = context.pop(); context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; context.es.byte(context.di+11) = context.al; @@ -7874,7 +8604,8 @@ void pickupconts(Context &context) { STACK_CHECK(context); context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); - if (context.flags.z()) goto notopenable; + if (context.flags.z()) + goto notopenable; context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context.dl = context.data.byte(kExpos); @@ -7888,9 +8619,11 @@ pickupcontloop: context.push(context.dx); context.push(context.ax); context._cmp(context.es.byte(context.bx+2), context.ah); - if (!context.flags.z()) goto notinsidethis; + if (!context.flags.z()) + goto notinsidethis; context._cmp(context.es.byte(context.bx+3), context.al); - if (!context.flags.z()) goto notinsidethis; + if (!context.flags.z()) + goto notinsidethis; context.data.byte(kItemtotran) = context.cl; transfercontoex(context); notinsidethis: @@ -7902,7 +8635,8 @@ notinsidethis: context._add(context.bx, 16); context._inc(context.cx); context._cmp(context.cx, 80); - if (!context.flags.z()) goto pickupcontloop; + if (!context.flags.z()) + goto pickupcontloop; notopenable: return; } @@ -7919,8 +8653,9 @@ void transfercontoex(Context &context) { context.ds = context.pop(); context.push(context.di); context.cx = 8; - while(context.cx--) context._movsw(); - context.di = context.pop(); + while(context.cx--) + context._movsw(); + context.di = context.pop(); context.dx = context.pop(); context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; @@ -7962,7 +8697,8 @@ moretext: context._stosb(); context._inc(context.data.word(kExtextpos)); context._cmp(context.al, 0); - if (!context.flags.z()) goto moretext; + if (!context.flags.z()) + goto moretext; } void getexpos(Context &context) { @@ -7972,11 +8708,13 @@ void getexpos(Context &context) { context.di = (0+2080+30000); tryanotherex: context._cmp(context.es.byte(context.di+2), 255); - if (context.flags.z()) goto foundnewex; + if (context.flags.z()) + goto foundnewex; context._add(context.di, 16); context._inc(context.al); context._cmp(context.al, (114)); - if (!context.flags.z()) goto tryanotherex; + if (!context.flags.z()) + goto tryanotherex; foundnewex: context.data.byte(kExpos) = context.al; } @@ -7990,9 +8728,11 @@ void purgealocation(Context &context) { context.cx = 0; purgeloc: context._cmp(context.bl, context.es.byte(context.di+0)); - if (!context.flags.z()) goto dontpurge; + if (!context.flags.z()) + goto dontpurge; context._cmp(context.es.byte(context.di+2), 0); - if (!context.flags.z()) goto dontpurge; + if (!context.flags.z()) + goto dontpurge; context.push(context.di); context.push(context.es); context.push(context.bx); @@ -8006,7 +8746,8 @@ dontpurge: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); - if (!context.flags.z()) goto purgeloc; + if (!context.flags.z()) + goto purgeloc; } void emergencypurge(Context &context) { @@ -8015,14 +8756,16 @@ checkpurgeagain: context.ax = context.data.word(kExframepos); context._add(context.ax, 4000); context._cmp(context.ax, (30000)); - if (context.flags.c()) goto notnearframeend; + if (context.flags.c()) + goto notnearframeend; purgeanitem(context); goto checkpurgeagain; notnearframeend: context.ax = context.data.word(kExtextpos); context._add(context.ax, 400); context._cmp(context.ax, (18000)); - if (context.flags.c()) goto notneartextend; + if (context.flags.c()) + goto notneartextend; purgeanitem(context); goto checkpurgeagain; notneartextend: @@ -8038,37 +8781,45 @@ void purgeanitem(Context &context) { lookforpurge: context.al = context.es.byte(context.di+2); context._cmp(context.al, 0); - if (!context.flags.z()) goto cantpurge; + if (!context.flags.z()) + goto cantpurge; context._cmp(context.es.byte(context.di+12), 2); - if (context.flags.z()) goto iscup; + if (context.flags.z()) + goto iscup; context._cmp(context.es.byte(context.di+12), 255); - if (!context.flags.z()) goto cantpurge; + if (!context.flags.z()) + goto cantpurge; iscup: context._cmp(context.es.byte(context.di+11), context.bl); - if (context.flags.z()) goto cantpurge; + if (context.flags.z()) + goto cantpurge; deleteexobject(context); return; cantpurge: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); - if (!context.flags.z()) goto lookforpurge; + if (!context.flags.z()) + goto lookforpurge; context.di = (0+2080+30000); context.bl = context.data.byte(kReallocation); context.cx = 0; lookforpurge2: context.al = context.es.byte(context.di+2); context._cmp(context.al, 0); - if (!context.flags.z()) goto cantpurge2; + if (!context.flags.z()) + goto cantpurge2; context._cmp(context.es.byte(context.di+12), 255); - if (!context.flags.z()) goto cantpurge2; + if (!context.flags.z()) + goto cantpurge2; deleteexobject(context); return; cantpurge2: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); - if (!context.flags.z()) goto lookforpurge2; + if (!context.flags.z()) + goto lookforpurge2; } void deleteexobject(Context &context) { @@ -8079,7 +8830,8 @@ void deleteexobject(Context &context) { context.push(context.cx); context.al = 255; context.cx = 16; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.ax = context.pop(); context.cl = context.al; context._add(context.al, context.al); @@ -8100,7 +8852,8 @@ void deleteexobject(Context &context) { context.cx = 0; deleteconts: context._cmp(context.es.word(context.di+2), context.bx); - if (!context.flags.z()) goto notinsideex; + if (!context.flags.z()) + goto notinsideex; context.push(context.bx); context.push(context.cx); context.push(context.di); @@ -8112,7 +8865,8 @@ notinsideex: context._add(context.di, 16); context._inc(context.cx); context._cmp(context.cx, (114)); - if (!context.flags.z()) goto deleteconts; + if (!context.flags.z()) + goto deleteconts; } void deleteexframe(Context &context) { @@ -8137,8 +8891,9 @@ void deleteexframe(Context &context) { context._add(context.si, context.ax); context.push(context.ax); context.ds = context.es; - while(context.cx--) context._movsb(); - context.bx = context.pop(); + while(context.cx--) + context._movsb(); + context.bx = context.pop(); context._sub(context.data.word(kExframepos), context.bx); context.si = context.pop(); context.cx = (114)*3; @@ -8146,12 +8901,14 @@ void deleteexframe(Context &context) { shuffleadsdown: context.ax = context.es.word(context.di+2); context._cmp(context.ax, context.si); - if (context.flags.c()) goto beforethisone; + if (context.flags.c()) + goto beforethisone; context._sub(context.ax, context.bx); beforethisone: context.es.word(context.di+2) = context.ax; context._add(context.di, 6); - if (--context.cx) goto shuffleadsdown; + if (--context.cx) + goto shuffleadsdown; } void deleteextext(Context &context) { @@ -8171,15 +8928,17 @@ findlenextext: context._inc(context.ax); context._inc(context.si); context._cmp(context.cl, 0); - if (!context.flags.z()) goto findlenextext; + if (!context.flags.z()) + goto findlenextext; context.cx = (18000); context.bx = context.si; context._sub(context.bx, (0+2080+30000+(16*114)+((114+2)*2))); context.push(context.bx); context.push(context.ax); context._sub(context.cx, context.bx); - while(context.cx--) context._movsb(); - context.bx = context.pop(); + while(context.cx--) + context._movsb(); + context.bx = context.pop(); context._sub(context.data.word(kExtextpos), context.bx); context.si = context.pop(); context.cx = (114); @@ -8187,12 +8946,14 @@ findlenextext: shuffletextads: context.ax = context.es.word(context.di); context._cmp(context.ax, context.si); - if (context.flags.c()) goto beforethistext; + if (context.flags.c()) + goto beforethistext; context._sub(context.ax, context.bx); beforethistext: context.es.word(context.di) = context.ax; context._add(context.di, 2); - if (--context.cx) goto shuffletextads; + if (--context.cx) + goto shuffletextads; } void blockget(Context &context) { @@ -8257,7 +9018,8 @@ void getdimension(Context &context) { dimloop1: addalong(context); context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim1; + if (!context.flags.z()) + goto finishdim1; context._inc(context.ch); goto dimloop1; finishdim1: @@ -8268,7 +9030,8 @@ dimloop2: addlength(context); context.bx = context.pop(); context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim2; + if (!context.flags.z()) + goto finishdim2; context._inc(context.cl); context._add(context.bx, 3); goto dimloop2; @@ -8280,7 +9043,8 @@ dimloop3: addalong(context); context.bx = context.pop(); context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim3; + if (!context.flags.z()) + goto finishdim3; context._dec(context.dh); context._sub(context.bx, 11*3); goto dimloop3; @@ -8292,7 +9056,8 @@ dimloop4: addlength(context); context.bx = context.pop(); context._cmp(context.al, 0); - if (!context.flags.z()) goto finishdim4; + if (!context.flags.z()) + goto finishdim4; context._dec(context.dl); context._sub(context.bx, 3); goto dimloop4; @@ -8334,10 +9099,12 @@ void addalong(Context &context) { context.ah = 11; addloop: context._cmp(context.es.byte(context.bx), 0); - if (!context.flags.z()) goto gotalong; + if (!context.flags.z()) + goto gotalong; context._add(context.bx, 3); context._dec(context.ah); - if (!context.flags.z()) goto addloop; + if (!context.flags.z()) + goto addloop; context.al = 0; return; gotalong: @@ -8349,10 +9116,12 @@ void addlength(Context &context) { context.ah = 10; addloop2: context._cmp(context.es.byte(context.bx), 0); - if (!context.flags.z()) goto gotlength; + if (!context.flags.z()) + goto gotlength; context._add(context.bx, 3*11); context._dec(context.ah); - if (!context.flags.z()) goto addloop2; + if (!context.flags.z()) + goto addloop2; context.al = 0; return; gotlength: @@ -8387,19 +9156,22 @@ _tmp28a: context.si = (0); context._add(context.si, context.ax); context._movsw(); - context.ax = context.pop(); + context.ax = context.pop(); context._stosb(); context.si = context.pop(); - if (--context.cx) goto _tmp28a; + if (--context.cx) + goto _tmp28a; context._add(context.si, (66)-11); context.cx = context.pop(); - if (--context.cx) goto _tmp28; + if (--context.cx) + goto _tmp28; } void eraseoldobs(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); - if (context.flags.z()) goto donterase; + if (context.flags.z()) + goto donterase; context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; @@ -8408,16 +9180,19 @@ oberase: context.push(context.bx); context.ax = context.es.word(context.bx+20); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto notthisob; + if (context.flags.z()) + goto notthisob; context.di = context.bx; context.al = 255; context.cx = (32); - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); notthisob: context.bx = context.pop(); context.cx = context.pop(); context._add(context.bx, (32)); - if (--context.cx) goto oberase; + if (--context.cx) + goto oberase; donterase: return; } @@ -8430,7 +9205,8 @@ void showallobs(Context &context) { context.di = context.bx; context.cx = 128*5; context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.es = context.data.word(kSetframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -8450,12 +9226,14 @@ showobsloop: getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); - if (context.flags.z()) goto blankframe; + if (context.flags.z()) + goto blankframe; context.al = context.es.byte(context.si+18); context.ah = 0; context.data.word(kCurrentframe) = context.ax; context._cmp(context.al, 255); - if (context.flags.z()) goto blankframe; + if (context.flags.z()) + goto blankframe; context.push(context.es); context.push(context.si); calcfrframe(context); @@ -8465,11 +9243,14 @@ showobsloop: context.al = context.es.byte(context.si+18); context.es.byte(context.si+17) = context.al; context._cmp(context.es.byte(context.si+8), 0); - if (!context.flags.z()) goto animating; + if (!context.flags.z()) + goto animating; context._cmp(context.es.byte(context.si+5), 5); - if (context.flags.z()) goto animating; + if (context.flags.z()) + goto animating; context._cmp(context.es.byte(context.si+5), 6); - if (context.flags.z()) goto animating; + if (context.flags.z()) + goto animating; context.ax = context.data.word(kCurrentframe); context.ah = 0; context._add(context.di, context.data.word(kMapadx)); @@ -8499,7 +9280,8 @@ blankframe: context.cx = context.pop(); context._add(context.si, 64); context._dec(context.cx); - if (context.flags.z()) goto finishedsetobs; + if (context.flags.z()) + goto finishedsetobs; goto showobsloop; finishedsetobs: return; @@ -8508,7 +9290,8 @@ finishedsetobs: void makebackob(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); - if (context.flags.z()) goto nomake; + if (context.flags.z()) + goto nomake; context.al = context.es.byte(context.si+5); context.ah = context.es.byte(context.si+8); context.push(context.si); @@ -8526,7 +9309,8 @@ void makebackob(Context &context) { context.es.word(context.bx+20) = context.ax; context.ax = context.pop(); context._cmp(context.al, 255); - if (!context.flags.z()) goto usedpriority; + if (!context.flags.z()) + goto usedpriority; context.al = 0; usedpriority: context.es.byte(context.bx+23) = context.al; @@ -8547,7 +9331,8 @@ void showallfree(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.cx = 80*5; context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.es = context.data.word(kFreeframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -8567,7 +9352,8 @@ loop127: getmapad(context); context.si = context.pop(); context._cmp(context.ch, 0); - if (context.flags.z()) goto over138; + if (context.flags.z()) + goto over138; context.al = context.data.byte(kCurrentfree); context.ah = 0; context.dx = context.ax; @@ -8583,7 +9369,8 @@ loop127: context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); - if (context.flags.z()) goto over138; + if (context.flags.z()) + goto over138; context.ax = context.data.word(kCurrentframe); context.ah = 0; context._add(context.di, context.data.word(kMapadx)); @@ -8613,7 +9400,8 @@ over138: context._add(context.si, 16); context._inc(context.cx); context._cmp(context.cx, 80); - if (context.flags.z()) goto finfree; + if (context.flags.z()) + goto finfree; goto loop127; finfree: return; @@ -8627,7 +9415,8 @@ void showallex(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.cx = 100*5; context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.es = context.data.word(kExtras); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -8644,15 +9433,18 @@ exloop: context.push(context.si); context.ch = 0; context._cmp(context.es.byte(context.si), 255); - if (context.flags.z()) goto notinroom; + if (context.flags.z()) + goto notinroom; context.al = context.es.byte(context.si-2); context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto notinroom; + if (!context.flags.z()) + goto notinroom; getmapad(context); notinroom: context.si = context.pop(); context._cmp(context.ch, 0); - if (context.flags.z()) goto blankex; + if (context.flags.z()) + goto blankex; context.al = context.data.byte(kCurrentex); context.ah = 0; context.dx = context.ax; @@ -8668,7 +9460,8 @@ notinroom: context.si = context.pop(); context.es = context.pop(); context._cmp(context.cx, 0); - if (context.flags.z()) goto blankex; + if (context.flags.z()) + goto blankex; context.ax = context.data.word(kCurrentframe); context.ah = 0; context._add(context.di, context.data.word(kMapadx)); @@ -8698,7 +9491,8 @@ blankex: context._add(context.si, 16); context._inc(context.cx); context._cmp(context.cx, 100); - if (context.flags.z()) goto finex; + if (context.flags.z()) + goto finex; goto exloop; finex: return; @@ -8755,7 +9549,8 @@ void adjustlen(Context &context) { context.ah = context.al; context._add(context.al, context.ch); context._cmp(context.al, 100); - if (context.flags.c()) goto over242; + if (context.flags.c()) + goto over242; context.al = 224; context._sub(context.al, context.ch); context.ch = context.al; @@ -8767,11 +9562,13 @@ void getmapad(Context &context) { STACK_CHECK(context); getxad(context); context._cmp(context.ch, 0); - if (context.flags.z()) goto over146; + if (context.flags.z()) + goto over146; context.data.word(kObjectx) = context.ax; getyad(context); context._cmp(context.ch, 0); - if (context.flags.z()) goto over146; + if (context.flags.z()) + goto over146; context.data.word(kObjecty) = context.ax; context.ch = 1; over146: @@ -8787,11 +9584,14 @@ void getxad(Context &context) { context.ah = context.es.byte(context.si); context._inc(context.si); context._cmp(context.cl, 0); - if (!context.flags.z()) goto over148; + if (!context.flags.z()) + goto over148; context._sub(context.al, context.data.byte(kMapx)); - if (context.flags.c()) goto over148; + if (context.flags.c()) + goto over148; context._cmp(context.al, 11); - if (!context.flags.c()) goto over148; + if (!context.flags.c()) + goto over148; context.cl = 4; context._shl(context.al, context.cl); context._or(context.al, context.ah); @@ -8809,9 +9609,11 @@ void getyad(Context &context) { context.ah = context.es.byte(context.si); context._inc(context.si); context._sub(context.al, context.data.byte(kMapy)); - if (context.flags.c()) goto over147; + if (context.flags.c()) + goto over147; context._cmp(context.al, 10); - if (!context.flags.c()) goto over147; + if (!context.flags.c()) + goto over147; context.cl = 4; context._shl(context.al, context.cl); context._or(context.al, context.ah); @@ -8826,15 +9628,19 @@ void autolook(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kMousex); context._cmp(context.ax, context.data.word(kOldx)); - if (!context.flags.z()) goto diffmouse; + if (!context.flags.z()) + goto diffmouse; context.ax = context.data.word(kMousey); context._cmp(context.ax, context.data.word(kOldy)); - if (!context.flags.z()) goto diffmouse; + if (!context.flags.z()) + goto diffmouse; context._dec(context.data.word(kLookcounter)); context._cmp(context.data.word(kLookcounter), 0); - if (!context.flags.z()) goto noautolook; + if (!context.flags.z()) + goto noautolook; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto noautolook; + if (!context.flags.z()) + goto noautolook; dolook(context); noautolook: return; @@ -8845,20 +9651,25 @@ diffmouse: void look(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) { blank(context); return; }; + if (context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 241); - if (context.flags.z()) goto alreadylook; + if (context.flags.z()) + goto alreadylook; context.data.byte(kCommandtype) = 241; context.al = 25; commandonly(context); alreadylook: context._cmp(context.data.word(kMousebutton), 1); - if (!context.flags.z()) goto nolook; + if (!context.flags.z()) + goto nolook; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nolook; + if (context.flags.z()) + goto nolook; dolook(context); nolook: return; @@ -8883,14 +9694,16 @@ void dolook(Context &context) { findnextcolon(context); context.di = 66; context._cmp(context.data.byte(kReallocation), 50); - if (context.flags.c()) goto notdream3; + if (context.flags.c()) + goto notdream3; context.di = 40; notdream3: context.bx = 80; context.dl = 241; printslow(context); context._cmp(context.al, 1); - if (context.flags.z()) goto afterlook; + if (context.flags.z()) + goto afterlook; context.cx = 400; hangonp(context); afterlook: @@ -8918,21 +9731,25 @@ void redrawmainscrn(Context &context) { void getback1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPickup), 0); - if (context.flags.z()) goto notgotobject; + if (context.flags.z()) + goto notgotobject; blank(context); return; notgotobject: context._cmp(context.data.byte(kCommandtype), 202); - if (context.flags.z()) goto alreadyget; + if (context.flags.z()) + goto alreadyget; context.data.byte(kCommandtype) = 202; context.al = 26; commandonly(context); alreadyget: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nogetback; + if (context.flags.z()) + goto nogetback; context._and(context.ax, 1); - if (!context.flags.z()) goto dogetback; + if (!context.flags.z()) + goto dogetback; nogetback: return; dogetback: @@ -8969,11 +9786,13 @@ waittalk: context.bx = 2660; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto waittalk; + if (context.flags.z()) + goto waittalk; context.bx = context.data.word(kPersondata); context.es = context.cs; context._cmp(context.data.byte(kTalkpos), 4); - if (context.flags.c()) goto notnexttalk; + if (context.flags.c()) + goto notnexttalk; context.al = context.es.byte(context.bx+7); context._or(context.al, 128); context.es.byte(context.bx+7) = context.al; @@ -8981,7 +9800,8 @@ notnexttalk: redrawmainscrn(context); worktoscreenm(context); context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) goto nospeech; + if (!context.flags.z()) + goto nospeech; cancelch1(context); context.data.byte(kVolumedirection) = -1; context.data.byte(kVolumeto) = 0; @@ -9045,7 +9865,8 @@ void starttalk(Context &context) { context.dh = context.data.byte(kReallocation); loadspeech(context); context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) goto nospeech1; + if (!context.flags.z()) + goto nospeech1; context.data.byte(kVolumedirection) = 1; context.data.byte(kVolumeto) = 6; context.al = 50+12; @@ -9071,28 +9892,33 @@ void getpersontext(Context &context) { void moretalk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kTalkmode), 0); - if (context.flags.z()) goto canmore; + if (context.flags.z()) + goto canmore; redes(context); return; canmore: context._cmp(context.data.byte(kCommandtype), 215); - if (context.flags.z()) goto alreadymore; + if (context.flags.z()) + goto alreadymore; context.data.byte(kCommandtype) = 215; context.al = 49; commandonly(context); alreadymore: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nomore; + if (context.flags.z()) + goto nomore; context._and(context.ax, 1); - if (!context.flags.z()) goto domoretalk; + if (!context.flags.z()) + goto domoretalk; nomore: return; domoretalk: context.data.byte(kTalkmode) = 2; context.data.byte(kTalkpos) = 4; context._cmp(context.data.byte(kCharacter), 100); - if (context.flags.c()) goto notsecondpart; + if (context.flags.c()) + goto notsecondpart; context.data.byte(kTalkpos) = 48; notsecondpart: dosometalk(context); @@ -9120,7 +9946,8 @@ dospeech: context._add(context.ax, context.cx); context.si = context.ax; context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) goto endheartalk; + if (context.flags.z()) + goto endheartalk; context.push(context.es); context.push(context.si); createpanel(context); @@ -9149,7 +9976,8 @@ dospeech: context.dh = context.data.byte(kReallocation); loadspeech(context); context._cmp(context.data.byte(kSpeechloaded), 0); - if (context.flags.z()) goto noplay1; + if (context.flags.z()) + goto noplay1; context.al = 62; playchannel1(context); noplay1: @@ -9157,7 +9985,8 @@ noplay1: worktoscreenm(context); context.cx = 180; hangonpq(context); - if (!context.flags.c()) goto _tmp1; + if (!context.flags.c()) + goto _tmp1; return; _tmp1: context._inc(context.data.byte(kTalkpos)); @@ -9180,11 +10009,14 @@ _tmp1: context._add(context.ax, context.cx); context.si = context.ax; context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) goto endheartalk; + if (context.flags.z()) + goto endheartalk; context._cmp(context.es.byte(context.si), ':'); - if (context.flags.z()) goto skiptalk2; + if (context.flags.z()) + goto skiptalk2; context._cmp(context.es.byte(context.si), 32); - if (context.flags.z()) goto skiptalk2; + if (context.flags.z()) + goto skiptalk2; context.push(context.es); context.push(context.si); createpanel(context); @@ -9213,7 +10045,8 @@ _tmp1: context.dh = context.data.byte(kReallocation); loadspeech(context); context._cmp(context.data.byte(kSpeechloaded), 0); - if (context.flags.z()) goto noplay2; + if (context.flags.z()) + goto noplay2; context.al = 62; playchannel1(context); noplay2: @@ -9221,7 +10054,8 @@ noplay2: worktoscreenm(context); context.cx = 180; hangonpq(context); - if (!context.flags.c()) goto skiptalk2; + if (!context.flags.c()) + goto skiptalk2; return; skiptalk2: context._inc(context.data.byte(kTalkpos)); @@ -9249,19 +10083,25 @@ hangloopq: context.bx = context.pop(); context.cx = context.pop(); context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) goto quitconv; + if (context.flags.z()) + goto quitconv; context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) goto notspeaking; + if (!context.flags.z()) + goto notspeaking; context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) goto notspeaking; + if (!context.flags.z()) + goto notspeaking; context._inc(context.bx); context._cmp(context.bx, 40); - if (context.flags.z()) goto finishconv; + if (context.flags.z()) + goto finishconv; notspeaking: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto hangloopq; + if (context.flags.z()) + goto hangloopq; context._cmp(context.data.word(kOldbutton), 0); - if (!context.flags.z()) goto hangloopq; + if (!context.flags.z()) + goto hangloopq; finishconv: delpointer(context); context.data.byte(kPointermode) = 0; @@ -9277,22 +10117,26 @@ quitconv: void redes(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) goto cantredes; + if (!context.flags.z()) + goto cantredes; context._cmp(context.data.byte(kTalkmode), 2); - if (context.flags.z()) goto canredes; + if (context.flags.z()) + goto canredes; cantredes: blank(context); return; canredes: context._cmp(context.data.byte(kCommandtype), 217); - if (context.flags.z()) goto alreadyreds; + if (context.flags.z()) + goto alreadyreds; context.data.byte(kCommandtype) = 217; context.al = 50; commandonly(context); alreadyreds: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (!context.flags.z()) goto doredes; + if (!context.flags.z()) + goto doredes; return; doredes: delpointer(context); @@ -9311,9 +10155,11 @@ doredes: void newplace(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedtotravel), 1); - if (context.flags.z()) goto istravel; + if (context.flags.z()) + goto istravel; context._cmp(context.data.byte(kAutolocation), -1); - if (!context.flags.z()) goto isautoloc; + if (!context.flags.z()) + goto isautoloc; return; isautoloc: context.al = context.data.byte(kAutolocation); @@ -9359,14 +10205,17 @@ select: dumppointer(context); dumptextline(context); context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) goto quittravel; + if (context.flags.z()) + goto quittravel; context.bx = 2714; checkcoords(context); context._cmp(context.data.byte(kNewlocation), 255); - if (context.flags.z()) goto select; + if (context.flags.z()) + goto select; context.al = context.data.byte(kNewlocation); context._cmp(context.al, context.data.byte(kLocation)); - if (context.flags.z()) goto quittravel; + if (context.flags.z()) + goto quittravel; getridoftemp(context); getridoftemp2(context); getridoftemp3(context); @@ -9404,19 +10253,23 @@ void showcity(Context &context) { void lookatplace(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 224); - if (context.flags.z()) goto alreadyinfo; + if (context.flags.z()) + goto alreadyinfo; context.data.byte(kCommandtype) = 224; context.al = 27; commandonly(context); alreadyinfo: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto noinfo; + if (context.flags.z()) + goto noinfo; context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noinfo; + if (context.flags.z()) + goto noinfo; context.bl = context.data.byte(kDestpos); context._cmp(context.bl, 15); - if (!context.flags.c()) goto noinfo; + if (!context.flags.c()) + goto noinfo; context.push(context.bx); delpointer(context); deltextline(context); @@ -9486,7 +10339,8 @@ void locationpic(Context &context) { context.push(context.si); context.di = 0; context._cmp(context.al, 6); - if (!context.flags.c()) goto secondlot; + if (!context.flags.c()) + goto secondlot; context.ds = context.data.word(kTempgraphics); context._add(context.al, 4); goto gotgraphic; @@ -9502,7 +10356,8 @@ gotgraphic: context.es = context.pop(); context.al = context.data.byte(kDestpos); context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto notinthisone; + if (!context.flags.z()) + goto notinthisone; context.al = 3; context.di = 104; context.bx = 140+14; @@ -9568,25 +10423,30 @@ void showarrows(Context &context) { void nextdest(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 218); - if (context.flags.z()) goto alreadydu; + if (context.flags.z()) + goto alreadydu; context.data.byte(kCommandtype) = 218; context.al = 28; commandonly(context); alreadydu: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto nodu; + if (context.flags.z()) + goto nodu; context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nodu; + if (context.flags.z()) + goto nodu; searchdestup: context._inc(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), 15); - if (!context.flags.z()) goto notlastdest; + if (!context.flags.z()) + goto notlastdest; context.data.byte(kDestpos) = 0; notlastdest: getdestinfo(context); context._cmp(context.al, 0); - if (context.flags.z()) goto searchdestup; + if (context.flags.z()) + goto searchdestup; context.data.byte(kNewtextline) = 1; deltextline(context); delpointer(context); @@ -9606,25 +10466,30 @@ nodu: void lastdest(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 219); - if (context.flags.z()) goto alreadydd; + if (context.flags.z()) + goto alreadydd; context.data.byte(kCommandtype) = 219; context.al = 29; commandonly(context); alreadydd: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto nodd; + if (context.flags.z()) + goto nodd; context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nodd; + if (context.flags.z()) + goto nodd; searchdestdown: context._dec(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), -1); - if (!context.flags.z()) goto notfirstdest; + if (!context.flags.z()) + goto notfirstdest; context.data.byte(kDestpos) = 15; notfirstdest: getdestinfo(context); context._cmp(context.al, 0); - if (context.flags.z()) goto searchdestdown; + if (context.flags.z()) + goto searchdestdown; context.data.byte(kNewtextline) = 1; deltextline(context); delpointer(context); @@ -9644,16 +10509,19 @@ nodd: void destselect(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadytrav; + if (context.flags.z()) + goto alreadytrav; context.data.byte(kCommandtype) = 222; context.al = 30; commandonly(context); alreadytrav: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto notrav; + if (context.flags.z()) + goto notrav; context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notrav; + if (context.flags.z()) + goto notrav; getdestinfo(context); context.al = context.data.byte(kDestpos); context.data.byte(kNewlocation) = context.al; @@ -9685,7 +10553,8 @@ void resetlocation(Context &context) { STACK_CHECK(context); context.push(context.ax); context._cmp(context.al, 5); - if (!context.flags.z()) goto notdelhotel; + if (!context.flags.z()) + goto notdelhotel; purgealocation(context); context.al = 21; purgealocation(context); @@ -9696,14 +10565,16 @@ void resetlocation(Context &context) { goto clearedlocations; notdelhotel: context._cmp(context.al, 8); - if (!context.flags.z()) goto notdeltvstud; + if (!context.flags.z()) + goto notdeltvstud; purgealocation(context); context.al = 28; purgealocation(context); goto clearedlocations; notdeltvstud: context._cmp(context.al, 6); - if (!context.flags.z()) goto notdelsarters; + if (!context.flags.z()) + goto notdelsarters; purgealocation(context); context.al = 20; purgealocation(context); @@ -9712,7 +10583,8 @@ notdeltvstud: goto clearedlocations; notdelsarters: context._cmp(context.al, 13); - if (!context.flags.z()) goto notdelboathouse; + if (!context.flags.z()) + goto notdelboathouse; purgealocation(context); context.al = 29; purgealocation(context); @@ -9751,12 +10623,14 @@ void usemon(Context &context) { context.di = 2970+1; context.cx = 12; context.al = 32; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.es = context.cs; context.di = 2942+1; context.cx = 12; context.al = 32; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.es = context.cs; context.di = 2836; context.es.byte(context.di) = 1; @@ -9765,7 +10639,8 @@ void usemon(Context &context) { keyloop: context.es.byte(context.di) = 0; context._add(context.di, 26); - if (--context.cx) goto keyloop; + if (--context.cx) + goto keyloop; createpanel(context); showpanel(context); showicon(context); @@ -9815,7 +10690,8 @@ moreinput: context.data.word(kMonady) = context.bx; execcommand(context); context._cmp(context.al, 0); - if (context.flags.z()) goto moreinput; + if (context.flags.z()) + goto moreinput; getridoftemp(context); getridoftempcharset(context); context.es = context.data.word(kTextfile1); @@ -9866,12 +10742,15 @@ void loadpersonal(Context &context) { context.al = context.data.byte(kLocation); context.dx = 2052; context._cmp(context.al, 0); - if (context.flags.z()) goto foundpersonal; + if (context.flags.z()) + goto foundpersonal; context._cmp(context.al, 42); - if (context.flags.z()) goto foundpersonal; + if (context.flags.z()) + goto foundpersonal; context.dx = 2065; context._cmp(context.al, 2); - if (context.flags.z()) goto foundpersonal; + if (context.flags.z()) + goto foundpersonal; foundpersonal: openfile(context); readheader(context); @@ -9893,13 +10772,16 @@ void loadnews(Context &context) { context.al = context.data.byte(kNewsitem); context.dx = 2078; context._cmp(context.al, 0); - if (context.flags.z()) goto foundnews; + if (context.flags.z()) + goto foundnews; context.dx = 2091; context._cmp(context.al, 1); - if (context.flags.z()) goto foundnews; + if (context.flags.z()) + goto foundnews; context.dx = 2104; context._cmp(context.al, 2); - if (context.flags.z()) goto foundnews; + if (context.flags.z()) + goto foundnews; context.dx = 2117; foundnews: openfile(context); @@ -9922,16 +10804,20 @@ void loadcart(Context &context) { lookininterface(context); context.dx = 2130; context._cmp(context.al, 0); - if (context.flags.z()) goto gotcart; + if (context.flags.z()) + goto gotcart; context.dx = 2143; context._cmp(context.al, 1); - if (context.flags.z()) goto gotcart; + if (context.flags.z()) + goto gotcart; context.dx = 2156; context._cmp(context.al, 2); - if (context.flags.z()) goto gotcart; + if (context.flags.z()) + goto gotcart; context.dx = 2169; context._cmp(context.al, 3); - if (context.flags.z()) goto gotcart; + if (context.flags.z()) + goto gotcart; context.dx = 2182; gotcart: openfile(context); @@ -9959,7 +10845,8 @@ void lookininterface(Context &context) { context.ah = 1; checkinside(context); context._cmp(context.cl, (114)); - if (context.flags.z()) goto emptyinterface; + if (context.flags.z()) + goto emptyinterface; context.al = context.es.byte(context.bx+15); context._inc(context.al); return; @@ -9979,7 +10866,8 @@ powerloop: context.cx = 30; hangon(context); context.cx = context.pop(); - if (--context.cx) goto powerloop; + if (--context.cx) + goto powerloop; powerlighton(context); } @@ -9992,14 +10880,16 @@ accessloop: randomnum1(context); context._and(context.al, 15); context._cmp(context.al, 10); - if (context.flags.c()) goto off; + if (context.flags.c()) + goto off; accesslighton(context); goto chosenaccess; off: accesslightoff(context); chosenaccess: context.cx = context.pop(); - if (--context.cx) goto accessloop; + if (--context.cx) + goto accessloop; accesslightoff(context); } @@ -10111,7 +11001,8 @@ void input(Context &context) { context.di = 8045; context.cx = 64; context.al = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.data.word(kCurpos) = 0; context.al = '>'; context.di = context.data.word(kMonadx); @@ -10136,22 +11027,29 @@ waitkey: readkey(context); context.al = context.data.byte(kCurrentkey); context._cmp(context.al, 0); - if (context.flags.z()) goto waitkey; + if (context.flags.z()) + goto waitkey; context._cmp(context.al, 13); - if (context.flags.z()) goto endofinput; + if (context.flags.z()) + goto endofinput; context._cmp(context.al, 8); - if (!context.flags.z()) goto notdel; + if (!context.flags.z()) + goto notdel; context._cmp(context.data.word(kCurpos), 0); - if (context.flags.z()) goto waitkey; + if (context.flags.z()) + goto waitkey; delchar(context); goto waitkey; notdel: context._cmp(context.data.word(kCurpos), 28); - if (context.flags.z()) goto waitkey; + if (context.flags.z()) + goto waitkey; context._cmp(context.data.byte(kCurrentkey), 32); - if (!context.flags.z()) goto notleadingspace; + if (!context.flags.z()) + goto notleadingspace; context._cmp(context.data.word(kCurpos), 0); - if (context.flags.z()) goto waitkey; + if (context.flags.z()) + goto waitkey; notleadingspace: makecaps(context); context.es = context.cs; @@ -10160,7 +11058,8 @@ notleadingspace: context._add(context.si, 8045); context.es.byte(context.si) = context.al; context._cmp(context.al, 'Z'+1); - if (!context.flags.c()) goto waitkey; + if (!context.flags.c()) + goto waitkey; context.push(context.ax); context.push(context.es); context.push(context.si); @@ -10198,7 +11097,8 @@ endofinput: void makecaps(Context &context) { STACK_CHECK(context); context._cmp(context.al, 'a'); - if (context.flags.c()) goto notupperc; + if (context.flags.c()) + goto notupperc; context._sub(context.al, 32); notupperc: return; @@ -10240,7 +11140,8 @@ void execcommand(Context &context) { context.si = 8045; context.al = context.ds.byte(context.si); context._cmp(context.al, 0); - if (!context.flags.z()) goto notblankinp; + if (!context.flags.z()) + goto notblankinp; scrollmonitor(context); return; notblankinp: @@ -10254,15 +11155,18 @@ comloop2: context.ah = context.es.byte(context.bx); context._inc(context.bx); context._cmp(context.ah, 32); - if (context.flags.z()) goto foundcom; + if (context.flags.z()) + goto foundcom; context._cmp(context.al, context.ah); - if (context.flags.z()) goto comloop2; + if (context.flags.z()) + goto comloop2; context.si = context.pop(); context.bx = context.pop(); context._add(context.bx, 10); context._inc(context.cl); context._cmp(context.cl, 6); - if (!context.flags.z()) goto comloop; + if (!context.flags.z()) + goto comloop; neterror(context); context.al = 0; return; @@ -10270,15 +11174,20 @@ foundcom: context.si = context.pop(); context.bx = context.pop(); context._cmp(context.cl, 1); - if (context.flags.z()) goto testcom; + if (context.flags.z()) + goto testcom; context._cmp(context.cl, 2); - if (context.flags.z()) goto directory; + if (context.flags.z()) + goto directory; context._cmp(context.cl, 3); - if (context.flags.z()) goto accesscom; + if (context.flags.z()) + goto accesscom; context._cmp(context.cl, 4); - if (context.flags.z()) goto signoncom; + if (context.flags.z()) + goto signoncom; context._cmp(context.cl, 5); - if (context.flags.z()) goto keyscom; + if (context.flags.z()) + goto keyscom; goto quitcom; directory: dircom(context); @@ -10318,7 +11227,8 @@ void dircom(Context &context) { randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); - if (context.flags.z()) goto dirroot; + if (context.flags.z()) + goto dirroot; dirfile(context); return; dirroot: @@ -10330,8 +11240,9 @@ dirroot: context.di = 2970; context._inc(context.di); context.cx = 12; - while(context.cx--) context._movsb(); - monitorlogo(context); + while(context.cx--) + context._movsb(); + monitorlogo(context); scrollmonitor(context); context.al = 9; monmessage(context); @@ -10351,9 +11262,11 @@ directloop1: context.al = context.es.byte(context.bx); context._inc(context.bx); context._cmp(context.al, '*'); - if (context.flags.z()) goto endofdir; + if (context.flags.z()) + goto endofdir; context._cmp(context.al, 34); - if (!context.flags.z()) goto directloop1; + if (!context.flags.z()) + goto directloop1; monprint(context); goto directloop1; endofdir: @@ -10376,19 +11289,23 @@ signonloop: signonloop2: context._lodsb(); context._cmp(context.al, 32); - if (context.flags.z()) goto foundsign; + if (context.flags.z()) + goto foundsign; makecaps(context); context.ah = context.es.byte(context.di); context._inc(context.di); context._cmp(context.al, context.ah); - if (!context.flags.z()) goto nomatch; - if (--context.cx) goto signonloop2; + if (!context.flags.z()) + goto nomatch; + if (--context.cx) + goto signonloop2; nomatch: context.di = context.pop(); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 26); - if (--context.cx) goto signonloop; + if (--context.cx) + goto signonloop; context.al = 13; monmessage(context); return; @@ -10399,7 +11316,8 @@ foundsign: context.bx = context.si; context.es = context.ds; context._cmp(context.es.byte(context.bx), 0); - if (context.flags.z()) goto notyetassigned; + if (context.flags.z()) + goto notyetassigned; context.al = 17; monmessage(context); return; @@ -10430,9 +11348,11 @@ checkpass: context.ah = context.es.byte(context.bx); context._inc(context.bx); context._cmp(context.ah, 32); - if (context.flags.z()) goto passpassed; + if (context.flags.z()) + goto passpassed; context._cmp(context.al, context.ah); - if (context.flags.z()) goto checkpass; + if (context.flags.z()) + goto checkpass; context.bx = context.pop(); context.es = context.pop(); scrollmonitor(context); @@ -10468,14 +11388,16 @@ keysloop: context.push(context.cx); context.push(context.bx); context._cmp(context.es.byte(context.bx), 0); - if (context.flags.z()) goto notheld; + if (context.flags.z()) + goto notheld; context._add(context.bx, 14); monprint(context); notheld: context.bx = context.pop(); context.cx = context.pop(); context._add(context.bx, 26); - if (--context.cx) goto keysloop; + if (--context.cx) + goto keysloop; scrollmonitor(context); } @@ -10485,7 +11407,8 @@ void read(Context &context) { randomaccess(context); parser(context); context._cmp(context.es.byte(context.di+1), 0); - if (!context.flags.z()) goto okcom; + if (!context.flags.z()) + goto okcom; neterror(context); return; okcom: @@ -10497,28 +11420,32 @@ okcom: context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; + if (context.flags.z()) + goto foundfile2; context.ax = context.data.word(kTextfile2); context.data.word(kMonsource) = context.ax; context.ds = context.ax; context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; + if (context.flags.z()) + goto foundfile2; context.ax = context.data.word(kTextfile3); context.data.word(kMonsource) = context.ax; context.ds = context.ax; context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile2; + if (context.flags.z()) + goto foundfile2; context.al = 7; monmessage(context); return; foundfile2: getkeyandlogo(context); context._cmp(context.al, 0); - if (context.flags.z()) goto keyok1; + if (context.flags.z()) + goto keyok1; return; keyok1: context.es = context.cs; @@ -10526,7 +11453,8 @@ keyok1: context.ds = context.data.word(kMonsource); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto findtopictext; + if (context.flags.z()) + goto findtopictext; context.al = context.data.byte(kOldlogonum); context.data.byte(kLogonum) = context.al; context.al = 11; @@ -10544,11 +11472,14 @@ moretopic: monprint(context); context.al = context.es.byte(context.bx); context._cmp(context.al, 34); - if (context.flags.z()) goto endoftopic; + if (context.flags.z()) + goto endoftopic; context._cmp(context.al, '='); - if (context.flags.z()) goto endoftopic; + if (context.flags.z()) + goto endoftopic; context._cmp(context.al, '*'); - if (context.flags.z()) goto endoftopic; + if (context.flags.z()) + goto endoftopic; context.push(context.es); context.push(context.bx); processtrigger(context); @@ -10571,7 +11502,8 @@ void dirfile(Context &context) { context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; + if (context.flags.z()) + goto foundfile; context.di = context.pop(); context.es = context.pop(); context.push(context.es); @@ -10580,7 +11512,8 @@ void dirfile(Context &context) { context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; + if (context.flags.z()) + goto foundfile; context.di = context.pop(); context.es = context.pop(); context.push(context.es); @@ -10589,7 +11522,8 @@ void dirfile(Context &context) { context.si = (66*2); searchforstring(context); context._cmp(context.al, 0); - if (context.flags.z()) goto foundfile; + if (context.flags.z()) + goto foundfile; context.di = context.pop(); context.es = context.pop(); context.al = 7; @@ -10600,7 +11534,8 @@ foundfile: context.ax = context.pop(); getkeyandlogo(context); context._cmp(context.al, 0); - if (context.flags.z()) goto keyok2; + if (context.flags.z()) + goto keyok2; return; keyok2: context.push(context.es); @@ -10610,8 +11545,9 @@ keyok2: context.es = context.cs; context.di = 2970+1; context.cx = 12; - while(context.cx--) context._movsb(); - monitorlogo(context); + while(context.cx--) + context._movsb(); + monitorlogo(context); scrollmonitor(context); context.al = 10; monmessage(context); @@ -10621,11 +11557,14 @@ directloop2: context.al = context.es.byte(context.bx); context._inc(context.bx); context._cmp(context.al, 34); - if (context.flags.z()) goto endofdir2; + if (context.flags.z()) + goto endofdir2; context._cmp(context.al, '*'); - if (context.flags.z()) goto endofdir2; + if (context.flags.z()) + goto endofdir2; context._cmp(context.al, '='); - if (!context.flags.z()) goto directloop2; + if (!context.flags.z()) + goto directloop2; monprint(context); goto directloop2; endofdir2: @@ -10654,7 +11593,8 @@ void getkeyandlogo(Context &context) { context._add(context.bx, context.ax); context.al = context.es.byte(context.bx); context._cmp(context.al, 1); - if (context.flags.z()) goto keyok; + if (context.flags.z()) + goto keyok; context.push(context.bx); context.push(context.es); context.al = 12; @@ -10688,21 +11628,27 @@ keeplooking: context._lodsb(); makecaps(context); context._cmp(context.al, '*'); - if (context.flags.z()) goto notfound; + if (context.flags.z()) + goto notfound; context._cmp(context.dl, '='); - if (!context.flags.z()) goto nofindingtopic; + if (!context.flags.z()) + goto nofindingtopic; context._cmp(context.al, 34); - if (context.flags.z()) goto notfound; + if (context.flags.z()) + goto notfound; nofindingtopic: context.ah = context.es.byte(context.di); context._cmp(context.al, context.dl); - if (!context.flags.z()) goto notbracket; + if (!context.flags.z()) + goto notbracket; context._inc(context.dh); context._cmp(context.dh, 2); - if (context.flags.z()) goto complete; + if (context.flags.z()) + goto complete; notbracket: context._cmp(context.al, context.ah); - if (!context.flags.z()) goto restartlook; + if (!context.flags.z()) + goto restartlook; context._inc(context.di); goto keeplooking; complete: @@ -10720,7 +11666,8 @@ void parser(Context &context) { context.di = 2942; context.cx = 13; context.al = 0; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.di = 2942; context.al = '='; context._stosb(); @@ -10729,21 +11676,26 @@ void parser(Context &context) { notspace1: context._lodsw(); context._cmp(context.al, 32); - if (context.flags.z()) goto stillspace1; + if (context.flags.z()) + goto stillspace1; context._cmp(context.al, 0); - if (!context.flags.z()) goto notspace1; + if (!context.flags.z()) + goto notspace1; goto finishpars; stillspace1: context._lodsw(); context._cmp(context.al, 32); - if (context.flags.z()) goto stillspace1; + if (context.flags.z()) + goto stillspace1; copyin1: context._stosb(); context._lodsw(); context._cmp(context.al, 0); - if (context.flags.z()) goto finishpars; + if (context.flags.z()) + goto finishpars; context._cmp(context.al, 32); - if (!context.flags.z()) goto copyin1; + if (!context.flags.z()) + goto copyin1; finishpars: context.di = 2942; } @@ -10779,11 +11731,13 @@ void scrollmonitor(Context &context) { void lockmon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLasthardkey), 57); - if (!context.flags.z()) goto notlock; + if (!context.flags.z()) + goto notlock; locklighton(context); lockloop: context._cmp(context.data.byte(kLasthardkey), 57); - if (context.flags.z()) goto lockloop; + if (context.flags.z()) + goto lockloop; locklightoff(context); notlock: return; @@ -10793,7 +11747,8 @@ void monitorlogo(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kLogonum); context._cmp(context.al, context.data.byte(kOldlogonum)); - if (context.flags.z()) goto notnewlogo; + if (context.flags.z()) + goto notnewlogo; context.data.byte(kOldlogonum) = context.al; printlogo(context); printundermon(context); @@ -10828,7 +11783,8 @@ void showcurrentfile(Context &context) { curfileloop: context.al = context.cs.byte(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto finishfile; + if (context.flags.z()) + goto finishfile; context._inc(context.si); context.push(context.si); context.ds = context.data.word(kTempcharset); @@ -10850,15 +11806,18 @@ monmessageloop: context.al = context.es.byte(context.bx); context._inc(context.bx); context._cmp(context.al, '+'); - if (!context.flags.z()) goto monmessageloop; - if (--context.cx) goto monmessageloop; + if (!context.flags.z()) + goto monmessageloop; + if (--context.cx) + goto monmessageloop; monprint(context); } void processtrigger(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLasttrigger), '1'); - if (!context.flags.z()) goto notfirsttrigger; + if (!context.flags.z()) + goto notfirsttrigger; context.al = 8; setlocation(context); context.al = 45; @@ -10866,7 +11825,8 @@ void processtrigger(Context &context) { return; notfirsttrigger: context._cmp(context.data.byte(kLasttrigger), '2'); - if (!context.flags.z()) goto notsecondtrigger; + if (!context.flags.z()) + goto notsecondtrigger; context.al = 9; setlocation(context); context.al = 55; @@ -10874,7 +11834,8 @@ notfirsttrigger: return; notsecondtrigger: context._cmp(context.data.byte(kLasttrigger), '3'); - if (!context.flags.z()) goto notthirdtrigger; + if (!context.flags.z()) + goto notthirdtrigger; context.al = 2; setlocation(context); context.al = 59; @@ -10940,7 +11901,8 @@ void printcurs(Context &context) { context._inc(context.data.word(kMaintimer)); context.ax = context.data.word(kMaintimer); context._and(context.al, 16); - if (!context.flags.z()) goto flashcurs; + if (!context.flags.z()) + goto flashcurs; context.al = '/'; context._sub(context.al, 32); context.ah = 0; @@ -10995,7 +11957,8 @@ void useobject(Context &context) { STACK_CHECK(context); context.data.byte(kWithobject) = 255; context._cmp(context.data.byte(kCommandtype), 229); - if (context.flags.z()) goto alreadyuse; + if (context.flags.z()) + goto alreadyuse; context.data.byte(kCommandtype) = 229; context.bl = context.data.byte(kCommand); context.bh = context.data.byte(kObjecttype); @@ -11004,9 +11967,11 @@ void useobject(Context &context) { alreadyuse: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nouse; + if (context.flags.z()) + goto nouse; context._and(context.ax, 1); - if (!context.flags.z()) goto douse; + if (!context.flags.z()) + goto douse; nouse: return; douse: @@ -11016,9 +11981,11 @@ douse: void useroutine(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); - if (context.flags.c()) goto nodream7; + if (context.flags.c()) + goto nodream7; context._cmp(context.data.byte(kPointerpower), 0); - if (!context.flags.z()) goto powerok; + if (!context.flags.z()) + goto powerok; return; powerok: context.data.byte(kPointerpower) = 0; @@ -11032,19 +11999,23 @@ checkuselist: context._lodsb(); context._sub(context.al, 'A'); context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) goto failed; + if (!context.flags.z()) + goto failed; context._lodsb(); context._sub(context.al, 'A'); context._cmp(context.al, context.es.byte(context.bx+13)); - if (!context.flags.z()) goto failed; + if (!context.flags.z()) + goto failed; context._lodsb(); context._sub(context.al, 'A'); context._cmp(context.al, context.es.byte(context.bx+14)); - if (!context.flags.z()) goto failed; + if (!context.flags.z()) + goto failed; context._lodsb(); context._sub(context.al, 'A'); context._cmp(context.al, context.es.byte(context.bx+15)); - if (!context.flags.z()) goto failed; + if (!context.flags.z()) + goto failed; context._lodsw(); context.si = context.pop(); __dispatch_call(context, context.ax); @@ -11053,18 +12024,22 @@ failed: context.si = context.pop(); context._add(context.si, 6); context._cmp(context.ds.byte(context.si), 140); - if (!context.flags.z()) goto checkuselist; + if (!context.flags.z()) + goto checkuselist; delpointer(context); getobtextstart(context); findnextcolon(context); context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; + if (context.flags.z()) + goto cantuse2; findnextcolon(context); context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; + if (context.flags.z()) + goto cantuse2; context.al = context.es.byte(context.si); context._cmp(context.al, 0); - if (context.flags.z()) goto cantuse2; + if (context.flags.z()) + goto cantuse2; usetext(context); context.cx = 400; hangonp(context); @@ -11099,7 +12074,8 @@ void wheelsound(Context &context) { void runtap(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto tapwith; + if (!context.flags.z()) + goto tapwith; withwhat(context); return; tapwith: @@ -11110,7 +12086,8 @@ tapwith: context.dl = 'P'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto fillcupfromtap; + if (context.flags.z()) + goto fillcupfromtap; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'C'; @@ -11118,7 +12095,8 @@ tapwith: context.dl = 'P'; context.dh = 'F'; compare(context); - if (context.flags.z()) goto cupfromtapfull; + if (context.flags.z()) + goto cupfromtapfull; context.cx = 300; context.al = 56; showpuztext(context); @@ -11153,9 +12131,11 @@ void playguitar(Context &context) { void hotelcontrol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 21); - if (!context.flags.z()) goto notrightcont; + if (!context.flags.z()) + goto notrightcont; context._cmp(context.data.byte(kMapx), 33); - if (!context.flags.z()) goto notrightcont; + if (!context.flags.z()) + goto notrightcont; showfirstuse(context); putbackobstuff(context); return; @@ -11188,7 +12168,8 @@ void usetrainer(Context &context) { STACK_CHECK(context); getanyad(context); context._cmp(context.es.byte(context.bx+2), 4); - if (!context.flags.z()) goto notheldtrainer; + if (!context.flags.z()) + goto notheldtrainer; context._inc(context.data.byte(kProgresspoints)); makeworn(context); showseconduse(context); @@ -11220,7 +12201,8 @@ void nothelderror(Context &context) { void usepipe(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto pipewith; + if (!context.flags.z()) + goto pipewith; withwhat(context); return; pipewith: @@ -11231,7 +12213,8 @@ pipewith: context.dl = 'P'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto fillcup; + if (context.flags.z()) + goto fillcup; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'C'; @@ -11239,7 +12222,8 @@ pipewith: context.dl = 'P'; context.dh = 'F'; compare(context); - if (context.flags.z()) goto alreadyfull; + if (context.flags.z()) + goto alreadyfull; context.cx = 300; context.al = 14; showpuztext(context); @@ -11286,7 +12270,8 @@ void usefullcart(Context &context) { void useplinth(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto plinthwith; + if (!context.flags.z()) + goto plinthwith; withwhat(context); return; plinthwith: @@ -11297,7 +12282,8 @@ plinthwith: context.dl = 'E'; context.dh = 'Y'; compare(context); - if (context.flags.z()) goto isrightkey; + if (context.flags.z()) + goto isrightkey; showfirstuse(context); putbackobstuff(context); return; @@ -11360,7 +12346,8 @@ void slabdoora(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kReeltowatch) = 13; context._cmp(context.data.byte(kDreamnumber), 3); - if (!context.flags.z()) goto slabawrong; + if (!context.flags.z()) + goto slabawrong; context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 42; @@ -11376,13 +12363,15 @@ slabawrong: void slabdoorb(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kDreamnumber), 1); - if (!context.flags.z()) goto slabbwrong; + if (!context.flags.z()) + goto slabbwrong; context.al = 'S'; context.ah = 'H'; context.cl = 'L'; context.ch = 'D'; isryanholding(context); - if (!context.flags.z()) goto gotcrystal; + if (!context.flags.z()) + goto gotcrystal; context.al = 44; context.cx = 200; showpuztext(context); @@ -11419,7 +12408,8 @@ void slabdoord(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kReeltowatch) = 75; context._cmp(context.data.byte(kDreamnumber), 0); - if (!context.flags.z()) goto slabcwrong; + if (!context.flags.z()) + goto slabcwrong; context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 102; @@ -11440,7 +12430,8 @@ void slabdoorc(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kReeltowatch) = 108; context._cmp(context.data.byte(kDreamnumber), 4); - if (!context.flags.z()) goto slabdwrong; + if (!context.flags.z()) + goto slabdwrong; context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 135; @@ -11461,7 +12452,8 @@ void slabdoore(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kReeltowatch) = 141; context._cmp(context.data.byte(kDreamnumber), 5); - if (!context.flags.z()) goto slabewrong; + if (!context.flags.z()) + goto slabewrong; context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 168; @@ -11482,7 +12474,8 @@ void slabdoorf(Context &context) { context.data.byte(kSpeedcount) = 1; context.data.word(kReeltowatch) = 171; context._cmp(context.data.byte(kDreamnumber), 2); - if (!context.flags.z()) goto slabfwrong; + if (!context.flags.z()) + goto slabfwrong; context._inc(context.data.byte(kProgresspoints)); context.data.word(kWatchingtime) = 60; context.data.word(kEndwatchreel) = 197; @@ -11498,7 +12491,8 @@ slabfwrong: void useslab(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto slabwith; + if (!context.flags.z()) + goto slabwith; withwhat(context); return; slabwith: @@ -11509,7 +12503,8 @@ slabwith: context.dl = 'W'; context.dh = 'L'; compare(context); - if (context.flags.z()) goto nextslab; + if (context.flags.z()) + goto nextslab; context.cx = 300; context.al = 14; showpuztext(context); @@ -11528,7 +12523,8 @@ nextslab: placesetobject(context); context.ax = context.pop(); context._cmp(context.al, 54); - if (!context.flags.z()) goto notlastslab; + if (!context.flags.z()) + goto notlastslab; context.al = 0; turnpathon(context); context.data.word(kWatchingtime) = 22; @@ -11545,7 +12541,8 @@ notlastslab: void usecart(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto cartwith; + if (!context.flags.z()) + goto cartwith; withwhat(context); return; cartwith: @@ -11556,7 +12553,8 @@ cartwith: context.dl = 'C'; context.dh = 'K'; compare(context); - if (context.flags.z()) goto nextcart; + if (context.flags.z()) + goto nextcart; context.cx = 300; context.al = 14; showpuztext(context); @@ -11582,7 +12580,8 @@ nextcart: void useclearbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto clearboxwith; + if (!context.flags.z()) + goto clearboxwith; withwhat(context); return; clearboxwith: @@ -11593,7 +12592,8 @@ clearboxwith: context.dl = 'I'; context.dh = 'L'; compare(context); - if (context.flags.z()) goto openbox; + if (context.flags.z()) + goto openbox; context.cx = 300; context.al = 14; showpuztext(context); @@ -11637,7 +12637,8 @@ void userailing(Context &context) { void useopenbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto openboxwith; + if (!context.flags.z()) + goto openboxwith; withwhat(context); return; openboxwith: @@ -11648,7 +12649,8 @@ openboxwith: context.dl = 'P'; context.dh = 'F'; compare(context); - if (context.flags.z()) goto destoryopenbox; + if (context.flags.z()) + goto destoryopenbox; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'C'; @@ -11656,7 +12658,8 @@ openboxwith: context.dl = 'P'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto openboxwrong; + if (context.flags.z()) + goto openboxwrong; showfirstuse(context); return; destoryopenbox: @@ -11686,7 +12689,8 @@ openboxwrong: void wearwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) goto wearingwatch; + if (context.flags.z()) + goto wearingwatch; showfirstuse(context); context.data.byte(kWatchon) = 1; context.data.byte(kGetback) = 1; @@ -11701,7 +12705,8 @@ wearingwatch: void wearshades(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 1); - if (context.flags.z()) goto wearingshades; + if (context.flags.z()) + goto wearingshades; context.data.byte(kShadeson) = 1; showfirstuse(context); context.data.byte(kGetback) = 1; @@ -11716,7 +12721,8 @@ wearingshades: void sitdowninbar(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchmode), -1); - if (!context.flags.z()) goto satdown; + if (!context.flags.z()) + goto satdown; showfirstuse(context); context.data.word(kWatchingtime) = 50; context.data.word(kReeltowatch) = 55; @@ -11746,7 +12752,8 @@ void usechurchhole(Context &context) { void usehole(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto holewith; + if (!context.flags.z()) + goto holewith; withwhat(context); return; holewith: @@ -11757,7 +12764,8 @@ holewith: context.dl = 'D'; context.dh = 'A'; compare(context); - if (context.flags.z()) goto righthand; + if (context.flags.z()) + goto righthand; context.cx = 300; context.al = 14; showpuztext(context); @@ -11782,16 +12790,19 @@ void usealtar(Context &context) { context.ch = 'A'; findexobject(context); context._cmp(context.al, (114)); - if (context.flags.z()) goto thingsonaltar; + if (context.flags.z()) + goto thingsonaltar; context.al = 'C'; context.ah = 'N'; context.cl = 'D'; context.ch = 'B'; findexobject(context); context._cmp(context.al, (114)); - if (context.flags.z()) goto thingsonaltar; + if (context.flags.z()) + goto thingsonaltar; context._cmp(context.data.byte(kCanmovealtar), 1); - if (context.flags.z()) goto movealtar; + if (context.flags.z()) + goto movealtar; context.cx = 300; context.al = 23; showpuztext(context); @@ -11821,7 +12832,8 @@ thingsonaltar: void opentvdoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto tvdoorwith; + if (!context.flags.z()) + goto tvdoorwith; withwhat(context); return; tvdoorwith: @@ -11832,7 +12844,8 @@ tvdoorwith: context.dl = 'O'; context.dh = 'K'; compare(context); - if (context.flags.z()) goto keyontv; + if (context.flags.z()) + goto keyontv; context.cx = 300; context.al = 14; showpuztext(context); @@ -11868,7 +12881,8 @@ lookcolon: context.al = context.es.byte(context.si); context._inc(context.si); context._cmp(context.al, ':'); - if (!context.flags.z()) goto lookcolon; + if (!context.flags.z()) + goto lookcolon; } void openyourneighbour(Context &context) { @@ -11884,7 +12898,8 @@ void openyourneighbour(Context &context) { void usewindow(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kManspath), 6); - if (!context.flags.z()) goto notonbalc; + if (!context.flags.z()) + goto notonbalc; context._inc(context.data.byte(kProgresspoints)); showfirstuse(context); context.data.byte(kNewlocation) = 29; @@ -11973,11 +12988,14 @@ void isitright(Context &context) { context.es = context.bx; context.bx = 8573; context._cmp(context.es.byte(context.bx+0), context.al); - if (!context.flags.z()) goto notright; + if (!context.flags.z()) + goto notright; context._cmp(context.es.byte(context.bx+1), context.ah); - if (!context.flags.z()) goto notright; + if (!context.flags.z()) + goto notright; context._cmp(context.es.byte(context.bx+2), context.cl); - if (!context.flags.z()) goto notright; + if (!context.flags.z()) + goto notright; context._cmp(context.es.byte(context.bx+3), context.ch); notright: return; @@ -11994,7 +13012,8 @@ void drawitall(Context &context) { void openhoteldoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto hoteldoorwith; + if (!context.flags.z()) + goto hoteldoorwith; withwhat(context); return; hoteldoorwith: @@ -12005,7 +13024,8 @@ hoteldoorwith: context.dl = 'Y'; context.dh = 'A'; compare(context); - if (context.flags.z()) goto keyonhotel1; + if (context.flags.z()) + goto keyonhotel1; context.cx = 300; context.al = 14; showpuztext(context); @@ -12022,7 +13042,8 @@ keyonhotel1: void openhoteldoor2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto hoteldoorwith2; + if (!context.flags.z()) + goto hoteldoorwith2; withwhat(context); return; hoteldoorwith2: @@ -12033,7 +13054,8 @@ hoteldoorwith2: context.dl = 'Y'; context.dh = 'A'; compare(context); - if (context.flags.z()) goto keyonhotel2; + if (context.flags.z()) + goto keyonhotel2; context.cx = 300; context.al = 14; showpuztext(context); @@ -12049,7 +13071,8 @@ keyonhotel2: void grafittidoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto grafwith; + if (!context.flags.z()) + goto grafwith; withwhat(context); return; grafwith: @@ -12060,7 +13083,8 @@ grafwith: context.dl = 'E'; context.dh = 'N'; compare(context); - if (context.flags.z()) goto dograf; + if (context.flags.z()) + goto dograf; context.cx = 300; context.al = 14; showpuztext(context); @@ -12111,7 +13135,8 @@ void calledenslift(Context &context) { void calledensdlift(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLiftflag), 1); - if (context.flags.z()) goto edensdhere; + if (context.flags.z()) + goto edensdhere; showfirstuse(context); context.data.byte(kCounttoopen) = 8; context.data.byte(kGetback) = 1; @@ -12126,7 +13151,8 @@ edensdhere: void usepoolreader(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto poolwith; + if (!context.flags.z()) + goto poolwith; withwhat(context); return; poolwith: @@ -12137,7 +13163,8 @@ poolwith: context.dl = 'M'; context.dh = 'B'; compare(context); - if (context.flags.z()) goto openpool; + if (context.flags.z()) + goto openpool; context.cx = 300; context.al = 14; showpuztext(context); @@ -12145,7 +13172,8 @@ poolwith: return; openpool: context._cmp(context.data.byte(kTalkedtoattendant), 1); - if (context.flags.z()) goto canopenpool; + if (context.flags.z()) + goto canopenpool; showseconduse(context); putbackobstuff(context); return; @@ -12160,7 +13188,8 @@ canopenpool: void uselighter(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotlighterwith; + if (!context.flags.z()) + goto gotlighterwith; withwhat(context); return; gotlighterwith: @@ -12171,7 +13200,8 @@ gotlighterwith: context.dl = 'K'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto cigarette; + if (context.flags.z()) + goto cigarette; showfirstuse(context); putbackobstuff(context); return; @@ -12199,7 +13229,8 @@ void showseconduse(Context &context) { void usecardreader1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotreader1with; + if (!context.flags.z()) + goto gotreader1with; withwhat(context); return; gotreader1with: @@ -12210,7 +13241,8 @@ gotreader1with: context.dl = 'H'; context.dh = 'R'; compare(context); - if (context.flags.z()) goto correctcard; + if (context.flags.z()) + goto correctcard; context.cx = 300; context.al = 14; showpuztext(context); @@ -12218,9 +13250,11 @@ gotreader1with: return; correctcard: context._cmp(context.data.byte(kTalkedtosparky), 0); - if (context.flags.z()) goto notyet; + if (context.flags.z()) + goto notyet; context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) goto getscash; + if (context.flags.z()) + goto getscash; context.cx = 300; context.al = 17; showpuztext(context); @@ -12244,7 +13278,8 @@ notyet: void usecardreader2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotreader2with; + if (!context.flags.z()) + goto gotreader2with; withwhat(context); return; gotreader2with: @@ -12255,7 +13290,8 @@ gotreader2with: context.dl = 'H'; context.dh = 'R'; compare(context); - if (context.flags.z()) goto correctcard2; + if (context.flags.z()) + goto correctcard2; context.cx = 300; context.al = 14; showpuztext(context); @@ -12263,11 +13299,14 @@ gotreader2with: return; correctcard2: context._cmp(context.data.byte(kTalkedtoboss), 0); - if (context.flags.z()) goto notyetboss; + if (context.flags.z()) + goto notyetboss; context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) goto nocash; + if (context.flags.z()) + goto nocash; context._cmp(context.data.byte(kGunpassflag), 2); - if (context.flags.z()) goto alreadygotnew; + if (context.flags.z()) + goto alreadygotnew; context.al = 18; playchannel1(context); context.cx = 300; @@ -12300,7 +13339,8 @@ notyetboss: void usecardreader3(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotreader3with; + if (!context.flags.z()) + goto gotreader3with; withwhat(context); return; gotreader3with: @@ -12311,7 +13351,8 @@ gotreader3with: context.dl = 'H'; context.dh = 'R'; compare(context); - if (context.flags.z()) goto rightcard; + if (context.flags.z()) + goto rightcard; context.cx = 300; context.al = 14; showpuztext(context); @@ -12319,9 +13360,11 @@ gotreader3with: return; rightcard: context._cmp(context.data.byte(kTalkedtorecep), 0); - if (context.flags.z()) goto notyetrecep; + if (context.flags.z()) + goto notyetrecep; context._cmp(context.data.byte(kCardpassflag), 0); - if (!context.flags.z()) goto alreadyusedit; + if (!context.flags.z()) + goto alreadyusedit; context.al = 16; playchannel1(context); context.cx = 300; @@ -12453,7 +13496,8 @@ void moneypoke(Context &context) { numberpoke0: context._inc(context.cl); context._sub(context.ax, 10000); - if (!context.flags.c()) goto numberpoke0; + if (!context.flags.c()) + goto numberpoke0; context._add(context.ax, 10000); context.cs.byte(context.bx) = context.cl; context._inc(context.bx); @@ -12461,7 +13505,8 @@ numberpoke0: numberpoke1: context._inc(context.cl); context._sub(context.ax, 1000); - if (!context.flags.c()) goto numberpoke1; + if (!context.flags.c()) + goto numberpoke1; context._add(context.ax, 1000); context.cs.byte(context.bx) = context.cl; context._inc(context.bx); @@ -12469,7 +13514,8 @@ numberpoke1: numberpoke2: context._inc(context.cl); context._sub(context.ax, 100); - if (!context.flags.c()) goto numberpoke2; + if (!context.flags.c()) + goto numberpoke2; context._add(context.ax, 100); context.cs.byte(context.bx) = context.cl; context._inc(context.bx); @@ -12477,7 +13523,8 @@ numberpoke2: numberpoke3: context._inc(context.cl); context._sub(context.ax, 10); - if (!context.flags.c()) goto numberpoke3; + if (!context.flags.c()) + goto numberpoke3; context._add(context.ax, 10); context.cs.byte(context.bx) = context.cl; context.bx = 3479; @@ -12488,7 +13535,8 @@ numberpoke3: void usecontrol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotcontrolwith; + if (!context.flags.z()) + goto gotcontrolwith; withwhat(context); return; gotcontrolwith: @@ -12499,9 +13547,11 @@ gotcontrolwith: context.dl = 'Y'; context.dh = 'A'; compare(context); - if (context.flags.z()) goto rightkey; + if (context.flags.z()) + goto rightkey; context._cmp(context.data.byte(kReallocation), 21); - if (!context.flags.z()) goto balls; + if (!context.flags.z()) + goto balls; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'K'; @@ -12509,7 +13559,8 @@ gotcontrolwith: context.dl = 'F'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto jimmycontrols; + if (context.flags.z()) + goto jimmycontrols; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'A'; @@ -12517,7 +13568,8 @@ gotcontrolwith: context.dl = 'E'; context.dh = 'D'; compare(context); - if (context.flags.z()) goto axeoncontrols; + if (context.flags.z()) + goto axeoncontrols; balls: showfirstuse(context); putbackobstuff(context); @@ -12526,7 +13578,8 @@ rightkey: context.al = 16; playchannel1(context); context._cmp(context.data.byte(kLocation), 21); - if (context.flags.z()) goto goingdown; + if (context.flags.z()) + goto goingdown; context.cx = 300; context.al = 0; showpuztext(context); @@ -12585,7 +13638,8 @@ void usehatch(Context &context) { void usewire(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotwirewith; + if (!context.flags.z()) + goto gotwirewith; withwhat(context); return; gotwirewith: @@ -12596,7 +13650,8 @@ gotwirewith: context.dl = 'F'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto wireknife; + if (context.flags.z()) + goto wireknife; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'A'; @@ -12604,7 +13659,8 @@ gotwirewith: context.dl = 'E'; context.dh = 'D'; compare(context); - if (context.flags.z()) goto wireaxe; + if (context.flags.z()) + goto wireaxe; context.cx = 300; context.al = 14; showpuztext(context); @@ -12637,7 +13693,8 @@ void usehandle(Context &context) { findsetobject(context); context.al = context.es.byte(context.bx+58); context._cmp(context.al, 255); - if (!context.flags.z()) goto havecutwire; + if (!context.flags.z()) + goto havecutwire; context.cx = 300; context.al = 12; showpuztext(context); @@ -12697,7 +13754,8 @@ void useelevator4(Context &context) { void useelevator2(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 23); - if (context.flags.z()) goto inpoolhall; + if (context.flags.z()) + goto inpoolhall; showfirstuse(context); context.data.byte(kNewlocation) = 23; context.data.byte(kCounttoclose) = 20; @@ -12730,11 +13788,14 @@ void useelevator5(Context &context) { void usekey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 5); - if (context.flags.z()) goto usekey1; + if (context.flags.z()) + goto usekey1; context._cmp(context.data.byte(kLocation), 30); - if (context.flags.z()) goto usekey1; + if (context.flags.z()) + goto usekey1; context._cmp(context.data.byte(kLocation), 21); - if (context.flags.z()) goto usekey2; + if (context.flags.z()) + goto usekey2; context.cx = 200; context.al = 1; showpuztext(context); @@ -12742,9 +13803,11 @@ void usekey(Context &context) { return; usekey1: context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) goto wrongroom1; + if (!context.flags.z()) + goto wrongroom1; context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) goto wrongroom1; + if (!context.flags.z()) + goto wrongroom1; context.cx = 300; context.al = 0; showpuztext(context); @@ -12753,9 +13816,11 @@ usekey1: return; usekey2: context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) goto wrongroom1; + if (!context.flags.z()) + goto wrongroom1; context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) goto wrongroom1; + if (!context.flags.z()) + goto wrongroom1; context.cx = 300; context.al = 3; showpuztext(context); @@ -12775,7 +13840,8 @@ wrongroom1: void usestereo(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 0); - if (context.flags.z()) goto stereook; + if (context.flags.z()) + goto stereook; context.cx = 400; context.al = 4; showpuztext(context); @@ -12783,9 +13849,11 @@ void usestereo(Context &context) { return; stereook: context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) goto stereonotok; + if (!context.flags.z()) + goto stereonotok; context._cmp(context.data.byte(kMapy), 0); - if (context.flags.z()) goto stereook2; + if (context.flags.z()) + goto stereook2; stereonotok: context.cx = 400; context.al = 5; @@ -12801,7 +13869,8 @@ stereook2: context.ah = 1; checkinside(context); context._cmp(context.cl, (114)); - if (!context.flags.z()) goto cdinside; + if (!context.flags.z()) + goto cdinside; context.al = 6; context.cx = 400; showpuztext(context); @@ -12816,7 +13885,8 @@ cdinside: context._xor(context.al, 1); context.es.byte(context.bx+10) = context.al; context._cmp(context.al, 255); - if (context.flags.z()) goto stereoon; + if (context.flags.z()) + goto stereoon; context.al = 7; context.cx = 400; showpuztext(context); @@ -12835,7 +13905,8 @@ void usecooker(Context &context) { context.ah = context.data.byte(kObjecttype); checkinside(context); context._cmp(context.cl, (114)); - if (!context.flags.z()) goto foodinside; + if (!context.flags.z()) + goto foodinside; showfirstuse(context); putbackobstuff(context); return; @@ -12847,9 +13918,11 @@ foodinside: void useaxe(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 22); - if (!context.flags.z()) goto notinpool; + if (!context.flags.z()) + goto notinpool; context._cmp(context.data.byte(kMapy), 10); - if (context.flags.z()) goto axeondoor; + if (context.flags.z()) + goto axeondoor; showseconduse(context); context._inc(context.data.byte(kProgresspoints)); context.data.byte(kLastweapon) = 2; @@ -12876,7 +13949,8 @@ axeondoor: void useelvdoor(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gotdoorwith; + if (!context.flags.z()) + goto gotdoorwith; withwhat(context); return; gotdoorwith: @@ -12887,7 +13961,8 @@ gotdoorwith: context.dl = 'E'; context.dh = 'D'; compare(context); - if (context.flags.z()) goto axeondoor; + if (context.flags.z()) + goto axeondoor; context.al = 14; context.cx = 300; showpuztext(context); @@ -12953,16 +14028,19 @@ void selectob(Context &context) { findinvpos(context); context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (!context.flags.z()) goto canselectob; + if (!context.flags.z()) + goto canselectob; blank(context); return; canselectob: context.data.byte(kWithobject) = context.al; context.data.byte(kWithtype) = context.ah; context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) goto diffsub3; + if (!context.flags.z()) + goto diffsub3; context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) goto alreadyselob; + if (context.flags.z()) + goto alreadyselob; context.data.byte(kCommandtype) = 221; diffsub3: context.data.word(kOldsubject) = context.ax; @@ -12972,9 +14050,11 @@ diffsub3: alreadyselob: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notselob; + if (context.flags.z()) + goto notselob; context._and(context.ax, 1); - if (!context.flags.z()) goto doselob; + if (!context.flags.z()) + goto doselob; notselob: return; doselob: @@ -12995,7 +14075,8 @@ void compare(Context &context) { context.dx = context.pop(); context.cx = context.pop(); context._cmp(context.es.word(context.bx+12), context.cx); - if (!context.flags.z()) goto comparefin; + if (!context.flags.z()) + goto comparefin; context._cmp(context.es.word(context.bx+14), context.dx); comparefin: return; @@ -13012,20 +14093,25 @@ void findsetobject(Context &context) { context.dl = 0; findsetloop: context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) goto nofind; + if (!context.flags.z()) + goto nofind; context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) goto nofind; + if (!context.flags.z()) + goto nofind; context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) goto nofind; + if (!context.flags.z()) + goto nofind; context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) goto nofind; + if (!context.flags.z()) + goto nofind; context.al = context.dl; return; nofind: context._add(context.bx, 64); context._inc(context.dl); context._cmp(context.dl, 128); - if (!context.flags.z()) goto findsetloop; + if (!context.flags.z()) + goto findsetloop; context.al = context.dl; } @@ -13040,20 +14126,25 @@ void findexobject(Context &context) { context.dl = 0; findexloop: context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) goto nofindex; + if (!context.flags.z()) + goto nofindex; context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) goto nofindex; + if (!context.flags.z()) + goto nofindex; context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) goto nofindex; + if (!context.flags.z()) + goto nofindex; context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) goto nofindex; + if (!context.flags.z()) + goto nofindex; context.al = context.dl; return; nofindex: context._add(context.bx, 16); context._inc(context.dl); context._cmp(context.dl, (114)); - if (!context.flags.z()) goto findexloop; + if (!context.flags.z()) + goto findexloop; context.al = context.dl; } @@ -13068,15 +14159,20 @@ void isryanholding(Context &context) { context.dl = 0; searchinv: context._cmp(context.es.byte(context.bx+2), 4); - if (!context.flags.z()) goto nofindininv; + if (!context.flags.z()) + goto nofindininv; context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) goto nofindininv; + if (!context.flags.z()) + goto nofindininv; context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) goto nofindininv; + if (!context.flags.z()) + goto nofindininv; context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) goto nofindininv; + if (!context.flags.z()) + goto nofindininv; context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) goto nofindininv; + if (!context.flags.z()) + goto nofindininv; context.al = context.dl; context._cmp(context.al, (114)); return; @@ -13084,7 +14180,8 @@ nofindininv: context._add(context.bx, 16); context._inc(context.dl); context._cmp(context.dl, (114)); - if (!context.flags.z()) goto searchinv; + if (!context.flags.z()) + goto searchinv; context.al = context.dl; context._cmp(context.al, (114)); } @@ -13096,15 +14193,18 @@ void checkinside(Context &context) { context.cl = 0; insideloop: context._cmp(context.al, context.es.byte(context.bx+3)); - if (!context.flags.z()) goto notfoundinside; + if (!context.flags.z()) + goto notfoundinside; context._cmp(context.ah, context.es.byte(context.bx+2)); - if (!context.flags.z()) goto notfoundinside; + if (!context.flags.z()) + goto notfoundinside; return; notfoundinside: context._add(context.bx, 16); context._inc(context.cl); context._cmp(context.cl, (114)); - if (!context.flags.z()) goto insideloop; + if (!context.flags.z()) + goto insideloop; } void usetext(Context &context) { @@ -13246,11 +14346,14 @@ void findormake(Context &context) { context.ah = context.data.byte(kReallocation); changeloop: context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) goto haventfound; + if (context.flags.z()) + goto haventfound; context._cmp(context.ax, context.es.word(context.bx)); - if (!context.flags.z()) goto nofoundchange; + if (!context.flags.z()) + goto nofoundchange; context._cmp(context.ch, context.es.byte(context.bx+3)); - if (context.flags.z()) goto foundchange; + if (context.flags.z()) + goto foundchange; nofoundchange: context._add(context.bx, 4); goto changeloop; @@ -13281,11 +14384,13 @@ void setallchanges(Context &context) { setallloop: context.ax = context.es.word(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto endsetloop; + if (context.flags.z()) + goto endsetloop; context.cx = context.es.word(context.bx+2); context._add(context.bx, 4); context._cmp(context.ah, context.data.byte(kReallocation)); - if (!context.flags.z()) goto setallloop; + if (!context.flags.z()) + goto setallloop; context.push(context.es); context.push(context.bx); dochange(context); @@ -13299,9 +14404,11 @@ endsetloop: void dochange(Context &context) { STACK_CHECK(context); context._cmp(context.ch, 0); - if (context.flags.z()) goto object; + if (context.flags.z()) + goto object; context._cmp(context.ch, 1); - if (context.flags.z()) goto freeobject; + if (context.flags.z()) + goto freeobject; context.push(context.cx); context.ah = 0; context._add(context.ax, context.ax); @@ -13331,7 +14438,8 @@ freeobject: getfreead(context); context.cx = context.pop(); context._cmp(context.es.byte(context.bx+2), 255); - if (!context.flags.z()) goto beenpickedup; + if (!context.flags.z()) + goto beenpickedup; context.es.byte(context.bx+2) = context.cl; beenpickedup: return; @@ -13340,7 +14448,8 @@ beenpickedup: void autoappear(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 32); - if (!context.flags.z()) goto notinalley; + if (!context.flags.z()) + goto notinalley; context.al = 5; resetlocation(context); context.al = 10; @@ -13349,9 +14458,11 @@ void autoappear(Context &context) { return; notinalley: context._cmp(context.data.byte(kReallocation), 24); - if (!context.flags.z()) goto notinedens; + if (!context.flags.z()) + goto notinedens; context._cmp(context.data.byte(kGeneraldead), 1); - if (!context.flags.z()) goto edenspart2; + if (!context.flags.z()) + goto edenspart2; context._inc(context.data.byte(kGeneraldead)); context.al = 44; placesetobject(context); @@ -13372,7 +14483,8 @@ notinalley: return; edenspart2: context._cmp(context.data.byte(kSartaindead), 1); - if (!context.flags.z()) goto notedens2; + if (!context.flags.z()) + goto notedens2; context.al = 44; removesetobject(context); context.al = 93; @@ -13384,7 +14496,8 @@ notedens2: return; notinedens: context._cmp(context.data.byte(kReallocation), 25); - if (!context.flags.z()) goto notonsartroof; + if (!context.flags.z()) + goto notonsartroof; context.data.byte(kNewsitem) = 3; context.al = 6; resetlocation(context); @@ -13394,9 +14507,11 @@ notinedens: return; notonsartroof: context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) goto notinlouiss; + if (!context.flags.z()) + goto notinlouiss; context._cmp(context.data.byte(kRockstardead), 0); - if (context.flags.z()) goto notinlouiss; + if (context.flags.z()) + goto notinlouiss; context.al = 23; placesetobject(context); notinlouiss: @@ -13436,7 +14551,8 @@ void putundertimed(Context &context) { void dumptimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedtodumptimed), 1); - if (!context.flags.z()) goto nodumptimed; + if (!context.flags.z()) + goto nodumptimed; context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -13454,7 +14570,8 @@ nodumptimed: void setuptimeduse(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); - if (!context.flags.z()) goto cantsetup; + if (!context.flags.z()) + goto cantsetup; context.data.byte(kTimedy) = context.bh; context.data.byte(kTimedx) = context.bl; context.data.word(kCounttotimed) = context.cx; @@ -13477,20 +14594,23 @@ cantsetup: void setuptimedtemp(Context &context) { STACK_CHECK(context); context._cmp(context.ah, 0); - if (context.flags.z()) goto notloadspeech3; + if (context.flags.z()) + goto notloadspeech3; context.dl = 'T'; context.dh = context.ah; context.cl = 'T'; context.ah = 0; loadspeech(context); context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) goto notloadspeech3; + if (!context.flags.z()) + goto notloadspeech3; context.al = 50+12; playchannel1(context); return; notloadspeech3: context._cmp(context.data.word(kTimecount), 0); - if (!context.flags.z()) goto cantsetup2; + if (!context.flags.z()) + goto cantsetup2; context.data.byte(kTimedy) = context.bh; context.data.byte(kTimedx) = context.bl; context.data.word(kCounttotimed) = context.cx; @@ -13513,14 +14633,18 @@ cantsetup2: void usetimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); - if (context.flags.z()) goto notext; + if (context.flags.z()) + goto notext; context._dec(context.data.word(kTimecount)); context._cmp(context.data.word(kTimecount), 0); - if (context.flags.z()) goto deltimedtext; + if (context.flags.z()) + goto deltimedtext; context.ax = context.data.word(kTimecount); context._cmp(context.ax, context.data.word(kCounttotimed)); - if (context.flags.z()) goto firsttimed; - if (!context.flags.c()) goto notext; + if (context.flags.z()) + goto firsttimed; + if (!context.flags.c()) + goto notext; goto notfirsttimed; firsttimed: getundertimed(context); @@ -13558,7 +14682,8 @@ void usewall(Context &context) { STACK_CHECK(context); showfirstuse(context); context._cmp(context.data.byte(kManspath), 3); - if (context.flags.z()) goto gobackover; + if (context.flags.z()) + goto gobackover; context.data.word(kWatchingtime) = 30*2; context.data.word(kReeltowatch) = 2; context.data.word(kEndwatchreel) = 31; @@ -13612,7 +14737,8 @@ gobackover: void usechurchgate(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto gatewith; + if (!context.flags.z()) + goto gatewith; withwhat(context); return; gatewith: @@ -13623,7 +14749,8 @@ gatewith: context.dl = 'T'; context.dh = 'T'; compare(context); - if (context.flags.z()) goto cutgate; + if (context.flags.z()) + goto cutgate; context.cx = 300; context.al = 14; showpuztext(context); @@ -13641,7 +14768,8 @@ cutgate: context.al = 3; turnpathon(context); context._cmp(context.data.byte(kAidedead), 0); - if (context.flags.z()) goto notopenchurch; + if (context.flags.z()) + goto notopenchurch; context.al = 2; turnpathon(context); notopenchurch: @@ -13651,13 +14779,15 @@ notopenchurch: void usegun(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) goto istakengun; + if (context.flags.z()) + goto istakengun; showseconduse(context); putbackobstuff(context); return; istakengun: context._cmp(context.data.byte(kReallocation), 22); - if (!context.flags.z()) goto notinpoolroom; + if (!context.flags.z()) + goto notinpoolroom; context.cx = 300; context.al = 34; showpuztext(context); @@ -13668,7 +14798,8 @@ istakengun: return; notinpoolroom: context._cmp(context.data.byte(kReallocation), 25); - if (!context.flags.z()) goto nothelicopter; + if (!context.flags.z()) + goto nothelicopter; context.cx = 300; context.al = 34; showpuztext(context); @@ -13682,7 +14813,8 @@ notinpoolroom: return; nothelicopter: context._cmp(context.data.byte(kReallocation), 27); - if (!context.flags.z()) goto notinrockroom; + if (!context.flags.z()) + goto notinrockroom; context.cx = 300; context.al = 46; showpuztext(context); @@ -13697,16 +14829,21 @@ nothelicopter: return; notinrockroom: context._cmp(context.data.byte(kReallocation), 8); - if (!context.flags.z()) goto notbystudio; + if (!context.flags.z()) + goto notbystudio; context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) goto notbystudio; + if (!context.flags.z()) + goto notbystudio; context._cmp(context.data.byte(kMapy), 40); - if (!context.flags.z()) goto notbystudio; + if (!context.flags.z()) + goto notbystudio; context.al = 92; issetobonmap(context); - if (context.flags.z()) goto notbystudio; + if (context.flags.z()) + goto notbystudio; context._cmp(context.data.byte(kManspath), 9); - if (context.flags.z()) goto notbystudio; + if (context.flags.z()) + goto notbystudio; context.data.byte(kDestination) = 9; context.data.byte(kFinaldest) = 9; autosetwalk(context); @@ -13716,14 +14853,18 @@ notinrockroom: return; notbystudio: context._cmp(context.data.byte(kReallocation), 6); - if (!context.flags.z()) goto notsarters; + if (!context.flags.z()) + goto notsarters; context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) goto notsarters; + if (!context.flags.z()) + goto notsarters; context._cmp(context.data.byte(kMapy), 20); - if (!context.flags.z()) goto notsarters; + if (!context.flags.z()) + goto notsarters; context.al = 5; issetobonmap(context); - if (!context.flags.z()) goto notsarters; + if (!context.flags.z()) + goto notsarters; context.data.byte(kDestination) = 1; context.data.byte(kFinaldest) = 1; autosetwalk(context); @@ -13746,7 +14887,8 @@ notbystudio: return; notsarters: context._cmp(context.data.byte(kReallocation), 29); - if (!context.flags.z()) goto notaide; + if (!context.flags.z()) + goto notaide; context.data.byte(kGetback) = 1; context.al = 13; resetlocation(context); @@ -13768,13 +14910,17 @@ notsarters: return; notaide: context._cmp(context.data.byte(kReallocation), 23); - if (!context.flags.z()) goto notwithboss; + if (!context.flags.z()) + goto notwithboss; context._cmp(context.data.byte(kMapx), 0); - if (!context.flags.z()) goto notwithboss; + if (!context.flags.z()) + goto notwithboss; context._cmp(context.data.byte(kMapy), 50); - if (!context.flags.z()) goto notwithboss; + if (!context.flags.z()) + goto notwithboss; context._cmp(context.data.byte(kManspath), 5); - if (context.flags.z()) goto pathokboss; + if (context.flags.z()) + goto pathokboss; context.data.byte(kDestination) = 5; context.data.byte(kFinaldest) = 5; autosetwalk(context); @@ -13784,13 +14930,17 @@ pathokboss: return; notwithboss: context._cmp(context.data.byte(kReallocation), 8); - if (!context.flags.z()) goto nottvsoldier; + if (!context.flags.z()) + goto nottvsoldier; context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) goto nottvsoldier; + if (!context.flags.z()) + goto nottvsoldier; context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) goto nottvsoldier; + if (!context.flags.z()) + goto nottvsoldier; context._cmp(context.data.byte(kManspath), 2); - if (context.flags.z()) goto pathoktv; + if (context.flags.z()) + goto pathoktv; context.data.byte(kDestination) = 2; context.data.byte(kFinaldest) = 2; autosetwalk(context); @@ -13806,9 +14956,11 @@ nottvsoldier: void useshield(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 20); - if (!context.flags.z()) goto notinsartroom; + if (!context.flags.z()) + goto notinsartroom; context._cmp(context.data.byte(kCombatcount), 0); - if (context.flags.z()) goto notinsartroom; + if (context.flags.z()) + goto notinsartroom; context.data.byte(kLastweapon) = 3; showseconduse(context); context.data.byte(kGetback) = 1; @@ -13824,7 +14976,8 @@ void usebuttona(Context &context) { STACK_CHECK(context); context.al = 95; issetobonmap(context); - if (context.flags.z()) goto donethisbit; + if (context.flags.z()) + goto donethisbit; showfirstuse(context); context.al = 0; context.ah = context.data.byte(kRoomnum); @@ -13850,7 +15003,8 @@ donethisbit: void useplate(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) goto platewith; + if (!context.flags.z()) + goto platewith; withwhat(context); return; platewith: @@ -13861,7 +15015,8 @@ platewith: context.dl = 'R'; context.dh = 'W'; compare(context); - if (context.flags.z()) goto unscrewplate; + if (context.flags.z()) + goto unscrewplate; context.al = context.data.byte(kWithobject); context.ah = context.data.byte(kWithtype); context.cl = 'K'; @@ -13869,7 +15024,8 @@ platewith: context.dl = 'F'; context.dh = 'E'; compare(context); - if (context.flags.z()) goto triedknife; + if (context.flags.z()) + goto triedknife; context.cx = 300; context.al = 14; showpuztext(context); @@ -13903,7 +15059,8 @@ void usewinch(Context &context) { context.ah = 1; checkinside(context); context._cmp(context.cl, (114)); - if (context.flags.z()) goto nowinch; + if (context.flags.z()) + goto nowinch; context.al = context.cl; context.ah = 4; context.cl = 'F'; @@ -13911,7 +15068,8 @@ void usewinch(Context &context) { context.dl = 'S'; context.dh = 'E'; compare(context); - if (!context.flags.z()) goto nowinch; + if (!context.flags.z()) + goto nowinch; context.data.word(kWatchingtime) = 217*2; context.data.word(kReeltowatch) = 0; context.data.word(kEndwatchreel) = 217; @@ -13953,7 +15111,8 @@ keypadloop: showkeypad(context); showpointer(context); context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) goto nopresses; + if (context.flags.z()) + goto nopresses; context._dec(context.data.byte(kPresscount)); goto afterpress; nopresses: @@ -13967,22 +15126,28 @@ afterpress: context.bx = 3482; checkcoords(context); context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) goto numberright; + if (context.flags.z()) + goto numberright; context._cmp(context.data.byte(kLightcount), 1); - if (!context.flags.z()) goto notendkey; + if (!context.flags.z()) + goto notendkey; context._cmp(context.data.byte(kLockstatus), 0); - if (context.flags.z()) goto numberright; + if (context.flags.z()) + goto numberright; goto keypadloop; notendkey: context._cmp(context.data.byte(kPresscount), 40); - if (!context.flags.z()) goto keypadloop; + if (!context.flags.z()) + goto keypadloop; addtopresslist(context); context._cmp(context.data.byte(kPressed), 11); - if (!context.flags.z()) goto keypadloop; + if (!context.flags.z()) + goto keypadloop; context.ax = context.data.word(kKeypadax); context.cx = context.data.word(kKeypadcx); isitright(context); - if (!context.flags.z()) goto incorrect; + if (!context.flags.z()) + goto incorrect; context.data.byte(kLockstatus) = 0; context.al = 11; playchannel1(context); @@ -14012,16 +15177,19 @@ void loadkeypad(Context &context) { void quitkey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadyqk; + if (context.flags.z()) + goto alreadyqk; context.data.byte(kCommandtype) = 222; context.al = 4; commandonly(context); alreadyqk: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notqk; + if (context.flags.z()) + goto notqk; context._and(context.ax, 1); - if (!context.flags.z()) goto doqk; + if (!context.flags.z()) + goto doqk; notqk: return; doqk: @@ -14031,10 +15199,12 @@ doqk: void addtopresslist(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kPresspointer), 5); - if (context.flags.z()) goto nomorekeys; + if (context.flags.z()) + goto nomorekeys; context.al = context.data.byte(kPressed); context._cmp(context.al, 10); - if (!context.flags.z()) goto not10; + if (!context.flags.z()) + goto not10; context.al = 0; not10: context.bx = context.data.word(kPresspointer); @@ -14118,7 +15288,8 @@ void buttonpress(Context &context) { context.ch = context.cl; context._add(context.ch, 100); context._cmp(context.data.byte(kCommandtype), context.ch); - if (context.flags.z()) goto alreadyb; + if (context.flags.z()) + goto alreadyb; context.data.byte(kCommandtype) = context.ch; context.al = context.cl; context._add(context.al, 4); @@ -14128,9 +15299,11 @@ void buttonpress(Context &context) { alreadyb: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notb; + if (context.flags.z()) + goto notb; context._and(context.ax, 1); - if (!context.flags.z()) goto dob; + if (!context.flags.z()) + goto dob; notb: return; dob: @@ -14139,7 +15312,8 @@ dob: context.data.byte(kGraphicpress) = context.cl; context.data.byte(kPresscount) = 40; context._cmp(context.cl, 32); - if (context.flags.z()) goto nonoise; + if (context.flags.z()) + goto nonoise; context.al = 10; playchannel1(context); nonoise: @@ -14209,19 +15383,23 @@ void showkeypad(Context &context) { context.bx = (72)+59; singlekey(context); context._cmp(context.data.byte(kLightcount), 0); - if (context.flags.z()) goto notenter; + if (context.flags.z()) + goto notenter; context._dec(context.data.byte(kLightcount)); context.al = 36; context.bx = (72)-1+63; context._cmp(context.data.byte(kLockstatus), 0); - if (!context.flags.z()) goto changelight; + if (!context.flags.z()) + goto changelight; context.al = 41; context.bx = (72)+4+63; changelight: context._cmp(context.data.byte(kLightcount), 60); - if (context.flags.c()) goto gotlight; + if (context.flags.c()) + goto gotlight; context._cmp(context.data.byte(kLightcount), 100); - if (!context.flags.c()) goto gotlight; + if (!context.flags.c()) + goto gotlight; context._dec(context.al); gotlight: context.ds = context.data.word(kTempgraphics); @@ -14235,10 +15413,12 @@ notenter: void singlekey(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGraphicpress), context.al); - if (!context.flags.z()) goto gotkey; + if (!context.flags.z()) + goto gotkey; context._add(context.al, 11); context._cmp(context.data.byte(kPresscount), 8); - if (!context.flags.c()) goto gotkey; + if (!context.flags.c()) + goto gotkey; context._sub(context.al, 11); gotkey: context.ds = context.data.word(kTempgraphics); @@ -14294,7 +15474,8 @@ menuloop: context.bx = 3614; checkcoords(context); context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) goto menuloop; + if (!context.flags.z()) + goto menuloop; context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); getridoftemp(context); @@ -14368,7 +15549,8 @@ void showmenu(Context &context) { STACK_CHECK(context); context._inc(context.data.byte(kMenucount)); context._cmp(context.data.byte(kMenucount), 37*2); - if (!context.flags.z()) goto menuframeok; + if (!context.flags.z()) + goto menuframeok; context.data.byte(kMenucount) = 0; menuframeok: context.al = context.data.byte(kMenucount); @@ -14407,7 +15589,8 @@ folderloop: context.bx = 3636; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto folderloop; + if (context.flags.z()) + goto folderloop; context.data.byte(kManisoffscreen) = 0; getridoftemp(context); getridoftemp2(context); @@ -14421,21 +15604,25 @@ folderloop: void nextfolder(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 12); - if (!context.flags.z()) goto cannextf; + if (!context.flags.z()) + goto cannextf; blank(context); return; cannextf: context._cmp(context.data.byte(kCommandtype), 201); - if (context.flags.z()) goto alreadynextf; + if (context.flags.z()) + goto alreadynextf; context.data.byte(kCommandtype) = 201; context.al = 16; commandonly(context); alreadynextf: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notnextf; + if (context.flags.z()) + goto notnextf; context._cmp(context.ax, 1); - if (context.flags.z()) goto donextf; + if (context.flags.z()) + goto donextf; notnextf: return; donextf: @@ -14452,13 +15639,16 @@ donextf: void folderhints(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 5); - if (!context.flags.z()) goto notaideadd; + if (!context.flags.z()) + goto notaideadd; context._cmp(context.data.byte(kAidedead), 1); - if (context.flags.z()) goto notaideadd; + if (context.flags.z()) + goto notaideadd; context.al = 13; getlocation(context); context._cmp(context.al, 1); - if (context.flags.z()) goto notaideadd; + if (context.flags.z()) + goto notaideadd; context.al = 13; setlocation(context); showfolder(context); @@ -14475,11 +15665,13 @@ void folderhints(Context &context) { return; notaideadd: context._cmp(context.data.byte(kFolderpage), 9); - if (!context.flags.z()) goto notaristoadd; + if (!context.flags.z()) + goto notaristoadd; context.al = 7; getlocation(context); context._cmp(context.al, 1); - if (context.flags.z()) goto notaristoadd; + if (context.flags.z()) + goto notaristoadd; context.al = 7; setlocation(context); showfolder(context); @@ -14500,23 +15692,28 @@ notaristoadd: void lastfolder(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFolderpage), 0); - if (!context.flags.z()) goto canlastf; + if (!context.flags.z()) + goto canlastf; blank(context); return; canlastf: context._cmp(context.data.byte(kCommandtype), 202); - if (context.flags.z()) goto alreadylastf; + if (context.flags.z()) + goto alreadylastf; context.data.byte(kCommandtype) = 202; context.al = 17; commandonly(context); alreadylastf: context._cmp(context.data.byte(kFolderpage), 0); - if (context.flags.z()) goto notlastf; + if (context.flags.z()) + goto notlastf; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notlastf; + if (context.flags.z()) + goto notlastf; context._cmp(context.ax, 1); - if (context.flags.z()) goto dolastf; + if (context.flags.z()) + goto dolastf; notlastf: return; dolastf: @@ -14547,7 +15744,8 @@ void showfolder(Context &context) { STACK_CHECK(context); context.data.byte(kCommandtype) = 255; context._cmp(context.data.byte(kFolderpage), 0); - if (context.flags.z()) goto closedfolder; + if (context.flags.z()) + goto closedfolder; usetempcharset(context); createpanel2(context); context.ds = context.data.word(kTempgraphics); @@ -14576,11 +15774,13 @@ void showfolder(Context &context) { showframe(context); folderexit(context); context._cmp(context.data.byte(kFolderpage), 1); - if (context.flags.z()) goto noleftpage; + if (context.flags.z()) + goto noleftpage; showleftpage(context); noleftpage: context._cmp(context.data.byte(kFolderpage), 12); - if (context.flags.z()) goto norightpage; + if (context.flags.z()) + goto norightpage; showrightpage(context); norightpage: usecharset1(context); @@ -14635,7 +15835,8 @@ leftpageloop: context.bx = context.pop(); context.cx = context.pop(); context._add(context.bx, 16); - if (--context.cx) goto leftpageloop; + if (--context.cx) + goto leftpageloop; context.ds = context.data.word(kTempgraphics2); context.di = 0; context.al = 5; @@ -14663,9 +15864,11 @@ contleftpage: printdirect(context); context._add(context.bx, context.data.word(kLinespacing)); context._cmp(context.al, 0); - if (!context.flags.z()) goto contleftpage; + if (!context.flags.z()) + goto contleftpage; context.cx = context.pop(); - if (--context.cx) goto twolotsleft; + if (--context.cx) + goto twolotsleft; context.data.byte(kKerning) = 0; context.data.word(kCharshift) = 0; context.data.word(kLinespacing) = 10; @@ -14686,13 +15889,15 @@ flipfolderline: context.es.byte(context.si) = context.al; context._dec(context.si); context._inc(context.di); - if (--context.cx) goto flipfolderline; + if (--context.cx) + goto flipfolderline; context.si = context.pop(); context.di = context.pop(); context.cx = context.pop(); context._add(context.si, 320); context._add(context.di, 320); - if (--context.cx) goto flipfolder; + if (--context.cx) + goto flipfolder; } void showrightpage(Context &context) { @@ -14716,7 +15921,8 @@ rightpageloop: context.bx = context.pop(); context.cx = context.pop(); context._add(context.bx, 16); - if (--context.cx) goto rightpageloop; + if (--context.cx) + goto rightpageloop; context.ds = context.data.word(kTempgraphics2); context.di = 143; context.al = 2; @@ -14742,9 +15948,11 @@ contrightpage: printdirect(context); context._add(context.bx, context.data.word(kLinespacing)); context._cmp(context.al, 0); - if (!context.flags.z()) goto contrightpage; + if (!context.flags.z()) + goto contrightpage; context.cx = context.pop(); - if (--context.cx) goto twolotsright; + if (--context.cx) + goto twolotsright; context.data.byte(kKerning) = 0; context.data.word(kLinespacing) = 10; } @@ -14778,11 +15986,14 @@ symbolloop: context.bx = 3678; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto symbolloop; + if (context.flags.z()) + goto symbolloop; context._cmp(context.data.byte(kSymbolbotnum), 3); - if (!context.flags.z()) goto symbolwrong; + if (!context.flags.z()) + goto symbolwrong; context._cmp(context.data.byte(kSymboltopnum), 5); - if (!context.flags.z()) goto symbolwrong; + if (!context.flags.z()) + goto symbolwrong; context.al = 43; removesetobject(context); context.al = 46; @@ -14818,20 +16029,25 @@ symbolwrong: void quitsymbol(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadyqs; + if (context.flags.z()) + goto alreadyqs; context.data.byte(kCommandtype) = 222; context.al = 18; commandonly(context); alreadyqs: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notqs; + if (context.flags.z()) + goto notqs; context._and(context.ax, 1); - if (!context.flags.z()) goto doqs; + if (!context.flags.z()) + goto doqs; notqs: return; doqs: @@ -14841,15 +16057,18 @@ doqs: void settopleft(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 210); - if (context.flags.z()) goto alreadytopl; + if (context.flags.z()) + goto alreadytopl; context.data.byte(kCommandtype) = 210; context.al = 19; commandonly(context); alreadytopl: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto notopleft; + if (context.flags.z()) + goto notopleft; context.data.byte(kSymboltopdir) = -1; notopleft: return; @@ -14858,15 +16077,18 @@ notopleft: void settopright(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 211); - if (context.flags.z()) goto alreadytopr; + if (context.flags.z()) + goto alreadytopr; context.data.byte(kCommandtype) = 211; context.al = 20; commandonly(context); alreadytopr: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto notopright; + if (context.flags.z()) + goto notopright; context.data.byte(kSymboltopdir) = 1; notopright: return; @@ -14875,15 +16097,18 @@ notopright: void setbotleft(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 212); - if (context.flags.z()) goto alreadybotl; + if (context.flags.z()) + goto alreadybotl; context.data.byte(kCommandtype) = 212; context.al = 21; commandonly(context); alreadybotl: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto nobotleft; + if (context.flags.z()) + goto nobotleft; context.data.byte(kSymbolbotdir) = -1; nobotleft: return; @@ -14892,15 +16117,18 @@ nobotleft: void setbotright(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 213); - if (context.flags.z()) goto alreadybotr; + if (context.flags.z()) + goto alreadybotr; context.data.byte(kCommandtype) = 213; context.al = 22; commandonly(context); alreadybotr: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto nobotright; + if (context.flags.z()) + goto nobotright; context.data.byte(kSymbolbotdir) = 1; nobotright: return; @@ -14993,9 +16221,11 @@ void nextsymbol(Context &context) { STACK_CHECK(context); context._inc(context.al); context._cmp(context.al, 6); - if (context.flags.z()) goto topwrap; + if (context.flags.z()) + goto topwrap; context._cmp(context.al, 12); - if (context.flags.z()) goto botwrap; + if (context.flags.z()) + goto botwrap; return; topwrap: context.al = 0; @@ -15007,36 +16237,44 @@ botwrap: void updatesymboltop(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); - if (context.flags.z()) goto topfinished; + if (context.flags.z()) + goto topfinished; context._cmp(context.data.byte(kSymboltopdir), -1); - if (context.flags.z()) goto backwards; + if (context.flags.z()) + goto backwards; context._inc(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), 49); - if (!context.flags.z()) goto notwrapfor; + if (!context.flags.z()) + goto notwrapfor; context.data.byte(kSymboltopx) = 0; context._dec(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), -1); - if (!context.flags.z()) goto topfinished; + if (!context.flags.z()) + goto topfinished; context.data.byte(kSymboltopnum) = 5; return; notwrapfor: context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) goto topfinished; + if (!context.flags.z()) + goto topfinished; context.data.byte(kSymboltopdir) = 0; return; backwards: context._dec(context.data.byte(kSymboltopx)); context._cmp(context.data.byte(kSymboltopx), -1); - if (!context.flags.z()) goto notwrapback; + if (!context.flags.z()) + goto notwrapback; context.data.byte(kSymboltopx) = 48; context._inc(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), 6); - if (!context.flags.z()) goto topfinished; + if (!context.flags.z()) + goto topfinished; context.data.byte(kSymboltopnum) = 0; return; notwrapback: context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) goto topfinished; + if (!context.flags.z()) + goto topfinished; context.data.byte(kSymboltopdir) = 0; topfinished: return; @@ -15045,36 +16283,44 @@ topfinished: void updatesymbolbot(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); - if (context.flags.z()) goto botfinished; + if (context.flags.z()) + goto botfinished; context._cmp(context.data.byte(kSymbolbotdir), -1); - if (context.flags.z()) goto backwardsbot; + if (context.flags.z()) + goto backwardsbot; context._inc(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), 49); - if (!context.flags.z()) goto notwrapforb; + if (!context.flags.z()) + goto notwrapforb; context.data.byte(kSymbolbotx) = 0; context._dec(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), -1); - if (!context.flags.z()) goto botfinished; + if (!context.flags.z()) + goto botfinished; context.data.byte(kSymbolbotnum) = 5; return; notwrapforb: context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) goto botfinished; + if (!context.flags.z()) + goto botfinished; context.data.byte(kSymbolbotdir) = 0; return; backwardsbot: context._dec(context.data.byte(kSymbolbotx)); context._cmp(context.data.byte(kSymbolbotx), -1); - if (!context.flags.z()) goto notwrapbackb; + if (!context.flags.z()) + goto notwrapbackb; context.data.byte(kSymbolbotx) = 48; context._inc(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), 6); - if (!context.flags.z()) goto botfinished; + if (!context.flags.z()) + goto botfinished; context.data.byte(kSymbolbotnum) = 0; return; notwrapbackb: context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) goto botfinished; + if (!context.flags.z()) + goto botfinished; context.data.byte(kSymbolbotdir) = 0; botfinished: return; @@ -15083,7 +16329,8 @@ botfinished: void dumpsymbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kDumpx), -1); - if (context.flags.z()) goto nodumpsym; + if (context.flags.z()) + goto nodumpsym; context.di = context.data.word(kDumpx); context.bx = context.data.word(kDumpy); context.cl = 30; @@ -15125,7 +16372,8 @@ diaryloop: context.bx = 3740; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto diaryloop; + if (context.flags.z()) + goto diaryloop; getridoftemp(context); getridoftemptext(context); getridoftempcharset(context); @@ -15156,15 +16404,19 @@ void showdiary(Context &context) { void showdiarykeys(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) goto nokeyatall; + if (context.flags.z()) + goto nokeyatall; context._dec(context.data.byte(kPresscount)); context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) goto nokeyatall; + if (context.flags.z()) + goto nokeyatall; context._cmp(context.data.byte(kPressed), 'N'); - if (!context.flags.z()) goto nokeyn; + if (!context.flags.z()) + goto nokeyn; context.al = 3; context._cmp(context.data.byte(kPresscount), 1); - if (context.flags.z()) goto gotkeyn; + if (context.flags.z()) + goto gotkeyn; context.al = 4; gotkeyn: context.ah = 0; @@ -15173,14 +16425,16 @@ gotkeyn: context.ds = context.data.word(kTempgraphics); showframe(context); context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) goto notshown; + if (!context.flags.z()) + goto notshown; showdiarypage(context); notshown: return; nokeyn: context.al = 5; context._cmp(context.data.byte(kPresscount), 1); - if (context.flags.z()) goto gotkeyp; + if (context.flags.z()) + goto gotkeyp; context.al = 6; gotkeyp: context.ah = 0; @@ -15189,7 +16443,8 @@ gotkeyp: context.ds = context.data.word(kTempgraphics); showframe(context); context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) goto notshowp; + if (!context.flags.z()) + goto notshowp; showdiarypage(context); notshowp: return; @@ -15200,17 +16455,22 @@ nokeyatall: void dumpdiarykeys(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) goto notdumpdiary; + if (!context.flags.z()) + goto notdumpdiary; context._cmp(context.data.byte(kSartaindead), 1); - if (context.flags.z()) goto notsartadd; + if (context.flags.z()) + goto notsartadd; context._cmp(context.data.byte(kDiarypage), 5); - if (!context.flags.z()) goto notsartadd; + if (!context.flags.z()) + goto notsartadd; context._cmp(context.data.byte(kDiarypage), 5); - if (!context.flags.z()) goto notsartadd; + if (!context.flags.z()) + goto notsartadd; context.al = 6; getlocation(context); context._cmp(context.al, 1); - if (context.flags.z()) goto notsartadd; + if (context.flags.z()) + goto notsartadd; context.al = 6; setlocation(context); delpointer(context); @@ -15253,25 +16513,30 @@ notdumpdiary: void diarykeyp(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 214); - if (context.flags.z()) goto alreadykeyp; + if (context.flags.z()) + goto alreadykeyp; context.data.byte(kCommandtype) = 214; context.al = 23; commandonly(context); alreadykeyp: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto notkeyp; + if (context.flags.z()) + goto notkeyp; context.ax = context.data.word(kOldbutton); context._cmp(context.ax, context.data.word(kMousebutton)); - if (context.flags.z()) goto notkeyp; + if (context.flags.z()) + goto notkeyp; context._cmp(context.data.byte(kPresscount), 0); - if (!context.flags.z()) goto notkeyp; + if (!context.flags.z()) + goto notkeyp; context.al = 16; playchannel1(context); context.data.byte(kPresscount) = 12; context.data.byte(kPressed) = 'P'; context._dec(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), -1); - if (!context.flags.z()) goto notkeyp; + if (!context.flags.z()) + goto notkeyp; context.data.byte(kDiarypage) = 11; notkeyp: return; @@ -15280,25 +16545,30 @@ notkeyp: void diarykeyn(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 213); - if (context.flags.z()) goto alreadykeyn; + if (context.flags.z()) + goto alreadykeyn; context.data.byte(kCommandtype) = 213; context.al = 23; commandonly(context); alreadykeyn: context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto notkeyn; + if (context.flags.z()) + goto notkeyn; context.ax = context.data.word(kOldbutton); context._cmp(context.ax, context.data.word(kMousebutton)); - if (context.flags.z()) goto notkeyn; + if (context.flags.z()) + goto notkeyn; context._cmp(context.data.byte(kPresscount), 0); - if (!context.flags.z()) goto notkeyn; + if (!context.flags.z()) + goto notkeyn; context.al = 16; playchannel1(context); context.data.byte(kPresscount) = 12; context.data.byte(kPressed) = 'N'; context._inc(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), 12); - if (!context.flags.z()) goto notkeyn; + if (!context.flags.z()) + goto notkeyn; context.data.byte(kDiarypage) = 0; notkeyn: return; @@ -15351,20 +16621,25 @@ void findtext1(Context &context) { void zoomonoff(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) { blank(context); return; }; + if (context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadyonoff; + if (context.flags.z()) + goto alreadyonoff; context.data.byte(kCommandtype) = 222; context.al = 39; commandonly(context); alreadyonoff: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nozoomonoff; + if (context.flags.z()) + goto nozoomonoff; context._and(context.ax, 1); - if (!context.flags.z()) goto dozoomonoff; + if (!context.flags.z()) + goto dozoomonoff; nozoomonoff: return; dozoomonoff: @@ -15388,20 +16663,25 @@ dozoomonoff: void saveload(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) { blank(context); return; }; + if (context.flags.z()) + { blank(context); return; }; context._cmp(context.data.byte(kCommandtype), 253); - if (context.flags.z()) goto alreadyops; + if (context.flags.z()) + goto alreadyops; context.data.byte(kCommandtype) = 253; context.al = 43; commandonly(context); alreadyops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noops; + if (context.flags.z()) + goto noops; context._and(context.ax, 1); - if (context.flags.z()) goto noops; + if (context.flags.z()) + goto noops; dosaveload(context); noops: return; @@ -15439,14 +16719,17 @@ waitops: context.bx = 3782; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto waitops; + if (context.flags.z()) + goto waitops; context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) goto restartops; + if (context.flags.z()) + goto restartops; context.data.word(kTextaddressx) = 13; context.data.word(kTextaddressy) = 182; context.data.byte(kTextlen) = 240; context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) goto justret; + if (context.flags.z()) + goto justret; getridoftemp(context); restoreall(context); redrawmainscrn(context); @@ -15459,7 +16742,8 @@ justret: void getbackfromops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); - if (context.flags.z()) goto opsblock1; + if (context.flags.z()) + goto opsblock1; getback1(context); return; opsblock1: @@ -15525,16 +16809,19 @@ void loadsavebox(Context &context) { void loadgame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 246); - if (context.flags.z()) goto alreadyload; + if (context.flags.z()) + goto alreadyload; context.data.byte(kCommandtype) = 246; context.al = 41; commandonly(context); alreadyload: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noload; + if (context.flags.z()) + goto noload; context._cmp(context.ax, 1); - if (context.flags.z()) goto doload; + if (context.flags.z()) + goto doload; noload: return; doload: @@ -15558,9 +16845,11 @@ loadops: context.bx = 3824; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto loadops; + if (context.flags.z()) + goto loadops; context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) goto quitloaded; + if (context.flags.z()) + goto quitloaded; getridoftemp(context); context.dx = context.data; context.es = context.dx; @@ -15585,16 +16874,19 @@ quitloaded: void getbacktoops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 201); - if (context.flags.z()) goto alreadygetops; + if (context.flags.z()) + goto alreadygetops; context.data.byte(kCommandtype) = 201; context.al = 42; commandonly(context); alreadygetops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nogetbackops; + if (context.flags.z()) + goto nogetbackops; context._and(context.ax, 1); - if (!context.flags.z()) goto dogetbackops; + if (!context.flags.z()) + goto dogetbackops; nogetbackops: return; dogetbackops: @@ -15605,16 +16897,19 @@ dogetbackops: void discops(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 249); - if (context.flags.z()) goto alreadydiscops; + if (context.flags.z()) + goto alreadydiscops; context.data.byte(kCommandtype) = 249; context.al = 43; commandonly(context); alreadydiscops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto nodiscops; + if (context.flags.z()) + goto nodiscops; context._and(context.ax, 1); - if (!context.flags.z()) goto dodiscops; + if (!context.flags.z()) + goto dodiscops; nodiscops: return; dodiscops: @@ -15635,25 +16930,29 @@ discopsloop: context.bx = 3866; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto discopsloop; + if (context.flags.z()) + goto discopsloop; } void savegame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kMandead), 2); - if (!context.flags.z()) goto cansaveok; + if (!context.flags.z()) + goto cansaveok; blank(context); return; cansaveok: context._cmp(context.data.byte(kCommandtype), 247); - if (context.flags.z()) goto alreadysave; + if (context.flags.z()) + goto alreadysave; context.data.byte(kCommandtype) = 247; context.al = 44; commandonly(context); alreadysave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (!context.flags.z()) goto dosave; + if (!context.flags.z()) + goto dosave; return; dosave: context.data.byte(kLoadingorsave) = 2; @@ -15678,20 +16977,23 @@ saveops: context.bx = 3908; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto saveops; + if (context.flags.z()) + goto saveops; } void actualsave(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) goto alreadyactsave; + if (context.flags.z()) + goto alreadyactsave; context.data.byte(kCommandtype) = 222; context.al = 44; commandonly(context); alreadyactsave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto noactsave; + if (context.flags.z()) + goto noactsave; context.dx = context.data; context.ds = context.dx; context.si = 8579; @@ -15702,7 +17004,8 @@ alreadyactsave: context._add(context.si, context.ax); context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); - if (context.flags.z()) goto noactsave; + if (context.flags.z()) + goto noactsave; context.al = context.data.byte(kLocation); context.ah = 0; context.cx = 32; @@ -15714,8 +17017,9 @@ alreadyactsave: context.bx = context.di; context.es = context.cs; context.cx = 16; - while(context.cx--) context._movsw(); - context.al = context.data.byte(kRoomssample); + while(context.cx--) + context._movsw(); + context.al = context.data.byte(kRoomssample); context.es.byte(context.bx+13) = context.al; context.al = context.data.byte(kMapx); context.es.byte(context.bx+15) = context.al; @@ -15745,16 +17049,19 @@ noactsave: void actualload(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) goto alreadyactload; + if (context.flags.z()) + goto alreadyactload; context.data.byte(kCommandtype) = 221; context.al = 41; commandonly(context); alreadyactload: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto notactload; + if (context.flags.z()) + goto notactload; context._cmp(context.ax, 1); - if (!context.flags.z()) goto notactload; + if (!context.flags.z()) + goto notactload; context.dx = context.data; context.ds = context.dx; context.si = 8579; @@ -15765,7 +17072,8 @@ alreadyactload: context._add(context.si, context.ax); context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); - if (context.flags.z()) goto notactload; + if (context.flags.z()) + goto notactload; loadposition(context); context.data.byte(kGetback) = 1; notactload: @@ -15775,7 +17083,8 @@ notactload: void selectslot2(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto noselslot2; + if (context.flags.z()) + goto noselslot2; context.data.byte(kLoadingorsave) = 2; noselslot2: selectslot(context); @@ -15784,20 +17093,25 @@ noselslot2: void checkinput(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLoadingorsave), 3); - if (context.flags.z()) goto nokeypress; + if (context.flags.z()) + goto nokeypress; readkey(context); context.al = context.data.byte(kCurrentkey); context._cmp(context.al, 0); - if (context.flags.z()) goto nokeypress; + if (context.flags.z()) + goto nokeypress; context._cmp(context.al, 13); - if (!context.flags.z()) goto notret; + if (!context.flags.z()) + goto notret; context.data.byte(kLoadingorsave) = 3; goto afterkey; notret: context._cmp(context.al, 8); - if (!context.flags.z()) goto nodel2; + if (!context.flags.z()) + goto nodel2; context._cmp(context.data.byte(kCursorpos), 0); - if (context.flags.z()) goto nokeypress; + if (context.flags.z()) + goto nokeypress; getnamepos(context); context._dec(context.data.byte(kCursorpos)); context.es.byte(context.bx) = 0; @@ -15805,7 +17119,8 @@ notret: goto afterkey; nodel2: context._cmp(context.data.byte(kCursorpos), 14); - if (context.flags.z()) goto nokeypress; + if (context.flags.z()) + goto nokeypress; getnamepos(context); context._inc(context.data.byte(kCursorpos)); context.al = context.data.byte(kCurrentkey); @@ -15899,18 +17214,22 @@ void showsaveops(Context &context) { void selectslot(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 244); - if (context.flags.z()) goto alreadysel; + if (context.flags.z()) + goto alreadysel; context.data.byte(kCommandtype) = 244; context.al = 45; commandonly(context); alreadysel: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); - if (!context.flags.z()) goto noselslot; + if (!context.flags.z()) + goto noselslot; context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto noselslot; + if (context.flags.z()) + goto noselslot; context._cmp(context.data.byte(kLoadingorsave), 3); - if (!context.flags.z()) goto notnocurs; + if (!context.flags.z()) + goto notnocurs; context._dec(context.data.byte(kLoadingorsave)); notnocurs: oldtonames(context); @@ -15920,14 +17239,16 @@ notnocurs: getslotnum: context._inc(context.cl); context._sub(context.ax, 11); - if (!context.flags.c()) goto getslotnum; + if (!context.flags.c()) + goto getslotnum; context.data.byte(kCurrentslot) = context.cl; delpointer(context); showopbox(context); showslots(context); shownames(context); context._cmp(context.data.byte(kLoadingorsave), 1); - if (context.flags.z()) goto isloadmode; + if (context.flags.z()) + goto isloadmode; showsaveops(context); readmouse(context); showpointer(context); @@ -15961,7 +17282,8 @@ slotloop: context.push(context.di); context.push(context.bx); context._cmp(context.cl, context.data.byte(kCurrentslot)); - if (!context.flags.z()) goto nomatchslot; + if (!context.flags.z()) + goto nomatchslot; context.al = 3; context.ds = context.data.word(kTempgraphics); context.ah = 0; @@ -15973,7 +17295,8 @@ nomatchslot: context._add(context.bx, 10); context._inc(context.cl); context._cmp(context.cl, 7); - if (!context.flags.z()) goto slotloop; + if (!context.flags.z()) + goto slotloop; } void shownames(Context &context) { @@ -15992,9 +17315,11 @@ shownameloop: context.push(context.si); context.al = 4; context._cmp(context.cl, context.data.byte(kCurrentslot)); - if (!context.flags.z()) goto nomatchslot2; + if (!context.flags.z()) + goto nomatchslot2; context._cmp(context.data.byte(kLoadingorsave), 2); - if (!context.flags.z()) goto loadmode; + if (!context.flags.z()) + goto loadmode; context.dx = context.si; context.cx = 15; context._add(context.si, 15); @@ -16002,7 +17327,8 @@ zerostill: context._dec(context.si); context._dec(context.cl); context._cmp(context.es.byte(context.si), 1); - if (!context.flags.z()) goto foundcharacter; + if (!context.flags.z()) + goto foundcharacter; goto zerostill; foundcharacter: context.data.byte(kCursorpos) = context.cl; @@ -16039,7 +17365,8 @@ afterprintname: context._add(context.bx, 10); context._inc(context.cl); context._cmp(context.cl, 7); - if (!context.flags.z()) goto shownameloop; + if (!context.flags.z()) + goto shownameloop; } void namestoold(Context &context) { @@ -16049,8 +17376,9 @@ void namestoold(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; - while(context.cx--) context._movsb(); - } + while(context.cx--) + context._movsb(); +} void oldtonames(Context &context) { STACK_CHECK(context); @@ -16059,8 +17387,9 @@ void oldtonames(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; - while(context.cx--) context._movsb(); - } + while(context.cx--) + context._movsb(); +} void saveposition(Context &context) { STACK_CHECK(context); @@ -16182,7 +17511,8 @@ void makeheader(Context &context) { void storeit(Context &context) { STACK_CHECK(context); context._cmp(context.ax, 0); - if (!context.flags.z()) goto isntblank; + if (!context.flags.z()) + goto isntblank; context._inc(context.ax); isntblank: context._stosw(); @@ -16194,11 +17524,13 @@ void findlen(Context &context) { context._add(context.bx, context.ax); nextone: context._cmp(context.cl, context.ds.byte(context.bx)); - if (!context.flags.z()) goto foundlen; + if (!context.flags.z()) + goto foundlen; context._dec(context.bx); context._dec(context.ax); context._cmp(context.ax, 0); - if (!context.flags.z()) goto nextone; + if (!context.flags.z()) + goto nextone; foundlen: return; } @@ -16219,7 +17551,8 @@ scanloop: context.push(context.dx); context.push(context.cx); openfilefromc(context); - if (context.flags.c()) goto notexist; + if (context.flags.c()) + goto notexist; context.cx = context.pop(); context._inc(context.ch); context.push(context.cx); @@ -16247,7 +17580,8 @@ notexist: context._add(context.dx, 13); context._add(context.di, 17); context._dec(context.cl); - if (!context.flags.z()) goto scanloop; + if (!context.flags.z()) + goto scanloop; context.al = context.ch; } @@ -16278,9 +17612,11 @@ waitdecide: context.bx = 5057; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto waitdecide; + if (context.flags.z()) + goto waitdecide; context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) goto hasloadedroom; + if (context.flags.z()) + goto hasloadedroom; getridoftemp(context); hasloadedroom: context.data.word(kTextaddressx) = 13; @@ -16304,14 +17640,16 @@ void showdecisions(Context &context) { void newgame(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 251); - if (context.flags.z()) goto alreadynewgame; + if (context.flags.z()) + goto alreadynewgame; context.data.byte(kCommandtype) = 251; context.al = 47; commandonly(context); alreadynewgame: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); - if (!context.flags.z()) goto nonewgame; + if (!context.flags.z()) + goto nonewgame; context.data.byte(kGetback) = 3; nonewgame: return; @@ -16339,9 +17677,11 @@ loadops: context.bx = 3824; checkcoords(context); context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) goto loadops; + if (context.flags.z()) + goto loadops; context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) goto quitloaded; + if (context.flags.z()) + goto quitloaded; getridoftemp(context); context.dx = context.data; context.es = context.dx; @@ -16366,17 +17706,20 @@ quitloaded: void loadold(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 252); - if (context.flags.z()) goto alreadyloadold; + if (context.flags.z()) + goto alreadyloadold; context.data.byte(kCommandtype) = 252; context.al = 48; commandonly(context); alreadyloadold: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); - if (context.flags.z()) goto noloadold; + if (context.flags.z()) + goto noloadold; doload(context); context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) goto noloadold; + if (context.flags.z()) + goto noloadold; showdecisions(context); worktoscreenm(context); context.data.byte(kGetback) = 0; @@ -16395,7 +17738,8 @@ void createname(Context &context) { findten: context._inc(context.ah); context._sub(context.al, 10); - if (!context.flags.c()) goto findten; + if (!context.flags.c()) + goto findten; context.cs.byte(context.di+1) = context.ah; context._add(context.al, 10+'0'); context.cs.byte(context.di+2) = context.al; @@ -16404,21 +17748,24 @@ findten: thousandsc: context._inc(context.cl); context._sub(context.ax, 1000); - if (!context.flags.c()) goto thousandsc; + if (!context.flags.c()) + goto thousandsc; context._add(context.ax, 1000); context.cs.byte(context.di+4) = context.cl; context.cl = '0'-1; hundredsc: context._inc(context.cl); context._sub(context.ax, 100); - if (!context.flags.c()) goto hundredsc; + if (!context.flags.c()) + goto hundredsc; context._add(context.ax, 100); context.cs.byte(context.di+5) = context.cl; context.cl = '0'-1; tensc: context._inc(context.cl); context._sub(context.ax, 10); - if (!context.flags.c()) goto tensc; + if (!context.flags.c()) + goto tensc; context._add(context.ax, 10); context.cs.byte(context.di+6) = context.cl; context._add(context.al, '0'); @@ -16428,7 +17775,8 @@ tensc: void trysoundalloc(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedsoundbuff), 1); - if (context.flags.z()) goto gotsoundbuff; + if (context.flags.z()) + goto gotsoundbuff; context._inc(context.data.byte(kSoundtimes)); context.bx = (16384+2048)/16; allocatemem(context); @@ -16443,12 +17791,14 @@ void trysoundalloc(Context &context) { context._shl(context.ax, context.cl); context.data.word(kSoundbufferad) = context.ax; context._cmp(context.ax, 0x0b7ff); - if (!context.flags.c()) goto soundfail; + if (!context.flags.c()) + goto soundfail; context.es = context.data.word(kSoundbuffer); context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.data.byte(kNeedsoundbuff) = 1; return; soundfail: @@ -16461,7 +17811,8 @@ gotsoundbuff: void playchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) goto dontbother4; + if (context.flags.z()) + goto dontbother4; context.push(context.es); context.push(context.ds); context.push(context.bx); @@ -16471,7 +17822,8 @@ void playchannel0(Context &context) { context.data.byte(kCh0playing) = context.al; context.es = context.data.word(kSounddata); context._cmp(context.al, 12); - if (context.flags.c()) goto notsecondbank; + if (context.flags.c()) + goto notsecondbank; context.es = context.data.word(kSounddata2); context._sub(context.al, 12); notsecondbank: @@ -16489,7 +17841,8 @@ notsecondbank: context.ax = context.es.word(context.bx+3); context.data.word(kCh0blockstocopy) = context.ax; context._cmp(context.data.byte(kCh0repeat), 0); - if (context.flags.z()) goto nosetloop; + if (context.flags.z()) + goto nosetloop; context.ax = context.data.word(kCh0emmpage); context.data.word(kCh0oldemmpage) = context.ax; context.ax = context.data.word(kCh0offset); @@ -16510,9 +17863,11 @@ dontbother4: void playchannel1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) goto dontbother5; + if (context.flags.z()) + goto dontbother5; context._cmp(context.data.byte(kCh1playing), 7); - if (context.flags.z()) goto dontbother5; + if (context.flags.z()) + goto dontbother5; context.push(context.es); context.push(context.ds); context.push(context.bx); @@ -16522,7 +17877,8 @@ void playchannel1(Context &context) { context.data.byte(kCh1playing) = context.al; context.es = context.data.word(kSounddata); context._cmp(context.al, 12); - if (context.flags.c()) goto notsecondbank1; + if (context.flags.c()) + goto notsecondbank1; context.es = context.data.word(kSounddata2); context._sub(context.al, 12); notsecondbank1: @@ -16553,9 +17909,11 @@ void makenextblock(Context &context) { volumeadjust(context); loopchannel0(context); context._cmp(context.data.word(kCh1blockstocopy), 0); - if (context.flags.z()) goto mightbeonlych0; + if (context.flags.z()) + goto mightbeonlych0; context._cmp(context.data.word(kCh0blockstocopy), 0); - if (context.flags.z()) goto mightbeonlych1; + if (context.flags.z()) + goto mightbeonlych1; context._dec(context.data.word(kCh0blockstocopy)); context._dec(context.data.word(kCh1blockstocopy)); bothchannels(context); @@ -16563,7 +17921,8 @@ void makenextblock(Context &context) { mightbeonlych1: context.data.byte(kCh0playing) = 255; context._cmp(context.data.word(kCh1blockstocopy), 0); - if (context.flags.z()) goto notch1only; + if (context.flags.z()) + goto notch1only; context._dec(context.data.word(kCh1blockstocopy)); channel1only(context); notch1only: @@ -16571,7 +17930,8 @@ notch1only: mightbeonlych0: context.data.byte(kCh1playing) = 255; context._cmp(context.data.word(kCh0blockstocopy), 0); - if (context.flags.z()) goto notch0only; + if (context.flags.z()) + goto notch0only; context._dec(context.data.word(kCh0blockstocopy)); channel0only(context); return; @@ -16580,7 +17940,8 @@ notch0only: context.di = context.data.word(kSoundbufferwrite); context.cx = 1024; context.ax = 0x7f7f; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; } @@ -16589,12 +17950,15 @@ void volumeadjust(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); - if (context.flags.z()) goto volok; + if (context.flags.z()) + goto volok; context.al = context.data.byte(kVolume); context._cmp(context.al, context.data.byte(kVolumeto)); - if (context.flags.z()) goto volfinish; + if (context.flags.z()) + goto volfinish; context._add(context.data.byte(kVolumecount), 64); - if (!context.flags.z()) goto volok; + if (!context.flags.z()) + goto volok; context.al = context.data.byte(kVolume); context._add(context.al, context.data.byte(kVolumedirection)); context.data.byte(kVolume) = context.al; @@ -16608,11 +17972,14 @@ volok: void loopchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kCh0blockstocopy), 0); - if (!context.flags.z()) goto notloop; + if (!context.flags.z()) + goto notloop; context._cmp(context.data.byte(kCh0repeat), 0); - if (context.flags.z()) goto notloop; + if (context.flags.z()) + goto notloop; context._cmp(context.data.byte(kCh0repeat), 255); - if (context.flags.z()) goto endlessloop; + if (context.flags.z()) + goto endlessloop; context._dec(context.data.byte(kCh0repeat)); endlessloop: context.ax = context.data.word(kCh0oldemmpage); @@ -16643,10 +18010,12 @@ void cancelch1(Context &context) { void channel0tran(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); - if (!context.flags.z()) goto lowvolumetran; + if (!context.flags.z()) + goto lowvolumetran; context.cx = 1024; - while(context.cx--) context._movsw(); - return; + while(context.cx--) + context._movsw(); + return; lowvolumetran: context.cx = 1024; context.bh = context.data.byte(kVolume); @@ -16659,51 +18028,63 @@ volloop: context.bl = context.ah; context.ah = context.es.byte(context.bx); context._stosw(); - if (--context.cx) goto volloop; + if (--context.cx) + goto volloop; } void domix(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kVolume), 0); - if (!context.flags.z()) goto lowvolumemix; + if (!context.flags.z()) + goto lowvolumemix; slow: context._lodsb(); context.ah = context.ds.byte(context.bx); context._inc(context.bx); context._cmp(context.al, context.dh); - if (!context.flags.c()) goto toplot; + if (!context.flags.c()) + goto toplot; context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto nodistort; + if (!context.flags.c()) + goto nodistort; context._add(context.al, context.ah); - if (context.flags.s()) goto botok; + if (context.flags.s()) + goto botok; context._xor(context.al, context.al); context._stosb(); - if (--context.cx) goto slow; + if (--context.cx) + goto slow; goto doneit; botok: context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto slow; + if (--context.cx) + goto slow; goto doneit; toplot: context._cmp(context.ah, context.dh); - if (context.flags.c()) goto nodistort; + if (context.flags.c()) + goto nodistort; context._add(context.al, context.ah); - if (!context.flags.s()) goto topok; + if (!context.flags.s()) + goto topok; context.al = context.dl; context._stosb(); - if (--context.cx) goto slow; + if (--context.cx) + goto slow; goto doneit; topok: context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto slow; + if (--context.cx) + goto slow; goto doneit; nodistort: context._add(context.al, context.ah); context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto slow; + if (--context.cx) + goto slow; goto doneit; lowvolumemix: context._lodsb(); @@ -16716,39 +18097,49 @@ lowvolumemix: context.ah = context.ds.byte(context.bx); context._inc(context.bx); context._cmp(context.al, context.dh); - if (!context.flags.c()) goto toplotv; + if (!context.flags.c()) + goto toplotv; context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto nodistortv; + if (!context.flags.c()) + goto nodistortv; context._add(context.al, context.ah); - if (context.flags.s()) goto botokv; + if (context.flags.s()) + goto botokv; context._xor(context.al, context.al); context._stosb(); - if (--context.cx) goto lowvolumemix; + if (--context.cx) + goto lowvolumemix; goto doneit; botokv: context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto lowvolumemix; + if (--context.cx) + goto lowvolumemix; goto doneit; toplotv: context._cmp(context.ah, context.dh); - if (context.flags.c()) goto nodistortv; + if (context.flags.c()) + goto nodistortv; context._add(context.al, context.ah); - if (!context.flags.s()) goto topokv; + if (!context.flags.s()) + goto topokv; context.al = context.dl; context._stosb(); - if (--context.cx) goto lowvolumemix; + if (--context.cx) + goto lowvolumemix; goto doneit; topokv: context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto lowvolumemix; + if (--context.cx) + goto lowvolumemix; goto doneit; nodistortv: context._add(context.al, context.ah); context._xor(context.al, context.dh); context._stosb(); - if (--context.cx) goto lowvolumemix; + if (--context.cx) + goto lowvolumemix; doneit: return; } @@ -16756,7 +18147,8 @@ doneit: void entrytexts(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 21); - if (!context.flags.z()) goto notloc15; + if (!context.flags.z()) + goto notloc15; context.al = 28; context.cx = 60; context.dx = 11; @@ -16766,7 +18158,8 @@ void entrytexts(Context &context) { return; notloc15: context._cmp(context.data.byte(kLocation), 30); - if (!context.flags.z()) goto notloc43; + if (!context.flags.z()) + goto notloc43; context.al = 27; context.cx = 60; context.dx = 11; @@ -16776,7 +18169,8 @@ notloc15: return; notloc43: context._cmp(context.data.byte(kLocation), 23); - if (!context.flags.z()) goto notloc23; + if (!context.flags.z()) + goto notloc23; context.al = 29; context.cx = 60; context.dx = 11; @@ -16786,7 +18180,8 @@ notloc43: return; notloc23: context._cmp(context.data.byte(kLocation), 31); - if (!context.flags.z()) goto notloc44; + if (!context.flags.z()) + goto notloc44; context.al = 30; context.cx = 60; context.dx = 11; @@ -16796,7 +18191,8 @@ notloc23: return; notloc44: context._cmp(context.data.byte(kLocation), 20); - if (!context.flags.z()) goto notsarters2; + if (!context.flags.z()) + goto notsarters2; context.al = 31; context.cx = 60; context.dx = 11; @@ -16806,7 +18202,8 @@ notloc44: return; notsarters2: context._cmp(context.data.byte(kLocation), 24); - if (!context.flags.z()) goto notedenlob; + if (!context.flags.z()) + goto notedenlob; context.al = 32; context.cx = 60; context.dx = 3; @@ -16816,7 +18213,8 @@ notsarters2: return; notedenlob: context._cmp(context.data.byte(kLocation), 34); - if (!context.flags.z()) goto noteden2; + if (!context.flags.z()) + goto noteden2; context.al = 33; context.cx = 60; context.dx = 3; @@ -16833,7 +18231,8 @@ void entryanims(Context &context) { context.data.word(kReeltowatch) = -1; context.data.byte(kWatchmode) = -1; context._cmp(context.data.byte(kLocation), 33); - if (!context.flags.z()) goto notinthebeach; + if (!context.flags.z()) + goto notinthebeach; switchryanoff(context); context.data.word(kWatchingtime) = 76*2; context.data.word(kReeltowatch) = 0; @@ -16843,7 +18242,8 @@ void entryanims(Context &context) { return; notinthebeach: context._cmp(context.data.byte(kLocation), 44); - if (!context.flags.z()) goto notsparkys; + if (!context.flags.z()) + goto notsparkys; context.al = 8; resetlocation(context); context.data.word(kWatchingtime) = 50*2; @@ -16855,7 +18255,8 @@ notinthebeach: return; notsparkys: context._cmp(context.data.byte(kLocation), 22); - if (!context.flags.z()) goto notinthelift; + if (!context.flags.z()) + goto notinthelift; context.data.word(kWatchingtime) = 31*2; context.data.word(kReeltowatch) = 0; context.data.word(kEndwatchreel) = 30; @@ -16865,13 +18266,15 @@ notsparkys: return; notinthelift: context._cmp(context.data.byte(kLocation), 26); - if (!context.flags.z()) goto notunderchurch; + if (!context.flags.z()) + goto notunderchurch; context.data.byte(kSymboltopnum) = 2; context.data.byte(kSymbolbotnum) = 1; return; notunderchurch: context._cmp(context.data.byte(kLocation), 45); - if (!context.flags.z()) goto notenterdream; + if (!context.flags.z()) + goto notenterdream; context.data.byte(kKeeperflag) = 0; context.data.word(kWatchingtime) = 296; context.data.word(kReeltowatch) = 45; @@ -16882,23 +18285,29 @@ notunderchurch: return; notenterdream: context._cmp(context.data.byte(kReallocation), 46); - if (!context.flags.z()) goto notcrystal; + if (!context.flags.z()) + goto notcrystal; context._cmp(context.data.byte(kSartaindead), 1); - if (!context.flags.z()) goto notcrystal; + if (!context.flags.z()) + goto notcrystal; context.al = 0; removefreeobject(context); return; notcrystal: context._cmp(context.data.byte(kLocation), 9); - if (!context.flags.z()) goto nottopchurch; + if (!context.flags.z()) + goto nottopchurch; context.al = 2; checkifpathison(context); - if (context.flags.z()) goto nottopchurch; + if (context.flags.z()) + goto nottopchurch; context._cmp(context.data.byte(kAidedead), 0); - if (context.flags.z()) goto nottopchurch; + if (context.flags.z()) + goto nottopchurch; context.al = 3; checkifpathison(context); - if (!context.flags.z()) goto makedoorsopen; + if (!context.flags.z()) + goto makedoorsopen; context.al = 2; turnpathon(context); makedoorsopen: @@ -16909,7 +18318,8 @@ makedoorsopen: return; nottopchurch: context._cmp(context.data.byte(kLocation), 47); - if (!context.flags.z()) goto notdreamcentre; + if (!context.flags.z()) + goto notdreamcentre; context.al = 4; placesetobject(context); context.al = 5; @@ -16917,7 +18327,8 @@ nottopchurch: return; notdreamcentre: context._cmp(context.data.byte(kLocation), 38); - if (!context.flags.z()) goto notcarpark; + if (!context.flags.z()) + goto notcarpark; context.data.word(kWatchingtime) = 57*2; context.data.word(kReeltowatch) = 4; context.data.word(kEndwatchreel) = 57; @@ -16927,7 +18338,8 @@ notdreamcentre: return; notcarpark: context._cmp(context.data.byte(kLocation), 32); - if (!context.flags.z()) goto notalley; + if (!context.flags.z()) + goto notalley; context.data.word(kWatchingtime) = 66*2; context.data.word(kReeltowatch) = 0; context.data.word(kEndwatchreel) = 66; @@ -16937,7 +18349,8 @@ notcarpark: return; notalley: context._cmp(context.data.byte(kLocation), 24); - if (!context.flags.z()) goto notedensagain; + if (!context.flags.z()) + goto notedensagain; context.al = 2; context.ah = context.data.byte(kRoomnum); context._dec(context.ah); @@ -16949,7 +18362,8 @@ notedensagain: void initialinv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); - if (context.flags.z()) goto isedens; + if (context.flags.z()) + goto isedens; return; isedens: context.al = 11; @@ -17003,7 +18417,8 @@ void checkbasemem(Context &context) { STACK_CHECK(context); context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); - if (!context.flags.c()) goto enoughmem; + if (!context.flags.c()) + goto enoughmem; context.data.byte(kGameerror) = 5; { quickquit(context); return; }; enoughmem: @@ -17050,25 +18465,29 @@ void clearbuffers(Context &context) { context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; context.ax = 0; context.di = 0; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.es = context.data.word(kExtras); context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)+(6*64)); context.ds = context.cs; context.si = 534; context.cx = (991-534); - while(context.cx--) context._movsb(); - context.es = context.data.word(kBuffers); + while(context.cx--) + context._movsb(); + context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)+(6*64)+991-534); context.ds = context.cs; context.si = 0; context.cx = (68-0); - while(context.cx--) context._movsb(); - clearchanges(context); + while(context.cx--) + context._movsb(); + clearchanges(context); } void clearchanges(Context &context) { @@ -17077,27 +18496,31 @@ void clearchanges(Context &context) { context.cx = (250)*2; context.ax = 0x0ffff; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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*24)+(6*64)); context.es = context.cs; context.di = 534; context.cx = (991-534); - while(context.cx--) context._movsb(); - context.ds = context.data.word(kBuffers); + while(context.cx--) + context._movsb(); + context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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*24)+(6*64)+991-534); context.es = context.cs; context.di = 0; context.cx = (68-0); - while(context.cx--) context._movsb(); - context.data.byte(kExpos) = 0; + while(context.cx--) + context._movsb(); + context.data.byte(kExpos) = 0; context.data.word(kExframepos) = 0; context.data.word(kExtextpos) = 0; context.es = context.data.word(kExtras); context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.es = context.cs; context.di = 8011; context.al = 1; @@ -17108,13 +18531,15 @@ void clearchanges(Context &context) { context._stosb(); context.ax = 0; context.cx = 6; - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); } void clearbeforeload(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 1); - if (!context.flags.z()) goto noclear; + if (!context.flags.z()) + goto noclear; clearreels(context); clearrest(context); context.data.byte(kRoomloaded) = 0; @@ -17138,7 +18563,8 @@ void clearrest(Context &context) { context.cx = (66*60)/2; context.ax = 0; context.di = (0); - while(context.cx--) context._stosw(); + while(context.cx--) + context._stosw(); context.es = context.data.word(kBackdrop); deallocatemem(context); context.es = context.data.word(kSetframes); @@ -17164,31 +18590,44 @@ void parseblaster(Context &context) { lookattail: context.al = context.es.byte(context.bx); context._cmp(context.al, 0); - if (context.flags.z()) goto endtail; + if (context.flags.z()) + goto endtail; context._cmp(context.al, 13); - if (context.flags.z()) goto endtail; + if (context.flags.z()) + goto endtail; context._cmp(context.al, 'i'); - if (context.flags.z()) goto issoundint; + if (context.flags.z()) + goto issoundint; context._cmp(context.al, 'I'); - if (context.flags.z()) goto issoundint; + if (context.flags.z()) + goto issoundint; context._cmp(context.al, 'b'); - if (context.flags.z()) goto isbright; + if (context.flags.z()) + goto isbright; context._cmp(context.al, 'B'); - if (context.flags.z()) goto isbright; + if (context.flags.z()) + goto isbright; context._cmp(context.al, 'a'); - if (context.flags.z()) goto isbaseadd; + if (context.flags.z()) + goto isbaseadd; context._cmp(context.al, 'A'); - if (context.flags.z()) goto isbaseadd; + if (context.flags.z()) + goto isbaseadd; context._cmp(context.al, 'n'); - if (context.flags.z()) goto isnosound; + if (context.flags.z()) + goto isnosound; context._cmp(context.al, 'N'); - if (context.flags.z()) goto isnosound; + if (context.flags.z()) + goto isnosound; context._cmp(context.al, 'd'); - if (context.flags.z()) goto isdma; + if (context.flags.z()) + goto isdma; context._cmp(context.al, 'D'); - if (context.flags.z()) goto isdma; + if (context.flags.z()) + goto isdma; context._inc(context.bx); - if (--context.cx) goto lookattail; + if (--context.cx) + goto lookattail; return; issoundint: context.al = context.es.byte(context.bx+1); @@ -17269,9 +18708,11 @@ void screenupdate(Context &context) { animpointer(context); showpointer(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto iswatchingmode; + if (!context.flags.z()) + goto iswatchingmode; context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) goto finishearly; + if (!context.flags.z()) + goto finishearly; iswatchingmode: vsync(context); readmouse1(context); @@ -17284,7 +18725,8 @@ iswatchingmode: zoom(context); showpointer(context); context._cmp(context.data.byte(kWongame), 0); - if (!context.flags.z()) goto finishearly; + if (!context.flags.z()) + goto finishearly; vsync(context); readmouse2(context); dumppointer(context); @@ -17314,30 +18756,37 @@ finishearly: void watchreel(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kReeltowatch), -1); - if (context.flags.z()) goto notplayingreel; + if (context.flags.z()) + goto notplayingreel; context.al = context.data.byte(kManspath); context._cmp(context.al, context.data.byte(kFinaldest)); - if (!context.flags.z()) goto waitstopwalk; + if (!context.flags.z()) + goto waitstopwalk; context.al = context.data.byte(kTurntoface); context._cmp(context.al, context.data.byte(kFacing)); - if (context.flags.z()) goto notwatchpath; + if (context.flags.z()) + goto notwatchpath; waitstopwalk: return; notwatchpath: context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); - if (!context.flags.z()) goto showwatchreel; + if (!context.flags.z()) + goto showwatchreel; context.al = context.data.byte(kWatchspeed); context.data.byte(kSpeedcount) = context.al; context.ax = context.data.word(kReeltowatch); context._cmp(context.ax, context.data.word(kEndwatchreel)); - if (!context.flags.z()) goto ismorereel; + if (!context.flags.z()) + goto ismorereel; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto showwatchreel; + if (!context.flags.z()) + goto showwatchreel; context.data.word(kReeltowatch) = -1; context.data.byte(kWatchmode) = -1; context._cmp(context.data.word(kReeltohold), -1); - if (context.flags.z()) goto nomorereel; + if (context.flags.z()) + goto nomorereel; context.data.byte(kWatchmode) = 1; goto notplayingreel; ismorereel: @@ -17353,24 +18802,28 @@ nomorereel: return; notplayingreel: context._cmp(context.data.byte(kWatchmode), 1); - if (!context.flags.z()) goto notholdingreel; + if (!context.flags.z()) + goto notholdingreel; context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); return; notholdingreel: context._cmp(context.data.byte(kWatchmode), 2); - if (!context.flags.z()) goto notreleasehold; + if (!context.flags.z()) + goto notreleasehold; context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); - if (!context.flags.z()) goto notlastspeed2; + if (!context.flags.z()) + goto notlastspeed2; context.al = context.data.byte(kWatchspeed); context.data.byte(kSpeedcount) = context.al; context._inc(context.data.word(kReeltohold)); notlastspeed2: context.ax = context.data.word(kReeltohold); context._cmp(context.ax, context.data.word(kEndofholdreel)); - if (!context.flags.z()) goto ismorereel2; + if (!context.flags.z()) + goto ismorereel2; context.data.word(kReeltohold) = -1; context.data.byte(kWatchmode) = -1; context.al = context.data.byte(kDestafterhold); @@ -17390,9 +18843,11 @@ notreleasehold: void checkforshake(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 26); - if (!context.flags.z()) goto notstartshake; + if (!context.flags.z()) + goto notstartshake; context._cmp(context.ax, 104); - if (!context.flags.z()) goto notstartshake; + if (!context.flags.z()) + goto notstartshake; context.data.byte(kShakecounter) = -1; notstartshake: return; @@ -17401,12 +18856,15 @@ notstartshake: void watchcount(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) goto nowatchworn; + if (context.flags.z()) + goto nowatchworn; context._inc(context.data.byte(kTimercount)); context._cmp(context.data.byte(kTimercount), 9); - if (context.flags.z()) goto flashdots; + if (context.flags.z()) + goto flashdots; context._cmp(context.data.byte(kTimercount), 18); - if (context.flags.z()) goto uptime; + if (context.flags.z()) + goto uptime; nowatchworn: return; flashdots: @@ -17420,15 +18878,18 @@ uptime: context.data.byte(kTimercount) = 0; context._add(context.data.byte(kSecondcount), 1); context._cmp(context.data.byte(kSecondcount), 60); - if (!context.flags.z()) goto finishtime; + if (!context.flags.z()) + goto finishtime; context.data.byte(kSecondcount) = 0; context._inc(context.data.byte(kMinutecount)); context._cmp(context.data.byte(kMinutecount), 60); - if (!context.flags.z()) goto finishtime; + if (!context.flags.z()) + goto finishtime; context.data.byte(kMinutecount) = 0; context._inc(context.data.byte(kHourcount)); context._cmp(context.data.byte(kHourcount), 24); - if (!context.flags.z()) goto finishtime; + if (!context.flags.z()) + goto finishtime; context.data.byte(kHourcount) = 0; finishtime: showtime(context); @@ -17439,7 +18900,8 @@ finishwatch: void showtime(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) goto nowatch; + if (context.flags.z()) + goto nowatch; context.al = context.data.byte(kSecondcount); context.cl = 0; twodigitnum(context); @@ -17506,7 +18968,8 @@ nowatch: void dumpwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchdump), 1); - if (!context.flags.z()) goto nodumpwatch; + if (!context.flags.z()) + goto nodumpwatch; context.di = 256; context.bx = 21; context.cl = 40; @@ -17536,7 +18999,8 @@ void showbyte(Context &context) { void onedigit(Context &context) { STACK_CHECK(context); context._cmp(context.dl, 10); - if (!context.flags.c()) goto morethan10; + if (!context.flags.c()) + goto morethan10; context._add(context.dl, '0'); return; morethan10: @@ -17551,7 +19015,8 @@ void twodigitnum(Context &context) { numloop1: context._inc(context.ah); context._sub(context.al, 10); - if (!context.flags.c()) goto numloop1; + if (!context.flags.c()) + goto numloop1; context._add(context.al, 10); context._add(context.al, context.cl); } @@ -17564,7 +19029,8 @@ void showword(Context &context) { word1: context._inc(context.cl); context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word1; + if (!context.flags.c()) + goto word1; context._add(context.ax, context.bx); convnum(context); context.cs.byte(context.di) = context.cl; @@ -17573,7 +19039,8 @@ word1: word2: context._inc(context.cl); context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word2; + if (!context.flags.c()) + goto word2; context._add(context.ax, context.bx); convnum(context); context.cs.byte(context.di+1) = context.cl; @@ -17582,7 +19049,8 @@ word2: word3: context._inc(context.cl); context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word3; + if (!context.flags.c()) + goto word3; context._add(context.ax, context.bx); convnum(context); context.cs.byte(context.di+2) = context.cl; @@ -17591,7 +19059,8 @@ word3: word4: context._inc(context.cl); context._sub(context.ax, context.bx); - if (!context.flags.c()) goto word4; + if (!context.flags.c()) + goto word4; context._add(context.ax, context.bx); convnum(context); context.cs.byte(context.di+3) = context.cl; @@ -17604,9 +19073,11 @@ word4: void convnum(Context &context) { STACK_CHECK(context); context._cmp(context.ch, 0); - if (!context.flags.z()) goto noconvnum; + if (!context.flags.z()) + goto noconvnum; context._cmp(context.cl, '0'); - if (!context.flags.z()) goto notzeronum; + if (!context.flags.z()) + goto notzeronum; context.cl = 32; goto noconvnum; notzeronum: @@ -17618,14 +19089,16 @@ noconvnum: void walkandexamine(Context &context) { STACK_CHECK(context); finishedwalking(context); - if (!context.flags.z()) goto noobselect; + if (!context.flags.z()) + goto noobselect; context.al = context.data.byte(kWalkexamtype); context.data.byte(kCommandtype) = context.al; context.al = context.data.byte(kWalkexamnum); context.data.byte(kCommand) = context.al; context.data.byte(kWalkandexam) = 0; context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) goto noobselect; + if (context.flags.z()) + goto noobselect; examineob(context); return; wantstowalk: @@ -17637,39 +19110,50 @@ diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) goto notblock; + if (!context.flags.z()) + goto notblock; context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) goto dontcheck; + if (!context.flags.z()) + goto dontcheck; context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); - if (context.flags.c()) goto isblock; + if (context.flags.c()) + goto isblock; dontcheck: getflagunderp(context); context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) goto isblock; + if (context.flags.c()) + goto isblock; context._cmp(context.data.byte(kLastflag), 128); - if (!context.flags.c()) goto isblock; + if (!context.flags.c()) + goto isblock; goto toofaraway; notblock: context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) goto toofaraway; + if (!context.flags.z()) + goto toofaraway; context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) goto isblock; + if (context.flags.z()) + goto isblock; context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) goto isaperson; + if (context.flags.z()) + goto isaperson; examineobtext(context); return; middleofwalk: @@ -17690,12 +19174,14 @@ void mainscreen(Context &context) { context.data.byte(kInmaparea) = 0; context.bx = 5122; context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) goto checkmain; + if (context.flags.z()) + goto checkmain; context.bx = 5184; checkmain: checkcoords(context); context._cmp(context.data.byte(kWalkandexam), 0); - if (context.flags.z()) goto finishmain; + if (context.flags.z()) + goto finishmain; walkandexamine(context); finishmain: return; @@ -17704,24 +19190,31 @@ finishmain: void madmanrun(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); - if (!context.flags.z()) { identifyob(context); return; }; + if (!context.flags.z()) + { identifyob(context); return; }; context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) { identifyob(context); return; }; + if (!context.flags.z()) + { identifyob(context); return; }; context._cmp(context.data.byte(kPointermode), 2); - if (!context.flags.z()) { identifyob(context); return; }; + if (!context.flags.z()) + { identifyob(context); return; }; context._cmp(context.data.byte(kMadmanflag), 0); - if (!context.flags.z()) { identifyob(context); return; }; + if (!context.flags.z()) + { identifyob(context); return; }; context._cmp(context.data.byte(kCommandtype), 211); - if (context.flags.z()) goto alreadyrun; + if (context.flags.z()) + goto alreadyrun; context.data.byte(kCommandtype) = 211; context.al = 52; commandonly(context); alreadyrun: context._cmp(context.data.word(kMousebutton), 1); - if (!context.flags.z()) goto norun; + if (!context.flags.z()) + goto norun; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) goto norun; + if (context.flags.z()) + goto norun; context.data.byte(kLastweapon) = 8; norun: return; @@ -17730,24 +19223,30 @@ norun: void checkcoords(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewlocation), 255); - if (context.flags.z()) goto loop048; + if (context.flags.z()) + goto loop048; return; loop048: context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nonefound; + if (context.flags.z()) + goto nonefound; context.push(context.bx); context._cmp(context.data.word(kMousex), context.ax); - if (context.flags.l()) goto over045; + if (context.flags.l()) + goto over045; context.ax = context.cs.word(context.bx+2); context._cmp(context.data.word(kMousex), context.ax); - if (!context.flags.l()) goto over045; + if (!context.flags.l()) + goto over045; context.ax = context.cs.word(context.bx+4); context._cmp(context.data.word(kMousey), context.ax); - if (context.flags.l()) goto over045; + if (context.flags.l()) + goto over045; context.ax = context.cs.word(context.bx+6); context._cmp(context.data.word(kMousey), context.ax); - if (!context.flags.l()) goto over045; + if (!context.flags.l()) + goto over045; context.ax = context.cs.word(context.bx+8); __dispatch_call(context, context.ax); context.ax = context.pop(); @@ -17763,18 +19262,21 @@ nonefound: void identifyob(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) { blank(context); return; }; + if (!context.flags.z()) + { blank(context); return; }; context.ax = context.data.word(kMousex); context._sub(context.ax, context.data.word(kMapadx)); context._cmp(context.ax, 22*8); - if (context.flags.c()) goto notover1; + if (context.flags.c()) + goto notover1; blank(context); return; notover1: context.bx = context.data.word(kMousey); context._sub(context.bx, context.data.word(kMapady)); context._cmp(context.bx, 20*8); - if (context.flags.c()) goto notover2; + if (context.flags.c()) + goto notover2; blank(context); return; notover2: @@ -17789,13 +19291,17 @@ notover2: context.data.byte(kPointerfirstpath) = context.al; context.ax = context.pop(); checkifex(context); - if (!context.flags.z()) goto finishidentify; + if (!context.flags.z()) + goto finishidentify; checkiffree(context); - if (!context.flags.z()) goto finishidentify; + if (!context.flags.z()) + goto finishidentify; checkifperson(context); - if (!context.flags.z()) goto finishidentify; + if (!context.flags.z()) + goto finishidentify; checkifset(context); - if (!context.flags.z()) goto finishidentify; + if (!context.flags.z()) + goto finishidentify; context.ax = context.data.word(kMousex); context._sub(context.ax, context.data.word(kMapadx)); context.cl = context.al; @@ -17804,9 +19310,11 @@ notover2: context.ch = context.al; checkone(context); context._cmp(context.al, 0); - if (context.flags.z()) goto nothingund; + if (context.flags.z()) + goto nothingund; context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) goto nothingund; + if (context.flags.z()) + goto nothingund; context.ah = 3; obname(context); finishidentify: @@ -17823,7 +19331,8 @@ void checkifperson(Context &context) { identifyreel: context.push(context.cx); context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) goto notareelid; + if (context.flags.z()) + goto notareelid; context.push(context.es); context.push(context.bx); context.push(context.ax); @@ -17831,7 +19340,8 @@ identifyreel: context.data.word(kReelpointer) = context.ax; getreelstart(context); context._cmp(context.es.word(context.si+2), 0x0ffff); - if (!context.flags.z()) goto notblankpers; + if (!context.flags.z()) + goto notblankpers; context._add(context.si, 5); notblankpers: context.cx = context.es.word(context.si+2); @@ -17848,13 +19358,17 @@ notblankpers: context.bx = context.pop(); context.es = context.pop(); context._cmp(context.al, context.cl); - if (context.flags.c()) goto notareelid; + if (context.flags.c()) + goto notareelid; context._cmp(context.ah, context.ch); - if (context.flags.c()) goto notareelid; + if (context.flags.c()) + goto notareelid; context._cmp(context.al, context.dl); - if (!context.flags.c()) goto notareelid; + if (!context.flags.c()) + goto notareelid; context._cmp(context.ah, context.dh); - if (!context.flags.c()) goto notareelid; + if (!context.flags.c()) + goto notareelid; context.cx = context.pop(); context.ax = context.es.word(context.bx+2); context.data.word(kPersondata) = context.ax; @@ -17868,7 +19382,8 @@ notareelid: context.cx = context.pop(); context._add(context.bx, 5); context._dec(context.cx); - if (!context.flags.z()) goto identifyreel; + if (!context.flags.z()) + goto identifyreel; } void checkifset(Context &context) { @@ -17878,19 +19393,26 @@ void checkifset(Context &context) { context.cx = 127; identifyset: context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) goto notasetid; + if (context.flags.z()) + goto notasetid; context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) goto notasetid; + if (context.flags.c()) + goto notasetid; context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) goto notasetid; + if (!context.flags.c()) + goto notasetid; context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) goto notasetid; + if (context.flags.c()) + goto notasetid; context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) goto notasetid; + if (!context.flags.c()) + goto notasetid; pixelcheckset(context); - if (context.flags.z()) goto notasetid; + if (context.flags.z()) + goto notasetid; isitdescribed(context); - if (context.flags.z()) goto notasetid; + if (context.flags.z()) + goto notasetid; context.al = context.es.byte(context.bx+4); context.ah = 1; obname(context); @@ -17901,7 +19423,8 @@ notasetid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyset; + if (!context.flags.z()) + goto identifyset; } void checkifex(Context &context) { @@ -17911,15 +19434,20 @@ void checkifex(Context &context) { context.cx = 99; identifyex: context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) goto notanexid; + if (context.flags.z()) + goto notanexid; context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) goto notanexid; + if (context.flags.c()) + goto notanexid; context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) goto notanexid; + if (!context.flags.c()) + goto notanexid; context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) goto notanexid; + if (context.flags.c()) + goto notanexid; context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) goto notanexid; + if (!context.flags.c()) + goto notanexid; context.al = context.es.byte(context.bx+4); context.ah = 4; obname(context); @@ -17930,7 +19458,8 @@ notanexid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyex; + if (!context.flags.z()) + goto identifyex; } void checkiffree(Context &context) { @@ -17940,15 +19469,20 @@ void checkiffree(Context &context) { context.cx = 79; identifyfree: context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) goto notafreeid; + if (context.flags.z()) + goto notafreeid; context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) goto notafreeid; + if (context.flags.c()) + goto notafreeid; context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) goto notafreeid; + if (!context.flags.c()) + goto notafreeid; context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) goto notafreeid; + if (context.flags.c()) + goto notafreeid; context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) goto notafreeid; + if (!context.flags.c()) + goto notafreeid; context.al = context.es.byte(context.bx+4); context.ah = 2; obname(context); @@ -17959,7 +19493,8 @@ notafreeid: context._sub(context.bx, 5); context._dec(context.cx); context._cmp(context.cx, -1); - if (!context.flags.z()) goto identifyfree; + if (!context.flags.z()) + goto identifyfree; } void isitdescribed(Context &context) { @@ -18000,25 +19535,32 @@ void findpathofpoint(Context &context) { pathloop: context.al = context.es.byte(context.bx+6); context._cmp(context.al, 255); - if (!context.flags.z()) goto flunkedit; + if (!context.flags.z()) + goto flunkedit; context.ax = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto flunkedit; + if (context.flags.z()) + goto flunkedit; context._cmp(context.cl, context.al); - if (context.flags.c()) goto flunkedit; + if (context.flags.c()) + goto flunkedit; context._cmp(context.ch, context.ah); - if (context.flags.c()) goto flunkedit; + if (context.flags.c()) + goto flunkedit; context.ax = context.es.word(context.bx+4); context._cmp(context.cl, context.al); - if (!context.flags.c()) goto flunkedit; + if (!context.flags.c()) + goto flunkedit; context._cmp(context.ch, context.ah); - if (!context.flags.c()) goto flunkedit; + if (!context.flags.c()) + goto flunkedit; goto gotvalidpath; flunkedit: context._add(context.bx, 8); context._inc(context.dl); context._cmp(context.dl, 12); - if (!context.flags.z()) goto pathloop; + if (!context.flags.z()) + goto pathloop; context.dl = 255; gotvalidpath: return; @@ -18039,22 +19581,28 @@ void findfirstpath(Context &context) { fpathloop: context.ax = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nofirst; + if (context.flags.z()) + goto nofirst; context._cmp(context.cl, context.al); - if (context.flags.c()) goto nofirst; + if (context.flags.c()) + goto nofirst; context._cmp(context.ch, context.ah); - if (context.flags.c()) goto nofirst; + if (context.flags.c()) + goto nofirst; context.ax = context.es.word(context.bx+4); context._cmp(context.cl, context.al); - if (!context.flags.c()) goto nofirst; + if (!context.flags.c()) + goto nofirst; context._cmp(context.ch, context.ah); - if (!context.flags.c()) goto nofirst; + if (!context.flags.c()) + goto nofirst; goto gotfirst; nofirst: context._add(context.bx, 8); context._inc(context.dl); context._cmp(context.dl, 12); - if (!context.flags.z()) goto fpathloop; + if (!context.flags.z()) + goto fpathloop; context.al = 0; return; gotfirst: @@ -18073,7 +19621,8 @@ void turnpathon(Context &context) { getroomspaths(context); context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto nopathon; + if (context.flags.z()) + goto nopathon; context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18097,7 +19646,8 @@ void turnpathoff(Context &context) { getroomspaths(context); context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto nopathoff; + if (context.flags.z()) + goto nopathoff; context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -18178,13 +19728,15 @@ void checkifpathison(Context &context) { void afternewroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); - if (context.flags.z()) goto notnew; + if (context.flags.z()) + goto notnew; context.data.word(kTimecount) = 0; createpanel(context); context.data.byte(kCommandtype) = 0; findroominloc(context); context._cmp(context.data.byte(kRyanon), 1); - if (context.flags.z()) goto ryansoff; + if (context.flags.z()) + goto ryansoff; context.al = context.data.byte(kRyanx); context._add(context.al, 12); context.ah = context.data.byte(kRyany); @@ -18222,37 +19774,50 @@ void atmospheres(Context &context) { nextatmos: context.al = context.cs.byte(context.bx); context._cmp(context.al, 255); - if (context.flags.z()) goto nomoreatmos; + if (context.flags.z()) + goto nomoreatmos; context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) goto wrongatmos; + if (!context.flags.z()) + goto wrongatmos; context.ax = context.cs.word(context.bx+1); context._cmp(context.ax, context.cx); - if (!context.flags.z()) goto wrongatmos; + if (!context.flags.z()) + goto wrongatmos; context.ax = context.cs.word(context.bx+3); context._cmp(context.al, context.data.byte(kCh0playing)); - if (context.flags.z()) goto playingalready; + if (context.flags.z()) + goto playingalready; context._cmp(context.data.byte(kLocation), 45); - if (!context.flags.z()) goto notweb; + if (!context.flags.z()) + goto notweb; context._cmp(context.data.word(kReeltowatch), 45); - if (context.flags.z()) goto wrongatmos; + if (context.flags.z()) + goto wrongatmos; notweb: playchannel0(context); context._cmp(context.data.byte(kReallocation), 2); context._cmp(context.data.byte(kMapy), 0); - if (context.flags.z()) goto fullvol; - if (!context.flags.z()) goto notlouisvol; + if (context.flags.z()) + goto fullvol; + if (!context.flags.z()) + goto notlouisvol; context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) goto notlouisvol; + if (!context.flags.z()) + goto notlouisvol; context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) goto notlouisvol; + if (!context.flags.z()) + goto notlouisvol; context.data.byte(kVolume) = 5; notlouisvol: context._cmp(context.data.byte(kReallocation), 14); - if (!context.flags.z()) goto notmad1; + if (!context.flags.z()) + goto notmad1; context._cmp(context.data.byte(kMapx), 33); - if (context.flags.z()) goto ismad2; + if (context.flags.z()) + goto ismad2; context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) goto notmad1; + if (!context.flags.z()) + goto notmad1; context.data.byte(kVolume) = 5; return; ismad2: @@ -18261,11 +19826,14 @@ ismad2: notmad1: playingalready: context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) goto notlouisvol2; + if (!context.flags.z()) + goto notlouisvol2; context._cmp(context.data.byte(kMapx), 22); - if (context.flags.z()) goto louisvol; + if (context.flags.z()) + goto louisvol; context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) goto notlouisvol2; + if (!context.flags.z()) + goto notlouisvol2; fullvol: context.data.byte(kVolume) = 0; notlouisvol2: @@ -18283,9 +19851,11 @@ nomoreatmos: void walkintoroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); - if (!context.flags.z()) goto notlair; + if (!context.flags.z()) + goto notlair; context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) goto notlair; + if (!context.flags.z()) + goto notlair; context.data.byte(kDestination) = 1; context.data.byte(kFinaldest) = 1; autosetwalk(context); @@ -18296,7 +19866,8 @@ notlair: void afterintroroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); - if (context.flags.z()) goto notnewintro; + if (context.flags.z()) + goto notnewintro; clearwork(context); findroominloc(context); context.data.byte(kNewobs) = 1; @@ -18313,53 +19884,68 @@ notnewintro: void obname(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReasseschanges), 0); - if (context.flags.z()) goto notnewpath; + if (context.flags.z()) + goto notnewpath; context.data.byte(kReasseschanges) = 0; goto diff; notnewpath: context._cmp(context.ah, context.data.byte(kCommandtype)); - if (context.flags.z()) goto notdiffob; + if (context.flags.z()) + goto notdiffob; goto diff; notdiffob: context._cmp(context.al, context.data.byte(kCommand)); - if (!context.flags.z()) goto diff; + if (!context.flags.z()) + goto diff; context._cmp(context.data.byte(kWalkandexam), 1); - if (context.flags.z()) goto walkandexamine; + if (context.flags.z()) + goto walkandexamine; context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) goto noobselect; + if (context.flags.z()) + goto noobselect; context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) goto isntblock; + if (!context.flags.z()) + goto isntblock; context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) goto noobselect; + if (context.flags.c()) + goto noobselect; isntblock: context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) goto wantstowalk; + if (!context.flags.z()) + goto wantstowalk; context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) goto wantstowalk; + if (context.flags.z()) + goto wantstowalk; finishedwalking(context); - if (!context.flags.z()) goto noobselect; + if (!context.flags.z()) + goto noobselect; context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) goto wantstotalk; + if (context.flags.z()) + goto wantstotalk; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto noobselect; + if (!context.flags.z()) + goto noobselect; examineob(context); return; wantstotalk: context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto noobselect; + if (!context.flags.z()) + goto noobselect; talk(context); return; walkandexamine: finishedwalking(context); - if (!context.flags.z()) goto noobselect; + if (!context.flags.z()) + goto noobselect; context.al = context.data.byte(kWalkexamtype); context.data.byte(kCommandtype) = context.al; context.al = context.data.byte(kWalkexamnum); context.data.byte(kCommand) = context.al; context.data.byte(kWalkandexam) = 0; context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) goto noobselect; + if (context.flags.z()) + goto noobselect; examineob(context); return; wantstowalk: @@ -18371,39 +19957,50 @@ diff: context.data.byte(kCommand) = context.al; context.data.byte(kCommandtype) = context.ah; context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); - if (!context.flags.z()) goto middleofwalk; + if (!context.flags.z()) + goto middleofwalk; context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) goto notblock; + if (!context.flags.z()) + goto notblock; context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) goto dontcheck; + if (!context.flags.z()) + goto dontcheck; context.cl = context.data.byte(kRyanx); context._add(context.cl, 12); context.ch = context.data.byte(kRyany); context._add(context.ch, 12); checkone(context); context._cmp(context.cl, 2); - if (context.flags.c()) goto isblock; + if (context.flags.c()) + goto isblock; dontcheck: getflagunderp(context); context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) goto isblock; + if (context.flags.c()) + goto isblock; context._cmp(context.data.byte(kLastflag), 128); - if (!context.flags.c()) goto isblock; + if (!context.flags.c()) + goto isblock; goto toofaraway; notblock: context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) goto toofaraway; + if (!context.flags.z()) + goto toofaraway; context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) goto isblock; + if (context.flags.z()) + goto isblock; context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) goto isaperson; + if (context.flags.z()) + goto isaperson; examineobtext(context); return; middleofwalk: @@ -18422,7 +20019,8 @@ toofaraway: void finishedwalking(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto iswalking; + if (!context.flags.z()) + goto iswalking; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); iswalking: @@ -18477,7 +20075,8 @@ void commandwithob(Context &context) { context.ax = context.pop(); context.di = context.data.word(kLastxpos); context._cmp(context.al, 0); - if (context.flags.z()) goto noadd; + if (context.flags.z()) + goto noadd; context._add(context.di, 5); noadd: context.bx = context.data.word(kTextaddressy); @@ -18564,7 +20163,8 @@ searchmess: findnextcolon(context); context.ax = context.pop(); context._dec(context.ah); - if (!context.flags.z()) goto searchmess; + if (!context.flags.z()) + goto searchmess; context.di = context.pop(); context.bx = context.pop(); context.dx = context.pop(); @@ -18613,20 +20213,26 @@ void getflagunderp(Context &context) { void setwalk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) goto alreadywalking; + if (!context.flags.z()) + goto alreadywalking; context.al = context.data.byte(kPointerspath); context._cmp(context.al, context.data.byte(kManspath)); - if (context.flags.z()) goto cantwalk2; + if (context.flags.z()) + goto cantwalk2; context._cmp(context.data.byte(kWatchmode), 1); - if (context.flags.z()) goto holdingreel; + if (context.flags.z()) + goto holdingreel; context._cmp(context.data.byte(kWatchmode), 2); - if (context.flags.z()) goto cantwalk; + if (context.flags.z()) + goto cantwalk; context.data.byte(kDestination) = context.al; context.data.byte(kFinaldest) = context.al; context._cmp(context.data.word(kMousebutton), 2); - if (!context.flags.z()) goto notwalkandexam; + if (!context.flags.z()) + goto notwalkandexam; context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) goto notwalkandexam; + if (context.flags.z()) + goto notwalkandexam; context.data.byte(kWalkandexam) = 1; context.al = context.data.byte(kCommandtype); context.data.byte(kWalkexamtype) = context.al; @@ -18652,7 +20258,8 @@ void autosetwalk(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kManspath); context._cmp(context.data.byte(kFinaldest), context.al); - if (!context.flags.z()) goto notsamealready; + if (!context.flags.z()) + goto notsamealready; return; notsamealready: getroomspaths(context); @@ -18689,7 +20296,8 @@ notsamealready: context.data.word(kLineendy) = context.ax; bresenhams(context); context._cmp(context.data.byte(kLinedirection), 0); - if (context.flags.z()) goto normalline; + if (context.flags.z()) + goto normalline; context.al = context.data.byte(kLinelength); context._dec(context.al); context.data.byte(kLinepointer) = context.al; @@ -18715,7 +20323,8 @@ checkdestloop: context.dl = context.es.byte(context.bx); context._and(context.dl, 0xf); context._cmp(context.ax, context.dx); - if (!context.flags.z()) goto nextcheck; + if (!context.flags.z()) + goto nextcheck; context.al = context.es.byte(context.bx+1); context._and(context.al, 15); context.data.byte(kDestination) = context.al; @@ -18735,13 +20344,15 @@ nextcheck: context._shl(context.dh, 1); context._shl(context.dh, 1); context._cmp(context.ax, context.dx); - if (!context.flags.z()) goto nextcheck2; + if (!context.flags.z()) + goto nextcheck2; context.ch = context.es.byte(context.bx+1); context._and(context.ch, 15); nextcheck2: context._add(context.bx, 2); context._dec(context.cl); - if (!context.flags.z()) goto checkdestloop; + if (!context.flags.z()) + goto checkdestloop; context.data.byte(kDestination) = context.ch; context.bx = context.pop(); } @@ -18756,8 +20367,10 @@ void bresenhams(Context &context) { context.data.byte(kLinedirection) = 0; context.cx = context.data.word(kLineendx); context._sub(context.cx, context.data.word(kLinestartx)); - if (context.flags.z()) goto vertline; - if (!context.flags.s()) goto line1; + if (context.flags.z()) + goto vertline; + if (!context.flags.s()) + goto line1; context._neg(context.cx); context.bx = context.data.word(kLineendx); context._xchg(context.bx, context.data.word(kLinestartx)); @@ -18769,15 +20382,18 @@ void bresenhams(Context &context) { line1: context.bx = context.data.word(kLineendy); context._sub(context.bx, context.data.word(kLinestarty)); - if (context.flags.z()) goto horizline; - if (!context.flags.s()) goto line3; + if (context.flags.z()) + goto horizline; + if (!context.flags.s()) + goto line3; context._neg(context.bx); context._neg(context.si); line3: context.push(context.si); context.data.byte(kLineroutine) = 0; context._cmp(context.bx, context.cx); - if (context.flags.le()) goto line4; + if (context.flags.le()) + goto line4; context.data.byte(kLineroutine) = 1; context._xchg(context.bx, context.cx); line4: @@ -18793,14 +20409,16 @@ line4: context._inc(context.cx); context.bx = context.pop(); context._cmp(context.data.byte(kLineroutine), 1); - if (context.flags.z()) goto hislope; + if (context.flags.z()) + goto hislope; goto loslope; vertline: context.ax = context.data.word(kLinestarty); context.bx = context.data.word(kLineendy); context.cx = context.bx; context._sub(context.cx, context.ax); - if (!context.flags.l()) goto line31; + if (!context.flags.l()) + goto line31; context._neg(context.cx); context.ax = context.bx; context.data.byte(kLinedirection) = 1; @@ -18813,7 +20431,8 @@ line31: line32: context._stosw(); context._add(context.ah, context.bl); - if (--context.cx) goto line32; + if (--context.cx) + goto line32; goto lineexit; horizline: context.ax = context.data.word(kLinestartx); @@ -18823,35 +20442,42 @@ horizline: horizloop: context._stosw(); context._inc(context.al); - if (--context.cx) goto horizloop; + if (--context.cx) + goto horizloop; goto lineexit; loslope: loloop: context._stosw(); context._inc(context.al); context._or(context.si, context.si); - if (!context.flags.s()) goto line12; + if (!context.flags.s()) + goto line12; context._add(context.si, context.data.word(kIncrement1)); - if (--context.cx) goto loloop; + if (--context.cx) + goto loloop; goto lineexit; line12: context._add(context.si, context.data.word(kIncrement2)); context._add(context.ah, context.bl); - if (--context.cx) goto loloop; + if (--context.cx) + goto loloop; goto lineexit; hislope: hiloop: context._stosw(); context._add(context.ah, context.bl); context._or(context.si, context.si); - if (!context.flags.s()) goto line23; + if (!context.flags.s()) + goto line23; context._add(context.si, context.data.word(kIncrement1)); - if (--context.cx) goto hiloop; + if (--context.cx) + goto hiloop; goto lineexit; line23: context._add(context.si, context.data.word(kIncrement2)); context._inc(context.al); - if (--context.cx) goto hiloop; + if (--context.cx) + goto hiloop; lineexit: context._sub(context.di, 8173); context.ax = context.di; @@ -18866,7 +20492,8 @@ void workoutframes(Context &context) { context.ax = context.data.word(kLineendx); context._add(context.ax, 32); context._sub(context.bx, context.ax); - if (!context.flags.c()) goto notneg1; + if (!context.flags.c()) + goto notneg1; context._neg(context.bx); notneg1: context.cx = context.data.word(kLinestarty); @@ -18874,16 +20501,19 @@ notneg1: context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); - if (!context.flags.c()) goto notneg2; + if (!context.flags.c()) + goto notneg2; context._neg(context.cx); notneg2: context._cmp(context.bx, context.cx); - if (!context.flags.c()) goto tendstohoriz; + if (!context.flags.c()) + goto tendstohoriz; context.dl = 2; context.ax = context.cx; context._shr(context.ax, 1); context._cmp(context.bx, context.ax); - if (context.flags.c()) goto gotquad; + if (context.flags.c()) + goto gotquad; context.dl = 1; goto gotquad; tendstohoriz: @@ -18891,7 +20521,8 @@ tendstohoriz: context.ax = context.bx; context._shr(context.ax, 1); context._cmp(context.cx, context.ax); - if (context.flags.c()) goto gotquad; + if (context.flags.c()) + goto gotquad; context.dl = 1; goto gotquad; gotquad: @@ -18900,15 +20531,18 @@ gotquad: context.ax = context.data.word(kLineendx); context._add(context.ax, 32); context._sub(context.bx, context.ax); - if (context.flags.c()) goto isinright; + if (context.flags.c()) + goto isinright; context.cx = context.data.word(kLinestarty); context._add(context.cx, 32); context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); - if (!context.flags.c()) goto topleft; + if (!context.flags.c()) + goto topleft; context._cmp(context.dl, 1); - if (context.flags.z()) goto noswap1; + if (context.flags.z()) + goto noswap1; context._xor(context.dl, 2); noswap1: context._add(context.dl, 4); @@ -18922,12 +20556,14 @@ isinright: context.ax = context.data.word(kLineendy); context._add(context.ax, 32); context._sub(context.cx, context.ax); - if (!context.flags.c()) goto botright; + if (!context.flags.c()) + goto botright; context._add(context.dl, 2); goto success; botright: context._cmp(context.dl, 1); - if (context.flags.z()) goto noswap2; + if (context.flags.z()) + goto noswap2; context._xor(context.dl, 2); noswap2: success: @@ -18957,18 +20593,22 @@ void copyname(Context &context) { make: context._lodsb(); context._cmp(context.al, ':'); - if (context.flags.z()) goto finishmakename; + if (context.flags.z()) + goto finishmakename; context._cmp(context.al, 0); - if (context.flags.z()) goto finishmakename; + if (context.flags.z()) + goto finishmakename; context._stosb(); - if (--context.cx) goto make; + if (--context.cx) + goto make; finishmakename: context._inc(context.cx); context.al = 0; context._stosb(); return; context.al = 255; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); } void findobname(Context &context) { @@ -18979,7 +20619,8 @@ void findobname(Context &context) { context.bx = context.ax; context.ax = context.pop(); context._cmp(context.ah, 5); - if (!context.flags.z()) goto notpersonname; + if (!context.flags.z()) + goto notpersonname; context.push(context.ax); context._and(context.al, 127); context.ah = 0; @@ -18996,7 +20637,8 @@ void findobname(Context &context) { return; notpersonname: context._cmp(context.ah, 4); - if (!context.flags.z()) goto notextraname; + if (!context.flags.z()) + goto notextraname; context.ds = context.data.word(kExtras); context._add(context.bx, (0+2080+30000+(16*114))); context.ax = context.ds.word(context.bx); @@ -19005,7 +20647,8 @@ notpersonname: return; notextraname: context._cmp(context.ah, 2); - if (!context.flags.z()) goto notfreename; + if (!context.flags.z()) + goto notfreename; context.ds = context.data.word(kFreedesc); context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); @@ -19014,7 +20657,8 @@ notextraname: return; notfreename: context._cmp(context.ah, 1); - if (!context.flags.z()) goto notsetname; + if (!context.flags.z()) + goto notsetname; context.ds = context.data.word(kSetdesc); context._add(context.bx, (0)); context.ax = context.ds.word(context.bx); @@ -19032,7 +20676,8 @@ notsetname: void showicon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 50); - if (!context.flags.c()) goto isdream1; + if (!context.flags.c()) + goto isdream1; showpanel(context); showman(context); roomname(context); @@ -19122,7 +20767,8 @@ void showman(Context &context) { context.ah = 0; showframe(context); context._cmp(context.data.byte(kShadeson), 0); - if (context.flags.z()) goto notverycool; + if (context.flags.z()) + goto notverycool; context.ds = context.data.word(kIcons1); context.di = 28; context.bx = 25; @@ -19158,7 +20804,8 @@ void roomname(Context &context) { printmessage(context); context.bl = context.data.byte(kRoomnum); context._cmp(context.bl, 32); - if (context.flags.c()) goto notover32; + if (context.flags.c()) + goto notover32; context._sub(context.bl, 32); notover32: context.bh = 0; @@ -19173,7 +20820,8 @@ notover32: context.bx = 25; context.dl = 120; context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) goto gotpl; + if (context.flags.z()) + goto gotpl; context.dl = 160; gotpl: context.al = 0; @@ -19209,7 +20857,8 @@ void panelicons1(Context &context) { STACK_CHECK(context); context.di = 0; context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) goto watchison; + if (context.flags.z()) + goto watchison; context.di = 48; watchison: context.push(context.di); @@ -19222,7 +20871,8 @@ watchison: context.di = context.pop(); context.push(context.di); context._cmp(context.data.byte(kZoomon), 1); - if (context.flags.z()) goto zoomisoff; + if (context.flags.z()) + goto zoomisoff; context.ds = context.data.word(kIcons1); context._add(context.di, 228); context.bx = 8; @@ -19237,7 +20887,8 @@ zoomisoff: void showwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) goto nowristwatch; + if (context.flags.z()) + goto nowristwatch; context.ds = context.data.word(kIcons1); context.di = 250; context.bx = 1; @@ -19252,7 +20903,8 @@ nowristwatch: void zoomicon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 0); - if (context.flags.z()) goto nozoom1; + if (context.flags.z()) + goto nozoom1; context.ds = context.data.word(kIcons1); context.di = (8); context.bx = (132)-1; @@ -19266,21 +20918,26 @@ nozoom1: void showblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kManisoffscreen), 1); - if (context.flags.z()) goto finblink1; + if (context.flags.z()) + goto finblink1; context._inc(context.data.byte(kBlinkcount)); context._cmp(context.data.byte(kShadeson), 0); - if (!context.flags.z()) goto finblink1; + if (!context.flags.z()) + goto finblink1; context._cmp(context.data.byte(kReallocation), 50); - if (!context.flags.c()) goto eyesshut; + if (!context.flags.c()) + goto eyesshut; context.al = context.data.byte(kBlinkcount); context._cmp(context.al, 3); - if (!context.flags.z()) goto finblink1; + if (!context.flags.z()) + goto finblink1; context.data.byte(kBlinkcount) = 0; context.al = context.data.byte(kBlinkframe); context._inc(context.al); context.data.byte(kBlinkframe) = context.al; context._cmp(context.al, 6); - if (context.flags.c()) goto nomorethan6; + if (context.flags.c()) + goto nomorethan6; context.al = 6; nomorethan6: context.ah = 0; @@ -19301,12 +20958,15 @@ eyesshut: void dumpblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 0); - if (!context.flags.z()) goto nodumpeye; + if (!context.flags.z()) + goto nodumpeye; context._cmp(context.data.byte(kBlinkcount), 0); - if (!context.flags.z()) goto nodumpeye; + if (!context.flags.z()) + goto nodumpeye; context.al = context.data.byte(kBlinkframe); context._cmp(context.al, 6); - if (!context.flags.c()) goto nodumpeye; + if (!context.flags.c()) + goto nodumpeye; context.push(context.ds); context.di = 44; context.bx = 32; @@ -19331,7 +20991,8 @@ void worktoscreenm(Context &context) { void blank(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 199); - if (context.flags.z()) goto alreadyblnk; + if (context.flags.z()) + goto alreadyblnk; context.data.byte(kCommandtype) = 199; context.al = 0; commandonly(context); @@ -19377,11 +21038,14 @@ hangloop: context.cx = context.pop(); context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 0); - if (context.flags.z()) goto notpressed; + if (context.flags.z()) + goto notpressed; context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) goto getoutofit; + if (!context.flags.z()) + goto getoutofit; notpressed: - if (--context.cx) goto hangloop; + if (--context.cx) + goto hangloop; getoutofit: delpointer(context); context.ax = context.pop(); @@ -19401,7 +21065,8 @@ hangloopw: vsync(context); dumppointer(context); context.cx = context.pop(); - if (--context.cx) goto hangloopw; + if (--context.cx) + goto hangloopw; } void hangoncurs(Context &context) { @@ -19412,7 +21077,8 @@ monloop1: vsync(context); delcurs(context); context.cx = context.pop(); - if (--context.cx) goto monloop1; + if (--context.cx) + goto monloop1; } void getunderzoom(Context &context) { @@ -19429,7 +21095,8 @@ void getunderzoom(Context &context) { void dumpzoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 1); - if (!context.flags.z()) goto notzoomon; + if (!context.flags.z()) + goto notzoomon; context.di = (8)+5; context.bx = (132)+4; context.cl = 46; @@ -19453,9 +21120,11 @@ void putunderzoom(Context &context) { void crosshair(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) goto nocross; + if (context.flags.z()) + goto nocross; context._cmp(context.data.byte(kCommandtype), 10); - if (!context.flags.c()) goto nocross; + if (!context.flags.c()) + goto nocross; context.es = context.data.word(kWorkspace); context.ds = context.data.word(kIcons1); context.di = (8)+24; @@ -19482,7 +21151,8 @@ void showpointer(Context &context) { context.bx = context.data.word(kMousey); context.data.word(kOldpointery) = context.bx; context._cmp(context.data.byte(kPickup), 1); - if (context.flags.z()) goto itsanobject; + if (context.flags.z()) + goto itsanobject; context.push(context.bx); context.push(context.di); context.ds = context.data.word(kIcons1); @@ -19495,11 +21165,13 @@ void showpointer(Context &context) { context._add(context.si, context.ax); context.cx = context.ds.word(context.si); context._cmp(context.cl, 12); - if (!context.flags.c()) goto notsmallx; + if (!context.flags.c()) + goto notsmallx; context.cl = 12; notsmallx: context._cmp(context.ch, 12); - if (!context.flags.c()) goto notsmally; + if (!context.flags.c()) + goto notsmally; context.ch = 12; notsmally: context.data.byte(kPointerxs) = context.cl; @@ -19524,7 +21196,8 @@ itsanobject: context.al = context.data.byte(kItemframe); context.ds = context.data.word(kExtras); context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) goto itsfrominv; + if (context.flags.z()) + goto itsfrominv; context.ds = context.data.word(kFreeframes); itsfrominv: context.cl = context.al; @@ -19540,11 +21213,13 @@ itsfrominv: context.ax = 2080; context.cx = context.ds.word(context.si); context._cmp(context.cl, 12); - if (!context.flags.c()) goto notsmallx2; + if (!context.flags.c()) + goto notsmallx2; context.cl = 12; notsmallx2: context._cmp(context.ch, 12); - if (!context.flags.c()) goto notsmally2; + if (!context.flags.c()) + goto notsmally2; context.ch = 12; notsmally2: context.data.byte(kPointerxs) = context.cl; @@ -19586,7 +21261,8 @@ void delpointer(Context &context) { STACK_CHECK(context); context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) goto nevershown; + if (context.flags.z()) + goto nevershown; context.data.word(kDelherex) = context.ax; context.ax = context.data.word(kOldpointery); context.data.word(kDelherey) = context.ax; @@ -19614,9 +21290,11 @@ void dumppointer(Context &context) { context.bx = context.data.word(kOldpointery); context.di = context.data.word(kOldpointerx); context._cmp(context.di, context.data.word(kDelherex)); - if (!context.flags.z()) goto difffound; + if (!context.flags.z()) + goto difffound; context._cmp(context.bx, context.data.word(kDelherey)); - if (context.flags.z()) goto notboth; + if (context.flags.z()) + goto notboth; difffound: context.cl = context.data.byte(kPointerxs); context.ch = context.data.byte(kPointerys); @@ -19650,7 +21328,8 @@ void deltextline(Context &context) { void dumptextline(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewtextline), 1); - if (!context.flags.z()) goto nodumptextline; + if (!context.flags.z()) + goto nodumptextline; context.data.byte(kNewtextline) = 0; context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); @@ -19664,49 +21343,62 @@ nodumptextline: void animpointer(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) goto combathand; + if (context.flags.z()) + goto combathand; context._cmp(context.data.byte(kPointermode), 3); - if (context.flags.z()) goto mousehand; + if (context.flags.z()) + goto mousehand; context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) goto notwatchpoint; + if (context.flags.z()) + goto notwatchpoint; context.data.byte(kPointerframe) = 11; return; notwatchpoint: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kInmaparea), 0); - if (context.flags.z()) goto gothand; + if (context.flags.z()) + goto gothand; context._cmp(context.data.byte(kPointerfirstpath), 0); - if (context.flags.z()) goto gothand; + if (context.flags.z()) + goto gothand; getflagunderp(context); context._cmp(context.cl, 2); - if (context.flags.c()) goto gothand; + if (context.flags.c()) + goto gothand; context._cmp(context.cl, 128); - if (!context.flags.c()) goto gothand; + if (!context.flags.c()) + goto gothand; context.data.byte(kPointerframe) = 3; context._test(context.cl, 4); - if (!context.flags.z()) goto gothand; + if (!context.flags.z()) + goto gothand; context.data.byte(kPointerframe) = 4; context._test(context.cl, 16); - if (!context.flags.z()) goto gothand; + if (!context.flags.z()) + goto gothand; context.data.byte(kPointerframe) = 5; context._test(context.cl, 2); - if (!context.flags.z()) goto gothand; + if (!context.flags.z()) + goto gothand; context.data.byte(kPointerframe) = 6; context._test(context.cl, 8); - if (!context.flags.z()) goto gothand; + if (!context.flags.z()) + goto gothand; context.data.byte(kPointerframe) = 8; gothand: return; mousehand: context._cmp(context.data.byte(kPointerspeed), 0); - if (context.flags.z()) goto rightspeed3; + if (context.flags.z()) + goto rightspeed3; context._dec(context.data.byte(kPointerspeed)); goto finflashmouse; rightspeed3: context.data.byte(kPointerspeed) = 5; context._inc(context.data.byte(kPointercount)); context._cmp(context.data.byte(kPointercount), 16); - if (!context.flags.z()) goto finflashmouse; + if (!context.flags.z()) + goto finflashmouse; context.data.byte(kPointercount) = 0; finflashmouse: context.al = context.data.byte(kPointercount); @@ -19719,9 +21411,11 @@ finflashmouse: combathand: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kReallocation), 14); - if (!context.flags.z()) goto notarrow; + if (!context.flags.z()) + goto notarrow; context._cmp(context.data.byte(kCommandtype), 211); - if (!context.flags.z()) goto notarrow; + if (!context.flags.z()) + goto notarrow; context.data.byte(kPointerframe) = 5; notarrow: return; @@ -19799,7 +21493,8 @@ void readkey(Context &context) { STACK_CHECK(context); context.bx = context.data.word(kBufferout); context._cmp(context.bx, context.data.word(kBufferin)); - if (context.flags.z()) goto nokey; + if (context.flags.z()) + goto nokey; context._inc(context.bx); context._and(context.bx, 15); context.data.word(kBufferout) = context.bx; @@ -19858,7 +21553,8 @@ hangonloop: context.push(context.cx); vsync(context); context.cx = context.pop(); - if (--context.cx) goto hangonloop; + if (--context.cx) + goto hangonloop; } void loadtraveltext(Context &context) { @@ -19943,9 +21639,11 @@ void loadroomssample(Context &context) { STACK_CHECK(context); context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); - if (context.flags.z()) goto loadedalready; + if (context.flags.z()) + goto loadedalready; context._cmp(context.al, context.data.byte(kCurrentsample)); - if (context.flags.z()) goto loadedalready; + if (context.flags.z()) + goto loadedalready; context.data.byte(kCurrentsample) = context.al; context.al = context.data.byte(kCurrentsample); context.cl = '0'; @@ -19962,7 +21660,8 @@ loadedalready: void getridofreels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); - if (context.flags.z()) goto dontgetrid; + if (context.flags.z()) + goto dontgetrid; context.es = context.data.word(kReel1); deallocatemem(context); context.es = context.data.word(kReel2); @@ -20004,7 +21703,8 @@ void getridofall(Context &context) { void restorereels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); - if (context.flags.z()) goto dontrestore; + if (context.flags.z()) + goto dontrestore; context.al = context.data.byte(kReallocation); getroomdata(context); context.dx = context.bx; @@ -20127,11 +21827,13 @@ blimey: context.push(context.cx); context.push(context.si); context.cx = (66); - while(context.cx--) context._movsb(); - context.si = context.pop(); + while(context.cx--) + context._movsb(); + context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 132); - if (--context.cx) goto blimey; + if (--context.cx) + goto blimey; context.di = context.pop(); context.es = context.pop(); } @@ -20262,7 +21964,8 @@ void startloading(Context &context) { context.data.byte(kLinepointer) = 254; context.ax = context.pop(); context._cmp(context.al, 255); - if (context.flags.z()) goto dontwalkin; + if (context.flags.z()) + goto dontwalkin; context.data.byte(kManspath) = context.al; context.push(context.bx); autosetwalk(context); @@ -20279,13 +21982,15 @@ void disablepath(Context &context) { looky2: context._add(context.cx, 6); context._sub(context.al, 10); - if (!context.flags.c()) goto looky2; + if (!context.flags.c()) + goto looky2; context.al = context.ah; context._dec(context.cx); lookx2: context._inc(context.cx); context._sub(context.al, 11); - if (!context.flags.c()) goto lookx2; + if (!context.flags.c()) + goto lookx2; context.al = context.cl; context.ah = 0; context.cx = 144; @@ -20326,13 +22031,15 @@ void findroominloc(Context &context) { looky: context._add(context.cx, 6); context._sub(context.al, 10); - if (!context.flags.c()) goto looky; + if (!context.flags.c()) + goto looky; context.al = context.data.byte(kMapx); context._dec(context.cx); lookx: context._inc(context.cx); context._sub(context.al, 11); - if (!context.flags.c()) goto lookx; + if (!context.flags.c()) + goto lookx; context.data.byte(kRoomnum) = context.cl; } @@ -20376,7 +22083,8 @@ void fillspace(Context &context) { context.push(context.bx); context.di = context.dx; context.es = context.ds; - while(context.cx--) context._stosb(); + while(context.cx--) + context._stosb(); context.bx = context.pop(); context.di = context.pop(); context.dx = context.pop(); @@ -20443,7 +22151,8 @@ void readsetdata(Context &context) { context.ax = context.data.word(kCharset1); context.data.word(kCurrentset) = context.ax; context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) goto novolumeload; + if (context.flags.z()) + goto novolumeload; context.dx = 2286; openfile(context); context.cx = 2048-256; @@ -20465,7 +22174,8 @@ transfer: context._inc(context.si); context._inc(context.di); context._cmp(context.al, 0); - if (!context.flags.z()) goto transfer; + if (!context.flags.z()) + goto transfer; context.dx = 6059; } @@ -20490,7 +22200,8 @@ void dreamweb(Context &context) { setsoundoff(context); scanfornames(context); context._cmp(context.al, 0); - if (!context.flags.z()) goto dodecisions; + if (!context.flags.z()) + goto dodecisions; setmode(context); loadpalfromiff(context); titles(context); @@ -20501,7 +22212,8 @@ dodecisions: setmode(context); decide(context); context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) goto mainloop; + if (context.flags.z()) + goto mainloop; titles(context); credits(context); playgame: @@ -20545,23 +22257,31 @@ loadnew: mainloop: screenupdate(context); context._cmp(context.data.byte(kWongame), 0); - if (!context.flags.z()) goto endofgame; + if (!context.flags.z()) + goto endofgame; context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) goto gameover; + if (context.flags.z()) + goto gameover; context._cmp(context.data.byte(kMandead), 2); - if (context.flags.z()) goto gameover; + if (context.flags.z()) + goto gameover; context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) goto notwatching; + if (context.flags.z()) + goto notwatching; context.al = context.data.byte(kFinaldest); context._cmp(context.al, context.data.byte(kManspath)); - if (!context.flags.z()) goto mainloop; + if (!context.flags.z()) + goto mainloop; context._dec(context.data.word(kWatchingtime)); - if (!context.flags.z()) goto mainloop; + if (!context.flags.z()) + goto mainloop; notwatching: context._cmp(context.data.byte(kMandead), 4); - if (context.flags.z()) goto gameover; + if (context.flags.z()) + goto gameover; context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) goto loadnew; + if (!context.flags.z()) + goto loadnew; goto mainloop; gameover: clearbeforeload(context); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5ded297e36..5dd8e847c1 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -6,7 +6,7 @@ #include "dreamweb/runtime.h" -namespace dreamgen { +namespace DreamGen { void __dispatch_call(Context &context, unsigned addr); void __start(Context &context); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 619f0dddfe..37d47b26c5 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -42,10 +42,10 @@ #include "dreamweb/dreamweb.h" #include "dreamweb/dreamgen.h" -namespace dreamgen { - void doshake(dreamgen::Context &context); - void dofade(dreamgen::Context &context); - void volumeadjust(dreamgen::Context &context); +namespace DreamGen { + void doshake(DreamGen::Context &context); + void dofade(DreamGen::Context &context); + void volumeadjust(DreamGen::Context &context); } namespace DreamWeb { @@ -100,8 +100,8 @@ void DreamWebEngine::waitForVSync() { setVSyncInterrupt(false); } - dreamgen::doshake(_context); - dreamgen::dofade(_context); + DreamGen::doshake(_context); + DreamGen::dofade(_context); _system->updateScreen(); } @@ -139,8 +139,8 @@ void DreamWebEngine::processEvents() { break; case Common::KEYCODE_c: //skip statue puzzle - _context.data.byte(dreamgen::kSymbolbotnum) = 3; - _context.data.byte(dreamgen::kSymboltopnum) = 5; + _context.data.byte(DreamGen::kSymbolbotnum) = 3; + _context.data.byte(DreamGen::kSymboltopnum) = 5; break; default: @@ -170,7 +170,7 @@ void DreamWebEngine::processEvents() { break; } - _context.data.byte(dreamgen::kLasthardkey) = hardKey; + _context.data.byte(DreamGen::kLasthardkey) = hardKey; // The rest of the keys are converted to ASCII. This // is fairly restrictive, and eventually we may want @@ -213,7 +213,7 @@ Common::Error DreamWebEngine::run() { getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); //http://martin.hinner.info/vga/timing.html - dreamgen::__start(_context); + DreamGen::__start(_context); getTimerManager()->removeTimerProc(vSyncInterrupt); @@ -294,13 +294,13 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { 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::kBufferin) + 1) & 0x0f; - uint16 out = _context.data.word(dreamgen::kBufferout); + uint16 in = (_context.data.word(DreamGen::kBufferin) + 1) & 0x0f; + uint16 out = _context.data.word(DreamGen::kBufferout); if (in == out) { warning("keyboard buffer is full"); return; } - _context.data.word(dreamgen::kBufferin) = in; + _context.data.word(DreamGen::kBufferin) = in; keybuf[in] = ascii; } @@ -326,11 +326,11 @@ void DreamWebEngine::mouseCall() { } void DreamWebEngine::fadeDos() { - _context.ds = _context.es = _context.data.word(dreamgen::kBuffers); + _context.ds = _context.es = _context.data.word(DreamGen::kBuffers); return; //fixme later waitForVSync(); //processEvents will be called from vsync - uint8 *dst = _context.es.ptr(dreamgen::kStartpal, 768); + uint8 *dst = _context.es.ptr(DreamGen::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 @@ -379,9 +379,9 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int } void DreamWebEngine::printUnderMonitor() { - _context.es = _context.data.word(dreamgen::kWorkspace); - _context.di = dreamgen::kScreenwidth * 43 + 76; - _context.si = _context.di + 8 * dreamgen::kScreenwidth; + _context.es = _context.data.word(DreamGen::kWorkspace); + _context.di = DreamGen::kScreenwidth * 43 + 76; + _context.si = _context.di + 8 * DreamGen::kScreenwidth; Graphics::Surface *s = _system->lockScreen(); if (!s) @@ -397,8 +397,8 @@ void DreamWebEngine::printUnderMonitor() { ++dst; ++src; } } - _context._add(_context.di, dreamgen::kScreenwidth); - _context._add(_context.si, dreamgen::kScreenwidth); + _context._add(_context.di, DreamGen::kScreenwidth); + _context._add(_context.si, DreamGen::kScreenwidth); } _context.cx = 0; _system->unlockScreen(); @@ -480,7 +480,7 @@ void DreamWebEngine::soundHandler() { volumeadjust(_context); _context.ax = _context.pop(); - uint volume = _context.data.byte(dreamgen::kVolume); + uint volume = _context.data.byte(DreamGen::kVolume); //.vol file loaded into soundbuf:0x4000 //volume table at (volume * 0x100 + 0x3f00) //volume value could be from 1 to 7 @@ -496,13 +496,13 @@ void DreamWebEngine::soundHandler() { volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; _mixer->setChannelVolume(_channelHandle[0], volume); - uint8 ch0 = _context.data.byte(dreamgen::kCh0playing); + uint8 ch0 = _context.data.byte(DreamGen::kCh0playing); if (ch0 == 255) ch0 = 0; - uint8 ch1 = _context.data.byte(dreamgen::kCh1playing); + uint8 ch1 = _context.data.byte(DreamGen::kCh1playing); if (ch1 == 255) ch1 = 0; - uint8 ch0loop = _context.data.byte(dreamgen::kCh0repeat); + uint8 ch0loop = _context.data.byte(DreamGen::kCh0repeat); if (_channel0 != ch0) { _channel0 = ch0; @@ -517,11 +517,11 @@ void DreamWebEngine::soundHandler() { } } if (!_mixer->isSoundHandleActive(_channelHandle[0])) { - _context.data.byte(dreamgen::kCh0playing) = 255; + _context.data.byte(DreamGen::kCh0playing) = 255; _channel0 = 0; } if (!_mixer->isSoundHandleActive(_channelHandle[1])) { - _context.data.byte(dreamgen::kCh1playing) = 255; + _context.data.byte(DreamGen::kCh1playing) = 255; _channel1 = 0; } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 9ed02b6283..7ccc0e6cd3 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -74,7 +74,6 @@ public: bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); -//dreamgen public api: uint8 randomNumber() { return _rnd.getRandomNumber(255); } void openFile(const Common::String &name); @@ -139,7 +138,7 @@ private: Audio::SoundHandle _channelHandle[2]; uint8 _channel0, _channel1; - dreamgen::Context _context; + DreamGen::Context _context; }; } // End of namespace DreamWeb diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 3b97ce1930..8932e123a8 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -13,7 +13,7 @@ namespace DreamWeb { class DreamWebEngine; } -namespace dreamgen { +namespace DreamGen { //fixme: name clash #undef random diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1a6cb7685d..129186ca07 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -2,7 +2,7 @@ #include "engines/util.h" #include "graphics/surface.h" -namespace dreamgen { +namespace DreamGen { Common::String getFilename(Context &context) { uint16 name_ptr = context.dx; -- cgit v1.2.3 From d8d16e0231272e73f72630c5a1966db6f1e29809 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 16 Jun 2011 16:44:58 +0400 Subject: DREAMWEB: removed while loops from rep+stos/movs instructions --- devtools/tasmrecover/tasm/proc.py | 14 ++++ engines/dreamweb/dreamgen.cpp | 171 +++++++++++++------------------------- 2 files changed, 71 insertions(+), 114 deletions(-) diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 3c4ac21372..1350ea1e0b 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -34,6 +34,9 @@ class proc: if not isinstance(stmts[i], cls): i += 1 continue + if i > 0 and isinstance(stmts[i - 1], op._rep): #skip rep prefixed instructions for now + i += 1 + continue j = i + 1 while j < len(stmts): @@ -49,6 +52,17 @@ class proc: else: i = j + i = 0 + while i < len(stmts): + if not isinstance(stmts[i], op._rep): + i += 1 + continue + if i + 1 >= len(stmts): + break + if isinstance(stmts[i + 1], cls): + stmts[i + 1].repeat = 'context.cx' + del stmts[i] + i += 1 return def optimize(self): diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index e6b6d738fd..ba1e5ba159 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2711,8 +2711,7 @@ void clearsprites(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.al = 255; context.cx = (32)*16; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); } void makesprite(Context &context) { @@ -2740,8 +2739,7 @@ void delsprite(Context &context) { context.di = context.bx; context.cx = (32); context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); } void spriteupdate(Context &context) { @@ -4082,8 +4080,7 @@ void updatepeople(Context &context) { context.data.word(kListpos) = context.di; context.cx = 12*5; context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context._inc(context.data.word(kMaintimer)); context.es = context.cs; context.bx = 534; @@ -4726,8 +4723,7 @@ void delthisone(Context &context) { deloneloop: context.push(context.cx); context.ch = 0; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.cx = context.pop(); context._add(context.di, context.ax); context._add(context.si, context.dx); @@ -5093,8 +5089,7 @@ void transferinv(Context &context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; @@ -5141,8 +5136,7 @@ void transfermap(Context &context) { context._mul(context.cx); context.cx = context.ax; context.push(context.cx); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.cx = context.pop(); context.ax = context.pop(); context.es.word(context.bx+2) = context.ax; @@ -5181,8 +5175,7 @@ void clearendpal(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); } void clearpalette(Context &context) { @@ -5208,8 +5201,7 @@ void fadetowhite(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.cx = 768; context.al = 63; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.al = 0; context._stosb(3); @@ -5226,8 +5218,7 @@ void fadefromwhite(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768; context.al = 63; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.al = 0; context._stosb(3); @@ -5267,13 +5258,11 @@ halfend: context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); context.cx = 3*5; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); context.cx = 3*2; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.data.byte(kFadedirection) = 1; context.data.byte(kFadecount) = 31; context.data.byte(kColourpos) = 0; @@ -5583,8 +5572,7 @@ void paltostartpal(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); } void endpaltostart(Context &context) { @@ -5594,8 +5582,7 @@ void endpaltostart(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); } void startpaltoend(Context &context) { @@ -5605,8 +5592,7 @@ void startpaltoend(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.cx = 768/2; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); } void paltoendpal(Context &context) { @@ -5616,8 +5602,7 @@ void paltoendpal(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); } void allpalette(Context &context) { @@ -5627,8 +5612,7 @@ void allpalette(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); context.cx = 768/2; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); dumpcurrent(context); } @@ -5654,8 +5638,7 @@ void fadedownmon(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5675,8 +5658,7 @@ void fadeupmon(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5696,8 +5678,7 @@ void fadeupmonfirst(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -5720,8 +5701,7 @@ void fadeupyellows(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); context.cx = 3*8; context.ax = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); context._stosb(); context._stosw(); @@ -5740,8 +5720,7 @@ void initialmoncols(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); context.cx = 3*9; context.ax = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); context._stosb(); context._stosw(); @@ -6718,8 +6697,7 @@ void findallryan(Context &context) { context.push(context.di); context.cx = 30; context.ax = 0x0ffff; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.di = context.pop(); context.cl = 4; context.ds = context.data.word(kExtras); @@ -6754,8 +6732,7 @@ void findallopen(Context &context) { context.push(context.di); context.cx = 16; context.ax = 0x0ffff; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.di = context.pop(); context.cl = context.data.byte(kOpenedob); context.dl = context.data.byte(kOpenedtype); @@ -8572,8 +8549,7 @@ void transfertoex(Context &context) { context.ds = context.data.word(kFreedat); context.si = context.ax; context.cx = 8; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); context.di = context.pop(); context.al = context.data.byte(kReallocation); context.es.byte(context.di) = context.al; @@ -8653,8 +8629,7 @@ void transfercontoex(Context &context) { context.ds = context.pop(); context.push(context.di); context.cx = 8; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); context.di = context.pop(); context.dx = context.pop(); context.al = context.data.byte(kReallocation); @@ -8830,8 +8805,7 @@ void deleteexobject(Context &context) { context.push(context.cx); context.al = 255; context.cx = 16; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.ax = context.pop(); context.cl = context.al; context._add(context.al, context.al); @@ -8891,8 +8865,7 @@ void deleteexframe(Context &context) { context._add(context.si, context.ax); context.push(context.ax); context.ds = context.es; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.bx = context.pop(); context._sub(context.data.word(kExframepos), context.bx); context.si = context.pop(); @@ -8936,8 +8909,7 @@ findlenextext: context.push(context.bx); context.push(context.ax); context._sub(context.cx, context.bx); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.bx = context.pop(); context._sub(context.data.word(kExtextpos), context.bx); context.si = context.pop(); @@ -9185,8 +9157,7 @@ oberase: context.di = context.bx; context.al = 255; context.cx = (32); - while(context.cx--) - context._stosb(); + context._stosb(context.cx); notthisob: context.bx = context.pop(); context.cx = context.pop(); @@ -9205,8 +9176,7 @@ void showallobs(Context &context) { context.di = context.bx; context.cx = 128*5; context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.es = context.data.word(kSetframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -9331,8 +9301,7 @@ void showallfree(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); context.cx = 80*5; context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.es = context.data.word(kFreeframes); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -9415,8 +9384,7 @@ void showallex(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); context.cx = 100*5; context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.es = context.data.word(kExtras); context.data.word(kFrsegment) = context.es; context.ax = (0); @@ -10623,14 +10591,12 @@ void usemon(Context &context) { context.di = 2970+1; context.cx = 12; context.al = 32; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.es = context.cs; context.di = 2942+1; context.cx = 12; context.al = 32; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.es = context.cs; context.di = 2836; context.es.byte(context.di) = 1; @@ -11001,8 +10967,7 @@ void input(Context &context) { context.di = 8045; context.cx = 64; context.al = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.data.word(kCurpos) = 0; context.al = '>'; context.di = context.data.word(kMonadx); @@ -11240,8 +11205,7 @@ dirroot: context.di = 2970; context._inc(context.di); context.cx = 12; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); monitorlogo(context); scrollmonitor(context); context.al = 9; @@ -11545,8 +11509,7 @@ keyok2: context.es = context.cs; context.di = 2970+1; context.cx = 12; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); monitorlogo(context); scrollmonitor(context); context.al = 10; @@ -11666,8 +11629,7 @@ void parser(Context &context) { context.di = 2942; context.cx = 13; context.al = 0; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.di = 2942; context.al = '='; context._stosb(); @@ -17017,8 +16979,7 @@ alreadyactsave: context.bx = context.di; context.es = context.cs; context.cx = 16; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); context.al = context.data.byte(kRoomssample); context.es.byte(context.bx+13) = context.al; context.al = context.data.byte(kMapx); @@ -17376,8 +17337,7 @@ void namestoold(Context &context) { context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.es = context.data.word(kBuffers); context.cx = 17*4; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); } void oldtonames(Context &context) { @@ -17387,8 +17347,7 @@ void oldtonames(Context &context) { context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); context.ds = context.data.word(kBuffers); context.cx = 17*4; - while(context.cx--) - context._movsb(); + context._movsb(context.cx); } void saveposition(Context &context) { @@ -17797,8 +17756,7 @@ void trysoundalloc(Context &context) { context.di = 0; context.cx = 16384/2; context.ax = 0x7f7f; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.data.byte(kNeedsoundbuff) = 1; return; soundfail: @@ -17940,8 +17898,7 @@ notch0only: context.di = context.data.word(kSoundbufferwrite); context.cx = 1024; context.ax = 0x7f7f; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context._and(context.di, 16384-1); context.data.word(kSoundbufferwrite) = context.di; } @@ -18013,8 +17970,7 @@ void channel0tran(Context &context) { if (!context.flags.z()) goto lowvolumetran; context.cx = 1024; - while(context.cx--) - context._movsw(); + context._movsw(context.cx); return; lowvolumetran: context.cx = 1024; @@ -18465,28 +18421,24 @@ void clearbuffers(Context &context) { context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; context.ax = 0; context.di = 0; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.es = context.data.word(kExtras); context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)+(6*64)); context.ds = context.cs; context.si = 534; context.cx = (991-534); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.es = context.data.word(kBuffers); context.di = (0+(180*10)+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*24)+(6*64)+991-534); context.ds = context.cs; context.si = 0; context.cx = (68-0); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); clearchanges(context); } @@ -18496,22 +18448,19 @@ void clearchanges(Context &context) { context.cx = (250)*2; context.ax = 0x0ffff; context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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*24)+(6*64)); context.es = context.cs; context.di = 534; context.cx = (991-534); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.ds = context.data.word(kBuffers); context.si = (0+(180*10)+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*24)+(6*64)+991-534); context.es = context.cs; context.di = 0; context.cx = (68-0); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.data.byte(kExpos) = 0; context.data.word(kExframepos) = 0; context.data.word(kExtextpos) = 0; @@ -18519,8 +18468,7 @@ void clearchanges(Context &context) { context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; context.ax = 0x0ffff; context.di = 0; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.es = context.cs; context.di = 8011; context.al = 1; @@ -18531,8 +18479,7 @@ void clearchanges(Context &context) { context._stosb(); context.ax = 0; context.cx = 6; - while(context.cx--) - context._stosw(); + context._stosw(context.cx); } void clearbeforeload(Context &context) { @@ -18563,8 +18510,7 @@ void clearrest(Context &context) { context.cx = (66*60)/2; context.ax = 0; context.di = (0); - while(context.cx--) - context._stosw(); + context._stosw(context.cx); context.es = context.data.word(kBackdrop); deallocatemem(context); context.es = context.data.word(kSetframes); @@ -20607,8 +20553,7 @@ finishmakename: context._stosb(); return; context.al = 255; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); } void findobname(Context &context) { @@ -21827,8 +21772,7 @@ blimey: context.push(context.cx); context.push(context.si); context.cx = (66); - while(context.cx--) - context._movsb(); + context._movsb(context.cx); context.si = context.pop(); context.cx = context.pop(); context._add(context.si, 132); @@ -22083,8 +22027,7 @@ void fillspace(Context &context) { context.push(context.bx); context.di = context.dx; context.es = context.ds; - while(context.cx--) - context._stosb(); + context._stosb(context.cx); context.bx = context.pop(); context.di = context.pop(); context.dx = context.pop(); -- cgit v1.2.3 From 7428e646d51ae0c666621fe0f407ad1096c6566e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Jun 2011 23:30:15 +1000 Subject: TSAGE: Minor bugfix to sound fading code --- engines/tsage/sound.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 61254bb21f..79cd08b6fc 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -382,7 +382,7 @@ void SoundManager::_sfProcessFading() { sfManager()._needToRethink = true; } - if (s->_fadeDest != 255) { + if (s->_fadeDest != -1) { if (s->_fadeCounter != 0) --s->_fadeCounter; else { @@ -2382,7 +2382,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _sampleRate = _mixer->getOutputRate(); _opl = makeAdLibOPL(_sampleRate); - memset(_channelVoiced, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); @@ -2518,7 +2518,7 @@ static int num = 1; ++num; */ debugN("%d [%x]=%x ", num++, reg, value);//***DEBUG**** - for (int idx = 0; idx < 16; ++idx) debugN("%d", _channelVoiced[idx] ? 1 : 0); + for (int idx = 0; idx < ADLIB_CHANNEL_COUNT; ++idx) debugN("%d", _channelVoiced[idx] ? 1 : 0); debugN("\n"); _portContents[reg] = value; -- cgit v1.2.3 From 287c23f1263c77fa04d2a697f441d362ed419b5d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 16 Jun 2011 15:33:26 +0200 Subject: DREAMWEB: Try to clean up jumps to returns --- devtools/tasmrecover/tasm/cpp.py | 4 + devtools/tasmrecover/tasm/proc.py | 40 +- engines/dreamweb/dreamgen.cpp | 951 ++++++++++++-------------------------- 3 files changed, 334 insertions(+), 661 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 3e5ae78438..5d460961a6 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -241,6 +241,9 @@ namespace %s { self.add_forward(name) return "{ %s(context); return; }" %name else: + # TODO: name or self.resolve_label(name) or self.mangle_label(name)?? + if name in self.proc.retlabels: + return "return /* (%s) */" % (name,) return "goto %s" %self.resolve_label(name) def _label(self, name): @@ -443,6 +446,7 @@ namespace %s { self.proc = proc_module.proc(name) self.proc.stmts = copy(src_proc.stmts) self.proc.labels = copy(src_proc.labels) + self.proc.retlabels = copy(src_proc.retlabels) #for p in xrange(skip, len(self.proc.stmts)): # s = self.proc.stmts[p] # if isinstance(s, op.basejmp): diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 1350ea1e0b..e5af1afae5 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -9,6 +9,7 @@ class proc: self.calls = [] self.stmts = [] self.labels = set() + self.retlabels = set() self.__label_re = re.compile(r'^(\S+):(.*)$') self.offset = proc.last_addr proc.last_addr += 4 @@ -67,13 +68,20 @@ class proc: def optimize(self): print "optimizing..." - #trivial simplifications, removing last ret + #trivial simplifications while len(self.stmts) and isinstance(self.stmts[-1], op.label): print "stripping last label" self.stmts.pop() - if isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): - print "stripping last ret" - self.stmts.pop() + #mark labels that directly precede a ret + for i in range(len(self.stmts)): + if not isinstance(self.stmts[i], op.label): + continue + j = i + while j < len(self.stmts) and isinstance(self.stmts[j], op.label): + j += 1 + if j == len(self.stmts) or isinstance(self.stmts[j], op._ret): + print "Return label: %s" % (self.stmts[i].name,) + self.retlabels.add(self.stmts[i].name) #merging push ax pop bx constructs i = 0 while i + 1 < len(self.stmts): @@ -102,15 +110,29 @@ class proc: continue print "checking label %s..." %s.name used = False - for j in self.stmts: - if isinstance(j, op.basejmp) and j.label == s.name: - print "used" - used = True - break + if s.name not in self.retlabels: + for j in self.stmts: + if isinstance(j, op.basejmp) and j.label == s.name: + print "used" + used = True + break if not used: print self.labels self.remove_label(s.name) + #removing duplicate rets + i = 0 + while i < len(self.stmts)-1: + if isinstance(self.stmts[i], op._ret) and isinstance(self.stmts[i+1], op._ret): + del self.stmts[i] + else: + i += 1 + + #removing last ret + while len(self.stmts) > 0 and isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): + print "stripping last ret" + self.stmts.pop() + self.optimize_sequence(op._stosb); self.optimize_sequence(op._stosw); self.optimize_sequence(op._movsb); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index ba1e5ba159..000b6d7e43 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -504,11 +504,9 @@ void foghornsound(Context &context) { randomnumber(context); context._cmp(context.al, 198); if (!context.flags.z()) - goto nofog; + return /* (nofog) */; context.al = 13; playchannel1(context); -nofog: - return; } void receptionist(Context &context) { @@ -556,10 +554,8 @@ gotrecep: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) - goto nottalkedrecep; + return /* (nottalkedrecep) */; context.data.byte(kTalkedtorecep) = 1; -nottalkedrecep: - return; } void smokebloke(Context &context) { @@ -610,10 +606,8 @@ void attendant(Context &context) { context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) - goto nottalked; + return /* (nottalked) */; context.data.byte(kTalkedtoattendant) = 1; -nottalked: - return; } void manasleep(Context &context) { @@ -629,11 +623,9 @@ void eden(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) - goto notinbed; + return /* (notinbed) */; showgamereel(context); addtopeoplelist(context); -notinbed: - return; } void edeninbath(Context &context) { @@ -643,11 +635,9 @@ void edeninbath(Context &context) { goto notinbed; context._cmp(context.data.byte(kSartaindead), 0); if (!context.flags.z()) - goto notinbath; + return /* (notinbath) */; showgamereel(context); addtopeoplelist(context); -notinbath: - return; /*continuing to unbounded code: notinbed from eden:5-6*/ notinbed: return; @@ -670,18 +660,16 @@ void louis(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (!context.flags.z()) - goto notlouis1; + return /* (notlouis1) */; showgamereel(context); addtopeoplelist(context); -notlouis1: - return; } void louischair(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) - goto notlouis2; + return /* (notlouis2) */; checkspeed(context); if (!context.flags.z()) goto notlouisanim; @@ -707,8 +695,6 @@ restartlouis: notlouisanim: showgamereel(context); addtopeoplelist(context); -notlouis2: - return; } void manasleep2(Context &context) { @@ -994,7 +980,7 @@ void mugger(Context &context) { goto endmugger1; context._cmp(context.ax, 176); if (context.flags.z()) - goto endmugger2; + return /* (endmugger2) */; context._cmp(context.ax, 2); if (!context.flags.z()) goto havesetwatch; @@ -1059,9 +1045,6 @@ endmugger1: context.data.byte(kBeenmugged) = 1; context.bx = context.pop(); context.es = context.pop(); - return; -endmugger2: - return; } void aide(Context &context) { @@ -1096,7 +1079,7 @@ notfirstbiz: goto buscombatwonend; context._cmp(context.ax, 49); if (context.flags.z()) - goto buscombatend; + return /* (buscombatend) */; checkspeed(context); if (!context.flags.z()) goto busspeed; @@ -1158,12 +1141,10 @@ busspeed: context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 14); if (!context.flags.z()) - goto buscombatend; + return /* (buscombatend) */; context.data.word(kWatchingtime) = 0; context.data.byte(kPointermode) = 2; return; -buscombatend: - return; buscombatwonend: context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 0; @@ -1261,11 +1242,9 @@ combatover2: context._inc(context.data.byte(kCombatcount)); context._cmp(context.data.byte(kCombatcount), 100); if (context.flags.c()) - goto doneover2; + return /* (doneover2) */; context.data.word(kWatchingtime) = 0; context.data.byte(kMandead) = 2; -doneover2: - return; } void security(Context &context) { @@ -1390,10 +1369,8 @@ notboss: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) - goto nottalkedboss; + return /* (nottalkedboss) */; context.data.byte(kTalkedtoboss) = 1; -nottalkedboss: - return; } void gamer(Context &context) { @@ -1422,23 +1399,19 @@ void sparkydrip(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) - goto cantdrip; + return /* (cantdrip) */; context.al = 14; context.ah = 0; playchannel0(context); -cantdrip: - return; } void carparkdrip(Context &context) { STACK_CHECK(context); checkspeed(context); if (!context.flags.z()) - goto cantdrip2; + return /* (cantdrip2) */; context.al = 14; playchannel1(context); -cantdrip2: - return; } void keeper(Context &context) { @@ -1448,22 +1421,19 @@ void keeper(Context &context) { goto notwaiting; context._cmp(context.data.word(kReeltowatch), 190); if (context.flags.c()) - goto waiting; + return /* (waiting) */; context._inc(context.data.byte(kKeeperflag)); context.ah = context.es.byte(context.bx+7); context._and(context.ah, 127); context._cmp(context.ah, context.data.byte(kDreamnumber)); if (context.flags.z()) - goto notdiff; + return /* (notdiff) */; context.al = context.data.byte(kDreamnumber); context.es.byte(context.bx+7) = context.al; -notdiff: return; notwaiting: addtopeoplelist(context); showgamereel(context); -waiting: - return; } void candles1(Context &context) { @@ -1855,13 +1825,12 @@ notmonk2text9: notmonk2text10: context._cmp(context.data.byte(kIntrocount), 31); if (!context.flags.z()) - goto notmonk2text11; + return /* (notmonk2text11) */; context.al = 18; context.bl = 36; context.bh = 160; context.cx = 100; goto gotmonks2text; -notmonk2text11: return; gotmonks2text: context.dx = 1; @@ -1892,13 +1861,12 @@ notintro1text1: notintro1text2: context._cmp(context.data.byte(kIntrocount), 6); if (!context.flags.z()) - goto notintro1text3; + return /* (notintro1text3) */; context.al = 42; context.bl = 34; context.bh = 130; context.cx = 90; goto gotintro1text; -notintro1text3: return; gotintro1text: context.dx = 1; @@ -1925,13 +1893,12 @@ void intro2text(Context &context) { notintro2text1: context._cmp(context.ax, 15); if (!context.flags.z()) - goto notintro2text2; + return /* (notintro2text2) */; context.al = 44; context.bl = 34; context.bh = 40; context.cx = 90; goto gotintro2text; -notintro2text2: return; gotintro2text: context.dx = 1; @@ -1952,13 +1919,12 @@ void intro3text(Context &context) { notintro3text1: context._cmp(context.ax, 108); if (!context.flags.z()) - goto notintro3text2; + return /* (notintro3text2) */; context.al = 46; context.bl = 36; context.bh = 56; context.cx = 100; goto gotintro3text; -notintro3text2: return; gotintro3text: context.dx = 1; @@ -2052,11 +2018,9 @@ notendseq: context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 145); if (!context.flags.z()) - goto notendcreds; + return /* (notendcreds) */; context.es.word(context.bx+3) = 146; rollendcredits(context); -notendcreds: - return; } void rollendcredits(Context &context) { @@ -2156,22 +2120,18 @@ void priest(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 8); if (context.flags.z()) - goto priestspoken; + return /* (priestspoken) */; context.data.byte(kPointermode) = 0; context.data.word(kWatchingtime) = 2; checkspeed(context); if (!context.flags.z()) - goto priestwait; + return /* (priestwait) */; context._inc(context.es.word(context.bx+3)); context.push(context.es); context.push(context.bx); priesttext(context); context.bx = context.pop(); context.es = context.pop(); -priestwait: - return; -priestspoken: - return; } void madmanstelly(Context &context) { @@ -2252,14 +2212,13 @@ nomadspeed: madmanspoken: context._cmp(context.data.byte(kWongame), 1); if (context.flags.z()) - goto alreadywon; + return /* (alreadywon) */; context.data.byte(kWongame) = 1; context.push(context.es); context.push(context.bx); getridoftemptext(context); context.bx = context.pop(); context.es = context.pop(); -alreadywon: return; ryansded: context.data.byte(kMandead) = 2; @@ -2270,10 +2229,10 @@ void madmantext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSpeechcount), 63); if (!context.flags.c()) - goto nomadtext; + return /* (nomadtext) */; context._cmp(context.data.byte(kCh1playing), 255); if (!context.flags.z()) - goto nomadtext; + return /* (nomadtext) */; context.al = context.data.byte(kSpeechcount); context._inc(context.data.byte(kSpeechcount)); context._add(context.al, 47); @@ -2283,8 +2242,6 @@ void madmantext(Context &context) { context.dx = 1; context.ah = 82; setuptimedtemp(context); -nomadtext: - return; } void madmode(Context &context) { @@ -2293,27 +2250,25 @@ void madmode(Context &context) { context.data.byte(kPointermode) = 0; context._cmp(context.data.byte(kCombatcount), 65); if (context.flags.c()) - goto iswatchmad; + return /* (iswatchmad) */; context._cmp(context.data.byte(kCombatcount), 70); if (!context.flags.c()) - goto iswatchmad; + return /* (iswatchmad) */; context.data.byte(kPointermode) = 2; -iswatchmad: - return; } void priesttext(Context &context) { STACK_CHECK(context); context._cmp(context.es.word(context.bx+3), 2); if (context.flags.c()) - goto nopriesttext; + return /* (nopriesttext) */; context._cmp(context.es.word(context.bx+3), 7); if (!context.flags.c()) - goto nopriesttext; + return /* (nopriesttext) */; context.al = context.es.byte(context.bx+3); context._and(context.al, 1); if (!context.flags.z()) - goto nopriesttext; + return /* (nopriesttext) */; context.al = context.es.byte(context.bx+3); context._shr(context.al, 1); context._add(context.al, 50); @@ -2322,8 +2277,6 @@ void priesttext(Context &context) { context.cx = 54; context.dx = 1; setuptimeduse(context); -nopriesttext: - return; } void textforend(Context &context) { @@ -2348,13 +2301,12 @@ notendtext1: notendtext2: context._cmp(context.data.byte(kIntrocount), 85); if (!context.flags.z()) - goto notendtext3; + return /* (notendtext3) */; context.al = 2; context.bl = 34; context.bh = 20; context.cx = 60; goto gotendtext; -notendtext3: return; gotendtext: context.dx = 1; @@ -2483,11 +2435,10 @@ notmonktext12: notmonktext13: context._cmp(context.data.byte(kIntrocount), 53); if (!context.flags.z()) - goto notendtitles; + return /* (notendtitles) */; fadescreendowns(context); context.data.byte(kVolumeto) = 7; context.data.byte(kVolumedirection) = 1; -notendtitles: return; gotmonktext: context.dx = 1; @@ -2505,14 +2456,12 @@ void drunk(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (!context.flags.z()) - goto trampgone; + return /* (trampgone) */; context.al = context.es.byte(context.bx+7); context._and(context.al, 127); context.es.byte(context.bx+7) = context.al; showgamereel(context); addtopeoplelist(context); -trampgone: - return; } void advisor(Context &context) { @@ -2616,10 +2565,8 @@ finishsparky: context.al = context.es.byte(context.bx+7); context._and(context.al, 128); if (context.flags.z()) - goto nottalkedsparky; + return /* (nottalkedsparky) */; context.data.byte(kTalkedtosparky) = 1; -nottalkedsparky: - return; } void train(Context &context) { @@ -2635,19 +2582,17 @@ notrainyet: randomnumber(context); context._cmp(context.al, 253); if (context.flags.c()) - goto notrainatall; + return /* (notrainatall) */; context._cmp(context.data.byte(kManspath), 5); if (!context.flags.z()) - goto notrainatall; + return /* (notrainatall) */; context._cmp(context.data.byte(kFinaldest), 5); if (!context.flags.z()) - goto notrainatall; + return /* (notrainatall) */; context.ax = 5; gottrainframe: context.es.word(context.bx+3) = context.ax; showgamereel(context); -notrainatall: - return; } void addtopeoplelist(Context &context) { @@ -2673,7 +2618,7 @@ void showgamereel(Context &context) { context.ax = context.es.word(context.bx+3); context._cmp(context.ax, 512); if (!context.flags.c()) - goto noshow; + return /* (noshow) */; context.data.word(kReelpointer) = context.ax; context.push(context.es); context.push(context.bx); @@ -2682,8 +2627,6 @@ void showgamereel(Context &context) { context.es = context.pop(); context.ax = context.data.word(kReelpointer); context.es.word(context.bx+3) = context.ax; -noshow: - return; } void checkspeed(Context &context) { @@ -2695,11 +2638,10 @@ void checkspeed(Context &context) { context.al = context.es.byte(context.bx+6); context._cmp(context.al, context.es.byte(context.bx+5)); if (!context.flags.z()) - goto notspeed; + return /* (notspeed) */; context.al = 0; context.es.byte(context.bx+6) = context.al; context._cmp(context.al, context.al); -notspeed: return; forcenext: context._cmp(context.al, context.al); @@ -2770,12 +2712,10 @@ _tmp18a: context.cx = context.pop(); context._cmp(context.data.byte(kNowinnewroom), 1); if (context.flags.z()) - goto _tmp18b; + return /* ($18b) */; context._add(context.bx, (32)); if (--context.cx) goto _tmp18; -_tmp18b: - return; } void printsprites(Context &context) { @@ -3229,11 +3169,8 @@ notaright: notadown: context._test(context.al, 16); if (context.flags.z()) - goto notanup; + return /* (notanup) */; adjustup(context); - return; -notanup: - return; } void adjustdown(Context &context) { @@ -3298,13 +3235,13 @@ void reminders(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 24); if (!context.flags.z()) - goto notinedenslift; + return /* (notinedenslift) */; context._cmp(context.data.byte(kMapx), 44); if (!context.flags.z()) - goto notinedenslift; + return /* (notinedenslift) */; context._cmp(context.data.byte(kProgresspoints), 0); if (!context.flags.z()) - goto notfirst; + return /* (notfirst) */; context.al = 'D'; context.ah = 'K'; context.cl = 'E'; @@ -3337,7 +3274,6 @@ void reminders(Context &context) { goto forgotone; havegotcard: context._inc(context.data.byte(kProgresspoints)); -notfirst: return; forgotone: context.al = 50; @@ -3346,9 +3282,6 @@ forgotone: context.cx = 48; context.dx = 8; setuptimeduse(context); - return; -notinedenslift: - return; } void initrain(Context &context) { @@ -3429,10 +3362,10 @@ lookforlinestart: context._inc(context.ch); context._cmp(context.cl, 0); if (context.flags.z()) - goto endofthisline; + return /* (endofthisline) */; context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) - goto endofthisline; + return /* (endofthisline) */; goto lookforlinestart; foundlinestart: context.es.word(context.di) = context.cx; @@ -3467,13 +3400,11 @@ foundlineend: context.cx = context.pop(); context._cmp(context.cl, 0); if (context.flags.z()) - goto endofthisline; + return /* (endofthisline) */; context._cmp(context.ch, context.data.byte(kMapysize)); if (!context.flags.c()) - goto endofthisline; + return /* (endofthisline) */; goto lookforlinestart; -endofthisline: - return; } void getblockofpixel(Context &context) { @@ -3511,7 +3442,7 @@ void showrain(Context &context) { context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); if (context.flags.z()) - goto nothunder; + return /* (nothunder) */; morerain: context.es = context.data.word(kBuffers); context._cmp(context.es.byte(context.bx), 255); @@ -3563,21 +3494,21 @@ noplot: finishrain: context._cmp(context.data.word(kCh1blockstocopy), 0); if (!context.flags.z()) - goto nothunder; + return /* (nothunder) */; context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) goto notlouisthund; context._cmp(context.data.byte(kBeenmugged), 1); if (!context.flags.z()) - goto nothunder; + return /* (nothunder) */; notlouisthund: context._cmp(context.data.byte(kReallocation), 55); if (context.flags.z()) - goto nothunder; + return /* (nothunder) */; randomnum1(context); context._cmp(context.al, 1); if (!context.flags.c()) - goto nothunder; + return /* (nothunder) */; context.al = 7; context._cmp(context.data.byte(kCh0playing), 6); if (context.flags.z()) @@ -3585,8 +3516,6 @@ notlouisthund: context.al = 4; isthunder1: playchannel1(context); -nothunder: - return; } void backobject(Context &context) { @@ -3599,7 +3528,7 @@ void backobject(Context &context) { goto _tmp48z; context._dec(context.al); context.es.byte(context.bx+18) = context.al; - goto finishback; + return /* (finishback) */; _tmp48z: context.al = context.ds.byte(context.di+7); context.es.byte(context.bx+18) = context.al; @@ -3608,41 +3537,39 @@ _tmp48z: if (!context.flags.z()) goto notwidedoor; widedoor(context); - goto finishback; + return /* (finishback) */; notwidedoor: context._cmp(context.al, 5); if (!context.flags.z()) goto notrandom; random(context); - goto finishback; + return /* (finishback) */; notrandom: context._cmp(context.al, 4); if (!context.flags.z()) goto notlockdoor; lockeddoorway(context); - goto finishback; + return /* (finishback) */; notlockdoor: context._cmp(context.al, 3); if (!context.flags.z()) goto notlift; liftsprite(context); - goto finishback; + return /* (finishback) */; notlift: context._cmp(context.al, 2); if (!context.flags.z()) goto notdoor; doorway(context); - goto finishback; + return /* (finishback) */; notdoor: context._cmp(context.al, 1); if (!context.flags.z()) goto steadyob; constant(context); - goto finishback; + return /* (finishback) */; steadyob: steady(context); -finishback: - return; } void liftsprite(Context &context) { @@ -3908,10 +3835,8 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) - goto notnearly; + return /* (notnearly) */; context.data.byte(kThroughdoor) = 0; -notnearly: - return; } void lockeddoorway(Context &context) { @@ -3999,9 +3924,8 @@ atlast3: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) - goto justshutting; + return /* (justshutting) */; context.data.byte(kThroughdoor) = 1; -justshutting: return; shutdoor2: context.cl = context.es.byte(context.bx+19); @@ -4027,7 +3951,7 @@ atlast4: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 0); if (!context.flags.z()) - goto notlocky; + return /* (notlocky) */; context.al = context.data.byte(kDoorpath); context.push(context.es); context.push(context.bx); @@ -4035,8 +3959,6 @@ atlast4: context.bx = context.pop(); context.es = context.pop(); context.data.byte(kLockstatus) = 1; -notlocky: - return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: context.cl = context.es.byte(context.bx+19); @@ -4089,7 +4011,7 @@ updateloop: context.al = context.es.byte(context.bx); context._cmp(context.al, 255); if (context.flags.z()) - goto endupdate; + return /* (endupdate) */; context._cmp(context.al, context.data.byte(kReallocation)); if (!context.flags.z()) goto notinthisroom; @@ -4108,8 +4030,6 @@ notinthisroom: context._add(context.bx, 8); context._add(context.di, 2); goto updateloop; -endupdate: - return; } void getreelframeax(Context &context) { @@ -4220,24 +4140,20 @@ endreelsound: context.ax = context.data.word(kLastsoundreel); context._cmp(context.ax, context.data.word(kReelpointer)); if (context.flags.z()) - goto nochange2; + return /* (nochange2) */; context.data.word(kLastsoundreel) = -1; -nochange2: - return; } void reconstruct(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kHavedoneobs), 0); if (context.flags.z()) - goto noneedtorecon; + return /* (noneedtorecon) */; context.data.byte(kNewobs) = 1; drawfloor(context); spriteupdate(context); printsprites(context); context.data.byte(kHavedoneobs) = 0; -noneedtorecon: - return; } void dealwithspecial(Context &context) { @@ -4416,7 +4332,7 @@ dumpevery2: context.cx = context.es.word(context.bx+2); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) - goto finishevery2; + return /* (finishevery2) */; context.push(context.bx); context.push(context.es); context.push(context.ds); @@ -4432,8 +4348,6 @@ dumpevery2: context.bx = context.pop(); context._add(context.bx, 5); goto dumpevery2; -finishevery2: - return; } void allocatework(Context &context) { @@ -4641,11 +4555,10 @@ void zoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) - goto inwatching; + return /* (inwatching) */; context._cmp(context.data.byte(kZoomon), 1); if (context.flags.z()) goto zoomswitch; -inwatching: return; zoomswitch: context._cmp(context.data.byte(kCommandtype), 199); @@ -5147,7 +5060,7 @@ void dofade(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kFadedirection), 0); if (context.flags.z()) - goto finishfade; + return /* (finishfade) */; context.cl = context.data.byte(kNumtofade); context.ch = 0; context.al = context.data.byte(kColourpos); @@ -5163,10 +5076,8 @@ void dofade(Context &context) { context.data.byte(kColourpos) = context.al; context._cmp(context.al, 0); if (!context.flags.z()) - goto finishfade; + return /* (finishfade) */; fadecalculation(context); -finishfade: - return; } void clearendpal(Context &context) { @@ -5456,7 +5367,7 @@ looknext2: gotnext2: context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) - goto endearly; + return /* (endearly) */; if (--context.cx) goto endcredits21; context.cx = 120; @@ -5464,8 +5375,6 @@ gotnext2: return; endearly2: context.cx = context.pop(); -endearly: - return; } void fadecalculation(Context &context) { @@ -5860,11 +5769,9 @@ hangonloope: context.cx = context.pop(); context._cmp(context.data.byte(kLasthardkey), 1); if (context.flags.z()) - goto hangonearly; + return /* (hangonearly) */; if (--context.cx) goto hangonloope; -hangonearly: - return; } void intro(Context &context) { @@ -6139,7 +6046,7 @@ void printchar(Context &context) { STACK_CHECK(context); context._cmp(context.al, 255); if (context.flags.z()) - goto ignoreit; + return /* (ignoreit) */; context.push(context.si); context.push(context.bx); context.push(context.di); @@ -6161,8 +6068,6 @@ nokern: context.ch = 0; context._add(context.di, context.cx); context.cx = context.pop(); -ignoreit: - return; } void kernchars(Context &context) { @@ -6865,11 +6770,9 @@ void isitworn(Context &context) { context.al = context.es.byte(context.bx+12); context._cmp(context.al, 'W'-'A'); if (!context.flags.z()) - goto notworn; + return /* (notworn) */; context.al = context.es.byte(context.bx+13); context._cmp(context.al, 'E'-'A'); -notworn: - return; } void makeworn(Context &context) { @@ -6990,11 +6893,10 @@ alreadyincryan: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noincryan; + return /* (noincryan) */; context._and(context.ax, 1); if (!context.flags.z()) goto doincryan; -noincryan: return; doincryan: context.ax = context.data.word(kMousex); @@ -7118,7 +7020,7 @@ void obpicture(Context &context) { context.ah = context.data.byte(kObjecttype); context._cmp(context.ah, 1); if (context.flags.z()) - goto setframe; + return /* (setframe) */; context._cmp(context.ah, 4); if (context.flags.z()) goto exframe; @@ -7132,8 +7034,6 @@ void obpicture(Context &context) { context.ah = 128; showframe(context); return; -setframe: - return; exframe: context.ds = context.data.word(kExtras); context.di = 160; @@ -7220,19 +7120,15 @@ void obsthatdothings(Context &context) { context.dh = 'B'; compare(context); if (!context.flags.z()) - goto notlouiscard; + return /* (notlouiscard) */; context.al = 4; getlocation(context); context._cmp(context.al, 1); if (context.flags.z()) - goto seencard; + return /* (seencard) */; context.al = 4; setlocation(context); lookatcard(context); -seencard: - return; -notlouiscard: - return; } void getobtextstart(Context &context) { @@ -7269,14 +7165,13 @@ tryagain: context.si = context.pop(); context._cmp(context.data.byte(kObjecttype), 1); if (!context.flags.z()) - goto cantmakeoneup; + return /* (cantmakeoneup) */; context._cmp(context.al, 0); if (context.flags.z()) goto findsometext; context._cmp(context.al, ':'); if (context.flags.z()) goto findsometext; -cantmakeoneup: return; findsometext: searchforsame(context); @@ -7333,12 +7228,10 @@ isntcolon: context._inc(context.si); context._cmp(context.al, 0); if (context.flags.z()) - goto endofcolon; + return /* (endofcolon) */; context._cmp(context.al, ':'); if (!context.flags.z()) goto isntcolon; -endofcolon: - return; } void inventory(Context &context) { @@ -7363,11 +7256,10 @@ alreadyopinv: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto cantopinv; + return /* (cantopinv) */; context._and(context.ax, 1); if (!context.flags.z()) goto doopeninv; -cantopinv: return; doopeninv: context.data.word(kTimecount) = 0; @@ -7492,11 +7384,10 @@ alreadysp: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) - goto nosetpick; + return /* (nosetpick) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (!context.flags.z()) goto dosetpick; -nosetpick: return; dosetpick: createpanel(context); @@ -7596,11 +7487,10 @@ alreadyswap1: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto cantswap1; + return /* (cantswap1) */; context._and(context.ax, 1); if (!context.flags.z()) goto doswap1; -cantswap1: return; doswap1: context.ah = context.data.byte(kObjecttype); @@ -7657,11 +7547,10 @@ alreadyswap2: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto cantswap2; + return /* (cantswap2) */; context._and(context.ax, 1); if (!context.flags.z()) goto doswap2; -cantswap2: return; doswap2: geteitherad(context); @@ -7774,11 +7663,10 @@ alreadyplce: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notletgo2; + return /* (notletgo2) */; context._and(context.ax, 1); if (!context.flags.z()) goto doplace; -notletgo2: return; doplace: delpointer(context); @@ -7855,11 +7743,10 @@ alreadygrab: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notletgo; + return /* (notletgo) */; context._and(context.ax, 1); if (!context.flags.z()) goto dograb; -notletgo: return; dograb: delpointer(context); @@ -8047,11 +7934,10 @@ alreadydrop: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nodrop; + return /* (nodrop) */; context._and(context.ax, 1); if (!context.flags.z()) goto dodrop; -nodrop: return; dodrop: geteitherad(context); @@ -8193,14 +8079,12 @@ void removeobfrominv(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommand), 100); if (context.flags.z()) - goto obnotexist; + return /* (obnotexist) */; getanyad(context); context.di = context.bx; context.cl = context.data.byte(kCommand); context.ch = 0; deleteexobject(context); -obnotexist: - return; } void selectopenob(Context &context) { @@ -8225,11 +8109,10 @@ alreadyopob: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noopenob; + return /* (noopenob) */; context._and(context.ax, 1); if (!context.flags.z()) goto doopenob; -noopenob: return; doopenob: context.al = context.data.byte(kCommand); @@ -8254,7 +8137,7 @@ void useopened(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kOpenedob), 255); if (context.flags.z()) - goto cannotuseopen; + return /* (cannotuseopen) */; context._cmp(context.data.byte(kPickup), 0); if (!context.flags.z()) goto notout2; @@ -8267,7 +8150,6 @@ notout2: if (context.flags.z()) goto canplace3; swapwithopen(context); -cannotuseopen: return; canplace3: context._cmp(context.data.byte(kPickup), 1); @@ -8294,11 +8176,10 @@ alreadyplc2: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notletgo3; + return /* (notletgo3) */; context._cmp(context.ax, 1); if (context.flags.z()) goto doplace2; -notletgo3: return; doplace2: geteitherad(context); @@ -8494,15 +8375,14 @@ alreadygrb: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notletgo4; + return /* (notletgo4) */; context._cmp(context.ax, 1); if (context.flags.z()) goto dogrb; context._cmp(context.ax, 2); if (!context.flags.z()) - goto notletgo4; + return /* (notletgo4) */; reexfromopen(context); -notletgo4: return; dogrb: delpointer(context); @@ -8581,7 +8461,7 @@ void pickupconts(Context &context) { context.al = context.ds.byte(context.si+7); context._cmp(context.al, 255); if (context.flags.z()) - goto notopenable; + return /* (notopenable) */; context.al = context.data.byte(kItemframe); context.ah = context.data.byte(kObjecttype); context.dl = context.data.byte(kExpos); @@ -8613,8 +8493,6 @@ notinsidethis: context._cmp(context.cx, 80); if (!context.flags.z()) goto pickupcontloop; -notopenable: - return; } void transfercontoex(Context &context) { @@ -8740,11 +8618,9 @@ notnearframeend: context._add(context.ax, 400); context._cmp(context.ax, (18000)); if (context.flags.c()) - goto notneartextend; + return /* (notneartextend) */; purgeanitem(context); goto checkpurgeagain; -notneartextend: - return; } void purgeanitem(Context &context) { @@ -9143,7 +9019,7 @@ void eraseoldobs(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) - goto donterase; + return /* (donterase) */; context.es = context.data.word(kBuffers); context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); context.cx = 16; @@ -9164,8 +9040,6 @@ notthisob: context._add(context.bx, (32)); if (--context.cx) goto oberase; -donterase: - return; } void showallobs(Context &context) { @@ -9251,17 +9125,15 @@ blankframe: context._add(context.si, 64); context._dec(context.cx); if (context.flags.z()) - goto finishedsetobs; + return /* (finishedsetobs) */; goto showobsloop; -finishedsetobs: - return; } void makebackob(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewobs), 0); if (context.flags.z()) - goto nomake; + return /* (nomake) */; context.al = context.es.byte(context.si+5); context.ah = context.es.byte(context.si+8); context.push(context.si); @@ -9289,8 +9161,6 @@ usedpriority: context.es.byte(context.bx+18) = 0; context.es.byte(context.bx+19) = 0; context.si = context.pop(); -nomake: - return; } void showallfree(Context &context) { @@ -9370,10 +9240,8 @@ over138: context._inc(context.cx); context._cmp(context.cx, 80); if (context.flags.z()) - goto finfree; + return /* (finfree) */; goto loop127; -finfree: - return; } void showallex(Context &context) { @@ -9460,10 +9328,8 @@ blankex: context._inc(context.cx); context._cmp(context.cx, 100); if (context.flags.z()) - goto finex; + return /* (finex) */; goto exloop; -finex: - return; } void calcfrframe(Context &context) { @@ -9518,12 +9384,10 @@ void adjustlen(Context &context) { context._add(context.al, context.ch); context._cmp(context.al, 100); if (context.flags.c()) - goto over242; + return /* (over242) */; context.al = 224; context._sub(context.al, context.ch); context.ch = context.al; -over242: - return; } void getmapad(Context &context) { @@ -9531,16 +9395,14 @@ void getmapad(Context &context) { getxad(context); context._cmp(context.ch, 0); if (context.flags.z()) - goto over146; + return /* (over146) */; context.data.word(kObjectx) = context.ax; getyad(context); context._cmp(context.ch, 0); if (context.flags.z()) - goto over146; + return /* (over146) */; context.data.word(kObjecty) = context.ax; context.ch = 1; -over146: - return; } void getxad(Context &context) { @@ -9605,12 +9467,11 @@ void autolook(Context &context) { context._dec(context.data.word(kLookcounter)); context._cmp(context.data.word(kLookcounter), 0); if (!context.flags.z()) - goto noautolook; + return /* (noautolook) */; context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) - goto noautolook; + return /* (noautolook) */; dolook(context); -noautolook: return; diffmouse: context.data.word(kLookcounter) = 1000; @@ -9633,14 +9494,12 @@ void look(Context &context) { alreadylook: context._cmp(context.data.word(kMousebutton), 1); if (!context.flags.z()) - goto nolook; + return /* (nolook) */; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nolook; + return /* (nolook) */; dolook(context); -nolook: - return; } void dolook(Context &context) { @@ -9714,11 +9573,10 @@ alreadyget: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nogetback; + return /* (nogetback) */; context._and(context.ax, 1); if (!context.flags.z()) goto dogetback; -nogetback: return; dogetback: context.data.byte(kGetback) = 1; @@ -9769,12 +9627,10 @@ notnexttalk: worktoscreenm(context); context._cmp(context.data.byte(kSpeechloaded), 1); if (!context.flags.z()) - goto nospeech; + return /* (nospeech) */; cancelch1(context); context.data.byte(kVolumedirection) = -1; context.data.byte(kVolumeto) = 0; -nospeech: - return; } void convicons(Context &context) { @@ -9834,13 +9690,11 @@ void starttalk(Context &context) { loadspeech(context); context._cmp(context.data.byte(kSpeechloaded), 1); if (!context.flags.z()) - goto nospeech1; + return /* (nospeech1) */; context.data.byte(kVolumedirection) = 1; context.data.byte(kVolumeto) = 6; context.al = 50+12; playchannel1(context); -nospeech1: - return; } void getpersontext(Context &context) { @@ -9875,11 +9729,10 @@ alreadymore: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nomore; + return /* (nomore) */; context._and(context.ax, 1); if (!context.flags.z()) goto domoretalk; -nomore: return; domoretalk: context.data.byte(kTalkmode) = 2; @@ -10230,14 +10083,14 @@ alreadyinfo: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto noinfo; + return /* (noinfo) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noinfo; + return /* (noinfo) */; context.bl = context.data.byte(kDestpos); context._cmp(context.bl, 15); if (!context.flags.c()) - goto noinfo; + return /* (noinfo) */; context.push(context.bx); delpointer(context); deltextline(context); @@ -10273,8 +10126,6 @@ alreadyinfo: context.data.byte(kPointerframe) = 0; putundercentre(context); worktoscreenm(context); -noinfo: - return; } void getundercentre(Context &context) { @@ -10400,10 +10251,10 @@ alreadydu: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto nodu; + return /* (nodu) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nodu; + return /* (nodu) */; searchdestup: context._inc(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), 15); @@ -10427,8 +10278,6 @@ notlastdest: showpointer(context); worktoscreen(context); delpointer(context); -nodu: - return; } void lastdest(Context &context) { @@ -10443,10 +10292,10 @@ alreadydd: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto nodd; + return /* (nodd) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nodd; + return /* (nodd) */; searchdestdown: context._dec(context.data.byte(kDestpos)); context._cmp(context.data.byte(kDestpos), -1); @@ -10470,8 +10319,6 @@ notfirstdest: showpointer(context); worktoscreen(context); delpointer(context); -nodd: - return; } void destselect(Context &context) { @@ -10486,15 +10333,13 @@ alreadytrav: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto notrav; + return /* (notrav) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notrav; + return /* (notrav) */; getdestinfo(context); context.al = context.data.byte(kDestpos); context.data.byte(kNewlocation) = context.al; -notrav: - return; } void getlocation(Context &context) { @@ -10996,7 +10841,7 @@ waitkey: goto waitkey; context._cmp(context.al, 13); if (context.flags.z()) - goto endofinput; + return /* (endofinput) */; context._cmp(context.al, 8); if (!context.flags.z()) goto notdel; @@ -11055,18 +10900,14 @@ notleadingspace: context._inc(context.data.word(kCurpos)); context._add(context.data.word(kCurslocx), context.cx); goto waitkey; -endofinput: - return; } void makecaps(Context &context) { STACK_CHECK(context); context._cmp(context.al, 'a'); if (context.flags.c()) - goto notupperc; + return /* (notupperc) */; context._sub(context.al, 32); -notupperc: - return; } void delchar(Context &context) { @@ -11227,14 +11068,12 @@ directloop1: context._inc(context.bx); context._cmp(context.al, '*'); if (context.flags.z()) - goto endofdir; + return /* (endofdir) */; context._cmp(context.al, 34); if (!context.flags.z()) goto directloop1; monprint(context); goto directloop1; -endofdir: - return; } void signon(Context &context) { @@ -11694,15 +11533,13 @@ void lockmon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLasthardkey), 57); if (!context.flags.z()) - goto notlock; + return /* (notlock) */; locklighton(context); lockloop: context._cmp(context.data.byte(kLasthardkey), 57); if (context.flags.z()) goto lockloop; locklightoff(context); -notlock: - return; } void monitorlogo(Context &context) { @@ -11746,7 +11583,7 @@ curfileloop: context.al = context.cs.byte(context.si); context._cmp(context.al, 0); if (context.flags.z()) - goto finishfile; + return /* (finishfile) */; context._inc(context.si); context.push(context.si); context.ds = context.data.word(kTempcharset); @@ -11754,8 +11591,6 @@ curfileloop: printchar(context); context.si = context.pop(); goto curfileloop; -finishfile: - return; } void monmessage(Context &context) { @@ -11797,13 +11632,11 @@ notfirsttrigger: notsecondtrigger: context._cmp(context.data.byte(kLasttrigger), '3'); if (!context.flags.z()) - goto notthirdtrigger; + return /* (notthirdtrigger) */; context.al = 2; setlocation(context); context.al = 59; triggermessage(context); -notthirdtrigger: - return; } void triggermessage(Context &context) { @@ -11930,11 +11763,10 @@ alreadyuse: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nouse; + return /* (nouse) */; context._and(context.ax, 1); if (!context.flags.z()) goto douse; -nouse: return; douse: useroutine(context); @@ -12951,16 +12783,14 @@ void isitright(Context &context) { context.bx = 8573; context._cmp(context.es.byte(context.bx+0), context.al); if (!context.flags.z()) - goto notright; + return /* (notright) */; context._cmp(context.es.byte(context.bx+1), context.ah); if (!context.flags.z()) - goto notright; + return /* (notright) */; context._cmp(context.es.byte(context.bx+2), context.cl); if (!context.flags.z()) - goto notright; + return /* (notright) */; context._cmp(context.es.byte(context.bx+3), context.ch); -notright: - return; } void drawitall(Context &context) { @@ -14013,11 +13843,10 @@ alreadyselob: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notselob; + return /* (notselob) */; context._and(context.ax, 1); if (!context.flags.z()) goto doselob; -notselob: return; doselob: delpointer(context); @@ -14038,10 +13867,8 @@ void compare(Context &context) { context.cx = context.pop(); context._cmp(context.es.word(context.bx+12), context.cx); if (!context.flags.z()) - goto comparefin; + return /* (comparefin) */; context._cmp(context.es.word(context.bx+14), context.dx); -comparefin: - return; } void findsetobject(Context &context) { @@ -14347,7 +14174,7 @@ setallloop: context.ax = context.es.word(context.bx); context._cmp(context.al, 255); if (context.flags.z()) - goto endsetloop; + return /* (endsetloop) */; context.cx = context.es.word(context.bx+2); context._add(context.bx, 4); context._cmp(context.ah, context.data.byte(kReallocation)); @@ -14359,8 +14186,6 @@ setallloop: context.bx = context.pop(); context.es = context.pop(); goto setallloop; -endsetloop: - return; } void dochange(Context &context) { @@ -14401,10 +14226,8 @@ freeobject: context.cx = context.pop(); context._cmp(context.es.byte(context.bx+2), 255); if (!context.flags.z()) - goto beenpickedup; + return /* (beenpickedup) */; context.es.byte(context.bx+2) = context.cl; -beenpickedup: - return; } void autoappear(Context &context) { @@ -14446,7 +14269,7 @@ notinalley: edenspart2: context._cmp(context.data.byte(kSartaindead), 1); if (!context.flags.z()) - goto notedens2; + return /* (notedens2) */; context.al = 44; removesetobject(context); context.al = 93; @@ -14454,7 +14277,6 @@ edenspart2: context.al = 55; placesetobject(context); context._inc(context.data.byte(kSartaindead)); -notedens2: return; notinedens: context._cmp(context.data.byte(kReallocation), 25); @@ -14470,14 +14292,12 @@ notinedens: notonsartroof: context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) - goto notinlouiss; + return /* (notinlouiss) */; context._cmp(context.data.byte(kRockstardead), 0); if (context.flags.z()) - goto notinlouiss; + return /* (notinlouiss) */; context.al = 23; placesetobject(context); -notinlouiss: - return; } void getundertimed(Context &context) { @@ -14514,7 +14334,7 @@ void dumptimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedtodumptimed), 1); if (!context.flags.z()) - goto nodumptimed; + return /* (nodumptimed) */; context.al = context.data.byte(kTimedy); context.ah = 0; context.bx = context.ax; @@ -14525,15 +14345,13 @@ void dumptimedtext(Context &context) { context.ch = (24); multidump(context); context.data.byte(kNeedtodumptimed) = 0; -nodumptimed: - return; } void setuptimeduse(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) - goto cantsetup; + return /* (cantsetup) */; context.data.byte(kTimedy) = context.bh; context.data.byte(kTimedx) = context.bl; context.data.word(kCounttotimed) = context.cx; @@ -14549,8 +14367,6 @@ void setuptimeduse(Context &context) { context.bx = context.ax; context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; -cantsetup: - return; } void setuptimedtemp(Context &context) { @@ -14572,7 +14388,7 @@ void setuptimedtemp(Context &context) { notloadspeech3: context._cmp(context.data.word(kTimecount), 0); if (!context.flags.z()) - goto cantsetup2; + return /* (cantsetup2) */; context.data.byte(kTimedy) = context.bh; context.data.byte(kTimedx) = context.bl; context.data.word(kCounttotimed) = context.cx; @@ -14588,15 +14404,13 @@ notloadspeech3: context.bx = context.ax; context.data.word(kTimedseg) = context.es; context.data.word(kTimedoffset) = context.bx; -cantsetup2: - return; } void usetimedtext(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) - goto notext; + return /* (notext) */; context._dec(context.data.word(kTimecount)); context._cmp(context.data.word(kTimecount), 0); if (context.flags.z()) @@ -14606,7 +14420,7 @@ void usetimedtext(Context &context) { if (context.flags.z()) goto firsttimed; if (!context.flags.c()) - goto notext; + return /* (notext) */; goto notfirsttimed; firsttimed: getundertimed(context); @@ -14622,7 +14436,6 @@ notfirsttimed: context.ah = 0; printdirect(context); context.data.byte(kNeedtodumptimed) = 1; -notext: return; deltimedtext: putundertimed(context); @@ -14731,11 +14544,9 @@ cutgate: turnpathon(context); context._cmp(context.data.byte(kAidedead), 0); if (context.flags.z()) - goto notopenchurch; + return /* (notopenchurch) */; context.al = 2; turnpathon(context); -notopenchurch: - return; } void usegun(Context &context) { @@ -15148,11 +14959,10 @@ alreadyqk: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notqk; + return /* (notqk) */; context._and(context.ax, 1); if (!context.flags.z()) goto doqk; -notqk: return; doqk: context.data.byte(kGetback) = 1; @@ -15162,7 +14972,7 @@ void addtopresslist(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kPresspointer), 5); if (context.flags.z()) - goto nomorekeys; + return /* (nomorekeys) */; context.al = context.data.byte(kPressed); context._cmp(context.al, 10); if (!context.flags.z()) @@ -15175,8 +14985,6 @@ not10: context._add(context.bx, 8573); context.es.byte(context.bx) = context.al; context._inc(context.data.word(kPresspointer)); -nomorekeys: - return; } void buttonone(Context &context) { @@ -15262,11 +15070,10 @@ alreadyb: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notb; + return /* (notb) */; context._and(context.ax, 1); if (!context.flags.z()) goto dob; -notb: return; dob: context.data.byte(kPressed) = context.cl; @@ -15275,11 +15082,9 @@ dob: context.data.byte(kPresscount) = 40; context._cmp(context.cl, 32); if (context.flags.z()) - goto nonoise; + return /* (nonoise) */; context.al = 10; playchannel1(context); -nonoise: - return; } void showouterpad(Context &context) { @@ -15346,7 +15151,7 @@ void showkeypad(Context &context) { singlekey(context); context._cmp(context.data.byte(kLightcount), 0); if (context.flags.z()) - goto notenter; + return /* (notenter) */; context._dec(context.data.byte(kLightcount)); context.al = 36; context.bx = (72)-1+63; @@ -15368,8 +15173,6 @@ gotlight: context.ah = 0; context.di = (36+112)+60; showframe(context); -notenter: - return; } void singlekey(Context &context) { @@ -15444,8 +15247,6 @@ menuloop: getridoftemp2(context); restorereels(context); worktoscreenm(context); - return; - return; } void dumpmenu(Context &context) { @@ -15581,11 +15382,10 @@ alreadynextf: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notnextf; + return /* (notnextf) */; context._cmp(context.ax, 1); if (context.flags.z()) goto donextf; -notnextf: return; donextf: context._inc(context.data.byte(kFolderpage)); @@ -15628,12 +15428,12 @@ void folderhints(Context &context) { notaideadd: context._cmp(context.data.byte(kFolderpage), 9); if (!context.flags.z()) - goto notaristoadd; + return /* (notaristoadd) */; context.al = 7; getlocation(context); context._cmp(context.al, 1); if (context.flags.z()) - goto notaristoadd; + return /* (notaristoadd) */; context.al = 7; setlocation(context); showfolder(context); @@ -15647,8 +15447,6 @@ notaideadd: worktoscreenm(context); context.cx = 200; hangonp(context); -notaristoadd: - return; } void lastfolder(Context &context) { @@ -15668,15 +15466,14 @@ canlastf: alreadylastf: context._cmp(context.data.byte(kFolderpage), 0); if (context.flags.z()) - goto notlastf; + return /* (notlastf) */; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notlastf; + return /* (notlastf) */; context._cmp(context.ax, 1); if (context.flags.z()) goto dolastf; -notlastf: return; dolastf: context._dec(context.data.byte(kFolderpage)); @@ -16006,11 +15803,10 @@ alreadyqs: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notqs; + return /* (notqs) */; context._and(context.ax, 1); if (!context.flags.z()) goto doqs; -notqs: return; doqs: context.data.byte(kGetback) = 1; @@ -16030,10 +15826,8 @@ void settopleft(Context &context) { alreadytopl: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto notopleft; + return /* (notopleft) */; context.data.byte(kSymboltopdir) = -1; -notopleft: - return; } void settopright(Context &context) { @@ -16050,10 +15844,8 @@ void settopright(Context &context) { alreadytopr: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto notopright; + return /* (notopright) */; context.data.byte(kSymboltopdir) = 1; -notopright: - return; } void setbotleft(Context &context) { @@ -16070,10 +15862,8 @@ void setbotleft(Context &context) { alreadybotl: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto nobotleft; + return /* (nobotleft) */; context.data.byte(kSymbolbotdir) = -1; -nobotleft: - return; } void setbotright(Context &context) { @@ -16090,10 +15880,8 @@ void setbotright(Context &context) { alreadybotr: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto nobotright; + return /* (nobotright) */; context.data.byte(kSymbolbotdir) = 1; -nobotright: - return; } void dumpsymbol(Context &context) { @@ -16200,7 +15988,7 @@ void updatesymboltop(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymboltopdir), 0); if (context.flags.z()) - goto topfinished; + return /* (topfinished) */; context._cmp(context.data.byte(kSymboltopdir), -1); if (context.flags.z()) goto backwards; @@ -16212,13 +16000,13 @@ void updatesymboltop(Context &context) { context._dec(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), -1); if (!context.flags.z()) - goto topfinished; + return /* (topfinished) */; context.data.byte(kSymboltopnum) = 5; return; notwrapfor: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) - goto topfinished; + return /* (topfinished) */; context.data.byte(kSymboltopdir) = 0; return; backwards: @@ -16230,23 +16018,21 @@ backwards: context._inc(context.data.byte(kSymboltopnum)); context._cmp(context.data.byte(kSymboltopnum), 6); if (!context.flags.z()) - goto topfinished; + return /* (topfinished) */; context.data.byte(kSymboltopnum) = 0; return; notwrapback: context._cmp(context.data.byte(kSymboltopx), 24); if (!context.flags.z()) - goto topfinished; + return /* (topfinished) */; context.data.byte(kSymboltopdir) = 0; -topfinished: - return; } void updatesymbolbot(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSymbolbotdir), 0); if (context.flags.z()) - goto botfinished; + return /* (botfinished) */; context._cmp(context.data.byte(kSymbolbotdir), -1); if (context.flags.z()) goto backwardsbot; @@ -16258,13 +16044,13 @@ void updatesymbolbot(Context &context) { context._dec(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), -1); if (!context.flags.z()) - goto botfinished; + return /* (botfinished) */; context.data.byte(kSymbolbotnum) = 5; return; notwrapforb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) - goto botfinished; + return /* (botfinished) */; context.data.byte(kSymbolbotdir) = 0; return; backwardsbot: @@ -16276,31 +16062,27 @@ backwardsbot: context._inc(context.data.byte(kSymbolbotnum)); context._cmp(context.data.byte(kSymbolbotnum), 6); if (!context.flags.z()) - goto botfinished; + return /* (botfinished) */; context.data.byte(kSymbolbotnum) = 0; return; notwrapbackb: context._cmp(context.data.byte(kSymbolbotx), 24); if (!context.flags.z()) - goto botfinished; + return /* (botfinished) */; context.data.byte(kSymbolbotdir) = 0; -botfinished: - return; } void dumpsymbox(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kDumpx), -1); if (context.flags.z()) - goto nodumpsym; + return /* (nodumpsym) */; context.di = context.data.word(kDumpx); context.bx = context.data.word(kDumpy); context.cl = 30; context.ch = 77; multidump(context); context.data.word(kDumpx) = -1; -nodumpsym: - return; } void usediary(Context &context) { @@ -16343,8 +16125,6 @@ diaryloop: context.data.byte(kManisoffscreen) = 0; redrawmainscrn(context); worktoscreenm(context); - return; - return; } void showdiary(Context &context) { @@ -16367,11 +16147,11 @@ void showdiarykeys(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) - goto nokeyatall; + return /* (nokeyatall) */; context._dec(context.data.byte(kPresscount)); context._cmp(context.data.byte(kPresscount), 0); if (context.flags.z()) - goto nokeyatall; + return /* (nokeyatall) */; context._cmp(context.data.byte(kPressed), 'N'); if (!context.flags.z()) goto nokeyn; @@ -16388,9 +16168,8 @@ gotkeyn: showframe(context); context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) - goto notshown; + return /* (notshown) */; showdiarypage(context); -notshown: return; nokeyn: context.al = 5; @@ -16406,12 +16185,8 @@ gotkeyp: showframe(context); context._cmp(context.data.byte(kPresscount), 1); if (!context.flags.z()) - goto notshowp; + return /* (notshowp) */; showdiarypage(context); -notshowp: - return; -nokeyatall: - return; } void dumpdiarykeys(Context &context) { @@ -16483,14 +16258,14 @@ void diarykeyp(Context &context) { alreadykeyp: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto notkeyp; + return /* (notkeyp) */; context.ax = context.data.word(kOldbutton); context._cmp(context.ax, context.data.word(kMousebutton)); if (context.flags.z()) - goto notkeyp; + return /* (notkeyp) */; context._cmp(context.data.byte(kPresscount), 0); if (!context.flags.z()) - goto notkeyp; + return /* (notkeyp) */; context.al = 16; playchannel1(context); context.data.byte(kPresscount) = 12; @@ -16498,10 +16273,8 @@ alreadykeyp: context._dec(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), -1); if (!context.flags.z()) - goto notkeyp; + return /* (notkeyp) */; context.data.byte(kDiarypage) = 11; -notkeyp: - return; } void diarykeyn(Context &context) { @@ -16515,14 +16288,14 @@ void diarykeyn(Context &context) { alreadykeyn: context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto notkeyn; + return /* (notkeyn) */; context.ax = context.data.word(kOldbutton); context._cmp(context.ax, context.data.word(kMousebutton)); if (context.flags.z()) - goto notkeyn; + return /* (notkeyn) */; context._cmp(context.data.byte(kPresscount), 0); if (!context.flags.z()) - goto notkeyn; + return /* (notkeyn) */; context.al = 16; playchannel1(context); context.data.byte(kPresscount) = 12; @@ -16530,10 +16303,8 @@ alreadykeyn: context._inc(context.data.byte(kDiarypage)); context._cmp(context.data.byte(kDiarypage), 12); if (!context.flags.z()) - goto notkeyn; + return /* (notkeyn) */; context.data.byte(kDiarypage) = 0; -notkeyn: - return; } void showdiarypage(Context &context) { @@ -16598,11 +16369,10 @@ alreadyonoff: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nozoomonoff; + return /* (nozoomonoff) */; context._and(context.ax, 1); if (!context.flags.z()) goto dozoomonoff; -nozoomonoff: return; dozoomonoff: context.al = context.data.byte(kZoomon); @@ -16640,13 +16410,11 @@ alreadyops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noops; + return /* (noops) */; context._and(context.ax, 1); if (context.flags.z()) - goto noops; + return /* (noops) */; dosaveload(context); -noops: - return; } void dosaveload(Context &context) { @@ -16780,11 +16548,10 @@ alreadyload: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noload; + return /* (noload) */; context._cmp(context.ax, 1); if (context.flags.z()) goto doload; -noload: return; doload: context.data.byte(kLoadingorsave) = 1; @@ -16811,7 +16578,7 @@ loadops: goto loadops; context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) - goto quitloaded; + return /* (quitloaded) */; getridoftemp(context); context.dx = context.data; context.es = context.dx; @@ -16829,8 +16596,6 @@ loadops: startup(context); worktoscreen(context); context.data.byte(kGetback) = 4; -quitloaded: - return; } void getbacktoops(Context &context) { @@ -16845,11 +16610,10 @@ alreadygetops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nogetbackops; + return /* (nogetbackops) */; context._and(context.ax, 1); if (!context.flags.z()) goto dogetbackops; -nogetbackops: return; dogetbackops: oldtonames(context); @@ -16868,11 +16632,10 @@ alreadydiscops: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto nodiscops; + return /* (nodiscops) */; context._and(context.ax, 1); if (!context.flags.z()) goto dodiscops; -nodiscops: return; dodiscops: scanfornames(context); @@ -16955,7 +16718,7 @@ alreadyactsave: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto noactsave; + return /* (noactsave) */; context.dx = context.data; context.ds = context.dx; context.si = 8579; @@ -16967,7 +16730,7 @@ alreadyactsave: context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) - goto noactsave; + return /* (noactsave) */; context.al = context.data.byte(kLocation); context.ah = 0; context.cx = 32; @@ -17003,8 +16766,6 @@ alreadyactsave: redrawmainscrn(context); worktoscreenm(context); context.data.byte(kGetback) = 4; -noactsave: - return; } void actualload(Context &context) { @@ -17019,10 +16780,10 @@ alreadyactload: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto notactload; + return /* (notactload) */; context._cmp(context.ax, 1); if (!context.flags.z()) - goto notactload; + return /* (notactload) */; context.dx = context.data; context.ds = context.dx; context.si = 8579; @@ -17034,11 +16795,9 @@ alreadyactload: context._inc(context.si); context._cmp(context.ds.byte(context.si), 0); if (context.flags.z()) - goto notactload; + return /* (notactload) */; loadposition(context); context.data.byte(kGetback) = 1; -notactload: - return; } void selectslot2(Context &context) { @@ -17055,12 +16814,12 @@ void checkinput(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLoadingorsave), 3); if (context.flags.z()) - goto nokeypress; + return /* (nokeypress) */; readkey(context); context.al = context.data.byte(kCurrentkey); context._cmp(context.al, 0); if (context.flags.z()) - goto nokeypress; + return /* (nokeypress) */; context._cmp(context.al, 13); if (!context.flags.z()) goto notret; @@ -17072,7 +16831,7 @@ notret: goto nodel2; context._cmp(context.data.byte(kCursorpos), 0); if (context.flags.z()) - goto nokeypress; + return /* (nokeypress) */; getnamepos(context); context._dec(context.data.byte(kCursorpos)); context.es.byte(context.bx) = 0; @@ -17081,7 +16840,7 @@ notret: nodel2: context._cmp(context.data.byte(kCursorpos), 14); if (context.flags.z()) - goto nokeypress; + return /* (nokeypress) */; getnamepos(context); context._inc(context.data.byte(kCursorpos)); context.al = context.data.byte(kCurrentkey); @@ -17089,7 +16848,6 @@ nodel2: context.es.byte(context.bx+2) = 0; context.es.byte(context.bx+3) = 1; goto afterkey; -nokeypress: return; afterkey: showopbox(context); @@ -17184,10 +16942,10 @@ alreadysel: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) - goto noselslot; + return /* (noselslot) */; context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto noselslot; + return /* (noselslot) */; context._cmp(context.data.byte(kLoadingorsave), 3); if (!context.flags.z()) goto notnocurs; @@ -17222,9 +16980,6 @@ isloadmode: showpointer(context); worktoscreen(context); delpointer(context); - return; -noselslot: - return; } void showslots(Context &context) { @@ -17484,14 +17239,12 @@ void findlen(Context &context) { nextone: context._cmp(context.cl, context.ds.byte(context.bx)); if (!context.flags.z()) - goto foundlen; + return /* (foundlen) */; context._dec(context.bx); context._dec(context.ax); context._cmp(context.ax, 0); if (!context.flags.z()) goto nextone; -foundlen: - return; } void scanfornames(Context &context) { @@ -17608,15 +17361,12 @@ alreadynewgame: context.ax = context.data.word(kMousebutton); context._cmp(context.ax, 1); if (!context.flags.z()) - goto nonewgame; + return /* (nonewgame) */; context.data.byte(kGetback) = 3; -nonewgame: - return; } void doload(Context &context) { STACK_CHECK(context); - context.data.byte(kLoadingorsave) = 1; showopbox(context); showloadops(context); context.data.byte(kCurrentslot) = 0; @@ -17640,7 +17390,7 @@ loadops: goto loadops; context._cmp(context.data.byte(kGetback), 2); if (context.flags.z()) - goto quitloaded; + return /* (quitloaded) */; getridoftemp(context); context.dx = context.data; context.es = context.dx; @@ -17658,8 +17408,6 @@ loadops: startup(context); worktoscreen(context); context.data.byte(kGetback) = 4; -quitloaded: - return; } void loadold(Context &context) { @@ -17674,16 +17422,14 @@ alreadyloadold: context.ax = context.data.word(kMousebutton); context._and(context.ax, 1); if (context.flags.z()) - goto noloadold; + return /* (noloadold) */; doload(context); context._cmp(context.data.byte(kGetback), 4); if (context.flags.z()) - goto noloadold; + return /* (noloadold) */; showdecisions(context); worktoscreenm(context); context.data.byte(kGetback) = 0; -noloadold: - return; } void createname(Context &context) { @@ -17735,7 +17481,7 @@ void trysoundalloc(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNeedsoundbuff), 1); if (context.flags.z()) - goto gotsoundbuff; + return /* (gotsoundbuff) */; context._inc(context.data.byte(kSoundtimes)); context.bx = (16384+2048)/16; allocatemem(context); @@ -17762,15 +17508,13 @@ void trysoundalloc(Context &context) { soundfail: context.es = context.data.word(kSoundbuffer); deallocatemem(context); -gotsoundbuff: - return; } void playchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) - goto dontbother4; + return /* (dontbother4) */; context.push(context.es); context.push(context.ds); context.push(context.bx); @@ -17814,18 +17558,16 @@ nosetloop: context.bx = context.pop(); context.ds = context.pop(); context.es = context.pop(); -dontbother4: - return; } void playchannel1(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) - goto dontbother5; + return /* (dontbother5) */; context._cmp(context.data.byte(kCh1playing), 7); if (context.flags.z()) - goto dontbother5; + return /* (dontbother5) */; context.push(context.es); context.push(context.ds); context.push(context.bx); @@ -17858,8 +17600,6 @@ notsecondbank1: context.bx = context.pop(); context.ds = context.pop(); context.es = context.pop(); -dontbother5: - return; } void makenextblock(Context &context) { @@ -17880,10 +17620,9 @@ mightbeonlych1: context.data.byte(kCh0playing) = 255; context._cmp(context.data.word(kCh1blockstocopy), 0); if (context.flags.z()) - goto notch1only; + return /* (notch1only) */; context._dec(context.data.word(kCh1blockstocopy)); channel1only(context); -notch1only: return; mightbeonlych0: context.data.byte(kCh1playing) = 255; @@ -17908,32 +17647,30 @@ void volumeadjust(Context &context) { context.al = context.data.byte(kVolumedirection); context._cmp(context.al, 0); if (context.flags.z()) - goto volok; + return /* (volok) */; context.al = context.data.byte(kVolume); context._cmp(context.al, context.data.byte(kVolumeto)); if (context.flags.z()) goto volfinish; context._add(context.data.byte(kVolumecount), 64); if (!context.flags.z()) - goto volok; + return /* (volok) */; context.al = context.data.byte(kVolume); context._add(context.al, context.data.byte(kVolumedirection)); context.data.byte(kVolume) = context.al; return; volfinish: context.data.byte(kVolumedirection) = 0; -volok: - return; } void loopchannel0(Context &context) { STACK_CHECK(context); context._cmp(context.data.word(kCh0blockstocopy), 0); if (!context.flags.z()) - goto notloop; + return /* (notloop) */; context._cmp(context.data.byte(kCh0repeat), 0); if (context.flags.z()) - goto notloop; + return /* (notloop) */; context._cmp(context.data.byte(kCh0repeat), 255); if (context.flags.z()) goto endlessloop; @@ -17946,9 +17683,6 @@ endlessloop: context.ax = context.data.word(kCh0blockstocopy); context._add(context.ax, context.data.word(kCh0oldblockstocopy)); context.data.word(kCh0blockstocopy) = context.ax; - return; -notloop: - return; } void cancelch0(Context &context) { @@ -18010,13 +17744,13 @@ slow: context._stosb(); if (--context.cx) goto slow; - goto doneit; + return /* (doneit) */; botok: context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto slow; - goto doneit; + return /* (doneit) */; toplot: context._cmp(context.ah, context.dh); if (context.flags.c()) @@ -18028,20 +17762,20 @@ toplot: context._stosb(); if (--context.cx) goto slow; - goto doneit; + return /* (doneit) */; topok: context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto slow; - goto doneit; + return /* (doneit) */; nodistort: context._add(context.al, context.ah); context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto slow; - goto doneit; + return /* (doneit) */; lowvolumemix: context._lodsb(); context.push(context.bx); @@ -18065,13 +17799,13 @@ lowvolumemix: context._stosb(); if (--context.cx) goto lowvolumemix; - goto doneit; + return /* (doneit) */; botokv: context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto lowvolumemix; - goto doneit; + return /* (doneit) */; toplotv: context._cmp(context.ah, context.dh); if (context.flags.c()) @@ -18083,21 +17817,19 @@ toplotv: context._stosb(); if (--context.cx) goto lowvolumemix; - goto doneit; + return /* (doneit) */; topokv: context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto lowvolumemix; - goto doneit; + return /* (doneit) */; nodistortv: context._add(context.al, context.ah); context._xor(context.al, context.dh); context._stosb(); if (--context.cx) goto lowvolumemix; -doneit: - return; } void entrytexts(Context &context) { @@ -18170,16 +17902,13 @@ notsarters2: notedenlob: context._cmp(context.data.byte(kLocation), 34); if (!context.flags.z()) - goto noteden2; + return /* (noteden2) */; context.al = 33; context.cx = 60; context.dx = 3; context.bl = 68; context.bh = 64; setuptimeduse(context); - return; -noteden2: - return; } void entryanims(Context &context) { @@ -18306,13 +18035,11 @@ notcarpark: notalley: context._cmp(context.data.byte(kLocation), 24); if (!context.flags.z()) - goto notedensagain; + return /* (notedensagain) */; context.al = 2; context.ah = context.data.byte(kRoomnum); context._dec(context.ah); turnanypathon(context); -notedensagain: - return; } void initialinv(Context &context) { @@ -18374,11 +18101,9 @@ void checkbasemem(Context &context) { context.bx = context.data.word(kHowmuchalloc); context._cmp(context.bx, 0x9360); if (!context.flags.c()) - goto enoughmem; + return /* (enoughmem) */; context.data.byte(kGameerror) = 5; { quickquit(context); return; }; -enoughmem: - return; } void allocatebuffers(Context &context) { @@ -18486,12 +18211,10 @@ void clearbeforeload(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 1); if (!context.flags.z()) - goto noclear; + return /* (noclear) */; clearreels(context); clearrest(context); context.data.byte(kRoomloaded) = 0; -noclear: - return; } void clearreels(Context &context) { @@ -18537,10 +18260,10 @@ lookattail: context.al = context.es.byte(context.bx); context._cmp(context.al, 0); if (context.flags.z()) - goto endtail; + return /* (endtail) */; context._cmp(context.al, 13); if (context.flags.z()) - goto endtail; + return /* (endtail) */; context._cmp(context.al, 'i'); if (context.flags.z()) goto issoundint; @@ -18607,8 +18330,6 @@ isnosound: context.data.byte(kSoundint) = 255; context._inc(context.bx); goto lookattail; -endtail: - return; } void startup(Context &context) { @@ -18658,7 +18379,7 @@ void screenupdate(Context &context) { goto iswatchingmode; context._cmp(context.data.byte(kNewlocation), 255); if (!context.flags.z()) - goto finishearly; + return /* (finishearly) */; iswatchingmode: vsync(context); readmouse1(context); @@ -18672,7 +18393,7 @@ iswatchingmode: showpointer(context); context._cmp(context.data.byte(kWongame), 0); if (!context.flags.z()) - goto finishearly; + return /* (finishearly) */; vsync(context); readmouse2(context); dumppointer(context); @@ -18695,8 +18416,6 @@ iswatchingmode: dumppointer(context); dumpwatch(context); delpointer(context); -finishearly: - return; } void watchreel(Context &context) { @@ -18707,12 +18426,11 @@ void watchreel(Context &context) { context.al = context.data.byte(kManspath); context._cmp(context.al, context.data.byte(kFinaldest)); if (!context.flags.z()) - goto waitstopwalk; + return /* (waitstopwalk) */; context.al = context.data.byte(kTurntoface); context._cmp(context.al, context.data.byte(kFacing)); if (context.flags.z()) goto notwatchpath; -waitstopwalk: return; notwatchpath: context._dec(context.data.byte(kSpeedcount)); @@ -18732,7 +18450,7 @@ notwatchpath: context.data.byte(kWatchmode) = -1; context._cmp(context.data.word(kReeltohold), -1); if (context.flags.z()) - goto nomorereel; + return /* (nomorereel) */; context.data.byte(kWatchmode) = 1; goto notplayingreel; ismorereel: @@ -18744,7 +18462,6 @@ showwatchreel: context.ax = context.data.word(kReelpointer); context.data.word(kReeltowatch) = context.ax; checkforshake(context); -nomorereel: return; notplayingreel: context._cmp(context.data.byte(kWatchmode), 1); @@ -18757,7 +18474,7 @@ notplayingreel: notholdingreel: context._cmp(context.data.byte(kWatchmode), 2); if (!context.flags.z()) - goto notreleasehold; + return /* (notreleasehold) */; context._dec(context.data.byte(kSpeedcount)); context._cmp(context.data.byte(kSpeedcount), -1); if (!context.flags.z()) @@ -18781,29 +18498,24 @@ ismorereel2: context.ax = context.data.word(kReeltohold); context.data.word(kReelpointer) = context.ax; plotreel(context); - return; -notreleasehold: - return; } void checkforshake(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kReallocation), 26); if (!context.flags.z()) - goto notstartshake; + return /* (notstartshake) */; context._cmp(context.ax, 104); if (!context.flags.z()) - goto notstartshake; + return /* (notstartshake) */; context.data.byte(kShakecounter) = -1; -notstartshake: - return; } void watchcount(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) - goto nowatchworn; + return /* (nowatchworn) */; context._inc(context.data.byte(kTimercount)); context._cmp(context.data.byte(kTimercount), 9); if (context.flags.z()) @@ -18811,7 +18523,6 @@ void watchcount(Context &context) { context._cmp(context.data.byte(kTimercount), 18); if (context.flags.z()) goto uptime; -nowatchworn: return; flashdots: context.ax = 91*3+21; @@ -18847,7 +18558,7 @@ void showtime(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) - goto nowatch; + return /* (nowatch) */; context.al = context.data.byte(kSecondcount); context.cl = 0; twodigitnum(context); @@ -18907,23 +18618,19 @@ void showtime(Context &context) { context.di = 267+5; context.bx = 21; showframe(context); -nowatch: - return; } void dumpwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchdump), 1); if (!context.flags.z()) - goto nodumpwatch; + return /* (nodumpwatch) */; context.di = 256; context.bx = 21; context.cl = 40; context.ch = 12; multidump(context); context.data.byte(kWatchdump) = 0; -nodumpwatch: - return; } void showbyte(Context &context) { @@ -19020,23 +18727,21 @@ void convnum(Context &context) { STACK_CHECK(context); context._cmp(context.ch, 0); if (!context.flags.z()) - goto noconvnum; + return /* (noconvnum) */; context._cmp(context.cl, '0'); if (!context.flags.z()) goto notzeronum; context.cl = 32; - goto noconvnum; + return /* (noconvnum) */; notzeronum: context.ch = 1; -noconvnum: - return; } void walkandexamine(Context &context) { STACK_CHECK(context); finishedwalking(context); if (!context.flags.z()) - goto noobselect; + return /* (noobselect) */; context.al = context.data.byte(kWalkexamtype); context.data.byte(kCommandtype) = context.al; context.al = context.data.byte(kWalkexamnum); @@ -19044,13 +18749,12 @@ void walkandexamine(Context &context) { context.data.byte(kWalkandexam) = 0; context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) - goto noobselect; + return /* (noobselect) */; examineob(context); return; wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; -noobselect: return; diff: context.data.byte(kCommand) = context.al; @@ -19127,10 +18831,8 @@ checkmain: checkcoords(context); context._cmp(context.data.byte(kWalkandexam), 0); if (context.flags.z()) - goto finishmain; + return /* (finishmain) */; walkandexamine(context); -finishmain: - return; } void madmanrun(Context &context) { @@ -19156,14 +18858,12 @@ void madmanrun(Context &context) { alreadyrun: context._cmp(context.data.word(kMousebutton), 1); if (!context.flags.z()) - goto norun; + return /* (norun) */; context.ax = context.data.word(kMousebutton); context._cmp(context.ax, context.data.word(kOldbutton)); if (context.flags.z()) - goto norun; + return /* (norun) */; context.data.byte(kLastweapon) = 8; -norun: - return; } void checkcoords(Context &context) { @@ -19176,7 +18876,7 @@ loop048: context.ax = context.cs.word(context.bx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) - goto nonefound; + return /* (nonefound) */; context.push(context.bx); context._cmp(context.data.word(kMousex), context.ax); if (context.flags.l()) @@ -19201,8 +18901,6 @@ over045: context.bx = context.pop(); context._add(context.bx, 10); goto loop048; -nonefound: - return; } void identifyob(Context &context) { @@ -19238,16 +18936,16 @@ notover2: context.ax = context.pop(); checkifex(context); if (!context.flags.z()) - goto finishidentify; + return /* (finishidentify) */; checkiffree(context); if (!context.flags.z()) - goto finishidentify; + return /* (finishidentify) */; checkifperson(context); if (!context.flags.z()) - goto finishidentify; + return /* (finishidentify) */; checkifset(context); if (!context.flags.z()) - goto finishidentify; + return /* (finishidentify) */; context.ax = context.data.word(kMousex); context._sub(context.ax, context.data.word(kMapadx)); context.cl = context.al; @@ -19263,7 +18961,6 @@ notover2: goto nothingund; context.ah = 3; obname(context); -finishidentify: return; nothingund: blank(context); @@ -19500,7 +19197,7 @@ pathloop: context._cmp(context.ch, context.ah); if (!context.flags.c()) goto flunkedit; - goto gotvalidpath; + return /* (gotvalidpath) */; flunkedit: context._add(context.bx, 8); context._inc(context.dl); @@ -19508,8 +19205,6 @@ flunkedit: if (!context.flags.z()) goto pathloop; context.dl = 255; -gotvalidpath: - return; } void findfirstpath(Context &context) { @@ -19568,7 +19263,7 @@ void turnpathon(Context &context) { context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) - goto nopathon; + return /* (nopathon) */; context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -19576,8 +19271,6 @@ void turnpathon(Context &context) { context._add(context.bx, context.ax); context.al = 255; context.es.byte(context.bx+6) = context.al; -nopathon: - return; } void turnpathoff(Context &context) { @@ -19593,7 +19286,7 @@ void turnpathoff(Context &context) { context.ax = context.pop(); context._cmp(context.al, 255); if (context.flags.z()) - goto nopathoff; + return /* (nopathoff) */; context.ah = 0; context._add(context.ax, context.ax); context._add(context.ax, context.ax); @@ -19601,8 +19294,6 @@ void turnpathoff(Context &context) { context._add(context.bx, context.ax); context.al = 0; context.es.byte(context.bx+6) = context.al; -nopathoff: - return; } void turnanypathon(Context &context) { @@ -19675,7 +19366,7 @@ void afternewroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) - goto notnew; + return /* (notnew) */; context.data.word(kTimecount) = 0; createpanel(context); context.data.byte(kCommandtype) = 0; @@ -19708,8 +19399,6 @@ ryansoff: walkintoroom(context); reminders(context); atmospheres(context); -notnew: - return; } void atmospheres(Context &context) { @@ -19773,16 +19462,15 @@ notmad1: playingalready: context._cmp(context.data.byte(kReallocation), 2); if (!context.flags.z()) - goto notlouisvol2; + return /* (notlouisvol2) */; context._cmp(context.data.byte(kMapx), 22); if (context.flags.z()) goto louisvol; context._cmp(context.data.byte(kMapx), 11); if (!context.flags.z()) - goto notlouisvol2; + return /* (notlouisvol2) */; fullvol: context.data.byte(kVolume) = 0; -notlouisvol2: return; louisvol: context.data.byte(kVolume) = 5; @@ -19798,22 +19486,20 @@ void walkintoroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLocation), 14); if (!context.flags.z()) - goto notlair; + return /* (notlair) */; context._cmp(context.data.byte(kMapx), 22); if (!context.flags.z()) - goto notlair; + return /* (notlair) */; context.data.byte(kDestination) = 1; context.data.byte(kFinaldest) = 1; autosetwalk(context); -notlair: - return; } void afterintroroom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNowinnewroom), 0); if (context.flags.z()) - goto notnewintro; + return /* (notnewintro) */; clearwork(context); findroominloc(context); context.data.byte(kNewobs) = 1; @@ -19823,8 +19509,6 @@ void afterintroroom(Context &context) { printsprites(context); worktoscreen(context); context.data.byte(kNowinnewroom) = 0; -notnewintro: - return; } void obname(Context &context) { @@ -19848,13 +19532,13 @@ notdiffob: goto walkandexamine; context._cmp(context.data.word(kMousebutton), 0); if (context.flags.z()) - goto noobselect; + return /* (noobselect) */; context._cmp(context.data.byte(kCommandtype), 3); if (!context.flags.z()) goto isntblock; context._cmp(context.data.byte(kLastflag), 2); if (context.flags.c()) - goto noobselect; + return /* (noobselect) */; isntblock: context.bl = context.data.byte(kManspath); context._cmp(context.bl, context.data.byte(kPointerspath)); @@ -19865,25 +19549,25 @@ isntblock: goto wantstowalk; finishedwalking(context); if (!context.flags.z()) - goto noobselect; + return /* (noobselect) */; context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) goto wantstotalk; context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) - goto noobselect; + return /* (noobselect) */; examineob(context); return; wantstotalk: context._cmp(context.data.word(kWatchingtime), 0); if (!context.flags.z()) - goto noobselect; + return /* (noobselect) */; talk(context); return; walkandexamine: finishedwalking(context); if (!context.flags.z()) - goto noobselect; + return /* (noobselect) */; context.al = context.data.byte(kWalkexamtype); context.data.byte(kCommandtype) = context.al; context.al = context.data.byte(kWalkexamnum); @@ -19891,13 +19575,12 @@ walkandexamine: context.data.byte(kWalkandexam) = 0; context._cmp(context.data.byte(kCommandtype), 5); if (context.flags.z()) - goto noobselect; + return /* (noobselect) */; examineob(context); return; wantstowalk: setwalk(context); context.data.byte(kReasseschanges) = 1; -noobselect: return; diff: context.data.byte(kCommand) = context.al; @@ -19966,11 +19649,9 @@ void finishedwalking(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kLinepointer), 254); if (!context.flags.z()) - goto iswalking; + return /* (iswalking) */; context.al = context.data.byte(kFacing); context._cmp(context.al, context.data.byte(kTurntoface)); -iswalking: - return; } void examineobtext(Context &context) { @@ -20170,7 +19851,7 @@ void setwalk(Context &context) { goto holdingreel; context._cmp(context.data.byte(kWatchmode), 2); if (context.flags.z()) - goto cantwalk; + return /* (cantwalk) */; context.data.byte(kDestination) = context.al; context.data.byte(kFinaldest) = context.al; context._cmp(context.data.word(kMousebutton), 2); @@ -20186,7 +19867,6 @@ void setwalk(Context &context) { context.data.byte(kWalkexamnum) = context.al; notwalkandexam: autosetwalk(context); -cantwalk: return; cantwalk2: facerightway(context); @@ -20713,15 +20393,13 @@ void showman(Context &context) { showframe(context); context._cmp(context.data.byte(kShadeson), 0); if (context.flags.z()) - goto notverycool; + return /* (notverycool) */; context.ds = context.data.word(kIcons1); context.di = 28; context.bx = 25; context.al = 2; context.ah = 0; showframe(context); -notverycool: - return; } void showpanel(Context &context) { @@ -20833,7 +20511,7 @@ void showwatch(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kWatchon), 0); if (context.flags.z()) - goto nowristwatch; + return /* (nowristwatch) */; context.ds = context.data.word(kIcons1); context.di = 250; context.bx = 1; @@ -20841,41 +20519,37 @@ void showwatch(Context &context) { context.ah = 0; showframe(context); showtime(context); -nowristwatch: - return; } void zoomicon(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 0); if (context.flags.z()) - goto nozoom1; + return /* (nozoom1) */; context.ds = context.data.word(kIcons1); context.di = (8); context.bx = (132)-1; context.al = 8; context.ah = 0; showframe(context); -nozoom1: - return; } void showblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kManisoffscreen), 1); if (context.flags.z()) - goto finblink1; + return /* (finblink1) */; context._inc(context.data.byte(kBlinkcount)); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) - goto finblink1; + return /* (finblink1) */; context._cmp(context.data.byte(kReallocation), 50); if (!context.flags.c()) - goto eyesshut; + return /* (eyesshut) */; context.al = context.data.byte(kBlinkcount); context._cmp(context.al, 3); if (!context.flags.z()) - goto finblink1; + return /* (finblink1) */; context.data.byte(kBlinkcount) = 0; context.al = context.data.byte(kBlinkframe); context._inc(context.al); @@ -20894,24 +20568,20 @@ nomorethan6: context.bx = 32; context.ah = 0; showframe(context); -finblink1: - return; -eyesshut: - return; } void dumpblink(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kShadeson), 0); if (!context.flags.z()) - goto nodumpeye; + return /* (nodumpeye) */; context._cmp(context.data.byte(kBlinkcount), 0); if (!context.flags.z()) - goto nodumpeye; + return /* (nodumpeye) */; context.al = context.data.byte(kBlinkframe); context._cmp(context.al, 6); if (!context.flags.c()) - goto nodumpeye; + return /* (nodumpeye) */; context.push(context.ds); context.di = 44; context.bx = 32; @@ -20919,8 +20589,6 @@ void dumpblink(Context &context) { context.ch = 12; multidump(context); context.ds = context.pop(); -nodumpeye: - return; } void worktoscreenm(Context &context) { @@ -20937,12 +20605,10 @@ void blank(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kCommandtype), 199); if (context.flags.z()) - goto alreadyblnk; + return /* (alreadyblnk) */; context.data.byte(kCommandtype) = 199; context.al = 0; commandonly(context); -alreadyblnk: - return; } void allpointer(Context &context) { @@ -21041,14 +20707,12 @@ void dumpzoom(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kZoomon), 1); if (!context.flags.z()) - goto notzoomon; + return /* (notzoomon) */; context.di = (8)+5; context.bx = (132)+4; context.cl = 46; context.ch = 40; multidump(context); -notzoomon: - return; } void putunderzoom(Context &context) { @@ -21207,7 +20871,7 @@ void delpointer(Context &context) { context.ax = context.data.word(kOldpointerx); context._cmp(context.ax, 0x0ffff); if (context.flags.z()) - goto nevershown; + return /* (nevershown) */; context.data.word(kDelherex) = context.ax; context.ax = context.data.word(kOldpointery); context.data.word(kDelherey) = context.ax; @@ -21220,8 +20884,6 @@ void delpointer(Context &context) { context.di = context.data.word(kDelherex); context.bx = context.data.word(kDelherey); multiput(context); -nevershown: - return; } void dumppointer(Context &context) { @@ -21239,13 +20901,11 @@ void dumppointer(Context &context) { goto difffound; context._cmp(context.bx, context.data.word(kDelherey)); if (context.flags.z()) - goto notboth; + return /* (notboth) */; difffound: context.cl = context.data.byte(kPointerxs); context.ch = context.data.byte(kPointerys); multidump(context); -notboth: - return; } void undertextline(Context &context) { @@ -21274,15 +20934,13 @@ void dumptextline(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kNewtextline), 1); if (!context.flags.z()) - goto nodumptextline; + return /* (nodumptextline) */; context.data.byte(kNewtextline) = 0; context.di = context.data.word(kTextaddressx); context.bx = context.data.word(kTextaddressy); context.cl = (180); context.ch = (10); multidump(context); -nodumptextline: - return; } void animpointer(Context &context) { @@ -21302,35 +20960,34 @@ notwatchpoint: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kInmaparea), 0); if (context.flags.z()) - goto gothand; + return /* (gothand) */; context._cmp(context.data.byte(kPointerfirstpath), 0); if (context.flags.z()) - goto gothand; + return /* (gothand) */; getflagunderp(context); context._cmp(context.cl, 2); if (context.flags.c()) - goto gothand; + return /* (gothand) */; context._cmp(context.cl, 128); if (!context.flags.c()) - goto gothand; + return /* (gothand) */; context.data.byte(kPointerframe) = 3; context._test(context.cl, 4); if (!context.flags.z()) - goto gothand; + return /* (gothand) */; context.data.byte(kPointerframe) = 4; context._test(context.cl, 16); if (!context.flags.z()) - goto gothand; + return /* (gothand) */; context.data.byte(kPointerframe) = 5; context._test(context.cl, 2); if (!context.flags.z()) - goto gothand; + return /* (gothand) */; context.data.byte(kPointerframe) = 6; context._test(context.cl, 8); if (!context.flags.z()) - goto gothand; + return /* (gothand) */; context.data.byte(kPointerframe) = 8; -gothand: return; mousehand: context._cmp(context.data.byte(kPointerspeed), 0); @@ -21357,13 +21014,11 @@ combathand: context.data.byte(kPointerframe) = 0; context._cmp(context.data.byte(kReallocation), 14); if (!context.flags.z()) - goto notarrow; + return /* (notarrow) */; context._cmp(context.data.byte(kCommandtype), 211); if (!context.flags.z()) - goto notarrow; + return /* (notarrow) */; context.data.byte(kPointerframe) = 5; -notarrow: - return; } void readmouse(Context &context) { @@ -21585,10 +21240,10 @@ void loadroomssample(Context &context) { context.al = context.data.byte(kRoomssample); context._cmp(context.al, 255); if (context.flags.z()) - goto loadedalready; + return /* (loadedalready) */; context._cmp(context.al, context.data.byte(kCurrentsample)); if (context.flags.z()) - goto loadedalready; + return /* (loadedalready) */; context.data.byte(kCurrentsample) = context.al; context.al = context.data.byte(kCurrentsample); context.cl = '0'; @@ -21598,23 +21253,19 @@ void loadroomssample(Context &context) { context.cs.word(context.di+10) = context.ax; context.dx = context.di; loadsecondsample(context); -loadedalready: - return; } void getridofreels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) - goto dontgetrid; + return /* (dontgetrid) */; context.es = context.data.word(kReel1); deallocatemem(context); context.es = context.data.word(kReel2); deallocatemem(context); context.es = context.data.word(kReel3); deallocatemem(context); -dontgetrid: - return; } void getridofall(Context &context) { @@ -21649,7 +21300,7 @@ void restorereels(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kRoomloaded), 0); if (context.flags.z()) - goto dontrestore; + return /* (dontrestore) */; context.al = context.data.byte(kReallocation); getroomdata(context); context.dx = context.bx; @@ -21675,8 +21326,6 @@ void restorereels(Context &context) { context.dx = 0; loadseg(context); closefile(context); -dontrestore: - return; } void restoreall(Context &context) { @@ -22095,7 +21744,7 @@ void readsetdata(Context &context) { context.data.word(kCurrentset) = context.ax; context._cmp(context.data.byte(kSoundint), 255); if (context.flags.z()) - goto novolumeload; + return /* (novolumeload) */; context.dx = 2286; openfile(context); context.cx = 2048-256; @@ -22103,8 +21752,6 @@ void readsetdata(Context &context) { context.dx = 16384; readfromfile(context); closefile(context); -novolumeload: - return; } void makename(Context &context) { -- cgit v1.2.3 From 71e457783eb830982aa5f89a3f72ea741f32ffef Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 12:47:03 -0400 Subject: BACKENDS: Add generic TaskbarManager class to handle taskbar integration --- backends/modular-backend.cpp | 3 ++ backends/modular-backend.h | 10 +++-- backends/platform/sdl/sdl.cpp | 17 ++++++++ backends/platform/sdl/sdl.h | 6 ++- common/taskbar.h | 98 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 common/taskbar.h diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index 525170d685..70c352303c 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -33,6 +33,7 @@ ModularBackend::ModularBackend() : _mutexManager(0), + _taskbarManager(0), _graphicsManager(0), _mixer(0) { @@ -43,6 +44,8 @@ ModularBackend::~ModularBackend() { _graphicsManager = 0; delete _mixer; _mixer = 0; + delete _taskbarManager; + _taskbarManager = 0; delete _mutexManager; _mutexManager = 0; } diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 3593130bf5..124a6ad807 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -27,20 +27,21 @@ class GraphicsManager; class MutexManager; +class TaskbarManager; /** * Base class for modular backends. - * + * * It wraps most functions to their manager equivalent, but not * all OSystem functions are implemented here. - * + * * A backend derivated from this class, will need to implement * these functions on its own: * OSystem::pollEvent() * OSystem::getMillis() * OSystem::delayMillis() * OSystem::getTimeAndDate() - * + * * And, it should also initialize all the managers variables * declared in this class, or override their related functions. */ @@ -111,7 +112,7 @@ public: virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; } //@} - + /** @name Mutex handling */ //@{ @@ -141,6 +142,7 @@ protected: /** @name Managers variables */ //@{ + TaskbarManager *_taskbarManager; MutexManager *_mutexManager; GraphicsManager *_graphicsManager; Audio::Mixer *_mixer; diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index fd27c82797..4520b74861 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -31,6 +31,7 @@ #include "backends/platform/sdl/sdl.h" #include "common/config-manager.h" #include "common/EventRecorder.h" +#include "common/taskbar.h" #include "common/textconsole.h" #include "backends/saves/default/default-saves.h" @@ -125,6 +126,9 @@ void OSystem_SDL::init() { if (_timerManager == 0) _timerManager = new SdlTimerManager(); + if (_taskbarManager == 0) + _taskbarManager = new Common::TaskbarManager(); + #ifdef USE_OPENGL // Setup a list with both SDL and OpenGL graphics modes setupGraphicsModes(); @@ -209,6 +213,19 @@ void OSystem_SDL::initBackend() { ModularBackend::initBackend(); } +void OSystem_SDL::engineInit() { + // Add the started engine to the list of recent tasks + _taskbarManager->addRecent(ConfMan.getActiveDomainName(), ConfMan.get("description")); + + // Set the overlay icon the current running engine + _taskbarManager->setOverlayIcon(ConfMan.getActiveDomainName(), ConfMan.get("description")); +} + +void OSystem_SDL::engineDone() { + // Remove overlay icon + _taskbarManager->setOverlayIcon("", ""); +} + void OSystem_SDL::initSDL() { // Check if SDL has not been initialized if (!_initedSDL) { diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9c08752054..19f913ef45 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -30,7 +30,7 @@ #include "backends/events/sdl/sdl-events.h" #include "backends/log/log.h" -/** +/** * Base OSystem class for all SDL ports. */ class OSystem_SDL : public ModularBackend { @@ -38,7 +38,7 @@ public: OSystem_SDL(); virtual ~OSystem_SDL(); - /** + /** * Pre-initialize backend. It should be called after * instantiating the backend. Early needed managers are * created here. @@ -54,6 +54,8 @@ public: // Override functions from ModularBackend and OSystem virtual void initBackend(); + virtual void engineInit(); + virtual void engineDone(); virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); virtual void fatalError(); diff --git a/common/taskbar.h b/common/taskbar.h new file mode 100644 index 0000000000..e29fcdcb36 --- /dev/null +++ b/common/taskbar.h @@ -0,0 +1,98 @@ +/* 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. + * + * $URL$ + * $Id$ + */ + +#ifndef COMMON_TASKBAR_MANAGER_H +#define COMMON_TASKBAR_MANAGER_H + +#include "common/str.h" + +namespace Common { + +class TaskbarManager { +public: + /** + * Values representing the taskbar progress state + */ + enum TaskbarProgressState { + NoProgress = 0, + Indeterminate = 1, + Normal = 2, + Error = 4, + Paused = 8 + }; + + TaskbarManager() {} + virtual ~TaskbarManager() {} + + /** + * Sets an overlay icon on the taskbar icon. + * + * When an empty name is given, no icon is shown + * and the current overlay icon (if any) is removed + * + * @param name Path to the icon + * @param description The description + * + * @note on Windows, the icon should be an ICO file + */ + virtual void setOverlayIcon(const String &name, const String &description) {} + + /** + * Sets a progress value on the taskbar icon + * + * @param val The current progress value + * @param max The maximum progress value + */ + virtual void setProgressValue(int val, int max) {} + + /** + * Sets the progress state on the taskbar icon + * + * State can be any of the following: + * - NoProgress: disable display of progress state + * - Indeterminate + * - Normal + * - Error + * - Paused + * + * @param state The progress state + */ + virtual void setProgressState(TaskbarProgressState state) {} + + /** + * Adds an engine to the recent items list + * + * Path is automatically set to the current executable path, + * an icon name is generated (with fallback to default icon) + * and the command line is set to start the engine on click. + * + * @param name The target name. + * @param description The description. + */ + virtual void addRecent(const String &name, const String &description) {} +}; + +} // End of namespace Common + +#endif // COMMON_TASKBAR_MANAGER_H -- cgit v1.2.3 From f67975a487704828a2005a26ed6725b01c2554db Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 12:48:01 -0400 Subject: BACKENDS: Add win32 stubs for taskbar integration --- backends/module.mk | 3 +- backends/platform/sdl/win32/win32.cpp | 6 +++- backends/taskbar/win32/win32-taskbar.cpp | 54 ++++++++++++++++++++++++++++++++ backends/taskbar/win32/win32-taskbar.h | 45 ++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 backends/taskbar/win32/win32-taskbar.cpp create mode 100644 backends/taskbar/win32/win32-taskbar.h diff --git a/backends/module.mk b/backends/module.mk index d1feae4317..7d5b86f561 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -89,7 +89,8 @@ MODULE_OBJS += \ fs/windows/windows-fs.o \ fs/windows/windows-fs-factory.o \ midi/windows.o \ - plugins/win32/win32-provider.o + plugins/win32/win32-provider.o \ + taskbar/win32/win32-taskbar.o endif ifdef AMIGAOS diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 5b14be4417..0fd2fbbd1d 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -36,6 +36,7 @@ #include "backends/platform/sdl/win32/win32.h" #include "backends/fs/windows/windows-fs-factory.h" +#include "backends/taskbar/win32/win32-taskbar.h" #include "common/memstream.h" @@ -81,9 +82,12 @@ void OSystem_Win32::init() { } #endif - // Initialze File System Factory + // Initialize File System Factory _fsFactory = new WindowsFilesystemFactory(); + // Initialize task bar manager + _taskbarManager = new Win32TaskbarManager(); + // Invoke parent implementation of this method OSystem_SDL::init(); } diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp new file mode 100644 index 0000000000..7f76791dfa --- /dev/null +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -0,0 +1,54 @@ +/* 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. + * + * $URL$ + * $Id$ + * + * Original code from EcWin7 - Copyright (C) 2010 Emanuele Colombo + * https://code.google.com/p/dukto/ + */ + +#include "common/scummsys.h" + +#include "common/textconsole.h" + +#include "backends/taskbar/win32/win32-taskbar.h" + +Win32TaskbarManager::Win32TaskbarManager() { +} + +Win32TaskbarManager::~Win32TaskbarManager() { +} + +void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { + warning("[Win32TaskbarManager::setOverlayIcon] Not implemented"); +} + +void Win32TaskbarManager::setProgressValue(int val, int max) { + warning("[Win32TaskbarManager::setProgressValue] Not implemented"); +} + +void Win32TaskbarManager::setProgressState(TaskbarProgressState state) { + warning("[Win32TaskbarManager::setProgressState] Not implemented"); +} + +void Win32TaskbarManager::addRecent(const Common::String &name, const Common::String &description) { + warning("[Win32TaskbarManager::addRecent] Not implemented"); +} \ No newline at end of file diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h new file mode 100644 index 0000000000..20c1a8d383 --- /dev/null +++ b/backends/taskbar/win32/win32-taskbar.h @@ -0,0 +1,45 @@ +/* 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. + * + * $URL$ + * $Id$ + * + * Original code from EcWin7 - Copyright (C) 2010 Emanuele Colombo + * https://code.google.com/p/dukto/ + */ + +#ifndef BACKEND_WIN32_TASKBAR_H +#define BACKEND_WIN32_TASKBAR_H + +#include "common/str.h" +#include "common/taskbar.h" + +class Win32TaskbarManager : public Common::TaskbarManager { +public: + Win32TaskbarManager(); + virtual ~Win32TaskbarManager(); + + virtual void setOverlayIcon(const Common::String &name, const Common::String &description); + virtual void setProgressValue(int val, int max); + virtual void setProgressState(TaskbarProgressState state); + virtual void addRecent(const Common::String &name, const Common::String &description); +}; + +#endif // BACKEND_WIN32_TASKBAR_H -- cgit v1.2.3 From 2c76a4af40fdafecd5191c55b3d54b204022c13b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 16 Jun 2011 16:29:48 +0200 Subject: DREAMWEB: Fix probably copy-paste error in asm This removes an (empty) 'unbounded code' block in dreamgen.cpp --- devtools/tasmrecover/dreamweb/sprite.asm | 2 +- engines/dreamweb/dreamgen.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm index bb7ba402f8..f6e883abeb 100644 --- a/devtools/tasmrecover/dreamweb/sprite.asm +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -441,7 +441,7 @@ notinbed: ret Edeninbath proc near cmp generaldead,0 - jz notinbed + jz notinbath cmp sartaindead,0 jnz notinbath call showgamereel diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 000b6d7e43..1d079d9571 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -632,16 +632,12 @@ void edeninbath(Context &context) { STACK_CHECK(context); context._cmp(context.data.byte(kGeneraldead), 0); if (context.flags.z()) - goto notinbed; + return /* (notinbath) */; context._cmp(context.data.byte(kSartaindead), 0); if (!context.flags.z()) return /* (notinbath) */; showgamereel(context); addtopeoplelist(context); -/*continuing to unbounded code: notinbed from eden:5-6*/ -notinbed: - return; - return; } void malefan(Context &context) { -- cgit v1.2.3 From c0ec09ac66162d253ab16e1fb9b3a85dfdd176d7 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 31 Mar 2011 04:46:36 -0400 Subject: BACKENDS: Implement Win32 taskbar progress state and recent list --- backends/platform/sdl/win32/win32.cpp | 1 + backends/taskbar/win32/win32-taskbar.cpp | 144 +++++++++++++++++++++++++++++-- backends/taskbar/win32/win32-taskbar.h | 19 +++- common/taskbar.h | 16 ++-- 4 files changed, 164 insertions(+), 16 deletions(-) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 0fd2fbbd1d..bb254786d5 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -87,6 +87,7 @@ void OSystem_Win32::init() { // Initialize task bar manager _taskbarManager = new Win32TaskbarManager(); + ((Win32TaskbarManager *)_taskbarManager)->init(); // Invoke parent implementation of this method OSystem_SDL::init(); diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 7f76791dfa..1ddbde10bc 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -25,30 +25,160 @@ * https://code.google.com/p/dukto/ */ -#include "common/scummsys.h" +#ifdef WIN32 -#include "common/textconsole.h" +// Needed for taskbar functions +#include +#include #include "backends/taskbar/win32/win32-taskbar.h" +#include "common/config-manager.h" +#include "common/textconsole.h" + +#include + +// System.Title property key, values taken from http://msdn.microsoft.com/en-us/library/bb787584.aspx +const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; + Win32TaskbarManager::Win32TaskbarManager() { + _taskbar = NULL; } Win32TaskbarManager::~Win32TaskbarManager() { + if (_taskbar) + _taskbar->Release(); + _taskbar = NULL; + + CoUninitialize(); +} + +void Win32TaskbarManager::init() { + // Do nothing if not running on Windows 7 of later + if (!isWin7OrLater()) + return; + + CoInitialize(NULL); + + // Try creating instance (on fail, _taskbar will contain NULL) + HRESULT hr = CoCreateInstance(CLSID_TaskbarList, + 0, + CLSCTX_INPROC_SERVER, + IID_ITaskbarList3, + reinterpret_cast (&(_taskbar))); + + if (SUCCEEDED(hr)) { + // Initialize taskbar object + if (FAILED(_taskbar->HrInit())) { + _taskbar->Release(); + _taskbar = NULL; + } + } else { + warning("[Win32TaskbarManager::init] Cannot create taskbar instance"); + } } void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { + if (_taskbar == NULL) + return; + warning("[Win32TaskbarManager::setOverlayIcon] Not implemented"); } -void Win32TaskbarManager::setProgressValue(int val, int max) { - warning("[Win32TaskbarManager::setProgressValue] Not implemented"); +void Win32TaskbarManager::setProgressValue(int completed, int total) { + if (_taskbar == NULL) + return; + + _taskbar->SetProgressValue(getHwnd(), completed, total); } void Win32TaskbarManager::setProgressState(TaskbarProgressState state) { - warning("[Win32TaskbarManager::setProgressState] Not implemented"); + if (_taskbar == NULL) + return; + + _taskbar->SetProgressState(getHwnd(), (TBPFLAG)state); } void Win32TaskbarManager::addRecent(const Common::String &name, const Common::String &description) { - warning("[Win32TaskbarManager::addRecent] Not implemented"); -} \ No newline at end of file + if (_taskbar == NULL) + return; + + // ANSI version doesn't seem to work correctly with Win7 jump lists, so explicitly use Unicode interface. + IShellLinkW *link; + + // Get the ScummVM executable path. + WCHAR path[MAX_PATH]; + GetModuleFileNameW(NULL, path, MAX_PATH); + + // Create a shell link. + if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&link)))) { + // Convert game name and description to Unicode. + LPWSTR game = ansiToUnicode(name.c_str()); + LPWSTR desc = ansiToUnicode(description.c_str()); + + // Set link properties. + link->SetPath(path); + link->SetArguments(game); + link->SetIconLocation(path, 0); // There's no way to get a game-specific icon, is there? + + // The link's display name must be set via property store. + IPropertyStore* propStore; + HRESULT hr = link->QueryInterface(&propStore); + if (SUCCEEDED(hr)) { + PROPVARIANT pv; + pv.vt = VT_LPWSTR; + pv.pwszVal = desc; + + hr = propStore->SetValue(PKEY_Title, pv); + + propStore->Commit(); + propStore->Release(); + } + + // SHAddToRecentDocs will cause the games to be added to the Recent list, allowing the + // user to pin them. + SHAddToRecentDocs(SHARD_LINK, link); + link->Release(); + delete[] game; + delete[] desc; + } +} + +bool Win32TaskbarManager::isWin7OrLater() { + OSVERSIONINFOEX versionInfo; + DWORDLONG conditionMask = 0; + + ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + versionInfo.dwMajorVersion = 6; + versionInfo.dwMinorVersion = 1; + + VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + + return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); +} + +LPWSTR Win32TaskbarManager::ansiToUnicode(const char *s) { + DWORD size = MultiByteToWideChar(0, 0, s, -1, NULL, 0); + + if (size > 0) { + LPWSTR result = new WCHAR[size]; + if (MultiByteToWideChar(0, 0, s, -1, result, size) != 0) + return result; + } + + return NULL; +} + +HWND Win32TaskbarManager::getHwnd() { + SDL_SysWMinfo wmi; + SDL_VERSION(&wmi.version); + + if(!SDL_GetWMInfo(&wmi)) + return NULL; + + return wmi.window; +} + +#endif diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index 20c1a8d383..d0871d36d2 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -28,18 +28,35 @@ #ifndef BACKEND_WIN32_TASKBAR_H #define BACKEND_WIN32_TASKBAR_H +#ifdef WIN32 + #include "common/str.h" #include "common/taskbar.h" +struct ITaskbarList3; + class Win32TaskbarManager : public Common::TaskbarManager { public: Win32TaskbarManager(); virtual ~Win32TaskbarManager(); + void init(); + virtual void setOverlayIcon(const Common::String &name, const Common::String &description); - virtual void setProgressValue(int val, int max); + virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); virtual void addRecent(const Common::String &name, const Common::String &description); + +private: + HWND _hwnd; + ITaskbarList3 *_taskbar; + + // Helper functions + bool isWin7OrLater(); + LPWSTR ansiToUnicode(const char *s); + HWND getHwnd(); }; +#endif + #endif // BACKEND_WIN32_TASKBAR_H diff --git a/common/taskbar.h b/common/taskbar.h index e29fcdcb36..ea1d218724 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -35,11 +35,11 @@ public: * Values representing the taskbar progress state */ enum TaskbarProgressState { - NoProgress = 0, - Indeterminate = 1, - Normal = 2, - Error = 4, - Paused = 8 + kTaskbarNoProgress = 0, + kTaskbarIndeterminate = 1, + kTaskbarNormal = 2, + kTaskbarError = 4, + kTaskbarPaused = 8 }; TaskbarManager() {} @@ -61,10 +61,10 @@ public: /** * Sets a progress value on the taskbar icon * - * @param val The current progress value - * @param max The maximum progress value + * @param completed The current progress value. + * @param total The maximum progress value. */ - virtual void setProgressValue(int val, int max) {} + virtual void setProgressValue(int completed, int total) {} /** * Sets the progress state on the taskbar icon -- cgit v1.2.3 From 0fd56852b65aed463d79cddc9545511107296809 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 31 Mar 2011 06:14:30 -0400 Subject: BACKENDS: Add support for custom game icon (recent items list and icon overlay) --- backends/taskbar/win32/win32-taskbar.cpp | 60 +++++++++++++++++++++++++++++--- backends/taskbar/win32/win32-taskbar.h | 3 +- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 1ddbde10bc..85c87f3680 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -31,12 +31,18 @@ #include #include +// For Bitmap and overlay icons +#include +using namespace Gdiplus; + +// For HWND +#include + #include "backends/taskbar/win32/win32-taskbar.h" #include "common/config-manager.h" #include "common/textconsole.h" - -#include +#include "common/file.h" // System.Title property key, values taken from http://msdn.microsoft.com/en-us/library/bb787584.aspx const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; @@ -82,7 +88,25 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo if (_taskbar == NULL) return; - warning("[Win32TaskbarManager::setOverlayIcon] Not implemented"); + if (name.empty()) { + _taskbar->SetOverlayIcon(getHwnd(), NULL, L""); + return; + } + + // Compute full icon path + Common::String path = getIconPath(name); + if (path.empty()) + return; + + HICON pIcon = (HICON)::LoadImage(NULL, path.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE); + + // Sets the overlay icon + LPWSTR desc = ansiToUnicode(description.c_str()); + _taskbar->SetOverlayIcon(getHwnd(), pIcon, desc); + + DestroyIcon(pIcon); + + delete[] desc; } void Win32TaskbarManager::setProgressValue(int completed, int total) { @@ -119,7 +143,17 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St // Set link properties. link->SetPath(path); link->SetArguments(game); - link->SetIconLocation(path, 0); // There's no way to get a game-specific icon, is there? + + Common::String iconPath = getIconPath(name); + if (iconPath.empty()) { + link->SetIconLocation(path, 0); // No game-specific icon available + } else { + LPWSTR icon = ansiToUnicode(iconPath.c_str()); + + link->SetIconLocation(icon, 0); + + delete[] icon; + } // The link's display name must be set via property store. IPropertyStore* propStore; @@ -144,6 +178,24 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St } } +Common::String Win32TaskbarManager::getIconPath(Common::String target) { + // Get extra path + Common::String extra = ConfMan.get("extrapath"); + + Common::String filename = target + ".ico"; + Common::String path = extra + filename; + + if (!Common::File::exists(filename)) { + // Try with the game id instead of the domain name + filename = ConfMan.get("gameid") + ".ico"; + + if (!Common::File::exists(filename)) + return ""; + } + + return extra + filename; +} + bool Win32TaskbarManager::isWin7OrLater() { OSVERSIONINFOEX versionInfo; DWORDLONG conditionMask = 0; diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index d0871d36d2..bdd45a942d 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -48,9 +48,10 @@ public: virtual void addRecent(const Common::String &name, const Common::String &description); private: - HWND _hwnd; ITaskbarList3 *_taskbar; + Common::String getIconPath(Common::String target); + // Helper functions bool isWin7OrLater(); LPWSTR ansiToUnicode(const char *s); -- cgit v1.2.3 From cd7822a29f22fd290a86281d65b965d32f667a49 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 31 Mar 2011 06:35:16 -0400 Subject: BACKENDS: Add engine-level accessor for TaskbarManager --- backends/modular-backend.cpp | 5 +++++ backends/modular-backend.h | 1 + common/system.h | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index 70c352303c..a2710bc1cf 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -238,3 +238,8 @@ void ModularBackend::displayMessageOnOSD(const char *msg) { void ModularBackend::quit() { exit(0); } + +Common::TaskbarManager *ModularBackend::getTaskbarManager() { + assert(_taskbarManager); + return _taskbarManager; +} diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 124a6ad807..6b5bfff989 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -134,6 +134,7 @@ public: //@{ virtual void quit(); + virtual TaskbarManager *getTaskbarManager(); virtual void displayMessageOnOSD(const char *msg); //@} diff --git a/common/system.h b/common/system.h index d26bc593aa..f556fa22f8 100644 --- a/common/system.h +++ b/common/system.h @@ -42,6 +42,7 @@ struct Rect; class SaveFileManager; class SearchSet; class String; +class TaskbarManager; class TimerManager; class SeekableReadStream; class WriteStream; @@ -1047,6 +1048,14 @@ public: return _savefileManager; } + /** + * Returns the TaskbarManager, used to handle progress bars, + * icon overlay, tasks and recent items list on the taskbar. + * + * @return the TaskbarManager for the current architecture + */ + virtual Common::TaskbarManager *getTaskbarManager() = 0; + /** * Returns the FilesystemFactory object, depending on the current architecture. * -- cgit v1.2.3 From 2be35013f1d014620f222da9ed32110ce77814da Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 31 Mar 2011 06:35:43 -0400 Subject: BACKENDS: Add progress to MassAdd dialog --- gui/massadd.cpp | 9 +++++++++ gui/massadd.h | 1 + 2 files changed, 10 insertions(+) diff --git a/gui/massadd.cpp b/gui/massadd.cpp index b0adce3f47..1578e75b25 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -24,6 +24,7 @@ #include "common/config-manager.h" #include "common/debug.h" #include "common/system.h" +#include "common/taskbar.h" #include "common/translation.h" #include "gui/launcher.h" // For addGameToConf() @@ -60,6 +61,7 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir) : Dialog("MassAdd"), _dirsScanned(0), _oldGamesCount(0), + _dirTotal(0), _okButton(0), _dirProgressText(0), _gameProgressText(0) { @@ -130,6 +132,9 @@ struct GameDescLess { void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { + // Remove progress bar from taskbar + g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress); + // FIXME: It's a really bad thing that we use two arbitrary constants if (cmd == kOkCmd) { // Sort the detected games. This is not strictly necessary, but nice for @@ -226,10 +231,14 @@ void MassAddDialog::handleTickle() { for (Common::FSList::const_iterator file = files.begin(); file != files.end(); ++file) { if (file->isDirectory()) { _scanStack.push(*file); + + _dirTotal++; } } _dirsScanned++; + + g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); } diff --git a/gui/massadd.h b/gui/massadd.h index 15cef7ba68..7350213835 100644 --- a/gui/massadd.h +++ b/gui/massadd.h @@ -60,6 +60,7 @@ private: int _dirsScanned; int _oldGamesCount; + int _dirTotal; Widget *_okButton; StaticTextWidget *_dirProgressText; -- cgit v1.2.3 From 2348eeed4c4c5f6bb55d9d566d7adbfa2f0c1136 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 13:30:13 -0400 Subject: BACKENDS: Add taskbar integration compat header for MingW --- backends/taskbar/win32/mingw-compat.h | 140 +++++++++++++++++++++++++++++++ backends/taskbar/win32/win32-taskbar.cpp | 35 +++++--- backends/taskbar/win32/win32-taskbar.h | 4 +- 3 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 backends/taskbar/win32/mingw-compat.h diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h new file mode 100644 index 0000000000..6324de3b34 --- /dev/null +++ b/backends/taskbar/win32/mingw-compat.h @@ -0,0 +1,140 @@ +/* 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. + * + * $URL$ + * $Id$ + * + */ + +// TODO: Remove header when the latest changes to the Windows SDK have been integrated into MingW +// For reference, the interface definitions here are imported the SDK headers and from the +// EcWin7 project (https://code.google.com/p/dukto/) + +#ifndef BACKEND_WIN32_TASKBAR_MINGW_H +#define BACKEND_WIN32_TASKBAR_MINGW_H + +#if defined(WIN32) +#if defined(__GNUC__) +#ifdef __MINGW32__ + +#define _WIN32_WINNT 0x0501 +#include +#include +#include +#include +#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK + +// Taskbar GUID definitions +DEFINE_GUID(CLSID_TaskbarList,0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90); +DEFINE_GUID(IID_ITaskbarList3,0xea1afb91,0x9e28,0x4b86,0x90,0xE9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf); +DEFINE_GUID(IID_IPropertyStore,0x886d8eeb,0x8cf2,0x4446,0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99); + +// Property key +typedef struct _tagpropertykey { + GUID fmtid; + DWORD pid; +} PROPERTYKEY; + +#define REFPROPERTYKEY const PROPERTYKEY & + +typedef struct tagPROPVARIANT PROPVARIANT; +#define REFPROPVARIANT const PROPVARIANT & + +// Property store +DECLARE_INTERFACE_(IPropertyStore, IUnknown) { + STDMETHOD (GetCount) (DWORD *cProps) PURE; + STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE; + STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; + STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; + STDMETHOD (Commit) (void) PURE; +}; +typedef IPropertyStore *LPIPropertyStore; + +// Mingw-specific defines for taskbar integration +typedef enum THUMBBUTTONMASK { + THB_BITMAP = 0x1, + THB_ICON = 0x2, + THB_TOOLTIP = 0x4, + THB_FLAGS = 0x8 +} THUMBBUTTONMASK; + +typedef enum THUMBBUTTONFLAGS { + THBF_ENABLED = 0, + THBF_DISABLED = 0x1, + THBF_DISMISSONCLICK = 0x2, + THBF_NOBACKGROUND = 0x4, + THBF_HIDDEN = 0x8, + THBF_NONINTERACTIVE = 0x10 +} THUMBBUTTONFLAGS; + +typedef struct THUMBBUTTON { + THUMBBUTTONMASK dwMask; + UINT iId; + UINT iBitmap; + HICON hIcon; + WCHAR szTip[260]; + THUMBBUTTONFLAGS dwFlags; +} THUMBBUTTON; +typedef struct THUMBBUTTON *LPTHUMBBUTTON; + +typedef enum TBPFLAG { + TBPF_NOPROGRESS = 0, + TBPF_INDETERMINATE = 0x1, + TBPF_NORMAL = 0x2, + TBPF_ERROR = 0x4, + TBPF_PAUSED = 0x8 +} TBPFLAG; + +// Taskbar interface +DECLARE_INTERFACE_(ITaskbarList3, IUnknown) { + // IUnknown + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + // ITaskbarList + STDMETHOD(HrInit) (THIS) PURE; + STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE; + STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE; + // ITaskbarList3 + STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE; + STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE; + STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE; + STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE; + STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE; + STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE; + STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE; + STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; + STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; + STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; +}; + + +typedef ITaskbarList3 *LPITaskbarList3; + +#endif // __MINGW32__ +#endif // __GNUC__ +#endif // WIN32 + +#endif // BACKEND_WIN32_TASKBAR_MINGW_H diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 85c87f3680..768bf5b64e 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -21,20 +21,23 @@ * $URL$ * $Id$ * - * Original code from EcWin7 - Copyright (C) 2010 Emanuele Colombo - * https://code.google.com/p/dukto/ */ -#ifdef WIN32 +#if defined(WIN32) // Needed for taskbar functions -#include +#if defined(__GNUC__) +#ifdef __MINGW32__ + #include "backends/taskbar/win32/mingw-compat.h" +#else + #error Only compilation with MingW is supported +#endif +#else + // Default MSVC headers for ITaskbarList3 and IShellLink + #include +#endif #include -// For Bitmap and overlay icons -#include -using namespace Gdiplus; - // For HWND #include @@ -85,6 +88,8 @@ void Win32TaskbarManager::init() { } void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { + //warning("[Win32TaskbarManager::setOverlayIcon] Setting overlay icon to: %s (%s)", name.c_str(), description.c_str()); + if (_taskbar == NULL) return; @@ -99,6 +104,10 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo return; HICON pIcon = (HICON)::LoadImage(NULL, path.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE); + if (!pIcon) { + warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!"); + return; + } // Sets the overlay icon LPWSTR desc = ansiToUnicode(description.c_str()); @@ -124,6 +133,8 @@ void Win32TaskbarManager::setProgressState(TaskbarProgressState state) { } void Win32TaskbarManager::addRecent(const Common::String &name, const Common::String &description) { + //warning("[Win32TaskbarManager::addRecent] Adding recent list entry: %s (%s)", name.c_str(), description.c_str()); + if (_taskbar == NULL) return; @@ -135,7 +146,7 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St GetModuleFileNameW(NULL, path, MAX_PATH); // Create a shell link. - if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_PPV_ARGS(&link)))) { + if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_IShellLinkW, reinterpret_cast (&link)))) { // Convert game name and description to Unicode. LPWSTR game = ansiToUnicode(name.c_str()); LPWSTR desc = ansiToUnicode(description.c_str()); @@ -157,7 +168,7 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St // The link's display name must be set via property store. IPropertyStore* propStore; - HRESULT hr = link->QueryInterface(&propStore); + HRESULT hr = link->QueryInterface(IID_IPropertyStore, reinterpret_cast (&(propStore))); if (SUCCEEDED(hr)) { PROPVARIANT pv; pv.vt = VT_LPWSTR; @@ -169,8 +180,7 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St propStore->Release(); } - // SHAddToRecentDocs will cause the games to be added to the Recent list, allowing the - // user to pin them. + // SHAddToRecentDocs will cause the games to be added to the Recent list, allowing the user to pin them. SHAddToRecentDocs(SHARD_LINK, link); link->Release(); delete[] game; @@ -183,7 +193,6 @@ Common::String Win32TaskbarManager::getIconPath(Common::String target) { Common::String extra = ConfMan.get("extrapath"); Common::String filename = target + ".ico"; - Common::String path = extra + filename; if (!Common::File::exists(filename)) { // Try with the game id instead of the domain name diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index bdd45a942d..f9ce9c16fc 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -21,14 +21,12 @@ * $URL$ * $Id$ * - * Original code from EcWin7 - Copyright (C) 2010 Emanuele Colombo - * https://code.google.com/p/dukto/ */ #ifndef BACKEND_WIN32_TASKBAR_H #define BACKEND_WIN32_TASKBAR_H -#ifdef WIN32 +#if defined(WIN32) #include "common/str.h" #include "common/taskbar.h" -- cgit v1.2.3 From fe347e4339e25607c4f35ca4892ef9f4b4211108 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 13:31:13 -0400 Subject: TOOLS: Add ole32.lib and uuid.lib to Code::Blocks linked libraries --- devtools/create_project/create_project.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 29bc5bfcd5..aafbe7585b 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -364,6 +364,11 @@ int main(int argc, char *argv[]) { provider = new CreateProjectTool::CodeBlocksProvider(globalWarnings, projectWarnings); + + // Those libraries are automatically added by MSVC, but we need to add them manually with mingw + setup.libraries.push_back("ole32"); + setup.libraries.push_back("uuid"); + break; case kProjectMSVC: -- cgit v1.2.3 From a523ade3329a36a50c75161279ced7c0d754906f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 1 Apr 2011 01:04:46 -0400 Subject: BACKENDS: Add stubs for unity taskbar class --- backends/module.mk | 3 +- backends/taskbar/unity/unity-taskbar.cpp | 56 ++++++++++++++++++++++++++++++++ backends/taskbar/unity/unity-taskbar.h | 49 ++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 backends/taskbar/unity/unity-taskbar.cpp create mode 100644 backends/taskbar/unity/unity-taskbar.h diff --git a/backends/module.mk b/backends/module.mk index 7d5b86f561..9869587a51 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -75,7 +75,8 @@ MODULE_OBJS += \ fs/posix/posix-fs.o \ fs/posix/posix-fs-factory.o \ plugins/posix/posix-provider.o \ - saves/posix/posix-saves.o + saves/posix/posix-saves.o \ + taskbar/unity/unity-taskbar.o endif ifdef MACOSX diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp new file mode 100644 index 0000000000..98616a7587 --- /dev/null +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -0,0 +1,56 @@ +/* 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. + * + * $URL$ + * $Id$ + * + */ + +#if defined(UNIX) + +#include "backends/taskbar/unity/unity-taskbar.h" + +#include "common/config-manager.h" +#include "common/textconsole.h" +#include "common/file.h" + +UnityTaskbarManager::UnityTaskbarManager() { +} + +UnityTaskbarManager::~UnityTaskbarManager() { +} + +void UnityTaskbarManager::setOverlayIcon(Common::String name, Common::String description) { + warning("[UnityTaskbarManager::setOverlayIcon] Not implemented"); +} + +void UnityTaskbarManager::setProgressValue(int completed, int total) { + warning("[UnityTaskbarManager::setProgressValue] Not implemented"); +} + +void UnityTaskbarManager::setProgressState(TaskbarProgressState state) { + warning("[UnityTaskbarManager::setProgressState] Not implemented"); +} + +void UnityTaskbarManager::addRecent(Common::String name, Common::String description) { + warning("[UnityTaskbarManager::addRecent] Not implemented"); +} + +#endif diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h new file mode 100644 index 0000000000..a49f369cac --- /dev/null +++ b/backends/taskbar/unity/unity-taskbar.h @@ -0,0 +1,49 @@ +/* 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. + * + * $URL$ + * $Id$ + * + */ + +#ifndef BACKEND_UNITY_TASKBAR_H +#define BACKEND_UNITY_TASKBAR_H + +#if defined(UNIX) + +#include "common/str.h" +#include "common/taskbar.h" + +class UnityTaskbarManager : public Common::TaskbarManager { +public: + UnityTaskbarManager(); + virtual ~UnityTaskbarManager(); + + virtual void setOverlayIcon(Common::String name, Common::String description); + virtual void setProgressValue(int completed, int total); + virtual void setProgressState(TaskbarProgressState state); + virtual void addRecent(Common::String name, Common::String description); + +private: +}; + +#endif + +#endif // BACKEND_UNITY_TASKBAR_H -- cgit v1.2.3 From c3d9c6afa57055705849359deaac7c5748d66fe1 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 1 Apr 2011 01:30:12 -0400 Subject: BACKENDS: Add use flag for taskbar integration --- backends/platform/sdl/win32/win32.cpp | 4 +++- backends/taskbar/unity/unity-taskbar.cpp | 2 +- backends/taskbar/unity/unity-taskbar.h | 2 +- backends/taskbar/win32/win32-taskbar.cpp | 2 +- backends/taskbar/win32/win32-taskbar.h | 2 +- configure | 30 ++++++++++++++++++++++++++++++ devtools/create_project/create_project.cpp | 1 + 7 files changed, 38 insertions(+), 5 deletions(-) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index bb254786d5..0a6702b6d9 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -85,9 +85,11 @@ void OSystem_Win32::init() { // Initialize File System Factory _fsFactory = new WindowsFilesystemFactory(); - // Initialize task bar manager +#if defined(USE_TASKBAR) + // Initialize taskbar manager _taskbarManager = new Win32TaskbarManager(); ((Win32TaskbarManager *)_taskbarManager)->init(); +#endif // Invoke parent implementation of this method OSystem_SDL::init(); diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 98616a7587..4a074abca2 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -23,7 +23,7 @@ * */ -#if defined(UNIX) +#if defined(UNIX) && defined(USE_TASKBAR) #include "backends/taskbar/unity/unity-taskbar.h" diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index a49f369cac..cd8efdaf2a 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -26,7 +26,7 @@ #ifndef BACKEND_UNITY_TASKBAR_H #define BACKEND_UNITY_TASKBAR_H -#if defined(UNIX) +#if defined(UNIX) && defined(USE_TASKBAR) #include "common/str.h" #include "common/taskbar.h" diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 768bf5b64e..91c4e2399c 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -23,7 +23,7 @@ * */ -#if defined(WIN32) +#if defined(WIN32) && defined(USE_TASKBAR) // Needed for taskbar functions #if defined(__GNUC__) diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index f9ce9c16fc..7d963c19ca 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -26,7 +26,7 @@ #ifndef BACKEND_WIN32_TASKBAR_H #define BACKEND_WIN32_TASKBAR_H -#if defined(WIN32) +#if defined(WIN32) && defined(USE_TASKBAR) #include "common/str.h" #include "common/taskbar.h" diff --git a/configure b/configure index cb06643b34..fca8791b40 100755 --- a/configure +++ b/configure @@ -138,6 +138,7 @@ _fluidsynth=auto _opengl=auto _opengles=auto _readline=auto +_taskbar=auto # Default option behaviour yes/no _debug_build=auto _release_build=auto @@ -771,6 +772,9 @@ Optional Libraries: --with-readline-prefix=DIR Prefix where readline is installed (optional) --disable-readline disable readline support in text console [autodetect] + --with-unity-prefix=DIR Prefix where libunity is installed (optional) + --disable-unity disable unity[autodetect] + Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory @@ -818,6 +822,8 @@ for ac_option in $@; do --disable-fluidsynth) _fluidsynth=no ;; --enable-readline) _readline=yes ;; --disable-readline) _readline=no ;; + --enable-taskbar) _taskbar=yes ;; + --disable-taskbar) _taskbar=no ;; --enable-opengl) _opengl=yes ;; --disable-opengl) _opengl=no ;; --enable-verbose-build) _verbose_build=yes ;; @@ -893,6 +899,11 @@ for ac_option in $@; do READLINE_CFLAGS="-I$arg/include" READLINE_LIBS="-L$arg/lib" ;; + --with-unity-prefix=*) + arg=`echo $ac_option | cut -d '=' -f 2` + UNITY_CFLAGS="-I$arg/include" + UNITY_LIBS="-L$arg/lib" + ;; --with-opengl-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` OPENGL_CFLAGS="-I$arg/include" @@ -2920,6 +2931,25 @@ define_in_config_h_if_yes "$_readline" 'USE_READLINE' define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' +# +# Check for Unity if taskbar integration is enabled +# +echocheck "taskbar" +if test "$_taskbar" = auto ; then + _taskbar=no + cat > $TMPC << EOF +#include +int main(void) { return 0; } +EOF + cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _taskbar=yes +fi +if test "$_taskbar" = yes ; then + LIBS="$LIBS $UNITY_LIBS -lunity" + INCLUDES="$INCLUDES $UNITY_CFLAGS" +fi +define_in_config_h_if_yes "$_taskbar" 'USE_TASKBAR' +echo "$_taskbar" + # # Check for OpenGL (ES) # diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index aafbe7585b..35d08561bf 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -779,6 +779,7 @@ const Feature s_features[] = { { "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" }, { "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling. { "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" }, + { "taskbar", "USE_TASKBAR", "", true, "Taskbar integration support" }, { "translation", "USE_TRANSLATION", "", true, "Translation support" }, { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"}, { "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there -- cgit v1.2.3 From 984e1968bce3b4a23833719653a5d5751e5c8a04 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 1 Apr 2011 08:01:53 -0400 Subject: BACKENDS: Add WIP Unity support --- backends/platform/sdl/posix/posix.cpp | 6 +++++ backends/taskbar/unity/unity-taskbar.cpp | 43 +++++++++++++++++++++++++++----- backends/taskbar/unity/unity-taskbar.h | 7 ++++-- configure | 23 +++++++++-------- 4 files changed, 61 insertions(+), 18 deletions(-) diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index d757186134..f124a3af7d 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -33,6 +33,7 @@ #include "backends/platform/sdl/posix/posix.h" #include "backends/saves/posix/posix-saves.h" #include "backends/fs/posix/posix-fs-factory.h" +#include "backends/taskbar/unity/unity-taskbar.h" #include #include @@ -49,6 +50,11 @@ void OSystem_POSIX::init() { // Initialze File System Factory _fsFactory = new POSIXFilesystemFactory(); +#if defined(USE_TASKBAR) + // Initialize taskbar manager + _taskbarManager = new UnityTaskbarManager(); +#endif + // Invoke parent implementation of this method OSystem_SDL::init(); } diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 4a074abca2..6c18f0940c 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -23,33 +23,64 @@ * */ +#include "common/scummsys.h" + #if defined(UNIX) && defined(USE_TASKBAR) #include "backends/taskbar/unity/unity-taskbar.h" -#include "common/config-manager.h" #include "common/textconsole.h" -#include "common/file.h" UnityTaskbarManager::UnityTaskbarManager() { + g_type_init(); + + _launcher = unity_launcher_entry_get_for_desktop_id("scummvm.desktop"); } UnityTaskbarManager::~UnityTaskbarManager() { } -void UnityTaskbarManager::setOverlayIcon(Common::String name, Common::String description) { +void UnityTaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { + if (_launcher == NULL) + return; + warning("[UnityTaskbarManager::setOverlayIcon] Not implemented"); } void UnityTaskbarManager::setProgressValue(int completed, int total) { - warning("[UnityTaskbarManager::setProgressValue] Not implemented"); + if (_launcher == NULL) + return; + + double percentage = (double)completed / (double)total; + unity_launcher_entry_set_progress(_launcher, percentage); + unity_launcher_entry_set_progress_visible(_launcher, TRUE); } void UnityTaskbarManager::setProgressState(TaskbarProgressState state) { - warning("[UnityTaskbarManager::setProgressState] Not implemented"); + if (_launcher == NULL) + return; + + switch (state) { + default: + warning("[UnityTaskbarManager::setProgressState] Unknown state / Not implemented (%d)", state); + // fallback to noprogress state + + case kTaskbarNoProgress: + unity_launcher_entry_set_progress_visible(_launcher, FALSE); + break; + + // Unity only support two progress states as of 3.0: visible or not visible + // We show progress in all of those states + case kTaskbarIndeterminate: + case kTaskbarNormal: + case kTaskbarError: + case kTaskbarPaused: + unity_launcher_entry_set_progress_visible(_launcher, TRUE); + break; + } } -void UnityTaskbarManager::addRecent(Common::String name, Common::String description) { +void UnityTaskbarManager::addRecent(const Common::String &name, const Common::String &description) { warning("[UnityTaskbarManager::addRecent] Not implemented"); } diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index cd8efdaf2a..0d0484c02e 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -31,17 +31,20 @@ #include "common/str.h" #include "common/taskbar.h" +#include + class UnityTaskbarManager : public Common::TaskbarManager { public: UnityTaskbarManager(); virtual ~UnityTaskbarManager(); - virtual void setOverlayIcon(Common::String name, Common::String description); + virtual void setOverlayIcon(const Common::String &name, const Common::String &description); virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); - virtual void addRecent(Common::String name, Common::String description); + virtual void addRecent(const Common::String &name, const Common::String &description); private: + UnityLauncherEntry *_launcher; }; #endif diff --git a/configure b/configure index fca8791b40..fc0e3c0e3e 100755 --- a/configure +++ b/configure @@ -138,7 +138,7 @@ _fluidsynth=auto _opengl=auto _opengles=auto _readline=auto -_taskbar=auto +_unity=auto # Default option behaviour yes/no _debug_build=auto _release_build=auto @@ -822,8 +822,8 @@ for ac_option in $@; do --disable-fluidsynth) _fluidsynth=no ;; --enable-readline) _readline=yes ;; --disable-readline) _readline=no ;; - --enable-taskbar) _taskbar=yes ;; - --disable-taskbar) _taskbar=no ;; + --enable-unity) _unity=yes ;; + --disable-unity) _unity=no ;; --enable-opengl) _opengl=yes ;; --disable-opengl) _opengl=no ;; --enable-verbose-build) _verbose_build=yes ;; @@ -2934,21 +2934,24 @@ define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' # # Check for Unity if taskbar integration is enabled # -echocheck "taskbar" -if test "$_taskbar" = auto ; then - _taskbar=no +echocheck "unity" +# Unity has a lots of dependency, update the libs and cflags var with them +UNITY_LIBS="$UNITY_LIBS $(pkg-config --libs unity)" +UNITY_CFLAGS="$UNITY_CFLAGS $(pkg-config --cflags unity)" +if test "$_unity" = auto ; then + _unity=no cat > $TMPC << EOF #include int main(void) { return 0; } EOF - cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _taskbar=yes + cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _unity=yes fi -if test "$_taskbar" = yes ; then +if test "$_unity" = yes ; then LIBS="$LIBS $UNITY_LIBS -lunity" INCLUDES="$INCLUDES $UNITY_CFLAGS" fi -define_in_config_h_if_yes "$_taskbar" 'USE_TASKBAR' -echo "$_taskbar" +define_in_config_h_if_yes "$_unity" 'USE_TASKBAR' +echo "$_unity" # # Check for OpenGL (ES) -- cgit v1.2.3 From cd09b7e74fd9552901505082166b679c39f85ccc Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sat, 2 Apr 2011 19:09:12 -0400 Subject: BACKENDS: Only update unity libs and cflags in auto mode --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index fc0e3c0e3e..37dfc807b7 100755 --- a/configure +++ b/configure @@ -2935,10 +2935,10 @@ define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' # Check for Unity if taskbar integration is enabled # echocheck "unity" -# Unity has a lots of dependency, update the libs and cflags var with them -UNITY_LIBS="$UNITY_LIBS $(pkg-config --libs unity)" -UNITY_CFLAGS="$UNITY_CFLAGS $(pkg-config --cflags unity)" if test "$_unity" = auto ; then + # Unity has a lots of dependency, update the libs and cflags var with them + UNITY_LIBS="$UNITY_LIBS $(pkg-config --libs unity)" + UNITY_CFLAGS="$UNITY_CFLAGS $(pkg-config --cflags unity)" _unity=no cat > $TMPC << EOF #include -- cgit v1.2.3 From ae67a9a958e26a237ddb7910f6c4a1b6b088dc77 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 16 Jun 2011 16:43:48 +0200 Subject: DREAMWEB: Re-optimize unbounded code blocks This gets rid of some unused labels. We need to be careful not be optimize too much, as that could remove the very label the unbounded block was added for. --- devtools/tasmrecover/tasm/cpp.py | 2 ++ devtools/tasmrecover/tasm/proc.py | 4 ++-- engines/dreamweb/dreamgen.cpp | 12 +----------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 5d460961a6..da21efe21d 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -483,6 +483,8 @@ namespace %s { self.proc.stmts.append(s) self.proc.add("ret") print "skipping %d instructions, todo: %d" %(start, len(self.proc.stmts) - start) + print "re-optimizing..." + self.proc.optimize(keep_labels=[label]) self.proc.visit(self, start) self.body += "}\n"; self.translated.insert(0, self.body) diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index e5af1afae5..6db3b7a682 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -66,7 +66,7 @@ class proc: i += 1 return - def optimize(self): + def optimize(self, keep_labels=[]): print "optimizing..." #trivial simplifications while len(self.stmts) and isinstance(self.stmts[-1], op.label): @@ -109,7 +109,7 @@ class proc: if not isinstance(s, op.label): continue print "checking label %s..." %s.name - used = False + used = s.name in keep_labels if s.name not in self.retlabels: for j in self.stmts: if isinstance(j, op.basejmp) and j.label == s.name: diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 1d079d9571..7ad10a2e42 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3984,11 +3984,8 @@ atlast2: context.ds.byte(context.di+17) = context.al; context._cmp(context.cl, 5); if (!context.flags.z()) - goto notnearly; + return /* (notnearly) */; context.data.byte(kThroughdoor) = 0; -notnearly: - return; - return; } void updatepeople(Context &context) { @@ -7343,12 +7340,6 @@ iswatching: justgetback: context.data.byte(kInvopen) = 0; context.data.byte(kOpenedob) = 255; - return; -examlist: -invlist1: -openchangesize: -withlist1: - return; } void setpickup(Context &context) { @@ -13731,7 +13722,6 @@ axeondoor: context.data.byte(kWatchspeed) = 1; context.data.byte(kSpeedcount) = 1; context.data.byte(kGetback) = 1; - return; } void useelvdoor(Context &context) { -- cgit v1.2.3 From daf277f146daf230db5207448800fef6e3889034 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Mon, 18 Apr 2011 22:06:15 -0500 Subject: CONFIGURE: add warning for building WIP/unstable engines Also, If any unstable/wip engine is enabled, #define TAINTED_BUILD --- configure | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 76 insertions(+), 8 deletions(-) diff --git a/configure b/configure index cb06643b34..8b7feba443 100755 --- a/configure +++ b/configure @@ -65,8 +65,12 @@ get_var() { # Add an engine: id name build subengines add_engine() { _engines="${_engines} ${1}" + if test "${3}" == "no" ; then + set_var _wip_engines "${_wip_engines} ${1}" + fi set_var _engine_${1}_name "${2}" set_var _engine_${1}_build "${3}" + set_var _engine_${1}_build_default "${3}" set_var _engine_${1}_subengines "${4}" for sub in ${4}; do set_var _engine_${sub}_sub "yes" @@ -176,6 +180,7 @@ _sdlpath="$PATH" _nasmpath="$PATH" NASMFLAGS="" NASM="" +_tainted_build=no # The following variables are automatically detected, and should not # be modified otherwise. Consider them read-only. _posix=no @@ -423,6 +428,11 @@ get_engine_build() { get_var _engine_$1_build } +# Was this engine set to be built by default? +get_engine_build_default() { + get_var _engine_$1_build_default +} + # Get the subengines get_engine_subengines() { get_var _engine_$1_subengines @@ -542,12 +552,19 @@ prepare_engine_build_strings() { if test -n "$string" ; then _engines_skipped="${_engines_skipped}#$string@" fi + + string=`get_engine_build_string $1 wip` + if test -n "$string" ; then + _engines_built_wip="${_engines_built_wip}#$string@" + fi + } # Get the string about building an engine get_engine_build_string() { engine_string="" engine_build=`get_engine_build $1` + engine_build_default=`get_engine_build_default $1` show=no # Check if the current engine should be shown for the current status @@ -563,6 +580,14 @@ get_engine_build_string() { fi done fi + # Test for enabled wip sub-engines + if test $2 = wip ; then + for subeng in `get_engine_subengines $1` ; do + if test `get_engine_build $subeng` != no -a `get_engine_build_default $subeng` = no ; then + show=yes + fi + done + fi fi # Convert static/dynamic to yes to ease the check of subengines @@ -570,13 +595,18 @@ get_engine_build_string() { engine_build=yes fi + # Check if it is a wip engine + if test "$2" = "wip" -a "$engine_build" != "no" -a "$engine_build_default" = no; then + show=yes + fi + # The engine should be shown, build the string if test $show = yes ; then build_string_func=get_${1}_build_string if ( type $build_string_func | grep function ) 2> /dev/null > /dev/null ; then - engine_string=`$build_string_func $1 $engine_build` + engine_string=`$build_string_func $1 $engine_build $2` else - engine_string=`get_subengines_build_string $1 $engine_build` + engine_string=`get_subengines_build_string $1 $engine_build "" $2` fi engine_string="`get_engine_name $1` $engine_string" @@ -588,14 +618,29 @@ get_engine_build_string() { # Get the string about building subengines get_subengines_build_string() { all=yes + parent_engine=$1 subengine_string=$3 - for subeng in `get_engine_subengines $1` ; do - if test `get_engine_build $subeng` = $2 ; then + parent_status=$4 + parent_engine_build_default=`get_engine_build_default $parent_engine` + + for subeng in `get_engine_subengines $parent_engine` ; do + subengine_build=`get_engine_build $subeng` + subengine_build_default=`get_engine_build_default $subeng` + if test \( $subengine_build = $2 -a "$parent_status" != wip \) -o \( "$parent_status" = wip -a $subengine_build != no -a "$subengine_build_default" = no \) ; then subengine_string="$subengine_string [`get_engine_name $subeng`]" else all=no fi + + # handle engines that are on by default and have a single subengine that is off by default + if test "$parent_status" = wip ; then + if test $parent_engine_build_default = yes -a subengine ; then + all=no + fi + fi + done + if test $2 != no ; then if test -n "$subengine_string" ; then if test $all = yes ; then @@ -610,19 +655,19 @@ get_subengines_build_string() { # Engine specific build strings get_scumm_build_string() { if test `get_engine_build $1` != no ; then - if test $2 != no ; then + if test $2 != no -a "$3" != wip ; then base="[v0-v6 games]" fi - get_subengines_build_string $1 $2 "$base" + get_subengines_build_string $1 $2 "$base" $3 fi } get_saga_build_string() { if test `get_engine_build $1` != no ; then - if test $2 != no ; then + if test $2 != no -a "$3" != wip; then base="[ITE]" fi - get_subengines_build_string $1 $2 "$base" + get_subengines_build_string $1 $2 "$base" $3 fi } @@ -3258,6 +3303,23 @@ for engine in $_engines; do fi done +# +# Detection of WIP/unstable engines +# +for engine in $_engines; do + engine_build=`get_engine_build $engine` + engine_build_default=`get_engine_build_default $engine` + engine_wip=false + if test $engine_build != no -a $engine_build_default = no ; then + engine_wip=true + set_var _tainted_build "yes" + fi + engine_wip_defname="ENGINE_WIP_`echo $engine | tr '[a-z]' '[A-Z]'`" + add_line_to_config_h "#define $engine_wip_defname $engine_wip" +done + +add_to_config_h_if_yes `get_var _tainted_build` '#define TAINTED_BUILD' + # # Show which engines ("frontends") are to be built # @@ -3283,6 +3345,12 @@ if test -n "$_engines_skipped" ; then s/#/ /g' fi +if test -n "$_engines_built_wip" ; then + echo "WARNING: This ScummVM build contains the following UNSTABLE engines:" + echo $_engines_built_wip | sed 's/@/\ +/g +s/#/ /g' +fi echo echo "Creating config.h" -- cgit v1.2.3 From 71759eab534512e7a4df557f12ffadb0062a56ad Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Mon, 25 Apr 2011 15:52:51 -0500 Subject: BASE: add TAINTED feature to gScummVMFeatures When configure enables a WIP/unstable engine, the about box and scummvm --version will now display TAINTED in the "features compiled in" list --- base/version.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/version.cpp b/base/version.cpp index 3083034714..c91698cba9 100644 --- a/base/version.cpp +++ b/base/version.cpp @@ -60,6 +60,11 @@ const char *gScummVMBuildDate = __DATE__ " " __TIME__; const char *gScummVMVersionDate = SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")"; const char *gScummVMFullVersion = "ScummVM " SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")"; const char *gScummVMFeatures = "" +#ifdef TAINTED_BUILD + // TAINTED means the build contains engines/subengines not enabled by default + "TAINTED " +#endif + #ifdef USE_TREMOR #ifdef USE_TREMOLO // libTremolo is used on WinCE for better ogg performance -- cgit v1.2.3 From 6c14d8a95052b68c9f076d32e520c6befac3d959 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 4 Apr 2011 12:35:19 -0400 Subject: BACKENDS: Integrate glib main event loop - Unity needs a glib event loop to dispatch events. - Cleanup whitespace and indentation --- backends/platform/sdl/posix/posix.cpp | 9 ++- backends/platform/sdl/sdl.cpp | 2 +- backends/taskbar/unity/unity-taskbar.cpp | 35 ++++++++--- backends/taskbar/unity/unity-taskbar.h | 7 ++- backends/taskbar/win32/mingw-compat.h | 105 +++++++++++++++---------------- backends/taskbar/win32/win32-taskbar.cpp | 38 +++++------ 6 files changed, 113 insertions(+), 83 deletions(-) diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index f124a3af7d..94f8d95ffb 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -51,8 +51,8 @@ void OSystem_POSIX::init() { _fsFactory = new POSIXFilesystemFactory(); #if defined(USE_TASKBAR) - // Initialize taskbar manager - _taskbarManager = new UnityTaskbarManager(); + // Initialize taskbar manager + _taskbarManager = new UnityTaskbarManager(); #endif // Invoke parent implementation of this method @@ -66,6 +66,11 @@ void OSystem_POSIX::initBackend() { // Invoke parent implementation of this method OSystem_SDL::initBackend(); + +#if defined(USE_TASKBAR) + // Register the taskbar manager as an event source (this is necessary for the glib event loop to be run) + _eventManager->getEventDispatcher()->registerSource((UnityTaskbarManager *)_taskbarManager, false); +#endif } bool OSystem_POSIX::hasFeature(Feature f) { diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 4520b74861..4743dbb558 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -385,7 +385,7 @@ void OSystem_SDL::setupIcon() { if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) { warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]); - + return; } if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) { diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 6c18f0940c..24347e382f 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -32,27 +32,31 @@ #include "common/textconsole.h" UnityTaskbarManager::UnityTaskbarManager() { - g_type_init(); + g_type_init(); - _launcher = unity_launcher_entry_get_for_desktop_id("scummvm.desktop"); + _loop = g_main_loop_new(NULL, FALSE); + + _launcher = unity_launcher_entry_get_for_desktop_id("scummvm.desktop"); } UnityTaskbarManager::~UnityTaskbarManager() { + g_main_loop_unref(_loop); + _loop = NULL; } void UnityTaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { if (_launcher == NULL) - return; + return; warning("[UnityTaskbarManager::setOverlayIcon] Not implemented"); } void UnityTaskbarManager::setProgressValue(int completed, int total) { - if (_launcher == NULL) - return; + if (_launcher == NULL) + return; - double percentage = (double)completed / (double)total; - unity_launcher_entry_set_progress(_launcher, percentage); + double percentage = (double)completed / (double)total; + unity_launcher_entry_set_progress(_launcher, percentage); unity_launcher_entry_set_progress_visible(_launcher, TRUE); } @@ -84,4 +88,21 @@ void UnityTaskbarManager::addRecent(const Common::String &name, const Common::St warning("[UnityTaskbarManager::addRecent] Not implemented"); } +// Unity requires the glib event loop to the run to function properly +// as events are sent asynchronously +bool UnityTaskbarManager::pollEvent(Common::Event &event) { + if (!_loop) + return false; + + // Get context + GMainContext *context = g_main_loop_get_context(_loop); + if (!context) + return false; + + // Dispatch events + g_main_context_iteration(context, FALSE); + + return false; +} + #endif diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index 0d0484c02e..d8a68a4101 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -28,12 +28,13 @@ #if defined(UNIX) && defined(USE_TASKBAR) +#include "common/events.h" #include "common/str.h" #include "common/taskbar.h" #include -class UnityTaskbarManager : public Common::TaskbarManager { +class UnityTaskbarManager : public Common::TaskbarManager, public Common::EventSource { public: UnityTaskbarManager(); virtual ~UnityTaskbarManager(); @@ -43,7 +44,11 @@ public: virtual void setProgressState(TaskbarProgressState state); virtual void addRecent(const Common::String &name, const Common::String &description); + // Implementation of the EventSource interface + virtual bool pollEvent(Common::Event &event); + private: + GMainLoop *_loop; UnityLauncherEntry *_launcher; }; diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h index 6324de3b34..3ee4b9aa5d 100644 --- a/backends/taskbar/win32/mingw-compat.h +++ b/backends/taskbar/win32/mingw-compat.h @@ -48,8 +48,8 @@ DEFINE_GUID(IID_IPropertyStore,0x886d8eeb,0x8cf2,0x4446,0x8d,0x02,0xcd,0xba,0x1d // Property key typedef struct _tagpropertykey { - GUID fmtid; - DWORD pid; + GUID fmtid; + DWORD pid; } PROPERTYKEY; #define REFPROPERTYKEY const PROPERTYKEY & @@ -59,78 +59,77 @@ typedef struct tagPROPVARIANT PROPVARIANT; // Property store DECLARE_INTERFACE_(IPropertyStore, IUnknown) { - STDMETHOD (GetCount) (DWORD *cProps) PURE; - STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE; - STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; - STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; - STDMETHOD (Commit) (void) PURE; + STDMETHOD (GetCount) (DWORD *cProps) PURE; + STDMETHOD (GetAt) (DWORD iProp, PROPERTYKEY *pkey) PURE; + STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; + STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; + STDMETHOD (Commit) (void) PURE; }; typedef IPropertyStore *LPIPropertyStore; // Mingw-specific defines for taskbar integration typedef enum THUMBBUTTONMASK { - THB_BITMAP = 0x1, - THB_ICON = 0x2, - THB_TOOLTIP = 0x4, - THB_FLAGS = 0x8 + THB_BITMAP = 0x1, + THB_ICON = 0x2, + THB_TOOLTIP = 0x4, + THB_FLAGS = 0x8 } THUMBBUTTONMASK; typedef enum THUMBBUTTONFLAGS { - THBF_ENABLED = 0, - THBF_DISABLED = 0x1, - THBF_DISMISSONCLICK = 0x2, - THBF_NOBACKGROUND = 0x4, - THBF_HIDDEN = 0x8, - THBF_NONINTERACTIVE = 0x10 + THBF_ENABLED = 0, + THBF_DISABLED = 0x1, + THBF_DISMISSONCLICK = 0x2, + THBF_NOBACKGROUND = 0x4, + THBF_HIDDEN = 0x8, + THBF_NONINTERACTIVE = 0x10 } THUMBBUTTONFLAGS; typedef struct THUMBBUTTON { - THUMBBUTTONMASK dwMask; - UINT iId; - UINT iBitmap; - HICON hIcon; - WCHAR szTip[260]; - THUMBBUTTONFLAGS dwFlags; + THUMBBUTTONMASK dwMask; + UINT iId; + UINT iBitmap; + HICON hIcon; + WCHAR szTip[260]; + THUMBBUTTONFLAGS dwFlags; } THUMBBUTTON; typedef struct THUMBBUTTON *LPTHUMBBUTTON; typedef enum TBPFLAG { - TBPF_NOPROGRESS = 0, - TBPF_INDETERMINATE = 0x1, - TBPF_NORMAL = 0x2, - TBPF_ERROR = 0x4, - TBPF_PAUSED = 0x8 + TBPF_NOPROGRESS = 0, + TBPF_INDETERMINATE = 0x1, + TBPF_NORMAL = 0x2, + TBPF_ERROR = 0x4, + TBPF_PAUSED = 0x8 } TBPFLAG; // Taskbar interface DECLARE_INTERFACE_(ITaskbarList3, IUnknown) { - // IUnknown - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - // ITaskbarList - STDMETHOD(HrInit) (THIS) PURE; - STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE; - STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE; - STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE; - // ITaskbarList3 - STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE; - STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE; - STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE; - STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE; - STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE; - STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE; - STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; - STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; - STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE; - STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; - STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; - STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; + // IUnknown + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + // ITaskbarList + STDMETHOD(HrInit) (THIS) PURE; + STDMETHOD(AddTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(DeleteTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(ActivateTab) (THIS_ HWND hwnd) PURE; + STDMETHOD(SetActiveAlt) (THIS_ HWND hwnd) PURE; + STDMETHOD (MarkFullscreenWindow) (THIS_ HWND hwnd, int fFullscreen) PURE; + // ITaskbarList3 + STDMETHOD (SetProgressValue) (THIS_ HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE; + STDMETHOD (SetProgressState) (THIS_ HWND hwnd, TBPFLAG tbpFlags) PURE; + STDMETHOD (RegisterTab) (THIS_ HWND hwndTab, HWND hwndMDI) PURE; + STDMETHOD (UnregisterTab) (THIS_ HWND hwndTab) PURE; + STDMETHOD (SetTabOrder) (THIS_ HWND hwndTab, HWND hwndInsertBefore) PURE; + STDMETHOD (SetTabActive) (THIS_ HWND hwndTab, HWND hwndMDI, DWORD dwReserved) PURE; + STDMETHOD (ThumbBarAddButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarUpdateButtons) (THIS_ HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) PURE; + STDMETHOD (ThumbBarSetImageList) (THIS_ HWND hwnd, HIMAGELIST himl) PURE; + STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; + STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; + STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; }; - typedef ITaskbarList3 *LPITaskbarList3; #endif // __MINGW32__ diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 91c4e2399c..c630129ea9 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -28,13 +28,13 @@ // Needed for taskbar functions #if defined(__GNUC__) #ifdef __MINGW32__ - #include "backends/taskbar/win32/mingw-compat.h" + #include "backends/taskbar/win32/mingw-compat.h" #else - #error Only compilation with MingW is supported + #error Only compilation with MingW is supported #endif #else - // Default MSVC headers for ITaskbarList3 and IShellLink - #include + // Default MSVC headers for ITaskbarList3 and IShellLink + #include #endif #include @@ -71,10 +71,10 @@ void Win32TaskbarManager::init() { // Try creating instance (on fail, _taskbar will contain NULL) HRESULT hr = CoCreateInstance(CLSID_TaskbarList, - 0, - CLSCTX_INPROC_SERVER, - IID_ITaskbarList3, - reinterpret_cast (&(_taskbar))); + 0, + CLSCTX_INPROC_SERVER, + IID_ITaskbarList3, + reinterpret_cast (&(_taskbar))); if (SUCCEEDED(hr)) { // Initialize taskbar object @@ -105,8 +105,8 @@ void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Commo HICON pIcon = (HICON)::LoadImage(NULL, path.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE); if (!pIcon) { - warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!"); - return; + warning("[Win32TaskbarManager::setOverlayIcon] Cannot load icon!"); + return; } // Sets the overlay icon @@ -206,18 +206,18 @@ Common::String Win32TaskbarManager::getIconPath(Common::String target) { } bool Win32TaskbarManager::isWin7OrLater() { - OSVERSIONINFOEX versionInfo; - DWORDLONG conditionMask = 0; + OSVERSIONINFOEX versionInfo; + DWORDLONG conditionMask = 0; - ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); - versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - versionInfo.dwMajorVersion = 6; - versionInfo.dwMinorVersion = 1; + ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); + versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + versionInfo.dwMajorVersion = 6; + versionInfo.dwMinorVersion = 1; - VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); + return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); } LPWSTR Win32TaskbarManager::ansiToUnicode(const char *s) { -- cgit v1.2.3 From e1dc9cdc0b89609753d3558f9603bef1cc12f1d8 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 4 Apr 2011 12:49:49 -0400 Subject: BACKENDS: Add support for count status to TaskbarManager - Show the number of found games when using the massadd dialog --- backends/taskbar/unity/unity-taskbar.cpp | 9 ++++ backends/taskbar/unity/unity-taskbar.h | 1 + common/taskbar.h | 74 ++++++++++++++++++-------------- gui/massadd.cpp | 12 +++--- 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 24347e382f..0de2167a83 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -88,6 +88,15 @@ void UnityTaskbarManager::addRecent(const Common::String &name, const Common::St warning("[UnityTaskbarManager::addRecent] Not implemented"); } +void UnityTaskbarManager::setCount(int count) { + if (_launcher == NULL) + return; + + unity_launcher_entry_set_count(_launcher, count); + + unity_launcher_entry_set_count_visible(_launcher, (count == 0) ? FALSE : TRUE); +} + // Unity requires the glib event loop to the run to function properly // as events are sent asynchronously bool UnityTaskbarManager::pollEvent(Common::Event &event) { diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index d8a68a4101..48f403a849 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -43,6 +43,7 @@ public: virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); virtual void addRecent(const Common::String &name, const Common::String &description); + virtual void setCount(int count); // Implementation of the EventSource interface virtual bool pollEvent(Common::Event &event); diff --git a/common/taskbar.h b/common/taskbar.h index ea1d218724..2219e6e04f 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -32,7 +32,7 @@ namespace Common { class TaskbarManager { public: /** - * Values representing the taskbar progress state + * Values representing the taskbar progress state */ enum TaskbarProgressState { kTaskbarNoProgress = 0, @@ -46,51 +46,61 @@ public: virtual ~TaskbarManager() {} /** - * Sets an overlay icon on the taskbar icon. + * Sets an overlay icon on the taskbar icon * * When an empty name is given, no icon is shown * and the current overlay icon (if any) is removed * - * @param name Path to the icon - * @param description The description + * @param name Path to the icon + * @param description The description * * @note on Windows, the icon should be an ICO file */ - virtual void setOverlayIcon(const String &name, const String &description) {} + virtual void setOverlayIcon(const String &name, const String &description) {} - /** - * Sets a progress value on the taskbar icon - * - * @param completed The current progress value. - * @param total The maximum progress value. - */ - virtual void setProgressValue(int completed, int total) {} + /** + * Sets a progress value on the taskbar icon + * + * @param completed The current progress value. + * @param total The maximum progress value. + */ + virtual void setProgressValue(int completed, int total) {} - /** - * Sets the progress state on the taskbar icon - * - * State can be any of the following: - * - NoProgress: disable display of progress state + /** + * Sets the progress state on the taskbar icon + * + * State can be any of the following: + * - NoProgress: disable display of progress state * - Indeterminate * - Normal * - Error * - Paused - * - * @param state The progress state - */ - virtual void setProgressState(TaskbarProgressState state) {} + * + * @param state The progress state + */ + virtual void setProgressState(TaskbarProgressState state) {} + + /** + * Sets the count number associated with the icon as an overlay + * + * @param count The count + * + * @note Setting a count of 0 will hide the count + */ + virtual void setCount(int count) {} + + /** + * Adds an engine to the recent items list + * + * Path is automatically set to the current executable path, + * an icon name is generated (with fallback to default icon) + * and the command line is set to start the engine on click. + * + * @param name The target name. + * @param description The description. + */ + virtual void addRecent(const String &name, const String &description) {} - /** - * Adds an engine to the recent items list - * - * Path is automatically set to the current executable path, - * an icon name is generated (with fallback to default icon) - * and the command line is set to start the engine on click. - * - * @param name The target name. - * @param description The description. - */ - virtual void addRecent(const String &name, const String &description) {} }; } // End of namespace Common diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 1578e75b25..29a2b1886a 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -71,14 +71,14 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir) // The dir we start our scan at _scanStack.push(startDir); -// Removed for now... Why would you put a title on mass add dialog called "Mass Add Dialog"? -// new StaticTextWidget(this, "massadddialog_caption", "Mass Add Dialog"); + // Removed for now... Why would you put a title on mass add dialog called "Mass Add Dialog"? + // new StaticTextWidget(this, "massadddialog_caption", "Mass Add Dialog"); _dirProgressText = new StaticTextWidget(this, "MassAdd.DirProgressText", - _("... progress ...")); + _("... progress ...")); _gameProgressText = new StaticTextWidget(this, "MassAdd.GameProgressText", - _("... progress ...")); + _("... progress ...")); _dirProgressText->setAlign(Graphics::kTextAlignCenter); _gameProgressText->setAlign(Graphics::kTextAlignCenter); @@ -132,8 +132,9 @@ struct GameDescLess { void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { - // Remove progress bar from taskbar + // Remove progress bar and count from taskbar g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress); + g_system->getTaskbarManager()->setCount(0); // FIXME: It's a really bad thing that we use two arbitrary constants if (cmd == kOkCmd) { @@ -239,6 +240,7 @@ void MassAddDialog::handleTickle() { _dirsScanned++; g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); + g_system->getTaskbarManager()->setCount(_games.size()); } -- cgit v1.2.3 From 5649ddaf101db5d8ce70e9ba1bfda850c5d00aa5 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 4 Apr 2011 16:10:58 -0400 Subject: BACKENDS: Move Win32TaskbarManager init code to constructor --- backends/platform/sdl/win32/win32.cpp | 1 - backends/taskbar/win32/win32-taskbar.cpp | 30 +++++++++++++----------------- backends/taskbar/win32/win32-taskbar.h | 2 -- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 0a6702b6d9..08139f0dc2 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -88,7 +88,6 @@ void OSystem_Win32::init() { #if defined(USE_TASKBAR) // Initialize taskbar manager _taskbarManager = new Win32TaskbarManager(); - ((Win32TaskbarManager *)_taskbarManager)->init(); #endif // Invoke parent implementation of this method diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index c630129ea9..fd8cd263e8 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -51,19 +51,7 @@ const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; Win32TaskbarManager::Win32TaskbarManager() { - _taskbar = NULL; -} - -Win32TaskbarManager::~Win32TaskbarManager() { - if (_taskbar) - _taskbar->Release(); - _taskbar = NULL; - - CoUninitialize(); -} - -void Win32TaskbarManager::init() { - // Do nothing if not running on Windows 7 of later + // Do nothing if not running on Windows 7 or later if (!isWin7OrLater()) return; @@ -71,10 +59,10 @@ void Win32TaskbarManager::init() { // Try creating instance (on fail, _taskbar will contain NULL) HRESULT hr = CoCreateInstance(CLSID_TaskbarList, - 0, - CLSCTX_INPROC_SERVER, - IID_ITaskbarList3, - reinterpret_cast (&(_taskbar))); + 0, + CLSCTX_INPROC_SERVER, + IID_ITaskbarList3, + reinterpret_cast (&(_taskbar))); if (SUCCEEDED(hr)) { // Initialize taskbar object @@ -87,6 +75,14 @@ void Win32TaskbarManager::init() { } } +Win32TaskbarManager::~Win32TaskbarManager() { + if (_taskbar) + _taskbar->Release(); + _taskbar = NULL; + + CoUninitialize(); +} + void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { //warning("[Win32TaskbarManager::setOverlayIcon] Setting overlay icon to: %s (%s)", name.c_str(), description.c_str()); diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index 7d963c19ca..0fc219e816 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -38,8 +38,6 @@ public: Win32TaskbarManager(); virtual ~Win32TaskbarManager(); - void init(); - virtual void setOverlayIcon(const Common::String &name, const Common::String &description); virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); -- cgit v1.2.3 From fdada1dbffb57e12f5683f54e5bbaf7cc5eafdce Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 6 Apr 2011 19:51:25 -0400 Subject: BACKENDS: Remove UnityTaskbarManager::setOverlayIcon() Unity is not going to provide a way to set a custom overlay icon (the emblem API is being replaced by a simple urgent state) --- backends/taskbar/unity/unity-taskbar.cpp | 7 ------- backends/taskbar/unity/unity-taskbar.h | 1 - 2 files changed, 8 deletions(-) diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 0de2167a83..0045a6fdbd 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -44,13 +44,6 @@ UnityTaskbarManager::~UnityTaskbarManager() { _loop = NULL; } -void UnityTaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { - if (_launcher == NULL) - return; - - warning("[UnityTaskbarManager::setOverlayIcon] Not implemented"); -} - void UnityTaskbarManager::setProgressValue(int completed, int total) { if (_launcher == NULL) return; diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index 48f403a849..ed40a6507e 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -39,7 +39,6 @@ public: UnityTaskbarManager(); virtual ~UnityTaskbarManager(); - virtual void setOverlayIcon(const Common::String &name, const Common::String &description); virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); virtual void addRecent(const Common::String &name, const Common::String &description); -- cgit v1.2.3 From 28aa4f0f33c662b8d0c9273011d43237451b9659 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 15:31:56 -0400 Subject: COMMON: Add overall documentation to TaskbarManager interface --- common/taskbar.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/taskbar.h b/common/taskbar.h index 2219e6e04f..f040af8786 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -29,6 +29,17 @@ namespace Common { +/** + * The TaskbarManager allows interaction with the ScummVM icon in the taskbar. + * + * This allows the application to set a progress bar, an overlay icon and count + * as well as add the started engine to the recent items list (so that the user + * can start the engine directly in one click) + * + * @note functionality will vary between supported platforms (due to API limitations) + * and some of the methods will just be no-ops or approximate the functionality + * as best as possible + */ class TaskbarManager { public: /** -- cgit v1.2.3 From 1e3603b9371204c88a60983cbfb61a4adcef0b94 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 26 Apr 2011 16:19:20 -0400 Subject: BACKENDS: Add define for Unity-specific taskbar code --- backends/platform/sdl/posix/posix.cpp | 4 ++-- backends/taskbar/unity/unity-taskbar.cpp | 2 +- backends/taskbar/unity/unity-taskbar.h | 2 +- configure | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 94f8d95ffb..05c779a4e0 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -50,7 +50,7 @@ void OSystem_POSIX::init() { // Initialze File System Factory _fsFactory = new POSIXFilesystemFactory(); -#if defined(USE_TASKBAR) +#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) // Initialize taskbar manager _taskbarManager = new UnityTaskbarManager(); #endif @@ -67,7 +67,7 @@ void OSystem_POSIX::initBackend() { // Invoke parent implementation of this method OSystem_SDL::initBackend(); -#if defined(USE_TASKBAR) +#if defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) // Register the taskbar manager as an event source (this is necessary for the glib event loop to be run) _eventManager->getEventDispatcher()->registerSource((UnityTaskbarManager *)_taskbarManager, false); #endif diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 0045a6fdbd..49c56b746d 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -25,7 +25,7 @@ #include "common/scummsys.h" -#if defined(UNIX) && defined(USE_TASKBAR) +#if defined(UNIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) #include "backends/taskbar/unity/unity-taskbar.h" diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index ed40a6507e..9f14b44d8f 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -26,7 +26,7 @@ #ifndef BACKEND_UNITY_TASKBAR_H #define BACKEND_UNITY_TASKBAR_H -#if defined(UNIX) && defined(USE_TASKBAR) +#if defined(UNIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) #include "common/events.h" #include "common/str.h" diff --git a/configure b/configure index 37dfc807b7..6e39ad3667 100755 --- a/configure +++ b/configure @@ -2951,6 +2951,7 @@ if test "$_unity" = yes ; then INCLUDES="$INCLUDES $UNITY_CFLAGS" fi define_in_config_h_if_yes "$_unity" 'USE_TASKBAR' +define_in_config_h_if_yes "$_unity" 'USE_TASKBAR_UNITY' echo "$_unity" # -- cgit v1.2.3 From 7458073bad16f7f15fe8a98227e7b718ecb8a075 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 27 Apr 2011 16:07:03 -0400 Subject: COMMON: Update TaskbarManager header with better documentation and examples of use --- common/taskbar.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/common/taskbar.h b/common/taskbar.h index f040af8786..ff9fd9c264 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -30,11 +30,20 @@ namespace Common { /** - * The TaskbarManager allows interaction with the ScummVM icon in the taskbar. + * The TaskbarManager allows interaction with the ScummVM application icon: + * - in the taskbar on Windows 7 and later + * - in the launcher for Unity + * - in the dock on MacOSX + * - ... * - * This allows the application to set a progress bar, an overlay icon and count - * as well as add the started engine to the recent items list (so that the user - * can start the engine directly in one click) + * This allows GUI code and engines to display a progress bar, an overlay icon and/or count + * associated with the ScummVM icon as well as add the started engine to the recent items + * list (so that the user can start the engine directly in one click). + * + * Examples of use: + * - Track search progress and found engines when running the Mass Add dialog + * - Add an entry to the recent items when starting an engine + * - Show the current running engine icon as an overlay * * @note functionality will vary between supported platforms (due to API limitations) * and some of the methods will just be no-ops or approximate the functionality -- cgit v1.2.3 From 30c0966018c78cfe2ea8c7e48d1d75929aa33622 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 28 Apr 2011 18:10:26 -0400 Subject: CONFIGURE: Disable Unity on non-unix systems and add taskbar support when compiling with mingw - Mingw now links with 2 additional libraries: ole32 and uuid --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 6e39ad3667..d772303739 100755 --- a/configure +++ b/configure @@ -1781,9 +1781,10 @@ case $_host_os in mingw*) DEFINES="$DEFINES -DWIN32" DEFINES="$DEFINES -D__USE_MINGW_ANSI_STDIO=0" - LIBS="$LIBS -lmingw32 -lwinmm" + LIBS="$LIBS -lmingw32 -lwinmm -lole32 -luuid" OBJS="$OBJS scummvmwinres.o" add_line_to_config_mk 'WIN32 = 1' + add_line_to_config_h "#define USE_TASKBAR" ;; mint*) DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" @@ -2935,6 +2936,9 @@ define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' # Check for Unity if taskbar integration is enabled # echocheck "unity" +if test "$_unix" = no ; then + _unity=no +else if test "$_unity" = auto ; then # Unity has a lots of dependency, update the libs and cflags var with them UNITY_LIBS="$UNITY_LIBS $(pkg-config --libs unity)" @@ -2952,6 +2956,7 @@ if test "$_unity" = yes ; then fi define_in_config_h_if_yes "$_unity" 'USE_TASKBAR' define_in_config_h_if_yes "$_unity" 'USE_TASKBAR_UNITY' +fi echo "$_unity" # -- cgit v1.2.3 From f843b3f280a1641d11601c9ee248d35944b14b42 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 28 Apr 2011 18:39:15 -0400 Subject: BACKENDS: Fix Win32TaskbarManager compilation with Mingw It was missing an include for scummsys.h and so couldn't find the defines --- backends/taskbar/win32/win32-taskbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index fd8cd263e8..4053708e96 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -22,6 +22,8 @@ * $Id$ * */ + +#include "common/scummsys.h" #if defined(WIN32) && defined(USE_TASKBAR) -- cgit v1.2.3 From 0ae3e4f2897a79b5e9c7df3a5209f101d421426e Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 29 Apr 2011 11:33:18 -0400 Subject: CONFIGURE: Update libunity detection by adding a call to one of unity functions in the cc_check test Some older compilers might not error out on missing headers and will compile (with warnings) unless a symbol is missing --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d772303739..0f014d9973 100755 --- a/configure +++ b/configure @@ -2946,7 +2946,10 @@ if test "$_unity" = auto ; then _unity=no cat > $TMPC << EOF #include -int main(void) { return 0; } +int main(void) { + unity_launcher_entry_get_for_desktop_id("scummvm.desktop"); + return 0; +} EOF cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _unity=yes fi -- cgit v1.2.3 From 79fb0ff223588fd7020ef8f133e74f2fdb35f95e Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 29 Apr 2011 11:54:09 -0400 Subject: CONFIGURE: Update internal libunity handling and add support for disabling taskbar support entirely - Rename internal _unity var to _libunity - Disable libunity support when taskbar integration support is disabled --- configure | 57 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/configure b/configure index 0f014d9973..ef13e0d14f 100755 --- a/configure +++ b/configure @@ -138,7 +138,8 @@ _fluidsynth=auto _opengl=auto _opengles=auto _readline=auto -_unity=auto +_taskbar=yes +_libunity=auto # Default option behaviour yes/no _debug_build=auto _release_build=auto @@ -723,6 +724,7 @@ Optional Features: --disable-scalers exclude scalers --disable-hq-scalers exclude HQ2x and HQ3x scalers --disable-translation don't build support for translated messages + --disable-taskbar don't build support for taskbar and launcher integration --enable-text-console use text console instead of graphical console --enable-verbose-build enable regular echoing of commands during build process @@ -772,8 +774,8 @@ Optional Libraries: --with-readline-prefix=DIR Prefix where readline is installed (optional) --disable-readline disable readline support in text console [autodetect] - --with-unity-prefix=DIR Prefix where libunity is installed (optional) - --disable-unity disable unity[autodetect] + --with-libunity-prefix=DIR Prefix where libunity is installed (optional) + --disable-libunity disable Unity launcher integration [autodetect] Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -822,8 +824,10 @@ for ac_option in $@; do --disable-fluidsynth) _fluidsynth=no ;; --enable-readline) _readline=yes ;; --disable-readline) _readline=no ;; - --enable-unity) _unity=yes ;; - --disable-unity) _unity=no ;; + --enable-taskbar) _taskbar=yes ;; + --disable-taskbar) _taskbar=no ;; + --enable-libunity) _libunity=yes ;; + --disable-libunity) _libunity=no ;; --enable-opengl) _opengl=yes ;; --disable-opengl) _opengl=no ;; --enable-verbose-build) _verbose_build=yes ;; @@ -899,10 +903,10 @@ for ac_option in $@; do READLINE_CFLAGS="-I$arg/include" READLINE_LIBS="-L$arg/lib" ;; - --with-unity-prefix=*) + --with-libunity-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` - UNITY_CFLAGS="-I$arg/include" - UNITY_LIBS="-L$arg/lib" + LIBUNITY_CFLAGS="-I$arg/include" + LIBUNITY_LIBS="-L$arg/lib" ;; --with-opengl-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` @@ -1784,7 +1788,6 @@ case $_host_os in LIBS="$LIBS -lmingw32 -lwinmm -lole32 -luuid" OBJS="$OBJS scummvmwinres.o" add_line_to_config_mk 'WIN32 = 1' - add_line_to_config_h "#define USE_TASKBAR" ;; mint*) DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE" @@ -2935,15 +2938,15 @@ define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER' # # Check for Unity if taskbar integration is enabled # -echocheck "unity" -if test "$_unix" = no ; then - _unity=no +echocheck "libunity" +if test "$_unix" = no || test "$_taskbar" = no; then + _libunity=no else -if test "$_unity" = auto ; then - # Unity has a lots of dependency, update the libs and cflags var with them - UNITY_LIBS="$UNITY_LIBS $(pkg-config --libs unity)" - UNITY_CFLAGS="$UNITY_CFLAGS $(pkg-config --cflags unity)" - _unity=no +if test "$_libunity" = auto ; then + # Unity has a lots of dependencies, update the libs and cflags var with them + LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity)" + LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity)" + _libunity=no cat > $TMPC << EOF #include int main(void) { @@ -2951,16 +2954,15 @@ int main(void) { return 0; } EOF - cc_check $UNITY_CFLAGS $UNITY_LIBS -lunity && _unity=yes + cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS -lunity && _libunity=yes fi -if test "$_unity" = yes ; then - LIBS="$LIBS $UNITY_LIBS -lunity" - INCLUDES="$INCLUDES $UNITY_CFLAGS" +if test "$_libunity" = yes ; then + LIBS="$LIBS $LIBUNITY_LIBS -lunity" + INCLUDES="$INCLUDES $LIBUNITY_CFLAGS" fi -define_in_config_h_if_yes "$_unity" 'USE_TASKBAR' -define_in_config_h_if_yes "$_unity" 'USE_TASKBAR_UNITY' +define_in_config_h_if_yes "$_libunity" 'USE_TASKBAR_UNITY' fi -echo "$_unity" +echo "$_libunity" # # Check for OpenGL (ES) @@ -3137,6 +3139,13 @@ EOF fi fi +# +# Check whether to build taskbar integration support +# +echo_n "Building taskbar integration support... " +define_in_config_if_yes $_taskbar 'USE_TASKBAR' +echo "$_taskbar" + # # Figure out installation directories # -- cgit v1.2.3 From 96148345483dd0e7667f0b7541d5956524181dd5 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 29 Apr 2011 12:15:49 -0400 Subject: BACKENDS/COMMON/GUI: Remove complete support for TaskbarManager when taskbar integration is not enabled --- backends/modular-backend.cpp | 10 ++++++++-- backends/modular-backend.h | 4 ++++ backends/platform/sdl/sdl.cpp | 4 ++++ backends/platform/sdl/sdl.h | 2 ++ common/system.h | 6 +++++- common/taskbar.h | 5 +++++ gui/massadd.cpp | 4 ++++ 7 files changed, 32 insertions(+), 3 deletions(-) diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index a2710bc1cf..4b306be228 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -33,10 +33,11 @@ ModularBackend::ModularBackend() : _mutexManager(0), - _taskbarManager(0), _graphicsManager(0), _mixer(0) { - +#if defined(USE_TASKBAR) + _taskbarManager = 0; +#endif } ModularBackend::~ModularBackend() { @@ -44,8 +45,10 @@ ModularBackend::~ModularBackend() { _graphicsManager = 0; delete _mixer; _mixer = 0; +#if defined(USE_TASKBAR) delete _taskbarManager; _taskbarManager = 0; +#endif delete _mutexManager; _mutexManager = 0; } @@ -239,7 +242,10 @@ void ModularBackend::quit() { exit(0); } +#if defined(USE_TASKBAR) Common::TaskbarManager *ModularBackend::getTaskbarManager() { assert(_taskbarManager); return _taskbarManager; } +#endif + diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 6b5bfff989..fab7fb6a4d 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -134,7 +134,9 @@ public: //@{ virtual void quit(); +#if defined(USE_TASKBAR) virtual TaskbarManager *getTaskbarManager(); +#endif virtual void displayMessageOnOSD(const char *msg); //@} @@ -143,7 +145,9 @@ protected: /** @name Managers variables */ //@{ +#if defined(USE_TASKBAR) TaskbarManager *_taskbarManager; +#endif MutexManager *_mutexManager; GraphicsManager *_graphicsManager; Audio::Mixer *_mixer; diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 4743dbb558..85ea177a39 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -126,8 +126,10 @@ void OSystem_SDL::init() { if (_timerManager == 0) _timerManager = new SdlTimerManager(); +#if defined(USE_TASKBAR) if (_taskbarManager == 0) _taskbarManager = new Common::TaskbarManager(); +#endif #ifdef USE_OPENGL // Setup a list with both SDL and OpenGL graphics modes @@ -213,6 +215,7 @@ void OSystem_SDL::initBackend() { ModularBackend::initBackend(); } +#if defined(USE_TASKBAR) void OSystem_SDL::engineInit() { // Add the started engine to the list of recent tasks _taskbarManager->addRecent(ConfMan.getActiveDomainName(), ConfMan.get("description")); @@ -225,6 +228,7 @@ void OSystem_SDL::engineDone() { // Remove overlay icon _taskbarManager->setOverlayIcon("", ""); } +#endif void OSystem_SDL::initSDL() { // Check if SDL has not been initialized diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 19f913ef45..395b2b3aac 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -54,8 +54,10 @@ public: // Override functions from ModularBackend and OSystem virtual void initBackend(); +#if defined(USE_TASKBAR) virtual void engineInit(); virtual void engineDone(); +#endif virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); virtual void fatalError(); diff --git a/common/system.h b/common/system.h index f556fa22f8..0bfa980800 100644 --- a/common/system.h +++ b/common/system.h @@ -42,7 +42,9 @@ struct Rect; class SaveFileManager; class SearchSet; class String; -class TaskbarManager; +#if defined(USE_TASKBAR) + class TaskbarManager; +#endif class TimerManager; class SeekableReadStream; class WriteStream; @@ -1048,6 +1050,7 @@ public: return _savefileManager; } +#if defined(USE_TASKBAR) /** * Returns the TaskbarManager, used to handle progress bars, * icon overlay, tasks and recent items list on the taskbar. @@ -1055,6 +1058,7 @@ public: * @return the TaskbarManager for the current architecture */ virtual Common::TaskbarManager *getTaskbarManager() = 0; +#endif /** * Returns the FilesystemFactory object, depending on the current architecture. diff --git a/common/taskbar.h b/common/taskbar.h index ff9fd9c264..023227e5e0 100644 --- a/common/taskbar.h +++ b/common/taskbar.h @@ -25,8 +25,11 @@ #ifndef COMMON_TASKBAR_MANAGER_H #define COMMON_TASKBAR_MANAGER_H +#include "common/scummsys.h" #include "common/str.h" +#if defined(USE_TASKBAR) + namespace Common { /** @@ -125,4 +128,6 @@ public: } // End of namespace Common +#endif + #endif // COMMON_TASKBAR_MANAGER_H diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 29a2b1886a..70580e8b9c 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -132,9 +132,11 @@ struct GameDescLess { void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { +#if defined(USE_TASKBAR) // Remove progress bar and count from taskbar g_system->getTaskbarManager()->setProgressState(Common::TaskbarManager::kTaskbarNoProgress); g_system->getTaskbarManager()->setCount(0); +#endif // FIXME: It's a really bad thing that we use two arbitrary constants if (cmd == kOkCmd) { @@ -239,8 +241,10 @@ void MassAddDialog::handleTickle() { _dirsScanned++; +#if defined(USE_TASKBAR) g_system->getTaskbarManager()->setProgressValue(_dirsScanned, _dirTotal); g_system->getTaskbarManager()->setCount(_games.size()); +#endif } -- cgit v1.2.3 From 5dff6c2c081756feb61fd273da903019e33363a1 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 11:06:05 -0400 Subject: BACKENDS: Allow use of excluded functions needed by Win32TaskbarManager --- backends/taskbar/win32/win32-taskbar.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 4053708e96..c05b91d9f3 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -22,7 +22,15 @@ * $Id$ * */ - + +// We need certain functions that are excluded by default +#undef NONLS +#undef NOICONS +#include +#if defined(ARRAYSIZE) + #undef ARRAYSIZE +#endif + #include "common/scummsys.h" #if defined(WIN32) && defined(USE_TASKBAR) -- cgit v1.2.3 From 599695bc4f70c28c556e2c78822eda6ef29d2faa Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 11:24:38 -0400 Subject: COMMON: Change TaskbarManager to the new module slot interface --- backends/modular-backend.cpp | 16 +--------------- backends/modular-backend.h | 15 ++++----------- common/system.cpp | 9 +++++++++ common/system.h | 15 +++++++++++++-- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index 4b306be228..525170d685 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -35,9 +35,7 @@ ModularBackend::ModularBackend() _mutexManager(0), _graphicsManager(0), _mixer(0) { -#if defined(USE_TASKBAR) - _taskbarManager = 0; -#endif + } ModularBackend::~ModularBackend() { @@ -45,10 +43,6 @@ ModularBackend::~ModularBackend() { _graphicsManager = 0; delete _mixer; _mixer = 0; -#if defined(USE_TASKBAR) - delete _taskbarManager; - _taskbarManager = 0; -#endif delete _mutexManager; _mutexManager = 0; } @@ -241,11 +235,3 @@ void ModularBackend::displayMessageOnOSD(const char *msg) { void ModularBackend::quit() { exit(0); } - -#if defined(USE_TASKBAR) -Common::TaskbarManager *ModularBackend::getTaskbarManager() { - assert(_taskbarManager); - return _taskbarManager; -} -#endif - diff --git a/backends/modular-backend.h b/backends/modular-backend.h index fab7fb6a4d..3593130bf5 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -27,21 +27,20 @@ class GraphicsManager; class MutexManager; -class TaskbarManager; /** * Base class for modular backends. - * + * * It wraps most functions to their manager equivalent, but not * all OSystem functions are implemented here. - * + * * A backend derivated from this class, will need to implement * these functions on its own: * OSystem::pollEvent() * OSystem::getMillis() * OSystem::delayMillis() * OSystem::getTimeAndDate() - * + * * And, it should also initialize all the managers variables * declared in this class, or override their related functions. */ @@ -112,7 +111,7 @@ public: virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; } //@} - + /** @name Mutex handling */ //@{ @@ -134,9 +133,6 @@ public: //@{ virtual void quit(); -#if defined(USE_TASKBAR) - virtual TaskbarManager *getTaskbarManager(); -#endif virtual void displayMessageOnOSD(const char *msg); //@} @@ -145,9 +141,6 @@ protected: /** @name Managers variables */ //@{ -#if defined(USE_TASKBAR) - TaskbarManager *_taskbarManager; -#endif MutexManager *_mutexManager; GraphicsManager *_graphicsManager; Audio::Mixer *_mixer; diff --git a/common/system.cpp b/common/system.cpp index fae7a3ef34..2dab687872 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -32,6 +32,7 @@ #include "common/fs.h" #include "common/savefile.h" #include "common/str.h" +#include "common/taskbar.h" #include "common/textconsole.h" #include "backends/audiocd/default/default-audiocd.h" @@ -45,6 +46,9 @@ OSystem::OSystem() { _eventManager = 0; _timerManager = 0; _savefileManager = 0; +#if defined(USE_TASKBAR) + _taskbarManager = 0; +#endif _fsFactory = 0; } @@ -58,6 +62,11 @@ OSystem::~OSystem() { delete _timerManager; _timerManager = 0; +#if defined(USE_TASKBAR) + delete _taskbarManager; + _taskbarManager = 0; +#endif + delete _savefileManager; _savefileManager = 0; diff --git a/common/system.h b/common/system.h index 0bfa980800..24728a918c 100644 --- a/common/system.h +++ b/common/system.h @@ -43,7 +43,7 @@ class SaveFileManager; class SearchSet; class String; #if defined(USE_TASKBAR) - class TaskbarManager; +class TaskbarManager; #endif class TimerManager; class SeekableReadStream; @@ -152,6 +152,15 @@ protected: */ Common::SaveFileManager *_savefileManager; +#if defined(USE_TASKBAR) + /** + * No default value is provided for _savefileManager by OSystem. + * + * @note _savefileManager is deleted by the OSystem destructor. + */ + Common::TaskbarManager *_taskbarManager; +#endif + /** * No default value is provided for _fsFactory by OSystem. * @@ -1057,7 +1066,9 @@ public: * * @return the TaskbarManager for the current architecture */ - virtual Common::TaskbarManager *getTaskbarManager() = 0; + virtual Common::TaskbarManager *getTaskbarManager() { + return _taskbarManager; + } #endif /** -- cgit v1.2.3 From 8729af342f42a68893ac473841373002e2a06e9d Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 11:57:06 -0400 Subject: CONFIGURE: Disable check for unity when compiling with mingw (pkg-config is not available) --- configure | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/configure b/configure index ef13e0d14f..3f3eeb852a 100755 --- a/configure +++ b/configure @@ -2943,18 +2943,26 @@ if test "$_unix" = no || test "$_taskbar" = no; then _libunity=no else if test "$_libunity" = auto ; then - # Unity has a lots of dependencies, update the libs and cflags var with them - LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity)" - LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity)" - _libunity=no - cat > $TMPC << EOF + case $_host_os in + mingw*) + # pkgconfig and unity are not supported on mingw + _libunity=no + ;; + *) + # Unity has a lots of dependencies, update the libs and cflags var with them + LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity)" + LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity)" + _libunity=no + cat > $TMPC << EOF #include int main(void) { unity_launcher_entry_get_for_desktop_id("scummvm.desktop"); return 0; } EOF - cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS -lunity && _libunity=yes + cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS -lunity && _libunity=yes + ;; + esac fi if test "$_libunity" = yes ; then LIBS="$LIBS $LIBUNITY_LIBS -lunity" -- cgit v1.2.3 From 179630b46b8e24d6c87c114f97efa076a8fc19fa Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 12:30:40 -0400 Subject: CONFIGURE: Only add linking to ole32 and uuid when taskbar support is compiled for Win32 We also show the type of taskbar integration being compiled. --- configure | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3f3eeb852a..87f4b86ae6 100755 --- a/configure +++ b/configure @@ -1785,7 +1785,7 @@ case $_host_os in mingw*) DEFINES="$DEFINES -DWIN32" DEFINES="$DEFINES -D__USE_MINGW_ANSI_STDIO=0" - LIBS="$LIBS -lmingw32 -lwinmm -lole32 -luuid" + LIBS="$LIBS -lmingw32 -lwinmm" OBJS="$OBJS scummvmwinres.o" add_line_to_config_mk 'WIN32 = 1' ;; @@ -3152,7 +3152,23 @@ fi # echo_n "Building taskbar integration support... " define_in_config_if_yes $_taskbar 'USE_TASKBAR' -echo "$_taskbar" +if test "$_taskbar" = yes; then + case $_host_os in + mingw*) + LIBS="$LIBS -lole32 -luuid" + echo "win32" + ;; + *) + if test "$_unity" = yes; then + echo "unity" + else + echo "$_taskbar" + fi + ;; + esac +else + echo "$_taskbar" +fi # # Figure out installation directories -- cgit v1.2.3 From 149a8f8f11765107cbfe9e3c3b5e8fb27e621470 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 12:31:34 -0400 Subject: BACKENDS: Fix compilation of Win32TaskbarManager with mingw --- backends/taskbar/win32/mingw-compat.h | 3 +++ backends/taskbar/win32/win32-taskbar.cpp | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h index 3ee4b9aa5d..06968b62ff 100644 --- a/backends/taskbar/win32/mingw-compat.h +++ b/backends/taskbar/win32/mingw-compat.h @@ -34,6 +34,9 @@ #if defined(__GNUC__) #ifdef __MINGW32__ +#ifdef _WIN32_WINNT + #undef _WIN32_WINNT +#endif #define _WIN32_WINNT 0x0501 #include #include diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index c05b91d9f3..3754a03c76 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -23,16 +23,12 @@ * */ -// We need certain functions that are excluded by default -#undef NONLS -#undef NOICONS -#include -#if defined(ARRAYSIZE) - #undef ARRAYSIZE +// We cannot use common/scummsys.h directly as it will include +// windows.h and we need to do it by hand to allow excluded functions +#if defined(HAVE_CONFIG_H) +#include "config.h" #endif -#include "common/scummsys.h" - #if defined(WIN32) && defined(USE_TASKBAR) // Needed for taskbar functions @@ -43,6 +39,14 @@ #error Only compilation with MingW is supported #endif #else + // We need certain functions that are excluded by default + #undef NONLS + #undef NOICONS + #include + #if defined(ARRAYSIZE) + #undef ARRAYSIZE + #endif + // Default MSVC headers for ITaskbarList3 and IShellLink #include #endif @@ -51,6 +55,8 @@ // For HWND #include +#include "common/scummsys.h" + #include "backends/taskbar/win32/win32-taskbar.h" #include "common/config-manager.h" -- cgit v1.2.3 From 96c1e97459dbcd5422dbdf42df9c370c086d6a22 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 12:47:31 -0400 Subject: CONFIGURE: Add minimum version of Unity --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 87f4b86ae6..df0c948825 100755 --- a/configure +++ b/configure @@ -2950,8 +2950,8 @@ if test "$_libunity" = auto ; then ;; *) # Unity has a lots of dependencies, update the libs and cflags var with them - LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity)" - LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity)" + LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity = 3.8.4)" + LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity = 3.8.4)" _libunity=no cat > $TMPC << EOF #include -- cgit v1.2.3 From 4d0bba314d3b584f15d1d50e59d8f1b8c9a39161 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Mon, 25 Apr 2011 15:26:38 -0500 Subject: ENGINES: Warn user about games marked with ADGF_UNSTABLE flags ADGF_UNSTABLE is always warned about. ADGF_TESTING is only warned about when running configure with --enable-relase. Both warnings are subject to the enable_wip_game_warning config option. --- base/commandLine.cpp | 2 ++ base/main.cpp | 2 +- common/error.cpp | 3 +++ common/error.h | 2 ++ engines/advancedDetector.cpp | 23 +++++++++++++++++++++-- engines/advancedDetector.h | 3 +++ engines/engine.cpp | 11 +++++++++++ engines/engine.h | 7 +++++++ engines/game.cpp | 31 ++++++++++++++++++++++++++++++- engines/game.h | 18 +++++++++++++++++- 10 files changed, 97 insertions(+), 5 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index e34cde4779..61853a1ebc 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -186,6 +186,8 @@ void registerDefaults() { ConfMan.registerDefault("cdrom", 0); + ConfMan.registerDefault("enable_unsupported_game_warning", true); + // Game specific ConfMan.registerDefault("path", ""); ConfMan.registerDefault("platform", Common::kPlatformPC); diff --git a/base/main.cpp b/base/main.cpp index 906f4c9242..395ba8344c 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -427,7 +427,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { #endif // Did an error occur ? - if (result.getCode() != Common::kNoError) { + if (result.getCode() != Common::kNoError && result.getCode() != Common::kUserCanceled) { // Shows an informative error dialog if starting the selected game failed. GUI::displayErrorDialog(result, _("Error running game:")); } diff --git a/common/error.cpp b/common/error.cpp index a6c52a0ce9..78178f8e27 100644 --- a/common/error.cpp +++ b/common/error.cpp @@ -67,6 +67,9 @@ static String errorToString(ErrorCode errorCode) { case kEnginePluginNotSupportSaves: return _s("Engine plugin does not support save states"); + case kUserCanceled: + return _s("User canceled"); + case kUnknownError: default: return _s("Unknown error"); diff --git a/common/error.h b/common/error.h index 23c12b67e4..7043862eea 100644 --- a/common/error.h +++ b/common/error.h @@ -62,6 +62,8 @@ enum ErrorCode { kEnginePluginNotFound, ///< Failed to find plugin to handle target kEnginePluginNotSupportSaves, ///< Failed if plugin does not support listing save states + kUserCanceled, ///< User has canceled the launching of the game + kUnknownError ///< Catch-all error, used if no other error code matches }; diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 7ae4d7718a..d864fe8b52 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -51,7 +51,13 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa extra = g.extra; } - GameDescriptor gd(g.gameid, title, g.language, g.platform); + GameSupportLevel gsl = kStableGame; + if (g.flags & ADGF_UNSTABLE) + gsl = kUnstableGame; + else if (g.flags & ADGF_TESTING) + gsl = kTestingGame; + + GameDescriptor gd(g.gameid, title, g.language, g.platform, 0, gsl); gd.updateDesc(extra); return gd; } @@ -253,8 +259,21 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) Common::updateGameGUIOptions(agdDesc->guioptions | _guioptions, lang); + GameDescriptor gameDescriptor = toGameDescriptor(*agdDesc, _gameids); + + bool showTestingWarning = false; + +#ifdef RELEASE_BUILD + showTestingWarning = true; +#endif + + if (((gameDescriptor.getSupportLevel() == kUnstableGame + || (gameDescriptor.getSupportLevel() == kTestingGame + && showTestingWarning))) + && !Engine::warnUserAboutUnsupportedGame()) + return Common::kUserCanceled; - debug(2, "Running %s", toGameDescriptor(*agdDesc, _gameids).description().c_str()); + debug(2, "Running %s", gameDescriptor.description().c_str()); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 5360d23ac1..cbdfdf39d8 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -24,6 +24,7 @@ #define ENGINES_ADVANCED_DETECTOR_H #include "engines/metaengine.h" +#include "engines/engine.h" namespace Common { class Error; @@ -62,6 +63,8 @@ struct ADGameFileDescription { enum ADGameFlags { ADGF_NO_FLAGS = 0, + ADGF_UNSTABLE = (1 << 21), // flag to designate not yet officially-supported games that are not fit for public testing + ADGF_TESTING = (1 << 22), // flag to designate not yet officially-supported games that are fit for public testing ADGF_PIRATED = (1 << 23), ///< flag to designate well known pirated versions with cracks ADGF_ADDENGLISH = (1 << 24), ///< always add English as language option ADGF_MACRESFORK = (1 << 25), ///< the md5 for this entry will be calculated from the resource fork diff --git a/engines/engine.cpp b/engines/engine.cpp index dc30b4bd0d..0797bafc27 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -400,6 +400,17 @@ void Engine::openMainMenuDialog() { syncSoundSettings(); } +bool Engine::warnUserAboutUnsupportedGame() { + if (ConfMan.getBool("enable_unsupported_game_warning")) { + GUI::MessageDialog alert("WARNING: The game you are about to start is" + " not yet fully supported by ScummVM. As such, it is likely to be" + " unstable, and any saves you make might not work in future" + " versions of ScummVM.", "Start anyway", "Cancel"); + return alert.runModal() == GUI::kMessageOK; + } + return true; +} + uint32 Engine::getTotalPlayTime() const { if (!_pauseLevel) return _system->getMillis() - _engineStartTime; diff --git a/engines/engine.h b/engines/engine.h index d7d971ad97..06b7f7dedd 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -251,6 +251,13 @@ public: */ void openMainMenuDialog(); + /** + * Display a warning to the user that the game is not fully supported. + * + * @return true if the user chose to start anyway, false otherwise + */ + static bool warnUserAboutUnsupportedGame(); + /** * Get the total play time. * diff --git a/engines/game.cpp b/engines/game.cpp index c6d9905b52..cbd5a802c6 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -46,7 +46,7 @@ GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd, uint32 guioptions setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions)); } -GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions) { +GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions, GameSupportLevel gsl) { setVal("gameid", g); setVal("description", d); if (l != Common::UNK_LANG) @@ -55,6 +55,8 @@ GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, setVal("platform", Common::getPlatformCode(p)); if (guioptions != 0) setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions)); + + setSupportLevel(gsl); } void GameDescriptor::setGUIOptions(uint32 guioptions) { @@ -97,3 +99,30 @@ void GameDescriptor::updateDesc(const char *extra) { setVal("description", descr); } } + +GameSupportLevel GameDescriptor::getSupportLevel() { + GameSupportLevel gsl = kStableGame; + if (contains("gsl")) { + Common::String gslString = getVal("gsl"); + if (gslString.equals("unstable")) + gsl = kUnstableGame; + else if (gslString.equals("testing")) + gsl = kTestingGame; + } + return gsl; +} + +void GameDescriptor::setSupportLevel(GameSupportLevel gsl) { + switch (gsl) { + case kUnstableGame: + setVal("gsl", "unstable"); + break; + case kTestingGame: + setVal("gsl", "testing"); + break; + case kStableGame: + // Fall Through intended + default: + erase("gsl"); + } +} diff --git a/engines/game.h b/engines/game.h index 3216cfb628..9798954437 100644 --- a/engines/game.h +++ b/engines/game.h @@ -46,6 +46,15 @@ struct PlainGameDescriptor { */ const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list); +/** + * Ths is an enum to describe how done a game is. This also indicates what level of support is expected. + */ +enum GameSupportLevel { + kStableGame = 0, // the game is fully supported + kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing + kUnstableGame // the game is not even ready for public testing yet +}; + /** * A hashmap describing details about a given game. In a sense this is a refined * version of PlainGameDescriptor, as it also contains a gameid and a description string. @@ -61,7 +70,8 @@ public: const Common::String &description, Common::Language language = Common::UNK_LANG, Common::Platform platform = Common::kPlatformUnknown, - uint32 guioptions = 0); + uint32 guioptions = 0, + GameSupportLevel gsl = kStableGame); /** * Update the description string by appending (LANG/PLATFORM/EXTRA) to it. @@ -71,6 +81,12 @@ public: void setGUIOptions(uint32 options); void appendGUIOptions(const Common::String &str); + /** + * What level of support is expected of this game + */ + GameSupportLevel getSupportLevel(); + void setSupportLevel(GameSupportLevel gsl); + Common::String &gameid() { return getVal("gameid"); } Common::String &description() { return getVal("description"); } const Common::String &gameid() const { return getVal("gameid"); } -- cgit v1.2.3 From 69a45b434f5a93b0642f2eb3fc6bc3deaf27a11b Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 22:33:45 -0500 Subject: SCI: flag all WIP games with ADGF_UNSTABLE SCI32 games --- engines/sci/detection_tables.h | 150 ++++++++++++++++++++--------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index def3879945..73f4e4e89f 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -617,7 +617,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783}, {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight - English DOS Floppy (supplied my markcoolio in bug report #2723777) // SCI interpreter version 2.000.000 @@ -625,7 +625,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "65e8c14092e4c9b3b3538b7602c8c5ec", 10783}, {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight - English DOS Floppy // SCI interpreter version 2.000.000, VERSION file reports "1.0\nGabriel Knight\n11/22/10:33 pm\n\x1A" @@ -633,7 +633,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "ef41df08cf2c1f680216cdbeed0f8311", 10783}, {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight - German DOS Floppy (supplied my markcoolio in bug report #2723775) // SCI interpreter version 2.000.000 @@ -641,7 +641,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "ad6508b0296b25c07b1f58828dc33696", 10789}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13077029}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight - English DOS CD (from jvprat) // Executable scanning reports "2.000.000", VERSION file reports "01.100.000" @@ -649,7 +649,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996}, {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - English Windows CD (from jvprat) // Executable scanning reports "2.000.000", VERSION file reports "01.100.000" @@ -657,7 +657,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996}, {"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - German DOS CD (from Tobis87) // SCI interpreter version 2.000.000 @@ -665,7 +665,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - Spanish DOS CD (from jvprat) // Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995" @@ -673,7 +673,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599}, AD_LISTEND}, - Common::ES_ESP, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::ES_ESP, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - French DOS CD (from Hkz) // VERSION file reports "1.000.000, May 3, 1994" @@ -681,7 +681,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "55f909ba93a2515042a08d8a2da8414e", 11392}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13325145}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::FR_FRA, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - German Windows CD (from Tobis87) // SCI interpreter version 2.000.000 @@ -689,7 +689,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformWindows, ADGF_CD, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - Spanish Windows CD (from jvprat) // Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995" @@ -697,7 +697,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404}, {"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599}, AD_LISTEND}, - Common::ES_ESP, Common::kPlatformWindows, ADGF_CD, GUIO_NONE }, + Common::ES_ESP, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight - English Macintosh {"gk1", "", { @@ -706,7 +706,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"Data3", 0, "f25068b408b09275d8b698866462f578", 3677599}, {"Data4", 0, "1cceebbe411b26c860a74f91c337fdf3", 3230086}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE }, // Gabriel Knight 2 - English Windows Non-Interactive Demo // Executable scanning reports "2.100.002" @@ -714,7 +714,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "e0effce11c4908f4b91838741716c83d", 1351}, {"resource.000", 0, "d04cfc7f04b6f74d13025378be49ec2b", 4640330}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight 2 - English DOS (from jvprat) // Executable scanning reports "2.100.002", VERSION file reports "1.1" @@ -732,7 +732,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.006", 0, "ce9359037277b7d7976da185c2fa0aad", 2977}, {"ressci.006", 0, "8e44e03890205a7be12f45aaba9644b4", 60659424}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight 2 - French DOS (6-CDs Sierra Originals reedition) // Executable scanning reports "2.100.002", VERSION file reports "1.0" @@ -750,7 +750,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.006", 0, "11b2e722170b8c93fdaa5428e2c7676f", 3001}, {"ressci.006", 0, "4037d941aec39d2e654e20960429aefc", 60568486}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, 0, + Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Gabriel Knight 2 - English Macintosh @@ -763,7 +763,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"Data4", 0, "8b843c62eb53136a855d6e0087e3cb0d", 5889553}, {"Data5", 0, "f9fcf9ab2eb13b2125c33a1cda03a093", 14349984}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE }, #endif // ENABLE_SCI32 @@ -1446,7 +1446,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.000", 0, "4948e4e1506f1e1c4e1d47abfa06b7f8", 204385195}, {"resource.map", 0, "40ccafb2195301504eba2e4f4f2c7f3d", 18925}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - English Windows (from the King's Quest Collection) // Executable scanning reports "2.100.002", VERSION file reports "1.4" @@ -1454,7 +1454,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697}, {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 203882535}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - English DOS (from FRG) // SCI interpreter version 2.100.002, VERSION file reports "2.00b" @@ -1462,7 +1462,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709}, {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - English Windows (from FRG) // SCI interpreter version 2.100.002, VERSION file reports "2.00b" @@ -1470,7 +1470,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709}, {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - German Windows (supplied by markcoolio in bug report #2727402) // SCI interpreter version 2.100.002 @@ -1478,7 +1478,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "838b9ff132bd6962026fee832e8a7ddb", 18697}, {"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 206626576}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - Spanish DOS (from jvprat) // Executable scanning reports "2.100.002", VERSION file reports "2.00" @@ -1486,7 +1486,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "0b62693cbe87e3aaca3e8655a437f27f", 18709}, {"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100}, AD_LISTEND}, - Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // King's Quest 7 - English DOS Non-Interactive Demo // SCI interpreter version 2.100.002 @@ -1494,7 +1494,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "b44f774108d63faa1d021101221c5a54", 1690}, {"resource.000", 0, "d9659d2cf0c269c6a9dc776707f5bea0", 2433827}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif // ENABLE_SCI32 @@ -2087,7 +2087,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872}, {"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691) // SCI interpreter version 2.100.002 @@ -2095,7 +2095,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896}, {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18534274}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691) // SCI interpreter version 2.100.002 @@ -2103,7 +2103,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896}, {"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18538987}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE }, + Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691) // SCI interpreter version 2.100.002 @@ -2111,7 +2111,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.000", 0, "5cc6159688b2dc03790a67c90ccc67f9", 10195878}, {"resmap.000", 0, "6a2b2811eef82e87cde91cf1de845af8", 2695}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, #ifdef ENABLE_SCI3_GAMES // Larry 7 - English DOS CD (from spookypeanut) @@ -2120,7 +2120,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188}, {"ressci.000", 0, "89353723488219e25589165d73ed663e", 66965678}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Larry 7 - German DOS (from Tobis87) // SCI interpreter version 3.000.000 @@ -2128,7 +2128,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "c11e6bfcfc2f2d05da47e5a7df3e9b1a", 8188}, {"ressci.000", 0, "a8c6817bb94f332ff498a71c8b47f893", 66971724}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Larry 7 - French DOS (provided by richiefs in bug report #2670691) // SCI interpreter version 3.000.000 @@ -2136,7 +2136,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "4407849fd52fe3efb0c30fba60cd5cd4", 8206}, {"ressci.000", 0, "dc37c3055fffbefb494ff22b145d377b", 66964472}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Larry 7 - Italian DOS CD (from glorifindel) // SCI interpreter version 3.000.000 @@ -2144,7 +2144,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "9852a97141f789413f29bf956052acdb", 8212}, {"ressci.000", 0, "440b9fed89590abb4e4386ed6f948ee2", 67140181}, AD_LISTEND}, - Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NONE }, + Common::IT_ITA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Larry 7 - Spanish DOS (from the Leisure Suit Larry Collection) // Executable scanning reports "3.000.000", VERSION file reports "1.0s" @@ -2152,7 +2152,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "8f3d603e1acc834a5d598b30cdfc93f3", 8188}, {"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418}, AD_LISTEND}, - Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif // Lighthouse - English Windows Demo (from jvprat) @@ -2161,7 +2161,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64}, {"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, #ifdef ENABLE_SCI3_GAMES // Lighthouse - English Windows Demo @@ -2170,7 +2170,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525}, {"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, // Lighthouse - English DOS (from jvprat) // Executable scanning reports "3.000.000", VERSION file reports "1.1" @@ -2180,7 +2180,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.002", 0, "c68db5333f152fea6ca2dfc75cad8b34", 7573}, {"ressci.002", 0, "175468431a979b9f317c294ce3bc1430", 94628315}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Lighthouse - Spanish DOS (from jvprat) // Executable scanning reports "3.000.000", VERSION file reports "1.1" @@ -2190,7 +2190,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.002", 0, "e7dc85884a2417e2eff9de0c63dd65fa", 7630}, {"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127}, AD_LISTEND}, - Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif // ENABLE_SCI3_GAMES #endif // ENABLE_SCI32 @@ -2307,7 +2307,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741}, {"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (English/French/German/Spanish) // Executable scanning reports "2.100.002" @@ -2315,7 +2315,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "ef611af561898dcfea87846919ebf3eb", 4969}, {"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, #endif // ENABLE_SCI32 // Ms. Astro Chicken - English DOS @@ -2345,7 +2345,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.007", 0, "afbd16ea77869a720afa1c5371de107d", 7972}, //{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Phantasmagoria - English DOS Demo // Executable scanning reports "2.100.002" @@ -2353,7 +2353,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.001", 0, "416138651ea828219ca454cae18341a3", 11518}, {"ressci.001", 0, "3aae6559aa1df273bc542d5ac6330d75", 65844612}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, // Phantasmagoria - English DOS/Windows (GOG version) - ressci.* merged in ressci.000 // Windows executable scanning reports "2.100.002" - "Sep 19 1995 15:09:43" @@ -2364,7 +2364,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.000", 0, "cd5967f9b9586e3380645961c0765be3", 116822037}, {"resmap.000", 0, "3cafc1c6a53945c1f3babbfd6380c64c", 16468}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Phantasmagoria - English Macintosh // NOTE: This only contains disc 1 files (as well as the two persistent files: @@ -2380,7 +2380,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { // Data8-12 are empty {"Data13", 0, "6d2c450fca19a69b5af74ed5b03c0a17", 14923328}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE }, #ifdef ENABLE_SCI3_GAMES // Phantasmagoria 2 - English Windows (from jvprat) @@ -2397,7 +2397,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.005", 0, "8bd5ceeedcbe16dfe55d1b90dcd4be84", 1942}, {"ressci.005", 0, "05f9fe2bee749659acb3cd2c90252fc5", 67905112}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Phantasmagoria 2 - English DOS (GOG version) - ressci.* merged in ressci.000 // Executable scanning reports "3.000.000" - "Dec 07 1996 09:29:03" @@ -2407,7 +2407,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.000", 0, "c54f26d9f43f908151263254b6d97053", 108134481}, {"resmap.000", 0, "de154a223a9ef4ea7358b76adc38ef5b", 2956}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif // ENABLE_SCI3_GAMES #endif // ENABLE_SCI32 @@ -2614,7 +2614,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "379dfe80ed6bd16c47e4b950c4722eac", 11374}, {"resource.000", 0, "fd316a09b628b7032248139003369022", 18841068}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Police Quest 4 - English DOS // SCI interpreter version 2.000.000 (a guess?) @@ -2622,7 +2622,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "aed9643158ccf01b71f359db33137f82", 9895}, {"resource.000", 0, "da383857b3be1e4514daeba2524359e0", 15141432}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Police Quest 4 - French DOS (supplied by abevi in bug report #2612718) // SCI interpreter version 2.000.000 @@ -2630,7 +2630,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "008030846edcc7c5c7a812c7f4ae4ceb", 9256}, {"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730153}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Police Quest 4 - German DOS (supplied by markcoolio in bug report #2723840) // SCI interpreter version 2.000.000 (a guess?) @@ -2638,7 +2638,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "2393ee728ab930b2762cb5889f9b5aff", 9256}, {"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730155}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Police Quest: SWAT - English DOS/Windows Demo (from jvprat) // Executable scanning reports "2.100.002", VERSION file reports "0.001.200" @@ -2646,7 +2646,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "8c96733ef94c21526792f7ca4e3f2120", 1648}, {"resource.000", 0, "d8892f1b8c56c8f7704325460f49b300", 3676175}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, // Police Quest: SWAT - English DOS (from GOG.com) // Executable scanning reports "2.100.002", VERSION file reports "1.0c" @@ -2654,7 +2654,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "1c2563fee189885e29d9348f37306d94", 12175}, {"ressci.000", 0, "b2e1826ca81ce2e7e764587f5a14eee9", 127149181}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Police Quest: SWAT - English Windows (from the Police Quest Collection) // Executable scanning reports "2.100.002", VERSION file reports "1.0c" @@ -2669,7 +2669,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.004", 0, "4228038906f041623e65789500b22285", 6835}, {"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, #endif // ENABLE_SCI32 // Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784) @@ -2980,7 +2980,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301}, {"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Quest for Glory 4 1.1 Floppy - English DOS (supplied by abevi in bug report #2612718) // SCI interpreter version 2.000.000 @@ -2988,7 +2988,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "d10a4cc177d2091d744e2ad8c049b0ae", 9295}, {"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11003589}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Quest for Glory 4 1.1 Floppy - German DOS (supplied by markcool in bug report #2723850) // Executable scanning reports "2.000.000", VERSION file reports "1.1" @@ -2996,7 +2996,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301}, {"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Quest for Glory 4 CD - English DOS/Windows (from jvprat) // Executable scanning reports "2.100.002", VERSION file reports "1.0" @@ -3004,7 +3004,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246}, {"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // RAMA - English DOS/Windows Demo // Executable scanning reports "2.100.002", VERSION file reports "000.000.008" @@ -3012,7 +3012,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.001", 0, "775304e9b2a545156be4d94209550094", 1393}, {"ressci.001", 0, "259437fd75fdf51e8207fda8c01fa4fd", 2334384}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, #ifdef ENABLE_SCI3_GAMES // RAMA - English Windows (from jvprat) @@ -3025,7 +3025,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.003", 0, "31ef4c0621711585d031f0ae81707251", 1636}, {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6860492}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, // RAMA - English Windows (from Quietust, in bug report #2850645) {"rama", "", { @@ -3036,7 +3036,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.003", 0, "48841e4b84ef1b98b48d43566fda9e13", 1636}, {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6870356}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, // RAMA - Italian Windows CD (from glorifindel) // SCI interpreter version 3.000.000 (a guess?) @@ -3044,7 +3044,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70611091}, {"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338}, AD_LISTEND}, - Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, #endif // ENABLE_SCI3_GAMES // Shivers - English Windows (from jvprat) @@ -3053,14 +3053,14 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "f2ead37749ed8f6535a2445a7d05a0cc", 46525}, {"ressci.000", 0, "4294c6d7510935f2e0a52e302073c951", 262654836}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, // Shivers - German Windows (from Tobis87) {"shivers", "", { {"resmap.000", 0, "f483d0a1f78334c18052e92785c3086e", 46537}, {"ressci.000", 0, "6751b144671e2deed919eb9d284b07eb", 262390692}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, // Shivers - English Windows Demo // Executable scanning reports "2.100.002" @@ -3068,7 +3068,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "d9e0bc5eddefcbe47f528760085d8927", 1186}, {"ressci.000", 0, "3a93c6340b54e07e65d0e5583354d186", 10505469}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, // Shivers 2 doesn't contain SCI scripts. The whole game logic has // been reimplemented from SCI in native code placed in DLL files. @@ -3086,7 +3086,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "d8659188b84beaef076bd869837cd530", 634}, {"ressci.000", 0, "7fbac0807a044c9543e8ac376d200e59", 4925003}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, // Shivers 2 - English Windows (from abevi) // VERSION.TXT Version 1.0 (3/25/97) @@ -3094,7 +3094,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.001", 0, "a79d03d6eb75be0a79324f14e3d2ace4", 95346793}, {"resmap.001", 0, "a4804d436d90c4ec2e46b537f5e954db", 6268}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif @@ -3572,7 +3572,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528}, {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG) // SCI interpreter version 2.100.002 (just a guess) @@ -3580,7 +3580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528}, {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - French DOS/Win3.11 CD (from French magazine Joystick - September 1997) // Executable scanning reports "2.100.002", VERSION file reports "1.0" @@ -3588,7 +3588,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "3c831625931d5079b73ae8c275f52c95", 10534}, {"resource.000", 0, "4195ca940f759424f62b90e262cc1737", 40932397}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE }, + Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884) // SCI interpreter version 2.100.002 (just a guess) @@ -3596,7 +3596,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534}, {"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG) // SCI interpreter version 2.100.002 (just a guess) @@ -3604,7 +3604,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "368f07b07433db3f819fa3fa0e5efee5", 2572}, {"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, #endif // ENABLE_SCI32 // The Island of Dr. Brain - English DOS CD (from jvprat) @@ -3638,7 +3638,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "9a3e172cde9963d0a969f26469318cec", 3403}, {"ressci.000", 0, "db3e290481c35c3224e9602e71e4a1f1", 5073868}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH }, // Torin's Passage - English Windows // SCI interpreter version 2.100.002 (just a guess) @@ -3646,7 +3646,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799}, {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Torin's Passage - Spanish Windows (from jvprat) // Executable scanning reports "2.100.002", VERSION file reports "1.0" @@ -3655,7 +3655,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887}, // TODO: depend on one of the patches? AD_LISTEND}, - Common::ES_ESP, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::ES_ESP, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Torin's Passage - French Windows // SCI interpreter version 2.100.002 (just a guess) @@ -3663,7 +3663,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799}, {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Torin's Passage - German Windows // SCI interpreter version 2.100.002 (just a guess) @@ -3671,7 +3671,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799}, {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH }, + Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH }, // Torin's Passage - Italian Windows CD (from glorifindel) // SCI interpreter version 2.100.002 (just a guess) @@ -3679,7 +3679,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799}, {"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887}, AD_LISTEND}, - Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE }, + Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE }, #endif // ENABLE_SCI32 // SCI Fanmade Games -- cgit v1.2.3 From d4b5c595c641b3db7b94faf040d979e08e2c3ffb Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 22:48:51 -0500 Subject: GROOVIE: flag all WIP games with ADGF_UNSTABLE Groovie 2 games --- engines/groovie/detection.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 2065307ca9..62887bac1e 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -131,7 +131,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "11h", "", AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM }, kGroovieV2, 1 @@ -142,7 +142,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "11h", "Demo", AD_ENTRY1s("disk.1", "aacb32ce07e0df2894bd83a3dee40c12", 70), - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, Common::GUIO_NOLAUNCHLOAD | + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NOLAUNCHLOAD | Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM }, kGroovieV2, 1 @@ -153,7 +153,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "11h", "Making Of", AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD }, kGroovieV2, 2 }, @@ -163,7 +163,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "clandestiny", "Trailer", AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD }, kGroovieV2, 3 }, @@ -173,7 +173,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "clandestiny", "", AD_ENTRY1s("disk.1", "f79fc1515174540fef6a34132efc4c53", 76), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI }, kGroovieV2, 1 }, @@ -183,7 +183,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "unclehenry", "", AD_ENTRY1s("disk.1", "0e1b1d3cecc4fc7efa62a968844d1f7a", 72), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI }, kGroovieV2, 1 }, @@ -193,7 +193,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "tlc", "", AD_ENTRY1s("disk.1", "32a1afa68478f1f9d2b25eeea427f2e3", 84), - Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI }, kGroovieV2, 1 }, -- cgit v1.2.3 From ff3fbfcf770bcb43d2d5d77617550c9c0501afa5 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 22:54:12 -0500 Subject: LASTEXPRESS: flag all WIP games with ADGF_UNSTABLE all --- engines/lastexpress/detection.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index 369d815543..de80e75341 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -47,7 +47,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -65,7 +65,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -83,7 +83,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -98,7 +98,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformUnknown, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -116,7 +116,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::FR_FRA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -134,7 +134,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::DE_DEU, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -152,7 +152,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::ES_ESP, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -170,7 +170,7 @@ static const ADGameDescription gameDescriptions[] = { }, Common::IT_ITA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, -- cgit v1.2.3 From 94334f66b31355da95468eb2d87cb1f332dbeea9 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 22:57:17 -0500 Subject: M4: flag all WIP games with ADGF_UNSTABLE all --- engines/m4/detection.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index 02ed967777..9c359c081f 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -79,7 +79,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Burger, @@ -95,7 +95,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::DE_DEU, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Burger, @@ -111,7 +111,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::RU_RUS, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Burger, @@ -127,7 +127,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_Burger, @@ -143,7 +143,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_Burger, @@ -159,7 +159,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -175,7 +175,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -191,7 +191,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::DE_DEU, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -207,7 +207,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::FR_FRA, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -223,7 +223,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::ES_ESP, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -239,7 +239,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_Riddle, @@ -255,7 +255,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NOSPEECH }, GType_RexNebular, @@ -271,7 +271,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_RexNebular, @@ -287,7 +287,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NOSPEECH }, GType_DragonSphere, @@ -304,7 +304,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_DragonSphere, @@ -320,7 +320,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_DragonSphere, @@ -336,7 +336,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NOSPEECH }, GType_Phantom, @@ -352,7 +352,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GType_Phantom, @@ -368,7 +368,7 @@ static const M4GameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE }, GType_Phantom, -- cgit v1.2.3 From efd85e17920321d893f7552bf295761374d6ce05 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 23:05:24 -0500 Subject: MOHAWK: flag all WIP games with ADGF_UNSTABLE Where in Time is Carmen Sandiego? Myst Riven: The Sequel to Myst The following games are flagged according to the compatibility list zoombini csworld csamtrak carmentq carmentqc maggiesfa jamesmath treehouse 1stdegree csusa arthurrace catinthehat rugrats lbsampler >=V3 arthurcomp --- engines/mohawk/detection_tables.h | 110 +++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 2cf80377f6..00bff4aee1 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -33,7 +33,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "ae3258c9c90128d274aa6a790b3ad181"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -51,7 +51,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("DEMO.DAT", "c39303dd53fb5c4e7f3c23231c606cd0"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -69,7 +69,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "4beb3366ed3f3b9bfb6e81a14a43bdcc"), Common::DE_DEU, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -87,7 +87,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "e0937cca1ab125e48e30dc3cd5046ddf"), Common::DE_DEU, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -105,7 +105,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "f7e7d7ca69934f1351b5acd4fe4d44c2"), Common::ES_ESP, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -123,7 +123,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "032c88e3b7e8db4ca475e7b7db9a66bb"), Common::JA_JPN, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -141,7 +141,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "d631d42567a941c67c78f2e491f4ea58"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -159,7 +159,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MAKING.DAT", "f6387e8f0f7b8a3e42c95294315d6a0e"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MAKINGOF, @@ -177,7 +177,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MAKING.DAT", "03ff62607e64419ab2b6ebf7b7bcdf63"), Common::JA_JPN, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MAKINGOF, @@ -195,7 +195,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "c4cae9f143b5947262e6cb2397e1617e"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -213,7 +213,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "c4cae9f143b5947262e6cb2397e1617e"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -231,7 +231,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "f88e0ace66dbca78eebdaaa1d3314ceb"), Common::DE_DEU, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -249,7 +249,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MYST.DAT", "aea81633b2d2ae498f09072fb87263b6"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -267,7 +267,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "71145fdecbd68a0cfc292c2fbddf8e08"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -285,7 +285,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "d8ccae34a0e3c709135a73f449b783be"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -303,7 +303,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "249e8c995d191b03ee94c892c0eac775"), Common::ES_ESP, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -321,7 +321,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "08fcaa5d5a2a01d7a5a6960f497212fe"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -339,7 +339,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "a5fe1c91a6033eb6ee54b287578b74b9"), Common::DE_DEU, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -357,7 +357,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "aff2a384aaa9a0e0ec51010f708c5c04"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -375,7 +375,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("a_Data.MHK", "bae6b03bd8d6eb350d35fd13f0e3139f"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -390,7 +390,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("signin.mhk", "410b4ce8d1a8702971e4d1ffba9b965d"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSTIME, @@ -405,7 +405,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("iface.mhk", "5c1203712a16513bd158dc3c1b6cebd7"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_DEMO, + ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSTIME, @@ -421,7 +421,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("ZOOMBINI.MHK", "98b758fec55104c096cfd129048be9a6"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_ZOOMBINI, @@ -436,7 +436,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("ZOOMBINI.MHK", "0672f65c40dd065840c896e41c13f980"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_ZOOMBINI, @@ -451,7 +451,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("ZOOMBINI.MHK", "6ae0bdf791266b1fe3d4fabbf44c3faa"), Common::DE_DEU, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_ZOOMBINI, @@ -466,7 +466,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("ZOOMBINI.MHK", "8231e58525143ccf6e8b747df34b139f"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_ZOOMBINI, @@ -481,7 +481,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("C2K.MHK", "605fe88380848031bbd0ff84ade6fe40"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSWORLD, @@ -496,7 +496,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("C2K.MHK", "d4857aeb0f5e2e0c4ac556aa74f38c23"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSWORLD, @@ -511,7 +511,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("AMTRAK.MHK", "2f95301f0bb950d555bb7b0e3b1b7eb1"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSAMTRAK, @@ -645,7 +645,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("Outline.txt", "67abce5dcda969c23f367a98c90439bc"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV5, @@ -660,7 +660,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("Outline.txt", "6a281eefe72987afb0f8fb6cf84553f5"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV5, @@ -675,7 +675,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("Outline", "b7dc6e65fa9e80784a5bb8b557aa37c4"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -690,7 +690,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BookOutline", "1ce006d7daaa26cf61040203856b88f1"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -705,7 +705,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BRODER.MHK", "007299da8b2c6e8ec1cde9598c243024"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_JAMESMATH, @@ -721,7 +721,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BRODER.MHK", "53c000938a50dca92860fd9b546dd276"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_JAMESMATH, @@ -736,7 +736,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("MAINROOM.MHK", "12f51894d7f838af639ea9bf1bc8f45b"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_TREEHOUSE, @@ -858,7 +858,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_1STDEGREE, @@ -876,7 +876,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("AL236_1.MHK", "0e0c70b1b702b6ddca61a1192ada1282"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_1STDEGREE, @@ -891,7 +891,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("USAC2K.MHK", "b8c9d3a2586f62bce3a48b50d7a700e9"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_CSUSA, @@ -1435,7 +1435,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("RACE.LB", "1645f36bcb36e440d928e920aa48c373"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1451,7 +1451,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("RACE32.LB", "292a05bc48c1dd9583821a4181a02ef2"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1686,7 +1686,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("Outline", "0b5ab6dd7c08cf23066efa709fa48bbc"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1701,7 +1701,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BookOutline", "e139903eee98f0b0c3f39247a23b8f10"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1716,7 +1716,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("outline", "525be248363fe27d50d750632c1e759e"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV4, @@ -1731,7 +1731,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BookOutline", "54a324ee6f8260258bff7043a05b0004"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV4, @@ -1749,7 +1749,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("outline", "36225e0b4986a80135cfdd9643cc7030"), Common::FR_FRA, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV4, @@ -1825,7 +1825,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("outline", "d239506f969ff68fa886f084082e9158"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1840,7 +1840,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BookOutline", "6dd1c0606f1db3b71207121b4370e487"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV3, @@ -1934,7 +1934,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("OUTLINE", "dec4d1a05449f81b6012706932658326"), Common::EN_ANY, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV4, @@ -1949,7 +1949,7 @@ static const MohawkGameDescription gameDescriptions[] = { AD_ENTRY1("BookOutline", "87bf1f9113340ce1c6c880932e815882"), Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_LIVINGBOOKSV4, @@ -2150,7 +2150,7 @@ static const MohawkGameDescription fallbackDescs[] = { AD_ENTRY1(0, 0), Common::UNK_LANG, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -2165,7 +2165,7 @@ static const MohawkGameDescription fallbackDescs[] = { AD_ENTRY1(0, 0), Common::UNK_LANG, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MAKINGOF, @@ -2180,7 +2180,7 @@ static const MohawkGameDescription fallbackDescs[] = { AD_ENTRY1(0, 0), Common::UNK_LANG, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_MYST, @@ -2195,7 +2195,7 @@ static const MohawkGameDescription fallbackDescs[] = { AD_ENTRY1(0, 0), Common::UNK_LANG, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, @@ -2210,7 +2210,7 @@ static const MohawkGameDescription fallbackDescs[] = { AD_ENTRY1(0, 0), Common::UNK_LANG, Common::kPlatformWindows, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_RIVEN, -- cgit v1.2.3 From 3d1358776f15c3bea3b759481c861b9afd840369 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 23:10:22 -0500 Subject: SAGA: flag all WIP games with ADGF_UNSTABLE SAGA 2 Games --- engines/saga/detection_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index f63efd206b..ab73fcba6e 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -821,7 +821,7 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GID_DINO, @@ -851,7 +851,7 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GID_FTA2, -- cgit v1.2.3 From 206256713d993a39a0f154a2a6c9378271bca0a6 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 23:12:51 -0500 Subject: SWORD25: flag all WIP games with ADGF_UNSTABLE all --- engines/sword25/detection_tables.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/engines/sword25/detection_tables.h b/engines/sword25/detection_tables.h index ca586b4f01..fe9e6e7934 100644 --- a/engines/sword25/detection_tables.h +++ b/engines/sword25/detection_tables.h @@ -34,7 +34,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588), Common::EN_ANY, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -43,7 +43,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_fr.b25c", "690caf157387e06d2c3d1ca53c43f428", 1006043), Common::FR_FRA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -52,7 +52,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588), Common::DE_DEU, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -61,7 +61,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_hr.b25c", "e881054d1f8ec1e527422fc521c25405", 1273217), Common::HU_HUN, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -70,7 +70,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_it.b25c", "f3325666da0515cc2b42062e953c0889", 996197), Common::IT_ITA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -79,7 +79,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_pl.b25c", "49dc1a20f95391a808e475c49be2bac0", 1281799), Common::PL_POL, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -88,7 +88,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_pt.b25c", "1df701432f9e13dcefe1adeb890b9c69", 993812), Common::PT_BRA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -97,7 +97,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_ru.b25c", "deb33dd2f90a71ff60181918a8ce5063", 1235378), Common::RU_RUS, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, { @@ -106,7 +106,7 @@ static const ADGameDescription gameDescriptions[] = { AD_ENTRY1s("lang_es.b25c", "384c19072d83725f351bb9ecb4d3f02b", 987965), Common::ES_ESP, Common::kPlatformUnknown, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, @@ -120,7 +120,7 @@ static const ADGameDescription gameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformUnknown, - GF_EXTRACTED, + GF_EXTRACTED | ADGF_UNSTABLE, Common::GUIO_NONE }, AD_TABLE_END_MARKER -- cgit v1.2.3 From 1ef7e958201a6a5f4d99071944fa1048fbf5357f Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Fri, 29 Apr 2011 23:15:33 -0500 Subject: TSAGE: flag all WIP games with ADGF_UNSTABLE all --- engines/tsage/detection_tables.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index 4cd74ff13d..2b64222425 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -32,7 +32,7 @@ static const tSageGameDescription gameDescriptions[] = { AD_ENTRY1s("ring.rlb", "466f0e6492d9d0f34d35c5cd088de90f", 37847618), Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_Ringworld, @@ -46,7 +46,7 @@ static const tSageGameDescription gameDescriptions[] = { AD_ENTRY1s("ring.rlb", "7b7f0c5b37b58fa5ec06ebb2ca0d0d9d", 8438770), Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_Ringworld, @@ -91,7 +91,7 @@ static const tSageGameDescription gameDescriptions[] = { AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508), Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, Common::GUIO_NONE }, GType_BlueForce, -- cgit v1.2.3 From 901b6191c5066ee373a588ad593bffa9ee076dca Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Wed, 15 Jun 2011 14:02:42 -0500 Subject: DREAMWEB: flag all WIP games with ADGF_UNSTABLE all --- engines/dreamweb/detection_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 13184650ba..058d43cbd2 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -42,7 +42,7 @@ static const DreamWebGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, }, @@ -59,7 +59,7 @@ static const DreamWebGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_CD, + ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, }, -- cgit v1.2.3 From 283872018b676113ea429af6cf5ee4c1fe498072 Mon Sep 17 00:00:00 2001 From: athrxx Date: Thu, 16 Jun 2011 20:51:09 +0200 Subject: SCUMM: slightly changed behavior of 16bit mode detection (another attempt to fix SCUMM FM-TOWNS for ANDROID) --- engines/scumm/charset.cpp | 1 + engines/scumm/scumm.cpp | 39 ++++++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index dce6c9c144..9238b25feb 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -50,6 +50,7 @@ void ScummEngine::loadCJKFont() { if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji #ifdef DISABLE_TOWNS_DUAL_LAYER_MODE + GUIErrorMessage("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build"); error("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build"); #else // use FM-TOWNS font rom, since game files don't have kanji font resources diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index c74e4d1824..1ccf215605 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1155,24 +1155,29 @@ Common::Error ScummEngine::init() { #endif ) { #ifdef USE_RGB_COLOR - _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); - Common::List tryModes = _system->getSupportedFormats(); - // Try default 555 mode first - tryModes.push_front(_outputPixelFormat); - - for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { - if (g->bytesPerPixel != 2 || g->aBits()) - continue; - _outputPixelFormat = *g; + _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); + + if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) { initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat); - // Other modes than 555 are only supported for FM-TOWNS games and LOOM PCE. - // Especially the HE games require 555. - if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine)) - break; + if (_outputPixelFormat != _system->getScreenFormat()) + return Common::kUnsupportedColorMode; + } else { + Common::List tryModes = _system->getSupportedFormats(); + for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { + if (g->bytesPerPixel != 2 || g->aBits()) + g = tryModes.erase(g); + + if (*g == _outputPixelFormat) { + tryModes.clear(); + tryModes.push_back(_outputPixelFormat); + break; + } + } + + initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes); + if (_system->getScreenFormat().bytesPerPixel != 2) + return Common::kUnsupportedColorMode; } - - if (_outputPixelFormat != _system->getScreenFormat()) - return Common::kUnsupportedColorMode; #else if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) { warning("Starting game without the required 16bit color support.\nYou may experience color glitches"); @@ -1184,7 +1189,7 @@ Common::Error ScummEngine::init() { } else { #ifdef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns && _game.version == 5) - error("This game requires dual graphics layer support which is disabled in this build"); + return Common::Error(Common::kUnsupportedColorMode, "This game requires dual graphics layer support which is disabled in this build"); #endif initGraphics(screenWidth, screenHeight, (screenWidth > 320)); } -- cgit v1.2.3 From 1a58262ca72fd09748755463299e54749d5c63ae Mon Sep 17 00:00:00 2001 From: athrxx Date: Thu, 16 Jun 2011 21:31:45 +0200 Subject: SCUMM: fix bug in cb661d63d0cd45d1231435a593b74dfc51872a0f --- engines/scumm/scumm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 1ccf215605..362430d704 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1164,8 +1164,10 @@ Common::Error ScummEngine::init() { } else { Common::List tryModes = _system->getSupportedFormats(); for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { - if (g->bytesPerPixel != 2 || g->aBits()) + if (g->bytesPerPixel != 2 || g->aBits()) { g = tryModes.erase(g); + g--; + } if (*g == _outputPixelFormat) { tryModes.clear(); -- cgit v1.2.3 From 154c584d44d689f0a7b521b49c5ce245a52fb992 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 16 Jun 2011 16:09:20 -0400 Subject: BACKENDS: Enhance Win32TaskbarManager::getIconPath() We now look for an iconsPath configuration variable with the path to the icons folder. In addition, we look if there is an "icons" subfolder (useful when using extrapath to store icons) --- backends/taskbar/win32/win32-taskbar.cpp | 35 +++++++++++++++++++++++--------- backends/taskbar/win32/win32-taskbar.h | 7 +++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 3754a03c76..0cfd81e3f2 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -201,20 +201,35 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St } Common::String Win32TaskbarManager::getIconPath(Common::String target) { - // Get extra path - Common::String extra = ConfMan.get("extrapath"); - - Common::String filename = target + ".ico"; + // We first try to look for a iconspath configuration variable then + // fallback to the extra path + // + // Icons can be either in a subfolder named "icons" or directly in the path + + Common::String iconsPath = ConfMan.get("iconspath"); + Common::String extraPath = ConfMan.get("extrapath"); + +#define TRY_ICON_PATH(path) { \ + Common::FSNode node((path)); \ + if (node.exists()) \ + return (path); \ +} - if (!Common::File::exists(filename)) { - // Try with the game id instead of the domain name - filename = ConfMan.get("gameid") + ".ico"; + if (!iconsPath.empty()) { + TRY_ICON_PATH(iconsPath + "/" + target + ".ico"); + TRY_ICON_PATH(iconsPath + "/" + ConfMan.get("gameid") + ".ico"); + TRY_ICON_PATH(iconsPath + "/icons/" + target + ".ico"); + TRY_ICON_PATH(iconsPath + "/icons/" + ConfMan.get("gameid") + ".ico"); + } - if (!Common::File::exists(filename)) - return ""; + if (!extraPath.empty()) { + TRY_ICON_PATH(extraPath + "/" + target + ".ico"); + TRY_ICON_PATH(extraPath + "/" + ConfMan.get("gameid") + ".ico"); + TRY_ICON_PATH(extraPath + "/icons/" + target + ".ico"); + TRY_ICON_PATH(extraPath + "/icons/" + ConfMan.get("gameid") + ".ico"); } - return extra + filename; + return ""; } bool Win32TaskbarManager::isWin7OrLater() { diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index 0fc219e816..3415a79bd7 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -46,6 +46,13 @@ public: private: ITaskbarList3 *_taskbar; + /** + * Get the path to an icon for the game + * + * @param target The game target + * + * @return The icon path (or "" if no icon was found) + */ Common::String getIconPath(Common::String target); // Helper functions -- cgit v1.2.3 From 6fe3e63ed1dc190c9ef6cf21b0d1890b5ebea03a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 17 Jun 2011 00:30:39 +0400 Subject: DREAMWEB: replaced generated code with c++ style stubs --- devtools/tasmrecover/tasm/cpp.py | 155 +- devtools/tasmrecover/tasm/proc.py | 2 +- engines/dreamweb/dreamgen.cpp | 36971 ++++++++++++++++++------------------ engines/dreamweb/dreamgen.h | 831 +- engines/dreamweb/dreamweb.cpp | 52 +- engines/dreamweb/dreamweb.h | 2 +- engines/dreamweb/runtime.h | 4 +- engines/dreamweb/stubs.cpp | 453 +- 8 files changed, 19323 insertions(+), 19147 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index da21efe21d..324772120e 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -36,20 +36,19 @@ class cpp: self.failed = list(blacklist) self.translated = [] self.proc_addr = [] - self.forwards = [] + self.methods = [] self.fd.write("""%s #include \"%s\" namespace %s { - """ %(banner, header, namespace)) def expand_cb(self, match): name = match.group(0).lower() if len(name) == 2 and \ ((name[0] in ['a', 'b', 'c', 'd'] and name[1] in ['h', 'x', 'l']) or name in ['si', 'di', 'es', 'ds', 'cs']): - return "context.%s" %name + return "%s" %name if self.indirection == -1: try: @@ -74,7 +73,7 @@ namespace %s { if size == 0: raise Exception("invalid var '%s' size %u" %(name, size)) if self.indirection == 0: - value = "context.data.%s(k%s)" %("byte" if size == 1 else "word", name.capitalize()) + value = "data.%s(k%s)" %("byte" if size == 1 else "word", name.capitalize()) elif self.indirection == -1: value = "%s" %g.offset self.indirection = 0 @@ -135,7 +134,7 @@ namespace %s { m = re.match(r'seg\s+(.*?)$', expr) if m is not None: - return "context.data" + return "data" match_id = True m = re.match(r'offset\s+(.*?)$', expr) @@ -174,7 +173,7 @@ namespace %s { plus = "" match_id = False #print "COMMON_REG: ", reg, plus - expr = "context.%s%s" %(reg, plus) + expr = "%s%s" %(reg, plus) expr = re.sub(r'\b([0-9][a-fA-F0-9]*)h', '0x\\1', expr) expr = re.sub(r'\b([0-1]+)b', parse_bin, expr) @@ -188,9 +187,9 @@ namespace %s { if indirection == 1: if size == 1: - expr = "context.%s.byte(%s)" %(seg_prefix, expr) + expr = "%s.byte(%s)" %(seg_prefix, expr) elif size == 2: - expr = "context.%s.word(%s)" %(seg_prefix, expr) + expr = "%s.word(%s)" %(seg_prefix, expr) else: expr = "@invalid size 0" elif indirection == 0: @@ -238,12 +237,11 @@ namespace %s { jump_proc = True if jump_proc: - self.add_forward(name) - return "{ %s(context); return; }" %name + return "{ %s(); return; }" %name else: # TODO: name or self.resolve_label(name) or self.mangle_label(name)?? if name in self.proc.retlabels: - return "return /* (%s) */" % (name,) + return "return /* (%s) */" % (name) return "goto %s" %self.resolve_label(name) def _label(self, name): @@ -256,17 +254,12 @@ namespace %s { print "+scheduling function %s..." %name self.proc_queue.append(name) - def add_forward(self, name): - if name not in self.forwards and name not in self.failed: - self.forwards.append(name) - def _call(self, name): name = name.lower() if name == 'ax': - self.body += "\t__dispatch_call(context, %s);\n" %self.expand('ax', 2) + self.body += "\t__dispatch_call(%s);\n" %self.expand('ax', 2) return - self.body += "\t%s(context);\n" %name - self.add_forward(name); + self.body += "\t%s();\n" %name self.schedule(name) def _ret(self): @@ -289,111 +282,111 @@ namespace %s { self.body += "\t%s = %s;\n" %self.parse2(dst, src) def _add(self, dst, src): - self.body += "\tcontext._add(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_add(%s, %s);\n" %self.parse2(dst, src) def _sub(self, dst, src): - self.body += "\tcontext._sub(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_sub(%s, %s);\n" %self.parse2(dst, src) def _and(self, dst, src): - self.body += "\tcontext._and(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_and(%s, %s);\n" %self.parse2(dst, src) def _or(self, dst, src): - self.body += "\tcontext._or(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_or(%s, %s);\n" %self.parse2(dst, src) def _xor(self, dst, src): - self.body += "\tcontext._xor(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_xor(%s, %s);\n" %self.parse2(dst, src) def _neg(self, dst): dst = self.expand(dst) - self.body += "\tcontext._neg(%s);\n" %(dst) + self.body += "\t_neg(%s);\n" %(dst) def _cbw(self): - self.body += "\tcontext.ax.cbw();\n" + self.body += "\tax.cbw();\n" def _shr(self, dst, src): - self.body += "\tcontext._shr(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_shr(%s, %s);\n" %self.parse2(dst, src) def _shl(self, dst, src): - self.body += "\tcontext._shl(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_shl(%s, %s);\n" %self.parse2(dst, src) #def _sar(self, dst, src): - # self.body += "\tcontext._sar(%s%s);\n" %self.parse2(dst, src) + # self.body += "\t_sar(%s%s);\n" %self.parse2(dst, src) #def _sal(self, dst, src): - # self.body += "\tcontext._sal(%s, %s);\n" %self.parse2(dst, src) + # self.body += "\t_sal(%s, %s);\n" %self.parse2(dst, src) #def _rcl(self, dst, src): - # self.body += "\tcontext._rcl(%s, %s);\n" %self.parse2(dst, src) + # self.body += "\t_rcl(%s, %s);\n" %self.parse2(dst, src) #def _rcr(self, dst, src): - # self.body += "\tcontext._rcr(%s, %s);\n" %self.parse2(dst, src) + # self.body += "\t_rcr(%s, %s);\n" %self.parse2(dst, src) def _mul(self, src): src = self.expand(src) - self.body += "\tcontext._mul(%s);\n" %(src) + self.body += "\t_mul(%s);\n" %(src) def _div(self, src): src = self.expand(src) - self.body += "\tcontext._div(%s);\n" %(src) + self.body += "\t_div(%s);\n" %(src) def _inc(self, dst): dst = self.expand(dst) - self.body += "\tcontext._inc(%s);\n" %(dst) + self.body += "\t_inc(%s);\n" %(dst) def _dec(self, dst): dst = self.expand(dst) - self.body += "\tcontext._dec(%s);\n" %(dst) + self.body += "\t_dec(%s);\n" %(dst) def _cmp(self, a, b): - self.body += "\tcontext._cmp(%s, %s);\n" %self.parse2(a, b) + self.body += "\t_cmp(%s, %s);\n" %self.parse2(a, b) def _test(self, a, b): - self.body += "\tcontext._test(%s, %s);\n" %self.parse2(a, b) + self.body += "\t_test(%s, %s);\n" %self.parse2(a, b) def _js(self, label): - self.body += "\tif (context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jns(self, label): - self.body += "\tif (!context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!flags.s())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jz(self, label): - self.body += "\tif (context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jnz(self, label): - self.body += "\tif (!context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!flags.z())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jl(self, label): - self.body += "\tif (context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jg(self, label): - self.body += "\tif (!context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jle(self, label): - self.body += "\tif (context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (flags.le())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jge(self, label): - self.body += "\tif (!context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!flags.l())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jc(self, label): - self.body += "\tif (context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) def _jnc(self, label): - self.body += "\tif (!context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) + self.body += "\tif (!flags.c())\n\t\t%s;\n" %(self.jump_to_label(label)) def _xchg(self, dst, src): - self.body += "\tcontext._xchg(%s, %s);\n" %self.parse2(dst, src) + self.body += "\t_xchg(%s, %s);\n" %self.parse2(dst, src) def _jmp(self, label): self.body += "\t%s;\n" %(self.jump_to_label(label)) def _loop(self, label): - self.body += "\tif (--context.cx)\n\t\t%s;\n" %self.jump_to_label(label) + self.body += "\tif (--cx)\n\t\t%s;\n" %self.jump_to_label(label) def _push(self, regs): p = str(); for r in regs: r = self.expand(r) - p += "\tcontext.push(%s);\n" %(r) + p += "\tpush(%s);\n" %(r) self.body += p def _pop(self, regs): @@ -402,35 +395,35 @@ namespace %s { self.temps_count -= 1 i = self.temps_count r = self.expand(r) - p += "\t%s = context.pop();\n" %r + p += "\t%s = pop();\n" %r self.body += p def _rep(self): - self.body += "\twhile(context.cx--)\n\t" + self.body += "\twhile(cx--)\n\t" def _lodsb(self): - self.body += "\tcontext._lodsb();\n" + self.body += "\t_lodsb();\n" def _lodsw(self): - self.body += "\tcontext._lodsw();\n" + self.body += "\t_lodsw();\n" def _stosb(self, n): - self.body += "\tcontext._stosb(%s);\n" %("" if n == 1 else n) + self.body += "\t_stosb(%s);\n" %("" if n == 1 else n) def _stosw(self, n): - self.body += "\tcontext._stosw(%s);\n" %("" if n == 1 else n) + self.body += "\t_stosw(%s);\n" %("" if n == 1 else n) def _movsb(self, n): - self.body += "\tcontext._movsb(%s);\n" %("" if n == 1 else n) + self.body += "\t_movsb(%s);\n" %("" if n == 1 else n) def _movsw(self, n): - self.body += "\tcontext._movsw(%s);\n" %("" if n == 1 else n) + self.body += "\t_movsw(%s);\n" %("" if n == 1 else n) def _stc(self): - self.body += "\tcontext.flags._c = true;\n " + self.body += "\tflags._c = true;\n " def _clc(self): - self.body += "\tcontext.flags._c = false;\n " + self.body += "\tflags._c = false;\n " def __proc(self, name, def_skip = 0): try: @@ -457,7 +450,7 @@ namespace %s { self.proc_addr.append((name, self.proc.offset)) self.body = str() - self.body += "void %s(Context &context) {\n\tSTACK_CHECK(context);\n" %name; + self.body += "void %sContext::%s() {\n\tSTACK_CHECK;\n" %(self.namespace, name); self.proc.optimize() self.unbounded = [] self.proc.visit(self, skip) @@ -505,7 +498,7 @@ namespace %s { fd = open(fname, "wt") fd.write("namespace %s {\n" %self.namespace) for p in procs: - fd.write("void %s(Context &context) {\n\t::error(\"%s\");\n}\n\n" %(p, p)) + fd.write("void %sContext::%s() {\n\t::error(\"%s\");\n}\n\n" %(self.namespace, p, p)) fd.write("} /*namespace %s */\n" %self.namespace) fd.close() @@ -526,13 +519,11 @@ namespace %s { print "continuing on %s" %name self.proc_done.append(name) self.__proc(name) + self.methods.append(name) self.write_stubs("_stubs.cpp", self.failed) + self.methods += self.failed done, failed = len(self.proc_done), len(self.failed) - for f in self.forwards: - if f not in self.failed: - self.fd.write("void %s(Context &context);\n" %f) - self.fd.write("\n") self.fd.write("\n".join(self.translated)) self.fd.write("\n\n") @@ -546,20 +537,19 @@ namespace %s { n += 1 if (n & 0xf) == 0: data_impl += "\n\t\t" - data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src));\n" + data_impl += "};\n\tds.assign(src, src + sizeof(src));\n" self.hd.write( """\n#include "dreamweb/runtime.h" namespace %s { - void __dispatch_call(Context &context, unsigned addr); - void __start(Context &context); +class %sContext : public Context { +public: + void __start(); + void __dispatch_call(uint16 addr); -""" %(self.namespace)) - for f in self.failed: - self.hd.write("\tvoid %s(Context &context);\n" %f) - - offsets_decl = "\n" +""" +%(self.namespace, self.namespace)) offsets = [] for k, v in self.context.get_globals().items(): if isinstance(v, op.var): @@ -569,20 +559,21 @@ namespace %s { offsets = sorted(offsets, key=lambda t: t[1]) for o in offsets: - offsets_decl += "\tconst static uint16 k%s = %s;\n" %o - offsets_decl += "\n" - self.hd.write(offsets_decl); + self.hd.write("\tconst static uint16 k%s = %s;\n" %o) + self.hd.write("\n") + for p in set(self.methods): + self.hd.write("\tvoid %s();\n" %p) - self.hd.write("\n}\n\n#endif\n") + self.hd.write("};\n}\n\n#endif\n") self.hd.close() - self.fd.write("\nvoid __start(Context &context) { %s%s(context); \n}\n" %(data_impl, start)) + self.fd.write("\nvoid %sContext::__start() { %s%s(); \n}\n" %(self.namespace, data_impl, start)) - self.fd.write("\nvoid __dispatch_call(Context &context, unsigned addr) {\n\tswitch(addr) {\n") + self.fd.write("\nvoid %sContext::__dispatch_call(uint16 addr) {\n\tswitch(addr) {\n" %self.namespace) self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1]) for name,addr in self.proc_addr: - self.fd.write("\t\tcase 0x%04x: %s(context); break;\n" %(addr, name)) - self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)context.ax);") + self.fd.write("\t\tcase 0x%04x: %s(); break;\n" %(addr, name)) + self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)ax);") self.fd.write("\n\t}\n}\n\n} /*namespace*/\n") self.fd.close() diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index 6db3b7a682..c304438984 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -61,7 +61,7 @@ class proc: if i + 1 >= len(stmts): break if isinstance(stmts[i + 1], cls): - stmts[i + 1].repeat = 'context.cx' + stmts[i + 1].repeat = 'cx' del stmts[i] i += 1 return diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 7ad10a2e42..135daa5c76 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4,21880 +4,21407 @@ namespace DreamGen { -void checkbasemem(Context &context); -void allocatebuffers(Context &context); -void clearbuffers(Context &context); -void clearpalette(Context &context); -void readsetdata(Context &context); -void scanfornames(Context &context); -void loadpalfromiff(Context &context); -void titles(Context &context); -void credits(Context &context); -void decide(Context &context); -void clearchanges(Context &context); -void loadroom(Context &context); -void clearsprites(Context &context); -void initman(Context &context); -void entrytexts(Context &context); -void entryanims(Context &context); -void initialinv(Context &context); -void startup1(Context &context); -void clearbeforeload(Context &context); -void startup(Context &context); -void worktoscreenm(Context &context); -void screenupdate(Context &context); -void showgun(Context &context); -void fadescreendown(Context &context); -void hangon(Context &context); -void fadescreendowns(Context &context); -void endgame(Context &context); -void makename(Context &context); -void standardload(Context &context); -void getroomspaths(Context &context); -void readheader(Context &context); -void allocateload(Context &context); -void fillspace(Context &context); -void sortoutmap(Context &context); -void findroominloc(Context &context); -void deletetaken(Context &context); -void setallchanges(Context &context); -void autoappear(Context &context); -void getroomdata(Context &context); -void autosetwalk(Context &context); -void findxyfrompath(Context &context); -void twodigitnum(Context &context); -void startloading(Context &context); -void loadroomssample(Context &context); -void switchryanon(Context &context); -void drawflags(Context &context); -void getdimension(Context &context); -void getflagunderp(Context &context); -void dumpblink(Context &context); -void showblink(Context &context); -void showframe(Context &context); -void printcurs(Context &context); -void delcurs(Context &context); -void delpointer(Context &context); -void readmouse(Context &context); -void animpointer(Context &context); -void showpointer(Context &context); -void dumppointer(Context &context); -void commandonly(Context &context); -void showtime(Context &context); -void showwatch(Context &context); -void printmessage(Context &context); -void printdirect(Context &context); -void usecharset1(Context &context); -void showpanel(Context &context); -void showman(Context &context); -void roomname(Context &context); -void panelicons1(Context &context); -void zoomicon(Context &context); -void middlepanel(Context &context); -void findobname(Context &context); -void workoutframes(Context &context); -void checkdest(Context &context); -void bresenhams(Context &context); -void facerightway(Context &context); -void checkone(Context &context); -void commandwithob(Context &context); -void findnextcolon(Context &context); -void deltextline(Context &context); -void copyname(Context &context); -void finishedwalking(Context &context); -void examineob(Context &context); -void talk(Context &context); -void setwalk(Context &context); -void examineobtext(Context &context); -void blocknametext(Context &context); -void personnametext(Context &context); -void walktotext(Context &context); -void clearwork(Context &context); -void drawfloor(Context &context); -void reelsonscreen(Context &context); -void spriteupdate(Context &context); -void printsprites(Context &context); -void playchannel0(Context &context); -void cancelch0(Context &context); -void createpanel(Context &context); -void findpathofpoint(Context &context); -void showicon(Context &context); -void undertextline(Context &context); -void mainscreen(Context &context); -void getunderzoom(Context &context); -void zoom(Context &context); -void walkintoroom(Context &context); -void reminders(Context &context); -void atmospheres(Context &context); -void findormake(Context &context); -void obname(Context &context); -void pixelcheckset(Context &context); -void isitdescribed(Context &context); -void getreelstart(Context &context); -void getreelframeax(Context &context); -void blank(Context &context); -void findfirstpath(Context &context); -void checkifex(Context &context); -void checkiffree(Context &context); -void checkifperson(Context &context); -void checkifset(Context &context); -void identifyob(Context &context); -void checkcoords(Context &context); -void walkandexamine(Context &context); -void convnum(Context &context); -void onedigit(Context &context); -void plotreel(Context &context); -void checkforshake(Context &context); -void newplace(Context &context); -void readmouse1(Context &context); -void dumptextline(Context &context); -void autolook(Context &context); -void watchcount(Context &context); -void readmouse2(Context &context); -void dumpzoom(Context &context); -void deleverything(Context &context); -void afternewroom(Context &context); -void readmouse3(Context &context); -void dumpmap(Context &context); -void dumptimedtext(Context &context); -void readmouse4(Context &context); -void dumpwatch(Context &context); -void fadescreenup(Context &context); -void clearreels(Context &context); -void clearrest(Context &context); -void trysoundalloc(Context &context); -void allocatework(Context &context); -void checkforemm(Context &context); -void getanyad(Context &context); -void transfertoex(Context &context); -void pickupob(Context &context); -void switchryanoff(Context &context); -void resetlocation(Context &context); -void removefreeobject(Context &context); -void checkifpathison(Context &context); -void turnpathon(Context &context); -void removesetobject(Context &context); -void placesetobject(Context &context); -void turnanypathon(Context &context); -void setuptimeduse(Context &context); -void volumeadjust(Context &context); -void loopchannel0(Context &context); -void cancelch1(Context &context); -void createname(Context &context); -void doload(Context &context); -void showdecisions(Context &context); -void showopbox(Context &context); -void showloadops(Context &context); -void showslots(Context &context); -void shownames(Context &context); -void namestoold(Context &context); -void getridoftemp(Context &context); -void initrain(Context &context); -void createpanel2(Context &context); -void loadsavebox(Context &context); -void storeit(Context &context); -void makeheader(Context &context); -void oldtonames(Context &context); -void showsaveops(Context &context); -void readkey(Context &context); -void getnamepos(Context &context); -void selectslot(Context &context); -void loadposition(Context &context); -void saveposition(Context &context); -void restoreall(Context &context); -void redrawmainscrn(Context &context); -void checkinput(Context &context); -void showdiscops(Context &context); -void loadintotemp(Context &context); -void getback1(Context &context); -void getridofall(Context &context); -void showmainops(Context &context); -void dosaveload(Context &context); -void findtext1(Context &context); -void usetempcharset(Context &context); -void playchannel1(Context &context); -void getlocation(Context &context); -void setlocation(Context &context); -void hangonp(Context &context); -void showdiary(Context &context); -void showdiarypage(Context &context); -void getridofreels(Context &context); -void loadtemptext(Context &context); -void loadtempcharset(Context &context); -void showdiarykeys(Context &context); -void dumpdiarykeys(Context &context); -void getridoftemptext(Context &context); -void getridoftempcharset(Context &context); -void restorereels(Context &context); -void nextsymbol(Context &context); -void showsymbol(Context &context); -void updatesymboltop(Context &context); -void updatesymbolbot(Context &context); -void dumpsymbol(Context &context); -void turnanypathoff(Context &context); -void folderexit(Context &context); -void showleftpage(Context &context); -void showrightpage(Context &context); -void loadintotemp2(Context &context); -void loadintotemp3(Context &context); -void showfolder(Context &context); -void folderhints(Context &context); -void loadfolder(Context &context); -void getridoftemp2(Context &context); -void getridoftemp3(Context &context); -void loadmenu(Context &context); -void getundermenu(Context &context); -void putundermenu(Context &context); -void showmenu(Context &context); -void dumpmenu(Context &context); -void singlekey(Context &context); -void buttonpress(Context &context); -void loadkeypad(Context &context); -void showouterpad(Context &context); -void showkeypad(Context &context); -void dumpkeypad(Context &context); -void addtopresslist(Context &context); -void isitright(Context &context); -void checkinside(Context &context); -void compare(Context &context); -void showfirstuse(Context &context); -void putbackobstuff(Context &context); -void withwhat(Context &context); -void showpuztext(Context &context); -void placefreeobject(Context &context); -void issetobonmap(Context &context); -void showseconduse(Context &context); -void removeobfrominv(Context &context); -void turnpathoff(Context &context); -void getundertimed(Context &context); -void putundertimed(Context &context); -void getsetad(Context &context); -void getfreead(Context &context); -void dochange(Context &context); -void findpuztext(Context &context); -void showexit(Context &context); -void obicons(Context &context); -void obpicture(Context &context); -void describeob(Context &context); -void getanyaddir(Context &context); -void findinvpos(Context &context); -void useroutine(Context &context); -void printmessage2(Context &context); -void fillryan(Context &context); -void findsetobject(Context &context); -void getobtextstart(Context &context); -void usetext(Context &context); -void selectlocation(Context &context); -void hangonw(Context &context); -void moneypoke(Context &context); -void nextcolon(Context &context); -void getexad(Context &context); -void entercode(Context &context); -void findexobject(Context &context); -void makeworn(Context &context); -void isryanholding(Context &context); -void nothelderror(Context &context); -void triggermessage(Context &context); -void monprint(Context &context); -void printchar(Context &context); -void showcurrentfile(Context &context); -void printlogo(Context &context); -void randomaccess(Context &context); -void locklighton(Context &context); -void locklightoff(Context &context); -void makecaps(Context &context); -void monmessage(Context &context); -void scrollmonitor(Context &context); -void searchforstring(Context &context); -void getkeyandlogo(Context &context); -void monitorlogo(Context &context); -void parser(Context &context); -void neterror(Context &context); -void processtrigger(Context &context); -void input(Context &context); -void dirfile(Context &context); -void searchforfiles(Context &context); -void dircom(Context &context); -void signon(Context &context); -void read(Context &context); -void showkeys(Context &context); -void delchar(Context &context); -void randomnum1(Context &context); -void accesslighton(Context &context); -void accesslightoff(Context &context); -void powerlighton(Context &context); -void powerlightoff(Context &context); -void lookininterface(Context &context); -void loadpersonal(Context &context); -void loadnews(Context &context); -void loadcart(Context &context); -void printoutermon(Context &context); -void initialmoncols(Context &context); -void turnonpower(Context &context); -void fadeupyellows(Context &context); -void fadeupmonfirst(Context &context); -void hangoncurs(Context &context); -void execcommand(Context &context); -void purgealocation(Context &context); -void getdestinfo(Context &context); -void showarrows(Context &context); -void locationpic(Context &context); -void getundercentre(Context &context); -void putundercentre(Context &context); -void readcitypic(Context &context); -void showcity(Context &context); -void readdesticon(Context &context); -void loadtraveltext(Context &context); -void convicons(Context &context); -void starttalk(Context &context); -void hangonpq(Context &context); -void redes(Context &context); -void dosometalk(Context &context); -void getpersontext(Context &context); -void getpersframe(Context &context); -void findsource(Context &context); -void printslow(Context &context); -void dolook(Context &context); -void getxad(Context &context); -void getyad(Context &context); -void getmapad(Context &context); -void calcfrframe(Context &context); -void finalframe(Context &context); -void makesprite(Context &context); -void makebackob(Context &context); -void addalong(Context &context); -void addlength(Context &context); -void eraseoldobs(Context &context); -void calcmapad(Context &context); -void doblocks(Context &context); -void showallobs(Context &context); -void showallfree(Context &context); -void showallex(Context &context); -void paneltomap(Context &context); -void deleteexframe(Context &context); -void deleteextext(Context &context); -void deleteexobject(Context &context); -void purgeanitem(Context &context); -void getexpos(Context &context); -void transfermap(Context &context); -void transferinv(Context &context); -void transfertext(Context &context); -void transfercontoex(Context &context); -void emergencypurge(Context &context); -void pickupconts(Context &context); -void findopenpos(Context &context); -void reexfromopen(Context &context); -void geteitherad(Context &context); -void fillopen(Context &context); -void useopened(Context &context); -void getopenedsize(Context &context); -void errormessage3(Context &context); -void errormessage2(Context &context); -void examicon(Context &context); -void outofopen(Context &context); -void swapwithopen(Context &context); -void isitworn(Context &context); -void wornerror(Context &context); -void errormessage1(Context &context); -void checkobjectsize(Context &context); -void openinv(Context &context); -void openob(Context &context); -void droperror(Context &context); -void cantdrop(Context &context); -void reexfrominv(Context &context); -void intoinv(Context &context); -void outofinv(Context &context); -void swapwithinv(Context &context); -void makemainscreen(Context &context); -void searchforsame(Context &context); -void lookatcard(Context &context); -void obsthatdothings(Context &context); -void additionaltext(Context &context); -void findallopen(Context &context); -void obtoinv(Context &context); -void findallryan(Context &context); -void showryanpage(Context &context); -void kernchars(Context &context); -void getnextword(Context &context); -void getnumber(Context &context); -void lockmon(Context &context); -void printboth(Context &context); -void waitframes(Context &context); -void hangone(Context &context); -void allpalette(Context &context); -void fadescreenups(Context &context); -void afterintroroom(Context &context); -void usetimedtext(Context &context); -void loadintroroom(Context &context); -void runintroseq(Context &context); -void realcredits(Context &context); -void runendseq(Context &context); -void showmonk(Context &context); -void monkspeaking(Context &context); -void gettingshot(Context &context); -void biblequote(Context &context); -void intro(Context &context); -void paltostartpal(Context &context); -void paltoendpal(Context &context); -void dumpcurrent(Context &context); -void rollem(Context &context); -void greyscalesum(Context &context); -void endpaltostart(Context &context); -void clearendpal(Context &context); -void rollendcredits2(Context &context); -void clearstartpal(Context &context); -void fadecalculation(Context &context); -void frameoutfx(Context &context); -void frameoutbh(Context &context); -void frameoutv(Context &context); -void putunderzoom(Context &context); -void crosshair(Context &context); -void maptopanel(Context &context); -void movemap(Context &context); -void dealwithspecial(Context &context); -void showreelframe(Context &context); -void soundonreels(Context &context); -void reconstruct(Context &context); -void updatepeople(Context &context); -void watchreel(Context &context); -void showrain(Context &context); -void dodoor(Context &context); -void liftnoise(Context &context); -void widedoor(Context &context); -void random(Context &context); -void lockeddoorway(Context &context); -void liftsprite(Context &context); -void doorway(Context &context); -void constant(Context &context); -void steady(Context &context); -void getblockofpixel(Context &context); -void splitintolines(Context &context); -void adjustleft(Context &context); -void adjustright(Context &context); -void adjustdown(Context &context); -void adjustup(Context &context); -void aboutturn(Context &context); -void checkforexit(Context &context); -void walking(Context &context); -void printasprite(Context &context); -void showgamereel(Context &context); -void checkspeed(Context &context); -void addtopeoplelist(Context &context); -void setuptimedtemp(Context &context); -void madmantext(Context &context); -void madmode(Context &context); -void priesttext(Context &context); -void fadescreenuphalf(Context &context); -void textforend(Context &context); -void fadescreendownhalf(Context &context); -void rollendcredits(Context &context); -void textformonk(Context &context); -void monks2text(Context &context); -void intro2text(Context &context); -void intro3text(Context &context); -void intro1text(Context &context); - -void alleybarksound(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._dec(context.ax); - context._cmp(context.ax, 0); - if (!context.flags.z()) +void DreamGenContext::alleybarksound() { + STACK_CHECK; + ax = es.word(bx+3); + _dec(ax); + _cmp(ax, 0); + if (!flags.z()) goto nobark; - context.push(context.bx); - context.push(context.es); - context.al = 14; - playchannel1(context); - context.es = context.pop(); - context.bx = context.pop(); - context.ax = 1000; + push(bx); + push(es); + al = 14; + playchannel1(); + es = pop(); + bx = pop(); + ax = 1000; nobark: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; } -void intromusic(Context &context) { - STACK_CHECK(context); +void DreamGenContext::intromusic() { + STACK_CHECK; } -void foghornsound(Context &context) { - STACK_CHECK(context); - randomnumber(context); - context._cmp(context.al, 198); - if (!context.flags.z()) +void DreamGenContext::foghornsound() { + STACK_CHECK; + randomnumber(); + _cmp(al, 198); + if (!flags.z()) return /* (nofog) */; - context.al = 13; - playchannel1(context); + al = 13; + playchannel1(); } -void receptionist(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::receptionist() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto gotrecep; - context._cmp(context.data.byte(kCardpassflag), 1); - if (!context.flags.z()) + _cmp(data.byte(kCardpassflag), 1); + if (!flags.z()) goto notsetcard; - context._inc(context.data.byte(kCardpassflag)); - context.es.byte(context.bx+7) = 1; - context.es.word(context.bx+3) = 64; + _inc(data.byte(kCardpassflag)); + es.byte(bx+7) = 1; + es.word(bx+3) = 64; notsetcard: - context._cmp(context.es.word(context.bx+3), 58); - if (!context.flags.z()) + _cmp(es.word(bx+3), 58); + if (!flags.z()) goto notdes1; - randomnumber(context); - context._cmp(context.al, 30); - if (context.flags.c()) + randomnumber(); + _cmp(al, 30); + if (flags.c()) goto notdes2; - context.es.word(context.bx+3) = 55; + es.word(bx+3) = 55; goto gotrecep; notdes1: - context._cmp(context.es.word(context.bx+3), 60); - if (!context.flags.z()) + _cmp(es.word(bx+3), 60); + if (!flags.z()) goto notdes2; - randomnumber(context); - context._cmp(context.al, 240); - if (context.flags.c()) + randomnumber(); + _cmp(al, 240); + if (flags.c()) goto gotrecep; - context.es.word(context.bx+3) = 53; + es.word(bx+3) = 53; goto gotrecep; notdes2: - context._cmp(context.es.word(context.bx+3), 88); - if (!context.flags.z()) + _cmp(es.word(bx+3), 88); + if (!flags.z()) goto notendcard; - context.es.word(context.bx+3) = 53; + es.word(bx+3) = 53; goto gotrecep; notendcard: - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); gotrecep: - showgamereel(context); - addtopeoplelist(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 128); - if (context.flags.z()) + showgamereel(); + addtopeoplelist(); + al = es.byte(bx+7); + _and(al, 128); + if (flags.z()) return /* (nottalkedrecep) */; - context.data.byte(kTalkedtorecep) = 1; + data.byte(kTalkedtorecep) = 1; } -void smokebloke(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRockstardead), 0); - if (!context.flags.z()) +void DreamGenContext::smokebloke() { + STACK_CHECK; + _cmp(data.byte(kRockstardead), 0); + if (!flags.z()) goto notspokento; - context.al = context.es.byte(context.bx+7); - context._and(context.al, 128); - if (context.flags.z()) + al = es.byte(bx+7); + _and(al, 128); + if (flags.z()) goto notspokento; - context.push(context.es); - context.push(context.bx); - context.al = 5; - setlocation(context); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + al = 5; + setlocation(); + bx = pop(); + es = pop(); notspokento: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto gotsmokeb; - context._cmp(context.es.word(context.bx+3), 100); - if (!context.flags.z()) + _cmp(es.word(bx+3), 100); + if (!flags.z()) goto notsmokeb1; - randomnumber(context); - context._cmp(context.al, 30); - if (context.flags.c()) + randomnumber(); + _cmp(al, 30); + if (flags.c()) goto notsmokeb2; - context.es.word(context.bx+3) = 96; + es.word(bx+3) = 96; goto gotsmokeb; notsmokeb1: - context._cmp(context.es.word(context.bx+3), 117); - if (!context.flags.z()) + _cmp(es.word(bx+3), 117); + if (!flags.z()) goto notsmokeb2; - context.es.word(context.bx+3) = 96; + es.word(bx+3) = 96; goto gotsmokeb; notsmokeb2: - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); gotsmokeb: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void attendant(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 128); - if (context.flags.z()) +void DreamGenContext::attendant() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); + al = es.byte(bx+7); + _and(al, 128); + if (flags.z()) return /* (nottalked) */; - context.data.byte(kTalkedtoattendant) = 1; + data.byte(kTalkedtoattendant) = 1; } -void manasleep(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 127); - context.es.byte(context.bx+7) = context.al; - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::manasleep() { + STACK_CHECK; + al = es.byte(bx+7); + _and(al, 127); + es.byte(bx+7) = al; + showgamereel(); + addtopeoplelist(); } -void eden(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kGeneraldead), 0); - if (!context.flags.z()) +void DreamGenContext::eden() { + STACK_CHECK; + _cmp(data.byte(kGeneraldead), 0); + if (!flags.z()) return /* (notinbed) */; - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void edeninbath(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kGeneraldead), 0); - if (context.flags.z()) +void DreamGenContext::edeninbath() { + STACK_CHECK; + _cmp(data.byte(kGeneraldead), 0); + if (flags.z()) return /* (notinbath) */; - context._cmp(context.data.byte(kSartaindead), 0); - if (!context.flags.z()) + _cmp(data.byte(kSartaindead), 0); + if (!flags.z()) return /* (notinbath) */; - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void malefan(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::malefan() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void femalefan(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::femalefan() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void louis(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRockstardead), 0); - if (!context.flags.z()) +void DreamGenContext::louis() { + STACK_CHECK; + _cmp(data.byte(kRockstardead), 0); + if (!flags.z()) return /* (notlouis1) */; - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void louischair(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRockstardead), 0); - if (context.flags.z()) +void DreamGenContext::louischair() { + STACK_CHECK; + _cmp(data.byte(kRockstardead), 0); + if (flags.z()) return /* (notlouis2) */; - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto notlouisanim; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 191); - if (context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 191); + if (flags.z()) goto restartlouis; - context._cmp(context.ax, 185); - if (context.flags.z()) + _cmp(ax, 185); + if (flags.z()) goto randomlouis; - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; goto notlouisanim; randomlouis: - context.es.word(context.bx+3) = context.ax; - randomnumber(context); - context._cmp(context.al, 245); - if (!context.flags.c()) + es.word(bx+3) = ax; + randomnumber(); + _cmp(al, 245); + if (!flags.c()) goto notlouisanim; restartlouis: - context.ax = 182; - context.es.word(context.bx+3) = context.ax; + ax = 182; + es.word(bx+3) = ax; notlouisanim: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void manasleep2(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 127); - context.es.byte(context.bx+7) = context.al; - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::manasleep2() { + STACK_CHECK; + al = es.byte(bx+7); + _and(al, 127); + es.byte(bx+7) = al; + showgamereel(); + addtopeoplelist(); } -void mansatstill(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::mansatstill() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void tattooman(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::tattooman() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void drinker(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::drinker() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto gotdrinker; - context._inc(context.es.word(context.bx+3)); - context._cmp(context.es.word(context.bx+3), 115); - if (!context.flags.z()) + _inc(es.word(bx+3)); + _cmp(es.word(bx+3), 115); + if (!flags.z()) goto notdrinker1; - context.es.word(context.bx+3) = 105; + es.word(bx+3) = 105; goto gotdrinker; notdrinker1: - context._cmp(context.es.word(context.bx+3), 106); - if (!context.flags.z()) + _cmp(es.word(bx+3), 106); + if (!flags.z()) goto gotdrinker; - randomnumber(context); - context._cmp(context.al, 3); - if (context.flags.c()) + randomnumber(); + _cmp(al, 3); + if (flags.c()) goto gotdrinker; - context.es.word(context.bx+3) = 105; + es.word(bx+3) = 105; gotdrinker: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void bartender(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::bartender() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto gotsmoket; - context._cmp(context.es.word(context.bx+3), 86); - if (!context.flags.z()) + _cmp(es.word(bx+3), 86); + if (!flags.z()) goto notsmoket1; - randomnumber(context); - context._cmp(context.al, 18); - if (context.flags.c()) + randomnumber(); + _cmp(al, 18); + if (flags.c()) goto notsmoket2; - context.es.word(context.bx+3) = 81; + es.word(bx+3) = 81; goto gotsmoket; notsmoket1: - context._cmp(context.es.word(context.bx+3), 103); - if (!context.flags.z()) + _cmp(es.word(bx+3), 103); + if (!flags.z()) goto notsmoket2; - context.es.word(context.bx+3) = 81; + es.word(bx+3) = 81; goto gotsmoket; notsmoket2: - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); gotsmoket: - showgamereel(context); - context._cmp(context.data.byte(kGunpassflag), 1); - if (!context.flags.z()) + showgamereel(); + _cmp(data.byte(kGunpassflag), 1); + if (!flags.z()) goto notgotgun; - context.es.byte(context.bx+7) = 9; + es.byte(bx+7) = 9; notgotgun: - addtopeoplelist(context); + addtopeoplelist(); } -void othersmoker(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::othersmoker() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void barwoman(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); +void DreamGenContext::barwoman() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); } -void interviewer(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kReeltowatch), 68); - if (!context.flags.z()) +void DreamGenContext::interviewer() { + STACK_CHECK; + _cmp(data.word(kReeltowatch), 68); + if (!flags.z()) goto notgeneralstart; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); notgeneralstart: - context._cmp(context.es.word(context.bx+3), 250); - if (context.flags.z()) + _cmp(es.word(bx+3), 250); + if (flags.z()) goto talking; - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto talking; - context._cmp(context.es.word(context.bx+3), 259); - if (context.flags.z()) + _cmp(es.word(bx+3), 259); + if (flags.z()) goto talking; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); talking: - showgamereel(context); + showgamereel(); } -void soldier1(Context &context) { - STACK_CHECK(context); - context._cmp(context.es.word(context.bx+3), 0); - if (context.flags.z()) +void DreamGenContext::soldier1() { + STACK_CHECK; + _cmp(es.word(bx+3), 0); + if (flags.z()) goto soldierwait; - context.data.word(kWatchingtime) = 10; - context._cmp(context.es.word(context.bx+3), 30); - if (!context.flags.z()) + data.word(kWatchingtime) = 10; + _cmp(es.word(bx+3), 30); + if (!flags.z()) goto notaftersshot; - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 40); + if (!flags.z()) goto gotsoldframe; - context.data.byte(kMandead) = 2; + data.byte(kMandead) = 2; goto gotsoldframe; notaftersshot: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto gotsoldframe; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); goto gotsoldframe; soldierwait: - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto gotsoldframe; - context.data.word(kWatchingtime) = 10; - context._cmp(context.data.byte(kManspath), 2); - if (!context.flags.z()) + data.word(kWatchingtime) = 10; + _cmp(data.byte(kManspath), 2); + if (!flags.z()) goto gotsoldframe; - context._cmp(context.data.byte(kFacing), 4); - if (!context.flags.z()) + _cmp(data.byte(kFacing), 4); + if (!flags.z()) goto gotsoldframe; - context._inc(context.es.word(context.bx+3)); - context.data.byte(kLastweapon) = -1; - context.data.byte(kCombatcount) = 0; + _inc(es.word(bx+3)); + data.byte(kLastweapon) = -1; + data.byte(kCombatcount) = 0; gotsoldframe: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void rockstar(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 303); - if (context.flags.z()) +void DreamGenContext::rockstar() { + STACK_CHECK; + ax = es.word(bx+3); + _cmp(ax, 303); + if (flags.z()) goto rockcombatend; - context._cmp(context.ax, 118); - if (context.flags.z()) + _cmp(ax, 118); + if (flags.z()) goto rockcombatend; - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto rockspeed; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 118); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 118); + if (!flags.z()) goto notbeforedead; - context.data.byte(kMandead) = 2; + data.byte(kMandead) = 2; goto gotrockframe; notbeforedead: - context._cmp(context.ax, 79); - if (!context.flags.z()) + _cmp(ax, 79); + if (!flags.z()) goto gotrockframe; - context._dec(context.ax); - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _dec(ax); + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto notgunonrock; - context.data.byte(kLastweapon) = -1; - context.ax = 123; + data.byte(kLastweapon) = -1; + ax = 123; goto gotrockframe; notgunonrock: - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 40); + if (!flags.z()) goto gotrockframe; - context.data.byte(kCombatcount) = 0; - context.ax = 79; + data.byte(kCombatcount) = 0; + ax = 79; gotrockframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; rockspeed: - showgamereel(context); - context._cmp(context.es.word(context.bx+3), 78); - if (!context.flags.z()) + showgamereel(); + _cmp(es.word(bx+3), 78); + if (!flags.z()) goto notalkrock; - addtopeoplelist(context); - context.data.byte(kPointermode) = 2; - context.data.word(kWatchingtime) = 0; + addtopeoplelist(); + data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; return; notalkrock: - context.data.word(kWatchingtime) = 2; - context.data.byte(kPointermode) = 0; - context.al = context.data.byte(kMapy); - context.es.byte(context.bx+2) = context.al; + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + al = data.byte(kMapy); + es.byte(bx+2) = al; return; rockcombatend: - context.data.byte(kNewlocation) = 45; - showgamereel(context); + data.byte(kNewlocation) = 45; + showgamereel(); } -void helicopter(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 203); - if (context.flags.z()) +void DreamGenContext::helicopter() { + STACK_CHECK; + ax = es.word(bx+3); + _cmp(ax, 203); + if (flags.z()) goto heliwon; - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto helispeed; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 53); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 53); + if (!flags.z()) goto notbeforehdead; - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 8); - if (context.flags.c()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 8); + if (flags.c()) goto waitabit; - context.data.byte(kMandead) = 2; + data.byte(kMandead) = 2; waitabit: - context.ax = 49; + ax = 49; goto gotheliframe; notbeforehdead: - context._cmp(context.ax, 9); - if (!context.flags.z()) + _cmp(ax, 9); + if (!flags.z()) goto gotheliframe; - context._dec(context.ax); - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _dec(ax); + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto notgunonheli; - context.data.byte(kLastweapon) = -1; - context.ax = 55; + data.byte(kLastweapon) = -1; + ax = 55; goto gotheliframe; notgunonheli: - context.ax = 5; - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 20); - if (!context.flags.z()) + ax = 5; + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 20); + if (!flags.z()) goto gotheliframe; - context.data.byte(kCombatcount) = 0; - context.ax = 9; + data.byte(kCombatcount) = 0; + ax = 9; gotheliframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; helispeed: - showgamereel(context); - context.al = context.data.byte(kMapx); - context.es.byte(context.bx+1) = context.al; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 9); - if (!context.flags.c()) + showgamereel(); + al = data.byte(kMapx); + es.byte(bx+1) = al; + ax = es.word(bx+3); + _cmp(ax, 9); + if (!flags.c()) goto notwaitingheli; - context._cmp(context.data.byte(kCombatcount), 7); - if (context.flags.c()) + _cmp(data.byte(kCombatcount), 7); + if (flags.c()) goto notwaitingheli; - context.data.byte(kPointermode) = 2; - context.data.word(kWatchingtime) = 0; + data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; return; notwaitingheli: - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 2; return; heliwon: - context.data.byte(kPointermode) = 0; + data.byte(kPointermode) = 0; } -void mugger(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 138); - if (context.flags.z()) +void DreamGenContext::mugger() { + STACK_CHECK; + ax = es.word(bx+3); + _cmp(ax, 138); + if (flags.z()) goto endmugger1; - context._cmp(context.ax, 176); - if (context.flags.z()) + _cmp(ax, 176); + if (flags.z()) return /* (endmugger2) */; - context._cmp(context.ax, 2); - if (!context.flags.z()) + _cmp(ax, 2); + if (!flags.z()) goto havesetwatch; - context.data.word(kWatchingtime) = 175*2; + data.word(kWatchingtime) = 175*2; havesetwatch: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto notmugger; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); notmugger: - showgamereel(context); - context.al = context.data.byte(kMapx); - context.es.byte(context.bx+1) = context.al; + showgamereel(); + al = data.byte(kMapx); + es.byte(bx+1) = al; return; endmugger1: - context.push(context.es); - context.push(context.bx); - createpanel2(context); - showicon(context); - context.al = 41; - findpuztext(context); - context.di = 33+20; - context.bx = 104; - context.dl = 241; - context.ah = 0; - printdirect(context); - worktoscreen(context); - context.cx = 300; - hangon(context); - context.bx = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.bx); - context.es.word(context.bx+3) = 140; - context.data.byte(kManspath) = 2; - context.data.byte(kFinaldest) = 2; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - context.al = 'W'; - context.ah = 'E'; - context.cl = 'T'; - context.ch = 'A'; - findexobject(context); - context.data.byte(kCommand) = context.al; - context.data.byte(kObjecttype) = 4; - removeobfrominv(context); - context.al = 'W'; - context.ah = 'E'; - context.cl = 'T'; - context.ch = 'B'; - findexobject(context); - context.data.byte(kCommand) = context.al; - context.data.byte(kObjecttype) = 4; - removeobfrominv(context); - makemainscreen(context); - context.al = 48; - context.bl = 68-32; - context.bh = 54+64; - context.cx = 70; - context.dx = 10; - setuptimeduse(context); - context.data.byte(kBeenmugged) = 1; - context.bx = context.pop(); - context.es = context.pop(); -} - -void aide(Context &context) { - STACK_CHECK(context); - showgamereel(context); - addtopeoplelist(context); -} - -void businessman(Context &context) { - STACK_CHECK(context); - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 2; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 2); - if (!context.flags.z()) + push(es); + push(bx); + createpanel2(); + showicon(); + al = 41; + findpuztext(); + di = 33+20; + bx = 104; + dl = 241; + ah = 0; + printdirect(); + worktoscreen(); + cx = 300; + hangon(); + bx = pop(); + es = pop(); + push(es); + push(bx); + es.word(bx+3) = 140; + data.byte(kManspath) = 2; + data.byte(kFinaldest) = 2; + findxyfrompath(); + data.byte(kResetmanxy) = 1; + al = 'W'; + ah = 'E'; + cl = 'T'; + ch = 'A'; + findexobject(); + data.byte(kCommand) = al; + data.byte(kObjecttype) = 4; + removeobfrominv(); + al = 'W'; + ah = 'E'; + cl = 'T'; + ch = 'B'; + findexobject(); + data.byte(kCommand) = al; + data.byte(kObjecttype) = 4; + removeobfrominv(); + makemainscreen(); + al = 48; + bl = 68-32; + bh = 54+64; + cx = 70; + dx = 10; + setuptimeduse(); + data.byte(kBeenmugged) = 1; + bx = pop(); + es = pop(); +} + +void DreamGenContext::aide() { + STACK_CHECK; + showgamereel(); + addtopeoplelist(); +} + +void DreamGenContext::businessman() { + STACK_CHECK; + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 2; + ax = es.word(bx+3); + _cmp(ax, 2); + if (!flags.z()) goto notfirstbiz; - context.push(context.ax); - context.push(context.bx); - context.push(context.es); - context.al = 49; - context.cx = 30; - context.dx = 1; - context.bl = 68; - context.bh = 174; - setuptimeduse(context); - context.es = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); + push(ax); + push(bx); + push(es); + al = 49; + cx = 30; + dx = 1; + bl = 68; + bh = 174; + setuptimeduse(); + es = pop(); + bx = pop(); + ax = pop(); notfirstbiz: - context._cmp(context.ax, 95); - if (context.flags.z()) + _cmp(ax, 95); + if (flags.z()) goto buscombatwonend; - context._cmp(context.ax, 49); - if (context.flags.z()) + _cmp(ax, 49); + if (flags.z()) return /* (buscombatend) */; - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto busspeed; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 48); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 48); + if (!flags.z()) goto notbeforedeadb; - context.data.byte(kMandead) = 2; + data.byte(kMandead) = 2; goto gotbusframe; notbeforedeadb: - context._cmp(context.ax, 15); - if (!context.flags.z()) + _cmp(ax, 15); + if (!flags.z()) goto buscombatwon; - context._dec(context.ax); - context._cmp(context.data.byte(kLastweapon), 3); - if (!context.flags.z()) + _dec(ax); + _cmp(data.byte(kLastweapon), 3); + if (!flags.z()) goto notshieldonbus; - context.data.byte(kLastweapon) = -1; - context.data.byte(kCombatcount) = 0; - context.ax = 51; + data.byte(kLastweapon) = -1; + data.byte(kCombatcount) = 0; + ax = 51; goto gotbusframe; notshieldonbus: - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 20); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 20); + if (!flags.z()) goto gotbusframe; - context.data.byte(kCombatcount) = 0; - context.ax = 15; + data.byte(kCombatcount) = 0; + ax = 15; goto gotbusframe; buscombatwon: - context._cmp(context.ax, 91); - if (!context.flags.z()) + _cmp(ax, 91); + if (!flags.z()) goto gotbusframe; - context.push(context.bx); - context.push(context.es); - context.al = 0; - turnpathon(context); - context.al = 1; - turnpathon(context); - context.al = 2; - turnpathon(context); - context.al = 3; - turnpathoff(context); - context.data.byte(kManspath) = 5; - context.data.byte(kFinaldest) = 5; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - context.es = context.pop(); - context.bx = context.pop(); - context.ax = 92; + push(bx); + push(es); + al = 0; + turnpathon(); + al = 1; + turnpathon(); + al = 2; + turnpathon(); + al = 3; + turnpathoff(); + data.byte(kManspath) = 5; + data.byte(kFinaldest) = 5; + findxyfrompath(); + data.byte(kResetmanxy) = 1; + es = pop(); + bx = pop(); + ax = 92; goto gotbusframe; gotbusframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; busspeed: - showgamereel(context); - context.al = context.data.byte(kMapy); - context.es.byte(context.bx+2) = context.al; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 14); - if (!context.flags.z()) + showgamereel(); + al = data.byte(kMapy); + es.byte(bx+2) = al; + ax = es.word(bx+3); + _cmp(ax, 14); + if (!flags.z()) return /* (buscombatend) */; - context.data.word(kWatchingtime) = 0; - context.data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; + data.byte(kPointermode) = 2; return; buscombatwonend: - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 0; + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 0; } -void poolguard(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 214); - if (context.flags.z()) +void DreamGenContext::poolguard() { + STACK_CHECK; + ax = es.word(bx+3); + _cmp(ax, 214); + if (flags.z()) goto combatover2; - context._cmp(context.ax, 258); - if (context.flags.z()) + _cmp(ax, 258); + if (flags.z()) goto combatover2; - context._cmp(context.ax, 185); - if (context.flags.z()) + _cmp(ax, 185); + if (flags.z()) goto combatover1; - context._cmp(context.ax, 0); - if (!context.flags.z()) + _cmp(ax, 0); + if (!flags.z()) goto notfirstpool; - context.al = 0; - turnpathon(context); + al = 0; + turnpathon(); notfirstpool: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto guardspeed; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 122); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 122); + if (!flags.z()) goto notendguard1; - context._dec(context.ax); - context._cmp(context.data.byte(kLastweapon), 2); - if (!context.flags.z()) + _dec(ax); + _cmp(data.byte(kLastweapon), 2); + if (!flags.z()) goto notaxeonpool; - context.data.byte(kLastweapon) = -1; - context.ax = 122; + data.byte(kLastweapon) = -1; + ax = 122; goto gotguardframe; notaxeonpool: - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 40); + if (!flags.z()) goto gotguardframe; - context.data.byte(kCombatcount) = 0; - context.ax = 195; + data.byte(kCombatcount) = 0; + ax = 195; goto gotguardframe; notendguard1: - context._cmp(context.ax, 147); - if (!context.flags.z()) + _cmp(ax, 147); + if (!flags.z()) goto gotguardframe; - context._dec(context.ax); - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _dec(ax); + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto notgunonpool; - context.data.byte(kLastweapon) = -1; - context.ax = 147; + data.byte(kLastweapon) = -1; + ax = 147; goto gotguardframe; notgunonpool: - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 40); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 40); + if (!flags.z()) goto gotguardframe; - context.data.byte(kCombatcount) = 0; - context.ax = 220; + data.byte(kCombatcount) = 0; + ax = 220; gotguardframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; guardspeed: - showgamereel(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 121); - if (context.flags.z()) + showgamereel(); + ax = es.word(bx+3); + _cmp(ax, 121); + if (flags.z()) goto iswaitingpool; - context._cmp(context.ax, 146); - if (context.flags.z()) + _cmp(ax, 146); + if (flags.z()) goto iswaitingpool; - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 2; return; iswaitingpool: - context.data.byte(kPointermode) = 2; - context.data.word(kWatchingtime) = 0; + data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; return; combatover1: - context.data.word(kWatchingtime) = 0; - context.data.byte(kPointermode) = 0; - context.al = 0; - turnpathon(context); - context.al = 1; - turnpathoff(context); + data.word(kWatchingtime) = 0; + data.byte(kPointermode) = 0; + al = 0; + turnpathon(); + al = 1; + turnpathoff(); return; combatover2: - showgamereel(context); - context.data.word(kWatchingtime) = 2; - context.data.byte(kPointermode) = 0; - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 100); - if (context.flags.c()) + showgamereel(); + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 100); + if (flags.c()) return /* (doneover2) */; - context.data.word(kWatchingtime) = 0; - context.data.byte(kMandead) = 2; + data.word(kWatchingtime) = 0; + data.byte(kMandead) = 2; } -void security(Context &context) { - STACK_CHECK(context); - context._cmp(context.es.word(context.bx+3), 32); - if (context.flags.z()) +void DreamGenContext::security() { + STACK_CHECK; + _cmp(es.word(bx+3), 32); + if (flags.z()) goto securwait; - context._cmp(context.es.word(context.bx+3), 69); - if (!context.flags.z()) + _cmp(es.word(bx+3), 69); + if (!flags.z()) goto notaftersec; return; notaftersec: - context.data.word(kWatchingtime) = 10; - checkspeed(context); - if (!context.flags.z()) + data.word(kWatchingtime) = 10; + checkspeed(); + if (!flags.z()) goto gotsecurframe; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); goto gotsecurframe; securwait: - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto gotsecurframe; - context.data.word(kWatchingtime) = 10; - context._cmp(context.data.byte(kManspath), 9); - if (!context.flags.z()) + data.word(kWatchingtime) = 10; + _cmp(data.byte(kManspath), 9); + if (!flags.z()) goto gotsecurframe; - context._cmp(context.data.byte(kFacing), 0); - if (!context.flags.z()) + _cmp(data.byte(kFacing), 0); + if (!flags.z()) goto gotsecurframe; - context.data.byte(kLastweapon) = -1; - context._inc(context.es.word(context.bx+3)); + data.byte(kLastweapon) = -1; + _inc(es.word(bx+3)); gotsecurframe: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void heavy(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 127); - context.es.byte(context.bx+7) = context.al; - context._cmp(context.es.word(context.bx+3), 43); - if (context.flags.z()) +void DreamGenContext::heavy() { + STACK_CHECK; + al = es.byte(bx+7); + _and(al, 127); + es.byte(bx+7) = al; + _cmp(es.word(bx+3), 43); + if (flags.z()) goto heavywait; - context.data.word(kWatchingtime) = 10; - context._cmp(context.es.word(context.bx+3), 70); - if (!context.flags.z()) + data.word(kWatchingtime) = 10; + _cmp(es.word(bx+3), 70); + if (!flags.z()) goto notafterhshot; - context._inc(context.data.byte(kCombatcount)); - context._cmp(context.data.byte(kCombatcount), 80); - if (!context.flags.z()) + _inc(data.byte(kCombatcount)); + _cmp(data.byte(kCombatcount), 80); + if (!flags.z()) goto gotheavyframe; - context.data.byte(kMandead) = 2; + data.byte(kMandead) = 2; goto gotheavyframe; notafterhshot: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto gotheavyframe; - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); goto gotheavyframe; heavywait: - context._cmp(context.data.byte(kLastweapon), 1); - if (!context.flags.z()) + _cmp(data.byte(kLastweapon), 1); + if (!flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(kManspath), 5); - if (!context.flags.z()) + _cmp(data.byte(kManspath), 5); + if (!flags.z()) goto gotheavyframe; - context._cmp(context.data.byte(kFacing), 4); - if (!context.flags.z()) + _cmp(data.byte(kFacing), 4); + if (!flags.z()) goto gotheavyframe; - context.data.byte(kLastweapon) = -1; - context._inc(context.es.word(context.bx+3)); - context.data.byte(kCombatcount) = 0; + data.byte(kLastweapon) = -1; + _inc(es.word(bx+3)); + data.byte(kCombatcount) = 0; gotheavyframe: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void bossman(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::bossman() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto notboss; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 4); - if (context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 4); + if (flags.z()) goto firstdes; - context._cmp(context.ax, 20); - if (context.flags.z()) + _cmp(ax, 20); + if (flags.z()) goto secdes; - context._cmp(context.ax, 41); - if (!context.flags.z()) + _cmp(ax, 41); + if (!flags.z()) goto gotallboss; - context.ax = 0; - context._inc(context.data.byte(kGunpassflag)); - context.es.byte(context.bx+7) = 10; + ax = 0; + _inc(data.byte(kGunpassflag)); + es.byte(bx+7) = 10; goto gotallboss; firstdes: - context._cmp(context.data.byte(kGunpassflag), 1); - if (context.flags.z()) + _cmp(data.byte(kGunpassflag), 1); + if (flags.z()) goto gotallboss; - context.push(context.ax); - randomnumber(context); - context.cl = context.al; - context.ax = context.pop(); - context._cmp(context.cl, 10); - if (context.flags.c()) + push(ax); + randomnumber(); + cl = al; + ax = pop(); + _cmp(cl, 10); + if (flags.c()) goto gotallboss; - context.ax = 0; + ax = 0; goto gotallboss; secdes: - context._cmp(context.data.byte(kGunpassflag), 1); - if (context.flags.z()) + _cmp(data.byte(kGunpassflag), 1); + if (flags.z()) goto gotallboss; - context.ax = 0; + ax = 0; gotallboss: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; notboss: - showgamereel(context); - addtopeoplelist(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 128); - if (context.flags.z()) + showgamereel(); + addtopeoplelist(); + al = es.byte(bx+7); + _and(al, 128); + if (flags.z()) return /* (nottalkedboss) */; - context.data.byte(kTalkedtoboss) = 1; + data.byte(kTalkedtoboss) = 1; } -void gamer(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::gamer() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto gamerfin; gameragain: - randomnum1(context); - context._and(context.al, 7); - context._cmp(context.al, 5); - if (!context.flags.c()) + randomnum1(); + _and(al, 7); + _cmp(al, 5); + if (!flags.c()) goto gameragain; - context._add(context.al, 20); - context._cmp(context.al, context.es.byte(context.bx+3)); - if (context.flags.z()) + _add(al, 20); + _cmp(al, es.byte(bx+3)); + if (flags.z()) goto gameragain; - context.ah = 0; - context.es.word(context.bx+3) = context.ax; + ah = 0; + es.word(bx+3) = ax; gamerfin: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void sparkydrip(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::sparkydrip() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) return /* (cantdrip) */; - context.al = 14; - context.ah = 0; - playchannel0(context); + al = 14; + ah = 0; + playchannel0(); } -void carparkdrip(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::carparkdrip() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) return /* (cantdrip2) */; - context.al = 14; - playchannel1(context); + al = 14; + playchannel1(); } -void keeper(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kKeeperflag), 0); - if (!context.flags.z()) +void DreamGenContext::keeper() { + STACK_CHECK; + _cmp(data.byte(kKeeperflag), 0); + if (!flags.z()) goto notwaiting; - context._cmp(context.data.word(kReeltowatch), 190); - if (context.flags.c()) + _cmp(data.word(kReeltowatch), 190); + if (flags.c()) return /* (waiting) */; - context._inc(context.data.byte(kKeeperflag)); - context.ah = context.es.byte(context.bx+7); - context._and(context.ah, 127); - context._cmp(context.ah, context.data.byte(kDreamnumber)); - if (context.flags.z()) + _inc(data.byte(kKeeperflag)); + ah = es.byte(bx+7); + _and(ah, 127); + _cmp(ah, data.byte(kDreamnumber)); + if (flags.z()) return /* (notdiff) */; - context.al = context.data.byte(kDreamnumber); - context.es.byte(context.bx+7) = context.al; + al = data.byte(kDreamnumber); + es.byte(bx+7) = al; return; notwaiting: - addtopeoplelist(context); - showgamereel(context); + addtopeoplelist(); + showgamereel(); } -void candles1(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::candles1() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto candle1; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 44); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 44); + if (!flags.z()) goto notendcandle1; - context.ax = 39; + ax = 39; notendcandle1: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; candle1: - showgamereel(context); + showgamereel(); } -void smallcandle(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::smallcandle() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto smallcandlef; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 37); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 37); + if (!flags.z()) goto notendsmallcandle; - context.ax = 25; + ax = 25; notendsmallcandle: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; smallcandlef: - showgamereel(context); + showgamereel(); } -void intromagic1(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::intromagic1() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto introm1fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 145); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 145); + if (!flags.z()) goto gotintrom1; - context.ax = 121; + ax = 121; gotintrom1: - context.es.word(context.bx+3) = context.ax; - context._cmp(context.ax, 121); - if (!context.flags.z()) + es.word(bx+3) = ax; + _cmp(ax, 121); + if (!flags.z()) goto introm1fin; - context._inc(context.data.byte(kIntrocount)); - context.push(context.es); - context.push(context.bx); - intro1text(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(kIntrocount), 8); - if (!context.flags.z()) + _inc(data.byte(kIntrocount)); + push(es); + push(bx); + intro1text(); + bx = pop(); + es = pop(); + _cmp(data.byte(kIntrocount), 8); + if (!flags.z()) goto introm1fin; - context._add(context.data.byte(kMapy), 10); - context.data.byte(kNowinnewroom) = 1; + _add(data.byte(kMapy), 10); + data.byte(kNowinnewroom) = 1; introm1fin: - showgamereel(context); + showgamereel(); } -void candles(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::candles() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto candlesfin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 167); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 167); + if (!flags.z()) goto gotcandles; - context.ax = 162; + ax = 162; gotcandles: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; candlesfin: - showgamereel(context); + showgamereel(); } -void candles2(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::candles2() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto candles2fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 238); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 238); + if (!flags.z()) goto gotcandles2; - context.ax = 233; + ax = 233; gotcandles2: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; candles2fin: - showgamereel(context); + showgamereel(); } -void gates(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::gates() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto gatesfin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 116); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 116); + if (!flags.z()) goto notbang; - context.push(context.ax); - context.push(context.bx); - context.push(context.es); - context.al = 17; - playchannel1(context); - context.es = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); + push(ax); + push(bx); + push(es); + al = 17; + playchannel1(); + es = pop(); + bx = pop(); + ax = pop(); notbang: - context._cmp(context.ax, 110); - if (context.flags.c()) + _cmp(ax, 110); + if (flags.c()) goto slowgates; - context.es.byte(context.bx+5) = 2; + es.byte(bx+5) = 2; slowgates: - context._cmp(context.ax, 120); - if (!context.flags.z()) + _cmp(ax, 120); + if (!flags.z()) goto gotgates; - context.data.byte(kGetback) = 1; - context.ax = 119; + data.byte(kGetback) = 1; + ax = 119; gotgates: - context.es.word(context.bx+3) = context.ax; - context.push(context.es); - context.push(context.bx); - intro3text(context); - context.bx = context.pop(); - context.es = context.pop(); + es.word(bx+3) = ax; + push(es); + push(bx); + intro3text(); + bx = pop(); + es = pop(); gatesfin: - showgamereel(context); + showgamereel(); } -void intromagic2(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::intromagic2() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto introm2fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 216); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 216); + if (!flags.z()) goto gotintrom2; - context.ax = 192; + ax = 192; gotintrom2: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; introm2fin: - showgamereel(context); + showgamereel(); } -void intromagic3(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::intromagic3() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto introm3fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 218); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 218); + if (!flags.z()) goto gotintrom3; - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; gotintrom3: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; introm3fin: - showgamereel(context); - context.al = context.data.byte(kMapx); - context.es.byte(context.bx+1) = context.al; + showgamereel(); + al = data.byte(kMapx); + es.byte(bx+1) = al; } -void intromonks1(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::intromonks1() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto intromonk1fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 80); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 80); + if (!flags.z()) goto notendmonk1; - context._add(context.data.byte(kMapy), 10); - context.data.byte(kNowinnewroom) = 1; - showgamereel(context); + _add(data.byte(kMapy), 10); + data.byte(kNowinnewroom) = 1; + showgamereel(); return; notendmonk1: - context._cmp(context.ax, 30); - if (!context.flags.z()) + _cmp(ax, 30); + if (!flags.z()) goto gotintromonk1; - context._sub(context.data.byte(kMapy), 10); - context.data.byte(kNowinnewroom) = 1; - context.ax = 51; + _sub(data.byte(kMapy), 10); + data.byte(kNowinnewroom) = 1; + ax = 51; gotintromonk1: - context.es.word(context.bx+3) = context.ax; - context._cmp(context.ax, 5); - if (context.flags.z()) + es.word(bx+3) = ax; + _cmp(ax, 5); + if (flags.z()) goto waitstep; - context._cmp(context.ax, 15); - if (context.flags.z()) + _cmp(ax, 15); + if (flags.z()) goto waitstep; - context._cmp(context.ax, 25); - if (context.flags.z()) + _cmp(ax, 25); + if (flags.z()) goto waitstep; - context._cmp(context.ax, 61); - if (context.flags.z()) + _cmp(ax, 61); + if (flags.z()) goto waitstep; - context._cmp(context.ax, 71); - if (context.flags.z()) + _cmp(ax, 71); + if (flags.z()) goto waitstep; goto intromonk1fin; waitstep: - context.push(context.es); - context.push(context.bx); - intro2text(context); - context.bx = context.pop(); - context.es = context.pop(); - context.es.byte(context.bx+6) = -20; + push(es); + push(bx); + intro2text(); + bx = pop(); + es = pop(); + es.byte(bx+6) = -20; intromonk1fin: - showgamereel(context); - context.al = context.data.byte(kMapy); - context.es.byte(context.bx+2) = context.al; + showgamereel(); + al = data.byte(kMapy); + es.byte(bx+2) = al; } -void intromonks2(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::intromonks2() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto intromonk2fin; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 87); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 87); + if (!flags.z()) goto nottalk1; - context._inc(context.data.byte(kIntrocount)); - context.push(context.es); - context.push(context.bx); - monks2text(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(kIntrocount), 19); - if (!context.flags.z()) + _inc(data.byte(kIntrocount)); + push(es); + push(bx); + monks2text(); + bx = pop(); + es = pop(); + _cmp(data.byte(kIntrocount), 19); + if (!flags.z()) goto notlasttalk1; - context.ax = 87; + ax = 87; goto gotintromonk2; notlasttalk1: - context.ax = 74; + ax = 74; goto gotintromonk2; nottalk1: - context._cmp(context.ax, 110); - if (!context.flags.z()) + _cmp(ax, 110); + if (!flags.z()) goto notraisearm; - context._inc(context.data.byte(kIntrocount)); - context.push(context.es); - context.push(context.bx); - monks2text(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(kIntrocount), 35); - if (!context.flags.z()) + _inc(data.byte(kIntrocount)); + push(es); + push(bx); + monks2text(); + bx = pop(); + es = pop(); + _cmp(data.byte(kIntrocount), 35); + if (!flags.z()) goto notlastraise; - context.ax = 111; + ax = 111; goto gotintromonk2; notlastraise: - context.ax = 98; + ax = 98; goto gotintromonk2; notraisearm: - context._cmp(context.ax, 176); - if (!context.flags.z()) + _cmp(ax, 176); + if (!flags.z()) goto notendmonk2; - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; goto gotintromonk2; notendmonk2: - context._cmp(context.ax, 125); - if (!context.flags.z()) + _cmp(ax, 125); + if (!flags.z()) goto gotintromonk2; - context.ax = 140; + ax = 140; gotintromonk2: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; intromonk2fin: - showgamereel(context); + showgamereel(); } -void handclap(Context &context) { - STACK_CHECK(context); +void DreamGenContext::handclap() { + STACK_CHECK; } -void monks2text(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kIntrocount), 1); - if (!context.flags.z()) +void DreamGenContext::monks2text() { + STACK_CHECK; + _cmp(data.byte(kIntrocount), 1); + if (!flags.z()) goto notmonk2text1; - context.al = 8; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 8; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text1: - context._cmp(context.data.byte(kIntrocount), 4); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 4); + if (!flags.z()) goto notmonk2text2; - context.al = 9; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 9; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text2: - context._cmp(context.data.byte(kIntrocount), 7); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 7); + if (!flags.z()) goto notmonk2text3; - context.al = 10; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 10; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text3: - context._cmp(context.data.byte(kIntrocount), 10); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 10); + if (!flags.z()) goto notmonk2text4; - context.data.byte(kIntrocount) = 12; - context.al = 11; - context.bl = 0; - context.bh = 105; - context.cx = 100; + data.byte(kIntrocount) = 12; + al = 11; + bl = 0; + bh = 105; + cx = 100; goto gotmonks2text; notmonk2text4: - context._cmp(context.data.byte(kIntrocount), 13); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 13); + if (!flags.z()) goto notmonk2text5; - context.data.byte(kIntrocount) = 17; + data.byte(kIntrocount) = 17; return; - context.al = 12; - context.bl = 0; - context.bh = 120; - context.cx = 100; + al = 12; + bl = 0; + bh = 120; + cx = 100; goto gotmonks2text; notmonk2text5: - context._cmp(context.data.byte(kIntrocount), 16); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 16); + if (!flags.z()) goto notmonk2text6; - context.al = 13; - context.bl = 0; - context.bh = 135; - context.cx = 100; + al = 13; + bl = 0; + bh = 135; + cx = 100; goto gotmonks2text; notmonk2text6: - context._cmp(context.data.byte(kIntrocount), 19); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 19); + if (!flags.z()) goto notmonk2text7; - context.al = 14; - context.bl = 36; - context.bh = 160; - context.cx = 100; - context.dx = 1; - context.ah = 82; - { setuptimedtemp(context); return; }; + al = 14; + bl = 36; + bh = 160; + cx = 100; + dx = 1; + ah = 82; + { setuptimedtemp(); return; }; notmonk2text7: - context._cmp(context.data.byte(kIntrocount), 22); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 22); + if (!flags.z()) goto notmonk2text8; - context.al = 15; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 15; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text8: - context._cmp(context.data.byte(kIntrocount), 25); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 25); + if (!flags.z()) goto notmonk2text9; - context.al = 16; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 16; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text9: - context._cmp(context.data.byte(kIntrocount), 27); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 27); + if (!flags.z()) goto notmonk2text10; - context.al = 17; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 17; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; notmonk2text10: - context._cmp(context.data.byte(kIntrocount), 31); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 31); + if (!flags.z()) return /* (notmonk2text11) */; - context.al = 18; - context.bl = 36; - context.bh = 160; - context.cx = 100; + al = 18; + bl = 36; + bh = 160; + cx = 100; goto gotmonks2text; return; gotmonks2text: - context.dx = 1; - context.cx = 120; - context.ah = 82; - setuptimedtemp(context); + dx = 1; + cx = 120; + ah = 82; + setuptimedtemp(); } -void intro1text(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kIntrocount), 2); - if (!context.flags.z()) +void DreamGenContext::intro1text() { + STACK_CHECK; + _cmp(data.byte(kIntrocount), 2); + if (!flags.z()) goto notintro1text1; - context.al = 40; - context.bl = 34; - context.bh = 130; - context.cx = 90; + al = 40; + bl = 34; + bh = 130; + cx = 90; goto gotintro1text; notintro1text1: - context._cmp(context.data.byte(kIntrocount), 4); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 4); + if (!flags.z()) goto notintro1text2; - context.al = 41; - context.bl = 34; - context.bh = 130; - context.cx = 90; + al = 41; + bl = 34; + bh = 130; + cx = 90; goto gotintro1text; notintro1text2: - context._cmp(context.data.byte(kIntrocount), 6); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 6); + if (!flags.z()) return /* (notintro1text3) */; - context.al = 42; - context.bl = 34; - context.bh = 130; - context.cx = 90; + al = 42; + bl = 34; + bh = 130; + cx = 90; goto gotintro1text; return; gotintro1text: - context.dx = 1; - context.ah = 82; - context._cmp(context.data.byte(kCh1playing), 255); - if (context.flags.z()) + dx = 1; + ah = 82; + _cmp(data.byte(kCh1playing), 255); + if (flags.z()) goto oktalk2; - context._dec(context.data.byte(kIntrocount)); + _dec(data.byte(kIntrocount)); return; oktalk2: - setuptimedtemp(context); + setuptimedtemp(); } -void intro2text(Context &context) { - STACK_CHECK(context); - context._cmp(context.ax, 5); - if (!context.flags.z()) +void DreamGenContext::intro2text() { + STACK_CHECK; + _cmp(ax, 5); + if (!flags.z()) goto notintro2text1; - context.al = 43; - context.bl = 34; - context.bh = 40; - context.cx = 90; + al = 43; + bl = 34; + bh = 40; + cx = 90; goto gotintro2text; notintro2text1: - context._cmp(context.ax, 15); - if (!context.flags.z()) + _cmp(ax, 15); + if (!flags.z()) return /* (notintro2text2) */; - context.al = 44; - context.bl = 34; - context.bh = 40; - context.cx = 90; + al = 44; + bl = 34; + bh = 40; + cx = 90; goto gotintro2text; return; gotintro2text: - context.dx = 1; - context.ah = 82; - setuptimedtemp(context); + dx = 1; + ah = 82; + setuptimedtemp(); } -void intro3text(Context &context) { - STACK_CHECK(context); - context._cmp(context.ax, 107); - if (!context.flags.z()) +void DreamGenContext::intro3text() { + STACK_CHECK; + _cmp(ax, 107); + if (!flags.z()) goto notintro3text1; - context.al = 45; - context.bl = 36; - context.bh = 56; - context.cx = 100; + al = 45; + bl = 36; + bh = 56; + cx = 100; goto gotintro3text; notintro3text1: - context._cmp(context.ax, 108); - if (!context.flags.z()) + _cmp(ax, 108); + if (!flags.z()) return /* (notintro3text2) */; - context.al = 46; - context.bl = 36; - context.bh = 56; - context.cx = 100; + al = 46; + bl = 36; + bh = 56; + cx = 100; goto gotintro3text; return; gotintro3text: - context.dx = 1; - context.ah = 82; - setuptimedtemp(context); + dx = 1; + ah = 82; + setuptimedtemp(); } -void monkandryan(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::monkandryan() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto notmonkryan; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 83); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 83); + if (!flags.z()) goto gotmonkryan; - context._inc(context.data.byte(kIntrocount)); - context.push(context.es); - context.push(context.bx); - textformonk(context); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = 77; - context._cmp(context.data.byte(kIntrocount), 57); - if (!context.flags.z()) + _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; - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; return; gotmonkryan: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; notmonkryan: - showgamereel(context); + showgamereel(); } -void endgameseq(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::endgameseq() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto notendseq; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 51); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 51); + if (!flags.z()) goto gotendseq; - context._cmp(context.data.byte(kIntrocount), 140); - if (context.flags.z()) + _cmp(data.byte(kIntrocount), 140); + if (flags.z()) goto gotendseq; - context._inc(context.data.byte(kIntrocount)); - context.push(context.es); - context.push(context.bx); - textforend(context); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = 50; + _inc(data.byte(kIntrocount)); + push(es); + push(bx); + textforend(); + bx = pop(); + es = pop(); + ax = 50; gotendseq: - context.es.word(context.bx+3) = context.ax; - context._cmp(context.ax, 134); - if (!context.flags.z()) + es.word(bx+3) = ax; + _cmp(ax, 134); + if (!flags.z()) goto notfadedown; - context.push(context.es); - context.push(context.bx); - context.push(context.ax); - fadescreendownhalf(context); - context.ax = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + push(ax); + fadescreendownhalf(); + ax = pop(); + bx = pop(); + es = pop(); goto notendseq; notfadedown: - context._cmp(context.ax, 324); - if (!context.flags.z()) + _cmp(ax, 324); + if (!flags.z()) goto notfadeend; - context.push(context.es); - context.push(context.bx); - context.push(context.ax); - fadescreendowns(context); - context.data.byte(kVolumeto) = 7; - context.data.byte(kVolumedirection) = 1; - context.ax = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + push(ax); + fadescreendowns(); + data.byte(kVolumeto) = 7; + data.byte(kVolumedirection) = 1; + ax = pop(); + bx = pop(); + es = pop(); notfadeend: - context._cmp(context.ax, 340); - if (!context.flags.z()) + _cmp(ax, 340); + if (!flags.z()) goto notendseq; - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; notendseq: - showgamereel(context); - context.al = context.data.byte(kMapy); - context.es.byte(context.bx+2) = context.al; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 145); - if (!context.flags.z()) + showgamereel(); + al = data.byte(kMapy); + es.byte(bx+2) = al; + ax = es.word(bx+3); + _cmp(ax, 145); + if (!flags.z()) return /* (notendcreds) */; - context.es.word(context.bx+3) = 146; - rollendcredits(context); -} - -void rollendcredits(Context &context) { - STACK_CHECK(context); - context.al = 16; - context.ah = 255; - playchannel0(context); - context.data.byte(kVolume) = 7; - context.data.byte(kVolumeto) = 0; - context.data.byte(kVolumedirection) = -1; - context.cl = 160; - context.ch = 160; - context.di = 75; - context.bx = 20; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiget(context); - context.es = context.data.word(kTextfile1); - context.si = 3*2; - context.ax = context.es.word(context.si); - context.si = context.ax; - context._add(context.si, (66*2)); - context.cx = 254; + 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: - context.push(context.cx); - context.bx = 10; - context.cx = context.data.word(kLinespacing); + push(cx); + bx = 10; + cx = data.word(kLinespacing); endcredits2: - context.push(context.cx); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 75; - context.bx = 20; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiput(context); - vsync(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.cx = 18; + 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: - context.push(context.cx); - context.di = 75; - context.dx = 161; - context.ax = 0; - printdirect(context); - context._add(context.bx, context.data.word(kLinespacing)); - context.cx = context.pop(); - if (--context.cx) + push(cx); + di = 75; + dx = 161; + ax = 0; + printdirect(); + _add(bx, data.word(kLinespacing)); + cx = pop(); + if (--cx) goto onelot; - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 75; - context.bx = 20; - multidump(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._dec(context.bx); - if (--context.cx) + 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; - context.cx = context.pop(); + cx = pop(); looknext: - context.al = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.al, ':'); - if (context.flags.z()) + al = es.byte(si); + _inc(si); + _cmp(al, ':'); + if (flags.z()) goto gotnext; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto gotnext; goto looknext; gotnext: - if (--context.cx) + if (--cx) goto endcredits1; - context.cx = 100; - hangon(context); - paneltomap(context); - fadescreenuphalf(context); + cx = 100; + hangon(); + paneltomap(); + fadescreenuphalf(); } -void priest(Context &context) { - STACK_CHECK(context); - context._cmp(context.es.word(context.bx+3), 8); - if (context.flags.z()) +void DreamGenContext::priest() { + STACK_CHECK; + _cmp(es.word(bx+3), 8); + if (flags.z()) return /* (priestspoken) */; - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 2; - checkspeed(context); - if (!context.flags.z()) + data.byte(kPointermode) = 0; + data.word(kWatchingtime) = 2; + checkspeed(); + if (!flags.z()) return /* (priestwait) */; - context._inc(context.es.word(context.bx+3)); - context.push(context.es); - context.push(context.bx); - priesttext(context); - context.bx = context.pop(); - context.es = context.pop(); -} - -void madmanstelly(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 307); - if (!context.flags.z()) + _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; - context.ax = 300; + ax = 300; notendtelly: - context.es.word(context.bx+3) = context.ax; - showgamereel(context); + es.word(bx+3) = ax; + showgamereel(); } -void madman(Context &context) { - STACK_CHECK(context); - context.data.word(kWatchingtime) = 2; - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::madman() { + STACK_CHECK; + data.word(kWatchingtime) = 2; + checkspeed(); + if (!flags.z()) goto nomadspeed; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 364); - if (!context.flags.c()) + ax = es.word(bx+3); + _cmp(ax, 364); + if (!flags.c()) goto ryansded; - context._cmp(context.ax, 10); - if (!context.flags.z()) + _cmp(ax, 10); + if (!flags.z()) goto notfirstmad; - context.push(context.es); - context.push(context.bx); - context.push(context.ax); - context.dx = 2247; - loadtemptext(context); - context.ax = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.data.byte(kCombatcount) = -1; - context.data.byte(kSpeechcount) = 0; + push(es); + push(bx); + push(ax); + dx = 2247; + loadtemptext(); + ax = pop(); + bx = pop(); + es = pop(); + data.byte(kCombatcount) = -1; + data.byte(kSpeechcount) = 0; notfirstmad: - context._inc(context.ax); - context._cmp(context.ax, 294); - if (context.flags.z()) + _inc(ax); + _cmp(ax, 294); + if (flags.z()) goto madmanspoken; - context._cmp(context.ax, 66); - if (!context.flags.z()) + _cmp(ax, 66); + if (!flags.z()) goto nomadspeak; - context._inc(context.data.byte(kCombatcount)); - context.push(context.es); - context.push(context.bx); - madmantext(context); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = 53; - context._cmp(context.data.byte(kCombatcount), 64); - if (context.flags.c()) + _inc(data.byte(kCombatcount)); + push(es); + push(bx); + madmantext(); + bx = pop(); + es = pop(); + ax = 53; + _cmp(data.byte(kCombatcount), 64); + if (flags.c()) goto nomadspeak; - context._cmp(context.data.byte(kCombatcount), 70); - if (context.flags.z()) + _cmp(data.byte(kCombatcount), 70); + if (flags.z()) goto killryan; - context._cmp(context.data.byte(kLastweapon), 8); - if (!context.flags.z()) + _cmp(data.byte(kLastweapon), 8); + if (!flags.z()) goto nomadspeak; - context.data.byte(kCombatcount) = 72; - context.data.byte(kLastweapon) = -1; - context.data.byte(kMadmanflag) = 1; - context.ax = 67; + data.byte(kCombatcount) = 72; + data.byte(kLastweapon) = -1; + data.byte(kMadmanflag) = 1; + ax = 67; goto nomadspeak; killryan: - context.ax = 310; + ax = 310; nomadspeak: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; nomadspeed: - showgamereel(context); - context.al = context.data.byte(kMapx); - context.es.byte(context.bx+1) = context.al; - madmode(context); + showgamereel(); + al = data.byte(kMapx); + es.byte(bx+1) = al; + madmode(); return; madmanspoken: - context._cmp(context.data.byte(kWongame), 1); - if (context.flags.z()) + _cmp(data.byte(kWongame), 1); + if (flags.z()) return /* (alreadywon) */; - context.data.byte(kWongame) = 1; - context.push(context.es); - context.push(context.bx); - getridoftemptext(context); - context.bx = context.pop(); - context.es = context.pop(); + data.byte(kWongame) = 1; + push(es); + push(bx); + getridoftemptext(); + bx = pop(); + es = pop(); return; ryansded: - context.data.byte(kMandead) = 2; - showgamereel(context); + data.byte(kMandead) = 2; + showgamereel(); } -void madmantext(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSpeechcount), 63); - if (!context.flags.c()) +void DreamGenContext::madmantext() { + STACK_CHECK; + _cmp(data.byte(kSpeechcount), 63); + if (!flags.c()) return /* (nomadtext) */; - context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) + _cmp(data.byte(kCh1playing), 255); + if (!flags.z()) return /* (nomadtext) */; - context.al = context.data.byte(kSpeechcount); - context._inc(context.data.byte(kSpeechcount)); - context._add(context.al, 47); - context.bl = 72; - context.bh = 80; - context.cx = 90; - context.dx = 1; - context.ah = 82; - setuptimedtemp(context); -} - -void madmode(Context &context) { - STACK_CHECK(context); - context.data.word(kWatchingtime) = 2; - context.data.byte(kPointermode) = 0; - context._cmp(context.data.byte(kCombatcount), 65); - if (context.flags.c()) + al = data.byte(kSpeechcount); + _inc(data.byte(kSpeechcount)); + _add(al, 47); + bl = 72; + bh = 80; + cx = 90; + dx = 1; + ah = 82; + setuptimedtemp(); +} + +void DreamGenContext::madmode() { + STACK_CHECK; + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + _cmp(data.byte(kCombatcount), 65); + if (flags.c()) return /* (iswatchmad) */; - context._cmp(context.data.byte(kCombatcount), 70); - if (!context.flags.c()) + _cmp(data.byte(kCombatcount), 70); + if (!flags.c()) return /* (iswatchmad) */; - context.data.byte(kPointermode) = 2; + data.byte(kPointermode) = 2; } -void priesttext(Context &context) { - STACK_CHECK(context); - context._cmp(context.es.word(context.bx+3), 2); - if (context.flags.c()) +void DreamGenContext::priesttext() { + STACK_CHECK; + _cmp(es.word(bx+3), 2); + if (flags.c()) return /* (nopriesttext) */; - context._cmp(context.es.word(context.bx+3), 7); - if (!context.flags.c()) + _cmp(es.word(bx+3), 7); + if (!flags.c()) return /* (nopriesttext) */; - context.al = context.es.byte(context.bx+3); - context._and(context.al, 1); - if (!context.flags.z()) + al = es.byte(bx+3); + _and(al, 1); + if (!flags.z()) return /* (nopriesttext) */; - context.al = context.es.byte(context.bx+3); - context._shr(context.al, 1); - context._add(context.al, 50); - context.bl = 72; - context.bh = 80; - context.cx = 54; - context.dx = 1; - setuptimeduse(context); -} - -void textforend(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kIntrocount), 20); - if (!context.flags.z()) + 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; - context.al = 0; - context.bl = 34; - context.bh = 20; - context.cx = 60; + al = 0; + bl = 34; + bh = 20; + cx = 60; goto gotendtext; notendtext1: - context._cmp(context.data.byte(kIntrocount), 50); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 50); + if (!flags.z()) goto notendtext2; - context.al = 1; - context.bl = 34; - context.bh = 20; - context.cx = 60; + al = 1; + bl = 34; + bh = 20; + cx = 60; goto gotendtext; notendtext2: - context._cmp(context.data.byte(kIntrocount), 85); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 85); + if (!flags.z()) return /* (notendtext3) */; - context.al = 2; - context.bl = 34; - context.bh = 20; - context.cx = 60; + al = 2; + bl = 34; + bh = 20; + cx = 60; goto gotendtext; return; gotendtext: - context.dx = 1; - context.ah = 83; - setuptimedtemp(context); + dx = 1; + ah = 83; + setuptimedtemp(); } -void textformonk(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kIntrocount), 1); - if (!context.flags.z()) +void DreamGenContext::textformonk() { + STACK_CHECK; + _cmp(data.byte(kIntrocount), 1); + if (!flags.z()) goto notmonktext1; - context.al = 19; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 19; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext1: - context._cmp(context.data.byte(kIntrocount), 5); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 5); + if (!flags.z()) goto notmonktext2; - context.al = 20; - context.bl = 68; - context.bh = 38; - context.cx = 120; + al = 20; + bl = 68; + bh = 38; + cx = 120; goto gotmonktext; notmonktext2: - context._cmp(context.data.byte(kIntrocount), 9); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 9); + if (!flags.z()) goto notmonktext3; - context.al = 21; - context.bl = 48; - context.bh = 154; - context.cx = 120; + al = 21; + bl = 48; + bh = 154; + cx = 120; goto gotmonktext; notmonktext3: - context._cmp(context.data.byte(kIntrocount), 13); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 13); + if (!flags.z()) goto notmonktext4; - context.al = 22; - context.bl = 68; - context.bh = 38; - context.cx = 120; + al = 22; + bl = 68; + bh = 38; + cx = 120; goto gotmonktext; notmonktext4: - context._cmp(context.data.byte(kIntrocount), 15); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 15); + if (!flags.z()) goto notmonktext5; - context.al = 23; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 23; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext5: - context._cmp(context.data.byte(kIntrocount), 21); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 21); + if (!flags.z()) goto notmonktext6; - context.al = 24; - context.bl = 68; - context.bh = 38; - context.cx = 120; + al = 24; + bl = 68; + bh = 38; + cx = 120; goto gotmonktext; notmonktext6: - context._cmp(context.data.byte(kIntrocount), 25); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 25); + if (!flags.z()) goto notmonktext7; - context.al = 25; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 25; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext7: - context._cmp(context.data.byte(kIntrocount), 29); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 29); + if (!flags.z()) goto notmonktext8; - context.al = 26; - context.bl = 68; - context.bh = 38; - context.cx = 120; + al = 26; + bl = 68; + bh = 38; + cx = 120; goto gotmonktext; notmonktext8: - context._cmp(context.data.byte(kIntrocount), 33); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 33); + if (!flags.z()) goto notmonktext9; - context.al = 27; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 27; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext9: - context._cmp(context.data.byte(kIntrocount), 37); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 37); + if (!flags.z()) goto notmonktext10; - context.al = 28; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 28; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext10: - context._cmp(context.data.byte(kIntrocount), 41); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 41); + if (!flags.z()) goto notmonktext11; - context.al = 29; - context.bl = 68; - context.bh = 38; - context.cx = 120; + al = 29; + bl = 68; + bh = 38; + cx = 120; goto gotmonktext; notmonktext11: - context._cmp(context.data.byte(kIntrocount), 45); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 45); + if (!flags.z()) goto notmonktext12; - context.al = 30; - context.bl = 68; - context.bh = 154; - context.cx = 120; + al = 30; + bl = 68; + bh = 154; + cx = 120; goto gotmonktext; notmonktext12: - context._cmp(context.data.byte(kIntrocount), 52); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 52); + if (!flags.z()) goto notmonktext13; - context.al = 31; - context.bl = 68; - context.bh = 154; - context.cx = 220; + al = 31; + bl = 68; + bh = 154; + cx = 220; goto gotmonktext; notmonktext13: - context._cmp(context.data.byte(kIntrocount), 53); - if (!context.flags.z()) + _cmp(data.byte(kIntrocount), 53); + if (!flags.z()) return /* (notendtitles) */; - fadescreendowns(context); - context.data.byte(kVolumeto) = 7; - context.data.byte(kVolumedirection) = 1; + fadescreendowns(); + data.byte(kVolumeto) = 7; + data.byte(kVolumedirection) = 1; return; gotmonktext: - context.dx = 1; - context.ah = 82; - context._cmp(context.data.byte(kCh1playing), 255); - if (context.flags.z()) + dx = 1; + ah = 82; + _cmp(data.byte(kCh1playing), 255); + if (flags.z()) goto oktalk; - context._dec(context.data.byte(kIntrocount)); + _dec(data.byte(kIntrocount)); return; oktalk: - setuptimedtemp(context); + setuptimedtemp(); } -void drunk(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kGeneraldead), 0); - if (!context.flags.z()) +void DreamGenContext::drunk() { + STACK_CHECK; + _cmp(data.byte(kGeneraldead), 0); + if (!flags.z()) return /* (trampgone) */; - context.al = context.es.byte(context.bx+7); - context._and(context.al, 127); - context.es.byte(context.bx+7) = context.al; - showgamereel(context); - addtopeoplelist(context); + al = es.byte(bx+7); + _and(al, 127); + es.byte(bx+7) = al; + showgamereel(); + addtopeoplelist(); } -void advisor(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::advisor() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto noadvisor; goto noadvisor; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 123); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 123); + if (!flags.z()) goto notendadvis; - context.ax = 106; + ax = 106; goto gotadvframe; notendadvis: - context._cmp(context.ax, 108); - if (!context.flags.z()) + _cmp(ax, 108); + if (!flags.z()) goto gotadvframe; - context.push(context.ax); - randomnumber(context); - context.cl = context.al; - context.ax = context.pop(); - context._cmp(context.cl, 3); - if (context.flags.c()) + push(ax); + randomnumber(); + cl = al; + ax = pop(); + _cmp(cl, 3); + if (flags.c()) goto gotadvframe; - context.ax = 106; + ax = 106; gotadvframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; noadvisor: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void copper(Context &context) { - STACK_CHECK(context); - checkspeed(context); - if (!context.flags.z()) +void DreamGenContext::copper() { + STACK_CHECK; + checkspeed(); + if (!flags.z()) goto nocopper; - context.ax = context.es.word(context.bx+3); - context._inc(context.ax); - context._cmp(context.ax, 94); - if (!context.flags.z()) + ax = es.word(bx+3); + _inc(ax); + _cmp(ax, 94); + if (!flags.z()) goto notendcopper; - context.ax = 64; + ax = 64; goto gotcopframe; notendcopper: - context._cmp(context.ax, 81); - if (context.flags.z()) + _cmp(ax, 81); + if (flags.z()) goto mightwait; - context._cmp(context.ax, 66); - if (!context.flags.z()) + _cmp(ax, 66); + if (!flags.z()) goto gotcopframe; mightwait: - context.push(context.ax); - randomnumber(context); - context.cl = context.al; - context.ax = context.pop(); - context._cmp(context.cl, 7); - if (context.flags.c()) + push(ax); + randomnumber(); + cl = al; + ax = pop(); + _cmp(cl, 7); + if (flags.c()) goto gotcopframe; - context._dec(context.ax); + _dec(ax); gotcopframe: - context.es.word(context.bx+3) = context.ax; + es.word(bx+3) = ax; nocopper: - showgamereel(context); - addtopeoplelist(context); + showgamereel(); + addtopeoplelist(); } -void sparky(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) +void DreamGenContext::sparky() { + STACK_CHECK; + _cmp(data.word(kCard1money), 0); + if (flags.z()) goto animsparky; - context.es.byte(context.bx+7) = 3; + es.byte(bx+7) = 3; goto animsparky; animsparky: - checkspeed(context); - if (!context.flags.z()) + checkspeed(); + if (!flags.z()) goto finishsparky; - context._cmp(context.es.word(context.bx+3), 34); - if (!context.flags.z()) + _cmp(es.word(bx+3), 34); + if (!flags.z()) goto notsparky1; - randomnumber(context); - context._cmp(context.al, 30); - if (context.flags.c()) + randomnumber(); + _cmp(al, 30); + if (flags.c()) goto dosparky; - context.es.word(context.bx+3) = 27; + es.word(bx+3) = 27; goto finishsparky; notsparky1: - context._cmp(context.es.word(context.bx+3), 48); - if (!context.flags.z()) + _cmp(es.word(bx+3), 48); + if (!flags.z()) goto dosparky; - context.es.word(context.bx+3) = 27; + es.word(bx+3) = 27; goto finishsparky; dosparky: - context._inc(context.es.word(context.bx+3)); + _inc(es.word(bx+3)); finishsparky: - showgamereel(context); - addtopeoplelist(context); - context.al = context.es.byte(context.bx+7); - context._and(context.al, 128); - if (context.flags.z()) + showgamereel(); + addtopeoplelist(); + al = es.byte(bx+7); + _and(al, 128); + if (flags.z()) return /* (nottalkedsparky) */; - context.data.byte(kTalkedtosparky) = 1; + data.byte(kTalkedtosparky) = 1; } -void train(Context &context) { - STACK_CHECK(context); +void DreamGenContext::train() { + STACK_CHECK; return; - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 21); - if (!context.flags.c()) + ax = es.word(bx+3); + _cmp(ax, 21); + if (!flags.c()) goto notrainyet; - context._inc(context.ax); + _inc(ax); goto gottrainframe; notrainyet: - randomnumber(context); - context._cmp(context.al, 253); - if (context.flags.c()) + randomnumber(); + _cmp(al, 253); + if (flags.c()) return /* (notrainatall) */; - context._cmp(context.data.byte(kManspath), 5); - if (!context.flags.z()) + _cmp(data.byte(kManspath), 5); + if (!flags.z()) return /* (notrainatall) */; - context._cmp(context.data.byte(kFinaldest), 5); - if (!context.flags.z()) + _cmp(data.byte(kFinaldest), 5); + if (!flags.z()) return /* (notrainatall) */; - context.ax = 5; + ax = 5; gottrainframe: - context.es.word(context.bx+3) = context.ax; - showgamereel(context); -} - -void addtopeoplelist(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.push(context.bx); - context.cl = context.es.byte(context.bx+7); - context.ax = context.es.word(context.bx+3); - context.bx = context.data.word(kListpos); - context.es = context.data.word(kBuffers); - context.es.word(context.bx) = context.ax; - context.ax = context.pop(); - context.es.word(context.bx+2) = context.ax; - context.es.byte(context.bx+4) = context.cl; - context.bx = context.pop(); - context.es = context.pop(); - context._add(context.data.word(kListpos), 5); -} - -void showgamereel(Context &context) { - STACK_CHECK(context); - context.ax = context.es.word(context.bx+3); - context._cmp(context.ax, 512); - if (!context.flags.c()) + es.word(bx+3) = ax; + showgamereel(); +} + +void DreamGenContext::addtopeoplelist() { + STACK_CHECK; + push(es); + push(bx); + push(bx); + cl = es.byte(bx+7); + ax = es.word(bx+3); + bx = data.word(kListpos); + es = data.word(kBuffers); + es.word(bx) = ax; + ax = pop(); + es.word(bx+2) = ax; + es.byte(bx+4) = cl; + bx = pop(); + es = pop(); + _add(data.word(kListpos), 5); +} + +void DreamGenContext::showgamereel() { + STACK_CHECK; + ax = es.word(bx+3); + _cmp(ax, 512); + if (!flags.c()) return /* (noshow) */; - context.data.word(kReelpointer) = context.ax; - context.push(context.es); - context.push(context.bx); - plotreel(context); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = context.data.word(kReelpointer); - context.es.word(context.bx+3) = context.ax; -} - -void checkspeed(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLastweapon), -1); - if (!context.flags.z()) + data.word(kReelpointer) = ax; + push(es); + push(bx); + plotreel(); + bx = pop(); + es = pop(); + ax = data.word(kReelpointer); + es.word(bx+3) = ax; +} + +void DreamGenContext::checkspeed() { + STACK_CHECK; + _cmp(data.byte(kLastweapon), -1); + if (!flags.z()) goto forcenext; - context._inc(context.es.byte(context.bx+6)); - context.al = context.es.byte(context.bx+6); - context._cmp(context.al, context.es.byte(context.bx+5)); - if (!context.flags.z()) + _inc(es.byte(bx+6)); + al = es.byte(bx+6); + _cmp(al, es.byte(bx+5)); + if (!flags.z()) return /* (notspeed) */; - context.al = 0; - context.es.byte(context.bx+6) = context.al; - context._cmp(context.al, context.al); + al = 0; + es.byte(bx+6) = al; + _cmp(al, al); return; forcenext: - context._cmp(context.al, context.al); + _cmp(al, al); } -void clearsprites(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - context.al = 255; - context.cx = (32)*16; - context._stosb(context.cx); +void DreamGenContext::clearsprites() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + al = 255; + cx = (32)*16; + _stosb(cx); } -void makesprite(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); +void DreamGenContext::makesprite() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: - context._cmp(context.es.byte(context.bx+15), 255); - if (context.flags.z()) + _cmp(es.byte(bx+15), 255); + if (flags.z()) goto _tmp17a; - context._add(context.bx, (32)); + _add(bx, (32)); goto _tmp17; _tmp17a: - context.es.word(context.bx) = context.cx; - context.es.word(context.bx+10) = context.si; - context.es.word(context.bx+6) = context.dx; - context.es.word(context.bx+8) = context.di; - context.es.word(context.bx+2) = 0x0ffff; - context.es.byte(context.bx+15) = 0; - context.es.byte(context.bx+18) = 0; -} - -void delsprite(Context &context) { - STACK_CHECK(context); - context.di = context.bx; - context.cx = (32); - context.al = 255; - context._stosb(context.cx); -} - -void spriteupdate(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - context.al = context.data.byte(kRyanon); - context.es.byte(context.bx+31) = context.al; - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - context.cx = 16; + es.word(bx) = cx; + es.word(bx+10) = si; + es.word(bx+6) = dx; + es.word(bx+8) = di; + es.word(bx+2) = 0x0ffff; + es.byte(bx+15) = 0; + es.byte(bx+18) = 0; +} + +void DreamGenContext::delsprite() { + STACK_CHECK; + di = bx; + cx = (32); + al = 255; + _stosb(cx); +} + +void DreamGenContext::spriteupdate() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + al = data.byte(kRyanon); + es.byte(bx+31) = al; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + cx = 16; _tmp18: - context.push(context.cx); - context.push(context.bx); - context.ax = context.es.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + push(cx); + push(bx); + ax = es.word(bx); + _cmp(ax, 0x0ffff); + if (flags.z()) goto _tmp18a; - context.push(context.es); - context.push(context.ds); - context.cx = context.es.word(context.bx+2); - context.es.word(context.bx+24) = context.cx; - __dispatch_call(context, context.ax); - context.ds = context.pop(); - context.es = context.pop(); + push(es); + push(ds); + cx = es.word(bx+2); + es.word(bx+24) = cx; + __dispatch_call(ax); + ds = pop(); + es = pop(); _tmp18a: - context.bx = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(kNowinnewroom), 1); - if (context.flags.z()) + bx = pop(); + cx = pop(); + _cmp(data.byte(kNowinnewroom), 1); + if (flags.z()) return /* ($18b) */; - context._add(context.bx, (32)); - if (--context.cx) + _add(bx, (32)); + if (--cx) goto _tmp18; } -void printsprites(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.cx = 0; +void DreamGenContext::printsprites() { + STACK_CHECK; + es = data.word(kBuffers); + cx = 0; priorityloop: - context.push(context.cx); - context.data.byte(kPriority) = context.cl; - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - context.cx = 16; + push(cx); + data.byte(kPriority) = cl; + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + cx = 16; prtspriteloop: - context.push(context.cx); - context.push(context.bx); - context.ax = context.es.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + push(cx); + push(bx); + ax = es.word(bx); + _cmp(ax, 0x0ffff); + if (flags.z()) goto skipsprite; - context.al = context.data.byte(kPriority); - context._cmp(context.al, context.es.byte(context.bx+23)); - if (!context.flags.z()) + al = data.byte(kPriority); + _cmp(al, es.byte(bx+23)); + if (!flags.z()) goto skipsprite; - context._cmp(context.es.byte(context.bx+31), 1); - if (context.flags.z()) + _cmp(es.byte(bx+31), 1); + if (flags.z()) goto skipsprite; - printasprite(context); + printasprite(); skipsprite: - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, (32)); - if (--context.cx) + bx = pop(); + cx = pop(); + _add(bx, (32)); + if (--cx) goto prtspriteloop; - context.cx = context.pop(); - context._inc(context.cx); - context._cmp(context.cx, 7); - if (!context.flags.z()) + cx = pop(); + _inc(cx); + _cmp(cx, 7); + if (!flags.z()) goto priorityloop; } -void printasprite(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.si = context.bx; - context.ds = context.es.word(context.si+6); - context.al = context.es.byte(context.si+11); - context.ah = 0; - context._cmp(context.al, 220); - if (context.flags.c()) +void DreamGenContext::printasprite() { + STACK_CHECK; + push(es); + push(bx); + si = bx; + ds = es.word(si+6); + al = es.byte(si+11); + ah = 0; + _cmp(al, 220); + if (flags.c()) goto notnegative1; - context.ah = 255; + ah = 255; notnegative1: - context.bx = context.ax; - context._add(context.bx, context.data.word(kMapady)); - context.al = context.es.byte(context.si+10); - context.ah = 0; - context._cmp(context.al, 220); - if (context.flags.c()) + bx = ax; + _add(bx, data.word(kMapady)); + al = es.byte(si+10); + ah = 0; + _cmp(al, 220); + if (flags.c()) goto notnegative2; - context.ah = 255; + ah = 255; notnegative2: - context.di = context.ax; - context._add(context.di, context.data.word(kMapadx)); - context.al = context.es.byte(context.si+15); - context.ah = 0; - context._cmp(context.es.byte(context.si+30), 0); - if (context.flags.z()) + di = ax; + _add(di, data.word(kMapadx)); + al = es.byte(si+15); + ah = 0; + _cmp(es.byte(si+30), 0); + if (flags.z()) goto steadyframe; - context.ah = 8; + ah = 8; steadyframe: - context._cmp(context.data.byte(kPriority), 6); - if (!context.flags.z()) + _cmp(data.byte(kPriority), 6); + if (!flags.z()) goto notquickp; notquickp: - showframe(context); - context.bx = context.pop(); - context.es = context.pop(); -} - -void checkone(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - context.al = context.ch; - context.ah = 0; - context.cl = 4; - context._shr(context.ax, context.cl); - context.dl = context.al; - context.cx = context.pop(); - context.al = context.cl; - context.ah = 0; - context.cl = 4; - context._shr(context.ax, context.cl); - context.ah = context.dl; - context.push(context.ax); - context.ch = 0; - context.cl = context.al; - context.push(context.cx); - context.al = context.ah; - context.ah = 0; - context.cx = 11; - context._mul(context.cx); - context.cx = context.pop(); - context._add(context.ax, context.cx); - context.cx = 3; - context._mul(context.cx); - context.si = context.ax; - context.ds = context.data.word(kBuffers); - context._add(context.si, (0+(180*10)+32+60+(32*32))); - context._lodsw(); - context.cx = context.ax; - context._lodsb(); - context.dx = context.pop(); -} - -void findsource(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kCurrentframe); - context._cmp(context.ax, 160); - if (!context.flags.c()) + showframe(); + bx = pop(); + es = pop(); +} + +void DreamGenContext::checkone() { + STACK_CHECK; + push(cx); + al = ch; + ah = 0; + cl = 4; + _shr(ax, cl); + dl = al; + cx = pop(); + al = cl; + ah = 0; + cl = 4; + _shr(ax, cl); + ah = dl; + push(ax); + ch = 0; + cl = al; + push(cx); + al = ah; + ah = 0; + cx = 11; + _mul(cx); + cx = pop(); + _add(ax, cx); + cx = 3; + _mul(cx); + si = ax; + ds = data.word(kBuffers); + _add(si, (0+(180*10)+32+60+(32*32))); + _lodsw(); + cx = ax; + _lodsb(); + dx = pop(); +} + +void DreamGenContext::findsource() { + STACK_CHECK; + ax = data.word(kCurrentframe); + _cmp(ax, 160); + if (!flags.c()) goto over1000; - context.ds = context.data.word(kReel1); - context.data.word(kTakeoff) = 0; + ds = data.word(kReel1); + data.word(kTakeoff) = 0; return; over1000: - context._cmp(context.ax, 320); - if (!context.flags.c()) + _cmp(ax, 320); + if (!flags.c()) goto over1001; - context.ds = context.data.word(kReel2); - context.data.word(kTakeoff) = 160; + ds = data.word(kReel2); + data.word(kTakeoff) = 160; return; over1001: - context.ds = context.data.word(kReel3); - context.data.word(kTakeoff) = 320; -} - -void initman(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kRyanx); - context.ah = context.data.byte(kRyany); - context.si = context.ax; - context.cx = 49464; - context.dx = context.data.word(kMainsprites); - context.di = 0; - makesprite(context); - context.es.byte(context.bx+23) = 4; - context.es.byte(context.bx+22) = 0; - context.es.byte(context.bx+29) = 0; -} - -void mainman(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kResetmanxy), 1); - if (!context.flags.z()) + ds = data.word(kReel3); + data.word(kTakeoff) = 320; +} + +void DreamGenContext::initman() { + STACK_CHECK; + al = data.byte(kRyanx); + ah = data.byte(kRyany); + si = ax; + cx = 49464; + dx = data.word(kMainsprites); + di = 0; + makesprite(); + es.byte(bx+23) = 4; + es.byte(bx+22) = 0; + es.byte(bx+29) = 0; +} + +void DreamGenContext::mainman() { + STACK_CHECK; + _cmp(data.byte(kResetmanxy), 1); + if (!flags.z()) goto notinnewroom; - context.data.byte(kResetmanxy) = 0; - context.al = context.data.byte(kRyanx); - context.ah = context.data.byte(kRyany); - context.es.word(context.bx+10) = context.ax; - context.es.byte(context.bx+29) = 0; + data.byte(kResetmanxy) = 0; + al = data.byte(kRyanx); + ah = data.byte(kRyany); + es.word(bx+10) = ax; + es.byte(bx+29) = 0; goto executewalk; notinnewroom: - context._dec(context.es.byte(context.bx+22)); - context._cmp(context.es.byte(context.bx+22), -1); - if (context.flags.z()) + _dec(es.byte(bx+22)); + _cmp(es.byte(bx+22), -1); + if (flags.z()) goto executewalk; return; executewalk: - context.es.byte(context.bx+22) = 0; - context.al = context.data.byte(kTurntoface); - context._cmp(context.al, context.data.byte(kFacing)); - if (context.flags.z()) + es.byte(bx+22) = 0; + al = data.byte(kTurntoface); + _cmp(al, data.byte(kFacing)); + if (flags.z()) goto facingok; - aboutturn(context); + aboutturn(); goto notwalk; facingok: - context._cmp(context.data.byte(kTurndirection), 0); - if (context.flags.z()) + _cmp(data.byte(kTurndirection), 0); + if (flags.z()) goto alreadyturned; - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto alreadyturned; - context.data.byte(kReasseschanges) = 1; - context.al = context.data.byte(kFacing); - context._cmp(context.al, context.data.byte(kLeavedirection)); - if (!context.flags.z()) + data.byte(kReasseschanges) = 1; + al = data.byte(kFacing); + _cmp(al, data.byte(kLeavedirection)); + if (!flags.z()) goto alreadyturned; - checkforexit(context); + checkforexit(); alreadyturned: - context.data.byte(kTurndirection) = 0; - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + data.byte(kTurndirection) = 0; + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto walkman; - context.es.byte(context.bx+29) = 0; + es.byte(bx+29) = 0; goto notwalk; walkman: - context.al = context.es.byte(context.bx+29); - context._inc(context.al); - context._cmp(context.al, 11); - if (!context.flags.z()) + al = es.byte(bx+29); + _inc(al); + _cmp(al, 11); + if (!flags.z()) goto notanimend1; - context.al = 1; + al = 1; notanimend1: - context.es.byte(context.bx+29) = context.al; - walking(context); - context._cmp(context.data.byte(kLinepointer), 254); - if (context.flags.z()) + es.byte(bx+29) = al; + walking(); + _cmp(data.byte(kLinepointer), 254); + if (flags.z()) goto afterwalk; - context.al = context.data.byte(kFacing); - context._and(context.al, 1); - if (context.flags.z()) + al = data.byte(kFacing); + _and(al, 1); + if (flags.z()) goto isdouble; - context.al = context.es.byte(context.bx+29); - context._cmp(context.al, 2); - if (context.flags.z()) + al = es.byte(bx+29); + _cmp(al, 2); + if (flags.z()) goto afterwalk; - context._cmp(context.al, 7); - if (context.flags.z()) + _cmp(al, 7); + if (flags.z()) goto afterwalk; isdouble: - walking(context); + walking(); afterwalk: - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto notwalk; - context.al = context.data.byte(kTurntoface); - context._cmp(context.al, context.data.byte(kFacing)); - if (!context.flags.z()) + al = data.byte(kTurntoface); + _cmp(al, data.byte(kFacing)); + if (!flags.z()) goto notwalk; - context.data.byte(kReasseschanges) = 1; - context.al = context.data.byte(kFacing); - context._cmp(context.al, context.data.byte(kLeavedirection)); - if (!context.flags.z()) + data.byte(kReasseschanges) = 1; + al = data.byte(kFacing); + _cmp(al, data.byte(kLeavedirection)); + if (!flags.z()) goto notwalk; - checkforexit(context); + checkforexit(); notwalk: - context.al = context.data.byte(kFacing); - context.ah = 0; - context.di = 1105; - context._add(context.di, context.ax); - context.al = context.cs.byte(context.di); - context._add(context.al, context.es.byte(context.bx+29)); - context.es.byte(context.bx+15) = context.al; - context.ax = context.es.word(context.bx+10); - context.data.byte(kRyanx) = context.al; - context.data.byte(kRyany) = context.ah; -} - -void aboutturn(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kTurndirection), 1); - if (context.flags.z()) + al = data.byte(kFacing); + ah = 0; + di = 1105; + _add(di, ax); + al = cs.byte(di); + _add(al, es.byte(bx+29)); + es.byte(bx+15) = al; + ax = es.word(bx+10); + data.byte(kRyanx) = al; + data.byte(kRyany) = ah; +} + +void DreamGenContext::aboutturn() { + STACK_CHECK; + _cmp(data.byte(kTurndirection), 1); + if (flags.z()) goto incdir; - context._cmp(context.data.byte(kTurndirection), -1); - if (context.flags.z()) + _cmp(data.byte(kTurndirection), -1); + if (flags.z()) goto decdir; - context.al = context.data.byte(kFacing); - context._sub(context.al, context.data.byte(kTurntoface)); - if (!context.flags.c()) + al = data.byte(kFacing); + _sub(al, data.byte(kTurntoface)); + if (!flags.c()) goto higher; - context._neg(context.al); - context._cmp(context.al, 4); - if (!context.flags.c()) + _neg(al); + _cmp(al, 4); + if (!flags.c()) goto decdir; goto incdir; higher: - context._cmp(context.al, 4); - if (!context.flags.c()) + _cmp(al, 4); + if (!flags.c()) goto incdir; goto decdir; incdir: - context.data.byte(kTurndirection) = 1; - context.al = context.data.byte(kFacing); - context._inc(context.al); - context._and(context.al, 7); - context.data.byte(kFacing) = context.al; - context.es.byte(context.bx+29) = 0; + data.byte(kTurndirection) = 1; + al = data.byte(kFacing); + _inc(al); + _and(al, 7); + data.byte(kFacing) = al; + es.byte(bx+29) = 0; return; decdir: - context.data.byte(kTurndirection) = -1; - context.al = context.data.byte(kFacing); - context._dec(context.al); - context._and(context.al, 7); - context.data.byte(kFacing) = context.al; - context.es.byte(context.bx+29) = 0; -} - -void walking(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLinedirection), 0); - if (context.flags.z()) + data.byte(kTurndirection) = -1; + al = data.byte(kFacing); + _dec(al); + _and(al, 7); + data.byte(kFacing) = al; + es.byte(bx+29) = 0; +} + +void DreamGenContext::walking() { + STACK_CHECK; + _cmp(data.byte(kLinedirection), 0); + if (flags.z()) goto normalwalk; - context.al = context.data.byte(kLinepointer); - context._dec(context.al); - context.data.byte(kLinepointer) = context.al; - context._cmp(context.al, 200); - if (!context.flags.c()) + al = data.byte(kLinepointer); + _dec(al); + data.byte(kLinepointer) = al; + _cmp(al, 200); + if (!flags.c()) goto endofline; goto continuewalk; normalwalk: - context.al = context.data.byte(kLinepointer); - context._inc(context.al); - context.data.byte(kLinepointer) = context.al; - context._cmp(context.al, context.data.byte(kLinelength)); - if (!context.flags.c()) + al = data.byte(kLinepointer); + _inc(al); + data.byte(kLinepointer) = al; + _cmp(al, data.byte(kLinelength)); + if (!flags.c()) goto endofline; continuewalk: - context.ah = 0; - context._add(context.ax, context.ax); - context.push(context.es); - context.push(context.bx); - context.dx = context.data; - context.es = context.dx; - context.bx = 8173; - context._add(context.bx, context.ax); - context.ax = context.es.word(context.bx); - context.bx = context.pop(); - context.es = context.pop(); - context.es.word(context.bx+10) = context.ax; + ah = 0; + _add(ax, ax); + push(es); + push(bx); + dx = data; + es = dx; + bx = 8173; + _add(bx, ax); + ax = es.word(bx); + bx = pop(); + es = pop(); + es.word(bx+10) = ax; return; endofline: - context.data.byte(kLinepointer) = 254; - context.al = context.data.byte(kDestination); - context.data.byte(kManspath) = context.al; - context._cmp(context.al, context.data.byte(kFinaldest)); - if (context.flags.z()) + data.byte(kLinepointer) = 254; + al = data.byte(kDestination); + data.byte(kManspath) = al; + _cmp(al, data.byte(kFinaldest)); + if (flags.z()) goto finishedwalk; - context.al = context.data.byte(kFinaldest); - context.data.byte(kDestination) = context.al; - context.push(context.es); - context.push(context.bx); - autosetwalk(context); - context.bx = context.pop(); - context.es = context.pop(); + al = data.byte(kFinaldest); + data.byte(kDestination) = al; + push(es); + push(bx); + autosetwalk(); + bx = pop(); + es = pop(); return; finishedwalk: - facerightway(context); -} - -void facerightway(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - getroomspaths(context); - context.al = context.data.byte(kManspath); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx+7); - context.data.byte(kTurntoface) = context.al; - context.data.byte(kLeavedirection) = context.al; - context.bx = context.pop(); - context.es = context.pop(); -} - -void checkforexit(Context &context) { - STACK_CHECK(context); - context.cl = context.data.byte(kRyanx); - context._add(context.cl, 12); - context.ch = context.data.byte(kRyany); - context._add(context.ch, 12); - checkone(context); - context.data.byte(kLastflag) = context.cl; - context.data.byte(kLastflagex) = context.ch; - context.data.byte(kFlagx) = context.dl; - context.data.byte(kFlagy) = context.dh; - context.al = context.data.byte(kLastflag); - context._test(context.al, 64); - if (context.flags.z()) + facerightway(); +} + +void DreamGenContext::facerightway() { + STACK_CHECK; + push(es); + push(bx); + getroomspaths(); + al = data.byte(kManspath); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = es.byte(bx+7); + data.byte(kTurntoface) = al; + data.byte(kLeavedirection) = al; + bx = pop(); + es = pop(); +} + +void DreamGenContext::checkforexit() { + STACK_CHECK; + cl = data.byte(kRyanx); + _add(cl, 12); + ch = data.byte(kRyany); + _add(ch, 12); + checkone(); + data.byte(kLastflag) = cl; + data.byte(kLastflagex) = ch; + data.byte(kFlagx) = dl; + data.byte(kFlagy) = dh; + al = data.byte(kLastflag); + _test(al, 64); + if (flags.z()) goto notnewdirect; - context.al = context.data.byte(kLastflagex); - context.data.byte(kAutolocation) = context.al; + al = data.byte(kLastflagex); + data.byte(kAutolocation) = al; return; notnewdirect: - context._test(context.al, 32); - if (context.flags.z()) + _test(al, 32); + if (flags.z()) goto notleave; - context.push(context.es); - context.push(context.bx); - context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) + push(es); + push(bx); + _cmp(data.byte(kReallocation), 2); + if (!flags.z()) goto notlouis; - context.bl = 0; - context.push(context.bx); - context.al = 'W'; - context.ah = 'E'; - context.cl = 'T'; - context.ch = 'A'; - isryanholding(context); - context.bx = context.pop(); - if (context.flags.z()) + bl = 0; + push(bx); + al = 'W'; + ah = 'E'; + cl = 'T'; + ch = 'A'; + isryanholding(); + bx = pop(); + if (flags.z()) goto noshoe1; - context._inc(context.bl); + _inc(bl); noshoe1: - context.push(context.bx); - context.al = 'W'; - context.ah = 'E'; - context.cl = 'T'; - context.ch = 'B'; - isryanholding(context); - context.bx = context.pop(); - if (context.flags.z()) + push(bx); + al = 'W'; + ah = 'E'; + cl = 'T'; + ch = 'B'; + isryanholding(); + bx = pop(); + if (flags.z()) goto noshoe2; - context._inc(context.bl); + _inc(bl); noshoe2: - context._cmp(context.bl, 2); - if (context.flags.z()) + _cmp(bl, 2); + if (flags.z()) goto notlouis; - context.al = 42; - context._cmp(context.bl, 0); - if (context.flags.z()) + al = 42; + _cmp(bl, 0); + if (flags.z()) goto notravmessage; - context._inc(context.al); + _inc(al); notravmessage: - context.cx = 80; - context.dx = 10; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); - context.al = context.data.byte(kFacing); - context._add(context.al, 4); - context._and(context.al, 7); - context.data.byte(kTurntoface) = context.al; - context.bx = context.pop(); - context.es = context.pop(); + cx = 80; + dx = 10; + bl = 68; + bh = 64; + setuptimeduse(); + al = data.byte(kFacing); + _add(al, 4); + _and(al, 7); + data.byte(kTurntoface) = al; + bx = pop(); + es = pop(); return; notlouis: - context.bx = context.pop(); - context.es = context.pop(); - context.data.byte(kNeedtotravel) = 1; + bx = pop(); + es = pop(); + data.byte(kNeedtotravel) = 1; return; notleave: - context._test(context.al, 4); - if (context.flags.z()) + _test(al, 4); + if (flags.z()) goto notaleft; - adjustleft(context); + adjustleft(); return; notaleft: - context._test(context.al, 2); - if (context.flags.z()) + _test(al, 2); + if (flags.z()) goto notaright; - adjustright(context); + adjustright(); return; notaright: - context._test(context.al, 8); - if (context.flags.z()) + _test(al, 8); + if (flags.z()) goto notadown; - adjustdown(context); + adjustdown(); return; notadown: - context._test(context.al, 16); - if (context.flags.z()) + _test(al, 16); + if (flags.z()) return /* (notanup) */; - adjustup(context); -} - -void adjustdown(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context._add(context.data.byte(kMapy), 10); - context.al = context.data.byte(kLastflagex); - context.cl = 16; - context._mul(context.cl); - context.es.byte(context.bx+11) = context.al; - context.data.byte(kNowinnewroom) = 1; - context.bx = context.pop(); - context.es = context.pop(); -} - -void adjustup(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context._sub(context.data.byte(kMapy), 10); - context.al = context.data.byte(kLastflagex); - context.cl = 16; - context._mul(context.cl); - context.es.byte(context.bx+11) = context.al; - context.data.byte(kNowinnewroom) = 1; - context.bx = context.pop(); - context.es = context.pop(); -} - -void adjustleft(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.data.byte(kLastflag) = 0; - context._sub(context.data.byte(kMapx), 11); - context.al = context.data.byte(kLastflagex); - context.cl = 16; - context._mul(context.cl); - context.es.byte(context.bx+10) = context.al; - context.data.byte(kNowinnewroom) = 1; - context.bx = context.pop(); - context.es = context.pop(); -} - -void adjustright(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context._add(context.data.byte(kMapx), 11); - context.al = context.data.byte(kLastflagex); - context.cl = 16; - context._mul(context.cl); - context._sub(context.al, 2); - context.es.byte(context.bx+10) = context.al; - context.data.byte(kNowinnewroom) = 1; - context.bx = context.pop(); - context.es = context.pop(); -} - -void reminders(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 24); - if (!context.flags.z()) + adjustup(); +} + +void DreamGenContext::adjustdown() { + STACK_CHECK; + push(es); + push(bx); + _add(data.byte(kMapy), 10); + al = data.byte(kLastflagex); + cl = 16; + _mul(cl); + es.byte(bx+11) = al; + data.byte(kNowinnewroom) = 1; + bx = pop(); + es = pop(); +} + +void DreamGenContext::adjustup() { + STACK_CHECK; + push(es); + push(bx); + _sub(data.byte(kMapy), 10); + al = data.byte(kLastflagex); + cl = 16; + _mul(cl); + es.byte(bx+11) = al; + data.byte(kNowinnewroom) = 1; + bx = pop(); + es = pop(); +} + +void DreamGenContext::adjustleft() { + STACK_CHECK; + push(es); + push(bx); + data.byte(kLastflag) = 0; + _sub(data.byte(kMapx), 11); + al = data.byte(kLastflagex); + cl = 16; + _mul(cl); + es.byte(bx+10) = al; + data.byte(kNowinnewroom) = 1; + bx = pop(); + es = pop(); +} + +void DreamGenContext::adjustright() { + STACK_CHECK; + push(es); + push(bx); + _add(data.byte(kMapx), 11); + al = data.byte(kLastflagex); + cl = 16; + _mul(cl); + _sub(al, 2); + es.byte(bx+10) = al; + data.byte(kNowinnewroom) = 1; + bx = pop(); + es = pop(); +} + +void DreamGenContext::reminders() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 24); + if (!flags.z()) return /* (notinedenslift) */; - context._cmp(context.data.byte(kMapx), 44); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 44); + if (!flags.z()) return /* (notinedenslift) */; - context._cmp(context.data.byte(kProgresspoints), 0); - if (!context.flags.z()) + _cmp(data.byte(kProgresspoints), 0); + if (!flags.z()) return /* (notfirst) */; - context.al = 'D'; - context.ah = 'K'; - context.cl = 'E'; - context.ch = 'Y'; - isryanholding(context); - if (context.flags.z()) + al = 'D'; + ah = 'K'; + cl = 'E'; + ch = 'Y'; + isryanholding(); + if (flags.z()) goto forgotone; - context.al = 'C'; - context.ah = 'S'; - context.cl = 'H'; - context.ch = 'R'; - findexobject(context); - context._cmp(context.al, (114)); - if (context.flags.z()) + al = 'C'; + ah = 'S'; + cl = 'H'; + ch = 'R'; + findexobject(); + _cmp(al, (114)); + if (flags.z()) goto forgotone; - context.ax = context.es.word(context.bx+2); - context._cmp(context.al, 4); - if (!context.flags.z()) + ax = es.word(bx+2); + _cmp(al, 4); + if (!flags.z()) goto forgotone; - context._cmp(context.ah, 255); - if (context.flags.z()) + _cmp(ah, 255); + if (flags.z()) goto havegotcard; - context.cl = 'P'; - context.ch = 'U'; - context.dl = 'R'; - context.dh = 'S'; - context._xchg(context.al, context.ah); - compare(context); - if (!context.flags.z()) + cl = 'P'; + ch = 'U'; + dl = 'R'; + dh = 'S'; + _xchg(al, ah); + compare(); + if (!flags.z()) goto forgotone; havegotcard: - context._inc(context.data.byte(kProgresspoints)); + _inc(data.byte(kProgresspoints)); return; forgotone: - context.al = 50; - context.bl = 54; - context.bh = 70; - context.cx = 48; - context.dx = 8; - setuptimeduse(context); -} - -void initrain(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+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*24)); - context.bx = 1113; + al = 50; + bl = 54; + bh = 70; + cx = 48; + dx = 8; + setuptimeduse(); +} + +void DreamGenContext::initrain() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+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*24)); + bx = 1113; checkmorerain: - context.al = context.cs.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + al = cs.byte(bx); + _cmp(al, 255); + if (flags.z()) goto finishinitrain; - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto checkrain; - context.al = context.cs.byte(context.bx+1); - context._cmp(context.al, context.data.byte(kMapx)); - if (!context.flags.z()) + al = cs.byte(bx+1); + _cmp(al, data.byte(kMapx)); + if (!flags.z()) goto checkrain; - context.al = context.cs.byte(context.bx+2); - context._cmp(context.al, context.data.byte(kMapy)); - if (!context.flags.z()) + al = cs.byte(bx+2); + _cmp(al, data.byte(kMapy)); + if (!flags.z()) goto checkrain; - context.al = context.cs.byte(context.bx+3); - context.data.byte(kRainspace) = context.al; + al = cs.byte(bx+3); + data.byte(kRainspace) = al; goto dorain; checkrain: - context._add(context.bx, 4); + _add(bx, 4); goto checkmorerain; dorain: - context.cx = 4; + cx = 4; initraintop: - randomnumber(context); - context._and(context.al, 31); - context._add(context.al, 3); - context._cmp(context.al, context.data.byte(kRainspace)); - if (!context.flags.c()) + randomnumber(); + _and(al, 31); + _add(al, 3); + _cmp(al, data.byte(kRainspace)); + if (!flags.c()) goto initraintop; - context._add(context.cl, context.al); - context._cmp(context.cl, context.data.byte(kMapxsize)); - if (!context.flags.c()) + _add(cl, al); + _cmp(cl, data.byte(kMapxsize)); + if (!flags.c()) goto initrainside; - context.push(context.cx); - splitintolines(context); - context.cx = context.pop(); + push(cx); + splitintolines(); + cx = pop(); goto initraintop; initrainside: - context.cl = context.data.byte(kMapxsize); - context._dec(context.cl); + cl = data.byte(kMapxsize); + _dec(cl); initrainside2: - randomnumber(context); - context._and(context.al, 31); - context._add(context.al, 3); - context._cmp(context.al, context.data.byte(kRainspace)); - if (!context.flags.c()) + randomnumber(); + _and(al, 31); + _add(al, 3); + _cmp(al, data.byte(kRainspace)); + if (!flags.c()) goto initrainside2; - context._add(context.ch, context.al); - context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) + _add(ch, al); + _cmp(ch, data.byte(kMapysize)); + if (!flags.c()) goto finishinitrain; - context.push(context.cx); - splitintolines(context); - context.cx = context.pop(); + push(cx); + splitintolines(); + cx = pop(); goto initrainside2; finishinitrain: - context.al = 255; - context._stosb(); + al = 255; + _stosb(); } -void splitintolines(Context &context) { - STACK_CHECK(context); +void DreamGenContext::splitintolines() { + STACK_CHECK; lookforlinestart: - getblockofpixel(context); - context._cmp(context.al, 0); - if (!context.flags.z()) + getblockofpixel(); + _cmp(al, 0); + if (!flags.z()) goto foundlinestart; - context._dec(context.cl); - context._inc(context.ch); - context._cmp(context.cl, 0); - if (context.flags.z()) + _dec(cl); + _inc(ch); + _cmp(cl, 0); + if (flags.z()) return /* (endofthisline) */; - context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) + _cmp(ch, data.byte(kMapysize)); + if (!flags.c()) return /* (endofthisline) */; goto lookforlinestart; foundlinestart: - context.es.word(context.di) = context.cx; - context.bh = 1; + es.word(di) = cx; + bh = 1; lookforlineend: - getblockofpixel(context); - context._cmp(context.al, 0); - if (context.flags.z()) + getblockofpixel(); + _cmp(al, 0); + if (flags.z()) goto foundlineend; - context._dec(context.cl); - context._inc(context.ch); - context._cmp(context.cl, 0); - if (context.flags.z()) + _dec(cl); + _inc(ch); + _cmp(cl, 0); + if (flags.z()) goto foundlineend; - context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) + _cmp(ch, data.byte(kMapysize)); + if (!flags.c()) goto foundlineend; - context._inc(context.bh); + _inc(bh); goto lookforlineend; foundlineend: - context.push(context.cx); - context.es.byte(context.di+2) = context.bh; - randomnumber(context); - context.es.byte(context.di+3) = context.al; - randomnumber(context); - context.es.byte(context.di+4) = context.al; - randomnumber(context); - context._and(context.al, 3); - context._add(context.al, 4); - context.es.byte(context.di+5) = context.al; - context._add(context.di, 6); - context.cx = context.pop(); - context._cmp(context.cl, 0); - if (context.flags.z()) + 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) */; - context._cmp(context.ch, context.data.byte(kMapysize)); - if (!context.flags.c()) + _cmp(ch, data.byte(kMapysize)); + if (!flags.c()) return /* (endofthisline) */; goto lookforlinestart; } -void getblockofpixel(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - context.push(context.es); - context.push(context.di); - context.ax = context.data.word(kMapxstart); - context._add(context.cl, context.al); - context.ax = context.data.word(kMapystart); - context._add(context.ch, context.al); - checkone(context); - context._and(context.cl, 1); - if (!context.flags.z()) +void DreamGenContext::getblockofpixel() { + STACK_CHECK; + push(cx); + push(es); + push(di); + ax = data.word(kMapxstart); + _add(cl, al); + ax = data.word(kMapystart); + _add(ch, al); + checkone(); + _and(cl, 1); + if (!flags.z()) goto failrain; - context.di = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); + di = pop(); + es = pop(); + cx = pop(); return; failrain: - context.di = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.al = 0; -} - -void showrain(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kMainsprites); - context.si = 6*58; - context.ax = context.ds.word(context.si+2); - context.si = context.ax; - context._add(context.si, 2080); - context.bx = (0+(180*10)+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*24)); - context.es = context.data.word(kBuffers); - context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) + di = pop(); + es = pop(); + cx = pop(); + al = 0; +} + +void DreamGenContext::showrain() { + STACK_CHECK; + ds = data.word(kMainsprites); + si = 6*58; + ax = ds.word(si+2); + si = ax; + _add(si, 2080); + bx = (0+(180*10)+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*24)); + es = data.word(kBuffers); + _cmp(es.byte(bx), 255); + if (flags.z()) return /* (nothunder) */; morerain: - context.es = context.data.word(kBuffers); - context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) + es = data.word(kBuffers); + _cmp(es.byte(bx), 255); + if (flags.z()) goto finishrain; - context.al = context.es.byte(context.bx+1); - context.ah = 0; - context._add(context.ax, context.data.word(kMapady)); - context._add(context.ax, context.data.word(kMapystart)); - context.cx = 320; - context._mul(context.cx); - context.cl = context.es.byte(context.bx); - context.ch = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.data.word(kMapadx)); - context._add(context.ax, context.data.word(kMapxstart)); - context.di = context.ax; - context.cl = context.es.byte(context.bx+2); - context.ch = 0; - context.ax = context.es.word(context.bx+3); - context.dl = context.es.byte(context.bx+5); - context.dh = 0; - context._sub(context.ax, context.dx); - context._and(context.ax, 511); - context.es.word(context.bx+3) = context.ax; - context._add(context.bx, 6); - context.push(context.si); - context._add(context.si, context.ax); - context.es = context.data.word(kWorkspace); - context.ah = 0; - context.dx = 320-2; + al = es.byte(bx+1); + ah = 0; + _add(ax, data.word(kMapady)); + _add(ax, data.word(kMapystart)); + cx = 320; + _mul(cx); + cl = es.byte(bx); + ch = 0; + _add(ax, cx); + _add(ax, data.word(kMapadx)); + _add(ax, data.word(kMapxstart)); + di = ax; + cl = es.byte(bx+2); + ch = 0; + ax = es.word(bx+3); + dl = es.byte(bx+5); + dh = 0; + _sub(ax, dx); + _and(ax, 511); + es.word(bx+3) = ax; + _add(bx, 6); + push(si); + _add(si, ax); + es = data.word(kWorkspace); + ah = 0; + dx = 320-2; rainloop: - context._lodsb(); - context._cmp(context.al, context.ah); - if (context.flags.z()) + _lodsb(); + _cmp(al, ah); + if (flags.z()) goto noplot; - context._stosb(); - context._add(context.di, context.dx); - if (--context.cx) + _stosb(); + _add(di, dx); + if (--cx) goto rainloop; - context.si = context.pop(); + si = pop(); goto morerain; noplot: - context._add(context.di, 320-1); - if (--context.cx) + _add(di, 320-1); + if (--cx) goto rainloop; - context.si = context.pop(); + si = pop(); goto morerain; finishrain: - context._cmp(context.data.word(kCh1blockstocopy), 0); - if (!context.flags.z()) + _cmp(data.word(kCh1blockstocopy), 0); + if (!flags.z()) return /* (nothunder) */; - context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 2); + if (!flags.z()) goto notlouisthund; - context._cmp(context.data.byte(kBeenmugged), 1); - if (!context.flags.z()) + _cmp(data.byte(kBeenmugged), 1); + if (!flags.z()) return /* (nothunder) */; notlouisthund: - context._cmp(context.data.byte(kReallocation), 55); - if (context.flags.z()) + _cmp(data.byte(kReallocation), 55); + if (flags.z()) return /* (nothunder) */; - randomnum1(context); - context._cmp(context.al, 1); - if (!context.flags.c()) + randomnum1(); + _cmp(al, 1); + if (!flags.c()) return /* (nothunder) */; - context.al = 7; - context._cmp(context.data.byte(kCh0playing), 6); - if (context.flags.z()) + al = 7; + _cmp(data.byte(kCh0playing), 6); + if (flags.z()) goto isthunder1; - context.al = 4; + al = 4; isthunder1: - playchannel1(context); + playchannel1(); } -void backobject(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kSetdat); - context.di = context.es.word(context.bx+20); - context.al = context.es.byte(context.bx+18); - context._cmp(context.al, 0); - if (context.flags.z()) +void DreamGenContext::backobject() { + STACK_CHECK; + ds = data.word(kSetdat); + di = es.word(bx+20); + al = es.byte(bx+18); + _cmp(al, 0); + if (flags.z()) goto _tmp48z; - context._dec(context.al); - context.es.byte(context.bx+18) = context.al; + _dec(al); + es.byte(bx+18) = al; return /* (finishback) */; _tmp48z: - context.al = context.ds.byte(context.di+7); - context.es.byte(context.bx+18) = context.al; - context.al = context.ds.byte(context.di+8); - context._cmp(context.al, 6); - if (!context.flags.z()) + al = ds.byte(di+7); + es.byte(bx+18) = al; + al = ds.byte(di+8); + _cmp(al, 6); + if (!flags.z()) goto notwidedoor; - widedoor(context); + widedoor(); return /* (finishback) */; notwidedoor: - context._cmp(context.al, 5); - if (!context.flags.z()) + _cmp(al, 5); + if (!flags.z()) goto notrandom; - random(context); + random(); return /* (finishback) */; notrandom: - context._cmp(context.al, 4); - if (!context.flags.z()) + _cmp(al, 4); + if (!flags.z()) goto notlockdoor; - lockeddoorway(context); + lockeddoorway(); return /* (finishback) */; notlockdoor: - context._cmp(context.al, 3); - if (!context.flags.z()) + _cmp(al, 3); + if (!flags.z()) goto notlift; - liftsprite(context); + liftsprite(); return /* (finishback) */; notlift: - context._cmp(context.al, 2); - if (!context.flags.z()) + _cmp(al, 2); + if (!flags.z()) goto notdoor; - doorway(context); + doorway(); return /* (finishback) */; notdoor: - context._cmp(context.al, 1); - if (!context.flags.z()) + _cmp(al, 1); + if (!flags.z()) goto steadyob; - constant(context); + constant(); return /* (finishback) */; steadyob: - steady(context); + steady(); } -void liftsprite(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kLiftflag); - context._cmp(context.al, 0); - if (context.flags.z()) +void DreamGenContext::liftsprite() { + STACK_CHECK; + al = data.byte(kLiftflag); + _cmp(al, 0); + if (flags.z()) goto liftclosed; - context._cmp(context.al, 1); - if (context.flags.z()) + _cmp(al, 1); + if (flags.z()) goto liftopen; - context._cmp(context.al, 3); - if (context.flags.z()) + _cmp(al, 3); + if (flags.z()) goto openlift; - context.al = context.es.byte(context.bx+19); - context._cmp(context.al, 0); - if (context.flags.z()) + al = es.byte(bx+19); + _cmp(al, 0); + if (flags.z()) goto finishclose; - context._dec(context.al); - context._cmp(context.al, 11); - if (!context.flags.z()) + _dec(al); + _cmp(al, 11); + if (!flags.z()) goto pokelift; - context.push(context.ax); - context.al = 3; - liftnoise(context); - context.ax = context.pop(); + push(ax); + al = 3; + liftnoise(); + ax = pop(); goto pokelift; finishclose: - context.data.byte(kLiftflag) = 0; + data.byte(kLiftflag) = 0; return; openlift: - context.al = context.es.byte(context.bx+19); - context._cmp(context.al, 12); - if (context.flags.z()) + al = es.byte(bx+19); + _cmp(al, 12); + if (flags.z()) goto endoflist; - context._inc(context.al); - context._cmp(context.al, 1); - if (!context.flags.z()) + _inc(al); + _cmp(al, 1); + if (!flags.z()) goto pokelift; - context.push(context.ax); - context.al = 2; - liftnoise(context); - context.ax = context.pop(); + push(ax); + al = 2; + liftnoise(); + ax = pop(); pokelift: - context.es.byte(context.bx+19) = context.al; - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; + es.byte(bx+19) = al; + ah = 0; + push(di); + _add(di, ax); + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; return; endoflist: - context.data.byte(kLiftflag) = 1; + data.byte(kLiftflag) = 1; return; liftopen: - context.al = context.data.byte(kLiftpath); - context.push(context.es); - context.push(context.bx); - turnpathon(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(kCounttoclose), 0); - if (context.flags.z()) + al = data.byte(kLiftpath); + push(es); + push(bx); + turnpathon(); + bx = pop(); + es = pop(); + _cmp(data.byte(kCounttoclose), 0); + if (flags.z()) goto nocountclose; - context._dec(context.data.byte(kCounttoclose)); - context._cmp(context.data.byte(kCounttoclose), 0); - if (!context.flags.z()) + _dec(data.byte(kCounttoclose)); + _cmp(data.byte(kCounttoclose), 0); + if (!flags.z()) goto nocountclose; - context.data.byte(kLiftflag) = 2; + data.byte(kLiftflag) = 2; nocountclose: - context.al = 12; + al = 12; goto pokelift; liftclosed: - context.al = context.data.byte(kLiftpath); - context.push(context.es); - context.push(context.bx); - turnpathoff(context); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.data.byte(kCounttoopen), 0); - if (context.flags.z()) + al = data.byte(kLiftpath); + push(es); + push(bx); + turnpathoff(); + bx = pop(); + es = pop(); + _cmp(data.byte(kCounttoopen), 0); + if (flags.z()) goto nocountopen; - context._dec(context.data.byte(kCounttoopen)); - context._cmp(context.data.byte(kCounttoopen), 0); - if (!context.flags.z()) + _dec(data.byte(kCounttoopen)); + _cmp(data.byte(kCounttoopen), 0); + if (!flags.z()) goto nocountopen; - context.data.byte(kLiftflag) = 3; + data.byte(kLiftflag) = 3; nocountopen: - context.al = 0; + al = 0; goto pokelift; } -void liftnoise(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 5); - if (context.flags.z()) +void DreamGenContext::liftnoise() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 5); + if (flags.z()) goto hissnoise; - context._cmp(context.data.byte(kReallocation), 21); - if (context.flags.z()) + _cmp(data.byte(kReallocation), 21); + if (flags.z()) goto hissnoise; - playchannel1(context); + playchannel1(); return; hissnoise: - context.al = 13; - playchannel1(context); -} - -void random(Context &context) { - STACK_CHECK(context); - randomnum1(context); - context.push(context.di); - context._and(context.ax, 7); - context._add(context.di, 18); - context._add(context.di, context.ax); - context.al = context.ds.byte(context.di); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; -} - -void steady(Context &context) { - STACK_CHECK(context); - context.al = context.ds.byte(context.di+18); - context.ds.byte(context.di+17) = context.al; - context.es.byte(context.bx+15) = context.al; -} - -void constant(Context &context) { - STACK_CHECK(context); - context._inc(context.es.byte(context.bx+19)); - context.cl = context.es.byte(context.bx+19); - context.ch = 0; - context._add(context.di, context.cx); - context._cmp(context.ds.byte(context.di+18), 255); - if (!context.flags.z()) + 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; - context._sub(context.di, context.cx); - context.cx = 0; - context.es.byte(context.bx+19) = context.cl; + _sub(di, cx); + cx = 0; + es.byte(bx+19) = cl; gotconst: - context.al = context.ds.byte(context.di+18); - context._sub(context.di, context.cx); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; -} - -void doorway(Context &context) { - STACK_CHECK(context); - context.data.byte(kDoorcheck1) = -24; - context.data.byte(kDoorcheck2) = 10; - context.data.byte(kDoorcheck3) = -30; - context.data.byte(kDoorcheck4) = 10; - dodoor(context); -} - -void widedoor(Context &context) { - STACK_CHECK(context); - context.data.byte(kDoorcheck1) = -24; - context.data.byte(kDoorcheck2) = 24; - context.data.byte(kDoorcheck3) = -30; - context.data.byte(kDoorcheck4) = 24; - dodoor(context); -} - -void dodoor(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kRyanx); - context.ah = context.data.byte(kRyany); - context.cl = context.es.byte(context.bx+10); - context.ch = context.es.byte(context.bx+11); - context._cmp(context.al, context.cl); - if (!context.flags.c()) + al = ds.byte(di+18); + _sub(di, cx); + es.byte(bx+15) = al; + ds.byte(di+17) = al; +} + +void DreamGenContext::doorway() { + STACK_CHECK; + data.byte(kDoorcheck1) = -24; + data.byte(kDoorcheck2) = 10; + data.byte(kDoorcheck3) = -30; + data.byte(kDoorcheck4) = 10; + dodoor(); +} + +void DreamGenContext::widedoor() { + STACK_CHECK; + data.byte(kDoorcheck1) = -24; + data.byte(kDoorcheck2) = 24; + data.byte(kDoorcheck3) = -30; + data.byte(kDoorcheck4) = 24; + dodoor(); +} + +void DreamGenContext::dodoor() { + STACK_CHECK; + al = data.byte(kRyanx); + ah = data.byte(kRyany); + cl = es.byte(bx+10); + ch = es.byte(bx+11); + _cmp(al, cl); + if (!flags.c()) goto rtofdoor; - context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(kDoorcheck1)); - if (!context.flags.c()) + _sub(al, cl); + _cmp(al, data.byte(kDoorcheck1)); + if (!flags.c()) goto upordown; goto shutdoor; rtofdoor: - context._sub(context.al, context.cl); - context._cmp(context.al, context.data.byte(kDoorcheck2)); - if (!context.flags.c()) + _sub(al, cl); + _cmp(al, data.byte(kDoorcheck2)); + if (!flags.c()) goto shutdoor; upordown: - context._cmp(context.ah, context.ch); - if (!context.flags.c()) + _cmp(ah, ch); + if (!flags.c()) goto botofdoor; - context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(kDoorcheck3)); - if (context.flags.c()) + _sub(ah, ch); + _cmp(ah, data.byte(kDoorcheck3)); + if (flags.c()) goto shutdoor; goto opendoor; botofdoor: - context._sub(context.ah, context.ch); - context._cmp(context.ah, context.data.byte(kDoorcheck4)); - if (!context.flags.c()) + _sub(ah, ch); + _cmp(ah, data.byte(kDoorcheck4)); + if (!flags.c()) goto shutdoor; opendoor: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.data.byte(kThroughdoor), 1); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(data.byte(kThroughdoor), 1); + if (!flags.z()) goto notthrough; - context._cmp(context.cl, 0); - if (!context.flags.z()) + _cmp(cl, 0); + if (!flags.z()) goto notthrough; - context.cl = 6; + cl = 6; notthrough: - context._inc(context.cl); - context._cmp(context.cl, 1); - if (!context.flags.z()) + _inc(cl); + _cmp(cl, 1); + if (!flags.z()) goto notdoorsound2; - context.al = 0; - context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) + al = 0; + _cmp(data.byte(kReallocation), 5); + if (!flags.z()) goto nothoteldoor2; - context.al = 13; + al = 13; nothoteldoor2: - playchannel1(context); + playchannel1(); notdoorsound2: - context.ch = 0; - context.push(context.di); - context._add(context.di, context.cx); - context.al = context.ds.byte(context.di+18); - context._cmp(context.al, 255); - if (!context.flags.z()) + ch = 0; + push(di); + _add(di, cx); + al = ds.byte(di+18); + _cmp(al, 255); + if (!flags.z()) goto atlast1; - context._dec(context.di); - context._dec(context.cl); + _dec(di); + _dec(cl); atlast1: - context.es.byte(context.bx+19) = context.cl; - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; - context.data.byte(kThroughdoor) = 1; + es.byte(bx+19) = cl; + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; + data.byte(kThroughdoor) = 1; return; shutdoor: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.cl, 5); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(cl, 5); + if (!flags.z()) goto notdoorsound1; - context.al = 1; - context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) + al = 1; + _cmp(data.byte(kReallocation), 5); + if (!flags.z()) goto nothoteldoor1; - context.al = 13; + al = 13; nothoteldoor1: - playchannel1(context); + playchannel1(); notdoorsound1: - context._cmp(context.cl, 0); - if (context.flags.z()) + _cmp(cl, 0); + if (flags.z()) goto atlast2; - context._dec(context.cl); - context.es.byte(context.bx+19) = context.cl; + _dec(cl); + es.byte(bx+19) = cl; atlast2: - context.ch = 0; - context.push(context.di); - context._add(context.di, context.cx); - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; - context._cmp(context.cl, 5); - if (!context.flags.z()) + ch = 0; + push(di); + _add(di, cx); + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; + _cmp(cl, 5); + if (!flags.z()) return /* (notnearly) */; - context.data.byte(kThroughdoor) = 0; + data.byte(kThroughdoor) = 0; } -void lockeddoorway(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kRyanx); - context.ah = context.data.byte(kRyany); - context.cl = context.es.byte(context.bx+10); - context.ch = context.es.byte(context.bx+11); - context._cmp(context.al, context.cl); - if (!context.flags.c()) +void DreamGenContext::lockeddoorway() { + STACK_CHECK; + al = data.byte(kRyanx); + ah = data.byte(kRyany); + cl = es.byte(bx+10); + ch = es.byte(bx+11); + _cmp(al, cl); + if (!flags.c()) goto rtofdoor2; - context._sub(context.al, context.cl); - context._cmp(context.al, -24); - if (!context.flags.c()) + _sub(al, cl); + _cmp(al, -24); + if (!flags.c()) goto upordown2; goto shutdoor2; rtofdoor2: - context._sub(context.al, context.cl); - context._cmp(context.al, 10); - if (!context.flags.c()) + _sub(al, cl); + _cmp(al, 10); + if (!flags.c()) goto shutdoor2; upordown2: - context._cmp(context.ah, context.ch); - if (!context.flags.c()) + _cmp(ah, ch); + if (!flags.c()) goto botofdoor2; - context._sub(context.ah, context.ch); - context._cmp(context.ah, -30); - if (context.flags.c()) + _sub(ah, ch); + _cmp(ah, -30); + if (flags.c()) goto shutdoor2; goto opendoor2; botofdoor2: - context._sub(context.ah, context.ch); - context._cmp(context.ah, 12); - if (!context.flags.c()) + _sub(ah, ch); + _cmp(ah, 12); + if (!flags.c()) goto shutdoor2; opendoor2: - context._cmp(context.data.byte(kThroughdoor), 1); - if (context.flags.z()) + _cmp(data.byte(kThroughdoor), 1); + if (flags.z()) goto mustbeopen; - context._cmp(context.data.byte(kLockstatus), 1); - if (context.flags.z()) + _cmp(data.byte(kLockstatus), 1); + if (flags.z()) goto shutdoor; mustbeopen: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.cl, 1); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(cl, 1); + if (!flags.z()) goto notdoorsound4; - context.al = 0; - playchannel1(context); + al = 0; + playchannel1(); notdoorsound4: - context._cmp(context.cl, 6); - if (!context.flags.z()) + _cmp(cl, 6); + if (!flags.z()) goto noturnonyet; - context.al = context.data.byte(kDoorpath); - context.push(context.es); - context.push(context.bx); - turnpathon(context); - context.bx = context.pop(); - context.es = context.pop(); + al = data.byte(kDoorpath); + push(es); + push(bx); + turnpathon(); + bx = pop(); + es = pop(); noturnonyet: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.data.byte(kThroughdoor), 1); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(data.byte(kThroughdoor), 1); + if (!flags.z()) goto notthrough2; - context._cmp(context.cl, 0); - if (!context.flags.z()) + _cmp(cl, 0); + if (!flags.z()) goto notthrough2; - context.cl = 6; + cl = 6; notthrough2: - context._inc(context.cl); - context.ch = 0; - context.push(context.di); - context._add(context.di, context.cx); - context.al = context.ds.byte(context.di+18); - context._cmp(context.al, 255); - if (!context.flags.z()) + _inc(cl); + ch = 0; + push(di); + _add(di, cx); + al = ds.byte(di+18); + _cmp(al, 255); + if (!flags.z()) goto atlast3; - context._dec(context.di); - context._dec(context.cl); + _dec(di); + _dec(cl); atlast3: - context.es.byte(context.bx+19) = context.cl; - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; - context._cmp(context.cl, 5); - if (!context.flags.z()) + es.byte(bx+19) = cl; + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; + _cmp(cl, 5); + if (!flags.z()) return /* (justshutting) */; - context.data.byte(kThroughdoor) = 1; + data.byte(kThroughdoor) = 1; return; shutdoor2: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.cl, 5); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(cl, 5); + if (!flags.z()) goto notdoorsound3; - context.al = 1; - playchannel1(context); + al = 1; + playchannel1(); notdoorsound3: - context._cmp(context.cl, 0); - if (context.flags.z()) + _cmp(cl, 0); + if (flags.z()) goto atlast4; - context._dec(context.cl); - context.es.byte(context.bx+19) = context.cl; + _dec(cl); + es.byte(bx+19) = cl; atlast4: - context.ch = 0; - context.data.byte(kThroughdoor) = 0; - context.push(context.di); - context._add(context.di, context.cx); - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; - context._cmp(context.cl, 0); - if (!context.flags.z()) + ch = 0; + data.byte(kThroughdoor) = 0; + push(di); + _add(di, cx); + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; + _cmp(cl, 0); + if (!flags.z()) return /* (notlocky) */; - context.al = context.data.byte(kDoorpath); - context.push(context.es); - context.push(context.bx); - turnpathoff(context); - context.bx = context.pop(); - context.es = context.pop(); - context.data.byte(kLockstatus) = 1; + al = data.byte(kDoorpath); + push(es); + push(bx); + turnpathoff(); + bx = pop(); + es = pop(); + data.byte(kLockstatus) = 1; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: - context.cl = context.es.byte(context.bx+19); - context._cmp(context.cl, 5); - if (!context.flags.z()) + cl = es.byte(bx+19); + _cmp(cl, 5); + if (!flags.z()) goto notdoorsound1; - context.al = 1; - context._cmp(context.data.byte(kReallocation), 5); - if (!context.flags.z()) + al = 1; + _cmp(data.byte(kReallocation), 5); + if (!flags.z()) goto nothoteldoor1; - context.al = 13; + al = 13; nothoteldoor1: - playchannel1(context); + playchannel1(); notdoorsound1: - context._cmp(context.cl, 0); - if (context.flags.z()) + _cmp(cl, 0); + if (flags.z()) goto atlast2; - context._dec(context.cl); - context.es.byte(context.bx+19) = context.cl; + _dec(cl); + es.byte(bx+19) = cl; atlast2: - context.ch = 0; - context.push(context.di); - context._add(context.di, context.cx); - context.al = context.ds.byte(context.di+18); - context.di = context.pop(); - context.es.byte(context.bx+15) = context.al; - context.ds.byte(context.di+17) = context.al; - context._cmp(context.cl, 5); - if (!context.flags.z()) + ch = 0; + push(di); + _add(di, cx); + al = ds.byte(di+18); + di = pop(); + es.byte(bx+15) = al; + ds.byte(di+17) = al; + _cmp(cl, 5); + if (!flags.z()) return /* (notnearly) */; - context.data.byte(kThroughdoor) = 0; -} - -void updatepeople(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); - context.data.word(kListpos) = context.di; - context.cx = 12*5; - context.al = 255; - context._stosb(context.cx); - context._inc(context.data.word(kMaintimer)); - context.es = context.cs; - context.bx = 534; - context.di = 991; + data.byte(kThroughdoor) = 0; +} + +void DreamGenContext::updatepeople() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + data.word(kListpos) = di; + cx = 12*5; + al = 255; + _stosb(cx); + _inc(data.word(kMaintimer)); + es = cs; + bx = 534; + di = 991; updateloop: - context.al = context.es.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + al = es.byte(bx); + _cmp(al, 255); + if (flags.z()) return /* (endupdate) */; - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto notinthisroom; - context.cx = context.es.word(context.bx+1); - context._cmp(context.cl, context.data.byte(kMapx)); - if (!context.flags.z()) + cx = es.word(bx+1); + _cmp(cl, data.byte(kMapx)); + if (!flags.z()) goto notinthisroom; - context._cmp(context.ch, context.data.byte(kMapy)); - if (!context.flags.z()) + _cmp(ch, data.byte(kMapy)); + if (!flags.z()) goto notinthisroom; - context.push(context.di); - context.ax = context.cs.word(context.di); - __dispatch_call(context, context.ax); - context.di = context.pop(); + push(di); + ax = cs.word(di); + __dispatch_call(ax); + di = pop(); notinthisroom: - context._add(context.bx, 8); - context._add(context.di, 2); + _add(bx, 8); + _add(di, 2); goto updateloop; } -void getreelframeax(Context &context) { - STACK_CHECK(context); - context.push(context.ds); - context.data.word(kCurrentframe) = context.ax; - findsource(context); - context.es = context.ds; - context.ds = context.pop(); - context.ax = context.data.word(kCurrentframe); - context._sub(context.ax, context.data.word(kTakeoff)); - context._add(context.ax, context.ax); - context.cx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.cx); - context.bx = context.ax; -} - -void reelsonscreen(Context &context) { - STACK_CHECK(context); - reconstruct(context); - updatepeople(context); - watchreel(context); - showrain(context); - usetimedtext(context); -} - -void plotreel(Context &context) { - STACK_CHECK(context); - getreelstart(context); +void DreamGenContext::getreelframeax() { + STACK_CHECK; + push(ds); + data.word(kCurrentframe) = ax; + findsource(); + es = ds; + ds = pop(); + ax = data.word(kCurrentframe); + _sub(ax, data.word(kTakeoff)); + _add(ax, ax); + cx = ax; + _add(ax, ax); + _add(ax, cx); + bx = ax; +} + +void DreamGenContext::reelsonscreen() { + STACK_CHECK; + reconstruct(); + updatepeople(); + watchreel(); + showrain(); + usetimedtext(); +} + +void DreamGenContext::plotreel() { + STACK_CHECK; + getreelstart(); retryreel: - context.push(context.es); - context.push(context.si); - context.ax = context.es.word(context.si+2); - context._cmp(context.al, 220); - if (context.flags.c()) + push(es); + push(si); + ax = es.word(si+2); + _cmp(al, 220); + if (flags.c()) goto normalreel; - context._cmp(context.al, 255); - if (context.flags.z()) + _cmp(al, 255); + if (flags.z()) goto normalreel; - dealwithspecial(context); - context._inc(context.data.word(kReelpointer)); - context.si = context.pop(); - context.es = context.pop(); - context._add(context.si, 40); + dealwithspecial(); + _inc(data.word(kReelpointer)); + si = pop(); + es = pop(); + _add(si, 40); goto retryreel; normalreel: - context.cx = 8; + cx = 8; plotloop: - context.push(context.cx); - context.push(context.es); - context.push(context.si); - context.ax = context.es.word(context.si); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + push(cx); + push(es); + push(si); + ax = es.word(si); + _cmp(ax, 0x0ffff); + if (flags.z()) goto notplot; - showreelframe(context); + showreelframe(); notplot: - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context._add(context.si, 5); - if (--context.cx) + si = pop(); + es = pop(); + cx = pop(); + _add(si, 5); + if (--cx) goto plotloop; - soundonreels(context); - context.bx = context.pop(); - context.es = context.pop(); -} - -void soundonreels(Context &context) { - STACK_CHECK(context); - context.bl = context.data.byte(kReallocation); - context._add(context.bl, context.bl); - context._xor(context.bh, context.bh); - context._add(context.bx, 1214); - context.si = context.cs.word(context.bx); + soundonreels(); + bx = pop(); + es = pop(); +} + +void DreamGenContext::soundonreels() { + STACK_CHECK; + bl = data.byte(kReallocation); + _add(bl, bl); + _xor(bh, bh); + _add(bx, 1214); + si = cs.word(bx); reelsoundloop: - context.al = context.cs.byte(context.si); - context._cmp(context.al, 255); - if (context.flags.z()) + al = cs.byte(si); + _cmp(al, 255); + if (flags.z()) goto endreelsound; - context.ax = context.cs.word(context.si+1); - context._cmp(context.ax, context.data.word(kReelpointer)); - if (!context.flags.z()) + ax = cs.word(si+1); + _cmp(ax, data.word(kReelpointer)); + if (!flags.z()) goto skipreelsound; - context._cmp(context.ax, context.data.word(kLastsoundreel)); - if (context.flags.z()) + _cmp(ax, data.word(kLastsoundreel)); + if (flags.z()) goto skipreelsound; - context.data.word(kLastsoundreel) = context.ax; - context.al = context.cs.byte(context.si); - context._cmp(context.al, 64); - if (context.flags.c()) - { playchannel1(context); return; }; - context._cmp(context.al, 128); - if (context.flags.c()) + data.word(kLastsoundreel) = ax; + al = cs.byte(si); + _cmp(al, 64); + if (flags.c()) + { playchannel1(); return; }; + _cmp(al, 128); + if (flags.c()) goto channel0once; - context._and(context.al, 63); - context.ah = 255; - { playchannel0(context); return; }; + _and(al, 63); + ah = 255; + { playchannel0(); return; }; channel0once: - context._and(context.al, 63); - context.ah = 0; - { playchannel0(context); return; }; + _and(al, 63); + ah = 0; + { playchannel0(); return; }; skipreelsound: - context._add(context.si, 3); + _add(si, 3); goto reelsoundloop; endreelsound: - context.ax = context.data.word(kLastsoundreel); - context._cmp(context.ax, context.data.word(kReelpointer)); - if (context.flags.z()) + ax = data.word(kLastsoundreel); + _cmp(ax, data.word(kReelpointer)); + if (flags.z()) return /* (nochange2) */; - context.data.word(kLastsoundreel) = -1; + data.word(kLastsoundreel) = -1; } -void reconstruct(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kHavedoneobs), 0); - if (context.flags.z()) +void DreamGenContext::reconstruct() { + STACK_CHECK; + _cmp(data.byte(kHavedoneobs), 0); + if (flags.z()) return /* (noneedtorecon) */; - context.data.byte(kNewobs) = 1; - drawfloor(context); - spriteupdate(context); - printsprites(context); - context.data.byte(kHavedoneobs) = 0; -} - -void dealwithspecial(Context &context) { - STACK_CHECK(context); - context._sub(context.al, 220); - context._cmp(context.al, 0); - if (!context.flags.z()) + data.byte(kNewobs) = 1; + drawfloor(); + spriteupdate(); + printsprites(); + data.byte(kHavedoneobs) = 0; +} + +void DreamGenContext::dealwithspecial() { + STACK_CHECK; + _sub(al, 220); + _cmp(al, 0); + if (!flags.z()) goto notplset; - context.al = context.ah; - placesetobject(context); - context.data.byte(kHavedoneobs) = 1; + al = ah; + placesetobject(); + data.byte(kHavedoneobs) = 1; return; notplset: - context._cmp(context.al, 1); - if (!context.flags.z()) + _cmp(al, 1); + if (!flags.z()) goto notremset; - context.al = context.ah; - removesetobject(context); - context.data.byte(kHavedoneobs) = 1; + al = ah; + removesetobject(); + data.byte(kHavedoneobs) = 1; return; notremset: - context._cmp(context.al, 2); - if (!context.flags.z()) + _cmp(al, 2); + if (!flags.z()) goto notplfree; - context.al = context.ah; - placefreeobject(context); - context.data.byte(kHavedoneobs) = 1; + al = ah; + placefreeobject(); + data.byte(kHavedoneobs) = 1; return; notplfree: - context._cmp(context.al, 3); - if (!context.flags.z()) + _cmp(al, 3); + if (!flags.z()) goto notremfree; - context.al = context.ah; - removefreeobject(context); - context.data.byte(kHavedoneobs) = 1; + al = ah; + removefreeobject(); + data.byte(kHavedoneobs) = 1; return; notremfree: - context._cmp(context.al, 4); - if (!context.flags.z()) + _cmp(al, 4); + if (!flags.z()) goto notryanoff; - switchryanoff(context); + switchryanoff(); return; notryanoff: - context._cmp(context.al, 5); - if (!context.flags.z()) + _cmp(al, 5); + if (!flags.z()) goto notryanon; - context.data.byte(kTurntoface) = context.ah; - context.data.byte(kFacing) = context.ah; - switchryanon(context); + data.byte(kTurntoface) = ah; + data.byte(kFacing) = ah; + switchryanon(); return; notryanon: - context._cmp(context.al, 6); - if (!context.flags.z()) + _cmp(al, 6); + if (!flags.z()) goto notchangeloc; - context.data.byte(kNewlocation) = context.ah; + data.byte(kNewlocation) = ah; return; notchangeloc: - movemap(context); + movemap(); } -void movemap(Context &context) { - STACK_CHECK(context); - context._cmp(context.ah, 32); - if (!context.flags.z()) +void DreamGenContext::movemap() { + STACK_CHECK; + _cmp(ah, 32); + if (!flags.z()) goto notmapup2; - context._sub(context.data.byte(kMapy), 20); - context.data.byte(kNowinnewroom) = 1; + _sub(data.byte(kMapy), 20); + data.byte(kNowinnewroom) = 1; return; notmapup2: - context._cmp(context.ah, 16); - if (!context.flags.z()) + _cmp(ah, 16); + if (!flags.z()) goto notmapupspec; - context._sub(context.data.byte(kMapy), 10); - context.data.byte(kNowinnewroom) = 1; + _sub(data.byte(kMapy), 10); + data.byte(kNowinnewroom) = 1; return; notmapupspec: - context._cmp(context.ah, 8); - if (!context.flags.z()) + _cmp(ah, 8); + if (!flags.z()) goto notmapdownspec; - context._add(context.data.byte(kMapy), 10); - context.data.byte(kNowinnewroom) = 1; + _add(data.byte(kMapy), 10); + data.byte(kNowinnewroom) = 1; return; notmapdownspec: - context._cmp(context.ah, 2); - if (!context.flags.z()) + _cmp(ah, 2); + if (!flags.z()) goto notmaprightspec; - context._add(context.data.byte(kMapx), 11); - context.data.byte(kNowinnewroom) = 1; + _add(data.byte(kMapx), 11); + data.byte(kNowinnewroom) = 1; return; notmaprightspec: - context._sub(context.data.byte(kMapx), 11); - context.data.byte(kNowinnewroom) = 1; -} - -void getreelstart(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kReelpointer); - context.cx = 40; - context._mul(context.cx); - context.es = context.data.word(kReels); - context.si = context.ax; - context._add(context.si, (0+(36*144))); -} - -void showreelframe(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.si+2); - context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(kMapadx)); - context.al = context.es.byte(context.si+3); - context.bx = context.ax; - context._add(context.bx, context.data.word(kMapady)); - context.ax = context.es.word(context.si); - context.data.word(kCurrentframe) = context.ax; - findsource(context); - context.ax = context.data.word(kCurrentframe); - context._sub(context.ax, context.data.word(kTakeoff)); - context.ah = 8; - showframe(context); -} - -void deleverything(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kMapysize); - context.ah = 0; - context._add(context.ax, context.data.word(kMapoffsety)); - context._cmp(context.ax, 182); - if (!context.flags.c()) + _sub(data.byte(kMapx), 11); + data.byte(kNowinnewroom) = 1; +} + +void DreamGenContext::getreelstart() { + STACK_CHECK; + ax = data.word(kReelpointer); + cx = 40; + _mul(cx); + es = data.word(kReels); + si = ax; + _add(si, (0+(36*144))); +} + +void DreamGenContext::showreelframe() { + STACK_CHECK; + al = es.byte(si+2); + ah = 0; + di = ax; + _add(di, data.word(kMapadx)); + al = es.byte(si+3); + bx = ax; + _add(bx, data.word(kMapady)); + ax = es.word(si); + data.word(kCurrentframe) = ax; + findsource(); + ax = data.word(kCurrentframe); + _sub(ax, data.word(kTakeoff)); + ah = 8; + showframe(); +} + +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(context); + maptopanel(); return; bigroom: - context._sub(context.data.byte(kMapysize), 8); - maptopanel(context); - context._add(context.data.byte(kMapysize), 8); + _sub(data.byte(kMapysize), 8); + maptopanel(); + _add(data.byte(kMapysize), 8); } -void dumpeverything(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); +void DreamGenContext::dumpeverything() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); dumpevery1: - context.ax = context.es.word(context.bx); - context.cx = context.es.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + ax = es.word(bx); + cx = es.word(bx+2); + _cmp(ax, 0x0ffff); + if (flags.z()) goto finishevery1; - context._cmp(context.ax, context.es.word(context.bx+(40*5))); - if (!context.flags.z()) + _cmp(ax, es.word(bx+(40*5))); + if (!flags.z()) goto notskip1; - context._cmp(context.cx, context.es.word(context.bx+(40*5)+2)); - if (context.flags.z()) + _cmp(cx, es.word(bx+(40*5)+2)); + if (flags.z()) goto skip1; notskip1: - context.push(context.bx); - context.push(context.es); - context.push(context.ds); - context.bl = context.ah; - context.bh = 0; - context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(kMapadx)); - context._add(context.bx, context.data.word(kMapady)); - multidump(context); - context.ds = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); + push(bx); + push(es); + push(ds); + bl = ah; + bh = 0; + ah = 0; + di = ax; + _add(di, data.word(kMapadx)); + _add(bx, data.word(kMapady)); + multidump(); + ds = pop(); + es = pop(); + bx = pop(); skip1: - context._add(context.bx, 5); + _add(bx, 5); goto dumpevery1; finishevery1: - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5); dumpevery2: - context.ax = context.es.word(context.bx); - context.cx = context.es.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + ax = es.word(bx); + cx = es.word(bx+2); + _cmp(ax, 0x0ffff); + if (flags.z()) return /* (finishevery2) */; - context.push(context.bx); - context.push(context.es); - context.push(context.ds); - context.bl = context.ah; - context.bh = 0; - context.ah = 0; - context.di = context.ax; - context._add(context.di, context.data.word(kMapadx)); - context._add(context.bx, context.data.word(kMapady)); - multidump(context); - context.ds = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 5); + push(bx); + push(es); + push(ds); + bl = ah; + bh = 0; + ah = 0; + di = ax; + _add(di, data.word(kMapadx)); + _add(bx, data.word(kMapady)); + multidump(); + ds = pop(); + es = pop(); + bx = pop(); + _add(bx, 5); goto dumpevery2; } -void allocatework(Context &context) { - STACK_CHECK(context); - context.bx = 0x1000; - allocatemem(context); - context.data.word(kWorkspace) = context.ax; +void DreamGenContext::allocatework() { + STACK_CHECK; + bx = 0x1000; + allocatemem(); + data.word(kWorkspace) = ax; } -void readabyte(Context &context) { - STACK_CHECK(context); - context._cmp(context.si, 30000); - if (!context.flags.z()) +void DreamGenContext::readabyte() { + STACK_CHECK; + _cmp(si, 30000); + if (!flags.z()) goto notendblock; - context.push(context.bx); - context.push(context.es); - context.push(context.di); - context.push(context.ds); - context.push(context.si); - readoneblock(context); - context.si = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context.si = 0; + push(bx); + push(es); + push(di); + push(ds); + push(si); + readoneblock(); + si = pop(); + ds = pop(); + di = pop(); + es = pop(); + bx = pop(); + si = 0; notendblock: - context._lodsb(); -} - -void loadpalfromiff(Context &context) { - STACK_CHECK(context); - context.dx = 2481; - openfile(context); - context.cx = 2000; - context.ds = context.data.word(kMapstore); - context.dx = 0; - readfromfile(context); - closefile(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - context.ds = context.data.word(kMapstore); - context.si = 0x30; - context.cx = 768; + _lodsb(); +} + +void DreamGenContext::loadpalfromiff() { + STACK_CHECK; + dx = 2481; + openfile(); + cx = 2000; + ds = data.word(kMapstore); + dx = 0; + readfromfile(); + closefile(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + ds = data.word(kMapstore); + si = 0x30; + cx = 768; palloop: - context._lodsb(); - context._shr(context.al, 1); - context._shr(context.al, 1); - context._cmp(context.data.byte(kBrightness), 1); - if (!context.flags.z()) + _lodsb(); + _shr(al, 1); + _shr(al, 1); + _cmp(data.byte(kBrightness), 1); + if (!flags.z()) goto nought; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto nought; - context.ah = context.al; - context._shr(context.ah, 1); - context._add(context.al, context.ah); - context._shr(context.ah, 1); - context._add(context.al, context.ah); - context._cmp(context.al, 64); - if (context.flags.c()) + ah = al; + _shr(ah, 1); + _add(al, ah); + _shr(ah, 1); + _add(al, ah); + _cmp(al, 64); + if (flags.c()) goto nought; - context.al = 63; + al = 63; nought: - context._stosb(); - if (--context.cx) + _stosb(); + if (--cx) goto palloop; } -void paneltomap(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kMapxstart); - context._add(context.di, context.data.word(kMapadx)); - context.bx = context.data.word(kMapystart); - context._add(context.bx, context.data.word(kMapady)); - context.ds = context.data.word(kMapstore); - context.si = 0; - context.cl = context.data.byte(kMapxsize); - context.ch = context.data.byte(kMapysize); - multiget(context); -} - -void maptopanel(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kMapxstart); - context._add(context.di, context.data.word(kMapadx)); - context.bx = context.data.word(kMapystart); - context._add(context.bx, context.data.word(kMapady)); - context.ds = context.data.word(kMapstore); - context.si = 0; - context.cl = context.data.byte(kMapxsize); - context.ch = context.data.byte(kMapysize); - multiput(context); -} - -void dumpmap(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kMapxstart); - context._add(context.di, context.data.word(kMapadx)); - context.bx = context.data.word(kMapystart); - context._add(context.bx, context.data.word(kMapady)); - context.cl = context.data.byte(kMapxsize); - context.ch = context.data.byte(kMapysize); - multidump(context); -} - -void pixelcheckset(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context._sub(context.al, context.es.byte(context.bx)); - context._sub(context.ah, context.es.byte(context.bx+1)); - context.push(context.es); - context.push(context.bx); - context.push(context.cx); - context.push(context.ax); - context.al = context.es.byte(context.bx+4); - getsetad(context); - context.al = context.es.byte(context.bx+17); - context.es = context.data.word(kSetframes); - context.bx = (0); - context.ah = 0; - context.cx = 6; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context.cl = context.es.byte(context.bx); - context.ch = 0; - context._mul(context.cx); - context.cx = context.pop(); - context.ch = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.es.word(context.bx+2)); - context.bx = context.ax; - context._add(context.bx, (0+2080)); - context.al = context.es.byte(context.bx); - context.dl = context.al; - context.cx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.ax = context.pop(); - context._cmp(context.dl, 0); -} - -void createpanel(Context &context) { - STACK_CHECK(context); - context.di = 0; - context.bx = 8; - context.ds = context.data.word(kIcons2); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 8; - context.ds = context.data.word(kIcons2); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 0; - context.bx = 104; - context.ds = context.data.word(kIcons2); - context.al = 0; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 104; - context.ds = context.data.word(kIcons2); - context.al = 0; - context.ah = 2; - showframe(context); -} - -void createpanel2(Context &context) { - STACK_CHECK(context); - createpanel(context); - context.di = 0; - context.bx = 0; - context.ds = context.data.word(kIcons2); - context.al = 5; - context.ah = 2; - showframe(context); - context.di = 160; - context.bx = 0; - context.ds = context.data.word(kIcons2); - context.al = 5; - context.ah = 2; - showframe(context); -} - -void clearwork(Context &context) { - STACK_CHECK(context); - context.ax = 0x0; - context.es = context.data.word(kWorkspace); - context.di = 0; - context.cx = (200*320)/64; +void DreamGenContext::paneltomap() { + STACK_CHECK; + di = data.word(kMapxstart); + _add(di, data.word(kMapadx)); + bx = data.word(kMapystart); + _add(bx, data.word(kMapady)); + ds = data.word(kMapstore); + si = 0; + cl = data.byte(kMapxsize); + ch = data.byte(kMapysize); + multiget(); +} + +void DreamGenContext::maptopanel() { + STACK_CHECK; + di = data.word(kMapxstart); + _add(di, data.word(kMapadx)); + bx = data.word(kMapystart); + _add(bx, data.word(kMapady)); + ds = data.word(kMapstore); + si = 0; + cl = data.byte(kMapxsize); + ch = data.byte(kMapysize); + multiput(); +} + +void DreamGenContext::dumpmap() { + STACK_CHECK; + di = data.word(kMapxstart); + _add(di, data.word(kMapadx)); + bx = data.word(kMapystart); + _add(bx, data.word(kMapady)); + cl = data.byte(kMapxsize); + ch = data.byte(kMapysize); + multidump(); +} + +void DreamGenContext::pixelcheckset() { + STACK_CHECK; + push(ax); + _sub(al, es.byte(bx)); + _sub(ah, es.byte(bx+1)); + push(es); + push(bx); + push(cx); + push(ax); + al = es.byte(bx+4); + getsetad(); + al = es.byte(bx+17); + es = data.word(kSetframes); + bx = (0); + ah = 0; + cx = 6; + _mul(cx); + _add(bx, ax); + ax = pop(); + push(ax); + al = ah; + ah = 0; + cl = es.byte(bx); + ch = 0; + _mul(cx); + cx = pop(); + ch = 0; + _add(ax, cx); + _add(ax, es.word(bx+2)); + bx = ax; + _add(bx, (0+2080)); + al = es.byte(bx); + dl = al; + cx = pop(); + bx = pop(); + es = pop(); + ax = pop(); + _cmp(dl, 0); +} + +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(); +} + +void DreamGenContext::clearwork() { + STACK_CHECK; + ax = 0x0; + es = data.word(kWorkspace); + di = 0; + cx = (200*320)/64; clearloop: - context._stosw(32); - if (--context.cx) + _stosw(32); + if (--cx) goto clearloop; } -void zoom(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) +void DreamGenContext::zoom() { + STACK_CHECK; + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) return /* (inwatching) */; - context._cmp(context.data.byte(kZoomon), 1); - if (context.flags.z()) + _cmp(data.byte(kZoomon), 1); + if (flags.z()) goto zoomswitch; return; zoomswitch: - context._cmp(context.data.byte(kCommandtype), 199); - if (context.flags.c()) + _cmp(data.byte(kCommandtype), 199); + if (flags.c()) goto zoomit; - putunderzoom(context); + putunderzoom(); return; zoomit: - context.ax = context.data.word(kOldpointery); - context._sub(context.ax, 9); - context.cx = (320); - context._mul(context.cx); - context._add(context.ax, context.data.word(kOldpointerx)); - context._sub(context.ax, 11); - context.si = context.ax; - context.ax = (132)+4; - context.cx = (320); - context._mul(context.cx); - context._add(context.ax, (8)+5); - context.di = context.ax; - context.es = context.data.word(kWorkspace); - context.ds = context.data.word(kWorkspace); - context.cx = 20; + ax = data.word(kOldpointery); + _sub(ax, 9); + cx = (320); + _mul(cx); + _add(ax, data.word(kOldpointerx)); + _sub(ax, 11); + si = ax; + ax = (132)+4; + cx = (320); + _mul(cx); + _add(ax, (8)+5); + di = ax; + es = data.word(kWorkspace); + ds = data.word(kWorkspace); + cx = 20; zoomloop: - context.push(context.cx); - context.cx = 23; + push(cx); + cx = 23; zoomloop2: - context._lodsb(); - context.ah = context.al; - context._stosw(); - context.es.word(context.di+(320)-2) = context.ax; - if (--context.cx) + _lodsb(); + ah = al; + _stosw(); + es.word(di+(320)-2) = ax; + if (--cx) goto zoomloop2; - context._add(context.si, (320)-23); - context._add(context.di, (320)-46+(320)); - context.cx = context.pop(); - if (--context.cx) + _add(si, (320)-23); + _add(di, (320)-46+(320)); + cx = pop(); + if (--cx) goto zoomloop; - crosshair(context); - context.data.byte(kDidzoom) = 1; -} - -void delthisone(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, context.data.word(kMapady)); - context.bx = (320); - context._mul(context.bx); - context.bx = context.pop(); - context.bh = 0; - context._add(context.bx, context.data.word(kMapadx)); - context._add(context.ax, context.bx); - context.di = context.ax; - context.ax = context.pop(); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context.bx = 22*8; - context._mul(context.bx); - context.bx = context.pop(); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = context.ax; - context.es = context.data.word(kWorkspace); - context.ds = context.data.word(kMapstore); - context.dl = context.cl; - context.dh = 0; - context.ax = (320); - context._sub(context.ax, context.dx); - context._neg(context.dx); - context._add(context.dx, 22*8); + crosshair(); + data.byte(kDidzoom) = 1; +} + +void DreamGenContext::delthisone() { + STACK_CHECK; + push(ax); + push(ax); + al = ah; + ah = 0; + _add(ax, data.word(kMapady)); + bx = (320); + _mul(bx); + bx = pop(); + bh = 0; + _add(bx, data.word(kMapadx)); + _add(ax, bx); + di = ax; + ax = pop(); + push(ax); + al = ah; + ah = 0; + bx = 22*8; + _mul(bx); + bx = pop(); + bh = 0; + _add(ax, bx); + si = ax; + es = data.word(kWorkspace); + ds = data.word(kMapstore); + dl = cl; + dh = 0; + ax = (320); + _sub(ax, dx); + _neg(dx); + _add(dx, 22*8); deloneloop: - context.push(context.cx); - context.ch = 0; - context._movsb(context.cx); - context.cx = context.pop(); - context._add(context.di, context.ax); - context._add(context.si, context.dx); - context._dec(context.ch); - if (!context.flags.z()) + push(cx); + ch = 0; + _movsb(cx); + cx = pop(); + _add(di, ax); + _add(si, dx); + _dec(ch); + if (!flags.z()) goto deloneloop; } -void doblocks(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kWorkspace); - context.ax = context.data.word(kMapady); - context.cx = (320); - context._mul(context.cx); - context.di = context.data.word(kMapadx); - context._add(context.di, context.ax); - context.al = context.data.byte(kMapy); - context.ah = 0; - context.bx = (66); - context._mul(context.bx); - context.bl = context.data.byte(kMapx); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = (0); - context._add(context.si, context.ax); - context.cx = 10; +void DreamGenContext::doblocks() { + STACK_CHECK; + es = data.word(kWorkspace); + ax = data.word(kMapady); + cx = (320); + _mul(cx); + di = data.word(kMapadx); + _add(di, ax); + al = data.byte(kMapy); + ah = 0; + bx = (66); + _mul(bx); + bl = data.byte(kMapx); + bh = 0; + _add(ax, bx); + si = (0); + _add(si, ax); + cx = 10; loop120: - context.push(context.di); - context.push(context.cx); - context.cx = 11; + push(di); + push(cx); + cx = 11; loop124: - context.push(context.cx); - context.push(context.di); - context.ds = context.data.word(kMapdata); - context._lodsb(); - context.ds = context.data.word(kBackdrop); - context.push(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + push(cx); + push(di); + ds = data.word(kMapdata); + _lodsb(); + ds = data.word(kBackdrop); + push(si); + _cmp(al, 0); + if (flags.z()) goto zeroblock; - context.ah = context.al; - context.al = 0; - context.si = (0+192); - context._add(context.si, context.ax); - context.bh = 14; - context.bh = 4; + ah = al; + al = 0; + si = (0+192); + _add(si, ax); + bh = 14; + bh = 4; firstbitofblock: - context._movsw(8); - context._add(context.di, (320)-16); - context._dec(context.bh); - if (!context.flags.z()) + _movsw(8); + _add(di, (320)-16); + _dec(bh); + if (!flags.z()) goto firstbitofblock; - context.bh = 12; + bh = 12; loop125: - context._movsw(8); - context.ax = 0x0dfdf; - context._stosw(2); - context._add(context.di, (320)-20); - context._dec(context.bh); - if (!context.flags.z()) + _movsw(8); + ax = 0x0dfdf; + _stosw(2); + _add(di, (320)-20); + _dec(bh); + if (!flags.z()) goto loop125; - context._add(context.di, 4); - context.ax = 0x0dfdf; - context._stosw(8); - context._add(context.di, (320)-16); - context._stosw(8); - context._add(context.di, (320)-16); - context._stosw(8); - context._add(context.di, (320)-16); - context._stosw(8); + _add(di, 4); + ax = 0x0dfdf; + _stosw(8); + _add(di, (320)-16); + _stosw(8); + _add(di, (320)-16); + _stosw(8); + _add(di, (320)-16); + _stosw(8); zeroblock: - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, 16); - if (--context.cx) + si = pop(); + di = pop(); + cx = pop(); + _add(di, 16); + if (--cx) goto loop124; - context._add(context.si, (66)-11); - context.cx = context.pop(); - context.di = context.pop(); - context._add(context.di, (320)*16); - if (--context.cx) + _add(si, (66)-11); + cx = pop(); + di = pop(); + _add(di, (320)*16); + if (--cx) goto loop120; } -void showframe(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.push(context.ax); - context.cx = context.ax; - context._and(context.cx, 511); - context._add(context.cx, context.cx); - context.si = context.cx; - context._add(context.cx, context.cx); - context._add(context.si, context.cx); - context._cmp(context.ds.word(context.si), 0); - if (!context.flags.z()) +void DreamGenContext::showframe() { + STACK_CHECK; + push(dx); + push(ax); + cx = ax; + _and(cx, 511); + _add(cx, cx); + si = cx; + _add(cx, cx); + _add(si, cx); + _cmp(ds.word(si), 0); + if (!flags.z()) goto notblankshow; - context.ax = context.pop(); - context.dx = context.pop(); - context.cx = 0; + ax = pop(); + dx = pop(); + cx = 0; return; notblankshow: - context._test(context.ah, 128); - if (!context.flags.z()) + _test(ah, 128); + if (!flags.z()) goto skipoffsets; - context.al = context.ds.byte(context.si+4); - context.ah = 0; - context._add(context.di, context.ax); - context.al = context.ds.byte(context.si+5); - context.ah = 0; - context._add(context.bx, context.ax); + al = ds.byte(si+4); + ah = 0; + _add(di, ax); + al = ds.byte(si+5); + ah = 0; + _add(bx, ax); skipoffsets: - context.cx = context.ds.word(context.si+0); - context.ax = context.ds.word(context.si+2); - context._add(context.ax, 2080); - context.si = context.ax; - context.ax = context.pop(); - context.dx = context.pop(); - context._cmp(context.ah, 0); - if (context.flags.z()) + cx = ds.word(si+0); + ax = ds.word(si+2); + _add(ax, 2080); + si = ax; + ax = pop(); + dx = pop(); + _cmp(ah, 0); + if (flags.z()) goto noeffects; - context._test(context.ah, 128); - if (context.flags.z()) + _test(ah, 128); + if (flags.z()) goto notcentred; - context.push(context.ax); - context.al = context.cl; - context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.di, context.ax); - context.al = context.ch; - context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.bx, context.ax); - context.ax = context.pop(); + push(ax); + al = cl; + ah = 0; + _shr(ax, 1); + _sub(di, ax); + al = ch; + ah = 0; + _shr(ax, 1); + _sub(bx, ax); + ax = pop(); notcentred: - context._test(context.ah, 64); - if (context.flags.z()) + _test(ah, 64); + if (flags.z()) goto notdiffdest; - context.push(context.cx); - frameoutfx(context); - context.cx = context.pop(); + push(cx); + frameoutfx(); + cx = pop(); return; notdiffdest: - context._test(context.ah, 8); - if (context.flags.z()) + _test(ah, 8); + if (flags.z()) goto notprintlist; - context.push(context.ax); - context.ax = context.di; - context._sub(context.ax, context.data.word(kMapadx)); - context.push(context.bx); - context._sub(context.bx, context.data.word(kMapady)); - context.ah = context.bl; - context.bx = context.pop(); - context.ax = context.pop(); + push(ax); + ax = di; + _sub(ax, data.word(kMapadx)); + push(bx); + _sub(bx, data.word(kMapady)); + ah = bl; + bx = pop(); + ax = pop(); notprintlist: - context._test(context.ah, 4); - if (context.flags.z()) + _test(ah, 4); + if (flags.z()) goto notflippedx; - context.dx = (320); - context.es = context.data.word(kWorkspace); - context.push(context.cx); - frameoutfx(context); - context.cx = context.pop(); + dx = (320); + es = data.word(kWorkspace); + push(cx); + frameoutfx(); + cx = pop(); return; notflippedx: - context._test(context.ah, 2); - if (context.flags.z()) + _test(ah, 2); + if (flags.z()) goto notnomask; - context.dx = (320); - context.es = context.data.word(kWorkspace); - context.push(context.cx); - frameoutnm(context); - context.cx = context.pop(); + dx = (320); + es = data.word(kWorkspace); + push(cx); + frameoutnm(); + cx = pop(); return; notnomask: - context._test(context.ah, 32); - if (context.flags.z()) + _test(ah, 32); + if (flags.z()) goto noeffects; - context.dx = (320); - context.es = context.data.word(kWorkspace); - context.push(context.cx); - frameoutbh(context); - context.cx = context.pop(); + dx = (320); + es = data.word(kWorkspace); + push(cx); + frameoutbh(); + cx = pop(); return; noeffects: - context.dx = (320); - context.es = context.data.word(kWorkspace); - context.push(context.cx); - frameoutv(context); - context.cx = context.pop(); -} - -void frameoutv(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); - context.cx = context.pop(); + dx = (320); + es = data.word(kWorkspace); + push(cx); + frameoutv(); + cx = pop(); +} + +void DreamGenContext::frameoutv() { + STACK_CHECK; + push(dx); + ax = bx; + bx = dx; + _mul(bx); + _add(di, ax); + dx = pop(); + push(cx); + ch = 0; + _sub(dx, cx); + cx = pop(); frameloop1: - context.push(context.cx); - context.ch = 0; + push(cx); + ch = 0; frameloop2: - context._lodsb(); - context._cmp(context.al, 0); - if (!context.flags.z()) + _lodsb(); + _cmp(al, 0); + if (!flags.z()) goto backtosolid; backtoother: - context._inc(context.di); - if (--context.cx) + _inc(di); + if (--cx) goto frameloop2; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._dec(context.ch); - if (!context.flags.z()) + cx = pop(); + _add(di, dx); + _dec(ch); + if (!flags.z()) goto frameloop1; return; frameloop3: - context._lodsb(); - context._cmp(context.al, 0); - if (context.flags.z()) + _lodsb(); + _cmp(al, 0); + if (flags.z()) goto backtoother; backtosolid: - context._stosb(); - if (--context.cx) + _stosb(); + if (--cx) goto frameloop3; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._dec(context.ch); - if (!context.flags.z()) + cx = pop(); + _add(di, dx); + _dec(ch); + if (!flags.z()) goto frameloop1; } -void frameoutbh(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._sub(context.dx, context.cx); - context.cx = context.pop(); +void DreamGenContext::frameoutbh() { + STACK_CHECK; + push(dx); + ax = bx; + bx = dx; + _mul(bx); + _add(di, ax); + dx = pop(); + push(cx); + ch = 0; + _sub(dx, cx); + cx = pop(); bhloop2: - context.push(context.cx); - context.ch = 0; - context.ah = 255; + push(cx); + ch = 0; + ah = 255; bhloop1: - context._cmp(context.es.byte(context.di), context.ah); - if (!context.flags.z()) + _cmp(es.byte(di), ah); + if (!flags.z()) goto nofill; - context._movsb(); - if (--context.cx) + _movsb(); + if (--cx) goto bhloop1; goto nextline; nofill: - context._inc(context.di); - context._inc(context.si); - if (--context.cx) + _inc(di); + _inc(si); + if (--cx) goto bhloop1; nextline: - context._add(context.di, context.dx); - context.cx = context.pop(); - context._dec(context.ch); - if (!context.flags.z()) + _add(di, dx); + cx = pop(); + _dec(ch); + if (!flags.z()) goto bhloop2; } -void frameoutfx(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.ax = context.bx; - context.bx = context.dx; - context._mul(context.bx); - context._add(context.di, context.ax); - context.dx = context.pop(); - context.push(context.cx); - context.ch = 0; - context._add(context.dx, context.cx); - context.cx = context.pop(); +void DreamGenContext::frameoutfx() { + STACK_CHECK; + push(dx); + ax = bx; + bx = dx; + _mul(bx); + _add(di, ax); + dx = pop(); + push(cx); + ch = 0; + _add(dx, cx); + cx = pop(); frameloopfx1: - context.push(context.cx); - context.ch = 0; + push(cx); + ch = 0; frameloopfx2: - context._lodsb(); - context._cmp(context.al, 0); - if (!context.flags.z()) + _lodsb(); + _cmp(al, 0); + if (!flags.z()) goto backtosolidfx; backtootherfx: - context._dec(context.di); - if (--context.cx) + _dec(di); + if (--cx) goto frameloopfx2; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._dec(context.ch); - if (!context.flags.z()) + cx = pop(); + _add(di, dx); + _dec(ch); + if (!flags.z()) goto frameloopfx1; return; frameloopfx3: - context._lodsb(); - context._cmp(context.al, 0); - if (context.flags.z()) + _lodsb(); + _cmp(al, 0); + if (flags.z()) goto backtootherfx; backtosolidfx: - context.es.byte(context.di) = context.al; - context._dec(context.di); - if (--context.cx) + es.byte(di) = al; + _dec(di); + if (--cx) goto frameloopfx3; - context.cx = context.pop(); - context._add(context.di, context.dx); - context._dec(context.ch); - if (!context.flags.z()) + cx = pop(); + _add(di, dx); + _dec(ch); + if (!flags.z()) goto frameloopfx1; } -void transferinv(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kExframepos); - context.push(context.di); - context.al = context.data.byte(kExpos); - context.ah = 0; - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context._inc(context.ax); - context.cx = 6; - context._mul(context.cx); - context.es = context.data.word(kExtras); - context.bx = (0); - context._add(context.bx, context.ax); - context._add(context.di, (0+2080)); - context.push(context.bx); - context.al = context.data.byte(kItemtotran); - context.ah = 0; - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context._inc(context.ax); - context.cx = 6; - context._mul(context.cx); - context.ds = context.data.word(kFreeframes); - context.bx = (0); - context._add(context.bx, context.ax); - context.si = (0+2080); - context.al = context.ds.byte(context.bx); - context.ah = 0; - context.cl = context.ds.byte(context.bx+1); - context.ch = 0; - context._add(context.si, context.ds.word(context.bx+2)); - context.dx = context.ds.word(context.bx+4); - context.bx = context.pop(); - context.es.byte(context.bx+0) = context.al; - context.es.byte(context.bx+1) = context.cl; - context.es.word(context.bx+4) = context.dx; - context._mul(context.cx); - context.cx = context.ax; - context.push(context.cx); - context._movsb(context.cx); - context.cx = context.pop(); - context.ax = context.pop(); - context.es.word(context.bx+2) = context.ax; - context._add(context.data.word(kExframepos), context.cx); -} - -void transfermap(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kExframepos); - context.push(context.di); - context.al = context.data.byte(kExpos); - context.ah = 0; - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context.cx = 6; - context._mul(context.cx); - context.es = context.data.word(kExtras); - context.bx = (0); - context._add(context.bx, context.ax); - context._add(context.di, (0+2080)); - context.push(context.bx); - context.al = context.data.byte(kItemtotran); - context.ah = 0; - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.bx); - context.cx = 6; - context._mul(context.cx); - context.ds = context.data.word(kFreeframes); - context.bx = (0); - context._add(context.bx, context.ax); - context.si = (0+2080); - context.al = context.ds.byte(context.bx); - context.ah = 0; - context.cl = context.ds.byte(context.bx+1); - context.ch = 0; - context._add(context.si, context.ds.word(context.bx+2)); - context.dx = context.ds.word(context.bx+4); - context.bx = context.pop(); - context.es.byte(context.bx+0) = context.al; - context.es.byte(context.bx+1) = context.cl; - context.es.word(context.bx+4) = context.dx; - context._mul(context.cx); - context.cx = context.ax; - context.push(context.cx); - context._movsb(context.cx); - context.cx = context.pop(); - context.ax = context.pop(); - context.es.word(context.bx+2) = context.ax; - context._add(context.data.word(kExframepos), context.cx); -} - -void dofade(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kFadedirection), 0); - if (context.flags.z()) +void DreamGenContext::transferinv() { + STACK_CHECK; + di = data.word(kExframepos); + push(di); + al = data.byte(kExpos); + ah = 0; + bx = ax; + _add(ax, ax); + _add(ax, bx); + _inc(ax); + cx = 6; + _mul(cx); + es = data.word(kExtras); + bx = (0); + _add(bx, ax); + _add(di, (0+2080)); + push(bx); + al = data.byte(kItemtotran); + ah = 0; + bx = ax; + _add(ax, ax); + _add(ax, bx); + _inc(ax); + cx = 6; + _mul(cx); + ds = data.word(kFreeframes); + bx = (0); + _add(bx, ax); + si = (0+2080); + al = ds.byte(bx); + ah = 0; + cl = ds.byte(bx+1); + ch = 0; + _add(si, ds.word(bx+2)); + dx = ds.word(bx+4); + bx = pop(); + es.byte(bx+0) = al; + es.byte(bx+1) = cl; + es.word(bx+4) = dx; + _mul(cx); + cx = ax; + push(cx); + _movsb(cx); + cx = pop(); + ax = pop(); + es.word(bx+2) = ax; + _add(data.word(kExframepos), cx); +} + +void DreamGenContext::transfermap() { + STACK_CHECK; + di = data.word(kExframepos); + push(di); + al = data.byte(kExpos); + ah = 0; + bx = ax; + _add(ax, ax); + _add(ax, bx); + cx = 6; + _mul(cx); + es = data.word(kExtras); + bx = (0); + _add(bx, ax); + _add(di, (0+2080)); + push(bx); + al = data.byte(kItemtotran); + ah = 0; + bx = ax; + _add(ax, ax); + _add(ax, bx); + cx = 6; + _mul(cx); + ds = data.word(kFreeframes); + bx = (0); + _add(bx, ax); + si = (0+2080); + al = ds.byte(bx); + ah = 0; + cl = ds.byte(bx+1); + ch = 0; + _add(si, ds.word(bx+2)); + dx = ds.word(bx+4); + bx = pop(); + es.byte(bx+0) = al; + es.byte(bx+1) = cl; + es.word(bx+4) = dx; + _mul(cx); + cx = ax; + push(cx); + _movsb(cx); + cx = pop(); + ax = pop(); + es.word(bx+2) = ax; + _add(data.word(kExframepos), cx); +} + +void DreamGenContext::dofade() { + STACK_CHECK; + _cmp(data.byte(kFadedirection), 0); + if (flags.z()) return /* (finishfade) */; - context.cl = context.data.byte(kNumtofade); - context.ch = 0; - context.al = context.data.byte(kColourpos); - context.ah = 0; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context._add(context.si, context.ax); - context._add(context.si, context.ax); - context._add(context.si, context.ax); - showgroup(context); - context.al = context.data.byte(kNumtofade); - context._add(context.al, context.data.byte(kColourpos)); - context.data.byte(kColourpos) = context.al; - context._cmp(context.al, 0); - if (!context.flags.z()) + cl = data.byte(kNumtofade); + ch = 0; + al = data.byte(kColourpos); + ah = 0; + ds = data.word(kBuffers); + si = (0+(180*10)+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(context); -} - -void clearendpal(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.cx = 768; - context.al = 0; - context._stosb(context.cx); -} - -void clearpalette(Context &context) { - STACK_CHECK(context); - context.data.byte(kFadedirection) = 0; - clearstartpal(context); - dumpcurrent(context); -} - -void fadescreenup(Context &context) { - STACK_CHECK(context); - clearstartpal(context); - paltoendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; -} - -void fadetowhite(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.cx = 768; - context.al = 63; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.al = 0; - context._stosb(3); - paltostartpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; -} - -void fadefromwhite(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.cx = 768; - context.al = 63; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.al = 0; - context._stosb(3); - paltoendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; -} - -void fadescreenups(Context &context) { - STACK_CHECK(context); - clearstartpal(context); - paltoendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 64; -} - -void fadescreendownhalf(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - paltoendpal(context); - context.cx = 768; - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + fadecalculation(); +} + +void DreamGenContext::clearendpal() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + cx = 768; + al = 0; + _stosb(cx); +} + +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+(180*10)+32+60+(32*32)+(11*10*3)+768); + cx = 768; + al = 63; + _stosb(cx); + di = (0+(180*10)+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+(180*10)+32+60+(32*32)+(11*10*3)); + cx = 768; + al = 63; + _stosb(cx); + di = (0+(180*10)+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(); + cx = 768; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); halfend: - context.al = context.es.byte(context.bx); - context._shr(context.al, 1); - context.es.byte(context.bx) = context.al; - context._inc(context.bx); - if (--context.cx) + al = es.byte(bx); + _shr(al, 1); + es.byte(bx) = al; + _inc(bx); + if (--cx) goto halfend; - context.ds = context.data.word(kBuffers); - context.es = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); - context.cx = 3*5; - context._movsb(context.cx); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); - context.cx = 3*2; - context._movsb(context.cx); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 31; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 32; -} - -void fadescreenuphalf(Context &context) { - STACK_CHECK(context); - endpaltostart(context); - paltoendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 31; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 32; -} - -void fadescreendown(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - clearendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; -} - -void fadescreendowns(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - clearendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 64; -} - -void clearstartpal(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.cx = 256; + ds = data.word(kBuffers); + es = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); + cx = 3*5; + _movsb(cx); + si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); + cx = 3*2; + _movsb(cx); + data.byte(kFadedirection) = 1; + data.byte(kFadecount) = 31; + data.byte(kColourpos) = 0; + 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+(180*10)+32+60+(32*32)+(11*10*3)); + cx = 256; wholeloop1: - context.ax = 0; - context._stosw(); - context.al = 0; - context._stosb(); - if (--context.cx) + ax = 0; + _stosw(); + al = 0; + _stosb(); + if (--cx) goto wholeloop1; } -void showgun(Context &context) { - STACK_CHECK(context); - context.data.byte(kAddtored) = 0; - context.data.byte(kAddtogreen) = 0; - context.data.byte(kAddtoblue) = 0; - paltostartpal(context); - paltoendpal(context); - greyscalesum(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 130; - hangon(context); - endpaltostart(context); - clearendpal(context); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 200; - hangon(context); - context.data.byte(kRoomssample) = 34; - loadroomssample(context); - context.data.byte(kVolume) = 0; - context.dx = 2351; - loadintotemp(context); - createpanel2(context); - context.ds = context.data.word(kTempgraphics); - context.al = 0; - context.ah = 0; - context.di = 100; - context.bx = 4; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.al = 1; - context.ah = 0; - context.di = 158; - context.bx = 106; - showframe(context); - worktoscreen(context); - getridoftemp(context); - fadescreenup(context); - context.cx = 160; - hangon(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.dx = 2260; - loadtemptext(context); - rollendcredits2(context); - getridoftemptext(context); -} - -void rollendcredits2(Context &context) { - STACK_CHECK(context); - rollem(context); -} - -void rollem(Context &context) { - STACK_CHECK(context); - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiget(context); - context.es = context.data.word(kTextfile1); - context.si = 49*2; - context.ax = context.es.word(context.si); - context.si = context.ax; - context._add(context.si, (66*2)); - context.cx = 80; +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() { + STACK_CHECK; + cl = 160; + ch = 160; + di = 25; + bx = 20; + ds = data.word(kMapstore); + si = 0; + multiget(); + es = data.word(kTextfile1); + si = 49*2; + ax = es.word(si); + si = ax; + _add(si, (66*2)); + cx = 80; endcredits21: - context.push(context.cx); - context.bx = 10; - context.cx = context.data.word(kLinespacing); + push(cx); + bx = 10; + cx = data.word(kLinespacing); endcredits22: - context.push(context.cx); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiput(context); - vsync(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.push(context.si); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.cx = 18; + push(cx); + push(si); + push(di); + push(es); + push(bx); + vsync(); + cl = 160; + ch = 160; + di = 25; + 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; onelot2: - context.push(context.cx); - context.di = 25; - context.dx = 161; - context.ax = 0; - printdirect(context); - context._add(context.bx, context.data.word(kLinespacing)); - context.cx = context.pop(); - if (--context.cx) + push(cx); + di = 25; + dx = 161; + ax = 0; + printdirect(); + _add(bx, data.word(kLinespacing)); + cx = pop(); + if (--cx) goto onelot2; - vsync(context); - context.cl = 160; - context.ch = 160; - context.di = 25; - context.bx = 20; - multidump(context); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + vsync(); + cl = 160; + ch = 160; + di = 25; + bx = 20; + multidump(); + bx = pop(); + es = pop(); + di = pop(); + si = pop(); + cx = pop(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto endearly2; - context._dec(context.bx); - if (--context.cx) + _dec(bx); + if (--cx) goto endcredits22; - context.cx = context.pop(); + cx = pop(); looknext2: - context.al = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.al, ':'); - if (context.flags.z()) + al = es.byte(si); + _inc(si); + _cmp(al, ':'); + if (flags.z()) goto gotnext2; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto gotnext2; goto looknext2; gotnext2: - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) return /* (endearly) */; - if (--context.cx) + if (--cx) goto endcredits21; - context.cx = 120; - hangone(context); + cx = 120; + hangone(); return; endearly2: - context.cx = context.pop(); + cx = pop(); } -void fadecalculation(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kFadecount), 0); - if (context.flags.z()) +void DreamGenContext::fadecalculation() { + STACK_CHECK; + _cmp(data.byte(kFadecount), 0); + if (flags.z()) goto nomorefading; - context.bl = context.data.byte(kFadecount); - context.es = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.cx = 768; + bl = data.byte(kFadecount); + es = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + cx = 768; fadecolloop: - context.al = context.es.byte(context.si); - context.ah = context.es.byte(context.di); - context._cmp(context.al, context.ah); - if (context.flags.z()) + al = es.byte(si); + ah = es.byte(di); + _cmp(al, ah); + if (flags.z()) goto gotthere; - if (context.flags.c()) + if (flags.c()) goto lesscolour; - context._dec(context.es.byte(context.si)); + _dec(es.byte(si)); goto gotthere; lesscolour: - context._cmp(context.bl, context.ah); - if (context.flags.z()) + _cmp(bl, ah); + if (flags.z()) goto withit; - if (!context.flags.c()) + if (!flags.c()) goto gotthere; withit: - context._inc(context.es.byte(context.si)); + _inc(es.byte(si)); gotthere: - context._inc(context.si); - context._inc(context.di); - if (--context.cx) + _inc(si); + _inc(di); + if (--cx) goto fadecolloop; - context._dec(context.data.byte(kFadecount)); + _dec(data.byte(kFadecount)); return; nomorefading: - context.data.byte(kFadedirection) = 0; + data.byte(kFadedirection) = 0; } -void greyscalesum(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.cx = 256; +void DreamGenContext::greyscalesum() { + STACK_CHECK; + es = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + cx = 256; greysumloop1: - context.push(context.cx); - context.bx = 0; - context.al = context.es.byte(context.si); - context.ah = 0; - context.cx = 20; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.si+1); - context.ah = 0; - context.cx = 59; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.si+2); - context.ah = 0; - context.cx = 11; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = -1; + 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: - context._inc(context.al); - context._sub(context.bx, 100); - if (!context.flags.c()) + _inc(al); + _sub(bx, 100); + if (!flags.c()) goto greysumloop2; - context.bl = context.al; - context.al = context.bl; - context.ah = context.data.byte(kAddtored); - context._cmp(context.al, 0); - context._add(context.al, context.ah); - context._stosb(); - context.ah = context.data.byte(kAddtogreen); - context.al = context.bl; - context._cmp(context.al, 0); - if (context.flags.z()) + 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; - context._add(context.al, context.ah); + _add(al, ah); noaddg: - context._stosb(); - context.ah = context.data.byte(kAddtoblue); - context.al = context.bl; - context._cmp(context.al, 0); - if (context.flags.z()) + _stosb(); + ah = data.byte(kAddtoblue); + al = bl; + _cmp(al, 0); + if (flags.z()) goto noaddb; - context._add(context.al, context.ah); + _add(al, ah); noaddb: - context._stosb(); - context._add(context.si, 3); - context.cx = context.pop(); - if (--context.cx) + _stosb(); + _add(si, 3); + cx = pop(); + if (--cx) goto greysumloop1; } -void paltostartpal(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.cx = 768/2; - context._movsw(context.cx); -} - -void endpaltostart(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.cx = 768/2; - context._movsw(context.cx); -} - -void startpaltoend(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.ds = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.cx = 768/2; - context._movsw(context.cx); -} - -void paltoendpal(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.ds = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - context.cx = 768/2; - context._movsw(context.cx); -} - -void allpalette(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.ds = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - context.cx = 768/2; - context._movsw(context.cx); - dumpcurrent(context); -} - -void dumpcurrent(Context &context) { - STACK_CHECK(context); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)); - context.ds = context.data.word(kBuffers); - vsync(context); - context.al = 0; - context.cx = 128; - showgroup(context); - vsync(context); - context.al = 128; - context.cx = 128; - showgroup(context); -} - -void fadedownmon(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - paltoendpal(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); - context.cx = 3*8; - context.ax = 0; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 64; - hangon(context); -} - -void fadeupmon(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - paltoendpal(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); - context.cx = 3*8; - context.ax = 0; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 128; - hangon(context); -} - -void fadeupmonfirst(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - paltoendpal(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); - context.cx = 3*8; - context.ax = 0; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 64; - hangon(context); - context.al = 26; - playchannel1(context); - context.cx = 64; - hangon(context); -} - -void fadeupyellows(Context &context) { - STACK_CHECK(context); - paltoendpal(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); - context.cx = 3*8; - context.ax = 0; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); - context._stosb(); - context._stosw(); - context.data.byte(kFadedirection) = 1; - context.data.byte(kFadecount) = 63; - context.data.byte(kColourpos) = 0; - context.data.byte(kNumtofade) = 128; - context.cx = 128; - hangon(context); -} - -void initialmoncols(Context &context) { - STACK_CHECK(context); - paltostartpal(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); - context.cx = 3*9; - context.ax = 0; - context._stosb(context.cx); - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); - context._stosb(); - context._stosw(); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); - context.al = 230; - context.cx = 18; - showgroup(context); -} - -void titles(Context &context) { - STACK_CHECK(context); - clearpalette(context); - biblequote(context); - intro(context); -} - -void endgame(Context &context) { - STACK_CHECK(context); - context.dx = 2260; - loadtemptext(context); - monkspeaking(context); - gettingshot(context); - getridoftemptext(context); - context.data.byte(kVolumeto) = 7; - context.data.byte(kVolumedirection) = 1; - context.cx = 200; - hangon(context); -} - -void monkspeaking(Context &context) { - STACK_CHECK(context); - context.data.byte(kRoomssample) = 35; - loadroomssample(context); - context.dx = 2364; - loadintotemp(context); - clearwork(context); - showmonk(context); - worktoscreen(context); - context.data.byte(kVolume) = 7; - context.data.byte(kVolumedirection) = -1; - context.data.byte(kVolumeto) = 5; - context.al = 12; - context.ah = 255; - playchannel0(context); - fadescreenups(context); - context.cx = 300; - hangon(context); - context.al = 40; +void DreamGenContext::paltostartpal() { + STACK_CHECK; + es = data.word(kBuffers); + ds = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + cx = 768/2; + _movsw(cx); +} + +void DreamGenContext::endpaltostart() { + STACK_CHECK; + es = data.word(kBuffers); + ds = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + cx = 768/2; + _movsw(cx); +} + +void DreamGenContext::startpaltoend() { + STACK_CHECK; + es = data.word(kBuffers); + ds = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + cx = 768/2; + _movsw(cx); +} + +void DreamGenContext::paltoendpal() { + STACK_CHECK; + es = data.word(kBuffers); + ds = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + cx = 768/2; + _movsw(cx); +} + +void DreamGenContext::allpalette() { + STACK_CHECK; + es = data.word(kBuffers); + ds = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + cx = 768/2; + _movsw(cx); + dumpcurrent(); +} + +void DreamGenContext::dumpcurrent() { + STACK_CHECK; + si = (0+(180*10)+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(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); + cx = 3*8; + ax = 0; + _stosb(cx); + di = (0+(180*10)+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 = 64; + hangon(); +} + +void DreamGenContext::fadeupmon() { + STACK_CHECK; + paltostartpal(); + paltoendpal(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); + cx = 3*8; + ax = 0; + _stosb(cx); + di = (0+(180*10)+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(); +} + +void DreamGenContext::fadeupmonfirst() { + STACK_CHECK; + paltostartpal(); + paltoendpal(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); + cx = 3*8; + ax = 0; + _stosb(cx); + di = (0+(180*10)+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 = 64; + hangon(); + al = 26; + playchannel1(); + cx = 64; + hangon(); +} + +void DreamGenContext::fadeupyellows() { + STACK_CHECK; + paltoendpal(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); + cx = 3*8; + ax = 0; + _stosb(cx); + di = (0+(180*10)+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(); +} + +void DreamGenContext::initialmoncols() { + STACK_CHECK; + paltostartpal(); + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); + cx = 3*9; + ax = 0; + _stosb(cx); + di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); + _stosb(); + _stosw(); + ds = data.word(kBuffers); + si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); + al = 230; + cx = 18; + showgroup(); +} + +void DreamGenContext::titles() { + STACK_CHECK; + clearpalette(); + biblequote(); + 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: - context.push(context.ax); - context.dl = 'T'; - context.dh = 83; - context.cl = 'T'; - context.ah = 0; - loadspeech(context); - context.al = 50+12; - playchannel1(context); + push(ax); + dl = 'T'; + dh = 83; + cl = 'T'; + ah = 0; + loadspeech(); + al = 50+12; + playchannel1(); notloadspeech2: - vsync(context); - context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) + vsync(); + _cmp(data.byte(kCh1playing), 255); + if (!flags.z()) goto notloadspeech2; - context.ax = context.pop(); - context._inc(context.al); - context._cmp(context.al, 48); - if (!context.flags.z()) + ax = pop(); + _inc(al); + _cmp(al, 48); + if (!flags.z()) goto loadspeech2; - context.data.byte(kVolumedirection) = 1; - context.data.byte(kVolumeto) = 7; - fadescreendowns(context); - context.cx = 300; - hangon(context); - getridoftemp(context); -} - -void showmonk(Context &context) { - STACK_CHECK(context); - context.al = 0; - context.ah = 128; - context.di = 160; - context.bx = 72; - context.ds = context.data.word(kTempgraphics); - showframe(context); -} - -void gettingshot(Context &context) { - STACK_CHECK(context); - context.data.byte(kNewlocation) = 55; - clearpalette(context); - loadintroroom(context); - fadescreenups(context); - context.data.byte(kVolumeto) = 0; - context.data.byte(kVolumedirection) = -1; - runendseq(context); - clearbeforeload(context); -} - -void credits(Context &context) { - STACK_CHECK(context); - clearpalette(context); - realcredits(context); -} - -void biblequote(Context &context) { - STACK_CHECK(context); - mode640x480(context); - context.dx = 2377; - showpcx(context); - fadescreenups(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + 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; - context.cx = 560; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + cx = 560; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto biblequotearly; - fadescreendowns(context); - context.cx = 200; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 200; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto biblequotearly; - cancelch0(context); + cancelch0(); biblequotearly: - context.data.byte(kLasthardkey) = 0; + data.byte(kLasthardkey) = 0; } -void hangone(Context &context) { - STACK_CHECK(context); +void DreamGenContext::hangone() { + STACK_CHECK; hangonloope: - context.push(context.cx); - vsync(context); - context.cx = context.pop(); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + push(cx); + vsync(); + cx = pop(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) return /* (hangonearly) */; - if (--context.cx) + if (--cx) goto hangonloope; } -void intro(Context &context) { - STACK_CHECK(context); - context.dx = 2247; - loadtemptext(context); - loadpalfromiff(context); - setmode(context); - context.data.byte(kNewlocation) = 50; - clearpalette(context); - loadintroroom(context); - context.data.byte(kVolume) = 7; - context.data.byte(kVolumedirection) = -1; - context.data.byte(kVolumeto) = 4; - context.al = 12; - context.ah = 255; - playchannel0(context); - fadescreenups(context); - runintroseq(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) +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(context); - context.data.byte(kNewlocation) = 52; - loadintroroom(context); - runintroseq(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + clearbeforeload(); + data.byte(kNewlocation) = 52; + loadintroroom(); + runintroseq(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto introearly; - clearbeforeload(context); - context.data.byte(kNewlocation) = 53; - loadintroroom(context); - runintroseq(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + clearbeforeload(); + data.byte(kNewlocation) = 53; + loadintroroom(); + runintroseq(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto introearly; - clearbeforeload(context); - allpalette(context); - context.data.byte(kNewlocation) = 54; - loadintroroom(context); - runintroseq(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + clearbeforeload(); + allpalette(); + data.byte(kNewlocation) = 54; + loadintroroom(); + runintroseq(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto introearly; - getridoftemptext(context); - clearbeforeload(context); + getridoftemptext(); + clearbeforeload(); introearly: - context.data.byte(kLasthardkey) = 0; + data.byte(kLasthardkey) = 0; } -void runintroseq(Context &context) { - STACK_CHECK(context); - context.data.byte(kGetback) = 0; +void DreamGenContext::runintroseq() { + STACK_CHECK; + data.byte(kGetback) = 0; moreintroseq: - vsync(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + vsync(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto earlyendrun; - spriteupdate(context); - vsync(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + spriteupdate(); + vsync(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto earlyendrun; - deleverything(context); - printsprites(context); - reelsonscreen(context); - afterintroroom(context); - usetimedtext(context); - vsync(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + deleverything(); + printsprites(); + reelsonscreen(); + afterintroroom(); + usetimedtext(); + vsync(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto earlyendrun; - dumpmap(context); - dumptimedtext(context); - vsync(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dumpmap(); + dumptimedtext(); + vsync(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto earlyendrun; - context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) + _cmp(data.byte(kGetback), 1); + if (!flags.z()) goto moreintroseq; return; earlyendrun: - getridoftemptext(context); - clearbeforeload(context); + getridoftemptext(); + clearbeforeload(); } -void runendseq(Context &context) { - STACK_CHECK(context); - atmospheres(context); - context.data.byte(kGetback) = 0; +void DreamGenContext::runendseq() { + STACK_CHECK; + atmospheres(); + data.byte(kGetback) = 0; moreendseq: - vsync(context); - spriteupdate(context); - vsync(context); - deleverything(context); - printsprites(context); - reelsonscreen(context); - afterintroroom(context); - usetimedtext(context); - vsync(context); - dumpmap(context); - dumptimedtext(context); - vsync(context); - context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) + vsync(); + spriteupdate(); + vsync(); + deleverything(); + printsprites(); + reelsonscreen(); + afterintroroom(); + usetimedtext(); + vsync(); + dumpmap(); + dumptimedtext(); + vsync(); + _cmp(data.byte(kGetback), 1); + if (!flags.z()) goto moreendseq; } -void loadintroroom(Context &context) { - STACK_CHECK(context); - context.data.byte(kIntrocount) = 0; - context.data.byte(kLocation) = 255; - loadroom(context); - context.data.word(kMapoffsetx) = 72; - context.data.word(kMapoffsety) = 16; - clearsprites(context); - context.data.byte(kThroughdoor) = 0; - context.data.byte(kCurrentkey) = '0'; - context.data.byte(kMainmode) = 0; - clearwork(context); - context.data.byte(kNewobs) = 1; - drawfloor(context); - reelsonscreen(context); - spriteupdate(context); - printsprites(context); - worktoscreen(context); -} - -void realcredits(Context &context) { - STACK_CHECK(context); - context.data.byte(kRoomssample) = 33; - loadroomssample(context); - context.data.byte(kVolume) = 0; - mode640x480(context); - context.cx = 35; - hangon(context); - context.dx = 2390; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) +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(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + allpalette(); + cx = 80; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 256; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.dx = 2403; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dx = 2403; + showpcx(); + al = 12; + ah = 0; + playchannel0(); + cx = 2; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - allpalette(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + allpalette(); + cx = 80; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 256; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.dx = 2416; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dx = 2416; + showpcx(); + al = 12; + ah = 0; + playchannel0(); + cx = 2; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - allpalette(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + allpalette(); + cx = 80; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 256; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.dx = 2429; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dx = 2429; + showpcx(); + al = 12; + ah = 0; + playchannel0(); + cx = 2; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - allpalette(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + allpalette(); + cx = 80; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 256; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.dx = 2442; - showpcx(context); - context.al = 12; - context.ah = 0; - playchannel0(context); - context.cx = 2; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dx = 2442; + showpcx(); + al = 12; + ah = 0; + playchannel0(); + cx = 2; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - allpalette(context); - context.cx = 80; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + allpalette(); + cx = 80; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + fadescreendowns(); + cx = 256; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.dx = 2455; - showpcx(context); - fadescreenups(context); - context.cx = 60; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + dx = 2455; + showpcx(); + fadescreenups(); + cx = 60; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - context.al = 13; - context.ah = 0; - playchannel0(context); - context.cx = 350; - hangone(context); - context._cmp(context.data.byte(kLasthardkey), 1); - if (context.flags.z()) + al = 13; + ah = 0; + playchannel0(); + cx = 350; + hangone(); + _cmp(data.byte(kLasthardkey), 1); + if (flags.z()) goto realcreditsearly; - fadescreendowns(context); - context.cx = 256; - hangone(context); + fadescreendowns(); + cx = 256; + hangone(); realcreditsearly: - context.data.byte(kLasthardkey) = 0; + data.byte(kLasthardkey) = 0; } -void printchar(Context &context) { - STACK_CHECK(context); - context._cmp(context.al, 255); - if (context.flags.z()) +void DreamGenContext::printchar() { + STACK_CHECK; + _cmp(al, 255); + if (flags.z()) return /* (ignoreit) */; - context.push(context.si); - context.push(context.bx); - context.push(context.di); - context.push(context.ax); - context._sub(context.al, 32); - context.ah = 0; - context._add(context.ax, context.data.word(kCharshift)); - showframe(context); - context.ax = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context._cmp(context.data.byte(kKerning), 0); - if (!context.flags.z()) + push(si); + push(bx); + push(di); + push(ax); + _sub(al, 32); + ah = 0; + _add(ax, data.word(kCharshift)); + showframe(); + ax = pop(); + di = pop(); + bx = pop(); + si = pop(); + _cmp(data.byte(kKerning), 0); + if (!flags.z()) goto nokern; - kernchars(context); + kernchars(); nokern: - context.push(context.cx); - context.ch = 0; - context._add(context.di, context.cx); - context.cx = context.pop(); + push(cx); + ch = 0; + _add(di, cx); + cx = pop(); } -void kernchars(Context &context) { - STACK_CHECK(context); - context._cmp(context.al, 'a'); - if (context.flags.z()) +void DreamGenContext::kernchars() { + STACK_CHECK; + _cmp(al, 'a'); + if (flags.z()) goto iskern; - context._cmp(context.al, 'u'); - if (context.flags.z()) + _cmp(al, 'u'); + if (flags.z()) goto iskern; return; iskern: - context._cmp(context.ah, 'n'); - if (context.flags.z()) + _cmp(ah, 'n'); + if (flags.z()) goto kernit; - context._cmp(context.ah, 't'); - if (context.flags.z()) + _cmp(ah, 't'); + if (flags.z()) goto kernit; - context._cmp(context.ah, 'r'); - if (context.flags.z()) + _cmp(ah, 'r'); + if (flags.z()) goto kernit; - context._cmp(context.ah, 'i'); - if (context.flags.z()) + _cmp(ah, 'i'); + if (flags.z()) goto kernit; - context._cmp(context.ah, 'l'); - if (context.flags.z()) + _cmp(ah, 'l'); + if (flags.z()) goto kernit; return; kernit: - context._dec(context.cl); + _dec(cl); } -void printslow(Context &context) { - STACK_CHECK(context); - context.data.byte(kPointerframe) = 1; - context.data.byte(kPointermode) = 3; - context.ds = context.data.word(kCharset1); +void DreamGenContext::printslow() { + STACK_CHECK; + data.byte(kPointerframe) = 1; + data.byte(kPointermode) = 3; + ds = data.word(kCharset1); printloopslow6: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; + push(bx); + push(di); + push(dx); + getnumber(); + ch = 0; printloopslow5: - context.push(context.cx); - context.push(context.si); - context.push(context.es); - context.ax = context.es.word(context.si); - context.push(context.bx); - context.push(context.cx); - context.push(context.es); - context.push(context.si); - context.push(context.ds); - printboth(context); - context.ds = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.es.word(context.si+1); - context._inc(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + push(cx); + push(si); + push(es); + ax = es.word(si); + push(bx); + push(cx); + push(es); + push(si); + push(ds); + printboth(); + ds = pop(); + si = pop(); + es = pop(); + cx = pop(); + bx = pop(); + ax = es.word(si+1); + _inc(si); + _cmp(al, 0); + if (flags.z()) goto finishslow; - context._cmp(context.al, ':'); - if (context.flags.z()) + _cmp(al, ':'); + if (flags.z()) goto finishslow; - context._cmp(context.cl, 1); - if (context.flags.z()) + _cmp(cl, 1); + if (flags.z()) goto afterslow; - context.push(context.di); - context.push(context.ds); - context.push(context.bx); - context.push(context.cx); - context.push(context.es); - context.push(context.si); - context.data.word(kCharshift) = 91; - printboth(context); - context.data.word(kCharshift) = 0; - context.si = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - waitframes(context); - context._cmp(context.ax, 0); - if (context.flags.z()) + push(di); + push(ds); + push(bx); + push(cx); + push(es); + push(si); + data.word(kCharshift) = 91; + printboth(); + data.word(kCharshift) = 0; + si = pop(); + es = pop(); + cx = pop(); + bx = pop(); + ds = pop(); + di = pop(); + waitframes(); + _cmp(ax, 0); + if (flags.z()) goto keepgoing; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (!flags.z()) goto finishslow2; keepgoing: - waitframes(context); - context._cmp(context.ax, 0); - if (context.flags.z()) + waitframes(); + _cmp(ax, 0); + if (flags.z()) goto afterslow; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (!flags.z()) goto finishslow2; afterslow: - context.es = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._inc(context.si); - if (--context.cx) + es = pop(); + si = pop(); + cx = pop(); + _inc(si); + if (--cx) goto printloopslow5; - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 10); + dx = pop(); + di = pop(); + bx = pop(); + _add(bx, 10); goto printloopslow6; finishslow: - context.es = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.al = 0; + es = pop(); + si = pop(); + cx = pop(); + dx = pop(); + di = pop(); + bx = pop(); + al = 0; return; finishslow2: - context.es = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.al = 1; -} - -void waitframes(Context &context) { - STACK_CHECK(context); - context.push(context.di); - context.push(context.bx); - context.push(context.es); - context.push(context.si); - context.push(context.ds); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - delpointer(context); - context.ax = context.data.word(kMousebutton); - context.ds = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); -} - -void printboth(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.cx); - context.push(context.bx); - context.push(context.di); - printchar(context); - context.ax = context.pop(); - context.push(context.di); - context.di = context.ax; - multidump(context); - context.di = context.pop(); - context.bx = context.pop(); - context.cx = context.pop(); - context.ax = context.pop(); -} - -void printdirect(Context &context) { - STACK_CHECK(context); - context.data.word(kLastxpos) = context.di; - context.ds = context.data.word(kCurrentset); + es = pop(); + si = pop(); + cx = pop(); + dx = pop(); + di = pop(); + bx = pop(); + al = 1; +} + +void DreamGenContext::waitframes() { + STACK_CHECK; + push(di); + push(bx); + push(es); + push(si); + push(ds); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + delpointer(); + ax = data.word(kMousebutton); + ds = pop(); + si = pop(); + es = pop(); + bx = pop(); + di = pop(); +} + +void DreamGenContext::printboth() { + STACK_CHECK; + push(ax); + push(cx); + push(bx); + push(di); + printchar(); + ax = pop(); + push(di); + di = ax; + multidump(); + di = pop(); + bx = pop(); + cx = pop(); + ax = pop(); +} + +void DreamGenContext::printdirect() { + STACK_CHECK; + data.word(kLastxpos) = di; + ds = data.word(kCurrentset); printloop6: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; + push(bx); + push(di); + push(dx); + getnumber(); + ch = 0; printloop5: - context.ax = context.es.word(context.si); - context._inc(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + ax = es.word(si); + _inc(si); + _cmp(al, 0); + if (flags.z()) goto finishdirct; - context._cmp(context.al, ':'); - if (context.flags.z()) + _cmp(al, ':'); + if (flags.z()) goto finishdirct; - context.push(context.cx); - context.push(context.es); - printchar(context); - context.data.word(kLastxpos) = context.di; - context.es = context.pop(); - context.cx = context.pop(); - if (--context.cx) + push(cx); + push(es); + printchar(); + data.word(kLastxpos) = di; + es = pop(); + cx = pop(); + if (--cx) goto printloop5; - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._add(context.bx, context.data.word(kLinespacing)); + dx = pop(); + di = pop(); + bx = pop(); + _add(bx, data.word(kLinespacing)); goto printloop6; finishdirct: - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); -} - -void monprint(Context &context) { - STACK_CHECK(context); - context.data.byte(kKerning) = 1; - context.si = context.bx; - context.dl = 166; - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.ds = context.data.word(kTempcharset); + dx = pop(); + di = pop(); + bx = pop(); +} + +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: - context.push(context.bx); - context.push(context.di); - context.push(context.dx); - getnumber(context); - context.ch = 0; + push(bx); + push(di); + push(dx); + getnumber(); + ch = 0; printloop7: - context.al = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.al, ':'); - if (context.flags.z()) + al = es.byte(si); + _inc(si); + _cmp(al, ':'); + if (flags.z()) goto finishmon2; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto finishmon; - context._cmp(context.al, 34); - if (context.flags.z()) + _cmp(al, 34); + if (flags.z()) goto finishmon; - context._cmp(context.al, '='); - if (context.flags.z()) + _cmp(al, '='); + if (flags.z()) goto finishmon; - context._cmp(context.al, '%'); - if (!context.flags.z()) + _cmp(al, '%'); + if (!flags.z()) goto nottrigger; - context.ah = context.es.byte(context.si); - context._inc(context.si); - context._inc(context.si); + ah = es.byte(si); + _inc(si); + _inc(si); goto finishmon; nottrigger: - context.push(context.cx); - context.push(context.es); - printchar(context); - context.data.word(kCurslocx) = context.di; - context.data.word(kCurslocy) = context.bx; - context.data.word(kMaintimer) = 1; - printcurs(context); - vsync(context); - context.push(context.si); - context.push(context.dx); - context.push(context.ds); - context.push(context.es); - context.push(context.bx); - context.push(context.di); - lockmon(context); - context.di = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); - context.dx = context.pop(); - context.si = context.pop(); - delcurs(context); - context.es = context.pop(); - context.cx = context.pop(); - if (--context.cx) + push(cx); + push(es); + 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: - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - scrollmonitor(context); - context.data.word(kCurslocx) = context.di; + dx = pop(); + di = pop(); + bx = pop(); + scrollmonitor(); + data.word(kCurslocx) = di; goto printloop8; finishmon: - context.dx = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context._cmp(context.al, '%'); - if (!context.flags.z()) + dx = pop(); + di = pop(); + bx = pop(); + _cmp(al, '%'); + if (!flags.z()) goto nottrigger2; - context.data.byte(kLasttrigger) = context.ah; + data.byte(kLasttrigger) = ah; nottrigger2: - context.data.word(kCurslocx) = context.di; - scrollmonitor(context); - context.bx = context.si; - context.data.byte(kKerning) = 0; -} - -void getnumber(Context &context) { - STACK_CHECK(context); - context.cx = 0; - context.push(context.si); - context.push(context.bx); - context.push(context.di); - context.push(context.ds); - context.push(context.es); - context.di = context.si; + data.word(kCurslocx) = di; + scrollmonitor(); + bx = si; + data.byte(kKerning) = 0; +} + +void DreamGenContext::getnumber() { + STACK_CHECK; + cx = 0; + push(si); + push(bx); + push(di); + push(ds); + push(es); + di = si; wordloop: - context.push(context.cx); - context.push(context.dx); - getnextword(context); - context.dx = context.pop(); - context.cx = context.pop(); - context._cmp(context.al, 1); - if (context.flags.z()) + push(cx); + push(dx); + getnextword(); + dx = pop(); + cx = pop(); + _cmp(al, 1); + if (flags.z()) goto endoftext; - context.al = context.cl; - context.ah = 0; - context.push(context.bx); - context.bh = 0; - context._add(context.ax, context.bx); - context.bx = context.pop(); - context._sub(context.ax, 10); - context.dh = 0; - context._cmp(context.ax, context.dx); - if (!context.flags.c()) + al = cl; + ah = 0; + push(bx); + bh = 0; + _add(ax, bx); + bx = pop(); + _sub(ax, 10); + dh = 0; + _cmp(ax, dx); + if (!flags.c()) goto gotoverend; - context._add(context.cl, context.bl); - context._add(context.ch, context.bh); + _add(cl, bl); + _add(ch, bh); goto wordloop; gotoverend: - context.al = context.dl; - context._and(context.al, 1); - if (context.flags.z()) + al = dl; + _and(al, 1); + if (flags.z()) goto notcentre; - context.push(context.cx); - context.al = context.dl; - context._and(context.al, 0xfe); - context.ah = 0; - context.ch = 0; - context._sub(context.ax, context.cx); - context._add(context.ax, 20); - context._shr(context.ax, 1); - context.cx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context._add(context.di, context.ax); - context.cl = context.ch; + push(cx); + al = dl; + _and(al, 0xfe); + ah = 0; + ch = 0; + _sub(ax, cx); + _add(ax, 20); + _shr(ax, 1); + cx = pop(); + es = pop(); + ds = pop(); + di = pop(); + bx = pop(); + si = pop(); + _add(di, ax); + cl = ch; return; notcentre: - context.es = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context.cl = context.ch; + es = pop(); + ds = pop(); + di = pop(); + bx = pop(); + si = pop(); + cl = ch; return; endoftext: - context.al = context.cl; - context.ah = 0; - context.push(context.bx); - context.bh = 0; - context._add(context.ax, context.bx); - context.bx = context.pop(); - context._sub(context.ax, 10); - context.dh = 0; - context._cmp(context.ax, context.dx); - if (!context.flags.c()) + al = cl; + ah = 0; + push(bx); + bh = 0; + _add(ax, bx); + bx = pop(); + _sub(ax, 10); + dh = 0; + _cmp(ax, dx); + if (!flags.c()) goto gotoverend2; - context._add(context.cl, context.bl); - context._add(context.ch, context.bh); + _add(cl, bl); + _add(ch, bh); gotoverend2: - context.al = context.dl; - context._and(context.al, 1); - if (context.flags.z()) + al = dl; + _and(al, 1); + if (flags.z()) goto notcent2; - context.push(context.cx); - context.al = context.dl; - context._and(context.al, 0xfe); - context._add(context.al, 2); - context.ah = 0; - context.ch = 0; - context._add(context.ax, 20); - context._sub(context.ax, context.cx); - context._shr(context.ax, 1); - context.cx = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context._add(context.di, context.ax); - context.cl = context.ch; + push(cx); + al = dl; + _and(al, 0xfe); + _add(al, 2); + ah = 0; + ch = 0; + _add(ax, 20); + _sub(ax, cx); + _shr(ax, 1); + cx = pop(); + es = pop(); + ds = pop(); + di = pop(); + bx = pop(); + si = pop(); + _add(di, ax); + cl = ch; return; notcent2: - context.es = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.si = context.pop(); - context.cl = context.ch; + es = pop(); + ds = pop(); + di = pop(); + bx = pop(); + si = pop(); + cl = ch; } -void getnextword(Context &context) { - STACK_CHECK(context); - context.bx = 0; +void DreamGenContext::getnextword() { + STACK_CHECK; + bx = 0; getloop: - context.ax = context.es.word(context.di); - context._inc(context.di); - context._inc(context.bh); - context._cmp(context.al, ':'); - if (context.flags.z()) + ax = es.word(di); + _inc(di); + _inc(bh); + _cmp(al, ':'); + if (flags.z()) goto endall; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto endall; - context._cmp(context.al, 32); - if (context.flags.z()) + _cmp(al, 32); + if (flags.z()) goto endword; - context._cmp(context.al, 255); - if (context.flags.z()) + _cmp(al, 255); + if (flags.z()) goto getloop; - context.push(context.ax); - context._sub(context.al, 32); - context.ah = 0; - context._add(context.ax, context.data.word(kCharshift)); - context._add(context.ax, context.ax); - context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.cl = context.ds.byte(context.si+0); - context.ax = context.pop(); - kernchars(context); - context._add(context.bl, context.cl); + push(ax); + _sub(al, 32); + ah = 0; + _add(ax, data.word(kCharshift)); + _add(ax, ax); + si = ax; + _add(ax, ax); + _add(si, ax); + cl = ds.byte(si+0); + ax = pop(); + kernchars(); + _add(bl, cl); goto getloop; endword: - context._add(context.bl, 6); - context.al = 0; + _add(bl, 6); + al = 0; return; endall: - context._add(context.bl, 6); - context.al = 1; -} - -void fillryan(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32); - findallryan(context); - context.si = (0+(180*10)+32); - context.al = context.data.byte(kRyanpage); - context.ah = 0; - context.cx = 20; - context._mul(context.cx); - context._add(context.si, context.ax); - context.di = (80); - context.bx = (58); - context.cx = 2; + _add(bl, 6); + al = 1; +} + +void DreamGenContext::fillryan() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+32); + findallryan(); + si = (0+(180*10)+32); + al = data.byte(kRyanpage); + ah = 0; + cx = 20; + _mul(cx); + _add(si, ax); + di = (80); + bx = (58); + cx = 2; ryanloop2: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.cx = 5; + push(cx); + push(di); + push(bx); + cx = 5; ryanloop1: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.ax = context.es.word(context.si); - context._add(context.si, 2); - context.push(context.si); - context.push(context.es); - obtoinv(context); - context.es = context.pop(); - context.si = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, (44)); - if (--context.cx) + push(cx); + push(di); + push(bx); + ax = es.word(si); + _add(si, 2); + push(si); + push(es); + obtoinv(); + es = pop(); + si = pop(); + bx = pop(); + di = pop(); + cx = pop(); + _add(di, (44)); + if (--cx) goto ryanloop1; - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.bx, (44)); - if (--context.cx) + bx = pop(); + di = pop(); + cx = pop(); + _add(bx, (44)); + if (--cx) goto ryanloop2; - showryanpage(context); + showryanpage(); } -void fillopen(Context &context) { - STACK_CHECK(context); - deltextline(context); - getopenedsize(context); - context._cmp(context.ah, 4); - if (context.flags.c()) +void DreamGenContext::fillopen() { + STACK_CHECK; + deltextline(); + getopenedsize(); + _cmp(ah, 4); + if (flags.c()) goto lessthanapage; - context.ah = 4; + ah = 4; lessthanapage: - context.al = 1; - context.push(context.ax); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)); - findallopen(context); - context.si = (0+(180*10)); - context.di = (80); - context.bx = (58)+96; - context.cx = context.pop(); + al = 1; + push(ax); + es = data.word(kBuffers); + di = (0+(180*10)); + findallopen(); + si = (0+(180*10)); + di = (80); + bx = (58)+96; + cx = pop(); openloop1: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context.ax = context.es.word(context.si); - context._add(context.si, 2); - context.push(context.si); - context.push(context.es); - context._cmp(context.ch, context.cl); - if (context.flags.c()) + push(cx); + push(di); + push(bx); + ax = es.word(si); + _add(si, 2); + push(si); + push(es); + _cmp(ch, cl); + if (flags.c()) goto nextopenslot; - obtoinv(context); + obtoinv(); nextopenslot: - context.es = context.pop(); - context.si = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.di, (44)); - context._inc(context.cl); - context._cmp(context.cl, 5); - if (!context.flags.z()) + es = pop(); + si = pop(); + bx = pop(); + di = pop(); + cx = pop(); + _add(di, (44)); + _inc(cl); + _cmp(cl, 5); + if (!flags.z()) goto openloop1; - undertextline(context); -} - -void findallryan(Context &context) { - STACK_CHECK(context); - context.push(context.di); - context.cx = 30; - context.ax = 0x0ffff; - context._stosw(context.cx); - context.di = context.pop(); - context.cl = 4; - context.ds = context.data.word(kExtras); - context.bx = (0+2080+30000); - context.ch = 0; + undertextline(); +} + +void DreamGenContext::findallryan() { + STACK_CHECK; + push(di); + cx = 30; + ax = 0x0ffff; + _stosw(cx); + di = pop(); + cl = 4; + ds = data.word(kExtras); + bx = (0+2080+30000); + ch = 0; findryanloop: - context._cmp(context.ds.byte(context.bx+2), context.cl); - if (!context.flags.z()) + _cmp(ds.byte(bx+2), cl); + if (!flags.z()) goto notinryaninv; - context._cmp(context.ds.byte(context.bx+3), 255); - if (!context.flags.z()) + _cmp(ds.byte(bx+3), 255); + if (!flags.z()) goto notinryaninv; - context.al = context.ds.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 4; - context._stosw(); - context.di = context.pop(); + al = ds.byte(bx+4); + ah = 0; + push(di); + _add(di, ax); + _add(di, ax); + al = ch; + ah = 4; + _stosw(); + di = pop(); notinryaninv: - context._add(context.bx, 16); - context._inc(context.ch); - context._cmp(context.ch, (114)); - if (!context.flags.z()) + _add(bx, 16); + _inc(ch); + _cmp(ch, (114)); + if (!flags.z()) goto findryanloop; } -void findallopen(Context &context) { - STACK_CHECK(context); - context.push(context.di); - context.cx = 16; - context.ax = 0x0ffff; - context._stosw(context.cx); - context.di = context.pop(); - context.cl = context.data.byte(kOpenedob); - context.dl = context.data.byte(kOpenedtype); - context.ds = context.data.word(kExtras); - context.bx = (0+2080+30000); - context.ch = 0; +void DreamGenContext::findallopen() { + STACK_CHECK; + push(di); + cx = 16; + ax = 0x0ffff; + _stosw(cx); + di = pop(); + cl = data.byte(kOpenedob); + dl = data.byte(kOpenedtype); + ds = data.word(kExtras); + bx = (0+2080+30000); + ch = 0; findopen1: - context._cmp(context.ds.byte(context.bx+3), context.cl); - if (!context.flags.z()) + _cmp(ds.byte(bx+3), cl); + if (!flags.z()) goto findopen2; - context._cmp(context.ds.byte(context.bx+2), context.dl); - if (!context.flags.z()) + _cmp(ds.byte(bx+2), dl); + if (!flags.z()) goto findopen2; - context._cmp(context.data.byte(kOpenedtype), 4); - if (context.flags.z()) + _cmp(data.byte(kOpenedtype), 4); + if (flags.z()) goto noloccheck; - context.al = context.ds.byte(context.bx+5); - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + al = ds.byte(bx+5); + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto findopen2; noloccheck: - context.al = context.ds.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 4; - context._stosw(); - context.di = context.pop(); + al = ds.byte(bx+4); + ah = 0; + push(di); + _add(di, ax); + _add(di, ax); + al = ch; + ah = 4; + _stosw(); + di = pop(); findopen2: - context._add(context.bx, 16); - context._inc(context.ch); - context._cmp(context.ch, (114)); - if (!context.flags.z()) + _add(bx, 16); + _inc(ch); + _cmp(ch, (114)); + if (!flags.z()) goto findopen1; - context.cl = context.data.byte(kOpenedob); - context.dl = context.data.byte(kOpenedtype); - context.push(context.dx); - context.ds = context.data.word(kFreedat); - context.dx = context.pop(); - context.bx = 0; - context.ch = 0; + cl = data.byte(kOpenedob); + dl = data.byte(kOpenedtype); + push(dx); + ds = data.word(kFreedat); + dx = pop(); + bx = 0; + ch = 0; findopen1a: - context._cmp(context.ds.byte(context.bx+3), context.cl); - if (!context.flags.z()) + _cmp(ds.byte(bx+3), cl); + if (!flags.z()) goto findopen2a; - context._cmp(context.ds.byte(context.bx+2), context.dl); - if (!context.flags.z()) + _cmp(ds.byte(bx+2), dl); + if (!flags.z()) goto findopen2a; - context.al = context.ds.byte(context.bx+4); - context.ah = 0; - context.push(context.di); - context._add(context.di, context.ax); - context._add(context.di, context.ax); - context.al = context.ch; - context.ah = 2; - context._stosw(); - context.di = context.pop(); + al = ds.byte(bx+4); + ah = 0; + push(di); + _add(di, ax); + _add(di, ax); + al = ch; + ah = 2; + _stosw(); + di = pop(); findopen2a: - context._add(context.bx, 16); - context._inc(context.ch); - context._cmp(context.ch, 80); - if (!context.flags.z()) + _add(bx, 16); + _inc(ch); + _cmp(ch, 80); + if (!flags.z()) goto findopen1a; } -void obtoinv(Context &context) { - STACK_CHECK(context); - context.push(context.bx); - context.push(context.es); - context.push(context.si); - context.push(context.ax); - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.ds = context.data.word(kIcons1); - context._sub(context.di, 2); - context._sub(context.bx, 1); - context.al = 10; - context.ah = 0; - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) +void DreamGenContext::obtoinv() { + STACK_CHECK; + push(bx); + push(es); + push(si); + push(ax); + push(ax); + push(di); + push(bx); + ds = data.word(kIcons1); + _sub(di, 2); + _sub(bx, 1); + al = 10; + ah = 0; + showframe(); + bx = pop(); + di = pop(); + ax = pop(); + _cmp(al, 255); + if (flags.z()) goto finishfill; - context.push(context.bx); - context.push(context.di); - context.push(context.ax); - context.ds = context.data.word(kExtras); - context._cmp(context.ah, 4); - if (context.flags.z()) + push(bx); + push(di); + push(ax); + ds = data.word(kExtras); + _cmp(ah, 4); + if (flags.z()) goto isanextra; - context.ds = context.data.word(kFreeframes); + ds = data.word(kFreeframes); isanextra: - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._inc(context.al); - context.ah = 128; - context._add(context.bx, 19); - context._add(context.di, 18); - showframe(context); - context.ax = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.push(context.bx); - getanyaddir(context); - isitworn(context); - context.bx = context.pop(); - if (!context.flags.z()) + cl = al; + _add(al, al); + _add(al, cl); + _inc(al); + ah = 128; + _add(bx, 19); + _add(di, 18); + showframe(); + ax = pop(); + di = pop(); + bx = pop(); + push(bx); + getanyaddir(); + isitworn(); + bx = pop(); + if (!flags.z()) goto finishfill; - context.ds = context.data.word(kIcons1); - context._sub(context.di, 3); - context._sub(context.bx, 2); - context.al = 7; - context.ah = 0; - showframe(context); + ds = data.word(kIcons1); + _sub(di, 3); + _sub(bx, 2); + al = 7; + ah = 0; + showframe(); finishfill: - context.ax = context.pop(); - context.si = context.pop(); - context.es = context.pop(); - context.bx = context.pop(); + ax = pop(); + si = pop(); + es = pop(); + bx = pop(); } -void isitworn(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.bx+12); - context._cmp(context.al, 'W'-'A'); - if (!context.flags.z()) +void DreamGenContext::isitworn() { + STACK_CHECK; + al = es.byte(bx+12); + _cmp(al, 'W'-'A'); + if (!flags.z()) return /* (notworn) */; - context.al = context.es.byte(context.bx+13); - context._cmp(context.al, 'E'-'A'); + al = es.byte(bx+13); + _cmp(al, 'E'-'A'); } -void makeworn(Context &context) { - STACK_CHECK(context); - context.es.byte(context.bx+12) = 'W'-'A'; - context.es.byte(context.bx+13) = 'E'-'A'; +void DreamGenContext::makeworn() { + STACK_CHECK; + es.byte(bx+12) = 'W'-'A'; + es.byte(bx+13) = 'E'-'A'; } -void examineob(Context &context) { - STACK_CHECK(context); - context.data.byte(kPointermode) = 0; - context.data.word(kTimecount) = 0; +void DreamGenContext::examineob() { + STACK_CHECK; + data.byte(kPointermode) = 0; + data.word(kTimecount) = 0; examineagain: - context.data.byte(kInmaparea) = 0; - context.data.byte(kExamagain) = 0; - context.data.byte(kOpenedob) = 255; - context.data.byte(kOpenedtype) = 255; - context.data.byte(kInvopen) = 0; - context.al = context.data.byte(kCommandtype); - context.data.byte(kObjecttype) = context.al; - context.data.byte(kItemframe) = 0; - context.data.byte(kPointerframe) = 0; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); + 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(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.data.byte(kGetback) = 0; - context.bx = 2494; - context._cmp(context.data.byte(kInvopen), 0); - if (context.flags.z()) + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + delpointer(); + data.byte(kGetback) = 0; + bx = 2494; + _cmp(data.byte(kInvopen), 0); + if (flags.z()) goto notuseinv; - context.bx = 2556; - context._cmp(context.data.byte(kInvopen), 1); - if (context.flags.z()) + bx = 2556; + _cmp(data.byte(kInvopen), 1); + if (flags.z()) goto notuseinv; - context.bx = 2618; + bx = 2618; notuseinv: - checkcoords(context); - context._cmp(context.data.byte(kExamagain), 0); - if (context.flags.z()) + checkcoords(); + _cmp(data.byte(kExamagain), 0); + if (flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto waitexam; - context.data.byte(kPickup) = 0; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + data.byte(kPickup) = 0; + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) goto iswatching; - context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) + _cmp(data.byte(kNewlocation), 255); + if (!flags.z()) goto justgetback; iswatching: - makemainscreen(context); - context.data.byte(kInvopen) = 0; - context.data.byte(kOpenedob) = 255; + makemainscreen(); + data.byte(kInvopen) = 0; + data.byte(kOpenedob) = 255; return; justgetback: - context.data.byte(kInvopen) = 0; - context.data.byte(kOpenedob) = 255; -} - -void makemainscreen(Context &context) { - STACK_CHECK(context); - createpanel(context); - context.data.byte(kNewobs) = 1; - drawfloor(context); - spriteupdate(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); - undertextline(context); - context.data.byte(kCommandtype) = 255; - animpointer(context); - worktoscreenm(context); - context.data.byte(kCommandtype) = 200; - context.data.byte(kManisoffscreen) = 0; -} - -void getbackfromob(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPickup), 1); - if (!context.flags.z()) + 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(context); + blank(); return; notheldob: - getback1(context); + getback1(); } -void incryanpage(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) +void DreamGenContext::incryanpage() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 222); + if (flags.z()) goto alreadyincryan; - context.data.byte(kCommandtype) = 222; - context.al = 31; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 31; + commandonly(); alreadyincryan: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noincryan) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doincryan; return; doincryan: - context.ax = context.data.word(kMousex); - context._sub(context.ax, (80)+167); - context.data.byte(kRyanpage) = -1; + ax = data.word(kMousex); + _sub(ax, (80)+167); + data.byte(kRyanpage) = -1; findnewpage: - context._inc(context.data.byte(kRyanpage)); - context._sub(context.ax, 18); - if (!context.flags.c()) + _inc(data.byte(kRyanpage)); + _sub(ax, 18); + if (!flags.c()) goto findnewpage; - delpointer(context); - fillryan(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void openinv(Context &context) { - STACK_CHECK(context); - context.data.byte(kInvopen) = 1; - context.al = 61; - context.di = (80); - context.bx = (58)-10; - context.dl = 240; - printmessage(context); - fillryan(context); - context.data.byte(kCommandtype) = 255; -} - -void showryanpage(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kIcons1); - context.di = (80)+167; - context.bx = (58)-12; - context.al = 12; - context.ah = 0; - showframe(context); - context.al = 13; - context._add(context.al, context.data.byte(kRyanpage)); - context.push(context.ax); - context.al = context.data.byte(kRyanpage); - context.ah = 0; - context.cx = 18; - context._mul(context.cx); - context.ds = context.data.word(kIcons1); - context.di = (80)+167; - context._add(context.di, context.ax); - context.bx = (58)-12; - context.ax = context.pop(); - context.ah = 0; - showframe(context); -} - -void openob(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kOpenedob); - context.ah = context.data.byte(kOpenedtype); - context.di = 5847; - copyname(context); - context.di = (80); - context.bx = (58)+86; - context.al = 62; - context.dl = 240; - printmessage(context); - context.di = context.data.word(kLastxpos); - context._add(context.di, 5); - context.bx = (58)+86; - context.es = context.cs; - context.si = 5847; - context.dl = 220; - context.al = 0; - context.ah = 0; - printdirect(context); - fillopen(context); - getopenedsize(context); - context.al = context.ah; - context.ah = 0; - context.cx = (44); - context._mul(context.cx); - context._add(context.ax, (80)); - context.bx = 2588; - context.cs.word(context.bx) = context.ax; -} - -void obicons(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCommand); - getanyad(context); - context._cmp(context.al, 255); - if (context.flags.z()) + 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::showryanpage() { + STACK_CHECK; + ds = data.word(kIcons1); + di = (80)+167; + bx = (58)-12; + al = 12; + ah = 0; + showframe(); + al = 13; + _add(al, data.byte(kRyanpage)); + push(ax); + al = data.byte(kRyanpage); + ah = 0; + cx = 18; + _mul(cx); + ds = data.word(kIcons1); + di = (80)+167; + _add(di, ax); + bx = (58)-12; + ax = pop(); + ah = 0; + showframe(); +} + +void DreamGenContext::openob() { + STACK_CHECK; + al = data.byte(kOpenedob); + ah = data.byte(kOpenedtype); + di = 5847; + copyname(); + di = (80); + bx = (58)+86; + al = 62; + dl = 240; + printmessage(); + di = data.word(kLastxpos); + _add(di, 5); + bx = (58)+86; + es = cs; + si = 5847; + dl = 220; + al = 0; + ah = 0; + printdirect(); + fillopen(); + getopenedsize(); + al = ah; + ah = 0; + cx = (44); + _mul(cx); + _add(ax, (80)); + bx = 2588; + cs.word(bx) = ax; +} + +void DreamGenContext::obicons() { + STACK_CHECK; + al = data.byte(kCommand); + getanyad(); + _cmp(al, 255); + if (flags.z()) goto cantopenit; - context.ds = context.data.word(kIcons2); - context.di = 210; - context.bx = 1; - context.al = 4; - context.ah = 0; - showframe(context); + ds = data.word(kIcons2); + di = 210; + bx = 1; + al = 4; + ah = 0; + showframe(); cantopenit: - context.ds = context.data.word(kIcons2); - context.di = 260; - context.bx = 1; - context.al = 1; - context.ah = 0; - showframe(context); -} - -void examicon(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kIcons2); - context.di = 254; - context.bx = 5; - context.al = 3; - context.ah = 0; - showframe(context); -} - -void obpicture(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - context._cmp(context.ah, 1); - if (context.flags.z()) + ds = data.word(kIcons2); + di = 260; + bx = 1; + al = 1; + ah = 0; + showframe(); +} + +void DreamGenContext::examicon() { + STACK_CHECK; + ds = data.word(kIcons2); + di = 254; + bx = 5; + al = 3; + ah = 0; + showframe(); +} + +void DreamGenContext::obpicture() { + STACK_CHECK; + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + _cmp(ah, 1); + if (flags.z()) return /* (setframe) */; - context._cmp(context.ah, 4); - if (context.flags.z()) + _cmp(ah, 4); + if (flags.z()) goto exframe; - context.ds = context.data.word(kFreeframes); - context.di = 160; - context.bx = 68; - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._inc(context.al); - context.ah = 128; - showframe(context); + ds = data.word(kFreeframes); + di = 160; + bx = 68; + cl = al; + _add(al, al); + _add(al, cl); + _inc(al); + ah = 128; + showframe(); return; exframe: - context.ds = context.data.word(kExtras); - context.di = 160; - context.bx = 68; - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._inc(context.al); - context.ah = 128; - showframe(context); -} - -void describeob(Context &context) { - STACK_CHECK(context); - getobtextstart(context); - context.di = 33; - context.bx = 92; - context.dl = 241; - context.ah = 16; - context.data.word(kCharshift) = 91+91; - printdirect(context); - context.data.word(kCharshift) = 0; - context.di = 36; - context.bx = 104; - context.dl = 241; - context.ah = 0; - printdirect(context); - context.push(context.bx); - obsthatdothings(context); - context.bx = context.pop(); - additionaltext(context); -} - -void additionaltext(Context &context) { - STACK_CHECK(context); - context._add(context.bx, 10); - context.push(context.bx); - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + ds = data.word(kExtras); + di = 160; + bx = 68; + cl = al; + _add(al, al); + _add(al, cl); + _inc(al); + ah = 128; + showframe(); +} + +void DreamGenContext::describeob() { + STACK_CHECK; + getobtextstart(); + di = 33; + bx = 92; + dl = 241; + ah = 16; + data.word(kCharshift) = 91+91; + printdirect(); + data.word(kCharshift) = 0; + di = 36; + bx = 104; + dl = 241; + ah = 0; + printdirect(); + push(bx); + obsthatdothings(); + bx = pop(); + additionaltext(); +} + +void DreamGenContext::additionaltext() { + STACK_CHECK; + _add(bx, 10); + push(bx); + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'E'; + compare(); + if (flags.z()) goto emptycup; - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'F'; + compare(); + if (flags.z()) goto fullcup; - context.bx = context.pop(); + bx = pop(); return; emptycup: - context.al = 40; - findpuztext(context); - context.bx = context.pop(); - context.di = 36; - context.dl = 241; - context.ah = 0; - printdirect(context); + al = 40; + findpuztext(); + bx = pop(); + di = 36; + dl = 241; + ah = 0; + printdirect(); return; fullcup: - context.al = 39; - findpuztext(context); - context.bx = context.pop(); - context.di = 36; - context.dl = 241; - context.ah = 0; - printdirect(context); -} - -void obsthatdothings(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - context.cl = 'M'; - context.ch = 'E'; - context.dl = 'M'; - context.dh = 'B'; - compare(context); - if (!context.flags.z()) + al = 39; + 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) */; - context.al = 4; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) + al = 4; + getlocation(); + _cmp(al, 1); + if (flags.z()) return /* (seencard) */; - context.al = 4; - setlocation(context); - lookatcard(context); -} - -void getobtextstart(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kFreedesc); - context.si = (0); - context.cx = (0+(82*2)); - context._cmp(context.data.byte(kObjecttype), 2); - if (context.flags.z()) + al = 4; + setlocation(); + lookatcard(); +} + +void DreamGenContext::getobtextstart() { + STACK_CHECK; + es = data.word(kFreedesc); + si = (0); + cx = (0+(82*2)); + _cmp(data.byte(kObjecttype), 2); + if (flags.z()) goto describe; - context.es = context.data.word(kSetdesc); - context.si = (0); - context.cx = (0+(130*2)); - context._cmp(context.data.byte(kObjecttype), 1); - if (context.flags.z()) + es = data.word(kSetdesc); + si = (0); + cx = (0+(130*2)); + _cmp(data.byte(kObjecttype), 1); + if (flags.z()) goto describe; - context.es = context.data.word(kExtras); - context.si = (0+2080+30000+(16*114)); - context.cx = (0+2080+30000+(16*114)+((114+2)*2)); + es = data.word(kExtras); + si = (0+2080+30000+(16*114)); + cx = (0+2080+30000+(16*114)+((114+2)*2)); describe: - context.al = context.data.byte(kCommand); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.ax = context.es.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context.bx = context.ax; + al = data.byte(kCommand); + ah = 0; + _add(ax, ax); + _add(si, ax); + ax = es.word(si); + _add(ax, cx); + si = ax; + bx = ax; tryagain: - context.push(context.si); - findnextcolon(context); - context.al = context.es.byte(context.si); - context.cx = context.si; - context.si = context.pop(); - context._cmp(context.data.byte(kObjecttype), 1); - if (!context.flags.z()) + push(si); + findnextcolon(); + al = es.byte(si); + cx = si; + si = pop(); + _cmp(data.byte(kObjecttype), 1); + if (!flags.z()) return /* (cantmakeoneup) */; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto findsometext; - context._cmp(context.al, ':'); - if (context.flags.z()) + _cmp(al, ':'); + if (flags.z()) goto findsometext; return; findsometext: - searchforsame(context); + searchforsame(); goto tryagain; } -void searchforsame(Context &context) { - STACK_CHECK(context); - context.si = context.cx; +void DreamGenContext::searchforsame() { + STACK_CHECK; + si = cx; searchagain: - context._inc(context.si); - context.al = context.es.byte(context.bx); + _inc(si); + al = es.byte(bx); search: - context._cmp(context.es.byte(context.si), context.al); - if (context.flags.z()) + _cmp(es.byte(si), al); + if (flags.z()) goto gotstartletter; - context._inc(context.cx); - context._inc(context.si); - context._cmp(context.si, 8000); - if (context.flags.c()) + _inc(cx); + _inc(si); + _cmp(si, 8000); + if (flags.c()) goto search; - context.si = context.bx; - context.ax = context.pop(); + si = bx; + ax = pop(); return; gotstartletter: - context.push(context.bx); - context.push(context.si); + push(bx); + push(si); keepchecking: - context._inc(context.si); - context._inc(context.bx); - context.al = context.es.byte(context.bx); - context.ah = context.es.byte(context.si); - context._cmp(context.al, ':'); - if (context.flags.z()) + _inc(si); + _inc(bx); + al = es.byte(bx); + ah = es.byte(si); + _cmp(al, ':'); + if (flags.z()) goto foundmatch; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto foundmatch; - context._cmp(context.al, context.ah); - if (context.flags.z()) + _cmp(al, ah); + if (flags.z()) goto keepchecking; - context.si = context.pop(); - context.bx = context.pop(); + si = pop(); + bx = pop(); goto searchagain; foundmatch: - context.si = context.pop(); - context.bx = context.pop(); + si = pop(); + bx = pop(); } -void findnextcolon(Context &context) { - STACK_CHECK(context); +void DreamGenContext::findnextcolon() { + STACK_CHECK; isntcolon: - context.al = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + al = es.byte(si); + _inc(si); + _cmp(al, 0); + if (flags.z()) return /* (endofcolon) */; - context._cmp(context.al, ':'); - if (!context.flags.z()) + _cmp(al, ':'); + if (!flags.z()) goto isntcolon; } -void inventory(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) +void DreamGenContext::inventory() { + STACK_CHECK; + _cmp(data.byte(kMandead), 1); + if (flags.z()) goto iswatchinv; - context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (flags.z()) goto notwatchinv; iswatchinv: - blank(context); + blank(); return; notwatchinv: - context._cmp(context.data.byte(kCommandtype), 239); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 239); + if (flags.z()) goto alreadyopinv; - context.data.byte(kCommandtype) = 239; - context.al = 32; - commandonly(context); + data.byte(kCommandtype) = 239; + al = 32; + commandonly(); alreadyopinv: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (cantopinv) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doopeninv; return; doopeninv: - context.data.word(kTimecount) = 0; - context.data.byte(kPointermode) = 0; - context.data.byte(kInmaparea) = 0; - animpointer(context); - createpanel(context); - showpanel(context); - examicon(context); - showman(context); - showexit(context); - undertextline(context); - context.data.byte(kPickup) = 0; - context.data.byte(kInvopen) = 2; - openinv(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.byte(kOpenedob) = 255; + 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; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: - context.data.byte(kInmaparea) = 0; - context.data.byte(kExamagain) = 0; - context.data.byte(kOpenedob) = 255; - context.data.byte(kOpenedtype) = 255; - context.data.byte(kInvopen) = 0; - context.al = context.data.byte(kCommandtype); - context.data.byte(kObjecttype) = context.al; - context.data.byte(kItemframe) = 0; - context.data.byte(kPointerframe) = 0; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); + 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(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.data.byte(kGetback) = 0; - context.bx = 2494; - context._cmp(context.data.byte(kInvopen), 0); - if (context.flags.z()) + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + delpointer(); + data.byte(kGetback) = 0; + bx = 2494; + _cmp(data.byte(kInvopen), 0); + if (flags.z()) goto notuseinv; - context.bx = 2556; - context._cmp(context.data.byte(kInvopen), 1); - if (context.flags.z()) + bx = 2556; + _cmp(data.byte(kInvopen), 1); + if (flags.z()) goto notuseinv; - context.bx = 2618; + bx = 2618; notuseinv: - checkcoords(context); - context._cmp(context.data.byte(kExamagain), 0); - if (context.flags.z()) + checkcoords(); + _cmp(data.byte(kExamagain), 0); + if (flags.z()) goto norex; goto examineagain; norex: - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto waitexam; - context.data.byte(kPickup) = 0; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + data.byte(kPickup) = 0; + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) goto iswatching; - context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) + _cmp(data.byte(kNewlocation), 255); + if (!flags.z()) goto justgetback; iswatching: - makemainscreen(context); - context.data.byte(kInvopen) = 0; - context.data.byte(kOpenedob) = 255; + makemainscreen(); + data.byte(kInvopen) = 0; + data.byte(kOpenedob) = 255; return; justgetback: - context.data.byte(kInvopen) = 0; - context.data.byte(kOpenedob) = 255; + data.byte(kInvopen) = 0; + data.byte(kOpenedob) = 255; } -void setpickup(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kObjecttype), 1); - if (context.flags.z()) +void DreamGenContext::setpickup() { + STACK_CHECK; + _cmp(data.byte(kObjecttype), 1); + if (flags.z()) goto cantpick; - context._cmp(context.data.byte(kObjecttype), 3); - if (context.flags.z()) + _cmp(data.byte(kObjecttype), 3); + if (flags.z()) goto cantpick; - getanyad(context); - context.al = context.es.byte(context.bx+2); - context._cmp(context.al, 4); - if (!context.flags.z()) + getanyad(); + al = es.byte(bx+2); + _cmp(al, 4); + if (!flags.z()) goto canpick; cantpick: - blank(context); + blank(); return; canpick: - context._cmp(context.data.byte(kCommandtype), 209); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 209); + if (flags.z()) goto alreadysp; - context.data.byte(kCommandtype) = 209; - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kObjecttype); - context.al = 33; - commandwithob(context); + data.byte(kCommandtype) = 209; + bl = data.byte(kCommand); + bh = data.byte(kObjecttype); + al = 33; + commandwithob(); alreadysp: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, 1); + if (!flags.z()) return /* (nosetpick) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (!flags.z()) goto dosetpick; return; dosetpick: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - examicon(context); - context.data.byte(kPickup) = 1; - context.data.byte(kInvopen) = 2; - context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) + createpanel(); + showpanel(); + showman(); + showexit(); + examicon(); + data.byte(kPickup) = 1; + data.byte(kInvopen) = 2; + _cmp(data.byte(kObjecttype), 4); + if (flags.z()) goto pickupexob; - context.al = context.data.byte(kCommand); - context.data.byte(kItemframe) = context.al; - context.data.byte(kOpenedob) = 255; - transfertoex(context); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = 4; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; - openinv(context); - worktoscreenm(context); + al = data.byte(kCommand); + data.byte(kItemframe) = al; + data.byte(kOpenedob) = 255; + transfertoex(); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = 4; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; + openinv(); + worktoscreenm(); return; pickupexob: - context.al = context.data.byte(kCommand); - context.data.byte(kItemframe) = context.al; - context.data.byte(kOpenedob) = 255; - openinv(context); - worktoscreenm(context); + al = data.byte(kCommand); + data.byte(kItemframe) = al; + data.byte(kOpenedob) = 255; + openinv(); + worktoscreenm(); } -void examinventory(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 249); - if (context.flags.z()) +void DreamGenContext::examinventory() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 249); + if (flags.z()) goto alreadyexinv; - context.data.byte(kCommandtype) = 249; - context.al = 32; - commandonly(context); + data.byte(kCommandtype) = 249; + al = 32; + commandonly(); alreadyexinv: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (!flags.z()) goto doexinv; return; doexinv: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - examicon(context); - context.data.byte(kPickup) = 0; - context.data.byte(kInvopen) = 2; - openinv(context); - worktoscreenm(context); -} - -void reexfrominv(Context &context) { - STACK_CHECK(context); - findinvpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kCommandtype) = context.ah; - context.data.byte(kCommand) = context.al; - context.data.byte(kExamagain) = 1; - context.data.byte(kPointermode) = 0; -} - -void reexfromopen(Context &context) { - STACK_CHECK(context); - return; - findopenpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kCommandtype) = context.ah; - context.data.byte(kCommand) = context.al; - context.data.byte(kExamagain) = 1; - context.data.byte(kPointermode) = 0; -} - -void swapwithinv(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kItemframe); - context.ah = context.data.byte(kObjecttype); - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + 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; +} + +void DreamGenContext::reexfromopen() { + STACK_CHECK; + return; + findopenpos(); + ax = es.word(bx); + data.byte(kCommandtype) = ah; + data.byte(kCommand) = al; + data.byte(kExamagain) = 1; + data.byte(kPointermode) = 0; +} + +void DreamGenContext::swapwithinv() { + STACK_CHECK; + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub7; - context._cmp(context.data.byte(kCommandtype), 243); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 243); + if (flags.z()) goto alreadyswap1; - context.data.byte(kCommandtype) = 243; + data.byte(kCommandtype) = 243; difsub7: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 34; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 34; + commandwithob(); alreadyswap1: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (cantswap1) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doswap1; return; doswap1: - context.ah = context.data.byte(kObjecttype); - context.al = context.data.byte(kItemframe); - context.push(context.ax); - findinvpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = context.ah; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; - context.bl = context.data.byte(kItemframe); - context.bh = context.data.byte(kObjecttype); - context.ax = context.pop(); - context.data.byte(kObjecttype) = context.ah; - context.data.byte(kItemframe) = context.al; - context.push(context.bx); - findinvpos(context); - delpointer(context); - context.al = context.data.byte(kItemframe); - geteitherad(context); - context.es.byte(context.bx+2) = 4; - context.es.byte(context.bx+3) = 255; - context.al = context.data.byte(kLastinvpos); - context.es.byte(context.bx+4) = context.al; - context.ax = context.pop(); - context.data.byte(kObjecttype) = context.ah; - context.data.byte(kItemframe) = context.al; - fillryan(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void swapwithopen(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kItemframe); - context.ah = context.data.byte(kObjecttype); - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + ah = data.byte(kObjecttype); + al = data.byte(kItemframe); + push(ax); + findinvpos(); + ax = es.word(bx); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = ah; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; + bl = data.byte(kItemframe); + bh = data.byte(kObjecttype); + ax = pop(); + data.byte(kObjecttype) = ah; + data.byte(kItemframe) = al; + push(bx); + findinvpos(); + delpointer(); + al = data.byte(kItemframe); + geteitherad(); + es.byte(bx+2) = 4; + es.byte(bx+3) = 255; + al = data.byte(kLastinvpos); + es.byte(bx+4) = al; + ax = pop(); + data.byte(kObjecttype) = ah; + data.byte(kItemframe) = al; + fillryan(); + readmouse(); + showpointer(); + worktoscreen(); + delpointer(); +} + +void DreamGenContext::swapwithopen() { + STACK_CHECK; + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub8; - context._cmp(context.data.byte(kCommandtype), 242); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 242); + if (flags.z()) goto alreadyswap2; - context.data.byte(kCommandtype) = 242; + data.byte(kCommandtype) = 242; difsub8: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 34; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 34; + commandwithob(); alreadyswap2: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (cantswap2) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doswap2; return; doswap2: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) + geteitherad(); + isitworn(); + if (!flags.z()) goto notwornswap; - wornerror(context); + wornerror(); return; notwornswap: - delpointer(context); - context.al = context.data.byte(kItemframe); - context._cmp(context.al, context.data.byte(kOpenedob)); - if (!context.flags.z()) + delpointer(); + al = data.byte(kItemframe); + _cmp(al, data.byte(kOpenedob)); + if (!flags.z()) goto isntsame2; - context.al = context.data.byte(kObjecttype); - context._cmp(context.al, context.data.byte(kOpenedtype)); - if (!context.flags.z()) + al = data.byte(kObjecttype); + _cmp(al, data.byte(kOpenedtype)); + if (!flags.z()) goto isntsame2; - errormessage1(context); + errormessage1(); return; isntsame2: - checkobjectsize(context); - context._cmp(context.al, 0); - if (context.flags.z()) + checkobjectsize(); + _cmp(al, 0); + if (flags.z()) goto sizeok2; return; sizeok2: - context.ah = context.data.byte(kObjecttype); - context.al = context.data.byte(kItemframe); - context.push(context.ax); - findopenpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = context.ah; - context._cmp(context.ah, 4); - if (!context.flags.z()) + ah = data.byte(kObjecttype); + al = data.byte(kItemframe); + push(ax); + findopenpos(); + ax = es.word(bx); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = ah; + _cmp(ah, 4); + if (!flags.z()) goto makeswapex; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; goto actuallyswap; makeswapex: - transfertoex(context); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = 4; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; + transfertoex(); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = 4; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; actuallyswap: - context.bl = context.data.byte(kItemframe); - context.bh = context.data.byte(kObjecttype); - context.ax = context.pop(); - context.data.byte(kObjecttype) = context.ah; - context.data.byte(kItemframe) = context.al; - context.push(context.bx); - findopenpos(context); - geteitherad(context); - context.al = context.data.byte(kOpenedtype); - context.es.byte(context.bx+2) = context.al; - context.al = context.data.byte(kOpenedob); - context.es.byte(context.bx+3) = context.al; - context.al = context.data.byte(kLastinvpos); - context.es.byte(context.bx+4) = context.al; - context.al = context.data.byte(kReallocation); - context.es.byte(context.bx+5) = context.al; - context.ax = context.pop(); - context.data.byte(kObjecttype) = context.ah; - context.data.byte(kItemframe) = context.al; - fillopen(context); - fillryan(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void intoinv(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPickup), 0); - if (!context.flags.z()) + bl = data.byte(kItemframe); + bh = data.byte(kObjecttype); + ax = pop(); + data.byte(kObjecttype) = ah; + data.byte(kItemframe) = al; + push(bx); + findopenpos(); + geteitherad(); + al = data.byte(kOpenedtype); + es.byte(bx+2) = al; + al = data.byte(kOpenedob); + es.byte(bx+3) = al; + al = data.byte(kLastinvpos); + es.byte(bx+4) = al; + al = data.byte(kReallocation); + es.byte(bx+5) = al; + ax = pop(); + data.byte(kObjecttype) = ah; + data.byte(kItemframe) = al; + fillopen(); + fillryan(); + undertextline(); + readmouse(); + useopened(); + showpointer(); + worktoscreen(); + delpointer(); +} + +void DreamGenContext::intoinv() { + STACK_CHECK; + _cmp(data.byte(kPickup), 0); + if (!flags.z()) goto notout; - outofinv(context); + outofinv(); return; notout: - findinvpos(context); - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + findinvpos(); + ax = es.word(bx); + _cmp(al, 255); + if (flags.z()) goto canplace1; - swapwithinv(context); + swapwithinv(); return; canplace1: - context.al = context.data.byte(kItemframe); - context.ah = context.data.byte(kObjecttype); - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub1; - context._cmp(context.data.byte(kCommandtype), 220); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 220); + if (flags.z()) goto alreadyplce; - context.data.byte(kCommandtype) = 220; + data.byte(kCommandtype) = 220; difsub1: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 35; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 35; + commandwithob(); alreadyplce: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notletgo2) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doplace; return; doplace: - delpointer(context); - context.al = context.data.byte(kItemframe); - getexad(context); - context.es.byte(context.bx+2) = 4; - context.es.byte(context.bx+3) = 255; - context.al = context.data.byte(kLastinvpos); - context.es.byte(context.bx+4) = context.al; - context.data.byte(kPickup) = 0; - fillryan(context); - readmouse(context); - showpointer(context); - outofinv(context); - worktoscreen(context); - delpointer(context); -} - -void deletetaken(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kFreedat); - context.ah = context.data.byte(kReallocation); - context.ds = context.data.word(kExtras); - context.si = (0+2080+30000); - context.cx = (114); + delpointer(); + al = data.byte(kItemframe); + 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(); +} + +void DreamGenContext::deletetaken() { + STACK_CHECK; + es = data.word(kFreedat); + ah = data.byte(kReallocation); + ds = data.word(kExtras); + si = (0+2080+30000); + cx = (114); takenloop: - context.al = context.ds.byte(context.si+11); - context._cmp(context.al, context.ah); - if (!context.flags.z()) + al = ds.byte(si+11); + _cmp(al, ah); + if (!flags.z()) goto notinhere; - context.bl = context.ds.byte(context.si+1); - context.bh = 0; - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context._add(context.bx, context.bx); - context.es.byte(context.bx+2) = 254; + bl = ds.byte(si+1); + bh = 0; + _add(bx, bx); + _add(bx, bx); + _add(bx, bx); + _add(bx, bx); + es.byte(bx+2) = 254; notinhere: - context._add(context.si, 16); - if (--context.cx) + _add(si, 16); + if (--cx) goto takenloop; } -void outofinv(Context &context) { - STACK_CHECK(context); - findinvpos(context); - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (!context.flags.z()) +void DreamGenContext::outofinv() { + STACK_CHECK; + findinvpos(); + ax = es.word(bx); + _cmp(al, 255); + if (!flags.z()) goto canpick2; - blank(context); + blank(); return; canpick2: - context.bx = context.data.word(kMousebutton); - context._cmp(context.bx, 2); - if (!context.flags.z()) + bx = data.word(kMousebutton); + _cmp(bx, 2); + if (!flags.z()) goto canpick2a; - reexfrominv(context); + reexfrominv(); return; canpick2a: - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub3; - context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 221); + if (flags.z()) goto alreadygrab; - context.data.byte(kCommandtype) = 221; + data.byte(kCommandtype) = 221; difsub3: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 36; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 36; + commandwithob(); alreadygrab: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notletgo) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dograb; return; dograb: - delpointer(context); - context.data.byte(kPickup) = 1; - findinvpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = context.ah; - getexad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; - fillryan(context); - readmouse(context); - showpointer(context); - intoinv(context); - worktoscreen(context); - delpointer(context); -} - -void getfreead(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.cl = 4; - context._shl(context.ax, context.cl); - context.bx = context.ax; - context.es = context.data.word(kFreedat); -} - -void getexad(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.bx = 16; - context._mul(context.bx); - context.bx = context.ax; - context.es = context.data.word(kExtras); - context._add(context.bx, (0+2080+30000)); -} - -void geteitherad(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) + delpointer(); + data.byte(kPickup) = 1; + findinvpos(); + ax = es.word(bx); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = ah; + getexad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; + fillryan(); + readmouse(); + showpointer(); + intoinv(); + worktoscreen(); + delpointer(); +} + +void DreamGenContext::getfreead() { + STACK_CHECK; + ah = 0; + cl = 4; + _shl(ax, cl); + bx = ax; + es = data.word(kFreedat); +} + +void DreamGenContext::getexad() { + STACK_CHECK; + ah = 0; + bx = 16; + _mul(bx); + bx = ax; + es = data.word(kExtras); + _add(bx, (0+2080+30000)); +} + +void DreamGenContext::geteitherad() { + STACK_CHECK; + _cmp(data.byte(kObjecttype), 4); + if (flags.z()) goto isinexlist; - context.al = context.data.byte(kItemframe); - getfreead(context); + al = data.byte(kItemframe); + getfreead(); return; isinexlist: - context.al = context.data.byte(kItemframe); - getexad(context); + al = data.byte(kItemframe); + getexad(); } -void getanyad(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) +void DreamGenContext::getanyad() { + STACK_CHECK; + _cmp(data.byte(kObjecttype), 4); + if (flags.z()) goto isex; - context._cmp(context.data.byte(kObjecttype), 2); - if (context.flags.z()) + _cmp(data.byte(kObjecttype), 2); + if (flags.z()) goto isfree; - context.al = context.data.byte(kCommand); - getsetad(context); - context.ax = context.es.word(context.bx+4); + al = data.byte(kCommand); + getsetad(); + ax = es.word(bx+4); return; isfree: - context.al = context.data.byte(kCommand); - getfreead(context); - context.ax = context.es.word(context.bx+7); + al = data.byte(kCommand); + getfreead(); + ax = es.word(bx+7); return; isex: - context.al = context.data.byte(kCommand); - getexad(context); - context.ax = context.es.word(context.bx+7); + al = data.byte(kCommand); + getexad(); + ax = es.word(bx+7); } -void getanyaddir(Context &context) { - STACK_CHECK(context); - context._cmp(context.ah, 4); - if (context.flags.z()) +void DreamGenContext::getanyaddir() { + STACK_CHECK; + _cmp(ah, 4); + if (flags.z()) goto isex3; - context._cmp(context.ah, 2); - if (context.flags.z()) + _cmp(ah, 2); + if (flags.z()) goto isfree3; - getsetad(context); + getsetad(); return; isfree3: - getfreead(context); + getfreead(); return; isex3: - getexad(context); + getexad(); } -void getopenedsize(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kOpenedtype), 4); - if (context.flags.z()) +void DreamGenContext::getopenedsize() { + STACK_CHECK; + _cmp(data.byte(kOpenedtype), 4); + if (flags.z()) goto isex2; - context._cmp(context.data.byte(kOpenedtype), 2); - if (context.flags.z()) + _cmp(data.byte(kOpenedtype), 2); + if (flags.z()) goto isfree2; - context.al = context.data.byte(kOpenedob); - getsetad(context); - context.ax = context.es.word(context.bx+3); + al = data.byte(kOpenedob); + getsetad(); + ax = es.word(bx+3); return; isfree2: - context.al = context.data.byte(kOpenedob); - getfreead(context); - context.ax = context.es.word(context.bx+7); + al = data.byte(kOpenedob); + getfreead(); + ax = es.word(bx+7); return; isex2: - context.al = context.data.byte(kOpenedob); - getexad(context); - context.ax = context.es.word(context.bx+7); + al = data.byte(kOpenedob); + getexad(); + ax = es.word(bx+7); } -void getsetad(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.bx = 64; - context._mul(context.bx); - context.bx = context.ax; - context.es = context.data.word(kSetdat); +void DreamGenContext::getsetad() { + STACK_CHECK; + ah = 0; + bx = 64; + _mul(bx); + bx = ax; + es = data.word(kSetdat); } -void findinvpos(Context &context) { - STACK_CHECK(context); - context.cx = context.data.word(kMousex); - context._sub(context.cx, (80)); - context.bx = -1; +void DreamGenContext::findinvpos() { + STACK_CHECK; + cx = data.word(kMousex); + _sub(cx, (80)); + bx = -1; findinv1: - context._inc(context.bx); - context._sub(context.cx, (44)); - if (!context.flags.c()) + _inc(bx); + _sub(cx, (44)); + if (!flags.c()) goto findinv1; - context.cx = context.data.word(kMousey); - context._sub(context.cx, (58)); - context._sub(context.bx, 5); + cx = data.word(kMousey); + _sub(cx, (58)); + _sub(bx, 5); findinv2: - context._add(context.bx, 5); - context._sub(context.cx, (44)); - if (!context.flags.c()) + _add(bx, 5); + _sub(cx, (44)); + if (!flags.c()) goto findinv2; - context.al = context.data.byte(kRyanpage); - context.ah = 0; - context.cx = 10; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.al = context.bl; - context.data.byte(kLastinvpos) = context.al; - context._add(context.bx, context.bx); - context.es = context.data.word(kBuffers); - context._add(context.bx, (0+(180*10)+32)); -} - -void findopenpos(Context &context) { - STACK_CHECK(context); - context.cx = context.data.word(kMousex); - context._sub(context.cx, (80)); - context.bx = -1; + al = data.byte(kRyanpage); + ah = 0; + cx = 10; + _mul(cx); + _add(bx, ax); + al = bl; + data.byte(kLastinvpos) = al; + _add(bx, bx); + es = data.word(kBuffers); + _add(bx, (0+(180*10)+32)); +} + +void DreamGenContext::findopenpos() { + STACK_CHECK; + cx = data.word(kMousex); + _sub(cx, (80)); + bx = -1; findopenp1: - context._inc(context.bx); - context._sub(context.cx, (44)); - if (!context.flags.c()) + _inc(bx); + _sub(cx, (44)); + if (!flags.c()) goto findopenp1; - context.al = context.bl; - context.data.byte(kLastinvpos) = context.al; - context._add(context.bx, context.bx); - context.es = context.data.word(kBuffers); - context._add(context.bx, (0+(180*10))); + al = bl; + data.byte(kLastinvpos) = al; + _add(bx, bx); + es = data.word(kBuffers); + _add(bx, (0+(180*10))); } -void dropobject(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 223); - if (context.flags.z()) +void DreamGenContext::dropobject() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 223); + if (flags.z()) goto alreadydrop; - context.data.byte(kCommandtype) = 223; - context._cmp(context.data.byte(kPickup), 0); - if (context.flags.z()) - { blank(context); return; }; - context.bl = context.data.byte(kItemframe); - context.bh = context.data.byte(kObjecttype); - context.al = 37; - commandwithob(context); + data.byte(kCommandtype) = 223; + _cmp(data.byte(kPickup), 0); + if (flags.z()) + { blank(); return; }; + bl = data.byte(kItemframe); + bh = data.byte(kObjecttype); + al = 37; + commandwithob(); alreadydrop: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nodrop) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dodrop; return; dodrop: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) + geteitherad(); + isitworn(); + if (!flags.z()) goto nowornerror; - wornerror(context); + wornerror(); return; nowornerror: - context._cmp(context.data.byte(kReallocation), 47); - if (context.flags.z()) + _cmp(data.byte(kReallocation), 47); + if (flags.z()) goto nodrop2; - context.cl = context.data.byte(kRyanx); - context._add(context.cl, 12); - context.ch = context.data.byte(kRyany); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) + cl = data.byte(kRyanx); + _add(cl, 12); + ch = data.byte(kRyany); + _add(ch, 12); + checkone(); + _cmp(cl, 2); + if (flags.c()) goto nodroperror; nodrop2: - droperror(context); + droperror(); return; nodroperror: - context._cmp(context.data.byte(kMapxsize), 64); - if (!context.flags.z()) + _cmp(data.byte(kMapxsize), 64); + if (!flags.z()) goto notinlift; - context._cmp(context.data.byte(kMapysize), 64); - if (!context.flags.z()) + _cmp(data.byte(kMapysize), 64); + if (!flags.z()) goto notinlift; - droperror(context); + droperror(); return; notinlift: - context.al = context.data.byte(kItemframe); - context.ah = 4; - context.cl = 'G'; - context.ch = 'U'; - context.dl = 'N'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) - { cantdrop(context); return; }; - context.al = context.data.byte(kItemframe); - context.ah = 4; - context.cl = 'S'; - context.ch = 'H'; - context.dl = 'L'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) - { cantdrop(context); return; }; - context.data.byte(kObjecttype) = 4; - context.al = context.data.byte(kItemframe); - getexad(context); - context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(kRyanx); - context._add(context.al, 4); - context.cl = 4; - context._shr(context.al, context.cl); - context._add(context.al, context.data.byte(kMapx)); - context.ah = context.data.byte(kRyany); - context._add(context.ah, 8); - context.cl = 4; - context._shr(context.ah, context.cl); - context._add(context.ah, context.data.byte(kMapy)); - context.es.byte(context.bx+3) = context.al; - context.es.byte(context.bx+5) = context.ah; - context.al = context.data.byte(kRyanx); - context._add(context.al, 4); - context._and(context.al, 15); - context.ah = context.data.byte(kRyany); - context._add(context.ah, 8); - context._and(context.ah, 15); - context.es.byte(context.bx+4) = context.al; - context.es.byte(context.bx+6) = context.ah; - context.data.byte(kPickup) = 0; - context.al = context.data.byte(kReallocation); - context.es.byte(context.bx) = context.al; -} - -void droperror(Context &context) { - STACK_CHECK(context); - context.data.byte(kCommandtype) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 56; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(kCommandtype) = 255; - worktoscreenm(context); -} - -void cantdrop(Context &context) { - STACK_CHECK(context); - context.data.byte(kCommandtype) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 24; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(kCommandtype) = 255; - worktoscreenm(context); -} - -void wornerror(Context &context) { - STACK_CHECK(context); - context.data.byte(kCommandtype) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 57; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - context.data.byte(kCommandtype) = 255; - worktoscreenm(context); -} - -void removeobfrominv(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommand), 100); - if (context.flags.z()) + al = data.byte(kItemframe); + ah = 4; + cl = 'G'; + ch = 'U'; + dl = 'N'; + dh = 'A'; + compare(); + if (flags.z()) + { cantdrop(); return; }; + al = data.byte(kItemframe); + ah = 4; + cl = 'S'; + ch = 'H'; + dl = 'L'; + dh = 'D'; + compare(); + if (flags.z()) + { cantdrop(); return; }; + data.byte(kObjecttype) = 4; + al = data.byte(kItemframe); + getexad(); + es.byte(bx+2) = 0; + al = data.byte(kRyanx); + _add(al, 4); + cl = 4; + _shr(al, cl); + _add(al, data.byte(kMapx)); + ah = data.byte(kRyany); + _add(ah, 8); + cl = 4; + _shr(ah, cl); + _add(ah, data.byte(kMapy)); + es.byte(bx+3) = al; + es.byte(bx+5) = ah; + al = data.byte(kRyanx); + _add(al, 4); + _and(al, 15); + ah = data.byte(kRyany); + _add(ah, 8); + _and(ah, 15); + es.byte(bx+4) = al; + es.byte(bx+6) = ah; + data.byte(kPickup) = 0; + al = data.byte(kReallocation); + 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() { + STACK_CHECK; + _cmp(data.byte(kCommand), 100); + if (flags.z()) return /* (obnotexist) */; - getanyad(context); - context.di = context.bx; - context.cl = context.data.byte(kCommand); - context.ch = 0; - deleteexobject(context); -} - -void selectopenob(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCommand); - getanyad(context); - context._cmp(context.al, 255); - if (!context.flags.z()) + getanyad(); + di = bx; + cl = data.byte(kCommand); + ch = 0; + deleteexobject(); +} + +void DreamGenContext::selectopenob() { + STACK_CHECK; + al = data.byte(kCommand); + getanyad(); + _cmp(al, 255); + if (!flags.z()) goto canopenit1; - blank(context); + blank(); return; canopenit1: - context._cmp(context.data.byte(kCommandtype), 224); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 224); + if (flags.z()) goto alreadyopob; - context.data.byte(kCommandtype) = 224; - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kObjecttype); - context.al = 38; - commandwithob(context); + data.byte(kCommandtype) = 224; + bl = data.byte(kCommand); + bh = data.byte(kObjecttype); + al = 38; + commandwithob(); alreadyopob: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noopenob) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doopenob; return; doopenob: - context.al = context.data.byte(kCommand); - context.data.byte(kOpenedob) = context.al; - context.al = context.data.byte(kObjecttype); - context.data.byte(kOpenedtype) = context.al; - createpanel(context); - showpanel(context); - showman(context); - examicon(context); - showexit(context); - openinv(context); - openob(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void useopened(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kOpenedob), 255); - if (context.flags.z()) + al = data.byte(kCommand); + 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() { + STACK_CHECK; + _cmp(data.byte(kOpenedob), 255); + if (flags.z()) return /* (cannotuseopen) */; - context._cmp(context.data.byte(kPickup), 0); - if (!context.flags.z()) + _cmp(data.byte(kPickup), 0); + if (!flags.z()) goto notout2; - outofopen(context); + outofopen(); return; notout2: - findopenpos(context); - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + findopenpos(); + ax = es.word(bx); + _cmp(al, 255); + if (flags.z()) goto canplace3; - swapwithopen(context); + swapwithopen(); return; canplace3: - context._cmp(context.data.byte(kPickup), 1); - if (context.flags.z()) + _cmp(data.byte(kPickup), 1); + if (flags.z()) goto intoopen; - blank(context); + blank(); return; intoopen: - context.al = context.data.byte(kItemframe); - context.ah = context.data.byte(kObjecttype); - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub2; - context._cmp(context.data.byte(kCommandtype), 227); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 227); + if (flags.z()) goto alreadyplc2; - context.data.byte(kCommandtype) = 227; + data.byte(kCommandtype) = 227; difsub2: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 35; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 35; + commandwithob(); alreadyplc2: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notletgo3) */; - context._cmp(context.ax, 1); - if (context.flags.z()) + _cmp(ax, 1); + if (flags.z()) goto doplace2; return; doplace2: - geteitherad(context); - isitworn(context); - if (!context.flags.z()) + geteitherad(); + isitworn(); + if (!flags.z()) goto notworntoopen; - wornerror(context); + wornerror(); return; notworntoopen: - delpointer(context); - context.al = context.data.byte(kItemframe); - context._cmp(context.al, context.data.byte(kOpenedob)); - if (!context.flags.z()) + delpointer(); + al = data.byte(kItemframe); + _cmp(al, data.byte(kOpenedob)); + if (!flags.z()) goto isntsame; - context.al = context.data.byte(kObjecttype); - context._cmp(context.al, context.data.byte(kOpenedtype)); - if (!context.flags.z()) + al = data.byte(kObjecttype); + _cmp(al, data.byte(kOpenedtype)); + if (!flags.z()) goto isntsame; - errormessage1(context); + errormessage1(); return; isntsame: - checkobjectsize(context); - context._cmp(context.al, 0); - if (context.flags.z()) + checkobjectsize(); + _cmp(al, 0); + if (flags.z()) goto sizeok1; return; sizeok1: - context.data.byte(kPickup) = 0; - context.al = context.data.byte(kItemframe); - geteitherad(context); - context.al = context.data.byte(kOpenedtype); - context.es.byte(context.bx+2) = context.al; - context.al = context.data.byte(kOpenedob); - context.es.byte(context.bx+3) = context.al; - context.al = context.data.byte(kLastinvpos); - context.es.byte(context.bx+4) = context.al; - context.al = context.data.byte(kReallocation); - context.es.byte(context.bx+5) = context.al; - fillopen(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void errormessage1(Context &context) { - STACK_CHECK(context); - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 58; - context.dl = 240; - printmessage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void errormessage2(Context &context) { - STACK_CHECK(context); - context.data.byte(kCommandtype) = 255; - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 59; - context.dl = 240; - printmessage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void errormessage3(Context &context) { - STACK_CHECK(context); - delpointer(context); - context.di = 76; - context.bx = 21; - context.al = 60; - context.dl = 240; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - showpanel(context); - showman(context); - examicon(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void checkobjectsize(Context &context) { - STACK_CHECK(context); - getopenedsize(context); - context.push(context.ax); - context.al = context.data.byte(kItemframe); - geteitherad(context); - context.al = context.es.byte(context.bx+9); - context.cx = context.pop(); - context._cmp(context.al, 255); - if (!context.flags.z()) + data.byte(kPickup) = 0; + al = data.byte(kItemframe); + geteitherad(); + al = data.byte(kOpenedtype); + es.byte(bx+2) = al; + al = data.byte(kOpenedob); + es.byte(bx+3) = al; + al = data.byte(kLastinvpos); + 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(); +} + +void DreamGenContext::errormessage3() { + 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(); + push(ax); + al = data.byte(kItemframe); + geteitherad(); + al = es.byte(bx+9); + cx = pop(); + _cmp(al, 255); + if (!flags.z()) goto notunsized; - context.al = 6; + al = 6; notunsized: - context._cmp(context.al, 100); - if (!context.flags.c()) + _cmp(al, 100); + if (!flags.c()) goto specialcase; - context._cmp(context.cl, 100); - if (context.flags.c()) + _cmp(cl, 100); + if (flags.c()) goto isntspecial; - errormessage3(context); + errormessage3(); goto sizewrong; isntspecial: - context._cmp(context.cl, context.al); - if (!context.flags.c()) + _cmp(cl, al); + if (!flags.c()) goto sizeok; specialcase: - context._sub(context.al, 100); - context._cmp(context.cl, 100); - if (!context.flags.c()) + _sub(al, 100); + _cmp(cl, 100); + if (!flags.c()) goto bothspecial; - context._cmp(context.cl, context.al); - if (!context.flags.c()) + _cmp(cl, al); + if (!flags.c()) goto sizeok; - errormessage2(context); + errormessage2(); goto sizewrong; bothspecial: - context._sub(context.cl, 100); - context._cmp(context.al, context.cl); - if (context.flags.z()) + _sub(cl, 100); + _cmp(al, cl); + if (flags.z()) goto sizeok; - errormessage3(context); + errormessage3(); sizewrong: - context.al = 1; + al = 1; return; sizeok: - context.al = 0; + al = 0; } -void outofopen(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kOpenedob), 255); - if (context.flags.z()) +void DreamGenContext::outofopen() { + STACK_CHECK; + _cmp(data.byte(kOpenedob), 255); + if (flags.z()) goto cantuseopen; - findopenpos(context); - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (!context.flags.z()) + findopenpos(); + ax = es.word(bx); + _cmp(al, 255); + if (!flags.z()) goto canpick4; cantuseopen: - blank(context); + blank(); return; canpick4: - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto difsub4; - context._cmp(context.data.byte(kCommandtype), 228); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 228); + if (flags.z()) goto alreadygrb; - context.data.byte(kCommandtype) = 228; + data.byte(kCommandtype) = 228; difsub4: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 36; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 36; + commandwithob(); alreadygrb: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notletgo4) */; - context._cmp(context.ax, 1); - if (context.flags.z()) + _cmp(ax, 1); + if (flags.z()) goto dogrb; - context._cmp(context.ax, 2); - if (!context.flags.z()) + _cmp(ax, 2); + if (!flags.z()) return /* (notletgo4) */; - reexfromopen(context); + reexfromopen(); return; dogrb: - delpointer(context); - context.data.byte(kPickup) = 1; - findopenpos(context); - context.ax = context.es.word(context.bx); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = context.ah; - context._cmp(context.ah, 4); - if (!context.flags.z()) + delpointer(); + data.byte(kPickup) = 1; + findopenpos(); + ax = es.word(bx); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = ah; + _cmp(ah, 4); + if (!flags.z()) goto makeintoex; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; goto actuallyout; makeintoex: - transfertoex(context); - context.data.byte(kItemframe) = context.al; - context.data.byte(kObjecttype) = 4; - geteitherad(context); - context.es.byte(context.bx+2) = 20; - context.es.byte(context.bx+3) = 255; + transfertoex(); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = 4; + geteitherad(); + es.byte(bx+2) = 20; + es.byte(bx+3) = 255; actuallyout: - fillopen(context); - undertextline(context); - readmouse(context); - useopened(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void transfertoex(Context &context) { - STACK_CHECK(context); - emergencypurge(context); - getexpos(context); - context.al = context.data.byte(kExpos); - context.push(context.ax); - context.push(context.di); - context.al = context.data.byte(kItemframe); - context.ah = 0; - context.bx = 16; - context._mul(context.bx); - context.ds = context.data.word(kFreedat); - context.si = context.ax; - context.cx = 8; - context._movsw(context.cx); - context.di = context.pop(); - context.al = context.data.byte(kReallocation); - context.es.byte(context.di) = context.al; - context.es.byte(context.di+11) = context.al; - context.al = context.data.byte(kItemframe); - context.es.byte(context.di+1) = context.al; - context.es.byte(context.di+2) = 4; - context.es.byte(context.di+3) = 255; - context.al = context.data.byte(kLastinvpos); - context.es.byte(context.di+4) = context.al; - context.al = context.data.byte(kItemframe); - context.data.byte(kItemtotran) = context.al; - transfermap(context); - transferinv(context); - transfertext(context); - context.al = context.data.byte(kItemframe); - context.ah = 0; - context.bx = 16; - context._mul(context.bx); - context.ds = context.data.word(kFreedat); - context.si = context.ax; - context.ds.byte(context.si+2) = 254; - pickupconts(context); - context.ax = context.pop(); -} - -void pickupconts(Context &context) { - STACK_CHECK(context); - context.al = context.ds.byte(context.si+7); - context._cmp(context.al, 255); - if (context.flags.z()) + fillopen(); + undertextline(); + readmouse(); + useopened(); + showpointer(); + worktoscreen(); + delpointer(); +} + +void DreamGenContext::transfertoex() { + STACK_CHECK; + emergencypurge(); + getexpos(); + al = data.byte(kExpos); + push(ax); + push(di); + al = data.byte(kItemframe); + ah = 0; + bx = 16; + _mul(bx); + ds = data.word(kFreedat); + si = ax; + cx = 8; + _movsw(cx); + di = pop(); + al = data.byte(kReallocation); + es.byte(di) = al; + es.byte(di+11) = al; + al = data.byte(kItemframe); + es.byte(di+1) = al; + es.byte(di+2) = 4; + es.byte(di+3) = 255; + al = data.byte(kLastinvpos); + es.byte(di+4) = al; + al = data.byte(kItemframe); + data.byte(kItemtotran) = al; + transfermap(); + transferinv(); + transfertext(); + al = data.byte(kItemframe); + ah = 0; + bx = 16; + _mul(bx); + ds = data.word(kFreedat); + si = ax; + ds.byte(si+2) = 254; + pickupconts(); + ax = pop(); +} + +void DreamGenContext::pickupconts() { + STACK_CHECK; + al = ds.byte(si+7); + _cmp(al, 255); + if (flags.z()) return /* (notopenable) */; - context.al = context.data.byte(kItemframe); - context.ah = context.data.byte(kObjecttype); - context.dl = context.data.byte(kExpos); - context.es = context.data.word(kFreedat); - context.bx = 0; - context.cx = 0; + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + dl = data.byte(kExpos); + es = data.word(kFreedat); + bx = 0; + cx = 0; pickupcontloop: - context.push(context.cx); - context.push(context.es); - context.push(context.bx); - context.push(context.dx); - context.push(context.ax); - context._cmp(context.es.byte(context.bx+2), context.ah); - if (!context.flags.z()) + push(cx); + push(es); + push(bx); + push(dx); + push(ax); + _cmp(es.byte(bx+2), ah); + if (!flags.z()) goto notinsidethis; - context._cmp(context.es.byte(context.bx+3), context.al); - if (!context.flags.z()) + _cmp(es.byte(bx+3), al); + if (!flags.z()) goto notinsidethis; - context.data.byte(kItemtotran) = context.cl; - transfercontoex(context); + data.byte(kItemtotran) = cl; + transfercontoex(); notinsidethis: - context.ax = context.pop(); - context.dx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - context._inc(context.cx); - context._cmp(context.cx, 80); - if (!context.flags.z()) + ax = pop(); + dx = pop(); + bx = pop(); + es = pop(); + cx = pop(); + _add(bx, 16); + _inc(cx); + _cmp(cx, 80); + if (!flags.z()) goto pickupcontloop; } -void transfercontoex(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.push(context.dx); - context.push(context.es); - context.push(context.bx); - getexpos(context); - context.si = context.pop(); - context.ds = context.pop(); - context.push(context.di); - context.cx = 8; - context._movsw(context.cx); - context.di = context.pop(); - context.dx = context.pop(); - context.al = context.data.byte(kReallocation); - context.es.byte(context.di) = context.al; - context.es.byte(context.di+11) = context.al; - context.al = context.data.byte(kItemtotran); - context.es.byte(context.di+1) = context.al; - context.es.byte(context.di+3) = context.dl; - context.es.byte(context.di+2) = 4; - transfermap(context); - transferinv(context); - transfertext(context); - context.si = context.pop(); - context.ds = context.pop(); - context.ds.byte(context.si+2) = 255; -} - -void transfertext(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kExtras); - context.al = context.data.byte(kExpos); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = (0+2080+30000+(16*114)); - context._add(context.bx, context.ax); - context.di = context.data.word(kExtextpos); - context.es.word(context.bx) = context.di; - context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2))); - context.al = context.data.byte(kItemtotran); - context.ah = 0; - context._add(context.ax, context.ax); - context.ds = context.data.word(kFreedesc); - context.bx = (0); - context._add(context.bx, context.ax); - context.si = (0+(82*2)); - context.ax = context.ds.word(context.bx); - context._add(context.si, context.ax); +void DreamGenContext::transfercontoex() { + STACK_CHECK; + push(es); + push(bx); + push(dx); + push(es); + push(bx); + getexpos(); + si = pop(); + ds = pop(); + push(di); + cx = 8; + _movsw(cx); + di = pop(); + dx = pop(); + al = data.byte(kReallocation); + es.byte(di) = al; + es.byte(di+11) = al; + al = data.byte(kItemtotran); + es.byte(di+1) = al; + es.byte(di+3) = dl; + es.byte(di+2) = 4; + 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: - context._lodsb(); - context._stosb(); - context._inc(context.data.word(kExtextpos)); - context._cmp(context.al, 0); - if (!context.flags.z()) + _lodsb(); + _stosb(); + _inc(data.word(kExtextpos)); + _cmp(al, 0); + if (!flags.z()) goto moretext; } -void getexpos(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kExtras); - context.al = 0; - context.di = (0+2080+30000); +void DreamGenContext::getexpos() { + STACK_CHECK; + es = data.word(kExtras); + al = 0; + di = (0+2080+30000); tryanotherex: - context._cmp(context.es.byte(context.di+2), 255); - if (context.flags.z()) + _cmp(es.byte(di+2), 255); + if (flags.z()) goto foundnewex; - context._add(context.di, 16); - context._inc(context.al); - context._cmp(context.al, (114)); - if (!context.flags.z()) + _add(di, 16); + _inc(al); + _cmp(al, (114)); + if (!flags.z()) goto tryanotherex; foundnewex: - context.data.byte(kExpos) = context.al; + data.byte(kExpos) = al; } -void purgealocation(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.es = context.data.word(kExtras); - context.di = (0+2080+30000); - context.bx = context.pop(); - context.cx = 0; +void DreamGenContext::purgealocation() { + STACK_CHECK; + push(ax); + es = data.word(kExtras); + di = (0+2080+30000); + bx = pop(); + cx = 0; purgeloc: - context._cmp(context.bl, context.es.byte(context.di+0)); - if (!context.flags.z()) + _cmp(bl, es.byte(di+0)); + if (!flags.z()) goto dontpurge; - context._cmp(context.es.byte(context.di+2), 0); - if (!context.flags.z()) + _cmp(es.byte(di+2), 0); + if (!flags.z()) goto dontpurge; - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.push(context.cx); - deleteexobject(context); - context.cx = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); + push(di); + push(es); + push(bx); + push(cx); + deleteexobject(); + cx = pop(); + bx = pop(); + es = pop(); + di = pop(); dontpurge: - context._add(context.di, 16); - context._inc(context.cx); - context._cmp(context.cx, (114)); - if (!context.flags.z()) + _add(di, 16); + _inc(cx); + _cmp(cx, (114)); + if (!flags.z()) goto purgeloc; } -void emergencypurge(Context &context) { - STACK_CHECK(context); +void DreamGenContext::emergencypurge() { + STACK_CHECK; checkpurgeagain: - context.ax = context.data.word(kExframepos); - context._add(context.ax, 4000); - context._cmp(context.ax, (30000)); - if (context.flags.c()) + ax = data.word(kExframepos); + _add(ax, 4000); + _cmp(ax, (30000)); + if (flags.c()) goto notnearframeend; - purgeanitem(context); + purgeanitem(); goto checkpurgeagain; notnearframeend: - context.ax = context.data.word(kExtextpos); - context._add(context.ax, 400); - context._cmp(context.ax, (18000)); - if (context.flags.c()) + ax = data.word(kExtextpos); + _add(ax, 400); + _cmp(ax, (18000)); + if (flags.c()) return /* (notneartextend) */; - purgeanitem(context); + purgeanitem(); goto checkpurgeagain; } -void purgeanitem(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kExtras); - context.di = (0+2080+30000); - context.bl = context.data.byte(kReallocation); - context.cx = 0; +void DreamGenContext::purgeanitem() { + STACK_CHECK; + es = data.word(kExtras); + di = (0+2080+30000); + bl = data.byte(kReallocation); + cx = 0; lookforpurge: - context.al = context.es.byte(context.di+2); - context._cmp(context.al, 0); - if (!context.flags.z()) + al = es.byte(di+2); + _cmp(al, 0); + if (!flags.z()) goto cantpurge; - context._cmp(context.es.byte(context.di+12), 2); - if (context.flags.z()) + _cmp(es.byte(di+12), 2); + if (flags.z()) goto iscup; - context._cmp(context.es.byte(context.di+12), 255); - if (!context.flags.z()) + _cmp(es.byte(di+12), 255); + if (!flags.z()) goto cantpurge; iscup: - context._cmp(context.es.byte(context.di+11), context.bl); - if (context.flags.z()) + _cmp(es.byte(di+11), bl); + if (flags.z()) goto cantpurge; - deleteexobject(context); + deleteexobject(); return; cantpurge: - context._add(context.di, 16); - context._inc(context.cx); - context._cmp(context.cx, (114)); - if (!context.flags.z()) + _add(di, 16); + _inc(cx); + _cmp(cx, (114)); + if (!flags.z()) goto lookforpurge; - context.di = (0+2080+30000); - context.bl = context.data.byte(kReallocation); - context.cx = 0; + di = (0+2080+30000); + bl = data.byte(kReallocation); + cx = 0; lookforpurge2: - context.al = context.es.byte(context.di+2); - context._cmp(context.al, 0); - if (!context.flags.z()) + al = es.byte(di+2); + _cmp(al, 0); + if (!flags.z()) goto cantpurge2; - context._cmp(context.es.byte(context.di+12), 255); - if (!context.flags.z()) + _cmp(es.byte(di+12), 255); + if (!flags.z()) goto cantpurge2; - deleteexobject(context); + deleteexobject(); return; cantpurge2: - context._add(context.di, 16); - context._inc(context.cx); - context._cmp(context.cx, (114)); - if (!context.flags.z()) + _add(di, 16); + _inc(cx); + _cmp(cx, (114)); + if (!flags.z()) goto lookforpurge2; } -void deleteexobject(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - context.push(context.cx); - context.push(context.cx); - context.push(context.cx); - context.al = 255; - context.cx = 16; - context._stosb(context.cx); - context.ax = context.pop(); - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - deleteexframe(context); - context.ax = context.pop(); - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._inc(context.al); - deleteexframe(context); - context.ax = context.pop(); - deleteextext(context); - context.bx = context.pop(); - context.bh = context.bl; - context.bl = 4; - context.di = (0+2080+30000); - context.cx = 0; +void DreamGenContext::deleteexobject() { + STACK_CHECK; + push(cx); + push(cx); + push(cx); + push(cx); + al = 255; + cx = 16; + _stosb(cx); + ax = pop(); + cl = al; + _add(al, al); + _add(al, cl); + deleteexframe(); + ax = pop(); + cl = al; + _add(al, al); + _add(al, cl); + _inc(al); + deleteexframe(); + ax = pop(); + deleteextext(); + bx = pop(); + bh = bl; + bl = 4; + di = (0+2080+30000); + cx = 0; deleteconts: - context._cmp(context.es.word(context.di+2), context.bx); - if (!context.flags.z()) + _cmp(es.word(di+2), bx); + if (!flags.z()) goto notinsideex; - context.push(context.bx); - context.push(context.cx); - context.push(context.di); - deleteexobject(context); - context.di = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); + push(bx); + push(cx); + push(di); + deleteexobject(); + di = pop(); + cx = pop(); + bx = pop(); notinsideex: - context._add(context.di, 16); - context._inc(context.cx); - context._cmp(context.cx, (114)); - if (!context.flags.z()) + _add(di, 16); + _inc(cx); + _cmp(cx, (114)); + if (!flags.z()) goto deleteconts; } -void deleteexframe(Context &context) { - STACK_CHECK(context); - context.di = (0); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context.al = context.es.byte(context.di); - context.ah = 0; - context.cl = context.es.byte(context.di+1); - context.ch = 0; - context._mul(context.cx); - context.si = context.es.word(context.di+2); - context.push(context.si); - context._add(context.si, (0+2080)); - context.cx = (30000); - context._sub(context.cx, context.es.word(context.di+2)); - context.di = context.si; - context._add(context.si, context.ax); - context.push(context.ax); - context.ds = context.es; - context._movsb(context.cx); - context.bx = context.pop(); - context._sub(context.data.word(kExframepos), context.bx); - context.si = context.pop(); - context.cx = (114)*3; - context.di = (0); +void DreamGenContext::deleteexframe() { + STACK_CHECK; + di = (0); + ah = 0; + _add(ax, ax); + _add(di, ax); + _add(ax, ax); + _add(di, ax); + al = es.byte(di); + ah = 0; + cl = es.byte(di+1); + ch = 0; + _mul(cx); + si = es.word(di+2); + push(si); + _add(si, (0+2080)); + cx = (30000); + _sub(cx, es.word(di+2)); + di = si; + _add(si, ax); + push(ax); + ds = es; + _movsb(cx); + bx = pop(); + _sub(data.word(kExframepos), bx); + si = pop(); + cx = (114)*3; + di = (0); shuffleadsdown: - context.ax = context.es.word(context.di+2); - context._cmp(context.ax, context.si); - if (context.flags.c()) + ax = es.word(di+2); + _cmp(ax, si); + if (flags.c()) goto beforethisone; - context._sub(context.ax, context.bx); + _sub(ax, bx); beforethisone: - context.es.word(context.di+2) = context.ax; - context._add(context.di, 6); - if (--context.cx) + es.word(di+2) = ax; + _add(di, 6); + if (--cx) goto shuffleadsdown; } -void deleteextext(Context &context) { - STACK_CHECK(context); - context.di = (0+2080+30000+(16*114)); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.di, context.ax); - context.ax = context.es.word(context.di); - context.si = context.ax; - context.di = context.ax; - context._add(context.si, (0+2080+30000+(16*114)+((114+2)*2))); - context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2))); - context.ax = 0; +void DreamGenContext::deleteextext() { + STACK_CHECK; + di = (0+2080+30000+(16*114)); + ah = 0; + _add(ax, ax); + _add(di, ax); + ax = es.word(di); + si = ax; + di = ax; + _add(si, (0+2080+30000+(16*114)+((114+2)*2))); + _add(di, (0+2080+30000+(16*114)+((114+2)*2))); + ax = 0; findlenextext: - context.cl = context.es.byte(context.si); - context._inc(context.ax); - context._inc(context.si); - context._cmp(context.cl, 0); - if (!context.flags.z()) + cl = es.byte(si); + _inc(ax); + _inc(si); + _cmp(cl, 0); + if (!flags.z()) goto findlenextext; - context.cx = (18000); - context.bx = context.si; - context._sub(context.bx, (0+2080+30000+(16*114)+((114+2)*2))); - context.push(context.bx); - context.push(context.ax); - context._sub(context.cx, context.bx); - context._movsb(context.cx); - context.bx = context.pop(); - context._sub(context.data.word(kExtextpos), context.bx); - context.si = context.pop(); - context.cx = (114); - context.di = (0+2080+30000+(16*114)); + cx = (18000); + bx = si; + _sub(bx, (0+2080+30000+(16*114)+((114+2)*2))); + push(bx); + push(ax); + _sub(cx, bx); + _movsb(cx); + bx = pop(); + _sub(data.word(kExtextpos), bx); + si = pop(); + cx = (114); + di = (0+2080+30000+(16*114)); shuffletextads: - context.ax = context.es.word(context.di); - context._cmp(context.ax, context.si); - if (context.flags.c()) + ax = es.word(di); + _cmp(ax, si); + if (flags.c()) goto beforethistext; - context._sub(context.ax, context.bx); + _sub(ax, bx); beforethistext: - context.es.word(context.di) = context.ax; - context._add(context.di, 2); - if (--context.cx) + es.word(di) = ax; + _add(di, 2); + if (--cx) goto shuffletextads; } -void blockget(Context &context) { - STACK_CHECK(context); - context.ah = context.al; - context.al = 0; - context.ds = context.data.word(kBackdrop); - context.si = (0+192); - context._add(context.si, context.ax); -} - -void drawfloor(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - eraseoldobs(context); - drawflags(context); - calcmapad(context); - doblocks(context); - showallobs(context); - showallfree(context); - showallex(context); - paneltomap(context); - initrain(context); - context.data.byte(kNewobs) = 0; - context.bx = context.pop(); - context.es = context.pop(); -} - -void calcmapad(Context &context) { - STACK_CHECK(context); - getdimension(context); - context.push(context.cx); - context.push(context.dx); - context.al = 11; - context._sub(context.al, context.dl); - context._sub(context.al, context.cl); - context._sub(context.al, context.cl); - context.ax.cbw(); - context.bx = 8; - context._mul(context.bx); - context._add(context.ax, context.data.word(kMapoffsetx)); - context.data.word(kMapadx) = context.ax; - context.dx = context.pop(); - context.cx = context.pop(); - context.al = 10; - context._sub(context.al, context.dh); - context._sub(context.al, context.ch); - context._sub(context.al, context.ch); - context.ax.cbw(); - context.bx = 8; - context._mul(context.bx); - context._add(context.ax, context.data.word(kMapoffsety)); - context.data.word(kMapady) = context.ax; -} - -void getdimension(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)); - context.ch = 0; +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::calcmapad() { + STACK_CHECK; + getdimension(); + push(cx); + push(dx); + al = 11; + _sub(al, dl); + _sub(al, cl); + _sub(al, cl); + ax.cbw(); + bx = 8; + _mul(bx); + _add(ax, data.word(kMapoffsetx)); + data.word(kMapadx) = ax; + dx = pop(); + cx = pop(); + al = 10; + _sub(al, dh); + _sub(al, ch); + _sub(al, ch); + ax.cbw(); + bx = 8; + _mul(bx); + _add(ax, data.word(kMapoffsety)); + data.word(kMapady) = ax; +} + +void DreamGenContext::getdimension() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)); + ch = 0; dimloop1: - addalong(context); - context._cmp(context.al, 0); - if (!context.flags.z()) + addalong(); + _cmp(al, 0); + if (!flags.z()) goto finishdim1; - context._inc(context.ch); + _inc(ch); goto dimloop1; finishdim1: - context.bx = (0+(180*10)+32+60+(32*32)); - context.cl = 0; + bx = (0+(180*10)+32+60+(32*32)); + cl = 0; dimloop2: - context.push(context.bx); - addlength(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) + push(bx); + addlength(); + bx = pop(); + _cmp(al, 0); + if (!flags.z()) goto finishdim2; - context._inc(context.cl); - context._add(context.bx, 3); + _inc(cl); + _add(bx, 3); goto dimloop2; finishdim2: - context.bx = (0+(180*10)+32+60+(32*32))+(11*3*9); - context.dh = 10; + bx = (0+(180*10)+32+60+(32*32))+(11*3*9); + dh = 10; dimloop3: - context.push(context.bx); - addalong(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) + push(bx); + addalong(); + bx = pop(); + _cmp(al, 0); + if (!flags.z()) goto finishdim3; - context._dec(context.dh); - context._sub(context.bx, 11*3); + _dec(dh); + _sub(bx, 11*3); goto dimloop3; finishdim3: - context.bx = (0+(180*10)+32+60+(32*32))+(3*10); - context.dl = 11; + bx = (0+(180*10)+32+60+(32*32))+(3*10); + dl = 11; dimloop4: - context.push(context.bx); - addlength(context); - context.bx = context.pop(); - context._cmp(context.al, 0); - if (!context.flags.z()) + push(bx); + addlength(); + bx = pop(); + _cmp(al, 0); + if (!flags.z()) goto finishdim4; - context._dec(context.dl); - context._sub(context.bx, 3); + _dec(dl); + _sub(bx, 3); goto dimloop4; finishdim4: - context.al = context.cl; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.word(kMapxstart) = context.ax; - context.al = context.ch; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.word(kMapystart) = context.ax; - context._sub(context.dl, context.cl); - context._sub(context.dh, context.ch); - context.al = context.dl; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.byte(kMapxsize) = context.al; - context.al = context.dh; - context.ah = 0; - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context._shl(context.ax, 1); - context.data.byte(kMapysize) = context.al; -} - -void addalong(Context &context) { - STACK_CHECK(context); - context.ah = 11; + al = cl; + ah = 0; + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + data.word(kMapxstart) = ax; + al = ch; + ah = 0; + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + data.word(kMapystart) = ax; + _sub(dl, cl); + _sub(dh, ch); + al = dl; + ah = 0; + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + data.byte(kMapxsize) = al; + al = dh; + ah = 0; + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + _shl(ax, 1); + data.byte(kMapysize) = al; +} + +void DreamGenContext::addalong() { + STACK_CHECK; + ah = 11; addloop: - context._cmp(context.es.byte(context.bx), 0); - if (!context.flags.z()) + _cmp(es.byte(bx), 0); + if (!flags.z()) goto gotalong; - context._add(context.bx, 3); - context._dec(context.ah); - if (!context.flags.z()) + _add(bx, 3); + _dec(ah); + if (!flags.z()) goto addloop; - context.al = 0; + al = 0; return; gotalong: - context.al = 1; + al = 1; } -void addlength(Context &context) { - STACK_CHECK(context); - context.ah = 10; +void DreamGenContext::addlength() { + STACK_CHECK; + ah = 10; addloop2: - context._cmp(context.es.byte(context.bx), 0); - if (!context.flags.z()) + _cmp(es.byte(bx), 0); + if (!flags.z()) goto gotlength; - context._add(context.bx, 3*11); - context._dec(context.ah); - if (!context.flags.z()) + _add(bx, 3*11); + _dec(ah); + if (!flags.z()) goto addloop2; - context.al = 0; + al = 0; return; gotlength: - context.al = 1; -} - -void drawflags(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+32+60+(32*32)); - context.al = context.data.byte(kMapy); - context.ah = 0; - context.cx = (66); - context._mul(context.cx); - context.bl = context.data.byte(kMapx); - context.bh = 0; - context._add(context.ax, context.bx); - context.si = (0); - context._add(context.si, context.ax); - context.cx = 10; + al = 1; +} + +void DreamGenContext::drawflags() { + STACK_CHECK; + es = data.word(kBuffers); + di = (0+(180*10)+32+60+(32*32)); + al = data.byte(kMapy); + ah = 0; + cx = (66); + _mul(cx); + bl = data.byte(kMapx); + bh = 0; + _add(ax, bx); + si = (0); + _add(si, ax); + cx = 10; _tmp28: - context.push(context.cx); - context.cx = 11; + push(cx); + cx = 11; _tmp28a: - context.ds = context.data.word(kMapdata); - context._lodsb(); - context.ds = context.data.word(kBackdrop); - context.push(context.si); - context.push(context.ax); - context.ah = 0; - context._add(context.ax, context.ax); - context.si = (0); - context._add(context.si, context.ax); - context._movsw(); - context.ax = context.pop(); - context._stosb(); - context.si = context.pop(); - if (--context.cx) + ds = data.word(kMapdata); + _lodsb(); + ds = data.word(kBackdrop); + push(si); + push(ax); + ah = 0; + _add(ax, ax); + si = (0); + _add(si, ax); + _movsw(); + ax = pop(); + _stosb(); + si = pop(); + if (--cx) goto _tmp28a; - context._add(context.si, (66)-11); - context.cx = context.pop(); - if (--context.cx) + _add(si, (66)-11); + cx = pop(); + if (--cx) goto _tmp28; } -void eraseoldobs(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNewobs), 0); - if (context.flags.z()) +void DreamGenContext::eraseoldobs() { + STACK_CHECK; + _cmp(data.byte(kNewobs), 0); + if (flags.z()) return /* (donterase) */; - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - context.cx = 16; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + cx = 16; oberase: - context.push(context.cx); - context.push(context.bx); - context.ax = context.es.word(context.bx+20); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + push(cx); + push(bx); + ax = es.word(bx+20); + _cmp(ax, 0x0ffff); + if (flags.z()) goto notthisob; - context.di = context.bx; - context.al = 255; - context.cx = (32); - context._stosb(context.cx); + di = bx; + al = 255; + cx = (32); + _stosb(cx); notthisob: - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, (32)); - if (--context.cx) + bx = pop(); + cx = pop(); + _add(bx, (32)); + if (--cx) goto oberase; } -void showallobs(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); - context.data.word(kListpos) = context.bx; - context.di = context.bx; - context.cx = 128*5; - context.al = 255; - context._stosb(context.cx); - context.es = context.data.word(kSetframes); - context.data.word(kFrsegment) = context.es; - context.ax = (0); - context.data.word(kDataad) = context.ax; - context.ax = (0+2080); - context.data.word(kFramesad) = context.ax; - context.data.byte(kCurrentob) = 0; - context.ds = context.data.word(kSetdat); - context.si = 0; - context.cx = 128; +void DreamGenContext::showallobs() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + data.word(kListpos) = bx; + di = bx; + cx = 128*5; + al = 255; + _stosb(cx); + es = data.word(kSetframes); + data.word(kFrsegment) = es; + ax = (0); + data.word(kDataad) = ax; + ax = (0+2080); + data.word(kFramesad) = ax; + data.byte(kCurrentob) = 0; + ds = data.word(kSetdat); + si = 0; + cx = 128; showobsloop: - context.push(context.cx); - context.push(context.si); - context.push(context.si); - context._add(context.si, 58); - context.es = context.data.word(kSetdat); - getmapad(context); - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) + push(cx); + push(si); + push(si); + _add(si, 58); + es = data.word(kSetdat); + getmapad(); + si = pop(); + _cmp(ch, 0); + if (flags.z()) goto blankframe; - context.al = context.es.byte(context.si+18); - context.ah = 0; - context.data.word(kCurrentframe) = context.ax; - context._cmp(context.al, 255); - if (context.flags.z()) + al = es.byte(si+18); + ah = 0; + data.word(kCurrentframe) = ax; + _cmp(al, 255); + if (flags.z()) goto blankframe; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.al = context.es.byte(context.si+18); - context.es.byte(context.si+17) = context.al; - context._cmp(context.es.byte(context.si+8), 0); - if (!context.flags.z()) + push(es); + push(si); + calcfrframe(); + finalframe(); + si = pop(); + es = pop(); + al = es.byte(si+18); + es.byte(si+17) = al; + _cmp(es.byte(si+8), 0); + if (!flags.z()) goto animating; - context._cmp(context.es.byte(context.si+5), 5); - if (context.flags.z()) + _cmp(es.byte(si+5), 5); + if (flags.z()) goto animating; - context._cmp(context.es.byte(context.si+5), 6); - if (context.flags.z()) + _cmp(es.byte(si+5), 6); + if (flags.z()) goto animating; - context.ax = context.data.word(kCurrentframe); - context.ah = 0; - context._add(context.di, context.data.word(kMapadx)); - context._add(context.bx, context.data.word(kMapady)); - showframe(context); + ax = data.word(kCurrentframe); + ah = 0; + _add(di, data.word(kMapadx)); + _add(bx, data.word(kMapady)); + showframe(); goto drawnsetob; animating: - makebackob(context); + makebackob(); drawnsetob: - context.si = context.data.word(kListpos); - context.es = context.data.word(kBuffers); - context.al = context.data.byte(kSavex); - context.ah = context.data.byte(kSavey); - context.es.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(kSavesize); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.es.word(context.si+2) = context.ax; - context.al = context.data.byte(kCurrentob); - context.es.byte(context.si+4) = context.al; - context._add(context.si, 5); - context.data.word(kListpos) = context.si; + si = data.word(kListpos); + es = data.word(kBuffers); + al = data.byte(kSavex); + ah = data.byte(kSavey); + es.word(si) = ax; + cx = ax; + ax = data.word(kSavesize); + _add(al, cl); + _add(ah, ch); + es.word(si+2) = ax; + al = data.byte(kCurrentob); + es.byte(si+4) = al; + _add(si, 5); + data.word(kListpos) = si; blankframe: - context._inc(context.data.byte(kCurrentob)); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 64); - context._dec(context.cx); - if (context.flags.z()) + _inc(data.byte(kCurrentob)); + si = pop(); + cx = pop(); + _add(si, 64); + _dec(cx); + if (flags.z()) return /* (finishedsetobs) */; goto showobsloop; } -void makebackob(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNewobs), 0); - if (context.flags.z()) +void DreamGenContext::makebackob() { + STACK_CHECK; + _cmp(data.byte(kNewobs), 0); + if (flags.z()) return /* (nomake) */; - context.al = context.es.byte(context.si+5); - context.ah = context.es.byte(context.si+8); - context.push(context.si); - context.push(context.ax); - context.push(context.si); - context.ax = context.data.word(kObjectx); - context.bx = context.data.word(kObjecty); - context.ah = context.bl; - context.si = context.ax; - context.cx = 49520; - context.dx = context.data.word(kSetframes); - context.di = (0); - makesprite(context); - context.ax = context.pop(); - context.es.word(context.bx+20) = context.ax; - context.ax = context.pop(); - context._cmp(context.al, 255); - if (!context.flags.z()) + al = es.byte(si+5); + ah = es.byte(si+8); + push(si); + push(ax); + push(si); + ax = data.word(kObjectx); + bx = data.word(kObjecty); + ah = bl; + si = ax; + cx = 49520; + dx = data.word(kSetframes); + di = (0); + makesprite(); + ax = pop(); + es.word(bx+20) = ax; + ax = pop(); + _cmp(al, 255); + if (!flags.z()) goto usedpriority; - context.al = 0; + al = 0; usedpriority: - context.es.byte(context.bx+23) = context.al; - context.es.byte(context.bx+30) = context.ah; - context.es.byte(context.bx+16) = 0; - context.es.byte(context.bx+18) = 0; - context.es.byte(context.bx+19) = 0; - context.si = context.pop(); -} - -void showallfree(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - context.data.word(kListpos) = context.bx; - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - context.cx = 80*5; - context.al = 255; - context._stosb(context.cx); - context.es = context.data.word(kFreeframes); - context.data.word(kFrsegment) = context.es; - context.ax = (0); - context.data.word(kDataad) = context.ax; - context.ax = (0+2080); - context.data.word(kFramesad) = context.ax; - context.al = 0; - context.data.byte(kCurrentfree) = context.al; - context.ds = context.data.word(kFreedat); - context.si = 2; - context.cx = 0; + es.byte(bx+23) = al; + es.byte(bx+30) = ah; + es.byte(bx+16) = 0; + es.byte(bx+18) = 0; + es.byte(bx+19) = 0; + si = pop(); +} + +void DreamGenContext::showallfree() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + data.word(kListpos) = bx; + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + cx = 80*5; + al = 255; + _stosb(cx); + es = data.word(kFreeframes); + data.word(kFrsegment) = es; + ax = (0); + data.word(kDataad) = ax; + ax = (0+2080); + data.word(kFramesad) = ax; + al = 0; + data.byte(kCurrentfree) = al; + ds = data.word(kFreedat); + si = 2; + cx = 0; loop127: - context.push(context.cx); - context.push(context.si); - context.push(context.si); - context.es = context.data.word(kFreedat); - getmapad(context); - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) + push(cx); + push(si); + push(si); + es = data.word(kFreedat); + getmapad(); + si = pop(); + _cmp(ch, 0); + if (flags.z()) goto over138; - context.al = context.data.byte(kCurrentfree); - context.ah = 0; - context.dx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.dx); - context.data.word(kCurrentframe) = context.ax; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - context.es = context.data.word(kMapstore); - context.ds = context.data.word(kFrsegment); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context._cmp(context.cx, 0); - if (context.flags.z()) + al = data.byte(kCurrentfree); + ah = 0; + dx = ax; + _add(ax, ax); + _add(ax, dx); + data.word(kCurrentframe) = ax; + push(es); + push(si); + calcfrframe(); + es = data.word(kMapstore); + ds = data.word(kFrsegment); + finalframe(); + si = pop(); + es = pop(); + _cmp(cx, 0); + if (flags.z()) goto over138; - context.ax = context.data.word(kCurrentframe); - context.ah = 0; - context._add(context.di, context.data.word(kMapadx)); - context._add(context.bx, context.data.word(kMapady)); - showframe(context); - context.si = context.data.word(kListpos); - context.es = context.data.word(kBuffers); - context.al = context.data.byte(kSavex); - context.ah = context.data.byte(kSavey); - context.es.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(kSavesize); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.es.word(context.si+2) = context.ax; - context.ax = context.pop(); - context.cx = context.pop(); - context.push(context.cx); - context.push(context.ax); - context.es.byte(context.si+4) = context.cl; - context._add(context.si, 5); - context.data.word(kListpos) = context.si; + ax = data.word(kCurrentframe); + ah = 0; + _add(di, data.word(kMapadx)); + _add(bx, data.word(kMapady)); + showframe(); + si = data.word(kListpos); + es = data.word(kBuffers); + al = data.byte(kSavex); + ah = data.byte(kSavey); + es.word(si) = ax; + cx = ax; + ax = data.word(kSavesize); + _add(al, cl); + _add(ah, ch); + es.word(si+2) = ax; + ax = pop(); + cx = pop(); + push(cx); + push(ax); + es.byte(si+4) = cl; + _add(si, 5); + data.word(kListpos) = si; over138: - context._inc(context.data.byte(kCurrentfree)); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 16); - context._inc(context.cx); - context._cmp(context.cx, 80); - if (context.flags.z()) + _inc(data.byte(kCurrentfree)); + si = pop(); + cx = pop(); + _add(si, 16); + _inc(cx); + _cmp(cx, 80); + if (flags.z()) return /* (finfree) */; goto loop127; } -void showallex(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); - context.data.word(kListpos) = context.bx; - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); - context.cx = 100*5; - context.al = 255; - context._stosb(context.cx); - context.es = context.data.word(kExtras); - context.data.word(kFrsegment) = context.es; - context.ax = (0); - context.data.word(kDataad) = context.ax; - context.ax = (0+2080); - context.data.word(kFramesad) = context.ax; - context.data.byte(kCurrentex) = 0; - context.si = (0+2080+30000)+2; - context.cx = 0; +void DreamGenContext::showallex() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + data.word(kListpos) = bx; + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + cx = 100*5; + al = 255; + _stosb(cx); + es = data.word(kExtras); + data.word(kFrsegment) = es; + ax = (0); + data.word(kDataad) = ax; + ax = (0+2080); + data.word(kFramesad) = ax; + data.byte(kCurrentex) = 0; + si = (0+2080+30000)+2; + cx = 0; exloop: - context.push(context.cx); - context.push(context.si); - context.es = context.data.word(kExtras); - context.push(context.si); - context.ch = 0; - context._cmp(context.es.byte(context.si), 255); - if (context.flags.z()) + push(cx); + push(si); + es = data.word(kExtras); + push(si); + ch = 0; + _cmp(es.byte(si), 255); + if (flags.z()) goto notinroom; - context.al = context.es.byte(context.si-2); - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + al = es.byte(si-2); + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto notinroom; - getmapad(context); + getmapad(); notinroom: - context.si = context.pop(); - context._cmp(context.ch, 0); - if (context.flags.z()) + si = pop(); + _cmp(ch, 0); + if (flags.z()) goto blankex; - context.al = context.data.byte(kCurrentex); - context.ah = 0; - context.dx = context.ax; - context._add(context.ax, context.ax); - context._add(context.ax, context.dx); - context.data.word(kCurrentframe) = context.ax; - context.push(context.es); - context.push(context.si); - calcfrframe(context); - context.es = context.data.word(kMapstore); - context.ds = context.data.word(kFrsegment); - finalframe(context); - context.si = context.pop(); - context.es = context.pop(); - context._cmp(context.cx, 0); - if (context.flags.z()) + al = data.byte(kCurrentex); + ah = 0; + dx = ax; + _add(ax, ax); + _add(ax, dx); + data.word(kCurrentframe) = ax; + push(es); + push(si); + calcfrframe(); + es = data.word(kMapstore); + ds = data.word(kFrsegment); + finalframe(); + si = pop(); + es = pop(); + _cmp(cx, 0); + if (flags.z()) goto blankex; - context.ax = context.data.word(kCurrentframe); - context.ah = 0; - context._add(context.di, context.data.word(kMapadx)); - context._add(context.bx, context.data.word(kMapady)); - showframe(context); - context.si = context.data.word(kListpos); - context.es = context.data.word(kBuffers); - context.al = context.data.byte(kSavex); - context.ah = context.data.byte(kSavey); - context.es.word(context.si) = context.ax; - context.cx = context.ax; - context.ax = context.data.word(kSavesize); - context._add(context.al, context.cl); - context._add(context.ah, context.ch); - context.es.word(context.si+2) = context.ax; - context.ax = context.pop(); - context.cx = context.pop(); - context.push(context.cx); - context.push(context.ax); - context.es.byte(context.si+4) = context.cl; - context._add(context.si, 5); - context.data.word(kListpos) = context.si; + ax = data.word(kCurrentframe); + ah = 0; + _add(di, data.word(kMapadx)); + _add(bx, data.word(kMapady)); + showframe(); + si = data.word(kListpos); + es = data.word(kBuffers); + al = data.byte(kSavex); + ah = data.byte(kSavey); + es.word(si) = ax; + cx = ax; + ax = data.word(kSavesize); + _add(al, cl); + _add(ah, ch); + es.word(si+2) = ax; + ax = pop(); + cx = pop(); + push(cx); + push(ax); + es.byte(si+4) = cl; + _add(si, 5); + data.word(kListpos) = si; blankex: - context._inc(context.data.byte(kCurrentex)); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 16); - context._inc(context.cx); - context._cmp(context.cx, 100); - if (context.flags.z()) + _inc(data.byte(kCurrentex)); + si = pop(); + cx = pop(); + _add(si, 16); + _inc(cx); + _cmp(cx, 100); + if (flags.z()) return /* (finex) */; goto exloop; } -void calcfrframe(Context &context) { - STACK_CHECK(context); - context.dx = context.data.word(kFrsegment); - context.ax = context.data.word(kFramesad); - context.push(context.ax); - context.cx = context.data.word(kDataad); - context.ax = context.data.word(kCurrentframe); - context.ds = context.dx; - context.bx = 6; - context._mul(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.cx = context.ds.word(context.bx); - context.ax = context.ds.word(context.bx+2); - context.dx = context.ds.word(context.bx+4); - context.bx = context.pop(); - context.push(context.dx); - context._add(context.ax, context.bx); - context.data.word(kSavesource) = context.ax; - context.data.word(kSavesize) = context.cx; - context.ax = context.pop(); - context.push(context.ax); - context.ah = 0; - context.data.word(kOffsetx) = context.ax; - context.ax = context.pop(); - context.al = context.ah; - context.ah = 0; - context.data.word(kOffsety) = context.ax; - return; - context.ax = context.pop(); - context.cx = 0; - context.data.word(kSavesize) = context.cx; -} - -void finalframe(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kObjecty); - context._add(context.ax, context.data.word(kOffsety)); - context.bx = context.data.word(kObjectx); - context._add(context.bx, context.data.word(kOffsetx)); - context.data.byte(kSavex) = context.bl; - context.data.byte(kSavey) = context.al; - context.di = context.data.word(kObjectx); - context.bx = context.data.word(kObjecty); -} - -void adjustlen(Context &context) { - STACK_CHECK(context); - context.ah = context.al; - context._add(context.al, context.ch); - context._cmp(context.al, 100); - if (context.flags.c()) +void DreamGenContext::calcfrframe() { + STACK_CHECK; + dx = data.word(kFrsegment); + ax = data.word(kFramesad); + push(ax); + cx = data.word(kDataad); + ax = data.word(kCurrentframe); + ds = dx; + bx = 6; + _mul(bx); + _add(ax, cx); + bx = ax; + cx = ds.word(bx); + ax = ds.word(bx+2); + dx = ds.word(bx+4); + bx = pop(); + push(dx); + _add(ax, bx); + data.word(kSavesource) = ax; + data.word(kSavesize) = cx; + ax = pop(); + push(ax); + ah = 0; + data.word(kOffsetx) = ax; + ax = pop(); + al = ah; + ah = 0; + data.word(kOffsety) = ax; + return; + ax = pop(); + cx = 0; + data.word(kSavesize) = cx; +} + +void DreamGenContext::finalframe() { + STACK_CHECK; + ax = data.word(kObjecty); + _add(ax, data.word(kOffsety)); + bx = data.word(kObjectx); + _add(bx, data.word(kOffsetx)); + data.byte(kSavex) = bl; + data.byte(kSavey) = al; + di = data.word(kObjectx); + bx = data.word(kObjecty); +} + +void DreamGenContext::adjustlen() { + STACK_CHECK; + ah = al; + _add(al, ch); + _cmp(al, 100); + if (flags.c()) return /* (over242) */; - context.al = 224; - context._sub(context.al, context.ch); - context.ch = context.al; + al = 224; + _sub(al, ch); + ch = al; } -void getmapad(Context &context) { - STACK_CHECK(context); - getxad(context); - context._cmp(context.ch, 0); - if (context.flags.z()) +void DreamGenContext::getmapad() { + STACK_CHECK; + getxad(); + _cmp(ch, 0); + if (flags.z()) return /* (over146) */; - context.data.word(kObjectx) = context.ax; - getyad(context); - context._cmp(context.ch, 0); - if (context.flags.z()) + data.word(kObjectx) = ax; + getyad(); + _cmp(ch, 0); + if (flags.z()) return /* (over146) */; - context.data.word(kObjecty) = context.ax; - context.ch = 1; -} - -void getxad(Context &context) { - STACK_CHECK(context); - context.cl = context.es.byte(context.si); - context._inc(context.si); - context.al = context.es.byte(context.si); - context._inc(context.si); - context.ah = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.cl, 0); - if (!context.flags.z()) + data.word(kObjecty) = ax; + ch = 1; +} + +void DreamGenContext::getxad() { + STACK_CHECK; + cl = es.byte(si); + _inc(si); + al = es.byte(si); + _inc(si); + ah = es.byte(si); + _inc(si); + _cmp(cl, 0); + if (!flags.z()) goto over148; - context._sub(context.al, context.data.byte(kMapx)); - if (context.flags.c()) + _sub(al, data.byte(kMapx)); + if (flags.c()) goto over148; - context._cmp(context.al, 11); - if (!context.flags.c()) + _cmp(al, 11); + if (!flags.c()) goto over148; - context.cl = 4; - context._shl(context.al, context.cl); - context._or(context.al, context.ah); - context.ah = 0; - context.ch = 1; + cl = 4; + _shl(al, cl); + _or(al, ah); + ah = 0; + ch = 1; return; over148: - context.ch = 0; + ch = 0; } -void getyad(Context &context) { - STACK_CHECK(context); - context.al = context.es.byte(context.si); - context._inc(context.si); - context.ah = context.es.byte(context.si); - context._inc(context.si); - context._sub(context.al, context.data.byte(kMapy)); - if (context.flags.c()) +void DreamGenContext::getyad() { + STACK_CHECK; + al = es.byte(si); + _inc(si); + ah = es.byte(si); + _inc(si); + _sub(al, data.byte(kMapy)); + if (flags.c()) goto over147; - context._cmp(context.al, 10); - if (!context.flags.c()) + _cmp(al, 10); + if (!flags.c()) goto over147; - context.cl = 4; - context._shl(context.al, context.cl); - context._or(context.al, context.ah); - context.ah = 0; - context.ch = 1; + cl = 4; + _shl(al, cl); + _or(al, ah); + ah = 0; + ch = 1; return; over147: - context.ch = 0; + ch = 0; } -void autolook(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousex); - context._cmp(context.ax, context.data.word(kOldx)); - if (!context.flags.z()) +void DreamGenContext::autolook() { + STACK_CHECK; + ax = data.word(kMousex); + _cmp(ax, data.word(kOldx)); + if (!flags.z()) goto diffmouse; - context.ax = context.data.word(kMousey); - context._cmp(context.ax, context.data.word(kOldy)); - if (!context.flags.z()) + ax = data.word(kMousey); + _cmp(ax, data.word(kOldy)); + if (!flags.z()) goto diffmouse; - context._dec(context.data.word(kLookcounter)); - context._cmp(context.data.word(kLookcounter), 0); - if (!context.flags.z()) + _dec(data.word(kLookcounter)); + _cmp(data.word(kLookcounter), 0); + if (!flags.z()) return /* (noautolook) */; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) return /* (noautolook) */; - dolook(context); + dolook(); return; diffmouse: - context.data.word(kLookcounter) = 1000; -} - -void look(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 241); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 241; - context.al = 25; - commandonly(context); + data.byte(kCommandtype) = 241; + al = 25; + commandonly(); alreadylook: - context._cmp(context.data.word(kMousebutton), 1); - if (!context.flags.z()) + _cmp(data.word(kMousebutton), 1); + if (!flags.z()) return /* (nolook) */; - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nolook) */; - dolook(context); -} - -void dolook(Context &context) { - STACK_CHECK(context); - createpanel(context); - showicon(context); - undertextline(context); - worktoscreenm(context); - context.data.byte(kCommandtype) = 255; - dumptextline(context); - context.bl = context.data.byte(kRoomnum); - context._and(context.bl, 31); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kRoomdesc); - context._add(context.bx, (0)); - context.si = context.es.word(context.bx); - context._add(context.si, (0+(38*2))); - findnextcolon(context); - context.di = 66; - context._cmp(context.data.byte(kReallocation), 50); - if (context.flags.c()) + 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; - context.di = 40; + di = 40; notdream3: - context.bx = 80; - context.dl = 241; - printslow(context); - context._cmp(context.al, 1); - if (context.flags.z()) + bx = 80; + dl = 241; + printslow(); + _cmp(al, 1); + if (flags.z()) goto afterlook; - context.cx = 400; - hangonp(context); + cx = 400; + hangonp(); afterlook: - context.data.byte(kPointermode) = 0; - context.data.byte(kCommandtype) = 0; - redrawmainscrn(context); - worktoscreenm(context); -} - -void redrawmainscrn(Context &context) { - STACK_CHECK(context); - context.data.word(kTimecount) = 0; - createpanel(context); - context.data.byte(kNewobs) = 0; - drawfloor(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); - undertextline(context); - readmouse(context); - context.data.byte(kCommandtype) = 255; -} - -void getback1(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPickup), 0); - if (context.flags.z()) + 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(context); + blank(); return; notgotobject: - context._cmp(context.data.byte(kCommandtype), 202); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 202); + if (flags.z()) goto alreadyget; - context.data.byte(kCommandtype) = 202; - context.al = 26; - commandonly(context); + data.byte(kCommandtype) = 202; + al = 26; + commandonly(); alreadyget: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nogetback) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dogetback; return; dogetback: - context.data.byte(kGetback) = 1; - context.data.byte(kPickup) = 0; -} - -void talk(Context &context) { - STACK_CHECK(context); - context.data.byte(kTalkpos) = 0; - context.data.byte(kInmaparea) = 0; - context.al = context.data.byte(kCommand); - context.data.byte(kCharacter) = context.al; - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - undertextline(context); - convicons(context); - starttalk(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); + 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(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.data.byte(kGetback) = 0; - context.bx = 2660; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + data.byte(kGetback) = 0; + bx = 2660; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto waittalk; - context.bx = context.data.word(kPersondata); - context.es = context.cs; - context._cmp(context.data.byte(kTalkpos), 4); - if (context.flags.c()) + bx = data.word(kPersondata); + es = cs; + _cmp(data.byte(kTalkpos), 4); + if (flags.c()) goto notnexttalk; - context.al = context.es.byte(context.bx+7); - context._or(context.al, 128); - context.es.byte(context.bx+7) = context.al; + al = es.byte(bx+7); + _or(al, 128); + es.byte(bx+7) = al; notnexttalk: - redrawmainscrn(context); - worktoscreenm(context); - context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) + redrawmainscrn(); + worktoscreenm(); + _cmp(data.byte(kSpeechloaded), 1); + if (!flags.z()) return /* (nospeech) */; - cancelch1(context); - context.data.byte(kVolumedirection) = -1; - context.data.byte(kVolumeto) = 0; -} - -void convicons(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - getpersframe(context); - context.di = 234; - context.bx = 2; - context.data.word(kCurrentframe) = context.ax; - findsource(context); - context.ax = context.data.word(kCurrentframe); - context._sub(context.ax, context.data.word(kTakeoff)); - context.ah = 0; - showframe(context); -} - -void getpersframe(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kPeople); - context._add(context.bx, (0)); - context.ax = context.es.word(context.bx); -} - -void starttalk(Context &context) { - STACK_CHECK(context); - context.data.byte(kTalkmode) = 0; - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - getpersontext(context); - context.data.word(kCharshift) = 91+91; - context.di = 66; - context.bx = 64; - context.dl = 241; - context.al = 0; - context.ah = 79; - printdirect(context); - context.data.word(kCharshift) = 0; - context.di = 66; - context.bx = 80; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(kSpeechloaded) = 0; - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cl = 'C'; - context.dl = 'R'; - context.dh = context.data.byte(kReallocation); - loadspeech(context); - context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) + 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() { + STACK_CHECK; + data.byte(kTalkmode) = 0; + al = data.byte(kCharacter); + _and(al, 127); + getpersontext(); + data.word(kCharshift) = 91+91; + di = 66; + bx = 64; + dl = 241; + al = 0; + ah = 79; + printdirect(); + data.word(kCharshift) = 0; + di = 66; + bx = 80; + dl = 241; + al = 0; + ah = 0; + printdirect(); + data.byte(kSpeechloaded) = 0; + al = data.byte(kCharacter); + _and(al, 127); + ah = 0; + cx = 64; + _mul(cx); + cl = 'C'; + dl = 'R'; + dh = data.byte(kReallocation); + loadspeech(); + _cmp(data.byte(kSpeechloaded), 1); + if (!flags.z()) return /* (nospeech1) */; - context.data.byte(kVolumedirection) = 1; - context.data.byte(kVolumeto) = 6; - context.al = 50+12; - playchannel1(context); -} - -void getpersontext(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.cx = 64*2; - context._mul(context.cx); - context.si = context.ax; - context.es = context.data.word(kPeople); - context._add(context.si, (0+24)); - context.cx = (0+24+(1026*2)); - context.ax = context.es.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; -} - -void moretalk(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kTalkmode), 0); - if (context.flags.z()) + data.byte(kVolumedirection) = 1; + data.byte(kVolumeto) = 6; + al = 50+12; + playchannel1(); +} + +void DreamGenContext::getpersontext() { + STACK_CHECK; + ah = 0; + cx = 64*2; + _mul(cx); + si = ax; + es = data.word(kPeople); + _add(si, (0+24)); + cx = (0+24+(1026*2)); + ax = es.word(si); + _add(ax, cx); + si = ax; +} + +void DreamGenContext::moretalk() { + STACK_CHECK; + _cmp(data.byte(kTalkmode), 0); + if (flags.z()) goto canmore; - redes(context); + redes(); return; canmore: - context._cmp(context.data.byte(kCommandtype), 215); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 215); + if (flags.z()) goto alreadymore; - context.data.byte(kCommandtype) = 215; - context.al = 49; - commandonly(context); + data.byte(kCommandtype) = 215; + al = 49; + commandonly(); alreadymore: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nomore) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto domoretalk; return; domoretalk: - context.data.byte(kTalkmode) = 2; - context.data.byte(kTalkpos) = 4; - context._cmp(context.data.byte(kCharacter), 100); - if (context.flags.c()) + data.byte(kTalkmode) = 2; + data.byte(kTalkpos) = 4; + _cmp(data.byte(kCharacter), 100); + if (flags.c()) goto notsecondpart; - context.data.byte(kTalkpos) = 48; + data.byte(kTalkpos) = 48; notsecondpart: - dosometalk(context); + dosometalk(); } -void dosometalk(Context &context) { - STACK_CHECK(context); +void DreamGenContext::dosometalk() { + STACK_CHECK; dospeech: - context.al = context.data.byte(kTalkpos); - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cx = context.ax; - context.al = context.data.byte(kTalkpos); - context.ah = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.ax); - context.si = context.ax; - context.es = context.data.word(kPeople); - context._add(context.si, (0+24)); - context.cx = (0+24+(1026*2)); - context.ax = context.es.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) + al = data.byte(kTalkpos); + al = data.byte(kCharacter); + _and(al, 127); + ah = 0; + cx = 64; + _mul(cx); + cx = ax; + al = data.byte(kTalkpos); + ah = 0; + _add(ax, cx); + _add(ax, ax); + si = ax; + es = data.word(kPeople); + _add(si, (0+24)); + cx = (0+24+(1026*2)); + ax = es.word(si); + _add(ax, cx); + si = ax; + _cmp(es.byte(si), 0); + if (flags.z()) goto endheartalk; - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 164; - context.bx = 64; - context.dl = 144; - context.al = 0; - context.ah = 0; - printdirect(context); - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cl = context.data.byte(kTalkpos); - context.ch = 0; - context._add(context.ax, context.cx); - context.cl = 'C'; - context.dl = 'R'; - context.dh = context.data.byte(kReallocation); - loadspeech(context); - context._cmp(context.data.byte(kSpeechloaded), 0); - if (context.flags.z()) + push(es); + push(si); + createpanel(); + showpanel(); + showman(); + showexit(); + convicons(); + si = pop(); + es = pop(); + di = 164; + bx = 64; + dl = 144; + al = 0; + ah = 0; + printdirect(); + al = data.byte(kCharacter); + _and(al, 127); + ah = 0; + cx = 64; + _mul(cx); + cl = data.byte(kTalkpos); + ch = 0; + _add(ax, cx); + cl = 'C'; + dl = 'R'; + dh = data.byte(kReallocation); + loadspeech(); + _cmp(data.byte(kSpeechloaded), 0); + if (flags.z()) goto noplay1; - context.al = 62; - playchannel1(context); + al = 62; + playchannel1(); noplay1: - context.data.byte(kPointermode) = 3; - worktoscreenm(context); - context.cx = 180; - hangonpq(context); - if (!context.flags.c()) + data.byte(kPointermode) = 3; + worktoscreenm(); + cx = 180; + hangonpq(); + if (!flags.c()) goto _tmp1; return; _tmp1: - context._inc(context.data.byte(kTalkpos)); - context.al = context.data.byte(kTalkpos); - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cx = context.ax; - context.al = context.data.byte(kTalkpos); - context.ah = 0; - context._add(context.ax, context.cx); - context._add(context.ax, context.ax); - context.si = context.ax; - context.es = context.data.word(kPeople); - context._add(context.si, (0+24)); - context.cx = (0+24+(1026*2)); - context.ax = context.es.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context._cmp(context.es.byte(context.si), 0); - if (context.flags.z()) + _inc(data.byte(kTalkpos)); + al = data.byte(kTalkpos); + al = data.byte(kCharacter); + _and(al, 127); + ah = 0; + cx = 64; + _mul(cx); + cx = ax; + al = data.byte(kTalkpos); + ah = 0; + _add(ax, cx); + _add(ax, ax); + si = ax; + es = data.word(kPeople); + _add(si, (0+24)); + cx = (0+24+(1026*2)); + ax = es.word(si); + _add(ax, cx); + si = ax; + _cmp(es.byte(si), 0); + if (flags.z()) goto endheartalk; - context._cmp(context.es.byte(context.si), ':'); - if (context.flags.z()) + _cmp(es.byte(si), ':'); + if (flags.z()) goto skiptalk2; - context._cmp(context.es.byte(context.si), 32); - if (context.flags.z()) + _cmp(es.byte(si), 32); + if (flags.z()) goto skiptalk2; - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 48; - context.bx = 128; - context.dl = 144; - context.al = 0; - context.ah = 0; - printdirect(context); - context.al = context.data.byte(kCharacter); - context._and(context.al, 127); - context.ah = 0; - context.cx = 64; - context._mul(context.cx); - context.cl = context.data.byte(kTalkpos); - context.ch = 0; - context._add(context.ax, context.cx); - context.cl = 'C'; - context.dl = 'R'; - context.dh = context.data.byte(kReallocation); - loadspeech(context); - context._cmp(context.data.byte(kSpeechloaded), 0); - if (context.flags.z()) + push(es); + push(si); + createpanel(); + showpanel(); + showman(); + showexit(); + convicons(); + si = pop(); + es = pop(); + di = 48; + bx = 128; + dl = 144; + al = 0; + ah = 0; + printdirect(); + al = data.byte(kCharacter); + _and(al, 127); + ah = 0; + cx = 64; + _mul(cx); + cl = data.byte(kTalkpos); + ch = 0; + _add(ax, cx); + cl = 'C'; + dl = 'R'; + dh = data.byte(kReallocation); + loadspeech(); + _cmp(data.byte(kSpeechloaded), 0); + if (flags.z()) goto noplay2; - context.al = 62; - playchannel1(context); + al = 62; + playchannel1(); noplay2: - context.data.byte(kPointermode) = 3; - worktoscreenm(context); - context.cx = 180; - hangonpq(context); - if (!context.flags.c()) + data.byte(kPointermode) = 3; + worktoscreenm(); + cx = 180; + hangonpq(); + if (!flags.c()) goto skiptalk2; return; skiptalk2: - context._inc(context.data.byte(kTalkpos)); + _inc(data.byte(kTalkpos)); goto dospeech; endheartalk: - context.data.byte(kPointermode) = 0; + data.byte(kPointermode) = 0; } -void hangonpq(Context &context) { - STACK_CHECK(context); - context.data.byte(kGetback) = 0; - context.bx = 0; +void DreamGenContext::hangonpq() { + STACK_CHECK; + data.byte(kGetback) = 0; + bx = 0; hangloopq: - context.push(context.cx); - context.push(context.bx); - delpointer(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 2692; - checkcoords(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) + push(cx); + push(bx); + delpointer(); + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 2692; + checkcoords(); + bx = pop(); + cx = pop(); + _cmp(data.byte(kGetback), 1); + if (flags.z()) goto quitconv; - context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) + _cmp(data.byte(kSpeechloaded), 1); + if (!flags.z()) goto notspeaking; - context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) + _cmp(data.byte(kCh1playing), 255); + if (!flags.z()) goto notspeaking; - context._inc(context.bx); - context._cmp(context.bx, 40); - if (context.flags.z()) + _inc(bx); + _cmp(bx, 40); + if (flags.z()) goto finishconv; notspeaking: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) goto hangloopq; - context._cmp(context.data.word(kOldbutton), 0); - if (!context.flags.z()) + _cmp(data.word(kOldbutton), 0); + if (!flags.z()) goto hangloopq; finishconv: - delpointer(context); - context.data.byte(kPointermode) = 0; - context.flags._c = false; + delpointer(); + data.byte(kPointermode) = 0; + flags._c = false; return; quitconv: - delpointer(context); - context.data.byte(kPointermode) = 0; - cancelch1(context); - context.flags._c = true; + delpointer(); + data.byte(kPointermode) = 0; + cancelch1(); + flags._c = true; } -void redes(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCh1playing), 255); - if (!context.flags.z()) +void DreamGenContext::redes() { + STACK_CHECK; + _cmp(data.byte(kCh1playing), 255); + if (!flags.z()) goto cantredes; - context._cmp(context.data.byte(kTalkmode), 2); - if (context.flags.z()) + _cmp(data.byte(kTalkmode), 2); + if (flags.z()) goto canredes; cantredes: - blank(context); + blank(); return; canredes: - context._cmp(context.data.byte(kCommandtype), 217); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 217); + if (flags.z()) goto alreadyreds; - context.data.byte(kCommandtype) = 217; - context.al = 50; - commandonly(context); + data.byte(kCommandtype) = 217; + al = 50; + commandonly(); alreadyreds: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (!flags.z()) goto doredes; return; doredes: - delpointer(context); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - convicons(context); - starttalk(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void newplace(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNeedtotravel), 1); - if (context.flags.z()) + 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; - context._cmp(context.data.byte(kAutolocation), -1); - if (!context.flags.z()) + _cmp(data.byte(kAutolocation), -1); + if (!flags.z()) goto isautoloc; return; isautoloc: - context.al = context.data.byte(kAutolocation); - context.data.byte(kNewlocation) = context.al; - context.data.byte(kAutolocation) = -1; + al = data.byte(kAutolocation); + data.byte(kNewlocation) = al; + data.byte(kAutolocation) = -1; return; istravel: - context.data.byte(kNeedtotravel) = 0; - selectlocation(context); -} - -void selectlocation(Context &context) { - STACK_CHECK(context); - context.data.byte(kInmaparea) = 0; - clearbeforeload(context); - context.data.byte(kGetback) = 0; - context.data.byte(kPointerframe) = 22; - readcitypic(context); - showcity(context); - getridoftemp(context); - readdesticon(context); - loadtraveltext(context); - showpanel(context); - showman(context); - showarrows(context); - showexit(context); - locationpic(context); - undertextline(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - context.data.byte(kPointerframe) = 0; - showpointer(context); - worktoscreen(context); - context.al = 9; - context.ah = 255; - playchannel0(context); - context.data.byte(kNewlocation) = 255; + 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: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + _cmp(data.byte(kGetback), 1); + if (flags.z()) goto quittravel; - context.bx = 2714; - checkcoords(context); - context._cmp(context.data.byte(kNewlocation), 255); - if (context.flags.z()) + bx = 2714; + checkcoords(); + _cmp(data.byte(kNewlocation), 255); + if (flags.z()) goto select; - context.al = context.data.byte(kNewlocation); - context._cmp(context.al, context.data.byte(kLocation)); - if (context.flags.z()) + al = data.byte(kNewlocation); + _cmp(al, data.byte(kLocation)); + if (flags.z()) goto quittravel; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - context.es = context.data.word(kTraveltext); - deallocatemem(context); + getridoftemp(); + getridoftemp2(); + getridoftemp3(); + es = data.word(kTraveltext); + deallocatemem(); return; quittravel: - context.al = context.data.byte(kReallocation); - context.data.byte(kNewlocation) = context.al; - context.data.byte(kGetback) = 0; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - context.es = context.data.word(kTraveltext); - deallocatemem(context); -} - -void showcity(Context &context) { - STACK_CHECK(context); - clearwork(context); - context.ds = context.data.word(kTempgraphics); - context.di = 57; - context.bx = 32; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = 120+57; - context.bx = 32; - context.al = 1; - context.ah = 0; - showframe(context); -} - -void lookatplace(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 224); - if (context.flags.z()) + 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() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 224); + if (flags.z()) goto alreadyinfo; - context.data.byte(kCommandtype) = 224; - context.al = 27; - commandonly(context); + data.byte(kCommandtype) = 224; + al = 27; + commandonly(); alreadyinfo: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (noinfo) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noinfo) */; - context.bl = context.data.byte(kDestpos); - context._cmp(context.bl, 15); - if (!context.flags.c()) + bl = data.byte(kDestpos); + _cmp(bl, 15); + if (!flags.c()) return /* (noinfo) */; - context.push(context.bx); - delpointer(context); - deltextline(context); - getundercentre(context); - context.ds = context.data.word(kTempgraphics3); - context.al = 0; - context.ah = 0; - context.di = 60; - context.bx = 72; - showframe(context); - context.al = 4; - context.ah = 0; - context.di = 60; - context.bx = 72+55; - showframe(context); - context.bx = context.pop(); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kTraveltext); - context.si = context.es.word(context.bx); - context._add(context.si, (66*2)); - findnextcolon(context); - context.di = 63; - context.bx = 84; - context.dl = 191; - context.al = 0; - context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = 500; - hangonp(context); - context.data.byte(kPointermode) = 0; - context.data.byte(kPointerframe) = 0; - putundercentre(context); - worktoscreenm(context); -} - -void getundercentre(Context &context) { - STACK_CHECK(context); - context.di = 58; - context.bx = 72; - context.ds = context.data.word(kMapstore); - context.si = 0; - context.cl = 254; - context.ch = 110; - multiget(context); -} - -void putundercentre(Context &context) { - STACK_CHECK(context); - context.di = 58; - context.bx = 72; - context.ds = context.data.word(kMapstore); - context.si = 0; - context.cl = 254; - context.ch = 110; - multiput(context); -} - -void locationpic(Context &context) { - STACK_CHECK(context); - getdestinfo(context); - context.al = context.es.byte(context.si); - context.push(context.es); - context.push(context.si); - context.di = 0; - context._cmp(context.al, 6); - if (!context.flags.c()) + push(bx); + delpointer(); + deltextline(); + getundercentre(); + ds = data.word(kTempgraphics3); + al = 0; + ah = 0; + di = 60; + bx = 72; + showframe(); + al = 4; + ah = 0; + di = 60; + bx = 72+55; + showframe(); + bx = pop(); + bh = 0; + _add(bx, bx); + es = data.word(kTraveltext); + si = es.word(bx); + _add(si, (66*2)); + findnextcolon(); + di = 63; + bx = 84; + dl = 191; + al = 0; + ah = 0; + printdirect(); + worktoscreenm(); + cx = 500; + hangonp(); + data.byte(kPointermode) = 0; + data.byte(kPointerframe) = 0; + putundercentre(); + worktoscreenm(); +} + +void DreamGenContext::getundercentre() { + STACK_CHECK; + di = 58; + bx = 72; + ds = data.word(kMapstore); + si = 0; + cl = 254; + ch = 110; + multiget(); +} + +void DreamGenContext::putundercentre() { + STACK_CHECK; + di = 58; + bx = 72; + ds = data.word(kMapstore); + si = 0; + cl = 254; + ch = 110; + multiput(); +} + +void DreamGenContext::locationpic() { + STACK_CHECK; + getdestinfo(); + al = es.byte(si); + push(es); + push(si); + di = 0; + _cmp(al, 6); + if (!flags.c()) goto secondlot; - context.ds = context.data.word(kTempgraphics); - context._add(context.al, 4); + ds = data.word(kTempgraphics); + _add(al, 4); goto gotgraphic; secondlot: - context._sub(context.al, 6); - context.ds = context.data.word(kTempgraphics2); + _sub(al, 6); + ds = data.word(kTempgraphics2); gotgraphic: - context._add(context.di, 104); - context.bx = 138+14; - context.ah = 0; - showframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.al = context.data.byte(kDestpos); - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + _add(di, 104); + bx = 138+14; + ah = 0; + showframe(); + si = pop(); + es = pop(); + al = data.byte(kDestpos); + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto notinthisone; - context.al = 3; - context.di = 104; - context.bx = 140+14; - context.ds = context.data.word(kTempgraphics); - context.ah = 0; - showframe(context); + al = 3; + di = 104; + bx = 140+14; + ds = data.word(kTempgraphics); + ah = 0; + showframe(); notinthisone: - context.bl = context.data.byte(kDestpos); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kTraveltext); - context.si = context.es.word(context.bx); - context._add(context.si, (66*2)); - context.di = 50; - context.bx = 20; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); -} - -void getdestinfo(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kDestpos); - context.ah = 0; - context.push(context.ax); - context.dx = context.data; - context.es = context.dx; - context.si = 8011; - context._add(context.si, context.ax); - context.cl = context.es.byte(context.si); - context.ax = context.pop(); - context.push(context.cx); - context.dx = context.data; - context.es = context.dx; - context.si = 8027; - context._add(context.si, context.ax); - context.ax = context.pop(); -} - -void showarrows(Context &context) { - STACK_CHECK(context); - context.di = 116-12; - context.bx = 16; - context.ds = context.data.word(kTempgraphics); - context.al = 0; - context.ah = 0; - showframe(context); - context.di = 226+12; - context.bx = 16; - context.ds = context.data.word(kTempgraphics); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = 280; - context.bx = 14; - context.ds = context.data.word(kTempgraphics); - context.al = 2; - context.ah = 0; - showframe(context); -} - -void nextdest(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 218); - if (context.flags.z()) + bl = data.byte(kDestpos); + bh = 0; + _add(bx, bx); + es = data.word(kTraveltext); + si = es.word(bx); + _add(si, (66*2)); + di = 50; + bx = 20; + dl = 241; + al = 0; + ah = 0; + printdirect(); +} + +void DreamGenContext::getdestinfo() { + STACK_CHECK; + al = data.byte(kDestpos); + ah = 0; + push(ax); + dx = data; + es = dx; + si = 8011; + _add(si, ax); + cl = es.byte(si); + ax = pop(); + push(cx); + dx = data; + es = dx; + si = 8027; + _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; - context.data.byte(kCommandtype) = 218; - context.al = 28; - commandonly(context); + data.byte(kCommandtype) = 218; + al = 28; + commandonly(); alreadydu: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (nodu) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nodu) */; searchdestup: - context._inc(context.data.byte(kDestpos)); - context._cmp(context.data.byte(kDestpos), 15); - if (!context.flags.z()) + _inc(data.byte(kDestpos)); + _cmp(data.byte(kDestpos), 15); + if (!flags.z()) goto notlastdest; - context.data.byte(kDestpos) = 0; + data.byte(kDestpos) = 0; notlastdest: - getdestinfo(context); - context._cmp(context.al, 0); - if (context.flags.z()) + getdestinfo(); + _cmp(al, 0); + if (flags.z()) goto searchdestup; - context.data.byte(kNewtextline) = 1; - deltextline(context); - delpointer(context); - showpanel(context); - showman(context); - showarrows(context); - locationpic(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void lastdest(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 219); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 219; - context.al = 29; - commandonly(context); + data.byte(kCommandtype) = 219; + al = 29; + commandonly(); alreadydd: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (nodd) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nodd) */; searchdestdown: - context._dec(context.data.byte(kDestpos)); - context._cmp(context.data.byte(kDestpos), -1); - if (!context.flags.z()) + _dec(data.byte(kDestpos)); + _cmp(data.byte(kDestpos), -1); + if (!flags.z()) goto notfirstdest; - context.data.byte(kDestpos) = 15; + data.byte(kDestpos) = 15; notfirstdest: - getdestinfo(context); - context._cmp(context.al, 0); - if (context.flags.z()) + getdestinfo(); + _cmp(al, 0); + if (flags.z()) goto searchdestdown; - context.data.byte(kNewtextline) = 1; - deltextline(context); - delpointer(context); - showpanel(context); - showman(context); - showarrows(context); - locationpic(context); - undertextline(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void destselect(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 222; - context.al = 30; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 30; + commandonly(); alreadytrav: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (notrav) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notrav) */; - getdestinfo(context); - context.al = context.data.byte(kDestpos); - context.data.byte(kNewlocation) = context.al; -} - -void getlocation(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.bx = context.ax; - context.dx = context.data; - context.es = context.dx; - context._add(context.bx, 8011); - context.al = context.es.byte(context.bx); -} - -void setlocation(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.bx = context.ax; - context.dx = context.data; - context.es = context.dx; - context._add(context.bx, 8011); - context.es.byte(context.bx) = 1; -} - -void resetlocation(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context._cmp(context.al, 5); - if (!context.flags.z()) + 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() { + STACK_CHECK; + push(ax); + _cmp(al, 5); + if (!flags.z()) goto notdelhotel; - purgealocation(context); - context.al = 21; - purgealocation(context); - context.al = 22; - purgealocation(context); - context.al = 27; - purgealocation(context); + purgealocation(); + al = 21; + purgealocation(); + al = 22; + purgealocation(); + al = 27; + purgealocation(); goto clearedlocations; notdelhotel: - context._cmp(context.al, 8); - if (!context.flags.z()) + _cmp(al, 8); + if (!flags.z()) goto notdeltvstud; - purgealocation(context); - context.al = 28; - purgealocation(context); + purgealocation(); + al = 28; + purgealocation(); goto clearedlocations; notdeltvstud: - context._cmp(context.al, 6); - if (!context.flags.z()) + _cmp(al, 6); + if (!flags.z()) goto notdelsarters; - purgealocation(context); - context.al = 20; - purgealocation(context); - context.al = 25; - purgealocation(context); + purgealocation(); + al = 20; + purgealocation(); + al = 25; + purgealocation(); goto clearedlocations; notdelsarters: - context._cmp(context.al, 13); - if (!context.flags.z()) + _cmp(al, 13); + if (!flags.z()) goto notdelboathouse; - purgealocation(context); - context.al = 29; - purgealocation(context); + purgealocation(); + al = 29; + purgealocation(); goto clearedlocations; notdelboathouse: clearedlocations: - context.ax = context.pop(); - context.ah = 0; - context.bx = context.ax; - context.dx = context.data; - context.es = context.dx; - context._add(context.bx, 8011); - context.es.byte(context.bx) = 0; -} - -void readdesticon(Context &context) { - STACK_CHECK(context); - context.dx = 2013; - loadintotemp(context); - context.dx = 2026; - loadintotemp2(context); - context.dx = 1961; - loadintotemp3(context); -} - -void readcitypic(Context &context) { - STACK_CHECK(context); - context.dx = 2000; - loadintotemp(context); -} - -void usemon(Context &context) { - STACK_CHECK(context); - context.data.byte(kLasttrigger) = 0; - context.es = context.cs; - context.di = 2970+1; - context.cx = 12; - context.al = 32; - context._stosb(context.cx); - context.es = context.cs; - context.di = 2942+1; - context.cx = 12; - context.al = 32; - context._stosb(context.cx); - context.es = context.cs; - context.di = 2836; - context.es.byte(context.di) = 1; - context._add(context.di, 26); - context.cx = 3; + ax = pop(); + ah = 0; + bx = ax; + dx = data; + es = dx; + _add(bx, 8011); + 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); + es = cs; + di = 2942+1; + cx = 12; + al = 32; + _stosb(cx); + es = cs; + di = 2836; + es.byte(di) = 1; + _add(di, 26); + cx = 3; keyloop: - context.es.byte(context.di) = 0; - context._add(context.di, 26); - if (--context.cx) + es.byte(di) = 0; + _add(di, 26); + if (--cx) goto keyloop; - createpanel(context); - showpanel(context); - showicon(context); - drawfloor(context); - getridofall(context); - context.dx = 1974; - loadintotemp(context); - loadpersonal(context); - loadnews(context); - loadcart(context); - context.dx = 1870; - loadtempcharset(context); - printoutermon(context); - initialmoncols(context); - printlogo(context); - worktoscreen(context); - turnonpower(context); - fadeupyellows(context); - fadeupmonfirst(context); - context.data.word(kMonadx) = 76; - context.data.word(kMonady) = 141; - context.al = 1; - monmessage(context); - context.cx = 120; - hangoncurs(context); - context.al = 2; - monmessage(context); - context.cx = 60; - randomaccess(context); - context.al = 3; - monmessage(context); - context.cx = 100; - hangoncurs(context); - printlogo(context); - scrollmonitor(context); - context.data.word(kBufferin) = 0; - context.data.word(kBufferout) = 0; + 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: - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.push(context.di); - context.push(context.bx); - input(context); - context.bx = context.pop(); - context.di = context.pop(); - context.data.word(kMonadx) = context.di; - context.data.word(kMonady) = context.bx; - execcommand(context); - context._cmp(context.al, 0); - if (context.flags.z()) + 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(context); - getridoftempcharset(context); - context.es = context.data.word(kTextfile1); - deallocatemem(context); - context.es = context.data.word(kTextfile2); - deallocatemem(context); - context.es = context.data.word(kTextfile3); - deallocatemem(context); - context.data.byte(kGetback) = 1; - context.al = 26; - playchannel1(context); - context.data.byte(kManisoffscreen) = 0; - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); -} - -void printoutermon(Context &context) { - STACK_CHECK(context); - context.di = 40; - context.bx = 32; - context.ds = context.data.word(kTempgraphics); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = 264; - context.bx = 32; - context.ds = context.data.word(kTempgraphics); - context.al = 2; - context.ah = 0; - showframe(context); - context.di = 40; - context.bx = 12; - context.ds = context.data.word(kTempgraphics); - context.al = 3; - context.ah = 0; - showframe(context); - context.di = 40; - context.bx = 164; - context.ds = context.data.word(kTempgraphics); - context.al = 4; - context.ah = 0; - showframe(context); -} - -void loadpersonal(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kLocation); - context.dx = 2052; - context._cmp(context.al, 0); - if (context.flags.z()) + 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; - context._cmp(context.al, 42); - if (context.flags.z()) + _cmp(al, 42); + if (flags.z()) goto foundpersonal; - context.dx = 2065; - context._cmp(context.al, 2); - if (context.flags.z()) + dx = 2065; + _cmp(al, 2); + if (flags.z()) goto foundpersonal; foundpersonal: - openfile(context); - readheader(context); - context.bx = context.es.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(kTextfile1) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); -} - -void loadnews(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kNewsitem); - context.dx = 2078; - context._cmp(context.al, 0); - if (context.flags.z()) + 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; - context.dx = 2091; - context._cmp(context.al, 1); - if (context.flags.z()) + dx = 2091; + _cmp(al, 1); + if (flags.z()) goto foundnews; - context.dx = 2104; - context._cmp(context.al, 2); - if (context.flags.z()) + dx = 2104; + _cmp(al, 2); + if (flags.z()) goto foundnews; - context.dx = 2117; + dx = 2117; foundnews: - openfile(context); - readheader(context); - context.bx = context.es.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(kTextfile2) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); -} - -void loadcart(Context &context) { - STACK_CHECK(context); - lookininterface(context); - context.dx = 2130; - context._cmp(context.al, 0); - if (context.flags.z()) + 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; - context.dx = 2143; - context._cmp(context.al, 1); - if (context.flags.z()) + dx = 2143; + _cmp(al, 1); + if (flags.z()) goto gotcart; - context.dx = 2156; - context._cmp(context.al, 2); - if (context.flags.z()) + dx = 2156; + _cmp(al, 2); + if (flags.z()) goto gotcart; - context.dx = 2169; - context._cmp(context.al, 3); - if (context.flags.z()) + dx = 2169; + _cmp(al, 3); + if (flags.z()) goto gotcart; - context.dx = 2182; + dx = 2182; gotcart: - openfile(context); - readheader(context); - context.bx = context.es.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.data.word(kTextfile3) = context.ax; - context.ds = context.ax; - context.cx = context.pop(); - context.dx = 0; - readfromfile(context); - closefile(context); -} - -void lookininterface(Context &context) { - STACK_CHECK(context); - context.al = 'I'; - context.ah = 'N'; - context.cl = 'T'; - context.ch = 'F'; - findsetobject(context); - context.ah = 1; - checkinside(context); - context._cmp(context.cl, (114)); - if (context.flags.z()) + 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() { + STACK_CHECK; + al = 'I'; + ah = 'N'; + cl = 'T'; + ch = 'F'; + findsetobject(); + ah = 1; + checkinside(); + _cmp(cl, (114)); + if (flags.z()) goto emptyinterface; - context.al = context.es.byte(context.bx+15); - context._inc(context.al); + al = es.byte(bx+15); + _inc(al); return; emptyinterface: - context.al = 0; + al = 0; } -void turnonpower(Context &context) { - STACK_CHECK(context); - context.cx = 3; +void DreamGenContext::turnonpower() { + STACK_CHECK; + cx = 3; powerloop: - context.push(context.cx); - powerlighton(context); - context.cx = 30; - hangon(context); - powerlightoff(context); - context.cx = 30; - hangon(context); - context.cx = context.pop(); - if (--context.cx) + push(cx); + powerlighton(); + cx = 30; + hangon(); + powerlightoff(); + cx = 30; + hangon(); + cx = pop(); + if (--cx) goto powerloop; - powerlighton(context); + powerlighton(); } -void randomaccess(Context &context) { - STACK_CHECK(context); +void DreamGenContext::randomaccess() { + STACK_CHECK; accessloop: - context.push(context.cx); - vsync(context); - vsync(context); - randomnum1(context); - context._and(context.al, 15); - context._cmp(context.al, 10); - if (context.flags.c()) + push(cx); + vsync(); + vsync(); + randomnum1(); + _and(al, 15); + _cmp(al, 10); + if (flags.c()) goto off; - accesslighton(context); + accesslighton(); goto chosenaccess; off: - accesslightoff(context); + accesslightoff(); chosenaccess: - context.cx = context.pop(); - if (--context.cx) + cx = pop(); + if (--cx) goto accessloop; - accesslightoff(context); -} - -void powerlighton(Context &context) { - STACK_CHECK(context); - context.di = 257+4; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 6; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void powerlightoff(Context &context) { - STACK_CHECK(context); - context.di = 257+4; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 5; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void accesslighton(Context &context) { - STACK_CHECK(context); - context.di = 74; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 8; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void accesslightoff(Context &context) { - STACK_CHECK(context); - context.di = 74; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 7; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void locklighton(Context &context) { - STACK_CHECK(context); - context.di = 56; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 10; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void locklightoff(Context &context) { - STACK_CHECK(context); - context.di = 56; - context.bx = 182; - context.ds = context.data.word(kTempgraphics); - context.al = 9; - context.ah = 0; - context.push(context.di); - context.push(context.bx); - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.cl = 12; - context.ch = 8; - multidump(context); -} - -void input(Context &context) { - STACK_CHECK(context); - context.es = context.cs; - context.di = 8045; - context.cx = 64; - context.al = 0; - context._stosb(context.cx); - context.data.word(kCurpos) = 0; - context.al = '>'; - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.ds = context.data.word(kTempcharset); - context.ah = 0; - printchar(context); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.cl = 6; - context.ch = 8; - multidump(context); - context._add(context.data.word(kMonadx), 6); - context.ax = context.data.word(kMonadx); - context.data.word(kCurslocx) = context.ax; - context.ax = context.data.word(kMonady); - context.data.word(kCurslocy) = context.ax; + 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); + 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(context); - vsync(context); - delcurs(context); - readkey(context); - context.al = context.data.byte(kCurrentkey); - context._cmp(context.al, 0); - if (context.flags.z()) + printcurs(); + vsync(); + delcurs(); + readkey(); + al = data.byte(kCurrentkey); + _cmp(al, 0); + if (flags.z()) goto waitkey; - context._cmp(context.al, 13); - if (context.flags.z()) + _cmp(al, 13); + if (flags.z()) return /* (endofinput) */; - context._cmp(context.al, 8); - if (!context.flags.z()) + _cmp(al, 8); + if (!flags.z()) goto notdel; - context._cmp(context.data.word(kCurpos), 0); - if (context.flags.z()) + _cmp(data.word(kCurpos), 0); + if (flags.z()) goto waitkey; - delchar(context); + delchar(); goto waitkey; notdel: - context._cmp(context.data.word(kCurpos), 28); - if (context.flags.z()) + _cmp(data.word(kCurpos), 28); + if (flags.z()) goto waitkey; - context._cmp(context.data.byte(kCurrentkey), 32); - if (!context.flags.z()) + _cmp(data.byte(kCurrentkey), 32); + if (!flags.z()) goto notleadingspace; - context._cmp(context.data.word(kCurpos), 0); - if (context.flags.z()) + _cmp(data.word(kCurpos), 0); + if (flags.z()) goto waitkey; notleadingspace: - makecaps(context); - context.es = context.cs; - context.si = context.data.word(kCurpos); - context._add(context.si, context.si); - context._add(context.si, 8045); - context.es.byte(context.si) = context.al; - context._cmp(context.al, 'Z'+1); - if (!context.flags.c()) + 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; - context.push(context.ax); - context.push(context.es); - context.push(context.si); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.ds = context.data.word(kMapstore); - context.ax = context.data.word(kCurpos); - context._xchg(context.al, context.ah); - context.si = context.ax; - context.cl = 8; - context.ch = 8; - multiget(context); - context.si = context.pop(); - context.es = context.pop(); - context.ax = context.pop(); - context.push(context.es); - context.push(context.si); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.ds = context.data.word(kTempcharset); - context.ah = 0; - printchar(context); - context.si = context.pop(); - context.es = context.pop(); - context.es.byte(context.si+1) = context.cl; - context.ch = 0; - context._add(context.data.word(kMonadx), context.cx); - context._inc(context.data.word(kCurpos)); - context._add(context.data.word(kCurslocx), context.cx); + 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 makecaps(Context &context) { - STACK_CHECK(context); - context._cmp(context.al, 'a'); - if (context.flags.c()) +void DreamGenContext::makecaps() { + STACK_CHECK; + _cmp(al, 'a'); + if (flags.c()) return /* (notupperc) */; - context._sub(context.al, 32); -} - -void delchar(Context &context) { - STACK_CHECK(context); - context._dec(context.data.word(kCurpos)); - context.si = context.data.word(kCurpos); - context._add(context.si, context.si); - context.es = context.cs; - context._add(context.si, 8045); - context.es.byte(context.si) = 0; - context.al = context.es.byte(context.si+1); - context.ah = 0; - context._sub(context.data.word(kMonadx), context.ax); - context._sub(context.data.word(kCurslocx), context.ax); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.ds = context.data.word(kMapstore); - context.ax = context.data.word(kCurpos); - context._xchg(context.al, context.ah); - context.si = context.ax; - context.cl = 8; - context.ch = 8; - multiput(context); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.cl = context.al; - context.ch = 8; - multidump(context); -} - -void execcommand(Context &context) { - STACK_CHECK(context); - context.es = context.cs; - context.bx = 2776; - context.ds = context.cs; - context.si = 8045; - context.al = context.ds.byte(context.si); - context._cmp(context.al, 0); - if (!context.flags.z()) + _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() { + STACK_CHECK; + es = cs; + bx = 2776; + ds = cs; + si = 8045; + al = ds.byte(si); + _cmp(al, 0); + if (!flags.z()) goto notblankinp; - scrollmonitor(context); + scrollmonitor(); return; notblankinp: - context.cl = 0; + cl = 0; comloop: - context.push(context.bx); - context.push(context.si); + push(bx); + push(si); comloop2: - context.al = context.ds.byte(context.si); - context._add(context.si, 2); - context.ah = context.es.byte(context.bx); - context._inc(context.bx); - context._cmp(context.ah, 32); - if (context.flags.z()) + al = ds.byte(si); + _add(si, 2); + ah = es.byte(bx); + _inc(bx); + _cmp(ah, 32); + if (flags.z()) goto foundcom; - context._cmp(context.al, context.ah); - if (context.flags.z()) + _cmp(al, ah); + if (flags.z()) goto comloop2; - context.si = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 10); - context._inc(context.cl); - context._cmp(context.cl, 6); - if (!context.flags.z()) + si = pop(); + bx = pop(); + _add(bx, 10); + _inc(cl); + _cmp(cl, 6); + if (!flags.z()) goto comloop; - neterror(context); - context.al = 0; + neterror(); + al = 0; return; foundcom: - context.si = context.pop(); - context.bx = context.pop(); - context._cmp(context.cl, 1); - if (context.flags.z()) + si = pop(); + bx = pop(); + _cmp(cl, 1); + if (flags.z()) goto testcom; - context._cmp(context.cl, 2); - if (context.flags.z()) + _cmp(cl, 2); + if (flags.z()) goto directory; - context._cmp(context.cl, 3); - if (context.flags.z()) + _cmp(cl, 3); + if (flags.z()) goto accesscom; - context._cmp(context.cl, 4); - if (context.flags.z()) + _cmp(cl, 4); + if (flags.z()) goto signoncom; - context._cmp(context.cl, 5); - if (context.flags.z()) + _cmp(cl, 5); + if (flags.z()) goto keyscom; goto quitcom; directory: - dircom(context); - context.al = 0; + dircom(); + al = 0; return; signoncom: - signon(context); - context.al = 0; + signon(); + al = 0; return; accesscom: - read(context); - context.al = 0; + read(); + al = 0; return; keyscom: - showkeys(context); - context.al = 0; + showkeys(); + al = 0; return; testcom: - context.al = 6; - monmessage(context); - context.al = 0; + al = 6; + monmessage(); + al = 0; return; quitcom: - context.al = 1; + al = 1; } -void neterror(Context &context) { - STACK_CHECK(context); - context.al = 5; - monmessage(context); - scrollmonitor(context); +void DreamGenContext::neterror() { + STACK_CHECK; + al = 5; + monmessage(); + scrollmonitor(); } -void dircom(Context &context) { - STACK_CHECK(context); - context.cx = 30; - randomaccess(context); - parser(context); - context._cmp(context.es.byte(context.di+1), 0); - if (context.flags.z()) +void DreamGenContext::dircom() { + STACK_CHECK; + cx = 30; + randomaccess(); + parser(); + _cmp(es.byte(di+1), 0); + if (flags.z()) goto dirroot; - dirfile(context); + dirfile(); return; dirroot: - context.data.byte(kLogonum) = 0; - context.ds = context.cs; - context.si = 2956; - context._inc(context.si); - context.es = context.cs; - context.di = 2970; - context._inc(context.di); - context.cx = 12; - context._movsb(context.cx); - monitorlogo(context); - scrollmonitor(context); - context.al = 9; - monmessage(context); - context.es = context.data.word(kTextfile1); - searchforfiles(context); - context.es = context.data.word(kTextfile2); - searchforfiles(context); - context.es = context.data.word(kTextfile3); - searchforfiles(context); - scrollmonitor(context); -} - -void searchforfiles(Context &context) { - STACK_CHECK(context); - context.bx = (66*2); + data.byte(kLogonum) = 0; + ds = cs; + si = 2956; + _inc(si); + es = cs; + di = 2970; + _inc(di); + cx = 12; + _movsb(cx); + monitorlogo(); + scrollmonitor(); + al = 9; + monmessage(); + es = data.word(kTextfile1); + searchforfiles(); + es = data.word(kTextfile2); + searchforfiles(); + es = data.word(kTextfile3); + searchforfiles(); + scrollmonitor(); +} + +void DreamGenContext::searchforfiles() { + STACK_CHECK; + bx = (66*2); directloop1: - context.al = context.es.byte(context.bx); - context._inc(context.bx); - context._cmp(context.al, '*'); - if (context.flags.z()) + al = es.byte(bx); + _inc(bx); + _cmp(al, '*'); + if (flags.z()) return /* (endofdir) */; - context._cmp(context.al, 34); - if (!context.flags.z()) + _cmp(al, 34); + if (!flags.z()) goto directloop1; - monprint(context); + monprint(); goto directloop1; } -void signon(Context &context) { - STACK_CHECK(context); - parser(context); - context._inc(context.di); - context.ds = context.cs; - context.si = 2836; - context.cx = 4; +void DreamGenContext::signon() { + STACK_CHECK; + parser(); + _inc(di); + ds = cs; + si = 2836; + cx = 4; signonloop: - context.push(context.cx); - context.push(context.si); - context.push(context.di); - context._add(context.si, 14); - context.cx = 11; + push(cx); + push(si); + push(di); + _add(si, 14); + cx = 11; signonloop2: - context._lodsb(); - context._cmp(context.al, 32); - if (context.flags.z()) + _lodsb(); + _cmp(al, 32); + if (flags.z()) goto foundsign; - makecaps(context); - context.ah = context.es.byte(context.di); - context._inc(context.di); - context._cmp(context.al, context.ah); - if (!context.flags.z()) + makecaps(); + ah = es.byte(di); + _inc(di); + _cmp(al, ah); + if (!flags.z()) goto nomatch; - if (--context.cx) + if (--cx) goto signonloop2; nomatch: - context.di = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 26); - if (--context.cx) + di = pop(); + si = pop(); + cx = pop(); + _add(si, 26); + if (--cx) goto signonloop; - context.al = 13; - monmessage(context); + al = 13; + monmessage(); return; foundsign: - context.di = context.pop(); - context.si = context.pop(); - context.cx = context.pop(); - context.bx = context.si; - context.es = context.ds; - context._cmp(context.es.byte(context.bx), 0); - if (context.flags.z()) + di = pop(); + si = pop(); + cx = pop(); + bx = si; + es = ds; + _cmp(es.byte(bx), 0); + if (flags.z()) goto notyetassigned; - context.al = 17; - monmessage(context); + al = 17; + monmessage(); return; notyetassigned: - context.push(context.es); - context.push(context.bx); - scrollmonitor(context); - context.al = 15; - monmessage(context); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - context.push(context.di); - context.push(context.bx); - input(context); - context.bx = context.pop(); - context.di = context.pop(); - context.data.word(kMonadx) = context.di; - context.data.word(kMonady) = context.bx; - context.bx = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.bx); - context._add(context.bx, 2); - context.ds = context.cs; - context.si = 8045; + push(es); + push(bx); + scrollmonitor(); + al = 15; + monmessage(); + 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; + bx = pop(); + es = pop(); + push(es); + push(bx); + _add(bx, 2); + ds = cs; + si = 8045; checkpass: - context._lodsw(); - context.ah = context.es.byte(context.bx); - context._inc(context.bx); - context._cmp(context.ah, 32); - if (context.flags.z()) + _lodsw(); + ah = es.byte(bx); + _inc(bx); + _cmp(ah, 32); + if (flags.z()) goto passpassed; - context._cmp(context.al, context.ah); - if (context.flags.z()) + _cmp(al, ah); + if (flags.z()) goto checkpass; - context.bx = context.pop(); - context.es = context.pop(); - scrollmonitor(context); - context.al = 16; - monmessage(context); + bx = pop(); + es = pop(); + scrollmonitor(); + al = 16; + monmessage(); return; passpassed: - context.al = 14; - monmessage(context); - context.bx = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.bx); - context._add(context.bx, 14); - monprint(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); - context.es.byte(context.bx) = 1; -} - -void showkeys(Context &context) { - STACK_CHECK(context); - context.cx = 10; - randomaccess(context); - scrollmonitor(context); - context.al = 18; - monmessage(context); - context.es = context.cs; - context.bx = 2836; - context.cx = 4; + al = 14; + monmessage(); + bx = pop(); + es = pop(); + push(es); + push(bx); + _add(bx, 14); + monprint(); + scrollmonitor(); + bx = pop(); + es = pop(); + es.byte(bx) = 1; +} + +void DreamGenContext::showkeys() { + STACK_CHECK; + cx = 10; + randomaccess(); + scrollmonitor(); + al = 18; + monmessage(); + es = cs; + bx = 2836; + cx = 4; keysloop: - context.push(context.cx); - context.push(context.bx); - context._cmp(context.es.byte(context.bx), 0); - if (context.flags.z()) + push(cx); + push(bx); + _cmp(es.byte(bx), 0); + if (flags.z()) goto notheld; - context._add(context.bx, 14); - monprint(context); + _add(bx, 14); + monprint(); notheld: - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 26); - if (--context.cx) + bx = pop(); + cx = pop(); + _add(bx, 26); + if (--cx) goto keysloop; - scrollmonitor(context); + scrollmonitor(); } -void read(Context &context) { - STACK_CHECK(context); - context.cx = 40; - randomaccess(context); - parser(context); - context._cmp(context.es.byte(context.di+1), 0); - if (!context.flags.z()) +void DreamGenContext::read() { + STACK_CHECK; + cx = 40; + randomaccess(); + parser(); + _cmp(es.byte(di+1), 0); + if (!flags.z()) goto okcom; - neterror(context); + neterror(); return; okcom: - context.es = context.cs; - context.di = 2970; - context.ax = context.data.word(kTextfile1); - context.data.word(kMonsource) = context.ax; - context.ds = context.ax; - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + es = cs; + di = 2970; + ax = data.word(kTextfile1); + data.word(kMonsource) = ax; + ds = ax; + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile2; - context.ax = context.data.word(kTextfile2); - context.data.word(kMonsource) = context.ax; - context.ds = context.ax; - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + ax = data.word(kTextfile2); + data.word(kMonsource) = ax; + ds = ax; + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile2; - context.ax = context.data.word(kTextfile3); - context.data.word(kMonsource) = context.ax; - context.ds = context.ax; - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + ax = data.word(kTextfile3); + data.word(kMonsource) = ax; + ds = ax; + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile2; - context.al = 7; - monmessage(context); + al = 7; + monmessage(); return; foundfile2: - getkeyandlogo(context); - context._cmp(context.al, 0); - if (context.flags.z()) + getkeyandlogo(); + _cmp(al, 0); + if (flags.z()) goto keyok1; return; keyok1: - context.es = context.cs; - context.di = 2942; - context.ds = context.data.word(kMonsource); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + es = cs; + di = 2942; + ds = data.word(kMonsource); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto findtopictext; - context.al = context.data.byte(kOldlogonum); - context.data.byte(kLogonum) = context.al; - context.al = 11; - monmessage(context); + al = data.byte(kOldlogonum); + data.byte(kLogonum) = al; + al = 11; + monmessage(); return; findtopictext: - context._inc(context.bx); - context.push(context.es); - context.push(context.bx); - monitorlogo(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); + _inc(bx); + push(es); + push(bx); + monitorlogo(); + scrollmonitor(); + bx = pop(); + es = pop(); moretopic: - monprint(context); - context.al = context.es.byte(context.bx); - context._cmp(context.al, 34); - if (context.flags.z()) + monprint(); + al = es.byte(bx); + _cmp(al, 34); + if (flags.z()) goto endoftopic; - context._cmp(context.al, '='); - if (context.flags.z()) + _cmp(al, '='); + if (flags.z()) goto endoftopic; - context._cmp(context.al, '*'); - if (context.flags.z()) + _cmp(al, '*'); + if (flags.z()) goto endoftopic; - context.push(context.es); - context.push(context.bx); - processtrigger(context); - context.cx = 24; - randomaccess(context); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + processtrigger(); + cx = 24; + randomaccess(); + bx = pop(); + es = pop(); goto moretopic; endoftopic: - scrollmonitor(context); -} - -void dirfile(Context &context) { - STACK_CHECK(context); - context.al = 34; - context.es.byte(context.di) = context.al; - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(kTextfile1); - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + scrollmonitor(); +} + +void DreamGenContext::dirfile() { + STACK_CHECK; + al = 34; + es.byte(di) = al; + push(es); + push(di); + ds = data.word(kTextfile1); + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(kTextfile2); - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + di = pop(); + es = pop(); + push(es); + push(di); + ds = data.word(kTextfile2); + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(kTextfile3); - context.si = (66*2); - searchforstring(context); - context._cmp(context.al, 0); - if (context.flags.z()) + di = pop(); + es = pop(); + push(es); + push(di); + ds = data.word(kTextfile3); + si = (66*2); + searchforstring(); + _cmp(al, 0); + if (flags.z()) goto foundfile; - context.di = context.pop(); - context.es = context.pop(); - context.al = 7; - monmessage(context); + di = pop(); + es = pop(); + al = 7; + monmessage(); return; foundfile: - context.ax = context.pop(); - context.ax = context.pop(); - getkeyandlogo(context); - context._cmp(context.al, 0); - if (context.flags.z()) + ax = pop(); + ax = pop(); + getkeyandlogo(); + _cmp(al, 0); + if (flags.z()) goto keyok2; return; keyok2: - context.push(context.es); - context.push(context.bx); - context.ds = context.cs; - context.si = 2942+1; - context.es = context.cs; - context.di = 2970+1; - context.cx = 12; - context._movsb(context.cx); - monitorlogo(context); - scrollmonitor(context); - context.al = 10; - monmessage(context); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + ds = cs; + si = 2942+1; + es = cs; + di = 2970+1; + cx = 12; + _movsb(cx); + monitorlogo(); + scrollmonitor(); + al = 10; + monmessage(); + bx = pop(); + es = pop(); directloop2: - context.al = context.es.byte(context.bx); - context._inc(context.bx); - context._cmp(context.al, 34); - if (context.flags.z()) + al = es.byte(bx); + _inc(bx); + _cmp(al, 34); + if (flags.z()) goto endofdir2; - context._cmp(context.al, '*'); - if (context.flags.z()) + _cmp(al, '*'); + if (flags.z()) goto endofdir2; - context._cmp(context.al, '='); - if (!context.flags.z()) + _cmp(al, '='); + if (!flags.z()) goto directloop2; - monprint(context); + monprint(); goto directloop2; endofdir2: - scrollmonitor(context); -} - -void getkeyandlogo(Context &context) { - STACK_CHECK(context); - context._inc(context.bx); - context.al = context.es.byte(context.bx); - context._sub(context.al, 48); - context.data.byte(kNewlogonum) = context.al; - context._add(context.bx, 2); - context.al = context.es.byte(context.bx); - context._sub(context.al, 48); - context.data.byte(kKeynum) = context.al; - context._inc(context.bx); - context.push(context.es); - context.push(context.bx); - context.al = context.data.byte(kKeynum); - context.ah = 0; - context.cx = 26; - context._mul(context.cx); - context.es = context.cs; - context.bx = 2836; - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx); - context._cmp(context.al, 1); - if (context.flags.z()) + scrollmonitor(); +} + +void DreamGenContext::getkeyandlogo() { + STACK_CHECK; + _inc(bx); + al = es.byte(bx); + _sub(al, 48); + data.byte(kNewlogonum) = al; + _add(bx, 2); + al = es.byte(bx); + _sub(al, 48); + data.byte(kKeynum) = al; + _inc(bx); + push(es); + push(bx); + al = data.byte(kKeynum); + ah = 0; + cx = 26; + _mul(cx); + es = cs; + bx = 2836; + _add(bx, ax); + al = es.byte(bx); + _cmp(al, 1); + if (flags.z()) goto keyok; - context.push(context.bx); - context.push(context.es); - context.al = 12; - monmessage(context); - context.es = context.pop(); - context.bx = context.pop(); - context._add(context.bx, 14); - monprint(context); - scrollmonitor(context); - context.bx = context.pop(); - context.es = context.pop(); - context.al = 1; + push(bx); + push(es); + al = 12; + monmessage(); + es = pop(); + bx = pop(); + _add(bx, 14); + monprint(); + scrollmonitor(); + bx = pop(); + es = pop(); + al = 1; return; keyok: - context.bx = context.pop(); - context.es = context.pop(); - context.al = context.data.byte(kNewlogonum); - context.data.byte(kLogonum) = context.al; - context.al = 0; + bx = pop(); + es = pop(); + al = data.byte(kNewlogonum); + data.byte(kLogonum) = al; + al = 0; } -void searchforstring(Context &context) { - STACK_CHECK(context); - context.dl = context.es.byte(context.di); - context.cx = context.di; +void DreamGenContext::searchforstring() { + STACK_CHECK; + dl = es.byte(di); + cx = di; restartlook: - context.di = context.cx; - context.bx = context.si; - context.dh = 0; + di = cx; + bx = si; + dh = 0; keeplooking: - context._lodsb(); - makecaps(context); - context._cmp(context.al, '*'); - if (context.flags.z()) + _lodsb(); + makecaps(); + _cmp(al, '*'); + if (flags.z()) goto notfound; - context._cmp(context.dl, '='); - if (!context.flags.z()) + _cmp(dl, '='); + if (!flags.z()) goto nofindingtopic; - context._cmp(context.al, 34); - if (context.flags.z()) + _cmp(al, 34); + if (flags.z()) goto notfound; nofindingtopic: - context.ah = context.es.byte(context.di); - context._cmp(context.al, context.dl); - if (!context.flags.z()) + ah = es.byte(di); + _cmp(al, dl); + if (!flags.z()) goto notbracket; - context._inc(context.dh); - context._cmp(context.dh, 2); - if (context.flags.z()) + _inc(dh); + _cmp(dh, 2); + if (flags.z()) goto complete; notbracket: - context._cmp(context.al, context.ah); - if (!context.flags.z()) + _cmp(al, ah); + if (!flags.z()) goto restartlook; - context._inc(context.di); + _inc(di); goto keeplooking; complete: - context.es = context.ds; - context.al = 0; - context.bx = context.si; + es = ds; + al = 0; + bx = si; return; notfound: - context.al = 1; -} - -void parser(Context &context) { - STACK_CHECK(context); - context.es = context.cs; - context.di = 2942; - context.cx = 13; - context.al = 0; - context._stosb(context.cx); - context.di = 2942; - context.al = '='; - context._stosb(); - context.ds = context.cs; - context.si = 8045; + al = 1; +} + +void DreamGenContext::parser() { + STACK_CHECK; + es = cs; + di = 2942; + cx = 13; + al = 0; + _stosb(cx); + di = 2942; + al = '='; + _stosb(); + ds = cs; + si = 8045; notspace1: - context._lodsw(); - context._cmp(context.al, 32); - if (context.flags.z()) + _lodsw(); + _cmp(al, 32); + if (flags.z()) goto stillspace1; - context._cmp(context.al, 0); - if (!context.flags.z()) + _cmp(al, 0); + if (!flags.z()) goto notspace1; goto finishpars; stillspace1: - context._lodsw(); - context._cmp(context.al, 32); - if (context.flags.z()) + _lodsw(); + _cmp(al, 32); + if (flags.z()) goto stillspace1; copyin1: - context._stosb(); - context._lodsw(); - context._cmp(context.al, 0); - if (context.flags.z()) + _stosb(); + _lodsw(); + _cmp(al, 0); + if (flags.z()) goto finishpars; - context._cmp(context.al, 32); - if (!context.flags.z()) + _cmp(al, 32); + if (!flags.z()) goto copyin1; finishpars: - context.di = 2942; -} - -void scrollmonitor(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.di); - context.push(context.si); - context.push(context.es); - context.push(context.ds); - printlogo(context); - context.di = context.data.word(kMonadx); - context.bx = context.data.word(kMonady); - printundermon(context); - context.ax = context.data.word(kMonady); - worktoscreen(context); - context.al = 25; - playchannel1(context); - context.ds = context.pop(); - context.es = context.pop(); - context.si = context.pop(); - context.di = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); -} - -void lockmon(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLasthardkey), 57); - if (!context.flags.z()) + di = 2942; +} + +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::lockmon() { + STACK_CHECK; + _cmp(data.byte(kLasthardkey), 57); + if (!flags.z()) return /* (notlock) */; - locklighton(context); + locklighton(); lockloop: - context._cmp(context.data.byte(kLasthardkey), 57); - if (context.flags.z()) + _cmp(data.byte(kLasthardkey), 57); + if (flags.z()) goto lockloop; - locklightoff(context); + locklightoff(); } -void monitorlogo(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kLogonum); - context._cmp(context.al, context.data.byte(kOldlogonum)); - if (context.flags.z()) +void DreamGenContext::monitorlogo() { + STACK_CHECK; + al = data.byte(kLogonum); + _cmp(al, data.byte(kOldlogonum)); + if (flags.z()) goto notnewlogo; - context.data.byte(kOldlogonum) = context.al; - printlogo(context); - printundermon(context); - worktoscreen(context); - printlogo(context); - printlogo(context); - context.al = 26; - playchannel1(context); - context.cx = 20; - randomaccess(context); + data.byte(kOldlogonum) = al; + printlogo(); + printundermon(); + worktoscreen(); + printlogo(); + printlogo(); + al = 26; + playchannel1(); + cx = 20; + randomaccess(); return; notnewlogo: - printlogo(context); + printlogo(); } -void printlogo(Context &context) { - STACK_CHECK(context); - context.di = 56; - context.bx = 32; - context.ds = context.data.word(kTempgraphics); - context.al = 0; - context.ah = 0; - showframe(context); - showcurrentfile(context); +void DreamGenContext::printlogo() { + STACK_CHECK; + di = 56; + bx = 32; + ds = data.word(kTempgraphics); + al = 0; + ah = 0; + showframe(); + showcurrentfile(); } -void showcurrentfile(Context &context) { - STACK_CHECK(context); - context.di = 178; - context.bx = 37; - context.si = 2970+1; +void DreamGenContext::showcurrentfile() { + STACK_CHECK; + di = 178; + bx = 37; + si = 2970+1; curfileloop: - context.al = context.cs.byte(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + al = cs.byte(si); + _cmp(al, 0); + if (flags.z()) return /* (finishfile) */; - context._inc(context.si); - context.push(context.si); - context.ds = context.data.word(kTempcharset); - context.ah = 0; - printchar(context); - context.si = context.pop(); + _inc(si); + push(si); + ds = data.word(kTempcharset); + ah = 0; + printchar(); + si = pop(); goto curfileloop; } -void monmessage(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTextfile1); - context.bx = (66*2); - context.cl = context.al; - context.ch = 0; +void DreamGenContext::monmessage() { + STACK_CHECK; + es = data.word(kTextfile1); + bx = (66*2); + cl = al; + ch = 0; monmessageloop: - context.al = context.es.byte(context.bx); - context._inc(context.bx); - context._cmp(context.al, '+'); - if (!context.flags.z()) + al = es.byte(bx); + _inc(bx); + _cmp(al, '+'); + if (!flags.z()) goto monmessageloop; - if (--context.cx) + if (--cx) goto monmessageloop; - monprint(context); + monprint(); } -void processtrigger(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLasttrigger), '1'); - if (!context.flags.z()) +void DreamGenContext::processtrigger() { + STACK_CHECK; + _cmp(data.byte(kLasttrigger), '1'); + if (!flags.z()) goto notfirsttrigger; - context.al = 8; - setlocation(context); - context.al = 45; - triggermessage(context); + al = 8; + setlocation(); + al = 45; + triggermessage(); return; notfirsttrigger: - context._cmp(context.data.byte(kLasttrigger), '2'); - if (!context.flags.z()) + _cmp(data.byte(kLasttrigger), '2'); + if (!flags.z()) goto notsecondtrigger; - context.al = 9; - setlocation(context); - context.al = 55; - triggermessage(context); + al = 9; + setlocation(); + al = 55; + triggermessage(); return; notsecondtrigger: - context._cmp(context.data.byte(kLasttrigger), '3'); - if (!context.flags.z()) + _cmp(data.byte(kLasttrigger), '3'); + if (!flags.z()) return /* (notthirdtrigger) */; - context.al = 2; - setlocation(context); - context.al = 59; - triggermessage(context); -} - -void triggermessage(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.di = 174; - context.bx = 153; - context.cl = 200; - context.ch = 63; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiget(context); - context.ax = context.pop(); - findpuztext(context); - context.di = 174; - context.bx = 156; - context.dl = 141; - context.ah = 16; - printdirect(context); - context.cx = 140; - hangon(context); - worktoscreen(context); - context.cx = 340; - hangon(context); - context.di = 174; - context.bx = 153; - context.cl = 200; - context.ch = 63; - context.ds = context.data.word(kMapstore); - context.si = 0; - multiput(context); - worktoscreen(context); - context.data.byte(kLasttrigger) = 0; -} - -void printcurs(Context &context) { - STACK_CHECK(context); - context.push(context.si); - context.push(context.di); - context.push(context.ds); - context.push(context.dx); - context.push(context.bx); - context.push(context.es); - context.di = context.data.word(kCurslocx); - context.bx = context.data.word(kCurslocy); - context.cl = 6; - context.ch = 8; - context.ds = context.data.word(kBuffers); - context.si = (0); - context.push(context.di); - context.push(context.bx); - multiget(context); - context.bx = context.pop(); - context.di = context.pop(); - context.push(context.bx); - context.push(context.di); - context._inc(context.data.word(kMaintimer)); - context.ax = context.data.word(kMaintimer); - context._and(context.al, 16); - if (!context.flags.z()) + al = 2; + setlocation(); + al = 59; + triggermessage(); +} + +void DreamGenContext::triggermessage() { + STACK_CHECK; + push(ax); + di = 174; + bx = 153; + cl = 200; + ch = 63; + ds = data.word(kMapstore); + si = 0; + multiget(); + ax = pop(); + findpuztext(); + di = 174; + bx = 156; + dl = 141; + ah = 16; + printdirect(); + cx = 140; + hangon(); + worktoscreen(); + cx = 340; + hangon(); + di = 174; + bx = 153; + cl = 200; + ch = 63; + ds = data.word(kMapstore); + si = 0; + 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; + 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; - context.al = '/'; - context._sub(context.al, 32); - context.ah = 0; - context.ds = context.data.word(kTempcharset); - showframe(context); + al = '/'; + _sub(al, 32); + ah = 0; + ds = data.word(kTempcharset); + showframe(); flashcurs: - context.di = context.pop(); - context.bx = context.pop(); - context._sub(context.di, 6); - context.cl = 12; - context.ch = 8; - multidump(context); - context.es = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.si = context.pop(); -} - -void delcurs(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.push(context.di); - context.push(context.ds); - context.push(context.dx); - context.push(context.si); - context.di = context.data.word(kCurslocx); - context.bx = context.data.word(kCurslocy); - context.cl = 6; - context.ch = 8; - context.push(context.di); - context.push(context.bx); - context.push(context.cx); - context.ds = context.data.word(kBuffers); - context.si = (0); - multiput(context); - context.cx = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - multidump(context); - context.si = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); -} - -void useobject(Context &context) { - STACK_CHECK(context); - context.data.byte(kWithobject) = 255; - context._cmp(context.data.byte(kCommandtype), 229); - if (context.flags.z()) + di = pop(); + bx = pop(); + _sub(di, 6); + cl = 12; + ch = 8; + 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; + 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; - context.data.byte(kCommandtype) = 229; - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kObjecttype); - context.al = 51; - commandwithob(context); + data.byte(kCommandtype) = 229; + bl = data.byte(kCommand); + bh = data.byte(kObjecttype); + al = 51; + commandwithob(); alreadyuse: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nouse) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto douse; return; douse: - useroutine(context); + useroutine(); } -void useroutine(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 50); - if (context.flags.c()) +void DreamGenContext::useroutine() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 50); + if (flags.c()) goto nodream7; - context._cmp(context.data.byte(kPointerpower), 0); - if (!context.flags.z()) + _cmp(data.byte(kPointerpower), 0); + if (!flags.z()) goto powerok; return; powerok: - context.data.byte(kPointerpower) = 0; + data.byte(kPointerpower) = 0; nodream7: - getanyad(context); - context.dx = context.data; - context.ds = context.dx; - context.si = 2984; + getanyad(); + dx = data; + ds = dx; + si = 2984; checkuselist: - context.push(context.si); - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) + push(si); + _lodsb(); + _sub(al, 'A'); + _cmp(al, es.byte(bx+12)); + if (!flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.es.byte(context.bx+13)); - if (!context.flags.z()) + _lodsb(); + _sub(al, 'A'); + _cmp(al, es.byte(bx+13)); + if (!flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.es.byte(context.bx+14)); - if (!context.flags.z()) + _lodsb(); + _sub(al, 'A'); + _cmp(al, es.byte(bx+14)); + if (!flags.z()) goto failed; - context._lodsb(); - context._sub(context.al, 'A'); - context._cmp(context.al, context.es.byte(context.bx+15)); - if (!context.flags.z()) + _lodsb(); + _sub(al, 'A'); + _cmp(al, es.byte(bx+15)); + if (!flags.z()) goto failed; - context._lodsw(); - context.si = context.pop(); - __dispatch_call(context, context.ax); + _lodsw(); + si = pop(); + __dispatch_call(ax); return; failed: - context.si = context.pop(); - context._add(context.si, 6); - context._cmp(context.ds.byte(context.si), 140); - if (!context.flags.z()) + si = pop(); + _add(si, 6); + _cmp(ds.byte(si), 140); + if (!flags.z()) goto checkuselist; - delpointer(context); - getobtextstart(context); - findnextcolon(context); - context._cmp(context.al, 0); - if (context.flags.z()) + delpointer(); + getobtextstart(); + findnextcolon(); + _cmp(al, 0); + if (flags.z()) goto cantuse2; - findnextcolon(context); - context._cmp(context.al, 0); - if (context.flags.z()) + findnextcolon(); + _cmp(al, 0); + if (flags.z()) goto cantuse2; - context.al = context.es.byte(context.si); - context._cmp(context.al, 0); - if (context.flags.z()) + al = es.byte(si); + _cmp(al, 0); + if (flags.z()) goto cantuse2; - usetext(context); - context.cx = 400; - hangonp(context); - putbackobstuff(context); + usetext(); + cx = 400; + hangonp(); + putbackobstuff(); return; cantuse2: - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.di = 33; - context.bx = 100; - context.al = 63; - context.dl = 241; - printmessage(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - putbackobstuff(context); - context.data.byte(kCommandtype) = 255; -} - -void wheelsound(Context &context) { - STACK_CHECK(context); - context.al = 17; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); -} - -void runtap(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + createpanel(); + showpanel(); + showman(); + showexit(); + obicons(); + di = 33; + bx = 100; + al = 63; + dl = 241; + printmessage(); + worktoscreenm(); + cx = 50; + hangonp(); + putbackobstuff(); + data.byte(kCommandtype) = 255; +} + +void DreamGenContext::wheelsound() { + STACK_CHECK; + al = 17; + playchannel1(); + showfirstuse(); + putbackobstuff(); +} + +void DreamGenContext::runtap() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto tapwith; - withwhat(context); + withwhat(); return; tapwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'E'; + compare(); + if (flags.z()) goto fillcupfromtap; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'F'; + compare(); + if (flags.z()) goto cupfromtapfull; - context.cx = 300; - context.al = 56; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 56; + showpuztext(); + putbackobstuff(); return; fillcupfromtap: - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+15) = 'F'-'A'; - context.al = 8; - playchannel1(context); - context.cx = 300; - context.al = 57; - showpuztext(context); - putbackobstuff(context); + al = data.byte(kWithobject); + getexad(); + es.byte(bx+15) = 'F'-'A'; + al = 8; + playchannel1(); + cx = 300; + al = 57; + showpuztext(); + putbackobstuff(); return; cupfromtapfull: - context.cx = 300; - context.al = 58; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 58; + showpuztext(); + putbackobstuff(); } -void playguitar(Context &context) { - STACK_CHECK(context); - context.al = 14; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); +void DreamGenContext::playguitar() { + STACK_CHECK; + al = 14; + playchannel1(); + showfirstuse(); + putbackobstuff(); } -void hotelcontrol(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 21); - if (!context.flags.z()) +void DreamGenContext::hotelcontrol() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 21); + if (!flags.z()) goto notrightcont; - context._cmp(context.data.byte(kMapx), 33); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 33); + if (!flags.z()) goto notrightcont; - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); return; notrightcont: - showseconduse(context); - putbackobstuff(context); -} - -void hotelbell(Context &context) { - STACK_CHECK(context); - context.al = 12; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); -} - -void opentomb(Context &context) { - STACK_CHECK(context); - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - context.data.word(kWatchingtime) = 35*2; - context.data.word(kReeltowatch) = 1; - context.data.word(kEndwatchreel) = 33; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void usetrainer(Context &context) { - STACK_CHECK(context); - getanyad(context); - context._cmp(context.es.byte(context.bx+2), 4); - if (!context.flags.z()) + 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; - context._inc(context.data.byte(kProgresspoints)); - makeworn(context); - showseconduse(context); - putbackobstuff(context); + _inc(data.byte(kProgresspoints)); + makeworn(); + showseconduse(); + putbackobstuff(); return; notheldtrainer: - nothelderror(context); -} - -void nothelderror(Context &context) { - STACK_CHECK(context); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.di = 64; - context.bx = 100; - context.al = 63; - context.ah = 1; - context.dl = 201; - printmessage2(context); - worktoscreenm(context); - context.cx = 50; - hangonp(context); - putbackobstuff(context); -} - -void usepipe(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + nothelderror(); +} + +void DreamGenContext::nothelderror() { + STACK_CHECK; + createpanel(); + showpanel(); + showman(); + showexit(); + obicons(); + di = 64; + bx = 100; + al = 63; + ah = 1; + dl = 201; + printmessage2(); + worktoscreenm(); + cx = 50; + hangonp(); + putbackobstuff(); +} + +void DreamGenContext::usepipe() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto pipewith; - withwhat(context); + withwhat(); return; pipewith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'E'; + compare(); + if (flags.z()) goto fillcup; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'F'; + compare(); + if (flags.z()) goto alreadyfull; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; fillcup: - context.cx = 300; - context.al = 36; - showpuztext(context); - putbackobstuff(context); - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+15) = 'F'-'A'; + cx = 300; + al = 36; + showpuztext(); + putbackobstuff(); + al = data.byte(kWithobject); + getexad(); + es.byte(bx+15) = 'F'-'A'; return; alreadyfull: - context.cx = 300; - context.al = 35; - showpuztext(context); - putbackobstuff(context); -} - -void usefullcart(Context &context) { - STACK_CHECK(context); - context._inc(context.data.byte(kProgresspoints)); - context.al = 2; - context.ah = context.data.byte(kRoomnum); - context._add(context.ah, 6); - turnanypathon(context); - context.data.byte(kManspath) = 4; - context.data.byte(kFacing) = 4; - context.data.byte(kTurntoface) = 4; - context.data.byte(kFinaldest) = 4; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - showfirstuse(context); - context.data.word(kWatchingtime) = 72*2; - context.data.word(kReeltowatch) = 58; - context.data.word(kEndwatchreel) = 142; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void useplinth(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + 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; +} + +void DreamGenContext::useplinth() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto plinthwith; - withwhat(context); + withwhat(); return; plinthwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'D'; - context.ch = 'K'; - context.dl = 'E'; - context.dh = 'Y'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'D'; + ch = 'K'; + dl = 'E'; + dh = 'Y'; + compare(); + if (flags.z()) goto isrightkey; - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); return; isrightkey: - context._inc(context.data.byte(kProgresspoints)); - showseconduse(context); - context.data.word(kWatchingtime) = 220; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 104; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context.al = context.data.byte(kRoomafterdream); - context.data.byte(kNewlocation) = context.al; -} - -void chewy(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - getanyad(context); - context.es.byte(context.bx+2) = 255; - context.data.byte(kGetback) = 1; -} - -void useladder(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context._sub(context.data.byte(kMapx), 11); - findroominloc(context); - context.data.byte(kFacing) = 6; - context.data.byte(kTurntoface) = 6; - context.data.byte(kManspath) = 0; - context.data.byte(kDestination) = 0; - context.data.byte(kFinaldest) = 0; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - context.data.byte(kGetback) = 1; -} - -void useladderb(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context._add(context.data.byte(kMapx), 11); - findroominloc(context); - context.data.byte(kFacing) = 2; - context.data.byte(kTurntoface) = 2; - context.data.byte(kManspath) = 1; - context.data.byte(kDestination) = 1; - context.data.byte(kFinaldest) = 1; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - context.data.byte(kGetback) = 1; -} - -void slabdoora(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 13; - context._cmp(context.data.byte(kDreamnumber), 3); - if (!context.flags.z()) + _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; - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 42; - context.data.byte(kNewlocation) = 47; + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 42; + data.byte(kNewlocation) = 47; return; slabawrong: - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 34; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 34; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; } -void slabdoorb(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kDreamnumber), 1); - if (!context.flags.z()) +void DreamGenContext::slabdoorb() { + STACK_CHECK; + _cmp(data.byte(kDreamnumber), 1); + if (!flags.z()) goto slabbwrong; - context.al = 'S'; - context.ah = 'H'; - context.cl = 'L'; - context.ch = 'D'; - isryanholding(context); - if (!context.flags.z()) + al = 'S'; + ah = 'H'; + cl = 'L'; + ch = 'D'; + isryanholding(); + if (!flags.z()) goto gotcrystal; - context.al = 44; - context.cx = 200; - showpuztext(context); - putbackobstuff(context); + al = 44; + cx = 200; + showpuztext(); + putbackobstuff(); return; gotcrystal: - showfirstuse(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 44; - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 71; - context.data.byte(kNewlocation) = 47; + 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(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 44; - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 63; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; -} - -void slabdoord(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 75; - context._cmp(context.data.byte(kDreamnumber), 0); - if (!context.flags.z()) + 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; - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 102; - context.data.byte(kNewlocation) = 47; + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 102; + data.byte(kNewlocation) = 47; return; slabcwrong: - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 94; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; -} - -void slabdoorc(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 108; - context._cmp(context.data.byte(kDreamnumber), 4); - if (!context.flags.z()) + 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; - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 135; - context.data.byte(kNewlocation) = 47; + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 135; + data.byte(kNewlocation) = 47; return; slabdwrong: - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 127; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; -} - -void slabdoore(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 141; - context._cmp(context.data.byte(kDreamnumber), 5); - if (!context.flags.z()) + 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; - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 168; - context.data.byte(kNewlocation) = 47; + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 168; + data.byte(kNewlocation) = 47; return; slabewrong: - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 160; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; -} - -void slabdoorf(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kReeltowatch) = 171; - context._cmp(context.data.byte(kDreamnumber), 2); - if (!context.flags.z()) + 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; - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 60; - context.data.word(kEndwatchreel) = 197; - context.data.byte(kNewlocation) = 47; + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 197; + data.byte(kNewlocation) = 47; return; slabfwrong: - context.data.word(kWatchingtime) = 40; - context.data.word(kEndwatchreel) = 189; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 189; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; } -void useslab(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::useslab() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto slabwith; - withwhat(context); + withwhat(); return; slabwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'J'; - context.ch = 'E'; - context.dl = 'W'; - context.dh = 'L'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'J'; + ch = 'E'; + dl = 'W'; + dh = 'L'; + compare(); + if (flags.z()) goto nextslab; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; nextslab: - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(kCommand); - context.push(context.ax); - removesetobject(context); - context.ax = context.pop(); - context._inc(context.al); - context.push(context.ax); - placesetobject(context); - context.ax = context.pop(); - context._cmp(context.al, 54); - if (!context.flags.z()) + al = data.byte(kWithobject); + getexad(); + es.byte(bx+2) = 0; + al = data.byte(kCommand); + push(ax); + removesetobject(); + ax = pop(); + _inc(al); + push(ax); + placesetobject(); + ax = pop(); + _cmp(al, 54); + if (!flags.z()) goto notlastslab; - context.al = 0; - turnpathon(context); - context.data.word(kWatchingtime) = 22; - context.data.word(kReeltowatch) = 35; - context.data.word(kEndwatchreel) = 48; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; + al = 0; + turnpathon(); + data.word(kWatchingtime) = 22; + data.word(kReeltowatch) = 35; + data.word(kEndwatchreel) = 48; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; notlastslab: - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - context.data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); + showfirstuse(); + data.byte(kGetback) = 1; } -void usecart(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usecart() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto cartwith; - withwhat(context); + withwhat(); return; cartwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'R'; - context.ch = 'O'; - context.dl = 'C'; - context.dh = 'K'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'R'; + ch = 'O'; + dl = 'C'; + dh = 'K'; + compare(); + if (flags.z()) goto nextcart; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; nextcart: - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+2) = 0; - context.al = context.data.byte(kCommand); - context.push(context.ax); - removesetobject(context); - context.ax = context.pop(); - context._inc(context.al); - placesetobject(context); - context._inc(context.data.byte(kProgresspoints)); - context.al = 17; - playchannel1(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; -} - -void useclearbox(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + 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(context); + withwhat(); return; clearboxwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'R'; - context.ch = 'A'; - context.dl = 'I'; - context.dh = 'L'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'R'; + ch = 'A'; + dl = 'I'; + dh = 'L'; + compare(); + if (flags.z()) goto openbox; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; openbox: - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - context.data.word(kWatchingtime) = 80; - context.data.word(kReeltowatch) = 67; - context.data.word(kEndwatchreel) = 105; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void usecoveredbox(Context &context) { - STACK_CHECK(context); - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - context.data.word(kWatchingtime) = 50; - context.data.word(kReeltowatch) = 41; - context.data.word(kEndwatchreel) = 66; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void userailing(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.word(kWatchingtime) = 80; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 30; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context.data.byte(kMandead) = 4; -} - -void useopenbox(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + _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() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto openboxwith; - withwhat(context); + withwhat(); return; openboxwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'F'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'F'; + compare(); + if (flags.z()) goto destoryopenbox; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'P'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'P'; + dh = 'E'; + compare(); + if (flags.z()) goto openboxwrong; - showfirstuse(context); + showfirstuse(); return; destoryopenbox: - context._inc(context.data.byte(kProgresspoints)); - context.cx = 300; - context.al = 37; - showpuztext(context); - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+15) = 'E'-'A'; - context.data.word(kWatchingtime) = 140; - context.data.word(kReeltowatch) = 105; - context.data.word(kEndwatchreel) = 181; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.al = 4; - turnpathon(context); - context.data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); + cx = 300; + al = 37; + showpuztext(); + al = data.byte(kWithobject); + getexad(); + es.byte(bx+15) = 'E'-'A'; + data.word(kWatchingtime) = 140; + data.word(kReeltowatch) = 105; + data.word(kEndwatchreel) = 181; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + al = 4; + turnpathon(); + data.byte(kGetback) = 1; return; openboxwrong: - context.cx = 300; - context.al = 38; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 38; + showpuztext(); + putbackobstuff(); } -void wearwatch(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) +void DreamGenContext::wearwatch() { + STACK_CHECK; + _cmp(data.byte(kWatchon), 1); + if (flags.z()) goto wearingwatch; - showfirstuse(context); - context.data.byte(kWatchon) = 1; - context.data.byte(kGetback) = 1; - getanyad(context); - makeworn(context); + showfirstuse(); + data.byte(kWatchon) = 1; + data.byte(kGetback) = 1; + getanyad(); + makeworn(); return; wearingwatch: - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void wearshades(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kShadeson), 1); - if (context.flags.z()) +void DreamGenContext::wearshades() { + STACK_CHECK; + _cmp(data.byte(kShadeson), 1); + if (flags.z()) goto wearingshades; - context.data.byte(kShadeson) = 1; - showfirstuse(context); - context.data.byte(kGetback) = 1; - getanyad(context); - makeworn(context); + data.byte(kShadeson) = 1; + showfirstuse(); + data.byte(kGetback) = 1; + getanyad(); + makeworn(); return; wearingshades: - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void sitdowninbar(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchmode), -1); - if (!context.flags.z()) +void DreamGenContext::sitdowninbar() { + STACK_CHECK; + _cmp(data.byte(kWatchmode), -1); + if (!flags.z()) goto satdown; - showfirstuse(context); - context.data.word(kWatchingtime) = 50; - context.data.word(kReeltowatch) = 55; - context.data.word(kEndwatchreel) = 71; - context.data.word(kReeltohold) = 73; - context.data.word(kEndofholdreel) = 83; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; + 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(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void usechurchhole(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; - context.data.word(kWatchingtime) = 28; - context.data.word(kReeltowatch) = 13; - context.data.word(kEndwatchreel) = 26; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; +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 usehole(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usehole() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto holewith; - withwhat(context); + withwhat(); return; holewith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'H'; - context.ch = 'N'; - context.dl = 'D'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'H'; + ch = 'N'; + dl = 'D'; + dh = 'A'; + compare(); + if (flags.z()) goto righthand; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; righthand: - showfirstuse(context); - context.al = 86; - removesetobject(context); - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+2) = 255; - context.data.byte(kCanmovealtar) = 1; - context.data.byte(kGetback) = 1; -} - -void usealtar(Context &context) { - STACK_CHECK(context); - context.al = 'C'; - context.ah = 'N'; - context.cl = 'D'; - context.ch = 'A'; - findexobject(context); - context._cmp(context.al, (114)); - if (context.flags.z()) + 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() { + STACK_CHECK; + al = 'C'; + ah = 'N'; + cl = 'D'; + ch = 'A'; + findexobject(); + _cmp(al, (114)); + if (flags.z()) goto thingsonaltar; - context.al = 'C'; - context.ah = 'N'; - context.cl = 'D'; - context.ch = 'B'; - findexobject(context); - context._cmp(context.al, (114)); - if (context.flags.z()) + al = 'C'; + ah = 'N'; + cl = 'D'; + ch = 'B'; + findexobject(); + _cmp(al, (114)); + if (flags.z()) goto thingsonaltar; - context._cmp(context.data.byte(kCanmovealtar), 1); - if (context.flags.z()) + _cmp(data.byte(kCanmovealtar), 1); + if (flags.z()) goto movealtar; - context.cx = 300; - context.al = 23; - showpuztext(context); - context.data.byte(kGetback) = 1; + cx = 300; + al = 23; + showpuztext(); + data.byte(kGetback) = 1; return; movealtar: - context._inc(context.data.byte(kProgresspoints)); - showseconduse(context); - context.data.word(kWatchingtime) = 160; - context.data.word(kReeltowatch) = 81; - context.data.word(kEndwatchreel) = 174; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.al = 47; - context.bl = 52; - context.bh = 76; - context.cx = 32; - context.dx = 98; - setuptimeduse(context); - context.data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); + showseconduse(); + data.word(kWatchingtime) = 160; + data.word(kReeltowatch) = 81; + data.word(kEndwatchreel) = 174; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + al = 47; + bl = 52; + bh = 76; + cx = 32; + dx = 98; + setuptimeduse(); + data.byte(kGetback) = 1; return; thingsonaltar: - showfirstuse(context); - context.data.byte(kGetback) = 1; + showfirstuse(); + data.byte(kGetback) = 1; } -void opentvdoor(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::opentvdoor() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto tvdoorwith; - withwhat(context); + withwhat(); return; tvdoorwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'U'; - context.ch = 'L'; - context.dl = 'O'; - context.dh = 'K'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'U'; + ch = 'L'; + dl = 'O'; + dh = 'K'; + compare(); + if (flags.z()) goto keyontv; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; keyontv: - showfirstuse(context); - context.data.byte(kLockstatus) = 0; - context.data.byte(kGetback) = 1; + showfirstuse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; } -void usedryer(Context &context) { - STACK_CHECK(context); - context.al = 12; - playchannel1(context); - showfirstuse(context); - context.data.byte(kGetback) = 1; +void DreamGenContext::usedryer() { + STACK_CHECK; + al = 12; + playchannel1(); + showfirstuse(); + data.byte(kGetback) = 1; } -void openlouis(Context &context) { - STACK_CHECK(context); - context.al = 5; - context.ah = 2; - context.cl = 3; - context.ch = 8; - entercode(context); - context.data.byte(kGetback) = 1; +void DreamGenContext::openlouis() { + STACK_CHECK; + al = 5; + ah = 2; + cl = 3; + ch = 8; + entercode(); + data.byte(kGetback) = 1; } -void nextcolon(Context &context) { - STACK_CHECK(context); +void DreamGenContext::nextcolon() { + STACK_CHECK; lookcolon: - context.al = context.es.byte(context.si); - context._inc(context.si); - context._cmp(context.al, ':'); - if (!context.flags.z()) + al = es.byte(si); + _inc(si); + _cmp(al, ':'); + if (!flags.z()) goto lookcolon; } -void openyourneighbour(Context &context) { - STACK_CHECK(context); - context.al = 255; - context.ah = 255; - context.cl = 255; - context.ch = 255; - entercode(context); - context.data.byte(kGetback) = 1; +void DreamGenContext::openyourneighbour() { + STACK_CHECK; + al = 255; + ah = 255; + cl = 255; + ch = 255; + entercode(); + data.byte(kGetback) = 1; } -void usewindow(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kManspath), 6); - if (!context.flags.z()) +void DreamGenContext::usewindow() { + STACK_CHECK; + _cmp(data.byte(kManspath), 6); + if (!flags.z()) goto notonbalc; - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - context.data.byte(kNewlocation) = 29; - context.data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); + showfirstuse(); + data.byte(kNewlocation) = 29; + data.byte(kGetback) = 1; return; notonbalc: - showseconduse(context); - putbackobstuff(context); -} - -void usebalcony(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.al = 6; - turnpathon(context); - context.al = 0; - turnpathoff(context); - context.al = 1; - turnpathoff(context); - context.al = 2; - turnpathoff(context); - context.al = 3; - turnpathoff(context); - context.al = 4; - turnpathoff(context); - context.al = 5; - turnpathoff(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kManspath) = 6; - context.data.byte(kDestination) = 6; - context.data.byte(kFinaldest) = 6; - findxyfrompath(context); - switchryanoff(context); - context.data.byte(kResetmanxy) = 1; - context.data.word(kWatchingtime) = 30*2; - context.data.word(kReeltowatch) = 183; - context.data.word(kEndwatchreel) = 212; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void openryan(Context &context) { - STACK_CHECK(context); - context.al = 5; - context.ah = 1; - context.cl = 0; - context.ch = 6; - entercode(context); - context.data.byte(kGetback) = 1; -} - -void openpoolboss(Context &context) { - STACK_CHECK(context); - context.al = 5; - context.ah = 2; - context.cl = 2; - context.ch = 2; - entercode(context); - context.data.byte(kGetback) = 1; -} - -void openeden(Context &context) { - STACK_CHECK(context); - context.al = 2; - context.ah = 8; - context.cl = 6; - context.ch = 5; - entercode(context); - context.data.byte(kGetback) = 1; -} - -void opensarters(Context &context) { - STACK_CHECK(context); - context.al = 7; - context.ah = 8; - context.cl = 3; - context.ch = 3; - entercode(context); - context.data.byte(kGetback) = 1; -} - -void isitright(Context &context) { - STACK_CHECK(context); - context.bx = context.data; - context.es = context.bx; - context.bx = 8573; - context._cmp(context.es.byte(context.bx+0), context.al); - if (!context.flags.z()) + 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) */; - context._cmp(context.es.byte(context.bx+1), context.ah); - if (!context.flags.z()) + _cmp(es.byte(bx+1), ah); + if (!flags.z()) return /* (notright) */; - context._cmp(context.es.byte(context.bx+2), context.cl); - if (!context.flags.z()) + _cmp(es.byte(bx+2), cl); + if (!flags.z()) return /* (notright) */; - context._cmp(context.es.byte(context.bx+3), context.ch); + _cmp(es.byte(bx+3), ch); } -void drawitall(Context &context) { - STACK_CHECK(context); - createpanel(context); - drawfloor(context); - printsprites(context); - showicon(context); +void DreamGenContext::drawitall() { + STACK_CHECK; + createpanel(); + drawfloor(); + printsprites(); + showicon(); } -void openhoteldoor(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::openhoteldoor() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto hoteldoorwith; - withwhat(context); + withwhat(); return; hoteldoorwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'E'; + dl = 'Y'; + dh = 'A'; + compare(); + if (flags.z()) goto keyonhotel1; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; keyonhotel1: - context.al = 16; - playchannel1(context); - showfirstuse(context); - context.data.byte(kLockstatus) = 0; - context.data.byte(kGetback) = 1; + al = 16; + playchannel1(); + showfirstuse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; } -void openhoteldoor2(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::openhoteldoor2() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto hoteldoorwith2; - withwhat(context); + withwhat(); return; hoteldoorwith2: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'E'; + dl = 'Y'; + dh = 'A'; + compare(); + if (flags.z()) goto keyonhotel2; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; keyonhotel2: - context.al = 16; - playchannel1(context); - showfirstuse(context); - putbackobstuff(context); + al = 16; + playchannel1(); + showfirstuse(); + putbackobstuff(); } -void grafittidoor(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::grafittidoor() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto grafwith; - withwhat(context); + withwhat(); return; grafwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'A'; - context.ch = 'P'; - context.dl = 'E'; - context.dh = 'N'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'A'; + ch = 'P'; + dl = 'E'; + dh = 'N'; + compare(); + if (flags.z()) goto dograf; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; dograf: - showfirstuse(context); - putbackobstuff(context); -} - -void trapdoor(Context &context) { - STACK_CHECK(context); - context._inc(context.data.byte(kProgresspoints)); - showfirstuse(context); - switchryanoff(context); - context.data.word(kWatchingtime) = 20*2; - context.data.word(kReeltowatch) = 181; - context.data.word(kEndwatchreel) = 197; - context.data.byte(kNewlocation) = 26; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void callhotellift(Context &context) { - STACK_CHECK(context); - context.al = 12; - playchannel1(context); - showfirstuse(context); - context.data.byte(kCounttoopen) = 8; - context.data.byte(kGetback) = 1; - context.data.byte(kDestination) = 5; - context.data.byte(kFinaldest) = 5; - autosetwalk(context); - context.al = 4; - turnpathon(context); -} - -void calledenslift(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kCounttoopen) = 8; - context.data.byte(kGetback) = 1; - context.al = 2; - turnpathon(context); -} - -void calledensdlift(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLiftflag), 1); - if (context.flags.z()) + 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(context); - context.data.byte(kCounttoopen) = 8; - context.data.byte(kGetback) = 1; - context.al = 2; - turnpathon(context); + showfirstuse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + al = 2; + turnpathon(); return; edensdhere: - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void usepoolreader(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usepoolreader() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto poolwith; - withwhat(context); + withwhat(); return; poolwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'M'; - context.ch = 'E'; - context.dl = 'M'; - context.dh = 'B'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'M'; + ch = 'E'; + dl = 'M'; + dh = 'B'; + compare(); + if (flags.z()) goto openpool; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; openpool: - context._cmp(context.data.byte(kTalkedtoattendant), 1); - if (context.flags.z()) + _cmp(data.byte(kTalkedtoattendant), 1); + if (flags.z()) goto canopenpool; - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); return; canopenpool: - context.al = 17; - playchannel1(context); - showfirstuse(context); - context.data.byte(kCounttoopen) = 6; - context.data.byte(kGetback) = 1; + al = 17; + playchannel1(); + showfirstuse(); + data.byte(kCounttoopen) = 6; + data.byte(kGetback) = 1; } -void uselighter(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::uselighter() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotlighterwith; - withwhat(context); + withwhat(); return; gotlighterwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'S'; - context.ch = 'M'; - context.dl = 'K'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'S'; + ch = 'M'; + dl = 'K'; + dh = 'E'; + compare(); + if (flags.z()) goto cigarette; - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); return; cigarette: - context.cx = 300; - context.al = 9; - showpuztext(context); - context.al = context.data.byte(kWithobject); - getexad(context); - context.es.byte(context.bx+2) = 255; - context.data.byte(kGetback) = 1; -} - -void showseconduse(Context &context) { - STACK_CHECK(context); - getobtextstart(context); - nextcolon(context); - nextcolon(context); - nextcolon(context); - usetext(context); - context.cx = 400; - hangonp(context); -} - -void usecardreader1(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + 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(context); + withwhat(); return; gotreader1with: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'S'; + dl = 'H'; + dh = 'R'; + compare(); + if (flags.z()) goto correctcard; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; correctcard: - context._cmp(context.data.byte(kTalkedtosparky), 0); - if (context.flags.z()) + _cmp(data.byte(kTalkedtosparky), 0); + if (flags.z()) goto notyet; - context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) + _cmp(data.word(kCard1money), 0); + if (flags.z()) goto getscash; - context.cx = 300; - context.al = 17; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 17; + showpuztext(); + putbackobstuff(); return; getscash: - context.al = 16; - playchannel1(context); - context.cx = 300; - context.al = 18; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kCard1money) = 12432; - context.data.byte(kGetback) = 1; + al = 16; + playchannel1(); + cx = 300; + al = 18; + showpuztext(); + _inc(data.byte(kProgresspoints)); + data.word(kCard1money) = 12432; + data.byte(kGetback) = 1; return; notyet: - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); } -void usecardreader2(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usecardreader2() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotreader2with; - withwhat(context); + withwhat(); return; gotreader2with: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'S'; + dl = 'H'; + dh = 'R'; + compare(); + if (flags.z()) goto correctcard2; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; correctcard2: - context._cmp(context.data.byte(kTalkedtoboss), 0); - if (context.flags.z()) + _cmp(data.byte(kTalkedtoboss), 0); + if (flags.z()) goto notyetboss; - context._cmp(context.data.word(kCard1money), 0); - if (context.flags.z()) + _cmp(data.word(kCard1money), 0); + if (flags.z()) goto nocash; - context._cmp(context.data.byte(kGunpassflag), 2); - if (context.flags.z()) + _cmp(data.byte(kGunpassflag), 2); + if (flags.z()) goto alreadygotnew; - context.al = 18; - playchannel1(context); - context.cx = 300; - context.al = 19; - showpuztext(context); - context.al = 94; - placesetobject(context); - context.data.byte(kGunpassflag) = 1; - context._sub(context.data.word(kCard1money), 2000); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kGetback) = 1; + 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: - context.cx = 300; - context.al = 20; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 20; + showpuztext(); + putbackobstuff(); return; alreadygotnew: - context.cx = 300; - context.al = 22; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 22; + showpuztext(); + putbackobstuff(); return; notyetboss: - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); } -void usecardreader3(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usecardreader3() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotreader3with; - withwhat(context); + withwhat(); return; gotreader3with: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'S'; - context.dl = 'H'; - context.dh = 'R'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'S'; + dl = 'H'; + dh = 'R'; + compare(); + if (flags.z()) goto rightcard; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; rightcard: - context._cmp(context.data.byte(kTalkedtorecep), 0); - if (context.flags.z()) + _cmp(data.byte(kTalkedtorecep), 0); + if (flags.z()) goto notyetrecep; - context._cmp(context.data.byte(kCardpassflag), 0); - if (!context.flags.z()) + _cmp(data.byte(kCardpassflag), 0); + if (!flags.z()) goto alreadyusedit; - context.al = 16; - playchannel1(context); - context.cx = 300; - context.al = 25; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context._sub(context.data.word(kCard1money), 8300); - context.data.byte(kCardpassflag) = 1; - context.data.byte(kGetback) = 1; + 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: - context.cx = 300; - context.al = 26; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 26; + showpuztext(); + putbackobstuff(); return; notyetrecep: - showfirstuse(context); - putbackobstuff(context); -} - -void usecashcard(Context &context) { - STACK_CHECK(context); - getridofreels(context); - loadkeypad(context); - createpanel(context); - showpanel(context); - showexit(context); - showman(context); - context.di = 114; - context.bx = 120; - context.ds = context.data.word(kTempgraphics); - context.al = 39; - context.ah = 0; - showframe(context); - context.ax = context.data.word(kCard1money); - moneypoke(context); - getobtextstart(context); - nextcolon(context); - nextcolon(context); - context.di = 36; - context.bx = 98; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - context.di = 160; - context.bx = 155; - context.es = context.cs; - context.si = 3474; - context.data.word(kCharshift) = 91*2+75; - context.al = 0; - context.ah = 0; - context.dl = 240; - printdirect(context); - context.di = 187; - context.bx = 155; - context.es = context.cs; - context.si = 3479; - context.data.word(kCharshift) = 91*2+85; - context.al = 0; - context.ah = 0; - context.dl = 240; - printdirect(context); - context.data.word(kCharshift) = 0; - worktoscreenm(context); - context.cx = 400; - hangonp(context); - getridoftemp(context); - restorereels(context); - putbackobstuff(context); -} - -void lookatcard(Context &context) { - STACK_CHECK(context); - context.data.byte(kManisoffscreen) = 1; - getridofreels(context); - loadkeypad(context); - createpanel2(context); - context.di = 160; - context.bx = 80; - context.ds = context.data.word(kTempgraphics); - context.al = 42; - context.ah = 128; - showframe(context); - getobtextstart(context); - findnextcolon(context); - findnextcolon(context); - findnextcolon(context); - context.di = 36; - context.bx = 124; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - context.push(context.es); - context.push(context.si); - worktoscreenm(context); - context.cx = 280; - hangonw(context); - createpanel2(context); - context.di = 160; - context.bx = 80; - context.ds = context.data.word(kTempgraphics); - context.al = 42; - context.ah = 128; - showframe(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 130; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonw(context); - context.data.byte(kManisoffscreen) = 0; - getridoftemp(context); - restorereels(context); - putbackobstuff(context); -} - -void moneypoke(Context &context) { - STACK_CHECK(context); - context.bx = 3474; - context.cl = 48-1; + showfirstuse(); + putbackobstuff(); +} + +void DreamGenContext::usecashcard() { + STACK_CHECK; + getridofreels(); + loadkeypad(); + createpanel(); + showpanel(); + showexit(); + showman(); + di = 114; + bx = 120; + ds = data.word(kTempgraphics); + al = 39; + ah = 0; + showframe(); + ax = data.word(kCard1money); + moneypoke(); + getobtextstart(); + nextcolon(); + nextcolon(); + di = 36; + bx = 98; + dl = 241; + al = 0; + ah = 0; + printdirect(); + di = 160; + bx = 155; + es = cs; + si = 3474; + data.word(kCharshift) = 91*2+75; + al = 0; + ah = 0; + dl = 240; + printdirect(); + di = 187; + bx = 155; + es = cs; + si = 3479; + data.word(kCharshift) = 91*2+85; + al = 0; + ah = 0; + dl = 240; + printdirect(); + data.word(kCharshift) = 0; + worktoscreenm(); + cx = 400; + hangonp(); + getridoftemp(); + restorereels(); + putbackobstuff(); +} + +void DreamGenContext::lookatcard() { + STACK_CHECK; + data.byte(kManisoffscreen) = 1; + getridofreels(); + loadkeypad(); + createpanel2(); + di = 160; + bx = 80; + ds = data.word(kTempgraphics); + al = 42; + ah = 128; + showframe(); + getobtextstart(); + findnextcolon(); + findnextcolon(); + findnextcolon(); + di = 36; + bx = 124; + dl = 241; + al = 0; + ah = 0; + printdirect(); + push(es); + push(si); + worktoscreenm(); + cx = 280; + hangonw(); + createpanel2(); + di = 160; + bx = 80; + ds = data.word(kTempgraphics); + al = 42; + ah = 128; + showframe(); + si = pop(); + es = pop(); + di = 36; + bx = 130; + dl = 241; + al = 0; + ah = 0; + printdirect(); + worktoscreenm(); + cx = 200; + hangonw(); + data.byte(kManisoffscreen) = 0; + getridoftemp(); + restorereels(); + putbackobstuff(); +} + +void DreamGenContext::moneypoke() { + STACK_CHECK; + bx = 3474; + cl = 48-1; numberpoke0: - context._inc(context.cl); - context._sub(context.ax, 10000); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 10000); + if (!flags.c()) goto numberpoke0; - context._add(context.ax, 10000); - context.cs.byte(context.bx) = context.cl; - context._inc(context.bx); - context.cl = 48-1; + _add(ax, 10000); + cs.byte(bx) = cl; + _inc(bx); + cl = 48-1; numberpoke1: - context._inc(context.cl); - context._sub(context.ax, 1000); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 1000); + if (!flags.c()) goto numberpoke1; - context._add(context.ax, 1000); - context.cs.byte(context.bx) = context.cl; - context._inc(context.bx); - context.cl = 48-1; + _add(ax, 1000); + cs.byte(bx) = cl; + _inc(bx); + cl = 48-1; numberpoke2: - context._inc(context.cl); - context._sub(context.ax, 100); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 100); + if (!flags.c()) goto numberpoke2; - context._add(context.ax, 100); - context.cs.byte(context.bx) = context.cl; - context._inc(context.bx); - context.cl = 48-1; + _add(ax, 100); + cs.byte(bx) = cl; + _inc(bx); + cl = 48-1; numberpoke3: - context._inc(context.cl); - context._sub(context.ax, 10); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 10); + if (!flags.c()) goto numberpoke3; - context._add(context.ax, 10); - context.cs.byte(context.bx) = context.cl; - context.bx = 3479; - context._add(context.al, 48); - context.cs.byte(context.bx) = context.al; + _add(ax, 10); + cs.byte(bx) = cl; + bx = 3479; + _add(al, 48); + cs.byte(bx) = al; } -void usecontrol(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usecontrol() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotcontrolwith; - withwhat(context); + withwhat(); return; gotcontrolwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'E'; - context.dl = 'Y'; - context.dh = 'A'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'E'; + dl = 'Y'; + dh = 'A'; + compare(); + if (flags.z()) goto rightkey; - context._cmp(context.data.byte(kReallocation), 21); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 21); + if (!flags.z()) goto balls; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'N'; + dl = 'F'; + dh = 'E'; + compare(); + if (flags.z()) goto jimmycontrols; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'A'; + ch = 'X'; + dl = 'E'; + dh = 'D'; + compare(); + if (flags.z()) goto axeoncontrols; balls: - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); return; rightkey: - context.al = 16; - playchannel1(context); - context._cmp(context.data.byte(kLocation), 21); - if (context.flags.z()) + al = 16; + playchannel1(); + _cmp(data.byte(kLocation), 21); + if (flags.z()) goto goingdown; - context.cx = 300; - context.al = 0; - showpuztext(context); - context.data.byte(kNewlocation) = 21; - context.data.byte(kCounttoclose) = 8; - context.data.byte(kCounttoopen) = 0; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; + cx = 300; + al = 0; + showpuztext(); + data.byte(kNewlocation) = 21; + data.byte(kCounttoclose) = 8; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; return; goingdown: - context.cx = 300; - context.al = 3; - showpuztext(context); - context.data.byte(kNewlocation) = 30; - context.data.byte(kCounttoclose) = 8; - context.data.byte(kCounttoopen) = 0; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; + cx = 300; + al = 3; + showpuztext(); + data.byte(kNewlocation) = 30; + data.byte(kCounttoclose) = 8; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; return; jimmycontrols: - context.al = 50; - placesetobject(context); - context.al = 51; - placesetobject(context); - context.al = 26; - placesetobject(context); - context.al = 30; - placesetobject(context); - context.al = 16; - removesetobject(context); - context.al = 17; - removesetobject(context); - context.al = 14; - playchannel1(context); - context.cx = 300; - context.al = 10; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kGetback) = 1; + al = 50; + placesetobject(); + al = 51; + placesetobject(); + al = 26; + placesetobject(); + al = 30; + placesetobject(); + al = 16; + removesetobject(); + al = 17; + removesetobject(); + al = 14; + playchannel1(); + cx = 300; + al = 10; + showpuztext(); + _inc(data.byte(kProgresspoints)); + data.byte(kGetback) = 1; return; axeoncontrols: - context.cx = 300; - context.al = 16; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - putbackobstuff(context); + cx = 300; + al = 16; + showpuztext(); + _inc(data.byte(kProgresspoints)); + putbackobstuff(); } -void usehatch(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kNewlocation) = 40; - context.data.byte(kGetback) = 1; +void DreamGenContext::usehatch() { + STACK_CHECK; + showfirstuse(); + data.byte(kNewlocation) = 40; + data.byte(kGetback) = 1; } -void usewire(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::usewire() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotwirewith; - withwhat(context); + withwhat(); return; gotwirewith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'N'; + dl = 'F'; + dh = 'E'; + compare(); + if (flags.z()) goto wireknife; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'A'; + ch = 'X'; + dl = 'E'; + dh = 'D'; + compare(); + if (flags.z()) goto wireaxe; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; wireaxe: - context.cx = 300; - context.al = 16; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 16; + showpuztext(); + putbackobstuff(); return; wireknife: - context.al = 51; - removesetobject(context); - context.al = 52; - placesetobject(context); - context.cx = 300; - context.al = 11; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kGetback) = 1; -} - -void usehandle(Context &context) { - STACK_CHECK(context); - context.al = 'C'; - context.ah = 'U'; - context.cl = 'T'; - context.ch = 'W'; - findsetobject(context); - context.al = context.es.byte(context.bx+58); - context._cmp(context.al, 255); - if (!context.flags.z()) + al = 51; + removesetobject(); + al = 52; + placesetobject(); + cx = 300; + al = 11; + showpuztext(); + _inc(data.byte(kProgresspoints)); + data.byte(kGetback) = 1; +} + +void DreamGenContext::usehandle() { + STACK_CHECK; + al = 'C'; + ah = 'U'; + cl = 'T'; + ch = 'W'; + findsetobject(); + al = es.byte(bx+58); + _cmp(al, 255); + if (!flags.z()) goto havecutwire; - context.cx = 300; - context.al = 12; - showpuztext(context); - context.data.byte(kGetback) = 1; + cx = 300; + al = 12; + showpuztext(); + data.byte(kGetback) = 1; return; havecutwire: - context.cx = 300; - context.al = 13; - showpuztext(context); - context.data.byte(kNewlocation) = 22; - context.data.byte(kGetback) = 1; -} - -void useelevator1(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - selectlocation(context); - context.data.byte(kGetback) = 1; -} - -void showfirstuse(Context &context) { - STACK_CHECK(context); - getobtextstart(context); - findnextcolon(context); - findnextcolon(context); - usetext(context); - context.cx = 400; - hangonp(context); -} - -void useelevator3(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.byte(kCounttoclose) = 20; - context.data.byte(kNewlocation) = 34; - context.data.word(kReeltowatch) = 46; - context.data.word(kEndwatchreel) = 63; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; -} - -void useelevator4(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 11; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kCounttoclose) = 20; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; - context.data.byte(kNewlocation) = 24; -} - -void useelevator2(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 23); - if (context.flags.z()) + cx = 300; + al = 13; + 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(context); - context.data.byte(kNewlocation) = 23; - context.data.byte(kCounttoclose) = 20; - context.data.byte(kCounttoopen) = 0; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; + showfirstuse(); + data.byte(kNewlocation) = 23; + data.byte(kCounttoclose) = 20; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; return; inpoolhall: - showfirstuse(context); - context.data.byte(kNewlocation) = 31; - context.data.byte(kCounttoclose) = 20; - context.data.byte(kCounttoopen) = 0; - context.data.word(kWatchingtime) = 80; - context.data.byte(kGetback) = 1; -} - -void useelevator5(Context &context) { - STACK_CHECK(context); - context.al = 4; - placesetobject(context); - context.al = 0; - removesetobject(context); - context.data.byte(kNewlocation) = 20; - context.data.word(kWatchingtime) = 80; - context.data.byte(kLiftflag) = 1; - context.data.byte(kCounttoclose) = 8; - context.data.byte(kGetback) = 1; -} - -void usekey(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 5); - if (context.flags.z()) + 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() { + STACK_CHECK; + _cmp(data.byte(kLocation), 5); + if (flags.z()) goto usekey1; - context._cmp(context.data.byte(kLocation), 30); - if (context.flags.z()) + _cmp(data.byte(kLocation), 30); + if (flags.z()) goto usekey1; - context._cmp(context.data.byte(kLocation), 21); - if (context.flags.z()) + _cmp(data.byte(kLocation), 21); + if (flags.z()) goto usekey2; - context.cx = 200; - context.al = 1; - showpuztext(context); - putbackobstuff(context); + cx = 200; + al = 1; + showpuztext(); + putbackobstuff(); return; usekey1: - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (!flags.z()) goto wrongroom1; - context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 10); + if (!flags.z()) goto wrongroom1; - context.cx = 300; - context.al = 0; - showpuztext(context); - context.data.byte(kCounttoclose) = 100; - context.data.byte(kGetback) = 1; + cx = 300; + al = 0; + showpuztext(); + data.byte(kCounttoclose) = 100; + data.byte(kGetback) = 1; return; usekey2: - context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 11); + if (!flags.z()) goto wrongroom1; - context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 10); + if (!flags.z()) goto wrongroom1; - context.cx = 300; - context.al = 3; - showpuztext(context); - context.data.byte(kNewlocation) = 30; - context.al = 2; - fadescreendown(context); - showfirstuse(context); - putbackobstuff(context); + cx = 300; + al = 3; + showpuztext(); + data.byte(kNewlocation) = 30; + al = 2; + fadescreendown(); + showfirstuse(); + putbackobstuff(); return; wrongroom1: - context.cx = 200; - context.al = 2; - showpuztext(context); - putbackobstuff(context); + cx = 200; + al = 2; + showpuztext(); + putbackobstuff(); } -void usestereo(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 0); - if (context.flags.z()) +void DreamGenContext::usestereo() { + STACK_CHECK; + _cmp(data.byte(kLocation), 0); + if (flags.z()) goto stereook; - context.cx = 400; - context.al = 4; - showpuztext(context); - putbackobstuff(context); + cx = 400; + al = 4; + showpuztext(); + putbackobstuff(); return; stereook: - context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 11); + if (!flags.z()) goto stereonotok; - context._cmp(context.data.byte(kMapy), 0); - if (context.flags.z()) + _cmp(data.byte(kMapy), 0); + if (flags.z()) goto stereook2; stereonotok: - context.cx = 400; - context.al = 5; - showpuztext(context); - putbackobstuff(context); + cx = 400; + al = 5; + showpuztext(); + putbackobstuff(); return; stereook2: - context.al = 'C'; - context.ah = 'D'; - context.cl = 'P'; - context.ch = 'L'; - findsetobject(context); - context.ah = 1; - checkinside(context); - context._cmp(context.cl, (114)); - if (!context.flags.z()) + al = 'C'; + ah = 'D'; + cl = 'P'; + ch = 'L'; + findsetobject(); + ah = 1; + checkinside(); + _cmp(cl, (114)); + if (!flags.z()) goto cdinside; - context.al = 6; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); - getanyad(context); - context.al = 255; - context.es.byte(context.bx+10) = context.al; + al = 6; + cx = 400; + showpuztext(); + putbackobstuff(); + getanyad(); + al = 255; + es.byte(bx+10) = al; return; cdinside: - getanyad(context); - context.al = context.es.byte(context.bx+10); - context._xor(context.al, 1); - context.es.byte(context.bx+10) = context.al; - context._cmp(context.al, 255); - if (context.flags.z()) + getanyad(); + al = es.byte(bx+10); + _xor(al, 1); + es.byte(bx+10) = al; + _cmp(al, 255); + if (flags.z()) goto stereoon; - context.al = 7; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); + al = 7; + cx = 400; + showpuztext(); + putbackobstuff(); return; stereoon: - context.al = 8; - context.cx = 400; - showpuztext(context); - putbackobstuff(context); -} - -void usecooker(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - checkinside(context); - context._cmp(context.cl, (114)); - if (!context.flags.z()) + 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(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); return; foodinside: - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void useaxe(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 22); - if (!context.flags.z()) +void DreamGenContext::useaxe() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 22); + if (!flags.z()) goto notinpool; - context._cmp(context.data.byte(kMapy), 10); - if (context.flags.z()) + _cmp(data.byte(kMapy), 10); + if (flags.z()) goto axeondoor; - showseconduse(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kLastweapon) = 2; - context.data.byte(kGetback) = 1; - removeobfrominv(context); + showseconduse(); + _inc(data.byte(kProgresspoints)); + data.byte(kLastweapon) = 2; + data.byte(kGetback) = 1; + removeobfrominv(); return; notinpool: - showfirstuse(context); + showfirstuse(); /*continuing to unbounded code: axeondoor from useelvdoor:19-29*/ axeondoor: - context.al = 15; - context.cx = 300; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 46*2; - context.data.word(kReeltowatch) = 31; - context.data.word(kEndwatchreel) = 77; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void useelvdoor(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + 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::useelvdoor() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto gotdoorwith; - withwhat(context); + withwhat(); return; gotdoorwith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'A'; - context.ch = 'X'; - context.dl = 'E'; - context.dh = 'D'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'A'; + ch = 'X'; + dl = 'E'; + dh = 'D'; + compare(); + if (flags.z()) goto axeondoor; - context.al = 14; - context.cx = 300; - showpuztext(context); - putbackobstuff(context); + al = 14; + cx = 300; + showpuztext(); + putbackobstuff(); return; axeondoor: - context.al = 15; - context.cx = 300; - showpuztext(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.word(kWatchingtime) = 46*2; - context.data.word(kReeltowatch) = 31; - context.data.word(kEndwatchreel) = 77; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void withwhat(Context &context) { - STACK_CHECK(context); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - context.al = context.data.byte(kCommand); - context.ah = context.data.byte(kObjecttype); - context.es = context.cs; - context.di = 5847; - copyname(context); - context.di = 100; - context.bx = 21; - context.dl = 200; - context.al = 63; - context.ah = 2; - printmessage2(context); - context.di = context.data.word(kLastxpos); - context._add(context.di, 5); - context.bx = 21; - context.es = context.cs; - context.si = 5847; - context.dl = 220; - context.al = 0; - context.ah = 0; - printdirect(context); - context.di = context.data.word(kLastxpos); - context._add(context.di, 5); - context.bx = 21; - context.dl = 200; - context.al = 63; - context.ah = 3; - printmessage2(context); - fillryan(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.byte(kInvopen) = 2; -} - -void selectob(Context &context) { - STACK_CHECK(context); - findinvpos(context); - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (!context.flags.z()) + 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(); + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + es = cs; + di = 5847; + copyname(); + di = 100; + bx = 21; + dl = 200; + al = 63; + ah = 2; + printmessage2(); + di = data.word(kLastxpos); + _add(di, 5); + bx = 21; + es = cs; + si = 5847; + dl = 220; + al = 0; + ah = 0; + printdirect(); + di = data.word(kLastxpos); + _add(di, 5); + bx = 21; + dl = 200; + al = 63; + ah = 3; + printmessage2(); + fillryan(); + data.byte(kCommandtype) = 255; + readmouse(); + showpointer(); + worktoscreen(); + delpointer(); + data.byte(kInvopen) = 2; +} + +void DreamGenContext::selectob() { + STACK_CHECK; + findinvpos(); + ax = es.word(bx); + _cmp(al, 255); + if (!flags.z()) goto canselectob; - blank(context); + blank(); return; canselectob: - context.data.byte(kWithobject) = context.al; - context.data.byte(kWithtype) = context.ah; - context._cmp(context.ax, context.data.word(kOldsubject)); - if (!context.flags.z()) + data.byte(kWithobject) = al; + data.byte(kWithtype) = ah; + _cmp(ax, data.word(kOldsubject)); + if (!flags.z()) goto diffsub3; - context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 221); + if (flags.z()) goto alreadyselob; - context.data.byte(kCommandtype) = 221; + data.byte(kCommandtype) = 221; diffsub3: - context.data.word(kOldsubject) = context.ax; - context.bx = context.ax; - context.al = 0; - commandwithob(context); + data.word(kOldsubject) = ax; + bx = ax; + al = 0; + commandwithob(); alreadyselob: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notselob) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doselob; return; doselob: - delpointer(context); - context.data.byte(kInvopen) = 0; - useroutine(context); -} - -void compare(Context &context) { - STACK_CHECK(context); - context._sub(context.dl, 'A'); - context._sub(context.dh, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.push(context.cx); - context.push(context.dx); - getanyaddir(context); - context.dx = context.pop(); - context.cx = context.pop(); - context._cmp(context.es.word(context.bx+12), context.cx); - if (!context.flags.z()) + delpointer(); + data.byte(kInvopen) = 0; + useroutine(); +} + +void DreamGenContext::compare() { + STACK_CHECK; + _sub(dl, 'A'); + _sub(dh, 'A'); + _sub(cl, 'A'); + _sub(ch, 'A'); + push(cx); + push(dx); + getanyaddir(); + dx = pop(); + cx = pop(); + _cmp(es.word(bx+12), cx); + if (!flags.z()) return /* (comparefin) */; - context._cmp(context.es.word(context.bx+14), context.dx); -} - -void findsetobject(Context &context) { - STACK_CHECK(context); - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(kSetdat); - context.bx = 0; - context.dl = 0; + _cmp(es.word(bx+14), dx); +} + +void DreamGenContext::findsetobject() { + STACK_CHECK; + _sub(al, 'A'); + _sub(ah, 'A'); + _sub(cl, 'A'); + _sub(ch, 'A'); + es = data.word(kSetdat); + bx = 0; + dl = 0; findsetloop: - context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) + _cmp(al, es.byte(bx+12)); + if (!flags.z()) goto nofind; - context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) + _cmp(ah, es.byte(bx+13)); + if (!flags.z()) goto nofind; - context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) + _cmp(cl, es.byte(bx+14)); + if (!flags.z()) goto nofind; - context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) + _cmp(ch, es.byte(bx+15)); + if (!flags.z()) goto nofind; - context.al = context.dl; + al = dl; return; nofind: - context._add(context.bx, 64); - context._inc(context.dl); - context._cmp(context.dl, 128); - if (!context.flags.z()) + _add(bx, 64); + _inc(dl); + _cmp(dl, 128); + if (!flags.z()) goto findsetloop; - context.al = context.dl; -} - -void findexobject(Context &context) { - STACK_CHECK(context); - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(kExtras); - context.bx = (0+2080+30000); - context.dl = 0; + al = dl; +} + +void DreamGenContext::findexobject() { + STACK_CHECK; + _sub(al, 'A'); + _sub(ah, 'A'); + _sub(cl, 'A'); + _sub(ch, 'A'); + es = data.word(kExtras); + bx = (0+2080+30000); + dl = 0; findexloop: - context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) + _cmp(al, es.byte(bx+12)); + if (!flags.z()) goto nofindex; - context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) + _cmp(ah, es.byte(bx+13)); + if (!flags.z()) goto nofindex; - context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) + _cmp(cl, es.byte(bx+14)); + if (!flags.z()) goto nofindex; - context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) + _cmp(ch, es.byte(bx+15)); + if (!flags.z()) goto nofindex; - context.al = context.dl; + al = dl; return; nofindex: - context._add(context.bx, 16); - context._inc(context.dl); - context._cmp(context.dl, (114)); - if (!context.flags.z()) + _add(bx, 16); + _inc(dl); + _cmp(dl, (114)); + if (!flags.z()) goto findexloop; - context.al = context.dl; -} - -void isryanholding(Context &context) { - STACK_CHECK(context); - context._sub(context.al, 'A'); - context._sub(context.ah, 'A'); - context._sub(context.cl, 'A'); - context._sub(context.ch, 'A'); - context.es = context.data.word(kExtras); - context.bx = (0+2080+30000); - context.dl = 0; + al = dl; +} + +void DreamGenContext::isryanholding() { + STACK_CHECK; + _sub(al, 'A'); + _sub(ah, 'A'); + _sub(cl, 'A'); + _sub(ch, 'A'); + es = data.word(kExtras); + bx = (0+2080+30000); + dl = 0; searchinv: - context._cmp(context.es.byte(context.bx+2), 4); - if (!context.flags.z()) + _cmp(es.byte(bx+2), 4); + if (!flags.z()) goto nofindininv; - context._cmp(context.al, context.es.byte(context.bx+12)); - if (!context.flags.z()) + _cmp(al, es.byte(bx+12)); + if (!flags.z()) goto nofindininv; - context._cmp(context.ah, context.es.byte(context.bx+13)); - if (!context.flags.z()) + _cmp(ah, es.byte(bx+13)); + if (!flags.z()) goto nofindininv; - context._cmp(context.cl, context.es.byte(context.bx+14)); - if (!context.flags.z()) + _cmp(cl, es.byte(bx+14)); + if (!flags.z()) goto nofindininv; - context._cmp(context.ch, context.es.byte(context.bx+15)); - if (!context.flags.z()) + _cmp(ch, es.byte(bx+15)); + if (!flags.z()) goto nofindininv; - context.al = context.dl; - context._cmp(context.al, (114)); + al = dl; + _cmp(al, (114)); return; nofindininv: - context._add(context.bx, 16); - context._inc(context.dl); - context._cmp(context.dl, (114)); - if (!context.flags.z()) + _add(bx, 16); + _inc(dl); + _cmp(dl, (114)); + if (!flags.z()) goto searchinv; - context.al = context.dl; - context._cmp(context.al, (114)); + al = dl; + _cmp(al, (114)); } -void checkinside(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kExtras); - context.bx = (0+2080+30000); - context.cl = 0; +void DreamGenContext::checkinside() { + STACK_CHECK; + es = data.word(kExtras); + bx = (0+2080+30000); + cl = 0; insideloop: - context._cmp(context.al, context.es.byte(context.bx+3)); - if (!context.flags.z()) + _cmp(al, es.byte(bx+3)); + if (!flags.z()) goto notfoundinside; - context._cmp(context.ah, context.es.byte(context.bx+2)); - if (!context.flags.z()) + _cmp(ah, es.byte(bx+2)); + if (!flags.z()) goto notfoundinside; return; notfoundinside: - context._add(context.bx, 16); - context._inc(context.cl); - context._cmp(context.cl, (114)); - if (!context.flags.z()) + _add(bx, 16); + _inc(cl); + _cmp(cl, (114)); + if (!flags.z()) goto insideloop; } -void usetext(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 104; - context.dl = 241; - context.al = 0; - context.ah = 0; - printdirect(context); - worktoscreenm(context); -} - -void putbackobstuff(Context &context) { - STACK_CHECK(context); - createpanel(context); - showpanel(context); - showman(context); - obicons(context); - showexit(context); - obpicture(context); - describeob(context); - undertextline(context); - context.data.byte(kCommandtype) = 255; - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void showpuztext(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - findpuztext(context); - context.push(context.es); - context.push(context.si); - createpanel(context); - showpanel(context); - showman(context); - showexit(context); - obicons(context); - context.si = context.pop(); - context.es = context.pop(); - context.di = 36; - context.bx = 104; - context.dl = 241; - context.ah = 0; - printdirect(context); - worktoscreenm(context); - context.cx = context.pop(); - hangonp(context); -} - -void findpuztext(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.si = context.ax; - context._add(context.si, context.si); - context.es = context.data.word(kPuzzletext); - context.ax = context.es.word(context.si); - context._add(context.ax, (66*2)); - context.si = context.ax; -} - -void placesetobject(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.cl = 0; - context.ch = 0; - findormake(context); - getsetad(context); - context.es.byte(context.bx+58) = 0; - context.bx = context.pop(); - context.es = context.pop(); -} - -void removesetobject(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.cl = 255; - context.ch = 0; - findormake(context); - getsetad(context); - context.es.byte(context.bx+58) = 255; - context.bx = context.pop(); - context.es = context.pop(); -} - -void issetobonmap(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - getsetad(context); - context.al = context.es.byte(context.bx+58); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.al, 0); -} - -void placefreeobject(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - context.cl = 0; - context.ch = 1; - findormake(context); - getfreead(context); - context.es.byte(context.bx+2) = 0; - context.bx = context.pop(); - context.es = context.pop(); -} - -void removefreeobject(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.bx); - getfreead(context); - context.es.byte(context.bx+2) = 255; - context.bx = context.pop(); - context.es = context.pop(); -} - -void findormake(Context &context) { - STACK_CHECK(context); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - context.push(context.ax); - context.es = context.data.word(kBuffers); - context.ah = context.data.byte(kReallocation); +void DreamGenContext::usetext() { + STACK_CHECK; + push(es); + push(si); + createpanel(); + showpanel(); + showman(); + showexit(); + obicons(); + si = pop(); + es = pop(); + di = 36; + bx = 104; + dl = 241; + al = 0; + ah = 0; + printdirect(); + worktoscreenm(); +} + +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() { + STACK_CHECK; + ah = 0; + si = ax; + _add(si, si); + es = data.word(kPuzzletext); + ax = es.word(si); + _add(ax, (66*2)); + si = ax; +} + +void DreamGenContext::placesetobject() { + STACK_CHECK; + push(es); + push(bx); + cl = 0; + ch = 0; + findormake(); + getsetad(); + es.byte(bx+58) = 0; + bx = pop(); + es = pop(); +} + +void DreamGenContext::removesetobject() { + STACK_CHECK; + push(es); + push(bx); + cl = 255; + ch = 0; + findormake(); + getsetad(); + es.byte(bx+58) = 255; + bx = pop(); + es = pop(); +} + +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() { + 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(); + es.byte(bx+2) = 255; + bx = pop(); + es = pop(); +} + +void DreamGenContext::findormake() { + STACK_CHECK; + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + push(ax); + es = data.word(kBuffers); + ah = data.byte(kReallocation); changeloop: - context._cmp(context.es.byte(context.bx), 255); - if (context.flags.z()) + _cmp(es.byte(bx), 255); + if (flags.z()) goto haventfound; - context._cmp(context.ax, context.es.word(context.bx)); - if (!context.flags.z()) + _cmp(ax, es.word(bx)); + if (!flags.z()) goto nofoundchange; - context._cmp(context.ch, context.es.byte(context.bx+3)); - if (context.flags.z()) + _cmp(ch, es.byte(bx+3)); + if (flags.z()) goto foundchange; nofoundchange: - context._add(context.bx, 4); + _add(bx, 4); goto changeloop; foundchange: - context.ax = context.pop(); - context.es.byte(context.bx+2) = context.cl; + ax = pop(); + es.byte(bx+2) = cl; return; haventfound: - context.es.word(context.bx) = context.ax; - context.es.word(context.bx+2) = context.cx; - context.ax = context.pop(); + es.word(bx) = ax; + es.word(bx+2) = cx; + ax = pop(); } -void switchryanon(Context &context) { - STACK_CHECK(context); - context.data.byte(kRyanon) = 255; +void DreamGenContext::switchryanon() { + STACK_CHECK; + data.byte(kRyanon) = 255; } -void switchryanoff(Context &context) { - STACK_CHECK(context); - context.data.byte(kRyanon) = 1; +void DreamGenContext::switchryanoff() { + STACK_CHECK; + data.byte(kRyanon) = 1; } -void setallchanges(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); +void DreamGenContext::setallchanges() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); setallloop: - context.ax = context.es.word(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + ax = es.word(bx); + _cmp(al, 255); + if (flags.z()) return /* (endsetloop) */; - context.cx = context.es.word(context.bx+2); - context._add(context.bx, 4); - context._cmp(context.ah, context.data.byte(kReallocation)); - if (!context.flags.z()) + cx = es.word(bx+2); + _add(bx, 4); + _cmp(ah, data.byte(kReallocation)); + if (!flags.z()) goto setallloop; - context.push(context.es); - context.push(context.bx); - dochange(context); - context.bx = context.pop(); - context.es = context.pop(); + push(es); + push(bx); + dochange(); + bx = pop(); + es = pop(); goto setallloop; } -void dochange(Context &context) { - STACK_CHECK(context); - context._cmp(context.ch, 0); - if (context.flags.z()) +void DreamGenContext::dochange() { + STACK_CHECK; + _cmp(ch, 0); + if (flags.z()) goto object; - context._cmp(context.ch, 1); - if (context.flags.z()) + _cmp(ch, 1); + if (flags.z()) goto freeobject; - context.push(context.cx); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context.push(context.ax); - context.al = context.ch; - context._sub(context.al, 100); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.bx = context.pop(); - context._add(context.bx, context.ax); - context._add(context.bx, (0)); - context.es = context.data.word(kReels); - context.cx = context.pop(); - context.es.byte(context.bx+6) = context.cl; + push(cx); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + push(ax); + al = ch; + _sub(al, 100); + ah = 0; + cx = 144; + _mul(cx); + bx = pop(); + _add(bx, ax); + _add(bx, (0)); + es = data.word(kReels); + cx = pop(); + es.byte(bx+6) = cl; return; object: - context.push(context.cx); - getsetad(context); - context.cx = context.pop(); - context.es.byte(context.bx+58) = context.cl; + push(cx); + getsetad(); + cx = pop(); + es.byte(bx+58) = cl; return; freeobject: - context.push(context.cx); - getfreead(context); - context.cx = context.pop(); - context._cmp(context.es.byte(context.bx+2), 255); - if (!context.flags.z()) + push(cx); + getfreead(); + cx = pop(); + _cmp(es.byte(bx+2), 255); + if (!flags.z()) return /* (beenpickedup) */; - context.es.byte(context.bx+2) = context.cl; + es.byte(bx+2) = cl; } -void autoappear(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 32); - if (!context.flags.z()) +void DreamGenContext::autoappear() { + STACK_CHECK; + _cmp(data.byte(kLocation), 32); + if (!flags.z()) goto notinalley; - context.al = 5; - resetlocation(context); - context.al = 10; - setlocation(context); - context.data.byte(kDestpos) = 10; + al = 5; + resetlocation(); + al = 10; + setlocation(); + data.byte(kDestpos) = 10; return; notinalley: - context._cmp(context.data.byte(kReallocation), 24); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 24); + if (!flags.z()) goto notinedens; - context._cmp(context.data.byte(kGeneraldead), 1); - if (!context.flags.z()) + _cmp(data.byte(kGeneraldead), 1); + if (!flags.z()) goto edenspart2; - context._inc(context.data.byte(kGeneraldead)); - context.al = 44; - placesetobject(context); - context.al = 18; - placesetobject(context); - context.al = 93; - placesetobject(context); - context.al = 92; - removesetobject(context); - context.al = 55; - removesetobject(context); - context.al = 75; - removesetobject(context); - context.al = 84; - removesetobject(context); - context.al = 85; - removesetobject(context); + _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: - context._cmp(context.data.byte(kSartaindead), 1); - if (!context.flags.z()) + _cmp(data.byte(kSartaindead), 1); + if (!flags.z()) return /* (notedens2) */; - context.al = 44; - removesetobject(context); - context.al = 93; - removesetobject(context); - context.al = 55; - placesetobject(context); - context._inc(context.data.byte(kSartaindead)); + al = 44; + removesetobject(); + al = 93; + removesetobject(); + al = 55; + placesetobject(); + _inc(data.byte(kSartaindead)); return; notinedens: - context._cmp(context.data.byte(kReallocation), 25); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 25); + if (!flags.z()) goto notonsartroof; - context.data.byte(kNewsitem) = 3; - context.al = 6; - resetlocation(context); - context.al = 11; - setlocation(context); - context.data.byte(kDestpos) = 11; + data.byte(kNewsitem) = 3; + al = 6; + resetlocation(); + al = 11; + setlocation(); + data.byte(kDestpos) = 11; return; notonsartroof: - context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 2); + if (!flags.z()) return /* (notinlouiss) */; - context._cmp(context.data.byte(kRockstardead), 0); - if (context.flags.z()) + _cmp(data.byte(kRockstardead), 0); + if (flags.z()) return /* (notinlouiss) */; - context.al = 23; - placesetobject(context); -} - -void getundertimed(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kTimedy); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(kTimedx); - context.ah = 0; - context.di = context.ax; - context.ch = (24); - context.cl = 240; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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(context); -} - -void putundertimed(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kTimedy); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(kTimedx); - context.ah = 0; - context.di = context.ax; - context.ch = (24); - context.cl = 240; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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(context); -} - -void dumptimedtext(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNeedtodumptimed), 1); - if (!context.flags.z()) + al = 23; + placesetobject(); +} + +void DreamGenContext::getundertimed() { + STACK_CHECK; + al = data.byte(kTimedy); + ah = 0; + bx = ax; + al = data.byte(kTimedx); + ah = 0; + di = ax; + ch = (24); + cl = 240; + ds = data.word(kBuffers); + si = (0+(180*10)+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::putundertimed() { + STACK_CHECK; + al = data.byte(kTimedy); + ah = 0; + bx = ax; + al = data.byte(kTimedx); + ah = 0; + di = ax; + ch = (24); + cl = 240; + ds = data.word(kBuffers); + si = (0+(180*10)+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::dumptimedtext() { + STACK_CHECK; + _cmp(data.byte(kNeedtodumptimed), 1); + if (!flags.z()) return /* (nodumptimed) */; - context.al = context.data.byte(kTimedy); - context.ah = 0; - context.bx = context.ax; - context.al = context.data.byte(kTimedx); - context.ah = 0; - context.di = context.ax; - context.cl = 240; - context.ch = (24); - multidump(context); - context.data.byte(kNeedtodumptimed) = 0; -} - -void setuptimeduse(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kTimecount), 0); - if (!context.flags.z()) + al = data.byte(kTimedy); + ah = 0; + bx = ax; + al = data.byte(kTimedx); + ah = 0; + di = ax; + cl = 240; + ch = (24); + multidump(); + data.byte(kNeedtodumptimed) = 0; +} + +void DreamGenContext::setuptimeduse() { + STACK_CHECK; + _cmp(data.word(kTimecount), 0); + if (!flags.z()) return /* (cantsetup) */; - context.data.byte(kTimedy) = context.bh; - context.data.byte(kTimedx) = context.bl; - context.data.word(kCounttotimed) = context.cx; - context._add(context.dx, context.cx); - context.data.word(kTimecount) = context.dx; - context.bl = context.al; - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kPuzzletext); - context.cx = (66*2); - context.ax = context.es.word(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.data.word(kTimedseg) = context.es; - context.data.word(kTimedoffset) = context.bx; -} - -void setuptimedtemp(Context &context) { - STACK_CHECK(context); - context._cmp(context.ah, 0); - if (context.flags.z()) + data.byte(kTimedy) = bh; + data.byte(kTimedx) = bl; + data.word(kCounttotimed) = cx; + _add(dx, cx); + data.word(kTimecount) = dx; + bl = al; + bh = 0; + _add(bx, bx); + es = data.word(kPuzzletext); + cx = (66*2); + ax = es.word(bx); + _add(ax, cx); + bx = ax; + data.word(kTimedseg) = es; + data.word(kTimedoffset) = bx; +} + +void DreamGenContext::setuptimedtemp() { + STACK_CHECK; + _cmp(ah, 0); + if (flags.z()) goto notloadspeech3; - context.dl = 'T'; - context.dh = context.ah; - context.cl = 'T'; - context.ah = 0; - loadspeech(context); - context._cmp(context.data.byte(kSpeechloaded), 1); - if (!context.flags.z()) + dl = 'T'; + dh = ah; + cl = 'T'; + ah = 0; + loadspeech(); + _cmp(data.byte(kSpeechloaded), 1); + if (!flags.z()) goto notloadspeech3; - context.al = 50+12; - playchannel1(context); + al = 50+12; + playchannel1(); return; notloadspeech3: - context._cmp(context.data.word(kTimecount), 0); - if (!context.flags.z()) + _cmp(data.word(kTimecount), 0); + if (!flags.z()) return /* (cantsetup2) */; - context.data.byte(kTimedy) = context.bh; - context.data.byte(kTimedx) = context.bl; - context.data.word(kCounttotimed) = context.cx; - context._add(context.dx, context.cx); - context.data.word(kTimecount) = context.dx; - context.bl = context.al; - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kTextfile1); - context.cx = (66*2); - context.ax = context.es.word(context.bx); - context._add(context.ax, context.cx); - context.bx = context.ax; - context.data.word(kTimedseg) = context.es; - context.data.word(kTimedoffset) = context.bx; -} - -void usetimedtext(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kTimecount), 0); - if (context.flags.z()) + data.byte(kTimedy) = bh; + data.byte(kTimedx) = bl; + data.word(kCounttotimed) = cx; + _add(dx, cx); + data.word(kTimecount) = dx; + bl = al; + bh = 0; + _add(bx, bx); + es = data.word(kTextfile1); + cx = (66*2); + ax = es.word(bx); + _add(ax, cx); + bx = ax; + data.word(kTimedseg) = es; + data.word(kTimedoffset) = bx; +} + +void DreamGenContext::usetimedtext() { + STACK_CHECK; + _cmp(data.word(kTimecount), 0); + if (flags.z()) return /* (notext) */; - context._dec(context.data.word(kTimecount)); - context._cmp(context.data.word(kTimecount), 0); - if (context.flags.z()) + _dec(data.word(kTimecount)); + _cmp(data.word(kTimecount), 0); + if (flags.z()) goto deltimedtext; - context.ax = context.data.word(kTimecount); - context._cmp(context.ax, context.data.word(kCounttotimed)); - if (context.flags.z()) + ax = data.word(kTimecount); + _cmp(ax, data.word(kCounttotimed)); + if (flags.z()) goto firsttimed; - if (!context.flags.c()) + if (!flags.c()) return /* (notext) */; goto notfirsttimed; firsttimed: - getundertimed(context); + getundertimed(); notfirsttimed: - context.bl = context.data.byte(kTimedy); - context.bh = 0; - context.al = context.data.byte(kTimedx); - context.ah = 0; - context.di = context.ax; - context.es = context.data.word(kTimedseg); - context.si = context.data.word(kTimedoffset); - context.dl = 237; - context.ah = 0; - printdirect(context); - context.data.byte(kNeedtodumptimed) = 1; + bl = data.byte(kTimedy); + bh = 0; + al = data.byte(kTimedx); + ah = 0; + di = ax; + es = data.word(kTimedseg); + si = data.word(kTimedoffset); + dl = 237; + ah = 0; + printdirect(); + data.byte(kNeedtodumptimed) = 1; return; deltimedtext: - putundertimed(context); - context.data.byte(kNeedtodumptimed) = 1; -} - -void edenscdplayer(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context.data.word(kWatchingtime) = 18*2; - context.data.word(kReeltowatch) = 25; - context.data.word(kEndwatchreel) = 42; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; -} - -void usewall(Context &context) { - STACK_CHECK(context); - showfirstuse(context); - context._cmp(context.data.byte(kManspath), 3); - if (context.flags.z()) + putundertimed(); + data.byte(kNeedtodumptimed) = 1; +} + +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; - context.data.word(kWatchingtime) = 30*2; - context.data.word(kReeltowatch) = 2; - context.data.word(kEndwatchreel) = 31; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context.al = 3; - turnpathon(context); - context.al = 4; - turnpathon(context); - context.al = 0; - turnpathoff(context); - context.al = 1; - turnpathoff(context); - context.al = 2; - turnpathoff(context); - context.al = 5; - turnpathoff(context); - context.data.byte(kManspath) = 3; - context.data.byte(kFinaldest) = 3; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - switchryanoff(context); + 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: - context.data.word(kWatchingtime) = 30*2; - context.data.word(kReeltowatch) = 34; - context.data.word(kEndwatchreel) = 60; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context.al = 3; - turnpathoff(context); - context.al = 4; - turnpathoff(context); - context.al = 0; - turnpathon(context); - context.al = 1; - turnpathon(context); - context.al = 2; - turnpathon(context); - context.al = 5; - turnpathon(context); - context.data.byte(kManspath) = 5; - context.data.byte(kFinaldest) = 5; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; - switchryanoff(context); -} - -void usechurchgate(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) + 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(context); + withwhat(); return; gatewith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'C'; - context.ch = 'U'; - context.dl = 'T'; - context.dh = 'T'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'C'; + ch = 'U'; + dl = 'T'; + dh = 'T'; + compare(); + if (flags.z()) goto cutgate; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; cutgate: - showfirstuse(context); - context.data.word(kWatchingtime) = 64*2; - context.data.word(kReeltowatch) = 4; - context.data.word(kEndwatchreel) = 70; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); - context.al = 3; - turnpathon(context); - context._cmp(context.data.byte(kAidedead), 0); - if (context.flags.z()) + 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) */; - context.al = 2; - turnpathon(context); + al = 2; + turnpathon(); } -void usegun(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) +void DreamGenContext::usegun() { + STACK_CHECK; + _cmp(data.byte(kObjecttype), 4); + if (flags.z()) goto istakengun; - showseconduse(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); return; istakengun: - context._cmp(context.data.byte(kReallocation), 22); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 22); + if (!flags.z()) goto notinpoolroom; - context.cx = 300; - context.al = 34; - showpuztext(context); - context.data.byte(kLastweapon) = 1; - context.data.byte(kCombatcount) = 39; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); + cx = 300; + al = 34; + showpuztext(); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 39; + data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); return; notinpoolroom: - context._cmp(context.data.byte(kReallocation), 25); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 25); + if (!flags.z()) goto nothelicopter; - context.cx = 300; - context.al = 34; - showpuztext(context); - context.data.byte(kLastweapon) = 1; - context.data.byte(kCombatcount) = 19; - context.data.byte(kGetback) = 1; - context.data.byte(kDreamnumber) = 2; - context.data.byte(kRoomafterdream) = 38; - context.data.byte(kSartaindead) = 1; - context._inc(context.data.byte(kProgresspoints)); + cx = 300; + al = 34; + showpuztext(); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 19; + data.byte(kGetback) = 1; + data.byte(kDreamnumber) = 2; + data.byte(kRoomafterdream) = 38; + data.byte(kSartaindead) = 1; + _inc(data.byte(kProgresspoints)); return; nothelicopter: - context._cmp(context.data.byte(kReallocation), 27); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 27); + if (!flags.z()) goto notinrockroom; - context.cx = 300; - context.al = 46; - showpuztext(context); - context.data.byte(kPointermode) = 2; - context.data.byte(kRockstardead) = 1; - context.data.byte(kLastweapon) = 1; - context.data.byte(kNewsitem) = 1; - context.data.byte(kGetback) = 1; - context.data.byte(kRoomafterdream) = 32; - context.data.byte(kDreamnumber) = 0; - context._inc(context.data.byte(kProgresspoints)); + cx = 300; + al = 46; + showpuztext(); + data.byte(kPointermode) = 2; + data.byte(kRockstardead) = 1; + data.byte(kLastweapon) = 1; + data.byte(kNewsitem) = 1; + data.byte(kGetback) = 1; + data.byte(kRoomafterdream) = 32; + data.byte(kDreamnumber) = 0; + _inc(data.byte(kProgresspoints)); return; notinrockroom: - context._cmp(context.data.byte(kReallocation), 8); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 8); + if (!flags.z()) goto notbystudio; - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (!flags.z()) goto notbystudio; - context._cmp(context.data.byte(kMapy), 40); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 40); + if (!flags.z()) goto notbystudio; - context.al = 92; - issetobonmap(context); - if (context.flags.z()) + al = 92; + issetobonmap(); + if (flags.z()) goto notbystudio; - context._cmp(context.data.byte(kManspath), 9); - if (context.flags.z()) + _cmp(data.byte(kManspath), 9); + if (flags.z()) goto notbystudio; - context.data.byte(kDestination) = 9; - context.data.byte(kFinaldest) = 9; - autosetwalk(context); - context.data.byte(kLastweapon) = 1; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); + data.byte(kDestination) = 9; + data.byte(kFinaldest) = 9; + autosetwalk(); + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); return; notbystudio: - context._cmp(context.data.byte(kReallocation), 6); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 6); + if (!flags.z()) goto notsarters; - context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 11); + if (!flags.z()) goto notsarters; - context._cmp(context.data.byte(kMapy), 20); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 20); + if (!flags.z()) goto notsarters; - context.al = 5; - issetobonmap(context); - if (!context.flags.z()) + al = 5; + issetobonmap(); + if (!flags.z()) goto notsarters; - context.data.byte(kDestination) = 1; - context.data.byte(kFinaldest) = 1; - autosetwalk(context); - context.al = 5; - removesetobject(context); - context.al = 6; - placesetobject(context); - context.al = 1; - context.ah = context.data.byte(kRoomnum); - context._dec(context.ah); - turnanypathon(context); - context.data.byte(kLiftflag) = 1; - context.data.word(kWatchingtime) = 40*2; - context.data.word(kReeltowatch) = 4; - context.data.word(kEndwatchreel) = 43; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autosetwalk(); + al = 5; + removesetobject(); + al = 6; + placesetobject(); + al = 1; + ah = data.byte(kRoomnum); + _dec(ah); + turnanypathon(); + data.byte(kLiftflag) = 1; + data.word(kWatchingtime) = 40*2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 43; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); return; notsarters: - context._cmp(context.data.byte(kReallocation), 29); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 29); + if (!flags.z()) goto notaide; - context.data.byte(kGetback) = 1; - context.al = 13; - resetlocation(context); - context.al = 12; - setlocation(context); - context.data.byte(kDestpos) = 12; - context.data.byte(kDestination) = 2; - context.data.byte(kFinaldest) = 2; - autosetwalk(context); - context.data.word(kWatchingtime) = 164*2; - context.data.word(kReeltowatch) = 3; - context.data.word(kEndwatchreel) = 164; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kAidedead) = 1; - context.data.byte(kDreamnumber) = 3; - context.data.byte(kRoomafterdream) = 33; - context._inc(context.data.byte(kProgresspoints)); + data.byte(kGetback) = 1; + al = 13; + resetlocation(); + al = 12; + setlocation(); + data.byte(kDestpos) = 12; + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autosetwalk(); + data.word(kWatchingtime) = 164*2; + data.word(kReeltowatch) = 3; + data.word(kEndwatchreel) = 164; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kAidedead) = 1; + data.byte(kDreamnumber) = 3; + data.byte(kRoomafterdream) = 33; + _inc(data.byte(kProgresspoints)); return; notaide: - context._cmp(context.data.byte(kReallocation), 23); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 23); + if (!flags.z()) goto notwithboss; - context._cmp(context.data.byte(kMapx), 0); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 0); + if (!flags.z()) goto notwithboss; - context._cmp(context.data.byte(kMapy), 50); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 50); + if (!flags.z()) goto notwithboss; - context._cmp(context.data.byte(kManspath), 5); - if (context.flags.z()) + _cmp(data.byte(kManspath), 5); + if (flags.z()) goto pathokboss; - context.data.byte(kDestination) = 5; - context.data.byte(kFinaldest) = 5; - autosetwalk(context); + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autosetwalk(); pathokboss: - context.data.byte(kLastweapon) = 1; - context.data.byte(kGetback) = 1; + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; return; notwithboss: - context._cmp(context.data.byte(kReallocation), 8); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 8); + if (!flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 11); + if (!flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 10); + if (!flags.z()) goto nottvsoldier; - context._cmp(context.data.byte(kManspath), 2); - if (context.flags.z()) + _cmp(data.byte(kManspath), 2); + if (flags.z()) goto pathoktv; - context.data.byte(kDestination) = 2; - context.data.byte(kFinaldest) = 2; - autosetwalk(context); + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autosetwalk(); pathoktv: - context.data.byte(kLastweapon) = 1; - context.data.byte(kGetback) = 1; + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; return; nottvsoldier: - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); } -void useshield(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 20); - if (!context.flags.z()) +void DreamGenContext::useshield() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 20); + if (!flags.z()) goto notinsartroom; - context._cmp(context.data.byte(kCombatcount), 0); - if (context.flags.z()) + _cmp(data.byte(kCombatcount), 0); + if (flags.z()) goto notinsartroom; - context.data.byte(kLastweapon) = 3; - showseconduse(context); - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); - removeobfrominv(context); + data.byte(kLastweapon) = 3; + showseconduse(); + data.byte(kGetback) = 1; + _inc(data.byte(kProgresspoints)); + removeobfrominv(); return; notinsartroom: - showfirstuse(context); - putbackobstuff(context); + showfirstuse(); + putbackobstuff(); } -void usebuttona(Context &context) { - STACK_CHECK(context); - context.al = 95; - issetobonmap(context); - if (context.flags.z()) +void DreamGenContext::usebuttona() { + STACK_CHECK; + al = 95; + issetobonmap(); + if (flags.z()) goto donethisbit; - showfirstuse(context); - context.al = 0; - context.ah = context.data.byte(kRoomnum); - context._dec(context.ah); - turnanypathon(context); - context.al = 9; - removesetobject(context); - context.al = 95; - placesetobject(context); - context.data.word(kWatchingtime) = 15*2; - context.data.word(kReeltowatch) = 71; - context.data.word(kEndwatchreel) = 85; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); + 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(context); - putbackobstuff(context); + showseconduse(); + putbackobstuff(); } -void useplate(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWithobject), 255); - if (!context.flags.z()) +void DreamGenContext::useplate() { + STACK_CHECK; + _cmp(data.byte(kWithobject), 255); + if (!flags.z()) goto platewith; - withwhat(context); + withwhat(); return; platewith: - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'S'; - context.ch = 'C'; - context.dl = 'R'; - context.dh = 'W'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'S'; + ch = 'C'; + dl = 'R'; + dh = 'W'; + compare(); + if (flags.z()) goto unscrewplate; - context.al = context.data.byte(kWithobject); - context.ah = context.data.byte(kWithtype); - context.cl = 'K'; - context.ch = 'N'; - context.dl = 'F'; - context.dh = 'E'; - compare(context); - if (context.flags.z()) + al = data.byte(kWithobject); + ah = data.byte(kWithtype); + cl = 'K'; + ch = 'N'; + dl = 'F'; + dh = 'E'; + compare(); + if (flags.z()) goto triedknife; - context.cx = 300; - context.al = 14; - showpuztext(context); - putbackobstuff(context); + cx = 300; + al = 14; + showpuztext(); + putbackobstuff(); return; unscrewplate: - context.al = 20; - playchannel1(context); - showfirstuse(context); - context.al = 28; - placesetobject(context); - context.al = 24; - placesetobject(context); - context.al = 25; - removesetobject(context); - context.al = 0; - placefreeobject(context); - context._inc(context.data.byte(kProgresspoints)); - context.data.byte(kGetback) = 1; + 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: - context.cx = 300; - context.al = 54; - showpuztext(context); - putbackobstuff(context); -} - -void usewinch(Context &context) { - STACK_CHECK(context); - context.al = 40; - context.ah = 1; - checkinside(context); - context._cmp(context.cl, (114)); - if (context.flags.z()) + cx = 300; + al = 54; + showpuztext(); + putbackobstuff(); +} + +void DreamGenContext::usewinch() { + STACK_CHECK; + al = 40; + ah = 1; + checkinside(); + _cmp(cl, (114)); + if (flags.z()) goto nowinch; - context.al = context.cl; - context.ah = 4; - context.cl = 'F'; - context.ch = 'U'; - context.dl = 'S'; - context.dh = 'E'; - compare(context); - if (!context.flags.z()) + al = cl; + ah = 4; + cl = 'F'; + ch = 'U'; + dl = 'S'; + dh = 'E'; + compare(); + if (!flags.z()) goto nowinch; - context.data.word(kWatchingtime) = 217*2; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 217; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - context.data.byte(kDestpos) = 1; - context.data.byte(kNewlocation) = 45; - context.data.byte(kDreamnumber) = 1; - context.data.byte(kRoomafterdream) = 44; - context.data.byte(kGeneraldead) = 1; - context.data.byte(kNewsitem) = 2; - context.data.byte(kGetback) = 1; - context._inc(context.data.byte(kProgresspoints)); + 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(context); - putbackobstuff(context); -} - -void entercode(Context &context) { - STACK_CHECK(context); - context.data.word(kKeypadax) = context.ax; - context.data.word(kKeypadcx) = context.cx; - getridofreels(context); - loadkeypad(context); - createpanel(context); - showicon(context); - showouterpad(context); - showkeypad(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.word(kPresspointer) = 0; - context.data.byte(kGetback) = 0; + 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: - delpointer(context); - readmouse(context); - showkeypad(context); - showpointer(context); - context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showkeypad(); + showpointer(); + _cmp(data.byte(kPresscount), 0); + if (flags.z()) goto nopresses; - context._dec(context.data.byte(kPresscount)); + _dec(data.byte(kPresscount)); goto afterpress; nopresses: - context.data.byte(kPressed) = 255; - context.data.byte(kGraphicpress) = 255; - vsync(context); + data.byte(kPressed) = 255; + data.byte(kGraphicpress) = 255; + vsync(); afterpress: - dumppointer(context); - dumpkeypad(context); - dumptextline(context); - context.bx = 3482; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 1); - if (context.flags.z()) + dumppointer(); + dumpkeypad(); + dumptextline(); + bx = 3482; + checkcoords(); + _cmp(data.byte(kGetback), 1); + if (flags.z()) goto numberright; - context._cmp(context.data.byte(kLightcount), 1); - if (!context.flags.z()) + _cmp(data.byte(kLightcount), 1); + if (!flags.z()) goto notendkey; - context._cmp(context.data.byte(kLockstatus), 0); - if (context.flags.z()) + _cmp(data.byte(kLockstatus), 0); + if (flags.z()) goto numberright; goto keypadloop; notendkey: - context._cmp(context.data.byte(kPresscount), 40); - if (!context.flags.z()) + _cmp(data.byte(kPresscount), 40); + if (!flags.z()) goto keypadloop; - addtopresslist(context); - context._cmp(context.data.byte(kPressed), 11); - if (!context.flags.z()) + addtopresslist(); + _cmp(data.byte(kPressed), 11); + if (!flags.z()) goto keypadloop; - context.ax = context.data.word(kKeypadax); - context.cx = context.data.word(kKeypadcx); - isitright(context); - if (!context.flags.z()) + ax = data.word(kKeypadax); + cx = data.word(kKeypadcx); + isitright(); + if (!flags.z()) goto incorrect; - context.data.byte(kLockstatus) = 0; - context.al = 11; - playchannel1(context); - context.data.byte(kLightcount) = 120; - context.data.word(kPresspointer) = 0; + data.byte(kLockstatus) = 0; + al = 11; + playchannel1(); + data.byte(kLightcount) = 120; + data.word(kPresspointer) = 0; goto keypadloop; incorrect: - context.al = 11; - playchannel1(context); - context.data.byte(kLightcount) = 120; - context.data.word(kPresspointer) = 0; + al = 11; + playchannel1(); + data.byte(kLightcount) = 120; + data.word(kPresspointer) = 0; goto keypadloop; numberright: - context.data.byte(kManisoffscreen) = 0; - getridoftemp(context); - restorereels(context); - redrawmainscrn(context); - worktoscreenm(context); + data.byte(kManisoffscreen) = 0; + getridoftemp(); + restorereels(); + redrawmainscrn(); + worktoscreenm(); } -void loadkeypad(Context &context) { - STACK_CHECK(context); - context.dx = 1948; - loadintotemp(context); +void DreamGenContext::loadkeypad() { + STACK_CHECK; + dx = 1948; + loadintotemp(); } -void quitkey(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) +void DreamGenContext::quitkey() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 222); + if (flags.z()) goto alreadyqk; - context.data.byte(kCommandtype) = 222; - context.al = 4; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 4; + commandonly(); alreadyqk: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notqk) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doqk; return; doqk: - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; } -void addtopresslist(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kPresspointer), 5); - if (context.flags.z()) +void DreamGenContext::addtopresslist() { + STACK_CHECK; + _cmp(data.word(kPresspointer), 5); + if (flags.z()) return /* (nomorekeys) */; - context.al = context.data.byte(kPressed); - context._cmp(context.al, 10); - if (!context.flags.z()) + al = data.byte(kPressed); + _cmp(al, 10); + if (!flags.z()) goto not10; - context.al = 0; + al = 0; not10: - context.bx = context.data.word(kPresspointer); - context.dx = context.data; - context.es = context.dx; - context._add(context.bx, 8573); - context.es.byte(context.bx) = context.al; - context._inc(context.data.word(kPresspointer)); + bx = data.word(kPresspointer); + dx = data; + es = dx; + _add(bx, 8573); + es.byte(bx) = al; + _inc(data.word(kPresspointer)); } -void buttonone(Context &context) { - STACK_CHECK(context); - context.cl = 1; - buttonpress(context); +void DreamGenContext::buttonone() { + STACK_CHECK; + cl = 1; + buttonpress(); } -void buttontwo(Context &context) { - STACK_CHECK(context); - context.cl = 2; - buttonpress(context); +void DreamGenContext::buttontwo() { + STACK_CHECK; + cl = 2; + buttonpress(); } -void buttonthree(Context &context) { - STACK_CHECK(context); - context.cl = 3; - buttonpress(context); +void DreamGenContext::buttonthree() { + STACK_CHECK; + cl = 3; + buttonpress(); } -void buttonfour(Context &context) { - STACK_CHECK(context); - context.cl = 4; - buttonpress(context); +void DreamGenContext::buttonfour() { + STACK_CHECK; + cl = 4; + buttonpress(); } -void buttonfive(Context &context) { - STACK_CHECK(context); - context.cl = 5; - buttonpress(context); +void DreamGenContext::buttonfive() { + STACK_CHECK; + cl = 5; + buttonpress(); } -void buttonsix(Context &context) { - STACK_CHECK(context); - context.cl = 6; - buttonpress(context); +void DreamGenContext::buttonsix() { + STACK_CHECK; + cl = 6; + buttonpress(); } -void buttonseven(Context &context) { - STACK_CHECK(context); - context.cl = 7; - buttonpress(context); +void DreamGenContext::buttonseven() { + STACK_CHECK; + cl = 7; + buttonpress(); } -void buttoneight(Context &context) { - STACK_CHECK(context); - context.cl = 8; - buttonpress(context); +void DreamGenContext::buttoneight() { + STACK_CHECK; + cl = 8; + buttonpress(); } -void buttonnine(Context &context) { - STACK_CHECK(context); - context.cl = 9; - buttonpress(context); +void DreamGenContext::buttonnine() { + STACK_CHECK; + cl = 9; + buttonpress(); } -void buttonnought(Context &context) { - STACK_CHECK(context); - context.cl = 10; - buttonpress(context); +void DreamGenContext::buttonnought() { + STACK_CHECK; + cl = 10; + buttonpress(); } -void buttonenter(Context &context) { - STACK_CHECK(context); - context.cl = 11; - buttonpress(context); +void DreamGenContext::buttonenter() { + STACK_CHECK; + cl = 11; + buttonpress(); } -void buttonpress(Context &context) { - STACK_CHECK(context); - context.ch = context.cl; - context._add(context.ch, 100); - context._cmp(context.data.byte(kCommandtype), context.ch); - if (context.flags.z()) +void DreamGenContext::buttonpress() { + STACK_CHECK; + ch = cl; + _add(ch, 100); + _cmp(data.byte(kCommandtype), ch); + if (flags.z()) goto alreadyb; - context.data.byte(kCommandtype) = context.ch; - context.al = context.cl; - context._add(context.al, 4); - context.push(context.cx); - commandonly(context); - context.cx = context.pop(); + data.byte(kCommandtype) = ch; + al = cl; + _add(al, 4); + push(cx); + commandonly(); + cx = pop(); alreadyb: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notb) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dob; return; dob: - context.data.byte(kPressed) = context.cl; - context._add(context.cl, 21); - context.data.byte(kGraphicpress) = context.cl; - context.data.byte(kPresscount) = 40; - context._cmp(context.cl, 32); - if (context.flags.z()) + data.byte(kPressed) = cl; + _add(cl, 21); + data.byte(kGraphicpress) = cl; + data.byte(kPresscount) = 40; + _cmp(cl, 32); + if (flags.z()) return /* (nonoise) */; - context.al = 10; - playchannel1(context); -} - -void showouterpad(Context &context) { - STACK_CHECK(context); - context.di = (36+112)-3; - context.bx = (72)-4; - context.ds = context.data.word(kTempgraphics); - context.al = 1; - context.ah = 0; - showframe(context); - context.di = (36+112)+74; - context.bx = (72)+76; - context.ds = context.data.word(kTempgraphics); - context.al = 37; - context.ah = 0; - showframe(context); -} - -void showkeypad(Context &context) { - STACK_CHECK(context); - context.al = 22; - context.di = (36+112)+9; - context.bx = (72)+5; - singlekey(context); - context.al = 23; - context.di = (36+112)+31; - context.bx = (72)+5; - singlekey(context); - context.al = 24; - context.di = (36+112)+53; - context.bx = (72)+5; - singlekey(context); - context.al = 25; - context.di = (36+112)+9; - context.bx = (72)+23; - singlekey(context); - context.al = 26; - context.di = (36+112)+31; - context.bx = (72)+23; - singlekey(context); - context.al = 27; - context.di = (36+112)+53; - context.bx = (72)+23; - singlekey(context); - context.al = 28; - context.di = (36+112)+9; - context.bx = (72)+41; - singlekey(context); - context.al = 29; - context.di = (36+112)+31; - context.bx = (72)+41; - singlekey(context); - context.al = 30; - context.di = (36+112)+53; - context.bx = (72)+41; - singlekey(context); - context.al = 31; - context.di = (36+112)+9; - context.bx = (72)+59; - singlekey(context); - context.al = 32; - context.di = (36+112)+31; - context.bx = (72)+59; - singlekey(context); - context._cmp(context.data.byte(kLightcount), 0); - if (context.flags.z()) + 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) */; - context._dec(context.data.byte(kLightcount)); - context.al = 36; - context.bx = (72)-1+63; - context._cmp(context.data.byte(kLockstatus), 0); - if (!context.flags.z()) + _dec(data.byte(kLightcount)); + al = 36; + bx = (72)-1+63; + _cmp(data.byte(kLockstatus), 0); + if (!flags.z()) goto changelight; - context.al = 41; - context.bx = (72)+4+63; + al = 41; + bx = (72)+4+63; changelight: - context._cmp(context.data.byte(kLightcount), 60); - if (context.flags.c()) + _cmp(data.byte(kLightcount), 60); + if (flags.c()) goto gotlight; - context._cmp(context.data.byte(kLightcount), 100); - if (!context.flags.c()) + _cmp(data.byte(kLightcount), 100); + if (!flags.c()) goto gotlight; - context._dec(context.al); + _dec(al); gotlight: - context.ds = context.data.word(kTempgraphics); - context.ah = 0; - context.di = (36+112)+60; - showframe(context); + ds = data.word(kTempgraphics); + ah = 0; + di = (36+112)+60; + showframe(); } -void singlekey(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kGraphicpress), context.al); - if (!context.flags.z()) +void DreamGenContext::singlekey() { + STACK_CHECK; + _cmp(data.byte(kGraphicpress), al); + if (!flags.z()) goto gotkey; - context._add(context.al, 11); - context._cmp(context.data.byte(kPresscount), 8); - if (!context.flags.c()) + _add(al, 11); + _cmp(data.byte(kPresscount), 8); + if (!flags.c()) goto gotkey; - context._sub(context.al, 11); + _sub(al, 11); gotkey: - context.ds = context.data.word(kTempgraphics); - context._sub(context.al, 20); - context.ah = 0; - showframe(context); -} - -void dumpkeypad(Context &context) { - STACK_CHECK(context); - context.di = (36+112)-3; - context.bx = (72)-4; - context.cl = 120; - context.ch = 90; - multidump(context); -} - -void usemenu(Context &context) { - STACK_CHECK(context); - getridofreels(context); - loadmenu(context); - createpanel(context); - showpanel(context); - showicon(context); - context.data.byte(kNewobs) = 0; - drawfloor(context); - printsprites(context); - context.al = 4; - context.ah = 0; - context.di = (80+40)-48; - context.bx = (60)-4; - context.ds = context.data.word(kTempgraphics2); - showframe(context); - getundermenu(context); - context.al = 5; - context.ah = 0; - context.di = (80+40)+54; - context.bx = (60)+72; - context.ds = context.data.word(kTempgraphics2); - showframe(context); - worktoscreenm(context); - context.data.byte(kGetback) = 0; + 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(context); - putundermenu(context); - showmenu(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumpmenu(context); - dumptextline(context); - context.bx = 3614; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 1); - if (!context.flags.z()) + delpointer(); + putundermenu(); + showmenu(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumpmenu(); + dumptextline(); + bx = 3614; + checkcoords(); + _cmp(data.byte(kGetback), 1); + if (!flags.z()) goto menuloop; - context.data.byte(kManisoffscreen) = 0; - redrawmainscrn(context); - getridoftemp(context); - getridoftemp2(context); - restorereels(context); - worktoscreenm(context); -} - -void dumpmenu(Context &context) { - STACK_CHECK(context); - context.di = (80+40); - context.bx = (60); - context.cl = 48; - context.ch = 48; - multidump(context); -} - -void getundermenu(Context &context) { - STACK_CHECK(context); - context.di = (80+40); - context.bx = (60); - context.cl = 48; - context.ch = 48; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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(context); -} - -void putundermenu(Context &context) { - STACK_CHECK(context); - context.di = (80+40); - context.bx = (60); - context.cl = 48; - context.ch = 48; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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(context); -} - -void showoutermenu(Context &context) { - STACK_CHECK(context); - context.al = 40; - context.ah = 0; - context.di = (80+40)-34; - context.bx = (60)-40; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = 41; - context.ah = 0; - context.di = (80+40)+64-34; - context.bx = (60)-40; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = 42; - context.ah = 0; - context.di = (80+40)-26; - context.bx = (60)+57-40; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = 43; - context.ah = 0; - context.di = (80+40)+64-26; - context.bx = (60)+57-40; - context.ds = context.data.word(kTempgraphics); - showframe(context); -} - -void showmenu(Context &context) { - STACK_CHECK(context); - context._inc(context.data.byte(kMenucount)); - context._cmp(context.data.byte(kMenucount), 37*2); - if (!context.flags.z()) + 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+(180*10)+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+(180*10)+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; - context.data.byte(kMenucount) = 0; + data.byte(kMenucount) = 0; menuframeok: - context.al = context.data.byte(kMenucount); - context._shr(context.al, 1); - context.ah = 0; - context.di = (80+40); - context.bx = (60); - context.ds = context.data.word(kTempgraphics); - showframe(context); -} - -void loadmenu(Context &context) { - STACK_CHECK(context); - context.dx = 1832; - loadintotemp(context); - context.dx = 1987; - loadintotemp2(context); -} - -void viewfolder(Context &context) { - STACK_CHECK(context); - context.data.byte(kManisoffscreen) = 1; - getridofall(context); - loadfolder(context); - context.data.byte(kFolderpage) = 0; - showfolder(context); - worktoscreenm(context); - context.data.byte(kGetback) = 0; + 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(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3636; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 3636; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto folderloop; - context.data.byte(kManisoffscreen) = 0; - getridoftemp(context); - getridoftemp2(context); - getridoftemp3(context); - getridoftempcharset(context); - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); -} - -void nextfolder(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kFolderpage), 12); - if (!context.flags.z()) + 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(context); + blank(); return; cannextf: - context._cmp(context.data.byte(kCommandtype), 201); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 201); + if (flags.z()) goto alreadynextf; - context.data.byte(kCommandtype) = 201; - context.al = 16; - commandonly(context); + data.byte(kCommandtype) = 201; + al = 16; + commandonly(); alreadynextf: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notnextf) */; - context._cmp(context.ax, 1); - if (context.flags.z()) + _cmp(ax, 1); + if (flags.z()) goto donextf; return; donextf: - context._inc(context.data.byte(kFolderpage)); - folderhints(context); - delpointer(context); - showfolder(context); - context.data.word(kMousebutton) = 0; - context.bx = 3636; - checkcoords(context); - worktoscreenm(context); -} - -void folderhints(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kFolderpage), 5); - if (!context.flags.z()) + _inc(data.byte(kFolderpage)); + folderhints(); + delpointer(); + showfolder(); + data.word(kMousebutton) = 0; + bx = 3636; + checkcoords(); + worktoscreenm(); +} + +void DreamGenContext::folderhints() { + STACK_CHECK; + _cmp(data.byte(kFolderpage), 5); + if (!flags.z()) goto notaideadd; - context._cmp(context.data.byte(kAidedead), 1); - if (context.flags.z()) + _cmp(data.byte(kAidedead), 1); + if (flags.z()) goto notaideadd; - context.al = 13; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) + al = 13; + getlocation(); + _cmp(al, 1); + if (flags.z()) goto notaideadd; - context.al = 13; - setlocation(context); - showfolder(context); - context.al = 30; - findtext1(context); - context.di = 0; - context.bx = 86; - context.dl = 141; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); + al = 13; + setlocation(); + showfolder(); + al = 30; + findtext1(); + di = 0; + bx = 86; + dl = 141; + ah = 16; + printdirect(); + worktoscreenm(); + cx = 200; + hangonp(); return; notaideadd: - context._cmp(context.data.byte(kFolderpage), 9); - if (!context.flags.z()) + _cmp(data.byte(kFolderpage), 9); + if (!flags.z()) return /* (notaristoadd) */; - context.al = 7; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) + al = 7; + getlocation(); + _cmp(al, 1); + if (flags.z()) return /* (notaristoadd) */; - context.al = 7; - setlocation(context); - showfolder(context); - context.al = 31; - findtext1(context); - context.di = 0; - context.bx = 86; - context.dl = 141; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); -} - -void lastfolder(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kFolderpage), 0); - if (!context.flags.z()) + 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(context); + blank(); return; canlastf: - context._cmp(context.data.byte(kCommandtype), 202); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 202); + if (flags.z()) goto alreadylastf; - context.data.byte(kCommandtype) = 202; - context.al = 17; - commandonly(context); + data.byte(kCommandtype) = 202; + al = 17; + commandonly(); alreadylastf: - context._cmp(context.data.byte(kFolderpage), 0); - if (context.flags.z()) + _cmp(data.byte(kFolderpage), 0); + if (flags.z()) return /* (notlastf) */; - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notlastf) */; - context._cmp(context.ax, 1); - if (context.flags.z()) + _cmp(ax, 1); + if (flags.z()) goto dolastf; return; dolastf: - context._dec(context.data.byte(kFolderpage)); - delpointer(context); - showfolder(context); - context.data.word(kMousebutton) = 0; - context.bx = 3636; - checkcoords(context); - worktoscreenm(context); -} - -void loadfolder(Context &context) { - STACK_CHECK(context); - context.dx = 2299; - loadintotemp(context); - context.dx = 2312; - loadintotemp2(context); - context.dx = 2325; - loadintotemp3(context); - context.dx = 1883; - loadtempcharset(context); - context.dx = 2195; - loadtemptext(context); -} - -void showfolder(Context &context) { - STACK_CHECK(context); - context.data.byte(kCommandtype) = 255; - context._cmp(context.data.byte(kFolderpage), 0); - if (context.flags.z()) + _dec(data.byte(kFolderpage)); + delpointer(); + showfolder(); + data.word(kMousebutton) = 0; + bx = 3636; + 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(context); - createpanel2(context); - context.ds = context.data.word(kTempgraphics); - context.di = 0; - context.bx = 0; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = 143; - context.bx = 0; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = 0; - context.bx = 92; - context.al = 2; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = 143; - context.bx = 92; - context.al = 3; - context.ah = 0; - showframe(context); - folderexit(context); - context._cmp(context.data.byte(kFolderpage), 1); - if (context.flags.z()) + 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(context); + showleftpage(); noleftpage: - context._cmp(context.data.byte(kFolderpage), 12); - if (context.flags.z()) + _cmp(data.byte(kFolderpage), 12); + if (flags.z()) goto norightpage; - showrightpage(context); + showrightpage(); norightpage: - usecharset1(context); - undertextline(context); + usecharset1(); + undertextline(); return; closedfolder: - createpanel2(context); - context.ds = context.data.word(kTempgraphics3); - context.di = 143-28; - context.bx = 0; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics3); - context.di = 143-28; - context.bx = 92; - context.al = 1; - context.ah = 0; - showframe(context); - folderexit(context); - undertextline(context); -} - -void folderexit(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics2); - context.di = 296; - context.bx = 178; - context.al = 6; - context.ah = 0; - showframe(context); -} - -void showleftpage(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics2); - context.di = 0; - context.bx = 12; - context.al = 3; - context.ah = 0; - showframe(context); - context.bx = 12+5; - context.cx = 9; + 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: - context.push(context.cx); - context.push(context.bx); - context.ds = context.data.word(kTempgraphics2); - context.di = 0; - context.al = 4; - context.ah = 0; - showframe(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - if (--context.cx) + 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; - context.ds = context.data.word(kTempgraphics2); - context.di = 0; - context.al = 5; - context.ah = 0; - showframe(context); - context.data.word(kLinespacing) = 8; - context.data.word(kCharshift) = 91; - context.data.byte(kKerning) = 1; - context.bl = context.data.byte(kFolderpage); - context._dec(context.bl); - context._dec(context.bl); - context._add(context.bl, context.bl); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kTextfile1); - context.si = context.es.word(context.bx); - context._add(context.si, 66*2); - context.di = 2; - context.bx = 48; - context.dl = 140; - context.cx = 2; + 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: - context.push(context.cx); + push(cx); contleftpage: - printdirect(context); - context._add(context.bx, context.data.word(kLinespacing)); - context._cmp(context.al, 0); - if (!context.flags.z()) + printdirect(); + _add(bx, data.word(kLinespacing)); + _cmp(al, 0); + if (!flags.z()) goto contleftpage; - context.cx = context.pop(); - if (--context.cx) + cx = pop(); + if (--cx) goto twolotsleft; - context.data.byte(kKerning) = 0; - context.data.word(kCharshift) = 0; - context.data.word(kLinespacing) = 10; - context.es = context.data.word(kWorkspace); - context.ds = context.data.word(kWorkspace); - context.di = (48*320)+2; - context.si = (48*320)+2+130; - context.cx = 120; + 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: - context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.cx = 65; + push(cx); + push(di); + push(si); + cx = 65; flipfolderline: - context.al = context.es.byte(context.di); - context.ah = context.es.byte(context.si); - context.es.byte(context.di) = context.ah; - context.es.byte(context.si) = context.al; - context._dec(context.si); - context._inc(context.di); - if (--context.cx) + al = es.byte(di); + ah = es.byte(si); + es.byte(di) = ah; + es.byte(si) = al; + _dec(si); + _inc(di); + if (--cx) goto flipfolderline; - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.si, 320); - context._add(context.di, 320); - if (--context.cx) + si = pop(); + di = pop(); + cx = pop(); + _add(si, 320); + _add(di, 320); + if (--cx) goto flipfolder; } -void showrightpage(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics2); - context.di = 143; - context.bx = 12; - context.al = 0; - context.ah = 0; - showframe(context); - context.bx = 12+37; - context.cx = 7; +void DreamGenContext::showrightpage() { + STACK_CHECK; + ds = data.word(kTempgraphics2); + di = 143; + bx = 12; + al = 0; + ah = 0; + showframe(); + bx = 12+37; + cx = 7; rightpageloop: - context.push(context.cx); - context.push(context.bx); - context.ds = context.data.word(kTempgraphics2); - context.di = 143; - context.al = 1; - context.ah = 0; - showframe(context); - context.bx = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 16); - if (--context.cx) + 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; - context.ds = context.data.word(kTempgraphics2); - context.di = 143; - context.al = 2; - context.ah = 0; - showframe(context); - context.data.word(kLinespacing) = 8; - context.data.byte(kKerning) = 1; - context.bl = context.data.byte(kFolderpage); - context._dec(context.bl); - context._add(context.bl, context.bl); - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kTextfile1); - context.si = context.es.word(context.bx); - context._add(context.si, 66*2); - context.di = 152; - context.bx = 48; - context.dl = 140; - context.cx = 2; + 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: - context.push(context.cx); + push(cx); contrightpage: - printdirect(context); - context._add(context.bx, context.data.word(kLinespacing)); - context._cmp(context.al, 0); - if (!context.flags.z()) + printdirect(); + _add(bx, data.word(kLinespacing)); + _cmp(al, 0); + if (!flags.z()) goto contrightpage; - context.cx = context.pop(); - if (--context.cx) + cx = pop(); + if (--cx) goto twolotsright; - context.data.byte(kKerning) = 0; - context.data.word(kLinespacing) = 10; -} - -void entersymbol(Context &context) { - STACK_CHECK(context); - context.data.byte(kManisoffscreen) = 1; - getridofreels(context); - context.dx = 2338; - loadintotemp(context); - context.data.byte(kSymboltopx) = 24; - context.data.byte(kSymboltopdir) = 0; - context.data.byte(kSymbolbotx) = 24; - context.data.byte(kSymbolbotdir) = 0; - redrawmainscrn(context); - showsymbol(context); - undertextline(context); - worktoscreenm(context); - context.data.byte(kGetback) = 0; + 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(context); - updatesymboltop(context); - updatesymbolbot(context); - showsymbol(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - dumpsymbol(context); - context.bx = 3678; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + updatesymboltop(); + updatesymbolbot(); + showsymbol(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + dumpsymbol(); + bx = 3678; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto symbolloop; - context._cmp(context.data.byte(kSymbolbotnum), 3); - if (!context.flags.z()) + _cmp(data.byte(kSymbolbotnum), 3); + if (!flags.z()) goto symbolwrong; - context._cmp(context.data.byte(kSymboltopnum), 5); - if (!context.flags.z()) + _cmp(data.byte(kSymboltopnum), 5); + if (!flags.z()) goto symbolwrong; - context.al = 43; - removesetobject(context); - context.al = 46; - placesetobject(context); - context.ah = context.data.byte(kRoomnum); - context._add(context.ah, 12); - context.al = 0; - turnanypathon(context); - context.data.byte(kManisoffscreen) = 0; - redrawmainscrn(context); - getridoftemp(context); - restorereels(context); - worktoscreenm(context); - context.al = 13; - playchannel1(context); + 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: - context.al = 46; - removesetobject(context); - context.al = 43; - placesetobject(context); - context.ah = context.data.byte(kRoomnum); - context._add(context.ah, 12); - context.al = 0; - turnanypathoff(context); - context.data.byte(kManisoffscreen) = 0; - redrawmainscrn(context); - getridoftemp(context); - restorereels(context); - worktoscreenm(context); -} - -void quitsymbol(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 222; - context.al = 18; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 18; + commandonly(); alreadyqs: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notqs) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto doqs; return; doqs: - context.data.byte(kGetback) = 1; + data.byte(kGetback) = 1; } -void settopleft(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymboltopdir), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 210); - if (context.flags.z()) +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; - context.data.byte(kCommandtype) = 210; - context.al = 19; - commandonly(context); + data.byte(kCommandtype) = 210; + al = 19; + commandonly(); alreadytopl: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (notopleft) */; - context.data.byte(kSymboltopdir) = -1; + data.byte(kSymboltopdir) = -1; } -void settopright(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymboltopdir), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 211); - if (context.flags.z()) +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; - context.data.byte(kCommandtype) = 211; - context.al = 20; - commandonly(context); + data.byte(kCommandtype) = 211; + al = 20; + commandonly(); alreadytopr: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (notopright) */; - context.data.byte(kSymboltopdir) = 1; + data.byte(kSymboltopdir) = 1; } -void setbotleft(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymbolbotdir), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 212); - if (context.flags.z()) +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; - context.data.byte(kCommandtype) = 212; - context.al = 21; - commandonly(context); + data.byte(kCommandtype) = 212; + al = 21; + commandonly(); alreadybotl: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (nobotleft) */; - context.data.byte(kSymbolbotdir) = -1; + data.byte(kSymbolbotdir) = -1; } -void setbotright(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymbolbotdir), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 213); - if (context.flags.z()) +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; - context.data.byte(kCommandtype) = 213; - context.al = 22; - commandonly(context); + data.byte(kCommandtype) = 213; + al = 22; + commandonly(); alreadybotr: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (nobotright) */; - context.data.byte(kSymbolbotdir) = 1; -} - -void dumpsymbol(Context &context) { - STACK_CHECK(context); - context.data.byte(kNewtextline) = 0; - context.di = (64); - context.bx = (56)+20; - context.cl = 104; - context.ch = 60; - multidump(context); -} - -void showsymbol(Context &context) { - STACK_CHECK(context); - context.al = 12; - context.ah = 0; - context.di = (64); - context.bx = (56); - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = context.data.byte(kSymboltopx); - context.ah = 0; - context.di = context.ax; - context._add(context.di, (64)-44); - context.al = context.data.byte(kSymboltopnum); - context.bx = (56)+20; - context.ds = context.data.word(kTempgraphics); - context.ah = 32; - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - showframe(context); - context.al = context.data.byte(kSymbolbotx); - context.ah = 0; - context.di = context.ax; - context._add(context.di, (64)-44); - context.al = context.data.byte(kSymbolbotnum); - context._add(context.al, 6); - context.bx = (56)+49; - context.ds = context.data.word(kTempgraphics); - context.ah = 32; - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - context.push(context.ax); - context.push(context.di); - context.push(context.bx); - context.push(context.ds); - showframe(context); - context.ds = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.ax = context.pop(); - nextsymbol(context); - context._add(context.di, 49); - showframe(context); -} - -void nextsymbol(Context &context) { - STACK_CHECK(context); - context._inc(context.al); - context._cmp(context.al, 6); - if (context.flags.z()) + 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; - context._cmp(context.al, 12); - if (context.flags.z()) + _cmp(al, 12); + if (flags.z()) goto botwrap; return; topwrap: - context.al = 0; + al = 0; return; botwrap: - context.al = 6; + al = 6; } -void updatesymboltop(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymboltopdir), 0); - if (context.flags.z()) +void DreamGenContext::updatesymboltop() { + STACK_CHECK; + _cmp(data.byte(kSymboltopdir), 0); + if (flags.z()) return /* (topfinished) */; - context._cmp(context.data.byte(kSymboltopdir), -1); - if (context.flags.z()) + _cmp(data.byte(kSymboltopdir), -1); + if (flags.z()) goto backwards; - context._inc(context.data.byte(kSymboltopx)); - context._cmp(context.data.byte(kSymboltopx), 49); - if (!context.flags.z()) + _inc(data.byte(kSymboltopx)); + _cmp(data.byte(kSymboltopx), 49); + if (!flags.z()) goto notwrapfor; - context.data.byte(kSymboltopx) = 0; - context._dec(context.data.byte(kSymboltopnum)); - context._cmp(context.data.byte(kSymboltopnum), -1); - if (!context.flags.z()) + data.byte(kSymboltopx) = 0; + _dec(data.byte(kSymboltopnum)); + _cmp(data.byte(kSymboltopnum), -1); + if (!flags.z()) return /* (topfinished) */; - context.data.byte(kSymboltopnum) = 5; + data.byte(kSymboltopnum) = 5; return; notwrapfor: - context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) + _cmp(data.byte(kSymboltopx), 24); + if (!flags.z()) return /* (topfinished) */; - context.data.byte(kSymboltopdir) = 0; + data.byte(kSymboltopdir) = 0; return; backwards: - context._dec(context.data.byte(kSymboltopx)); - context._cmp(context.data.byte(kSymboltopx), -1); - if (!context.flags.z()) + _dec(data.byte(kSymboltopx)); + _cmp(data.byte(kSymboltopx), -1); + if (!flags.z()) goto notwrapback; - context.data.byte(kSymboltopx) = 48; - context._inc(context.data.byte(kSymboltopnum)); - context._cmp(context.data.byte(kSymboltopnum), 6); - if (!context.flags.z()) + data.byte(kSymboltopx) = 48; + _inc(data.byte(kSymboltopnum)); + _cmp(data.byte(kSymboltopnum), 6); + if (!flags.z()) return /* (topfinished) */; - context.data.byte(kSymboltopnum) = 0; + data.byte(kSymboltopnum) = 0; return; notwrapback: - context._cmp(context.data.byte(kSymboltopx), 24); - if (!context.flags.z()) + _cmp(data.byte(kSymboltopx), 24); + if (!flags.z()) return /* (topfinished) */; - context.data.byte(kSymboltopdir) = 0; + data.byte(kSymboltopdir) = 0; } -void updatesymbolbot(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSymbolbotdir), 0); - if (context.flags.z()) +void DreamGenContext::updatesymbolbot() { + STACK_CHECK; + _cmp(data.byte(kSymbolbotdir), 0); + if (flags.z()) return /* (botfinished) */; - context._cmp(context.data.byte(kSymbolbotdir), -1); - if (context.flags.z()) + _cmp(data.byte(kSymbolbotdir), -1); + if (flags.z()) goto backwardsbot; - context._inc(context.data.byte(kSymbolbotx)); - context._cmp(context.data.byte(kSymbolbotx), 49); - if (!context.flags.z()) + _inc(data.byte(kSymbolbotx)); + _cmp(data.byte(kSymbolbotx), 49); + if (!flags.z()) goto notwrapforb; - context.data.byte(kSymbolbotx) = 0; - context._dec(context.data.byte(kSymbolbotnum)); - context._cmp(context.data.byte(kSymbolbotnum), -1); - if (!context.flags.z()) + data.byte(kSymbolbotx) = 0; + _dec(data.byte(kSymbolbotnum)); + _cmp(data.byte(kSymbolbotnum), -1); + if (!flags.z()) return /* (botfinished) */; - context.data.byte(kSymbolbotnum) = 5; + data.byte(kSymbolbotnum) = 5; return; notwrapforb: - context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) + _cmp(data.byte(kSymbolbotx), 24); + if (!flags.z()) return /* (botfinished) */; - context.data.byte(kSymbolbotdir) = 0; + data.byte(kSymbolbotdir) = 0; return; backwardsbot: - context._dec(context.data.byte(kSymbolbotx)); - context._cmp(context.data.byte(kSymbolbotx), -1); - if (!context.flags.z()) + _dec(data.byte(kSymbolbotx)); + _cmp(data.byte(kSymbolbotx), -1); + if (!flags.z()) goto notwrapbackb; - context.data.byte(kSymbolbotx) = 48; - context._inc(context.data.byte(kSymbolbotnum)); - context._cmp(context.data.byte(kSymbolbotnum), 6); - if (!context.flags.z()) + data.byte(kSymbolbotx) = 48; + _inc(data.byte(kSymbolbotnum)); + _cmp(data.byte(kSymbolbotnum), 6); + if (!flags.z()) return /* (botfinished) */; - context.data.byte(kSymbolbotnum) = 0; + data.byte(kSymbolbotnum) = 0; return; notwrapbackb: - context._cmp(context.data.byte(kSymbolbotx), 24); - if (!context.flags.z()) + _cmp(data.byte(kSymbolbotx), 24); + if (!flags.z()) return /* (botfinished) */; - context.data.byte(kSymbolbotdir) = 0; + data.byte(kSymbolbotdir) = 0; } -void dumpsymbox(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kDumpx), -1); - if (context.flags.z()) +void DreamGenContext::dumpsymbox() { + STACK_CHECK; + _cmp(data.word(kDumpx), -1); + if (flags.z()) return /* (nodumpsym) */; - context.di = context.data.word(kDumpx); - context.bx = context.data.word(kDumpy); - context.cl = 30; - context.ch = 77; - multidump(context); - context.data.word(kDumpx) = -1; -} - -void usediary(Context &context) { - STACK_CHECK(context); - getridofreels(context); - context.dx = 2039; - loadintotemp(context); - context.dx = 2208; - loadtemptext(context); - context.dx = 1883; - loadtempcharset(context); - createpanel(context); - showicon(context); - showdiary(context); - undertextline(context); - showdiarypage(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); - context.data.byte(kGetback) = 0; + 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(context); - readmouse(context); - showdiarykeys(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumpdiarykeys(context); - dumptextline(context); - context.bx = 3740; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showdiarykeys(); + showpointer(); + vsync(); + dumppointer(); + dumpdiarykeys(); + dumptextline(); + bx = 3740; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto diaryloop; - getridoftemp(context); - getridoftemptext(context); - getridoftempcharset(context); - restorereels(context); - context.data.byte(kManisoffscreen) = 0; - redrawmainscrn(context); - worktoscreenm(context); -} - -void showdiary(Context &context) { - STACK_CHECK(context); - context.al = 1; - context.ah = 0; - context.di = (68+24); - context.bx = (48+12)+37; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = 2; - context.ah = 0; - context.di = (68+24)+176; - context.bx = (48+12)+108; - context.ds = context.data.word(kTempgraphics); - showframe(context); -} - -void showdiarykeys(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) + 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() { + STACK_CHECK; + _cmp(data.byte(kPresscount), 0); + if (flags.z()) return /* (nokeyatall) */; - context._dec(context.data.byte(kPresscount)); - context._cmp(context.data.byte(kPresscount), 0); - if (context.flags.z()) + _dec(data.byte(kPresscount)); + _cmp(data.byte(kPresscount), 0); + if (flags.z()) return /* (nokeyatall) */; - context._cmp(context.data.byte(kPressed), 'N'); - if (!context.flags.z()) + _cmp(data.byte(kPressed), 'N'); + if (!flags.z()) goto nokeyn; - context.al = 3; - context._cmp(context.data.byte(kPresscount), 1); - if (context.flags.z()) + al = 3; + _cmp(data.byte(kPresscount), 1); + if (flags.z()) goto gotkeyn; - context.al = 4; + al = 4; gotkeyn: - context.ah = 0; - context.di = (68+24)+94; - context.bx = (48+12)+97; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) + ah = 0; + di = (68+24)+94; + bx = (48+12)+97; + ds = data.word(kTempgraphics); + showframe(); + _cmp(data.byte(kPresscount), 1); + if (!flags.z()) return /* (notshown) */; - showdiarypage(context); + showdiarypage(); return; nokeyn: - context.al = 5; - context._cmp(context.data.byte(kPresscount), 1); - if (context.flags.z()) + al = 5; + _cmp(data.byte(kPresscount), 1); + if (flags.z()) goto gotkeyp; - context.al = 6; + al = 6; gotkeyp: - context.ah = 0; - context.di = (68+24)+151; - context.bx = (48+12)+71; - context.ds = context.data.word(kTempgraphics); - showframe(context); - context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) + ah = 0; + di = (68+24)+151; + bx = (48+12)+71; + ds = data.word(kTempgraphics); + showframe(); + _cmp(data.byte(kPresscount), 1); + if (!flags.z()) return /* (notshowp) */; - showdiarypage(context); + showdiarypage(); } -void dumpdiarykeys(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPresscount), 1); - if (!context.flags.z()) +void DreamGenContext::dumpdiarykeys() { + STACK_CHECK; + _cmp(data.byte(kPresscount), 1); + if (!flags.z()) goto notdumpdiary; - context._cmp(context.data.byte(kSartaindead), 1); - if (context.flags.z()) + _cmp(data.byte(kSartaindead), 1); + if (flags.z()) goto notsartadd; - context._cmp(context.data.byte(kDiarypage), 5); - if (!context.flags.z()) + _cmp(data.byte(kDiarypage), 5); + if (!flags.z()) goto notsartadd; - context._cmp(context.data.byte(kDiarypage), 5); - if (!context.flags.z()) + _cmp(data.byte(kDiarypage), 5); + if (!flags.z()) goto notsartadd; - context.al = 6; - getlocation(context); - context._cmp(context.al, 1); - if (context.flags.z()) + al = 6; + getlocation(); + _cmp(al, 1); + if (flags.z()) goto notsartadd; - context.al = 6; - setlocation(context); - delpointer(context); - context.al = 12; - findtext1(context); - context.di = 70; - context.bx = 106; - context.dl = 241; - context.ah = 16; - printdirect(context); - worktoscreenm(context); - context.cx = 200; - hangonp(context); - createpanel(context); - showicon(context); - showdiary(context); - showdiarypage(context); - worktoscreenm(context); - showpointer(context); + al = 6; + setlocation(); + delpointer(); + al = 12; + findtext1(); + di = 70; + bx = 106; + dl = 241; + ah = 16; + printdirect(); + worktoscreenm(); + cx = 200; + hangonp(); + createpanel(); + showicon(); + showdiary(); + showdiarypage(); + worktoscreenm(); + showpointer(); return; notsartadd: - context.di = (68+24)+48; - context.bx = (48+12)+15; - context.cl = 200; - context.ch = 16; - multidump(context); + di = (68+24)+48; + bx = (48+12)+15; + cl = 200; + ch = 16; + multidump(); notdumpdiary: - context.di = (68+24)+94; - context.bx = (48+12)+97; - context.cl = 16; - context.ch = 16; - multidump(context); - context.di = (68+24)+151; - context.bx = (48+12)+71; - context.cl = 16; - context.ch = 16; - multidump(context); -} - -void diarykeyp(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 214); - if (context.flags.z()) + di = (68+24)+94; + bx = (48+12)+97; + cl = 16; + ch = 16; + multidump(); + di = (68+24)+151; + bx = (48+12)+71; + cl = 16; + ch = 16; + multidump(); +} + +void DreamGenContext::diarykeyp() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 214); + if (flags.z()) goto alreadykeyp; - context.data.byte(kCommandtype) = 214; - context.al = 23; - commandonly(context); + data.byte(kCommandtype) = 214; + al = 23; + commandonly(); alreadykeyp: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (notkeyp) */; - context.ax = context.data.word(kOldbutton); - context._cmp(context.ax, context.data.word(kMousebutton)); - if (context.flags.z()) + ax = data.word(kOldbutton); + _cmp(ax, data.word(kMousebutton)); + if (flags.z()) return /* (notkeyp) */; - context._cmp(context.data.byte(kPresscount), 0); - if (!context.flags.z()) + _cmp(data.byte(kPresscount), 0); + if (!flags.z()) return /* (notkeyp) */; - context.al = 16; - playchannel1(context); - context.data.byte(kPresscount) = 12; - context.data.byte(kPressed) = 'P'; - context._dec(context.data.byte(kDiarypage)); - context._cmp(context.data.byte(kDiarypage), -1); - if (!context.flags.z()) + 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) */; - context.data.byte(kDiarypage) = 11; + data.byte(kDiarypage) = 11; } -void diarykeyn(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 213); - if (context.flags.z()) +void DreamGenContext::diarykeyn() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 213); + if (flags.z()) goto alreadykeyn; - context.data.byte(kCommandtype) = 213; - context.al = 23; - commandonly(context); + data.byte(kCommandtype) = 213; + al = 23; + commandonly(); alreadykeyn: - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (notkeyn) */; - context.ax = context.data.word(kOldbutton); - context._cmp(context.ax, context.data.word(kMousebutton)); - if (context.flags.z()) + ax = data.word(kOldbutton); + _cmp(ax, data.word(kMousebutton)); + if (flags.z()) return /* (notkeyn) */; - context._cmp(context.data.byte(kPresscount), 0); - if (!context.flags.z()) + _cmp(data.byte(kPresscount), 0); + if (!flags.z()) return /* (notkeyn) */; - context.al = 16; - playchannel1(context); - context.data.byte(kPresscount) = 12; - context.data.byte(kPressed) = 'N'; - context._inc(context.data.byte(kDiarypage)); - context._cmp(context.data.byte(kDiarypage), 12); - if (!context.flags.z()) + 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) */; - context.data.byte(kDiarypage) = 0; -} - -void showdiarypage(Context &context) { - STACK_CHECK(context); - context.al = 0; - context.ah = 0; - context.di = (68+24); - context.bx = (48+12); - context.ds = context.data.word(kTempgraphics); - showframe(context); - context.al = context.data.byte(kDiarypage); - findtext1(context); - context.data.byte(kKerning) = 1; - usetempcharset(context); - context.di = (68+24)+48; - context.bx = (48+12)+16; - context.dl = 240; - context.ah = 16; - context.data.word(kCharshift) = 91+91; - printdirect(context); - context.di = (68+24)+129; - context.bx = (48+12)+16; - context.dl = 240; - context.ah = 16; - printdirect(context); - context.di = (68+24)+48; - context.bx = (48+12)+23; - context.dl = 240; - context.ah = 16; - printdirect(context); - context.data.byte(kKerning) = 0; - context.data.word(kCharshift) = 0; - usecharset1(context); -} - -void findtext1(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.si = context.ax; - context._add(context.si, context.si); - context.es = context.data.word(kTextfile1); - context.ax = context.es.word(context.si); - context._add(context.ax, (66*2)); - context.si = context.ax; -} - -void zoomonoff(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) + data.byte(kDiarypage) = 0; +} + +void DreamGenContext::showdiarypage() { + STACK_CHECK; + al = 0; + ah = 0; + di = (68+24); + bx = (48+12); + ds = data.word(kTempgraphics); + showframe(); + al = data.byte(kDiarypage); + findtext1(); + data.byte(kKerning) = 1; + usetempcharset(); + di = (68+24)+48; + bx = (48+12)+16; + dl = 240; + ah = 16; + data.word(kCharshift) = 91+91; + printdirect(); + di = (68+24)+129; + bx = (48+12)+16; + dl = 240; + ah = 16; + printdirect(); + di = (68+24)+48; + bx = (48+12)+23; + dl = 240; + ah = 16; + printdirect(); + data.byte(kKerning) = 0; + data.word(kCharshift) = 0; + usecharset1(); +} + +void DreamGenContext::findtext1() { + STACK_CHECK; + ah = 0; + si = ax; + _add(si, si); + es = data.word(kTextfile1); + ax = es.word(si); + _add(ax, (66*2)); + 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; - context.data.byte(kCommandtype) = 222; - context.al = 39; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 39; + commandonly(); alreadyonoff: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nozoomonoff) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dozoomonoff; return; dozoomonoff: - context.al = context.data.byte(kZoomon); - context._xor(context.al, 1); - context.data.byte(kZoomon) = context.al; - createpanel(context); - context.data.byte(kNewobs) = 0; - drawfloor(context); - printsprites(context); - reelsonscreen(context); - showicon(context); - getunderzoom(context); - undertextline(context); - context.al = 39; - commandonly(context); - readmouse(context); - worktoscreenm(context); -} - -void saveload(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) - { blank(context); return; }; - context._cmp(context.data.byte(kCommandtype), 253); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 253; - context.al = 43; - commandonly(context); + data.byte(kCommandtype) = 253; + al = 43; + commandonly(); alreadyops: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noops) */; - context._and(context.ax, 1); - if (context.flags.z()) + _and(ax, 1); + if (flags.z()) return /* (noops) */; - dosaveload(context); -} - -void dosaveload(Context &context) { - STACK_CHECK(context); - context.data.byte(kPointerframe) = 0; - context.data.word(kTextaddressx) = 70; - context.data.word(kTextaddressy) = 182-8; - context.data.byte(kTextlen) = 181; - context.data.byte(kManisoffscreen) = 1; - clearwork(context); - createpanel2(context); - undertextline(context); - getridofall(context); - loadsavebox(context); - showopbox(context); - showmainops(context); - worktoscreen(context); + 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(context); - showmainops(context); - worktoscreenm(context); + showopbox(); + showmainops(); + worktoscreenm(); donefirstops: - context.data.byte(kGetback) = 0; + data.byte(kGetback) = 0; waitops: - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.bx = 3782; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + delpointer(); + bx = 3782; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto waitops; - context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) + _cmp(data.byte(kGetback), 2); + if (flags.z()) goto restartops; - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; - context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + _cmp(data.byte(kGetback), 4); + if (flags.z()) goto justret; - getridoftemp(context); - restoreall(context); - redrawmainscrn(context); - worktoscreenm(context); - context.data.byte(kCommandtype) = 200; + getridoftemp(); + restoreall(); + redrawmainscrn(); + worktoscreenm(); + data.byte(kCommandtype) = 200; justret: - context.data.byte(kManisoffscreen) = 0; + data.byte(kManisoffscreen) = 0; } -void getbackfromops(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kMandead), 2); - if (context.flags.z()) +void DreamGenContext::getbackfromops() { + STACK_CHECK; + _cmp(data.byte(kMandead), 2); + if (flags.z()) goto opsblock1; - getback1(context); + getback1(); return; opsblock1: - blank(context); -} - -void showmainops(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+10; - context.bx = (52)+10; - context.al = 8; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+59; - context.bx = (52)+30; - context.al = 7; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+128+4; - context.bx = (52)+12; - context.al = 1; - context.ah = 0; - showframe(context); -} - -void showdiscops(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+128+4; - context.bx = (52)+12; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+10; - context.bx = (52)+10; - context.al = 9; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+59; - context.bx = (52)+30; - context.al = 10; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+176+2; - context.bx = (52)+60-4; - context.al = 5; - context.ah = 0; - showframe(context); -} - -void loadsavebox(Context &context) { - STACK_CHECK(context); - context.dx = 1961; - loadintotemp(context); -} - -void loadgame(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 246); - if (context.flags.z()) + 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::loadgame() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 246); + if (flags.z()) goto alreadyload; - context.data.byte(kCommandtype) = 246; - context.al = 41; - commandonly(context); + data.byte(kCommandtype) = 246; + al = 41; + commandonly(); alreadyload: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noload) */; - context._cmp(context.ax, 1); - if (context.flags.z()) + _cmp(ax, 1); + if (flags.z()) goto doload; return; doload: - context.data.byte(kLoadingorsave) = 1; - showopbox(context); - showloadops(context); - context.data.byte(kCurrentslot) = 0; - showslots(context); - shownames(context); - context.data.byte(kPointerframe) = 0; - worktoscreenm(context); - namestoold(context); - context.data.byte(kGetback) = 0; + data.byte(kLoadingorsave) = 1; + showopbox(); + showloadops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + data.byte(kPointerframe) = 0; + worktoscreenm(); + namestoold(); + data.byte(kGetback) = 0; loadops: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3824; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 3824; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto loadops; - context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) + _cmp(data.byte(kGetback), 2); + if (flags.z()) return /* (quitloaded) */; - getridoftemp(context); - context.dx = context.data; - context.es = context.dx; - context.bx = 7979; - startloading(context); - loadroomssample(context); - context.data.byte(kRoomloaded) = 1; - context.data.byte(kNewlocation) = 255; - clearsprites(context); - initman(context); - initrain(context); - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; - startup(context); - worktoscreen(context); - context.data.byte(kGetback) = 4; -} - -void getbacktoops(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 201); - if (context.flags.z()) + getridoftemp(); + dx = data; + es = dx; + bx = 7979; + startloading(); + loadroomssample(); + data.byte(kRoomloaded) = 1; + data.byte(kNewlocation) = 255; + clearsprites(); + initman(); + initrain(); + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + startup(); + worktoscreen(); + data.byte(kGetback) = 4; +} + +void DreamGenContext::getbacktoops() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 201); + if (flags.z()) goto alreadygetops; - context.data.byte(kCommandtype) = 201; - context.al = 42; - commandonly(context); + data.byte(kCommandtype) = 201; + al = 42; + commandonly(); alreadygetops: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nogetbackops) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dogetbackops; return; dogetbackops: - oldtonames(context); - context.data.byte(kGetback) = 2; + oldtonames(); + data.byte(kGetback) = 2; } -void discops(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 249); - if (context.flags.z()) +void DreamGenContext::discops() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 249); + if (flags.z()) goto alreadydiscops; - context.data.byte(kCommandtype) = 249; - context.al = 43; - commandonly(context); + data.byte(kCommandtype) = 249; + al = 43; + commandonly(); alreadydiscops: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (nodiscops) */; - context._and(context.ax, 1); - if (!context.flags.z()) + _and(ax, 1); + if (!flags.z()) goto dodiscops; return; dodiscops: - scanfornames(context); - context.data.byte(kLoadingorsave) = 2; - showopbox(context); - showdiscops(context); - context.data.byte(kCurrentslot) = 0; - worktoscreenm(context); - context.data.byte(kGetback) = 0; + scanfornames(); + data.byte(kLoadingorsave) = 2; + showopbox(); + showdiscops(); + data.byte(kCurrentslot) = 0; + worktoscreenm(); + data.byte(kGetback) = 0; discopsloop: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3866; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 3866; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto discopsloop; } -void savegame(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kMandead), 2); - if (!context.flags.z()) +void DreamGenContext::savegame() { + STACK_CHECK; + _cmp(data.byte(kMandead), 2); + if (!flags.z()) goto cansaveok; - blank(context); + blank(); return; cansaveok: - context._cmp(context.data.byte(kCommandtype), 247); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 247); + if (flags.z()) goto alreadysave; - context.data.byte(kCommandtype) = 247; - context.al = 44; - commandonly(context); + data.byte(kCommandtype) = 247; + al = 44; + commandonly(); alreadysave: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (!flags.z()) goto dosave; return; dosave: - context.data.byte(kLoadingorsave) = 2; - showopbox(context); - showsaveops(context); - context.data.byte(kCurrentslot) = 0; - showslots(context); - shownames(context); - worktoscreenm(context); - namestoold(context); - context.data.word(kBufferin) = 0; - context.data.word(kBufferout) = 0; - context.data.byte(kGetback) = 0; + data.byte(kLoadingorsave) = 2; + showopbox(); + showsaveops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + worktoscreenm(); + namestoold(); + data.word(kBufferin) = 0; + data.word(kBufferout) = 0; + data.byte(kGetback) = 0; saveops: - delpointer(context); - checkinput(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3908; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + checkinput(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 3908; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto saveops; } -void actualsave(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 222); - if (context.flags.z()) +void DreamGenContext::actualsave() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 222); + if (flags.z()) goto alreadyactsave; - context.data.byte(kCommandtype) = 222; - context.al = 44; - commandonly(context); + data.byte(kCommandtype) = 222; + al = 44; + commandonly(); alreadyactsave: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (noactsave) */; - context.dx = context.data; - context.ds = context.dx; - context.si = 8579; - context.al = context.data.byte(kCurrentslot); - context.ah = 0; - context.cx = 17; - context._mul(context.cx); - context._add(context.si, context.ax); - context._inc(context.si); - context._cmp(context.ds.byte(context.si), 0); - if (context.flags.z()) + 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) */; - context.al = context.data.byte(kLocation); - context.ah = 0; - context.cx = 32; - context._mul(context.cx); - context.ds = context.cs; - context.si = 6187; - context._add(context.si, context.ax); - context.di = 7979; - context.bx = context.di; - context.es = context.cs; - context.cx = 16; - context._movsw(context.cx); - context.al = context.data.byte(kRoomssample); - context.es.byte(context.bx+13) = context.al; - context.al = context.data.byte(kMapx); - context.es.byte(context.bx+15) = context.al; - context.al = context.data.byte(kMapy); - context.es.byte(context.bx+16) = context.al; - context.al = context.data.byte(kLiftflag); - context.es.byte(context.bx+20) = context.al; - context.al = context.data.byte(kManspath); - context.es.byte(context.bx+21) = context.al; - context.al = context.data.byte(kFacing); - context.es.byte(context.bx+22) = context.al; - context.al = 255; - context.es.byte(context.bx+27) = context.al; - saveposition(context); - getridoftemp(context); - restoreall(context); - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; - redrawmainscrn(context); - worktoscreenm(context); - context.data.byte(kGetback) = 4; -} - -void actualload(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 221); - if (context.flags.z()) + 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); + 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; - context.data.byte(kCommandtype) = 221; - context.al = 41; - commandonly(context); + data.byte(kCommandtype) = 221; + al = 41; + commandonly(); alreadyactload: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (notactload) */; - context._cmp(context.ax, 1); - if (!context.flags.z()) + _cmp(ax, 1); + if (!flags.z()) return /* (notactload) */; - context.dx = context.data; - context.ds = context.dx; - context.si = 8579; - context.al = context.data.byte(kCurrentslot); - context.ah = 0; - context.cx = 17; - context._mul(context.cx); - context._add(context.si, context.ax); - context._inc(context.si); - context._cmp(context.ds.byte(context.si), 0); - if (context.flags.z()) + 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(context); - context.data.byte(kGetback) = 1; + loadposition(); + data.byte(kGetback) = 1; } -void selectslot2(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) +void DreamGenContext::selectslot2() { + STACK_CHECK; + _cmp(data.word(kMousebutton), 0); + if (flags.z()) goto noselslot2; - context.data.byte(kLoadingorsave) = 2; + data.byte(kLoadingorsave) = 2; noselslot2: - selectslot(context); + selectslot(); } -void checkinput(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLoadingorsave), 3); - if (context.flags.z()) +void DreamGenContext::checkinput() { + STACK_CHECK; + _cmp(data.byte(kLoadingorsave), 3); + if (flags.z()) return /* (nokeypress) */; - readkey(context); - context.al = context.data.byte(kCurrentkey); - context._cmp(context.al, 0); - if (context.flags.z()) + readkey(); + al = data.byte(kCurrentkey); + _cmp(al, 0); + if (flags.z()) return /* (nokeypress) */; - context._cmp(context.al, 13); - if (!context.flags.z()) + _cmp(al, 13); + if (!flags.z()) goto notret; - context.data.byte(kLoadingorsave) = 3; + data.byte(kLoadingorsave) = 3; goto afterkey; notret: - context._cmp(context.al, 8); - if (!context.flags.z()) + _cmp(al, 8); + if (!flags.z()) goto nodel2; - context._cmp(context.data.byte(kCursorpos), 0); - if (context.flags.z()) + _cmp(data.byte(kCursorpos), 0); + if (flags.z()) return /* (nokeypress) */; - getnamepos(context); - context._dec(context.data.byte(kCursorpos)); - context.es.byte(context.bx) = 0; - context.es.byte(context.bx+1) = 1; + getnamepos(); + _dec(data.byte(kCursorpos)); + es.byte(bx) = 0; + es.byte(bx+1) = 1; goto afterkey; nodel2: - context._cmp(context.data.byte(kCursorpos), 14); - if (context.flags.z()) + _cmp(data.byte(kCursorpos), 14); + if (flags.z()) return /* (nokeypress) */; - getnamepos(context); - context._inc(context.data.byte(kCursorpos)); - context.al = context.data.byte(kCurrentkey); - context.es.byte(context.bx+1) = context.al; - context.es.byte(context.bx+2) = 0; - context.es.byte(context.bx+3) = 1; + 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(context); - shownames(context); - showslots(context); - showsaveops(context); - worktoscreenm(context); -} - -void getnamepos(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kCurrentslot); - context.ah = 0; - context.cx = 17; - context._mul(context.cx); - context.dx = context.data; - context.es = context.dx; - context.bx = 8579; - context._add(context.bx, context.ax); - context.al = context.data.byte(kCursorpos); - context.ah = 0; - context._add(context.bx, context.ax); -} - -void showopbox(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60); - context.bx = (52); - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60); - context.bx = (52)+55; - context.al = 4; - context.ah = 0; - showframe(context); -} - -void showloadops(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+128+4; - context.bx = (52)+12; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+176+2; - context.bx = (52)+60-4; - context.al = 5; - context.ah = 0; - showframe(context); - context.di = (60)+104; - context.bx = (52)+14; - context.al = 55; - context.dl = 101; - printmessage(context); -} - -void showsaveops(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+128+4; - context.bx = (52)+12; - context.al = 1; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+176+2; - context.bx = (52)+60-4; - context.al = 5; - context.ah = 0; - showframe(context); - context.di = (60)+104; - context.bx = (52)+14; - context.al = 54; - context.dl = 101; - printmessage(context); -} - -void selectslot(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 244); - if (context.flags.z()) + 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() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 244); + if (flags.z()) goto alreadysel; - context.data.byte(kCommandtype) = 244; - context.al = 45; - commandonly(context); + data.byte(kCommandtype) = 244; + al = 45; + commandonly(); alreadysel: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, 1); + if (!flags.z()) return /* (noselslot) */; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (noselslot) */; - context._cmp(context.data.byte(kLoadingorsave), 3); - if (!context.flags.z()) + _cmp(data.byte(kLoadingorsave), 3); + if (!flags.z()) goto notnocurs; - context._dec(context.data.byte(kLoadingorsave)); + _dec(data.byte(kLoadingorsave)); notnocurs: - oldtonames(context); - context.ax = context.data.word(kMousey); - context._sub(context.ax, (52)+4); - context.cl = -1; + oldtonames(); + ax = data.word(kMousey); + _sub(ax, (52)+4); + cl = -1; getslotnum: - context._inc(context.cl); - context._sub(context.ax, 11); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 11); + if (!flags.c()) goto getslotnum; - context.data.byte(kCurrentslot) = context.cl; - delpointer(context); - showopbox(context); - showslots(context); - shownames(context); - context._cmp(context.data.byte(kLoadingorsave), 1); - if (context.flags.z()) + data.byte(kCurrentslot) = cl; + delpointer(); + showopbox(); + showslots(); + shownames(); + _cmp(data.byte(kLoadingorsave), 1); + if (flags.z()) goto isloadmode; - showsaveops(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); + showsaveops(); + readmouse(); + showpointer(); + worktoscreen(); + delpointer(); return; isloadmode: - showloadops(context); - readmouse(context); - showpointer(context); - worktoscreen(context); - delpointer(context); -} - -void showslots(Context &context) { - STACK_CHECK(context); - context.di = (60)+7; - context.bx = (52)+8; - context.al = 2; - context.ds = context.data.word(kTempgraphics); - context.ah = 0; - showframe(context); - context.di = (60)+10; - context.bx = (52)+11; - context.cl = 0; + showloadops(); + readmouse(); + showpointer(); + worktoscreen(); + delpointer(); +} + +void DreamGenContext::showslots() { + STACK_CHECK; + di = (60)+7; + bx = (52)+8; + al = 2; + ds = data.word(kTempgraphics); + ah = 0; + showframe(); + di = (60)+10; + bx = (52)+11; + cl = 0; slotloop: - context.push(context.cx); - context.push(context.di); - context.push(context.bx); - context._cmp(context.cl, context.data.byte(kCurrentslot)); - if (!context.flags.z()) + push(cx); + push(di); + push(bx); + _cmp(cl, data.byte(kCurrentslot)); + if (!flags.z()) goto nomatchslot; - context.al = 3; - context.ds = context.data.word(kTempgraphics); - context.ah = 0; - showframe(context); + al = 3; + ds = data.word(kTempgraphics); + ah = 0; + showframe(); nomatchslot: - context.bx = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.bx, 10); - context._inc(context.cl); - context._cmp(context.cl, 7); - if (!context.flags.z()) + bx = pop(); + di = pop(); + cx = pop(); + _add(bx, 10); + _inc(cl); + _cmp(cl, 7); + if (!flags.z()) goto slotloop; } -void shownames(Context &context) { - STACK_CHECK(context); - context.dx = context.data; - context.es = context.dx; - context.si = 8579+1; - context.di = (60)+21; - context.bx = (52)+10; - context.cl = 0; +void DreamGenContext::shownames() { + STACK_CHECK; + dx = data; + es = dx; + si = 8579+1; + di = (60)+21; + bx = (52)+10; + cl = 0; shownameloop: - context.push(context.cx); - context.push(context.di); - context.push(context.es); - context.push(context.bx); - context.push(context.si); - context.al = 4; - context._cmp(context.cl, context.data.byte(kCurrentslot)); - if (!context.flags.z()) + push(cx); + push(di); + push(es); + push(bx); + push(si); + al = 4; + _cmp(cl, data.byte(kCurrentslot)); + if (!flags.z()) goto nomatchslot2; - context._cmp(context.data.byte(kLoadingorsave), 2); - if (!context.flags.z()) + _cmp(data.byte(kLoadingorsave), 2); + if (!flags.z()) goto loadmode; - context.dx = context.si; - context.cx = 15; - context._add(context.si, 15); + dx = si; + cx = 15; + _add(si, 15); zerostill: - context._dec(context.si); - context._dec(context.cl); - context._cmp(context.es.byte(context.si), 1); - if (!context.flags.z()) + _dec(si); + _dec(cl); + _cmp(es.byte(si), 1); + if (!flags.z()) goto foundcharacter; goto zerostill; foundcharacter: - context.data.byte(kCursorpos) = context.cl; - context.es.byte(context.si) = '/'; - context.es.byte(context.si+1) = 0; - context.push(context.si); - context.si = context.dx; - context.dl = 200; - context.ah = 0; - printdirect(context); - context.si = context.pop(); - context.es.byte(context.si) = 0; - context.es.byte(context.si+1) = 1; + 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: - context.al = 0; - context.dl = 200; - context.ah = 0; - context.data.word(kCharshift) = 91; - printdirect(context); - context.data.word(kCharshift) = 0; + al = 0; + dl = 200; + ah = 0; + data.word(kCharshift) = 91; + printdirect(); + data.word(kCharshift) = 0; goto afterprintname; nomatchslot2: - context.dl = 200; - context.ah = 0; - printdirect(context); + dl = 200; + ah = 0; + printdirect(); afterprintname: - context.si = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context._add(context.si, 17); - context._add(context.bx, 10); - context._inc(context.cl); - context._cmp(context.cl, 7); - if (!context.flags.z()) + 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 namestoold(Context &context) { - STACK_CHECK(context); - context.ds = context.cs; - context.si = 8579; - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - context.es = context.data.word(kBuffers); - context.cx = 17*4; - context._movsb(context.cx); -} - -void oldtonames(Context &context) { - STACK_CHECK(context); - context.es = context.cs; - context.di = 8579; - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - context.ds = context.data.word(kBuffers); - context.cx = 17*4; - context._movsb(context.cx); -} - -void saveposition(Context &context) { - STACK_CHECK(context); - makeheader(context); - context.al = context.data.byte(kCurrentslot); - context.ah = 0; - context.push(context.ax); - context.cx = 13; - context._mul(context.cx); - context.dx = context.data; - context.ds = context.dx; - context.dx = 8698; - context._add(context.dx, context.ax); - openforsave(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 6091; - context.cx = (6187-6091); - savefilewrite(context); - context.dx = context.data; - context.es = context.dx; - context.di = 6141; - context.ax = context.pop(); - context.cx = 17; - context._mul(context.cx); - context.dx = context.data; - context.ds = context.dx; - context.dx = 8579; - context._add(context.dx, context.ax); - saveseg(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 0; - saveseg(context); - context.ds = context.data.word(kExtras); - context.dx = (0); - saveseg(context); - context.ds = context.data.word(kBuffers); - context.dx = (0+(180*10)+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(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 7979; - saveseg(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 534; - saveseg(context); - closefile(context); -} - -void loadposition(Context &context) { - STACK_CHECK(context); - context.data.word(kTimecount) = 0; - clearchanges(context); - context.al = context.data.byte(kCurrentslot); - context.ah = 0; - context.push(context.ax); - context.cx = 13; - context._mul(context.cx); - context.dx = context.data; - context.ds = context.dx; - context.dx = 8698; - context._add(context.dx, context.ax); - openfilefromc(context); - context.ds = context.cs; - context.dx = 6091; - context.cx = (6187-6091); - savefileread(context); - context.es = context.cs; - context.di = 6141; - context.ax = context.pop(); - context.cx = 17; - context._mul(context.cx); - context.dx = context.data; - context.ds = context.dx; - context.dx = 8579; - context._add(context.dx, context.ax); - loadseg(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(kExtras); - context.dx = (0); - loadseg(context); - context.ds = context.data.word(kBuffers); - context.dx = (0+(180*10)+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(context); - context.dx = context.data; - context.ds = context.dx; - context.dx = 7979; - loadseg(context); - context.ds = context.cs; - context.dx = 534; - loadseg(context); - closefile(context); -} - -void makeheader(Context &context) { - STACK_CHECK(context); - context.dx = context.data; - context.es = context.dx; - context.di = 6141; - context.ax = 17; - storeit(context); - context.ax = (68-0); - storeit(context); - context.ax = (0+2080+30000+(16*114)+((114+2)*2)+18000); - storeit(context); - context.ax = (250)*4; - storeit(context); - context.ax = 48; - storeit(context); - context.ax = (991-534); - storeit(context); -} - -void storeit(Context &context) { - STACK_CHECK(context); - context._cmp(context.ax, 0); - if (!context.flags.z()) +void DreamGenContext::namestoold() { + STACK_CHECK; + ds = cs; + si = 8579; + di = (0+(180*10)+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); +} + +void DreamGenContext::oldtonames() { + STACK_CHECK; + es = cs; + di = 8579; + si = (0+(180*10)+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); +} + +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+(180*10)+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+(180*10)+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; - context._inc(context.ax); + _inc(ax); isntblank: - context._stosw(); + _stosw(); } -void findlen(Context &context) { - STACK_CHECK(context); - context._dec(context.bx); - context._add(context.bx, context.ax); +void DreamGenContext::findlen() { + STACK_CHECK; + _dec(bx); + _add(bx, ax); nextone: - context._cmp(context.cl, context.ds.byte(context.bx)); - if (!context.flags.z()) + _cmp(cl, ds.byte(bx)); + if (!flags.z()) return /* (foundlen) */; - context._dec(context.bx); - context._dec(context.ax); - context._cmp(context.ax, 0); - if (!context.flags.z()) + _dec(bx); + _dec(ax); + _cmp(ax, 0); + if (!flags.z()) goto nextone; } -void scanfornames(Context &context) { - STACK_CHECK(context); - context.dx = context.data; - context.es = context.dx; - context.di = 8579; - context.dx = context.data; - context.ds = context.dx; - context.dx = 8698; - context.cx = 7; +void DreamGenContext::scanfornames() { + STACK_CHECK; + dx = data; + es = dx; + di = 8579; + dx = data; + ds = dx; + dx = 8698; + cx = 7; scanloop: - context.push(context.es); - context.push(context.ds); - context.push(context.di); - context.push(context.dx); - context.push(context.cx); - openfilefromc(context); - if (context.flags.c()) + push(es); + push(ds); + push(di); + push(dx); + push(cx); + openfilefromc(); + if (flags.c()) goto notexist; - context.cx = context.pop(); - context._inc(context.ch); - context.push(context.cx); - context.push(context.di); - context.push(context.es); - context.dx = context.data; - context.ds = context.dx; - context.dx = 6091; - context.cx = (6187-6091); - savefileread(context); - context.dx = context.data; - context.es = context.dx; - context.di = 6141; - context.ds = context.pop(); - context.dx = context.pop(); - loadseg(context); - context.bx = context.data.word(kHandle); - closefile(context); + 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: - context.cx = context.pop(); - context.dx = context.pop(); - context.di = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); - context._add(context.dx, 13); - context._add(context.di, 17); - context._dec(context.cl); - if (!context.flags.z()) + cx = pop(); + dx = pop(); + di = pop(); + ds = pop(); + es = pop(); + _add(dx, 13); + _add(di, 17); + _dec(cl); + if (!flags.z()) goto scanloop; - context.al = context.ch; -} - -void decide(Context &context) { - STACK_CHECK(context); - setmode(context); - loadpalfromiff(context); - clearpalette(context); - context.data.byte(kPointermode) = 0; - context.data.word(kWatchingtime) = 0; - context.data.byte(kPointerframe) = 0; - context.data.word(kTextaddressx) = 70; - context.data.word(kTextaddressy) = 182-8; - context.data.byte(kTextlen) = 181; - context.data.byte(kManisoffscreen) = 1; - loadsavebox(context); - showdecisions(context); - worktoscreen(context); - fadescreenup(context); - context.data.byte(kGetback) = 0; + 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: - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - context.bx = 5057; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + delpointer(); + bx = 5057; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto waitdecide; - context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) + _cmp(data.byte(kGetback), 4); + if (flags.z()) goto hasloadedroom; - getridoftemp(context); + getridoftemp(); hasloadedroom: - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; -} - -void showdecisions(Context &context) { - STACK_CHECK(context); - createpanel2(context); - showopbox(context); - context.ds = context.data.word(kTempgraphics); - context.di = (60)+17; - context.bx = (52)+13; - context.al = 6; - context.ah = 0; - showframe(context); - undertextline(context); -} - -void newgame(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 251); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 251; - context.al = 47; - commandonly(context); + data.byte(kCommandtype) = 251; + al = 47; + commandonly(); alreadynewgame: - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, 1); - if (!context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, 1); + if (!flags.z()) return /* (nonewgame) */; - context.data.byte(kGetback) = 3; -} - -void doload(Context &context) { - STACK_CHECK(context); - showopbox(context); - showloadops(context); - context.data.byte(kCurrentslot) = 0; - showslots(context); - shownames(context); - context.data.byte(kPointerframe) = 0; - worktoscreenm(context); - namestoold(context); - context.data.byte(kGetback) = 0; + data.byte(kGetback) = 3; +} + +void DreamGenContext::doload() { + STACK_CHECK; + showopbox(); + showloadops(); + data.byte(kCurrentslot) = 0; + showslots(); + shownames(); + data.byte(kPointerframe) = 0; + worktoscreenm(); + namestoold(); + data.byte(kGetback) = 0; loadops: - delpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - dumppointer(context); - dumptextline(context); - context.bx = 3824; - checkcoords(context); - context._cmp(context.data.byte(kGetback), 0); - if (context.flags.z()) + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + bx = 3824; + checkcoords(); + _cmp(data.byte(kGetback), 0); + if (flags.z()) goto loadops; - context._cmp(context.data.byte(kGetback), 2); - if (context.flags.z()) + _cmp(data.byte(kGetback), 2); + if (flags.z()) return /* (quitloaded) */; - getridoftemp(context); - context.dx = context.data; - context.es = context.dx; - context.bx = 7979; - startloading(context); - loadroomssample(context); - context.data.byte(kRoomloaded) = 1; - context.data.byte(kNewlocation) = 255; - clearsprites(context); - initman(context); - initrain(context); - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; - startup(context); - worktoscreen(context); - context.data.byte(kGetback) = 4; -} - -void loadold(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 252); - if (context.flags.z()) + getridoftemp(); + dx = data; + es = dx; + bx = 7979; + startloading(); + loadroomssample(); + data.byte(kRoomloaded) = 1; + data.byte(kNewlocation) = 255; + clearsprites(); + initman(); + initrain(); + data.word(kTextaddressx) = 13; + data.word(kTextaddressy) = 182; + data.byte(kTextlen) = 240; + startup(); + worktoscreen(); + data.byte(kGetback) = 4; +} + +void DreamGenContext::loadold() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 252); + if (flags.z()) goto alreadyloadold; - context.data.byte(kCommandtype) = 252; - context.al = 48; - commandonly(context); + data.byte(kCommandtype) = 252; + al = 48; + commandonly(); alreadyloadold: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return /* (noloadold) */; - doload(context); - context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) + doload(); + _cmp(data.byte(kGetback), 4); + if (flags.z()) return /* (noloadold) */; - showdecisions(context); - worktoscreenm(context); - context.data.byte(kGetback) = 0; -} - -void createname(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.di = 5105; - context.cs.byte(context.di+0) = context.dl; - context.cs.byte(context.di+3) = context.cl; - context.al = context.dh; - context.ah = '0'-1; + showdecisions(); + worktoscreenm(); + data.byte(kGetback) = 0; +} + +void DreamGenContext::createname() { + STACK_CHECK; + push(ax); + di = 5105; + cs.byte(di+0) = dl; + cs.byte(di+3) = cl; + al = dh; + ah = '0'-1; findten: - context._inc(context.ah); - context._sub(context.al, 10); - if (!context.flags.c()) + _inc(ah); + _sub(al, 10); + if (!flags.c()) goto findten; - context.cs.byte(context.di+1) = context.ah; - context._add(context.al, 10+'0'); - context.cs.byte(context.di+2) = context.al; - context.ax = context.pop(); - context.cl = '0'-1; + cs.byte(di+1) = ah; + _add(al, 10+'0'); + cs.byte(di+2) = al; + ax = pop(); + cl = '0'-1; thousandsc: - context._inc(context.cl); - context._sub(context.ax, 1000); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 1000); + if (!flags.c()) goto thousandsc; - context._add(context.ax, 1000); - context.cs.byte(context.di+4) = context.cl; - context.cl = '0'-1; + _add(ax, 1000); + cs.byte(di+4) = cl; + cl = '0'-1; hundredsc: - context._inc(context.cl); - context._sub(context.ax, 100); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 100); + if (!flags.c()) goto hundredsc; - context._add(context.ax, 100); - context.cs.byte(context.di+5) = context.cl; - context.cl = '0'-1; + _add(ax, 100); + cs.byte(di+5) = cl; + cl = '0'-1; tensc: - context._inc(context.cl); - context._sub(context.ax, 10); - if (!context.flags.c()) + _inc(cl); + _sub(ax, 10); + if (!flags.c()) goto tensc; - context._add(context.ax, 10); - context.cs.byte(context.di+6) = context.cl; - context._add(context.al, '0'); - context.cs.byte(context.di+7) = context.al; + _add(ax, 10); + cs.byte(di+6) = cl; + _add(al, '0'); + cs.byte(di+7) = al; } -void trysoundalloc(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNeedsoundbuff), 1); - if (context.flags.z()) +void DreamGenContext::trysoundalloc() { + STACK_CHECK; + _cmp(data.byte(kNeedsoundbuff), 1); + if (flags.z()) return /* (gotsoundbuff) */; - context._inc(context.data.byte(kSoundtimes)); - context.bx = (16384+2048)/16; - allocatemem(context); - context.data.word(kSoundbuffer) = context.ax; - context.push(context.ax); - context.al = context.ah; - context.cl = 4; - context._shr(context.al, context.cl); - context.data.byte(kSoundbufferpage) = context.al; - context.ax = context.pop(); - context.cl = 4; - context._shl(context.ax, context.cl); - context.data.word(kSoundbufferad) = context.ax; - context._cmp(context.ax, 0x0b7ff); - if (!context.flags.c()) + _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; - context.es = context.data.word(kSoundbuffer); - context.di = 0; - context.cx = 16384/2; - context.ax = 0x7f7f; - context._stosw(context.cx); - context.data.byte(kNeedsoundbuff) = 1; + es = data.word(kSoundbuffer); + di = 0; + cx = 16384/2; + ax = 0x7f7f; + _stosw(cx); + data.byte(kNeedsoundbuff) = 1; return; soundfail: - context.es = context.data.word(kSoundbuffer); - deallocatemem(context); + es = data.word(kSoundbuffer); + deallocatemem(); } -void playchannel0(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) +void DreamGenContext::playchannel0() { + STACK_CHECK; + _cmp(data.byte(kSoundint), 255); + if (flags.z()) return /* (dontbother4) */; - context.push(context.es); - context.push(context.ds); - context.push(context.bx); - context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.data.byte(kCh0playing) = context.al; - context.es = context.data.word(kSounddata); - context._cmp(context.al, 12); - if (context.flags.c()) + 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; - context.es = context.data.word(kSounddata2); - context._sub(context.al, 12); + es = data.word(kSounddata2); + _sub(al, 12); notsecondbank: - context.data.byte(kCh0repeat) = context.ah; - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx); - context.ah = 0; - context.data.word(kCh0emmpage) = context.ax; - context.ax = context.es.word(context.bx+1); - context.data.word(kCh0offset) = context.ax; - context.ax = context.es.word(context.bx+3); - context.data.word(kCh0blockstocopy) = context.ax; - context._cmp(context.data.byte(kCh0repeat), 0); - if (context.flags.z()) + 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; - context.ax = context.data.word(kCh0emmpage); - context.data.word(kCh0oldemmpage) = context.ax; - context.ax = context.data.word(kCh0offset); - context.data.word(kCh0oldoffset) = context.ax; - context.ax = context.data.word(kCh0blockstocopy); - context.data.word(kCh0oldblockstocopy) = context.ax; + 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: - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); -} - -void playchannel1(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) + 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) */; - context._cmp(context.data.byte(kCh1playing), 7); - if (context.flags.z()) + _cmp(data.byte(kCh1playing), 7); + if (flags.z()) return /* (dontbother5) */; - context.push(context.es); - context.push(context.ds); - context.push(context.bx); - context.push(context.cx); - context.push(context.di); - context.push(context.si); - context.data.byte(kCh1playing) = context.al; - context.es = context.data.word(kSounddata); - context._cmp(context.al, 12); - if (context.flags.c()) + 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; - context.es = context.data.word(kSounddata2); - context._sub(context.al, 12); + es = data.word(kSounddata2); + _sub(al, 12); notsecondbank1: - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx); - context.ah = 0; - context.data.word(kCh1emmpage) = context.ax; - context.ax = context.es.word(context.bx+1); - context.data.word(kCh1offset) = context.ax; - context.ax = context.es.word(context.bx+3); - context.data.word(kCh1blockstocopy) = context.ax; - context.si = context.pop(); - context.di = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); -} - -void makenextblock(Context &context) { - STACK_CHECK(context); - volumeadjust(context); - loopchannel0(context); - context._cmp(context.data.word(kCh1blockstocopy), 0); - if (context.flags.z()) + 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::makenextblock() { + STACK_CHECK; + volumeadjust(); + loopchannel0(); + _cmp(data.word(kCh1blockstocopy), 0); + if (flags.z()) goto mightbeonlych0; - context._cmp(context.data.word(kCh0blockstocopy), 0); - if (context.flags.z()) + _cmp(data.word(kCh0blockstocopy), 0); + if (flags.z()) goto mightbeonlych1; - context._dec(context.data.word(kCh0blockstocopy)); - context._dec(context.data.word(kCh1blockstocopy)); - bothchannels(context); + _dec(data.word(kCh0blockstocopy)); + _dec(data.word(kCh1blockstocopy)); + bothchannels(); return; mightbeonlych1: - context.data.byte(kCh0playing) = 255; - context._cmp(context.data.word(kCh1blockstocopy), 0); - if (context.flags.z()) + data.byte(kCh0playing) = 255; + _cmp(data.word(kCh1blockstocopy), 0); + if (flags.z()) return /* (notch1only) */; - context._dec(context.data.word(kCh1blockstocopy)); - channel1only(context); + _dec(data.word(kCh1blockstocopy)); + channel1only(); return; mightbeonlych0: - context.data.byte(kCh1playing) = 255; - context._cmp(context.data.word(kCh0blockstocopy), 0); - if (context.flags.z()) + data.byte(kCh1playing) = 255; + _cmp(data.word(kCh0blockstocopy), 0); + if (flags.z()) goto notch0only; - context._dec(context.data.word(kCh0blockstocopy)); - channel0only(context); + _dec(data.word(kCh0blockstocopy)); + channel0only(); return; notch0only: - context.es = context.data.word(kSoundbuffer); - context.di = context.data.word(kSoundbufferwrite); - context.cx = 1024; - context.ax = 0x7f7f; - context._stosw(context.cx); - context._and(context.di, 16384-1); - context.data.word(kSoundbufferwrite) = context.di; -} - -void volumeadjust(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kVolumedirection); - context._cmp(context.al, 0); - if (context.flags.z()) + es = data.word(kSoundbuffer); + di = data.word(kSoundbufferwrite); + cx = 1024; + ax = 0x7f7f; + _stosw(cx); + _and(di, 16384-1); + data.word(kSoundbufferwrite) = di; +} + +void DreamGenContext::volumeadjust() { + STACK_CHECK; + al = data.byte(kVolumedirection); + _cmp(al, 0); + if (flags.z()) return /* (volok) */; - context.al = context.data.byte(kVolume); - context._cmp(context.al, context.data.byte(kVolumeto)); - if (context.flags.z()) + al = data.byte(kVolume); + _cmp(al, data.byte(kVolumeto)); + if (flags.z()) goto volfinish; - context._add(context.data.byte(kVolumecount), 64); - if (!context.flags.z()) + _add(data.byte(kVolumecount), 64); + if (!flags.z()) return /* (volok) */; - context.al = context.data.byte(kVolume); - context._add(context.al, context.data.byte(kVolumedirection)); - context.data.byte(kVolume) = context.al; + al = data.byte(kVolume); + _add(al, data.byte(kVolumedirection)); + data.byte(kVolume) = al; return; volfinish: - context.data.byte(kVolumedirection) = 0; + data.byte(kVolumedirection) = 0; } -void loopchannel0(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kCh0blockstocopy), 0); - if (!context.flags.z()) +void DreamGenContext::loopchannel0() { + STACK_CHECK; + _cmp(data.word(kCh0blockstocopy), 0); + if (!flags.z()) return /* (notloop) */; - context._cmp(context.data.byte(kCh0repeat), 0); - if (context.flags.z()) + _cmp(data.byte(kCh0repeat), 0); + if (flags.z()) return /* (notloop) */; - context._cmp(context.data.byte(kCh0repeat), 255); - if (context.flags.z()) + _cmp(data.byte(kCh0repeat), 255); + if (flags.z()) goto endlessloop; - context._dec(context.data.byte(kCh0repeat)); + _dec(data.byte(kCh0repeat)); endlessloop: - context.ax = context.data.word(kCh0oldemmpage); - context.data.word(kCh0emmpage) = context.ax; - context.ax = context.data.word(kCh0oldoffset); - context.data.word(kCh0offset) = context.ax; - context.ax = context.data.word(kCh0blockstocopy); - context._add(context.ax, context.data.word(kCh0oldblockstocopy)); - context.data.word(kCh0blockstocopy) = context.ax; + ax = data.word(kCh0oldemmpage); + data.word(kCh0emmpage) = ax; + ax = data.word(kCh0oldoffset); + data.word(kCh0offset) = ax; + ax = data.word(kCh0blockstocopy); + _add(ax, data.word(kCh0oldblockstocopy)); + data.word(kCh0blockstocopy) = ax; } -void cancelch0(Context &context) { - STACK_CHECK(context); - context.data.byte(kCh0repeat) = 0; - context.data.word(kCh0blockstocopy) = 0; - context.data.byte(kCh0playing) = 255; +void DreamGenContext::cancelch0() { + STACK_CHECK; + data.byte(kCh0repeat) = 0; + data.word(kCh0blockstocopy) = 0; + data.byte(kCh0playing) = 255; } -void cancelch1(Context &context) { - STACK_CHECK(context); - context.data.word(kCh1blockstocopy) = 0; - context.data.byte(kCh1playing) = 255; +void DreamGenContext::cancelch1() { + STACK_CHECK; + data.word(kCh1blockstocopy) = 0; + data.byte(kCh1playing) = 255; } -void channel0tran(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kVolume), 0); - if (!context.flags.z()) +void DreamGenContext::channel0tran() { + STACK_CHECK; + _cmp(data.byte(kVolume), 0); + if (!flags.z()) goto lowvolumetran; - context.cx = 1024; - context._movsw(context.cx); + cx = 1024; + _movsw(cx); return; lowvolumetran: - context.cx = 1024; - context.bh = context.data.byte(kVolume); - context.bl = 0; - context._add(context.bx, 16384-256); + cx = 1024; + bh = data.byte(kVolume); + bl = 0; + _add(bx, 16384-256); volloop: - context._lodsw(); - context.bl = context.al; - context.al = context.es.byte(context.bx); - context.bl = context.ah; - context.ah = context.es.byte(context.bx); - context._stosw(); - if (--context.cx) + _lodsw(); + bl = al; + al = es.byte(bx); + bl = ah; + ah = es.byte(bx); + _stosw(); + if (--cx) goto volloop; } -void domix(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kVolume), 0); - if (!context.flags.z()) +void DreamGenContext::domix() { + STACK_CHECK; + _cmp(data.byte(kVolume), 0); + if (!flags.z()) goto lowvolumemix; slow: - context._lodsb(); - context.ah = context.ds.byte(context.bx); - context._inc(context.bx); - context._cmp(context.al, context.dh); - if (!context.flags.c()) + _lodsb(); + ah = ds.byte(bx); + _inc(bx); + _cmp(al, dh); + if (!flags.c()) goto toplot; - context._cmp(context.ah, context.dh); - if (!context.flags.c()) + _cmp(ah, dh); + if (!flags.c()) goto nodistort; - context._add(context.al, context.ah); - if (context.flags.s()) + _add(al, ah); + if (flags.s()) goto botok; - context._xor(context.al, context.al); - context._stosb(); - if (--context.cx) + _xor(al, al); + _stosb(); + if (--cx) goto slow; return /* (doneit) */; botok: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _xor(al, dh); + _stosb(); + if (--cx) goto slow; return /* (doneit) */; toplot: - context._cmp(context.ah, context.dh); - if (context.flags.c()) + _cmp(ah, dh); + if (flags.c()) goto nodistort; - context._add(context.al, context.ah); - if (!context.flags.s()) + _add(al, ah); + if (!flags.s()) goto topok; - context.al = context.dl; - context._stosb(); - if (--context.cx) + al = dl; + _stosb(); + if (--cx) goto slow; return /* (doneit) */; topok: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _xor(al, dh); + _stosb(); + if (--cx) goto slow; return /* (doneit) */; nodistort: - context._add(context.al, context.ah); - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _add(al, ah); + _xor(al, dh); + _stosb(); + if (--cx) goto slow; return /* (doneit) */; lowvolumemix: - context._lodsb(); - context.push(context.bx); - context.bh = context.data.byte(kVolume); - context._add(context.bh, 63); - context.bl = context.al; - context.al = context.es.byte(context.bx); - context.bx = context.pop(); - context.ah = context.ds.byte(context.bx); - context._inc(context.bx); - context._cmp(context.al, context.dh); - if (!context.flags.c()) + _lodsb(); + push(bx); + bh = data.byte(kVolume); + _add(bh, 63); + bl = al; + al = es.byte(bx); + bx = pop(); + ah = ds.byte(bx); + _inc(bx); + _cmp(al, dh); + if (!flags.c()) goto toplotv; - context._cmp(context.ah, context.dh); - if (!context.flags.c()) + _cmp(ah, dh); + if (!flags.c()) goto nodistortv; - context._add(context.al, context.ah); - if (context.flags.s()) + _add(al, ah); + if (flags.s()) goto botokv; - context._xor(context.al, context.al); - context._stosb(); - if (--context.cx) + _xor(al, al); + _stosb(); + if (--cx) goto lowvolumemix; return /* (doneit) */; botokv: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _xor(al, dh); + _stosb(); + if (--cx) goto lowvolumemix; return /* (doneit) */; toplotv: - context._cmp(context.ah, context.dh); - if (context.flags.c()) + _cmp(ah, dh); + if (flags.c()) goto nodistortv; - context._add(context.al, context.ah); - if (!context.flags.s()) + _add(al, ah); + if (!flags.s()) goto topokv; - context.al = context.dl; - context._stosb(); - if (--context.cx) + al = dl; + _stosb(); + if (--cx) goto lowvolumemix; return /* (doneit) */; topokv: - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _xor(al, dh); + _stosb(); + if (--cx) goto lowvolumemix; return /* (doneit) */; nodistortv: - context._add(context.al, context.ah); - context._xor(context.al, context.dh); - context._stosb(); - if (--context.cx) + _add(al, ah); + _xor(al, dh); + _stosb(); + if (--cx) goto lowvolumemix; } -void entrytexts(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 21); - if (!context.flags.z()) +void DreamGenContext::entrytexts() { + STACK_CHECK; + _cmp(data.byte(kLocation), 21); + if (!flags.z()) goto notloc15; - context.al = 28; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 28; + cx = 60; + dx = 11; + bl = 68; + bh = 64; + setuptimeduse(); return; notloc15: - context._cmp(context.data.byte(kLocation), 30); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 30); + if (!flags.z()) goto notloc43; - context.al = 27; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 27; + cx = 60; + dx = 11; + bl = 68; + bh = 64; + setuptimeduse(); return; notloc43: - context._cmp(context.data.byte(kLocation), 23); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 23); + if (!flags.z()) goto notloc23; - context.al = 29; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 29; + cx = 60; + dx = 11; + bl = 68; + bh = 64; + setuptimeduse(); return; notloc23: - context._cmp(context.data.byte(kLocation), 31); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 31); + if (!flags.z()) goto notloc44; - context.al = 30; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 30; + cx = 60; + dx = 11; + bl = 68; + bh = 64; + setuptimeduse(); return; notloc44: - context._cmp(context.data.byte(kLocation), 20); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 20); + if (!flags.z()) goto notsarters2; - context.al = 31; - context.cx = 60; - context.dx = 11; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 31; + cx = 60; + dx = 11; + bl = 68; + bh = 64; + setuptimeduse(); return; notsarters2: - context._cmp(context.data.byte(kLocation), 24); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 24); + if (!flags.z()) goto notedenlob; - context.al = 32; - context.cx = 60; - context.dx = 3; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); + al = 32; + cx = 60; + dx = 3; + bl = 68; + bh = 64; + setuptimeduse(); return; notedenlob: - context._cmp(context.data.byte(kLocation), 34); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 34); + if (!flags.z()) return /* (noteden2) */; - context.al = 33; - context.cx = 60; - context.dx = 3; - context.bl = 68; - context.bh = 64; - setuptimeduse(context); -} - -void entryanims(Context &context) { - STACK_CHECK(context); - context.data.word(kReeltowatch) = -1; - context.data.byte(kWatchmode) = -1; - context._cmp(context.data.byte(kLocation), 33); - if (!context.flags.z()) + al = 33; + cx = 60; + dx = 3; + bl = 68; + bh = 64; + setuptimeduse(); +} + +void DreamGenContext::entryanims() { + STACK_CHECK; + data.word(kReeltowatch) = -1; + data.byte(kWatchmode) = -1; + _cmp(data.byte(kLocation), 33); + if (!flags.z()) goto notinthebeach; - switchryanoff(context); - context.data.word(kWatchingtime) = 76*2; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 76; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; + switchryanoff(); + data.word(kWatchingtime) = 76*2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 76; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; return; notinthebeach: - context._cmp(context.data.byte(kLocation), 44); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 44); + if (!flags.z()) goto notsparkys; - context.al = 8; - resetlocation(context); - context.data.word(kWatchingtime) = 50*2; - context.data.word(kReeltowatch) = 247; - context.data.word(kEndwatchreel) = 297; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); + al = 8; + resetlocation(); + data.word(kWatchingtime) = 50*2; + data.word(kReeltowatch) = 247; + data.word(kEndwatchreel) = 297; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchryanoff(); return; notsparkys: - context._cmp(context.data.byte(kLocation), 22); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 22); + if (!flags.z()) goto notinthelift; - context.data.word(kWatchingtime) = 31*2; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 30; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); + data.word(kWatchingtime) = 31*2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 30; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchryanoff(); return; notinthelift: - context._cmp(context.data.byte(kLocation), 26); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 26); + if (!flags.z()) goto notunderchurch; - context.data.byte(kSymboltopnum) = 2; - context.data.byte(kSymbolbotnum) = 1; + data.byte(kSymboltopnum) = 2; + data.byte(kSymbolbotnum) = 1; return; notunderchurch: - context._cmp(context.data.byte(kLocation), 45); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 45); + if (!flags.z()) goto notenterdream; - context.data.byte(kKeeperflag) = 0; - context.data.word(kWatchingtime) = 296; - context.data.word(kReeltowatch) = 45; - context.data.word(kEndwatchreel) = 198; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); + data.byte(kKeeperflag) = 0; + data.word(kWatchingtime) = 296; + data.word(kReeltowatch) = 45; + data.word(kEndwatchreel) = 198; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchryanoff(); return; notenterdream: - context._cmp(context.data.byte(kReallocation), 46); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 46); + if (!flags.z()) goto notcrystal; - context._cmp(context.data.byte(kSartaindead), 1); - if (!context.flags.z()) + _cmp(data.byte(kSartaindead), 1); + if (!flags.z()) goto notcrystal; - context.al = 0; - removefreeobject(context); + al = 0; + removefreeobject(); return; notcrystal: - context._cmp(context.data.byte(kLocation), 9); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 9); + if (!flags.z()) goto nottopchurch; - context.al = 2; - checkifpathison(context); - if (context.flags.z()) + al = 2; + checkifpathison(); + if (flags.z()) goto nottopchurch; - context._cmp(context.data.byte(kAidedead), 0); - if (context.flags.z()) + _cmp(data.byte(kAidedead), 0); + if (flags.z()) goto nottopchurch; - context.al = 3; - checkifpathison(context); - if (!context.flags.z()) + al = 3; + checkifpathison(); + if (!flags.z()) goto makedoorsopen; - context.al = 2; - turnpathon(context); + al = 2; + turnpathon(); makedoorsopen: - context.al = 4; - removesetobject(context); - context.al = 5; - placesetobject(context); + al = 4; + removesetobject(); + al = 5; + placesetobject(); return; nottopchurch: - context._cmp(context.data.byte(kLocation), 47); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 47); + if (!flags.z()) goto notdreamcentre; - context.al = 4; - placesetobject(context); - context.al = 5; - placesetobject(context); + al = 4; + placesetobject(); + al = 5; + placesetobject(); return; notdreamcentre: - context._cmp(context.data.byte(kLocation), 38); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 38); + if (!flags.z()) goto notcarpark; - context.data.word(kWatchingtime) = 57*2; - context.data.word(kReeltowatch) = 4; - context.data.word(kEndwatchreel) = 57; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); + data.word(kWatchingtime) = 57*2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 57; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchryanoff(); return; notcarpark: - context._cmp(context.data.byte(kLocation), 32); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 32); + if (!flags.z()) goto notalley; - context.data.word(kWatchingtime) = 66*2; - context.data.word(kReeltowatch) = 0; - context.data.word(kEndwatchreel) = 66; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); + data.word(kWatchingtime) = 66*2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 66; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + switchryanoff(); return; notalley: - context._cmp(context.data.byte(kLocation), 24); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 24); + if (!flags.z()) return /* (notedensagain) */; - context.al = 2; - context.ah = context.data.byte(kRoomnum); - context._dec(context.ah); - turnanypathon(context); + al = 2; + ah = data.byte(kRoomnum); + _dec(ah); + turnanypathon(); } -void initialinv(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 24); - if (context.flags.z()) +void DreamGenContext::initialinv() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 24); + if (flags.z()) goto isedens; return; isedens: - context.al = 11; - context.ah = 5; - pickupob(context); - context.al = 12; - context.ah = 6; - pickupob(context); - context.al = 13; - context.ah = 7; - pickupob(context); - context.al = 14; - context.ah = 8; - pickupob(context); - context.al = 18; - context.al = 18; - context.ah = 0; - pickupob(context); - context.al = 19; - context.ah = 1; - pickupob(context); - context.al = 20; - context.ah = 9; - pickupob(context); - context.al = 16; - context.ah = 2; - pickupob(context); - context.data.byte(kWatchmode) = 1; - context.data.word(kReeltohold) = 0; - context.data.word(kEndofholdreel) = 6; - context.data.byte(kWatchspeed) = 1; - context.data.byte(kSpeedcount) = 1; - switchryanoff(context); -} - -void pickupob(Context &context) { - STACK_CHECK(context); - context.data.byte(kLastinvpos) = context.ah; - context.data.byte(kObjecttype) = 2; - context.data.byte(kItemframe) = context.al; - context.data.byte(kCommand) = context.al; - getanyad(context); - transfertoex(context); -} - -void checkforemm(Context &context) { - STACK_CHECK(context); -} - -void checkbasemem(Context &context) { - STACK_CHECK(context); - context.bx = context.data.word(kHowmuchalloc); - context._cmp(context.bx, 0x9360); - if (!context.flags.c()) + 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) */; - context.data.byte(kGameerror) = 5; - { quickquit(context); return; }; -} - -void allocatebuffers(Context &context) { - STACK_CHECK(context); - context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16; - allocatemem(context); - context.data.word(kExtras) = context.ax; - trysoundalloc(context); - context.bx = (0+(66*60))/16; - allocatemem(context); - context.data.word(kMapdata) = context.ax; - trysoundalloc(context); - context.bx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/16; - allocatemem(context); - context.data.word(kBuffers) = context.ax; - trysoundalloc(context); - context.bx = (16*80)/16; - allocatemem(context); - context.data.word(kFreedat) = context.ax; - trysoundalloc(context); - context.bx = (64*128)/16; - allocatemem(context); - context.data.word(kSetdat) = context.ax; - trysoundalloc(context); - context.bx = (22*8*20*8)/16; - allocatemem(context); - context.data.word(kMapstore) = context.ax; - allocatework(context); - context.bx = 2048/16; - allocatemem(context); - context.data.word(kSounddata) = context.ax; - context.bx = 2048/16; - allocatemem(context); - context.data.word(kSounddata2) = context.ax; -} - -void clearbuffers(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; - context.ax = 0; - context.di = 0; - context._stosw(context.cx); - context.es = context.data.word(kExtras); - context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; - context.ax = 0x0ffff; - context.di = 0; - context._stosw(context.cx); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+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*24)+(6*64)); - context.ds = context.cs; - context.si = 534; - context.cx = (991-534); - context._movsb(context.cx); - context.es = context.data.word(kBuffers); - context.di = (0+(180*10)+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*24)+(6*64)+991-534); - context.ds = context.cs; - context.si = 0; - context.cx = (68-0); - context._movsb(context.cx); - clearchanges(context); -} - -void clearchanges(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.cx = (250)*2; - context.ax = 0x0ffff; - context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - context._stosw(context.cx); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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*24)+(6*64)); - context.es = context.cs; - context.di = 534; - context.cx = (991-534); - context._movsb(context.cx); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+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*24)+(6*64)+991-534); - context.es = context.cs; - context.di = 0; - context.cx = (68-0); - context._movsb(context.cx); - context.data.byte(kExpos) = 0; - context.data.word(kExframepos) = 0; - context.data.word(kExtextpos) = 0; - context.es = context.data.word(kExtras); - context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; - context.ax = 0x0ffff; - context.di = 0; - context._stosw(context.cx); - context.es = context.cs; - context.di = 8011; - context.al = 1; - context._stosb(2); - context.al = 0; - context._stosb(); - context.al = 1; - context._stosb(); - context.ax = 0; - context.cx = 6; - context._stosw(context.cx); -} - -void clearbeforeload(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRoomloaded), 1); - if (!context.flags.z()) + 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+(180*10)+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*24)+(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() { + STACK_CHECK; + es = data.word(kBuffers); + cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; + ax = 0; + di = 0; + _stosw(cx); + es = data.word(kExtras); + cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; + ax = 0x0ffff; + di = 0; + _stosw(cx); + es = data.word(kBuffers); + di = (0+(180*10)+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*24)+(6*64)); + ds = cs; + si = 534; + cx = (991-534); + _movsb(cx); + es = data.word(kBuffers); + di = (0+(180*10)+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*24)+(6*64)+991-534); + ds = cs; + si = 0; + cx = (68-0); + _movsb(cx); + clearchanges(); +} + +void DreamGenContext::clearchanges() { + STACK_CHECK; + es = data.word(kBuffers); + cx = (250)*2; + ax = 0x0ffff; + di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + _stosw(cx); + ds = data.word(kBuffers); + si = (0+(180*10)+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*24)+(6*64)); + es = cs; + di = 534; + cx = (991-534); + _movsb(cx); + ds = data.word(kBuffers); + si = (0+(180*10)+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*24)+(6*64)+991-534); + es = cs; + di = 0; + cx = (68-0); + _movsb(cx); + data.byte(kExpos) = 0; + data.word(kExframepos) = 0; + data.word(kExtextpos) = 0; + es = data.word(kExtras); + cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; + ax = 0x0ffff; + di = 0; + _stosw(cx); + es = cs; + di = 8011; + al = 1; + _stosb(2); + al = 0; + _stosb(); + al = 1; + _stosb(); + ax = 0; + cx = 6; + _stosw(cx); +} + +void DreamGenContext::clearbeforeload() { + STACK_CHECK; + _cmp(data.byte(kRoomloaded), 1); + if (!flags.z()) return /* (noclear) */; - clearreels(context); - clearrest(context); - context.data.byte(kRoomloaded) = 0; -} - -void clearreels(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kReel1); - deallocatemem(context); - context.es = context.data.word(kReel2); - deallocatemem(context); - context.es = context.data.word(kReel3); - deallocatemem(context); -} - -void clearrest(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kMapdata); - context.cx = (66*60)/2; - context.ax = 0; - context.di = (0); - context._stosw(context.cx); - context.es = context.data.word(kBackdrop); - deallocatemem(context); - context.es = context.data.word(kSetframes); - deallocatemem(context); - context.es = context.data.word(kReels); - deallocatemem(context); - context.es = context.data.word(kPeople); - deallocatemem(context); - context.es = context.data.word(kSetdesc); - deallocatemem(context); - context.es = context.data.word(kBlockdesc); - deallocatemem(context); - context.es = context.data.word(kRoomdesc); - deallocatemem(context); - context.es = context.data.word(kFreeframes); - deallocatemem(context); - context.es = context.data.word(kFreedesc); - deallocatemem(context); -} - -void parseblaster(Context &context) { - STACK_CHECK(context); + 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); + 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::parseblaster() { + STACK_CHECK; lookattail: - context.al = context.es.byte(context.bx); - context._cmp(context.al, 0); - if (context.flags.z()) + al = es.byte(bx); + _cmp(al, 0); + if (flags.z()) return /* (endtail) */; - context._cmp(context.al, 13); - if (context.flags.z()) + _cmp(al, 13); + if (flags.z()) return /* (endtail) */; - context._cmp(context.al, 'i'); - if (context.flags.z()) + _cmp(al, 'i'); + if (flags.z()) goto issoundint; - context._cmp(context.al, 'I'); - if (context.flags.z()) + _cmp(al, 'I'); + if (flags.z()) goto issoundint; - context._cmp(context.al, 'b'); - if (context.flags.z()) + _cmp(al, 'b'); + if (flags.z()) goto isbright; - context._cmp(context.al, 'B'); - if (context.flags.z()) + _cmp(al, 'B'); + if (flags.z()) goto isbright; - context._cmp(context.al, 'a'); - if (context.flags.z()) + _cmp(al, 'a'); + if (flags.z()) goto isbaseadd; - context._cmp(context.al, 'A'); - if (context.flags.z()) + _cmp(al, 'A'); + if (flags.z()) goto isbaseadd; - context._cmp(context.al, 'n'); - if (context.flags.z()) + _cmp(al, 'n'); + if (flags.z()) goto isnosound; - context._cmp(context.al, 'N'); - if (context.flags.z()) + _cmp(al, 'N'); + if (flags.z()) goto isnosound; - context._cmp(context.al, 'd'); - if (context.flags.z()) + _cmp(al, 'd'); + if (flags.z()) goto isdma; - context._cmp(context.al, 'D'); - if (context.flags.z()) + _cmp(al, 'D'); + if (flags.z()) goto isdma; - context._inc(context.bx); - if (--context.cx) + _inc(bx); + if (--cx) goto lookattail; return; issoundint: - context.al = context.es.byte(context.bx+1); - context._sub(context.al, '0'); - context.data.byte(kSoundint) = context.al; - context._inc(context.bx); + al = es.byte(bx+1); + _sub(al, '0'); + data.byte(kSoundint) = al; + _inc(bx); goto lookattail; isdma: - context.al = context.es.byte(context.bx+1); - context._sub(context.al, '0'); - context.data.byte(kSounddmachannel) = context.al; - context._inc(context.bx); + al = es.byte(bx+1); + _sub(al, '0'); + data.byte(kSounddmachannel) = al; + _inc(bx); goto lookattail; isbaseadd: - context.push(context.cx); - context.al = context.es.byte(context.bx+2); - context._sub(context.al, '0'); - context.ah = 0; - context.cl = 4; - context._shl(context.ax, context.cl); - context._add(context.ax, 0x200); - context.data.word(kSoundbaseadd) = context.ax; - context.cx = context.pop(); - context._inc(context.bx); + push(cx); + al = es.byte(bx+2); + _sub(al, '0'); + ah = 0; + cl = 4; + _shl(ax, cl); + _add(ax, 0x200); + data.word(kSoundbaseadd) = ax; + cx = pop(); + _inc(bx); goto lookattail; isbright: - context.data.byte(kBrightness) = 1; - context._inc(context.bx); + data.byte(kBrightness) = 1; + _inc(bx); goto lookattail; isnosound: - context.data.byte(kSoundint) = 255; - context._inc(context.bx); + data.byte(kSoundint) = 255; + _inc(bx); goto lookattail; } -void startup(Context &context) { - STACK_CHECK(context); - context.data.byte(kCurrentkey) = 0; - context.data.byte(kMainmode) = 0; - createpanel(context); - context.data.byte(kNewobs) = 1; - drawfloor(context); - showicon(context); - getunderzoom(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - atmospheres(context); -} - -void startup1(Context &context) { - STACK_CHECK(context); - clearpalette(context); - context.data.byte(kThroughdoor) = 0; - context.data.byte(kCurrentkey) = '0'; - context.data.byte(kMainmode) = 0; - createpanel(context); - context.data.byte(kNewobs) = 1; - drawfloor(context); - showicon(context); - getunderzoom(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - atmospheres(context); - worktoscreen(context); - fadescreenup(context); -} - -void screenupdate(Context &context) { - STACK_CHECK(context); - newplace(context); - mainscreen(context); - animpointer(context); - showpointer(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) +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; - context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) + _cmp(data.byte(kNewlocation), 255); + if (!flags.z()) return /* (finishearly) */; iswatchingmode: - vsync(context); - readmouse1(context); - dumppointer(context); - dumptextline(context); - delpointer(context); - autolook(context); - spriteupdate(context); - watchcount(context); - zoom(context); - showpointer(context); - context._cmp(context.data.byte(kWongame), 0); - if (!context.flags.z()) + vsync(); + readmouse1(); + dumppointer(); + dumptextline(); + delpointer(); + autolook(); + spriteupdate(); + watchcount(); + zoom(); + showpointer(); + _cmp(data.byte(kWongame), 0); + if (!flags.z()) return /* (finishearly) */; - vsync(context); - readmouse2(context); - dumppointer(context); - dumpzoom(context); - delpointer(context); - deleverything(context); - printsprites(context); - reelsonscreen(context); - afternewroom(context); - showpointer(context); - vsync(context); - readmouse3(context); - dumppointer(context); - dumpmap(context); - dumptimedtext(context); - delpointer(context); - showpointer(context); - vsync(context); - readmouse4(context); - dumppointer(context); - dumpwatch(context); - delpointer(context); -} - -void watchreel(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kReeltowatch), -1); - if (context.flags.z()) + 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; - context.al = context.data.byte(kManspath); - context._cmp(context.al, context.data.byte(kFinaldest)); - if (!context.flags.z()) + al = data.byte(kManspath); + _cmp(al, data.byte(kFinaldest)); + if (!flags.z()) return /* (waitstopwalk) */; - context.al = context.data.byte(kTurntoface); - context._cmp(context.al, context.data.byte(kFacing)); - if (context.flags.z()) + al = data.byte(kTurntoface); + _cmp(al, data.byte(kFacing)); + if (flags.z()) goto notwatchpath; return; notwatchpath: - context._dec(context.data.byte(kSpeedcount)); - context._cmp(context.data.byte(kSpeedcount), -1); - if (!context.flags.z()) + _dec(data.byte(kSpeedcount)); + _cmp(data.byte(kSpeedcount), -1); + if (!flags.z()) goto showwatchreel; - context.al = context.data.byte(kWatchspeed); - context.data.byte(kSpeedcount) = context.al; - context.ax = context.data.word(kReeltowatch); - context._cmp(context.ax, context.data.word(kEndwatchreel)); - if (!context.flags.z()) + al = data.byte(kWatchspeed); + data.byte(kSpeedcount) = al; + ax = data.word(kReeltowatch); + _cmp(ax, data.word(kEndwatchreel)); + if (!flags.z()) goto ismorereel; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) goto showwatchreel; - context.data.word(kReeltowatch) = -1; - context.data.byte(kWatchmode) = -1; - context._cmp(context.data.word(kReeltohold), -1); - if (context.flags.z()) + data.word(kReeltowatch) = -1; + data.byte(kWatchmode) = -1; + _cmp(data.word(kReeltohold), -1); + if (flags.z()) return /* (nomorereel) */; - context.data.byte(kWatchmode) = 1; + data.byte(kWatchmode) = 1; goto notplayingreel; ismorereel: - context._inc(context.data.word(kReeltowatch)); + _inc(data.word(kReeltowatch)); showwatchreel: - context.ax = context.data.word(kReeltowatch); - context.data.word(kReelpointer) = context.ax; - plotreel(context); - context.ax = context.data.word(kReelpointer); - context.data.word(kReeltowatch) = context.ax; - checkforshake(context); + ax = data.word(kReeltowatch); + data.word(kReelpointer) = ax; + plotreel(); + ax = data.word(kReelpointer); + data.word(kReeltowatch) = ax; + checkforshake(); return; notplayingreel: - context._cmp(context.data.byte(kWatchmode), 1); - if (!context.flags.z()) + _cmp(data.byte(kWatchmode), 1); + if (!flags.z()) goto notholdingreel; - context.ax = context.data.word(kReeltohold); - context.data.word(kReelpointer) = context.ax; - plotreel(context); + ax = data.word(kReeltohold); + data.word(kReelpointer) = ax; + plotreel(); return; notholdingreel: - context._cmp(context.data.byte(kWatchmode), 2); - if (!context.flags.z()) + _cmp(data.byte(kWatchmode), 2); + if (!flags.z()) return /* (notreleasehold) */; - context._dec(context.data.byte(kSpeedcount)); - context._cmp(context.data.byte(kSpeedcount), -1); - if (!context.flags.z()) + _dec(data.byte(kSpeedcount)); + _cmp(data.byte(kSpeedcount), -1); + if (!flags.z()) goto notlastspeed2; - context.al = context.data.byte(kWatchspeed); - context.data.byte(kSpeedcount) = context.al; - context._inc(context.data.word(kReeltohold)); + al = data.byte(kWatchspeed); + data.byte(kSpeedcount) = al; + _inc(data.word(kReeltohold)); notlastspeed2: - context.ax = context.data.word(kReeltohold); - context._cmp(context.ax, context.data.word(kEndofholdreel)); - if (!context.flags.z()) + ax = data.word(kReeltohold); + _cmp(ax, data.word(kEndofholdreel)); + if (!flags.z()) goto ismorereel2; - context.data.word(kReeltohold) = -1; - context.data.byte(kWatchmode) = -1; - context.al = context.data.byte(kDestafterhold); - context.data.byte(kDestination) = context.al; - context.data.byte(kFinaldest) = context.al; - autosetwalk(context); + data.word(kReeltohold) = -1; + data.byte(kWatchmode) = -1; + al = data.byte(kDestafterhold); + data.byte(kDestination) = al; + data.byte(kFinaldest) = al; + autosetwalk(); return; ismorereel2: - context.ax = context.data.word(kReeltohold); - context.data.word(kReelpointer) = context.ax; - plotreel(context); + ax = data.word(kReeltohold); + data.word(kReelpointer) = ax; + plotreel(); } -void checkforshake(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 26); - if (!context.flags.z()) +void DreamGenContext::checkforshake() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 26); + if (!flags.z()) return /* (notstartshake) */; - context._cmp(context.ax, 104); - if (!context.flags.z()) + _cmp(ax, 104); + if (!flags.z()) return /* (notstartshake) */; - context.data.byte(kShakecounter) = -1; + data.byte(kShakecounter) = -1; } -void watchcount(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) +void DreamGenContext::watchcount() { + STACK_CHECK; + _cmp(data.byte(kWatchon), 0); + if (flags.z()) return /* (nowatchworn) */; - context._inc(context.data.byte(kTimercount)); - context._cmp(context.data.byte(kTimercount), 9); - if (context.flags.z()) + _inc(data.byte(kTimercount)); + _cmp(data.byte(kTimercount), 9); + if (flags.z()) goto flashdots; - context._cmp(context.data.byte(kTimercount), 18); - if (context.flags.z()) + _cmp(data.byte(kTimercount), 18); + if (flags.z()) goto uptime; return; flashdots: - context.ax = 91*3+21; - context.di = 268+4; - context.bx = 21; - context.ds = context.data.word(kCharset1); - showframe(context); + ax = 91*3+21; + di = 268+4; + bx = 21; + ds = data.word(kCharset1); + showframe(); goto finishwatch; uptime: - context.data.byte(kTimercount) = 0; - context._add(context.data.byte(kSecondcount), 1); - context._cmp(context.data.byte(kSecondcount), 60); - if (!context.flags.z()) + data.byte(kTimercount) = 0; + _add(data.byte(kSecondcount), 1); + _cmp(data.byte(kSecondcount), 60); + if (!flags.z()) goto finishtime; - context.data.byte(kSecondcount) = 0; - context._inc(context.data.byte(kMinutecount)); - context._cmp(context.data.byte(kMinutecount), 60); - if (!context.flags.z()) + data.byte(kSecondcount) = 0; + _inc(data.byte(kMinutecount)); + _cmp(data.byte(kMinutecount), 60); + if (!flags.z()) goto finishtime; - context.data.byte(kMinutecount) = 0; - context._inc(context.data.byte(kHourcount)); - context._cmp(context.data.byte(kHourcount), 24); - if (!context.flags.z()) + data.byte(kMinutecount) = 0; + _inc(data.byte(kHourcount)); + _cmp(data.byte(kHourcount), 24); + if (!flags.z()) goto finishtime; - context.data.byte(kHourcount) = 0; + data.byte(kHourcount) = 0; finishtime: - showtime(context); + showtime(); finishwatch: - context.data.byte(kWatchdump) = 1; + data.byte(kWatchdump) = 1; } -void showtime(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) +void DreamGenContext::showtime() { + STACK_CHECK; + _cmp(data.byte(kWatchon), 0); + if (flags.z()) return /* (nowatch) */; - context.al = context.data.byte(kSecondcount); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3+10); - context.ds = context.data.word(kCharset1); - context.di = 282+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3+10); - context.ds = context.data.word(kCharset1); - context.di = 282+9; - context.bx = 21; - showframe(context); - context.al = context.data.byte(kMinutecount); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(kCharset1); - context.di = 270+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(kCharset1); - context.di = 270+11; - context.bx = 21; - showframe(context); - context.al = context.data.byte(kHourcount); - context.cl = 0; - twodigitnum(context); - context.push(context.ax); - context.al = context.ah; - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(kCharset1); - context.di = 256+5; - context.bx = 21; - showframe(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, 91*3); - context.ds = context.data.word(kCharset1); - context.di = 256+11; - context.bx = 21; - showframe(context); - context.ax = 91*3+20; - context.ds = context.data.word(kCharset1); - context.di = 267+5; - context.bx = 21; - showframe(context); -} - -void dumpwatch(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchdump), 1); - if (!context.flags.z()) + 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) */; - context.di = 256; - context.bx = 21; - context.cl = 40; - context.ch = 12; - multidump(context); - context.data.byte(kWatchdump) = 0; -} - -void showbyte(Context &context) { - STACK_CHECK(context); - context.dl = context.al; - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - onedigit(context); - context.es.byte(context.di) = context.dl; - context.dl = context.al; - context._and(context.dl, 15); - onedigit(context); - context.es.byte(context.di+1) = context.dl; - context._add(context.di, 3); -} - -void onedigit(Context &context) { - STACK_CHECK(context); - context._cmp(context.dl, 10); - if (!context.flags.c()) + 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; - context._add(context.dl, '0'); + _add(dl, '0'); return; morethan10: - context._sub(context.dl, 10); - context._add(context.dl, 'A'); + _sub(dl, 10); + _add(dl, 'A'); } -void twodigitnum(Context &context) { - STACK_CHECK(context); - context.ah = context.cl; - context._dec(context.ah); +void DreamGenContext::twodigitnum() { + STACK_CHECK; + ah = cl; + _dec(ah); numloop1: - context._inc(context.ah); - context._sub(context.al, 10); - if (!context.flags.c()) + _inc(ah); + _sub(al, 10); + if (!flags.c()) goto numloop1; - context._add(context.al, 10); - context._add(context.al, context.cl); + _add(al, 10); + _add(al, cl); } -void showword(Context &context) { - STACK_CHECK(context); - context.ch = 0; - context.bx = 10000; - context.cl = 47; +void DreamGenContext::showword() { + STACK_CHECK; + ch = 0; + bx = 10000; + cl = 47; word1: - context._inc(context.cl); - context._sub(context.ax, context.bx); - if (!context.flags.c()) + _inc(cl); + _sub(ax, bx); + if (!flags.c()) goto word1; - context._add(context.ax, context.bx); - convnum(context); - context.cs.byte(context.di) = context.cl; - context.bx = 1000; - context.cl = 47; + _add(ax, bx); + convnum(); + cs.byte(di) = cl; + bx = 1000; + cl = 47; word2: - context._inc(context.cl); - context._sub(context.ax, context.bx); - if (!context.flags.c()) + _inc(cl); + _sub(ax, bx); + if (!flags.c()) goto word2; - context._add(context.ax, context.bx); - convnum(context); - context.cs.byte(context.di+1) = context.cl; - context.bx = 100; - context.cl = 47; + _add(ax, bx); + convnum(); + cs.byte(di+1) = cl; + bx = 100; + cl = 47; word3: - context._inc(context.cl); - context._sub(context.ax, context.bx); - if (!context.flags.c()) + _inc(cl); + _sub(ax, bx); + if (!flags.c()) goto word3; - context._add(context.ax, context.bx); - convnum(context); - context.cs.byte(context.di+2) = context.cl; - context.bx = 10; - context.cl = 47; + _add(ax, bx); + convnum(); + cs.byte(di+2) = cl; + bx = 10; + cl = 47; word4: - context._inc(context.cl); - context._sub(context.ax, context.bx); - if (!context.flags.c()) + _inc(cl); + _sub(ax, bx); + if (!flags.c()) goto word4; - context._add(context.ax, context.bx); - convnum(context); - context.cs.byte(context.di+3) = context.cl; - context._add(context.al, 48); - context.cl = context.al; - convnum(context); - context.cs.byte(context.di+4) = context.cl; -} - -void convnum(Context &context) { - STACK_CHECK(context); - context._cmp(context.ch, 0); - if (!context.flags.z()) + _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) */; - context._cmp(context.cl, '0'); - if (!context.flags.z()) + _cmp(cl, '0'); + if (!flags.z()) goto notzeronum; - context.cl = 32; + cl = 32; return /* (noconvnum) */; notzeronum: - context.ch = 1; + ch = 1; } -void walkandexamine(Context &context) { - STACK_CHECK(context); - finishedwalking(context); - if (!context.flags.z()) +void DreamGenContext::walkandexamine() { + STACK_CHECK; + finishedwalking(); + if (!flags.z()) return /* (noobselect) */; - context.al = context.data.byte(kWalkexamtype); - context.data.byte(kCommandtype) = context.al; - context.al = context.data.byte(kWalkexamnum); - context.data.byte(kCommand) = context.al; - context.data.byte(kWalkandexam) = 0; - context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) + al = data.byte(kWalkexamtype); + data.byte(kCommandtype) = al; + al = data.byte(kWalkexamnum); + data.byte(kCommand) = al; + data.byte(kWalkandexam) = 0; + _cmp(data.byte(kCommandtype), 5); + if (flags.z()) return /* (noobselect) */; - examineob(context); + examineob(); return; wantstowalk: - setwalk(context); - context.data.byte(kReasseschanges) = 1; + setwalk(); + data.byte(kReasseschanges) = 1; return; diff: - context.data.byte(kCommand) = context.al; - context.data.byte(kCommandtype) = context.ah; - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + data.byte(kCommand) = al; + data.byte(kCommandtype) = ah; + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto middleofwalk; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) goto middleofwalk; - context.al = context.data.byte(kFacing); - context._cmp(context.al, context.data.byte(kTurntoface)); - if (!context.flags.z()) + al = data.byte(kFacing); + _cmp(al, data.byte(kTurntoface)); + if (!flags.z()) goto middleofwalk; - context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (!flags.z()) goto notblock; - context.bl = context.data.byte(kManspath); - context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) + bl = data.byte(kManspath); + _cmp(bl, data.byte(kPointerspath)); + if (!flags.z()) goto dontcheck; - context.cl = context.data.byte(kRyanx); - context._add(context.cl, 12); - context.ch = context.data.byte(kRyany); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) + cl = data.byte(kRyanx); + _add(cl, 12); + ch = data.byte(kRyany); + _add(ch, 12); + checkone(); + _cmp(cl, 2); + if (flags.c()) goto isblock; dontcheck: - getflagunderp(context); - context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) + getflagunderp(); + _cmp(data.byte(kLastflag), 2); + if (flags.c()) goto isblock; - context._cmp(context.data.byte(kLastflag), 128); - if (!context.flags.c()) + _cmp(data.byte(kLastflag), 128); + if (!flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(kManspath); - context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) + bl = data.byte(kManspath); + _cmp(bl, data.byte(kPointerspath)); + if (!flags.z()) goto toofaraway; - context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (flags.z()) goto isblock; - context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 5); + if (flags.z()) goto isaperson; - examineobtext(context); + examineobtext(); return; middleofwalk: - blocknametext(context); + blocknametext(); return; isblock: - blocknametext(context); + blocknametext(); return; isaperson: - personnametext(context); + personnametext(); return; toofaraway: - walktotext(context); + walktotext(); } -void mainscreen(Context &context) { - STACK_CHECK(context); - context.data.byte(kInmaparea) = 0; - context.bx = 5122; - context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) +void DreamGenContext::mainscreen() { + STACK_CHECK; + data.byte(kInmaparea) = 0; + bx = 5122; + _cmp(data.byte(kWatchon), 1); + if (flags.z()) goto checkmain; - context.bx = 5184; + bx = 5184; checkmain: - checkcoords(context); - context._cmp(context.data.byte(kWalkandexam), 0); - if (context.flags.z()) + checkcoords(); + _cmp(data.byte(kWalkandexam), 0); + if (flags.z()) return /* (finishmain) */; - walkandexamine(context); -} - -void madmanrun(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 14); - if (!context.flags.z()) - { identifyob(context); return; }; - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) - { identifyob(context); return; }; - context._cmp(context.data.byte(kPointermode), 2); - if (!context.flags.z()) - { identifyob(context); return; }; - context._cmp(context.data.byte(kMadmanflag), 0); - if (!context.flags.z()) - { identifyob(context); return; }; - context._cmp(context.data.byte(kCommandtype), 211); - if (context.flags.z()) + 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; - context.data.byte(kCommandtype) = 211; - context.al = 52; - commandonly(context); + data.byte(kCommandtype) = 211; + al = 52; + commandonly(); alreadyrun: - context._cmp(context.data.word(kMousebutton), 1); - if (!context.flags.z()) + _cmp(data.word(kMousebutton), 1); + if (!flags.z()) return /* (norun) */; - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, context.data.word(kOldbutton)); - if (context.flags.z()) + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) return /* (norun) */; - context.data.byte(kLastweapon) = 8; + data.byte(kLastweapon) = 8; } -void checkcoords(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNewlocation), 255); - if (context.flags.z()) +void DreamGenContext::checkcoords() { + STACK_CHECK; + _cmp(data.byte(kNewlocation), 255); + if (flags.z()) goto loop048; return; loop048: - context.ax = context.cs.word(context.bx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + ax = cs.word(bx); + _cmp(ax, 0x0ffff); + if (flags.z()) return /* (nonefound) */; - context.push(context.bx); - context._cmp(context.data.word(kMousex), context.ax); - if (context.flags.l()) + push(bx); + _cmp(data.word(kMousex), ax); + if (flags.l()) goto over045; - context.ax = context.cs.word(context.bx+2); - context._cmp(context.data.word(kMousex), context.ax); - if (!context.flags.l()) + ax = cs.word(bx+2); + _cmp(data.word(kMousex), ax); + if (!flags.l()) goto over045; - context.ax = context.cs.word(context.bx+4); - context._cmp(context.data.word(kMousey), context.ax); - if (context.flags.l()) + ax = cs.word(bx+4); + _cmp(data.word(kMousey), ax); + if (flags.l()) goto over045; - context.ax = context.cs.word(context.bx+6); - context._cmp(context.data.word(kMousey), context.ax); - if (!context.flags.l()) + ax = cs.word(bx+6); + _cmp(data.word(kMousey), ax); + if (!flags.l()) goto over045; - context.ax = context.cs.word(context.bx+8); - __dispatch_call(context, context.ax); - context.ax = context.pop(); + ax = cs.word(bx+8); + __dispatch_call(ax); + ax = pop(); return; over045: - context.bx = context.pop(); - context._add(context.bx, 10); + bx = pop(); + _add(bx, 10); goto loop048; } -void identifyob(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) - { blank(context); return; }; - context.ax = context.data.word(kMousex); - context._sub(context.ax, context.data.word(kMapadx)); - context._cmp(context.ax, 22*8); - if (context.flags.c()) +void DreamGenContext::identifyob() { + STACK_CHECK; + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) + { blank(); return; }; + ax = data.word(kMousex); + _sub(ax, data.word(kMapadx)); + _cmp(ax, 22*8); + if (flags.c()) goto notover1; - blank(context); + blank(); return; notover1: - context.bx = context.data.word(kMousey); - context._sub(context.bx, context.data.word(kMapady)); - context._cmp(context.bx, 20*8); - if (context.flags.c()) + bx = data.word(kMousey); + _sub(bx, data.word(kMapady)); + _cmp(bx, 20*8); + if (flags.c()) goto notover2; - blank(context); + blank(); return; notover2: - context.data.byte(kInmaparea) = 1; - context.ah = context.bl; - context.push(context.ax); - findpathofpoint(context); - context.data.byte(kPointerspath) = context.dl; - context.ax = context.pop(); - context.push(context.ax); - findfirstpath(context); - context.data.byte(kPointerfirstpath) = context.al; - context.ax = context.pop(); - checkifex(context); - if (!context.flags.z()) + data.byte(kInmaparea) = 1; + ah = bl; + push(ax); + findpathofpoint(); + data.byte(kPointerspath) = dl; + ax = pop(); + push(ax); + findfirstpath(); + data.byte(kPointerfirstpath) = al; + ax = pop(); + checkifex(); + if (!flags.z()) return /* (finishidentify) */; - checkiffree(context); - if (!context.flags.z()) + checkiffree(); + if (!flags.z()) return /* (finishidentify) */; - checkifperson(context); - if (!context.flags.z()) + checkifperson(); + if (!flags.z()) return /* (finishidentify) */; - checkifset(context); - if (!context.flags.z()) + checkifset(); + if (!flags.z()) return /* (finishidentify) */; - context.ax = context.data.word(kMousex); - context._sub(context.ax, context.data.word(kMapadx)); - context.cl = context.al; - context.ax = context.data.word(kMousey); - context._sub(context.ax, context.data.word(kMapady)); - context.ch = context.al; - checkone(context); - context._cmp(context.al, 0); - if (context.flags.z()) + ax = data.word(kMousex); + _sub(ax, data.word(kMapadx)); + cl = al; + ax = data.word(kMousey); + _sub(ax, data.word(kMapady)); + ch = al; + checkone(); + _cmp(al, 0); + if (flags.z()) goto nothingund; - context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) + _cmp(data.byte(kMandead), 1); + if (flags.z()) goto nothingund; - context.ah = 3; - obname(context); + ah = 3; + obname(); return; nothingund: - blank(context); + blank(); } -void checkifperson(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); - context.cx = 12; +void DreamGenContext::checkifperson() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + cx = 12; identifyreel: - context.push(context.cx); - context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) + push(cx); + _cmp(es.byte(bx+4), 255); + if (flags.z()) goto notareelid; - context.push(context.es); - context.push(context.bx); - context.push(context.ax); - context.ax = context.es.word(context.bx+0); - context.data.word(kReelpointer) = context.ax; - getreelstart(context); - context._cmp(context.es.word(context.si+2), 0x0ffff); - if (!context.flags.z()) + push(es); + push(bx); + push(ax); + ax = es.word(bx+0); + data.word(kReelpointer) = ax; + getreelstart(); + _cmp(es.word(si+2), 0x0ffff); + if (!flags.z()) goto notblankpers; - context._add(context.si, 5); + _add(si, 5); notblankpers: - context.cx = context.es.word(context.si+2); - context.ax = context.es.word(context.si+0); - context.push(context.cx); - getreelframeax(context); - context.cx = context.pop(); - context._add(context.cl, context.es.byte(context.bx+4)); - context._add(context.ch, context.es.byte(context.bx+5)); - context.dx = context.cx; - context._add(context.dl, context.es.byte(context.bx+0)); - context._add(context.dh, context.es.byte(context.bx+1)); - context.ax = context.pop(); - context.bx = context.pop(); - context.es = context.pop(); - context._cmp(context.al, context.cl); - if (context.flags.c()) + cx = es.word(si+2); + ax = es.word(si+0); + push(cx); + getreelframeax(); + cx = pop(); + _add(cl, es.byte(bx+4)); + _add(ch, es.byte(bx+5)); + dx = cx; + _add(dl, es.byte(bx+0)); + _add(dh, es.byte(bx+1)); + ax = pop(); + bx = pop(); + es = pop(); + _cmp(al, cl); + if (flags.c()) goto notareelid; - context._cmp(context.ah, context.ch); - if (context.flags.c()) + _cmp(ah, ch); + if (flags.c()) goto notareelid; - context._cmp(context.al, context.dl); - if (!context.flags.c()) + _cmp(al, dl); + if (!flags.c()) goto notareelid; - context._cmp(context.ah, context.dh); - if (!context.flags.c()) + _cmp(ah, dh); + if (!flags.c()) goto notareelid; - context.cx = context.pop(); - context.ax = context.es.word(context.bx+2); - context.data.word(kPersondata) = context.ax; - context.al = context.es.byte(context.bx+4); - context.ah = 5; - obname(context); - context.al = 0; - context._cmp(context.al, 1); + cx = pop(); + ax = es.word(bx+2); + data.word(kPersondata) = ax; + al = es.byte(bx+4); + ah = 5; + obname(); + al = 0; + _cmp(al, 1); return; notareelid: - context.cx = context.pop(); - context._add(context.bx, 5); - context._dec(context.cx); - if (!context.flags.z()) + cx = pop(); + _add(bx, 5); + _dec(cx); + if (!flags.z()) goto identifyreel; } -void checkifset(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); - context.cx = 127; +void DreamGenContext::checkifset() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); + cx = 127; identifyset: - context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) + _cmp(es.byte(bx+4), 255); + if (flags.z()) goto notasetid; - context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) + _cmp(al, es.byte(bx)); + if (flags.c()) goto notasetid; - context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) + _cmp(al, es.byte(bx+2)); + if (!flags.c()) goto notasetid; - context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) + _cmp(ah, es.byte(bx+1)); + if (flags.c()) goto notasetid; - context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) + _cmp(ah, es.byte(bx+3)); + if (!flags.c()) goto notasetid; - pixelcheckset(context); - if (context.flags.z()) + pixelcheckset(); + if (flags.z()) goto notasetid; - isitdescribed(context); - if (context.flags.z()) + isitdescribed(); + if (flags.z()) goto notasetid; - context.al = context.es.byte(context.bx+4); - context.ah = 1; - obname(context); - context.al = 0; - context._cmp(context.al, 1); + al = es.byte(bx+4); + ah = 1; + obname(); + al = 0; + _cmp(al, 1); return; notasetid: - context._sub(context.bx, 5); - context._dec(context.cx); - context._cmp(context.cx, -1); - if (!context.flags.z()) + _sub(bx, 5); + _dec(cx); + _cmp(cx, -1); + if (!flags.z()) goto identifyset; } -void checkifex(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); - context.cx = 99; +void DreamGenContext::checkifex() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); + cx = 99; identifyex: - context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) + _cmp(es.byte(bx+4), 255); + if (flags.z()) goto notanexid; - context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) + _cmp(al, es.byte(bx)); + if (flags.c()) goto notanexid; - context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) + _cmp(al, es.byte(bx+2)); + if (!flags.c()) goto notanexid; - context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) + _cmp(ah, es.byte(bx+1)); + if (flags.c()) goto notanexid; - context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) + _cmp(ah, es.byte(bx+3)); + if (!flags.c()) goto notanexid; - context.al = context.es.byte(context.bx+4); - context.ah = 4; - obname(context); - context.al = 1; - context._cmp(context.al, 0); + al = es.byte(bx+4); + ah = 4; + obname(); + al = 1; + _cmp(al, 0); return; notanexid: - context._sub(context.bx, 5); - context._dec(context.cx); - context._cmp(context.cx, -1); - if (!context.flags.z()) + _sub(bx, 5); + _dec(cx); + _cmp(cx, -1); + if (!flags.z()) goto identifyex; } -void checkiffree(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBuffers); - context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); - context.cx = 79; +void DreamGenContext::checkiffree() { + STACK_CHECK; + es = data.word(kBuffers); + bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); + cx = 79; identifyfree: - context._cmp(context.es.byte(context.bx+4), 255); - if (context.flags.z()) + _cmp(es.byte(bx+4), 255); + if (flags.z()) goto notafreeid; - context._cmp(context.al, context.es.byte(context.bx)); - if (context.flags.c()) + _cmp(al, es.byte(bx)); + if (flags.c()) goto notafreeid; - context._cmp(context.al, context.es.byte(context.bx+2)); - if (!context.flags.c()) + _cmp(al, es.byte(bx+2)); + if (!flags.c()) goto notafreeid; - context._cmp(context.ah, context.es.byte(context.bx+1)); - if (context.flags.c()) + _cmp(ah, es.byte(bx+1)); + if (flags.c()) goto notafreeid; - context._cmp(context.ah, context.es.byte(context.bx+3)); - if (!context.flags.c()) + _cmp(ah, es.byte(bx+3)); + if (!flags.c()) goto notafreeid; - context.al = context.es.byte(context.bx+4); - context.ah = 2; - obname(context); - context.al = 0; - context._cmp(context.al, 1); + al = es.byte(bx+4); + ah = 2; + obname(); + al = 0; + _cmp(al, 1); return; notafreeid: - context._sub(context.bx, 5); - context._dec(context.cx); - context._cmp(context.cx, -1); - if (!context.flags.z()) + _sub(bx, 5); + _dec(cx); + _cmp(cx, -1); + if (!flags.z()) goto identifyfree; } -void isitdescribed(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.cx); - context.push(context.es); - context.push(context.bx); - context.al = context.es.byte(context.bx+4); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kSetdesc); - context._add(context.bx, (0)); - context.ax = context.es.word(context.bx); - context._add(context.ax, (0+(130*2))); - context.bx = context.ax; - context.dl = context.es.byte(context.bx); - context.bx = context.pop(); - context.es = context.pop(); - context.cx = context.pop(); - context.ax = context.pop(); - context._cmp(context.dl, 0); -} - -void findpathofpoint(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.bx = (0); - context.es = context.data.word(kReels); - context.al = context.data.byte(kRoomnum); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.cx = context.pop(); - context.dl = 0; +void DreamGenContext::isitdescribed() { + STACK_CHECK; + push(ax); + push(cx); + push(es); + push(bx); + al = es.byte(bx+4); + ah = 0; + _add(ax, ax); + bx = ax; + es = data.word(kSetdesc); + _add(bx, (0)); + ax = es.word(bx); + _add(ax, (0+(130*2))); + bx = ax; + dl = es.byte(bx); + bx = pop(); + es = pop(); + cx = pop(); + ax = pop(); + _cmp(dl, 0); +} + +void DreamGenContext::findpathofpoint() { + STACK_CHECK; + push(ax); + bx = (0); + es = data.word(kReels); + al = data.byte(kRoomnum); + ah = 0; + cx = 144; + _mul(cx); + _add(bx, ax); + cx = pop(); + dl = 0; pathloop: - context.al = context.es.byte(context.bx+6); - context._cmp(context.al, 255); - if (!context.flags.z()) + al = es.byte(bx+6); + _cmp(al, 255); + if (!flags.z()) goto flunkedit; - context.ax = context.es.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + ax = es.word(bx+2); + _cmp(ax, 0x0ffff); + if (flags.z()) goto flunkedit; - context._cmp(context.cl, context.al); - if (context.flags.c()) + _cmp(cl, al); + if (flags.c()) goto flunkedit; - context._cmp(context.ch, context.ah); - if (context.flags.c()) + _cmp(ch, ah); + if (flags.c()) goto flunkedit; - context.ax = context.es.word(context.bx+4); - context._cmp(context.cl, context.al); - if (!context.flags.c()) + ax = es.word(bx+4); + _cmp(cl, al); + if (!flags.c()) goto flunkedit; - context._cmp(context.ch, context.ah); - if (!context.flags.c()) + _cmp(ch, ah); + if (!flags.c()) goto flunkedit; return /* (gotvalidpath) */; flunkedit: - context._add(context.bx, 8); - context._inc(context.dl); - context._cmp(context.dl, 12); - if (!context.flags.z()) + _add(bx, 8); + _inc(dl); + _cmp(dl, 12); + if (!flags.z()) goto pathloop; - context.dl = 255; -} - -void findfirstpath(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.bx = (0); - context.es = context.data.word(kReels); - context.al = context.data.byte(kRoomnum); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context._add(context.bx, context.ax); - context.cx = context.pop(); - context.dl = 0; + dl = 255; +} + +void DreamGenContext::findfirstpath() { + STACK_CHECK; + push(ax); + bx = (0); + es = data.word(kReels); + al = data.byte(kRoomnum); + ah = 0; + cx = 144; + _mul(cx); + _add(bx, ax); + cx = pop(); + dl = 0; fpathloop: - context.ax = context.es.word(context.bx+2); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + ax = es.word(bx+2); + _cmp(ax, 0x0ffff); + if (flags.z()) goto nofirst; - context._cmp(context.cl, context.al); - if (context.flags.c()) + _cmp(cl, al); + if (flags.c()) goto nofirst; - context._cmp(context.ch, context.ah); - if (context.flags.c()) + _cmp(ch, ah); + if (flags.c()) goto nofirst; - context.ax = context.es.word(context.bx+4); - context._cmp(context.cl, context.al); - if (!context.flags.c()) + ax = es.word(bx+4); + _cmp(cl, al); + if (!flags.c()) goto nofirst; - context._cmp(context.ch, context.ah); - if (!context.flags.c()) + _cmp(ch, ah); + if (!flags.c()) goto nofirst; goto gotfirst; nofirst: - context._add(context.bx, 8); - context._inc(context.dl); - context._cmp(context.dl, 12); - if (!context.flags.z()) + _add(bx, 8); + _inc(dl); + _cmp(dl, 12); + if (!flags.z()) goto fpathloop; - context.al = 0; + al = 0; return; gotfirst: - context.al = context.es.byte(context.bx+6); -} - -void turnpathon(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.cl = 255; - context.ch = context.data.byte(kRoomnum); - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - getroomspaths(context); - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) + al = es.byte(bx+6); +} + +void DreamGenContext::turnpathon() { + STACK_CHECK; + push(ax); + push(ax); + cl = 255; + ch = data.byte(kRoomnum); + _add(ch, 100); + findormake(); + ax = pop(); + getroomspaths(); + ax = pop(); + _cmp(al, 255); + if (flags.z()) return /* (nopathon) */; - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 255; - context.es.byte(context.bx+6) = context.al; -} - -void turnpathoff(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.cl = 0; - context.ch = context.data.byte(kRoomnum); - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - getroomspaths(context); - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = 255; + es.byte(bx+6) = al; +} + +void DreamGenContext::turnpathoff() { + STACK_CHECK; + push(ax); + push(ax); + cl = 0; + ch = data.byte(kRoomnum); + _add(ch, 100); + findormake(); + ax = pop(); + getroomspaths(); + ax = pop(); + _cmp(al, 255); + if (flags.z()) return /* (nopathoff) */; - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.es.byte(context.bx+6) = context.al; -} - -void turnanypathon(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.cl = 255; - context.ch = context.ah; - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - context.al = context.ah; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(kReels); - context.bx = (0); - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 255; - context.es.byte(context.bx+6) = context.al; -} - -void turnanypathoff(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.cl = 0; - context.ch = context.ah; - context._add(context.ch, 100); - findormake(context); - context.ax = context.pop(); - context.al = context.ah; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(kReels); - context.bx = (0); - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.es.byte(context.bx+6) = context.al; -} - -void checkifpathison(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - getroomspaths(context); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx+6); - context._cmp(context.al, 255); -} - -void afternewroom(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNowinnewroom), 0); - if (context.flags.z()) + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = 0; + es.byte(bx+6) = al; +} + +void DreamGenContext::turnanypathon() { + STACK_CHECK; + push(ax); + push(ax); + cl = 255; + ch = ah; + _add(ch, 100); + findormake(); + ax = pop(); + al = ah; + 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 = 255; + es.byte(bx+6) = al; +} + +void DreamGenContext::turnanypathoff() { + STACK_CHECK; + push(ax); + push(ax); + cl = 0; + ch = ah; + _add(ch, 100); + findormake(); + ax = pop(); + al = ah; + 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::checkifpathison() { + STACK_CHECK; + push(ax); + getroomspaths(); + ax = pop(); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = es.byte(bx+6); + _cmp(al, 255); +} + +void DreamGenContext::afternewroom() { + STACK_CHECK; + _cmp(data.byte(kNowinnewroom), 0); + if (flags.z()) return /* (notnew) */; - context.data.word(kTimecount) = 0; - createpanel(context); - context.data.byte(kCommandtype) = 0; - findroominloc(context); - context._cmp(context.data.byte(kRyanon), 1); - if (context.flags.z()) + data.word(kTimecount) = 0; + createpanel(); + data.byte(kCommandtype) = 0; + findroominloc(); + _cmp(data.byte(kRyanon), 1); + if (flags.z()) goto ryansoff; - context.al = context.data.byte(kRyanx); - context._add(context.al, 12); - context.ah = context.data.byte(kRyany); - context._add(context.ah, 12); - findpathofpoint(context); - context.data.byte(kManspath) = context.dl; - findxyfrompath(context); - context.data.byte(kResetmanxy) = 1; + 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: - context.data.byte(kNewobs) = 1; - drawfloor(context); - context.data.word(kLookcounter) = 160; - context.data.byte(kNowinnewroom) = 0; - showicon(context); - spriteupdate(context); - printsprites(context); - undertextline(context); - reelsonscreen(context); - mainscreen(context); - getunderzoom(context); - zoom(context); - worktoscreenm(context); - walkintoroom(context); - reminders(context); - atmospheres(context); -} - -void atmospheres(Context &context) { - STACK_CHECK(context); - context.cl = context.data.byte(kMapx); - context.ch = context.data.byte(kMapy); - context.bx = 5246; + 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 = 5246; nextatmos: - context.al = context.cs.byte(context.bx); - context._cmp(context.al, 255); - if (context.flags.z()) + al = cs.byte(bx); + _cmp(al, 255); + if (flags.z()) goto nomoreatmos; - context._cmp(context.al, context.data.byte(kReallocation)); - if (!context.flags.z()) + _cmp(al, data.byte(kReallocation)); + if (!flags.z()) goto wrongatmos; - context.ax = context.cs.word(context.bx+1); - context._cmp(context.ax, context.cx); - if (!context.flags.z()) + ax = cs.word(bx+1); + _cmp(ax, cx); + if (!flags.z()) goto wrongatmos; - context.ax = context.cs.word(context.bx+3); - context._cmp(context.al, context.data.byte(kCh0playing)); - if (context.flags.z()) + ax = cs.word(bx+3); + _cmp(al, data.byte(kCh0playing)); + if (flags.z()) goto playingalready; - context._cmp(context.data.byte(kLocation), 45); - if (!context.flags.z()) + _cmp(data.byte(kLocation), 45); + if (!flags.z()) goto notweb; - context._cmp(context.data.word(kReeltowatch), 45); - if (context.flags.z()) + _cmp(data.word(kReeltowatch), 45); + if (flags.z()) goto wrongatmos; notweb: - playchannel0(context); - context._cmp(context.data.byte(kReallocation), 2); - context._cmp(context.data.byte(kMapy), 0); - if (context.flags.z()) + playchannel0(); + _cmp(data.byte(kReallocation), 2); + _cmp(data.byte(kMapy), 0); + if (flags.z()) goto fullvol; - if (!context.flags.z()) + if (!flags.z()) goto notlouisvol; - context._cmp(context.data.byte(kMapy), 10); - if (!context.flags.z()) + _cmp(data.byte(kMapy), 10); + if (!flags.z()) goto notlouisvol; - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (!flags.z()) goto notlouisvol; - context.data.byte(kVolume) = 5; + data.byte(kVolume) = 5; notlouisvol: - context._cmp(context.data.byte(kReallocation), 14); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 14); + if (!flags.z()) goto notmad1; - context._cmp(context.data.byte(kMapx), 33); - if (context.flags.z()) + _cmp(data.byte(kMapx), 33); + if (flags.z()) goto ismad2; - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (!flags.z()) goto notmad1; - context.data.byte(kVolume) = 5; + data.byte(kVolume) = 5; return; ismad2: - context.data.byte(kVolume) = 0; + data.byte(kVolume) = 0; return; notmad1: playingalready: - context._cmp(context.data.byte(kReallocation), 2); - if (!context.flags.z()) + _cmp(data.byte(kReallocation), 2); + if (!flags.z()) return /* (notlouisvol2) */; - context._cmp(context.data.byte(kMapx), 22); - if (context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (flags.z()) goto louisvol; - context._cmp(context.data.byte(kMapx), 11); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 11); + if (!flags.z()) return /* (notlouisvol2) */; fullvol: - context.data.byte(kVolume) = 0; + data.byte(kVolume) = 0; return; louisvol: - context.data.byte(kVolume) = 5; + data.byte(kVolume) = 5; return; wrongatmos: - context._add(context.bx, 5); + _add(bx, 5); goto nextatmos; nomoreatmos: - cancelch0(context); + cancelch0(); } -void walkintoroom(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLocation), 14); - if (!context.flags.z()) +void DreamGenContext::walkintoroom() { + STACK_CHECK; + _cmp(data.byte(kLocation), 14); + if (!flags.z()) return /* (notlair) */; - context._cmp(context.data.byte(kMapx), 22); - if (!context.flags.z()) + _cmp(data.byte(kMapx), 22); + if (!flags.z()) return /* (notlair) */; - context.data.byte(kDestination) = 1; - context.data.byte(kFinaldest) = 1; - autosetwalk(context); + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autosetwalk(); } -void afterintroroom(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNowinnewroom), 0); - if (context.flags.z()) +void DreamGenContext::afterintroroom() { + STACK_CHECK; + _cmp(data.byte(kNowinnewroom), 0); + if (flags.z()) return /* (notnewintro) */; - clearwork(context); - findroominloc(context); - context.data.byte(kNewobs) = 1; - drawfloor(context); - reelsonscreen(context); - spriteupdate(context); - printsprites(context); - worktoscreen(context); - context.data.byte(kNowinnewroom) = 0; -} - -void obname(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReasseschanges), 0); - if (context.flags.z()) + clearwork(); + findroominloc(); + data.byte(kNewobs) = 1; + drawfloor(); + reelsonscreen(); + spriteupdate(); + printsprites(); + worktoscreen(); + data.byte(kNowinnewroom) = 0; +} + +void DreamGenContext::obname() { + STACK_CHECK; + _cmp(data.byte(kReasseschanges), 0); + if (flags.z()) goto notnewpath; - context.data.byte(kReasseschanges) = 0; + data.byte(kReasseschanges) = 0; goto diff; notnewpath: - context._cmp(context.ah, context.data.byte(kCommandtype)); - if (context.flags.z()) + _cmp(ah, data.byte(kCommandtype)); + if (flags.z()) goto notdiffob; goto diff; notdiffob: - context._cmp(context.al, context.data.byte(kCommand)); - if (!context.flags.z()) + _cmp(al, data.byte(kCommand)); + if (!flags.z()) goto diff; - context._cmp(context.data.byte(kWalkandexam), 1); - if (context.flags.z()) + _cmp(data.byte(kWalkandexam), 1); + if (flags.z()) goto walkandexamine; - context._cmp(context.data.word(kMousebutton), 0); - if (context.flags.z()) + _cmp(data.word(kMousebutton), 0); + if (flags.z()) return /* (noobselect) */; - context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (!flags.z()) goto isntblock; - context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) + _cmp(data.byte(kLastflag), 2); + if (flags.c()) return /* (noobselect) */; isntblock: - context.bl = context.data.byte(kManspath); - context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) + bl = data.byte(kManspath); + _cmp(bl, data.byte(kPointerspath)); + if (!flags.z()) goto wantstowalk; - context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (flags.z()) goto wantstowalk; - finishedwalking(context); - if (!context.flags.z()) + finishedwalking(); + if (!flags.z()) return /* (noobselect) */; - context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 5); + if (flags.z()) goto wantstotalk; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) return /* (noobselect) */; - examineob(context); + examineob(); return; wantstotalk: - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) return /* (noobselect) */; - talk(context); + talk(); return; walkandexamine: - finishedwalking(context); - if (!context.flags.z()) + finishedwalking(); + if (!flags.z()) return /* (noobselect) */; - context.al = context.data.byte(kWalkexamtype); - context.data.byte(kCommandtype) = context.al; - context.al = context.data.byte(kWalkexamnum); - context.data.byte(kCommand) = context.al; - context.data.byte(kWalkandexam) = 0; - context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) + al = data.byte(kWalkexamtype); + data.byte(kCommandtype) = al; + al = data.byte(kWalkexamnum); + data.byte(kCommand) = al; + data.byte(kWalkandexam) = 0; + _cmp(data.byte(kCommandtype), 5); + if (flags.z()) return /* (noobselect) */; - examineob(context); + examineob(); return; wantstowalk: - setwalk(context); - context.data.byte(kReasseschanges) = 1; + setwalk(); + data.byte(kReasseschanges) = 1; return; diff: - context.data.byte(kCommand) = context.al; - context.data.byte(kCommandtype) = context.ah; - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + data.byte(kCommand) = al; + data.byte(kCommandtype) = ah; + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto middleofwalk; - context._cmp(context.data.word(kWatchingtime), 0); - if (!context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (!flags.z()) goto middleofwalk; - context.al = context.data.byte(kFacing); - context._cmp(context.al, context.data.byte(kTurntoface)); - if (!context.flags.z()) + al = data.byte(kFacing); + _cmp(al, data.byte(kTurntoface)); + if (!flags.z()) goto middleofwalk; - context._cmp(context.data.byte(kCommandtype), 3); - if (!context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (!flags.z()) goto notblock; - context.bl = context.data.byte(kManspath); - context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) + bl = data.byte(kManspath); + _cmp(bl, data.byte(kPointerspath)); + if (!flags.z()) goto dontcheck; - context.cl = context.data.byte(kRyanx); - context._add(context.cl, 12); - context.ch = context.data.byte(kRyany); - context._add(context.ch, 12); - checkone(context); - context._cmp(context.cl, 2); - if (context.flags.c()) + cl = data.byte(kRyanx); + _add(cl, 12); + ch = data.byte(kRyany); + _add(ch, 12); + checkone(); + _cmp(cl, 2); + if (flags.c()) goto isblock; dontcheck: - getflagunderp(context); - context._cmp(context.data.byte(kLastflag), 2); - if (context.flags.c()) + getflagunderp(); + _cmp(data.byte(kLastflag), 2); + if (flags.c()) goto isblock; - context._cmp(context.data.byte(kLastflag), 128); - if (!context.flags.c()) + _cmp(data.byte(kLastflag), 128); + if (!flags.c()) goto isblock; goto toofaraway; notblock: - context.bl = context.data.byte(kManspath); - context._cmp(context.bl, context.data.byte(kPointerspath)); - if (!context.flags.z()) + bl = data.byte(kManspath); + _cmp(bl, data.byte(kPointerspath)); + if (!flags.z()) goto toofaraway; - context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (flags.z()) goto isblock; - context._cmp(context.data.byte(kCommandtype), 5); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 5); + if (flags.z()) goto isaperson; - examineobtext(context); + examineobtext(); return; middleofwalk: - blocknametext(context); + blocknametext(); return; isblock: - blocknametext(context); + blocknametext(); return; isaperson: - personnametext(context); + personnametext(); return; toofaraway: - walktotext(context); + walktotext(); } -void finishedwalking(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) +void DreamGenContext::finishedwalking() { + STACK_CHECK; + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) return /* (iswalking) */; - context.al = context.data.byte(kFacing); - context._cmp(context.al, context.data.byte(kTurntoface)); -} - -void examineobtext(Context &context) { - STACK_CHECK(context); - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kCommandtype); - context.al = 1; - commandwithob(context); -} - -void commandwithob(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.es); - context.push(context.ds); - context.push(context.si); - context.push(context.di); - deltextline(context); - context.di = context.pop(); - context.si = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.push(context.bx); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kCommandtext); - context.ax = context.es.word(context.bx); - context._add(context.ax, (66*2)); - context.si = context.ax; - context.di = context.data.word(kTextaddressx); - context.bx = context.data.word(kTextaddressy); - context.dl = context.data.byte(kTextlen); - context.al = 0; - context.ah = 0; - printdirect(context); - context.ax = context.pop(); - context.di = 5847; - copyname(context); - context.ax = context.pop(); - context.di = context.data.word(kLastxpos); - context._cmp(context.al, 0); - if (context.flags.z()) + al = data.byte(kFacing); + _cmp(al, data.byte(kTurntoface)); +} + +void DreamGenContext::examineobtext() { + STACK_CHECK; + bl = data.byte(kCommand); + bh = data.byte(kCommandtype); + al = 1; + commandwithob(); +} + +void DreamGenContext::commandwithob() { + STACK_CHECK; + push(ax); + push(ax); + push(bx); + push(cx); + push(dx); + push(es); + push(ds); + push(si); + push(di); + deltextline(); + di = pop(); + si = pop(); + ds = pop(); + es = pop(); + dx = pop(); + cx = pop(); + bx = pop(); + ax = pop(); + push(bx); + ah = 0; + _add(ax, ax); + bx = ax; + es = data.word(kCommandtext); + ax = es.word(bx); + _add(ax, (66*2)); + si = ax; + di = data.word(kTextaddressx); + bx = data.word(kTextaddressy); + dl = data.byte(kTextlen); + al = 0; + ah = 0; + printdirect(); + ax = pop(); + di = 5847; + copyname(); + ax = pop(); + di = data.word(kLastxpos); + _cmp(al, 0); + if (flags.z()) goto noadd; - context._add(context.di, 5); + _add(di, 5); noadd: - context.bx = context.data.word(kTextaddressy); - context.es = context.cs; - context.si = 5847; - context.dl = context.data.byte(kTextlen); - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(kNewtextline) = 1; -} - -void commandonly(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.push(context.bx); - context.push(context.cx); - context.push(context.dx); - context.push(context.es); - context.push(context.ds); - context.push(context.si); - context.push(context.di); - deltextline(context); - context.di = context.pop(); - context.si = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); - context.dx = context.pop(); - context.cx = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kCommandtext); - context.ax = context.es.word(context.bx); - context._add(context.ax, (66*2)); - context.si = context.ax; - context.di = context.data.word(kTextaddressx); - context.bx = context.data.word(kTextaddressy); - context.dl = context.data.byte(kTextlen); - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.byte(kNewtextline) = 1; -} - -void printmessage(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.push(context.bx); - context.push(context.di); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kCommandtext); - context.ax = context.es.word(context.bx); - context._add(context.ax, (66*2)); - context.si = context.ax; - context.di = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); - context.al = 0; - context.ah = 0; - printdirect(context); -} - -void printmessage2(Context &context) { - STACK_CHECK(context); - context.push(context.dx); - context.push(context.bx); - context.push(context.di); - context.push(context.ax); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.es = context.data.word(kCommandtext); - context.ax = context.es.word(context.bx); - context._add(context.ax, (66*2)); - context.si = context.ax; - context.ax = context.pop(); + bx = data.word(kTextaddressy); + es = cs; + si = 5847; + dl = data.byte(kTextlen); + al = 0; + ah = 0; + printdirect(); + data.byte(kNewtextline) = 1; +} + +void DreamGenContext::commandonly() { + STACK_CHECK; + push(ax); + push(bx); + push(cx); + push(dx); + push(es); + push(ds); + push(si); + push(di); + deltextline(); + di = pop(); + si = pop(); + ds = pop(); + es = pop(); + dx = pop(); + cx = pop(); + bx = pop(); + ax = pop(); + ah = 0; + _add(ax, ax); + bx = ax; + es = data.word(kCommandtext); + ax = es.word(bx); + _add(ax, (66*2)); + si = ax; + di = data.word(kTextaddressx); + bx = data.word(kTextaddressy); + dl = data.byte(kTextlen); + al = 0; + ah = 0; + printdirect(); + data.byte(kNewtextline) = 1; +} + +void DreamGenContext::printmessage() { + STACK_CHECK; + push(dx); + push(bx); + push(di); + ah = 0; + _add(ax, ax); + bx = ax; + es = data.word(kCommandtext); + ax = es.word(bx); + _add(ax, (66*2)); + si = ax; + di = pop(); + bx = pop(); + dx = pop(); + al = 0; + ah = 0; + printdirect(); +} + +void DreamGenContext::printmessage2() { + STACK_CHECK; + push(dx); + push(bx); + push(di); + push(ax); + ah = 0; + _add(ax, ax); + bx = ax; + es = data.word(kCommandtext); + ax = es.word(bx); + _add(ax, (66*2)); + si = ax; + ax = pop(); searchmess: - context.push(context.ax); - findnextcolon(context); - context.ax = context.pop(); - context._dec(context.ah); - if (!context.flags.z()) + push(ax); + findnextcolon(); + ax = pop(); + _dec(ah); + if (!flags.z()) goto searchmess; - context.di = context.pop(); - context.bx = context.pop(); - context.dx = context.pop(); - context.al = 0; - context.ah = 0; - printdirect(context); -} - -void blocknametext(Context &context) { - STACK_CHECK(context); - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kCommandtype); - context.al = 0; - commandwithob(context); -} - -void personnametext(Context &context) { - STACK_CHECK(context); - context.bl = context.data.byte(kCommand); - context._and(context.bl, 127); - context.bh = context.data.byte(kCommandtype); - context.al = 2; - commandwithob(context); -} - -void walktotext(Context &context) { - STACK_CHECK(context); - context.bl = context.data.byte(kCommand); - context.bh = context.data.byte(kCommandtype); - context.al = 3; - commandwithob(context); -} - -void getflagunderp(Context &context) { - STACK_CHECK(context); - context.cx = context.data.word(kMousex); - context._sub(context.cx, context.data.word(kMapadx)); - context.ax = context.data.word(kMousey); - context._sub(context.ax, context.data.word(kMapady)); - context.ch = context.al; - checkone(context); - context.data.byte(kLastflag) = context.cl; - context.data.byte(kLastflagex) = context.ch; -} - -void setwalk(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kLinepointer), 254); - if (!context.flags.z()) + di = pop(); + bx = pop(); + dx = pop(); + al = 0; + ah = 0; + printdirect(); +} + +void DreamGenContext::blocknametext() { + STACK_CHECK; + bl = data.byte(kCommand); + bh = data.byte(kCommandtype); + al = 0; + commandwithob(); +} + +void DreamGenContext::personnametext() { + STACK_CHECK; + bl = data.byte(kCommand); + _and(bl, 127); + bh = data.byte(kCommandtype); + al = 2; + commandwithob(); +} + +void DreamGenContext::walktotext() { + STACK_CHECK; + bl = data.byte(kCommand); + bh = data.byte(kCommandtype); + al = 3; + commandwithob(); +} + +void DreamGenContext::getflagunderp() { + STACK_CHECK; + cx = data.word(kMousex); + _sub(cx, data.word(kMapadx)); + ax = data.word(kMousey); + _sub(ax, data.word(kMapady)); + ch = al; + checkone(); + data.byte(kLastflag) = cl; + data.byte(kLastflagex) = ch; +} + +void DreamGenContext::setwalk() { + STACK_CHECK; + _cmp(data.byte(kLinepointer), 254); + if (!flags.z()) goto alreadywalking; - context.al = context.data.byte(kPointerspath); - context._cmp(context.al, context.data.byte(kManspath)); - if (context.flags.z()) + al = data.byte(kPointerspath); + _cmp(al, data.byte(kManspath)); + if (flags.z()) goto cantwalk2; - context._cmp(context.data.byte(kWatchmode), 1); - if (context.flags.z()) + _cmp(data.byte(kWatchmode), 1); + if (flags.z()) goto holdingreel; - context._cmp(context.data.byte(kWatchmode), 2); - if (context.flags.z()) + _cmp(data.byte(kWatchmode), 2); + if (flags.z()) return /* (cantwalk) */; - context.data.byte(kDestination) = context.al; - context.data.byte(kFinaldest) = context.al; - context._cmp(context.data.word(kMousebutton), 2); - if (!context.flags.z()) + data.byte(kDestination) = al; + data.byte(kFinaldest) = al; + _cmp(data.word(kMousebutton), 2); + if (!flags.z()) goto notwalkandexam; - context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) + _cmp(data.byte(kCommandtype), 3); + if (flags.z()) goto notwalkandexam; - context.data.byte(kWalkandexam) = 1; - context.al = context.data.byte(kCommandtype); - context.data.byte(kWalkexamtype) = context.al; - context.al = context.data.byte(kCommand); - context.data.byte(kWalkexamnum) = context.al; + data.byte(kWalkandexam) = 1; + al = data.byte(kCommandtype); + data.byte(kWalkexamtype) = al; + al = data.byte(kCommand); + data.byte(kWalkexamnum) = al; notwalkandexam: - autosetwalk(context); + autosetwalk(); return; cantwalk2: - facerightway(context); + facerightway(); return; alreadywalking: - context.al = context.data.byte(kPointerspath); - context.data.byte(kFinaldest) = context.al; + al = data.byte(kPointerspath); + data.byte(kFinaldest) = al; return; holdingreel: - context.data.byte(kDestafterhold) = context.al; - context.data.byte(kWatchmode) = 2; + data.byte(kDestafterhold) = al; + data.byte(kWatchmode) = 2; } -void autosetwalk(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kManspath); - context._cmp(context.data.byte(kFinaldest), context.al); - if (!context.flags.z()) +void DreamGenContext::autosetwalk() { + STACK_CHECK; + al = data.byte(kManspath); + _cmp(data.byte(kFinaldest), al); + if (!flags.z()) goto notsamealready; return; notsamealready: - getroomspaths(context); - checkdest(context); - context.push(context.bx); - context.al = context.data.byte(kManspath); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(kLinestartx) = context.ax; - context.al = context.es.byte(context.bx+1); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(kLinestarty) = context.ax; - context.bx = context.pop(); - context.al = context.data.byte(kDestination); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = context.es.byte(context.bx); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(kLineendx) = context.ax; - context.al = context.es.byte(context.bx+1); - context.ah = 0; - context._sub(context.ax, 12); - context.data.word(kLineendy) = context.ax; - bresenhams(context); - context._cmp(context.data.byte(kLinedirection), 0); - if (context.flags.z()) + getroomspaths(); + checkdest(); + push(bx); + al = data.byte(kManspath); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = es.byte(bx); + ah = 0; + _sub(ax, 12); + data.word(kLinestartx) = ax; + al = es.byte(bx+1); + ah = 0; + _sub(ax, 12); + data.word(kLinestarty) = ax; + bx = pop(); + al = data.byte(kDestination); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + al = es.byte(bx); + ah = 0; + _sub(ax, 12); + data.word(kLineendx) = ax; + al = es.byte(bx+1); + ah = 0; + _sub(ax, 12); + data.word(kLineendy) = ax; + bresenhams(); + _cmp(data.byte(kLinedirection), 0); + if (flags.z()) goto normalline; - context.al = context.data.byte(kLinelength); - context._dec(context.al); - context.data.byte(kLinepointer) = context.al; - context.data.byte(kLinedirection) = 1; + al = data.byte(kLinelength); + _dec(al); + data.byte(kLinepointer) = al; + data.byte(kLinedirection) = 1; return; normalline: - context.data.byte(kLinepointer) = 0; -} - -void checkdest(Context &context) { - STACK_CHECK(context); - context.push(context.bx); - context._add(context.bx, 12*8); - context.ah = context.data.byte(kManspath); - context.cl = 4; - context._shl(context.ah, context.cl); - context.al = context.data.byte(kDestination); - context.cl = 24; - context.ch = context.data.byte(kDestination); + data.byte(kLinepointer) = 0; +} + +void DreamGenContext::checkdest() { + STACK_CHECK; + push(bx); + _add(bx, 12*8); + ah = data.byte(kManspath); + cl = 4; + _shl(ah, cl); + al = data.byte(kDestination); + cl = 24; + ch = data.byte(kDestination); checkdestloop: - context.dh = context.es.byte(context.bx); - context._and(context.dh, 0xf0); - context.dl = context.es.byte(context.bx); - context._and(context.dl, 0xf); - context._cmp(context.ax, context.dx); - if (!context.flags.z()) + dh = es.byte(bx); + _and(dh, 0xf0); + dl = es.byte(bx); + _and(dl, 0xf); + _cmp(ax, dx); + if (!flags.z()) goto nextcheck; - context.al = context.es.byte(context.bx+1); - context._and(context.al, 15); - context.data.byte(kDestination) = context.al; - context.bx = context.pop(); + al = es.byte(bx+1); + _and(al, 15); + data.byte(kDestination) = al; + bx = pop(); return; nextcheck: - context.dl = context.es.byte(context.bx); - context._and(context.dl, 0xf0); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context._shr(context.dl, 1); - context.dh = context.es.byte(context.bx); - context._and(context.dh, 0xf); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._shl(context.dh, 1); - context._cmp(context.ax, context.dx); - if (!context.flags.z()) + dl = es.byte(bx); + _and(dl, 0xf0); + _shr(dl, 1); + _shr(dl, 1); + _shr(dl, 1); + _shr(dl, 1); + dh = es.byte(bx); + _and(dh, 0xf); + _shl(dh, 1); + _shl(dh, 1); + _shl(dh, 1); + _shl(dh, 1); + _cmp(ax, dx); + if (!flags.z()) goto nextcheck2; - context.ch = context.es.byte(context.bx+1); - context._and(context.ch, 15); + ch = es.byte(bx+1); + _and(ch, 15); nextcheck2: - context._add(context.bx, 2); - context._dec(context.cl); - if (!context.flags.z()) + _add(bx, 2); + _dec(cl); + if (!flags.z()) goto checkdestloop; - context.data.byte(kDestination) = context.ch; - context.bx = context.pop(); -} - -void bresenhams(Context &context) { - STACK_CHECK(context); - workoutframes(context); - context.dx = context.data; - context.es = context.dx; - context.di = 8173; - context.si = 1; - context.data.byte(kLinedirection) = 0; - context.cx = context.data.word(kLineendx); - context._sub(context.cx, context.data.word(kLinestartx)); - if (context.flags.z()) + data.byte(kDestination) = ch; + bx = pop(); +} + +void DreamGenContext::bresenhams() { + STACK_CHECK; + workoutframes(); + dx = data; + es = dx; + di = 8173; + si = 1; + data.byte(kLinedirection) = 0; + cx = data.word(kLineendx); + _sub(cx, data.word(kLinestartx)); + if (flags.z()) goto vertline; - if (!context.flags.s()) + if (!flags.s()) goto line1; - context._neg(context.cx); - context.bx = context.data.word(kLineendx); - context._xchg(context.bx, context.data.word(kLinestartx)); - context.data.word(kLineendx) = context.bx; - context.bx = context.data.word(kLineendy); - context._xchg(context.bx, context.data.word(kLinestarty)); - context.data.word(kLineendy) = context.bx; - context.data.byte(kLinedirection) = 1; + _neg(cx); + bx = data.word(kLineendx); + _xchg(bx, data.word(kLinestartx)); + data.word(kLineendx) = bx; + bx = data.word(kLineendy); + _xchg(bx, data.word(kLinestarty)); + data.word(kLineendy) = bx; + data.byte(kLinedirection) = 1; line1: - context.bx = context.data.word(kLineendy); - context._sub(context.bx, context.data.word(kLinestarty)); - if (context.flags.z()) + bx = data.word(kLineendy); + _sub(bx, data.word(kLinestarty)); + if (flags.z()) goto horizline; - if (!context.flags.s()) + if (!flags.s()) goto line3; - context._neg(context.bx); - context._neg(context.si); + _neg(bx); + _neg(si); line3: - context.push(context.si); - context.data.byte(kLineroutine) = 0; - context._cmp(context.bx, context.cx); - if (context.flags.le()) + push(si); + data.byte(kLineroutine) = 0; + _cmp(bx, cx); + if (flags.le()) goto line4; - context.data.byte(kLineroutine) = 1; - context._xchg(context.bx, context.cx); + data.byte(kLineroutine) = 1; + _xchg(bx, cx); line4: - context._shl(context.bx, 1); - context.data.word(kIncrement1) = context.bx; - context._sub(context.bx, context.cx); - context.si = context.bx; - context._sub(context.bx, context.cx); - context.data.word(kIncrement2) = context.bx; - context.ax = context.data.word(kLinestartx); - context.bx = context.data.word(kLinestarty); - context.ah = context.bl; - context._inc(context.cx); - context.bx = context.pop(); - context._cmp(context.data.byte(kLineroutine), 1); - if (context.flags.z()) + _shl(bx, 1); + data.word(kIncrement1) = bx; + _sub(bx, cx); + si = bx; + _sub(bx, cx); + data.word(kIncrement2) = bx; + ax = data.word(kLinestartx); + bx = data.word(kLinestarty); + ah = bl; + _inc(cx); + bx = pop(); + _cmp(data.byte(kLineroutine), 1); + if (flags.z()) goto hislope; goto loslope; vertline: - context.ax = context.data.word(kLinestarty); - context.bx = context.data.word(kLineendy); - context.cx = context.bx; - context._sub(context.cx, context.ax); - if (!context.flags.l()) + ax = data.word(kLinestarty); + bx = data.word(kLineendy); + cx = bx; + _sub(cx, ax); + if (!flags.l()) goto line31; - context._neg(context.cx); - context.ax = context.bx; - context.data.byte(kLinedirection) = 1; + _neg(cx); + ax = bx; + data.byte(kLinedirection) = 1; line31: - context._inc(context.cx); - context.bx = context.data.word(kLinestartx); - context._xchg(context.ax, context.bx); - context.ah = context.bl; - context.bx = context.si; + _inc(cx); + bx = data.word(kLinestartx); + _xchg(ax, bx); + ah = bl; + bx = si; line32: - context._stosw(); - context._add(context.ah, context.bl); - if (--context.cx) + _stosw(); + _add(ah, bl); + if (--cx) goto line32; goto lineexit; horizline: - context.ax = context.data.word(kLinestartx); - context.bx = context.data.word(kLinestarty); - context.ah = context.bl; - context._inc(context.cx); + ax = data.word(kLinestartx); + bx = data.word(kLinestarty); + ah = bl; + _inc(cx); horizloop: - context._stosw(); - context._inc(context.al); - if (--context.cx) + _stosw(); + _inc(al); + if (--cx) goto horizloop; goto lineexit; loslope: loloop: - context._stosw(); - context._inc(context.al); - context._or(context.si, context.si); - if (!context.flags.s()) + _stosw(); + _inc(al); + _or(si, si); + if (!flags.s()) goto line12; - context._add(context.si, context.data.word(kIncrement1)); - if (--context.cx) + _add(si, data.word(kIncrement1)); + if (--cx) goto loloop; goto lineexit; line12: - context._add(context.si, context.data.word(kIncrement2)); - context._add(context.ah, context.bl); - if (--context.cx) + _add(si, data.word(kIncrement2)); + _add(ah, bl); + if (--cx) goto loloop; goto lineexit; hislope: hiloop: - context._stosw(); - context._add(context.ah, context.bl); - context._or(context.si, context.si); - if (!context.flags.s()) + _stosw(); + _add(ah, bl); + _or(si, si); + if (!flags.s()) goto line23; - context._add(context.si, context.data.word(kIncrement1)); - if (--context.cx) + _add(si, data.word(kIncrement1)); + if (--cx) goto hiloop; goto lineexit; line23: - context._add(context.si, context.data.word(kIncrement2)); - context._inc(context.al); - if (--context.cx) + _add(si, data.word(kIncrement2)); + _inc(al); + if (--cx) goto hiloop; lineexit: - context._sub(context.di, 8173); - context.ax = context.di; - context._shr(context.ax, 1); - context.data.byte(kLinelength) = context.al; -} - -void workoutframes(Context &context) { - STACK_CHECK(context); - context.bx = context.data.word(kLinestartx); - context._add(context.bx, 32); - context.ax = context.data.word(kLineendx); - context._add(context.ax, 32); - context._sub(context.bx, context.ax); - if (!context.flags.c()) + _sub(di, 8173); + ax = di; + _shr(ax, 1); + data.byte(kLinelength) = al; +} + +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; - context._neg(context.bx); + _neg(bx); notneg1: - context.cx = context.data.word(kLinestarty); - context._add(context.cx, 32); - context.ax = context.data.word(kLineendy); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) + cx = data.word(kLinestarty); + _add(cx, 32); + ax = data.word(kLineendy); + _add(ax, 32); + _sub(cx, ax); + if (!flags.c()) goto notneg2; - context._neg(context.cx); + _neg(cx); notneg2: - context._cmp(context.bx, context.cx); - if (!context.flags.c()) + _cmp(bx, cx); + if (!flags.c()) goto tendstohoriz; - context.dl = 2; - context.ax = context.cx; - context._shr(context.ax, 1); - context._cmp(context.bx, context.ax); - if (context.flags.c()) + dl = 2; + ax = cx; + _shr(ax, 1); + _cmp(bx, ax); + if (flags.c()) goto gotquad; - context.dl = 1; + dl = 1; goto gotquad; tendstohoriz: - context.dl = 0; - context.ax = context.bx; - context._shr(context.ax, 1); - context._cmp(context.cx, context.ax); - if (context.flags.c()) + dl = 0; + ax = bx; + _shr(ax, 1); + _cmp(cx, ax); + if (flags.c()) goto gotquad; - context.dl = 1; + dl = 1; goto gotquad; gotquad: - context.bx = context.data.word(kLinestartx); - context._add(context.bx, 32); - context.ax = context.data.word(kLineendx); - context._add(context.ax, 32); - context._sub(context.bx, context.ax); - if (context.flags.c()) + bx = data.word(kLinestartx); + _add(bx, 32); + ax = data.word(kLineendx); + _add(ax, 32); + _sub(bx, ax); + if (flags.c()) goto isinright; - context.cx = context.data.word(kLinestarty); - context._add(context.cx, 32); - context.ax = context.data.word(kLineendy); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) + cx = data.word(kLinestarty); + _add(cx, 32); + ax = data.word(kLineendy); + _add(ax, 32); + _sub(cx, ax); + if (!flags.c()) goto topleft; - context._cmp(context.dl, 1); - if (context.flags.z()) + _cmp(dl, 1); + if (flags.z()) goto noswap1; - context._xor(context.dl, 2); + _xor(dl, 2); noswap1: - context._add(context.dl, 4); + _add(dl, 4); goto success; topleft: - context._add(context.dl, 6); + _add(dl, 6); goto success; isinright: - context.cx = context.data.word(kLinestarty); - context._add(context.cx, 32); - context.ax = context.data.word(kLineendy); - context._add(context.ax, 32); - context._sub(context.cx, context.ax); - if (!context.flags.c()) + cx = data.word(kLinestarty); + _add(cx, 32); + ax = data.word(kLineendy); + _add(ax, 32); + _sub(cx, ax); + if (!flags.c()) goto botright; - context._add(context.dl, 2); + _add(dl, 2); goto success; botright: - context._cmp(context.dl, 1); - if (context.flags.z()) + _cmp(dl, 1); + if (flags.z()) goto noswap2; - context._xor(context.dl, 2); + _xor(dl, 2); noswap2: success: - context._and(context.dl, 7); - context.data.byte(kTurntoface) = context.dl; - context.data.byte(kTurndirection) = 0; -} - -void getroomspaths(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kRoomnum); - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(kReels); - context.bx = (0); - context._add(context.bx, context.ax); -} - -void copyname(Context &context) { - STACK_CHECK(context); - context.push(context.di); - findobname(context); - context.di = context.pop(); - context.es = context.cs; - context.cx = 28; + _and(dl, 7); + data.byte(kTurntoface) = dl; + data.byte(kTurndirection) = 0; +} + +void DreamGenContext::getroomspaths() { + STACK_CHECK; + al = data.byte(kRoomnum); + ah = 0; + cx = 144; + _mul(cx); + es = data.word(kReels); + bx = (0); + _add(bx, ax); +} + +void DreamGenContext::copyname() { + STACK_CHECK; + push(di); + findobname(); + di = pop(); + es = cs; + cx = 28; make: - context._lodsb(); - context._cmp(context.al, ':'); - if (context.flags.z()) + _lodsb(); + _cmp(al, ':'); + if (flags.z()) goto finishmakename; - context._cmp(context.al, 0); - if (context.flags.z()) + _cmp(al, 0); + if (flags.z()) goto finishmakename; - context._stosb(); - if (--context.cx) + _stosb(); + if (--cx) goto make; finishmakename: - context._inc(context.cx); - context.al = 0; - context._stosb(); - return; - context.al = 255; - context._stosb(context.cx); -} - -void findobname(Context &context) { - STACK_CHECK(context); - context.push(context.ax); - context.ah = 0; - context._add(context.ax, context.ax); - context.bx = context.ax; - context.ax = context.pop(); - context._cmp(context.ah, 5); - if (!context.flags.z()) + _inc(cx); + al = 0; + _stosb(); + return; + al = 255; + _stosb(cx); +} + +void DreamGenContext::findobname() { + STACK_CHECK; + push(ax); + ah = 0; + _add(ax, ax); + bx = ax; + ax = pop(); + _cmp(ah, 5); + if (!flags.z()) goto notpersonname; - context.push(context.ax); - context._and(context.al, 127); - context.ah = 0; - context.bx = 64*2; - context._mul(context.bx); - context.si = context.ax; - context.ds = context.data.word(kPeople); - context._add(context.si, (0+24)); - context.cx = (0+24+(1026*2)); - context.ax = context.ds.word(context.si); - context._add(context.ax, context.cx); - context.si = context.ax; - context.ax = context.pop(); + push(ax); + _and(al, 127); + ah = 0; + bx = 64*2; + _mul(bx); + si = ax; + ds = data.word(kPeople); + _add(si, (0+24)); + cx = (0+24+(1026*2)); + ax = ds.word(si); + _add(ax, cx); + si = ax; + ax = pop(); return; notpersonname: - context._cmp(context.ah, 4); - if (!context.flags.z()) + _cmp(ah, 4); + if (!flags.z()) goto notextraname; - context.ds = context.data.word(kExtras); - context._add(context.bx, (0+2080+30000+(16*114))); - context.ax = context.ds.word(context.bx); - context._add(context.ax, (0+2080+30000+(16*114)+((114+2)*2))); - context.si = context.ax; + ds = data.word(kExtras); + _add(bx, (0+2080+30000+(16*114))); + ax = ds.word(bx); + _add(ax, (0+2080+30000+(16*114)+((114+2)*2))); + si = ax; return; notextraname: - context._cmp(context.ah, 2); - if (!context.flags.z()) + _cmp(ah, 2); + if (!flags.z()) goto notfreename; - context.ds = context.data.word(kFreedesc); - context._add(context.bx, (0)); - context.ax = context.ds.word(context.bx); - context._add(context.ax, (0+(82*2))); - context.si = context.ax; + ds = data.word(kFreedesc); + _add(bx, (0)); + ax = ds.word(bx); + _add(ax, (0+(82*2))); + si = ax; return; notfreename: - context._cmp(context.ah, 1); - if (!context.flags.z()) + _cmp(ah, 1); + if (!flags.z()) goto notsetname; - context.ds = context.data.word(kSetdesc); - context._add(context.bx, (0)); - context.ax = context.ds.word(context.bx); - context._add(context.ax, (0+(130*2))); - context.si = context.ax; + ds = data.word(kSetdesc); + _add(bx, (0)); + ax = ds.word(bx); + _add(ax, (0+(130*2))); + si = ax; return; notsetname: - context.ds = context.data.word(kBlockdesc); - context._add(context.bx, (0)); - context.ax = context.ds.word(context.bx); - context._add(context.ax, (0+(98*2))); - context.si = context.ax; + ds = data.word(kBlockdesc); + _add(bx, (0)); + ax = ds.word(bx); + _add(ax, (0+(98*2))); + si = ax; } -void showicon(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kReallocation), 50); - if (!context.flags.c()) +void DreamGenContext::showicon() { + STACK_CHECK; + _cmp(data.byte(kReallocation), 50); + if (!flags.c()) goto isdream1; - showpanel(context); - showman(context); - roomname(context); - panelicons1(context); - zoomicon(context); + showpanel(); + showman(); + roomname(); + panelicons1(); + zoomicon(); return; isdream1: - context.ds = context.data.word(kTempsprites); - context.di = 72; - context.bx = 2; - context.al = 45; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 72+47; - context.bx = 2; - context.al = 46; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 69-10; - context.bx = 21; - context.al = 49; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 160+88; - context.bx = 2; - context.al = 45; - context.ah = 4; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 160+43; - context.bx = 2; - context.al = 46; - context.ah = 4; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 160+101; - context.bx = 21; - context.al = 49; - context.ah = 4; - showframe(context); - middlepanel(context); -} - -void middlepanel(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kTempsprites); - context.di = 72+47+20; - context.bx = 0; - context.al = 48; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 72+19; - context.bx = 21; - context.al = 47; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 160+23; - context.bx = 0; - context.al = 48; - context.ah = 4; - showframe(context); - context.ds = context.data.word(kTempsprites); - context.di = 160+71; - context.bx = 21; - context.al = 47; - context.ah = 4; - showframe(context); -} - -void showman(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kIcons1); - context.di = 0; - context.bx = 0; - context.al = 0; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kIcons1); - context.di = 0; - context.bx = 114; - context.al = 1; - context.ah = 0; - showframe(context); - context._cmp(context.data.byte(kShadeson), 0); - if (context.flags.z()) + 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) */; - context.ds = context.data.word(kIcons1); - context.di = 28; - context.bx = 25; - context.al = 2; - context.ah = 0; - showframe(context); -} - -void showpanel(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kIcons1); - context.di = 72; - context.bx = 0; - context.al = 19; - context.ah = 0; - showframe(context); - context.ds = context.data.word(kIcons1); - context.di = 192; - context.bx = 0; - context.al = 19; - context.ah = 0; - showframe(context); -} - -void roomname(Context &context) { - STACK_CHECK(context); - context.di = 88; - context.bx = 18; - context.al = 53; - context.dl = 240; - printmessage(context); - context.bl = context.data.byte(kRoomnum); - context._cmp(context.bl, 32); - if (context.flags.c()) + ds = data.word(kIcons1); + di = 28; + bx = 25; + al = 2; + ah = 0; + showframe(); +} + +void DreamGenContext::showpanel() { + STACK_CHECK; + ds = data.word(kIcons1); + di = 72; + bx = 0; + al = 19; + ah = 0; + showframe(); + ds = data.word(kIcons1); + di = 192; + bx = 0; + al = 19; + 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; - context._sub(context.bl, 32); + _sub(bl, 32); notover32: - context.bh = 0; - context._add(context.bx, context.bx); - context.es = context.data.word(kRoomdesc); - context._add(context.bx, (0)); - context.ax = context.es.word(context.bx); - context._add(context.ax, (0+(38*2))); - context.si = context.ax; - context.data.word(kLinespacing) = 7; - context.di = 88; - context.bx = 25; - context.dl = 120; - context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) + 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; - context.dl = 160; + dl = 160; gotpl: - context.al = 0; - context.ah = 0; - printdirect(context); - context.data.word(kLinespacing) = 10; - usecharset1(context); + al = 0; + ah = 0; + printdirect(); + data.word(kLinespacing) = 10; + usecharset1(); } -void usecharset1(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kCharset1); - context.data.word(kCurrentset) = context.ax; +void DreamGenContext::usecharset1() { + STACK_CHECK; + ax = data.word(kCharset1); + data.word(kCurrentset) = ax; } -void usetempcharset(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kTempcharset); - context.data.word(kCurrentset) = context.ax; +void DreamGenContext::usetempcharset() { + STACK_CHECK; + ax = data.word(kTempcharset); + data.word(kCurrentset) = ax; } -void showexit(Context &context) { - STACK_CHECK(context); - context.ds = context.data.word(kIcons1); - context.di = 274; - context.bx = 154; - context.al = 11; - context.ah = 0; - showframe(context); +void DreamGenContext::showexit() { + STACK_CHECK; + ds = data.word(kIcons1); + di = 274; + bx = 154; + al = 11; + ah = 0; + showframe(); } -void panelicons1(Context &context) { - STACK_CHECK(context); - context.di = 0; - context._cmp(context.data.byte(kWatchon), 1); - if (context.flags.z()) +void DreamGenContext::panelicons1() { + STACK_CHECK; + di = 0; + _cmp(data.byte(kWatchon), 1); + if (flags.z()) goto watchison; - context.di = 48; + di = 48; watchison: - context.push(context.di); - context.ds = context.data.word(kIcons2); - context._add(context.di, 204); - context.bx = 4; - context.al = 2; - context.ah = 0; - showframe(context); - context.di = context.pop(); - context.push(context.di); - context._cmp(context.data.byte(kZoomon), 1); - if (context.flags.z()) + 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; - context.ds = context.data.word(kIcons1); - context._add(context.di, 228); - context.bx = 8; - context.al = 5; - context.ah = 0; - showframe(context); + ds = data.word(kIcons1); + _add(di, 228); + bx = 8; + al = 5; + ah = 0; + showframe(); zoomisoff: - context.di = context.pop(); - showwatch(context); + di = pop(); + showwatch(); } -void showwatch(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kWatchon), 0); - if (context.flags.z()) +void DreamGenContext::showwatch() { + STACK_CHECK; + _cmp(data.byte(kWatchon), 0); + if (flags.z()) return /* (nowristwatch) */; - context.ds = context.data.word(kIcons1); - context.di = 250; - context.bx = 1; - context.al = 6; - context.ah = 0; - showframe(context); - showtime(context); -} - -void zoomicon(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kZoomon), 0); - if (context.flags.z()) + 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) */; - context.ds = context.data.word(kIcons1); - context.di = (8); - context.bx = (132)-1; - context.al = 8; - context.ah = 0; - showframe(context); -} - -void showblink(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kManisoffscreen), 1); - if (context.flags.z()) + ds = data.word(kIcons1); + di = (8); + bx = (132)-1; + al = 8; + ah = 0; + showframe(); +} + +void DreamGenContext::showblink() { + STACK_CHECK; + _cmp(data.byte(kManisoffscreen), 1); + if (flags.z()) return /* (finblink1) */; - context._inc(context.data.byte(kBlinkcount)); - context._cmp(context.data.byte(kShadeson), 0); - if (!context.flags.z()) + _inc(data.byte(kBlinkcount)); + _cmp(data.byte(kShadeson), 0); + if (!flags.z()) return /* (finblink1) */; - context._cmp(context.data.byte(kReallocation), 50); - if (!context.flags.c()) + _cmp(data.byte(kReallocation), 50); + if (!flags.c()) return /* (eyesshut) */; - context.al = context.data.byte(kBlinkcount); - context._cmp(context.al, 3); - if (!context.flags.z()) + al = data.byte(kBlinkcount); + _cmp(al, 3); + if (!flags.z()) return /* (finblink1) */; - context.data.byte(kBlinkcount) = 0; - context.al = context.data.byte(kBlinkframe); - context._inc(context.al); - context.data.byte(kBlinkframe) = context.al; - context._cmp(context.al, 6); - if (context.flags.c()) + data.byte(kBlinkcount) = 0; + al = data.byte(kBlinkframe); + _inc(al); + data.byte(kBlinkframe) = al; + _cmp(al, 6); + if (flags.c()) goto nomorethan6; - context.al = 6; + al = 6; nomorethan6: - context.ah = 0; - context.bx = 5888; - context._add(context.bx, context.ax); - context.al = context.cs.byte(context.bx); - context.ds = context.data.word(kIcons1); - context.di = 44; - context.bx = 32; - context.ah = 0; - showframe(context); -} - -void dumpblink(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kShadeson), 0); - if (!context.flags.z()) + ah = 0; + bx = 5888; + _add(bx, ax); + al = cs.byte(bx); + ds = data.word(kIcons1); + di = 44; + bx = 32; + ah = 0; + showframe(); +} + +void DreamGenContext::dumpblink() { + STACK_CHECK; + _cmp(data.byte(kShadeson), 0); + if (!flags.z()) return /* (nodumpeye) */; - context._cmp(context.data.byte(kBlinkcount), 0); - if (!context.flags.z()) + _cmp(data.byte(kBlinkcount), 0); + if (!flags.z()) return /* (nodumpeye) */; - context.al = context.data.byte(kBlinkframe); - context._cmp(context.al, 6); - if (!context.flags.c()) + al = data.byte(kBlinkframe); + _cmp(al, 6); + if (!flags.c()) return /* (nodumpeye) */; - context.push(context.ds); - context.di = 44; - context.bx = 32; - context.cl = 16; - context.ch = 12; - multidump(context); - context.ds = context.pop(); -} - -void worktoscreenm(Context &context) { - STACK_CHECK(context); - animpointer(context); - readmouse(context); - showpointer(context); - vsync(context); - worktoscreen(context); - delpointer(context); -} - -void blank(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 199); - if (context.flags.z()) + push(ds); + di = 44; + bx = 32; + cl = 16; + ch = 12; + multidump(); + ds = pop(); +} + +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) */; - context.data.byte(kCommandtype) = 199; - context.al = 0; - commandonly(context); -} - -void allpointer(Context &context) { - STACK_CHECK(context); - readmouse(context); - showpointer(context); - dumppointer(context); -} - -void hangonp(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - context._add(context.cx, context.cx); - context.ax = context.pop(); - context._add(context.cx, context.ax); - context.data.word(kMaintimer) = 0; - context.al = context.data.byte(kPointerframe); - context.ah = context.data.byte(kPickup); - context.push(context.ax); - context.data.byte(kPointermode) = 3; - context.data.byte(kPickup) = 0; - context.push(context.cx); - context.data.byte(kCommandtype) = 255; - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - context.cx = context.pop(); + data.byte(kCommandtype) = 199; + al = 0; + commandonly(); +} + +void DreamGenContext::allpointer() { + STACK_CHECK; + readmouse(); + showpointer(); + dumppointer(); +} + +void DreamGenContext::hangonp() { + STACK_CHECK; + push(cx); + _add(cx, cx); + ax = pop(); + _add(cx, ax); + data.word(kMaintimer) = 0; + al = data.byte(kPointerframe); + ah = data.byte(kPickup); + push(ax); + data.byte(kPointermode) = 3; + data.byte(kPickup) = 0; + push(cx); + data.byte(kCommandtype) = 255; + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + cx = pop(); hangloop: - context.push(context.cx); - delpointer(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - context.cx = context.pop(); - context.ax = context.data.word(kMousebutton); - context._cmp(context.ax, 0); - if (context.flags.z()) + push(cx); + delpointer(); + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + cx = pop(); + ax = data.word(kMousebutton); + _cmp(ax, 0); + if (flags.z()) goto notpressed; - context._cmp(context.ax, context.data.word(kOldbutton)); - if (!context.flags.z()) + _cmp(ax, data.word(kOldbutton)); + if (!flags.z()) goto getoutofit; notpressed: - if (--context.cx) + if (--cx) goto hangloop; getoutofit: - delpointer(context); - context.ax = context.pop(); - context.data.byte(kPointerframe) = context.al; - context.data.byte(kPickup) = context.ah; - context.data.byte(kPointermode) = 0; + delpointer(); + ax = pop(); + data.byte(kPointerframe) = al; + data.byte(kPickup) = ah; + data.byte(kPointermode) = 0; } -void hangonw(Context &context) { - STACK_CHECK(context); +void DreamGenContext::hangonw() { + STACK_CHECK; hangloopw: - context.push(context.cx); - delpointer(context); - readmouse(context); - animpointer(context); - showpointer(context); - vsync(context); - dumppointer(context); - context.cx = context.pop(); - if (--context.cx) + push(cx); + delpointer(); + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + cx = pop(); + if (--cx) goto hangloopw; } -void hangoncurs(Context &context) { - STACK_CHECK(context); +void DreamGenContext::hangoncurs() { + STACK_CHECK; monloop1: - context.push(context.cx); - printcurs(context); - vsync(context); - delcurs(context); - context.cx = context.pop(); - if (--context.cx) + push(cx); + printcurs(); + vsync(); + delcurs(); + cx = pop(); + if (--cx) goto monloop1; } -void getunderzoom(Context &context) { - STACK_CHECK(context); - context.di = (8)+5; - context.bx = (132)+4; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - context.cl = 46; - context.ch = 40; - multiget(context); +void DreamGenContext::getunderzoom() { + STACK_CHECK; + di = (8)+5; + bx = (132)+4; + ds = data.word(kBuffers); + si = (0+(180*10)+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 dumpzoom(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kZoomon), 1); - if (!context.flags.z()) +void DreamGenContext::dumpzoom() { + STACK_CHECK; + _cmp(data.byte(kZoomon), 1); + if (!flags.z()) return /* (notzoomon) */; - context.di = (8)+5; - context.bx = (132)+4; - context.cl = 46; - context.ch = 40; - multidump(context); -} - -void putunderzoom(Context &context) { - STACK_CHECK(context); - context.di = (8)+5; - context.bx = (132)+4; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - context.cl = 46; - context.ch = 40; - multiput(context); -} - -void crosshair(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kCommandtype), 3); - if (context.flags.z()) + 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+(180*10)+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::crosshair() { + STACK_CHECK; + _cmp(data.byte(kCommandtype), 3); + if (flags.z()) goto nocross; - context._cmp(context.data.byte(kCommandtype), 10); - if (!context.flags.c()) + _cmp(data.byte(kCommandtype), 10); + if (!flags.c()) goto nocross; - context.es = context.data.word(kWorkspace); - context.ds = context.data.word(kIcons1); - context.di = (8)+24; - context.bx = (132)+19; - context.al = 9; - context.ah = 0; - showframe(context); + es = data.word(kWorkspace); + ds = data.word(kIcons1); + di = (8)+24; + bx = (132)+19; + al = 9; + ah = 0; + showframe(); return; nocross: - context.es = context.data.word(kWorkspace); - context.ds = context.data.word(kIcons1); - context.di = (8)+24; - context.bx = (132)+19; - context.al = 29; - context.ah = 0; - showframe(context); -} - -void showpointer(Context &context) { - STACK_CHECK(context); - showblink(context); - context.di = context.data.word(kMousex); - context.data.word(kOldpointerx) = context.di; - context.bx = context.data.word(kMousey); - context.data.word(kOldpointery) = context.bx; - context._cmp(context.data.byte(kPickup), 1); - if (context.flags.z()) + es = data.word(kWorkspace); + ds = data.word(kIcons1); + di = (8)+24; + bx = (132)+19; + al = 29; + ah = 0; + showframe(); +} + +void DreamGenContext::showpointer() { + STACK_CHECK; + showblink(); + di = data.word(kMousex); + data.word(kOldpointerx) = di; + bx = data.word(kMousey); + data.word(kOldpointery) = bx; + _cmp(data.byte(kPickup), 1); + if (flags.z()) goto itsanobject; - context.push(context.bx); - context.push(context.di); - context.ds = context.data.word(kIcons1); - context.al = context.data.byte(kPointerframe); - context._add(context.al, 20); - context.ah = 0; - context._add(context.ax, context.ax); - context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.cx = context.ds.word(context.si); - context._cmp(context.cl, 12); - if (!context.flags.c()) + push(bx); + push(di); + ds = data.word(kIcons1); + al = data.byte(kPointerframe); + _add(al, 20); + ah = 0; + _add(ax, ax); + si = ax; + _add(ax, ax); + _add(si, ax); + cx = ds.word(si); + _cmp(cl, 12); + if (!flags.c()) goto notsmallx; - context.cl = 12; + cl = 12; notsmallx: - context._cmp(context.ch, 12); - if (!context.flags.c()) + _cmp(ch, 12); + if (!flags.c()) goto notsmally; - context.ch = 12; + ch = 12; notsmally: - context.data.byte(kPointerxs) = context.cl; - context.data.byte(kPointerys) = context.ch; - context.push(context.ds); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60); - multiget(context); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.push(context.di); - context.push(context.bx); - context.al = context.data.byte(kPointerframe); - context._add(context.al, 20); - context.ah = 0; - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); + data.byte(kPointerxs) = cl; + data.byte(kPointerys) = ch; + push(ds); + ds = data.word(kBuffers); + si = (0+(180*10)+32+60); + multiget(); + ds = pop(); + di = pop(); + bx = pop(); + push(di); + push(bx); + al = data.byte(kPointerframe); + _add(al, 20); + ah = 0; + showframe(); + bx = pop(); + di = pop(); return; itsanobject: - context.al = context.data.byte(kItemframe); - context.ds = context.data.word(kExtras); - context._cmp(context.data.byte(kObjecttype), 4); - if (context.flags.z()) + al = data.byte(kItemframe); + ds = data.word(kExtras); + _cmp(data.byte(kObjecttype), 4); + if (flags.z()) goto itsfrominv; - context.ds = context.data.word(kFreeframes); + ds = data.word(kFreeframes); itsfrominv: - context.cl = context.al; - context._add(context.al, context.al); - context._add(context.al, context.cl); - context._inc(context.al); - context.ah = 0; - context.push(context.ax); - context._add(context.ax, context.ax); - context.si = context.ax; - context._add(context.ax, context.ax); - context._add(context.si, context.ax); - context.ax = 2080; - context.cx = context.ds.word(context.si); - context._cmp(context.cl, 12); - if (!context.flags.c()) + cl = al; + _add(al, al); + _add(al, cl); + _inc(al); + ah = 0; + push(ax); + _add(ax, ax); + si = ax; + _add(ax, ax); + _add(si, ax); + ax = 2080; + cx = ds.word(si); + _cmp(cl, 12); + if (!flags.c()) goto notsmallx2; - context.cl = 12; + cl = 12; notsmallx2: - context._cmp(context.ch, 12); - if (!context.flags.c()) + _cmp(ch, 12); + if (!flags.c()) goto notsmally2; - context.ch = 12; + ch = 12; notsmally2: - context.data.byte(kPointerxs) = context.cl; - context.data.byte(kPointerys) = context.ch; - context.ax = context.pop(); - context.push(context.di); - context.push(context.bx); - context.push(context.ax); - context.push(context.bx); - context.push(context.di); - context.push(context.ds); - context.al = context.cl; - context.ah = 0; - context._shr(context.ax, 1); - context._sub(context.data.word(kOldpointerx), context.ax); - context._sub(context.di, context.ax); - context.al = context.ch; - context._shr(context.ax, 1); - context._sub(context.data.word(kOldpointery), context.ax); - context._sub(context.bx, context.ax); - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60); - multiget(context); - context.ds = context.pop(); - context.di = context.pop(); - context.bx = context.pop(); - context.ax = context.pop(); - context.ah = 128; - showframe(context); - context.bx = context.pop(); - context.di = context.pop(); - context.ds = context.data.word(kIcons1); - context.al = 3; - context.ah = 128; - showframe(context); -} - -void delpointer(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kOldpointerx); - context._cmp(context.ax, 0x0ffff); - if (context.flags.z()) + data.byte(kPointerxs) = cl; + data.byte(kPointerys) = ch; + ax = pop(); + push(di); + push(bx); + push(ax); + push(bx); + push(di); + push(ds); + al = cl; + ah = 0; + _shr(ax, 1); + _sub(data.word(kOldpointerx), ax); + _sub(di, ax); + al = ch; + _shr(ax, 1); + _sub(data.word(kOldpointery), ax); + _sub(bx, ax); + ds = data.word(kBuffers); + si = (0+(180*10)+32+60); + multiget(); + ds = pop(); + di = pop(); + bx = pop(); + ax = pop(); + ah = 128; + showframe(); + bx = pop(); + di = pop(); + ds = data.word(kIcons1); + al = 3; + ah = 128; + showframe(); +} + +void DreamGenContext::delpointer() { + STACK_CHECK; + ax = data.word(kOldpointerx); + _cmp(ax, 0x0ffff); + if (flags.z()) return /* (nevershown) */; - context.data.word(kDelherex) = context.ax; - context.ax = context.data.word(kOldpointery); - context.data.word(kDelherey) = context.ax; - context.cl = context.data.byte(kPointerxs); - context.data.byte(kDelxs) = context.cl; - context.ch = context.data.byte(kPointerys); - context.data.byte(kDelys) = context.ch; - context.ds = context.data.word(kBuffers); - context.si = (0+(180*10)+32+60); - context.di = context.data.word(kDelherex); - context.bx = context.data.word(kDelherey); - multiput(context); -} - -void dumppointer(Context &context) { - STACK_CHECK(context); - dumpblink(context); - context.cl = context.data.byte(kDelxs); - context.ch = context.data.byte(kDelys); - context.di = context.data.word(kDelherex); - context.bx = context.data.word(kDelherey); - multidump(context); - context.bx = context.data.word(kOldpointery); - context.di = context.data.word(kOldpointerx); - context._cmp(context.di, context.data.word(kDelherex)); - if (!context.flags.z()) + data.word(kDelherex) = ax; + ax = data.word(kOldpointery); + data.word(kDelherey) = ax; + cl = data.byte(kPointerxs); + data.byte(kDelxs) = cl; + ch = data.byte(kPointerys); + data.byte(kDelys) = ch; + ds = data.word(kBuffers); + si = (0+(180*10)+32+60); + di = data.word(kDelherex); + bx = data.word(kDelherey); + multiput(); +} + +void DreamGenContext::dumppointer() { + STACK_CHECK; + dumpblink(); + cl = data.byte(kDelxs); + ch = data.byte(kDelys); + di = data.word(kDelherex); + bx = data.word(kDelherey); + multidump(); + bx = data.word(kOldpointery); + di = data.word(kOldpointerx); + _cmp(di, data.word(kDelherex)); + if (!flags.z()) goto difffound; - context._cmp(context.bx, context.data.word(kDelherey)); - if (context.flags.z()) + _cmp(bx, data.word(kDelherey)); + if (flags.z()) return /* (notboth) */; difffound: - context.cl = context.data.byte(kPointerxs); - context.ch = context.data.byte(kPointerys); - multidump(context); -} - -void undertextline(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kTextaddressx); - context.bx = context.data.word(kTextaddressy); - context.ds = context.data.word(kBuffers); - context.si = (0); - context.cl = (180); - context.ch = (10); - multiget(context); -} - -void deltextline(Context &context) { - STACK_CHECK(context); - context.di = context.data.word(kTextaddressx); - context.bx = context.data.word(kTextaddressy); - context.ds = context.data.word(kBuffers); - context.si = (0); - context.cl = (180); - context.ch = (10); - multiput(context); -} - -void dumptextline(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kNewtextline), 1); - if (!context.flags.z()) + cl = data.byte(kPointerxs); + ch = data.byte(kPointerys); + multidump(); +} + +void DreamGenContext::undertextline() { + STACK_CHECK; + di = data.word(kTextaddressx); + bx = data.word(kTextaddressy); + ds = data.word(kBuffers); + si = (0); + cl = (180); + ch = (10); + multiget(); +} + +void DreamGenContext::deltextline() { + STACK_CHECK; + di = data.word(kTextaddressx); + bx = data.word(kTextaddressy); + ds = data.word(kBuffers); + si = (0); + cl = (180); + ch = (10); + multiput(); +} + +void DreamGenContext::dumptextline() { + STACK_CHECK; + _cmp(data.byte(kNewtextline), 1); + if (!flags.z()) return /* (nodumptextline) */; - context.data.byte(kNewtextline) = 0; - context.di = context.data.word(kTextaddressx); - context.bx = context.data.word(kTextaddressy); - context.cl = (180); - context.ch = (10); - multidump(context); -} - -void animpointer(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kPointermode), 2); - if (context.flags.z()) + data.byte(kNewtextline) = 0; + di = data.word(kTextaddressx); + bx = data.word(kTextaddressy); + cl = (180); + ch = (10); + multidump(); +} + +void DreamGenContext::animpointer() { + STACK_CHECK; + _cmp(data.byte(kPointermode), 2); + if (flags.z()) goto combathand; - context._cmp(context.data.byte(kPointermode), 3); - if (context.flags.z()) + _cmp(data.byte(kPointermode), 3); + if (flags.z()) goto mousehand; - context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (flags.z()) goto notwatchpoint; - context.data.byte(kPointerframe) = 11; + data.byte(kPointerframe) = 11; return; notwatchpoint: - context.data.byte(kPointerframe) = 0; - context._cmp(context.data.byte(kInmaparea), 0); - if (context.flags.z()) + data.byte(kPointerframe) = 0; + _cmp(data.byte(kInmaparea), 0); + if (flags.z()) return /* (gothand) */; - context._cmp(context.data.byte(kPointerfirstpath), 0); - if (context.flags.z()) + _cmp(data.byte(kPointerfirstpath), 0); + if (flags.z()) return /* (gothand) */; - getflagunderp(context); - context._cmp(context.cl, 2); - if (context.flags.c()) + getflagunderp(); + _cmp(cl, 2); + if (flags.c()) return /* (gothand) */; - context._cmp(context.cl, 128); - if (!context.flags.c()) + _cmp(cl, 128); + if (!flags.c()) return /* (gothand) */; - context.data.byte(kPointerframe) = 3; - context._test(context.cl, 4); - if (!context.flags.z()) + data.byte(kPointerframe) = 3; + _test(cl, 4); + if (!flags.z()) return /* (gothand) */; - context.data.byte(kPointerframe) = 4; - context._test(context.cl, 16); - if (!context.flags.z()) + data.byte(kPointerframe) = 4; + _test(cl, 16); + if (!flags.z()) return /* (gothand) */; - context.data.byte(kPointerframe) = 5; - context._test(context.cl, 2); - if (!context.flags.z()) + data.byte(kPointerframe) = 5; + _test(cl, 2); + if (!flags.z()) return /* (gothand) */; - context.data.byte(kPointerframe) = 6; - context._test(context.cl, 8); - if (!context.flags.z()) + data.byte(kPointerframe) = 6; + _test(cl, 8); + if (!flags.z()) return /* (gothand) */; - context.data.byte(kPointerframe) = 8; + data.byte(kPointerframe) = 8; return; mousehand: - context._cmp(context.data.byte(kPointerspeed), 0); - if (context.flags.z()) + _cmp(data.byte(kPointerspeed), 0); + if (flags.z()) goto rightspeed3; - context._dec(context.data.byte(kPointerspeed)); + _dec(data.byte(kPointerspeed)); goto finflashmouse; rightspeed3: - context.data.byte(kPointerspeed) = 5; - context._inc(context.data.byte(kPointercount)); - context._cmp(context.data.byte(kPointercount), 16); - if (!context.flags.z()) + data.byte(kPointerspeed) = 5; + _inc(data.byte(kPointercount)); + _cmp(data.byte(kPointercount), 16); + if (!flags.z()) goto finflashmouse; - context.data.byte(kPointercount) = 0; + data.byte(kPointercount) = 0; finflashmouse: - context.al = context.data.byte(kPointercount); - context.ah = 0; - context.bx = 5895; - context._add(context.bx, context.ax); - context.al = context.cs.byte(context.bx); - context.data.byte(kPointerframe) = context.al; + al = data.byte(kPointercount); + ah = 0; + bx = 5895; + _add(bx, ax); + al = cs.byte(bx); + data.byte(kPointerframe) = al; return; combathand: - context.data.byte(kPointerframe) = 0; - context._cmp(context.data.byte(kReallocation), 14); - if (!context.flags.z()) + data.byte(kPointerframe) = 0; + _cmp(data.byte(kReallocation), 14); + if (!flags.z()) return /* (notarrow) */; - context._cmp(context.data.byte(kCommandtype), 211); - if (!context.flags.z()) + _cmp(data.byte(kCommandtype), 211); + if (!flags.z()) return /* (notarrow) */; - context.data.byte(kPointerframe) = 5; -} - -void readmouse(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousebutton); - context.data.word(kOldbutton) = context.ax; - context.ax = context.data.word(kMousex); - context.data.word(kOldx) = context.ax; - context.ax = context.data.word(kMousey); - context.data.word(kOldy) = context.ax; - mousecall(context); - context.data.word(kMousex) = context.cx; - context.data.word(kMousey) = context.dx; - context.data.word(kMousebutton) = context.bx; -} - -void readmouse1(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousex); - context.data.word(kOldx) = context.ax; - context.ax = context.data.word(kMousey); - context.data.word(kOldy) = context.ax; - mousecall(context); - context.data.word(kMousex) = context.cx; - context.data.word(kMousey) = context.dx; - context.data.word(kMousebutton1) = context.bx; -} - -void readmouse2(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousex); - context.data.word(kOldx) = context.ax; - context.ax = context.data.word(kMousey); - context.data.word(kOldy) = context.ax; - mousecall(context); - context.data.word(kMousex) = context.cx; - context.data.word(kMousey) = context.dx; - context.data.word(kMousebutton2) = context.bx; -} - -void readmouse3(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousex); - context.data.word(kOldx) = context.ax; - context.ax = context.data.word(kMousey); - context.data.word(kOldy) = context.ax; - mousecall(context); - context.data.word(kMousex) = context.cx; - context.data.word(kMousey) = context.dx; - context.data.word(kMousebutton3) = context.bx; -} - -void readmouse4(Context &context) { - STACK_CHECK(context); - context.ax = context.data.word(kMousebutton); - context.data.word(kOldbutton) = context.ax; - context.ax = context.data.word(kMousex); - context.data.word(kOldx) = context.ax; - context.ax = context.data.word(kMousey); - context.data.word(kOldy) = context.ax; - mousecall(context); - context.data.word(kMousex) = context.cx; - context.data.word(kMousey) = context.dx; - context.ax = context.data.word(kMousebutton1); - context._or(context.ax, context.data.word(kMousebutton2)); - context._or(context.ax, context.data.word(kMousebutton3)); - context._or(context.bx, context.ax); - context.data.word(kMousebutton) = context.bx; -} - -void readkey(Context &context) { - STACK_CHECK(context); - context.bx = context.data.word(kBufferout); - context._cmp(context.bx, context.data.word(kBufferin)); - if (context.flags.z()) + data.byte(kPointerframe) = 5; +} + +void DreamGenContext::readmouse() { + STACK_CHECK; + ax = data.word(kMousebutton); + data.word(kOldbutton) = ax; + ax = data.word(kMousex); + data.word(kOldx) = ax; + ax = data.word(kMousey); + data.word(kOldy) = ax; + mousecall(); + data.word(kMousex) = cx; + data.word(kMousey) = dx; + data.word(kMousebutton) = bx; +} + +void DreamGenContext::readmouse1() { + STACK_CHECK; + ax = data.word(kMousex); + data.word(kOldx) = ax; + ax = data.word(kMousey); + data.word(kOldy) = ax; + mousecall(); + data.word(kMousex) = cx; + data.word(kMousey) = dx; + data.word(kMousebutton1) = bx; +} + +void DreamGenContext::readmouse2() { + STACK_CHECK; + ax = data.word(kMousex); + data.word(kOldx) = ax; + ax = data.word(kMousey); + data.word(kOldy) = ax; + mousecall(); + data.word(kMousex) = cx; + data.word(kMousey) = dx; + data.word(kMousebutton2) = bx; +} + +void DreamGenContext::readmouse3() { + STACK_CHECK; + ax = data.word(kMousex); + data.word(kOldx) = ax; + ax = data.word(kMousey); + data.word(kOldy) = ax; + mousecall(); + data.word(kMousex) = cx; + data.word(kMousey) = dx; + data.word(kMousebutton3) = bx; +} + +void DreamGenContext::readmouse4() { + STACK_CHECK; + ax = data.word(kMousebutton); + data.word(kOldbutton) = ax; + ax = data.word(kMousex); + data.word(kOldx) = ax; + ax = data.word(kMousey); + data.word(kOldy) = ax; + mousecall(); + data.word(kMousex) = cx; + data.word(kMousey) = dx; + ax = data.word(kMousebutton1); + _or(ax, data.word(kMousebutton2)); + _or(ax, data.word(kMousebutton3)); + _or(bx, ax); + data.word(kMousebutton) = bx; +} + +void DreamGenContext::readkey() { + STACK_CHECK; + bx = data.word(kBufferout); + _cmp(bx, data.word(kBufferin)); + if (flags.z()) goto nokey; - context._inc(context.bx); - context._and(context.bx, 15); - context.data.word(kBufferout) = context.bx; - context.di = 5912; - context._add(context.di, context.bx); - context.al = context.cs.byte(context.di); - context.data.byte(kCurrentkey) = context.al; + _inc(bx); + _and(bx, 15); + data.word(kBufferout) = bx; + di = 5912; + _add(di, bx); + al = cs.byte(di); + data.byte(kCurrentkey) = al; return; nokey: - context.data.byte(kCurrentkey) = 0; -} - -void convertkey(Context &context) { - STACK_CHECK(context); - context._and(context.al, 127); - context.ah = 0; - context.di = 5928; - context._add(context.di, context.ax); - context.al = context.cs.byte(context.di); -} - -void randomnum1(Context &context) { - STACK_CHECK(context); - context.push(context.ds); - context.push(context.es); - context.push(context.di); - context.push(context.bx); - context.push(context.cx); - randomnumber(context); - context.cx = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); -} - -void randomnum2(Context &context) { - STACK_CHECK(context); - context.push(context.ds); - context.push(context.es); - context.push(context.di); - context.push(context.bx); - context.push(context.ax); - randomnumber(context); - context.cl = context.al; - context.ax = context.pop(); - context.bx = context.pop(); - context.di = context.pop(); - context.es = context.pop(); - context.ds = context.pop(); -} - -void hangon(Context &context) { - STACK_CHECK(context); + data.byte(kCurrentkey) = 0; +} + +void DreamGenContext::convertkey() { + STACK_CHECK; + _and(al, 127); + ah = 0; + di = 5928; + _add(di, ax); + al = cs.byte(di); +} + +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::hangon() { + STACK_CHECK; hangonloop: - context.push(context.cx); - vsync(context); - context.cx = context.pop(); - if (--context.cx) + push(cx); + vsync(); + cx = pop(); + if (--cx) goto hangonloop; } -void loadtraveltext(Context &context) { - STACK_CHECK(context); - context.dx = 2234; - standardload(context); - context.data.word(kTraveltext) = context.ax; -} - -void loadintotemp(Context &context) { - STACK_CHECK(context); - context.ds = context.cs; - standardload(context); - context.data.word(kTempgraphics) = context.ax; -} - -void loadintotemp2(Context &context) { - STACK_CHECK(context); - context.ds = context.cs; - standardload(context); - context.data.word(kTempgraphics2) = context.ax; -} - -void loadintotemp3(Context &context) { - STACK_CHECK(context); - context.ds = context.cs; - standardload(context); - context.data.word(kTempgraphics3) = context.ax; -} - -void loadtempcharset(Context &context) { - STACK_CHECK(context); - standardload(context); - context.data.word(kTempcharset) = context.ax; -} - -void standardload(Context &context) { - STACK_CHECK(context); - openfile(context); - readheader(context); - context.bx = context.es.word(context.di); - context.push(context.bx); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.ds = context.ax; - context.cx = context.pop(); - context.push(context.ax); - context.dx = 0; - readfromfile(context); - closefile(context); - context.ax = context.pop(); -} - -void loadtemptext(Context &context) { - STACK_CHECK(context); - standardload(context); - context.data.word(kTextfile1) = context.ax; -} - -void loadroom(Context &context) { - STACK_CHECK(context); - context.data.byte(kRoomloaded) = 1; - context.data.word(kTimecount) = 0; - context.data.word(kMaintimer) = 0; - context.data.word(kMapoffsetx) = 104; - context.data.word(kMapoffsety) = 38; - context.data.word(kTextaddressx) = 13; - context.data.word(kTextaddressy) = 182; - context.data.byte(kTextlen) = 240; - context.al = context.data.byte(kNewlocation); - context.data.byte(kLocation) = context.al; - getroomdata(context); - startloading(context); - loadroomssample(context); - switchryanon(context); - drawflags(context); - getdimension(context); -} - -void loadroomssample(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kRoomssample); - context._cmp(context.al, 255); - if (context.flags.z()) +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) */; - context._cmp(context.al, context.data.byte(kCurrentsample)); - if (context.flags.z()) + _cmp(al, data.byte(kCurrentsample)); + if (flags.z()) return /* (loadedalready) */; - context.data.byte(kCurrentsample) = context.al; - context.al = context.data.byte(kCurrentsample); - context.cl = '0'; - twodigitnum(context); - context.di = 1896; - context._xchg(context.al, context.ah); - context.cs.word(context.di+10) = context.ax; - context.dx = context.di; - loadsecondsample(context); -} - -void getridofreels(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRoomloaded), 0); - if (context.flags.z()) + 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) */; - context.es = context.data.word(kReel1); - deallocatemem(context); - context.es = context.data.word(kReel2); - deallocatemem(context); - context.es = context.data.word(kReel3); - deallocatemem(context); -} - -void getridofall(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kBackdrop); - deallocatemem(context); - context.es = context.data.word(kSetframes); - deallocatemem(context); - context.es = context.data.word(kReel1); - deallocatemem(context); - context.es = context.data.word(kReel2); - deallocatemem(context); - context.es = context.data.word(kReel3); - deallocatemem(context); - context.es = context.data.word(kReels); - deallocatemem(context); - context.es = context.data.word(kPeople); - deallocatemem(context); - context.es = context.data.word(kSetdesc); - deallocatemem(context); - context.es = context.data.word(kBlockdesc); - deallocatemem(context); - context.es = context.data.word(kRoomdesc); - deallocatemem(context); - context.es = context.data.word(kFreeframes); - deallocatemem(context); - context.es = context.data.word(kFreedesc); - deallocatemem(context); -} - -void restorereels(Context &context) { - STACK_CHECK(context); - context._cmp(context.data.byte(kRoomloaded), 0); - if (context.flags.z()) + 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) */; - context.al = context.data.byte(kReallocation); - getroomdata(context); - context.dx = context.bx; - openfile(context); - readheader(context); - dontloadseg(context); - dontloadseg(context); - dontloadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(kReel1) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel2) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel3) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - closefile(context); -} - -void restoreall(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kLocation); - getroomdata(context); - context.dx = context.bx; - openfile(context); - readheader(context); - allocateload(context); - context.ds = context.ax; - context.data.word(kBackdrop) = context.ax; - context.dx = (0); - loadseg(context); - context.ds = context.data.word(kWorkspace); - context.dx = (0); - context.cx = 132*66; - context.al = 0; - fillspace(context); - loadseg(context); - sortoutmap(context); - allocateload(context); - context.data.word(kSetframes) = context.ax; - context.ds = context.ax; - context.dx = (0); - loadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(kReel1) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel2) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel3) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReels) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kPeople) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kSetdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kBlockdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kRoomdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kFreeframes) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - dontloadseg(context); - allocateload(context); - context.data.word(kFreedesc) = context.ax; - context.ds = context.ax; - context.dx = (0); - loadseg(context); - closefile(context); - setallchanges(context); -} - -void sortoutmap(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.di); - context.ds = context.data.word(kWorkspace); - context.si = 0; - context.es = context.data.word(kMapdata); - context.di = 0; - context.cx = (60); + 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: - context.push(context.cx); - context.push(context.si); - context.cx = (66); - context._movsb(context.cx); - context.si = context.pop(); - context.cx = context.pop(); - context._add(context.si, 132); - if (--context.cx) + push(cx); + push(si); + cx = (66); + _movsb(cx); + si = pop(); + cx = pop(); + _add(si, 132); + if (--cx) goto blimey; - context.di = context.pop(); - context.es = context.pop(); -} - -void startloading(Context &context) { - STACK_CHECK(context); - context.data.byte(kCombatcount) = 0; - context.al = context.cs.byte(context.bx+13); - context.data.byte(kRoomssample) = context.al; - context.al = context.cs.byte(context.bx+15); - context.data.byte(kMapx) = context.al; - context.al = context.cs.byte(context.bx+16); - context.data.byte(kMapy) = context.al; - context.al = context.cs.byte(context.bx+20); - context.data.byte(kLiftflag) = context.al; - context.al = context.cs.byte(context.bx+21); - context.data.byte(kManspath) = context.al; - context.data.byte(kDestination) = context.al; - context.data.byte(kFinaldest) = context.al; - context.al = context.cs.byte(context.bx+22); - context.data.byte(kFacing) = context.al; - context.data.byte(kTurntoface) = context.al; - context.al = context.cs.byte(context.bx+23); - context.data.byte(kCounttoopen) = context.al; - context.al = context.cs.byte(context.bx+24); - context.data.byte(kLiftpath) = context.al; - context.al = context.cs.byte(context.bx+25); - context.data.byte(kDoorpath) = context.al; - context.data.byte(kLastweapon) = -1; - context.al = context.cs.byte(context.bx+27); - context.push(context.ax); - context.al = context.cs.byte(context.bx+31); - context.ah = context.data.byte(kReallocation); - context.data.byte(kReallocation) = context.al; - context.dx = context.bx; - openfile(context); - readheader(context); - allocateload(context); - context.ds = context.ax; - context.data.word(kBackdrop) = context.ax; - context.dx = (0); - loadseg(context); - context.ds = context.data.word(kWorkspace); - context.dx = (0); - context.cx = 132*66; - context.al = 0; - fillspace(context); - loadseg(context); - sortoutmap(context); - allocateload(context); - context.data.word(kSetframes) = context.ax; - context.ds = context.ax; - context.dx = (0); - loadseg(context); - context.ds = context.data.word(kSetdat); - context.dx = 0; - context.cx = (64*128); - context.al = 255; - fillspace(context); - loadseg(context); - allocateload(context); - context.data.word(kReel1) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel2) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReel3) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kReels) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kPeople) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kSetdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kBlockdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kRoomdesc) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - allocateload(context); - context.data.word(kFreeframes) = context.ax; - context.ds = context.ax; - context.dx = 0; - loadseg(context); - context.ds = context.data.word(kFreedat); - context.dx = 0; - context.cx = (16*80); - context.al = 255; - fillspace(context); - loadseg(context); - allocateload(context); - context.data.word(kFreedesc) = context.ax; - context.ds = context.ax; - context.dx = (0); - loadseg(context); - closefile(context); - findroominloc(context); - deletetaken(context); - setallchanges(context); - autoappear(context); - context.al = context.data.byte(kNewlocation); - getroomdata(context); - context.data.byte(kLastweapon) = -1; - context.data.byte(kMandead) = 0; - context.data.word(kLookcounter) = 160; - context.data.byte(kNewlocation) = 255; - context.data.byte(kLinepointer) = 254; - context.ax = context.pop(); - context._cmp(context.al, 255); - if (context.flags.z()) + di = pop(); + es = pop(); +} + +void DreamGenContext::startloading() { + STACK_CHECK; + data.byte(kCombatcount) = 0; + al = cs.byte(bx+13); + data.byte(kRoomssample) = al; + al = cs.byte(bx+15); + data.byte(kMapx) = al; + al = cs.byte(bx+16); + data.byte(kMapy) = al; + al = cs.byte(bx+20); + data.byte(kLiftflag) = al; + al = cs.byte(bx+21); + data.byte(kManspath) = al; + data.byte(kDestination) = al; + data.byte(kFinaldest) = al; + al = cs.byte(bx+22); + data.byte(kFacing) = al; + data.byte(kTurntoface) = al; + al = cs.byte(bx+23); + data.byte(kCounttoopen) = al; + al = cs.byte(bx+24); + data.byte(kLiftpath) = al; + al = cs.byte(bx+25); + data.byte(kDoorpath) = al; + data.byte(kLastweapon) = -1; + al = cs.byte(bx+27); + push(ax); + al = cs.byte(bx+31); + ah = data.byte(kReallocation); + data.byte(kReallocation) = al; + 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(); + 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(kMandead) = 0; + data.word(kLookcounter) = 160; + data.byte(kNewlocation) = 255; + data.byte(kLinepointer) = 254; + ax = pop(); + _cmp(al, 255); + if (flags.z()) goto dontwalkin; - context.data.byte(kManspath) = context.al; - context.push(context.bx); - autosetwalk(context); - context.bx = context.pop(); + data.byte(kManspath) = al; + push(bx); + autosetwalk(); + bx = pop(); dontwalkin: - findxyfrompath(context); + findxyfrompath(); } -void disablepath(Context &context) { - STACK_CHECK(context); - context.push(context.cx); - context._xchg(context.al, context.ah); - context.cx = -6; +void DreamGenContext::disablepath() { + STACK_CHECK; + push(cx); + _xchg(al, ah); + cx = -6; looky2: - context._add(context.cx, 6); - context._sub(context.al, 10); - if (!context.flags.c()) + _add(cx, 6); + _sub(al, 10); + if (!flags.c()) goto looky2; - context.al = context.ah; - context._dec(context.cx); + al = ah; + _dec(cx); lookx2: - context._inc(context.cx); - context._sub(context.al, 11); - if (!context.flags.c()) + _inc(cx); + _sub(al, 11); + if (!flags.c()) goto lookx2; - context.al = context.cl; - context.ah = 0; - context.cx = 144; - context._mul(context.cx); - context.es = context.data.word(kReels); - context.bx = (0); - context._add(context.bx, context.ax); - context.ax = context.pop(); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.al = 0; - context.es.byte(context.bx+6) = context.al; -} - -void findxyfrompath(Context &context) { - STACK_CHECK(context); - getroomspaths(context); - context.al = context.data.byte(kManspath); - context.ah = 0; - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.ax, context.ax); - context._add(context.bx, context.ax); - context.ax = context.es.word(context.bx); - context._sub(context.al, 12); - context._sub(context.ah, 12); - context.data.byte(kRyanx) = context.al; - context.data.byte(kRyany) = context.ah; -} - -void findroominloc(Context &context) { - STACK_CHECK(context); - context.al = context.data.byte(kMapy); - context.cx = -6; + 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::findxyfrompath() { + STACK_CHECK; + getroomspaths(); + al = data.byte(kManspath); + ah = 0; + _add(ax, ax); + _add(ax, ax); + _add(ax, ax); + _add(bx, ax); + ax = es.word(bx); + _sub(al, 12); + _sub(ah, 12); + data.byte(kRyanx) = al; + data.byte(kRyany) = ah; +} + +void DreamGenContext::findroominloc() { + STACK_CHECK; + al = data.byte(kMapy); + cx = -6; looky: - context._add(context.cx, 6); - context._sub(context.al, 10); - if (!context.flags.c()) + _add(cx, 6); + _sub(al, 10); + if (!flags.c()) goto looky; - context.al = context.data.byte(kMapx); - context._dec(context.cx); + al = data.byte(kMapx); + _dec(cx); lookx: - context._inc(context.cx); - context._sub(context.al, 11); - if (!context.flags.c()) + _inc(cx); + _sub(al, 11); + if (!flags.c()) goto lookx; - context.data.byte(kRoomnum) = context.cl; -} - -void getroomdata(Context &context) { - STACK_CHECK(context); - context.ah = 0; - context.cx = 32; - context._mul(context.cx); - context.bx = 6187; - context._add(context.bx, context.ax); -} - -void readheader(Context &context) { - STACK_CHECK(context); - context.ds = context.cs; - context.dx = 6091; - context.cx = (6187-6091); - readfromfile(context); - context.es = context.cs; - context.di = 6141; -} - -void allocateload(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.di); - context.bx = context.es.word(context.di); - context.cl = 4; - context._shr(context.bx, context.cl); - allocatemem(context); - context.di = context.pop(); - context.es = context.pop(); -} - -void fillspace(Context &context) { - STACK_CHECK(context); - context.push(context.es); - context.push(context.ds); - context.push(context.dx); - context.push(context.di); - context.push(context.bx); - context.di = context.dx; - context.es = context.ds; - context._stosb(context.cx); - context.bx = context.pop(); - context.di = context.pop(); - context.dx = context.pop(); - context.ds = context.pop(); - context.es = context.pop(); -} - -void getridoftemp(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTempgraphics); - deallocatemem(context); -} - -void getridoftemptext(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTextfile1); - deallocatemem(context); -} - -void getridoftemp2(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTempgraphics2); - deallocatemem(context); -} - -void getridoftemp3(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTempgraphics3); - deallocatemem(context); -} - -void getridoftempcharset(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTempcharset); - deallocatemem(context); -} - -void getridoftempsp(Context &context) { - STACK_CHECK(context); - context.es = context.data.word(kTempsprites); - deallocatemem(context); -} - -void readsetdata(Context &context) { - STACK_CHECK(context); - context.dx = 1857; - standardload(context); - context.data.word(kCharset1) = context.ax; - context.dx = 1922; - standardload(context); - context.data.word(kIcons1) = context.ax; - context.dx = 1935; - standardload(context); - context.data.word(kIcons2) = context.ax; - context.dx = 1819; - standardload(context); - context.data.word(kMainsprites) = context.ax; - context.dx = 2221; - standardload(context); - context.data.word(kPuzzletext) = context.ax; - context.dx = 2273; - standardload(context); - context.data.word(kCommandtext) = context.ax; - context.ax = context.data.word(kCharset1); - context.data.word(kCurrentset) = context.ax; - context._cmp(context.data.byte(kSoundint), 255); - if (context.flags.z()) + data.byte(kRoomnum) = cl; +} + +void DreamGenContext::getroomdata() { + STACK_CHECK; + ah = 0; + cx = 32; + _mul(cx); + bx = 6187; + _add(bx, ax); +} + +void DreamGenContext::readheader() { + STACK_CHECK; + ds = cs; + dx = 6091; + cx = (6187-6091); + readfromfile(); + es = cs; + di = 6141; +} + +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::fillspace() { + STACK_CHECK; + push(es); + push(ds); + push(dx); + push(di); + push(bx); + di = dx; + es = ds; + _stosb(cx); + bx = pop(); + di = pop(); + dx = pop(); + ds = 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) */; - context.dx = 2286; - openfile(context); - context.cx = 2048-256; - context.ds = context.data.word(kSoundbuffer); - context.dx = 16384; - readfromfile(context); - closefile(context); -} - -void makename(Context &context) { - STACK_CHECK(context); - context.si = context.dx; - context.di = 6061; + dx = 2286; + openfile(); + cx = 2048-256; + ds = data.word(kSoundbuffer); + dx = 16384; + readfromfile(); + closefile(); +} + +void DreamGenContext::makename() { + STACK_CHECK; + si = dx; + di = 6061; transfer: - context.al = context.cs.byte(context.si); - context.cs.byte(context.di) = context.al; - context._inc(context.si); - context._inc(context.di); - context._cmp(context.al, 0); - if (!context.flags.z()) + al = cs.byte(si); + cs.byte(di) = al; + _inc(si); + _inc(di); + _cmp(al, 0); + if (!flags.z()) goto transfer; - context.dx = 6059; -} - -void dreamweb(Context &context) { - STACK_CHECK(context); - seecommandtail(context); - checkbasemem(context); - soundstartup(context); - setkeyboardint(context); - setupemm(context); - allocatebuffers(context); - setmouse(context); - fadedos(context); - gettime(context); - clearbuffers(context); - clearpalette(context); - set16colpalette(context); - readsetdata(context); - context.data.byte(kWongame) = 0; - context.dx = 1909; - loadsample(context); - setsoundoff(context); - scanfornames(context); - context._cmp(context.al, 0); - if (!context.flags.z()) + dx = 6059; +} + +void DreamGenContext::dreamweb() { + STACK_CHECK; + seecommandtail(); + checkbasemem(); + soundstartup(); + setkeyboardint(); + setupemm(); + allocatebuffers(); + setmouse(); + fadedos(); + gettime(); + clearbuffers(); + clearpalette(); + set16colpalette(); + readsetdata(); + data.byte(kWongame) = 0; + dx = 1909; + loadsample(); + setsoundoff(); + scanfornames(); + _cmp(al, 0); + if (!flags.z()) goto dodecisions; - setmode(context); - loadpalfromiff(context); - titles(context); - credits(context); + setmode(); + loadpalfromiff(); + titles(); + credits(); goto playgame; dodecisions: - cls(context); - setmode(context); - decide(context); - context._cmp(context.data.byte(kGetback), 4); - if (context.flags.z()) + cls(); + setmode(); + decide(); + _cmp(data.byte(kGetback), 4); + if (flags.z()) goto mainloop; - titles(context); - credits(context); + titles(); + credits(); playgame: - clearchanges(context); - setmode(context); - loadpalfromiff(context); - context.data.byte(kLocation) = 255; - context.data.byte(kRoomafterdream) = 1; - context.data.byte(kNewlocation) = 35; - context.data.byte(kVolume) = 7; - loadroom(context); - clearsprites(context); - initman(context); - entrytexts(context); - entryanims(context); - context.data.byte(kDestpos) = 3; - initialinv(context); - context.data.byte(kLastflag) = 32; - startup1(context); - context.data.byte(kVolumeto) = 0; - context.data.byte(kVolumedirection) = -1; - context.data.byte(kCommandtype) = 255; + clearchanges(); + setmode(); + loadpalfromiff(); + data.byte(kLocation) = 255; + data.byte(kRoomafterdream) = 1; + data.byte(kNewlocation) = 35; + data.byte(kVolume) = 7; + loadroom(); + clearsprites(); + initman(); + entrytexts(); + entryanims(); + data.byte(kDestpos) = 3; + initialinv(); + data.byte(kLastflag) = 32; + startup1(); + data.byte(kVolumeto) = 0; + data.byte(kVolumedirection) = -1; + data.byte(kCommandtype) = 255; goto mainloop; loadnew: - clearbeforeload(context); - loadroom(context); - clearsprites(context); - initman(context); - entrytexts(context); - entryanims(context); - context.data.byte(kNewlocation) = 255; - startup(context); - context.data.byte(kCommandtype) = 255; - worktoscreenm(context); + clearbeforeload(); + loadroom(); + clearsprites(); + initman(); + entrytexts(); + entryanims(); + data.byte(kNewlocation) = 255; + startup(); + data.byte(kCommandtype) = 255; + worktoscreenm(); goto mainloop; - context.data.byte(kNewlocation) = 255; - clearsprites(context); - initman(context); - startup(context); - context.data.byte(kCommandtype) = 255; + data.byte(kNewlocation) = 255; + clearsprites(); + initman(); + startup(); + data.byte(kCommandtype) = 255; mainloop: - screenupdate(context); - context._cmp(context.data.byte(kWongame), 0); - if (!context.flags.z()) + screenupdate(); + _cmp(data.byte(kWongame), 0); + if (!flags.z()) goto endofgame; - context._cmp(context.data.byte(kMandead), 1); - if (context.flags.z()) + _cmp(data.byte(kMandead), 1); + if (flags.z()) goto gameover; - context._cmp(context.data.byte(kMandead), 2); - if (context.flags.z()) + _cmp(data.byte(kMandead), 2); + if (flags.z()) goto gameover; - context._cmp(context.data.word(kWatchingtime), 0); - if (context.flags.z()) + _cmp(data.word(kWatchingtime), 0); + if (flags.z()) goto notwatching; - context.al = context.data.byte(kFinaldest); - context._cmp(context.al, context.data.byte(kManspath)); - if (!context.flags.z()) + al = data.byte(kFinaldest); + _cmp(al, data.byte(kManspath)); + if (!flags.z()) goto mainloop; - context._dec(context.data.word(kWatchingtime)); - if (!context.flags.z()) + _dec(data.word(kWatchingtime)); + if (!flags.z()) goto mainloop; notwatching: - context._cmp(context.data.byte(kMandead), 4); - if (context.flags.z()) + _cmp(data.byte(kMandead), 4); + if (flags.z()) goto gameover; - context._cmp(context.data.byte(kNewlocation), 255); - if (!context.flags.z()) + _cmp(data.byte(kNewlocation), 255); + if (!flags.z()) goto loadnew; goto mainloop; gameover: - clearbeforeload(context); - showgun(context); - fadescreendown(context); - context.cx = 100; - hangon(context); + clearbeforeload(); + showgun(); + fadescreendown(); + cx = 100; + hangon(); goto dodecisions; endofgame: - clearbeforeload(context); - fadescreendowns(context); - context.cx = 200; - hangon(context); - endgame(context); - { quickquit2(context); return; }; + clearbeforeload(); + fadescreendowns(); + cx = 200; + hangon(); + endgame(); + { quickquit2(); return; }; } -void __start(Context &context) { +void DreamGenContext::__start() { static const uint8 src[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -22446,756 +21973,756 @@ void __start(Context &context) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - context.ds.assign(src, src + sizeof(src)); -dreamweb(context); + ds.assign(src, src + sizeof(src)); +dreamweb(); } -void __dispatch_call(Context &context, unsigned addr) { +void DreamGenContext::__dispatch_call(uint16 addr) { switch(addr) { - case 0xc000: alleybarksound(context); break; - case 0xc004: intromusic(context); break; - case 0xc008: foghornsound(context); break; - case 0xc00c: receptionist(context); break; - case 0xc010: smokebloke(context); break; - case 0xc014: attendant(context); break; - case 0xc018: manasleep(context); break; - case 0xc01c: eden(context); break; - case 0xc020: edeninbath(context); break; - case 0xc024: malefan(context); break; - case 0xc028: femalefan(context); break; - case 0xc02c: louis(context); break; - case 0xc030: louischair(context); break; - case 0xc034: manasleep2(context); break; - case 0xc038: mansatstill(context); break; - case 0xc03c: tattooman(context); break; - case 0xc040: drinker(context); break; - case 0xc044: bartender(context); break; - case 0xc048: othersmoker(context); break; - case 0xc04c: barwoman(context); break; - case 0xc050: interviewer(context); break; - case 0xc054: soldier1(context); break; - case 0xc058: rockstar(context); break; - case 0xc05c: helicopter(context); break; - case 0xc060: mugger(context); break; - case 0xc064: aide(context); break; - case 0xc068: businessman(context); break; - case 0xc06c: poolguard(context); break; - case 0xc070: security(context); break; - case 0xc074: heavy(context); break; - case 0xc078: bossman(context); break; - case 0xc07c: gamer(context); break; - case 0xc080: sparkydrip(context); break; - case 0xc084: carparkdrip(context); break; - case 0xc088: keeper(context); break; - case 0xc08c: candles1(context); break; - case 0xc090: smallcandle(context); break; - case 0xc094: intromagic1(context); break; - case 0xc098: candles(context); break; - case 0xc09c: candles2(context); break; - case 0xc0a0: gates(context); break; - case 0xc0a4: intromagic2(context); break; - case 0xc0a8: intromagic3(context); break; - case 0xc0ac: intromonks1(context); break; - case 0xc0b0: intromonks2(context); break; - case 0xc0b4: handclap(context); break; - case 0xc0b8: monks2text(context); break; - case 0xc0bc: intro1text(context); break; - case 0xc0c0: intro2text(context); break; - case 0xc0c4: intro3text(context); break; - case 0xc0c8: monkandryan(context); break; - case 0xc0cc: endgameseq(context); break; - case 0xc0d0: rollendcredits(context); break; - case 0xc0d4: priest(context); break; - case 0xc0d8: madmanstelly(context); break; - case 0xc0dc: madman(context); break; - case 0xc0e0: madmantext(context); break; - case 0xc0e4: madmode(context); break; - case 0xc0e8: priesttext(context); break; - case 0xc0ec: textforend(context); break; - case 0xc0f0: textformonk(context); break; - case 0xc0f4: drunk(context); break; - case 0xc0f8: advisor(context); break; - case 0xc0fc: copper(context); break; - case 0xc100: sparky(context); break; - case 0xc104: train(context); break; - case 0xc108: addtopeoplelist(context); break; - case 0xc10c: showgamereel(context); break; - case 0xc110: checkspeed(context); break; - case 0xc114: clearsprites(context); break; - case 0xc118: makesprite(context); break; - case 0xc11c: delsprite(context); break; - case 0xc120: spriteupdate(context); break; - case 0xc124: printsprites(context); break; - case 0xc128: printasprite(context); break; - case 0xc12c: checkone(context); break; - case 0xc130: findsource(context); break; - case 0xc134: initman(context); break; - case 0xc138: mainman(context); break; - case 0xc13c: aboutturn(context); break; - case 0xc140: walking(context); break; - case 0xc144: facerightway(context); break; - case 0xc148: checkforexit(context); break; - case 0xc14c: adjustdown(context); break; - case 0xc150: adjustup(context); break; - case 0xc154: adjustleft(context); break; - case 0xc158: adjustright(context); break; - case 0xc15c: reminders(context); break; - case 0xc160: initrain(context); break; - case 0xc164: splitintolines(context); break; - case 0xc168: getblockofpixel(context); break; - case 0xc16c: showrain(context); break; - case 0xc170: backobject(context); break; - case 0xc174: liftsprite(context); break; - case 0xc178: liftnoise(context); break; - case 0xc17c: random(context); break; - case 0xc180: steady(context); break; - case 0xc184: constant(context); break; - case 0xc188: doorway(context); break; - case 0xc18c: widedoor(context); break; - case 0xc190: dodoor(context); break; - case 0xc194: lockeddoorway(context); break; - case 0xc198: updatepeople(context); break; - case 0xc19c: getreelframeax(context); break; - case 0xc1a0: reelsonscreen(context); break; - case 0xc1a4: plotreel(context); break; - case 0xc1a8: soundonreels(context); break; - case 0xc1ac: reconstruct(context); break; - case 0xc1b0: dealwithspecial(context); break; - case 0xc1b4: movemap(context); break; - case 0xc1b8: getreelstart(context); break; - case 0xc1bc: showreelframe(context); break; - case 0xc1c0: deleverything(context); break; - case 0xc1c4: dumpeverything(context); break; - case 0xc1c8: allocatework(context); break; - case 0xc1cc: showpcx(context); break; - case 0xc1d0: readabyte(context); break; - case 0xc1d4: readoneblock(context); break; - case 0xc1d8: loadpalfromiff(context); break; - case 0xc1dc: setmode(context); break; - case 0xc1ec: paneltomap(context); break; - case 0xc1f0: maptopanel(context); break; - case 0xc1f4: dumpmap(context); break; - case 0xc1f8: pixelcheckset(context); break; - case 0xc1fc: createpanel(context); break; - case 0xc200: createpanel2(context); break; - case 0xc204: clearwork(context); break; - case 0xc208: vsync(context); break; - case 0xc20c: doshake(context); break; - case 0xc210: zoom(context); break; - case 0xc214: delthisone(context); break; - case 0xc228: doblocks(context); break; - case 0xc22c: showframe(context); break; - case 0xc230: frameoutv(context); break; - case 0xc238: frameoutbh(context); break; - case 0xc23c: frameoutfx(context); break; - case 0xc240: transferinv(context); break; - case 0xc244: transfermap(context); break; - case 0xc248: fadedos(context); break; - case 0xc24c: dofade(context); break; - case 0xc250: clearendpal(context); break; - case 0xc254: clearpalette(context); break; - case 0xc258: fadescreenup(context); break; - case 0xc25c: fadetowhite(context); break; - case 0xc260: fadefromwhite(context); break; - case 0xc264: fadescreenups(context); break; - case 0xc268: fadescreendownhalf(context); break; - case 0xc26c: fadescreenuphalf(context); break; - case 0xc270: fadescreendown(context); break; - case 0xc274: fadescreendowns(context); break; - case 0xc278: clearstartpal(context); break; - case 0xc27c: showgun(context); break; - case 0xc280: rollendcredits2(context); break; - case 0xc284: rollem(context); break; - case 0xc288: fadecalculation(context); break; - case 0xc28c: greyscalesum(context); break; - case 0xc290: showgroup(context); break; - case 0xc294: paltostartpal(context); break; - case 0xc298: endpaltostart(context); break; - case 0xc29c: startpaltoend(context); break; - case 0xc2a0: paltoendpal(context); break; - case 0xc2a4: allpalette(context); break; - case 0xc2a8: dumpcurrent(context); break; - case 0xc2ac: fadedownmon(context); break; - case 0xc2b0: fadeupmon(context); break; - case 0xc2b4: fadeupmonfirst(context); break; - case 0xc2b8: fadeupyellows(context); break; - case 0xc2bc: initialmoncols(context); break; - case 0xc2c0: titles(context); break; - case 0xc2c4: endgame(context); break; - case 0xc2c8: monkspeaking(context); break; - case 0xc2cc: showmonk(context); break; - case 0xc2d0: gettingshot(context); break; - case 0xc2d4: credits(context); break; - case 0xc2d8: biblequote(context); break; - case 0xc2dc: hangone(context); break; - case 0xc2e0: intro(context); break; - case 0xc2e4: runintroseq(context); break; - case 0xc2e8: runendseq(context); break; - case 0xc2ec: loadintroroom(context); break; - case 0xc2f0: mode640x480(context); break; - case 0xc2f4: set16colpalette(context); break; - case 0xc2f8: realcredits(context); break; - case 0xc2fc: printchar(context); break; - case 0xc300: kernchars(context); break; - case 0xc304: printslow(context); break; - case 0xc308: waitframes(context); break; - case 0xc30c: printboth(context); break; - case 0xc310: printdirect(context); break; - case 0xc314: monprint(context); break; - case 0xc318: getnumber(context); break; - case 0xc31c: getnextword(context); break; - case 0xc320: fillryan(context); break; - case 0xc324: fillopen(context); break; - case 0xc328: findallryan(context); break; - case 0xc32c: findallopen(context); break; - case 0xc330: obtoinv(context); break; - case 0xc334: isitworn(context); break; - case 0xc338: makeworn(context); break; - case 0xc33c: examineob(context); break; - case 0xc340: makemainscreen(context); break; - case 0xc344: getbackfromob(context); break; - case 0xc348: incryanpage(context); break; - case 0xc34c: openinv(context); break; - case 0xc350: showryanpage(context); break; - case 0xc354: openob(context); break; - case 0xc358: obicons(context); break; - case 0xc35c: examicon(context); break; - case 0xc360: obpicture(context); break; - case 0xc364: describeob(context); break; - case 0xc368: additionaltext(context); break; - case 0xc36c: obsthatdothings(context); break; - case 0xc370: getobtextstart(context); break; - case 0xc374: searchforsame(context); break; - case 0xc378: findnextcolon(context); break; - case 0xc37c: inventory(context); break; - case 0xc380: setpickup(context); break; - case 0xc384: examinventory(context); break; - case 0xc388: reexfrominv(context); break; - case 0xc38c: reexfromopen(context); break; - case 0xc390: swapwithinv(context); break; - case 0xc394: swapwithopen(context); break; - case 0xc398: intoinv(context); break; - case 0xc39c: deletetaken(context); break; - case 0xc3a0: outofinv(context); break; - case 0xc3a4: getfreead(context); break; - case 0xc3a8: getexad(context); break; - case 0xc3ac: geteitherad(context); break; - case 0xc3b0: getanyad(context); break; - case 0xc3b4: getanyaddir(context); break; - case 0xc3b8: getopenedsize(context); break; - case 0xc3bc: getsetad(context); break; - case 0xc3c0: findinvpos(context); break; - case 0xc3c4: findopenpos(context); break; - case 0xc3c8: dropobject(context); break; - case 0xc3cc: droperror(context); break; - case 0xc3d0: cantdrop(context); break; - case 0xc3d4: wornerror(context); break; - case 0xc3d8: removeobfrominv(context); break; - case 0xc3dc: selectopenob(context); break; - case 0xc3e0: useopened(context); break; - case 0xc3e4: errormessage1(context); break; - case 0xc3e8: errormessage2(context); break; - case 0xc3ec: errormessage3(context); break; - case 0xc3f0: checkobjectsize(context); break; - case 0xc3f4: outofopen(context); break; - case 0xc3f8: transfertoex(context); break; - case 0xc3fc: pickupconts(context); break; - case 0xc400: transfercontoex(context); break; - case 0xc404: transfertext(context); break; - case 0xc408: getexpos(context); break; - case 0xc40c: purgealocation(context); break; - case 0xc410: emergencypurge(context); break; - case 0xc414: purgeanitem(context); break; - case 0xc418: deleteexobject(context); break; - case 0xc41c: deleteexframe(context); break; - case 0xc420: deleteextext(context); break; - case 0xc424: blockget(context); break; - case 0xc428: drawfloor(context); break; - case 0xc42c: calcmapad(context); break; - case 0xc430: getdimension(context); break; - case 0xc434: addalong(context); break; - case 0xc438: addlength(context); break; - case 0xc43c: drawflags(context); break; - case 0xc440: eraseoldobs(context); break; - case 0xc444: showallobs(context); break; - case 0xc448: makebackob(context); break; - case 0xc44c: showallfree(context); break; - case 0xc450: showallex(context); break; - case 0xc454: calcfrframe(context); break; - case 0xc458: finalframe(context); break; - case 0xc45c: adjustlen(context); break; - case 0xc460: getmapad(context); break; - case 0xc464: getxad(context); break; - case 0xc468: getyad(context); break; - case 0xc46c: autolook(context); break; - case 0xc470: look(context); break; - case 0xc474: dolook(context); break; - case 0xc478: redrawmainscrn(context); break; - case 0xc47c: getback1(context); break; - case 0xc480: talk(context); break; - case 0xc484: convicons(context); break; - case 0xc488: getpersframe(context); break; - case 0xc48c: starttalk(context); break; - case 0xc490: getpersontext(context); break; - case 0xc494: moretalk(context); break; - case 0xc498: dosometalk(context); break; - case 0xc49c: hangonpq(context); break; - case 0xc4a0: redes(context); break; - case 0xc4a4: newplace(context); break; - case 0xc4a8: selectlocation(context); break; - case 0xc4ac: showcity(context); break; - case 0xc4b0: lookatplace(context); break; - case 0xc4b4: getundercentre(context); break; - case 0xc4b8: putundercentre(context); break; - case 0xc4bc: locationpic(context); break; - case 0xc4c0: getdestinfo(context); break; - case 0xc4c4: showarrows(context); break; - case 0xc4c8: nextdest(context); break; - case 0xc4cc: lastdest(context); break; - case 0xc4d0: destselect(context); break; - case 0xc4d4: getlocation(context); break; - case 0xc4d8: setlocation(context); break; - case 0xc4dc: resetlocation(context); break; - case 0xc4e0: readdesticon(context); break; - case 0xc4e4: readcitypic(context); break; - case 0xc4e8: usemon(context); break; - case 0xc4ec: printoutermon(context); break; - case 0xc4f0: loadpersonal(context); break; - case 0xc4f4: loadnews(context); break; - case 0xc4f8: loadcart(context); break; - case 0xc4fc: lookininterface(context); break; - case 0xc500: turnonpower(context); break; - case 0xc504: randomaccess(context); break; - case 0xc508: powerlighton(context); break; - case 0xc50c: powerlightoff(context); break; - case 0xc510: accesslighton(context); break; - case 0xc514: accesslightoff(context); break; - case 0xc518: locklighton(context); break; - case 0xc51c: locklightoff(context); break; - case 0xc520: input(context); break; - case 0xc524: makecaps(context); break; - case 0xc528: delchar(context); break; - case 0xc52c: execcommand(context); break; - case 0xc530: neterror(context); break; - case 0xc534: dircom(context); break; - case 0xc538: searchforfiles(context); break; - case 0xc53c: signon(context); break; - case 0xc540: showkeys(context); break; - case 0xc544: read(context); break; - case 0xc548: dirfile(context); break; - case 0xc54c: getkeyandlogo(context); break; - case 0xc550: searchforstring(context); break; - case 0xc554: parser(context); break; - case 0xc558: scrollmonitor(context); break; - case 0xc55c: lockmon(context); break; - case 0xc560: monitorlogo(context); break; - case 0xc564: printlogo(context); break; - case 0xc568: showcurrentfile(context); break; - case 0xc56c: monmessage(context); break; - case 0xc570: processtrigger(context); break; - case 0xc574: triggermessage(context); break; - case 0xc578: printcurs(context); break; - case 0xc57c: delcurs(context); break; - case 0xc580: useobject(context); break; - case 0xc584: useroutine(context); break; - case 0xc588: wheelsound(context); break; - case 0xc58c: runtap(context); break; - case 0xc590: playguitar(context); break; - case 0xc594: hotelcontrol(context); break; - case 0xc598: hotelbell(context); break; - case 0xc59c: opentomb(context); break; - case 0xc5a0: usetrainer(context); break; - case 0xc5a4: nothelderror(context); break; - case 0xc5a8: usepipe(context); break; - case 0xc5ac: usefullcart(context); break; - case 0xc5b0: useplinth(context); break; - case 0xc5b4: chewy(context); break; - case 0xc5b8: useladder(context); break; - case 0xc5bc: useladderb(context); break; - case 0xc5c0: slabdoora(context); break; - case 0xc5c4: slabdoorb(context); break; - case 0xc5c8: slabdoord(context); break; - case 0xc5cc: slabdoorc(context); break; - case 0xc5d0: slabdoore(context); break; - case 0xc5d4: slabdoorf(context); break; - case 0xc5d8: useslab(context); break; - case 0xc5dc: usecart(context); break; - case 0xc5e0: useclearbox(context); break; - case 0xc5e4: usecoveredbox(context); break; - case 0xc5e8: userailing(context); break; - case 0xc5ec: useopenbox(context); break; - case 0xc5f0: wearwatch(context); break; - case 0xc5f4: wearshades(context); break; - case 0xc5f8: sitdowninbar(context); break; - case 0xc5fc: usechurchhole(context); break; - case 0xc600: usehole(context); break; - case 0xc604: usealtar(context); break; - case 0xc608: opentvdoor(context); break; - case 0xc60c: usedryer(context); break; - case 0xc610: openlouis(context); break; - case 0xc614: nextcolon(context); break; - case 0xc618: openyourneighbour(context); break; - case 0xc61c: usewindow(context); break; - case 0xc620: usebalcony(context); break; - case 0xc624: openryan(context); break; - case 0xc628: openpoolboss(context); break; - case 0xc62c: openeden(context); break; - case 0xc630: opensarters(context); break; - case 0xc634: isitright(context); break; - case 0xc638: drawitall(context); break; - case 0xc63c: openhoteldoor(context); break; - case 0xc640: openhoteldoor2(context); break; - case 0xc644: grafittidoor(context); break; - case 0xc648: trapdoor(context); break; - case 0xc64c: callhotellift(context); break; - case 0xc650: calledenslift(context); break; - case 0xc654: calledensdlift(context); break; - case 0xc658: usepoolreader(context); break; - case 0xc65c: uselighter(context); break; - case 0xc660: showseconduse(context); break; - case 0xc664: usecardreader1(context); break; - case 0xc668: usecardreader2(context); break; - case 0xc66c: usecardreader3(context); break; - case 0xc670: usecashcard(context); break; - case 0xc674: lookatcard(context); break; - case 0xc678: moneypoke(context); break; - case 0xc67c: usecontrol(context); break; - case 0xc680: usehatch(context); break; - case 0xc684: usewire(context); break; - case 0xc688: usehandle(context); break; - case 0xc68c: useelevator1(context); break; - case 0xc690: showfirstuse(context); break; - case 0xc694: useelevator3(context); break; - case 0xc698: useelevator4(context); break; - case 0xc69c: useelevator2(context); break; - case 0xc6a0: useelevator5(context); break; - case 0xc6a4: usekey(context); break; - case 0xc6a8: usestereo(context); break; - case 0xc6ac: usecooker(context); break; - case 0xc6b0: useaxe(context); break; - case 0xc6b4: useelvdoor(context); break; - case 0xc6b8: withwhat(context); break; - case 0xc6bc: selectob(context); break; - case 0xc6c0: compare(context); break; - case 0xc6c4: findsetobject(context); break; - case 0xc6c8: findexobject(context); break; - case 0xc6cc: isryanholding(context); break; - case 0xc6d0: checkinside(context); break; - case 0xc6d4: usetext(context); break; - case 0xc6d8: putbackobstuff(context); break; - case 0xc6dc: showpuztext(context); break; - case 0xc6e0: findpuztext(context); break; - case 0xc6e4: placesetobject(context); break; - case 0xc6e8: removesetobject(context); break; - case 0xc6ec: issetobonmap(context); break; - case 0xc6f0: placefreeobject(context); break; - case 0xc6f4: removefreeobject(context); break; - case 0xc6f8: findormake(context); break; - case 0xc6fc: switchryanon(context); break; - case 0xc700: switchryanoff(context); break; - case 0xc704: setallchanges(context); break; - case 0xc708: dochange(context); break; - case 0xc70c: autoappear(context); break; - case 0xc710: getundertimed(context); break; - case 0xc714: putundertimed(context); break; - case 0xc718: dumptimedtext(context); break; - case 0xc71c: setuptimeduse(context); break; - case 0xc720: setuptimedtemp(context); break; - case 0xc724: usetimedtext(context); break; - case 0xc728: edenscdplayer(context); break; - case 0xc72c: usewall(context); break; - case 0xc730: usechurchgate(context); break; - case 0xc734: usegun(context); break; - case 0xc738: useshield(context); break; - case 0xc73c: usebuttona(context); break; - case 0xc740: useplate(context); break; - case 0xc744: usewinch(context); break; - case 0xc748: entercode(context); break; - case 0xc74c: loadkeypad(context); break; - case 0xc750: quitkey(context); break; - case 0xc754: addtopresslist(context); break; - case 0xc758: buttonone(context); break; - case 0xc75c: buttontwo(context); break; - case 0xc760: buttonthree(context); break; - case 0xc764: buttonfour(context); break; - case 0xc768: buttonfive(context); break; - case 0xc76c: buttonsix(context); break; - case 0xc770: buttonseven(context); break; - case 0xc774: buttoneight(context); break; - case 0xc778: buttonnine(context); break; - case 0xc77c: buttonnought(context); break; - case 0xc780: buttonenter(context); break; - case 0xc784: buttonpress(context); break; - case 0xc788: showouterpad(context); break; - case 0xc78c: showkeypad(context); break; - case 0xc790: singlekey(context); break; - case 0xc794: dumpkeypad(context); break; - case 0xc798: usemenu(context); break; - case 0xc79c: dumpmenu(context); break; - case 0xc7a0: getundermenu(context); break; - case 0xc7a4: putundermenu(context); break; - case 0xc7a8: showoutermenu(context); break; - case 0xc7ac: showmenu(context); break; - case 0xc7b0: loadmenu(context); break; - case 0xc7b4: viewfolder(context); break; - case 0xc7b8: nextfolder(context); break; - case 0xc7bc: folderhints(context); break; - case 0xc7c0: lastfolder(context); break; - case 0xc7c4: loadfolder(context); break; - case 0xc7c8: showfolder(context); break; - case 0xc7cc: folderexit(context); break; - case 0xc7d0: showleftpage(context); break; - case 0xc7d4: showrightpage(context); break; - case 0xc7d8: entersymbol(context); break; - case 0xc7dc: quitsymbol(context); break; - case 0xc7e0: settopleft(context); break; - case 0xc7e4: settopright(context); break; - case 0xc7e8: setbotleft(context); break; - case 0xc7ec: setbotright(context); break; - case 0xc7f0: dumpsymbol(context); break; - case 0xc7f4: showsymbol(context); break; - case 0xc7f8: nextsymbol(context); break; - case 0xc7fc: updatesymboltop(context); break; - case 0xc800: updatesymbolbot(context); break; - case 0xc804: dumpsymbox(context); break; - case 0xc808: usediary(context); break; - case 0xc80c: showdiary(context); break; - case 0xc810: showdiarykeys(context); break; - case 0xc814: dumpdiarykeys(context); break; - case 0xc818: diarykeyp(context); break; - case 0xc81c: diarykeyn(context); break; - case 0xc820: showdiarypage(context); break; - case 0xc824: findtext1(context); break; - case 0xc828: zoomonoff(context); break; - case 0xc82c: saveload(context); break; - case 0xc830: dosaveload(context); break; - case 0xc834: getbackfromops(context); break; - case 0xc838: showmainops(context); break; - case 0xc83c: showdiscops(context); break; - case 0xc840: loadsavebox(context); break; - case 0xc844: loadgame(context); break; - case 0xc848: getbacktoops(context); break; - case 0xc84c: discops(context); break; - case 0xc850: savegame(context); break; - case 0xc854: actualsave(context); break; - case 0xc858: actualload(context); break; - case 0xc85c: selectslot2(context); break; - case 0xc860: checkinput(context); break; - case 0xc864: getnamepos(context); break; - case 0xc868: showopbox(context); break; - case 0xc86c: showloadops(context); break; - case 0xc870: showsaveops(context); break; - case 0xc874: selectslot(context); break; - case 0xc878: showslots(context); break; - case 0xc87c: shownames(context); break; - case 0xc880: dosreturn(context); break; - case 0xc884: error(context); break; - case 0xc888: namestoold(context); break; - case 0xc88c: oldtonames(context); break; - case 0xc890: savefilewrite(context); break; - case 0xc894: savefileread(context); break; - case 0xc898: saveposition(context); break; - case 0xc89c: loadposition(context); break; - case 0xc8a0: loadseg(context); break; - case 0xc8a4: makeheader(context); break; - case 0xc8a8: storeit(context); break; - case 0xc8ac: saveseg(context); break; - case 0xc8b0: findlen(context); break; - case 0xc8b4: scanfornames(context); break; - case 0xc8b8: decide(context); break; - case 0xc8bc: showdecisions(context); break; - case 0xc8c0: newgame(context); break; - case 0xc8c4: loadold(context); break; - case 0xc8c8: loadspeech(context); break; - case 0xc8cc: createname(context); break; - case 0xc8d0: loadsample(context); break; - case 0xc8d4: loadsecondsample(context); break; - case 0xc8d8: soundstartup(context); break; - case 0xc8dc: trysoundalloc(context); break; - case 0xc8e0: setsoundoff(context); break; - case 0xc8e4: checksoundint(context); break; - case 0xc8e8: enablesoundint(context); break; - case 0xc8ec: disablesoundint(context); break; - case 0xc8f0: interupttest(context); break; - case 0xc8f4: soundend(context); break; - case 0xc8f8: out22c(context); break; - case 0xc8fc: playchannel0(context); break; - case 0xc900: playchannel1(context); break; - case 0xc904: makenextblock(context); break; - case 0xc908: volumeadjust(context); break; - case 0xc90c: loopchannel0(context); break; - case 0xc910: cancelch0(context); break; - case 0xc914: cancelch1(context); break; - case 0xc918: channel0only(context); break; - case 0xc91c: channel1only(context); break; - case 0xc920: channel0tran(context); break; - case 0xc924: bothchannels(context); break; - case 0xc928: saveems(context); break; - case 0xc92c: restoreems(context); break; - case 0xc930: domix(context); break; - case 0xc934: dmaend(context); break; - case 0xc938: startdmablock(context); break; - case 0xc93c: setuppit(context); break; - case 0xc940: getridofpit(context); break; - case 0xc944: pitinterupt(context); break; - case 0xc948: dreamweb(context); break; - case 0xc94c: entrytexts(context); break; - case 0xc950: entryanims(context); break; - case 0xc954: initialinv(context); break; - case 0xc958: pickupob(context); break; - case 0xc95c: setupemm(context); break; - case 0xc960: removeemm(context); break; - case 0xc964: checkforemm(context); break; - case 0xc968: checkbasemem(context); break; - case 0xc96c: allocatebuffers(context); break; - case 0xc970: clearbuffers(context); break; - case 0xc974: clearchanges(context); break; - case 0xc978: clearbeforeload(context); break; - case 0xc97c: clearreels(context); break; - case 0xc980: clearrest(context); break; - case 0xc984: deallocatemem(context); break; - case 0xc988: allocatemem(context); break; - case 0xc990: parseblaster(context); break; - case 0xc994: startup(context); break; - case 0xc998: startup1(context); break; - case 0xc99c: screenupdate(context); break; - case 0xc9a0: watchreel(context); break; - case 0xc9a4: checkforshake(context); break; - case 0xc9a8: watchcount(context); break; - case 0xc9ac: showtime(context); break; - case 0xc9b0: dumpwatch(context); break; - case 0xc9b4: showbyte(context); break; - case 0xc9b8: onedigit(context); break; - case 0xc9bc: twodigitnum(context); break; - case 0xc9c0: showword(context); break; - case 0xc9c4: convnum(context); break; - case 0xc9c8: mainscreen(context); break; - case 0xc9cc: madmanrun(context); break; - case 0xc9d0: checkcoords(context); break; - case 0xc9d4: identifyob(context); break; - case 0xc9d8: checkifperson(context); break; - case 0xc9dc: checkifset(context); break; - case 0xc9e0: checkifex(context); break; - case 0xc9e4: checkiffree(context); break; - case 0xc9e8: isitdescribed(context); break; - case 0xc9ec: findpathofpoint(context); break; - case 0xc9f0: findfirstpath(context); break; - case 0xc9f4: turnpathon(context); break; - case 0xc9f8: turnpathoff(context); break; - case 0xc9fc: turnanypathon(context); break; - case 0xca00: turnanypathoff(context); break; - case 0xca04: checkifpathison(context); break; - case 0xca08: afternewroom(context); break; - case 0xca0c: atmospheres(context); break; - case 0xca10: walkintoroom(context); break; - case 0xca14: afterintroroom(context); break; - case 0xca18: obname(context); break; - case 0xca1c: finishedwalking(context); break; - case 0xca20: examineobtext(context); break; - case 0xca24: commandwithob(context); break; - case 0xca28: commandonly(context); break; - case 0xca2c: printmessage(context); break; - case 0xca30: printmessage2(context); break; - case 0xca34: blocknametext(context); break; - case 0xca38: personnametext(context); break; - case 0xca3c: walktotext(context); break; - case 0xca40: getflagunderp(context); break; - case 0xca44: setwalk(context); break; - case 0xca48: autosetwalk(context); break; - case 0xca4c: checkdest(context); break; - case 0xca50: bresenhams(context); break; - case 0xca54: workoutframes(context); break; - case 0xca58: getroomspaths(context); break; - case 0xca5c: copyname(context); break; - case 0xca60: findobname(context); break; - case 0xca64: showicon(context); break; - case 0xca68: middlepanel(context); break; - case 0xca6c: showman(context); break; - case 0xca70: showpanel(context); break; - case 0xca74: roomname(context); break; - case 0xca78: usecharset1(context); break; - case 0xca7c: usetempcharset(context); break; - case 0xca80: showexit(context); break; - case 0xca84: panelicons1(context); break; - case 0xca88: showwatch(context); break; - case 0xca8c: gettime(context); break; - case 0xca90: zoomicon(context); break; - case 0xca94: showblink(context); break; - case 0xca98: dumpblink(context); break; - case 0xca9c: worktoscreenm(context); break; - case 0xcaa0: blank(context); break; - case 0xcaa4: allpointer(context); break; - case 0xcaa8: hangonp(context); break; - case 0xcaac: hangonw(context); break; - case 0xcab0: hangoncurs(context); break; - case 0xcab4: getunderzoom(context); break; - case 0xcab8: dumpzoom(context); break; - case 0xcabc: putunderzoom(context); break; - case 0xcac0: crosshair(context); break; - case 0xcac4: showpointer(context); break; - case 0xcac8: delpointer(context); break; - case 0xcacc: dumppointer(context); break; - case 0xcad0: undertextline(context); break; - case 0xcad4: deltextline(context); break; - case 0xcad8: dumptextline(context); break; - case 0xcadc: animpointer(context); break; - case 0xcae0: setmouse(context); break; - case 0xcae4: readmouse(context); break; - case 0xcae8: mousecall(context); break; - case 0xcaec: readmouse1(context); break; - case 0xcaf0: readmouse2(context); break; - case 0xcaf4: readmouse3(context); break; - case 0xcaf8: readmouse4(context); break; - case 0xcafc: readkey(context); break; - case 0xcb00: convertkey(context); break; - case 0xcb04: randomnum1(context); break; - case 0xcb08: randomnum2(context); break; - case 0xcb10: hangon(context); break; - case 0xcb14: loadtraveltext(context); break; - case 0xcb18: loadintotemp(context); break; - case 0xcb1c: loadintotemp2(context); break; - case 0xcb20: loadintotemp3(context); break; - case 0xcb24: loadtempcharset(context); break; - case 0xcb28: standardload(context); break; - case 0xcb2c: loadtemptext(context); break; - case 0xcb30: loadroom(context); break; - case 0xcb34: loadroomssample(context); break; - case 0xcb38: getridofreels(context); break; - case 0xcb3c: getridofall(context); break; - case 0xcb40: restorereels(context); break; - case 0xcb44: restoreall(context); break; - case 0xcb48: sortoutmap(context); break; - case 0xcb4c: startloading(context); break; - case 0xcb50: disablepath(context); break; - case 0xcb54: findxyfrompath(context); break; - case 0xcb58: findroominloc(context); break; - case 0xcb5c: getroomdata(context); break; - case 0xcb60: readheader(context); break; - case 0xcb64: dontloadseg(context); break; - case 0xcb68: allocateload(context); break; - case 0xcb6c: fillspace(context); break; - case 0xcb70: getridoftemp(context); break; - case 0xcb74: getridoftemptext(context); break; - case 0xcb78: getridoftemp2(context); break; - case 0xcb7c: getridoftemp3(context); break; - case 0xcb80: getridoftempcharset(context); break; - case 0xcb84: getridoftempsp(context); break; - case 0xcb88: readsetdata(context); break; - case 0xcb8c: createfile(context); break; - case 0xcb90: openfile(context); break; - case 0xcb94: openfilefromc(context); break; - case 0xcb98: makename(context); break; - case 0xcb9c: openfilenocheck(context); break; - case 0xcba0: openforsave(context); break; - case 0xcba4: closefile(context); break; - case 0xcba8: readfromfile(context); break; - case 0xcbac: setkeyboardint(context); break; - case 0xcbb0: resetkeyboard(context); break; - case 0xcbb4: keyboardread(context); break; - case 0xcbb8: walkandexamine(context); break; - case 0xcbbc: doload(context); break; - case 0xcbc0: generalerror(context); break; - default: ::error("invalid call to %04x dispatched", (uint16)context.ax); + case 0xc000: alleybarksound(); break; + case 0xc004: intromusic(); break; + case 0xc008: foghornsound(); break; + case 0xc00c: receptionist(); break; + case 0xc010: smokebloke(); break; + case 0xc014: attendant(); break; + case 0xc018: manasleep(); break; + case 0xc01c: eden(); break; + case 0xc020: edeninbath(); break; + case 0xc024: malefan(); break; + case 0xc028: femalefan(); break; + case 0xc02c: louis(); break; + case 0xc030: louischair(); break; + case 0xc034: manasleep2(); break; + case 0xc038: mansatstill(); break; + case 0xc03c: tattooman(); break; + case 0xc040: drinker(); break; + case 0xc044: bartender(); break; + case 0xc048: othersmoker(); break; + case 0xc04c: barwoman(); break; + case 0xc050: interviewer(); break; + case 0xc054: soldier1(); break; + case 0xc058: rockstar(); break; + case 0xc05c: helicopter(); break; + case 0xc060: mugger(); break; + case 0xc064: aide(); break; + case 0xc068: businessman(); break; + case 0xc06c: poolguard(); break; + case 0xc070: security(); break; + case 0xc074: heavy(); break; + case 0xc078: bossman(); break; + case 0xc07c: gamer(); break; + case 0xc080: sparkydrip(); break; + case 0xc084: carparkdrip(); break; + case 0xc088: keeper(); break; + case 0xc08c: candles1(); break; + case 0xc090: smallcandle(); break; + case 0xc094: intromagic1(); break; + case 0xc098: candles(); break; + case 0xc09c: candles2(); break; + case 0xc0a0: gates(); break; + case 0xc0a4: intromagic2(); break; + case 0xc0a8: intromagic3(); break; + case 0xc0ac: intromonks1(); break; + case 0xc0b0: intromonks2(); break; + case 0xc0b4: handclap(); break; + case 0xc0b8: monks2text(); break; + case 0xc0bc: intro1text(); break; + case 0xc0c0: intro2text(); break; + case 0xc0c4: intro3text(); break; + case 0xc0c8: monkandryan(); break; + case 0xc0cc: endgameseq(); break; + case 0xc0d0: rollendcredits(); break; + case 0xc0d4: priest(); break; + case 0xc0d8: madmanstelly(); break; + case 0xc0dc: madman(); break; + case 0xc0e0: madmantext(); break; + case 0xc0e4: madmode(); break; + case 0xc0e8: priesttext(); break; + case 0xc0ec: textforend(); break; + case 0xc0f0: textformonk(); break; + case 0xc0f4: drunk(); break; + case 0xc0f8: advisor(); break; + case 0xc0fc: copper(); break; + case 0xc100: sparky(); break; + case 0xc104: train(); break; + case 0xc108: addtopeoplelist(); break; + case 0xc10c: showgamereel(); break; + case 0xc110: checkspeed(); break; + case 0xc114: clearsprites(); break; + case 0xc118: makesprite(); break; + case 0xc11c: delsprite(); break; + case 0xc120: spriteupdate(); break; + case 0xc124: printsprites(); break; + case 0xc128: printasprite(); break; + case 0xc12c: checkone(); break; + case 0xc130: findsource(); break; + case 0xc134: initman(); break; + case 0xc138: mainman(); break; + case 0xc13c: aboutturn(); break; + case 0xc140: walking(); break; + case 0xc144: facerightway(); break; + case 0xc148: checkforexit(); break; + case 0xc14c: adjustdown(); break; + case 0xc150: adjustup(); break; + case 0xc154: adjustleft(); break; + case 0xc158: adjustright(); break; + case 0xc15c: reminders(); break; + case 0xc160: initrain(); break; + case 0xc164: splitintolines(); break; + case 0xc168: getblockofpixel(); break; + case 0xc16c: showrain(); break; + case 0xc170: backobject(); break; + case 0xc174: liftsprite(); break; + case 0xc178: liftnoise(); break; + case 0xc17c: random(); break; + case 0xc180: steady(); break; + case 0xc184: constant(); break; + case 0xc188: doorway(); break; + case 0xc18c: widedoor(); break; + case 0xc190: dodoor(); break; + case 0xc194: lockeddoorway(); break; + case 0xc198: updatepeople(); break; + case 0xc19c: getreelframeax(); break; + case 0xc1a0: reelsonscreen(); break; + case 0xc1a4: plotreel(); break; + case 0xc1a8: soundonreels(); break; + case 0xc1ac: reconstruct(); break; + case 0xc1b0: dealwithspecial(); break; + case 0xc1b4: movemap(); break; + case 0xc1b8: getreelstart(); break; + case 0xc1bc: showreelframe(); break; + case 0xc1c0: deleverything(); break; + case 0xc1c4: dumpeverything(); break; + case 0xc1c8: allocatework(); break; + case 0xc1cc: showpcx(); break; + case 0xc1d0: readabyte(); break; + case 0xc1d4: readoneblock(); break; + case 0xc1d8: loadpalfromiff(); break; + case 0xc1dc: setmode(); break; + case 0xc1ec: paneltomap(); break; + case 0xc1f0: maptopanel(); break; + case 0xc1f4: dumpmap(); break; + case 0xc1f8: pixelcheckset(); break; + case 0xc1fc: createpanel(); break; + case 0xc200: createpanel2(); break; + case 0xc204: clearwork(); break; + case 0xc208: vsync(); break; + case 0xc20c: doshake(); break; + case 0xc210: zoom(); break; + case 0xc214: delthisone(); break; + case 0xc228: doblocks(); break; + case 0xc22c: showframe(); break; + case 0xc230: frameoutv(); break; + case 0xc238: frameoutbh(); break; + case 0xc23c: frameoutfx(); break; + case 0xc240: transferinv(); break; + case 0xc244: transfermap(); break; + case 0xc248: fadedos(); break; + case 0xc24c: dofade(); break; + case 0xc250: clearendpal(); break; + case 0xc254: clearpalette(); break; + case 0xc258: fadescreenup(); break; + case 0xc25c: fadetowhite(); break; + case 0xc260: fadefromwhite(); break; + case 0xc264: fadescreenups(); break; + case 0xc268: fadescreendownhalf(); break; + case 0xc26c: fadescreenuphalf(); break; + case 0xc270: fadescreendown(); break; + case 0xc274: fadescreendowns(); break; + case 0xc278: clearstartpal(); break; + case 0xc27c: showgun(); break; + case 0xc280: rollendcredits2(); break; + case 0xc284: rollem(); break; + case 0xc288: fadecalculation(); break; + case 0xc28c: greyscalesum(); break; + case 0xc290: showgroup(); break; + case 0xc294: paltostartpal(); break; + case 0xc298: endpaltostart(); break; + case 0xc29c: startpaltoend(); break; + case 0xc2a0: paltoendpal(); break; + case 0xc2a4: allpalette(); break; + case 0xc2a8: dumpcurrent(); break; + case 0xc2ac: fadedownmon(); break; + case 0xc2b0: fadeupmon(); break; + case 0xc2b4: fadeupmonfirst(); break; + case 0xc2b8: fadeupyellows(); break; + case 0xc2bc: initialmoncols(); break; + case 0xc2c0: titles(); break; + case 0xc2c4: endgame(); break; + case 0xc2c8: monkspeaking(); break; + case 0xc2cc: showmonk(); break; + case 0xc2d0: gettingshot(); break; + case 0xc2d4: credits(); break; + case 0xc2d8: biblequote(); break; + case 0xc2dc: hangone(); break; + case 0xc2e0: intro(); break; + case 0xc2e4: runintroseq(); break; + case 0xc2e8: runendseq(); break; + case 0xc2ec: loadintroroom(); break; + case 0xc2f0: mode640x480(); break; + case 0xc2f4: set16colpalette(); break; + case 0xc2f8: realcredits(); break; + case 0xc2fc: printchar(); break; + case 0xc300: kernchars(); break; + case 0xc304: printslow(); break; + case 0xc308: waitframes(); break; + case 0xc30c: printboth(); break; + case 0xc310: printdirect(); break; + case 0xc314: monprint(); break; + case 0xc318: getnumber(); break; + case 0xc31c: getnextword(); break; + case 0xc320: fillryan(); break; + case 0xc324: fillopen(); break; + case 0xc328: findallryan(); break; + case 0xc32c: findallopen(); break; + case 0xc330: obtoinv(); break; + case 0xc334: isitworn(); break; + case 0xc338: makeworn(); break; + case 0xc33c: examineob(); break; + case 0xc340: makemainscreen(); break; + case 0xc344: getbackfromob(); break; + case 0xc348: incryanpage(); break; + case 0xc34c: openinv(); break; + case 0xc350: showryanpage(); break; + case 0xc354: openob(); break; + case 0xc358: obicons(); break; + case 0xc35c: examicon(); break; + case 0xc360: obpicture(); break; + case 0xc364: describeob(); break; + case 0xc368: additionaltext(); break; + case 0xc36c: obsthatdothings(); break; + case 0xc370: getobtextstart(); break; + case 0xc374: searchforsame(); break; + case 0xc378: findnextcolon(); break; + case 0xc37c: inventory(); break; + case 0xc380: setpickup(); break; + case 0xc384: examinventory(); break; + case 0xc388: reexfrominv(); break; + case 0xc38c: reexfromopen(); break; + case 0xc390: swapwithinv(); break; + case 0xc394: swapwithopen(); break; + case 0xc398: intoinv(); break; + case 0xc39c: deletetaken(); break; + case 0xc3a0: outofinv(); break; + case 0xc3a4: getfreead(); break; + case 0xc3a8: getexad(); break; + case 0xc3ac: geteitherad(); break; + case 0xc3b0: getanyad(); break; + case 0xc3b4: getanyaddir(); break; + case 0xc3b8: getopenedsize(); break; + case 0xc3bc: getsetad(); break; + case 0xc3c0: findinvpos(); break; + case 0xc3c4: findopenpos(); break; + case 0xc3c8: dropobject(); break; + case 0xc3cc: droperror(); break; + case 0xc3d0: cantdrop(); break; + case 0xc3d4: wornerror(); break; + case 0xc3d8: removeobfrominv(); break; + case 0xc3dc: selectopenob(); break; + case 0xc3e0: useopened(); break; + case 0xc3e4: errormessage1(); break; + case 0xc3e8: errormessage2(); break; + case 0xc3ec: errormessage3(); break; + case 0xc3f0: checkobjectsize(); break; + case 0xc3f4: outofopen(); break; + case 0xc3f8: transfertoex(); break; + case 0xc3fc: pickupconts(); break; + case 0xc400: transfercontoex(); break; + case 0xc404: transfertext(); break; + case 0xc408: getexpos(); break; + case 0xc40c: purgealocation(); break; + case 0xc410: emergencypurge(); break; + case 0xc414: purgeanitem(); break; + case 0xc418: deleteexobject(); break; + case 0xc41c: deleteexframe(); break; + case 0xc420: deleteextext(); break; + case 0xc424: blockget(); break; + case 0xc428: drawfloor(); break; + case 0xc42c: calcmapad(); break; + case 0xc430: getdimension(); break; + case 0xc434: addalong(); break; + case 0xc438: addlength(); break; + case 0xc43c: drawflags(); break; + case 0xc440: eraseoldobs(); break; + case 0xc444: showallobs(); break; + case 0xc448: makebackob(); break; + case 0xc44c: showallfree(); break; + case 0xc450: showallex(); break; + case 0xc454: calcfrframe(); break; + case 0xc458: finalframe(); break; + case 0xc45c: adjustlen(); break; + case 0xc460: getmapad(); break; + case 0xc464: getxad(); break; + case 0xc468: getyad(); break; + case 0xc46c: autolook(); break; + case 0xc470: look(); break; + case 0xc474: dolook(); break; + case 0xc478: redrawmainscrn(); break; + case 0xc47c: getback1(); break; + case 0xc480: talk(); break; + case 0xc484: convicons(); break; + case 0xc488: getpersframe(); break; + case 0xc48c: starttalk(); break; + case 0xc490: getpersontext(); break; + case 0xc494: moretalk(); break; + case 0xc498: dosometalk(); break; + case 0xc49c: hangonpq(); break; + case 0xc4a0: redes(); break; + case 0xc4a4: newplace(); break; + case 0xc4a8: selectlocation(); break; + case 0xc4ac: showcity(); break; + case 0xc4b0: lookatplace(); break; + case 0xc4b4: getundercentre(); break; + case 0xc4b8: putundercentre(); break; + case 0xc4bc: locationpic(); break; + case 0xc4c0: getdestinfo(); break; + case 0xc4c4: showarrows(); break; + case 0xc4c8: nextdest(); break; + case 0xc4cc: lastdest(); break; + case 0xc4d0: destselect(); break; + case 0xc4d4: getlocation(); break; + case 0xc4d8: setlocation(); break; + case 0xc4dc: resetlocation(); break; + case 0xc4e0: readdesticon(); break; + case 0xc4e4: readcitypic(); break; + case 0xc4e8: usemon(); break; + case 0xc4ec: printoutermon(); break; + case 0xc4f0: loadpersonal(); break; + case 0xc4f4: loadnews(); break; + case 0xc4f8: loadcart(); break; + case 0xc4fc: lookininterface(); break; + case 0xc500: turnonpower(); break; + case 0xc504: randomaccess(); break; + case 0xc508: powerlighton(); break; + case 0xc50c: powerlightoff(); break; + case 0xc510: accesslighton(); break; + case 0xc514: accesslightoff(); break; + case 0xc518: locklighton(); break; + case 0xc51c: locklightoff(); break; + case 0xc520: input(); break; + case 0xc524: makecaps(); break; + case 0xc528: delchar(); break; + case 0xc52c: execcommand(); break; + case 0xc530: neterror(); break; + case 0xc534: dircom(); break; + case 0xc538: searchforfiles(); break; + case 0xc53c: signon(); break; + case 0xc540: showkeys(); break; + case 0xc544: read(); break; + case 0xc548: dirfile(); break; + case 0xc54c: getkeyandlogo(); break; + case 0xc550: searchforstring(); break; + case 0xc554: parser(); break; + case 0xc558: scrollmonitor(); break; + case 0xc55c: lockmon(); break; + case 0xc560: monitorlogo(); break; + case 0xc564: printlogo(); break; + case 0xc568: showcurrentfile(); break; + case 0xc56c: monmessage(); break; + case 0xc570: processtrigger(); break; + case 0xc574: triggermessage(); break; + case 0xc578: printcurs(); break; + case 0xc57c: delcurs(); break; + case 0xc580: useobject(); break; + case 0xc584: useroutine(); break; + case 0xc588: wheelsound(); break; + case 0xc58c: runtap(); break; + case 0xc590: playguitar(); break; + case 0xc594: hotelcontrol(); break; + case 0xc598: hotelbell(); break; + case 0xc59c: opentomb(); break; + case 0xc5a0: usetrainer(); break; + case 0xc5a4: nothelderror(); break; + case 0xc5a8: usepipe(); break; + case 0xc5ac: usefullcart(); break; + case 0xc5b0: useplinth(); break; + case 0xc5b4: chewy(); break; + case 0xc5b8: useladder(); break; + case 0xc5bc: useladderb(); break; + case 0xc5c0: slabdoora(); break; + case 0xc5c4: slabdoorb(); break; + case 0xc5c8: slabdoord(); break; + case 0xc5cc: slabdoorc(); break; + case 0xc5d0: slabdoore(); break; + case 0xc5d4: slabdoorf(); break; + case 0xc5d8: useslab(); break; + case 0xc5dc: usecart(); break; + case 0xc5e0: useclearbox(); break; + case 0xc5e4: usecoveredbox(); break; + case 0xc5e8: userailing(); break; + case 0xc5ec: useopenbox(); break; + case 0xc5f0: wearwatch(); break; + case 0xc5f4: wearshades(); break; + case 0xc5f8: sitdowninbar(); break; + case 0xc5fc: usechurchhole(); break; + case 0xc600: usehole(); break; + case 0xc604: usealtar(); break; + case 0xc608: opentvdoor(); break; + case 0xc60c: usedryer(); break; + case 0xc610: openlouis(); break; + case 0xc614: nextcolon(); break; + case 0xc618: openyourneighbour(); break; + case 0xc61c: usewindow(); break; + case 0xc620: usebalcony(); break; + case 0xc624: openryan(); break; + case 0xc628: openpoolboss(); break; + case 0xc62c: openeden(); break; + case 0xc630: opensarters(); break; + case 0xc634: isitright(); break; + case 0xc638: drawitall(); break; + case 0xc63c: openhoteldoor(); break; + case 0xc640: openhoteldoor2(); break; + case 0xc644: grafittidoor(); break; + case 0xc648: trapdoor(); break; + case 0xc64c: callhotellift(); break; + case 0xc650: calledenslift(); break; + case 0xc654: calledensdlift(); break; + case 0xc658: usepoolreader(); break; + case 0xc65c: uselighter(); break; + case 0xc660: showseconduse(); break; + case 0xc664: usecardreader1(); break; + case 0xc668: usecardreader2(); break; + case 0xc66c: usecardreader3(); break; + case 0xc670: usecashcard(); break; + case 0xc674: lookatcard(); break; + case 0xc678: moneypoke(); break; + case 0xc67c: usecontrol(); break; + case 0xc680: usehatch(); break; + case 0xc684: usewire(); break; + case 0xc688: usehandle(); break; + case 0xc68c: useelevator1(); break; + case 0xc690: showfirstuse(); break; + case 0xc694: useelevator3(); break; + case 0xc698: useelevator4(); break; + case 0xc69c: useelevator2(); break; + case 0xc6a0: useelevator5(); break; + case 0xc6a4: usekey(); break; + case 0xc6a8: usestereo(); break; + case 0xc6ac: usecooker(); break; + case 0xc6b0: useaxe(); break; + case 0xc6b4: useelvdoor(); break; + case 0xc6b8: withwhat(); break; + case 0xc6bc: selectob(); break; + case 0xc6c0: compare(); break; + case 0xc6c4: findsetobject(); break; + case 0xc6c8: findexobject(); break; + case 0xc6cc: isryanholding(); break; + case 0xc6d0: checkinside(); break; + case 0xc6d4: usetext(); break; + case 0xc6d8: putbackobstuff(); break; + case 0xc6dc: showpuztext(); break; + case 0xc6e0: findpuztext(); break; + case 0xc6e4: placesetobject(); break; + case 0xc6e8: removesetobject(); break; + case 0xc6ec: issetobonmap(); break; + case 0xc6f0: placefreeobject(); break; + case 0xc6f4: removefreeobject(); break; + case 0xc6f8: findormake(); break; + case 0xc6fc: switchryanon(); break; + case 0xc700: switchryanoff(); break; + case 0xc704: setallchanges(); break; + case 0xc708: dochange(); break; + case 0xc70c: autoappear(); break; + case 0xc710: getundertimed(); break; + case 0xc714: putundertimed(); break; + case 0xc718: dumptimedtext(); break; + case 0xc71c: setuptimeduse(); break; + case 0xc720: setuptimedtemp(); break; + case 0xc724: usetimedtext(); break; + case 0xc728: edenscdplayer(); break; + case 0xc72c: usewall(); break; + case 0xc730: usechurchgate(); break; + case 0xc734: usegun(); break; + case 0xc738: useshield(); break; + case 0xc73c: usebuttona(); break; + case 0xc740: useplate(); break; + case 0xc744: usewinch(); break; + case 0xc748: entercode(); break; + case 0xc74c: loadkeypad(); break; + case 0xc750: quitkey(); break; + case 0xc754: addtopresslist(); break; + case 0xc758: buttonone(); break; + case 0xc75c: buttontwo(); break; + case 0xc760: buttonthree(); break; + case 0xc764: buttonfour(); break; + case 0xc768: buttonfive(); break; + case 0xc76c: buttonsix(); break; + case 0xc770: buttonseven(); break; + case 0xc774: buttoneight(); break; + case 0xc778: buttonnine(); break; + case 0xc77c: buttonnought(); break; + case 0xc780: buttonenter(); break; + case 0xc784: buttonpress(); break; + case 0xc788: showouterpad(); break; + case 0xc78c: showkeypad(); break; + case 0xc790: singlekey(); break; + case 0xc794: dumpkeypad(); break; + case 0xc798: usemenu(); break; + case 0xc79c: dumpmenu(); break; + case 0xc7a0: getundermenu(); break; + case 0xc7a4: putundermenu(); break; + case 0xc7a8: showoutermenu(); break; + case 0xc7ac: showmenu(); break; + case 0xc7b0: loadmenu(); break; + case 0xc7b4: viewfolder(); break; + case 0xc7b8: nextfolder(); break; + case 0xc7bc: folderhints(); break; + case 0xc7c0: lastfolder(); break; + case 0xc7c4: loadfolder(); break; + case 0xc7c8: showfolder(); break; + case 0xc7cc: folderexit(); break; + case 0xc7d0: showleftpage(); break; + case 0xc7d4: showrightpage(); break; + case 0xc7d8: entersymbol(); break; + case 0xc7dc: quitsymbol(); break; + case 0xc7e0: settopleft(); break; + case 0xc7e4: settopright(); break; + case 0xc7e8: setbotleft(); break; + case 0xc7ec: setbotright(); break; + case 0xc7f0: dumpsymbol(); break; + case 0xc7f4: showsymbol(); break; + case 0xc7f8: nextsymbol(); break; + case 0xc7fc: updatesymboltop(); break; + case 0xc800: updatesymbolbot(); break; + case 0xc804: dumpsymbox(); break; + case 0xc808: usediary(); break; + case 0xc80c: showdiary(); break; + case 0xc810: showdiarykeys(); break; + case 0xc814: dumpdiarykeys(); break; + case 0xc818: diarykeyp(); break; + case 0xc81c: diarykeyn(); break; + case 0xc820: showdiarypage(); break; + case 0xc824: findtext1(); break; + case 0xc828: zoomonoff(); break; + case 0xc82c: saveload(); break; + case 0xc830: dosaveload(); break; + case 0xc834: getbackfromops(); break; + case 0xc838: showmainops(); break; + case 0xc83c: showdiscops(); break; + case 0xc840: loadsavebox(); break; + case 0xc844: loadgame(); break; + case 0xc848: getbacktoops(); break; + case 0xc84c: discops(); break; + case 0xc850: savegame(); break; + case 0xc854: actualsave(); break; + case 0xc858: actualload(); break; + case 0xc85c: selectslot2(); break; + case 0xc860: checkinput(); break; + case 0xc864: getnamepos(); break; + case 0xc868: showopbox(); break; + case 0xc86c: showloadops(); break; + case 0xc870: showsaveops(); break; + case 0xc874: selectslot(); break; + case 0xc878: showslots(); break; + case 0xc87c: shownames(); break; + case 0xc880: dosreturn(); break; + case 0xc884: error(); break; + case 0xc888: namestoold(); break; + case 0xc88c: oldtonames(); break; + case 0xc890: savefilewrite(); break; + case 0xc894: savefileread(); break; + case 0xc898: saveposition(); break; + case 0xc89c: loadposition(); break; + case 0xc8a0: loadseg(); break; + case 0xc8a4: makeheader(); break; + case 0xc8a8: storeit(); break; + case 0xc8ac: saveseg(); break; + case 0xc8b0: findlen(); break; + case 0xc8b4: scanfornames(); break; + case 0xc8b8: decide(); break; + case 0xc8bc: showdecisions(); break; + case 0xc8c0: newgame(); break; + case 0xc8c4: loadold(); break; + case 0xc8c8: loadspeech(); break; + case 0xc8cc: createname(); break; + case 0xc8d0: loadsample(); break; + case 0xc8d4: loadsecondsample(); break; + case 0xc8d8: soundstartup(); break; + case 0xc8dc: trysoundalloc(); break; + case 0xc8e0: setsoundoff(); break; + case 0xc8e4: checksoundint(); break; + case 0xc8e8: enablesoundint(); break; + case 0xc8ec: disablesoundint(); break; + case 0xc8f0: interupttest(); break; + case 0xc8f4: soundend(); break; + case 0xc8f8: out22c(); break; + case 0xc8fc: playchannel0(); break; + case 0xc900: playchannel1(); break; + case 0xc904: makenextblock(); break; + case 0xc908: volumeadjust(); break; + case 0xc90c: loopchannel0(); break; + case 0xc910: cancelch0(); break; + case 0xc914: cancelch1(); break; + case 0xc918: channel0only(); break; + case 0xc91c: channel1only(); break; + case 0xc920: channel0tran(); break; + case 0xc924: bothchannels(); break; + case 0xc928: saveems(); break; + case 0xc92c: restoreems(); break; + case 0xc930: domix(); break; + case 0xc934: dmaend(); break; + case 0xc938: startdmablock(); break; + case 0xc93c: setuppit(); break; + case 0xc940: getridofpit(); break; + case 0xc944: pitinterupt(); break; + case 0xc948: dreamweb(); break; + case 0xc94c: entrytexts(); break; + case 0xc950: entryanims(); break; + case 0xc954: initialinv(); break; + case 0xc958: pickupob(); break; + case 0xc95c: setupemm(); break; + case 0xc960: removeemm(); break; + case 0xc964: checkforemm(); break; + case 0xc968: checkbasemem(); break; + case 0xc96c: allocatebuffers(); break; + case 0xc970: clearbuffers(); break; + case 0xc974: clearchanges(); break; + case 0xc978: clearbeforeload(); break; + case 0xc97c: clearreels(); break; + case 0xc980: clearrest(); break; + case 0xc984: deallocatemem(); break; + case 0xc988: allocatemem(); break; + case 0xc990: parseblaster(); break; + case 0xc994: startup(); break; + case 0xc998: startup1(); break; + case 0xc99c: screenupdate(); break; + case 0xc9a0: watchreel(); break; + case 0xc9a4: checkforshake(); break; + case 0xc9a8: watchcount(); break; + case 0xc9ac: showtime(); break; + case 0xc9b0: dumpwatch(); break; + case 0xc9b4: showbyte(); break; + case 0xc9b8: onedigit(); break; + case 0xc9bc: twodigitnum(); break; + case 0xc9c0: showword(); break; + case 0xc9c4: convnum(); break; + case 0xc9c8: mainscreen(); break; + case 0xc9cc: madmanrun(); break; + case 0xc9d0: checkcoords(); break; + case 0xc9d4: identifyob(); break; + case 0xc9d8: checkifperson(); break; + case 0xc9dc: checkifset(); break; + case 0xc9e0: checkifex(); break; + case 0xc9e4: checkiffree(); break; + case 0xc9e8: isitdescribed(); break; + case 0xc9ec: findpathofpoint(); break; + case 0xc9f0: findfirstpath(); break; + case 0xc9f4: turnpathon(); break; + case 0xc9f8: turnpathoff(); break; + case 0xc9fc: turnanypathon(); break; + case 0xca00: turnanypathoff(); break; + case 0xca04: checkifpathison(); break; + case 0xca08: afternewroom(); break; + case 0xca0c: atmospheres(); break; + case 0xca10: walkintoroom(); break; + case 0xca14: afterintroroom(); break; + case 0xca18: obname(); break; + case 0xca1c: finishedwalking(); break; + case 0xca20: examineobtext(); break; + case 0xca24: commandwithob(); break; + case 0xca28: commandonly(); break; + case 0xca2c: printmessage(); break; + case 0xca30: printmessage2(); break; + case 0xca34: blocknametext(); break; + case 0xca38: personnametext(); break; + case 0xca3c: walktotext(); break; + case 0xca40: getflagunderp(); break; + case 0xca44: setwalk(); break; + case 0xca48: autosetwalk(); break; + case 0xca4c: checkdest(); break; + case 0xca50: bresenhams(); break; + case 0xca54: workoutframes(); break; + case 0xca58: getroomspaths(); break; + case 0xca5c: copyname(); break; + case 0xca60: findobname(); break; + case 0xca64: showicon(); break; + case 0xca68: middlepanel(); break; + case 0xca6c: showman(); break; + case 0xca70: showpanel(); break; + case 0xca74: roomname(); break; + case 0xca78: usecharset1(); break; + case 0xca7c: usetempcharset(); break; + case 0xca80: showexit(); break; + case 0xca84: panelicons1(); break; + case 0xca88: showwatch(); break; + case 0xca8c: gettime(); break; + case 0xca90: zoomicon(); break; + case 0xca94: showblink(); break; + case 0xca98: dumpblink(); break; + case 0xca9c: worktoscreenm(); break; + case 0xcaa0: blank(); break; + case 0xcaa4: allpointer(); break; + case 0xcaa8: hangonp(); break; + case 0xcaac: hangonw(); break; + case 0xcab0: hangoncurs(); break; + case 0xcab4: getunderzoom(); break; + case 0xcab8: dumpzoom(); break; + case 0xcabc: putunderzoom(); break; + case 0xcac0: crosshair(); break; + case 0xcac4: showpointer(); break; + case 0xcac8: delpointer(); break; + case 0xcacc: dumppointer(); break; + case 0xcad0: undertextline(); break; + case 0xcad4: deltextline(); break; + case 0xcad8: dumptextline(); break; + case 0xcadc: animpointer(); break; + case 0xcae0: setmouse(); break; + case 0xcae4: readmouse(); break; + case 0xcae8: mousecall(); break; + case 0xcaec: readmouse1(); break; + case 0xcaf0: readmouse2(); break; + case 0xcaf4: readmouse3(); break; + case 0xcaf8: readmouse4(); break; + case 0xcafc: readkey(); break; + case 0xcb00: convertkey(); break; + case 0xcb04: randomnum1(); break; + case 0xcb08: randomnum2(); break; + case 0xcb10: hangon(); break; + case 0xcb14: loadtraveltext(); break; + case 0xcb18: loadintotemp(); break; + case 0xcb1c: loadintotemp2(); break; + case 0xcb20: loadintotemp3(); break; + case 0xcb24: loadtempcharset(); break; + case 0xcb28: standardload(); break; + case 0xcb2c: loadtemptext(); break; + case 0xcb30: loadroom(); break; + case 0xcb34: loadroomssample(); break; + case 0xcb38: getridofreels(); break; + case 0xcb3c: getridofall(); break; + case 0xcb40: restorereels(); break; + case 0xcb44: restoreall(); break; + case 0xcb48: sortoutmap(); break; + case 0xcb4c: startloading(); break; + case 0xcb50: disablepath(); break; + case 0xcb54: findxyfrompath(); break; + case 0xcb58: findroominloc(); break; + case 0xcb5c: getroomdata(); break; + case 0xcb60: readheader(); break; + case 0xcb64: dontloadseg(); break; + case 0xcb68: allocateload(); break; + case 0xcb6c: fillspace(); break; + case 0xcb70: getridoftemp(); break; + case 0xcb74: getridoftemptext(); break; + case 0xcb78: getridoftemp2(); break; + case 0xcb7c: getridoftemp3(); break; + case 0xcb80: getridoftempcharset(); break; + case 0xcb84: getridoftempsp(); break; + case 0xcb88: readsetdata(); break; + case 0xcb8c: createfile(); break; + case 0xcb90: openfile(); break; + case 0xcb94: openfilefromc(); break; + case 0xcb98: makename(); break; + case 0xcb9c: openfilenocheck(); break; + case 0xcba0: openforsave(); break; + case 0xcba4: closefile(); break; + case 0xcba8: readfromfile(); break; + case 0xcbac: setkeyboardint(); break; + case 0xcbb0: resetkeyboard(); break; + case 0xcbb4: keyboardread(); break; + case 0xcbb8: walkandexamine(); break; + case 0xcbbc: doload(); break; + case 0xcbc0: generalerror(); break; + default: ::error("invalid call to %04x dispatched", (uint16)ax); } } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5dd8e847c1..a70f06d496 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -8,76 +8,10 @@ namespace DreamGen { - void __dispatch_call(Context &context, unsigned addr); - void __start(Context &context); - - void randomnumber(Context &context); - void quickquit(Context &context); - void quickquit2(Context &context); - void seecommandtail(Context &context); - void multiget(Context &context); - void multiput(Context &context); - void multidump(Context &context); - void frameoutnm(Context &context); - void cls(Context &context); - void printundermon(Context &context); - void worktoscreen(Context &context); - void width160(Context &context); - void keyboardread(Context &context); - void resetkeyboard(Context &context); - void setkeyboardint(Context &context); - void readfromfile(Context &context); - void closefile(Context &context); - void openforsave(Context &context); - void openfilenocheck(Context &context); - void openfilefromc(Context &context); - void openfile(Context &context); - void createfile(Context &context); - void dontloadseg(Context &context); - void mousecall(Context &context); - void setmouse(Context &context); - void gettime(Context &context); - void allocatemem(Context &context); - void deallocatemem(Context &context); - void removeemm(Context &context); - void setupemm(Context &context); - void pitinterupt(Context &context); - void getridofpit(Context &context); - void setuppit(Context &context); - void startdmablock(Context &context); - void dmaend(Context &context); - void restoreems(Context &context); - void saveems(Context &context); - void bothchannels(Context &context); - void channel1only(Context &context); - void channel0only(Context &context); - void out22c(Context &context); - void soundend(Context &context); - void interupttest(Context &context); - void disablesoundint(Context &context); - void enablesoundint(Context &context); - void checksoundint(Context &context); - void setsoundoff(Context &context); - void soundstartup(Context &context); - void loadsecondsample(Context &context); - void loadsample(Context &context); - void loadspeech(Context &context); - void saveseg(Context &context); - void loadseg(Context &context); - void savefileread(Context &context); - void savefilewrite(Context &context); - void error(Context &context); - void generalerror(Context &context); - void dosreturn(Context &context); - void set16colpalette(Context &context); - void mode640x480(Context &context); - void showgroup(Context &context); - void fadedos(Context &context); - void doshake(Context &context); - void vsync(Context &context); - void setmode(Context &context); - void readoneblock(Context &context); - void showpcx(Context &context); +class DreamGenContext : public Context { +public: + void __start(); + void __dispatch_call(uint16 addr); const static uint16 kStartvars = 0; const static uint16 kProgresspoints = 1; @@ -646,7 +580,762 @@ namespace DreamGen { const static uint16 kMenux = (80+40); const static uint16 kLenofreelrouts = (991-534); - + void bothchannels(); + void usewire(); + void getnamepos(); + void drawitall(); + void clearstartpal(); + void femalefan(); + void greyscalesum(); + void showgamereel(); + void identifyob(); + void trysoundalloc(); + void uselighter(); + void showmenu(); + void usepoolreader(); + void showgroup(); + void startdmablock(); + void useopenbox(); + void clearbuffers(); + void neterror(); + void storeit(); + void lockeddoorway(); + void isitworn(); + void putundertimed(); + void dumpmap(); + void multidump(); + void channel0only(); + void worktoscreenm(); + void removeemm(); + void mansatstill(); + 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 bresenhams(); + void getbackfromops(); + void frameoutv(); + void restoreall(); + void screenupdate(); + void addlength(); + void usetimedtext(); + void putundercentre(); + void checkobjectsize(); + void commandonly(); + void adjustlen(); + 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 multiget(); + void fadeupmonfirst(); + void drawfloor(); + void loadkeypad(); + void findsource(); + void clearendpal(); + void findtext1(); + void isryanholding(); + void interupttest(); + void usecashcard(); + void usewall(); + void opentomb(); + void buttonfour(); + void dosometalk(); + void lockmon(); + void dochange(); + void getanyaddir(); + void showsaveops(); + void intromonks1(); + void resetlocation(); + void oldtonames(); + void showdiscops(); + void advisor(); + void additionaltext(); + void kernchars(); + void othersmoker(); + void autosetwalk(); + void setuptimedtemp(); + void blocknametext(); + void useelevator5(); + void useelevator4(); + void useelevator1(); + void attendant(); + 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 readsetdata(); + void loadintotemp(); + void loadintroroom(); + void saveseg(); + void showblink(); + void mousecall(); + void train(); + void watchcount(); + void fadedownmon(); + void loadcart(); + void splitintolines(); + void bartender(); + void eden(); + void showdiary(); + void purgealocation(); + void updatepeople(); + void slabdoorf(); + void addtopeoplelist(); + void hangoncurs(); + void sparkydrip(); + void compare(); + void printcurs(); + void convertkey(); + void outofopen(); + void dealwithspecial(); + void dircom(); + void liftsprite(); + void dumpkeypad(); + void dumpzoom(); + void endgameseq(); + void cancelch0(); + void setbotleft(); + void findfirstpath(); + void showallfree(); + void loadold(); + void loadtempcharset(); + void useslab(); + 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 reminders(); + void selectslot2(); + void runtap(); + void domix(); + void priesttext(); + void paneltomap(); + void obname(); + void getridoftemp3(); + void getridoftemp2(); + void usebalcony(); + void runendseq(); + void dumpdiarykeys(); + void disablesoundint(); + void checkifset(); + void showallex(); + void showrain(); + void openpoolboss(); + void buttontwo(); + void fillopen(); + void delsprite(); + void getroomspaths(); + void dumptextline(); + void fadescreendownhalf(); + void useplate(); + void candles1(); + void lookininterface(); + void manasleep(); + void isitdescribed(); + void hotelbell(); + void loadspeech(); + void cls(); + void printsprites(); + void dumptimedtext(); + void showallobs(); + void getnumber(); + void adjustleft(); + void calledenslift(); + void useclearbox(); + void entryanims(); + void nextfolder(); + void getfreead(); + void showarrows(); + void walkintoroom(); + void getridoftemptext(); + void printoutermon(); + void setuppit(); + void showpcx(); + void showdecisions(); + void checkspeed(); + void printchar(); + void showkeypad(); + void obtoinv(); + void removeobfrominv(); + void usecoveredbox(); + void openyourneighbour(); + void fadescreenuphalf(); + void getridoftempcharset(); + 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 wornerror(); + void entersymbol(); + void showword(); + void dirfile(); + void setmode(); + void walktotext(); + void pickupconts(); + void locklightoff(); + void wearwatch(); + void runintroseq(); + void doblocks(); + void showbyte(); + void allpalette(); + void findormake(); + void nextsymbol(); + void monks2text(); + void poolguard(); + void clearpalette(); + void cantdrop(); + void maptopanel(); + void calcmapad(); + void getridofall(); + void copper(); + void folderhints(); + void openhoteldoor(); + void removesetobject(); + void checkifperson(); + void frameoutfx(); + void blank(); + void drinker(); + void nextcolon(); + void placefreeobject(); + void delpointer(); + void loopchannel0(); + void initrain(); + void showleftpage(); + void rockstar(); + void adjustright(); + void putunderzoom(); + void vsync(); + void showseconduse(); + void turnpathoff(); + void findinvpos(); + void usetext(); + void hangonpq(); + 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 dumpmenu(); + void chewy(); + void accesslighton(); + void dosreturn(); + void titles(); + void quickquit(); + void showpointer(); + void usecooker(); + void loadmenu(); + void checkforemm(); + void checkifpathison(); + void smallcandle(); + void receptionist(); + void selectslot(); + void edenscdplayer(); + void readoneblock(); + void fadeupmon(); + void paltoendpal(); + void fadetowhite(); + void textformonk(); + void loadsavebox(); + void fadescreenup(); + void soundend(); + void redes(); + void errormessage1(); + void clearchanges(); + void errormessage3(); + void deletetaken(); + void putundermenu(); + void checkifex(); + void intromagic2(); + void findobname(); + void edeninbath(); + void intromagic1(); + void showdiarypage(); + void useshield(); + void getbacktoops(); + void rollendcredits(); + void intro1text(); + void getmapad(); + void playchannel1(); + void playchannel0(); + void usemon(); + void steady(); + void pixelcheckset(); + void reexfrominv(); + void fillspace(); + void talk(); + void usedryer(); + void dumpeverything(); + void usehatch(); + void zoom(); + void outofinv(); + void viewfolder(); + void walking(); + void diarykeyp(); + void readabyte(); + void showframe(); + void random(); + void obicons(); + void frameoutbh(); + void channel1only(); + void playguitar(); + 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 showmainops(); + void madmanstelly(); + void constant(); + void loadroomssample(); + void getblockofpixel(); + void paltostartpal(); + void bossman(); + void getridofpit(); + void convnum(); + void nothelderror(); + void readheader(); + void getsetad(); + void getyad(); + void reconstruct(); + void soldier1(); + void getundercentre(); + void checkforexit(); + void loadseg(); + void makeheader(); + void setkeyboardint(); + void priest(); + void readmouse(); + void powerlighton(); + void savefilewrite(); + void printmessage2(); + void loadnews(); + void rollem(); + void makeworn(); + void examineobtext(); + void startup(); + void savegame(); + void startpaltoend(); + void showicon(); + void findopenpos(); + void describeob(); + void deleteexframe(); + void folderexit(); + void useplinth(); + void wheelsound(); + void actualsave(); + void autolook(); + void checkbasemem(); + void transfertext(); + void searchforsame(); + void enablesoundint(); + void getback1(); + void setlocation(); + void fadefromwhite(); + void animpointer(); + 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 showexit(); + void printundermon(); + void buttonnine(); + void findallopen(); + void loadintotemp3(); + void loadintotemp2(); + void gamer(); + void personnametext(); + void quitsymbol(); + void readfromfile(); + void initialinv(); + void showslots(); + void dofade(); + void hangon(); + 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 helicopter(); + void scrollmonitor(); + void setsoundoff(); + void setpickup(); + void dropobject(); + void printmessage(); + void reexfromopen(); + void fillryan(); + void loadtemptext(); + void usestereo(); + void showcurrentfile(); + 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 afterintroroom(); + 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 doorway(); + void useopened(); + void inventory(); + void powerlightoff(); + void getroomdata(); + void showoutermenu(); + void signon(); + void deleteextext(); + void foghornsound(); + void showrightpage(); + void openhoteldoor2(); + void examicon(); + void showgun(); + void switchryanon(); + void louischair(); + void saveems(); + void locationpic(); + void getflagunderp(); + void dolook(); + void opentvdoor(); + void triggermessage(); + void finalframe(); + void plotreel(); + void swapwithopen(); + void makesprite(); + void dreamweb(); + void droperror(); + void openfilenocheck(); + void calledensdlift(); + void checkinside(); + void gates(); + void selectlocation(); + void showwatch(); + void turnanypathon(); + void restorereels(); + void setwalk(); + void printboth(); + void useroutine(); + void zoomicon(); + void hotelcontrol(); + void findpathofpoint(); + void issetobonmap(); + void getdestinfo(); + void drunk(); + void dumpblink(); + void setuptimeduse(); + void grafittidoor(); + void input(); + void nextdest(); + void getdimension(); + void makecaps(); + void read(); + void fadescreenups(); + void checkdest(); + void initman(); + void loadpalfromiff(); + void facerightway(); + void startup1(); + void findlen(); + void showsymbol(); + 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 readmouse1(); + void showman(); + void readmouse2(); + void newplace(); + void movemap(); + void loadsample(); + void usecardreader1(); + void usecardreader2(); + void usecardreader3(); + void tattooman(); + void usehandle(); + void quitkey(); + void openfile(); + void usecharset1(); + void makenextblock(); + void showpuztext(); + void addalong(); + void width160(); + void incryanpage(); + void dodoor(); + void eraseoldobs(); + void buttoneight(); + void opensarters(); + 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 aide(); + void openforsave(); + void closefile(); + void delcurs(); + void randomaccess(); + void calcfrframe(); + void intromagic3(); + void initialmoncols(); + void checkforshake(); + void usebuttona(); + void cancelch1(); + 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 finishedwalking(); + void findallryan(); + void channel0tran(); + void buttonpress(); + void parseblaster(); + void callhotellift(); + void makemainscreen(); + void intromonks2(); + void usewinch(); + void setbotright(); + void readmouse3(); + void showfirstuse(); + void setupemm(); + void usefullcart(); + void transfertoex(); + void getlocation(); + void geteitherad(); + void placesetobject(); + void drawflags(); + void zoomonoff(); + void updatesymboltop(); + void showryanpage(); + void printlogo(); + void allpointer(); + void checksoundint(); + void clearreels(); + void malefan(); + void dosaveload(); + void createname(); + void readcitypic(); + void getpersontext(); + void intoinv(); + void showtime(); + void parser(); + void hangonw(); + void intro(); + void hangonp(); + void fadescreendowns(); + void showloadops(); + void getridoftempsp(); + void scanfornames(); + void setallchanges(); + void newgame(); + void examinventory(); + void standardload(); + void undertextline(); + void findroominloc(); + void sitdowninbar(); + void shownames(); + void savefileread(); + void emergencypurge(); + void usemenu(); + void alleybarksound(); + void usecart(); + void intromusic(); + void makename(); + void processtrigger(); + void monmessage(); + void readdesticon(); + void randomnum2(); + void loadsecondsample(); + void transfercontoex(); + void multiput(); + void isitright(); + 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 mainman(); + void volumeadjust(); + void checkiffree(); +}; } #endif diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 37d47b26c5..cb66dda26b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -42,12 +42,6 @@ #include "dreamweb/dreamweb.h" #include "dreamweb/dreamgen.h" -namespace DreamGen { - void doshake(DreamGen::Context &context); - void dofade(DreamGen::Context &context); - void volumeadjust(DreamGen::Context &context); -} - namespace DreamWeb { DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : @@ -100,8 +94,8 @@ void DreamWebEngine::waitForVSync() { setVSyncInterrupt(false); } - DreamGen::doshake(_context); - DreamGen::dofade(_context); + _context.doshake(); + _context.dofade(); _system->updateScreen(); } @@ -139,8 +133,8 @@ void DreamWebEngine::processEvents() { break; case Common::KEYCODE_c: //skip statue puzzle - _context.data.byte(DreamGen::kSymbolbotnum) = 3; - _context.data.byte(DreamGen::kSymboltopnum) = 5; + _context.data.byte(DreamGen::DreamGenContext::kSymbolbotnum) = 3; + _context.data.byte(DreamGen::DreamGenContext::kSymboltopnum) = 5; break; default: @@ -170,7 +164,7 @@ void DreamWebEngine::processEvents() { break; } - _context.data.byte(DreamGen::kLasthardkey) = hardKey; + _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = hardKey; // The rest of the keys are converted to ASCII. This // is fairly restrictive, and eventually we may want @@ -213,7 +207,7 @@ Common::Error DreamWebEngine::run() { getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); //http://martin.hinner.info/vga/timing.html - DreamGen::__start(_context); + _context.__start(); getTimerManager()->removeTimerProc(vSyncInterrupt); @@ -294,13 +288,13 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) { 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::kBufferin) + 1) & 0x0f; - uint16 out = _context.data.word(DreamGen::kBufferout); + uint16 in = (_context.data.word(DreamGen::DreamGenContext::kBufferin) + 1) & 0x0f; + uint16 out = _context.data.word(DreamGen::DreamGenContext::kBufferout); if (in == out) { warning("keyboard buffer is full"); return; } - _context.data.word(DreamGen::kBufferin) = in; + _context.data.word(DreamGen::DreamGenContext::kBufferin) = in; keybuf[in] = ascii; } @@ -326,11 +320,11 @@ void DreamWebEngine::mouseCall() { } void DreamWebEngine::fadeDos() { - _context.ds = _context.es = _context.data.word(DreamGen::kBuffers); + _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::kStartpal, 768); + 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 @@ -379,9 +373,9 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int } void DreamWebEngine::printUnderMonitor() { - _context.es = _context.data.word(DreamGen::kWorkspace); - _context.di = DreamGen::kScreenwidth * 43 + 76; - _context.si = _context.di + 8 * DreamGen::kScreenwidth; + _context.es = _context.data.word(DreamGen::DreamGenContext::kWorkspace); + _context.di = DreamGen::DreamGenContext::kScreenwidth * 43 + 76; + _context.si = _context.di + 8 * DreamGen::DreamGenContext::kScreenwidth; Graphics::Surface *s = _system->lockScreen(); if (!s) @@ -397,8 +391,8 @@ void DreamWebEngine::printUnderMonitor() { ++dst; ++src; } } - _context._add(_context.di, DreamGen::kScreenwidth); - _context._add(_context.si, DreamGen::kScreenwidth); + _context._add(_context.di, DreamGen::DreamGenContext::kScreenwidth); + _context._add(_context.si, DreamGen::DreamGenContext::kScreenwidth); } _context.cx = 0; _system->unlockScreen(); @@ -477,10 +471,10 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) { void DreamWebEngine::soundHandler() { _context.push(_context.ax); - volumeadjust(_context); + _context.volumeadjust(); _context.ax = _context.pop(); - uint volume = _context.data.byte(DreamGen::kVolume); + 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 @@ -496,13 +490,13 @@ void DreamWebEngine::soundHandler() { volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8; _mixer->setChannelVolume(_channelHandle[0], volume); - uint8 ch0 = _context.data.byte(DreamGen::kCh0playing); + uint8 ch0 = _context.data.byte(DreamGen::DreamGenContext::kCh0playing); if (ch0 == 255) ch0 = 0; - uint8 ch1 = _context.data.byte(DreamGen::kCh1playing); + uint8 ch1 = _context.data.byte(DreamGen::DreamGenContext::kCh1playing); if (ch1 == 255) ch1 = 0; - uint8 ch0loop = _context.data.byte(DreamGen::kCh0repeat); + uint8 ch0loop = _context.data.byte(DreamGen::DreamGenContext::kCh0repeat); if (_channel0 != ch0) { _channel0 = ch0; @@ -517,11 +511,11 @@ void DreamWebEngine::soundHandler() { } } if (!_mixer->isSoundHandleActive(_channelHandle[0])) { - _context.data.byte(DreamGen::kCh0playing) = 255; + _context.data.byte(DreamGen::DreamGenContext::kCh0playing) = 255; _channel0 = 0; } if (!_mixer->isSoundHandleActive(_channelHandle[1])) { - _context.data.byte(DreamGen::kCh1playing) = 255; + _context.data.byte(DreamGen::DreamGenContext::kCh1playing) = 255; _channel1 = 0; } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 7ccc0e6cd3..fce4a082cc 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -138,7 +138,7 @@ private: Audio::SoundHandle _channelHandle[2]; uint8 _channel0, _channel1; - DreamGen::Context _context; + DreamGen::DreamGenContext _context; }; } // End of namespace DreamWeb diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 8932e123a8..b8a87bd69e 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -542,9 +542,9 @@ public: }; #ifndef NDEBUG -# define STACK_CHECK(context) StackChecker checker(context) +# define STACK_CHECK StackChecker checker(*this) #else -# define STACK_CHECK(context) do {} while (0) +# define STACK_CHECK do {} while (0) #endif } diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 129186ca07..69f240ae5e 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -13,220 +13,220 @@ Common::String getFilename(Context &context) { return name; } -void multiget(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned x = (uint16)context.di, y = (uint16)context.bx; +void DreamGenContext::multiget() { + unsigned w = (uint8)cl, h = (uint8)ch; + unsigned x = (uint16)di, y = (uint16)bx; unsigned src = x + y * kScreenwidth; - unsigned dst = (uint16)context.si; - context.es = context.ds; - context.ds = context.data.word(kWorkspace); + unsigned dst = (uint16)si; + es = ds; + ds = data.word(kWorkspace); if (y + h > 200) 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)context.ds, (uint16)context.es); + //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) { - uint8 *src_p = context.ds.ptr(src + kScreenwidth * l, w); - uint8 *dst_p = context.es.ptr(dst + w * l, w); + uint8 *src_p = ds.ptr(src + kScreenwidth * l, w); + uint8 *dst_p = es.ptr(dst + w * l, w); memcpy(dst_p, src_p, w); } - context.si += w * h; - context.di = src + kScreenwidth * h; - context.cx = 0; + si += w * h; + di = src + kScreenwidth * h; + cx = 0; } -void multiput(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned x = (uint16)context.di, y = (uint16)context.bx; - unsigned src = (uint16)context.si; +void DreamGenContext::multiput() { + unsigned w = (uint8)cl, h = (uint8)ch; + unsigned x = (uint16)di, y = (uint16)bx; + unsigned src = (uint16)si; unsigned dst = x + y * kScreenwidth; - context.es = context.data.word(kWorkspace); + es = data.word(kWorkspace); if (y + h > 200) h = 200 - y; if (x + w > 320) w = 320 - x; - //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es); + //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es); for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = context.ds.ptr(src + w * l, w); - uint8 *dst_p = context.es.ptr(dst + kScreenwidth * l, w); + uint8 *src_p = ds.ptr(src + w * l, w); + uint8 *dst_p = es.ptr(dst + kScreenwidth * l, w); memcpy(dst_p, src_p, w); } - context.si += w * h; - context.di = dst + kScreenwidth * h; - context.cx = 0; + si += w * h; + di = dst + kScreenwidth * h; + cx = 0; } -void multidump(Context &context) { - context.ds = context.data.word(kWorkspace); - int w = (uint8)context.cl, h = (uint8)context.ch; - int x = (int16)context.di, y = (int16)context.bx; +void DreamGenContext::multidump() { + ds = data.word(kWorkspace); + int w = (uint8)cl, h = (uint8)ch; + int x = (int16)di, y = (int16)bx; unsigned offset = x + y * kScreenwidth; - //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset); - context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); - context.si = context.di = offset + h * kScreenwidth; - context.cx = 0; + //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)ds, x, y, offset); + engine->blit(ds.ptr(offset, w * h), kScreenwidth, x, y, w, h); + si = di = offset + h * kScreenwidth; + cx = 0; } -void worktoscreen(Context &context) { - context.ds = context.data.word(kWorkspace); +void DreamGenContext::worktoscreen() { + ds = data.word(kWorkspace); uint size = 320 * 200; - context.engine->blit(context.ds.ptr(0, size), 320, 0, 0, 320, 200); - context.di = context.si = size; - context.cx = 0; + engine->blit(ds.ptr(0, size), 320, 0, 0, 320, 200); + di = si = size; + cx = 0; } -void printundermon(Context &context) { - context.engine->printUnderMonitor(); +void DreamGenContext::printundermon() { + engine->printUnderMonitor(); } -void cls(Context &context) { - context.engine->cls(); +void DreamGenContext::cls() { + engine->cls(); } -void frameoutnm(Context &context) { - unsigned w = (uint8)context.cl, h = (uint8)context.ch; - unsigned pitch = (uint16)context.dx; - unsigned src = (uint16)context.si; - int x = (uint16)context.di, y = (uint16)context.bx; +void DreamGenContext::frameoutnm() { + unsigned w = (uint8)cl, h = (uint8)ch; + unsigned pitch = (uint16)dx; + unsigned src = (uint16)si; + int x = (uint16)di, y = (uint16)bx; unsigned dst = x + y * pitch; - //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)context.ds, (uint16)context.es); + //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)ds, (uint16)es); for(unsigned l = 0; l < h; ++l) { - uint8 *src_p = context.ds.ptr(src + w * l, w); - uint8 *dst_p = context.es.ptr(dst + pitch * l, w); + uint8 *src_p = ds.ptr(src + w * l, w); + uint8 *dst_p = es.ptr(dst + pitch * l, w); memcpy(dst_p, src_p, w); } - context.di += dst + pitch * h; - context.si += w * h; - context.cx = 0; + di += dst + pitch * h; + si += w * h; + cx = 0; } -void seecommandtail(Context &context) { - context.data.word(kSoundbaseadd) = 0x220; - context.data.byte(kSoundint) = 5; - context.data.byte(kSounddmachannel) = 1; - context.data.byte(kBrightness) = 1; - context.data.word(kHowmuchalloc) = 0x9360; +void DreamGenContext::seecommandtail() { + data.word(kSoundbaseadd) = 0x220; + data.byte(kSoundint) = 5; + data.byte(kSounddmachannel) = 1; + data.byte(kBrightness) = 1; + data.word(kHowmuchalloc) = 0x9360; } -void randomnumber(Context &context) { - context.al = context.engine->randomNumber(); +void DreamGenContext::randomnumber() { + al = engine->randomNumber(); } -void quickquit(Context &context) { - context.engine->quit(); +void DreamGenContext::quickquit() { + engine->quit(); } -void quickquit2(Context &context) { - context.engine->quit(); +void DreamGenContext::quickquit2() { + engine->quit(); } -void keyboardread(Context &context) { +void DreamGenContext::keyboardread() { ::error("keyboardread"); //this keyboard int handler, must never be called } -void resetkeyboard(Context &context) { +void DreamGenContext::resetkeyboard() { } -void setkeyboardint(Context &context) { +void DreamGenContext::setkeyboardint() { } -void readfromfile(Context &context) { - uint16 dst_offset = context.dx; - uint16 size = context.cx; - debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); - context.flags._c = false; +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; } -void closefile(Context &context) { - context.engine->closeFile(); - context.data.byte(kHandle) = 0; +void DreamGenContext::closefile() { + engine->closeFile(); + data.byte(kHandle) = 0; } -void openforsave(Context &context) { - const char *name = (const char *)context.ds.ptr(context.dx, 13); +void DreamGenContext::openforsave() { + const char *name = (const char *)ds.ptr(dx, 13); debug(1, "openforsave(%s)", name); - context.engine->openSaveFileForWriting(name); + engine->openSaveFileForWriting(name); } -void openfilenocheck(Context &context) { - const char *name = (const char *)context.ds.ptr(context.dx, 13); +void DreamGenContext::openfilenocheck() { + const char *name = (const char *)ds.ptr(dx, 13); debug(1, "checksavefile(%s)", name); - bool ok = context.engine->openSaveFileForReading(name); - context.flags._c = !ok; + bool ok = engine->openSaveFileForReading(name); + flags._c = !ok; } -void openfilefromc(Context &context) { - openfilenocheck(context); +void DreamGenContext::openfilefromc() { + openfilenocheck(); } -void openfile(Context &context) { - Common::String name = getFilename(context); +void DreamGenContext::openfile() { + Common::String name = getFilename(*this); debug(1, "opening file: %s", name.c_str()); - context.engine->openFile(name); - context.cs.word(kHandle) = 1; //only one handle - context.flags._c = false; + engine->openFile(name); + cs.word(kHandle) = 1; //only one handle + flags._c = false; } -void createfile(Context &context) { +void DreamGenContext::createfile() { ::error("createfile"); } -void dontloadseg(Context &context) { - context.ax = context.es.word(context.di); - context._add(context.di, 2); - context.dx = context.ax; - context.cx = 0; - unsigned pos = context.engine->skipBytes(context.dx); - context.dx = pos >> 16; - context.ax = pos & 0xffff; - context.flags._c = false; +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 mousecall(Context &context) { - context.engine->mouseCall(); +void DreamGenContext::mousecall() { + engine->mouseCall(); } -void setmouse(Context &context) { - context.data.word(kOldpointerx) = 0xffff; +void DreamGenContext::setmouse() { + data.word(kOldpointerx) = 0xffff; //warning("setmouse: fixme: add range setting"); //set vertical range to 15-184 //set horizontal range to 15-298*2 } -void gettime(Context &context) { +void DreamGenContext::gettime() { TimeDate t; g_system->getTimeAndDate(t); debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); - context.ch = t.tm_hour; - context.cl = t.tm_min; - context.dh = t.tm_sec; - context.data.byte(kSecondcount) = context.dh; - context.data.byte(kMinutecount) = context.cl; - context.data.byte(kHourcount) = context.ch; + ch = t.tm_hour; + cl = t.tm_min; + dh = t.tm_sec; + data.byte(kSecondcount) = dh; + data.byte(kMinutecount) = cl; + data.byte(kHourcount) = ch; } -void allocatemem(Context &context) { - uint size = (context.bx + 2) * 16; +void DreamGenContext::allocatemem() { + uint size = (bx + 2) * 16; debug(1, "allocate mem, %u bytes", size); - context.flags._c = false; - SegmentRef seg = context.allocateSegment(size); - context.ax = (uint16)seg; - debug(1, "\tsegment address -> %04x", (uint16)context.ax); + flags._c = false; + SegmentRef seg = allocateSegment(size); + ax = (uint16)seg; + debug(1, "\tsegment address -> %04x", (uint16)ax); } -void deallocatemem(Context &context) { - uint16 id = (uint16)context.es; +void DreamGenContext::deallocatemem() { + uint16 id = (uint16)es; debug(1, "deallocating segment %04x", id); - context.deallocateSegment(id); + deallocateSegment(id); //fixing invalid entries in the sprite table - context.es = context.data; + es = data; uint tsize = 16 * 32; - uint16 bseg = context.data.word(kBuffers); + uint16 bseg = data.word(kBuffers); if (!bseg) return; - SegmentRef buffers(&context); + SegmentRef buffers(this); buffers = bseg; uint8 *ptr = buffers.ptr(kSpritetable, tsize); for(uint i = 0; i < tsize; i += 32) { @@ -237,192 +237,167 @@ void deallocatemem(Context &context) { } } -void removeemm(Context &context) { +void DreamGenContext::removeemm() { ::error("removeemm"); } -void setupemm(Context &context) { - //fixme: double check this, but it seems that emm pages used only for sound +void DreamGenContext::setupemm() { } -void pitinterupt(Context &context) { +void DreamGenContext::pitinterupt() { ::error("pitinterupt"); } -void getridofpit(Context &context) { +void DreamGenContext::getridofpit() { ::error("getridofpit"); } -void setuppit(Context &context) { +void DreamGenContext::setuppit() { ::error("setuppit"); } -void startdmablock(Context &context) { +void DreamGenContext::startdmablock() { ::error("startdmablock"); } -void dmaend(Context &context) { +void DreamGenContext::dmaend() { ::error("dmaend"); } -void restoreems(Context &context) { +void DreamGenContext::restoreems() { ::error("restoreems"); } -void saveems(Context &context) { +void DreamGenContext::saveems() { ::error("saveems"); } -void bothchannels(Context &context) { +void DreamGenContext::bothchannels() { ::error("bothchannels"); } -void channel1only(Context &context) { +void DreamGenContext::channel1only() { ::error("channel1only"); } -void channel0only(Context &context) { +void DreamGenContext::channel0only() { ::error("channel0only"); } -void out22c(Context &context) { +void DreamGenContext::out22c() { ::error("out22c"); } -void soundstartup(Context &context) { +void DreamGenContext::soundstartup() {} +void DreamGenContext::soundend() {} +void DreamGenContext::DreamGenContext::interupttest() {} +void DreamGenContext::disablesoundint() {} +void DreamGenContext::enablesoundint() {} +void DreamGenContext::checksoundint() { + data.byte(kTestresult) = 1; } -void soundend(Context &context) { -} - -void interupttest(Context &context) { - ::error("interupttest"); -} - -void disablesoundint(Context &context) { - warning("disablesoundint: STUB"); -} - -void enablesoundint(Context &context) { - warning("enablesoundint: STUB"); -} - -void checksoundint(Context &context) { - context.data.byte(kTestresult) = 1; - warning("checksoundint: STUB"); -} - -void setsoundoff(Context &context) { +void DreamGenContext::setsoundoff() { warning("setsoundoff: STUB"); } -void readheader(Context &context); - -void loadsample(Context &context) { - context.engine->loadSounds(0, (const char *)context.data.ptr(context.dx, 13)); +void DreamGenContext::loadsample() { + engine->loadSounds(0, (const char *)data.ptr(dx, 13)); } -void cancelch0(Context &context); -void cancelch1(Context &context); - -void loadsecondsample(Context &context) { - uint8 ch0 = context.data.byte(kCh0playing); +void DreamGenContext::loadsecondsample() { + uint8 ch0 = data.byte(kCh0playing); if (ch0 >= 12 && ch0 != 255) - cancelch0(context); - uint8 ch1 = context.data.byte(kCh1playing); + cancelch0(); + uint8 ch1 = data.byte(kCh1playing); if (ch1 >= 12) - cancelch1(context); - context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13)); + cancelch1(); + engine->loadSounds(1, (const char *)data.ptr(dx, 13)); } -void createname(Context &context); - -void loadspeech(Context &context) { - cancelch1(context); - context.data.byte(kSpeechloaded) = 0; - createname(context); - const char *name = (const char *)context.data.ptr(context.di, 13); +void DreamGenContext::loadspeech() { + cancelch1(); + data.byte(kSpeechloaded) = 0; + createname(); + const char *name = (const char *)data.ptr(di, 13); //warning("name = %s", name); - if (context.engine->loadSpeech(name)) - context.data.byte(kSpeechloaded) = 1; + if (engine->loadSpeech(name)) + data.byte(kSpeechloaded) = 1; } -void saveseg(Context &context) { - context.cx = context.es.word(context.di); - context._add(context.di, 2); - savefilewrite(context); +void DreamGenContext::saveseg() { + cx = es.word(di); + _add(di, 2); + savefilewrite(); } -void savefilewrite(Context &context) { - context.ax = context.engine->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); +void DreamGenContext::savefilewrite() { + ax = engine->writeToSaveFile(ds.ptr(dx, cx), cx); } -void savefileread(Context &context) { - context.ax = context.engine->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx); +void DreamGenContext::savefileread() { + ax = engine->readFromSaveFile(ds.ptr(dx, cx), cx); } -void loadseg(Context &context) { - context.ax = context.es.word(context.di); - context.di += 2; +void DreamGenContext::loadseg() { + ax = es.word(di); + di += 2; - uint16 dst_offset = context.dx; - uint16 size = context.ax; + uint16 dst_offset = dx; + uint16 size = ax; - debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size); - context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size); - context.flags._c = false; + debug(1, "loadseg(%04x:%u, %u)", (uint16)ds, dst_offset, size); + ax = engine->readFromFile(ds.ptr(dst_offset, size), size); + flags._c = false; } -void error(Context &context) { +void DreamGenContext::error() { ::error("error"); } -void generalerror(Context &context) { +void DreamGenContext::generalerror() { ::error("generalerror"); } -void commandonly(Context &context); - -void dosreturn(Context &context) { - context._cmp(context.data.byte(kCommandtype), 250); - if (context.flags.z()) goto alreadydos; - context.data.byte(kCommandtype) = 250; - context.al = 46; - commandonly(context); +void DreamGenContext::dosreturn() { + _cmp(data.byte(kCommandtype), 250); + if (flags.z()) goto alreadydos; + data.byte(kCommandtype) = 250; + al = 46; + commandonly(); alreadydos: - context.ax = context.data.word(kMousebutton); - context._and(context.ax, 1); - if (context.flags.z()) return; + ax = data.word(kMousebutton); + _and(ax, 1); + if (flags.z()) return; - quickquit2(context); - quickquit(context); + quickquit2(); + quickquit(); } -void set16colpalette(Context &context) { -} +void DreamGenContext::set16colpalette() {} -void mode640x480(Context &context) { +void DreamGenContext::mode640x480() { // Video mode 12h: 640x480 pixels, 16 colors, I believe - context.al = 0x12 + 128; - context.ah = 0; + al = 0x12 + 128; + ah = 0; initGraphics(640, 480, true); } -void showgroup(Context &context) { - context.engine->setPalette(); +void DreamGenContext::showgroup() { + engine->setPalette(); } -void fadedos(Context &context) { - context.engine->fadeDos(); +void DreamGenContext::fadedos() { + engine->fadeDos(); } -void doshake(Context &context) { - uint8 &counter = context.data.byte(kShakecounter); - context._cmp(counter, 48); - if (context.flags.z()) +void DreamGenContext::doshake() { + uint8 &counter = data.byte(kShakecounter); + _cmp(counter, 48); + if (flags.z()) return; - context._add(counter, 1); + _add(counter, 1); static const int shakeTable[] = { 0, -2, 3, -2, 0, 2, 4, -1, 1, -3, 3, 2, 0, -2, 3, -2, @@ -443,27 +418,27 @@ void doshake(Context &context) { 1, -3, 3, 0, }; int offset = shakeTable[counter]; - context.engine->setShakePos(offset >= 0? offset: -offset); + engine->setShakePos(offset >= 0? offset: -offset); } -void vsync(Context &context) { - context.engine->waitForVSync(); +void DreamGenContext::vsync() { + engine->waitForVSync(); } -void setmode(Context &context) { - vsync(context); +void DreamGenContext::setmode() { + vsync(); initGraphics(320, 200, false); } -void readoneblock(Context &context) { - context.ds = context.data.word(kWorkspace); - context.cx = 30000; - context.dx = 0; - readfromfile(context); +void DreamGenContext::readoneblock() { + ds = data.word(kWorkspace); + cx = 30000; + dx = 0; + readfromfile(); } -void showpcx(Context &context) { - Common::String name = getFilename(context); +void DreamGenContext::showpcx() { + Common::String name = getFilename(*this); Common::File pcxFile; if (!pcxFile.open(name)) { @@ -478,8 +453,8 @@ void showpcx(Context &context) { // the color components have to be adjusted from 8 to 6 bits. pcxFile.seek(16, SEEK_SET); - context.es = context.data.word(kBuffers); - maingamepal = context.es.ptr(4782, 768); //fixme: hardcoded offset + es = data.word(kBuffers); + maingamepal = es.ptr(4782, 768); //fixme: hardcoded offset pcxFile.read(maingamepal, 48); memset(maingamepal + 48, 0xff, 720); -- cgit v1.2.3 From 7d7696272177c9d6b2840d5acfee68c4204b9fb5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 16 Jun 2011 23:33:26 +0300 Subject: GRAPHICS: Fix decoding of 4bpp PNGs Fixes checkbox in options menu in Sword25. --- graphics/png.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/png.cpp b/graphics/png.cpp index e6dceab3fa..c250433222 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -202,7 +202,7 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) { } // The surface is a whole scanline wide, skip the rest of it. if (_header.bitDepth == 4) - src += output->w / 2; + src += output->w / 2 + output->w % 2; } } -- cgit v1.2.3 From f090eb672714233eea7f13dd56c2fd159fd6bd7e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 17 Jun 2011 01:17:25 +0300 Subject: SWORD25: Fix image blending for black This fixes exit menu. --- engines/sword25/gfx/image/renderedimage.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index a9c9de4f0c..f5f33d8e02 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -373,17 +373,23 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe default: // alpha blending #if defined(SCUMM_LITTLE_ENDIAN) - if (cb != 255) + if (cb == 0) + *out = 0; + else if (cb != 255) *out += ((b - *out) * a * cb) >> 16; else *out += ((b - *out) * a) >> 8; out++; - if (cg != 255) + if (cg == 0) + *out = 0; + else if (cg != 255) *out += ((g - *out) * a * cg) >> 16; else *out += ((g - *out) * a) >> 8; out++; - if (cr != 255) + if (cr == 0) + *out = 0; + else if (cr != 255) *out += ((r - *out) * a * cr) >> 16; else *out += ((r - *out) * a) >> 8; @@ -393,17 +399,23 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe #else *out = 255; out++; - if (cr != 255) + if (cr == 0) + *out = 0; + else if (cr != 255) *out += ((r - *out) * a * cr) >> 16; else *out += ((r - *out) * a) >> 8; out++; - if (cg != 255) + if (cg == 0) + *out = 0; + else if (cg != 255) *out += ((g - *out) * a * cg) >> 16; else *out += ((g - *out) * a) >> 8; out++; - if (cb != 255) + if (cb == 0) + *out = 0; + else if (cb != 255) *out += ((b - *out) * a * cb) >> 16; else *out += ((b - *out) * a) >> 8; -- cgit v1.2.3 From abf26b0614581f2725f65621d0403255884a9cc2 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Fri, 17 Jun 2011 05:56:23 +0200 Subject: GRAPHICS: Fix Valgrind warning The stream class uses free() to automatically dispose of the buffer so it must be allocated with malloc(), not "new". --- graphics/png.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphics/png.cpp b/graphics/png.cpp index c250433222..a1cf266227 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -236,7 +236,7 @@ bool PNG::read(Common::SeekableReadStream *str) { case kChunkIDAT: if (_compressedBufferSize == 0) { _compressedBufferSize += chunkLength; - _compressedBuffer = new byte[_compressedBufferSize]; + _compressedBuffer = (byte *)malloc(_compressedBufferSize); _stream->read(_compressedBuffer, chunkLength); } else { // Expand the buffer @@ -244,8 +244,8 @@ bool PNG::read(Common::SeekableReadStream *str) { _compressedBufferSize += chunkLength; byte *tmp = new byte[prevSize]; memcpy(tmp, _compressedBuffer, prevSize); - delete[] _compressedBuffer; - _compressedBuffer = new byte[_compressedBufferSize]; + free(_compressedBuffer); + _compressedBuffer = (byte *)malloc(_compressedBufferSize); memcpy(_compressedBuffer, tmp, prevSize); delete[] tmp; _stream->read(_compressedBuffer + prevSize, chunkLength); -- cgit v1.2.3 From 520b18d2ac183c4d671b9bd59935bec2aea0d4c6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 16 Jun 2011 15:13:16 +0200 Subject: SCI: Use ScopedPtr to handle temporary resMan instance on the heap --- engines/sci/detection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 7bc9699e9b..10c27b2331 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -23,6 +23,7 @@ #include "engines/advancedDetector.h" #include "base/plugins.h" #include "common/file.h" +#include "common/ptr.h" #include "common/savefile.h" #include "common/system.h" #include "graphics/thumbnail.h" @@ -485,7 +486,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, return 0; } - ResourceManager *resMan = new ResourceManager(); + Common::ScopedPtr resMan(new ResourceManager()); assert(resMan); resMan->addAppropriateSources(fslist); resMan->init(true); @@ -495,7 +496,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, // Is SCI32 compiled in? If not, and this is a SCI32 game, // stop here if (getSciVersion() >= SCI_VERSION_2) { - delete resMan; return (const ADGameDescription *)&s_fallbackDesc; } #endif @@ -506,7 +506,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, // Can't be SCI (or unsupported SCI views). Pinball Creep by sierra also uses resource.map/resource.000 files // but doesnt share sci format at all, if we dont return 0 here we will detect this game as SCI if (gameViews == kViewUnknown) { - delete resMan; return 0; } @@ -519,7 +518,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, // If we don't have a game id, the game is not SCI if (sierraGameId.empty()) { - delete resMan; return 0; } @@ -575,8 +573,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, if (s_fallbackDesc.flags & ADGF_DEMO) s_fallbackDesc.extra = (gameId.hasSuffix("sci")) ? "SCI/Demo" : "Demo"; - delete resMan; - return (const ADGameDescription *)&s_fallbackDesc; } -- cgit v1.2.3 From da3fff8ab38bce529ed6cbd1dea2731c93314030 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 16 Jun 2011 15:51:04 +0200 Subject: COMMON: Make use of Common::parseBool --- common/config-manager.cpp | 8 +++----- gui/ThemeParser.cpp | 22 +++++++++------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 03fcb20abf..3941e27cc1 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -491,11 +491,9 @@ int ConfigManager::getInt(const String &key, const String &domName) const { bool ConfigManager::getBool(const String &key, const String &domName) const { String value(get(key, domName)); - - if ((value == "true") || (value == "yes") || (value == "1")) - return true; - if ((value == "false") || (value == "no") || (value == "0")) - return false; + bool val; + if (Common::parseBool(value, val)) + return val; error("ConfigManager::getBool(%s,%s): '%s' is not a valid bool", key.c_str(), domName.c_str(), value.c_str()); diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 5b1faa4075..55a76e856e 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -352,11 +352,8 @@ bool ThemeParser::parserCallback_drawdata(ParserNode *node) { } if (node->values.contains("cache")) { - if (node->values["cache"] == "true") - cached = true; - else if (node->values["cache"] == "false") - cached = false; - else return parserError("'Parsed' value must be either true or false."); + if (!Common::parseBool(node->values["cache"], cached)) + return parserError("'Parsed' value must be either true or false."); } if (_theme->addDrawData(node->values["id"], cached) == false) @@ -595,9 +592,7 @@ bool ThemeParser::parserCallback_widget(ParserNode *node) { bool enabled = true; if (node->values.contains("enabled")) { - if (node->values["enabled"] == "false") - enabled = false; - else if (node->values["enabled"] != "true") + if (!Common::parseBool(node->values["enabled"], enabled)) return parserError("Invalid value for Widget enabling (expecting true/false)"); } @@ -641,9 +636,7 @@ bool ThemeParser::parserCallback_dialog(ParserNode *node) { } if (node->values.contains("enabled")) { - if (node->values["enabled"] == "false") - enabled = false; - else if (node->values["enabled"] != "true") + if (!Common::parseBool(node->values["enabled"], enabled)) return parserError("Invalid value for Dialog enabling (expecting true/false)"); } @@ -677,16 +670,19 @@ bool ThemeParser::parserCallback_import(ParserNode *node) { bool ThemeParser::parserCallback_layout(ParserNode *node) { int spacing = -1; + bool center; if (node->values.contains("spacing")) { if (!parseIntegerKey(node->values["spacing"], 1, &spacing)) return false; } + Common::parseBool(node->values["center"], center); + if (node->values["type"] == "vertical") - _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, node->values["center"] == "true"); + _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, center); else if (node->values["type"] == "horizontal") - _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, node->values["center"] == "true"); + _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, center); else return parserError("Invalid layout type. Only 'horizontal' and 'vertical' layouts allowed."); -- cgit v1.2.3 From e670a2a65c062cc2cdb71ddb5760b75c718d9f9f Mon Sep 17 00:00:00 2001 From: Scott Thomas Date: Fri, 17 Jun 2011 19:42:19 +0930 Subject: MOHAWK: Add detection for Zoombinis v2.0. --- engines/mohawk/detection_tables.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 2cf80377f6..09e280bdc4 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -444,6 +444,21 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + { + { + "zoombini", + "v2.0", + AD_ENTRY1("ZOOMBINI.MHK", "506b1122ffa740e2566cf0b583d24478"), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_ZOOMBINI, + GF_HASMIDI, + 0 + }, + { { "zoombini", -- cgit v1.2.3 From cef5506e9f0ba328a064f058f074c979b8ba6485 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 17 Jun 2011 11:14:57 +0200 Subject: SCI: Change fallback detector to use allFiles hashmap --- engines/sci/detection.cpp | 77 +++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 10c27b2331..038b0862de 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -430,56 +430,49 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, s_fallbackDesc.platform = Common::kPlatformPC; // default to PC platform s_fallbackDesc.gameid = "sci"; - // First grab all filenames - // TODO: Consider using allFiles instead of fslist - for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { - if (file->isDirectory()) - continue; - - Common::String filename = file->getName(); - filename.toLowercase(); + if (allFiles.contains("resource.map") || allFiles.contains("Data1") + || allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) { + foundResMap = true; + } - if (filename.contains("resource.map") || filename.contains("resmap.00") || filename.contains("Data1")) { - foundResMap = true; + // Determine if we got a CD version and set the CD flag accordingly, by checking for + // resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that + // the file should be over 10MB, as it contains all the game speech and is usually + // around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which + // also have a small resource.aud file + if (allFiles.contains("resource.aud") || allFiles.contains("audio001.002")) { + Common::FSNode file = allFiles.contains("resource.aud") ? allFiles["resource.aud"] : allFiles["audio001.002"]; + Common::SeekableReadStream *tmpStream = file.createReadStream(); + if (tmpStream->size() > 10 * 1024 * 1024) { + // We got a CD version, so set the CD flag accordingly + s_fallbackDesc.flags |= ADGF_CD; + s_fallbackDesc.extra = "CD"; } + delete tmpStream; + } - // Determine if we got a CD version and set the CD flag accordingly, by checking for - // resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that - // the file should be over 10MB, as it contains all the game speech and is usually - // around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which - // also have a small resource.aud file - if (filename.contains("resource.aud") || filename.contains("audio001.002")) { - Common::SeekableReadStream *tmpStream = file->createReadStream(); - if (tmpStream->size() > 10 * 1024 * 1024) { - // We got a CD version, so set the CD flag accordingly - s_fallbackDesc.flags |= ADGF_CD; - s_fallbackDesc.extra = "CD"; - } - delete tmpStream; - } + if (allFiles.contains("resource.000") || allFiles.contains("resource.001") + || allFiles.contains("ressci.000") || allFiles.contains("ressci.001")) + foundRes000 = true; - if (filename.contains("resource.000") || filename.contains("resource.001") - || filename.contains("ressci.000") || filename.contains("ressci.001")) - foundRes000 = true; + // Data1 contains both map and volume for SCI1.1+ Mac games + if (allFiles.contains("Data1")) { + foundResMap = foundRes000 = true; + s_fallbackDesc.platform = Common::kPlatformMacintosh; + } - // Data1 contains both map and volume for SCI1.1+ Mac games - if (filename.contains("Data1")) { - foundResMap = foundRes000 = true; - s_fallbackDesc.platform = Common::kPlatformMacintosh; - } + // Determine the game platform + // The existence of any of these files indicates an Amiga game + if (allFiles.contains("9.pat") || allFiles.contains("spal") || + allFiles.contains("patch.005") || allFiles.contains("bank.001")) + s_fallbackDesc.platform = Common::kPlatformAmiga; - // Determine the game platform - // The existence of any of these files indicates an Amiga game - if (filename.contains("9.pat") || filename.contains("spal") || - filename.contains("patch.005") || filename.contains("bank.001")) - s_fallbackDesc.platform = Common::kPlatformAmiga; + // The existence of 7.pat or patch.200 indicates a Mac game + if (allFiles.contains("7.pat") || allFiles.contains("patch.200")) + s_fallbackDesc.platform = Common::kPlatformMacintosh; - // The existence of 7.pat or patch.200 indicates a Mac game - if (filename.contains("7.pat") || filename.contains("patch.200")) - s_fallbackDesc.platform = Common::kPlatformMacintosh; + // The data files for Atari ST versions are the same as their DOS counterparts - // The data files for Atari ST versions are the same as their DOS counterparts - } // If these files aren't found, it can't be SCI if (!foundResMap && !foundRes000) { -- cgit v1.2.3 From 055820c94b34eb948bb6f3cd7cec6697912ab794 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 17 Jun 2011 11:20:43 +0200 Subject: SCI: Improve fallback detection for GK2 demo --- engines/sci/detection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 038b0862de..03917a83aa 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -225,6 +225,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = { { "emc", "funseeker", SCI_VERSION_NONE }, { "gk", "gk1", SCI_VERSION_NONE }, // gk2 is the same + { "gk2demo", "gk2", SCI_VERSION_NONE }, { "hoyledemo", "hoyle1", SCI_VERSION_NONE }, { "cardgames", "hoyle1", SCI_VERSION_NONE }, { "solitare", "hoyle2", SCI_VERSION_NONE }, -- cgit v1.2.3 From c2bbab4fec7fa568d45984177035f2ef15da075b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 17 Jun 2011 11:29:24 +0200 Subject: SCI: Improve fallback detection for KQ7 --- engines/sci/detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 03917a83aa..7d093a75d8 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -237,7 +237,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = { { "kq4", "kq4sci", SCI_VERSION_NONE }, // kq5 is the same // kq6 is the same - // kq7 is the same + { "kq7cd", "kq7", SCI_VERSION_NONE }, { "mm1", "laurabow", SCI_VERSION_NONE }, { "cb1", "laurabow", SCI_VERSION_NONE }, { "lb2", "laurabow2", SCI_VERSION_NONE }, -- cgit v1.2.3 From 7c44582bb74bc3386040788b53d3ba27505723e7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 17 Jun 2011 12:11:40 +0200 Subject: ENGINES: Update GameDescriptor::updateDesc docs to match reality --- engines/game.cpp | 3 --- engines/game.h | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engines/game.cpp b/engines/game.cpp index c6d9905b52..c3a7454141 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -69,9 +69,6 @@ void GameDescriptor::appendGUIOptions(const Common::String &str) { } void GameDescriptor::updateDesc(const char *extra) { - // TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone. - // We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or - // the seperator (instead of '/' use ', ' or ' '). const bool hasCustomLanguage = (language() != Common::UNK_LANG); const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown); const bool hasExtraDesc = (extra && extra[0]); diff --git a/engines/game.h b/engines/game.h index 3216cfb628..1cf2c4b39d 100644 --- a/engines/game.h +++ b/engines/game.h @@ -64,7 +64,9 @@ public: uint32 guioptions = 0); /** - * Update the description string by appending (LANG/PLATFORM/EXTRA) to it. + * Update the description string by appending (EXTRA/PLATFORM/LANG) to it. + * Values that are missing are omitted, so e.g. (EXTRA/LANG) would be + * added if no platform has been specified but a language and an extra string. */ void updateDesc(const char *extra = 0); -- cgit v1.2.3 From 2e2676526d97db7b1bff5be2838e4479aca3ba97 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 17 Jun 2011 14:12:03 +0200 Subject: SCI: Improve 'extra' strings generated by fallback detector --- engines/sci/detection.cpp | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 7d093a75d8..1cfedd6f1b 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -325,7 +325,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId[0]; ++cur) { if (sierraId == cur->oldId) { - // Distinguish same IDs from the SCI version + // Distinguish same IDs via the SCI version if (cur->version != SCI_VERSION_NONE && cur->version != getSciVersion()) continue; @@ -447,7 +447,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, if (tmpStream->size() > 10 * 1024 * 1024) { // We got a CD version, so set the CD flag accordingly s_fallbackDesc.flags |= ADGF_CD; - s_fallbackDesc.extra = "CD"; } delete tmpStream; } @@ -550,22 +549,40 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, } - // Fill in extras field + // Fill in "extra" field + + // Is this an EGA version that might have a VGA pendant? Then we want + // to mark it as such in the "extra" field. + const bool markAsEGA = (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga + && getSciVersion() > SCI_VERSION_1_EGA_ONLY); + + const bool isDemo = (s_fallbackDesc.flags & ADGF_DEMO); + const bool isCD = (s_fallbackDesc.flags & ADGF_CD); if (gameId.hasSuffix("sci")) { s_fallbackDesc.extra = "SCI"; // Differentiate EGA versions from the VGA ones, where needed - if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga) + if (markAsEGA) s_fallbackDesc.extra = "SCI/EGA"; + + // Mark as demo. + // Note: This overwrites the 'EGA' info, if it was previously set. + if (isDemo) + s_fallbackDesc.extra = "SCI/Demo"; } else { - if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga) + if (markAsEGA) s_fallbackDesc.extra = "EGA"; - } - // Add "demo" to the description for demos - if (s_fallbackDesc.flags & ADGF_DEMO) - s_fallbackDesc.extra = (gameId.hasSuffix("sci")) ? "SCI/Demo" : "Demo"; + // Set "CD" and "Demo" as appropriate. + // Note: This overwrites the 'EGA' info, if it was previously set. + if (isDemo && isCD) + s_fallbackDesc.extra = "CD Demo"; + else if (isDemo) + s_fallbackDesc.extra = "Demo"; + else if (isCD) + s_fallbackDesc.extra = "CD"; + } return (const ADGameDescription *)&s_fallbackDesc; } -- cgit v1.2.3 From 27890ec3e2cb708fc18f46f839dc8ce9d8311b3d Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 17 Jun 2011 21:15:06 +0400 Subject: DREAMWEB: clear cx after rep movs/stos commands --- devtools/tasmrecover/tasm/cpp.py | 16 +++--- devtools/tasmrecover/tasm/op.py | 12 ++-- devtools/tasmrecover/tasm/proc.py | 1 + engines/dreamweb/dreamgen.cpp | 114 +++++++++++++++++++------------------- engines/dreamweb/runtime.h | 16 ++++-- 5 files changed, 85 insertions(+), 74 deletions(-) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 324772120e..0196e5b45c 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -407,17 +407,17 @@ namespace %s { def _lodsw(self): self.body += "\t_lodsw();\n" - def _stosb(self, n): - self.body += "\t_stosb(%s);\n" %("" if n == 1 else n) + def _stosb(self, n, clear_cx): + self.body += "\t_stosb(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "") - def _stosw(self, n): - self.body += "\t_stosw(%s);\n" %("" if n == 1 else n) + def _stosw(self, n, clear_cx): + self.body += "\t_stosw(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "") - def _movsb(self, n): - self.body += "\t_movsb(%s);\n" %("" if n == 1 else n) + def _movsb(self, n, clear_cx): + self.body += "\t_movsb(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "") - def _movsw(self, n): - self.body += "\t_movsw(%s);\n" %("" if n == 1 else n) + def _movsw(self, n, clear_cx): + self.body += "\t_movsw(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "") def _stc(self): self.body += "\tflags._c = true;\n " diff --git a/devtools/tasmrecover/tasm/op.py b/devtools/tasmrecover/tasm/op.py index 9baebccfc3..10fdd8a568 100644 --- a/devtools/tasmrecover/tasm/op.py +++ b/devtools/tasmrecover/tasm/op.py @@ -317,26 +317,30 @@ class _lodsw(baseop): class _stosw(baseop): def __init__(self, arg): self.repeat = 1 + self.clear_cx = False def visit(self, visitor): - visitor._stosw(self.repeat) + visitor._stosw(self.repeat, self.clear_cx) class _stosb(baseop): def __init__(self, arg): self.repeat = 1 + self.clear_cx = False def visit(self, visitor): - visitor._stosb(self.repeat) + visitor._stosb(self.repeat, self.clear_cx) class _movsw(baseop): def __init__(self, arg): self.repeat = 1 + self.clear_cx = False def visit(self, visitor): - visitor._movsw(self.repeat) + visitor._movsw(self.repeat, self.clear_cx) class _movsb(baseop): def __init__(self, arg): self.repeat = 1 + self.clear_cx = False def visit(self, visitor): - visitor._movsb(self.repeat) + visitor._movsb(self.repeat, self.clear_cx) class _in(baseop): def __init__(self, arg): diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index c304438984..c127c406f7 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -62,6 +62,7 @@ class proc: break if isinstance(stmts[i + 1], cls): stmts[i + 1].repeat = 'cx' + stmts[i + 1].clear_cx = True del stmts[i] i += 1 return diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 135daa5c76..a87f65bcb3 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2176,7 +2176,7 @@ void DreamGenContext::clearsprites() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); al = 255; cx = (32)*16; - _stosb(cx); + _stosb(cx, true); } void DreamGenContext::makesprite() { @@ -2204,7 +2204,7 @@ void DreamGenContext::delsprite() { di = bx; cx = (32); al = 255; - _stosb(cx); + _stosb(cx, true); } void DreamGenContext::spriteupdate() { @@ -3522,7 +3522,7 @@ void DreamGenContext::updatepeople() { data.word(kListpos) = di; cx = 12*5; al = 255; - _stosb(cx); + _stosb(cx, true); _inc(data.word(kMaintimer)); es = cs; bx = 534; @@ -4156,7 +4156,7 @@ void DreamGenContext::delthisone() { deloneloop: push(cx); ch = 0; - _movsb(cx); + _movsb(cx, true); cx = pop(); _add(di, ax); _add(si, dx); @@ -4522,7 +4522,7 @@ void DreamGenContext::transferinv() { _mul(cx); cx = ax; push(cx); - _movsb(cx); + _movsb(cx, true); cx = pop(); ax = pop(); es.word(bx+2) = ax; @@ -4569,7 +4569,7 @@ void DreamGenContext::transfermap() { _mul(cx); cx = ax; push(cx); - _movsb(cx); + _movsb(cx, true); cx = pop(); ax = pop(); es.word(bx+2) = ax; @@ -4606,7 +4606,7 @@ void DreamGenContext::clearendpal() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); cx = 768; al = 0; - _stosb(cx); + _stosb(cx, true); } void DreamGenContext::clearpalette() { @@ -4632,7 +4632,7 @@ void DreamGenContext::fadetowhite() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); cx = 768; al = 63; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); al = 0; _stosb(3); @@ -4649,7 +4649,7 @@ void DreamGenContext::fadefromwhite() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)); cx = 768; al = 63; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3)); al = 0; _stosb(3); @@ -4689,11 +4689,11 @@ halfend: si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); cx = 3*5; - _movsb(cx); + _movsb(cx, true); si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); cx = 3*2; - _movsb(cx); + _movsb(cx, true); data.byte(kFadedirection) = 1; data.byte(kFadecount) = 31; data.byte(kColourpos) = 0; @@ -5001,7 +5001,7 @@ void DreamGenContext::paltostartpal() { si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); di = (0+(180*10)+32+60+(32*32)+(11*10*3)); cx = 768/2; - _movsw(cx); + _movsw(cx, true); } void DreamGenContext::endpaltostart() { @@ -5011,7 +5011,7 @@ void DreamGenContext::endpaltostart() { si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); di = (0+(180*10)+32+60+(32*32)+(11*10*3)); cx = 768/2; - _movsw(cx); + _movsw(cx, true); } void DreamGenContext::startpaltoend() { @@ -5021,7 +5021,7 @@ void DreamGenContext::startpaltoend() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); si = (0+(180*10)+32+60+(32*32)+(11*10*3)); cx = 768/2; - _movsw(cx); + _movsw(cx, true); } void DreamGenContext::paltoendpal() { @@ -5031,7 +5031,7 @@ void DreamGenContext::paltoendpal() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); cx = 768/2; - _movsw(cx); + _movsw(cx, true); } void DreamGenContext::allpalette() { @@ -5041,7 +5041,7 @@ void DreamGenContext::allpalette() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)); si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); cx = 768/2; - _movsw(cx); + _movsw(cx, true); dumpcurrent(); } @@ -5067,7 +5067,7 @@ void DreamGenContext::fadedownmon() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); cx = 3*8; ax = 0; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); _stosb(); _stosw(); @@ -5087,7 +5087,7 @@ void DreamGenContext::fadeupmon() { di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); cx = 3*8; ax = 0; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); @@ -5107,7 +5107,7 @@ void DreamGenContext::fadeupmonfirst() { di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); cx = 3*8; ax = 0; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); @@ -5130,7 +5130,7 @@ void DreamGenContext::fadeupyellows() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); cx = 3*8; ax = 0; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); _stosb(); _stosw(); @@ -5149,7 +5149,7 @@ void DreamGenContext::initialmoncols() { di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); cx = 3*9; ax = 0; - _stosb(cx); + _stosb(cx, true); di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); @@ -6122,7 +6122,7 @@ void DreamGenContext::findallryan() { push(di); cx = 30; ax = 0x0ffff; - _stosw(cx); + _stosw(cx, true); di = pop(); cl = 4; ds = data.word(kExtras); @@ -6157,7 +6157,7 @@ void DreamGenContext::findallopen() { push(di); cx = 16; ax = 0x0ffff; - _stosw(cx); + _stosw(cx, true); di = pop(); cl = data.byte(kOpenedob); dl = data.byte(kOpenedtype); @@ -7943,7 +7943,7 @@ void DreamGenContext::transfertoex() { ds = data.word(kFreedat); si = ax; cx = 8; - _movsw(cx); + _movsw(cx, true); di = pop(); al = data.byte(kReallocation); es.byte(di) = al; @@ -8021,7 +8021,7 @@ void DreamGenContext::transfercontoex() { ds = pop(); push(di); cx = 8; - _movsw(cx); + _movsw(cx, true); di = pop(); dx = pop(); al = data.byte(kReallocation); @@ -8195,7 +8195,7 @@ void DreamGenContext::deleteexobject() { push(cx); al = 255; cx = 16; - _stosb(cx); + _stosb(cx, true); ax = pop(); cl = al; _add(al, al); @@ -8255,7 +8255,7 @@ void DreamGenContext::deleteexframe() { _add(si, ax); push(ax); ds = es; - _movsb(cx); + _movsb(cx, true); bx = pop(); _sub(data.word(kExframepos), bx); si = pop(); @@ -8299,7 +8299,7 @@ findlenextext: push(bx); push(ax); _sub(cx, bx); - _movsb(cx); + _movsb(cx, true); bx = pop(); _sub(data.word(kExtextpos), bx); si = pop(); @@ -8547,7 +8547,7 @@ oberase: di = bx; al = 255; cx = (32); - _stosb(cx); + _stosb(cx, true); notthisob: bx = pop(); cx = pop(); @@ -8564,7 +8564,7 @@ void DreamGenContext::showallobs() { di = bx; cx = 128*5; al = 255; - _stosb(cx); + _stosb(cx, true); es = data.word(kSetframes); data.word(kFrsegment) = es; ax = (0); @@ -8685,7 +8685,7 @@ void DreamGenContext::showallfree() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); cx = 80*5; al = 255; - _stosb(cx); + _stosb(cx, true); es = data.word(kFreeframes); data.word(kFrsegment) = es; ax = (0); @@ -8766,7 +8766,7 @@ void DreamGenContext::showallex() { di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); cx = 100*5; al = 255; - _stosb(cx); + _stosb(cx, true); es = data.word(kExtras); data.word(kFrsegment) = es; ax = (0); @@ -9950,12 +9950,12 @@ void DreamGenContext::usemon() { di = 2970+1; cx = 12; al = 32; - _stosb(cx); + _stosb(cx, true); es = cs; di = 2942+1; cx = 12; al = 32; - _stosb(cx); + _stosb(cx, true); es = cs; di = 2836; es.byte(di) = 1; @@ -10326,7 +10326,7 @@ void DreamGenContext::input() { di = 8045; cx = 64; al = 0; - _stosb(cx); + _stosb(cx, true); data.word(kCurpos) = 0; al = '>'; di = data.word(kMonadx); @@ -10560,7 +10560,7 @@ dirroot: di = 2970; _inc(di); cx = 12; - _movsb(cx); + _movsb(cx, true); monitorlogo(); scrollmonitor(); al = 9; @@ -10862,7 +10862,7 @@ keyok2: es = cs; di = 2970+1; cx = 12; - _movsb(cx); + _movsb(cx, true); monitorlogo(); scrollmonitor(); al = 10; @@ -10982,7 +10982,7 @@ void DreamGenContext::parser() { di = 2942; cx = 13; al = 0; - _stosb(cx); + _stosb(cx, true); di = 2942; al = '='; _stosb(); @@ -16255,7 +16255,7 @@ alreadyactsave: bx = di; es = cs; cx = 16; - _movsw(cx); + _movsw(cx, true); al = data.byte(kRoomssample); es.byte(bx+13) = al; al = data.byte(kMapx); @@ -16605,7 +16605,7 @@ void DreamGenContext::namestoold() { di = (0+(180*10)+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); + _movsb(cx, true); } void DreamGenContext::oldtonames() { @@ -16615,7 +16615,7 @@ void DreamGenContext::oldtonames() { si = (0+(180*10)+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); + _movsb(cx, true); } void DreamGenContext::saveposition() { @@ -17015,7 +17015,7 @@ void DreamGenContext::trysoundalloc() { di = 0; cx = 16384/2; ax = 0x7f7f; - _stosw(cx); + _stosw(cx, true); data.byte(kNeedsoundbuff) = 1; return; soundfail: @@ -17150,7 +17150,7 @@ notch0only: di = data.word(kSoundbufferwrite); cx = 1024; ax = 0x7f7f; - _stosw(cx); + _stosw(cx, true); _and(di, 16384-1); data.word(kSoundbufferwrite) = di; } @@ -17217,7 +17217,7 @@ void DreamGenContext::channel0tran() { if (!flags.z()) goto lowvolumetran; cx = 1024; - _movsw(cx); + _movsw(cx, true); return; lowvolumetran: cx = 1024; @@ -17659,24 +17659,24 @@ void DreamGenContext::clearbuffers() { cx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/2; ax = 0; di = 0; - _stosw(cx); + _stosw(cx, true); es = data.word(kExtras); cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; ax = 0x0ffff; di = 0; - _stosw(cx); + _stosw(cx, true); es = data.word(kBuffers); di = (0+(180*10)+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*24)+(6*64)); ds = cs; si = 534; cx = (991-534); - _movsb(cx); + _movsb(cx, true); es = data.word(kBuffers); di = (0+(180*10)+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*24)+(6*64)+991-534); ds = cs; si = 0; cx = (68-0); - _movsb(cx); + _movsb(cx, true); clearchanges(); } @@ -17686,19 +17686,19 @@ void DreamGenContext::clearchanges() { cx = (250)*2; ax = 0x0ffff; di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - _stosw(cx); + _stosw(cx, true); ds = data.word(kBuffers); si = (0+(180*10)+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*24)+(6*64)); es = cs; di = 534; cx = (991-534); - _movsb(cx); + _movsb(cx, true); ds = data.word(kBuffers); si = (0+(180*10)+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*24)+(6*64)+991-534); es = cs; di = 0; cx = (68-0); - _movsb(cx); + _movsb(cx, true); data.byte(kExpos) = 0; data.word(kExframepos) = 0; data.word(kExtextpos) = 0; @@ -17706,7 +17706,7 @@ void DreamGenContext::clearchanges() { cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2; ax = 0x0ffff; di = 0; - _stosw(cx); + _stosw(cx, true); es = cs; di = 8011; al = 1; @@ -17717,7 +17717,7 @@ void DreamGenContext::clearchanges() { _stosb(); ax = 0; cx = 6; - _stosw(cx); + _stosw(cx, true); } void DreamGenContext::clearbeforeload() { @@ -17746,7 +17746,7 @@ void DreamGenContext::clearrest() { cx = (66*60)/2; ax = 0; di = (0); - _stosw(cx); + _stosw(cx, true); es = data.word(kBackdrop); deallocatemem(); es = data.word(kSetframes); @@ -19746,7 +19746,7 @@ finishmakename: _stosb(); return; al = 255; - _stosb(cx); + _stosb(cx, true); } void DreamGenContext::findobname() { @@ -20934,7 +20934,7 @@ blimey: push(cx); push(si); cx = (66); - _movsb(cx); + _movsb(cx, true); si = pop(); cx = pop(); _add(si, 132); @@ -21189,7 +21189,7 @@ void DreamGenContext::fillspace() { push(bx); di = dx; es = ds; - _stosb(cx); + _stosb(cx, true); bx = pop(); di = pop(); dx = pop(); diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index b8a87bd69e..bb671431b0 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -462,12 +462,14 @@ public: es.byte(di++) = ds.byte(si++); } - inline void _movsb(uint size) { + inline void _movsb(uint size, bool clear_cx = false) { uint8 *dst = es.ptr(di, size); uint8 *src = ds.ptr(si, size); memcpy(dst, src, size); di += size; si += size; + if (clear_cx) + cx = 0; } inline void _movsw() { @@ -475,18 +477,20 @@ public: _movsb(); } - inline void _movsw(uint size) { - _movsb(size * 2); + inline void _movsw(uint size, bool clear_cx = false) { + _movsb(size * 2, clear_cx); } inline void _stosb() { es.byte(di++) = al; } - inline void _stosb(uint size) { + inline void _stosb(uint size, bool clear_cx = false) { uint8 *dst = es.ptr(di, size); memset(dst, al, size); di += size; + if (clear_cx) + cx = 0; } inline void _stosw() { @@ -494,13 +498,15 @@ public: es.byte(di++) = ah; } - inline void _stosw(uint size) { + inline void _stosw(uint size, bool clear_cx = false) { uint8 *dst = es.ptr(di, size); di += 2 * size; while(size--) { *dst++ = al; *dst++ = ah; } + if (clear_cx) + cx = 0; } inline void _xchg(uint16 &a, uint16 &b) { -- cgit v1.2.3 From a8049f708b023c887bd8a8792b68299c7050dca9 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 17 Jun 2011 19:47:32 +0200 Subject: BACKENDS: Mono output devices are OK on Symbian. --- backends/mixer/sdl/sdl-mixer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index f0b0885dd7..979b18e264 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -84,8 +84,12 @@ void SdlMixerManager::init() { if (_obtained.format != desired.format) warning("SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format); +#ifndef __SYMBIAN32__ + // The SymbianSdlMixerManager does stereo->mono downmixing, + // but otherwise we require stereo output. if (_obtained.channels != 2) error("SDL mixer output requires stereo output device"); +#endif _mixer = new Audio::MixerImpl(g_system, _obtained.freq); assert(_mixer); -- cgit v1.2.3 From 825c889e33d2c68dec65e6496c69d5d4a89cba51 Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 17 Jun 2011 20:32:17 +0200 Subject: GUI: fix uninitialized var (caused rendering glitches when compiling with MSVC) --- gui/ThemeParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 55a76e856e..db45b5a995 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -670,7 +670,7 @@ bool ThemeParser::parserCallback_import(ParserNode *node) { bool ThemeParser::parserCallback_layout(ParserNode *node) { int spacing = -1; - bool center; + bool center = false; if (node->values.contains("spacing")) { if (!parseIntegerKey(node->values["spacing"], 1, &spacing)) -- cgit v1.2.3 From 4aa66fa5aa337c7aef7d20013f776168042d45f0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 10:41:20 +0200 Subject: PSP: Make logMessage() implementation independent from parent class(es) --- backends/platform/psp/osys_psp.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 01124b420e..8c8180d04e 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -20,8 +20,7 @@ * */ -// Allow use of stuff in -#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include #include @@ -422,7 +421,15 @@ void OSystem_PSP::quit() { } void OSystem_PSP::logMessage(LogMessageType::Type type, const char *message) { - EventsBaseBackend::logMessage(type, message); + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); if (type == LogMessageType::kError) PspDebugTrace(false, "%s", message); // write to file -- cgit v1.2.3 From 50896e6029076c6c5087cb2d3a918f7545b47008 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 10:43:48 +0200 Subject: WII: Add logMessage() implementation --- backends/platform/wii/osystem.cpp | 18 +++++++++++++----- backends/platform/wii/osystem.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index c6b23783b8..258a782cc4 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -19,11 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Allow use of stuff in -#define FORBIDDEN_SYMBOL_EXCEPTION_time_h - -#define FORBIDDEN_SYMBOL_EXCEPTION_printf -#define FORBIDDEN_SYMBOL_EXCEPTION_getcwd +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include @@ -291,6 +287,18 @@ void OSystem_Wii::showOptionsDialog() { _padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration"); } +void OSystem_Wii::logMessage(LogMessageType::Type type, const char *message) { + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); +} + #ifndef GAMECUBE Common::String OSystem_Wii::getSystemLanguage() const { const char *wiiCountries[] = { diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 6863a6840e..64197f913a 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -211,6 +211,8 @@ public: virtual FilesystemFactory *getFilesystemFactory(); virtual void getTimeAndDate(TimeDate &t) const; + virtual void logMessage(LogMessageType::Type type, const char *message); + #ifndef GAMECUBE virtual Common::String getSystemLanguage() const; #endif // GAMECUBE -- cgit v1.2.3 From c06ddf2e57ac7247c6a944212f6aea923c03364c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 10:58:06 +0200 Subject: IPHONE: Add logMessage() implementation --- backends/platform/iphone/osys_main.cpp | 12 ++++++++++++ backends/platform/iphone/osys_main.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 9325ed50bf..4bc567c39d 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -242,6 +242,18 @@ void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit } } +void OSystem_IPHONE::logMessage(LogMessageType::Type type, const char *message) { + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); +} + void iphone_main(int argc, char *argv[]) { //OSystem_IPHONE::migrateApp(); diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 14325f8090..37896cceeb 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -180,6 +180,8 @@ public: virtual Common::String getDefaultConfigFileName(); + virtual void logMessage(LogMessageType::Type type, const char *message); + protected: void internUpdateScreen(); void dirtyFullScreen(); -- cgit v1.2.3 From 263e23bd810a87bf76023948923a5bb7c203ac2c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 10:58:23 +0200 Subject: N64: Add logMessage() implementation --- backends/platform/n64/osys_n64.h | 1 + backends/platform/n64/osys_n64_base.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index dfa8f58cce..285e2afa55 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -199,6 +199,7 @@ public: virtual Audio::Mixer *getMixer(); virtual void getTimeAndDate(TimeDate &t) const; virtual void setTimerCallback(TimerProc callback, int interval); + virtual void logMessage(LogMessageType::Type type, const char *message); void rebuildOffscreenGameBuffer(void); void rebuildOffscreenMouseBuffer(void); diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 69e8da3526..4bc3780fe2 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -870,6 +870,18 @@ void OSystem_N64::getTimeAndDate(TimeDate &t) const { return; } +void OSystem_N64::logMessage(LogMessageType::Type type, const char *message) { + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); +} + void OSystem_N64::setTimerCallback(TimerProc callback, int interval) { assert (interval > 0); -- cgit v1.2.3 From 7607a077fe589c2cdbdd587ba4c6285f1134c422 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 10:59:23 +0200 Subject: NULL: Add logMessage() implementation --- backends/platform/null/null.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp index 106cde1699..4690a67c55 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -52,6 +52,8 @@ public: virtual uint32 getMillis(); virtual void delayMillis(uint msecs); virtual void getTimeAndDate(TimeDate &t) const {} + + virtual void logMessage(LogMessageType::Type type, const char *message); }; OSystem_NULL::OSystem_NULL() { @@ -97,6 +99,18 @@ uint32 OSystem_NULL::getMillis() { void OSystem_NULL::delayMillis(uint msecs) { } +void OSystem_NULL::logMessage(LogMessageType::Type type, const char *message) { + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); +} + OSystem *OSystem_NULL_create() { return new OSystem_NULL(); } -- cgit v1.2.3 From 3599d0708709b9f434c96b9922024a8b87361fb0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 11:25:46 +0200 Subject: SDL: Make logMessage() implementation independent from parent class(es) --- backends/platform/sdl/sdl.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index fd27c82797..e36878db07 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -275,10 +275,22 @@ void OSystem_SDL::fatalError() { void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) { - ModularBackend::logMessage(type, message); + // First log to stdout/stderr + FILE *output = 0; + + if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) + output = stdout; + else + output = stderr; + + fputs(message, output); + fflush(output); + + // Then log into file (via the logger) if (_logger) _logger->print(message); + // Finally, some Windows / WinCE specific logging code. #if defined( USE_WINDBG ) #if defined( _WIN32_WCE ) TCHAR buf_unicode[1024]; -- cgit v1.2.3 From f7c1e7d002c21eeaf0b5c06d3527ede532f5cd51 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 11:05:23 +0200 Subject: COMMON: Remove default implementation of OSystem::logMessage --- common/system.cpp | 19 ------------------- common/system.h | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/common/system.cpp b/common/system.cpp index fae7a3ef34..1645a6be10 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -21,11 +21,6 @@ */ #define FORBIDDEN_SYMBOL_EXCEPTION_exit -#define FORBIDDEN_SYMBOL_EXCEPTION_FILE -#define FORBIDDEN_SYMBOL_EXCEPTION_fputs -#define FORBIDDEN_SYMBOL_EXCEPTION_fflush -#define FORBIDDEN_SYMBOL_EXCEPTION_stdout -#define FORBIDDEN_SYMBOL_EXCEPTION_stderr #include "common/system.h" #include "common/events.h" @@ -136,20 +131,6 @@ Common::String OSystem::getDefaultConfigFileName() { return "scummvm.ini"; } -void OSystem::logMessage(LogMessageType::Type type, const char *message) { -#if !defined(__PLAYSTATION2__) && !defined(__DS__) - FILE *output = 0; - - if (type == LogMessageType::kInfo || type == LogMessageType::kDebug) - output = stdout; - else - output = stderr; - - fputs(message, output); - fflush(output); -#endif -} - Common::String OSystem::getSystemLanguage() const { return "en_US"; } diff --git a/common/system.h b/common/system.h index d26bc593aa..3e740ff0c1 100644 --- a/common/system.h +++ b/common/system.h @@ -1101,7 +1101,7 @@ public: * @param type the type of the message * @param message the message itself */ - virtual void logMessage(LogMessageType::Type type, const char *message); + virtual void logMessage(LogMessageType::Type type, const char *message) = 0; /** * Open the log file in a way that allows the user to review it, -- cgit v1.2.3 From 0881f54a0650e479a30f1ce5e3b22f695495b4b7 Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 17 Jun 2011 23:37:21 +0200 Subject: SCUMM: fix FM-TOWNS graphics output for ARM devices (changed behavior of USE_ARM_GFX_ASM define) --- engines/scumm/gfx.cpp | 6 +++--- engines/scumm/gfx_towns.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 98d447fdaf..d3ff8266a0 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -652,15 +652,15 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i assert(0 == (width & 3)); // Compose the text over the game graphics -#ifdef USE_ARM_GFX_ASM - asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); -#else #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) { towns_drawStripToScreen(vs, x, y, x, top, width, height); return; } else #endif +#ifdef USE_ARM_GFX_ASM + asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); +#else if (_outputPixelFormat.bytesPerPixel == 2) { const byte *srcPtr = (const byte *)src; const byte *textPtr = (byte *)_textSurface.getBasePtr(x * m, y * m); diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 3c96be8b9c..4ec9c1bbf4 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -453,6 +453,8 @@ void TownsScreen::updateOutputBuffer() { int ptch = _pitch - (r->right - r->left + 1) * _pixelFormat.bytesPerPixel; if (_pixelFormat.bytesPerPixel == 2 && l->bpp == 1) { + if (!l->palette) + error("void TownsScreen::updateOutputBuffer(): No palette assigned to 8 bit layer %d", i); for (int ic = 0; ic < l->numCol; ic++) l->bltTmpPal[ic] = calc16BitColor(&l->palette[ic * 3]); } -- cgit v1.2.3 From e792adb1b889580fa198d56e16f9098fd4227bb0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:30:57 +0100 Subject: COMMON: Add vformat() function (Common::String analog to vsprintf) --- common/scummsys.h | 13 +++++++++++++ common/str.cpp | 20 +++++++++++++++----- common/str.h | 13 ++++++++++++- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/common/scummsys.h b/common/scummsys.h index a425befecf..9d4b6a9677 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -302,6 +302,19 @@ #define MAXPATHLEN 256 #endif +#ifndef scumm_va_copy + #if defined(va_copy) + #define scumm_va_copy va_copy + #elif defined(__va_copy) + #define scumm_va_copy __va_copy + #elif defined(_MSC_VER) + #define scumm_va_copy(dst, src) ((dst) = (src)) + #else + #error scumm_va_copy undefined for this port + #endif +#endif + + // // Typedef our system types unless they have already been defined by config.h, diff --git a/common/str.cpp b/common/str.cpp index 223188bdd6..a2cd4a0193 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -25,8 +25,6 @@ #include "common/str.h" #include "common/util.h" -#include - namespace Common { MemoryPool *g_refCountPool = 0; // FIXME: This is never freed right now @@ -429,10 +427,22 @@ uint String::hash() const { // static String String::format(const char *fmt, ...) { String output; - assert(output.isStorageIntern()); va_list va; va_start(va, fmt); + output = String::vformat(fmt, va); + va_end(va); + + return output; +} + +// static +String String::vformat(const char *fmt, va_list args) { + String output; + assert(output.isStorageIntern()); + + va_list va; + scumm_va_copy(va, args); int len = vsnprintf(output._str, _builtinCapacity, fmt, va); va_end(va); @@ -457,7 +467,7 @@ String String::format(const char *fmt, ...) { assert(!output.isStorageIntern()); size = output._extern._capacity; - va_start(va, fmt); + scumm_va_copy(va, args); len = vsnprintf(output._str, size, fmt, va); va_end(va); } while (len == -1 || len >= size - 1); @@ -468,7 +478,7 @@ String String::format(const char *fmt, ...) { } else { // vsnprintf didn't have enough space, so grow buffer output.ensureCapacity(len, false); - va_start(va, fmt); + scumm_va_copy(va, args); int len2 = vsnprintf(output._str, len+1, fmt, va); va_end(va); assert(len == len2); diff --git a/common/str.h b/common/str.h index 7b97dfe945..8e07b6233d 100644 --- a/common/str.h +++ b/common/str.h @@ -24,6 +24,8 @@ #include "common/scummsys.h" +#include + namespace Common { /** @@ -213,10 +215,19 @@ public: uint hash() const; /** - * Printf-like function. Returns a formatted String. + * Print formatted data into a String object. Similar to sprintf, + * except that it stores the result in (variably sized) String + * instead of a fixed size buffer. */ static Common::String format(const char *fmt, ...) GCC_PRINTF(1,2); + /** + * Print formatted data into a String object. Similar to vsprintf, + * except that it stores the result in (variably sized) String + * instead of a fixed size buffer. + */ + static Common::String vformat(const char *fmt, va_list args); + public: typedef char * iterator; typedef const char * const_iterator; -- cgit v1.2.3 From 71ea5acd29e97a123d095d88638778bf3dbe4d0d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:41:40 +0100 Subject: AGI: Replace vsprintf by Common::String::vformat --- engines/agi/text.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index fedfd29362..82a2340ad6 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -504,17 +504,16 @@ int AgiEngine::print(const char *p, int lin, int col, int len) { * */ void AgiEngine::printStatus(const char *message, ...) { - char x[42]; va_list args; va_start(args, message); - vsprintf(x, message, args); + Common::String x = Common::String::vformat(message, args); va_end(args); debugC(4, kDebugLevelText, "fg=%d, bg=%d", STATUS_FG, STATUS_BG); - printText(x, 0, 0, _game.lineStatus, 40, STATUS_FG, STATUS_BG); + printText(x.c_str(), 0, 0, _game.lineStatus, 40, STATUS_FG, STATUS_BG); } static void safeStrcat(Common::String &p, const char *t) { -- cgit v1.2.3 From 5455fc5ff48c6b005ac514c55f975491c2202bac Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:41:45 +0100 Subject: AGOS: Replace vsprintf by Common::String::vformat --- engines/agos/string.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 1cdd7f6d81..fa85d5767c 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -840,13 +840,12 @@ void AGOSEngine_Feeble::printInteractText(uint16 num, const char *string) { void AGOSEngine_Feeble::sendInteractText(uint16 num, const char *fmt, ...) { va_list arglist; - char string[256]; va_start(arglist, fmt); - vsprintf(string, fmt, arglist); + Common::String string = Common::String::vformat(fmt, arglist); va_end(arglist); - printInteractText(num, string); + printInteractText(num, string.c_str()); } #endif -- cgit v1.2.3 From fcc5580d9f917abf17363a124b07fe8d199bf530 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:41:54 +0100 Subject: HUGO: Replace vsprintf by Common::String::vformat --- engines/hugo/parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 4a53d67377..a79ec2c609 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -391,6 +391,8 @@ void Parser::command(const char *format, ...) { va_list marker; va_start(marker, format); +// TODO: +// _vm->_line = Common::String::vformat(format, marker); vsprintf(_vm->_line, format, marker); va_end(marker); -- cgit v1.2.3 From d74e2d3224f7f43daf7bc90018b1b3f40a8c4596 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:42:05 +0100 Subject: KYRA: Replace vsprintf by Common::String::vformat --- engines/kyra/gui.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index b9477c950a..f58ca0117c 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -643,32 +643,31 @@ void MainMenu::printString(const char *format, int x, int y, int col1, int col2, if (!format) return; - char string[512]; va_list vaList; va_start(vaList, flags); - vsprintf(string, format, vaList); + Common::String string = Common::String::vformat(format, vaList); va_end(vaList); if (flags & 1) - x -= _screen->getTextWidth(string) >> 1; + x -= _screen->getTextWidth(string.c_str()) >> 1; if (flags & 2) - x -= _screen->getTextWidth(string); + x -= _screen->getTextWidth(string.c_str()); if (_vm->gameFlags().use16ColorMode) flags &= 3; if (flags & 4) { - _screen->printText(string, x - 1, y, _static.altColor, col2); - _screen->printText(string, x, y + 1, _static.altColor, col2); + _screen->printText(string.c_str(), x - 1, y, _static.altColor, col2); + _screen->printText(string.c_str(), x, y + 1, _static.altColor, col2); } if (flags & 8) { - _screen->printText(string, x - 1, y, 227, col2); - _screen->printText(string, x, y + 1, 227, col2); + _screen->printText(string.c_str(), x - 1, y, 227, col2); + _screen->printText(string.c_str(), x, y + 1, 227, col2); } - _screen->printText(string, x, y, col1, col2); + _screen->printText(string.c_str(), x, y, col1, col2); } } // End of namespace Kyra -- cgit v1.2.3 From b81207a04ecb5057b2b6efa0f3a6288b6e969aef Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 18 Mar 2011 14:42:51 +0100 Subject: COMMON: Replace some vsnprintf/STRINGBUFLEN uses by vformat --- common/debug.cpp | 13 ++++--------- common/textconsole.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index dbbb204deb..0dae344bb2 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -107,18 +107,13 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel) { #ifndef DISABLE_TEXT_CONSOLE static void debugHelper(const char *s, va_list va, bool caret = true) { - char buf[STRINGBUFLEN]; + Common::String buf = Common::String::vformat(s, va); - vsnprintf(buf, STRINGBUFLEN, s, va); - buf[STRINGBUFLEN-1] = '\0'; - - if (caret) { - buf[STRINGBUFLEN-2] = '\0'; - strcat(buf, "\n"); - } + if (caret) + buf += '\n'; if (g_system) - g_system->logMessage(LogMessageType::kDebug, buf); + g_system->logMessage(LogMessageType::kDebug, buf.c_str()); // TODO: Think of a good fallback in case we do not have // any OSystem yet. } diff --git a/common/textconsole.cpp b/common/textconsole.cpp index f2325ac9ad..ffa42e63a0 100644 --- a/common/textconsole.cpp +++ b/common/textconsole.cpp @@ -46,14 +46,14 @@ void setErrorHandler(ErrorHandler handler) { #ifndef DISABLE_TEXT_CONSOLE void warning(const char *s, ...) { - char buf[STRINGBUFLEN]; + Common::String output; va_list va; va_start(va, s); - vsnprintf(buf, STRINGBUFLEN, s, va); + output = Common::String::vformat(s, va); va_end(va); - Common::String output = Common::String::format("WARNING: %s!\n", buf); + output = "WARNING: " + output + "!\n"; if (g_system) g_system->logMessage(LogMessageType::kWarning, output.c_str()); @@ -64,6 +64,9 @@ void warning(const char *s, ...) { #endif void NORETURN_PRE error(const char *s, ...) { + // We don't use String::vformat here, as that require + // using the heap, and that might be impossible at this + // point, e.g. if the error was an "out-of-memory" error. char buf_input[STRINGBUFLEN]; char buf_output[STRINGBUFLEN]; va_list va; -- cgit v1.2.3 From 36d720d06b0ed5f736ca08230c5f37459395a83e Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 18 Jun 2011 08:26:55 +0200 Subject: CONFIGURE: Use = to test for string equality, not == I think this is correct. It's consistent with how it's done in other places in the configure script, and it silences a bunch of "unexpected operator" warnings for me. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 8b7feba443..0afdbfe7c8 100755 --- a/configure +++ b/configure @@ -65,7 +65,7 @@ get_var() { # Add an engine: id name build subengines add_engine() { _engines="${_engines} ${1}" - if test "${3}" == "no" ; then + if test "${3}" = "no" ; then set_var _wip_engines "${_wip_engines} ${1}" fi set_var _engine_${1}_name "${2}" -- cgit v1.2.3 From 0d025153e0c5d53545b9e47555eb70a11be96b8f Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 18 Jun 2011 10:29:25 +0200 Subject: ANDROID: Fix kFeatureCursorPalette. --- backends/platform/android/android.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 90660cf82c..17c7d4f9cb 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -423,7 +423,7 @@ void OSystem_Android::setFeatureState(Feature f, bool enable) { showVirtualKeyboard(enable); break; case kFeatureCursorPalette: - _use_mouse_palette = !enable; + _use_mouse_palette = enable; if (!enable) disableCursorPalette(); break; -- cgit v1.2.3 From 4cdc9c9f8e883bdb4864e6b2c0ef127bf0824e9a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 18 Jun 2011 12:59:55 +0400 Subject: DREAMWEB: implemented clean exit --- devtools/tasmrecover/dreamweb/dreamweb.asm | 6 ++++++ engines/dreamweb/dreamgen.cpp | 7 ++++++- engines/dreamweb/dreamgen.h | 3 ++- engines/dreamweb/dreamweb.cpp | 6 ++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index ea61338ae3..275d8208b0 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -195,6 +195,10 @@ alreadyloaded: mov newlocation,255 mov commandtype,255 mainloop: call screenupdate + cmp quitrequested, 0 + jz $1 + ret +$1: cmp wongame,0 jnz endofgame cmp mandead,1 @@ -6219,6 +6223,8 @@ savefiles db "DREAMWEB.D00",0 Recname db "DREAMWEB.DEM",0 +Quitrequested db 0 + ;-------------------------------------------------------End of code segment---- diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a87f65bcb3..92901b0627 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -21359,6 +21359,11 @@ loadnew: data.byte(kCommandtype) = 255; mainloop: screenupdate(); + _cmp(data.byte(kQuitrequested), 0); + if (flags.z()) + goto _tmp1; + return; +_tmp1: _cmp(data.byte(kWongame), 0); if (!flags.z()) goto endofgame; @@ -21972,7 +21977,7 @@ void DreamGenContext::__start() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, }; + 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index a70f06d496..d7cf4677e3 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -486,7 +486,8 @@ public: const static uint16 kSavenames = 8579; const static uint16 kSavefiles = 8698; const static uint16 kRecname = 8789; - const static uint16 kStak = 8802; + const static uint16 kQuitrequested = 8802; + const static uint16 kStak = 8803; const static uint16 kBlocktextdat = (0); const static uint16 kPersonframes = (0); const static uint16 kDebuglevel1 = (0); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index cb66dda26b..4f39671b85 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -100,8 +100,9 @@ void DreamWebEngine::waitForVSync() { } void DreamWebEngine::quit() { - warning("Engine should quit gracefully (but doesn't yet)"); - g_system->quit(); + _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 1; + _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = 1; + _context.data.byte(DreamGen::DreamGenContext::kGetback) = 4; } void DreamWebEngine::processEvents() { @@ -208,6 +209,7 @@ Common::Error DreamWebEngine::run() { //http://martin.hinner.info/vga/timing.html _context.__start(); + _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0; getTimerManager()->removeTimerProc(vSyncInterrupt); -- cgit v1.2.3 From cf671227fe52f7d87afeab65a90642d4aa6b7d73 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 18 Jun 2011 13:33:24 +0400 Subject: DREAMWEB: do not call updatescreen before quitting, fixed crash on dosreturn, cleaned up dosreturn stub --- devtools/tasmrecover/dreamweb/dreamweb.asm | 3 ++- engines/dreamweb/detection.cpp | 6 ++++++ engines/dreamweb/dreamgen.cpp | 8 +++++++- engines/dreamweb/dreamgen.h | 1 + engines/dreamweb/dreamweb.cpp | 3 +++ engines/dreamweb/stubs.cpp | 22 ++++++++++++++-------- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index 275d8208b0..5d2a60a0c7 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -194,11 +194,12 @@ alreadyloaded: mov newlocation,255 call startup mov commandtype,255 -mainloop: call screenupdate +mainloop: cmp quitrequested, 0 jz $1 ret $1: + call screenupdate cmp wongame,0 jnz endofgame cmp mandead,1 diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index a5cb7b585f..613bba153f 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -83,6 +83,12 @@ bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { } bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const { + switch(f) { + case kSupportsRTL: + return true; + default: + return false; + } return false; } diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 92901b0627..35721d3d4b 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4165,6 +4165,11 @@ deloneloop: goto deloneloop; } +void DreamGenContext::width160() { + STACK_CHECK; + _movsw(161); +} + void DreamGenContext::doblocks() { STACK_CHECK; es = data.word(kWorkspace); @@ -21358,12 +21363,12 @@ loadnew: startup(); data.byte(kCommandtype) = 255; mainloop: - screenupdate(); _cmp(data.byte(kQuitrequested), 0); if (flags.z()) goto _tmp1; return; _tmp1: + screenupdate(); _cmp(data.byte(kWongame), 0); if (!flags.z()) goto endofgame; @@ -22115,6 +22120,7 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case 0xc20c: doshake(); break; case 0xc210: zoom(); break; case 0xc214: delthisone(); break; + case 0xc224: width160(); break; case 0xc228: doblocks(); break; case 0xc22c: showframe(); break; case 0xc230: frameoutv(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index d7cf4677e3..94b7607087 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -964,6 +964,7 @@ public: void createpanel(); void turnpathon(); void showmainops(); + void width160dosreturn(); void madmanstelly(); void constant(); void loadroomssample(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 4f39671b85..a0e3bf0f9b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -116,6 +116,9 @@ void DreamWebEngine::processEvents() { int softKey, hardKey; while (event_manager->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: + quit(); + break; case Common::EVENT_KEYDOWN: if (event.kbd.flags & Common::KBD_CTRL) { switch (event.kbd.keycode) { diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 69f240ae5e..b8c5fedccd 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -162,6 +162,10 @@ void DreamGenContext::openfilefromc() { void DreamGenContext::openfile() { Common::String name = getFilename(*this); + if (name.empty()) { //fixme: this happens if you quit from new game/load screen + flags._c = true; + return; + } debug(1, "opening file: %s", name.c_str()); engine->openFile(name); cs.word(kHandle) = 1; //only one handle @@ -361,17 +365,19 @@ void DreamGenContext::generalerror() { void DreamGenContext::dosreturn() { _cmp(data.byte(kCommandtype), 250); - if (flags.z()) goto alreadydos; - data.byte(kCommandtype) = 250; - al = 46; - commandonly(); -alreadydos: + if (!flags.z()) { + data.byte(kCommandtype) = 250; + al = 46; + commandonly(); + } + ax = data.word(kMousebutton); _and(ax, 1); - if (flags.z()) return; + if (flags.z()) + return; - quickquit2(); - quickquit(); + data.word(kMousebutton) = 0; + engine->quit(); } void DreamGenContext::set16colpalette() {} -- cgit v1.2.3 From 41a399231be1abe21ac561994f0f19bc0c37e8a1 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 18 Jun 2011 14:29:10 +0400 Subject: DREAMWEB: added stubs for loading from lancher (disabled). --- engines/dreamweb/detection.cpp | 4 ++-- engines/dreamweb/dreamweb.cpp | 11 +++++++++++ engines/dreamweb/dreamweb.h | 4 ++++ engines/dreamweb/stubs.cpp | 8 ++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 613bba153f..c3e99fed47 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -74,8 +74,8 @@ public: bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { switch(f) { case kSupportsListSaves: - case kSupportsLoadingDuringStartup: - case kSupportsDeleteSave: + //case kSupportsLoadingDuringStartup: + //case kSupportsDeleteSave: return true; default: return false; diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index a0e3bf0f9b..0dc25afab0 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -111,6 +111,15 @@ void DreamWebEngine::processEvents() { quit(); return; } + + if (_enableSavingOrLoading && _loadSavefile >= 0 && _loadSavefile <= 6) { + debug(1, "loading save state %d", _loadSavefile); + _context.data.byte(_context.kCurrentslot) = _loadSavefile; + _loadSavefile = -1; + _context.loadposition(); + _context.data.byte(_context.kGetback) = 1; + } + soundHandler(); Common::Event event; int softKey, hardKey; @@ -208,6 +217,8 @@ void DreamWebEngine::processEvents() { Common::Error DreamWebEngine::run() { _console = new DreamWebConsole(this); + _loadSavefile = Common::ConfigManager::instance().getInt("save_slot"); + getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); //http://martin.hinner.info/vga/timing.html diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index fce4a082cc..e4e0b0453a 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -104,6 +104,8 @@ public: void loadSounds(uint bank, const Common::String &file); bool loadSpeech(const Common::String &filename); + + void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } private: void keyPressed(uint16 ascii); @@ -121,6 +123,8 @@ private: uint _speed; bool _turbo; uint _oldMouseState; + int _loadSavefile; + bool _enableSavingOrLoading; struct Sample { uint offset; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index b8c5fedccd..be6dab5b52 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -193,9 +193,6 @@ void DreamGenContext::mousecall() { void DreamGenContext::setmouse() { data.word(kOldpointerx) = 0xffff; - //warning("setmouse: fixme: add range setting"); - //set vertical range to 15-184 - //set horizontal range to 15-298*2 } void DreamGenContext::gettime() { @@ -380,7 +377,10 @@ void DreamGenContext::dosreturn() { engine->quit(); } -void DreamGenContext::set16colpalette() {} +void DreamGenContext::set16colpalette() { + //fixme: this is a bit hackish, set16colpalette called after initialization and nearly before main loop. + engine->enableSavingOrLoading(); +} void DreamGenContext::mode640x480() { // Video mode 12h: 640x480 pixels, 16 colors, I believe -- cgit v1.2.3 From afc6b2e617a6bef77963ac8b95cb424fa645668f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 18 Jun 2011 14:52:53 +0400 Subject: DREAMWEB: fixed size check in stosw(size) --- engines/dreamweb/runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index bb671431b0..47dcbf820c 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -499,7 +499,7 @@ public: } inline void _stosw(uint size, bool clear_cx = false) { - uint8 *dst = es.ptr(di, size); + uint8 *dst = es.ptr(di, size * 2); di += 2 * size; while(size--) { *dst++ = al; -- cgit v1.2.3 From cc77de35c23c5cf3caee33b04a93c88fa4e02b29 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 18 Jun 2011 13:12:13 +0200 Subject: SCUMM: make sure asmDrawStripToScreen is not called in 16bit mode (fixes possible issue in LOOM PCE) --- engines/scumm/gfx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index d3ff8266a0..b78059bd94 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -658,9 +658,6 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i return; } else #endif -#ifdef USE_ARM_GFX_ASM - asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); -#else if (_outputPixelFormat.bytesPerPixel == 2) { const byte *srcPtr = (const byte *)src; const byte *textPtr = (byte *)_textSurface.getBasePtr(x * m, y * m); @@ -682,7 +679,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i srcPtr += vsPitch; textPtr += _textSurface.pitch - width * m; } - } else { + } +#ifdef USE_ARM_GFX_ASM + asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch); +#else + else { // We blit four pixels at a time, for improved performance. const uint32 *src32 = (const uint32 *)src; uint32 *dst32 = (uint32 *)_compositeBuf; -- cgit v1.2.3 From a7234eef817ae43a93f1e3949a238dd3a3555e10 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 18 Jun 2011 16:30:29 +0200 Subject: SWORD25: Fix getting volume settings from config file The tests had been inverted, so that if there were config file settings it would use the default settings instead. --- engines/sword25/util/lua/scummvm_file.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp index 3c0377d0ee..9df090f49b 100644 --- a/engines/sword25/util/lua/scummvm_file.cpp +++ b/engines/sword25/util/lua/scummvm_file.cpp @@ -33,10 +33,10 @@ Sword25FileProxy::Sword25FileProxy(const Common::String &filename, const Common: } void Sword25FileProxy::setupConfigFile() { - double sfxVolume = ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0; - double musicVolume = ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0; - double speechVolume = ConfMan.hasKey("speech_volume") ? 1.0 : 1.0 * ConfMan.getInt("speech_volume") / 255.0; - bool subtitles = ConfMan.hasKey("subtitles") ? true : ConfMan.getBool("subtitles"); + double sfxVolume = !ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0; + double musicVolume = !ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0; + double speechVolume = !ConfMan.hasKey("speech_volume") ? 1.0 : 1.0 * ConfMan.getInt("speech_volume") / 255.0; + bool subtitles = !ConfMan.hasKey("subtitles") ? true : ConfMan.getBool("subtitles"); _readData = Common::String::format( "GAME_LANGUAGE = \"%s\"\r\n\ -- cgit v1.2.3 From 72aa426770af379223b1572f87c003c540f5a263 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sat, 18 Jun 2011 18:30:04 +0200 Subject: SWORD25: Fix locale-related bug when reading the volume settings I don't really like this, but I can't think of any better way. It seems that Lua doesn't like decimal comma at all, so we have to format the volume settings with a decimal point instead. Otherwise, all I'll ever get is either full volume or no volume, with nothing in between. --- engines/sword25/util/lua/scummvm_file.cpp | 30 ++++++++++++++++++++++++++---- engines/sword25/util/lua/scummvm_file.h | 1 + 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp index 9df090f49b..7667e19c6f 100644 --- a/engines/sword25/util/lua/scummvm_file.cpp +++ b/engines/sword25/util/lua/scummvm_file.cpp @@ -32,6 +32,25 @@ Sword25FileProxy::Sword25FileProxy(const Common::String &filename, const Common: setupConfigFile(); } +Common::String Sword25FileProxy::formatDouble(double value) { + // This is a bit hackish. The point of it is that it's important that + // we ignore the locale decimal mark and force it to be a point. If it + // would happen to be a comma instead, it seems that it's seen as two + // comma-separated integers rather than one floating-point value. Or + // something like that. + + bool negative = value < 0.0; + value = fabs(value); + double integerPart = floor(value); + double fractionalPart = (value - integerPart) * 1000000.0; + + Common::String out = Common::String::format("%.0f.%.0f", integerPart, fractionalPart); + if (negative) + out = "-" + out; + + return out; +} + void Sword25FileProxy::setupConfigFile() { double sfxVolume = !ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0; double musicVolume = !ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0; @@ -45,10 +64,13 @@ MAX_MEMORY_USAGE = 256000000\r\n\ GFX_VSYNC_ACTIVE = true\r\n\ SFX_SAMPLING_RATE = 44100\r\n\ SFX_CHANNEL_COUNT = 32\r\n\ -SFX_SOUND_VOLUME = %f\r\n\ -SFX_MUSIC_VOLUME = %f\r\n\ -SFX_SPEECH_VOLUME = %f\r\n", - getLanguage().c_str(), subtitles ? "true" : "false", sfxVolume, musicVolume, speechVolume); +SFX_SOUND_VOLUME = %s\r\n\ +SFX_MUSIC_VOLUME = %s\r\n\ +SFX_SPEECH_VOLUME = %s\r\n", + getLanguage().c_str(), subtitles ? "true" : "false", + formatDouble(sfxVolume).c_str(), + formatDouble(musicVolume).c_str(), + formatDouble(speechVolume).c_str()); _readPos = 0; } diff --git a/engines/sword25/util/lua/scummvm_file.h b/engines/sword25/util/lua/scummvm_file.h index a4cbd2a6cf..e8c468ee07 100644 --- a/engines/sword25/util/lua/scummvm_file.h +++ b/engines/sword25/util/lua/scummvm_file.h @@ -37,6 +37,7 @@ private: uint _readPos; Common::String _settings; + Common::String formatDouble(double value); void setupConfigFile(); Common::String getLanguage(); void setLanguage(const Common::String &lang); -- cgit v1.2.3 From 9b703356e6c7aecfea52cfa82714fb0ef8241465 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 18 Jun 2011 19:59:36 +0300 Subject: DREAMWEB: Fix saveGameState signature to match Engine's virtual method --- engines/dreamweb/detection.cpp | 2 +- engines/dreamweb/dreamweb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index c3e99fed47..b8cefaca95 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -140,7 +140,7 @@ Common::Error DreamWebEngine::loadGameState(int slot) { return Common::kNoError; } -Common::Error DreamWebEngine::saveGameState(int slot, const char *desc) { +Common::Error DreamWebEngine::saveGameState(int slot, const Common::String &desc) { return Common::kNoError; } diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index e4e0b0453a..a955bcfe47 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -69,7 +69,7 @@ public: void waitForVSync(); Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot, const char *desc); + Common::Error saveGameState(int slot, const Common::String &desc); bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); -- cgit v1.2.3 From 03ba1871f7392db32db09228878a2e148042f8c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 18 Jun 2011 19:44:18 +0200 Subject: SCUMM: fixed messed up colors in 16bit HE games (regression from 068b4a5351a5574dbfac6acff5776a0071f3f2dd) --- engines/scumm/gfx.cpp | 4 ++-- engines/scumm/gfx.h | 4 ++-- engines/scumm/scumm.cpp | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index b78059bd94..fd529b36fe 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -251,7 +251,7 @@ GdiV2::~GdiV2() { } #ifdef USE_RGB_COLOR -Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) { +GdiHE16bit::GdiHE16bit(ScummEngine *vm) : GdiHE(vm) { } #endif @@ -3674,7 +3674,7 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons #undef READ_BIT_256 #ifdef USE_RGB_COLOR -void Gdi16Bit::writeRoomColor(byte *dst, byte color) const { +void GdiHE16bit::writeRoomColor(byte *dst, byte color) const { WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2)); } #endif diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 54ce724da1..2e7111e78b 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -430,11 +430,11 @@ public: }; #ifdef USE_RGB_COLOR -class Gdi16Bit : public Gdi { +class GdiHE16bit : public GdiHE { protected: virtual void writeRoomColor(byte *dst, byte color) const; public: - Gdi16Bit(ScummEngine *vm); + GdiHE16bit(ScummEngine *vm); }; #endif diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 362430d704..4fd1f6b32d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -114,17 +114,18 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _rnd("scumm") { - if (_game.heversion > 0) { - _gdi = new GdiHE(this); - } else if (_game.platform == Common::kPlatformNES) { - _gdi = new GdiNES(this); #ifdef USE_RGB_COLOR - } else if (_game.features & GF_16BIT_COLOR) { + if (_game.features & GF_16BIT_COLOR) { if (_game.platform == Common::kPlatformPCEngine) _gdi = new GdiPCEngine(this); - else - _gdi = new Gdi16Bit(this); + else if (_game.heversion > 0) + _gdi = new GdiHE16bit(this); + } else #endif + if (_game.heversion > 0) { + _gdi = new GdiHE(this); + } else if (_game.platform == Common::kPlatformNES) { + _gdi = new GdiNES(this); } else if (_game.version <= 1) { _gdi = new GdiV1(this); } else if (_game.version == 2) { -- cgit v1.2.3 From 81e0dd1444ea2550800d344a03cccbc8135054c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 18 Jun 2011 16:32:59 +0200 Subject: SCUMM: regenerate 16bit palette after loading a savegame in LOOM PCE (this avoids isssues when using savegames from different ports with different 16bit color modes) --- engines/scumm/saveload.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 2be032d496..f9a6b211c3 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1497,6 +1497,16 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { resetCursors(); } } + + // Regenerate 16bit palette after loading. + // This avoids color issues when loading savegames that have been saved with a different ScummVM port + // that uses a different 16bit color mode than the ScummVM port which is currently used. +#ifdef USE_RGB_COLOR + if (_game.platform == Common::kPlatformPCEngine && s->isLoading()) { + for (int i = 0; i < 256; ++i) + _16BitPalette[i] = get16BitColor(_currentPalette[i * 3 + 0], _currentPalette[i * 3 + 1], _currentPalette[i * 3 + 2]); + } +#endif } #ifdef ENABLE_SCUMM_7_8 -- cgit v1.2.3 From 0246bdf74ea815623e9997b84b88d26b6ef075cf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 18 Jun 2011 19:56:07 +0200 Subject: AGOS: Get rid of unused variable. --- engines/agos/string.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index fa85d5767c..60e465fddf 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -723,11 +723,9 @@ void AGOSEngine_Feeble::printScreenText(uint vgaSpriteId, uint color, const char const char *string2 = string; int16 height, talkDelay; int stringLength = strlen(string); - int lettersPerRow; const int textHeight = 15; height = textHeight; - lettersPerRow = width / 6; talkDelay = (stringLength + 3) / 3; if (_variableArray[86] == 0) -- cgit v1.2.3 From 48e5bd36e9722d87787d077e34ca28a454cc14f1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 19 Jun 2011 00:58:16 +0200 Subject: LOL: fix bug reported on forum In cases where the script failed to delete a certain character from the party (because that character was not a party member) it would add this character to the party instead. E.g. when returning to Gladstone without having picked up Timothy, he would get added to the party after the throne room scene. The same happened with Lora at the Draracle if she wasn't picked up on the way. --- engines/kyra/lol.h | 2 +- engines/kyra/script_lol.cpp | 34 ++++++++++++++-------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index 943bb7f8d5..06a4f29f63 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -717,7 +717,7 @@ private: int olol_setScriptTimer(EMCState *script); int olol_createHandItem(EMCState *script); int olol_playAttackSound(EMCState *script); - int olol_characterJoinsParty(EMCState *script); + int olol_addRemoveCharacter(EMCState *script); int olol_giveItem(EMCState *script); int olol_loadTimScript(EMCState *script); int olol_runTimScript(EMCState *script); diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index 695528b8d1..1afefcffa4 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -1088,33 +1088,27 @@ int LoLEngine::olol_playAttackSound(EMCState *script) { return 1; } -int LoLEngine::olol_characterJoinsParty(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_characterJoinsParty(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); +int LoLEngine::olol_addRemoveCharacter(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_addRemoveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); int16 id = stackPos(0); - if (id < 0) + if (id < 0) { id = -id; + for (int i = 0; i < 4; i++) { + if (!(_characters[i].flags & 1) || _characters[i].id != id) + continue; - for (int i = 0; i < 4; i++) { - if (!(_characters[i].flags & 1) || _characters[i].id != id) - continue; - - _characters[i].flags &= 0xfffe; - calcCharPortraitXpos(); + _characters[i].flags &= 0xfffe; + calcCharPortraitXpos(); - if (!_updateFlags) { - gui_enableDefaultPlayfieldButtons(); - gui_drawPlayField(); + if (_selectedCharacter == i) + _selectedCharacter = 0; + break; } - - if (_selectedCharacter == i) - _selectedCharacter = 0; - - return 1; + } else { + addCharacter(id); } - addCharacter(id); - if (!_updateFlags) { gui_enableDefaultPlayfieldButtons(); gui_drawPlayField(); @@ -2823,7 +2817,7 @@ void LoLEngine::setupOpcodeTable() { Opcode(olol_setScriptTimer); Opcode(olol_createHandItem); Opcode(olol_playAttackSound); - Opcode(olol_characterJoinsParty); + Opcode(olol_addRemoveCharacter); // 0x4C Opcode(olol_giveItem); -- cgit v1.2.3 From 4de14b0dbc593db9bbccba9fb28a1ec0f589e56b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 19 Jun 2011 13:30:29 +1000 Subject: TSAGE: Fixed problem with number of voices not being reset --- engines/tsage/sound.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 79cd08b6fc..5531ad9843 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -707,6 +707,9 @@ void SoundManager::_sfRethinkVoiceTypes() { vse._type1._channelNum2 = 0; vse._type1._priority2 = 0; } + + // Reset the number of voices available + vs->_numVoices = vs->_total; } } @@ -2058,6 +2061,7 @@ void Sound::_soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceTyp vte._field5 = 0; driver->updateVoice(voiceType->_entries[idx]._voiceNum); } + return; } } } @@ -2424,11 +2428,10 @@ void AdlibSoundDriver::close() { bool AdlibSoundDriver::reset() { write(1, 0x20); write(4, 0x80); -/* - * code fragment originally part of testing Adlib timer speed + write(2, 1); write(4, 1); -*/ + return true; } -- cgit v1.2.3 From cc63cbcf5fe466ff72e84d1eeb34f0afd61b5714 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 19 Jun 2011 20:17:47 +1000 Subject: TSAGE: Cleaned up the write() method --- engines/tsage/sound.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 5531ad9843..4494656d46 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2512,18 +2512,6 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) { } void AdlibSoundDriver::write(byte reg, byte value) { -static int num = 1; -/* - if (((num - 1) % 8) == 0) - debugN("\n9800:%.4x ", (num - 1) * 2 + 2); - - debugN("%.2x %.2x ", reg, value); - ++num; -*/ -debugN("%d [%x]=%x ", num++, reg, value);//***DEBUG**** - for (int idx = 0; idx < ADLIB_CHANNEL_COUNT; ++idx) debugN("%d", _channelVoiced[idx] ? 1 : 0); - debugN("\n"); - _portContents[reg] = value; OPLWriteReg(_opl, reg, value); } -- cgit v1.2.3 From 41159c68ab35abea23e95974cedc286f530b11c9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 15:24:31 +0400 Subject: DREAMWEB: removed hack from openfile --- engines/dreamweb/stubs.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index be6dab5b52..7eeeabe136 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -162,10 +162,6 @@ void DreamGenContext::openfilefromc() { void DreamGenContext::openfile() { Common::String name = getFilename(*this); - if (name.empty()) { //fixme: this happens if you quit from new game/load screen - flags._c = true; - return; - } debug(1, "opening file: %s", name.c_str()); engine->openFile(name); cs.word(kHandle) = 1; //only one handle @@ -361,6 +357,7 @@ void DreamGenContext::generalerror() { } void DreamGenContext::dosreturn() { + _cmp(data.byte(kCommandtype), 250); if (!flags.z()) { data.byte(kCommandtype) = 250; -- cgit v1.2.3 From 4ede98d748d1d3a52714cf84da17ccd83b50d35b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 15:49:49 +0400 Subject: DREAMWEB: Removed getback = 4 hack, added clean exit from every menus and credits --- devtools/tasmrecover/dreamweb/dreamweb.asm | 22 ++++++++++---- devtools/tasmrecover/dreamweb/saveload.asm | 35 ++++++++++++++++++---- devtools/tasmrecover/dreamweb/titles.asm | 3 ++ engines/dreamweb/dreamgen.cpp | 47 +++++++++++++++++++++++------- engines/dreamweb/dreamgen.h | 1 - engines/dreamweb/dreamweb.cpp | 1 - 6 files changed, 87 insertions(+), 22 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index 5d2a60a0c7..a3c165aaf9 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -135,13 +135,24 @@ Dreamweb proc near dodecisions: call cls call setmode call decide + + cmp quitrequested, 0 + jnz exitgame + cmp getback,4 jz mainloop call titles + + cmp quitrequested, 0 + jnz exitgame + call credits -playgame: call clearchanges +playgame: + cmp quitrequested, 0 + jnz exitgame + call clearchanges call setmode call loadpalfromiff mov location,255 @@ -196,9 +207,8 @@ alreadyloaded: mov newlocation,255 mainloop: cmp quitrequested, 0 - jz $1 - ret -$1: + jnz exitgame + call screenupdate cmp wongame,0 jnz endofgame @@ -240,7 +250,9 @@ endofgame: call clearbeforeload call hangon call endgame jmp quickquit2 - + +exitgame: + ret endp diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm index f10d87149d..9a34a763f2 100644 --- a/devtools/tasmrecover/dreamweb/saveload.asm +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -109,7 +109,11 @@ restartops: call showopbox call showmainops call worktoscreenm donefirstops: mov getback,0 -waitops: call readmouse +waitops: + cmp quitrequested, 0 + jnz justret + + call readmouse call showpointer call vsync call dumppointer @@ -260,7 +264,11 @@ doload: mov loadingorsave,1 call namestoold mov getback,0 -loadops: call delpointer +loadops: + cmp quitrequested, 0 + jnz quitloaded + + call delpointer call readmouse call showpointer call vsync @@ -354,7 +362,11 @@ dodiscops: call scanfornames call worktoscreenm mov getback,0 -discopsloop: call delpointer +discopsloop: + cmp quitrequested, 0 + jnz quitdiscops + + call delpointer call readmouse call showpointer call vsync @@ -364,6 +376,7 @@ discopsloop: call delpointer call checkcoords cmp getback,0 jz discopsloop +quitdiscops: ret discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame @@ -411,7 +424,11 @@ dosave: mov loadingorsave,2 mov getback,0 -saveops: call delpointer +saveops: + cmp quitrequested, 0 + jnz quitsavegame + + call delpointer call checkinput call readmouse call showpointer @@ -423,6 +440,7 @@ saveops: call delpointer call checkcoords cmp getback,0 jz saveops +quitsavegame: ret savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops @@ -1398,7 +1416,12 @@ Decide proc near call fadescreenup mov getback,0 -waitdecide: call readmouse +waitdecide: + cmp quitrequested, 0 + jz $1 + ret +$1: + call readmouse call showpointer call vsync call dumppointer @@ -1482,6 +1505,8 @@ alreadyloadold: mov ax,mousebutton call doload cmp getback,4 jz noloadold + cmp quitrequested, 0 + jnz noloadold call showdecisions call worktoscreenm mov getback,0 diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm index a47f31a327..acaeefa995 100644 --- a/devtools/tasmrecover/dreamweb/titles.asm +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -9,7 +9,10 @@ Titles proc near else call clearpalette call biblequote + cmp quitrequested, 0 + jnz titlesearly call intro +titlesearly: ret endif diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 35721d3d4b..7c9c88136c 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4165,11 +4165,6 @@ deloneloop: goto deloneloop; } -void DreamGenContext::width160() { - STACK_CHECK; - _movsw(161); -} - void DreamGenContext::doblocks() { STACK_CHECK; es = data.word(kWorkspace); @@ -5169,6 +5164,9 @@ void DreamGenContext::titles() { STACK_CHECK; clearpalette(); biblequote(); + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (titlesearly) */; intro(); } @@ -15958,6 +15956,9 @@ restartops: donefirstops: data.byte(kGetback) = 0; waitops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + goto justret; readmouse(); showpointer(); vsync(); @@ -16083,6 +16084,9 @@ doload: namestoold(); data.byte(kGetback) = 0; loadops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitloaded) */; delpointer(); readmouse(); showpointer(); @@ -16164,6 +16168,9 @@ dodiscops: worktoscreenm(); data.byte(kGetback) = 0; discopsloop: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitdiscops) */; delpointer(); readmouse(); showpointer(); @@ -16210,6 +16217,9 @@ dosave: data.word(kBufferout) = 0; data.byte(kGetback) = 0; saveops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitsavegame) */; delpointer(); checkinput(); readmouse(); @@ -16833,6 +16843,11 @@ void DreamGenContext::decide() { fadescreenup(); data.byte(kGetback) = 0; waitdecide: + _cmp(data.byte(kQuitrequested), 0); + if (flags.z()) + goto _tmp1; + return; +_tmp1: readmouse(); showpointer(); vsync(); @@ -16895,6 +16910,9 @@ void DreamGenContext::doload() { namestoold(); data.byte(kGetback) = 0; loadops: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (quitloaded) */; delpointer(); readmouse(); showpointer(); @@ -16945,6 +16963,9 @@ alreadyloadold: _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; @@ -21319,12 +21340,21 @@ dodecisions: cls(); setmode(); decide(); + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (exitgame) */; _cmp(data.byte(kGetback), 4); if (flags.z()) goto mainloop; titles(); + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (exitgame) */; credits(); playgame: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + return /* (exitgame) */; clearchanges(); setmode(); loadpalfromiff(); @@ -21364,10 +21394,8 @@ loadnew: data.byte(kCommandtype) = 255; mainloop: _cmp(data.byte(kQuitrequested), 0); - if (flags.z()) - goto _tmp1; - return; -_tmp1: + if (!flags.z()) + return /* (exitgame) */; screenupdate(); _cmp(data.byte(kWongame), 0); if (!flags.z()) @@ -22120,7 +22148,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case 0xc20c: doshake(); break; case 0xc210: zoom(); break; case 0xc214: delthisone(); break; - case 0xc224: width160(); break; case 0xc228: doblocks(); break; case 0xc22c: showframe(); break; case 0xc230: frameoutv(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 94b7607087..d7cf4677e3 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -964,7 +964,6 @@ public: void createpanel(); void turnpathon(); void showmainops(); - void width160dosreturn(); void madmanstelly(); void constant(); void loadroomssample(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0dc25afab0..7e1b9833dc 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -102,7 +102,6 @@ void DreamWebEngine::waitForVSync() { void DreamWebEngine::quit() { _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 1; _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = 1; - _context.data.byte(DreamGen::DreamGenContext::kGetback) = 4; } void DreamWebEngine::processEvents() { -- cgit v1.2.3 From 9f8850fd918b37b7c7d214ffaaec0ae2b5987bd7 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 16:05:55 +0400 Subject: DREAMWEB: Added checksums for German CD release --- engines/dreamweb/detection_tables.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 058d43cbd2..f32b8de6b6 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -81,6 +81,23 @@ static const DreamWebGameDescription gameDescriptions[] = { }, }, + // German CD release + { + { + "dreamweb", + "CD", + { + {"dreamweb.r00", 0, "9960dc3baddabc6ad2a6fd75292b149c", 155886}, + {"dreamweb.r02", 0, "076ca7cd326cb2abfb2091c6cf46ae08", 201038}, + AD_LISTEND + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_CD | ADGF_UNSTABLE, + GUIO_NONE + }, + }, + { AD_TABLE_END_MARKER } }; -- cgit v1.2.3 From 984407de8473731687203675c3bc3dda93e79cbf Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 19 Jun 2011 14:46:02 +0200 Subject: SCUMM: fix SCUMM3 FM-TOWNS font rendering glitch in Japanese mode (Wrong character height for non-SJIS chars which messed up the inventory scrolling arrows) --- engines/scumm/charset.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 9238b25feb..97caa47d6a 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -789,8 +789,10 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) { else if (_vm->_cjkFont) _vm->_cjkFont->drawChar(_vm->_textSurface, chr, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, _color, _shadowColor); #endif - if (is2byte) + if (is2byte) { origWidth /= _vm->_textSurfaceMultiplier; + height /= _vm->_textSurfaceMultiplier; + } } if (_str.left > _left) @@ -804,8 +806,8 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) { _str.right++; } - if (_str.bottom < _top + height / _vm->_textSurfaceMultiplier) - _str.bottom = _top + height / _vm->_textSurfaceMultiplier; + if (_str.bottom < _top + height) + _str.bottom = _top + height; } void CharsetRendererV3::drawChar(int chr, Graphics::Surface &s, int x, int y) { -- cgit v1.2.3 From 57c68af92e856f300a45c0b0ab929464e1f414eb Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 16:55:36 +0400 Subject: DREAMWEB: Fixed quit from travel screen --- devtools/tasmrecover/dreamweb/newplace.asm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm index cac6e100a7..10a587f25b 100644 --- a/devtools/tasmrecover/dreamweb/newplace.asm +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -53,7 +53,10 @@ Selectlocation proc near call playchannel0 mov newlocation,255 -select: call delpointer +select: + cmp quitrequested, 0 + jnz quittravel + call delpointer call readmouse call showpointer call vsync -- cgit v1.2.3 From 5efe835f203a94d06f3ff64a9df39c9fdaae8a3b Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 16:55:55 +0400 Subject: DREAMWEB: Added assertions on cx == 0xffff --- engines/dreamweb/runtime.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 47dcbf820c..bbffa7846f 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -463,6 +463,7 @@ public: } inline void _movsb(uint size, bool clear_cx = false) { + assert(size != 0xffff); uint8 *dst = es.ptr(di, size); uint8 *src = ds.ptr(si, size); memcpy(dst, src, size); @@ -478,6 +479,7 @@ public: } inline void _movsw(uint size, bool clear_cx = false) { + assert(size != 0xffff); _movsb(size * 2, clear_cx); } @@ -486,6 +488,7 @@ public: } inline void _stosb(uint size, bool clear_cx = false) { + assert(size != 0xffff); uint8 *dst = es.ptr(di, size); memset(dst, al, size); di += size; @@ -499,6 +502,7 @@ public: } inline void _stosw(uint size, bool clear_cx = false) { + assert(size != 0xffff); uint8 *dst = es.ptr(di, size * 2); di += 2 * size; while(size--) { -- cgit v1.2.3 From 613a203c8a8ac6175988938fbbceaa47ee8b2877 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 19 Jun 2011 16:56:19 +0400 Subject: DREAMWEB: Added crash workaround --- devtools/tasmrecover/dreamweb/object.asm | 4 +++- engines/dreamweb/dreamgen.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index 93710d3c23..d0465e09bc 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -2583,8 +2583,10 @@ findlenextext: mov cl,[es:si] sub bx,extext push bx ax sub cx,bx + cmp cx, 0xffff; BIG FIXME! Find out why this is happening + jz $1 rep movsb - pop bx +$1: pop bx sub extextpos,bx pop si diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 7c9c88136c..d4fb4441f6 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -8302,7 +8302,11 @@ findlenextext: push(bx); push(ax); _sub(cx, bx); + _cmp(cx, 0xffff); + if (flags.z()) + goto _tmp1; _movsb(cx, true); +_tmp1: bx = pop(); _sub(data.word(kExtextpos), bx); si = pop(); @@ -9536,6 +9540,9 @@ void DreamGenContext::selectlocation() { playchannel0(); data.byte(kNewlocation) = 255; select: + _cmp(data.byte(kQuitrequested), 0); + if (!flags.z()) + goto quittravel; delpointer(); readmouse(); showpointer(); -- cgit v1.2.3 From 0efea76fff1a68a2050e9b427c383c24a0ab5d8c Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 19 Jun 2011 15:13:49 +0200 Subject: TSAGE: Silence GCC warnings (hopefully without breaking anything) There is one remaining warning about 'maxPriority' being set but not tested in one of the loops in _sfRethinkSoundDrivers(), but I'm uncertain about that one. Looks like it could be an actual engine bug. --- engines/tsage/sound.cpp | 24 ++++++++++++++---------- engines/tsage/sound.h | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 4494656d46..88b2c2abb2 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -232,19 +232,20 @@ void SoundManager::unInstallDriver(int driverNum) { // Mute any loaded sounds disableSoundServer(); - for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) - (*i)->mute(true); + Common::List::iterator j; + for (j = _playList.begin(); j != _playList.end(); ++j) + (*j)->mute(true); // Uninstall the driver _sfUnInstallDriver(*i); // Re-orient all the loaded sounds - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->orientAfterDriverChange(); + for (j = _soundList.begin(); j != _soundList.end(); ++j) + (*j)->orientAfterDriverChange(); // Unmute currently active sounds - for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) - (*i)->mute(false); + for (j = _playList.begin(); j != _playList.end(); ++j) + (*j)->mute(false); enableSoundServer(); } @@ -549,14 +550,16 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) { void SoundManager::_sfRethinkSoundDrivers() { // Free any existing entries - for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + int idx; + + for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) { if (sfManager()._voiceTypeStructPtrs[idx]) { delete sfManager()._voiceTypeStructPtrs[idx]; sfManager()._voiceTypeStructPtrs[idx] = NULL; } } - for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { + for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) { byte flag = 0xff; int total = 0; @@ -638,7 +641,7 @@ void SoundManager::_sfRethinkSoundDrivers() { byteVal = *groupData; groupData += 2; - for (int idx = 0; idx < byteVal; ++idx) { + for (idx = 0; idx < byteVal; ++idx) { VoiceStructEntry ve; memset(&ve, 0, sizeof(VoiceStructEntry)); @@ -2462,8 +2465,9 @@ void AdlibSoundDriver::proc32(int channel, int program, int v0, int v1) { int offset = READ_LE_UINT16(_patchData + program * 2); if (offset) { const byte *dataP = _patchData + offset; + int id; - for (int offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) { + for (offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) { if ((dataP[offset] <= v0) && (dataP[offset + 1] >= v0)) { if (dataP[offset + 2] != 0xff) v0 = dataP[offset + 2]; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 4bef27d2c9..105b2a43bf 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -74,6 +74,7 @@ public: int _driverResID; public: SoundDriver(); + virtual ~SoundDriver() {}; const Common::String &getShortDriverDescription() { return _shortDescription; } const Common::String &getLongDriverDescription() { return _longDescription; } @@ -415,7 +416,7 @@ private: void setFrequency(int channel); public: AdlibSoundDriver(); - ~AdlibSoundDriver(); + virtual ~AdlibSoundDriver(); virtual bool open(); virtual void close(); -- cgit v1.2.3 From a15d233dc4f83c04252442496594aa1658f6f83c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 19 Jun 2011 23:19:02 +1000 Subject: DREAMWEB: Fix compilation error on MSVC --- engines/dreamweb/stubs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 7eeeabe136..e2da072fae 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -287,7 +287,7 @@ void DreamGenContext::out22c() { void DreamGenContext::soundstartup() {} void DreamGenContext::soundend() {} -void DreamGenContext::DreamGenContext::interupttest() {} +void DreamGenContext::interupttest() {} void DreamGenContext::disablesoundint() {} void DreamGenContext::enablesoundint() {} void DreamGenContext::checksoundint() { -- cgit v1.2.3 From 85e4e2933adcb3c9472b7a7095bb7b481a973fa0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 19 Jun 2011 23:21:02 +1000 Subject: TSAGE: Fix signalling an action when a song stops --- engines/tsage/sound.cpp | 10 +++++----- engines/tsage/sound.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 88b2c2abb2..1288ba9367 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1454,7 +1454,7 @@ void Sound::unPrime() { stop(); } -void Sound::_prime(int soundResID, bool queueFlag) { +void Sound::_prime(int soundResID, bool dontQueue) { if (_primed) unPrime(); @@ -1485,8 +1485,8 @@ void Sound::_prime(int soundResID, bool queueFlag) { _remoteReceiver = ALLOCATE(200); } - _soPrimeSound(queueFlag); - if (queueFlag) + _soPrimeSound(dontQueue); + if (!dontQueue) _soundManager->addToSoundList(this); _primed = true; @@ -1675,8 +1675,8 @@ void Sound::release() { _hold = -1; } -void Sound::_soPrimeSound(bool queueFlag) { - if (!queueFlag) { +void Sound::_soPrimeSound(bool dontQueue) { + if (!dontQueue) { _priority = (_fixedPriority != -1) ? _fixedPriority : _sndResPriority; _loop = !_fixedLoop ? _fixedLoop : _sndResLoop; _pausedCount = 0; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 105b2a43bf..8fcb1c38ff 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -247,7 +247,7 @@ public: class Sound: public EventHandler { private: - void _prime(int soundResID, bool queueFlag); + void _prime(int soundResID, bool dontQueue); void _unPrime(); void orientAfterRestore(); public: @@ -329,7 +329,7 @@ public: void orientAfterDriverChange(); // _so methods - void _soPrimeSound(bool queueFlag); + void _soPrimeSound(bool dontQueue); void _soSetTimeIndex(uint timeIndex); bool _soServiceTracks(); void _soPrimeChannelData(); -- cgit v1.2.3 From 575fbcb1c1ea904da17fe04580e589514275347a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 19 Jun 2011 18:04:41 +0200 Subject: DREAMWEB: Remove control chars from source --- devtools/tasmrecover/dreamweb/backdrop.asm | 1 - devtools/tasmrecover/dreamweb/debug.asm | 1 - devtools/tasmrecover/dreamweb/dreamweb.asm | 1 - devtools/tasmrecover/dreamweb/keypad.asm | 1 - devtools/tasmrecover/dreamweb/look.asm | 1 - devtools/tasmrecover/dreamweb/monitor.asm | 1 - devtools/tasmrecover/dreamweb/newplace.asm | 1 - devtools/tasmrecover/dreamweb/object.asm | 1 - devtools/tasmrecover/dreamweb/print.asm | 1 - devtools/tasmrecover/dreamweb/saveload.asm | 1 - devtools/tasmrecover/dreamweb/sblaster.asm | 1 - devtools/tasmrecover/dreamweb/sprite.asm | 1 - devtools/tasmrecover/dreamweb/talk.asm | 1 - devtools/tasmrecover/dreamweb/titles.asm | 1 - devtools/tasmrecover/dreamweb/use.asm | 1 - devtools/tasmrecover/dreamweb/vars.asm | 1 - devtools/tasmrecover/dreamweb/vgafades.asm | 1 - devtools/tasmrecover/dreamweb/vgagrafx.asm | 1 - 18 files changed, 18 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm index c02d95bbe9..5dfe20bf5d 100644 --- a/devtools/tasmrecover/dreamweb/backdrop.asm +++ b/devtools/tasmrecover/dreamweb/backdrop.asm @@ -874,4 +874,3 @@ over147: mov ch,0 - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm index 991e240fd1..951da4fa3f 100644 --- a/devtools/tasmrecover/dreamweb/debug.asm +++ b/devtools/tasmrecover/dreamweb/debug.asm @@ -379,4 +379,3 @@ debugtextr: db "00000",0 endif - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index 88cf2a91c0..89c515f511 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -6273,4 +6273,3 @@ STACKSPACE ends  - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm index d75a4fde82..8ac38524aa 100644 --- a/devtools/tasmrecover/dreamweb/keypad.asm +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -1755,4 +1755,3 @@ Findtext1 proc near endp - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/look.asm b/devtools/tasmrecover/dreamweb/look.asm index b5bc913a73..399e1f16fd 100644 --- a/devtools/tasmrecover/dreamweb/look.asm +++ b/devtools/tasmrecover/dreamweb/look.asm @@ -164,4 +164,3 @@ dogetback: mov getback,1 - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm index 7cc1a5a4dd..247ba10f2b 100644 --- a/devtools/tasmrecover/dreamweb/monitor.asm +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -1493,4 +1493,3 @@ finishcurdel: - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm index cac6e100a7..c412dba293 100644 --- a/devtools/tasmrecover/dreamweb/newplace.asm +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -578,4 +578,3 @@ Readcitypic proc near - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index 93710d3c23..e887f36549 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -2605,4 +2605,3 @@ beforethistext: mov [es:di],ax - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm index a276db7298..e99641c094 100644 --- a/devtools/tasmrecover/dreamweb/print.asm +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -588,4 +588,3 @@ nomod: ret endp endif - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm index e8fa018de8..e0b6061165 100644 --- a/devtools/tasmrecover/dreamweb/saveload.asm +++ b/devtools/tasmrecover/dreamweb/saveload.asm @@ -1486,4 +1486,3 @@ noloadold: ret - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm index 9eb9afc08f..46eb8e2366 100644 --- a/devtools/tasmrecover/dreamweb/sblaster.asm +++ b/devtools/tasmrecover/dreamweb/sblaster.asm @@ -1290,4 +1290,3 @@ nopitflip: cli - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm index bb7ba402f8..f546e0463c 100644 --- a/devtools/tasmrecover/dreamweb/sprite.asm +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -5031,4 +5031,3 @@ finishevery2: ret - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm index d19257072b..d1a69f4e89 100644 --- a/devtools/tasmrecover/dreamweb/talk.asm +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -566,4 +566,3 @@ doredes: call delpointer - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm index 6441d568ec..fb410ab134 100644 --- a/devtools/tasmrecover/dreamweb/titles.asm +++ b/devtools/tasmrecover/dreamweb/titles.asm @@ -525,4 +525,3 @@ RealCredits proc near - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm index 250aa00240..508e8bd4c1 100644 --- a/devtools/tasmrecover/dreamweb/use.asm +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -3807,4 +3807,3 @@ nowinch: call showfirstuse - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm index 37d48e944b..dbb41cd7f2 100644 --- a/devtools/tasmrecover/dreamweb/vars.asm +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -561,4 +561,3 @@ gameerror db 0 howmuchalloc dw 0 - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm index 26874a428f..06cc9d6a44 100644 --- a/devtools/tasmrecover/dreamweb/vgafades.asm +++ b/devtools/tasmrecover/dreamweb/vgafades.asm @@ -864,4 +864,3 @@ Initialmoncols proc near endp - \ No newline at end of file diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm index 4082883b6a..3a820a5d9a 100644 --- a/devtools/tasmrecover/dreamweb/vgagrafx.asm +++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm @@ -1759,4 +1759,3 @@ Title7graphics db "DREAMWEB.I07",0 Palettescreen db "DREAMWEB.PAL",0 - \ No newline at end of file -- cgit v1.2.3 From 01c22ea1602a41b5f13b691e9140d63b5300da80 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 18:23:35 +0200 Subject: TEENAGENT: Get rid of unused variable. --- engines/teenagent/animation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index af54bca6a4..e945bda1e5 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -115,7 +115,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) { return; } - uint16 pos = 0; + //uint16 pos = 0; int off = 0; switch (type) { case kTypeLan: @@ -141,7 +141,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) { frames = new Surface[frames_count]; s->skip(frames_count * 2 - 2); //sizes - pos = s->readUint16LE(); + /*pos = */s->readUint16LE(); //debug(0, "pos?: %04x", pos); for (uint16 i = 0; i < frames_count; ++i) { -- cgit v1.2.3 From d316099f35c2b3ea351d39cf7be588c31ca9be48 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 18:27:18 +0200 Subject: OPENGLSDL: Formatting fixes. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 87457c3c08..00352689c1 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -110,16 +110,16 @@ void OpenGLSdlGraphicsManager::detectSupportedFormats() { // use. const Graphics::PixelFormat RGBList[] = { #if defined(ENABLE_32BIT) - Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888 + Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888 #ifndef USE_GLES Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), // ARGB8888 #endif - Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888 + Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888 #endif - Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565 - Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551 - Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555 - Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444 + Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565 + Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551 + Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555 + Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444 #ifndef USE_GLES Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) // ARGB4444 #endif -- cgit v1.2.3 From 735604c2fdc8a6e8dc2874c49413715555dc692b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 18:31:34 +0200 Subject: OPENGLSDL: Use String::format instead of sprintf. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 00352689c1..0fcee18605 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -394,27 +394,27 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() { if (newModeName) { const int scaleFactor = getScale(); - char buffer[128]; - sprintf(buffer, "%s: %s\n%d x %d -> %d x %d", + Common::String osdMessage = Common::String::format( + "%s: %s\n%d x %d -> %d x %d", _("Current display mode"), newModeName, _videoMode.screenWidth * scaleFactor, _videoMode.screenHeight * scaleFactor, _hwscreen->w, _hwscreen->h ); - displayMessageOnOSD(buffer); + displayMessageOnOSD(osdMessage.c_str()); } } void OpenGLSdlGraphicsManager::displayScaleChangedMsg() { - char buffer[128]; const int scaleFactor = getScale(); - sprintf(buffer, "%s: x%d\n%d x %d -> %d x %d", + Common::String osdMessage = Common::String::format( + "%s: x%d\n%d x %d -> %d x %d", _("Current scale"), scaleFactor, _videoMode.screenWidth, _videoMode.screenHeight, _videoMode.overlayWidth, _videoMode.overlayHeight ); - displayMessageOnOSD(buffer); + displayMessageOnOSD(osdMessage.c_str()); } #endif @@ -450,18 +450,18 @@ void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) { _ignoreResizeFrames = 10; #ifdef USE_OSD - char buffer[128]; + Common::String osdMessage; if (getFullscreenMode()) - sprintf(buffer, "%s\n%d x %d", + osdMessage = Common::String::format("%s\n%d x %d", _("Fullscreen mode"), _hwscreen->w, _hwscreen->h ); else - sprintf(buffer, "%s\n%d x %d", + osdMessage = Common::String::format("%s\n%d x %d", _("Windowed mode"), _hwscreen->w, _hwscreen->h ); - displayMessageOnOSD(buffer); + displayMessageOnOSD(osdMessage.c_str()); #endif } @@ -478,19 +478,19 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { // Alt-S create a screenshot if (event.kbd.keycode == 's') { - char filename[20]; + Common::String filename; for (int n = 0;; n++) { SDL_RWops *file; - sprintf(filename, "scummvm%05d.bmp", n); - file = SDL_RWFromFile(filename, "r"); + filename = Common::String::format("scummvm%05d.bmp", n); + file = SDL_RWFromFile(filename.c_str(), "r"); if (!file) break; SDL_RWclose(file); } - if (saveScreenshot(filename)) - debug("Saved screenshot '%s'", filename); + if (saveScreenshot(filename.c_str())) + debug("Saved screenshot '%s'", filename.c_str()); else warning("Could not save screenshot"); return true; @@ -511,18 +511,18 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection)); endGFXTransaction(); #ifdef USE_OSD - char buffer[128]; + Common::String osdMessage; if (getFeatureState(OSystem::kFeatureAspectRatioCorrection)) - sprintf(buffer, "%s\n%d x %d -> %d x %d", - _("Enabled aspect ratio correction"), + osdMessage = Common::String::format("%s\n%d x %d -> %d x %d", + _("Enabled aspect ratio correction"), _videoMode.screenWidth, _videoMode.screenHeight, _hwscreen->w, _hwscreen->h); else - sprintf(buffer, "%s\n%d x %d -> %d x %d", - _("Disabled aspect ratio correction"), + osdMessage = Common::String::format("%s\n%d x %d -> %d x %d", + _("Disabled aspect ratio correction"), _videoMode.screenWidth, _videoMode.screenHeight, _hwscreen->w, _hwscreen->h); - displayMessageOnOSD(buffer); + displayMessageOnOSD(osdMessage.c_str()); #endif internUpdateScreen(); return true; -- cgit v1.2.3 From f28e134247c2017c8a5d9df54a1f745dc7802028 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 18:48:30 +0200 Subject: OPENGL: Formatting fixes. --- backends/graphics/opengl/opengl-graphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index c0551de386..9ec38dbbed 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -179,7 +179,7 @@ bool OpenGLGraphicsManager::setGraphicsMode(int mode) { } int OpenGLGraphicsManager::getGraphicsMode() const { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); return _videoMode.mode; } @@ -420,12 +420,12 @@ void OpenGLGraphicsManager::fillScreen(uint32 col) { } void OpenGLGraphicsManager::updateScreen() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); internUpdateScreen(); } void OpenGLGraphicsManager::setShakePos(int shakeOffset) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); _shakePos = shakeOffset; } @@ -440,7 +440,7 @@ void OpenGLGraphicsManager::clearFocusRectangle() { // void OpenGLGraphicsManager::showOverlay() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (_overlayVisible) return; @@ -451,7 +451,7 @@ void OpenGLGraphicsManager::showOverlay() { } void OpenGLGraphicsManager::hideOverlay() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (!_overlayVisible) return; @@ -483,7 +483,7 @@ void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { } void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (_overlayTexture == NULL) return; -- cgit v1.2.3 From 34f8b489d2af01992cf8e9d75f9218372ac04e39 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 18:49:02 +0200 Subject: SDL: Formatting fixes. --- backends/graphics/sdl/sdl-graphics.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 9063f55744..257c3ea2ef 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -631,7 +631,7 @@ void SdlGraphicsManager::setGraphicsModeIntern() { } int SdlGraphicsManager::getGraphicsMode() const { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); return _videoMode.mode; } @@ -941,7 +941,7 @@ bool SdlGraphicsManager::hotswapGFXMode() { } void SdlGraphicsManager::updateScreen() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends @@ -1223,7 +1223,7 @@ void SdlGraphicsManager::setAspectRatioCorrection(bool enable) { } void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); assert(src); if (_screen == NULL) { @@ -1273,7 +1273,7 @@ void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int } Graphics::Surface *SdlGraphicsManager::lockScreen() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); // Lock the graphics mutex g_system->lockMutex(_graphicsMutex); @@ -1300,7 +1300,7 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() { } void SdlGraphicsManager::unlockScreen() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); // paranoia check assert(_screenIsLocked); @@ -1465,7 +1465,7 @@ void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint n } void SdlGraphicsManager::setShakePos(int shake_pos) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); _newShakePos = shake_pos; } @@ -1511,7 +1511,7 @@ void SdlGraphicsManager::clearFocusRectangle() { #pragma mark - void SdlGraphicsManager::showOverlay() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); int x, y; @@ -1534,7 +1534,7 @@ void SdlGraphicsManager::showOverlay() { } void SdlGraphicsManager::hideOverlay() { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (!_overlayVisible) return; @@ -1558,7 +1558,7 @@ void SdlGraphicsManager::hideOverlay() { } void SdlGraphicsManager::clearOverlay() { - //assert (_transactionMode == kTransactionNone); + //assert(_transactionMode == kTransactionNone); Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends @@ -1591,7 +1591,7 @@ void SdlGraphicsManager::clearOverlay() { } void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (_overlayscreen == NULL) return; @@ -1611,7 +1611,7 @@ void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { } void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); if (_overlayscreen == NULL) return; @@ -2037,7 +2037,7 @@ void SdlGraphicsManager::drawMouse() { #ifdef USE_OSD void SdlGraphicsManager::displayMessageOnOSD(const char *msg) { - assert (_transactionMode == kTransactionNone); + assert(_transactionMode == kTransactionNone); assert(msg); Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends -- cgit v1.2.3 From e0eb86826e5855bae1a8cc2ce81fa935b891d128 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 19:03:10 +0200 Subject: OPENGL: Clarify OSD rect color in a comment. --- backends/graphics/opengl/opengl-graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 9ec38dbbed..4c2c70daf2 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -1413,7 +1413,7 @@ void OpenGLGraphicsManager::updateOSD() { int dstX = (_osdSurface.w - width) / 2; int dstY = (_osdSurface.h - height) / 2; - // Draw a dark gray rect + // Draw a dark gray rect (R = 40, G = 40, B = 40) const uint16 color = 0x294B; _osdSurface.fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color); -- cgit v1.2.3 From f9f16ee35823db90ff561b06af05a2c02d341fc9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 19:09:55 +0200 Subject: OPENGLSDL: Add FIXME about desktop resolution retrieving. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 0fcee18605..eefba59089 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -54,6 +54,10 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() SDL_ShowCursor(SDL_DISABLE); // Get desktop resolution + // TODO: In case the OpenGL manager is created *after* a plain SDL manager + // has been used, this will return the last setup graphics mode rather + // than the desktop resolution. We should really look into a way to + // properly retrieve the desktop resolution. const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo(); if (videoInfo->current_w > 0 && videoInfo->current_h > 0) { _desktopWidth = videoInfo->current_w; -- cgit v1.2.3 From 2067bec18e905e62ae1110e8b58b1178b6800c6c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 19:33:06 +0200 Subject: SDL: Remove left over traces from the time the SdlEventSource subclassed DefaultEventManager. --- backends/events/sdl/sdl-events.h | 6 +++--- backends/platform/sdl/sdl.cpp | 28 ++++++++++++---------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h index 227d6e1607..9b9d265970 100644 --- a/backends/events/sdl/sdl-events.h +++ b/backends/events/sdl/sdl-events.h @@ -20,13 +20,13 @@ * */ -#if !defined(BACKEND_EVENTS_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) +#ifndef BACKEND_EVENTS_SDL_H #define BACKEND_EVENTS_SDL_H -#include "backends/events/default/default-events.h" - #include "backends/platform/sdl/sdl-sys.h" +#include "common/events.h" + /** * The SDL event source. diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index e36878db07..7b24ebe753 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -172,22 +172,6 @@ void OSystem_SDL::initBackend() { } } - // Creates the backend managers, if they don't exist yet (we check - // for this to allow subclasses to provide their own). - if (_eventManager == 0) - _eventManager = new DefaultEventManager(_eventSource); - - // We have to initialize the graphics manager before the event manager - // so the virtual keyboard can be initialized, but we have to add the - // graphics manager as an event observer after initializing the event - // manager. - if (graphicsManagerType == 0) - ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); -#ifdef USE_OPENGL - else if (graphicsManagerType == 1) - ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver(); -#endif - if (_savefileManager == 0) _savefileManager = new DefaultSaveFileManager(); @@ -207,6 +191,18 @@ void OSystem_SDL::initBackend() { _inited = true; ModularBackend::initBackend(); + + // We have to initialize the graphics manager before the event manager + // so the virtual keyboard can be initialized, but we have to add the + // graphics manager as an event observer after initializing the event + // manager. + if (graphicsManagerType == 0) + ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); +#ifdef USE_OPENGL + else if (graphicsManagerType == 1) + ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver(); +#endif + } void OSystem_SDL::initSDL() { -- cgit v1.2.3 From 1c21232416cb39f021631906320e21f8efa212ba Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 20:08:55 +0200 Subject: SDL: Rename SdlGraphicsManager to SurfaceSdlGraphicsManager to reflect its purpose. Hopefully I catched all uses of the old name in our ports... --- backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 10 +- backends/graphics/dinguxsdl/dinguxsdl-graphics.h | 8 +- backends/graphics/gph/gph-graphics.cpp | 12 +- backends/graphics/gph/gph-graphics.h | 8 +- .../linuxmotosdl/linuxmotosdl-graphics.cpp | 10 +- .../graphics/linuxmotosdl/linuxmotosdl-graphics.h | 4 +- backends/graphics/openpandora/op-graphics.cpp | 4 +- backends/graphics/openpandora/op-graphics.h | 8 +- .../samsungtvsdl/samsungtvsdl-graphics.cpp | 6 +- .../graphics/samsungtvsdl/samsungtvsdl-graphics.h | 4 +- backends/graphics/sdl/sdl-graphics.cpp | 2321 -------------------- backends/graphics/sdl/sdl-graphics.h | 338 --- .../graphics/surfacesdl/surfacesdl-graphics.cpp | 2321 ++++++++++++++++++++ backends/graphics/surfacesdl/surfacesdl-graphics.h | 338 +++ .../graphics/symbiansdl/symbiansdl-graphics.cpp | 6 +- backends/graphics/symbiansdl/symbiansdl-graphics.h | 4 +- backends/graphics/wincesdl/wincesdl-graphics.cpp | 14 +- backends/graphics/wincesdl/wincesdl-graphics.h | 4 +- backends/module.mk | 2 +- backends/platform/sdl/sdl.cpp | 14 +- 20 files changed, 2718 insertions(+), 2718 deletions(-) delete mode 100644 backends/graphics/sdl/sdl-graphics.cpp delete mode 100644 backends/graphics/sdl/sdl-graphics.h create mode 100644 backends/graphics/surfacesdl/surfacesdl-graphics.cpp create mode 100644 backends/graphics/surfacesdl/surfacesdl-graphics.h diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 8a141e97a5..d1a31869ed 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -36,7 +36,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { }; DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss) - : SdlGraphicsManager(boss) { + : SurfaceSdlGraphicsManager(boss) { } const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const { @@ -415,7 +415,7 @@ void DINGUXSdlGraphicsManager::showOverlay() { _mouseCurState.x = _mouseCurState.x / 2; _mouseCurState.y = _mouseCurState.y / 2; } - SdlGraphicsManager::showOverlay(); + SurfaceSdlGraphicsManager::showOverlay(); } void DINGUXSdlGraphicsManager::hideOverlay() { @@ -423,7 +423,7 @@ void DINGUXSdlGraphicsManager::hideOverlay() { _mouseCurState.x = _mouseCurState.x * 2; _mouseCurState.y = _mouseCurState.y * 2; } - SdlGraphicsManager::hideOverlay(); + SurfaceSdlGraphicsManager::hideOverlay(); } bool DINGUXSdlGraphicsManager::loadGFXMode() { @@ -462,7 +462,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() { } - return SdlGraphicsManager::loadGFXMode(); + return SurfaceSdlGraphicsManager::loadGFXMode(); } bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) { @@ -507,7 +507,7 @@ void DINGUXSdlGraphicsManager::warpMouse(int x, int y) { y = y / 2; } } - SdlGraphicsManager::warpMouse(x, y); + SurfaceSdlGraphicsManager::warpMouse(x, y); } void DINGUXSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index 9fb1170503..d24e72f63e 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -23,7 +23,7 @@ #ifndef BACKENDS_GRAPHICS_SDL_DINGUX_H #define BACKENDS_GRAPHICS_SDL_DINGUX_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" @@ -32,7 +32,7 @@ enum { GFX_HALF = 12 }; -class DINGUXSdlGraphicsManager : public SdlGraphicsManager { +class DINGUXSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: DINGUXSdlGraphicsManager(SdlEventSource *boss); @@ -54,8 +54,8 @@ public: void undrawMouse(); virtual void warpMouse(int x, int y); - SdlGraphicsManager::MousePos *getMouseCurState(); - SdlGraphicsManager::VideoState *getVideoMode(); + SurfaceSdlGraphicsManager::MousePos *getMouseCurState(); + SurfaceSdlGraphicsManager::VideoState *getVideoMode(); virtual void adjustMouseEvent(const Common::Event &event); }; diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index eb748f2fc2..5c98635b71 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -36,7 +36,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { }; GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource) { + : SurfaceSdlGraphicsManager(sdlEventSource) { } const OSystem::GraphicsMode *GPHGraphicsManager::getSupportedGraphicsModes() const { @@ -443,7 +443,7 @@ void GPHGraphicsManager::showOverlay() { _mouseCurState.x = _mouseCurState.x / 2; _mouseCurState.y = _mouseCurState.y / 2; } - SdlGraphicsManager::showOverlay(); + SurfaceSdlGraphicsManager::showOverlay(); } void GPHGraphicsManager::hideOverlay() { @@ -451,7 +451,7 @@ void GPHGraphicsManager::hideOverlay() { _mouseCurState.x = _mouseCurState.x * 2; _mouseCurState.y = _mouseCurState.y * 2; } - SdlGraphicsManager::hideOverlay(); + SurfaceSdlGraphicsManager::hideOverlay(); } @@ -503,7 +503,7 @@ void GPHGraphicsManager::hideOverlay() { // // } -// return SdlGraphicsManager::loadGFXMode(); +// return SurfaceSdlGraphicsManager::loadGFXMode(); //} bool GPHGraphicsManager::loadGFXMode() { @@ -531,7 +531,7 @@ bool GPHGraphicsManager::loadGFXMode() { _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; _videoMode.hardwareHeight = effectiveScreenHeight(); } - return SdlGraphicsManager::loadGFXMode(); + return SurfaceSdlGraphicsManager::loadGFXMode(); } bool GPHGraphicsManager::hasFeature(OSystem::Feature f) { @@ -576,7 +576,7 @@ void GPHGraphicsManager::warpMouse(int x, int y) { y = y / 2; } } - SdlGraphicsManager::warpMouse(x, y); + SurfaceSdlGraphicsManager::warpMouse(x, y); } void GPHGraphicsManager::adjustMouseEvent(const Common::Event &event) { diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h index fc3dc5730d..45b8618569 100644 --- a/backends/graphics/gph/gph-graphics.h +++ b/backends/graphics/gph/gph-graphics.h @@ -23,7 +23,7 @@ #ifndef BACKENDS_GRAPHICS_GPH_H #define BACKENDS_GRAPHICS_GPH_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" @@ -31,7 +31,7 @@ enum { GFX_HALF = 12 }; -class GPHGraphicsManager : public SdlGraphicsManager { +class GPHGraphicsManager : public SurfaceSdlGraphicsManager { public: GPHGraphicsManager(SdlEventSource *boss); @@ -53,8 +53,8 @@ public: void undrawMouse(); virtual void warpMouse(int x, int y); - SdlGraphicsManager::MousePos *getMouseCurState(); - SdlGraphicsManager::VideoState *getVideoMode(); + SurfaceSdlGraphicsManager::MousePos *getMouseCurState(); + SurfaceSdlGraphicsManager::VideoState *getVideoMode(); virtual void adjustMouseEvent(const Common::Event &event); }; diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index 42db89ee33..732074b7e2 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -46,7 +46,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { }; LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource) { + : SurfaceSdlGraphicsManager(sdlEventSource) { } const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const { @@ -166,7 +166,7 @@ bool LinuxmotoSdlGraphicsManager::loadGFXMode() { _videoMode.hardwareHeight = effectiveScreenHeight(); } - return SdlGraphicsManager::loadGFXMode(); + return SurfaceSdlGraphicsManager::loadGFXMode(); } void LinuxmotoSdlGraphicsManager::drawMouse() { @@ -457,7 +457,7 @@ void LinuxmotoSdlGraphicsManager::showOverlay() { _mouseCurState.x = _mouseCurState.x / 2; _mouseCurState.y = _mouseCurState.y / 2; } - SdlGraphicsManager::showOverlay(); + SurfaceSdlGraphicsManager::showOverlay(); } void LinuxmotoSdlGraphicsManager::hideOverlay() { @@ -465,7 +465,7 @@ void LinuxmotoSdlGraphicsManager::hideOverlay() { _mouseCurState.x = _mouseCurState.x * 2; _mouseCurState.y = _mouseCurState.y * 2; } - SdlGraphicsManager::hideOverlay(); + SurfaceSdlGraphicsManager::hideOverlay(); } void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) { @@ -475,7 +475,7 @@ void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) { y = y / 2; } } - SdlGraphicsManager::warpMouse(x, y); + SurfaceSdlGraphicsManager::warpMouse(x, y); } void LinuxmotoSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h index c428f00447..938512f323 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h @@ -23,9 +23,9 @@ #ifndef BACKENDS_GRAPHICS_SDL_LINUXMOTO_H #define BACKENDS_GRAPHICS_SDL_LINUXMOTO_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" -class LinuxmotoSdlGraphicsManager : public SdlGraphicsManager { +class LinuxmotoSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource); diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp index c8617635a5..5f0301a0c8 100644 --- a/backends/graphics/openpandora/op-graphics.cpp +++ b/backends/graphics/openpandora/op-graphics.cpp @@ -32,7 +32,7 @@ #include "common/textconsole.h" OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource) { + : SurfaceSdlGraphicsManager(sdlEventSource) { } bool OPGraphicsManager::loadGFXMode() { @@ -47,7 +47,7 @@ bool OPGraphicsManager::loadGFXMode() { if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) _videoMode.aspectRatioCorrection = false; - return SdlGraphicsManager::loadGFXMode(); + return SurfaceSdlGraphicsManager::loadGFXMode(); } #endif diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h index 4bb89ca1e6..ed26df7475 100644 --- a/backends/graphics/openpandora/op-graphics.h +++ b/backends/graphics/openpandora/op-graphics.h @@ -23,7 +23,7 @@ #ifndef BACKENDS_GRAPHICS_OP_H #define BACKENDS_GRAPHICS_OP_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" @@ -31,7 +31,7 @@ enum { GFX_HALF = 12 }; -class OPGraphicsManager : public SdlGraphicsManager { +class OPGraphicsManager : public SurfaceSdlGraphicsManager { public: OPGraphicsManager(SdlEventSource *sdlEventSource); @@ -53,8 +53,8 @@ public: // void undrawMouse(); // virtual void warpMouse(int x, int y); -// SdlGraphicsManager::MousePos *getMouseCurState(); -// SdlGraphicsManager::VideoState *getVideoMode(); +// SurfaceSdlGraphicsManager::MousePos *getMouseCurState(); +// SurfaceSdlGraphicsManager::VideoState *getVideoMode(); // virtual void adjustMouseEvent(const Common::Event &event); }; diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp index f6832978a8..95e0875f55 100644 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp @@ -29,7 +29,7 @@ #include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h" SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource) { + : SurfaceSdlGraphicsManager(sdlEventSource) { } bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) { @@ -41,7 +41,7 @@ bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) { void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { switch (f) { case OSystem::kFeatureAspectRatioCorrection: - SdlGraphicsManager::setFeatureState(f, enable); + SurfaceSdlGraphicsManager::setFeatureState(f, enable); break; default: break; @@ -51,7 +51,7 @@ void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enabl bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) { switch (f) { case OSystem::kFeatureAspectRatioCorrection: - return SdlGraphicsManager::getFeatureState(f); + return SurfaceSdlGraphicsManager::getFeatureState(f); default: return false; } diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h index dc65c3a696..2d0ff636f4 100644 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h @@ -25,9 +25,9 @@ #if defined(SAMSUNGTV) -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" -class SamsungTVSdlGraphicsManager : public SdlGraphicsManager { +class SamsungTVSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource); diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp deleted file mode 100644 index 257c3ea2ef..0000000000 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ /dev/null @@ -1,2321 +0,0 @@ -/* 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 "common/scummsys.h" - -#if defined(SDL_BACKEND) - -#include "backends/graphics/sdl/sdl-graphics.h" -#include "backends/events/sdl/sdl-events.h" -#include "backends/platform/sdl/sdl.h" -#include "common/config-manager.h" -#include "common/mutex.h" -#include "common/textconsole.h" -#include "common/translation.h" -#include "common/util.h" -#ifdef USE_RGB_COLOR -#include "common/list.h" -#endif -#include "graphics/font.h" -#include "graphics/fontman.h" -#include "graphics/scaler.h" -#include "graphics/scaler/aspect.h" -#include "graphics/surface.h" - -static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { - {"1x", _s("Normal (no scaling)"), GFX_NORMAL}, -#ifdef USE_SCALERS - {"2x", "2x", GFX_DOUBLESIZE}, - {"3x", "3x", GFX_TRIPLESIZE}, - {"2xsai", "2xSAI", GFX_2XSAI}, - {"super2xsai", "Super2xSAI", GFX_SUPER2XSAI}, - {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, - {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, - {"advmame3x", "AdvMAME3x", GFX_ADVMAME3X}, -#ifdef USE_HQ_SCALERS - {"hq2x", "HQ2x", GFX_HQ2X}, - {"hq3x", "HQ3x", GFX_HQ3X}, -#endif - {"tv2x", "TV2x", GFX_TV2X}, - {"dotmatrix", "DotMatrix", GFX_DOTMATRIX}, -#endif - {0, 0, 0} -}; - -DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Normal (no scaling)", "lowres") - -// Table of relative scalers magnitudes -// [definedScale - 1][scaleFactor - 1] -static ScalerProc *scalersMagn[3][3] = { -#ifdef USE_SCALERS - { Normal1x, AdvMame2x, AdvMame3x }, - { Normal1x, Normal1x, Normal1o5x }, - { Normal1x, Normal1x, Normal1x } -#else // remove dependencies on other scalers - { Normal1x, Normal1x, Normal1x }, - { Normal1x, Normal1x, Normal1x }, - { Normal1x, Normal1x, Normal1x } -#endif -}; - -static const int s_gfxModeSwitchTable[][4] = { - { GFX_NORMAL, GFX_DOUBLESIZE, GFX_TRIPLESIZE, -1 }, - { GFX_NORMAL, GFX_ADVMAME2X, GFX_ADVMAME3X, -1 }, - { GFX_NORMAL, GFX_HQ2X, GFX_HQ3X, -1 }, - { GFX_NORMAL, GFX_2XSAI, -1, -1 }, - { GFX_NORMAL, GFX_SUPER2XSAI, -1, -1 }, - { GFX_NORMAL, GFX_SUPEREAGLE, -1, -1 }, - { GFX_NORMAL, GFX_TV2X, -1, -1 }, - { GFX_NORMAL, GFX_DOTMATRIX, -1, -1 } - }; - -#ifdef USE_SCALERS -static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY); -#endif - -AspectRatio::AspectRatio(int w, int h) { - // TODO : Validation and so on... - // Currently, we just ensure the program don't instantiate non-supported aspect ratios - _kw = w; - _kh = h; -} - -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS) -static AspectRatio getDesiredAspectRatio() { - const size_t AR_COUNT = 4; - const char *desiredAspectRatioAsStrings[AR_COUNT] = { "auto", "4/3", "16/9", "16/10" }; - const AspectRatio desiredAspectRatios[AR_COUNT] = { AspectRatio(0, 0), AspectRatio(4,3), AspectRatio(16,9), AspectRatio(16,10) }; - - //TODO : We could parse an arbitrary string, if we code enough proper validation - Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio"); - - for (size_t i = 0; i < AR_COUNT; i++) { - assert(desiredAspectRatioAsStrings[i] != NULL); - - if (!scumm_stricmp(desiredAspectRatio.c_str(), desiredAspectRatioAsStrings[i])) { - return desiredAspectRatios[i]; - } - } - // TODO : Report a warning - return AspectRatio(0, 0); -} -#endif - -SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource) - : - _sdlEventSource(sdlEventSource), -#ifdef USE_OSD - _osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0), -#endif - _hwscreen(0), _screen(0), _tmpscreen(0), -#ifdef USE_RGB_COLOR - _screenFormat(Graphics::PixelFormat::createFormatCLUT8()), - _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()), -#endif - _overlayVisible(false), - _overlayscreen(0), _tmpscreen2(0), - _scalerProc(0), _screenChangeCount(0), - _mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0), - _mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true), - _currentShakePos(0), _newShakePos(0), - _paletteDirtyStart(0), _paletteDirtyEnd(0), - _screenIsLocked(false), - _graphicsMutex(0), -#ifdef USE_SDL_DEBUG_FOCUSRECT - _enableFocusRectDebugCode(false), _enableFocusRect(false), _focusRect(), -#endif - _transactionMode(kTransactionNone) { - - if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) { - error("Could not initialize SDL: %s", SDL_GetError()); - } - - // This is also called in initSDL(), but initializing graphics - // may reset it. - SDL_EnableUNICODE(1); - - // allocate palette storage - _currentPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256); - _cursorPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256); - - _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0; - - memset(&_mouseCurState, 0, sizeof(_mouseCurState)); - - _graphicsMutex = g_system->createMutex(); - -#ifdef USE_SDL_DEBUG_FOCUSRECT - if (ConfMan.hasKey("use_sdl_debug_focusrect")) - _enableFocusRectDebugCode = ConfMan.getBool("use_sdl_debug_focusrect"); -#endif - - SDL_ShowCursor(SDL_DISABLE); - - memset(&_oldVideoMode, 0, sizeof(_oldVideoMode)); - memset(&_videoMode, 0, sizeof(_videoMode)); - memset(&_transactionDetails, 0, sizeof(_transactionDetails)); - -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS) - _videoMode.mode = GFX_DOUBLESIZE; - _videoMode.scaleFactor = 2; - _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); - _videoMode.desiredAspectRatio = getDesiredAspectRatio(); - _scalerProc = Normal2x; -#else // for small screen platforms - _videoMode.mode = GFX_NORMAL; - _videoMode.scaleFactor = 1; - _videoMode.aspectRatioCorrection = false; - _scalerProc = Normal1x; -#endif - _scalerType = 0; - -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) - _videoMode.fullscreen = ConfMan.getBool("fullscreen"); -#else - _videoMode.fullscreen = true; -#endif -} - -SdlGraphicsManager::~SdlGraphicsManager() { - // Unregister the event observer - if (g_system->getEventManager()->getEventDispatcher() != NULL) - g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this); - - unloadGFXMode(); - if (_mouseSurface) - SDL_FreeSurface(_mouseSurface); - _mouseSurface = 0; - if (_mouseOrigSurface) - SDL_FreeSurface(_mouseOrigSurface); - _mouseOrigSurface = 0; - g_system->deleteMutex(_graphicsMutex); - - free(_currentPalette); - free(_cursorPalette); - free(_mouseData); -} - -void SdlGraphicsManager::initEventObserver() { - // Register the graphics manager as a event observer - g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false); -} - -bool SdlGraphicsManager::hasFeature(OSystem::Feature f) { - return - (f == OSystem::kFeatureFullscreenMode) || - (f == OSystem::kFeatureAspectRatioCorrection) || - (f == OSystem::kFeatureCursorPalette) || - (f == OSystem::kFeatureIconifyWindow); -} - -void SdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { - switch (f) { - case OSystem::kFeatureFullscreenMode: - setFullscreenMode(enable); - break; - case OSystem::kFeatureAspectRatioCorrection: - setAspectRatioCorrection(enable); - break; - case OSystem::kFeatureCursorPalette: - _cursorPaletteDisabled = !enable; - blitCursor(); - break; - case OSystem::kFeatureIconifyWindow: - if (enable) - SDL_WM_IconifyWindow(); - break; - default: - break; - } -} - -bool SdlGraphicsManager::getFeatureState(OSystem::Feature f) { - assert(_transactionMode == kTransactionNone); - - switch (f) { - case OSystem::kFeatureFullscreenMode: - return _videoMode.fullscreen; - case OSystem::kFeatureAspectRatioCorrection: - return _videoMode.aspectRatioCorrection; - case OSystem::kFeatureCursorPalette: - return !_cursorPaletteDisabled; - default: - return false; - } -} - -const OSystem::GraphicsMode *SdlGraphicsManager::supportedGraphicsModes() { - return s_supportedGraphicsModes; -} - -const OSystem::GraphicsMode *SdlGraphicsManager::getSupportedGraphicsModes() const { - return s_supportedGraphicsModes; -} - -int SdlGraphicsManager::getDefaultGraphicsMode() const { - return GFX_DOUBLESIZE; -} - -void SdlGraphicsManager::resetGraphicsScale() { - setGraphicsMode(s_gfxModeSwitchTable[_scalerType][0]); -} - -void SdlGraphicsManager::beginGFXTransaction() { - assert(_transactionMode == kTransactionNone); - - _transactionMode = kTransactionActive; - - _transactionDetails.sizeChanged = false; - - _transactionDetails.needHotswap = false; - _transactionDetails.needUpdatescreen = false; - - _transactionDetails.normal1xScaler = false; -#ifdef USE_RGB_COLOR - _transactionDetails.formatChanged = false; -#endif - - _oldVideoMode = _videoMode; -} - -OSystem::TransactionError SdlGraphicsManager::endGFXTransaction() { - int errors = OSystem::kTransactionSuccess; - - assert(_transactionMode != kTransactionNone); - - if (_transactionMode == kTransactionRollback) { - if (_videoMode.fullscreen != _oldVideoMode.fullscreen) { - errors |= OSystem::kTransactionFullscreenFailed; - - _videoMode.fullscreen = _oldVideoMode.fullscreen; - } else if (_videoMode.aspectRatioCorrection != _oldVideoMode.aspectRatioCorrection) { - errors |= OSystem::kTransactionAspectRatioFailed; - - _videoMode.aspectRatioCorrection = _oldVideoMode.aspectRatioCorrection; - } else if (_videoMode.mode != _oldVideoMode.mode) { - errors |= OSystem::kTransactionModeSwitchFailed; - - _videoMode.mode = _oldVideoMode.mode; - _videoMode.scaleFactor = _oldVideoMode.scaleFactor; -#ifdef USE_RGB_COLOR - } else if (_videoMode.format != _oldVideoMode.format) { - errors |= OSystem::kTransactionFormatNotSupported; - - _videoMode.format = _oldVideoMode.format; - _screenFormat = _videoMode.format; -#endif - } else if (_videoMode.screenWidth != _oldVideoMode.screenWidth || _videoMode.screenHeight != _oldVideoMode.screenHeight) { - errors |= OSystem::kTransactionSizeChangeFailed; - - _videoMode.screenWidth = _oldVideoMode.screenWidth; - _videoMode.screenHeight = _oldVideoMode.screenHeight; - _videoMode.overlayWidth = _oldVideoMode.overlayWidth; - _videoMode.overlayHeight = _oldVideoMode.overlayHeight; - } - - if (_videoMode.fullscreen == _oldVideoMode.fullscreen && - _videoMode.aspectRatioCorrection == _oldVideoMode.aspectRatioCorrection && - _videoMode.mode == _oldVideoMode.mode && - _videoMode.screenWidth == _oldVideoMode.screenWidth && - _videoMode.screenHeight == _oldVideoMode.screenHeight) { - - // Our new video mode would now be exactly the same as the - // old one. Since we still can not assume SDL_SetVideoMode - // to be working fine, we need to invalidate the old video - // mode, so loadGFXMode would error out properly. - _oldVideoMode.setup = false; - } - } - -#ifdef USE_RGB_COLOR - if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) { -#else - if (_transactionDetails.sizeChanged) { -#endif - unloadGFXMode(); - if (!loadGFXMode()) { - if (_oldVideoMode.setup) { - _transactionMode = kTransactionRollback; - errors |= endGFXTransaction(); - } - } else { - setGraphicsModeIntern(); - clearOverlay(); - - _videoMode.setup = true; - // OSystem_SDL::pollEvent used to update the screen change count, - // but actually it gives problems when a video mode was changed - // but OSystem_SDL::pollEvent was not called. This for example - // caused a crash under certain circumstances when doing an RTL. - // To fix this issue we update the screen change count right here. - _screenChangeCount++; - } - } else if (_transactionDetails.needHotswap) { - setGraphicsModeIntern(); - if (!hotswapGFXMode()) { - if (_oldVideoMode.setup) { - _transactionMode = kTransactionRollback; - errors |= endGFXTransaction(); - } - } else { - _videoMode.setup = true; - // OSystem_SDL::pollEvent used to update the screen change count, - // but actually it gives problems when a video mode was changed - // but OSystem_SDL::pollEvent was not called. This for example - // caused a crash under certain circumstances when doing an RTL. - // To fix this issue we update the screen change count right here. - _screenChangeCount++; - - if (_transactionDetails.needUpdatescreen) - internUpdateScreen(); - } - } else if (_transactionDetails.needUpdatescreen) { - setGraphicsModeIntern(); - internUpdateScreen(); - } - - _transactionMode = kTransactionNone; - return (OSystem::TransactionError)errors; -} - -#ifdef USE_RGB_COLOR -Common::List SdlGraphicsManager::getSupportedFormats() const { - assert(!_supportedFormats.empty()); - return _supportedFormats; -} - -void SdlGraphicsManager::detectSupportedFormats() { - - // Clear old list - _supportedFormats.clear(); - - // Some tables with standard formats that we always list - // as "supported". If frontend code tries to use one of - // these, we will perform the necessary format - // conversion in the background. Of course this incurs a - // performance hit, but on desktop ports this should not - // matter. We still push the currently active format to - // the front, so if frontend code just uses the first - // available format, it will get one that is "cheap" to - // use. - const Graphics::PixelFormat RGBList[] = { -#ifdef USE_RGB_COLOR - // RGBA8888, ARGB8888, RGB888 - Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), - Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), - Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), -#endif - // RGB565, XRGB1555, RGB555, RGBA4444, ARGB4444 - Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), - Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15), - Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), - Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), - Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) - }; - const Graphics::PixelFormat BGRList[] = { -#ifdef USE_RGB_COLOR - // ABGR8888, BGRA8888, BGR888 - Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), - Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0), - Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0), -#endif - // BGR565, XBGR1555, BGR555, ABGR4444, BGRA4444 - Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0), - Graphics::PixelFormat(2, 5, 5, 5, 1, 0, 5, 10, 15), - Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0), - Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12), - Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0) - }; - - Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8(); - if (_hwscreen) { - // Get our currently set hardware format - format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel, - 8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss, - 8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss, - _hwscreen->format->Rshift, _hwscreen->format->Gshift, - _hwscreen->format->Bshift, _hwscreen->format->Ashift); - - // Workaround to MacOSX SDL not providing an accurate Aloss value. - if (_hwscreen->format->Amask == 0) - format.aLoss = 8; - - // Push it first, as the prefered format. - _supportedFormats.push_back(format); - } - - // TODO: prioritize matching alpha masks - int i; - - // Push some RGB formats - for (i = 0; i < ARRAYSIZE(RGBList); i++) { - if (_hwscreen && (RGBList[i].bytesPerPixel > format.bytesPerPixel)) - continue; - if (RGBList[i] != format) - _supportedFormats.push_back(RGBList[i]); - } - - // Push some BGR formats - for (i = 0; i < ARRAYSIZE(BGRList); i++) { - if (_hwscreen && (BGRList[i].bytesPerPixel > format.bytesPerPixel)) - continue; - if (BGRList[i] != format) - _supportedFormats.push_back(BGRList[i]); - } - - // Finally, we always supposed 8 bit palette graphics - _supportedFormats.push_back(Graphics::PixelFormat::createFormatCLUT8()); -} -#endif - -bool SdlGraphicsManager::setGraphicsMode(int mode) { - Common::StackLock lock(_graphicsMutex); - - assert(_transactionMode == kTransactionActive); - - if (_oldVideoMode.setup && _oldVideoMode.mode == mode) - return true; - - int newScaleFactor = 1; - - switch (mode) { - case GFX_NORMAL: - newScaleFactor = 1; - break; -#ifdef USE_SCALERS - case GFX_DOUBLESIZE: - newScaleFactor = 2; - break; - case GFX_TRIPLESIZE: - newScaleFactor = 3; - break; - - case GFX_2XSAI: - newScaleFactor = 2; - break; - case GFX_SUPER2XSAI: - newScaleFactor = 2; - break; - case GFX_SUPEREAGLE: - newScaleFactor = 2; - break; - case GFX_ADVMAME2X: - newScaleFactor = 2; - break; - case GFX_ADVMAME3X: - newScaleFactor = 3; - break; -#ifdef USE_HQ_SCALERS - case GFX_HQ2X: - newScaleFactor = 2; - break; - case GFX_HQ3X: - newScaleFactor = 3; - break; -#endif - case GFX_TV2X: - newScaleFactor = 2; - break; - case GFX_DOTMATRIX: - newScaleFactor = 2; - break; -#endif // USE_SCALERS - - default: - warning("unknown gfx mode %d", mode); - return false; - } - - _transactionDetails.normal1xScaler = (mode == GFX_NORMAL); - if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor) - _transactionDetails.needHotswap = true; - - _transactionDetails.needUpdatescreen = true; - - _videoMode.mode = mode; - _videoMode.scaleFactor = newScaleFactor; - - return true; -} - -void SdlGraphicsManager::setGraphicsModeIntern() { - Common::StackLock lock(_graphicsMutex); - ScalerProc *newScalerProc = 0; - - switch (_videoMode.mode) { - case GFX_NORMAL: - newScalerProc = Normal1x; - break; -#ifdef USE_SCALERS - case GFX_DOUBLESIZE: - newScalerProc = Normal2x; - break; - case GFX_TRIPLESIZE: - newScalerProc = Normal3x; - break; - - case GFX_2XSAI: - newScalerProc = _2xSaI; - break; - case GFX_SUPER2XSAI: - newScalerProc = Super2xSaI; - break; - case GFX_SUPEREAGLE: - newScalerProc = SuperEagle; - break; - case GFX_ADVMAME2X: - newScalerProc = AdvMame2x; - break; - case GFX_ADVMAME3X: - newScalerProc = AdvMame3x; - break; -#ifdef USE_HQ_SCALERS - case GFX_HQ2X: - newScalerProc = HQ2x; - break; - case GFX_HQ3X: - newScalerProc = HQ3x; - break; -#endif - case GFX_TV2X: - newScalerProc = TV2x; - break; - case GFX_DOTMATRIX: - newScalerProc = DotMatrix; - break; -#endif // USE_SCALERS - - default: - error("Unknown gfx mode %d", _videoMode.mode); - } - - _scalerProc = newScalerProc; - - if (_videoMode.mode != GFX_NORMAL) { - for (int i = 0; i < ARRAYSIZE(s_gfxModeSwitchTable); i++) { - if (s_gfxModeSwitchTable[i][1] == _videoMode.mode || s_gfxModeSwitchTable[i][2] == _videoMode.mode) { - _scalerType = i; - break; - } - } - } - - if (!_screen || !_hwscreen) - return; - - // Blit everything to the screen - _forceFull = true; - - // Even if the old and new scale factors are the same, we may have a - // different scaler for the cursor now. - blitCursor(); -} - -int SdlGraphicsManager::getGraphicsMode() const { - assert(_transactionMode == kTransactionNone); - return _videoMode.mode; -} - -void SdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) { - assert(_transactionMode == kTransactionActive); - -#ifdef USE_RGB_COLOR - //avoid redundant format changes - Graphics::PixelFormat newFormat; - if (!format) - newFormat = Graphics::PixelFormat::createFormatCLUT8(); - else - newFormat = *format; - - assert(newFormat.bytesPerPixel > 0); - - if (newFormat != _videoMode.format) { - _videoMode.format = newFormat; - _transactionDetails.formatChanged = true; - _screenFormat = newFormat; - } -#endif - - // Avoid redundant res changes - if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) - return; - - _videoMode.screenWidth = w; - _videoMode.screenHeight = h; - - _transactionDetails.sizeChanged = true; -} - -int SdlGraphicsManager::effectiveScreenHeight() const { - return _videoMode.scaleFactor * - (_videoMode.aspectRatioCorrection - ? real2Aspect(_videoMode.screenHeight) - : _videoMode.screenHeight); -} - -static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &width, int &height) { - assert(&width != &height); - - if (desiredAspectRatio.isAuto()) - return; - - int kw = desiredAspectRatio.kw(); - int kh = desiredAspectRatio.kh(); - - const int w = width; - const int h = height; - - SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_SWSURFACE); //TODO : Maybe specify a pixel format - assert(availableModes); - - const SDL_Rect *bestMode = NULL; - uint bestMetric = (uint)-1; // Metric is wasted space - while (const SDL_Rect *mode = *availableModes++) { - if (mode->w < w) - continue; - if (mode->h < h) - continue; - if (mode->h * kw != mode->w * kh) - continue; - - uint metric = mode->w * mode->h - w * h; - if (metric > bestMetric) - continue; - - bestMetric = metric; - bestMode = mode; - } - - if (!bestMode) { - warning("Unable to enforce the desired aspect ratio"); - return; - } - width = bestMode->w; - height = bestMode->h; -} - -bool SdlGraphicsManager::loadGFXMode() { - _forceFull = true; - -#if !defined(__MAEMO__) && !defined(DINGUX) && !defined(GPH_DEVICE) && !defined(LINUXMOTO) && !defined(OPENPANDORA) - _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; - _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; - - if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) - _videoMode.aspectRatioCorrection = false; - - if (_videoMode.aspectRatioCorrection) - _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); - - _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; - _videoMode.hardwareHeight = effectiveScreenHeight(); -#else - _videoMode.hardwareWidth = _videoMode.overlayWidth; - _videoMode.hardwareHeight = _videoMode.overlayHeight; -#endif - - // - // Create the surface that contains the 8 bit game data - // -#ifdef USE_RGB_COLOR - _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, - _screenFormat.bytesPerPixel << 3, - ((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift , - ((1 << _screenFormat.gBits()) - 1) << _screenFormat.gShift , - ((1 << _screenFormat.bBits()) - 1) << _screenFormat.bShift , - ((1 << _screenFormat.aBits()) - 1) << _screenFormat.aShift ); - if (_screen == NULL) - error("allocating _screen failed"); - -#else - _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0); - if (_screen == NULL) - error("allocating _screen failed"); -#endif - - // - // Create the surface that contains the scaled graphics in 16 bit mode - // - - if (_videoMode.fullscreen) { - fixupResolutionForAspectRatio(_videoMode.desiredAspectRatio, _videoMode.hardwareWidth, _videoMode.hardwareHeight); - } - - _hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16, - _videoMode.fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE - ); -#ifdef USE_RGB_COLOR - detectSupportedFormats(); -#endif - - if (_hwscreen == NULL) { - // DON'T use error(), as this tries to bring up the debug - // console, which WON'T WORK now that _hwscreen is hosed. - - if (!_oldVideoMode.setup) { - warning("SDL_SetVideoMode says we can't switch to that mode (%s)", SDL_GetError()); - g_system->quit(); - } else { - return false; - } - } - - // - // Create the surface used for the graphics in 16 bit before scaling, and also the overlay - // - - // Need some extra bytes around when using 2xSaI - _tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth + 3, _videoMode.screenHeight + 3, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - - if (_tmpscreen == NULL) - error("allocating _tmpscreen failed"); - - _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth, _videoMode.overlayHeight, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - - if (_overlayscreen == NULL) - error("allocating _overlayscreen failed"); - - _overlayFormat.bytesPerPixel = _overlayscreen->format->BytesPerPixel; - - _overlayFormat.rLoss = _overlayscreen->format->Rloss; - _overlayFormat.gLoss = _overlayscreen->format->Gloss; - _overlayFormat.bLoss = _overlayscreen->format->Bloss; - _overlayFormat.aLoss = _overlayscreen->format->Aloss; - - _overlayFormat.rShift = _overlayscreen->format->Rshift; - _overlayFormat.gShift = _overlayscreen->format->Gshift; - _overlayFormat.bShift = _overlayscreen->format->Bshift; - _overlayFormat.aShift = _overlayscreen->format->Ashift; - - _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth + 3, _videoMode.overlayHeight + 3, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - - if (_tmpscreen2 == NULL) - error("allocating _tmpscreen2 failed"); - -#ifdef USE_OSD - _osdSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, - _hwscreen->w, - _hwscreen->h, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - if (_osdSurface == NULL) - error("allocating _osdSurface failed"); - SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey); -#endif - - _sdlEventSource->resetKeyboadEmulation( - _videoMode.screenWidth * _videoMode.scaleFactor - 1, - effectiveScreenHeight() - 1); - - // Distinguish 555 and 565 mode - if (_hwscreen->format->Rmask == 0x7C00) - InitScalers(555); - else - InitScalers(565); - - return true; -} - -void SdlGraphicsManager::unloadGFXMode() { - if (_screen) { - SDL_FreeSurface(_screen); - _screen = NULL; - } - - if (_hwscreen) { - SDL_FreeSurface(_hwscreen); - _hwscreen = NULL; - } - - if (_tmpscreen) { - SDL_FreeSurface(_tmpscreen); - _tmpscreen = NULL; - } - - if (_tmpscreen2) { - SDL_FreeSurface(_tmpscreen2); - _tmpscreen2 = NULL; - } - - if (_overlayscreen) { - SDL_FreeSurface(_overlayscreen); - _overlayscreen = NULL; - } - -#ifdef USE_OSD - if (_osdSurface) { - SDL_FreeSurface(_osdSurface); - _osdSurface = NULL; - } -#endif - DestroyScalers(); -} - -bool SdlGraphicsManager::hotswapGFXMode() { - if (!_screen) - return false; - - // Keep around the old _screen & _overlayscreen so we can restore the screen data - // after the mode switch. - SDL_Surface *old_screen = _screen; - _screen = NULL; - SDL_Surface *old_overlayscreen = _overlayscreen; - _overlayscreen = NULL; - - // Release the HW screen surface - SDL_FreeSurface(_hwscreen); _hwscreen = NULL; - - SDL_FreeSurface(_tmpscreen); _tmpscreen = NULL; - SDL_FreeSurface(_tmpscreen2); _tmpscreen2 = NULL; - -#ifdef USE_OSD - // Release the OSD surface - SDL_FreeSurface(_osdSurface); _osdSurface = NULL; -#endif - - // Setup the new GFX mode - if (!loadGFXMode()) { - unloadGFXMode(); - - _screen = old_screen; - _overlayscreen = old_overlayscreen; - - return false; - } - - // reset palette - SDL_SetColors(_screen, _currentPalette, 0, 256); - - // Restore old screen content - SDL_BlitSurface(old_screen, NULL, _screen, NULL); - SDL_BlitSurface(old_overlayscreen, NULL, _overlayscreen, NULL); - - // Free the old surfaces - SDL_FreeSurface(old_screen); - SDL_FreeSurface(old_overlayscreen); - - // Update cursor to new scale - blitCursor(); - - // Blit everything to the screen - internUpdateScreen(); - - return true; -} - -void SdlGraphicsManager::updateScreen() { - assert(_transactionMode == kTransactionNone); - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - internUpdateScreen(); -} - -void SdlGraphicsManager::internUpdateScreen() { - SDL_Surface *srcSurf, *origSurf; - int height, width; - ScalerProc *scalerProc; - int scale1; - - // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?) -#if defined (DEBUG) && !defined(WIN32) && !defined(_WIN32_WCE) - assert(_hwscreen != NULL); - assert(_hwscreen->map->sw_data != NULL); -#endif - - // If the shake position changed, fill the dirty area with blackness - if (_currentShakePos != _newShakePos || - (_mouseNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { - SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor}; - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - blackrect.h = real2Aspect(blackrect.h - 1) + 1; - - SDL_FillRect(_hwscreen, &blackrect, 0); - - _currentShakePos = _newShakePos; - - _forceFull = true; - } - - // Check whether the palette was changed in the meantime and update the - // screen surface accordingly. - if (_screen && _paletteDirtyEnd != 0) { - SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart, - _paletteDirtyStart, - _paletteDirtyEnd - _paletteDirtyStart); - - _paletteDirtyEnd = 0; - - _forceFull = true; - } - -#ifdef USE_OSD - // OSD visible (i.e. non-transparent)? - if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { - // Updated alpha value - const int diff = SDL_GetTicks() - _osdFadeStartTime; - if (diff > 0) { - if (diff >= kOSDFadeOutDuration) { - // Back to full transparency - _osdAlpha = SDL_ALPHA_TRANSPARENT; - } else { - // Do a linear fade out... - const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100; - _osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; - } - SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha); - _forceFull = true; - } - } -#endif - - if (!_overlayVisible) { - origSurf = _screen; - srcSurf = _tmpscreen; - width = _videoMode.screenWidth; - height = _videoMode.screenHeight; - scalerProc = _scalerProc; - scale1 = _videoMode.scaleFactor; - } else { - origSurf = _overlayscreen; - srcSurf = _tmpscreen2; - width = _videoMode.overlayWidth; - height = _videoMode.overlayHeight; - scalerProc = Normal1x; - - scale1 = 1; - } - - // Add the area covered by the mouse cursor to the list of dirty rects if - // we have to redraw the mouse. - if (_mouseNeedsRedraw) - undrawMouse(); - - // Force a full redraw if requested - if (_forceFull) { - _numDirtyRects = 1; - _dirtyRectList[0].x = 0; - _dirtyRectList[0].y = 0; - _dirtyRectList[0].w = width; - _dirtyRectList[0].h = height; - } - - // Only draw anything if necessary - if (_numDirtyRects > 0 || _mouseNeedsRedraw) { - SDL_Rect *r; - SDL_Rect dst; - uint32 srcPitch, dstPitch; - SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects; - - for (r = _dirtyRectList; r != lastRect; ++r) { - dst = *r; - dst.x++; // Shift rect by one since 2xSai needs to access the data around - dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. - - if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - } - - SDL_LockSurface(srcSurf); - SDL_LockSurface(_hwscreen); - - srcPitch = srcSurf->pitch; - dstPitch = _hwscreen->pitch; - - for (r = _dirtyRectList; r != lastRect; ++r) { - register int dst_y = r->y + _currentShakePos; - register int dst_h = 0; - register int orig_dst_y = 0; - register int rx1 = r->x * scale1; - - if (dst_y < height) { - dst_h = r->h; - if (dst_h > height - dst_y) - dst_h = height - dst_y; - - orig_dst_y = dst_y; - dst_y = dst_y * scale1; - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - dst_y = real2Aspect(dst_y); - - assert(scalerProc != NULL); - scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, - (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); - } - - r->x = rx1; - r->y = dst_y; - r->w = r->w * scale1; - r->h = dst_h * scale1; - -#ifdef USE_SCALERS - if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible) - r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); -#endif - } - SDL_UnlockSurface(srcSurf); - SDL_UnlockSurface(_hwscreen); - - // Readjust the dirty rect list in case we are doing a full update. - // This is necessary if shaking is active. - if (_forceFull) { - _dirtyRectList[0].y = 0; - _dirtyRectList[0].h = effectiveScreenHeight(); - } - - drawMouse(); - -#ifdef USE_OSD - if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { - SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0); - } -#endif - -#ifdef USE_SDL_DEBUG_FOCUSRECT - // We draw the focus rectangle on top of everything, to assure it's easily visible. - // Of course when the overlay is visible we do not show it, since it is only for game - // specific focus. - if (_enableFocusRect && !_overlayVisible) { - int y = _focusRect.top + _currentShakePos; - int h = 0; - int x = _focusRect.left * scale1; - int w = _focusRect.width() * scale1; - - if (y < height) { - h = _focusRect.height(); - if (h > height - y) - h = height - y; - - y *= scale1; - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - y = real2Aspect(y); - - if (h > 0 && w > 0) { - SDL_LockSurface(_hwscreen); - - // Use white as color for now. - Uint32 rectColor = SDL_MapRGB(_hwscreen->format, 0xFF, 0xFF, 0xFF); - - // First draw the top and bottom lines - // then draw the left and right lines - if (_hwscreen->format->BytesPerPixel == 2) { - uint16 *top = (uint16 *)((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 2); - uint16 *bottom = (uint16 *)((byte *)_hwscreen->pixels + (y + h) * _hwscreen->pitch + x * 2); - byte *left = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 2); - byte *right = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + (x + w - 1) * 2); - - while (w--) { - *top++ = rectColor; - *bottom++ = rectColor; - } - - while (h--) { - *(uint16 *)left = rectColor; - *(uint16 *)right = rectColor; - - left += _hwscreen->pitch; - right += _hwscreen->pitch; - } - } else if (_hwscreen->format->BytesPerPixel == 4) { - uint32 *top = (uint32 *)((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 4); - uint32 *bottom = (uint32 *)((byte *)_hwscreen->pixels + (y + h) * _hwscreen->pitch + x * 4); - byte *left = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 4); - byte *right = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + (x + w - 1) * 4); - - while (w--) { - *top++ = rectColor; - *bottom++ = rectColor; - } - - while (h--) { - *(uint32 *)left = rectColor; - *(uint32 *)right = rectColor; - - left += _hwscreen->pitch; - right += _hwscreen->pitch; - } - } - - SDL_UnlockSurface(_hwscreen); - } - } - } -#endif - - // Finally, blit all our changes to the screen - SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList); - } - - _numDirtyRects = 0; - _forceFull = false; - _mouseNeedsRedraw = false; -} - -bool SdlGraphicsManager::saveScreenshot(const char *filename) { - assert(_hwscreen != NULL); - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - return SDL_SaveBMP(_hwscreen, filename) == 0; -} - -void SdlGraphicsManager::setFullscreenMode(bool enable) { - Common::StackLock lock(_graphicsMutex); - - if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable) - return; - - if (_transactionMode == kTransactionActive) { - _videoMode.fullscreen = enable; - _transactionDetails.needHotswap = true; - } -} - -void SdlGraphicsManager::setAspectRatioCorrection(bool enable) { - Common::StackLock lock(_graphicsMutex); - - if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable) - return; - - if (_transactionMode == kTransactionActive) { - _videoMode.aspectRatioCorrection = enable; - _transactionDetails.needHotswap = true; - } -} - -void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) { - assert(_transactionMode == kTransactionNone); - assert(src); - - if (_screen == NULL) { - warning("SdlGraphicsManager::copyRectToScreen: _screen == NULL"); - return; - } - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - assert(x >= 0 && x < _videoMode.screenWidth); - assert(y >= 0 && y < _videoMode.screenHeight); - assert(h > 0 && y + h <= _videoMode.screenHeight); - assert(w > 0 && x + w <= _videoMode.screenWidth); - - addDirtyRect(x, y, w, h); - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - -#ifdef USE_RGB_COLOR - byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x * _screenFormat.bytesPerPixel; - if (_videoMode.screenWidth == w && pitch == _screen->pitch) { - memcpy(dst, src, h*pitch); - } else { - do { - memcpy(dst, src, w * _screenFormat.bytesPerPixel); - src += pitch; - dst += _screen->pitch; - } while (--h); - } -#else - byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x; - if (_screen->pitch == pitch && pitch == w) { - memcpy(dst, src, h*w); - } else { - do { - memcpy(dst, src, w); - src += pitch; - dst += _screen->pitch; - } while (--h); - } -#endif - - // Unlock the screen surface - SDL_UnlockSurface(_screen); -} - -Graphics::Surface *SdlGraphicsManager::lockScreen() { - assert(_transactionMode == kTransactionNone); - - // Lock the graphics mutex - g_system->lockMutex(_graphicsMutex); - - // paranoia check - assert(!_screenIsLocked); - _screenIsLocked = true; - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - _framebuffer.pixels = _screen->pixels; - _framebuffer.w = _screen->w; - _framebuffer.h = _screen->h; - _framebuffer.pitch = _screen->pitch; -#ifdef USE_RGB_COLOR - _framebuffer.format = _screenFormat; -#else - _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); -#endif - - return &_framebuffer; -} - -void SdlGraphicsManager::unlockScreen() { - assert(_transactionMode == kTransactionNone); - - // paranoia check - assert(_screenIsLocked); - _screenIsLocked = false; - - // Unlock the screen surface - SDL_UnlockSurface(_screen); - - // Trigger a full screen update - _forceFull = true; - - // Finally unlock the graphics mutex - g_system->unlockMutex(_graphicsMutex); -} - -void SdlGraphicsManager::fillScreen(uint32 col) { - Graphics::Surface *screen = lockScreen(); - if (screen && screen->pixels) - memset(screen->pixels, col, screen->h * screen->pitch); - unlockScreen(); -} - -void SdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) { - if (_forceFull) - return; - - if (_numDirtyRects == NUM_DIRTY_RECT) { - _forceFull = true; - return; - } - - int height, width; - - if (!_overlayVisible && !realCoordinates) { - width = _videoMode.screenWidth; - height = _videoMode.screenHeight; - } else { - width = _videoMode.overlayWidth; - height = _videoMode.overlayHeight; - } - - // Extend the dirty region by 1 pixel for scalers - // that "smear" the screen, e.g. 2xSAI - if (!realCoordinates) { - x--; - y--; - w+=2; - h+=2; - } - - // clip - if (x < 0) { - w += x; - x = 0; - } - - if (y < 0) { - h += y; - y=0; - } - - if (w > width - x) { - w = width - x; - } - - if (h > height - y) { - h = height - y; - } - -#ifdef USE_SCALERS - if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) { - makeRectStretchable(x, y, w, h); - } -#endif - - if (w == width && h == height) { - _forceFull = true; - return; - } - - if (w > 0 && h > 0) { - SDL_Rect *r = &_dirtyRectList[_numDirtyRects++]; - - r->x = x; - r->y = y; - r->w = w; - r->h = h; - } -} - -int16 SdlGraphicsManager::getHeight() { - return _videoMode.screenHeight; -} - -int16 SdlGraphicsManager::getWidth() { - return _videoMode.screenWidth; -} - -void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) { - assert(colors); - -#ifdef USE_RGB_COLOR - assert(_screenFormat.bytesPerPixel == 1); -#endif - - // Setting the palette before _screen is created is allowed - for now - - // since we don't actually set the palette until the screen is updated. - // But it could indicate a programming error, so let's warn about it. - - if (!_screen) - warning("SdlGraphicsManager::setPalette: _screen == NULL"); - - const byte *b = colors; - uint i; - SDL_Color *base = _currentPalette + start; - for (i = 0; i < num; i++, b += 3) { - base[i].r = b[0]; - base[i].g = b[1]; - base[i].b = b[2]; - } - - if (start < _paletteDirtyStart) - _paletteDirtyStart = start; - - if (start + num > _paletteDirtyEnd) - _paletteDirtyEnd = start + num; - - // Some games blink cursors with palette - if (_cursorPaletteDisabled) - blitCursor(); -} - -void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) { - assert(colors); - -#ifdef USE_RGB_COLOR - assert(_screenFormat.bytesPerPixel == 1); -#endif - - const SDL_Color *base = _currentPalette + start; - - for (uint i = 0; i < num; ++i) { - colors[i * 3] = base[i].r; - colors[i * 3 + 1] = base[i].g; - colors[i * 3 + 2] = base[i].b; - } -} - -void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) { - assert(colors); - const byte *b = colors; - uint i; - SDL_Color *base = _cursorPalette + start; - for (i = 0; i < num; i++, b += 3) { - base[i].r = b[0]; - base[i].g = b[1]; - base[i].b = b[2]; - } - - _cursorPaletteDisabled = false; - blitCursor(); -} - -void SdlGraphicsManager::setShakePos(int shake_pos) { - assert(_transactionMode == kTransactionNone); - - _newShakePos = shake_pos; -} - -void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) { -#ifdef USE_SDL_DEBUG_FOCUSRECT - // Only enable focus rectangle debug code, when the user wants it - if (!_enableFocusRectDebugCode) - return; - - _enableFocusRect = true; - _focusRect = rect; - - if (rect.left < 0 || rect.top < 0 || rect.right > _videoMode.screenWidth || rect.bottom > _videoMode.screenHeight) - warning("SdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom); - - // It's gross but we actually sometimes get rects, which are not inside the screen bounds, - // thus we need to clip the rect here... - _focusRect.clip(_videoMode.screenWidth, _videoMode.screenHeight); - - // We just fake this as a dirty rect for now, to easily force an screen update whenever - // the rect changes. - addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height()); -#endif -} - -void SdlGraphicsManager::clearFocusRectangle() { -#ifdef USE_SDL_DEBUG_FOCUSRECT - // Only enable focus rectangle debug code, when the user wants it - if (!_enableFocusRectDebugCode) - return; - - _enableFocusRect = false; - - // We just fake this as a dirty rect for now, to easily force an screen update whenever - // the rect changes. - addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height()); -#endif -} - -#pragma mark - -#pragma mark --- Overlays --- -#pragma mark - - -void SdlGraphicsManager::showOverlay() { - assert(_transactionMode == kTransactionNone); - - int x, y; - - if (_overlayVisible) - return; - - _overlayVisible = true; - - // Since resolution could change, put mouse to adjusted position - // Fixes bug #1349059 - x = _mouseCurState.x * _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - y = real2Aspect(_mouseCurState.y) * _videoMode.scaleFactor; - else - y = _mouseCurState.y * _videoMode.scaleFactor; - - warpMouse(x, y); - - clearOverlay(); -} - -void SdlGraphicsManager::hideOverlay() { - assert(_transactionMode == kTransactionNone); - - if (!_overlayVisible) - return; - - int x, y; - - _overlayVisible = false; - - // Since resolution could change, put mouse to adjusted position - // Fixes bug #1349059 - x = _mouseCurState.x / _videoMode.scaleFactor; - y = _mouseCurState.y / _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - y = aspect2Real(y); - - warpMouse(x, y); - - clearOverlay(); - - _forceFull = true; -} - -void SdlGraphicsManager::clearOverlay() { - //assert(_transactionMode == kTransactionNone); - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - if (!_overlayVisible) - return; - - // Clear the overlay by making the game screen "look through" everywhere. - SDL_Rect src, dst; - src.x = src.y = 0; - dst.x = dst.y = 1; - src.w = dst.w = _videoMode.screenWidth; - src.h = dst.h = _videoMode.screenHeight; - if (SDL_BlitSurface(_screen, &src, _tmpscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - - SDL_LockSurface(_tmpscreen); - SDL_LockSurface(_overlayscreen); - _scalerProc((byte *)(_tmpscreen->pixels) + _tmpscreen->pitch + 2, _tmpscreen->pitch, - (byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight); - -#ifdef USE_SCALERS - if (_videoMode.aspectRatioCorrection) - stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch, - _videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0); -#endif - SDL_UnlockSurface(_tmpscreen); - SDL_UnlockSurface(_overlayscreen); - - _forceFull = true; -} - -void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { - assert(_transactionMode == kTransactionNone); - - if (_overlayscreen == NULL) - return; - - if (SDL_LockSurface(_overlayscreen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - byte *src = (byte *)_overlayscreen->pixels; - int h = _videoMode.overlayHeight; - do { - memcpy(buf, src, _videoMode.overlayWidth * 2); - src += _overlayscreen->pitch; - buf += pitch; - } while (--h); - - SDL_UnlockSurface(_overlayscreen); -} - -void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { - assert(_transactionMode == kTransactionNone); - - if (_overlayscreen == NULL) - return; - - // Clip the coordinates - if (x < 0) { - w += x; - buf -= x; - x = 0; - } - - if (y < 0) { - h += y; buf -= y * pitch; - y = 0; - } - - if (w > _videoMode.overlayWidth - x) { - w = _videoMode.overlayWidth - x; - } - - if (h > _videoMode.overlayHeight - y) { - h = _videoMode.overlayHeight - y; - } - - if (w <= 0 || h <= 0) - return; - - // Mark the modified region as dirty - addDirtyRect(x, y, w, h); - - if (SDL_LockSurface(_overlayscreen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - byte *dst = (byte *)_overlayscreen->pixels + y * _overlayscreen->pitch + x * 2; - do { - memcpy(dst, buf, w * 2); - dst += _overlayscreen->pitch; - buf += pitch; - } while (--h); - - SDL_UnlockSurface(_overlayscreen); -} - - -#pragma mark - -#pragma mark --- Mouse --- -#pragma mark - - -bool SdlGraphicsManager::showMouse(bool visible) { - if (_mouseVisible == visible) - return visible; - - bool last = _mouseVisible; - _mouseVisible = visible; - _mouseNeedsRedraw = true; - - return last; -} - -void SdlGraphicsManager::setMousePos(int x, int y) { - if (x != _mouseCurState.x || y != _mouseCurState.y) { - _mouseNeedsRedraw = true; - _mouseCurState.x = x; - _mouseCurState.y = y; - } -} - -void SdlGraphicsManager::warpMouse(int x, int y) { - int y1 = y; - - // Don't change actual mouse position, when mouse is outside of our window (in case of windowed mode) - if (!(SDL_GetAppState( ) & SDL_APPMOUSEFOCUS)) { - setMousePos(x, y); // but change game cursor position - return; - } - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - y1 = real2Aspect(y); - - if (_mouseCurState.x != x || _mouseCurState.y != y) { - if (!_overlayVisible) - SDL_WarpMouse(x * _videoMode.scaleFactor, y1 * _videoMode.scaleFactor); - else - SDL_WarpMouse(x, y1); - - // SDL_WarpMouse() generates a mouse movement event, so - // setMousePos() would be called eventually. However, the - // cannon script in CoMI calls this function twice each time - // the cannon is reloaded. Unless we update the mouse position - // immediately the second call is ignored, causing the cannon - // to change its aim. - - setMousePos(x, y); - } -} - -void SdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { -#ifdef USE_RGB_COLOR - if (!format) - _cursorFormat = Graphics::PixelFormat::createFormatCLUT8(); - else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel) - _cursorFormat = *format; - - if (_cursorFormat.bytesPerPixel < 4) - assert(keycolor < (uint)(1 << (_cursorFormat.bytesPerPixel << 3))); -#else - assert(keycolor <= 0xFF); -#endif - - if (w == 0 || h == 0) - return; - - _mouseCurState.hotX = hotspot_x; - _mouseCurState.hotY = hotspot_y; - - _mouseKeyColor = keycolor; - - _cursorTargetScale = cursorTargetScale; - - if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) { - _mouseCurState.w = w; - _mouseCurState.h = h; - - if (_mouseOrigSurface) - SDL_FreeSurface(_mouseOrigSurface); - - // Allocate bigger surface because AdvMame2x adds black pixel at [0,0] - _mouseOrigSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, - _mouseCurState.w + 2, - _mouseCurState.h + 2, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - - if (_mouseOrigSurface == NULL) - error("allocating _mouseOrigSurface failed"); - SDL_SetColorKey(_mouseOrigSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey); - } - - free(_mouseData); -#ifdef USE_RGB_COLOR - _mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel); - memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel); -#else - _mouseData = (byte *)malloc(w * h); - memcpy(_mouseData, buf, w * h); -#endif - - blitCursor(); -} - -void SdlGraphicsManager::blitCursor() { - byte *dstPtr; - const byte *srcPtr = _mouseData; -#ifdef USE_RGB_COLOR - uint32 color; -#else - byte color; -#endif - int w, h, i, j; - - if (!_mouseOrigSurface || !_mouseData) - return; - - _mouseNeedsRedraw = true; - - w = _mouseCurState.w; - h = _mouseCurState.h; - - SDL_LockSurface(_mouseOrigSurface); - - // Make whole surface transparent - for (i = 0; i < h + 2; i++) { - dstPtr = (byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch * i; - for (j = 0; j < w + 2; j++) { - *(uint16 *)dstPtr = kMouseColorKey; - dstPtr += 2; - } - } - - // Draw from [1,1] since AdvMame2x adds artefact at 0,0 - dstPtr = (byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2; - - SDL_Color *palette; - - if (_cursorPaletteDisabled) - palette = _currentPalette; - else - palette = _cursorPalette; - - for (i = 0; i < h; i++) { - for (j = 0; j < w; j++) { -#ifdef USE_RGB_COLOR - if (_cursorFormat.bytesPerPixel > 1) { - if (_cursorFormat.bytesPerPixel == 2) - color = *(const uint16 *)srcPtr; - else - color = *(const uint32 *)srcPtr; - if (color != _mouseKeyColor) { // transparent, don't draw - uint8 r, g, b; - _cursorFormat.colorToRGB(color, r, g, b); - *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format, - r, g, b); - } - dstPtr += 2; - srcPtr += _cursorFormat.bytesPerPixel; - } else { -#endif - color = *srcPtr; - if (color != _mouseKeyColor) { // transparent, don't draw - *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format, - palette[color].r, palette[color].g, palette[color].b); - } - dstPtr += 2; - srcPtr++; -#ifdef USE_RGB_COLOR - } -#endif - } - dstPtr += _mouseOrigSurface->pitch - w * 2; - } - - int rW, rH; - - if (_cursorTargetScale >= _videoMode.scaleFactor) { - // The cursor target scale is greater or equal to the scale at - // which the rest of the screen is drawn. We do not downscale - // the cursor image, we draw it at its original size. It will - // appear too large on screen. - - rW = w; - rH = h; - _mouseCurState.rHotX = _mouseCurState.hotX; - _mouseCurState.rHotY = _mouseCurState.hotY; - - // The virtual dimensions may be larger than the original. - - _mouseCurState.vW = w * _cursorTargetScale / _videoMode.scaleFactor; - _mouseCurState.vH = h * _cursorTargetScale / _videoMode.scaleFactor; - _mouseCurState.vHotX = _mouseCurState.hotX * _cursorTargetScale / - _videoMode.scaleFactor; - _mouseCurState.vHotY = _mouseCurState.hotY * _cursorTargetScale / - _videoMode.scaleFactor; - } else { - // The cursor target scale is smaller than the scale at which - // the rest of the screen is drawn. We scale up the cursor - // image to make it appear correct. - - rW = w * _videoMode.scaleFactor / _cursorTargetScale; - rH = h * _videoMode.scaleFactor / _cursorTargetScale; - _mouseCurState.rHotX = _mouseCurState.hotX * _videoMode.scaleFactor / - _cursorTargetScale; - _mouseCurState.rHotY = _mouseCurState.hotY * _videoMode.scaleFactor / - _cursorTargetScale; - - // The virtual dimensions will be the same as the original. - - _mouseCurState.vW = w; - _mouseCurState.vH = h; - _mouseCurState.vHotX = _mouseCurState.hotX; - _mouseCurState.vHotY = _mouseCurState.hotY; - } - -#ifdef USE_SCALERS - int rH1 = rH; // store original to pass to aspect-correction function later -#endif - - if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) { - rH = real2Aspect(rH - 1) + 1; - _mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY); - } - - if (_mouseCurState.rW != rW || _mouseCurState.rH != rH) { - _mouseCurState.rW = rW; - _mouseCurState.rH = rH; - - if (_mouseSurface) - SDL_FreeSurface(_mouseSurface); - - _mouseSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, - _mouseCurState.rW, - _mouseCurState.rH, - 16, - _hwscreen->format->Rmask, - _hwscreen->format->Gmask, - _hwscreen->format->Bmask, - _hwscreen->format->Amask); - - if (_mouseSurface == NULL) - error("allocating _mouseSurface failed"); - - SDL_SetColorKey(_mouseSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey); - } - - SDL_LockSurface(_mouseSurface); - - ScalerProc *scalerProc; - - // If possible, use the same scaler for the cursor as for the rest of - // the game. This only works well with the non-blurring scalers so we - // actually only use the 1x, 1.5x, 2x and AdvMame scalers. - - if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE)) - scalerProc = _scalerProc; - else - scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1]; - - scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2, - _mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch, - _mouseCurState.w, _mouseCurState.h); - -#ifdef USE_SCALERS - if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) - cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0); -#endif - - SDL_UnlockSurface(_mouseSurface); - SDL_UnlockSurface(_mouseOrigSurface); -} - -#ifdef USE_SCALERS -// Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from -// common/scale/aspect.cpp -static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) { - int maxDstY = real2Aspect(origSrcY + height - 1); - int y; - const uint8 *startSrcPtr = buf + srcX * 2 + (srcY - origSrcY) * pitch; - uint8 *dstPtr = buf + srcX * 2 + maxDstY * pitch; - - for (y = maxDstY; y >= srcY; y--) { - const uint8 *srcPtr = startSrcPtr + aspect2Real(y) * pitch; - - if (srcPtr == dstPtr) - break; - memcpy(dstPtr, srcPtr, width * 2); - dstPtr -= pitch; - } - - return 1 + maxDstY - srcY; -} -#endif - -void SdlGraphicsManager::undrawMouse() { - const int x = _mouseBackup.x; - const int y = _mouseBackup.y; - - // When we switch bigger overlay off mouse jumps. Argh! - // This is intended to prevent undrawing offscreen mouse - if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) - return; - - if (_mouseBackup.w != 0 && _mouseBackup.h != 0) - addDirtyRect(x, y - _currentShakePos, _mouseBackup.w, _mouseBackup.h); -} - -void SdlGraphicsManager::drawMouse() { - if (!_mouseVisible || !_mouseSurface) { - _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0; - return; - } - - SDL_Rect dst; - int scale; - int hotX, hotY; - - dst.x = _mouseCurState.x; - dst.y = _mouseCurState.y; - - if (!_overlayVisible) { - scale = _videoMode.scaleFactor; - dst.w = _mouseCurState.vW; - dst.h = _mouseCurState.vH; - hotX = _mouseCurState.vHotX; - hotY = _mouseCurState.vHotY; - } else { - scale = 1; - dst.w = _mouseCurState.rW; - dst.h = _mouseCurState.rH; - hotX = _mouseCurState.rHotX; - hotY = _mouseCurState.rHotY; - } - - // The mouse is undrawn using virtual coordinates, i.e. they may be - // scaled and aspect-ratio corrected. - - _mouseBackup.x = dst.x - hotX; - _mouseBackup.y = dst.y - hotY; - _mouseBackup.w = dst.w; - _mouseBackup.h = dst.h; - - // We draw the pre-scaled cursor image, so now we need to adjust for - // scaling, shake position and aspect ratio correction manually. - - if (!_overlayVisible) { - dst.y += _currentShakePos; - } - - if (_videoMode.aspectRatioCorrection && !_overlayVisible) - dst.y = real2Aspect(dst.y); - - dst.x = scale * dst.x - _mouseCurState.rHotX; - dst.y = scale * dst.y - _mouseCurState.rHotY; - dst.w = _mouseCurState.rW; - dst.h = _mouseCurState.rH; - - // Note that SDL_BlitSurface() and addDirtyRect() will both perform any - // clipping necessary - - if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); - - // The screen will be updated using real surface coordinates, i.e. - // they will not be scaled or aspect-ratio corrected. - - addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); -} - -#pragma mark - -#pragma mark --- On Screen Display --- -#pragma mark - - -#ifdef USE_OSD -void SdlGraphicsManager::displayMessageOnOSD(const char *msg) { - assert(_transactionMode == kTransactionNone); - assert(msg); - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - uint i; - - // Lock the OSD surface for drawing - if (SDL_LockSurface(_osdSurface)) - error("displayMessageOnOSD: SDL_LockSurface failed: %s", SDL_GetError()); - - Graphics::Surface dst; - dst.pixels = _osdSurface->pixels; - dst.w = _osdSurface->w; - dst.h = _osdSurface->h; - dst.pitch = _osdSurface->pitch; - dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel, - 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss, - 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss, - _osdSurface->format->Rshift, _osdSurface->format->Gshift, - _osdSurface->format->Bshift, _osdSurface->format->Ashift); - - // The font we are going to use: - const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont); - - // Clear everything with the "transparent" color, i.e. the colorkey - SDL_FillRect(_osdSurface, 0, kOSDColorKey); - - // Split the message into separate lines. - Common::Array lines; - const char *ptr; - for (ptr = msg; *ptr; ++ptr) { - if (*ptr == '\n') { - lines.push_back(Common::String(msg, ptr - msg)); - msg = ptr + 1; - } - } - lines.push_back(Common::String(msg, ptr - msg)); - - // Determine a rect which would contain the message string (clipped to the - // screen dimensions). - const int vOffset = 6; - const int lineSpacing = 1; - const int lineHeight = font->getFontHeight() + 2 * lineSpacing; - int width = 0; - int height = lineHeight * lines.size() + 2 * vOffset; - for (i = 0; i < lines.size(); i++) { - width = MAX(width, font->getStringWidth(lines[i]) + 14); - } - - // Clip the rect - if (width > dst.w) - width = dst.w; - if (height > dst.h) - height = dst.h; - - // Draw a dark gray rect - // TODO: Rounded corners ? Border? - SDL_Rect osdRect; - osdRect.x = (dst.w - width) / 2; - osdRect.y = (dst.h - height) / 2; - osdRect.w = width; - osdRect.h = height; - SDL_FillRect(_osdSurface, &osdRect, SDL_MapRGB(_osdSurface->format, 64, 64, 64)); - - // Render the message, centered, and in white - for (i = 0; i < lines.size(); i++) { - font->drawString(&dst, lines[i], - osdRect.x, osdRect.y + i * lineHeight + vOffset + lineSpacing, osdRect.w, - SDL_MapRGB(_osdSurface->format, 255, 255, 255), - Graphics::kTextAlignCenter); - } - - // Finished drawing, so unlock the OSD surface again - SDL_UnlockSurface(_osdSurface); - - // Init the OSD display parameters, and the fade out - _osdAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100; - _osdFadeStartTime = SDL_GetTicks() + kOSDFadeOutDelay; - SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha); - - // Ensure a full redraw takes place next time the screen is updated - _forceFull = true; -} -#endif - -bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) { - - // Ctrl-Alt-a toggles aspect ratio correction - if (key == 'a') { - beginGFXTransaction(); - setFeatureState(OSystem::kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection); - endGFXTransaction(); -#ifdef USE_OSD - char buffer[128]; - if (_videoMode.aspectRatioCorrection) - sprintf(buffer, "%s\n%d x %d -> %d x %d", - _("Enabled aspect ratio correction"), - _videoMode.screenWidth, _videoMode.screenHeight, - _hwscreen->w, _hwscreen->h - ); - else - sprintf(buffer, "%s\n%d x %d -> %d x %d", - _("Disabled aspect ratio correction"), - _videoMode.screenWidth, _videoMode.screenHeight, - _hwscreen->w, _hwscreen->h - ); - displayMessageOnOSD(buffer); -#endif - internUpdateScreen(); - return true; - } - - int newMode = -1; - int factor = _videoMode.scaleFactor - 1; - SDLKey sdlKey = (SDLKey)key; - - // Increase/decrease the scale factor - if (sdlKey == SDLK_EQUALS || sdlKey == SDLK_PLUS || sdlKey == SDLK_MINUS || - sdlKey == SDLK_KP_PLUS || sdlKey == SDLK_KP_MINUS) { - factor += (sdlKey == SDLK_MINUS || sdlKey == SDLK_KP_MINUS) ? -1 : +1; - if (0 <= factor && factor <= 3) { - newMode = s_gfxModeSwitchTable[_scalerType][factor]; - } - } - - const bool isNormalNumber = (SDLK_1 <= sdlKey && sdlKey <= SDLK_9); - const bool isKeypadNumber = (SDLK_KP1 <= sdlKey && sdlKey <= SDLK_KP9); - if (isNormalNumber || isKeypadNumber) { - _scalerType = sdlKey - (isNormalNumber ? SDLK_1 : SDLK_KP1); - if (_scalerType >= ARRAYSIZE(s_gfxModeSwitchTable)) - return false; - - while (s_gfxModeSwitchTable[_scalerType][factor] < 0) { - assert(factor > 0); - factor--; - } - newMode = s_gfxModeSwitchTable[_scalerType][factor]; - } - - if (newMode >= 0) { - beginGFXTransaction(); - setGraphicsMode(newMode); - endGFXTransaction(); -#ifdef USE_OSD - if (_osdSurface) { - const char *newScalerName = 0; - const OSystem::GraphicsMode *g = getSupportedGraphicsModes(); - while (g->name) { - if (g->id == _videoMode.mode) { - newScalerName = g->description; - break; - } - g++; - } - if (newScalerName) { - char buffer[128]; - sprintf(buffer, "%s %s\n%d x %d -> %d x %d", - _("Active graphics filter:"), - newScalerName, - _videoMode.screenWidth, _videoMode.screenHeight, - _hwscreen->w, _hwscreen->h - ); - displayMessageOnOSD(buffer); - } - } -#endif - internUpdateScreen(); - - return true; - } else { - return false; - } -} - -bool SdlGraphicsManager::isScalerHotkey(const Common::Event &event) { - if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) { - const bool isNormalNumber = (Common::KEYCODE_1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_9); - const bool isKeypadNumber = (Common::KEYCODE_KP1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_KP9); - const bool isScaleKey = (event.kbd.keycode == Common::KEYCODE_EQUALS || event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS || - event.kbd.keycode == Common::KEYCODE_KP_PLUS || event.kbd.keycode == Common::KEYCODE_KP_MINUS); - - if (isNormalNumber || isKeypadNumber) { - int keyValue = event.kbd.keycode - (isNormalNumber ? Common::KEYCODE_1 : Common::KEYCODE_KP1); - if (keyValue >= ARRAYSIZE(s_gfxModeSwitchTable)) - return false; - } - return (isScaleKey || event.kbd.keycode == 'a'); - } - return false; -} - -void SdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { - if (!event.synthetic) { - Common::Event newEvent(event); - newEvent.synthetic = true; - if (!_overlayVisible) { - newEvent.mouse.x /= _videoMode.scaleFactor; - newEvent.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - newEvent.mouse.y = aspect2Real(newEvent.mouse.y); - } - g_system->getEventManager()->pushEvent(newEvent); - } -} - -void SdlGraphicsManager::toggleFullScreen() { - beginGFXTransaction(); - setFullscreenMode(!_videoMode.fullscreen); - endGFXTransaction(); -#ifdef USE_OSD - if (_videoMode.fullscreen) - displayMessageOnOSD(_("Fullscreen mode")); - else - displayMessageOnOSD(_("Windowed mode")); -#endif -} - -bool SdlGraphicsManager::notifyEvent(const Common::Event &event) { - switch ((int)event.type) { - case Common::EVENT_KEYDOWN: - // Alt-Return and Alt-Enter toggle full screen mode - if (event.kbd.hasFlags(Common::KBD_ALT) && - (event.kbd.keycode == Common::KEYCODE_RETURN || - event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER)) { - toggleFullScreen(); - return true; - } - - // Alt-S: Create a screenshot - if (event.kbd.hasFlags(Common::KBD_ALT) && event.kbd.keycode == 's') { - char filename[20]; - - for (int n = 0;; n++) { - SDL_RWops *file; - - sprintf(filename, "scummvm%05d.bmp", n); - file = SDL_RWFromFile(filename, "r"); - if (!file) - break; - SDL_RWclose(file); - } - if (saveScreenshot(filename)) - debug("Saved screenshot '%s'", filename); - else - warning("Could not save screenshot"); - return true; - } - - // Ctrl-Alt- will change the GFX mode - if (event.kbd.hasFlags(Common::KBD_CTRL|Common::KBD_ALT)) { - if (handleScalerHotkeys(event.kbd.keycode)) - return true; - } - case Common::EVENT_KEYUP: - return isScalerHotkey(event); - case Common::EVENT_MOUSEMOVE: - if (event.synthetic) - setMousePos(event.mouse.x, event.mouse.y); - case Common::EVENT_LBUTTONDOWN: - case Common::EVENT_RBUTTONDOWN: - case Common::EVENT_WHEELUP: - case Common::EVENT_WHEELDOWN: - case Common::EVENT_MBUTTONDOWN: - case Common::EVENT_LBUTTONUP: - case Common::EVENT_RBUTTONUP: - case Common::EVENT_MBUTTONUP: - adjustMouseEvent(event); - return !event.synthetic; - - // HACK: Handle special SDL event - case OSystem_SDL::kSdlEventExpose: - _forceFull = true; - return false; - default: - break; - } - - return false; -} - -#endif diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h deleted file mode 100644 index 9627ab23a3..0000000000 --- a/backends/graphics/sdl/sdl-graphics.h +++ /dev/null @@ -1,338 +0,0 @@ -/* 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 BACKENDS_GRAPHICS_SDL_H -#define BACKENDS_GRAPHICS_SDL_H - -#include "backends/graphics/graphics.h" -#include "graphics/pixelformat.h" -#include "graphics/scaler.h" -#include "common/events.h" -#include "common/system.h" - -#include "backends/events/sdl/sdl-events.h" - -#include "backends/platform/sdl/sdl-sys.h" - -#ifndef RELEASE_BUILD -// Define this to allow for focus rectangle debugging -#define USE_SDL_DEBUG_FOCUSRECT -#endif - -#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) -// Uncomment this to enable the 'on screen display' code. -#define USE_OSD 1 -#endif - -enum { - GFX_NORMAL = 0, - GFX_DOUBLESIZE = 1, - GFX_TRIPLESIZE = 2, - GFX_2XSAI = 3, - GFX_SUPER2XSAI = 4, - GFX_SUPEREAGLE = 5, - GFX_ADVMAME2X = 6, - GFX_ADVMAME3X = 7, - GFX_HQ2X = 8, - GFX_HQ3X = 9, - GFX_TV2X = 10, - GFX_DOTMATRIX = 11 -}; - - -class AspectRatio { - int _kw, _kh; -public: - AspectRatio() { _kw = _kh = 0; } - AspectRatio(int w, int h); - - bool isAuto() const { return (_kw | _kh) == 0; } - - int kw() const { return _kw; } - int kh() const { return _kh; } -}; - -/** - * SDL graphics manager - */ -class SdlGraphicsManager : public GraphicsManager, public Common::EventObserver { -public: - SdlGraphicsManager(SdlEventSource *sdlEventSource); - virtual ~SdlGraphicsManager(); - - virtual void initEventObserver(); - - virtual bool hasFeature(OSystem::Feature f); - virtual void setFeatureState(OSystem::Feature f, bool enable); - virtual bool getFeatureState(OSystem::Feature f); - - static const OSystem::GraphicsMode *supportedGraphicsModes(); - virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; - virtual int getDefaultGraphicsMode() const; - virtual bool setGraphicsMode(int mode); - virtual int getGraphicsMode() const; - virtual void resetGraphicsScale(); -#ifdef USE_RGB_COLOR - virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } - virtual Common::List getSupportedFormats() const; -#endif - virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL); - virtual int getScreenChangeID() const { return _screenChangeCount; } - - virtual void beginGFXTransaction(); - virtual OSystem::TransactionError endGFXTransaction(); - - virtual int16 getHeight(); - virtual int16 getWidth(); - -protected: - // PaletteManager API - virtual void setPalette(const byte *colors, uint start, uint num); - virtual void grabPalette(byte *colors, uint start, uint num); - -public: - virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); - virtual Graphics::Surface *lockScreen(); - virtual void unlockScreen(); - virtual void fillScreen(uint32 col); - virtual void updateScreen(); - virtual void setShakePos(int shakeOffset); - virtual void setFocusRectangle(const Common::Rect& rect); - virtual void clearFocusRectangle(); - - virtual void showOverlay(); - virtual void hideOverlay(); - virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; } - virtual void clearOverlay(); - virtual void grabOverlay(OverlayColor *buf, int pitch); - virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); - virtual int16 getOverlayHeight() { return _videoMode.overlayHeight; } - virtual int16 getOverlayWidth() { return _videoMode.overlayWidth; } - - virtual bool showMouse(bool visible); - virtual void warpMouse(int x, int y); - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL); - virtual void setCursorPalette(const byte *colors, uint start, uint num); - -#ifdef USE_OSD - virtual void displayMessageOnOSD(const char *msg); -#endif - - // Override from Common::EventObserver - bool notifyEvent(const Common::Event &event); - -protected: - SdlEventSource *_sdlEventSource; - -#ifdef USE_OSD - /** Surface containing the OSD message */ - SDL_Surface *_osdSurface; - /** Transparency level of the OSD */ - uint8 _osdAlpha; - /** When to start the fade out */ - uint32 _osdFadeStartTime; - /** Enum with OSD options */ - enum { - kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */ - kOSDFadeOutDuration = 500, /** < Duration of the OSD fade out (in milliseconds) */ - kOSDColorKey = 1, /** < Transparent color key */ - kOSDInitialAlpha = 80 /** < Initial alpha level, in percent */ - }; -#endif - - /** Hardware screen */ - SDL_Surface *_hwscreen; - - /** Unseen game screen */ - SDL_Surface *_screen; -#ifdef USE_RGB_COLOR - Graphics::PixelFormat _screenFormat; - Graphics::PixelFormat _cursorFormat; - Common::List _supportedFormats; - - /** - * Update the list of supported pixel formats. - * This method is invoked by loadGFXMode(). - */ - void detectSupportedFormats(); -#endif - - /** Temporary screen (for scalers) */ - SDL_Surface *_tmpscreen; - /** Temporary screen (for scalers) */ - SDL_Surface *_tmpscreen2; - - SDL_Surface *_overlayscreen; - bool _overlayVisible; - Graphics::PixelFormat _overlayFormat; - - enum { - kTransactionNone = 0, - kTransactionActive = 1, - kTransactionRollback = 2 - }; - - struct TransactionDetails { - bool sizeChanged; - bool needHotswap; - bool needUpdatescreen; - bool normal1xScaler; -#ifdef USE_RGB_COLOR - bool formatChanged; -#endif - }; - TransactionDetails _transactionDetails; - - struct VideoState { - bool setup; - - bool fullscreen; - bool aspectRatioCorrection; - AspectRatio desiredAspectRatio; - - int mode; - int scaleFactor; - - int screenWidth, screenHeight; - int overlayWidth, overlayHeight; - int hardwareWidth, hardwareHeight; -#ifdef USE_RGB_COLOR - Graphics::PixelFormat format; -#endif - }; - VideoState _videoMode, _oldVideoMode; - - /** Force full redraw on next updateScreen */ - bool _forceFull; - - ScalerProc *_scalerProc; - int _scalerType; - int _transactionMode; - - bool _screenIsLocked; - Graphics::Surface _framebuffer; - - int _screenChangeCount; - - enum { - NUM_DIRTY_RECT = 100, - MAX_SCALING = 3 - }; - - // Dirty rect management - SDL_Rect _dirtyRectList[NUM_DIRTY_RECT]; - int _numDirtyRects; - - struct MousePos { - // The mouse position, using either virtual (game) or real - // (overlay) coordinates. - int16 x, y; - - // The size and hotspot of the original cursor image. - int16 w, h; - int16 hotX, hotY; - - // The size and hotspot of the pre-scaled cursor image, in real - // coordinates. - int16 rW, rH; - int16 rHotX, rHotY; - - // The size and hotspot of the pre-scaled cursor image, in game - // coordinates. - int16 vW, vH; - int16 vHotX, vHotY; - - MousePos() : x(0), y(0), w(0), h(0), hotX(0), hotY(0), - rW(0), rH(0), rHotX(0), rHotY(0), vW(0), vH(0), - vHotX(0), vHotY(0) - { } - }; - - bool _mouseVisible; - bool _mouseNeedsRedraw; - byte *_mouseData; - SDL_Rect _mouseBackup; - MousePos _mouseCurState; -#ifdef USE_RGB_COLOR - uint32 _mouseKeyColor; -#else - byte _mouseKeyColor; -#endif - int _cursorTargetScale; - bool _cursorPaletteDisabled; - SDL_Surface *_mouseOrigSurface; - SDL_Surface *_mouseSurface; - enum { - kMouseColorKey = 1 - }; - - // Shake mode - int _currentShakePos; - int _newShakePos; - - // Palette data - SDL_Color *_currentPalette; - uint _paletteDirtyStart, _paletteDirtyEnd; - - // Cursor palette data - SDL_Color *_cursorPalette; - - /** - * Mutex which prevents multiple threads from interfering with each other - * when accessing the screen. - */ - OSystem::MutexRef _graphicsMutex; - -#ifdef USE_SDL_DEBUG_FOCUSRECT - bool _enableFocusRectDebugCode; - bool _enableFocusRect; - Common::Rect _focusRect; -#endif - - virtual void addDirtyRect(int x, int y, int w, int h, bool realCoordinates = false); - - virtual void drawMouse(); - virtual void undrawMouse(); - virtual void blitCursor(); - - virtual void internUpdateScreen(); - - virtual bool loadGFXMode(); - virtual void unloadGFXMode(); - virtual bool hotswapGFXMode(); - - virtual void setFullscreenMode(bool enable); - virtual void setAspectRatioCorrection(bool enable); - - virtual int effectiveScreenHeight() const; - - virtual void setGraphicsModeIntern(); - - virtual bool handleScalerHotkeys(Common::KeyCode key); - virtual bool isScalerHotkey(const Common::Event &event); - virtual void adjustMouseEvent(const Common::Event &event); - virtual void setMousePos(int x, int y); - virtual void toggleFullScreen(); - virtual bool saveScreenshot(const char *filename); -}; - -#endif diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp new file mode 100644 index 0000000000..66207b6808 --- /dev/null +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -0,0 +1,2321 @@ +/* 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 "common/scummsys.h" + +#if defined(SDL_BACKEND) + +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" +#include "backends/events/sdl/sdl-events.h" +#include "backends/platform/sdl/sdl.h" +#include "common/config-manager.h" +#include "common/mutex.h" +#include "common/textconsole.h" +#include "common/translation.h" +#include "common/util.h" +#ifdef USE_RGB_COLOR +#include "common/list.h" +#endif +#include "graphics/font.h" +#include "graphics/fontman.h" +#include "graphics/scaler.h" +#include "graphics/scaler/aspect.h" +#include "graphics/surface.h" + +static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { + {"1x", _s("Normal (no scaling)"), GFX_NORMAL}, +#ifdef USE_SCALERS + {"2x", "2x", GFX_DOUBLESIZE}, + {"3x", "3x", GFX_TRIPLESIZE}, + {"2xsai", "2xSAI", GFX_2XSAI}, + {"super2xsai", "Super2xSAI", GFX_SUPER2XSAI}, + {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, + {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, + {"advmame3x", "AdvMAME3x", GFX_ADVMAME3X}, +#ifdef USE_HQ_SCALERS + {"hq2x", "HQ2x", GFX_HQ2X}, + {"hq3x", "HQ3x", GFX_HQ3X}, +#endif + {"tv2x", "TV2x", GFX_TV2X}, + {"dotmatrix", "DotMatrix", GFX_DOTMATRIX}, +#endif + {0, 0, 0} +}; + +DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Normal (no scaling)", "lowres") + +// Table of relative scalers magnitudes +// [definedScale - 1][scaleFactor - 1] +static ScalerProc *scalersMagn[3][3] = { +#ifdef USE_SCALERS + { Normal1x, AdvMame2x, AdvMame3x }, + { Normal1x, Normal1x, Normal1o5x }, + { Normal1x, Normal1x, Normal1x } +#else // remove dependencies on other scalers + { Normal1x, Normal1x, Normal1x }, + { Normal1x, Normal1x, Normal1x }, + { Normal1x, Normal1x, Normal1x } +#endif +}; + +static const int s_gfxModeSwitchTable[][4] = { + { GFX_NORMAL, GFX_DOUBLESIZE, GFX_TRIPLESIZE, -1 }, + { GFX_NORMAL, GFX_ADVMAME2X, GFX_ADVMAME3X, -1 }, + { GFX_NORMAL, GFX_HQ2X, GFX_HQ3X, -1 }, + { GFX_NORMAL, GFX_2XSAI, -1, -1 }, + { GFX_NORMAL, GFX_SUPER2XSAI, -1, -1 }, + { GFX_NORMAL, GFX_SUPEREAGLE, -1, -1 }, + { GFX_NORMAL, GFX_TV2X, -1, -1 }, + { GFX_NORMAL, GFX_DOTMATRIX, -1, -1 } + }; + +#ifdef USE_SCALERS +static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY); +#endif + +AspectRatio::AspectRatio(int w, int h) { + // TODO : Validation and so on... + // Currently, we just ensure the program don't instantiate non-supported aspect ratios + _kw = w; + _kh = h; +} + +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS) +static AspectRatio getDesiredAspectRatio() { + const size_t AR_COUNT = 4; + const char *desiredAspectRatioAsStrings[AR_COUNT] = { "auto", "4/3", "16/9", "16/10" }; + const AspectRatio desiredAspectRatios[AR_COUNT] = { AspectRatio(0, 0), AspectRatio(4,3), AspectRatio(16,9), AspectRatio(16,10) }; + + //TODO : We could parse an arbitrary string, if we code enough proper validation + Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio"); + + for (size_t i = 0; i < AR_COUNT; i++) { + assert(desiredAspectRatioAsStrings[i] != NULL); + + if (!scumm_stricmp(desiredAspectRatio.c_str(), desiredAspectRatioAsStrings[i])) { + return desiredAspectRatios[i]; + } + } + // TODO : Report a warning + return AspectRatio(0, 0); +} +#endif + +SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource) + : + _sdlEventSource(sdlEventSource), +#ifdef USE_OSD + _osdSurface(0), _osdAlpha(SDL_ALPHA_TRANSPARENT), _osdFadeStartTime(0), +#endif + _hwscreen(0), _screen(0), _tmpscreen(0), +#ifdef USE_RGB_COLOR + _screenFormat(Graphics::PixelFormat::createFormatCLUT8()), + _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()), +#endif + _overlayVisible(false), + _overlayscreen(0), _tmpscreen2(0), + _scalerProc(0), _screenChangeCount(0), + _mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0), + _mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true), + _currentShakePos(0), _newShakePos(0), + _paletteDirtyStart(0), _paletteDirtyEnd(0), + _screenIsLocked(false), + _graphicsMutex(0), +#ifdef USE_SDL_DEBUG_FOCUSRECT + _enableFocusRectDebugCode(false), _enableFocusRect(false), _focusRect(), +#endif + _transactionMode(kTransactionNone) { + + if (SDL_InitSubSystem(SDL_INIT_VIDEO) == -1) { + error("Could not initialize SDL: %s", SDL_GetError()); + } + + // This is also called in initSDL(), but initializing graphics + // may reset it. + SDL_EnableUNICODE(1); + + // allocate palette storage + _currentPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256); + _cursorPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256); + + _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0; + + memset(&_mouseCurState, 0, sizeof(_mouseCurState)); + + _graphicsMutex = g_system->createMutex(); + +#ifdef USE_SDL_DEBUG_FOCUSRECT + if (ConfMan.hasKey("use_sdl_debug_focusrect")) + _enableFocusRectDebugCode = ConfMan.getBool("use_sdl_debug_focusrect"); +#endif + + SDL_ShowCursor(SDL_DISABLE); + + memset(&_oldVideoMode, 0, sizeof(_oldVideoMode)); + memset(&_videoMode, 0, sizeof(_videoMode)); + memset(&_transactionDetails, 0, sizeof(_transactionDetails)); + +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && defined(USE_SCALERS) + _videoMode.mode = GFX_DOUBLESIZE; + _videoMode.scaleFactor = 2; + _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); + _videoMode.desiredAspectRatio = getDesiredAspectRatio(); + _scalerProc = Normal2x; +#else // for small screen platforms + _videoMode.mode = GFX_NORMAL; + _videoMode.scaleFactor = 1; + _videoMode.aspectRatioCorrection = false; + _scalerProc = Normal1x; +#endif + _scalerType = 0; + +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) + _videoMode.fullscreen = ConfMan.getBool("fullscreen"); +#else + _videoMode.fullscreen = true; +#endif +} + +SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() { + // Unregister the event observer + if (g_system->getEventManager()->getEventDispatcher() != NULL) + g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this); + + unloadGFXMode(); + if (_mouseSurface) + SDL_FreeSurface(_mouseSurface); + _mouseSurface = 0; + if (_mouseOrigSurface) + SDL_FreeSurface(_mouseOrigSurface); + _mouseOrigSurface = 0; + g_system->deleteMutex(_graphicsMutex); + + free(_currentPalette); + free(_cursorPalette); + free(_mouseData); +} + +void SurfaceSdlGraphicsManager::initEventObserver() { + // Register the graphics manager as a event observer + g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false); +} + +bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) { + return + (f == OSystem::kFeatureFullscreenMode) || + (f == OSystem::kFeatureAspectRatioCorrection) || + (f == OSystem::kFeatureCursorPalette) || + (f == OSystem::kFeatureIconifyWindow); +} + +void SurfaceSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { + switch (f) { + case OSystem::kFeatureFullscreenMode: + setFullscreenMode(enable); + break; + case OSystem::kFeatureAspectRatioCorrection: + setAspectRatioCorrection(enable); + break; + case OSystem::kFeatureCursorPalette: + _cursorPaletteDisabled = !enable; + blitCursor(); + break; + case OSystem::kFeatureIconifyWindow: + if (enable) + SDL_WM_IconifyWindow(); + break; + default: + break; + } +} + +bool SurfaceSdlGraphicsManager::getFeatureState(OSystem::Feature f) { + assert(_transactionMode == kTransactionNone); + + switch (f) { + case OSystem::kFeatureFullscreenMode: + return _videoMode.fullscreen; + case OSystem::kFeatureAspectRatioCorrection: + return _videoMode.aspectRatioCorrection; + case OSystem::kFeatureCursorPalette: + return !_cursorPaletteDisabled; + default: + return false; + } +} + +const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::supportedGraphicsModes() { + return s_supportedGraphicsModes; +} + +const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::getSupportedGraphicsModes() const { + return s_supportedGraphicsModes; +} + +int SurfaceSdlGraphicsManager::getDefaultGraphicsMode() const { + return GFX_DOUBLESIZE; +} + +void SurfaceSdlGraphicsManager::resetGraphicsScale() { + setGraphicsMode(s_gfxModeSwitchTable[_scalerType][0]); +} + +void SurfaceSdlGraphicsManager::beginGFXTransaction() { + assert(_transactionMode == kTransactionNone); + + _transactionMode = kTransactionActive; + + _transactionDetails.sizeChanged = false; + + _transactionDetails.needHotswap = false; + _transactionDetails.needUpdatescreen = false; + + _transactionDetails.normal1xScaler = false; +#ifdef USE_RGB_COLOR + _transactionDetails.formatChanged = false; +#endif + + _oldVideoMode = _videoMode; +} + +OSystem::TransactionError SurfaceSdlGraphicsManager::endGFXTransaction() { + int errors = OSystem::kTransactionSuccess; + + assert(_transactionMode != kTransactionNone); + + if (_transactionMode == kTransactionRollback) { + if (_videoMode.fullscreen != _oldVideoMode.fullscreen) { + errors |= OSystem::kTransactionFullscreenFailed; + + _videoMode.fullscreen = _oldVideoMode.fullscreen; + } else if (_videoMode.aspectRatioCorrection != _oldVideoMode.aspectRatioCorrection) { + errors |= OSystem::kTransactionAspectRatioFailed; + + _videoMode.aspectRatioCorrection = _oldVideoMode.aspectRatioCorrection; + } else if (_videoMode.mode != _oldVideoMode.mode) { + errors |= OSystem::kTransactionModeSwitchFailed; + + _videoMode.mode = _oldVideoMode.mode; + _videoMode.scaleFactor = _oldVideoMode.scaleFactor; +#ifdef USE_RGB_COLOR + } else if (_videoMode.format != _oldVideoMode.format) { + errors |= OSystem::kTransactionFormatNotSupported; + + _videoMode.format = _oldVideoMode.format; + _screenFormat = _videoMode.format; +#endif + } else if (_videoMode.screenWidth != _oldVideoMode.screenWidth || _videoMode.screenHeight != _oldVideoMode.screenHeight) { + errors |= OSystem::kTransactionSizeChangeFailed; + + _videoMode.screenWidth = _oldVideoMode.screenWidth; + _videoMode.screenHeight = _oldVideoMode.screenHeight; + _videoMode.overlayWidth = _oldVideoMode.overlayWidth; + _videoMode.overlayHeight = _oldVideoMode.overlayHeight; + } + + if (_videoMode.fullscreen == _oldVideoMode.fullscreen && + _videoMode.aspectRatioCorrection == _oldVideoMode.aspectRatioCorrection && + _videoMode.mode == _oldVideoMode.mode && + _videoMode.screenWidth == _oldVideoMode.screenWidth && + _videoMode.screenHeight == _oldVideoMode.screenHeight) { + + // Our new video mode would now be exactly the same as the + // old one. Since we still can not assume SDL_SetVideoMode + // to be working fine, we need to invalidate the old video + // mode, so loadGFXMode would error out properly. + _oldVideoMode.setup = false; + } + } + +#ifdef USE_RGB_COLOR + if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) { +#else + if (_transactionDetails.sizeChanged) { +#endif + unloadGFXMode(); + if (!loadGFXMode()) { + if (_oldVideoMode.setup) { + _transactionMode = kTransactionRollback; + errors |= endGFXTransaction(); + } + } else { + setGraphicsModeIntern(); + clearOverlay(); + + _videoMode.setup = true; + // OSystem_SDL::pollEvent used to update the screen change count, + // but actually it gives problems when a video mode was changed + // but OSystem_SDL::pollEvent was not called. This for example + // caused a crash under certain circumstances when doing an RTL. + // To fix this issue we update the screen change count right here. + _screenChangeCount++; + } + } else if (_transactionDetails.needHotswap) { + setGraphicsModeIntern(); + if (!hotswapGFXMode()) { + if (_oldVideoMode.setup) { + _transactionMode = kTransactionRollback; + errors |= endGFXTransaction(); + } + } else { + _videoMode.setup = true; + // OSystem_SDL::pollEvent used to update the screen change count, + // but actually it gives problems when a video mode was changed + // but OSystem_SDL::pollEvent was not called. This for example + // caused a crash under certain circumstances when doing an RTL. + // To fix this issue we update the screen change count right here. + _screenChangeCount++; + + if (_transactionDetails.needUpdatescreen) + internUpdateScreen(); + } + } else if (_transactionDetails.needUpdatescreen) { + setGraphicsModeIntern(); + internUpdateScreen(); + } + + _transactionMode = kTransactionNone; + return (OSystem::TransactionError)errors; +} + +#ifdef USE_RGB_COLOR +Common::List SurfaceSdlGraphicsManager::getSupportedFormats() const { + assert(!_supportedFormats.empty()); + return _supportedFormats; +} + +void SurfaceSdlGraphicsManager::detectSupportedFormats() { + + // Clear old list + _supportedFormats.clear(); + + // Some tables with standard formats that we always list + // as "supported". If frontend code tries to use one of + // these, we will perform the necessary format + // conversion in the background. Of course this incurs a + // performance hit, but on desktop ports this should not + // matter. We still push the currently active format to + // the front, so if frontend code just uses the first + // available format, it will get one that is "cheap" to + // use. + const Graphics::PixelFormat RGBList[] = { +#ifdef USE_RGB_COLOR + // RGBA8888, ARGB8888, RGB888 + Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), + Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), + Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), +#endif + // RGB565, XRGB1555, RGB555, RGBA4444, ARGB4444 + Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), + Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15), + Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), + Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), + Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) + }; + const Graphics::PixelFormat BGRList[] = { +#ifdef USE_RGB_COLOR + // ABGR8888, BGRA8888, BGR888 + Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), + Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0), + Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0), +#endif + // BGR565, XBGR1555, BGR555, ABGR4444, BGRA4444 + Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0), + Graphics::PixelFormat(2, 5, 5, 5, 1, 0, 5, 10, 15), + Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0), + Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12), + Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0) + }; + + Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8(); + if (_hwscreen) { + // Get our currently set hardware format + format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel, + 8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss, + 8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss, + _hwscreen->format->Rshift, _hwscreen->format->Gshift, + _hwscreen->format->Bshift, _hwscreen->format->Ashift); + + // Workaround to MacOSX SDL not providing an accurate Aloss value. + if (_hwscreen->format->Amask == 0) + format.aLoss = 8; + + // Push it first, as the prefered format. + _supportedFormats.push_back(format); + } + + // TODO: prioritize matching alpha masks + int i; + + // Push some RGB formats + for (i = 0; i < ARRAYSIZE(RGBList); i++) { + if (_hwscreen && (RGBList[i].bytesPerPixel > format.bytesPerPixel)) + continue; + if (RGBList[i] != format) + _supportedFormats.push_back(RGBList[i]); + } + + // Push some BGR formats + for (i = 0; i < ARRAYSIZE(BGRList); i++) { + if (_hwscreen && (BGRList[i].bytesPerPixel > format.bytesPerPixel)) + continue; + if (BGRList[i] != format) + _supportedFormats.push_back(BGRList[i]); + } + + // Finally, we always supposed 8 bit palette graphics + _supportedFormats.push_back(Graphics::PixelFormat::createFormatCLUT8()); +} +#endif + +bool SurfaceSdlGraphicsManager::setGraphicsMode(int mode) { + Common::StackLock lock(_graphicsMutex); + + assert(_transactionMode == kTransactionActive); + + if (_oldVideoMode.setup && _oldVideoMode.mode == mode) + return true; + + int newScaleFactor = 1; + + switch (mode) { + case GFX_NORMAL: + newScaleFactor = 1; + break; +#ifdef USE_SCALERS + case GFX_DOUBLESIZE: + newScaleFactor = 2; + break; + case GFX_TRIPLESIZE: + newScaleFactor = 3; + break; + + case GFX_2XSAI: + newScaleFactor = 2; + break; + case GFX_SUPER2XSAI: + newScaleFactor = 2; + break; + case GFX_SUPEREAGLE: + newScaleFactor = 2; + break; + case GFX_ADVMAME2X: + newScaleFactor = 2; + break; + case GFX_ADVMAME3X: + newScaleFactor = 3; + break; +#ifdef USE_HQ_SCALERS + case GFX_HQ2X: + newScaleFactor = 2; + break; + case GFX_HQ3X: + newScaleFactor = 3; + break; +#endif + case GFX_TV2X: + newScaleFactor = 2; + break; + case GFX_DOTMATRIX: + newScaleFactor = 2; + break; +#endif // USE_SCALERS + + default: + warning("unknown gfx mode %d", mode); + return false; + } + + _transactionDetails.normal1xScaler = (mode == GFX_NORMAL); + if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor) + _transactionDetails.needHotswap = true; + + _transactionDetails.needUpdatescreen = true; + + _videoMode.mode = mode; + _videoMode.scaleFactor = newScaleFactor; + + return true; +} + +void SurfaceSdlGraphicsManager::setGraphicsModeIntern() { + Common::StackLock lock(_graphicsMutex); + ScalerProc *newScalerProc = 0; + + switch (_videoMode.mode) { + case GFX_NORMAL: + newScalerProc = Normal1x; + break; +#ifdef USE_SCALERS + case GFX_DOUBLESIZE: + newScalerProc = Normal2x; + break; + case GFX_TRIPLESIZE: + newScalerProc = Normal3x; + break; + + case GFX_2XSAI: + newScalerProc = _2xSaI; + break; + case GFX_SUPER2XSAI: + newScalerProc = Super2xSaI; + break; + case GFX_SUPEREAGLE: + newScalerProc = SuperEagle; + break; + case GFX_ADVMAME2X: + newScalerProc = AdvMame2x; + break; + case GFX_ADVMAME3X: + newScalerProc = AdvMame3x; + break; +#ifdef USE_HQ_SCALERS + case GFX_HQ2X: + newScalerProc = HQ2x; + break; + case GFX_HQ3X: + newScalerProc = HQ3x; + break; +#endif + case GFX_TV2X: + newScalerProc = TV2x; + break; + case GFX_DOTMATRIX: + newScalerProc = DotMatrix; + break; +#endif // USE_SCALERS + + default: + error("Unknown gfx mode %d", _videoMode.mode); + } + + _scalerProc = newScalerProc; + + if (_videoMode.mode != GFX_NORMAL) { + for (int i = 0; i < ARRAYSIZE(s_gfxModeSwitchTable); i++) { + if (s_gfxModeSwitchTable[i][1] == _videoMode.mode || s_gfxModeSwitchTable[i][2] == _videoMode.mode) { + _scalerType = i; + break; + } + } + } + + if (!_screen || !_hwscreen) + return; + + // Blit everything to the screen + _forceFull = true; + + // Even if the old and new scale factors are the same, we may have a + // different scaler for the cursor now. + blitCursor(); +} + +int SurfaceSdlGraphicsManager::getGraphicsMode() const { + assert(_transactionMode == kTransactionNone); + return _videoMode.mode; +} + +void SurfaceSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) { + assert(_transactionMode == kTransactionActive); + +#ifdef USE_RGB_COLOR + //avoid redundant format changes + Graphics::PixelFormat newFormat; + if (!format) + newFormat = Graphics::PixelFormat::createFormatCLUT8(); + else + newFormat = *format; + + assert(newFormat.bytesPerPixel > 0); + + if (newFormat != _videoMode.format) { + _videoMode.format = newFormat; + _transactionDetails.formatChanged = true; + _screenFormat = newFormat; + } +#endif + + // Avoid redundant res changes + if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight) + return; + + _videoMode.screenWidth = w; + _videoMode.screenHeight = h; + + _transactionDetails.sizeChanged = true; +} + +int SurfaceSdlGraphicsManager::effectiveScreenHeight() const { + return _videoMode.scaleFactor * + (_videoMode.aspectRatioCorrection + ? real2Aspect(_videoMode.screenHeight) + : _videoMode.screenHeight); +} + +static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &width, int &height) { + assert(&width != &height); + + if (desiredAspectRatio.isAuto()) + return; + + int kw = desiredAspectRatio.kw(); + int kh = desiredAspectRatio.kh(); + + const int w = width; + const int h = height; + + SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_SWSURFACE); //TODO : Maybe specify a pixel format + assert(availableModes); + + const SDL_Rect *bestMode = NULL; + uint bestMetric = (uint)-1; // Metric is wasted space + while (const SDL_Rect *mode = *availableModes++) { + if (mode->w < w) + continue; + if (mode->h < h) + continue; + if (mode->h * kw != mode->w * kh) + continue; + + uint metric = mode->w * mode->h - w * h; + if (metric > bestMetric) + continue; + + bestMetric = metric; + bestMode = mode; + } + + if (!bestMode) { + warning("Unable to enforce the desired aspect ratio"); + return; + } + width = bestMode->w; + height = bestMode->h; +} + +bool SurfaceSdlGraphicsManager::loadGFXMode() { + _forceFull = true; + +#if !defined(__MAEMO__) && !defined(DINGUX) && !defined(GPH_DEVICE) && !defined(LINUXMOTO) && !defined(OPENPANDORA) + _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; + + if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) + _videoMode.aspectRatioCorrection = false; + + if (_videoMode.aspectRatioCorrection) + _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); + + _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.hardwareHeight = effectiveScreenHeight(); +#else + _videoMode.hardwareWidth = _videoMode.overlayWidth; + _videoMode.hardwareHeight = _videoMode.overlayHeight; +#endif + + // + // Create the surface that contains the 8 bit game data + // +#ifdef USE_RGB_COLOR + _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, + _screenFormat.bytesPerPixel << 3, + ((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift , + ((1 << _screenFormat.gBits()) - 1) << _screenFormat.gShift , + ((1 << _screenFormat.bBits()) - 1) << _screenFormat.bShift , + ((1 << _screenFormat.aBits()) - 1) << _screenFormat.aShift ); + if (_screen == NULL) + error("allocating _screen failed"); + +#else + _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0); + if (_screen == NULL) + error("allocating _screen failed"); +#endif + + // + // Create the surface that contains the scaled graphics in 16 bit mode + // + + if (_videoMode.fullscreen) { + fixupResolutionForAspectRatio(_videoMode.desiredAspectRatio, _videoMode.hardwareWidth, _videoMode.hardwareHeight); + } + + _hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16, + _videoMode.fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE + ); +#ifdef USE_RGB_COLOR + detectSupportedFormats(); +#endif + + if (_hwscreen == NULL) { + // DON'T use error(), as this tries to bring up the debug + // console, which WON'T WORK now that _hwscreen is hosed. + + if (!_oldVideoMode.setup) { + warning("SDL_SetVideoMode says we can't switch to that mode (%s)", SDL_GetError()); + g_system->quit(); + } else { + return false; + } + } + + // + // Create the surface used for the graphics in 16 bit before scaling, and also the overlay + // + + // Need some extra bytes around when using 2xSaI + _tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth + 3, _videoMode.screenHeight + 3, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + + if (_tmpscreen == NULL) + error("allocating _tmpscreen failed"); + + _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth, _videoMode.overlayHeight, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + + if (_overlayscreen == NULL) + error("allocating _overlayscreen failed"); + + _overlayFormat.bytesPerPixel = _overlayscreen->format->BytesPerPixel; + + _overlayFormat.rLoss = _overlayscreen->format->Rloss; + _overlayFormat.gLoss = _overlayscreen->format->Gloss; + _overlayFormat.bLoss = _overlayscreen->format->Bloss; + _overlayFormat.aLoss = _overlayscreen->format->Aloss; + + _overlayFormat.rShift = _overlayscreen->format->Rshift; + _overlayFormat.gShift = _overlayscreen->format->Gshift; + _overlayFormat.bShift = _overlayscreen->format->Bshift; + _overlayFormat.aShift = _overlayscreen->format->Ashift; + + _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth + 3, _videoMode.overlayHeight + 3, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + + if (_tmpscreen2 == NULL) + error("allocating _tmpscreen2 failed"); + +#ifdef USE_OSD + _osdSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, + _hwscreen->w, + _hwscreen->h, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + if (_osdSurface == NULL) + error("allocating _osdSurface failed"); + SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey); +#endif + + _sdlEventSource->resetKeyboadEmulation( + _videoMode.screenWidth * _videoMode.scaleFactor - 1, + effectiveScreenHeight() - 1); + + // Distinguish 555 and 565 mode + if (_hwscreen->format->Rmask == 0x7C00) + InitScalers(555); + else + InitScalers(565); + + return true; +} + +void SurfaceSdlGraphicsManager::unloadGFXMode() { + if (_screen) { + SDL_FreeSurface(_screen); + _screen = NULL; + } + + if (_hwscreen) { + SDL_FreeSurface(_hwscreen); + _hwscreen = NULL; + } + + if (_tmpscreen) { + SDL_FreeSurface(_tmpscreen); + _tmpscreen = NULL; + } + + if (_tmpscreen2) { + SDL_FreeSurface(_tmpscreen2); + _tmpscreen2 = NULL; + } + + if (_overlayscreen) { + SDL_FreeSurface(_overlayscreen); + _overlayscreen = NULL; + } + +#ifdef USE_OSD + if (_osdSurface) { + SDL_FreeSurface(_osdSurface); + _osdSurface = NULL; + } +#endif + DestroyScalers(); +} + +bool SurfaceSdlGraphicsManager::hotswapGFXMode() { + if (!_screen) + return false; + + // Keep around the old _screen & _overlayscreen so we can restore the screen data + // after the mode switch. + SDL_Surface *old_screen = _screen; + _screen = NULL; + SDL_Surface *old_overlayscreen = _overlayscreen; + _overlayscreen = NULL; + + // Release the HW screen surface + SDL_FreeSurface(_hwscreen); _hwscreen = NULL; + + SDL_FreeSurface(_tmpscreen); _tmpscreen = NULL; + SDL_FreeSurface(_tmpscreen2); _tmpscreen2 = NULL; + +#ifdef USE_OSD + // Release the OSD surface + SDL_FreeSurface(_osdSurface); _osdSurface = NULL; +#endif + + // Setup the new GFX mode + if (!loadGFXMode()) { + unloadGFXMode(); + + _screen = old_screen; + _overlayscreen = old_overlayscreen; + + return false; + } + + // reset palette + SDL_SetColors(_screen, _currentPalette, 0, 256); + + // Restore old screen content + SDL_BlitSurface(old_screen, NULL, _screen, NULL); + SDL_BlitSurface(old_overlayscreen, NULL, _overlayscreen, NULL); + + // Free the old surfaces + SDL_FreeSurface(old_screen); + SDL_FreeSurface(old_overlayscreen); + + // Update cursor to new scale + blitCursor(); + + // Blit everything to the screen + internUpdateScreen(); + + return true; +} + +void SurfaceSdlGraphicsManager::updateScreen() { + assert(_transactionMode == kTransactionNone); + + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + + internUpdateScreen(); +} + +void SurfaceSdlGraphicsManager::internUpdateScreen() { + SDL_Surface *srcSurf, *origSurf; + int height, width; + ScalerProc *scalerProc; + int scale1; + + // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?) +#if defined (DEBUG) && !defined(WIN32) && !defined(_WIN32_WCE) + assert(_hwscreen != NULL); + assert(_hwscreen->map->sw_data != NULL); +#endif + + // If the shake position changed, fill the dirty area with blackness + if (_currentShakePos != _newShakePos || + (_mouseNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { + SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor}; + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + blackrect.h = real2Aspect(blackrect.h - 1) + 1; + + SDL_FillRect(_hwscreen, &blackrect, 0); + + _currentShakePos = _newShakePos; + + _forceFull = true; + } + + // Check whether the palette was changed in the meantime and update the + // screen surface accordingly. + if (_screen && _paletteDirtyEnd != 0) { + SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart, + _paletteDirtyStart, + _paletteDirtyEnd - _paletteDirtyStart); + + _paletteDirtyEnd = 0; + + _forceFull = true; + } + +#ifdef USE_OSD + // OSD visible (i.e. non-transparent)? + if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { + // Updated alpha value + const int diff = SDL_GetTicks() - _osdFadeStartTime; + if (diff > 0) { + if (diff >= kOSDFadeOutDuration) { + // Back to full transparency + _osdAlpha = SDL_ALPHA_TRANSPARENT; + } else { + // Do a linear fade out... + const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100; + _osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; + } + SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha); + _forceFull = true; + } + } +#endif + + if (!_overlayVisible) { + origSurf = _screen; + srcSurf = _tmpscreen; + width = _videoMode.screenWidth; + height = _videoMode.screenHeight; + scalerProc = _scalerProc; + scale1 = _videoMode.scaleFactor; + } else { + origSurf = _overlayscreen; + srcSurf = _tmpscreen2; + width = _videoMode.overlayWidth; + height = _videoMode.overlayHeight; + scalerProc = Normal1x; + + scale1 = 1; + } + + // Add the area covered by the mouse cursor to the list of dirty rects if + // we have to redraw the mouse. + if (_mouseNeedsRedraw) + undrawMouse(); + + // Force a full redraw if requested + if (_forceFull) { + _numDirtyRects = 1; + _dirtyRectList[0].x = 0; + _dirtyRectList[0].y = 0; + _dirtyRectList[0].w = width; + _dirtyRectList[0].h = height; + } + + // Only draw anything if necessary + if (_numDirtyRects > 0 || _mouseNeedsRedraw) { + SDL_Rect *r; + SDL_Rect dst; + uint32 srcPitch, dstPitch; + SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects; + + for (r = _dirtyRectList; r != lastRect; ++r) { + dst = *r; + dst.x++; // Shift rect by one since 2xSai needs to access the data around + dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. + + if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) + error("SDL_BlitSurface failed: %s", SDL_GetError()); + } + + SDL_LockSurface(srcSurf); + SDL_LockSurface(_hwscreen); + + srcPitch = srcSurf->pitch; + dstPitch = _hwscreen->pitch; + + for (r = _dirtyRectList; r != lastRect; ++r) { + register int dst_y = r->y + _currentShakePos; + register int dst_h = 0; + register int orig_dst_y = 0; + register int rx1 = r->x * scale1; + + if (dst_y < height) { + dst_h = r->h; + if (dst_h > height - dst_y) + dst_h = height - dst_y; + + orig_dst_y = dst_y; + dst_y = dst_y * scale1; + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + dst_y = real2Aspect(dst_y); + + assert(scalerProc != NULL); + scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, + (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); + } + + r->x = rx1; + r->y = dst_y; + r->w = r->w * scale1; + r->h = dst_h * scale1; + +#ifdef USE_SCALERS + if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible) + r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); +#endif + } + SDL_UnlockSurface(srcSurf); + SDL_UnlockSurface(_hwscreen); + + // Readjust the dirty rect list in case we are doing a full update. + // This is necessary if shaking is active. + if (_forceFull) { + _dirtyRectList[0].y = 0; + _dirtyRectList[0].h = effectiveScreenHeight(); + } + + drawMouse(); + +#ifdef USE_OSD + if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { + SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0); + } +#endif + +#ifdef USE_SDL_DEBUG_FOCUSRECT + // We draw the focus rectangle on top of everything, to assure it's easily visible. + // Of course when the overlay is visible we do not show it, since it is only for game + // specific focus. + if (_enableFocusRect && !_overlayVisible) { + int y = _focusRect.top + _currentShakePos; + int h = 0; + int x = _focusRect.left * scale1; + int w = _focusRect.width() * scale1; + + if (y < height) { + h = _focusRect.height(); + if (h > height - y) + h = height - y; + + y *= scale1; + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + y = real2Aspect(y); + + if (h > 0 && w > 0) { + SDL_LockSurface(_hwscreen); + + // Use white as color for now. + Uint32 rectColor = SDL_MapRGB(_hwscreen->format, 0xFF, 0xFF, 0xFF); + + // First draw the top and bottom lines + // then draw the left and right lines + if (_hwscreen->format->BytesPerPixel == 2) { + uint16 *top = (uint16 *)((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 2); + uint16 *bottom = (uint16 *)((byte *)_hwscreen->pixels + (y + h) * _hwscreen->pitch + x * 2); + byte *left = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 2); + byte *right = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + (x + w - 1) * 2); + + while (w--) { + *top++ = rectColor; + *bottom++ = rectColor; + } + + while (h--) { + *(uint16 *)left = rectColor; + *(uint16 *)right = rectColor; + + left += _hwscreen->pitch; + right += _hwscreen->pitch; + } + } else if (_hwscreen->format->BytesPerPixel == 4) { + uint32 *top = (uint32 *)((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 4); + uint32 *bottom = (uint32 *)((byte *)_hwscreen->pixels + (y + h) * _hwscreen->pitch + x * 4); + byte *left = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + x * 4); + byte *right = ((byte *)_hwscreen->pixels + y * _hwscreen->pitch + (x + w - 1) * 4); + + while (w--) { + *top++ = rectColor; + *bottom++ = rectColor; + } + + while (h--) { + *(uint32 *)left = rectColor; + *(uint32 *)right = rectColor; + + left += _hwscreen->pitch; + right += _hwscreen->pitch; + } + } + + SDL_UnlockSurface(_hwscreen); + } + } + } +#endif + + // Finally, blit all our changes to the screen + SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList); + } + + _numDirtyRects = 0; + _forceFull = false; + _mouseNeedsRedraw = false; +} + +bool SurfaceSdlGraphicsManager::saveScreenshot(const char *filename) { + assert(_hwscreen != NULL); + + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + return SDL_SaveBMP(_hwscreen, filename) == 0; +} + +void SurfaceSdlGraphicsManager::setFullscreenMode(bool enable) { + Common::StackLock lock(_graphicsMutex); + + if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable) + return; + + if (_transactionMode == kTransactionActive) { + _videoMode.fullscreen = enable; + _transactionDetails.needHotswap = true; + } +} + +void SurfaceSdlGraphicsManager::setAspectRatioCorrection(bool enable) { + Common::StackLock lock(_graphicsMutex); + + if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable) + return; + + if (_transactionMode == kTransactionActive) { + _videoMode.aspectRatioCorrection = enable; + _transactionDetails.needHotswap = true; + } +} + +void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) { + assert(_transactionMode == kTransactionNone); + assert(src); + + if (_screen == NULL) { + warning("SurfaceSdlGraphicsManager::copyRectToScreen: _screen == NULL"); + return; + } + + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + + assert(x >= 0 && x < _videoMode.screenWidth); + assert(y >= 0 && y < _videoMode.screenHeight); + assert(h > 0 && y + h <= _videoMode.screenHeight); + assert(w > 0 && x + w <= _videoMode.screenWidth); + + addDirtyRect(x, y, w, h); + + // Try to lock the screen surface + if (SDL_LockSurface(_screen) == -1) + error("SDL_LockSurface failed: %s", SDL_GetError()); + +#ifdef USE_RGB_COLOR + byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x * _screenFormat.bytesPerPixel; + if (_videoMode.screenWidth == w && pitch == _screen->pitch) { + memcpy(dst, src, h*pitch); + } else { + do { + memcpy(dst, src, w * _screenFormat.bytesPerPixel); + src += pitch; + dst += _screen->pitch; + } while (--h); + } +#else + byte *dst = (byte *)_screen->pixels + y * _screen->pitch + x; + if (_screen->pitch == pitch && pitch == w) { + memcpy(dst, src, h*w); + } else { + do { + memcpy(dst, src, w); + src += pitch; + dst += _screen->pitch; + } while (--h); + } +#endif + + // Unlock the screen surface + SDL_UnlockSurface(_screen); +} + +Graphics::Surface *SurfaceSdlGraphicsManager::lockScreen() { + assert(_transactionMode == kTransactionNone); + + // Lock the graphics mutex + g_system->lockMutex(_graphicsMutex); + + // paranoia check + assert(!_screenIsLocked); + _screenIsLocked = true; + + // Try to lock the screen surface + if (SDL_LockSurface(_screen) == -1) + error("SDL_LockSurface failed: %s", SDL_GetError()); + + _framebuffer.pixels = _screen->pixels; + _framebuffer.w = _screen->w; + _framebuffer.h = _screen->h; + _framebuffer.pitch = _screen->pitch; +#ifdef USE_RGB_COLOR + _framebuffer.format = _screenFormat; +#else + _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); +#endif + + return &_framebuffer; +} + +void SurfaceSdlGraphicsManager::unlockScreen() { + assert(_transactionMode == kTransactionNone); + + // paranoia check + assert(_screenIsLocked); + _screenIsLocked = false; + + // Unlock the screen surface + SDL_UnlockSurface(_screen); + + // Trigger a full screen update + _forceFull = true; + + // Finally unlock the graphics mutex + g_system->unlockMutex(_graphicsMutex); +} + +void SurfaceSdlGraphicsManager::fillScreen(uint32 col) { + Graphics::Surface *screen = lockScreen(); + if (screen && screen->pixels) + memset(screen->pixels, col, screen->h * screen->pitch); + unlockScreen(); +} + +void SurfaceSdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) { + if (_forceFull) + return; + + if (_numDirtyRects == NUM_DIRTY_RECT) { + _forceFull = true; + return; + } + + int height, width; + + if (!_overlayVisible && !realCoordinates) { + width = _videoMode.screenWidth; + height = _videoMode.screenHeight; + } else { + width = _videoMode.overlayWidth; + height = _videoMode.overlayHeight; + } + + // Extend the dirty region by 1 pixel for scalers + // that "smear" the screen, e.g. 2xSAI + if (!realCoordinates) { + x--; + y--; + w+=2; + h+=2; + } + + // clip + if (x < 0) { + w += x; + x = 0; + } + + if (y < 0) { + h += y; + y=0; + } + + if (w > width - x) { + w = width - x; + } + + if (h > height - y) { + h = height - y; + } + +#ifdef USE_SCALERS + if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) { + makeRectStretchable(x, y, w, h); + } +#endif + + if (w == width && h == height) { + _forceFull = true; + return; + } + + if (w > 0 && h > 0) { + SDL_Rect *r = &_dirtyRectList[_numDirtyRects++]; + + r->x = x; + r->y = y; + r->w = w; + r->h = h; + } +} + +int16 SurfaceSdlGraphicsManager::getHeight() { + return _videoMode.screenHeight; +} + +int16 SurfaceSdlGraphicsManager::getWidth() { + return _videoMode.screenWidth; +} + +void SurfaceSdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) { + assert(colors); + +#ifdef USE_RGB_COLOR + assert(_screenFormat.bytesPerPixel == 1); +#endif + + // Setting the palette before _screen is created is allowed - for now - + // since we don't actually set the palette until the screen is updated. + // But it could indicate a programming error, so let's warn about it. + + if (!_screen) + warning("SurfaceSdlGraphicsManager::setPalette: _screen == NULL"); + + const byte *b = colors; + uint i; + SDL_Color *base = _currentPalette + start; + for (i = 0; i < num; i++, b += 3) { + base[i].r = b[0]; + base[i].g = b[1]; + base[i].b = b[2]; + } + + if (start < _paletteDirtyStart) + _paletteDirtyStart = start; + + if (start + num > _paletteDirtyEnd) + _paletteDirtyEnd = start + num; + + // Some games blink cursors with palette + if (_cursorPaletteDisabled) + blitCursor(); +} + +void SurfaceSdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) { + assert(colors); + +#ifdef USE_RGB_COLOR + assert(_screenFormat.bytesPerPixel == 1); +#endif + + const SDL_Color *base = _currentPalette + start; + + for (uint i = 0; i < num; ++i) { + colors[i * 3] = base[i].r; + colors[i * 3 + 1] = base[i].g; + colors[i * 3 + 2] = base[i].b; + } +} + +void SurfaceSdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) { + assert(colors); + const byte *b = colors; + uint i; + SDL_Color *base = _cursorPalette + start; + for (i = 0; i < num; i++, b += 3) { + base[i].r = b[0]; + base[i].g = b[1]; + base[i].b = b[2]; + } + + _cursorPaletteDisabled = false; + blitCursor(); +} + +void SurfaceSdlGraphicsManager::setShakePos(int shake_pos) { + assert(_transactionMode == kTransactionNone); + + _newShakePos = shake_pos; +} + +void SurfaceSdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) { +#ifdef USE_SDL_DEBUG_FOCUSRECT + // Only enable focus rectangle debug code, when the user wants it + if (!_enableFocusRectDebugCode) + return; + + _enableFocusRect = true; + _focusRect = rect; + + if (rect.left < 0 || rect.top < 0 || rect.right > _videoMode.screenWidth || rect.bottom > _videoMode.screenHeight) + warning("SurfaceSdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom); + + // It's gross but we actually sometimes get rects, which are not inside the screen bounds, + // thus we need to clip the rect here... + _focusRect.clip(_videoMode.screenWidth, _videoMode.screenHeight); + + // We just fake this as a dirty rect for now, to easily force an screen update whenever + // the rect changes. + addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height()); +#endif +} + +void SurfaceSdlGraphicsManager::clearFocusRectangle() { +#ifdef USE_SDL_DEBUG_FOCUSRECT + // Only enable focus rectangle debug code, when the user wants it + if (!_enableFocusRectDebugCode) + return; + + _enableFocusRect = false; + + // We just fake this as a dirty rect for now, to easily force an screen update whenever + // the rect changes. + addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height()); +#endif +} + +#pragma mark - +#pragma mark --- Overlays --- +#pragma mark - + +void SurfaceSdlGraphicsManager::showOverlay() { + assert(_transactionMode == kTransactionNone); + + int x, y; + + if (_overlayVisible) + return; + + _overlayVisible = true; + + // Since resolution could change, put mouse to adjusted position + // Fixes bug #1349059 + x = _mouseCurState.x * _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + y = real2Aspect(_mouseCurState.y) * _videoMode.scaleFactor; + else + y = _mouseCurState.y * _videoMode.scaleFactor; + + warpMouse(x, y); + + clearOverlay(); +} + +void SurfaceSdlGraphicsManager::hideOverlay() { + assert(_transactionMode == kTransactionNone); + + if (!_overlayVisible) + return; + + int x, y; + + _overlayVisible = false; + + // Since resolution could change, put mouse to adjusted position + // Fixes bug #1349059 + x = _mouseCurState.x / _videoMode.scaleFactor; + y = _mouseCurState.y / _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + y = aspect2Real(y); + + warpMouse(x, y); + + clearOverlay(); + + _forceFull = true; +} + +void SurfaceSdlGraphicsManager::clearOverlay() { + //assert(_transactionMode == kTransactionNone); + + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + + if (!_overlayVisible) + return; + + // Clear the overlay by making the game screen "look through" everywhere. + SDL_Rect src, dst; + src.x = src.y = 0; + dst.x = dst.y = 1; + src.w = dst.w = _videoMode.screenWidth; + src.h = dst.h = _videoMode.screenHeight; + if (SDL_BlitSurface(_screen, &src, _tmpscreen, &dst) != 0) + error("SDL_BlitSurface failed: %s", SDL_GetError()); + + SDL_LockSurface(_tmpscreen); + SDL_LockSurface(_overlayscreen); + _scalerProc((byte *)(_tmpscreen->pixels) + _tmpscreen->pitch + 2, _tmpscreen->pitch, + (byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight); + +#ifdef USE_SCALERS + if (_videoMode.aspectRatioCorrection) + stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch, + _videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0); +#endif + SDL_UnlockSurface(_tmpscreen); + SDL_UnlockSurface(_overlayscreen); + + _forceFull = true; +} + +void SurfaceSdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) { + assert(_transactionMode == kTransactionNone); + + if (_overlayscreen == NULL) + return; + + if (SDL_LockSurface(_overlayscreen) == -1) + error("SDL_LockSurface failed: %s", SDL_GetError()); + + byte *src = (byte *)_overlayscreen->pixels; + int h = _videoMode.overlayHeight; + do { + memcpy(buf, src, _videoMode.overlayWidth * 2); + src += _overlayscreen->pitch; + buf += pitch; + } while (--h); + + SDL_UnlockSurface(_overlayscreen); +} + +void SurfaceSdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { + assert(_transactionMode == kTransactionNone); + + if (_overlayscreen == NULL) + return; + + // Clip the coordinates + if (x < 0) { + w += x; + buf -= x; + x = 0; + } + + if (y < 0) { + h += y; buf -= y * pitch; + y = 0; + } + + if (w > _videoMode.overlayWidth - x) { + w = _videoMode.overlayWidth - x; + } + + if (h > _videoMode.overlayHeight - y) { + h = _videoMode.overlayHeight - y; + } + + if (w <= 0 || h <= 0) + return; + + // Mark the modified region as dirty + addDirtyRect(x, y, w, h); + + if (SDL_LockSurface(_overlayscreen) == -1) + error("SDL_LockSurface failed: %s", SDL_GetError()); + + byte *dst = (byte *)_overlayscreen->pixels + y * _overlayscreen->pitch + x * 2; + do { + memcpy(dst, buf, w * 2); + dst += _overlayscreen->pitch; + buf += pitch; + } while (--h); + + SDL_UnlockSurface(_overlayscreen); +} + + +#pragma mark - +#pragma mark --- Mouse --- +#pragma mark - + +bool SurfaceSdlGraphicsManager::showMouse(bool visible) { + if (_mouseVisible == visible) + return visible; + + bool last = _mouseVisible; + _mouseVisible = visible; + _mouseNeedsRedraw = true; + + return last; +} + +void SurfaceSdlGraphicsManager::setMousePos(int x, int y) { + if (x != _mouseCurState.x || y != _mouseCurState.y) { + _mouseNeedsRedraw = true; + _mouseCurState.x = x; + _mouseCurState.y = y; + } +} + +void SurfaceSdlGraphicsManager::warpMouse(int x, int y) { + int y1 = y; + + // Don't change actual mouse position, when mouse is outside of our window (in case of windowed mode) + if (!(SDL_GetAppState( ) & SDL_APPMOUSEFOCUS)) { + setMousePos(x, y); // but change game cursor position + return; + } + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + y1 = real2Aspect(y); + + if (_mouseCurState.x != x || _mouseCurState.y != y) { + if (!_overlayVisible) + SDL_WarpMouse(x * _videoMode.scaleFactor, y1 * _videoMode.scaleFactor); + else + SDL_WarpMouse(x, y1); + + // SDL_WarpMouse() generates a mouse movement event, so + // setMousePos() would be called eventually. However, the + // cannon script in CoMI calls this function twice each time + // the cannon is reloaded. Unless we update the mouse position + // immediately the second call is ignored, causing the cannon + // to change its aim. + + setMousePos(x, y); + } +} + +void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { +#ifdef USE_RGB_COLOR + if (!format) + _cursorFormat = Graphics::PixelFormat::createFormatCLUT8(); + else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel) + _cursorFormat = *format; + + if (_cursorFormat.bytesPerPixel < 4) + assert(keycolor < (uint)(1 << (_cursorFormat.bytesPerPixel << 3))); +#else + assert(keycolor <= 0xFF); +#endif + + if (w == 0 || h == 0) + return; + + _mouseCurState.hotX = hotspot_x; + _mouseCurState.hotY = hotspot_y; + + _mouseKeyColor = keycolor; + + _cursorTargetScale = cursorTargetScale; + + if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) { + _mouseCurState.w = w; + _mouseCurState.h = h; + + if (_mouseOrigSurface) + SDL_FreeSurface(_mouseOrigSurface); + + // Allocate bigger surface because AdvMame2x adds black pixel at [0,0] + _mouseOrigSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, + _mouseCurState.w + 2, + _mouseCurState.h + 2, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + + if (_mouseOrigSurface == NULL) + error("allocating _mouseOrigSurface failed"); + SDL_SetColorKey(_mouseOrigSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey); + } + + free(_mouseData); +#ifdef USE_RGB_COLOR + _mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel); + memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel); +#else + _mouseData = (byte *)malloc(w * h); + memcpy(_mouseData, buf, w * h); +#endif + + blitCursor(); +} + +void SurfaceSdlGraphicsManager::blitCursor() { + byte *dstPtr; + const byte *srcPtr = _mouseData; +#ifdef USE_RGB_COLOR + uint32 color; +#else + byte color; +#endif + int w, h, i, j; + + if (!_mouseOrigSurface || !_mouseData) + return; + + _mouseNeedsRedraw = true; + + w = _mouseCurState.w; + h = _mouseCurState.h; + + SDL_LockSurface(_mouseOrigSurface); + + // Make whole surface transparent + for (i = 0; i < h + 2; i++) { + dstPtr = (byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch * i; + for (j = 0; j < w + 2; j++) { + *(uint16 *)dstPtr = kMouseColorKey; + dstPtr += 2; + } + } + + // Draw from [1,1] since AdvMame2x adds artefact at 0,0 + dstPtr = (byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2; + + SDL_Color *palette; + + if (_cursorPaletteDisabled) + palette = _currentPalette; + else + palette = _cursorPalette; + + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { +#ifdef USE_RGB_COLOR + if (_cursorFormat.bytesPerPixel > 1) { + if (_cursorFormat.bytesPerPixel == 2) + color = *(const uint16 *)srcPtr; + else + color = *(const uint32 *)srcPtr; + if (color != _mouseKeyColor) { // transparent, don't draw + uint8 r, g, b; + _cursorFormat.colorToRGB(color, r, g, b); + *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format, + r, g, b); + } + dstPtr += 2; + srcPtr += _cursorFormat.bytesPerPixel; + } else { +#endif + color = *srcPtr; + if (color != _mouseKeyColor) { // transparent, don't draw + *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format, + palette[color].r, palette[color].g, palette[color].b); + } + dstPtr += 2; + srcPtr++; +#ifdef USE_RGB_COLOR + } +#endif + } + dstPtr += _mouseOrigSurface->pitch - w * 2; + } + + int rW, rH; + + if (_cursorTargetScale >= _videoMode.scaleFactor) { + // The cursor target scale is greater or equal to the scale at + // which the rest of the screen is drawn. We do not downscale + // the cursor image, we draw it at its original size. It will + // appear too large on screen. + + rW = w; + rH = h; + _mouseCurState.rHotX = _mouseCurState.hotX; + _mouseCurState.rHotY = _mouseCurState.hotY; + + // The virtual dimensions may be larger than the original. + + _mouseCurState.vW = w * _cursorTargetScale / _videoMode.scaleFactor; + _mouseCurState.vH = h * _cursorTargetScale / _videoMode.scaleFactor; + _mouseCurState.vHotX = _mouseCurState.hotX * _cursorTargetScale / + _videoMode.scaleFactor; + _mouseCurState.vHotY = _mouseCurState.hotY * _cursorTargetScale / + _videoMode.scaleFactor; + } else { + // The cursor target scale is smaller than the scale at which + // the rest of the screen is drawn. We scale up the cursor + // image to make it appear correct. + + rW = w * _videoMode.scaleFactor / _cursorTargetScale; + rH = h * _videoMode.scaleFactor / _cursorTargetScale; + _mouseCurState.rHotX = _mouseCurState.hotX * _videoMode.scaleFactor / + _cursorTargetScale; + _mouseCurState.rHotY = _mouseCurState.hotY * _videoMode.scaleFactor / + _cursorTargetScale; + + // The virtual dimensions will be the same as the original. + + _mouseCurState.vW = w; + _mouseCurState.vH = h; + _mouseCurState.vHotX = _mouseCurState.hotX; + _mouseCurState.vHotY = _mouseCurState.hotY; + } + +#ifdef USE_SCALERS + int rH1 = rH; // store original to pass to aspect-correction function later +#endif + + if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) { + rH = real2Aspect(rH - 1) + 1; + _mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY); + } + + if (_mouseCurState.rW != rW || _mouseCurState.rH != rH) { + _mouseCurState.rW = rW; + _mouseCurState.rH = rH; + + if (_mouseSurface) + SDL_FreeSurface(_mouseSurface); + + _mouseSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, + _mouseCurState.rW, + _mouseCurState.rH, + 16, + _hwscreen->format->Rmask, + _hwscreen->format->Gmask, + _hwscreen->format->Bmask, + _hwscreen->format->Amask); + + if (_mouseSurface == NULL) + error("allocating _mouseSurface failed"); + + SDL_SetColorKey(_mouseSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kMouseColorKey); + } + + SDL_LockSurface(_mouseSurface); + + ScalerProc *scalerProc; + + // If possible, use the same scaler for the cursor as for the rest of + // the game. This only works well with the non-blurring scalers so we + // actually only use the 1x, 1.5x, 2x and AdvMame scalers. + + if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE)) + scalerProc = _scalerProc; + else + scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1]; + + scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2, + _mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch, + _mouseCurState.w, _mouseCurState.h); + +#ifdef USE_SCALERS + if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) + cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0); +#endif + + SDL_UnlockSurface(_mouseSurface); + SDL_UnlockSurface(_mouseOrigSurface); +} + +#ifdef USE_SCALERS +// Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from +// common/scale/aspect.cpp +static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) { + int maxDstY = real2Aspect(origSrcY + height - 1); + int y; + const uint8 *startSrcPtr = buf + srcX * 2 + (srcY - origSrcY) * pitch; + uint8 *dstPtr = buf + srcX * 2 + maxDstY * pitch; + + for (y = maxDstY; y >= srcY; y--) { + const uint8 *srcPtr = startSrcPtr + aspect2Real(y) * pitch; + + if (srcPtr == dstPtr) + break; + memcpy(dstPtr, srcPtr, width * 2); + dstPtr -= pitch; + } + + return 1 + maxDstY - srcY; +} +#endif + +void SurfaceSdlGraphicsManager::undrawMouse() { + const int x = _mouseBackup.x; + const int y = _mouseBackup.y; + + // When we switch bigger overlay off mouse jumps. Argh! + // This is intended to prevent undrawing offscreen mouse + if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) + return; + + if (_mouseBackup.w != 0 && _mouseBackup.h != 0) + addDirtyRect(x, y - _currentShakePos, _mouseBackup.w, _mouseBackup.h); +} + +void SurfaceSdlGraphicsManager::drawMouse() { + if (!_mouseVisible || !_mouseSurface) { + _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0; + return; + } + + SDL_Rect dst; + int scale; + int hotX, hotY; + + dst.x = _mouseCurState.x; + dst.y = _mouseCurState.y; + + if (!_overlayVisible) { + scale = _videoMode.scaleFactor; + dst.w = _mouseCurState.vW; + dst.h = _mouseCurState.vH; + hotX = _mouseCurState.vHotX; + hotY = _mouseCurState.vHotY; + } else { + scale = 1; + dst.w = _mouseCurState.rW; + dst.h = _mouseCurState.rH; + hotX = _mouseCurState.rHotX; + hotY = _mouseCurState.rHotY; + } + + // The mouse is undrawn using virtual coordinates, i.e. they may be + // scaled and aspect-ratio corrected. + + _mouseBackup.x = dst.x - hotX; + _mouseBackup.y = dst.y - hotY; + _mouseBackup.w = dst.w; + _mouseBackup.h = dst.h; + + // We draw the pre-scaled cursor image, so now we need to adjust for + // scaling, shake position and aspect ratio correction manually. + + if (!_overlayVisible) { + dst.y += _currentShakePos; + } + + if (_videoMode.aspectRatioCorrection && !_overlayVisible) + dst.y = real2Aspect(dst.y); + + dst.x = scale * dst.x - _mouseCurState.rHotX; + dst.y = scale * dst.y - _mouseCurState.rHotY; + dst.w = _mouseCurState.rW; + dst.h = _mouseCurState.rH; + + // Note that SDL_BlitSurface() and addDirtyRect() will both perform any + // clipping necessary + + if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0) + error("SDL_BlitSurface failed: %s", SDL_GetError()); + + // The screen will be updated using real surface coordinates, i.e. + // they will not be scaled or aspect-ratio corrected. + + addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); +} + +#pragma mark - +#pragma mark --- On Screen Display --- +#pragma mark - + +#ifdef USE_OSD +void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) { + assert(_transactionMode == kTransactionNone); + assert(msg); + + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + + uint i; + + // Lock the OSD surface for drawing + if (SDL_LockSurface(_osdSurface)) + error("displayMessageOnOSD: SDL_LockSurface failed: %s", SDL_GetError()); + + Graphics::Surface dst; + dst.pixels = _osdSurface->pixels; + dst.w = _osdSurface->w; + dst.h = _osdSurface->h; + dst.pitch = _osdSurface->pitch; + dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel, + 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss, + 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss, + _osdSurface->format->Rshift, _osdSurface->format->Gshift, + _osdSurface->format->Bshift, _osdSurface->format->Ashift); + + // The font we are going to use: + const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kLocalizedFont); + + // Clear everything with the "transparent" color, i.e. the colorkey + SDL_FillRect(_osdSurface, 0, kOSDColorKey); + + // Split the message into separate lines. + Common::Array lines; + const char *ptr; + for (ptr = msg; *ptr; ++ptr) { + if (*ptr == '\n') { + lines.push_back(Common::String(msg, ptr - msg)); + msg = ptr + 1; + } + } + lines.push_back(Common::String(msg, ptr - msg)); + + // Determine a rect which would contain the message string (clipped to the + // screen dimensions). + const int vOffset = 6; + const int lineSpacing = 1; + const int lineHeight = font->getFontHeight() + 2 * lineSpacing; + int width = 0; + int height = lineHeight * lines.size() + 2 * vOffset; + for (i = 0; i < lines.size(); i++) { + width = MAX(width, font->getStringWidth(lines[i]) + 14); + } + + // Clip the rect + if (width > dst.w) + width = dst.w; + if (height > dst.h) + height = dst.h; + + // Draw a dark gray rect + // TODO: Rounded corners ? Border? + SDL_Rect osdRect; + osdRect.x = (dst.w - width) / 2; + osdRect.y = (dst.h - height) / 2; + osdRect.w = width; + osdRect.h = height; + SDL_FillRect(_osdSurface, &osdRect, SDL_MapRGB(_osdSurface->format, 64, 64, 64)); + + // Render the message, centered, and in white + for (i = 0; i < lines.size(); i++) { + font->drawString(&dst, lines[i], + osdRect.x, osdRect.y + i * lineHeight + vOffset + lineSpacing, osdRect.w, + SDL_MapRGB(_osdSurface->format, 255, 255, 255), + Graphics::kTextAlignCenter); + } + + // Finished drawing, so unlock the OSD surface again + SDL_UnlockSurface(_osdSurface); + + // Init the OSD display parameters, and the fade out + _osdAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100; + _osdFadeStartTime = SDL_GetTicks() + kOSDFadeOutDelay; + SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha); + + // Ensure a full redraw takes place next time the screen is updated + _forceFull = true; +} +#endif + +bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) { + + // Ctrl-Alt-a toggles aspect ratio correction + if (key == 'a') { + beginGFXTransaction(); + setFeatureState(OSystem::kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection); + endGFXTransaction(); +#ifdef USE_OSD + char buffer[128]; + if (_videoMode.aspectRatioCorrection) + sprintf(buffer, "%s\n%d x %d -> %d x %d", + _("Enabled aspect ratio correction"), + _videoMode.screenWidth, _videoMode.screenHeight, + _hwscreen->w, _hwscreen->h + ); + else + sprintf(buffer, "%s\n%d x %d -> %d x %d", + _("Disabled aspect ratio correction"), + _videoMode.screenWidth, _videoMode.screenHeight, + _hwscreen->w, _hwscreen->h + ); + displayMessageOnOSD(buffer); +#endif + internUpdateScreen(); + return true; + } + + int newMode = -1; + int factor = _videoMode.scaleFactor - 1; + SDLKey sdlKey = (SDLKey)key; + + // Increase/decrease the scale factor + if (sdlKey == SDLK_EQUALS || sdlKey == SDLK_PLUS || sdlKey == SDLK_MINUS || + sdlKey == SDLK_KP_PLUS || sdlKey == SDLK_KP_MINUS) { + factor += (sdlKey == SDLK_MINUS || sdlKey == SDLK_KP_MINUS) ? -1 : +1; + if (0 <= factor && factor <= 3) { + newMode = s_gfxModeSwitchTable[_scalerType][factor]; + } + } + + const bool isNormalNumber = (SDLK_1 <= sdlKey && sdlKey <= SDLK_9); + const bool isKeypadNumber = (SDLK_KP1 <= sdlKey && sdlKey <= SDLK_KP9); + if (isNormalNumber || isKeypadNumber) { + _scalerType = sdlKey - (isNormalNumber ? SDLK_1 : SDLK_KP1); + if (_scalerType >= ARRAYSIZE(s_gfxModeSwitchTable)) + return false; + + while (s_gfxModeSwitchTable[_scalerType][factor] < 0) { + assert(factor > 0); + factor--; + } + newMode = s_gfxModeSwitchTable[_scalerType][factor]; + } + + if (newMode >= 0) { + beginGFXTransaction(); + setGraphicsMode(newMode); + endGFXTransaction(); +#ifdef USE_OSD + if (_osdSurface) { + const char *newScalerName = 0; + const OSystem::GraphicsMode *g = getSupportedGraphicsModes(); + while (g->name) { + if (g->id == _videoMode.mode) { + newScalerName = g->description; + break; + } + g++; + } + if (newScalerName) { + char buffer[128]; + sprintf(buffer, "%s %s\n%d x %d -> %d x %d", + _("Active graphics filter:"), + newScalerName, + _videoMode.screenWidth, _videoMode.screenHeight, + _hwscreen->w, _hwscreen->h + ); + displayMessageOnOSD(buffer); + } + } +#endif + internUpdateScreen(); + + return true; + } else { + return false; + } +} + +bool SurfaceSdlGraphicsManager::isScalerHotkey(const Common::Event &event) { + if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) { + const bool isNormalNumber = (Common::KEYCODE_1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_9); + const bool isKeypadNumber = (Common::KEYCODE_KP1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_KP9); + const bool isScaleKey = (event.kbd.keycode == Common::KEYCODE_EQUALS || event.kbd.keycode == Common::KEYCODE_PLUS || event.kbd.keycode == Common::KEYCODE_MINUS || + event.kbd.keycode == Common::KEYCODE_KP_PLUS || event.kbd.keycode == Common::KEYCODE_KP_MINUS); + + if (isNormalNumber || isKeypadNumber) { + int keyValue = event.kbd.keycode - (isNormalNumber ? Common::KEYCODE_1 : Common::KEYCODE_KP1); + if (keyValue >= ARRAYSIZE(s_gfxModeSwitchTable)) + return false; + } + return (isScaleKey || event.kbd.keycode == 'a'); + } + return false; +} + +void SurfaceSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { + if (!event.synthetic) { + Common::Event newEvent(event); + newEvent.synthetic = true; + if (!_overlayVisible) { + newEvent.mouse.x /= _videoMode.scaleFactor; + newEvent.mouse.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + newEvent.mouse.y = aspect2Real(newEvent.mouse.y); + } + g_system->getEventManager()->pushEvent(newEvent); + } +} + +void SurfaceSdlGraphicsManager::toggleFullScreen() { + beginGFXTransaction(); + setFullscreenMode(!_videoMode.fullscreen); + endGFXTransaction(); +#ifdef USE_OSD + if (_videoMode.fullscreen) + displayMessageOnOSD(_("Fullscreen mode")); + else + displayMessageOnOSD(_("Windowed mode")); +#endif +} + +bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) { + switch ((int)event.type) { + case Common::EVENT_KEYDOWN: + // Alt-Return and Alt-Enter toggle full screen mode + if (event.kbd.hasFlags(Common::KBD_ALT) && + (event.kbd.keycode == Common::KEYCODE_RETURN || + event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER)) { + toggleFullScreen(); + return true; + } + + // Alt-S: Create a screenshot + if (event.kbd.hasFlags(Common::KBD_ALT) && event.kbd.keycode == 's') { + char filename[20]; + + for (int n = 0;; n++) { + SDL_RWops *file; + + sprintf(filename, "scummvm%05d.bmp", n); + file = SDL_RWFromFile(filename, "r"); + if (!file) + break; + SDL_RWclose(file); + } + if (saveScreenshot(filename)) + debug("Saved screenshot '%s'", filename); + else + warning("Could not save screenshot"); + return true; + } + + // Ctrl-Alt- will change the GFX mode + if (event.kbd.hasFlags(Common::KBD_CTRL|Common::KBD_ALT)) { + if (handleScalerHotkeys(event.kbd.keycode)) + return true; + } + case Common::EVENT_KEYUP: + return isScalerHotkey(event); + case Common::EVENT_MOUSEMOVE: + if (event.synthetic) + setMousePos(event.mouse.x, event.mouse.y); + case Common::EVENT_LBUTTONDOWN: + case Common::EVENT_RBUTTONDOWN: + case Common::EVENT_WHEELUP: + case Common::EVENT_WHEELDOWN: + case Common::EVENT_MBUTTONDOWN: + case Common::EVENT_LBUTTONUP: + case Common::EVENT_RBUTTONUP: + case Common::EVENT_MBUTTONUP: + adjustMouseEvent(event); + return !event.synthetic; + + // HACK: Handle special SDL event + case OSystem_SDL::kSdlEventExpose: + _forceFull = true; + return false; + default: + break; + } + + return false; +} + +#endif diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h new file mode 100644 index 0000000000..96ba103f14 --- /dev/null +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -0,0 +1,338 @@ +/* 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 BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H +#define BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H + +#include "backends/graphics/graphics.h" +#include "graphics/pixelformat.h" +#include "graphics/scaler.h" +#include "common/events.h" +#include "common/system.h" + +#include "backends/events/sdl/sdl-events.h" + +#include "backends/platform/sdl/sdl-sys.h" + +#ifndef RELEASE_BUILD +// Define this to allow for focus rectangle debugging +#define USE_SDL_DEBUG_FOCUSRECT +#endif + +#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) +// Uncomment this to enable the 'on screen display' code. +#define USE_OSD 1 +#endif + +enum { + GFX_NORMAL = 0, + GFX_DOUBLESIZE = 1, + GFX_TRIPLESIZE = 2, + GFX_2XSAI = 3, + GFX_SUPER2XSAI = 4, + GFX_SUPEREAGLE = 5, + GFX_ADVMAME2X = 6, + GFX_ADVMAME3X = 7, + GFX_HQ2X = 8, + GFX_HQ3X = 9, + GFX_TV2X = 10, + GFX_DOTMATRIX = 11 +}; + + +class AspectRatio { + int _kw, _kh; +public: + AspectRatio() { _kw = _kh = 0; } + AspectRatio(int w, int h); + + bool isAuto() const { return (_kw | _kh) == 0; } + + int kw() const { return _kw; } + int kh() const { return _kh; } +}; + +/** + * SDL graphics manager + */ +class SurfaceSdlGraphicsManager : public GraphicsManager, public Common::EventObserver { +public: + SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource); + virtual ~SurfaceSdlGraphicsManager(); + + virtual void initEventObserver(); + + virtual bool hasFeature(OSystem::Feature f); + virtual void setFeatureState(OSystem::Feature f, bool enable); + virtual bool getFeatureState(OSystem::Feature f); + + static const OSystem::GraphicsMode *supportedGraphicsModes(); + virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const; + virtual int getDefaultGraphicsMode() const; + virtual bool setGraphicsMode(int mode); + virtual int getGraphicsMode() const; + virtual void resetGraphicsScale(); +#ifdef USE_RGB_COLOR + virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } + virtual Common::List getSupportedFormats() const; +#endif + virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL); + virtual int getScreenChangeID() const { return _screenChangeCount; } + + virtual void beginGFXTransaction(); + virtual OSystem::TransactionError endGFXTransaction(); + + virtual int16 getHeight(); + virtual int16 getWidth(); + +protected: + // PaletteManager API + virtual void setPalette(const byte *colors, uint start, uint num); + virtual void grabPalette(byte *colors, uint start, uint num); + +public: + virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); + virtual void fillScreen(uint32 col); + virtual void updateScreen(); + virtual void setShakePos(int shakeOffset); + virtual void setFocusRectangle(const Common::Rect& rect); + virtual void clearFocusRectangle(); + + virtual void showOverlay(); + virtual void hideOverlay(); + virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; } + virtual void clearOverlay(); + virtual void grabOverlay(OverlayColor *buf, int pitch); + virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); + virtual int16 getOverlayHeight() { return _videoMode.overlayHeight; } + virtual int16 getOverlayWidth() { return _videoMode.overlayWidth; } + + virtual bool showMouse(bool visible); + virtual void warpMouse(int x, int y); + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL); + virtual void setCursorPalette(const byte *colors, uint start, uint num); + +#ifdef USE_OSD + virtual void displayMessageOnOSD(const char *msg); +#endif + + // Override from Common::EventObserver + bool notifyEvent(const Common::Event &event); + +protected: + SdlEventSource *_sdlEventSource; + +#ifdef USE_OSD + /** Surface containing the OSD message */ + SDL_Surface *_osdSurface; + /** Transparency level of the OSD */ + uint8 _osdAlpha; + /** When to start the fade out */ + uint32 _osdFadeStartTime; + /** Enum with OSD options */ + enum { + kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */ + kOSDFadeOutDuration = 500, /** < Duration of the OSD fade out (in milliseconds) */ + kOSDColorKey = 1, /** < Transparent color key */ + kOSDInitialAlpha = 80 /** < Initial alpha level, in percent */ + }; +#endif + + /** Hardware screen */ + SDL_Surface *_hwscreen; + + /** Unseen game screen */ + SDL_Surface *_screen; +#ifdef USE_RGB_COLOR + Graphics::PixelFormat _screenFormat; + Graphics::PixelFormat _cursorFormat; + Common::List _supportedFormats; + + /** + * Update the list of supported pixel formats. + * This method is invoked by loadGFXMode(). + */ + void detectSupportedFormats(); +#endif + + /** Temporary screen (for scalers) */ + SDL_Surface *_tmpscreen; + /** Temporary screen (for scalers) */ + SDL_Surface *_tmpscreen2; + + SDL_Surface *_overlayscreen; + bool _overlayVisible; + Graphics::PixelFormat _overlayFormat; + + enum { + kTransactionNone = 0, + kTransactionActive = 1, + kTransactionRollback = 2 + }; + + struct TransactionDetails { + bool sizeChanged; + bool needHotswap; + bool needUpdatescreen; + bool normal1xScaler; +#ifdef USE_RGB_COLOR + bool formatChanged; +#endif + }; + TransactionDetails _transactionDetails; + + struct VideoState { + bool setup; + + bool fullscreen; + bool aspectRatioCorrection; + AspectRatio desiredAspectRatio; + + int mode; + int scaleFactor; + + int screenWidth, screenHeight; + int overlayWidth, overlayHeight; + int hardwareWidth, hardwareHeight; +#ifdef USE_RGB_COLOR + Graphics::PixelFormat format; +#endif + }; + VideoState _videoMode, _oldVideoMode; + + /** Force full redraw on next updateScreen */ + bool _forceFull; + + ScalerProc *_scalerProc; + int _scalerType; + int _transactionMode; + + bool _screenIsLocked; + Graphics::Surface _framebuffer; + + int _screenChangeCount; + + enum { + NUM_DIRTY_RECT = 100, + MAX_SCALING = 3 + }; + + // Dirty rect management + SDL_Rect _dirtyRectList[NUM_DIRTY_RECT]; + int _numDirtyRects; + + struct MousePos { + // The mouse position, using either virtual (game) or real + // (overlay) coordinates. + int16 x, y; + + // The size and hotspot of the original cursor image. + int16 w, h; + int16 hotX, hotY; + + // The size and hotspot of the pre-scaled cursor image, in real + // coordinates. + int16 rW, rH; + int16 rHotX, rHotY; + + // The size and hotspot of the pre-scaled cursor image, in game + // coordinates. + int16 vW, vH; + int16 vHotX, vHotY; + + MousePos() : x(0), y(0), w(0), h(0), hotX(0), hotY(0), + rW(0), rH(0), rHotX(0), rHotY(0), vW(0), vH(0), + vHotX(0), vHotY(0) + { } + }; + + bool _mouseVisible; + bool _mouseNeedsRedraw; + byte *_mouseData; + SDL_Rect _mouseBackup; + MousePos _mouseCurState; +#ifdef USE_RGB_COLOR + uint32 _mouseKeyColor; +#else + byte _mouseKeyColor; +#endif + int _cursorTargetScale; + bool _cursorPaletteDisabled; + SDL_Surface *_mouseOrigSurface; + SDL_Surface *_mouseSurface; + enum { + kMouseColorKey = 1 + }; + + // Shake mode + int _currentShakePos; + int _newShakePos; + + // Palette data + SDL_Color *_currentPalette; + uint _paletteDirtyStart, _paletteDirtyEnd; + + // Cursor palette data + SDL_Color *_cursorPalette; + + /** + * Mutex which prevents multiple threads from interfering with each other + * when accessing the screen. + */ + OSystem::MutexRef _graphicsMutex; + +#ifdef USE_SDL_DEBUG_FOCUSRECT + bool _enableFocusRectDebugCode; + bool _enableFocusRect; + Common::Rect _focusRect; +#endif + + virtual void addDirtyRect(int x, int y, int w, int h, bool realCoordinates = false); + + virtual void drawMouse(); + virtual void undrawMouse(); + virtual void blitCursor(); + + virtual void internUpdateScreen(); + + virtual bool loadGFXMode(); + virtual void unloadGFXMode(); + virtual bool hotswapGFXMode(); + + virtual void setFullscreenMode(bool enable); + virtual void setAspectRatioCorrection(bool enable); + + virtual int effectiveScreenHeight() const; + + virtual void setGraphicsModeIntern(); + + virtual bool handleScalerHotkeys(Common::KeyCode key); + virtual bool isScalerHotkey(const Common::Event &event); + virtual void adjustMouseEvent(const Common::Event &event); + virtual void setMousePos(int x, int y); + virtual void toggleFullScreen(); + virtual bool saveScreenshot(const char *filename); +}; + +#endif diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp index a88c8a8ffe..4a9a219641 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp @@ -28,7 +28,7 @@ #include "backends/platform/symbian/src/SymbianActions.h" SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource) { + : SurfaceSdlGraphicsManager(sdlEventSource) { } int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const { @@ -47,7 +47,7 @@ const OSystem::GraphicsMode *SymbianSdlGraphicsManager::getSupportedGraphicsMode // make sure we always go to normal, even if the string might be set wrong! bool SymbianSdlGraphicsManager::setGraphicsMode(int /*name*/) { // let parent OSystem_SDL handle it - return SdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode()); + return SurfaceSdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode()); } bool SymbianSdlGraphicsManager::hasFeature(OSystem::Feature f) { @@ -72,7 +72,7 @@ void SymbianSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) GUI::Actions::Instance()->beginMapping(enable); break; default: - SdlGraphicsManager::setFeatureState(f, enable); + SurfaceSdlGraphicsManager::setFeatureState(f, enable); } } diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h index 1bad32a9b6..404ca87a0a 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.h +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h @@ -23,9 +23,9 @@ #ifndef BACKENDS_GRAPHICS_SYMBIAN_SDL_H #define BACKENDS_GRAPHICS_SYMBIAN_SDL_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" -class SymbianSdlGraphicsManager : public SdlGraphicsManager { +class SymbianSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource); diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 8ba7b5821d..f9f963dc70 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -43,7 +43,7 @@ #include "backends/platform/wince/CEgui/ItemAction.h" WINCESdlGraphicsManager::WINCESdlGraphicsManager(SdlEventSource *sdlEventSource) - : SdlGraphicsManager(sdlEventSource), + : SurfaceSdlGraphicsManager(sdlEventSource), _panelInitialized(false), _noDoubleTapRMB(false), _toolbarHighDrawn(false), _newOrientation(0), _orientationLandscape(0), _panelVisible(true), _saveActiveToolbar(NAME_MAIN_PANEL), _panelStateForced(false), @@ -149,7 +149,7 @@ void WINCESdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) { return; default: - SdlGraphicsManager::setFeatureState(f, enable); + SurfaceSdlGraphicsManager::setFeatureState(f, enable); } } @@ -160,7 +160,7 @@ bool WINCESdlGraphicsManager::getFeatureState(OSystem::Feature f) { case OSystem::kFeatureVirtualKeyboard: return (_panelStateForced); default: - return SdlGraphicsManager::getFeatureState(f); + return SurfaceSdlGraphicsManager::getFeatureState(f); } } @@ -204,7 +204,7 @@ void WINCESdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelForm _videoMode.overlayWidth = w; _videoMode.overlayHeight = h; - SdlGraphicsManager::initSize(w, h, format); + SurfaceSdlGraphicsManager::initSize(w, h, format); if (_scalersChanged) { unloadGFXMode(); @@ -1185,7 +1185,7 @@ void WINCESdlGraphicsManager::setMousePos(int x, int y) { Graphics::Surface *WINCESdlGraphicsManager::lockScreen() { // Make sure mouse pointer is not painted over the playfield at the time of locking undrawMouse(); - return SdlGraphicsManager::lockScreen(); + return SurfaceSdlGraphicsManager::lockScreen(); } void WINCESdlGraphicsManager::showOverlay() { @@ -1293,7 +1293,7 @@ void WINCESdlGraphicsManager::warpMouse(int x, int y) { } void WINCESdlGraphicsManager::unlockScreen() { - SdlGraphicsManager::unlockScreen(); + SurfaceSdlGraphicsManager::unlockScreen(); } void WINCESdlGraphicsManager::internDrawMouse() { @@ -1468,7 +1468,7 @@ void WINCESdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool mous if (_forceFull || _paletteDirtyEnd) return; - SdlGraphicsManager::addDirtyRect(x, y, w, h, false); + SurfaceSdlGraphicsManager::addDirtyRect(x, y, w, h, false); } void WINCESdlGraphicsManager::swap_panel_visibility() { diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index 2727bc0d27..c620082b0c 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -23,7 +23,7 @@ #ifndef BACKENDS_GRAPHICS_WINCE_SDL_H #define BACKENDS_GRAPHICS_WINCE_SDL_H -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "backends/platform/wince/CEgui/CEGUI.h" // Internal GUI names @@ -39,7 +39,7 @@ extern bool _hasSmartphoneResolution; -class WINCESdlGraphicsManager : public SdlGraphicsManager { +class WINCESdlGraphicsManager : public SurfaceSdlGraphicsManager { public: WINCESdlGraphicsManager(SdlEventSource *sdlEventSource); diff --git a/backends/module.mk b/backends/module.mk index d1feae4317..8063bcf619 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -62,7 +62,7 @@ ifdef SDL_BACKEND MODULE_OBJS += \ audiocd/sdl/sdl-audiocd.o \ events/sdl/sdl-events.o \ - graphics/sdl/sdl-graphics.o \ + graphics/surfacesdl/surfacesdl-graphics.o \ mixer/doublebuffersdl/doublebuffersdl-mixer.o \ mixer/sdl/sdl-mixer.o \ mutex/sdl/sdl-mutex.o \ diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 7b24ebe753..4cca5792cb 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -38,7 +38,7 @@ #include "backends/events/sdl/sdl-events.h" #include "backends/mutex/sdl/sdl-mutex.h" #include "backends/timer/sdl/sdl-timer.h" -#include "backends/graphics/sdl/sdl-graphics.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #ifdef USE_OPENGL #include "backends/graphics/openglsdl/openglsdl-graphics.h" #endif @@ -167,7 +167,7 @@ void OSystem_SDL::initBackend() { } #endif if (_graphicsManager == 0) { - _graphicsManager = new SdlGraphicsManager(_eventSource); + _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource); graphicsManagerType = 0; } } @@ -197,7 +197,7 @@ void OSystem_SDL::initBackend() { // graphics manager as an event observer after initializing the event // manager. if (graphicsManagerType == 0) - ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); + ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver(); #ifdef USE_OPENGL else if (graphicsManagerType == 1) ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver(); @@ -480,7 +480,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) { // Check if mode is from SDL or OpenGL if (mode < _sdlModesCount) { - srcMode = SdlGraphicsManager::supportedGraphicsModes(); + srcMode = SurfaceSdlGraphicsManager::supportedGraphicsModes(); i = 0; } else { srcMode = OpenGLSdlGraphicsManager::supportedGraphicsModes(); @@ -495,8 +495,8 @@ bool OSystem_SDL::setGraphicsMode(int mode) { if (_graphicsMode >= _sdlModesCount && mode < _sdlModesCount) { debug(1, "switching to plain SDL graphics"); delete _graphicsManager; - _graphicsManager = new SdlGraphicsManager(_eventSource); - ((SdlGraphicsManager *)_graphicsManager)->initEventObserver(); + _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource); + ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver(); _graphicsManager->beginGFXTransaction(); } else if (_graphicsMode < _sdlModesCount && mode >= _sdlModesCount) { debug(1, "switching to OpenGL graphics"); @@ -522,7 +522,7 @@ int OSystem_SDL::getGraphicsMode() const { } void OSystem_SDL::setupGraphicsModes() { - const OSystem::GraphicsMode *sdlGraphicsModes = SdlGraphicsManager::supportedGraphicsModes(); + const OSystem::GraphicsMode *sdlGraphicsModes = SurfaceSdlGraphicsManager::supportedGraphicsModes(); const OSystem::GraphicsMode *openglGraphicsModes = OpenGLSdlGraphicsManager::supportedGraphicsModes(); _sdlModesCount = 0; _glModesCount = 0; -- cgit v1.2.3 From 80b336f79607ba3683f36a3fff6f39db6eef13bf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 19 Jun 2011 20:20:13 +0200 Subject: SDL: Replace some SdlGraphicsManager uses with SurfaceSdlGraphicsManager. --- backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 4 ++-- backends/graphics/gph/gph-graphics.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index d1a31869ed..8075d0d45b 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -492,11 +492,11 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) { } } -SdlGraphicsManager::MousePos* DINGUXSdlGraphicsManager::getMouseCurState() { +SurfaceSdlGraphicsManager::MousePos *DINGUXSdlGraphicsManager::getMouseCurState() { return &_mouseCurState; } -SdlGraphicsManager::VideoState* DINGUXSdlGraphicsManager::getVideoMode() { +SurfaceSdlGraphicsManager::VideoState *DINGUXSdlGraphicsManager::getVideoMode() { return &_videoMode; } diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 5c98635b71..82a32203fb 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -561,11 +561,11 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) { } } -SdlGraphicsManager::MousePos* GPHGraphicsManager::getMouseCurState() { +SurfaceSdlGraphicsManager::MousePos *GPHGraphicsManager::getMouseCurState() { return &_mouseCurState; } -SdlGraphicsManager::VideoState* GPHGraphicsManager::getVideoMode() { +SurfaceSdlGraphicsManager::VideoState *GPHGraphicsManager::getVideoMode() { return &_videoMode; } -- cgit v1.2.3 From 4c80ea38373aa766ece15d113618666b9323ced4 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 19 Jun 2011 23:27:51 +0100 Subject: I18N: Update Hungarian translation from patch #3316628 --- po/hu_HU.po | 144 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 81 insertions(+), 63 deletions(-) diff --git a/po/hu_HU.po b/po/hu_HU.po index d392369220..fbf9f3dd61 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-13 22:20+0100\n" -"PO-Revision-Date: 2011-06-12 07:17+0100\n" +"PO-Revision-Date: 2011-06-15 07:42+0100\n" "Last-Translator: Gruby \n" "Language-Team: Hungarian\n" "MIME-Version: 1.0\n" @@ -1182,6 +1182,8 @@ msgid "" "the README for basic information, and for instructions on how to obtain " "further assistance." msgstr "" +"Sajnálom, a motor jelenleg nem tartalmaz játék közbeni súgót. Olvassd el a " +"README-t az alap információkról, és hogy hogyan segíthetsz a késõbbiekben." #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 @@ -1199,21 +1201,19 @@ msgstr "Billenty #: engines/engine.cpp:220 msgid "Could not initialize color format." -msgstr "" +msgstr "Szín formátum nincs alkalmazva" #: engines/engine.cpp:228 -#, fuzzy msgid "Could not switch to video mode: '" -msgstr "Jelenlegi videómód:" +msgstr "Videómód nincs átállítva: ' " #: engines/engine.cpp:237 -#, fuzzy msgid "Could not apply aspect ratio setting." -msgstr "Méretarány korrekció engedélyezve" +msgstr "Méretarány korrekció nem változott." #: engines/engine.cpp:242 msgid "Could not apply fullscreen setting." -msgstr "" +msgstr "Teljesképernyõs beállítás nincs alkalmazva" #: engines/engine.cpp:342 msgid "" @@ -1223,6 +1223,11 @@ msgid "" "the data files to your hard disk instead.\n" "See the README file for details." msgstr "" +"Úgy néz ki, ezt a játékot CD-rõl futtatod\n" +"Ez ismert problémákat okoz, ezért\n" +"ajánlatos átmásolni a játék\n" +"adatfájljait a merevlemezedre.\n" +"Nézd meg a README fájlt a részletekért." #: engines/engine.cpp:353 msgid "" @@ -1232,6 +1237,11 @@ msgid "" "order to listen to the game's music.\n" "See the README file for details." msgstr "" +"A játékhoz audiósávok tartoznak a lemezen\n" +"ezeket a sávokat másold ki egy megfelelõ\n" +"CD audió kitömörítõ programmal\n" +"hogy a játék zenéje hallható legyen.\n" +"Nézd meg a README fájlt a részletekért." #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" @@ -1771,6 +1781,8 @@ msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" +"Native MIDI támogatáshoz kell a Roland Upgrade a LucasArts-tól,\n" +"a %s hiányzik. AdLib-ot használok helyette." #: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format @@ -1846,40 +1858,24 @@ msgstr "Vissza #: engines/agos/animation.cpp:544 #, c-format msgid "Cutscene file '%s' not found!" -msgstr "" +msgstr "'%s' átvezetõ fájl nem található" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 #: engines/tinsel/saveload.cpp:468 -#, fuzzy msgid "Failed to load game state from file." -msgstr "" -"Játékállás betöltése:\n" -"\n" -"%s fájlból nem sikerült" +msgstr "Játékállás betöltése fájlból nem sikerült." #: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 -#, fuzzy msgid "Failed to save game state to file." -msgstr "" -"Játékállás mentése:\n" -"\n" -"%s fájlba nem sikerült" +msgstr "Játékállás mentése fájlba nem sikerült." #: engines/gob/inter_v5.cpp:107 -#, fuzzy msgid "Failed to delete file." -msgstr "" -"Játékállás mentése:\n" -"\n" -"%s fájlba nem sikerült" +msgstr "Fájl törlés sikertelen." #: engines/groovie/script.cpp:417 -#, fuzzy msgid "Failed to save game" -msgstr "" -"Játékállás mentése:\n" -"\n" -"%s fájlba nem sikerült" +msgstr "Játék mentés nem sikerült" #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -1889,36 +1885,44 @@ msgid "" "General MIDI ones. After all it might happen\n" "that a few tracks will not be correctly played." msgstr "" +"Úgy néz ki egy General MIDI eszközt használsz,\n" +"a játék csak Roland MT32 MIDI eszközt támogat.\n" +"Cseréld ki Roland MT32 hangszerekre\n" +"a General MIDI-t. Különben néhány\n" +"sávot nem lehet rendesen lejátszani." #: engines/m4/m4_menus.cpp:138 -#, fuzzy msgid "Save game failed!" -msgstr "Játék mentése:" +msgstr "Játék mentése nem sikerült!" #: engines/sky/compact.cpp:130 msgid "" "Unable to find \"sky.cpt\" file!\n" "Please download it from www.scummvm.org" msgstr "" +"A \"sky.cpt\" fájl nem található!\n" +"Töltsd le a www.scummvm.org oldaláról" #: engines/sky/compact.cpp:141 msgid "" "The \"sky.cpt\" file has an incorrect size.\n" "Please (re)download it from www.scummvm.org" msgstr "" +"A \"sky.cpt\" fájl mérete nem megfelelõ.\n" +"Töltsd le a www.scummvm.org oldaláról" #: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 msgid "DXA cutscenes found but ScummVM has been built without zlib support" -msgstr "" +msgstr "DXA átvezetõ elérhetõ, de a ScummVM zlib támogatás nincs lefordítva" #: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 msgid "MPEG2 cutscenes are no longer supported" -msgstr "" +msgstr "MPEG2 átvezetõk már nem támogatottak" #: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 #, c-format msgid "Cutscene '%s' not found" -msgstr "" +msgstr "'%s' átvezetõ nem található" #: engines/sword1/control.cpp:863 msgid "" @@ -1930,6 +1934,13 @@ msgid "" "Press OK to convert them now, otherwise you will be asked again the next " "time you start the game.\n" msgstr "" +"ScummVM régi játékmentést talált a Broken Sword 1 hez, ezt át kell " +"alakítani.\n" +"A régi játékmentés nem támogatott, ezért a játék nem töltõdik be átalakítás " +"nélkül.\n" +"\n" +"Nyomj OK-t az átalakításhoz, vagy rákérdezzek ha legközelebb elindítod a " +"játékot.\n" #: engines/sword1/control.cpp:1232 #, c-format @@ -1937,18 +1948,20 @@ msgid "" "Target new save game already exists!\n" "Would you like to keep the old save game (%s) or the new one (%s)?\n" msgstr "" +"A választott játékmentés már létezik!\n" +"Megtartod a régi játékmentést (%s) vagy kicseréled az újra (%s)?\n" #: engines/sword1/control.cpp:1235 msgid "Keep the old one" -msgstr "" +msgstr "A régit megtartom" #: engines/sword1/control.cpp:1235 msgid "Keep the new one" -msgstr "" +msgstr "Az újat megtartom" #: engines/sword1/logic.cpp:1633 msgid "This is the end of the Broken Sword 1 Demo" -msgstr "" +msgstr "Ez a Broken Sword 1 Demo vége" #: engines/parallaction/saveload.cpp:133 #, c-format @@ -1956,16 +1969,16 @@ msgid "" "Can't save game in slot %i\n" "\n" msgstr "" +"Játékállás nem menthetõ %i slotba\n" +"\n" #: engines/parallaction/saveload.cpp:211 -#, fuzzy msgid "Loading game..." -msgstr "Játék betöltése:" +msgstr "Játék betöltés..." #: engines/parallaction/saveload.cpp:226 -#, fuzzy msgid "Saving game..." -msgstr "Játék mentése:" +msgstr "Játék mentés..." #: engines/parallaction/saveload.cpp:279 msgid "" @@ -1976,10 +1989,16 @@ msgid "" "\n" "Press OK to convert them now, otherwise you will be asked next time.\n" msgstr "" +"ScummVM régi játékmentést talált a Nippon Safes hez ezt át kell nevezni.\n" +"A régi játékmentés nem támogatott, ezért a játék nem töltõdik be átnevezés " +"nélkül..\n" +"\n" +"Nyomj OK-t az átalakításhoz, vagy rákérdezzek ha legközelebb elindítod a " +"játékot.\n" #: engines/parallaction/saveload.cpp:326 msgid "ScummVM successfully converted all your savefiles." -msgstr "" +msgstr "ScummVM konvertálta az összes játékállásodat." #: engines/parallaction/saveload.cpp:328 msgid "" @@ -1988,6 +2007,10 @@ msgid "" "\n" "Please report to the team." msgstr "" +"ScummVM kiírt néhány figyelmeztetést a konzolablakba és nem biztos hogy az " +"összes fájlod át lett alakítva.\n" +"\n" +"Légyszíves jelentsd a csapatnak." #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" @@ -1998,40 +2021,40 @@ msgid "DOSBox OPL emulator" msgstr "DOSBox OPL emulátor" #: audio/mididrv.cpp:204 -#, fuzzy, c-format +#, c-format msgid "" "The selected audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" -"A '%s' kiválasztott hangeszköz nem elérhetõ. Bõvebb információ a " -"naplófájlban. Következõ elérhetõ eszköz keresése..." +"A kiválasztott '%s' hangeszköz nem található. (Lekapcsoltad, vagy kihúztad). " +"A következõ elérhetõ eszköz keresése..." #: audio/mididrv.cpp:216 -#, fuzzy, c-format +#, c-format msgid "" "The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -"A '%s' kiválasztott hangeszköz nem elérhetõ. Bõvebb információ a " -"naplófájlban. Következõ elérhetõ eszköz keresése..." +"A kiválasztott '%s' hangeszköz nem használható. Bõvebb információ a " +"naplófájlban. A következõ elérhetõ eszköz keresése..." #: audio/mididrv.cpp:250 -#, fuzzy, c-format +#, c-format msgid "" "The preferred audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" -"A '%s' elsõdleges hangeszköz nem elérhetõ. Bõvebb információ a naplófájlban. " -"Következõ elérhetõ eszköz keresése..." +"Az elsõdleges '%s' hangeszköz nem található. (Lekapcsoltad, vagy kihúztad). " +"A következõ elérhetõ eszköz keresése..." #: audio/mididrv.cpp:265 -#, fuzzy, c-format +#, c-format msgid "" "The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" -"A '%s' elsõdleges hangeszköz nem elérhetõ. Bõvebb információ a naplófájlban. " -"Következõ elérhetõ eszköz keresése..." +"Az elsõdleges '%s' hangeszköz nem használható. Bõvebb információ a " +"naplófájlban. A következõ elérhetõ eszköz keresése..." #: audio/null.h:43 msgid "No music" @@ -2162,14 +2185,12 @@ msgid "Disable power off" msgstr "Leállítás tiltva" #: backends/platform/iphone/osys_events.cpp:338 -#, fuzzy msgid "Mouse-click-and-drag mode enabled." -msgstr "Touchpad mód engedélyezve." +msgstr "Egér kattint-és-húz mód engedélyezve." #: backends/platform/iphone/osys_events.cpp:340 -#, fuzzy msgid "Mouse-click-and-drag mode disabled." -msgstr "Touchpad mód letiltva." +msgstr "Egér kattint-és-húz mód letiltva." #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." @@ -2553,19 +2574,16 @@ msgstr "" "a teljes listát" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Do you really want to return to the Launcher?" -msgstr "Biztos hogy törölni akarod ezt a játékállást?" +msgstr "Biztos hogy visszatérsz az indítópulthoz?" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Launcher" -msgstr "Megüt" +msgstr "Indítópult" #: backends/events/default/default-events.cpp:244 -#, fuzzy msgid "Do you really want to quit?" -msgstr "Ki akarsz lépni ?" +msgstr "Biztos hogy ki akarsz lépni ?" #: backends/events/gph/gph-events.cpp:366 #: backends/events/gph/gph-events.cpp:409 -- cgit v1.2.3 From 3853e76202b132e769ae149720eca931cd87104a Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 19 Jun 2011 23:28:22 +0100 Subject: I18N: Regenerate translations data file --- gui/themes/translations.dat | Bin 212190 -> 215413 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index 9e5c0465d9..ae5fb480d3 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3 From 88913c0139ac6d1dfb356d3048702b7bc8ef4079 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Jun 2011 00:59:48 +0200 Subject: ALL: Remove trailing whitespaces This tries to make our code a bit more compliant with our code formatting conventions. For future use, this is the command I used: git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//' --- audio/decoders/aac.cpp | 2 +- audio/decoders/adpcm.cpp | 4 +- audio/decoders/quicktime.cpp | 4 +- audio/decoders/quicktime.h | 2 +- audio/mididrv.cpp | 6 +- audio/softsynth/fmtowns_pc98/towns_audio.cpp | 26 +- audio/softsynth/fmtowns_pc98/towns_midi.cpp | 44 +- audio/softsynth/fmtowns_pc98/towns_midi.h | 6 +- audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp | 2 +- .../softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp | 4 +- audio/softsynth/mt32.cpp | 4 +- backends/audiocd/audiocd.h | 2 +- backends/events/sdl/sdl-events.h | 4 +- backends/events/webossdl/webossdl-events.cpp | 2 +- backends/graphics/dinguxsdl/dinguxsdl-graphics.h | 2 +- backends/graphics/opengl/gltexture.cpp | 2 +- backends/graphics/opengl/opengl-graphics.cpp | 10 +- backends/graphics/opengl/opengl-graphics.h | 4 +- backends/graphics/openglsdl/openglsdl-graphics.cpp | 8 +- backends/graphics/surfacesdl/surfacesdl-graphics.h | 6 +- .../doublebuffersdl/doublebuffersdl-mixer.cpp | 2 +- backends/mixer/sdl/sdl-mixer.cpp | 2 +- backends/mixer/sdl/sdl-mixer.h | 2 +- backends/modular-backend.h | 10 +- backends/platform/dc/dcmain.cpp | 12 +- backends/platform/dc/plugins.cpp | 2 +- backends/platform/dingux/dingux.cpp | 2 +- backends/platform/ds/arm9/source/gbampsave.cpp | 4 +- backends/platform/n64/osys_n64.h | 2 +- backends/platform/n64/osys_n64_events.cpp | 2 +- backends/platform/psp/cursor.cpp | 10 +- backends/platform/psp/display_client.cpp | 32 +- backends/platform/psp/display_client.h | 10 +- backends/platform/psp/display_manager.cpp | 8 +- backends/platform/psp/display_manager.h | 6 +- backends/platform/psp/dummy.cpp | 12 +- backends/platform/psp/image_viewer.cpp | 90 +- backends/platform/psp/image_viewer.h | 28 +- backends/platform/psp/input.cpp | 32 +- backends/platform/psp/input.h | 20 +- backends/platform/psp/osys_psp.cpp | 2 +- backends/platform/psp/png_loader.cpp | 22 +- backends/platform/psp/png_loader.h | 2 +- backends/platform/psp/trace.cpp | 36 +- backends/platform/sdl/macosx/macosx.cpp | 2 +- backends/platform/sdl/sdl-sys.h | 2 +- backends/platform/sdl/sdl.cpp | 2 +- backends/platform/sdl/sdl.h | 4 +- backends/platform/symbian/src/SymbianOS.cpp | 4 +- backends/platform/wince/wince-sdl.cpp | 2 +- backends/plugins/elf/elf-loader.cpp | 26 +- backends/plugins/elf/elf-provider.cpp | 8 +- backends/plugins/elf/memory-manager.cpp | 62 +- backends/plugins/elf/memory-manager.h | 26 +- backends/plugins/elf/mips-loader.cpp | 6 +- base/main.cpp | 8 +- base/plugins.cpp | 36 +- base/plugins.h | 20 +- common/config-manager.h | 2 +- common/ptr.h | 2 +- common/quicktime.cpp | 4 +- common/winexe_ne.cpp | 2 +- common/winexe_pe.h | 2 +- devtools/create_hugo/create_hugo.cpp | 2 +- devtools/create_hugo/staticdisplay.h | 2 +- devtools/create_kyradat/extract.cpp | 2 +- devtools/create_mads/main.cpp | 4 +- devtools/create_mads/parser.cpp | 22 +- devtools/skycpt/cptcompiler.cpp | 2 +- engines/agi/agi.cpp | 2 +- engines/agi/detection.cpp | 2 +- engines/agi/sound.cpp | 2 +- engines/agi/sound_2gs.cpp | 12 +- engines/agi/sound_2gs.h | 4 +- engines/agi/sound_midi.cpp | 10 +- engines/agi/sound_pcjr.h | 4 +- engines/agi/sound_sarien.cpp | 4 +- engines/agos/string.cpp | 2 +- engines/cine/various.cpp | 2 +- engines/cruise/background.cpp | 2 +- engines/cruise/cruise_main.cpp | 2 +- engines/dialogs.cpp | 2 +- engines/drascula/detection.cpp | 2 +- engines/drascula/graphics.cpp | 4 +- engines/drascula/resource.cpp | 2 +- engines/drascula/rooms.cpp | 2 +- engines/dreamweb/detection.cpp | 2 +- engines/dreamweb/dreamgen.cpp | 1136 ++++++++++---------- engines/dreamweb/dreamweb.cpp | 12 +- engines/dreamweb/dreamweb.h | 2 +- engines/dreamweb/runtime.h | 12 +- engines/dreamweb/stubs.cpp | 2 +- engines/gob/inter_fascin.cpp | 2 +- engines/gob/video_v6.cpp | 2 +- engines/groovie/music.cpp | 8 +- engines/groovie/player.h | 4 +- engines/hugo/console.cpp | 12 +- engines/hugo/dialogs.cpp | 10 +- engines/hugo/display.cpp | 2 +- engines/hugo/hugo.cpp | 4 +- engines/hugo/hugo.h | 2 +- engines/hugo/inventory.h | 2 +- engines/hugo/object.cpp | 4 +- engines/hugo/parser.cpp | 2 +- engines/hugo/parser.h | 4 +- engines/hugo/schedule.cpp | 4 +- engines/hugo/schedule.h | 2 +- engines/hugo/sound.cpp | 4 +- engines/kyra/sequences_lol.cpp | 4 +- engines/kyra/sound_intern.h | 2 +- engines/kyra/sound_towns.cpp | 12 +- engines/lure/res_struct.h | 2 +- engines/m4/animation.cpp | 18 +- engines/m4/assets.cpp | 8 +- engines/m4/assets.h | 4 +- engines/m4/dialogs.cpp | 4 +- engines/m4/events.cpp | 2 +- engines/m4/font.h | 2 +- engines/m4/globals.cpp | 4 +- engines/m4/graphics.cpp | 12 +- engines/m4/graphics.h | 2 +- engines/m4/m4.cpp | 2 +- engines/m4/m4.h | 2 +- engines/m4/m4_views.cpp | 2 +- engines/m4/mads_anim.cpp | 2 +- engines/m4/mads_logic.cpp | 32 +- engines/m4/mads_logic.h | 4 +- engines/m4/mads_menus.cpp | 10 +- engines/m4/mads_player.cpp | 18 +- engines/m4/mads_scene.cpp | 20 +- engines/m4/mads_views.cpp | 40 +- engines/m4/mads_views.h | 12 +- engines/m4/resource.cpp | 2 +- engines/m4/resource.h | 2 +- engines/m4/scene.cpp | 6 +- engines/m4/sound.cpp | 4 +- engines/m4/sprite.cpp | 2 +- engines/made/database.cpp | 8 +- engines/mohawk/bitmap.cpp | 2 +- engines/mohawk/console.cpp | 2 +- engines/mohawk/livingbooks.h | 2 +- engines/mohawk/myst_stacks/demo.cpp | 2 +- engines/mohawk/myst_stacks/myst.cpp | 4 +- engines/mohawk/resource.cpp | 4 +- engines/mohawk/riven.cpp | 8 +- engines/mohawk/riven_external.cpp | 8 +- engines/mohawk/riven_scripts.cpp | 2 +- engines/mohawk/video.cpp | 8 +- engines/parallaction/dialogue.cpp | 28 +- engines/parallaction/exec_br.cpp | 6 +- engines/parallaction/gfxbase.cpp | 10 +- engines/parallaction/graphics.cpp | 6 +- engines/parallaction/gui_br.cpp | 4 +- engines/parallaction/gui_ns.cpp | 22 +- engines/parallaction/objects.cpp | 8 +- engines/parallaction/parallaction.cpp | 10 +- engines/parallaction/parallaction_ns.cpp | 4 +- engines/parallaction/parser_br.cpp | 4 +- engines/parallaction/parser_ns.cpp | 8 +- engines/parallaction/sound.h | 4 +- engines/parallaction/sound_ns.cpp | 8 +- engines/parallaction/walk.cpp | 6 +- engines/saga/actor.cpp | 2 +- engines/saga/actor.h | 4 +- engines/saga/animation.cpp | 4 +- engines/saga/events.cpp | 2 +- engines/saga/introproc_saga2.cpp | 2 +- engines/saga/isomap.cpp | 2 +- engines/saga/palanim.cpp | 4 +- engines/saga/saga.cpp | 2 +- engines/saga/scene.h | 2 +- engines/saga/sprite.cpp | 8 +- engines/sci/console.cpp | 18 +- engines/sci/detection_tables.h | 4 +- engines/sci/engine/features.h | 2 +- engines/sci/engine/kernel.h | 2 +- engines/sci/engine/kernel_tables.h | 6 +- engines/sci/engine/kevent.cpp | 2 +- engines/sci/engine/kfile.cpp | 6 +- engines/sci/engine/kgraphics.cpp | 12 +- engines/sci/engine/kmisc.cpp | 6 +- engines/sci/engine/kmovement.cpp | 4 +- engines/sci/engine/kpathing.cpp | 6 +- engines/sci/engine/kscripts.cpp | 2 +- engines/sci/engine/kstring.cpp | 8 +- engines/sci/engine/kvideo.cpp | 6 +- engines/sci/engine/object.cpp | 10 +- engines/sci/engine/object.h | 4 +- engines/sci/engine/savegame.h | 2 +- engines/sci/engine/script.cpp | 2 +- engines/sci/engine/script_patches.cpp | 10 +- engines/sci/engine/scriptdebug.cpp | 12 +- engines/sci/engine/segment.cpp | 2 +- engines/sci/engine/selector.cpp | 2 +- engines/sci/engine/selector.h | 2 +- engines/sci/engine/state.cpp | 4 +- engines/sci/engine/static_selectors.cpp | 8 +- engines/sci/engine/vm.cpp | 22 +- engines/sci/engine/vm_types.cpp | 12 +- engines/sci/engine/workarounds.cpp | 2 +- engines/sci/event.cpp | 4 +- engines/sci/graphics/animate.cpp | 4 +- engines/sci/graphics/compare.h | 2 +- engines/sci/graphics/coordadjuster.h | 4 +- engines/sci/graphics/menu.cpp | 4 +- engines/sci/graphics/palette.cpp | 8 +- engines/sci/graphics/palette.h | 2 +- engines/sci/graphics/picture.cpp | 6 +- engines/sci/graphics/ports.cpp | 2 +- engines/sci/graphics/view.cpp | 6 +- engines/sci/parser/said.cpp | 10 +- engines/sci/resource.cpp | 26 +- engines/sci/resource_audio.cpp | 4 +- engines/sci/sci.cpp | 6 +- engines/sci/sci.h | 4 +- engines/sci/sound/audio.cpp | 2 +- engines/sci/sound/drivers/amigamac.cpp | 6 +- engines/sci/sound/music.cpp | 4 +- engines/sci/video/robot_decoder.cpp | 24 +- engines/sci/video/seq_decoder.h | 2 +- engines/scumm/actor.cpp | 2 +- engines/scumm/charset.cpp | 2 +- engines/scumm/costume.cpp | 10 +- engines/scumm/detection.cpp | 6 +- engines/scumm/gfx.cpp | 22 +- engines/scumm/gfx.h | 10 +- engines/scumm/gfx_towns.cpp | 40 +- engines/scumm/he/logic_he.cpp | 2 +- engines/scumm/he/resource_he.cpp | 2 +- engines/scumm/he/resource_he.h | 2 +- engines/scumm/he/script_v60he.cpp | 2 +- engines/scumm/he/script_v72he.cpp | 2 +- engines/scumm/imuse/imuse.cpp | 8 +- engines/scumm/imuse/imuse_internal.h | 2 +- engines/scumm/imuse/imuse_player.cpp | 6 +- engines/scumm/imuse/sysex_scumm.cpp | 2 +- engines/scumm/player_towns.cpp | 56 +- engines/scumm/player_towns.h | 12 +- engines/scumm/saveload.cpp | 4 +- engines/scumm/script_v5.cpp | 4 +- engines/scumm/scumm.cpp | 14 +- engines/scumm/scumm.h | 8 +- engines/scumm/sound.cpp | 2 +- engines/scumm/verbs.cpp | 18 +- engines/sword1/animation.cpp | 2 +- engines/sword2/animation.cpp | 2 +- engines/sword25/gfx/animation.h | 2 +- engines/sword25/gfx/animationresource.cpp | 6 +- engines/sword25/gfx/fontresource.cpp | 2 +- engines/sword25/gfx/graphicengine.cpp | 2 +- engines/sword25/gfx/image/art.cpp | 2 +- engines/sword25/gfx/screenshot.cpp | 6 +- engines/sword25/gfx/text.cpp | 2 +- engines/sword25/kernel/persistenceservice.cpp | 2 +- engines/sword25/package/packagemanager.cpp | 2 +- engines/sword25/package/packagemanager.h | 2 +- engines/sword25/util/lua/lapi.cpp | 4 +- engines/sword25/util/lua/lauxlib.cpp | 8 +- engines/sword25/util/lua/ldblib.cpp | 2 +- engines/sword25/util/lua/ldebug.cpp | 2 +- engines/sword25/util/lua/ldo.cpp | 2 +- engines/sword25/util/lua/lgc.cpp | 4 +- engines/sword25/util/lua/liolib.cpp | 42 +- engines/sword25/util/lua/llimits.h | 4 +- engines/sword25/util/lua/loadlib.cpp | 4 +- engines/sword25/util/lua/lobject.h | 2 +- engines/sword25/util/lua/lopcodes.h | 10 +- engines/sword25/util/lua/lstate.cpp | 2 +- engines/sword25/util/lua/lstrlib.cpp | 2 +- engines/sword25/util/lua/ltable.cpp | 14 +- engines/sword25/util/lua/lua.h | 2 +- engines/sword25/util/lua/lualib.h | 2 +- engines/sword25/util/lua/lvm.cpp | 4 +- engines/sword25/util/lua/scummvm_file.cpp | 10 +- engines/teenagent/inventory.cpp | 2 +- engines/teenagent/inventory.h | 4 +- engines/teenagent/resources.h | 6 +- engines/teenagent/scene.cpp | 8 +- engines/teenagent/teenagent.cpp | 6 +- engines/testbed/config-params.h | 10 +- engines/tinsel/detection_tables.h | 6 +- engines/tinsel/pcode.cpp | 8 +- engines/tinsel/saveload.cpp | 2 +- engines/tinsel/tinlib.cpp | 42 +- engines/toon/path.cpp | 4 +- engines/toon/tools.cpp | 2 +- engines/toon/toon.cpp | 2 +- engines/toon/toon.h | 6 +- engines/tsage/blueforce_logic.cpp | 2 +- engines/tsage/debugger.cpp | 8 +- engines/tsage/dialogs.cpp | 2 +- engines/tsage/events.cpp | 4 +- engines/tsage/globals.cpp | 2 +- engines/tsage/graphics.cpp | 4 +- engines/tsage/ringworld_demo.cpp | 6 +- engines/tsage/ringworld_logic.cpp | 38 +- engines/tsage/ringworld_scenes1.cpp | 2 +- engines/tsage/ringworld_scenes1.h | 4 +- engines/tsage/ringworld_scenes3.cpp | 2 +- engines/tsage/ringworld_scenes5.cpp | 4 +- engines/tsage/sound.cpp | 104 +- engines/tsage/sound.h | 2 +- graphics/fonts/winfont.cpp | 6 +- graphics/fonts/winfont.h | 2 +- graphics/jpeg.h | 2 +- graphics/png.cpp | 6 +- graphics/sjis.cpp | 4 +- graphics/sjis.h | 2 +- graphics/surface.cpp | 2 +- graphics/surface.h | 2 +- gui/options.cpp | 10 +- video/codecs/truemotion1.cpp | 2 +- video/codecs/truemotion1.h | 4 +- video/qt_decoder.cpp | 2 +- 314 files changed, 1761 insertions(+), 1761 deletions(-) diff --git a/audio/decoders/aac.cpp b/audio/decoders/aac.cpp index 7949b5b561..874062a702 100644 --- a/audio/decoders/aac.cpp +++ b/audio/decoders/aac.cpp @@ -127,7 +127,7 @@ int AACStream::readBuffer(int16 *buffer, const int numSamples) { // Dip into our remaining samples pool if it's available if (_remainingSamples) { samples = MIN(numSamples, _remainingSamplesSize - _remainingSamplesPos); - + memcpy(buffer, _remainingSamples + _remainingSamplesPos, samples * 2); _remainingSamplesPos += samples; diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp index d28ed222a5..f75196c882 100644 --- a/audio/decoders/adpcm.cpp +++ b/audio/decoders/adpcm.cpp @@ -342,14 +342,14 @@ do { \ _topNibble = true; \ } \ } while (0) - + int DK3_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) { int samples = 0; assert((numSamples % 4) == 0); - while (samples < numSamples && !_stream->eos() && _stream->pos() < _endpos) { + while (samples < numSamples && !_stream->eos() && _stream->pos() < _endpos) { if ((_stream->pos() % _blockAlign) == 0) { _stream->readUint16LE(); // Unknown uint16 rate = _stream->readUint16LE(); // Copy of rate diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index 0f2e76658b..0ad2821cd5 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -220,7 +220,7 @@ void QuickTimeAudioDecoder::setAudioStreamPos(const Timestamp &where) { // First, we need to track down what audio sample we need Audio::Timestamp curAudioTime = where.convertToFramerate(_tracks[_audioTrackIndex]->timeScale); uint32 sample = curAudioTime.totalNumberOfFrames(); - uint32 seekSample = sample; + uint32 seekSample = sample; if (!isOldDemuxing()) { // We shouldn't have audio samples that are a different duration @@ -246,7 +246,7 @@ void QuickTimeAudioDecoder::setAudioStreamPos(const Timestamp &where) { totalSamples += chunkSampleCount; } - + // Reposition the audio stream queueNextAudioChunk(); if (sample != totalSamples) { diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h index 413f527221..9f6c6c20e0 100644 --- a/audio/decoders/quicktime.h +++ b/audio/decoders/quicktime.h @@ -45,7 +45,7 @@ namespace Common { namespace Audio { class SeekableAudioStream; - + /** * Try to load a QuickTime sound file from the given file name and create a SeekableAudioStream * from that data. diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp index 0ca70b24f8..b71c02f991 100644 --- a/audio/mididrv.cpp +++ b/audio/mididrv.cpp @@ -229,7 +229,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { if ((flags & MDT_MIDI) && !skipMidi) { // If a preferred MT32 or GM device has been selected that device gets returned if available. Common::String devStr; - if (flags & MDT_PREFER_MT32) + if (flags & MDT_PREFER_MT32) devStr = ConfMan.get("mt32_device"); else if (flags & MDT_PREFER_GM) devStr = ConfMan.get("gm_device"); @@ -261,7 +261,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { // If the preferred (expressly requested) device cannot be used we display a warning and continue. // Don't warn about the failing device if we did already (this becomes relevant if the failing // device is selected as preferred device and also as GM or MT-32 device). - if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) { + if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) { Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), getDeviceString(hdl, MidiDriver::kDeviceName).c_str()); GUI::MessageDialog dialog(warningMsg); dialog.runModal(); @@ -285,7 +285,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) { } } - // Now we default to the first available device with music type 'MT_GM' if not + // Now we default to the first available device with music type 'MT_GM' if not // MT-32 is preferred or if MT-32 is preferred but all other devices have failed. if (!(flags & MDT_PREFER_MT32) || flags == (MDT_PREFER_MT32 | MDT_MIDI)) { for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp index beee5f1cad..28591117f0 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp @@ -67,7 +67,7 @@ public: void updateEnvelopeGenerator(); - void setInstrument(uint8 *instr); + void setInstrument(uint8 *instr); void setLevel(uint8 lvl); void setPitch(uint32 pt); void setBalance(uint8 blc); @@ -272,12 +272,12 @@ private: static const uint8 _fmDefaultInstrument[]; }; -TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) : +TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) : TownsPC98_FmSynth(mixer, kTypeTowns, externalMutexHandling), _fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0), _baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _drvOwner(owner), _pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume), - _outputVolumeFlags(0), _fmChanPlaying(0), + _outputVolumeFlags(0), _fmChanPlaying(0), _numReservedChannels(0), _numWaveTables(0), _updateOutputVol(false), _ready(false) { #define INTCB(x) &TownsAudioInterfaceInternal::intf_##x @@ -431,7 +431,7 @@ void TownsAudioInterfaceInternal::releaseRef(TownsAudioInterface *owner) { return; _refCount--; - + if (_refCount) { if (_refInstance) _refInstance->removePluginDriver(owner); @@ -484,7 +484,7 @@ int TownsAudioInterfaceInternal::processCommand(int command, va_list &args) { if (command < 0 || command > 81) return 4; - + Common::StackLock lock(_mutex); int res = (this->*_intfOpcodes[command])(args); @@ -564,7 +564,7 @@ void TownsAudioInterfaceInternal::nextTickEx(int32 *buffer, uint32 bufferSize) { } finOutL += oL; finOutR += oR; - + if (!(_pcmChan[ii]._activeKey || _pcmChan[ii]._activeEffect)) _pcmChan[ii]._activeOutput = false; } @@ -996,7 +996,7 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) { if (mute & 2) memset(&_outputMute[12], 1, 4); if (mute & 1) - memset(&_outputMute[8], 1, 4); + memset(&_outputMute[8], 1, 4); _outputMute[(f < 0x80) ? 11 : 15] = 0; f += f; @@ -1009,8 +1009,8 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) { _outputMute[(f < 0x80) ? 0 : 4] = 0; f += f; _outputMute[(f < 0x80) ? 1 : 5] = 0; - f += f; - + f += f; + updateOutputVolume(); return 0; } @@ -1581,7 +1581,7 @@ void TownsAudio_PcmChannel::clear() { _envTotalLevel = _envAttackRate = _envDecayRate = _envSustainLevel = _envSustainRate = _envReleaseRate = 0; _envStep = _envCurrentLevel = 0; - _envState = kEnvReady; + _envState = kEnvReady; _activeKey = _activeEffect = _activeOutput = _keyPressed = _reserved = false; @@ -1650,7 +1650,7 @@ void TownsAudio_PcmChannel::keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable * _activeEffect = true; else _keyPressed = _activeKey = true; - + _activeOutput = true; } @@ -1742,7 +1742,7 @@ void TownsAudio_PcmChannel::setBalance(uint8 blc) { void TownsAudio_PcmChannel::updateOutput() { if (_activeKey || _activeEffect) { _pos += _step; - + if (&_data[_pos >> 11] >= _loopEnd) { if (_loopLen) { _pos -= _loopLen; @@ -1811,7 +1811,7 @@ void TownsAudio_PcmChannel::setVelo(uint8 velo) { _envTotalLevel = ((_envTotalLevel * lvl) >> 14) & 0xff; _envSustainLevel = ((_envSustainLevel * lvl) >> 14) & 0xff; envAttack(); - _tl = (_envCurrentLevel >> 8) << 1; + _tl = (_envCurrentLevel >> 8) << 1; } } diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp index 071a697615..e415a0dda5 100644 --- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp @@ -36,7 +36,7 @@ public: void setupProgram(const uint8 *data, uint8 mLevelPara, uint8 tLevelPara); void setupEffects(int index, uint8 flags, const uint8 *effectData); void setModWheel(uint8 value); - + void connect(TownsMidiInputChannel *chan); void disconnect(); @@ -100,7 +100,7 @@ private: uint8 _operator1Tl; uint8 _sustainNoteOff; int16 _duration; - + uint16 _freq; int16 _freqAdjust; @@ -134,7 +134,7 @@ public: void controlChange(byte control, byte value); void pitchBendFactor(byte value); void priority(byte value); - void sysEx_customInstrument(uint32 type, const byte *instr); + void sysEx_customInstrument(uint32 type, const byte *instr); private: void controlModulationWheel(byte value); @@ -145,7 +145,7 @@ private: void releasePedal(); TownsMidiOutputChannel *_out; - + uint8 *_instrument; uint8 _prg; uint8 _chanIndex; @@ -175,7 +175,7 @@ private: class TownsMidiChanState { public: TownsMidiChanState(); - ~TownsMidiChanState() {} + ~TownsMidiChanState() {} uint8 get(uint8 type); uint8 unk1; @@ -247,7 +247,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u // music (unsuitable data is just forced into the wrong audio device). static const uint8 mul[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 12, 12, 15, 15 }; - uint8 chan = _chanMap[_chan]; + uint8 chan = _chanMap[_chan]; uint8 mulAmsFms1 = _driver->_chanState[chan].mulAmsFms = data[0]; uint8 tl1 = _driver->_chanState[chan].tl = (data[1] | 0x3f) - mLevelPara; @@ -296,7 +296,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u void TownsMidiOutputChannel::setupEffects(int index, uint8 flags, const uint8 *effectData) { uint16 effectMaxLevel[] = { 0x2FF, 0x1F, 0x07, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3E, 0x1F }; uint8 effectType[] = { 0x1D, 0x1C, 0x1B, 0x00, 0x03, 0x04, 0x07, 0x08, 0x0D, 0x10, 0x11, 0x14, 0x15, 0x1e, 0x1f, 0x00 }; - + EffectEnvelope *s = &_effectEnvelopes[index]; EffectDef *d = &_effectDefs[index]; @@ -354,7 +354,7 @@ void TownsMidiOutputChannel::connect(TownsMidiInputChannel *chan) { void TownsMidiOutputChannel::disconnect() { keyOff(); - + TownsMidiOutputChannel *p = _prev; TownsMidiOutputChannel *n = _next; @@ -448,10 +448,10 @@ int TownsMidiOutputChannel::advanceEffectEnvelope(EffectEnvelope *s, EffectDef * s->state = kEnvReady; return 0; } - } + } int32 t = s->currentLevel + s->incrPerStep; - + s->incrCountRem += s->incrPerStepRem; if (s->incrCountRem >= s->numSteps) { s->incrCountRem -= s->numSteps; @@ -492,7 +492,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) { if (v & 0x80) e = _driver->randomValue(e); - + if (!e) e = 1; @@ -525,7 +525,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) { int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) { uint8 chan = (type < 13) ? _chanMap2[_chan] : ((type < 26) ? _chanMap[_chan] : _chan); - + if (type == 28) return 15; else if (type == 29) @@ -539,8 +539,8 @@ int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) { uint8 res = (_driver->_chanState[chan].get(def[0] >> 5) & def[2]) >> def[1]; if (def[3]) res = def[3] - res; - - return res; + + return res; } int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) { @@ -554,12 +554,12 @@ int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) { return ((lvl + 1) * mod) >> 5; if (mod < 0) { - if (lvl < 0) + if (lvl < 0) return _driver->_operatorLevelTable[((-lvl) << 5) - mod]; else return -_driver->_operatorLevelTable[(lvl << 5) - mod]; } else { - if (lvl < 0) + if (lvl < 0) return -_driver->_operatorLevelTable[((-lvl) << 5) + mod]; else return _driver->_operatorLevelTable[((-lvl) << 5) + mod]; @@ -577,7 +577,7 @@ void TownsMidiOutputChannel::keyOff() { } void TownsMidiOutputChannel::keyOnSetFreq(uint16 frq) { - uint16 note = (frq << 1) >> 8; + uint16 note = (frq << 1) >> 8; frq = (_freqMSB[note] << 11) | _freqLSB[note] ; out(0xa4, frq >> 8); out(0xa0, frq & 0xff); @@ -701,7 +701,7 @@ void TownsMidiInputChannel::noteOff(byte note) { void TownsMidiInputChannel::noteOn(byte note, byte velocity) { TownsMidiOutputChannel *oc = _driver->allocateOutputChannel(_priority); - + if (!oc) return; @@ -711,7 +711,7 @@ void TownsMidiInputChannel::noteOn(byte note, byte velocity) { oc->_note = note; oc->_sustainNoteOff = 0; oc->_duration = _instrument[29] * 63; - + oc->_operator1Tl = (_instrument[1] & 0x3f) + _driver->_operatorLevelTable[((velocity >> 1) << 5) + (_instrument[4] >> 2)]; if (oc->_operator1Tl > 63) oc->_operator1Tl = 63; @@ -840,7 +840,7 @@ MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerP _channels = new TownsMidiInputChannel*[32]; for (int i = 0; i < 32; i++) _channels[i] = new TownsMidiInputChannel(this, i > 8 ? (i + 1) : i); - + _out = new TownsMidiOutputChannel*[6]; for (int i = 0; i < 6; i++) _out[i] = new TownsMidiOutputChannel(this, i); @@ -964,7 +964,7 @@ MidiChannel *MidiDriver_TOWNS::allocateChannel() { if (!_isOpen) return 0; - for (int i = 0; i < 32; ++i) { + for (int i = 0; i < 32; ++i) { TownsMidiInputChannel *chan = _channels[i]; if (chan->allocate()) return chan; @@ -1023,7 +1023,7 @@ TownsMidiOutputChannel *MidiDriver_TOWNS::allocateOutputChannel(uint8 pri) { res = _out[_allocCurPos]; } } - + if (res) res->disconnect(); diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.h b/audio/softsynth/fmtowns_pc98/towns_midi.h index 9aa7c93b35..8c764c55d9 100644 --- a/audio/softsynth/fmtowns_pc98/towns_midi.h +++ b/audio/softsynth/fmtowns_pc98/towns_midi.h @@ -57,7 +57,7 @@ private: void updateOutputChannels(); TownsMidiOutputChannel *allocateOutputChannel(uint8 pri); - + int randomValue(int para); TownsMidiInputChannel **_channels; @@ -72,11 +72,11 @@ private: uint32 _tickCounter; uint8 _allocCurPos; uint8 _rand; - + bool _isOpen; uint8 *_operatorLevelTable; - + const uint16 _baseTempo; }; diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp index 49fe97caf1..001d258873 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp @@ -1265,7 +1265,7 @@ void TownsPC98_AudioDriver::fadeStep() { void TownsPC98_AudioDriver::pause() { _musicPlaying = false; } - + void TownsPC98_AudioDriver::cont() { _musicPlaying = true; } diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp index 63007ba93c..b4967a556f 100644 --- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp @@ -1160,12 +1160,12 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { for (int i = 0; i < 2; i++) { if (_timers[i].enabled && _timers[i].cb) { if (!_timers[i].smpTillCb) { - + if (locked && _externalMutex) { _mutex.unlock(); locked = false; } - + (this->*_timers[i].cb)(); if (!locked && _externalMutex) { diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp index 6d13ec33b4..6703a6f7b7 100644 --- a/audio/softsynth/mt32.cpp +++ b/audio/softsynth/mt32.cpp @@ -564,8 +564,8 @@ bool MT32EmuMusicPlugin::checkDevice(MidiDriver::DeviceHandle) const { warning("The MT-32 emulator requires one of the two following file sets (not bundled with ScummVM):\n Either 'MT32_CONTROL.ROM' and 'MT32_PCM.ROM' or 'CM32L_CONTROL.ROM' and 'CM32L_PCM.ROM'"); return false; } - - return true; + + return true; } Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const { diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h index 92b7598cb5..0afc6af991 100644 --- a/backends/audiocd/audiocd.h +++ b/backends/audiocd/audiocd.h @@ -113,7 +113,7 @@ public: * @return true if the CD drive was inited succesfully */ virtual bool openCD(int drive) = 0; - + /** * Poll CD status. * @return true if CD audio is playing diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h index 9b9d265970..805b76b108 100644 --- a/backends/events/sdl/sdl-events.h +++ b/backends/events/sdl/sdl-events.h @@ -32,7 +32,7 @@ * The SDL event source. */ class SdlEventSource : public Common::EventSource { -public: +public: SdlEventSource(); virtual ~SdlEventSource(); @@ -69,7 +69,7 @@ protected: /** Scroll lock state - since SDL doesn't track it */ bool _scrollLock; - + /** Joystick */ SDL_Joystick *_joystick; diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 4a17bc2066..102eb5802e 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -89,7 +89,7 @@ void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, event.kbd.flags |= Common::KBD_SHIFT; if (mod & KMOD_CTRL) event.kbd.flags |= Common::KBD_CTRL; - + // Holding down the gesture area emulates the ALT key if (gestureDown) event.kbd.flags |= Common::KBD_ALT; diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index d24e72f63e..84a784b771 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -25,7 +25,7 @@ #include "backends/graphics/surfacesdl/surfacesdl-graphics.h" -#include "graphics/scaler/aspect.h" // for aspect2Real +#include "graphics/scaler/aspect.h" // for aspect2Real #include "graphics/scaler/downscaler.h" enum { diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp index 3d1027b44f..b7f5c90105 100644 --- a/backends/graphics/opengl/gltexture.cpp +++ b/backends/graphics/opengl/gltexture.cpp @@ -108,7 +108,7 @@ void GLTexture::refresh() { void GLTexture::allocBuffer(GLuint w, GLuint h) { _realWidth = w; _realHeight = h; - + if (w <= _textureWidth && h <= _textureHeight && !_refresh) // Already allocated a sufficiently large buffer return; diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 4c2c70daf2..046be4c669 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -642,7 +642,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) { assert(colors); - + // Save the cursor palette memcpy(_cursorPalette + start * 3, colors, num * 3); @@ -1315,7 +1315,7 @@ bool OpenGLGraphicsManager::notifyEvent(const Common::Event &event) { bool OpenGLGraphicsManager::saveScreenshot(const char *filename) { int width = _videoMode.hardwareWidth; int height = _videoMode.hardwareHeight; - + // A line of a BMP image must have a size divisible by 4. // We calculate the padding bytes needed here. // Since we use a 3 byte per pixel mode, we can use width % 4 here, since @@ -1358,7 +1358,7 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) { out.writeUint32LE(0); out.writeUint32LE(0); out.writeUint32LE(0); - out.writeUint32LE(0); + out.writeUint32LE(0); // Write pixel data to BMP out.write(pixels, lineSize * height); @@ -1423,9 +1423,9 @@ void OpenGLGraphicsManager::updateOSD() { dstX, dstY + i * lineHeight + vOffset + lineSpacing, width, 0xFFFF, Graphics::kTextAlignCenter); } - + // Update the texture - _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0, + _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0, _osdSurface.w, _osdSurface.h); } #endif diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 463715aad8..56f7d92a12 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -185,7 +185,7 @@ protected: /** * Set the scale factor. - * + * * This can only be used in a GFX transaction. * * @param newScale New scale factor. @@ -332,7 +332,7 @@ protected: GLTexture *_osdTexture; Graphics::Surface _osdSurface; uint8 _osdAlpha; - uint32 _osdFadeStartTime; + uint32 _osdFadeStartTime; bool _requireOSDUpdate; enum { kOSDFadeOutDelay = 2 * 1000, diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index eefba59089..bd7dd32e3b 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -306,7 +306,7 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() { int screenAspectRatio = _videoMode.screenWidth * 10000 / _videoMode.screenHeight; int desiredAspectRatio = getAspectRatio(); - + // Do not downscale dimensions, only enlarge them if needed if (screenAspectRatio > desiredAspectRatio) _videoMode.hardwareHeight = (_videoMode.overlayWidth * 10000 + 5000) / desiredAspectRatio; @@ -389,7 +389,7 @@ void OpenGLSdlGraphicsManager::internUpdateScreen() { OpenGLGraphicsManager::internUpdateScreen(); // Swap OpenGL buffers - SDL_GL_SwapBuffers(); + SDL_GL_SwapBuffers(); } #ifdef USE_OSD @@ -561,7 +561,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { // Check if the desktop resolution has been detected if (_desktopWidth > 0 && _desktopHeight > 0) // If the new scale factor is too big, do not scale - if (_videoMode.screenWidth * factor > _desktopWidth || + if (_videoMode.screenWidth * factor > _desktopWidth || _videoMode.screenHeight * factor > _desktopHeight) return false; @@ -611,7 +611,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { break; case Common::EVENT_KEYUP: return isHotkey(event); - // HACK: Handle special SDL event + // HACK: Handle special SDL event // The new screen size is saved on the mouse event as part of HACK, // there is no common resize event. case OSystem_SDL::kSdlEventResize: diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h index 96ba103f14..cd8710d443 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.h +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -100,7 +100,7 @@ public: virtual void beginGFXTransaction(); virtual OSystem::TransactionError endGFXTransaction(); - + virtual int16 getHeight(); virtual int16 getWidth(); @@ -132,7 +132,7 @@ public: virtual void warpMouse(int x, int y); virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL); virtual void setCursorPalette(const byte *colors, uint start, uint num); - + #ifdef USE_OSD virtual void displayMessageOnOSD(const char *msg); #endif @@ -149,7 +149,7 @@ protected: /** Transparency level of the OSD */ uint8 _osdAlpha; /** When to start the fade out */ - uint32 _osdFadeStartTime; + uint32 _osdFadeStartTime; /** Enum with OSD options */ enum { kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */ diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp index 001389b1c0..3e5b9940e0 100644 --- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp +++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp @@ -28,7 +28,7 @@ DoubleBufferSDLMixerManager::DoubleBufferSDLMixerManager() : _soundMutex(0), _soundCond(0), _soundThread(0), _soundThreadIsRunning(false), _soundThreadShouldQuit(false) { - + } DoubleBufferSDLMixerManager::~DoubleBufferSDLMixerManager() { diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index 979b18e264..001309a777 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -70,7 +70,7 @@ void SdlMixerManager::init() { warning("Could not open audio device: %s", SDL_GetError()); _mixer = new Audio::MixerImpl(g_system, desired.freq); - assert(_mixer); + assert(_mixer); _mixer->setReady(false); } else { debug(1, "Output sample rate: %d Hz", _obtained.freq); diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h index 82ffa4f901..6fee26bd1f 100644 --- a/backends/mixer/sdl/sdl-mixer.h +++ b/backends/mixer/sdl/sdl-mixer.h @@ -73,7 +73,7 @@ protected: bool _audioSuspended; /** - * Returns the desired audio specification + * Returns the desired audio specification */ virtual SDL_AudioSpec getAudioSpec(uint32 rate); diff --git a/backends/modular-backend.h b/backends/modular-backend.h index 3593130bf5..b864da0df5 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -30,17 +30,17 @@ class MutexManager; /** * Base class for modular backends. - * + * * It wraps most functions to their manager equivalent, but not * all OSystem functions are implemented here. - * + * * A backend derivated from this class, will need to implement * these functions on its own: * OSystem::pollEvent() * OSystem::getMillis() * OSystem::delayMillis() * OSystem::getTimeAndDate() - * + * * And, it should also initialize all the managers variables * declared in this class, or override their related functions. */ @@ -107,11 +107,11 @@ public: /** @name Events and Time */ //@{ - + virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; } //@} - + /** @name Mutex handling */ //@{ diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index 3faf0185ad..06738a687d 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -234,7 +234,7 @@ void OSystem_Dreamcast::logMessage(LogMessageType::Type type, const char *messag namespace DC_Flash { static int syscall_info_flash(int sect, int *info) { - return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0); + return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0); } static int syscall_read_flash(int offs, void *buf, int cnt) @@ -255,24 +255,24 @@ namespace DC_Flash { } return (unsigned short)~n; } - + static int flash_read_sector(int partition, int sec, unsigned char *dst) { int s, r, n, b, bmb, got=0; int info[2]; char buf[64]; char bm[64]; - + if((r = syscall_info_flash(partition, info))<0) return r; - + if((r = syscall_read_flash(info[0], buf, 64))<0) return r; - + if(memcmp(buf, "KATANA_FLASH", 12) || buf[16] != partition || buf[17] != 0) return -2; - + n = (info[1]>>6)-1-((info[1] + 0x7fff)>>15); bmb = n+1; for(b = 0; b < n; b++) { diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp index fff3c147ec..2942a4f155 100644 --- a/backends/platform/dc/plugins.cpp +++ b/backends/platform/dc/plugins.cpp @@ -51,7 +51,7 @@ static void drawPluginProgress(const Common::String &filename) ta_begin_frame(); draw_solid_quad(80.0, 270.0, 560.0, 300.0, 0xff808080, 0xff808080, 0xff808080, 0xff808080); - draw_solid_quad(85.0, 275.0, 555.0, 295.0, + draw_solid_quad(85.0, 275.0, 555.0, 295.0, 0xff202020, 0xff202020, 0xff202020, 0xff202020); draw_solid_quad(85.0, 275.0, 85.0+470.0*ffree, 295.0, fcol, fcol, fcol, fcol); diff --git a/backends/platform/dingux/dingux.cpp b/backends/platform/dingux/dingux.cpp index 1af53aeae1..674c2ea780 100644 --- a/backends/platform/dingux/dingux.cpp +++ b/backends/platform/dingux/dingux.cpp @@ -33,7 +33,7 @@ void OSystem_SDL_Dingux::initBackend() { // Create the graphics manager if (_graphicsManager == 0) { - _graphicsManager = new DINGUXSdlGraphicsManager(_eventSource); + _graphicsManager = new DINGUXSdlGraphicsManager(_eventSource); } // Call parent implementation of this method diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index db9b1c2609..03729c5e6e 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -52,7 +52,7 @@ Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &f fileSpec += filename; // consolePrintf("Opening the file: %s\n", fileSpec.c_str()); - + Common::WriteStream *stream = DS::DSFileStream::makeFromPath(fileSpec, true); // Use a write buffer stream = Common::wrapBufferedWriteStream(stream, SAVE_BUFFER_SIZE); @@ -66,7 +66,7 @@ Common::InSaveFile *GBAMPSaveFileManager::openForLoading(const Common::String &f fileSpec += filename; // consolePrintf("Opening the file: %s\n", fileSpec.c_str()); - + return DS::DSFileStream::makeFromPath(fileSpec, false); } diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index 285e2afa55..354f25a1cf 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -107,7 +107,7 @@ protected: // FIXME: This must be left as "int" for now, to fix the sign-comparison problem // there is a little more work involved than an int->uint change int _cursorWidth, _cursorHeight; - + int _cursorKeycolor; uint16 _overlayHeight, _overlayWidth; diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp index 2645cfea2a..62f11aef64 100644 --- a/backends/platform/n64/osys_n64_events.cpp +++ b/backends/platform/n64/osys_n64_events.cpp @@ -162,7 +162,7 @@ bool OSystem_N64::pollEvent(Common::Event &event) { uint16 newButtons = 0; if (_controllerPort >= 0) newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller - + uint16 newMouseButtons = 0; if (_mousePort >= 0) newMouseButtons = _ctrlData.c[_mousePort].buttons; diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp index 18a61f3df4..b295507de1 100644 --- a/backends/platform/psp/cursor.cpp +++ b/backends/platform/psp/cursor.cpp @@ -324,18 +324,18 @@ inline void Cursor::setRendererModePalettized(bool palettized) { _renderer.setAlphaReverse(false); _renderer.setColorTest(false); } else { // 16 bits, no palette - // Color test is an easy way for the hardware to make our keycolor + // Color test is an easy way for the hardware to make our keycolor // transparent. - _renderer.setColorTest(true); - + _renderer.setColorTest(true); + // Alpha blending is not strictly required, but makes the cursor look // much better _renderer.setAlphaBlending(true); - + // Pixel formats without alpha (5650) are considered to have their alpha set. // Since pixel formats with alpha don't have their alpha bits set, we reverse // the alpha format for them so that 0 alpha is 1. - if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650) + if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650) _renderer.setAlphaReverse(true); else _renderer.setAlphaReverse(false); diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp index 14b96d9cae..bc29166895 100644 --- a/backends/platform/psp/display_client.cpp +++ b/backends/platform/psp/display_client.cpp @@ -389,31 +389,31 @@ void Buffer::copyToArray(byte *dst, int pitch) { void Buffer::setSize(uint32 width, uint32 height, HowToSize textureOrSource/*=kSizeByTextureSize*/) { DEBUG_ENTER_FUNC(); - + // We can size the buffer either by texture size (multiple of 2^n) or source size. // At higher sizes, increasing the texture size to 2^n is a waste of space. At these sizes kSizeBySourceSize should be used. - + _sourceSize.width = width; _sourceSize.height = height; _textureSize.width = scaleUpToPowerOfTwo(width); // can only scale up to 512 _textureSize.height = scaleUpToPowerOfTwo(height); - + if (textureOrSource == kSizeByTextureSize) { _width = _textureSize.width; _height = _textureSize.height; } else { // sizeBySourceSize _width = _sourceSize.width; _height = _sourceSize.height; - - // adjust allocated width to be divisible by 32. + + // adjust allocated width to be divisible by 32. // The GU can only handle multiples of 16 bytes. A 4 bit image x 32 will give us 16 bytes // We don't necessarily know the depth of the pixels here. So just make it divisible by 32. uint32 checkDiv = _width & 31; if (checkDiv) _width += 32 - checkDiv; } - + PSP_DEBUG_PRINT("width[%u], height[%u], texW[%u], texH[%u], sourceW[%d], sourceH[%d] %s\n", _width, _height, _textureSize.width, _textureSize.height, _sourceSize.width, _sourceSize.height, textureOrSource ? "size by source" : "size by texture"); } @@ -558,10 +558,10 @@ void GuRenderer::render() { // Loop over patches of 512x512 pixel textures and draw them for (uint32 j = 0; j < _buffer->getSourceHeight(); j += 512) { _textureLoadOffset.y = j; - + for (uint32 i = 0; i < _buffer->getSourceWidth(); i += 512) { _textureLoadOffset.x = i; - + guLoadTexture(); Vertex *vertices = guGetVertices(); fillVertices(vertices); @@ -573,8 +573,8 @@ void GuRenderer::render() { inline void GuRenderer::guProgramDrawBehavior() { DEBUG_ENTER_FUNC(); - PSP_DEBUG_PRINT("blending[%s] colorTest[%s] reverseAlpha[%s] keyColor[%u]\n", - _blending ? "on" : "off", _colorTest ? "on" : "off", + PSP_DEBUG_PRINT("blending[%s] colorTest[%s] reverseAlpha[%s] keyColor[%u]\n", + _blending ? "on" : "off", _colorTest ? "on" : "off", _alphaReverse ? "on" : "off", _keyColor); if (_blending) { @@ -591,7 +591,7 @@ inline void GuRenderer::guProgramDrawBehavior() { if (_colorTest) { sceGuEnable(GU_COLOR_TEST); sceGuColorFunc(GU_NOTEQUAL, // show only colors not equal to this color - _keyColor, + _keyColor, 0x00ffffff); // match everything but alpha } else sceGuDisable(GU_COLOR_TEST); @@ -663,10 +663,10 @@ inline void GuRenderer::guLoadTexture() { byte *startPoint = _buffer->getPixels(); if (_textureLoadOffset.x) startPoint += _buffer->_pixelFormat.pixelsToBytes(_textureLoadOffset.x); - if (_textureLoadOffset.y) + if (_textureLoadOffset.y) startPoint += _buffer->getWidthInBytes() * _textureLoadOffset.y; - - sceGuTexImage(0, + + sceGuTexImage(0, _buffer->getTextureWidth(), // texture width (must be power of 2) _buffer->getTextureHeight(), // texture height (must be power of 2) _buffer->getWidth(), // width of a line of the image (to get to the next line) @@ -698,7 +698,7 @@ void GuRenderer::fillVertices(Vertex *vertices) { // These coordinates describe an area within the texture. ie. we already loaded a square of texture, // now the coordinates within it are 0 to the edge of the area of the texture we want to draw float textureStartX = textureFix + _offsetInBuffer.x; - float textureStartY = textureFix + _offsetInBuffer.y; + float textureStartY = textureFix + _offsetInBuffer.y; int textureLeftX = _drawSize.width - _textureLoadOffset.x; if (textureLeftX > 512) @@ -720,7 +720,7 @@ void GuRenderer::fillVertices(Vertex *vertices) { float imageStartY = gapY + scaledOffsetOnScreenY + (scaleSourceToOutput(false, stretch(false, _textureLoadOffset.y))); float imageEndX, imageEndY; - + imageEndX = imageStartX + scaleSourceToOutput(true, stretch(true, textureLeftX)); imageEndY = imageStartY + scaleSourceToOutput(false, stretch(false, textureLeftY)); diff --git a/backends/platform/psp/display_client.h b/backends/platform/psp/display_client.h index f190658a26..e384bfb82b 100644 --- a/backends/platform/psp/display_client.h +++ b/backends/platform/psp/display_client.h @@ -171,12 +171,12 @@ protected: class GuRenderer { public: // Constructors - GuRenderer() : _useGlobalScaler(false), _buffer(0), _palette(0), - _blending(false), _alphaReverse(false), _colorTest(false), + GuRenderer() : _useGlobalScaler(false), _buffer(0), _palette(0), + _blending(false), _alphaReverse(false), _colorTest(false), _keyColor(0), _fullScreen(false), _stretch(false), _stretchX(1.0f), _stretchY(1.0f) {} - GuRenderer(Buffer *buffer, Palette *palette) : - _useGlobalScaler(false), _buffer(buffer), _palette(palette), - _blending(false), _alphaReverse(false), _colorTest(false), + GuRenderer(Buffer *buffer, Palette *palette) : + _useGlobalScaler(false), _buffer(buffer), _palette(palette), + _blending(false), _alphaReverse(false), _colorTest(false), _keyColor(0), _fullScreen(false), _stretch(false), _stretchX(1.0f), _stretchY(1.0f) {} static void setDisplayManager(DisplayManager *dm) { _displayManager = dm; } // Called by the Display Manager diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 899b79727f..e945dca4a8 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -299,7 +299,7 @@ void DisplayManager::init() { #endif // Init overlay since we never change the size - _overlay->deallocate(); + _overlay->deallocate(); _overlay->setBytesPerPixel(sizeof(OverlayColor)); _overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); _overlay->allocate(); @@ -432,13 +432,13 @@ bool DisplayManager::renderAll() { _screen->render(); _screen->setClean(); // clean out dirty bit - + if (_imageViewer->isVisible()) _imageViewer->render(); _imageViewer->setClean(); if (_overlay->isVisible()) - _overlay->render(); + _overlay->render(); _overlay->setClean(); if (_cursor->isVisible()) @@ -448,7 +448,7 @@ bool DisplayManager::renderAll() { if (_keyboard->isVisible()) _keyboard->render(); _keyboard->setClean(); - + _masterGuRenderer.guPostRender(); return true; // rendered successfully diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h index 5176bee3fe..38c43d60a3 100644 --- a/backends/platform/psp/display_manager.h +++ b/backends/platform/psp/display_manager.h @@ -72,7 +72,7 @@ private: */ class MasterGuRenderer : public PspThreadable { public: - MasterGuRenderer() : _lastRenderTime(0), _renderFinished(true), + MasterGuRenderer() : _lastRenderTime(0), _renderFinished(true), _renderSema(1, 1), _callbackId(-1) {} void guInit(); void guPreRender(); @@ -108,7 +108,7 @@ public: KEEP_ASPECT_RATIO, STRETCHED_FULL_SCREEN }; - DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0), + DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0), _imageViewer(0), _lastUpdateTime(0), _graphicsMode(0) {} ~DisplayManager(); @@ -127,7 +127,7 @@ public: void setOverlay(Overlay *overlay) { _overlay = overlay; } void setKeyboard(PSPKeyboard *keyboard) { _keyboard = keyboard; } void setImageViewer(ImageViewer *imageViewer) { _imageViewer = imageViewer; } - + void setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format); // Getters diff --git a/backends/platform/psp/dummy.cpp b/backends/platform/psp/dummy.cpp index 86ab30b3e2..748ac8cbf3 100644 --- a/backends/platform/psp/dummy.cpp +++ b/backends/platform/psp/dummy.cpp @@ -26,31 +26,31 @@ #include #include #include - + //void userWriteFn(png_structp png_ptr, png_bytep data, png_size_t length) { //} //void userFlushFn(png_structp png_ptr) { //} - + // Dummy functions are pulled in so that we don't need to build the plugins with certain libs - + int dummyFunc() { // For Broken Sword 2.5 volatile int i; i = clock(); rename("dummyA", "dummyB"); - + png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_set_write_fn(png_ptr, NULL, NULL, NULL); png_infop info_ptr; png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); png_destroy_write_struct(&png_ptr, &info_ptr); - + // For lua's usage of libc: very heavy usage so it pulls in sockets? setsockopt(0, 0, 0, NULL, 0); getsockopt(0, 0, 0, NULL, NULL); - + return i; } \ No newline at end of file diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp index 97d582b63a..1ed7698bc8 100644 --- a/backends/platform/psp/image_viewer.cpp +++ b/backends/platform/psp/image_viewer.cpp @@ -34,45 +34,45 @@ #include "backends/platform/psp/input.h" #include "backends/platform/psp/display_manager.h" #include "backends/platform/psp/display_client.h" -#include "backends/platform/psp/image_viewer.h" -#include "backends/platform/psp/png_loader.h" +#include "backends/platform/psp/image_viewer.h" +#include "backends/platform/psp/png_loader.h" #include "backends/platform/psp/thread.h" static const char *imageName = "psp_image"; #define PSP_SCREEN_HEIGHT 272 #define PSP_SCREEN_WIDTH 480 - + bool ImageViewer::load(int imageNum) { if (_init) unload(); - + // build string char number[8]; sprintf(number, "%d", imageNum); - Common::String imageNameStr(imageName); + Common::String imageNameStr(imageName); Common::String specificImageName = imageNameStr + Common::String(number) + Common::String(".png"); - + // search for image file if (!SearchMan.hasFile(specificImageName)) { PSP_ERROR("file %s not found\n", specificImageName.c_str()); return false; } - + Common::ScopedPtr file(SearchMan.createReadStreamForMember(specificImageName)); - + _buffer = new Buffer(); _palette = new Palette(); _renderer = new GuRenderer(); - + assert(_buffer); assert(_palette); assert(_renderer); - + // Load a PNG into our buffer and palette. Size it by the actual size of the image PngLoader image(file, *_buffer, *_palette, Buffer::kSizeBySourceSize); - + PngLoader::Status status = image.allocate(); // allocate the buffers for the file - + char error[100]; if (status == PngLoader::BAD_FILE) { sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str()); @@ -89,29 +89,29 @@ bool ImageViewer::load(int imageNum) { if (!image.load()) { sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str()); GUI::TimedMessageDialog dialog(error, 4000); - dialog.runModal(); + dialog.runModal(); return false; } - + setConstantRendererOptions(); setFullScreenImageParams(); // prepare renderer for full screen view - + _imageNum = imageNum; // now we can say we displayed this image _init = true; - + return true; } void ImageViewer::setConstantRendererOptions() { _renderer->setBuffer(_buffer); _renderer->setPalette(_palette); - + _renderer->setAlphaBlending(false); _renderer->setColorTest(false); _renderer->setUseGlobalScaler(false); _renderer->setStretch(true); _renderer->setOffsetInBuffer(0, 0); - _renderer->setDrawWholeBuffer(); + _renderer->setDrawWholeBuffer(); } void ImageViewer::unload() { @@ -130,32 +130,32 @@ void ImageViewer::resetOnEngineDone() { void ImageViewer::setVisible(bool visible) { DEBUG_ENTER_FUNC(); - + if (_visible == visible) return; - + // from here on, we're making the loader visible if (visible && g_engine) { // we can only run the image viewer when there's an engine g_engine->pauseEngine(true); - + load(_imageNum ? _imageNum : 1); // load the 1st image or the current } if (visible && _init) { // we managed to load _visible = true; setViewerButtons(true); - + { // so dialog goes out of scope, destroying all allocations GUI::TimedMessageDialog dialog("Image Viewer", 1000); dialog.runModal(); } - + runLoop(); // only listen to viewer events } else { // we were asked to make invisible or failed to load _visible = false; unload(); setViewerButtons(false); - + if (g_engine && g_engine->isPaused()) g_engine->pauseEngine(false); } @@ -175,7 +175,7 @@ void ImageViewer::runLoop() { void ImageViewer::setViewerButtons(bool active) { _inputHandler->setImageViewerMode(active); -} +} void ImageViewer::loadNextImage() { if (!load(_imageNum+1)) { // try to load the next image @@ -190,21 +190,21 @@ void ImageViewer::loadLastImage() { if (!load(_imageNum-1)) if (!load(_imageNum)) setVisible(false); // we can't even show the old image so hide - } + } setDirty(); } void ImageViewer::setFullScreenImageParams() { // we try to fit the image fullscreen at least in one dimension uint32 width = _buffer->getSourceWidth(); - uint32 height = _buffer->getSourceHeight(); + uint32 height = _buffer->getSourceHeight(); _centerX = PSP_SCREEN_WIDTH / 2.0f; _centerY = PSP_SCREEN_HEIGHT / 2.0f; - + // see if we fit width wise if (PSP_SCREEN_HEIGHT >= (int)((height * PSP_SCREEN_WIDTH) / (float)width)) { - setZoom(PSP_SCREEN_WIDTH / (float)width); + setZoom(PSP_SCREEN_WIDTH / (float)width); } else { setZoom(PSP_SCREEN_HEIGHT / (float)height); } @@ -233,32 +233,32 @@ void ImageViewer::render() { break; } _renderer->render(); - } + } } void ImageViewer::modifyZoom(bool up) { float factor = _zoomFactor; - if (up) + if (up) factor += 0.1f; else // down factor -= 0.1f; - - setZoom(factor); + + setZoom(factor); } -void ImageViewer::setZoom(float value) { +void ImageViewer::setZoom(float value) { if (value <= 0.0f) // don't want 0 or negative zoom return; _zoomFactor = value; - _renderer->setStretchXY(value, value); + _renderer->setStretchXY(value, value); setOffsetParams(); } void ImageViewer::moveImageX(float val) { float newVal = _centerX + val; - - if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4) + + if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4) return; _centerX = newVal; setOffsetParams(); @@ -266,22 +266,22 @@ void ImageViewer::moveImageX(float val) { void ImageViewer::moveImageY(float val) { float newVal = _centerY + val; - - if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4) + + if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4) return; _centerY = newVal; setOffsetParams(); } -// Set the renderer with the proper offset on the screen +// Set the renderer with the proper offset on the screen // void ImageViewer::setOffsetParams() { _visibleWidth = _zoomFactor * _buffer->getSourceWidth(); - _visibleHeight = _zoomFactor * _buffer->getSourceHeight(); - + _visibleHeight = _zoomFactor * _buffer->getSourceHeight(); + int offsetX = _centerX - (int)(_visibleWidth * 0.5f); int offsetY = _centerY - (int)(_visibleHeight * 0.5f); - + _renderer->setOffsetOnScreen(offsetX, offsetY); setDirty(); } @@ -290,8 +290,8 @@ void ImageViewer::setOffsetParams() { // void ImageViewer::handleEvent(uint32 event) { DEBUG_ENTER_FUNC(); - - switch (event) { + + switch (event) { case EVENT_HIDE: setVisible(false); break; diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h index 4c3eaf7b4a..ad188536a3 100644 --- a/backends/platform/psp/image_viewer.h +++ b/backends/platform/psp/image_viewer.h @@ -54,10 +54,10 @@ private: float _visibleHeight, _visibleWidth; float _centerX, _centerY; Event _movement; - + InputHandler *_inputHandler; DisplayManager *_displayManager; - + void setFullScreenImageParams(); void loadNextImage(); void loadLastImage(); @@ -66,19 +66,19 @@ private: void moveImageX(float val); void moveImageY(float val); bool load(int imageNum); - void unload(); + void unload(); void runLoop(); // to get total pausing we have to do our own loop - + void setZoom(float value); void setOffsetParams(); void modifyZoom(bool up); // up or down void setVisible(bool visible); - + public: - ImageViewer() : _buffer(0), _palette(0), _visible(false), - _dirty(false), _init(false), _imageNum(0), - _zoomFactor(0.0f), _visibleHeight(0.0f), _visibleWidth(0.0f), + ImageViewer() : _buffer(0), _palette(0), _visible(false), + _dirty(false), _init(false), _imageNum(0), + _zoomFactor(0.0f), _visibleHeight(0.0f), _visibleWidth(0.0f), _centerX(0.0f), _centerY(0.0f), _movement(EVENT_MOVE_STOP), _inputHandler(0), _displayManager(0) {} ~ImageViewer() { unload(); } // deallocate images @@ -88,15 +88,15 @@ public: bool isDirty() { return _dirty; } void setDirty() { _dirty = true; } void setClean() { if (!_visible) // otherwise we want to keep rendering - _dirty = false; - } + _dirty = false; + } void resetOnEngineDone(); - + void handleEvent(uint32 event); - + // pointer setters - void setInputHandler(InputHandler *inputHandler) { _inputHandler = inputHandler; } + void setInputHandler(InputHandler *inputHandler) { _inputHandler = inputHandler; } void setDisplayManager(DisplayManager *displayManager) { _displayManager = displayManager; } }; -#endif /* PSP_IMAGE_VIEWER_H */ \ No newline at end of file +#endif /* PSP_IMAGE_VIEWER_H */ \ No newline at end of file diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp index 17f8954e3b..a9ad441b4d 100644 --- a/backends/platform/psp/input.cpp +++ b/backends/platform/psp/input.cpp @@ -198,7 +198,7 @@ bool ButtonPad::getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData & uint32 curButtonState = PSP_ALL_BUTTONS & pad.Buttons; // we only care about these if (_combosEnabled) - modifyButtonsForCombos(pad); // change buttons for combos + modifyButtonsForCombos(pad); // change buttons for combos return getEventFromButtonState(event, pspEvent, curButtonState); } @@ -460,7 +460,7 @@ bool InputHandler::handlePspEvent(Common::Event &event, PspEvent &pspEvent) { /*case PSP_EVENT_CHANGE_SPEED: handleSpeedChange(pspEvent.data); break;*/ - case PSP_EVENT_IMAGE_VIEWER: + case PSP_EVENT_IMAGE_VIEWER: _imageViewer->handleEvent(pspEvent.data); break; case PSP_EVENT_IMAGE_VIEWER_SET_BUTTONS: @@ -530,7 +530,7 @@ void InputHandler::setImageViewerMode(bool active) { _nub.init(); _buttonPad.enableCombos(true); // re-enable combos _buttonPad.initButtons(); - } + } } void InputHandler::setButtonsForImageViewer() { @@ -538,32 +538,32 @@ void InputHandler::setButtonsForImageViewer() { // Dpad _buttonPad.clearButtons(); - _buttonPad.getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_IN, + _buttonPad.getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_IN, + PSP_EVENT_NONE, false); + _buttonPad.getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_OUT, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_OUT, + _buttonPad.getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_LAST_IMAGE, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_LAST_IMAGE, + _buttonPad.getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_NEXT_IMAGE, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_NEXT_IMAGE, - PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_LTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, + _buttonPad.getButton(ButtonPad::BTN_LTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_RTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, + _buttonPad.getButton(ButtonPad::BTN_RTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_START, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, + _buttonPad.getButton(ButtonPad::BTN_START, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, PSP_EVENT_NONE, false); - _buttonPad.getButton(ButtonPad::BTN_SELECT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, + _buttonPad.getButton(ButtonPad::BTN_SELECT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE, PSP_EVENT_NONE, false); //Nub _nub.getPad().clearButtons(); - _nub.getPad().getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_UP, + _nub.getPad().getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_UP, PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP); - _nub.getPad().getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_DOWN, + _nub.getPad().getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_DOWN, PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP); - _nub.getPad().getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_LEFT, + _nub.getPad().getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_LEFT, PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP); - _nub.getPad().getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_RIGHT, + _nub.getPad().getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_RIGHT, PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP); } diff --git a/backends/platform/psp/input.h b/backends/platform/psp/input.h index 8315a3766c..ef2e1b84a4 100644 --- a/backends/platform/psp/input.h +++ b/backends/platform/psp/input.h @@ -122,16 +122,16 @@ public: ButtonPad(); void initButtons(); // set the buttons to the mode that's selected void clearButtons(); // empty the buttons of all events - + bool getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData &pad); bool getEventFromButtonState(Common::Event &event, PspEvent &pspEvent, uint32 buttonState); - + void setShifted(ShiftMode shifted) { _shifted = shifted; } void setPadMode(PspPadMode mode) { _padMode = mode; } bool isButtonDown() { return _prevButtonState; } - + void enableCombos(bool value) { _combosEnabled = value; } - Button &getButton(ButtonType type, ShiftMode mode) { return _button[type][mode]; } + Button &getButton(ButtonType type, ShiftMode mode) { return _button[type][mode]; } }; class Nub { @@ -140,17 +140,17 @@ private: ShiftMode _shifted; bool _dpadMode; - + ButtonPad _buttonPad; // private buttonpad for dpad mode - + int32 modifyNubAxisMotion(int32 input); void translateToDpadState(int dpadX, int dpadY, uint32 &buttonState); // convert nub data to dpad data public: Nub() : _shifted(UNSHIFTED), _dpadMode(false) { } - void init() { _buttonPad.initButtons(); } + void init() { _buttonPad.initButtons(); } void setCursor(Cursor *cursor) { _cursor = cursor; } - + // setters void setDpadMode(bool active) { _dpadMode = active; } void setShifted(ShiftMode shifted) { _shifted = shifted; } @@ -163,7 +163,7 @@ public: class InputHandler { public: - InputHandler() : _keyboard(0), _cursor(0), _imageViewer(0), _padMode(PAD_MODE_NORMAL), + InputHandler() : _keyboard(0), _cursor(0), _imageViewer(0), _padMode(PAD_MODE_NORMAL), _lastPadCheckTime(0) {} // pointer setters void setKeyboard(PSPKeyboard *keyboard) { _keyboard = keyboard; } @@ -175,7 +175,7 @@ public: void setImageViewerMode(bool active); private: - Nub _nub; + Nub _nub; ButtonPad _buttonPad; // Pointers to relevant other classes diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 8c8180d04e..5fa5110684 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -83,7 +83,7 @@ void OSystem_PSP::initBackend() { _inputHandler.setKeyboard(&_keyboard); _inputHandler.setImageViewer(&_imageViewer); _inputHandler.init(); - + // Set pointers for image viewer _imageViewer.setInputHandler(&_inputHandler); _imageViewer.setDisplayManager(&_displayManager); diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp index 2f4857569e..16377539c8 100644 --- a/backends/platform/psp/png_loader.cpp +++ b/backends/platform/psp/png_loader.cpp @@ -36,7 +36,7 @@ PngLoader::Status PngLoader::allocate() { DEBUG_ENTER_FUNC(); - + if (!findImageDimensions()) { PSP_ERROR("failed to get image dimensions\n"); return BAD_FILE; @@ -45,7 +45,7 @@ PngLoader::Status PngLoader::allocate() { _buffer->setSize(_width, _height, _sizeBy); uint32 bitsPerPixel = _bitDepth * _channels; - + if (_paletteSize) { // 8 or 4-bit image if (bitsPerPixel == 4) { _buffer->setPixelFormat(PSPPixelFormat::Type_Palette_4bit); @@ -130,7 +130,7 @@ bool PngLoader::basicImageLoad() { png_get_IHDR(_pngPtr, _infoPtr, (png_uint_32 *)&_width, (png_uint_32 *)&_height, &_bitDepth, &_colorType, &interlaceType, int_p_NULL, int_p_NULL); _channels = png_get_channels(_pngPtr, _infoPtr); - + if (_colorType & PNG_COLOR_MASK_PALETTE) _paletteSize = _infoPtr->num_palette; @@ -141,7 +141,7 @@ bool PngLoader::basicImageLoad() { bool PngLoader::findImageDimensions() { DEBUG_ENTER_FUNC(); - bool status = basicImageLoad(); + bool status = basicImageLoad(); PSP_DEBUG_PRINT("width[%d], height[%d], paletteSize[%d], bitDepth[%d], channels[%d], rowBytes[%d]\n", _width, _height, _paletteSize, _bitDepth, _channels, _infoPtr->rowbytes); png_destroy_read_struct(&_pngPtr, &_infoPtr, png_infopp_NULL); @@ -157,7 +157,7 @@ bool PngLoader::loadImageIntoBuffer() { if (!basicImageLoad()) { png_destroy_read_struct(&_pngPtr, &_infoPtr, png_infopp_NULL); return false; - } + } png_set_strip_16(_pngPtr); // Strip off 16 bit channels in case they occur if (_paletteSize) { @@ -178,16 +178,16 @@ bool PngLoader::loadImageIntoBuffer() { } uint32 rowBytes = png_get_rowbytes(_pngPtr, _infoPtr); - - // there seems to be a bug in libpng where it doesn't increase the rowbytes or the + + // there seems to be a bug in libpng where it doesn't increase the rowbytes or the // channel even after we add the alpha channel if (_channels == 3 && (rowBytes / _width) == 3) { _channels = 4; - rowBytes = _width * _channels; - } - + rowBytes = _width * _channels; + } + PSP_DEBUG_PRINT("rowBytes[%d], channels[%d]\n", rowBytes, _channels); - + unsigned char *line = (unsigned char*) malloc(rowBytes); if (!line) { png_destroy_read_struct(&_pngPtr, png_infopp_NULL, png_infopp_NULL); diff --git a/backends/platform/psp/png_loader.h b/backends/platform/psp/png_loader.h index 616a79405e..0ff9d8a65d 100644 --- a/backends/platform/psp/png_loader.h +++ b/backends/platform/psp/png_loader.h @@ -61,7 +61,7 @@ public: Buffer::HowToSize sizeBy = Buffer::kSizeByTextureSize) : _file(file), _buffer(&buffer), _palette(&palette), _width(0), _height(0), _paletteSize(0), - _bitDepth(0), _sizeBy(sizeBy), _pngPtr(0), + _bitDepth(0), _sizeBy(sizeBy), _pngPtr(0), _infoPtr(0), _colorType(0), _channels(0) {} PngLoader::Status allocate(); diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp index 373e00415b..b799b4e870 100644 --- a/backends/platform/psp/trace.cpp +++ b/backends/platform/psp/trace.cpp @@ -75,38 +75,38 @@ void PspDebugTrace(bool alsoToScreen, const char *format, ...) { #define GET_RET(retAddr) \ asm volatile ("move %0,$ra\n\t" \ : "=&r" (retAddr) : ) - + #define GET_SP(stackPtr) \ asm volatile ("move %0,$sp\n\t" \ : "=&r" (stackPtr) : ) // Function to retrieve a backtrace for the MIPS processor -// This is not trivial since the MIPS doesn't use a frame pointer. +// This is not trivial since the MIPS doesn't use a frame pointer. // Takes the number of levels wanted above the calling function (included) and an array of void * -// +// void mipsBacktrace(uint32 levels, void **addresses) { - // get the current return address + // get the current return address register byte *retAddr; register byte *stackPointer; - GET_RET(retAddr); + GET_RET(retAddr); GET_SP(stackPointer); char string[100]; - + if (!levels) return; - + memset(addresses, 0, sizeof(void *) * levels); - + uint32 curLevel = 0; - + const uint32 SP_SUBTRACT = 0x27bd8000; // The instruction to subtract from the SP looks like this const uint32 SP_SUB_HIGH_MASK = 0xffff8000; // The mask to check for the subtract SP instruction const uint32 SP_SUB_LOW_MASK = 0x0000ffff; // The mask that gives us how much was subtracted - + // make sure we go out of the stack of this current level // we already have the return address for this level from the register if (curLevel < levels) { - void *thisFunc = (void *)mipsBacktrace; + void *thisFunc = (void *)mipsBacktrace; for (uint32 *seekPtr = (uint32 *)thisFunc; ; seekPtr++) { if ((*seekPtr & SP_SUB_HIGH_MASK) == SP_SUBTRACT) { // we found the $sp subtraction at the beginning of the function @@ -120,10 +120,10 @@ void mipsBacktrace(uint32 levels, void **addresses) { fputs(string, stderr); } break; - } - } + } + } } - + // keep scanning while more levels are requested while (curLevel < levels) { // now scan backwards from the return address to find the size of the stack @@ -139,13 +139,13 @@ void mipsBacktrace(uint32 levels, void **addresses) { sprintf(string, "invalid retAddr %p\n", retAddr); fputs(string, stderr); return; - } + } //sprintf(string, "retAddr[%p]\n", retAddr); //fputs(string, stderr); addresses[curLevel++] = retAddr; break; - } - } + } + } } -} +} diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 9b11eb2c09..817f61e864 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -74,7 +74,7 @@ void OSystem_MacOSX::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit } void OSystem_MacOSX::setupIcon() { - // Don't set icon on OS X, as we use a nicer external icon there. + // Don't set icon on OS X, as we use a nicer external icon there. } bool OSystem_MacOSX::hasFeature(Feature f) { diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index 77515ff4e5..63bfc58617 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -47,7 +47,7 @@ typedef struct { int FAKE; } FAKE_FILE; // Finally forbid FILE again (if it was forbidden to start with) #if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE) -#undef FILE +#undef FILE #define FILE FORBIDDEN_SYMBOL_REPLACEMENT #endif diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 4cca5792cb..ecaeabf4e1 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -376,7 +376,7 @@ void OSystem_SDL::setupIcon() { if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) { warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]); - + return; } if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) { diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9c08752054..707ad8bc55 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -30,7 +30,7 @@ #include "backends/events/sdl/sdl-events.h" #include "backends/log/log.h" -/** +/** * Base OSystem class for all SDL ports. */ class OSystem_SDL : public ModularBackend { @@ -38,7 +38,7 @@ public: OSystem_SDL(); virtual ~OSystem_SDL(); - /** + /** * Pre-initialize backend. It should be called after * instantiating the backend. Early needed managers are * created here. diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 9cccc81d19..b1bd976f9e 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -57,7 +57,7 @@ char *GetExecutablePath() { OSystem_SDL_Symbian::OSystem_SDL_Symbian() : _RFs(0) { - + } void OSystem_SDL_Symbian::init() { @@ -171,7 +171,7 @@ Common::String OSystem_SDL_Symbian::getDefaultConfigFileName() { } void OSystem_SDL_Symbian::setupIcon() { - // Don't for Symbian: it uses the EScummVM.aif file for the icon. + // Don't for Symbian: it uses the EScummVM.aif file for the icon. } RFs& OSystem_SDL_Symbian::FsSession() { diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 54fa71cfd2..9b1ffe817c 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -621,7 +621,7 @@ Common::String OSystem_WINCE3::getSystemLanguage() const { GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, ctryNameW, sizeof(ctryNameW)) != 0) { WideCharToMultiByte(CP_ACP, 0, langNameW, -1, langName, (wcslen(langNameW) + 1), NULL, NULL); WideCharToMultiByte(CP_ACP, 0, ctryNameW, -1, ctryName, (wcslen(ctryNameW) + 1), NULL, NULL); - + debug(1, "Trying to find posix locale name for %s_%s", langName, ctryName); while (posixMappingTable[i][0] && !localeFound) { if ( (!strcmp(posixMappingTable[i][0], langName) || !strcmp(posixMappingTable[i][0], "*")) && diff --git a/backends/plugins/elf/elf-loader.cpp b/backends/plugins/elf/elf-loader.cpp index b25bcf835b..4335ea6108 100644 --- a/backends/plugins/elf/elf-loader.cpp +++ b/backends/plugins/elf/elf-loader.cpp @@ -169,7 +169,7 @@ bool DLObject::loadSegment(Elf32_Phdr *phdr) { warning("elfloader: Out of memory."); return false; } - + debug(2, "elfloader: Allocated segment @ %p", _segment); // Get offset to load segment into @@ -222,7 +222,7 @@ Elf32_Shdr * DLObject::loadSectionHeaders(Elf32_Ehdr *ehdr) { int DLObject::findSymbolTableSection(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) { int SymbolTableSection = -1; - + // Loop over sections, looking for symbol table linked to a string table for (uint32 i = 0; i < ehdr->e_shnum; i++) { if (shdr[i].sh_type == SHT_SYMTAB && @@ -233,7 +233,7 @@ int DLObject::findSymbolTableSection(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) { break; } } - + return SymbolTableSection; } @@ -315,12 +315,12 @@ void DLObject::relocateSymbols(ptrdiff_t offset) { } // Track the size of the plugin through memory manager without loading -// the plugin into memory. +// the plugin into memory. // void DLObject::trackSize(const char *path) { - + _file = Common::FSNode(path).createReadStream(); - + if (!_file) { warning("elfloader: File %s not found.", path); return; @@ -334,11 +334,11 @@ void DLObject::trackSize(const char *path) { _file = 0; return; } - + ELFMemMan.trackPlugin(true); // begin tracking the plugin size - + // Load the segments - for (uint32 i = 0; i < ehdr.e_phnum; i++) { + for (uint32 i = 0; i < ehdr.e_phnum; i++) { debug(2, "elfloader: Loading segment %d", i); if (!readProgramHeaders(&ehdr, &phdr, i)) { @@ -351,7 +351,7 @@ void DLObject::trackSize(const char *path) { ELFMemMan.trackAlloc(phdr.p_align, phdr.p_memsz); } } - + ELFMemMan.trackPlugin(false); // we're done tracking the plugin size delete _file; @@ -367,7 +367,7 @@ bool DLObject::load() { return false; //Load the segments - for (uint32 i = 0; i < ehdr.e_phnum; i++) { + for (uint32 i = 0; i < ehdr.e_phnum; i++) { debug(2, "elfloader: Loading segment %d", i); if (readProgramHeaders(&ehdr, &phdr, i) == false) @@ -386,12 +386,12 @@ bool DLObject::load() { free(shdr); return false; } - + if (!loadStringTable(shdr)) { free(shdr); return false; } - + // Offset by our segment allocated address // must use _segmentVMA here for multiple segments (MIPS) _segmentOffset = ptrdiff_t(_segment) - _segmentVMA; diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp index 480f7068c4..84054f44cb 100644 --- a/backends/plugins/elf/elf-provider.cpp +++ b/backends/plugins/elf/elf-provider.cpp @@ -100,7 +100,7 @@ DynamicPlugin::VoidFunc ELFPlugin::findSymbol(const char *symbol) { void ELFPlugin::trackSize() { // All we need to do is create our object, track its size, then delete it DLObject *obj = makeDLObject(); - + obj->trackSize(_filename.c_str()); delete obj; } @@ -180,7 +180,7 @@ void ELFPlugin::unloadPlugin() { PluginList ELFPluginProvider::getPlugins() { PluginList pl = FilePluginProvider::getPlugins(); -#if defined(UNCACHED_PLUGINS) && !defined(ELF_NO_MEM_MANAGER) +#if defined(UNCACHED_PLUGINS) && !defined(ELF_NO_MEM_MANAGER) // This static downcast is safe because all of the plugins must // be ELF plugins for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) { @@ -190,8 +190,8 @@ PluginList ELFPluginProvider::getPlugins() { // The Memory Manager should now allocate space based on the information // it collected ELFMemMan.allocateHeap(); -#endif - +#endif + return pl; } diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp index 39f5e9071d..02669b3647 100644 --- a/backends/plugins/elf/memory-manager.cpp +++ b/backends/plugins/elf/memory-manager.cpp @@ -20,7 +20,7 @@ * */ -#include "common/scummsys.h" +#include "common/scummsys.h" #if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) @@ -28,12 +28,12 @@ #include "common/debug.h" #include "common/util.h" #include - -DECLARE_SINGLETON(ELFMemoryManager); -ELFMemoryManager::ELFMemoryManager() : - _heap(0), _heapSize(0), _heapAlign(0), - _trackAllocs(false), _measuredSize(0), _measuredAlign(0), +DECLARE_SINGLETON(ELFMemoryManager); + +ELFMemoryManager::ELFMemoryManager() : + _heap(0), _heapSize(0), _heapAlign(0), + _trackAllocs(false), _measuredSize(0), _measuredAlign(0), _bytesAllocated(0) {} ELFMemoryManager::~ELFMemoryManager() { @@ -46,23 +46,23 @@ void ELFMemoryManager::trackPlugin(bool value) { if (value == _trackAllocs) return; - + _trackAllocs = value; - + if (_trackAllocs) { // start measuring // start tracking allocations _measuredAlign = 0; - + } else { // we're done measuring // get the total allocated size uint32 measuredSize = _allocList.back().end() - _allocList.front().start; _heapSize = MAX(_heapSize, measuredSize); _heapAlign = MAX(_heapAlign, _measuredAlign); - + _allocList.clear(); _bytesAllocated = 0; // reset - + debug(2, "measured a plugin of size %d. Max size %d. Max align %d", measuredSize, _heapSize, _heapAlign); } } @@ -70,7 +70,7 @@ void ELFMemoryManager::trackPlugin(bool value) { void ELFMemoryManager::trackAlloc(uint32 align, uint32 size) { if (!_measuredAlign) _measuredAlign = align; - + // use the allocate function to simulate allocation allocateOnHeap(align, size); } @@ -79,20 +79,20 @@ void ELFMemoryManager::allocateHeap() { // The memory manager should only allocate once assert (!_heap); assert (_heapSize); - + // clear the list _allocList.clear(); _bytesAllocated = 0; - + debug(2, "ELFMemoryManager: allocating %d bytes aligned at %d as the \ plugin heap", _heapSize, _heapAlign); - + // prepare the heap - if (_heapAlign) + if (_heapAlign) _heap = ::memalign(_heapAlign, _heapSize); else _heap = ::malloc(_heapSize); - + assert(_heap); } @@ -106,7 +106,7 @@ void *ELFMemoryManager::pluginAllocate(uint32 size) { void *ELFMemoryManager::pluginAllocate(uint32 align, uint32 size) { if (_heap) { return allocateOnHeap(align, size); - } + } return ::memalign(align, size); } @@ -120,16 +120,16 @@ void ELFMemoryManager::pluginDeallocate(void *ptr) { // Allocate space for the request in our heap void *ELFMemoryManager::allocateOnHeap(uint32 align, uint32 size) { byte *lastAddress = (byte *)_heap; - + // We can't allow allocations smaller than sizeof(Allocation). This could - // only be from non-plugin allocations and would cause infinite recursion + // only be from non-plugin allocations and would cause infinite recursion // when allocating our Allocation in the list. if (size <= sizeof(Allocation)) return 0; - + Common::List::iterator i; for (i = _allocList.begin(); i != _allocList.end(); i++) { - if (i->start - lastAddress > (int)size) + if (i->start - lastAddress > (int)size) break; lastAddress = i->end(); // align to desired alignment @@ -137,20 +137,20 @@ void *ELFMemoryManager::allocateOnHeap(uint32 align, uint32 size) { lastAddress = (byte *)( ((uint32)lastAddress + align - 1) & ~(align - 1) ); } } - + // Check if we exceeded our heap limit // We skip this case if we're only tracking allocations if (!_trackAllocs && ((uint32)lastAddress + size > (uint32)_heap + _heapSize)) { debug(2, "failed to find space to allocate %d bytes", size); return 0; } - + _allocList.insert(i, Allocation(lastAddress, size)); _bytesAllocated += size; - - debug(7, "ELFMemoryManager: allocated %d bytes at %p. Total %d bytes", + + debug(7, "ELFMemoryManager: allocated %d bytes at %p. Total %d bytes", size, lastAddress, _bytesAllocated); - + return lastAddress; } @@ -159,14 +159,14 @@ void ELFMemoryManager::deallocateFromHeap(void *ptr) { for (i = _allocList.begin(); i != _allocList.end(); i++) { if (i->start == ptr) { _bytesAllocated -= (*i).size; - - debug(7, "ELFMemoryManager: freed %d bytes at %p. Total %d bytes", + + debug(7, "ELFMemoryManager: freed %d bytes at %p. Total %d bytes", (*i).size, (*i).start, _bytesAllocated); - + _allocList.erase(i); break; } - } + } } #endif /* defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) */ diff --git a/backends/plugins/elf/memory-manager.h b/backends/plugins/elf/memory-manager.h index ac70e5e3bb..032ecb2be5 100644 --- a/backends/plugins/elf/memory-manager.h +++ b/backends/plugins/elf/memory-manager.h @@ -30,17 +30,17 @@ #include "common/singleton.h" #include "common/list.h" #include "common/mutex.h" - + /** - * A 'foolproof' way to prevent memory fragmentation. This class is used to - * serve as a permanent allocation to prevent the process of loading and + * A 'foolproof' way to prevent memory fragmentation. This class is used to + * serve as a permanent allocation to prevent the process of loading and * unloading plugins from causing heavy fragmentation. **/ - + #define ELFMemMan ELFMemoryManager::instance() - + class ELFMemoryManager : public Common::Singleton { -public: +public: void trackPlugin(bool value); void trackAlloc(uint32 align, uint32 size); @@ -49,7 +49,7 @@ public: void *pluginAllocate(uint32 size); void *pluginAllocate(uint32 align, uint32 size); void pluginDeallocate(void *ptr); - + private: friend class Common::Singleton; @@ -58,7 +58,7 @@ private: void *allocateOnHeap(uint32 align, uint32 size); void deallocateFromHeap(void *ptr); - + struct Allocation { byte *start; uint32 size; @@ -70,17 +70,17 @@ private: void *_heap; uint32 _heapAlign; // alignment of the heap uint32 _heapSize; // size of the heap - + // tracking allocations bool _trackAllocs; // whether we are currently tracking - uint32 _measuredSize; - uint32 _measuredAlign; - + uint32 _measuredSize; + uint32 _measuredAlign; + // real allocations Common::List _allocList; uint32 _bytesAllocated; }; - + #endif /* defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) */ #endif /* ELF_MEMORY_MANAGER_H */ diff --git a/backends/plugins/elf/mips-loader.cpp b/backends/plugins/elf/mips-loader.cpp index 8ce1a69583..e043c9647f 100644 --- a/backends/plugins/elf/mips-loader.cpp +++ b/backends/plugins/elf/mips-loader.cpp @@ -53,7 +53,7 @@ bool MIPSDLObject::relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment) debug(2, "elfloader: Loaded relocation table. %d entries. base address=%p", cnt, relSegment); Elf32_Addr adjustedMainSegment = Elf32_Addr(_segment) - _segmentVMA; // adjust for VMA offset - + bool seenHi16 = false; // For treating HI/LO16 commands int32 firstHi16 = -1; // Mark the point of the first hi16 seen Elf32_Addr ahl = 0; // Calculated addend @@ -259,7 +259,7 @@ void MIPSDLObject::relocateSymbols(ptrdiff_t offset) { if (!ShortsMan.inGeneralSegment((char *)s->st_value)) { if (s->st_value < _segmentVMA) s->st_value = _segmentVMA; // deal with symbols referring to sections, which start before the VMA - + s->st_value += offset; if (s->st_value < Elf32_Addr(_segment) || s->st_value > Elf32_Addr(_segment) + _segmentSize) @@ -287,7 +287,7 @@ bool MIPSDLObject::loadSegment(Elf32_Phdr *phdr) { } debug(2, "elfloader: Allocated segment @ %p", _segment); - + // Get offset to load segment into baseAddress = _segment; _segmentSize = phdr->p_memsz; diff --git a/base/main.cpp b/base/main.cpp index 395ba8344c..717ccb3344 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -333,7 +333,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { PluginManager::instance().init(); PluginManager::instance().loadAllPlugins(); // load plugins for cached plugin manager - + // If we received an invalid music parameter via command line we check this here. // We can't check this before loading the music plugins. // On the other hand we cannot load the plugins before we know the file paths (in case of external plugins). @@ -385,7 +385,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { system.getAudioCDManager(); MusicManager::instance(); Common::DebugManager::instance(); - + // Init the event manager. As the virtual keyboard is loaded here, it must // take place after the backend is initiated and the screen has been setup system.getEventManager()->init(); @@ -424,8 +424,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // reallocate the config manager to get rid of any fragmentation ConfMan.defragment(); - #endif - + #endif + // Did an error occur ? if (result.getCode() != Common::kNoError && result.getCode() != Common::kUserCanceled) { // Shows an informative error dialog if starting the selected game failed. diff --git a/base/plugins.cpp b/base/plugins.cpp index 8ce7b53254..4c2fd2cffc 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -313,7 +313,7 @@ PluginManager &PluginManager::instance() { if (_instance) return *_instance; -#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) +#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) _instance = new PluginManagerUncached(); #else _instance = new PluginManager(); @@ -348,7 +348,7 @@ void PluginManager::addPluginProvider(PluginProvider *pp) { void PluginManagerUncached::init() { unloadAllPlugins(); _allEnginePlugins.clear(); - + // Resize our pluginsInMem list to prevent fragmentation _pluginsInMem[PLUGIN_TYPE_ENGINE].resize(2); unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins @@ -357,7 +357,7 @@ void PluginManagerUncached::init() { pp != _providers.end(); ++pp) { PluginList pl((*pp)->getPlugins()); - + for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) { // This is a 'hack' based on the assumption that we have no sound // file plugins. Currently this is the case. If it changes, we @@ -365,15 +365,15 @@ void PluginManagerUncached::init() { // music or an engine plugin. if ((*pp)->isFilePluginProvider()) { _allEnginePlugins.push_back(*p); - } else if ((*p)->loadPlugin()) { // and this is the proper method + } else if ((*p)->loadPlugin()) { // and this is the proper method if ((*p)->getType() == PLUGIN_TYPE_ENGINE) { (*p)->unloadPlugin(); _allEnginePlugins.push_back(*p); } else { // add non-engine plugins to the 'in-memory' list // these won't ever get unloaded - addToPluginsInMemList(*p); + addToPluginsInMemList(*p); } - } + } } } } @@ -403,7 +403,7 @@ bool PluginManagerUncached::loadPluginFromGameId(const Common::String &gameId) { bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename) { if (filename.empty()) return false; - + unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); PluginList::iterator i; @@ -417,7 +417,7 @@ bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename) return false; } -/** +/** * Update the config manager with a plugin file name that we found can handle * the game. **/ @@ -435,7 +435,7 @@ void PluginManagerUncached::updateConfigWithFileName(const Common::String &gameI } } -void PluginManagerUncached::loadFirstPlugin() { +void PluginManagerUncached::loadFirstPlugin() { unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // let's try to find one we can load @@ -517,7 +517,7 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) { bool found = false; // The plugin is valid, see if it provides the same module as an // already loaded one and should replace it. - + PluginList::iterator pl = _pluginsInMem[plugin->getType()].begin(); while (!found && pl != _pluginsInMem[plugin->getType()].end()) { if (!strcmp(plugin->getName(), (*pl)->getName())) { @@ -542,7 +542,7 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) { DECLARE_SINGLETON(EngineManager); -/** +/** * This function works for both cached and uncached PluginManagers. * For the cached version, most of the logic here will short circuit. * @@ -554,24 +554,24 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Eng // First look for the game using the plugins in memory. This is critical // for calls coming from inside games - result = findGameInLoadedPlugins(gameName, plugin); + result = findGameInLoadedPlugins(gameName, plugin); if (!result.gameid().empty()) { return result; } - + // Now look for the game using the gameId. This is much faster than scanning plugin // by plugin if (PluginMan.loadPluginFromGameId(gameName)) { - result = findGameInLoadedPlugins(gameName, plugin); + result = findGameInLoadedPlugins(gameName, plugin); if (!result.gameid().empty()) { return result; } } - + // We failed to find it using the gameid. Scan the list of plugins PluginMan.loadFirstPlugin(); do { - result = findGameInLoadedPlugins(gameName, plugin); + result = findGameInLoadedPlugins(gameName, plugin); if (!result.gameid().empty()) { // Update with new plugin file name PluginMan.updateConfigWithFileName(gameName); @@ -582,7 +582,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Eng return result; } -/** +/** * Find the game within the plugins loaded in memory **/ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const EnginePlugin **plugin) const { @@ -594,7 +594,7 @@ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &game *plugin = 0; EnginePlugin::List::const_iterator iter; - + for (iter = plugins.begin(); iter != plugins.end(); ++iter) { result = (**iter)->findGame(gameName.c_str()); if (!result.gameid().empty()) { diff --git a/base/plugins.h b/base/plugins.h index a1ae734159..fffb5fb910 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -143,7 +143,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; // Abstract plugins /** - * Abstract base class for the plugin objects which handle plugins + * Abstract base class for the plugin objects which handle plugins * instantiation. Subclasses for this may be used for engine plugins and other * types of plugins. An existing PluginObject refers to an executable file * loaded in memory and ready to run. The plugin, on the other hand, is just @@ -310,7 +310,7 @@ protected: bool tryLoadPlugin(Plugin *plugin); void addToPluginsInMemList(Plugin *plugin); - + static PluginManager *_instance; PluginManager(); @@ -326,9 +326,9 @@ public: virtual void init() {} virtual void loadFirstPlugin() {} virtual bool loadNextPlugin() { return false; } - virtual bool loadPluginFromGameId(const Common::String &gameId) { return false; } - virtual void updateConfigWithFileName(const Common::String &gameId) {} - + virtual bool loadPluginFromGameId(const Common::String &gameId) { return false; } + virtual void updateConfigWithFileName(const Common::String &gameId) {} + // Functions used only by the cached PluginManager virtual void loadAllPlugins(); void unloadAllPlugins(); @@ -338,7 +338,7 @@ public: const PluginList &getPlugins(PluginType t) { return _pluginsInMem[t]; } }; -/** +/** * Uncached version of plugin manager * Keeps only one dynamic plugin in memory at a time **/ @@ -349,15 +349,15 @@ protected: PluginList::iterator _currentPlugin; PluginManagerUncached() {} - bool loadPluginByFileName(const Common::String &filename); + bool loadPluginByFileName(const Common::String &filename); public: virtual void init(); virtual void loadFirstPlugin(); virtual bool loadNextPlugin(); - virtual bool loadPluginFromGameId(const Common::String &gameId); - virtual void updateConfigWithFileName(const Common::String &gameId); - + virtual bool loadPluginFromGameId(const Common::String &gameId); + virtual void updateConfigWithFileName(const Common::String &gameId); + virtual void loadAllPlugins() {} // we don't allow this }; diff --git a/common/config-manager.h b/common/config-manager.h index 6f3f554459..78a62b9808 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -147,7 +147,7 @@ public: static void defragment(); // move in memory to reduce fragmentation void copyFrom(ConfigManager &source); - + private: friend class Singleton; ConfigManager(); diff --git a/common/ptr.h b/common/ptr.h index e0d026f964..fc272d3d41 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -240,7 +240,7 @@ public: operator bool() const { return _pointer != 0; } ~ScopedPtr() { - delete _pointer; + delete _pointer; } /** diff --git a/common/quicktime.cpp b/common/quicktime.cpp index 57534b301a..ee49b092a4 100644 --- a/common/quicktime.cpp +++ b/common/quicktime.cpp @@ -728,7 +728,7 @@ int QuickTimeParser::readESDS(Atom atom) { byte tag; int length; - + readMP4Desc(_fd, tag, length); _fd->readUint16BE(); // id if (tag == kMP4ESDescTag) @@ -736,7 +736,7 @@ int QuickTimeParser::readESDS(Atom atom) { // Check if we've got the Config MPEG-4 header readMP4Desc(_fd, tag, length); - if (tag != kMP4DecConfigDescTag) + if (tag != kMP4DecConfigDescTag) return 0; track->objectTypeMP4 = _fd->readByte(); diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp index 80266ba87e..8690f6795b 100644 --- a/common/winexe_ne.cpp +++ b/common/winexe_ne.cpp @@ -136,7 +136,7 @@ bool NEResources::loadFromCompressedEXE(const String &fileName) { matchPos &= 0xFFF; } } - + } } diff --git a/common/winexe_pe.h b/common/winexe_pe.h index cc1d0c9770..b38f2f78f5 100644 --- a/common/winexe_pe.h +++ b/common/winexe_pe.h @@ -107,7 +107,7 @@ private: uint32 offset; uint32 size; }; - + typedef HashMap LangMap; typedef HashMap NameMap; typedef HashMap TypeMap; diff --git a/devtools/create_hugo/create_hugo.cpp b/devtools/create_hugo/create_hugo.cpp index e54ade2b28..63b57f9c8f 100644 --- a/devtools/create_hugo/create_hugo.cpp +++ b/devtools/create_hugo/create_hugo.cpp @@ -743,7 +743,7 @@ int main(int argc, char *argv[]) { writeUint16BE(outFile, 0); writeUint16BE(outFile, kALnewscr_2d); writeUint16BE(outFile, 0); - + writeSByte(outFile, NUM_TUNES_1w); writeSByte(outFile, SILENCE_1w); writeSByte(outFile, TEST_SOUND_1w); diff --git a/devtools/create_hugo/staticdisplay.h b/devtools/create_hugo/staticdisplay.h index 03800017b5..99d155dc13 100644 --- a/devtools/create_hugo/staticdisplay.h +++ b/devtools/create_hugo/staticdisplay.h @@ -60,7 +60,7 @@ byte _palette[SIZE_PAL_ARRAY] = { V2, V2, V2 // BRIGHTWHITE }; #else -// Original paletter found in original exe. +// Original paletter found in original exe. // Currently disabled, because the result is quite ugly! // Color table of nearest standard 16 colors in system static palette #define C1 191 // Low intensity value diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp index 2b6499d3fb..5581dacec0 100644 --- a/devtools/create_kyradat/extract.cpp +++ b/devtools/create_kyradat/extract.cpp @@ -415,7 +415,7 @@ bool extractKyraForestSeqData(PAKFile &out, const ExtractInformation *info, cons const uint8 *src = data; uint8 *dst = buffer; const PatchEntry *patchPos = patchData; - + while (dst < (buffer + outsize)) { if ((dst - buffer) == patchPos->pos) { *dst++ = patchPos->val; diff --git a/devtools/create_mads/main.cpp b/devtools/create_mads/main.cpp index c5cd6d5b2e..aec9e45b8b 100644 --- a/devtools/create_mads/main.cpp +++ b/devtools/create_mads/main.cpp @@ -48,7 +48,7 @@ void link(const char *destFilename, char **srcFilenames, int srcCount) { fwrite(headerStr, 1, 4, destFile); for (int i = 0; i <= srcCount; ++i) fwrite(&v, 1, 4, destFile); - + // Set up buffer for copying void *tempBuffer = malloc(BUFFER_SIZE); @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) { // Change the extension strcpy(p, ".bin"); } - + // Compile the specified source file bool result = Compile(argv[1], destFilename); return result ? 0 : 1; diff --git a/devtools/create_mads/parser.cpp b/devtools/create_mads/parser.cpp index 0c6df43046..5df505e0df 100644 --- a/devtools/create_mads/parser.cpp +++ b/devtools/create_mads/parser.cpp @@ -44,7 +44,7 @@ enum CharCode { }; enum TokenCode { - NO_TOKEN, WORD, NUMBER, IDENTIFIER, END_OF_FILE, END_OF_LINE, + NO_TOKEN, WORD, NUMBER, IDENTIFIER, END_OF_FILE, END_OF_LINE, RW_DEFINE, RW_COLON, RW_SUB, RW_END, RW_OPCODE, ERROR }; @@ -58,7 +58,7 @@ struct Literal { union { int integer; } value; -}; +}; struct SymbolEntry { char symbol[MAX_TOKEN_STRING_LENGTH]; @@ -109,12 +109,12 @@ struct OpcodeEntry { }; OpcodeEntry OpcodeList[OP_DUP + 1] = { - {"HALT", OP_NO_PARAM}, {"IMM", OP_IMM_PARAM}, {"ZERO", OP_NO_PARAM}, {"ONE", OP_NO_PARAM}, - {"MINUSONE", OP_NO_PARAM}, {"STR", OP_IMM_PARAM}, {"DLOAD", OP_IMM_PARAM}, {"DSTORE", OP_IMM_PARAM}, + {"HALT", OP_NO_PARAM}, {"IMM", OP_IMM_PARAM}, {"ZERO", OP_NO_PARAM}, {"ONE", OP_NO_PARAM}, + {"MINUSONE", OP_NO_PARAM}, {"STR", OP_IMM_PARAM}, {"DLOAD", OP_IMM_PARAM}, {"DSTORE", OP_IMM_PARAM}, {"PAL", OP_IMM_PARAM}, {"LOAD", OP_IMM_PARAM}, {"GLOAD", OP_IMM_PARAM}, {"STORE", OP_IMM_PARAM}, {"GSTORE", OP_IMM_PARAM}, {"CALL", OP_IMM_PARAM}, {"LIBCALL", OP_IMM_PARAM}, {"RET", OP_NO_PARAM}, {"ALLOC", OP_IMM_PARAM}, {"JUMP", OP_TRANSFER_PARAM}, {"JMPFALSE", OP_TRANSFER_PARAM}, - {"JMPTRUE", OP_TRANSFER_PARAM}, {"EQUAL", OP_NO_PARAM}, {"LESS", OP_NO_PARAM}, + {"JMPTRUE", OP_TRANSFER_PARAM}, {"EQUAL", OP_NO_PARAM}, {"LESS", OP_NO_PARAM}, {"LEQUAL", OP_NO_PARAM}, {"NEQUAL", OP_NO_PARAM}, {"GEQUAL", OP_NO_PARAM}, {"GREAT", OP_NO_PARAM}, {"PLUS", OP_NO_PARAM}, {"MINUS", OP_NO_PARAM}, {"LOR", OP_NO_PARAM}, {"MULT", OP_NO_PARAM}, {"DIV", OP_IMM_PARAM}, {"MOD", OP_NO_PARAM}, @@ -418,7 +418,7 @@ void handle_define() { printf("Duplicate symbol encountered.\n"); token = ERROR; return; - } + } // Store the new symbol name strcpy(symbolTable[symbolCount].symbol, token_string); @@ -529,7 +529,7 @@ void handle_instruction() { printf("Incorrect opcode parameter encountered\n"); token = ERROR; return; - } + } // Apply the correct opcode size to the previously stored opcode and save the byte(s) if (literal.value.integer <= 0xff) { @@ -559,7 +559,7 @@ void handle_instruction() { printf("Incorrect opcode parameter encountered\n"); token = ERROR; return; - } + } // Check to see if it's a backward jump to an existing label int idx = jumpIndexOf(token_string); @@ -641,7 +641,7 @@ void handle_sub() { token = ERROR; return; } - + // If this is the first subroutine, start writing out the data if (subroutinesCount == 0) write_header(); @@ -681,7 +681,7 @@ void handle_sub() { // Save identifier, it's hopefully a jump symbol strcpy(jumpDests[jumpDestCount].name, token_string); get_token(); - if (token != RW_COLON) + if (token != RW_COLON) token = ERROR; else { // Save the jump point @@ -863,7 +863,7 @@ void get_special() { strToUpper(token_string); if (token_string[0] == '@') token = IDENTIFIER; - else if (!is_reserved_word()) + else if (!is_reserved_word()) token = ERROR; } diff --git a/devtools/skycpt/cptcompiler.cpp b/devtools/skycpt/cptcompiler.cpp index 264646816c..f6ee926075 100644 --- a/devtools/skycpt/cptcompiler.cpp +++ b/devtools/skycpt/cptcompiler.cpp @@ -503,7 +503,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * fwrite(&tmp, 2, 1, debOutf); tmp = 0; fwrite(&tmp, 2, 1, debOutf); - + printf("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf)); printf("reset destination: %ld\n", ftell(debOutf)); for (int cnt = 0; cnt < 6; cnt++) { diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 811a58f45d..0eefbab04d 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -188,7 +188,7 @@ void AgiEngine::processEvents() { case Common::KEYCODE_KP5: if (_predictiveDialogRunning) key = event.kbd.ascii; - else + else key = KEY_STATIONARY; break; case Common::KEYCODE_PLUS: diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 21ff5deb2c..a0736d0cc3 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -473,7 +473,7 @@ bool AgiBase::canLoadGameStateCurrently() { bool AgiBase::canSaveGameStateCurrently() { if (getGameID() == GID_BC) // Technically in Black Cauldron we may save anytime return true; - + return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !_noSaveLoadAllowed && _game.inputEnabled); } diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index aa338db0f2..f2d7af32da 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -144,7 +144,7 @@ void SoundMgr::stopSound() { // not be any harm doing it, so do it anyway. if (_endflag != -1) _vm->setflag(_endflag, true); - + _endflag = -1; } diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index 3c8a3dfc8d..38e256aa4b 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -167,12 +167,12 @@ uint SoundGen2GS::generateOutput() { g->seg++; } } - + // TODO: Advance vibrato here. The Apple IIGS uses a LFO with // triangle wave to modulate the frequency of both oscillators. // In Apple IIGS the vibrato and the envelope are updated at the // same time, so the vibrato speed depends on ENVELOPE_COEF. - + // Advance oscillators int s0 = 0; int s1 = 0; @@ -202,12 +202,12 @@ uint SoundGen2GS::generateOutput() { } } } - + // Take envelope and MIDI volume information into account. // Also amplify. s0 *= vol * g->vel / 127 * 80 / 256; s1 *= vol * g->vel / 127 * 80 / 256; - + // Select output channel. if (g->osc[0].chn) outl += s0; @@ -375,7 +375,7 @@ void SoundGen2GS::midiNoteOn(int channel, int note, int velocity) { IIgsGenerator* g = allocateGenerator(); g->ins = _channels[channel].getInstrument(); const IIgsInstrumentHeader* i = g->ins; - + // Pass information from the MIDI channel to the generator. Take // velocity into account, although simplistically. velocity *= 5 / 3; @@ -385,7 +385,7 @@ void SoundGen2GS::midiNoteOn(int channel, int note, int velocity) { g->key = note; g->vel = velocity * _channels[channel].getVolume() / 127; g->chn = channel; - + // Instruments can define different samples to be used based on // what the key is. Find the correct samples for our key. int wa = 0; diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h index 1a225300ae..9123e18415 100644 --- a/engines/agi/sound_2gs.h +++ b/engines/agi/sound_2gs.h @@ -33,7 +33,7 @@ namespace Agi { // Apple IIGS to halt the corresponding oscillator immediately. We preprocess // the sample data by converting it to signed values and the instruments by // detecting prematurely stopping samples beforehand. -// +// // Note: None of the tested SIERRASTANDARD files have zeroes in them. So in // practice there is no need to check for them. However, they still do exist // in the sample resources. @@ -263,7 +263,7 @@ private: uint _ticks; ///< MIDI ticks (60Hz) int16 *_out; ///< Output buffer uint _outSize; ///< Output buffer size - + static const int kSfxMidiChannel = 15; ///< MIDI channel used for playing sample resources }; diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index d2c99171e2..0cbaa4af86 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -33,7 +33,7 @@ // Timing is not perfect, yet. It plays correct, when I use the // Gravis-Midiplayer, but the songs are too fast when I use playmidi on // Linux. -// +// // Original program developed by Jens. Christian Restemeier // @@ -114,7 +114,7 @@ void SoundGenMIDI::endOfTrack() { void SoundGenMIDI::play(int resnum) { MIDISound *track; - + stop(); _isGM = true; @@ -153,7 +153,7 @@ unsigned char instr[] = {50, 51, 19}; static void writeDelta(Common::MemoryWriteStreamDynamic *st, int32 delta) { int32 i; - i = delta >> 21; if (i > 0) st->writeByte((i & 127) | 128); + i = delta >> 21; if (i > 0) st->writeByte((i & 127) | 128); i = delta >> 14; if (i > 0) st->writeByte((i & 127) | 128); i = delta >> 7; if (i > 0) st->writeByte((i & 127) | 128); st->writeByte(delta & 127); @@ -196,7 +196,7 @@ static uint32 convertSND2MIDI(byte *snddata, byte **data) { int note; /* I don't know, what frequency equals midi note 0 ... */ /* This moves the song 4 octaves down: */ - fr = (log10(111860.0 / (double)freq) / ll) - 48; + fr = (log10(111860.0 / (double)freq) / ll) - 48; note = (int)floor(fr + 0.5); if (note < 0) note = 0; if (note > 127) note = 127; @@ -222,7 +222,7 @@ static uint32 convertSND2MIDI(byte *snddata, byte **data) { st.writeByte(0); st.writeByte(0); } - } + } writeDelta(&st, 0); st.writeByte(0xff); st.writeByte(0x2f); diff --git a/engines/agi/sound_pcjr.h b/engines/agi/sound_pcjr.h index f50fd0aa82..4317e86516 100644 --- a/engines/agi/sound_pcjr.h +++ b/engines/agi/sound_pcjr.h @@ -45,9 +45,9 @@ struct SndGenChan { uint16 dissolveCount; byte attenuation; byte attenuationCopy; - + GenType genType; - + // for the sample mixer int freqCount; }; diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index fc9a57791c..9ea8569b81 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -105,7 +105,7 @@ SoundGenSarien::~SoundGenSarien() { int SoundGenSarien::readBuffer(int16 *buffer, const int numSamples) { fillAudio(buffer, numSamples / 2); - + return numSamples; } @@ -124,7 +124,7 @@ void SoundGenSarien::play(int resnum) { for (int i = 0; i < NUM_CHANNELS; i++) { _chn[i].type = type; _chn[i].flags = AGI_SOUND_LOOP; - + if (_env) { _chn[i].flags |= AGI_SOUND_ENVELOPE; _chn[i].adsr = AGI_SOUND_ENV_ATTACK; diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 60e465fddf..f9a06cbecb 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -621,7 +621,7 @@ void AGOSEngine_PuzzlePack::printInfoText(const char *itemText) { itemName = " Gem: "; } break; - + case 82: if (_variableArray[flag]) { if (_variableArray[flag] == 201 || _variableArray[flag] == 211) diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 81e72d6905..cdb5140002 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -55,7 +55,7 @@ int16 canUseOnObject = 0; void waitPlayerInput() { uint16 button; - + do { manageEvents(); getMouseData(mouseUpdateStatus, &button, &dummyU16, &dummyU16); diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 1e7e87cf38..4d1284a802 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -212,7 +212,7 @@ int loadBackground(const char *name, int idx) { // NOTE: the following is really meant to compare pointers and not the actual // strings. See r48092 and r48094. if (name != backgroundTable[idx].name) { - if (strlen(name) >= sizeof(backgroundTable[idx].name)) + if (strlen(name) >= sizeof(backgroundTable[idx].name)) warning("background name length exceeded allowable maximum"); Common::strlcpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name)); diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 3f13c6cbff..a97583c972 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1882,7 +1882,7 @@ void CruiseEngine::mainLoop() { while (numIterations-- > 0) { bgChanged = backgroundChanged[masterScreen]; - + manageScripts(&relHead); manageScripts(&procHead); diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 531cf32dbc..89c07ad24c 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -173,7 +173,7 @@ void MainMenuDialog::reflowLayout() { _loadButton->setEnabled(_engine->canLoadGameStateCurrently()); if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime)) _saveButton->setEnabled(_engine->canSaveGameStateCurrently()); - + // Overlay size might have changed since the construction of the dialog. // Update labels when it might be needed // FIXME: it might be better to declare GUI::StaticTextWidget::setLabel() virtual diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 2249a49e4d..6ba5597e8a 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -243,7 +243,7 @@ static const DrasculaGameDescription gameDescriptions[] = { GUIO_NONE }, }, - + { // Drascula French version (ScummVM repacked files) { diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index d133b3609d..9ea20e3e12 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -204,7 +204,7 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width, } ptr += 320 - width; } - + } void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer) { @@ -354,7 +354,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { print_abc(msg, x, y); return; } - + // Message doesn't fit on screen, split it // Get a word from the message diff --git a/engines/drascula/resource.cpp b/engines/drascula/resource.cpp index bda25113b7..6da43e7cba 100644 --- a/engines/drascula/resource.cpp +++ b/engines/drascula/resource.cpp @@ -45,7 +45,7 @@ TextResourceParser::TextResourceParser(Common::SeekableReadStream *stream, Dispo _stream(stream), _dispose(dispose) { // NOTE: strangely enough, the code before this refactoring used the size of - // the stream as a fixed maximum length for the parser. Using an updated + // the stream as a fixed maximum length for the parser. Using an updated // (size-pos) would make more sense to me, but let's see what the experts say. _maxLen = _stream->size(); } diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index 50d44bab79..9f725b6d76 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1675,7 +1675,7 @@ void DrasculaEngine::enterRoom(int roomIndex) { if (!stream) { error("missing data file %s", fileName); } - + TextResourceParser p(stream, DisposeAfterUse::YES); p.parseInt(roomNumber); diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index b8cefaca95..18a2f899a8 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -50,7 +50,7 @@ static const PlainGameDescriptor dreamWebGames[] = { class DreamWebMetaEngine : public AdvancedMetaEngine { public: DreamWebMetaEngine(): - AdvancedMetaEngine(DreamWeb::gameDescriptions, + AdvancedMetaEngine(DreamWeb::gameDescriptions, sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames) { _singleid = "dreamweb"; _guioptions = Common::GUIO_NOMIDI; diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index d4fb4441f6..c80f386da1 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -21449,577 +21449,577 @@ endofgame: -void DreamGenContext::__start() { +void DreamGenContext::__start() { static const uint8 src[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00, - 0xff, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 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, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, - 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, - 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, - 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, - 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, - 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, - 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, - 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, - 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, - 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, - 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, - 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, - 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, - 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, - 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, - 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, - 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, - 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, - 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, - 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, - 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, - 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, - 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, - 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, - 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, - 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, - 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, - 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, - 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, - 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, - 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, - 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, - 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, - 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, - 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, - 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, - 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, - 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, - 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, - 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, - 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, - 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, - 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, - 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, - 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, - 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, - 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, - 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, - 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, - 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, - 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, - 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, - 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, - 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, - 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, - 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, - 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, - 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, - 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, - 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, - 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, - 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, - 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, - 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, - 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, - 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, - 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, - 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, - 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, - 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, - 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, - 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, - 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, - 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, - 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, - 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, - 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, - 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, - 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, - 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, - 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, - 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, - 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, - 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, - 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, - 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, - 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, - 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, - 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, - 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, - 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, - 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, - 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, - 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, - 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, - 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, - 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, - 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, - 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, - 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, - 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, - 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, - 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, - 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, - 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, - 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, - 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, - 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, - 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, - 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, - 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, - 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, - 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, - 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, - 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, - 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, - 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, - 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, - 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, - 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, - 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, - 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, - 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, - 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, - 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, - 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, - 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, - 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, - 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, - 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, - 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, - 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, - 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, - 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, - 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, - 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, - 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, - 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, - 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, - 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, - 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, - 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, - 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, - 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, - 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, - 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, - 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, - 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, - 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, - 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, - 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, - 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, - 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, - 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, - 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, - 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, - 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, - 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, - 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, - 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, - 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, - 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, - 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, - 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, - 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, - 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, - 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, - 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, - 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, - 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, - 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, - 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, - 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, - 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, - 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, - 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, - 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, - 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, - 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, - 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, - 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, - 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, - 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, - 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, - 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, - 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, - 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, - 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, - 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, - 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, - 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, - 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, - 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, - 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, - 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, - 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, - 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, - 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, - 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, - 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, - 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, - 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, - 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, - 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, - 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, - 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, - 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, - 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, - 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, - 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, - 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, - 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, - 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, - 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, - 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, - 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, - 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, - 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, - 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, - 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, - 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00, + 0xff, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 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, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, + 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, + 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, + 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, + 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, + 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, + 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, + 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, + 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, + 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, + 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, + 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, + 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, + 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, + 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, + 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, + 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, + 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, + 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, + 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, + 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, + 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, + 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, + 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, + 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, + 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, + 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, + 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, + 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, + 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, + 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, + 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, + 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, + 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, + 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, + 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, + 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, + 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, + 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, + 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, + 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, + 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, + 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, + 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, + 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, + 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, + 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, + 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, + 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, + 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, + 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, + 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, + 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, + 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, + 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, + 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, + 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, + 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, + 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, + 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, + 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, + 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, + 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, + 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, + 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, + 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, + 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, + 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, + 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, + 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, + 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, + 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, + 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, + 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, + 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, + 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, + 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, + 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, + 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, + 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, + 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, + 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, + 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, + 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, + 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, + 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, + 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, + 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, + 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, + 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, + 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, + 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, + 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, + 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, + 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, + 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, + 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, + 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, + 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, + 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, + 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, + 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, + 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, + 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, + 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, + 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, + 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, + 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, + 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, + 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, + 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, + 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, + 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, + 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, + 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, + 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, + 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, + 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, + 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, + 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, + 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, + 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, + 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, + 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, + 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, + 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, + 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, + 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, + 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, + 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, + 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, + 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, + 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, + 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, + 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, + 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, + 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, + 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, + 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, + 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, + 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, + 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, + 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, + 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, + 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, + 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, + 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, + 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, + 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, + 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, + 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, + 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, + 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, + 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, + 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, + 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, + 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, + 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, + 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, + 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, + 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, + 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, + 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, + 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, + 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, + 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, + 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, + 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, + 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, + 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, + 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, + 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, + 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, + 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, + 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, + 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, + 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, + 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, + 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, + 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, + 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, + 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, + 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, + 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, + 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, + 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, + 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, + 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, + 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, + 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, + 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, + 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, + 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, + 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, + 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, + 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, + 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, + 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, + 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, + 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, + 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, + 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, + 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, + 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, + 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, + 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, + 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, + 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, + 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, + 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, + 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); -dreamweb(); +dreamweb(); } void DreamGenContext::__dispatch_call(uint16 addr) { diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 7e1b9833dc..8be02dc90e 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -44,7 +44,7 @@ namespace DreamWeb { -DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : +DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb") { _context.engine = this; @@ -223,7 +223,7 @@ Common::Error DreamWebEngine::run() { _context.__start(); _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0; - + getTimerManager()->removeTimerProc(vSyncInterrupt); return Common::kNoError; @@ -428,7 +428,7 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { type = Audio::Mixer::kSFXSoundType; } else if (speech) type = Audio::Mixer::kSpeechSoundType; - else + else type = Audio::Mixer::kMusicSoundType; Audio::SeekableAudioStream *raw; @@ -445,7 +445,7 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { memcpy(buffer, data.data.begin() + sample.offset, sample.size); raw = Audio::makeRawStream( - buffer, + buffer, sample.size, 22050, Audio::FLAG_UNSIGNED); } else { uint8 *buffer = (uint8 *)malloc(_speechData.size()); @@ -453,9 +453,9 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { if (!buffer) error("out of memory: cannot allocate memory for sound(%u bytes)", _speechData.size()); raw = Audio::makeRawStream( - buffer, + buffer, _speechData.size(), 22050, Audio::FLAG_UNSIGNED); - + } Audio::AudioStream *stream; diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index a955bcfe47..e0797bc96b 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -104,7 +104,7 @@ public: void loadSounds(uint bank, const Common::String &file); bool loadSpeech(const Common::String &filename); - + void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } private: diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index bbffa7846f..724d5e4053 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -97,16 +97,16 @@ public: struct Segment { Common::Array 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); } @@ -163,7 +163,7 @@ public: assert(_segment != 0); _segment->assign(b, e); } - + inline uint8* ptr(unsigned index, unsigned size) { assert(_segment != 0); return _segment->ptr(index, size); @@ -180,7 +180,7 @@ struct Flags { inline bool l() const { return _o != _s; } inline bool le() const { return _o != _s|| _z; } - + inline void update_zs(uint8 v) { _s = v & 0x80; _z = v == 0; @@ -228,7 +228,7 @@ public: //data == fake segment register always pointing to data segment Flags flags; - inline Context(): engine(0), al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx), + 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); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index e2da072fae..be870aa52f 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -367,7 +367,7 @@ void DreamGenContext::dosreturn() { ax = data.word(kMousebutton); _and(ax, 1); - if (flags.z()) + if (flags.z()) return; data.word(kMousebutton) = 0; diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index bab1975abc..081b48fbad 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -174,7 +174,7 @@ void Inter_Fascination::oFascin_assign(OpFuncParams ¶ms) { case TYPE_VAR_INT32_AS_INT16: case TYPE_ARRAY_INT16: - WRITE_VARO_UINT16(dest + i * 2, _vm->_game->_script->getResultInt()); + WRITE_VARO_UINT16(dest + i * 2, _vm->_game->_script->getResultInt()); break; case TYPE_VAR_INT32: diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp index e2c952952d..7fb3104162 100644 --- a/engines/gob/video_v6.cpp +++ b/engines/gob/video_v6.cpp @@ -124,7 +124,7 @@ void Video_v6::drawYUV(Surface &destDesc, int16 x, int16 y, Pixel dstRow = dst; int nextChromaLine = (i < ((height - 1) & ~3) ) ? dataWidth : 0; - + for (int j = 0; j < width; j++, dstRow++) { int nextChromaColumn = (j < ((width - 1) & ~3)) ? 1 : 0; diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 33fc986193..c6e990dfcf 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -801,17 +801,17 @@ bool MusicPlayerIOS::load(uint32 fileref, bool loop) { 19468 ambient (but not 69, amb b. odd) 19470 puzzle 19471 - 19473 + 19473 19475 coffins or blood pump 19476 blood pump or coffins 19493 19499 chapel 19509 downstair ambient 19510 bedroom 'skip 3 and 5' puzzle (should loop from partway?) - 19514 + 19514 19515 bathroom drain teeth */ - if ((fileref >= 19462 && fileref <= 19468) || + if ((fileref >= 19462 && fileref <= 19468) || fileref == 19470 || fileref == 19471 || fileref == 19473 || fileref == 19475 || fileref == 19476 || fileref == 19493 || @@ -849,7 +849,7 @@ bool MusicPlayerIOS::load(uint32 fileref, bool loop) { updateVolume(); // Play! - _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handle, audStream); + _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handle, audStream); return true; } diff --git a/engines/groovie/player.h b/engines/groovie/player.h index d8135a99b2..c9258ffdbd 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -53,8 +53,8 @@ protected: Common::SeekableReadStream *_file; uint16 _flags; Audio::QueuingAudioStream *_audioStream; - - + + private: // Synchronization stuff bool _begunPlaying; diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp index 0a67b5cd0a..19fd91e3fa 100644 --- a/engines/hugo/console.cpp +++ b/engines/hugo/console.cpp @@ -64,8 +64,8 @@ bool HugoConsole::Cmd_gotoScreen(int argc, const char **argv) { if ((argc != 2) || (strToInt(argv[1]) > _vm->_numScreens)){ DebugPrintf("Usage: %s \n", argv[0]); return true; - } - + } + _vm->_scheduler->newScreen(strToInt(argv[1])); return false; } @@ -78,7 +78,7 @@ bool HugoConsole::Cmd_listScreens(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + DebugPrintf("Available screens for this game are:\n"); for (int i = 0; i < _vm->_numScreens; i++) DebugPrintf("%2d - %s\n", i, _vm->_text->getScreenNames(i)); @@ -93,7 +93,7 @@ bool HugoConsole::Cmd_listObjects(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + DebugPrintf("Available objects for this game are:\n"); for (int i = 0; i < _vm->_object->_numObj; i++) { if (_vm->_object->_objects[i].genericCmd & TAKE) @@ -110,7 +110,7 @@ bool HugoConsole::Cmd_getObject(int argc, const char **argv) { DebugPrintf("Usage: %s \n", argv[0]); return true; } - + if (_vm->_object->_objects[strToInt(argv[1])].genericCmd & TAKE) _vm->_parser->takeObject(&_vm->_object->_objects[strToInt(argv[1])]); else @@ -127,7 +127,7 @@ bool HugoConsole::Cmd_getAllObjects(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + for (int i = 0; i < _vm->_object->_numObj; i++) { if (_vm->_object->_objects[i].genericCmd & TAKE) _vm->_parser->takeObject(&_vm->_object->_objects[i]); diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index 6c816141f7..c43cdd7b46 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -95,15 +95,15 @@ void TopMenu::reflowLayout() { _recallButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; - + _turboButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; x += kButtonSpace; - + _lookButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; - + _inventButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale); x += kButtonWidth + kButtonPad; @@ -133,7 +133,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat()); byte *src = (byte *)arrayBmp[i * 2]->pixels; byte *dst = (byte *)arrayBmp[i * 2 + 1]->pixels; - + for (int j = 0; j < arrayBmp[i * 2]->h; j++) { src = (byte *)arrayBmp[i * 2]->getBasePtr(0, j); dst = (byte *)arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2); @@ -153,7 +153,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { *dst++ = *src++; } } - + in.skip(bmpSize); } } diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index c716e80d87..2d35bb0448 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -736,7 +736,7 @@ overlayState_t Screen_v1d::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) { uint16 index = (uint16)(dst_p - _frontBuffer) >> 3; for (int i = 0; i < seq_p->lines-y; i++) { // Each line in object - if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back. + if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back. return kOvlForeground; index += kCompLineSize; } diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 10d61f25a2..7b54c7701d 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -299,7 +299,7 @@ Common::Error HugoEngine::run() { _status.helpFl = false; _file->instructions(); } - + _mouse->mouseHandler(); // Mouse activity - adds to display list _screen->displayList(kDisplayDisplay); // Blit the display list to screen _status.doQuitFl |= shouldQuit(); // update game quit flag @@ -315,7 +315,7 @@ void HugoEngine::initMachine() { _object->readObjectImages(); // Read all object images if (_platform == Common::kPlatformWindows) _file->readUIFImages(); // Read all uif images (only in Win versions) - + _sound->initPcspkrPlayer(); } diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 81d194f1d6..125819a39b 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -177,7 +177,7 @@ struct status_t { // Game status (not saved) bool recallFl; // Toolbar "recall" button pressed bool newScreenFl; // New screen just loaded in dib_a bool godModeFl; // Allow DEBUG features in live version - bool showBoundariesFl; // Flag used to show and hide boundaries, + bool showBoundariesFl; // Flag used to show and hide boundaries, // used by the console bool doQuitFl; bool skipIntroFl; diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h index de9e4cd1f0..666cc37b51 100644 --- a/engines/hugo/inventory.h +++ b/engines/hugo/inventory.h @@ -56,7 +56,7 @@ private: HugoEngine *_vm; static const int kStepDy = 8; // Pixels per step movement - + int16 _firstIconId; // Index of first icon to display int16 *_invent; istate_t _inventoryState; // Inventory icon bar state diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index e888a1d998..e5c7b4bf90 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -157,7 +157,7 @@ void ObjectHandler::useObject(int16 objId) { if (inventObjId == use->objId) { // Look for secondary object, if found use matching verb bool foundFl = false; - + for (target_t *target = use->targets; target->nounIndex != 0; target++) if (target->nounIndex == obj->nounIndex) { foundFl = true; @@ -425,7 +425,7 @@ void ObjectHandler::loadObjectUses(Common::ReadStream &in) { } for (int i = 0; i < numElem; i++) { - if (varnt == _vm->_gameVariant) + if (varnt == _vm->_gameVariant) readUse(in, _uses[i]); else { readUse(in, tmpUse); diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index a79ec2c609..5cb97f2dc5 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -60,7 +60,7 @@ Parser::~Parser() { uint16 Parser::getCmdDefaultVerbIdx(const uint16 index) const { return _cmdList[index][0].verbIndex; } - + /** * Read a cmd structure from Hugo.dat */ diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index faa6dc2303..f8b9d9f13b 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -81,9 +81,9 @@ public: virtual ~Parser(); bool isWordPresent(char **wordArr) const; - + uint16 getCmdDefaultVerbIdx(const uint16 index) const; - + void charHandler(); void command(const char *format, ...); void freeParser(); diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index a099bec21c..d1b4aa6a9c 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -1040,7 +1040,7 @@ void Scheduler::saveActions(Common::WriteStream *f) const { * Find the index in the action list to be able to serialize the action to save game */ void Scheduler::findAction(const act* action, int16* index, int16* subElem) { - + assert(index && subElem); if (!action) { *index = -1; @@ -1106,7 +1106,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) { else _events[i].action = (act*)&_actListArr[index][subElem]; - _events[i].localActionFl = (f->readByte() == 1) ? true : false; + _events[i].localActionFl = (f->readByte() == 1) ? true : false; _events[i].time = f->readUint32BE(); int16 prevIndex = f->readSint16BE(); diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h index e3107809cf..60d51f0673 100644 --- a/engines/hugo/schedule.h +++ b/engines/hugo/schedule.h @@ -616,7 +616,7 @@ public: protected: virtual const char *getCypher() const; - + void promptAction(act *action); }; diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 9473536a47..1fea1f4343 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -127,7 +127,7 @@ SoundHandler::SoundHandler(HugoEngine *vm) : _vm(vm) { curPriority = 0; pcspkrTimer = 0; pcspkrOctave = 3; - pcspkrNoteDuration = 2; + pcspkrNoteDuration = 2; } SoundHandler::~SoundHandler() { @@ -290,7 +290,7 @@ void SoundHandler::pcspkr_player() { } else if (pcspkrTimer >= 0) { // Note still going return; } - + // Time to play next note do { cmd_note = true; diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 01bf3c5e26..27f3951faf 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -202,7 +202,7 @@ void LoLEngine::setupPrologueData(bool load) { void LoLEngine::showIntro() { _tim = new TIMInterpreter(this, _screen, _system); assert(_tim); - + if (_flags.platform == Common::kPlatformPC98) showStarcraftLogo(); @@ -1115,7 +1115,7 @@ void LoLEngine::showOutro(int character, bool maxDifficulty) { showCredits(); _eventList.clear(); - + if (!shouldQuit()) { switch (character) { case 0: diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 2ba0890789..be3c09de96 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -140,7 +140,7 @@ private: uint8 _sfxChannel; TownsEuphonyDriver *_driver; - + bool _cdaPlaying; const uint8 *_musicFadeTable; diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 73d435f3e5..012f1f5d7d 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -107,11 +107,11 @@ void SoundTowns::haltTrack() { g_system->getAudioCDManager()->stop(); g_system->getAudioCDManager()->updateCD(); _cdaPlaying = false; - + for (int i = 0; i < 6; i++) _driver->chanVolume(i, 0); for (int i = 0x40; i < 0x46; i++) - _driver->chanVolume(i, 0); + _driver->chanVolume(i, 0); for (int i = 0; i < 32; i++) _driver->configChan_enable(i, 0); _driver->stopParser(); @@ -128,7 +128,7 @@ void SoundTowns::loadSoundFile(uint file) { void SoundTowns::playSoundEffect(uint8 track) { if (!_sfxEnabled || !_sfxFileData) return; - + if (track == 0 || track == 10) { stopAllSoundEffects(); return; @@ -258,13 +258,13 @@ void SoundTowns::beginFadeOut() { uint16 fadeVolCur[12]; uint16 fadeVolStep[12]; - + for (int i = 0; i < 6; i++) { fadeVolCur[i] = READ_LE_UINT16(&_musicFadeTable[(_lastTrack * 12 + i) * 2]); fadeVolStep[i] = fadeVolCur[i] / 50; fadeVolCur[i + 6] = READ_LE_UINT16(&_musicFadeTable[(_lastTrack * 12 + 6 + i) * 2]); fadeVolStep[i + 6] = fadeVolCur[i + 6] / 30; - } + } for (int i = 0; i < 12; i++) { for (int ii = 0; ii < 6; ii++) @@ -344,7 +344,7 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) { uint32 trackSize = READ_LE_UINT32(_musicTrackData + 2048); uint8 startTick = _musicTrackData[2052]; - + _driver->setMusicTempo(_musicTrackData[2053]); src = _musicTrackData + 2054; diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 49b6ef78ba..8d6c557297 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -470,7 +470,7 @@ public: bool isEmpty() const { return _actions.begin() == _actions.end(); } void clear() { _actions.clear(); } CurrentActionEntry &top() { return **_actions.begin(); } - CurrentActionEntry &bottom() { + CurrentActionEntry &bottom() { ActionsList::iterator i = _actions.end(); --i; return **i; diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp index 39a3f175cd..4f315dd396 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -91,7 +91,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S _scrollY = animStream->readSint16LE(); _scrollTicks = animStream->readUint16LE(); animStream->skip(8); - + animStream->read(buffer, FILENAME_SIZE); buffer[FILENAME_SIZE] = '\0'; _interfaceFile = Common::String(buffer); @@ -230,7 +230,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S // Load all the sprite sets for the animation for (int i = 0; i < spriteListCount; ++i) { if (_field12 && (i == _spriteListIndex)) - // Skip over field, since it's manually loaded + // Skip over field, since it's manually loaded continue; _spriteListIndexes[i] = _view->_spriteSlots.addSprites(_spriteSetNames[i].c_str()); @@ -242,7 +242,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S if (madsRes) resName += "*"; resName += _spriteSetNames[_spriteListIndex]; - + _spriteListIndexes[_spriteListIndex] = _view->_spriteSlots.addSprites(resName.c_str()); } @@ -298,7 +298,7 @@ void MadsAnimation::update() { if (_field12) { int spriteListIndex = _spriteListIndexes[_spriteListIndex]; int newIndex = -1; - + for (uint idx = _oldFrameEntry; idx < _frameEntries.size(); ++idx) { if (_frameEntries[idx].frameNumber > _currentFrame) break; @@ -378,7 +378,7 @@ void MadsAnimation::update() { if (_frameEntries[_oldFrameEntry].frameNumber > _currentFrame) break; else if (_frameEntries[_oldFrameEntry].frameNumber == _currentFrame) { - // Found the correct frame + // Found the correct frame int spriteSlotIndex = 0; int index = 0; @@ -393,14 +393,14 @@ void MadsAnimation::update() { } ++index; continue; - } - + } + if (spriteSlotIndex == 0) { int slotIndex = _view->_spriteSlots.getIndex(); MadsSpriteSlot &slot = _view->_spriteSlots[slotIndex]; slot.copy(_frameEntries[_oldFrameEntry].spriteSlot); slot.seqIndex = _frameEntries[_oldFrameEntry].seqIndex + 0x80; - + SpriteAsset &spriteSet = _view->_spriteSlots.getSprite( _view->_spriteSlots[slotIndex].spriteListIndex); slot.spriteType = spriteSet.isBackground() ? BACKGROUND_SPRITE : FOREGROUND_SPRITE; @@ -408,7 +408,7 @@ void MadsAnimation::update() { break; } } - + ++_oldFrameEntry; } diff --git a/engines/m4/assets.cpp b/engines/m4/assets.cpp index 8ffdeb53e0..d6cc71e133 100644 --- a/engines/m4/assets.cpp +++ b/engines/m4/assets.cpp @@ -97,8 +97,8 @@ long *DataAsset::getRow(int index) { return &_data[_recSize * index]; } -SpriteAsset::SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name, - bool asStream, int flags) : +SpriteAsset::SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name, + bool asStream, int flags) : BaseAsset(vm) { _stream = stream; _palInterface = NULL; @@ -285,7 +285,7 @@ void SpriteAsset::loadMadsSpriteAsset(MadsM4Engine *vm, Common::SeekableReadStre // Load the frame Common::MemoryReadStream *rs = new Common::MemoryReadStream(destData, frameSizes[curFrame]); - _frames[curFrame].frame = new M4Sprite(rs, _frames[curFrame].x, _frames[curFrame].y, + _frames[curFrame].frame = new M4Sprite(rs, _frames[curFrame].x, _frames[curFrame].y, _frames[curFrame].w, _frames[curFrame].h, false); delete rs; @@ -634,7 +634,7 @@ MadsSpriteSetCharInfo::MadsSpriteSetCharInfo(Common::SeekableReadStream *s) { _totalFrames = s->readByte(); s->skip(1); _numEntries = s->readUint16LE(); - + for (int i = 0; i < 16; ++i) _frameList[i] = s->readUint16LE(); for (int i = 0; i < 16; ++i) diff --git a/engines/m4/assets.h b/engines/m4/assets.h index 90670dde53..25996a421e 100644 --- a/engines/m4/assets.h +++ b/engines/m4/assets.h @@ -115,7 +115,7 @@ public: class SpriteAsset : public BaseAsset { public: - SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name, + SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name, bool asStream = false, int flags = 0); SpriteAsset(MadsM4Engine *vm, const char *name); ~SpriteAsset(); @@ -151,7 +151,7 @@ protected: Common::Array _frameOffsets; Common::Array _frames; uint32 _frameStartOffset; - + // MADS sprite set fields uint8 _mode; bool _isBackground; diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index afe2692753..390ca711d1 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -532,7 +532,7 @@ void Dialog::display(MadsM4Engine *vm, int widthChars, const char **descEntries) } dlg->_lines[0].underline = true; - + dlg->draw(); vm->_viewManager->addView(dlg); vm->_viewManager->moveToFront(dlg); @@ -554,7 +554,7 @@ void Dialog::getValue(MadsM4Engine *vm, const char *title, const char *text, int vm->_viewManager->moveToFront(dlg); // TODO: How to wait until the dialog is closed - + } } // End of namespace M4 diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp index f8225fba3e..b476d08c9c 100644 --- a/engines/m4/events.cpp +++ b/engines/m4/events.cpp @@ -253,7 +253,7 @@ bool Mouse::setCursorNum(int cursorIndex) { _cursor = _cursorSprites->getFrame(cursorIndex); // Set the cursor to the sprite - CursorMan.replaceCursor((const byte *)_cursor->getBasePtr(), _cursor->width(), _cursor->height(), + CursorMan.replaceCursor((const byte *)_cursor->getBasePtr(), _cursor->width(), _cursor->height(), _cursor->xOffset, _cursor->yOffset, TRANSPARENT_COLOR_INDEX); return true; diff --git a/engines/m4/font.h b/engines/m4/font.h index b00a393811..5a9c73e5d5 100644 --- a/engines/m4/font.h +++ b/engines/m4/font.h @@ -108,7 +108,7 @@ public: Font *getFont(const char *filename); void setFont(const char *filename); - Font *current() { + Font *current() { assert(_currentFont); return _currentFont; } diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index bf2c3abe1c..f4aab8ae8f 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -414,7 +414,7 @@ const char *MadsGlobals::loadMessage(uint index) { } /** - * Adds the specified scene number to list of scenes previously visited + * Adds the specified scene number to list of scenes previously visited */ void MadsGlobals::addVisitedScene(int newSceneNumber) { if (!isSceneVisited(newSceneNumber)) @@ -539,7 +539,7 @@ void MadsObject::load(Common::SeekableReadStream *stream) { } void MadsObject::setRoom(int roomNumber) { - + } } // End of namespace M4 diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 786c975850..4c272de32c 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -408,7 +408,7 @@ void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int dest * Copies a given image onto a destination surface with scaling, transferring only pixels that meet * the specified depth requirement on a secondary surface contain depth information */ -void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, +void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthsSurface, int scale, int transparentColor) { if (scale == 100) { @@ -451,7 +451,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, } src->freeData(); - depthsSurface->freeData(); + depthsSurface->freeData(); return; } @@ -501,7 +501,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, widthAmount -= destRight; if (widthAmount > 0) spriteWidth -= widthAmount; - + int spriteRight = spriteLeft + spriteWidth; if (spriteWidth <= 0) return; @@ -568,7 +568,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, } src->freeData(); - depthsSurface->freeData(); + depthsSurface->freeData(); this->freeData(); } @@ -919,7 +919,7 @@ void M4Surface::scrollY(int yAmount) { // Vertically shift all the lines Common::copy(pixelsP + (pitch * ySize), pixelsP + (pitch * height()), pixelsP); // Transfer the buffered lines to the bottom of the screen - Common::copy(tempData, tempData + blockSize, pixelsP + (pitch * (height() - ySize))); + Common::copy(tempData, tempData + blockSize, pixelsP + (pitch * (height() - ySize))); } ::free(tempData); @@ -945,7 +945,7 @@ void M4Surface::translate(RGBList *list, bool isTransparent) { M4Surface *M4Surface::flipHorizontal() const { M4Surface *dest = new M4Surface(width(), height()); dest->_rgbList = (this->_rgbList == NULL) ? NULL : this->_rgbList->clone(); - + byte *destP = dest->getBasePtr(); for (int y = 0; y < height(); ++y) { diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index 242857ba1a..f3dde454f3 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -170,7 +170,7 @@ public: void frameRect(const Common::Rect &r, uint8 color); void fillRect(const Common::Rect &r, uint8 color); void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, int transparentColor = -1); - void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface, + void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface, int scale, int transparentColor = -1); void update() { diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 93f5ab4cba..efc7943114 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -259,7 +259,7 @@ void MadsM4Engine::dumpFile(const char *filename, bool uncompress) { Common::DumpFile f; byte buffer[DUMP_BUFFER_SIZE]; Common::SeekableReadStream *fileS = res()->get(filename); - + if (!f.open(filename)) error("Could not open '%s' for writing", filename); diff --git a/engines/m4/m4.h b/engines/m4/m4.h index 18c3936db8..46107cb20a 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -94,7 +94,7 @@ class Animation; enum M4GameType { GType_Riddle = 1, GType_Burger = 2, - GType_RexNebular = 3, + GType_RexNebular = 3, GType_DragonSphere = 4, GType_Phantom = 5 }; diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp index 4eb84a7488..78c409252b 100644 --- a/engines/m4/m4_views.cpp +++ b/engines/m4/m4_views.cpp @@ -217,7 +217,7 @@ const char *INTERFACE_SERIES = "999intr"; #define SPR(x) _sprites->getFrame(x) -M4InterfaceView::M4InterfaceView(MadsM4Engine *vm): +M4InterfaceView::M4InterfaceView(MadsM4Engine *vm): GameInterfaceView(vm, Common::Rect(0, vm->_screen->height() - INTERFACE_HEIGHT, vm->_screen->width(), vm->_screen->height())), _statusText(GUITextField(this, Common::Rect(200, 1, 450, 21))), diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index d35b31943a..2ea576dfa4 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -536,7 +536,7 @@ void AnimviewView::updateState() { // Clear up current background and sprites _backgroundSurface.reset(); clearLists(); - + // Reset flags _startFrame = -1; diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index b1e57bd7f3..cc28a26e68 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -177,7 +177,7 @@ void MadsSceneLogic::initializeDataMap() { uint32 MadsSceneLogic::getDataValue(int dataId) { switch (dataId) { - case 1: + case 1: return _madsVm->scene()->_abortTimersMode2; case 2: return _madsVm->scene()->_abortTimers; @@ -208,7 +208,7 @@ uint32 MadsSceneLogic::getDataValue(int dataId) { void MadsSceneLogic::setDataValue(int dataId, uint16 dataValue) { switch (dataId) { - case 1: + case 1: _madsVm->scene()->_abortTimersMode2 = (AbortTimerMode)dataValue; break; case 2: @@ -297,7 +297,7 @@ uint16 MadsSceneLogic::startReversibleSpriteSequence(uint16 srcSpriteIdx, bool f uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_REVERSIBLE, 0, 0); } @@ -306,7 +306,7 @@ uint16 MadsSceneLogic::startCycledSpriteSequence(uint16 srcSpriteIdx, bool flipp uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_CYCLED, 0, 0); } @@ -315,7 +315,7 @@ uint16 MadsSceneLogic::startSpriteSequence3(uint16 srcSpriteIdx, bool flipped, i uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, -1, ANIMTYPE_CYCLED, 0, 0); } @@ -335,11 +335,11 @@ void MadsSceneLogic::getPlayerSpritesPrefix() { strcpy(_madsVm->_player._spritesPrefix, "RXSM"); else if (_madsVm->globals()->_nextSceneId == 112) strcpy(_madsVm->_player._spritesPrefix, ""); - + if (strcmp(oldName, _madsVm->_player._spritesPrefix) != 0) _madsVm->_player._spritesChanged = true; - if ((_madsVm->globals()->_nextSceneId == 105) || + if ((_madsVm->globals()->_nextSceneId == 105) || ((_madsVm->globals()->_nextSceneId == 109) && (_madsVm->globals()->_globals[15] != 0))) { // TODO: unknown flag setting _madsVm->_player._spritesChanged = true; @@ -420,7 +420,7 @@ void MadsSceneLogic::initializeScripts() { if ((language != 1) || (_madsVm->getLanguage() != Common::EN_ANY)) continue; - // Found script block for the given game and language. + // Found script block for the given game and language. _scriptsSize = (i < (offsets.size() - 1)) ? offsets[i + 1] - offsets[i] : f.size() - offsets[i]; break; } @@ -433,7 +433,7 @@ void MadsSceneLogic::initializeScripts() { // Load up the list of subroutines into a hash map uint32 blockOffset = f.pos() - 3; - uint32 subsStart = 0; + uint32 subsStart = 0; for (;;) { // Get next entry Common::String subName; @@ -593,12 +593,12 @@ void MadsSceneLogic::execute(uint32 subOffset) { } case OP_DSTORE: { // Stores data variable - param = getParam(scriptOffset, opcode); + param = getParam(scriptOffset, opcode); ScriptVar v = stack.pop(); setDataValue(param, v.isInt() ? v.get() : 0); break; } - + case OP_LOAD: // loads local variable onto stack param = getParam(scriptOffset, opcode); stack.push(locals[param]); @@ -621,7 +621,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_GSTORE: // pops stack and stores in global variable param = getParam(scriptOffset, opcode); - assert(param < TOTAL_NUM_VARIABLES); + assert(param < TOTAL_NUM_VARIABLES); _madsVm->globals()->_globals[param] = stack.pop().get(); break; @@ -647,7 +647,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { // Condition satisfied - do the jump scriptOffset = param; break; - + case OP_JMPTRUE: // conditional jump param = subOffset + getParam(scriptOffset, opcode); if (stack.pop().get() != 0) @@ -708,7 +708,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_OR: param1 |= param2; break; case OP_EOR: param1 ^= param2; break; } - + stack.push(ScriptVar(param1)); } break; @@ -774,7 +774,7 @@ uint32 MadsSceneLogic::getParam(uint32 &scriptOffset, int opcode) { */ void MadsSceneLogic::getCallParameters(int numParams, Common::Stack &stack, ScriptVar *callParams) { assert(numParams <= MAX_CALL_PARAMS); - for (int i = 0; i < numParams; ++i, ++callParams) + for (int i = 0; i < numParams; ++i, ++callParams) *callParams = stack.pop(); } @@ -881,7 +881,7 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack &stac case 14: { // DynamicHotspots_add EXTRACT_PARAMS(7); - int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2], + int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2], Common::Rect(p[6], p[5], p[6] + p[4], p[5] + p[3])); stack.push(ScriptVar(idx)); break; diff --git a/engines/m4/mads_logic.h b/engines/m4/mads_logic.h index 3132094252..4f0b0d5ba2 100644 --- a/engines/m4/mads_logic.h +++ b/engines/m4/mads_logic.h @@ -19,8 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The MADS game logic is all hard-coded into the games, although for Rex at least - * it seems to use only a fairly basic set of instructions and function calls, so it should be - * possible + * it seems to use only a fairly basic set of instructions and function calls, so it should be + * possible */ #ifndef M4_MADS_LOGIC_H diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp index fa65329d76..8a2ab67f11 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -210,7 +210,7 @@ void RexMainMenuView::updateState() { M4Sprite *spr = _menuItem->getFrame(0); itemSize = _menuItem->getFrame(0)->height(); spr->copyTo(this, _menuItemPosList[_menuItemIndex - 1].x, - _menuItemPosList[_menuItemIndex - 1].y + row + (itemSize / 2) - (spr->height() / 2), + _menuItemPosList[_menuItemIndex - 1].y + row + (itemSize / 2) - (spr->height() / 2), spr->getTransparencyIndex()); delete _menuItem; @@ -876,7 +876,7 @@ void RexDialogView::addLine(const char *msg_p, Font *font, MadsTextAlignment ali } break; } - + case RIGHT_ALIGN: // Right align (moving left from given passed left) rec->pos.x = left - font->getWidth(rec->text); @@ -920,7 +920,7 @@ void RexDialogView::setClickableLines() { for (int i = 0; i < DIALOG_LINES_SIZE; ++i) { if (_dialogText[i].in_use) { // Add an entry for the line - _screenObjects.add(Common::Rect(_dialogText[i].pos.x, _dialogText[i].pos.y, + _screenObjects.add(Common::Rect(_dialogText[i].pos.x, _dialogText[i].pos.y, _dialogText[i].pos.x + _dialogText[i].font->getWidth(_dialogText[i].text, _dialogText[i].widthAdjust), _dialogText[i].pos.y + _dialogText[i].font->getHeight()), 19, i, 1); } @@ -988,7 +988,7 @@ RexGameMenuDialog::RexGameMenuDialog(): RexDialogView() { void RexGameMenuDialog::addLines() { // Add the title int top = MADS_Y_OFFSET - 2 - ((((_vm->_font->current()->getHeight() + 2) * 6) >> 1) - 78); - + addQuote(_vm->_font->current(), ALIGN_CENTER, 0, top, 10); // Loop for adding the option lines of the dialog @@ -1163,7 +1163,7 @@ bool RexOptionsDialog::onEvent(M4EventType eventType, int32 param1, int x, int y return true; } - // Update the option selections + // Update the option selections reload(); } diff --git a/engines/m4/mads_player.cpp b/engines/m4/mads_player.cpp index 0b83b54ff5..73480088ee 100644 --- a/engines/m4/mads_player.cpp +++ b/engines/m4/mads_player.cpp @@ -46,7 +46,7 @@ MadsPlayer::MadsPlayer() { _unk4 = false; _spritesChanged = true; - + _direction = 0; _newDirection = 0; _priorTimer = 0; @@ -131,7 +131,7 @@ void MadsPlayer::update() { // Figure out the depth for the sprite int newDepth = 1; int yp = MIN(_playerPos.y, (int16)155); - + for (int idx = 1; idx < 15; ++idx) { if (_madsVm->scene()->getSceneResources()._depthBands[newDepth] >= yp) newDepth = idx + 1; @@ -199,7 +199,7 @@ void MadsPlayer::updateFrame() { _unk2 = 0; } else { _unk2 = _actionList2[_actionIndex]; - + if (_actionIndex > 0) --_actionIndex; } @@ -237,7 +237,7 @@ void MadsPlayer::setupFrame() { _frameCount = spriteSet.getCount(); _yScale = spriteSet._charInfo->_yScale; - + if ((_frameNum <= 0) || (_frameNum > _frameCount)) _frameNum = 1; _forceRefresh = true; @@ -336,7 +336,7 @@ void MadsPlayer::setDest(int destX, int destY, int facing) { setTicksAmount(); _moving = true; _destFacing = facing; - + _madsVm->scene()->getSceneResources().setRouteNode(_madsVm->scene()->getSceneResources()._nodes.size() - 2, _playerPos, _madsVm->scene()->_depthSurface); _madsVm->scene()->getSceneResources().setRouteNode(_madsVm->scene()->getSceneResources()._nodes.size() - 1, @@ -448,7 +448,7 @@ void MadsPlayer::move() { bool routeFlag = false; if (_moving) { - int idx = _routeCount; + int idx = _routeCount; while (!_v844C0 && (_destPos.x == _playerPos.x) && (_destPos.y == _playerPos.y)) { if (idx != 0) { --idx; @@ -650,7 +650,7 @@ int MadsPlayer::scanPath(M4Surface *depthSurface, const Common::Point &srcPos, c srcP += xDirection; } - + return 0; } @@ -730,12 +730,12 @@ void MadsPlayer::startMovement() { int majorChange = MAX(xDiff, yDiff); _v84530 = (majorChange == 0) ? 0 : _hypotenuse / majorChange; - + if (_playerPos.x > _destPos.x) _v8452C = MAX(_posChange.x, _posChange.y); else _v8452C = 0; - + _hypotenuse /= 100; _v8452E = -_v84530; } diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index a0acbdd69d..5f160aa300 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -169,7 +169,7 @@ void MadsScene::loadScene(int sceneNumber) { } _abortTimers = 0; _abortTimersMode2 = ABORTMODE_1; - + // Do any scene specific setup if (_vm->getGameType() == GType_RexNebular) @@ -376,7 +376,7 @@ void MadsScene::updateState() { if (_madsVm->globals()->_config.easyMouse) _action.refresh(); - + if ((_activeAnimation) && !_abortTimers) { _activeAnimation->update(); if (((MadsAnimation *) _activeAnimation)->freeFlag() || freeFlag) { @@ -598,7 +598,7 @@ void MadsScene::loadAnimation(const Common::String &animName, int abortTimers) { bool MadsScene::getDepthHighBit(const Common::Point &pt) { const byte *p = _depthSurface->getBasePtr(pt.x, pt.y); - if (_sceneResources._depthStyle == 2) + if (_sceneResources._depthStyle == 2) return ((*p << 4) & 0x80) != 0; return (*p & 0x80) != 0; @@ -653,7 +653,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su _depthStyle = stream->readUint16LE(); _width = stream->readUint16LE(); _height = stream->readUint16LE(); - + stream->skip(24); int nodeCount = stream->readUint16LE(); @@ -771,7 +771,7 @@ void MadsSceneResources::setRouteNode(int nodeIndex, const Common::Point &pt, M4 if (hypotenuse >= 0x3FFF) // Shouldn't ever be this large hypotenuse = 0x3FFF; - + entry = hypotenuse | flags; _nodes[idx].indexes[nodeIndex] = entry; _nodes[nodeIndex].indexes[idx] = entry; @@ -794,7 +794,7 @@ int MadsSceneResources::getRouteFlags(const Common::Point &src, const Common::Po ++yDiff; byte *srcP = depthSurface->getBasePtr(src.x, src.y); - + int totalCtr = majorDiff; for (int xCtr = 0; xCtr < xDiff; ++xCtr, srcP += xDirection) { totalCtr += yDiff; @@ -837,7 +837,7 @@ int MadsSceneResources::getRouteFlags(const Common::Point &src, const Common::Po *-------------------------------------------------------------------------- */ -MadsInterfaceView::MadsInterfaceView(MadsM4Engine *vm): GameInterfaceView(vm, +MadsInterfaceView::MadsInterfaceView(MadsM4Engine *vm): GameInterfaceView(vm, Common::Rect(0, MADS_SURFACE_HEIGHT, vm->_screen->width(), vm->_screen->height())) { _screenType = VIEWID_INTERFACE; _highlightedElement = -1; @@ -1078,7 +1078,7 @@ bool MadsInterfaceView::onEvent(M4EventType eventType, int32 param1, int x, int // A standard action was selected int verbId = kVerbLook + (_highlightedElement - ACTIONS_START); warning("Selected action #%d", verbId); - + } else if ((_highlightedElement >= VOCAB_START) && (_highlightedElement < (VOCAB_START + 5))) { // A vocab action was selected MadsObject *obj = _madsVm->globals()->getObject(_selectedObject); @@ -1259,8 +1259,8 @@ void MadsInterfaceView::leaveScene() { //-------------------------------------------------------------------------- -int getActiveAnimationBool() { - return (_madsVm->scene()->activeAnimation()) ? 1 : 0; +int getActiveAnimationBool() { + return (_madsVm->scene()->activeAnimation()) ? 1 : 0; } int getAnimationCurrentFrame() { diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index b66591a207..0521903c95 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -99,7 +99,7 @@ void MadsAction::set() { // Use/to action int selectedObject = _madsVm->scene()->getInterface()->getSelectedObject(); MadsObject *objEntry = _madsVm->globals()->getObject(selectedObject); - + _action.objectNameId = objEntry->_descId; _currentAction = objEntry->_vocabList[_selectedRow].vocabId; @@ -244,7 +244,7 @@ void MadsAction::refresh() { // Add a new text display entry to display the status text at the bottom of the screen area uint colors = (_vm->getGameType() == GType_DragonSphere) ? 0x0300 : 0x0003; - _statusTextIndex = _owner._textDisplay.add(160 - (strWidth / 2), + _statusTextIndex = _owner._textDisplay.add(160 - (strWidth / 2), MADS_SURFACE_HEIGHT + _owner._posAdjust.y - 13, colors, textSpacing, _statusText, font); } } @@ -476,7 +476,7 @@ void MadsSpriteSlots::drawBackground() { if (slot.depth > 1) { // Draw the frame with depth processing - _owner._bgSurface->copyFrom(frame, xp, yp, slot.depth, _owner._depthSurface, 100, + _owner._bgSurface->copyFrom(frame, xp, yp, slot.depth, _owner._depthSurface, 100, frame->getTransparencyIndex()); } else { // No depth, so simply draw the image @@ -526,7 +526,7 @@ void MadsSpriteSlots::drawForeground(M4Surface *viewport) { if ((slot.scale < 100) && (slot.scale != -1)) { // Minimalised drawing - viewport->copyFrom(spr, slot.xp, slot.yp, slot.depth, _owner._depthSurface, slot.scale, + viewport->copyFrom(spr, slot.xp, slot.yp, slot.depth, _owner._depthSurface, slot.scale, sprite->getTransparencyIndex()); } else { int xp, yp; @@ -665,7 +665,7 @@ void MadsTextDisplay::draw(M4Surface *view) { for (uint idx = 0; idx < _entries.size(); ++idx) { if (_entries[idx].active && (_entries[idx].expire >= 0)) { _entries[idx].font->setColors(_entries[idx].color1, _entries[idx].color2, 0); - _entries[idx].font->writeString(view, _entries[idx].msg, + _entries[idx].font->writeString(view, _entries[idx].msg, _entries[idx].bounds.left, _entries[idx].bounds.top, _entries[idx].bounds.width(), _entries[idx].spacing); } @@ -728,7 +728,7 @@ int MadsKernelMessageList::add(const Common::Point &pt, uint fontColor, uint8 fl rec.frameTimer = _madsVm->_currentTimer; rec.abortTimers = abortTimers; rec.abortMode = _owner._abortTimersMode2; - + for (int i = 0; i < 3; ++i) rec.actionNouns[i] = _madsVm->globals()->actionNouns[i]; @@ -850,7 +850,7 @@ void MadsKernelMessageList::processText(int msgIndex) { y1 = seqEntry.msgPos.y; } } - + if (msg.flags & KMSG_PLAYER_TIMEOUT) { if (word_8469E != 0) { // TODO: Figure out various flags @@ -867,7 +867,7 @@ void MadsKernelMessageList::processText(int msgIndex) { msg.msg[msg.msgOffset] = msg.asciiChar; char *msgP = &msg.msg[++msg.msgOffset]; *msgP = msg.asciiChar2; - + msg.asciiChar = *msgP; msg.asciiChar2 = *(msgP + 1); @@ -884,7 +884,7 @@ void MadsKernelMessageList::processText(int msgIndex) { flag = true; } - int strWidth = _talkFont->getWidth(msg.msg, _owner._textSpacing); + int strWidth = _talkFont->getWidth(msg.msg, _owner._textSpacing); if (msg.flags & (KMSG_RIGHT_ALIGN | KMSG_CENTER_ALIGN)) { x1 -= (msg.flags & KMSG_CENTER_ALIGN) ? strWidth / 2 : strWidth; @@ -935,7 +935,7 @@ ScreenObjects::ScreenObjects(MadsView &owner): _owner(owner) { _category = 0; _objectIndex = 0; } - + /** * Clears the entries list */ @@ -1153,7 +1153,7 @@ void MadsDirtyAreas::setSpriteSlot(int dirtyIdx, const MadsSpriteSlot &spriteSlo SpriteAsset &spriteSet = _owner._spriteSlots.getSprite(spriteSlot.spriteListIndex); M4Sprite *frame = spriteSet.getFrame(((spriteSlot.frameNumber & 0x7fff) - 1) & 0x7f); - + if (spriteSlot.scale == -1) { width = frame->width(); height = frame->height(); @@ -1270,8 +1270,8 @@ bool MadsSequenceList::addSubEntry(int index, SequenceSubEntryMode mode, int fra return false; } -int MadsSequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks, - int msgX, int msgY, bool nonFixed, char scale, uint8 depth, int frameInc, SpriteAnimType animType, int numSprites, +int MadsSequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks, + int msgX, int msgY, bool nonFixed, char scale, uint8 depth, int frameInc, SpriteAnimType animType, int numSprites, int frameStart) { // Find a free slot @@ -1340,7 +1340,7 @@ void MadsSequenceList::setSpriteSlot(int seqIndex, MadsSpriteSlot &spriteSlot) { spriteSlot.frameNumber = (timerEntry.flipped ? 0x8000 : 0) | timerEntry.frameIndex; spriteSlot.depth = timerEntry.depth; spriteSlot.scale = timerEntry.scale; - + if (!timerEntry.nonFixed) { spriteSlot.xp = timerEntry.msgPos.x; spriteSlot.yp = timerEntry.msgPos.y; @@ -1420,7 +1420,7 @@ bool MadsSequenceList::loadSprites(int seqIndex) { seqEntry.frameInc = 1; } else { // Otherwise reset back to last sprite for further reverse animating - seqEntry.frameIndex = seqEntry.numSprites; + seqEntry.frameIndex = seqEntry.numSprites; } } @@ -1478,7 +1478,7 @@ void MadsSequenceList::tick() { continue; // Set the next timeout for the timer entry - seqEntry.timeout = currentTimer + seqEntry.numTicks; + seqEntry.timeout = currentTimer + seqEntry.numTicks; // Action the sprite if (loadSprites(idx)) { @@ -1509,7 +1509,7 @@ void MadsSequenceList::setAnimRange(int seqIndex, int startVal, int endVal) { tempStart = 1; break; } - + switch (endVal) { case -2: case 0: @@ -1558,7 +1558,7 @@ Animation::~Animation() { MadsView::MadsView(View *view): _view(view), _dynamicHotspots(*this), _sequenceList(*this), _kernelMessages(*this), _spriteSlots(*this), _dirtyAreas(*this), _textDisplay(*this), _screenObjects(*this), _action(*this) { - + _textSpacing = -1; _newTimeout = 0; _abortTimers = 0; @@ -1590,8 +1590,8 @@ void MadsView::refresh() { // Merge any identified dirty areas _dirtyAreas.merge(1, DIRTY_AREAS_SIZE); - - // Copy dirty areas to the main display surface + + // Copy dirty areas to the main display surface _dirtyAreas.copy(_viewport, _bgSurface, _posAdjust); // Handle dirty areas for foreground objects diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h index 6be2283a32..41caaa2ded 100644 --- a/engines/m4/mads_views.h +++ b/engines/m4/mads_views.h @@ -208,7 +208,7 @@ public: #define TIMED_TEXT_SIZE 10 #define INDEFINITE_TIMEOUT 9999999 -enum KernelMessageFlags {KMSG_QUOTED = 1, KMSG_PLAYER_TIMEOUT = 2, KMSG_SEQ_ENTRY = 4, KMSG_SCROLL = 8, KMSG_RIGHT_ALIGN = 0x10, +enum KernelMessageFlags {KMSG_QUOTED = 1, KMSG_PLAYER_TIMEOUT = 2, KMSG_SEQ_ENTRY = 4, KMSG_SCROLL = 8, KMSG_RIGHT_ALIGN = 0x10, KMSG_CENTER_ALIGN = 0x20, KMSG_EXPIRE = 0x40, KMSG_ACTIVE = 0x80}; class MadsKernelMessageEntry { @@ -388,7 +388,7 @@ struct MadsSequenceEntry { int8 active; int8 spriteListIndex; bool flipped; - + int frameIndex; int frameStart; int numSprites; @@ -402,7 +402,7 @@ struct MadsSequenceEntry { bool nonFixed; int field_13; - + Common::Point msgPos; int triggerCountdown; bool doneFlag; @@ -424,10 +424,10 @@ private: public: MadsSequenceList(MadsView &owner); - MadsSequenceEntry &operator[](int index) { return _entries[index]; } + MadsSequenceEntry &operator[](int index) { return _entries[index]; } void clear(); bool addSubEntry(int index, SequenceSubEntryMode mode, int frameIndex, int abortVal); - int add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, + int add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks, int msgX, int msgY, bool nonFixed, char scale, uint8 depth, int frameInc, SpriteAnimType animType, int numSprites, int frameStart); void remove(int seqIndex); @@ -452,7 +452,7 @@ public: virtual void setCurrentFrame(int frameNumber) = 0; virtual int getCurrentFrame() = 0; }; - + class MadsView { private: diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp index 2ae29ca0bb..f5b2050052 100644 --- a/engines/m4/resource.cpp +++ b/engines/m4/resource.cpp @@ -313,7 +313,7 @@ const char *MADSResourceManager::getResourceFilename(const char *resourceName) { /** * Forms a resource name based on the passed specifiers */ -const char *MADSResourceManager::getResourceName(char asciiCh, int prefix, ExtensionType extType, +const char *MADSResourceManager::getResourceName(char asciiCh, int prefix, ExtensionType extType, const char *suffix, int index) { static char resourceName[100]; diff --git a/engines/m4/resource.h b/engines/m4/resource.h index 00c54a3680..c13c293544 100644 --- a/engines/m4/resource.h +++ b/engines/m4/resource.h @@ -109,7 +109,7 @@ public: enum ResourceType {RESTYPE_ROOM, RESTYPE_SC, RESTYPE_TEXT, RESTYPE_QUO, RESTYPE_I, RESTYPE_OB, RESTYPE_FONT, RESTYPE_SOUND, RESTYPE_SPEECH, RESTYPE_HAS_EXT, RESTYPE_NO_EXT}; -enum ExtensionType {EXTTYPE_SS = 1, EXTTYPE_AA = 2, EXTTYPE_DAT = 3, EXTTYPE_HH = 4, EXTTYPE_ART = 5, +enum ExtensionType {EXTTYPE_SS = 1, EXTTYPE_AA = 2, EXTTYPE_DAT = 3, EXTTYPE_HH = 4, EXTTYPE_ART = 5, EXTTYPE_INT = 6, EXTTYPE_NONE = -1}; enum ResourcePrefixType {RESPREFIX_GL = 1, RESPREFIX_SC = 2, RESPREFIX_RM = 3}; diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp index a38be20086..be49dcb13f 100644 --- a/engines/m4/scene.cpp +++ b/engines/m4/scene.cpp @@ -36,7 +36,7 @@ namespace M4 { -Scene::Scene(MadsM4Engine *vm, SceneResources *res): View(vm, Common::Rect(0, 0, vm->_screen->width(), +Scene::Scene(MadsM4Engine *vm, SceneResources *res): View(vm, Common::Rect(0, 0, vm->_screen->width(), vm->_screen->height())), _sceneResources(res) { _screenType = VIEWID_SCENE; @@ -142,7 +142,7 @@ void Scene::showCodes() { // Show the walk areas for the M4 engine in black and white const byte *srcP = (const byte *)_walkSurface->getBasePtr(0, 0); byte *destP = _backgroundSurface->getBasePtr(0, 0); - + for (int i = 0; i < _walkSurface->width() * _walkSurface->height(); i++) destP[i] = (srcP[i] & 0x10) ? 0xFF : 0; @@ -154,7 +154,7 @@ void Scene::showCodes() { _vm->_palette->setPalette(colors, 0, 256); } else { // MADS handling - + // copy the walk data to the background, in whatever current palette is active _walkSurface->copyTo(_backgroundSurface); diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index d10dea5cad..76eae8a661 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -97,8 +97,8 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel) _mixer->playStream(Audio::Mixer::kSFXSoundType, &handle->handle, stream, -1, volume); } -void Sound::playSound(int soundNum) { - warning("TODO: playSound(%d)", soundNum); +void Sound::playSound(int soundNum) { + warning("TODO: playSound(%d)", soundNum); } void Sound::pauseSound() { diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp index 1a3228d1bb..d0741732f3 100644 --- a/engines/m4/sprite.cpp +++ b/engines/m4/sprite.cpp @@ -182,7 +182,7 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) { } } } - + // Check if we need to scan forward to find the end of the line if (!newLine) { do { diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 1151339d49..004f1462a6 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -511,7 +511,7 @@ int16 GameDatabaseV2::loadgame(const char *filename, int16 version) { _objects[i]->load(*in); } delete in; - + _objectPropertyCache.clear(); // make sure to clear cache return result; } @@ -642,7 +642,7 @@ void GameDatabaseV3::load(Common::SeekableReadStream &sourceS) { void GameDatabaseV3::reloadFromStream(Common::SeekableReadStream &sourceS) { sourceS.seek(_gameStateOffs); sourceS.read(_gameState, _gameStateSize); - + _objectPropertyCache.clear(); // make sure to clear cache } @@ -734,9 +734,9 @@ int16 GameDatabaseV3::loadgame(const char *filename, int16 version) { in->skip(64); // skip savegame description in->read(_gameState, _gameStateSize); delete in; - + _objectPropertyCache.clear(); // make sure to clear cache - + return 0; } diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp index d54e2dac6b..f61516c91d 100644 --- a/engines/mohawk/bitmap.cpp +++ b/engines/mohawk/bitmap.cpp @@ -910,7 +910,7 @@ void DOSBitmap::expandEGAPlanes(Graphics::Surface *surface, Common::SeekableRead j = -1; x++; } - } + } dst += surface->w; } diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 4e5b7186ff..05012bec3d 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -632,7 +632,7 @@ bool RivenConsole::Cmd_Combos(int argc, const char **argv) { uint32 teleCombo = _vm->_vars["tcorrectorder"]; uint32 prisonCombo = _vm->_vars["pcorrectorder"]; uint32 domeCombo = _vm->_vars["adomecombo"]; - + DebugPrintf("Telescope Combo:\n "); for (int i = 0; i < 5; i++) DebugPrintf("%d ", _vm->_externalScriptHandler->getComboDigit(teleCombo, i)); diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index de84b0f13f..56107ad97b 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -459,7 +459,7 @@ public: void setGlobalVisible(bool visible); void startPhase(uint phase); void stop(); - + protected: bool _starting; diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp index 53d946dd66..5788f4b3a3 100644 --- a/engines/mohawk/myst_stacks/demo.cpp +++ b/engines/mohawk/myst_stacks/demo.cpp @@ -69,7 +69,7 @@ void Demo::disablePersistentScripts() { void Demo::runPersistentScripts() { Intro::runPersistentScripts(); - + if (_enabled201) { // Used on Card 2001, 2002 and 2003 diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 70abf0ccd3..66492d1200 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -397,7 +397,7 @@ uint16 Myst::getVar(uint16 var) { else return 0; case 25: // Fireplace Red Page Present - if (_globals.ending != 4) + if (_globals.ending != 4) return !(_globals.redPagesInBook & 32) && (_globals.heldPage != 12); else return 0; @@ -3269,7 +3269,7 @@ void Myst::generatorControlRoom_run(void) { if (_generatorVoltage == _state.generatorVoltage) { generatorRedrawRocket(); } else { - // Animate generator gauge + // Animate generator gauge if (_generatorVoltage > _state.generatorVoltage) _generatorVoltage--; else diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 3a95b83199..37fc73de67 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -79,12 +79,12 @@ bool MohawkArchive::open(Common::SeekableReadStream *stream) { } _rsrc.version = _mhk->readUint16BE(); - + if (_rsrc.version != 0x100) { warning("Unsupported Mohawk resource version %d.%d", (_rsrc.version >> 8) & 0xff, _rsrc.version & 0xff); return false; } - + _rsrc.compaction = _mhk->readUint16BE(); // Only used in creation, not in reading _rsrc.filesize = _mhk->readUint32BE(); _rsrc.abs_offset = _mhk->readUint32BE(); diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 3514afdb61..8f8bc15990 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -178,7 +178,7 @@ Common::Error MohawkEngine_Riven::run() { changeToCard(1); } - + while (!_gameOver && !shouldQuit()) handleEvents(); @@ -436,7 +436,7 @@ void MohawkEngine_Riven::loadCard(uint16 id) { void MohawkEngine_Riven::loadHotspots(uint16 id) { // Clear old hotspots delete[] _hotspots; - + // NOTE: The hotspot scripts are cleared by the RivenScriptManager automatically. Common::SeekableReadStream *inStream = getResource(ID_HSPT, id); @@ -460,8 +460,8 @@ void MohawkEngine_Riven::loadHotspots(uint16 id) { // - tspit 371 (DVD: 377), hotspot 4 if (left >= right || top >= bottom) { warning("%s %d hotspot %d is invalid: (%d, %d, %d, %d)", getStackName(_curStack).c_str(), _curCard, i, left, top, right, bottom); - left = top = right = bottom = 0; - _hotspots[i].enabled = 0; + left = top = right = bottom = 0; + _hotspots[i].enabled = 0; } _hotspots[i].rect = Common::Rect(left, top, right, bottom); diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index 8ad05ded13..60e94ea795 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -244,7 +244,7 @@ void RivenExternal::runCredits(uint16 video, uint32 delay) { _vm->_gfx->updateCredits(); } } else if (_vm->_video->updateMovies()) - _vm->_system->updateScreen(); + _vm->_system->updateScreen(); Common::Event event; while (_vm->_system->getEventManager()->pollEvent(event)) @@ -2060,7 +2060,7 @@ void RivenExternal::xbookclick(uint16 argc, uint16 *argv) { _vm->_cursor->setCursor(kRivenMainCursor); _vm->_system->updateScreen(); - + // OK, Gehn has opened the trap book and has asked us to go in. Let's watch // and see what the player will do... while (_vm->_video->getElapsedTime(video) < endTime && !_vm->shouldQuit()) { @@ -2216,7 +2216,7 @@ void RivenExternal::xgwatch(uint16 argc, uint16 *argv) { curSound++; soundTime = _vm->_system->getMillis(); } - + // Poll events just to check for quitting Common::Event event; while (_vm->_system->getEventManager()->pollEvent(event)) {} @@ -2525,7 +2525,7 @@ static Common::Rect generateMarbleGridRect(uint16 x, uint16 y) { } void RivenExternal::xt7500_checkmarbles(uint16 argc, uint16 *argv) { - // Set apower if the marbles are in their correct spot. + // Set apower if the marbles are in their correct spot. bool valid = true; static const uint32 marbleFinalValues[] = { 1114121, 1441798, 0, 65552, 65558, 262146 }; diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 161acb665f..6e3e9a34dc 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -546,7 +546,7 @@ void RivenScript::storeMovieOpcode(uint16 op, uint16 argc, uint16 *argv) { byte *scriptBuf = (byte *)malloc(scriptSize); WRITE_BE_UINT16(scriptBuf, 1); // One command WRITE_BE_UINT16(scriptBuf + 2, argv[3]); // One opcode - WRITE_BE_UINT16(scriptBuf + 4, argc - 4); // argc - 4 args + WRITE_BE_UINT16(scriptBuf + 4, argc - 4); // argc - 4 args for (int i = 0; i < argc - 4; i++) WRITE_BE_UINT16(scriptBuf + 6 + (i * 2), argv[i + 4]); diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index eec6256276..cd8fc8ef80 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -436,22 +436,22 @@ VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint entry.filename = filename; entry.loop = loop; entry.enabled = true; - + Common::File *file = new Common::File(); if (!file->open(filename)) { delete file; return NULL_VID_HANDLE; } - + entry->loadStream(file); - + // Search for any deleted videos so we can take a formerly used slot for (uint32 i = 0; i < _videoStreams.size(); i++) if (!_videoStreams[i].video) { _videoStreams[i] = entry; return i; } - + // Otherwise, just add it to the list _videoStreams.push_back(entry); return _videoStreams.size() - 1; diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 880d41a8a3..a908152bf8 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -52,7 +52,7 @@ struct BalloonPositions { class DialogueManager { - + Parallaction *_vm; Dialogue *_dialogue; @@ -81,10 +81,10 @@ protected: bool _isKeyDown; uint16 _downKey; -protected: +protected: Gfx *_gfx; BalloonManager *_balloonMan; - + public: DialogueManager(Parallaction *vm, ZonePtr z); virtual ~DialogueManager(); @@ -108,11 +108,11 @@ protected: NEXT_ANSWER, DIALOGUE_OVER } _state; - + static const int NO_ANSWER_SELECTED = -1; void transitionToState(DialogueState newState); - + bool displayQuestion(); void displayAnswers(); bool testAnswerFlags(Answer *a); @@ -132,7 +132,7 @@ protected: DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) { _gfx = _vm->_gfx; _balloonMan = _vm->_balloonMan; - + _dialogue = _z->u._speakDialogue; isNpc = !_z->u._filename.empty() && _z->u._filename.compareToIgnoreCase("yourself"); _questioner = isNpc ? _vm->_disk->loadTalk(_z->u._filename.c_str()) : _vm->_char._talk; @@ -166,11 +166,11 @@ void DialogueManager::transitionToState(DialogueState newState) { "nextanswer", "over" }; - + if (_state != newState) { debugC(3, kDebugDialogue, "DialogueManager moved to state '%s'", dialogueStates[newState]); - if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) { + if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) { switch (newState) { case RUN_QUESTION: debug(" Q : %s", _q->_text.c_str()); @@ -188,7 +188,7 @@ void DialogueManager::transitionToState(DialogueState newState) { _state = newState; } - + bool DialogueManager::testAnswerFlags(Answer *a) { uint32 flags = _vm->getLocationFlags(); if (a->_yesFlags & kFlagsGlobal) @@ -240,7 +240,7 @@ int16 DialogueManager::selectAnswerN() { VisibleAnswer *oldAnswer = &_visAnswers[_oldSelection]; VisibleAnswer *answer = &_visAnswers[_selection]; - + if (_selection != _oldSelection) { if (_oldSelection != NO_ANSWER_SELECTED) { _balloonMan->setBalloonText(oldAnswer->_balloon, oldAnswer->_a->_text, BalloonManager::kUnselectedColor); @@ -286,7 +286,7 @@ void DialogueManager::nextAnswer() { return; } - // try and check if there are any suitable answers, + // try and check if there are any suitable answers, // given the current game state. addVisibleAnswers(_q); if (!_numVisAnswers) { @@ -294,9 +294,9 @@ void DialogueManager::nextAnswer() { transitionToState(DIALOGUE_OVER); return; } - + if (_visAnswers[0]._a->textIsNull()) { - // if the first answer is null (it's implied that it's the + // if the first answer is null (it's implied that it's the // only one because we already called addVisibleAnswers), // then jump to the next question _answerId = _visAnswers[0]._index; @@ -547,7 +547,7 @@ void Parallaction::runDialogueFrame() { if (_input->_inputMode != Input::kInputModeDialogue) { return; } - + _dialogueMan->run(); if (_dialogueMan->isOver()) { diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index 0ec1675c48..658ef5af82 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -530,11 +530,11 @@ DECLARE_INSTRUCTION_OPCODE(endif) { DECLARE_INSTRUCTION_OPCODE(stop) { ZonePtr z = ctxt._inst->_z; - - // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has + + // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has // "STOP insegui", which doesn't exist (see ticket #3021744 for the gory details) if (!z) return; - + if (ACTIONTYPE(z) == kZoneHear) { warning("Parallaction_br::instOp_stop not yet implemented for HEAR zones"); // TODO: stop music or sound effects generated by a zone. diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index 24544f46dd..48d84ed101 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -296,19 +296,19 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur // clipped scaled destination rectangle Common::Rect dstRect(scaledWidth, scaledHeight); dstRect.moveTo(scaledLeft, scaledTop); - - Common::Rect clipper(surf->w, surf->h); + + Common::Rect clipper(surf->w, surf->h); dstRect.clip(clipper); if (!dstRect.isValidRect()) return; - - + + // clipped source rectangle Common::Rect srcRect; srcRect.left = (dstRect.left - scaledLeft) * 100 / scale; srcRect.top = (dstRect.top - scaledTop) * 100 / scale; srcRect.setWidth(dstRect.width() * 100 / scale); srcRect.setHeight(dstRect.height() * 100 / scale); - if (!srcRect.isValidRect()) return; + if (!srcRect.isValidRect()) return; Common::Point dp; dp.x = dstRect.left; diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index cf0cf13333..1da61b68ae 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -565,7 +565,7 @@ void Gfx::showFloatingLabel(GfxObj *label) { label->x = -1000; label->y = -1000; label->setFlags(kGfxObjVisible); - + _floatingLabel = label; _labels.push_back(label); } @@ -673,7 +673,7 @@ void Gfx::showLabel(GfxObj *label, int16 x, int16 y) { label->x = x; label->y = y; - + _labels.push_back(label); } @@ -695,7 +695,7 @@ void Gfx::unregisterLabel(GfxObj *label) { _labels.remove_at(i); break; } - } + } } diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index c520ad4f25..d1361a6e8c 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -223,10 +223,10 @@ public: } break; - default: + default: _vm->_nextPart = _firstLocation[selection].part; _vm->scheduleLocationSwitch(_firstLocation[selection].location); - + } _vm->_system->showMouse(false); diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index ef1a8a6e7e..3794aeae29 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -122,7 +122,7 @@ public: _dosLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French _dosLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English _dosLanguageSelectBlocks[3] = Common::Rect( 227, 35, 275, 105 ); // German - + _amigaLanguageSelectBlocks[0] = Common::Rect( -1, -1, -1, -1 ); // Italian: not supported by Amiga multi-lingual version _amigaLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French _amigaLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English @@ -149,7 +149,7 @@ public: _language = -1; _allowChoice = true; } - + ~ChooseLanguageInputState_NS() { destroyLabels(); } @@ -222,15 +222,15 @@ public: _nextState[0] = "newgame"; _nextState[1] = "loadgame"; - + _labels[0] = 0; _labels[1] = 0; } - + ~SelectGameInputState_NS() { destroyLabels(); } - + void destroyLabels() { _vm->_gfx->unregisterLabel(_labels[0]); _vm->_gfx->unregisterLabel(_labels[1]); @@ -326,7 +326,7 @@ public: _labels[2] = 0; _labels[3] = 0; } - + ~NewGameInputState_NS() { destroyLabels(); } @@ -475,7 +475,7 @@ public: _block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _labels[0] = 0; _labels[1] = 0; - + _codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na _codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa _codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 ); // ra @@ -698,7 +698,7 @@ public: _vm->_gfx->unregisterLabel(_labels[0]); _vm->_gfx->unregisterLabel(_labels[1]); delete _labels[0]; - delete _labels[1]; + delete _labels[1]; _labels[0] = 0; _labels[1] = 0; } @@ -827,18 +827,18 @@ public: _labels[2] = 0; _labels[3] = 0; } - + void destroyLabels() { _vm->_gfx->unregisterLabel(_labels[0]); _vm->_gfx->unregisterLabel(_labels[1]); _vm->_gfx->unregisterLabel(_labels[2]); _vm->_gfx->unregisterLabel(_labels[3]); - + delete _labels[0]; delete _labels[1]; delete _labels[2]; delete _labels[3]; - + _labels[0] = 0; _labels[1] = 0; _labels[2] = 0; diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index 3750602076..22406013a1 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -264,7 +264,7 @@ bool Answer::textIsNull() { int Answer::speakerMood() { return _mood & 0xF; } - + Question::Question(const Common::String &name) : _name(name), _mood(0) { memset(_answers, 0, sizeof(_answers)); } @@ -278,16 +278,16 @@ Question::~Question() { bool Question::textIsNull() { return (_text.equalsIgnoreCase("NULL")); } - + int Question::speakerMood() { return _mood & 0xF; } int Question::balloonWinding() { - return _mood & 0x10; + return _mood & 0x10; } - + Instruction::Instruction() { _index = 0; _flags = 0; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 9bbc7d0c57..a37c4439a1 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -627,7 +627,7 @@ bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) { return false; } } - + // WORKAROUND: this huge condition is needed because we made TypeData a collection of structs // instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine, // but we need to check it separately here. The same workaround is applied in freeZones. @@ -659,14 +659,14 @@ bool Parallaction::checkZoneType(ZonePtr z, uint32 type) { if (_gameType == GType_BRA) { if (type == 0) { - if (ITEMTYPE(z) == 0) { + if (ITEMTYPE(z) == 0) { if (ACTIONTYPE(z) != kZonePath) { return true; } - } + } if (ACTIONTYPE(z) == kZoneDoor) { return true; - } + } } } @@ -751,7 +751,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { AnimationPtr a = *ait; _a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation - + if (!_a) { if (_gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) { continue; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 64cf1b437d..0b92db1f0a 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -351,7 +351,7 @@ void Parallaction_ns::changeLocation() { // prevent music changes during the introduction _soundManI->playLocationMusic(location); } - + _input->stopHovering(); // this is still needed to remove the floatingLabel _gfx->freeLabels(); @@ -471,7 +471,7 @@ void Parallaction_ns::changeCharacter(const char *name) { // prevent music changes during the introduction _soundManI->playCharacterMusic(_char.getBaseName()); } - + // The original engine used to reload 'common' only on loadgames. We are reloading here since 'common' // contains character specific stuff. This causes crashes like bug #1816899, because parseLocation tries // to reload scripts but the data archive selected is occasionally wrong. This has been solved by having diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index e4be53022e..f53d71caec 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -824,12 +824,12 @@ void LocationParser_br::parseHearData(ZonePtr z) { } void LocationParser_br::parseNoneData(ZonePtr z) { - /* the only case we have to handle here is that of "scende2", which is the only Animation with + /* the only case we have to handle here is that of "scende2", which is the only Animation with a command list following the type marker. */ if (!scumm_stricmp(_tokens[0], "commands")) { parseCommands(z->_commands); - } + } } diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 69763affc8..213f0ae191 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -1412,9 +1412,9 @@ void LocationParser_ns::parseSpeakData(ZonePtr z) { } void LocationParser_ns::parseNoneData(ZonePtr z) { - // "None" zones should have no content, but some - // inconsistently define their command list after - // the TYPE marker. This routine catches these + // "None" zones should have no content, but some + // inconsistently define their command list after + // the TYPE marker. This routine catches these // command lists that would be lost otherwise. if (!scumm_stricmp(_tokens[0], "commands")) { parseCommands(z->_commands); @@ -1423,7 +1423,7 @@ void LocationParser_ns::parseNoneData(ZonePtr z) { _script->readLineToken(true); _parser->parseStatement(); } while (!ctxt.endcommands); - + // no need to parse one more line here, as // it is done by the caller } diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h index baca5a7213..d0b5e5c175 100644 --- a/engines/parallaction/sound.h +++ b/engines/parallaction/sound.h @@ -131,11 +131,11 @@ class DosSoundMan_ns : public SoundMan_ns { MidiPlayer *_midiPlayer; bool _playing; - + bool isLocationSilent(const char *locationName); bool locationHasOwnSoftMusic(const char *locationName); - + public: DosSoundMan_ns(Parallaction_ns *vm); ~DosSoundMan_ns(); diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 917d310738..b5d4c72ea4 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -140,7 +140,7 @@ void DosSoundMan_ns::playMusic() { Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile); _midiPlayer->play(stream); _midiPlayer->setVolume(255); - + _playing = true; } @@ -159,7 +159,7 @@ void DosSoundMan_ns::pause(bool p) { bool DosSoundMan_ns::locationHasOwnSoftMusic(const char *locationName) { return !scumm_stricmp(locationName, "night") || !scumm_stricmp(locationName, "intsushi"); } - + void DosSoundMan_ns::playCharacterMusic(const char *character) { if (!character || locationHasOwnSoftMusic(_vm->_location._name)) { return; @@ -167,7 +167,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) { char *name = const_cast(character); const char *newMusicFile = 0; - + if (!scumm_stricmp(name, _dinoName)) { newMusicFile = "dino"; } else @@ -200,7 +200,7 @@ void DosSoundMan_ns::playLocationMusic(const char *location) { debugC(2, kDebugExec, "changeLocation: music stopped"); } else { playCharacterMusic(_vm->_char.getBaseName()); - } + } } diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 21ee5ee5d9..5d5695ace4 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -590,14 +590,14 @@ void PathWalker_BR::doWalk(State &s) { int xStep = (scale * 16) / 100 + 1; int yStep = (scale * 10) / 100 + 1; - /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a + /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a Character) is controlled by the user (for movement, via this walking code) and by the scripts (to simulate the balloon floating in the air, in a neverending loop that alters the position coordinates). When the two step sizes are equal in magnitude and opposite in direction, then the walk code enters an infinite loop without giving control back to the user (this happens quite frequently - when navigating the balloon near the borders of the screen, where the calculated step is - forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr) + when navigating the balloon near the borders of the screen, where the calculated step is + forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr) uses increments of 3 for both x and y, we tweak the calculated steps accordingly here. */ if (xStep == 3) xStep--; if (yStep == 3) yStep--; diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 86606855e3..862a0b4d64 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -340,7 +340,7 @@ void Actor::loadActorSpriteList(ActorData *actor) { uint lastFrame = 0; uint curFrameIndex; int resourceId = actor->_spriteListResourceId; - + if (actor->_frames != NULL) { for (ActorFrameSequences::const_iterator i = actor->_frames->begin(); i != actor->_frames->end(); ++i) { for (int orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) { diff --git a/engines/saga/actor.h b/engines/saga/actor.h index 451497986d..a4f475660d 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -321,7 +321,7 @@ public: _screenDepth = in->readSint32LE(); _screenScale = in->readSint32LE(); } - + CommonObjectData() { _index = 0; _id = 0; @@ -463,7 +463,7 @@ public: void cmdActorWalkTo(int argc, const char **argv); bool validActorId(uint16 id) { - return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size()))); + return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size()))); } int actorIdToIndex(uint16 id) { return (id == ID_PROTAG) ? 0 : objectIdToIndex(id); } uint16 actorIndexToId(int index) { return (index == 0) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); } diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 7ec4a59398..8b2d1e9dad 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -169,7 +169,7 @@ int Anim::playCutaway(int cut, bool fade) { ByteArray resourceData; _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData); load(MAX_ANIMATIONS + cutawaySlot, resourceData); - + setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles); setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate); @@ -414,7 +414,7 @@ void Anim::load(uint16 animId, const ByteArray &resourceData) { } anim->resourceData.resize(resourceData.size() - dataOffset); - + memcpy(anim->resourceData.getBuffer(), resourceData.getBuffer() + dataOffset, anim->resourceData.size()); // Cache frame offsets diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 35f41e30ab..ec3ef2f6f9 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -557,7 +557,7 @@ int Events::handleInterval(Event *event) { } EventColumns *Events::chain(EventColumns *eventColumns, const Event &event) { - + if (eventColumns == NULL) { EventColumns tmp; diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 80d53a2794..bdf8936a55 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -113,7 +113,7 @@ void Scene::playMovie(const char *filename) { _vm->_system->updateScreen(); } } - + Common::Event event; while (_vm->_system->getEventManager()->pollEvent(event)) { if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP) diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index adea59ca9a..e886f0df82 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -836,7 +836,7 @@ void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *loca count = colDiff; col += colDiff; } - + colDiff = _tileClip.right - col; if (colDiff > 0) { int countDiff = fgRunCount - count; diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index 1fefad93ab..021a4c9bac 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -53,7 +53,7 @@ void PalAnim::loadPalAnim(const ByteArray &resourceData) { debug(3, "PalAnim::loadPalAnim(): Loading %d PALANIM entries.", _entries.size()); for (Common::Array::iterator i = _entries.begin(); i != _entries.end(); ++i) { - + i->cycle = 0; i->colors.resize(readS.readUint16()); @@ -139,7 +139,7 @@ void PalAnim::cycleStep(int vectortime) { void PalAnim::clear() { debug(3, "PalAnim::clear()"); - + _entries.clear(); } diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 15bd2aff72..d168605e99 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -451,7 +451,7 @@ void SagaEngine::loadStrings(StringsTable &stringsTable, const ByteArray &string error("SagaEngine::loadStrings() Wrong offset"); } stringsTable.strings[ui] = &stringsTable.buffer[offset]; - + debug(9, "string[%i]=%s", ui, stringsTable.strings[ui]); } } diff --git a/engines/saga/scene.h b/engines/saga/scene.h index adac3b622a..6e2cb12380 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -126,7 +126,7 @@ struct SceneDescription { uint16 sceneScriptEntrypointNumber; uint16 startScriptEntrypointNumber; int16 musicResourceId; - + void reset() { flags = resourceListResourceId = endSlope = beginSlope = scriptModuleNumber = sceneScriptEntrypointNumber = startScriptEntrypointNumber = musicResourceId = 0; } diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp index 81893c7480..2895c6800c 100644 --- a/engines/saga/sprite.cpp +++ b/engines/saga/sprite.cpp @@ -207,7 +207,7 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b const byte *srcPointer; int backBufferPitch = _vm->_gfx->getBackBufferPitch(); - + //find Rects intersection yDiff = clipRect.top - spritePointer.y; if (yDiff > 0) { @@ -247,10 +247,10 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b } bufRowPointer = _vm->_gfx->getBackBufferPixels() + backBufferPitch * yDstOffset + xDstOffset; srcRowPointer = spriteBuffer + width * ySrcOffset + xSrcOffset; - + // validate src, dst buffers assert(_vm->_gfx->getBackBufferPixels() <= bufRowPointer); - assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >= + assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >= (byte *)(bufRowPointer + backBufferPitch * (cHeight - 1) + cWidth)); assert((const byte *)spriteBuffer <= srcRowPointer); assert(((const byte *)spriteBuffer + (width * height)) >= (const byte *)(srcRowPointer + width * (cHeight - 1) + cWidth)); @@ -469,7 +469,7 @@ void Sprite::scaleBuffer(const byte *src, int width, int height, int scale, size _decodeBuf.resize(outLength); byte *dst = &_decodeBuf.front(); - + memset(dst, 0, _decodeBuf.size()); for (int i = 0; i < height; i++) { diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index b1b5f81995..2f69d5caa1 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -255,7 +255,7 @@ void Console::postEnter() { videoDecoder = new RobotDecoder(g_system->getMixer(), _engine->getPlatform() == Common::kPlatformMacintosh); } else if (_videoFile.hasSuffix(".duk")) { duckMode = true; - videoDecoder = new Video::AviDecoder(g_system->getMixer()); + videoDecoder = new Video::AviDecoder(g_system->getMixer()); #endif } else if (_videoFile.hasSuffix(".avi")) { videoDecoder = new Video::AviDecoder(g_system->getMixer()); @@ -895,7 +895,7 @@ bool Console::cmdVerifyScripts(int argc, const char **argv) { return true; } -// Same as in sound/drivers/midi.cpp +// Same as in sound/drivers/midi.cpp uint8 getGmInstrument(const Mt32ToGmMap &Mt32Ins) { if (Mt32Ins.gmInstr == MIDI_MAPPED_TO_RHYTHM) return Mt32Ins.gmRhythmKey + 0x80; @@ -913,7 +913,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) { MidiPlayer *player = MidiPlayer_Midi_create(doSoundVersion); MidiParser_SCI *parser = new MidiParser_SCI(doSoundVersion, 0); parser->setMidiDriver(player); - + Common::List *resources = _engine->getResMan()->listResources(kResourceTypeSound); Common::sort(resources->begin(), resources->end()); Common::List::iterator itr = resources->begin(); @@ -984,7 +984,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) { if (channel != 15) { // SCI special byte instrument = *channelData++; if (!firstOneShown) - firstOneShown = true; + firstOneShown = true; else DebugPrintf(","); @@ -1577,7 +1577,7 @@ bool Console::cmdPlayVideo(int argc, const char **argv) { Common::String filename = argv[1]; filename.toLowercase(); - if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") || + if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") || filename.hasSuffix(".rbt") || filename.hasSuffix(".duk")) { _videoFile = filename; _videoFrameDelay = (argc == 2) ? 10 : atoi(argv[2]); @@ -1699,7 +1699,7 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { return true; } - // Now we _finally_ know these are valid saved bits + // Now we _finally_ know these are valid saved bits Common::Rect rect; byte mask; @@ -1829,7 +1829,7 @@ bool Console::cmdPrintSegmentTable(int argc, const char **argv) { case SEG_TYPE_STRING: DebugPrintf("T SCI32 strings (%d)", (*(StringTable *)mobj).entries_used); break; -#endif +#endif default: DebugPrintf("I Invalid (type = %x)", mobj->getType()); @@ -2954,8 +2954,8 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) { uint16 argc2 = opparams[1]; if (kFuncNum == kernelFuncNum) { - DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n", - itr->getNumber(), objName, + DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n", + itr->getNumber(), objName, _engine->getKernel()->getSelectorName(obj->getFuncSelector(i)).c_str(), i, argc2); } } diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 73f4e4e89f..4634edb1a8 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -2346,7 +2346,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { //{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038}, AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, - + // Phantasmagoria - English DOS Demo // Executable scanning reports "2.100.002" {"phantasmagoria", "Demo", { @@ -3479,7 +3479,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { // Space Quest 4 - English Macintosh // Executable scanning reports "x.yyy.zzz" - // VERSION file reports "1.148" + // VERSION file reports "1.148" {"sq4", "", { {"resource.map", 0, "6ffc6f76c4127d140759a512ab9a07be", 6042}, {"resource.000", 0, "6a538b389705232cf9b2d7de2cf9c0a7", 224833}, diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 07ba626d15..4592c5be9c 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -75,7 +75,7 @@ public: * @return Message function type, SCI_VERSION_1_LATE / SCI_VERSION_1_1 */ SciVersion detectMessageFunctionType(); - + #ifdef ENABLE_SCI32 /** * Autodetects the kernel functions used in SCI2.1 diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 68b1601580..ff3c67c84b 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -272,7 +272,7 @@ private: // Kernel-related lists Common::StringArray _selectorNames; Common::StringArray _kernelNames; - + const Common::String _invalid; }; diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 31ef64d109..0c5d4e680d 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -558,16 +558,16 @@ static SciKernelMapEntry s_kernelMap[] = { // SetWindowsOption is used to set Windows specific options, like for example the title bar visibility of // the game window in Phantasmagoria 2. We ignore these settings completely. { MAP_EMPTY(SetWindowsOption), SIG_EVERYWHERE, "ii", NULL, NULL }, - + // Used by the Windows version of Phantasmagoria 1 to get the video speed setting. This is called after - // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can + // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can // just use GetConfig and mark this one as empty, like the DOS version does. { MAP_EMPTY(GetSierraProfileInt), SIG_EVERYWHERE, "(.*)", NULL, NULL }, // Unused / debug SCI2.1 unused functions, always mapped to kDummy // The debug functions are called from the inbuilt debugger or polygon - // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon, + // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon, // aeDisplayClass and scalerCode { MAP_DUMMY(FindSelector), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_DUMMY(FindClass), SIG_EVERYWHERE, "(.*)", NULL, NULL }, diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 2cd6b198de..df3b3efd57 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -194,7 +194,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { // Wait a bit here, so that the CPU isn't maxed out when the game // is waiting for user input (e.g. when showing text boxes) - bug // #3037874. Make sure that we're not delaying while the game is - // benchmarking, as that will affect the final benchmarked result - + // benchmarking, as that will affect the final benchmarked result - // check bugs #3058865 and #3127824 if (s->_gameIsBenchmarking) { // Game is benchmarking, don't add a delay diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index e1e52215d2..1bd6754ca5 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -208,7 +208,7 @@ reg_t kFClose(EngineState *s, int argc, reg_t *argv) { reg_t kFPuts(EngineState *s, int argc, reg_t *argv) { int handle = argv[0].toUint16(); Common::String data = s->_segMan->getString(argv[1]); - + FileHandle *f = getFileFromHandle(s, handle); if (f) f->_out->write(data.c_str(), data.size()); @@ -812,7 +812,7 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) { int bytesRead = 0; char *buf = new char[size]; debugC(kDebugLevelFile, "kFileIO(readRaw): %d, %d", handle, size); - + FileHandle *f = getFileFromHandle(s, handle); if (f) { bytesRead = f->_in->read(buf, size); @@ -910,7 +910,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) { int offset = argv[1].toUint16(); int whence = argv[2].toUint16(); debugC(kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence); - + FileHandle *f = getFileFromHandle(s, handle); if (f) diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 6c96266922..36de767464 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -151,7 +151,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { case 2: pos.y = argv[1].toSint16(); pos.x = argv[0].toSint16(); - + g_sci->_gfxCursor->kernelSetPos(pos); break; case 4: { @@ -192,7 +192,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { break; case 10: // Freddy pharkas, when using the whiskey glass to read the prescription (bug #3034973) - g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(), + g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(), Common::Rect(argv[1].toUint16(), argv[2].toUint16(), argv[3].toUint16(), argv[4].toUint16()), argv[5].toUint16(), argv[6].toUint16(), argv[7].toUint16(), argv[8].toUint16(), argv[9].toUint16()); @@ -428,7 +428,7 @@ reg_t kCanBeHere(EngineState *s, int argc, reg_t *argv) { reg_t kCantBeHere(EngineState *s, int argc, reg_t *argv) { reg_t curObject = argv[0]; reg_t listReference = (argc > 1) ? argv[1] : NULL_REG; - + reg_t canBeHere = g_sci->_gfxCompare->kernelCanBeHere(curObject, listReference); return canBeHere; } @@ -1279,7 +1279,7 @@ reg_t kCantBeHere32(EngineState *s, int argc, reg_t *argv) { // TODO // reg_t curObject = argv[0]; // reg_t listReference = (argc > 1) ? argv[1] : NULL_REG; - + return NULL_REG; } @@ -1642,8 +1642,8 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) { // TODO: This defines the resolution that the fonts are supposed to be displayed // in. Currently, this is only used for showing high-res fonts in GK1 Mac, but - // should be extended to handle other font resolutions such as those - + // should be extended to handle other font resolutions such as those + int xResolution = argv[0].toUint16(); //int yResolution = argv[1].toUint16(); diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index daed248db1..e6837242e4 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -75,11 +75,11 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) { } break; case GID_SQ4: - // In SQ4 (floppy and CD) the sequel police appear way too quickly in + // In SQ4 (floppy and CD) the sequel police appear way too quickly in // the Skate-o-rama rooms, resulting in all sorts of timer issues, like // #3109139 (which occurs because a police officer instantly teleports // just before Roger exits and shoots him). We throttle these scenes a - // bit more, in order to prevent timer bugs related to the sequel police + // bit more, in order to prevent timer bugs related to the sequel police if (s->currentRoomNumber() == 405 || s->currentRoomNumber() == 406 || s->currentRoomNumber() == 410 || s->currentRoomNumber() == 411) { s->_throttleTrigger = true; @@ -186,7 +186,7 @@ reg_t kSetDebug(EngineState *s, int argc, reg_t *argv) { if (g_sci->getGameId() != GID_GK1) { debug("Debug mode activated"); - + g_sci->getDebugger()->attach(); } diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 31715f19d3..14f7db47a0 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -239,7 +239,7 @@ reg_t kInitBresen(EngineState *s, int argc, reg_t *argv) { client_step--; if (!client_step) - error("kInitBresen failed"); + error("kInitBresen failed"); client_xStep--; } @@ -440,7 +440,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { invokeSelector(s, clientLooper, SELECTOR(doit), argc, argv, 2, params); } s->r_acc = SIGNAL_REG; - + } else { // is blocked if (avoiderHeading == -1) diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 8904a48978..375aeaa06b 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1110,7 +1110,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { // Make sure that we have enough points if (pointList.maxSize < size * POLY_POINT_SIZE) { warning("convert_polygon: Not enough memory allocated for polygon points. " - "Expected %d, got %d. Skipping polygon", + "Expected %d, got %d. Skipping polygon", size * POLY_POINT_SIZE, pointList.maxSize); return NULL; } @@ -1202,7 +1202,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co change_polygons_opt_0(pf_s); Common::Point *new_start = fixup_start_point(pf_s, start); - + if (!new_start) { warning("AvoidPath: Couldn't fixup start position for pathfinding"); delete pf_s; @@ -1210,7 +1210,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co } Common::Point *new_end = fixup_end_point(pf_s, end); - + if (!new_end) { warning("AvoidPath: Couldn't fixup end position for pathfinding"); delete new_start; diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index d83254b2c4..93c1fffe3c 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -163,7 +163,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) { // extend the internal storage size. if (infoSelector & kInfoFlagClone) parentObj = s->_segMan->getObject(parentAddr); - + *cloneObj = *parentObj; // Mark as clone diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index c3c10bd2a2..07b87a7cbc 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -427,7 +427,7 @@ reg_t kGetFarText(EngineState *s, int argc, reg_t *argv) { } seeker = (char *)textres->data; - + // The second parameter (counter) determines the number of the string // inside the text resource. while (counter--) { @@ -715,7 +715,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { // triggers an assert when doing string2[i + index2]. for (uint16 i = 0; i < count; i++) string1->setValue(i + index1, string2[i + index2]); - + return strAddress; } case 7: { // Cmp @@ -781,14 +781,14 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { return NULL_REG; case 15: { // upper Common::String string = s->_segMan->getString(argv[1]); - + string.toUppercase(); s->_segMan->strcpy(argv[1], string.c_str()); return NULL_REG; } case 16: { // lower Common::String string = s->_segMan->getString(argv[1]); - + string.toLowercase(); s->_segMan->strcpy(argv[1], string.c_str()); return NULL_REG; diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 9a60f39c85..6d810d516c 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -65,7 +65,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { scaleBuffer = new byte[width * height * bytesPerPixel]; } - uint16 x, y; + uint16 x, y; // Sanity check... if (videoState.x > 0 && videoState.y > 0 && isVMD) { @@ -94,7 +94,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { if (frame) { if (scaleBuffer) { - // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows + // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows g_sci->_gfxScreen->scale2x((byte *)frame->pixels, scaleBuffer, videoDecoder->getWidth(), videoDecoder->getHeight(), bytesPerPixel); g_system->copyRectToScreen(scaleBuffer, pitch, x, y, width, height); } else { @@ -130,7 +130,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { uint16 screenWidth = g_system->getWidth(); uint16 screenHeight = g_system->getHeight(); - + Video::VideoDecoder *videoDecoder = 0; if (argv[0].segment != 0) { diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index f09f18298a..a1854a2723 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -259,13 +259,13 @@ void Object::initSelectorsSci3(const byte *buf) { // two selectors are always reserved (because their storage // space is used by the typeMask). // We don't know beforehand how many methods and properties - // there are, so we count them first. + // there are, so we count them first. for (int groupNr = 0; groupNr < groups; ++groupNr) { byte groupLocation = groupInfo[groupNr]; const byte *seeker = selectorBase + groupLocation * 32 * 2; if (groupLocation != 0) { - // This object actually has selectors belonging to this group + // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); for (int bit = 2; bit < 32; ++bit) { @@ -277,7 +277,7 @@ void Object::initSelectorsSci3(const byte *buf) { } else { // Undefined selector } - + } } } @@ -296,7 +296,7 @@ void Object::initSelectorsSci3(const byte *buf) { const byte *seeker = selectorBase + groupLocation * 32 * 2; if (groupLocation != 0) { - // This object actually has selectors belonging to this group + // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); int groupBaseId = groupNr * 32; @@ -323,7 +323,7 @@ void Object::initSelectorsSci3(const byte *buf) { } else { // Undefined selector } - + } } } diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 80c8e9e83d..0ca16b48a2 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -79,7 +79,7 @@ public: } reg_t getSpeciesSelector() const { - if (getSciVersion() <= SCI_VERSION_2_1) + if (getSciVersion() <= SCI_VERSION_2_1) return _variables[_offset]; else // SCI3 return _speciesSelectorSci3; @@ -93,7 +93,7 @@ public: } reg_t getSuperClassSelector() const { - if (getSciVersion() <= SCI_VERSION_2_1) + if (getSciVersion() <= SCI_VERSION_2_1) return _variables[_offset + 1]; else // SCI3 return _superClassPosSci3; diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index fbd77eb076..1d899b0d37 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -51,7 +51,7 @@ struct EngineState; * 19 - exportsAreWide * 18 - SCI32 arrays/strings * 17 - sound - * + * */ enum { diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index a38aa06bc4..01e1afe5ea 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -160,7 +160,7 @@ void Script::load(ResourceManager *resMan) { _numExports = 0; _synonyms = 0; _numSynonyms = 0; - + if (getSciVersion() <= SCI_VERSION_1_LATE) { _exportTable = (const uint16 *)findBlockSCI0(SCI_OBJ_EXPORTS); if (_exportTable) { diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 2d3d8f6155..a714980a35 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -209,7 +209,7 @@ const byte ecoquest2SignatureEcorderTutorial[] = { const uint16 ecoquest2PatchEcorderTutorial[] = { 0x31, 0x23, // bnt [next state] (save 1 byte) - // The parameter count below should be 7, but we're out of bytes + // The parameter count below should be 7, but we're out of bytes // to patch! A workaround has been added because of this 0x78, // push1 (parameter count) //0x39, 0x07, // pushi 07 (parameter count) @@ -221,7 +221,7 @@ const uint16 ecoquest2PatchEcorderTutorial[] = { 0x78, // push1 (visual screen) 0x39, 0x17, // pushi 17 (color) 0x43, 0x6c, 0x0e, // call kGraph - // The parameter count below should be 5, but we're out of bytes + // The parameter count below should be 5, but we're out of bytes // to patch! A workaround has been added because of this 0x78, // push1 (parameter count) //0x39, 0x05, // pushi 05 (parameter count) @@ -697,7 +697,7 @@ const SciScriptSignature laurabow2Signatures[] = { // =========================================================================== // Mother Goose SCI1/SCI1.1 -// MG::replay somewhat calculates the savedgame-id used when saving again +// MG::replay somewhat calculates the savedgame-id used when saving again // this doesn't work right and we remove the code completely. // We set the savedgame-id directly right after restoring in kRestoreGame. const byte mothergoose256SignatureReplay[] = { @@ -1034,7 +1034,7 @@ const uint16 sq1vgaPatchEgoShowsCard[] = { // script, description, magic DWORD, adjust const SciScriptSignature sq1vgaSignatures[] = { - { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, + { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard }, SCI_SIGNATUREENTRY_TERMINATOR}; @@ -1087,7 +1087,7 @@ void Script::applyPatch(const uint16 *patch, byte *scriptData, const uint32 scri } patch++; patchWord = *patch; - } + } } // will return -1 if no match was found, otherwise an offset to the start of the signature match diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 957930784b..3a18fbc68f 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -72,7 +72,7 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode const byte *scr; int scr_size; reg_t retval = make_reg(pos.segment, pos.offset + 1); - uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc. + uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc. int i = 0; Kernel *kernel = g_sci->getKernel(); @@ -617,8 +617,8 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg Console *con = g_sci->getSciDebugger(); #ifdef VM_DEBUG_SEND - debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj), - s->_segMan->getObjectName(send_obj), selector, + debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj), + s->_segMan->getObjectName(send_obj), selector, g_sci->getKernel()->getSelectorName(selector).c_str()); #endif // VM_DEBUG_SEND @@ -644,18 +644,18 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg reg_t selectorValue = *varp.getPointer(segMan); if (!argc && (activeBreakpointTypes & BREAK_SELECTORREAD)) { if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORREAD, send_obj, selector)) - con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n", + con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n", objectName, selectorName, PRINT_REG(selectorValue)); } else if (argc && (activeBreakpointTypes & BREAK_SELECTORWRITE)) { if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORWRITE, send_obj, selector)) - con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n", + con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n", objectName, selectorName, PRINT_REG(selectorValue), PRINT_REG(argp[1])); } if (argc > 1) - debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n", + debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n", objectName, selectorName, PRINT_REG(selectorValue), PRINT_REG(argp[1]), argc); } diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 5d8a81a7f1..3f11d6ff49 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -255,7 +255,7 @@ SegmentRef ArrayTable::dereference(reg_t pointer) { return ret; } -void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) { +void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) { _table[sub_addr.offset].destroy(); freeEntry(sub_addr.offset); } diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 2edbea9676..c2f857f319 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -212,7 +212,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t *address.getPointer(segMan) = value; } -void invokeSelector(EngineState *s, reg_t object, int selectorId, +void invokeSelector(EngineState *s, reg_t object, int selectorId, int k_argc, StackPtr k_argp, int argc, const reg_t *argv) { int i; int framesize = 2 + 1 * argc; diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index f13c13e00c..085dd6e832 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -185,7 +185,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t /** * Invokes a selector from an object. */ -void invokeSelector(EngineState *s, reg_t object, int selectorId, +void invokeSelector(EngineState *s, reg_t object, int selectorId, int k_argc, StackPtr k_argp, int argc = 0, const reg_t *argv = 0); } // End of namespace Sci diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 3328f80de1..4ea9f72054 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -144,7 +144,7 @@ void EngineState::wait(int16 ticks) { void EngineState::initGlobals() { Script *script_000 = _segMan->getScript(1); - + if (!script_000->_localsBlock) error("Script 0 has no locals block"); @@ -331,7 +331,7 @@ void SciEngine::checkVocabularySwitch() { uint16 parserLanguage = 1; if (SELECTOR(parseLang) != -1) parserLanguage = readSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(parseLang)); - + if (parserLanguage != _vocabularyLanguage) { delete _vocabulary; _vocabulary = new Vocabulary(_resMan, parserLanguage > 1 ? true : false); diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp index 6526eff2db..cca4c47be8 100644 --- a/engines/sci/engine/static_selectors.cpp +++ b/engines/sci/engine/static_selectors.cpp @@ -96,7 +96,7 @@ static const char * const sci2Selectors[] = { "center", "all", "show", "textLeft", "textTop", // 115 - 119 "textRight", "textBottom", "borderColor", "titleFore", "titleBack", // 120 - 124 "titleFont", "dimmed", "frameOut", "lastKey", "magnifier", // 125 - 129 - "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134 + "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134 "left", "right", "top", "bottom", "numLines" // 135 - 139 }; #endif @@ -265,8 +265,8 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) { if (targetClass) { if (classReferences[i].selectorType == kSelectorMethod) { if (targetClass->getMethodCount() < selectorOffset + 1) - error("The %s class has less than %d methods (%d)", - classReferences[i].className, selectorOffset + 1, + error("The %s class has less than %d methods (%d)", + classReferences[i].className, selectorOffset + 1, targetClass->getMethodCount()); targetSelectorPos = targetClass->getFuncSelector(selectorOffset); @@ -275,7 +275,7 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) { selectorOffset += (getSciVersion() <= SCI_VERSION_1_LATE) ? 3 : 8; if (targetClass->getVarCount() < selectorOffset + 1) - error("The %s class has less than %d variables (%d)", + error("The %s class has less than %d variables (%d)", classReferences[i].className, selectorOffset + 1, targetClass->getVarCount()); diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 1517355365..db682de16f 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -42,7 +42,7 @@ const reg_t NULL_REG = {0, 0}; const reg_t SIGNAL_REG = {0, SIGNAL_OFFSET}; const reg_t TRUE_REG = {0, 1}; //#define VM_DEBUG_SEND -// Enable the define below to have the VM abort on cases where a conditional +// Enable the define below to have the VM abort on cases where a conditional // statement is followed by an unconditional jump (which will most likely lead // to an infinite loop). Aids in detecting script bugs such as #3040722. //#define ABORT_ON_INFINITE_LOOP @@ -130,14 +130,14 @@ static reg_t read_var(EngineState *s, int type, int index) { if (solution.type == WORKAROUND_NONE) { #ifdef RELEASE_BUILD // If we are running an official ScummVM release -> fake 0 in unknown cases - warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); s->variables[type][index] = NULL_REG; break; #else - error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); #endif @@ -366,8 +366,8 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { switch (solution.type) { case WORKAROUND_NONE: kernel->signatureDebug(kernelCall.signature, argc, argv); - error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)", - kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)", + kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; case WORKAROUND_IGNORE: // don't do kernel call, leave acc alone @@ -418,12 +418,12 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { int callNameLen = strlen(kernelCall.name); if (strncmp(kernelCall.name, kernelSubCall.name, callNameLen) == 0) { const char *subCallName = kernelSubCall.name + callNameLen; - error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)", - kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)", + kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); } - error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)", - kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)", + kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; } @@ -828,10 +828,10 @@ void run_vm(EngineState *s) { uint16 localCallOffset = s->xs->addr.pc.offset + opparams[0]; - ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp, + ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp, (call_base->requireUint16()) + s->r_rest, call_base, s->xs->local_segment, make_reg(s->xs->addr.pc.segment, localCallOffset), - NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1, + NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1, EXEC_STACK_TYPE_CALL); s->_executionStack.push_back(xstack); diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp index e39c7708ad..b95fd58129 100644 --- a/engines/sci/engine/vm_types.cpp +++ b/engines/sci/engine/vm_types.cpp @@ -32,8 +32,8 @@ reg_t reg_t::lookForWorkaround(const reg_t right) const { SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, arithmeticWorkarounds, &originReply); if (solution.type == WORKAROUND_NONE) - error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)", - PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(), + error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)", + PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(), originReply.methodName.c_str(), g_sci->getEngineState()->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); assert(solution.type == WORKAROUND_FAKE); @@ -56,7 +56,7 @@ reg_t reg_t::operator+(const reg_t right) const { return make_reg(segment, offset + right.toSint16()); default: return lookForWorkaround(right); - } + } } else if (isNumber() && right.isPointer()) { // Adding a pointer to a number, flip the order return right + *this; @@ -94,9 +94,9 @@ reg_t reg_t::operator/(const reg_t right) const { reg_t reg_t::operator%(const reg_t right) const { if (isNumber() && right.isNumber() && !right.isNull()) { - // Support for negative numbers was added in Iceman, and perhaps in + // Support for negative numbers was added in Iceman, and perhaps in // SCI0 0.000.685 and later. Theoretically, this wasn't really used - // in SCI0, so the result is probably unpredictable. Such a case + // in SCI0, so the result is probably unpredictable. Such a case // would indicate either a script bug, or a modulo on an unsigned // integer larger than 32767. In any case, such a case should be // investigated, instead of being silently accepted. @@ -178,7 +178,7 @@ int reg_t::cmp(const reg_t right, bool treatAsUnsigned) const { if (treatAsUnsigned || !isNumber()) return toUint16() - right.toUint16(); else - return toSint16() - right.toSint16(); + return toSint16() - right.toSint16(); } else if (pointerComparisonWithInteger(right)) { return 1; } else if (right.pointerComparisonWithInteger(*this)) { diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 464b4d8d5b..768ba28518 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -447,7 +447,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun do { workaround = workaroundList; while (workaround->methodName) { - bool objectNameMatches = (workaround->objectName == NULL) || + bool objectNameMatches = (workaround->objectName == NULL) || (workaround->objectName == g_sci->getSciLanguageString(searchObjectName, K_LANG_ENGLISH)); // Special case: in the fanmade Russian translation of SQ4, all diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 74879f6c63..c14cfada07 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -261,7 +261,7 @@ SciEvent EventManager::getScummVMEvent() { else if ((modifiers & Common::KBD_CTRL) && input.character > 0 && input.character < 27) input.character += 96; // 0x01 -> 'a' } - + // If no actual key was pressed (e.g. if only a modifier key was pressed), // ignore the event if (!input.character) @@ -277,7 +277,7 @@ void EventManager::updateScreen() { if (g_system->getMillis() - s->_screenUpdateTime >= 1000 / 60) { g_system->updateScreen(); s->_screenUpdateTime = g_system->getMillis(); - // Throttle the checking of shouldQuit() to 60fps as well, since + // Throttle the checking of shouldQuit() to 60fps as well, since // Engine::shouldQuit() invokes 2 virtual functions // (EventManager::shouldQuit() and EventManager::shouldRTL()), // which is very expensive to invoke constantly without any diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index c36ecd112a..18f8511953 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -201,7 +201,7 @@ void GfxAnimate::fill(byte &old_picNotValid) { adjustInvalidCels(view, it); processViewScaling(view, it); setNsRect(view, it); - + //warning("%s view %d, loop %d, cel %d, signal %x", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo, it->signal); // Calculate current priority according to y-coordinate @@ -659,7 +659,7 @@ void GfxAnimate::throttleSpeed() { // No entries drawn -> no speed throttler triggering break; case 1: { - + // One entry drawn -> check if that entry was a speed benchmark view, if not enable speed throttler AnimateEntry *onlyCast = &_lastCastData[0]; if ((onlyCast->viewId == 0) && (onlyCast->loopNo == 13) && (onlyCast->celNo == 0)) { diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 83b4f49c08..bacb6e71e2 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -51,7 +51,7 @@ private: GfxCoordAdjuster *_coordAdjuster; uint16 isOnControl(uint16 screenMask, const Common::Rect &rect); - + /** * This function checks whether any of the objects in the given list, * *different* from checkObject, has a brRect which is contained inside diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 1b8a3e2679..23cf79d209 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -68,7 +68,7 @@ public: void moveCursor(Common::Point &pos); Common::Rect pictureGetDisplayArea(); - + private: GfxPorts *_ports; @@ -90,7 +90,7 @@ public: void pictureSetDisplayArea(Common::Rect displayArea); Common::Rect pictureGetDisplayArea(); - + private: SegManager *_segMan; diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 913f680e99..673729784f 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -423,8 +423,8 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { default: while (itemIterator != itemEnd) { itemEntry = *itemIterator; - if (itemEntry->keyPress == keyPress && - itemEntry->keyModifier == keyModifier && + if (itemEntry->keyPress == keyPress && + itemEntry->keyModifier == keyModifier && itemEntry->enabled) break; itemIterator++; diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 899ef10b33..c5a3545701 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -71,7 +71,7 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool useMergi _macClut = 0; loadMacIconBarPalette(); - + #ifdef ENABLE_SCI32 _clutTable = 0; #endif @@ -236,7 +236,7 @@ static byte blendColors(byte c1, byte c2) { // return (c1/2+c2/2)+((c1&1)+(c2&1))/2; // gamma 2.2 - double t = (pow(c1/255.0, 2.2/1.0) * 255.0) + + double t = (pow(c1/255.0, 2.2/1.0) * 255.0) + (pow(c2/255.0, 2.2/1.0) * 255.0); return (byte)(0.5 + (pow(0.5*t/255.0, 1.0/2.2) * 255.0)); } @@ -378,7 +378,7 @@ bool GfxPalette::merge(Palette *newPalette, bool force, bool forceRealMerge) { break; } } - + // if still no luck - set an approximate color if (j == 256) { newPalette->mapping[i] = res & 0xFF; @@ -991,7 +991,7 @@ void GfxPalette::unloadClut() { delete[] _clutTable; _clutTable = 0; } - + #endif } // End of namespace Sci diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index 9b0c45baf6..243420cc47 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -125,7 +125,7 @@ private: void loadMacIconBarPalette(); byte *_macClut; - + #ifdef ENABLE_SCI32 byte *_clutTable; #endif diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index ce69ba8922..ecb54e89e8 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -357,7 +357,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) _screen->putPixel(x, y, drawMask, curByte, priority, 0); - + if (x == leftX) { ptr += sourcePixelSkipPerRow; x = rightX; @@ -515,7 +515,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { icemanDrawFix = true; } if (g_sci->getGameId() == GID_KQ5) { - // WORKAROUND: ignore the seemingly broken priority of picture 48 + // WORKAROUND: ignore the seemingly broken priority of picture 48 // (island overview). Fixes bug #3041044. if (_resourceId == 48) ignoreBrokenPriority = true; @@ -551,7 +551,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { case PIC_OP_SET_PRIORITY: pic_priority = data[curPos++] & 0x0F; - if (isEGA) + if (isEGA) pic_priority = EGApriority[pic_priority]; if (ignoreBrokenPriority) pic_priority = 255; diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index 9412976d5b..6b4c8180bf 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -721,7 +721,7 @@ void GfxPorts::printWindowList(Console *con) { if ((*it)->isWindow()) { Window *wnd = ((Window *)*it); con->DebugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n", - wnd->id, wnd->title.c_str(), wnd->left, wnd->top, + wnd->id, wnd->title.c_str(), wnd->left, wnd->top, wnd->rect.left, wnd->rect.top, wnd->rect.right, wnd->rect.bottom, wnd->bDrawn, wnd->wndStyle); } diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index afb4c184e8..6ca4903e17 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -202,7 +202,7 @@ void GfxView::initData(GuiResourceId resourceId) { palOffset = READ_SCI11ENDIAN_UINT32(_resourceData + 8); // For SCI32, this is a scale flag - if (getSciVersion() >= SCI_VERSION_2) { + if (getSciVersion() >= SCI_VERSION_2) { _sci2ScaleRes = (Sci32ViewNativeResolution)_resourceData[5]; if (_screen->getUpscaledHires() == GFX_SCREEN_UPSCALED_DISABLED) _sci2ScaleRes = SCI_VIEW_NATIVERES_NONE; @@ -426,7 +426,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo // compression for SCI1.1+ Mac while (pixelNr < pixelCount) { uint32 pixelLine = pixelNr; - + if (hasByteLengths) { pixelNr += *rlePtr++; runLength = *rlePtr++; @@ -500,7 +500,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo } else { memcpy(outPtr + pixelNr, literalPtr, MIN(runLength, pixelCount - pixelNr)); literalPtr += runLength; - } + } break; case 0x80: // fill with color if (!literalPos) diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index 827e28073a..01c25ef401 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -224,7 +224,7 @@ static bool parsePart2(ParseTreeNode* parentNode, bool& nonempty) } else if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parsePart2(newNode, nonempty); if (found) { @@ -282,7 +282,7 @@ static bool parsePart3(ParseTreeNode* parentNode, bool& nonempty) } else if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parsePart3(newNode, nonempty); if (found) { @@ -366,7 +366,7 @@ static bool parseRef(ParseTreeNode* parentNode) said_attach_subtree(newParent, 0x144, 0x14f, newNode); newParent = newParent->right; - + newNode = said_branch_node(said_next_node(), 0, 0); found = parseRef(newNode); @@ -381,14 +381,14 @@ static bool parseRef(ParseTreeNode* parentNode) } - } + } // NB: This is not an "else if'. // If there is a "< [ ... ]", that is parsed as "< ..." if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parseRef(newNode); if (found) { diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 308bd92ef4..fa70481bdc 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -128,7 +128,7 @@ static const char *s_resourceTypeSuffixes[] = { "trn", "rbt", "vmd", "chk", "", "etc", "duk", "clu", "tga", "zzz", "", "", "" -}; +}; const char *getResourceTypeName(ResourceType restype) { if (restype != kResourceTypeInvalid) @@ -449,11 +449,11 @@ bool MacResourceForkResourceSource::isCompressableResource(ResourceType type) co *ptr++ = value; \ } -void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const { +void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const { // KQ6 Mac is the only game not compressed. It's not worth writing a // heuristic just for that game. Also, skip over any resource that cannot // be compressed. - bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType()); + bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType()); uint32 uncompressedSize = 0; // GK2 Mac is crazy. In its Patches resource fork, picture 2315 is not @@ -503,7 +503,7 @@ void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStrea // Copy chunk expanded extraByte1 = stream->readByte(); extraByte2 = stream->readByte(); - + literalLength = extraByte2 & 3; OUTPUT_LITERAL() @@ -824,7 +824,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) { byte *ptr = chunk->data; uint32 firstOffset = 0; - + for (;;) { ResourceType type = resMan->convertResType(*ptr); uint16 number = READ_LE_UINT16(ptr + 1); @@ -844,7 +844,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) { // There's no end marker to the data table, but the first resource // begins directly after the entry table. So, when we hit the first // resource, we're at the end of the entry table. - + if (!firstOffset) firstOffset = entry.offset; @@ -1243,7 +1243,7 @@ ResVersion ResourceManager::detectVolVersion() { for (Common::List::iterator it = _sources.begin(); it != _sources.end(); ++it) { rsrc = *it; - + if (rsrc->getSourceType() == kSourceVolume) { if (rsrc->_resourceFile) { fileStream = rsrc->_resourceFile->createReadStream(); @@ -1291,7 +1291,7 @@ ResVersion ResourceManager::detectVolVersion() { // loading SCI3 volumes, the format is otherwise // identical to SCI2. We therefore get the compression // indicator here, but disregard it in the following - // code. + // code. wCompression = fileStream->readUint16LE(); if (fileStream->eos()) { @@ -1473,7 +1473,7 @@ void ResourceManager::readResourcePatchesBase36() { name = (*x)->getName(); ResourceId resource36 = convertPatchNameBase36((ResourceType)i, name); - + /* if (i == kResourceTypeAudio36) debug("audio36 patch: %s => %s. tuple:%d, %s\n", name.c_str(), inputName.c_str(), resource36.tuple, resource36.toString().c_str()); @@ -1494,7 +1494,7 @@ void ResourceManager::readResourcePatchesBase36() { // Check for SOL as well tag = (tag << 16) | stream->readUint16BE(); - + if (tag != MKTAG('S','O','L',0)) { delete stream; continue; @@ -1613,7 +1613,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) { warning("Error while reading %s", map->getLocationName().c_str()); return SCI_ERROR_RESMAP_NOT_FOUND; } - + if (offset == 0xFFFFFFFF) break; @@ -2129,7 +2129,7 @@ void ResourceManager::detectSciVersion() { bool oldDecompressors = true; ResourceCompression viewCompression; -#ifdef ENABLE_SCI32 +#ifdef ENABLE_SCI32 viewCompression = getViewCompression(); #else if (_volVersion >= kResVersionSci2) { @@ -2173,7 +2173,7 @@ void ResourceManager::detectSciVersion() { } #endif } - + if (_volVersion == kResVersionSci11Mac) { // SCI32 doesn't have the resource.cfg file, so we can figure out // which of the games are SCI1.1. Note that there are no Mac SCI2 games. diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 588ea76ea5..032040fc2c 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -356,14 +356,14 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) { stream->seek(offset + 1); byte headerSize = stream->readByte(); assert(headerSize == 11 || headerSize == 12); - + stream->skip(5); uint32 size = stream->readUint32LE() + headerSize + 2; addResource(ResourceId(kResourceTypeAudio, n), src, offset, size); } } else { - bool isEarly = (entrySize != 11); + bool isEarly = (entrySize != 11); if (!isEarly) { offset = READ_LE_UINT32(ptr); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index cc9042ceb7..de1aafb8e2 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -282,7 +282,7 @@ Common::Error SciEngine::run() { // without this games would be pretty badly broken } - // Show any special warnings for buggy scripts with severe game bugs, + // Show any special warnings for buggy scripts with severe game bugs, // which have been patched by Sierra if (getGameId() == GID_LONGBOW) { // Longbow 1.0 has a buggy script which prevents the game @@ -868,7 +868,7 @@ void SciEngine::syncIngameAudioOptions() { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? - if (getGameId() == GID_SQ4 + if (getGameId() == GID_SQ4 || getGameId() == GID_FREDDYPHARKAS // TODO: The following need script patches for simultaneous speech and subtitles //|| getGameId() == GID_KQ6 @@ -907,7 +907,7 @@ void SciEngine::loadMacExecutable() { // KQ6/Freddy require the executable to load their icon bar palettes if (hasMacIconBar()) error("Could not load Mac resource fork '%s'", filename.c_str()); - + // TODO: Show some sort of warning dialog saying they can't get any // high-res Mac fonts, when we get to that point ;) } diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 04ccbd97d2..b419d862a4 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -38,7 +38,7 @@ struct ADGameDescription; * Status of this engine: ??? * * Games using this engine: - * - Newer Sierra adventure games (based on FreeSCI) + * - Newer Sierra adventure games (based on FreeSCI) * * @todo give a concrete list of supported games. Could also * list future games, with status for each. @@ -176,7 +176,7 @@ enum SciGameId { GID_FANMADE // FIXME: Do we really need/want this? }; -/** +/** * SCI versions * For more information, check here: * http://wiki.scummvm.org/index.php/Sierra_Game_Versions#SCI_Games diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 592caa5814..123dd21894 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -285,7 +285,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 // instead. memcpy(compressedData, audioRes->data, audioRes->size); Common::SeekableReadStream *compressedStream = new Common::MemoryReadStream(compressedData, audioRes->size, DisposeAfterUse::YES); - + switch (audioCompressionType) { case MKTAG('M','P','3',' '): #ifdef USE_MAD diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 1436ca45a7..3c750401b9 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -178,7 +178,7 @@ int MidiDriver_AmigaMac::interpolate(int8 *samples, frac_t offset, bool isUnsign int diff = (s2 - s1) << 8; return (s1 << 8) + fracToInt(diff * (offset & FRAC_LO_MASK)); } - + int diff = (samples[x + 1] - samples[x]) << 8; return (samples[x] << 8) + fracToInt(diff * (offset & FRAC_LO_MASK)); } @@ -373,7 +373,7 @@ void MidiDriver_AmigaMac::setOutputFrac(int voice) { fnote -= instrument->baseNote; fnote *= 4; // FIXME: check how SSCI maps this - fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169; + fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169; while (fnote < 0) { divFact *= 2; @@ -617,7 +617,7 @@ int MidiDriver_AmigaMac::open() { } else if (!loadInstrumentsSCI0Mac(stream)) return Common::kUnknownError; } - + MidiDriver_Emulated::open(); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, _mixer->kMaxChannelVolume, 0, DisposeAfterUse::NO); diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 96cbf135ed..2afab3858d 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -291,8 +291,8 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { if (_soundVersion >= SCI_VERSION_1_EARLY && g_sci->getPlatform() == Common::kPlatformAmiga) flags = 0; int endPart = track->digitalSampleEnd > 0 ? (track->digitalSampleSize - track->digitalSampleEnd) : 0; - pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart, - track->digitalSampleSize - track->digitalSampleStart - endPart, + pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart, + track->digitalSampleSize - track->digitalSampleStart - endPart, track->digitalSampleRate, flags, DisposeAfterUse::NO); delete pSnd->pLoopStream; pSnd->pLoopStream = 0; diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index d394fd0b2b..77f45e0788 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -53,14 +53,14 @@ namespace Sci { // Taken from http://anthonylarme.tripod.com/phantas/phintgtp.html // // (...) What we needed was a way of playing video, but have it blend into -// normal room art instead of occupying its own rectangular area. Room art -// consists of a background pic overlaid with various animating cels -// (traditional lingo: sprites). The cels each have a priority that determines -// who is on top and who is behind in the drawing order. Cels are read from -// *.v56 files (another proprietary format). A Robot is video frames with -// transparent background including priority and x,y information. Thus, it is +// normal room art instead of occupying its own rectangular area. Room art +// consists of a background pic overlaid with various animating cels +// (traditional lingo: sprites). The cels each have a priority that determines +// who is on top and who is behind in the drawing order. Cels are read from +// *.v56 files (another proprietary format). A Robot is video frames with +// transparent background including priority and x,y information. Thus, it is // like a cel, except it comes from an RBT - not a v56. Because it blends into -// our graphics engine, it looks just like a part of the room. A RBT can move +// our graphics engine, it looks just like a part of the room. A RBT can move // around the screen and go behind other objects. (...) #ifdef ENABLE_SCI32 @@ -105,7 +105,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) { _surface = new Graphics::Surface(); readHeaderChunk(); - + // There are several versions of robot files, ranging from 3 to 6. // v3: no known examples // v4: PQ:SWAT demo @@ -223,7 +223,7 @@ void RobotDecoder::calculateVideoDimensions() { // This is an O(n) operation, as each frame has a different size. // We need to know the actual frame size to have a constant video size. uint32 pos = _fileStream->pos(); - + for (uint32 curFrame = 0; curFrame < _header.frameCount; curFrame++) { _fileStream->skip(4); uint16 frameWidth = _fileStream->readUint16(); @@ -327,8 +327,8 @@ const Graphics::Surface *RobotDecoder::decodeNextFrame() { // FIXME: For some reason, there are audio hiccups/gaps if (_header.hasSound) { _fileStream->skip(8); // header - _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8), - (audioChunkSize - 8) * 2, DisposeAfterUse::NO, + _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8), + (audioChunkSize - 8) * 2, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN); } else { _fileStream->skip(audioChunkSize); @@ -359,7 +359,7 @@ void RobotDecoder::close() { } reset(); -} +} #endif diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index f5e8ad9b05..800a3c9024 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -58,7 +58,7 @@ public: Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } - + protected: Common::Rational getFrameRate() const { assert(_frameDelay); return Common::Rational(60, _frameDelay); } diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index e4057d1f13..20b929dfd4 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -1066,7 +1066,7 @@ static int checkXYInBoxBounds(int boxnum, int x, int y, int &destX, int &destY) int dist; // MM C64: This fixes the trunk bug (#3070065), as well - // as the fruit bowl, however im not sure if its + // as the fruit bowl, however im not sure if its // the proper solution or not. if( g_scumm->_game.version == 0 ) yDist = ABS(y - destY); diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 97caa47d6a..7fb834ce98 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -1070,7 +1070,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, Graphics::Surface backSurface; if ((ignoreCharsetMask || !vs->hasTwoBuffers) #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - && (_vm->_game.platform != Common::kPlatformFMTowns) + && (_vm->_game.platform != Common::kPlatformFMTowns) #endif ) { dstSurface = *vs; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 75cde5e33a..4ca4988605 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -73,10 +73,10 @@ static const int v1MMNESLookup[25] = { }; static const byte v0ActorTalkArray[0x19] = { - 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x00, 0x46, 0x06, - 0x06, 0x06, 0x06, 0xFF, 0xFF, - 0x06, 0xC0, 0x06, 0x06, 0x00, + 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x00, 0x46, 0x06, + 0x06, 0x06, 0x06, 0xFF, 0xFF, + 0x06, 0xC0, 0x06, 0x06, 0x00, 0xC0, 0xC0, 0x00, 0x06, 0x06 }; @@ -1417,7 +1417,7 @@ byte C64CostumeLoader::increaseAnims(Actor *a) { if (A->_moving && _vm->_currentRoom != 1 && _vm->_currentRoom != 44) { if (a->_cost.soundPos == 0) a->_cost.soundCounter++; - + // Is this the correct location? // 0x073C if (v0ActorTalkArray[a->_number] & 0x3F) diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index e5c5906404..18f2f4ddec 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -272,7 +272,7 @@ static BaseScummFile *openDiskImage(const Common::FSNode &node, const GameFilena GameSettings gs; memset(&gs, 0, sizeof(GameSettings)); gs.gameid = gfp->gameid; - gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK); + gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK); gs.platform = gfp->platform; // determine second disk file name @@ -454,7 +454,7 @@ static void composeFileHashMap(DescMap &fileMD5Map, const Common::FSList &fslist matched = true; break; } - + if (!matched) continue; @@ -515,7 +515,7 @@ static void detectGames(const Common::FSList &fslist, Common::List vs->w) return; - + // Convert 'rect' to local (virtual screen) coordinates rect.top -= vs->topline; rect.bottom -= vs->topline; @@ -1068,7 +1068,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } #endif - + if (_game.features & GF_16BIT_COLOR) fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->format.bytesPerPixel); else @@ -1128,7 +1128,7 @@ void ScummEngine::clearTextSurface() { fill((byte*)_textSurface.pixels, _textSurface.pitch, #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE _game.platform == Common::kPlatformFMTowns ? 0 : -#endif +#endif CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.format.bytesPerPixel); } @@ -1345,12 +1345,12 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) { color = ((color & 0x0f) << 4) | (color & 0x0f); byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop + vs->topline) * _textSurfaceMultiplier); fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); - + if (_game.id == GID_MONKEY2 || _game.id == GID_INDY4 || ((_game.id == GID_INDY3 || _game.id == GID_ZAK) && vs->number != kTextVirtScreen) || (_game.id == GID_LOOM && vs->number == kMainVirtScreen)) return; } #endif - + fill(backbuff, vs->pitch, color, width, height, vs->format.bytesPerPixel); } } @@ -4010,7 +4010,7 @@ void ScummEngine::scrollEffect(int dir) { y = 1 + step; while (y < vs->h) { moveScreen(0, -step, vs->h); -#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_townsScreen) { towns_drawStripToScreen(vs, 0, vs->topline + vs->h - step, 0, y - step, vs->w, step); } else @@ -4023,7 +4023,7 @@ void ScummEngine::scrollEffect(int dir) { vs->w * m, step * m); _system->updateScreen(); } - + waitForTimer(delay); y += step; } @@ -4046,7 +4046,7 @@ void ScummEngine::scrollEffect(int dir) { vs->w * m, step * m); _system->updateScreen(); } - + waitForTimer(delay); y += step; } @@ -4093,7 +4093,7 @@ void ScummEngine::scrollEffect(int dir) { 0, 0, step, vs->h); _system->updateScreen(); - } + } waitForTimer(delay); x += step; diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 2e7111e78b..af75a98731 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -450,14 +450,14 @@ public: void clearLayer(int layer); void fillLayerRect(int layer, int x, int y, int w, int h, int col); //void copyRectToLayer(int layer, int x, int y, int w, int h, const uint8 *src); - + uint8 *getLayerPixels(int layer, int x, int y); int getLayerPitch(int layer); int getLayerHeight(int layer); int getLayerBpp(int layer); int getLayerScaleW(int layer); int getLayerScaleH(int layer); - + void addDirtyRect(int x, int y, int w, int h); void toggleLayers(int flag); void update(); @@ -484,16 +484,16 @@ private: uint8 **bltInternY; uint16 *bltTmpPal; } _layers[2]; - + uint8 *_outBuffer; int _height; int _width; int _pitch; Graphics::PixelFormat _pixelFormat; - + int _numDirtyRects; - Common::List _dirtyRects; + Common::List _dirtyRects; OSystem *_system; }; #endif // DISABLE_TOWNS_DUAL_LAYER_MODE diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 4ec9c1bbf4..6a3f50a1af 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -47,7 +47,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in int dp2 = _townsScreen->getLayerPitch(1) - width * m * _townsScreen->getLayerBpp(1); int sp1 = vs->pitch - (width * vs->format.bytesPerPixel); int sp2 = _textSurface.pitch - width * m; - + if (vs->number == kMainVirtScreen || _game.id == GID_INDY3 || _game.id == GID_ZAK) { for (int h = 0; h < height; ++h) { if (_outputPixelFormat.bytesPerPixel == 2) { @@ -63,13 +63,13 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in src1 += vs->pitch; dst1 += _townsScreen->getLayerPitch(0); } - + for (int sH = 0; sH < m; ++sH) { memcpy(dst2, src2, width * m); src2 += _textSurface.pitch; dst2 += _townsScreen->getLayerPitch(1); } - } + } } else { dst1 = dst2; for (int h = 0; h < height; ++h) { @@ -81,7 +81,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in dst1 = dst2; uint8 *src3 = src2; - + if (m == 2) { dst2 += _townsScreen->getLayerPitch(1); src3 += _townsScreen->getLayerPitch(1); @@ -95,7 +95,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in dst1++; } - src1 += sp1; + src1 += sp1; src2 = src3 + sp2; dst1 = dst2 + dp2; dst2 += dp2; @@ -231,7 +231,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void if (width > _width || height > _height) error("TownsScreen::setupLayer(): Layer width/height must be equal or less than screen width/height"); - + l->scaleW = _width / width; l->scaleH = _height / height; @@ -268,13 +268,13 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void delete[] l->bltTmpPal; l->bltTmpPal = (l->bpp == 1 && _pixelFormat.bytesPerPixel == 2) ? new uint16[l->numCol] : 0; - + l->enabled = true; _layers[0].onBottom = true; _layers[1].onBottom = _layers[0].enabled ? false : true; l->ready = true; } - + void TownsScreen::clearLayer(int layer) { if (layer < 0 || layer > 1) return; @@ -300,10 +300,10 @@ void TownsScreen::fillLayerRect(int layer, int x, int y, int w, int h, int col) assert(x >= 0 && y >= 0 && ((x + w) * l->bpp) <= (l->pitch) && (y + h) <= (l->height)); uint8 *pos = l->pixels + y * l->pitch + x * l->bpp; - + for (int i = 0; i < h; ++i) { if (l->bpp == 2) { - for (int ii = 0; ii < w; ++ii) { + for (int ii = 0; ii < w; ++ii) { *(uint16*)pos = col; pos += 2; } @@ -359,8 +359,8 @@ int TownsScreen::getLayerScaleH(int layer) { void TownsScreen::addDirtyRect(int x, int y, int w, int h) { if (w <= 0 || h <= 0 || _numDirtyRects > DIRTY_RECTS_MAX) - return; - + return; + if (_numDirtyRects == DIRTY_RECTS_MAX) { // full redraw _dirtyRects.clear(); @@ -383,25 +383,25 @@ void TownsScreen::addDirtyRect(int x, int y, int w, int h) { y = r->top; skip = true; } - + if (x2 > r->left && x2 < r->right && y > r->top && y < r->bottom) { x2 = r->right; y = r->top; skip = true; } - + if (x2 > r->left && x2 < r->right && y2 > r->top && y2 < r->bottom) { x2 = r->right; y2 = r->bottom; skip = true; } - + if (x > r->left && x < r->right && y2 > r->top && y2 < r->bottom) { x = r->left; y2 = r->bottom; skip = true; - } - + } + if (skip) { r->left = x; r->top = y; @@ -486,13 +486,13 @@ void TownsScreen::updateOutputBuffer() { uint8 col = l->bltInternY[y][l->bltInternX[x]]; if (col || l->onBottom) { if (l->numCol == 16) - col = (col >> 4) & (col & 0x0f); + col = (col >> 4) & (col & 0x0f); *dst = col; } dst++; } dst += ptch; - } + } } } } @@ -505,7 +505,7 @@ void TownsScreen::outputToScreen() { _numDirtyRects = 0; } -uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) { +uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) { return _pixelFormat.RGBToColor(palEntry[0], palEntry[1], palEntry[2]); } diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index a7d808e316..af56bca2ee 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -1018,7 +1018,7 @@ int LogicHEsoccer::op_1007(int32 *args) { // Returns the square root of the sum of the squares of the arguments static inline double sqrtSquare(double a1, double a2, double a3) { return sqrt(a1 * a1 + a2 * a2 + a3 * a3); -} +} int LogicHEsoccer::op_1008(int32 *args) { // TODO: Used during a match (kicking?) diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 4565bb9f26..39240e347f 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -166,7 +166,7 @@ bool MacResExtractor::extractResource(int id, CachedCursor *cc) { } Common::SeekableReadStream *dataStream = _resMgr->getResource('crsr', id + 1000); - + if (!dataStream) return false; diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h index 9978869ffc..6996ce81eb 100644 --- a/engines/scumm/he/resource_he.h +++ b/engines/scumm/he/resource_he.h @@ -61,7 +61,7 @@ private: ResExtractor::CachedCursor *findCachedCursor(int id); ResExtractor::CachedCursor *getCachedCursorSlot(); - + CachedCursor _cursorCache[MAX_CACHED_CURSORS]; }; diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp index fb070b3e27..cf7d9fbd2f 100644 --- a/engines/scumm/he/script_v60he.cpp +++ b/engines/scumm/he/script_v60he.cpp @@ -744,7 +744,7 @@ void ScummEngine_v60he::o60_closeFile() { _hOutFileTable[slot] = 0; } - delete _hInFileTable[slot]; + delete _hInFileTable[slot]; _hInFileTable[slot] = 0; } } diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 8f16bf0f3a..5af4035930 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -1446,7 +1446,7 @@ void ScummEngine_v72he::o72_openFile() { _hOutFileTable[slot]->write(initialData, initialSize); delete[] initialData; } - + } break; default: error("o72_openFile(): wrong open file mode %d", mode); diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 6813566144..317ef36cb9 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -100,16 +100,16 @@ IMuseInternal::~IMuseInternal() { } } -byte *IMuseInternal::findStartOfSound(int sound, int ct) { +byte *IMuseInternal::findStartOfSound(int sound, int ct) { int32 size, pos; - + static const uint32 id[] = { MKTAG('M', 'T', 'h', 'd'), MKTAG('F', 'O', 'R', 'M'), MKTAG('M', 'D', 'h', 'd'), MKTAG('M', 'D', 'p', 'g') }; - + byte *ptr = g_scumm->_res->_types[rtSound][sound]._address; if (ptr == NULL) { @@ -952,7 +952,7 @@ void IMuseInternal::handle_marker(uint id, byte data) { _trigger_count--; _queue_cleared = false; _queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue); - + while (_queue_end != _queue_pos && _cmd_queue[_queue_end].array[0] == COMMAND_ID && !_queue_cleared) { p = _cmd_queue[_queue_end].array; doCommand_internal(p[1], p[2], p[3], p[4], p[5], p[6], p[7], 0); diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h index 8808a3655a..6a7b9fc7d9 100644 --- a/engines/scumm/imuse/imuse_internal.h +++ b/engines/scumm/imuse/imuse_internal.h @@ -450,7 +450,7 @@ protected: kMThd = 1, kFORM = 2, kMDhd = 4, // Used in MI2 and INDY4. Contain certain start parameters (priority, volume, etc. ) for the player. - kMDpg = 8 // These chunks exist in DOTT and SAMNMAX. They don't get processed, however. + kMDpg = 8 // These chunks exist in DOTT and SAMNMAX. They don't get processed, however. }; byte *findStartOfSound(int sound, int ct = (kMThd | kFORM)); diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp index 0b084f3116..61b9cad2cb 100644 --- a/engines/scumm/imuse/imuse_player.cpp +++ b/engines/scumm/imuse/imuse_player.cpp @@ -120,7 +120,7 @@ bool Player::startSound(int sound, MidiDriver *midi) { _midi = NULL; return false; } - + debugC(DEBUG_IMUSE, "Starting music %d", sound); return true; } @@ -194,7 +194,7 @@ int Player::start_seq_sound(int sound, bool reset_vars) { _parser->property(MidiParser::mpSmartJump, 1); _parser->loadMusic(ptr, 0); _parser->setTrack(_track_index); - + ptr = _se->findStartOfSound(sound, IMuseInternal::kMDhd); setSpeed(reset_vars ? (ptr ? (READ_BE_UINT32(&ptr[4]) && ptr[15] ? ptr[15] : 128) : 128) : _speed); @@ -226,7 +226,7 @@ void Player::loadStartParameters(int sound) { _pan = ptr[4]; _transpose = ptr[5]; _detune = ptr[6]; - setSpeed(ptr[7]); + setSpeed(ptr[7]); } } } diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp index 4eb3bee93c..c3bec93a60 100644 --- a/engines/scumm/imuse/sysex_scumm.cpp +++ b/engines/scumm/imuse/sysex_scumm.cpp @@ -76,7 +76,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) { part->set_pri(p[4]); part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F)); part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F)); - part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false; + part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false; part->set_transpose((p[9] & 0x0F) << 4 | (p[10] & 0x0F)); part->set_detune((p[11] & 0x0F) << 4 | (p[12] & 0x0F)); part->pitchBendFactor((p[13] & 0x0F) << 4 | (p[14] & 0x0F)); diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index e71a8d0587..dd7630d370 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -32,7 +32,7 @@ Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVe void Player_Towns::setSfxVolume(int vol) { if (!_intf) - return; + return; _intf->setSoundEffectVolume(vol); } @@ -98,17 +98,17 @@ void Player_Towns::playPcmTrack(int sound, const uint8 *data, int velo, int pan, return; const uint8 *sfxData = data + 16; - + int numChan = _v2 ? 1 : data[14]; for (int i = 0; i < numChan; i++) { int chan = allocatePcmChannel(sound, i, priority); if (!chan) return; - + _intf->callback(70, _unkFlags); _intf->callback(3, chan + 0x3f, pan); _intf->callback(37, chan + 0x3f, note, velo, sfxData); - + _pcmCurrentSound[chan].note = note; _pcmCurrentSound[chan].velo = velo; _pcmCurrentSound[chan].pan = pan; @@ -191,7 +191,7 @@ Player_Towns_v1::Player_Towns_v1(ScummEngine *vm, Audio::Mixer *mixer) : Player_ if (_vm->_game.version == 3) { _soundOverride = new SoundOvrParameters[_numSoundMax]; memset(_soundOverride, 0, _numSoundMax * sizeof(SoundOvrParameters)); - } + } _driver = new TownsEuphonyDriver(mixer); } @@ -204,7 +204,7 @@ Player_Towns_v1::~Player_Towns_v1() { bool Player_Towns_v1::init() { if (!_driver) return false; - + if (!_driver->init()) return false; @@ -235,13 +235,13 @@ void Player_Towns_v1::startSound(int sound) { if (type == 0) { uint8 velocity = 0; uint8 note = 0; - + if (_vm->_game.version == 3) { velocity = (_soundOverride[sound].vLeft + _soundOverride[sound].vRight); note = _soundOverride[sound].note; } - velocity = velocity ? velocity >> 2 : ptr[14] >> 1; + velocity = velocity ? velocity >> 2 : ptr[14] >> 1; playPcmTrack(sound, ptr + 6, velocity, 64, note ? note : ptr[50], READ_LE_UINT16(ptr + 10)); } else if (type == 1) { @@ -267,7 +267,7 @@ void Player_Towns_v1::stopSound(int sound) { _eupLooping = false; _driver->stopParser(); } - + stopPcmTrack(sound); } @@ -293,7 +293,7 @@ int Player_Towns_v1::getSoundStatus(int sound) const { int32 Player_Towns_v1::doCommand(int numargs, int args[]) { int32 res = 0; - + switch (args[0]) { case 2: _driver->intf()->callback(73, 0); @@ -381,12 +381,12 @@ void Player_Towns_v1::saveLoadWithSerializer(Serializer *ser) { void Player_Towns_v1::restoreAfterLoad() { setVolumeCD(_cdaVolLeft, _cdaVolRight); - + if (_cdaCurrentSoundTemp) { uint8 *ptr = _vm->getResourceAddress(rtSound, _cdaCurrentSoundTemp) + 6; if (_vm->_game.version != 3) ptr += 2; - + if (ptr[7] == 2) { playCdaTrack(_cdaCurrentSoundTemp, ptr, true); _cdaCurrentSound = _cdaCurrentSoundTemp; @@ -398,7 +398,7 @@ void Player_Towns_v1::restoreAfterLoad() { uint8 *ptr = _vm->getResourceAddress(rtSound, _eupCurrentSound) + 6; if (_vm->_game.version != 3) ptr += 2; - + if (ptr[7] == 1) { setSoundVolume(_eupCurrentSound, _eupVolLeft, _eupVolRight); playEuphonyTrack(_eupCurrentSound, ptr); @@ -458,7 +458,7 @@ void Player_Towns_v1::startSoundEx(int sound, int velo, int pan, int note) { } else if (ptr[13] == 2) { int volLeft = velo; int volRight = velo; - + if (pan < 50) volRight = ((pan * 2 + 1) * velo + 50) / 100; else if (pan > 50) @@ -478,7 +478,7 @@ void Player_Towns_v1::stopSoundSuspendLooping(int sound) { return; } else if (sound == _cdaCurrentSound) { if (_cdaNumLoops && _cdaForceRestart) - _cdaForceRestart = 1; + _cdaForceRestart = 1; } else { for (int i = 1; i < 9; i++) { if (sound == _pcmCurrentSound[i].index) { @@ -487,7 +487,7 @@ void Player_Towns_v1::stopSoundSuspendLooping(int sound) { _driver->stopSoundEffect(i + 0x3f); if (_pcmCurrentSound[i].looping) _pcmCurrentSound[i].paused = 1; - else + else _pcmCurrentSound[i].index = 0; } } @@ -532,7 +532,7 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) { uint32 trackSize = READ_LE_UINT32(src); src += 4; uint8 startTick = *src++; - + _driver->setMusicTempo(*src++); _driver->startMusicTrack(trackData, trackSize, startTick); @@ -559,7 +559,7 @@ void Player_Towns_v1::playCdaTrack(int sound, const uint8 *data, bool skipTrackV } } - if (sound == _cdaCurrentSound && _vm->_sound->pollCD() == 1) + if (sound == _cdaCurrentSound && _vm->_sound->pollCD() == 1) return; ptr += 16; @@ -585,7 +585,7 @@ Player_Towns_v2::~Player_Towns_v2() { _intf = 0; if (_imuseDispose) - delete _imuse; + delete _imuse; delete[] _sblData; delete[] _soundOverride; @@ -594,7 +594,7 @@ Player_Towns_v2::~Player_Towns_v2() { bool Player_Towns_v2::init() { if (!_intf) return false; - + if (!_intf->init()) return false; @@ -637,7 +637,7 @@ void Player_Towns_v2::startSound(int sound) { void Player_Towns_v2::stopSound(int sound) { if (_soundOverride[sound].type == 7) { - stopPcmTrack(sound); + stopPcmTrack(sound); } else { _imuse->stopSound(sound); } @@ -651,7 +651,7 @@ void Player_Towns_v2::stopAllSounds() { int32 Player_Towns_v2::doCommand(int numargs, int args[]) { int32 res = -1; uint8 *ptr = 0; - + switch (args[0]) { case 8: startSound(args[1]); @@ -675,7 +675,7 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) { case 258: if (_soundOverride[args[1]].type == 0) { ptr = _vm->getResourceAddress(rtSound, args[1]); - if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S')) + if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S')) _soundOverride[args[1]].type = 7; } if (_soundOverride[args[1]].type == 7) { @@ -683,11 +683,11 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) { res = 0; } break; - + case 259: if (_soundOverride[args[1]].type == 0) { ptr = _vm->getResourceAddress(rtSound, args[1]); - if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S')) + if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S')) _soundOverride[args[1]].type = 7; } if (_soundOverride[args[1]].type == 7) { @@ -702,7 +702,7 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) { if (res == -1) return _imuse->doCommand(numargs, args); - + return res; } @@ -718,9 +718,9 @@ void Player_Towns_v2::playVocTrack(const uint8 *data) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x04, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00 }; - + uint32 len = (READ_LE_UINT32(data) >> 8) - 2; - + int chan = allocatePcmChannel(0xffff, 0, 0x1000); if (!chan) return; diff --git a/engines/scumm/player_towns.h b/engines/scumm/player_towns.h index 470020d621..5c76d7c6c7 100644 --- a/engines/scumm/player_towns.h +++ b/engines/scumm/player_towns.h @@ -47,8 +47,8 @@ public: virtual void restoreAfterLoad(); // version 1 specific - virtual int getCurrentCdaSound() { return 0; } - virtual int getCurrentCdaVolume() { return 0; } + virtual int getCurrentCdaSound() { return 0; } + virtual int getCurrentCdaVolume() { return 0; } virtual void setVolumeCD(int left, int right) {} virtual void setSoundVolume(int sound, int left, int right) {} virtual void setSoundNote(int sound, int note) {} @@ -92,8 +92,8 @@ public: void stopAllSounds(); int getSoundStatus(int sound) const; - int getCurrentCdaSound() { return _cdaCurrentSound; } - int getCurrentCdaVolume() { return (_cdaVolLeft + _cdaVolRight + 1) >> 1; } + int getCurrentCdaSound() { return _cdaCurrentSound; } + int getCurrentCdaVolume() { return (_cdaVolLeft + _cdaVolRight + 1) >> 1; } int32 doCommand(int numargs, int args[]); @@ -124,7 +124,7 @@ private: uint8 _cdaVolLeft; uint8 _cdaVolRight; - + uint8 _eupCurrentSound; uint8 _eupLooping; uint8 _eupVolLeft; @@ -170,7 +170,7 @@ private: SoundOvrParameters *_soundOverride; uint8 *_sblData; - + IMuse *_imuse; const bool _imuseDispose; }; diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index f9a6b211c3..3cc710c207 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1316,10 +1316,10 @@ void ScummEngine::saveOrLoad(Serializer *s) { MKEND() }; - s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8); + s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8); s->saveLoadArrayOf(_cyclRects, 10, sizeof(_cyclRects[0]), townsFields); s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields); - s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8); + s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8); s->saveLoadEntries(this, townsExtraEntries); } #endif diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 2c8f65496f..a6cf504586 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1611,7 +1611,7 @@ void ScummEngine_v5::o5_resourceRoutines() { foo = getVarOrDirectByte(PARAM_2); bar = fetchScriptByte(); if (_townsPlayer) - _townsPlayer->setSoundVolume(resid, foo, bar); + _townsPlayer->setSoundVolume(resid, foo, bar); break; case 37: if (_townsPlayer) @@ -2319,7 +2319,7 @@ void ScummEngine_v5::o5_verbOps() { if (_game.platform == Common::kPlatformFMTowns && _game.version == 3 && slot) continue; - + if (slot == 0) { for (slot = 1; slot < _numVerbs; slot++) { if (_verbs[slot].verbid == 0) diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 4fd1f6b32d..ed5537f409 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -329,7 +329,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) memset(&_cyclRects, 0, 16 * sizeof(Common::Rect)); _numCyclRects = 0; #endif - + // // Init all VARS to 0xFF // @@ -591,7 +591,7 @@ ScummEngine::~ScummEngine() { delete _actors[i]; delete[] _actors; } - + delete[] _sortedActors; delete[] _2byteFontPtr; @@ -1150,20 +1150,20 @@ Common::Error ScummEngine::init() { screenWidth *= _textSurfaceMultiplier; screenHeight *= _textSurfaceMultiplier; } - if (_game.features & GF_16BIT_COLOR + if (_game.features & GF_16BIT_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE || _game.platform == Common::kPlatformFMTowns #endif ) { #ifdef USE_RGB_COLOR - _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); + _outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) { initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat); if (_outputPixelFormat != _system->getScreenFormat()) return Common::kUnsupportedColorMode; } else { - Common::List tryModes = _system->getSupportedFormats(); + Common::List tryModes = _system->getSupportedFormats(); for (Common::List::iterator g = tryModes.begin(); g != tryModes.end(); ++g) { if (g->bytesPerPixel != 2 || g->aBits()) { g = tryModes.erase(g); @@ -1176,7 +1176,7 @@ Common::Error ScummEngine::init() { break; } } - + initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes); if (_system->getScreenFormat().bytesPerPixel != 2) return Common::kUnsupportedColorMode; @@ -1868,7 +1868,7 @@ void ScummEngine::setupMusic(int midi) { } _imuse = IMuse::create(_system, nativeMidiDriver, adlibMidiDriver); - + if (_game.platform == Common::kPlatformFMTowns) { _musicEngine = _townsPlayer = new Player_Towns_v2(this, _mixer, _imuse, true); if (!_townsPlayer->init()) diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 5700271911..01bde90e1c 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -1004,7 +1004,7 @@ protected: // Screen rendering byte *_compositeBuf; byte *_herculesBuf; - + virtual void drawDirtyScreenParts(); void updateDirtyScreen(VirtScreenNumber slot); void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b); @@ -1148,7 +1148,7 @@ protected: void restoreCharsetBg(); void clearCharsetMask(); void clearTextSurface(); - + virtual void initCharset(int charset); virtual void printString(int m, const byte *msg); @@ -1348,10 +1348,10 @@ protected: Common::Rect _cyclRects[16]; int _numCyclRects; - + Common::Rect _curStringRect; - byte _townsOverrideShadowColor; + byte _townsOverrideShadowColor; byte _textPalette[48]; byte _townsClearLayerFlag; byte _townsActiveLayerFlags; diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index c22da8e7c7..27e43b3740 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -312,7 +312,7 @@ void Sound::playSound(int soundID) { sound = (byte *)malloc(size); memcpy(sound, ptr + 6, size); stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED); - _mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); + _mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID); } else if (_vm->_game.platform != Common::kPlatformFMTowns && READ_BE_UINT32(ptr) == MKTAG('S','O','U','N')) { if (_vm->_game.version != 3) diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 69caceb53a..0c1554840e 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -152,7 +152,7 @@ void ScummEngine_v0::setNewKidVerbs() { void ScummEngine_v0::switchActor(int slot) { resetSentence(false); - + if (_currentRoom == 45) return; @@ -728,7 +728,7 @@ void ScummEngine_v0::runObject(int obj, int entry) { entry = 0x0F; } } - + _v0ObjectInInventory = prev; if (getVerbEntrypoint(obj, entry) != 0) { @@ -830,7 +830,7 @@ bool ScummEngine_v0::verbObtain(int obj, int objIndex) { } else { _verbPickup = false; } - + // Ignore verbs? Actor *a = derefActor(VAR(VAR_EGO), "verbObtain"); if (((ActorC64 *)a)->_miscflags & 0x40) { @@ -989,7 +989,7 @@ bool ScummEngine_v0::verbExec() { runObject(_activeObjectIndex, entry); _v0ObjectIndex = false; } else if (_activeInventory) { - // Not sure this is the correct way to do this, + // Not sure this is the correct way to do this, // however its working for most situations - segra if (verbExecutes(_activeInventory, true) == false) { if (_activeObject2 && _activeObject2Inv && verbExecutes(_activeObject2, true)) { @@ -1001,7 +1001,7 @@ bool ScummEngine_v0::verbExec() { runObject(_activeObject, _activeVerb); } else { _v0ObjectInInventory = true; - + if (_activeObject2) { _activeObject = _activeObject2; @@ -1085,7 +1085,7 @@ void ScummEngine_v0::checkExecVerbs() { // Click into V2 inventory checkV2Inventory(_mouse.x, _mouse.y); - + // Did the Inventory position changed (arrows pressed, do nothing) if (invOff != _inventoryOffset) return; @@ -1143,7 +1143,7 @@ void ScummEngine_v0::checkExecVerbs() { obj = 0; objIdx = 0; } - + if (a->_miscflags & 0x80) { if (_activeVerb != 7 && over != 7) { _activeVerb = 0; @@ -1444,9 +1444,9 @@ void ScummEngine::restoreVerbBG(int verb) { VerbSlot *vs; vs = &_verbs[verb]; - uint8 col = + uint8 col = #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE - ((_game.platform == Common::kPlatformFMTowns) && (_game.id == GID_MONKEY2 || _game.id == GID_INDY4) && (vs->bkcolor == _townsOverrideShadowColor)) ? 0 : + ((_game.platform == Common::kPlatformFMTowns) && (_game.id == GID_MONKEY2 || _game.id == GID_INDY4) && (vs->bkcolor == _townsOverrideShadowColor)) ? 0 : #endif vs->bkcolor; diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index cb86264eeb..4ce3e2e88d 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -261,7 +261,7 @@ bool MoviePlayer::playVideo() { uint32 minWeight = 0xFFFFFFFF; uint32 weight; byte r, g, b; - + const byte *palette = _decoder->getPalette(); for (int i = 0; i < 256; i++) { diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 133abf165e..80b4809722 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -296,7 +296,7 @@ bool MoviePlayer::playVideo() { uint32 minWeight = 0xFFFFFFFF; uint32 weight; byte r, g, b; - + const byte *palette = _decoder->getPalette(); for (int i = 0; i < 256; i++) { diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h index 55deacd333..60070be214 100644 --- a/engines/sword25/gfx/animation.h +++ b/engines/sword25/gfx/animation.h @@ -210,7 +210,7 @@ private: AnimationDescription *getAnimationDescription() const; /** - * Initializes a new animation resource from an XML file. + * Initializes a new animation resource from an XML file. */ void initializeAnimationResource(const Common::String &fileName); }; diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index b9d70cf87b..621e20ad8c 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -64,7 +64,7 @@ AnimationResource::AnimationResource(const Common::String &filename) : char *xmlData = _pPackage->getXmlFile(getFileName(), &fileSize); if (!xmlData) { error("Could not read \"%s\".", getFileName().c_str()); - return; + return; } // Parse the contents @@ -118,7 +118,7 @@ bool AnimationResource::parserCallback_animation(ParserNode *node) { // Loop type value const char *loopTypeString = node->values["type"].c_str(); - + if (strcmp(loopTypeString, "oneshot") == 0) { _animationType = Animation::AT_ONESHOT; } else if (strcmp(loopTypeString, "loop") == 0) { @@ -148,7 +148,7 @@ bool AnimationResource::parserCallback_frame(ParserNode *node) { } frame.fileName = _pPackage->getAbsolutePath(fileString); if (frame.fileName.empty()) { - error("Could not create absolute path for file specified in tag in \"%s\": \"%s\".", + error("Could not create absolute path for file specified in tag in \"%s\": \"%s\".", getFileName().c_str(), fileString); return false; } diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp index 7657abb5f2..0aeca7c180 100644 --- a/engines/sword25/gfx/fontresource.cpp +++ b/engines/sword25/gfx/fontresource.cpp @@ -85,7 +85,7 @@ bool FontResource::parserCallback_font(ParserNode *node) { getFileName().c_str(), DEFAULT_GAPWIDTH); _gapWidth = DEFAULT_GAPWIDTH; } - + // Get a reference to the package manager assert(_pKernel); PackageManager *pPackage = _pKernel->getPackage(); diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 6b1c2bc514..91133b9fd2 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -365,7 +365,7 @@ void GraphicEngine::updateLastFrameDuration() { } bool GraphicEngine::saveThumbnailScreenshot(const Common::String &filename) { - // Note: In ScumMVM, rather than saivng the thumbnail to a file, we store it in memory + // Note: In ScumMVM, rather than saivng the thumbnail to a file, we store it in memory // until needed when creating savegame files delete _thumbnail; diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index cd7cfb6b69..2df8bd4f3e 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -2499,7 +2499,7 @@ void art_svp_render_aa_iter_step(ArtSVPRenderAAIter *iter, int *p_start, ADD_STEP(x, xdelta) } if (x < x1) { - this_ = + this_ = (int)(delta * (1 - 0.5 * (x_max - ix_max) * (x_max - ix_max) * rslope)); diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 4f9ba1d3c5..de7b62fba9 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -67,8 +67,8 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) { // This method takes a screen image with a dimension of 800x600, and creates a screenshot with a dimension of 200x125. - // First 50 pixels are cut off the top and bottom (the interface boards in the game). The remaining image of 800x500 - // will be on a 16th of its size, reduced by being handed out in 4x4 pixel blocks and the average of each block + // First 50 pixels are cut off the top and bottom (the interface boards in the game). The remaining image of 800x500 + // will be on a 16th of its size, reduced by being handed out in 4x4 pixel blocks and the average of each block // generates a pixel of the target image. Finally, the result as a PNG file is stored as a file. // The source image must be 800x600. @@ -84,7 +84,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) // Über das Zielbild iterieren und einen Pixel zur Zeit berechnen. uint x, y; x = y = 0; - + for (byte *pDest = (byte *)thumbnail.pixels; pDest < ((byte *)thumbnail.pixels + thumbnail.pitch * thumbnail.h); ) { // Get an average over a 4x4 pixel block in the source image int alpha, red, green, blue; diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index 8e18d2936d..82bb7cdff7 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -61,7 +61,7 @@ Text::Text(InputPersistenceBlock &reader, RenderObjectPtr parentPt // Temporarily set fields prior to unpersisting actual values _modulationColor(0xffffffff), _autoWrap(false), - _autoWrapThreshold(AUTO_WRAP_THRESHOLD_DEFAULT) { + _autoWrapThreshold(AUTO_WRAP_THRESHOLD_DEFAULT) { // Unpersist the fields _initSuccess = unpersist(reader); diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index 17e9199b5c..c88360e031 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -199,7 +199,7 @@ Common::String PersistenceService::getSavegameDirectory() { // Try and return the path using the savegame subfolder. But if doesn't exist, fall back on the data directory if (childNode.exists()) return childNode.getPath(); - + return node.getPath(); } diff --git a/engines/sword25/package/packagemanager.cpp b/engines/sword25/package/packagemanager.cpp index 5c869203c6..5549f50c3c 100644 --- a/engines/sword25/package/packagemanager.cpp +++ b/engines/sword25/package/packagemanager.cpp @@ -157,7 +157,7 @@ byte *PackageManager::getFile(const Common::String &fileName, uint *fileSizePtr) byte *buffer = new byte[file->size()]; file->read(buffer, file->size()); - + delete file; return buffer; } diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h index 3c4c4e89c5..c57c30636d 100644 --- a/engines/sword25/package/packagemanager.h +++ b/engines/sword25/package/packagemanager.h @@ -151,7 +151,7 @@ public: return result; } - + /** * Returns the path to the current directory. * @return Returns a string containing the path to the current directory. diff --git a/engines/sword25/util/lua/lapi.cpp b/engines/sword25/util/lua/lapi.cpp index 16f8460e39..ff25cfc653 100644 --- a/engines/sword25/util/lua/lapi.cpp +++ b/engines/sword25/util/lua/lapi.cpp @@ -213,7 +213,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { api_checkvalidindex(L, o); if (idx == LUA_ENVIRONINDEX) { Closure *func = curr_func(L); - api_check(L, ttistable(L->top - 1)); + api_check(L, ttistable(L->top - 1)); func->c.env = hvalue(L->top - 1); luaC_barrier(L, func, L->top - 1); } @@ -773,7 +773,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) { #define checkresults(L,na,nr) \ api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) - + LUA_API void lua_call (lua_State *L, int nargs, int nresults) { StkId func; diff --git a/engines/sword25/util/lua/lauxlib.cpp b/engines/sword25/util/lua/lauxlib.cpp index 8978cd5613..1261777315 100644 --- a/engines/sword25/util/lua/lauxlib.cpp +++ b/engines/sword25/util/lua/lauxlib.cpp @@ -570,13 +570,13 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { } c = lf.f->getc(); - if (c == '#') { // Unix exec. file? + if (c == '#') { // Unix exec. file? lf.extraline = 1; - while ((c = lf.f->getc()) != EOF && c != '\n') ; // skip first line + while ((c = lf.f->getc()) != EOF && c != '\n') ; // skip first line if (c == '\n') c = lf.f->getc(); } - if (c == LUA_SIGNATURE[0] && filename) { // binary file? - lf.f = freopen(filename, "rb", lf.f); // reopen in binary mode + if (c == LUA_SIGNATURE[0] && filename) { // binary file? + lf.f = freopen(filename, "rb", lf.f); // reopen in binary mode if (lf.f == NULL) return errfile(L, "reopen", fnameindex); // skip eventual `#!...' while ((c = lf.f->getc()) != EOF && c != LUA_SIGNATURE[0]) ; diff --git a/engines/sword25/util/lua/ldblib.cpp b/engines/sword25/util/lua/ldblib.cpp index 4d0333b46e..618e9a843f 100644 --- a/engines/sword25/util/lua/ldblib.cpp +++ b/engines/sword25/util/lua/ldblib.cpp @@ -142,7 +142,7 @@ static int db_getinfo (lua_State *L) { treatstackoption(L, L1, "func"); return 1; /* return table */ } - + static int db_getlocal (lua_State *L) { int arg; diff --git a/engines/sword25/util/lua/ldebug.cpp b/engines/sword25/util/lua/ldebug.cpp index 0b26522b31..85c492cc77 100644 --- a/engines/sword25/util/lua/ldebug.cpp +++ b/engines/sword25/util/lua/ldebug.cpp @@ -184,7 +184,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { int i; for (i=0; il.p->sizelineinfo; i++) setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); - sethvalue(L, L->top, t); + sethvalue(L, L->top, t); } incr_top(L); } diff --git a/engines/sword25/util/lua/ldo.cpp b/engines/sword25/util/lua/ldo.cpp index bbcdf98b3d..49e0881a45 100644 --- a/engines/sword25/util/lua/ldo.cpp +++ b/engines/sword25/util/lua/ldo.cpp @@ -384,7 +384,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) { ** The arguments are on the stack, right after the function. ** When returns, all the results are on the stack, starting at the original ** function position. -*/ +*/ void luaD_call (lua_State *L, StkId func, int nResults) { if (++L->nCcalls >= LUAI_MAXCCALLS) { if (L->nCcalls == LUAI_MAXCCALLS) diff --git a/engines/sword25/util/lua/lgc.cpp b/engines/sword25/util/lua/lgc.cpp index 52ff72bdc9..71e581ad30 100644 --- a/engines/sword25/util/lua/lgc.cpp +++ b/engines/sword25/util/lua/lgc.cpp @@ -310,7 +310,7 @@ static l_mem propagatemark (global_State *g) { traverseproto(g, p); return sizeof(Proto) + sizeof(Instruction) * p->sizecode + sizeof(Proto *) * p->sizep + - sizeof(TValue) * p->sizek + + sizeof(TValue) * p->sizek + sizeof(int) * p->sizelineinfo + sizeof(LocVar) * p->sizelocvars + sizeof(TString *) * p->sizeupvalues; @@ -697,7 +697,7 @@ void luaC_linkupval (lua_State *L, UpVal *uv) { GCObject *o = obj2gco(uv); o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ g->rootgc = o; - if (isgray(o)) { + if (isgray(o)) { if (g->gcstate == GCSpropagate) { gray2black(o); /* closed upvalues need barrier */ luaC_barrier(L, uv, uv->v); diff --git a/engines/sword25/util/lua/liolib.cpp b/engines/sword25/util/lua/liolib.cpp index b505d1e4df..6c00de5094 100644 --- a/engines/sword25/util/lua/liolib.cpp +++ b/engines/sword25/util/lua/liolib.cpp @@ -228,7 +228,7 @@ static int g_iofile (lua_State *L, int f, const char *mode) { } lua_rawseti(L, LUA_ENVIRONINDEX, f); } - // return current value + // return current value lua_rawgeti(L, LUA_ENVIRONINDEX, f); return 1; } @@ -315,7 +315,7 @@ static int read_line (lua_State *L, Sword25::Sword25FileProxy *f) { for (;;) { size_t l; char *p = luaL_prepbuffer(&b); - if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { // eof? + if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { // eof? luaL_pushresult(&b); // close buffer return (lua_objlen(L, -1) > 0); // check whether read something } @@ -332,19 +332,19 @@ static int read_line (lua_State *L, Sword25::Sword25FileProxy *f) { static int read_chars (lua_State *L, Sword25::Sword25FileProxy *f, size_t n) { - size_t rlen; // how much to read - size_t nr; // number of chars actually read + size_t rlen; // how much to read + size_t nr; // number of chars actually read luaL_Buffer b; luaL_buffinit(L, &b); - rlen = LUAL_BUFFERSIZE; // try to read that much each time + rlen = LUAL_BUFFERSIZE; // try to read that much each time do { char *p = luaL_prepbuffer(&b); - if (rlen > n) rlen = n; // cannot read more than asked + if (rlen > n) rlen = n; // cannot read more than asked nr = fread(p, sizeof(char), rlen, f); luaL_addsize(&b, nr); - n -= nr; // still have to read `n' chars - } while (n > 0 && nr == rlen); // until end of count or eof - luaL_pushresult(&b); // close buffer + n -= nr; // still have to read `n' chars + } while (n > 0 && nr == rlen); // until end of count or eof + luaL_pushresult(&b); // close buffer return (n == 0 || lua_objlen(L, -1) > 0); } @@ -354,11 +354,11 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) { int success; int n; clearerr(f); - if (nargs == 0) { // no arguments? + if (nargs == 0) { // no arguments? success = read_line(L, f); - n = first+1; // to return 1 result + n = first+1; // to return 1 result } - else { // ensure stack space for all results and for auxlib's buffer + else { // ensure stack space for all results and for auxlib's buffer luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); success = 1; for (n = first; nargs-- && success; n++) { @@ -370,15 +370,15 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) { const char *p = lua_tostring(L, n); luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); switch (p[1]) { - case 'n': // number + case 'n': // number success = read_number(L, f); break; - case 'l': // line + case 'l': // line success = read_line(L, f); break; - case 'a': // file - read_chars(L, f, ~((size_t)0)); // read MAX_SIZE_T chars - success = 1; // always success + case 'a': // file + read_chars(L, f, ~((size_t)0)); // read MAX_SIZE_T chars + success = 1; // always success break; default: return luaL_argerror(L, n, "invalid format"); @@ -389,8 +389,8 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) { if (ferror(f)) return pushresult(L, 0, NULL); if (!success) { - lua_pop(L, 1); // remove last result - lua_pushnil(L); // push nil instead + lua_pop(L, 1); // remove last result + lua_pushnil(L); // push nil instead } return n - first; } @@ -419,8 +419,8 @@ static int io_readline (lua_State *L) { if (ferror(f)) return luaL_error(L, "%s", "LUA I/O error descriptions have been removed in ScummVM"); if (sucess) return 1; - else { // EOF - if (lua_toboolean(L, lua_upvalueindex(2))) { // generator created file? + else { // EOF + if (lua_toboolean(L, lua_upvalueindex(2))) { // generator created file? lua_settop(L, 0); lua_pushvalue(L, lua_upvalueindex(1)); aux_close(L); // close it diff --git a/engines/sword25/util/lua/llimits.h b/engines/sword25/util/lua/llimits.h index a31ad160ad..0925231350 100644 --- a/engines/sword25/util/lua/llimits.h +++ b/engines/sword25/util/lua/llimits.h @@ -107,7 +107,7 @@ typedef lu_int32 Instruction; #ifndef lua_lock -#define lua_lock(L) ((void) 0) +#define lua_lock(L) ((void) 0) #define lua_unlock(L) ((void) 0) #endif @@ -118,7 +118,7 @@ typedef lu_int32 Instruction; /* ** macro to control inclusion of some hard tests on stack reallocation -*/ +*/ #ifndef HARDSTACKTESTS #define condhardstacktests(x) ((void)0) #else diff --git a/engines/sword25/util/lua/loadlib.cpp b/engines/sword25/util/lua/loadlib.cpp index 9795a575f5..f4cdd70a78 100644 --- a/engines/sword25/util/lua/loadlib.cpp +++ b/engines/sword25/util/lua/loadlib.cpp @@ -182,7 +182,7 @@ static int ll_require (lua_State *L) { ** 'module' function ** ======================================================= */ - + static void setfenv (lua_State *L) { lua_Debug ar; @@ -298,7 +298,7 @@ LUALIB_API int luaopen_package (lua_State *L) { lua_setfield(L, -2, "__gc"); /* create `package' table */ luaL_register(L, LUA_LOADLIBNAME, pk_funcs); -#if defined(LUA_COMPAT_LOADLIB) +#if defined(LUA_COMPAT_LOADLIB) lua_getfield(L, -1, "loadlib"); lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); #endif diff --git a/engines/sword25/util/lua/lobject.h b/engines/sword25/util/lua/lobject.h index 35aaed028a..5418a918b1 100644 --- a/engines/sword25/util/lua/lobject.h +++ b/engines/sword25/util/lua/lobject.h @@ -337,7 +337,7 @@ typedef struct Node { typedef struct Table { CommonHeader; - lu_byte flags; /* 1<

C) then pc++ */ -OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ +OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ +OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ @@ -197,8 +197,8 @@ OP_FORLOOP,/* A sBx R(A)+=R(A+2); if R(A) =) R(A)*/ @@ -240,7 +240,7 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ ** bits 4-5: B arg mode ** bit 6: instruction set register A ** bit 7: operator is a test -*/ +*/ enum OpArgMask { OpArgN, /* argument is not used */ diff --git a/engines/sword25/util/lua/lstate.cpp b/engines/sword25/util/lua/lstate.cpp index 495d75c8a6..e542bcbacc 100644 --- a/engines/sword25/util/lua/lstate.cpp +++ b/engines/sword25/util/lua/lstate.cpp @@ -36,7 +36,7 @@ typedef struct LG { lua_State l; global_State g; } LG; - + static void stack_init (lua_State *L1, lua_State *L) { diff --git a/engines/sword25/util/lua/lstrlib.cpp b/engines/sword25/util/lua/lstrlib.cpp index e5501b9b49..2a1b8690e2 100644 --- a/engines/sword25/util/lua/lstrlib.cpp +++ b/engines/sword25/util/lua/lstrlib.cpp @@ -635,7 +635,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, lua_pushlstring(L, s, e - s); /* keep original text */ } else if (!lua_isstring(L, -1)) - luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); + luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); luaL_addvalue(b); /* add result to accumulator */ } diff --git a/engines/sword25/util/lua/ltable.cpp b/engines/sword25/util/lua/ltable.cpp index b2ec0e912a..45381fe673 100644 --- a/engines/sword25/util/lua/ltable.cpp +++ b/engines/sword25/util/lua/ltable.cpp @@ -48,7 +48,7 @@ #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) - + #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) #define hashboolean(t,p) hashpow2(t, p) @@ -303,7 +303,7 @@ static void resize (lua_State *L, Table *t, int nasize, int nhsize) { if (nasize > oldasize) /* array part must grow? */ setarrayvector(L, t, nasize); /* create new hash part with appropriate size */ - setnodevector(L, t, nhsize); + setnodevector(L, t, nhsize); if (nasize < oldasize) { /* array part must shrink? */ t->sizearray = nasize; /* re-insert elements from vanishing slice */ @@ -392,11 +392,11 @@ static Node *getfreepos (Table *t) { /* -** inserts a new key into a hash table; first, check whether key's main -** position is free. If not, check whether colliding node is in its main -** position or not: if it is not, move colliding node to an empty place and -** put new key in its main position; otherwise (colliding node is in its main -** position), new key goes to an empty position. +** inserts a new key into a hash table; first, check whether key's main +** position is free. If not, check whether colliding node is in its main +** position or not: if it is not, move colliding node to an empty place and +** put new key in its main position; otherwise (colliding node is in its main +** position), new key goes to an empty position. */ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { Node *mp = mainposition(t, key); diff --git a/engines/sword25/util/lua/lua.h b/engines/sword25/util/lua/lua.h index 417cdadf8b..08ad80d70f 100644 --- a/engines/sword25/util/lua/lua.h +++ b/engines/sword25/util/lua/lua.h @@ -247,7 +247,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); -/* +/* ** =============================================================== ** some useful macros ** =============================================================== diff --git a/engines/sword25/util/lua/lualib.h b/engines/sword25/util/lua/lualib.h index 33d4e314c2..830f6a0894 100644 --- a/engines/sword25/util/lua/lualib.h +++ b/engines/sword25/util/lua/lualib.h @@ -41,7 +41,7 @@ LUALIB_API int (luaopen_package) (lua_State *L); /* open all previous libraries */ -LUALIB_API void (luaL_openlibs) (lua_State *L); +LUALIB_API void (luaL_openlibs) (lua_State *L); diff --git a/engines/sword25/util/lua/lvm.cpp b/engines/sword25/util/lua/lvm.cpp index fb700c20a2..d0f2198651 100644 --- a/engines/sword25/util/lua/lvm.cpp +++ b/engines/sword25/util/lua/lvm.cpp @@ -125,7 +125,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { callTMres(L, val, tm, t, key); return; } - t = tm; /* else repeat with `tm' */ + t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in gettable"); } @@ -152,7 +152,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { callTM(L, tm, t, key, val); return; } - t = tm; /* else repeat with `tm' */ + t = tm; /* else repeat with `tm' */ } luaG_runerror(L, "loop in settable"); } diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp index 7667e19c6f..33053a71cb 100644 --- a/engines/sword25/util/lua/scummvm_file.cpp +++ b/engines/sword25/util/lua/scummvm_file.cpp @@ -98,14 +98,14 @@ size_t Sword25FileProxy::write(const char *ptr, size_t count) { // Legitimate data const char *p = strchr(ptr, '\n'); if (!p) p = ptr + strlen(ptr); - while ((*p == '\r') || (*p == '\n')) + while ((*p == '\r') || (*p == '\n')) ++p; _settings += Common::String(ptr, p - ptr); ptr = p; } - while ((*ptr == '\r') || (*ptr == '\n')) + while ((*ptr == '\r') || (*ptr == '\n')) ++ptr; } @@ -119,7 +119,7 @@ void Sword25FileProxy::writeSettings() { if ((*pSrc != '\r') && (*pSrc != '\n')) { const char *p = strchr(pSrc, '='); assert(p); - + // Get the setting name const char *pEnd = p - 1; while (*pEnd == ' ') @@ -132,10 +132,10 @@ void Sword25FileProxy::writeSettings() { ++pStart; pEnd = pStart + 1; - while ((*pEnd != '\r') && (*pEnd != '\n') && (*pEnd != '\0')) + while ((*pEnd != '\r') && (*pEnd != '\n') && (*pEnd != '\0')) ++pEnd; Common::String value(pStart + (*pStart == '"' ? 1 : 0), pEnd - pStart - (*pStart == '"' ? 2 : 0)); - + // Update the setting updateSetting(settingName, value); pSrc = pEnd; diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 8430f42c61..4951b2d940 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -58,7 +58,7 @@ Inventory::Inventory(TeenAgentEngine *engine) { for (byte i = 0; i < offsets; ++i) { _offset[i] = READ_LE_UINT16(_items + i * 2 + 1); } - _offset[92] = items_size; + _offset[92] = items_size; Resources *res = Resources::instance(); for (byte i = 0; i <= 92; ++i) { diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index 55c58a1c22..61e5364542 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -75,12 +75,12 @@ private: void backgroundEffect(Graphics::Surface *s); void render(Inventory *inventory, uint item_id, Graphics::Surface *surface, int delta); }; - + Item _graphics[24]; bool _active; Common::Point _mouse; - + bool tryObjectCallback(InventoryObject *obj); InventoryObject *_hoveredObj; diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index c2eb32dbd4..5c08a46489 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -44,9 +44,9 @@ public: //void loadOn(Graphics::Surface &surface, int id, uint16 &dst, uint16 *flags); //void loadOns(Graphics::Surface &surface, int id, uint16 &dst); - /* - * PSP (as the other sony playstation consoles - to be confirmed and 'ifdef'ed here too) - * is very sensitive to the number of simultaneously opened files. + /* + * PSP (as the other sony playstation consoles - to be confirmed and 'ifdef'ed here too) + * is very sensitive to the number of simultaneously opened files. * This is an attempt to reduce their number to zero. * TransientFilePack does not keep opened file descriptors and reopens it on each request. */ diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index ef18b95f5a..4be6c9c31a 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -576,7 +576,7 @@ void Scene::paletteEffect(byte step) { byte *src = res->dseg.ptr(0x6609); byte *dst = palette + 3 * 0xf2; for(byte i = 0; i < 0xd; ++i) { - for(byte c = 0; c < 3; ++c, ++src) + for(byte c = 0; c < 3; ++c, ++src) *dst++ = *src > step? *src - step: 0; } } @@ -812,9 +812,9 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) { _system->unlockScreen(); continue; } - //removed mark == null. In final scene of chapter 2 mark rendered above table. - //if it'd cause any bugs, add hack here. (_id != 23 && mark == NULL) - if (on_enabled && + //removed mark == null. In final scene of chapter 2 mark rendered above table. + //if it'd cause any bugs, add hack here. (_id != 23 && mark == NULL) + if (on_enabled && debug_features.feature[DebugFeatures::kShowOn]) { on.render(surface, actor_animation_position); } diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index ce8862ffd0..724f75be2f 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -206,7 +206,7 @@ void TeenAgentEngine::deinit() { Common::Error TeenAgentEngine::loadGameState(int slot) { debug(0, "loading from slot %d", slot); - Common::ScopedPtr + Common::ScopedPtr in(_saveFileMan->openForLoading(Common::String::format("teenagent.%02d", slot))); if (!in) in.reset(_saveFileMan->openForLoading(Common::String::format("teenagent.%d", slot))); @@ -963,10 +963,10 @@ void TeenAgentEngine::playSoundNow(byte id) { void TeenAgentEngine::setMusic(byte id) { debug(0, "starting music %u", id); Resources *res = Resources::instance(); - + if (id != 1) //intro music *res->dseg.ptr(0xDB90) = id; - + if (_gameDescription->flags & ADGF_CD) { byte track2cd[] = {7, 2, 0, 9, 3, 6, 8, 10, 4, 5, 11}; if (id == 0 || id > 11 || track2cd[id - 1] == 0) { diff --git a/engines/testbed/config-params.h b/engines/testbed/config-params.h index e982f62c72..6906d9248e 100644 --- a/engines/testbed/config-params.h +++ b/engines/testbed/config-params.h @@ -34,7 +34,7 @@ class ConfigParams : public Common::Singleton { private: friend class Common::Singleton; ConfigParams(); - + /** * Private variables related to log files. */ @@ -57,16 +57,16 @@ private: TestbedConfigManager *_testbedConfMan; public: - + bool isRerunRequired(); void setRerunFlag(bool flag) { _rerunTests = flag; } bool isSessionInteractive() { return _isInteractive; } void setSessionAsInteractive(bool status) { _isInteractive = status; } - + bool isGameDataFound() { return _isGameDataFound; } void setGameDataFound(bool status) { _isGameDataFound = status; } - + TestbedConfigManager *getTestbedConfigManager() { return _testbedConfMan; } void setTestbedConfigManager(TestbedConfigManager* confMan) { _testbedConfMan = confMan; } @@ -74,7 +74,7 @@ public: void setLogDirectory(const Common::String &dirname) { _logDirectory = dirname; } Common::String &getLogFilename() { return _logFilename; } void setLogFilename(const Common::String &filename) { _logFilename = filename; } - + Common::WriteStream *getLogWriteStream() { return _ws; } Graphics::FontManager::FontUsage getCurrentFontUsageType() { return _displayFont; } void setCurrentFontUsageType(Graphics::FontManager::FontUsage f) { _displayFont = f; } diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h index c86db9e438..116322aa89 100644 --- a/engines/tinsel/detection_tables.h +++ b/engines/tinsel/detection_tables.h @@ -119,7 +119,7 @@ static const TinselGameDescription gameDescriptions[] = { TINSEL_V1, }, - { + { { "dw", "Floppy", @@ -142,7 +142,7 @@ static const TinselGameDescription gameDescriptions[] = { TINSEL_V1, }, - { + { { "dw", "Floppy", @@ -165,7 +165,7 @@ static const TinselGameDescription gameDescriptions[] = { TINSEL_V1, }, - { + { { "dw", "Floppy", diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index 0834e7df24..2ab1e653d4 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -140,11 +140,11 @@ static const byte fragment7[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(908), OP_JUMP static const byte fragment8[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(910), OP_JUMP | OPSIZE16, FRAGMENT_WORD(644)}; static const byte fragment9[] = {OP_JUMP | OPSIZE8, 123}; static const byte fragment10[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(160), OP_JUMP | OPSIZE16, FRAGMENT_WORD(136)}; -static const byte fragment11[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1572), +static const byte fragment11[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1572), OP_ONE, OP_LIBCALL | OPSIZE8, 14, // Re-show the cursor OP_IMM | OPSIZE16, FRAGMENT_WORD(322), OP_LIBCALL | OPSIZE8, 46, // Give back the whistle OP_JUMP | OPSIZE16, FRAGMENT_WORD(1661)}; -static const byte fragment12[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1491), +static const byte fragment12[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1491), OP_ONE, OP_LIBCALL | OPSIZE8, 14, // Re-show the cursor OP_IMM | OPSIZE16, FRAGMENT_WORD(322), OP_LIBCALL | OPSIZE8, 46, // Give back the whistle OP_JUMP | OPSIZE16, FRAGMENT_WORD(1568)}; @@ -208,10 +208,10 @@ const WorkaroundEntry workaroundList[] = { // See bug report #2934211. {TINSEL_V1, true, 352601285, 1569, sizeof(fragment11), fragment11}, {TINSEL_V1, false, 352602304, 1488, sizeof(fragment12), fragment12}, - + // DW2: Corrects a bug with global 306 not being cleared if you leave // the marketplace scene whilst D'Blah is talking (even if it's not - // actually audible); returning to the scene and clicking on him multiple + // actually audible); returning to the scene and clicking on him multiple // times would cause the game to crash {TINSEL_V2, true, 1109294728, 0, sizeof(fragment13), fragment13}, diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 1244168a21..7a973ba4be 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -483,7 +483,7 @@ static void DoSave() { NeedLoad = true; if (SaveSceneName == NULL) { - // Generate a new unique save name + // Generate a new unique save name int i; int ano = 1; // Allocated number diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 7613c1a897..7fbec69cbf 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -214,39 +214,39 @@ static const MASTER_LIB_CODES DW1_CODES[] = { }; static const MASTER_LIB_CODES DW2DEMO_CODES[] = { - ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY, + ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY, ACTORREF, ACTORRGB, ACTORSCALE, ACTORXPOS, ACTORYPOS, ADDHIGHLIGHT, ADDINV, ADDINV1, ADDINV2, ADDOPENINV, ADDTOPIC, - BACKGROUND, CALLACTOR, CALLGLOBALPROCESS, CALLOBJECT, + BACKGROUND, CALLACTOR, CALLGLOBALPROCESS, CALLOBJECT, CALLPROCESS, CALLSCENE, CALLTAG, CAMERA, CDCHANGESCENE, CDDOCHANGE, CDLOAD, CDPLAY, CLEARHOOKSCENE, CLOSEINVENTORY, - CONTROL, CONVERSATION, CURSOR, CURSORXPOS, CURSORYPOS, - DECCONVW, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW, + CONTROL, CONVERSATION, CURSOR, CURSORXPOS, CURSORYPOS, + DECCONVW, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW, DECLEAD, DECSCALE, DECTAGFONT, DECTALKFONT, DELTOPIC, DIMMUSIC, DROP, DROPOUT, EFFECTACTOR, ENABLEMENU, ENDACTOR, - ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEOUT, FRAMEGRAB, - FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, HASRESTARTED, - HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH, + ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEOUT, FRAMEGRAB, + FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, HASRESTARTED, + HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH, HIDEREFER, HIDETAG, HOLD, HOOKSCENE, IDLETIME, INSTANTSCROLL, - INVENTORY, INVPLAY, INWHICHINV, KILLACTOR, KILLGLOBALPROCESS, - KILLPROCESS, LOCALVAR, MOVECURSOR, MOVETAG, MOVETAGTO, NEWSCENE, - NOBLOCKING, NOPAUSE, NOSCROLL, OFFSET, OTHEROBJECT, PAUSE, PLAY, - PLAYMUSIC, PLAYRTF, PLAYSAMPLE, POINTACTOR, POINTTAG, POSTACTOR, + INVENTORY, INVPLAY, INWHICHINV, KILLACTOR, KILLGLOBALPROCESS, + KILLPROCESS, LOCALVAR, MOVECURSOR, MOVETAG, MOVETAGTO, NEWSCENE, + NOBLOCKING, NOPAUSE, NOSCROLL, OFFSET, OTHEROBJECT, PAUSE, PLAY, + PLAYMUSIC, PLAYRTF, PLAYSAMPLE, POINTACTOR, POINTTAG, POSTACTOR, POSTGLOBALPROCESS, POSTOBJECT, POSTPROCESS, POSTTAG, PRINT, PRINTCURSOR, PRINTOBJ, PRINTTAG, QUITGAME, RANDOM, RESETIDLETIME, - RESTARTGAME, RESTORESCENE, RUNMODE, SAVESCENE, SAY, SAYAT, - SCALINGREELS, SCREENXPOS, SCREENYPOS, SCROLL, SCROLLPARAMETERS, + RESTARTGAME, RESTORESCENE, RUNMODE, SAVESCENE, SAY, SAYAT, + SCALINGREELS, SCREENXPOS, SCREENYPOS, SCROLL, SCROLLPARAMETERS, SENDACTOR, SENDGLOBALPROCESS, SENDOBJECT, SENDPROCESS, SENDTAG, - SETBRIGHTNESS, SETINVLIMIT, SETINVSIZE, SETLANGUAGE, SETPALETTE, - SETSYSTEMSTRING, SETSYSTEMVAR, SHELL, SHOWACTOR, SHOWBLOCK, + SETBRIGHTNESS, SETINVLIMIT, SETINVSIZE, SETLANGUAGE, SETPALETTE, + SETSYSTEMSTRING, SETSYSTEMVAR, SHELL, SHOWACTOR, SHOWBLOCK, SHOWEFFECT, SHOWPATH, SHOWREFER, SHOWTAG, STAND, STANDTAG, - STARTGLOBALPROCESS, STARTPROCESS, STARTTIMER, STOPWALK, SUBTITLES, - SWALK, SYSTEMVAR, TAGTAGXPOS, TAGTAGYPOS, TAGWALKXPOS, TAGWALKYPOS, + STARTGLOBALPROCESS, STARTPROCESS, STARTTIMER, STOPWALK, SUBTITLES, + SWALK, SYSTEMVAR, TAGTAGXPOS, TAGTAGYPOS, TAGWALKXPOS, TAGWALKYPOS, TALK, TALKAT, TALKPALETTEINDEX, TALKRGB, TALKVIA, THISOBJECT, - THISTAG, TIMER, TOPIC, TOPPLAY, TOPWINDOW, TRANSLUCENTINDEX, - UNDIMMUSIC, UNHOOKSCENE, WAITFRAME, WAITKEY, WAITSCROLL, WAITTIME, - WALK, WALKED, WALKEDPOLY, WALKEDTAG, WALKINGACTOR, WALKPOLY, - WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY, + THISTAG, TIMER, TOPIC, TOPPLAY, TOPWINDOW, TRANSLUCENTINDEX, + UNDIMMUSIC, UNHOOKSCENE, WAITFRAME, WAITKEY, WAITSCROLL, WAITTIME, + WALK, WALKED, WALKEDPOLY, WALKEDTAG, WALKINGACTOR, WALKPOLY, + WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY, HIGHEST_LIBCODE }; diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index c116d63663..dde7be07d0 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -406,8 +406,8 @@ void PathFinding::init(Picture *mask) { _height = mask->getHeight(); _currentMask = mask; _heap->unload(); - // In order to reduce memory fragmentation on small devices, we use the maximum - // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is + // In order to reduce memory fragmentation on small devices, we use the maximum + // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is // 1280 as opposed to the possible 640, it actually helps memory allocation on // those devices. _heap->init(TOON_BACKBUFFER_WIDTH * _height); // should really be _width diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp index c9aa470deb..c2ee8acf8a 100644 --- a/engines/toon/tools.cpp +++ b/engines/toon/tools.cpp @@ -372,7 +372,7 @@ int32 RncDecoder::unpackM1(const void *input, uint16 inputSize, void *output) { _dstPtr += inputLength; _srcPtr += inputLength; _inputByteLeft -= inputLength; - uint16 a; + uint16 a; if (_inputByteLeft <= 0) a = 0; else if (_inputByteLeft == 1) diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 0e0978b3d6..cb41db1967 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -114,7 +114,7 @@ void ToonEngine::init() { _drew = _characters[0]; _flux = _characters[1]; - + // preload walk anim for flux and drew _drew->loadWalkAnimation("STNDWALK.CAF"); diff --git a/engines/toon/toon.h b/engines/toon/toon.h index 65c6ba0234..cad684d590 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -204,7 +204,7 @@ public: void viewInventoryItem(Common::String str, int32 lineId, int32 itemDest); void storePalette(); void restorePalette(); - const char *getSpecialConversationMusic(int32 locationId); + const char *getSpecialConversationMusic(int32 locationId); void playRoomMusic(); void waitForScriptStep(); void doMagnifierEffect(); @@ -320,7 +320,7 @@ public: } Common::Error saveGameState(int slot, const Common::String &desc) { - + return (saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError); } @@ -381,7 +381,7 @@ protected: Common::Array _oldDirtyRects; bool _dirtyAll; - + AnimationInstance *_cursorAnimationInstance; Animation *_cursorAnimation; diff --git a/engines/tsage/blueforce_logic.cpp b/engines/tsage/blueforce_logic.cpp index 9813bef6f7..d266d5e1d9 100644 --- a/engines/tsage/blueforce_logic.cpp +++ b/engines/tsage/blueforce_logic.cpp @@ -30,7 +30,7 @@ namespace tSage { void BlueForceGame::start() { // Start the game _globals->_sceneManager.changeScene(20); - + _globals->_events.setCursor(CURSOR_WALK); } diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 5288c98b72..9277fd429a 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -63,7 +63,7 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) { if (argc < 2) { DebugPrintf("Usage: %s [prior scene #]\n", argv[0]); return true; - } + } if (argc == 3) _globals->_sceneManager._sceneNumber = strToInt(argv[2]); @@ -222,7 +222,7 @@ bool Debugger::Cmd_ListObjects(int argc, const char **argv) { DebugPrintf("Usage: %s\n", argv[0]); return true; } - + DebugPrintf("Available objects for this game are:\n"); DebugPrintf("0 - Stunner\n"); DebugPrintf("1 - Scanner\n"); @@ -393,7 +393,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { // Lock the background surface for access Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); - + // Iterate through the scene items SynchronizedList::iterator i; for (i = _globals->_sceneItems.reverse_begin(); i != _globals->_sceneItems.end(); --i, ++colIndex) { @@ -418,7 +418,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { LineSliceSet set = r.getLineSlices(y); for (uint p = 0; p < set.items.size(); ++p) - destSurface.hLine(set.items[p].xs - sceneBounds.left, y - sceneBounds.top, + destSurface.hLine(set.items[p].xs - sceneBounds.left, y - sceneBounds.top, set.items[p].xe - sceneBounds.left - 1, colIndex); } } diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index c1bd1d027f..86fbbc8e43 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -43,7 +43,7 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String const Common::String &btn2Message) : GfxDialog() { // Set up the message addElements(&_msg, &_btn1, NULL); - + _msg.set(message, 200, ALIGN_LEFT); _msg._bounds.moveTo(0, 0); _defaultButton = &_btn1; diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index 50077fecaf..94c074a50b 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -282,7 +282,7 @@ void EventsClass::hideCursor() { setCursor(CURSOR_NONE); } -bool EventsClass::isCursorVisible() const { +bool EventsClass::isCursorVisible() const { return !_globals->getFlag(122); } @@ -312,7 +312,7 @@ void EventsClass::delay(int numFrames) { void EventsClass::listenerSynchronize(Serializer &s) { s.syncAsUint32LE(_frameNumber); s.syncAsUint32LE(_prevDelayFrame); - + if (s.getVersion() >= 5) { s.syncAsSint16LE(_currentCursor); s.syncAsSint16LE(_lastCursor); diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index b0f6db53c6..e54f1073b0 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -140,7 +140,7 @@ void Globals::synchronize(Serializer &s) { s.syncAsSint32LE(_gfxColors.foreground); s.syncAsSint32LE(_fontColors.background); s.syncAsSint32LE(_fontColors.foreground); - + if (s.getVersion() >= 4) { s.syncAsByte(_unkColor1); s.syncAsByte(_unkColor2); diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 25dc897ecd..23f5f22573 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -846,7 +846,7 @@ void GfxButton::setDefaults() { gfxManager._font.getStringBounds(_message.c_str(), tempRect, 240); tempRect.right = ((tempRect.right + 15) / 16) * 16; - // Set the button bounds + // Set the button bounds tempRect.collapse(-_globals->_gfxEdgeAdjust, -_globals->_gfxEdgeAdjust); if (_vm->getFeatures() & GF_CD) --tempRect.top; @@ -866,7 +866,7 @@ void GfxButton::draw() { // Set the font and color gfxManager._font.setFontNumber(_fontNumber); - // + // gfxManager._font._colors.foreground = this->_unkColor1; gfxManager._font._colors2.background = this->_unkColor2; gfxManager._font._colors2.foreground = this->_unkColor3; diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index 4f905d5bec..fa7511808f 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -30,7 +30,7 @@ namespace tSage { void RingworldDemoGame::start() { // Start the demo's single scene _globals->_sceneManager.changeScene(1); - + _globals->_events.setCursor(CURSOR_NONE); } @@ -108,12 +108,12 @@ void RingworldDemoScene::signal() { _actor4.postInit(); _actor5.postInit(); _actor6.postInit(); - + setAction(&_sequenceManager, this, 22, &_actor1, &_actor2, &_actor3, &_actor4, &_actor5, &_actor6, NULL); } void RingworldDemoScene::process(Event &event) { - + } } // End of namespace tSage diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 4c60e5fea9..2b5b84ab64 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -268,7 +268,7 @@ void SceneArea::setup(int resNum, int rlbNum, int subNum, int actionId) { } void SceneArea::draw2() { - _surface.draw(Common::Point(_bounds.left, _bounds.top)); + _surface.draw(Common::Point(_bounds.left, _bounds.top)); } void SceneArea::display() { @@ -619,7 +619,7 @@ void SpeakerSKL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(203, 120)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(7013); _object2.setStrip2(1); @@ -651,7 +651,7 @@ void SpeakerQL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(128, 146)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2612); _object2.setStrip2(1); @@ -684,7 +684,7 @@ void SpeakerSR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(224, 198)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2813); _object2.setStrip2(1); @@ -725,7 +725,7 @@ void SpeakerSL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(95, 198)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2812); _object2.setStrip2(1); @@ -757,7 +757,7 @@ void SpeakerQR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(191, 146)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2613); _object2.setStrip2(1); @@ -789,7 +789,7 @@ void SpeakerQU::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(116, 120)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(7021); _object2.setStrip2(1); @@ -818,7 +818,7 @@ void SpeakerCR::setText(const Common::String &msg) { _object1.fixPriority(255); _object1.setPosition(Common::Point(219, 168)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(9011); _object2.setStrip2(1); @@ -847,7 +847,7 @@ void SpeakerMR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(220, 143)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2713); _object2.setStrip2(1); @@ -879,7 +879,7 @@ void SpeakerSAL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(185, 200)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2853); _object2.setStrip2(1); @@ -910,7 +910,7 @@ void SpeakerML::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(99, 143)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(2712); _object2.setStrip2(1); @@ -941,7 +941,7 @@ void SpeakerCHFL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(205, 116)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4113); _object2.setStrip2(1); @@ -972,7 +972,7 @@ void SpeakerCHFR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(103, 116)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4112); _object2.setStrip2(1); @@ -1003,7 +1003,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(107, 117)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4062); _object2.setStrip2(1); @@ -1048,7 +1048,7 @@ void SpeakerPR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(212, 117)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4063); _object2.setStrip2(2); @@ -1093,7 +1093,7 @@ void SpeakerCDR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(208, 97)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4163); _object2.setStrip2(2); @@ -1124,7 +1124,7 @@ void SpeakerCDL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(112, 97)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(4162); _object2.setStrip2(2); @@ -1155,7 +1155,7 @@ void SpeakerFLL::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(216, 129)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(5223); _object2.setStrip2(1); @@ -1186,7 +1186,7 @@ void SpeakerBatR::setText(const Common::String &msg) { _object1._frame = 1; _object1.setPosition(Common::Point(137, 122)); _object1.animate(ANIM_MODE_7, 0, NULL); - + _object2.postInit(&_objectList); _object2.setVisage(5361); _object2.setStrip2(1); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index 9f8aedbfc1..717841d4fc 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -2890,7 +2890,7 @@ void Scene6100::Action3::signal() { scene->_sunflower3.hide(); scene->_rocks.hide(); scene->_sceneText.hide(); - + _globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(8120, this); break; diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h index 712a16c612..283cf68e07 100644 --- a/engines/tsage/ringworld_scenes1.h +++ b/engines/tsage/ringworld_scenes1.h @@ -272,7 +272,7 @@ class Scene50 : public Scene { public: virtual void signal(); }; - + /* Objects */ class Object1 : public SceneObject { public: @@ -312,7 +312,7 @@ public: virtual void dispatch(); }; -class Scene60 : public Scene { +class Scene60 : public Scene { class Action1 : public Action { public: virtual void signal(); diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 5d2732d36c..824a96a18b 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -1962,7 +1962,7 @@ void Scene2100::signal() { void Scene2100::synchronize(Serializer &s) { Scene::synchronize(s); if (s.getVersion() >= 3) - s.syncAsSint16LE(_sitFl); + s.syncAsSint16LE(_sitFl); } /*-------------------------------------------------------------------------- diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index c884f9f6e4..fccc7e1b50 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -1921,7 +1921,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _miranda.setStrip(3); _miranda.setFrame(2); _miranda.changeZoom(-1); - + _miranda.setPosition(Common::Point(66, 209)); _globals->_sceneItems.push_back(&_miranda); } @@ -4268,7 +4268,7 @@ void Scene4301::Action1::signal() { _actionIndex = 2; break; case 10: - // Puzzle: Wrong code + // Puzzle: Wrong code _globals->_events.setCursor(CURSOR_NONE); scene->_soundHandler.play(337); if (scene->_hotspot3._flags & OBJFLAG_HIDE) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 1288ba9367..0c0d93be03 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -205,7 +205,7 @@ void SoundManager::installDriver(int driverNum) { // Unmute currently active sounds for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) (*i)->mute(false); - + enableSoundServer(); } break; @@ -239,14 +239,14 @@ void SoundManager::unInstallDriver(int driverNum) { // Uninstall the driver _sfUnInstallDriver(*i); - // Re-orient all the loaded sounds + // Re-orient all the loaded sounds for (j = _soundList.begin(); j != _soundList.end(); ++j) (*j)->orientAfterDriverChange(); // Unmute currently active sounds for (j = _playList.begin(); j != _playList.end(); ++j) (*j)->mute(false); - + enableSoundServer(); } } @@ -361,7 +361,7 @@ void SoundManager::_sfSoundServer() { } while (sfManager()._serverSuspendedCount > 0); // Poll all sound drivers in case they need it - for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); i != sfManager()._installedDrivers.end(); ++i) { (*i)->poll(); } @@ -479,7 +479,7 @@ void SoundManager::_sfUpdateVoiceStructs2() { vse._priority2 = vse._priority; } } - } + } } /*--------------------------------------------------------------------------*/ @@ -532,7 +532,7 @@ void SoundManager::_sfAddToPlayList(Sound *sound) { _sfRethinkVoiceTypes(); --sfManager()._serverSuspendedCount; } - + void SoundManager::_sfRemoveFromPlayList(Sound *sound) { ++sfManager()._serverSuspendedCount; if (_sfDoRemoveFromPlayList(sound)) @@ -541,7 +541,7 @@ void SoundManager::_sfRemoveFromPlayList(Sound *sound) { } bool SoundManager::_sfIsOnPlayList(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + ++_soundManager->_serverSuspendedCount; bool result = contains(_soundManager->_playList, sound); --_soundManager->_serverSuspendedCount; @@ -619,7 +619,7 @@ void SoundManager::_sfRethinkSoundDrivers() { while (*groupData != 0xff) { byte byteVal = *groupData++; - + if (byteVal == idx) { ++groupData; @@ -666,7 +666,7 @@ void SoundManager::_sfRethinkSoundDrivers() { } } } - } + } } } } @@ -764,7 +764,7 @@ void SoundManager::_sfRethinkVoiceTypes() { if (vtStruct->_voiceType != VOICETYPE_0) { // Type 1 int numVoices = vtStruct->_numVoices; - + if (numVoices >= chNumVoices) { int channelCount = chNumVoices, idx = 0; while (channelCount > 0) { @@ -821,7 +821,7 @@ void SoundManager::_sfRethinkVoiceTypes() { // Type 0 if (sound->_isEmpty) { uint idx = 0; - while ((idx < vtStruct->_entries.size()) && + while ((idx < vtStruct->_entries.size()) && (vtStruct->_entries[idx]._voiceNum == foundIndex)) ++idx; if (idx == vtStruct->_entries.size()) @@ -832,7 +832,7 @@ void SoundManager::_sfRethinkVoiceTypes() { if (flagsVal != 1) { // All modes except mode 1 (loc_23EDF) int entryIndex = -1, maxVoiceNum = 0; - + for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (!vtStruct->_entries[idx]._type0._sound2 && (vtStruct->_entries[idx]._field1 != 0) && (vtStruct->_entries[idx]._voiceNum > maxVoiceNum)) { @@ -848,7 +848,7 @@ void SoundManager::_sfRethinkVoiceTypes() { vtStruct->_entries[entryIndex]._type0._field12 = 0; continue; } - + if (foundPriority != 0) continue; @@ -874,7 +874,7 @@ void SoundManager::_sfRethinkVoiceTypes() { break; } else { // Channel mode 1 handling (loc_23FAC) - + bool foundMatch = false; int entryIndex = -1; for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { @@ -894,14 +894,14 @@ void SoundManager::_sfRethinkVoiceTypes() { vtStruct->_entries[entryIndex]._type0._field12 = 0; continue; } - + if (!foundMatch) { if (foundPriority) continue; if (entryIndex == -1) { _sfUpdateVoiceStructs2(); break; - } + } } // Find the entry with the highest priority @@ -921,7 +921,7 @@ void SoundManager::_sfRethinkVoiceTypes() { entryIndex = -1; } } - + if (!foundMatch) { if (foundPriority) continue; @@ -966,12 +966,12 @@ void SoundManager::_sfRethinkVoiceTypes() { vteDest._sound2 = vteSrc._sound2; vteDest._channelNum2 = vteSrc._channelNum2; vteDest._priority2 = vteSrc._priority2; - + vteSrc._sound2 = sound; vteSrc._channelNum2 = foundIndex; vteSrc._priority2 = foundPriority; vteSrc._field12 = 1; - continue; + continue; } if (!foundPriority) @@ -1031,7 +1031,7 @@ void SoundManager::_sfRethinkVoiceTypes() { if (total) { driver->proc24(vse._channelNum, idx, vse._sound, 123, 0); driver->proc24(vse._channelNum, idx, vse._sound, 1, vse._sound->_chModulation[vse._channelNum]); - driver->proc24(vse._channelNum, idx, vse._sound, 7, + driver->proc24(vse._channelNum, idx, vse._sound, 7, vse._sound->_chVolume[vse._channelNum] * vse._sound->_volume / 127); driver->proc24(vse._channelNum, idx, vse._sound, 10, vse._sound->_chPan[vse._channelNum]); driver->proc24(vse._channelNum, idx, vse._sound, 64, vse._sound->_chDamper[vse._channelNum]); @@ -1105,7 +1105,7 @@ void SoundManager::_sfRethinkVoiceTypes() { 1, vseFound._sound->_chModulation[vseFound._channelNum]); driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, 7, vseFound._sound->_chVolume[vseFound._channelNum] * vseFound._sound->_volume / 127); - driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, + driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, 10, vseFound._sound->_chPan[vseFound._channelNum]); driver->setProgram(vseFound._channelNum, vseFound._sound->_chProgram[vseFound._channelNum]); driver->setPitchBlend(vseFound._channelNum, vseFound._sound->_chPitchBlend[vseFound._channelNum]); @@ -1175,7 +1175,7 @@ void SoundManager::_sfRethinkVoiceTypes() { driver->updateVoice(vs->_entries[idx2]._voiceNum); driver->proc38(vs->_entries[idx2]._voiceNum, 1, vse2._sound->_chModulation[vse2._channelNum]); - driver->proc38(vs->_entries[idx2]._voiceNum, 7, + driver->proc38(vs->_entries[idx2]._voiceNum, 7, vse2._sound->_chVolume[vse2._channelNum] * vse2._sound->_volume / 127); driver->proc38(vs->_entries[idx2]._voiceNum, 10, vse2._sound->_chPan[vse2._channelNum]); driver->setPitch(vs->_entries[idx2]._voiceNum, vse2._sound->_chPitchBlend[vse2._channelNum]); @@ -1206,13 +1206,13 @@ void SoundManager::_sfUpdateVolume(Sound *sound) { } void SoundManager::_sfDereferenceAll() { - // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed + // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed // pointer lists based on the handles. Since in ScummVM we're just using pointers directly, this // method doesn't need any implementation } void SoundManager::_sfUpdatePriority(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + ++_soundManager->_serverSuspendedCount; int tempPriority = (sound->_fixedPriority == 255) ? sound->_sndResPriority : sound->_priority; if (sound->_priority != tempPriority) { @@ -1240,7 +1240,7 @@ void SoundManager::_sfSetMasterVol(int volume) { if (volume != _soundManager->_masterVol) { _soundManager->_masterVol = volume; - for (Common::List::iterator i = _soundManager->_installedDrivers.begin(); + for (Common::List::iterator i = _soundManager->_installedDrivers.begin(); i != _soundManager->_installedDrivers.end(); ++i) { (*i)->setMasterVolume(volume); } @@ -1283,8 +1283,8 @@ void SoundManager::_sfTerminate() { void SoundManager::_sfExtractGroupMask() { uint32 mask = 0; - for (Common::List::iterator i = sfManager()._installedDrivers.begin(); - i != sfManager()._installedDrivers.end(); ++i) + for (Common::List::iterator i = sfManager()._installedDrivers.begin(); + i != sfManager()._installedDrivers.end(); ++i) mask |= (*i)->_groupMask; _soundManager->_groupsAvail = mask; @@ -1293,7 +1293,7 @@ void SoundManager::_sfExtractGroupMask() { bool SoundManager::_sfInstallDriver(SoundDriver *driver) { if (!driver->open()) return false; - + sfManager()._installedDrivers.push_back(driver); driver->_groupOffset = driver->getGroupData(); driver->_groupMask = READ_LE_UINT32(driver->_groupOffset); @@ -1345,13 +1345,13 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { break; } } - + --sfManager()._serverSuspendedCount; return result; } void SoundManager::_sfDoUpdateVolume(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + ++_soundManager->_serverSuspendedCount; for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; @@ -1375,7 +1375,7 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { } } } - + --_soundManager->_serverSuspendedCount; } @@ -1408,7 +1408,7 @@ Sound::Sound() { _isEmpty = false; _remoteReceiver = NULL; - + memset(_chProgram, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chModulation, 0, SOUND_ARR_SIZE * sizeof(int)); memset(_chVolume, 0, SOUND_ARR_SIZE * sizeof(int)); @@ -1519,7 +1519,7 @@ void Sound::orientAfterDriverChange() { for (int idx = 0; idx < _trackInfo._numTracks; ++idx) DEALLOCATE(_channelData[idx]); - + _trackInfo._numTracks = 0; _primed = false; _prime(_soundResID, true); @@ -1723,8 +1723,8 @@ bool Sound::_soServiceTracks() { if (_isEmpty) { _soRemoteReceive(); return false; - } - + } + bool flag = true; for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) { int mode = *_channelData[trackCtr]; @@ -1784,12 +1784,12 @@ void Sound::_soPrimeChannelData() { for (int idx = 0; idx < _trackInfo._numTracks; ++idx) { byte *d = _channelData[idx]; - int mode = *d; + int mode = *d; int channelNum = (int8)*(d + 1); _trkChannel[idx] = channelNum; assert((channelNum >= -1) && (channelNum < 16)); - + if (channelNum >= 0) { _chProgram[channelNum] = *(d + 10); _chModulation[channelNum] = 0; @@ -1841,7 +1841,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum]; int voiceNum = -1; SoundDriver *driver = NULL; - + VoiceTypeStruct *vtStruct; VoiceType voiceType = VOICETYPE_0, chVoiceType = VOICETYPE_0; @@ -1856,7 +1856,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { voiceType = vtStruct->_voiceType; if (voiceType == VOICETYPE_0) { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - if (!vtStruct->_entries[idx]._type0._sound && + if (!vtStruct->_entries[idx]._type0._sound && (vtStruct->_entries[idx]._type0._channelNum != channelNum)) { voiceNum = vtStruct->_entries[idx]._voiceNum; driver = vtStruct->_entries[idx]._driver; @@ -1870,7 +1870,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { const byte *pData = channelData + _trkIndex[trackIndex]; for (;;) { - byte v = *pData++; + byte v = *pData++; if (!(v & 0x80)) { // Area #1 if (!_soundManager->_soTimeIndexFlag) { @@ -1883,7 +1883,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { driver->proc18(voiceNum, chVoiceType); } } - } + } } else if (!(v & 0x40)) { // Area #2 if (!_soundManager->_soTimeIndexFlag) { @@ -1927,7 +1927,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } else if (!(v & 0x10)) { // Area #4 v = (v & 0xf) << 1; - + byte b = *pData++; if (b & 0x80) v |= 1; @@ -2023,7 +2023,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { } } } else { - _soSetTrackPos(trackIndex, pData - channelData, program); + _soSetTrackPos(trackIndex, pData - channelData, program); } } else { @@ -2173,7 +2173,7 @@ void Sound::_soDoTrackCommand(int channelNum, int command, int value) { bool Sound::_soDoUpdateTracks(int command, int value) { if ((command == 76) || (_hold != value)) return false; - + for (int trackIndex = 0; trackIndex < _trackInfo._numTracks; ++trackIndex) { _trkState[trackIndex] = _trkLoopState[trackIndex]; _trkRest[trackIndex] = _trkLoopRest[trackIndex]; @@ -2225,7 +2225,7 @@ void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) { vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1); vtStruct->_entries[entryIndex]._type1._field5 = 0; - driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, *(channelData + 1), 0x7f); + driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, *(channelData + 1), 0x7f); } } else { @@ -2310,7 +2310,7 @@ void ASound::dispatch() { void ASound::play(int soundNum, Action *action, int volume) { _action = action; _cueValue = 0; - + setVol(volume); _sound.play(soundNum); } @@ -2355,14 +2355,14 @@ const byte v440B0[9] = { 0, 1, 2, 6, 7, 8, 12, 13, 14 }; const byte v440B9[9] = { 3, 4, 5, 9, 10, 11, 15, 16, 17 }; -const byte v440C2[18] = { +const byte v440C2[18] = { 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21 }; const byte v44134[64] = { 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, + 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55, 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63 }; @@ -2526,7 +2526,7 @@ void AdlibSoundDriver::updateChannelVolume(int channelNum) { int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] : 63 - v44134[volume * _v44070[channelNum] / 63]; - int portNum = v440C2[v440B0[channelNum]] + 0x40; + int portNum = v440C2[v440B0[channelNum]] + 0x40; write(portNum, (_portContents[portNum] & 0x80) | level1); portNum = v440C2[v440B9[channelNum]] + 0x40; @@ -2589,7 +2589,7 @@ void AdlibSoundDriver::updateChannel(int channel) { write(0x80 + portOffset, *(dataP + 27) | (*(dataP + 26) << 4)); write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 28)); - write(0xC0 + channel, (_portContents[0xC0 + channel] & 0xF0) + write(0xC0 + channel, (_portContents[0xC0 + channel] & 0xF0) | (*(dataP + 16) << 1) | *(dataP + 3)); _v44082[channel] = *(dataP + 3); @@ -2607,7 +2607,7 @@ void AdlibSoundDriver::setFrequency(int channel) { v -= 0x2000; if (v == 0x1fff) v = 0x2000; - + offset = (v / 170) & 3; ch += (v / 170) >> 2; @@ -2636,7 +2636,7 @@ void AdlibSoundDriver::setFrequency(int channel) { int dataWord = v440D4[((ch % 12) << 2) + offset]; write(0xA0 + channel, dataWord & 0xff); - write(0xB0 + channel, (_portContents[0xB0 + channel] & 0xE0) | + write(0xB0 + channel, (_portContents[0xB0 + channel] & 0xE0) | ((dataWord >> 8) & 3) | (var2 << 2)); } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 8fcb1c38ff..4cda2cd1d9 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -372,7 +372,7 @@ public: void mute(bool flag) { _sound.mute(flag); } void fadeIn() { fade(127, 5, 10, 0, NULL); } void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } - void fade(int v1, int v2, int v3, int v4, Action *action); + void fade(int v1, int v2, int v3, int v4, Action *action); void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } uint32 getTimeIndex() const { return _sound.getTimeIndex(); } void setPri(int v) { _sound.setPri(v); } diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 0e87769f2f..8b60f8aa6b 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -81,7 +81,7 @@ bool WinFont::loadFromFON(const Common::String &fileName, const WinFontDirEntry return true; // Then try loading via the PE code - return loadFromPE(fileName, dirEntry); + return loadFromPE(fileName, dirEntry); } bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &dirEntry) { @@ -98,7 +98,7 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry & } uint32 fontId = getFontIndex(*fontDirectory, dirEntry); - + delete fontDirectory; // Couldn't match the face name @@ -133,7 +133,7 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry & } uint32 fontId = getFontIndex(*fontDirectory, dirEntry); - + delete fontDirectory; // Couldn't match the face name diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h index b6c1be7064..4382d7ed6b 100644 --- a/graphics/fonts/winfont.h +++ b/graphics/fonts/winfont.h @@ -88,7 +88,7 @@ private: uint16 charWidth; uint32 offset; byte *bitmap; - } *_glyphs; + } *_glyphs; }; } // End of namespace Graphics diff --git a/graphics/jpeg.h b/graphics/jpeg.h index bda0c08240..27b91e8777 100644 --- a/graphics/jpeg.h +++ b/graphics/jpeg.h @@ -72,7 +72,7 @@ private: // Result image for this component Surface surface; }; - + Component *_components; // Scan components diff --git a/graphics/png.cpp b/graphics/png.cpp index a1cf266227..6eff4b1e47 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -100,7 +100,7 @@ enum PNGFilters { kFilterPaeth = 4 }; -PNG::PNG() : _compressedBuffer(0), _compressedBufferSize(0), +PNG::PNG() : _compressedBuffer(0), _compressedBufferSize(0), _unfilteredSurface(0), _transparentColorSpecified(false) { } @@ -282,7 +282,7 @@ bool PNG::read(Common::SeekableReadStream *str) { // Unpack the compressed buffer Common::MemoryReadStream *compData = new Common::MemoryReadStream(_compressedBuffer, _compressedBufferSize, DisposeAfterUse::YES); _imageData = Common::wrapCompressedReadStream(compData); - + // Construct the final image constructImage(); @@ -306,7 +306,7 @@ byte PNG::paethPredictor(int16 a, int16 b, int16 c) { int16 pa = ABS(b - c); int16 pb = ABS(a - c); int16 pc = ABS(a + b - c - c); - + if (pa <= MIN(pb, pc)) return (byte)a; else if (pb <= pc) diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index 660abf556c..09e1746df4 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -161,7 +161,7 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, outlineExtraWidth = 0; outlineXOffset = 1; } - + if (maxH != -1 && maxH < height) { height = maxH; outlineExtraHeight = 0; @@ -191,7 +191,7 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, if (_drawMode == kOutlineMode) { blitCharacter(outline, width + outlineExtraWidth, height + outlineExtraHeight, (uint8 *)dst, pitch, c2); blitCharacter(glyphSource, width - outlineXOffset, height - outlineYOffset, (uint8 *)dst + pitch + 1, pitch, c1); - } else { + } else { if (_drawMode != kDefaultMode) { blitCharacter(glyphSource, width - outlineXOffset, height, ((uint8*)dst) + 1, pitch, c2); blitCharacter(glyphSource, width, height - outlineYOffset, ((uint8*)dst) + pitch, pitch, c2); diff --git a/graphics/sjis.h b/graphics/sjis.h index 21ced62b1d..0c3b057cc4 100644 --- a/graphics/sjis.h +++ b/graphics/sjis.h @@ -141,7 +141,7 @@ public: void toggleFlippedMode(bool enable) { _flippedMode = enable; } uint getFontHeight() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); } - + uint getMaxFontWidth() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); } uint getCharWidth(uint16 ch) const; diff --git a/graphics/surface.cpp b/graphics/surface.cpp index cee8e61438..0fad25734c 100644 --- a/graphics/surface.cpp +++ b/graphics/surface.cpp @@ -127,7 +127,7 @@ void Surface::vLine(int x, int y, int y2, uint32 color) { *ptr = (uint16)color; ptr += pitch / 2; } - + } else if (format.bytesPerPixel == 4) { uint32 *ptr = (uint32 *)getBasePtr(x, y); while (y++ <= y2) { diff --git a/graphics/surface.h b/graphics/surface.h index 2a0f71955a..018a283aad 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -189,7 +189,7 @@ struct Surface { /** * A deleter for Surface objects which can be used with SharedPtr. - * + * * This deleter assures Surface::free is called on deletion. */ struct SharedPtrSurfaceDeleter { diff --git a/gui/options.cpp b/gui/options.cpp index b0b9fe6c90..3cc2eea6b9 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -343,12 +343,12 @@ void OptionsDialog::close() { ConfMan.removeKey("render_mode", _domain); } } - + // Setup graphics again if needed if (_domain == Common::ConfigManager::kApplicationDomain && graphicsModeChanged) { g_system->beginGFXTransaction(); g_system->setGraphicsMode(ConfMan.get("gfx_mode", _domain).c_str()); - + if (ConfMan.hasKey("aspect_ratio")) g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio", _domain)); if (ConfMan.hasKey("fullscreen")) @@ -383,7 +383,7 @@ void OptionsDialog::close() { message += "\n"; message += _("the video mode could not be changed."); } - + if (gfxError & OSystem::kTransactionAspectRatioFailed) { ConfMan.setBool("aspect_ratio", g_system->getFeatureState(OSystem::kFeatureAspectRatioCorrection), _domain); message += "\n"; @@ -808,7 +808,7 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi _gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle()); } else if (d->getMusicDriverId() == "auto") { _gmDevicePopUp->appendEntry(_("Use first available device"), d->getHandle()); - } + } } } @@ -855,7 +855,7 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi // Make sure the null device is the first one in the list to avoid undesired // auto detection for users who don't have a saved setting yet. for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) { - MusicDevices i = (**m)->getDevices(); + MusicDevices i = (**m)->getDevices(); for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { if (d->getMusicDriverId() == "null") _mt32DevicePopUp->appendEntry(_("Don't use Roland MT-32 music"), d->getHandle()); diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp index b8a3c0ab37..e475c8426c 100644 --- a/video/codecs/truemotion1.cpp +++ b/video/codecs/truemotion1.cpp @@ -112,7 +112,7 @@ TrueMotion1Decoder::~TrueMotion1Decoder() { void TrueMotion1Decoder::selectDeltaTables(int deltaTableIndex) { if (deltaTableIndex > 3) return; - + for (byte i = 0; i < 8; i++) { _ydt[i] = ydts[deltaTableIndex][i]; _cdt[i] = cdts[deltaTableIndex][i]; diff --git a/video/codecs/truemotion1.h b/video/codecs/truemotion1.h index 33fbedca93..628cfa4584 100644 --- a/video/codecs/truemotion1.h +++ b/video/codecs/truemotion1.h @@ -27,7 +27,7 @@ #ifndef VIDEO_CODECS_TRUEMOTION1_H #define VIDEO_CODECS_TRUEMOTION1_H - + #include "video/codecs/codec.h" namespace Video { @@ -51,7 +51,7 @@ private: uint16 _width, _height; int _flags; - + struct PredictorTableEntry { uint32 color; bool getNextIndex; diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 9575845cd3..f93f0d616e 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -134,7 +134,7 @@ uint32 QuickTimeDecoder::findKeyFrame(uint32 frame) const { for (int i = _tracks[_videoTrackIndex]->keyframeCount - 1; i >= 0; i--) if (_tracks[_videoTrackIndex]->keyframes[i] <= frame) return _tracks[_videoTrackIndex]->keyframes[i]; - + // If none found, we'll assume the requested frame is a key frame return frame; } -- cgit v1.2.3 From dae19afbfb0ba288755bd83c9bee5e0c48620c6a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Jun 2011 01:28:10 +0200 Subject: SCI: Let fallback detector set GUIO_NOSPEECH appropriately --- engines/sci/detection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 1cfedd6f1b..2285e512bd 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -430,6 +430,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, s_fallbackDesc.flags = ADGF_NO_FLAGS; s_fallbackDesc.platform = Common::kPlatformPC; // default to PC platform s_fallbackDesc.gameid = "sci"; + s_fallbackDesc.guioptions = Common::GUIO_NONE; if (allFiles.contains("resource.map") || allFiles.contains("Data1") || allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) { @@ -559,6 +560,9 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, const bool isDemo = (s_fallbackDesc.flags & ADGF_DEMO); const bool isCD = (s_fallbackDesc.flags & ADGF_CD); + if (!isCD) + s_fallbackDesc.guioptions |= Common::GUIO_NOSPEECH; + if (gameId.hasSuffix("sci")) { s_fallbackDesc.extra = "SCI"; -- cgit v1.2.3 From 123f2416d8074a50e2c42c83caaf94961d4c6d36 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 19:42:13 +1000 Subject: TSAGE: Initial implementation of AudioStream interface for sound driver --- engines/tsage/events.cpp | 6 +----- engines/tsage/sound.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++- engines/tsage/sound.h | 22 ++++++++++++++++++++- 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index 94c074a50b..a24f65421b 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -48,9 +48,8 @@ bool EventsClass::pollEvent() { _priorFrameTime = milli; ++_frameNumber; - // Update screen and allow the sound manager to process pending sounds + // Update screen g_system->updateScreen(); - SoundManager::_sfSoundServer(); } if (!g_system->getEventManager()->pollEvent(_event)) return false; @@ -299,9 +298,6 @@ void EventsClass::delay(int numFrames) { ++_frameNumber; _priorFrameTime = g_system->getMillis(); - - // Allow pending sounds to be processed - SoundManager::_sfSoundServer(); } g_system->updateScreen(); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 0c0d93be03..24c64bda3c 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -51,6 +51,8 @@ SoundManager::SoundManager() { _needToRethink = false; _soTimeIndexFlag = false; + _updateTicksCounter = 0; + _eventsDelay = GAME_FRAME_TIME; } SoundManager::~SoundManager() { @@ -114,6 +116,14 @@ void SoundManager::syncSounds() { this->setMasterVol(musicVolume / 2); } +void SoundManager::update() { + ++_updateTicksCounter; + if (_updateTicksCounter > _eventsDelay) { + _sfSoundServer(); + _updateTicksCounter = 0; + } +} + Common::List &SoundManager::buildDriverList(bool detectFlag) { assert(__sndmgrReady); _availableDrivers.clear(); @@ -482,6 +492,10 @@ void SoundManager::_sfUpdateVoiceStructs2() { } } +void SoundManager::_sfUpdateCallback(void *ref) { + ((SoundManager *)ref)->update(); +} + /*--------------------------------------------------------------------------*/ void SoundManager::saveNotifier(bool postFlag) { @@ -1293,7 +1307,8 @@ void SoundManager::_sfExtractGroupMask() { bool SoundManager::_sfInstallDriver(SoundDriver *driver) { if (!driver->open()) return false; - + + driver->setUpdateCallback(_sfUpdateCallback, (void *)&sfManager()); sfManager()._installedDrivers.push_back(driver); driver->_groupOffset = driver->getGroupData(); driver->_groupMask = READ_LE_UINT32(driver->_groupOffset); @@ -2376,6 +2391,8 @@ const int v440D4[48] = { }; AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { + _upCb = NULL; + _upRef = NULL; _minVersion = 0x102; _maxVersion = 0x10A; _masterVolume = 0; @@ -2388,6 +2405,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _mixer = _vm->_mixer; _sampleRate = _mixer->getOutputRate(); _opl = makeAdLibOPL(_sampleRate); + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); @@ -2404,6 +2422,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { AdlibSoundDriver::~AdlibSoundDriver() { DEALLOCATE(_patchData); + _mixer->stopHandle(_soundHandle); OPLDestroy(_opl); } @@ -2640,4 +2659,34 @@ void AdlibSoundDriver::setFrequency(int channel) { ((dataWord >> 8) & 3) | (var2 << 2)); } +int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) { + update(buffer, numSamples); + return numSamples; +} + +void AdlibSoundDriver::update(int16 *buf, int len) { + static int samplesLeft = 0; + while (len != 0) { + int count = samplesLeft; + if (count > len) { + count = len; + } + samplesLeft -= count; + len -= count; + YM3812UpdateOne(_opl, buf, count); + if (samplesLeft == 0) { + if (_upCb) { + (*_upCb)(_upRef); + } + samplesLeft = _sampleRate / 50; + } + buf += count; + } +} + +void AdlibSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) { + _upCb = upCb; + _upRef = ref; +} + } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 4cda2cd1d9..ed93d33443 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -72,6 +72,10 @@ public: uint32 _groupMask; const GroupData *_groupOffset; int _driverResID; + + typedef void (*UpdateCallback)(void *); + UpdateCallback _upCb; + void *_upRef; public: SoundDriver(); virtual ~SoundDriver() {}; @@ -101,6 +105,8 @@ public: virtual void proc38(int channel, int cmd, int value) {} // Method #19 virtual void setPitch(int channel, int pitchBlend) {} // Method #20 virtual void proc42(int channel, int v0, int v1) {} // Method #21 + + virtual void setUpdateCallback(UpdateCallback upCb, void *ref) {} }; struct VoiceStructEntryType0 { @@ -171,6 +177,8 @@ public: Common::List _soundList; Common::List _availableDrivers; bool _needToRethink; + int _updateTicksCounter; + int _eventsDelay; // Misc flags bool _soTimeIndexFlag; public: @@ -181,6 +189,7 @@ public: virtual void listenerSynchronize(Serializer &s); virtual void postInit(); void syncSounds(); + void update(); static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); @@ -243,6 +252,7 @@ public: static void _sfProcessFading(); static void _sfUpdateVoiceStructs(); static void _sfUpdateVoiceStructs2(); + static void _sfUpdateCallback(void *ref); }; class Sound: public EventHandler { @@ -387,11 +397,12 @@ public: #define ADLIB_CHANNEL_COUNT 9 -class AdlibSoundDriver: public SoundDriver { +class AdlibSoundDriver: public SoundDriver, Audio::AudioStream { private: GroupData _groupData; Audio::Mixer *_mixer; FM_OPL *_opl; + Audio::SoundHandle _soundHandle; int _sampleRate; byte _portContents[256]; const byte *_patchData; @@ -428,6 +439,15 @@ public: virtual void updateVoice(int channel); virtual void proc38(int channel, int cmd, int value); virtual void setPitch(int channel, int pitchBlend); + virtual void setUpdateCallback(UpdateCallback upCb, void *ref); + + // AudioStream interface + virtual int readBuffer(int16 *buffer, const int numSamples); + virtual bool isStereo() const { return false; } + virtual bool endOfData() const { return false; } + virtual int getRate() const { return _sampleRate; } + + void update(int16 *buf, int len); }; } // End of namespace tSage -- cgit v1.2.3 From f8e0ff86c74e5ce24cf5f3d7b2308b810e3ebd41 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 19:57:33 +1000 Subject: TSAGE: Bugfix for properly decrementing _disabledServerCount --- engines/tsage/sound.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 24c64bda3c..bbd1c407d2 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -215,12 +215,12 @@ void SoundManager::installDriver(int driverNum) { // Unmute currently active sounds for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) (*i)->mute(false); - - enableSoundServer(); } break; } } + + enableSoundServer(); } /** @@ -355,7 +355,7 @@ void SoundManager::rethinkVoiceTypes() { } void SoundManager::_sfSoundServer() { - if (!sfManager()._serverDisabledCount && !sfManager()._serverSuspendedCount) + if (sfManager()._serverDisabledCount || sfManager()._serverSuspendedCount) return; if (sfManager()._needToRethink) { -- cgit v1.2.3 From c22f824bedceca3dd89bded1bccbc8d2d1ef1b8c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 21:09:39 +1000 Subject: TSAGE: Corrections to the sound fading code --- engines/tsage/sound.cpp | 18 +++++++----------- engines/tsage/sound.h | 8 ++++---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index bbd1c407d2..9d397c7fe5 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -398,15 +398,11 @@ void SoundManager::_sfProcessFading() { --s->_fadeCounter; else { if (s->_volume >= s->_fadeDest) { - if ((s->_fadeDest - s->_volume) > s->_fadeSteps) - s->_volume += s->_fadeSteps; - else - s->_volume = s->_fadeDest; + s->_volume = ((s->_volume - s->_fadeDest) > s->_fadeSteps) ? + s->_volume - s->_fadeSteps : s->_fadeDest; } else { - if (s->_fadeDest > s->_fadeSteps) - s->_volume -= s->_fadeSteps; - else - s->_volume = s->_fadeDest; + s->_volume = ((s->_fadeDest - s->_volume) > s->_fadeSteps) ? + s->_volume + s->_fadeSteps : s->_fadeDest; } _sfDoUpdateVolume(s); @@ -1606,7 +1602,7 @@ void Sound::mute(bool flag) { _soundManager->restartSoundServer(); } -void Sound::fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag) { +void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag) { _soundManager->suspendSoundServer(); if (fadeDest > 127) @@ -2346,11 +2342,11 @@ void ASound::unPrime() { _action = NULL; } -void ASound::fade(int v1, int v2, int v3, int v4, Action *action) { +void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action) { if (action) _action = action; - _sound.fade(v1, v2, v3, v4); + _sound.fade(fadeDest, fadeSteps, fadeTicks, stopAfterFadeFlag); } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index ed93d33443..9b76cd4a06 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -323,7 +323,7 @@ public: bool isMuted() const; void pause(bool flag); void mute(bool flag); - void fade(int fadeDest, int fadeTicks, int fadeSteps, bool stopAfterFadeFlag); + void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag); void setTimeIndex(uint32 timeIndex); uint32 getTimeIndex() const; int getCueValue() const; @@ -380,9 +380,9 @@ public: bool isMuted() const { return _sound.isMuted(); } void pause(bool flag) { _sound.pause(flag); } void mute(bool flag) { _sound.mute(flag); } - void fadeIn() { fade(127, 5, 10, 0, NULL); } - void fadeOut(Action *action) { fade(0, 5, 10, 1, action); } - void fade(int v1, int v2, int v3, int v4, Action *action); + void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action); + void fadeIn() { fade(127, 5, 10, false, NULL); } + void fadeOut(Action *action) { fade(0, 5, 10, true, action); } void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } uint32 getTimeIndex() const { return _sound.getTimeIndex(); } void setPri(int v) { _sound.setPri(v); } -- cgit v1.2.3 From 7c733a538c5c333041cb35975f215d3b354468ea Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 21:30:20 +1000 Subject: TSAGE: Sound is now working! --- engines/tsage/sound.cpp | 8 +------- engines/tsage/sound.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 9d397c7fe5..73eaa5fb2e 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -51,8 +51,6 @@ SoundManager::SoundManager() { _needToRethink = false; _soTimeIndexFlag = false; - _updateTicksCounter = 0; - _eventsDelay = GAME_FRAME_TIME; } SoundManager::~SoundManager() { @@ -117,11 +115,7 @@ void SoundManager::syncSounds() { } void SoundManager::update() { - ++_updateTicksCounter; - if (_updateTicksCounter > _eventsDelay) { - _sfSoundServer(); - _updateTicksCounter = 0; - } + _sfSoundServer(); } Common::List &SoundManager::buildDriverList(bool detectFlag) { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 9b76cd4a06..722e33d8d4 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -177,8 +177,6 @@ public: Common::List _soundList; Common::List _availableDrivers; bool _needToRethink; - int _updateTicksCounter; - int _eventsDelay; // Misc flags bool _soTimeIndexFlag; public: -- cgit v1.2.3 From adb40844d894cd69c4c89fbaddb130a70cab6816 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 21:42:30 +1000 Subject: TSAGE: Bugfix for crash when exiting whilst a sound is playing --- engines/tsage/sound.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 73eaa5fb2e..51a24a3c86 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -55,8 +55,11 @@ SoundManager::SoundManager() { SoundManager::~SoundManager() { if (__sndmgrReady) { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->stop(); + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ) { + Sound *s = *i; + ++i; + s->stop(); + } for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { SoundDriver *driver = *i; ++i; -- cgit v1.2.3 From 0d485d282222e4b0ce407e1bce537acf5b7f5dd0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 22:33:55 +1000 Subject: TSAGE: Loop variables are meant to be integers rather than bools --- engines/tsage/sound.cpp | 10 +++++----- engines/tsage/sound.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 51a24a3c86..65c2c990fb 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1395,11 +1395,11 @@ Sound::Sound() { _group = 0; _sndResPriority = 0; _fixedPriority = -1; - _sndResLoop = true; - _fixedLoop = true; + _sndResLoop = 1; + _fixedLoop = -1; _priority = 0; _volume = 127; - _loop = false; + _loop = 0; _pausedCount = 0; _mutedCount = 0; _hold = 0xff; @@ -1660,7 +1660,7 @@ void Sound::setPri(int priority) { _soundManager->updateSoundPri(this); } -void Sound::setLoop(bool flag) { +void Sound::setLoop(int flag) { _fixedLoop = flag; _soundManager->updateSoundLoop(this); } @@ -1669,7 +1669,7 @@ int Sound::getPri() const { return _priority; } -bool Sound::getLoop() { +int Sound::getLoop() { return _loop; } diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 722e33d8d4..5e89275722 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -264,8 +264,8 @@ public: int _group; int _sndResPriority; int _fixedPriority; - bool _sndResLoop; - bool _fixedLoop; + int _sndResLoop; + int _fixedLoop; int _priority; int _volume; int _loop; @@ -329,9 +329,9 @@ public: void setVol(int volume); int getVol() const; void setPri(int priority); - void setLoop(bool flag); + void setLoop(int flag); int getPri() const; - bool getLoop(); + int getLoop(); void holdAt(int amount); void release(); void orientAfterDriverChange(); @@ -384,9 +384,9 @@ public: void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } uint32 getTimeIndex() const { return _sound.getTimeIndex(); } void setPri(int v) { _sound.setPri(v); } - void setLoop(bool flag) { _sound.setLoop(flag); } + void setLoop(int total) { _sound.setLoop(total); } int getPri() const { return _sound.getPri(); } - bool getLoop() { return _sound.getLoop(); } + int getLoop() { return _sound.getLoop(); } void setVol(int volume) { _sound.setVol(volume); } int getVol() const { return _sound.getVol(); } void holdAt(int v) { _sound.holdAt(v); } -- cgit v1.2.3 From fcab88634d57b7db4e06e156992dc34f2c572697 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 23:02:59 +1000 Subject: TSAGE: Replaced integer counters used as mutexes with Common::Mutex usage --- engines/tsage/sound.cpp | 82 +++++++++++++------------------------------------ engines/tsage/sound.h | 9 ++---- 2 files changed, 25 insertions(+), 66 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 65c2c990fb..42416e2bf0 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -44,8 +44,6 @@ SoundManager::SoundManager() { _groupsAvail = 0; _masterVol = 127; - _serverSuspendedCount = 0; - _serverDisabledCount = 0; _suspendedCount = 0; _driversDetected = false; _needToRethink = false; @@ -154,24 +152,6 @@ void SoundManager::dumpDriverList() { _availableDrivers.clear(); } -void SoundManager::disableSoundServer() { - ++_serverDisabledCount; -} - -void SoundManager::enableSoundServer() { - if (_serverDisabledCount > 0) - --_serverDisabledCount; -} - -void SoundManager::suspendSoundServer() { - ++_serverSuspendedCount; -} - -void SoundManager::restartSoundServer() { - if (_serverSuspendedCount > 0) - --_serverSuspendedCount; -} - /** * Install the specified driver number */ @@ -188,7 +168,8 @@ void SoundManager::installDriver(int driverNum) { assert((_ourDrvResVersion >= driver->_minVersion) && (_ourDrvResVersion <= driver->_maxVersion)); // Mute any loaded sounds - disableSoundServer(); + Common::StackLock slock(_serverDisabledMutex); + for (Common::List::iterator i = _playList.begin(); i != _playList.end(); ++i) (*i)->mute(true); @@ -216,8 +197,6 @@ void SoundManager::installDriver(int driverNum) { break; } } - - enableSoundServer(); } /** @@ -238,7 +217,8 @@ void SoundManager::unInstallDriver(int driverNum) { // Found driver to remove // Mute any loaded sounds - disableSoundServer(); + Common::StackLock slock(_serverDisabledMutex); + Common::List::iterator j; for (j = _playList.begin(); j != _playList.end(); ++j) (*j)->mute(true); @@ -253,8 +233,6 @@ void SoundManager::unInstallDriver(int driverNum) { // Unmute currently active sounds for (j = _playList.begin(); j != _playList.end(); ++j) (*j)->mute(false); - - enableSoundServer(); } } } @@ -348,12 +326,13 @@ void SoundManager::updateSoundLoop(Sound *sound) { } void SoundManager::rethinkVoiceTypes() { + Common::StackLock slock(sfManager()._serverSuspendedMutex); _sfRethinkVoiceTypes(); } void SoundManager::_sfSoundServer() { - if (sfManager()._serverDisabledCount || sfManager()._serverSuspendedCount) - return; + Common::StackLock slock1(sfManager()._serverDisabledMutex); + Common::StackLock slock2(sfManager()._serverSuspendedMutex); if (sfManager()._needToRethink) { _sfRethinkVoiceTypes(); @@ -363,9 +342,7 @@ void SoundManager::_sfSoundServer() { } // Handle any fading if necessary - do { - _sfProcessFading(); - } while (sfManager()._serverSuspendedCount > 0); + _sfProcessFading(); // Poll all sound drivers in case they need it for (Common::List::iterator i = sfManager()._installedDrivers.begin(); @@ -533,24 +510,24 @@ int SoundManager::_sfDetermineGroup(const byte *soundData) { } void SoundManager::_sfAddToPlayList(Sound *sound) { - ++sfManager()._serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); + _sfDoAddToPlayList(sound); sound->_stoppedAsynchronously = false; _sfRethinkVoiceTypes(); - --sfManager()._serverSuspendedCount; } void SoundManager::_sfRemoveFromPlayList(Sound *sound) { - ++sfManager()._serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); + if (_sfDoRemoveFromPlayList(sound)) _sfRethinkVoiceTypes(); - --sfManager()._serverSuspendedCount; } bool SoundManager::_sfIsOnPlayList(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); + bool result = contains(_soundManager->_playList, sound); - --_soundManager->_serverSuspendedCount; return result; } @@ -679,7 +656,6 @@ void SoundManager::_sfRethinkSoundDrivers() { } void SoundManager::_sfRethinkVoiceTypes() { - ++sfManager()._serverSuspendedCount; _sfDereferenceAll(); // Pre-processing @@ -1203,8 +1179,6 @@ void SoundManager::_sfRethinkVoiceTypes() { } } } - - --sfManager()._serverSuspendedCount; } void SoundManager::_sfUpdateVolume(Sound *sound) { @@ -1219,7 +1193,7 @@ void SoundManager::_sfDereferenceAll() { } void SoundManager::_sfUpdatePriority(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); int tempPriority = (sound->_fixedPriority == 255) ? sound->_sndResPriority : sound->_priority; if (sound->_priority != tempPriority) { @@ -1229,8 +1203,6 @@ void SoundManager::_sfUpdatePriority(Sound *sound) { _sfRethinkVoiceTypes(); } } - - --_soundManager->_serverSuspendedCount; } void SoundManager::_sfUpdateLoop(Sound *sound) { @@ -1329,21 +1301,20 @@ void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData * Adds the specified sound in the playing sound list, inserting in order of priority */ void SoundManager::_sfDoAddToPlayList(Sound *sound) { - ++sfManager()._serverSuspendedCount; + Common::StackLock slock2(sfManager()._serverSuspendedMutex); Common::List::iterator i = sfManager()._playList.begin(); while ((i != sfManager()._playList.end()) && (sound->_priority > (*i)->_priority)) ++i; sfManager()._playList.insert(i, sound); - --sfManager()._serverSuspendedCount; } /** * Removes the specified sound from the play list */ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { - ++sfManager()._serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); bool result = false; for (Common::List::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) { @@ -1354,12 +1325,11 @@ bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) { } } - --sfManager()._serverSuspendedCount; return result; } void SoundManager::_sfDoUpdateVolume(Sound *sound) { - ++_soundManager->_serverSuspendedCount; + Common::StackLock slock(sfManager()._serverSuspendedMutex); for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) { VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex]; @@ -1383,8 +1353,6 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { } } } - - --_soundManager->_serverSuspendedCount; } /*--------------------------------------------------------------------------*/ @@ -1576,7 +1544,7 @@ bool Sound::isMuted() const { } void Sound::pause(bool flag) { - _soundManager->suspendSoundServer(); + Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); if (flag) ++_pausedCount; @@ -1584,11 +1552,10 @@ void Sound::pause(bool flag) { --_pausedCount; _soundManager->rethinkVoiceTypes(); - _soundManager->restartSoundServer(); } void Sound::mute(bool flag) { - _soundManager->suspendSoundServer(); + Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); if (flag) ++_mutedCount; @@ -1596,11 +1563,10 @@ void Sound::mute(bool flag) { --_mutedCount; _soundManager->rethinkVoiceTypes(); - _soundManager->restartSoundServer(); } void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag) { - _soundManager->suspendSoundServer(); + Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); if (fadeDest > 127) fadeDest = 127; @@ -1614,8 +1580,6 @@ void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeF _fadeSteps = fadeSteps; _fadeCounter = 0; _stopAfterFadeFlag = stopAfterFadeFlag; - - _soundManager->restartSoundServer(); } void Sound::setTimeIndex(uint32 timeIndex) { @@ -1704,7 +1668,7 @@ void Sound::_soPrimeSound(bool dontQueue) { } void Sound::_soSetTimeIndex(uint timeIndex) { - ++_soundManager->_serverDisabledCount; + Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex); if (timeIndex != _timer) { _soundManager->_soTimeIndexFlag = true; @@ -1723,8 +1687,6 @@ void Sound::_soSetTimeIndex(uint timeIndex) { _soundManager->_soTimeIndexFlag = false; } - - --_soundManager->_serverDisabledCount; } bool Sound::_soServiceTracks() { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 5e89275722..be3924151b 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -24,6 +24,7 @@ #define TSAGE_SOUND_H #include "common/scummsys.h" +#include "common/mutex.h" #include "audio/audiostream.h" #include "audio/fmopl.h" #include "audio/mixer.h" @@ -170,8 +171,8 @@ public: VoiceTypeStruct *_voiceTypeStructPtrs[SOUND_ARR_SIZE]; uint32 _groupsAvail; int _masterVol; - int _serverDisabledCount; - int _serverSuspendedCount; + Common::Mutex _serverDisabledMutex; + Common::Mutex _serverSuspendedMutex; int _suspendedCount; bool _driversDetected; Common::List _soundList; @@ -201,10 +202,6 @@ public: void installDriver(int driverNum); bool isInstalled(int driverNum) const; void unInstallDriver(int driverNum); - void disableSoundServer(); - void enableSoundServer(); - void suspendSoundServer(); - void restartSoundServer(); void checkResVersion(const byte *soundData); int determineGroup(const byte *soundData); int extractPriority(const byte *soundData); -- cgit v1.2.3 From 5674dda4ccb36fe1b2fc539be33cb21a52451484 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 20 Jun 2011 16:26:48 +0200 Subject: COMMON: Fix conflicting comment --- common/archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/archive.h b/common/archive.h index 3c75970d60..8400c56d69 100644 --- a/common/archive.h +++ b/common/archive.h @@ -143,7 +143,7 @@ class SearchSet : public Archive { ArchiveNodeList::iterator find(const String &name); ArchiveNodeList::const_iterator find(const String &name) const; - // Add an archive keeping the list sorted by ascending priorities. + // Add an archive keeping the list sorted by descending priority. void insert(const Node& node); public: -- cgit v1.2.3 From 2cc721760ff29c78bea6373ed8628b1bc3aedc6b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 20 Jun 2011 16:11:55 +0200 Subject: WIN32: Properly setup priority in Win32 resource archive code. --- backends/platform/sdl/win32/win32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 5b14be4417..432f7077ae 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -300,7 +300,7 @@ Common::SeekableReadStream *Win32ResourceArchive::createReadStreamForMember(cons } // End of anonymous namespace void OSystem_Win32::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { - s.add("Win32Res", new Win32ResourceArchive()); + s.add("Win32Res", new Win32ResourceArchive(), priority); OSystem_SDL::addSysArchivesToSearchSet(s, priority); } -- cgit v1.2.3 From 0269a8d9008f51cca63ad215bbb2aa23ad75d574 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Mon, 20 Jun 2011 17:23:30 +0200 Subject: TINSEL: Fix/comment CORO_KILL_SELF macro. This reverts 9573b1d2f54818f9bdac4a91e0a90b306ade7810, which changed the behaviour of (among other things) NewScene, which made Discworld uncompletable. Thanks to digitall for bisection/reproduction. --- engines/tinsel/coroutine.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index b62c40b4e5..5bcf1149d9 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -178,10 +178,15 @@ public: #define CORO_RESCHEDULE do { g_scheduler->reschedule(); CORO_SLEEP(1); } while (0) /** - * Stop the currently running coroutine. + * Stop the currently running coroutine and all calling coroutines. + * + * This sets _sleep to -1 rather than 0 so that the context doesn't get + * deleted by CoroContextHolder, since we want CORO_INVOKE_ARGS to + * propogate the _sleep value and return immediately (the scheduler will + * then delete the entire coroutine's state, including all subcontexts). */ #define CORO_KILL_SELF() \ - do { if (&coroParam != &nullContext) { coroParam->_sleep = 0; } return; } while (0) + do { if (&coroParam != &nullContext) { coroParam->_sleep = -1; } return; } while (0) /** @@ -193,8 +198,12 @@ public: /** * Invoke another coroutine. * - * What makes this tricky is that the coroutine we called my yield/sleep, - * and we need to deal with this adequately. + * If the subcontext still exists after the coroutine is invoked, it has + * either yielded/slept or killed itself, and so we copy the _sleep value + * to our own context and return (execution will continue at the case + * statement below, where we loop and call the coroutine again). + * If the subcontext is null, the coroutine ended normally, and we can + * simply break out of the loop and continue execution. * * @param subCoro name of the coroutine-enabled function to invoke * @param ARGS list of arguments to pass to subCoro -- cgit v1.2.3 From 6318758e7119d7834a9f7c4be11b819ee0bfaff4 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Mon, 20 Jun 2011 17:42:00 +0200 Subject: TINSEL: Don't leak running processes in Scheduler::reset(). --- engines/tinsel/sched.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index b24d6bf9b8..d6cd806eb2 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -70,6 +70,7 @@ Scheduler::Scheduler() { active = new PROCESS; active->pPrevious = NULL; + active->pNext = NULL; g_scheduler = this; // FIXME HACK } @@ -113,6 +114,14 @@ void Scheduler::reset() { memset(processList, 'S', MAX_PROCESSES * sizeof(PROCESS)); } + // Kill all running processes (i.e. free memory allocated for their state). + PROCESS *pProc = active->pNext; + while (pProc != NULL) { + delete pProc->state; + pProc->state = 0; + pProc = pProc->pNext; + } + // no active processes pCurrent = active->pNext = NULL; -- cgit v1.2.3 From 70799120914c5abb9fd0788493117e1c47769f0f Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 20 Jun 2011 20:00:09 +0200 Subject: DREAMWEB: Remove convertkey() This function was responsible for filtering invalid keys (e.g. in savegame names), and was only used by keyboardread(). This filtering is done by processEvents() instead. --- devtools/tasmrecover/tasm-recover | 3 +- engines/dreamweb/dreamgen.cpp | 1146 ++++++++++++++++++------------------- engines/dreamweb/dreamgen.h | 14 +- 3 files changed, 577 insertions(+), 586 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 35e20d20ab..27aeb326c0 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -19,6 +19,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'cls', 'printundermon', 'worktoscreen', - 'width160' + 'width160', + 'convertkey' ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c80f386da1..2f58230260 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -20653,15 +20653,6 @@ nokey: data.byte(kCurrentkey) = 0; } -void DreamGenContext::convertkey() { - STACK_CHECK; - _and(al, 127); - ah = 0; - di = 5928; - _add(di, ax); - al = cs.byte(di); -} - void DreamGenContext::randomnum1() { STACK_CHECK; push(ds); @@ -21449,577 +21440,577 @@ endofgame: -void DreamGenContext::__start() { +void DreamGenContext::__start() { static const uint8 src[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00, - 0xff, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 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, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, - 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, - 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, - 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, - 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, - 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, - 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, - 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, - 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, - 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, - 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, - 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, - 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, - 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, - 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, - 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, - 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, - 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, - 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, - 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, - 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, - 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, - 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, - 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, - 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, - 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, - 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, - 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, - 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, - 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, - 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, - 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, - 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, - 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, - 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, - 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, - 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, - 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, - 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, - 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, - 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, - 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, - 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, - 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, - 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, - 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, - 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, - 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, - 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, - 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, - 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, - 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, - 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, - 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, - 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, - 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, - 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, - 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, - 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, - 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, - 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, - 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, - 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, - 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, - 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, - 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, - 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, - 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, - 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, - 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, - 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, - 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, - 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, - 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, - 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, - 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, - 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, - 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, - 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, - 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, - 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, - 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, - 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, - 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, - 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, - 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, - 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, - 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, - 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, - 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, - 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, - 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, - 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, - 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, - 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, - 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, - 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, - 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, - 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, - 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, - 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, - 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, - 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, - 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, - 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, - 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, - 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, - 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, - 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, - 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, - 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, - 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, - 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, - 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, - 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, - 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, - 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, - 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, - 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, - 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, - 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, - 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, - 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, - 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, - 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, - 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, - 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, - 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, - 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, - 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, - 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, - 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, - 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, - 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, - 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, - 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, - 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, - 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, - 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, - 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, - 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, - 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, - 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, - 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, - 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, - 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, - 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, - 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, - 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, - 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, - 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, - 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, - 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, - 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, - 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, - 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, - 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, - 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, - 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, - 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, - 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, - 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, - 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, - 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, - 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, - 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, - 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, - 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, - 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, - 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, - 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, - 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, - 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, - 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, - 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, - 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, - 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, - 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, - 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, - 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, - 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, - 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, - 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, - 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, - 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, - 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, - 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, - 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, - 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, - 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, - 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, - 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, - 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, - 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, - 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, - 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, - 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, - 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, - 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, - 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, - 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, - 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, - 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, - 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, - 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, - 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, - 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, - 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, - 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, - 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, - 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, - 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, - 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, - 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, - 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, - 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, - 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, - 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, - 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, - 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, - 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, - 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, - 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, - 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, - 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, - 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, - 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, - 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, - 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, - 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, - 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, - 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, - 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, - 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, - 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, - 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, - 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, - 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, - 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, - 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, - 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, - 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, - 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, - 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, - 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, - 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, - 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, - 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, - 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, - 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, - 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0xff, 0x00, + 0xff, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0d, 0x00, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 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, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, + 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, + 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, + 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, + 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, + 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, + 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, + 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, + 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, + 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, + 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, + 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, + 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, + 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, + 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, + 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, + 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, + 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, + 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, + 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, + 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x7c, + 0xc0, 0x80, 0xc0, 0x1c, 0xc0, 0x20, 0xc0, 0x00, 0xc1, 0x10, 0xc0, 0x18, 0xc0, 0xf4, 0xc0, 0x0c, + 0xc0, 0x24, 0xc0, 0x28, 0xc0, 0x2c, 0xc0, 0x30, 0xc0, 0x54, 0xc0, 0x78, 0xc0, 0x50, 0xc0, 0x74, + 0xc0, 0x34, 0xc0, 0x38, 0xc0, 0x40, 0xc0, 0x44, 0xc0, 0x48, 0xc0, 0x3c, 0xc0, 0x14, 0xc0, 0x88, + 0xc0, 0x8c, 0xc0, 0x90, 0xc0, 0x70, 0xc0, 0xfc, 0xc0, 0x6c, 0xc0, 0x58, 0xc0, 0x68, 0xc0, 0x04, + 0xc1, 0x64, 0xc0, 0x60, 0xc0, 0x5c, 0xc0, 0x94, 0xc0, 0x04, 0xc0, 0xa4, 0xc0, 0x9c, 0xc0, 0xa0, + 0xc0, 0xa8, 0xc0, 0xac, 0xc0, 0x98, 0xc0, 0xb0, 0xc0, 0xb4, 0xc0, 0xc8, 0xc0, 0xcc, 0xc0, 0xd4, + 0xc0, 0xdc, 0xc0, 0xd8, 0xc0, 0x00, 0xc0, 0x08, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, 0xc0, 0x84, + 0xc0, 0x00, 0x3c, 0x21, 0x47, 0x0b, 0x52, 0x16, 0x5d, 0x01, 0x2c, 0x0a, 0x10, 0x04, 0x0b, 0x1e, + 0x0e, 0x04, 0x16, 0x1e, 0x0e, 0x03, 0x21, 0x0a, 0x0e, 0x0a, 0x21, 0x1e, 0x0e, 0x0a, 0x16, 0x1e, + 0x18, 0x09, 0x16, 0x0a, 0x0e, 0x02, 0x21, 0x00, 0x0e, 0x02, 0x16, 0x00, 0x0e, 0x06, 0x0b, 0x1e, + 0x0e, 0x07, 0x0b, 0x14, 0x12, 0x07, 0x00, 0x14, 0x12, 0x07, 0x00, 0x1e, 0x12, 0x37, 0x2c, 0x00, + 0x0e, 0x05, 0x16, 0x1e, 0x0e, 0x08, 0x00, 0x0a, 0x12, 0x08, 0x0b, 0x0a, 0x12, 0x08, 0x16, 0x0a, + 0x12, 0x08, 0x21, 0x0a, 0x12, 0x08, 0x21, 0x14, 0x12, 0x08, 0x21, 0x1e, 0x12, 0x08, 0x21, 0x28, + 0x12, 0x08, 0x16, 0x28, 0x12, 0x08, 0x0b, 0x28, 0x12, 0x15, 0x2c, 0x14, 0x12, 0xff, 0x2e, 0x05, + 0x2f, 0x05, 0x33, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x46, 0x05, 0x2e, 0x05, 0x4d, 0x05, + 0x5d, 0x05, 0x64, 0x05, 0x68, 0x05, 0x6c, 0x05, 0x70, 0x05, 0x7d, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x9f, 0x05, 0x2e, 0x05, 0xb5, 0x05, 0xd4, 0x05, 0x2e, 0x05, + 0xe1, 0x05, 0xf7, 0x05, 0x0d, 0x06, 0x26, 0x06, 0x39, 0x06, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x49, 0x06, 0x50, 0x06, 0x75, 0x06, 0x2e, 0x05, + 0x2e, 0x05, 0x2e, 0x05, 0x2e, 0x05, 0x82, 0x06, 0x86, 0x06, 0x2e, 0x05, 0x8d, 0x06, 0xff, 0x0f, + 0x01, 0x01, 0xff, 0x0c, 0x05, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x23, 0x00, 0x11, 0x32, 0x00, 0x12, + 0x67, 0x00, 0x13, 0x6c, 0x00, 0xff, 0x12, 0x13, 0x00, 0x13, 0x17, 0x00, 0xff, 0x0c, 0x33, 0x00, + 0x0d, 0x35, 0x00, 0x0e, 0x0e, 0x00, 0x0f, 0x14, 0x00, 0x00, 0x4e, 0x00, 0xff, 0x0c, 0x77, 0x00, + 0x0c, 0x91, 0x00, 0xff, 0x0d, 0x10, 0x00, 0xff, 0x0d, 0x14, 0x00, 0xff, 0x0e, 0x10, 0x00, 0xff, + 0x0f, 0x04, 0x00, 0x10, 0x08, 0x00, 0x11, 0x86, 0x00, 0x12, 0x99, 0x00, 0xff, 0x0d, 0x6c, 0x00, + 0x0f, 0x46, 0x01, 0x0f, 0x4b, 0x01, 0x0f, 0x50, 0x01, 0x0f, 0x56, 0x01, 0x0f, 0x5c, 0x01, 0x0f, + 0x62, 0x01, 0x12, 0x9f, 0x00, 0x12, 0xb2, 0x00, 0x93, 0xd9, 0x00, 0x54, 0xe4, 0x00, 0xff, 0x0d, + 0x14, 0x00, 0x0d, 0x15, 0x00, 0x0f, 0x22, 0x00, 0x0d, 0x34, 0x00, 0x0d, 0x37, 0x00, 0x19, 0x39, + 0x00, 0x15, 0x49, 0x00, 0xff, 0x0d, 0xc4, 0x00, 0x0d, 0xea, 0x00, 0x0d, 0x9c, 0x00, 0x0e, 0x81, + 0x00, 0x0d, 0x7c, 0x00, 0x0f, 0xa2, 0x00, 0x0f, 0xc8, 0x00, 0x0f, 0xef, 0x00, 0x11, 0x63, 0x00, + 0x0c, 0x34, 0x00, 0xff, 0x0f, 0x38, 0x00, 0x10, 0x40, 0x00, 0x13, 0x16, 0x00, 0x14, 0x21, 0x00, + 0xff, 0x14, 0x0b, 0x00, 0x14, 0x0f, 0x00, 0x0f, 0x1c, 0x00, 0x0d, 0x50, 0x00, 0x15, 0x52, 0x00, + 0x93, 0x57, 0x00, 0x57, 0x80, 0x00, 0xff, 0x0c, 0x0d, 0x00, 0x0e, 0x27, 0x00, 0x0c, 0x43, 0x00, + 0x0c, 0x4b, 0x00, 0x0c, 0x53, 0x00, 0x0c, 0x5b, 0x00, 0x0f, 0x66, 0x00, 0xff, 0x16, 0x24, 0x00, + 0x0d, 0x7d, 0x00, 0x12, 0x58, 0x00, 0x0f, 0x6b, 0x00, 0x0e, 0x7f, 0x00, 0x0e, 0x9a, 0x00, 0x93, + 0xaa, 0x00, 0x57, 0xe8, 0x00, 0xff, 0x15, 0x10, 0x00, 0x15, 0x48, 0x00, 0x15, 0xcd, 0x00, 0x16, + 0x3f, 0x00, 0x97, 0x63, 0x00, 0x58, 0x9e, 0x00, 0xff, 0x0d, 0x15, 0x00, 0x0e, 0x18, 0x00, 0x93, + 0x32, 0x00, 0x57, 0x4b, 0x00, 0x18, 0x80, 0x00, 0xff, 0x53, 0x2e, 0x00, 0x10, 0xa7, 0x00, 0xff, + 0x10, 0x13, 0x00, 0x0e, 0x24, 0x00, 0x10, 0x32, 0x00, 0x0e, 0x41, 0x00, 0x10, 0x51, 0x00, 0x0e, + 0x60, 0x00, 0x10, 0x72, 0x00, 0x0e, 0x81, 0x00, 0x10, 0x93, 0x00, 0x0e, 0xa2, 0x00, 0x10, 0xb1, + 0x00, 0x0e, 0xbf, 0x00, 0xff, 0x0d, 0x30, 0x00, 0x0e, 0x29, 0x00, 0x0f, 0x4e, 0x00, 0x10, 0x5c, + 0x00, 0xff, 0x10, 0x73, 0x00, 0xff, 0x15, 0x67, 0x00, 0x14, 0xc7, 0x00, 0xff, 0x11, 0x35, 0x00, + 0x11, 0x36, 0x00, 0x11, 0x37, 0x00, 0x11, 0x38, 0x00, 0x11, 0x39, 0x00, 0x11, 0x3a, 0x00, 0x11, + 0x3b, 0x00, 0x11, 0x3d, 0x00, 0x11, 0x3f, 0x00, 0x11, 0x40, 0x00, 0x11, 0x41, 0x00, 0xff, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, + 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, + 0x99, 0x9f, 0x9e, 0x9c, 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9e, 0x9c, + 0x9a, 0x9f, 0x9a, 0x9c, 0x9e, 0xa0, 0x9b, 0x9d, 0x99, 0x9f, 0x9c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x53, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x53, 0x30, 0x32, 0x00, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x2e, 0x44, 0x41, 0x54, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x30, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x43, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x56, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, + 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x47, 0x30, 0x38, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, + 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x37, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x47, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x47, 0x31, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x31, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x30, 0x32, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x54, 0x31, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x31, + 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x30, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x32, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x54, 0x32, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, + 0x32, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x30, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x35, 0x31, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x54, 0x38, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x54, 0x38, 0x32, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x33, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x54, 0x38, 0x34, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x47, 0x30, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x47, 0x31, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, + 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x32, 0x00, 0x44, + 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x33, 0x00, 0x44, 0x52, 0x45, 0x41, + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x2e, 0x49, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, + 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x32, 0x00, + 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x33, 0x00, 0x44, 0x52, 0x45, + 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x49, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x49, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x49, 0x30, 0x37, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x50, 0x41, 0x4c, 0x00, 0x11, 0x01, + 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0x04, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2c, 0x00, + 0x80, 0xc5, 0xd2, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x2c, 0x00, 0xdc, 0xc3, 0x90, 0x00, 0xb0, 0x00, + 0x40, 0x00, 0x60, 0x00, 0x80, 0xc3, 0x00, 0x00, 0x32, 0x00, 0x32, 0x00, 0xc8, 0x00, 0x84, 0xc3, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, + 0x9d, 0x00, 0xc6, 0x00, 0x44, 0xc3, 0xff, 0x00, 0x26, 0x01, 0x00, 0x00, 0x18, 0x00, 0xc8, 0xc3, + 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, 0x00, 0x01, 0x9e, 0x00, + 0xca, 0x00, 0xe0, 0xc3, 0x50, 0x00, 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0x98, 0xc3, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, + 0xc6, 0x00, 0x44, 0xc3, 0xf7, 0x00, 0x2d, 0x01, 0x28, 0x00, 0x38, 0x00, 0x48, 0xc3, 0x50, 0x00, + 0x2c, 0x01, 0x3a, 0x00, 0x92, 0x00, 0xbc, 0xc6, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0xf0, 0x00, + 0x22, 0x01, 0x02, 0x00, 0x2c, 0x00, 0x94, 0xc4, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xee, 0x00, 0x02, 0x01, 0x04, 0x00, + 0x2c, 0x00, 0xc8, 0xc4, 0x68, 0x00, 0x7c, 0x00, 0x04, 0x00, 0x2c, 0x00, 0xcc, 0xc4, 0x18, 0x01, + 0x34, 0x01, 0x04, 0x00, 0x2c, 0x00, 0xb0, 0xc4, 0x68, 0x00, 0xd8, 0x00, 0x8a, 0x00, 0xc0, 0x00, + 0xd0, 0xc4, 0x11, 0x01, 0x40, 0x01, 0x9d, 0x00, 0xc6, 0x00, 0x7c, 0xc4, 0x00, 0x00, 0x40, 0x01, + 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, + 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, + 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, + 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, + 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x4e, 0x45, 0x54, 0x57, 0xe8, 0xc4, 0x45, 0x4c, + 0x56, 0x41, 0x8c, 0xc6, 0x45, 0x4c, 0x56, 0x42, 0x9c, 0xc6, 0x45, 0x4c, 0x56, 0x43, 0x94, 0xc6, + 0x45, 0x4c, 0x56, 0x45, 0x98, 0xc6, 0x45, 0x4c, 0x56, 0x46, 0xa0, 0xc6, 0x43, 0x47, 0x41, 0x54, + 0x30, 0xc7, 0x52, 0x45, 0x4d, 0x4f, 0xa8, 0xc6, 0x42, 0x55, 0x54, 0x41, 0x3c, 0xc7, 0x43, 0x42, + 0x4f, 0x58, 0x44, 0xc7, 0x4c, 0x49, 0x54, 0x45, 0x5c, 0xc6, 0x50, 0x4c, 0x41, 0x54, 0x40, 0xc7, + 0x4c, 0x49, 0x46, 0x54, 0x7c, 0xc6, 0x57, 0x49, 0x52, 0x45, 0x84, 0xc6, 0x48, 0x4e, 0x44, 0x4c, + 0x88, 0xc6, 0x48, 0x41, 0x43, 0x48, 0x80, 0xc6, 0x44, 0x4f, 0x4f, 0x52, 0xb4, 0xc6, 0x43, 0x53, + 0x48, 0x52, 0x70, 0xc6, 0x47, 0x55, 0x4e, 0x41, 0x34, 0xc7, 0x43, 0x52, 0x41, 0x41, 0x64, 0xc6, + 0x43, 0x52, 0x42, 0x42, 0x68, 0xc6, 0x43, 0x52, 0x43, 0x43, 0x6c, 0xc6, 0x53, 0x45, 0x41, 0x54, + 0xf8, 0xc5, 0x4d, 0x45, 0x4e, 0x55, 0x98, 0xc7, 0x43, 0x4f, 0x4f, 0x4b, 0xac, 0xc6, 0x45, 0x4c, + 0x43, 0x41, 0x4c, 0xc6, 0x45, 0x44, 0x43, 0x41, 0x50, 0xc6, 0x44, 0x44, 0x43, 0x41, 0x54, 0xc6, + 0x41, 0x4c, 0x54, 0x52, 0x04, 0xc6, 0x4c, 0x4f, 0x4b, 0x41, 0x3c, 0xc6, 0x4c, 0x4f, 0x4b, 0x42, + 0x40, 0xc6, 0x45, 0x4e, 0x54, 0x41, 0x10, 0xc6, 0x45, 0x4e, 0x54, 0x42, 0x24, 0xc6, 0x45, 0x4e, + 0x54, 0x45, 0x28, 0xc6, 0x45, 0x4e, 0x54, 0x43, 0x18, 0xc6, 0x45, 0x4e, 0x54, 0x44, 0x2c, 0xc6, + 0x45, 0x4e, 0x54, 0x48, 0x30, 0xc6, 0x57, 0x57, 0x41, 0x54, 0xf0, 0xc5, 0x50, 0x4f, 0x4f, 0x4c, + 0x58, 0xc6, 0x57, 0x53, 0x48, 0x44, 0xf4, 0xc5, 0x47, 0x52, 0x41, 0x46, 0x44, 0xc6, 0x54, 0x52, + 0x41, 0x50, 0x48, 0xc6, 0x43, 0x44, 0x50, 0x45, 0x28, 0xc7, 0x44, 0x4c, 0x4f, 0x4b, 0x08, 0xc6, + 0x48, 0x4f, 0x4c, 0x45, 0x00, 0xc6, 0x44, 0x52, 0x59, 0x52, 0x0c, 0xc6, 0x48, 0x4f, 0x4c, 0x59, + 0xfc, 0xc5, 0x57, 0x41, 0x4c, 0x4c, 0x2c, 0xc7, 0x42, 0x4f, 0x4f, 0x4b, 0x08, 0xc8, 0x41, 0x58, + 0x45, 0x44, 0xb0, 0xc6, 0x53, 0x48, 0x4c, 0x44, 0x38, 0xc7, 0x42, 0x43, 0x4e, 0x59, 0xe8, 0xc5, + 0x4c, 0x49, 0x44, 0x43, 0xe4, 0xc5, 0x4c, 0x49, 0x44, 0x55, 0xe0, 0xc5, 0x4c, 0x49, 0x44, 0x4f, + 0xec, 0xc5, 0x50, 0x49, 0x50, 0x45, 0xa8, 0xc5, 0x42, 0x41, 0x4c, 0x43, 0x20, 0xc6, 0x57, 0x49, + 0x4e, 0x44, 0x1c, 0xc6, 0x50, 0x41, 0x50, 0x52, 0xb4, 0xc7, 0x55, 0x57, 0x54, 0x41, 0xa0, 0xc5, + 0x55, 0x57, 0x54, 0x42, 0xa0, 0xc5, 0x53, 0x54, 0x41, 0x54, 0xd8, 0xc7, 0x54, 0x4c, 0x49, 0x44, + 0x9c, 0xc5, 0x53, 0x4c, 0x41, 0x42, 0xd8, 0xc5, 0x43, 0x41, 0x52, 0x54, 0xdc, 0xc5, 0x46, 0x43, + 0x41, 0x52, 0xac, 0xc5, 0x53, 0x4c, 0x42, 0x41, 0xc0, 0xc5, 0x53, 0x4c, 0x42, 0x42, 0xc4, 0xc5, + 0x53, 0x4c, 0x42, 0x43, 0xcc, 0xc5, 0x53, 0x4c, 0x42, 0x44, 0xc8, 0xc5, 0x53, 0x4c, 0x42, 0x45, + 0xd0, 0xc5, 0x53, 0x4c, 0x42, 0x46, 0xd4, 0xc5, 0x50, 0x4c, 0x49, 0x4e, 0xb0, 0xc5, 0x4c, 0x41, + 0x44, 0x44, 0xb8, 0xc5, 0x4c, 0x41, 0x44, 0x42, 0xbc, 0xc5, 0x47, 0x55, 0x4d, 0x41, 0xb4, 0xc5, + 0x53, 0x51, 0x45, 0x45, 0x88, 0xc5, 0x54, 0x41, 0x50, 0x50, 0x8c, 0xc5, 0x47, 0x55, 0x49, 0x54, + 0x90, 0xc5, 0x43, 0x4f, 0x4e, 0x54, 0x94, 0xc5, 0x42, 0x45, 0x4c, 0x4c, 0x98, 0xc5, 0x8c, 0x8c, + 0x8c, 0x8c, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x9d, 0x00, 0xb2, 0x00, 0x51, 0x00, + 0x5e, 0x00, 0x58, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x5c, 0xc7, 0xc9, 0x00, + 0xde, 0x00, 0x51, 0x00, 0x5e, 0x00, 0x60, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x5f, 0x00, 0x70, 0x00, + 0x64, 0xc7, 0xb3, 0x00, 0xc8, 0x00, 0x5f, 0x00, 0x70, 0x00, 0x68, 0xc7, 0xc9, 0x00, 0xde, 0x00, + 0x5f, 0x00, 0x70, 0x00, 0x6c, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x71, 0x00, 0x82, 0x00, 0x70, 0xc7, + 0xb3, 0x00, 0xc8, 0x00, 0x71, 0x00, 0x82, 0x00, 0x74, 0xc7, 0xc9, 0x00, 0xde, 0x00, 0x71, 0x00, + 0x82, 0x00, 0x78, 0xc7, 0x9d, 0x00, 0xb2, 0x00, 0x83, 0x00, 0x91, 0x00, 0x7c, 0xc7, 0xb3, 0x00, + 0xde, 0x00, 0x83, 0x00, 0x91, 0x00, 0x80, 0xc7, 0xdc, 0x00, 0xea, 0x00, 0x98, 0x00, 0xa6, 0x00, + 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xae, 0x00, + 0xbc, 0x00, 0x84, 0x00, 0x94, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0x18, 0x01, 0x40, 0x01, 0xa0, 0x00, 0xc8, 0x00, 0x50, 0xc7, 0x8f, 0x00, + 0x2c, 0x01, 0x06, 0x00, 0xc2, 0x00, 0xb8, 0xc7, 0x00, 0x00, 0x8f, 0x00, 0x06, 0x00, 0xc2, 0x00, + 0xc0, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x68, 0x00, + 0x80, 0x00, 0x3a, 0x00, 0x48, 0x00, 0xdc, 0xc7, 0x40, 0x00, 0x74, 0x00, 0x4c, 0x00, 0x6a, 0x00, + 0xe0, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x4c, 0x00, 0x6a, 0x00, 0xe4, 0xc7, 0x40, 0x00, 0x74, 0x00, + 0x6a, 0x00, 0x88, 0x00, 0xe8, 0xc7, 0x74, 0x00, 0xa8, 0x00, 0x6a, 0x00, 0x88, 0x00, 0xec, 0xc7, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0xba, 0x00, 0xca, 0x00, + 0x9d, 0x00, 0xad, 0x00, 0x1c, 0xc8, 0xf3, 0x00, 0x03, 0x01, 0x83, 0x00, 0x93, 0x00, 0x18, 0xc8, + 0x0c, 0x01, 0x1c, 0x01, 0xa8, 0x00, 0xb8, 0x00, 0x50, 0xc7, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, + 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, 0x80, 0x00, 0x34, 0xc8, + 0x46, 0x00, 0x89, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x44, 0x00, + 0x98, 0x00, 0x4c, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, + 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, 0xfa, 0x00, 0x40, 0x00, + 0x98, 0x00, 0x58, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, 0x74, 0xc8, 0x00, 0x00, + 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x77, 0x00, 0xae, 0x00, 0x52, 0x00, + 0x80, 0x00, 0x44, 0xc8, 0x46, 0x00, 0x8b, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0x50, 0xc8, 0xec, 0x00, + 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, + 0xa0, 0xca, 0xff, 0xff, 0xec, 0x00, 0xfc, 0x00, 0x70, 0x00, 0x80, 0x00, 0x48, 0xc8, 0xbc, 0x00, + 0xfa, 0x00, 0x40, 0x00, 0x98, 0x00, 0x54, 0xc8, 0x3e, 0x00, 0x98, 0x00, 0x38, 0x00, 0x85, 0x00, + 0x74, 0xc8, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, 0x45, 0x78, 0x70, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x2e, 0x0d, 0x0a, 0x0d, + 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, + 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, + 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x72, 0x64, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x20, 0x48, 0x65, 0x78, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x4f, + 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x42, 0x61, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, + 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x3a, 0x0d, 0x0a, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x44, 0x65, 0x61, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x2e, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x41, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x20, 0x35, 0x39, 0x30, 0x4b, 0x20, 0x6f, 0x66, + 0x20, 0x62, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, + 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, + 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, + 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x75, 0x70, 0x74, 0x20, 0x30, 0x0d, + 0x0a, 0x0d, 0x0a, 0x24, 0x0d, 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, + 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, + 0x55, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x20, 0x45, 0x4d, 0x4d, 0x20, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x0d, + 0x0a, 0x0d, 0x0a, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x68, 0x61, 0x73, 0x20, + 0x61, 0x6e, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x0d, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x63, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x42, 0x6c, 0x61, 0x73, 0x74, 0x65, 0x72, + 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x0d, + 0x0a, 0x74, 0x68, 0x65, 0x20, 0x42, 0x4c, 0x41, 0x53, 0x54, 0x45, 0x52, 0x20, 0x65, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x20, 0x28, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x55, 0x54, 0x4f, 0x45, + 0x58, 0x45, 0x43, 0x2e, 0x42, 0x41, 0x54, 0x29, 0x0d, 0x0a, 0x0d, 0x0a, 0x49, 0x66, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, + 0x20, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, + 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, + 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0d, 0x0a, + 0x0d, 0x0a, 0x54, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, + 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x0d, 0x0a, 0x6f, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0d, + 0x0a, 0x0d, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x49, 0x37, 0x20, 0x41, 0x32, 0x32, 0x30, 0x20, 0x44, 0x31, 0x20, 0x20, + 0x20, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, + 0x62, 0x20, 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x37, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x20, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x61, + 0x73, 0x65, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x32, 0x32, 0x30, 0x68, 0x0d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, + 0x42, 0x20, 0x49, 0x35, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x77, 0x65, 0x62, 0x20, + 0x6f, 0x6e, 0x20, 0x49, 0x52, 0x51, 0x20, 0x35, 0x20, 0x61, 0x6e, 0x64, 0x0d, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, + 0x32, 0x32, 0x30, 0x68, 0x2c, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, + 0x0d, 0x0a, 0x0d, 0x0a, 0x54, 0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x72, 0x65, 0x61, + 0x6d, 0x77, 0x65, 0x62, 0x20, 0x43, 0x44, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, + 0x73, 0x74, 0x65, 0x72, 0x65, 0x6f, 0x2e, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x0d, 0x0a, 0x0d, 0x0a, + 0x24, 0x81, 0x00, 0xb8, 0x00, 0x52, 0x00, 0x80, 0x00, 0xc0, 0xc8, 0x50, 0x00, 0x93, 0x00, 0x3e, + 0x00, 0x6f, 0x00, 0x80, 0xc8, 0xb7, 0x00, 0xfa, 0x00, 0x3e, 0x00, 0x6f, 0x00, 0xc4, 0xc8, 0x00, + 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xa0, 0xca, 0xff, 0xff, 0x53, 0x50, 0x45, 0x45, 0x43, + 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x87, 0x83, + 0x81, 0x82, 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, + 0x00, 0x00, 0xb4, 0x00, 0x7c, 0xc3, 0xe2, 0x00, 0xf4, 0x00, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, + 0xe2, 0x00, 0xf4, 0x00, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, + 0x7c, 0x00, 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, + 0x2c, 0x00, 0x46, 0x00, 0x20, 0x00, 0x2e, 0x00, 0x70, 0xc4, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, + 0xb4, 0x00, 0x7c, 0xc3, 0x12, 0x01, 0x24, 0x01, 0x0a, 0x00, 0x1a, 0x00, 0x28, 0xc8, 0x12, 0x01, + 0x24, 0x01, 0x1a, 0x00, 0x28, 0x00, 0x2c, 0xc8, 0xf0, 0x00, 0x04, 0x01, 0x64, 0x00, 0x7c, 0x00, + 0xcc, 0xc9, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xc8, 0x00, 0xd4, 0xc9, 0xff, 0xff, 0x00, 0x21, + 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x0a, 0x0f, 0xff, 0x00, 0x16, 0x00, 0x0f, 0xff, 0x00, 0x0b, 0x00, + 0x0f, 0xff, 0x00, 0x0b, 0x0a, 0x0f, 0xff, 0x00, 0x00, 0x0a, 0x0f, 0xff, 0x01, 0x2c, 0x0a, 0x06, + 0xff, 0x01, 0x2c, 0x00, 0x0d, 0xff, 0x02, 0x21, 0x00, 0x06, 0xff, 0x02, 0x16, 0x00, 0x05, 0xff, + 0x02, 0x16, 0x0a, 0x10, 0xff, 0x02, 0x0b, 0x0a, 0x10, 0xff, 0x03, 0x2c, 0x00, 0x0f, 0xff, 0x03, + 0x21, 0x0a, 0x06, 0xff, 0x03, 0x21, 0x00, 0x05, 0xff, 0x04, 0x0b, 0x1e, 0x06, 0xff, 0x04, 0x16, + 0x1e, 0x05, 0xff, 0x04, 0x16, 0x14, 0x0d, 0xff, 0x0a, 0x21, 0x1e, 0x06, 0xff, 0x0a, 0x16, 0x1e, + 0x06, 0xff, 0x09, 0x16, 0x0a, 0x06, 0xff, 0x09, 0x16, 0x14, 0x10, 0xff, 0x09, 0x16, 0x1e, 0x10, + 0xff, 0x09, 0x16, 0x28, 0x10, 0xff, 0x09, 0x16, 0x32, 0x10, 0xff, 0x06, 0x0b, 0x1e, 0x06, 0xff, + 0x06, 0x00, 0x0a, 0x0f, 0xff, 0x06, 0x00, 0x14, 0x0f, 0xff, 0x06, 0x0b, 0x14, 0x0f, 0xff, 0x06, + 0x16, 0x14, 0x0f, 0xff, 0x07, 0x0b, 0x14, 0x06, 0xff, 0x07, 0x00, 0x14, 0x06, 0xff, 0x07, 0x00, + 0x1e, 0x06, 0xff, 0x37, 0x2c, 0x00, 0x05, 0xff, 0x37, 0x2c, 0x0a, 0x05, 0xff, 0x05, 0x16, 0x1e, + 0x06, 0xff, 0x05, 0x16, 0x14, 0x0f, 0xff, 0x05, 0x16, 0x0a, 0x0f, 0xff, 0x18, 0x16, 0x00, 0x0f, + 0xff, 0x18, 0x21, 0x00, 0x0f, 0xff, 0x18, 0x2c, 0x00, 0x0f, 0xff, 0x18, 0x21, 0x0a, 0x0f, 0xff, + 0x08, 0x00, 0x0a, 0x06, 0xff, 0x08, 0x0b, 0x0a, 0x06, 0xff, 0x08, 0x16, 0x0a, 0x06, 0xff, 0x08, + 0x21, 0x0a, 0x06, 0xff, 0x08, 0x21, 0x14, 0x06, 0xff, 0x08, 0x21, 0x1e, 0x06, 0xff, 0x08, 0x21, + 0x28, 0x06, 0xff, 0x08, 0x16, 0x28, 0x06, 0xff, 0x08, 0x0b, 0x28, 0x06, 0xff, 0x0b, 0x0b, 0x14, + 0x0c, 0xff, 0x0b, 0x0b, 0x1e, 0x0c, 0xff, 0x0b, 0x16, 0x14, 0x0c, 0xff, 0x0b, 0x16, 0x1e, 0x0c, + 0xff, 0x0c, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x16, 0x14, 0x0c, 0xff, 0x0d, 0x21, 0x14, 0x0c, 0xff, + 0x0e, 0x2c, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x00, 0x0c, 0xff, 0x0e, 0x21, 0x0a, 0x0c, 0xff, 0x0e, + 0x21, 0x14, 0x0c, 0xff, 0x0e, 0x21, 0x1e, 0x0c, 0xff, 0x0e, 0x21, 0x28, 0x0c, 0xff, 0x0e, 0x16, + 0x00, 0x10, 0xff, 0x13, 0x00, 0x00, 0x0c, 0xff, 0x14, 0x00, 0x14, 0x10, 0xff, 0x14, 0x00, 0x1e, + 0x10, 0xff, 0x14, 0x0b, 0x1e, 0x10, 0xff, 0x14, 0x00, 0x28, 0x10, 0xff, 0x14, 0x0b, 0x28, 0x10, + 0xff, 0x15, 0x0b, 0x0a, 0x0f, 0xff, 0x15, 0x0b, 0x14, 0x0f, 0xff, 0x15, 0x00, 0x14, 0x0f, 0xff, + 0x15, 0x16, 0x14, 0x0f, 0xff, 0x15, 0x21, 0x14, 0x0f, 0xff, 0x15, 0x2c, 0x14, 0x0f, 0xff, 0x15, + 0x2c, 0x0a, 0x0f, 0xff, 0x16, 0x16, 0x0a, 0x10, 0xff, 0x16, 0x16, 0x14, 0x10, 0xff, 0x17, 0x16, + 0x1e, 0x0d, 0xff, 0x17, 0x16, 0x28, 0x0d, 0xff, 0x17, 0x21, 0x28, 0x0d, 0xff, 0x17, 0x0b, 0x28, + 0x0d, 0xff, 0x17, 0x00, 0x28, 0x0d, 0xff, 0x17, 0x00, 0x32, 0x0d, 0xff, 0x19, 0x0b, 0x28, 0x10, + 0xff, 0x19, 0x0b, 0x32, 0x10, 0xff, 0x19, 0x00, 0x32, 0x10, 0xff, 0x1b, 0x0b, 0x14, 0x10, 0xff, + 0x1b, 0x0b, 0x1e, 0x10, 0xff, 0x1d, 0x0b, 0x0a, 0x10, 0xff, 0x2d, 0x16, 0x1e, 0x0c, 0xff, 0x2d, + 0x16, 0x28, 0x0c, 0xff, 0x2d, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x28, 0x0c, 0xff, 0x2e, 0x0b, + 0x32, 0x0c, 0xff, 0x2e, 0x16, 0x32, 0x0c, 0xff, 0x2e, 0x21, 0x32, 0x0c, 0xff, 0x2f, 0x00, 0x00, + 0x0c, 0xff, 0x1a, 0x16, 0x14, 0x10, 0xff, 0x1a, 0x21, 0x0a, 0x10, 0xff, 0x1a, 0x21, 0x14, 0x10, + 0xff, 0x1a, 0x21, 0x1e, 0x10, 0xff, 0x1a, 0x2c, 0x1e, 0x10, 0xff, 0x1a, 0x16, 0x1e, 0x10, 0xff, + 0x1a, 0x0b, 0x1e, 0x10, 0xff, 0x1a, 0x0b, 0x14, 0x10, 0xff, 0x1a, 0x00, 0x14, 0x10, 0xff, 0x1a, + 0x0b, 0x28, 0x10, 0xff, 0x1a, 0x00, 0x28, 0x10, 0xff, 0x1a, 0x16, 0x28, 0x10, 0xff, 0x1a, 0x0b, + 0x32, 0x10, 0xff, 0x1c, 0x00, 0x1e, 0x0f, 0xff, 0x1c, 0x00, 0x14, 0x0f, 0xff, 0x1c, 0x00, 0x28, + 0x0f, 0xff, 0x1c, 0x0b, 0x1e, 0x0f, 0xff, 0x1c, 0x0b, 0x14, 0x0f, 0xff, 0x1c, 0x16, 0x1e, 0x0f, + 0xff, 0x1c, 0x16, 0x14, 0x0f, 0xff, 0xff, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 0x41, + 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, + 0x37, 0x38, 0x39, 0x30, 0x2d, 0x00, 0x08, 0x00, 0x51, 0x57, 0x45, 0x52, 0x54, 0x59, 0x55, 0x49, + 0x4f, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x41, 0x53, 0x44, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x3a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x43, 0x4f, + 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31, 0x39, 0x39, 0x32, 0x20, 0x43, 0x52, 0x45, + 0x41, 0x54, 0x49, 0x56, 0x45, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x30, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x07, 0x02, 0xff, 0xff, 0xff, 0xff, 0x06, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x32, 0x00, 0x02, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x03, 0xff, 0xff, 0xff, 0x02, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x21, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0x00, 0x02, 0x04, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x00, 0x05, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0x00, 0x04, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x36, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x02, 0xff, 0x00, 0xff, 0xff, 0xff, 0x06, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x37, 0x00, 0xff, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x07, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x00, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0x28, 0x00, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x39, 0x00, 0x09, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x06, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x09, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x21, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x00, 0xff, 0xff, 0x02, 0x02, 0x04, 0x16, 0x1e, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x33, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x34, 0x00, 0x0e, 0xff, 0x2c, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x30, 0x00, 0x16, 0xff, 0x00, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x33, 0x00, 0x17, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x35, 0x00, 0x16, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x37, 0x00, 0x16, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x39, 0x00, 0x16, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x35, 0x00, 0x05, 0xff, 0x16, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x01, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x34, 0x00, 0x17, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x30, 0x00, 0x0a, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x32, 0x00, 0x0c, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x33, 0x00, 0x05, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x06, 0x02, 0xff, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x34, 0x00, 0x05, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x03, 0x18, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x32, 0x00, 0x16, 0xff, 0x16, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x16, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x31, 0x00, 0x0b, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x38, 0x00, 0x05, 0xff, 0x0b, 0x14, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x31, 0x00, 0x05, 0xff, 0x0b, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x04, 0x02, 0x0f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x32, 0x36, 0x00, 0x09, 0xff, 0x00, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x31, 0x39, 0x00, 0x13, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x02, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x38, 0x00, 0x08, 0xff, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x30, 0x31, 0x00, 0x01, 0xff, 0x2c, 0x0a, 0xff, 0xff, 0xff, 0x00, + 0x03, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x28, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x37, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x35, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2d, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x34, 0x36, 0x00, 0x23, 0xff, 0x16, 0x32, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2e, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x30, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x31, 0x00, 0x23, 0xff, 0x0b, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x32, 0x00, 0x23, 0xff, 0x16, 0x1e, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x33, 0x00, 0x23, 0xff, 0x21, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x34, 0x00, 0x23, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x52, 0x35, 0x35, 0x00, 0x0e, 0xff, 0x2c, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, + 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, + 0x45, 0x42, 0x2e, 0x44, 0x30, 0x30, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, + 0x44, 0x30, 0x31, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x32, + 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x33, 0x00, 0x44, 0x52, + 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x34, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, + 0x57, 0x45, 0x42, 0x2e, 0x44, 0x30, 0x35, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, + 0x2e, 0x44, 0x30, 0x36, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x44, 0x45, + 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); -dreamweb(); +dreamweb(); } void DreamGenContext::__dispatch_call(uint16 addr) { @@ -22719,7 +22710,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case 0xcaf4: readmouse3(); break; case 0xcaf8: readmouse4(); break; case 0xcafc: readkey(); break; - case 0xcb00: convertkey(); break; case 0xcb04: randomnum1(); break; case 0xcb08: randomnum2(); break; case 0xcb10: hangon(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index d7cf4677e3..2d05f9c791 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -600,7 +600,6 @@ public: void clearbuffers(); void neterror(); void storeit(); - void lockeddoorway(); void isitworn(); void putundertimed(); void dumpmap(); @@ -658,7 +657,7 @@ public: void usewall(); void opentomb(); void buttonfour(); - void dosometalk(); + void animpointer(); void lockmon(); void dochange(); void getanyaddir(); @@ -867,7 +866,6 @@ public: void adjustright(); void putunderzoom(); void vsync(); - void showseconduse(); void turnpathoff(); void findinvpos(); void usetext(); @@ -956,9 +954,8 @@ public: void showmonk(); void diarykeyn(); void set16colpalette(); - void convicons(); - void interviewer(); void sparky(); + void interviewer(); void purgeanitem(); void madman(); void createpanel(); @@ -1011,7 +1008,7 @@ public: void getback1(); void setlocation(); void fadefromwhite(); - void animpointer(); + void checksoundint(); void usewindow(); void wearshades(); void onedigit(); @@ -1253,12 +1250,14 @@ public: void usechurchgate(); void monkandryan(); void allocatebuffers(); + void convicons(); void swapwithinv(); void usecontrol(); void buttonseven(); void redrawmainscrn(); void finishedwalking(); void findallryan(); + void lockeddoorway(); void channel0tran(); void buttonpress(); void parseblaster(); @@ -1281,7 +1280,7 @@ public: void showryanpage(); void printlogo(); void allpointer(); - void checksoundint(); + void showseconduse(); void clearreels(); void malefan(); void dosaveload(); @@ -1310,6 +1309,7 @@ public: void emergencypurge(); void usemenu(); void alleybarksound(); + void dosometalk(); void usecart(); void intromusic(); void makename(); -- cgit v1.2.3 From f78d5bc553e1e372b9e21c867e70bd561a8eb1bb Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 20 Jun 2011 20:09:26 +0200 Subject: DREAMWEB: Remove readabyte() and readoneblock() They were only used by the PCX decoder, which was rewritten some time ago to no longer use them. --- devtools/tasmrecover/tasm-recover | 4 +++- engines/dreamweb/dreamgen.cpp | 23 ----------------------- engines/dreamweb/stubs.cpp | 7 ------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 27aeb326c0..96fd6c45fa 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -20,6 +20,8 @@ generator = cpp(context, "DreamGen", blacklist = [ 'printundermon', 'worktoscreen', 'width160', - 'convertkey' + 'convertkey', + 'readabyte', + 'readoneblock' ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2f58230260..9349436ca2 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3877,27 +3877,6 @@ void DreamGenContext::allocatework() { data.word(kWorkspace) = ax; } -void DreamGenContext::readabyte() { - STACK_CHECK; - _cmp(si, 30000); - if (!flags.z()) - goto notendblock; - push(bx); - push(es); - push(di); - push(ds); - push(si); - readoneblock(); - si = pop(); - ds = pop(); - di = pop(); - es = pop(); - bx = pop(); - si = 0; -notendblock: - _lodsb(); -} - void DreamGenContext::loadpalfromiff() { STACK_CHECK; dx = 2481; @@ -22131,8 +22110,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case 0xc1c4: dumpeverything(); break; case 0xc1c8: allocatework(); break; case 0xc1cc: showpcx(); break; - case 0xc1d0: readabyte(); break; - case 0xc1d4: readoneblock(); break; case 0xc1d8: loadpalfromiff(); break; case 0xc1dc: setmode(); break; case 0xc1ec: paneltomap(); break; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index be870aa52f..58f2441791 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -433,13 +433,6 @@ void DreamGenContext::setmode() { initGraphics(320, 200, false); } -void DreamGenContext::readoneblock() { - ds = data.word(kWorkspace); - cx = 30000; - dx = 0; - readfromfile(); -} - void DreamGenContext::showpcx() { Common::String name = getFilename(*this); Common::File pcxFile; -- cgit v1.2.3 From f8a4ccbc658ce5c54679264a18b37d9a1cbe29ca Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 20 Jun 2011 20:16:21 +0200 Subject: DREAMWEB: Use kMaingamepal provided by the tasm-recover This should significantly decrease the risk of mysterious palette bugs in the PCX title cards after regenerating dreamgen.cpp --- engines/dreamweb/stubs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 58f2441791..eebfbeb0d4 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -450,7 +450,7 @@ void DreamGenContext::showpcx() { pcxFile.seek(16, SEEK_SET); es = data.word(kBuffers); - maingamepal = es.ptr(4782, 768); //fixme: hardcoded offset + maingamepal = es.ptr(kMaingamepal, 768); pcxFile.read(maingamepal, 48); memset(maingamepal + 48, 0xff, 720); -- cgit v1.2.3 From 784180ef68a6dca2734bc240991e464ae21f1de9 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 20 Jun 2011 21:32:19 +0300 Subject: GRAPHICS: Cleanup and simplification of some PNG decoder code --- graphics/png.cpp | 77 ++++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/graphics/png.cpp b/graphics/png.cpp index 6eff4b1e47..6ffc53bd92 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -116,59 +116,52 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) { output->create(_unfilteredSurface->w, _unfilteredSurface->h, format); byte *src = (byte *)_unfilteredSurface->pixels; byte a = 0xFF; + byte bpp = _unfilteredSurface->format.bytesPerPixel; if (_header.colorType != kIndexed) { - if (_header.colorType == kTrueColor || _header.colorType == kTrueColorWithAlpha) { - if (_unfilteredSurface->format.bytesPerPixel != 3 && _unfilteredSurface->format.bytesPerPixel != 4) + if (_header.colorType == kTrueColor || + _header.colorType == kTrueColorWithAlpha) { + if (bpp != 3 && bpp != 4) error("Unsupported truecolor PNG format"); - } else if (_header.colorType == kGrayScale || _header.colorType == kGrayScaleWithAlpha) { - if (_unfilteredSurface->format.bytesPerPixel != 1 && _unfilteredSurface->format.bytesPerPixel != 2) + } else if (_header.colorType == kGrayScale || + _header.colorType == kGrayScaleWithAlpha) { + if (bpp != 1 && bpp != 2) error("Unsupported grayscale PNG format"); } for (uint16 i = 0; i < output->h; i++) { for (uint16 j = 0; j < output->w; j++) { - if (format.bytesPerPixel == 2) { // 2bpp - uint16 *dest = ((uint16 *)output->getBasePtr(j, i)); - if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale - if (_transparentColorSpecified) - a = (src[0] == _transparentColor[0]) ? 0 : 0xFF; - *dest = format.ARGBToColor( a, src[0], src[0], src[0]); - } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha - *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]); - } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB - if (_transparentColorSpecified) { - bool isTransparentColor = (src[0] == _transparentColor[0] && - src[1] == _transparentColor[1] && - src[2] == _transparentColor[2]); - a = isTransparentColor ? 0 : 0xFF; - } - *dest = format.ARGBToColor( a, src[0], src[1], src[2]); - } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA - *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]); - } - } else { // 4bpp - uint32 *dest = ((uint32 *)output->getBasePtr(j, i)); - if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale - if (_transparentColorSpecified) - a = (src[0] == _transparentColor[0]) ? 0 : 0xFF; - *dest = format.ARGBToColor( a, src[0], src[0], src[0]); - } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha - *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]); - } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB - if (_transparentColorSpecified) { - bool isTransparentColor = (src[0] == _transparentColor[0] && - src[1] == _transparentColor[1] && - src[2] == _transparentColor[2]); - a = isTransparentColor ? 0 : 0xFF; - } - *dest = format.ARGBToColor( a, src[0], src[1], src[2]); - } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA - *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]); + uint32 result = 0; + + switch (bpp) { + case 1: // Grayscale + if (_transparentColorSpecified) + a = (src[0] == _transparentColor[0]) ? 0 : 0xFF; + result = format.ARGBToColor( a, src[0], src[0], src[0]); + break; + case 2: // Grayscale + alpha + result = format.ARGBToColor(src[1], src[0], src[0], src[0]); + break; + case 3: // RGB + if (_transparentColorSpecified) { + bool isTransparentColor = (src[0] == _transparentColor[0] && + src[1] == _transparentColor[1] && + src[2] == _transparentColor[2]); + a = isTransparentColor ? 0 : 0xFF; } + result = format.ARGBToColor( a, src[0], src[1], src[2]); + break; + case 4: // RGBA + result = format.ARGBToColor(src[3], src[0], src[1], src[2]); + break; } - src += _unfilteredSurface->format.bytesPerPixel; + if (format.bytesPerPixel == 2) // 2bpp + *((uint16 *)output->getBasePtr(j, i)) = (uint16)result; + else // 4bpp + *((uint32 *)output->getBasePtr(j, i)) = result; + + src += bpp; } } } else { -- cgit v1.2.3 From 3f1c42fdf58b16eea6d9811070d0da702261a23f Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 22:42:23 +0100 Subject: I18N: Update German translation --- po/de_DE.po | 219 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 126 insertions(+), 93 deletions(-) diff --git a/po/de_DE.po b/po/de_DE.po index 154c529984..e3053ee989 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-13 22:20+0100\n" -"PO-Revision-Date: 2011-04-24 12:35+0100\n" +"PO-Revision-Date: 2011-06-20 09:45+0100\n" "Last-Translator: Simon Sawatzki \n" "Language-Team: Lothar Serra Mari & Simon Sawatzki " "\n" @@ -522,7 +522,7 @@ msgstr "Suchlauf abgeschlossen!" #: gui/massadd.cpp:246 #, c-format msgid "Discovered %d new games, ignored %d previously added games." -msgstr "" +msgstr "%d neue Spiele gefunden, %d bereits hinzugefügte Spiele ignoriert." #: gui/massadd.cpp:250 #, c-format @@ -530,9 +530,9 @@ msgid "Scanned %d directories ..." msgstr "%d Ordner durchsucht..." #: gui/massadd.cpp:253 -#, fuzzy, c-format +#, c-format msgid "Discovered %d new games, ignored %d previously added games ..." -msgstr "%d neue Spiele gefunden..." +msgstr "%d neue Spiele gefunden, %d bereits hinzugefügte Spiele ignoriert..." #: gui/options.cpp:72 msgid "Never" @@ -582,19 +582,20 @@ msgstr "-" #: gui/options.cpp:372 msgid "Failed to apply some of the graphic options changes:" -msgstr "" +msgstr "Fehler bei einigen Änderungen in Grafikoptionen:" #: gui/options.cpp:384 msgid "the video mode could not be changed." -msgstr "" +msgstr "Grafikmodus konnte nicht geändert werden." #: gui/options.cpp:390 msgid "the fullscreen setting could not be changed" -msgstr "" +msgstr "Vollbildeinstellung konnte nicht geändert werden." #: gui/options.cpp:396 msgid "the aspect ratio setting could not be changed" msgstr "" +"Einstellung für Seitenverhältniskorrektur konnte nicht geändert werden." #: gui/options.cpp:705 msgid "Graphics mode:" @@ -908,9 +909,8 @@ msgid "Language of ScummVM GUI" msgstr "Sprache der ScummVM-Oberfläche" #: gui/options.cpp:1295 -#, fuzzy msgid "You have to restart ScummVM before your changes will take effect." -msgstr "Sie müssen ScummVM neu starten, um die Einstellungen zu übernehmen." +msgstr "Sie müssen ScummVM neu starten, damit die Änderungen wirksam werden." #: gui/options.cpp:1308 msgid "Select directory for savegames" @@ -1119,15 +1119,19 @@ msgstr "Hercules-Gelb" #: engines/advancedDetector.cpp:323 #, c-format msgid "The game in '%s' seems to be unknown." -msgstr "" +msgstr "Das Spiel im Verzeichnis \"%s\" scheint nicht bekannt zu sein." #: engines/advancedDetector.cpp:324 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" +"Bitte berichten Sie die folgenden Daten auf Englisch an das ScummVM-Team " +"sowie" #: engines/advancedDetector.cpp:326 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" +"den Namen des Spiels, das Sie hinzufügen wollten, als auch die Version/" +"Sprache/usw.:" #: engines/advancedDetector.cpp:574 #, c-format @@ -1135,14 +1139,18 @@ msgid "" "Your game version has been detected using filename matching as a variant of %" "s." msgstr "" +"Ihre Spielversion wurde durch Dateinamen-Übereinstimmung als Variante von %s " +"erkannt." #: engines/advancedDetector.cpp:577 msgid "If this is an original and unmodified version, please report any" -msgstr "" +msgstr "Sollte es sich hierbei um eine unmodifizierte Originalversion handeln," #: engines/advancedDetector.cpp:579 msgid "information previously printed by ScummVM to the team." msgstr "" +"so teilen Sie bitte dem Team die von ScummVM zuvor ausgegebenen Daten auf " +"Englisch mit." #: engines/dialogs.cpp:84 msgid "~R~esume" @@ -1198,6 +1206,9 @@ msgid "" "the README for basic information, and for instructions on how to obtain " "further assistance." msgstr "" +"Leider bietet diese Engine keine Spielhilfe. Bitte lesen Sie die LIESMICH-" +"Datei für grundlegende Informationen und Anweisungen dazu, wie man an " +"weitere Hilfe gelangt." #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 @@ -1215,21 +1226,19 @@ msgstr "~T~asten" #: engines/engine.cpp:220 msgid "Could not initialize color format." -msgstr "" +msgstr "Konnte Farbenformat nicht initialisieren." #: engines/engine.cpp:228 -#, fuzzy msgid "Could not switch to video mode: '" -msgstr "Aktueller Videomodus:" +msgstr "Konnte nicht zu Grafikmodus wechseln: '" #: engines/engine.cpp:237 -#, fuzzy msgid "Could not apply aspect ratio setting." -msgstr "Seitenverhältnis anpassen: an/aus" +msgstr "Konnte Einstellung für Seitenverhältniskorrektur nicht anwenden." #: engines/engine.cpp:242 msgid "Could not apply fullscreen setting." -msgstr "" +msgstr "Konnte Einstellung für Vollbildmodus nicht anwenden." #: engines/engine.cpp:342 msgid "" @@ -1239,6 +1248,13 @@ msgid "" "the data files to your hard disk instead.\n" "See the README file for details." msgstr "" +"Sie scheinen dieses Spiel direkt von CD zu\n" +"spielen. Dies kann bekanntermaßen zu Problemen\n" +"führen und es wird deshalb empfohlen, die\n" +"Dateien des Spiels auf die Festplatte zu\n" +"kopieren und von dort aus zu spielen.\n" +"Lesen Sie die LIESMICH-Datei für\n" +"weitere Informationen." #: engines/engine.cpp:353 msgid "" @@ -1248,6 +1264,12 @@ msgid "" "order to listen to the game's music.\n" "See the README file for details." msgstr "" +"Dieses Spiel hat Audio-Titel auf seiner CD.\n" +"Diese Titel müssen von der CD mittels eines\n" +"geeigneten Extrahierungsprogramms für\n" +"Audio-CDs beschafft werden, um diese im\n" +"Spiel hören zu können. Lesen Sie die\n" +"LIESMICH-Datei für weitere Informationen." #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" @@ -1401,7 +1423,6 @@ msgid " since they may cause crashes" msgstr " da dies Abstürze oder fehlerhaftes" #: engines/scumm/help.cpp:110 -#, fuzzy msgid " or incorrect game behavior." msgstr " Spielverhalten verursachen kann." @@ -1788,6 +1809,8 @@ msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" +"Systemeigene MIDI-Ünterstützung erfordert das Roland-Upgrade von LucasArts,\n" +"aber %s fehlt. Stattdessen wird AdLib verwendet." #: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 #, c-format @@ -1864,40 +1887,24 @@ msgstr "Laden" #: engines/agos/animation.cpp:544 #, c-format msgid "Cutscene file '%s' not found!" -msgstr "" +msgstr "Zwischensequenz \"%s\" nicht gefunden!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 #: engines/tinsel/saveload.cpp:468 -#, fuzzy msgid "Failed to load game state from file." -msgstr "" -"Konnte Spielstand nicht aus folgender Datei laden:\n" -"\n" -"%s" +msgstr "Konnte Spielstand aus Datei nicht laden." #: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 -#, fuzzy msgid "Failed to save game state to file." -msgstr "" -"Konnte Spielstand nicht in folgender Datei speichern:\n" -"\n" -"%s" +msgstr "Konnte Spielstand nicht in Datei speichern." #: engines/gob/inter_v5.cpp:107 -#, fuzzy msgid "Failed to delete file." -msgstr "" -"Konnte Spielstand nicht in folgender Datei speichern:\n" -"\n" -"%s" +msgstr "Konnte Datei nicht löschen." #: engines/groovie/script.cpp:417 -#, fuzzy msgid "Failed to save game" -msgstr "" -"Konnte Spielstand nicht in folgender Datei speichern:\n" -"\n" -"%s" +msgstr "Konnte Spielstand nicht speichern." #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -1907,36 +1914,49 @@ msgid "" "General MIDI ones. After all it might happen\n" "that a few tracks will not be correctly played." msgstr "" +"Sie scheinen ein General-MIDI-Gerät zu\n" +"verwenden, aber das Spiel unterstützt nur\n" +"Roland MT-32 MIDI. Es wird versucht, die\n" +"Roland-MT-32-Instrumente denen von General MIDI\n" +"zuzuordnen. Es kann jedoch vorkommen, dass ein\n" +"paar Musikstücke nicht richtig abgespielt werden." #: engines/m4/m4_menus.cpp:138 -#, fuzzy msgid "Save game failed!" -msgstr "Speichern:" +msgstr "Konnte Spielstand nicht speichern!" #: engines/sky/compact.cpp:130 msgid "" "Unable to find \"sky.cpt\" file!\n" "Please download it from www.scummvm.org" msgstr "" +"Konnte \"sky.cpt\" nicht finden!\n" +"Bitte laden Sie die Datei von\n" +"www.scummvm.org herunter." #: engines/sky/compact.cpp:141 msgid "" "The \"sky.cpt\" file has an incorrect size.\n" "Please (re)download it from www.scummvm.org" msgstr "" +"Die Datei \"sky.cpt\" hat eine ungültige Größe.\n" +"Bitte laden Sie diese Datei (erneut) von\n" +"www.scummvm.org herunter." #: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 msgid "DXA cutscenes found but ScummVM has been built without zlib support" msgstr "" +"DXA-Zwischensequenzen gefunden, aber ScummVM wurde ohne Zlib-Unterstützung " +"erstellt." #: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 msgid "MPEG2 cutscenes are no longer supported" -msgstr "" +msgstr "MPEG2-Zwischensequenzen werden nicht mehr unterstützt." #: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 #, c-format msgid "Cutscene '%s' not found" -msgstr "" +msgstr "Zwischensequenz \"%s\" gefunden" #: engines/sword1/control.cpp:863 msgid "" @@ -1948,6 +1968,13 @@ msgid "" "Press OK to convert them now, otherwise you will be asked again the next " "time you start the game.\n" msgstr "" +"ScummVM hat erkannt, dass Sie alte Speicherstände von Baphomets Fluch 1 " +"haben, die umgewandelt werden sollten.\n" +"Das alte Spielstandsformat wird nicht mehr unterstützt, also können Sie " +"diese Speicherstände nicht laden, wenn Sie diese nicht konvertieren.\n" +"\n" +"Klicken Sie auf OK, um diese jetzt umzuwandeln, ansonsten werden Sie erneut " +"gefragt, wenn Sie das nächste Mal dieses Spiel starten.\n" #: engines/sword1/control.cpp:1232 #, c-format @@ -1955,18 +1982,20 @@ msgid "" "Target new save game already exists!\n" "Would you like to keep the old save game (%s) or the new one (%s)?\n" msgstr "" +"Die für den neuen Spielstand vorgesehene Datei existiert bereits!\n" +"Möchten Sie den alten Speicherstand (%s) oder den neuen (%s) behalten?\n" #: engines/sword1/control.cpp:1235 msgid "Keep the old one" -msgstr "" +msgstr "Den alten behalten" #: engines/sword1/control.cpp:1235 msgid "Keep the new one" -msgstr "" +msgstr "Den neuen behalten" #: engines/sword1/logic.cpp:1633 msgid "This is the end of the Broken Sword 1 Demo" -msgstr "" +msgstr "Das ist das Ende der Demo von Broken Sword 1 (Baphomets Fluch 1)." #: engines/parallaction/saveload.cpp:133 #, c-format @@ -1974,16 +2003,16 @@ msgid "" "Can't save game in slot %i\n" "\n" msgstr "" +"Kann Spiel nicht speichern auf Speicherplatz %i\n" +"\n" #: engines/parallaction/saveload.cpp:211 -#, fuzzy msgid "Loading game..." -msgstr "Spiel laden:" +msgstr "Spiel wird geladen..." #: engines/parallaction/saveload.cpp:226 -#, fuzzy msgid "Saving game..." -msgstr "Speichern:" +msgstr "Spiel wird gespeichert..." #: engines/parallaction/saveload.cpp:279 msgid "" @@ -1994,10 +2023,17 @@ msgid "" "\n" "Press OK to convert them now, otherwise you will be asked next time.\n" msgstr "" +"ScummVM hat erkannt, dass Sie alte Speicherstände von Nippon Safes haben, " +"die umbenannt werden sollten.\n" +"Die alten Dateinamen werden nicht mehr unterstützt, also können Sie diese " +"Speicherstände nicht laden, wenn Sie diese nicht konvertieren.\n" +"\n" +"Klicken Sie auf OK, um diese jetzt umzuwandeln, ansonsten werden Sie erneut " +"gefragt, wenn Sie das nächste Mal dieses Spiel starten.\n" #: engines/parallaction/saveload.cpp:326 msgid "ScummVM successfully converted all your savefiles." -msgstr "" +msgstr "ScummVM hat alle Speicherstände erfolgreich umgewandelt." #: engines/parallaction/saveload.cpp:328 msgid "" @@ -2006,6 +2042,9 @@ msgid "" "\n" "Please report to the team." msgstr "" +"ScummVM hat ein paar Warnungen im Konsolenfenster ausgegeben und kann nicht " +"gewährleisten, dass alle Speicherstände umgewandelt wurden.\n" +"\n" #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" @@ -2021,6 +2060,9 @@ msgid "" "The selected audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" +"Das ausgewählte Audiogerät \"%s\" wurde nicht gefunden (könnte " +"beispielsweise ausgeschaltet oder nicht angeschlossen sein). Es wird " +"versucht, auf das nächste verfügbare Gerät zurückzugreifen." #: audio/mididrv.cpp:216 #, c-format @@ -2028,6 +2070,9 @@ msgid "" "The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"Das ausgewählte Audiogerät \"%s\" kann nicht verwendet werden. Schauen Sie " +"für weitere Informationen in der Log-Datei nach. Es wird versucht, auf das " +"nächste verfügbare Gerät zurückzugreifen." #: audio/mididrv.cpp:250 #, c-format @@ -2035,6 +2080,9 @@ msgid "" "The preferred audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" +"Das bevorzugte Audiogerät \"%s\" wurde nicht gefunden (könnte beispielsweise " +"ausgeschaltet oder nicht angeschlossen sein). Es wird versucht, auf das " +"nächste verfügbare Gerät zurückzugreifen." #: audio/mididrv.cpp:265 #, c-format @@ -2042,6 +2090,9 @@ msgid "" "The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"Das bevorzugte Audiogerät \"%s\" kann nicht verwendet werden. Schauen Sie " +"für weitere Informationen in der Log-Datei nach. Es wird versucht, auf das " +"nächste verfügbare Gerät zurückzugreifen." #: audio/null.h:43 msgid "No music" @@ -2064,9 +2115,8 @@ msgid "C64 Audio Emulator" msgstr "C64-Audio-Emulator" #: audio/softsynth/mt32.cpp:329 -#, fuzzy msgid "Initializing MT-32 Emulator" -msgstr "MT-32-Emulator wird gestartet..." +msgstr "MT-32-Emulator wird gestartet" #: audio/softsynth/mt32.cpp:543 msgid "MT-32 Emulator" @@ -2173,14 +2223,12 @@ msgid "Disable power off" msgstr "Stromsparmodus abschalten" #: backends/platform/iphone/osys_events.cpp:338 -#, fuzzy msgid "Mouse-click-and-drag mode enabled." -msgstr "Touchpad-Modus aktiviert." +msgstr "Maus-klick-und-zieh-Modus aktiviert." #: backends/platform/iphone/osys_events.cpp:340 -#, fuzzy msgid "Mouse-click-and-drag mode disabled." -msgstr "Touchpad-Modus ausgeschaltet." +msgstr "Maus-klick-und-zieh-Modus ausgeschaltet." #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." @@ -2201,26 +2249,22 @@ msgstr "Normal ohn.Skalieren" #: backends/graphics/sdl/sdl-graphics.cpp:2137 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 -#, fuzzy msgid "Enabled aspect ratio correction" -msgstr "Seitenverhältnis anpassen: an/aus" +msgstr "Seitenverhältniskorrektur an" #: backends/graphics/sdl/sdl-graphics.cpp:2143 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 -#, fuzzy msgid "Disabled aspect ratio correction" -msgstr "Seitenverhältnis anpassen: an/aus" +msgstr "Seitenverhältniskorrektur aus" #: backends/graphics/sdl/sdl-graphics.cpp:2198 -#, fuzzy msgid "Active graphics filter:" -msgstr "Zwischen Grafikfiltern wechseln" +msgstr "Aktiver Grafikfilter:" #: backends/graphics/sdl/sdl-graphics.cpp:2254 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 -#, fuzzy msgid "Windowed mode" -msgstr "Render-Modus:" +msgstr "Fenstermodus" #: backends/graphics/opengl/opengl-graphics.cpp:139 msgid "OpenGL Normal" @@ -2235,21 +2279,20 @@ msgid "OpenGL Original" msgstr "" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 -#, fuzzy msgid "Current display mode" -msgstr "Aktueller Videomodus:" +msgstr "Aktueller Grafikmodus" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 msgid "Current scale" -msgstr "" +msgstr "Aktueller Vergrößerungsfaktor" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 msgid "Active filter mode: Linear" -msgstr "" +msgstr "Aktiver Filtermodus: linear" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 msgid "Active filter mode: Nearest" -msgstr "" +msgstr "Aktiver Filtermodus: nächste Nachbarn" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2331,7 +2374,7 @@ msgstr "Video" #: backends/platform/wii/options.cpp:54 msgid "Current video mode:" -msgstr "Aktueller Videomodus:" +msgstr "Aktueller Grafikmodus:" #: backends/platform/wii/options.cpp:56 msgid "Double-strike" @@ -2442,17 +2485,15 @@ msgid "Network down" msgstr "Netzwerk ist aus." #: backends/platform/wii/options.cpp:178 -#, fuzzy msgid "Initializing network" -msgstr "Netzwerk wird gestartet..." +msgstr "Netzwerk wird gestartet" #: backends/platform/wii/options.cpp:182 -#, fuzzy msgid "Timeout while initializing network" msgstr "Zeitüberschreitung beim Starten des Netzwerks" #: backends/platform/wii/options.cpp:186 -#, fuzzy, c-format +#, c-format msgid "Network not initialized (%d)" msgstr "Netzwerk nicht gestartet (%d)" @@ -2575,58 +2616,50 @@ msgstr "" "zuzuweisen, um das ganze Inventar sehen zu können." #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Do you really want to return to the Launcher?" -msgstr "Diesen Spielstand wirklich löschen?" +msgstr "Möchten Sie wirklich zur Spieleliste zurückkehren?" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Launcher" -msgstr "Schlage" +msgstr "Spieleliste" #: backends/events/default/default-events.cpp:244 -#, fuzzy msgid "Do you really want to quit?" -msgstr "Möchten Sie beenden?" +msgstr "Möchten Sie wirklich beenden?" #: backends/events/gph/gph-events.cpp:366 #: backends/events/gph/gph-events.cpp:409 #: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" -msgstr "" +msgstr "Berührungsbildschirm-Tipp-Modus - Linksklick" #: backends/events/gph/gph-events.cpp:368 #: backends/events/gph/gph-events.cpp:411 #: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" -msgstr "" +msgstr "Berührungsbildschirm-Tipp-Modus - Rechtsklick" #: backends/events/gph/gph-events.cpp:370 #: backends/events/gph/gph-events.cpp:413 #: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" -msgstr "" +msgstr "Berührungsbildschirm-Tipp-Modus - schweben (kein Klick)" #: backends/events/gph/gph-events.cpp:390 -#, fuzzy msgid "Maximum Volume" -msgstr "Lautstärke" +msgstr "Höchste Lautstärke" #: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" -msgstr "" +msgstr "Lautstärke höher" #: backends/events/gph/gph-events.cpp:398 -#, fuzzy msgid "Minimal Volume" -msgstr "Lautstärke" +msgstr "Niedrigste Lautstärke" #: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" -msgstr "" - -#~ msgid "Discovered %d new games." -#~ msgstr "%d neue Spiele gefunden." +msgstr "Lautstärke niedriger" #~ msgid "Command line argument not processed" #~ msgstr "Argument in Kommandozeile nicht verarbeitet" -- cgit v1.2.3 From ba6d0121e109fc363631d38be5b8630a004508ad Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 23:10:45 +0100 Subject: I18N: Update list of files used to generate the translations template --- po/POTFILES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/POTFILES b/po/POTFILES index 323e50e8e4..3ffb587f01 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -63,7 +63,7 @@ backends/keymapper/remap-dialog.cpp backends/midi/windows.cpp backends/platform/ds/arm9/source/dsoptions.cpp backends/platform/iphone/osys_events.cpp -backends/graphics/sdl/sdl-graphics.cpp +backends/graphics/surfacesdl/surfacesdl-graphics.cpp backends/graphics/opengl/opengl-graphics.cpp backends/graphics/openglsdl/openglsdl-graphics.cpp backends/platform/symbian/src/SymbianActions.cpp -- cgit v1.2.3 From f4d20223be7a2bb9cf5a27c689a7b7dea1be4958 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 23:12:26 +0100 Subject: I18N: Make the unsupported game warning translatable --- engines/engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/engine.cpp b/engines/engine.cpp index 0797bafc27..dde5064dc4 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -402,10 +402,10 @@ void Engine::openMainMenuDialog() { bool Engine::warnUserAboutUnsupportedGame() { if (ConfMan.getBool("enable_unsupported_game_warning")) { - GUI::MessageDialog alert("WARNING: The game you are about to start is" + GUI::MessageDialog alert(_("WARNING: The game you are about to start is" " not yet fully supported by ScummVM. As such, it is likely to be" " unstable, and any saves you make might not work in future" - " versions of ScummVM.", "Start anyway", "Cancel"); + " versions of ScummVM."), _("Start anyway"), _("Cancel")); return alert.runModal() == GUI::kMessageOK; } return true; -- cgit v1.2.3 From 5e4e36ea38d3daef7820a3af9305bd48a9f15116 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 23:14:25 +0100 Subject: I18N: Update translations template file from source code --- po/scummvm.pot | 87 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/po/scummvm.pot b/po/scummvm.pot index 39c80538d8..7abb933cb1 100644 --- a/po/scummvm.pot +++ b/po/scummvm.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.4.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,8 +45,8 @@ msgstr "" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -85,7 +85,7 @@ msgstr "" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -597,8 +597,9 @@ msgstr "" msgid "Special dithering modes supported by some games" msgstr "" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "" @@ -1063,7 +1064,11 @@ msgstr "" msgid "Engine plugin does not support save states" msgstr "" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "" @@ -1085,34 +1090,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "" @@ -1216,6 +1206,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "" @@ -1748,14 +1749,14 @@ msgstr "" msgid "Fly to lower right" msgstr "" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1763,7 +1764,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1771,7 +1772,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1779,7 +1780,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2121,31 +2122,31 @@ msgstr "" msgid "Touchpad mode disabled." msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 msgid "Enabled aspect ratio correction" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 msgid "Disabled aspect ratio correction" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 msgid "Active graphics filter:" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 msgid "Windowed mode" msgstr "" @@ -2161,19 +2162,19 @@ msgstr "" msgid "OpenGL Original" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 msgid "Current display mode" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" -- cgit v1.2.3 From e58bedc479345d5d59a6508d1f00821ddb37e090 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 23:16:27 +0100 Subject: I18N: Update translations files from template --- po/ca_ES.po | 87 ++++++++++++++++++++++++------------------------ po/cs_CZ.po | 102 ++++++++++++++++++++++++++++++++------------------------- po/da_DA.po | 87 ++++++++++++++++++++++++------------------------ po/de_DE.po | 107 ++++++++++++++++++++++++++++++++++-------------------------- po/es_ES.po | 87 ++++++++++++++++++++++++------------------------ po/fr_FR.po | 87 ++++++++++++++++++++++++------------------------ po/hu_HU.po | 98 +++++++++++++++++++++++++++++++------------------------ po/it_IT.po | 87 ++++++++++++++++++++++++------------------------ po/nb_NO.po | 87 ++++++++++++++++++++++++------------------------ po/nn_NO.po | 87 ++++++++++++++++++++++++------------------------ po/pl_PL.po | 87 ++++++++++++++++++++++++------------------------ po/pt_BR.po | 87 ++++++++++++++++++++++++------------------------ po/ru_RU.po | 87 ++++++++++++++++++++++++------------------------ po/se_SE.po | 87 ++++++++++++++++++++++++------------------------ po/uk_UA.po | 87 ++++++++++++++++++++++++------------------------ 15 files changed, 700 insertions(+), 651 deletions(-) diff --git a/po/ca_ES.po b/po/ca_ES.po index ce4c1db140..d837be093f 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2010-09-21 23:12+0100\n" "Last-Translator: Jordi Vilalta Prat \n" "Language-Team: Catalan \n" @@ -45,8 +45,8 @@ msgstr "Amunt" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -85,7 +85,7 @@ msgstr "Mapeja" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -607,8 +607,9 @@ msgstr "Mode de pintat:" msgid "Special dithering modes supported by some games" msgstr "Modes de dispersió especials suportats per alguns jocs" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Mode pantalla completa" @@ -1096,7 +1097,11 @@ msgstr "" msgid "Engine plugin does not support save states" msgstr "El motor no suporta el nivell de depuració '%s'" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 #, fuzzy msgid "Unknown error" msgstr "Error desconegut" @@ -1119,34 +1124,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Àmbar" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~C~ontinua" @@ -1252,6 +1242,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1804,14 +1805,14 @@ msgstr "" msgid "Fly to lower right" msgstr "" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1822,7 +1823,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1833,7 +1834,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1844,7 +1845,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2208,33 +2209,33 @@ msgstr "Mode Touchpad activat." msgid "Touchpad mode disabled." msgstr "Mode Touchpad desactivat." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (sense escalar)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal (no escalat)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Correcció de la relació d'aspecte" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Correcció de la relació d'aspecte" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 msgid "Active graphics filter:" msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Mode de pintat:" @@ -2251,20 +2252,20 @@ msgstr "" msgid "OpenGL Original" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Mode de vídeo actual:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index 6a570b81c2..aad7110daf 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-06-14 15:04+0100\n" "Last-Translator: Zbynìk Schwarz \n" "Language-Team: \n" @@ -49,8 +49,8 @@ msgstr "J #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Mapovat" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -605,8 +605,9 @@ msgstr "Re msgid "Special dithering modes supported by some games" msgstr "Speciální re¾imy chvìní podporované nìkterými hrami" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Re¾im celé obrazovky" @@ -1079,7 +1080,11 @@ msgstr "Nelze nal msgid "Engine plugin does not support save states" msgstr "Zás. modul jádra nepodporuje ulo¾ené stavy" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Neznámá chyba" @@ -1101,36 +1106,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Jantarová" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "Hra v '%s' se zdá být neznámá." -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "Prosím nahlaste následující data týmu ScummVM spolu se jménem" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "hry, kterou jste se pokusili pøidat a její verzi/jazyk/atd.:" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" -"Bylo zji¹tìno, ¾e Va¹e verze hry pou¾ívá jméno souboru shodující se s " -"variantou %s." - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "Pokud je toto pùvodní a nezmìnìná verze, ohlaste prosím jakékoli" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "pøede¹le vypsané informace od ScummVM zpátky týmu." - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~P~okraèovat" @@ -1247,6 +1235,17 @@ msgstr "" "abyste mohli poslouchat hudbu ve høe.\n" "Pro podrobnosti si pøeètìte README." +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~øedchozí" @@ -1779,7 +1778,7 @@ msgstr "Let msgid "Fly to lower right" msgstr "Letìt doprava dolù" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1788,7 +1787,7 @@ msgstr "" "Pøirozená podpora MIDI vy¾aduje Aktualizaci Roland od LucasArts,\n" "ale %s chybí. Místo toho je pou¾it AdLib." -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1799,7 +1798,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1810,7 +1809,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1821,7 +1820,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2204,31 +2203,31 @@ msgstr "Touchpad re msgid "Touchpad mode disabled." msgstr "Touchpad re¾im vypnut" -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normální (bez zmìny velikosti)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normální (bez zmìny velikosti)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 msgid "Enabled aspect ratio correction" msgstr "Povolena korekce pomìru stran" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 msgid "Disabled aspect ratio correction" msgstr "Zakázána korekce pomìru stran" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 msgid "Active graphics filter:" msgstr "Aktivní grafický filtr:" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 msgid "Windowed mode" msgstr "Re¾im do okna" @@ -2244,19 +2243,19 @@ msgstr "OpenGL Zachov msgid "OpenGL Original" msgstr "OpenGL Pùvodní" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 msgid "Current display mode" msgstr "Souèasný re¾im obrazu" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "Souèasná velikost" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "Aktivní re¾im filtru: Lineární" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "Aktivní re¾im filtru: Nejbli¾¹í" @@ -2627,6 +2626,19 @@ msgstr "Minim msgid "Decreasing Volume" msgstr "Sni¾uji Hlasitost" +#~ msgid "" +#~ "Your game version has been detected using filename matching as a variant " +#~ "of %s." +#~ msgstr "" +#~ "Bylo zji¹tìno, ¾e Va¹e verze hry pou¾ívá jméno souboru shodující se s " +#~ "variantou %s." + +#~ msgid "If this is an original and unmodified version, please report any" +#~ msgstr "Pokud je toto pùvodní a nezmìnìná verze, ohlaste prosím jakékoli" + +#~ msgid "information previously printed by ScummVM to the team." +#~ msgstr "pøede¹le vypsané informace od ScummVM zpátky týmu." + #~ msgid "Discovered %d new games." #~ msgstr "Objeveno %d nových her." diff --git a/po/da_DA.po b/po/da_DA.po index 1d9acf76f5..9bb43f7784 100644 --- a/po/da_DA.po +++ b/po/da_DA.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-01-08 22:53+0100\n" "Last-Translator: Steffen Nyeland \n" "Language-Team: Steffen Nyeland \n" @@ -45,8 +45,8 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -85,7 +85,7 @@ msgstr "Kortl #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -604,8 +604,9 @@ msgstr "Rendere tilstand:" msgid "Special dithering modes supported by some games" msgstr "Speciel farvereduceringstilstand understøttet a nogle spil" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Fuldskærms tilstand" @@ -1083,7 +1084,11 @@ msgstr "" msgid "Engine plugin does not support save states" msgstr "Motor understøtter ikke fejlfindingsniveau '%s'" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 #, fuzzy msgid "Unknown error" msgstr "Ukendt fejl" @@ -1106,34 +1111,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules brun" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "Gen~o~ptag" @@ -1239,6 +1229,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "Fo~r~rige" @@ -1772,14 +1773,14 @@ msgstr "Flyv til h msgid "Fly to lower right" msgstr "Flyv nederst til højre" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1790,7 +1791,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1801,7 +1802,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1812,7 +1813,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2176,34 +2177,34 @@ msgstr "Pegeplade tilstand aktiveret." msgid "Touchpad mode disabled." msgstr "Pegeplade tilstand deaktiveret." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Skift billedformat korrektion" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Skift billedformat korrektion" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Skift mellem grafik filtre" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Rendere tilstand:" @@ -2220,20 +2221,20 @@ msgstr "OpenGL Bevar" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Aktuel videotilstand:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/de_DE.po b/po/de_DE.po index e3053ee989..d823212316 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-06-20 09:45+0100\n" "Last-Translator: Simon Sawatzki \n" "Language-Team: Lothar Serra Mari & Simon Sawatzki " @@ -47,8 +47,8 @@ msgstr "Pfad hoch" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -87,7 +87,7 @@ msgstr "Zuweisen" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -610,8 +610,9 @@ msgid "Special dithering modes supported by some games" msgstr "" "Spezielle Farbmischungsmethoden werden von manchen Spielen unterstützt." -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Vollbildmodus" @@ -1094,7 +1095,11 @@ msgstr "Konnte kein passendes Engine-Plugin finden." msgid "Engine plugin does not support save states" msgstr "Engine-Plugin unterstützt keine Speicherstände." -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Unbekannter Fehler" @@ -1116,42 +1121,23 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules-Gelb" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "Das Spiel im Verzeichnis \"%s\" scheint nicht bekannt zu sein." -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" "Bitte berichten Sie die folgenden Daten auf Englisch an das ScummVM-Team " "sowie" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" "den Namen des Spiels, das Sie hinzufügen wollten, als auch die Version/" "Sprache/usw.:" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" -"Ihre Spielversion wurde durch Dateinamen-Übereinstimmung als Variante von %s " -"erkannt." - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "Sollte es sich hierbei um eine unmodifizierte Originalversion handeln," - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" -"so teilen Sie bitte dem Team die von ScummVM zuvor ausgegebenen Daten auf " -"Englisch mit." - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~F~ortsetzen" @@ -1271,6 +1257,17 @@ msgstr "" "Spiel hören zu können. Lesen Sie die\n" "LIESMICH-Datei für weitere Informationen." +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~Z~urück" @@ -1803,7 +1800,7 @@ msgstr "Nach rechts fliegen" msgid "Fly to lower right" msgstr "Nach unten rechts fliegen" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1812,7 +1809,7 @@ msgstr "" "Systemeigene MIDI-Ünterstützung erfordert das Roland-Upgrade von LucasArts,\n" "aber %s fehlt. Stattdessen wird AdLib verwendet." -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1823,7 +1820,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1834,7 +1831,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1845,7 +1842,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2238,31 +2235,31 @@ msgstr "Touchpad-Modus aktiviert." msgid "Touchpad mode disabled." msgstr "Touchpad-Modus ausgeschaltet." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (keine Skalierung)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal ohn.Skalieren" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 msgid "Enabled aspect ratio correction" msgstr "Seitenverhältniskorrektur an" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 msgid "Disabled aspect ratio correction" msgstr "Seitenverhältniskorrektur aus" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 msgid "Active graphics filter:" msgstr "Aktiver Grafikfilter:" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 msgid "Windowed mode" msgstr "Fenstermodus" @@ -2278,19 +2275,19 @@ msgstr "" msgid "OpenGL Original" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 msgid "Current display mode" msgstr "Aktueller Grafikmodus" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "Aktueller Vergrößerungsfaktor" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "Aktiver Filtermodus: linear" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "Aktiver Filtermodus: nächste Nachbarn" @@ -2661,6 +2658,22 @@ msgstr "Niedrigste Lautst msgid "Decreasing Volume" msgstr "Lautstärke niedriger" +#~ msgid "" +#~ "Your game version has been detected using filename matching as a variant " +#~ "of %s." +#~ msgstr "" +#~ "Ihre Spielversion wurde durch Dateinamen-Übereinstimmung als Variante von " +#~ "%s erkannt." + +#~ msgid "If this is an original and unmodified version, please report any" +#~ msgstr "" +#~ "Sollte es sich hierbei um eine unmodifizierte Originalversion handeln," + +#~ msgid "information previously printed by ScummVM to the team." +#~ msgstr "" +#~ "so teilen Sie bitte dem Team die von ScummVM zuvor ausgegebenen Daten auf " +#~ "Englisch mit." + #~ msgid "Command line argument not processed" #~ msgstr "Argument in Kommandozeile nicht verarbeitet" diff --git a/po/es_ES.po b/po/es_ES.po index 0f76d38917..730b8d48b0 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-05-08 13:31+0100\n" "Last-Translator: Tomás Maidagan\n" "Language-Team: \n" @@ -45,8 +45,8 @@ msgstr "Arriba" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -85,7 +85,7 @@ msgstr "Asignar" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -604,8 +604,9 @@ msgstr "Renderizado:" msgid "Special dithering modes supported by some games" msgstr "Modos especiales de expansión soportados por algunos juegos" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Pantalla completa" @@ -1085,7 +1086,11 @@ msgstr "No se ha encontrado un plugin adecuado" msgid "Engine plugin does not support save states" msgstr "El plugin del motor no es compatible con partidas guardadas" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Error desconocido" @@ -1107,34 +1112,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ámbar" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~R~eanudar" @@ -1240,6 +1230,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1773,14 +1774,14 @@ msgstr "Volar a la derecha" msgid "Fly to lower right" msgstr "Volar abajo y a la derecha" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1791,7 +1792,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1802,7 +1803,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1813,7 +1814,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2180,34 +2181,34 @@ msgstr "Modo Touchpad activado." msgid "Touchpad mode disabled." msgstr "Modo Touchpad desactivado." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (sin reescalado)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Corrección de aspecto" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Corrección de aspecto" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Alternar entre filtros gráficos" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Renderizado:" @@ -2224,20 +2225,20 @@ msgstr "OpenGL Conservar" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Modo de vídeo actual:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/fr_FR.po b/po/fr_FR.po index 1dca127df8..cfb0c0a45b 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-05-02 19:50+0100\n" "Last-Translator: Thierry Crozat \n" "Language-Team: French \n" @@ -46,8 +46,8 @@ msgstr "Remonter" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -86,7 +86,7 @@ msgstr "Affecter" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -606,8 +606,9 @@ msgstr "Mode de rendu:" msgid "Special dithering modes supported by some games" msgstr "Mode spécial de tramage supporté par certains jeux" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Plein écran" @@ -1090,7 +1091,11 @@ msgstr "Aucun plugin n'a pu msgid "Engine plugin does not support save states" msgstr "Ce moteur de jeu ne supporte pas les sauvegardes" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Erreur inconnue" @@ -1112,34 +1117,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Ambre" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~R~eprendre" @@ -1245,6 +1235,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~récédent" @@ -1778,14 +1779,14 @@ msgstr "Voler vers la droite" msgid "Fly to lower right" msgstr "Voler vers la bas à droite" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1796,7 +1797,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1807,7 +1808,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1818,7 +1819,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2186,34 +2187,34 @@ msgstr "Mode touchpad activ msgid "Touchpad mode disabled." msgstr "Mode touchpad désactivé" -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (échelle d'origine)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Changer correction du rapport d'aspect" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Changer correction du rapport d'aspect" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Changer de filtre graphique" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Mode de rendu:" @@ -2230,20 +2231,20 @@ msgstr "OpenGL Pr msgid "OpenGL Original" msgstr "OpenGL Originel" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Mode vidéo actuel" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/hu_HU.po b/po/hu_HU.po index fbf9f3dd61..78062e9d41 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-06-15 07:42+0100\n" "Last-Translator: Gruby \n" "Language-Team: Hungarian\n" @@ -49,8 +49,8 @@ msgstr "Feljebb" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Kioszt #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -606,8 +606,9 @@ msgstr "Kirajzol msgid "Special dithering modes supported by some games" msgstr "Néhány játék támogatja a speciális árnyalási módokat" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Teljesképernyõs mód:" @@ -1078,7 +1079,11 @@ msgstr "Nem tal msgid "Engine plugin does not support save states" msgstr "A motor nem támogatja a játékállás mentését" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Ismeretlen hiba" @@ -1100,34 +1105,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Sárga" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "A '%s' játék ismeretlennek tûnik." -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "Kérlek jelezd a ScummVM csapatnak a következõ adatokat, együtt a játék" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "címével és megbízható adataival játékverzió/nyelv(ek)/stb.:" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "A felismert játékverziód a használt fájlnévvel a %s egy változata." - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "Ha ez egy eredeti nem változtatott verzió, kérlek jelezd minden" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "elõzõleg kiírt információt a ScummVM csapatnak." - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "Folytatás" @@ -1243,6 +1233,17 @@ msgstr "" "hogy a játék zenéje hallható legyen.\n" "Nézd meg a README fájlt a részletekért." +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "Elõzõ" @@ -1775,7 +1776,7 @@ msgstr "Jobbra rep msgid "Fly to lower right" msgstr "Jobbra le repülés" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1784,7 +1785,7 @@ msgstr "" "Native MIDI támogatáshoz kell a Roland Upgrade a LucasArts-tól,\n" "a %s hiányzik. AdLib-ot használok helyette." -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1795,7 +1796,7 @@ msgstr "" "\n" "%s fájlba nem sikerült" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1806,7 +1807,7 @@ msgstr "" "\n" "%s fájlból nem sikerült" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1817,7 +1818,7 @@ msgstr "" "\n" "%s fájlba elkészült" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2200,31 +2201,31 @@ msgstr "Touchpad m msgid "Touchpad mode disabled." msgstr "Touchpad mód letiltva." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normál (nincs átméretezés)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normál (nincs átméretezés)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 msgid "Enabled aspect ratio correction" msgstr "Méretarány korrekció engedélyezve" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 msgid "Disabled aspect ratio correction" msgstr "Méretarány korrekció letiltva" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 msgid "Active graphics filter:" msgstr "Aktív grafikus szûrõk:" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 msgid "Windowed mode" msgstr "Ablakos mód" @@ -2240,19 +2241,19 @@ msgstr "OpenGL Megtartott" msgid "OpenGL Original" msgstr "OpenGL Eredeti" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 msgid "Current display mode" msgstr "Jelenlegi videómód" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "Aktuális méretezés" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "Aktív filter mód: Lineáris" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "Aktív filter mód: Közelítõ" @@ -2619,6 +2620,17 @@ msgstr "Minimum Hanger msgid "Decreasing Volume" msgstr "Hangerõ csökkentése" +#~ msgid "" +#~ "Your game version has been detected using filename matching as a variant " +#~ "of %s." +#~ msgstr "A felismert játékverziód a használt fájlnévvel a %s egy változata." + +#~ msgid "If this is an original and unmodified version, please report any" +#~ msgstr "Ha ez egy eredeti nem változtatott verzió, kérlek jelezd minden" + +#~ msgid "information previously printed by ScummVM to the team." +#~ msgstr "elõzõleg kiírt információt a ScummVM csapatnak." + #~ msgid "Discovered %d new games." #~ msgstr "%d Új játékot találtam." diff --git a/po/it_IT.po b/po/it_IT.po index 24f09e349f..1386e41973 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-04-24 14:46+0100\n" "Last-Translator: Matteo 'Maff' Angelino \n" "Language-Team: Italian\n" @@ -45,8 +45,8 @@ msgstr "Su" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -85,7 +85,7 @@ msgstr "Mappa" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -606,8 +606,9 @@ msgstr "Resa grafica:" msgid "Special dithering modes supported by some games" msgstr "Modalità di resa grafica speciali supportate da alcuni giochi" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Modalità a schermo intero" @@ -1086,7 +1087,11 @@ msgstr "Impossibile trovare un plugin idoneo" msgid "Engine plugin does not support save states" msgstr "Il plugin del motore non supporta i salvataggi" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Errore sconosciuto" @@ -1108,34 +1113,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ambra" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~R~ipristina" @@ -1241,6 +1231,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~recedenti" @@ -1774,14 +1775,14 @@ msgstr "Vola a destra" msgid "Fly to lower right" msgstr "Vola in basso a destra" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1792,7 +1793,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1803,7 +1804,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1814,7 +1815,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2182,34 +2183,34 @@ msgstr "Modalit msgid "Touchpad mode disabled." msgstr "Modalità touchpad disattivata." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normale (nessun ridimensionamento)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normale (no ridim.)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Cambia correzione proporzioni" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Cambia correzione proporzioni" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Cambia filtro grafico" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Resa grafica:" @@ -2226,20 +2227,20 @@ msgstr "OpenGL Conserve" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Modalità video attuale:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index 3afebc96d9..eb895ed8c4 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-04-25 22:56+0100\n" "Last-Translator: Einar Johan T. Sømåen \n" "Language-Team: somaen \n" @@ -49,8 +49,8 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Koble" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -608,8 +608,9 @@ msgstr "Tegnemodus:" msgid "Special dithering modes supported by some games" msgstr "Spesiel dithering-modus støttet av enkelte spill" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Fullskjermsmodus" @@ -1081,7 +1082,11 @@ msgstr "Kunne ikke finne en passende engine-plugin" msgid "Engine plugin does not support save states" msgstr "Spillmotor-plugin støtter ikke lagrede tilstander" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Ukjent feil" @@ -1103,34 +1108,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Oransje" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~F~ortsett" @@ -1236,6 +1226,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~orrige" @@ -1769,14 +1770,14 @@ msgstr "Fly til h msgid "Fly to lower right" msgstr "Fly til nedre høyre" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1787,7 +1788,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1798,7 +1799,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1809,7 +1810,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2176,34 +2177,34 @@ msgstr "Touchpad-modus aktivert." msgid "Touchpad mode disabled." msgstr "Touchpad-modus deaktivert." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Veksle aspekt-rate korrigering" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Veksle aspekt-rate korrigering" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Bytt grafikkfiltre" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Tegnemodus:" @@ -2220,20 +2221,20 @@ msgstr "OpenGL Bevar" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Nåværende videomodus:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/nn_NO.po b/po/nn_NO.po index 9eecf8b6b5..ff43eb2a17 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-04-25 23:07+0100\n" "Last-Translator: Einar Johan T. Sømåen \n" "Language-Team: somaen \n" @@ -49,8 +49,8 @@ msgstr "G #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Kople" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -607,8 +607,9 @@ msgstr "Teiknemodus:" msgid "Special dithering modes supported by some games" msgstr "Spesielle dithering-modus som støttast av nokre spel" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Fullskjermsmodus" @@ -1079,7 +1080,11 @@ msgstr "Kunne ikkje finne ein passande spelmotor-plugin" msgid "Engine plugin does not support save states" msgstr "Spelmotor-plugin støttar ikkje lagra tilstandar." -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Ukjend feil" @@ -1101,34 +1106,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Raudgul" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~F~ortsett" @@ -1236,6 +1226,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~orrige" @@ -1769,14 +1770,14 @@ msgstr "Fly til h msgid "Fly to lower right" msgstr "Fly til nedre høgre" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1784,7 +1785,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1792,7 +1793,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1800,7 +1801,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2150,34 +2151,34 @@ msgstr "" msgid "Touchpad mode disabled." msgstr "" -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (inga skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal (inga skalering)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Veksle aspekt-korrigering" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Veksle aspekt-korrigering" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Veksle grafikkfiltre" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Teiknemodus:" @@ -2194,20 +2195,20 @@ msgstr "OpenGL Bevar" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Gjeldende videomodus:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/pl_PL.po b/po/pl_PL.po index f591d0065a..12d53847f5 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-05-02 12:09+0100\n" "Last-Translator: \n" "Language-Team: Grajpopolsku.pl \n" @@ -49,8 +49,8 @@ msgstr "W g #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Przypisz" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -604,8 +604,9 @@ msgstr "Renderer:" msgid "Special dithering modes supported by some games" msgstr "Specjalne tryby ditheringu wspierane przez niektóre gry" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Tryb pe³noekranowy" @@ -1081,7 +1082,11 @@ msgstr "Nie uda msgid "Engine plugin does not support save states" msgstr "Silnik nie wspiera zapisu stanu gry" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Nieznany b³±d" @@ -1103,34 +1108,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Bursztynowy Hercules" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~W~znów" @@ -1236,6 +1226,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~P~oprzedni" @@ -1769,14 +1770,14 @@ msgstr "Le msgid "Fly to lower right" msgstr "Leæ w dó³, w prawo" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1787,7 +1788,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1798,7 +1799,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1809,7 +1810,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2176,34 +2177,34 @@ msgstr "Tryb touchpada w msgid "Touchpad mode disabled." msgstr "Tryb touchpada wy³±czony." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Zwyk³y (bez skalowania)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Zwyk³y (bez skalowania)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "W³±cz/wy³±cz korekcjê formatu obrazu" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "W³±cz/wy³±cz korekcjê formatu obrazu" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Prze³±czaj pomiêdzy filtrami grafiki" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Renderer:" @@ -2220,20 +2221,20 @@ msgstr "OpenGL - zachow." msgid "OpenGL Original" msgstr "OpenGL - pierw." -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Obecny tryb wideo:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index a9a0d1412d..2ea8bfe237 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-05-03 19:11-0300\n" "Last-Translator: Saulo Benigno \n" "Language-Team: ScummBR (www.scummbr.com) \n" @@ -49,8 +49,8 @@ msgstr "Acima" #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -89,7 +89,7 @@ msgstr "Mapear" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -608,8 +608,9 @@ msgstr "Renderiza msgid "Special dithering modes supported by some games" msgstr "Modos especiais de dithering suportados por alguns jogos" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Modo Tela Cheia" @@ -1088,7 +1089,11 @@ msgstr "N msgid "Engine plugin does not support save states" msgstr "A engine atual não suporta salvar o progresso do jogo" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Erro desconhecido" @@ -1110,34 +1115,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules Amber" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~V~oltar ao jogo" @@ -1243,6 +1233,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~A~nterior" @@ -1776,14 +1777,14 @@ msgstr "Voar para direita" msgid "Fly to lower right" msgstr "Voar para direita inferior" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1794,7 +1795,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1805,7 +1806,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1816,7 +1817,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2184,34 +2185,34 @@ msgstr "Modo Touchpad ligado." msgid "Touchpad mode disabled." msgstr "Modo Touchpad desligado." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normal (sem escala)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normal (sem escala)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Habilita correção de proporção" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Habilita correção de proporção" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Alterna entre os filtros gráficos" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Renderização" @@ -2228,20 +2229,20 @@ msgstr "OpenGL Conserve" msgid "OpenGL Original" msgstr "OpenGL Original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Modo de vídeo atual:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/ru_RU.po b/po/ru_RU.po index 9600a810ea..ae5bbdb448 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2010-06-13 20:55+0300\n" "Last-Translator: Eugene Sandulenko \n" "Language-Team: Russian\n" @@ -47,8 +47,8 @@ msgstr " #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -87,7 +87,7 @@ msgstr " #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -605,8 +605,9 @@ msgstr " msgid "Special dithering modes supported by some games" msgstr "ÁßÕæØÐÛìÝëÕ àÕÖØÜë àÕÝÔÕàØÝÓÐ, ßÞÔÔÕàÖØÒÐÕÜëÕ ÝÕÚÞâÞàëÜØ ØÓàÐÜØ" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "¿ÞÛÝÞíÚàÐÝÝëÙ àÕÖØÜ" @@ -1088,7 +1089,11 @@ msgstr " msgid "Engine plugin does not support save states" msgstr "´ÒØÖÞÚ ÝÕ ßÞÔÔÕàÖØÒÐÕâ áÞåàÐÝÕÝØï" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "½ÕØ×ÒÕáâÝÐï ÞèØÑÚÐ" @@ -1110,34 +1115,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ÏÝâÐàÝëÙ" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "¿àÞÔÞÛ~Ö~Øâì" @@ -1243,6 +1233,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~¿~àÕÔ" @@ -1776,14 +1777,14 @@ msgstr " msgid "Fly to lower right" msgstr "»ÕâÕâì ÒßàÐÒÞ-ÒÝØ×" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1794,7 +1795,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1805,7 +1806,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1816,7 +1817,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2183,34 +2184,34 @@ msgstr " msgid "Touchpad mode disabled." msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒëÚÛîçÕÝ." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "±Õ× ãÒÕÛØçÕÝØï" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "±Õ× ãÒÕÛØçÕÝØï" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "¿ÕàÕÚÛîçÕÝØÕ ÜÕÖÔã ÓàÐäØçÕáÚØÜØ äØÛìâàÐÜØ" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "ÀÕÖØÜ àÐáâàÐ:" @@ -2227,20 +2228,20 @@ msgstr "OpenGL msgid "OpenGL Original" msgstr "OpenGL Ø×ÝÐçÐÛìÝëÙ" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "ÂÕÚãéØÙ ÒØÔÕÞàÕÖØÜ:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/se_SE.po b/po/se_SE.po index ccb12b159f..7301fd52d1 100644 --- a/po/se_SE.po +++ b/po/se_SE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-05-02 13:07+0100\n" "Last-Translator: Hampus Flink \n" "Language-Team: \n" @@ -50,8 +50,8 @@ msgstr "Upp #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -90,7 +90,7 @@ msgstr "St #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -609,8 +609,9 @@ msgstr "Renderingsl msgid "Special dithering modes supported by some games" msgstr "Speciella gitterlägen stödda av vissa spel" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "Fullskärmsläge" @@ -1089,7 +1090,11 @@ msgstr "Kunde inte hitta l msgid "Engine plugin does not support save states" msgstr "Motorn stöder inte debug-nivå '%s'" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "Okänt fel" @@ -1111,34 +1116,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Herkules bärnsten" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "~F~ortsätt" @@ -1244,6 +1234,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~F~öregående" @@ -1777,14 +1778,14 @@ msgstr "Flyg msgid "Fly to lower right" msgstr "Flyg åt nedre höger" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1795,7 +1796,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1806,7 +1807,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1817,7 +1818,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2184,34 +2185,34 @@ msgstr "Touchpad-l msgid "Touchpad mode disabled." msgstr "Touchpad-läge inaktiverat." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "Normalt (ingen skalning)" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "Normalt (ingen skalning)" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Korrektion av bildförhållande på/av" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Korrektion av bildförhållande på/av" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "Växla grafikfilter" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "Renderingsläge:" @@ -2228,20 +2229,20 @@ msgstr "OpenGL konservation" msgid "OpenGL Original" msgstr "OpenGL original" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "Aktivt videoläge:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" diff --git a/po/uk_UA.po b/po/uk_UA.po index dfacf84fa7..0d94a6320f 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2011-06-13 22:20+0100\n" +"POT-Creation-Date: 2011-06-20 23:09+0100\n" "PO-Revision-Date: 2011-03-26 22:38+0200\n" "Last-Translator: Lubomyr Lisen\n" "Language-Team: Ukrainian\n" @@ -47,8 +47,8 @@ msgstr " #: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43 #: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178 #: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54 -#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281 -#: backends/platform/wii/options.cpp:48 +#: engines/engine.cpp:408 engines/sword1/control.cpp:865 +#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48 #: backends/events/default/default-events.cpp:222 #: backends/events/default/default-events.cpp:244 msgid "Cancel" @@ -87,7 +87,7 @@ msgstr " #: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936 #: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179 -#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772 +#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796 #: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417 #: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141 #: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354 @@ -604,8 +604,9 @@ msgstr " msgid "Special dithering modes supported by some games" msgstr "ÁßÕæöÐÛìÝö àÕÖØÜØ àÐáâàãÒÐÝÝï, ïÚö ßöÔâàØÜãîâì ÔÕïÚö öÓàØ" -#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456 +#: gui/options.cpp:726 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460 msgid "Fullscreen mode" msgstr "¿ÞÒÝÞÕÚàÐÝÝØÙ àÕÖØÜ" @@ -1083,7 +1084,11 @@ msgstr " msgid "Engine plugin does not support save states" msgstr "´ÒØÖÞÚ ÝÕ ßöÔâàØÜãô àöÒÕÝì ÒöÔÛÐÔÚØ '%s'" -#: common/error.cpp:72 +#: common/error.cpp:71 +msgid "User canceled" +msgstr "" + +#: common/error.cpp:75 msgid "Unknown error" msgstr "½ÕÒöÔÞÜÐ ßÞÜØÛÚÐ" @@ -1105,34 +1110,19 @@ msgctxt "lowres" msgid "Hercules Amber" msgstr "Hercules ÏÝâÐàÝØÙ" -#: engines/advancedDetector.cpp:323 +#: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." msgstr "" -#: engines/advancedDetector.cpp:324 +#: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" msgstr "" -#: engines/advancedDetector.cpp:326 +#: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" msgstr "" -#: engines/advancedDetector.cpp:574 -#, c-format -msgid "" -"Your game version has been detected using filename matching as a variant of %" -"s." -msgstr "" - -#: engines/advancedDetector.cpp:577 -msgid "If this is an original and unmodified version, please report any" -msgstr "" - -#: engines/advancedDetector.cpp:579 -msgid "information previously printed by ScummVM to the team." -msgstr "" - #: engines/dialogs.cpp:84 msgid "~R~esume" msgstr "¿àÞÔÞÒ~Ö~ØâØ" @@ -1238,6 +1228,17 @@ msgid "" "See the README file for details." msgstr "" +#: engines/engine.cpp:405 +msgid "" +"WARNING: The game you are about to start is not yet fully supported by " +"ScummVM. As such, it is likely to be unstable, and any saves you make might " +"not work in future versions of ScummVM." +msgstr "" + +#: engines/engine.cpp:408 +msgid "Start anyway" +msgstr "" + #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" msgstr "~¿~ÞßÕà" @@ -1771,14 +1772,14 @@ msgstr " msgid "Fly to lower right" msgstr "»ÕâöâØ ÔÞÝØ×ã ÝÐßàÐÒÞ" -#: engines/scumm/scumm.cpp:1770 +#: engines/scumm/scumm.cpp:1794 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190 +#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1789,7 +1790,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155 +#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1800,7 +1801,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198 +#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1811,7 +1812,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2490 +#: engines/scumm/scumm.cpp:2514 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2178,34 +2179,34 @@ msgstr " msgid "Touchpad mode disabled." msgstr "ÀÕÖØÜ âÐçßÐÔã ÒØÜÚÝÕÝÞ." -#: backends/graphics/sdl/sdl-graphics.cpp:45 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" msgstr "±Õ× ×ÑöÛìèÕÝÝï" -#: backends/graphics/sdl/sdl-graphics.cpp:64 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64 msgctxt "lowres" msgid "Normal (no scaling)" msgstr "±Õ× ×ÑöÛìèÕÝÝï" -#: backends/graphics/sdl/sdl-graphics.cpp:2137 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "ºÞàÕÚæöï áßöÒÒöÔÝÞèÕÝÝï áâÞàöÝ" -#: backends/graphics/sdl/sdl-graphics.cpp:2143 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "ºÞàÕÚæöï áßöÒÒöÔÝÞèÕÝÝï áâÞàöÝ" -#: backends/graphics/sdl/sdl-graphics.cpp:2198 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 #, fuzzy msgid "Active graphics filter:" msgstr "¿ÕàÕÚÛîçÕÝÝï ÜöÖ ÓàÐäöçÝØÜØ äöÛìâàÐÜØ" -#: backends/graphics/sdl/sdl-graphics.cpp:2254 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461 +#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 #, fuzzy msgid "Windowed mode" msgstr "ÀÕÖØÜ àÐáâàãÒ.:" @@ -2222,20 +2223,20 @@ msgstr "OpenGL msgid "OpenGL Original" msgstr "OpenGL ÞàØÓöÝÐÛìÝØÙ" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 #, fuzzy msgid "Current display mode" msgstr "¿ÞâÞçÝØÙ ÒöÔÕÞàÕÖØÜ:" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" msgstr "" -- cgit v1.2.3 From 53dfd3a3f5687ba0b8b16522d9c9df915f7ef63c Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Mon, 20 Jun 2011 23:16:58 +0100 Subject: I18N: Regenerate translations data file --- gui/themes/translations.dat | Bin 215413 -> 220518 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index ae5fb480d3..83155bba1b 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3 From 12fc332242413dac8fbaf440220e6f022e7e9555 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 18:50:21 +1000 Subject: TSAGE: Fix for un-used variable in _sfRethinkVoiceTypes --- engines/tsage/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 42416e2bf0..fec5518fd4 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -839,7 +839,7 @@ void SoundManager::_sfRethinkVoiceTypes() { entryIndex = -1; for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if ((vtStruct->_entries[idx]._field1 != 0) && - (vtStruct->_entries[idx]._type0._priority2 > maxVoiceNum)) { + (vtStruct->_entries[idx]._type0._priority2 > maxPriority)) { maxPriority = vtStruct->_entries[idx]._type0._priority2; entryIndex = idx; } -- cgit v1.2.3 From fd84b0461468c5f1b7c0e4a33bc92c088ebda9c4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 19:44:22 +1000 Subject: TSAGE: Fixes for sound fading --- engines/tsage/sound.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index fec5518fd4..811e272086 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1341,14 +1341,14 @@ void SoundManager::_sfDoUpdateVolume(Sound *sound) { SoundDriver *driver = vse._driver; if (vs->_voiceType == VOICETYPE_0) { - if (!vse._type0._sound) { + if (vse._type0._sound) { int vol = sound->_volume * sound->_chVolume[vse._type0._channelNum] / 127; driver->proc24(voiceIndex, vse._voiceNum, sound, 7, vol); } } else { - if (!vse._type1._sound) { + if (vse._type1._sound) { int vol = sound->_volume * sound->_chVolume[vse._type1._channelNum] / 127; - driver->setVolume1(voiceIndex, vse._voiceNum, 7, vol); + driver->proc38(vse._voiceNum, 7, vol); } } } -- cgit v1.2.3 From 8c6ad70158ecdf75dd4f9e405f6afcee6dfcb982 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 21:30:57 +1000 Subject: TSAGE: Disable SFX and speech volume sliders for all games --- engines/tsage/detection_tables.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index 2b64222425..8b80edf89d 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -33,7 +33,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_Ringworld, GF_CD | GF_ALT_REGIONS @@ -47,7 +47,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_Ringworld, GF_FLOPPY @@ -61,7 +61,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_Ringworld, GF_FLOPPY | GF_DEMO @@ -76,7 +76,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_Ringworld, GF_FLOPPY | GF_DEMO | GF_ALT_REGIONS @@ -92,7 +92,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_BlueForce, GF_FLOPPY @@ -107,7 +107,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_BlueForce, GF_FLOPPY @@ -121,7 +121,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - Common::GUIO_NONE + Common::GUIO_NOSPEECH | Common::GUIO_NOSFX }, GType_BlueForce, GF_CD -- cgit v1.2.3 From 8aa368fe559bd19aedbbc7353b784466a0381485 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 21:42:42 +1000 Subject: TSAGE: Fix updating the volume when changed in the Options dialog --- engines/tsage/ringworld_demo.cpp | 1 + engines/tsage/ringworld_logic.cpp | 1 + engines/tsage/sound.cpp | 14 +++++++------- engines/tsage/sound.h | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp index fa7511808f..b24fec98f9 100644 --- a/engines/tsage/ringworld_demo.cpp +++ b/engines/tsage/ringworld_demo.cpp @@ -72,6 +72,7 @@ void RingworldDemoGame::processEvent(Event &event) { ConfigDialog *dlg = new ConfigDialog(); dlg->runModal(); delete dlg; + _globals->_soundManager.syncSounds(); _globals->_events.setCursorFromFlag(); break; } diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 2b5b84ab64..eece4abc29 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1441,6 +1441,7 @@ void RingworldGame::processEvent(Event &event) { ConfigDialog *dlg = new ConfigDialog(); dlg->runModal(); delete dlg; + _globals->_soundManager.syncSounds(); _globals->_events.setCursorFromFlag(); break; } diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 811e272086..c2e5ba716f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -43,7 +43,7 @@ SoundManager::SoundManager() { _voiceTypeStructPtrs[i] = NULL; _groupsAvail = 0; - _masterVol = 127; + _newVolume = _masterVol = 127; _suspendedCount = 0; _driversDetected = false; _needToRethink = false; @@ -100,18 +100,14 @@ void SoundManager::syncSounds() { mute = ConfMan.getBool("mute"); bool music_mute = mute; - bool sfx_mute = mute; if (!mute) { music_mute = ConfMan.getBool("music_mute"); - sfx_mute = ConfMan.getBool("sfx_mute"); } - // Get the new music and sfx volumes + // Get the new music volume int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); - int sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); - warning("Set volume music=%d sfx=%d", musicVolume, sfxVolume); this->setMasterVol(musicVolume / 2); } @@ -251,7 +247,7 @@ bool SoundManager::isInstalled(int driverNum) const { } void SoundManager::setMasterVol(int volume) { - _sfSetMasterVol(volume); + _newVolume = volume; } int SoundManager::getMasterVol() const { @@ -341,6 +337,10 @@ void SoundManager::_sfSoundServer() { _sfDereferenceAll(); } + // If the master volume has changed, update it + if (sfManager()._newVolume != sfManager()._masterVol) + _sfSetMasterVol(sfManager()._newVolume); + // Handle any fading if necessary _sfProcessFading(); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index be3924151b..0da54fc179 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -171,6 +171,7 @@ public: VoiceTypeStruct *_voiceTypeStructPtrs[SOUND_ARR_SIZE]; uint32 _groupsAvail; int _masterVol; + int _newVolume; Common::Mutex _serverDisabledMutex; Common::Mutex _serverSuspendedMutex; int _suspendedCount; -- cgit v1.2.3 From fc2aa70c967448769c45cb69959816a70f35ed42 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 21 Jun 2011 13:55:52 +0200 Subject: NEWS: Add 1.3.1 news entry to master branch too. --- NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 6fda0a8f39..d3c0f9250f 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,16 @@ For a more comprehensive changelog of the latest experimental code, see: SDL ports: - Added support for OpenGL (GSoC Task). +1.3.1 (????-??-??) + General: + - Improved audio device detection and fallback. + There should be no more silent errors due to invalid audio devices. + Instead ScummVM should pick up a suitable alternative device. + + SCUMM: + - Fixed graphics bug in FM-TOWNS versions of games on ARM devices + (Android, iPhone, etc.). + 1.3.0 (2011-05-28) New Games: - Added support for Backyard Baseball. -- cgit v1.2.3 From 36526ef954bfd105c8a3dd143a0e68e3fb9cb6b9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 22:41:17 +1000 Subject: TSAGE: Bugfix for properly stopping playing sounds --- engines/tsage/sound.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c2e5ba716f..2ecd88941d 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1416,6 +1416,7 @@ void Sound::play(int soundNum) { } void Sound::stop() { + _globals->_soundManager.removeFromPlayList(this); _unPrime(); } @@ -2252,6 +2253,7 @@ void ASound::synchronize(Serializer &s) { SYNC_POINTER(_action); s.syncAsByte(_cueValue); + } void ASound::dispatch() { -- cgit v1.2.3 From 3b7c91f2a77b49a36074f666e3801d28e7ccb999 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 21 Jun 2011 16:57:42 +0200 Subject: COMMON: Move HerculesDimensions enum to SCUMM. The enum is only used inside the SCUMM engine so it is rather pointless to keep it in common/util.h right now. Also if we really want it in some common place it should probably be better in graphics/ too. --- common/util.h | 5 ----- engines/scumm/gfx.cpp | 10 +++++----- engines/scumm/gfx.h | 5 +++++ engines/scumm/input.cpp | 2 +- engines/scumm/scumm.cpp | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/util.h b/common/util.h index 5837c8beab..cd890c970f 100644 --- a/common/util.h +++ b/common/util.h @@ -208,11 +208,6 @@ enum RenderMode { kRenderAmiga = 5 }; -enum HerculesDimensions { - kHercW = 720, - kHercH = 350 -}; - struct RenderModeDescription { const char *code; const char *description; diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 2b0ded1c0a..f22547f193 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -722,11 +722,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height); - src = _herculesBuf + x + y * Common::kHercW; - pitch = Common::kHercW; + src = _herculesBuf + x + y * kHercWidth; + pitch = kHercWidth; // center image on the screen - x += (Common::kHercW - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40 + x += (kHercWidth - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40 } else if (_useCJKMode && m == 2) { pitch *= m; x *= m; @@ -819,10 +819,10 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid int dsty = yo*2 - yo/4; for (int y1 = 0; y1 < heighto;) { - assert(dsty < Common::kHercH); + assert(dsty < kHercHeight); srcptr = src + y1 * srcPitch; - dstptr = hercbuf + dsty * Common::kHercW + xo * 2; + dstptr = hercbuf + dsty * kHercWidth + xo * 2; const int idx1 = (dsty % 7) % 2; for (int x1 = 0; x1 < widtho; x1++) { diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index af75a98731..4b44ddc376 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -32,6 +32,11 @@ namespace Scumm { class ScummEngine; +enum HerculesDimensions { + kHercWidth = 720, + kHercHeight = 350 +}; + /** Camera modes */ enum { kNormalCameraMode = 1, diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 07c52578c3..5eea7acc6b 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -181,7 +181,7 @@ void ScummEngine::parseEvent(Common::Event event) { _mouse.y = event.mouse.y; if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { - _mouse.x -= (Common::kHercW - _screenWidth * 2) / 2; + _mouse.x -= (kHercWidth - _screenWidth * 2) / 2; _mouse.x >>= 1; _mouse.y = _mouse.y * 4 / 7; } else if (_useCJKMode && _textSurfaceMultiplier == 2) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index ed5537f409..7b136dc36d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -564,7 +564,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _herculesBuf = 0; if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { - _herculesBuf = (byte *)malloc(Common::kHercW * Common::kHercH); + _herculesBuf = (byte *)malloc(kHercWidth * kHercHeight); } // Add debug levels @@ -1140,7 +1140,7 @@ Common::Error ScummEngine::init() { // Initialize backend if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { - initGraphics(Common::kHercW, Common::kHercH, true); + initGraphics(kHercWidth, kHercHeight, true); } else { int screenWidth = _screenWidth; int screenHeight = _screenHeight; -- cgit v1.2.3 From 55ed69dbab7a4856c59fe676cc6721110cb405e6 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 21 Jun 2011 21:01:02 +0200 Subject: DREAMWEB: Remove control char from source --- devtools/tasmrecover/dreamweb/dreamweb.asm | 2 -- 1 file changed, 2 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index fd9bfb715c..d357c5cd73 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -6276,5 +6276,3 @@ STACKSPACE ends - - -- cgit v1.2.3 From 25513893044032b2595992936e1e6011889197fd Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 21 Jun 2011 23:50:01 +0200 Subject: DREAMWEB: Fix bug in tasmrecover causing load/save mixup This is a regression from c1b9adb6912 and (my commit) 287c23f1263c. It is not safe to remove opcodes from proc.stmts since labels are sometimes referenced by their offset in the list. So, instead they are now replaced by op._nop. This fixes kLoadingorsave not being set in doload(), which was visible when going to the load game menu from the startup menu. --- devtools/tasmrecover/tasm/proc.py | 33 +++++++++++++++------------------ engines/dreamweb/dreamgen.cpp | 3 ++- engines/dreamweb/dreamgen.h | 6 +++--- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py index c127c406f7..ed7053df89 100644 --- a/devtools/tasmrecover/tasm/proc.py +++ b/devtools/tasmrecover/tasm/proc.py @@ -23,9 +23,9 @@ class proc: self.labels.remove(label) except: pass - for l in self.stmts: - if isinstance(l, op.label) and l.name == label: - self.stmts.remove(l) + for i in xrange(len(self.stmts)): + if isinstance(self.stmts[i], op.label) and self.stmts[i].name == label: + self.stmts[i] = op._nop(None) return def optimize_sequence(self, cls): @@ -48,7 +48,8 @@ class proc: n = j - i if n > 1: print "Eliminate consequtive storage instructions at %u-%u" %(i, j) - del stmts[i + 1:j] + for k in range(i+1,j): + stmts[k] = op._nop(None) stmts[i].repeat = n else: i = j @@ -63,7 +64,7 @@ class proc: if isinstance(stmts[i + 1], cls): stmts[i + 1].repeat = 'cx' stmts[i + 1].clear_cx = True - del stmts[i] + stmts[i] = op._nop(None) i += 1 return @@ -78,7 +79,7 @@ class proc: if not isinstance(self.stmts[i], op.label): continue j = i - while j < len(self.stmts) and isinstance(self.stmts[j], op.label): + while j < len(self.stmts) and isinstance(self.stmts[j], (op.label, op._nop)): j += 1 if j == len(self.stmts) or isinstance(self.stmts[j], op._ret): print "Return label: %s" % (self.stmts[i].name,) @@ -121,18 +122,14 @@ class proc: print self.labels self.remove_label(s.name) - #removing duplicate rets - i = 0 - while i < len(self.stmts)-1: - if isinstance(self.stmts[i], op._ret) and isinstance(self.stmts[i+1], op._ret): - del self.stmts[i] - else: - i += 1 - - #removing last ret - while len(self.stmts) > 0 and isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)): - print "stripping last ret" - self.stmts.pop() + #removing duplicate rets and rets at end + for i in xrange(len(self.stmts)): + if isinstance(self.stmts[i], op._ret): + j = i+1 + while j < len(self.stmts) and isinstance(self.stmts[j], op._nop): + j += 1 + if j == len(self.stmts) or isinstance(self.stmts[j], op._ret): + self.stmts[i] = op._nop(None) self.optimize_sequence(op._stosb); self.optimize_sequence(op._stosw); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9349436ca2..da0d71f7fe 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -13226,7 +13226,7 @@ void DreamGenContext::useaxe() { return; notinpool: showfirstuse(); -/*continuing to unbounded code: axeondoor from useelvdoor:19-29*/ +/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ axeondoor: al = 15; cx = 300; @@ -16886,6 +16886,7 @@ alreadynewgame: void DreamGenContext::doload() { STACK_CHECK; + data.byte(kLoadingorsave) = 1; showopbox(); showloadops(); data.byte(kCurrentslot) = 0; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 2d05f9c791..b012663ab6 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -600,6 +600,7 @@ public: void clearbuffers(); void neterror(); void storeit(); + void lockeddoorway(); void isitworn(); void putundertimed(); void dumpmap(); @@ -954,8 +955,9 @@ public: void showmonk(); void diarykeyn(); void set16colpalette(); - void sparky(); + void convicons(); void interviewer(); + void sparky(); void purgeanitem(); void madman(); void createpanel(); @@ -1250,14 +1252,12 @@ public: void usechurchgate(); void monkandryan(); void allocatebuffers(); - void convicons(); void swapwithinv(); void usecontrol(); void buttonseven(); void redrawmainscrn(); void finishedwalking(); void findallryan(); - void lockeddoorway(); void channel0tran(); void buttonpress(); void parseblaster(); -- cgit v1.2.3 From c288d6d20729563c6ce3416fd641947a35562469 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 22 Jun 2011 00:20:05 +0300 Subject: LASTEXPRESS: Implement sound filters. Still not hooked in. --- engines/lastexpress/game/sound.cpp | 351 +++++++++++++++++++++++++++++++++++++ engines/lastexpress/game/sound.h | 2 +- 2 files changed, 352 insertions(+), 1 deletion(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 3f98ac79ea..b8d2755907 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -1948,4 +1948,355 @@ void SoundManager::stopAllSound() { (*i)->soundStream->stop(); } +////////////////////////////////////////////////////////////////////////// +// Sound filter +////////////////////////////////////////////////////////////////////////// + +static int filterData[1424] = { + 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256, + 384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0, + 192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640, + 64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128, + 320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576, + 704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192, + 192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448, + 576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832, + 320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320, + 320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704, + 832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448, + 448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448, + 640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960, + 1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576, + 576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576, + 576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832, + 960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088, + 1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704, + 704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768, + 768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960, + 1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280, + 1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896, + 896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896, + 896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152, + 1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408, + 1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, + 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088, + 1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088, + 1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152, + 1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152, + 1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408, + 1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536, + 1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728, + 1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856, + 1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344, + 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408, + 1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408, + 1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472, + 1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664, + 1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856, + 1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984, + 2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, + 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664, + 1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664, + 1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728, + 1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728, + 1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984, + 2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112, + 2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304, + 2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432, + 1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920, + 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984, + 1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984, + 1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048, + 2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240, + 2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432, + 2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560, + 2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, + 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240, + 2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240, + 2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304, + 2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304, + 2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560, + 2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688, + 2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880, + 3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008, + 2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496, + 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560, + 2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560, + 2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624, + 2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816, + 2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008, + 3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136, + 3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, + 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816, + 2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816, + 2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880, + 2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880, + 3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136, + 3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264, + 3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456, + 3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584, + 3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072, + 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136, + 3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136, + 3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200, + 3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392, + 3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584, + 3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712, + 3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, + 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392, + 3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392, + 3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456, + 3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456, + 3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712, + 3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840, + 3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032, + 4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160, + 3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648, + 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712, + 3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712, + 3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776, + 3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968, + 4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160, + 4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288, + 4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, + 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968, + 3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968, + 3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032, + 4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032, + 4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288, + 4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416, + 4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608, + 4736, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736, + 4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224, + 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288, + 4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288, + 4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352, + 4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544, + 4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736, + 4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864, + 4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, + 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544, + 4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544, + 4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608, + 4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608, + 4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864, + 4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992, + 5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184, + 5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312, + 4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800, + 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864, + 4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864, + 4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928, + 5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120, + 5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312, + 5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440, + 5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, + 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120, + 5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120, + 5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184, + 5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184, + 5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440, + 5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568, + 5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, + 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632, + 5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376, + 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440, + 5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440, + 5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, + 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632, + 5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, + 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632, + 5632 +}; + +static int filterData2[1424] = { + 0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11, + -13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, + -11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5, + -7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18, + -1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12, + 15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4, + 7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19, + -22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14, + -17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5, + -8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26, + 30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10, + 14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27, + -31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16, + -21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2, + -7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25, + 31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3, + 9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34, + -40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17, + -24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50, + 58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21, + 29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55, + -63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32, + -41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5, + -15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50, + 61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6, + 18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56, + -68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20, + -34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82, + 97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8, + 24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74, + -90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9, + -27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70, + 90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130, + -150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55, + -77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133, + 157, 181, -12, -36, -60, -84, -109, -133, -157, -181, + 13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93, + -120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191, + 221, -14, -44, -73, -103, -132, -162, -191, -221, 16, + 48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113, + -146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232, + 268, -17, -53, -89, -125, -160, -196, -232, -268, 19, + 58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137, + -176, -215, -255, -294, 21, 64, 108, 151, 194, 237, + 281, 324, -21, -64, -108, -151, -194, -237, -281, -324, + 23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118, + -166, -213, -261, -308, -356, 26, 78, 130, 182, 235, + 287, 339, 391, -26, -78, -130, -182, -235, -287, -339, + -391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86, + -143, -201, -258, -316, -373, -431, 31, 94, 158, 221, + 284, 347, 411, 474, -31, -94, -158, -221, -284, -347, + -411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34, + -104, -174, -244, -313, -383, -453, -523, 38, 115, 191, + 268, 345, 422, 498, 575, -38, -115, -191, -268, -345, + -422, -498, -575, 42, 126, 210, 294, 379, 463, 547, + 631, -42, -126, -210, -294, -379, -463, -547, -631, + 46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231, + -324, -417, -510, -602, -695, 51, 153, 255, 357, 459, + 561, 663, 765, -51, -153, -255, -357, -459, -561, -663, + -765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168, + -280, -392, -505, -617, -729, -841, 61, 185, 308, 432, + 555, 679, 802, 926, -61, -185, -308, -432, -555, -679, + -802, -926, 68, 204, 340, 476, 612, 748, 884, 1020, + -68, -204, -340, -476, -612, -748, -884, -1020, 74, + 224, 373, 523, 672, 822, 971, 1121, -74, -224, -373, + -523, -672, -822, -971, -1121, 82, 246, 411, 575, 740, + 904, 1069, 1233, -82, -246, -411, -575, -740, -904, + -1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357, + -90, -271, -452, -633, -814, -995, -1176, -1357, 99, + 298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497, + -696, -895, -1094, -1293, -1492, 109, 328, 547, 766, + 985, 1204, 1423, 1642, -109, -328, -547, -766, -985, + -1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324, + 1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564, + -1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132, + -397, -662, -927, -1192, -1457, -1722, -1987, 145, 437, + 728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728, + -1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121, + 1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442, + -1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940, + 2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292, + -2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910, + -194, -582, -970, -1358, -1746, -2134, -2522, -2910, + 213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213, + -640, -1066, -1493, -1920, -2347, -2773, -3200, 234, + 704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704, + -1173, -1643, -2112, -2582, -3051, -3521, 258, 774, + 1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291, + -1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988, + 2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556, + -3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436, + 4060, 4685, -312, -937, -1561, -2186, -2811, -3436, + -4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467, + 5154, -343, -1030, -1718, -2405, -3092, -3779, -4467, + -5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670, + -378, -1134, -1890, -2646, -3402, -4158, -4914, -5670, + 415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415, + -1247, -2079, -2911, -3742, -4574, -5406, -6238, 457, + 1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372, + -2287, -3202, -4117, -5032, -5947, -6862, 503, 1509, + 2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516, + -3522, -4529, -5535, -6542, -7548, 553, 1660, 2767, + 3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874, + -4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479, + 6697, 7915, 9133, -608, -1826, -3044, -4262, -5479, + -6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367, + 8706, 10046, -669, -2009, -3348, -4688, -6027, -7367, + -8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577, + 11051, -736, -2210, -3683, -5157, -6630, -8104, -9577, + -11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157, + -810, -2431, -4052, -5673, -7294, -8915, -10536, -12157, + 891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891, + -2674, -4457, -6240, -8023, -9806, -11589, -13372, 980, + 2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941, + -4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236, + 5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236, + -5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559, + 5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559, + -5933, -8306, -10679, -13052, -15426, -17799, 1305, + 3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305, + -3915, -6526, -9136, -11747, -14357, -16968, -19578, + 1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538, + -1435, -4307, -7179, -10051, -12922, -15794, -18666, + -21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531, + 23690, -1579, -4738, -7896, -11055, -14214, -17373, + -20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111, + 22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111, + -22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022, + 24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022, + -24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124, + 27329, 31533, -2102, -6306, -10511, -14715, -18920, + -23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812, + 25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812, + -25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893, + 27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893, + -27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183, + 30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183, + -30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700, + 32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700, + -32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471, + 32767, 32767, 32767, -3385, -10157, -16928, -23700, + -30471, -32767, -32767, -32767, 3724, 11172, 18621, + 26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621, + -26069, -32767, -32767, -32767, -32767, 4095, 12287, + 20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287, + -20479, -28671, -32767, -32767, -32767, -32767 +}; + +static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0}; +static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1}; + +static void soundFilter(byte *data, int16 *buffer, int p1, int p2); + +void SoundManager::applyFilter(SoundEntry *entry, int16 *buffer) { + if ((((byte *)entry->soundData)[1] << 6) > 0x1600) { + entry->status.status |= 0x20000000; + } else { + int variant = entry->status.status & 0x1f; + + soundFilter((byte *)entry->soundData, buffer, p1s[variant], p2s[variant]); + } +} + + +static void soundFilter(byte *data, int16 *buffer, int p1, int p2) { + int data1, data2, data1p, data2p; + byte idx; + + data2 = data[0]; + data1 = data[1] << 6; + + data += 2; + + for (int count = 0; count < 735; count++) { + idx = data[count] >> 4; + data1p = filterData[idx + data1]; + data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767); + + buffer[2 * count] = (p2 * data2p) >> p1; + + idx = data[count] & 0xF; + + data1 = filterData[idx + data1p]; + data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767); + buffer[2 * count + 1] = (p2 * data2) >> p1; + } +} + + } // End of namespace LastExpress diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index ddafc21829..5b1fe64cd8 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -381,7 +381,7 @@ private: void drawSubtitleOnScreen(SubtitleEntry *subtitle); // Sound filter - void applyFilter(SoundEntry *entry, SoundBuffer buffer); + void applyFilter(SoundEntry *entry, int16 *buffer); }; } // End of namespace LastExpress -- cgit v1.2.3 From 1fe9985912c3bb819d1145b03389a615f9b11401 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 22 Jun 2011 10:41:38 +0300 Subject: LASTEXPRESS: Named several soundEntry structure members --- engines/lastexpress/game/sound.cpp | 10 +++++----- engines/lastexpress/game/sound.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index b8d2755907..4779fc532f 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -614,16 +614,16 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { if (entry->name2.matchString("NISSND?") && (entry->status.status & kFlagType7) != kFlag3) { s.syncAsUint32LE(entry->status.status); // status; s.syncAsUint32LE(entry->type); // type; - s.syncAsUint32LE(entry->field_1C); // field_8; + s.syncAsUint32LE(entry->blockCount); // field_8; s.syncAsUint32LE(entry->time); // time; s.syncAsUint32LE(entry->field_34); // field_10; s.syncAsUint32LE(entry->field_38); // field_14; s.syncAsUint32LE(entry->entity); // entity; - uint32 field_1C = (uint32)entry->field_48 - _data2; - if (field_1C > kFlag8) - field_1C = 0; - s.syncAsUint32LE(field_1C); // field_1C; + uint32 blockCount = (uint32)entry->field_48 - _data2; + if (blockCount > kFlag8) + blockCount = 0; + s.syncAsUint32LE(blockCount); // blockCount; s.syncAsUint32LE(entry->field_4C); // field_20; diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index 5b1fe64cd8..839c868813 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -246,14 +246,14 @@ private: struct SoundEntry { SoundStatusUnion status; SoundType type; // int - //int field_8; - //int field_C; - int processedFrameCount; + //int data; + //int endOffset; + int currentDataPtr; void *soundData; - //int field_18; - int field_1C; + //int currentBufferPtr; + int blockCount; uint32 time; - //int field_24; + //int size; //int field_28; Common::SeekableReadStream *stream; // int //int field_30; @@ -276,10 +276,10 @@ private: status.status = 0; type = kSoundTypeNone; - processedFrameCount = 0; + currentDataPtr = 0; soundData = NULL; - field_1C = 0; + blockCount = 0; time = 0; stream = NULL; -- cgit v1.2.3 From 45e1d7aa0dc144792bf5b922d79337dec621ef81 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Jun 2011 22:54:25 +1000 Subject: TSAGE: Bugfix for sound assert in scene 20 --- engines/tsage/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 2ecd88941d..980e080e73 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1808,7 +1808,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { return; int channelNum = _trkChannel[trackIndex]; - assert((channelNum >= 0) && (channelNum < SOUND_ARR_SIZE)); + assert((channelNum >= -1) && (channelNum < SOUND_ARR_SIZE)); int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum]; int voiceNum = -1; SoundDriver *driver = NULL; -- cgit v1.2.3 From 7ef6bea74ef157d57c75cf3d582c838dbc651b87 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Jun 2011 18:30:59 +1000 Subject: TSAGE: Clarified Globals::_sceneListeners as Globals::_sounds --- engines/tsage/globals.cpp | 15 ++++++++++++--- engines/tsage/globals.h | 5 ++++- engines/tsage/scenes.cpp | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index e54f1073b0..34b26ec311 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -94,8 +94,8 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _sceneObjects_queue.push_front(_sceneObjects); _prevSceneOffset = Common::Point(-1, -1); - _sceneListeners.push_back(&_soundHandler); - _sceneListeners.push_back(&_sequenceManager._soundHandler); + _sounds.push_back(&_soundHandler); + _sounds.push_back(&_sequenceManager._soundHandler); _scrollFollower = NULL; _inventory = NULL; @@ -148,7 +148,7 @@ void Globals::synchronize(Serializer &s) { } s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y); - _sceneListeners.synchronize(s); + _sounds.synchronize(s); for (int i = 0; i < 256; ++i) s.syncAsByte(_flags[i]); @@ -158,4 +158,13 @@ void Globals::synchronize(Serializer &s) { s.syncAsSint32LE(_stripNum); } +void Globals::dispatchSound(ASound *obj) { + obj->dispatch(); +} + +void Globals::dispatchSounds() { + Common::for_each(_sounds.begin(), _sounds.end(), Globals::dispatchSound); +} + + } // end of namespace tSage diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 3635fcc3fa..7cfec718e2 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -34,6 +34,8 @@ namespace tSage { class Globals : public SavedObject { +private: + static void dispatchSound(ASound *obj); public: GfxSurface _screenSurface; GfxManager _gfxManagerInstance; @@ -56,7 +58,7 @@ public: SoundManager _soundManager; Common::Point _dialogCenter; WalkRegions _walkRegions; - SynchronizedList _sceneListeners; + SynchronizedList _sounds; bool _flags[256]; Player _player; ASound _soundHandler; @@ -91,6 +93,7 @@ public: GfxManager &gfxManager() { return **_gfxManagers.begin(); } virtual Common::String getClassName() { return "Globals"; } virtual void synchronize(Serializer &s); + void dispatchSounds(); }; extern Globals *_globals; diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 4625661b62..a820a20167 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -55,7 +55,7 @@ void SceneManager::checkScene() { _nextSceneNumber = -1; } - Common::for_each(_globals->_sceneListeners.begin(), _globals->_sceneListeners.end(), SceneHandler::dispatchObject); + _globals->dispatchSounds(); } void SceneManager::sceneChange() { -- cgit v1.2.3 From f67f069e3f830b824f1f61db03ebbe7bddb9c19f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Jun 2011 18:58:59 +1000 Subject: TSAGE: Fix sounds not getting registered in Globals::_sounds This fixes a problem in Scene 20 where the scene wasn't ending after a sound fade --- engines/tsage/sound.cpp | 10 +++++++++- engines/tsage/sound.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 980e080e73..d57aa876e2 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -302,7 +302,8 @@ void SoundManager::addToPlayList(Sound *sound) { } void SoundManager::removeFromPlayList(Sound *sound) { - _sfRemoveFromPlayList(sound); + if (_soundManager) + _sfRemoveFromPlayList(sound); } bool SoundManager::isOnPlayList(Sound *sound) { @@ -2246,6 +2247,13 @@ int Sound::_soFindSound(VoiceTypeStruct *vtStruct, int channelNum) { ASound::ASound(): EventHandler() { _action = NULL; _cueValue = -1; + if (_globals) + _globals->_sounds.push_back(this); +} + +ASound::~ASound() { + if (_globals) + _globals->_sounds.remove(this); } void ASound::synchronize(Serializer &s) { diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 0da54fc179..9a8cfb3cfc 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -361,6 +361,7 @@ public: int _cueValue; ASound(); + ~ASound(); virtual void synchronize(Serializer &s); virtual void dispatch(); -- cgit v1.2.3 From 69290ef7aeba8e67a1d537fff20825b9f39a1d86 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Jun 2011 19:13:36 +1000 Subject: TSAGE: Remove out of date TODO comments where applicable --- engines/tsage/core.cpp | 11 ++++------- engines/tsage/graphics.cpp | 2 +- engines/tsage/ringworld_logic.cpp | 1 - engines/tsage/ringworld_scenes1.cpp | 3 +-- engines/tsage/scenes.cpp | 3 --- engines/tsage/scenes.h | 4 +++- engines/tsage/sound.cpp | 1 - 7 files changed, 9 insertions(+), 16 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 4603379c78..76714a6f10 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2869,8 +2869,6 @@ void Region::draw() { } void Region::uniteLine(int yp, LineSliceSet &sliceSet) { - // TODO: More properly implement like the original - // First expand the bounds as necessary to fit in the row if (_ySlices.empty()) { _bounds = Rect(sliceSet.items[0].xs, yp, sliceSet.items[sliceSet.items.size() - 1].xe, yp + 1); @@ -3024,13 +3022,12 @@ void WalkRegion::loadProcessList(byte *dataP, int dataSize, int &dataIndex, int int yp = READ_LE_UINT16(dataP + idx * 4 + 2); if (yp != y1) { /* - * Commented out: doesn't seem to be used + * Commented out: v doesn't seem to be used int v; if (idx == (dataSize - 1)) v = READ_LE_UINT16(dataP + 2); else v = process1(idx, dataP, dataSize); - warning("TODO: v not used? - %d", v); */ process2(dataIndex, x1, y1, xp, yp); ++dataIndex; @@ -3547,9 +3544,10 @@ void SceneHandler::dispatch() { if (_globals->_sceneManager._scene) _globals->_sceneManager._scene->dispatch(); - //TODO: Figure out purpose of the given list - //_globals->_regions.forEach(SceneHandler::handleListener); + // Not actually used + //_eventListeners.forEach(SceneHandler::handleListener); + // Handle pending eents Event event; while (_globals->_events.getEvent(event)) process(event); @@ -3573,7 +3571,6 @@ void SceneHandler::dispatchObject(EventHandler *obj) { } void SceneHandler::saveListener(Serializer &ser) { - warning("TODO: SceneHandler::saveListener"); } } // End of namespace tSage diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 23f5f22573..1d432724dc 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -895,7 +895,7 @@ bool GfxButton::process(Event &event) { case EVENT_KEYPRESS: if (!event.handled && (event.kbd.keycode == _keycode)) { - // TODO: Ensure momentary click operation displays + // Highlight the button momentarily highlight(); g_system->delayMillis(20); highlight(); diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index eece4abc29..1dd905b3b6 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -667,7 +667,6 @@ void SpeakerQL::setText(const Common::String &msg) { /*--------------------------------------------------------------------------*/ SpeakerSR::SpeakerSR() { - // TODO: check initialization of object3 _speakerName = "SR"; _newSceneNumber = 2811; _textPos = Common::Point(10, 30); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index 717841d4fc..29b7c9b997 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -1255,8 +1255,7 @@ void Scene40::Action7::signal() { switch (_actionIndex++) { case 0: - // TODO: check if it's rand(500) or rand(499)+500 - setDelay(_globals->_randomSource.getRandomNumber(500)); + setDelay(_globals->_randomSource.getRandomNumber(499) + 500); break; case 1: scene->_object7.postInit(); diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index a820a20167..6352918e39 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -105,8 +105,6 @@ void SceneManager::sceneChange() { // Set the next scene to be active _sceneNumber = _nextSceneNumber; - // TODO: Unknown check of word_45CD3 / call to saver method - // Free any regions disposeRegions(); @@ -208,7 +206,6 @@ void SceneManager::setBackSurface() { } void SceneManager::saveListener(int saveMode) { - warning("TODO: SceneManager::saveLIstener"); } void SceneManager::loadNotifier(bool postFlag) { diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index b3c009c4fe..5845efaec9 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -71,7 +71,9 @@ public: class SceneManager : public GameHandler, public SaveListener { private: - void disposeRegions() { warning("TODO: disposeRegions()"); } + void disposeRegions() { + // No need to do anything, since regions will be freed automatically when the scene is + } Scene *getNewScene(); public: Scene *_scene; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index d57aa876e2..dc7b6599ed 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -1869,7 +1869,6 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { if (channelNum != -1) { if (voiceType == VOICETYPE_1) { - // TODO: sub_25E32/sub_25DD8 if (chFlags & 0x10) _soProc42(vtStruct, channelNum, chVoiceType, v); else -- cgit v1.2.3 From f646ab3c863923f9d1f87ca3b13cc288a7934033 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Jun 2011 01:34:57 +0200 Subject: SCI: Mark sq6 as a CD game --- engines/sci/detection_tables.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 4634edb1a8..0010f095e1 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -3572,7 +3572,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528}, {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG) // SCI interpreter version 2.100.002 (just a guess) @@ -3580,7 +3580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528}, {"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, + Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - French DOS/Win3.11 CD (from French magazine Joystick - September 1997) // Executable scanning reports "2.100.002", VERSION file reports "1.0" @@ -3588,7 +3588,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "3c831625931d5079b73ae8c275f52c95", 10534}, {"resource.000", 0, "4195ca940f759424f62b90e262cc1737", 40932397}, AD_LISTEND}, - Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, + Common::FR_FRA, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884) // SCI interpreter version 2.100.002 (just a guess) @@ -3596,7 +3596,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534}, {"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE }, + Common::DE_DEU, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE }, // Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG) // SCI interpreter version 2.100.002 (just a guess) -- cgit v1.2.3 From c2d31c4ca53fd209f48b50a6c6761999365df1ee Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 22 Jun 2011 11:52:58 +0200 Subject: CREDITS: Mark myself as retired --- AUTHORS | 17 ++++++++--------- devtools/credits.pl | 17 ++++++++--------- gui/credits.h | 12 ++++++++---- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/AUTHORS b/AUTHORS index feaa178e6e..6492b4781d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,13 +2,13 @@ ScummVM Team ************ Project Leaders --------------- - Max Horn Eugene Sandulenko Retired Project Leaders ----------------------- James Brown Vincent Hamm - ScummVM co-founder, Original Cruise/CinE author + Max Horn Ludvig Strigeus - Original ScummVM and SimonVM author Engine Teams @@ -18,7 +18,7 @@ ScummVM Team James Brown - (retired) Jonathan Gray - (retired) Vincent Hamm - (retired) - Max Horn + Max Horn - (retired) Travis Howell - (retired) Pawel Kolodziejski - Codecs, iMUSE, Smush, etc. Gregory Montoir @@ -138,7 +138,7 @@ ScummVM Team SCI: Greg Frieger Paul Gilbert - Max Horn + Max Horn - (retired) Filippos Karapetis Martin Kiewitz Walter van Niftrik @@ -164,7 +164,7 @@ ScummVM Team Sword25: Eugene Sandulenko Filippos Karapetis - Max Horn + Max Horn - (retired) Paul Gilbert Torbjorn Andersson @@ -177,7 +177,7 @@ ScummVM Team Fabio Battaglia - PSX version support Paul Gilbert Sven Hesse - Max Horn + Max Horn - (retired) Filippos Karapetis Joost Peters @@ -238,7 +238,7 @@ ScummVM Team Yotam Barnoy SDL (Win/Linux/OS X/etc.): - Max Horn + Max Horn - (retired) Eugene Sandulenko - Asm routines, GFX layers SymbianOS: @@ -255,7 +255,7 @@ ScummVM Team ---------------- Infrastructure: Max Horn - Backend & Engine APIs, file API, sound mixer, - audiostreams, data structures, etc. + audiostreams, data structures, etc. (retired) Eugene Sandulenko Johannes Schickel @@ -285,7 +285,6 @@ ScummVM Team James Brown - IRC Logs maintainer Thierry Crozat - Wiki maintainer Andre Heider - Buildbot maintainer - Max Horn - Forum, IRC channel and Mailing list maintainer Joost Peters - Doxygen Project Documentation maintainer Jordi Vilalta Prat - Wiki maintainer Eugene Sandulenko - Forum, IRC channel, Screen Shots and Mailing @@ -339,7 +338,7 @@ Other contributions Willem Jan Palenstijn Mac OS X: - Max Horn + Max Horn - (retired) Oystein Eftevaag Mandriva: diff --git a/devtools/credits.pl b/devtools/credits.pl index bf48304af3..48ce5e28e7 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -447,7 +447,6 @@ begin_credits("Credits"); begin_section("ScummVM Team"); begin_section("Project Leaders"); begin_persons(); - add_person("Max Horn", "Fingolfin", ""); add_person("Eugene Sandulenko", "sev", ""); end_persons(); end_section(); @@ -456,6 +455,7 @@ begin_credits("Credits"); begin_persons(); add_person("James Brown", "ender", ""); add_person("Vincent Hamm", "yaz0r", "ScummVM co-founder, Original Cruise/CinE author"); + add_person("Max Horn", "Fingolfin", ""); add_person("Ludvig Strigeus", "ludde", "Original ScummVM and SimonVM author"); end_persons(); end_section(); @@ -466,7 +466,7 @@ begin_credits("Credits"); add_person("James Brown", "ender", "(retired)"); add_person("Jonathan Gray", "khalek", "(retired)"); add_person("Vincent Hamm", "yaz0r", "(retired)"); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Travis Howell", "Kirben", "(retired)"); add_person("Paweł Kołodziejski", "aquadran", "Codecs, iMUSE, Smush, etc."); add_person("Gregory Montoir", "cyx", ""); @@ -606,7 +606,7 @@ begin_credits("Credits"); begin_section("SCI"); add_person("Greg Frieger", "_FRG_", ""); add_person("Paul Gilbert", "dreammaster", ""); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Filippos Karapetis", "[md5]", ""); add_person("Martin Kiewitz", "m_kiewitz", ""); add_person("Walter van Niftrik", "waltervn", ""); @@ -636,7 +636,7 @@ begin_credits("Credits"); begin_section("Sword25"); add_person("Eugene Sandulenko", "sev", ""); add_person("Filippos Karapetis", "[md5]", ""); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Paul Gilbert", "dreammaster", ""); add_person("Torbjörn Andersson", "eriktorbjorn", ""); end_section(); @@ -652,7 +652,7 @@ begin_credits("Credits"); add_person("Fabio Battaglia", "Hkz", "PSX version support"); add_person("Paul Gilbert", "dreammaster", ""); add_person("Sven Hesse", "DrMcCoy", ""); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Filippos Karapetis", "[md5]", ""); add_person("Joost Peters", "joostp", ""); end_section(); @@ -732,7 +732,7 @@ begin_credits("Credits"); end_section(); begin_section("SDL (Win/Linux/OS X/etc.)"); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Eugene Sandulenko", "sev", "Asm routines, GFX layers"); end_section(); @@ -753,7 +753,7 @@ begin_credits("Credits"); begin_section("Other subsystems"); begin_section("Infrastructure"); - add_person("Max Horn", "Fingolfin", "Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc."); + add_person("Max Horn", "Fingolfin", "Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc. (retired)"); add_person("Eugene Sandulenko", "sev", ""); add_person("Johannes Schickel", "LordHoto", ""); end_section(); @@ -785,7 +785,6 @@ begin_credits("Credits"); add_person("James Brown", "Ender", "IRC Logs maintainer"); add_person("Thierry Crozat", "criezy", "Wiki maintainer"); add_person("Andre Heider", "dhewg", "Buildbot maintainer"); - add_person("Max Horn", "Fingolfin", "Forum, IRC channel and Mailing list maintainer"); add_person("Joost Peters", "JoostP", "Doxygen Project Documentation maintainer"); add_person("Jordi Vilalta Prat", "jvprat", "Wiki maintainer"); add_person("Eugene Sandulenko", "sev", "Forum, IRC channel, Screen Shots and Mailing list maintainer"); @@ -849,7 +848,7 @@ begin_credits("Credits"); end_section(); begin_section("Mac OS X"); - add_person("Max Horn", "Fingolfin", ""); + add_person("Max Horn", "Fingolfin", "(retired)"); add_person("Oystein Eftevaag", "vinterstum", ""); end_section(); diff --git a/gui/credits.h b/gui/credits.h index ba679c433c..5bc6d56ff4 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -3,13 +3,13 @@ static const char *credits[] = { "C1""ScummVM Team", "", "C1""Project Leaders", -"C0""Max Horn", "C0""Eugene Sandulenko", "", "C1""Retired Project Leaders", "C0""James Brown", "C0""Vincent Hamm", "C2""ScummVM co-founder, Original Cruise/CinE author", +"C0""Max Horn", "C0""Ludvig Strigeus", "C2""Original ScummVM and SimonVM author", "", @@ -23,6 +23,7 @@ static const char *credits[] = { "C0""Vincent Hamm", "C2""(retired)", "C0""Max Horn", +"C2""(retired)", "C0""Travis Howell", "C2""(retired)", "C0""Pawel Kolodziejski", @@ -156,6 +157,7 @@ static const char *credits[] = { "C0""Greg Frieger", "C0""Paul Gilbert", "C0""Max Horn", +"C2""(retired)", "C0""Filippos Karapetis", "C0""Martin Kiewitz", "C0""Walter van Niftrik", @@ -189,6 +191,7 @@ static const char *credits[] = { "C0""Eugene Sandulenko", "C0""Filippos Karapetis", "C0""Max Horn", +"C2""(retired)", "C0""Paul Gilbert", "C0""Torbj\366rn Andersson", "", @@ -204,6 +207,7 @@ static const char *credits[] = { "C0""Paul Gilbert", "C0""Sven Hesse", "C0""Max Horn", +"C2""(retired)", "C0""Filippos Karapetis", "C0""Joost Peters", "", @@ -268,6 +272,7 @@ static const char *credits[] = { "", "C1""SDL (Win/Linux/OS X/etc.)", "C0""Max Horn", +"C2""(retired)", "C0""Eugene Sandulenko", "C2""Asm routines, GFX layers", "", @@ -285,7 +290,7 @@ static const char *credits[] = { "C1""Other subsystems", "C1""Infrastructure", "C0""Max Horn", -"C2""Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc.", +"C2""Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc. (retired)", "C0""Eugene Sandulenko", "C0""Johannes Schickel", "", @@ -320,8 +325,6 @@ static const char *credits[] = { "C2""Wiki maintainer", "C0""Andre Heider", "C2""Buildbot maintainer", -"C0""Max Horn", -"C2""Forum, IRC channel and Mailing list maintainer", "C0""Joost Peters", "C2""Doxygen Project Documentation maintainer", "C0""Jordi Vilalta Prat", @@ -390,6 +393,7 @@ static const char *credits[] = { "", "C1""Mac OS X", "C0""Max Horn", +"C2""(retired)", "C0""Oystein Eftevaag", "", "C1""Mandriva", -- cgit v1.2.3 From 7dca4bf09683650b3a8ce44d87723460226f98f8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 22 Jun 2011 18:11:13 +0200 Subject: LASTEXPRESS: Make some static data const respectively static. --- engines/lastexpress/game/sound.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 4779fc532f..1c7abbf95e 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -40,7 +40,7 @@ namespace LastExpress { #define SOUNDCACHE_MAX_SIZE 6 // Letters & messages -const char *messages[24] = { +static const char *const messages[24] = { "", "TXT1001", // 1 "TXT1001A", // 2 @@ -67,7 +67,7 @@ const char *messages[24] = { "ENDALRM3" // 65 }; -const char *cities[17] = { +static const char *const cities[17] = { "EPERNAY", "CHALONS", "BARLEDUC", @@ -87,7 +87,7 @@ const char *cities[17] = { "POLICE" }; -const char *locomotiveSounds[5] = { +static const char *const locomotiveSounds[5] = { "ZFX1005", "ZFX1006", "ZFX1007", @@ -1952,7 +1952,7 @@ void SoundManager::stopAllSound() { // Sound filter ////////////////////////////////////////////////////////////////////////// -static int filterData[1424] = { +static const int filterData[1424] = { 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0, 192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640, @@ -2109,7 +2109,7 @@ static int filterData[1424] = { 5632 }; -static int filterData2[1424] = { +static const int filterData2[1424] = { 0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11, -13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, -11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5, @@ -2258,8 +2258,8 @@ static int filterData2[1424] = { -20479, -28671, -32767, -32767, -32767, -32767 }; -static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0}; -static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1}; +static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0 }; +static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 }; static void soundFilter(byte *data, int16 *buffer, int p1, int p2); -- cgit v1.2.3 From cb37f4517baa4435c7cc0774d5a830173a6dc0db Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 22 Jun 2011 18:35:59 +0200 Subject: NEWS: Mention Tinsel fix. --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index d3c0f9250f..3849d82fae 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ For a more comprehensive changelog of the latest experimental code, see: There should be no more silent errors due to invalid audio devices. Instead ScummVM should pick up a suitable alternative device. + Tinsel: + - Fixed a regression that made Discworld uncompletable. + SCUMM: - Fixed graphics bug in FM-TOWNS versions of games on ARM devices (Android, iPhone, etc.). -- cgit v1.2.3 From 872d672c335febce0c1d5dff3843b00c0016fce2 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 2 Jun 2011 10:03:01 +0200 Subject: SDL: Allow building with current SDL 1.3hg --- backends/events/sdl/sdl-events.cpp | 21 ++++++++++----------- backends/module.mk | 7 ++++++- backends/platform/sdl/sdl-sys.h | 23 ++++++++++++++++++++++- backends/platform/sdl/sdl.cpp | 16 +++++++++++++++- configure | 9 +++++++++ 5 files changed, 62 insertions(+), 14 deletions(-) diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index 835d98e718..4489a2e580 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -206,7 +206,6 @@ bool SdlEventSource::pollEvent(Common::Event &event) { } SDL_Event ev; - ev.type = SDL_NOEVENT; while (SDL_PollEvent(&ev)) { preprocessEvents(&ev); if (dispatchSDLEvent(ev, event)) @@ -304,7 +303,7 @@ bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; - event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); + event.kbd.ascii = mapKey(ev.key.keysym.sym, (SDLMod)ev.key.keysym.mod, (Uint16)ev.key.keysym.unicode); return true; } @@ -348,7 +347,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { event.type = Common::EVENT_KEYUP; event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; - event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); + event.kbd.ascii = mapKey(ev.key.keysym.sym, (SDLMod)ev.key.keysym.mod, (Uint16)ev.key.keysym.unicode); // Ctrl-Alt- will change the GFX mode SDLModToOSystemKeyFlags(mod, event); @@ -418,19 +417,19 @@ bool SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { switch (ev.jbutton.button) { case JOY_BUT_ESCAPE: event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_PERIOD: event.kbd.keycode = Common::KEYCODE_PERIOD; - event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_PERIOD, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_SPACE: event.kbd.keycode = Common::KEYCODE_SPACE; - event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_SPACE, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_F5: event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_F5, (SDLMod)ev.key.keysym.mod, 0); break; } } @@ -449,19 +448,19 @@ bool SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { switch (ev.jbutton.button) { case JOY_BUT_ESCAPE: event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_PERIOD: event.kbd.keycode = Common::KEYCODE_PERIOD; - event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_PERIOD, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_SPACE: event.kbd.keycode = Common::KEYCODE_SPACE; - event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_SPACE, (SDLMod)ev.key.keysym.mod, 0); break; case JOY_BUT_F5: event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); + event.kbd.ascii = mapKey(SDLK_F5, (SDLMod)ev.key.keysym.mod, 0); break; } } diff --git a/backends/module.mk b/backends/module.mk index 8063bcf619..ff2411a63d 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -60,7 +60,6 @@ endif # derive from the SDL backend, and they all need the following files. ifdef SDL_BACKEND MODULE_OBJS += \ - audiocd/sdl/sdl-audiocd.o \ events/sdl/sdl-events.o \ graphics/surfacesdl/surfacesdl-graphics.o \ mixer/doublebuffersdl/doublebuffersdl-mixer.o \ @@ -68,6 +67,12 @@ MODULE_OBJS += \ mutex/sdl/sdl-mutex.o \ plugins/sdl/sdl-provider.o \ timer/sdl/sdl-timer.o + +# SDL 1.3 removed audio CD support +ifndef USE_SDL13 +MODULE_OBJS += \ + audiocd/sdl/sdl-audiocd.o +endif endif ifdef POSIX diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index 63bfc58617..ca3c586e03 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -27,7 +27,7 @@ // fashion, even on the Symbian port. // Moreover, it contains a workaround for the fact that SDL_rwops.h uses // a FILE pointer in one place, which conflicts with common/forbidden.h. - +// The SDL 1.3 headers also include strings.h #include "common/scummsys.h" @@ -39,6 +39,16 @@ typedef struct { int FAKE; } FAKE_FILE; #define FILE FAKE_FILE #endif +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp) +#undef strcasecmp +#define strcasecmp FAKE_strcasecmp +#endif + +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp) +#undef strncasecmp +#define strncasecmp FAKE_strncasecmp +#endif + #if defined(__SYMBIAN32__) #include #else @@ -51,4 +61,15 @@ typedef struct { int FAKE; } FAKE_FILE; #define FILE FORBIDDEN_SYMBOL_REPLACEMENT #endif +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp) +#undef strcasecmp +#define strcasecmp FORBIDDEN_SYMBOL_REPLACEMENT +#endif + +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp) +#undef strncasecmp +#define strncasecmp FORBIDDEN_SYMBOL_REPLACEMENT +#endif + + #endif diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index ecaeabf4e1..7972b19689 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -34,7 +34,14 @@ #include "common/textconsole.h" #include "backends/saves/default/default-saves.h" + +// Audio CD support was removed with SDL 1.3 +#if SDL_VERSION_ATLEAST(1, 3, 0) +#include "backends/audiocd/default/default-audiocd.h" +#else #include "backends/audiocd/sdl/sdl-audiocd.h" +#endif + #include "backends/events/sdl/sdl-events.h" #include "backends/mutex/sdl/sdl-mutex.h" #include "backends/timer/sdl/sdl-timer.h" @@ -182,8 +189,15 @@ void OSystem_SDL::initBackend() { _mixerManager->init(); } - if (_audiocdManager == 0) + if (_audiocdManager == 0) { + // Audio CD support was removed with SDL 1.3 +#if SDL_VERSION_ATLEAST(1, 3, 0) + _audiocdManager = new DefaultAudioCDManager(); +#else _audiocdManager = new SdlAudioCDManager(); +#endif + + } // Setup a custom program icon. setupIcon(); diff --git a/configure b/configure index 0afdbfe7c8..0dad21efbd 100755 --- a/configure +++ b/configure @@ -2379,6 +2379,15 @@ case $_backend in LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" DEFINES="$DEFINES -DSDL_BACKEND" add_line_to_config_mk "SDL_BACKEND = 1" + + _sdlversion=`$_sdlconfig --version` + case $_sdlversion in + 1.3.*) + add_line_to_config_mk "USE_SDL13 = 1" + ;; + *) + ;; + esac ;; esac -- cgit v1.2.3 From 11cfa0d357193826fdf27b9f6fe07e71038d5eef Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 2 Jun 2011 10:34:41 +0200 Subject: PS3: Initial version of the PlayStation 3 backend --- .gitignore | 1 + backends/fs/posix/posix-fs-factory.cpp | 2 +- backends/fs/posix/posix-fs-factory.h | 1 + backends/fs/posix/posix-fs.cpp | 2 +- backends/fs/ps3/ps3-fs-factory.cpp | 26 ++++++++++ backends/fs/ps3/ps3-fs-factory.h | 36 +++++++++++++ backends/module.mk | 7 +++ backends/platform/sdl/main.cpp | 1 + backends/platform/sdl/module.mk | 6 +++ backends/platform/sdl/posix/posix-main.cpp | 2 +- backends/platform/sdl/ps3/ps3-main.cpp | 49 ++++++++++++++++++ backends/platform/sdl/ps3/ps3.cpp | 79 +++++++++++++++++++++++++++++ backends/platform/sdl/ps3/ps3.h | 47 +++++++++++++++++ configure | 41 ++++++++++++++- dists/ps3/ICON0.PNG | Bin 0 -> 43210 bytes dists/ps3/PIC1.PNG | Bin 0 -> 3193068 bytes dists/ps3/sfo.xml | 33 ++++++++++++ ports.mk | 23 ++++++++- 18 files changed, 350 insertions(+), 6 deletions(-) create mode 100644 backends/fs/ps3/ps3-fs-factory.cpp create mode 100644 backends/fs/ps3/ps3-fs-factory.h create mode 100644 backends/platform/sdl/ps3/ps3-main.cpp create mode 100644 backends/platform/sdl/ps3/ps3.cpp create mode 100644 backends/platform/sdl/ps3/ps3.h create mode 100644 dists/ps3/ICON0.PNG create mode 100644 dists/ps3/PIC1.PNG create mode 100644 dists/ps3/sfo.xml diff --git a/.gitignore b/.gitignore index 6294cb451d..32fb0b91b6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ lib*.a /MT32_CONTROL.ROM /MT32_PCM.ROM /ScummVM.app +/scummvm-ps3.pkg /*.ipk /.project /.cproject diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index 829355be84..776ea86155 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(POSIX) +#if defined(POSIX) || defined(PLAYSTATION3) // Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. // Also with clock() in sys/time.h in some Mac OS X SDKs. diff --git a/backends/fs/posix/posix-fs-factory.h b/backends/fs/posix/posix-fs-factory.h index a7075db94c..c7cec6fab5 100644 --- a/backends/fs/posix/posix-fs-factory.h +++ b/backends/fs/posix/posix-fs-factory.h @@ -30,6 +30,7 @@ * Parts of this class are documented in the base interface class, FilesystemFactory. */ class POSIXFilesystemFactory : public FilesystemFactory { +protected: virtual AbstractFSNode *makeRootFileNode() const; virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const; diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index 0b94c37b16..320c5a6f39 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(POSIX) +#if defined(POSIX) || defined(PLAYSTATION3) // Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. // Also with clock() in sys/time.h in some Mac OS X SDKs. diff --git a/backends/fs/ps3/ps3-fs-factory.cpp b/backends/fs/ps3/ps3-fs-factory.cpp new file mode 100644 index 0000000000..3257246c50 --- /dev/null +++ b/backends/fs/ps3/ps3-fs-factory.cpp @@ -0,0 +1,26 @@ +/* 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 "backends/fs/ps3/ps3-fs-factory.h" + +AbstractFSNode *PS3FilesystemFactory::makeCurrentDirectoryFileNode() const { + return makeRootFileNode(); +} diff --git a/backends/fs/ps3/ps3-fs-factory.h b/backends/fs/ps3/ps3-fs-factory.h new file mode 100644 index 0000000000..6c1988b1c9 --- /dev/null +++ b/backends/fs/ps3/ps3-fs-factory.h @@ -0,0 +1,36 @@ +/* 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 PS3_FILESYSTEM_FACTORY_H +#define PS3_FILESYSTEM_FACTORY_H + +#include "backends/fs/posix/posix-fs-factory.h" + +/** + * Creates PS3FilesystemFactory objects. + * + * Parts of this class are documented in the base interface class, FilesystemFactory. + */ +class PS3FilesystemFactory : public POSIXFilesystemFactory { + virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; +}; + +#endif /*PS3_FILESYSTEM_FACTORY_H*/ diff --git a/backends/module.mk b/backends/module.mk index ff2411a63d..342ce0df7a 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -104,6 +104,13 @@ MODULE_OBJS += \ midi/camd.o endif +ifdef PLAYSTATION3 +MODULE_OBJS += \ + fs/posix/posix-fs.o \ + fs/posix/posix-fs-factory.o \ + fs/ps3/ps3-fs-factory.o +endif + ifeq ($(BACKEND),ds) MODULE_OBJS += \ fs/ds/ds-fs.o \ diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp index 1992bdd3f2..3947d010c4 100644 --- a/backends/platform/sdl/main.cpp +++ b/backends/platform/sdl/main.cpp @@ -34,6 +34,7 @@ !defined(CAANOO) && \ !defined(LINUXMOTO) && \ !defined(SAMSUNGTV) && \ + !defined(PLAYSTATION3) && \ !defined(OPENPANDORA) #include "backends/platform/sdl/sdl.h" diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk index efc5168d5b..e67bf859d6 100644 --- a/backends/platform/sdl/module.mk +++ b/backends/platform/sdl/module.mk @@ -29,6 +29,12 @@ MODULE_OBJS += \ amigaos/amigaos.o endif +ifdef PLAYSTATION3 +MODULE_OBJS += \ + ps3/ps3-main.o \ + ps3/ps3.o +endif + # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp index f78e001398..3bf7a5138a 100644 --- a/backends/platform/sdl/posix/posix-main.cpp +++ b/backends/platform/sdl/posix/posix-main.cpp @@ -22,7 +22,7 @@ #include "common/scummsys.h" -#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) +#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) #include "backends/platform/sdl/posix/posix.h" #include "backends/plugins/sdl/sdl-provider.h" diff --git a/backends/platform/sdl/ps3/ps3-main.cpp b/backends/platform/sdl/ps3/ps3-main.cpp new file mode 100644 index 0000000000..ba548a3749 --- /dev/null +++ b/backends/platform/sdl/ps3/ps3-main.cpp @@ -0,0 +1,49 @@ +/* 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 "common/scummsys.h" + +#include "backends/platform/sdl/ps3/ps3.h" +#include "backends/plugins/sdl/sdl-provider.h" +#include "base/main.h" + +int main(int argc, char *argv[]) { + + // Create our OSystem instance + g_system = new OSystem_PS3(); + assert(g_system); + + // Pre initialize the backend + ((OSystem_PS3 *)g_system)->init(); + +#ifdef DYNAMIC_MODULES + PluginManager::instance().addPluginProvider(new SDLPluginProvider()); +#endif + + // Invoke the actual ScummVM main entry point: + int res = scummvm_main(argc, argv); + + // Free OSystem + delete (OSystem_PS3 *)g_system; + + return res; +} diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp new file mode 100644 index 0000000000..49739b8ba7 --- /dev/null +++ b/backends/platform/sdl/ps3/ps3.cpp @@ -0,0 +1,79 @@ +/* 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. + * + */ + +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h + +#include "common/scummsys.h" +#include "common/config-manager.h" +#include "backends/platform/sdl/ps3/ps3.h" +#include "backends/graphics/surfacesdl/surfacesdl-graphics.h" +#include "backends/saves/default/default-saves.h" +#include "backends/fs/ps3/ps3-fs-factory.h" + +#include +#include + +int access(const char *pathname, int mode) { + struct stat sb; + + if (stat(pathname, &sb) == -1) { + return -1; + } + + return 0; +} + +OSystem_PS3::OSystem_PS3(Common::String baseConfigName) + : _baseConfigName(baseConfigName) { +} + +void OSystem_PS3::init() { + // Initialze File System Factory + _fsFactory = new PS3FilesystemFactory(); + + // Invoke parent implementation of this method + OSystem_SDL::init(); +} + +void OSystem_PS3::initBackend() { + ConfMan.registerDefault("joystick_num", 0); + ConfMan.registerDefault("fullscreen", true); + ConfMan.registerDefault("aspect_ratio", true); + + // Create the savefile manager + if (_savefileManager == 0) + _savefileManager = new DefaultSaveFileManager(PREFIX "/saves"); + + // Invoke parent implementation of this method + OSystem_SDL::initBackend(); +} + +Common::String OSystem_PS3::getDefaultConfigFileName() { + return PREFIX "/" + _baseConfigName; +} + +Common::WriteStream *OSystem_PS3::createLogFile() { + Common::FSNode file(PREFIX "/scummvm.log"); + return file.createWriteStream(); +} diff --git a/backends/platform/sdl/ps3/ps3.h b/backends/platform/sdl/ps3/ps3.h new file mode 100644 index 0000000000..daed7599a9 --- /dev/null +++ b/backends/platform/sdl/ps3/ps3.h @@ -0,0 +1,47 @@ +/* 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 PLATFORM_SDL_PS3_H +#define PLATFORM_SDL_PS3_H + +#include "backends/platform/sdl/sdl.h" + +class OSystem_PS3 : public OSystem_SDL { +public: + // Let the subclasses be able to change _baseConfigName in the constructor + OSystem_PS3(Common::String baseConfigName = "scummvm.ini"); + virtual ~OSystem_PS3() {} + + virtual void init(); + virtual void initBackend(); + +protected: + // Base string for creating the default path and filename + // for the configuration file + Common::String _baseConfigName; + + virtual Common::String getDefaultConfigFileName(); + + virtual Common::WriteStream *createLogFile(); +}; + +#endif diff --git a/configure b/configure index 0dad21efbd..8b8717b1aa 100755 --- a/configure +++ b/configure @@ -743,6 +743,7 @@ Special configuration feature: n64 for Nintendo 64 openpandora for OpenPandora ps2 for PlayStation 2 + ps3 for PlayStation 3 psp for PlayStation Portable samsungtv for Samsung TV webos for HP Palm WebOS @@ -1117,6 +1118,22 @@ ps2) _host_cpu=mips64r5900el _host_alias=ee ;; +ps3) + _host_os=ps3 + _host_cpu=ppc + _host_alias=powerpc64-ps3-elf + + # The prefix is always the same on PS3 so we hardcode the default + # here. It is still possible to define a custom prefix which is + # needed when packaging the app with a user-specific app ID. + test "x$prefix" = xNONE && prefix=/dev_hdd0/game/SCUM12000/USRDIR + # PS3 apps are installed into app-specific directories. The + # default directory structure of ScummVM makes no sense here so we + # hardcode PS3 specific directories here. + datarootdir='${prefix}/data' + datadir='${datarootdir}' + docdir='${prefix}/doc' + ;; psp) _host_os=psp _host_cpu=mipsallegrexel @@ -1258,6 +1275,12 @@ ps2) exit 1 fi ;; +ps3) + if test -z "$PS3DEV"; then + echo "Please set PS3DEV in your environment. export PS3DEV=" + exit 1 + fi + ;; psp) if test -z "$PSPDEV"; then PSPDEV=`psp-config --pspdev-path` @@ -1450,7 +1473,7 @@ if test "$have_gcc" = yes ; then case $_host_os in # newlib-based system include files suppress non-C89 function # declarations under __STRICT_ANSI__ - amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince ) + amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | wii | wince ) ;; *) CXXFLAGS="$CXXFLAGS -ansi" @@ -1839,6 +1862,16 @@ case $_host_os in DEFINES="$DEFINES -D_EE" DEFINES="$DEFINES -D__PLAYSTATION2__" ;; + ps3) + # Force use of SDL from the ps3 toolchain + _sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin" + + DEFINES="$DEFINES -DPLAYSTATION3" + CXXFLAGS="$CXXFLAGS -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include" + LDFLAGS="$LDFLAGS -L$PS3DEV/psl1ght/ppu/lib -L$PS3DEV/portlibs/ppu/lib" + add_line_to_config_mk 'PLAYSTATION3 = 1' + add_line_to_config_h "#define PREFIX \"${prefix}\"" + ;; psp) if test -d "$PSPDEV/psp/lib"; then LDFLAGS="$LDFLAGS -L$PSPDEV/psp/lib" @@ -2196,6 +2229,10 @@ if test -n "$_host"; then CXXFLAGS="$CXXFLAGS -s" fi ;; + ps3) + _mt32emu=no + _timidity=no + ;; psp) _backend="psp" _build_scalers=no @@ -2419,7 +2456,7 @@ esac # echo_n "Checking if host is POSIX compliant... " case $_host_os in - amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | psp | wii | wince) + amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince) _posix=no ;; android | beos* | bsd* | darwin* | freebsd* | gph-linux | haiku* | hpux* | iphone | irix* | linux* | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos) diff --git a/dists/ps3/ICON0.PNG b/dists/ps3/ICON0.PNG new file mode 100644 index 0000000000..e0dc9d7847 Binary files /dev/null and b/dists/ps3/ICON0.PNG differ diff --git a/dists/ps3/PIC1.PNG b/dists/ps3/PIC1.PNG new file mode 100644 index 0000000000..1fcdeb71fc Binary files /dev/null and b/dists/ps3/PIC1.PNG differ diff --git a/dists/ps3/sfo.xml b/dists/ps3/sfo.xml new file mode 100644 index 0000000000..657e1c1410 --- /dev/null +++ b/dists/ps3/sfo.xml @@ -0,0 +1,33 @@ + + + + 0 + + + 1 + + + HG + + + 0 + + + 01.8000 + + + 63 + + + 279 + + + ScummVM + + + SCUM12000 + + + 01.00 + + diff --git a/ports.mk b/ports.mk index 15dc7e854b..9aa1b3dd44 100644 --- a/ports.mk +++ b/ports.mk @@ -211,6 +211,27 @@ ifdef DIST_FILES_ENGINEDATA endif cp $(DIST_FILES_DOCS) $(AOS4PATH) +# +# PlayStation 3 specific +# + +ps3pkg: $(EXECUTABLE) + $(STRIP) $(EXECUTABLE) + sprxlinker $(EXECUTABLE) + mkdir -p ps3pkg/USRDIR/data/ + mkdir -p ps3pkg/USRDIR/doc/ + mkdir -p ps3pkg/USRDIR/saves/ + make_self_npdrm "$(EXECUTABLE)" ps3pkg/USRDIR/EBOOT.BIN UP0001-SCUM12000_00-0000000000000000 + cp $(DIST_FILES_THEMES) ps3pkg/USRDIR/data/ +ifdef DIST_FILES_ENGINEDATA + cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/ +endif + cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/ + cp dists/ps3/ICON0.PNG ps3pkg/ + cp dists/ps3/PIC1.PNG ps3pkg/ + sfo.py -f dists/ps3/sfo.xml ps3pkg/PARAM.SFO + pkg.py --contentid UP0001-SCUM12000_00-0000000000000000 ps3pkg/ scummvm-ps3.pkg + # Mark special targets as phony -.PHONY: deb bundle osxsnap win32dist install uninstall +.PHONY: deb bundle osxsnap win32dist install uninstall ps3pkg -- cgit v1.2.3 From 8bd78b6325213695116c1494c65795406d797b0b Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 2 Jun 2011 19:43:44 +0200 Subject: PS3: Add a SDL 1.3 mixer, for use with the PS3 backend. SDL 1.3 allows converting from the S16SYS sound format to F32MSB, which is required by the PS3. --- backends/mixer/sdl13/sdl13-mixer.cpp | 109 +++++++++++++++++++++++++++++++++++ backends/mixer/sdl13/sdl13-mixer.h | 67 +++++++++++++++++++++ backends/module.mk | 3 +- backends/platform/sdl/ps3/ps3.cpp | 9 +++ 4 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 backends/mixer/sdl13/sdl13-mixer.cpp create mode 100644 backends/mixer/sdl13/sdl13-mixer.h diff --git a/backends/mixer/sdl13/sdl13-mixer.cpp b/backends/mixer/sdl13/sdl13-mixer.cpp new file mode 100644 index 0000000000..84777c8bab --- /dev/null +++ b/backends/mixer/sdl13/sdl13-mixer.cpp @@ -0,0 +1,109 @@ +/* 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 "common/scummsys.h" + +#if defined(SDL_BACKEND) + +#include "backends/mixer/sdl13/sdl13-mixer.h" +#include "common/debug.h" +#include "common/system.h" +#include "common/config-manager.h" +#include "common/textconsole.h" + +#ifdef GP2X +#define SAMPLES_PER_SEC 11025 +#else +#define SAMPLES_PER_SEC 22050 +#endif +//#define SAMPLES_PER_SEC 44100 + +Sdl13MixerManager::Sdl13MixerManager() + : + SdlMixerManager(), + _device(0) { + +} + +Sdl13MixerManager::~Sdl13MixerManager() { + _mixer->setReady(false); + + SDL_CloseAudioDevice(_device); + + delete _mixer; +} + +void Sdl13MixerManager::init() { + // Start SDL Audio subsystem + if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) { + error("Could not initialize SDL: %s", SDL_GetError()); + } + + // Get the desired audio specs + SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC); + + // Start SDL audio with the desired specs + _device = SDL_OpenAudioDevice(NULL, 0, &desired, &_obtained, + SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); + + if (_device <= 0) { + warning("Could not open audio device: %s", SDL_GetError()); + + _mixer = new Audio::MixerImpl(g_system, desired.freq); + assert(_mixer); + _mixer->setReady(false); + } else { + debug(1, "Output sample rate: %d Hz", _obtained.freq); + + _mixer = new Audio::MixerImpl(g_system, _obtained.freq); + assert(_mixer); + _mixer->setReady(true); + + startAudio(); + } +} + +void Sdl13MixerManager::startAudio() { + // Start the sound system + SDL_PauseAudioDevice(_device, 0); +} + +void Sdl13MixerManager::suspendAudio() { + SDL_CloseAudioDevice(_device); + _audioSuspended = true; +} + +int Sdl13MixerManager::resumeAudio() { + if (!_audioSuspended) + return -2; + + _device = SDL_OpenAudioDevice(NULL, 0, &_obtained, NULL, 0); + if (_device <= 0) { + return -1; + } + + SDL_PauseAudioDevice(_device, 0); + _audioSuspended = false; + return 0; +} + +#endif diff --git a/backends/mixer/sdl13/sdl13-mixer.h b/backends/mixer/sdl13/sdl13-mixer.h new file mode 100644 index 0000000000..9e07ea8673 --- /dev/null +++ b/backends/mixer/sdl13/sdl13-mixer.h @@ -0,0 +1,67 @@ +/* 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 BACKENDS_MIXER_SDL13_H +#define BACKENDS_MIXER_SDL13_H + +#include "backends/mixer/sdl/sdl-mixer.h" + +/** + * SDL mixer manager. It wraps the actual implementation + * of the Audio:Mixer used by the engine, and setups + * the SDL audio subsystem and the callback for the + * audio mixer implementation. + */ +class Sdl13MixerManager : public SdlMixerManager { +public: + Sdl13MixerManager(); + virtual ~Sdl13MixerManager(); + + /** + * Initialize and setups the mixer + */ + virtual void init(); + + /** + * Pauses the audio system + */ + virtual void suspendAudio(); + + /** + * Resumes the audio system + */ + virtual int resumeAudio(); + +protected: + + /** + * The opened SDL audio device + */ + SDL_AudioDeviceID _device; + + /** + * Starts SDL audio + */ + virtual void startAudio(); +}; + +#endif diff --git a/backends/module.mk b/backends/module.mk index 342ce0df7a..84d8277cd2 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -108,7 +108,8 @@ ifdef PLAYSTATION3 MODULE_OBJS += \ fs/posix/posix-fs.o \ fs/posix/posix-fs-factory.o \ - fs/ps3/ps3-fs-factory.o + fs/ps3/ps3-fs-factory.o \ + mixer/sdl13/sdl13-mixer.o endif ifeq ($(BACKEND),ds) diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp index 49739b8ba7..32be580f6e 100644 --- a/backends/platform/sdl/ps3/ps3.cpp +++ b/backends/platform/sdl/ps3/ps3.cpp @@ -30,6 +30,7 @@ #include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "backends/saves/default/default-saves.h" #include "backends/fs/ps3/ps3-fs-factory.h" +#include "backends/mixer/sdl13/sdl13-mixer.h" #include #include @@ -65,6 +66,14 @@ void OSystem_PS3::initBackend() { if (_savefileManager == 0) _savefileManager = new DefaultSaveFileManager(PREFIX "/saves"); + // Create the mixer manager + if (_mixer == 0) { + _mixerManager = new Sdl13MixerManager(); + + // Setup and start mixer + _mixerManager->init(); + } + // Invoke parent implementation of this method OSystem_SDL::initBackend(); } -- cgit v1.2.3 From 6633a06519bfc0a826e1e1664b88c4dd413abbeb Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 4 Jun 2011 12:54:37 +0200 Subject: PS3: Map joypad buttons to features. Enable the virtual keyboard. --- backends/events/ps3sdl/ps3sdl-events.cpp | 124 +++++++++++++++++++++++++++++++ backends/events/ps3sdl/ps3sdl-events.h | 37 +++++++++ backends/module.mk | 1 + backends/platform/sdl/ps3/ps3.cpp | 8 +- configure | 1 + ports.mk | 1 + 6 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 backends/events/ps3sdl/ps3sdl-events.cpp create mode 100644 backends/events/ps3sdl/ps3sdl-events.h diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp new file mode 100644 index 0000000000..4bcc8e15ba --- /dev/null +++ b/backends/events/ps3sdl/ps3sdl-events.cpp @@ -0,0 +1,124 @@ +/* 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 "common/scummsys.h" + +#if defined(PLAYSTATION3) + +#include "backends/events/ps3sdl/ps3sdl-events.h" + +#include "common/util.h" +#include "common/events.h" + +enum { + BTN_LEFT = 0, + BTN_DOWN = 1, + BTN_RIGHT = 2, + BTN_UP = 3, + + BTN_START = 4, + BTN_R3 = 5, + BTN_L3 = 6, + BTN_SELECT = 7, + + BTN_SQUARE = 8, + BTN_CROSS = 9, + BTN_CIRCLE = 10, + BTN_TRIANGLE = 11, + + BTN_R1 = 12, + BTN_L1 = 13, + BTN_R2 = 14, + BTN_L2 = 15 +}; + +bool PS3SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { + + event.kbd.flags = 0; + + switch (ev.jbutton.button) { + case BTN_CROSS: // Left mouse button + event.type = Common::EVENT_LBUTTONDOWN; + fillMouseEvent(event, _km.x, _km.y); + break; + case BTN_CIRCLE: // Right mouse button + event.type = Common::EVENT_RBUTTONDOWN; + fillMouseEvent(event, _km.x, _km.y); + break; + case BTN_TRIANGLE: // Game menu + event.type = Common::EVENT_KEYDOWN; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0); + break; + case BTN_SELECT: // Virtual keyboard + event.type = Common::EVENT_KEYDOWN; + event.kbd.keycode = Common::KEYCODE_F7; + event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0); + break; + case BTN_SQUARE: // Escape + event.type = Common::EVENT_KEYDOWN; + event.kbd.keycode = Common::KEYCODE_ESCAPE; + event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0); + break; + case BTN_L1: // Predictive input dialog + event.type = Common::EVENT_PREDICTIVE_DIALOG; + break; + case BTN_START: // ScummVM in game menu + event.type = Common::EVENT_MAINMENU; + break; + } + return true; +} + +bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { + + event.kbd.flags = 0; + + switch (ev.jbutton.button) { + case BTN_CROSS: // Left mouse button + event.type = Common::EVENT_LBUTTONUP; + fillMouseEvent(event, _km.x, _km.y); + break; + case BTN_CIRCLE: // Right mouse button + event.type = Common::EVENT_RBUTTONUP; + fillMouseEvent(event, _km.x, _km.y); + break; + case BTN_TRIANGLE: // Game menu + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0); + break; + case BTN_SELECT: // Virtual keyboard + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_F7; + event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0); + break; + case BTN_SQUARE: // Escape + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_ESCAPE; + event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0); + break; + } + return true; +} + +#endif diff --git a/backends/events/ps3sdl/ps3sdl-events.h b/backends/events/ps3sdl/ps3sdl-events.h new file mode 100644 index 0000000000..328f613350 --- /dev/null +++ b/backends/events/ps3sdl/ps3sdl-events.h @@ -0,0 +1,37 @@ +/* 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. + * + */ + +#if !defined(BACKEND_EVENTS_PS3_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER) +#define BACKEND_EVENTS_PS3_H + +#include "backends/events/sdl/sdl-events.h" + +/** + * SDL Events manager for the PS3. + */ +class PS3SdlEventSource : public SdlEventSource { +protected: + bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); + bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); +}; + +#endif /* BACKEND_EVENTS_PS3_H */ diff --git a/backends/module.mk b/backends/module.mk index 84d8277cd2..79ad1c5dd0 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -109,6 +109,7 @@ MODULE_OBJS += \ fs/posix/posix-fs.o \ fs/posix/posix-fs-factory.o \ fs/ps3/ps3-fs-factory.o \ + events/ps3sdl/ps3sdl-events.o \ mixer/sdl13/sdl13-mixer.o endif diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp index 32be580f6e..16722ccdb7 100644 --- a/backends/platform/sdl/ps3/ps3.cpp +++ b/backends/platform/sdl/ps3/ps3.cpp @@ -30,6 +30,7 @@ #include "backends/graphics/surfacesdl/surfacesdl-graphics.h" #include "backends/saves/default/default-saves.h" #include "backends/fs/ps3/ps3-fs-factory.h" +#include "backends/events/ps3sdl/ps3sdl-events.h" #include "backends/mixer/sdl13/sdl13-mixer.h" #include @@ -58,7 +59,8 @@ void OSystem_PS3::init() { } void OSystem_PS3::initBackend() { - ConfMan.registerDefault("joystick_num", 0); + ConfMan.set("joystick_num", 0); + ConfMan.set("vkeybdpath", PREFIX "/data"); ConfMan.registerDefault("fullscreen", true); ConfMan.registerDefault("aspect_ratio", true); @@ -74,6 +76,10 @@ void OSystem_PS3::initBackend() { _mixerManager->init(); } + // Event source + if (_eventSource == 0) + _eventSource = new PS3SdlEventSource(); + // Invoke parent implementation of this method OSystem_SDL::initBackend(); } diff --git a/configure b/configure index 8b8717b1aa..e464c92247 100755 --- a/configure +++ b/configure @@ -2232,6 +2232,7 @@ if test -n "$_host"; then ps3) _mt32emu=no _timidity=no + _vkeybd=yes ;; psp) _backend="psp" diff --git a/ports.mk b/ports.mk index 9aa1b3dd44..4e570921a4 100644 --- a/ports.mk +++ b/ports.mk @@ -227,6 +227,7 @@ ifdef DIST_FILES_ENGINEDATA cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/ endif cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/ + cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/ cp dists/ps3/ICON0.PNG ps3pkg/ cp dists/ps3/PIC1.PNG ps3pkg/ sfo.py -f dists/ps3/sfo.xml ps3pkg/PARAM.SFO -- cgit v1.2.3 From f262d8932fc89ed8b02b5aff93a4bce7d68b34da Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 4 Jun 2011 17:53:42 +0200 Subject: PS3: Keep updating the screen while the XMB is open to prevent it from freezing --- backends/events/ps3sdl/ps3sdl-events.cpp | 39 ++++++++++++++++++++++++++++++++ backends/events/ps3sdl/ps3sdl-events.h | 1 + 2 files changed, 40 insertions(+) diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp index 4bcc8e15ba..eefc641844 100644 --- a/backends/events/ps3sdl/ps3sdl-events.cpp +++ b/backends/events/ps3sdl/ps3sdl-events.cpp @@ -25,6 +25,8 @@ #if defined(PLAYSTATION3) #include "backends/events/ps3sdl/ps3sdl-events.h" +#include "backends/platform/sdl/sdl.h" +#include "engines/engine.h" #include "common/util.h" #include "common/events.h" @@ -121,4 +123,41 @@ bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { return true; } +/** + * The XMB (PS3 in game menu) needs the screen buffers to be constantly flip while open. + * This pauses execution and keeps redrawing the screen until the XMB is closed. + */ +void PS3SdlEventSource::preprocessEvents(SDL_Event *event) { + if (event->type == SDL_ACTIVEEVENT) { + if (event->active.state == SDL_APPMOUSEFOCUS && !event->active.gain) { + // XMB opened + if (g_engine) + g_engine->pauseEngine(true); + + for (;;) { + if (!SDL_PollEvent(event)) { + // Locking the screen forces a full redraw + Graphics::Surface* screen = g_system->lockScreen(); + if (screen) { + g_system->unlockScreen(); + g_system->updateScreen(); + } + SDL_Delay(10); + continue; + } + if (event->type == SDL_QUIT) + return; + if (event->type != SDL_ACTIVEEVENT) + continue; + if (event->active.state == SDL_APPMOUSEFOCUS && event->active.gain) { + // XMB closed + if (g_engine) + g_engine->pauseEngine(false); + return; + } + } + } + } +} + #endif diff --git a/backends/events/ps3sdl/ps3sdl-events.h b/backends/events/ps3sdl/ps3sdl-events.h index 328f613350..8cf2f43426 100644 --- a/backends/events/ps3sdl/ps3sdl-events.h +++ b/backends/events/ps3sdl/ps3sdl-events.h @@ -30,6 +30,7 @@ */ class PS3SdlEventSource : public SdlEventSource { protected: + void preprocessEvents(SDL_Event *event); bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); }; -- cgit v1.2.3 From c31ec23d5b95f133762541d2d742f44995e8049e Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 5 Jun 2011 13:06:45 +0200 Subject: PS3: Build with -mminimal-toc to allow loading larger elfs. Thanks to andoma for the tip. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index e464c92247..c2eff81d89 100755 --- a/configure +++ b/configure @@ -1867,7 +1867,7 @@ case $_host_os in _sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin" DEFINES="$DEFINES -DPLAYSTATION3" - CXXFLAGS="$CXXFLAGS -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include" + CXXFLAGS="$CXXFLAGS -mminimal-toc -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include" LDFLAGS="$LDFLAGS -L$PS3DEV/psl1ght/ppu/lib -L$PS3DEV/portlibs/ppu/lib" add_line_to_config_mk 'PLAYSTATION3 = 1' add_line_to_config_h "#define PREFIX \"${prefix}\"" -- cgit v1.2.3 From 1fdbf418dd9c6e997a46e0b771e9a6a606b9b028 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Tue, 7 Jun 2011 20:10:03 +0200 Subject: PS3: Added a readme --- dists/ps3/readme-ps3.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ ports.mk | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 dists/ps3/readme-ps3.md diff --git a/dists/ps3/readme-ps3.md b/dists/ps3/readme-ps3.md new file mode 100644 index 0000000000..2fb393b4fb --- /dev/null +++ b/dists/ps3/readme-ps3.md @@ -0,0 +1,49 @@ +Prerequisites +============= +- A homebrew enabled PlayStation 3 console. As of now that mostly means having a custom firmware installed. Obtaining and installing such a software is out of the scope of this document. Sorry, but you're on your own for that one. +- At least one ScummVM supported game. The list of compatible games can be seen here: http://www.scummvm.org/compatibility/ +The page http://wiki.scummvm.org/index.php/Where_to_get_the_games references some places where those games can be bought. Demonstration versions for most of the supported games are downloadable on http://scummvm.org/demos/ +- An USB drive. + +Installing +========== +From a computer, download the installable package of the PS3 port from ScummVM's main site. It should be a .pkg file. Copy it to an USB drive. +After having plugged the USB drive to you PS3, the installation package should appear in the XMB under the "Games > Install Package" menu. Installing it copies ScummVM and its dependencies to your PS3's hard drive. It also adds the "Games > PlayStation 3 > ScummVM" XMB entry which is to be used to launch ScummVM. + +Configuring and playing games +============================= +The user manual describes how to add games to ScummVM and launch them : http://wiki.scummvm.org/index.php/User_Manual + +PlayStation 3 Specifics +======================= +Games can be launched either from an USB drive or from the internal hard drive. The internal hard drive has better performance though. +Savegames are wrote in the /hdd0/game/SCUM12000/saves folder. + +Joypad button mapping +===================== +- Left stick => Mouse +- Cross => Left mouse button +- Circle => Right mouse button +- Triangle => Game menu (F5) +- Square => Escape +- Start => ScummVM's in global game menu +- Select => Toggle virtual keyboard +- L1 => AGI predictive input dialog + +Disclaimer +========== +Unauthorized distribution of an installable package with non freeware games included is a violation of the copyright law and is as such forbidden. + +Building from source +==================== +This port of ScummVM to the PS3 is based on SDL. It uses the open source SDK PSL1GHT. + +The dependencies needed to build it are : + +- The toolchain from https://github.com/ps3dev/ps3toolchain +- SDL from https://github.com/zeldin/SDL_PSL1GHT +- ScummVM from https://github.com/scummvm/scummvm + +Once all the dependencies are correctly setup, an installable package can be obtained from source by issuing the following command : + +./configure --host=ps3 && make ps3pkg diff --git a/ports.mk b/ports.mk index 4e570921a4..eba8b686f2 100644 --- a/ports.mk +++ b/ports.mk @@ -214,7 +214,6 @@ endif # # PlayStation 3 specific # - ps3pkg: $(EXECUTABLE) $(STRIP) $(EXECUTABLE) sprxlinker $(EXECUTABLE) @@ -227,6 +226,7 @@ ifdef DIST_FILES_ENGINEDATA cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/ endif cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/ + cp dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/ cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/ cp dists/ps3/ICON0.PNG ps3pkg/ cp dists/ps3/PIC1.PNG ps3pkg/ -- cgit v1.2.3 From d2454d7e5f1ddcc59b779fa9daa2128078fc0fda Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 22 Jun 2011 20:01:53 +0200 Subject: CONFIGURE: When building the SDL backend, display the SDL version number. From SDL 1.3.0 onwards, audio CD support has been removed. --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index c2eff81d89..61443326d2 100755 --- a/configure +++ b/configure @@ -3223,6 +3223,10 @@ fi echo_n "Backend... " echo_n "$_backend" +if test "$_backend" = "sdl" -a -n "$_sdlversion"; then + echo_n " ($_sdlversion)" +fi + if test "$_nasm" = yes ; then echo_n ", assembly routines" fi -- cgit v1.2.3 From afdfff02f1415f66856f273fcf9f30d7621d8953 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Wed, 22 Jun 2011 22:00:59 +0200 Subject: TSAGE: Don't crash if -x option points to an non-existing savegame. Instead, just pretend there is no spoon^H^H^H^H^H-x option. --- engines/tsage/ringworld_logic.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 1dd905b3b6..58501172af 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -1333,9 +1333,20 @@ void RingworldGame::start() { RING_INVENTORY._scanner._sceneNumber = 1; RING_INVENTORY._ring._sceneNumber = 1; + int slot = -1; + + if (ConfMan.hasKey("save_slot")) { + slot = ConfMan.getInt("save_slot"); + Common::String file = _vm->generateSaveName(slot); + Common::InSaveFile *in = _vm->_system->getSavefileManager()->openForLoading(file); + if (in) + delete in; + else + slot = -1; + } - if (ConfMan.hasKey("save_slot")) - _globals->_sceneHandler._loadGameSlot = ConfMan.getInt("save_slot"); + if (slot >= 0) + _globals->_sceneHandler._loadGameSlot = slot; else // Switch to the title screen _globals->_sceneManager.setNewScene(1000); -- cgit v1.2.3 From 52d91368af89541284fbc525ff1357c5e38cb071 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 22 Jun 2011 23:08:13 +0200 Subject: TSAGE: Fix bug in sound fading in scene 20. This was blocking progress under linux... --- engines/tsage/ringworld_scenes1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index 29b7c9b997..7fe2610fd7 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -342,7 +342,7 @@ void Scene20::Action2::signal() { } case 8: scene->_sound.release(); - scene->_sound.fadeOut(this); + _globals->_soundHandler.fadeOut(this); break; case 9: SceneItem::display(0, 0, LIST_END); -- cgit v1.2.3 From cf12e0499752f9607b50a05d465e1921eaabc242 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Wed, 22 Jun 2011 23:11:44 +0200 Subject: DREAMWEB: frameoutv becomes a native function --- devtools/tasmrecover/tasm-recover | 3 ++- engines/dreamweb/dreamgen.cpp | 47 --------------------------------------- engines/dreamweb/stubs.cpp | 22 ++++++++++++++++++ 3 files changed, 24 insertions(+), 48 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 96fd6c45fa..d6c6a2523f 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -22,6 +22,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'width160', 'convertkey', 'readabyte', - 'readoneblock' + 'readoneblock', + 'frameoutv' ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index da0d71f7fe..462ae596f8 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4329,52 +4329,6 @@ noeffects: cx = pop(); } -void DreamGenContext::frameoutv() { - STACK_CHECK; - push(dx); - ax = bx; - bx = dx; - _mul(bx); - _add(di, ax); - dx = pop(); - push(cx); - ch = 0; - _sub(dx, cx); - cx = pop(); -frameloop1: - push(cx); - ch = 0; -frameloop2: - _lodsb(); - _cmp(al, 0); - if (!flags.z()) - goto backtosolid; -backtoother: - _inc(di); - if (--cx) - goto frameloop2; - cx = pop(); - _add(di, dx); - _dec(ch); - if (!flags.z()) - goto frameloop1; - return; -frameloop3: - _lodsb(); - _cmp(al, 0); - if (flags.z()) - goto backtoother; -backtosolid: - _stosb(); - if (--cx) - goto frameloop3; - cx = pop(); - _add(di, dx); - _dec(ch); - if (!flags.z()) - goto frameloop1; -} - void DreamGenContext::frameoutbh() { STACK_CHECK; push(dx); @@ -22126,7 +22080,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case 0xc214: delthisone(); break; case 0xc228: doblocks(); break; case 0xc22c: showframe(); break; - case 0xc230: frameoutv(); break; case 0xc238: frameoutbh(); break; case 0xc23c: frameoutfx(); break; case 0xc240: transferinv(); break; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index eebfbeb0d4..1869f1b109 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -503,4 +503,26 @@ void DreamGenContext::showpcx() { pcxFile.close(); } +void DreamGenContext::frameoutv() { + uint16 pitch = dx; + uint16 width = cx & 0xff; + uint16 height = cx >> 8; + uint16 stride = pitch - width; + + const uint8* src = ds.ptr(si, width * height); + uint8* base = es.ptr(di, stride * height); + uint8* dst = base + pitch * bx; + + // NB: Original code assumes non-zero width and height, "for" are unneeded, do-while would suffice but would be less readable + for (uint16 y = 0; y < height; ++y) { + for (uint16 x = 0; x < width; ++x) { + uint8 pixel = *src++; + if (pixel) + *dst = pixel; + ++dst; + } + dst += stride; + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 2109fc7a3c2f0e6c64401a07f24d292526ddbf2a Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 22 Jun 2011 22:41:57 +0100 Subject: COMMON: Improve loading of translations data file Now if the header of the file is not correct it continues to look for a valid file, while before if the first file found was obsolete or corrupted translation was disabled even if a valid file was present in the search path. --- common/translation.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/common/translation.cpp b/common/translation.cpp index 526bebcec6..59488c2dd5 100644 --- a/common/translation.cpp +++ b/common/translation.cpp @@ -223,9 +223,17 @@ String TranslationManager::getLangById(int id) const { } bool TranslationManager::openTranslationsFile(File& inFile) { - // First try to open it directly (i.e. using the SearchMan). - if (inFile.open("translations.dat")) - return true; + // First try to open it using the SearchMan. + ArchiveMemberList fileList; + SearchMan.listMatchingMembers(fileList, "translations.dat"); + for (ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) { + SeekableReadStream *stream = it->get()->createReadStream(); + if (stream && inFile.open(stream, it->get()->getName())) { + if (checkHeader(inFile)) + return true; + inFile.close(); + } + } // Then look in the Themepath if we can find the file. if (ConfMan.hasKey("themepath")) @@ -243,8 +251,11 @@ bool TranslationManager::openTranslationsFile(const FSNode &node, File& inFile, // necessary to make them here. But it avoid printing warnings. FSNode fileNode = node.getChild("translations.dat"); if (fileNode.exists() && fileNode.isReadable() && !fileNode.isDirectory()) { - if (inFile.open(fileNode)) - return true; + if (inFile.open(fileNode)) { + if (checkHeader(inFile)) + return true; + inFile.close(); + } } // Check if we exceeded the given recursion depth @@ -268,13 +279,10 @@ bool TranslationManager::openTranslationsFile(const FSNode &node, File& inFile, void TranslationManager::loadTranslationsInfoDat() { File in; if (!openTranslationsFile(in)) { - warning("You are missing the 'translations.dat' file. GUI translation will not be available"); + warning("You are missing a valid 'translations.dat' file. GUI translation will not be available"); return; } - if (!checkHeader(in)) - return; - char buf[256]; int len; @@ -326,9 +334,6 @@ void TranslationManager::loadLanguageDat(int index) { if (!openTranslationsFile(in)) return; - if (!checkHeader(in)) - return; - char buf[1024]; int len; @@ -386,7 +391,7 @@ bool TranslationManager::checkHeader(File &in) { // Check header if (strcmp(buf, "TRANSLATIONS")) { - warning("Your 'translations.dat' file is corrupt. GUI translation will not be available"); + warning("File '%s' is not a valid translations data file. Skipping this file", in.getName()); return false; } @@ -394,7 +399,7 @@ bool TranslationManager::checkHeader(File &in) { ver = in.readByte(); if (ver != TRANSLATIONS_DAT_VER) { - warning("Your 'translations.dat' file has a mismatching version, expected was %d but you got %d. GUI translation will not be available", TRANSLATIONS_DAT_VER, ver); + warning("File '%s' has a mismatching version, expected was %d but you got %d. Skipping this file", in.getName(), TRANSLATIONS_DAT_VER, ver); return false; } -- cgit v1.2.3 From 4865572316936cac14ea373de4d8ea0e0ac45b4b Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 22 Jun 2011 22:47:07 +0100 Subject: I18N: Update Hungarian translation from patch #3323744 --- po/hu_HU.po | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/po/hu_HU.po b/po/hu_HU.po index 78062e9d41..4663df0ded 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-20 23:09+0100\n" -"PO-Revision-Date: 2011-06-15 07:42+0100\n" +"PO-Revision-Date: 2011-06-21 09:54+0100\n" "Last-Translator: Gruby \n" "Language-Team: Hungarian\n" "MIME-Version: 1.0\n" @@ -1081,7 +1081,7 @@ msgstr "A motor nem t #: common/error.cpp:71 msgid "User canceled" -msgstr "" +msgstr "Felhasználói megszakítás" #: common/error.cpp:75 msgid "Unknown error" @@ -1239,10 +1239,13 @@ msgid "" "ScummVM. As such, it is likely to be unstable, and any saves you make might " "not work in future versions of ScummVM." msgstr "" +"FIGYELEM: A játékot amit indítani akarsz még nem teljesen támogatotja a " +"ScummVM. Számíts rá hogy nem stabilan fut, és a mentések nem mûködnek a " +"jövõbeni ScummVM verziókkal." #: engines/engine.cpp:408 msgid "Start anyway" -msgstr "" +msgstr "Indítás így is" #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" -- cgit v1.2.3 From 59d3b938d442fdae9709d1633d8ed8101ba95152 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 22 Jun 2011 22:47:38 +0100 Subject: I18N: Regenerate translations data file --- gui/themes/translations.dat | Bin 220518 -> 220969 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index 83155bba1b..f218747182 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3 From 8e42ee4c983167f0e2589b1401ba90a5df99fcc6 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 23 Jun 2011 00:28:44 +0100 Subject: SAGA: Fix Bug #3323722 ("IHNM: Crash to desktop in Ellen's Adventure") Thanks to fuzzie for this fix. IHNM and ITE should be retested. --- engines/saga/actor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 862a0b4d64..06ce335518 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -385,6 +385,7 @@ void Actor::loadActorList(int protagonistIdx, int actorCount, int actorsResource ByteArrayReadStreamEndian actorS(actorListData); + _actors.clear(); _actors.resize(actorCount); i = 0; for (ActorDataArray::iterator actor = _actors.begin(); actor != _actors.end(); ++actor, i++) { -- cgit v1.2.3 From 3c2a9b292f5a851529fb0196eab662fd9996a459 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 21 Jun 2011 23:50:01 -0400 Subject: LASTEXPRESS: Move Fight class to its own folder --- engines/lastexpress/debug.cpp | 3 +- engines/lastexpress/entities/anna.cpp | 3 +- engines/lastexpress/entities/ivo.cpp | 3 +- engines/lastexpress/entities/milos.cpp | 3 +- engines/lastexpress/entities/salko.cpp | 3 +- engines/lastexpress/entities/vesna.cpp | 3 +- engines/lastexpress/fight/fight.cpp | 1583 ++++++++++++++++++++++++++++++++ engines/lastexpress/fight/fight.h | 266 ++++++ engines/lastexpress/game/fight.cpp | 1583 -------------------------------- engines/lastexpress/game/fight.h | 266 ------ engines/lastexpress/game/logic.cpp | 4 +- engines/lastexpress/game/menu.cpp | 3 +- engines/lastexpress/module.mk | 2 +- 13 files changed, 1867 insertions(+), 1858 deletions(-) create mode 100644 engines/lastexpress/fight/fight.cpp create mode 100644 engines/lastexpress/fight/fight.h delete mode 100644 engines/lastexpress/game/fight.cpp delete mode 100644 engines/lastexpress/game/fight.h diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index 4b7c5f6a9a..d5c7df0e55 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -31,9 +31,10 @@ #include "lastexpress/data/snd.h" #include "lastexpress/data/subtitle.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/beetle.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index 0bedda41e8..bce99ad16d 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -22,9 +22,10 @@ #include "lastexpress/entities/anna.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/entities/ivo.cpp b/engines/lastexpress/entities/ivo.cpp index 35f4ccfb8c..861c3cf9bd 100644 --- a/engines/lastexpress/entities/ivo.cpp +++ b/engines/lastexpress/entities/ivo.cpp @@ -22,9 +22,10 @@ #include "lastexpress/entities/ivo.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 587c43cade..45fd6883f0 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -24,9 +24,10 @@ #include "lastexpress/entities/vesna.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index 4d510bb9bf..bbaff5f1d9 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -22,9 +22,10 @@ #include "lastexpress/entities/salko.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 8e09dbf7b0..79ac934ef9 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -22,9 +22,10 @@ #include "lastexpress/entities/vesna.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/action.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp new file mode 100644 index 0000000000..5b3530f488 --- /dev/null +++ b/engines/lastexpress/fight/fight.cpp @@ -0,0 +1,1583 @@ +/* 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 "lastexpress/fight/fight.h" + +#include "lastexpress/data/cursor.h" +#include "lastexpress/data/scene.h" +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/entities.h" +#include "lastexpress/game/inventory.h" +#include "lastexpress/game/logic.h" +#include "lastexpress/game/object.h" +#include "lastexpress/game/scenes.h" +#include "lastexpress/game/sound.h" +#include "lastexpress/game/state.h" + +#include "lastexpress/graphics.h" +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +#include "common/func.h" + +namespace LastExpress { + +#define CALL_FUNCTION0(fighter, name) \ + (*fighter->name)(fighter) + +#define CALL_FUNCTION1(fighter, name, a) \ + (*fighter->name)(fighter, a) + +#define REGISTER_PLAYER_FUNCTIONS(name) \ + if (!_data) \ + error("Fight::load##namePlayer - invalid data!"); \ + _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleAction##name); \ + _data->player->update = new Common::Functor1Mem(this, &Fight::update##name); \ + _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract##name); + +#define REGISTER_OPPONENT_FUNCTIONS(name) \ + if (!_data) \ + error("Fight::load##nameOpponent - invalid data!"); \ + _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleOpponentAction##name); \ + _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponent##name); \ + _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); + +#define CHECK_SEQUENCE2(fighter, value) \ + (fighter->frame->getInfo()->field_33 & value) + +Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(NULL), _endType(kFightEndLost), _state(0), _handleTimer(false) {} + +Fight::~Fight() { + clearData(); + _data = NULL; + + // Zero passed pointers + _engine = NULL; +} + +////////////////////////////////////////////////////////////////////////// +// Events +////////////////////////////////////////////////////////////////////////// + +void Fight::eventMouse(const Common::Event &ev) { + if (!_data || _data->index) + return; + + // TODO move all the egg handling to inventory functions + + getFlags()->mouseLeftClick = false; + getFlags()->shouldRedraw = false; + getFlags()->mouseRightClick = false; + + if (ev.mouse.x < 608 || ev.mouse.y < 448 || ev.mouse.x >= 640 || ev.mouse.x >= 480) { + + // Handle right button click + if (ev.type == Common::EVENT_RBUTTONUP) { + getSound()->removeFromQueue(kEntityTables0); + setStopped(); + + getGlobalTimer() ? _state = 0 : ++_state; + + getFlags()->mouseRightClick = true; + } + + if (_handleTimer) { + // Timer expired => show with full brightness + if (!getGlobalTimer()) + getInventory()->drawBlinkingEgg(); + + _handleTimer = false; + } + + // Check hotspots + Scene *scene = getScenes()->get(getState()->scene); + SceneHotspot *hotspot = NULL; + + if (!scene->checkHotSpot(ev.mouse, &hotspot)) { + _engine->getCursor()->setStyle(kCursorNormal); + } else { + _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); + + // Call player function + if (CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { + if (ev.type == Common::EVENT_LBUTTONUP) + CALL_FUNCTION1(_data->player, handleAction, (FightAction)hotspot->action); + } else { + _engine->getCursor()->setStyle(kCursorNormal); + } + } + } else { + // Handle clicks on menu icon + + if (!_handleTimer) { + // Timer expired => show with full brightness + if (!getGlobalTimer()) + getInventory()->drawBlinkingEgg(); + + _handleTimer = true; + } + + // Stop fight if clicked + if (ev.type == Common::EVENT_LBUTTONUP) { + _handleTimer = false; + getSound()->removeFromQueue(kEntityTables0); + bailout(kFightEndExit); + } + + // Reset timer on right click + if (ev.type == Common::EVENT_RBUTTONUP) { + if (getGlobalTimer()) { + if (getSound()->isBuffered("TIMER")) + getSound()->removeFromQueue("TIMER"); + + setGlobalTimer(900); + } + } + } + + getFlags()->shouldRedraw = true; +} + +void Fight::eventTick(const Common::Event &ev) { + handleTick(ev, true); +} + +void Fight::handleTick(const Common::Event &ev, bool isProcessing) { + // TODO move all the egg handling to inventory functions + + // Blink egg + if (getGlobalTimer()) { + warning("Fight::handleMouseMove - egg blinking not implemented!"); + } + + if (!_data || _data->index) + return; + + SceneHotspot *hotspot = NULL; + if (!getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot) || !CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { + _engine->getCursor()->setStyle(kCursorNormal); + } else { + _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); + } + + CALL_FUNCTION0(_data->player, update); + CALL_FUNCTION0(_data->opponent, update); + + // Draw sequences + if (!_data->isRunning) + return; + + if (isProcessing) + getScenes()->drawFrames(true); + + if (_data->index) { + // Set next sequence name index + _data->index--; + _data->sequences[_data->index] = loadSequence(_data->names[_data->index]); + } +} + +////////////////////////////////////////////////////////////////////////// +// Setup +////////////////////////////////////////////////////////////////////////// + +Fight::FightEndType Fight::setup(FightType type) { + if (_data) + error("Fight::setup - calling fight setup again while a fight is already in progress!"); + + ////////////////////////////////////////////////////////////////////////// + // Prepare UI & state + if (_state >= 5 && (type == kFightSalko || type == kFightVesna)) { + _state = 0; + return kFightEndWin; + } + + getInventory()->showHourGlass(); + // TODO events function + getFlags()->flag_0 = false; + getFlags()->mouseRightClick = false; + getEntities()->reset(); + + // Compute scene to use + SceneIndex sceneIndex; + switch(type) { + default: + sceneIndex = kSceneFightDefault; + break; + + case kFightMilos: + sceneIndex = (getObjects()->get(kObjectCompartment1).location2 < kObjectLocation3) ? kSceneFightMilos : kSceneFightMilosBedOpened; + break; + + case kFightAnna: + sceneIndex = kSceneFightAnna; + break; + + case kFightIvo: + sceneIndex = kSceneFightIvo; + break; + + case kFightSalko: + sceneIndex = kSceneFightSalko; + break; + + case kFightVesna: + sceneIndex = kSceneFightVesna; + break; + } + + if (getFlags()->shouldRedraw) { + getFlags()->shouldRedraw = false; + askForRedraw(); + //redrawScreen(); + } + + // Load the scene object + Scene *scene = getScenes()->get(sceneIndex); + + // Update game entities and state + getEntityData(kEntityPlayer)->entityPosition = scene->entityPosition; + getEntityData(kEntityPlayer)->location = scene->location; + + getState()->scene = sceneIndex; + + getFlags()->flag_3 = true; + + // Draw the scene + _engine->getGraphicsManager()->draw(scene, GraphicsManager::kBackgroundC); + // FIXME move to start of fight? + askForRedraw(); + redrawScreen(); + + ////////////////////////////////////////////////////////////////////////// + // Setup the fight + _data = new FightData; + loadData(type); + + // Show opponents & egg button + Common::Event emptyEvent; + handleTick(emptyEvent, false); + getInventory()->drawEgg(); + + // Start fight + _endType = kFightEndLost; + while (_data->isRunning) { + if (_engine->handleEvents()) + continue; + + getSound()->updateQueue(); + } + + // Cleanup after fight is over + clearData(); + + return _endType; +} + +////////////////////////////////////////////////////////////////////////// +// Status +////////////////////////////////////////////////////////////////////////// + +void Fight::setStopped() { + if (_data) + _data->isRunning = false; +} + +void Fight::bailout(FightEndType type) { + _state = 0; + _endType = type; + setStopped(); +} + +////////////////////////////////////////////////////////////////////////// +// Cleanup +////////////////////////////////////////////////////////////////////////// + +void Fight::clearData() { + if (!_data) + return; + + // Clear data + clearSequences(_data->player); + clearSequences(_data->opponent); + + SAFE_DELETE(_data->player); + SAFE_DELETE(_data->opponent); + + SAFE_DELETE(_data); + + _engine->restoreEventHandlers(); +} + +void Fight::clearSequences(Fighter *combatant) const { + if (!combatant) + return; + + // The original game resets the function pointers to default values, just before deleting the struct + getScenes()->removeAndRedraw(&combatant->frame, false); + + // Free sequences + for (int i = 0; i < (int)combatant->sequences.size(); i++) + SAFE_DELETE(combatant->sequences[i]); +} + +////////////////////////////////////////////////////////////////////////// +// Drawing +////////////////////////////////////////////////////////////////////////// + +void Fight::setSequenceAndDraw(Fighter *combatant, uint32 sequenceIndex, FightSequenceType type) const { + if (combatant->sequences.size() < sequenceIndex) + return; + + switch (type) { + default: + break; + + case kFightSequenceType0: + if (combatant->sequenceIndex) + return; + + combatant->sequence = combatant->sequences[sequenceIndex]; + combatant->sequenceIndex = sequenceIndex; + draw(combatant); + break; + + case kFightSequenceType1: + combatant->sequence = combatant->sequences[sequenceIndex]; + combatant->sequenceIndex = sequenceIndex; + combatant->sequenceIndex2 = 0; + draw(combatant); + break; + + case kFightSequenceType2: + combatant->sequenceIndex2 = sequenceIndex; + break; + } +} + +void Fight::draw(Fighter *combatant) const { + getScenes()->removeAndRedraw(&combatant->frame, false); + + combatant->frameIndex = 0; + combatant->field_24 = 0; +} + +////////////////////////////////////////////////////////////////////////// +// Loading +////////////////////////////////////////////////////////////////////////// + +void Fight::loadData(FightType type) { + if (!_data) + error("Fight::loadData - invalid data!"); + + switch (type) { + default: + break; + + case kFightMilos: + loadMilosPlayer(); + loadMilosOpponent(); + break; + + case kFightAnna: + loadAnnaPlayer(); + loadAnnaOpponent(); + break; + + case kFightIvo: + loadIvoPlayer(); + loadIvoOpponent(); + break; + + case kFightSalko: + loadSalkoPlayer(); + loadSalkoOpponent(); + break; + + case kFightVesna: + loadVesnaPlayer(); + loadVesnaOpponent(); + break; + } + + if (!_data->player || !_data->opponent) + error("Fight::loadData - error loading fight data (type=%d)", type); + + ////////////////////////////////////////////////////////////////////////// + // Start running the fight + _data->isRunning = true; + + if (_state < 5) { + setSequenceAndDraw(_data->player, 0, kFightSequenceType0); + setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); + goto end_load; + } + + switch(type) { + default: + break; + + case kFightMilos: + _data->opponent->countdown = 1; + setSequenceAndDraw(_data->player, 4, kFightSequenceType0); + setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); + break; + + case kFightIvo: + _data->opponent->countdown = 1; + setSequenceAndDraw(_data->player, 3, kFightSequenceType0); + setSequenceAndDraw(_data->opponent, 6, kFightSequenceType0); + break; + + case kFightVesna: + _data->opponent->countdown = 1; + setSequenceAndDraw(_data->player, 0, kFightSequenceType0); + setSequenceAndDraw(_data->player, 3, kFightSequenceType2); + setSequenceAndDraw(_data->opponent, 5, kFightSequenceType0); + break; + } + +end_load: + // Setup event handlers + _engine->backupEventHandlers(); + SET_EVENT_HANDLERS(Fight, this); +} + +////////////////////////////////////////////////////////////////////////// +// Shared +////////////////////////////////////////////////////////////////////////// +void Fight::processFighter(Fighter *fighter) { + if (!_data) + error("Fight::processFighter - invalid data!"); + + if (!fighter->sequence) { + if (fighter->frame) { + getScenes()->removeFromQueue(fighter->frame); + getScenes()->setCoordinates(fighter->frame); + } + SAFE_DELETE(fighter->frame); + return; + } + + if (fighter->sequence->count() <= fighter->frameIndex) { + switch(fighter->action) { + default: + break; + + case kFightAction101: + setSequenceAndDraw(fighter, fighter->sequenceIndex2, kFightSequenceType1); + fighter->sequenceIndex2 = 0; + break; + + case kFightActionResetFrame: + fighter->frameIndex = 0; + break; + + case kFightAction103: + setSequenceAndDraw(fighter, 0, kFightSequenceType1); + CALL_FUNCTION1(fighter, handleAction, kFightAction101); + setSequenceAndDraw(fighter->opponent, 0, kFightSequenceType1); + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction101); + CALL_FUNCTION0(fighter->opponent, update); + break; + + case kFightActionWin: + bailout(kFightEndWin); + break; + + case kFightActionLost: + bailout(kFightEndLost); + break; + } + } + + if (_data->isRunning) { + + // Get the current sequence frame + SequenceFrame *frame = new SequenceFrame(fighter->sequence, (uint16)fighter->frameIndex); + frame->getInfo()->location = 1; + + if (fighter->frame == frame) { + delete frame; + return; + } + + getSound()->playFightSound(frame->getInfo()->soundAction, frame->getInfo()->field_31); + + // Add current frame to queue and advance + getScenes()->addToQueue(frame); + fighter->frameIndex++; + + if (fighter->frame) { + getScenes()->removeFromQueue(fighter->frame); + + if (!frame->getInfo()->field_2E) + getScenes()->setCoordinates(fighter->frame); + } + + // Replace by new frame + delete fighter->frame; + fighter->frame = frame; + } +} + +void Fight::handleAction(Fighter *fighter, FightAction action) { + switch (action) { + default: + return; + + case kFightAction101: + break; + + case kFightActionResetFrame: + fighter->countdown--; + break; + + case kFightAction103: + CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); + break; + + case kFightActionWin: + _endType = kFightEndWin; + CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); + break; + + case kFightActionLost: + _endType = kFightEndLost; + CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); + break; + } + + // Update action + fighter->action = action; +} + +bool Fight::canInteract(Fighter const *fighter, FightAction /*= (FightAction)0*/ ) { + return (fighter->action == kFightAction101 && !fighter->sequenceIndex); +} + +void Fight::update(Fighter *fighter) { + + processFighter(fighter); + + if (fighter->frame) + fighter->frame->getInfo()->location = (fighter->action == kFightActionResetFrame ? 2 : 0); +} + +void Fight::updateOpponent(Fighter *fighter) { + + // This is an opponent struct! + Opponent *opponent = (Opponent *)fighter; + + processFighter(opponent); + + if (opponent->field_38 && !opponent->sequenceIndex) + opponent->field_38--; + + if (fighter->frame) + fighter->frame->getInfo()->location = 1; +} + +////////////////////////////////////////////////////////////////////////// +// Milos +////////////////////////////////////////////////////////////////////////// + +void Fight::loadMilosPlayer() { + REGISTER_PLAYER_FUNCTIONS(Milos) + + _data->player->sequences.push_back(loadSequence("2001cr.seq")); + _data->player->sequences.push_back(loadSequence("2001cdl.seq")); + _data->player->sequences.push_back(loadSequence("2001cdr.seq")); + _data->player->sequences.push_back(loadSequence("2001cdm.seq")); + _data->player->sequences.push_back(loadSequence("2001csgr.seq")); + _data->player->sequences.push_back(loadSequence("2001csgl.seq")); + _data->player->sequences.push_back(loadSequence("2001dbk.seq")); +} + +void Fight::loadMilosOpponent() { + REGISTER_OPPONENT_FUNCTIONS(Milos) + + _data->opponent->sequences.push_back(loadSequence("2001or.seq")); + _data->opponent->sequences.push_back(loadSequence("2001oal.seq")); + _data->opponent->sequences.push_back(loadSequence("2001oam.seq")); + _data->opponent->sequences.push_back(loadSequence("2001okl.seq")); + _data->opponent->sequences.push_back(loadSequence("2001okm.seq")); + _data->opponent->sequences.push_back(loadSequence("2001dbk.seq")); + _data->opponent->sequences.push_back(loadSequence("2001wbk.seq")); + + getSound()->playSound(kEntityTables0, "MUS027", SoundManager::kFlagDefault); + + _data->opponent->field_38 = 35; +} + +void Fight::handleActionMilos(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + return; + + case kFightAction1: + if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 6, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 3, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction2: + if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 6, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction128: + if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4) || fighter->opponent->sequenceIndex != 1) { + switch (fighter->opponent->sequenceIndex) { + default: + setSequenceAndDraw(fighter, rnd(3) + 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(fighter, 1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(fighter, 3, kFightSequenceType0); + break; + } + } else { + setSequenceAndDraw(fighter, 4, kFightSequenceType1); + CALL_FUNCTION0(fighter, update); + } + break; + } +} + +void Fight::updateMilos(Fighter *fighter) { + if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { + + // Draw sequences + if (fighter->opponent->countdown <= 0) { + setSequenceAndDraw(fighter, 5, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); + + getSound()->removeFromQueue(kEntityTables0); + getSound()->playSound(kEntityTrain, "MUS029", SoundManager::kFlagDefault); + + CALL_FUNCTION1(fighter, handleAction, kFightActionWin); + } + + if (fighter->sequenceIndex == 4) { + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction4); + _endType = kFightEndLost; + } + } + + update(fighter); +} + +bool Fight::canInteractMilos(Fighter const *fighter, FightAction action) { + if (!_data) + error("Fight::canInteractMilos - invalid data!"); + + if (action != kFightAction128 + || _data->player->sequenceIndex != 1 + || !fighter->frame + || CHECK_SEQUENCE2(fighter, 4) + || fighter->opponent->sequenceIndex != 1) { + return canInteract(fighter); + } + + _engine->getCursor()->setStyle(kCursorHand); + + return true; +} + +void Fight::handleOpponentActionMilos(Fighter *fighter, FightAction action) { + if (action == kFightAction4) { + setSequenceAndDraw(fighter, 5, kFightSequenceType1); + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + } else { + if (action != kFightAction131) + handleAction(fighter, action); + } +} + +void Fight::updateOpponentMilos(Fighter *fighter) { + // This is an opponent struct! + Opponent *opponent = (Opponent *)fighter; + + if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { + + if (opponent->opponent->field_34 >= 2) { + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType1); + break; + + case 3: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + } + } else { + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + } + + // Update field_38 + if (opponent->opponent->field_34 < 5) + opponent->field_38 = 6 * (5 - opponent->opponent->field_34); + else + opponent->field_38 = 0; + } + + if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { + if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) + CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); + + if (opponent->opponent->countdown <= 0) { + getSound()->removeFromQueue(kEntityTables0); + CALL_FUNCTION1(opponent, handleAction, kFightActionLost); + } + } + + updateOpponent(opponent); +} + +////////////////////////////////////////////////////////////////////////// +// Anna +////////////////////////////////////////////////////////////////////////// + +void Fight::loadAnnaPlayer() { + if (!_data) + error("Fight::loadAnnaPlayer - invalid data!"); + + // Special case: we are using some shared functions directly + _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleActionAnna); + _data->player->update = new Common::Functor1Mem(this, &Fight::update); + _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); + + _data->player->sequences.push_back(loadSequence("2002cr.seq")); + _data->player->sequences.push_back(loadSequence("2002cdl.seq")); + _data->player->sequences.push_back(loadSequence("2002cdr.seq")); + _data->player->sequences.push_back(loadSequence("2002cdm.seq")); + _data->player->sequences.push_back(loadSequence("2002lbk.seq")); +} + +void Fight::loadAnnaOpponent() { + if (!_data) + error("Fight::loadAnnaOpponent - invalid data!"); + + // Special case: we are using some shared functions directly + _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleAction); + _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponentAnna); + _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); + + _data->opponent->sequences.push_back(loadSequence("2002or.seq")); + _data->opponent->sequences.push_back(loadSequence("2002oal.seq")); + _data->opponent->sequences.push_back(loadSequence("2002oam.seq")); + _data->opponent->sequences.push_back(loadSequence("2002oar.seq")); + _data->opponent->sequences.push_back(loadSequence("2002okr.seq")); + _data->opponent->sequences.push_back(loadSequence("2002okml.seq")); + _data->opponent->sequences.push_back(loadSequence("2002okm.seq")); + + getSound()->playSound(kEntityTables0, "MUS030", SoundManager::kFlagDefault); + + _data->opponent->field_38 = 30; +} + +void Fight::handleActionAnna(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + return; + + case kFightAction1: + if ((fighter->sequenceIndex != 1 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 4, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction2: + if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 4, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction3: + if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 1) || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 4, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction128: + switch (fighter->opponent->sequenceIndex) { + default: + setSequenceAndDraw(fighter, 3, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(fighter, 1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(fighter, 3, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(fighter, 2, kFightSequenceType0); + break; + } + break; + } + + if (fighter->field_34 > 4) { + getSound()->removeFromQueue(kEntityTables0); + bailout(kFightEndWin); + } +} + +void Fight::updateOpponentAnna(Fighter *fighter) { + // This is an opponent struct! + Opponent *opponent = (Opponent *)fighter; + + if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { + + if (opponent->opponent->field_34 >= 2) { + switch (rnd(6)) { + default: + break; + + case 0: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(opponent, 3, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(opponent, 3, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 5: + setSequenceAndDraw(opponent, 3, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + } + } + + // Update field_38 + opponent->field_38 = (int32)rnd(15); + } + + if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { + if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 3) + CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); + + if (opponent->opponent->countdown <= 0) { + getSound()->removeFromQueue(kEntityTables0); + CALL_FUNCTION1(opponent, handleAction, kFightActionLost); + } + } + + updateOpponent(opponent); +} + +////////////////////////////////////////////////////////////////////////// +// Ivo +////////////////////////////////////////////////////////////////////////// + +void Fight::loadIvoPlayer() { + REGISTER_PLAYER_FUNCTIONS(Ivo) + + _data->player->sequences.push_back(loadSequence("2003cr.seq")); + _data->player->sequences.push_back(loadSequence("2003car.seq")); + _data->player->sequences.push_back(loadSequence("2003cal.seq")); + _data->player->sequences.push_back(loadSequence("2003cdr.seq")); + _data->player->sequences.push_back(loadSequence("2003cdm.seq")); + _data->player->sequences.push_back(loadSequence("2003chr.seq")); + _data->player->sequences.push_back(loadSequence("2003chl.seq")); + _data->player->sequences.push_back(loadSequence("2003ckr.seq")); + _data->player->sequences.push_back(loadSequence("2003lbk.seq")); + _data->player->sequences.push_back(loadSequence("2003fbk.seq")); + + _data->player->countdown = 5; +} + +void Fight::loadIvoOpponent() { + REGISTER_OPPONENT_FUNCTIONS(Ivo) + + _data->opponent->sequences.push_back(loadSequence("2003or.seq")); + _data->opponent->sequences.push_back(loadSequence("2003oal.seq")); + _data->opponent->sequences.push_back(loadSequence("2003oar.seq")); + _data->opponent->sequences.push_back(loadSequence("2003odm.seq")); + _data->opponent->sequences.push_back(loadSequence("2003okl.seq")); + _data->opponent->sequences.push_back(loadSequence("2003okj.seq")); + _data->opponent->sequences.push_back(loadSequence("blank.seq")); + _data->opponent->sequences.push_back(loadSequence("csdr.seq")); + _data->opponent->sequences.push_back(loadSequence("2003l.seq")); + + getSound()->playSound(kEntityTables0, "MUS032", SoundManager::kFlagDefault); + + _data->opponent->countdown = 5; + _data->opponent->field_38 = 15; +} + +void Fight::handleActionIvo(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + return; + + case kFightAction1: + if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 7, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } + break; + + case kFightAction2: + if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 7, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } + break; + + case kFightAction128: + switch (fighter->opponent->sequenceIndex) { + default: + case 1: + setSequenceAndDraw(fighter, 1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(fighter, 2, kFightSequenceType0); + break; + } + break; + + case kFightAction129: + setSequenceAndDraw(fighter, (fighter->opponent->countdown > 1) ? 4 : 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); + break; + + case kFightAction130: + setSequenceAndDraw(fighter, 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); + break; + } +} + +void Fight::updateIvo(Fighter *fighter) { + + if ((fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) && !fighter->frameIndex) + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction131); + + if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { + + // Draw sequences + if (fighter->opponent->countdown <= 0) { + setSequenceAndDraw(fighter, 9, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, 8, kFightSequenceType1); + getSound()->removeFromQueue(kEntityTables0); + + CALL_FUNCTION1(fighter, handleAction, kFightActionWin); + return; + } + + if (fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) + CALL_FUNCTION1(fighter->opponent, handleAction, (FightAction)fighter->sequenceIndex); + } + + update(fighter); +} + +bool Fight::canInteractIvo(Fighter const *fighter, FightAction action) { + if (action == kFightAction129 || action == kFightAction130) + return (fighter->sequenceIndex >= 8); + + return canInteract(fighter); +} + +void Fight::handleOpponentActionIvo(Fighter *fighter, FightAction action) { + // This is an opponent struct! + Opponent *opponent = (Opponent *)fighter; + + switch (action) { + default: + handleAction(fighter, action); + break; + + case kFightAction3: + if ((opponent->sequenceIndex != 1 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { + setSequenceAndDraw(opponent, 6, kFightSequenceType1); + setSequenceAndDraw(opponent->opponent, 6, kFightSequenceType1); + CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); + } + break; + + case kFightAction4: + if ((opponent->sequenceIndex != 2 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { + setSequenceAndDraw(opponent, 6, kFightSequenceType1); + setSequenceAndDraw(opponent->opponent, 5, kFightSequenceType1); + CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); + } + break; + + case kFightAction131: + if (opponent->sequenceIndex) + break; + + if (rnd(100) <= (unsigned int)(opponent->countdown > 2 ? 60 : 75)) { + setSequenceAndDraw(opponent, 3 , kFightSequenceType1); + if (opponent->opponent->sequenceIndex == 4) + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + } + break; + } +} + +void Fight::updateOpponentIvo(Fighter *fighter) { + // This is an opponent struct! + Opponent *opponent = (Opponent *)fighter; + + if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { + + if (opponent->opponent->field_34 >= 2) { + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 3: + setSequenceAndDraw(opponent, 0, kFightSequenceType2); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(opponent, 0, kFightSequenceType1); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + } + } + + // Update field_38 + opponent->field_38 = 3 * opponent->countdown + (int32)rnd(10); + } + + if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { + + if (opponent->opponent->countdown <= 0) { + setSequenceAndDraw(opponent, 7, kFightSequenceType1); + setSequenceAndDraw(opponent->opponent, 8, kFightSequenceType1); + getSound()->removeFromQueue(kEntityTables0); + + CALL_FUNCTION1(opponent->opponent, handleAction, kFightActionWin); + + return; + } + + if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) + CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); + } + + updateOpponent(opponent); +} + +////////////////////////////////////////////////////////////////////////// +// Salko +////////////////////////////////////////////////////////////////////////// + +void Fight::loadSalkoPlayer() { + REGISTER_PLAYER_FUNCTIONS(Salko) + + _data->player->sequences.push_back(loadSequence("2004cr.seq")); + _data->player->sequences.push_back(loadSequence("2004cdr.seq")); + _data->player->sequences.push_back(loadSequence("2004chj.seq")); + _data->player->sequences.push_back(loadSequence("2004bk.seq")); + + _data->player->countdown = 2; +} + +void Fight::loadSalkoOpponent() { + REGISTER_OPPONENT_FUNCTIONS(Salko) + + _data->opponent->sequences.push_back(loadSequence("2004or.seq")); + _data->opponent->sequences.push_back(loadSequence("2004oam.seq")); + _data->opponent->sequences.push_back(loadSequence("2004oar.seq")); + _data->opponent->sequences.push_back(loadSequence("2004okr.seq")); + _data->opponent->sequences.push_back(loadSequence("2004ohm.seq")); + _data->opponent->sequences.push_back(loadSequence("blank.seq")); + + getSound()->playSound(kEntityTables0, "MUS035", SoundManager::kFlagDefault); + + _data->opponent->countdown = 3; + _data->opponent->field_38 = 30; +} + +void Fight::handleActionSalko(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + return; + + case kFightAction1: + case kFightAction2: + if (fighter->sequenceIndex != 1 && CHECK_SEQUENCE2(fighter, 4)) { + fighter->field_34 = 0; + + setSequenceAndDraw(fighter, 3, kFightSequenceType1); + setSequenceAndDraw(fighter->opponent, (action == kFightAction1 ? 3 : 4), kFightSequenceType1); + + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + + if (action == kFightAction2) + fighter->countdown= 0; + + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction5: + if (fighter->sequenceIndex != 3) { + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } + break; + + case kFightAction128: + setSequenceAndDraw(fighter, 1, kFightSequenceType0); + fighter->field_34 = 0; + break; + + case kFightAction131: + setSequenceAndDraw(fighter, 2, (fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0)); + break; + } +} + +void Fight::updateSalko(Fighter *fighter) { + update(fighter); + + // The original doesn't check for currentSequence2 != NULL (might not happen when everything is working properly, but crashes with our current implementation) + if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { + + if (fighter->opponent->countdown <= 0) { + getSound()->removeFromQueue(kEntityTables0); + bailout(kFightEndWin); + + return; + } + + if (fighter->sequenceIndex == 2) + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction2); + } +} + +bool Fight::canInteractSalko(Fighter const *fighter, FightAction action) { + if (action == kFightAction131) { + if (fighter->sequenceIndex == 1) { + if (fighter->opponent->countdown <= 0) + _engine->getCursor()->setStyle(kCursorHand); + + return true; + } + + return false; + } + + return canInteract(fighter); +} + +void Fight::handleOpponentActionSalko(Fighter *fighter, FightAction action) { + if (action == kFightAction2) { + setSequenceAndDraw(fighter, 5, kFightSequenceType1); + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + } else { + handleAction(fighter, action); + } +} + +void Fight::updateOpponentSalko(Fighter *fighter) { + // This is an opponent struct + Opponent *opponent = (Opponent *)fighter; + + if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { + + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 3: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + } + + // Update field_38 + opponent->field_38 = 4 * opponent->countdown; + } + + if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { + if (opponent->opponent->countdown <= 0) { + getSound()->removeFromQueue(kEntityTables0); + bailout(kFightEndLost); + + // Stop processing + return; + } + + if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) + CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); + } + + updateOpponent(opponent); +} + +////////////////////////////////////////////////////////////////////////// +// Vesna +////////////////////////////////////////////////////////////////////////// + +void Fight::loadVesnaPlayer() { + REGISTER_PLAYER_FUNCTIONS(Vesna) + + _data->player->sequences.push_back(loadSequence("2005cr.seq")); + _data->player->sequences.push_back(loadSequence("2005cdr.seq")); + _data->player->sequences.push_back(loadSequence("2005cbr.seq")); + _data->player->sequences.push_back(loadSequence("2005bk.seq")); + _data->player->sequences.push_back(loadSequence("2005cdm1.seq")); + _data->player->sequences.push_back(loadSequence("2005chl.seq")); +} + +void Fight::loadVesnaOpponent() { + REGISTER_OPPONENT_FUNCTIONS(Vesna) + + _data->opponent->sequences.push_back(loadSequence("2005or.seq")); + _data->opponent->sequences.push_back(loadSequence("2005oam.seq")); + _data->opponent->sequences.push_back(loadSequence("2005oar.seq")); + _data->opponent->sequences.push_back(loadSequence("2005okml.seq")); + _data->opponent->sequences.push_back(loadSequence("2005okr.seq")); + _data->opponent->sequences.push_back(loadSequence("2005odm1.seq")); + _data->opponent->sequences.push_back(loadSequence("2005csbm.seq")); + _data->opponent->sequences.push_back(loadSequence("2005oam4.seq")); + + getSound()->playSound(kEntityTables0, "MUS038", SoundManager::kFlagDefault); + + _data->opponent->countdown = 4; + _data->opponent->field_38 = 30; +} + +void Fight::handleActionVesna(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + return; + + case kFightAction1: + if (fighter->sequenceIndex != 1) { + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction2: + if (fighter->sequenceIndex != 2) { + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } else { + fighter->field_34++; + } + break; + + case kFightAction5: + if (fighter->sequenceIndex != 3) { + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + CALL_FUNCTION0(fighter, update); + } + break; + + case kFightAction128: + if (fighter->sequenceIndex == 1 && fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { + setSequenceAndDraw(fighter, 5, kFightSequenceType1); + } else { + setSequenceAndDraw(fighter, (fighter->opponent->sequenceIndex == 5) ? 3 : 1, kFightSequenceType0); + } + break; + + case kFightAction132: + setSequenceAndDraw(fighter, 2, kFightSequenceType0); + break; + } + + if (fighter->field_34 > 10) { + setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType2); + fighter->opponent->countdown = 1; + fighter->field_34 = 0; + } +} + +void Fight::updateVesna(Fighter *fighter) { + if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { + + if (fighter->sequenceIndex == 3) + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction3); + + if (fighter->opponent->countdown <= 0) { + getSound()->removeFromQueue(kEntityTables0); + bailout(kFightEndWin); + return; + } + + if (fighter->sequenceIndex == 5) + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction5); + } + + update(fighter); +} + +bool Fight::canInteractVesna(Fighter const *fighter, FightAction action) { + if (action != kFightAction128) + return canInteract(fighter); + + if (fighter->sequenceIndex != 1) { + + if (fighter->opponent->sequenceIndex == 5) { + _engine->getCursor()->setStyle(kCursorDown); + return true; + } + + return canInteract(fighter); + } + + if (fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { + _engine->getCursor()->setStyle(kCursorPunchLeft); + return true; + } + + return false; +} + +void Fight::handleOpponentActionVesna(Fighter *fighter, FightAction action) { + switch (action) { + default: + handleAction(fighter, action); + break; + + case kFightAction3: + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + break; + + case kFightAction5: + setSequenceAndDraw(fighter, 7, kFightSequenceType1); + CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); + if (fighter->countdown <= 1) + fighter->countdown = 1; + break; + + case kFightAction131: + break; + } +} + +void Fight::updateOpponentVesna(Fighter *fighter) { + // This is an opponent struct + Opponent *opponent = (Opponent *)fighter; + + if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { + + if (opponent->opponent->field_34 == 1) { + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + } else { + switch (rnd(6)) { + default: + break; + + case 0: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + + case 2: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(opponent, 1, kFightSequenceType0); + setSequenceAndDraw(opponent, 2, kFightSequenceType2); + break; + + case 5: + setSequenceAndDraw(opponent, 2, kFightSequenceType0); + setSequenceAndDraw(opponent, 1, kFightSequenceType2); + break; + } + } + + // Update field_38 + opponent->field_38 = 4 * opponent->countdown; + } + + if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { + if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 5) + CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); + + if (opponent->opponent->countdown <= 0) { + + switch (opponent->sequenceIndex) { + default: + break; + + case 1: + setSequenceAndDraw(opponent, 3, kFightSequenceType1); + break; + + case 2: + setSequenceAndDraw(opponent, 4, kFightSequenceType1); + break; + + case 5: + setSequenceAndDraw(opponent, 6, kFightSequenceType1); + break; + } + + setSequenceAndDraw(opponent->opponent, 4, kFightSequenceType1); + + CALL_FUNCTION1(opponent, handleAction, kFightActionLost); + CALL_FUNCTION0(opponent->opponent, update); + CALL_FUNCTION0(opponent, update); + + getSound()->removeFromQueue(kEntityTables0); + + // Stop processing + return; + } + } + + updateOpponent(opponent); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fight.h b/engines/lastexpress/fight/fight.h new file mode 100644 index 0000000000..a33cc93a29 --- /dev/null +++ b/engines/lastexpress/fight/fight.h @@ -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. + * + */ + +#ifndef LASTEXPRESS_FIGHT_H +#define LASTEXPRESS_FIGHT_H + +/* + Fight structure + --------------- + uint32 {4} - player struct + uint32 {4} - opponent struct + uint32 {4} - hasLost flag + + byte {1} - isRunning + + Fight participant structure + --------------------------- + uint32 {4} - function pointer + uint32 {4} - pointer to fight structure + uint32 {4} - pointer to opponent (fight participant structure) + uint32 {4} - array of sequences + uint32 {4} - number of sequences + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint16 {2} - ?? + uint16 {2} - ?? - only for opponent structure + uint32 {4} - ?? - only for opponent structure + +*/ + +#include "lastexpress/shared.h" + +#include "lastexpress/eventhandler.h" + +#include "common/array.h" + +namespace LastExpress { + +class LastExpressEngine; +class Sequence; +class SequenceFrame; + +////////////////////////////////////////////////////////////////////////// +// TODO : objectify! +class Fight : public EventHandler { +public: + enum FightEndType { + kFightEndWin = 0, + kFightEndLost = 1, + kFightEndExit = 2 + }; + + Fight(LastExpressEngine *engine); + ~Fight(); + + FightEndType setup(FightType type); + + void eventMouse(const Common::Event &ev); + void eventTick(const Common::Event &ev); + + void setStopped(); + void resetState() { _state = 0; } + +private: + enum FightSequenceType { + kFightSequenceType0 = 0, + kFightSequenceType1 = 1, + kFightSequenceType2 = 2 + }; + + enum FightAction { + kFightAction1 = 1, + kFightAction2 = 2, + kFightAction3 = 3, + kFightAction4 = 4, + kFightAction5 = 5, + kFightAction101 = 101, + kFightActionResetFrame = 102, + kFightAction103 = 103, + kFightActionWin = 104, + kFightActionLost = 105, + kFightAction128 = 128, + kFightAction129 = 129, + kFightAction130 = 130, + kFightAction131 = 131, + kFightAction132 = 132 + }; + + struct Fighter { + Common::Functor2 *handleAction; + Common::Functor1 *update; + Common::Functor2 *canInteract; + Fighter *opponent; + Common::Array sequences; + uint32 sequenceIndex; + Sequence *sequence; + SequenceFrame *frame; + uint32 frameIndex; + uint32 field_24; + FightAction action; + uint32 sequenceIndex2; + int32 countdown; // countdown before loosing ? + uint32 field_34; + + Fighter() { + handleAction = NULL; + update = NULL; + canInteract = NULL; + + opponent = NULL; + + sequenceIndex = 0; + sequence = NULL; + frame = NULL; + frameIndex = 0; + + field_24 = 0; + + action = kFightAction101; + sequenceIndex2 = 0; + + countdown = 1; + + field_34 = 0; + } + }; + + // Opponent struct + struct Opponent : Fighter { + int32 field_38; + + Opponent() : Fighter() { + field_38 = 0; + } + }; + + struct FightData { + Fighter *player; + Opponent *opponent; + int32 index; + + Sequence *sequences[20]; + Common::String names[20]; + + bool isRunning; + + FightData() { + player = new Fighter(); + opponent = new Opponent(); + + // Set opponents + player->opponent = opponent; + opponent->opponent = player; + + index = 0; + + isRunning = false; + } + }; + + LastExpressEngine *_engine; + FightData *_data; + FightEndType _endType; + int _state; + + bool _handleTimer; + + // Events + void handleTick(const Common::Event &ev, bool unknown); + + // State + void bailout(FightEndType type); + + + // Drawing + void setSequenceAndDraw(Fighter *fighter, uint32 sequenceIndex, FightSequenceType type) const; + void draw(Fighter *fighter) const; + + // Cleanup + void clearData(); + void clearSequences(Fighter *fighter) const; + + ////////////////////////////////////////////////////////////////////////// + // Loading + void loadData(FightType type); + + // Shared + void processFighter(Fighter *fighter); + + // Default functions + void handleAction(Fighter *fighter, FightAction action); + void update(Fighter *fighter); + bool canInteract(Fighter const *fighter, FightAction = (FightAction)0); + void updateOpponent(Fighter *fighter); + + // Milos + void loadMilosPlayer(); + void loadMilosOpponent(); + void handleActionMilos(Fighter *fighter, FightAction action); + void updateMilos(Fighter *fighter); + bool canInteractMilos(Fighter const *fighter, FightAction action); + void handleOpponentActionMilos(Fighter *fighter, FightAction action); + void updateOpponentMilos(Fighter *fighter); + + // Anna + void loadAnnaPlayer(); + void loadAnnaOpponent(); + void handleActionAnna(Fighter *fighter, FightAction action); + void updateOpponentAnna(Fighter *fighter); + + // Ivo + void loadIvoPlayer(); + void loadIvoOpponent(); + void handleActionIvo(Fighter *fighter, FightAction action); + void updateIvo(Fighter *fighter); + bool canInteractIvo(Fighter const *fighter, FightAction action); + void handleOpponentActionIvo(Fighter *fighter, FightAction action); + void updateOpponentIvo(Fighter *fighter); + + // Salko + void loadSalkoPlayer(); + void loadSalkoOpponent(); + void handleActionSalko(Fighter *fighter, FightAction action); + void updateSalko(Fighter *fighter); + bool canInteractSalko(Fighter const *fighter, FightAction action); + void handleOpponentActionSalko(Fighter *fighter, FightAction action); + void updateOpponentSalko(Fighter *fighter); + + // Vesna + void loadVesnaPlayer(); + void loadVesnaOpponent(); + void handleActionVesna(Fighter *fighter, FightAction action); + void updateVesna(Fighter *fighter); + bool canInteractVesna(Fighter const *fighter, FightAction action); + void handleOpponentActionVesna(Fighter *fighter, FightAction action); + void updateOpponentVesna(Fighter *fighter); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHT_H diff --git a/engines/lastexpress/game/fight.cpp b/engines/lastexpress/game/fight.cpp deleted file mode 100644 index ecc43bed2b..0000000000 --- a/engines/lastexpress/game/fight.cpp +++ /dev/null @@ -1,1583 +0,0 @@ -/* 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 "lastexpress/game/fight.h" - -#include "lastexpress/data/cursor.h" -#include "lastexpress/data/scene.h" -#include "lastexpress/data/sequence.h" - -#include "lastexpress/game/entities.h" -#include "lastexpress/game/inventory.h" -#include "lastexpress/game/logic.h" -#include "lastexpress/game/object.h" -#include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" -#include "lastexpress/game/state.h" - -#include "lastexpress/graphics.h" -#include "lastexpress/helpers.h" -#include "lastexpress/lastexpress.h" -#include "lastexpress/resource.h" - -#include "common/func.h" - -namespace LastExpress { - -#define CALL_FUNCTION0(fighter, name) \ - (*fighter->name)(fighter) - -#define CALL_FUNCTION1(fighter, name, a) \ - (*fighter->name)(fighter, a) - -#define REGISTER_PLAYER_FUNCTIONS(name) \ - if (!_data) \ - error("Fight::load##namePlayer - invalid data!"); \ - _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleAction##name); \ - _data->player->update = new Common::Functor1Mem(this, &Fight::update##name); \ - _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract##name); - -#define REGISTER_OPPONENT_FUNCTIONS(name) \ - if (!_data) \ - error("Fight::load##nameOpponent - invalid data!"); \ - _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleOpponentAction##name); \ - _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponent##name); \ - _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); - -#define CHECK_SEQUENCE2(fighter, value) \ - (fighter->frame->getInfo()->field_33 & value) - -Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(NULL), _endType(kFightEndLost), _state(0), _handleTimer(false) {} - -Fight::~Fight() { - clearData(); - _data = NULL; - - // Zero passed pointers - _engine = NULL; -} - -////////////////////////////////////////////////////////////////////////// -// Events -////////////////////////////////////////////////////////////////////////// - -void Fight::eventMouse(const Common::Event &ev) { - if (!_data || _data->index) - return; - - // TODO move all the egg handling to inventory functions - - getFlags()->mouseLeftClick = false; - getFlags()->shouldRedraw = false; - getFlags()->mouseRightClick = false; - - if (ev.mouse.x < 608 || ev.mouse.y < 448 || ev.mouse.x >= 640 || ev.mouse.x >= 480) { - - // Handle right button click - if (ev.type == Common::EVENT_RBUTTONUP) { - getSound()->removeFromQueue(kEntityTables0); - setStopped(); - - getGlobalTimer() ? _state = 0 : ++_state; - - getFlags()->mouseRightClick = true; - } - - if (_handleTimer) { - // Timer expired => show with full brightness - if (!getGlobalTimer()) - getInventory()->drawBlinkingEgg(); - - _handleTimer = false; - } - - // Check hotspots - Scene *scene = getScenes()->get(getState()->scene); - SceneHotspot *hotspot = NULL; - - if (!scene->checkHotSpot(ev.mouse, &hotspot)) { - _engine->getCursor()->setStyle(kCursorNormal); - } else { - _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); - - // Call player function - if (CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { - if (ev.type == Common::EVENT_LBUTTONUP) - CALL_FUNCTION1(_data->player, handleAction, (FightAction)hotspot->action); - } else { - _engine->getCursor()->setStyle(kCursorNormal); - } - } - } else { - // Handle clicks on menu icon - - if (!_handleTimer) { - // Timer expired => show with full brightness - if (!getGlobalTimer()) - getInventory()->drawBlinkingEgg(); - - _handleTimer = true; - } - - // Stop fight if clicked - if (ev.type == Common::EVENT_LBUTTONUP) { - _handleTimer = false; - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndExit); - } - - // Reset timer on right click - if (ev.type == Common::EVENT_RBUTTONUP) { - if (getGlobalTimer()) { - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); - - setGlobalTimer(900); - } - } - } - - getFlags()->shouldRedraw = true; -} - -void Fight::eventTick(const Common::Event &ev) { - handleTick(ev, true); -} - -void Fight::handleTick(const Common::Event &ev, bool isProcessing) { - // TODO move all the egg handling to inventory functions - - // Blink egg - if (getGlobalTimer()) { - warning("Fight::handleMouseMove - egg blinking not implemented!"); - } - - if (!_data || _data->index) - return; - - SceneHotspot *hotspot = NULL; - if (!getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot) || !CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { - _engine->getCursor()->setStyle(kCursorNormal); - } else { - _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); - } - - CALL_FUNCTION0(_data->player, update); - CALL_FUNCTION0(_data->opponent, update); - - // Draw sequences - if (!_data->isRunning) - return; - - if (isProcessing) - getScenes()->drawFrames(true); - - if (_data->index) { - // Set next sequence name index - _data->index--; - _data->sequences[_data->index] = loadSequence(_data->names[_data->index]); - } -} - -////////////////////////////////////////////////////////////////////////// -// Setup -////////////////////////////////////////////////////////////////////////// - -Fight::FightEndType Fight::setup(FightType type) { - if (_data) - error("Fight::setup - calling fight setup again while a fight is already in progress!"); - - ////////////////////////////////////////////////////////////////////////// - // Prepare UI & state - if (_state >= 5 && (type == kFightSalko || type == kFightVesna)) { - _state = 0; - return kFightEndWin; - } - - getInventory()->showHourGlass(); - // TODO events function - getFlags()->flag_0 = false; - getFlags()->mouseRightClick = false; - getEntities()->reset(); - - // Compute scene to use - SceneIndex sceneIndex; - switch(type) { - default: - sceneIndex = kSceneFightDefault; - break; - - case kFightMilos: - sceneIndex = (getObjects()->get(kObjectCompartment1).location2 < kObjectLocation3) ? kSceneFightMilos : kSceneFightMilosBedOpened; - break; - - case kFightAnna: - sceneIndex = kSceneFightAnna; - break; - - case kFightIvo: - sceneIndex = kSceneFightIvo; - break; - - case kFightSalko: - sceneIndex = kSceneFightSalko; - break; - - case kFightVesna: - sceneIndex = kSceneFightVesna; - break; - } - - if (getFlags()->shouldRedraw) { - getFlags()->shouldRedraw = false; - askForRedraw(); - //redrawScreen(); - } - - // Load the scene object - Scene *scene = getScenes()->get(sceneIndex); - - // Update game entities and state - getEntityData(kEntityPlayer)->entityPosition = scene->entityPosition; - getEntityData(kEntityPlayer)->location = scene->location; - - getState()->scene = sceneIndex; - - getFlags()->flag_3 = true; - - // Draw the scene - _engine->getGraphicsManager()->draw(scene, GraphicsManager::kBackgroundC); - // FIXME move to start of fight? - askForRedraw(); - redrawScreen(); - - ////////////////////////////////////////////////////////////////////////// - // Setup the fight - _data = new FightData; - loadData(type); - - // Show opponents & egg button - Common::Event emptyEvent; - handleTick(emptyEvent, false); - getInventory()->drawEgg(); - - // Start fight - _endType = kFightEndLost; - while (_data->isRunning) { - if (_engine->handleEvents()) - continue; - - getSound()->updateQueue(); - } - - // Cleanup after fight is over - clearData(); - - return _endType; -} - -////////////////////////////////////////////////////////////////////////// -// Status -////////////////////////////////////////////////////////////////////////// - -void Fight::setStopped() { - if (_data) - _data->isRunning = false; -} - -void Fight::bailout(FightEndType type) { - _state = 0; - _endType = type; - setStopped(); -} - -////////////////////////////////////////////////////////////////////////// -// Cleanup -////////////////////////////////////////////////////////////////////////// - -void Fight::clearData() { - if (!_data) - return; - - // Clear data - clearSequences(_data->player); - clearSequences(_data->opponent); - - SAFE_DELETE(_data->player); - SAFE_DELETE(_data->opponent); - - SAFE_DELETE(_data); - - _engine->restoreEventHandlers(); -} - -void Fight::clearSequences(Fighter *combatant) const { - if (!combatant) - return; - - // The original game resets the function pointers to default values, just before deleting the struct - getScenes()->removeAndRedraw(&combatant->frame, false); - - // Free sequences - for (int i = 0; i < (int)combatant->sequences.size(); i++) - SAFE_DELETE(combatant->sequences[i]); -} - -////////////////////////////////////////////////////////////////////////// -// Drawing -////////////////////////////////////////////////////////////////////////// - -void Fight::setSequenceAndDraw(Fighter *combatant, uint32 sequenceIndex, FightSequenceType type) const { - if (combatant->sequences.size() < sequenceIndex) - return; - - switch (type) { - default: - break; - - case kFightSequenceType0: - if (combatant->sequenceIndex) - return; - - combatant->sequence = combatant->sequences[sequenceIndex]; - combatant->sequenceIndex = sequenceIndex; - draw(combatant); - break; - - case kFightSequenceType1: - combatant->sequence = combatant->sequences[sequenceIndex]; - combatant->sequenceIndex = sequenceIndex; - combatant->sequenceIndex2 = 0; - draw(combatant); - break; - - case kFightSequenceType2: - combatant->sequenceIndex2 = sequenceIndex; - break; - } -} - -void Fight::draw(Fighter *combatant) const { - getScenes()->removeAndRedraw(&combatant->frame, false); - - combatant->frameIndex = 0; - combatant->field_24 = 0; -} - -////////////////////////////////////////////////////////////////////////// -// Loading -////////////////////////////////////////////////////////////////////////// - -void Fight::loadData(FightType type) { - if (!_data) - error("Fight::loadData - invalid data!"); - - switch (type) { - default: - break; - - case kFightMilos: - loadMilosPlayer(); - loadMilosOpponent(); - break; - - case kFightAnna: - loadAnnaPlayer(); - loadAnnaOpponent(); - break; - - case kFightIvo: - loadIvoPlayer(); - loadIvoOpponent(); - break; - - case kFightSalko: - loadSalkoPlayer(); - loadSalkoOpponent(); - break; - - case kFightVesna: - loadVesnaPlayer(); - loadVesnaOpponent(); - break; - } - - if (!_data->player || !_data->opponent) - error("Fight::loadData - error loading fight data (type=%d)", type); - - ////////////////////////////////////////////////////////////////////////// - // Start running the fight - _data->isRunning = true; - - if (_state < 5) { - setSequenceAndDraw(_data->player, 0, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); - goto end_load; - } - - switch(type) { - default: - break; - - case kFightMilos: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 4, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); - break; - - case kFightIvo: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 3, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 6, kFightSequenceType0); - break; - - case kFightVesna: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 0, kFightSequenceType0); - setSequenceAndDraw(_data->player, 3, kFightSequenceType2); - setSequenceAndDraw(_data->opponent, 5, kFightSequenceType0); - break; - } - -end_load: - // Setup event handlers - _engine->backupEventHandlers(); - SET_EVENT_HANDLERS(Fight, this); -} - -////////////////////////////////////////////////////////////////////////// -// Shared -////////////////////////////////////////////////////////////////////////// -void Fight::processFighter(Fighter *fighter) { - if (!_data) - error("Fight::processFighter - invalid data!"); - - if (!fighter->sequence) { - if (fighter->frame) { - getScenes()->removeFromQueue(fighter->frame); - getScenes()->setCoordinates(fighter->frame); - } - SAFE_DELETE(fighter->frame); - return; - } - - if (fighter->sequence->count() <= fighter->frameIndex) { - switch(fighter->action) { - default: - break; - - case kFightAction101: - setSequenceAndDraw(fighter, fighter->sequenceIndex2, kFightSequenceType1); - fighter->sequenceIndex2 = 0; - break; - - case kFightActionResetFrame: - fighter->frameIndex = 0; - break; - - case kFightAction103: - setSequenceAndDraw(fighter, 0, kFightSequenceType1); - CALL_FUNCTION1(fighter, handleAction, kFightAction101); - setSequenceAndDraw(fighter->opponent, 0, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction101); - CALL_FUNCTION0(fighter->opponent, update); - break; - - case kFightActionWin: - bailout(kFightEndWin); - break; - - case kFightActionLost: - bailout(kFightEndLost); - break; - } - } - - if (_data->isRunning) { - - // Get the current sequence frame - SequenceFrame *frame = new SequenceFrame(fighter->sequence, (uint16)fighter->frameIndex); - frame->getInfo()->location = 1; - - if (fighter->frame == frame) { - delete frame; - return; - } - - getSound()->playFightSound(frame->getInfo()->soundAction, frame->getInfo()->field_31); - - // Add current frame to queue and advance - getScenes()->addToQueue(frame); - fighter->frameIndex++; - - if (fighter->frame) { - getScenes()->removeFromQueue(fighter->frame); - - if (!frame->getInfo()->field_2E) - getScenes()->setCoordinates(fighter->frame); - } - - // Replace by new frame - delete fighter->frame; - fighter->frame = frame; - } -} - -void Fight::handleAction(Fighter *fighter, FightAction action) { - switch (action) { - default: - return; - - case kFightAction101: - break; - - case kFightActionResetFrame: - fighter->countdown--; - break; - - case kFightAction103: - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - - case kFightActionWin: - _endType = kFightEndWin; - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - - case kFightActionLost: - _endType = kFightEndLost; - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - } - - // Update action - fighter->action = action; -} - -bool Fight::canInteract(Fighter const *fighter, FightAction /*= (FightAction)0*/ ) { - return (fighter->action == kFightAction101 && !fighter->sequenceIndex); -} - -void Fight::update(Fighter *fighter) { - - processFighter(fighter); - - if (fighter->frame) - fighter->frame->getInfo()->location = (fighter->action == kFightActionResetFrame ? 2 : 0); -} - -void Fight::updateOpponent(Fighter *fighter) { - - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - processFighter(opponent); - - if (opponent->field_38 && !opponent->sequenceIndex) - opponent->field_38--; - - if (fighter->frame) - fighter->frame->getInfo()->location = 1; -} - -////////////////////////////////////////////////////////////////////////// -// Milos -////////////////////////////////////////////////////////////////////////// - -void Fight::loadMilosPlayer() { - REGISTER_PLAYER_FUNCTIONS(Milos) - - _data->player->sequences.push_back(loadSequence("2001cr.seq")); - _data->player->sequences.push_back(loadSequence("2001cdl.seq")); - _data->player->sequences.push_back(loadSequence("2001cdr.seq")); - _data->player->sequences.push_back(loadSequence("2001cdm.seq")); - _data->player->sequences.push_back(loadSequence("2001csgr.seq")); - _data->player->sequences.push_back(loadSequence("2001csgl.seq")); - _data->player->sequences.push_back(loadSequence("2001dbk.seq")); -} - -void Fight::loadMilosOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Milos) - - _data->opponent->sequences.push_back(loadSequence("2001or.seq")); - _data->opponent->sequences.push_back(loadSequence("2001oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2001oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2001okl.seq")); - _data->opponent->sequences.push_back(loadSequence("2001okm.seq")); - _data->opponent->sequences.push_back(loadSequence("2001dbk.seq")); - _data->opponent->sequences.push_back(loadSequence("2001wbk.seq")); - - getSound()->playSound(kEntityTables0, "MUS027", SoundManager::kFlagDefault); - - _data->opponent->field_38 = 35; -} - -void Fight::handleActionMilos(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 6, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 3, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 6, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction128: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4) || fighter->opponent->sequenceIndex != 1) { - switch (fighter->opponent->sequenceIndex) { - default: - setSequenceAndDraw(fighter, rnd(3) + 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - } - } else { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - CALL_FUNCTION0(fighter, update); - } - break; - } -} - -void Fight::updateMilos(Fighter *fighter) { - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - // Draw sequences - if (fighter->opponent->countdown <= 0) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); - - getSound()->removeFromQueue(kEntityTables0); - getSound()->playSound(kEntityTrain, "MUS029", SoundManager::kFlagDefault); - - CALL_FUNCTION1(fighter, handleAction, kFightActionWin); - } - - if (fighter->sequenceIndex == 4) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction4); - _endType = kFightEndLost; - } - } - - update(fighter); -} - -bool Fight::canInteractMilos(Fighter const *fighter, FightAction action) { - if (!_data) - error("Fight::canInteractMilos - invalid data!"); - - if (action != kFightAction128 - || _data->player->sequenceIndex != 1 - || !fighter->frame - || CHECK_SEQUENCE2(fighter, 4) - || fighter->opponent->sequenceIndex != 1) { - return canInteract(fighter); - } - - _engine->getCursor()->setStyle(kCursorHand); - - return true; -} - -void Fight::handleOpponentActionMilos(Fighter *fighter, FightAction action) { - if (action == kFightAction4) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - } else { - if (action != kFightAction131) - handleAction(fighter, action); - } -} - -void Fight::updateOpponentMilos(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType1); - break; - - case 3: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } else { - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - } - - // Update field_38 - if (opponent->opponent->field_34 < 5) - opponent->field_38 = 6 * (5 - opponent->opponent->field_34); - else - opponent->field_38 = 0; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - } - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Anna -////////////////////////////////////////////////////////////////////////// - -void Fight::loadAnnaPlayer() { - if (!_data) - error("Fight::loadAnnaPlayer - invalid data!"); - - // Special case: we are using some shared functions directly - _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleActionAnna); - _data->player->update = new Common::Functor1Mem(this, &Fight::update); - _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); - - _data->player->sequences.push_back(loadSequence("2002cr.seq")); - _data->player->sequences.push_back(loadSequence("2002cdl.seq")); - _data->player->sequences.push_back(loadSequence("2002cdr.seq")); - _data->player->sequences.push_back(loadSequence("2002cdm.seq")); - _data->player->sequences.push_back(loadSequence("2002lbk.seq")); -} - -void Fight::loadAnnaOpponent() { - if (!_data) - error("Fight::loadAnnaOpponent - invalid data!"); - - // Special case: we are using some shared functions directly - _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleAction); - _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponentAnna); - _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); - - _data->opponent->sequences.push_back(loadSequence("2002or.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okml.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okm.seq")); - - getSound()->playSound(kEntityTables0, "MUS030", SoundManager::kFlagDefault); - - _data->opponent->field_38 = 30; -} - -void Fight::handleActionAnna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if ((fighter->sequenceIndex != 1 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction3: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 1) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction128: - switch (fighter->opponent->sequenceIndex) { - default: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - break; - } - - if (fighter->field_34 > 4) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - } -} - -void Fight::updateOpponentAnna(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(6)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 5: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = (int32)rnd(15); - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 3) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - } - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Ivo -////////////////////////////////////////////////////////////////////////// - -void Fight::loadIvoPlayer() { - REGISTER_PLAYER_FUNCTIONS(Ivo) - - _data->player->sequences.push_back(loadSequence("2003cr.seq")); - _data->player->sequences.push_back(loadSequence("2003car.seq")); - _data->player->sequences.push_back(loadSequence("2003cal.seq")); - _data->player->sequences.push_back(loadSequence("2003cdr.seq")); - _data->player->sequences.push_back(loadSequence("2003cdm.seq")); - _data->player->sequences.push_back(loadSequence("2003chr.seq")); - _data->player->sequences.push_back(loadSequence("2003chl.seq")); - _data->player->sequences.push_back(loadSequence("2003ckr.seq")); - _data->player->sequences.push_back(loadSequence("2003lbk.seq")); - _data->player->sequences.push_back(loadSequence("2003fbk.seq")); - - _data->player->countdown = 5; -} - -void Fight::loadIvoOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Ivo) - - _data->opponent->sequences.push_back(loadSequence("2003or.seq")); - _data->opponent->sequences.push_back(loadSequence("2003oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2003oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2003odm.seq")); - _data->opponent->sequences.push_back(loadSequence("2003okl.seq")); - _data->opponent->sequences.push_back(loadSequence("2003okj.seq")); - _data->opponent->sequences.push_back(loadSequence("blank.seq")); - _data->opponent->sequences.push_back(loadSequence("csdr.seq")); - _data->opponent->sequences.push_back(loadSequence("2003l.seq")); - - getSound()->playSound(kEntityTables0, "MUS032", SoundManager::kFlagDefault); - - _data->opponent->countdown = 5; - _data->opponent->field_38 = 15; -} - -void Fight::handleActionIvo(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - switch (fighter->opponent->sequenceIndex) { - default: - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - break; - - case kFightAction129: - setSequenceAndDraw(fighter, (fighter->opponent->countdown > 1) ? 4 : 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); - break; - - case kFightAction130: - setSequenceAndDraw(fighter, 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); - break; - } -} - -void Fight::updateIvo(Fighter *fighter) { - - if ((fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) && !fighter->frameIndex) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction131); - - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - // Draw sequences - if (fighter->opponent->countdown <= 0) { - setSequenceAndDraw(fighter, 9, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); - - CALL_FUNCTION1(fighter, handleAction, kFightActionWin); - return; - } - - if (fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) - CALL_FUNCTION1(fighter->opponent, handleAction, (FightAction)fighter->sequenceIndex); - } - - update(fighter); -} - -bool Fight::canInteractIvo(Fighter const *fighter, FightAction action) { - if (action == kFightAction129 || action == kFightAction130) - return (fighter->sequenceIndex >= 8); - - return canInteract(fighter); -} - -void Fight::handleOpponentActionIvo(Fighter *fighter, FightAction action) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - switch (action) { - default: - handleAction(fighter, action); - break; - - case kFightAction3: - if ((opponent->sequenceIndex != 1 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 6, kFightSequenceType1); - CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); - } - break; - - case kFightAction4: - if ((opponent->sequenceIndex != 2 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 5, kFightSequenceType1); - CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); - } - break; - - case kFightAction131: - if (opponent->sequenceIndex) - break; - - if (rnd(100) <= (unsigned int)(opponent->countdown > 2 ? 60 : 75)) { - setSequenceAndDraw(opponent, 3 , kFightSequenceType1); - if (opponent->opponent->sequenceIndex == 4) - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - } - break; - } -} - -void Fight::updateOpponentIvo(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 3: - setSequenceAndDraw(opponent, 0, kFightSequenceType2); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 0, kFightSequenceType1); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = 3 * opponent->countdown + (int32)rnd(10); - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - - if (opponent->opponent->countdown <= 0) { - setSequenceAndDraw(opponent, 7, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); - - CALL_FUNCTION1(opponent->opponent, handleAction, kFightActionWin); - - return; - } - - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Salko -////////////////////////////////////////////////////////////////////////// - -void Fight::loadSalkoPlayer() { - REGISTER_PLAYER_FUNCTIONS(Salko) - - _data->player->sequences.push_back(loadSequence("2004cr.seq")); - _data->player->sequences.push_back(loadSequence("2004cdr.seq")); - _data->player->sequences.push_back(loadSequence("2004chj.seq")); - _data->player->sequences.push_back(loadSequence("2004bk.seq")); - - _data->player->countdown = 2; -} - -void Fight::loadSalkoOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Salko) - - _data->opponent->sequences.push_back(loadSequence("2004or.seq")); - _data->opponent->sequences.push_back(loadSequence("2004oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2004oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2004okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2004ohm.seq")); - _data->opponent->sequences.push_back(loadSequence("blank.seq")); - - getSound()->playSound(kEntityTables0, "MUS035", SoundManager::kFlagDefault); - - _data->opponent->countdown = 3; - _data->opponent->field_38 = 30; -} - -void Fight::handleActionSalko(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - case kFightAction2: - if (fighter->sequenceIndex != 1 && CHECK_SEQUENCE2(fighter, 4)) { - fighter->field_34 = 0; - - setSequenceAndDraw(fighter, 3, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, (action == kFightAction1 ? 3 : 4), kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - - if (action == kFightAction2) - fighter->countdown= 0; - - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction5: - if (fighter->sequenceIndex != 3) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - fighter->field_34 = 0; - break; - - case kFightAction131: - setSequenceAndDraw(fighter, 2, (fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0)); - break; - } -} - -void Fight::updateSalko(Fighter *fighter) { - update(fighter); - - // The original doesn't check for currentSequence2 != NULL (might not happen when everything is working properly, but crashes with our current implementation) - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - if (fighter->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - - return; - } - - if (fighter->sequenceIndex == 2) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction2); - } -} - -bool Fight::canInteractSalko(Fighter const *fighter, FightAction action) { - if (action == kFightAction131) { - if (fighter->sequenceIndex == 1) { - if (fighter->opponent->countdown <= 0) - _engine->getCursor()->setStyle(kCursorHand); - - return true; - } - - return false; - } - - return canInteract(fighter); -} - -void Fight::handleOpponentActionSalko(Fighter *fighter, FightAction action) { - if (action == kFightAction2) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - } else { - handleAction(fighter, action); - } -} - -void Fight::updateOpponentSalko(Fighter *fighter) { - // This is an opponent struct - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 3: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - - // Update field_38 - opponent->field_38 = 4 * opponent->countdown; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndLost); - - // Stop processing - return; - } - - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Vesna -////////////////////////////////////////////////////////////////////////// - -void Fight::loadVesnaPlayer() { - REGISTER_PLAYER_FUNCTIONS(Vesna) - - _data->player->sequences.push_back(loadSequence("2005cr.seq")); - _data->player->sequences.push_back(loadSequence("2005cdr.seq")); - _data->player->sequences.push_back(loadSequence("2005cbr.seq")); - _data->player->sequences.push_back(loadSequence("2005bk.seq")); - _data->player->sequences.push_back(loadSequence("2005cdm1.seq")); - _data->player->sequences.push_back(loadSequence("2005chl.seq")); -} - -void Fight::loadVesnaOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Vesna) - - _data->opponent->sequences.push_back(loadSequence("2005or.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2005okml.seq")); - _data->opponent->sequences.push_back(loadSequence("2005okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2005odm1.seq")); - _data->opponent->sequences.push_back(loadSequence("2005csbm.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oam4.seq")); - - getSound()->playSound(kEntityTables0, "MUS038", SoundManager::kFlagDefault); - - _data->opponent->countdown = 4; - _data->opponent->field_38 = 30; -} - -void Fight::handleActionVesna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if (fighter->sequenceIndex != 2) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction5: - if (fighter->sequenceIndex != 3) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - if (fighter->sequenceIndex == 1 && fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - } else { - setSequenceAndDraw(fighter, (fighter->opponent->sequenceIndex == 5) ? 3 : 1, kFightSequenceType0); - } - break; - - case kFightAction132: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - - if (fighter->field_34 > 10) { - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType2); - fighter->opponent->countdown = 1; - fighter->field_34 = 0; - } -} - -void Fight::updateVesna(Fighter *fighter) { - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - if (fighter->sequenceIndex == 3) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction3); - - if (fighter->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - return; - } - - if (fighter->sequenceIndex == 5) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction5); - } - - update(fighter); -} - -bool Fight::canInteractVesna(Fighter const *fighter, FightAction action) { - if (action != kFightAction128) - return canInteract(fighter); - - if (fighter->sequenceIndex != 1) { - - if (fighter->opponent->sequenceIndex == 5) { - _engine->getCursor()->setStyle(kCursorDown); - return true; - } - - return canInteract(fighter); - } - - if (fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { - _engine->getCursor()->setStyle(kCursorPunchLeft); - return true; - } - - return false; -} - -void Fight::handleOpponentActionVesna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - break; - - case kFightAction3: - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - break; - - case kFightAction5: - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - if (fighter->countdown <= 1) - fighter->countdown = 1; - break; - - case kFightAction131: - break; - } -} - -void Fight::updateOpponentVesna(Fighter *fighter) { - // This is an opponent struct - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 == 1) { - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - } else { - switch (rnd(6)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 2: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 5: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = 4 * opponent->countdown; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 5) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - - switch (opponent->sequenceIndex) { - default: - break; - - case 1: - setSequenceAndDraw(opponent, 3, kFightSequenceType1); - break; - - case 2: - setSequenceAndDraw(opponent, 4, kFightSequenceType1); - break; - - case 5: - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - break; - } - - setSequenceAndDraw(opponent->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - CALL_FUNCTION0(opponent->opponent, update); - CALL_FUNCTION0(opponent, update); - - getSound()->removeFromQueue(kEntityTables0); - - // Stop processing - return; - } - } - - updateOpponent(opponent); -} - -} // End of namespace LastExpress diff --git a/engines/lastexpress/game/fight.h b/engines/lastexpress/game/fight.h deleted file mode 100644 index a33cc93a29..0000000000 --- a/engines/lastexpress/game/fight.h +++ /dev/null @@ -1,266 +0,0 @@ -/* 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 LASTEXPRESS_FIGHT_H -#define LASTEXPRESS_FIGHT_H - -/* - Fight structure - --------------- - uint32 {4} - player struct - uint32 {4} - opponent struct - uint32 {4} - hasLost flag - - byte {1} - isRunning - - Fight participant structure - --------------------------- - uint32 {4} - function pointer - uint32 {4} - pointer to fight structure - uint32 {4} - pointer to opponent (fight participant structure) - uint32 {4} - array of sequences - uint32 {4} - number of sequences - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint16 {2} - ?? - uint16 {2} - ?? - only for opponent structure - uint32 {4} - ?? - only for opponent structure - -*/ - -#include "lastexpress/shared.h" - -#include "lastexpress/eventhandler.h" - -#include "common/array.h" - -namespace LastExpress { - -class LastExpressEngine; -class Sequence; -class SequenceFrame; - -////////////////////////////////////////////////////////////////////////// -// TODO : objectify! -class Fight : public EventHandler { -public: - enum FightEndType { - kFightEndWin = 0, - kFightEndLost = 1, - kFightEndExit = 2 - }; - - Fight(LastExpressEngine *engine); - ~Fight(); - - FightEndType setup(FightType type); - - void eventMouse(const Common::Event &ev); - void eventTick(const Common::Event &ev); - - void setStopped(); - void resetState() { _state = 0; } - -private: - enum FightSequenceType { - kFightSequenceType0 = 0, - kFightSequenceType1 = 1, - kFightSequenceType2 = 2 - }; - - enum FightAction { - kFightAction1 = 1, - kFightAction2 = 2, - kFightAction3 = 3, - kFightAction4 = 4, - kFightAction5 = 5, - kFightAction101 = 101, - kFightActionResetFrame = 102, - kFightAction103 = 103, - kFightActionWin = 104, - kFightActionLost = 105, - kFightAction128 = 128, - kFightAction129 = 129, - kFightAction130 = 130, - kFightAction131 = 131, - kFightAction132 = 132 - }; - - struct Fighter { - Common::Functor2 *handleAction; - Common::Functor1 *update; - Common::Functor2 *canInteract; - Fighter *opponent; - Common::Array sequences; - uint32 sequenceIndex; - Sequence *sequence; - SequenceFrame *frame; - uint32 frameIndex; - uint32 field_24; - FightAction action; - uint32 sequenceIndex2; - int32 countdown; // countdown before loosing ? - uint32 field_34; - - Fighter() { - handleAction = NULL; - update = NULL; - canInteract = NULL; - - opponent = NULL; - - sequenceIndex = 0; - sequence = NULL; - frame = NULL; - frameIndex = 0; - - field_24 = 0; - - action = kFightAction101; - sequenceIndex2 = 0; - - countdown = 1; - - field_34 = 0; - } - }; - - // Opponent struct - struct Opponent : Fighter { - int32 field_38; - - Opponent() : Fighter() { - field_38 = 0; - } - }; - - struct FightData { - Fighter *player; - Opponent *opponent; - int32 index; - - Sequence *sequences[20]; - Common::String names[20]; - - bool isRunning; - - FightData() { - player = new Fighter(); - opponent = new Opponent(); - - // Set opponents - player->opponent = opponent; - opponent->opponent = player; - - index = 0; - - isRunning = false; - } - }; - - LastExpressEngine *_engine; - FightData *_data; - FightEndType _endType; - int _state; - - bool _handleTimer; - - // Events - void handleTick(const Common::Event &ev, bool unknown); - - // State - void bailout(FightEndType type); - - - // Drawing - void setSequenceAndDraw(Fighter *fighter, uint32 sequenceIndex, FightSequenceType type) const; - void draw(Fighter *fighter) const; - - // Cleanup - void clearData(); - void clearSequences(Fighter *fighter) const; - - ////////////////////////////////////////////////////////////////////////// - // Loading - void loadData(FightType type); - - // Shared - void processFighter(Fighter *fighter); - - // Default functions - void handleAction(Fighter *fighter, FightAction action); - void update(Fighter *fighter); - bool canInteract(Fighter const *fighter, FightAction = (FightAction)0); - void updateOpponent(Fighter *fighter); - - // Milos - void loadMilosPlayer(); - void loadMilosOpponent(); - void handleActionMilos(Fighter *fighter, FightAction action); - void updateMilos(Fighter *fighter); - bool canInteractMilos(Fighter const *fighter, FightAction action); - void handleOpponentActionMilos(Fighter *fighter, FightAction action); - void updateOpponentMilos(Fighter *fighter); - - // Anna - void loadAnnaPlayer(); - void loadAnnaOpponent(); - void handleActionAnna(Fighter *fighter, FightAction action); - void updateOpponentAnna(Fighter *fighter); - - // Ivo - void loadIvoPlayer(); - void loadIvoOpponent(); - void handleActionIvo(Fighter *fighter, FightAction action); - void updateIvo(Fighter *fighter); - bool canInteractIvo(Fighter const *fighter, FightAction action); - void handleOpponentActionIvo(Fighter *fighter, FightAction action); - void updateOpponentIvo(Fighter *fighter); - - // Salko - void loadSalkoPlayer(); - void loadSalkoOpponent(); - void handleActionSalko(Fighter *fighter, FightAction action); - void updateSalko(Fighter *fighter); - bool canInteractSalko(Fighter const *fighter, FightAction action); - void handleOpponentActionSalko(Fighter *fighter, FightAction action); - void updateOpponentSalko(Fighter *fighter); - - // Vesna - void loadVesnaPlayer(); - void loadVesnaOpponent(); - void handleActionVesna(Fighter *fighter, FightAction action); - void updateVesna(Fighter *fighter); - bool canInteractVesna(Fighter const *fighter, FightAction action); - void handleOpponentActionVesna(Fighter *fighter, FightAction action); - void updateOpponentVesna(Fighter *fighter); -}; - -} // End of namespace LastExpress - -#endif // LASTEXPRESS_FIGHT_H diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index 0911c60de0..a8a2ce87b1 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -30,11 +30,13 @@ // Entities #include "lastexpress/entities/chapters.h" +// Fight +#include "lastexpress/fight/fight.h" + // Game #include "lastexpress/game/action.h" #include "lastexpress/game/beetle.h" #include "lastexpress/game/entities.h" -#include "lastexpress/game/fight.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/menu.h" #include "lastexpress/game/object.h" diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp index f9eef26326..27a43d8f61 100644 --- a/engines/lastexpress/game/menu.cpp +++ b/engines/lastexpress/game/menu.cpp @@ -28,7 +28,8 @@ #include "lastexpress/data/snd.h" #include "lastexpress/data/scene.h" -#include "lastexpress/game/fight.h" +#include "lastexpress/fight/fight.h" + #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/savegame.h" diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index 12fbb4f85b..3827c16681 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -45,10 +45,10 @@ MODULE_OBJS := \ entities/verges.o \ entities/vesna.o \ entities/yasmin.o \ + fight/fight.o \ game/action.o \ game/beetle.o \ game/entities.o \ - game/fight.o \ game/inventory.o \ game/logic.o \ game/menu.o \ -- cgit v1.2.3 From 434a2e66b1fc59e1b7732591cfefd7e389905817 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 02:20:15 -0400 Subject: LASTEXPRESS: Refactor Fight class - Replace structs holding function pointers by proper classes - Move each fighter functions to separate files --- engines/lastexpress/fight/fight.cpp | 1290 ++------------------------- engines/lastexpress/fight/fight.h | 169 +--- engines/lastexpress/fight/fighter.cpp | 248 +++++ engines/lastexpress/fight/fighter.h | 123 +++ engines/lastexpress/fight/fighter_anna.cpp | 186 ++++ engines/lastexpress/fight/fighter_anna.h | 48 + engines/lastexpress/fight/fighter_ivo.cpp | 244 +++++ engines/lastexpress/fight/fighter_ivo.h | 51 ++ engines/lastexpress/fight/fighter_milos.cpp | 221 +++++ engines/lastexpress/fight/fighter_milos.h | 51 ++ engines/lastexpress/fight/fighter_salko.cpp | 201 +++++ engines/lastexpress/fight/fighter_salko.h | 51 ++ engines/lastexpress/fight/fighter_vesna.cpp | 264 ++++++ engines/lastexpress/fight/fighter_vesna.h | 51 ++ engines/lastexpress/module.mk | 6 + 15 files changed, 1816 insertions(+), 1388 deletions(-) create mode 100644 engines/lastexpress/fight/fighter.cpp create mode 100644 engines/lastexpress/fight/fighter.h create mode 100644 engines/lastexpress/fight/fighter_anna.cpp create mode 100644 engines/lastexpress/fight/fighter_anna.h create mode 100644 engines/lastexpress/fight/fighter_ivo.cpp create mode 100644 engines/lastexpress/fight/fighter_ivo.h create mode 100644 engines/lastexpress/fight/fighter_milos.cpp create mode 100644 engines/lastexpress/fight/fighter_milos.h create mode 100644 engines/lastexpress/fight/fighter_salko.cpp create mode 100644 engines/lastexpress/fight/fighter_salko.h create mode 100644 engines/lastexpress/fight/fighter_vesna.cpp create mode 100644 engines/lastexpress/fight/fighter_vesna.h diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp index 5b3530f488..685b3b09d1 100644 --- a/engines/lastexpress/fight/fight.cpp +++ b/engines/lastexpress/fight/fight.cpp @@ -22,16 +22,19 @@ #include "lastexpress/fight/fight.h" +#include "lastexpress/fight/fighter_anna.h" +#include "lastexpress/fight/fighter_ivo.h" +#include "lastexpress/fight/fighter_milos.h" +#include "lastexpress/fight/fighter_salko.h" +#include "lastexpress/fight/fighter_vesna.h" + #include "lastexpress/data/cursor.h" -#include "lastexpress/data/scene.h" #include "lastexpress/data/sequence.h" -#include "lastexpress/game/entities.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/graphics.h" @@ -39,34 +42,24 @@ #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" -#include "common/func.h" - namespace LastExpress { -#define CALL_FUNCTION0(fighter, name) \ - (*fighter->name)(fighter) +Fight::FightData::FightData() { + player = NULL; + opponent = NULL; -#define CALL_FUNCTION1(fighter, name, a) \ - (*fighter->name)(fighter, a) + index = 0; -#define REGISTER_PLAYER_FUNCTIONS(name) \ - if (!_data) \ - error("Fight::load##namePlayer - invalid data!"); \ - _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleAction##name); \ - _data->player->update = new Common::Functor1Mem(this, &Fight::update##name); \ - _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract##name); - -#define REGISTER_OPPONENT_FUNCTIONS(name) \ - if (!_data) \ - error("Fight::load##nameOpponent - invalid data!"); \ - _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleOpponentAction##name); \ - _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponent##name); \ - _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); + isFightRunning = false; +} -#define CHECK_SEQUENCE2(fighter, value) \ - (fighter->frame->getInfo()->field_33 & value) +Fight::FightData::~FightData() { + SAFE_DELETE(player); + SAFE_DELETE(opponent); +} -Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(NULL), _endType(kFightEndLost), _state(0), _handleTimer(false) {} +Fight::Fight(LastExpressEngine *engine) : _engine(engine), _data(NULL), _endType(kFightEndLost), _state(0), _handleTimer(false) { +} Fight::~Fight() { clearData(); @@ -79,7 +72,6 @@ Fight::~Fight() { ////////////////////////////////////////////////////////////////////////// // Events ////////////////////////////////////////////////////////////////////////// - void Fight::eventMouse(const Common::Event &ev) { if (!_data || _data->index) return; @@ -120,9 +112,9 @@ void Fight::eventMouse(const Common::Event &ev) { _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); // Call player function - if (CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { + if (_data->player->canInteract((Fighter::FightAction)hotspot->action)) { if (ev.type == Common::EVENT_LBUTTONUP) - CALL_FUNCTION1(_data->player, handleAction, (FightAction)hotspot->action); + _data->player->handleAction((Fighter::FightAction)hotspot->action); } else { _engine->getCursor()->setStyle(kCursorNormal); } @@ -175,17 +167,17 @@ void Fight::handleTick(const Common::Event &ev, bool isProcessing) { return; SceneHotspot *hotspot = NULL; - if (!getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot) || !CALL_FUNCTION1(_data->player, canInteract, (FightAction)hotspot->action)) { + if (!getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot) || !_data->player->canInteract((Fighter::FightAction)hotspot->action)) { _engine->getCursor()->setStyle(kCursorNormal); } else { _engine->getCursor()->setStyle((CursorStyle)hotspot->cursor); } - CALL_FUNCTION0(_data->player, update); - CALL_FUNCTION0(_data->opponent, update); + _data->player->update(); + _data->opponent->update(); // Draw sequences - if (!_data->isRunning) + if (!_data->isFightRunning) return; if (isProcessing) @@ -201,7 +193,6 @@ void Fight::handleTick(const Common::Event &ev, bool isProcessing) { ////////////////////////////////////////////////////////////////////////// // Setup ////////////////////////////////////////////////////////////////////////// - Fight::FightEndType Fight::setup(FightType type) { if (_data) error("Fight::setup - calling fight setup again while a fight is already in progress!"); @@ -282,7 +273,7 @@ Fight::FightEndType Fight::setup(FightType type) { // Start fight _endType = kFightEndLost; - while (_data->isRunning) { + while (_data->isFightRunning) { if (_engine->handleEvents()) continue; @@ -298,10 +289,9 @@ Fight::FightEndType Fight::setup(FightType type) { ////////////////////////////////////////////////////////////////////////// // Status ////////////////////////////////////////////////////////////////////////// - void Fight::setStopped() { if (_data) - _data->isRunning = false; + _data->isFightRunning = false; } void Fight::bailout(FightEndType type) { @@ -313,80 +303,19 @@ void Fight::bailout(FightEndType type) { ////////////////////////////////////////////////////////////////////////// // Cleanup ////////////////////////////////////////////////////////////////////////// - void Fight::clearData() { if (!_data) return; // Clear data - clearSequences(_data->player); - clearSequences(_data->opponent); - - SAFE_DELETE(_data->player); - SAFE_DELETE(_data->opponent); - SAFE_DELETE(_data); _engine->restoreEventHandlers(); } -void Fight::clearSequences(Fighter *combatant) const { - if (!combatant) - return; - - // The original game resets the function pointers to default values, just before deleting the struct - getScenes()->removeAndRedraw(&combatant->frame, false); - - // Free sequences - for (int i = 0; i < (int)combatant->sequences.size(); i++) - SAFE_DELETE(combatant->sequences[i]); -} - -////////////////////////////////////////////////////////////////////////// -// Drawing -////////////////////////////////////////////////////////////////////////// - -void Fight::setSequenceAndDraw(Fighter *combatant, uint32 sequenceIndex, FightSequenceType type) const { - if (combatant->sequences.size() < sequenceIndex) - return; - - switch (type) { - default: - break; - - case kFightSequenceType0: - if (combatant->sequenceIndex) - return; - - combatant->sequence = combatant->sequences[sequenceIndex]; - combatant->sequenceIndex = sequenceIndex; - draw(combatant); - break; - - case kFightSequenceType1: - combatant->sequence = combatant->sequences[sequenceIndex]; - combatant->sequenceIndex = sequenceIndex; - combatant->sequenceIndex2 = 0; - draw(combatant); - break; - - case kFightSequenceType2: - combatant->sequenceIndex2 = sequenceIndex; - break; - } -} - -void Fight::draw(Fighter *combatant) const { - getScenes()->removeAndRedraw(&combatant->frame, false); - - combatant->frameIndex = 0; - combatant->field_24 = 0; -} - ////////////////////////////////////////////////////////////////////////// // Loading ////////////////////////////////////////////////////////////////////////// - void Fight::loadData(FightType type) { if (!_data) error("Fight::loadData - invalid data!"); @@ -396,41 +325,44 @@ void Fight::loadData(FightType type) { break; case kFightMilos: - loadMilosPlayer(); - loadMilosOpponent(); + _data->player = new FighterPlayerMilos(_engine); + _data->opponent = new FighterOpponentMilos(_engine); break; case kFightAnna: - loadAnnaPlayer(); - loadAnnaOpponent(); + _data->player = new FighterPlayerAnna(_engine); + _data->opponent = new FighterOpponentAnna(_engine); break; case kFightIvo: - loadIvoPlayer(); - loadIvoOpponent(); + _data->player = new FighterPlayerIvo(_engine); + _data->opponent = new FighterOpponentIvo(_engine); break; case kFightSalko: - loadSalkoPlayer(); - loadSalkoOpponent(); + _data->player = new FighterPlayerSalko(_engine); + _data->opponent = new FighterOpponentSalko(_engine); break; case kFightVesna: - loadVesnaPlayer(); - loadVesnaOpponent(); + _data->player = new FighterPlayerVesna(_engine); + _data->opponent = new FighterOpponentVesna(_engine); break; } if (!_data->player || !_data->opponent) error("Fight::loadData - error loading fight data (type=%d)", type); + // Setup opponent pointers + setOpponents(); + ////////////////////////////////////////////////////////////////////////// // Start running the fight - _data->isRunning = true; + _data->isFightRunning = true; if (_state < 5) { - setSequenceAndDraw(_data->player, 0, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); + _data->player->setSequenceAndDraw(0, Fighter::kFightSequenceType0); + _data->opponent->setSequenceAndDraw(0, Fighter::kFightSequenceType0); goto end_load; } @@ -439,22 +371,22 @@ void Fight::loadData(FightType type) { break; case kFightMilos: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 4, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 0, kFightSequenceType0); + _data->opponent->setCountdown(1); + _data->player->setSequenceAndDraw(4, Fighter::kFightSequenceType0); + _data->opponent->setSequenceAndDraw(0, Fighter::kFightSequenceType0); break; case kFightIvo: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 3, kFightSequenceType0); - setSequenceAndDraw(_data->opponent, 6, kFightSequenceType0); + _data->opponent->setCountdown(1); + _data->player->setSequenceAndDraw(3, Fighter::kFightSequenceType0); + _data->opponent->setSequenceAndDraw(6, Fighter::kFightSequenceType0); break; case kFightVesna: - _data->opponent->countdown = 1; - setSequenceAndDraw(_data->player, 0, kFightSequenceType0); - setSequenceAndDraw(_data->player, 3, kFightSequenceType2); - setSequenceAndDraw(_data->opponent, 5, kFightSequenceType0); + _data->opponent->setCountdown(1); + _data->player->setSequenceAndDraw(0, Fighter::kFightSequenceType0); + _data->player->setSequenceAndDraw(3, Fighter::kFightSequenceType2); + _data->opponent->setSequenceAndDraw(5, Fighter::kFightSequenceType0); break; } @@ -464,1120 +396,12 @@ end_load: SET_EVENT_HANDLERS(Fight, this); } -////////////////////////////////////////////////////////////////////////// -// Shared -////////////////////////////////////////////////////////////////////////// -void Fight::processFighter(Fighter *fighter) { - if (!_data) - error("Fight::processFighter - invalid data!"); - - if (!fighter->sequence) { - if (fighter->frame) { - getScenes()->removeFromQueue(fighter->frame); - getScenes()->setCoordinates(fighter->frame); - } - SAFE_DELETE(fighter->frame); - return; - } - - if (fighter->sequence->count() <= fighter->frameIndex) { - switch(fighter->action) { - default: - break; - - case kFightAction101: - setSequenceAndDraw(fighter, fighter->sequenceIndex2, kFightSequenceType1); - fighter->sequenceIndex2 = 0; - break; - - case kFightActionResetFrame: - fighter->frameIndex = 0; - break; - - case kFightAction103: - setSequenceAndDraw(fighter, 0, kFightSequenceType1); - CALL_FUNCTION1(fighter, handleAction, kFightAction101); - setSequenceAndDraw(fighter->opponent, 0, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction101); - CALL_FUNCTION0(fighter->opponent, update); - break; - - case kFightActionWin: - bailout(kFightEndWin); - break; - - case kFightActionLost: - bailout(kFightEndLost); - break; - } - } - - if (_data->isRunning) { - - // Get the current sequence frame - SequenceFrame *frame = new SequenceFrame(fighter->sequence, (uint16)fighter->frameIndex); - frame->getInfo()->location = 1; - - if (fighter->frame == frame) { - delete frame; - return; - } - - getSound()->playFightSound(frame->getInfo()->soundAction, frame->getInfo()->field_31); - - // Add current frame to queue and advance - getScenes()->addToQueue(frame); - fighter->frameIndex++; - - if (fighter->frame) { - getScenes()->removeFromQueue(fighter->frame); - - if (!frame->getInfo()->field_2E) - getScenes()->setCoordinates(fighter->frame); - } - - // Replace by new frame - delete fighter->frame; - fighter->frame = frame; - } -} - -void Fight::handleAction(Fighter *fighter, FightAction action) { - switch (action) { - default: - return; - - case kFightAction101: - break; - - case kFightActionResetFrame: - fighter->countdown--; - break; - - case kFightAction103: - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - - case kFightActionWin: - _endType = kFightEndWin; - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - - case kFightActionLost: - _endType = kFightEndLost; - CALL_FUNCTION1(fighter->opponent, handleAction, kFightActionResetFrame); - break; - } - - // Update action - fighter->action = action; -} - -bool Fight::canInteract(Fighter const *fighter, FightAction /*= (FightAction)0*/ ) { - return (fighter->action == kFightAction101 && !fighter->sequenceIndex); -} - -void Fight::update(Fighter *fighter) { - - processFighter(fighter); - - if (fighter->frame) - fighter->frame->getInfo()->location = (fighter->action == kFightActionResetFrame ? 2 : 0); -} - -void Fight::updateOpponent(Fighter *fighter) { - - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - processFighter(opponent); - - if (opponent->field_38 && !opponent->sequenceIndex) - opponent->field_38--; - - if (fighter->frame) - fighter->frame->getInfo()->location = 1; -} - -////////////////////////////////////////////////////////////////////////// -// Milos -////////////////////////////////////////////////////////////////////////// - -void Fight::loadMilosPlayer() { - REGISTER_PLAYER_FUNCTIONS(Milos) - - _data->player->sequences.push_back(loadSequence("2001cr.seq")); - _data->player->sequences.push_back(loadSequence("2001cdl.seq")); - _data->player->sequences.push_back(loadSequence("2001cdr.seq")); - _data->player->sequences.push_back(loadSequence("2001cdm.seq")); - _data->player->sequences.push_back(loadSequence("2001csgr.seq")); - _data->player->sequences.push_back(loadSequence("2001csgl.seq")); - _data->player->sequences.push_back(loadSequence("2001dbk.seq")); -} - -void Fight::loadMilosOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Milos) - - _data->opponent->sequences.push_back(loadSequence("2001or.seq")); - _data->opponent->sequences.push_back(loadSequence("2001oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2001oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2001okl.seq")); - _data->opponent->sequences.push_back(loadSequence("2001okm.seq")); - _data->opponent->sequences.push_back(loadSequence("2001dbk.seq")); - _data->opponent->sequences.push_back(loadSequence("2001wbk.seq")); - - getSound()->playSound(kEntityTables0, "MUS027", SoundManager::kFlagDefault); - - _data->opponent->field_38 = 35; -} - -void Fight::handleActionMilos(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 6, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 3, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 6, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction128: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4) || fighter->opponent->sequenceIndex != 1) { - switch (fighter->opponent->sequenceIndex) { - default: - setSequenceAndDraw(fighter, rnd(3) + 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - } - } else { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - CALL_FUNCTION0(fighter, update); - } - break; - } -} - -void Fight::updateMilos(Fighter *fighter) { - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - // Draw sequences - if (fighter->opponent->countdown <= 0) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); - - getSound()->removeFromQueue(kEntityTables0); - getSound()->playSound(kEntityTrain, "MUS029", SoundManager::kFlagDefault); - - CALL_FUNCTION1(fighter, handleAction, kFightActionWin); - } - - if (fighter->sequenceIndex == 4) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction4); - _endType = kFightEndLost; - } - } - - update(fighter); -} - -bool Fight::canInteractMilos(Fighter const *fighter, FightAction action) { - if (!_data) - error("Fight::canInteractMilos - invalid data!"); - - if (action != kFightAction128 - || _data->player->sequenceIndex != 1 - || !fighter->frame - || CHECK_SEQUENCE2(fighter, 4) - || fighter->opponent->sequenceIndex != 1) { - return canInteract(fighter); - } - - _engine->getCursor()->setStyle(kCursorHand); - - return true; -} - -void Fight::handleOpponentActionMilos(Fighter *fighter, FightAction action) { - if (action == kFightAction4) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - } else { - if (action != kFightAction131) - handleAction(fighter, action); - } -} - -void Fight::updateOpponentMilos(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType1); - break; - - case 3: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } else { - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - } - - // Update field_38 - if (opponent->opponent->field_34 < 5) - opponent->field_38 = 6 * (5 - opponent->opponent->field_34); - else - opponent->field_38 = 0; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - } - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Anna -////////////////////////////////////////////////////////////////////////// - -void Fight::loadAnnaPlayer() { - if (!_data) - error("Fight::loadAnnaPlayer - invalid data!"); - - // Special case: we are using some shared functions directly - _data->player->handleAction = new Common::Functor2Mem(this, &Fight::handleActionAnna); - _data->player->update = new Common::Functor1Mem(this, &Fight::update); - _data->player->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); - - _data->player->sequences.push_back(loadSequence("2002cr.seq")); - _data->player->sequences.push_back(loadSequence("2002cdl.seq")); - _data->player->sequences.push_back(loadSequence("2002cdr.seq")); - _data->player->sequences.push_back(loadSequence("2002cdm.seq")); - _data->player->sequences.push_back(loadSequence("2002lbk.seq")); -} - -void Fight::loadAnnaOpponent() { - if (!_data) - error("Fight::loadAnnaOpponent - invalid data!"); - - // Special case: we are using some shared functions directly - _data->opponent->handleAction = new Common::Functor2Mem(this, &Fight::handleAction); - _data->opponent->update = new Common::Functor1Mem(this, &Fight::updateOpponentAnna); - _data->opponent->canInteract = new Common::Functor2Mem(this, &Fight::canInteract); - - _data->opponent->sequences.push_back(loadSequence("2002or.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2002oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okml.seq")); - _data->opponent->sequences.push_back(loadSequence("2002okm.seq")); - - getSound()->playSound(kEntityTables0, "MUS030", SoundManager::kFlagDefault); - - _data->opponent->field_38 = 30; -} - -void Fight::handleActionAnna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if ((fighter->sequenceIndex != 1 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction3: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 1) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 4, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 6, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction128: - switch (fighter->opponent->sequenceIndex) { - default: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 3, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - break; - } - - if (fighter->field_34 > 4) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - } -} - -void Fight::updateOpponentAnna(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(6)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 5: - setSequenceAndDraw(opponent, 3, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = (int32)rnd(15); - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 3) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - } - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Ivo -////////////////////////////////////////////////////////////////////////// - -void Fight::loadIvoPlayer() { - REGISTER_PLAYER_FUNCTIONS(Ivo) - - _data->player->sequences.push_back(loadSequence("2003cr.seq")); - _data->player->sequences.push_back(loadSequence("2003car.seq")); - _data->player->sequences.push_back(loadSequence("2003cal.seq")); - _data->player->sequences.push_back(loadSequence("2003cdr.seq")); - _data->player->sequences.push_back(loadSequence("2003cdm.seq")); - _data->player->sequences.push_back(loadSequence("2003chr.seq")); - _data->player->sequences.push_back(loadSequence("2003chl.seq")); - _data->player->sequences.push_back(loadSequence("2003ckr.seq")); - _data->player->sequences.push_back(loadSequence("2003lbk.seq")); - _data->player->sequences.push_back(loadSequence("2003fbk.seq")); - - _data->player->countdown = 5; -} - -void Fight::loadIvoOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Ivo) - - _data->opponent->sequences.push_back(loadSequence("2003or.seq")); - _data->opponent->sequences.push_back(loadSequence("2003oal.seq")); - _data->opponent->sequences.push_back(loadSequence("2003oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2003odm.seq")); - _data->opponent->sequences.push_back(loadSequence("2003okl.seq")); - _data->opponent->sequences.push_back(loadSequence("2003okj.seq")); - _data->opponent->sequences.push_back(loadSequence("blank.seq")); - _data->opponent->sequences.push_back(loadSequence("csdr.seq")); - _data->opponent->sequences.push_back(loadSequence("2003l.seq")); - - getSound()->playSound(kEntityTables0, "MUS032", SoundManager::kFlagDefault); - - _data->opponent->countdown = 5; - _data->opponent->field_38 = 15; -} - -void Fight::handleActionIvo(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1 || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction2: - if ((fighter->sequenceIndex != 2 && fighter->sequenceIndex != 3) || CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - switch (fighter->opponent->sequenceIndex) { - default: - case 1: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - break; - - case kFightAction129: - setSequenceAndDraw(fighter, (fighter->opponent->countdown > 1) ? 4 : 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); - break; - - case kFightAction130: - setSequenceAndDraw(fighter, 3, fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); - break; - } -} - -void Fight::updateIvo(Fighter *fighter) { - - if ((fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) && !fighter->frameIndex) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction131); - - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - // Draw sequences - if (fighter->opponent->countdown <= 0) { - setSequenceAndDraw(fighter, 9, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, 8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); - - CALL_FUNCTION1(fighter, handleAction, kFightActionWin); - return; - } - - if (fighter->sequenceIndex == 3 || fighter->sequenceIndex == 4) - CALL_FUNCTION1(fighter->opponent, handleAction, (FightAction)fighter->sequenceIndex); - } - - update(fighter); -} - -bool Fight::canInteractIvo(Fighter const *fighter, FightAction action) { - if (action == kFightAction129 || action == kFightAction130) - return (fighter->sequenceIndex >= 8); - - return canInteract(fighter); -} - -void Fight::handleOpponentActionIvo(Fighter *fighter, FightAction action) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - switch (action) { - default: - handleAction(fighter, action); - break; - - case kFightAction3: - if ((opponent->sequenceIndex != 1 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 6, kFightSequenceType1); - CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); - } - break; - - case kFightAction4: - if ((opponent->sequenceIndex != 2 && opponent->sequenceIndex != 3) || CHECK_SEQUENCE2(opponent, 4)) { - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 5, kFightSequenceType1); - CALL_FUNCTION1(opponent->opponent, handleAction, kFightAction103); - } - break; - - case kFightAction131: - if (opponent->sequenceIndex) - break; - - if (rnd(100) <= (unsigned int)(opponent->countdown > 2 ? 60 : 75)) { - setSequenceAndDraw(opponent, 3 , kFightSequenceType1); - if (opponent->opponent->sequenceIndex == 4) - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - } - break; - } -} - -void Fight::updateOpponentIvo(Fighter *fighter) { - // This is an opponent struct! - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 >= 2) { - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 3: - setSequenceAndDraw(opponent, 0, kFightSequenceType2); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 0, kFightSequenceType1); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = 3 * opponent->countdown + (int32)rnd(10); - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - - if (opponent->opponent->countdown <= 0) { - setSequenceAndDraw(opponent, 7, kFightSequenceType1); - setSequenceAndDraw(opponent->opponent, 8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); - - CALL_FUNCTION1(opponent->opponent, handleAction, kFightActionWin); - - return; - } - - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Salko -////////////////////////////////////////////////////////////////////////// - -void Fight::loadSalkoPlayer() { - REGISTER_PLAYER_FUNCTIONS(Salko) - - _data->player->sequences.push_back(loadSequence("2004cr.seq")); - _data->player->sequences.push_back(loadSequence("2004cdr.seq")); - _data->player->sequences.push_back(loadSequence("2004chj.seq")); - _data->player->sequences.push_back(loadSequence("2004bk.seq")); - - _data->player->countdown = 2; -} - -void Fight::loadSalkoOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Salko) - - _data->opponent->sequences.push_back(loadSequence("2004or.seq")); - _data->opponent->sequences.push_back(loadSequence("2004oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2004oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2004okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2004ohm.seq")); - _data->opponent->sequences.push_back(loadSequence("blank.seq")); - - getSound()->playSound(kEntityTables0, "MUS035", SoundManager::kFlagDefault); - - _data->opponent->countdown = 3; - _data->opponent->field_38 = 30; -} - -void Fight::handleActionSalko(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - case kFightAction2: - if (fighter->sequenceIndex != 1 && CHECK_SEQUENCE2(fighter, 4)) { - fighter->field_34 = 0; - - setSequenceAndDraw(fighter, 3, kFightSequenceType1); - setSequenceAndDraw(fighter->opponent, (action == kFightAction1 ? 3 : 4), kFightSequenceType1); - - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - - if (action == kFightAction2) - fighter->countdown= 0; - - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction5: - if (fighter->sequenceIndex != 3) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - setSequenceAndDraw(fighter, 1, kFightSequenceType0); - fighter->field_34 = 0; - break; - - case kFightAction131: - setSequenceAndDraw(fighter, 2, (fighter->sequenceIndex ? kFightSequenceType2 : kFightSequenceType0)); - break; - } -} - -void Fight::updateSalko(Fighter *fighter) { - update(fighter); - - // The original doesn't check for currentSequence2 != NULL (might not happen when everything is working properly, but crashes with our current implementation) - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - if (fighter->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - - return; - } - - if (fighter->sequenceIndex == 2) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction2); - } -} - -bool Fight::canInteractSalko(Fighter const *fighter, FightAction action) { - if (action == kFightAction131) { - if (fighter->sequenceIndex == 1) { - if (fighter->opponent->countdown <= 0) - _engine->getCursor()->setStyle(kCursorHand); - - return true; - } - - return false; - } - - return canInteract(fighter); -} - -void Fight::handleOpponentActionSalko(Fighter *fighter, FightAction action) { - if (action == kFightAction2) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - } else { - handleAction(fighter, action); - } -} - -void Fight::updateOpponentSalko(Fighter *fighter) { - // This is an opponent struct - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - switch (rnd(5)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 2: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 3: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - - // Update field_38 - opponent->field_38 = 4 * opponent->countdown; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndLost); - - // Stop processing - return; - } - - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - } - - updateOpponent(opponent); -} - -////////////////////////////////////////////////////////////////////////// -// Vesna -////////////////////////////////////////////////////////////////////////// - -void Fight::loadVesnaPlayer() { - REGISTER_PLAYER_FUNCTIONS(Vesna) - - _data->player->sequences.push_back(loadSequence("2005cr.seq")); - _data->player->sequences.push_back(loadSequence("2005cdr.seq")); - _data->player->sequences.push_back(loadSequence("2005cbr.seq")); - _data->player->sequences.push_back(loadSequence("2005bk.seq")); - _data->player->sequences.push_back(loadSequence("2005cdm1.seq")); - _data->player->sequences.push_back(loadSequence("2005chl.seq")); -} - -void Fight::loadVesnaOpponent() { - REGISTER_OPPONENT_FUNCTIONS(Vesna) - - _data->opponent->sequences.push_back(loadSequence("2005or.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oam.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oar.seq")); - _data->opponent->sequences.push_back(loadSequence("2005okml.seq")); - _data->opponent->sequences.push_back(loadSequence("2005okr.seq")); - _data->opponent->sequences.push_back(loadSequence("2005odm1.seq")); - _data->opponent->sequences.push_back(loadSequence("2005csbm.seq")); - _data->opponent->sequences.push_back(loadSequence("2005oam4.seq")); - - getSound()->playSound(kEntityTables0, "MUS038", SoundManager::kFlagDefault); - - _data->opponent->countdown = 4; - _data->opponent->field_38 = 30; -} - -void Fight::handleActionVesna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - return; - - case kFightAction1: - if (fighter->sequenceIndex != 1) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction2: - if (fighter->sequenceIndex != 2) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } else { - fighter->field_34++; - } - break; - - case kFightAction5: - if (fighter->sequenceIndex != 3) { - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - CALL_FUNCTION0(fighter, update); - } - break; - - case kFightAction128: - if (fighter->sequenceIndex == 1 && fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { - setSequenceAndDraw(fighter, 5, kFightSequenceType1); - } else { - setSequenceAndDraw(fighter, (fighter->opponent->sequenceIndex == 5) ? 3 : 1, kFightSequenceType0); - } - break; - - case kFightAction132: - setSequenceAndDraw(fighter, 2, kFightSequenceType0); - break; - } - - if (fighter->field_34 > 10) { - setSequenceAndDraw(fighter->opponent, 5, kFightSequenceType2); - fighter->opponent->countdown = 1; - fighter->field_34 = 0; - } -} - -void Fight::updateVesna(Fighter *fighter) { - if (fighter->frame && CHECK_SEQUENCE2(fighter, 2)) { - - if (fighter->sequenceIndex == 3) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction3); - - if (fighter->opponent->countdown <= 0) { - getSound()->removeFromQueue(kEntityTables0); - bailout(kFightEndWin); - return; - } - - if (fighter->sequenceIndex == 5) - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction5); - } - - update(fighter); -} - -bool Fight::canInteractVesna(Fighter const *fighter, FightAction action) { - if (action != kFightAction128) - return canInteract(fighter); - - if (fighter->sequenceIndex != 1) { - - if (fighter->opponent->sequenceIndex == 5) { - _engine->getCursor()->setStyle(kCursorDown); - return true; - } - - return canInteract(fighter); - } - - if (fighter->opponent->sequenceIndex == 1 && CHECK_SEQUENCE2(fighter, 4)) { - _engine->getCursor()->setStyle(kCursorPunchLeft); - return true; - } - - return false; -} - -void Fight::handleOpponentActionVesna(Fighter *fighter, FightAction action) { - switch (action) { - default: - handleAction(fighter, action); - break; - - case kFightAction3: - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - break; - - case kFightAction5: - setSequenceAndDraw(fighter, 7, kFightSequenceType1); - CALL_FUNCTION1(fighter->opponent, handleAction, kFightAction103); - if (fighter->countdown <= 1) - fighter->countdown = 1; - break; - - case kFightAction131: - break; - } -} - -void Fight::updateOpponentVesna(Fighter *fighter) { - // This is an opponent struct - Opponent *opponent = (Opponent *)fighter; - - if (!opponent->field_38 && CALL_FUNCTION1(opponent, canInteract, kFightAction1) && !opponent->sequenceIndex2) { - - if (opponent->opponent->field_34 == 1) { - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - } else { - switch (rnd(6)) { - default: - break; - - case 0: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - break; - - case 1: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - - case 2: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - break; - - case 3: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 4: - setSequenceAndDraw(opponent, 1, kFightSequenceType0); - setSequenceAndDraw(opponent, 2, kFightSequenceType2); - break; - - case 5: - setSequenceAndDraw(opponent, 2, kFightSequenceType0); - setSequenceAndDraw(opponent, 1, kFightSequenceType2); - break; - } - } - - // Update field_38 - opponent->field_38 = 4 * opponent->countdown; - } - - if (opponent->frame && CHECK_SEQUENCE2(opponent, 2)) { - if (opponent->sequenceIndex == 1 || opponent->sequenceIndex == 2 || opponent->sequenceIndex == 5) - CALL_FUNCTION1(opponent->opponent, handleAction, (FightAction)opponent->sequenceIndex); - - if (opponent->opponent->countdown <= 0) { - - switch (opponent->sequenceIndex) { - default: - break; - - case 1: - setSequenceAndDraw(opponent, 3, kFightSequenceType1); - break; - - case 2: - setSequenceAndDraw(opponent, 4, kFightSequenceType1); - break; - - case 5: - setSequenceAndDraw(opponent, 6, kFightSequenceType1); - break; - } - - setSequenceAndDraw(opponent->opponent, 4, kFightSequenceType1); - - CALL_FUNCTION1(opponent, handleAction, kFightActionLost); - CALL_FUNCTION0(opponent->opponent, update); - CALL_FUNCTION0(opponent, update); - - getSound()->removeFromQueue(kEntityTables0); - - // Stop processing - return; - } - } +void Fight::setOpponents() { + _data->player->setOpponent(_data->opponent); + _data->opponent->setOpponent(_data->player); - updateOpponent(opponent); + _data->player->setFight(this); + _data->opponent->setFight(this); } } // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fight.h b/engines/lastexpress/fight/fight.h index a33cc93a29..fffb520789 100644 --- a/engines/lastexpress/fight/fight.h +++ b/engines/lastexpress/fight/fight.h @@ -57,16 +57,14 @@ #include "lastexpress/eventhandler.h" -#include "common/array.h" - namespace LastExpress { class LastExpressEngine; class Sequence; -class SequenceFrame; -////////////////////////////////////////////////////////////////////////// -// TODO : objectify! +class Fighter; +class Opponent; + class Fight : public EventHandler { public: enum FightEndType { @@ -83,82 +81,15 @@ public: void eventMouse(const Common::Event &ev); void eventTick(const Common::Event &ev); + // State + bool isRunning() { return _data->isFightRunning; } + void setRunningState(bool state) { _data->isFightRunning = state; } + void bailout(FightEndType type); void setStopped(); void resetState() { _state = 0; } + void setEndType(FightEndType endType) { _endType = endType; } private: - enum FightSequenceType { - kFightSequenceType0 = 0, - kFightSequenceType1 = 1, - kFightSequenceType2 = 2 - }; - - enum FightAction { - kFightAction1 = 1, - kFightAction2 = 2, - kFightAction3 = 3, - kFightAction4 = 4, - kFightAction5 = 5, - kFightAction101 = 101, - kFightActionResetFrame = 102, - kFightAction103 = 103, - kFightActionWin = 104, - kFightActionLost = 105, - kFightAction128 = 128, - kFightAction129 = 129, - kFightAction130 = 130, - kFightAction131 = 131, - kFightAction132 = 132 - }; - - struct Fighter { - Common::Functor2 *handleAction; - Common::Functor1 *update; - Common::Functor2 *canInteract; - Fighter *opponent; - Common::Array sequences; - uint32 sequenceIndex; - Sequence *sequence; - SequenceFrame *frame; - uint32 frameIndex; - uint32 field_24; - FightAction action; - uint32 sequenceIndex2; - int32 countdown; // countdown before loosing ? - uint32 field_34; - - Fighter() { - handleAction = NULL; - update = NULL; - canInteract = NULL; - - opponent = NULL; - - sequenceIndex = 0; - sequence = NULL; - frame = NULL; - frameIndex = 0; - - field_24 = 0; - - action = kFightAction101; - sequenceIndex2 = 0; - - countdown = 1; - - field_34 = 0; - } - }; - - // Opponent struct - struct Opponent : Fighter { - int32 field_38; - - Opponent() : Fighter() { - field_38 = 0; - } - }; - struct FightData { Fighter *player; Opponent *opponent; @@ -167,20 +98,10 @@ private: Sequence *sequences[20]; Common::String names[20]; - bool isRunning; - - FightData() { - player = new Fighter(); - opponent = new Opponent(); - - // Set opponents - player->opponent = opponent; - opponent->opponent = player; + bool isFightRunning; - index = 0; - - isRunning = false; - } + FightData(); + ~FightData(); }; LastExpressEngine *_engine; @@ -193,72 +114,10 @@ private: // Events void handleTick(const Common::Event &ev, bool unknown); - // State - void bailout(FightEndType type); - - - // Drawing - void setSequenceAndDraw(Fighter *fighter, uint32 sequenceIndex, FightSequenceType type) const; - void draw(Fighter *fighter) const; - - // Cleanup - void clearData(); - void clearSequences(Fighter *fighter) const; - - ////////////////////////////////////////////////////////////////////////// - // Loading + // Data void loadData(FightType type); - - // Shared - void processFighter(Fighter *fighter); - - // Default functions - void handleAction(Fighter *fighter, FightAction action); - void update(Fighter *fighter); - bool canInteract(Fighter const *fighter, FightAction = (FightAction)0); - void updateOpponent(Fighter *fighter); - - // Milos - void loadMilosPlayer(); - void loadMilosOpponent(); - void handleActionMilos(Fighter *fighter, FightAction action); - void updateMilos(Fighter *fighter); - bool canInteractMilos(Fighter const *fighter, FightAction action); - void handleOpponentActionMilos(Fighter *fighter, FightAction action); - void updateOpponentMilos(Fighter *fighter); - - // Anna - void loadAnnaPlayer(); - void loadAnnaOpponent(); - void handleActionAnna(Fighter *fighter, FightAction action); - void updateOpponentAnna(Fighter *fighter); - - // Ivo - void loadIvoPlayer(); - void loadIvoOpponent(); - void handleActionIvo(Fighter *fighter, FightAction action); - void updateIvo(Fighter *fighter); - bool canInteractIvo(Fighter const *fighter, FightAction action); - void handleOpponentActionIvo(Fighter *fighter, FightAction action); - void updateOpponentIvo(Fighter *fighter); - - // Salko - void loadSalkoPlayer(); - void loadSalkoOpponent(); - void handleActionSalko(Fighter *fighter, FightAction action); - void updateSalko(Fighter *fighter); - bool canInteractSalko(Fighter const *fighter, FightAction action); - void handleOpponentActionSalko(Fighter *fighter, FightAction action); - void updateOpponentSalko(Fighter *fighter); - - // Vesna - void loadVesnaPlayer(); - void loadVesnaOpponent(); - void handleActionVesna(Fighter *fighter, FightAction action); - void updateVesna(Fighter *fighter); - bool canInteractVesna(Fighter const *fighter, FightAction action); - void handleOpponentActionVesna(Fighter *fighter, FightAction action); - void updateOpponentVesna(Fighter *fighter); + void clearData(); + void setOpponents(); }; } // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter.cpp b/engines/lastexpress/fight/fighter.cpp new file mode 100644 index 0000000000..fcd69183fb --- /dev/null +++ b/engines/lastexpress/fight/fighter.cpp @@ -0,0 +1,248 @@ +/* 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 "lastexpress/fight/fighter.h" + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/scenes.h" +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" + +namespace LastExpress { + +Fighter::Fighter(LastExpressEngine *engine) : _engine(engine) { + _opponent = NULL; + _fight = NULL; + + _sequenceIndex = 0; + _sequence = NULL; + _frame = NULL; + _frameIndex = 0; + + _field_24 = 0; + + _action = kFightAction101; + _sequenceIndex2 = 0; + + _countdown = 1; + + _field_34 = 0; +} + +Fighter::~Fighter() { + clearSequences(); +} + +////////////////////////////////////////////////////////////////////////// +// Cleanup +////////////////////////////////////////////////////////////////////////// +void Fighter::clearSequences() { + // The original game resets the function pointers to default values, just before deleting the struct + + getScenes()->removeAndRedraw(&_frame, false); + + // Free sequences + for (int i = 0; i < (int)_sequences.size(); i++) + SAFE_DELETE(_sequences[i]); +} + +////////////////////////////////////////////////////////////////////////// +// Drawing +////////////////////////////////////////////////////////////////////////// +void Fighter::setSequenceAndDraw(uint32 sequenceIndex, FightSequenceType type) { + if (_sequences.size() < sequenceIndex) + return; + + switch (type) { + default: + break; + + case kFightSequenceType0: + if (_sequenceIndex) + return; + + _sequence = _sequences[sequenceIndex]; + _sequenceIndex = sequenceIndex; + draw(); + break; + + case kFightSequenceType1: + _sequence = _sequences[sequenceIndex]; + _sequenceIndex = sequenceIndex; + _sequenceIndex2 = 0; + draw(); + break; + + case kFightSequenceType2: + _sequenceIndex2 = sequenceIndex; + break; + } +} + +void Fighter::draw() { + getScenes()->removeAndRedraw(&_frame, false); + + _frameIndex = 0; + _field_24 = 0; +} + +////////////////////////////////////////////////////////////////////////// +// Processing +////////////////////////////////////////////////////////////////////////// +void Fighter::process() { + if (!_sequence) { + if (_frame) { + getScenes()->removeFromQueue(_frame); + getScenes()->setCoordinates(_frame); + } + SAFE_DELETE(_frame); + return; + } + + if (_sequence->count() <= _frameIndex) { + switch(_action) { + default: + break; + + case kFightAction101: + setSequenceAndDraw(_sequenceIndex2, kFightSequenceType1); + _sequenceIndex2 = 0; + break; + + case kFightActionResetFrame: + _frameIndex = 0; + break; + + case kFightAction103: + setSequenceAndDraw(0, kFightSequenceType1); + handleAction(kFightAction101); + _opponent->setSequenceAndDraw(0, kFightSequenceType1); + _opponent->handleAction(kFightAction101); + _opponent->update(); + break; + + case kFightActionWin: + _fight->bailout(Fight::kFightEndWin); + break; + + case kFightActionLost: + _fight->bailout(Fight::kFightEndLost); + break; + } + } + + if (_fight->isRunning()) { + + // Get the current sequence frame + SequenceFrame *frame = new SequenceFrame(_sequence, (uint16)_frameIndex); + frame->getInfo()->location = 1; + + if (_frame == frame) { + delete frame; + return; + } + + getSound()->playFightSound(frame->getInfo()->soundAction, frame->getInfo()->field_31); + + // Add current frame to queue and advance + getScenes()->addToQueue(frame); + _frameIndex++; + + if (_frame) { + getScenes()->removeFromQueue(_frame); + + if (!frame->getInfo()->field_2E) + getScenes()->setCoordinates(_frame); + } + + // Replace by new frame + delete _frame; + _frame = frame; + } +} + +////////////////////////////////////////////////////////////////////////// +// Default actions +////////////////////////////////////////////////////////////////////////// +void Fighter::handleAction(FightAction action) { + switch (action) { + default: + return; + + case kFightAction101: + break; + + case kFightActionResetFrame: + _countdown--; + break; + + case kFightAction103: + _opponent->handleAction(kFightActionResetFrame); + break; + + case kFightActionWin: + _fight->setEndType(Fight::kFightEndWin); + _opponent->handleAction(kFightActionResetFrame); + break; + + case kFightActionLost: + _fight->setEndType(Fight::kFightEndLost); + _opponent->handleAction(kFightActionResetFrame); + break; + } + + // Update action + _action = action; +} + +bool Fighter::canInteract(FightAction /*action = kFightActionNone*/ ) { + return (_action == kFightAction101 && !_sequenceIndex); +} + +void Fighter::update() { + process(); + + if (_frame) + _frame->getInfo()->location = (_action == kFightActionResetFrame ? 2 : 0); +} + +void Opponent::update() { + process(); + + if (_field_38 && !_sequenceIndex) + _field_38--; + + if (_frame) + _frame->getInfo()->location = 1; +} + +////////////////////////////////////////////////////////////////////////// +// Helpers +////////////////////////////////////////////////////////////////////////// +bool Fighter::checkFrame(uint32 val) { + return (_frame->getInfo()->field_33 & val); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter.h b/engines/lastexpress/fight/fighter.h new file mode 100644 index 0000000000..e37fe49d86 --- /dev/null +++ b/engines/lastexpress/fight/fighter.h @@ -0,0 +1,123 @@ +/* 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 LASTEXPRESS_FIGHTER_H +#define LASTEXPRESS_FIGHTER_H + +#include "lastexpress/fight/fight.h" + +#include "common/array.h" + +namespace LastExpress { + +class Fight; +class Sequence; +class SequenceFrame; + +class Fighter { +public: + enum FightAction { + kFightActionNone = 0, + kFightAction1 = 1, + kFightAction2 = 2, + kFightAction3 = 3, + kFightAction4 = 4, + kFightAction5 = 5, + kFightAction101 = 101, + kFightActionResetFrame = 102, + kFightAction103 = 103, + kFightActionWin = 104, + kFightActionLost = 105, + kFightAction128 = 128, + kFightAction129 = 129, + kFightAction130 = 130, + kFightAction131 = 131, + kFightAction132 = 132 + }; + + enum FightSequenceType { + kFightSequenceType0 = 0, + kFightSequenceType1 = 1, + kFightSequenceType2 = 2 + }; + + Fighter(LastExpressEngine *engine); + virtual ~Fighter(); + + // Default functions + virtual void handleAction(FightAction action); + virtual void update(); + virtual bool canInteract(FightAction action = kFightActionNone); + + // Drawing + void setSequenceAndDraw(uint32 sequenceIndex, FightSequenceType type); + + // Accessors + void setOpponent(Fighter *opponent) { _opponent = opponent; } + void setCountdown(int32 countdown) { _countdown = countdown; } + void setFight(Fight *fight) { _fight = fight; } + + int getCountdown() { return _countdown; } + uint32 getSequenceIndex() { return _sequenceIndex; } + uint32 getField34() { return _field_34; } + +protected: + LastExpressEngine *_engine; + Fight *_fight; + Fighter *_opponent; + Sequence *_sequence; + SequenceFrame *_frame; + uint32 _sequenceIndex; + Common::Array _sequences; + uint32 _frameIndex; + uint32 _field_24; + FightAction _action; + uint32 _sequenceIndex2; + int32 _countdown; // countdown before loosing ? + uint32 _field_34; + + // Drawing and processing + void draw(); + void process(); + + // Cleanup + void clearSequences(); + + // Helpers + bool checkFrame(uint32 val); +}; + +class Opponent : public Fighter { +public: + Opponent(LastExpressEngine *engine) : Fighter(engine) { + _field_38 = 0; + } + + virtual void update(); + +protected: + int32 _field_38; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_H diff --git a/engines/lastexpress/fight/fighter_anna.cpp b/engines/lastexpress/fight/fighter_anna.cpp new file mode 100644 index 0000000000..db2ab54c4b --- /dev/null +++ b/engines/lastexpress/fight/fighter_anna.cpp @@ -0,0 +1,186 @@ +/* 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 "lastexpress/fight/fighter_anna.h" + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// Player +////////////////////////////////////////////////////////////////////////// +FighterPlayerAnna::FighterPlayerAnna(LastExpressEngine *engine) : Fighter(engine) { + _sequences.push_back(loadSequence("2002cr.seq")); + _sequences.push_back(loadSequence("2002cdl.seq")); + _sequences.push_back(loadSequence("2002cdr.seq")); + _sequences.push_back(loadSequence("2002cdm.seq")); + _sequences.push_back(loadSequence("2002lbk.seq")); +} + +void FighterPlayerAnna::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + return; + + case kFightAction1: + if ((_sequenceIndex != 1 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(4, kFightSequenceType1); + _opponent->setSequenceAndDraw(4, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction2: + if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(4, kFightSequenceType1); + _opponent->setSequenceAndDraw(5, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction3: + if ((_sequenceIndex != 2 && _sequenceIndex != 1) || checkFrame(4)) { + setSequenceAndDraw(4, kFightSequenceType1); + _opponent->setSequenceAndDraw(6, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction128: + switch (_opponent->getSequenceIndex()) { + default: + setSequenceAndDraw(3, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(3, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(2, kFightSequenceType0); + break; + } + break; + } + + if (_field_34 > 4) { + getSound()->removeFromQueue(kEntityTables0); + _fight->bailout(Fight::kFightEndWin); + } +} + +////////////////////////////////////////////////////////////////////////// +// Opponent +////////////////////////////////////////////////////////////////////////// +FighterOpponentAnna::FighterOpponentAnna(LastExpressEngine *engine) : Opponent(engine) { + _sequences.push_back(loadSequence("2002or.seq")); + _sequences.push_back(loadSequence("2002oal.seq")); + _sequences.push_back(loadSequence("2002oam.seq")); + _sequences.push_back(loadSequence("2002oar.seq")); + _sequences.push_back(loadSequence("2002okr.seq")); + _sequences.push_back(loadSequence("2002okml.seq")); + _sequences.push_back(loadSequence("2002okm.seq")); + + getSound()->playSound(kEntityTables0, "MUS030", SoundManager::kFlagDefault); + + _field_38 = 30; +} + +void FighterOpponentAnna::update() { + if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) { + + if (_opponent->getField34() >= 2) { + switch (rnd(6)) { + default: + break; + + case 0: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(3, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(3, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 5: + setSequenceAndDraw(3, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + } + } + + // Update field_38 + _field_38 = (int32)rnd(15); + } + + if (_frame && checkFrame(2)) { + if (_sequenceIndex == 1 || _sequenceIndex == 2 || _sequenceIndex == 3) + _opponent->handleAction((FightAction)_sequenceIndex); + + if (_opponent->getCountdown() <= 0) { + getSound()->removeFromQueue(kEntityTables0); + handleAction(kFightActionLost); + } + } + + Fighter::update(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter_anna.h b/engines/lastexpress/fight/fighter_anna.h new file mode 100644 index 0000000000..abb6f9dc64 --- /dev/null +++ b/engines/lastexpress/fight/fighter_anna.h @@ -0,0 +1,48 @@ +/* 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 LASTEXPRESS_FIGHTER_ANNA_H +#define LASTEXPRESS_FIGHTER_ANNA_H + +#include "lastexpress/fight/fighter.h" + +namespace LastExpress { + +class LastExpressEngine; + +class FighterPlayerAnna : public Fighter { +public: + FighterPlayerAnna(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); +}; + +class FighterOpponentAnna : public Opponent { +public: + FighterOpponentAnna(LastExpressEngine *engine); + + virtual void update(); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_ANNA_H diff --git a/engines/lastexpress/fight/fighter_ivo.cpp b/engines/lastexpress/fight/fighter_ivo.cpp new file mode 100644 index 0000000000..423b6b4ce5 --- /dev/null +++ b/engines/lastexpress/fight/fighter_ivo.cpp @@ -0,0 +1,244 @@ +/* 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 "lastexpress/fight/fighter_ivo.h" + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// Player +////////////////////////////////////////////////////////////////////////// +FighterPlayerIvo::FighterPlayerIvo(LastExpressEngine *engine) : Fighter(engine) { + _sequences.push_back(loadSequence("2003cr.seq")); + _sequences.push_back(loadSequence("2003car.seq")); + _sequences.push_back(loadSequence("2003cal.seq")); + _sequences.push_back(loadSequence("2003cdr.seq")); + _sequences.push_back(loadSequence("2003cdm.seq")); + _sequences.push_back(loadSequence("2003chr.seq")); + _sequences.push_back(loadSequence("2003chl.seq")); + _sequences.push_back(loadSequence("2003ckr.seq")); + _sequences.push_back(loadSequence("2003lbk.seq")); + _sequences.push_back(loadSequence("2003fbk.seq")); + + _countdown = 5; +} + +void FighterPlayerIvo::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + return; + + case kFightAction1: + if (_sequenceIndex != 1 || checkFrame(4)) { + setSequenceAndDraw(7, kFightSequenceType1); + _opponent->setSequenceAndDraw(4, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } + break; + + case kFightAction2: + if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(7, kFightSequenceType1); + _opponent->setSequenceAndDraw(5, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } + break; + + case kFightAction128: + switch (_opponent->getSequenceIndex()) { + default: + case 1: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(2, kFightSequenceType0); + break; + } + break; + + case kFightAction129: + setSequenceAndDraw((_opponent->getCountdown() > 1) ? 4 : 3, _sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); + break; + + case kFightAction130: + setSequenceAndDraw(3, _sequenceIndex ? kFightSequenceType2 : kFightSequenceType0); + break; + } +} + +void FighterPlayerIvo::update() { + + if ((_sequenceIndex == 3 || _sequenceIndex == 4) && !_frameIndex) + _opponent->handleAction(kFightAction131); + + if (_frame && checkFrame(2)) { + + // Draw sequences + if (_opponent->getCountdown() <= 0) { + setSequenceAndDraw(9, kFightSequenceType1); + _opponent->setSequenceAndDraw(8, kFightSequenceType1); + getSound()->removeFromQueue(kEntityTables0); + + handleAction(kFightActionWin); + return; + } + + if (_sequenceIndex == 3 || _sequenceIndex == 4) + _opponent->handleAction((FightAction)_sequenceIndex); + } + + Fighter::update(); +} + +bool FighterPlayerIvo::canInteract(FightAction action) { + if (action == kFightAction129 || action == kFightAction130) + return (_sequenceIndex >= 8); + + return Fighter::canInteract(); +} + +////////////////////////////////////////////////////////////////////////// +// Opponent +////////////////////////////////////////////////////////////////////////// +FighterOpponentIvo::FighterOpponentIvo(LastExpressEngine *engine) : Opponent(engine) { + _sequences.push_back(loadSequence("2003or.seq")); + _sequences.push_back(loadSequence("2003oal.seq")); + _sequences.push_back(loadSequence("2003oar.seq")); + _sequences.push_back(loadSequence("2003odm.seq")); + _sequences.push_back(loadSequence("2003okl.seq")); + _sequences.push_back(loadSequence("2003okj.seq")); + _sequences.push_back(loadSequence("blank.seq")); + _sequences.push_back(loadSequence("csdr.seq")); + _sequences.push_back(loadSequence("2003l.seq")); + + getSound()->playSound(kEntityTables0, "MUS032", SoundManager::kFlagDefault); + + _countdown = 5; + _field_38 = 15; +} + +void FighterOpponentIvo::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + break; + + case kFightAction3: + if ((_sequenceIndex != 1 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(6, kFightSequenceType1); + _opponent->setSequenceAndDraw(6, kFightSequenceType1); + _opponent->handleAction(kFightAction103); + } + break; + + case kFightAction4: + if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(6, kFightSequenceType1); + _opponent->setSequenceAndDraw(5, kFightSequenceType1); + _opponent->handleAction(kFightAction103); + } + break; + + case kFightAction131: + if (_sequenceIndex) + break; + + if (rnd(100) <= (unsigned int)(_countdown > 2 ? 60 : 75)) { + setSequenceAndDraw(3 , kFightSequenceType1); + if (_opponent->getSequenceIndex() == 4) + setSequenceAndDraw(2, kFightSequenceType2); + } + break; + } +} + +void FighterOpponentIvo::update() { + if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) { + + if (_opponent->getField34() >= 2) { + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 3: + setSequenceAndDraw(0, kFightSequenceType2); + setSequenceAndDraw(1, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(0, kFightSequenceType1); + setSequenceAndDraw(1, kFightSequenceType2); + break; + } + } + + // Update field_38 + _field_38 = 3 * _countdown + (int32)rnd(10); + } + + if (_frame && checkFrame(2)) { + + if (_opponent->getCountdown() <= 0) { + setSequenceAndDraw(7, kFightSequenceType1); + _opponent->setSequenceAndDraw(8, kFightSequenceType1); + getSound()->removeFromQueue(kEntityTables0); + + _opponent->handleAction(kFightActionWin); + + return; + } + + if (_sequenceIndex == 1 || _sequenceIndex == 2) + _opponent->handleAction((FightAction)_sequenceIndex); + } + + Fighter::update(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter_ivo.h b/engines/lastexpress/fight/fighter_ivo.h new file mode 100644 index 0000000000..ca54fea904 --- /dev/null +++ b/engines/lastexpress/fight/fighter_ivo.h @@ -0,0 +1,51 @@ +/* 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 LASTEXPRESS_FIGHTER_IVO_H +#define LASTEXPRESS_FIGHTER_IVO_H + +#include "lastexpress/fight/fighter.h" + +namespace LastExpress { + +class LastExpressEngine; + +class FighterPlayerIvo : public Fighter { +public: + FighterPlayerIvo(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); + virtual bool canInteract(FightAction action = kFightActionNone); +}; + +class FighterOpponentIvo : public Opponent { +public: + FighterOpponentIvo(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_IVO_H diff --git a/engines/lastexpress/fight/fighter_milos.cpp b/engines/lastexpress/fight/fighter_milos.cpp new file mode 100644 index 0000000000..46e4bde7a6 --- /dev/null +++ b/engines/lastexpress/fight/fighter_milos.cpp @@ -0,0 +1,221 @@ +/* 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 "lastexpress/fight/fighter_milos.h" + +#include "lastexpress/data/cursor.h" +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// Player +////////////////////////////////////////////////////////////////////////// +FighterPlayerMilos::FighterPlayerMilos(LastExpressEngine *engine) : Fighter(engine) { + _sequences.push_back(loadSequence("2001cr.seq")); + _sequences.push_back(loadSequence("2001cdl.seq")); + _sequences.push_back(loadSequence("2001cdr.seq")); + _sequences.push_back(loadSequence("2001cdm.seq")); + _sequences.push_back(loadSequence("2001csgr.seq")); + _sequences.push_back(loadSequence("2001csgl.seq")); + _sequences.push_back(loadSequence("2001dbk.seq")); +} + +void FighterPlayerMilos::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + return; + + case kFightAction1: + if (_sequenceIndex != 1 || checkFrame(4)) { + setSequenceAndDraw(6, kFightSequenceType1); + _opponent->setSequenceAndDraw(3, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction2: + if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) { + setSequenceAndDraw(6, kFightSequenceType1); + _opponent->setSequenceAndDraw(4, kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction128: + if (_sequenceIndex != 1 || checkFrame(4) || _opponent->getSequenceIndex() != 1) { + switch (_opponent->getSequenceIndex()) { + default: + setSequenceAndDraw(rnd(3) + 1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(3, kFightSequenceType0); + break; + } + } else { + setSequenceAndDraw(4, kFightSequenceType1); + update(); + } + break; + } +} + +void FighterPlayerMilos::update() { + if (_frame && checkFrame(2)) { + + // Draw sequences + if (_opponent->getCountdown() <= 0) { + setSequenceAndDraw(5, kFightSequenceType1); + _opponent->setSequenceAndDraw(6, kFightSequenceType1); + + getSound()->removeFromQueue(kEntityTables0); + getSound()->playSound(kEntityTrain, "MUS029", SoundManager::kFlagDefault); + + handleAction(kFightActionWin); + } + + if (_sequenceIndex == 4) { + _opponent->handleAction(kFightAction4); + _fight->setEndType(Fight::kFightEndLost); + } + } + + Fighter::update(); +} + +bool FighterPlayerMilos::canInteract(FightAction action) { + if (action != kFightAction128 + || _sequenceIndex != 1 + || !_frame + || checkFrame(4) + || _opponent->getSequenceIndex() != 1) { + return Fighter::canInteract(); + } + + _engine->getCursor()->setStyle(kCursorHand); + + return true; +} + +////////////////////////////////////////////////////////////////////////// +// Opponent +////////////////////////////////////////////////////////////////////////// +FighterOpponentMilos::FighterOpponentMilos(LastExpressEngine *engine) : Opponent(engine) { + _sequences.push_back(loadSequence("2001or.seq")); + _sequences.push_back(loadSequence("2001oal.seq")); + _sequences.push_back(loadSequence("2001oam.seq")); + _sequences.push_back(loadSequence("2001okl.seq")); + _sequences.push_back(loadSequence("2001okm.seq")); + _sequences.push_back(loadSequence("2001dbk.seq")); + _sequences.push_back(loadSequence("2001wbk.seq")); + + getSound()->playSound(kEntityTables0, "MUS027", SoundManager::kFlagDefault); + + _field_38 = 35; +} + +void FighterOpponentMilos::handleAction(FightAction action) { + if (action == kFightAction4) { + setSequenceAndDraw(5, kFightSequenceType1); + _opponent->handleAction(kFightAction103); + } else { + if (action != kFightAction131) + Fighter::handleAction(action); + } +} + +void FighterOpponentMilos::update() { + if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) { + + if (_opponent->getField34() >= 2) { + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(2, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType1); + break; + + case 3: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(1, kFightSequenceType2); + break; + } + } else { + setSequenceAndDraw(2, kFightSequenceType0); + } + + // Update field_38 + if (_opponent->getField34() < 5) + _field_38 = 6 * (5 - _opponent->getField34()); + else + _field_38 = 0; + } + + if (_frame && checkFrame(2)) { + if (_sequenceIndex == 1 || _sequenceIndex == 2) + _opponent->handleAction((FightAction)_sequenceIndex); + + if (_opponent->getCountdown() <= 0) { + getSound()->removeFromQueue(kEntityTables0); + handleAction(kFightActionLost); + } + } + + Fighter::update(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter_milos.h b/engines/lastexpress/fight/fighter_milos.h new file mode 100644 index 0000000000..2126dd1838 --- /dev/null +++ b/engines/lastexpress/fight/fighter_milos.h @@ -0,0 +1,51 @@ +/* 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 LASTEXPRESS_FIGHTER_MILOS_H +#define LASTEXPRESS_FIGHTER_MILOS_H + +#include "lastexpress/fight/fighter.h" + +namespace LastExpress { + +class LastExpressEngine; + +class FighterPlayerMilos : public Fighter { +public: + FighterPlayerMilos(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); + virtual bool canInteract(FightAction action = kFightActionNone); +}; + +class FighterOpponentMilos : public Opponent { +public: + FighterOpponentMilos(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_MILOS_H diff --git a/engines/lastexpress/fight/fighter_salko.cpp b/engines/lastexpress/fight/fighter_salko.cpp new file mode 100644 index 0000000000..795dd41b93 --- /dev/null +++ b/engines/lastexpress/fight/fighter_salko.cpp @@ -0,0 +1,201 @@ +/* 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 "lastexpress/fight/fighter_salko.h" + +#include "lastexpress/data/cursor.h" +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// Player +////////////////////////////////////////////////////////////////////////// +FighterPlayerSalko::FighterPlayerSalko(LastExpressEngine *engine) : Fighter(engine) { + _sequences.push_back(loadSequence("2004cr.seq")); + _sequences.push_back(loadSequence("2004cdr.seq")); + _sequences.push_back(loadSequence("2004chj.seq")); + _sequences.push_back(loadSequence("2004bk.seq")); + + _countdown = 2; +} + +void FighterPlayerSalko::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + return; + + case kFightAction1: + case kFightAction2: + if (_sequenceIndex != 1 && checkFrame(4)) { + _field_34 = 0; + + setSequenceAndDraw(3, kFightSequenceType1); + _opponent->setSequenceAndDraw((action == kFightAction1 ? 3 : 4), kFightSequenceType1); + + _opponent->handleAction(kFightAction103); + + if (action == kFightAction2) + _countdown= 0; + + update(); + } else { + _field_34++; + } + break; + + case kFightAction5: + if (_sequenceIndex != 3) { + _opponent->handleAction(kFightAction103); + update(); + } + break; + + case kFightAction128: + setSequenceAndDraw(1, kFightSequenceType0); + _field_34 = 0; + break; + + case kFightAction131: + setSequenceAndDraw(2, (_sequenceIndex ? kFightSequenceType2 : kFightSequenceType0)); + break; + } +} + +void FighterPlayerSalko::update() { + Fighter::update(); + + // The original doesn't check for currentSequence2 != NULL (might not happen when everything is working properly, but crashes with our current implementation) + if (_frame && checkFrame(2)) { + + if (_opponent->getCountdown() <= 0) { + getSound()->removeFromQueue(kEntityTables0); + _fight->bailout(Fight::kFightEndWin); + + return; + } + + if (_sequenceIndex == 2) + _opponent->handleAction(kFightAction2); + } +} + +bool FighterPlayerSalko::canInteract(FightAction action) { + if (action == kFightAction131) { + if (_sequenceIndex == 1) { + if (_opponent->getCountdown() <= 0) + _engine->getCursor()->setStyle(kCursorHand); + + return true; + } + + return false; + } + + return Fighter::canInteract(); +} + +////////////////////////////////////////////////////////////////////////// +// Opponent +////////////////////////////////////////////////////////////////////////// +FighterOpponentSalko::FighterOpponentSalko(LastExpressEngine *engine) : Opponent(engine) { + _sequences.push_back(loadSequence("2004or.seq")); + _sequences.push_back(loadSequence("2004oam.seq")); + _sequences.push_back(loadSequence("2004oar.seq")); + _sequences.push_back(loadSequence("2004okr.seq")); + _sequences.push_back(loadSequence("2004ohm.seq")); + _sequences.push_back(loadSequence("blank.seq")); + + getSound()->playSound(kEntityTables0, "MUS035", SoundManager::kFlagDefault); + + _countdown = 3; + _field_38 = 30; +} + +void FighterOpponentSalko::handleAction(FightAction action) { + if (action == kFightAction2) { + setSequenceAndDraw(5, kFightSequenceType1); + _opponent->handleAction(kFightAction103); + } else { + Fighter::handleAction(action); + } +} + +void FighterOpponentSalko::update() { + if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) { + + switch (rnd(5)) { + default: + break; + + case 0: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(2, kFightSequenceType0); + break; + + case 2: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 3: + setSequenceAndDraw(2, kFightSequenceType0); + setSequenceAndDraw(1, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(1, kFightSequenceType2); + break; + } + + // Update field_38 + _field_38 = 4 * _countdown; + } + + if (_frame && checkFrame(2)) { + if (_opponent->getCountdown() <= 0) { + getSound()->removeFromQueue(kEntityTables0); + _fight->bailout(Fight::kFightEndLost); + + // Stop processing + return; + } + + if (_sequenceIndex == 1 || _sequenceIndex == 2) + _opponent->handleAction((FightAction)_sequenceIndex); + } + + Fighter::update(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter_salko.h b/engines/lastexpress/fight/fighter_salko.h new file mode 100644 index 0000000000..0a2a615867 --- /dev/null +++ b/engines/lastexpress/fight/fighter_salko.h @@ -0,0 +1,51 @@ +/* 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 LASTEXPRESS_FIGHTER_SALKO_H +#define LASTEXPRESS_FIGHTER_SALKO_H + +#include "lastexpress/fight/fighter.h" + +namespace LastExpress { + +class LastExpressEngine; + +class FighterPlayerSalko : public Fighter { +public: + FighterPlayerSalko(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); + virtual bool canInteract(FightAction action = kFightActionNone); +}; + +class FighterOpponentSalko : public Opponent { +public: + FighterOpponentSalko(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_SALKO_H diff --git a/engines/lastexpress/fight/fighter_vesna.cpp b/engines/lastexpress/fight/fighter_vesna.cpp new file mode 100644 index 0000000000..a2460106b0 --- /dev/null +++ b/engines/lastexpress/fight/fighter_vesna.cpp @@ -0,0 +1,264 @@ +/* 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 "lastexpress/fight/fighter_vesna.h" + +#include "lastexpress/data/cursor.h" +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// Player +////////////////////////////////////////////////////////////////////////// +FighterPlayerVesna::FighterPlayerVesna(LastExpressEngine *engine) : Fighter(engine) { + _sequences.push_back(loadSequence("2005cr.seq")); + _sequences.push_back(loadSequence("2005cdr.seq")); + _sequences.push_back(loadSequence("2005cbr.seq")); + _sequences.push_back(loadSequence("2005bk.seq")); + _sequences.push_back(loadSequence("2005cdm1.seq")); + _sequences.push_back(loadSequence("2005chl.seq")); +} + +void FighterPlayerVesna::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + return; + + case kFightAction1: + if (_sequenceIndex != 1) { + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction2: + if (_sequenceIndex != 2) { + _opponent->handleAction(kFightAction103); + update(); + } else { + _field_34++; + } + break; + + case kFightAction5: + if (_sequenceIndex != 3) { + _opponent->handleAction(kFightAction103); + update(); + } + break; + + case kFightAction128: + if (_sequenceIndex == 1 && _opponent->getSequenceIndex() == 1 && checkFrame(4)) { + setSequenceAndDraw(5, kFightSequenceType1); + } else { + setSequenceAndDraw((_opponent->getSequenceIndex() == 5) ? 3 : 1, kFightSequenceType0); + } + break; + + case kFightAction132: + setSequenceAndDraw(2, kFightSequenceType0); + break; + } + + if (_field_34 > 10) { + _opponent->setSequenceAndDraw(5, kFightSequenceType2); + _opponent->setCountdown(1); + _field_34 = 0; + } +} + +void FighterPlayerVesna::update() { + if (_frame && checkFrame(2)) { + + if (_sequenceIndex == 3) + _opponent->handleAction(kFightAction3); + + if (_opponent->getCountdown() <= 0) { + getSound()->removeFromQueue(kEntityTables0); + _fight->bailout(Fight::kFightEndWin); + return; + } + + if (_sequenceIndex == 5) + _opponent->handleAction(kFightAction5); + } + + Fighter::update(); +} + +bool FighterPlayerVesna::canInteract(FightAction action) { + if (action != kFightAction128) + return Fighter::canInteract(); + + if (_sequenceIndex != 1) { + + if (_opponent->getSequenceIndex() == 5) { + _engine->getCursor()->setStyle(kCursorDown); + return true; + } + + return Fighter::canInteract(); + } + + if (_opponent->getSequenceIndex() == 1 && checkFrame(4)) { + _engine->getCursor()->setStyle(kCursorPunchLeft); + return true; + } + + return false; +} + +////////////////////////////////////////////////////////////////////////// +// Opponent +////////////////////////////////////////////////////////////////////////// +FighterOpponentVesna::FighterOpponentVesna(LastExpressEngine *engine) : Opponent(engine) { + _sequences.push_back(loadSequence("2005or.seq")); + _sequences.push_back(loadSequence("2005oam.seq")); + _sequences.push_back(loadSequence("2005oar.seq")); + _sequences.push_back(loadSequence("2005okml.seq")); + _sequences.push_back(loadSequence("2005okr.seq")); + _sequences.push_back(loadSequence("2005odm1.seq")); + _sequences.push_back(loadSequence("2005csbm.seq")); + _sequences.push_back(loadSequence("2005oam4.seq")); + + getSound()->playSound(kEntityTables0, "MUS038", SoundManager::kFlagDefault); + + _countdown = 4; + _field_38 = 30; +} + +void FighterOpponentVesna::handleAction(FightAction action) { + switch (action) { + default: + Fighter::handleAction(action); + break; + + case kFightAction3: + _opponent->handleAction(kFightAction103); + break; + + case kFightAction5: + setSequenceAndDraw(7, kFightSequenceType1); + _opponent->handleAction(kFightAction103); + if (_countdown <= 1) + _countdown = 1; + break; + + case kFightAction131: + break; + } +} + +void FighterOpponentVesna::update() { + if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) { + + if (_opponent->getField34() == 1) { + setSequenceAndDraw(2, kFightSequenceType0); + } else { + switch (rnd(6)) { + default: + break; + + case 0: + setSequenceAndDraw(1, kFightSequenceType0); + break; + + case 1: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(1, kFightSequenceType2); + break; + + case 2: + setSequenceAndDraw(2, kFightSequenceType0); + break; + + case 3: + setSequenceAndDraw(2, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 4: + setSequenceAndDraw(1, kFightSequenceType0); + setSequenceAndDraw(2, kFightSequenceType2); + break; + + case 5: + setSequenceAndDraw(2, kFightSequenceType0); + setSequenceAndDraw(1, kFightSequenceType2); + break; + } + } + + // Update field_38 + _field_38 = 4 * _countdown; + } + + if (_frame && checkFrame(2)) { + if (_sequenceIndex == 1 || _sequenceIndex == 2 || _sequenceIndex == 5) + _opponent->handleAction((FightAction)_sequenceIndex); + + if (_opponent->getCountdown() <= 0) { + + switch (_sequenceIndex) { + default: + break; + + case 1: + setSequenceAndDraw(3, kFightSequenceType1); + break; + + case 2: + setSequenceAndDraw(4, kFightSequenceType1); + break; + + case 5: + setSequenceAndDraw(6, kFightSequenceType1); + break; + } + + _opponent->setSequenceAndDraw(4, kFightSequenceType1); + + handleAction(kFightActionLost); + _opponent->update(); + Fighter::update(); + + getSound()->removeFromQueue(kEntityTables0); + + // Stop processing + return; + } + } + + Fighter::update(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/fight/fighter_vesna.h b/engines/lastexpress/fight/fighter_vesna.h new file mode 100644 index 0000000000..5c8ec855ae --- /dev/null +++ b/engines/lastexpress/fight/fighter_vesna.h @@ -0,0 +1,51 @@ +/* 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 LASTEXPRESS_FIGHTER_VESNA_H +#define LASTEXPRESS_FIGHTER_VESNA_H + +#include "lastexpress/fight/fighter.h" + +namespace LastExpress { + +class LastExpressEngine; + +class FighterPlayerVesna : public Fighter { +public: + FighterPlayerVesna(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); + virtual bool canInteract(FightAction action = kFightActionNone); +}; + +class FighterOpponentVesna : public Opponent { +public: + FighterOpponentVesna(LastExpressEngine *engine); + + virtual void handleAction(FightAction action); + virtual void update(); +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_FIGHTER_VESNA_H diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index 3827c16681..e81151910b 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -46,6 +46,12 @@ MODULE_OBJS := \ entities/vesna.o \ entities/yasmin.o \ fight/fight.o \ + fight/fighter.o \ + fight/fighter_anna.o \ + fight/fighter_ivo.o \ + fight/fighter_milos.o \ + fight/fighter_salko.o \ + fight/fighter_vesna.o \ game/action.o \ game/beetle.o \ game/entities.o \ -- cgit v1.2.3 From 85bb5ef45e6b62b52317df2d83a7ad8663dbdfc0 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 02:47:51 -0400 Subject: LASTEXPRESS: Fix leak and corruption of event handlers function pointers - Add better error handling - Properly delete previous event handlers when setting new ones or restoring from backup --- engines/lastexpress/lastexpress.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index e162998719..120e6eb28b 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -288,22 +288,34 @@ void LastExpressEngine::handleSoundTimer() { /// Event Handling /////////////////////////////////////////////////////////////////////////////////// void LastExpressEngine::backupEventHandlers() { + if (_eventMouseBackup != NULL || _eventTickBackup != NULL) + error("[LastExpressEngine::backupEventHandlers] backup event handlers are already set"); + _eventMouseBackup = _eventMouse; _eventTickBackup = _eventTick; } void LastExpressEngine::restoreEventHandlers() { if (_eventMouseBackup == NULL || _eventTickBackup == NULL) - error("LastExpressEngine::restoreEventHandlers: restore called before backing up the event handlers!"); + error("[LastExpressEngine::restoreEventHandlers] restore called before backing up the event handlers"); + + // Cleanup previous event handlers + SAFE_DELETE(_eventMouse); + SAFE_DELETE(_eventTick); _eventMouse = _eventMouseBackup; _eventTick = _eventTickBackup; + + _eventMouseBackup = NULL; + _eventTickBackup = NULL; } void LastExpressEngine::setEventHandlers(EventHandler::EventFunction *mouse, EventHandler::EventFunction *tick) { - // Cleanup previous event handlers - delete _eventMouse; - delete _eventTick; + if (_eventMouse != _eventMouseBackup) + SAFE_DELETE(_eventMouse); + + if (_eventTick != _eventTickBackup) + SAFE_DELETE(_eventTick); _eventMouse = mouse; _eventTick = tick; -- cgit v1.2.3 From 27934d061ecef6456460265171ebccfc065d26e0 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 19:06:30 -0400 Subject: CONFIGURE: Fix Unity checks - Redirect pkgconfig errors to log file - Remove duplicated -lunity option - Fix output of selected taskbar integration when libunity is selected --- configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 04ca85ffb6..8c89afae4c 100755 --- a/configure +++ b/configure @@ -2995,8 +2995,8 @@ if test "$_libunity" = auto ; then ;; *) # Unity has a lots of dependencies, update the libs and cflags var with them - LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity = 3.8.4)" - LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity = 3.8.4)" + LIBUNITY_LIBS="$LIBUNITY_LIBS $(pkg-config --libs unity = 3.8.4 2>> "$TMPLOG")" + LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS $(pkg-config --cflags unity = 3.8.4 2>> "$TMPLOG")" _libunity=no cat > $TMPC << EOF #include @@ -3005,12 +3005,12 @@ int main(void) { return 0; } EOF - cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS -lunity && _libunity=yes + cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS && _libunity=yes ;; esac fi if test "$_libunity" = yes ; then - LIBS="$LIBS $LIBUNITY_LIBS -lunity" + LIBS="$LIBS $LIBUNITY_LIBS" INCLUDES="$INCLUDES $LIBUNITY_CFLAGS" fi define_in_config_h_if_yes "$_libunity" 'USE_TASKBAR_UNITY' @@ -3204,7 +3204,7 @@ if test "$_taskbar" = yes; then echo "win32" ;; *) - if test "$_unity" = yes; then + if test "$_libunity" = yes; then echo "unity" else echo "$_taskbar" -- cgit v1.2.3 From 2b53aff08b6949cf089630703876b8640406d374 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 19:14:55 -0400 Subject: GIT: Ignore Qt Creator project files --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 6294cb451d..9cb3984c0d 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,9 @@ ipch/ #Ignore default Visual Studio build folders [Dd]ebug/ [Rr]elease/ + +#Ignore Qt Creator project files +ScummVM.config +ScummVM.creator +ScummVM.files +ScummVM.includes -- cgit v1.2.3 From d9ede873d5043cc6c389afdcb6ec403cb9655a9a Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 20:22:26 -0400 Subject: BACKENDS: Add missing enumeration value and GUID for compilation under older versions of mingw64 --- backends/taskbar/win32/mingw-compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h index 06968b62ff..bf03db9abd 100644 --- a/backends/taskbar/win32/mingw-compat.h +++ b/backends/taskbar/win32/mingw-compat.h @@ -24,7 +24,7 @@ */ // TODO: Remove header when the latest changes to the Windows SDK have been integrated into MingW -// For reference, the interface definitions here are imported the SDK headers and from the +// For reference, the interface definitions here are imported the SDK headers and from the // EcWin7 project (https://code.google.com/p/dukto/) #ifndef BACKEND_WIN32_TASKBAR_MINGW_H @@ -42,8 +42,14 @@ #include #include #include +#include #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK +// Misc enumeration values +#ifndef SHARD_LINK +#define SHARD_LINK 0x00000006 +#endif + // Taskbar GUID definitions DEFINE_GUID(CLSID_TaskbarList,0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90); DEFINE_GUID(IID_ITaskbarList3,0xea1afb91,0x9e28,0x4b86,0x90,0xE9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf); -- cgit v1.2.3 From 2b01778e58db8f843d3cd29756f8f710a02d7306 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 20:52:59 -0400 Subject: BACKENDS: Fix compilation with Unity - Replace UNIX by POSIX - Move unity include to cpp file - Add exception for unistd.h and time.h headers --- backends/taskbar/unity/unity-taskbar.cpp | 6 +++++- backends/taskbar/unity/unity-taskbar.h | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backends/taskbar/unity/unity-taskbar.cpp b/backends/taskbar/unity/unity-taskbar.cpp index 49c56b746d..da053734d2 100644 --- a/backends/taskbar/unity/unity-taskbar.cpp +++ b/backends/taskbar/unity/unity-taskbar.cpp @@ -23,14 +23,18 @@ * */ +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h #include "common/scummsys.h" -#if defined(UNIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) +#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) #include "backends/taskbar/unity/unity-taskbar.h" #include "common/textconsole.h" +#include + UnityTaskbarManager::UnityTaskbarManager() { g_type_init(); diff --git a/backends/taskbar/unity/unity-taskbar.h b/backends/taskbar/unity/unity-taskbar.h index 9f14b44d8f..06ea0ca769 100644 --- a/backends/taskbar/unity/unity-taskbar.h +++ b/backends/taskbar/unity/unity-taskbar.h @@ -26,13 +26,14 @@ #ifndef BACKEND_UNITY_TASKBAR_H #define BACKEND_UNITY_TASKBAR_H -#if defined(UNIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) +#if defined(POSIX) && defined(USE_TASKBAR) && defined(USE_TASKBAR_UNITY) #include "common/events.h" #include "common/str.h" #include "common/taskbar.h" -#include +typedef struct _GMainLoop GMainLoop; +typedef struct _UnityLauncherEntry UnityLauncherEntry; class UnityTaskbarManager : public Common::TaskbarManager, public Common::EventSource { public: -- cgit v1.2.3 From e05b217b13b8546c815636cc10c3eb91c4465ab8 Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 3 Jun 2011 09:13:41 +0800 Subject: GIT: Ignore MSVC analysis build folders --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9cb3984c0d..a928f4d30c 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ project.xcworkspace /dists/msvc*/[Dd]ebug*/ /dists/msvc*/[Rr]elease*/ +/dists/msvc*/[Aa]nalysis*/ /dists/msvc*/*.lib /dists/msvc*/*.SAV /dists/msvc*/*.dat -- cgit v1.2.3 From 1cc7faa2426a59cf4af87b757027f767940910c7 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 02:53:14 +0800 Subject: DRACI: Replace abort() call by error() --- engines/draci/script.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index c4df9d9dde..8ff60033ed 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -1160,9 +1160,7 @@ void Script::run(const GPL2Program &program, uint16 offset) { } } } else { - debugC(1, kDraciBytecodeDebugLevel, "Unknown opcode %d, %d", - num, subnum); - abort(); + error("Unknown opcode %d, %d", num, subnum); } GPLHandler handler = cmd->_handler; -- cgit v1.2.3 From a8b13e8a6be900995c85f08fd527750e2620c215 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 02:56:25 +0800 Subject: AGOS: Fix operator precedence warning --- engines/agos/string.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index f9a06cbecb..410fd5a1ce 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -517,8 +517,7 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin y -= textHeight; } else pos = stringLength; - padding = (lettersPerRow - pos) % 2 ? - (lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2; + padding = ((lettersPerRow - pos) % 2) ? (lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2; while (padding--) *convertedString2++ = ' '; stringLength -= pos; -- cgit v1.2.3 From 2f200ac49322ff8ccd13c5e8b7a22abbf6ff2610 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 03:43:16 +0800 Subject: ANALYSIS: Fix potential memory leak when using realloc When reallocation is unsuccessful, the passed buffer is not freed. In this case, assigning the result (NULL) will result in a leak of the original memory buffer. See http://msdn.microsoft.com/en-us/library/kkedhy7c.aspx --- audio/decoders/voc.cpp | 6 +++++- engines/lure/memory.cpp | 8 ++++++-- engines/sword25/gfx/image/art.cpp | 42 +++++++++++++++++++++++++++++---------- engines/sword25/gfx/image/art.h | 4 +++- engines/touche/resource.cpp | 22 +++++++++++++------- 5 files changed, 60 insertions(+), 22 deletions(-) diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp index 74ea4440a1..be53f945ac 100644 --- a/audio/decoders/voc.cpp +++ b/audio/decoders/voc.cpp @@ -118,7 +118,11 @@ static byte *loadVOCFromStream(Common::ReadStream &stream, int &size, int &rate, debug(9, "VOC Data Block: %d, %d, %d", rate, packing, len); if (packing == 0) { if (size) { - ret_sound = (byte *)realloc(ret_sound, size + len); + byte *tmp = (byte *)realloc(ret_sound, size + len); + if (!tmp) + error("Cannot reallocate memory for VOC Data Block"); + + ret_sound = tmp; } else { ret_sound = (byte *)malloc(len); } diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index c5c28fa8bc..137a8f6bee 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -93,8 +93,12 @@ void MemoryBlock::copyFrom(const byte *src, uint32 srcPos, uint32 destPos, uint3 void MemoryBlock::reallocate(uint32 size1) { _size = size1; - _data = (byte *) realloc(_data, size1); - if (!_data) error ("Failed reallocating memory block"); + + byte *tmp = (byte *) realloc(_data, size1); + if (!tmp) + error ("[MemoryBlock::reallocate] Failed reallocating memory block"); + + _data = tmp; } } // End of namespace Lure diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index 2df8bd4f3e..07a2be5694 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -167,9 +167,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) { if (points != NULL && n_points >= 2) { if (n_segs == n_segs_max) { n_segs_max <<= 1; - svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); + ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + + (n_segs_max - 1) * + sizeof(ArtSVPSeg)); + + if (!tmp) + error("Cannot reallocate memory in art_svp_from_vpath()"); + + svp = tmp; } svp->segs[n_segs].n_points = n_points; svp->segs[n_segs].dir = (dir > 0); @@ -204,9 +209,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) { y = points[n_points - 1].y; if (n_segs == n_segs_max) { n_segs_max <<= 1; - svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); + ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + + (n_segs_max - 1) * + sizeof(ArtSVPSeg)); + + if (!tmp) + error("Cannot reallocate memory in art_svp_from_vpath()"); + + svp = tmp; } svp->segs[n_segs].n_points = n_points; svp->segs[n_segs].dir = (dir > 0); @@ -246,9 +256,14 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) { if (n_points >= 2) { if (n_segs == n_segs_max) { n_segs_max <<= 1; - svp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); + ArtSVP *tmp = (ArtSVP *)realloc(svp, sizeof(ArtSVP) + + (n_segs_max - 1) * + sizeof(ArtSVPSeg)); + + if (!tmp) + error("Cannot reallocate memory in art_svp_from_vpath()"); + + svp = tmp; } svp->segs[n_segs].n_points = n_points; svp->segs[n_segs].dir = (dir > 0); @@ -1157,8 +1172,13 @@ static int art_svp_writer_rewind_add_segment(ArtSvpWriter *self, int wind_left, (swr->n_segs_max - 1) * sizeof(ArtSVPSeg)); swr->svp = svp; - swr->n_points_max = art_renew(swr->n_points_max, int, - swr->n_segs_max); + int *tmp = art_renew(swr->n_points_max, int, + swr->n_segs_max); + + if (!tmp) + error("Cannot reallocate memory in art_svp_writer_rewind_add_segment()"); + + swr->n_points_max = tmp; } seg = &svp->segs[seg_num]; seg->n_points = 1; diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h index bfeb31cc30..942e26644f 100644 --- a/engines/sword25/gfx/image/art.h +++ b/engines/sword25/gfx/image/art.h @@ -51,7 +51,9 @@ namespace Sword25 { #define art_expand(p, type, max) \ do { \ if(max) {\ - p = art_renew(p, type, max <<= 1); \ + type *tmp = art_renew(p, type, max <<= 1); \ + if (!tmp) error("Cannot reallocate memory for art data"); \ + p = tmp; \ } else { \ max = 1; \ p = art_new(type, 1); \ diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 8f4752e912..6df6fc0e5f 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -468,14 +468,22 @@ void ToucheEngine::res_loadSprite(int num, int index) { if (size > spr->size) { debug(8, "Reallocating memory for sprite %d (index %d), %d bytes needed", num, index, size - spr->size); spr->size = size; - if (spr->ptr) { - spr->ptr = (uint8 *)realloc(spr->ptr, size); - } else { - spr->ptr = (uint8 *)malloc(size); - } - if (!spr->ptr) { - error("Unable to reallocate memory for sprite %d (%d bytes)", num, size); + + uint8 *buffer = NULL; + if (spr->ptr) + buffer = (uint8 *)realloc(spr->ptr, size); + + if (!buffer) { + // Free previously allocated sprite (when realloc failed) + free(spr->ptr); + + buffer = (uint8 *)malloc(size); } + + if (!buffer) + error("[ToucheEngine::res_loadSprite] Unable to reallocate memory for sprite %d (%d bytes)", num, size); + + spr->ptr = buffer; } for (int i = 0; i < _currentImageHeight; ++i) { res_decodeScanLineImageRLE(spr->ptr + _currentImageWidth * i, _currentImageWidth); -- cgit v1.2.3 From c52cc849123ac4a6e4a6ce1f0880cb1cd95e23cd Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 06:46:40 +0800 Subject: AUDIO/BACKENDS/GRAPHICS: Add error checks after allocating memory with malloc --- audio/rate.cpp | 3 +++ audio/softsynth/opl/mame.cpp | 2 ++ backends/vkeybd/virtual-keyboard-parser.cpp | 6 ++++++ graphics/scaler.cpp | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/audio/rate.cpp b/audio/rate.cpp index 83abd6150b..0fc23a8a54 100644 --- a/audio/rate.cpp +++ b/audio/rate.cpp @@ -298,6 +298,9 @@ public: _bufferSize = osamp; } + if (!_buffer) + error("[CopyRateConverter::flow] Cannot allocate memory for temp buffer"); + // Read up to 'osamp' samples into our temporary buffer len = input.readBuffer(_buffer, osamp); diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp index 74699ba4c6..15e869ba33 100644 --- a/audio/softsynth/opl/mame.cpp +++ b/audio/softsynth/opl/mame.cpp @@ -725,6 +725,8 @@ static int OPLOpenTable(void) { ENV_CURVE = (int *)malloc(sizeof(int) * (2*EG_ENT+1)); + if (!ENV_CURVE) + error("[OPLOpenTable] Cannot allocate memory"); /* envelope counter -> envelope output table */ for (i=0; i < EG_ENT; i++) { diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp index 5e4ce11fe4..58f0c468f6 100644 --- a/backends/vkeybd/virtual-keyboard-parser.cpp +++ b/backends/vkeybd/virtual-keyboard-parser.cpp @@ -205,6 +205,9 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) { evt->type = VirtualKeyboard::kVKEventModifier; byte *flags = (byte*) malloc(sizeof(byte)); + if (!flags) + error("[VirtualKeyboardParser::parserCallback_event] Cannot allocate memory"); + *(flags) = parseFlags(node->values["modifiers"]); evt->data = flags; @@ -217,6 +220,9 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) { evt->type = VirtualKeyboard::kVKEventSwitchMode; String& mode = node->values["mode"]; char *str = (char*) malloc(sizeof(char) * mode.size() + 1); + if (!str) + error("[VirtualKeyboardParser::parserCallback_event] Cannot allocate memory"); + memcpy(str, mode.c_str(), sizeof(char) * mode.size()); str[mode.size()] = 0; evt->data = str; diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp index a35fb9046e..9ade0e6c57 100644 --- a/graphics/scaler.cpp +++ b/graphics/scaler.cpp @@ -24,6 +24,7 @@ #include "graphics/scaler/scalebit.h" #include "common/util.h" #include "common/system.h" +#include "common/textconsole.h" int gBitFormat = 565; @@ -90,6 +91,9 @@ void InitLUT(Graphics::PixelFormat format) { if (RGBtoYUV == 0) RGBtoYUV = (uint32 *)malloc(65536 * sizeof(uint32)); + if (!RGBtoYUV) + error("[InitLUT] Cannot allocate memory for YUV/LUT buffers"); + for (int color = 0; color < 65536; ++color) { format.colorToRGB(color, r, g, b); Y = (r + g + b) >> 2; -- cgit v1.2.3 From 979fc29be615fa11a095d59adf37d4077018983c Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 07:00:24 +0800 Subject: BASE: Check return value from strtol in DO_OPTION_INT macro --- base/commandLine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 61853a1ebc..6d187ac8b1 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -267,8 +267,9 @@ void registerDefaults() { #define DO_OPTION_INT(shortCmd, longCmd) \ DO_OPTION(shortCmd, longCmd) \ char *endptr = 0; \ - strtol(option, &endptr, 0); \ - if (endptr == NULL || *endptr != 0) usage("--%s: Invalid number '%s'", longCmd, option); + long int retval = strtol(option, &endptr, 0); \ + if (endptr == NULL || *endptr != 0 || retval == 0 || retval == LONG_MAX || retval == LONG_MIN || errno == ERANGE) \ + usage("--%s: Invalid number '%s'", longCmd, option); // Use this for boolean options; this distinguishes between "-x" and "-X", // resp. between "--some-option" and "--no-some-option". -- cgit v1.2.3 From 3ece07b14b0ffcac4050692715c182d637c041a2 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 23:38:06 +0800 Subject: AUDIO: Replace assignment in return call by separate assignment and return call. --- audio/mpu401.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/mpu401.cpp b/audio/mpu401.cpp index caad945258..966e367a93 100644 --- a/audio/mpu401.cpp +++ b/audio/mpu401.cpp @@ -33,7 +33,10 @@ void MidiChannel_MPU401::init(MidiDriver *owner, byte channel) { bool MidiChannel_MPU401::allocate() { if (_allocated) return false; - return (_allocated = true); + + _allocated = true; + + return true; } MidiDriver *MidiChannel_MPU401::device() { -- cgit v1.2.3 From 7a882600c6778ad7d0bdd357aba92261ae306550 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 5 Jun 2011 04:10:39 +0800 Subject: GRAPHICS: Allocate Common::PEResources on the heap in WinFont::loadFromPE() --- graphics/fonts/winfont.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 8b60f8aa6b..3bad92236d 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -120,15 +120,18 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry & } bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &dirEntry) { - Common::PEResources exe; + Common::PEResources *exe = new Common::PEResources(); - if (!exe.loadFromEXE(fileName)) + if (!exe->loadFromEXE(fileName)) { + delete exe; return false; + } // Let's pull out the font directory - Common::SeekableReadStream *fontDirectory = exe.getResource(Common::kPEFontDir, Common::String("FONTDIR")); + Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kPEFontDir, Common::String("FONTDIR")); if (!fontDirectory) { warning("No font directory in '%s'", fileName.c_str()); + delete exe; return false; } @@ -139,18 +142,21 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry & // Couldn't match the face name if (fontId == 0xffffffff) { warning("Could not find face '%s' in '%s'", dirEntry.faceName.c_str(), fileName.c_str()); + delete exe; return false; } // Actually go get our font now... - Common::SeekableReadStream *fontStream = exe.getResource(Common::kPEFont, fontId); + Common::SeekableReadStream *fontStream = exe->getResource(Common::kPEFont, fontId); if (!fontStream) { warning("Could not find font %d in %s", fontId, fileName.c_str()); + delete exe; return false; } bool ok = loadFromFNT(*fontStream); delete fontStream; + delete exe; return ok; } -- cgit v1.2.3 From 5aa1877beffa71a2cc712a85b74a788e22a924e2 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 5 Jun 2011 05:01:39 +0800 Subject: TEENAGENT: Allocate large buffers on the heap instead of the stack --- engines/teenagent/resources.cpp | 11 +++- engines/teenagent/teenagent.cpp | 129 +++++++++++++++++++++++++++++++--------- 2 files changed, 111 insertions(+), 29 deletions(-) diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 9e69383215..597ca670c0 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -106,13 +106,20 @@ void Resources::loadOff(Graphics::Surface &surface, byte *palette, int id) { error("invalid background %d", id); return; } - byte buf[64768]; - off.read(id, buf, sizeof(buf)); + + const uint bufferSize = 64768; + byte *buf = (byte *)malloc(bufferSize); + if (!buf) + error("[Resources::loadOff] Cannot allocate buffer"); + + off.read(id, buf, bufferSize); byte *src = buf; byte *dst = (byte *)surface.pixels; memcpy(dst, src, 64000); memcpy(palette, buf + 64000, 768); + + free(buf); } Common::SeekableReadStream *Resources::loadLan(uint32 id) const { diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 724f75be2f..0289b994e6 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -216,14 +216,22 @@ Common::Error TeenAgentEngine::loadGameState(int slot) { Resources *res = Resources::instance(); - assert(res->dseg.size() >= 0x6478 + 0x777a); - char data[0x777a]; + const uint dataSize = 0x777a; + assert(res->dseg.size() >= 0x6478 + dataSize); + + char *data = (char *)malloc(dataSize); + if (!data) + error("[TeenAgentEngine::loadGameState] Cannot allocate buffer"); + in->seek(0); - if (in->read(data, 0x777a) != 0x777a) { + if (in->read(data, dataSize) != dataSize) { + free(data); return Common::kReadingFailed; } - memcpy(res->dseg.ptr(0x6478), data, sizeof(data)); + memcpy(res->dseg.ptr(0x6478), data, dataSize); + + free(data); scene->clear(); inventory->activate(false); @@ -290,17 +298,32 @@ bool TeenAgentEngine::showCDLogo() { if (!cdlogo.exists("cdlogo.res") || !cdlogo.open("cdlogo.res")) return true; - byte bg[0xfa00]; - byte palette[3*256]; + const uint bgSize = 0xfa00; + const uint paletteSize = 3 * 256; + + byte *bg = (byte *)malloc(bgSize); + if (!bg) + error("[TeenAgentEngine::showCDLogo] Cannot allocate background buffer"); + + byte *palette = (byte *)malloc(paletteSize); + if (!palette) { + free(bg); + error("[TeenAgentEngine::showCDLogo] Cannot allocate palette buffer"); + } + + cdlogo.read(bg, bgSize); + cdlogo.read(palette, paletteSize); - cdlogo.read(bg, sizeof(bg)); - cdlogo.read(palette, sizeof(palette)); - for (uint c = 0; c < 3*256; ++c) + for (uint c = 0; c < paletteSize; ++c) palette[c] *= 4; + _system->getPaletteManager()->setPalette(palette, 0, 0x100); _system->copyRectToScreen(bg, 320, 0, 0, 320, 200); _system->updateScreen(); + free(bg); + free(palette); + for(uint i = 0; i < 20; ++i) { int r = skipEvents(); if (r != 0) @@ -317,43 +340,66 @@ bool TeenAgentEngine::showLogo() { if (!logo.open("unlogic.res")) return true; - byte bg[0xfa00]; - byte palette[3*256]; - Common::ScopedPtr frame(logo.getStream(1)); if (!frame) return true; - frame->read(bg, sizeof(bg)); - frame->read(palette, sizeof(palette)); - for (uint c = 0; c < 3*256; ++c) + const uint bgSize = 0xfa00; + const uint paletteSize = 3 * 256; + + byte *bg = (byte *)malloc(bgSize); + if (!bg) + error("[TeenAgentEngine::showLogo] Cannot allocate background buffer"); + + byte *palette = (byte *)malloc(paletteSize); + if (!palette) { + free(bg); + error("[TeenAgentEngine::showLogo] Cannot allocate palette buffer"); + } + + frame->read(bg, bgSize); + frame->read(palette, paletteSize); + + for (uint c = 0; c < paletteSize; ++c) palette[c] *= 4; + _system->getPaletteManager()->setPalette(palette, 0, 0x100); + free(palette); + uint n = logo.fileCount(); for(uint f = 0; f < 4; ++f) for(uint i = 2; i <= n; ++i) { { int r = skipEvents(); - if (r != 0) + if (r != 0) { + free(bg); return r > 0? true: false; + } } _system->copyRectToScreen(bg, 320, 0, 0, 320, 200); frame.reset(logo.getStream(i)); - if (!frame) + if (!frame) { + free(bg); return true; + } Surface s; s.load(frame, Surface::kTypeOns); - if (s.empty()) + if (s.empty()) { + free(bg); return true; + } _system->copyRectToScreen((const byte *)s.pixels, s.w, s.x, s.y, s.w, s.h); _system->updateScreen(); _system->delayMillis(100); } + + free(bg); + return true; } @@ -364,29 +410,53 @@ bool TeenAgentEngine::showMetropolis() { FilePack varia; varia.open("varia.res"); - byte palette[3*256]; + const uint paletteSize = 3 * 256; + byte *palette = (byte *)malloc(paletteSize); + if (!palette) + error("[TeenAgentEngine::showMetropolis] Cannot allocate palette buffer"); + { Common::ScopedPtr s(varia.getStream(5)); - s->read(palette, sizeof(palette)); - for (uint c = 0; c < 3*256; ++c) + s->read(palette, paletteSize); + for (uint c = 0; c < paletteSize; ++c) palette[c] *= 4; } _system->getPaletteManager()->setPalette(palette, 0, 0x100); - byte varia_6[21760], varia_9[18302]; - varia.read(6, varia_6, sizeof(varia_6)); - varia.read(9, varia_9, sizeof(varia_9)); + free(palette); - byte colors[56 * 160 * 2]; - memset(colors, 0, sizeof(colors)); + const uint varia6Size = 21760; + const uint varia9Size = 18302; + byte *varia_6 = (byte *)malloc(varia6Size); + byte *varia_9 = (byte *)malloc(varia9Size); + if (!varia_6 || !varia_9) { + free(varia_6); + free(varia_9); + + error("[TeenAgentEngine::showMetropolis] Cannot allocate buffer"); + } + + varia.read(6, varia_6, varia6Size); + varia.read(9, varia_9, varia9Size); + + const uint colorsSize = 56 * 160 * 2; + byte *colors = (byte *)malloc(colorsSize); + if (!colors) + error("[TeenAgentEngine::showMetropolis] Cannot allocate colors buffer"); + + memset(colors, 0, colorsSize); int logo_y = -56; for(uint f = 0; f < 300; ++f) { { int r = skipEvents(); - if (r != 0) + if (r != 0) { + free(varia_6); + free(varia_9); + free(colors); return r > 0? true: false; + } } Graphics::Surface *surface = _system->lockScreen(); @@ -441,6 +511,11 @@ bool TeenAgentEngine::showMetropolis() { _system->updateScreen(); _system->delayMillis(100); } + + free(varia_6); + free(varia_9); + free(colors); + return true; } -- cgit v1.2.3 From 367605d774df038166b14044a5f5ce935f244519 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 5 Jun 2011 05:22:40 +0800 Subject: TSAGE: Allocate resource decoding buffer on the heap --- engines/toon/path.cpp | 24 +++++++++++++++++++++--- engines/tsage/resources.cpp | 11 +++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index dde7be07d0..43a134e39b 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -342,8 +342,15 @@ next: curX = destx; curY = desty; - int32 retPathX[4096]; - int32 retPathY[4096]; + int32 *retPathX = (int32 *)malloc(4096 * sizeof(int32)); + int32 *retPathY = (int32 *)malloc(4096 * sizeof(int32)); + if (!retPathX || !retPathY) { + free(retPathX); + free(retPathY); + + error("[PathFinding::findPath] Cannot allocate pathfinding buffers"); + } + int32 numpath = 0; retPathX[numpath] = curX; @@ -377,8 +384,12 @@ next: } } - if (bestX < 0 || bestY < 0) + if (bestX < 0 || bestY < 0) { + free(retPathX); + free(retPathY); + return 0; + } retPathX[numpath] = bestX; retPathY[numpath] = bestY; @@ -389,6 +400,10 @@ next: memcpy(_tempPathX, retPathX, sizeof(int32) * numpath); memcpy(_tempPathY, retPathY, sizeof(int32) * numpath); + + free(retPathX); + free(retPathY); + return true; } @@ -396,6 +411,9 @@ next: curY = bestY; } + free(retPathX); + free(retPathY); + return false; } diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index d24c564a1f..e6a561f3a7 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -237,8 +237,13 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) { uint16 ctrCurrent = 0x102, ctrMax = 0x200; uint16 word_48050 = 0, currentToken = 0, word_48054 =0; byte byte_49068 = 0, byte_49069 = 0; - DecodeReference table[0x1000]; - for (int i = 0; i < 0x1000; ++i) { + + const uint tableSize = 0x1000; + DecodeReference *table = (DecodeReference *)malloc(tableSize * sizeof(DecodeReference)); + if (!table) + error("[TLib::getResource] Cannot allocate table buffer"); + + for (int i = 0; i < tableSize; ++i) { table[i].vByte = table[i].vWord = 0; } Common::Stack tokenList; @@ -302,6 +307,8 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) { } } + free(table); + assert(bytesWritten == re->uncompressedSize); delete compStream; return dataOut; -- cgit v1.2.3 From 8a5bda72cca58314c639432d5ab718a70fd42b90 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 5 Jun 2011 05:50:40 +0800 Subject: BACKENDS/GRAPHICS: Silence non zero-terminated terminated buffers warnings by initializing the buffers to 0 --- backends/platform/sdl/sdl.cpp | 1 + graphics/font.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 3f85b1a564..96d65c5eb2 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -413,6 +413,7 @@ void OSystem_SDL::setupIcon() { for (i = 0; i < ncols; i++) { unsigned char code; char color[32]; + memset(color, 0, sizeof(color)); unsigned int col; if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) { warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]); diff --git a/graphics/font.cpp b/graphics/font.cpp index cdf9090625..d254c64264 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -214,6 +214,8 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) { char buf[256]; char facename[256]; char copyright[256]; + memset(facename, 0, sizeof(facename)); + memset(copyright, 0, sizeof(copyright)); /* set certain values to errors for later error checking*/ pf->defaultchar = -1; @@ -235,6 +237,7 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) { warning("Error: bad 'FONT'"); return 0; } + pf->facename = strdup(facename); continue; } @@ -243,6 +246,7 @@ int bdf_read_header(Common::SeekableReadStream &fp, NewFontData* pf) { warning("Error: bad 'COPYRIGHT'"); return 0; } + pf->copyright = strdup(copyright); continue; } -- cgit v1.2.3 From 9ff993382e17d1d7aef96105ad5fa2fe35043b7a Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 5 Jun 2011 06:03:54 +0800 Subject: LURE: Allocate debug strings buffer on the heap --- engines/lure/debugger.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index 68410875f7..ef4a22f73a 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -549,14 +549,19 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) { } bool Debugger::cmd_saveStrings(int argc, const char **argv) { - StringData &strings = StringData::getReference(); - char buffer[32768]; - if (argc != 2) { DebugPrintf("strings \n"); return true; } + StringData &strings = StringData::getReference(); + + char *buffer = (char *)malloc(32768); + if (!buffer) { + DebugPrintf("Cannot allocate strings buffer\n"); + return true; + } + uint16 id = strToInt(argv[1]); strings.getString(id, buffer, NULL, NULL); DebugPrintf("%s\n", buffer); @@ -577,6 +582,9 @@ bool Debugger::cmd_saveStrings(int argc, const char **argv) { DebugPrintf("Done\n"); */ + + free(buffer); + return true; } -- cgit v1.2.3 From e610a17fc3c8956aaca4b1f68a73dbfaebb5beb0 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 01:10:09 +0800 Subject: DRACI: Allocate no-sound buffer on the heap in LegacySoundArchive::openArchive() --- engines/draci/sound.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index 106167ef8a..d534f46a6e 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -67,8 +67,12 @@ void LegacySoundArchive::openArchive(const char *path) { debugC(1, kDraciArchiverDebugLevel, "Loading header"); uint totalLength = _f->readUint32LE(); + const uint kMaxSamples = 4095; // The no-sound file is exactly 16K bytes long, so don't fail on short reads - uint sampleStarts[kMaxSamples]; + uint *sampleStarts = (uint *)malloc(kMaxSamples * sizeof(uint)); + if (!sampleStarts) + error("[LegacySoundArchive::openArchive] Cannot allocate buffer for no-sound file"); + for (uint i = 0; i < kMaxSamples; ++i) { sampleStarts[i] = _f->readUint32LE(); } @@ -90,17 +94,22 @@ void LegacySoundArchive::openArchive(const char *path) { } if (_samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length != totalLength && _samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length - _samples[0]._offset != totalLength) { - // WORKAROUND: the stored length is stored with the header for sounds and without the hader for dubbing. Crazy. + // WORKAROUND: the stored length is stored with the header for sounds and without the header for dubbing. Crazy. debugC(1, kDraciArchiverDebugLevel, "Broken sound archive: %d != %d", _samples[_sampleCount-1]._offset + _samples[_sampleCount-1]._length, totalLength); closeArchive(); + + free(sampleStarts); + return; } } else { debugC(1, kDraciArchiverDebugLevel, "Archive info: empty"); } + free(sampleStarts); + // Indicate that the archive has been successfully opened _opened = true; } -- cgit v1.2.3 From 69c7673e53e1afd197f1e119059fc351a6daa5e0 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 01:14:48 +0800 Subject: KYRA: Allocate screen region buffer on the heap --- engines/kyra/debugger.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index d0baf8a133..e8dd9e9a15 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -71,11 +71,18 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) { } if (_vm->game() != GI_KYRA1 && _vm->resource()->getFileSize(argv[1]) != 768) { - uint8 buffer[320*200]; + uint8 *buffer = (uint8 *)malloc(320 * 200 * sizeof(uint8)); + if (!buffer) { + DebugPrintf("ERROR: Cannot allocate buffer for screen region!\n"); + return true; + } + _vm->screen()->copyRegionToBuffer(5, 0, 0, 320, 200, buffer); _vm->screen()->loadBitmap(argv[1], 5, 5, 0); palette.copy(_vm->screen()->getCPagePtr(5), 0, 256); _vm->screen()->copyBlockToPage(5, 0, 0, 320, 200, buffer); + + free(buffer); } else if (!_vm->screen()->loadPalette(argv[1], palette)) { DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]); return true; -- cgit v1.2.3 From dd21952f9845c2d9947c3ad6459f45063f0588d6 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 01:23:47 +0800 Subject: SCI: Allocate decompression buffers on the heap --- engines/sci/decompressor.cpp | 45 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index 03a06d240d..7e7acab994 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -181,16 +181,27 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack init(src, dest, nPacked, nUnpacked); uint16 token; // The last received value - - uint16 tokenlist[4096]; // pointers to dest[] - uint16 tokenlengthlist[4096]; // char length of each token uint16 tokenlastlength = 0; + uint16 *tokenlist = (uint16 *)malloc(4096 * sizeof(uint16)); // pointers to dest[] + uint16* tokenlengthlist = (uint16 *)malloc(4096 * sizeof(uint16)); // char length of each token + if (!tokenlist || !tokenlengthlist) { + free(tokenlist); + free(tokenlengthlist); + + error("[DecompressorLZW::unpackLZW] Cannot allocate token memory buffers"); + } + while (!isFinished()) { token = getBitsLSB(_numbits); - if (token == 0x101) + if (token == 0x101) { + free(tokenlist); + free(tokenlengthlist); + return 0; // terminator + } + if (token == 0x100) { // reset command _numbits = 9; _endtoken = 0x1FF; @@ -199,6 +210,10 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack if (token > 0xff) { if (token >= _curtoken) { warning("unpackLZW: Bad token %x", token); + + free(tokenlist); + free(tokenlengthlist); + return SCI_ERROR_DECOMPRESSION_ERROR; } tokenlastlength = tokenlengthlist[token] + 1; @@ -231,6 +246,9 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack } } + free(tokenlist); + free(tokenlengthlist); + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } @@ -238,12 +256,19 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac uint32 nUnpacked) { init(src, dest, nPacked, nUnpacked); - byte stak[0x1014]; - byte lastchar = 0; - uint16 stakptr = 0, lastbits = 0; - Tokenlist tokens[0x1004]; + byte *stak = (byte *)malloc(0x1014); + Tokenlist *tokens = (Tokenlist *)malloc(0x1004 * sizeof(Tokenlist)); + if (!stak || !tokens) { + free(stak); + free(tokens); + + error("[DecompressorLZW::unpackLZW1] Cannot allocate decompression buffers"); + } + memset(tokens, 0, sizeof(tokens)); + byte lastchar = 0; + uint16 stakptr = 0, lastbits = 0; byte decryptstart = 0; uint16 bitstring; @@ -310,6 +335,10 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac break; } } + + free(stak); + free(tokens); + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } -- cgit v1.2.3 From 7fa3a8bbffc625232cd24252cf501e2c2b7b2a55 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 6 Jun 2011 01:45:21 +0800 Subject: BACKENDS: Add better error handling to OSystem_Win32::getDefaultConfigFileName() --- backends/platform/sdl/win32/win32.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 5b02a20abc..814f1955fe 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -155,18 +155,31 @@ Common::String OSystem_Win32::getDefaultConfigFileName() { error("Unable to access user profile directory"); strcat(configFile, "\\Application Data"); - CreateDirectory(configFile, NULL); + + // If the directory already exists (as it should in most cases), + // we don't want to fail, but we need to stop on other errors (such as ERROR_PATH_NOT_FOUND) + if (!CreateDirectory(configFile, NULL)) { + if (GetLastError() != ERROR_ALREADY_EXISTS) + error("Cannot create Application data folder"); + } } strcat(configFile, "\\ScummVM"); - CreateDirectory(configFile, NULL); + if (!CreateDirectory(configFile, NULL)) { + if (GetLastError() != ERROR_ALREADY_EXISTS) + error("Cannot create ScummVM application data folder"); + } + strcat(configFile, "\\" DEFAULT_CONFIG_FILE); FILE *tmp = NULL; if ((tmp = fopen(configFile, "r")) == NULL) { // Check windows directory char oldConfigFile[MAXPATHLEN]; - GetWindowsDirectory(oldConfigFile, MAXPATHLEN); + uint ret = GetWindowsDirectory(oldConfigFile, MAXPATHLEN); + if (ret == 0 || ret > MAXPATHLEN) + error("Cannot retrieve the path of the Windows directory"); + strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE); if ((tmp = fopen(oldConfigFile, "r"))) { strcpy(configFile, oldConfigFile); @@ -178,7 +191,10 @@ Common::String OSystem_Win32::getDefaultConfigFileName() { } } else { // Check windows directory - GetWindowsDirectory(configFile, MAXPATHLEN); + uint ret = GetWindowsDirectory(configFile, MAXPATHLEN); + if (ret == 0 || ret > MAXPATHLEN) + error("Cannot retrieve the path of the Windows directory"); + strcat(configFile, "\\" DEFAULT_CONFIG_FILE); } -- cgit v1.2.3 From 53c4a190fc2337b6f2bec943ca9016f89d8e6f2f Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 7 Jun 2011 00:46:09 +0800 Subject: COMMON: Add abort() to the list of forbidden symbols --- common/forbidden.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/forbidden.h b/common/forbidden.h index 9cba19cf5e..95c1a47d65 100644 --- a/common/forbidden.h +++ b/common/forbidden.h @@ -29,7 +29,7 @@ * infrastructure code do not make use of certain "forbidden" APIs, such * as fopen(), setjmp(), etc. * This is achieved by re-#defining various symbols to a "garbage" - * string which then trigers a compiler error. + * string which then triggers a compiler error. * * Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they * have to access functions like fopen, fread etc. @@ -203,6 +203,11 @@ #define exit(a) FORBIDDEN_SYMBOL_REPLACEMENT #endif +#ifndef FORBIDDEN_SYMBOL_EXCEPTION_abort +#undef abort +#define abort() FORBIDDEN_SYMBOL_REPLACEMENT +#endif + #ifndef FORBIDDEN_SYMBOL_EXCEPTION_getenv #undef getenv #define getenv(a) FORBIDDEN_SYMBOL_REPLACEMENT -- cgit v1.2.3 From e972c6cfd87cb5cbf1e93cf481f53add88655c42 Mon Sep 17 00:00:00 2001 From: Julien Date: Sat, 4 Jun 2011 06:05:01 +0800 Subject: SWORD25: Add error checks after allocating memory with malloc --- engines/sword25/fmv/theora_decoder.cpp | 11 +++++++++ engines/sword25/gfx/image/art.cpp | 27 +++++++++++++++++++++++ engines/sword25/gfx/image/art.h | 1 + engines/sword25/gfx/image/vectorimage.cpp | 2 ++ engines/sword25/gfx/image/vectorimagerenderer.cpp | 7 ++++++ engines/sword25/package/packagemanager.h | 3 +++ 6 files changed, 51 insertions(+) diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index 098bd2c6b9..a7ebb5df8c 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -424,6 +424,12 @@ bool TheoraDecoder::queueAudio() { if (!_audStream) return false; + // An audio buffer should have been allocated (either in the constructor or after queuing the current buffer) + if (!_audiobuf) { + warning("[TheoraDecoder::queueAudio] Invalid audio buffer"); + return false; + } + bool queuedAudio = false; for (;;) { @@ -454,6 +460,11 @@ bool TheoraDecoder::queueAudio() { // The audio mixer is now responsible for the old audio buffer. // We need to create a new one. _audiobuf = (ogg_int16_t *)malloc(AUDIOFD_FRAGSIZE * sizeof(ogg_int16_t)); + if (!_audiobuf) { + warning("[TheoraDecoder::queueAudio] Cannot allocate memory for audio buffer"); + return false; + } + _audiobufFill = 0; queuedAudio = true; } diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp index 07a2be5694..e9715481c6 100644 --- a/engines/sword25/gfx/image/art.cpp +++ b/engines/sword25/gfx/image/art.cpp @@ -151,6 +151,8 @@ ArtSVP *art_svp_from_vpath(ArtVpath *vpath) { n_segs_max = 16; svp = (ArtSVP *)malloc(sizeof(ArtSVP) + (n_segs_max - 1) * sizeof(ArtSVPSeg)); + if (!svp) + error("[art_svp_from_vpath] Cannot allocate memory"); dir = 0; n_points = 0; @@ -1041,6 +1043,8 @@ struct _ArtPriPoint { static ArtPriQ *art_pri_new(void) { ArtPriQ *result = art_new(ArtPriQ, 1); + if (!result) + error("[art_pri_new] Cannot allocate memory"); result->n_items = 0; result->n_items_max = 16; @@ -1189,6 +1193,9 @@ static int art_svp_writer_rewind_add_segment(ArtSvpWriter *self, int wind_left, seg->bbox.x1 = x; seg->bbox.y1 = y; seg->points = art_new(ArtPoint, init_n_points_max); + if (!seg->points) + error("[art_svp_writer_rewind_add_segment] Cannot allocate memory"); + seg->points[0].x = x; seg->points[0].y = y; return seg_num; @@ -1233,6 +1240,8 @@ ArtSVP *art_svp_writer_rewind_reap(ArtSvpWriter *self) { ArtSvpWriter *art_svp_writer_rewind_new(ArtWindRule rule) { ArtSvpWriterRewind *result = art_new(ArtSvpWriterRewind, 1); + if (!result) + error("[art_svp_writer_rewind_new] Cannot allocate memory"); result->super.add_segment = art_svp_writer_rewind_add_segment; result->super.add_point = art_svp_writer_rewind_add_point; @@ -1242,6 +1251,9 @@ ArtSvpWriter *art_svp_writer_rewind_new(ArtWindRule rule) { result->n_segs_max = 16; result->svp = (ArtSVP *)malloc(sizeof(ArtSVP) + (result->n_segs_max - 1) * sizeof(ArtSVPSeg)); + if (!result->svp) + error("[art_svp_writer_rewind_new] Cannot allocate memory"); + result->svp->n_segs = 0; result->n_points_max = art_new(int, result->n_segs_max); @@ -1412,6 +1424,9 @@ static void art_svp_intersect_push_pt(ArtIntersectCtx *ctx, ArtActiveSeg *seg, seg->y1 = y; pri_pt = art_new(ArtPriPoint, 1); + if (!pri_pt) + error("[art_svp_intersect_push_pt] Cannot allocate memory"); + pri_pt->x = x; pri_pt->y = y; pri_pt->user_data = seg; @@ -1875,6 +1890,8 @@ static void art_svp_intersect_horiz(ArtIntersectCtx *ctx, ArtActiveSeg *seg, return; hs = art_new(ArtActiveSeg, 1); + if (!hs) + error("[art_svp_intersect_horiz] Cannot allocate memory"); hs->flags = ART_ACTIVE_FLAGS_DEL | (seg->flags & ART_ACTIVE_FLAGS_OUT); if (seg->flags & ART_ACTIVE_FLAGS_OUT) { @@ -2017,6 +2034,8 @@ static void art_svp_intersect_add_seg(ArtIntersectCtx *ctx, const ArtSVPSeg *in_ ArtActiveSeg *last = NULL; ArtActiveSeg *left, *right; ArtPriPoint *pri_pt = art_new(ArtPriPoint, 1); + if (!pri_pt) + error("[art_svp_intersect_add_seg] Cannot allocate memory"); seg->flags = 0; seg->in_seg = in_seg; @@ -2186,6 +2205,9 @@ void art_svp_intersector(const ArtSVP *in, ArtSvpWriter *out) { return; ctx = art_new(ArtIntersectCtx, 1); + if (!ctx) + error("[art_svp_intersector] Cannot allocate memory"); + ctx->in = in; ctx->out = out; pq = art_pri_new(); @@ -2198,6 +2220,9 @@ void art_svp_intersector(const ArtSVP *in, ArtSvpWriter *out) { ctx->in_curs = 0; first_point = art_new(ArtPriPoint, 1); + if (!first_point) + error("[art_svp_intersector] Cannot allocate memory"); + first_point->x = in->segs[0].points[0].x; first_point->y = in->segs[0].points[0].y; first_point->user_data = NULL; @@ -2339,6 +2364,8 @@ static void art_svp_render_delete_active(int *active_segs, int j, int n_active_s ArtSVPRenderAAIter *art_svp_render_aa_iter(const ArtSVP *svp, int x0, int y0, int x1, int y1) { ArtSVPRenderAAIter *iter = art_new(ArtSVPRenderAAIter, 1); + if (!iter) + error("[art_svp_render_aa_iter] Cannot allocate memory"); iter->svp = svp; iter->y = y0; diff --git a/engines/sword25/gfx/image/art.h b/engines/sword25/gfx/image/art.h index 942e26644f..8c9c97bc57 100644 --- a/engines/sword25/gfx/image/art.h +++ b/engines/sword25/gfx/image/art.h @@ -57,6 +57,7 @@ namespace Sword25 { } else { \ max = 1; \ p = art_new(type, 1); \ + if (!p) error("Cannot allocate memory for art data"); \ } \ } while (0) diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index 9235ec2fcf..b9ce5f7e00 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -321,6 +321,8 @@ ArtBpath *VectorImage::storeBez(ArtBpath *bez, int lineStyle, int fillStyle0, in bez[*bezNodes].code = ART_END; ArtBpath *bez1 = art_new(ArtBpath, *bezNodes + 1); + if (!bez1) + error("[VectorImage::storeBez] Cannot allocate memory"); for (int i = 0; i <= *bezNodes; i++) bez1[i] = bez[i]; diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp index 97dad3346d..6d4dc213f2 100644 --- a/engines/sword25/gfx/image/vectorimagerenderer.cpp +++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp @@ -270,6 +270,9 @@ ArtVpath *art_vpath_cat(ArtVpath *a, ArtVpath *b) { len_a = art_vpath_len(a); len_b = art_vpath_len(b); dest = art_new(ArtVpath, len_a + len_b + 1); + if (!dest) + error("[art_vpath_cat] Cannot allocate memory"); + p = dest; for (int i = 0; i < len_a; i++) @@ -299,6 +302,8 @@ ArtVpath *art_vpath_reverse(ArtVpath *a) { len = art_vpath_len(a); dest = art_new(ArtVpath, len + 1); + if (!dest) + error("[art_vpath_reverse] Cannot allocate memory"); for (i = 0; i < len; i++) { it = a[len - i - 1]; @@ -371,6 +376,8 @@ void drawBez(ArtBpath *bez1, ArtBpath *bez2, byte *buffer, int width, int height int size = art_vpath_len(vec); ArtVpath *vect = art_new(ArtVpath, size + 1); + if (!vect) + error("[drawBez] Cannot allocate memory"); int k; for (k = 0; k < size; k++) { diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h index c57c30636d..b0c6718008 100644 --- a/engines/sword25/package/packagemanager.h +++ b/engines/sword25/package/packagemanager.h @@ -141,6 +141,9 @@ public: uint fileSize; char *data = (char *)getFile(fileName, &fileSize); char *result = (char *)malloc(fileSize + strlen(versionStr) + 1); + if (!result) + error("[PackageManager::getXmlFile] Cannot allocate memory"); + strcpy(result, versionStr); Common::copy(data, data + fileSize, result + strlen(versionStr)); result[fileSize + strlen(versionStr)] = '\0'; -- cgit v1.2.3 From 92f4b7c611f0c317805e79a62ed883614572d9dd Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 23 Jun 2011 10:27:54 +0200 Subject: BASE: Fix build, and error handling in DO_OPTION_INT. This fixes the logic of 979fc29b (I hope) and includes some missing headers. --- base/commandLine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 6d187ac8b1..6cb858525e 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -25,6 +25,9 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_exit +#include +#include + #include "engines/metaengine.h" #include "base/commandLine.h" #include "base/plugins.h" @@ -267,8 +270,9 @@ void registerDefaults() { #define DO_OPTION_INT(shortCmd, longCmd) \ DO_OPTION(shortCmd, longCmd) \ char *endptr = 0; \ + errno = 0; \ long int retval = strtol(option, &endptr, 0); \ - if (endptr == NULL || *endptr != 0 || retval == 0 || retval == LONG_MAX || retval == LONG_MIN || errno == ERANGE) \ + if (endptr == NULL || *endptr != 0 || (errno != 0 && retval == 0) || (errno == ERANGE && (retval == LONG_MAX || retval == LONG_MIN))) \ usage("--%s: Invalid number '%s'", longCmd, option); // Use this for boolean options; this distinguishes between "-x" and "-X", -- cgit v1.2.3 From c4a5fa85069e2363e4e0e11f84d333b5fbd39caf Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 23 Jun 2011 11:40:19 +0300 Subject: CREDITS: Add real name of serga per his request --- AUTHORS | 2 +- devtools/credits.pl | 2 +- gui/credits.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6492b4781d..e998390a12 100644 --- a/AUTHORS +++ b/AUTHORS @@ -452,7 +452,7 @@ Other contributions Tim Phillips - Initial MI1 CD music support Quietust - Sound support for Amiga SCUMM V2/V3 games, MM NES support - segra - Improved support for Apple II/C64 versions of MM + Robert Crossfield - Improved support for Apple II/C64 versions of MM Andreas Roever - Broken Sword I & II MPEG2 cutscene support Edward Rudd - Fixes for playing MP3 versions of MI1/Loom audio Daniel Schepler - Final MI1 CD music support, initial Ogg Vorbis diff --git a/devtools/credits.pl b/devtools/credits.pl index 48ce5e28e7..de669184e1 100755 --- a/devtools/credits.pl +++ b/devtools/credits.pl @@ -971,7 +971,7 @@ begin_credits("Credits"); add_person("Nicolas Noble", "pixels", "Config file and ALSA support"); add_person("Tim Phillips", "realmz", "Initial MI1 CD music support"); add_person("", "Quietust", "Sound support for Amiga SCUMM V2/V3 games, MM NES support"); - add_person("", "segra", "Improved support for Apple II/C64 versions of MM"); + add_person("Robert Crossfield", "segra", "Improved support for Apple II/C64 versions of MM"); add_person("Andreas Röver", "", "Broken Sword I & II MPEG2 cutscene support"); add_person("Edward Rudd", "urkle", "Fixes for playing MP3 versions of MI1/Loom audio"); add_person("Daniel Schepler", "dschepler", "Final MI1 CD music support, initial Ogg Vorbis support"); diff --git a/gui/credits.h b/gui/credits.h index 5bc6d56ff4..91ed2cb26a 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -529,7 +529,7 @@ static const char *credits[] = { "C2""Initial MI1 CD music support", "C0""Quietust", "C2""Sound support for Amiga SCUMM V2/V3 games, MM NES support", -"C0""segra", +"C0""Robert Crossfield", "C2""Improved support for Apple II/C64 versions of MM", "C0""Andreas R\366ver", "C2""Broken Sword I & II MPEG2 cutscene support", -- cgit v1.2.3 From 97137e6b27a6d64fc2ba45c0c6d1a07d027ee27c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Jun 2011 23:40:25 +1000 Subject: TSAGE: Added saving/restoring of playing sounds to savegames --- engines/tsage/saveload.cpp | 6 ++- engines/tsage/saveload.h | 2 +- engines/tsage/scenes.cpp | 6 ++- engines/tsage/sound.cpp | 93 ++++++++++++++++++++++++++++++++++++++++------ engines/tsage/sound.h | 13 ++++--- 5 files changed, 100 insertions(+), 20 deletions(-) diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 522e40c236..b184e59c9e 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -21,11 +21,13 @@ */ #include "common/savefile.h" +#include "common/mutex.h" #include "graphics/palette.h" #include "graphics/scaler.h" #include "graphics/thumbnail.h" #include "tsage/globals.h" #include "tsage/saveload.h" +#include "tsage/sound.h" #include "tsage/tsage.h" namespace tSage { @@ -105,6 +107,7 @@ void Serializer::validate(int v, Common::Serializer::Version minVersion, Common::Error Saver::save(int slot, const Common::String &saveName) { assert(!getMacroRestoreFlag()); + Common::StackLock slock1(_globals->_soundManager._serverDisabledMutex); // Signal any objects registered for notification _saveNotifiers.notify(false); @@ -149,6 +152,7 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { Common::Error Saver::restore(int slot) { assert(!getMacroRestoreFlag()); + Common::StackLock slock1(_globals->_soundManager._serverDisabledMutex); // Signal any objects registered for notification _loadNotifiers.notify(false); @@ -205,7 +209,7 @@ Common::Error Saver::restore(int slot) { // Final post-restore notifications _macroRestoreFlag = false; - _loadNotifiers.notify(false); + _loadNotifiers.notify(true); return Common::kNoError; } diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index c1c2851f28..0382e4a1fc 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -33,7 +33,7 @@ namespace tSage { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 5 +#define TSAGE_SAVEGAME_VERSION 6 class SavedObject; diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 6352918e39..18b3da2698 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -235,7 +235,11 @@ void SceneManager::listenerSynchronize(Serializer &s) { if (s.isLoading()) { changeScene(_sceneNumber); - checkScene(); + + if (_nextSceneNumber != -1) { + sceneChange(); + _nextSceneNumber = -1; + } } _globals->_sceneManager._scrollerRect.synchronize(s); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index dc7b6599ed..6f061862dc 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -44,7 +44,6 @@ SoundManager::SoundManager() { _groupsAvail = 0; _newVolume = _masterVol = 127; - _suspendedCount = 0; _driversDetected = false; _needToRethink = false; @@ -53,6 +52,8 @@ SoundManager::SoundManager() { SoundManager::~SoundManager() { if (__sndmgrReady) { + Common::StackLock slock(_serverDisabledMutex); + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ) { Sound *s = *i; ++i; @@ -342,6 +343,18 @@ void SoundManager::_sfSoundServer() { if (sfManager()._newVolume != sfManager()._masterVol) _sfSetMasterVol(sfManager()._newVolume); + // If a time index has been set for any sound, fast forward to it + SynchronizedList::iterator i; + for (i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) { + Sound *s = *i; + if (s->_newTimeIndex != 0) { + s->mute(true); + s->_soSetTimeIndex(s->_newTimeIndex); + s->mute(false); + s->_newTimeIndex = 0; + } + } + // Handle any fading if necessary _sfProcessFading(); @@ -474,7 +487,7 @@ void SoundManager::saveNotifier(bool postFlag) { } void SoundManager::saveNotifierProc(bool postFlag) { - warning("TODO: SoundManager::saveNotifierProc"); + // Nothing needs to be done when saving the game } void SoundManager::loadNotifier(bool postFlag) { @@ -482,12 +495,37 @@ void SoundManager::loadNotifier(bool postFlag) { } void SoundManager::loadNotifierProc(bool postFlag) { - warning("TODO: SoundManager::loadNotifierProc"); + if (!postFlag) { + // Stop any currently playing sounds + if (__sndmgrReady) { + Common::StackLock slock(_serverDisabledMutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ) { + Sound *s = *i; + ++i; + s->stop(); + } + } + } else { + // Savegame is now loaded, so iterate over the sound list to prime any sounds as necessary + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + Sound *s = *i; + s->orientAfterRestore(); + } + } } void SoundManager::listenerSynchronize(Serializer &s) { s.validate("SoundManager"); - warning("TODO: SoundManager listenerSynchronise"); + assert(__sndmgrReady && _driversDetected); + + if (s.getVersion() < 6) + return; + + Common::StackLock slock(_serverDisabledMutex); + _playList.synchronize(s); + + _soundList.synchronize(s); } /*--------------------------------------------------------------------------*/ @@ -1188,7 +1226,7 @@ void SoundManager::_sfUpdateVolume(Sound *sound) { } void SoundManager::_sfDereferenceAll() { - // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed + // Orignal used handles for both the driver list and voiceTypeStructPtrs list. This method then refreshed // pointer lists based on the handles. Since in ScummVM we're just using pointers directly, this // method doesn't need any implementation } @@ -1379,6 +1417,7 @@ Sound::Sound() { _fadeCounter = 0; _stopAfterFadeFlag = false; _timer = 0; + _newTimeIndex = 0; _loopTimer = 0; _trackInfo._numTracks = 0; _primed = false; @@ -1411,6 +1450,36 @@ Sound::~Sound() { stop(); } +void Sound::synchronize(Serializer &s) { + if (s.getVersion() < 6) + return; + + assert(!_remoteReceiver); + + s.syncAsSint16LE(_soundResID); + s.syncAsByte(_primed); + s.syncAsByte(_stoppedAsynchronously); + s.syncAsSint16LE(_group); + s.syncAsSint16LE(_sndResPriority); + s.syncAsSint16LE(_fixedPriority); + s.syncAsSint16LE(_sndResLoop); + s.syncAsSint16LE(_fixedLoop); + s.syncAsSint16LE(_priority); + s.syncAsSint16LE(_volume); + s.syncAsSint16LE(_loop); + s.syncAsSint16LE(_pausedCount); + s.syncAsSint16LE(_mutedCount); + s.syncAsSint16LE(_hold); + s.syncAsSint16LE(_cueValue); + s.syncAsSint16LE(_fadeDest); + s.syncAsSint16LE(_fadeSteps); + s.syncAsUint32LE(_fadeTicks); + s.syncAsUint32LE(_fadeCounter); + s.syncAsByte(_stopAfterFadeFlag); + s.syncAsUint32LE(_timer); + s.syncAsSint16LE(_loopTimer); +} + void Sound::play(int soundNum) { prime(soundNum); _soundManager->addToPlayList(this); @@ -1436,6 +1505,7 @@ void Sound::_prime(int soundResID, bool dontQueue) { if (_primed) unPrime(); + _soundResID = soundResID; if (_soundResID != -1) { // Sound number specified _isEmpty = false; @@ -1501,12 +1571,13 @@ void Sound::orientAfterDriverChange() { _trackInfo._numTracks = 0; _primed = false; _prime(_soundResID, true); + setTimeIndex(timeIndex); } } void Sound::orientAfterRestore() { - if (_isEmpty) { + if (!_isEmpty) { int timeIndex = getTimeIndex(); _primed = false; _prime(_soundResID, true); @@ -1585,11 +1656,8 @@ void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeF } void Sound::setTimeIndex(uint32 timeIndex) { - if (_primed) { - mute(true); - _soSetTimeIndex(timeIndex); - mute(false); - } + if (_primed) + _newTimeIndex = timeIndex; } uint32 Sound::getTimeIndex() const { @@ -1665,6 +1733,7 @@ void Sound::_soPrimeSound(bool dontQueue) { } _timer = 0; + _newTimeIndex = 0; _loopTimer = 0; _soPrimeChannelData(); } @@ -1685,6 +1754,8 @@ void Sound::_soSetTimeIndex(uint timeIndex) { _soundManager->_needToRethink = true; break; } + + --timeIndex; } _soundManager->_soTimeIndexFlag = false; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 9a8cfb3cfc..4647e3c564 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -123,7 +123,6 @@ struct VoiceStructEntryType0 { int _channelNum3; int _priority3; int _field1A; - int _field1B; }; struct VoiceStructEntryType1 { @@ -166,7 +165,7 @@ private: public: bool __sndmgrReady; int _ourSndResVersion, _ourDrvResVersion; - Common::List _playList; + SynchronizedList _playList; Common::List _installedDrivers; VoiceTypeStruct *_voiceTypeStructPtrs[SOUND_ARR_SIZE]; uint32 _groupsAvail; @@ -174,9 +173,8 @@ public: int _newVolume; Common::Mutex _serverDisabledMutex; Common::Mutex _serverSuspendedMutex; - int _suspendedCount; bool _driversDetected; - Common::List _soundList; + SynchronizedList _soundList; Common::List _availableDrivers; bool _needToRethink; // Misc flags @@ -255,7 +253,6 @@ class Sound: public EventHandler { private: void _prime(int soundResID, bool dontQueue); void _unPrime(); - void orientAfterRestore(); public: bool _stoppedAsynchronously; int _soundResID; @@ -276,7 +273,8 @@ public: int _fadeTicks; int _fadeCounter; bool _stopAfterFadeFlag; - uint _timer; + uint32 _timer; + uint32 _newTimeIndex; int _loopTimer; int _chProgram[SOUND_ARR_SIZE]; int _chModulation[SOUND_ARR_SIZE]; @@ -306,6 +304,9 @@ public: Sound(); ~Sound(); + void synchronize(Serializer &s); + void orientAfterRestore(); + void play(int soundResID); void stop(); void prime(int soundResID); -- cgit v1.2.3 From f0cf72f4313c146dcec25fa004312a4319b89b91 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 22 Jun 2011 23:32:14 -0400 Subject: LASTEXPRESS: Move Menu class to a separate folder --- engines/lastexpress/entities/chapters.cpp | 3 +- engines/lastexpress/game/inventory.cpp | 3 +- engines/lastexpress/game/logic.cpp | 3 +- engines/lastexpress/game/menu.cpp | 1542 ----------------------------- engines/lastexpress/game/menu.h | 207 ---- engines/lastexpress/game/savegame.cpp | 3 +- engines/lastexpress/lastexpress.cpp | 3 +- engines/lastexpress/menu/menu.cpp | 1542 +++++++++++++++++++++++++++++ engines/lastexpress/menu/menu.h | 207 ++++ engines/lastexpress/module.mk | 2 +- 10 files changed, 1760 insertions(+), 1755 deletions(-) delete mode 100644 engines/lastexpress/game/menu.cpp delete mode 100644 engines/lastexpress/game/menu.h create mode 100644 engines/lastexpress/menu/menu.cpp create mode 100644 engines/lastexpress/menu/menu.h diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index 1252a62d8d..6a41590f64 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -57,13 +57,14 @@ #include "lastexpress/game/entities.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" -#include "lastexpress/game/menu.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/menu/menu.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index adf6ff772e..07ad8d936b 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -27,11 +27,12 @@ #include "lastexpress/data/snd.h" #include "lastexpress/game/logic.h" -#include "lastexpress/game/menu.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/menu/menu.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index a8a2ce87b1..3bd7d6da68 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -38,7 +38,6 @@ #include "lastexpress/game/beetle.h" #include "lastexpress/game/entities.h" #include "lastexpress/game/inventory.h" -#include "lastexpress/game/menu.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" @@ -46,6 +45,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/menu/menu.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/game/menu.cpp b/engines/lastexpress/game/menu.cpp deleted file mode 100644 index 27a43d8f61..0000000000 --- a/engines/lastexpress/game/menu.cpp +++ /dev/null @@ -1,1542 +0,0 @@ -/* 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 "lastexpress/game/menu.h" - -// Data -#include "lastexpress/data/animation.h" -#include "lastexpress/data/cursor.h" -#include "lastexpress/data/snd.h" -#include "lastexpress/data/scene.h" - -#include "lastexpress/fight/fight.h" - -#include "lastexpress/game/inventory.h" -#include "lastexpress/game/logic.h" -#include "lastexpress/game/savegame.h" -#include "lastexpress/game/savepoint.h" -#include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" -#include "lastexpress/game/state.h" - -#include "lastexpress/graphics.h" -#include "lastexpress/helpers.h" -#include "lastexpress/lastexpress.h" -#include "lastexpress/resource.h" - -#include "common/rational.h" - -#define getNextGameId() (GameId)((_gameId + 1) % 6) - -namespace LastExpress { - -// Bottom-left buttons (quit.seq) -enum StartMenuButtons { - kButtonVolumeDownPushed, - kButtonVolumeDown, - kButtonVolume, - kButtonVolumeUp, - kButtonVolumeUpPushed, - kButtonBrightnessDownPushed, // 5 - kButtonBrightnessDown, - kButtonBrightness, - kButtonBrightnessUp, - kButtonBrightnessUpPushed, - kButtonQuit, // 10 - kButtonQuitPushed -}; - -// Egg buttons (buttns.seq) -enum StartMenuEggButtons { - kButtonShield, - kButtonRewind, - kButtonRewindPushed, - kButtonForward, - kButtonForwardPushed, - kButtonCredits, // 5 - kButtonCreditsPushed, - kButtonContinue -}; - -// Tooltips sequence (helpnewr.seq) -enum StartMenuTooltips { - kTooltipInsertCd1, - kTooltipInsertCd2, - kTooltipInsertCd3, - kTooltipContinueGame, - kTooltipReplayGame, - kTooltipContinueRewoundGame, // 5 - kTooltipViewGameEnding, - kTooltipStartAnotherGame, - kTooltipVolumeUp, - kTooltipVolumeDown, - kTooltipBrightnessUp, // 10 - kTooltipBrightnessDown, - kTooltipQuit, - kTooltipRewindParis, - kTooltipForwardStrasbourg, - kTooltipRewindStrasbourg, // 15 - kTooltipRewindMunich, - kTooltipForwardMunich, - kTooltipForwardVienna, - kTooltipRewindVienna, - kTooltipRewindBudapest, // 20 - kTooltipForwardBudapest, - kTooltipForwardBelgrade, - kTooltipRewindBelgrade, - kTooltipForwardConstantinople, - kTooltipSwitchBlueGame, // 25 - kTooltipSwitchRedGame, - kTooltipSwitchGoldGame, - kTooltipSwitchGreenGame, - kTooltipSwitchTealGame, - kTooltipSwitchPurpleGame, // 30 - kTooltipPlayNewGame, - kTooltipCredits, - kTooltipFastForward, - kTooltipRewind -}; - -////////////////////////////////////////////////////////////////////////// -// DATA -////////////////////////////////////////////////////////////////////////// - -// Information about the cities on the train line -static const struct { - uint8 frame; - TimeValue time; -} _trainCities[31] = { - {0, kTimeCityParis}, - {9, kTimeCityEpernay}, - {11, kTimeCityChalons}, - {16, kTimeCityBarLeDuc}, - {21, kTimeCityNancy}, - {25, kTimeCityLuneville}, - {35, kTimeCityAvricourt}, - {37, kTimeCityDeutschAvricourt}, - {40, kTimeCityStrasbourg}, - {53, kTimeCityBadenOos}, - {56, kTimeCityKarlsruhe}, - {60, kTimeCityStuttgart}, - {63, kTimeCityGeislingen}, - {66, kTimeCityUlm}, - {68, kTimeCityAugsburg}, - {73, kTimeCityMunich}, - {84, kTimeCitySalzbourg}, - {89, kTimeCityAttnangPuchheim}, - {97, kTimeCityWels}, - {100, kTimeCityLinz}, - {104, kTimeCityAmstetten}, - {111, kTimeCityVienna}, - {120, kTimeCityPoszony}, - {124, kTimeCityGalanta}, - {132, kTimeCityBudapest}, - {148, kTimeCityBelgrade}, - /* Line 1 ends at 150 - line 2 begins at 0 */ - {157, kTimeCityNish}, - {165, kTimeCityTzaribrod}, - {174, kTimeCitySofia}, - {198, kTimeCityAdrianople}, - {210, kTimeCityConstantinople}}; - -static const struct { - TimeValue time; - uint index; - StartMenuTooltips rewind; - StartMenuTooltips forward; -} _cityButtonsInfo[7] = { - {kTimeCityParis, 64, kTooltipRewindParis, kTooltipRewindParis}, - {kTimeCityStrasbourg, 128, kTooltipRewindStrasbourg, kTooltipForwardStrasbourg}, - {kTimeCityMunich, 129, kTooltipRewindMunich, kTooltipForwardMunich}, - {kTimeCityVienna, 130, kTooltipRewindVienna, kTooltipForwardVienna}, - {kTimeCityBudapest, 131, kTooltipRewindBudapest, kTooltipForwardBudapest}, - {kTimeCityBelgrade, 132, kTooltipRewindBelgrade, kTooltipForwardBelgrade}, - {kTimeCityConstantinople, 192, kTooltipForwardConstantinople, kTooltipForwardConstantinople} -}; - -////////////////////////////////////////////////////////////////////////// -// Clock -////////////////////////////////////////////////////////////////////////// -class Clock { -public: - explicit Clock(LastExpressEngine *engine); - ~Clock(); - - void draw(uint32 time); - void clear(); - -private: - LastExpressEngine *_engine; - - // Frames - SequenceFrame *_frameMinutes; - SequenceFrame *_frameHour; - SequenceFrame *_frameSun; - SequenceFrame *_frameDate; -}; - -Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) { - _frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true); - _frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true); - _frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true); - _frameDate = new SequenceFrame(loadSequence("datenew.seq"), 0, true); -} - -Clock::~Clock() { - SAFE_DELETE(_frameMinutes); - SAFE_DELETE(_frameHour); - SAFE_DELETE(_frameSun); - SAFE_DELETE(_frameDate); - - // Zero passed pointers - _engine = NULL; -} - -void Clock::clear() { - getScenes()->removeFromQueue(_frameMinutes); - getScenes()->removeFromQueue(_frameHour); - getScenes()->removeFromQueue(_frameSun); - getScenes()->removeFromQueue(_frameDate); -} - -void Clock::draw(uint32 time) { - assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); - - // Check that sequences have been loaded - if (!_frameMinutes || !_frameHour || !_frameSun || !_frameDate) - error("Clock::process: clock sequences have not been loaded correctly!"); - - // Clear existing frames - clear(); - - // Game starts at: 1037700 = 7:13 p.m. on July 24, 1914 - // Game ends at: 4941000 = 7:30 p.m. on July 26, 1914 - // Game lasts for: 3903300 = 2 days + 17 mins = 2897 mins - - // 15 = 1 second - // 15 * 60 = 900 = 1 minute - // 900 * 60 = 54000 = 1 hour - // 54000 * 24 = 1296000 = 1 day - - // Calculate each sequence index from the current time - - uint8 hour = 0; - uint8 minute = 0; - State::getHourMinutes(time, &hour, &minute); - uint32 index_date = 18 * time / 1296000; - if (hour == 23) - index_date += 18 * minute / 60; - - // Set sequences frames - _frameMinutes->setFrame(minute); - _frameHour->setFrame((5 * hour + minute / 12) % 60); - _frameSun->setFrame((5 * hour + minute / 12) % 120); - _frameDate->setFrame((uint16)index_date); - - // Adjust z-order and queue - _frameMinutes->getInfo()->location = 1; - _frameHour->getInfo()->location = 1; - _frameSun->getInfo()->location = 1; - _frameDate->getInfo()->location = 1; - - getScenes()->addToQueue(_frameMinutes); - getScenes()->addToQueue(_frameHour); - getScenes()->addToQueue(_frameSun); - getScenes()->addToQueue(_frameDate); -} - -////////////////////////////////////////////////////////////////////////// -// TrainLine -////////////////////////////////////////////////////////////////////////// -class TrainLine { -public: - explicit TrainLine(LastExpressEngine *engine); - ~TrainLine(); - - void draw(uint32 time); - void clear(); - -private: - LastExpressEngine *_engine; - - // Frames - SequenceFrame *_frameLine1; - SequenceFrame *_frameLine2; -}; - -TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) { - _frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true); - _frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true); -} - -TrainLine::~TrainLine() { - SAFE_DELETE(_frameLine1); - SAFE_DELETE(_frameLine2); - - // Zero passed pointers - _engine = NULL; -} - -void TrainLine::clear() { - getScenes()->removeFromQueue(_frameLine1); - getScenes()->removeFromQueue(_frameLine2); -} - -// Draw the train line at the time -// line1: 150 frames (=> Belgrade) -// line2: 61 frames (=> Constantinople) -void TrainLine::draw(uint32 time) { - assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); - - // Check that sequences have been loaded - if (!_frameLine1 || !_frameLine2) - error("TrainLine::process: Line sequences have not been loaded correctly!"); - - // Clear existing frames - clear(); - - // Get the index of the last city the train has visited - uint index = 0; - for (uint i = 0; i < ARRAYSIZE(_trainCities); i++) - if ((uint32)_trainCities[i].time <= time) - index = i; - - uint16 frame; - if (time > (uint32)_trainCities[index].time) { - // Interpolate linearly to use a frame between the cities - uint8 diffFrames = _trainCities[index + 1].frame - _trainCities[index].frame; - uint diffTimeCities = (uint)(_trainCities[index + 1].time - _trainCities[index].time); - uint traveledTime = (time - (uint)_trainCities[index].time); - frame = (uint16)(_trainCities[index].frame + (traveledTime * diffFrames) / diffTimeCities); - } else { - // Exactly on the city - frame = _trainCities[index].frame; - } - - // Set frame, z-order and queue - if (frame < 150) { - _frameLine1->setFrame(frame); - - _frameLine1->getInfo()->location = 1; - getScenes()->addToQueue(_frameLine1); - } else { - // We passed Belgrade - _frameLine1->setFrame(149); - _frameLine2->setFrame(frame - 150); - - _frameLine1->getInfo()->location = 1; - _frameLine2->getInfo()->location = 1; - - getScenes()->addToQueue(_frameLine1); - getScenes()->addToQueue(_frameLine2); - } -} - - -////////////////////////////////////////////////////////////////////////// -// Menu -////////////////////////////////////////////////////////////////////////// -Menu::Menu(LastExpressEngine *engine) : _engine(engine), - _seqTooltips(NULL), _seqEggButtons(NULL), _seqButtons(NULL), _seqAcorn(NULL), _seqCity1(NULL), _seqCity2(NULL), _seqCity3(NULL), _seqCredits(NULL), - _gameId(kGameBlue), _hasShownStartScreen(false), _hasShownIntro(false), - _isShowingCredits(false), _isGameStarted(false), _isShowingMenu(false), - _creditsSequenceIndex(0), _checkHotspotsTicks(15), _mouseFlags(Common::EVENT_INVALID), _lastHotspot(NULL), - _currentTime(kTimeNone), _lowerTime(kTimeNone), _time(kTimeNone), _currentIndex(0), _index(0), _lastIndex(0), _delta(0), _handleTimeDelta(false) { - - _clock = new Clock(_engine); - _trainLine = new TrainLine(_engine); -} - -Menu::~Menu() { - SAFE_DELETE(_clock); - SAFE_DELETE(_trainLine); - - SAFE_DELETE(_seqTooltips); - SAFE_DELETE(_seqEggButtons); - SAFE_DELETE(_seqButtons); - SAFE_DELETE(_seqAcorn); - SAFE_DELETE(_seqCity1); - SAFE_DELETE(_seqCity2); - SAFE_DELETE(_seqCity3); - SAFE_DELETE(_seqCredits); - - _lastHotspot = NULL; - - // Cleanup frames - for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) - SAFE_DELETE(it->_value); - - _frames.clear(); - - // Zero passed pointers - _engine = NULL; -} - -////////////////////////////////////////////////////////////////////////// -// Setup -void Menu::setup() { - - // Clear drawing queue - getScenes()->removeAndRedraw(&_frames[kOverlayAcorn], false); - SAFE_DELETE(_seqAcorn); - - // Load Menu scene - // + 1 = normal menu with open egg / clock - // + 2 = shield menu, when no savegame exists (no game has been started) - _isGameStarted = _lowerTime >= kTimeStartGame; - getScenes()->loadScene((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)); - getFlags()->shouldRedraw = true; - getLogic()->updateCursor(); - - ////////////////////////////////////////////////////////////////////////// - // Load Acorn sequence - _seqAcorn = loadSequence(getAcornSequenceName(_isGameStarted ? getNextGameId() : kGameBlue)); - - ////////////////////////////////////////////////////////////////////////// - // Check if we loaded sequences before - if (_seqTooltips && _seqTooltips->count() > 0) - return; - - // Load all static data - _seqTooltips = loadSequence("helpnewr.seq"); - _seqEggButtons = loadSequence("buttns.seq"); - _seqButtons = loadSequence("quit.seq"); - _seqCity1 = loadSequence("jlinetl.seq"); - _seqCity2 = loadSequence("jlinecen.seq"); - _seqCity3 = loadSequence("jlinebr.seq"); - _seqCredits = loadSequence("credits.seq"); - - _frames[kOverlayTooltip] = new SequenceFrame(_seqTooltips); - _frames[kOverlayEggButtons] = new SequenceFrame(_seqEggButtons); - _frames[kOverlayButtons] = new SequenceFrame(_seqButtons); - _frames[kOverlayAcorn] = new SequenceFrame(_seqAcorn); - _frames[kOverlayCity1] = new SequenceFrame(_seqCity1); - _frames[kOverlayCity2] = new SequenceFrame(_seqCity2); - _frames[kOverlayCity3] = new SequenceFrame(_seqCity3); - _frames[kOverlayCredits] = new SequenceFrame(_seqCredits); -} - -////////////////////////////////////////////////////////////////////////// -// Handle events -void Menu::eventMouse(const Common::Event &ev) { - if (!getFlags()->shouldRedraw) - return; - - bool redraw = true; - getFlags()->shouldRedraw = false; - - // Update coordinates - setCoords(ev.mouse); - //_mouseFlags = (Common::EventType)(ev.type & Common::EVENT_LBUTTONUP); - - if (_isShowingCredits) { - if (ev.type == Common::EVENT_RBUTTONUP) { - showFrame(kOverlayCredits, -1, true); - _isShowingCredits = false; - } - - if (ev.type == Common::EVENT_LBUTTONUP) { - // Last frame of the credits - if (_seqCredits && _creditsSequenceIndex == _seqCredits->count() - 1) { - showFrame(kOverlayCredits, -1, true); - _isShowingCredits = false; - } else { - ++_creditsSequenceIndex; - showFrame(kOverlayCredits, _creditsSequenceIndex, true); - } - } - } else { - // Check for hotspots - SceneHotspot *hotspot = NULL; - getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot); - - if (_lastHotspot != hotspot || ev.type == Common::EVENT_LBUTTONUP) { - _lastHotspot = hotspot; - - if (ev.type == Common::EVENT_MOUSEMOVE) { /* todo check event type */ - if (!_handleTimeDelta && hasTimeDelta()) - setTime(); - } - - if (hotspot) { - redraw = handleEvent((StartMenuAction)hotspot->action, ev.type); - getFlags()->mouseRightClick = false; - getFlags()->mouseLeftClick = false; - } else { - hideOverlays(); - } - } - } - - if (redraw) { - getFlags()->shouldRedraw = true; - askForRedraw(); - } -} - -void Menu::eventTick(const Common::Event&) { - if (hasTimeDelta()) - adjustTime(); - else if (_handleTimeDelta) - _handleTimeDelta = false; - - // Check hotspots - if (!--_checkHotspotsTicks) { - checkHotspots(); - _checkHotspotsTicks = 15; - } -} - -////////////////////////////////////////////////////////////////////////// -// Show the intro and load the main menu scene -void Menu::show(bool doSavegame, SavegameType type, uint32 value) { - - if (_isShowingMenu) - return; - - _isShowingMenu = true; - getEntities()->reset(); - - // If no blue savegame exists, this might be the first time we start the game, so we show the full intro - if (!getFlags()->mouseRightClick) { - if (!SaveLoad::isSavegameValid(kGameBlue) && _engine->getResourceManager()->loadArchive(kArchiveCd1)) { - - if (!_hasShownIntro) { - // Show Broderbrund logo - Animation animation; - if (animation.load(getArchive("1930.nis"))) - animation.play(); - - getFlags()->mouseRightClick = false; - - // Play intro music - getSound()->playSoundWithSubtitles("MUS001.SND", SoundManager::kFlagMusic, kEntityPlayer); - - // Show The Smoking Car logo - if (animation.load(getArchive("1931.nis"))) - animation.play(); - - _hasShownIntro = true; - } - } else { - // Only show the quick intro - if (!_hasShownStartScreen) { - getSound()->playSoundWithSubtitles("MUS018.SND", SoundManager::kFlagMusic, kEntityPlayer); - getScenes()->loadScene(kSceneStartScreen); - - // Original game waits 60 frames and loops Sound::unknownFunction1 unless the right button is pressed - uint32 nextFrameCount = getFrameCount() + 60; - while (getFrameCount() < nextFrameCount) { - _engine->pollEvents(); - - if (getFlags()->mouseRightClick) - break; - - getSound()->updateQueue(); - } - } - } - } - - _hasShownStartScreen = true; - - // Init Menu - init(doSavegame, type, value); - - // Setup sound - getSound()->unknownFunction4(); - getSound()->resetQueue(SoundManager::kSoundType11, SoundManager::kSoundType13); - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); - - // Init flags & misc - _isShowingCredits = false; - _handleTimeDelta = hasTimeDelta(); - getInventory()->unselectItem(); - - // Set Cursor type - _engine->getCursor()->setStyle(kCursorNormal); - _engine->getCursor()->show(true); - - setup(); - checkHotspots(); - - // Set event handlers - SET_EVENT_HANDLERS(Menu, this); -} - -bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { - bool clicked = (type == Common::EVENT_LBUTTONUP); - - switch(action) { - default: - hideOverlays(); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuCredits: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - if (clicked) { - showFrame(kOverlayEggButtons, kButtonCreditsPushed, true); - showFrame(kOverlayTooltip, -1, true); - - getSound()->playSound(kEntityPlayer, "LIB046"); - - hideOverlays(); - - _isShowingCredits = true; - _creditsSequenceIndex = 0; - - showFrame(kOverlayCredits, 0, true); - } else { - // TODO check flags ? - - showFrame(kOverlayEggButtons, kButtonCredits, true); - showFrame(kOverlayTooltip, kTooltipCredits, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuQuitGame: - showFrame(kOverlayTooltip, kTooltipQuit, true); - - if (clicked) { - showFrame(kOverlayButtons, kButtonQuitPushed, true); - - getSound()->clearStatus(); - getSound()->updateQueue(); - getSound()->playSound(kEntityPlayer, "LIB046"); - - // FIXME uncomment when sound queue is properly implemented - /*while (getSound()->isBuffered("LIB046")) - getSound()->updateQueue();*/ - - getFlags()->shouldRedraw = false; - - Engine::quitGame(); - - return false; - } else { - showFrame(kOverlayButtons, kButtonQuit, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuCase4: - if (clicked) - _index = 0; - // fall down to kMenuContinue - - ////////////////////////////////////////////////////////////////////////// - case kMenuContinue: { - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - // Determine the proper CD archive - ArchiveIndex cd = kArchiveCd1; - if (getProgress().chapter > kChapter1) - cd = (getProgress().chapter > kChapter3) ? kArchiveCd3 : kArchiveCd2; - - // Show tooltips & buttons to start a game, continue a game or load the proper cd - if (ResourceManager::isArchivePresent(cd)) { - if (_isGameStarted) { - showFrame(kOverlayEggButtons, kButtonContinue, true); - - if (_lastIndex == _index) { - showFrame(kOverlayTooltip, getSaveLoad()->isGameFinished(_index, _lastIndex) ? kTooltipViewGameEnding : kTooltipContinueGame, true); - } else { - showFrame(kOverlayTooltip, kTooltipContinueRewoundGame, true); - } - - } else { - showFrame(kOverlayEggButtons, kButtonShield, true); - showFrame(kOverlayTooltip, kTooltipPlayNewGame, true); - } - } else { - showFrame(kOverlayEggButtons, -1, true); - showFrame(kOverlayTooltip, cd - 1, true); - } - - if (!clicked) - break; - - // Try loading the archive file - if (!_engine->getResourceManager()->loadArchive(cd)) - break; - - // Load the train data file and setup game - getScenes()->loadSceneDataFile(cd); - showFrame(kOverlayTooltip, -1, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - - // Setup new game - getSavePoints()->reset(); - setLogicEventHandlers(); - - if (_index) { - getSound()->processEntry(SoundManager::kSoundType11); - } else { - if (!getFlags()->mouseRightClick) { - getScenes()->loadScene((SceneIndex)(5 * _gameId + 3)); - - if (!getFlags()->mouseRightClick) { - getScenes()->loadScene((SceneIndex)(5 * _gameId + 4)); - - if (!getFlags()->mouseRightClick) { - getScenes()->loadScene((SceneIndex)(5 * _gameId + 5)); - - if (!getFlags()->mouseRightClick) { - getSound()->processEntry(SoundManager::kSoundType11); - - // Show intro - Animation animation; - if (animation.load(getArchive("1601.nis"))) - animation.play(); - - getEvent(kEventIntro) = 1; - } - } - } - } - - if (!getEvent(kEventIntro)) { - getEvent(kEventIntro) = 1; - - getSound()->processEntry(SoundManager::kSoundType11); - } - } - - // Setup game - getFlags()->isGameRunning = true; - startGame(); - - if (!_isShowingMenu) - getInventory()->show(); - - return false; - } - - ////////////////////////////////////////////////////////////////////////// - case kMenuSwitchSaveGame: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - if (clicked) { - showFrame(kOverlayAcorn, 1, true); - showFrame(kOverlayTooltip, -1, true); - getSound()->playSound(kEntityPlayer, "LIB047"); - - // Setup new menu screen - switchGame(); - setup(); - - // Set fight state to 0 - getFight()->resetState(); - - return true; - } - - // TODO Check for flag - - showFrame(kOverlayAcorn, 0, true); - - if (_isGameStarted) { - showFrame(kOverlayTooltip, kTooltipSwitchBlueGame, true); - break; - } - - if (_gameId == kGameGold) { - showFrame(kOverlayTooltip, kTooltipSwitchBlueGame, true); - break; - } - - if (!SaveLoad::isSavegameValid(getNextGameId())) { - showFrame(kOverlayTooltip, kTooltipStartAnotherGame, true); - break; - } - - // Stupid tooltips ids are not in order, so we can't just increment them... - switch(_gameId) { - default: - break; - - case kGameBlue: - showFrame(kOverlayTooltip, kTooltipSwitchRedGame, true); - break; - - case kGameRed: - showFrame(kOverlayTooltip, kTooltipSwitchGreenGame, true); - break; - - case kGameGreen: - showFrame(kOverlayTooltip, kTooltipSwitchPurpleGame, true); - break; - - case kGamePurple: - showFrame(kOverlayTooltip, kTooltipSwitchTealGame, true); - break; - - case kGameTeal: - showFrame(kOverlayTooltip, kTooltipSwitchGoldGame, true); - break; - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuRewindGame: - if (!_index || _currentTime < _time) { - hideOverlays(); - break; - } - - if (clicked) { - if (hasTimeDelta()) - _handleTimeDelta = false; - - showFrame(kOverlayEggButtons, kButtonRewindPushed, true); - showFrame(kOverlayTooltip, -1, true); - - getSound()->playSound(kEntityPlayer, "LIB046"); - - rewindTime(); - - _handleTimeDelta = false; - } else { - showFrame(kOverlayEggButtons, kButtonRewind, true); - showFrame(kOverlayTooltip, kTooltipRewind, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuForwardGame: - if (_lastIndex <= _index || _currentTime > _time) { - hideOverlays(); - break; - } - - if (clicked) { - if (hasTimeDelta()) - _handleTimeDelta = false; - - showFrame(kOverlayEggButtons, kButtonForwardPushed, true); - showFrame(kOverlayTooltip, -1, true); - - getSound()->playSound(kEntityPlayer, "LIB046"); - - forwardTime(); - - _handleTimeDelta = false; - } else { - showFrame(kOverlayEggButtons, kButtonForward, true); - showFrame(kOverlayTooltip, kTooltipFastForward, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuParis: - moveToCity(kParis, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuStrasBourg: - moveToCity(kStrasbourg, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuMunich: - moveToCity(kMunich, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuVienna: - moveToCity(kVienna, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuBudapest: - moveToCity(kBudapest, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuBelgrade: - moveToCity(kBelgrade, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuConstantinople: - moveToCity(kConstantinople, clicked); - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuDecreaseVolume: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - // Cannot decrease volume further - if (getVolume() == 0) { - showFrame(kOverlayButtons, kButtonVolume, true); - showFrame(kOverlayTooltip, -1, true); - break; - } - - showFrame(kOverlayTooltip, kTooltipVolumeDown, true); - - // Show highlight on button & adjust volume if needed - if (clicked) { - showFrame(kOverlayButtons, kButtonVolumeDownPushed, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - setVolume(getVolume() - 1); - - getSaveLoad()->saveVolumeBrightness(); - - uint32 nextFrameCount = getFrameCount() + 15; - while (nextFrameCount > getFrameCount()) { - _engine->pollEvents(); - - getSound()->updateQueue(); - } - } else { - showFrame(kOverlayButtons, kButtonVolumeDown, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuIncreaseVolume: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - // Cannot increase volume further - if (getVolume() >= 7) { - showFrame(kOverlayButtons, kButtonVolume, true); - showFrame(kOverlayTooltip, -1, true); - break; - } - - showFrame(kOverlayTooltip, kTooltipVolumeUp, true); - - // Show highlight on button & adjust volume if needed - if (clicked) { - showFrame(kOverlayButtons, kButtonVolumeUpPushed, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - setVolume(getVolume() + 1); - - getSaveLoad()->saveVolumeBrightness(); - - uint32 nextFrameCount = getFrameCount() + 15; - while (nextFrameCount > getFrameCount()) { - _engine->pollEvents(); - - getSound()->updateQueue(); - } - } else { - showFrame(kOverlayButtons, kButtonVolumeUp, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuDecreaseBrightness: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - // Cannot increase brightness further - if (getBrightness() == 0) { - showFrame(kOverlayButtons, kButtonBrightness, true); - showFrame(kOverlayTooltip, -1, true); - break; - } - - showFrame(kOverlayTooltip, kTooltipBrightnessDown, true); - - // Show highlight on button & adjust brightness if needed - if (clicked) { - showFrame(kOverlayButtons, kButtonBrightnessDownPushed, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - setBrightness(getBrightness() - 1); - - getSaveLoad()->saveVolumeBrightness(); - - // Reshow the background and frames (they will pick up the new brightness through the GraphicsManager) - _engine->getGraphicsManager()->draw(getScenes()->get((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)), GraphicsManager::kBackgroundC, true); - showFrame(kOverlayTooltip, kTooltipBrightnessDown, false); - showFrame(kOverlayButtons, kButtonBrightnessDownPushed, false); - } else { - showFrame(kOverlayButtons, kButtonBrightnessDown, true); - } - break; - - ////////////////////////////////////////////////////////////////////////// - case kMenuIncreaseBrightness: - if (hasTimeDelta()) { - hideOverlays(); - break; - } - - // Cannot increase brightness further - if (getBrightness() >= 6) { - showFrame(kOverlayButtons, kButtonBrightness, true); - showFrame(kOverlayTooltip, -1, true); - break; - } - - showFrame(kOverlayTooltip, kTooltipBrightnessUp, true); - - // Show highlight on button & adjust brightness if needed - if (clicked) { - showFrame(kOverlayButtons, kButtonBrightnessUpPushed, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - setBrightness(getBrightness() + 1); - - getSaveLoad()->saveVolumeBrightness(); - - // Reshow the background and frames (they will pick up the new brightness through the GraphicsManager) - _engine->getGraphicsManager()->draw(getScenes()->get((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)), GraphicsManager::kBackgroundC, true); - showFrame(kOverlayTooltip, kTooltipBrightnessUp, false); - showFrame(kOverlayButtons, kButtonBrightnessUpPushed, false); - } else { - showFrame(kOverlayButtons, kButtonBrightnessUp, true); - } - break; - } - - return true; -} - -void Menu::setLogicEventHandlers() { - SET_EVENT_HANDLERS(Logic, getLogic()); - clear(); - _isShowingMenu = false; -} - -////////////////////////////////////////////////////////////////////////// -// Game-related -////////////////////////////////////////////////////////////////////////// -void Menu::init(bool doSavegame, SavegameType type, uint32 value) { - - bool useSameIndex = true; - - if (getGlobalTimer()) { - value = 0; - - // Check if the CD file is present - ArchiveIndex index = kArchiveCd1; - switch (getProgress().chapter) { - default: - case kChapter1: - break; - - case kChapter2: - case kChapter3: - index = kArchiveCd2; - break; - - case kChapter4: - case kChapter5: - index = kArchiveCd3; - break; - } - - if (ResourceManager::isArchivePresent(index)) { - setGlobalTimer(0); - useSameIndex = false; - - // TODO remove existing savegame and reset index & savegame name - warning("Menu::initGame: not implemented!"); - } - - doSavegame = false; - } else { - // TODO rename saves? - } - - // Create a new savegame if needed - if (!SaveLoad::isSavegamePresent(_gameId)) - getSaveLoad()->create(_gameId); - - if (doSavegame) - getSaveLoad()->saveGame(kSavegameTypeEvent2, kEntityPlayer, kEventNone); - - if (!getGlobalTimer()) { - // TODO: remove existing savegame temp file - } - - // Init savegame & menu values - _lastIndex = getSaveLoad()->init(_gameId, true); - _lowerTime = getSaveLoad()->getTime(_lastIndex); - - if (useSameIndex) - _index = _lastIndex; - - //if (!getGlobalTimer()) - // _index3 = 0; - - if (!getProgress().chapter) - getProgress().chapter = kChapter1; - - getState()->time = (TimeValue)getSaveLoad()->getTime(_index); - getProgress().chapter = getSaveLoad()->getChapter(_index); - - if (_lowerTime >= kTimeStartGame) { - _currentTime = (uint32)getState()->time; - _time = (uint32)getState()->time; - _clock->draw(_time); - _trainLine->draw(_time); - - initTime(type, value); - } -} - -// Start a game (or load an existing savegame) -void Menu::startGame() { - // Clear savegame headers - getSaveLoad()->clear(); - - // Hide menu elements - _clock->clear(); - _trainLine->clear(); - - if (_lastIndex == _index) { - setGlobalTimer(0); - if (_index) { - getSaveLoad()->loadGame(_gameId); - } else { - getLogic()->resetState(); - getEntities()->setup(true, kEntityPlayer); - } - } else { - getSaveLoad()->loadGame(_gameId, _index); - } -} - -// Switch to the next savegame -void Menu::switchGame() { - - // Switch back to blue game is the current game is not started - _gameId = SaveLoad::isSavegameValid(_gameId) ? getNextGameId() : kGameBlue; - - // Initialize savegame if needed - if (!SaveLoad::isSavegamePresent(_gameId)) - getSaveLoad()->create(_gameId); - - getState()->time = kTimeNone; - - // Clear menu elements - _clock->clear(); - _trainLine->clear(); - - // Clear loaded savegame data - getSaveLoad()->clear(true); - - init(false, kSavegameTypeIndex, 0); -} - -////////////////////////////////////////////////////////////////////////// -// Overlays & elements -////////////////////////////////////////////////////////////////////////// -void Menu::checkHotspots() { - if (!_isShowingMenu) - return; - - if (!getFlags()->shouldRedraw) - return; - - if (_isShowingCredits) - return; - - SceneHotspot *hotspot = NULL; - getScenes()->get(getState()->scene)->checkHotSpot(getCoords(), &hotspot); - - if (hotspot) - handleEvent((StartMenuAction)hotspot->action, _mouseFlags); - else - hideOverlays(); -} - -void Menu::hideOverlays() { - _lastHotspot = NULL; - - // Hide all menu overlays - for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) - showFrame(it->_key, -1, false); - - getScenes()->drawFrames(true); -} - -void Menu::showFrame(StartMenuOverlay overlayType, int index, bool redraw) { - if (index == -1) { - getScenes()->removeFromQueue(_frames[overlayType]); - } else { - // Check that the overlay is valid - if (!_frames[overlayType]) - return; - - // Remove the frame and add a new one with the proper index - getScenes()->removeFromQueue(_frames[overlayType]); - _frames[overlayType]->setFrame((uint16)index); - getScenes()->addToQueue(_frames[overlayType]); - } - - if (redraw) - getScenes()->drawFrames(true); -} - -// Remove all frames from the queue -void Menu::clear() { - for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) - getScenes()->removeAndRedraw(&it->_value, false); - - clearBg(GraphicsManager::kBackgroundOverlay); -} - -// Get the sequence name to use for the acorn highlight, depending of the currently loaded savegame -Common::String Menu::getAcornSequenceName(GameId id) const { - Common::String name = ""; - switch (id) { - default: - case kGameBlue: - name = "aconblu3.seq"; - break; - - case kGameRed: - name = "aconred.seq"; - break; - - case kGameGreen: - name = "acongren.seq"; - break; - - case kGamePurple: - name = "aconpurp.seq"; - break; - - case kGameTeal: - name = "aconteal.seq"; - break; - - case kGameGold: - name = "acongold.seq"; - break; - } - - return name; -} - -////////////////////////////////////////////////////////////////////////// -// Time -////////////////////////////////////////////////////////////////////////// -void Menu::initTime(SavegameType type, uint32 value) { - if (!value) - return; - - // The savegame entry index - uint32 entryIndex = 0; - - switch (type) { - default: - break; - - case kSavegameTypeIndex: - entryIndex = (_index <= value) ? 1 : _index - value; - break; - - case kSavegameTypeTime: - if (value < kTimeStartGame) - break; - - entryIndex = _index; - if (!entryIndex) - break; - - // Iterate through existing entries - do { - if (getSaveLoad()->getTime(entryIndex) <= value) - break; - - entryIndex--; - } while (entryIndex); - break; - - case kSavegameTypeEvent: - entryIndex = _index; - if (!entryIndex) - break; - - do { - if (getSaveLoad()->getValue(entryIndex) == value) - break; - - entryIndex--; - } while (entryIndex); - break; - - case kSavegameTypeEvent2: - // TODO rewrite in a more legible way - if (_index > 1) { - uint32 index = _index; - do { - if (getSaveLoad()->getValue(index) == value) - break; - - index--; - } while (index > 1); - - entryIndex = index - 1; - } else { - entryIndex = _index - 1; - } - break; - } - - if (entryIndex) { - _currentIndex = entryIndex; - updateTime(getSaveLoad()->getTime(entryIndex)); - } -} - -void Menu::updateTime(uint32 time) { - if (_currentTime == _time) - _delta = 0; - - _currentTime = time; - - if (_time != time) { - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); - - getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", SoundManager::kFlagMenuClock, kEntityChapters); - adjustIndex(_currentTime, _time, false); - } -} - -void Menu::adjustIndex(uint32 time1, uint32 time2, bool searchEntry) { - uint32 index = 0; - int32 timeDelta = -1; - - if (time1 != time2) { - - index = _index; - - if (time2 >= time1) { - if (searchEntry) { - uint32 currentIndex = _index; - - if ((int32)_index >= 0) { - do { - // Calculate new delta - int32 newDelta = time1 - (uint32)getSaveLoad()->getTime(currentIndex); - - if (newDelta >= 0 && timeDelta >= newDelta) { - timeDelta = newDelta; - index = currentIndex; - } - - --currentIndex; - } while ((int32)currentIndex >= 0); - } - } else { - index = _index - 1; - } - } else { - if (searchEntry) { - uint32 currentIndex = _index; - - if (_lastIndex >= _index) { - do { - // Calculate new delta - int32 newDelta = (uint32)getSaveLoad()->getTime(currentIndex) - time1; - - if (newDelta >= 0 && timeDelta > newDelta) { - timeDelta = newDelta; - index = currentIndex; - } - - ++currentIndex; - } while (currentIndex <= _lastIndex); - } - } else { - index = _index + 1; - } - } - - _index = index; - checkHotspots(); - } - - if (_index == _currentIndex) { - if (getProgress().chapter != getSaveLoad()->getChapter(index)) - getProgress().chapter = getSaveLoad()->getChapter(_index); - } -} - -void Menu::goToTime(uint32 time) { - - uint32 entryIndex = 0; - uint32 deltaTime = (uint32)ABS((int32)(getSaveLoad()->getTime(0) - time)); - uint32 index = 0; - - do { - uint32 deltaTime2 = (uint32)ABS((int32)(getSaveLoad()->getTime(index) - time)); - if (deltaTime2 < deltaTime) { - deltaTime = deltaTime2; - entryIndex = index; - } - - ++index; - } while (_lastIndex >= index); - - _currentIndex = entryIndex; - updateTime(getSaveLoad()->getTime(entryIndex)); -} - -void Menu::setTime() { - _currentIndex = _index; - _currentTime = getSaveLoad()->getTime(_currentIndex); - - if (_time == _currentTime) - adjustTime(); -} - -void Menu::forwardTime() { - if (_lastIndex <= _index) - return; - - _currentIndex = _lastIndex; - updateTime(getSaveLoad()->getTime(_currentIndex)); -} - -void Menu::rewindTime() { - if (!_index) - return; - - _currentIndex = 0; - updateTime(getSaveLoad()->getTime(_currentIndex)); -} - -void Menu::adjustTime() { - uint32 originalTime = _time; - - // Adjust time delta - Common::Rational timeDelta(_delta >= 90 ? 9 : (9 * _delta + 89), _delta >= 90 ? 1 : 90); - - if (_currentTime < _time) { - timeDelta *= 900; - _time -= (uint)timeDelta.toInt(); - - if (_currentTime > _time) - _time = _currentTime; - } else { - timeDelta *= 900; - _time += (uint)timeDelta.toInt(); - - if (_currentTime < _time) - _time = _currentTime; - } - - if (_currentTime == _time && getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); - - _clock->draw(_time); - _trainLine->draw(_time); - getScenes()->drawFrames(true); - - adjustIndex(_time, originalTime, true); - - ++_delta; -} - -void Menu::moveToCity(CityButton city, bool clicked) { - uint32 time = (uint32)_cityButtonsInfo[city].time; - - // TODO Check if we have access (there seems to be more checks on some internal times) - probably : current_time (menu only) / game time / some other? - if (_lowerTime < time || _time == time || _currentTime == time) { - hideOverlays(); - return; - } - - // Show city overlay - showFrame((StartMenuOverlay)((_cityButtonsInfo[city].index >> 6) + 3), _cityButtonsInfo[city].index & 63, true); - - if (clicked) { - showFrame(kOverlayTooltip, -1, true); - getSound()->playSound(kEntityPlayer, "LIB046"); - goToTime(time); - - _handleTimeDelta = true; - - return; - } - - // Special case of first and last cities - if (city == kParis || city == kConstantinople) { - showFrame(kOverlayTooltip, (city == kParis) ? kTooltipRewindParis : kTooltipForwardConstantinople, true); - return; - } - - showFrame(kOverlayTooltip, (_time <= time) ? _cityButtonsInfo[city].forward : _cityButtonsInfo[city].rewind, true); -} - -////////////////////////////////////////////////////////////////////////// -// Sound / Brightness -////////////////////////////////////////////////////////////////////////// - -// Get current volume (converted internal ScummVM value) -uint32 Menu::getVolume() const { - return getState()->volume; -} - -// Set the volume (converts to ScummVM values) -void Menu::setVolume(uint32 volume) const { - getState()->volume = volume; - - // Clamp volume - uint32 value = volume * Audio::Mixer::kMaxMixerVolume / 7; - - if (value > Audio::Mixer::kMaxMixerVolume) - value = Audio::Mixer::kMaxMixerVolume; - - _engine->_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, (int32)value); -} - -uint32 Menu::getBrightness() const { - return getState()->brightness; -} - -void Menu::setBrightness(uint32 brightness) const { - getState()->brightness = brightness; - - // TODO reload cursor & font with adjusted brightness -} - -} // End of namespace LastExpress diff --git a/engines/lastexpress/game/menu.h b/engines/lastexpress/game/menu.h deleted file mode 100644 index 4b84c065cb..0000000000 --- a/engines/lastexpress/game/menu.h +++ /dev/null @@ -1,207 +0,0 @@ -/* 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 LASTEXPRESS_MENU_H -#define LASTEXPRESS_MENU_H - -#include "lastexpress/data/sequence.h" - -#include "lastexpress/eventhandler.h" - -#include "lastexpress/shared.h" - -#include "common/hashmap.h" - -namespace LastExpress { - -class LastExpressEngine; -class Scene; -class SceneHotspot; - -class Clock; -class TrainLine; - -class Menu : public EventHandler { -public: - Menu(LastExpressEngine *engine); - ~Menu(); - - void show(bool doSavegame, SavegameType type, uint32 value); - - // Event handling - void eventMouse(const Common::Event &ev); - void eventTick(const Common::Event &ev); - - bool isShown() const { return _isShowingMenu; } - - GameId getGameId() const { return _gameId; } - -private: - // Start menu events - enum StartMenuAction { - kMenuContinue = 1, - kMenuCredits = 2, - kMenuQuitGame = 3, - kMenuCase4 = 4, - kMenuSwitchSaveGame = 6, - kMenuRewindGame = 7, - kMenuForwardGame = 8, - kMenuParis = 10, - kMenuStrasBourg = 11, - kMenuMunich = 12, - kMenuVienna = 13, - kMenuBudapest = 14, - kMenuBelgrade = 15, - kMenuConstantinople = 16, - kMenuDecreaseVolume = 17, - kMenuIncreaseVolume = 18, - kMenuDecreaseBrightness = 19, - kMenuIncreaseBrightness = 20 - }; - - // City buttons - enum CityButton { - kParis = 0, - kStrasbourg = 1, - kMunich = 2, - kVienna = 3, - kBudapest = 4, - kBelgrade = 5, - kConstantinople = 6 - }; - - // Start menu overlay elements - enum StartMenuOverlay { - kOverlayTooltip, // 0 - kOverlayEggButtons, - kOverlayButtons, - kOverlayAcorn, - kOverlayCity1, - kOverlayCity2, // 5 - kOverlayCity3, - kOverlayCredits - }; - - LastExpressEngine *_engine; - - // Sequences - Sequence *_seqTooltips; - Sequence *_seqEggButtons; - Sequence *_seqButtons; - Sequence *_seqAcorn; - Sequence *_seqCity1; - Sequence *_seqCity2; - Sequence *_seqCity3; - Sequence *_seqCredits; - - GameId _gameId; - - // Indicator to know if we need to show the start animation when showMenu is called - bool _hasShownStartScreen; - bool _hasShownIntro; - - bool _isShowingCredits; - bool _isGameStarted; - bool _isShowingMenu; - - - uint16 _creditsSequenceIndex; - - ////////////////////////////////////////////////////////////////////////// - // Event handling - uint32 _checkHotspotsTicks; - Common::EventType _mouseFlags; - SceneHotspot *_lastHotspot; - - void init(bool doSavegame, SavegameType type, uint32 value); - void setup(); - bool handleEvent(StartMenuAction action, Common::EventType type); - void checkHotspots(); - void setLogicEventHandlers(); - - ////////////////////////////////////////////////////////////////////////// - // Game-related - void startGame(); - void switchGame(); - - ////////////////////////////////////////////////////////////////////////// - // Overlays & elements - Clock *_clock; - TrainLine *_trainLine; - - struct MenuOverlays_EqualTo { - bool operator()(const StartMenuOverlay &x, const StartMenuOverlay &y) const { return x == y; } - }; - - struct MenuOverlays_Hash { - uint operator()(const StartMenuOverlay &x) const { return x; } - }; - - typedef Common::HashMap MenuFrames; - - MenuFrames _frames; - - void hideOverlays(); - void showFrame(StartMenuOverlay overlay, int index, bool redraw); - - void clear(); - - // TODO: remove? - void moveToCity(CityButton city, bool clicked); - - ////////////////////////////////////////////////////////////////////////// - // Misc - Common::String getAcornSequenceName(GameId id) const; - - ////////////////////////////////////////////////////////////////////////// - // Time - uint32 _currentTime; // current game time - uint32 _lowerTime; // lower time value - uint32 _time; - - uint32 _currentIndex; // current savegame entry - uint32 _index; - uint32 _lastIndex; - uint32 _delta; - bool _handleTimeDelta; - - void initTime(SavegameType type, uint32 val); - void updateTime(uint32 time); - void adjustTime(); - void adjustIndex(uint32 time1, uint32 time2, bool searchEntry); - void goToTime(uint32 time); - void setTime(); - void forwardTime(); - void rewindTime(); - bool hasTimeDelta() { return (_currentTime - _time) >= 1; } - - ////////////////////////////////////////////////////////////////////////// - // Sound/Brightness related - uint32 getVolume() const; - void setVolume(uint32 volume) const; - uint32 getBrightness() const; - void setBrightness(uint32 brightness) const; -}; - -} // End of namespace LastExpress - -#endif // LASTEXPRESS_MENU_H diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp index 5d06ecab13..594cd1276b 100644 --- a/engines/lastexpress/game/savegame.cpp +++ b/engines/lastexpress/game/savegame.cpp @@ -24,11 +24,12 @@ #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" -#include "lastexpress/game/menu.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/state.h" +#include "lastexpress/menu/menu.h" + #include "lastexpress/debug.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 120e6eb28b..73893c9982 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -26,11 +26,12 @@ #include "lastexpress/data/font.h" #include "lastexpress/game/logic.h" -#include "lastexpress/game/menu.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/state.h" #include "lastexpress/game/sound.h" +#include "lastexpress/menu/menu.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/resource.h" diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp new file mode 100644 index 0000000000..b7e6a1430a --- /dev/null +++ b/engines/lastexpress/menu/menu.cpp @@ -0,0 +1,1542 @@ +/* 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 "lastexpress/menu/menu.h" + +// Data +#include "lastexpress/data/animation.h" +#include "lastexpress/data/cursor.h" +#include "lastexpress/data/snd.h" +#include "lastexpress/data/scene.h" + +#include "lastexpress/fight/fight.h" + +#include "lastexpress/game/inventory.h" +#include "lastexpress/game/logic.h" +#include "lastexpress/game/savegame.h" +#include "lastexpress/game/savepoint.h" +#include "lastexpress/game/scenes.h" +#include "lastexpress/game/sound.h" +#include "lastexpress/game/state.h" + +#include "lastexpress/graphics.h" +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +#include "common/rational.h" + +#define getNextGameId() (GameId)((_gameId + 1) % 6) + +namespace LastExpress { + +// Bottom-left buttons (quit.seq) +enum StartMenuButtons { + kButtonVolumeDownPushed, + kButtonVolumeDown, + kButtonVolume, + kButtonVolumeUp, + kButtonVolumeUpPushed, + kButtonBrightnessDownPushed, // 5 + kButtonBrightnessDown, + kButtonBrightness, + kButtonBrightnessUp, + kButtonBrightnessUpPushed, + kButtonQuit, // 10 + kButtonQuitPushed +}; + +// Egg buttons (buttns.seq) +enum StartMenuEggButtons { + kButtonShield, + kButtonRewind, + kButtonRewindPushed, + kButtonForward, + kButtonForwardPushed, + kButtonCredits, // 5 + kButtonCreditsPushed, + kButtonContinue +}; + +// Tooltips sequence (helpnewr.seq) +enum StartMenuTooltips { + kTooltipInsertCd1, + kTooltipInsertCd2, + kTooltipInsertCd3, + kTooltipContinueGame, + kTooltipReplayGame, + kTooltipContinueRewoundGame, // 5 + kTooltipViewGameEnding, + kTooltipStartAnotherGame, + kTooltipVolumeUp, + kTooltipVolumeDown, + kTooltipBrightnessUp, // 10 + kTooltipBrightnessDown, + kTooltipQuit, + kTooltipRewindParis, + kTooltipForwardStrasbourg, + kTooltipRewindStrasbourg, // 15 + kTooltipRewindMunich, + kTooltipForwardMunich, + kTooltipForwardVienna, + kTooltipRewindVienna, + kTooltipRewindBudapest, // 20 + kTooltipForwardBudapest, + kTooltipForwardBelgrade, + kTooltipRewindBelgrade, + kTooltipForwardConstantinople, + kTooltipSwitchBlueGame, // 25 + kTooltipSwitchRedGame, + kTooltipSwitchGoldGame, + kTooltipSwitchGreenGame, + kTooltipSwitchTealGame, + kTooltipSwitchPurpleGame, // 30 + kTooltipPlayNewGame, + kTooltipCredits, + kTooltipFastForward, + kTooltipRewind +}; + +////////////////////////////////////////////////////////////////////////// +// DATA +////////////////////////////////////////////////////////////////////////// + +// Information about the cities on the train line +static const struct { + uint8 frame; + TimeValue time; +} _trainCities[31] = { + {0, kTimeCityParis}, + {9, kTimeCityEpernay}, + {11, kTimeCityChalons}, + {16, kTimeCityBarLeDuc}, + {21, kTimeCityNancy}, + {25, kTimeCityLuneville}, + {35, kTimeCityAvricourt}, + {37, kTimeCityDeutschAvricourt}, + {40, kTimeCityStrasbourg}, + {53, kTimeCityBadenOos}, + {56, kTimeCityKarlsruhe}, + {60, kTimeCityStuttgart}, + {63, kTimeCityGeislingen}, + {66, kTimeCityUlm}, + {68, kTimeCityAugsburg}, + {73, kTimeCityMunich}, + {84, kTimeCitySalzbourg}, + {89, kTimeCityAttnangPuchheim}, + {97, kTimeCityWels}, + {100, kTimeCityLinz}, + {104, kTimeCityAmstetten}, + {111, kTimeCityVienna}, + {120, kTimeCityPoszony}, + {124, kTimeCityGalanta}, + {132, kTimeCityBudapest}, + {148, kTimeCityBelgrade}, + /* Line 1 ends at 150 - line 2 begins at 0 */ + {157, kTimeCityNish}, + {165, kTimeCityTzaribrod}, + {174, kTimeCitySofia}, + {198, kTimeCityAdrianople}, + {210, kTimeCityConstantinople}}; + +static const struct { + TimeValue time; + uint index; + StartMenuTooltips rewind; + StartMenuTooltips forward; +} _cityButtonsInfo[7] = { + {kTimeCityParis, 64, kTooltipRewindParis, kTooltipRewindParis}, + {kTimeCityStrasbourg, 128, kTooltipRewindStrasbourg, kTooltipForwardStrasbourg}, + {kTimeCityMunich, 129, kTooltipRewindMunich, kTooltipForwardMunich}, + {kTimeCityVienna, 130, kTooltipRewindVienna, kTooltipForwardVienna}, + {kTimeCityBudapest, 131, kTooltipRewindBudapest, kTooltipForwardBudapest}, + {kTimeCityBelgrade, 132, kTooltipRewindBelgrade, kTooltipForwardBelgrade}, + {kTimeCityConstantinople, 192, kTooltipForwardConstantinople, kTooltipForwardConstantinople} +}; + +////////////////////////////////////////////////////////////////////////// +// Clock +////////////////////////////////////////////////////////////////////////// +class Clock { +public: + explicit Clock(LastExpressEngine *engine); + ~Clock(); + + void draw(uint32 time); + void clear(); + +private: + LastExpressEngine *_engine; + + // Frames + SequenceFrame *_frameMinutes; + SequenceFrame *_frameHour; + SequenceFrame *_frameSun; + SequenceFrame *_frameDate; +}; + +Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) { + _frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true); + _frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true); + _frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true); + _frameDate = new SequenceFrame(loadSequence("datenew.seq"), 0, true); +} + +Clock::~Clock() { + SAFE_DELETE(_frameMinutes); + SAFE_DELETE(_frameHour); + SAFE_DELETE(_frameSun); + SAFE_DELETE(_frameDate); + + // Zero passed pointers + _engine = NULL; +} + +void Clock::clear() { + getScenes()->removeFromQueue(_frameMinutes); + getScenes()->removeFromQueue(_frameHour); + getScenes()->removeFromQueue(_frameSun); + getScenes()->removeFromQueue(_frameDate); +} + +void Clock::draw(uint32 time) { + assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); + + // Check that sequences have been loaded + if (!_frameMinutes || !_frameHour || !_frameSun || !_frameDate) + error("Clock::process: clock sequences have not been loaded correctly!"); + + // Clear existing frames + clear(); + + // Game starts at: 1037700 = 7:13 p.m. on July 24, 1914 + // Game ends at: 4941000 = 7:30 p.m. on July 26, 1914 + // Game lasts for: 3903300 = 2 days + 17 mins = 2897 mins + + // 15 = 1 second + // 15 * 60 = 900 = 1 minute + // 900 * 60 = 54000 = 1 hour + // 54000 * 24 = 1296000 = 1 day + + // Calculate each sequence index from the current time + + uint8 hour = 0; + uint8 minute = 0; + State::getHourMinutes(time, &hour, &minute); + uint32 index_date = 18 * time / 1296000; + if (hour == 23) + index_date += 18 * minute / 60; + + // Set sequences frames + _frameMinutes->setFrame(minute); + _frameHour->setFrame((5 * hour + minute / 12) % 60); + _frameSun->setFrame((5 * hour + minute / 12) % 120); + _frameDate->setFrame((uint16)index_date); + + // Adjust z-order and queue + _frameMinutes->getInfo()->location = 1; + _frameHour->getInfo()->location = 1; + _frameSun->getInfo()->location = 1; + _frameDate->getInfo()->location = 1; + + getScenes()->addToQueue(_frameMinutes); + getScenes()->addToQueue(_frameHour); + getScenes()->addToQueue(_frameSun); + getScenes()->addToQueue(_frameDate); +} + +////////////////////////////////////////////////////////////////////////// +// TrainLine +////////////////////////////////////////////////////////////////////////// +class TrainLine { +public: + explicit TrainLine(LastExpressEngine *engine); + ~TrainLine(); + + void draw(uint32 time); + void clear(); + +private: + LastExpressEngine *_engine; + + // Frames + SequenceFrame *_frameLine1; + SequenceFrame *_frameLine2; +}; + +TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) { + _frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true); + _frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true); +} + +TrainLine::~TrainLine() { + SAFE_DELETE(_frameLine1); + SAFE_DELETE(_frameLine2); + + // Zero passed pointers + _engine = NULL; +} + +void TrainLine::clear() { + getScenes()->removeFromQueue(_frameLine1); + getScenes()->removeFromQueue(_frameLine2); +} + +// Draw the train line at the time +// line1: 150 frames (=> Belgrade) +// line2: 61 frames (=> Constantinople) +void TrainLine::draw(uint32 time) { + assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); + + // Check that sequences have been loaded + if (!_frameLine1 || !_frameLine2) + error("TrainLine::process: Line sequences have not been loaded correctly!"); + + // Clear existing frames + clear(); + + // Get the index of the last city the train has visited + uint index = 0; + for (uint i = 0; i < ARRAYSIZE(_trainCities); i++) + if ((uint32)_trainCities[i].time <= time) + index = i; + + uint16 frame; + if (time > (uint32)_trainCities[index].time) { + // Interpolate linearly to use a frame between the cities + uint8 diffFrames = _trainCities[index + 1].frame - _trainCities[index].frame; + uint diffTimeCities = (uint)(_trainCities[index + 1].time - _trainCities[index].time); + uint traveledTime = (time - (uint)_trainCities[index].time); + frame = (uint16)(_trainCities[index].frame + (traveledTime * diffFrames) / diffTimeCities); + } else { + // Exactly on the city + frame = _trainCities[index].frame; + } + + // Set frame, z-order and queue + if (frame < 150) { + _frameLine1->setFrame(frame); + + _frameLine1->getInfo()->location = 1; + getScenes()->addToQueue(_frameLine1); + } else { + // We passed Belgrade + _frameLine1->setFrame(149); + _frameLine2->setFrame(frame - 150); + + _frameLine1->getInfo()->location = 1; + _frameLine2->getInfo()->location = 1; + + getScenes()->addToQueue(_frameLine1); + getScenes()->addToQueue(_frameLine2); + } +} + + +////////////////////////////////////////////////////////////////////////// +// Menu +////////////////////////////////////////////////////////////////////////// +Menu::Menu(LastExpressEngine *engine) : _engine(engine), + _seqTooltips(NULL), _seqEggButtons(NULL), _seqButtons(NULL), _seqAcorn(NULL), _seqCity1(NULL), _seqCity2(NULL), _seqCity3(NULL), _seqCredits(NULL), + _gameId(kGameBlue), _hasShownStartScreen(false), _hasShownIntro(false), + _isShowingCredits(false), _isGameStarted(false), _isShowingMenu(false), + _creditsSequenceIndex(0), _checkHotspotsTicks(15), _mouseFlags(Common::EVENT_INVALID), _lastHotspot(NULL), + _currentTime(kTimeNone), _lowerTime(kTimeNone), _time(kTimeNone), _currentIndex(0), _index(0), _lastIndex(0), _delta(0), _handleTimeDelta(false) { + + _clock = new Clock(_engine); + _trainLine = new TrainLine(_engine); +} + +Menu::~Menu() { + SAFE_DELETE(_clock); + SAFE_DELETE(_trainLine); + + SAFE_DELETE(_seqTooltips); + SAFE_DELETE(_seqEggButtons); + SAFE_DELETE(_seqButtons); + SAFE_DELETE(_seqAcorn); + SAFE_DELETE(_seqCity1); + SAFE_DELETE(_seqCity2); + SAFE_DELETE(_seqCity3); + SAFE_DELETE(_seqCredits); + + _lastHotspot = NULL; + + // Cleanup frames + for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) + SAFE_DELETE(it->_value); + + _frames.clear(); + + // Zero passed pointers + _engine = NULL; +} + +////////////////////////////////////////////////////////////////////////// +// Setup +void Menu::setup() { + + // Clear drawing queue + getScenes()->removeAndRedraw(&_frames[kOverlayAcorn], false); + SAFE_DELETE(_seqAcorn); + + // Load Menu scene + // + 1 = normal menu with open egg / clock + // + 2 = shield menu, when no savegame exists (no game has been started) + _isGameStarted = _lowerTime >= kTimeStartGame; + getScenes()->loadScene((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)); + getFlags()->shouldRedraw = true; + getLogic()->updateCursor(); + + ////////////////////////////////////////////////////////////////////////// + // Load Acorn sequence + _seqAcorn = loadSequence(getAcornSequenceName(_isGameStarted ? getNextGameId() : kGameBlue)); + + ////////////////////////////////////////////////////////////////////////// + // Check if we loaded sequences before + if (_seqTooltips && _seqTooltips->count() > 0) + return; + + // Load all static data + _seqTooltips = loadSequence("helpnewr.seq"); + _seqEggButtons = loadSequence("buttns.seq"); + _seqButtons = loadSequence("quit.seq"); + _seqCity1 = loadSequence("jlinetl.seq"); + _seqCity2 = loadSequence("jlinecen.seq"); + _seqCity3 = loadSequence("jlinebr.seq"); + _seqCredits = loadSequence("credits.seq"); + + _frames[kOverlayTooltip] = new SequenceFrame(_seqTooltips); + _frames[kOverlayEggButtons] = new SequenceFrame(_seqEggButtons); + _frames[kOverlayButtons] = new SequenceFrame(_seqButtons); + _frames[kOverlayAcorn] = new SequenceFrame(_seqAcorn); + _frames[kOverlayCity1] = new SequenceFrame(_seqCity1); + _frames[kOverlayCity2] = new SequenceFrame(_seqCity2); + _frames[kOverlayCity3] = new SequenceFrame(_seqCity3); + _frames[kOverlayCredits] = new SequenceFrame(_seqCredits); +} + +////////////////////////////////////////////////////////////////////////// +// Handle events +void Menu::eventMouse(const Common::Event &ev) { + if (!getFlags()->shouldRedraw) + return; + + bool redraw = true; + getFlags()->shouldRedraw = false; + + // Update coordinates + setCoords(ev.mouse); + //_mouseFlags = (Common::EventType)(ev.type & Common::EVENT_LBUTTONUP); + + if (_isShowingCredits) { + if (ev.type == Common::EVENT_RBUTTONUP) { + showFrame(kOverlayCredits, -1, true); + _isShowingCredits = false; + } + + if (ev.type == Common::EVENT_LBUTTONUP) { + // Last frame of the credits + if (_seqCredits && _creditsSequenceIndex == _seqCredits->count() - 1) { + showFrame(kOverlayCredits, -1, true); + _isShowingCredits = false; + } else { + ++_creditsSequenceIndex; + showFrame(kOverlayCredits, _creditsSequenceIndex, true); + } + } + } else { + // Check for hotspots + SceneHotspot *hotspot = NULL; + getScenes()->get(getState()->scene)->checkHotSpot(ev.mouse, &hotspot); + + if (_lastHotspot != hotspot || ev.type == Common::EVENT_LBUTTONUP) { + _lastHotspot = hotspot; + + if (ev.type == Common::EVENT_MOUSEMOVE) { /* todo check event type */ + if (!_handleTimeDelta && hasTimeDelta()) + setTime(); + } + + if (hotspot) { + redraw = handleEvent((StartMenuAction)hotspot->action, ev.type); + getFlags()->mouseRightClick = false; + getFlags()->mouseLeftClick = false; + } else { + hideOverlays(); + } + } + } + + if (redraw) { + getFlags()->shouldRedraw = true; + askForRedraw(); + } +} + +void Menu::eventTick(const Common::Event&) { + if (hasTimeDelta()) + adjustTime(); + else if (_handleTimeDelta) + _handleTimeDelta = false; + + // Check hotspots + if (!--_checkHotspotsTicks) { + checkHotspots(); + _checkHotspotsTicks = 15; + } +} + +////////////////////////////////////////////////////////////////////////// +// Show the intro and load the main menu scene +void Menu::show(bool doSavegame, SavegameType type, uint32 value) { + + if (_isShowingMenu) + return; + + _isShowingMenu = true; + getEntities()->reset(); + + // If no blue savegame exists, this might be the first time we start the game, so we show the full intro + if (!getFlags()->mouseRightClick) { + if (!SaveLoad::isSavegameValid(kGameBlue) && _engine->getResourceManager()->loadArchive(kArchiveCd1)) { + + if (!_hasShownIntro) { + // Show Broderbrund logo + Animation animation; + if (animation.load(getArchive("1930.nis"))) + animation.play(); + + getFlags()->mouseRightClick = false; + + // Play intro music + getSound()->playSoundWithSubtitles("MUS001.SND", SoundManager::kFlagMusic, kEntityPlayer); + + // Show The Smoking Car logo + if (animation.load(getArchive("1931.nis"))) + animation.play(); + + _hasShownIntro = true; + } + } else { + // Only show the quick intro + if (!_hasShownStartScreen) { + getSound()->playSoundWithSubtitles("MUS018.SND", SoundManager::kFlagMusic, kEntityPlayer); + getScenes()->loadScene(kSceneStartScreen); + + // Original game waits 60 frames and loops Sound::unknownFunction1 unless the right button is pressed + uint32 nextFrameCount = getFrameCount() + 60; + while (getFrameCount() < nextFrameCount) { + _engine->pollEvents(); + + if (getFlags()->mouseRightClick) + break; + + getSound()->updateQueue(); + } + } + } + } + + _hasShownStartScreen = true; + + // Init Menu + init(doSavegame, type, value); + + // Setup sound + getSound()->unknownFunction4(); + getSound()->resetQueue(SoundManager::kSoundType11, SoundManager::kSoundType13); + if (getSound()->isBuffered("TIMER")) + getSound()->removeFromQueue("TIMER"); + + // Init flags & misc + _isShowingCredits = false; + _handleTimeDelta = hasTimeDelta(); + getInventory()->unselectItem(); + + // Set Cursor type + _engine->getCursor()->setStyle(kCursorNormal); + _engine->getCursor()->show(true); + + setup(); + checkHotspots(); + + // Set event handlers + SET_EVENT_HANDLERS(Menu, this); +} + +bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { + bool clicked = (type == Common::EVENT_LBUTTONUP); + + switch(action) { + default: + hideOverlays(); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuCredits: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + if (clicked) { + showFrame(kOverlayEggButtons, kButtonCreditsPushed, true); + showFrame(kOverlayTooltip, -1, true); + + getSound()->playSound(kEntityPlayer, "LIB046"); + + hideOverlays(); + + _isShowingCredits = true; + _creditsSequenceIndex = 0; + + showFrame(kOverlayCredits, 0, true); + } else { + // TODO check flags ? + + showFrame(kOverlayEggButtons, kButtonCredits, true); + showFrame(kOverlayTooltip, kTooltipCredits, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuQuitGame: + showFrame(kOverlayTooltip, kTooltipQuit, true); + + if (clicked) { + showFrame(kOverlayButtons, kButtonQuitPushed, true); + + getSound()->clearStatus(); + getSound()->updateQueue(); + getSound()->playSound(kEntityPlayer, "LIB046"); + + // FIXME uncomment when sound queue is properly implemented + /*while (getSound()->isBuffered("LIB046")) + getSound()->updateQueue();*/ + + getFlags()->shouldRedraw = false; + + Engine::quitGame(); + + return false; + } else { + showFrame(kOverlayButtons, kButtonQuit, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuCase4: + if (clicked) + _index = 0; + // fall down to kMenuContinue + + ////////////////////////////////////////////////////////////////////////// + case kMenuContinue: { + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + // Determine the proper CD archive + ArchiveIndex cd = kArchiveCd1; + if (getProgress().chapter > kChapter1) + cd = (getProgress().chapter > kChapter3) ? kArchiveCd3 : kArchiveCd2; + + // Show tooltips & buttons to start a game, continue a game or load the proper cd + if (ResourceManager::isArchivePresent(cd)) { + if (_isGameStarted) { + showFrame(kOverlayEggButtons, kButtonContinue, true); + + if (_lastIndex == _index) { + showFrame(kOverlayTooltip, getSaveLoad()->isGameFinished(_index, _lastIndex) ? kTooltipViewGameEnding : kTooltipContinueGame, true); + } else { + showFrame(kOverlayTooltip, kTooltipContinueRewoundGame, true); + } + + } else { + showFrame(kOverlayEggButtons, kButtonShield, true); + showFrame(kOverlayTooltip, kTooltipPlayNewGame, true); + } + } else { + showFrame(kOverlayEggButtons, -1, true); + showFrame(kOverlayTooltip, cd - 1, true); + } + + if (!clicked) + break; + + // Try loading the archive file + if (!_engine->getResourceManager()->loadArchive(cd)) + break; + + // Load the train data file and setup game + getScenes()->loadSceneDataFile(cd); + showFrame(kOverlayTooltip, -1, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + + // Setup new game + getSavePoints()->reset(); + setLogicEventHandlers(); + + if (_index) { + getSound()->processEntry(SoundManager::kSoundType11); + } else { + if (!getFlags()->mouseRightClick) { + getScenes()->loadScene((SceneIndex)(5 * _gameId + 3)); + + if (!getFlags()->mouseRightClick) { + getScenes()->loadScene((SceneIndex)(5 * _gameId + 4)); + + if (!getFlags()->mouseRightClick) { + getScenes()->loadScene((SceneIndex)(5 * _gameId + 5)); + + if (!getFlags()->mouseRightClick) { + getSound()->processEntry(SoundManager::kSoundType11); + + // Show intro + Animation animation; + if (animation.load(getArchive("1601.nis"))) + animation.play(); + + getEvent(kEventIntro) = 1; + } + } + } + } + + if (!getEvent(kEventIntro)) { + getEvent(kEventIntro) = 1; + + getSound()->processEntry(SoundManager::kSoundType11); + } + } + + // Setup game + getFlags()->isGameRunning = true; + startGame(); + + if (!_isShowingMenu) + getInventory()->show(); + + return false; + } + + ////////////////////////////////////////////////////////////////////////// + case kMenuSwitchSaveGame: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + if (clicked) { + showFrame(kOverlayAcorn, 1, true); + showFrame(kOverlayTooltip, -1, true); + getSound()->playSound(kEntityPlayer, "LIB047"); + + // Setup new menu screen + switchGame(); + setup(); + + // Set fight state to 0 + getFight()->resetState(); + + return true; + } + + // TODO Check for flag + + showFrame(kOverlayAcorn, 0, true); + + if (_isGameStarted) { + showFrame(kOverlayTooltip, kTooltipSwitchBlueGame, true); + break; + } + + if (_gameId == kGameGold) { + showFrame(kOverlayTooltip, kTooltipSwitchBlueGame, true); + break; + } + + if (!SaveLoad::isSavegameValid(getNextGameId())) { + showFrame(kOverlayTooltip, kTooltipStartAnotherGame, true); + break; + } + + // Stupid tooltips ids are not in order, so we can't just increment them... + switch(_gameId) { + default: + break; + + case kGameBlue: + showFrame(kOverlayTooltip, kTooltipSwitchRedGame, true); + break; + + case kGameRed: + showFrame(kOverlayTooltip, kTooltipSwitchGreenGame, true); + break; + + case kGameGreen: + showFrame(kOverlayTooltip, kTooltipSwitchPurpleGame, true); + break; + + case kGamePurple: + showFrame(kOverlayTooltip, kTooltipSwitchTealGame, true); + break; + + case kGameTeal: + showFrame(kOverlayTooltip, kTooltipSwitchGoldGame, true); + break; + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuRewindGame: + if (!_index || _currentTime < _time) { + hideOverlays(); + break; + } + + if (clicked) { + if (hasTimeDelta()) + _handleTimeDelta = false; + + showFrame(kOverlayEggButtons, kButtonRewindPushed, true); + showFrame(kOverlayTooltip, -1, true); + + getSound()->playSound(kEntityPlayer, "LIB046"); + + rewindTime(); + + _handleTimeDelta = false; + } else { + showFrame(kOverlayEggButtons, kButtonRewind, true); + showFrame(kOverlayTooltip, kTooltipRewind, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuForwardGame: + if (_lastIndex <= _index || _currentTime > _time) { + hideOverlays(); + break; + } + + if (clicked) { + if (hasTimeDelta()) + _handleTimeDelta = false; + + showFrame(kOverlayEggButtons, kButtonForwardPushed, true); + showFrame(kOverlayTooltip, -1, true); + + getSound()->playSound(kEntityPlayer, "LIB046"); + + forwardTime(); + + _handleTimeDelta = false; + } else { + showFrame(kOverlayEggButtons, kButtonForward, true); + showFrame(kOverlayTooltip, kTooltipFastForward, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuParis: + moveToCity(kParis, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuStrasBourg: + moveToCity(kStrasbourg, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuMunich: + moveToCity(kMunich, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuVienna: + moveToCity(kVienna, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuBudapest: + moveToCity(kBudapest, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuBelgrade: + moveToCity(kBelgrade, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuConstantinople: + moveToCity(kConstantinople, clicked); + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuDecreaseVolume: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + // Cannot decrease volume further + if (getVolume() == 0) { + showFrame(kOverlayButtons, kButtonVolume, true); + showFrame(kOverlayTooltip, -1, true); + break; + } + + showFrame(kOverlayTooltip, kTooltipVolumeDown, true); + + // Show highlight on button & adjust volume if needed + if (clicked) { + showFrame(kOverlayButtons, kButtonVolumeDownPushed, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + setVolume(getVolume() - 1); + + getSaveLoad()->saveVolumeBrightness(); + + uint32 nextFrameCount = getFrameCount() + 15; + while (nextFrameCount > getFrameCount()) { + _engine->pollEvents(); + + getSound()->updateQueue(); + } + } else { + showFrame(kOverlayButtons, kButtonVolumeDown, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuIncreaseVolume: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + // Cannot increase volume further + if (getVolume() >= 7) { + showFrame(kOverlayButtons, kButtonVolume, true); + showFrame(kOverlayTooltip, -1, true); + break; + } + + showFrame(kOverlayTooltip, kTooltipVolumeUp, true); + + // Show highlight on button & adjust volume if needed + if (clicked) { + showFrame(kOverlayButtons, kButtonVolumeUpPushed, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + setVolume(getVolume() + 1); + + getSaveLoad()->saveVolumeBrightness(); + + uint32 nextFrameCount = getFrameCount() + 15; + while (nextFrameCount > getFrameCount()) { + _engine->pollEvents(); + + getSound()->updateQueue(); + } + } else { + showFrame(kOverlayButtons, kButtonVolumeUp, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuDecreaseBrightness: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + // Cannot increase brightness further + if (getBrightness() == 0) { + showFrame(kOverlayButtons, kButtonBrightness, true); + showFrame(kOverlayTooltip, -1, true); + break; + } + + showFrame(kOverlayTooltip, kTooltipBrightnessDown, true); + + // Show highlight on button & adjust brightness if needed + if (clicked) { + showFrame(kOverlayButtons, kButtonBrightnessDownPushed, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + setBrightness(getBrightness() - 1); + + getSaveLoad()->saveVolumeBrightness(); + + // Reshow the background and frames (they will pick up the new brightness through the GraphicsManager) + _engine->getGraphicsManager()->draw(getScenes()->get((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)), GraphicsManager::kBackgroundC, true); + showFrame(kOverlayTooltip, kTooltipBrightnessDown, false); + showFrame(kOverlayButtons, kButtonBrightnessDownPushed, false); + } else { + showFrame(kOverlayButtons, kButtonBrightnessDown, true); + } + break; + + ////////////////////////////////////////////////////////////////////////// + case kMenuIncreaseBrightness: + if (hasTimeDelta()) { + hideOverlays(); + break; + } + + // Cannot increase brightness further + if (getBrightness() >= 6) { + showFrame(kOverlayButtons, kButtonBrightness, true); + showFrame(kOverlayTooltip, -1, true); + break; + } + + showFrame(kOverlayTooltip, kTooltipBrightnessUp, true); + + // Show highlight on button & adjust brightness if needed + if (clicked) { + showFrame(kOverlayButtons, kButtonBrightnessUpPushed, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + setBrightness(getBrightness() + 1); + + getSaveLoad()->saveVolumeBrightness(); + + // Reshow the background and frames (they will pick up the new brightness through the GraphicsManager) + _engine->getGraphicsManager()->draw(getScenes()->get((SceneIndex)(_isGameStarted ? _gameId * 5 + 1 : _gameId * 5 + 2)), GraphicsManager::kBackgroundC, true); + showFrame(kOverlayTooltip, kTooltipBrightnessUp, false); + showFrame(kOverlayButtons, kButtonBrightnessUpPushed, false); + } else { + showFrame(kOverlayButtons, kButtonBrightnessUp, true); + } + break; + } + + return true; +} + +void Menu::setLogicEventHandlers() { + SET_EVENT_HANDLERS(Logic, getLogic()); + clear(); + _isShowingMenu = false; +} + +////////////////////////////////////////////////////////////////////////// +// Game-related +////////////////////////////////////////////////////////////////////////// +void Menu::init(bool doSavegame, SavegameType type, uint32 value) { + + bool useSameIndex = true; + + if (getGlobalTimer()) { + value = 0; + + // Check if the CD file is present + ArchiveIndex index = kArchiveCd1; + switch (getProgress().chapter) { + default: + case kChapter1: + break; + + case kChapter2: + case kChapter3: + index = kArchiveCd2; + break; + + case kChapter4: + case kChapter5: + index = kArchiveCd3; + break; + } + + if (ResourceManager::isArchivePresent(index)) { + setGlobalTimer(0); + useSameIndex = false; + + // TODO remove existing savegame and reset index & savegame name + warning("Menu::initGame: not implemented!"); + } + + doSavegame = false; + } else { + // TODO rename saves? + } + + // Create a new savegame if needed + if (!SaveLoad::isSavegamePresent(_gameId)) + getSaveLoad()->create(_gameId); + + if (doSavegame) + getSaveLoad()->saveGame(kSavegameTypeEvent2, kEntityPlayer, kEventNone); + + if (!getGlobalTimer()) { + // TODO: remove existing savegame temp file + } + + // Init savegame & menu values + _lastIndex = getSaveLoad()->init(_gameId, true); + _lowerTime = getSaveLoad()->getTime(_lastIndex); + + if (useSameIndex) + _index = _lastIndex; + + //if (!getGlobalTimer()) + // _index3 = 0; + + if (!getProgress().chapter) + getProgress().chapter = kChapter1; + + getState()->time = (TimeValue)getSaveLoad()->getTime(_index); + getProgress().chapter = getSaveLoad()->getChapter(_index); + + if (_lowerTime >= kTimeStartGame) { + _currentTime = (uint32)getState()->time; + _time = (uint32)getState()->time; + _clock->draw(_time); + _trainLine->draw(_time); + + initTime(type, value); + } +} + +// Start a game (or load an existing savegame) +void Menu::startGame() { + // Clear savegame headers + getSaveLoad()->clear(); + + // Hide menu elements + _clock->clear(); + _trainLine->clear(); + + if (_lastIndex == _index) { + setGlobalTimer(0); + if (_index) { + getSaveLoad()->loadGame(_gameId); + } else { + getLogic()->resetState(); + getEntities()->setup(true, kEntityPlayer); + } + } else { + getSaveLoad()->loadGame(_gameId, _index); + } +} + +// Switch to the next savegame +void Menu::switchGame() { + + // Switch back to blue game is the current game is not started + _gameId = SaveLoad::isSavegameValid(_gameId) ? getNextGameId() : kGameBlue; + + // Initialize savegame if needed + if (!SaveLoad::isSavegamePresent(_gameId)) + getSaveLoad()->create(_gameId); + + getState()->time = kTimeNone; + + // Clear menu elements + _clock->clear(); + _trainLine->clear(); + + // Clear loaded savegame data + getSaveLoad()->clear(true); + + init(false, kSavegameTypeIndex, 0); +} + +////////////////////////////////////////////////////////////////////////// +// Overlays & elements +////////////////////////////////////////////////////////////////////////// +void Menu::checkHotspots() { + if (!_isShowingMenu) + return; + + if (!getFlags()->shouldRedraw) + return; + + if (_isShowingCredits) + return; + + SceneHotspot *hotspot = NULL; + getScenes()->get(getState()->scene)->checkHotSpot(getCoords(), &hotspot); + + if (hotspot) + handleEvent((StartMenuAction)hotspot->action, _mouseFlags); + else + hideOverlays(); +} + +void Menu::hideOverlays() { + _lastHotspot = NULL; + + // Hide all menu overlays + for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) + showFrame(it->_key, -1, false); + + getScenes()->drawFrames(true); +} + +void Menu::showFrame(StartMenuOverlay overlayType, int index, bool redraw) { + if (index == -1) { + getScenes()->removeFromQueue(_frames[overlayType]); + } else { + // Check that the overlay is valid + if (!_frames[overlayType]) + return; + + // Remove the frame and add a new one with the proper index + getScenes()->removeFromQueue(_frames[overlayType]); + _frames[overlayType]->setFrame((uint16)index); + getScenes()->addToQueue(_frames[overlayType]); + } + + if (redraw) + getScenes()->drawFrames(true); +} + +// Remove all frames from the queue +void Menu::clear() { + for (MenuFrames::iterator it = _frames.begin(); it != _frames.end(); it++) + getScenes()->removeAndRedraw(&it->_value, false); + + clearBg(GraphicsManager::kBackgroundOverlay); +} + +// Get the sequence name to use for the acorn highlight, depending of the currently loaded savegame +Common::String Menu::getAcornSequenceName(GameId id) const { + Common::String name = ""; + switch (id) { + default: + case kGameBlue: + name = "aconblu3.seq"; + break; + + case kGameRed: + name = "aconred.seq"; + break; + + case kGameGreen: + name = "acongren.seq"; + break; + + case kGamePurple: + name = "aconpurp.seq"; + break; + + case kGameTeal: + name = "aconteal.seq"; + break; + + case kGameGold: + name = "acongold.seq"; + break; + } + + return name; +} + +////////////////////////////////////////////////////////////////////////// +// Time +////////////////////////////////////////////////////////////////////////// +void Menu::initTime(SavegameType type, uint32 value) { + if (!value) + return; + + // The savegame entry index + uint32 entryIndex = 0; + + switch (type) { + default: + break; + + case kSavegameTypeIndex: + entryIndex = (_index <= value) ? 1 : _index - value; + break; + + case kSavegameTypeTime: + if (value < kTimeStartGame) + break; + + entryIndex = _index; + if (!entryIndex) + break; + + // Iterate through existing entries + do { + if (getSaveLoad()->getTime(entryIndex) <= value) + break; + + entryIndex--; + } while (entryIndex); + break; + + case kSavegameTypeEvent: + entryIndex = _index; + if (!entryIndex) + break; + + do { + if (getSaveLoad()->getValue(entryIndex) == value) + break; + + entryIndex--; + } while (entryIndex); + break; + + case kSavegameTypeEvent2: + // TODO rewrite in a more legible way + if (_index > 1) { + uint32 index = _index; + do { + if (getSaveLoad()->getValue(index) == value) + break; + + index--; + } while (index > 1); + + entryIndex = index - 1; + } else { + entryIndex = _index - 1; + } + break; + } + + if (entryIndex) { + _currentIndex = entryIndex; + updateTime(getSaveLoad()->getTime(entryIndex)); + } +} + +void Menu::updateTime(uint32 time) { + if (_currentTime == _time) + _delta = 0; + + _currentTime = time; + + if (_time != time) { + if (getSound()->isBuffered(kEntityChapters)) + getSound()->removeFromQueue(kEntityChapters); + + getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", SoundManager::kFlagMenuClock, kEntityChapters); + adjustIndex(_currentTime, _time, false); + } +} + +void Menu::adjustIndex(uint32 time1, uint32 time2, bool searchEntry) { + uint32 index = 0; + int32 timeDelta = -1; + + if (time1 != time2) { + + index = _index; + + if (time2 >= time1) { + if (searchEntry) { + uint32 currentIndex = _index; + + if ((int32)_index >= 0) { + do { + // Calculate new delta + int32 newDelta = time1 - (uint32)getSaveLoad()->getTime(currentIndex); + + if (newDelta >= 0 && timeDelta >= newDelta) { + timeDelta = newDelta; + index = currentIndex; + } + + --currentIndex; + } while ((int32)currentIndex >= 0); + } + } else { + index = _index - 1; + } + } else { + if (searchEntry) { + uint32 currentIndex = _index; + + if (_lastIndex >= _index) { + do { + // Calculate new delta + int32 newDelta = (uint32)getSaveLoad()->getTime(currentIndex) - time1; + + if (newDelta >= 0 && timeDelta > newDelta) { + timeDelta = newDelta; + index = currentIndex; + } + + ++currentIndex; + } while (currentIndex <= _lastIndex); + } + } else { + index = _index + 1; + } + } + + _index = index; + checkHotspots(); + } + + if (_index == _currentIndex) { + if (getProgress().chapter != getSaveLoad()->getChapter(index)) + getProgress().chapter = getSaveLoad()->getChapter(_index); + } +} + +void Menu::goToTime(uint32 time) { + + uint32 entryIndex = 0; + uint32 deltaTime = (uint32)ABS((int32)(getSaveLoad()->getTime(0) - time)); + uint32 index = 0; + + do { + uint32 deltaTime2 = (uint32)ABS((int32)(getSaveLoad()->getTime(index) - time)); + if (deltaTime2 < deltaTime) { + deltaTime = deltaTime2; + entryIndex = index; + } + + ++index; + } while (_lastIndex >= index); + + _currentIndex = entryIndex; + updateTime(getSaveLoad()->getTime(entryIndex)); +} + +void Menu::setTime() { + _currentIndex = _index; + _currentTime = getSaveLoad()->getTime(_currentIndex); + + if (_time == _currentTime) + adjustTime(); +} + +void Menu::forwardTime() { + if (_lastIndex <= _index) + return; + + _currentIndex = _lastIndex; + updateTime(getSaveLoad()->getTime(_currentIndex)); +} + +void Menu::rewindTime() { + if (!_index) + return; + + _currentIndex = 0; + updateTime(getSaveLoad()->getTime(_currentIndex)); +} + +void Menu::adjustTime() { + uint32 originalTime = _time; + + // Adjust time delta + Common::Rational timeDelta(_delta >= 90 ? 9 : (9 * _delta + 89), _delta >= 90 ? 1 : 90); + + if (_currentTime < _time) { + timeDelta *= 900; + _time -= (uint)timeDelta.toInt(); + + if (_currentTime > _time) + _time = _currentTime; + } else { + timeDelta *= 900; + _time += (uint)timeDelta.toInt(); + + if (_currentTime < _time) + _time = _currentTime; + } + + if (_currentTime == _time && getSound()->isBuffered(kEntityChapters)) + getSound()->removeFromQueue(kEntityChapters); + + _clock->draw(_time); + _trainLine->draw(_time); + getScenes()->drawFrames(true); + + adjustIndex(_time, originalTime, true); + + ++_delta; +} + +void Menu::moveToCity(CityButton city, bool clicked) { + uint32 time = (uint32)_cityButtonsInfo[city].time; + + // TODO Check if we have access (there seems to be more checks on some internal times) - probably : current_time (menu only) / game time / some other? + if (_lowerTime < time || _time == time || _currentTime == time) { + hideOverlays(); + return; + } + + // Show city overlay + showFrame((StartMenuOverlay)((_cityButtonsInfo[city].index >> 6) + 3), _cityButtonsInfo[city].index & 63, true); + + if (clicked) { + showFrame(kOverlayTooltip, -1, true); + getSound()->playSound(kEntityPlayer, "LIB046"); + goToTime(time); + + _handleTimeDelta = true; + + return; + } + + // Special case of first and last cities + if (city == kParis || city == kConstantinople) { + showFrame(kOverlayTooltip, (city == kParis) ? kTooltipRewindParis : kTooltipForwardConstantinople, true); + return; + } + + showFrame(kOverlayTooltip, (_time <= time) ? _cityButtonsInfo[city].forward : _cityButtonsInfo[city].rewind, true); +} + +////////////////////////////////////////////////////////////////////////// +// Sound / Brightness +////////////////////////////////////////////////////////////////////////// + +// Get current volume (converted internal ScummVM value) +uint32 Menu::getVolume() const { + return getState()->volume; +} + +// Set the volume (converts to ScummVM values) +void Menu::setVolume(uint32 volume) const { + getState()->volume = volume; + + // Clamp volume + uint32 value = volume * Audio::Mixer::kMaxMixerVolume / 7; + + if (value > Audio::Mixer::kMaxMixerVolume) + value = Audio::Mixer::kMaxMixerVolume; + + _engine->_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, (int32)value); +} + +uint32 Menu::getBrightness() const { + return getState()->brightness; +} + +void Menu::setBrightness(uint32 brightness) const { + getState()->brightness = brightness; + + // TODO reload cursor & font with adjusted brightness +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/menu/menu.h b/engines/lastexpress/menu/menu.h new file mode 100644 index 0000000000..4b84c065cb --- /dev/null +++ b/engines/lastexpress/menu/menu.h @@ -0,0 +1,207 @@ +/* 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 LASTEXPRESS_MENU_H +#define LASTEXPRESS_MENU_H + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/eventhandler.h" + +#include "lastexpress/shared.h" + +#include "common/hashmap.h" + +namespace LastExpress { + +class LastExpressEngine; +class Scene; +class SceneHotspot; + +class Clock; +class TrainLine; + +class Menu : public EventHandler { +public: + Menu(LastExpressEngine *engine); + ~Menu(); + + void show(bool doSavegame, SavegameType type, uint32 value); + + // Event handling + void eventMouse(const Common::Event &ev); + void eventTick(const Common::Event &ev); + + bool isShown() const { return _isShowingMenu; } + + GameId getGameId() const { return _gameId; } + +private: + // Start menu events + enum StartMenuAction { + kMenuContinue = 1, + kMenuCredits = 2, + kMenuQuitGame = 3, + kMenuCase4 = 4, + kMenuSwitchSaveGame = 6, + kMenuRewindGame = 7, + kMenuForwardGame = 8, + kMenuParis = 10, + kMenuStrasBourg = 11, + kMenuMunich = 12, + kMenuVienna = 13, + kMenuBudapest = 14, + kMenuBelgrade = 15, + kMenuConstantinople = 16, + kMenuDecreaseVolume = 17, + kMenuIncreaseVolume = 18, + kMenuDecreaseBrightness = 19, + kMenuIncreaseBrightness = 20 + }; + + // City buttons + enum CityButton { + kParis = 0, + kStrasbourg = 1, + kMunich = 2, + kVienna = 3, + kBudapest = 4, + kBelgrade = 5, + kConstantinople = 6 + }; + + // Start menu overlay elements + enum StartMenuOverlay { + kOverlayTooltip, // 0 + kOverlayEggButtons, + kOverlayButtons, + kOverlayAcorn, + kOverlayCity1, + kOverlayCity2, // 5 + kOverlayCity3, + kOverlayCredits + }; + + LastExpressEngine *_engine; + + // Sequences + Sequence *_seqTooltips; + Sequence *_seqEggButtons; + Sequence *_seqButtons; + Sequence *_seqAcorn; + Sequence *_seqCity1; + Sequence *_seqCity2; + Sequence *_seqCity3; + Sequence *_seqCredits; + + GameId _gameId; + + // Indicator to know if we need to show the start animation when showMenu is called + bool _hasShownStartScreen; + bool _hasShownIntro; + + bool _isShowingCredits; + bool _isGameStarted; + bool _isShowingMenu; + + + uint16 _creditsSequenceIndex; + + ////////////////////////////////////////////////////////////////////////// + // Event handling + uint32 _checkHotspotsTicks; + Common::EventType _mouseFlags; + SceneHotspot *_lastHotspot; + + void init(bool doSavegame, SavegameType type, uint32 value); + void setup(); + bool handleEvent(StartMenuAction action, Common::EventType type); + void checkHotspots(); + void setLogicEventHandlers(); + + ////////////////////////////////////////////////////////////////////////// + // Game-related + void startGame(); + void switchGame(); + + ////////////////////////////////////////////////////////////////////////// + // Overlays & elements + Clock *_clock; + TrainLine *_trainLine; + + struct MenuOverlays_EqualTo { + bool operator()(const StartMenuOverlay &x, const StartMenuOverlay &y) const { return x == y; } + }; + + struct MenuOverlays_Hash { + uint operator()(const StartMenuOverlay &x) const { return x; } + }; + + typedef Common::HashMap MenuFrames; + + MenuFrames _frames; + + void hideOverlays(); + void showFrame(StartMenuOverlay overlay, int index, bool redraw); + + void clear(); + + // TODO: remove? + void moveToCity(CityButton city, bool clicked); + + ////////////////////////////////////////////////////////////////////////// + // Misc + Common::String getAcornSequenceName(GameId id) const; + + ////////////////////////////////////////////////////////////////////////// + // Time + uint32 _currentTime; // current game time + uint32 _lowerTime; // lower time value + uint32 _time; + + uint32 _currentIndex; // current savegame entry + uint32 _index; + uint32 _lastIndex; + uint32 _delta; + bool _handleTimeDelta; + + void initTime(SavegameType type, uint32 val); + void updateTime(uint32 time); + void adjustTime(); + void adjustIndex(uint32 time1, uint32 time2, bool searchEntry); + void goToTime(uint32 time); + void setTime(); + void forwardTime(); + void rewindTime(); + bool hasTimeDelta() { return (_currentTime - _time) >= 1; } + + ////////////////////////////////////////////////////////////////////////// + // Sound/Brightness related + uint32 getVolume() const; + void setVolume(uint32 volume) const; + uint32 getBrightness() const; + void setBrightness(uint32 brightness) const; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_MENU_H diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index e81151910b..e38772ad30 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -57,13 +57,13 @@ MODULE_OBJS := \ game/entities.o \ game/inventory.o \ game/logic.o \ - game/menu.o \ game/object.o \ game/savegame.o \ game/savepoint.o \ game/scenes.o \ game/sound.o \ game/state.o \ + menu/menu.o \ debug.o \ detection.o \ graphics.o \ -- cgit v1.2.3 From 7a96e0bfb67e9b5b8c0aa9bdae8415fb98214c3f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 00:05:01 -0400 Subject: LASTEXPRESS: Extract Clock and TrainLine classes to separate files --- engines/lastexpress/menu/clock.cpp | 106 ++++++++++++++++ engines/lastexpress/menu/clock.h | 53 ++++++++ engines/lastexpress/menu/menu.cpp | 221 +-------------------------------- engines/lastexpress/menu/trainline.cpp | 142 +++++++++++++++++++++ engines/lastexpress/menu/trainline.h | 51 ++++++++ engines/lastexpress/module.mk | 2 + 6 files changed, 357 insertions(+), 218 deletions(-) create mode 100644 engines/lastexpress/menu/clock.cpp create mode 100644 engines/lastexpress/menu/clock.h create mode 100644 engines/lastexpress/menu/trainline.cpp create mode 100644 engines/lastexpress/menu/trainline.h diff --git a/engines/lastexpress/menu/clock.cpp b/engines/lastexpress/menu/clock.cpp new file mode 100644 index 0000000000..b0e6a260d4 --- /dev/null +++ b/engines/lastexpress/menu/clock.cpp @@ -0,0 +1,106 @@ +/* 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 "lastexpress/menu/clock.h" + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/scenes.h" +#include "lastexpress/game/state.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) { + _frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true); + _frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true); + _frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true); + _frameDate = new SequenceFrame(loadSequence("datenew.seq"), 0, true); +} + +Clock::~Clock() { + SAFE_DELETE(_frameMinutes); + SAFE_DELETE(_frameHour); + SAFE_DELETE(_frameSun); + SAFE_DELETE(_frameDate); + + // Zero passed pointers + _engine = NULL; +} + +void Clock::clear() { + getScenes()->removeFromQueue(_frameMinutes); + getScenes()->removeFromQueue(_frameHour); + getScenes()->removeFromQueue(_frameSun); + getScenes()->removeFromQueue(_frameDate); +} + +void Clock::draw(uint32 time) { + assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); + + // Check that sequences have been loaded + if (!_frameMinutes || !_frameHour || !_frameSun || !_frameDate) + error("Clock::process: clock sequences have not been loaded correctly!"); + + // Clear existing frames + clear(); + + // Game starts at: 1037700 = 7:13 p.m. on July 24, 1914 + // Game ends at: 4941000 = 7:30 p.m. on July 26, 1914 + // Game lasts for: 3903300 = 2 days + 17 mins = 2897 mins + + // 15 = 1 second + // 15 * 60 = 900 = 1 minute + // 900 * 60 = 54000 = 1 hour + // 54000 * 24 = 1296000 = 1 day + + // Calculate each sequence index from the current time + + uint8 hour = 0; + uint8 minute = 0; + State::getHourMinutes(time, &hour, &minute); + uint32 index_date = 18 * time / 1296000; + if (hour == 23) + index_date += 18 * minute / 60; + + // Set sequences frames + _frameMinutes->setFrame(minute); + _frameHour->setFrame((5 * hour + minute / 12) % 60); + _frameSun->setFrame((5 * hour + minute / 12) % 120); + _frameDate->setFrame((uint16)index_date); + + // Adjust z-order and queue + _frameMinutes->getInfo()->location = 1; + _frameHour->getInfo()->location = 1; + _frameSun->getInfo()->location = 1; + _frameDate->getInfo()->location = 1; + + getScenes()->addToQueue(_frameMinutes); + getScenes()->addToQueue(_frameHour); + getScenes()->addToQueue(_frameSun); + getScenes()->addToQueue(_frameDate); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/menu/clock.h b/engines/lastexpress/menu/clock.h new file mode 100644 index 0000000000..339a18604f --- /dev/null +++ b/engines/lastexpress/menu/clock.h @@ -0,0 +1,53 @@ +/* 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 LASTEXPRESS_CLOCK_H +#define LASTEXPRESS_CLOCK_H + +#include "common/scummsys.h" + +namespace LastExpress { + +class LastExpressEngine; +class SequenceFrame; + +class Clock { +public: + explicit Clock(LastExpressEngine *engine); + ~Clock(); + + void draw(uint32 time); + void clear(); + +private: + LastExpressEngine *_engine; + + // Frames + SequenceFrame *_frameMinutes; + SequenceFrame *_frameHour; + SequenceFrame *_frameSun; + SequenceFrame *_frameDate; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_CLOCK_H diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index b7e6a1430a..e55a6d5960 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -38,6 +38,9 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/menu/clock.h" +#include "lastexpress/menu/trainline.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -119,45 +122,6 @@ enum StartMenuTooltips { ////////////////////////////////////////////////////////////////////////// // DATA ////////////////////////////////////////////////////////////////////////// - -// Information about the cities on the train line -static const struct { - uint8 frame; - TimeValue time; -} _trainCities[31] = { - {0, kTimeCityParis}, - {9, kTimeCityEpernay}, - {11, kTimeCityChalons}, - {16, kTimeCityBarLeDuc}, - {21, kTimeCityNancy}, - {25, kTimeCityLuneville}, - {35, kTimeCityAvricourt}, - {37, kTimeCityDeutschAvricourt}, - {40, kTimeCityStrasbourg}, - {53, kTimeCityBadenOos}, - {56, kTimeCityKarlsruhe}, - {60, kTimeCityStuttgart}, - {63, kTimeCityGeislingen}, - {66, kTimeCityUlm}, - {68, kTimeCityAugsburg}, - {73, kTimeCityMunich}, - {84, kTimeCitySalzbourg}, - {89, kTimeCityAttnangPuchheim}, - {97, kTimeCityWels}, - {100, kTimeCityLinz}, - {104, kTimeCityAmstetten}, - {111, kTimeCityVienna}, - {120, kTimeCityPoszony}, - {124, kTimeCityGalanta}, - {132, kTimeCityBudapest}, - {148, kTimeCityBelgrade}, - /* Line 1 ends at 150 - line 2 begins at 0 */ - {157, kTimeCityNish}, - {165, kTimeCityTzaribrod}, - {174, kTimeCitySofia}, - {198, kTimeCityAdrianople}, - {210, kTimeCityConstantinople}}; - static const struct { TimeValue time; uint index; @@ -173,185 +137,6 @@ static const struct { {kTimeCityConstantinople, 192, kTooltipForwardConstantinople, kTooltipForwardConstantinople} }; -////////////////////////////////////////////////////////////////////////// -// Clock -////////////////////////////////////////////////////////////////////////// -class Clock { -public: - explicit Clock(LastExpressEngine *engine); - ~Clock(); - - void draw(uint32 time); - void clear(); - -private: - LastExpressEngine *_engine; - - // Frames - SequenceFrame *_frameMinutes; - SequenceFrame *_frameHour; - SequenceFrame *_frameSun; - SequenceFrame *_frameDate; -}; - -Clock::Clock(LastExpressEngine *engine) : _engine(engine), _frameMinutes(NULL), _frameHour(NULL), _frameSun(NULL), _frameDate(NULL) { - _frameMinutes = new SequenceFrame(loadSequence("eggmin.seq"), 0, true); - _frameHour = new SequenceFrame(loadSequence("egghour.seq"), 0, true); - _frameSun = new SequenceFrame(loadSequence("sun.seq"), 0, true); - _frameDate = new SequenceFrame(loadSequence("datenew.seq"), 0, true); -} - -Clock::~Clock() { - SAFE_DELETE(_frameMinutes); - SAFE_DELETE(_frameHour); - SAFE_DELETE(_frameSun); - SAFE_DELETE(_frameDate); - - // Zero passed pointers - _engine = NULL; -} - -void Clock::clear() { - getScenes()->removeFromQueue(_frameMinutes); - getScenes()->removeFromQueue(_frameHour); - getScenes()->removeFromQueue(_frameSun); - getScenes()->removeFromQueue(_frameDate); -} - -void Clock::draw(uint32 time) { - assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); - - // Check that sequences have been loaded - if (!_frameMinutes || !_frameHour || !_frameSun || !_frameDate) - error("Clock::process: clock sequences have not been loaded correctly!"); - - // Clear existing frames - clear(); - - // Game starts at: 1037700 = 7:13 p.m. on July 24, 1914 - // Game ends at: 4941000 = 7:30 p.m. on July 26, 1914 - // Game lasts for: 3903300 = 2 days + 17 mins = 2897 mins - - // 15 = 1 second - // 15 * 60 = 900 = 1 minute - // 900 * 60 = 54000 = 1 hour - // 54000 * 24 = 1296000 = 1 day - - // Calculate each sequence index from the current time - - uint8 hour = 0; - uint8 minute = 0; - State::getHourMinutes(time, &hour, &minute); - uint32 index_date = 18 * time / 1296000; - if (hour == 23) - index_date += 18 * minute / 60; - - // Set sequences frames - _frameMinutes->setFrame(minute); - _frameHour->setFrame((5 * hour + minute / 12) % 60); - _frameSun->setFrame((5 * hour + minute / 12) % 120); - _frameDate->setFrame((uint16)index_date); - - // Adjust z-order and queue - _frameMinutes->getInfo()->location = 1; - _frameHour->getInfo()->location = 1; - _frameSun->getInfo()->location = 1; - _frameDate->getInfo()->location = 1; - - getScenes()->addToQueue(_frameMinutes); - getScenes()->addToQueue(_frameHour); - getScenes()->addToQueue(_frameSun); - getScenes()->addToQueue(_frameDate); -} - -////////////////////////////////////////////////////////////////////////// -// TrainLine -////////////////////////////////////////////////////////////////////////// -class TrainLine { -public: - explicit TrainLine(LastExpressEngine *engine); - ~TrainLine(); - - void draw(uint32 time); - void clear(); - -private: - LastExpressEngine *_engine; - - // Frames - SequenceFrame *_frameLine1; - SequenceFrame *_frameLine2; -}; - -TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) { - _frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true); - _frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true); -} - -TrainLine::~TrainLine() { - SAFE_DELETE(_frameLine1); - SAFE_DELETE(_frameLine2); - - // Zero passed pointers - _engine = NULL; -} - -void TrainLine::clear() { - getScenes()->removeFromQueue(_frameLine1); - getScenes()->removeFromQueue(_frameLine2); -} - -// Draw the train line at the time -// line1: 150 frames (=> Belgrade) -// line2: 61 frames (=> Constantinople) -void TrainLine::draw(uint32 time) { - assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); - - // Check that sequences have been loaded - if (!_frameLine1 || !_frameLine2) - error("TrainLine::process: Line sequences have not been loaded correctly!"); - - // Clear existing frames - clear(); - - // Get the index of the last city the train has visited - uint index = 0; - for (uint i = 0; i < ARRAYSIZE(_trainCities); i++) - if ((uint32)_trainCities[i].time <= time) - index = i; - - uint16 frame; - if (time > (uint32)_trainCities[index].time) { - // Interpolate linearly to use a frame between the cities - uint8 diffFrames = _trainCities[index + 1].frame - _trainCities[index].frame; - uint diffTimeCities = (uint)(_trainCities[index + 1].time - _trainCities[index].time); - uint traveledTime = (time - (uint)_trainCities[index].time); - frame = (uint16)(_trainCities[index].frame + (traveledTime * diffFrames) / diffTimeCities); - } else { - // Exactly on the city - frame = _trainCities[index].frame; - } - - // Set frame, z-order and queue - if (frame < 150) { - _frameLine1->setFrame(frame); - - _frameLine1->getInfo()->location = 1; - getScenes()->addToQueue(_frameLine1); - } else { - // We passed Belgrade - _frameLine1->setFrame(149); - _frameLine2->setFrame(frame - 150); - - _frameLine1->getInfo()->location = 1; - _frameLine2->getInfo()->location = 1; - - getScenes()->addToQueue(_frameLine1); - getScenes()->addToQueue(_frameLine2); - } -} - - ////////////////////////////////////////////////////////////////////////// // Menu ////////////////////////////////////////////////////////////////////////// diff --git a/engines/lastexpress/menu/trainline.cpp b/engines/lastexpress/menu/trainline.cpp new file mode 100644 index 0000000000..df08abf37b --- /dev/null +++ b/engines/lastexpress/menu/trainline.cpp @@ -0,0 +1,142 @@ +/* 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 "lastexpress/menu/trainline.h" + +#include "lastexpress/data/sequence.h" + +#include "lastexpress/game/scenes.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +// Information about the cities on the train line +static const struct { + uint8 frame; + TimeValue time; +} _trainCities[31] = { + {0, kTimeCityParis}, + {9, kTimeCityEpernay}, + {11, kTimeCityChalons}, + {16, kTimeCityBarLeDuc}, + {21, kTimeCityNancy}, + {25, kTimeCityLuneville}, + {35, kTimeCityAvricourt}, + {37, kTimeCityDeutschAvricourt}, + {40, kTimeCityStrasbourg}, + {53, kTimeCityBadenOos}, + {56, kTimeCityKarlsruhe}, + {60, kTimeCityStuttgart}, + {63, kTimeCityGeislingen}, + {66, kTimeCityUlm}, + {68, kTimeCityAugsburg}, + {73, kTimeCityMunich}, + {84, kTimeCitySalzbourg}, + {89, kTimeCityAttnangPuchheim}, + {97, kTimeCityWels}, + {100, kTimeCityLinz}, + {104, kTimeCityAmstetten}, + {111, kTimeCityVienna}, + {120, kTimeCityPoszony}, + {124, kTimeCityGalanta}, + {132, kTimeCityBudapest}, + {148, kTimeCityBelgrade}, + /* Line 1 ends at 150 - line 2 begins at 0 */ + {157, kTimeCityNish}, + {165, kTimeCityTzaribrod}, + {174, kTimeCitySofia}, + {198, kTimeCityAdrianople}, + {210, kTimeCityConstantinople} +}; + +TrainLine::TrainLine(LastExpressEngine *engine) : _engine(engine), _frameLine1(NULL), _frameLine2(NULL) { + _frameLine1 = new SequenceFrame(loadSequence("line1.seq"), 0, true); + _frameLine2 = new SequenceFrame(loadSequence("line2.seq"), 0, true); +} + +TrainLine::~TrainLine() { + SAFE_DELETE(_frameLine1); + SAFE_DELETE(_frameLine2); + + // Zero passed pointers + _engine = NULL; +} + +void TrainLine::clear() { + getScenes()->removeFromQueue(_frameLine1); + getScenes()->removeFromQueue(_frameLine2); +} + +// Draw the train line at the time +// line1: 150 frames (=> Belgrade) +// line2: 61 frames (=> Constantinople) +void TrainLine::draw(uint32 time) { + assert(time >= kTimeCityParis && time <= kTimeCityConstantinople); + + // Check that sequences have been loaded + if (!_frameLine1 || !_frameLine2) + error("TrainLine::process: Line sequences have not been loaded correctly!"); + + // Clear existing frames + clear(); + + // Get the index of the last city the train has visited + uint index = 0; + for (uint i = 0; i < ARRAYSIZE(_trainCities); i++) + if ((uint32)_trainCities[i].time <= time) + index = i; + + uint16 frame; + if (time > (uint32)_trainCities[index].time) { + // Interpolate linearly to use a frame between the cities + uint8 diffFrames = _trainCities[index + 1].frame - _trainCities[index].frame; + uint diffTimeCities = (uint)(_trainCities[index + 1].time - _trainCities[index].time); + uint traveledTime = (time - (uint)_trainCities[index].time); + frame = (uint16)(_trainCities[index].frame + (traveledTime * diffFrames) / diffTimeCities); + } else { + // Exactly on the city + frame = _trainCities[index].frame; + } + + // Set frame, z-order and queue + if (frame < 150) { + _frameLine1->setFrame(frame); + + _frameLine1->getInfo()->location = 1; + getScenes()->addToQueue(_frameLine1); + } else { + // We passed Belgrade + _frameLine1->setFrame(149); + _frameLine2->setFrame(frame - 150); + + _frameLine1->getInfo()->location = 1; + _frameLine2->getInfo()->location = 1; + + getScenes()->addToQueue(_frameLine1); + getScenes()->addToQueue(_frameLine2); + } +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/menu/trainline.h b/engines/lastexpress/menu/trainline.h new file mode 100644 index 0000000000..af6a121e9c --- /dev/null +++ b/engines/lastexpress/menu/trainline.h @@ -0,0 +1,51 @@ +/* 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 LASTEXPRESS_TRAINLINE_H +#define LASTEXPRESS_TRAINLINE_H + +#include "common/scummsys.h" + +namespace LastExpress { + +class LastExpressEngine; +class SequenceFrame; + +class TrainLine { +public: + explicit TrainLine(LastExpressEngine *engine); + ~TrainLine(); + + void draw(uint32 time); + void clear(); + +private: + LastExpressEngine *_engine; + + // Frames + SequenceFrame *_frameLine1; + SequenceFrame *_frameLine2; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_TRAINLINE_H diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index e38772ad30..71d81da0c9 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -63,7 +63,9 @@ MODULE_OBJS := \ game/scenes.o \ game/sound.o \ game/state.o \ + menu/clock.o \ menu/menu.o \ + menu/trainline.o \ debug.o \ detection.o \ graphics.o \ -- cgit v1.2.3 From b694a78f62a02253bca2a5611314599ae7fce725 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 05:42:48 -0400 Subject: ANALYSIS: Add static casts to is* functions This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results. See http://msdn.microsoft.com/en-us/library/ms245348.aspx --- base/commandLine.cpp | 2 +- common/config-file.cpp | 6 +++--- common/config-manager.cpp | 6 +++--- common/str.cpp | 6 +++--- common/xmlparser.cpp | 10 +++++----- common/xmlparser.h | 2 +- engines/agi/wagparser.cpp | 4 ++-- engines/agos/script_pn.cpp | 8 ++++---- engines/cine/detection.cpp | 2 +- engines/drascula/interface.cpp | 2 +- engines/hugo/parser.cpp | 2 +- engines/hugo/util.cpp | 2 +- engines/kyra/gui.cpp | 2 +- engines/m4/dialogs.cpp | 2 +- engines/parallaction/parser_br.cpp | 12 ++++++------ engines/parallaction/parser_ns.cpp | 2 +- engines/queen/talk.cpp | 2 +- engines/sci/engine/kstring.cpp | 4 ++-- engines/sci/graphics/text16.cpp | 2 +- engines/sci/resource.cpp | 4 ++-- engines/sci/resource_audio.cpp | 2 +- engines/scumm/smush/smush_player.cpp | 4 ++-- engines/scumm/string.cpp | 8 ++++---- engines/sky/detection.cpp | 2 +- engines/sword1/animation.cpp | 2 +- engines/sword25/util/lua/llex.cpp | 2 +- engines/touche/menu.cpp | 2 +- graphics/font.cpp | 2 +- 28 files changed, 53 insertions(+), 53 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 6cb858525e..2620d69ba2 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -279,7 +279,7 @@ void registerDefaults() { // resp. between "--some-option" and "--no-some-option". #define DO_OPTION_BOOL(shortCmd, longCmd) \ if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-"longCmd)) : (tolower(s[1]) == shortCmd)) { \ - bool boolValue = (islower(s[1]) != 0); \ + bool boolValue = (islower(static_cast(s[1])) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ diff --git a/common/config-file.cpp b/common/config-file.cpp index 55941131ac..ea3feff8ae 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -38,7 +38,7 @@ namespace Common { */ bool ConfigFile::isValidName(const Common::String &name) { const char *p = name.c_str(); - while (*p && (isalnum(*p) || *p == '-' || *p == '_' || *p == '.')) + while (*p && (isalnum(static_cast(*p)) || *p == '-' || *p == '_' || *p == '.')) p++; return *p == 0; } @@ -116,7 +116,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { // is, verify that it only consists of alphanumerics, // periods, dashes and underscores). Mohawk Living Books games // can have periods in their section names. - while (*p && (isalnum(*p) || *p == '-' || *p == '_' || *p == '.')) + while (*p && (isalnum(static_cast(*p)) || *p == '-' || *p == '_' || *p == '.')) p++; if (*p == '\0') @@ -139,7 +139,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { // Skip leading whitespaces const char *t = line.c_str(); - while (isspace(*t)) + while (isspace(static_cast(*t))) t++; // Skip empty lines / lines with only whitespace diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 3941e27cc1..a9d8c89035 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -31,7 +31,7 @@ DECLARE_SINGLETON(Common::ConfigManager); static bool isValidDomainName(const Common::String &domName) { const char *p = domName.c_str(); - while (*p && (isalnum(*p) || *p == '-' || *p == '_')) + while (*p && (isalnum(static_cast(*p)) || *p == '-' || *p == '_')) p++; return *p == 0; } @@ -187,7 +187,7 @@ void ConfigManager::loadFromStream(SeekableReadStream &stream) { // Get the domain name, and check whether it's valid (that // is, verify that it only consists of alphanumerics, // dashes and underscores). - while (*p && (isalnum(*p) || *p == '-' || *p == '_')) + while (*p && (isalnum(static_cast(*p)) || *p == '-' || *p == '_')) p++; if (*p == '\0') @@ -205,7 +205,7 @@ void ConfigManager::loadFromStream(SeekableReadStream &stream) { // Skip leading whitespaces const char *t = line.c_str(); - while (isspace(*t)) + while (isspace(static_cast(*t))) t++; // Skip empty lines / lines with only whitespace diff --git a/common/str.cpp b/common/str.cpp index a2cd4a0193..32f4b44e79 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -405,7 +405,7 @@ void String::trim() { makeUnique(); // Trim trailing whitespace - while (_size >= 1 && isspace(_str[_size - 1])) + while (_size >= 1 && isspace(static_cast(_str[_size - 1]))) --_size; _str[_size] = 0; @@ -606,14 +606,14 @@ String operator+(const String &x, char y) { } char *ltrim(char *t) { - while (isspace(*t)) + while (isspace(static_cast(*t))) t++; return t; } char *rtrim(char *t) { int l = strlen(t) - 1; - while (l >= 0 && isspace(t[l])) + while (l >= 0 && isspace(static_cast(t[l]))) t[l--] = 0; return t; } diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index 5217c4e82c..623619914a 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -263,7 +263,7 @@ bool XMLParser::vparseIntegerKey(const char *key, int count, va_list args) { int *num_ptr; while (count--) { - while (isspace(*key)) + while (isspace(static_cast(*key))) key++; num_ptr = va_arg(args, int*); @@ -271,7 +271,7 @@ bool XMLParser::vparseIntegerKey(const char *key, int count, va_list args) { key = parseEnd; - while (isspace(*key)) + while (isspace(static_cast(*key))) key++; if (count && *key++ != ',') @@ -463,10 +463,10 @@ bool XMLParser::parse() { } bool XMLParser::skipSpaces() { - if (!isspace(_char)) + if (!isspace(static_cast(_char))) return false; - while (_char && isspace(_char)) + while (_char && isspace(static_cast(_char))) _char = _stream->readByte(); return true; @@ -516,7 +516,7 @@ bool XMLParser::parseToken() { _char = _stream->readByte(); } - return isspace(_char) != 0 || _char == '>' || _char == '=' || _char == '/'; + return isspace(static_cast(_char)) != 0 || _char == '>' || _char == '=' || _char == '/'; } } // End of namespace Common diff --git a/common/xmlparser.h b/common/xmlparser.h index 7923e43a37..40c779b87e 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -294,7 +294,7 @@ protected: * in their name. */ virtual inline bool isValidNameChar(char c) { - return isalnum(c) || c == '_'; + return isalnum(static_cast(c)) || c == '_'; } /** diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index 14159c0147..39f9e0dd92 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -112,11 +112,11 @@ WagFileParser::~WagFileParser() { bool WagFileParser::checkAgiVersionProperty(const WagProperty &version) const { if (version.getCode() == WagProperty::PC_INTVERSION && // Must be AGI interpreter version property version.getSize() >= 3 && // Need at least three characters for a version number like "X.Y" - isdigit(version.getData()[0]) && // And the first character must be a digit + isdigit(static_cast(version.getData()[0])) && // And the first character must be a digit (version.getData()[1] == ',' || version.getData()[1] == '.')) { // And the second a comma or a period for (int i = 2; i < version.getSize(); i++) // And the rest must all be digits - if (!isdigit(version.getData()[i])) + if (!isdigit(static_cast(version.getData()[i]))) return false; // Bail out if found a non-digit after the decimal point return true; diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index bde59b71b8..3bd8ce19a3 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -465,8 +465,8 @@ void AGOSEngine_PN::opn_opcode35() { void AGOSEngine_PN::opn_opcode36() { for (int i = 0; i < _dataBase[57] + 1; ++i) _wordcp[i] = 0; - if (isspace(*_inpp)) - while ((*_inpp) && (isspace(*_inpp))) + if (isspace(static_cast(*_inpp))) + while ((*_inpp) && (isspace(static_cast(*_inpp)))) _inpp++; if (*_inpp == 0) { setScriptReturn(false); @@ -480,7 +480,7 @@ void AGOSEngine_PN::opn_opcode36() { } int ct = 1; - while ((*_inpp != '.') && (*_inpp != ',') && (!isspace(*_inpp)) && (*_inpp != '\0') && + while ((*_inpp != '.') && (*_inpp != ',') && (!isspace(static_cast(*_inpp))) && (*_inpp != '\0') && (*_inpp!='"')) { if (ct < _dataBase[57]) _wordcp[ct++] = *_inpp; @@ -580,7 +580,7 @@ void AGOSEngine_PN::opn_opcode46() { return; } x++; - while ((*x != '.') && (*x != ',') && (*x != '"') && (!isspace(*x)) && (*x != '\0')) + while ((*x != '.') && (*x != ',') && (*x != '"') && (!isspace(static_cast(*x))) && (*x != '\0')) pcf(*x++); setScriptReturn(true); } diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index cffeb29418..ba0251520b 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -141,7 +141,7 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const { for (file = filenames.begin(); file != filenames.end(); ++file) { // Jump over savegame files that don't end with a digit (e.g. "fw.3" is ok, "fw.a" is not). - if (!isdigit(file->lastChar())) + if (!isdigit(static_cast(file->lastChar()))) continue; // Obtain the last digit of the filename, since they correspond to the save slot diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index eb36baed18..e3a97087c0 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -159,7 +159,7 @@ void DrasculaEngine::enterName() { key = getScan(); if (key != 0) { - if (key >= 0 && key <= 0xFF && isalpha(key)) + if (key >= 0 && key <= 0xFF && isalpha(static_cast(key))) select2[v] = tolower(key); else if ((key >= Common::KEYCODE_0 && key <= Common::KEYCODE_9) || key == Common::KEYCODE_SPACE) select2[v] = key; diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 5cb97f2dc5..38a8e4e3ff 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -235,7 +235,7 @@ void Parser::charHandler() { if (_cmdLineIndex >= kMaxLineSize) { //MessageBeep(MB_ICONASTERISK); warning("STUB: MessageBeep() - Command line too long"); - } else if (isprint(c)) { + } else if (isprint(static_cast(c))) { _cmdLine[_cmdLineIndex++] = c; _cmdLine[_cmdLineIndex] = '\0'; } diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index a936a23de1..6dc9890c3a 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -119,7 +119,7 @@ char *strlwr(char *buffer) { char *result = buffer; while (*buffer != '\0') { - if (isupper(*buffer)) + if (isupper(static_cast(*buffer))) *buffer = tolower(*buffer); buffer++; } diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index f58ca0117c..29cbe20b23 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -375,7 +375,7 @@ void GUI::updateSaveList(bool excludeQuickSaves) { s1 = (*i)[i->size()-3]; s2 = (*i)[i->size()-2]; s3 = (*i)[i->size()-1]; - if (!isdigit(s1) || !isdigit(s2) || !isdigit(s3)) + if (!isdigit(static_cast(s1)) || !isdigit(static_cast(s2)) || !isdigit(static_cast(s3))) continue; s1 -= '0'; s2 -= '0'; diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index 390ca711d1..2b2c479673 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -265,7 +265,7 @@ void Dialog::setupInputArea() { */ bool Dialog::matchCommand(const char *s1, const char *s2) { bool result = scumm_strnicmp(s1, s2, strlen(s2)) == 0; - _commandCase = isupper(*s1); + _commandCase = isupper(static_cast(*s1)); return result; } diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index f53d71caec..df53ecca3f 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -524,14 +524,14 @@ DECLARE_COMMAND_PARSER(location) { ctxt.cmd->_startPos.x = -1000; ctxt.cmd->_startPos2.x = -1000; if (_tokens[ctxt.nextToken][0] != '\0') { - if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') { + if (isdigit(static_cast(_tokens[ctxt.nextToken][0])) || _tokens[ctxt.nextToken][0] == '-') { ctxt.cmd->_startPos.x = atoi(_tokens[ctxt.nextToken]); ctxt.nextToken++; ctxt.cmd->_startPos.y = atoi(_tokens[ctxt.nextToken]); ctxt.nextToken++; } - if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') { + if (isdigit(static_cast(_tokens[ctxt.nextToken][0])) || _tokens[ctxt.nextToken][0] == '-') { ctxt.cmd->_startPos2.x = atoi(_tokens[ctxt.nextToken]); ctxt.nextToken++; ctxt.cmd->_startPos2.y = atoi(_tokens[ctxt.nextToken]); @@ -677,7 +677,7 @@ DECLARE_COMMAND_PARSER(text) { createCommand(_parser->_lookup); - if (isdigit(_tokens[1][1])) { + if (isdigit(static_cast(_tokens[1][1]))) { ctxt.cmd->_zeta0 = atoi(_tokens[1]); ctxt.nextToken++; } else { @@ -714,7 +714,7 @@ DECLARE_COMMAND_PARSER(unary) { DECLARE_ZONE_PARSER(limits) { debugC(7, kDebugParser, "ZONE_PARSER(limits) "); - if (isalpha(_tokens[1][1])) { + if (isalpha(static_cast(_tokens[1][1]))) { ctxt.z->_flags |= kFlagsAnimLinked; ctxt.z->_linkedName = _tokens[1]; } else { @@ -1003,7 +1003,7 @@ DECLARE_INSTRUCTION_PARSER(text) { int _si = 1; - if (isdigit(_tokens[1][1])) { + if (isdigit(static_cast(_tokens[1][1]))) { ctxt.inst->_y = atoi(_tokens[1]); _si = 2; } else { @@ -1066,7 +1066,7 @@ DECLARE_INSTRUCTION_PARSER(endif) { void ProgramParser_br::parseRValue(ScriptVar &v, const char *str) { - if (isdigit(str[0]) || str[0] == '-') { + if (isdigit(static_cast(str[0])) || str[0] == '-') { v.setImmediate(atoi(str)); return; } diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 213f0ae191..100b608172 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -534,7 +534,7 @@ DECLARE_INSTRUCTION_PARSER(endscript) { void ProgramParser_ns::parseRValue(ScriptVar &v, const char *str) { - if (isdigit(str[0]) || str[0] == '-') { + if (isdigit(static_cast(str[0])) || str[0] == '-') { v.setImmediate(atoi(str)); return; } diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index b83bf60435..1f8d9b29f9 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -658,7 +658,7 @@ void Talk::stringAnimation(const SpeechParameters *parameters, int startFrame, i } else if (parameters->animation[0] == 'E') { // Talking head animation return; - } else if (!isdigit(parameters->animation[0])) { + } else if (!isdigit(static_cast(parameters->animation[0]))) { debug(6, "Error in speak string animation: '%s'", parameters->animation); return; } else diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 07b87a7cbc..9f10691767 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -238,14 +238,14 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { /* int writelength; -- unused atm */ - if (xfer && (isdigit(xfer) || xfer == '-' || xfer == '=')) { + if (xfer && (isdigit(static_cast(xfer)) || xfer == '-' || xfer == '=')) { char *destp; if (xfer == '0') fillchar = '0'; else if (xfer == '=') align = ALIGN_CENTER; - else if (isdigit(xfer) || (xfer == '-')) + else if (isdigit(static_cast(xfer)) || (xfer == '-')) source--; // Go to start of length argument str_leng = strtol(source, &destp, 10); diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index c2f71a0e54..84547d9828 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -100,7 +100,7 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1 // cX -> sets textColor to _textColors[X-1] curCode = textCode[0]; curCodeParm = textCode[1]; - if (isdigit(curCodeParm)) { + if (isdigit(static_cast(curCodeParm))) { curCodeParm -= '0'; } else { curCodeParm = -1; diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index fa70481bdc..f18b6c91f5 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1555,7 +1555,7 @@ void ResourceManager::readResourcePatches() { name = (*x)->getName(); // SCI1 scheme - if (isdigit(name[0])) { + if (isdigit(static_cast(name[0]))) { char *end = 0; resourceNr = strtol(name.c_str(), &end, 10); bAdd = (*end == '.'); // Ensure the next character is the period @@ -1563,7 +1563,7 @@ void ResourceManager::readResourcePatches() { // SCI0 scheme int resname_len = strlen(szResType); if (scumm_strnicmp(name.c_str(), szResType, resname_len) == 0 - && !isalpha(name[resname_len + 1])) { + && !isalpha(static_cast(name[resname_len + 1]))) { resourceNr = atoi(name.c_str() + resname_len + 1); bAdd = true; } diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 032040fc2c..f3a3c8dd5b 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -197,7 +197,7 @@ void ResourceManager::readWaveAudioPatches() { for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) { Common::String name = (*x)->getName(); - if (isdigit(name[0])) + if (isdigit(static_cast(name[0]))) processWavePatch(ResourceId(kResourceTypeAudio, atoi(name.c_str())), name); } } diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 66502572de..2f4e86bf61 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -90,13 +90,13 @@ public: assert(def_end != NULL); char *id_end = def_end; - while (id_end >= def_start && !isdigit(*(id_end-1))) { + while (id_end >= def_start && !isdigit(static_cast(*(id_end-1)))) { id_end--; } assert(id_end > def_start); char *id_start = id_end; - while (isdigit(*(id_start - 1))) { + while (isdigit(static_cast(*(id_start - 1)))) { id_start--; } diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 4b3207c6bf..2d2209c155 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -1383,10 +1383,10 @@ void ScummEngine_v7::loadLanguageBundle() { } else if (*ptr == '#') { // Number of subtags following a given basetag. We don't need that // information so we just skip it - } else if (isdigit(*ptr)) { + } else if (isdigit(static_cast(*ptr))) { int idx = 0; // A number (up to three digits)... - while (isdigit(*ptr)) { + while (isdigit(static_cast(*ptr))) { idx = idx * 10 + (*ptr - '0'); ptr++; } @@ -1424,12 +1424,12 @@ void ScummEngine_v7::loadLanguageBundle() { for (i = 0; i < _languageIndexSize; i++) { // First 8 chars in the line give the string ID / 'tag' int j; - for (j = 0; j < 8 && !isspace(*ptr); j++, ptr++) + for (j = 0; j < 8 && !isspace(static_cast(*ptr)); j++, ptr++) _languageIndex[i].tag[j] = toupper(*ptr); _languageIndex[i].tag[j] = 0; // After that follows a single space which we skip - assert(isspace(*ptr)); + assert(isspace(static_cast(*ptr))); ptr++; // Then comes the translated string: we record an offset to that. diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index f3cce06ad6..a1067496da 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -206,7 +206,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { // Extract the extension Common::String ext = file->c_str() + file->size() - 3; ext.toUppercase(); - if (isdigit(ext[0]) && isdigit(ext[1]) && isdigit(ext[2])){ + if (isdigit(static_cast(ext[0])) && isdigit(static_cast(ext[1])) && isdigit(static_cast(ext[2]))){ int slotNum = atoi(ext.c_str()); Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 4ce3e2e88d..f19efd2635 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -114,7 +114,7 @@ bool MoviePlayer::load(uint32 id) { int startFrame = strtoul(ptr, const_cast(&ptr), 10); int endFrame = strtoul(ptr, const_cast(&ptr), 10); - while (*ptr && isspace(*ptr)) + while (*ptr && isspace(static_cast(*ptr))) ptr++; if (startFrame > endFrame) { diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp index 4d73a6a600..b456ee2dfe 100644 --- a/engines/sword25/util/lua/llex.cpp +++ b/engines/sword25/util/lua/llex.cpp @@ -188,7 +188,7 @@ static void trydecpoint (LexState *ls, SemInfo *seminfo) { sprintf(buf, "%.1f", 1.0); ls->decpoint = '.'; for (i = 0; buf[i]; i++) { - if (!isspace(buf[i]) && !isdigit(buf[i])) { + if (!isspace(static_cast(buf[i])) && !isdigit(static_cast(buf[i]))) { ls->decpoint = buf[i]; break; } diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index f469a95803..c58e2f1a33 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -103,7 +103,7 @@ struct MenuData { void addCharToDescription(int slot, char chr) { char *description = saveLoadDescriptionsTable[slot]; int descriptionLen = strlen(description); - if (descriptionLen < 32 && isprint(chr)) { + if (descriptionLen < 32 && isprint(static_cast(chr))) { description[descriptionLen] = chr; description[descriptionLen + 1] = 0; } diff --git a/graphics/font.cpp b/graphics/font.cpp index d254c64264..0c180ee47d 100644 --- a/graphics/font.cpp +++ b/graphics/font.cpp @@ -948,7 +948,7 @@ int Font::wordWrapText(const Common::String &str, int maxWidth, Common::Array 0) { wrapper.add(line, lineWidth); // Trim left side - while (tmpStr.size() && isspace(tmpStr[0])) { + while (tmpStr.size() && isspace(static_cast(tmpStr[0]))) { tmpWidth -= getCharWidth(tmpStr[0]); tmpStr.deleteChar(0); } -- cgit v1.2.3 From 712af61f76148095cd3b8762eeb2b2b10502df1f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 08:49:27 -0400 Subject: BACKENDS: Silence warnings when compiling Win32TaskbarManager with mingw and add CLSID_ShellLink definition --- backends/taskbar/win32/mingw-compat.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backends/taskbar/win32/mingw-compat.h b/backends/taskbar/win32/mingw-compat.h index bf03db9abd..30ce818141 100644 --- a/backends/taskbar/win32/mingw-compat.h +++ b/backends/taskbar/win32/mingw-compat.h @@ -45,10 +45,10 @@ #include #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK -// Misc enumeration values -#ifndef SHARD_LINK +extern const GUID CLSID_ShellLink; + +// Shard enumeration value #define SHARD_LINK 0x00000006 -#endif // Taskbar GUID definitions DEFINE_GUID(CLSID_TaskbarList,0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90); @@ -73,6 +73,9 @@ DECLARE_INTERFACE_(IPropertyStore, IUnknown) { STDMETHOD (GetValue) (REFPROPERTYKEY key, PROPVARIANT *pv) PURE; STDMETHOD (SetValue) (REFPROPERTYKEY key, REFPROPVARIANT propvar) PURE; STDMETHOD (Commit) (void) PURE; + +private: + ~IPropertyStore(); }; typedef IPropertyStore *LPIPropertyStore; @@ -137,6 +140,9 @@ DECLARE_INTERFACE_(ITaskbarList3, IUnknown) { STDMETHOD (SetOverlayIcon) (THIS_ HWND hwnd, HICON hIcon, LPCWSTR pszDescription) PURE; STDMETHOD (SetThumbnailTooltip) (THIS_ HWND hwnd, LPCWSTR pszTip) PURE; STDMETHOD (SetThumbnailClip) (THIS_ HWND hwnd, RECT *prcClip) PURE; + +private: + ~ITaskbarList3(); }; typedef ITaskbarList3 *LPITaskbarList3; -- cgit v1.2.3 From 52ebc0da38856c3105d58920ced048e024fda1d7 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 23 Jun 2011 16:34:31 +0200 Subject: BASE: Correct usage of strtol(). - endptr needs not be initialised before calling strtol(), it is always set by strtol(). - endptr is never a null pointer after calling strtol(). - There is no need to rely on strtol() setting EINVAL (which is not guaranteed). Testing whether strtol() parsed till the end of the string is sufficient (it is guaranteed that the string is not empty at this point). - It is sufficient to just test for ERANGE without inspecting the return value, because a successful call to strtol() does not change errno. Signed-off-by: Alyssa Milburn --- base/commandLine.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 2620d69ba2..543511696f 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -26,7 +26,6 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_exit #include -#include #include "engines/metaengine.h" #include "base/commandLine.h" @@ -269,10 +268,10 @@ void registerDefaults() { // Use this for options which have a required integer value #define DO_OPTION_INT(shortCmd, longCmd) \ DO_OPTION(shortCmd, longCmd) \ - char *endptr = 0; \ + char *endptr; \ errno = 0; \ - long int retval = strtol(option, &endptr, 0); \ - if (endptr == NULL || *endptr != 0 || (errno != 0 && retval == 0) || (errno == ERANGE && (retval == LONG_MAX || retval == LONG_MIN))) \ + strtol(option, &endptr, 0); \ + if (*endptr != '\0' || errno == ERANGE) \ usage("--%s: Invalid number '%s'", longCmd, option); // Use this for boolean options; this distinguishes between "-x" and "-X", -- cgit v1.2.3 From 77440aadf4055d5cadf86a7be00e6c8ed51a5be7 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Thu, 23 Jun 2011 17:29:34 +0200 Subject: TSAGE: Silence GCC warnings. --- engines/tsage/resources.cpp | 2 +- engines/tsage/sound.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index e6a561f3a7..6d2c6b5837 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -243,7 +243,7 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) { if (!table) error("[TLib::getResource] Cannot allocate table buffer"); - for (int i = 0; i < tableSize; ++i) { + for (uint i = 0; i < tableSize; ++i) { table[i].vByte = table[i].vWord = 0; } Common::Stack tokenList; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 6f061862dc..8bdb2f2d4c 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -359,9 +359,9 @@ void SoundManager::_sfSoundServer() { _sfProcessFading(); // Poll all sound drivers in case they need it - for (Common::List::iterator i = sfManager()._installedDrivers.begin(); - i != sfManager()._installedDrivers.end(); ++i) { - (*i)->poll(); + for (Common::List::iterator j = sfManager()._installedDrivers.begin(); + j != sfManager()._installedDrivers.end(); ++j) { + (*j)->poll(); } } -- cgit v1.2.3 From eecd61e33d4c15fcfc1cd9abb72c1e85fcd7a647 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 10:52:39 -0400 Subject: ANDROID: Allow use of abort() in JNI class --- backends/platform/android/jni.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index c4daf24e16..e3b4ef7401 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -22,8 +22,9 @@ #if defined(__ANDROID__) -// Allow use of stuff in +// Allow use of stuff in and abort() #define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_EXCEPTION_abort // Disable printf override in common/forbidden.h to avoid // clashes with log.h from the Android SDK. -- cgit v1.2.3 From b3d8e426c258cc20cacfa1ab5f4613e40bd10c76 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 11:00:47 -0400 Subject: WII: Allow use of abort in OSystem_Wii class --- backends/platform/wii/osystem_gfx.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 859e3a1395..443e738a4a 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -20,6 +20,7 @@ */ #define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_abort #include -- cgit v1.2.3 From 714976729d0badab3e7557f62036aac0b2e9cc4f Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 23 Jun 2011 18:35:27 +0100 Subject: SAGA: Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers") This read of 1 byte past the end of the buffer has existed since the dragonMove() function was implemented, but since the change in bfb0986c to use ByteArray, this now causes an assertion due to the stricter bounds checking. This commit corrects the original issue. Thanks to fuzzie for this fix. --- engines/saga/actor_walk.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 5607fcdd66..ea33a0950d 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -1165,7 +1165,15 @@ void Actor::moveDragon(ActorData *actor) { dir0 = actor->_actionDirection; dir1 = actor->_tileDirections[actor->_walkStepIndex++]; dir2 = actor->_tileDirections[actor->_walkStepIndex]; - dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; + // Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers") + // If there were more than two steps left, get the third (next) step. + // Otherwise, store the second step again so the anim looks right. + // (If you stop the move instead, Rif isn't automatically knocked into + // the Sewer.) + if (actor->_walkStepIndex + 1 < actor->_walkStepsCount) + dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; + else + dir3 = dir2; if (dir0 != dir1){ actor->_actionDirection = dir0 = dir1; -- cgit v1.2.3 From e30b41b28e536f18b3c5d2d323c0d808dc1328df Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 23 Jun 2011 23:30:12 +0400 Subject: DREAMWEB: Added subtitle option --- devtools/tasmrecover/dreamweb/dreamweb.asm | 1 + devtools/tasmrecover/dreamweb/use.asm | 22 +++++++++++++++++++--- engines/dreamweb/detection.cpp | 1 + engines/dreamweb/dreamgen.cpp | 19 +++++++++++++++++-- engines/dreamweb/dreamgen.h | 3 ++- engines/dreamweb/dreamweb.cpp | 2 -- 6 files changed, 40 insertions(+), 8 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index d357c5cd73..edecad783e 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -6237,6 +6237,7 @@ savefiles db "DREAMWEB.D00",0 Recname db "DREAMWEB.DEM",0 Quitrequested db 0 +Subtitles db 0 ;-------------------------------------------------------End of code segment---- diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm index 508e8bd4c1..08debfca56 100644 --- a/devtools/tasmrecover/dreamweb/use.asm +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -3293,18 +3293,34 @@ Setuptimedtemp proc near if cd cmp ah,0 jz notloadspeech3 + push ax + push bx + push cx + push dx mov dl,"T" mov dh,ah - mov cl,"T" + mov cl,"T" mov ah,0 call loadspeech cmp speechloaded,1 - jnz notloadspeech3 + jnz $1 mov al,50+12 call playchannel1 +$1: + pop dx + pop cx + pop bx + pop ax + + cmp speechloaded,1 + jnz notloadspeech3 ; failed to load speech + cmp subtitles, 1 + jz notloadspeech3 ret + notloadspeech3: - endif + endif ;if cd + cmp timecount,0 jnz cantsetup2 mov timedy,bh diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 18a2f899a8..f3d5b07835 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -85,6 +85,7 @@ bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const { switch(f) { case kSupportsRTL: + case kSupportsSubtitleOptions: return true; default: return false; diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 462ae596f8..2485b5ad6a 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -13830,6 +13830,10 @@ void DreamGenContext::setuptimedtemp() { _cmp(ah, 0); if (flags.z()) goto notloadspeech3; + push(ax); + push(bx); + push(cx); + push(dx); dl = 'T'; dh = ah; cl = 'T'; @@ -13837,9 +13841,20 @@ void DreamGenContext::setuptimedtemp() { loadspeech(); _cmp(data.byte(kSpeechloaded), 1); if (!flags.z()) - goto notloadspeech3; + goto _tmp1; al = 50+12; playchannel1(); +_tmp1: + dx = pop(); + cx = pop(); + bx = pop(); + ax = pop(); + _cmp(data.byte(kSpeechloaded), 1); + if (!flags.z()) + goto notloadspeech3; + _cmp(data.byte(kSubtitles), 1); + if (flags.z()) + goto notloadspeech3; return; notloadspeech3: _cmp(data.word(kTimecount), 0); @@ -21942,7 +21957,7 @@ void DreamGenContext::__start() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index b012663ab6..5a60327a43 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -487,7 +487,8 @@ public: const static uint16 kSavefiles = 8698; const static uint16 kRecname = 8789; const static uint16 kQuitrequested = 8802; - const static uint16 kStak = 8803; + const static uint16 kSubtitles = 8803; + const static uint16 kStak = 8804; const static uint16 kBlocktextdat = (0); const static uint16 kPersonframes = (0); const static uint16 kDebuglevel1 = (0); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 8be02dc90e..0b8c843e84 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -219,8 +219,6 @@ Common::Error DreamWebEngine::run() { _loadSavefile = Common::ConfigManager::instance().getInt("save_slot"); getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this); - //http://martin.hinner.info/vga/timing.html - _context.__start(); _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0; -- cgit v1.2.3 From 8148f4d81d250ae66d5ac015161227fa1f78814e Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Thu, 23 Jun 2011 23:52:59 +0400 Subject: DREAMWEB: Added ui settings integration --- engines/dreamweb/dreamweb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0b8c843e84..590f071b6b 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -468,6 +468,9 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { } bool DreamWebEngine::loadSpeech(const Common::String &filename) { + if (ConfMan.getBool("speech_mute")) + return false; + Common::File file; if (!file.open("speech/" + filename)) return false; @@ -483,6 +486,7 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) { void DreamWebEngine::soundHandler() { + _context.data.byte(_context.kSubtitles) = ConfMan.getBool("subtitles"); _context.push(_context.ax); _context.volumeadjust(); _context.ax = _context.pop(); -- cgit v1.2.3 From 72965b6406adbd701b3fca00029cfdb5d71e8628 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 24 Jun 2011 00:01:59 +0400 Subject: DREAMWEB: Fixed quit() from dialogue --- devtools/tasmrecover/dreamweb/talk.asm | 4 ++++ engines/dreamweb/dreamgen.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm index 6bee4409b7..b6b96313f7 100644 --- a/devtools/tasmrecover/dreamweb/talk.asm +++ b/devtools/tasmrecover/dreamweb/talk.asm @@ -28,6 +28,8 @@ waittalk: call delpointer mov getback,0 mov bx,offset cs:talklist call checkcoords + cmp quitrequested, 0 + jnz finishtalk cmp getback,0 jz waittalk finishtalk: mov bx,persondata @@ -490,6 +492,8 @@ hangloopq: push cx bx pop bx cx cmp getback,1 jz quitconv + cmp quitrequested, 0 + jnz quitconv cmp speechloaded,1 jnz notspeaking cmp ch1playing,255 diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2485b5ad6a..e92cd83c2b 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -9065,9 +9065,13 @@ waittalk: data.byte(kGetback) = 0; bx = 2660; 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); @@ -9360,6 +9364,9 @@ hangloopq: _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; -- cgit v1.2.3 From 87811d3a812bca352340931ae4511e4d3d88a46a Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Fri, 24 Jun 2011 00:02:34 +0100 Subject: README: Move and rename translated README --- doc/translations/README-de.txt | 178 --------------------------------------- doc/translations/README-fr.txt | 172 ------------------------------------- doc/translations/de/Liesmich.txt | 178 +++++++++++++++++++++++++++++++++++++++ doc/translations/fr/Lisezmoi.txt | 172 +++++++++++++++++++++++++++++++++++++ 4 files changed, 350 insertions(+), 350 deletions(-) delete mode 100755 doc/translations/README-de.txt delete mode 100755 doc/translations/README-fr.txt create mode 100755 doc/translations/de/Liesmich.txt create mode 100755 doc/translations/fr/Lisezmoi.txt diff --git a/doc/translations/README-de.txt b/doc/translations/README-de.txt deleted file mode 100755 index a1d7d6eb5f..0000000000 --- a/doc/translations/README-de.txt +++ /dev/null @@ -1,178 +0,0 @@ -Dieses Dokument ist eine auszugsweise Ãœbersetzung der englischen -REAMDE-Datei. Das Original-Dokument enthält viel mehr Informationen. -Sollten Sie hier also nicht das finden, was Sie benötigen und ein wenig -Englisch können, sollten Sie sich die englische README-Datei ansehen. - -Für weitere Informationen, Kompatiblitätslisten, Einzelheiten zu Spenden, -die neusten veröffentlichten Versionen, Fortschrittberichte und mehr -besuchen Sie bitte die ScummVM-Website unter der Adresse: -http://www.scummvm.org/ - -Inhaltsverzeichnis: ------------------- -1.0) Einführung - * 1.1 Ãœber ScummVM - * 1.2 Schnellstart -2.0) Kontakt - * 2.1 Fehler berichten - -1.0) Einführung: ----- ------------- - -1.1) Ãœber ScummVM: ----- -------------- -ScummVM ist ein Programm, welches es Ihnen ermöglicht, bestimmte klassische -Grafik-Adventure (unter anderem aus dem Point-and-Click-Bereich) zu spielen, -vorausgesetzt, Sie sind im Besitz der Dateien des Spiels. Das Schlaue daran -ist: ScummVM ersetzt lediglich die Funktion der ausführbaren Dateien, -die mit den Spielen kamen, was ermöglicht, diese Spiele auf Systemen zu spielen, -für welche sie nie erstellt wurden! - -Ursprünglich wurde dieses Programm dafür entwickelt, um SCUMM-Spiele von -LucasArts auszuführen, wie beispielsweise Maniac Mansion, Monkey Island, -Day of the Tentacle oder Sam and Max. SCUMM steht als Abkürzung für -„Script Creation Utility for Maniac Mansion“ (deutsch etwa: -Skripterstellungsdienstprogramm für Maniac Mansion), was das erste -Spiel von LucasArts war, für welches LucasArts dieses System entworfen hatte. -Und viel später verlieh es seinen Namen an ScummVM (wobei „VM“ für -„Virtuelle Maschine“ steht). - -Mit der Zeit wurde Unterstützung für viele Nicht-SCUMM-Spiele hinzugefügt. -Einige Adventures, die ScummVM unterstützt, sind unter anderem Simon the -Sorcerer 1 und 2 von Adventure Soft, Beneath A Steel Sky und -Baphomets Fluch 1 und 2 von Revolution, Flight of the Amazon Queen, -Erben der Erde (Wyrmkeep), Gobliiins von Coktel Vision sowie -The Legend of Kyrandia von Westwood Studios. -Sie können eine genaue Liste mit Einzelheiten einsehen, welche Auskunft -darüber gibt, welche Spiele unterstützt werden und wie gut. Gehen Sie -hierfür auf die Kompatiblitätsseite. ScummVM wird kontinuierlich -verbessert, also schauen Sie oft vorbei. - -Unter den Systemen, mit denen Sie diese Spiele spielen können, befinden -sich Windows, Linux, Mac OS X, Dreamcast, PocketPC, PalmOS, iPhone, -AmigaOS, BeOS, OS/2, PSP, PS2, SymbianOS/EPOC und viele mehr. - -Zurzeit befindet sich ScummVM immer noch stark in der Entwicklung. -Seien Sie sich bewusst, dass wir zwar versuchen, dass viele Spiele -mit wenigen erheblichen Fehlern durchgespielt werden können, aber es -dennoch zu Abstürzen kommen kann und wir keine Gewähr übernehmen. -Davon abgesehen: Einige Spiele werden seit längerer Zeit unterstützt -und sollten in jeder stabilen veröffentlichten Version gut laufen. -Sie können sich einen Eindruck davon verschaffen, wie gut jedes Spiel -unter ScummVM läuft, indem Sie auf die Kompatiblitätsseite schauen. - -Wenn Sie sich ein wenig umsehen, können Sie herausfinden, dass -ScummVM sogar kommerziell genutzt wird, um einige der unterstützen Spiele -auf modernen Plattformen wiederzuveröffentlichen. Dies zeigt, dass -verschiedene Firmen mit der Qualität der Software zufrieden sind und wie gut -einige der Spiele mit ihrer Hilfe laufen. - -Wenn Ihnen ScummVM gefällt, können Sie uns gerne etwas Geld spenden, -um uns finanziell zu unterstützen. Dies hilft uns dabei, notwendige -Dienstprogramme zu kaufen, um ScummVM einfacher und schneller zu entwickeln. -Wenn Sie nicht spenden können, dürfen Sie auch gerne einen Patch beisteuern. - -1.2) Schnellstart: ----- ------------ -WICHTIG: In der unteren kurzen Anleitung wird davon ausgegangen, dass Sie -ScummVM auf Deutsch benutzen. Standardmäßig wird ScummVM die Sprache -Ihres Betriebssystems verwenden. Falls ScummVM auf Englisch statt auf -Deutsch erscheint, sollten Sie folgende Schritte ausführen, wenn Sie bei -Schritt 3 angelangt sind und ScummVM gestartet haben: --Klicken Sie auf "Options". --Klicken Sie auf den rechten Pfeil in der Reiterleiste und wählen den - Reiter "Misc" aus. --Wählen Sie im Feld "GUI Language" "Deutsch" aus und klicken auf "OK". --Bestätigen Sie die erscheinende Nachricht, klicken auf "Quit", um - ScummVM zu beenden und starten dann das Programm erneut. - -Wenn Sie ScummVM lieber in Englisch verwenden möchten, benutzen Sie bitte -die Anleitung in der englischen README-Datei. - - -Für die ungelduldigen unter den Benutzern ist hier in fünf einfachen -Schritten kurz beschrieben, wie man ScummVM lauffähig macht und das -Programm verwendet. - -1. Laden Sie ScummVM unter der Adresse - herunter und installieren Sie es. - -2. Erstellen Sie ein Verzeichnis auf Ihrer Festplatte und kopieren Sie -die Dateien des Spiels vom Original-Datenträger in dieses Verzeichnis. -Wiederholen Sie diesen Vorgang für jedes Spiel, das Sie spielen möchten. - -3. Starten Sie ScummVM, wählen Sie "Spiel hinzufügen" aus, wählen Sie das -Verzeichnis mit den Dateien des Spiels aus (versuchen Sie nicht, die -Dateien des Spiels selbst auszuwählen!) und klicken Sie auf "Auswählen". - -4. Ein Dialog sollte erscheinen, der Ihnen ermöglicht, verschiedene -Einstellungen vorzunehmn, sollten Sie dies wünschen (es sollte jedoch in -Ordnung sein, alles voreingestellt zu belassen). Bestätigen Sie diesen -Dialog. - -5. Wählen Sie das Spiel aus der Liste aus, welches Sie spielen möchten -und klicken Sie auf "Starten". - -In Zukunft sollte es nun möglich sein, direkt zu Schritt 5 überzugehen, -außer Sie wollen noch mehr Spiele hinzufügen. - -Tipp: Wenn Sie mehrere Spiele auf einmal hinzufügen möchten, drücken Sie -die Umschalt-Taste (Shift), bevor Sie auf "Spiel hinzufügen" klicken. -Diese Schaltfläche wird somit ihren Text zu "Durchsuchen" umändern und -wenn Sie dann auf diese klicken, werden Sie auch dazu aufgefordert, ein -Verzeichnis auszuwählen, nur dieses Mal wird ScummVM alle -Unterverzeichnisse automatisch nach unterstützen Spielen durchsuchen. - - -2.0) Kontakt: ----- -------- -Der einfachste Weg, um mit dem ScummVM-Team in Verbindung zu treten, ist, -Fehlerberichte einzusenden (siehe Abschnitt 2.1) oder durch Verwendung -des Forums unter der Adresse http://forums.scummvm.org . -Sie können ebenso der Mailing-Liste scummvm-devel betreiten und an diese -E-Mails versenden oder mit uns im IRC chatten (#scummvm unter -irc.freenode.net). Bitte fordern Sie uns nicht dazu auf, ein nicht -unterstütztes Spiel zu unterstützen. Lesen Sie zuerst die Seite FAQ -(Häufig gestellte Fragen) auf unserer Website. -Bitte beachten Sie Kenntnis, dass die offizielle Sprache des Forums, -der Mailing-Liste und des Chats Englisch ist und keine andere Sprache -dort verwendet werden sollte. - - -2.1) Fehler berichten: ----- --------------- -Um einen Fehler zu berichten, erstellen Sie bitte ein SourceForge-Konto -und folgen Sie dem Link "Bug Tracker" auf der ScummVM-Website. Bitte -stellen Sie sicher, dass sich der Bug wiedererzeugen lässt und immer noch -in der neusten Version von SVN oder des Daily builds auftritt. Bitte -sehen Sie auch auf der Problemliste unten und der Kompatiblitätsliste auf -der ScummVM-Website für dieses Spiel nach, um sicherzustellen, dass das -Problem nicht bereits bekannt ist: - - http://www.scummvm.org/compatibility_stable.php - -Bitte berichten Sie keine Fehler zu Spielen, die nicht als durchspielbar -im Bereich "Supported Games" oder der Kompatiblitätsliste aufgelistet -sind. Wir -wissen-, dass diese Spiele Fehler aufweisen. - -Bitte liefern Sie folgende Informationen: - - ScummVM-Version (BITTE mit neuster Version von SVN oder - des Daily builds testen) - - Einzelheiten zum Fehler, einschließlich Anweisungen, um den Fehler - hervorzurufen - - Sprache des Spiels (Englisch, Deutsch, ...) - - Version des Spiels (Version mit Sprachausgabe [Talkie], - Disketten-Version, ...) - - Plattform und gegebenenfalls Compiler (Win32, Linux, FreeBSD, ...) - - Fügen Sie einen Speicherstand hinzu, wenn es möglich ist. - - Wenn dieser Fehler erst seit kurzem Auftritt, teilen Sie bitte die - letzte Version ohne den Fehler mit und die erste Version mit diesem - Fehler. Auf diese Weise können wir diesen schneller beseitigen, - indem wir die vorgenommen Veränderungen einsehen. - -Zum Schluss möchten wir Sie noch bitten, jeden Punkt einzeln zu -berichten; bitte senden Sie nicht mehrere Punkte mit dem selben Ticket -ein, ansonsten wird es schwierig, den Status jedes einzelnen Fehlers -zu verfolgen. Denken Sie bitte auch daran, dass alle Fehlerberichte in -Englisch verfasst sein müssen. - diff --git a/doc/translations/README-fr.txt b/doc/translations/README-fr.txt deleted file mode 100755 index 186f0cd24d..0000000000 --- a/doc/translations/README-fr.txt +++ /dev/null @@ -1,172 +0,0 @@ -Ce document est une traduction partielle du fichier README anglais. Le -document original contient bien plus d'informations, donc si vous ne -trouvez pas ce que vous cherchez dans ce document et que vous comprenez -un peu l'anglais, jetez un coup d'oeil au fichier README anglais. - -Pour plus d'informations, liste des jeux compatibles, détails pour -donner de l'argent, la dernière version disponibles et bien plus encore, -visitez le site web de ScummVM à l'adresse http://www.scummvm.org/ - -Table des matières: -------------------- -1.0) Introduction - * 1.1 À propos de ScummVM - * 1.2 Démarrage rapide -2.0) Contact - * 2.1 Signaler des bogues - -1.0) Introduction: ----- ------------- - -1.1) À propos de ScummVM: ----- -------------------- -ScummVM est un logiciel qui vous permet de jouer certain jeux -d'aventures graphiques de type 'point-and-click' (pointer et cliquer), à -condition que vous possédiez les fichiers de données du jeu. Le plus -astucieux: ScummVM remplace juste les exécutables fournis avec les jeux, -vous permettant de jouer sur les systèmes pour lesquels ils n'ont jamais -été conçus! - -A l'origine il a été conçu pour exécuter les jeux basé sur le système -SCUMM de LucasArts, tels que Maniac Mansion, Monkey Island, Day of the -Tentacle ou Sam et Max. SCUMM est l'acronyme de 'Script Creation Utility -for Maniac Mansion', qui a été le premier jeu pour lequel LucasArts a -conçu ce système. Et beaucoup plus tard, il donna son nom à ScummVM -('VM' signifiant Virtual Machine). - -Au cours du temps de nombreux jeux non-SCUMM ont été ajouté, et ScummVM -prend désormais en charge de nombreux jeux Sierra AGI et SCI (tels que -King's Quest 1-6, Space Quest 1-5, ...), Discworld 1 et 2, Simon the -Sorcerer 1 et 2, Beneath A Steel Sky, Lure of the Temptress, Les -Chevaliers de Baphomet (Broken Sword I), Les Boucliers de Quetzalcoatl -(Broken Sword II), L'amazone queen (Flight of the Amazon Queen), -Gobliiins 1-3, la série des Legend of Kyrandia, un grand nombre de jeux -pour enfants de Humongous Entertainment (incluant les jeux Marine Malice -et Pouce-Pouce) et beaucoup plus. Vous pouvez trouver une liste complète -et détaillée sur les aventures qui sont pris en charge et les problèmes -connus sur la page de compatibilité. ScummVM évolue en permanence, donc -vérifier cette liste de compatibilités souvent. - -Vous pouvez jouer à ces jeux sur des ordinateurs de bureau classiques -(sous Windows, Linux, Mac OS X, ...), sur des consoles (Dreamcast, -Nintendo DS et Wii, PS2, PSP, ...), smartphones (Android, iPhone, Pocket -PC, Symbian ...) et plus encore. - -À ce stade ScummVM est encore en cours de développement. Soyez conscient -que malgré tous nos efforts pour en faire un logiciel le plus stable -possible, des plantages peuvent survenir. et nous n'offrons aucune -garantie. Cela étant dit, certains jeux sont supportés depuis longtemps -et devrait fonctionner correctement avec une version stable et récente -de ScummVM. Vous pouvez vous faire une idée du niveau de support d'un -jeu en regardant la page de compatibilité. En fait, si vous cherchez un -peu vous pourrez découvrir que ScummVM est même utilisé dans le commerce -pour la ré-édition sur les plates-formes modernes de quelques-uns des -jeux supportés. Cela montre que plusieurs entreprises sont satisfaits de -la qualité du logiciel. - -Si vous aimez ScummVM n'hésitez pas à faire un don en utilisant le -bouton PayPal sur la page d'accueil ScummVM. Cela nous aidera à acheter -les services nécessaires pour rendre le développement de ScummVM plus -facile et plus rapide. Si vous ne pouvez pas faire de don, vous pouvez -aussi proposer des patches! - -1.2) Démarrage rapide: ----- ---------------- -IMPORTANT: Les instructions ci-dessous supposent que vous utilisez -ScummVM en Français. Par défaut, ScummVM utilise la langue de votre -système d'exploitation. Si vous préférez utiliser ScummVM en Anglais, -vous pouvez plutôt utiliser le guide du fichier README Anglais. - - -Pour les plus impatients, voici comment obtenir ScummVM en cinq étapes -simples. - -1. Télécharger ScummVM sur et -installer l'application. - -2. Créez un répertoire sur votre disque dur et copier les fichiers de -données de jeu à partir du support original dans ce répertoire. Répétez -cette opération pour chaque jeu que vous voulez jouer. Utilisez un -répertoire séparé pour chaque jeu. - -3. Lancez ScummVM. - -Si ScummVM apparaît en anglais au lieu du français, procédez comme suit -pour changer la langue: -- Cliquez sur 'Options'. -- Cliquez sur la flèche droite dans la barre d'onglets et sélectionnez - l'onglet 'Misc'. -- Choisissez 'Francais' dans le champs 'GUI Language' et cliquez sur - 'OK'. Confirmez-le message qui apparaît, cliquez sur 'Quit' pour - quitter ScummVM, puis redémarrer le programme. - -Maintenant cliquez sur 'Ajouter...', puis sélectionnez le répertoire -contenant les fichiers de données du jeu (ne pas essayer de sélectionner -les fichiers de données eux-mêmes!) et cliquez sur 'Choisir'. - -4. Une boîte de dialogue devrait apparaître vous permettant de -configurer divers paramètres si vous le souhaitez (la valeur par défaut -devrait convenir dans la plupart des cas). Confirmez la boîte de -dialogue. - -5. Sélectionnez le jeu que vous voulez jouer dans la liste, et appuyez -sur 'Démarrer'. - -ScummVM se souvient des jeux ajoutés. Donc si vous quittez ScummVM puis -le relancez la liste des jeux contiendra tous les jeux que vous avez -déjà ajoutés. Vous pouvez donc passer directement à l'étape 5, à moins -que vous vouliez ajouter des jeux supplémentaires. - -Astuce: Si vous souhaitez ajouter plusieurs jeux d'un coup, essayez -d'appuyer et de maintenir la touche Maj (Shift) tout en cliquant sur -'Ajouter...' - son texte changera en 'Ajout Massif…'. Vous serez alors -invitez à sélectioner un répertoire dans lequel ScummVM parcourra tous -les sous-répertoire à la recherche de jeux supportés. - - -2.0) Contact: ----- -------- -La meilleure façon de contacter l'équipe de ScummVM est en soumettant -des rapports de bogues (voir section 2.1) ou en utilisant nos forums -http://forums.scummvm.org. Vous pouvez également envoyer un e-mail sur -la liste de diffusion scummvm-devel, ou discuter avec nous sur IRC -(#scummvm sur irc.freenode.net). S'il vous plaît ne nous demandez pas de -supporter un jeu non pris en charge - lire la FAQ sur notre site web -avant. Notez que la langue officielle de la liste de diffusion, forum et -chat est l'Anglais, et aucune autre langues ne doivent être utilisée. - - -2.1) Reporting Bugs: ----- --------------- -Pour signaler un bogue, veuillez créer un compte SourceForge et suivez -le lien "Bug Tracker" depuis notre page d'accueil. S'il vous plaît -vérifiez que le bogue est reproductible, et se produit encore dans la -'Daily Build' la plus récente. Vérifiez également la liste des problèmes -connus (ci-dessous) et la liste de compatibilité sur notre site Web pour -ce jeu, pour s'assurer que le problème n'est pas déjà connue: - - http://www.scummvm.org/compatibility_stable.php - -Veuillez ne pas rapporter de bogues sur les jeux qui ne sont pas -répertoriés comme étant finissable sur la liste de compatibilité. Nous -savons que ces jeux ont des bogues. - -Veuillez inclure les informations suivantes lorsque vous signalez un -problème: - - Version de ScummVM (veuillez tester avec la 'Daily Build' la plus - récente) - - Détails du problème, incluant les instructions pour le reproduire - - Langue du jeu (anglais, allemand, ...) - - Version du jeu (talkie, disquette, ...) - - Plate-forme et compilateur (Win32, Linux, Mac, FreeBSD, ...) - - Joindre une sauvegarde si possible - - Si ce problème est récent, s'il vous plaît notez la dernière - version sans bogue, et la première version qui à le problème. De - cette façon, nous pouvons y remédier plus rapidement, en regardant - les modifications apportées entre ces deux versions. - -Enfin, veuillez signaler chaque problème séparément, sinon, il devient -difficile de suivre l'état de chaque problème individuel. S'il vous -plaît gardez à l'esprit également que tous les rapports de bogue doivent -être rédigés en anglais. - diff --git a/doc/translations/de/Liesmich.txt b/doc/translations/de/Liesmich.txt new file mode 100755 index 0000000000..a1d7d6eb5f --- /dev/null +++ b/doc/translations/de/Liesmich.txt @@ -0,0 +1,178 @@ +Dieses Dokument ist eine auszugsweise Ãœbersetzung der englischen +REAMDE-Datei. Das Original-Dokument enthält viel mehr Informationen. +Sollten Sie hier also nicht das finden, was Sie benötigen und ein wenig +Englisch können, sollten Sie sich die englische README-Datei ansehen. + +Für weitere Informationen, Kompatiblitätslisten, Einzelheiten zu Spenden, +die neusten veröffentlichten Versionen, Fortschrittberichte und mehr +besuchen Sie bitte die ScummVM-Website unter der Adresse: +http://www.scummvm.org/ + +Inhaltsverzeichnis: +------------------ +1.0) Einführung + * 1.1 Ãœber ScummVM + * 1.2 Schnellstart +2.0) Kontakt + * 2.1 Fehler berichten + +1.0) Einführung: +---- ------------- + +1.1) Ãœber ScummVM: +---- -------------- +ScummVM ist ein Programm, welches es Ihnen ermöglicht, bestimmte klassische +Grafik-Adventure (unter anderem aus dem Point-and-Click-Bereich) zu spielen, +vorausgesetzt, Sie sind im Besitz der Dateien des Spiels. Das Schlaue daran +ist: ScummVM ersetzt lediglich die Funktion der ausführbaren Dateien, +die mit den Spielen kamen, was ermöglicht, diese Spiele auf Systemen zu spielen, +für welche sie nie erstellt wurden! + +Ursprünglich wurde dieses Programm dafür entwickelt, um SCUMM-Spiele von +LucasArts auszuführen, wie beispielsweise Maniac Mansion, Monkey Island, +Day of the Tentacle oder Sam and Max. SCUMM steht als Abkürzung für +„Script Creation Utility for Maniac Mansion“ (deutsch etwa: +Skripterstellungsdienstprogramm für Maniac Mansion), was das erste +Spiel von LucasArts war, für welches LucasArts dieses System entworfen hatte. +Und viel später verlieh es seinen Namen an ScummVM (wobei „VM“ für +„Virtuelle Maschine“ steht). + +Mit der Zeit wurde Unterstützung für viele Nicht-SCUMM-Spiele hinzugefügt. +Einige Adventures, die ScummVM unterstützt, sind unter anderem Simon the +Sorcerer 1 und 2 von Adventure Soft, Beneath A Steel Sky und +Baphomets Fluch 1 und 2 von Revolution, Flight of the Amazon Queen, +Erben der Erde (Wyrmkeep), Gobliiins von Coktel Vision sowie +The Legend of Kyrandia von Westwood Studios. +Sie können eine genaue Liste mit Einzelheiten einsehen, welche Auskunft +darüber gibt, welche Spiele unterstützt werden und wie gut. Gehen Sie +hierfür auf die Kompatiblitätsseite. ScummVM wird kontinuierlich +verbessert, also schauen Sie oft vorbei. + +Unter den Systemen, mit denen Sie diese Spiele spielen können, befinden +sich Windows, Linux, Mac OS X, Dreamcast, PocketPC, PalmOS, iPhone, +AmigaOS, BeOS, OS/2, PSP, PS2, SymbianOS/EPOC und viele mehr. + +Zurzeit befindet sich ScummVM immer noch stark in der Entwicklung. +Seien Sie sich bewusst, dass wir zwar versuchen, dass viele Spiele +mit wenigen erheblichen Fehlern durchgespielt werden können, aber es +dennoch zu Abstürzen kommen kann und wir keine Gewähr übernehmen. +Davon abgesehen: Einige Spiele werden seit längerer Zeit unterstützt +und sollten in jeder stabilen veröffentlichten Version gut laufen. +Sie können sich einen Eindruck davon verschaffen, wie gut jedes Spiel +unter ScummVM läuft, indem Sie auf die Kompatiblitätsseite schauen. + +Wenn Sie sich ein wenig umsehen, können Sie herausfinden, dass +ScummVM sogar kommerziell genutzt wird, um einige der unterstützen Spiele +auf modernen Plattformen wiederzuveröffentlichen. Dies zeigt, dass +verschiedene Firmen mit der Qualität der Software zufrieden sind und wie gut +einige der Spiele mit ihrer Hilfe laufen. + +Wenn Ihnen ScummVM gefällt, können Sie uns gerne etwas Geld spenden, +um uns finanziell zu unterstützen. Dies hilft uns dabei, notwendige +Dienstprogramme zu kaufen, um ScummVM einfacher und schneller zu entwickeln. +Wenn Sie nicht spenden können, dürfen Sie auch gerne einen Patch beisteuern. + +1.2) Schnellstart: +---- ------------ +WICHTIG: In der unteren kurzen Anleitung wird davon ausgegangen, dass Sie +ScummVM auf Deutsch benutzen. Standardmäßig wird ScummVM die Sprache +Ihres Betriebssystems verwenden. Falls ScummVM auf Englisch statt auf +Deutsch erscheint, sollten Sie folgende Schritte ausführen, wenn Sie bei +Schritt 3 angelangt sind und ScummVM gestartet haben: +-Klicken Sie auf "Options". +-Klicken Sie auf den rechten Pfeil in der Reiterleiste und wählen den + Reiter "Misc" aus. +-Wählen Sie im Feld "GUI Language" "Deutsch" aus und klicken auf "OK". +-Bestätigen Sie die erscheinende Nachricht, klicken auf "Quit", um + ScummVM zu beenden und starten dann das Programm erneut. + +Wenn Sie ScummVM lieber in Englisch verwenden möchten, benutzen Sie bitte +die Anleitung in der englischen README-Datei. + + +Für die ungelduldigen unter den Benutzern ist hier in fünf einfachen +Schritten kurz beschrieben, wie man ScummVM lauffähig macht und das +Programm verwendet. + +1. Laden Sie ScummVM unter der Adresse + herunter und installieren Sie es. + +2. Erstellen Sie ein Verzeichnis auf Ihrer Festplatte und kopieren Sie +die Dateien des Spiels vom Original-Datenträger in dieses Verzeichnis. +Wiederholen Sie diesen Vorgang für jedes Spiel, das Sie spielen möchten. + +3. Starten Sie ScummVM, wählen Sie "Spiel hinzufügen" aus, wählen Sie das +Verzeichnis mit den Dateien des Spiels aus (versuchen Sie nicht, die +Dateien des Spiels selbst auszuwählen!) und klicken Sie auf "Auswählen". + +4. Ein Dialog sollte erscheinen, der Ihnen ermöglicht, verschiedene +Einstellungen vorzunehmn, sollten Sie dies wünschen (es sollte jedoch in +Ordnung sein, alles voreingestellt zu belassen). Bestätigen Sie diesen +Dialog. + +5. Wählen Sie das Spiel aus der Liste aus, welches Sie spielen möchten +und klicken Sie auf "Starten". + +In Zukunft sollte es nun möglich sein, direkt zu Schritt 5 überzugehen, +außer Sie wollen noch mehr Spiele hinzufügen. + +Tipp: Wenn Sie mehrere Spiele auf einmal hinzufügen möchten, drücken Sie +die Umschalt-Taste (Shift), bevor Sie auf "Spiel hinzufügen" klicken. +Diese Schaltfläche wird somit ihren Text zu "Durchsuchen" umändern und +wenn Sie dann auf diese klicken, werden Sie auch dazu aufgefordert, ein +Verzeichnis auszuwählen, nur dieses Mal wird ScummVM alle +Unterverzeichnisse automatisch nach unterstützen Spielen durchsuchen. + + +2.0) Kontakt: +---- -------- +Der einfachste Weg, um mit dem ScummVM-Team in Verbindung zu treten, ist, +Fehlerberichte einzusenden (siehe Abschnitt 2.1) oder durch Verwendung +des Forums unter der Adresse http://forums.scummvm.org . +Sie können ebenso der Mailing-Liste scummvm-devel betreiten und an diese +E-Mails versenden oder mit uns im IRC chatten (#scummvm unter +irc.freenode.net). Bitte fordern Sie uns nicht dazu auf, ein nicht +unterstütztes Spiel zu unterstützen. Lesen Sie zuerst die Seite FAQ +(Häufig gestellte Fragen) auf unserer Website. +Bitte beachten Sie Kenntnis, dass die offizielle Sprache des Forums, +der Mailing-Liste und des Chats Englisch ist und keine andere Sprache +dort verwendet werden sollte. + + +2.1) Fehler berichten: +---- --------------- +Um einen Fehler zu berichten, erstellen Sie bitte ein SourceForge-Konto +und folgen Sie dem Link "Bug Tracker" auf der ScummVM-Website. Bitte +stellen Sie sicher, dass sich der Bug wiedererzeugen lässt und immer noch +in der neusten Version von SVN oder des Daily builds auftritt. Bitte +sehen Sie auch auf der Problemliste unten und der Kompatiblitätsliste auf +der ScummVM-Website für dieses Spiel nach, um sicherzustellen, dass das +Problem nicht bereits bekannt ist: + + http://www.scummvm.org/compatibility_stable.php + +Bitte berichten Sie keine Fehler zu Spielen, die nicht als durchspielbar +im Bereich "Supported Games" oder der Kompatiblitätsliste aufgelistet +sind. Wir -wissen-, dass diese Spiele Fehler aufweisen. + +Bitte liefern Sie folgende Informationen: + - ScummVM-Version (BITTE mit neuster Version von SVN oder + des Daily builds testen) + - Einzelheiten zum Fehler, einschließlich Anweisungen, um den Fehler + hervorzurufen + - Sprache des Spiels (Englisch, Deutsch, ...) + - Version des Spiels (Version mit Sprachausgabe [Talkie], + Disketten-Version, ...) + - Plattform und gegebenenfalls Compiler (Win32, Linux, FreeBSD, ...) + - Fügen Sie einen Speicherstand hinzu, wenn es möglich ist. + - Wenn dieser Fehler erst seit kurzem Auftritt, teilen Sie bitte die + letzte Version ohne den Fehler mit und die erste Version mit diesem + Fehler. Auf diese Weise können wir diesen schneller beseitigen, + indem wir die vorgenommen Veränderungen einsehen. + +Zum Schluss möchten wir Sie noch bitten, jeden Punkt einzeln zu +berichten; bitte senden Sie nicht mehrere Punkte mit dem selben Ticket +ein, ansonsten wird es schwierig, den Status jedes einzelnen Fehlers +zu verfolgen. Denken Sie bitte auch daran, dass alle Fehlerberichte in +Englisch verfasst sein müssen. + diff --git a/doc/translations/fr/Lisezmoi.txt b/doc/translations/fr/Lisezmoi.txt new file mode 100755 index 0000000000..186f0cd24d --- /dev/null +++ b/doc/translations/fr/Lisezmoi.txt @@ -0,0 +1,172 @@ +Ce document est une traduction partielle du fichier README anglais. Le +document original contient bien plus d'informations, donc si vous ne +trouvez pas ce que vous cherchez dans ce document et que vous comprenez +un peu l'anglais, jetez un coup d'oeil au fichier README anglais. + +Pour plus d'informations, liste des jeux compatibles, détails pour +donner de l'argent, la dernière version disponibles et bien plus encore, +visitez le site web de ScummVM à l'adresse http://www.scummvm.org/ + +Table des matières: +------------------- +1.0) Introduction + * 1.1 À propos de ScummVM + * 1.2 Démarrage rapide +2.0) Contact + * 2.1 Signaler des bogues + +1.0) Introduction: +---- ------------- + +1.1) À propos de ScummVM: +---- -------------------- +ScummVM est un logiciel qui vous permet de jouer certain jeux +d'aventures graphiques de type 'point-and-click' (pointer et cliquer), à +condition que vous possédiez les fichiers de données du jeu. Le plus +astucieux: ScummVM remplace juste les exécutables fournis avec les jeux, +vous permettant de jouer sur les systèmes pour lesquels ils n'ont jamais +été conçus! + +A l'origine il a été conçu pour exécuter les jeux basé sur le système +SCUMM de LucasArts, tels que Maniac Mansion, Monkey Island, Day of the +Tentacle ou Sam et Max. SCUMM est l'acronyme de 'Script Creation Utility +for Maniac Mansion', qui a été le premier jeu pour lequel LucasArts a +conçu ce système. Et beaucoup plus tard, il donna son nom à ScummVM +('VM' signifiant Virtual Machine). + +Au cours du temps de nombreux jeux non-SCUMM ont été ajouté, et ScummVM +prend désormais en charge de nombreux jeux Sierra AGI et SCI (tels que +King's Quest 1-6, Space Quest 1-5, ...), Discworld 1 et 2, Simon the +Sorcerer 1 et 2, Beneath A Steel Sky, Lure of the Temptress, Les +Chevaliers de Baphomet (Broken Sword I), Les Boucliers de Quetzalcoatl +(Broken Sword II), L'amazone queen (Flight of the Amazon Queen), +Gobliiins 1-3, la série des Legend of Kyrandia, un grand nombre de jeux +pour enfants de Humongous Entertainment (incluant les jeux Marine Malice +et Pouce-Pouce) et beaucoup plus. Vous pouvez trouver une liste complète +et détaillée sur les aventures qui sont pris en charge et les problèmes +connus sur la page de compatibilité. ScummVM évolue en permanence, donc +vérifier cette liste de compatibilités souvent. + +Vous pouvez jouer à ces jeux sur des ordinateurs de bureau classiques +(sous Windows, Linux, Mac OS X, ...), sur des consoles (Dreamcast, +Nintendo DS et Wii, PS2, PSP, ...), smartphones (Android, iPhone, Pocket +PC, Symbian ...) et plus encore. + +À ce stade ScummVM est encore en cours de développement. Soyez conscient +que malgré tous nos efforts pour en faire un logiciel le plus stable +possible, des plantages peuvent survenir. et nous n'offrons aucune +garantie. Cela étant dit, certains jeux sont supportés depuis longtemps +et devrait fonctionner correctement avec une version stable et récente +de ScummVM. Vous pouvez vous faire une idée du niveau de support d'un +jeu en regardant la page de compatibilité. En fait, si vous cherchez un +peu vous pourrez découvrir que ScummVM est même utilisé dans le commerce +pour la ré-édition sur les plates-formes modernes de quelques-uns des +jeux supportés. Cela montre que plusieurs entreprises sont satisfaits de +la qualité du logiciel. + +Si vous aimez ScummVM n'hésitez pas à faire un don en utilisant le +bouton PayPal sur la page d'accueil ScummVM. Cela nous aidera à acheter +les services nécessaires pour rendre le développement de ScummVM plus +facile et plus rapide. Si vous ne pouvez pas faire de don, vous pouvez +aussi proposer des patches! + +1.2) Démarrage rapide: +---- ---------------- +IMPORTANT: Les instructions ci-dessous supposent que vous utilisez +ScummVM en Français. Par défaut, ScummVM utilise la langue de votre +système d'exploitation. Si vous préférez utiliser ScummVM en Anglais, +vous pouvez plutôt utiliser le guide du fichier README Anglais. + + +Pour les plus impatients, voici comment obtenir ScummVM en cinq étapes +simples. + +1. Télécharger ScummVM sur et +installer l'application. + +2. Créez un répertoire sur votre disque dur et copier les fichiers de +données de jeu à partir du support original dans ce répertoire. Répétez +cette opération pour chaque jeu que vous voulez jouer. Utilisez un +répertoire séparé pour chaque jeu. + +3. Lancez ScummVM. + +Si ScummVM apparaît en anglais au lieu du français, procédez comme suit +pour changer la langue: +- Cliquez sur 'Options'. +- Cliquez sur la flèche droite dans la barre d'onglets et sélectionnez + l'onglet 'Misc'. +- Choisissez 'Francais' dans le champs 'GUI Language' et cliquez sur + 'OK'. Confirmez-le message qui apparaît, cliquez sur 'Quit' pour + quitter ScummVM, puis redémarrer le programme. + +Maintenant cliquez sur 'Ajouter...', puis sélectionnez le répertoire +contenant les fichiers de données du jeu (ne pas essayer de sélectionner +les fichiers de données eux-mêmes!) et cliquez sur 'Choisir'. + +4. Une boîte de dialogue devrait apparaître vous permettant de +configurer divers paramètres si vous le souhaitez (la valeur par défaut +devrait convenir dans la plupart des cas). Confirmez la boîte de +dialogue. + +5. Sélectionnez le jeu que vous voulez jouer dans la liste, et appuyez +sur 'Démarrer'. + +ScummVM se souvient des jeux ajoutés. Donc si vous quittez ScummVM puis +le relancez la liste des jeux contiendra tous les jeux que vous avez +déjà ajoutés. Vous pouvez donc passer directement à l'étape 5, à moins +que vous vouliez ajouter des jeux supplémentaires. + +Astuce: Si vous souhaitez ajouter plusieurs jeux d'un coup, essayez +d'appuyer et de maintenir la touche Maj (Shift) tout en cliquant sur +'Ajouter...' - son texte changera en 'Ajout Massif…'. Vous serez alors +invitez à sélectioner un répertoire dans lequel ScummVM parcourra tous +les sous-répertoire à la recherche de jeux supportés. + + +2.0) Contact: +---- -------- +La meilleure façon de contacter l'équipe de ScummVM est en soumettant +des rapports de bogues (voir section 2.1) ou en utilisant nos forums +http://forums.scummvm.org. Vous pouvez également envoyer un e-mail sur +la liste de diffusion scummvm-devel, ou discuter avec nous sur IRC +(#scummvm sur irc.freenode.net). S'il vous plaît ne nous demandez pas de +supporter un jeu non pris en charge - lire la FAQ sur notre site web +avant. Notez que la langue officielle de la liste de diffusion, forum et +chat est l'Anglais, et aucune autre langues ne doivent être utilisée. + + +2.1) Reporting Bugs: +---- --------------- +Pour signaler un bogue, veuillez créer un compte SourceForge et suivez +le lien "Bug Tracker" depuis notre page d'accueil. S'il vous plaît +vérifiez que le bogue est reproductible, et se produit encore dans la +'Daily Build' la plus récente. Vérifiez également la liste des problèmes +connus (ci-dessous) et la liste de compatibilité sur notre site Web pour +ce jeu, pour s'assurer que le problème n'est pas déjà connue: + + http://www.scummvm.org/compatibility_stable.php + +Veuillez ne pas rapporter de bogues sur les jeux qui ne sont pas +répertoriés comme étant finissable sur la liste de compatibilité. Nous +savons que ces jeux ont des bogues. + +Veuillez inclure les informations suivantes lorsque vous signalez un +problème: + - Version de ScummVM (veuillez tester avec la 'Daily Build' la plus + récente) + - Détails du problème, incluant les instructions pour le reproduire + - Langue du jeu (anglais, allemand, ...) + - Version du jeu (talkie, disquette, ...) + - Plate-forme et compilateur (Win32, Linux, Mac, FreeBSD, ...) + - Joindre une sauvegarde si possible + - Si ce problème est récent, s'il vous plaît notez la dernière + version sans bogue, et la première version qui à le problème. De + cette façon, nous pouvons y remédier plus rapidement, en regardant + les modifications apportées entre ces deux versions. + +Enfin, veuillez signaler chaque problème séparément, sinon, il devient +difficile de suivre l'état de chaque problème individuel. S'il vous +plaît gardez à l'esprit également que tous les rapports de bogue doivent +être rédigés en anglais. + -- cgit v1.2.3 From 7bdd3f3904828704d48e8b0a60fcfeab27f4287b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 24 Jun 2011 02:05:26 +0300 Subject: LASTEXPRESS: Implement playLoopingSound() In order for it to work properly, updateQueue() should be unstubbed. --- engines/lastexpress/game/sound.cpp | 111 ++++++++++++++++++++++++++++++++++++- engines/lastexpress/game/sound.h | 4 +- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 1c7abbf95e..6cd5731e54 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -26,6 +26,7 @@ #include "lastexpress/game/entities.h" #include "lastexpress/game/inventory.h" #include "lastexpress/game/logic.h" +#include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/state.h" @@ -117,6 +118,8 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( _drawSubtitles = 0; _currentSubtitle = NULL; + + _loopingSoundDuration = 0; } SoundManager::~SoundManager() { @@ -458,7 +461,7 @@ void SoundManager::removeEntry(SoundEntry *entry) { if (entry->entity) { if (entry->entity == kEntitySteam) - playLoopingSound(); + playLoopingSound(2); else if (entry->entity != kEntityTrain) getSavePoints()->push(kEntityPlayer, entry->entity, kActionEndSound); } @@ -1937,8 +1940,110 @@ void SoundManager::drawSubtitleOnScreen(SubtitleEntry *subtitle) { ////////////////////////////////////////////////////////////////////////// // Misc ////////////////////////////////////////////////////////////////////////// -void SoundManager::playLoopingSound() { - warning("SoundManager::playLoopingSound: not implemented!"); +void SoundManager::playLoopingSound(int param) { + Common::List::iterator snd; + char tmp[80]; + + for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { + if ((*snd)->type == kSoundType1) + break; + } + + byte numLoops[8]; + static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, + kPosition_6470, kPosition_5790, + kPosition_4840, kPosition_4070, + kPosition_3050, kPosition_2740 }; + + numLoops[1] = 4; + numLoops[2] = 2; + numLoops[3] = 2; + numLoops[4] = 2; + numLoops[5] = 2; + numLoops[6] = 2; + + tmp[0] = 0; + + int partNumber = 1; + int fnameLen = 6; + + if (_state & 1 && param >= 0x45 && param <= 0x46) { + if (_state & 2) { + strcpy(tmp, "STEAM.SND"); + + _loopingSoundDuration = 32767; + } else { + if (getEntityData(kEntityPlayer)->location == kLocationOutsideTrain) { + partNumber = 6; + } else { + if (getEntities()->isInsideCompartments(kEntityPlayer)) { + int objNum = (getEntityData(kEntityPlayer)->car - 3) < 1 ? 9 : 40; // Weird numbers + + numLoops[0] = 0; + + for (int pos = 0; pos < 8; pos++) { + if (numLoops[0]) + break; + if (getEntities()->isInsideCompartment(kEntityPlayer, getEntityData(kEntityPlayer)->car, positions[pos])) { + numLoops[0] = 1; + partNumber = (getObjects()->get((ObjectIndex)objNum).location - 2) < 1 ? 6 : 1; + } + objNum++; + } + } else { + switch (getEntityData(kEntityPlayer)->car) { + case 1: + case 6: + partNumber = 4; + break; + case 2: + case 3: + case 4: + case 5: + partNumber = 1; + break; + case 7: + partNumber = 5; + break; + case 8: + partNumber = 99; + break; + case 9: + partNumber = 3; + break; + default: + partNumber = 6; + break; + } + } + } + + if (partNumber != 99) { + sprintf(tmp, "LOOP%d%c.SND", partNumber, _engine->getRandom().getRandomNumber(numLoops[partNumber] - 1) + 'A'); + } + } + + if (getFlags()->flag_3) + fnameLen = 5; + + if (!*snd || scumm_strnicmp((*snd)->name2.c_str(), tmp, fnameLen)) { + _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; + + if (partNumber != 99) { + playSoundWithSubtitles(tmp, kFlagLoopedSound, kEntitySteam); + + if (*snd) + updateEntry(*snd, 0); + + for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { + if ((*snd)->type == kSoundType1) { + updateEntry((*snd), 7); + break; + } + } + } + } + } } void SoundManager::stopAllSound() { diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index 839c868813..f49f2bc9f0 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -125,6 +125,7 @@ public: kFlagDefault = 0x10, kFlagType1_2 = 0x1000000, + kFlagLoopedSound = 0x1001001, kFlagSteam = 0x1001007, kFlagType13 = 0x3000000, kFlagMenuClock = 0x3080010, @@ -345,7 +346,8 @@ private: uint32 _lastWarning[12]; // Looping sound - void playLoopingSound(); + void playLoopingSound(int param); + int _loopingSoundDuration; // Sound entries Common::List _soundList; ///< List of all sound entries -- cgit v1.2.3 From a5748a34afe9ae837b14f26f69d6b3518ef91966 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 24 Jun 2011 09:34:23 +0400 Subject: DREAMWEB: Fixed continuing to another procedure. (axe misuse crash) --- devtools/tasmrecover/tasm/cpp.py | 2 ++ engines/dreamweb/dreamgen.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 0196e5b45c..dfdfb239f4 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -466,7 +466,9 @@ namespace %s { self.resolve_label(s.label) #adding statements + #BIG FIXME: this is quite ugly to handle code analysis from the code generation. rewrite me! for label, proc, offset in self.unbounded: + self.body += "\treturn;\n" #we need to return before calling code from the other proc self.body += "/*continuing to unbounded code: %s from %s:%d-%d*/\n" %(label, proc.name, offset, len(proc.stmts)) start = len(self.proc.stmts) self.proc.add_label(label) diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index e92cd83c2b..a5a4748948 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -3482,6 +3482,7 @@ atlast4: bx = pop(); es = pop(); data.byte(kLockstatus) = 1; + return; /*continuing to unbounded code: shutdoor from dodoor:60-87*/ shutdoor: cl = es.byte(bx+19); @@ -6737,6 +6738,7 @@ doopeninv: delpointer(); data.byte(kOpenedob) = 255; goto waitexam; + return; /*continuing to unbounded code: examineagain from examineob:3-66*/ examineagain: data.byte(kInmaparea) = 0; @@ -13187,6 +13189,7 @@ void DreamGenContext::useaxe() { return; notinpool: showfirstuse(); + return; /*continuing to unbounded code: axeondoor from useelvdoor:19-30*/ axeondoor: al = 15; -- cgit v1.2.3 From 08375150ca0b4719ddda7932d5f5061fff225a28 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Fri, 24 Jun 2011 09:41:13 +0400 Subject: DREAMWEB: Show subtitle options only for CD version --- engines/dreamweb/detection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index f3d5b07835..47e25ded33 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -85,8 +85,9 @@ bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const { bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const { switch(f) { case kSupportsRTL: - case kSupportsSubtitleOptions: return true; + case kSupportsSubtitleOptions: + return _gameDescription->desc.flags & ADGF_CD; default: return false; } -- cgit v1.2.3 From 5d020fffad44c78414b91de7c26653b11b78b60f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 24 Jun 2011 10:56:49 -0400 Subject: LASTEXPRESS: Refactor Sound class - Move entry-related functions to separate class - Move enumeration to shared header and rename FlagType to SoundFlag --- engines/lastexpress/entities/abbot.cpp | 2 +- engines/lastexpress/entities/anna.cpp | 12 +- engines/lastexpress/entities/august.cpp | 8 +- engines/lastexpress/entities/boutarel.cpp | 2 +- engines/lastexpress/entities/chapters.cpp | 30 ++-- engines/lastexpress/entities/coudert.cpp | 2 +- engines/lastexpress/entities/entity.cpp | 2 +- engines/lastexpress/entities/entity.h | 2 +- engines/lastexpress/entities/gendarmes.cpp | 18 +-- engines/lastexpress/entities/gendarmes.h | 2 +- engines/lastexpress/entities/kahina.cpp | 2 +- engines/lastexpress/entities/kronos.cpp | 2 +- engines/lastexpress/entities/mahmud.cpp | 4 +- engines/lastexpress/entities/max.cpp | 2 +- engines/lastexpress/entities/mertens.cpp | 8 +- engines/lastexpress/entities/milos.cpp | 4 +- engines/lastexpress/entities/pascale.cpp | 8 +- engines/lastexpress/entities/rebecca.cpp | 4 +- engines/lastexpress/entities/tables.cpp | 8 +- engines/lastexpress/entities/tatiana.cpp | 2 +- engines/lastexpress/entities/train.cpp | 30 ++-- engines/lastexpress/entities/vassili.cpp | 4 +- engines/lastexpress/entities/verges.cpp | 4 +- engines/lastexpress/entities/vesna.cpp | 4 +- engines/lastexpress/fight/fighter_anna.cpp | 2 +- engines/lastexpress/fight/fighter_ivo.cpp | 2 +- engines/lastexpress/fight/fighter_milos.cpp | 4 +- engines/lastexpress/fight/fighter_salko.cpp | 2 +- engines/lastexpress/fight/fighter_vesna.cpp | 2 +- engines/lastexpress/game/action.cpp | 18 +-- engines/lastexpress/game/entities.cpp | 6 +- engines/lastexpress/game/inventory.cpp | 2 +- engines/lastexpress/game/logic.cpp | 2 +- engines/lastexpress/game/scenes.cpp | 6 +- engines/lastexpress/game/sound.cpp | 168 +++++++------------ engines/lastexpress/game/sound.h | 239 ++-------------------------- engines/lastexpress/menu/menu.cpp | 14 +- engines/lastexpress/module.mk | 1 + engines/lastexpress/shared.h | 56 +++++++ engines/lastexpress/sound/entry.cpp | 151 ++++++++++++++++++ engines/lastexpress/sound/entry.h | 173 ++++++++++++++++++++ 41 files changed, 565 insertions(+), 449 deletions(-) create mode 100644 engines/lastexpress/sound/entry.cpp create mode 100644 engines/lastexpress/sound/entry.h diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 29bb31b248..112edec9af 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -1112,7 +1112,7 @@ IMPLEMENT_FUNCTION(35, Abbot, function35) case 2: getData()->location = kLocationOutsideCompartment; - getSound()->playSound(kEntityAbbot, "Abb3040", SoundManager::kFlagInvalid, 45); + getSound()->playSound(kEntityAbbot, "Abb3040", kFlagInvalid, 45); getEntities()->updatePositionEnter(kEntityAbbot, kCarRestaurant, 57); setCallback(3); diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index bce99ad16d..d794cc8520 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -2063,7 +2063,7 @@ IMPLEMENT_FUNCTION(47, Anna, function47) break; case 4: - getSound()->playSound(kEntityAnna, getEvent(kEventAugustLunch) ? "Ann3136" : "Ann3136A", SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityAnna, getEvent(kEventAugustLunch) ? "Ann3136" : "Ann3136A", kFlagInvalid, 30); getSavePoints()->push(kEntityAnna, kEntityAugust, kAction122358304); setCallback(5); @@ -2258,7 +2258,7 @@ IMPLEMENT_FUNCTION(51, Anna, function51) break; case kActionDefault: - getSound()->playSound(kEntityAnna, "Aug3142", SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityAnna, "Aug3142", kFlagInvalid, 30); getEntities()->updatePositionEnter(kEntityAnna, kCarRestaurant, 57); getEntities()->drawSequenceRight(kEntityAnna, "112A"); if (getEntities()->isInRestaurant(kEntityPlayer)) @@ -3841,7 +3841,7 @@ IMPLEMENT_FUNCTION(78, Anna, function78) case 2: getAction()->playAnimation(kEventKronosHostageAnna); getScenes()->loadSceneFromPosition(kCarRestaurant, 61); - getSound()->playSound(kEntityAnna, "Mus024", SoundManager::kFlagDefault); + getSound()->playSound(kEntityAnna, "Mus024", kFlagDefault); setup_function79(); break; } @@ -3911,11 +3911,11 @@ IMPLEMENT_FUNCTION(80, Anna, function80) case kActionNone: UPDATE_PARAM(params->param1, getState()->timeTicks, 450); - getSound()->playSound(kEntityPlayer, "Kro5001", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "Kro5001", kFlagDefault); break; case kActionEndSound: - getSound()->playSound(kEntityPlayer, "Kro5002", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "Kro5002", kFlagDefault); getState()->time = kTime4923000; setCallback(1); @@ -3940,7 +3940,7 @@ IMPLEMENT_FUNCTION(80, Anna, function80) getAction()->playAnimation(kEventKronosBringFirebird); getScenes()->loadSceneFromItem(kItemFirebird); - getSound()->playSound(kEntityAnna, "Mus025", SoundManager::kFlagDefault); + getSound()->playSound(kEntityAnna, "Mus025", kFlagDefault); break; case 2: diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index f7e7390b90..fbd50d64fb 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -199,7 +199,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_S(13, August, playSound16) - Entity::playSound(savepoint, false, SoundManager::kFlagDefault); + Entity::playSound(savepoint, false, kFlagDefault); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// @@ -338,7 +338,7 @@ IMPLEMENT_FUNCTION_II(19, August, function19, bool, bool) case kAction1: getData()->inventoryItem = kItemNone; getSound()->playSound(kEntityPlayer, "CAT1002"); - getSound()->playSound(kEntityAugust, "AUG3101", SoundManager::kFlagInvalid, 15); + getSound()->playSound(kEntityAugust, "AUG3101", kFlagInvalid, 15); break; case kActionDefault: @@ -2179,7 +2179,7 @@ IMPLEMENT_FUNCTION_III(42, August, function42, CarIndex, EntityPosition, bool) getData()->inventoryItem = kItemNone; getSound()->playSound(kEntityPlayer, "CAT1002"); - getSound()->playSound(kEntityAugust, getEvent(kEventAugustBringBriefcase) ? "AUG3103" : "AUG3100", SoundManager::kFlagInvalid, 15); + getSound()->playSound(kEntityAugust, getEvent(kEventAugustBringBriefcase) ? "AUG3103" : "AUG3100", kFlagInvalid, 15); break; case kActionExcuseMe: @@ -2385,7 +2385,7 @@ IMPLEMENT_FUNCTION(45, August, function45) case kAction1: getData()->inventoryItem = kItemNone; getSound()->playSound(kEntityPlayer, "CAT1002"); - getSound()->playSound(kEntityAugust, "AUG3102", SoundManager::kFlagInvalid, 15); + getSound()->playSound(kEntityAugust, "AUG3102", kFlagInvalid, 15); break; case kActionDefault: diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index 0b2040897c..db7761784f 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -214,7 +214,7 @@ IMPLEMENT_FUNCTION_I(11, Boutarel, function11, bool) break; case kChapter1: - getSound()->playSound(kEntityBoutarel, "MRB1075", SoundManager::kFlagInvalid, 60); + getSound()->playSound(kEntityBoutarel, "MRB1075", kFlagInvalid, 60); break; case kChapter3: diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index 6a41590f64..d4425ada43 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -160,7 +160,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) break; case kActionEndSound: - getSound()->playSound(kEntityChapters, "MUS0009", SoundManager::kFlagDefault); + getSound()->playSound(kEntityChapters, "MUS0009", kFlagDefault); break; case kActionKnock: @@ -192,10 +192,10 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) CALLBACK_ACTION(); } else { getSound()->playSound(kEntityPlayer, "LIB014"); - getSound()->playSound(kEntityPlayer, "LIB015", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityPlayer, "LIB015", kFlagDefault, 15); if (!getSound()->isBuffered(kEntityChapters)) - getSound()->playSound(kEntityChapters, "MUS009", SoundManager::kFlagDefault); + getSound()->playSound(kEntityChapters, "MUS009", kFlagDefault); getScenes()->loadSceneFromPosition(kCarLocomotive, 38); @@ -271,7 +271,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) getSound()->processEntry("ZFX1007B"); - getSound()->playSound(kEntityPlayer, "MUS008", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); // FIXME add event pump ? @@ -699,7 +699,7 @@ IMPLEMENT_FUNCTION(9, Chapters, chapter1Next) ENTITY_PARAM(0, 3) = 0; } - getSound()->playSound(kEntityPlayer, "MUS008", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); while (getSound()->isBuffered("MUS008")) @@ -915,11 +915,11 @@ IMPLEMENT_FUNCTION(15, Chapters, chapter3Handler) break; case 0: - getSound()->playSound(kEntityPlayer, "ZFX1008", (SoundManager::FlagType)(rnd(15) + 2)); + getSound()->playSound(kEntityPlayer, "ZFX1008", (SoundFlag)(rnd(15) + 2)); break; case 1: - getSound()->playSound(kEntityPlayer, "ZFX1009", (SoundManager::FlagType)(rnd(15) + 2)); + getSound()->playSound(kEntityPlayer, "ZFX1009", (SoundFlag)(rnd(15) + 2)); break; } @@ -1214,11 +1214,11 @@ IMPLEMENT_FUNCTION(19, Chapters, chapter4Handler) break; case 0: - getSound()->playSound(kEntityPlayer, "ZFX1008", (SoundManager::FlagType)(rnd(15) + 2)); + getSound()->playSound(kEntityPlayer, "ZFX1008", (SoundFlag)(rnd(15) + 2)); break; case 1: - getSound()->playSound(kEntityPlayer, "ZFX1009", (SoundManager::FlagType)(rnd(15) + 2)); + getSound()->playSound(kEntityPlayer, "ZFX1009", (SoundFlag)(rnd(15) + 2)); break; } @@ -1418,7 +1418,7 @@ label_callback_4: case 11: getScenes()->loadSceneFromPosition(kCarRedSleeping, 74); - getSound()->playSound(kEntityTrain, "ZFX4001", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTrain, "ZFX4001", kFlagDefault); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneNone, true); break; } @@ -1471,7 +1471,7 @@ label_callback_4: ENTITY_PARAM(0, 3) = 0; } - getSound()->playSound(kEntityPlayer, "MUS008", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); while (getSound()->isBuffered("MUS008")) @@ -1538,7 +1538,7 @@ label_callback_4: if (getSound()->isBuffered(kEntityChapters)) getSound()->removeFromQueue(kEntityChapters); - getSound()->playSound(kEntityTrain, "ZFX4001", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTrain, "ZFX4001", kFlagDefault); getLogic()->gameOver(kSavegameTypeIndex, 0, kSceneNone, true); break; @@ -1674,7 +1674,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) params->param2 = 1; if (!getProgress().isNightTime) { - getSound()->playSound(kEntityChapters, "ARRIVE", SoundManager::kFlag8); + getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); getSound()->processEntries(); } } @@ -1683,7 +1683,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) params->param3 = 1; if (!getEvent(kEventLocomotiveMilosDay) && !getEvent(kEventLocomotiveMilosNight)) { - getSound()->playSound(kEntityChapters, "ARRIVE", SoundManager::kFlag8); + getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); getSound()->processEntries(); } } @@ -1797,7 +1797,7 @@ void Chapters::enterExitStation(const SavePoint &savepoint, bool isEnteringStati void Chapters::enterExitHelper(bool isEnteringStation) { EXPOSE_PARAMS(EntityData::EntityParametersSIIS); - getSound()->playSound(kEntityChapters, isEnteringStation ? "ARRIVE" : "DEPART", SoundManager::kFlag8); + getSound()->playSound(kEntityChapters, isEnteringStation ? "ARRIVE" : "DEPART", kFlag8); getSound()->processEntries(); getObjects()->update(kObjectHandleOutsideLeft, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index e74471ebca..0733a4c984 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -258,7 +258,7 @@ IMPLEMENT_FUNCTION_NOSETUP(7, Coudert, playSound16) break; case kActionDefault: - getSound()->playSound(kEntityCoudert, (char *)¶ms->seq1, SoundManager::kFlagDefault); + getSound()->playSound(kEntityCoudert, (char *)¶ms->seq1, kFlagDefault); break; case kActionCallback: diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 22750989fb..f6d24d69ca 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -255,7 +255,7 @@ void Entity::savegame(const SavePoint &savepoint) { } } -void Entity::playSound(const SavePoint &savepoint, bool resetItem, SoundManager::FlagType flag) { +void Entity::playSound(const SavePoint &savepoint, bool resetItem, SoundFlag flag) { EXPOSE_PARAMS(EntityData::EntityParametersSIIS) switch (savepoint.action) { diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 01cf17f791..1988aef6fe 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -686,7 +686,7 @@ protected: * @param resetItem true to reset item. * @param flag sound flag */ - void playSound(const SavePoint &savepoint, bool resetItem = false, SoundManager::FlagType flag = SoundManager::kFlagInvalid); + void playSound(const SavePoint &savepoint, bool resetItem = false, SoundFlag flag = kFlagInvalid); /** * Draws the entity diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp index f5ae191f9d..daa50956d3 100644 --- a/engines/lastexpress/entities/gendarmes.cpp +++ b/engines/lastexpress/entities/gendarmes.cpp @@ -88,12 +88,12 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_S(5, Gendarmes, arrestPlaysound16) - arrest(savepoint, true, SoundManager::kFlagDefault); + arrest(savepoint, true, kFlagDefault); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_I(6, Gendarmes, arrestCallback, uint32) - arrest(savepoint, true, SoundManager::kFlagInvalid, true); + arrest(savepoint, true, kFlagInvalid, true); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// @@ -103,7 +103,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_II(8, Gendarmes, arrestUpdateEntity, CarIndex, EntityPosition) - arrest(savepoint, true, SoundManager::kFlagInvalid, false, true); + arrest(savepoint, true, kFlagInvalid, false, true); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// @@ -221,7 +221,7 @@ IMPLEMENT_FUNCTION_IISS(9, Gendarmes, function9, CarIndex, EntityPosition) strcpy(arrestSound, "POL1043"); strcat(arrestSound, (char *)¶ms->seq2); - getSound()->playSound(kEntityGendarmes, arrestSound, SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityGendarmes, arrestSound, kFlagInvalid, 30); } getData()->location = kLocationInsideCompartment; @@ -264,7 +264,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje if (params->param6 == 0 || getState()->timeTicks > (uint32)params->param6) { params->param6 = kTimeInvalid; - getSound()->playSound(kEntityGendarmes, "POL1046A", SoundManager::kFlagDefault); + getSound()->playSound(kEntityGendarmes, "POL1046A", kFlagDefault); } UPDATE_PARAM(params->param7, getState()->timeTicks, 300); @@ -276,7 +276,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje if (getEntities()->isOutsideAlexeiWindow()) getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49); - getSound()->playSound(kEntityGendarmes, "LIB017", SoundManager::kFlagDefault); + getSound()->playSound(kEntityGendarmes, "LIB017", kFlagDefault); setCallback(getProgress().jacket == kJacketBlood ? 3 : 4); setup_savegame(kSavegameTypeEvent, getProgress().jacket == kJacketBlood ? kEventMertensBloodJacket : kEventGendarmesArrestation); @@ -312,7 +312,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje break; case 2: - getSound()->playSound(kEntityGendarmes, "LIB014", SoundManager::kFlagDefault); + getSound()->playSound(kEntityGendarmes, "LIB014", kFlagDefault); getAction()->playAnimation(kEventGendarmesArrestation); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverPolice1, true); break; @@ -338,7 +338,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje break; case 6: - getSound()->playSound(kEntityGendarmes, "LIB014", SoundManager::kFlagDefault); + getSound()->playSound(kEntityGendarmes, "LIB014", kFlagDefault); getAction()->playAnimation(kEventGendarmesArrestation); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverPolice1, true); break; @@ -544,7 +544,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// // Private functions ////////////////////////////////////////////////////////////////////////// -void Gendarmes::arrest(const SavePoint &savepoint, bool shouldPlaySound, SoundManager::FlagType flag, bool checkCallback, bool shouldUpdateEntity) { +void Gendarmes::arrest(const SavePoint &savepoint, bool shouldPlaySound, SoundFlag flag, bool checkCallback, bool shouldUpdateEntity) { switch (savepoint.action) { default: break; diff --git a/engines/lastexpress/entities/gendarmes.h b/engines/lastexpress/entities/gendarmes.h index e8f9cb2c38..5c3ff1d439 100644 --- a/engines/lastexpress/entities/gendarmes.h +++ b/engines/lastexpress/entities/gendarmes.h @@ -88,7 +88,7 @@ public: DECLARE_FUNCTION(chapter5) private: - void arrest(const SavePoint &savepoint, bool playSound = false, SoundManager::FlagType flag = SoundManager::kFlagInvalid, bool checkCallback = false, bool shouldUpdateEntity = false); + void arrest(const SavePoint &savepoint, bool playSound = false, SoundFlag flag = kFlagInvalid, bool checkCallback = false, bool shouldUpdateEntity = false); }; } // End of namespace LastExpress diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index 6472ce0533..db71981b60 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -1186,7 +1186,7 @@ IMPLEMENT_FUNCTION(24, Kahina, function24) getEntities()->updateEntity(kEntityKahina, kCarKronos, kPosition_9270); getEntities()->loadSceneFromEntityPosition(getData()->car, (EntityPosition)(getData()->entityPosition + 750)); getSavePoints()->push(kEntityKahina, kEntityKronos, kAction235599361); - getSound()->playSound(kEntityKahina, "MUS016", SoundManager::kFlagDefault); + getSound()->playSound(kEntityKahina, "MUS016", kFlagDefault); getProgress().field_44 = 1; params->param1 = true; diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 925b0967b7..5afc52fe3d 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -457,7 +457,7 @@ IMPLEMENT_FUNCTION(19, Kronos, function19) case 2: getAction()->playAnimation(kEventConcertStart); - getSound()->setupEntry(SoundManager::kSoundType7, kEntityKronos); + getSound()->setupEntry(kSoundType7, kEntityKronos); getScenes()->loadSceneFromPosition(kCarKronos, 83); RESET_ENTITY_STATE(kEntityRebecca, Rebecca, setup_function39); diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index 7d30d31a84..f9ae741d0e 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -204,7 +204,7 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) if (getState()->time >= kTimeCityGalanta) { params->param3 = 0; } else { - getSound()->playSound(kEntityTrain, "LIB050", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTrain, "LIB050", kFlagDefault); getLogic()->gameOver(kSavegameTypeIndex, 0, (getProgress().chapter == kChapter1) ? kSceneGameOverPolice1 : kSceneGameOverPolice2, true); } break; @@ -235,7 +235,7 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) break; case kActionDefault: - getSound()->playSound(kEntityMahmud, params->param2 ? "MAH1170A" : "MAH1173", SoundManager::kFlagInvalid, 45); + getSound()->playSound(kEntityMahmud, params->param2 ? "MAH1170A" : "MAH1173", kFlagInvalid, 45); getProgress().field_C4 = 1; setCallback(1); diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 7e5931322d..12123ed04a 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -480,7 +480,7 @@ IMPLEMENT_FUNCTION(14, Max, freeFromCage) getSound()->removeFromQueue(kEntityMax); getAction()->playAnimation(kEventCathMaxCage); - getSound()->setupEntry(SoundManager::kSoundType7, kEntityMax); + getSound()->setupEntry(kSoundType7, kEntityMax); getScenes()->processScene(); break; diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index 91082f487e..b99e344b20 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -289,7 +289,7 @@ IMPLEMENT_FUNCTION_S(8, Mertens, playSound16) break; case kActionDefault: - getSound()->playSound(kEntityMertens, (char *)¶ms->seq1, SoundManager::kFlagDefault); + getSound()->playSound(kEntityMertens, (char *)¶ms->seq1, kFlagDefault); break; case kActionCallback: @@ -896,7 +896,7 @@ IMPLEMENT_FUNCTION(17, Mertens, function17) } else { // Got the passenger list, Mertens is looking for it before sitting ENTITY_PARAM(0, 2) = 1; - getSound()->playSound(kEntityMertens, "CON1058", SoundManager::kFlagInvalid, 75); + getSound()->playSound(kEntityMertens, "CON1058", kFlagInvalid, 75); getEntities()->drawSequenceRight(kEntityMertens, "601D"); } @@ -984,7 +984,7 @@ IMPLEMENT_FUNCTION(18, Mertens, function18) getEntities()->drawSequenceRight(kEntityMertens, "601A"); } else { ENTITY_PARAM(0, 2) = 1; - getSound()->playSound(kEntityMertens, "CON1058", SoundManager::kFlagInvalid, 75); + getSound()->playSound(kEntityMertens, "CON1058", kFlagInvalid, 75); getEntities()->drawSequenceRight(kEntityMertens, "601D"); } @@ -1199,7 +1199,7 @@ IMPLEMENT_FUNCTION(22, Mertens, function22) getData()->location = kLocationInsideCompartment; getEntities()->clearSequences(kEntityMertens); if (!getSound()->isBuffered(kEntityMertens)) - getSound()->playSound(kEntityMertens, "MAH1172", SoundManager::kFlagInvalid, 225); + getSound()->playSound(kEntityMertens, "MAH1172", kFlagInvalid, 225); setCallback(7); setup_function21(kObjectCompartment4, kObject20); diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 45fd6883f0..68030b3be3 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -111,7 +111,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_S(7, Milos, playSound16) - Entity::playSound(savepoint, false, SoundManager::kFlagDefault); + Entity::playSound(savepoint, false, kFlagDefault); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// @@ -1728,7 +1728,7 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) getSound()->processEntries(); getAction()->playAnimation(isNight() ? kEventLocomotiveMilosNight : kEventLocomotiveMilosDay); - getSound()->setupEntry(SoundManager::kSoundType7, kEntityMilos); + getSound()->setupEntry(kSoundType7, kEntityMilos); getScenes()->loadSceneFromPosition(kCarCoalTender, 1); break; diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index 7cf7f7766e..d4a7359511 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -141,15 +141,15 @@ IMPLEMENT_FUNCTION(8, Pascale, welcomeSophieAndRebecca) break; case kChapter1: - getSound()->playSound(kEntityPascale, "REB1198", SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityPascale, "REB1198", kFlagInvalid, 30); break; case kChapter3: - getSound()->playSound(kEntityPascale, "REB3001", SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityPascale, "REB3001", kFlagInvalid, 30); break; case kChapter4: - getSound()->playSound(kEntityPascale, "REB4001", SoundManager::kFlagInvalid, 30); + getSound()->playSound(kEntityPascale, "REB4001", kFlagInvalid, 30); break; } @@ -754,7 +754,7 @@ IMPLEMENT_FUNCTION(24, Pascale, welcomeAbbot) break; case kActionDefault: - getSound()->playSound(kEntityPascale, "ABB3015", SoundManager::kFlagInvalid, 105); + getSound()->playSound(kEntityPascale, "ABB3015", kFlagInvalid, 105); getEntities()->drawSequenceRight(kEntityPascale, "029A1"); getEntities()->drawSequenceRight(kEntityAbbot, "029A2"); break; diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index 1cb895d8d6..68a37b368d 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -316,7 +316,7 @@ IMPLEMENT_FUNCTION_I(17, Rebecca, function17, bool) getData()->location = kLocationOutsideCompartment; if (getProgress().chapter == kChapter3) - getSound()->playSound(kEntityRebecca, "Reb3005", SoundManager::kFlagInvalid, 75); + getSound()->playSound(kEntityRebecca, "Reb3005", kFlagInvalid, 75); if (params->param1) { setCallback(5); @@ -1357,7 +1357,7 @@ label_callback_3: params->param5 = kTimeInvalid; getData()->inventoryItem = kItemNone; - getSound()->playSound(kEntityRebecca, "Reb3008", SoundManager::kFlagInvalid, 60); + getSound()->playSound(kEntityRebecca, "Reb3008", kFlagInvalid, 60); getEntities()->updatePositionEnter(kEntityRebecca, kCarRestaurant, 52); setCallback(3); diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index c372663c40..da053c5871 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -49,7 +49,7 @@ Tables::Tables(LastExpressEngine *engine, EntityIndex id) : Entity(engine, id) { IMPLEMENT_FUNCTION(1, Tables, chapter1) if (savepoint.action == kActionDefault) { if (_id == kEntityTables2) - getSound()->playSoundWithSubtitles("LOOP8A.SND", SoundManager::kFlagLoop, kEntityTables2); + getSound()->playSoundWithSubtitles("LOOP8A.SND", kFlagLoop, kEntityTables2); setup_draw(); } @@ -59,7 +59,7 @@ IMPLEMENT_FUNCTION_END IMPLEMENT_FUNCTION(2, Tables, chapter2) if (savepoint.action == kActionDefault) { if (_id == kEntityTables2) - getSound()->playSoundWithSubtitles("LOOP8A.SND", SoundManager::kFlagLoop, kEntityTables2); + getSound()->playSoundWithSubtitles("LOOP8A.SND", kFlagLoop, kEntityTables2); setup_draw(); } @@ -69,7 +69,7 @@ IMPLEMENT_FUNCTION_END IMPLEMENT_FUNCTION(3, Tables, chapter3) if (savepoint.action == kActionDefault) { if (_id == kEntityTables2) - getSound()->playSoundWithSubtitles("LOOP8A.SND", SoundManager::kFlagLoop, kEntityTables2); + getSound()->playSoundWithSubtitles("LOOP8A.SND", kFlagLoop, kEntityTables2); setup_draw(); } @@ -79,7 +79,7 @@ IMPLEMENT_FUNCTION_END IMPLEMENT_FUNCTION(4, Tables, chapter4) if (savepoint.action == kActionDefault) { if (_id == kEntityTables2) - getSound()->playSoundWithSubtitles("LOOP8A.SND", SoundManager::kFlagLoop, kEntityTables2); + getSound()->playSoundWithSubtitles("LOOP8A.SND", kFlagLoop, kEntityTables2); setup_draw(); } diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index 6e25d8c5c7..db5c413dc9 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -1952,7 +1952,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48) UPDATE_PARAM_GOTO(params->param2, getState()->timeTicks, 5 * (3 * rnd(5) + 30), label_end); - getSound()->playSound(kEntityTatiana, "LIB012", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTatiana, "LIB012", kFlagDefault); params->param2 = 0; label_end: diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 19c6fe279c..1a5c6f4f64 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -118,7 +118,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) getObjects()->update((ObjectIndex)params->param1, kEntityTrain, kObjectLocation3, kCursorNormal, kCursorNormal); // Knock / closed door sound - getSound()->playSound(kEntityTables5, (params->param2 == 8) ? "LIB012" : "LIB013", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables5, (params->param2 == 8) ? "LIB012" : "LIB013", kFlagDefault); if (params->param4 && params->param5) { @@ -130,17 +130,17 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1014", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013", SoundManager::kFlagDefault, 15); - getSound()->playSound(kEntityTables5, "Har1016", SoundManager::kFlagDefault, 150); + getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1016", kFlagDefault, 150); break; case 3: - getSound()->playSound(kEntityTables5, "Har1015A", SoundManager::kFlagDefault, 15); - getSound()->playSound(kEntityTables5, "Har1015", SoundManager::kFlagDefault, 150); + getSound()->playSound(kEntityTables5, "Har1015A", kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1015", kFlagDefault, 150); break; } @@ -164,15 +164,15 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1014", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); break; case 3: - getSound()->playSound(kEntityTables5, "Har1013A", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013A", kFlagDefault, 15); break; } @@ -191,11 +191,11 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1012", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1012", kFlagDefault, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1012A", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1012A", kFlagDefault, 15); break; } @@ -207,7 +207,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) ENTITY_PARAM(0, 1)++; if (ENTITY_PARAM(0, 1) <= 1) - getSound()->playSound(kEntityTables5, "Har1014", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1014", kFlagDefault, 15); else params->param8 = 1; @@ -221,7 +221,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) ENTITY_PARAM(0, 4)++; if (ENTITY_PARAM(0, 4) <= 1) { - getSound()->playSound(kEntityTables5, "Har1011", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1011", kFlagDefault, 15); handleCompartmentAction(); return; } @@ -241,11 +241,11 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) break; case 1: - getSound()->playSound(kEntityTables5, "Har1013", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013", kFlagDefault, 15); break; case 2: - getSound()->playSound(kEntityTables5, "Har1013A", SoundManager::kFlagDefault, 15); + getSound()->playSound(kEntityTables5, "Har1013A", kFlagDefault, 15); break; } diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index 09fb5b1223..a1daf3e524 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -268,7 +268,7 @@ IMPLEMENT_FUNCTION(8, Vassili, function8) getSavePoints()->push(kEntityVassili, kEntityAnna, kAction226031488); getSavePoints()->push(kEntityVassili, kEntityVerges, kAction226031488); getSavePoints()->push(kEntityVassili, kEntityCoudert, kAction226031488); - getSound()->playSound(kEntityVassili, "VAS1027", SoundManager::kFlagDefault); + getSound()->playSound(kEntityVassili, "VAS1027", kFlagDefault); break; } IMPLEMENT_FUNCTION_END @@ -300,7 +300,7 @@ IMPLEMENT_FUNCTION(9, Vassili, function9) setup_seizure(); } else { if (savepoint.action == kActionDefault) - getSound()->playSound(kEntityVassili, "VAS1028", SoundManager::kFlagDefault); + getSound()->playSound(kEntityVassili, "VAS1028", kFlagDefault); } break; } diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index bc35a105b1..c0a00b8c05 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -123,7 +123,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_NOSETUP(5, Verges, playSound16) - Entity::playSound(savepoint, false, SoundManager::kFlagDefault); + Entity::playSound(savepoint, false, kFlagDefault); IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// @@ -699,7 +699,7 @@ IMPLEMENT_FUNCTION(24, Verges, policeGettingOffTrain) break; case kActionDefault: - getSound()->playSound(kEntityVerges, "POL1101", SoundManager::kFlagDefault); + getSound()->playSound(kEntityVerges, "POL1101", kFlagDefault); break; case kActionCallback: diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 79ac934ef9..74bc0d3ea9 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -1083,7 +1083,7 @@ IMPLEMENT_FUNCTION(30, Vesna, function30) case kActionNone: if (!params->param1) { UPDATE_PARAM_PROC(params->param3, getState()->timeTicks, 120) - getSound()->playSound(kEntityVesna, "Ves50001", SoundManager::kFlagDefault); + getSound()->playSound(kEntityVesna, "Ves50001", kFlagDefault); params->param1 = 1; UPDATE_PARAM_PROC_END } @@ -1146,7 +1146,7 @@ IMPLEMENT_FUNCTION(30, Vesna, function30) setCallback(2); setup_savegame(kSavegameTypeEvent, kEventCathVesnaTrainTopKilled); } else { - getSound()->playSound(kEntityVesna, "Ves5001", SoundManager::kFlagDefault); + getSound()->playSound(kEntityVesna, "Ves5001", kFlagDefault); params->param1 = 1; } break; diff --git a/engines/lastexpress/fight/fighter_anna.cpp b/engines/lastexpress/fight/fighter_anna.cpp index db2ab54c4b..3c0132eef6 100644 --- a/engines/lastexpress/fight/fighter_anna.cpp +++ b/engines/lastexpress/fight/fighter_anna.cpp @@ -124,7 +124,7 @@ FighterOpponentAnna::FighterOpponentAnna(LastExpressEngine *engine) : Opponent(e _sequences.push_back(loadSequence("2002okml.seq")); _sequences.push_back(loadSequence("2002okm.seq")); - getSound()->playSound(kEntityTables0, "MUS030", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables0, "MUS030", kFlagDefault); _field_38 = 30; } diff --git a/engines/lastexpress/fight/fighter_ivo.cpp b/engines/lastexpress/fight/fighter_ivo.cpp index 423b6b4ce5..60d6c1a874 100644 --- a/engines/lastexpress/fight/fighter_ivo.cpp +++ b/engines/lastexpress/fight/fighter_ivo.cpp @@ -144,7 +144,7 @@ FighterOpponentIvo::FighterOpponentIvo(LastExpressEngine *engine) : Opponent(eng _sequences.push_back(loadSequence("csdr.seq")); _sequences.push_back(loadSequence("2003l.seq")); - getSound()->playSound(kEntityTables0, "MUS032", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables0, "MUS032", kFlagDefault); _countdown = 5; _field_38 = 15; diff --git a/engines/lastexpress/fight/fighter_milos.cpp b/engines/lastexpress/fight/fighter_milos.cpp index 46e4bde7a6..972c44882b 100644 --- a/engines/lastexpress/fight/fighter_milos.cpp +++ b/engines/lastexpress/fight/fighter_milos.cpp @@ -108,7 +108,7 @@ void FighterPlayerMilos::update() { _opponent->setSequenceAndDraw(6, kFightSequenceType1); getSound()->removeFromQueue(kEntityTables0); - getSound()->playSound(kEntityTrain, "MUS029", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTrain, "MUS029", kFlagDefault); handleAction(kFightActionWin); } @@ -148,7 +148,7 @@ FighterOpponentMilos::FighterOpponentMilos(LastExpressEngine *engine) : Opponent _sequences.push_back(loadSequence("2001dbk.seq")); _sequences.push_back(loadSequence("2001wbk.seq")); - getSound()->playSound(kEntityTables0, "MUS027", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables0, "MUS027", kFlagDefault); _field_38 = 35; } diff --git a/engines/lastexpress/fight/fighter_salko.cpp b/engines/lastexpress/fight/fighter_salko.cpp index 795dd41b93..6f71a6dda8 100644 --- a/engines/lastexpress/fight/fighter_salko.cpp +++ b/engines/lastexpress/fight/fighter_salko.cpp @@ -132,7 +132,7 @@ FighterOpponentSalko::FighterOpponentSalko(LastExpressEngine *engine) : Opponent _sequences.push_back(loadSequence("2004ohm.seq")); _sequences.push_back(loadSequence("blank.seq")); - getSound()->playSound(kEntityTables0, "MUS035", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables0, "MUS035", kFlagDefault); _countdown = 3; _field_38 = 30; diff --git a/engines/lastexpress/fight/fighter_vesna.cpp b/engines/lastexpress/fight/fighter_vesna.cpp index a2460106b0..c92d041c7e 100644 --- a/engines/lastexpress/fight/fighter_vesna.cpp +++ b/engines/lastexpress/fight/fighter_vesna.cpp @@ -150,7 +150,7 @@ FighterOpponentVesna::FighterOpponentVesna(LastExpressEngine *engine) : Opponent _sequences.push_back(loadSequence("2005csbm.seq")); _sequences.push_back(loadSequence("2005oam4.seq")); - getSound()->playSound(kEntityTables0, "MUS038", SoundManager::kFlagDefault); + getSound()->playSound(kEntityTables0, "MUS038", kFlagDefault); _countdown = 4; _field_38 = 30; diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 7540d18ed8..54bb8759ee 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -466,7 +466,7 @@ IMPLEMENT_ACTION(playMusic) Common::String filename = Common::String::format("MUS%03d", hotspot.param1); if (!getSound()->isBuffered(filename) && (hotspot.param1 != 50 || getProgress().chapter == kChapter5)) - getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault, hotspot.param2); + getSound()->playSound(kEntityPlayer, filename, kFlagDefault, hotspot.param2); return kSceneInvalid; } @@ -806,7 +806,7 @@ IMPLEMENT_ACTION(enterCompartment) getSound()->playSoundEvent(kEntityPlayer, 15, 22); if (getProgress().field_78 && !getSound()->isBuffered("MUS003")) { - getSound()->playSound(kEntityPlayer, "MUS003", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_78 = 0; } @@ -1084,7 +1084,7 @@ IMPLEMENT_ACTION(25) case 2: if (!getSound()->isBuffered("MUS021")) - getSound()->playSound(kEntityPlayer, "MUS021", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS021", kFlagDefault); break; case 3: @@ -1183,7 +1183,7 @@ IMPLEMENT_ACTION(29) Common::String filename = Common::String::format("MUS%03d", hotspot.param3); if (!getSound()->isBuffered(filename)) - getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, filename, kFlagDefault); return kSceneInvalid; } @@ -1345,7 +1345,7 @@ IMPLEMENT_ACTION(openBed) ////////////////////////////////////////////////////////////////////////// // Action 37 IMPLEMENT_ACTION(dialog) - getSound()->playDialog(kEntityTables4, (EntityIndex)hotspot.param1, SoundManager::kFlagDefault, 0); + getSound()->playDialog(kEntityTables4, (EntityIndex)hotspot.param1, kFlagDefault, 0); return kSceneInvalid; } @@ -1355,7 +1355,7 @@ IMPLEMENT_ACTION(dialog) IMPLEMENT_ACTION(eggBox) getSound()->playSoundEvent(kEntityPlayer, 43); if (getProgress().field_7C && !getSound()->isBuffered("MUS003")) { - getSound()->playSound(kEntityPlayer, "MUS003", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_7C = 0; } @@ -1367,7 +1367,7 @@ IMPLEMENT_ACTION(eggBox) IMPLEMENT_ACTION(39) getSound()->playSoundEvent(kEntityPlayer, 24); if (getProgress().field_80 && !getSound()->isBuffered("MUS003")) { - getSound()->playSound(kEntityPlayer, "MUS003", SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_80 = 0; } @@ -1409,7 +1409,7 @@ IMPLEMENT_ACTION(playMusicChapter) Common::String filename = Common::String::format("MUS%03d", id); if (!getSound()->isBuffered(filename)) - getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, filename, kFlagDefault); } return kSceneInvalid; @@ -1441,7 +1441,7 @@ IMPLEMENT_ACTION(playMusicChapterSetupTrain) Common::String filename = Common::String::format("MUS%03d", hotspot.param1); if (!getSound()->isBuffered(filename) && hotspot.param3 & id) { - getSound()->playSound(kEntityPlayer, filename, SoundManager::kFlagDefault); + getSound()->playSound(kEntityPlayer, filename, kFlagDefault); getSavePoints()->call(kEntityPlayer, kEntityTrain, kAction203863200, filename.c_str()); getSavePoints()->push(kEntityPlayer, kEntityTrain, kAction222746496, hotspot.param2); diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 513ad114b0..0fa3af36b7 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -299,7 +299,7 @@ void Entities::setupChapter(ChapterIndex chapter) { memset(&_compartments1, 0, sizeof(_compartments1)); memset(&_positions, 0, sizeof(_positions)); - getSound()->resetQueue(SoundManager::kSoundType13); + getSound()->resetQueue(kSoundType13); } // we skip the header when doing entity setup @@ -2355,7 +2355,7 @@ bool Entities::changeCar(EntityData::EntityCallData *data, EntityIndex entity, C if (data->car == newCar) { if (isInGreenCarEntrance(kEntityPlayer)) { getSound()->playSoundEvent(kEntityPlayer, 14); - getSound()->excuseMe(entity, kEntityPlayer, SoundManager::kFlagDefault); + getSound()->excuseMe(entity, kEntityPlayer, kFlagDefault); getScenes()->loadSceneFromPosition(kCarGreenSleeping, 1); getSound()->playSound(kEntityPlayer, "CAT1127A"); getSound()->playSoundEvent(kEntityPlayer, 15); @@ -2374,7 +2374,7 @@ bool Entities::changeCar(EntityData::EntityCallData *data, EntityIndex entity, C if (data->car == newCar) { if (isInKronosCarEntrance(kEntityPlayer)) { getSound()->playSoundEvent(kEntityPlayer, 14); - getSound()->excuseMe(entity, kEntityPlayer, SoundManager::kFlagDefault); + getSound()->excuseMe(entity, kEntityPlayer, kFlagDefault); getScenes()->loadSceneFromPosition(kCarGreenSleeping, 62); getSound()->playSound(kEntityPlayer, "CAT1127A"); getSound()->playSoundEvent(kEntityPlayer, 15); diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index 07ad8d936b..4d75fcaca5 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -156,7 +156,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { _portraitHighlighted = false; _isOpened = false; - getSound()->playSoundWithSubtitles("LIB039.SND", SoundManager::kFlagMenuClock, kEntityPlayer); + getSound()->playSoundWithSubtitles("LIB039.SND", kFlagMenuClock, kEntityPlayer); getMenu()->show(true, kSavegameTypeIndex, 0); diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index 3bd7d6da68..c1237eefe9 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -432,7 +432,7 @@ void Logic::gameOver(SavegameType type, uint32 value, SceneIndex sceneIndex, boo if (showScene) { - getSound()->processEntry(SoundManager::kSoundType11); + getSound()->processEntry(kSoundType11); if (sceneIndex && !getFlags()->mouseRightClick) { getScenes()->loadScene(sceneIndex); diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index e830b1d128..b346c9daf8 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -1132,7 +1132,7 @@ void SceneManager::postProcessScene() { } if (progress) - getSound()->excuseMe((progress == 1) ? entities[0] : entities[rnd(progress)], kEntityPlayer, SoundManager::kFlagDefault); + getSound()->excuseMe((progress == 1) ? entities[0] : entities[rnd(progress)], kEntityPlayer, kFlagDefault); } if (hotspot->scene) @@ -1157,8 +1157,8 @@ void SceneManager::postProcessScene() { if (getState()->time >= kTimeCityGalanta || getProgress().field_18 == 4) break; - getSound()->processEntry(SoundManager::kSoundType7); - getSound()->playSound(kEntityTrain, "LIB050", SoundManager::kFlagDefault); + getSound()->processEntry(kSoundType7); + getSound()->playSound(kEntityTrain, "LIB050", kFlagDefault); switch (getProgress().chapter) { default: diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 6cd5731e54..f8bee17d61 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/savepoint.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/entry.h" + #include "lastexpress/helpers.h" #include "lastexpress/graphics.h" #include "lastexpress/lastexpress.h" @@ -96,12 +98,21 @@ static const char *const locomotiveSounds[5] = { "ZFX1007B" }; -static const SoundManager::FlagType soundFlags[32] = { - SoundManager::kFlagDefault, SoundManager::kFlag15, SoundManager::kFlag14, SoundManager::kFlag13, SoundManager::kFlag12, - SoundManager::kFlag11, SoundManager::kFlag11, SoundManager::kFlag10, SoundManager::kFlag10, SoundManager::kFlag9, SoundManager::kFlag9, SoundManager::kFlag8, SoundManager::kFlag8, - SoundManager::kFlag7, SoundManager::kFlag7, SoundManager::kFlag7, SoundManager::kFlag6, SoundManager::kFlag6, SoundManager::kFlag6, - SoundManager::kFlag5, SoundManager::kFlag5, SoundManager::kFlag5, SoundManager::kFlag5, SoundManager::kFlag4, SoundManager::kFlag4, SoundManager::kFlag4, SoundManager::kFlag4, - SoundManager::kFlag3, SoundManager::kFlag3, SoundManager::kFlag3, SoundManager::kFlag3, SoundManager::kFlag3 +static const SoundFlag soundFlags[32] = { + kFlagDefault, + kFlag15, + kFlag14, + kFlag13, + kFlag12, + kFlag11, kFlag11, + kFlag10, kFlag10, + kFlag9, kFlag9, + kFlag8, kFlag8, + kFlag7, kFlag7, kFlag7, + kFlag6, kFlag6, kFlag6, + kFlag5, kFlag5, kFlag5, kFlag5, + kFlag4, kFlag4, kFlag4, kFlag4, + kFlag3, kFlag3, kFlag3, kFlag3, kFlag3 }; SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state(0), _currentType(kSoundType16), _flag(0) { @@ -179,7 +190,7 @@ void SoundManager::resetQueue(SoundType type1, SoundType type2) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type != type1 && (*i)->type != type2) - resetEntry(*i); + (*i)->reset(); } } @@ -188,7 +199,7 @@ void SoundManager::removeFromQueue(EntityIndex entity) { SoundEntry *entry = getEntry(entity); if (entry) - resetEntry(entry); + entry->reset(); } void SoundManager::removeFromQueue(Common::String filename) { @@ -196,7 +207,7 @@ void SoundManager::removeFromQueue(Common::String filename) { SoundEntry *entry = getEntry(filename); if (entry) - resetEntry(entry); + entry->reset(); } void SoundManager::clearQueue() { @@ -244,13 +255,13 @@ bool SoundManager::isBuffered(Common::String filename, bool testForEntity) { ////////////////////////////////////////////////////////////////////////// // Entry ////////////////////////////////////////////////////////////////////////// -void SoundManager::setupEntry(SoundEntry *entry, Common::String name, FlagType flag, int a4) { +void SoundManager::setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int a4) { if (!entry) error("SoundManager::setupEntry: Invalid entry!"); entry->field_4C = a4; setEntryType(entry, flag); - setEntryStatus(entry, flag); + entry->setStatus(flag); // Add entry to sound list _soundList.push_back(entry); @@ -260,7 +271,7 @@ void SoundManager::setupEntry(SoundEntry *entry, Common::String name, FlagType f loadSoundData(entry, name); } -void SoundManager::setEntryType(SoundEntry *entry, FlagType flag) { +void SoundManager::setEntryType(SoundEntry *entry, SoundFlag flag) { switch (flag & kFlagType9) { default: case kFlagNone: @@ -271,12 +282,12 @@ void SoundManager::setEntryType(SoundEntry *entry, FlagType flag) { case kFlagType1_2: { SoundEntry *previous2 = getEntry(kSoundType2); if (previous2) - updateEntry(previous2, 0); + previous2->update(0); SoundEntry *previous = getEntry(kSoundType1); if (previous) { previous->type = kSoundType2; - updateEntry(previous, 0); + previous->update(0); } entry->type = kSoundType1; @@ -287,7 +298,7 @@ void SoundManager::setEntryType(SoundEntry *entry, FlagType flag) { SoundEntry *previous = getEntry(kSoundType3); if (previous) { previous->type = kSoundType4; - updateEntry(previous, 0); + previous->update(0); } entry->type = kSoundType11; @@ -332,21 +343,6 @@ void SoundManager::setEntryType(SoundEntry *entry, FlagType flag) { } } -void SoundManager::setEntryStatus(SoundEntry *entry, FlagType flag) const { - SoundStatus status = (SoundStatus)flag; - if (!((status & 0xFF) & kSoundStatusClear1)) - status = (SoundStatus)(status | kSoundStatusClear2); - - if (((status & 0xFF00) >> 8) & kSoundStatusClear0) - entry->status.status = (uint32)status; - else - entry->status.status = (status | kSoundStatusClear4); -} - -void SoundManager::setInCache(SoundEntry *entry) { - entry->status.status |= kSoundStatusClear2; -} - bool SoundManager::setupCache(SoundEntry *entry) { if (entry->soundData) return true; @@ -370,8 +366,10 @@ bool SoundManager::setupCache(SoundEntry *entry) { if (entry->field_4C <= size) return false; - if (cacheEntry) - setInCache(cacheEntry); + if (!cacheEntry) + error("[SoundManager::setupCache] Cannot find a valid entry"); + + cacheEntry->setInCache(); // TODO: Wait until the cache entry is ready to be removed while (!(cacheEntry->status.status1 & 1)) @@ -425,23 +423,6 @@ void SoundManager::loadSoundData(SoundEntry *entry, Common::String name) { } } -void SoundManager::resetEntry(SoundEntry *entry) const { - entry->status.status |= kSoundStatusRemoved; - entry->entity = kEntityPlayer; - - if (entry->stream) { - if (!entry->soundStream) { - SAFE_DELETE(entry->stream); - } else { - entry->soundStream->stop(); - SAFE_DELETE(entry->soundStream); - } - - entry->stream = NULL; - } -} - - void SoundManager::removeEntry(SoundEntry *entry) { entry->status.status |= kSoundStatusRemoved; @@ -467,47 +448,12 @@ void SoundManager::removeEntry(SoundEntry *entry) { } } -void SoundManager::updateEntry(SoundEntry *entry, uint value) const { - if (!(entry->status.status3 & 64)) { - int value2 = value; - - entry->status.status |= kSoundStatus_100000; - - if (value) { - if (_flag & 32) { - entry->field_40 = value; - value2 = value * 2 + 1; - } - - entry->field_3C = value2; - } else { - entry->field_3C = 0; - entry->status.status |= kSoundStatus_40000000; - } - } -} - -void SoundManager::updateEntryState(SoundEntry *entry) const { - if (_flag & 32) { - if (entry->type != kSoundType9 && entry->type != kSoundType7 && entry->type != kSoundType5) { - uint32 status = entry->status.status & kSoundStatusClear1; - - entry->status.status &= kSoundStatusClearAll; - - entry->field_40 = status; - entry->status.status |= status * 2 + 1; - } - } - - entry->status.status |= kSoundStatus_20; -} - void SoundManager::processEntry(EntityIndex entity) { Common::StackLock locker(_mutex); SoundEntry *entry = getEntry(entity); if (entry) { - updateEntry(entry, 0); + entry->update(0); entry->entity = kEntityPlayer; } } @@ -517,7 +463,7 @@ void SoundManager::processEntry(SoundType type) { SoundEntry *entry = getEntry(type); if (entry) - updateEntry(entry, 0); + entry->update(0); } void SoundManager::setupEntry(SoundType type, EntityIndex index) { @@ -533,7 +479,7 @@ void SoundManager::processEntry(Common::String filename) { SoundEntry *entry = getEntry(filename); if (entry) { - updateEntry(entry, 0); + entry->update(0); entry->entity = kEntityPlayer; } } @@ -567,7 +513,7 @@ void SoundManager::unknownFunction4() { ////////////////////////////////////////////////////////////////////////// // Entry search ////////////////////////////////////////////////////////////////////////// -SoundManager::SoundEntry *SoundManager::getEntry(EntityIndex index) { +SoundEntry *SoundManager::getEntry(EntityIndex index) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->entity == index) return *i; @@ -576,7 +522,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(EntityIndex index) { return NULL; } -SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { +SoundEntry *SoundManager::getEntry(Common::String name) { if (!name.contains('.')) name += ".SND"; @@ -588,7 +534,7 @@ SoundManager::SoundEntry *SoundManager::getEntry(Common::String name) { return NULL; } -SoundManager::SoundEntry *SoundManager::getEntry(SoundType type) { +SoundEntry *SoundManager::getEntry(SoundType type) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { if ((*i)->type == type) return *i; @@ -663,11 +609,11 @@ uint32 SoundManager::count() { ////////////////////////////////////////////////////////////////////////// // Game-related functions ////////////////////////////////////////////////////////////////////////// -void SoundManager::playSound(EntityIndex entity, Common::String filename, FlagType flag, byte a4) { +void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundFlag flag, byte a4) { if (isBuffered(entity) && entity) removeFromQueue(entity); - FlagType currentFlag = (flag == -1) ? getSoundFlag(entity) : (FlagType)(flag | 0x80000); + SoundFlag currentFlag = (flag == -1) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000); // Add .SND at the end of the filename if needed if (!filename.contains('.')) @@ -678,8 +624,8 @@ void SoundManager::playSound(EntityIndex entity, Common::String filename, FlagTy getSavePoints()->push(kEntityPlayer, entity, kActionEndSound); } -bool SoundManager::playSoundWithSubtitles(Common::String filename, FlagType flag, EntityIndex entity, byte a4) { - SoundEntry *entry = new SoundEntry(); +bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4) { + SoundEntry *entry = new SoundEntry(_engine); Common::StackLock locker(_mutex); @@ -695,7 +641,7 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, FlagType flag filename.deleteLastChar(); showSubtitle(entry, filename); - updateEntryState(entry); + entry->updateState(); } return (entry->type != kSoundTypeNone); @@ -711,7 +657,7 @@ void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { return; int _action = (int)action; - FlagType flag = getSoundFlag(entity); + SoundFlag flag = getSoundFlag(entity); switch (action) { case 36: { @@ -886,7 +832,7 @@ void SoundManager::playFightSound(byte action, byte a4) { playSound(kEntityTrain, Common::String::format("LIB%03d.SND", _action), kFlagDefault, a4); } -void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, FlagType flag, byte a4) { +void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4) { if (isBuffered(getDialogName(entityDialog))) removeFromQueue(getDialogName(entityDialog)); @@ -894,7 +840,7 @@ void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, Flag } void SoundManager::playLocomotiveSound() { - playSound(kEntityPlayer, locomotiveSounds[rnd(5)], (FlagType)(rnd(15) + 2)); + playSound(kEntityPlayer, locomotiveSounds[rnd(5)], (SoundFlag)(rnd(15) + 2)); } const char *SoundManager::getDialogName(EntityIndex entity) const { @@ -1400,7 +1346,7 @@ void SoundManager::playWarningCompartment(EntityIndex entity, ObjectIndex compar _lastWarning[compartment - 28] = getState()->timeTicks; } -void SoundManager::excuseMe(EntityIndex entity, EntityIndex entity2, FlagType flag) { +void SoundManager::excuseMe(EntityIndex entity, EntityIndex entity2, SoundFlag flag) { if (isBuffered(entity) && entity != kEntityPlayer && entity != kEntityChapters && entity != kEntityTrain) return; @@ -1750,7 +1696,7 @@ const char *SoundManager::justAMinuteCath() const { ////////////////////////////////////////////////////////////////////////// // Sound flags ////////////////////////////////////////////////////////////////////////// -SoundManager::FlagType SoundManager::getSoundFlag(EntityIndex entity) const { +SoundFlag SoundManager::getSoundFlag(EntityIndex entity) const { if (entity == kEntityPlayer) return kFlagDefault; @@ -1758,7 +1704,7 @@ SoundManager::FlagType SoundManager::getSoundFlag(EntityIndex entity) const { return kFlagNone; // Compute sound value - FlagType ret = kFlag2; + SoundFlag ret = kFlag2; // Get default value if valid int index = ABS(getEntityData(entity)->entityPosition - getEntityData(kEntityPlayer)->entityPosition) / 230; @@ -1771,7 +1717,7 @@ SoundManager::FlagType SoundManager::getSoundFlag(EntityIndex entity) const { && !getEntities()->isOutsideAnnaWindow()) return kFlagNone; - return (FlagType)(ret / 6); + return (SoundFlag)(ret / 6); } switch (getEntityData(entity)->car) { @@ -1780,25 +1726,25 @@ SoundManager::FlagType SoundManager::getSoundFlag(EntityIndex entity) const { case kCarKronos: if (getEntities()->isInKronosSalon(entity) != getEntities()->isInKronosSalon(kEntityPlayer)) - ret = (FlagType)(ret * 2); + ret = (SoundFlag)(ret * 2); break; case kCarGreenSleeping: case kCarRedSleeping: if (getEntities()->isInGreenCarEntrance(kEntityPlayer) && !getEntities()->isInKronosSalon(entity)) - ret = (FlagType)(ret * 2); + ret = (SoundFlag)(ret * 2); if (getEntityData(kEntityPlayer)->location && (getEntityData(entity)->entityPosition != kPosition_1 || !getEntities()->isDistanceBetweenEntities(kEntityPlayer, entity, 400))) - ret = (FlagType)(ret * 2); + ret = (SoundFlag)(ret * 2); break; case kCarRestaurant: if (getEntities()->isInSalon(entity) == getEntities()->isInSalon(kEntityPlayer) && (getEntities()->isInRestaurant(entity) != getEntities()->isInRestaurant(kEntityPlayer))) - ret = (FlagType)(ret * 2); + ret = (SoundFlag)(ret * 2); else - ret = (FlagType)(ret * 4); + ret = (SoundFlag)(ret * 4); break; } @@ -1865,7 +1811,7 @@ void SoundManager::showSubtitle(SoundEntry *entry, Common::String filename) { } } -SoundManager::SubtitleEntry *SoundManager::loadSubtitle(Common::String filename, SoundEntry *soundEntry) { +SubtitleEntry *SoundManager::loadSubtitle(Common::String filename, SoundEntry *soundEntry) { SubtitleEntry *entry = new SubtitleEntry(); _subtitles.push_back(entry); @@ -1950,7 +1896,7 @@ void SoundManager::playLoopingSound(int param) { } byte numLoops[8]; - static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, + static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, kPosition_6470, kPosition_5790, kPosition_4840, kPosition_4070, kPosition_3050, kPosition_2740 }; @@ -2033,11 +1979,11 @@ void SoundManager::playLoopingSound(int param) { playSoundWithSubtitles(tmp, kFlagLoopedSound, kEntitySteam); if (*snd) - updateEntry(*snd, 0); + (*snd)->update(0); for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { if ((*snd)->type == kSoundType1) { - updateEntry((*snd), 7); + (*snd)->update(7); break; } } diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index f49f2bc9f0..a87bb9bb80 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -23,52 +23,6 @@ #ifndef LASTEXPRESS_SOUND_H #define LASTEXPRESS_SOUND_H -/* - - Sound entry: 68 bytes (this is what appears in the savegames) - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - entity - uint32 {4} - ?? - uint32 {4} - ?? - char {16} - name 1 - char {16} - name 2 - - Sound queue entry: 120 bytes - uint16 {2} - status - byte {1} - ?? - byte {1} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - file data pointer - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - archive structure pointer - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - entity - uint32 {4} - ?? - uint32 {4} - ?? - char {16} - name 1 - char {16} - name 2 - uint32 {4} - pointer to next entry in the queue - uint32 {4} - subtitle data pointer - -*/ - -#include "lastexpress/data/snd.h" -#include "lastexpress/data/subtitle.h" - #include "lastexpress/shared.h" #include "lastexpress/helpers.h" @@ -82,61 +36,11 @@ namespace LastExpress { class LastExpressEngine; class SubtitleManager; +class SoundEntry; +class SubtitleEntry; class SoundManager : Common::Serializable { public: - enum SoundType { - kSoundTypeNone = 0, - kSoundType1, - kSoundType2, - kSoundType3, - kSoundType4, - kSoundType5, - kSoundType6, - kSoundType7, - kSoundType8, - kSoundType9, - kSoundType10, - kSoundType11, - kSoundType12, - kSoundType13, - kSoundType14, - kSoundType15, - kSoundType16 - }; - - enum FlagType { - kFlagInvalid = -1, - kFlagNone = 0x0, - kFlag2 = 0x2, - kFlag3 = 0x3, - kFlag4 = 0x4, - kFlag5 = 0x5, - kFlag6 = 0x6, - kFlag7 = 0x7, - kFlag8 = 0x8, - kFlag9 = 0x9, - kFlag10 = 0xA, - kFlag11 = 0xB, - kFlag12 = 0xC, - kFlag13 = 0xD, - kFlag14 = 0xE, - kFlag15 = 0xF, - kFlagDefault = 0x10, - - kFlagType1_2 = 0x1000000, - kFlagLoopedSound = 0x1001001, - kFlagSteam = 0x1001007, - kFlagType13 = 0x3000000, - kFlagMenuClock = 0x3080010, - kFlagType7 = 0x4000000, - kFlagType11 = 0x5000000, - kFlagMusic = 0x5000010, - kFlagType3 = 0x6000000, - kFlagLoop = 0x6001008, - kFlagType9 = 0x7000000 - }; - SoundManager(LastExpressEngine *engine); ~SoundManager(); @@ -171,10 +75,10 @@ public: void clearStatus(); // Sound playing - void playSound(EntityIndex entity, Common::String filename, FlagType flag = kFlagInvalid, byte a4 = 0); - bool playSoundWithSubtitles(Common::String filename, FlagType flag, EntityIndex entity, byte a4 = 0); + void playSound(EntityIndex entity, Common::String filename, SoundFlag flag = kFlagInvalid, byte a4 = 0); + bool playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4 = 0); void playSoundEvent(EntityIndex entity, byte action, byte a3 = 0); - void playDialog(EntityIndex entity, EntityIndex entityDialog, FlagType flag, byte a4); + void playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4); void playSteam(CityIndex index); void playFightSound(byte action, byte a4); void playLocomotiveSound(); @@ -185,14 +89,14 @@ public: const char *getDialogName(EntityIndex entity) const; // Sound bites - void excuseMe(EntityIndex entity, EntityIndex entity2 = kEntityPlayer, FlagType flag = kFlagNone); + void excuseMe(EntityIndex entity, EntityIndex entity2 = kEntityPlayer, SoundFlag flag = kFlagNone); void excuseMeCath(); const char *justCheckingCath() const; const char *wrongDoorCath() const; const char *justAMinuteCath() const; // FLags - SoundManager::FlagType getSoundFlag(EntityIndex index) const; + SoundFlag getSoundFlag(EntityIndex index) const; // Debug void stopAllSound(); @@ -201,129 +105,18 @@ public: void saveLoadWithSerializer(Common::Serializer &ser); uint32 count(); + // Accessors + uint32 getFlag() { return _flag; } + private: typedef int32 *SoundBuffer; - enum SoundStatus { - kSoundStatus_20 = 0x20, - kSoundStatus_40 = 0x40, - kSoundStatus_180 = 0x180, - kSoundStatusRemoved = 0x200, - kSoundStatus_400 = 0x400, - - kSoundStatus_8000 = 0x8000, - kSoundStatus_20000 = 0x20000, - kSoundStatus_100000 = 0x100000, - kSoundStatus_40000000 = 0x40000000, - - kSoundStatusClear0 = 0x10, - kSoundStatusClear1 = 0x1F, - kSoundStatusClear2 = 0x80, - kSoundStatusClear3 = 0x200, - kSoundStatusClear4 = 0x800, - kSoundStatusClearAll = 0xFFFFFFE0 - }; - enum SoundState { kSoundState0 = 0, kSoundState1 = 1, kSoundState2 = 2 }; - union SoundStatusUnion { - uint32 status; - byte status1; - byte status2; - byte status3; - byte status4; - - SoundStatusUnion() { - status = 0; - } - }; - - struct SubtitleEntry; - - struct SoundEntry { - SoundStatusUnion status; - SoundType type; // int - //int data; - //int endOffset; - int currentDataPtr; - void *soundData; - //int currentBufferPtr; - int blockCount; - uint32 time; - //int size; - //int field_28; - Common::SeekableReadStream *stream; // int - //int field_30; - int field_34; - int field_38; - int field_3C; - int field_40; - EntityIndex entity; - int field_48; - uint32 field_4C; - Common::String name1; //char[16]; - Common::String name2; //char[16]; - //int next; // offset to the next structure in the list (not used) - SubtitleEntry *subtitle; - - // Sound stream - StreamedSound *soundStream; - - SoundEntry() { - status.status = 0; - type = kSoundTypeNone; - - currentDataPtr = 0; - soundData = NULL; - - blockCount = 0; - time = 0; - - stream = NULL; - - field_34 = 0; - field_38 = 0; - field_3C = 0; - field_40 = 0; - entity = kEntityPlayer; - field_48 = 0; - field_4C = 0; - - subtitle = NULL; - - soundStream = NULL; - } - - ~SoundEntry() { - // Entries that have been queued would have their streamed disposed automatically - if (!soundStream) - SAFE_DELETE(stream); - - delete soundStream; - } - }; - - struct SubtitleEntry { - Common::String filename; - SoundStatusUnion status; - SoundEntry *sound; - SubtitleManager *data; - - SubtitleEntry() { - status.status = 0; - sound = NULL; - data = NULL; - } - - ~SubtitleEntry() { - SAFE_DELETE(data); - } - }; - // Engine LastExpressEngine *_engine; @@ -337,6 +130,8 @@ private: uint32 _data0; uint32 _data1; uint32 _data2; + + // TODO: this seems to be a synchronization flag for the sound timer uint32 _flag; // Filters @@ -358,17 +153,11 @@ private: SoundEntry *getEntry(Common::String name); SoundEntry *getEntry(SoundType type); - void setupEntry(SoundEntry *entry, Common::String name, FlagType flag, int a4); - void setEntryType(SoundEntry *entry, FlagType flag); - void setEntryStatus(SoundEntry *entry, FlagType flag) const; - void setInCache(SoundEntry *entry); + void setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int a4); + void setEntryType(SoundEntry *entry, SoundFlag flag); bool setupCache(SoundEntry *entry); void removeFromCache(SoundEntry *entry); void loadSoundData(SoundEntry *entry, Common::String name); - - void updateEntry(SoundEntry *entry, uint value) const; - void updateEntryState(SoundEntry *entry) const; - void resetEntry(SoundEntry *entry) const; void removeEntry(SoundEntry *entry); // Subtitles diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index e55a6d5960..74a2c77a01 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -314,7 +314,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { getFlags()->mouseRightClick = false; // Play intro music - getSound()->playSoundWithSubtitles("MUS001.SND", SoundManager::kFlagMusic, kEntityPlayer); + getSound()->playSoundWithSubtitles("MUS001.SND", kFlagMusic, kEntityPlayer); // Show The Smoking Car logo if (animation.load(getArchive("1931.nis"))) @@ -325,7 +325,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { } else { // Only show the quick intro if (!_hasShownStartScreen) { - getSound()->playSoundWithSubtitles("MUS018.SND", SoundManager::kFlagMusic, kEntityPlayer); + getSound()->playSoundWithSubtitles("MUS018.SND", kFlagMusic, kEntityPlayer); getScenes()->loadScene(kSceneStartScreen); // Original game waits 60 frames and loops Sound::unknownFunction1 unless the right button is pressed @@ -349,7 +349,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { // Setup sound getSound()->unknownFunction4(); - getSound()->resetQueue(SoundManager::kSoundType11, SoundManager::kSoundType13); + getSound()->resetQueue(kSoundType11, kSoundType13); if (getSound()->isBuffered("TIMER")) getSound()->removeFromQueue("TIMER"); @@ -484,7 +484,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { setLogicEventHandlers(); if (_index) { - getSound()->processEntry(SoundManager::kSoundType11); + getSound()->processEntry(kSoundType11); } else { if (!getFlags()->mouseRightClick) { getScenes()->loadScene((SceneIndex)(5 * _gameId + 3)); @@ -496,7 +496,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { getScenes()->loadScene((SceneIndex)(5 * _gameId + 5)); if (!getFlags()->mouseRightClick) { - getSound()->processEntry(SoundManager::kSoundType11); + getSound()->processEntry(kSoundType11); // Show intro Animation animation; @@ -512,7 +512,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { if (!getEvent(kEventIntro)) { getEvent(kEventIntro) = 1; - getSound()->processEntry(SoundManager::kSoundType11); + getSound()->processEntry(kSoundType11); } } @@ -1120,7 +1120,7 @@ void Menu::updateTime(uint32 time) { if (getSound()->isBuffered(kEntityChapters)) getSound()->removeFromQueue(kEntityChapters); - getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", SoundManager::kFlagMenuClock, kEntityChapters); + getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", kFlagMenuClock, kEntityChapters); adjustIndex(_currentTime, _time, false); } } diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index 71d81da0c9..eff68efb73 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -66,6 +66,7 @@ MODULE_OBJS := \ menu/clock.o \ menu/menu.o \ menu/trainline.o \ + sound/entry.o \ debug.o \ detection.o \ graphics.o \ diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h index 8cebe16d87..d1730eefce 100644 --- a/engines/lastexpress/shared.h +++ b/engines/lastexpress/shared.h @@ -27,6 +27,62 @@ namespace LastExpress { +////////////////////////////////////////////////////////////////////////// +// Sound +////////////////////////////////////////////////////////////////////////// + +enum SoundType { + kSoundTypeNone = 0, + kSoundType1, + kSoundType2, + kSoundType3, + kSoundType4, + kSoundType5, + kSoundType6, + kSoundType7, + kSoundType8, + kSoundType9, + kSoundType10, + kSoundType11, + kSoundType12, + kSoundType13, + kSoundType14, + kSoundType15, + kSoundType16 +}; + +enum SoundFlag { + kFlagInvalid = -1, + kFlagNone = 0x0, + kFlag2 = 0x2, + kFlag3 = 0x3, + kFlag4 = 0x4, + kFlag5 = 0x5, + kFlag6 = 0x6, + kFlag7 = 0x7, + kFlag8 = 0x8, + kFlag9 = 0x9, + kFlag10 = 0xA, + kFlag11 = 0xB, + kFlag12 = 0xC, + kFlag13 = 0xD, + kFlag14 = 0xE, + kFlag15 = 0xF, + kFlagDefault = 0x10, + + kFlagType1_2 = 0x1000000, + kFlagLoopedSound = 0x1001001, + kFlagSteam = 0x1001007, + kFlagType13 = 0x3000000, + kFlagMenuClock = 0x3080010, + kFlagType7 = 0x4000000, + kFlagType11 = 0x5000000, + kFlagMusic = 0x5000010, + kFlagType3 = 0x6000000, + kFlagLoop = 0x6001008, + kFlagType9 = 0x7000000 +}; + ////////////////////////////////////////////////////////////////////////// // Time values ////////////////////////////////////////////////////////////////////////// diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp new file mode 100644 index 0000000000..309996886a --- /dev/null +++ b/engines/lastexpress/sound/entry.cpp @@ -0,0 +1,151 @@ +/* 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 "lastexpress/sound/entry.h" + +#include "lastexpress/game/sound.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" + +#include "common/stream.h" + +namespace LastExpress { + +////////////////////////////////////////////////////////////////////////// +// SoundEntry +////////////////////////////////////////////////////////////////////////// +SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) { + status.status = 0; + type = kSoundTypeNone; + + currentDataPtr = 0; + soundData = NULL; + + blockCount = 0; + time = 0; + + stream = NULL; + + field_34 = 0; + field_38 = 0; + field_3C = 0; + field_40 = 0; + entity = kEntityPlayer; + field_48 = 0; + field_4C = 0; + + subtitle = NULL; + + soundStream = NULL; +} + +SoundEntry::~SoundEntry() { + // Entries that have been queued would have their streamed disposed automatically + if (!soundStream) + SAFE_DELETE(stream); + + delete soundStream; + + _engine = NULL; +} + +void SoundEntry::setStatus(SoundFlag flag) { + SoundStatus statusFlag = (SoundStatus)flag; + if (!((statusFlag & 0xFF) & kSoundStatusClear1)) + statusFlag = (SoundStatus)(statusFlag | kSoundStatusClear2); + + if (((statusFlag & 0xFF00) >> 8) & kSoundStatusClear0) + status.status = (uint32)statusFlag; + else + status.status = (statusFlag | kSoundStatusClear4); +} + +void SoundEntry::setInCache() { + status.status |= kSoundStatusClear2; +} + +void SoundEntry::update(uint val) { + if (!(status.status3 & 64)) { + int value2 = val; + + status.status |= kSoundStatus_100000; + + if (val) { + if (getSound()->getFlag() & 32) { + field_40 = val; + value2 = val * 2 + 1; + } + + field_3C = value2; + } else { + field_3C = 0; + status.status |= kSoundStatus_40000000; + } + } +} + +void SoundEntry::updateState() { + if (getSound()->getFlag() & 32) { + if (type != kSoundType9 && type != kSoundType7 && type != kSoundType5) { + uint32 newStatus = status.status & kSoundStatusClear1; + + status.status &= kSoundStatusClearAll; + + field_40 = newStatus; + status.status |= newStatus * 2 + 1; + } + } + + status.status |= kSoundStatus_20; +} + +void SoundEntry::reset() { + status.status |= kSoundStatusRemoved; + entity = kEntityPlayer; + + if (stream) { + if (!soundStream) { + SAFE_DELETE(stream); + } else { + soundStream->stop(); + SAFE_DELETE(soundStream); + } + + stream = NULL; + } +} + +////////////////////////////////////////////////////////////////////////// +// SubtitleEntry +////////////////////////////////////////////////////////////////////////// +SubtitleEntry::SubtitleEntry() { + status.status = 0; + sound = NULL; + data = NULL; +} + +SubtitleEntry::~SubtitleEntry() { + SAFE_DELETE(data); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h new file mode 100644 index 0000000000..9ed091b225 --- /dev/null +++ b/engines/lastexpress/sound/entry.h @@ -0,0 +1,173 @@ +/* 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 LASTEXPRESS_SOUND_ENTRY_H +#define LASTEXPRESS_SOUND_ENTRY_H + +/* + Sound entry: 68 bytes (this is what appears in the savegames) + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - entity + uint32 {4} - ?? + uint32 {4} - ?? + char {16} - name 1 + char {16} - name 2 + + Sound queue entry: 120 bytes + uint16 {2} - status + byte {1} - ?? + byte {1} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - file data pointer + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - archive structure pointer + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - ?? + uint32 {4} - entity + uint32 {4} - ?? + uint32 {4} - ?? + char {16} - name 1 + char {16} - name 2 + uint32 {4} - pointer to next entry in the queue + uint32 {4} - subtitle data pointer +*/ + +#include "lastexpress/data/snd.h" +#include "lastexpress/data/subtitle.h" + +#include "lastexpress/shared.h" + +namespace LastExpress { + +class LastExpressEngine; +class SubtitleEntry; + +enum SoundStatus { + kSoundStatus_20 = 0x20, + kSoundStatus_40 = 0x40, + kSoundStatus_180 = 0x180, + kSoundStatusRemoved = 0x200, + kSoundStatus_400 = 0x400, + + kSoundStatus_8000 = 0x8000, + kSoundStatus_20000 = 0x20000, + kSoundStatus_100000 = 0x100000, + kSoundStatus_40000000 = 0x40000000, + + kSoundStatusClear0 = 0x10, + kSoundStatusClear1 = 0x1F, + kSoundStatusClear2 = 0x80, + kSoundStatusClear3 = 0x200, + kSoundStatusClear4 = 0x800, + kSoundStatusClearAll = 0xFFFFFFE0 +}; + +union SoundStatusUnion { + uint32 status; + byte status1; + byte status2; + byte status3; + byte status4; + + SoundStatusUnion() { + status = 0; + } +}; + +////////////////////////////////////////////////////////////////////////// +// SoundEntry +////////////////////////////////////////////////////////////////////////// +class SoundEntry { +public: + SoundEntry(LastExpressEngine *engine); + ~SoundEntry(); + + void setStatus(SoundFlag flag); + void setInCache(); + void update(uint val); + void updateState(); + void reset(); + +private: + LastExpressEngine *_engine; + +public: + SoundStatusUnion status; + SoundType type; // int + //int data; + //int endOffset; + int currentDataPtr; + void *soundData; + //int currentBufferPtr; + int blockCount; + uint32 time; + //int size; + //int field_28; + Common::SeekableReadStream *stream; // int + //int field_30; + int field_34; + int field_38; + int field_3C; + int field_40; + EntityIndex entity; + int field_48; + uint32 field_4C; + Common::String name1; //char[16]; + Common::String name2; //char[16]; + //int next; // offset to the next structure in the list (not used) + SubtitleEntry *subtitle; + + // Sound stream + StreamedSound *soundStream; +}; + +////////////////////////////////////////////////////////////////////////// +// SubtitleEntry +////////////////////////////////////////////////////////////////////////// +class SubtitleEntry { +public: + SubtitleEntry(); + ~SubtitleEntry(); + +public: + Common::String filename; + SoundStatusUnion status; + SoundEntry *sound; + SubtitleManager *data; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_SOUND_ENTRY_H -- cgit v1.2.3 From 3f4d2c8130ac1db51f9a2fc5fcb5a2413b215f45 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 24 Jun 2011 11:43:10 -0400 Subject: LASTEXPRESS: Move subtitle-related methods to the SubtitleEntry class --- engines/lastexpress/game/sound.cpp | 103 ++++-------------------------------- engines/lastexpress/game/sound.h | 16 +++--- engines/lastexpress/sound/entry.cpp | 91 ++++++++++++++++++++++++++++--- engines/lastexpress/sound/entry.h | 27 +++++++--- 4 files changed, 125 insertions(+), 112 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index f8bee17d61..adb82816f5 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -127,7 +127,7 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( // Sound cache _soundCacheData = malloc(6 * SOUNDCACHE_ENTRY_SIZE); - _drawSubtitles = 0; + _subtitlesFlag = 0; _currentSubtitle = NULL; _loopingSoundDuration = 0; @@ -436,7 +436,7 @@ void SoundManager::removeEntry(SoundEntry *entry) { // removeFromCache(entry); if (entry->subtitle) { - drawSubtitle(entry->subtitle); + entry->subtitle->draw(); SAFE_DELETE(entry->subtitle); } @@ -640,7 +640,7 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag fla while (filename.size() > 4) filename.deleteLastChar(); - showSubtitle(entry, filename); + entry->showSubtitle(filename); entry->updateState(); } @@ -785,7 +785,7 @@ void SoundManager::playSteam(CityIndex index) { // Get the new sound entry and show subtitles SoundEntry *entry = getEntry(kSoundType1); if (entry) - showSubtitle(entry, cities[index]); + entry->showSubtitle(cities[index]); } void SoundManager::playFightSound(byte action, byte a4) { @@ -1762,7 +1762,7 @@ void SoundManager::updateSubtitles() { for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { uint32 current_index = 0; - SoundEntry *soundEntry = (*i)->sound; + SoundEntry *soundEntry = (*i)->getSoundEntry(); SoundStatus status = (SoundStatus)soundEntry->status.status; if (!(status & kSoundStatus_40) @@ -1786,103 +1786,20 @@ void SoundManager::updateSubtitles() { if (_currentSubtitle == subtitle) { if (subtitle) - setupSubtitleAndDraw(subtitle); + subtitle->setupAndDraw(); return; } - if (_drawSubtitles & 1) - drawSubtitleOnScreen(subtitle); + if (_subtitlesFlag & 1) + subtitle->drawOnScreen(); if (subtitle) { - loadSubtitleData(subtitle); - setupSubtitleAndDraw(subtitle); + subtitle->loadData(); + subtitle->setupAndDraw(); } } -void SoundManager::showSubtitle(SoundEntry *entry, Common::String filename) { - entry->subtitle = loadSubtitle(filename, entry); - - if (entry->subtitle->status.status2 & 4) { - drawSubtitle(entry->subtitle); - SAFE_DELETE(entry->subtitle); - } else { - entry->status.status |= kSoundStatus_20000; - } -} - -SubtitleEntry *SoundManager::loadSubtitle(Common::String filename, SoundEntry *soundEntry) { - SubtitleEntry *entry = new SubtitleEntry(); - _subtitles.push_back(entry); - - // Set sound entry and filename - entry->filename = filename + ".SBE"; - entry->sound = soundEntry; - - // Load subtitle data - if (_engine->getResourceManager()->hasFile(filename)) { - if (_drawSubtitles & 2) - return entry; - - loadSubtitleData(entry); - } else { - entry->status.status = kSoundStatus_400; - } - - return entry; -} - -void SoundManager::loadSubtitleData(SubtitleEntry * entry) { - entry->data = new SubtitleManager(_engine->getFont()); - entry->data->load(getArchive(entry->filename)); - - _drawSubtitles |= 2; - _currentSubtitle = entry; -} - -void SoundManager::setupSubtitleAndDraw(SubtitleEntry *subtitle) { - if (!subtitle->data) { - subtitle->data = new SubtitleManager(_engine->getFont()); - subtitle->data->load(getArchive(subtitle->filename)); - } - - if (subtitle->data->getMaxTime() > subtitle->sound->time) { - subtitle->status.status = kSoundStatus_400; - } else { - subtitle->data->setTime((uint16)subtitle->sound->time); - - if (_drawSubtitles & 1) - drawSubtitleOnScreen(subtitle); - } - - _currentSubtitle = subtitle; -} - -void SoundManager::drawSubtitle(SubtitleEntry *subtitle) { - // Remove subtitle from queue - _subtitles.remove(subtitle); - - if (subtitle == _currentSubtitle) { - drawSubtitleOnScreen(subtitle); - - _currentSubtitle = NULL; - _drawSubtitles = 0; - } -} - -void SoundManager::drawSubtitleOnScreen(SubtitleEntry *subtitle) { - if (!subtitle) - error("SoundManager::drawSubtitleOnScreen: Invalid subtitle entry!"); - - _drawSubtitles &= ~1; - - if (subtitle->data == NULL) - return; - - if (_drawSubtitles & 1) - _engine->getGraphicsManager()->draw(subtitle->data, GraphicsManager::kBackgroundOverlay); -} - ////////////////////////////////////////////////////////////////////////// // Misc ////////////////////////////////////////////////////////////////////////// diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index a87bb9bb80..b2a1b4387b 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -107,6 +107,14 @@ public: // Accessors uint32 getFlag() { return _flag; } + int getSubtitleFlag() { return _subtitlesFlag; } + void setSubtitleFlag(int flag) { _subtitlesFlag = flag; } + + // Subtitles + void addSubtitle(SubtitleEntry *entry) { _subtitles.push_back(entry); } + void removeSubtitle(SubtitleEntry *entry) { _subtitles.remove(entry); } + void setCurrentSubtitle(SubtitleEntry *entry) { _currentSubtitle = entry; } + SubtitleEntry *getCurrentSubtitle() { return _currentSubtitle; } private: typedef int32 *SoundBuffer; @@ -161,15 +169,9 @@ private: void removeEntry(SoundEntry *entry); // Subtitles - int _drawSubtitles; + int _subtitlesFlag; Common::List _subtitles; SubtitleEntry *_currentSubtitle; - void showSubtitle(SoundEntry *entry, Common::String filename); - SubtitleEntry *loadSubtitle(Common::String filename, SoundEntry *soundEntry); - void loadSubtitleData(SubtitleEntry * entry); - void setupSubtitleAndDraw(SubtitleEntry *subtitle); - void drawSubtitle(SubtitleEntry *subtitle); - void drawSubtitleOnScreen(SubtitleEntry *subtitle); // Sound filter void applyFilter(SoundEntry *entry, int16 *buffer); diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 309996886a..848e728ba4 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -24,8 +24,10 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" #include "common/stream.h" @@ -35,7 +37,6 @@ namespace LastExpress { // SoundEntry ////////////////////////////////////////////////////////////////////////// SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) { - status.status = 0; type = kSoundTypeNone; currentDataPtr = 0; @@ -135,17 +136,95 @@ void SoundEntry::reset() { } } +void SoundEntry::showSubtitle(Common::String filename) { + subtitle = new SubtitleEntry(_engine); + subtitle->load(filename, this); + + if (subtitle->getStatus().status2 & 4) { + subtitle->draw(); + SAFE_DELETE(subtitle); + } else { + status.status |= kSoundStatus_20000; + } +} + ////////////////////////////////////////////////////////////////////////// // SubtitleEntry ////////////////////////////////////////////////////////////////////////// -SubtitleEntry::SubtitleEntry() { - status.status = 0; - sound = NULL; - data = NULL; +SubtitleEntry::SubtitleEntry(LastExpressEngine *engine) : _engine(engine) { + _sound = NULL; + _data = NULL; } SubtitleEntry::~SubtitleEntry() { - SAFE_DELETE(data); + SAFE_DELETE(_data); +} + +void SubtitleEntry::load(Common::String filename, SoundEntry *soundEntry) { + // Add ourselves to the list of active subtitles + getSound()->addSubtitle(this); + + // Set sound entry and filename + _filename = filename + ".SBE"; + _sound = soundEntry; + + // Load subtitle data + if (_engine->getResourceManager()->hasFile(filename)) { + if (getSound()->getSubtitleFlag() & 2) + return; + + loadData(); + } else { + _status.status = kSoundStatus_400; + } +} + +void SubtitleEntry::loadData() { + _data = new SubtitleManager(_engine->getFont()); + _data->load(getArchive(_filename)); + + getSound()->setSubtitleFlag(getSound()->getSubtitleFlag() | 2); + getSound()->setCurrentSubtitle(this); +} + +void SubtitleEntry::setupAndDraw() { + if (!_data) { + _data = new SubtitleManager(_engine->getFont()); + _data->load(getArchive(_filename)); + } + + if (_data->getMaxTime() > _sound->time) { + _status.status = kSoundStatus_400; + } else { + _data->setTime((uint16)_sound->time); + + if (getSound()->getSubtitleFlag() & 1) + drawOnScreen(); + } + + getSound()->setCurrentSubtitle(this); +} + +void SubtitleEntry::draw() { + // Remove ourselves from the queue + getSound()->removeSubtitle(this); + + if (this == getSound()->getCurrentSubtitle()) { + drawOnScreen(); + + getSound()->setCurrentSubtitle(NULL); + getSound()->setSubtitleFlag(0); + } +} + +void SubtitleEntry::drawOnScreen() { + getSound()->setSubtitleFlag(getSound()->getSubtitleFlag() & -1); + + if (_data == NULL) + return; + + if (getSound()->getSubtitleFlag() & 1) + _engine->getGraphicsManager()->draw(_data, GraphicsManager::kBackgroundOverlay); } } // End of namespace LastExpress diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h index 9ed091b225..5671e0e74b 100644 --- a/engines/lastexpress/sound/entry.h +++ b/engines/lastexpress/sound/entry.h @@ -120,6 +120,9 @@ public: void updateState(); void reset(); + // Subtitles + void showSubtitle(Common::String filename); + private: LastExpressEngine *_engine; @@ -158,14 +161,26 @@ public: ////////////////////////////////////////////////////////////////////////// class SubtitleEntry { public: - SubtitleEntry(); + SubtitleEntry(LastExpressEngine *engine); ~SubtitleEntry(); -public: - Common::String filename; - SoundStatusUnion status; - SoundEntry *sound; - SubtitleManager *data; + void load(Common::String filename, SoundEntry *soundEntry); + void loadData(); + void draw(); + void setupAndDraw(); + void drawOnScreen(); + + // Accessors + SoundStatusUnion getStatus() { return _status; } + SoundEntry *getSoundEntry() { return _sound; } + +private: + LastExpressEngine *_engine; + + Common::String _filename; + SoundStatusUnion _status; + SoundEntry *_sound; + SubtitleManager *_data; }; } // End of namespace LastExpress -- cgit v1.2.3 From 1b6453dff4dde1e293b62f7fb4ade02507fd31bb Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 24 Jun 2011 19:07:03 +0200 Subject: BASE: Mess with strtol error handling some more. WinCE's strtol can't actually do proper error handling because it is lacking errno, so just check the bounds instead. If you really have some need to pass LONG_MIN/LONG_MAX as command-line parameters then it could always be #ifdeffed, but I'm assuming no-one cares. --- base/commandLine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 543511696f..1cd3643f5a 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -25,7 +25,7 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_exit -#include +#include #include "engines/metaengine.h" #include "base/commandLine.h" @@ -266,12 +266,12 @@ void registerDefaults() { if (!option) usage("Option '%s' requires an argument", argv[isLongCmd ? i : i-1]); // Use this for options which have a required integer value +// (we don't check ERANGE because WinCE doesn't support errno, so we're stuck just rejecting LONG_MAX/LONG_MIN..) #define DO_OPTION_INT(shortCmd, longCmd) \ DO_OPTION(shortCmd, longCmd) \ char *endptr; \ - errno = 0; \ - strtol(option, &endptr, 0); \ - if (*endptr != '\0' || errno == ERANGE) \ + long int retval = strtol(option, &endptr, 0); \ + if (*endptr != '\0' || retval == LONG_MAX || retval == LONG_MIN) \ usage("--%s: Invalid number '%s'", longCmd, option); // Use this for boolean options; this distinguishes between "-x" and "-X", -- cgit v1.2.3 From d7a5ba3b2f9fa6b17e5a6abfbbbc3960f8c7d9b1 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 24 Jun 2011 21:01:04 +0200 Subject: MOHAWK: Allow matching LBValue items by their name. --- engines/mohawk/livingbooks_code.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 165ca4a328..5ae0e22560 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -32,6 +32,10 @@ bool LBValue::operator==(const LBValue &x) const { if (type != x.type) { if (isNumeric() && x.isNumeric()) return toDouble() == x.toDouble(); + else if (type == kLBValueString && x.type == kLBValueItemPtr) + return string == x.item->getName(); + else if (type == kLBValueItemPtr && x.type == kLBValueString) + return item->getName() == x.string; else return false; } -- cgit v1.2.3 From 685934ee4aea2b46b117f6c9351d500484b9ec6a Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 24 Jun 2011 21:01:56 +0200 Subject: MOHAWK: Partial support for newer LB targeting types. --- engines/mohawk/livingbooks.cpp | 79 ++++++++++++++++++++++++++++++++++-------- engines/mohawk/livingbooks.h | 9 +++++ 2 files changed, 73 insertions(+), 15 deletions(-) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 375806cda4..c1c1dfc875 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -1999,30 +1999,36 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Seeka entry->argc = stream->readUint16(); size -= 2; + entry->targetingType = 0; + uint16 targetingType = entry->argc; - if (targetingType == 0x3f3f || targetingType == 0xffff) { - entry->argc = 0; + if (targetingType == kTargetTypeExpression || targetingType == kTargetTypeCode + || targetingType == kTargetTypeName) { + entry->targetingType = targetingType; + + // FIXME + if (targetingType == kTargetTypeCode) + error("encountered kTargetTypeCode"); uint16 count = stream->readUint16(); size -= 2; debug(4, "%d targets with targeting type %04x", count, targetingType); - // FIXME: targeting by name uint oldAlign = size % 2; for (uint i = 0; i < count; i++) { Common::String target = _vm->readString(stream); - warning("ignoring target '%s' in script entry", target.c_str()); + debug(4, "target '%s'", target.c_str()); + entry->targets.push_back(target); size -= target.size() + 1; } + entry->argc = entry->targets.size(); if ((uint)(size % 2) != oldAlign) { stream->skip(1); size--; } - } - - if (entry->argc) { + } else if (entry->argc) { entry->argvParam = new uint16[entry->argc]; entry->argvTarget = new uint16[entry->argc]; debug(4, "With %d targets:", entry->argc); @@ -2612,15 +2618,58 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { entry->type, entry->event, entry->opcode, entry->param); if (entry->argc) { - uint16 targetId = entry->argvTarget[n]; - // TODO: is this type, perhaps? - uint16 param = entry->argvParam[n]; - target = _vm->getItemById(targetId); - if (!target) { - debug(2, "Target %04x (%04x) doesn't exist, skipping", targetId, param); - continue; + switch (entry->targetingType) { + case kTargetTypeExpression: + { + // FIXME: this should be EVALUATED + LBValue &tgt = _vm->_variables[entry->targets[n]]; + switch (tgt.type) { + case kLBValueItemPtr: + target = tgt.item; + break; + case kLBValueString: + // FIXME: handle 'self', at least + // TODO: correct otherwise? or only self? + target = _vm->getItemByName(tgt.string); + break; + case kLBValueInteger: + target = _vm->getItemById(tgt.integer); + break; + default: + // FIXME: handle list + debug(2, "Target '%s' (by expression) resulted in unknown type, skipping", entry->targets[n].c_str()); + } + } + if (!target) { + debug(2, "Target '%s' (by expression) doesn't exist, skipping", entry->targets[n].c_str()); + continue; + } + debug(2, "Target: '%s' (expression '%s')", target->_desc.c_str(), entry->targets[n].c_str()); + break; + case kTargetTypeCode: + // FIXME + error("encountered kTargetTypeCode"); + break; + case kTargetTypeName: + // FIXME: handle 'self' + target = _vm->getItemByName(entry->targets[n]); + if (!target) { + debug(2, "Target '%s' (by name) doesn't exist, skipping", entry->targets[n].c_str()); + continue; + } + debug(2, "Target: '%s' (by name)", target->_desc.c_str()); + break; + default: + uint16 targetId = entry->argvTarget[n]; + // TODO: is this type, perhaps? + uint16 param = entry->argvParam[n]; + target = _vm->getItemById(targetId); + if (!target) { + debug(2, "Target %04x (%04x) doesn't exist, skipping", targetId, param); + continue; + } + debug(2, "Target: %04x (%04x) '%s'", targetId, param, target->_desc.c_str()); } - debug(2, "Target: %04x (%04x) '%s'", targetId, param, target->_desc.c_str()); } else { target = this; debug(2, "Self-target on '%s'", _desc.c_str()); diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 56107ad97b..02fe34e8c2 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -233,6 +233,12 @@ enum { kLBNotifyQuit = 0xd }; +enum { + kTargetTypeExpression = 0x3f3f, + kTargetTypeCode = 0xfffe, + kTargetTypeName = 0xffff +}; + class MohawkEngine_LivingBooks; class LBPage; class LBGraphics; @@ -253,6 +259,9 @@ struct LBScriptEntry { uint16 *argvParam; uint16 *argvTarget; + uint16 targetingType; + Common::Array targets; + // kLBNotifyChangeMode uint16 newUnknown; uint16 newMode; -- cgit v1.2.3 From 2b03a3a0e6569cd4a6b940304a4582860a97789f Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 24 Jun 2011 21:10:49 +0200 Subject: MOHAWK: Handle ++/-- operators in LBCode. --- engines/mohawk/livingbooks_code.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 5ae0e22560..8791fc4330 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -441,6 +441,33 @@ void LBCode::parseMain() { } break; + case kTokenPlusPlus: + case kTokenMinusMinus: + { + byte token = _currToken; + if (token == kTokenPlusPlus) + debugN("++"); + else + debugN("--"); + nextToken(); + + if (_currToken != kTokenIdentifier) + error("expected identifier"); + assert(_currValue.type == kLBValueString); + Common::String varname = _currValue.string; + debugN("%s", varname.c_str()); + LBValue &val = _vm->_variables[varname]; + + // FIXME: pre/postincrement for non-integers + if (token == kTokenPlusPlus) + val.integer++; + else + val.integer--; + _stack.push(val); + nextToken(); + } + break; + case kTokenLiteral: case kTokenConstMode: case kTokenConstEventId: -- cgit v1.2.3 From b35f4d31a64588a4a1f99e38df16bffc0abaf0b2 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Fri, 24 Jun 2011 20:20:32 +0100 Subject: COMMON: Look for translations.dat in Theme path before using SearchMan --- common/translation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/translation.cpp b/common/translation.cpp index 59488c2dd5..e456f733fd 100644 --- a/common/translation.cpp +++ b/common/translation.cpp @@ -223,7 +223,11 @@ String TranslationManager::getLangById(int id) const { } bool TranslationManager::openTranslationsFile(File& inFile) { - // First try to open it using the SearchMan. + // First look in the Themepath if we can find the file. + if (ConfMan.hasKey("themepath") && openTranslationsFile(FSNode(ConfMan.get("themepath")), inFile)) + return true; + + // Then try to open it using the SearchMan. ArchiveMemberList fileList; SearchMan.listMatchingMembers(fileList, "translations.dat"); for (ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) { @@ -235,10 +239,6 @@ bool TranslationManager::openTranslationsFile(File& inFile) { } } - // Then look in the Themepath if we can find the file. - if (ConfMan.hasKey("themepath")) - return openTranslationsFile(FSNode(ConfMan.get("themepath")), inFile); - return false; } -- cgit v1.2.3 From 10ff50b9702f25bc43e7c32c7dd380b84f1bf9e3 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 24 Jun 2011 22:27:02 +0200 Subject: TSAGE: Silent a GCC warning reported by eriktorbjorn --- engines/tsage/graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 1d432724dc..fce9e1317d 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -326,7 +326,7 @@ void GfxSurface::synchronize(Serializer &s) { s.syncAsSint16LE(zero); } } else { - int w, h; + int w = 0, h = 0; s.syncAsSint16LE(w); s.syncAsSint16LE(h); -- cgit v1.2.3 From eb8db120b26ed42700e891d9cdd7dd88ce0f26e6 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Sat, 25 Jun 2011 01:00:07 +0200 Subject: WINCE: Hide toolbar when returning to game list --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 13 +++++++++++++ backends/graphics/wincesdl/wincesdl-graphics.h | 2 ++ backends/platform/wince/CELauncherDialog.cpp | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index f9f963dc70..b8c8b7754d 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -1599,6 +1599,19 @@ void WINCESdlGraphicsManager::swap_mouse_visibility() { undrawMouse(); } +void WINCESdlGraphicsManager::init_panel() { + _panelVisible = true; + if (_panelInitialized) { + _toolbarHandler.setVisible(true); + _toolbarHandler.setActive(NAME_MAIN_PANEL); + } +} + +void WINCESdlGraphicsManager::reset_panel() { + _panelVisible = false; + _toolbarHandler.setVisible(false); +} + // Smartphone actions void WINCESdlGraphicsManager::initZones() { int i; diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index c620082b0c..89aba92eae 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -90,6 +90,8 @@ public: void swap_zoom_up(); void swap_zoom_down(); void swap_mouse_visibility(); + void init_panel(); + void reset_panel(); void swap_freeLook(); bool getFreeLookState(); diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index 9c832dd585..dd6076e0af 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -24,6 +24,7 @@ #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "backends/platform/wince/wince-sdl.h" +#include "backends/graphics/wincesdl/wincesdl-graphics.h" #include "CELauncherDialog.h" @@ -34,6 +35,7 @@ #include "gui/browser.h" #include "gui/message.h" #include "gui/ThemeEval.h" +#include "gui/widgets/list.h" #include "common/config-manager.h" @@ -63,9 +65,13 @@ public: }; CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() { + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel(); } void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { + if ((cmd == 'STRT') || (cmd == kListItemActivatedCmd) || (cmd == kListItemDoubleClickedCmd)) { + ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel(); + } LauncherDialog::handleCommand(sender, cmd, data); if (cmd == 'ABOU') { CEAboutDialog about; -- cgit v1.2.3 From f46be3394ae5d714eb30b0776520fc0c110e3481 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 25 Jun 2011 10:43:41 +0300 Subject: SCI: Added the Mac versions of LSL1, LSL5 and Dr. Brain 1 Taken from bug reports #3328251, #3328262 and #3328257. Thanks to omer_mor for reporting these --- engines/sci/detection_tables.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 0010f095e1..6641f243e6 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -60,7 +60,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_NOSPEECH }, - // Castle of Dr. Brain - German Amiga (from www.back2roots.org, also includes english language) + // Castle of Dr. Brain - German Amiga (from www.back2roots.org, also includes English language) // Executable scanning reports "1.005.001" // SCI interpreter version 1.000.510 {"castlebrain", "", { @@ -72,6 +72,16 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO_NOSPEECH }, + // Castle of Dr. Brain Macintosh (from omer_mor, bug report #3328251) + {"castlebrain", "", { + {"resource.map", 0, "75cb06a94d2e0641295edd043f26f3a8", 2763}, + {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 476566}, + {"resource.001", 0, "7f7da982f5cd868e1e608cd4f6515656", 400521}, + {"resource.002", 0, "e1a6b6f1060f60be9dcb6d28ad7a2a20", 1168310}, + {"resource.003", 0, "6c3d1bb26ad532c94046bc9ac49b5ff4", 891295}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO_NOSPEECH }, + // Castle of Dr. Brain - English DOS Non-Interactive Demo // SCI interpreter version 1.000.005 {"castlebrain", "Demo", { @@ -1660,6 +1670,15 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + // Larry 1 VGA Remake - English Macintosh (from omer_mor, bug report #3328262) + {"lsl1sci", "SCI", { + {"resource.map", 0, "6395e7f7881e37e39d81ff5175a35f6f", 3237}, + {"resource.000", 0, "5933df4ea688584d6f59fdea5a9404f8", 989066}, + {"resource.001", 0, "aa6f153f70f1e32d1bde465fff08eecf", 1137418}, + {"resource.002", 0, "b22c616aa789ebef990290c7ffd86548", 1097477}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO_NOSPEECH }, + // Larry 1 VGA Remake - English DOS Non-Interactive Demo // SCI interpreter version 1.000.084 {"lsl1sci", "SCI/Demo", { @@ -1923,6 +1942,20 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + // Larry 5 - English Macintosh (from omer_mor, bug report #3328257) + {"lsl5", "", { + {"resource.map", 0, "f12439da78b9878e16436661deb83f84", 6525}, + {"resource.000", 0, "f2537473213d70e7f4fc82e988ab90ca", 702403}, + {"resource.001", 0, "db4a1381d88028876a99303bfaaba893", 704679}, + {"resource.002", 0, "e86aeb27711f4a673e06ec32cfc84125", 1125854}, + {"resource.003", 0, "13fd4942bb818f9acd2970d66fca6509", 854733}, + {"resource.004", 0, "999f407c9f38f937d4b8c4230ff5bb38", 1046644}, + {"resource.005", 0, "0cc8d35a744031c772ca7cd21ae95273", 1008293}, + {"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1110043}, + {"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 989801}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO_NOSPEECH }, + // Larry 5 - German DOS (from Tobis87) // SCI interpreter version T.A00.196 {"lsl5", "", { -- cgit v1.2.3 From dde622174c9093458cd448f6db11459c8e1ac59f Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 25 Jun 2011 09:51:50 +0200 Subject: MOHAWK: Don't crash when getting odd types from LB target expressions. (Thanks to [md5] for pointing it out.) --- engines/mohawk/livingbooks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index c1c1dfc875..397281fe74 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -2637,7 +2637,8 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { break; default: // FIXME: handle list - debug(2, "Target '%s' (by expression) resulted in unknown type, skipping", entry->targets[n].c_str()); + warning("Target '%s' (by expression) resulted in unknown type, skipping", entry->targets[n].c_str()); + continue; } } if (!target) { -- cgit v1.2.3 From 0c6d41e59eee60da0d0de58ca3bd3f1df5c741e1 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 25 Jun 2011 10:12:48 +0200 Subject: NEWS: Mention SAGA fixes, new Mohawk detection entries. --- NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 3849d82fae..bf25489f56 100644 --- a/NEWS +++ b/NEWS @@ -11,9 +11,19 @@ For a more comprehensive changelog of the latest experimental code, see: There should be no more silent errors due to invalid audio devices. Instead ScummVM should pick up a suitable alternative device. + Mohawk: + - Added detection entries for more variants of some Living Books + games. + Tinsel: - Fixed a regression that made Discworld uncompletable. + SAGA: + - Fixed a regression in Inherit the Earth's dragon walk code which + was causing crashes there. + - Fixed a regression causing various crashes in I Have No Mouth and + I Must Scream. + SCUMM: - Fixed graphics bug in FM-TOWNS versions of games on ARM devices (Android, iPhone, etc.). -- cgit v1.2.3 From 14a5e0a425877c3540289b37f1695771ca882a44 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 13:28:33 +0400 Subject: DREAMWEB: Fixed keypad animation --- devtools/tasmrecover/dreamweb/keypad.asm | 1 + engines/dreamweb/dreamgen.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm index 8ac38524aa..3638f35cb1 100644 --- a/devtools/tasmrecover/dreamweb/keypad.asm +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -22,6 +22,7 @@ keypadloop: call delpointer call readmouse call showkeypad call showpointer + call vsync cmp presscount,0 jz nopresses dec presscount diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a5a4748948..954b08eeec 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14630,6 +14630,7 @@ void DreamGenContext::showkeypad() { di = (36+112)+31; bx = (72)+59; singlekey(); + vsync(); _cmp(data.byte(kLightcount), 0); if (flags.z()) return /* (notenter) */; -- cgit v1.2.3 From a63e5939ed9f88e0609426e0e83c9fc7a90d38ab Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 13:40:56 +0400 Subject: DREAMWEB: Fixed quit from keypad screen --- devtools/tasmrecover/dreamweb/keypad.asm | 6 +++++- engines/dreamweb/dreamgen.cpp | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm index 3638f35cb1..8d918e618b 100644 --- a/devtools/tasmrecover/dreamweb/keypad.asm +++ b/devtools/tasmrecover/dreamweb/keypad.asm @@ -18,7 +18,11 @@ Entercode proc near mov presspointer,0 mov getback,0 -keypadloop: call delpointer +keypadloop: + cmp quitrequested, 0 + jnz numberright + + call delpointer call readmouse call showkeypad call showpointer diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 954b08eeec..253b49a8c9 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14360,10 +14360,14 @@ void DreamGenContext::entercode() { 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; @@ -14630,7 +14634,6 @@ void DreamGenContext::showkeypad() { di = (36+112)+31; bx = (72)+59; singlekey(); - vsync(); _cmp(data.byte(kLightcount), 0); if (flags.z()) return /* (notenter) */; -- cgit v1.2.3 From 7432cc4dd97e56e28c7acfef368272392ffb2900 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 25 Jun 2011 12:42:49 +0300 Subject: SCI: Fixed bug #3325512: "EcoQuest 1: Audio settings are not saved" --- engines/sci/sci.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index de1aafb8e2..792b2b2055 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -870,6 +870,7 @@ void SciEngine::syncIngameAudioOptions() { // Is it a game that supports simultaneous speech and subtitles? if (getGameId() == GID_SQ4 || getGameId() == GID_FREDDYPHARKAS + || getGameId() == GID_ECOQUEST // TODO: The following need script patches for simultaneous speech and subtitles //|| getGameId() == GID_KQ6 //|| getGameId() == GID_LAURABOW2 -- cgit v1.2.3 From bfa9fd7f3f6973cf82637e91e776c44ac59182e0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 25 Jun 2011 12:48:30 +0300 Subject: Updated NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index bf25489f56..0aca2b7456 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,10 @@ For a more comprehensive changelog of the latest experimental code, see: - Fixed a regression causing various crashes in I Have No Mouth and I Must Scream. + SCI: + - Added detection entries for some Macintosh game versions. + - Audio settings are now stored correctly for the CD version of EcoQuest 1. + SCUMM: - Fixed graphics bug in FM-TOWNS versions of games on ARM devices (Android, iPhone, etc.). -- cgit v1.2.3 From 7f5cd1ac82cb8dc8e7ceb426826b4a5367a27b49 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 25 Jun 2011 13:46:30 +0300 Subject: NEWS: Removed superfluous whitespace Thanks to salty-horse for pointing it out --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0aca2b7456..9be9b252ca 100644 --- a/NEWS +++ b/NEWS @@ -27,7 +27,7 @@ For a more comprehensive changelog of the latest experimental code, see: SCI: - Added detection entries for some Macintosh game versions. - Audio settings are now stored correctly for the CD version of EcoQuest 1. - + SCUMM: - Fixed graphics bug in FM-TOWNS versions of games on ARM devices (Android, iPhone, etc.). -- cgit v1.2.3 From 73d2d34e01fb929d5ed9af08646c9474ec5150ed Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 25 Jun 2011 14:50:07 +0300 Subject: LASTEXPRESS: Give proper name to another sound struct member --- engines/lastexpress/game/sound.cpp | 14 +++++++------- engines/lastexpress/game/sound.h | 2 +- engines/lastexpress/sound/entry.cpp | 2 +- engines/lastexpress/sound/entry.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index adb82816f5..c95ef85701 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -255,11 +255,11 @@ bool SoundManager::isBuffered(Common::String filename, bool testForEntity) { ////////////////////////////////////////////////////////////////////////// // Entry ////////////////////////////////////////////////////////////////////////// -void SoundManager::setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int a4) { +void SoundManager::setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int priority) { if (!entry) error("SoundManager::setupEntry: Invalid entry!"); - entry->field_4C = a4; + entry->priority = priority; setEntryType(entry, flag); entry->setStatus(flag); @@ -354,7 +354,7 @@ bool SoundManager::setupCache(SoundEntry *entry) { for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { if (!((*i)->status.status & kSoundStatus_180)) { - uint32 newSize = (*i)->field_4C + ((*i)->status.status & kSoundStatusClear1); + uint32 newSize = (*i)->priority + ((*i)->status.status & kSoundStatusClear1); if (newSize < size) { cacheEntry = (*i); @@ -363,7 +363,7 @@ bool SoundManager::setupCache(SoundEntry *entry) { } } - if (entry->field_4C <= size) + if (entry->priority <= size) return false; if (!cacheEntry) @@ -574,7 +574,7 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { blockCount = 0; s.syncAsUint32LE(blockCount); // blockCount; - s.syncAsUint32LE(entry->field_4C); // field_20; + s.syncAsUint32LE(entry->priority); // field_20; char name1[16]; strcpy((char *)&name1, entry->name1.c_str()); @@ -1769,10 +1769,10 @@ void SoundManager::updateSubtitles() { || status & 0x180 || soundEntry->time == 0 || (status & 0x1F) < 6 - || ((getFlags()->nis & 0x8000) && soundEntry->field_4C < 90)) { + || ((getFlags()->nis & 0x8000) && soundEntry->priority < 90)) { current_index = 0; } else { - current_index = soundEntry->field_4C + (status & 0x1F); + current_index = soundEntry->priority + (status & 0x1F); if (_currentSubtitle == (*i)) current_index += 4; diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index b2a1b4387b..e7b06609a9 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -161,7 +161,7 @@ private: SoundEntry *getEntry(Common::String name); SoundEntry *getEntry(SoundType type); - void setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int a4); + void setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int priority); void setEntryType(SoundEntry *entry, SoundFlag flag); bool setupCache(SoundEntry *entry); void removeFromCache(SoundEntry *entry); diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 848e728ba4..67549cb5fe 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -53,7 +53,7 @@ SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) { field_40 = 0; entity = kEntityPlayer; field_48 = 0; - field_4C = 0; + priority = 0; subtitle = NULL; diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h index 5671e0e74b..84a2342cf3 100644 --- a/engines/lastexpress/sound/entry.h +++ b/engines/lastexpress/sound/entry.h @@ -146,7 +146,7 @@ public: int field_40; EntityIndex entity; int field_48; - uint32 field_4C; + uint32 priority; Common::String name1; //char[16]; Common::String name2; //char[16]; //int next; // offset to the next structure in the list (not used) -- cgit v1.2.3 From 82e263223a6ae0ecbf9ae23c94fefba2bd6f5dd9 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 16:49:22 +0400 Subject: DREAMWEB: Added german and spanish floppy versions --- engines/dreamweb/detection_tables.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index f32b8de6b6..0208b7ebbf 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -81,6 +81,23 @@ static const DreamWebGameDescription gameDescriptions[] = { }, }, + // German floppy release + { + { + "dreamweb", + "", + { + {"dreamweb.r00", 0, "9960dc3baddabc6ad2a6fd75292b149c", 155886}, + {"dreamweb.r02", 0, "48e1f42a53402f963ca2d1ed969f4084", 212823}, + AD_LISTEND + }, + Common::DE_DEU, + Common::kPlatformPC, + ADGF_UNSTABLE, + GUIO_NONE + }, + }, + // German CD release { { @@ -98,6 +115,23 @@ static const DreamWebGameDescription gameDescriptions[] = { }, }, + // Spanish floppy release + { + { + "dreamweb", + "", + { + {"dreamweb.r00", 0, "2df07174321de39c4f17c9ff654b268a", 153608}, + {"dreamweb.r02", 0, "f97d435ad5da08fb1bcf6ea3dd6e0b9e", 199499}, + AD_LISTEND + }, + Common::ES_ESP, + Common::kPlatformPC, + ADGF_UNSTABLE, + GUIO_NONE + }, + }, + { AD_TABLE_END_MARKER } }; -- cgit v1.2.3 From 871349b6479ec624b85f0bf70f7b5870bccaeeec Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 28 May 2011 14:41:26 +0200 Subject: I18N: Update French translation --- po/fr_FR.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fr_FR.po b/po/fr_FR.po index cfb0c0a45b..7b6326a75b 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -1836,7 +1836,7 @@ msgstr "Mode ~Z~ip Activ #: engines/mohawk/dialogs.cpp:91 msgid "~T~ransitions Enabled" -msgstr "T~r~ansitions activé" +msgstr "T~r~ansitions activées" #: engines/mohawk/dialogs.cpp:92 msgid "~D~rop Page" -- cgit v1.2.3 From 771345da3aa0138c61345da1732fe6b3927001ce Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 28 May 2011 15:20:53 +0200 Subject: MOHAWK: Made some Myst common opcodes match the original better Plus some minor cleanup--- engines/mohawk/myst_scripts.cpp | 178 +++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 102 deletions(-) diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index be5b7e1c76..17f6de534f 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -436,89 +436,77 @@ void MystScriptParser::o_changeCardDirectional(uint16 op, uint16 var, uint16 arg // but with the current cardId stored. // Opcode 18 then "pops" this stored CardId and returns to that card. -// TODO: The purpose of the optional argv[1] on Opcode 17 and argv[0] -// on Opcode 18 which are always 4, 5 or 6 is unknown. - void MystScriptParser::o_changeCardPush(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - if (argc == 2) { - debugC(kDebugScript, "Opcode %d: Jump to Card Id, Storing Current Card Id", op); - - uint16 cardId = argv[0]; - debugC(kDebugScript, "\tJump to CardId: %d", cardId); + debugC(kDebugScript, "Opcode %d: Jump to Card Id, Storing Current Card Id", op); - uint16 u0 = argv[1]; // TODO - debugC(kDebugScript, "\tu0: %d", u0); + _savedCardId = _vm->getCurCard(); + uint16 cardId = argv[0]; - _savedCardId = _vm->getCurCard(); + // argv[1] is not used in the original engine - debugC(kDebugScript, "\tCurrent CardId: %d", _savedCardId); + debugC(kDebugScript, "\tCurrent CardId: %d", _savedCardId); + debugC(kDebugScript, "\tJump to CardId: %d", cardId); - _vm->changeToCard(cardId, true); - } else - unknown(op, var, argc, argv); + _vm->changeToCard(cardId, true); } void MystScriptParser::o_changeCardPop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); + debugC(kDebugScript, "Opcode %d: Return To Stored Card Id", op); + debugC(kDebugScript, "\tCardId: %d", _savedCardId); - if (argc == 1) { - debugC(kDebugScript, "Opcode %d: Return To Stored Card Id", op); - debugC(kDebugScript, "\tCardId: %d", _savedCardId); + // argv[0] is not used in the original engine - uint16 u0 = argv[0]; - debugC(kDebugScript, "\tu0: %d", u0); - - _vm->changeToCard(_savedCardId, true); - } else - unknown(op, var, argc, argv); + _vm->changeToCard(_savedCardId, true); } void MystScriptParser::o_enableAreas(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); + debugC(kDebugScript, "Opcode %d: Enable Hotspots", op); - if (argc > 0) { - debugC(kDebugScript, "Opcode %d: Enable Hotspots", op); + uint16 count = argv[0]; - uint16 count = argv[0]; + if (argc == count + 1) { + for (uint16 i = 0; i < count; i++) { + debugC(kDebugScript, "Enable hotspot index %d", argv[i + 1]); - if (argc != count + 1) - unknown(op, var, argc, argv); - else { - for (uint16 i = 0; i < count; i++) { - debugC(kDebugScript, "Enable hotspot index %d", argv[i + 1]); - _vm->setResourceEnabled(argv[i + 1], true); - } + MystResource *resource = 0; + if (argv[i + 1] == 0xFFFF) + resource = _invokingResource; + else + resource = _vm->_resources[argv[i + 1]]; + + if (resource) + resource->setEnabled(true); + else + warning("Unknown Resource in enableAreas script Opcode"); } - } else - unknown(op, var, argc, argv); + } else { + error("Invalid arguments for opcode %d", op); + } } void MystScriptParser::o_disableAreas(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - if (argc > 0) { - debugC(kDebugScript, "Opcode %d: Disable Hotspots", op); - - uint16 count = argv[0]; - - if (argc != count + 1) - unknown(op, var, argc, argv); - else { - for (uint16 i = 0; i < count; i++) { - debugC(kDebugScript, "Disable hotspot index %d", argv[i + 1]); - if (argv[i + 1] == 0xFFFF) { - if (_invokingResource != NULL) - _invokingResource->setEnabled(false); - else - warning("Unknown Resource in disableHotspots script Opcode"); - } else - _vm->setResourceEnabled(argv[i + 1], false); - } + debugC(kDebugScript, "Opcode %d: Disable Hotspots", op); + + uint16 count = argv[0]; + + if (argc == count + 1) { + for (uint16 i = 0; i < count; i++) { + debugC(kDebugScript, "Disable hotspot index %d", argv[i + 1]); + + MystResource *resource = 0; + if (argv[i + 1] == 0xFFFF) + resource = _invokingResource; + else + resource = _vm->_resources[argv[i + 1]]; + + if (resource) + resource->setEnabled(true); + else + warning("Unknown Resource in disableAreas script Opcode"); } - } else - unknown(op, var, argc, argv); + } else { + error("Invalid arguments for opcode %d", op); + } } void MystScriptParser::o_directionalUpdate(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -528,43 +516,37 @@ void MystScriptParser::o_directionalUpdate(uint16 op, uint16 var, uint16 argc, u } void MystScriptParser::o_toggleAreasActivation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - if (argc > 0) { - debugC(kDebugScript, "Opcode %d: Toggle areas activation", op); + debugC(kDebugScript, "Opcode %d: Toggle areas activation", op); - uint16 count = argv[0]; + uint16 count = argv[0]; - if (argc != count + 1) - unknown(op, var, argc, argv); - else { - for (uint16 i = 0; i < count; i++) { - debugC(kDebugScript, "Enable/Disable hotspot index %d", argv[i + 1]); + if (argc == count + 1) { + for (uint16 i = 0; i < count; i++) { + debugC(kDebugScript, "Enable/Disable hotspot index %d", argv[i + 1]); - MystResource *resource = 0; - if (argv[i + 1] == 0xFFFF) - resource = _invokingResource; - else - resource = _vm->_resources[argv[i + 1]]; + MystResource *resource = 0; + if (argv[i + 1] == 0xFFFF) + resource = _invokingResource; + else + resource = _vm->_resources[argv[i + 1]]; - if (resource) - resource->setEnabled(!resource->isEnabled()); - } + if (resource) + resource->setEnabled(!resource->isEnabled()); + else + warning("Unknown Resource in toggleAreasActivation script Opcode"); } - } else - unknown(op, var, argc, argv); + } else { + error("Invalid arguments for opcode %d", op); + } } void MystScriptParser::o_playSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - if (argc == 1) { - uint16 soundId = argv[0]; + uint16 soundId = argv[0]; - debugC(kDebugScript, "Opcode %d: playSound", op); - debugC(kDebugScript, "\tsoundId: %d", soundId); + debugC(kDebugScript, "Opcode %d: playSound", op); + debugC(kDebugScript, "\tsoundId: %d", soundId); - _vm->_sound->replaceSoundMyst(soundId); - } else - unknown(op, var, argc, argv); + _vm->_sound->replaceSoundMyst(soundId); } void MystScriptParser::o_stopSoundBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -590,7 +572,6 @@ void MystScriptParser::o_copyBackBufferToScreen(uint16 op, uint16 var, uint16 ar // Used in Mechanical Card 6267 (Code Lock) rect = _invokingResource->getRect(); } else { - // Used in ... TODO: Fill in. rect = Common::Rect(argv[0], argv[1], argv[2], argv[3]); } @@ -645,8 +626,6 @@ void MystScriptParser::o_copyImageToBackBuffer(uint16 op, uint16 var, uint16 arg // by Channelwood Card 3280 (Tank Valve) and water flow sound behavior in pipe // on cards leading from shed... void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - int16 *soundList = NULL; uint16 *soundListVolume = NULL; @@ -709,7 +688,7 @@ void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, uint16 arg warning("Unknown sound control value in opcode %d", op); } } else - unknown(op, var, argc, argv); + warning("Unknown arg count in opcode %d", op); delete[] soundList; soundList = NULL; @@ -783,25 +762,19 @@ void MystScriptParser::o_changeCard(uint16 op, uint16 var, uint16 argc, uint16 * } void MystScriptParser::o_drawImageChangeCard(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - if (argc == 3) { debugC(kDebugScript, "Opcode %d: Draw Full Screen Image, Delay then Change Card", op); uint16 imageId = argv[0]; uint16 cardId = argv[1]; - uint16 delay = argv[2]; // TODO: Not sure about argv[2] being delay.. + // argv[2] is not used in the original engine debugC(kDebugScript, "\timageId: %d", imageId); debugC(kDebugScript, "\tcardId: %d", cardId); - debugC(kDebugScript, "\tdelay: %d", delay); _vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333)); _vm->_system->updateScreen(); - _vm->_system->delayMillis(delay * 100); + _vm->changeToCard(cardId, true); - } else - unknown(op, var, argc, argv); } void MystScriptParser::o_changeMainCursor(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -916,7 +889,8 @@ void MystScriptParser::o_soundWaitStop(uint16 op, uint16 var, uint16 argc, uint1 // Used when Button is pushed... debugC(kDebugScript, "Opcode %d: Wait for foreground sound to finish", op); - // TODO: Implement + while (_vm->_sound->isPlaying()) + _vm->_system->delayMillis(10); } void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { -- cgit v1.2.3 From 5a2bc12f269a04a1b703112eaef7cf499c70884d Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 25 Jun 2011 15:17:03 +0200 Subject: PS3: Fix out of tree builds. Allow GCC to use CELL BE PPU features.--- configure | 2 +- ports.mk | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 0c0b34adc1..0443a2fb94 100755 --- a/configure +++ b/configure @@ -1882,7 +1882,7 @@ case $_host_os in _sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin" DEFINES="$DEFINES -DPLAYSTATION3" - CXXFLAGS="$CXXFLAGS -mminimal-toc -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include" + CXXFLAGS="$CXXFLAGS -mcpu=cell -mminimal-toc -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include" LDFLAGS="$LDFLAGS -L$PS3DEV/psl1ght/ppu/lib -L$PS3DEV/portlibs/ppu/lib" add_line_to_config_mk 'PLAYSTATION3 = 1' add_line_to_config_h "#define PREFIX \"${prefix}\"" diff --git a/ports.mk b/ports.mk index eba8b686f2..4535735b29 100644 --- a/ports.mk +++ b/ports.mk @@ -226,12 +226,13 @@ ifdef DIST_FILES_ENGINEDATA cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/ endif cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/ - cp dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/ + cp $(srcdir)/dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/ cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/ - cp dists/ps3/ICON0.PNG ps3pkg/ - cp dists/ps3/PIC1.PNG ps3pkg/ - sfo.py -f dists/ps3/sfo.xml ps3pkg/PARAM.SFO + cp $(srcdir)/dists/ps3/ICON0.PNG ps3pkg/ + cp $(srcdir)/dists/ps3/PIC1.PNG ps3pkg/ + sfo.py -f $(srcdir)/dists/ps3/sfo.xml ps3pkg/PARAM.SFO pkg.py --contentid UP0001-SCUM12000_00-0000000000000000 ps3pkg/ scummvm-ps3.pkg + package_finalize scummvm-ps3.pkg # Mark special targets as phony .PHONY: deb bundle osxsnap win32dist install uninstall ps3pkg -- cgit v1.2.3 From 1a05efa8eda02eb2c40432e19d77c6e507c86453 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 25 Jun 2011 15:41:58 +0200 Subject: GUI: fix bug #2822778 (Savegames now get loaded after GMM dialogue execution. This avoids mouse cursor glitches (e.g. mouse cursors which get changed during loadGameState() being popped when the dialogue closes). --- engines/dialogs.cpp | 10 +++------- engines/engine.cpp | 20 ++++++++++++++++++++ engines/engine.h | 16 ++++++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 89c07ad24c..1a077e5bf7 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -246,14 +246,10 @@ void MainMenuDialog::load() { int slot = _loadDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); - if (slot >= 0) { - // FIXME: For now we just ignore the return - // value, which is quite bad since it could - // be a fatal loading error, which renders - // the engine unusable. - _engine->loadGameState(slot); + _engine->setGameToLoadSlot(slot); + + if (slot >= 0) close(); - } } enum { diff --git a/engines/engine.cpp b/engines/engine.cpp index dde5064dc4..b952f065ad 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -96,6 +96,7 @@ Engine::Engine(OSystem *syst) _targetName(ConfMan.getActiveDomainName()), _pauseLevel(0), _pauseStartTime(0), + _saveSlotToLoad(-1), _engineStartTime(_system->getMillis()), _mainMenuDialog(NULL) { @@ -396,7 +397,22 @@ void Engine::pauseEngineIntern(bool pause) { void Engine::openMainMenuDialog() { if (!_mainMenuDialog) _mainMenuDialog = new MainMenuDialog(this); + + setGameToLoadSlot(-1); + runDialog(*_mainMenuDialog); + + // Load savegame after main menu execution + // (not from inside the menu loop to avoid + // mouse cursor glitches and simliar bugs, + // e.g. #2822778). + // FIXME: For now we just ignore the return + // value, which is quite bad since it could + // be a fatal loading error, which renders + // the engine unusable. + if (_saveSlotToLoad > 0) + loadGameState(_saveSlotToLoad); + syncSoundSettings(); } @@ -437,6 +453,10 @@ int Engine::runDialog(GUI::Dialog &dialog) { return result; } +void Engine::setGameToLoadSlot(int slot) { + _saveSlotToLoad = slot; +} + void Engine::syncSoundSettings() { // Sync the engine with the config manager int soundVolumeMusic = ConfMan.getInt("music_volume"); diff --git a/engines/engine.h b/engines/engine.h index 06b7f7dedd..2796df5c4f 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -82,6 +82,13 @@ private: */ int32 _engineStartTime; + /** + * Save slot selected via global main menu. + * This slot will be loaded after main menu execution (not from inside + * the menu loop, to avoid bugs like #2822778). + */ + int _saveSlotToLoad; + public: @@ -185,6 +192,15 @@ public: */ virtual Common::Error loadGameState(int slot); + /** + * Sets the game slot for a savegame to be loaded after global + * main menu execution. This is to avoid loading a savegame from + * inside the menu loop which causes bugs like #2822778. + * + * @param slot the slot from which a savestate should be loaded. + */ + void setGameToLoadSlot(int slot); + /** * Indicates whether a game state can be loaded. */ -- cgit v1.2.3 From 3f2b5b9e8b9196c9d0e573abf8f8350ec4034b1d Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 24 Jun 2011 17:17:20 +0200 Subject: KYRA: revert d7e700f370c258a5f4786d972af3666b93b71f94 The GMM mouse cursor bug has now been fixed inside the GMM and CursorMan code. --- engines/kyra/kyra_hof.cpp | 8 -------- engines/kyra/kyra_lok.cpp | 8 -------- engines/kyra/kyra_mr.cpp | 8 -------- engines/kyra/kyra_v1.cpp | 1 - engines/kyra/kyra_v1.h | 3 --- engines/kyra/lol.cpp | 8 -------- engines/kyra/saveload_hof.cpp | 2 +- engines/kyra/saveload_lok.cpp | 2 +- engines/kyra/saveload_lol.cpp | 2 +- engines/kyra/saveload_mr.cpp | 2 +- 10 files changed, 4 insertions(+), 40 deletions(-) diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 9a4f7bc42e..5c58e6e3ed 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -503,14 +503,6 @@ void KyraEngine_HoF::runLoop() { int inputFlag = checkInput(_buttonList, true); removeInputTop(); - if (_updateHandItemCursor) { - // This works around an issue which would occur when setHandItem(_itemInHand) - // was called from inside loadGameState(). When loading via GMM the - // mouse cursor would not be set correctly. - _updateHandItemCursor = false; - setHandItem(_itemInHand); - } - update(); if (inputFlag == 198 || inputFlag == 199) { diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index ee67062cdd..7f356f34c1 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -821,14 +821,6 @@ void KyraEngine_LoK::updateMousePointer(bool forceUpdate) { newY = 4; } - if (_updateHandItemCursor) { - // This works around an issue which would occur when setHandItem(_itemInHand) - // was called from inside loadGameState(). When loading via GMM the - // mouse cursor would not be set correctly. - _updateHandItemCursor = false; - setHandItem(_itemInHand); - } - if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) { _mouseState = newMouseState; _screen->hideMouse(); diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 973ab25088..f5bcd04ea0 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -908,14 +908,6 @@ void KyraEngine_MR::runLoop() { int inputFlag = checkInput(_mainButtonList, true); removeInputTop(); - if (_updateHandItemCursor) { - // This works around an issue which would occur when setHandItem(_itemInHand) - // was called from inside loadGameState(). When loading via GMM the - // mouse cursor would not be set correctly. - _updateHandItemCursor = false; - setHandItem(_itemInHand); - } - update(); _timer->update(); diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index f79fabf9eb..3d81368d2d 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -56,7 +56,6 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) _gameToLoad = -1; _mouseState = -1; - _updateHandItemCursor = false; _deathHandler = -1; memset(_flagsTable, 0, sizeof(_flagsTable)); diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 5b4f3385a4..c5bf2d2960 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -343,9 +343,6 @@ protected: virtual void setHandItem(Item item) = 0; virtual void removeHandItem() = 0; - void setDelayedCursorUpdate() { _updateHandItemCursor = true; } - bool _updateHandItemCursor; - // game flags uint8 _flagsTable[100]; // TODO: check this value diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index c567cbb037..2cca4fd4e3 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -935,14 +935,6 @@ void LoLEngine::runLoop() { checkFloatingPointerRegions(); gui_updateInput(); - if (_updateHandItemCursor) { - // This works around an issue which would occur when setHandItem(_itemInHand) - // was called from inside loadGameState(). When loading via GMM the - // mouse cursor would not be set correctly. - _updateHandItemCursor = false; - setHandItem(_itemInHand); - } - update(); if (_sceneUpdateRequired) diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index b395a38acd..645bd2903f 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -306,7 +306,7 @@ Common::Error KyraEngine_HoF::loadGameState(int slot) { _mainCharacter.facing = 4; enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1); - setDelayedCursorUpdate(); + setHandItem(_itemInHand); if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1) snd_playWanderScoreViaMap(_lastMusicCommand, 1); diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index 7689a904b0..34762d4c92 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -170,7 +170,7 @@ Common::Error KyraEngine_LoK::loadGameState(int slot) { _screen->copyRegion(8, 8, 8, 8, 304, 212, 10, 0); } - setDelayedCursorUpdate(); + setHandItem(_itemInHand); // Will-O-Wisp uses a different shape size than Brandon's usual // shape, thus we need to setup the correct size depending on diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp index c81ace26f0..07842ea358 100644 --- a/engines/kyra/saveload_lol.cpp +++ b/engines/kyra/saveload_lol.cpp @@ -257,7 +257,7 @@ Common::Error LoLEngine::loadGameState(int slot) { int t = _credits; _credits = 0; giveCredits(t, 0); - setDelayedCursorUpdate(); + setHandItem(_itemInHand); loadLevel(_currentLevel); gui_drawPlayField(); timerSpecialCharacterUpdate(0); diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp index 0fd3e520f9..139375264f 100644 --- a/engines/kyra/saveload_mr.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -305,7 +305,7 @@ Common::Error KyraEngine_MR::loadGameState(int slot) { _goodConsciencePosition = false; enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1); - setDelayedCursorUpdate(); + setHandItem(_itemInHand); if (_lastMusicCommand >= 0 && !_unkSceneScreenFlag1) snd_playWanderScoreViaMap(_lastMusicCommand, 1); -- cgit v1.2.3 From 375298f69a69e478447feab360fa9296b53e2698 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 17:28:51 +0400 Subject: DREAMWEB: Replaced foreign-guarded code with "foreignrelease" variable, added modifychar stub --- devtools/tasmrecover/dreamweb/dreamweb.asm | 18 +- devtools/tasmrecover/dreamweb/monitor.asm | 18 +- devtools/tasmrecover/dreamweb/newplace.asm | 13 +- devtools/tasmrecover/dreamweb/object.asm | 11 +- devtools/tasmrecover/dreamweb/print.asm | 5 +- devtools/tasmrecover/dreamweb/sprite.asm | 4 +- devtools/tasmrecover/dreamweb/use.asm | 23 ++- devtools/tasmrecover/tasm-recover | 3 +- engines/dreamweb/dreamgen.cpp | 307 +++++++++++++++++++---------- engines/dreamweb/dreamgen.h | 52 ++--- engines/dreamweb/dreamweb.cpp | 3 + engines/dreamweb/dreamweb.h | 2 + engines/dreamweb/stubs.cpp | 4 + 13 files changed, 295 insertions(+), 168 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm index edecad783e..c222a63178 100644 --- a/devtools/tasmrecover/dreamweb/dreamweb.asm +++ b/devtools/tasmrecover/dreamweb/dreamweb.asm @@ -50,7 +50,7 @@ debuglevel1 equ 0 ;memory debug on debuglevel2 equ 0 ;debug keys on+shouts demo equ 0 CD equ 1 -Foreign equ 0 +Foreign equ 1 Spanish equ 0 German equ 0 @@ -4225,9 +4225,10 @@ Undertextline proc near mov di,textaddressx mov bx,textaddressy - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 - endif +$1: mov ds,buffers mov si,textunder mov cl,undertextsizex @@ -4248,9 +4249,10 @@ Deltextline proc near mov di,textaddressx mov bx,textaddressy - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 - endif +$1: mov ds,buffers mov si,textunder mov cl,undertextsizex @@ -4271,9 +4273,10 @@ Dumptextline proc near mov newtextline,0 mov di,textaddressx mov bx,textaddressy - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 - endif +$1: mov cl,undertextsizex mov ch,undertextsizey call multidump @@ -6238,6 +6241,7 @@ Recname db "DREAMWEB.DEM",0 Quitrequested db 0 Subtitles db 0 +ForeignRelease db 0 ;-------------------------------------------------------End of code segment---- diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm index 247ba10f2b..7f3979c2b3 100644 --- a/devtools/tasmrecover/dreamweb/monitor.asm +++ b/devtools/tasmrecover/dreamweb/monitor.asm @@ -1425,10 +1425,11 @@ Printcurs proc near mov bx,curslocy mov cl,6 mov ch,8 - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 mov ch,11 - endif +$1: mov ds,buffers mov si,textunder push di bx @@ -1449,11 +1450,11 @@ Printcurs proc near flashcurs: pop di bx sub di,6 mov cl,12 - if foreign - mov ch,11 - else mov ch,8 - endif + cmp foreignrelease, 0 + jz $2 + mov ch,11 +$2: call multidump pop es bx dx ds di si @@ -1473,10 +1474,11 @@ Delcurs proc near mov bx,curslocy mov cl,6 mov ch,8 - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 mov ch,11 - endif +$1: push di bx cx mov ds,buffers mov si,textunder diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm index ac703f6b11..2bbf4fe498 100644 --- a/devtools/tasmrecover/dreamweb/newplace.asm +++ b/devtools/tasmrecover/dreamweb/newplace.asm @@ -158,13 +158,14 @@ alreadyinfo: mov ax,mousebutton mov di,60 mov bx,72+55 call showframe - if foreign + cmp foreignrelease, 0 + jz $1 mov al,4 mov ah,0 mov di,60 mov bx,72+55+21 call showframe - endif +$1: pop bx mov bh,0 @@ -175,11 +176,11 @@ alreadyinfo: mov ax,mousebutton call findnextcolon mov di,63 - if foreign - mov bx,84+4 - else mov bx,84 - endif + cmp foreignrelease, 0 + jz $2 + mov bx,84+4 +$2: mov dl,191 mov al,0 mov ah,0 diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index bdd043d588..bc73ef5679 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -670,11 +670,13 @@ Describeob proc near mov di,33 mov bx,92 - if foreign + + cmp foreignrelease, 0 + jz notsetd cmp objecttype,1 jnz notsetd mov bx,82 -notsetd: endif +notsetd: mov dl,241 mov ah,16 mov charshift,91+91 @@ -682,11 +684,12 @@ notsetd: endif mov charshift,0 mov di,36 mov bx,104 - if foreign + cmp foreignrelease, 0 + jz notsetd2 cmp objecttype,1 jnz notsetd2 mov bx,94 -notsetd2: endif +notsetd2: mov dl,241 mov ah,0 call printdirect diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm index a2052285f0..7cbb45c08b 100644 --- a/devtools/tasmrecover/dreamweb/print.asm +++ b/devtools/tasmrecover/dreamweb/print.asm @@ -6,9 +6,10 @@ Printchar proc near cmp al,255 jz ignoreit push si bx di - if foreign + cmp foreignrelease, 0 + jz $1 sub bx,3 - endif +$1: push ax sub al,32 ;"A" mov ah,0 diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm index fadea3b790..45f807da3f 100644 --- a/devtools/tasmrecover/dreamweb/sprite.asm +++ b/devtools/tasmrecover/dreamweb/sprite.asm @@ -4785,12 +4785,12 @@ Reconstruct proc near call drawfloor call spriteupdate call printsprites - if foreign + cmp foreignrelease, 0 + jz notfudge cmp reallocation,20 jnz notfudge call undertextline notfudge: - endif mov havedoneobs,0 noneedtorecon: ret diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm index 08debfca56..fbbd9c99db 100644 --- a/devtools/tasmrecover/dreamweb/use.asm +++ b/devtools/tasmrecover/dreamweb/use.asm @@ -1879,11 +1879,11 @@ Usecashcard proc near call showman mov di,114 - if foreign - mov bx,120-3 - else mov bx,120 - endif + cmp foreignrelease, 0 + jz $1 + mov bx,120-3 +$1: mov ds,tempgraphics mov al,39 mov ah,0 @@ -3189,9 +3189,10 @@ notinlouiss: ret Getundertimed proc near mov al,timedy - if foreign + cmp foreignrelease, 0 + jz $1 sub al,3 - endif +$1: mov ah,0 mov bx,ax mov al,timedx @@ -3212,9 +3213,10 @@ Getundertimed proc near Putundertimed proc near mov al,timedy - if foreign + cmp foreignrelease, 0 + jz $1 sub al,3 - endif +$1: mov ah,0 mov bx,ax mov al,timedx @@ -3239,9 +3241,10 @@ Dumptimedtext proc near cmp needtodumptimed,1 jnz nodumptimed mov al,timedy - if foreign + cmp foreignrelease, 0 + jz $1 sub al,3 - endif +$1: mov ah,0 mov bx,ax mov al,timedx diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index d6c6a2523f..5f7a528a5b 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -23,6 +23,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'convertkey', 'readabyte', 'readoneblock', - 'frameoutv' + 'frameoutv', + 'modifychar' ]) generator.generate('dreamweb') #start routine diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 253b49a8c9..2afd1bc357 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2173,7 +2173,7 @@ forcenext: void DreamGenContext::clearsprites() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); al = 255; cx = (32)*16; _stosb(cx, true); @@ -2182,7 +2182,7 @@ void DreamGenContext::clearsprites() { void DreamGenContext::makesprite() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); _tmp17: _cmp(es.byte(bx+15), 255); if (flags.z()) @@ -2210,11 +2210,11 @@ void DreamGenContext::delsprite() { void DreamGenContext::spriteupdate() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); al = data.byte(kRyanon); es.byte(bx+31) = al; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); cx = 16; _tmp18: push(cx); @@ -2248,7 +2248,7 @@ void DreamGenContext::printsprites() { priorityloop: push(cx); data.byte(kPriority) = cl; - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); cx = 16; prtspriteloop: push(cx); @@ -2346,7 +2346,7 @@ void DreamGenContext::checkone() { _mul(cx); si = ax; ds = data.word(kBuffers); - _add(si, (0+(180*10)+32+60+(32*32))); + _add(si, (0+(228*13)+32+60+(32*32))); _lodsw(); cx = ax; _lodsb(); @@ -2810,7 +2810,7 @@ forgotone: void DreamGenContext::initrain() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+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*24)); + 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 = 1113; checkmorerain: al = cs.byte(bx); @@ -2961,7 +2961,7 @@ void DreamGenContext::showrain() { ax = ds.word(si+2); si = ax; _add(si, 2080); - bx = (0+(180*10)+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*24)); + 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)); es = data.word(kBuffers); _cmp(es.byte(bx), 255); if (flags.z()) @@ -3519,7 +3519,7 @@ atlast2: void DreamGenContext::updatepeople() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); data.word(kListpos) = di; cx = 12*5; al = 255; @@ -3674,6 +3674,14 @@ void DreamGenContext::reconstruct() { 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; } @@ -3816,7 +3824,7 @@ bigroom: void DreamGenContext::dumpeverything() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); + 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)); dumpevery1: ax = es.word(bx); cx = es.word(bx+2); @@ -3847,7 +3855,7 @@ skip1: _add(bx, 5); goto dumpevery1; finishevery1: - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5); + 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))+(40*5); dumpevery2: ax = es.word(bx); cx = es.word(bx+2); @@ -3888,7 +3896,7 @@ void DreamGenContext::loadpalfromiff() { readfromfile(); closefile(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); ds = data.word(kMapstore); si = 0x30; cx = 768; @@ -4520,7 +4528,7 @@ void DreamGenContext::dofade() { al = data.byte(kColourpos); ah = 0; ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + si = (0+(228*13)+32+60+(32*32)+(11*10*3)); _add(si, ax); _add(si, ax); _add(si, ax); @@ -4537,7 +4545,7 @@ void DreamGenContext::dofade() { void DreamGenContext::clearendpal() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); cx = 768; al = 0; _stosb(cx, true); @@ -4563,11 +4571,11 @@ void DreamGenContext::fadescreenup() { void DreamGenContext::fadetowhite() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); cx = 768; al = 63; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); al = 0; _stosb(3); paltostartpal(); @@ -4580,11 +4588,11 @@ void DreamGenContext::fadetowhite() { void DreamGenContext::fadefromwhite() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)); cx = 768; al = 63; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)); al = 0; _stosb(3); paltoendpal(); @@ -4610,7 +4618,7 @@ void DreamGenContext::fadescreendownhalf() { paltoendpal(); cx = 768; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); halfend: al = es.byte(bx); _shr(al, 1); @@ -4620,12 +4628,12 @@ halfend: goto halfend; ds = data.word(kBuffers); es = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3); + si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(56*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(56*3); cx = 3*5; _movsb(cx, true); - si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3); + si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(77*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(77*3); cx = 3*2; _movsb(cx, true); data.byte(kFadedirection) = 1; @@ -4667,7 +4675,7 @@ void DreamGenContext::fadescreendowns() { void DreamGenContext::clearstartpal() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)); cx = 256; wholeloop1: ax = 0; @@ -4838,8 +4846,8 @@ void DreamGenContext::fadecalculation() { goto nomorefading; bl = data.byte(kFadecount); es = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + 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); @@ -4873,8 +4881,8 @@ nomorefading: void DreamGenContext::greyscalesum() { STACK_CHECK; es = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); + 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); @@ -4932,8 +4940,8 @@ void DreamGenContext::paltostartpal() { STACK_CHECK; es = data.word(kBuffers); ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + 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); } @@ -4942,8 +4950,8 @@ void DreamGenContext::endpaltostart() { STACK_CHECK; es = data.word(kBuffers); ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); + 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); } @@ -4952,8 +4960,8 @@ void DreamGenContext::startpaltoend() { STACK_CHECK; es = data.word(kBuffers); ds = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + 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); } @@ -4962,8 +4970,8 @@ void DreamGenContext::paltoendpal() { STACK_CHECK; es = data.word(kBuffers); ds = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + 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); } @@ -4972,8 +4980,8 @@ void DreamGenContext::allpalette() { STACK_CHECK; es = data.word(kBuffers); ds = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); + 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(); @@ -4981,7 +4989,7 @@ void DreamGenContext::allpalette() { void DreamGenContext::dumpcurrent() { STACK_CHECK; - si = (0+(180*10)+32+60+(32*32)+(11*10*3)); + si = (0+(228*13)+32+60+(32*32)+(11*10*3)); ds = data.word(kBuffers); vsync(); al = 0; @@ -4998,11 +5006,11 @@ void DreamGenContext::fadedownmon() { paltostartpal(); paltoendpal(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); cx = 3*8; ax = 0; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); _stosb(); _stosw(); data.byte(kFadedirection) = 1; @@ -5018,11 +5026,11 @@ void DreamGenContext::fadeupmon() { paltostartpal(); paltoendpal(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); cx = 3*8; ax = 0; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); data.byte(kFadedirection) = 1; @@ -5038,11 +5046,11 @@ void DreamGenContext::fadeupmonfirst() { paltostartpal(); paltoendpal(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(231*3); cx = 3*8; ax = 0; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); data.byte(kFadedirection) = 1; @@ -5061,11 +5069,11 @@ void DreamGenContext::fadeupyellows() { STACK_CHECK; paltoendpal(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(231*3); cx = 3*8; ax = 0; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768)+(246*3); _stosb(); _stosw(); data.byte(kFadedirection) = 1; @@ -5080,15 +5088,15 @@ void DreamGenContext::initialmoncols() { STACK_CHECK; paltostartpal(); es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); cx = 3*9; ax = 0; _stosb(cx, true); - di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3); + di = (0+(228*13)+32+60+(32*32)+(11*10*3))+(246*3); _stosb(); _stosw(); ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3); + si = (0+(228*13)+32+60+(32*32)+(11*10*3))+(230*3); al = 230; cx = 18; showgroup(); @@ -5507,6 +5515,11 @@ void DreamGenContext::printchar() { push(si); push(bx); push(di); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + _sub(bx, 3); +_tmp1: push(ax); _sub(al, 32); ah = 0; @@ -5578,6 +5591,7 @@ printloopslow5: push(es); push(si); push(ds); + modifychar(); printboth(); ds = pop(); si = pop(); @@ -5601,6 +5615,7 @@ printloopslow5: push(cx); push(es); push(si); + modifychar(); data.word(kCharshift) = 91; printboth(); data.word(kCharshift) = 0; @@ -5714,6 +5729,7 @@ printloop5: goto finishdirct; push(cx); push(es); + modifychar(); printchar(); data.word(kLastxpos) = di; es = pop(); @@ -5770,6 +5786,7 @@ printloop7: nottrigger: push(cx); push(es); + modifychar(); printchar(); data.word(kCurslocx) = di; data.word(kCurslocy) = bx; @@ -5940,6 +5957,7 @@ getloop: _cmp(al, 32); if (flags.z()) goto endword; + modifychar(); _cmp(al, 255); if (flags.z()) goto getloop; @@ -5968,9 +5986,9 @@ endall: void DreamGenContext::fillryan() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32); + di = (0+(228*13)+32); findallryan(); - si = (0+(180*10)+32); + si = (0+(228*13)+32); al = data.byte(kRyanpage); ah = 0; cx = 20; @@ -6022,9 +6040,9 @@ lessthanapage: al = 1; push(ax); es = data.word(kBuffers); - di = (0+(180*10)); + di = (0+(228*13)); findallopen(); - si = (0+(180*10)); + si = (0+(228*13)); di = (80); bx = (58)+96; cx = pop(); @@ -6508,6 +6526,14 @@ void DreamGenContext::describeob() { getobtextstart(); di = 33; bx = 92; + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto notsetd; + _cmp(data.byte(kObjecttype), 1); + if (!flags.z()) + goto notsetd; + bx = 82; +notsetd: dl = 241; ah = 16; data.word(kCharshift) = 91+91; @@ -6515,6 +6541,14 @@ void DreamGenContext::describeob() { data.word(kCharshift) = 0; di = 36; bx = 104; + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto notsetd2; + _cmp(data.byte(kObjecttype), 1); + if (!flags.z()) + goto notsetd2; + bx = 94; +notsetd2: dl = 241; ah = 0; printdirect(); @@ -7349,7 +7383,7 @@ findinv2: data.byte(kLastinvpos) = al; _add(bx, bx); es = data.word(kBuffers); - _add(bx, (0+(180*10)+32)); + _add(bx, (0+(228*13)+32)); } void DreamGenContext::findopenpos() { @@ -7366,7 +7400,7 @@ findopenp1: data.byte(kLastinvpos) = al; _add(bx, bx); es = data.word(kBuffers); - _add(bx, (0+(180*10))); + _add(bx, (0+(228*13))); } void DreamGenContext::dropobject() { @@ -8317,7 +8351,7 @@ void DreamGenContext::calcmapad() { void DreamGenContext::getdimension() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)); + bx = (0+(228*13)+32+60+(32*32)); ch = 0; dimloop1: addalong(); @@ -8327,7 +8361,7 @@ dimloop1: _inc(ch); goto dimloop1; finishdim1: - bx = (0+(180*10)+32+60+(32*32)); + bx = (0+(228*13)+32+60+(32*32)); cl = 0; dimloop2: push(bx); @@ -8340,7 +8374,7 @@ dimloop2: _add(bx, 3); goto dimloop2; finishdim2: - bx = (0+(180*10)+32+60+(32*32))+(11*3*9); + bx = (0+(228*13)+32+60+(32*32))+(11*3*9); dh = 10; dimloop3: push(bx); @@ -8353,7 +8387,7 @@ dimloop3: _sub(bx, 11*3); goto dimloop3; finishdim3: - bx = (0+(180*10)+32+60+(32*32))+(3*10); + bx = (0+(228*13)+32+60+(32*32))+(3*10); dl = 11; dimloop4: push(bx); @@ -8435,7 +8469,7 @@ gotlength: void DreamGenContext::drawflags() { STACK_CHECK; es = data.word(kBuffers); - di = (0+(180*10)+32+60+(32*32)); + di = (0+(228*13)+32+60+(32*32)); al = data.byte(kMapy); ah = 0; cx = (66); @@ -8477,7 +8511,7 @@ void DreamGenContext::eraseoldobs() { if (flags.z()) return /* (donterase) */; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); cx = 16; oberase: push(cx); @@ -8501,7 +8535,7 @@ notthisob: void DreamGenContext::showallobs() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); data.word(kListpos) = bx; di = bx; cx = 128*5; @@ -8622,9 +8656,9 @@ usedpriority: void DreamGenContext::showallfree() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); data.word(kListpos) = bx; - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); cx = 80*5; al = 255; _stosb(cx, true); @@ -8703,9 +8737,9 @@ over138: void DreamGenContext::showallex() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); data.word(kListpos) = bx; - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); cx = 100*5; al = 255; _stosb(cx, true); @@ -9572,6 +9606,15 @@ alreadyinfo: di = 60; bx = 72+55; showframe(); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + al = 4; + ah = 0; + di = 60; + bx = 72+55+21; + showframe(); +_tmp1: bx = pop(); bh = 0; _add(bx, bx); @@ -9581,6 +9624,11 @@ alreadyinfo: findnextcolon(); di = 63; bx = 84; + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp2; + bx = 84+4; +_tmp2: dl = 191; al = 0; ah = 0; @@ -11052,6 +11100,7 @@ curfileloop: return /* (finishfile) */; _inc(si); push(si); + modifychar(); ds = data.word(kTempcharset); ah = 0; printchar(); @@ -11150,6 +11199,12 @@ void DreamGenContext::printcurs() { 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); @@ -11175,6 +11230,11 @@ flashcurs: _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(); @@ -11196,6 +11256,12 @@ void DreamGenContext::delcurs() { 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); @@ -12654,6 +12720,11 @@ void DreamGenContext::usecashcard() { showman(); di = 114; bx = 120; + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + bx = 120-3; +_tmp1: ds = data.word(kTempgraphics); al = 39; ah = 0; @@ -13595,7 +13666,7 @@ void DreamGenContext::removefreeobject() { void DreamGenContext::findormake() { STACK_CHECK; - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + 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)); push(ax); es = data.word(kBuffers); ah = data.byte(kReallocation); @@ -13635,7 +13706,7 @@ void DreamGenContext::switchryanoff() { void DreamGenContext::setallchanges() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + 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)); setallloop: ax = es.word(bx); _cmp(al, 255); @@ -13769,30 +13840,40 @@ notonsartroof: void DreamGenContext::getundertimed() { STACK_CHECK; al = data.byte(kTimedy); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + _sub(al, 3); +_tmp1: ah = 0; bx = ax; al = data.byte(kTimedx); ah = 0; di = ax; - ch = (24); + ch = (30); cl = 240; ds = data.word(kBuffers); - si = (0+(180*10)+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)); + 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::putundertimed() { STACK_CHECK; al = data.byte(kTimedy); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + _sub(al, 3); +_tmp1: ah = 0; bx = ax; al = data.byte(kTimedx); ah = 0; di = ax; - ch = (24); + ch = (30); cl = 240; ds = data.word(kBuffers); - si = (0+(180*10)+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)); + 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(); } @@ -13802,13 +13883,18 @@ void DreamGenContext::dumptimedtext() { if (!flags.z()) return /* (nodumptimed) */; al = data.byte(kTimedy); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + _sub(al, 3); +_tmp1: ah = 0; bx = ax; al = data.byte(kTimedx); ah = 0; di = ax; cl = 240; - ch = (24); + ch = (30); multidump(); data.byte(kNeedtodumptimed) = 0; } @@ -14750,7 +14836,7 @@ void DreamGenContext::getundermenu() { cl = 48; ch = 48; ds = data.word(kBuffers); - si = (0+(180*10)+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)); + 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(); } @@ -14761,7 +14847,7 @@ void DreamGenContext::putundermenu() { cl = 48; ch = 48; ds = data.word(kBuffers); - si = (0+(180*10)+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)); + 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(); } @@ -16586,7 +16672,7 @@ void DreamGenContext::namestoold() { STACK_CHECK; ds = cs; si = 8579; - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + 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); @@ -16596,7 +16682,7 @@ void DreamGenContext::oldtonames() { STACK_CHECK; es = cs; di = 8579; - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + 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); @@ -16639,7 +16725,7 @@ void DreamGenContext::saveposition() { dx = (0); saveseg(); ds = data.word(kBuffers); - dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + 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; @@ -16688,7 +16774,7 @@ void DreamGenContext::loadposition() { dx = (0); loadseg(); ds = data.word(kBuffers); - dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + 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; @@ -17625,7 +17711,7 @@ void DreamGenContext::allocatebuffers() { allocatemem(); data.word(kMapdata) = ax; trysoundalloc(); - bx = (0+(180*10)+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*24)+(6*64)+991-534+68-0)/16; + 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(); @@ -17652,7 +17738,7 @@ void DreamGenContext::allocatebuffers() { void DreamGenContext::clearbuffers() { STACK_CHECK; es = data.word(kBuffers); - cx = (0+(180*10)+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*24)+(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)+991-534+68-0)/2; ax = 0; di = 0; _stosw(cx, true); @@ -17662,13 +17748,13 @@ void DreamGenContext::clearbuffers() { di = 0; _stosw(cx, true); es = data.word(kBuffers); - di = (0+(180*10)+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*24)+(6*64)); + 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); _movsb(cx, true); es = data.word(kBuffers); - di = (0+(180*10)+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*24)+(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)+991-534); ds = cs; si = 0; cx = (68-0); @@ -17681,16 +17767,16 @@ void DreamGenContext::clearchanges() { es = data.word(kBuffers); cx = (250)*2; ax = 0x0ffff; - di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); + 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)); _stosw(cx, true); ds = data.word(kBuffers); - si = (0+(180*10)+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*24)+(6*64)); + 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); _movsb(cx, true); ds = data.word(kBuffers); - si = (0+(180*10)+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*24)+(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)+991-534); es = cs; di = 0; cx = (68-0); @@ -18478,7 +18564,7 @@ nothingund: void DreamGenContext::checkifperson() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); cx = 12; identifyreel: push(cx); @@ -18541,7 +18627,7 @@ notareelid: void DreamGenContext::checkifset() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5); cx = 127; identifyset: _cmp(es.byte(bx+4), 255); @@ -18582,7 +18668,7 @@ notasetid: void DreamGenContext::checkifex() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5); cx = 99; identifyex: _cmp(es.byte(bx+4), 255); @@ -18617,7 +18703,7 @@ notanexid: void DreamGenContext::checkiffree() { STACK_CHECK; es = data.word(kBuffers); - bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); + bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5); cx = 79; identifyfree: _cmp(es.byte(bx+4), 255); @@ -20206,7 +20292,7 @@ void DreamGenContext::getunderzoom() { di = (8)+5; bx = (132)+4; ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + 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(); @@ -20229,7 +20315,7 @@ void DreamGenContext::putunderzoom() { di = (8)+5; bx = (132)+4; ds = data.word(kBuffers); - si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); + 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(); @@ -20296,7 +20382,7 @@ notsmally: data.byte(kPointerys) = ch; push(ds); ds = data.word(kBuffers); - si = (0+(180*10)+32+60); + si = (0+(228*13)+32+60); multiget(); ds = pop(); di = pop(); @@ -20359,7 +20445,7 @@ notsmally2: _sub(data.word(kOldpointery), ax); _sub(bx, ax); ds = data.word(kBuffers); - si = (0+(180*10)+32+60); + si = (0+(228*13)+32+60); multiget(); ds = pop(); di = pop(); @@ -20389,7 +20475,7 @@ void DreamGenContext::delpointer() { ch = data.byte(kPointerys); data.byte(kDelys) = ch; ds = data.word(kBuffers); - si = (0+(180*10)+32+60); + si = (0+(228*13)+32+60); di = data.word(kDelherex); bx = data.word(kDelherey); multiput(); @@ -20421,10 +20507,15 @@ 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 = (180); - ch = (10); + cl = (228); + ch = (13); multiget(); } @@ -20432,10 +20523,15 @@ void DreamGenContext::deltextline() { 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 = (180); - ch = (10); + cl = (228); + ch = (13); multiput(); } @@ -20447,8 +20543,13 @@ void DreamGenContext::dumptextline() { data.byte(kNewtextline) = 0; di = data.word(kTextaddressx); bx = data.word(kTextaddressy); - cl = (180); - ch = (10); + _cmp(data.byte(kForeignrelease), 0); + if (flags.z()) + goto _tmp1; + _sub(bx, 3); +_tmp1: + cl = (228); + ch = (13); multidump(); } @@ -21971,7 +22072,7 @@ void DreamGenContext::__start() { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5a60327a43..71c466da24 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -488,7 +488,8 @@ public: const static uint16 kRecname = 8789; const static uint16 kQuitrequested = 8802; const static uint16 kSubtitles = 8803; - const static uint16 kStak = 8804; + const static uint16 kForeignrelease = 8804; + const static uint16 kStak = 8805; const static uint16 kBlocktextdat = (0); const static uint16 kPersonframes = (0); const static uint16 kDebuglevel1 = (0); @@ -502,7 +503,6 @@ public: const static uint16 kFlags = (0); const static uint16 kGerman = (0); const static uint16 kTextunder = (0); - const static uint16 kForeign = (0); const static uint16 kPathdata = (0); const static uint16 kDemo = (0); const static uint16 kExframedata = (0); @@ -510,26 +510,26 @@ public: const static uint16 kFreetextdat = (0); const static uint16 kFrframedata = (0); const static uint16 kSettext = (0+(130*2)); - const static uint16 kOpeninvlist = (0+(180*10)); - const static uint16 kRyaninvlist = (0+(180*10)+32); - const static uint16 kPointerback = (0+(180*10)+32+60); - const static uint16 kMapflags = (0+(180*10)+32+60+(32*32)); - const static uint16 kStartpal = (0+(180*10)+32+60+(32*32)+(11*10*3)); - const static uint16 kEndpal = (0+(180*10)+32+60+(32*32)+(11*10*3)+768); - const static uint16 kMaingamepal = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768); - const static uint16 kSpritetable = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768); - const static uint16 kSetlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); - const static uint16 kFreelist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); - const static uint16 kExlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); - const static uint16 kPeoplelist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); - const static uint16 kZoomspace = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)); - const static uint16 kPrintedlist = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)); - const static uint16 kListofchanges = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - const static uint16 kUndertimedtext = (0+(180*10)+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)); - const static uint16 kRainlist = (0+(180*10)+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*24)); - const static uint16 kInitialreelrouts = (0+(180*10)+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*24)+(6*64)); - const static uint16 kInitialvars = (0+(180*10)+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*24)+(6*64)+991-534); - const static uint16 kLengthofbuffer = (0+(180*10)+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*24)+(6*64)+991-534+68-0); + const static uint16 kOpeninvlist = (0+(228*13)); + const static uint16 kRyaninvlist = (0+(228*13)+32); + const static uint16 kPointerback = (0+(228*13)+32+60); + const static uint16 kMapflags = (0+(228*13)+32+60+(32*32)); + const static uint16 kStartpal = (0+(228*13)+32+60+(32*32)+(11*10*3)); + const static uint16 kEndpal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768); + const static uint16 kMaingamepal = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768); + const static uint16 kSpritetable = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); + const static uint16 kSetlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)); + const static uint16 kFreelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)); + const static uint16 kExlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)); + const static uint16 kPeoplelist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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)); + const static 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); + const static 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); const static uint16 kReellist = (0+(36*144)); const static uint16 kIntext = (0+(38*2)); const static uint16 kLengthofmap = (0+(66*60)); @@ -546,16 +546,17 @@ public: const static uint16 kPersontxtdat = (0+24); const static uint16 kPersontext = (0+24+(1026*2)); const static uint16 kInputport = (0x63); + const static uint16 kForeign = (1); const static uint16 kCd = (1); - const static uint16 kUndertextsizey = (10); const static uint16 kNumexobjects = (114); + const static uint16 kUndertextsizey = (13); const static uint16 kZoomy = (132); const static uint16 kFreedatlen = (16*80); - const static uint16 kUndertextsizex = (180); const static uint16 kExtextlen = (18000); const static uint16 kLenofmapstore = (22*8*20*8); - const static uint16 kUndertimedysize = (24); + const static uint16 kUndertextsizex = (228); const static uint16 kNumchanges = (250); + const static uint16 kUndertimedysize = (30); const static uint16 kExframeslen = (30000); const static uint16 kTablesize = (32); const static uint16 kScreenwidth = (320); @@ -718,6 +719,7 @@ public: void addtopeoplelist(); void hangoncurs(); void sparkydrip(); + void modifychar(); void compare(); void printcurs(); void convertkey(); diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 590f071b6b..e8152e9963 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -568,6 +568,9 @@ void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { file.close(); } +uint8 DreamWebEngine::modifyChar(uint8 c) const { + return c; +} } // End of namespace DreamWeb diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index e0797bc96b..b1a68dbc20 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -107,6 +107,8 @@ public: void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } + uint8 modifyChar(uint8 c) const; + private: void keyPressed(uint16 ascii); void setSpeed(uint speed); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 1869f1b109..55e5fba2ac 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -525,4 +525,8 @@ void DreamGenContext::frameoutv() { } } +void DreamGenContext::modifychar() { + al = engine->modifyChar(al); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 545e482b5ad5cd440070904dc4446f1569d2b066 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 18:20:19 +0400 Subject: DREAMWEB: Reimplemented modifychar and language switching --- engines/dreamweb/detection.cpp | 10 -------- engines/dreamweb/dreamweb.cpp | 55 +++++++++++++++++++++++++++++++++++++++++- engines/dreamweb/dreamweb.h | 8 +++++- engines/dreamweb/stubs.cpp | 9 +++++++ 4 files changed, 70 insertions(+), 12 deletions(-) diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 47e25ded33..d32be6a2b7 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -30,16 +30,6 @@ #include "dreamweb/dreamweb.h" -#include "engines/advancedDetector.h" - -namespace DreamWeb { - -struct DreamWebGameDescription { - ADGameDescription desc; -}; - -} // End of namespace DreamWeb - static const PlainGameDescriptor dreamWebGames[] = { { "dreamweb", "DreamWeb" }, { 0, 0 } diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index e8152e9963..74fcf33407 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -65,6 +65,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _oldMouseState = 0; _channel0 = 0; _channel1 = 0; + + _language = gameDesc->desc.language; } DreamWebEngine::~DreamWebEngine() { @@ -569,7 +571,58 @@ void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { } uint8 DreamWebEngine::modifyChar(uint8 c) const { - return c; + if (c < 128) + return c; + + switch(_language) { + case Common::DE_DEU: + switch(c) + { + case 129: + return 'Z' + 3; + case 132: + return 'Z' + 1; + case 142: + return 'Z' + 4; + case 154: + return 'Z' + 6; + case 255: + return 'A' - 1; + case 153: + return 'Z' + 5; + case 148: + return 'Z' + 2; + default: + return c; + } + case Common::ES_ESP: + switch(c) { + case 160: + return 'Z' + 1; + case 130: + return 'Z' + 2; + case 161: + return 'Z' + 3; + case 162: + return 'Z' + 4; + case 163: + return 'Z' + 5; + case 164: + return 'Z' + 6; + case 165: + return ',' - 1; + case 168: + return 'A' - 1; + case 173: + return 'A' - 4; + case 129: + return 'A' - 5; + default: + return c; + } + default: + return c; + } } } // End of namespace DreamWeb diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index b1a68dbc20..7323cfe836 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -37,7 +37,9 @@ #include "audio/audiostream.h" #include "audio/mixer.h" +#include "engines/advancedDetector.h" #include "engines/engine.h" + #include "dreamweb/dreamgen.h" #include "dreamweb/console.h" @@ -49,7 +51,9 @@ enum { kDebugSaveLoad = (1 << 1) }; -struct DreamWebGameDescription; +struct DreamWebGameDescription { + ADGameDescription desc; +}; class DreamWebEngine : public Engine { private: @@ -107,6 +111,7 @@ public: void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } + Common::Language getLanguage() const { return _language; } uint8 modifyChar(uint8 c) const; private: @@ -127,6 +132,7 @@ private: uint _oldMouseState; int _loadSavefile; bool _enableSavingOrLoading; + Common::Language _language; struct Sample { uint offset; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 55e5fba2ac..43be0917e6 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -239,6 +239,15 @@ void DreamGenContext::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() { -- cgit v1.2.3 From dfb041ee2b15708e5f3309da67e4171f4f79565e Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 18:27:59 +0400 Subject: DREAMWEB: Added missing syncSoundSettings() --- engines/dreamweb/dreamweb.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 74fcf33407..5d54f734e6 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -216,6 +216,7 @@ void DreamWebEngine::processEvents() { Common::Error DreamWebEngine::run() { + syncSoundSettings(); _console = new DreamWebConsole(this); _loadSavefile = Common::ConfigManager::instance().getInt("save_slot"); -- cgit v1.2.3 From 08c8d3ca1014a8242b6162b9d3f637ad601bf9ec Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 18:46:10 +0400 Subject: DREAMWEB: Minor cleanup in playSound, added kSpeechSoundType for speech --- engines/dreamweb/dreamweb.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 5d54f734e6..eebadfddae 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -420,17 +420,21 @@ void DreamWebEngine::cls() { void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) { debug(1, "playSound(%u, %u, %u)", channel, id, loops); - const SoundData &data = _soundData[id >= 12? 1: 0]; - Audio::Mixer::SoundType type; - bool speech = id == 62; //actually 50 + int bank = 0; + bool speech = false; + Audio::Mixer::SoundType type = channel == 0? + Audio::Mixer::kMusicSoundType: Audio::Mixer::kSFXSoundType; + if (id >= 12) { id -= 12; - type = Audio::Mixer::kSFXSoundType; - } else if (speech) - type = Audio::Mixer::kSpeechSoundType; - else - type = Audio::Mixer::kMusicSoundType; + bank = 1; + if (id == 50) { + speech = true; + type = Audio::Mixer::kSpeechSoundType; + } + } + const SoundData &data = _soundData[bank]; Audio::SeekableAudioStream *raw; if (!speech) { -- cgit v1.2.3 From b60d864e6b36145ad9880b9a16eb28df792b589f Mon Sep 17 00:00:00 2001 From: athrxx Date: Sat, 25 Jun 2011 16:56:55 +0200 Subject: TASKBAR: initialize _taskBar with NULL in constructor --- backends/taskbar/win32/win32-taskbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 0cfd81e3f2..7d063f49ba 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -66,7 +66,7 @@ // System.Title property key, values taken from http://msdn.microsoft.com/en-us/library/bb787584.aspx const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; -Win32TaskbarManager::Win32TaskbarManager() { +Win32TaskbarManager::Win32TaskbarManager() : _taskbar(NULL) { // Do nothing if not running on Windows 7 or later if (!isWin7OrLater()) return; -- cgit v1.2.3 From b66ca6008873ac8a321ffee042b77019c7f4beb3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 25 Jun 2011 19:25:56 +0200 Subject: KYRA: _athrxx is the new Kyra maintainer. --- engines/kyra/kyra_v1.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index c5bf2d2960..83455f3922 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -73,27 +73,21 @@ class KyraMetaEngine; * Kyrandia 2 Russian (no feature request) * Kyrandia 3 Russian (feature request #2812792 "Kyrandia3 Russian") * - * The primary maintainer for the engine is LordHoto, although some parts are maintained by _athrxx. - * If you have questions about parts of the code, the following rough description might help in - * determining who you should ask: - * _athrxx is the maintainer for the Lands of Lore subengine, he also maintains most of the FM-TOWNS - * and PC98 specific code (especially the sound code, also some ingame code) and the Kyrandia 2 - * sequence player code. - * LordHoto is responsible for the rest of the codebase, he also worked on the graphics output for 16 - * color PC98 games. + * The engine is maintained by _athrxx. * * Other people who worked on this engine include cyx, who initially started to work on Kyrandia 1 * support, vinterstum, who did various things for Kyrandia 1 and started to work on the Kyrandia 2 * sequence player code and also on the TIM script code, and eriktorbjorn, who helped out naming * our AdLib player code and also contributed a work around for a music bug in the "Pool of Sorrow" - * scene of Kyrandia 1, which is also present in the original. All three mentioned developers are - * not actively working on KYRA anymore. + * scene of Kyrandia 1, which is also present in the original. LordHoto worked on Kyrandia 1 to 3 + * support and graphics output for 16 color PC98 games and was a maintainer of the Kyrandia part. + * All mentioned developers are not actively working on KYRA anymore. * * The engine is mostly finished code wise. A possible remaining task is proper refactoring, * which might help in reducing binary size and along with it runtime memory use, but of course * might lead to regressions (since the current code makes no problems on our low end ports, it * is pretty minor priority though, since the benefit would be mostly nicer code). The biggest - * task left is the kyra.dat handling, which is currently being revised by LordHoto. + * task left is the kyra.dat handling. * * Games using this engine: * - The Legend of Kyrandia (fully supported, except for Macintosh port, which lacks sound) -- cgit v1.2.3 From 77458508085d8a03336472dd10da895deb6b8281 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 21:51:27 +0400 Subject: DREAMWEB: Save registers in vsync, like in original sources --- engines/dreamweb/stubs.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 43be0917e6..5614aa391a 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -434,7 +434,23 @@ void DreamGenContext::doshake() { } void DreamGenContext::vsync() { + push(ax); + push(bx); + push(cx); + push(dx); + push(si); + push(di); + push(es); + push(ds); engine->waitForVSync(); + ds = pop(); + es = pop(); + di = pop(); + si = pop(); + dx = pop(); + cx = pop(); + bx = pop(); + ax = pop(); } void DreamGenContext::setmode() { -- cgit v1.2.3 From 4cbf30a88ca3cadb6f28a525f95578146d91037a Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 21:52:46 +0400 Subject: DREAMWEB: Removed workaround of invalid size of extext data --- devtools/tasmrecover/dreamweb/object.asm | 4 +--- engines/dreamweb/dreamgen.cpp | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm index bc73ef5679..830c9676f3 100644 --- a/devtools/tasmrecover/dreamweb/object.asm +++ b/devtools/tasmrecover/dreamweb/object.asm @@ -2586,10 +2586,8 @@ findlenextext: mov cl,[es:si] sub bx,extext push bx ax sub cx,bx - cmp cx, 0xffff; BIG FIXME! Find out why this is happening - jz $1 rep movsb -$1: pop bx + pop bx sub extextpos,bx pop si diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 2afd1bc357..a183c7c798 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -8271,11 +8271,7 @@ findlenextext: push(bx); push(ax); _sub(cx, bx); - _cmp(cx, 0xffff); - if (flags.z()) - goto _tmp1; _movsb(cx, true); -_tmp1: bx = pop(); _sub(data.word(kExtextpos), bx); si = pop(); -- cgit v1.2.3 From bc4691a23e0ff1ff6f2452d7ad5d4cd612ad06a1 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 25 Jun 2011 21:15:34 +0200 Subject: SCI: Fix incorrect usage of sizeof Thanks to salty-horse for the reports. --- engines/sci/decompressor.cpp | 5 +++-- engines/sci/engine/vm.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index 7e7acab994..82af6eca43 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -257,7 +257,8 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac init(src, dest, nPacked, nUnpacked); byte *stak = (byte *)malloc(0x1014); - Tokenlist *tokens = (Tokenlist *)malloc(0x1004 * sizeof(Tokenlist)); + unsigned int tokensSize = 0x1004 * sizeof(Tokenlist); + Tokenlist *tokens = (Tokenlist *)malloc(tokensSize); if (!stak || !tokens) { free(stak); free(tokens); @@ -265,7 +266,7 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac error("[DecompressorLZW::unpackLZW1] Cannot allocate decompression buffers"); } - memset(tokens, 0, sizeof(tokens)); + memset(tokens, 0, tokensSize); byte lastchar = 0; uint16 stakptr = 0, lastbits = 0; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index db682de16f..274b0bbbc9 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -462,7 +462,7 @@ int readPMachineInstruction(const byte *src, byte &extOpcode, int16 opparams[4]) extOpcode = src[offset++]; // Get "extended" opcode (lower bit has special meaning) const byte opcode = extOpcode >> 1; // get the actual opcode - memset(opparams, 0, sizeof(opparams)); + memset(opparams, 0, 4*sizeof(int16)); for (int i = 0; g_opcode_formats[opcode][i]; ++i) { //debugN("Opcode: 0x%x, Opnumber: 0x%x, temp: %d\n", opcode, opcode, temp); -- cgit v1.2.3 From d21402ef3c39e8a4664e36417d8192208a21b148 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 25 Jun 2011 21:33:01 +0200 Subject: HUGO: Fix incorrect usage of sizeof Thanks to salty-horse for the report. The new sizes are the ones that were replaced by sizeof in 399b59a583b. --- engines/hugo/file_v1d.cpp | 2 +- engines/hugo/file_v1w.cpp | 2 +- engines/hugo/file_v2d.cpp | 2 +- engines/hugo/file_v3d.cpp | 4 ++-- engines/hugo/hugo.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp index 9ebd9d284c..0795923536 100644 --- a/engines/hugo/file_v1d.cpp +++ b/engines/hugo/file_v1d.cpp @@ -62,7 +62,7 @@ void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]); if (!Common::File::exists(buf)) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); warning("File not found: %s", buf.c_str()); return; } diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp index eb2226f18a..162019dd2e 100644 --- a/engines/hugo/file_v1w.cpp +++ b/engines/hugo/file_v1w.cpp @@ -80,7 +80,7 @@ void FileManager_v1w::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } _sceneryArchive1.read(tmpImage, kOvlSize); diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp index 2a663edcfa..7e44e756d5 100644 --- a/engines/hugo/file_v2d.cpp +++ b/engines/hugo/file_v2d.cpp @@ -136,7 +136,7 @@ void FileManager_v2d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp index 7ac0ffc48a..69371bb030 100644 --- a/engines/hugo/file_v3d.cpp +++ b/engines/hugo/file_v3d.cpp @@ -143,7 +143,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } @@ -182,7 +182,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove break; } if (i == 0) { - memset(image, 0, sizeof(image)); + memset(image, 0, kOvlSize); return; } diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 7b54c7701d..df8abf32eb 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -463,7 +463,7 @@ bool HugoEngine::loadHugoDat() { if (varnt == _gameVariant) { _numStates = numElem; _screenStates = (byte *)malloc(sizeof(byte) * numElem); - memset(_screenStates, 0, sizeof(_screenStates)); + memset(_screenStates, 0, sizeof(byte) * numElem); } } -- cgit v1.2.3 From d413494f5b0485008bbc6074fca07bb00f448c40 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sat, 25 Jun 2011 22:12:52 +0400 Subject: DREAMWEB: Added assert on memcpy overlap --- engines/dreamweb/runtime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 724d5e4053..2951ad85d7 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -466,6 +466,7 @@ public: assert(size != 0xffff); uint8 *dst = es.ptr(di, size); uint8 *src = ds.ptr(si, size); + assert(src < dst || src >= dst + size); memcpy(dst, src, size); di += size; si += size; -- cgit v1.2.3 From 52a4f94ed21117443b003be251c92fcbb0a3cdf1 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 26 Jun 2011 02:39:47 +0400 Subject: DREAMWEB: Added italian floppy release --- engines/dreamweb/detection_tables.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h index 0208b7ebbf..0449361a98 100644 --- a/engines/dreamweb/detection_tables.h +++ b/engines/dreamweb/detection_tables.h @@ -132,6 +132,23 @@ static const DreamWebGameDescription gameDescriptions[] = { }, }, + // Italian floppy release + { + { + "dreamweb", + "", + { + {"dreamweb.r00", 0, "66dcab08354232f423c590156335f819", 155448}, + {"dreamweb.r02", 0, "87a026e9f80ed4f94169381f871ee305", 199676}, + AD_LISTEND + }, + Common::IT_ITA, + Common::kPlatformPC, + ADGF_UNSTABLE, + GUIO_NONE + }, + }, + { AD_TABLE_END_MARKER } }; -- cgit v1.2.3 From bfdf12ad2f9f4bc07561ce386928e41ffa31af4f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 26 Jun 2011 01:52:53 +0300 Subject: I18N: Update Russian translation --- gui/themes/translations.dat | Bin 220969 -> 226329 bytes po/ru_RU.po | 208 ++++++++++++++++++++++++-------------------- 2 files changed, 115 insertions(+), 93 deletions(-) mode change 100644 => 100755 gui/themes/translations.dat diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat old mode 100644 new mode 100755 index f218747182..5ed267370c Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ diff --git a/po/ru_RU.po b/po/ru_RU.po index ae5bbdb448..27bea4eac2 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -519,7 +519,7 @@ msgstr " #: gui/massadd.cpp:246 #, c-format msgid "Discovered %d new games, ignored %d previously added games." -msgstr "" +msgstr "½ÐÙÔÕÝÞ %d ÝÞÒëå ØÓà, ßàÞßãéÕÝÞ %Ò àÐÝÕÕ ÔÞÑÐÒÛÕÝÝëå ØÓà." #: gui/massadd.cpp:250 #, c-format @@ -527,9 +527,9 @@ msgid "Scanned %d directories ..." msgstr "¿àÞáÜÞâàÕÝÞ %d ÔØàÕÚâÞàØÙ ..." #: gui/massadd.cpp:253 -#, fuzzy, c-format +#, c-format msgid "Discovered %d new games, ignored %d previously added games ..." -msgstr "½ÐÙÔÕÝÞ %d ÝÞÒëå ØÓà ..." +msgstr "½ÐÙÔÕÝÞ %d ÝÞÒëå ØÓà, ßàÞßãéÕÝÞ %d àÐÝÕÕ ÔÞÑÐÒÛÕÝÝëå ØÓà ..." #: gui/options.cpp:72 msgid "Never" @@ -579,19 +579,19 @@ msgstr " #: gui/options.cpp:372 msgid "Failed to apply some of the graphic options changes:" -msgstr "" +msgstr "½Õ ãÔÐÛÞáì ßàØÜÕÝØâì Ø×ÜÕÝÕÝØï ÝÕÚâÞàëå ÓàÐäØçÕáÚØå ÞßæØÙ:" #: gui/options.cpp:384 msgid "the video mode could not be changed." -msgstr "" +msgstr "ÒØÔÕÞàÕÖØÜ ÝÕ ÜÞÖÕâ Ñëâì Ø×ÜÕÝñÝ." #: gui/options.cpp:390 msgid "the fullscreen setting could not be changed" -msgstr "" +msgstr "ßÞÛÝÞíÚàÐÝÝëÙ àÕÖØÜ ÝÕ ÜÞÖÕâ Ñëâì Ø×ÜÕÝñÝ" #: gui/options.cpp:396 msgid "the aspect ratio setting could not be changed" -msgstr "" +msgstr "àÕÖØÜ ÚÞààÕÚâØàÞÒÚØ áÞÞâÝÞèÕÝØï áâÞàÞÝ ÝÕ ÜÞÖÕâ Ñëâì Ø×ÜÕÝñÝ" #: gui/options.cpp:705 msgid "Graphics mode:" @@ -904,7 +904,6 @@ msgid "Language of ScummVM GUI" msgstr "Ï×ëÚ ÓàÐäØçÕáÚÞÓÞ ØÝâÕàäÕÙáÐ ScummVM" #: gui/options.cpp:1295 -#, fuzzy msgid "You have to restart ScummVM before your changes will take effect." msgstr "²ë ÔÞÛÖÝë ßÕàÕ×ÐßãáâØâì ScummVM çâÞÑë ßàØÜÕÝØâì Ø×ÜÕÝÕÝØï." @@ -1091,7 +1090,7 @@ msgstr " #: common/error.cpp:71 msgid "User canceled" -msgstr "" +msgstr "¿àÕàÒÐÝÞ ßÞÛì×ÞÒÐâÕÛÕÜ" #: common/error.cpp:75 msgid "Unknown error" @@ -1118,15 +1117,15 @@ msgstr "Hercules #: engines/advancedDetector.cpp:296 #, c-format msgid "The game in '%s' seems to be unknown." -msgstr "" +msgstr "ºÐÖÕâáï, çâÞ ØÓàÐ '%s' Õéñ ÝÕØ×ÒÕáâÝÐ." #: engines/advancedDetector.cpp:297 msgid "Please, report the following data to the ScummVM team along with name" -msgstr "" +msgstr "¿ÞÖÐÛãÙáâÐ, ßÕàÕÔÐÙâÕ áÛÕÔãîéØÕ ÔÐÝÝëÕ ÚÞÜÐÝÔÕ ScummVM ÒÜÕáâÕ á ÝÐ×ÒÐÝØÕÜ" #: engines/advancedDetector.cpp:299 msgid "of the game you tried to add and its version/language/etc.:" -msgstr "" +msgstr "ØÓàë, ÚÞâÞàãî Òë ßëâÐÕâÕáì ÔÞÑÐÒØâì, Ø ãÚÐÖØâÕ Õñ ÒÕàáØî, ï×ëÚ Ø â.Ô." #: engines/dialogs.cpp:84 msgid "~R~esume" @@ -1182,6 +1181,9 @@ msgid "" "the README for basic information, and for instructions on how to obtain " "further assistance." msgstr "" +"¿àÞáØÜ ßàÞéÕÝØï, ÝÞ íâÞâ ÔÒØÖÞÕ ßÞÚÐ ÝÕ ßàÕÔÞáâÐÒÛïÕâ ßÞÜÞéØ ÒÝãâàØ ØÓàë. " +"¿ÞÖÐÛãÙáâÐ, ÞÑàÐâØâÕáì Ò äÐÙÛ README ×Ð ÑÐ×ÞÒÞÙ ØÝäÞàÜÐæØÕÙ, Ð âÐÚÖÕ ØÝáâàãÚæØïÜØ " +"Þ âÞÜ, ÚÐÚ ßÞÛãçØâì ÔÐÛìÝÕÙèãî ßÞÜÞéì." #: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100 #: engines/mohawk/dialogs.cpp:152 @@ -1199,21 +1201,19 @@ msgstr "~ #: engines/engine.cpp:220 msgid "Could not initialize color format." -msgstr "" +msgstr "½Õ ÜÞÓã ØÝØæØÐÛØ×ØàÞÒÐâì äÞàÜÐâ æÒÕâÐ." #: engines/engine.cpp:228 -#, fuzzy msgid "Could not switch to video mode: '" -msgstr "ÂÕÚãéØÙ ÒØÔÕÞàÕÖØÜ:" +msgstr "½Õ ÜÞÓã ßÕàÕÚÛîçØâì ÒØÔÕÞàÕÖØÜ:" #: engines/engine.cpp:237 -#, fuzzy msgid "Could not apply aspect ratio setting." -msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" +msgstr "½Õ ãÔÐÛÞáì ØáßÞÛì×ÞÒÐâì ÚÞààÕÚæØî áÞÞâÝÞèÕÝØï áâÞàÞÝ." #: engines/engine.cpp:242 msgid "Could not apply fullscreen setting." -msgstr "" +msgstr "½Õ ÜÞÓã ßàØÜÕÝØâì ßÞÛÝÞíÚàÐÝÝëÙ àÕÖØÜ." #: engines/engine.cpp:342 msgid "" @@ -1223,6 +1223,11 @@ msgid "" "the data files to your hard disk instead.\n" "See the README file for details." msgstr "" +"ºÐÖÕâáï, Òë ßëâÐÕâÕáì ×ÐßãáâØâì íâã ØÓàã ßàïÜÞ\n" +"á CD. ÍâÞ ÞÑëçÝÞ Òë×ëÒÐÕâ ßàÞÑÛÕÜë, Ø ßÞíâÞÜã\n" +"Üë àÕÚÞÜÕÝÔãÕÜ áÚÞßØàÞÒÐâì äÐÙÛë ÔÐÝÝëå ØÓàë\n" +"ÝÐ ÖñáâÚØÙ ÔØáÚ. ¿ÞÔàÞÑÝÞáâØ ÜÞÖÝÞ ÝÐÙâØ Ò\n" +"äÐÙÛÕ README." #: engines/engine.cpp:353 msgid "" @@ -1232,6 +1237,12 @@ msgid "" "order to listen to the game's music.\n" "See the README file for details." msgstr "" +"´ØáÚ íâÞÙ ØÓàë áÞÔÕàÖØâ ×ÒãÚÞÒëÕ ÔÞàÞÖÚØ. ¸å\n" +"ÝÕÞÑåÞÔØÜÞ ßÕàÕßØáÐâì á ÔØáÚÐ á ßÞÜÞéìî\n" +"áÞÞâÒÕâáâÒãîéÕÙ ßàÞÓàÐÜÜë ÔÛï ÚÞßØàÞÒÐÝØï\n" +"ÐãÔØÞ ÔØáÚÞÒ, Ø âÞÛìÚÞ ßÞáÛÕ íâÞÓÞ Ò ØÓàÕ\n" +"ßÞïÒØâáï Üã×ëÚÐ. ¿ÞÔàÞÑÝÞáâØ ÜÞÖÝÞ ÝÐÙâØ Ò\n" +"äÐÙÛÕ README." #: engines/engine.cpp:405 msgid "" @@ -1239,10 +1250,13 @@ msgid "" "ScummVM. As such, it is likely to be unstable, and any saves you make might " "not work in future versions of ScummVM." msgstr "" +"¿Àµ´Ã¿Àµ¶¶µ½¸µ: ¸ÓàÐ, ÚÞâÞàãî Òë áÞÑØàÐÕâÕáì ×ÐßãáâØâì Õéñ ÝÕ ßÞÔÔÕàÖØÒÐÕâáï " +"ScummVM ßÞÛÝÞáâìî. ¾ÝÐ áÚÞàÕÕ ÒáÕÓÞ ÝÕ ÑãÔÕâ àÐÑÞâÐâì áâÐÑØÛìÝÞ, Ø áÞåàÐÝÕÝØï " +"ØÓà ÜÞÓãâ ÝÕ àÐÑÞâÐâì Ò ÑãÔãéØå ÒÕàáØïå ScummVM." #: engines/engine.cpp:408 msgid "Start anyway" -msgstr "" +msgstr "²áñ àÐÒÝÞ ×ÐßãáâØâì" #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" @@ -1396,7 +1410,6 @@ msgid " since they may cause crashes" msgstr " âÐÚ ÚÐÚ ÞÝØ ÜÞÓãâ ßàØÒÕáâØ Ú" #: engines/scumm/help.cpp:110 -#, fuzzy msgid " or incorrect game behavior." msgstr " ÝÕÒÕàÝÞÙ àÐÑÞâÕ ØÓàë." @@ -1783,6 +1796,8 @@ msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" +"ÀÕÖØÜ \"àÞÔÝÞÓÞ\" MIDI âàÕÑãÕâ ÞÑÝÞÒÛÕÝØÕ Roland Upgrade Þâ\n" +"LucasArts, ÝÞ ÝÕ åÒÐâÐÕâ %s. ¿ÕàÕÚÛîçÐîáì ÝÐ AdLib." #: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190 #, c-format @@ -1823,7 +1838,7 @@ msgid "" "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " "directory inside the Tentacle game directory." msgstr "" -"ÁÕÙçÐá ÔÞÛÖÝÐ ×ÐßãáâØâìáï ØÓàÐ Maniax Mansion. ½Þ ScummVM ßÞÚÐ íâÞ ÝÕ ãÜÕÕâ. " +"ÁÕÙçÐá ÔÞÛÖÝÐ ×ÐßãáâØâìáï ØÓàÐ Maniac Mansion. ½Þ ScummVM ßÞÚÐ íâÞÓÞ ÝÕ ãÜÕÕâ. " "ÇâÞÑë áëÓàÐâì, ÝÐÖÜØâÕ '½ÞÒÐï ØÓàÐ' Ò áâÐàâÞÒÞÜ ÜÕÝî ScummVM, Ð ×ÐâÕÜ " "ÒëÑÕàØâÕ ÔØàÕÚâÞàØî Maniac ÒÝãâàØ ÔØàÕÚâÞàØØ á ØÓàÞÙ Tentacle." @@ -1837,11 +1852,11 @@ msgstr " #: engines/mohawk/dialogs.cpp:92 msgid "~D~rop Page" -msgstr "" +msgstr "²ëÑàÞáØâì áâàÐÝØæã" #: engines/mohawk/dialogs.cpp:96 msgid "~S~how Map" -msgstr "" +msgstr "¿ÞÚÐ×Ðâì ÚÐàâã" #: engines/mohawk/dialogs.cpp:150 msgid "~W~ater Effect Enabled" @@ -1858,40 +1873,24 @@ msgstr " #: engines/agos/animation.cpp:544 #, c-format msgid "Cutscene file '%s' not found!" -msgstr "" +msgstr "ÄÐÙÛ ×ÐáâÐÒÚØ '%s' ÝÕ ÝÐÙÔÕÝ!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 #: engines/tinsel/saveload.cpp:468 -#, fuzzy msgid "Failed to load game state from file." -msgstr "" -"½Õ ãÔÐÛÞáì ×ÐÓàã×Øâì ØÓàã Ø× äÐÙÛÐ:\n" -"\n" -"%s" +msgstr "½Õ ãÔÐÛÞáì ×ÐÓàã×Øâì áÞåàÐÝñÝÝãî ØÓàã Ø× äÐÙÛÐ." #: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546 -#, fuzzy msgid "Failed to save game state to file." -msgstr "" -"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" -"\n" -"%s" +msgstr "½Õ ãÔÐÛÞáì áÞåàÐÝØâì ØÓàã Ò äÐÙÛ." #: engines/gob/inter_v5.cpp:107 -#, fuzzy msgid "Failed to delete file." -msgstr "" -"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" -"\n" -"%s" +msgstr "½Õ ãÔÐÛÞáì ãÔÐÛØâì äÐÙÛ." #: engines/groovie/script.cpp:417 -#, fuzzy msgid "Failed to save game" -msgstr "" -"½Õ ãÔÐÛÞáì ×ÐßØáÐâì ØÓàã Ò äÐÙÛ:\n" -"\n" -"%s" +msgstr "½Õ ãÔÐÛÞáì áÞåàÐÝØâì ØÓàã" #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -1901,36 +1900,45 @@ msgid "" "General MIDI ones. After all it might happen\n" "that a few tracks will not be correctly played." msgstr "" +"ºÐÖÕâáï, Òë ßëâÐÕâÕáì ØáßÞÛì×ÞÒÐâì ãáâàÞÙáâÒÞ\n" +"General MIDI, ÝÞ íâÐ ØÓàÐ ßÞÔÔÕàÖØÒÐÕâ âÞÛìÚÞ\n" +"Roland MT32 MIDI. ¼ë ßÞßàÞÑãÕÜ ßÞÔÞÑàÐâì General\n" +"MIDI ØÝáâàãÜÕÝâë, ßÞåÞÖØÕ ÝÐ Roland MT32, ÝÞ\n" +"ÜÞÖÕâ âÐÚ ßÞÛãçØâìáï, çâÞ ÝÕÚÞâÞàëÕ âàÕÚØ ÑãÔãâ\n" +"áëÓàÐÝë ÝÕÒÕàÝÞ." #: engines/m4/m4_menus.cpp:138 -#, fuzzy msgid "Save game failed!" -msgstr "ÁÞåàÐÝØâì ØÓàã:" +msgstr "½Õ ãÔÐÛÞáì áÞåàÐÝØâì ØÓàã!" #: engines/sky/compact.cpp:130 msgid "" "Unable to find \"sky.cpt\" file!\n" "Please download it from www.scummvm.org" msgstr "" +"¾âáãâáâÒãÕâ äÐÙÛ sky.cpt!\n" +"¿ÞÖÐÛãÙáâÐ, áÚÐçÐÙâÕ ÕÓÞ á www.scummvm.org" #: engines/sky/compact.cpp:141 msgid "" "The \"sky.cpt\" file has an incorrect size.\n" "Please (re)download it from www.scummvm.org" msgstr "" +"ÄÐÙÛ sky.cpt ØÜÕÕâ ÝÕÒÕàÝëÙ àÐ×ÜÕà.\n" +"¿ÞÖÐÛãÙáâÐ, áÚÐçÐÙâÕ ÕÓÞ ×ÐÝÞÒÞ á www.scummvm.org" #: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379 msgid "DXA cutscenes found but ScummVM has been built without zlib support" -msgstr "" +msgstr "½ÐÙÔÕÝë ×ÐáâÐÒÚØ Ò äÞàÜÐâÕ DXA, ÝÞ ScummVM ÑëÛ áÞÑàÐÝ ÑÕ× ßÞÔÔÕàÖÚØ zlib" #: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389 msgid "MPEG2 cutscenes are no longer supported" -msgstr "" +msgstr "·ÐáâÐÒÚØ Ò äÞàÜÐâÕ MPEG2 ÑÞÛìèÕ ÝÕ ßÞÔÔÕàÖØÒÐîâáï" #: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397 #, c-format msgid "Cutscene '%s' not found" -msgstr "" +msgstr "·ÐáâÐÒÚÐ '%s' ÝÕ ÝÐÙÔÕÝÐ" #: engines/sword1/control.cpp:863 msgid "" @@ -1942,6 +1950,12 @@ msgid "" "Press OK to convert them now, otherwise you will be asked again the next " "time you start the game.\n" msgstr "" +"ScummVM ÞÑÝÐàãÖØÛ ã ÒÐá áÞåàÐÝÕÝØï ØÓàë ÁÛÞÜÐÝÝëÙ ¼Õç Ò áâÐàÞÜ äÞàÜÐâÕ.\n" +"ÁâÐàëÙ äÞàÜÐâ ÑÞÛìèÕ ÝÕ ßÞÔÔÕàÖØÒÐÕâáï, Ø çâÞÑë ×ÐÓàã×Øâì áÞåàÐÝÕÝØï, ÞÝØ " +"ÔÞÛÖÝë Ñëâì ßÕàÕÒÕÔÕÝë Ò ÝÞÒëÙ äÞàÜÐâ.\n" +"\n" +"½ÐÖÜØâÕ ¾º, çâÞÑë ßÕàÕÒÕáâØ Øå Ò ÝÞÒëÙ äÞàÜÐâ áÕÙçÐá, Ò ßàÞâØÒÝÞÜ áÛãçÐÕ " +"íâÞ áÞÞÑéÕÝØÕ ßÞïÒØâáï áÝÞÒÐ ßàØ áÛÕÔãîéÕÜ ×ÐßãáÚÕ ØÓàë." #: engines/sword1/control.cpp:1232 #, c-format @@ -1949,18 +1963,20 @@ msgid "" "Target new save game already exists!\n" "Would you like to keep the old save game (%s) or the new one (%s)?\n" msgstr "" +"ÁÞåàÐÝÕÝØÕ ØÓàë á âÐÚØÜ ØÜÕÝÕÜ ãÖÕ áãéÕáâÒãÕâ!\n" +"²ë åÞâØâÕ ÞáâÐÒØâì áâÐàÞÕ ÝÐ×ÒÐÝØÕ (%s) ØÛØ áÔÕÛÐâì ÝÞÒÞÕ (%s)?\n" #: engines/sword1/control.cpp:1235 msgid "Keep the old one" -msgstr "" +msgstr "¾áâÐÒØâì áâÐàÞÕ" #: engines/sword1/control.cpp:1235 msgid "Keep the new one" -msgstr "" +msgstr "ÁÔÕÛÐâì ÝÞÒÞÕ" #: engines/sword1/logic.cpp:1633 msgid "This is the end of the Broken Sword 1 Demo" -msgstr "" +msgstr "ÍâÞ ×ÐÒÕàèÕÝØÕ ÔÕÜÞ ÁÛÞÜÐÝÝÞÓÞ ¼ÕçÐ 1" #: engines/parallaction/saveload.cpp:133 #, c-format @@ -1968,16 +1984,16 @@ msgid "" "Can't save game in slot %i\n" "\n" msgstr "" +"½Õ ÜÞÓã áÞåàÐÝØâì ØÓàã Ò ßÞ×ØæØî %i\n" +"\n" #: engines/parallaction/saveload.cpp:211 -#, fuzzy msgid "Loading game..." -msgstr "·ÐÓàã×Øâì ØÓàã:" +msgstr "·ÐÓàãÖÐî ØÓàã..." #: engines/parallaction/saveload.cpp:226 -#, fuzzy msgid "Saving game..." -msgstr "ÁÞåàÐÝØâì ØÓàã:" +msgstr "ÁÞåàÐÝïî ØÓàã..." #: engines/parallaction/saveload.cpp:279 msgid "" @@ -1988,10 +2004,17 @@ msgid "" "\n" "Press OK to convert them now, otherwise you will be asked next time.\n" msgstr "" +"ScummVM ÞÑÝÐàãÖØÛ ã ÒÐá áâÐàëÕ áÞåàÐÝÕÝØï ØÓàë Nippon Safes, ÚÞâÞàëÕ ÝÕÞÑåÞÔØÜÞ " +"ßÕàÕØÜÕÝÞÒÐâì." +"ÁâÐàëÕ ÝÐ×ÒÐÝØï ÑÞÛìèÕ ÝÕ ßÞÔÔÕàÖØÒÐîâáï, Ø ßÞíâÞÜã Òë ÝÕ áÜÞÖÕâÕ ×ÐÓàã×Øâì " +"áÞåàÐÝÕÝØï, ÕáÛØ ÝÕ ßÕàÕØÜÕÝãÕâÕ Øå.\n" +"\n" +"½ÐÖÜØâÕ ¾º, çâÞÑë ßÕàÕØÜÕÝÞÒÐâì Øå áÕÙçÐá, Ò ßàÞâØÒÝÞÜ áÛãçÐÕ íâÞ ÖÕ áÞÞÑéÕÝØÕ " +"ßÞïÒØâáï ßàØ áÛÕÔãîéÕÜ ×ÐßãáÚÕ ØÓàë." #: engines/parallaction/saveload.cpp:326 msgid "ScummVM successfully converted all your savefiles." -msgstr "" +msgstr "ScummVM ãáßÕèÝÞ ßàÕÞÑàÐ×ÞÒÐÛ ÒáÕ ÒÐèØ áÞåàÐÝÕÝØï ØÓà." #: engines/parallaction/saveload.cpp:328 msgid "" @@ -2000,6 +2023,10 @@ msgid "" "\n" "Please report to the team." msgstr "" +"ScummVM ÝÐßØáÐÛ ÝÕáÚÞÛìÚÞ ßàÕÔãßàÕÖÔÕÝØÙ Ò ÞÚÝÞ ÚÞÝáÞÛØ, Ø ÝÕ áÜÞÓ ßàÕÞÑàÐ×ÞÒÐâì " +"ÒáÕ äÐÙÛë.\n" +"\n" +"¿ÞÖÐÛãÙáâÐ, áÞÞÑéØâÕ ÞÑ íâÞÜ ÚÞÜÐÝÔÕ ScummVM." #: audio/fmopl.cpp:49 msgid "MAME OPL emulator" @@ -2015,6 +2042,8 @@ msgid "" "The selected audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" +"²ëÑàÐÝÝÞÕ ×ÒãÚÞÒÞÕ ãáâàÞÙáâÒÞ '%s' ÝÕ ÑëÛÞ ÝÐÙÔÕÝÞ (ÒÞ×ÜÞÖÝÞ ÞÝÞ ÒëÚÛîçÕÝÞ " +"ØÛØ ÝÕ ßÞÔÚÛîçÕÝÞ). ¿ëâÐîáì ØáßÞÛì×ÞÒÐâì ÔàãÓÞÕ ÔÞáâãßÝÞÕ ãáâàÞÙáâÒÞ..." #: audio/mididrv.cpp:216 #, c-format @@ -2022,6 +2051,9 @@ msgid "" "The selected audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"²ëÑàÐÝÝÞÕ ×ÒãÚÞÒÞÕ ãáâàÞÙáâÒÞ '%s' ÝÕ ÜÞÖÕâ Ñëâì ØáßÞÛì×ÞÒÐÝÞ. ÁÜÞâàØâÕ " +"äÐÙÛ ßàÞâÞÚÞÛÐ ÔÛï ÑÞÛÕÕ ßÞÔàÞÑÝÞÙ ØÝäÞàÜÐæØØ. ¿ëâÐîáì ØáßÞÛì×ÞÒÐâì ÔàãÓÞÕ " +"ÔÞáâãßÝÞÕ ãáâàÞÙáâÒÞ..." #: audio/mididrv.cpp:250 #, c-format @@ -2029,6 +2061,8 @@ msgid "" "The preferred audio device '%s' was not found (e.g. might be turned off or " "disconnected). Attempting to fall back to the next available device..." msgstr "" +"¿àÕÔßÞçâØâÕÛìÝÞÕ ×ÒãÚÞÒÞÕ ãáâàÞÙáâÒÞ '%s' ÝÕ ÑëÛÞ ÝÐÙÔÕÝÞ (ÒÞ×ÜÞÖÝÞ ÞÝÞ ÒëÚÛîçÕÝÞ " +"ØÛØ ÝÕ ßÞÔÚÛîçÕÝÞ). ¿ëâÐîáì ØáßÞÛì×ÞÒÐâì ÔàãÓÞÕ ÔÞáâãßÝÞÕ ãáâàÞÙáâÒÞ..." #: audio/mididrv.cpp:265 #, c-format @@ -2036,6 +2070,9 @@ msgid "" "The preferred audio device '%s' cannot be used. See log file for more " "information. Attempting to fall back to the next available device..." msgstr "" +"¿àÕÔßÞçâØâÕÛìÝÞÕ ×ÒãÚÞÒÞÕ ãáâàÞÙáâÒÞ '%s' ÝÕ ÜÞÖÕâ Ñëâì ØáßÞÛì×ÞÒÐÝÞ. ÁÜÞâàØâÕ " +"äÐÙÛ ßàÞâÞÚÞÛÐ ÔÛï ÑÞÛÕÕ ßÞÔàÞÑÝÞÙ ØÝäÞàÜÐæØØ. ¿ëâÐîáì ØáßÞÛì×ÞÒÐâì ÔàãÓÞÕ " +"ÔÞáâãßÝÞÕ ãáâàÞÙáâÒÞ..." #: audio/null.h:43 msgid "No music" @@ -2058,7 +2095,6 @@ msgid "C64 Audio Emulator" msgstr "ÍÜãÛïâÞà ×ÒãÚÐ C64" #: audio/softsynth/mt32.cpp:329 -#, fuzzy msgid "Initializing MT-32 Emulator" msgstr "½ÐáâàÐØÒÐî íÜãÛïâÞà MT-32" @@ -2167,14 +2203,12 @@ msgid "Disable power off" msgstr "·ÐßàÕâØâì ÒëÚÛîçÕÝØÕ" #: backends/platform/iphone/osys_events.cpp:338 -#, fuzzy msgid "Mouse-click-and-drag mode enabled." -msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒÚÛîçÕÝ." +msgstr "ÀÕÖØÜ ÜëèØ ÝÐÖÐâì-Ø-âïÝãâì ÒÚÛîçÕÝ." #: backends/platform/iphone/osys_events.cpp:340 -#, fuzzy msgid "Mouse-click-and-drag mode disabled." -msgstr "ÀÕÖØÜ âÐçßÐÔÐ ÒëÚÛîçÕÝ." +msgstr "ÀÕÖØÜ ÜëèØ ÝÐÖÐâì-Ø-âïÝãâì ÒëÚÛîçÕÝ." #: backends/platform/iphone/osys_events.cpp:351 msgid "Touchpad mode enabled." @@ -2195,26 +2229,22 @@ msgstr " #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:521 -#, fuzzy msgid "Enabled aspect ratio correction" -msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" +msgstr "ºÞààÕÚæØï áÞÞâÝÞèÕÝØï áâÞàÞÝ ÒÚÛîçÕÝÐ" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:526 -#, fuzzy msgid "Disabled aspect ratio correction" -msgstr "¿ÕàÕÚÛîçÕÝØÕ ÚÞààÕÚæØØ áÞÞâÝÞèÕÝØï áâÞàÞÝ" +msgstr "ºÞààÕÚæØï áÞÞâÝÞèÕÝØï áâÞàÞÝ ÒëÚÛîçÕÝÐ" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198 -#, fuzzy msgid "Active graphics filter:" -msgstr "¿ÕàÕÚÛîçÕÝØÕ ÜÕÖÔã ÓàÐäØçÕáÚØÜØ äØÛìâàÐÜØ" +msgstr "°ÚâØÒÝëÙ ÓàÐäØçÕáÚØÙ äØÛìâà:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254 #: backends/graphics/openglsdl/openglsdl-graphics.cpp:465 -#, fuzzy msgid "Windowed mode" -msgstr "ÀÕÖØÜ àÐáâàÐ:" +msgstr "¾ÚÞÝÝëÙ àÕÖØÜ" #: backends/graphics/opengl/opengl-graphics.cpp:139 msgid "OpenGL Normal" @@ -2229,21 +2259,20 @@ msgid "OpenGL Original" msgstr "OpenGL Ø×ÝÐçÐÛìÝëÙ" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:403 -#, fuzzy msgid "Current display mode" -msgstr "ÂÕÚãéØÙ ÒØÔÕÞàÕÖØÜ:" +msgstr "ÂÕÚãéØÙ ÒØÔÕÞàÕÖØÜ" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:416 msgid "Current scale" -msgstr "" +msgstr "ÂÕÚãéØÙ ÜÐáèâÐÑ" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:546 msgid "Active filter mode: Linear" -msgstr "" +msgstr "°ÚâØÒÝëÙ àÕÖØÜ äØÛìâàÐ: »ØÝÕÙÝëÙ" #: backends/graphics/openglsdl/openglsdl-graphics.cpp:548 msgid "Active filter mode: Nearest" -msgstr "" +msgstr "°ÚâØÒÝëÙ àÕÖØÜ äØÛìâàÐ: ±ÛØÖÐÙèØÙ" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2436,17 +2465,15 @@ msgid "Network down" msgstr "ÁÕâì ÒëÚÛîçÕÝÐ" #: backends/platform/wii/options.cpp:178 -#, fuzzy msgid "Initializing network" msgstr "½ÐáâàÐØÒÐî áÕâì" #: backends/platform/wii/options.cpp:182 -#, fuzzy msgid "Timeout while initializing network" msgstr "²àÕÜï ßÞÔÚÛîçÕÝØï Ú áÕâØ ØáâÕÚÛÞ" #: backends/platform/wii/options.cpp:186 -#, fuzzy, c-format +#, c-format msgid "Network not initialized (%d)" msgstr "ÁÕâì ÝÕ ÝÐáâàÞØÛÐáì (%d)" @@ -2565,55 +2592,50 @@ msgstr "" "ØÝÒÕÝâÐàì Ò ØÓàÕ" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Do you really want to return to the Launcher?" -msgstr "²ë ÔÕÙáâÒØâÕÛìÝÞ åÞâØâÕ ãÔÐÛØâì íâÞ áÞåàÐÝÕÝØÕ?" +msgstr "²ë ÔÕÙáâÒØâÕÛìÝÞ åÞâØâÕ ÒÕàÝãâìáï Ò ÓÛÐÒÝÞÕ ÜÕÝî?" #: backends/events/default/default-events.cpp:222 -#, fuzzy msgid "Launcher" -msgstr "ÃÔÐà" +msgstr "³ÛÐÒÝÞÕ ÜÕÝî" #: backends/events/default/default-events.cpp:244 -#, fuzzy msgid "Do you really want to quit?" -msgstr "²ë åÞâØâÕ ÒëÙâØ?" +msgstr "²ë ÔÕÙáâÒØâÕÛìÝÞ åÞâØâÕ ÒëÙâØ?" #: backends/events/gph/gph-events.cpp:366 #: backends/events/gph/gph-events.cpp:409 #: backends/events/openpandora/op-events.cpp:141 msgid "Touchscreen 'Tap Mode' - Left Click" -msgstr "" +msgstr "ÀÕÖØÜ 'ÚÐáÐÝØÙ' âÐçáÚàØÝÐ - »ÕÒëÙ ÚÛØÚ" #: backends/events/gph/gph-events.cpp:368 #: backends/events/gph/gph-events.cpp:411 #: backends/events/openpandora/op-events.cpp:143 msgid "Touchscreen 'Tap Mode' - Right Click" -msgstr "" +msgstr "ÀÕÖØÜ 'ÚÐáÐÝØÙ' âÐçáÚàØÝÐ - ¿àÐÒëÙ ÚÛØÚ" #: backends/events/gph/gph-events.cpp:370 #: backends/events/gph/gph-events.cpp:413 #: backends/events/openpandora/op-events.cpp:145 msgid "Touchscreen 'Tap Mode' - Hover (No Click)" -msgstr "" +msgstr "ÀÕÖØÜ 'ÚÐáÐÝØÙ' âÐçáÚàØÝÐ - ¿àÞÛñâ (ÑÕ× ÚÛØÚÐ)" #: backends/events/gph/gph-events.cpp:390 -#, fuzzy msgid "Maximum Volume" -msgstr "³àÞÜÚÞáâì" +msgstr "¼ÐÚáØÜÐÛìÝÐï ÓàÞÜÚÞáâì" #: backends/events/gph/gph-events.cpp:392 msgid "Increasing Volume" -msgstr "" +msgstr "ÃÒÕÛØçÕÝØÕ ÓàÞÜÚÞáâØ" #: backends/events/gph/gph-events.cpp:398 -#, fuzzy msgid "Minimal Volume" -msgstr "³àÞÜÚÞáâì" +msgstr "¼ØÝØÜÐÛìÝÐï ÓàÞÜÚÞáâì" #: backends/events/gph/gph-events.cpp:400 msgid "Decreasing Volume" -msgstr "" +msgstr "ÃÜÕÝìèÕÝØÕ ÓàÞÜÚÞáâØ" #~ msgid "Discovered %d new games." #~ msgstr "½ÐÙÔÕÝÞ %d ÝÞÒëå ØÓà." -- cgit v1.2.3 From 13aa8fa79f998048fc8217b347813beba8cb0b62 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 24 Jun 2011 19:04:33 +1000 Subject: TSAGE: Fix for properly initialising the _voiceTypeStructPtrs array --- engines/tsage/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 8bdb2f2d4c..f0273ddfcb 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -664,11 +664,11 @@ void SoundManager::_sfRethinkSoundDrivers() { byteVal = *groupData; groupData += 2; - for (idx = 0; idx < byteVal; ++idx) { + for (int entryIndez = 0; entryIndez < byteVal; ++entryIndez) { VoiceStructEntry ve; memset(&ve, 0, sizeof(VoiceStructEntry)); - ve._voiceNum = idx; + ve._voiceNum = entryIndez; ve._driver = driver; ve._type1._field4 = -1; ve._type1._field5 = 0; -- cgit v1.2.3 From fa97da864aeb17b46a83eead3f87a151b5bee59b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 26 Jun 2011 09:59:58 +1000 Subject: TSAGE: Several bugfixes for sound output to match the original --- engines/tsage/sound.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index f0273ddfcb..82cd0f16bd 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -31,6 +31,23 @@ namespace tSage { static SoundManager *_soundManager = NULL; +static void dumpVoiceStruct() { + VoiceTypeStruct *vt = _soundManager->_voiceTypeStructPtrs[1]; + if (!vt) { + debug("Not setup"); + return; + } + + assert(vt->_voiceType == VOICETYPE_1); + for (uint idx = 0; idx < vt->_entries.size(); ++idx) { + VoiceStructEntryType1 &vte = vt->_entries[idx]._type1; + debug("#%d - s=%x, ch=%x, pr=%x | s2=%x, ch2=%x, pr2=%x | s3=%x, ch3=%x, pr3=%x", + idx, vte._sound, vte._channelNum, vte._priority, + vte._sound2, vte._channelNum2, vte._priority2, + vte._sound3, vte._channelNum3, vte._priority3); + } +} + /*--------------------------------------------------------------------------*/ SoundManager::SoundManager() { @@ -1166,8 +1183,7 @@ void SoundManager::_sfRethinkVoiceTypes() { if (!vse2._sound && (vse2._sound3 == sound) && (vse2._channelNum3 == channelNum)) { vse2._sound = sound; vse2._channelNum = channelNum; - vse._channelNum = vse2._channelNum2; - vse._priority = vse2._priority2; + vse2._priority = vse._priority2; vse._sound2 = NULL; break; } @@ -1188,7 +1204,7 @@ void SoundManager::_sfRethinkVoiceTypes() { vse2._sound = vse._sound2; vse2._channelNum = vse._channelNum2; vse2._priority = vse._priority2; - vse._field4 = -1; + vse2._field4 = -1; vse2._field5 = 0; vse2._field6 = 0; @@ -1213,7 +1229,7 @@ void SoundManager::_sfRethinkVoiceTypes() { SoundDriver *driver = vs->_entries[idx]._driver; assert(driver); - driver->updateVoice(voiceIndex); + driver->updateVoice(vs->_entries[idx]._voiceNum); } } } @@ -1939,7 +1955,7 @@ void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) { b &= 0x7f; if (channelNum != -1) { - if (voiceType == VOICETYPE_1) { + if (voiceType != VOICETYPE_0) { if (chFlags & 0x10) _soProc42(vtStruct, channelNum, chVoiceType, v); else @@ -2484,10 +2500,7 @@ void AdlibSoundDriver::close() { bool AdlibSoundDriver::reset() { write(1, 0x20); - write(4, 0x80); - - write(2, 1); - write(4, 1); + write(1, 0x20); return true; } -- cgit v1.2.3 From f300c172f08c8982e451f7d335792e15cbc7f6b6 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Sun, 26 Jun 2011 02:09:54 +0200 Subject: WINCE: Fix timer manager --- backends/platform/wince/wince-sdl.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 9b1ffe817c..ec222c6fc1 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -353,9 +353,9 @@ void drawError(char *error) { } // ******************************************************************************************** -static DefaultTimerManager *_int_timer = NULL; static Uint32 timer_handler_wrapper(Uint32 interval) { - _int_timer->handler(); + DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager(); + tm->handler(); return interval; } @@ -379,21 +379,15 @@ void OSystem_WINCE3::initBackend() { ((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager); - - // FIXME: This timer manager is *not accesible* from the outside. - // Instead the timer manager setup by OSystem_SDL is visible on the outside. - // Since the WinCE backend actually seems to work, my guess is that - // SDL_AddTimer works after all and the following code is redundant. - // However it may be, this must be resolved one way or another. - - // Create the timer. CE SDL does not support multiple timers (SDL_AddTimer). + // Create the timer (but remove the timer manager from the SDL backend first). + // CE SDL does not support multiple timers (SDL_AddTimer). // We work around this by using the SetTimer function, since we only use // one timer in scummvm (for the time being) - _int_timer = new DefaultTimerManager(); - //_timerID = NULL; // OSystem_SDL will call removetimer with this, it's ok + delete _timerManager; + _timerManager = new DefaultTimerManager(); SDL_SetTimer(10, &timer_handler_wrapper); - // Chain init + // Call parent implementation of this method OSystem_SDL::initBackend(); // Initialize global key mapping @@ -404,9 +398,6 @@ void OSystem_WINCE3::initBackend() { GUI_Actions::Instance()->saveMapping(); // write defaults } - // Call parent implementation of this method - //OSystem_SDL::initBackend(); - _inited = true; } -- cgit v1.2.3 From c6a1051c3defc6cff4a2df5e064a63d6b586f2ae Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 26 Jun 2011 09:06:25 +0200 Subject: TSAGE: Silence GCC warnings --- engines/tsage/sound.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 82cd0f16bd..2c00e6ec47 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -31,6 +31,7 @@ namespace tSage { static SoundManager *_soundManager = NULL; +#if 0 static void dumpVoiceStruct() { VoiceTypeStruct *vt = _soundManager->_voiceTypeStructPtrs[1]; if (!vt) { @@ -41,12 +42,13 @@ static void dumpVoiceStruct() { assert(vt->_voiceType == VOICETYPE_1); for (uint idx = 0; idx < vt->_entries.size(); ++idx) { VoiceStructEntryType1 &vte = vt->_entries[idx]._type1; - debug("#%d - s=%x, ch=%x, pr=%x | s2=%x, ch2=%x, pr2=%x | s3=%x, ch3=%x, pr3=%x", - idx, vte._sound, vte._channelNum, vte._priority, - vte._sound2, vte._channelNum2, vte._priority2, - vte._sound3, vte._channelNum3, vte._priority3); + debug("#%d - s=%p, ch=%x, pr=%x | s2=%p, ch2=%x, pr2=%x | s3=%p, ch3=%x, pr3=%x", + idx, (void *)vte._sound, vte._channelNum, vte._priority, + (void *)vte._sound2, vte._channelNum2, vte._priority2, + (void *)vte._sound3, vte._channelNum3, vte._priority3); } } +#endif /*--------------------------------------------------------------------------*/ -- cgit v1.2.3 From 12635ee198e0e012346f0d8105a02ce615721873 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 26 Jun 2011 15:59:10 +0300 Subject: CINE: Fixed compilation when DUMP_SCRIPTS is set --- engines/cine/prc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp index d86107a8f8..ba9ba70110 100644 --- a/engines/cine/prc.cpp +++ b/engines/cine/prc.cpp @@ -98,10 +98,10 @@ bool loadPrc(const char *pPrcName) { char buffer[256]; for (s = 0; s < numScripts; s++) { - if (scriptTable[s]->_size) { + if (g_cine->_scriptTable[s]->_size) { sprintf(buffer, "%s_%03d.txt", pPrcName, s); - decompileScript((const byte *)scriptTable[s]->getString(0), scriptTable[s]->_size, s); + decompileScript((const byte *)g_cine->_scriptTable[s]->getString(0), g_cine->_scriptTable[s]->_size, s); dumpScript(buffer); } } -- cgit v1.2.3 From bce549f42a374e47c5de794c863d6cbe0842bfb4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 26 Jun 2011 16:09:38 +0300 Subject: SWORD25: Fix bug with loading saves when some saves are missing --- engines/sword25/gfx/staticbitmap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp index 60ad94e20f..0ae07b36b5 100644 --- a/engines/sword25/gfx/staticbitmap.cpp +++ b/engines/sword25/gfx/staticbitmap.cpp @@ -170,7 +170,10 @@ bool StaticBitmap::unpersist(InputPersistenceBlock &reader) { result &= Bitmap::unpersist(reader); Common::String resourceFilename; reader.readString(resourceFilename); - result &= initBitmapResource(resourceFilename); + // We may not have saves, and we actually do not need to + // restore them. So do not even try to load them. + if (!resourceFilename.hasPrefix("/saves")) + result &= initBitmapResource(resourceFilename); result &= RenderObject::unpersistChildren(reader); -- cgit v1.2.3 From 32392c9430c80d323914ffa91d4f08272396dcd9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 26 Jun 2011 17:36:53 +0300 Subject: SWORD25: Fixed bug with concurrent sounds. Reported by criezy --- engines/sword25/sfx/soundengine.cpp | 60 +++++++++++++++++++++---------------- engines/sword25/sfx/soundengine.h | 7 +++-- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 9244137c25..130383f8ef 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -61,6 +61,8 @@ SoundEngine::SoundEngine(Kernel *pKernel) : ResourceService(pKernel) { _mixer = g_system->getMixer(); + _maxHandleId = 1; + for (int i = 0; i < SOUND_HANDLES; i++) _handles[i].type = kFreeHandle; } @@ -139,19 +141,24 @@ void SoundEngine::resumeLayer(uint layer) { SndHandle *SoundEngine::getHandle(uint *id) { - // NOTE: Index 0 means error. Thus we're not using it - for (uint i = 1; i < SOUND_HANDLES; i++) { + for (uint i = 0; i < SOUND_HANDLES; i++) { if (_handles[i].type != kFreeHandle && !_mixer->isSoundHandleActive(_handles[i].handle)) { - debugC(kDebugSound, 5, "Handle %d has finished playing", i); + debugC(1, kDebugSound, "Handle %d has finished playing", _handles[i].id); _handles[i].type = kFreeHandle; } } - for (uint i = 1; i < SOUND_HANDLES; i++) { + for (uint i = 0; i < SOUND_HANDLES; i++) { if (_handles[i].type == kFreeHandle) { - debugC(kDebugSound, 5, "Allocated handle %d", i); + debugC(1, kDebugSound, "Allocated handle %d", _handles[i].id); + _handles[i].id = _maxHandleId; + _handles[i].type = kAllocatedHandle; + if (id) - *id = i; + *id = _maxHandleId; + + _maxHandleId++; + return &_handles[i]; } } @@ -161,6 +168,17 @@ SndHandle *SoundEngine::getHandle(uint *id) { return NULL; } +SndHandle *SoundEngine::findHandle(uint id) { + for (uint i = 0; i < SOUND_HANDLES; i++) { + if (_handles[i].id == id) + return &_handles[i]; + } + + error("Sound::findHandle(): Unknown handle"); + + return NULL; +} + Audio::Mixer::SoundType getType(SoundEngine::SOUND_TYPES type) { switch (type) { case SoundEngine::MUSIC: @@ -194,6 +212,8 @@ uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, debugC(1, kDebugSound, "SoundEngine::playSoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer); + handle->type = kAllocatedHandle; + #ifdef USE_VORBIS _mixer->playStream(getType(type), &(handle->handle), stream, -1, (byte)(volume * 255), (int8)(pan * 127)); #endif @@ -202,43 +222,33 @@ uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, } void SoundEngine::setSoundVolume(uint handle, float volume) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::setSoundVolume(%d, %f)", handle, volume); - _mixer->setChannelVolume(_handles[handle].handle, (byte)(volume * 255)); + _mixer->setChannelVolume(findHandle(handle)->handle, (byte)(volume * 255)); } void SoundEngine::setSoundPanning(uint handle, float pan) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::setSoundPanning(%d, %f)", handle, pan); - _mixer->setChannelBalance(_handles[handle].handle, (int8)(pan * 127)); + _mixer->setChannelBalance(findHandle(handle)->handle, (int8)(pan * 127)); } void SoundEngine::pauseSound(uint handle) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::pauseSound(%d)", handle); - _mixer->pauseHandle(_handles[handle].handle, true); + _mixer->pauseHandle(findHandle(handle)->handle, true); } void SoundEngine::resumeSound(uint handle) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::resumeSound(%d)", handle); - _mixer->pauseHandle(_handles[handle].handle, false); + _mixer->pauseHandle(findHandle(handle)->handle, false); } void SoundEngine::stopSound(uint handle) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::stopSound(%d)", handle); - _mixer->stopHandle(_handles[handle].handle); + _mixer->stopHandle(findHandle(handle)->handle); } bool SoundEngine::isSoundPaused(uint handle) { @@ -250,23 +260,21 @@ bool SoundEngine::isSoundPaused(uint handle) { } bool SoundEngine::isSoundPlaying(uint handle) { - assert(handle < SOUND_HANDLES); - debugC(1, kDebugSound, "SoundEngine::isSoundPlaying(%d)", handle); - return _mixer->isSoundHandleActive(_handles[handle].handle); + return _mixer->isSoundHandleActive(findHandle(handle)->handle); } float SoundEngine::getSoundVolume(uint handle) { debugC(1, kDebugSound, "SoundEngine::getSoundVolume(%d)", handle); - return (float)_mixer->getChannelVolume(_handles[handle].handle) / 255.0; + return (float)_mixer->getChannelVolume(findHandle(handle)->handle) / 255.0; } float SoundEngine::getSoundPanning(uint handle) { debugC(1, kDebugSound, "SoundEngine::getSoundPanning(%d)", handle); - return (float)_mixer->getChannelBalance(_handles[handle].handle) / 127.0; + return (float)_mixer->getChannelBalance(findHandle(handle)->handle) / 127.0; } Resource *SoundEngine::loadResource(const Common::String &fileName) { diff --git a/engines/sword25/sfx/soundengine.h b/engines/sword25/sfx/soundengine.h index 4dbd475846..71f1602484 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -58,13 +58,13 @@ namespace Sword25 { enum sndHandleType { kFreeHandle, - kEffectHandle, - kVoiceHandle + kAllocatedHandle }; struct SndHandle { Audio::SoundHandle handle; sndHandleType type; + uint32 id; }; @@ -244,10 +244,13 @@ public: private: bool registerScriptBindings(); SndHandle *getHandle(uint *id); + SndHandle *findHandle(uint id); private: Audio::Mixer *_mixer; SndHandle _handles[SOUND_HANDLES]; + + uint32 _maxHandleId; }; } // End of namespace Sword25 -- cgit v1.2.3 From 55a7bbf86abce9bd44b11fceed7e2a6a8bc49b51 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 26 Jun 2011 18:40:31 +0100 Subject: SWORD25: Change unknow handle error into a warning Also add sanity checks when calling findHandle() in the SoundEngine. This fixes an issue when functions of SoundEngine are called on a sound that has already finished playing (the most common occurrences are calls to isSoundPlaying()). --- engines/sword25/sfx/soundengine.cpp | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 130383f8ef..7c8a6593aa 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -174,7 +174,7 @@ SndHandle *SoundEngine::findHandle(uint id) { return &_handles[i]; } - error("Sound::findHandle(): Unknown handle"); + warning("Sound::findHandle(): Unknown handle"); return NULL; } @@ -224,31 +224,41 @@ uint SoundEngine::playSoundEx(const Common::String &fileName, SOUND_TYPES type, void SoundEngine::setSoundVolume(uint handle, float volume) { debugC(1, kDebugSound, "SoundEngine::setSoundVolume(%d, %f)", handle, volume); - _mixer->setChannelVolume(findHandle(handle)->handle, (byte)(volume * 255)); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle != NULL) + _mixer->setChannelVolume(sndHandle->handle, (byte)(volume * 255)); } void SoundEngine::setSoundPanning(uint handle, float pan) { debugC(1, kDebugSound, "SoundEngine::setSoundPanning(%d, %f)", handle, pan); - _mixer->setChannelBalance(findHandle(handle)->handle, (int8)(pan * 127)); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle != NULL) + _mixer->setChannelBalance(sndHandle->handle, (int8)(pan * 127)); } void SoundEngine::pauseSound(uint handle) { debugC(1, kDebugSound, "SoundEngine::pauseSound(%d)", handle); - _mixer->pauseHandle(findHandle(handle)->handle, true); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle != NULL) + _mixer->pauseHandle(sndHandle->handle, true); } void SoundEngine::resumeSound(uint handle) { debugC(1, kDebugSound, "SoundEngine::resumeSound(%d)", handle); - _mixer->pauseHandle(findHandle(handle)->handle, false); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle != NULL) + _mixer->pauseHandle(sndHandle->handle, false); } void SoundEngine::stopSound(uint handle) { debugC(1, kDebugSound, "SoundEngine::stopSound(%d)", handle); - _mixer->stopHandle(findHandle(handle)->handle); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle != NULL) + _mixer->stopHandle(sndHandle->handle); } bool SoundEngine::isSoundPaused(uint handle) { @@ -262,19 +272,28 @@ bool SoundEngine::isSoundPaused(uint handle) { bool SoundEngine::isSoundPlaying(uint handle) { debugC(1, kDebugSound, "SoundEngine::isSoundPlaying(%d)", handle); - return _mixer->isSoundHandleActive(findHandle(handle)->handle); + SndHandle* sndHandle = findHandle(handle); + if (sndHandle == NULL) + return false; + return _mixer->isSoundHandleActive(sndHandle->handle); } float SoundEngine::getSoundVolume(uint handle) { debugC(1, kDebugSound, "SoundEngine::getSoundVolume(%d)", handle); - return (float)_mixer->getChannelVolume(findHandle(handle)->handle) / 255.0; + SndHandle* sndHandle = findHandle(handle); + if (sndHandle == NULL) + return 0.f; + return (float)_mixer->getChannelVolume(sndHandle->handle) / 255.0; } float SoundEngine::getSoundPanning(uint handle) { debugC(1, kDebugSound, "SoundEngine::getSoundPanning(%d)", handle); - return (float)_mixer->getChannelBalance(findHandle(handle)->handle) / 127.0; + SndHandle* sndHandle = findHandle(handle); + if (sndHandle == NULL) + return 0.f; + return (float)_mixer->getChannelBalance(sndHandle->handle) / 127.0; } Resource *SoundEngine::loadResource(const Common::String &fileName) { -- cgit v1.2.3 From d2962531cbdfdfc3cdec7af2487add21a056295b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 26 Jun 2011 21:17:28 +0300 Subject: GRAPHICS: Generalized arbitrary bit depth images processing in PNG decoder. This fixes 1bpp image rengering. --- graphics/png.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/graphics/png.cpp b/graphics/png.cpp index 6ffc53bd92..2189fd333f 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -166,18 +166,26 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) { } } else { byte index, r, g, b; + uint32 mask = (0xff >> (8 - _header.bitDepth)) << (8 - _header.bitDepth); // Convert the indexed surface to the target pixel format for (uint16 i = 0; i < output->h; i++) { - bool otherPixel = false; + int data = 0; + int bitCount = 8; + byte *src1 = src; for (uint16 j = 0; j < output->w; j++) { - if (_header.bitDepth != 4) - index = *src; - else if (!otherPixel) - index = (*src) >> 4; - else - index = (*src) & 0xf; + if (bitCount == 8) { + data = *src; + src++; + } + + index = (data & mask) >> (8 - _header.bitDepth); + data = (data << _header.bitDepth) & 0xff; + bitCount -= _header.bitDepth; + + if (bitCount == 0) + bitCount = 8; r = _palette[index * 4 + 0]; g = _palette[index * 4 + 1]; @@ -188,14 +196,8 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) { *((uint16 *)output->getBasePtr(j, i)) = format.ARGBToColor(a, r, g, b); else *((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor(a, r, g, b); - - if (_header.bitDepth != 4 || otherPixel) - src++; - otherPixel = !otherPixel; } - // The surface is a whole scanline wide, skip the rest of it. - if (_header.bitDepth == 4) - src += output->w / 2 + output->w % 2; + src = src1 + output->w; } } -- cgit v1.2.3 From 3f43619ea8b5b80b7211467ec27abc45de152ff2 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 26 Jun 2011 14:34:56 -0400 Subject: LASTEXPRESS: Add detection entry for Russian version --- engines/lastexpress/detection.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index de80e75341..0a177809dd 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -127,7 +127,7 @@ static const ADGameDescription gameDescriptions[] = { "lastexpress", "", { - {"HD.HPF", 0, "7cdd70fc0b1555785f1e9e8d371ea85c", 31301632}, // 1997-04-08 14:33:42 + {"HD.HPF", 0, "7cdd70fc0b1555785f1e9e8d371ea85c", 31301632}, // 1997-04-08 14:33:42 {"CD1.HPF", 0, "6d74cc861d172466bc745ff8bf0e59c5", 522971136}, // 1997-04-08 13:05:56 {"CD2.HPF", 0, "b71ac9391de415807c74ff078f4fab22", 655702016}, // 1997-04-08 15:26:14 {"CD3.HPF", 0, "ee55d4310546dd2a38560b096d1c2771", 641144832}, // 1997-04-05 18:35:50 @@ -163,7 +163,7 @@ static const ADGameDescription gameDescriptions[] = { "lastexpress", "", { - {"HD.HPF", 0, "5539e78fd7eecb70bc858e86b5709fe9", 29562880}, // 1997-12-11 14:11:52 + {"HD.HPF", 0, "5539e78fd7eecb70bc858e86b5709fe9", 29562880}, // 1997-12-11 14:11:52 {"CD1.HPF", 0, "3c1c80b41f2c454b7b89dcb32648796c", 522328064}, // 1997-12-11 14:39:46 {"CD2.HPF", 0, "ea6414d5a718501cfd55de3884f4431d", 665411584}, // 1997-12-11 15:20:26 {"CD3.HPF", 0, "a5bd5b58acddbd951d4551f68de22025", 637718528}, // 1997-12-11 15:58:44 @@ -173,6 +173,24 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, Common::GUIO_NONE }, + + // The Last Express (Russian) + // expressw.exe 1999-04-05 15:33:56 + // express.exe ??? + { + "lastexpress", + "", + { + {"HD.HPF", 0, "a9e915c20f3231c5a1ac4455286971bb", 29908992}, // 1999-04-08 12:43:56 + {"CD1.HPF", 0, "80fbb95c9228353436b7b38e4b5bb64d", 525805568}, // 1999-04-07 13:30:14 + {"CD2.HPF", 0, "a1c8c344754e03eaa86eaabc6024709e", 677289984}, // 1999-04-07 16:19:56 + {"CD3.HPF", 0, "ea5adac447e59ea6d4a1737abad46480", 642584576}, // 1999-04-07 17:26:18 + }, + Common::RU_RUS, + Common::kPlatformUnknown, + ADGF_UNSTABLE, + Common::GUIO_NONE + }, AD_TABLE_END_MARKER }; -- cgit v1.2.3 From 3931de4235fc1eb2993968c7880d473f4e2a6077 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 26 Jun 2011 16:01:08 -0400 Subject: BACKENDS: Fix running on pre-Windows 2000 operating systems The Windows taskbar manager uses VerSetConditionMask and VerifyVersionInfo to check for Windows 7 or later before enabling the taskbar integration features. Those functions did not appear until Windows 2000, so we have to check for them at runtime. --- backends/taskbar/win32/win32-taskbar.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 7d063f49ba..d6be566263 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -232,6 +232,28 @@ Common::String Win32TaskbarManager::getIconPath(Common::String target) { return ""; } +// VerSetConditionMask and VerifyVersionInfo didn't appear until Windows 2000, +// so we need to check for them at runtime +LONGLONG VerSetConditionMaskFunc(ULONGLONG conditionMask, DWORD typeMask, BYTE condition) { + typedef BOOL (WINAPI *VerSetConditionMaskFunction)(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition); + + VerSetConditionMaskFunction verSetConditionMask = (VerSetConditionMaskFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerSetConditionMask"); + if (verSetConditionMask == NULL) + return 0; + + return verSetConditionMask(conditionMask, typeMask, condition); +} + +BOOL VerifyVersionInfoFunc(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask) { + typedef BOOL (WINAPI *VerifyVersionInfoFunction)(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask); + + VerifyVersionInfoFunction verifyVersionInfo = (VerifyVersionInfoFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerifyVersionInfoA"); + if (verifyVersionInfo == NULL) + return FALSE; + + return verifyVersionInfo(lpVersionInformation, dwTypeMask, dwlConditionMask); +} + bool Win32TaskbarManager::isWin7OrLater() { OSVERSIONINFOEX versionInfo; DWORDLONG conditionMask = 0; @@ -241,10 +263,10 @@ bool Win32TaskbarManager::isWin7OrLater() { versionInfo.dwMajorVersion = 6; versionInfo.dwMinorVersion = 1; - VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + conditionMask = VerSetConditionMaskFunc(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + conditionMask = VerSetConditionMaskFunc(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); - return VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); + return VerifyVersionInfoFunc(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask); } LPWSTR Win32TaskbarManager::ansiToUnicode(const char *s) { -- cgit v1.2.3 From e8c704a02573fca7ebe99cbaa9b27eb4382d40f6 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Sun, 26 Jun 2011 23:13:49 +0200 Subject: TOON: Fix the bottom pixels of text being cut off It's a dirty rect problem. The computeSize() function needs to take into consideration that the glyph may be offset, so it's not enough to just look at its size. For now, I'm assuming that this is only a problem with characters that stick out below the base line, so that's all this patch tries to fix. Let's see if that's enough. --- engines/toon/anim.cpp | 12 ++++++++++++ engines/toon/anim.h | 1 + engines/toon/font.cpp | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 23bd0f6487..07d51ef1b9 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -271,6 +271,18 @@ void Animation::applyPalette(int32 offset, int32 srcOffset, int32 numEntries) { _vm->setPaletteEntries(_palette + srcOffset, offset, numEntries); } +Common::Rect Animation::getFrameRect(int32 frame) { + debugC(4, kDebugAnim, "getFrameRect(%d)", frame); + if ((frame < 0) || (frame >= _numFrames)) { + return Common::Rect(); + } + + if (_frames[frame]._ref != -1) + frame = _frames[frame]._ref; + + return Common::Rect(_frames[frame]._x1, _frames[frame]._y1, _frames[frame]._x2, _frames[frame]._y2); +} + int32 Animation::getFrameWidth(int32 frame) { debugC(4, kDebugAnim, "getFrameWidth(%d)", frame); if ((frame < 0) || (frame >= _numFrames)) diff --git a/engines/toon/anim.h b/engines/toon/anim.h index 13c501b910..4b95b6cf40 100644 --- a/engines/toon/anim.h +++ b/engines/toon/anim.h @@ -68,6 +68,7 @@ public: void drawFrameWithMaskAndScale(Graphics::Surface &surface, int32 frame, int32 xx, int32 yy, int32 zz, Picture *mask, int32 scale); void drawStrip(int32 offset = 0); void applyPalette(int32 offset, int32 srcOffset, int32 numEntries); + Common::Rect getFrameRect(int32 frame); int32 getFrameWidth(int32 frame); int32 getFrameHeight(int32 frame); int32 getWidth() const; diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index 4c491ae2b3..63304c905f 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -21,6 +21,7 @@ */ #include "common/debug.h" +#include "common/rect.h" #include "toon/font.h" @@ -80,7 +81,7 @@ void FontRenderer::renderText(int32 x, int32 y, Common::String origText, int32 m x -= xx / 2; } - _vm->addDirtyRect(x, y, x + xx + 2, y + yy); + _vm->addDirtyRect(x, y, x + xx, y + yy); int32 curX = x; int32 curY = y; @@ -110,6 +111,7 @@ void FontRenderer::computeSize(Common::String origText, int32 *retX, int32 *retY int32 lineHeight = 0; int32 totalHeight = 0; int32 totalWidth = 0; + int32 lastLineHeight = 0; const byte *text = (const byte *)origText.c_str(); while (*text) { @@ -122,17 +124,25 @@ void FontRenderer::computeSize(Common::String origText, int32 *retX, int32 *retY totalHeight += lineHeight; lineHeight = 0; lineWidth = 0; + lastLineHeight = 0; } else { curChar = textToFont(curChar); int32 charWidth = _currentFont->getFrameWidth(curChar) - 1; int32 charHeight = _currentFont->getFrameHeight(curChar); lineWidth += charWidth; lineHeight = MAX(lineHeight, charHeight); + + // The character may be offset, so the height doesn't + // really tell how far it will stick out. For now, + // assume we only need to take the lower bound into + // consideration. + Common::Rect charRect = _currentFont->getFrameRect(curChar); + lastLineHeight = MAX(lastLineHeight, charRect.bottom); } text++; } - totalHeight += lineHeight; + totalHeight += lastLineHeight; totalWidth = MAX(totalWidth, lineWidth); *retX = totalWidth; -- cgit v1.2.3 From f065b612a61c781285a5c3ad4c4473f4261607be Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 26 Jun 2011 18:30:34 -0400 Subject: ICONS: Update Windows icons - Replace 128x128 RGB version by PNG compressed 256x256 version for Windows Vista and later - Update 256 colors versions of the icon to remove black background - Remove 16 colors versions (256 colors icons have been supported since Windows 3.0 and are the default on Windows 95) - Add missing sizes and colors to NSIS installer icon --- dists/nsis/graphics/scummvm-install.ico | Bin 15086 -> 77799 bytes icons/scummvm.ico | Bin 91198 -> 94081 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/dists/nsis/graphics/scummvm-install.ico b/dists/nsis/graphics/scummvm-install.ico index b8b118c7bd..6312959509 100644 Binary files a/dists/nsis/graphics/scummvm-install.ico and b/dists/nsis/graphics/scummvm-install.ico differ diff --git a/icons/scummvm.ico b/icons/scummvm.ico index 0142e90f14..0283e8432e 100644 Binary files a/icons/scummvm.ico and b/icons/scummvm.ico differ -- cgit v1.2.3 From 7983b1cce3fb5831f7437ea689b951ac7cd9c5a3 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sun, 26 Jun 2011 19:51:52 -0400 Subject: BACKENDS: Add special Win32 path to set SDL window icon We bypass SDL_WM_SetIcon and setup the window icon using the embedded icon, with the default path as a fallback. This allows us to use an antialised icon with alpha transparency (which the default included icon doesn't have) on Windows XP and later --- backends/platform/sdl/win32/win32.cpp | 24 ++++++++++++++++++++++++ backends/platform/sdl/win32/win32.h | 1 + dists/scummvm.rc | 1 + dists/scummvm.rc.in | 1 + 4 files changed, 27 insertions(+) diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 814f1955fe..420ed2465b 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -34,6 +34,8 @@ #undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... #include +#include // For setting the icon + #include "backends/platform/sdl/win32/win32.h" #include "backends/fs/windows/windows-fs-factory.h" #include "backends/taskbar/win32/win32-taskbar.h" @@ -137,6 +139,28 @@ bool OSystem_Win32::displayLogFile() { return false; } +void OSystem_Win32::setupIcon() { + HMODULE handle = GetModuleHandle(NULL); + HICON ico = LoadIcon(handle, MAKEINTRESOURCE(1001 /* IDI_ICON */)); + if (ico) { + SDL_SysWMinfo wminfo; + SDL_VERSION(&wminfo.version); + if (SDL_GetWMInfo(&wminfo)) { + // Replace the handle to the icon associated with the window class by our custom icon + SetClassLongPtr(wminfo.window, GCLP_HICON, (ULONG_PTR)ico); + + // Since there wasn't any default icon, we can't use the return value from SetClassLong + // to check for errors (it would be 0 in both cases: error or no previous value for the + // icon handle). Instead we check for the last-error code value. + if (GetLastError() == ERROR_SUCCESS) + return; + } + } + + // If no icon has been set, fallback to default path + OSystem_SDL::setupIcon(); +} + Common::String OSystem_Win32::getDefaultConfigFileName() { char configFile[MAXPATHLEN]; diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h index ef7b6af3f1..cc2fc51d36 100644 --- a/backends/platform/sdl/win32/win32.h +++ b/backends/platform/sdl/win32/win32.h @@ -46,6 +46,7 @@ protected: */ Common::String _logFilePath; + virtual void setupIcon(); virtual Common::String getDefaultConfigFileName(); virtual Common::WriteStream *createLogFile(); }; diff --git a/dists/scummvm.rc b/dists/scummvm.rc index 109437305c..d3330045b5 100644 --- a/dists/scummvm.rc +++ b/dists/scummvm.rc @@ -5,6 +5,7 @@ #endif #define FILE 256 +#define IDI_ICON 1001 IDI_ICON ICON DISCARDABLE "icons/scummvm.ico" diff --git a/dists/scummvm.rc.in b/dists/scummvm.rc.in index c043ce1644..8186e0e8ef 100644 --- a/dists/scummvm.rc.in +++ b/dists/scummvm.rc.in @@ -5,6 +5,7 @@ #endif #define FILE 256 +#define IDI_ICON 1001 IDI_ICON ICON DISCARDABLE "icons/scummvm.ico" -- cgit v1.2.3 From 0a9b9fe08f3b5fa8f9a505887fccd88b42f7f1b9 Mon Sep 17 00:00:00 2001 From: CeRiAl Date: Mon, 27 Jun 2011 02:00:33 +0200 Subject: WINCE: Added option to disable panel toggling with double tap on top of screen --- backends/events/wincesdl/wincesdl-events.cpp | 3 ++- backends/graphics/wincesdl/wincesdl-graphics.cpp | 5 ++++- backends/graphics/wincesdl/wincesdl-graphics.h | 1 + backends/platform/wince/CEActionsPocket.cpp | 3 ++- backends/platform/wince/CEActionsSmartphone.cpp | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/backends/events/wincesdl/wincesdl-events.cpp b/backends/events/wincesdl/wincesdl-events.cpp index 4fab47a58e..1116cbbb8d 100644 --- a/backends/events/wincesdl/wincesdl-events.cpp +++ b/backends/events/wincesdl/wincesdl-events.cpp @@ -183,7 +183,8 @@ bool WINCESdlEventSource::pollEvent(Common::Event &event) { if (_tapTime) { // second tap if (_closeClick && (GetTickCount() - _tapTime < 1000)) { if (event.mouse.y <= 20 && - _graphicsMan->_panelInitialized) { + _graphicsMan->_panelInitialized && + !_graphicsMan->_noDoubleTapPT) { // top of screen (show panel) _graphicsMan->swap_panel_visibility(); } else if (!_graphicsMan->_noDoubleTapRMB) { diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index b8c8b7754d..2ca78cedde 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -44,7 +44,7 @@ WINCESdlGraphicsManager::WINCESdlGraphicsManager(SdlEventSource *sdlEventSource) : SurfaceSdlGraphicsManager(sdlEventSource), - _panelInitialized(false), _noDoubleTapRMB(false), + _panelInitialized(false), _noDoubleTapRMB(false), _noDoubleTapPT(false), _toolbarHighDrawn(false), _newOrientation(0), _orientationLandscape(0), _panelVisible(true), _saveActiveToolbar(NAME_MAIN_PANEL), _panelStateForced(false), _canBeAspectScaled(false), _scalersChanged(false), _saveToolbarState(false), @@ -478,6 +478,9 @@ void WINCESdlGraphicsManager::update_game_settings() { if (ConfMan.hasKey("no_doubletap_rightclick")) _noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick"); + + if (ConfMan.hasKey("no_doubletap_paneltoggle")) + _noDoubleTapPT = ConfMan.getBool("no_doubletap_paneltoggle"); } void WINCESdlGraphicsManager::internUpdateScreen() { diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index 89aba92eae..92894e0dcd 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -117,6 +117,7 @@ public: bool _panelInitialized; // only initialize the toolbar once bool _noDoubleTapRMB; // disable double tap -> rmb click + bool _noDoubleTapPT; // disable double tap for toolbar toggling CEGUI::ToolbarHandler _toolbarHandler; diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index a4786d330d..194f855e98 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -137,6 +137,7 @@ void CEActionsPocket::initInstanceGame() { bool is_tinsel = (gameid == "tinsel"); bool is_cruise = (gameid == "cruise"); bool is_made = (gameid == "made"); + bool is_sci = (gameid == "sci"); GUI_Actions::initInstanceGame(); @@ -219,7 +220,7 @@ void CEActionsPocket::initInstanceGame() { // Key bind method _action_enabled[POCKET_ACTION_BINDKEYS] = true; // Disable double-tap right-click for convenience - if (is_tinsel || is_cruise) + if (is_tinsel || is_cruise || is_sci) if (!ConfMan.hasKey("no_doubletap_rightclick")) { ConfMan.setBool("no_doubletap_rightclick", true); ConfMan.flushToDisk(); diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index b12dadabb6..c6456d3eb5 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -128,6 +128,7 @@ void CEActionsSmartphone::initInstanceGame() { bool is_tinsel = (gameid == "tinsel"); bool is_cruise = (gameid == "cruise"); bool is_made = (gameid == "made"); + bool is_sci = (gameid == "sci"); GUI_Actions::initInstanceGame(); @@ -185,7 +186,7 @@ void CEActionsSmartphone::initInstanceGame() { // Bind keys _action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true; // Disable double-tap right-click for convenience - if (is_tinsel || is_cruise) + if (is_tinsel || is_cruise || is_sci) if (!ConfMan.hasKey("no_doubletap_rightclick")) { ConfMan.setBool("no_doubletap_rightclick", true); ConfMan.flushToDisk(); -- cgit v1.2.3 From 6cea946f16cee1529863b0d5ca77cfbf4bfb01b1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 27 Jun 2011 22:54:28 +1000 Subject: TSAGE: Separated the sound manager processing into it's own thread This will be necessary with the introduction of the Sound FX driver, since the sound manager will do the processing for both drivers, but each will need to do their own output in their AudioStream thread --- engines/tsage/events.h | 1 + engines/tsage/sound.cpp | 344 ++++++++++++++++++++++++++++++++++++++++++++---- engines/tsage/sound.h | 73 +++++++++- 3 files changed, 382 insertions(+), 36 deletions(-) diff --git a/engines/tsage/events.h b/engines/tsage/events.h index a13455d378..e0fbd88745 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -37,6 +37,7 @@ enum EventType {EVENT_NONE = 0, EVENT_BUTTON_DOWN = 1, EVENT_BUTTON_UP = 2, EVEN enum ButtonShiftFlags {BTNSHIFT_LEFT = 0, BTNSHIFT_RIGHT = 3, BTNSHIFT_MIDDLE = 4}; // Intrinisc game delay between execution frames. This runs at 60Hz +#define GAME_FRAME_RATE 60 #define GAME_FRAME_TIME (1000 / 60) class GfxManager; diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 2c00e6ec47..01e770a77a 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -31,25 +31,6 @@ namespace tSage { static SoundManager *_soundManager = NULL; -#if 0 -static void dumpVoiceStruct() { - VoiceTypeStruct *vt = _soundManager->_voiceTypeStructPtrs[1]; - if (!vt) { - debug("Not setup"); - return; - } - - assert(vt->_voiceType == VOICETYPE_1); - for (uint idx = 0; idx < vt->_entries.size(); ++idx) { - VoiceStructEntryType1 &vte = vt->_entries[idx]._type1; - debug("#%d - s=%p, ch=%x, pr=%x | s2=%p, ch2=%x, pr2=%x | s3=%p, ch3=%x, pr3=%x", - idx, (void *)vte._sound, vte._channelNum, vte._priority, - (void *)vte._sound2, vte._channelNum2, vte._priority2, - (void *)vte._sound3, vte._channelNum3, vte._priority3); - } -} -#endif - /*--------------------------------------------------------------------------*/ SoundManager::SoundManager() { @@ -84,6 +65,8 @@ SoundManager::~SoundManager() { delete driver; } _sfTerminate(); + + g_system->getTimerManager()->removeTimerProc(_sfUpdateCallback); } _soundManager = NULL; @@ -94,6 +77,10 @@ void SoundManager::postInit() { _saver->addSaveNotifier(&SoundManager::saveNotifier); _saver->addLoadNotifier(&SoundManager::loadNotifier); _saver->addListener(this); + + // Install a timer for handling sound manager updates at 60Hz + g_system->getTimerManager()->installTimerProc(_sfUpdateCallback, 1000000 / GAME_FRAME_RATE, NULL); + __sndmgrReady = true; } } @@ -1330,7 +1317,6 @@ bool SoundManager::_sfInstallDriver(SoundDriver *driver) { if (!driver->open()) return false; - driver->setUpdateCallback(_sfUpdateCallback, (void *)&sfManager()); sfManager()._installedDrivers.push_back(driver); driver->_groupOffset = driver->getGroupData(); driver->_groupMask = READ_LE_UINT32(driver->_groupOffset); @@ -2444,8 +2430,6 @@ const int v440D4[48] = { }; AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { - _upCb = NULL; - _upRef = NULL; _minVersion = 0x102; _maxVersion = 0x10A; _masterVolume = 0; @@ -2586,7 +2570,16 @@ void AdlibSoundDriver::setPitch(int channel, int pitchBlend) { void AdlibSoundDriver::write(byte reg, byte value) { _portContents[reg] = value; - OPLWriteReg(_opl, reg, value); + _queue.push(RegisterValue(reg, value)); +} + +void AdlibSoundDriver::flush() { + Common::StackLock slock(SoundManager::sfManager()._serverDisabledMutex); + + while (!_queue.empty()) { + RegisterValue v = _queue.pop(); + OPLWriteReg(_opl, v._regNum, v._value); + } } void AdlibSoundDriver::updateChannelVolume(int channelNum) { @@ -2725,18 +2718,311 @@ void AdlibSoundDriver::update(int16 *buf, int len) { len -= count; YM3812UpdateOne(_opl, buf, count); if (samplesLeft == 0) { - if (_upCb) { - (*_upCb)(_upRef); - } + flush(); samplesLeft = _sampleRate / 50; } buf += count; } } -void AdlibSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) { - _upCb = upCb; - _upRef = ref; +/*--------------------------------------------------------------------------*/ + +const byte adlibFx_group_data[] = { 3, 1, 1, 0, 0xff }; + + +AdlibFxSoundDriver::AdlibFxSoundDriver(): SoundDriver() { + _minVersion = 0x102; + _maxVersion = 0x10A; + _masterVolume = 0; + + _groupData.groupMask = 9; + _groupData.v1 = 0x3E; + _groupData.v2 = 0; + _groupData.pData = &adlib_group_data[0]; + + _mixer = _vm->_mixer; + _sampleRate = _mixer->getOutputRate(); + _opl = makeAdLibOPL(_sampleRate); + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); +/* + Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); + memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44070, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + _v44082[ADLIB_CHANNEL_COUNT] = 0x90; + Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000); + memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); + _patchData = NULL; +*/ +} + +AdlibFxSoundDriver::~AdlibFxSoundDriver() { + _mixer->stopHandle(_soundHandle); + OPLDestroy(_opl); +} + +bool AdlibFxSoundDriver::open() { + + + write(1, 0x20); + if (!reset()) + return false; + + write(8, 0); + for (int idx = 0x20; idx < 0xF6; ++idx) + write(idx, 0); + + write(0xBD, 0); + return true; +} + +void AdlibFxSoundDriver::close() { + for (int idx = 0xB0; idx < 0xB8; ++idx) + write(idx, _portContents[idx] & 0xDF); + for (int idx = 0x40; idx < 0x55; ++idx) + write(idx, 0x3F); + reset(); +} + +bool AdlibFxSoundDriver::reset() { + write(1, 0x20); + write(1, 0x20); + + return true; +} + +const GroupData *AdlibFxSoundDriver::getGroupData() { + return &_groupData; +} + +int AdlibFxSoundDriver::setMasterVolume(int volume) { + int oldVolume = _masterVolume; + _masterVolume = volume; + + for (int channelNum = 0; channelNum < ADLIB_CHANNEL_COUNT; ++channelNum) + updateChannelVolume(channelNum); + + return oldVolume; +} + +void AdlibFxSoundDriver::proc32(int channel, int program, int v0, int v1) { + if (program == -1) + return; +/* + int offset = READ_LE_UINT16(_patchData + program * 2); + if (offset) { + const byte *dataP = _patchData + offset; + int id; + + for (offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) { + if ((dataP[offset] <= v0) && (dataP[offset + 1] >= v0)) { + if (dataP[offset + 2] != 0xff) + v0 = dataP[offset + 2]; + + _v4409E[channel] = dataP + offset - _patchData; + + // Set sustain/release + int portNum = v440C2[v440B0[channel]] + 0x80; + write(portNum, (_portContents[portNum] & 0xF0) | 0xF); + + portNum = v440C2[v440B9[channel]] + 0x80; + write(portNum, (_portContents[portNum] & 0xF0) | 0xF); + + if (_channelVoiced[channel]) + clearVoice(channel); + + _v44067[channel] = v0; + _v4405E[channel] = v1; + + updateChannel(channel); + setFrequency(channel); + updateChannelVolume(channel); + setVoice(channel); + break; + } + } + } + */ +} + +void AdlibFxSoundDriver::updateVoice(int channel) { + if (_channelVoiced[channel]) + clearVoice(channel); +} + +void AdlibFxSoundDriver::proc38(int channel, int cmd, int value) { + if (cmd == 7) { + // Set channel volume + _channelVolume[channel] = value; + updateChannelVolume(channel); + } +} + +void AdlibFxSoundDriver::setPitch(int channel, int pitchBlend) { + _pitchBlend[channel] = pitchBlend; + setFrequency(channel); +} + +void AdlibFxSoundDriver::write(byte reg, byte value) { + _portContents[reg] = value; + _queue.push(RegisterValue(reg, value)); +} + +void AdlibFxSoundDriver::flush() { + Common::StackLock slock(SoundManager::sfManager()._serverDisabledMutex); + + while (!_queue.empty()) { + RegisterValue v = _queue.pop(); + OPLWriteReg(_opl, v._regNum, v._value); + } +} + +void AdlibFxSoundDriver::updateChannelVolume(int channelNum) { + int volume = (_masterVolume * _channelVolume[channelNum] / 127 * _v4405E[channelNum] / 127) / 2; + int level2 = 63 - v44134[volume * _v44079[channelNum] / 63]; + int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] : + 63 - v44134[volume * _v44070[channelNum] / 63]; + + int portNum = v440C2[v440B0[channelNum]] + 0x40; + write(portNum, (_portContents[portNum] & 0x80) | level1); + + portNum = v440C2[v440B9[channelNum]] + 0x40; + write(portNum, (_portContents[portNum] & 0x80) | level2); +} + +void AdlibFxSoundDriver::setVoice(int channel) { + int portNum = 0xB0 + channel; + write(portNum, _portContents[portNum] | 0x20); + _channelVoiced[channel] = true; +} + +void AdlibFxSoundDriver::clearVoice(int channel) { + write(0xB0 + channel, _portContents[0xB0 + channel] & ~0x20); + _channelVoiced[channel] = false; +} + +void AdlibFxSoundDriver::updateChannel(int channel) { +/* + const byte *dataP = _patchData + _v4409E[channel]; + int portOffset = v440C2[v440B0[channel]]; + + int portNum = portOffset + 0x20; + int portValue = 0; + if (*(dataP + 4)) + portValue |= 0x80; + if (*(dataP + 5)) + portValue |= 0x40; + if (*(dataP + 8)) + portValue |= 0x20; + if (*(dataP + 6)) + portValue |= 0x10; + portValue |= *(dataP + 7); + write(portNum, portValue); + + portValue = (_portContents[0x40 + portOffset] & 0x3F) | (*(dataP + 9) << 6); + write(0x40 + portOffset, portValue); + + _v44070[channel] = 63 - *(dataP + 10); + write(0x60 + portOffset, *(dataP + 12) | (*(dataP + 11) << 4)); + write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4)); + write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15)); + + portOffset = v440C2[v440B9[channel]]; + portNum = portOffset + 0x20; + portValue = 0; + if (*(dataP + 17)) + portValue |= 0x80; + if (*(dataP + 18)) + portValue |= 0x40; + if (*(dataP + 21)) + portValue |= 0x20; + if (*(dataP + 19)) + portValue |= 0x10; + portValue |= *(dataP + 20); + write(portNum, portValue); + + write(0x40 + portOffset, (_portContents[0x40 + portOffset] & 0x3f) | (*(dataP + 22) << 6)); + _v44079[channel] = 0x3F - *(dataP + 23); + write(0x60 + portOffset, *(dataP + 25) | (*(dataP + 24) << 4)); + write(0x80 + portOffset, *(dataP + 27) | (*(dataP + 26) << 4)); + write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 28)); + + write(0xC0 + channel, (_portContents[0xC0 + channel] & 0xF0) + | (*(dataP + 16) << 1) | *(dataP + 3)); + + _v44082[channel] = *(dataP + 3); + */ +} + +void AdlibFxSoundDriver::setFrequency(int channel) { + int offset, ch; + + int v = _pitchBlend[channel]; + if (v == 0x2000) { + offset = 0; + ch = _v44067[channel]; + } else if (v > 0x2000) { + ch = _v44067[channel]; + v -= 0x2000; + if (v == 0x1fff) + v = 0x2000; + + offset = (v / 170) & 3; + ch += (v / 170) >> 2; + + if (ch >= 128) + ch = 127; + } else { + ch = _v44067[channel]; + int tempVal = (0x2000 - v) / 170; + int tempVal2 = 4 - (tempVal & 3); + + if (tempVal2 == 4) + offset = 0; + else { + offset = tempVal2; + --ch; + } + + ch -= tempVal >> 2; + if (ch < 0) + ch = 0; + } + + int var2 = ch / 12; + if (var2) + --var2; + + int dataWord = v440D4[((ch % 12) << 2) + offset]; + write(0xA0 + channel, dataWord & 0xff); + write(0xB0 + channel, (_portContents[0xB0 + channel] & 0xE0) | + ((dataWord >> 8) & 3) | (var2 << 2)); +} + +int AdlibFxSoundDriver::readBuffer(int16 *buffer, const int numSamples) { + update(buffer, numSamples); + return numSamples; +} + +void AdlibFxSoundDriver::update(int16 *buf, int len) { + static int samplesLeft = 0; + while (len != 0) { + int count = samplesLeft; + if (count > len) { + count = len; + } + samplesLeft -= count; + len -= count; + YM3812UpdateOne(_opl, buf, count); + if (samplesLeft == 0) { + flush(); + samplesLeft = _sampleRate / 50; + } + buf += count; + } } } // End of namespace tSage diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 4647e3c564..27f30b9b08 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "common/mutex.h" +#include "common/queue.h" #include "audio/audiostream.h" #include "audio/fmopl.h" #include "audio/mixer.h" @@ -65,6 +66,15 @@ struct GroupData { const byte *pData; }; +struct RegisterValue { + uint8 _regNum; + uint8 _value; + + RegisterValue(int regNum, int value) { + _regNum = regNum; _value = value; + } +}; + class SoundDriver { public: Common::String _shortDescription, _longDescription; @@ -73,10 +83,6 @@ public: uint32 _groupMask; const GroupData *_groupOffset; int _driverResID; - - typedef void (*UpdateCallback)(void *); - UpdateCallback _upCb; - void *_upRef; public: SoundDriver(); virtual ~SoundDriver() {}; @@ -106,8 +112,6 @@ public: virtual void proc38(int channel, int cmd, int value) {} // Method #19 virtual void setPitch(int channel, int pitchBlend) {} // Method #20 virtual void proc42(int channel, int v0, int v1) {} // Method #21 - - virtual void setUpdateCallback(UpdateCallback upCb, void *ref) {} }; struct VoiceStructEntryType0 { @@ -405,6 +409,7 @@ private: byte _portContents[256]; const byte *_patchData; int _masterVolume; + Common::Queue _queue; bool _channelVoiced[ADLIB_CHANNEL_COUNT]; int _channelVolume[ADLIB_CHANNEL_COUNT]; @@ -418,6 +423,7 @@ private: void write(byte reg, byte value); + void flush(); void updateChannelVolume(int channel); void setVoice(int channel); void clearVoice(int channel); @@ -437,7 +443,6 @@ public: virtual void updateVoice(int channel); virtual void proc38(int channel, int cmd, int value); virtual void setPitch(int channel, int pitchBlend); - virtual void setUpdateCallback(UpdateCallback upCb, void *ref); // AudioStream interface virtual int readBuffer(int16 *buffer, const int numSamples); @@ -448,6 +453,60 @@ public: void update(int16 *buf, int len); }; +class AdlibFxSoundDriver: public SoundDriver, Audio::AudioStream { +private: + GroupData _groupData; + Audio::Mixer *_mixer; + FM_OPL *_opl; + Audio::SoundHandle _soundHandle; + int _sampleRate; + byte _portContents[256]; + int _masterVolume; + Common::Queue _queue; + + bool _channelVoiced[ADLIB_CHANNEL_COUNT]; + int _channelVolume[ADLIB_CHANNEL_COUNT]; + int _v4405E[ADLIB_CHANNEL_COUNT]; + int _v44067[ADLIB_CHANNEL_COUNT]; + int _v44070[ADLIB_CHANNEL_COUNT]; + int _v44079[ADLIB_CHANNEL_COUNT]; + int _v44082[ADLIB_CHANNEL_COUNT + 1]; + int _pitchBlend[ADLIB_CHANNEL_COUNT]; + int _v4409E[ADLIB_CHANNEL_COUNT]; + + + void write(byte reg, byte value); + void flush(); + void updateChannelVolume(int channel); + void setVoice(int channel); + void clearVoice(int channel); + void updateChannel(int channel); + void setFrequency(int channel); +public: + AdlibFxSoundDriver(); + virtual ~AdlibFxSoundDriver(); + + virtual bool open(); + virtual void close(); + virtual bool reset(); + virtual const GroupData *getGroupData(); + virtual void installPatch(const byte *data, int size) {} + virtual int setMasterVolume(int volume); + virtual void proc32(int channel, int program, int v0, int v1); + virtual void updateVoice(int channel); + virtual void proc38(int channel, int cmd, int value); + virtual void setPitch(int channel, int pitchBlend); + + // AudioStream interface + virtual int readBuffer(int16 *buffer, const int numSamples); + virtual bool isStereo() const { return false; } + virtual bool endOfData() const { return false; } + virtual int getRate() const { return _sampleRate; } + + void update(int16 *buf, int len); +}; + + } // End of namespace tSage #endif -- cgit v1.2.3 From 4b51bef7aebaef1f2a0e8a901a0d7bd0fee15447 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 27 Jun 2011 21:48:00 +0200 Subject: TOON: Add delay to inventory rendering loop. Uses a bit less CPU now. --- engines/toon/toon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index cb41db1967..26639d71f7 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -2695,7 +2695,7 @@ int32 ToonEngine::showInventory() { } renderInventory(); - + _system->delayMillis(10); } _gameState->_currentScrollValue = oldScrollValue; -- cgit v1.2.3 From 2d2ee68d2d2b807d1adb7bdb30d5f174f775ca1f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 01:57:21 -0400 Subject: BACKENDS: Update WindowsFilesystemNode::getChildren() to honor the hidden parameter (FR #1726611) Hidden folders (such as the recycle bin or temporary hidden folders) will no longer be visible in the file/folder browser (as is the case on the Posix and related backends) --- backends/fs/windows/windows-fs.cpp | 12 +++++++----- backends/fs/windows/windows-fs.h | 11 ++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp index 9e864753c9..c32ad2da94 100644 --- a/backends/fs/windows/windows-fs.cpp +++ b/backends/fs/windows/windows-fs.cpp @@ -54,7 +54,7 @@ bool WindowsFilesystemNode::isWritable() const { return _access(_path.c_str(), W_OK) == 0; } -void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data) { +void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, bool hidden, WIN32_FIND_DATA* find_data) { WindowsFilesystemNode entry; char *asciiName = toAscii(find_data->cFileName); bool isDirectory; @@ -63,6 +63,10 @@ void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const c if (!strcmp(asciiName, ".") || !strcmp(asciiName, "..")) return; + // Skip hidden files if asked + if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) && !hidden) + return; + isDirectory = (find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? true : false); if ((!isDirectory && mode == Common::FSNode::kListDirectoriesOnly) || @@ -163,8 +167,6 @@ AbstractFSNode *WindowsFilesystemNode::getChild(const Common::String &n) const { bool WindowsFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const { assert(_isDirectory); - //TODO: honor the hidden flag - if (_isPseudoRoot) { #ifndef _WIN32_WCE // Drives enumeration @@ -200,10 +202,10 @@ bool WindowsFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b if (handle == INVALID_HANDLE_VALUE) return false; - addFile(myList, mode, _path.c_str(), &desc); + addFile(myList, mode, _path.c_str(), hidden, &desc); while (FindNextFile(handle, &desc)) - addFile(myList, mode, _path.c_str(), &desc); + addFile(myList, mode, _path.c_str(), hidden, &desc); FindClose(handle); } diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h index 37d1e9099b..351307bef0 100644 --- a/backends/fs/windows/windows-fs.h +++ b/backends/fs/windows/windows-fs.h @@ -93,12 +93,13 @@ private: * Adds a single WindowsFilesystemNode to a given list. * This method is used by getChildren() to populate the directory entries list. * - * @param list List to put the file entry node in. - * @param mode Mode to use while adding the file entry to the list. - * @param base Common::String with the directory being listed. - * @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find. + * @param list List to put the file entry node in. + * @param mode Mode to use while adding the file entry to the list. + * @param base Common::String with the directory being listed. + * @param hidden true if hidden files should be added, false otherwise + * @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find. */ - static void addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data); + static void addFile(AbstractFSList &list, ListMode mode, const char *base, bool hidden, WIN32_FIND_DATA* find_data); /** * Converts a Unicode string to Ascii format. -- cgit v1.2.3 From 857f146bcb585ddffba581eb9d7ad7c8f20e7f5f Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Tue, 28 Jun 2011 11:18:52 +0400 Subject: DREAMWEB: Removed memcpy as suggested by wjp --- engines/dreamweb/runtime.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 2951ad85d7..a97ea2cf3d 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -464,12 +464,9 @@ public: inline void _movsb(uint size, bool clear_cx = false) { assert(size != 0xffff); - uint8 *dst = es.ptr(di, size); - uint8 *src = ds.ptr(si, size); - assert(src < dst || src >= dst + size); - memcpy(dst, src, size); - di += size; - si += size; + //fixme: add overlap and segment boundary check and rewrite + while(size--) + _movsb(); if (clear_cx) cx = 0; } -- cgit v1.2.3 From 168ba00ea36f8ef6e6127ef5091a5cf9f6c1b190 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 28 Jun 2011 12:55:05 +0300 Subject: SCI: Fixed script bug #3292327 - "SCI: HOYLE4: Cribbage bug" --- engines/sci/engine/workarounds.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 768ba28518..e61da20f97 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -77,6 +77,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = { { GID_HOYLE4, 700, 700, 1, "BridgeHand", "calcQTS", -1, 3, { WORKAROUND_FAKE, 0 } }, // sometimes when placing a bid in bridge { GID_HOYLE4, 300, 300, 0, "", "export 2", 0x1d4d, 0, { WORKAROUND_FAKE, 0 } }, // after passing around cards in hearts { GID_HOYLE4, 400, 400, 1, "GinHand", "calcRuns", -1, 4, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Gin Rummy (e.g. when knocking and placing a card) - bug #3292334 + { GID_HOYLE4, 500, 17, 1, "Character", "say", -1, 504, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Cribbage (e.g. when the opponent says "Last Card") - bug #3292327 { GID_ISLANDBRAIN, 100, 937, 0, "IconBar", "dispatchEvent", -1, 58, { WORKAROUND_FAKE, 0 } }, // when using ENTER at the startup menu - bug #3045225 { GID_ISLANDBRAIN, 140, 140, 0, "piece", "init", -1, 3, { WORKAROUND_FAKE, 1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0 { GID_ISLANDBRAIN, 200, 268, 0, "anElement", "select", -1, 0, { WORKAROUND_FAKE, 0 } }, // elements puzzle, gets used before super TextIcon -- cgit v1.2.3 From c2319a3a81104deeaa1aaae2e5b22c8306ea4fa1 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Jun 2011 15:28:26 +0200 Subject: MOHAWK: Make LB's readString/readRect more generic. --- engines/mohawk/livingbooks.cpp | 4 ++-- engines/mohawk/livingbooks.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 397281fe74..64383f6d2d 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -42,7 +42,7 @@ namespace Mohawk { // read a null-terminated string from a stream -Common::String MohawkEngine_LivingBooks::readString(Common::SeekableSubReadStreamEndian *stream) { +Common::String MohawkEngine_LivingBooks::readString(Common::ReadStream *stream) { Common::String ret; while (!stream->eos()) { byte in = stream->readByte(); @@ -54,7 +54,7 @@ Common::String MohawkEngine_LivingBooks::readString(Common::SeekableSubReadStrea } // read a rect from a stream -Common::Rect MohawkEngine_LivingBooks::readRect(Common::SeekableSubReadStreamEndian *stream) { +Common::Rect MohawkEngine_LivingBooks::readRect(Common::ReadStreamEndian *stream) { Common::Rect rect; // the V1 mac games have their rects in QuickDraw order diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 02fe34e8c2..c39e7f4227 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -655,8 +655,8 @@ public: void addNotifyEvent(NotifyEvent event); Common::SeekableSubReadStreamEndian *wrapStreamEndian(uint32 tag, uint16 id); - Common::String readString(Common::SeekableSubReadStreamEndian *stream); - Common::Rect readRect(Common::SeekableSubReadStreamEndian *stream); + Common::String readString(Common::ReadStream *stream); + Common::Rect readRect(Common::ReadStreamEndian *stream); GUI::Debugger *getDebugger() { return _console; } void addArchive(MohawkArchive *archive); -- cgit v1.2.3 From c2e9319fa8101051a7f2dc9fda747c76164cb6d9 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Jun 2011 15:30:43 +0200 Subject: MOHAWK: Handle kLBOpRunData properly. --- engines/mohawk/livingbooks.cpp | 77 +++++++++++++++++++++++------------------- engines/mohawk/livingbooks.h | 26 +++++++++----- 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 64383f6d2d..2e7f5e6d9d 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -32,6 +32,7 @@ #include "common/archive.h" #include "common/textconsole.h" #include "common/system.h" +#include "common/memstream.h" #include "graphics/palette.h" @@ -1873,6 +1874,7 @@ uint16 LBAnimation::getParentId() { LBScriptEntry::LBScriptEntry() { state = 0; + data = NULL; argvParam = NULL; argvTarget = NULL; } @@ -1880,6 +1882,7 @@ LBScriptEntry::LBScriptEntry() { LBScriptEntry::~LBScriptEntry() { delete[] argvParam; delete[] argvTarget; + delete[] data; for (uint i = 0; i < subentries.size(); i++) delete subentries[i]; @@ -1943,7 +1946,10 @@ void LBItem::readFrom(Common::SeekableSubReadStreamEndian *stream) { uint16 dataSize = stream->readUint16(); debug(4, "Data type %04x, size %d", dataType, dataSize); - readData(dataType, dataSize, stream); + byte *buf = new byte[dataSize]; + stream->read(buf, dataSize); + readData(dataType, dataSize, buf); + delete[] buf; if ((uint)stream->pos() != oldPos + 4 + (uint)dataSize) error("Failed to read correct number of bytes (off by %d) for data type %04x (size %d)", @@ -1956,7 +1962,7 @@ void LBItem::readFrom(Common::SeekableSubReadStreamEndian *stream) { } } -LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::SeekableSubReadStreamEndian *stream, bool isSubentry) { +LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::MemoryReadStreamEndian *stream, bool isSubentry) { if (size < 6) error("Script entry of type 0x%04x was too small (%d)", type, size); @@ -2081,37 +2087,33 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Seeka debug(4, "kLBOpSendExpression: offset %08x", entry->offset); size -= 4; } - if (entry->opcode == 0xffff) { + if (entry->opcode == kLBOpRunData) { if (size < 4) - error("didn't get enough bytes (%d) to read message in script entry", size); - uint16 msgId = stream->readUint16(); - uint16 msgLen = stream->readUint16(); + error("didn't get enough bytes (%d) to read data header in script entry", size); + entry->dataType = stream->readUint16(); + entry->dataLen = stream->readUint16(); size -= 4; - if (msgId == kLBSetPlayInfo) { - if (size != 20) - error("wah, more than just the kLBSetPlayInfo in here"); - // FIXME - warning("ignoring kLBSetPlayInfo"); - size -= 20; - stream->skip(20); - return entry; - } - if (msgId != kLBCommand) - error("expected a command in script entry, got 0x%04x", msgId); + if (size < entry->dataLen) + error("didn't get enough bytes (%d) to read data in script entry", size); - if (msgLen != size - (entry->event == kLBEventNotified ? 4 : 0) && !conditionTag) - error("script entry msgLen %d is not equal to size %d", msgLen, size); - - Common::String command = _vm->readString(stream); - if (command.size() + 1 > size) { - error("failed to read command in script entry: msgLen %d, command '%s' (%d chars)", - msgLen, command.c_str(), command.size()); + if (entry->dataType == kLBCommand) { + Common::String command = _vm->readString(stream); + uint commandSize = command.size() + 1; + if (commandSize > entry->dataLen) + error("failed to read command in script entry: dataLen %d, command '%s' (%d chars)", + entry->dataLen, command.c_str(), commandSize); + entry->dataLen = commandSize; + entry->data = new byte[commandSize]; + memcpy(entry->data, command.c_str(), commandSize); + size -= commandSize; + } else { + if (conditionTag) + error("kLBOpRunData had unexpected conditionTag"); + entry->data = new byte[entry->dataLen]; + stream->read(entry->data, entry->dataLen); + size -= entry->dataLen; } - size -= command.size() + 1; - - entry->command = command; - debug(4, "script entry command '%s'", command.c_str()); } if (entry->event == kLBEventNotified) { if (size < 4) @@ -2162,7 +2164,12 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Seeka return entry; } -void LBItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) { +void LBItem::readData(uint16 type, uint16 size, byte *data) { + Common::MemoryReadStreamEndian stream(data, size, _vm->isBigEndian()); + readData(type, size, &stream); +} + +void LBItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) { switch (type) { case kLBMsgListScript: case kLBNotifyScript: @@ -2831,8 +2838,8 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { } break; - case kLBOpRunCommand: - runCommand(entry->command); + case kLBOpRunData: + readData(entry->dataType, entry->dataLen, entry->data); break; case kLBOpJumpUnlessExpression: @@ -3168,7 +3175,7 @@ LBGroupItem::LBGroupItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rec _starting = false; } -void LBGroupItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) { +void LBGroupItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) { switch (type) { case kLBGroupData: { @@ -3289,7 +3296,7 @@ LBPaletteItem::~LBPaletteItem() { delete[] _palette; } -void LBPaletteItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) { +void LBPaletteItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) { switch (type) { case kLBPaletteXData: { @@ -3369,7 +3376,7 @@ LBLiveTextItem::LBLiveTextItem(MohawkEngine_LivingBooks *vm, LBPage *page, Commo debug(3, "new LBLiveTextItem"); } -void LBLiveTextItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) { +void LBLiveTextItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) { switch (type) { case kLBLiveTextData: { @@ -3614,7 +3621,7 @@ LBPictureItem::LBPictureItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common: debug(3, "new LBPictureItem"); } -void LBPictureItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) { +void LBPictureItem::readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) { switch (type) { case kLBSetDrawMode: { diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index c39e7f4227..02cf6c3f64 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -29,7 +29,6 @@ #include "mohawk/sound.h" #include "common/config-file.h" -#include "common/substream.h" #include "common/rect.h" #include "common/queue.h" #include "common/random.h" @@ -38,6 +37,11 @@ #include "livingbooks_code.h" +namespace Common { + class SeekableSubReadStreamEndian; + class MemoryReadStreamEndian; +} + namespace Mohawk { #define LBKEY_MOD_CTRL 1 @@ -218,7 +222,7 @@ enum { kLBOpBreakExpression = 0xfffc, kLBOpJumpToExpression = 0xfffd, kLBOpRunSubentries = 0xfffe, - kLBOpRunCommand = 0xffff + kLBOpRunData = 0xffff }; enum { @@ -277,7 +281,10 @@ struct LBScriptEntry { // kLBOpJumpUnlessExpression uint16 target; - Common::String command; + uint16 dataType; + uint16 dataLen; + byte *data; + Common::Array conditions; Common::Array subentries; }; @@ -368,7 +375,8 @@ public: virtual ~LBItem(); void readFrom(Common::SeekableSubReadStreamEndian *stream); - virtual void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void readData(uint16 type, uint16 size, byte *data); + virtual void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream); virtual void destroySelf(); // 0x2 virtual void setEnabled(bool enabled); // 0x3 @@ -430,7 +438,7 @@ protected: void runCommand(const Common::String &command); bool checkCondition(const Common::String &condition); - LBScriptEntry *parseScriptEntry(uint16 type, uint16 &size, Common::SeekableSubReadStreamEndian *stream, bool isSubentry = false); + LBScriptEntry *parseScriptEntry(uint16 type, uint16 &size, Common::MemoryReadStreamEndian *stream, bool isSubentry = false); }; class LBSoundItem : public LBItem { @@ -455,7 +463,7 @@ class LBGroupItem : public LBItem { public: LBGroupItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); - void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream); void destroySelf(); void setEnabled(bool enabled); @@ -480,7 +488,7 @@ public: LBPaletteItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); ~LBPaletteItem(); - void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream); bool togglePlaying(bool playing, bool restart); void update(); @@ -506,7 +514,7 @@ class LBLiveTextItem : public LBItem { public: LBLiveTextItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); - void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream); bool contains(Common::Point point); void update(); @@ -535,7 +543,7 @@ class LBPictureItem : public LBItem { public: LBPictureItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); - void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream); bool contains(Common::Point point); void draw(); -- cgit v1.2.3 From ede71596ba43c777d13201757c974aa22fd0e8ec Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Jun 2011 15:34:09 +0200 Subject: MOHAWK: Better sanity checks in LB scripting. --- engines/mohawk/livingbooks.cpp | 8 ++++++++ engines/mohawk/livingbooks_code.cpp | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 2e7f5e6d9d..248a9e607a 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -2016,6 +2016,8 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Memor if (targetingType == kTargetTypeCode) error("encountered kTargetTypeCode"); + if (size < 2) + error("not enough bytes (%d) reading special targeting", size); uint16 count = stream->readUint16(); size -= 2; @@ -2026,6 +2028,8 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Memor Common::String target = _vm->readString(stream); debug(4, "target '%s'", target.c_str()); entry->targets.push_back(target); + if (target.size() + 1 > size) + error("failed to read target (ran out of stream)"); size -= target.size() + 1; } entry->argc = entry->targets.size(); @@ -2134,6 +2138,8 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Memor } if (conditionTag == 1) { + if (!size) + error("failed to read condition (empty stream)"); Common::String condition = _vm->readString(stream); if (condition.size() == 0) { size--; @@ -2148,6 +2154,8 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Memor entry->conditions.push_back(condition); debug(4, "script entry condition '%s'", condition.c_str()); } else if (conditionTag == 2) { + if (size < 4) + error("expected more than %d bytes for conditionTag 2", size); // FIXME stream->skip(4); size -= 4; diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 8791fc4330..e72318d86a 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -250,8 +250,10 @@ LBValue LBCode::runCode(byte terminator) { parseStatement(); if (_stack.size()) result = _stack.pop(); - if (_currToken == terminator || _currToken == kTokenEndOfFile) + if (_currToken == terminator || _currToken == kTokenEndOfFile) { + debugN("\n"); break; + } if (_currToken != kTokenEndOfStatement && _currToken != kTokenEndOfFile) error("missing EOS (got %02x)", _currToken); debugN("\n"); -- cgit v1.2.3 From 71c4329d86566aa6281a4790b08fe8e77d057f10 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Jun 2011 11:58:52 -0400 Subject: MOHAWK: Rework archive handling A new base class has been introduced (aptly named "Archive"), which is much cleaner than inheriting from MohawkArchive. In addition, the underlying resource retrieving code has been merged to reduce dupliplication. --- engines/mohawk/cstime.cpp | 2 +- engines/mohawk/cursors.cpp | 2 +- engines/mohawk/livingbooks.cpp | 21 +- engines/mohawk/livingbooks.h | 10 +- engines/mohawk/mohawk.h | 4 +- engines/mohawk/myst.cpp | 4 +- engines/mohawk/resource.cpp | 592 +++++++++++++++++--------------------- engines/mohawk/resource.h | 143 +++------ engines/mohawk/riven.cpp | 4 +- engines/mohawk/riven_saveload.cpp | 2 +- 10 files changed, 322 insertions(+), 462 deletions(-) diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 59bc5ad661..3f9827581b 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -217,7 +217,7 @@ void MohawkEngine_CSTime::nextScene() { void MohawkEngine_CSTime::loadResourceFile(Common::String name) { MohawkArchive *archive = new MohawkArchive(); - if (!archive->open(name + ".mhk")) + if (!archive->openFile(name + ".mhk")) error("failed to open %s.mhk", name.c_str()); _mhk.push_back(archive); } diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index a797e4e127..3284a3228f 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -234,7 +234,7 @@ LivingBooksCursorManager_v2::LivingBooksCursorManager_v2() { // Try to open the system archive if we have it _sysArchive = new MohawkArchive(); - if (!_sysArchive->open("system.mhk")) { + if (!_sysArchive->openFile("system.mhk")) { delete _sysArchive; _sysArchive = 0; } diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 248a9e607a..8df5db720c 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -82,7 +82,7 @@ LBPage::LBPage(MohawkEngine_LivingBooks *vm) : _vm(vm) { _cascade = false; } -void LBPage::open(MohawkArchive *mhk, uint16 baseId) { +void LBPage::open(Archive *mhk, uint16 baseId) { _mhk = mhk; _baseId = baseId; @@ -385,8 +385,8 @@ bool MohawkEngine_LivingBooks::loadPage(LBMode mode, uint page, uint subpage) { warning("ignoring 'killgag' for filename '%s'", filename.c_str()); } - MohawkArchive *pageArchive = createMohawkArchive(); - if (!filename.empty() && pageArchive->open(filename)) { + Archive *pageArchive = createArchive(); + if (!filename.empty() && pageArchive->openFile(filename)) { _page = new LBPage(this); _page->open(pageArchive, 1000); } else { @@ -590,11 +590,11 @@ void MohawkEngine_LivingBooks::updatePage() { } } -void MohawkEngine_LivingBooks::addArchive(MohawkArchive *archive) { +void MohawkEngine_LivingBooks::addArchive(Archive *archive) { _mhk.push_back(archive); } -void MohawkEngine_LivingBooks::removeArchive(MohawkArchive *archive) { +void MohawkEngine_LivingBooks::removeArchive(Archive *archive) { for (uint i = 0; i < _mhk.size(); i++) { if (archive != _mhk[i]) continue; @@ -863,8 +863,11 @@ Common::String MohawkEngine_LivingBooks::convertWinFileName(const Common::String return filename; } -MohawkArchive *MohawkEngine_LivingBooks::createMohawkArchive() const { - return isPreMohawk() ? new LivingBooksArchive_v1() : new MohawkArchive(); +Archive *MohawkEngine_LivingBooks::createArchive() const { + if (isPreMohawk()) + return new LivingBooksArchive_v1(); + + return new MohawkArchive(); } bool MohawkEngine_LivingBooks::isPreMohawk() const { @@ -3855,8 +3858,8 @@ void LBProxyItem::init() { } debug(1, "LBProxyItem loading archive '%s' with id %d", filename.c_str(), baseId); - MohawkArchive *pageArchive = _vm->createMohawkArchive(); - if (!pageArchive->open(filename)) + Archive *pageArchive = _vm->createArchive(); + if (!pageArchive->openFile(filename)) error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str()); _page = new LBPage(_vm); _page->open(pageArchive, baseId); diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 02cf6c3f64..ed198a60c1 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -628,7 +628,7 @@ public: LBPage(MohawkEngine_LivingBooks *vm); ~LBPage(); - void open(MohawkArchive *mhk, uint16 baseId); + void open(Archive *mhk, uint16 baseId); uint16 getResourceVersion(); void itemDestroyed(LBItem *item); @@ -638,7 +638,7 @@ public: protected: MohawkEngine_LivingBooks *_vm; - MohawkArchive *_mhk; + Archive *_mhk; Common::Array _items; uint16 _baseId; @@ -667,8 +667,8 @@ public: Common::Rect readRect(Common::ReadStreamEndian *stream); GUI::Debugger *getDebugger() { return _console; } - void addArchive(MohawkArchive *archive); - void removeArchive(MohawkArchive *Archive); + void addArchive(Archive *archive); + void removeArchive(Archive *Archive); void addItem(LBItem *item); void removeItems(const Common::Array &items); @@ -697,7 +697,7 @@ public: // helper functions, also used by LBProxyItem Common::String getFileNameFromConfig(const Common::String §ion, const Common::String &key, Common::String &leftover); - MohawkArchive *createMohawkArchive() const; + Archive *createArchive() const; private: LivingBooksConsole *_console; diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index f0618f7374..2f0e570d56 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -77,7 +77,7 @@ enum MohawkGameFeatures { struct MohawkGameDescription; class Sound; class PauseDialog; -class MohawkArchive; +class Archive; class CursorManager; class MohawkEngine : public ::Engine { @@ -123,7 +123,7 @@ private: protected: // An array holding the main Mohawk archives require by the games - Common::Array _mhk; + Common::Array _mhk; }; } // End of namespace Mohawk diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index b60f8bd1ee..6bdf163a91 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -281,7 +281,7 @@ Common::Error MohawkEngine_Myst::run() { // Load Help System (Masterpiece Edition Only) if (getFeatures() & GF_ME) { MohawkArchive *mhk = new MohawkArchive(); - if (!mhk->open("help.dat")) + if (!mhk->openFile("help.dat")) error("Could not load help.dat"); _mhk.push_back(mhk); } @@ -488,7 +488,7 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS _mhk[0] = new MohawkArchive(); } - if (!_mhk[0]->open(mystFiles[_curStack])) + if (!_mhk[0]->openFile(mystFiles[_curStack])) error("Could not open %s", mystFiles[_curStack]); if (getPlatform() == Common::kPlatformMacintosh) diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 37fc73de67..2dc6d2252a 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -29,23 +29,25 @@ namespace Mohawk { -MohawkArchive::MohawkArchive() { - _mhk = NULL; - _types = NULL; - _fileTable = NULL; +// Base Archive code + +Archive::Archive() { + _stream = 0; +} + +Archive::~Archive() { + close(); } -bool MohawkArchive::open(const Common::String &filename) { +bool Archive::openFile(const Common::String &fileName) { Common::File *file = new Common::File(); - if (!file->open(filename)) { + if (!file->open(fileName)) { delete file; return false; } - _curFile = filename; - - if (!open(file)) { + if (!openStream(file)) { close(); return false; } @@ -53,431 +55,349 @@ bool MohawkArchive::open(const Common::String &filename) { return true; } -void MohawkArchive::close() { - delete _mhk; _mhk = NULL; - delete[] _types; _types = NULL; - delete[] _fileTable; _fileTable = NULL; - - _curFile.clear(); +void Archive::close() { + _types.clear(); + delete _stream; _stream = 0; } -bool MohawkArchive::open(Common::SeekableReadStream *stream) { - // Make sure no other file is open... - close(); - _mhk = stream; - - if (_mhk->readUint32BE() != ID_MHWK) { - warning("Could not find tag 'MHWK'"); - return false; - } - - /* uint32 fileSize = */ _mhk->readUint32BE(); - - if (_mhk->readUint32BE() != ID_RSRC) { - warning("Could not find tag \'RSRC\'"); +bool Archive::hasResource(uint32 tag, uint16 id) const { + if (!_types.contains(tag)) return false; - } - _rsrc.version = _mhk->readUint16BE(); + return _types[tag].contains(id); +} - if (_rsrc.version != 0x100) { - warning("Unsupported Mohawk resource version %d.%d", (_rsrc.version >> 8) & 0xff, _rsrc.version & 0xff); +bool Archive::hasResource(uint32 tag, const Common::String &resName) const { + if (!_types.contains(tag) || resName.empty()) return false; - } - _rsrc.compaction = _mhk->readUint16BE(); // Only used in creation, not in reading - _rsrc.filesize = _mhk->readUint32BE(); - _rsrc.abs_offset = _mhk->readUint32BE(); - _rsrc.file_table_offset = _mhk->readUint16BE(); - _rsrc.file_table_size = _mhk->readUint16BE(); + const ResourceMap &resMap = _types[tag]; - debug (3, "Absolute Offset = %08x", _rsrc.abs_offset); + for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++) + if (it->_value.name.equalsIgnoreCase(resName)) + return true; - ///////////////////////////////// - //Resource Dir - ///////////////////////////////// + return false; +} - // Type Table - _mhk->seek(_rsrc.abs_offset); - _typeTable.name_offset = _mhk->readUint16BE(); - _typeTable.resource_types = _mhk->readUint16BE(); +Common::SeekableReadStream *Archive::getResource(uint32 tag, uint16 id) { + if (!_types.contains(tag)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - debug (0, "Name List Offset = %04x Number of Resource Types = %04x", _typeTable.name_offset, _typeTable.resource_types); + const ResourceMap &resMap = _types[tag]; - _types = new Type[_typeTable.resource_types]; + if (!resMap.contains(id)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - for (uint16 i = 0; i < _typeTable.resource_types; i++) { - _types[i].tag = _mhk->readUint32BE(); - _types[i].resource_table_offset = _mhk->readUint16BE(); - _types[i].name_table_offset = _mhk->readUint16BE(); + const Resource &res = resMap[id]; - // HACK: Zoombini's SND resource starts will a NULL. - if (_types[i].tag == ID_SND) - debug (3, "Type[%02d]: Tag = \'SND\' ResTable Offset = %04x NameTable Offset = %04x", i, _types[i].resource_table_offset, _types[i].name_table_offset); - else - debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x NameTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset, _types[i].name_table_offset); + return new Common::SeekableSubReadStream(_stream, res.offset, res.offset + res.size); +} - // Resource Table - _mhk->seek(_rsrc.abs_offset + _types[i].resource_table_offset); - _types[i].resTable.resources = _mhk->readUint16BE(); +uint32 Archive::getOffset(uint32 tag, uint16 id) const { + if (!_types.contains(tag)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - debug (3, "Resources = %04x", _types[i].resTable.resources); + const ResourceMap &resMap = _types[tag]; - _types[i].resTable.entries = new Type::ResourceTable::Entries[_types[i].resTable.resources]; + if (!resMap.contains(id)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - for (uint16 j = 0; j < _types[i].resTable.resources; j++) { - _types[i].resTable.entries[j].id = _mhk->readUint16BE(); - _types[i].resTable.entries[j].index = _mhk->readUint16BE(); + return resMap[id].offset; +} - debug (4, "Entry[%02x]: ID = %04x (%d) Index = %04x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].index); - } +uint16 Archive::findResourceID(uint32 tag, const Common::String &resName) const { + if (!_types.contains(tag) || resName.empty()) + return 0xFFFF; - // Name Table - _mhk->seek(_rsrc.abs_offset + _types[i].name_table_offset); - _types[i].nameTable.num = _mhk->readUint16BE(); + const ResourceMap &resMap = _types[tag]; - debug (3, "Names = %04x", _types[i].nameTable.num); + for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++) + if (it->_value.name.equalsIgnoreCase(resName)) + return it->_key; - _types[i].nameTable.entries = new Type::NameTable::Entries[_types[i].nameTable.num]; + return 0xFFFF; +} - for (uint16 j = 0; j < _types[i].nameTable.num; j++) { - _types[i].nameTable.entries[j].offset = _mhk->readUint16BE(); - _types[i].nameTable.entries[j].index = _mhk->readUint16BE(); +Common::String Archive::getName(uint32 tag, uint16 id) const { + if (!_types.contains(tag)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - debug (4, "Entry[%02x]: Name List Offset = %04x Index = %04x", j, _types[i].nameTable.entries[j].offset, _types[i].nameTable.entries[j].index); + const ResourceMap &resMap = _types[tag]; - // Name List - uint32 pos = _mhk->pos(); - _mhk->seek(_rsrc.abs_offset + _typeTable.name_offset + _types[i].nameTable.entries[j].offset); - char c = (char)_mhk->readByte(); - while (c != 0) { - _types[i].nameTable.entries[j].name += c; - c = (char)_mhk->readByte(); - } + if (!resMap.contains(id)) + error("Archive does not contain '%s' %04x", tag2str(tag), id); - debug (3, "Name = \'%s\'", _types[i].nameTable.entries[j].name.c_str()); - - // Get back to next entry - _mhk->seek(pos); - } + return resMap[id].name; +} - // Return to next TypeTable entry - _mhk->seek(_rsrc.abs_offset + (i + 1) * 8 + 4); - debug (3, "\n"); - } +// Mohawk Archive code - _mhk->seek(_rsrc.abs_offset + _rsrc.file_table_offset); - _fileTableAmount = _mhk->readUint32BE(); - _fileTable = new FileTable[_fileTableAmount]; +struct FileTableEntry { + uint32 offset; + uint32 size; + byte flags; + uint16 unknown; +}; - for (uint32 i = 0; i < _fileTableAmount; i++) { - _fileTable[i].offset = _mhk->readUint32BE(); - _fileTable[i].dataSize = _mhk->readUint16BE(); - _fileTable[i].dataSize += _mhk->readByte() << 16; // Get bits 15-24 of dataSize too - _fileTable[i].flags = _mhk->readByte(); - _fileTable[i].unk = _mhk->readUint16BE(); +struct NameTableEntry { + uint16 index; + Common::String name; +}; - // Add in another 3 bits for file size from the flags. - // The flags are useless to us except for doing this ;) - _fileTable[i].dataSize += (_fileTable[i].flags & 7) << 24; +bool MohawkArchive::openStream(Common::SeekableReadStream *stream) { + // Make sure no other file is open... + close(); - debug (4, "File[%02x]: Offset = %08x DataSize = %07x Flags = %02x Unk = %04x", i, _fileTable[i].offset, _fileTable[i].dataSize, _fileTable[i].flags, _fileTable[i].unk); + if (stream->readUint32BE() != ID_MHWK) { + warning("Could not find tag 'MHWK'"); + return false; } - return true; -} - -int MohawkArchive::getTypeIndex(uint32 tag) { - for (uint16 i = 0; i < _typeTable.resource_types; i++) - if (_types[i].tag == tag) - return i; - return -1; // not found -} - -int MohawkArchive::getIDIndex(int typeIndex, uint16 id) { - for (uint16 i = 0; i < _types[typeIndex].resTable.resources; i++) - if (_types[typeIndex].resTable.entries[i].id == id) - return i; - return -1; // not found -} - -int MohawkArchive::getIDIndex(int typeIndex, const Common::String &resName) { - int index = -1; + /* uint32 fileSize = */ stream->readUint32BE(); - for (uint16 i = 0; i < _types[typeIndex].nameTable.num; i++) - if (_types[typeIndex].nameTable.entries[i].name.matchString(resName)) { - index = _types[typeIndex].nameTable.entries[i].index; - break; - } - - if (index < 0) - return -1; // Not found + if (stream->readUint32BE() != ID_RSRC) { + warning("Could not find tag \'RSRC\'"); + return false; + } - for (uint16 i = 0; i < _types[typeIndex].resTable.resources; i++) - if (_types[typeIndex].resTable.entries[i].index == index) - return i; + uint16 version = stream->readUint16BE(); - return -1; // Not found -} + if (version != 0x100) { + warning("Unsupported Mohawk resource version %d.%d", (version >> 8) & 0xff, version & 0xff); + return false; + } -uint16 MohawkArchive::findResourceID(uint32 type, const Common::String &resName) { - int typeIndex = getTypeIndex(type); + /* uint16 compaction = */ stream->readUint16BE(); // Only used in creation, not in reading + /* uint32 rsrcSize = */ stream->readUint32BE(); + uint32 absOffset = stream->readUint32BE(); + uint16 fileTableOffset = stream->readUint16BE(); + /* uint16 fileTableSize = */ stream->readUint16BE(); - if (typeIndex < 0) - return 0xFFFF; + // First, read in the file table + stream->seek(absOffset + fileTableOffset); + Common::Array fileTable; + fileTable.resize(stream->readUint32BE()); - int idIndex = getIDIndex(typeIndex, resName); + debug(4, "Reading file table with %d entries", fileTable.size()); - if (idIndex < 0) - return 0xFFFF; + for (uint32 i = 0; i < fileTable.size(); i++) { + fileTable[i].offset = stream->readUint32BE(); + fileTable[i].size = stream->readUint16BE(); + fileTable[i].size += stream->readByte() << 16; // Get bits 15-24 of size too + fileTable[i].flags = stream->readByte(); + fileTable[i].unknown = stream->readUint16BE(); - return _types[typeIndex].resTable.entries[idIndex].id; -} - -bool MohawkArchive::hasResource(uint32 tag, uint16 id) { - if (!_mhk) - return false; + // Add in another 3 bits for file size from the flags. + // The flags are useless to us except for doing this ;) + fileTable[i].size += (fileTable[i].flags & 7) << 24; - int16 typeIndex = getTypeIndex(tag); + debug(4, "File[%02x]: Offset = %08x Size = %07x Flags = %02x Unknown = %04x", i, fileTable[i].offset, fileTable[i].size, fileTable[i].flags, fileTable[i].unknown); + } - if (typeIndex < 0) - return false; + // Now go in an read in each of the types + stream->seek(absOffset); + uint16 stringTableOffset = stream->readUint16BE(); + uint16 typeCount = stream->readUint16BE(); - return getIDIndex(typeIndex, id) >= 0; -} + debug(0, "Name List Offset = %04x Number of Resource Types = %04x", stringTableOffset, typeCount); -bool MohawkArchive::hasResource(uint32 tag, const Common::String &resName) { - if (!_mhk) - return false; + for (uint16 i = 0; i < typeCount; i++) { + uint32 tag = stream->readUint32BE(); + uint16 resourceTableOffset = stream->readUint16BE(); + uint16 nameTableOffset = stream->readUint16BE(); - int16 typeIndex = getTypeIndex(tag); + // HACK: Zoombini's SND resource starts will a NULL. + if (tag == ID_SND) + debug(3, "Type[%02d]: Tag = \'SND\' ResTable Offset = %04x NameTable Offset = %04x", i, resourceTableOffset, nameTableOffset); + else + debug(3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x NameTable Offset = %04x", i, tag2str(tag), resourceTableOffset, nameTableOffset); - if (typeIndex < 0) - return false; + // Name Table + stream->seek(absOffset + nameTableOffset); + Common::Array nameTable; + nameTable.resize(stream->readUint16BE()); - return getIDIndex(typeIndex, resName) >= 0; -} + debug(3, "Names = %04x", nameTable.size()); -Common::String MohawkArchive::getName(uint32 tag, uint16 id) { - if (!_mhk) - return 0; + for (uint16 j = 0; j < nameTable.size(); j++) { + uint16 offset = stream->readUint16BE(); + nameTable[j].index = stream->readUint16BE(); - int16 typeIndex = getTypeIndex(tag); + debug(4, "Entry[%02x]: Name List Offset = %04x Index = %04x", j, offset, nameTable[j].index); - if (typeIndex < 0) - return 0; + // Name List + uint32 pos = stream->pos(); + stream->seek(absOffset + stringTableOffset + offset); + char c = (char)stream->readByte(); + while (c != 0) { + nameTable[j].name += c; + c = (char)stream->readByte(); + } - int16 idIndex = -1; + debug(3, "Name = \'%s\'", nameTable[j].name.c_str()); - for (uint16 i = 0; i < _types[typeIndex].resTable.resources; i++) - if (_types[typeIndex].resTable.entries[i].id == id) { - idIndex = _types[typeIndex].resTable.entries[i].index; - break; + // Get back to next entry + stream->seek(pos); } - assert(idIndex >= 0); - - for (uint16 i = 0; i < _types[typeIndex].nameTable.num; i++) - if (_types[typeIndex].nameTable.entries[i].index == idIndex) - return _types[typeIndex].nameTable.entries[i].name; - - return 0; // not found -} - -uint32 MohawkArchive::getOffset(uint32 tag, uint16 id) { - assert(_mhk); + // Resource Table + stream->seek(absOffset + resourceTableOffset); + uint16 resourceCount = stream->readUint16BE(); - int16 typeIndex = getTypeIndex(tag); - assert(typeIndex >= 0); + debug(3, "Resource count = %04x", resourceCount); - int16 idIndex = getIDIndex(typeIndex, id); - assert(idIndex >= 0); + ResourceMap &resMap = _types[tag]; - return _fileTable[_types[typeIndex].resTable.entries[idIndex].index - 1].offset; -} + for (uint16 j = 0; j < resourceCount; j++) { + uint16 id = stream->readUint16BE(); + uint16 index = stream->readUint16BE(); -Common::SeekableReadStream *MohawkArchive::getResource(uint32 tag, uint16 id) { - if (!_mhk) - error("MohawkArchive::getResource(): No File in Use"); + Resource &res = resMap[id]; - int16 typeIndex = getTypeIndex(tag); - - if (typeIndex < 0) - error("Could not find a tag of '%s' in file '%s'", tag2str(tag), _curFile.c_str()); + // Pull out the name from the name table + for (uint32 k = 0; k < nameTable.size(); k++) { + if (nameTable[k].index == index) { + res.name = nameTable[k].name; + break; + } + } - int16 idIndex = getIDIndex(typeIndex, id); + // Pull out our offset/size too + res.offset = fileTable[index - 1].offset; + + // WORKAROUND: tMOV resources pretty much ignore the size part of the file table, + // as the original just passed the full Mohawk file to QuickTime and the offset. + // We need to do this because of the way Mohawk is set up (this is much more "proper" + // than passing _stream at the right offset). We may want to do that in the future, though. + if (tag == ID_TMOV) { + if (index == fileTable.size() - 1) + res.size = stream->size() - fileTable[index - 1].offset; + else + res.size = fileTable[index].offset - fileTable[index - 1].offset; + } else + res.size = fileTable[index - 1].size; + + debug(4, "Entry[%02x]: ID = %04x (%d) Index = %04x", j, id, id, index); + } - if (idIndex < 0) - error("Could not find '%s' %04x in file '%s'", tag2str(tag), id, _curFile.c_str()); - // Note: the fileTableIndex is based off 1, not 0. So, subtract 1 - uint16 fileTableIndex = _types[typeIndex].resTable.entries[idIndex].index - 1; + // Return to next TypeTable entry + stream->seek(absOffset + (i + 1) * 8 + 4); - // WORKAROUND: tMOV resources pretty much ignore the size part of the file table, - // as the original just passed the full Mohawk file to QuickTime and the offset. - // We need to do this because of the way Mohawk is set up (this is much more "proper" - // than passing _mhk at the right offset). We may want to do that in the future, though. - if (_types[typeIndex].tag == ID_TMOV) { - if (fileTableIndex == _fileTableAmount - 1) - return new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _mhk->size()); - else - return new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex + 1].offset); + debug(3, "\n"); } - return new Common::SeekableSubReadStream(_mhk, _fileTable[fileTableIndex].offset, _fileTable[fileTableIndex].offset + _fileTable[fileTableIndex].dataSize); + _stream = stream; + return true; } -bool LivingBooksArchive_v1::open(Common::SeekableReadStream *stream) { +// Living Books Archive code + +bool LivingBooksArchive_v1::openStream(Common::SeekableReadStream *stream) { close(); - _mhk = stream; // This is for the "old" Mohawk resource format used in some older // Living Books. It is very similar, just missing the MHWK tag and // some other minor differences, especially with the file table // being merged into the resource table. - uint32 headerSize = _mhk->readUint32BE(); + uint32 headerSize = stream->readUint32BE(); // NOTE: There are differences besides endianness! (Subtle changes, // but different). if (headerSize == 6) { // We're in Big Endian mode (Macintosh) - _mhk->readUint16BE(); // Resource Table Size - _typeTable.resource_types = _mhk->readUint16BE(); - _types = new OldType[_typeTable.resource_types]; + stream->readUint16BE(); // Resource Table Size + uint16 typeCount = stream->readUint16BE(); - debug (0, "Old Mohawk File (Macintosh): Number of Resource Types = %04x", _typeTable.resource_types); + debug(0, "Old Mohawk File (Macintosh): Number of Resource Types = %04x", typeCount); - for (uint16 i = 0; i < _typeTable.resource_types; i++) { - _types[i].tag = _mhk->readUint32BE(); - _types[i].resource_table_offset = (uint16)_mhk->readUint32BE() + 6; - _mhk->readUint32BE(); // Unknown (always 0?) + for (uint16 i = 0; i < typeCount; i++) { + uint32 tag = stream->readUint32BE(); + uint32 resourceTableOffset = stream->readUint32BE() + 6; + stream->readUint32BE(); // Unknown (always 0?) - debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset); + debug(3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(tag), resourceTableOffset); - uint32 oldPos = _mhk->pos(); + uint32 oldPos = stream->pos(); // Resource Table/File Table - _mhk->seek(_types[i].resource_table_offset); - _types[i].resTable.resources = _mhk->readUint16BE(); - _types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources]; - - for (uint16 j = 0; j < _types[i].resTable.resources; j++) { - _types[i].resTable.entries[j].id = _mhk->readUint16BE(); - _types[i].resTable.entries[j].offset = _mhk->readUint32BE(); - _types[i].resTable.entries[j].size = _mhk->readByte() << 16; - _types[i].resTable.entries[j].size += _mhk->readUint16BE(); - _mhk->skip(5); // Unknown (always 0?) - - debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size); - } - - _mhk->seek(oldPos); - debug (3, "\n"); - } - } else if (SWAP_BYTES_32(headerSize) == 6) { // We're in Little Endian mode (Windows) - _mhk->readUint16LE(); // Resource Table Size - _typeTable.resource_types = _mhk->readUint16LE(); - _types = new OldType[_typeTable.resource_types]; + stream->seek(resourceTableOffset); + uint16 resourceCount = stream->readUint16BE(); - debug (0, "Old Mohawk File (Windows): Number of Resource Types = %04x", _typeTable.resource_types); + ResourceMap &resMap = _types[tag]; - for (uint16 i = 0; i < _typeTable.resource_types; i++) { - _types[i].tag = _mhk->readUint32LE(); - _types[i].resource_table_offset = _mhk->readUint16LE() + 6; - _mhk->readUint16LE(); // Unknown (always 0?) + for (uint16 j = 0; j < resourceCount; j++) { + uint16 id = stream->readUint16BE(); - debug (3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset); + Resource &res = resMap[id]; - uint32 oldPos = _mhk->pos(); + res.offset = stream->readUint32BE(); + res.size = stream->readByte() << 16; + res.size |= stream->readUint16BE(); + stream->skip(5); // Unknown (always 0?) - // Resource Table/File Table - _mhk->seek(_types[i].resource_table_offset); - _types[i].resTable.resources = _mhk->readUint16LE(); - _types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources]; - - for (uint16 j = 0; j < _types[i].resTable.resources; j++) { - _types[i].resTable.entries[j].id = _mhk->readUint16LE(); - _types[i].resTable.entries[j].offset = _mhk->readUint32LE(); - _types[i].resTable.entries[j].size = _mhk->readUint32LE(); - _mhk->readUint16LE(); // Unknown (always 0?) - - debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size); + debug(4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, id, id, res.offset, res.size); } - _mhk->seek(oldPos); - debug (3, "\n"); + stream->seek(oldPos); + debug(3, "\n"); } - } else { - warning("Could not determine type of Old Mohawk resource"); - return false; - } - - return true; -} - -uint32 LivingBooksArchive_v1::getOffset(uint32 tag, uint16 id) { - assert(_mhk); - - int16 typeIndex = getTypeIndex(tag); - assert(typeIndex >= 0); + } else if (SWAP_BYTES_32(headerSize) == 6) { // We're in Little Endian mode (Windows) + stream->readUint16LE(); // Resource Table Size + uint16 typeCount = stream->readUint16LE(); - int16 idIndex = getIDIndex(typeIndex, id); - assert(idIndex >= 0); + debug(0, "Old Mohawk File (Windows): Number of Resource Types = %04x", typeCount); - return _types[typeIndex].resTable.entries[idIndex].offset; -} + for (uint16 i = 0; i < typeCount; i++) { + uint32 tag = stream->readUint32LE(); + uint16 resourceTableOffset = stream->readUint16LE() + 6; + stream->readUint16LE(); // Unknown (always 0?) -Common::SeekableReadStream *LivingBooksArchive_v1::getResource(uint32 tag, uint16 id) { - if (!_mhk) - error("LivingBooksArchive_v1::getResource(): No File in Use"); + debug(3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(tag), resourceTableOffset); - int16 typeIndex = getTypeIndex(tag); + uint32 oldPos = stream->pos(); - if (typeIndex < 0) - error("Could not find a tag of \'%s\' in file \'%s\'", tag2str(tag), _curFile.c_str()); + // Resource Table/File Table + stream->seek(resourceTableOffset); + uint16 resourceCount = stream->readUint16LE(); - int16 idIndex = getIDIndex(typeIndex, id); + ResourceMap &resMap = _types[tag]; - if (idIndex < 0) - error("Could not find \'%s\' %04x in file \'%s\'", tag2str(tag), id, _curFile.c_str()); + for (uint16 j = 0; j < resourceCount; j++) { + uint16 id = stream->readUint16LE(); - return new Common::SeekableSubReadStream(_mhk, _types[typeIndex].resTable.entries[idIndex].offset, _types[typeIndex].resTable.entries[idIndex].offset + _types[typeIndex].resTable.entries[idIndex].size); -} + Resource &res = resMap[id]; -bool LivingBooksArchive_v1::hasResource(uint32 tag, uint16 id) { - if (!_mhk) - return false; + res.offset = stream->readUint32LE(); + res.size = stream->readUint32LE(); + stream->readUint16LE(); // Unknown (always 0?) - int16 typeIndex = getTypeIndex(tag); + debug(4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, id, id, res.offset, res.size); + } - if (typeIndex < 0) + stream->seek(oldPos); + debug(3, "\n"); + } + } else { + // Not a valid Living Books Archive return false; + } - return getIDIndex(typeIndex, id) >= 0; + _stream = stream; + return true; } -int LivingBooksArchive_v1::getTypeIndex(uint32 tag) { - for (uint16 i = 0; i < _typeTable.resource_types; i++) - if (_types[i].tag == tag) - return i; - return -1; // not found -} - -int LivingBooksArchive_v1::getIDIndex(int typeIndex, uint16 id) { - for (uint16 i = 0; i < _types[typeIndex].resTable.resources; i++) - if (_types[typeIndex].resTable.entries[i].id == id) - return i; - return -1; // not found -} +// DOS Archive (v2) code // Partially based on the Prince of Persia Format Specifications // See http://sdfg.com.ar/git/?p=fp-git.git;a=blob;f=FP/doc/FormatSpecifications // However, I'm keeping with the terminology we've been using with the // later archive formats. -bool DOSArchive_v2::open(Common::SeekableReadStream *stream) { +bool DOSArchive_v2::openStream(Common::SeekableReadStream *stream) { close(); uint32 typeTableOffset = stream->readUint32LE(); @@ -488,36 +408,38 @@ bool DOSArchive_v2::open(Common::SeekableReadStream *stream) { stream->seek(typeTableOffset); - _typeTable.resource_types = stream->readUint16LE(); - _types = new OldType[_typeTable.resource_types]; + uint16 typeCount = stream->readUint16LE(); - for (uint16 i = 0; i < _typeTable.resource_types; i++) { - _types[i].tag = stream->readUint32LE(); - _types[i].resource_table_offset = stream->readUint16LE(); + for (uint16 i = 0; i < typeCount; i++) { + uint32 tag = stream->readUint32LE(); + uint16 resourceTableOffset = stream->readUint16LE(); - debug(3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(_types[i].tag), _types[i].resource_table_offset); + debug(3, "Type[%02d]: Tag = \'%s\' ResTable Offset = %04x", i, tag2str(tag), resourceTableOffset); uint32 oldPos = stream->pos(); // Resource Table/File Table - stream->seek(_types[i].resource_table_offset + typeTableOffset); - _types[i].resTable.resources = stream->readUint16LE(); - _types[i].resTable.entries = new OldType::ResourceTable::Entries[_types[i].resTable.resources]; + stream->seek(resourceTableOffset + typeTableOffset); + uint16 resourceCount = stream->readUint16LE(); + + ResourceMap &resMap = _types[tag]; + + for (uint16 j = 0; j < resourceCount; j++) { + uint16 id = stream->readUint16LE(); - for (uint16 j = 0; j < _types[i].resTable.resources; j++) { - _types[i].resTable.entries[j].id = stream->readUint16LE(); - _types[i].resTable.entries[j].offset = stream->readUint32LE() + 1; // Need to add one to the offset to skip the checksum byte - _types[i].resTable.entries[j].size = stream->readUint16LE(); - stream->skip(3); // Skip the useless flags + Resource &res = resMap[id]; + res.offset = stream->readUint32LE() + 1; // Need to add one to the offset to skip the checksum byte + res.size = stream->readUint16LE(); + stream->skip(3); // Skip (useless) flags - debug (4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].id, _types[i].resTable.entries[j].offset, _types[i].resTable.entries[j].size); + debug(4, "Entry[%02x]: ID = %04x (%d)\tOffset = %08x, Size = %08x", j, id, id, res.offset, res.size); } stream->seek(oldPos); - debug (3, "\n"); + debug(3, "\n"); } - _mhk = stream; + _stream = stream; return true; } diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index cabce04e38..d4e91e0ec4 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -22,6 +22,7 @@ #include "common/scummsys.h" #include "common/endian.h" +#include "common/hashmap.h" #include "common/file.h" #include "common/str.h" @@ -128,127 +129,61 @@ namespace Mohawk { #define ID_BBOX MKTAG('B','B','O','X') // Boxes? (CSWorld, CSAmtrak) #define ID_SYSX MKTAG('S','Y','S','X') // MIDI Sysex -struct FileTable { - uint32 offset; - uint32 dataSize; // Really 27 bits - byte flags; // Mostly useless except for the bottom 3 bits which are part of the size - uint16 unk; // Always 0 -}; - -struct Type { - Type() { resTable.entries = NULL; nameTable.entries = NULL; } - ~Type() { delete[] resTable.entries; delete[] nameTable.entries; } - - //Type Table - uint32 tag; - uint16 resource_table_offset; - uint16 name_table_offset; - - struct ResourceTable { - uint16 resources; - struct Entries { - uint16 id; - uint16 index; - } *entries; - } resTable; - - struct NameTable { - uint16 num; - struct Entries { - uint16 offset; - uint16 index; - // Name List - Common::String name; - } *entries; - } nameTable; -}; - -struct TypeTable { - uint16 name_offset; - uint16 resource_types; -}; -struct RSRC_Header { - uint16 version; - uint16 compaction; - uint32 filesize; - uint32 abs_offset; - uint16 file_table_offset; - uint16 file_table_size; -}; - -class MohawkArchive { +class Archive { public: - MohawkArchive(); - virtual ~MohawkArchive() { close(); } + Archive(); + virtual ~Archive(); - bool open(const Common::String &filename); - virtual bool open(Common::SeekableReadStream *stream); + bool openFile(const Common::String &fileName); + virtual bool openStream(Common::SeekableReadStream *stream) = 0; void close(); - virtual bool hasResource(uint32 tag, uint16 id); - virtual bool hasResource(uint32 tag, const Common::String &resName); - virtual Common::SeekableReadStream *getResource(uint32 tag, uint16 id); - virtual uint32 getOffset(uint32 tag, uint16 id); - virtual uint16 findResourceID(uint32 type, const Common::String &resName); - Common::String getName(uint32 tag, uint16 id); + bool isOpen() const { return _stream != 0; } + + bool hasResource(uint32 tag, uint16 id) const; + bool hasResource(uint32 tag, const Common::String &resName) const; + Common::SeekableReadStream *getResource(uint32 tag, uint16 id); + uint32 getOffset(uint32 tag, uint16 id) const; + uint16 findResourceID(uint32 tag, const Common::String &resName) const; + Common::String getName(uint32 tag, uint16 id) const; protected: - Common::SeekableReadStream *_mhk; - TypeTable _typeTable; - Common::String _curFile; - -private: - RSRC_Header _rsrc; - Type *_types; - FileTable *_fileTable; - uint16 _nameTableAmount; - uint16 _resourceTableAmount; - uint16 _fileTableAmount; - - int getTypeIndex(uint32 tag); - int getIDIndex(int typeIndex, uint16 id); - int getIDIndex(int typeIndex, const Common::String &resName); + Common::SeekableReadStream *_stream; + + struct Resource { + uint32 offset; + uint32 size; + Common::String name; + }; + + typedef Common::HashMap ResourceMap; + typedef Common::HashMap TypeMap; + TypeMap _types; }; -class LivingBooksArchive_v1 : public MohawkArchive { +class MohawkArchive : public Archive { public: - LivingBooksArchive_v1() : MohawkArchive() {} - ~LivingBooksArchive_v1() {} + MohawkArchive() : Archive() {} + ~MohawkArchive() {} - bool hasResource(uint32 tag, uint16 id); - bool hasResource(uint32 tag, const Common::String &resName) { return false; } - virtual bool open(Common::SeekableReadStream *stream); - Common::SeekableReadStream *getResource(uint32 tag, uint16 id); - Common::SeekableReadStream *getResource(uint32 tag, const Common::String &resName) { return 0; } - uint32 getOffset(uint32 tag, uint16 id); - uint16 findResourceID(uint32 type, const Common::String &resName) { return 0xFFFF; } + bool openStream(Common::SeekableReadStream *stream); +}; -protected: - struct OldType { - uint32 tag; - uint16 resource_table_offset; - struct ResourceTable { - uint16 resources; - struct Entries { - uint16 id; - uint32 offset; - uint32 size; - } *entries; - } resTable; - } *_types; - -private: - int getTypeIndex(uint32 tag); - int getIDIndex(int typeIndex, uint16 id); +class LivingBooksArchive_v1 : public Archive { +public: + LivingBooksArchive_v1() : Archive() {} + ~LivingBooksArchive_v1() {} + + bool openStream(Common::SeekableReadStream *stream); }; -class DOSArchive_v2 : public LivingBooksArchive_v1 { +class DOSArchive_v2 : public Archive { public: - DOSArchive_v2() : LivingBooksArchive_v1() {} + DOSArchive_v2() : Archive() {} ~DOSArchive_v2() {} - virtual bool open(Common::SeekableReadStream *stream); + bool openStream(Common::SeekableReadStream *stream); }; } // End of namespace Mohawk diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 8f8bc15990..612b8b3685 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -143,7 +143,7 @@ Common::Error MohawkEngine_Riven::run() { _extrasFile = new MohawkArchive(); // We need extras.mhk for inventory images, marble images, and credits images - if (!_extrasFile->open("extras.mhk")) { + if (!_extrasFile->openFile("extras.mhk")) { Common::String message = "You're missing 'extras.mhk'. Using the 'arcriven.z' installer file also works."; GUIErrorMessage(message); warning("%s", message.c_str()); @@ -317,7 +317,7 @@ void MohawkEngine_Riven::changeToStack(uint16 n) { Common::String filename = Common::String(prefix) + endings[i]; MohawkArchive *mhk = new MohawkArchive(); - if (mhk->open(filename)) + if (mhk->openFile(filename)) _mhk.push_back(mhk); else delete mhk; diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 35d82d4aa0..f1ce2447a5 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -100,7 +100,7 @@ bool RivenSaveLoad::loadGame(Common::String filename) { MohawkArchive *mhk = new MohawkArchive(); - if (!mhk->open(loadFile)) { + if (!mhk->openStream(loadFile)) { warning("Save file is not a Mohawk archive"); delete mhk; return false; -- cgit v1.2.3 From cc818b444c454d2f8978655d5c29f379cbe21376 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Jun 2011 13:51:03 -0400 Subject: MOHAWK: Use matchString instead of equalsIgnoreCase for resource names A regression from 71c4329 --- engines/mohawk/resource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 2dc6d2252a..df8271dc5a 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -74,7 +74,7 @@ bool Archive::hasResource(uint32 tag, const Common::String &resName) const { const ResourceMap &resMap = _types[tag]; for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++) - if (it->_value.name.equalsIgnoreCase(resName)) + if (it->_value.name.matchString(resName)) return true; return false; @@ -113,7 +113,7 @@ uint16 Archive::findResourceID(uint32 tag, const Common::String &resName) const const ResourceMap &resMap = _types[tag]; for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++) - if (it->_value.name.equalsIgnoreCase(resName)) + if (it->_value.name.matchString(resName)) return it->_key; return 0xFFFF; -- cgit v1.2.3 From ddd83da48bb0aea037b9f199490b359e2d7a97e7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Jun 2011 13:54:14 -0400 Subject: MOHAWK: Add archive functions to get type/id lists This will be needed for CarmenTQ --- engines/mohawk/resource.cpp | 22 ++++++++++++++++++++++ engines/mohawk/resource.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index df8271dc5a..9b39692958 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -131,6 +131,28 @@ Common::String Archive::getName(uint32 tag, uint16 id) const { return resMap[id].name; } +Common::Array Archive::getResourceTypeList() const { + Common::Array typeList; + + for (TypeMap::const_iterator it = _types.begin(); it != _types.end(); it++) + typeList.push_back(it->_key); + + return typeList; +} + +Common::Array Archive::getResourceIDList(uint32 type) const { + Common::Array idList; + + if (!_types.contains(type)) + return idList; + + const ResourceMap &resMap = _types[type]; + + for (ResourceMap::const_iterator it = resMap.begin(); it != resMap.end(); it++) + idList.push_back(it->_key); + + return idList; +} // Mohawk Archive code diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index d4e91e0ec4..f2ead7af65 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -148,6 +148,9 @@ public: uint16 findResourceID(uint32 tag, const Common::String &resName) const; Common::String getName(uint32 tag, uint16 id) const; + Common::Array getResourceTypeList() const; + Common::Array getResourceIDList(uint32 type) const; + protected: Common::SeekableReadStream *_stream; -- cgit v1.2.3 From 8cd81da14eae116a220074207f15f08d8898eaf0 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 28 Jun 2011 14:31:57 -0400 Subject: MOHAWK: Cleanup Riven save code --- engines/mohawk/riven_saveload.cpp | 91 ++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index f1ce2447a5..18c13ec12b 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -274,7 +274,16 @@ Common::MemoryWriteStreamDynamic *RivenSaveLoad::genZIPSSection() { } bool RivenSaveLoad::saveGame(Common::String filename) { - // Note, this code is still WIP. It works quite well for now. + // NOTE: This code is designed to only output a Mohawk archive + // for a Riven saved game. It's hardcoded to do this because + // (as of right now) this is the only place in the engine + // that requires this feature. If the time comes when other + // games need this, we should think about coming up with some + // more common way of outputting resources to an archive. + + // TODO: Make these saves work with the original interpreter. + // Not sure why they don't work yet (they still can be loaded + // by ScummVM). // Make sure we have the right extension if (!filename.matchString("*.rvn", true)) @@ -296,99 +305,101 @@ bool RivenSaveLoad::saveGame(Common::String filename) { Common::MemoryWriteStreamDynamic *zipsSection = genZIPSSection(); // Let's calculate the file size! - uint32 fileSize = 0; + uint32 fileSize = 142; fileSize += versSection->size(); fileSize += nameSection->size(); fileSize += varsSection->size(); fileSize += zipsSection->size(); - fileSize += 16; // RSRC Header - fileSize += 4; // Type Table Header - fileSize += 4 * 8; // Type Table Entries - fileSize += 2; // Pseudo-Name entries - // IFF Header + // MHWK Header (8 bytes - total: 8) saveFile->writeUint32BE(ID_MHWK); - saveFile->writeUint32BE(fileSize); + saveFile->writeUint32BE(fileSize - 8); - // RSRC Header + // RSRC Header (20 bytes - total: 28) saveFile->writeUint32BE(ID_RSRC); saveFile->writeUint16BE(0x100); // Resource Version (1.0) - saveFile->writeUint16BE(0); // No compaction - saveFile->writeUint32BE(fileSize + 8); // Add on the 8 from the IFF header - saveFile->writeUint32BE(28); // IFF + RSRC - saveFile->writeUint16BE(62); // File Table Offset - saveFile->writeUint16BE(44); // 4 + 4 * 10 - - //Type Table - saveFile->writeUint16BE(36); // After the Type Table Entries + saveFile->writeUint16BE(1); // Compaction -- original saves have this too + saveFile->writeUint32BE(fileSize); // Subtract off the MHWK header size + saveFile->writeUint32BE(28); // Absolute offset: right after both headers + saveFile->writeUint16BE(70); // File Table Offset + saveFile->writeUint16BE(44); // File Table Size (4 bytes count + 4 entries * 10 bytes per entry) + + // Type Table (4 bytes - total: 32) + saveFile->writeUint16BE(36); // String table offset After the Type Table Entries saveFile->writeUint16BE(4); // 4 Type Table Entries - // Hardcode Entries + // Hardcode Entries (32 bytes - total: 64) saveFile->writeUint32BE(ID_VERS); - saveFile->writeUint16BE(38); - saveFile->writeUint16BE(36); + saveFile->writeUint16BE(46); // Resource table offset + saveFile->writeUint16BE(38); // String table offset saveFile->writeUint32BE(ID_NAME); - saveFile->writeUint16BE(44); - saveFile->writeUint16BE(36); + saveFile->writeUint16BE(52); + saveFile->writeUint16BE(40); saveFile->writeUint32BE(ID_VARS); - saveFile->writeUint16BE(50); - saveFile->writeUint16BE(36); + saveFile->writeUint16BE(58); + saveFile->writeUint16BE(42); saveFile->writeUint32BE(ID_ZIPS); - saveFile->writeUint16BE(56); - saveFile->writeUint16BE(36); + saveFile->writeUint16BE(64); + saveFile->writeUint16BE(44); - // Pseudo-Name Table/Name List + // Pseudo-String Table (2 bytes - total: 66) saveFile->writeUint16BE(0); // We don't need a name list - // VERS Section (Resource Table) + // Psuedo-Name Tables (8 bytes - total: 74) + saveFile->writeUint16BE(0); + saveFile->writeUint16BE(0); + saveFile->writeUint16BE(0); + saveFile->writeUint16BE(0); + + // VERS Section (Resource Table) (6 bytes - total: 80) saveFile->writeUint16BE(1); saveFile->writeUint16BE(1); saveFile->writeUint16BE(1); - // NAME Section (Resource Table) + // NAME Section (Resource Table) (6 bytes - total: 86) saveFile->writeUint16BE(1); saveFile->writeUint16BE(1); saveFile->writeUint16BE(2); - // VARS Section (Resource Table) + // VARS Section (Resource Table) (6 bytes - total: 92) saveFile->writeUint16BE(1); saveFile->writeUint16BE(1); saveFile->writeUint16BE(3); - // ZIPS Section (Resource Table) + // ZIPS Section (Resource Table) (6 bytes - total: 98) saveFile->writeUint16BE(1); saveFile->writeUint16BE(1); saveFile->writeUint16BE(4); - // File Table + // File Table (4 bytes - total: 102) saveFile->writeUint32BE(4); - // VERS Section (File Table) - saveFile->writeUint32BE(134); + // VERS Section (File Table) (10 bytes - total: 112) + saveFile->writeUint32BE(142); saveFile->writeUint16BE(versSection->size() & 0xFFFF); saveFile->writeByte((versSection->size() & 0xFF0000) >> 16); saveFile->writeByte(0); saveFile->writeUint16BE(0); - // NAME Section (File Table) - saveFile->writeUint32BE(134 + versSection->size()); + // NAME Section (File Table) (10 bytes - total: 122) + saveFile->writeUint32BE(142 + versSection->size()); saveFile->writeUint16BE(nameSection->size() & 0xFFFF); saveFile->writeByte((nameSection->size() & 0xFF0000) >> 16); saveFile->writeByte(0); saveFile->writeUint16BE(0); - // VARS Section (File Table) - saveFile->writeUint32BE(134 + versSection->size() + nameSection->size()); + // VARS Section (File Table) (10 bytes - total: 132) + saveFile->writeUint32BE(142 + versSection->size() + nameSection->size()); saveFile->writeUint16BE(varsSection->size() & 0xFFFF); saveFile->writeByte((varsSection->size() & 0xFF0000) >> 16); saveFile->writeByte(0); saveFile->writeUint16BE(0); - // ZIPS Section (File Table) - saveFile->writeUint32BE(134 + versSection->size() + nameSection->size() + varsSection->size()); + // ZIPS Section (File Table) (10 bytes - total: 142) + saveFile->writeUint32BE(142 + versSection->size() + nameSection->size() + varsSection->size()); saveFile->writeUint16BE(zipsSection->size() & 0xFFFF); saveFile->writeByte((zipsSection->size() & 0xFF0000) >> 16); saveFile->writeByte(0); -- cgit v1.2.3 From 549439374d5dda8f4206cf6be34b9d06924f7f1c Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 28 Jun 2011 19:54:05 +0100 Subject: I18N: Update Czech translation from patch #3326481 --- po/cs_CZ.po | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/po/cs_CZ.po b/po/cs_CZ.po index aad7110daf..9d2751a711 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2011-06-20 23:09+0100\n" -"PO-Revision-Date: 2011-06-14 15:04+0100\n" +"PO-Revision-Date: 2011-06-24 06:44+0100\n" "Last-Translator: Zbynìk Schwarz \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -1082,7 +1082,7 @@ msgstr "Z #: common/error.cpp:71 msgid "User canceled" -msgstr "" +msgstr "Zru¹eno u¾ivatelem" #: common/error.cpp:75 msgid "Unknown error" @@ -1241,10 +1241,13 @@ msgid "" "ScummVM. As such, it is likely to be unstable, and any saves you make might " "not work in future versions of ScummVM." msgstr "" +"VAROVÁNÍ: Hra, kterou se chystáte spustit, není je¹tì plnì podporována " +"ScummVM. Proto je mo¾né, ¾e bude nestabilní a jakékoli ulo¾ené hry nemusí " +"fungovat v budoucích verzích ScummVM." #: engines/engine.cpp:408 msgid "Start anyway" -msgstr "" +msgstr "Pøesto spustit" #: engines/scumm/dialogs.cpp:281 msgid "~P~revious" -- cgit v1.2.3 From 2e81e05a12600056cb34a6318f524c1a86c7145c Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 28 Jun 2011 19:54:30 +0100 Subject: I18N: Regenerate translations data file --- gui/themes/translations.dat | Bin 226329 -> 226564 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 gui/themes/translations.dat diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat old mode 100755 new mode 100644 index 5ed267370c..df15d72567 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3 From 3384f4bf827663edd2886ff2e2056430f8a70204 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Jun 2011 22:00:20 +0200 Subject: MOHAWK: Don't leak bitlStream (spotted by clone2727). --- engines/mohawk/livingbooks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 8df5db720c..06500bc725 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -768,6 +768,8 @@ void LBPage::loadBITL(uint16 resourceId) { if (bitlStream->size() == bitlStream->pos()) break; } + + delete bitlStream; } Common::SeekableSubReadStreamEndian *MohawkEngine_LivingBooks::wrapStreamEndian(uint32 tag, uint16 id) { -- cgit v1.2.3 From d1341387e3c396aa6b48b39379afc9e201448048 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 20:09:56 -0400 Subject: LASTEXPRESS: Move more entry-related functions to Entry class --- engines/lastexpress/game/sound.cpp | 258 ++++++++---------------------------- engines/lastexpress/game/sound.h | 18 ++- engines/lastexpress/sound/entry.cpp | 254 ++++++++++++++++++++++++++++------- engines/lastexpress/sound/entry.h | 97 ++++++++------ 4 files changed, 325 insertions(+), 302 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index c95ef85701..3fb3f8894d 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -161,15 +161,15 @@ void SoundManager::handleTimer() { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { SoundEntry *entry = (*i); - if (entry->stream == NULL) { + if (entry->_stream == NULL) { SAFE_DELETE(*i); i = _soundList.reverse_erase(i); continue; - } else if (!entry->soundStream) { - entry->soundStream = new StreamedSound(); + } else if (!entry->_soundStream) { + entry->_soundStream = new StreamedSound(); // TODO: stream any sound in the queue after filtering - entry->soundStream->load(entry->stream); + entry->_soundStream->load(entry->_stream); } } } @@ -189,7 +189,7 @@ void SoundManager::resetQueue(SoundType type1, SoundType type2) { Common::StackLock locker(_mutex); for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->type != type1 && (*i)->type != type2) + if ((*i)->getType() != type1 && (*i)->getType() != type2) (*i)->reset(); } } @@ -226,7 +226,7 @@ void SoundManager::clearQueue() { SoundEntry *entry = (*i); // Delete entry - removeEntry(entry); + entry->close(); SAFE_DELETE(entry); i = _soundList.reverse_erase(i); @@ -247,7 +247,7 @@ bool SoundManager::isBuffered(Common::String filename, bool testForEntity) { SoundEntry *entry = getEntry(filename); if (testForEntity) - return entry != NULL && !entry->entity; + return entry != NULL && entry->getEntity() != kEntityPlayer; return (entry != NULL); } @@ -255,96 +255,8 @@ bool SoundManager::isBuffered(Common::String filename, bool testForEntity) { ////////////////////////////////////////////////////////////////////////// // Entry ////////////////////////////////////////////////////////////////////////// -void SoundManager::setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int priority) { - if (!entry) - error("SoundManager::setupEntry: Invalid entry!"); - - entry->priority = priority; - setEntryType(entry, flag); - entry->setStatus(flag); - - // Add entry to sound list - _soundList.push_back(entry); - - // TODO Add entry to cache and load sound data - //setupCache(entry); - loadSoundData(entry, name); -} - -void SoundManager::setEntryType(SoundEntry *entry, SoundFlag flag) { - switch (flag & kFlagType9) { - default: - case kFlagNone: - entry->type = _currentType; - _currentType = (SoundType)(_currentType + 1); - break; - - case kFlagType1_2: { - SoundEntry *previous2 = getEntry(kSoundType2); - if (previous2) - previous2->update(0); - - SoundEntry *previous = getEntry(kSoundType1); - if (previous) { - previous->type = kSoundType2; - previous->update(0); - } - - entry->type = kSoundType1; - } - break; - - case kFlagType3: { - SoundEntry *previous = getEntry(kSoundType3); - if (previous) { - previous->type = kSoundType4; - previous->update(0); - } - - entry->type = kSoundType11; - } - break; - - case kFlagType7: { - SoundEntry *previous = getEntry(kSoundType7); - if (previous) - previous->type = kSoundType8; - - entry->type = kSoundType7; - } - break; - - case kFlagType9: { - SoundEntry *previous = getEntry(kSoundType9); - if (previous) - previous->type = kSoundType10; - - entry->type = kSoundType9; - } - break; - - case kFlagType11: { - SoundEntry *previous = getEntry(kSoundType11); - if (previous) - previous->type = kSoundType14; - - entry->type = kSoundType11; - } - break; - - case kFlagType13: { - SoundEntry *previous = getEntry(kSoundType13); - if (previous) - previous->type = kSoundType14; - - entry->type = kSoundType13; - } - break; - } -} - bool SoundManager::setupCache(SoundEntry *entry) { - if (entry->soundData) + if (entry->_soundData) return true; if (_soundCache.size() >= SOUNDCACHE_MAX_SIZE) { @@ -353,8 +265,8 @@ bool SoundManager::setupCache(SoundEntry *entry) { uint32 size = 1000; for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { - if (!((*i)->status.status & kSoundStatus_180)) { - uint32 newSize = (*i)->priority + ((*i)->status.status & kSoundStatusClear1); + if (!((*i)->_status.status & kSoundStatus_180)) { + uint32 newSize = (*i)->_priority + ((*i)->_status.status & kSoundStatusClear1); if (newSize < size) { cacheEntry = (*i); @@ -363,7 +275,7 @@ bool SoundManager::setupCache(SoundEntry *entry) { } } - if (entry->priority <= size) + if (entry->_priority <= size) return false; if (!cacheEntry) @@ -372,17 +284,17 @@ bool SoundManager::setupCache(SoundEntry *entry) { cacheEntry->setInCache(); // TODO: Wait until the cache entry is ready to be removed - while (!(cacheEntry->status.status1 & 1)) + while (!(cacheEntry->_status.status1 & 1)) ; - if (cacheEntry->soundData) + if (cacheEntry->_soundData) removeFromCache(cacheEntry); _soundCache.push_back(entry); - entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); } else { _soundCache.push_back(entry); - entry->soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); } return true; @@ -392,7 +304,7 @@ void SoundManager::removeFromCache(SoundEntry *entry) { for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { if ((*i) == entry) { // Remove sound buffer - entry->soundData = NULL; + entry->_soundData = NULL; // Remove entry from sound cache i = _soundCache.reverse_erase(i); @@ -404,48 +316,7 @@ void SoundManager::clearStatus() { Common::StackLock locker(_mutex); for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->status.status |= kSoundStatusClear3; -} - -void SoundManager::loadSoundData(SoundEntry *entry, Common::String name) { - entry->name2 = name; - - // Load sound data - entry->stream = getArchive(name); - - if (!entry->stream) - entry->stream = getArchive("DEFAULT.SND"); - - if (entry->stream) { - warning("Sound::loadSoundData: not implemented!"); - } else { - entry->status.status = kSoundStatusRemoved; - } -} - -void SoundManager::removeEntry(SoundEntry *entry) { - entry->status.status |= kSoundStatusRemoved; - - // Loop until ready - while (!(entry->status.status1 & 4) && !(_flag & 8) && (_flag & 1)) - ; // empty loop body - - // The original game remove the entry from the cache here, - // but since we are called from within an iterator loop - // we will remove the entry there - // removeFromCache(entry); - - if (entry->subtitle) { - entry->subtitle->draw(); - SAFE_DELETE(entry->subtitle); - } - - if (entry->entity) { - if (entry->entity == kEntitySteam) - playLoopingSound(2); - else if (entry->entity != kEntityTrain) - getSavePoints()->push(kEntityPlayer, entry->entity, kActionEndSound); - } + (*i)->_status.status |= kSoundStatusClear3; } void SoundManager::processEntry(EntityIndex entity) { @@ -454,7 +325,7 @@ void SoundManager::processEntry(EntityIndex entity) { SoundEntry *entry = getEntry(entity); if (entry) { entry->update(0); - entry->entity = kEntityPlayer; + entry->setEntity(kEntityPlayer); } } @@ -471,7 +342,7 @@ void SoundManager::setupEntry(SoundType type, EntityIndex index) { SoundEntry *entry = getEntry(type); if (entry) - entry->entity = index; + entry->setEntity(index); } void SoundManager::processEntry(Common::String filename) { @@ -480,7 +351,7 @@ void SoundManager::processEntry(Common::String filename) { SoundEntry *entry = getEntry(filename); if (entry) { entry->update(0); - entry->entity = kEntityPlayer; + entry->setEntity(kEntityPlayer); } } @@ -496,7 +367,7 @@ uint32 SoundManager::getEntryTime(EntityIndex index) { SoundEntry *entry = getEntry(index); if (entry) - return entry->time; + return entry->_time; return 0; } @@ -515,7 +386,7 @@ void SoundManager::unknownFunction4() { ////////////////////////////////////////////////////////////////////////// SoundEntry *SoundManager::getEntry(EntityIndex index) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->entity == index) + if ((*i)->getEntity() == index) return *i; } @@ -527,7 +398,7 @@ SoundEntry *SoundManager::getEntry(Common::String name) { name += ".SND"; for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->name2 == name) + if ((*i)->_name2 == name) return *i; } @@ -536,7 +407,7 @@ SoundEntry *SoundManager::getEntry(Common::String name) { SoundEntry *SoundManager::getEntry(SoundType type) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->type == type) + if ((*i)->getType() == type) return *i; } @@ -547,6 +418,8 @@ SoundEntry *SoundManager::getEntry(SoundType type) { // Savegame ////////////////////////////////////////////////////////////////////////// void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { + Common::StackLock locker(_mutex); + s.syncAsUint32LE(_state); s.syncAsUint32LE(_currentType); @@ -554,39 +427,12 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { uint32 numEntries = count(); s.syncAsUint32LE(numEntries); - Common::StackLock locker(_mutex); - // Save or load each entry data if (s.isSaving()) { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - SoundEntry *entry = *i; - if (entry->name2.matchString("NISSND?") && (entry->status.status & kFlagType7) != kFlag3) { - s.syncAsUint32LE(entry->status.status); // status; - s.syncAsUint32LE(entry->type); // type; - s.syncAsUint32LE(entry->blockCount); // field_8; - s.syncAsUint32LE(entry->time); // time; - s.syncAsUint32LE(entry->field_34); // field_10; - s.syncAsUint32LE(entry->field_38); // field_14; - s.syncAsUint32LE(entry->entity); // entity; - - uint32 blockCount = (uint32)entry->field_48 - _data2; - if (blockCount > kFlag8) - blockCount = 0; - s.syncAsUint32LE(blockCount); // blockCount; - - s.syncAsUint32LE(entry->priority); // field_20; - - char name1[16]; - strcpy((char *)&name1, entry->name1.c_str()); - s.syncBytes((byte *)&name1, 16); - - char name2[16]; - strcpy((char *)&name2, entry->name2.c_str()); - s.syncBytes((byte *)&name2, 16); - } - } + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->saveLoadWithSerializer(s); } else { - warning("Sound::saveLoadWithSerializer: not implemented!"); + warning("Sound::saveLoadWithSerializer: loading not implemented"); s.skip(numEntries * 64); } } @@ -600,7 +446,7 @@ uint32 SoundManager::count() { uint32 numEntries = 0; for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - if ((*i)->name2.matchString("NISSND?")) + if ((*i)->_name2.matchString("NISSND?")) ++numEntries; return numEntries; @@ -629,12 +475,12 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag fla Common::StackLock locker(_mutex); - setupEntry(entry, filename, flag, 30); - entry->entity = entity; + entry->open(filename, flag, 30); + entry->_entity = entity; if (a4) { - entry->field_48 = _data2 + 2 * a4; - entry->status.status |= kSoundStatus_8000; + entry->_field_48 = _data2 + 2 * a4; + entry->_status.status |= kSoundStatus_8000; } else { // Get subtitles name while (filename.size() > 4) @@ -644,7 +490,7 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag fla entry->updateState(); } - return (entry->type != kSoundTypeNone); + return (entry->getType() != kSoundTypeNone); } void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { @@ -1763,16 +1609,16 @@ void SoundManager::updateSubtitles() { for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { uint32 current_index = 0; SoundEntry *soundEntry = (*i)->getSoundEntry(); - SoundStatus status = (SoundStatus)soundEntry->status.status; + SoundStatus status = (SoundStatus)soundEntry->_status.status; if (!(status & kSoundStatus_40) - || status & 0x180 - || soundEntry->time == 0 - || (status & 0x1F) < 6 - || ((getFlags()->nis & 0x8000) && soundEntry->priority < 90)) { + || status & kSoundStatus_180 + || soundEntry->_time == 0 + || (status & kSoundStatusClear1) < 6 + || ((getFlags()->nis & 0x8000) && soundEntry->_priority < 90)) { current_index = 0; } else { - current_index = soundEntry->priority + (status & 0x1F); + current_index = soundEntry->_priority + (status & kSoundStatusClear1); if (_currentSubtitle == (*i)) current_index += 4; @@ -1808,15 +1654,15 @@ void SoundManager::playLoopingSound(int param) { char tmp[80]; for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { - if ((*snd)->type == kSoundType1) + if ((*snd)->getType() == kSoundType1) break; } byte numLoops[8]; static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, - kPosition_6470, kPosition_5790, - kPosition_4840, kPosition_4070, - kPosition_3050, kPosition_2740 }; + kPosition_6470, kPosition_5790, + kPosition_4840, kPosition_4070, + kPosition_3050, kPosition_2740 }; numLoops[1] = 4; numLoops[2] = 2; @@ -1889,7 +1735,7 @@ void SoundManager::playLoopingSound(int param) { if (getFlags()->flag_3) fnameLen = 5; - if (!*snd || scumm_strnicmp((*snd)->name2.c_str(), tmp, fnameLen)) { + if (!*snd || scumm_strnicmp((*snd)->_name2.c_str(), tmp, fnameLen)) { _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; if (partNumber != 99) { @@ -1899,7 +1745,7 @@ void SoundManager::playLoopingSound(int param) { (*snd)->update(0); for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { - if ((*snd)->type == kSoundType1) { + if ((*snd)->getType() == kSoundType1) { (*snd)->update(7); break; } @@ -1913,7 +1759,7 @@ void SoundManager::stopAllSound() { Common::StackLock locker(_mutex); for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->soundStream->stop(); + (*i)->_soundStream->stop(); } ////////////////////////////////////////////////////////////////////////// @@ -2232,12 +2078,12 @@ static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, static void soundFilter(byte *data, int16 *buffer, int p1, int p2); void SoundManager::applyFilter(SoundEntry *entry, int16 *buffer) { - if ((((byte *)entry->soundData)[1] << 6) > 0x1600) { - entry->status.status |= 0x20000000; + if ((((byte *)entry->_soundData)[1] << 6) > 0x1600) { + entry->_status.status |= 0x20000000; } else { - int variant = entry->status.status & 0x1f; + int variant = entry->_status.status & 0x1f; - soundFilter((byte *)entry->soundData, buffer, p1s[variant], p2s[variant]); + soundFilter((byte *)entry->_soundData, buffer, p1s[variant], p2s[variant]); } } diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index e7b06609a9..414fb0d028 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -84,6 +84,8 @@ public: void playLocomotiveSound(); void playWarningCompartment(EntityIndex entity, ObjectIndex compartment); + void playLoopingSound(int param); + // Dialog & Letters void readText(int id); const char *getDialogName(EntityIndex entity) const; @@ -109,6 +111,9 @@ public: uint32 getFlag() { return _flag; } int getSubtitleFlag() { return _subtitlesFlag; } void setSubtitleFlag(int flag) { _subtitlesFlag = flag; } + SoundType getCurrentType() { return _currentType; } + void setCurrentType(SoundType type) { _currentType = type; } + uint32 getData2() { return _data2; } // Subtitles void addSubtitle(SubtitleEntry *entry) { _subtitles.push_back(entry); } @@ -116,6 +121,12 @@ public: void setCurrentSubtitle(SubtitleEntry *entry) { _currentSubtitle = entry; } SubtitleEntry *getCurrentSubtitle() { return _currentSubtitle; } + // Queue + bool setupCache(SoundEntry *entry); + void addToQueue(SoundEntry *entry) { _soundList.push_back(entry); } + + SoundEntry *getEntry(SoundType type); + private: typedef int32 *SoundBuffer; @@ -149,7 +160,6 @@ private: uint32 _lastWarning[12]; // Looping sound - void playLoopingSound(int param); int _loopingSoundDuration; // Sound entries @@ -159,14 +169,8 @@ private: SoundEntry *getEntry(EntityIndex index); SoundEntry *getEntry(Common::String name); - SoundEntry *getEntry(SoundType type); - void setupEntry(SoundEntry *entry, Common::String name, SoundFlag flag, int priority); - void setEntryType(SoundEntry *entry, SoundFlag flag); - bool setupCache(SoundEntry *entry); void removeFromCache(SoundEntry *entry); - void loadSoundData(SoundEntry *entry, Common::String name); - void removeEntry(SoundEntry *entry); // Subtitles int _subtitlesFlag; diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 67549cb5fe..304d524f45 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -22,7 +22,10 @@ #include "lastexpress/sound/entry.h" +#include "lastexpress/game/logic.h" +#include "lastexpress/game/savepoint.h" #include "lastexpress/game/sound.h" +#include "lastexpress/game/state.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" @@ -37,114 +40,267 @@ namespace LastExpress { // SoundEntry ////////////////////////////////////////////////////////////////////////// SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) { - type = kSoundTypeNone; + _type = kSoundTypeNone; - currentDataPtr = 0; - soundData = NULL; + _currentDataPtr = 0; + _soundData = NULL; - blockCount = 0; - time = 0; + _blockCount = 0; + _time = 0; - stream = NULL; + _stream = NULL; - field_34 = 0; - field_38 = 0; - field_3C = 0; - field_40 = 0; - entity = kEntityPlayer; - field_48 = 0; - priority = 0; + _field_34 = 0; + _field_38 = 0; + _field_3C = 0; + _field_40 = 0; + _entity = kEntityPlayer; + _field_48 = 0; + _priority = 0; - subtitle = NULL; + _subtitle = NULL; - soundStream = NULL; + _soundStream = NULL; } SoundEntry::~SoundEntry() { // Entries that have been queued would have their streamed disposed automatically - if (!soundStream) - SAFE_DELETE(stream); + if (!_soundStream) + SAFE_DELETE(_stream); - delete soundStream; + delete _soundStream; _engine = NULL; } +void SoundEntry::open(Common::String name, SoundFlag flag, int priority) { + _priority = priority; + setType(flag); + setStatus(flag); + + // Add entry to sound list + getSound()->addToQueue(this); + + // Add entry to cache and load sound data + getSound()->setupCache(this); + loadSoundData(name); +} + +void SoundEntry::close() { + _status.status |= kSoundStatusRemoved; + + // Loop until ready + while (!(_status.status1 & 4) && !(getSound()->getFlag() & 8) && (getSound()->getFlag() & 1)) + ; // empty loop body + + // The original game remove the entry from the cache here, + // but since we are called from within an iterator loop + // we will remove the entry there + // removeFromCache(entry); + + if (_subtitle) { + _subtitle->draw(); + SAFE_DELETE(_subtitle); + } + + if (_entity) { + if (_entity == kEntitySteam) + getSound()->playLoopingSound(2); + else if (_entity != kEntityTrain) + getSavePoints()->push(kEntityPlayer, _entity, kActionEndSound); + } +} + +void SoundEntry::setType(SoundFlag flag) { + switch (flag & kFlagType9) { + default: + case kFlagNone: + _type = getSound()->getCurrentType(); + getSound()->setCurrentType((SoundType)(_type + 1)); + break; + + case kFlagType1_2: { + SoundEntry *previous2 = getSound()->getEntry(kSoundType2); + if (previous2) + previous2->update(0); + + SoundEntry *previous = getSound()->getEntry(kSoundType1); + if (previous) { + previous->setType(kSoundType2); + previous->update(0); + } + + _type = kSoundType1; + } + break; + + case kFlagType3: { + SoundEntry *previous = getSound()->getEntry(kSoundType3); + if (previous) { + previous->setType(kSoundType4); + previous->update(0); + } + + _type = kSoundType11; + } + break; + + case kFlagType7: { + SoundEntry *previous = getSound()->getEntry(kSoundType7); + if (previous) + previous->setType(kSoundType8); + + _type = kSoundType7; + } + break; + + case kFlagType9: { + SoundEntry *previous = getSound()->getEntry(kSoundType9); + if (previous) + previous->setType(kSoundType10); + + _type = kSoundType9; + } + break; + + case kFlagType11: { + SoundEntry *previous = getSound()->getEntry(kSoundType11); + if (previous) + previous->setType(kSoundType14); + + _type = kSoundType11; + } + break; + + case kFlagType13: { + SoundEntry *previous = getSound()->getEntry(kSoundType13); + if (previous) + previous->setType(kSoundType14); + + _type = kSoundType13; + } + break; + } +} + void SoundEntry::setStatus(SoundFlag flag) { SoundStatus statusFlag = (SoundStatus)flag; if (!((statusFlag & 0xFF) & kSoundStatusClear1)) statusFlag = (SoundStatus)(statusFlag | kSoundStatusClear2); if (((statusFlag & 0xFF00) >> 8) & kSoundStatusClear0) - status.status = (uint32)statusFlag; + _status.status = (uint32)statusFlag; else - status.status = (statusFlag | kSoundStatusClear4); + _status.status = (statusFlag | kSoundStatusClear4); } void SoundEntry::setInCache() { - status.status |= kSoundStatusClear2; + _status.status |= kSoundStatusClear2; +} + +void SoundEntry::loadSoundData(Common::String name) { + _name2 = name; + + // Load sound data + _stream = getArchive(name); + + if (!_stream) + _stream = getArchive("DEFAULT.SND"); + + if (_stream) { + warning("Sound::loadSoundData: not implemented!"); + } else { + _status.status = kSoundStatusRemoved; + } } void SoundEntry::update(uint val) { - if (!(status.status3 & 64)) { + if (!(_status.status3 & 64)) { int value2 = val; - status.status |= kSoundStatus_100000; + _status.status |= kSoundStatus_100000; if (val) { if (getSound()->getFlag() & 32) { - field_40 = val; + _field_40 = val; value2 = val * 2 + 1; } - field_3C = value2; + _field_3C = value2; } else { - field_3C = 0; - status.status |= kSoundStatus_40000000; + _field_3C = 0; + _status.status |= kSoundStatus_40000000; } } } void SoundEntry::updateState() { if (getSound()->getFlag() & 32) { - if (type != kSoundType9 && type != kSoundType7 && type != kSoundType5) { - uint32 newStatus = status.status & kSoundStatusClear1; + if (_type != kSoundType9 && _type != kSoundType7 && _type != kSoundType5) { + uint32 newStatus = _status.status & kSoundStatusClear1; - status.status &= kSoundStatusClearAll; + _status.status &= kSoundStatusClearAll; - field_40 = newStatus; - status.status |= newStatus * 2 + 1; + _field_40 = newStatus; + _status.status |= newStatus * 2 + 1; } } - status.status |= kSoundStatus_20; + _status.status |= kSoundStatus_20; } void SoundEntry::reset() { - status.status |= kSoundStatusRemoved; - entity = kEntityPlayer; + _status.status |= kSoundStatusRemoved; + _entity = kEntityPlayer; - if (stream) { - if (!soundStream) { - SAFE_DELETE(stream); + if (_stream) { + if (!_soundStream) { + SAFE_DELETE(_stream); } else { - soundStream->stop(); - SAFE_DELETE(soundStream); + _soundStream->stop(); + SAFE_DELETE(_soundStream); } - stream = NULL; + _stream = NULL; } } void SoundEntry::showSubtitle(Common::String filename) { - subtitle = new SubtitleEntry(_engine); - subtitle->load(filename, this); + _subtitle = new SubtitleEntry(_engine); + _subtitle->load(filename, this); - if (subtitle->getStatus().status2 & 4) { - subtitle->draw(); - SAFE_DELETE(subtitle); + if (_subtitle->getStatus().status2 & 4) { + _subtitle->draw(); + SAFE_DELETE(_subtitle); } else { - status.status |= kSoundStatus_20000; + _status.status |= kSoundStatus_20000; + } +} + +void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) { + if (_name2.matchString("NISSND?") && (_status.status & kFlagType7) != kFlag3) { + s.syncAsUint32LE(_status.status); + s.syncAsUint32LE(_type); + s.syncAsUint32LE(_blockCount); // field_8; + s.syncAsUint32LE(_time); + s.syncAsUint32LE(_field_34); // field_10; + s.syncAsUint32LE(_field_38); // field_14; + s.syncAsUint32LE(_entity); + + uint32 delta = (uint32)_field_48 - getSound()->getData2(); + if (delta > kFlag8) + delta = 0; + s.syncAsUint32LE(delta); + + s.syncAsUint32LE(_priority); + + char name1[16]; + strcpy((char *)&name1, _name1.c_str()); + s.syncBytes((byte *)&name1, 16); + + char name2[16]; + strcpy((char *)&name2, _name2.c_str()); + s.syncBytes((byte *)&name2, 16); } } @@ -193,10 +349,10 @@ void SubtitleEntry::setupAndDraw() { _data->load(getArchive(_filename)); } - if (_data->getMaxTime() > _sound->time) { + if (_data->getMaxTime() > _sound->_time) { _status.status = kSoundStatus_400; } else { - _data->setTime((uint16)_sound->time); + _data->setTime((uint16)_sound->_time); if (getSound()->getSubtitleFlag() & 1) drawOnScreen(); diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h index 84a2342cf3..929d3463d5 100644 --- a/engines/lastexpress/sound/entry.h +++ b/engines/lastexpress/sound/entry.h @@ -24,30 +24,30 @@ #define LASTEXPRESS_SOUND_ENTRY_H /* - Sound entry: 68 bytes (this is what appears in the savegames) - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? + Sound entry: 68 bytes (this is what appears in savegames) + uint32 {4} - status + uint32 {4} - type + uint32 {4} - blockCount + uint32 {4} - time uint32 {4} - ?? uint32 {4} - ?? uint32 {4} - entity uint32 {4} - ?? - uint32 {4} - ?? + uint32 {4} - priority char {16} - name 1 char {16} - name 2 Sound queue entry: 120 bytes uint16 {2} - status + byte {1} - type byte {1} - ?? - byte {1} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - ?? - uint32 {4} - file data pointer - uint32 {4} - ?? - uint32 {4} - ?? uint32 {4} - ?? + uint32 {4} - currentDataPtr + uint32 {4} - soundData + uint32 {4} - currentBufferPtr + uint32 {4} - blockCount + uint32 {4} - time + uint32 {4} - size uint32 {4} - ?? uint32 {4} - archive structure pointer uint32 {4} - ?? @@ -57,7 +57,7 @@ uint32 {4} - ?? uint32 {4} - entity uint32 {4} - ?? - uint32 {4} - ?? + uint32 {4} - priority char {16} - name 1 char {16} - name 2 uint32 {4} - pointer to next entry in the queue @@ -69,6 +69,8 @@ #include "lastexpress/shared.h" +#include "common/serializer.h" + namespace LastExpress { class LastExpressEngine; @@ -109,13 +111,18 @@ union SoundStatusUnion { ////////////////////////////////////////////////////////////////////////// // SoundEntry ////////////////////////////////////////////////////////////////////////// -class SoundEntry { +class SoundEntry : Common::Serializable { public: SoundEntry(LastExpressEngine *engine); ~SoundEntry(); + void open(Common::String name, SoundFlag flag, int priority); + void close(); + void setStatus(SoundFlag flag); + void setType(SoundFlag flag); void setInCache(); + void loadSoundData(Common::String name); void update(uint val); void updateState(); void reset(); @@ -123,37 +130,47 @@ public: // Subtitles void showSubtitle(Common::String filename); + // Serializable + void saveLoadWithSerializer(Common::Serializer &ser); + + // Accessors + void setType(SoundType type) { _type = type; } + SoundType getType() { return _type; } + + void setEntity(EntityIndex entity) { _entity = entity; } + EntityIndex getEntity() { return _entity; } + private: LastExpressEngine *_engine; public: - SoundStatusUnion status; - SoundType type; // int - //int data; - //int endOffset; - int currentDataPtr; - void *soundData; - //int currentBufferPtr; - int blockCount; - uint32 time; - //int size; - //int field_28; - Common::SeekableReadStream *stream; // int - //int field_30; - int field_34; - int field_38; - int field_3C; - int field_40; - EntityIndex entity; - int field_48; - uint32 priority; - Common::String name1; //char[16]; - Common::String name2; //char[16]; - //int next; // offset to the next structure in the list (not used) - SubtitleEntry *subtitle; + SoundStatusUnion _status; + SoundType _type; // int + //int _data; + //int _endOffset; + int _currentDataPtr; + void *_soundData; + //int _currentBufferPtr; + int _blockCount; + uint32 _time; + //int _size; + //int _field_28; + Common::SeekableReadStream *_stream; // int + //int _field_30; + int _field_34; + int _field_38; + int _field_3C; + int _field_40; + EntityIndex _entity; + int _field_48; + uint32 _priority; + Common::String _name1; //char[16]; + Common::String _name2; //char[16]; + // original has pointer to the next structure in the list (not used) + SubtitleEntry *_subtitle; // Sound stream - StreamedSound *soundStream; + StreamedSound *_soundStream; }; ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 6eace0ca759bc62b6b0b6cf69a4341b4d1bb43e4 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 22:10:29 -0400 Subject: LASTEXPRESS: Move sound queue related functions to a separate class - Implement missing queue reset function - Cleanup SoundManager::playLoopingSound() --- engines/lastexpress/debug.cpp | 6 +- engines/lastexpress/entities/abbot.cpp | 6 +- engines/lastexpress/entities/anna.cpp | 48 +- engines/lastexpress/entities/august.cpp | 18 +- engines/lastexpress/entities/boutarel.cpp | 4 +- engines/lastexpress/entities/chapters.cpp | 112 ++-- engines/lastexpress/entities/cooks.cpp | 6 +- engines/lastexpress/entities/coudert.cpp | 22 +- engines/lastexpress/entities/francois.cpp | 12 +- engines/lastexpress/entities/kahina.cpp | 14 +- engines/lastexpress/entities/kronos.cpp | 14 +- engines/lastexpress/entities/mahmud.cpp | 18 +- engines/lastexpress/entities/max.cpp | 46 +- engines/lastexpress/entities/mertens.cpp | 16 +- engines/lastexpress/entities/milos.cpp | 22 +- engines/lastexpress/entities/mmeboutarel.cpp | 8 +- engines/lastexpress/entities/pascale.cpp | 14 +- engines/lastexpress/entities/rebecca.cpp | 4 +- engines/lastexpress/entities/salko.cpp | 6 +- engines/lastexpress/entities/tables.cpp | 12 +- engines/lastexpress/entities/tatiana.cpp | 26 +- engines/lastexpress/entities/train.cpp | 16 +- engines/lastexpress/entities/vassili.cpp | 4 +- engines/lastexpress/entities/verges.cpp | 26 +- engines/lastexpress/fight/fight.cpp | 12 +- engines/lastexpress/fight/fighter_anna.cpp | 6 +- engines/lastexpress/fight/fighter_ivo.cpp | 6 +- engines/lastexpress/fight/fighter_milos.cpp | 6 +- engines/lastexpress/fight/fighter_salko.cpp | 6 +- engines/lastexpress/fight/fighter_vesna.cpp | 6 +- engines/lastexpress/game/action.cpp | 48 +- engines/lastexpress/game/entities.cpp | 8 +- engines/lastexpress/game/inventory.cpp | 8 +- engines/lastexpress/game/logic.cpp | 16 +- engines/lastexpress/game/savegame.cpp | 10 +- engines/lastexpress/game/scenes.cpp | 12 +- engines/lastexpress/game/sound.cpp | 803 ++------------------------- engines/lastexpress/game/sound.h | 119 +--- engines/lastexpress/helpers.h | 1 + engines/lastexpress/lastexpress.cpp | 8 +- engines/lastexpress/menu/menu.cpp | 38 +- engines/lastexpress/module.mk | 1 + engines/lastexpress/shared.h | 6 + engines/lastexpress/sound/entry.cpp | 55 +- engines/lastexpress/sound/queue.cpp | 795 ++++++++++++++++++++++++++ engines/lastexpress/sound/queue.h | 131 +++++ 46 files changed, 1379 insertions(+), 1202 deletions(-) create mode 100644 engines/lastexpress/sound/queue.cpp create mode 100644 engines/lastexpress/sound/queue.h diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index d5c7df0e55..2d22630381 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -44,6 +44,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -793,7 +795,7 @@ bool Debugger::cmdFight(int argc, const char **argv) { restoreArchive(); // Stop audio and restore scene - getSound()->stopAllSound(); + getSoundQueue()->stopAllSound(); clearBg(GraphicsManager::kBackgroundAll); @@ -925,7 +927,7 @@ bool Debugger::cmdBeetle(int argc, const char **argv) { restoreArchive(); // Stop audio and restore scene - getSound()->stopAllSound(); + getSoundQueue()->stopAllSound(); clearBg(GraphicsManager::kBackgroundAll); diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 112edec9af..6fcadcfa54 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -1409,7 +1411,7 @@ IMPLEMENT_FUNCTION(43, Abbot, function43) setup_playSound("Abb4002"); break; } else { - if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 1000) || getSound()->isBuffered(kEntityBoutarel) || !params->param4) + if (!getEntities()->isDistanceBetweenEntities(kEntityAbbot, kEntityPlayer, 1000) || getSoundQueue()->isBuffered(kEntityBoutarel) || !params->param4) params->param4 = (uint)getState()->time + 450; if (params->param4 < getState()->time) { @@ -1754,7 +1756,7 @@ IMPLEMENT_FUNCTION(49, Abbot, pickBomb) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index d794cc8520..2eb3a9ec85 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -312,7 +314,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) params->param4 = 0; params->param5 = 0; } else { - getSound()->removeFromQueue(kEntityAnna); + getSoundQueue()->removeFromQueue(kEntityAnna); getObjects()->update(kObjectCompartmentF, kEntityAnna, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject53, kEntityAnna, kObjectLocation1, kCursorNormal, kCursorNormal); @@ -323,7 +325,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) break; case kActionOpenDoor: - getSound()->removeFromQueue(kEntityAnna); + getSoundQueue()->removeFromQueue(kEntityAnna); setCallback(3); setup_playSound("LIB013"); break; @@ -339,8 +341,8 @@ IMPLEMENT_FUNCTION(12, Anna, function12) getEntities()->drawSequenceLeft(kEntityAnna, "418C"); - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getSound()->playSound(kEntityAnna, "ANN2135A"); break; @@ -379,7 +381,7 @@ IMPLEMENT_FUNCTION(12, Anna, function12) break; case 3: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(4); setup_playSound("MAX1120"); break; @@ -503,7 +505,7 @@ IMPLEMENT_FUNCTION_IS(15, Anna, function15, TimeValue) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -1456,7 +1458,7 @@ label_callback_1: case 2: case 3: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(4); setup_playSound("MAX1120"); break; @@ -1521,8 +1523,8 @@ IMPLEMENT_FUNCTION(35, Anna, function35) case kActionKnock: case kActionOpenDoor: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); if (savepoint.action == kActionKnock) getSound()->playSound(kEntityPlayer, "LIB012"); @@ -1564,8 +1566,8 @@ IMPLEMENT_FUNCTION(35, Anna, function35) break; case kAction226031488: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getSavePoints()->push(kEntityAnna, kEntityMax, kAction71277948); break; @@ -1844,7 +1846,7 @@ IMPLEMENT_FUNCTION(41, Anna, function41) case 1: case 2: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(3); setup_playSound("MAX1120"); break; @@ -2090,7 +2092,7 @@ IMPLEMENT_FUNCTION(48, Anna, function48) break; if (params->param3 != kTimeInvalid && getState()->time > kTime1969200) { - UPDATE_PARAM_PROC_TIME(kTime1983600, (!getEntities()->isInRestaurant(kEntityPlayer) || getSound()->isBuffered(kEntityBoutarel)), params->param3, 150) + UPDATE_PARAM_PROC_TIME(kTime1983600, (!getEntities()->isInRestaurant(kEntityPlayer) || getSoundQueue()->isBuffered(kEntityBoutarel)), params->param3, 150) setCallback(3); setup_playSound("Aug3007A"); break; @@ -2481,7 +2483,7 @@ IMPLEMENT_FUNCTION(53, Anna, function53) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -2620,7 +2622,7 @@ IMPLEMENT_FUNCTION(54, Anna, function54) break; case 1: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { setCallback(2); setup_playSound("MAX1120"); break; @@ -2789,7 +2791,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57) break; case 4: - if (getSound()->isBuffered(kEntityAugust)) { + if (getSoundQueue()->isBuffered(kEntityAugust)) { setCallback(4); setup_updateFromTime(75); } else { @@ -2817,7 +2819,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57) case kAction123712592: getEntities()->drawSequenceLeft(kEntityAnna, "628Af"); - if (getSound()->isBuffered(kEntityAugust)) { + if (getSoundQueue()->isBuffered(kEntityAugust)) { setCallback(4); setup_updateFromTime(75); } else { @@ -3158,8 +3160,8 @@ IMPLEMENT_FUNCTION(63, Anna, function63) // Anna will get killed... case kAction272177921: - if (getSound()->isBuffered("MUS012")) - getSound()->processEntry("MUS012"); + if (getSoundQueue()->isBuffered("MUS012")) + getSoundQueue()->processEntry("MUS012"); setCallback(1); setup_savegame(kSavegameTypeEvent, kEventAnnaKilled); @@ -3935,8 +3937,8 @@ IMPLEMENT_FUNCTION(80, Anna, function80) break; case 1: - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getAction()->playAnimation(kEventKronosBringFirebird); getScenes()->loadSceneFromItem(kItemFirebird); @@ -3951,8 +3953,8 @@ IMPLEMENT_FUNCTION(80, Anna, function80) case 3: getProgress().isEggOpen = true; - if (getSound()->isBuffered(kEntityAnna)) - getSound()->processEntry(kEntityAnna); + if (getSoundQueue()->isBuffered(kEntityAnna)) + getSoundQueue()->processEntry(kEntityAnna); getAction()->playAnimation(kEventKronosOpenFirebird); getScenes()->loadSceneFromPosition(kCarRestaurant, 3); diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index fbd50d64fb..44dd3eb579 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -36,6 +36,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -1427,7 +1429,7 @@ IMPLEMENT_FUNCTION(29, August, function29) if (getState()->time < kTime1134000) { if (!getEntities()->isInRestaurant(kEntityPlayer) - || getSound()->isBuffered("MRB1076") || getSound()->isBuffered("MRB1078") || getSound()->isBuffered("MRB1078A")) + || getSoundQueue()->isBuffered("MRB1076") || getSoundQueue()->isBuffered("MRB1078") || getSoundQueue()->isBuffered("MRB1078A")) params->param3 = (uint)getState()->time + 225; if (params->param3 > getState()->time) @@ -1762,7 +1764,7 @@ IMPLEMENT_FUNCTION(34, August, function34) break; case kActionNone: - if (!getSound()->isBuffered(kEntityAugust) && getProgress().field_18 != 4) + if (!getSoundQueue()->isBuffered(kEntityAugust) && getProgress().field_18 != 4) getSound()->playSound(kEntityAugust, "AUG1057"); // August snoring break; @@ -2183,7 +2185,7 @@ IMPLEMENT_FUNCTION_III(42, August, function42, CarIndex, EntityPosition, bool) break; case kActionExcuseMe: - if (!getSound()->isBuffered(kEntityAugust)) + if (!getSoundQueue()->isBuffered(kEntityAugust)) getSound()->excuseMe(kEntityAugust); break; @@ -3343,7 +3345,7 @@ IMPLEMENT_FUNCTION(65, August, function65) getObjects()->update(kObjectCompartment3, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand); - if (!getSound()->isBuffered(kEntityAugust)) + if (!getSoundQueue()->isBuffered(kEntityAugust)) getSound()->playSound(kEntityAugust, "AUG1057"); // August snoring break; } @@ -3504,9 +3506,9 @@ IMPLEMENT_FUNCTION(69, August, unhookCars) break; case kActionDefault: - getSound()->processEntries(); - if (getSound()->isBuffered("ARRIVE")) - getSound()->removeFromQueue("ARRIVE"); + getSoundQueue()->processEntries(); + if (getSoundQueue()->isBuffered("ARRIVE")) + getSoundQueue()->removeFromQueue("ARRIVE"); setCallback(1); setup_savegame(kSavegameTypeEvent, kEventAugustUnhookCarsBetrayal); @@ -3516,7 +3518,7 @@ IMPLEMENT_FUNCTION(69, August, unhookCars) if (getCallback() == 1) { getAction()->playAnimation(getProgress().field_C ? kEventAugustUnhookCarsBetrayal : kEventAugustUnhookCars); getEntities()->clearSequences(kEntityAugust); - getSound()->resetState(); + getSoundQueue()->resetState(); getSound()->playSound(kEntityPlayer, "MUS050"); getScenes()->loadSceneFromPosition(kCarRestaurant, 85, 1); getSavePoints()->pushAll(kEntityAugust, kActionProceedChapter5); diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index db7761784f..cf5d286d64 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -941,7 +943,7 @@ IMPLEMENT_FUNCTION(29, Boutarel, function29) if (getEntities()->isInRestaurant(kEntityAnna) && getEntities()->isInRestaurant(kEntityAugust) - && !getSound()->isBuffered(kEntityBoutarel) + && !getSoundQueue()->isBuffered(kEntityBoutarel) && params->param3 != kTimeInvalid) { if (getState()->time <= kTime1998000) diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index d4425ada43..53d89e9699 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -65,6 +65,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -164,16 +166,16 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; case kActionOpenDoor: if (params->param1) { getEntities()->clearSequences(kEntityChapters); - getSound()->processEntry(kEntityChapters); + getSoundQueue()->processEntry(kEntityChapters); getSound()->playSound(kEntityPlayer, "LIB014"); - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 4) = 7; @@ -194,7 +196,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) getSound()->playSound(kEntityPlayer, "LIB014"); getSound()->playSound(kEntityPlayer, "LIB015", kFlagDefault, 15); - if (!getSound()->isBuffered(kEntityChapters)) + if (!getSoundQueue()->isBuffered(kEntityChapters)) getSound()->playSound(kEntityChapters, "MUS009", kFlagDefault); getScenes()->loadSceneFromPosition(kCarLocomotive, 38); @@ -241,42 +243,42 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) RESET_ENTITY_STATE(kEntityHadija, Alouan, setup_function12); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } - getSound()->processEntries(); + getSoundQueue()->processEntries(); - if (getSound()->isBuffered("CON1505")) - getSound()->processEntry("CON1505"); + if (getSoundQueue()->isBuffered("CON1505")) + getSoundQueue()->processEntry("CON1505"); - if (getSound()->isBuffered("AUG1057")) - getSound()->processEntry("AUG1057"); + if (getSoundQueue()->isBuffered("AUG1057")) + getSoundQueue()->processEntry("AUG1057"); - if (getSound()->isBuffered("ZFX1005")) - getSound()->processEntry("ZFX1005"); + if (getSoundQueue()->isBuffered("ZFX1005")) + getSoundQueue()->processEntry("ZFX1005"); - if (getSound()->isBuffered("ZFX1006")) - getSound()->processEntry("ZFX1006"); + if (getSoundQueue()->isBuffered("ZFX1006")) + getSoundQueue()->processEntry("ZFX1006"); - if (getSound()->isBuffered("ZFX1007")) - getSound()->processEntry("ZFX1007"); + if (getSoundQueue()->isBuffered("ZFX1007")) + getSoundQueue()->processEntry("ZFX1007"); - if (getSound()->isBuffered("ZFX1007A")) - getSound()->processEntry("ZFX1007A"); + if (getSoundQueue()->isBuffered("ZFX1007A")) + getSoundQueue()->processEntry("ZFX1007A"); - if (getSound()->isBuffered("ZFX1007B")) - getSound()->processEntry("ZFX1007B"); + if (getSoundQueue()->isBuffered("ZFX1007B")) + getSoundQueue()->processEntry("ZFX1007B"); getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); // FIXME add event pump ? - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); getProgress().field_84 = true; @@ -301,7 +303,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End) if (params->param2 >= 3) { - if (!getSound()->isBuffered("LIB031", true)) + if (!getSoundQueue()->isBuffered("LIB031", true)) getSound()->playSound(kEntityPlayer, "LIB031"); if (params->param2 == 3) { @@ -319,7 +321,7 @@ IMPLEMENT_FUNCTION(7, Chapters, chapter1Init) return; getProgress().chapter = kChapter1; - getSound()->resetState(); + getSoundQueue()->resetState(); getState()->time = kTimeChapter1; getState()->timeDelta = 0; @@ -385,7 +387,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// #define PLAY_STEAM() { \ - getSound()->resetState(); \ + getSoundQueue()->resetState(); \ getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4)); \ ENTITY_PARAM(0, 2) = 0; \ } @@ -563,7 +565,7 @@ label_chapter1_next: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; if (params->param4) { @@ -694,7 +696,7 @@ IMPLEMENT_FUNCTION(9, Chapters, chapter1Next) if (savepoint.action == kActionDefault) { // Reset sound cache if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -702,8 +704,8 @@ IMPLEMENT_FUNCTION(9, Chapters, chapter1Next) getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); setup_chapter2(); } @@ -790,7 +792,7 @@ IMPLEMENT_FUNCTION(11, Chapters, chapter2Init) // Reset sound cache if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -874,7 +876,7 @@ IMPLEMENT_FUNCTION(14, Chapters, chapter3Init) getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -987,7 +989,7 @@ label_callback_8: } } - getSound()->resetState(); + getSoundQueue()->resetState(); getSound()->playSteam((CityIndex)ENTITY_PARAM(0, 4)); ENTITY_PARAM(0, 2) = 0; @@ -998,7 +1000,7 @@ label_callback_8: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; } break; @@ -1150,8 +1152,8 @@ IMPLEMENT_FUNCTION(18, Chapters, chapter4Init) if (savepoint.action != kActionDefault) return; - getSound()->processEntries(); - getSound()->resetState(); + getSoundQueue()->processEntries(); + getSoundQueue()->resetState(); getProgress().isTrainRunning = true; @@ -1177,7 +1179,7 @@ IMPLEMENT_FUNCTION(18, Chapters, chapter4Init) getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -1319,7 +1321,7 @@ label_callback_4: } if (ENTITY_PARAM(0, 3)) { - getSound()->resetState(); + getSoundQueue()->resetState(); ENTITY_PARAM(0, 3) = 0; } else if (!params->param2 && !params->param3) { getSound()->playSound(kEntityChapters, "ZFX1001"); @@ -1356,17 +1358,17 @@ label_callback_4: goto label_callback_4; case 5: - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getAction()->playAnimation(kEventTrainExplosionBridge); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneNone, true); break; case 6: - getSound()->processEntries(); + getSoundQueue()->processEntries(); getAction()->playAnimation(kEventTylerCastleDream); - getSound()->resetState(); + getSoundQueue()->resetState(); getProgress().field_18 = 1; @@ -1465,7 +1467,7 @@ label_callback_4: params->param1 = 1; if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; @@ -1474,8 +1476,8 @@ label_callback_4: getSound()->playSound(kEntityPlayer, "MUS008", kFlagDefault); getInventory()->unselectItem(); - while (getSound()->isBuffered("MUS008")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("MUS008")) + getSoundQueue()->updateQueue(); if (getInventory()->hasItem(kItemBomb)) { RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function47); @@ -1522,8 +1524,8 @@ label_callback_4: case kAction191001984: getState()->time = kTime2520000; - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getEntities()->clearSequences(kEntityChapters); getInventory()->removeItem(kItemTelegram); @@ -1535,8 +1537,8 @@ label_callback_4: break; case kAction201959744: - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getSound()->playSound(kEntityTrain, "ZFX4001", kFlagDefault); @@ -1644,7 +1646,7 @@ IMPLEMENT_FUNCTION(21, Chapters, chapter5Init) getObjects()->updateLocation2(kObjectRestaurantCar, kObjectLocation2); if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) { - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); ENTITY_PARAM(0, 2) = 0; ENTITY_PARAM(0, 3) = 0; } @@ -1675,7 +1677,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) if (!getProgress().isNightTime) { getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); } } @@ -1684,7 +1686,7 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) if (!getEvent(kEventLocomotiveMilosDay) && !getEvent(kEventLocomotiveMilosNight)) { getSound()->playSound(kEntityChapters, "ARRIVE", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); } } break; @@ -1713,8 +1715,8 @@ IMPLEMENT_FUNCTION(22, Chapters, chapter5Handler) getProgress().isNightTime = true; getState()->time = kTime2916000; - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); break; } IMPLEMENT_FUNCTION_END @@ -1730,7 +1732,7 @@ void Chapters::enterExitStation(const SavePoint &savepoint, bool isEnteringStati return; } - getSound()->removeFromQueue(kEntityChapters); + getSoundQueue()->removeFromQueue(kEntityChapters); if (!ENTITY_PARAM(0, 2)) { if (ENTITY_PARAM(0, 3)) @@ -1798,7 +1800,7 @@ void Chapters::enterExitHelper(bool isEnteringStation) { EXPOSE_PARAMS(EntityData::EntityParametersSIIS); getSound()->playSound(kEntityChapters, isEnteringStation ? "ARRIVE" : "DEPART", kFlag8); - getSound()->processEntries(); + getSoundQueue()->processEntries(); getObjects()->update(kObjectHandleOutsideLeft, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); getObjects()->update(kObjectHandleOutsideRight, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp index 336f911800..cd8fbfd8ff 100644 --- a/engines/lastexpress/entities/cooks.cpp +++ b/engines/lastexpress/entities/cooks.cpp @@ -29,6 +29,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -101,7 +103,7 @@ IMPLEMENT_FUNCTION(3, Cooks, function3) if (getEntities()->isPlayerPosition(kCarRestaurant, 46)) { getEntities()->drawSequenceLeft(kEntityCooks, "308D"); - if (!getSound()->isBuffered(kEntityCooks)) { + if (!getSoundQueue()->isBuffered(kEntityCooks)) { if (params->param1) { if (!getEntities()->hasValidFrame(kEntityCooks)) { getSound()->playSound(kEntityCooks, "LIB015"); @@ -187,7 +189,7 @@ IMPLEMENT_FUNCTION(4, Cooks, function4) if (getEntities()->isPlayerPosition(kCarRestaurant, 80)) { getEntities()->drawSequenceLeft(kEntityCooks, "308D"); - if (!getSound()->isBuffered(kEntityCooks)) { + if (!getSoundQueue()->isBuffered(kEntityCooks)) { if (params->param1) { if (!getEntities()->hasValidFrame(kEntityCooks)) { getSound()->playSound(kEntityCooks, "LIB015"); diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index 0733a4c984..fea08f4611 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -314,7 +316,7 @@ IMPLEMENT_FUNCTION_II(9, Coudert, updateEntity, CarIndex, EntityPosition) case kActionExcuseMeCath: if (getData()->clothes == kClothes1) getSound()->playSound(kEntityPlayer, "ZFX1003", getSound()->getSoundFlag(kEntityCoudert)); - else if (!getSound()->isBuffered(kEntityCoudert)) + else if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityPlayer, "JAC1112", getSound()->getSoundFlag(kEntityCoudert)); break; @@ -409,7 +411,7 @@ IMPLEMENT_FUNCTION_I(12, Coudert, excuseMe, EntityIndex) if (savepoint.action != kActionDefault) return; - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { CALLBACK_ACTION(); return; } @@ -823,7 +825,7 @@ IMPLEMENT_FUNCTION(18, Coudert, function18) getScenes()->loadSceneFromItemPosition(kItem5); if (getEntities()->isPlayerPosition(kCarRedSleeping, 68)) { - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, "JAC1111"); getScenes()->loadSceneFromPosition(kCarRedSleeping, 25); @@ -1642,7 +1644,7 @@ IMPLEMENT_FUNCTION_I(31, Coudert, function31, uint32) break; case 1: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { getEntities()->drawSequenceLeft(kEntityCoudert, "627K"); } else { setCallback(2); @@ -1929,7 +1931,7 @@ IMPLEMENT_FUNCTION_I(35, Coudert, function35, bool) break; case 1: - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, "Ann3124"); if (params->param1) @@ -2008,8 +2010,8 @@ IMPLEMENT_FUNCTION(37, Coudert, function37) break; case kActionDefault: - if (getSound()->isBuffered(kEntityCoudert)) - getSound()->processEntry(kEntityCoudert); + if (getSoundQueue()->isBuffered(kEntityCoudert)) + getSoundQueue()->processEntry(kEntityCoudert); if (ENTITY_PARAM(0, 7)) { getData()->entityPosition = kPosition_8200; @@ -2268,7 +2270,7 @@ label_callback_8: } label_callback_9: - if (ENTITY_PARAM(0, 1) && !getSound()->isBuffered(kEntityCoudert)) + if (ENTITY_PARAM(0, 1) && !getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, rnd(2) ? "JAC1065" : "JAC1065A"); if (getState()->time > kTime1107000 && !ENTITY_PARAM(0, 1) && !getEvent(kEventVassiliSeizure)) { @@ -3019,7 +3021,7 @@ IMPLEMENT_FUNCTION(46, Coudert, function46) // Fallback to next case case 7: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { setCallback(7); setup_updateFromTime(75); } else { @@ -3088,7 +3090,7 @@ IMPLEMENT_FUNCTION_I(47, Coudert, function47, bool) // Fallback to next case case 4: - if (getSound()->isBuffered(kEntityCoudert)) { + if (getSoundQueue()->isBuffered(kEntityCoudert)) { setCallback(4); setup_updateFromTime(225); } else { diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp index 86b6820499..6bbe740730 100644 --- a/engines/lastexpress/entities/francois.cpp +++ b/engines/lastexpress/entities/francois.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/savepoint.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -275,7 +277,7 @@ IMPLEMENT_FUNCTION_I(11, Francois, function11, TimeValue) break; case kActionNone: - if (!getSound()->isBuffered(kEntityFrancois)) { + if (!getSoundQueue()->isBuffered(kEntityFrancois)) { UPDATE_PARAM_PROC(CURRENT_PARAM(1, 1), getState()->timeTicks, params->param6) switch (rnd(7)) { @@ -370,8 +372,8 @@ label_callback: getData()->field_4A3 = 30; getData()->inventoryItem = kItemNone; - if (getSound()->isBuffered(kEntityFrancois)) - getSound()->processEntry(kEntityFrancois); + if (getSoundQueue()->isBuffered(kEntityFrancois)) + getSoundQueue()->processEntry(kEntityFrancois); setCallback(4); setup_updateEntity(kCarRedSleeping, kPosition_5790); @@ -381,8 +383,8 @@ label_callback: case kAction1: getData()->inventoryItem = kItemNone; - if (getSound()->isBuffered(kEntityFrancois)) - getSound()->processEntry(kEntityFrancois); + if (getSoundQueue()->isBuffered(kEntityFrancois)) + getSoundQueue()->processEntry(kEntityFrancois); setCallback(6); setup_savegame(kSavegameTypeEvent, kEventFrancoisWhistle); diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index db71981b60..6c73784b21 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -607,8 +609,8 @@ label_callback_3: break; if (getEvent(kEventKahinaAskSpeakFirebird)) { - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); if (savepoint.action == kActionKnock) getSound()->playSound(kEntityPlayer, "LIB012"); @@ -1163,8 +1165,8 @@ IMPLEMENT_FUNCTION(24, Kahina, function24) case 1: if (ENTITY_PARAM(0, 2)) { getEntities()->clearSequences(kEntityKahina); - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); getProgress().field_44 = 0; @@ -1198,8 +1200,8 @@ IMPLEMENT_FUNCTION(24, Kahina, function24) case kAction137503360: getEntities()->clearSequences(kEntityKahina); - if (getSound()->isBuffered(kEntityKahina)) - getSound()->processEntry(kEntityKahina); + if (getSoundQueue()->isBuffered(kEntityKahina)) + getSoundQueue()->processEntry(kEntityKahina); getProgress().field_44 = 0; diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 5afc52fe3d..06ebd54694 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -39,6 +39,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -216,7 +218,7 @@ IMPLEMENT_FUNCTION(11, Kronos, function11) case kActionDefault: getData()->entityPosition = kPosition_7000; - if (!getSound()->isBuffered(kEntityKronos)) + if (!getSoundQueue()->isBuffered(kEntityKronos)) getSound()->playSound(kEntityKronos, "KRO1001"); break; } @@ -457,7 +459,7 @@ IMPLEMENT_FUNCTION(19, Kronos, function19) case 2: getAction()->playAnimation(kEventConcertStart); - getSound()->setupEntry(kSoundType7, kEntityKronos); + getSoundQueue()->setupEntry(kSoundType7, kEntityKronos); getScenes()->loadSceneFromPosition(kCarKronos, 83); RESET_ENTITY_STATE(kEntityRebecca, Rebecca, setup_function39); @@ -480,7 +482,7 @@ IMPLEMENT_FUNCTION(20, Kronos, function20) break; case kActionNone: - params->param5 = getSound()->getEntryTime(kEntityKronos)* 2; + params->param5 = getSoundQueue()->getEntryTime(kEntityKronos)* 2; if (params->param6 < ARRAYSIZE(concertData) && params->param5 > concertData[params->param6].time) { @@ -560,8 +562,8 @@ IMPLEMENT_FUNCTION(20, Kronos, function20) case 3: getAction()->playAnimation(kEventCathFallingAsleep); - while (getSound()->isBuffered("1919.LNK")) - getSound()->updateQueue(); + while (getSoundQueue()->isBuffered("1919.LNK")) + getSoundQueue()->updateQueue(); getAction()->playAnimation(kEventCathWakingUp); getScenes()->processScene(); @@ -746,7 +748,7 @@ IMPLEMENT_FUNCTION(22, Kronos, function22) case kActionKnock: case kActionOpenDoor: - if (!getSound()->isBuffered(savepoint.action == kActionKnock ? "LIB012" : "LIB013", true)) + if (!getSoundQueue()->isBuffered(savepoint.action == kActionKnock ? "LIB012" : "LIB013", true)) getSound()->playSound(kEntityPlayer, savepoint.action == kActionKnock ? "LIB012" : "LIB013"); if (getEvent(kEventConcertLeaveWithBriefcase)) diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index f9ae741d0e..cb782854af 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -157,7 +159,7 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) case kActionEndSound: case kActionDrawScene: - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { EntityPosition position = getEntityData(kEntityPlayer)->entityPosition; if (position < kPosition_1500 || position >= kPosition_5790 || (position > kPosition_4455 && params->param5 != 5)) { getObjects()->update(kObjectCompartment5, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); @@ -173,12 +175,12 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool) case kActionKnock: case kActionOpenDoor: - if (!getSound()->isBuffered((savepoint.action == kActionKnock) ? "LIB012" : "LIB013", true)) + if (!getSoundQueue()->isBuffered((savepoint.action == kActionKnock) ? "LIB012" : "LIB013", true)) getSound()->playSound(kEntityPlayer, (savepoint.action == kActionKnock) ? "LIB012" : "LIB013"); params->param5 = savepoint.param.intValue; - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { params->param3++; switch(params->param3) { @@ -282,7 +284,7 @@ IMPLEMENT_FUNCTION(11, Mahmud, function11) case kActionOpenDoor: { getSound()->playSound(kEntityPlayer, (savepoint.action == kActionKnock ? "LIB012" : "LIB013")); - if (!getSound()->isBuffered(kEntityMahmud)) { + if (!getSoundQueue()->isBuffered(kEntityMahmud)) { params->param1++; getSound()->playSound(kEntityMahmud, (params->param1 == 1 ? "MAH1170E" : (params->param1 == 2 ? "MAH1173B" : "MAH1174"))); @@ -396,8 +398,8 @@ IMPLEMENT_FUNCTION(11, Mahmud, function11) break; case kAction123852928: - if (getSound()->isBuffered(kEntityMahmud)) - getSound()->processEntry(kEntityMahmud); + if (getSoundQueue()->isBuffered(kEntityMahmud)) + getSoundQueue()->processEntry(kEntityMahmud); getObjects()->update(kObjectCompartment5, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectCompartment6, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand); @@ -560,7 +562,7 @@ IMPLEMENT_FUNCTION(14, Mahmud, chaptersHandler) TIME_CHECK_CALLBACK(kTime1098000, params->param6, 1, setup_function13); - if (!getSound()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { + if (!getSoundQueue()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { params->param7 = 1; setCallback(2); @@ -636,7 +638,7 @@ IMPLEMENT_FUNCTION(14, Mahmud, chaptersHandler) params->param4 = 0; params->param5 = 0; - if (!getSound()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { + if (!getSoundQueue()->isBuffered("HAR1104") && getState()->time > kTime1167300 && !params->param7) { params->param7 = 1; setCallback(2); setup_function12(); diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 12123ed04a..924f8f77aa 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -31,6 +31,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -91,7 +93,7 @@ IMPLEMENT_FUNCTION(6, Max, chapter12_handler) case kActionNone: UPDATE_PARAM(params->param2, getState()->time, params->param1); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -108,7 +110,7 @@ IMPLEMENT_FUNCTION(6, Max, chapter12_handler) break; case kAction158007856: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -125,7 +127,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) case kActionNone: UPDATE_PARAM(params->param2, getState()->time, params->param1) - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -137,8 +139,8 @@ IMPLEMENT_FUNCTION(7, Max, function7) getObjects()->update(kObjectCompartmentF, kEntityMax, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject53, kEntityMax, kObjectLocation1, kCursorNormal, kCursorNormal); - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); setCallback((savepoint.action == kActionKnock) ? 1 : 2); setup_playSound((savepoint.action == kActionKnock) ? "LIB012" : "LIB013"); @@ -156,7 +158,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) break; case kActionDrawScene: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { if (getEntities()->isPlayerPosition(kCarRedSleeping, 56) || getEntities()->isPlayerPosition(kCarRedSleeping, 78)) getSound()->playSound(kEntityMax, "Max1120"); } @@ -197,7 +199,7 @@ IMPLEMENT_FUNCTION(7, Max, function7) break; case kAction158007856: - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -214,7 +216,7 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) case kActionNone: UPDATE_PARAM(params->param3, getState()->time, params->param2); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3101"); params->param2 = 255 * (4 * rnd(20) + 40); @@ -228,8 +230,8 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) break; } - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getAction()->playAnimation(kEventCathMaxLickHand); getScenes()->processScene(); @@ -247,7 +249,7 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) getData()->location = kLocationInsideCompartment; getData()->car = kCarBaggage; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3101"); break; @@ -255,8 +257,8 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler) if (getCallback() != 1) break; - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getSound()->playSound(kEntityPlayer, "LIB026"); getAction()->playAnimation(kEventCathMaxFree); @@ -392,7 +394,7 @@ IMPLEMENT_FUNCTION(13, Max, chapter3Handler) UPDATE_PARAM(params->param3, getState()->time, params->param1); - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); @@ -424,7 +426,7 @@ IMPLEMENT_FUNCTION(13, Max, chapter3Handler) if (params->param2) break; - if (!getSound()->isBuffered(kEntityMax)) { + if (!getSoundQueue()->isBuffered(kEntityMax)) { getSound()->playSound(kEntityMax, "Max1122"); params->param1 = 255 * (4 * rnd(20) + 40); } @@ -464,7 +466,7 @@ IMPLEMENT_FUNCTION(14, Max, freeFromCage) getData()->location = kLocationInsideCompartment; getData()->car = kCarBaggage; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max1122"); break; @@ -476,17 +478,17 @@ IMPLEMENT_FUNCTION(14, Max, freeFromCage) break; case 1: - if (getSound()->isBuffered(kEntityMax)) - getSound()->removeFromQueue(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->removeFromQueue(kEntityMax); getAction()->playAnimation(kEventCathMaxCage); - getSound()->setupEntry(kSoundType7, kEntityMax); + getSoundQueue()->setupEntry(kSoundType7, kEntityMax); getScenes()->processScene(); break; case 2: - if (getSound()->isBuffered(kEntityMax)) - getSound()->processEntry(kEntityMax); + if (getSoundQueue()->isBuffered(kEntityMax)) + getSoundQueue()->processEntry(kEntityMax); getSound()->playSound(kEntityPlayer, "LIB026"); getAction()->playAnimation(kEventCathMaxFree); @@ -523,7 +525,7 @@ IMPLEMENT_FUNCTION(15, Max, function15) getData()->location = kLocationOutsideCompartment; getData()->car = kCarRedSleeping; - if (!getSound()->isBuffered(kEntityMax)) + if (!getSoundQueue()->isBuffered(kEntityMax)) getSound()->playSound(kEntityMax, "Max3010"); setCallback(1); diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index b99e344b20..464cc343bb 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/state.h" #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -503,7 +505,7 @@ IMPLEMENT_FUNCTION_I(12, Mertens, bonsoir, EntityIndex) if (savepoint.action == kActionDefault) return; - if (getSound()->isBuffered(kEntityMertens)) { + if (getSoundQueue()->isBuffered(kEntityMertens)) { CALLBACK_ACTION(); return; } @@ -589,7 +591,7 @@ IMPLEMENT_FUNCTION_II(13, Mertens, function13, bool, bool) if (params->param2) params->param3 = 1; - if (!getSound()->isBuffered(kEntityMertens)) { + if (!getSoundQueue()->isBuffered(kEntityMertens)) { } @@ -1188,7 +1190,7 @@ IMPLEMENT_FUNCTION(22, Mertens, function22) break; case 5: - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, "MAH1170I"); setCallback(6); @@ -1198,7 +1200,7 @@ IMPLEMENT_FUNCTION(22, Mertens, function22) case 6: getData()->location = kLocationInsideCompartment; getEntities()->clearSequences(kEntityMertens); - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, "MAH1172", kFlagInvalid, 225); setCallback(7); @@ -2300,7 +2302,7 @@ IMPLEMENT_FUNCTION_I(31, Mertens, function31, MertensActionType) break; case 1: - if (getSound()->isBuffered(kEntityMertens)) { + if (getSoundQueue()->isBuffered(kEntityMertens)) { getEntities()->drawSequenceLeft(kEntityMertens, "601J"); } else { setCallback(2); @@ -3017,7 +3019,7 @@ IMPLEMENT_FUNCTION(42, Mertens, function42) if (getState()->time <= kTime1188000) { if ((!getEntities()->isPlayerInCar(kCarGreenSleeping) && !getEntities()->isPlayerInCar(kCarRedSleeping)) - || getSound()->isBuffered("REB1205") + || getSoundQueue()->isBuffered("REB1205") || !getEntities()->isInsideCompartment(kEntityMmeBoutarel, kCarRedSleeping, kPosition_5790) || !params->param4) { params->param4 = (uint)getState()->time; @@ -3138,7 +3140,7 @@ label_callback_18: } label_callback_19: - if (ENTITY_PARAM(0, 1) && !getSound()->isBuffered(kEntityMertens)) { + if (ENTITY_PARAM(0, 1) && !getSoundQueue()->isBuffered(kEntityMertens)) { if (getProgress().field_18 != 4) getSound()->playSound(kEntityMertens, "CON1505"); } diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 68030b3be3..1526c281b2 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -36,6 +36,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -1577,8 +1579,8 @@ IMPLEMENT_FUNCTION(29, Milos, chapter4Handler) break; case kAction221683008: - if (getSound()->isBuffered(kEntityMilos)) - getSound()->processEntry(kEntityMilos); + if (getSoundQueue()->isBuffered(kEntityMilos)) + getSoundQueue()->processEntry(kEntityMilos); params->param1 = 1; getSavePoints()->push(kEntityMilos, kEntityCoudert, kAction123199584); @@ -1720,15 +1722,15 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) break; case 2: - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); - if (getSound()->isBuffered("ARRIVE")) - getSound()->removeFromQueue("ARRIVE"); + if (getSoundQueue()->isBuffered("ARRIVE")) + getSoundQueue()->removeFromQueue("ARRIVE"); - getSound()->processEntries(); + getSoundQueue()->processEntries(); getAction()->playAnimation(isNight() ? kEventLocomotiveMilosNight : kEventLocomotiveMilosDay); - getSound()->setupEntry(kSoundType7, kEntityMilos); + getSoundQueue()->setupEntry(kSoundType7, kEntityMilos); getScenes()->loadSceneFromPosition(kCarCoalTender, 1); break; @@ -1740,7 +1742,7 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) case 4: getAction()->playAnimation(kEventLocomotiveRestartTrain); getAction()->playAnimation(kEventLocomotiveOldBridge); - getSound()->resetState(); + getSoundQueue()->resetState(); getState()->time = kTime2983500; setCallback(5); @@ -1783,7 +1785,7 @@ IMPLEMENT_FUNCTION(34, Milos, chapter5Handler) setup_savegame(kSavegameTypeEvent, kEventLocomotiveAnnaStopsTrain); } - getSound()->processEntry(kEntityMilos); + getSoundQueue()->processEntry(kEntityMilos); if (getState()->time < kTimeTrainStopped2) getState()->time = kTimeTrainStopped2; diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp index 78f2d2fb4b..1d4c52ca09 100644 --- a/engines/lastexpress/entities/mmeboutarel.cpp +++ b/engines/lastexpress/entities/mmeboutarel.cpp @@ -31,6 +31,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -399,7 +401,7 @@ IMPLEMENT_FUNCTION(13, MmeBoutarel, function13) break; case kActionNone: - if (!getSound()->isBuffered(kEntityMmeBoutarel) && params->param6 != kTimeInvalid) { + if (!getSoundQueue()->isBuffered(kEntityMmeBoutarel) && params->param6 != kTimeInvalid) { UPDATE_PARAM_PROC_TIME(params->param1, !getEntities()->isDistanceBetweenEntities(kEntityMmeBoutarel, kEntityPlayer, 2000), params->param6, 0) getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorNormal); getObjects()->update(kObject51, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorNormal); @@ -883,8 +885,8 @@ IMPLEMENT_FUNCTION(21, MmeBoutarel, chapter3Handler) if (getState()->time <= kTime2038500) { if (!getEntities()->isPlayerInCar(kCarRedSleeping) || !params->param1 - || getSound()->isBuffered("FRA2012") - || getSound()->isBuffered("FRA2010") + || getSoundQueue()->isBuffered("FRA2012") + || getSoundQueue()->isBuffered("FRA2010") ||!params->param2) params->param2 = (uint)getState()->time; diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index d4a7359511..8bbcf64e84 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -201,7 +203,7 @@ IMPLEMENT_FUNCTION(10, Pascale, welcomeCath) break; case kActionNone: - if (params->param1 && !getSound()->isBuffered(kEntityPascale)) + if (params->param1 && !getSoundQueue()->isBuffered(kEntityPascale)) getEntities()->updatePositionExit(kEntityPascale, kCarRestaurant, 64); break; @@ -462,10 +464,10 @@ IMPLEMENT_FUNCTION(16, Pascale, serveTatianaVassili) getEntities()->drawSequenceLeft(kEntityPascale, "014B"); getEntities()->updatePositionEnter(kEntityPascale, kCarRestaurant, 67); - if (getSound()->isBuffered("TAT1069A")) - getSound()->processEntry("TAT1069A"); - else if (getSound()->isBuffered("TAT1069B")) - getSound()->processEntry("TAT1069B"); + if (getSoundQueue()->isBuffered("TAT1069A")) + getSoundQueue()->processEntry("TAT1069A"); + else if (getSoundQueue()->isBuffered("TAT1069B")) + getSoundQueue()->processEntry("TAT1069B"); setCallback(2); setup_playSound("TAT1066"); @@ -1213,7 +1215,7 @@ label_callback1: break; case kAction169750080: - if (getSound()->isBuffered(kEntityPascale)) { + if (getSoundQueue()->isBuffered(kEntityPascale)) { params->param4 = 1; } else { setCallback(7); diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index 68a37b368d..6d1c5244f2 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -30,6 +30,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -511,7 +513,7 @@ IMPLEMENT_FUNCTION_I(20, Rebecca, function20, TimeValue) if (getProgress().chapter == kChapter1 && !ENTITY_PARAM(0, 3)) { if (params->param7 != kTimeInvalid && getState()->time > kTime1174500) { if (getState()->time <= kTime1183500) { - if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 2000) || getSound()->isBuffered("CON1210") || !params->param7) + if (!getEntities()->isDistanceBetweenEntities(kEntityRebecca, kEntityPlayer, 2000) || getSoundQueue()->isBuffered("CON1210") || !params->param7) params->param7 = (uint)(getState()->time); if (params->param7 >= getState()->time) diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index bbaff5f1d9..6dcab7121e 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -33,6 +33,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -596,8 +598,8 @@ IMPLEMENT_FUNCTION(24, Salko, chapter5Handler) break; case 1: - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); getAction()->playAnimation(kEventCathSalkoTrainTopFight); diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index da053c5871..702b636c31 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -29,6 +29,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -88,8 +90,8 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION(5, Tables, chapter5) if (savepoint.action == kActionDefault) { - if (_id == kEntityTables2 && getSound()->isBuffered(kEntityTables2)) - getSound()->processEntry(kEntityTables2); + if (_id == kEntityTables2 && getSoundQueue()->isBuffered(kEntityTables2)) + getSoundQueue()->processEntry(kEntityTables2); setup_draw(); } @@ -113,21 +115,21 @@ IMPLEMENT_FUNCTION(6, Tables, draw) case kChapter1: if (getState()->time > kTime1165500 && !params->param1) { params->param1 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; case kChapter3: if (getState()->time > kTime2052000 && !params->param2) { params->param2 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; case kChapter4: if (getState()->time > kTime2488500 && !params->param3) { params->param3 = 1; - getSound()->processEntry(kEntityTables2); + getSoundQueue()->processEntry(kEntityTables2); } break; diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index db5c413dc9..2f60b448ba 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -35,6 +35,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -420,7 +422,7 @@ IMPLEMENT_FUNCTION(19, Tatiana, chapter1Handler) break; case kActionNone: - if (getSound()->isBuffered(kEntityTatiana) || !params->param4 || params->param3 == 2 || getSound()->isBuffered("TAT1066")) + if (getSoundQueue()->isBuffered(kEntityTatiana) || !params->param4 || params->param3 == 2 || getSoundQueue()->isBuffered("TAT1066")) goto label_tatiana_chapter1_2; UPDATE_PARAM_PROC(params->param5, getState()->timeTicks, 450) @@ -568,7 +570,7 @@ IMPLEMENT_FUNCTION(21, Tatiana, function21) // Fallback to next case case 3: - if (getSound()->isBuffered(kEntityTatiana)) { + if (getSoundQueue()->isBuffered(kEntityTatiana)) { setCallback(3); setup_updateFromTime(75); } else { @@ -1858,7 +1860,7 @@ IMPLEMENT_FUNCTION(46, Tatiana, function46) parameters->param3 = 1; if (parameters->param2) { - getSound()->removeFromQueue(kEntityTatiana); + getSoundQueue()->removeFromQueue(kEntityTatiana); getSavePoints()->call(kEntityTatiana, kEntityTatiana, kActionEndSound); } } else { @@ -1947,7 +1949,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48) params->param1 = 0; } - if (!params->param1 || getSound()->isBuffered(kEntityTatiana)) + if (!params->param1 || getSoundQueue()->isBuffered(kEntityTatiana)) goto label_end; UPDATE_PARAM_GOTO(params->param2, getState()->timeTicks, 5 * (3 * rnd(5) + 30), label_end); @@ -2086,7 +2088,7 @@ IMPLEMENT_FUNCTION(50, Tatiana, function50) break; case kActionKnock: - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSound(kEntityPlayer, "LIB012"); break; @@ -2107,14 +2109,14 @@ IMPLEMENT_FUNCTION(50, Tatiana, function50) getObjects()->update(kObject48, kEntityTatiana, kObjectLocationNone, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectCompartmentA, kEntityTatiana, kObjectLocationNone, kCursorHandKnock, kCursorHand); - if (!getSound()->isBuffered(kEntityTatiana)) + if (!getSoundQueue()->isBuffered(kEntityTatiana)) getSound()->playSound(kEntityTatiana, "Tat4166"); break; case kActionCallback: if (getCallback() == 1) { - if (getSound()->isBuffered("MUS013")) - getSound()->processEntry("MUS013"); + if (getSoundQueue()->isBuffered("MUS013")) + getSoundQueue()->processEntry("MUS013"); getAction()->playAnimation(kEventVassiliDeadAlexei); getSavePoints()->push(kEntityTatiana, kEntityAbbot, kAction104060776); @@ -2223,11 +2225,11 @@ IMPLEMENT_FUNCTION(54, Tatiana, function54) case kActionCallback: if (getCallback() == 1) { - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); - if (getSound()->isBuffered(kEntityTatiana)) - getSound()->processEntry(kEntityTatiana); + if (getSoundQueue()->isBuffered(kEntityTatiana)) + getSoundQueue()->processEntry(kEntityTatiana); getAction()->playAnimation(isNight() ? kEventTatianaVassiliTalkNight : kEventTatianaVassiliTalk); getScenes()->processScene(); diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 1a5c6f4f64..74eed63bbf 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/state.h" #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -300,13 +302,13 @@ label_process: } // Update object - if (ENTITY_PARAM(0, 8) && !getSound()->isBuffered(kEntityTables5)) { + if (ENTITY_PARAM(0, 8) && !getSoundQueue()->isBuffered(kEntityTables5)) { getObjects()->update((ObjectIndex)ENTITY_PARAM(0, 8), getObjects()->get((ObjectIndex)ENTITY_PARAM(0, 8)).entity, kObjectLocation3, kCursorHandKnock, kCursorHand); ENTITY_PARAM(0, 8) = 0; } // Play clock sound - if (params->param6 && !getSound()->isBuffered("ZFX1001", true)) + if (params->param6 && !getSoundQueue()->isBuffered("ZFX1001", true)) getSound()->playSound(kEntityPlayer, "ZFX1001"); break; @@ -339,12 +341,12 @@ label_process: // Play clock sound if (getEntities()->isPlayerPosition(kCarRestaurant, 81)) { params->param6 = 1; - if (!getSound()->isBuffered("ZFX1001")) + if (!getSoundQueue()->isBuffered("ZFX1001")) getSound()->playSound(kEntityPlayer, "ZFX1001"); } else { params->param6 = 0; - if (getSound()->isBuffered("ZFX1001", true)) - getSound()->removeFromQueue("ZFX1001"); + if (getSoundQueue()->isBuffered("ZFX1001", true)) + getSoundQueue()->removeFromQueue("ZFX1001"); } // Draw moving background behind windows @@ -562,8 +564,8 @@ void Train::resetParam8() { && !getEntities()->isInsideCompartment(kEntityPlayer, (CarIndex)params1->param1, (EntityPosition)params1->param2) && !getEntities()->isInsideCompartment(kEntityPlayer, (CarIndex)params1->param1, (EntityPosition)params1->param3)) { - if (getSound()->isBuffered((const char *)¶ms1->seq)) - getSound()->processEntry((const char *)¶ms1->seq); + if (getSoundQueue()->isBuffered((const char *)¶ms1->seq)) + getSoundQueue()->processEntry((const char *)¶ms1->seq); params->param8 = 0; } diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index a1daf3e524..a7fbc7cf32 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -35,6 +35,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -295,7 +297,7 @@ IMPLEMENT_FUNCTION(9, Vassili, function9) || getEntities()->isPlayerPosition(kCarRedSleeping, 41)) { if (savepoint.action == kActionDrawScene) - getSound()->processEntry(kEntityVassili); + getSoundQueue()->processEntry(kEntityVassili); setup_seizure(); } else { diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index c0a00b8c05..c18137c835 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -32,6 +32,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -139,7 +141,7 @@ IMPLEMENT_FUNCTION_END ////////////////////////////////////////////////////////////////////////// IMPLEMENT_FUNCTION_II(8, Verges, updateEntity, CarIndex, EntityPosition) if (savepoint.action == kActionExcuseMeCath) { - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityPlayer, "TRA1113", getSound()->getSoundFlag(kEntityVerges)); return; @@ -187,7 +189,7 @@ switch (savepoint.action) { break; case 2: - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, (char *)¶ms->seq1); getEntities()->drawSequenceRight(kEntityVerges, "813DS"); @@ -232,7 +234,7 @@ IMPLEMENT_FUNCTION_IIS(10, Verges, function10, CarIndex, EntityPosition) case kActionNone: if (!params->param7) { - if (!getSound()->isBuffered(kEntityVerges)) { + if (!getSoundQueue()->isBuffered(kEntityVerges)) { getSound()->playSound(kEntityVerges, (char *)¶ms->seq); params->param7 = 1; } @@ -258,7 +260,7 @@ IMPLEMENT_FUNCTION_IIS(10, Verges, function10, CarIndex, EntityPosition) break; case kActionDefault: - if (!getSound()->isBuffered(kEntityVerges)) { + if (!getSoundQueue()->isBuffered(kEntityVerges)) { getSound()->playSound(kEntityVerges, (char *)¶ms->seq); params->param7 = 1; } @@ -704,7 +706,7 @@ IMPLEMENT_FUNCTION(24, Verges, policeGettingOffTrain) case kActionCallback: if (getCallback() == 1) { - getSound()->processEntry(kEntityVerges); + getSoundQueue()->processEntry(kEntityVerges); getAction()->playAnimation(kEventGendarmesArrestation); getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverPolice1, true); } @@ -1314,7 +1316,7 @@ IMPLEMENT_FUNCTION(32, Verges, function32) break; case 2: - if (!getSound()->isBuffered(kEntityVerges)) + if (!getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, "TRA3004"); getEntities()->drawSequenceRight(kEntityVerges, "813DS"); @@ -1752,16 +1754,16 @@ IMPLEMENT_FUNCTION(40, Verges, chapter5Handler) break; case kActionNone: - if (getEntities()->isInSalon(kEntityPlayer) && !getSound()->isBuffered(kEntityVerges)) + if (getEntities()->isInSalon(kEntityPlayer) && !getSoundQueue()->isBuffered(kEntityVerges)) getSound()->playSound(kEntityVerges, "WAT5000"); break; case kActionOpenDoor: - if (getSound()->isBuffered(kEntityVerges)) - getSound()->processEntry(kEntityVerges); + if (getSoundQueue()->isBuffered(kEntityVerges)) + getSoundQueue()->processEntry(kEntityVerges); - if (getSound()->isBuffered("MUS050")) - getSound()->processEntry("MUS050"); + if (getSoundQueue()->isBuffered("MUS050")) + getSoundQueue()->processEntry("MUS050"); getObjects()->update(kObject65, kEntityPlayer, kObjectLocationNone, kCursorNormal, kCursorForward); @@ -1811,7 +1813,7 @@ IMPLEMENT_FUNCTION(41, Verges, function41) // Fallback to next case case 2: - if (getSound()->isBuffered(kEntityVerges)) { + if (getSoundQueue()->isBuffered(kEntityVerges)) { setCallback(2); setup_updateFromTime(225); } else { diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp index 685b3b09d1..38a93cfd94 100644 --- a/engines/lastexpress/fight/fight.cpp +++ b/engines/lastexpress/fight/fight.cpp @@ -37,6 +37,8 @@ #include "lastexpress/game/scenes.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -86,7 +88,7 @@ void Fight::eventMouse(const Common::Event &ev) { // Handle right button click if (ev.type == Common::EVENT_RBUTTONUP) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); setStopped(); getGlobalTimer() ? _state = 0 : ++_state; @@ -133,15 +135,15 @@ void Fight::eventMouse(const Common::Event &ev) { // Stop fight if clicked if (ev.type == Common::EVENT_LBUTTONUP) { _handleTimer = false; - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); bailout(kFightEndExit); } // Reset timer on right click if (ev.type == Common::EVENT_RBUTTONUP) { if (getGlobalTimer()) { - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); + if (getSoundQueue()->isBuffered("TIMER")) + getSoundQueue()->removeFromQueue("TIMER"); setGlobalTimer(900); } @@ -277,7 +279,7 @@ Fight::FightEndType Fight::setup(FightType type) { if (_engine->handleEvents()) continue; - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); } // Cleanup after fight is over diff --git a/engines/lastexpress/fight/fighter_anna.cpp b/engines/lastexpress/fight/fighter_anna.cpp index 3c0132eef6..feb35515a0 100644 --- a/engines/lastexpress/fight/fighter_anna.cpp +++ b/engines/lastexpress/fight/fighter_anna.cpp @@ -26,6 +26,8 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -107,7 +109,7 @@ void FighterPlayerAnna::handleAction(FightAction action) { } if (_field_34 > 4) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); _fight->bailout(Fight::kFightEndWin); } } @@ -175,7 +177,7 @@ void FighterOpponentAnna::update() { _opponent->handleAction((FightAction)_sequenceIndex); if (_opponent->getCountdown() <= 0) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); handleAction(kFightActionLost); } } diff --git a/engines/lastexpress/fight/fighter_ivo.cpp b/engines/lastexpress/fight/fighter_ivo.cpp index 60d6c1a874..9988fca790 100644 --- a/engines/lastexpress/fight/fighter_ivo.cpp +++ b/engines/lastexpress/fight/fighter_ivo.cpp @@ -26,6 +26,8 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -110,7 +112,7 @@ void FighterPlayerIvo::update() { if (_opponent->getCountdown() <= 0) { setSequenceAndDraw(9, kFightSequenceType1); _opponent->setSequenceAndDraw(8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); handleAction(kFightActionWin); return; @@ -227,7 +229,7 @@ void FighterOpponentIvo::update() { if (_opponent->getCountdown() <= 0) { setSequenceAndDraw(7, kFightSequenceType1); _opponent->setSequenceAndDraw(8, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); _opponent->handleAction(kFightActionWin); diff --git a/engines/lastexpress/fight/fighter_milos.cpp b/engines/lastexpress/fight/fighter_milos.cpp index 972c44882b..82c965caf3 100644 --- a/engines/lastexpress/fight/fighter_milos.cpp +++ b/engines/lastexpress/fight/fighter_milos.cpp @@ -27,6 +27,8 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -107,7 +109,7 @@ void FighterPlayerMilos::update() { setSequenceAndDraw(5, kFightSequenceType1); _opponent->setSequenceAndDraw(6, kFightSequenceType1); - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); getSound()->playSound(kEntityTrain, "MUS029", kFlagDefault); handleAction(kFightActionWin); @@ -210,7 +212,7 @@ void FighterOpponentMilos::update() { _opponent->handleAction((FightAction)_sequenceIndex); if (_opponent->getCountdown() <= 0) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); handleAction(kFightActionLost); } } diff --git a/engines/lastexpress/fight/fighter_salko.cpp b/engines/lastexpress/fight/fighter_salko.cpp index 6f71a6dda8..166f7c3899 100644 --- a/engines/lastexpress/fight/fighter_salko.cpp +++ b/engines/lastexpress/fight/fighter_salko.cpp @@ -27,6 +27,8 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -95,7 +97,7 @@ void FighterPlayerSalko::update() { if (_frame && checkFrame(2)) { if (_opponent->getCountdown() <= 0) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); _fight->bailout(Fight::kFightEndWin); return; @@ -184,7 +186,7 @@ void FighterOpponentSalko::update() { if (_frame && checkFrame(2)) { if (_opponent->getCountdown() <= 0) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); _fight->bailout(Fight::kFightEndLost); // Stop processing diff --git a/engines/lastexpress/fight/fighter_vesna.cpp b/engines/lastexpress/fight/fighter_vesna.cpp index c92d041c7e..075f158bda 100644 --- a/engines/lastexpress/fight/fighter_vesna.cpp +++ b/engines/lastexpress/fight/fighter_vesna.cpp @@ -27,6 +27,8 @@ #include "lastexpress/game/sound.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -103,7 +105,7 @@ void FighterPlayerVesna::update() { _opponent->handleAction(kFightAction3); if (_opponent->getCountdown() <= 0) { - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); _fight->bailout(Fight::kFightEndWin); return; } @@ -251,7 +253,7 @@ void FighterOpponentVesna::update() { _opponent->update(); Fighter::update(); - getSound()->removeFromQueue(kEntityTables0); + getSoundQueue()->removeFromQueue(kEntityTables0); // Stop processing return; diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 54bb8759ee..f195825d6e 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -42,6 +42,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" @@ -453,7 +455,7 @@ IMPLEMENT_ACTION(savePoint) IMPLEMENT_ACTION(playSound) // Check that the file is not already buffered - if (hotspot.param2 || !getSound()->isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) + if (hotspot.param2 || !getSoundQueue()->isBuffered(Common::String::format("LIB%03d", hotspot.param1), true)) getSound()->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2); return kSceneInvalid; @@ -465,7 +467,7 @@ IMPLEMENT_ACTION(playMusic) // Check that the file is not already buffered Common::String filename = Common::String::format("MUS%03d", hotspot.param1); - if (!getSound()->isBuffered(filename) && (hotspot.param1 != 50 || getProgress().chapter == kChapter5)) + if (!getSoundQueue()->isBuffered(filename) && (hotspot.param1 != 50 || getProgress().chapter == kChapter5)) getSound()->playSound(kEntityPlayer, filename, kFlagDefault, hotspot.param2); return kSceneInvalid; @@ -481,7 +483,7 @@ IMPLEMENT_ACTION(knock) if (getObjects()->get(object).entity) { getSavePoints()->push(kEntityPlayer, getObjects()->get(object).entity, kActionKnock, object); } else { - if (!getSound()->isBuffered("LIB012", true)) + if (!getSoundQueue()->isBuffered("LIB012", true)) getSound()->playSoundEvent(kEntityPlayer, 12); } @@ -516,7 +518,7 @@ IMPLEMENT_ACTION(compartment) && (compartment != kObjectCompartment1 || !getInventory()->hasItem(kItemKey) || (getInventory()->getSelectedItem() != kItemFirebird && getInventory()->getSelectedItem() != kItemBriefcase)))) { - if (!getSound()->isBuffered("LIB13")) + if (!getSoundQueue()->isBuffered("LIB13")) getSound()->playSoundEvent(kEntityPlayer, 13); // Stop processing further @@ -621,7 +623,7 @@ IMPLEMENT_ACTION(updateObjetLocation2) getObjects()->updateLocation2(object, location); - if (object != kObject112 || getSound()->isBuffered("LIB096")) { + if (object != kObject112 || getSoundQueue()->isBuffered("LIB096")) { if (object == 1) getSound()->playSoundEvent(kEntityPlayer, 73); } else { @@ -805,7 +807,7 @@ IMPLEMENT_ACTION(enterCompartment) getSound()->playSoundEvent(kEntityPlayer, 14); getSound()->playSoundEvent(kEntityPlayer, 15, 22); - if (getProgress().field_78 && !getSound()->isBuffered("MUS003")) { + if (getProgress().field_78 && !getSoundQueue()->isBuffered("MUS003")) { getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_78 = 0; } @@ -1083,7 +1085,7 @@ IMPLEMENT_ACTION(25) break; case 2: - if (!getSound()->isBuffered("MUS021")) + if (!getSoundQueue()->isBuffered("MUS021")) getSound()->playSound(kEntityPlayer, "MUS021", kFlagDefault); break; @@ -1134,7 +1136,7 @@ IMPLEMENT_ACTION(26) ////////////////////////////////////////////////////////////////////////// // Action 27 IMPLEMENT_ACTION(27) - if (!getSound()->isBuffered("LIB031", true)) + if (!getSoundQueue()->isBuffered("LIB031", true)) getSound()->playSoundEvent(kEntityPlayer, 31); switch (getEntityData(kEntityPlayer)->car) { @@ -1182,7 +1184,7 @@ IMPLEMENT_ACTION(29) getSound()->playSoundEvent(kEntityPlayer, hotspot.param1, hotspot.param2); Common::String filename = Common::String::format("MUS%03d", hotspot.param3); - if (!getSound()->isBuffered(filename)) + if (!getSoundQueue()->isBuffered(filename)) getSound()->playSound(kEntityPlayer, filename, kFlagDefault); return kSceneInvalid; @@ -1354,7 +1356,7 @@ IMPLEMENT_ACTION(dialog) // Action 38 IMPLEMENT_ACTION(eggBox) getSound()->playSoundEvent(kEntityPlayer, 43); - if (getProgress().field_7C && !getSound()->isBuffered("MUS003")) { + if (getProgress().field_7C && !getSoundQueue()->isBuffered("MUS003")) { getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_7C = 0; } @@ -1366,7 +1368,7 @@ IMPLEMENT_ACTION(eggBox) // Action 39 IMPLEMENT_ACTION(39) getSound()->playSoundEvent(kEntityPlayer, 24); - if (getProgress().field_80 && !getSound()->isBuffered("MUS003")) { + if (getProgress().field_80 && !getSoundQueue()->isBuffered("MUS003")) { getSound()->playSound(kEntityPlayer, "MUS003", kFlagDefault); getProgress().field_80 = 0; } @@ -1408,7 +1410,7 @@ IMPLEMENT_ACTION(playMusicChapter) if (id) { Common::String filename = Common::String::format("MUS%03d", id); - if (!getSound()->isBuffered(filename)) + if (!getSoundQueue()->isBuffered(filename)) getSound()->playSound(kEntityPlayer, filename, kFlagDefault); } @@ -1440,7 +1442,7 @@ IMPLEMENT_ACTION(playMusicChapterSetupTrain) Common::String filename = Common::String::format("MUS%03d", hotspot.param1); - if (!getSound()->isBuffered(filename) && hotspot.param3 & id) { + if (!getSoundQueue()->isBuffered(filename) && hotspot.param3 & id) { getSound()->playSound(kEntityPlayer, filename, kFlagDefault); getSavePoints()->call(kEntityPlayer, kEntityTrain, kAction203863200, filename.c_str()); @@ -1612,7 +1614,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playWarningCompartment(kEntityMertens, object); getSavePoints()->push(kEntityPlayer, kEntityMertens, kAction305159806); @@ -1628,7 +1630,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, (rnd(2)) ? "JAC1000" : "JAC1000A"); if (doLoadScene) @@ -1640,7 +1642,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityMertens)) + if (!getSoundQueue()->isBuffered(kEntityMertens)) getSound()->playSound(kEntityMertens, (rnd(2)) ? "JAC1000" : "JAC1000A"); if (doLoadScene) @@ -1667,7 +1669,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playWarningCompartment(kEntityCoudert, object); getSavePoints()->push(kEntityPlayer, kEntityCoudert, kAction305159806); @@ -1684,7 +1686,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, (rnd(2)) ? "JAC1000" : "JAC1000A"); if (doLoadScene) @@ -1699,7 +1701,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d if (doPlaySound) playCompartmentSoundEvents(object); - if (!getSound()->isBuffered(kEntityCoudert)) + if (!getSoundQueue()->isBuffered(kEntityCoudert)) getSound()->playSound(kEntityCoudert, (rnd(2)) ? "JAC1000" : "JAC1000A"); if (doLoadScene) @@ -1930,8 +1932,8 @@ void Action::playAnimation(EventIndex index, bool debugMode) const { if (!getFlags()->mouseRightClick) { if (getGlobalTimer()) { - if (getSound()->isBuffered("TIMER")) { - getSound()->processEntry("TIMER"); + if (getSoundQueue()->isBuffered("TIMER")) { + getSoundQueue()->processEntry("TIMER"); setGlobalTimer(105); } } @@ -1948,8 +1950,8 @@ void Action::playAnimation(EventIndex index, bool debugMode) const { if (animation.load(getArchive(Common::String(_animationList[index].filename) + ".nis") , processSound ? Animation::kFlagDefault : Animation::kFlagProcess)) animation.play(); - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); + if (getSoundQueue()->isBuffered("TIMER")) + getSoundQueue()->removeFromQueue("TIMER"); } // Show cursor diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 0fa3af36b7..8dd2c26c19 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -71,6 +71,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -299,7 +301,7 @@ void Entities::setupChapter(ChapterIndex chapter) { memset(&_compartments1, 0, sizeof(_compartments1)); memset(&_positions, 0, sizeof(_positions)); - getSound()->resetQueue(kSoundType13); + getSoundQueue()->resetQueue(kSoundType13); } // we skip the header when doing entity setup @@ -369,8 +371,8 @@ void Entities::resetState(EntityIndex entityIndex) { getData(entityIndex)->currentCall = 0; getData(entityIndex)->inventoryItem = kItemNone; - if (getSound()->isBuffered(entityIndex)) - getSound()->removeFromQueue(entityIndex); + if (getSoundQueue()->isBuffered(entityIndex)) + getSoundQueue()->removeFromQueue(entityIndex); clearSequences(entityIndex); diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index 4d75fcaca5..c3a10225e9 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -33,6 +33,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -162,8 +164,8 @@ void Inventory::handleMouseEvent(const Common::Event &ev) { } else if (ev.type == Common::EVENT_RBUTTONDOWN) { if (getGlobalTimer()) { - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); + if (getSoundQueue()->isBuffered("TIMER")) + getSoundQueue()->removeFromQueue("TIMER"); setGlobalTimer(900); } @@ -630,7 +632,7 @@ void Inventory::drawBlinkingEgg() { // if (getGlobalTimer() + ticks >= 90) // getSound()->playSoundWithSubtitles("TIMER.SND", 50331664, kEntityPlayer); - // if (getSound()->isBuffered("TIMER")) + // if (getSoundQueue()->isBuffered("TIMER")) // setGlobalTimer(0); //} diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index c1237eefe9..cdde2a0e0a 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -47,6 +47,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -152,7 +154,7 @@ void Logic::eventMouse(const Common::Event &ev) { _engine->getCursor()->setStyle(getInventory()->get(kItemWhistle)->cursor); // Check if clicked - if (ev.type == Common::EVENT_LBUTTONUP && !getSound()->isBuffered("LIB045")) { + if (ev.type == Common::EVENT_LBUTTONUP && !getSoundQueue()->isBuffered("LIB045")) { getSound()->playSoundEvent(kEntityPlayer, 45); @@ -424,7 +426,7 @@ void Logic::resetState() { */ void Logic::gameOver(SavegameType type, uint32 value, SceneIndex sceneIndex, bool showScene) const { - getSound()->processEntries(); + getSoundQueue()->processEntries(); getEntities()->reset(); getFlags()->isGameRunning = false; getSavePoints()->reset(); @@ -432,16 +434,16 @@ void Logic::gameOver(SavegameType type, uint32 value, SceneIndex sceneIndex, boo if (showScene) { - getSound()->processEntry(kSoundType11); + getSoundQueue()->processEntry(kSoundType11); if (sceneIndex && !getFlags()->mouseRightClick) { getScenes()->loadScene(sceneIndex); - while (getSound()->isBuffered(kEntityTables4)) { + while (getSoundQueue()->isBuffered(kEntityTables4)) { if (getFlags()->mouseRightClick) break; - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); } } } @@ -451,7 +453,7 @@ void Logic::gameOver(SavegameType type, uint32 value, SceneIndex sceneIndex, boo } void Logic::switchChapter() const { - getSound()->clearStatus(); + getSoundQueue()->clearStatus(); switch(getState()->progress.chapter) { default: @@ -491,7 +493,7 @@ void Logic::switchChapter() const { } void Logic::playFinalSequence() const { - getSound()->processEntries(); + getSoundQueue()->processEntries(); _action->playAnimation(kEventFinalSequence); showCredits(); diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp index 594cd1276b..8dfc214913 100644 --- a/engines/lastexpress/game/savegame.cpp +++ b/engines/lastexpress/game/savegame.cpp @@ -30,6 +30,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/debug.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" @@ -125,7 +127,7 @@ uint32 SaveLoad::init(GameId id, bool resetHeaders) { while (_savegame->pos() < _savegame->size() && !_savegame->eos() && !_savegame->err()) { // Update sound queue while we go through the savegame - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); SavegameEntryHeader *entry = new SavegameEntryHeader(); entry->saveLoadWithSerializer(ser); @@ -217,7 +219,7 @@ void SaveLoad::loadGame(GameId id) { _gameTicksLastSavegame = getState()->timeTicks; if (header.keepIndex) { - getSound()->clearQueue(); + getSoundQueue()->clearQueue(); readEntry(&type, &entity, &val, false); } @@ -377,7 +379,7 @@ void SaveLoad::writeEntry(SavegameType type, EntityIndex entity, uint32 value) { WRITE_ENTRY("inventory", getInventory()->saveLoadWithSerializer(ser), 7 * 32); WRITE_ENTRY("objects", getObjects()->saveLoadWithSerializer(ser), 5 * 128); WRITE_ENTRY("entities", getEntities()->saveLoadWithSerializer(ser), 1262 * 40); - WRITE_ENTRY("sound", getSound()->saveLoadWithSerializer(ser), 3 * 4 + getSound()->count() * 64); + WRITE_ENTRY("sound", getSoundQueue()->saveLoadWithSerializer(ser), 3 * 4 + getSoundQueue()->count() * 64); WRITE_ENTRY("savepoints", getSavePoints()->saveLoadWithSerializer(ser), 128 * 16 + 4 + getSavePoints()->count() * 16); header.offset = (uint32)_savegame->pos() - (originalPosition + 32); @@ -452,7 +454,7 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b LOAD_ENTRY("inventory", getInventory()->saveLoadWithSerializer(ser), 7 * 32); LOAD_ENTRY("objects", getObjects()->saveLoadWithSerializer(ser), 5 * 128); LOAD_ENTRY("entities", getEntities()->saveLoadWithSerializer(ser), 1262 * 40); - LOAD_ENTRY_ONLY("sound", getSound()->saveLoadWithSerializer(ser)); + LOAD_ENTRY_ONLY("sound", getSoundQueue()->saveLoadWithSerializer(ser)); LOAD_ENTRY_ONLY("savepoints", getSavePoints()->saveLoadWithSerializer(ser)); // Update chapter diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index b346c9daf8..408f48044c 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -34,6 +34,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -1057,9 +1059,9 @@ void SceneManager::preProcessScene(SceneIndex *index) { // Sound processing Scene *newScene = getScenes()->get(*index); - if (getSound()->isBuffered(kEntityTables4)) { + if (getSoundQueue()->isBuffered(kEntityTables4)) { if (newScene->type != Scene::kTypeReadText || newScene->param1) - getSound()->processEntry(kEntityTables4); + getSoundQueue()->processEntry(kEntityTables4); } // Cleanup beetle sequences @@ -1089,8 +1091,8 @@ void SceneManager::postProcessScene() { if (getFlags()->mouseRightClick) break; - getSound()->updateQueue(); - getSound()->updateSubtitles(); + getSoundQueue()->updateQueue(); + getSoundQueue()->updateSubtitles(); } } @@ -1157,7 +1159,7 @@ void SceneManager::postProcessScene() { if (getState()->time >= kTimeCityGalanta || getProgress().field_18 == 4) break; - getSound()->processEntry(kSoundType7); + getSoundQueue()->processEntry(kSoundType7); getSound()->playSound(kEntityTrain, "LIB050", kFlagDefault); switch (getProgress().chapter) { diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 3fb3f8894d..bc4f71e18d 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -31,6 +31,7 @@ #include "lastexpress/game/state.h" #include "lastexpress/sound/entry.h" +#include "lastexpress/sound/queue.h" #include "lastexpress/helpers.h" #include "lastexpress/graphics.h" @@ -39,9 +40,6 @@ namespace LastExpress { -#define SOUNDCACHE_ENTRY_SIZE 92160 -#define SOUNDCACHE_MAX_SIZE 6 - // Letters & messages static const char *const messages[24] = { "", @@ -115,349 +113,32 @@ static const SoundFlag soundFlags[32] = { kFlag3, kFlag3, kFlag3, kFlag3, kFlag3 }; -SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state(0), _currentType(kSoundType16), _flag(0) { +SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine) { + _loopingSoundDuration = 0; + + _queue = new SoundQueue(engine); + + memset(&_lastWarning, 0, sizeof(_lastWarning)); + // Initialize unknown data _data0 = 0; _data1 = 0; _data2 = 0; - - memset(&_buffer, 0, sizeof(_buffer)); - memset(&_lastWarning, 0, sizeof(_lastWarning)); - - // Sound cache - _soundCacheData = malloc(6 * SOUNDCACHE_ENTRY_SIZE); - - _subtitlesFlag = 0; - _currentSubtitle = NULL; - - _loopingSoundDuration = 0; } SoundManager::~SoundManager() { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - SAFE_DELETE(*i); - _soundList.clear(); - - // Entries in the cache are just pointers to sound list entries - _soundCache.clear(); - - for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) - SAFE_DELETE(*i); - _subtitles.clear(); - - _currentSubtitle = NULL; - - free(_soundCacheData); + SAFE_DELETE(_queue); // Zero passed pointers _engine = NULL; } ////////////////////////////////////////////////////////////////////////// -// Timer -////////////////////////////////////////////////////////////////////////// -void SoundManager::handleTimer() { - Common::StackLock locker(_mutex); - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - SoundEntry *entry = (*i); - if (entry->_stream == NULL) { - SAFE_DELETE(*i); - i = _soundList.reverse_erase(i); - continue; - } else if (!entry->_soundStream) { - entry->_soundStream = new StreamedSound(); - - // TODO: stream any sound in the queue after filtering - entry->_soundStream->load(entry->_stream); - } - } -} - -////////////////////////////////////////////////////////////////////////// -// Sound queue management -////////////////////////////////////////////////////////////////////////// -void SoundManager::updateQueue() { - // TODO add mutex lock! - warning("Sound::updateQueue: not implemented!"); -} - -void SoundManager::resetQueue(SoundType type1, SoundType type2) { - if (!type2) - type2 = type1; - - Common::StackLock locker(_mutex); - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->getType() != type1 && (*i)->getType() != type2) - (*i)->reset(); - } -} - -void SoundManager::removeFromQueue(EntityIndex entity) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(entity); - if (entry) - entry->reset(); -} - -void SoundManager::removeFromQueue(Common::String filename) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(filename); - if (entry) - entry->reset(); -} - -void SoundManager::clearQueue() { - _flag |= 4; - - // FIXME: Wait a while for a flag to be set - //for (int i = 0; i < 3000000; i++) - // if (_flag & 8) - // break; - - _flag |= 8; - - Common::StackLock locker(_mutex); - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - SoundEntry *entry = (*i); - - // Delete entry - entry->close(); - SAFE_DELETE(entry); - - i = _soundList.reverse_erase(i); - } - - updateSubtitles(); -} - -bool SoundManager::isBuffered(EntityIndex entity) { - Common::StackLock locker(_mutex); - - return (getEntry(entity) != NULL); -} - -bool SoundManager::isBuffered(Common::String filename, bool testForEntity) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(filename); - - if (testForEntity) - return entry != NULL && entry->getEntity() != kEntityPlayer; - - return (entry != NULL); -} - -////////////////////////////////////////////////////////////////////////// -// Entry -////////////////////////////////////////////////////////////////////////// -bool SoundManager::setupCache(SoundEntry *entry) { - if (entry->_soundData) - return true; - - if (_soundCache.size() >= SOUNDCACHE_MAX_SIZE) { - - SoundEntry *cacheEntry = NULL; - uint32 size = 1000; - - for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { - if (!((*i)->_status.status & kSoundStatus_180)) { - uint32 newSize = (*i)->_priority + ((*i)->_status.status & kSoundStatusClear1); - - if (newSize < size) { - cacheEntry = (*i); - size = newSize; - } - } - } - - if (entry->_priority <= size) - return false; - - if (!cacheEntry) - error("[SoundManager::setupCache] Cannot find a valid entry"); - - cacheEntry->setInCache(); - - // TODO: Wait until the cache entry is ready to be removed - while (!(cacheEntry->_status.status1 & 1)) - ; - - if (cacheEntry->_soundData) - removeFromCache(cacheEntry); - - _soundCache.push_back(entry); - entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); - } else { - _soundCache.push_back(entry); - entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); - } - - return true; -} - -void SoundManager::removeFromCache(SoundEntry *entry) { - for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { - if ((*i) == entry) { - // Remove sound buffer - entry->_soundData = NULL; - - // Remove entry from sound cache - i = _soundCache.reverse_erase(i); - } - } -} - -void SoundManager::clearStatus() { - Common::StackLock locker(_mutex); - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->_status.status |= kSoundStatusClear3; -} - -void SoundManager::processEntry(EntityIndex entity) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(entity); - if (entry) { - entry->update(0); - entry->setEntity(kEntityPlayer); - } -} - -void SoundManager::processEntry(SoundType type) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(type); - if (entry) - entry->update(0); -} - -void SoundManager::setupEntry(SoundType type, EntityIndex index) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(type); - if (entry) - entry->setEntity(index); -} - -void SoundManager::processEntry(Common::String filename) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(filename); - if (entry) { - entry->update(0); - entry->setEntity(kEntityPlayer); - } -} - -void SoundManager::processEntries() { - _state = 0; - - processEntry(kSoundType1); - processEntry(kSoundType2); -} - -uint32 SoundManager::getEntryTime(EntityIndex index) { - Common::StackLock locker(_mutex); - - SoundEntry *entry = getEntry(index); - if (entry) - return entry->_time; - - return 0; -} - -////////////////////////////////////////////////////////////////////////// -// Misc -////////////////////////////////////////////////////////////////////////// - -void SoundManager::unknownFunction4() { - // TODO: Add mutex ? - warning("Sound::unknownFunction4: not implemented!"); -} - -////////////////////////////////////////////////////////////////////////// -// Entry search -////////////////////////////////////////////////////////////////////////// -SoundEntry *SoundManager::getEntry(EntityIndex index) { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->getEntity() == index) - return *i; - } - - return NULL; -} - -SoundEntry *SoundManager::getEntry(Common::String name) { - if (!name.contains('.')) - name += ".SND"; - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->_name2 == name) - return *i; - } - - return NULL; -} - -SoundEntry *SoundManager::getEntry(SoundType type) { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->getType() == type) - return *i; - } - - return NULL; -} - -////////////////////////////////////////////////////////////////////////// -// Savegame -////////////////////////////////////////////////////////////////////////// -void SoundManager::saveLoadWithSerializer(Common::Serializer &s) { - Common::StackLock locker(_mutex); - - s.syncAsUint32LE(_state); - s.syncAsUint32LE(_currentType); - - // Compute the number of entries to save - uint32 numEntries = count(); - s.syncAsUint32LE(numEntries); - - // Save or load each entry data - if (s.isSaving()) { - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->saveLoadWithSerializer(s); - } else { - warning("Sound::saveLoadWithSerializer: loading not implemented"); - s.skip(numEntries * 64); - } -} - - -// FIXME: We probably need another mutex here to protect during the whole savegame process -// as we could have removed an entry between the time we check the count and the time we -// save the entries -uint32 SoundManager::count() { - Common::StackLock locker(_mutex); - - uint32 numEntries = 0; - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - if ((*i)->_name2.matchString("NISSND?")) - ++numEntries; - - return numEntries; -} - -////////////////////////////////////////////////////////////////////////// -// Game-related functions +// Sound-related functions ////////////////////////////////////////////////////////////////////////// void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundFlag flag, byte a4) { - if (isBuffered(entity) && entity) - removeFromQueue(entity); + if (_queue->isBuffered(entity) && entity) + _queue->removeFromQueue(entity); SoundFlag currentFlag = (flag == -1) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000); @@ -473,8 +154,6 @@ void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundF bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4) { SoundEntry *entry = new SoundEntry(_engine); - Common::StackLock locker(_mutex); - entry->open(filename, flag, 30); entry->_entity = entity; @@ -623,13 +302,13 @@ void SoundManager::playSteam(CityIndex index) { if (index >= ARRAYSIZE(cities)) error("SoundManager::playSteam: invalid city index (was %d, max %d)", index, ARRAYSIZE(cities)); - _state |= kSoundState2; + _queue->resetState(kSoundState2); - if (!getEntry(kSoundType1)) + if (!_queue->getEntry(kSoundType1)) playSoundWithSubtitles("STEAM.SND", kFlagSteam, kEntitySteam); // Get the new sound entry and show subtitles - SoundEntry *entry = getEntry(kSoundType1); + SoundEntry *entry = _queue->getEntry(kSoundType1); if (entry) entry->showSubtitle(cities[index]); } @@ -679,8 +358,8 @@ void SoundManager::playFightSound(byte action, byte a4) { } void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4) { - if (isBuffered(getDialogName(entityDialog))) - removeFromQueue(getDialogName(entityDialog)); + if (_queue->isBuffered(getDialogName(entityDialog))) + _queue->removeFromQueue(getDialogName(entityDialog)); playSound(entity, getDialogName(entityDialog), flag, a4); } @@ -993,7 +672,7 @@ const char *SoundManager::getDialogName(EntityIndex entity) const { // Letters & Messages ////////////////////////////////////////////////////////////////////////// void SoundManager::readText(int id){ - if (!isBuffered(kEntityTables4)) + if (!_queue->isBuffered(kEntityTables4)) return; if (id < 0 || (id > 8 && id < 50) || id > 64) @@ -1004,8 +683,8 @@ void SoundManager::readText(int id){ // Check if file is in cache for id [1;8] if (id <= 8) - if (isBuffered(text)) - removeFromQueue(text); + if (_queue->isBuffered(text)) + _queue->removeFromQueue(text); playSound(kEntityTables4, text, kFlagDefault); } @@ -1193,7 +872,7 @@ void SoundManager::playWarningCompartment(EntityIndex entity, ObjectIndex compar } void SoundManager::excuseMe(EntityIndex entity, EntityIndex entity2, SoundFlag flag) { - if (isBuffered(entity) && entity != kEntityPlayer && entity != kEntityChapters && entity != kEntityTrain) + if (_queue->isBuffered(entity) && entity != kEntityPlayer && entity != kEntityChapters && entity != kEntityTrain) return; if (entity2 == kEntityFrancois || entity2 == kEntityMax) @@ -1597,73 +1276,18 @@ SoundFlag SoundManager::getSoundFlag(EntityIndex entity) const { return ret; } -////////////////////////////////////////////////////////////////////////// -// Subtitles -////////////////////////////////////////////////////////////////////////// -void SoundManager::updateSubtitles() { - Common::StackLock locker(_mutex); - - uint32 index = 0; - SubtitleEntry *subtitle = NULL; - - for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { - uint32 current_index = 0; - SoundEntry *soundEntry = (*i)->getSoundEntry(); - SoundStatus status = (SoundStatus)soundEntry->_status.status; - - if (!(status & kSoundStatus_40) - || status & kSoundStatus_180 - || soundEntry->_time == 0 - || (status & kSoundStatusClear1) < 6 - || ((getFlags()->nis & 0x8000) && soundEntry->_priority < 90)) { - current_index = 0; - } else { - current_index = soundEntry->_priority + (status & kSoundStatusClear1); - - if (_currentSubtitle == (*i)) - current_index += 4; - } - - if (index < current_index) { - index = current_index; - subtitle = (*i); - } - } - - if (_currentSubtitle == subtitle) { - if (subtitle) - subtitle->setupAndDraw(); - - return; - } - - if (_subtitlesFlag & 1) - subtitle->drawOnScreen(); - - if (subtitle) { - subtitle->loadData(); - subtitle->setupAndDraw(); - } -} - ////////////////////////////////////////////////////////////////////////// // Misc ////////////////////////////////////////////////////////////////////////// void SoundManager::playLoopingSound(int param) { - Common::List::iterator snd; - char tmp[80]; + SoundEntry *entry = _queue->getEntry(kSoundType1); - for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { - if ((*snd)->getType() == kSoundType1) - break; - } - - byte numLoops[8]; static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, kPosition_6470, kPosition_5790, kPosition_4840, kPosition_4070, kPosition_3050, kPosition_2740 }; + byte numLoops[8]; numLoops[1] = 4; numLoops[2] = 2; numLoops[3] = 2; @@ -1671,13 +1295,14 @@ void SoundManager::playLoopingSound(int param) { numLoops[5] = 2; numLoops[6] = 2; + char tmp[80]; tmp[0] = 0; int partNumber = 1; int fnameLen = 6; - if (_state & 1 && param >= 0x45 && param <= 0x46) { - if (_state & 2) { + if (_queue->getSoundState() & 1 && param >= 0x45 && param <= 0x46) { + if (_queue->getSoundState() & 2) { strcpy(tmp, "STEAM.SND"); _loopingSoundDuration = 32767; @@ -1727,390 +1352,28 @@ void SoundManager::playLoopingSound(int param) { } } - if (partNumber != 99) { + if (partNumber != 99) sprintf(tmp, "LOOP%d%c.SND", partNumber, _engine->getRandom().getRandomNumber(numLoops[partNumber] - 1) + 'A'); - } } if (getFlags()->flag_3) fnameLen = 5; - if (!*snd || scumm_strnicmp((*snd)->_name2.c_str(), tmp, fnameLen)) { + if (!entry || scumm_strnicmp(entry->_name2.c_str(), tmp, fnameLen)) { _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; if (partNumber != 99) { playSoundWithSubtitles(tmp, kFlagLoopedSound, kEntitySteam); - if (*snd) - (*snd)->update(0); + if (entry) + entry->update(0); - for (snd = _soundList.begin(); snd != _soundList.end(); ++snd) { - if ((*snd)->getType() == kSoundType1) { - (*snd)->update(7); - break; - } - } + SoundEntry *entry1 = _queue->getEntry(kSoundType1); + if (entry1) + entry1->update(7); } } } } -void SoundManager::stopAllSound() { - Common::StackLock locker(_mutex); - - for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->_soundStream->stop(); -} - -////////////////////////////////////////////////////////////////////////// -// Sound filter -////////////////////////////////////////////////////////////////////////// - -static const int filterData[1424] = { - 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256, - 384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0, - 192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640, - 64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128, - 320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576, - 704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192, - 192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448, - 576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832, - 320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320, - 320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704, - 832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448, - 448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448, - 640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960, - 1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576, - 576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576, - 576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832, - 960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088, - 1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704, - 704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768, - 768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960, - 1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280, - 1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896, - 896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896, - 896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152, - 1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408, - 1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, - 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088, - 1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088, - 1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152, - 1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152, - 1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408, - 1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536, - 1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728, - 1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856, - 1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344, - 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408, - 1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408, - 1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472, - 1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664, - 1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856, - 1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984, - 2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, - 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664, - 1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664, - 1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728, - 1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728, - 1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984, - 2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112, - 2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304, - 2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432, - 1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920, - 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984, - 1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984, - 1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048, - 2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240, - 2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432, - 2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560, - 2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, - 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240, - 2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240, - 2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304, - 2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304, - 2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560, - 2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688, - 2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880, - 3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008, - 2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496, - 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560, - 2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560, - 2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624, - 2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816, - 2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008, - 3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136, - 3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, - 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816, - 2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816, - 2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880, - 2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880, - 3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136, - 3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264, - 3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456, - 3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584, - 3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072, - 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136, - 3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136, - 3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200, - 3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392, - 3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584, - 3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712, - 3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, - 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392, - 3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392, - 3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456, - 3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456, - 3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712, - 3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840, - 3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032, - 4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160, - 3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648, - 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712, - 3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712, - 3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776, - 3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968, - 4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160, - 4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288, - 4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, - 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968, - 3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968, - 3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032, - 4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032, - 4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288, - 4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416, - 4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608, - 4736, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736, - 4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224, - 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288, - 4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288, - 4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352, - 4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544, - 4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736, - 4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864, - 4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, - 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544, - 4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544, - 4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608, - 4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608, - 4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864, - 4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992, - 5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184, - 5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312, - 4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800, - 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864, - 4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864, - 4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928, - 5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120, - 5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312, - 5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440, - 5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, - 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120, - 5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120, - 5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184, - 5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184, - 5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440, - 5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568, - 5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, - 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632, - 5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376, - 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440, - 5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440, - 5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, - 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632, - 5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, - 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632, - 5632 -}; - -static const int filterData2[1424] = { - 0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11, - -13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, - -11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5, - -7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18, - -1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12, - 15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4, - 7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19, - -22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14, - -17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5, - -8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26, - 30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10, - 14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27, - -31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16, - -21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2, - -7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25, - 31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3, - 9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34, - -40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17, - -24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50, - 58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21, - 29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55, - -63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32, - -41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5, - -15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50, - 61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6, - 18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56, - -68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20, - -34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82, - 97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8, - 24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74, - -90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9, - -27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70, - 90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130, - -150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55, - -77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133, - 157, 181, -12, -36, -60, -84, -109, -133, -157, -181, - 13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93, - -120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191, - 221, -14, -44, -73, -103, -132, -162, -191, -221, 16, - 48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113, - -146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232, - 268, -17, -53, -89, -125, -160, -196, -232, -268, 19, - 58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137, - -176, -215, -255, -294, 21, 64, 108, 151, 194, 237, - 281, 324, -21, -64, -108, -151, -194, -237, -281, -324, - 23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118, - -166, -213, -261, -308, -356, 26, 78, 130, 182, 235, - 287, 339, 391, -26, -78, -130, -182, -235, -287, -339, - -391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86, - -143, -201, -258, -316, -373, -431, 31, 94, 158, 221, - 284, 347, 411, 474, -31, -94, -158, -221, -284, -347, - -411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34, - -104, -174, -244, -313, -383, -453, -523, 38, 115, 191, - 268, 345, 422, 498, 575, -38, -115, -191, -268, -345, - -422, -498, -575, 42, 126, 210, 294, 379, 463, 547, - 631, -42, -126, -210, -294, -379, -463, -547, -631, - 46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231, - -324, -417, -510, -602, -695, 51, 153, 255, 357, 459, - 561, 663, 765, -51, -153, -255, -357, -459, -561, -663, - -765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168, - -280, -392, -505, -617, -729, -841, 61, 185, 308, 432, - 555, 679, 802, 926, -61, -185, -308, -432, -555, -679, - -802, -926, 68, 204, 340, 476, 612, 748, 884, 1020, - -68, -204, -340, -476, -612, -748, -884, -1020, 74, - 224, 373, 523, 672, 822, 971, 1121, -74, -224, -373, - -523, -672, -822, -971, -1121, 82, 246, 411, 575, 740, - 904, 1069, 1233, -82, -246, -411, -575, -740, -904, - -1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357, - -90, -271, -452, -633, -814, -995, -1176, -1357, 99, - 298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497, - -696, -895, -1094, -1293, -1492, 109, 328, 547, 766, - 985, 1204, 1423, 1642, -109, -328, -547, -766, -985, - -1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324, - 1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564, - -1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132, - -397, -662, -927, -1192, -1457, -1722, -1987, 145, 437, - 728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728, - -1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121, - 1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442, - -1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940, - 2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292, - -2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910, - -194, -582, -970, -1358, -1746, -2134, -2522, -2910, - 213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213, - -640, -1066, -1493, -1920, -2347, -2773, -3200, 234, - 704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704, - -1173, -1643, -2112, -2582, -3051, -3521, 258, 774, - 1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291, - -1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988, - 2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556, - -3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436, - 4060, 4685, -312, -937, -1561, -2186, -2811, -3436, - -4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467, - 5154, -343, -1030, -1718, -2405, -3092, -3779, -4467, - -5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670, - -378, -1134, -1890, -2646, -3402, -4158, -4914, -5670, - 415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415, - -1247, -2079, -2911, -3742, -4574, -5406, -6238, 457, - 1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372, - -2287, -3202, -4117, -5032, -5947, -6862, 503, 1509, - 2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516, - -3522, -4529, -5535, -6542, -7548, 553, 1660, 2767, - 3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874, - -4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479, - 6697, 7915, 9133, -608, -1826, -3044, -4262, -5479, - -6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367, - 8706, 10046, -669, -2009, -3348, -4688, -6027, -7367, - -8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577, - 11051, -736, -2210, -3683, -5157, -6630, -8104, -9577, - -11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157, - -810, -2431, -4052, -5673, -7294, -8915, -10536, -12157, - 891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891, - -2674, -4457, -6240, -8023, -9806, -11589, -13372, 980, - 2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941, - -4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236, - 5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236, - -5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559, - 5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559, - -5933, -8306, -10679, -13052, -15426, -17799, 1305, - 3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305, - -3915, -6526, -9136, -11747, -14357, -16968, -19578, - 1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538, - -1435, -4307, -7179, -10051, -12922, -15794, -18666, - -21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531, - 23690, -1579, -4738, -7896, -11055, -14214, -17373, - -20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111, - 22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111, - -22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022, - 24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022, - -24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124, - 27329, 31533, -2102, -6306, -10511, -14715, -18920, - -23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812, - 25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812, - -25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893, - 27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893, - -27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183, - 30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183, - -30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700, - 32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700, - -32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471, - 32767, 32767, 32767, -3385, -10157, -16928, -23700, - -30471, -32767, -32767, -32767, 3724, 11172, 18621, - 26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621, - -26069, -32767, -32767, -32767, -32767, 4095, 12287, - 20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287, - -20479, -28671, -32767, -32767, -32767, -32767 -}; - -static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0 }; -static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 }; - -static void soundFilter(byte *data, int16 *buffer, int p1, int p2); - -void SoundManager::applyFilter(SoundEntry *entry, int16 *buffer) { - if ((((byte *)entry->_soundData)[1] << 6) > 0x1600) { - entry->_status.status |= 0x20000000; - } else { - int variant = entry->_status.status & 0x1f; - - soundFilter((byte *)entry->_soundData, buffer, p1s[variant], p2s[variant]); - } -} - - -static void soundFilter(byte *data, int16 *buffer, int p1, int p2) { - int data1, data2, data1p, data2p; - byte idx; - - data2 = data[0]; - data1 = data[1] << 6; - - data += 2; - - for (int count = 0; count < 735; count++) { - idx = data[count] >> 4; - data1p = filterData[idx + data1]; - data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767); - - buffer[2 * count] = (p2 * data2p) >> p1; - - idx = data[count] & 0xF; - - data1 = filterData[idx + data1p]; - data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767); - buffer[2 * count + 1] = (p2 * data2) >> p1; - } -} - - } // End of namespace LastExpress diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h index 414fb0d028..797e52646e 100644 --- a/engines/lastexpress/game/sound.h +++ b/engines/lastexpress/game/sound.h @@ -25,55 +25,18 @@ #include "lastexpress/shared.h" -#include "lastexpress/helpers.h" - -#include "common/list.h" -#include "common/mutex.h" -#include "common/system.h" -#include "common/serializer.h" +#include "common/str.h" namespace LastExpress { class LastExpressEngine; -class SubtitleManager; -class SoundEntry; -class SubtitleEntry; +class SoundQueue; -class SoundManager : Common::Serializable { +class SoundManager { public: SoundManager(LastExpressEngine *engine); ~SoundManager(); - // Timer - void handleTimer(); - - // State - void resetState() { _state |= kSoundType1; } - - // Sound queue - void updateQueue(); - void resetQueue(SoundType type1, SoundType type2 = kSoundTypeNone); - void clearQueue(); - - // Subtitles - void updateSubtitles(); - - // Entry - bool isBuffered(Common::String filename, bool testForEntity = false); - bool isBuffered(EntityIndex entity); - void setupEntry(SoundType type, EntityIndex index); - void processEntry(EntityIndex entity); - void processEntry(SoundType type); - void processEntry(Common::String filename); - void processEntries(); - void removeFromQueue(Common::String filename); - void removeFromQueue(EntityIndex entity); - uint32 getEntryTime(EntityIndex index); - - // Misc - void unknownFunction4(); - void clearStatus(); - // Sound playing void playSound(EntityIndex entity, Common::String filename, SoundFlag flag = kFlagInvalid, byte a4 = 0); bool playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4 = 0); @@ -83,7 +46,6 @@ public: void playFightSound(byte action, byte a4); void playLocomotiveSound(); void playWarningCompartment(EntityIndex entity, ObjectIndex compartment); - void playLoopingSound(int param); // Dialog & Letters @@ -97,64 +59,16 @@ public: const char *wrongDoorCath() const; const char *justAMinuteCath() const; - // FLags + // Flags SoundFlag getSoundFlag(EntityIndex index) const; - // Debug - void stopAllSound(); - - // Serializable - void saveLoadWithSerializer(Common::Serializer &ser); - uint32 count(); - // Accessors - uint32 getFlag() { return _flag; } - int getSubtitleFlag() { return _subtitlesFlag; } - void setSubtitleFlag(int flag) { _subtitlesFlag = flag; } - SoundType getCurrentType() { return _currentType; } - void setCurrentType(SoundType type) { _currentType = type; } + SoundQueue *getQueue() { return _queue; } uint32 getData2() { return _data2; } - // Subtitles - void addSubtitle(SubtitleEntry *entry) { _subtitles.push_back(entry); } - void removeSubtitle(SubtitleEntry *entry) { _subtitles.remove(entry); } - void setCurrentSubtitle(SubtitleEntry *entry) { _currentSubtitle = entry; } - SubtitleEntry *getCurrentSubtitle() { return _currentSubtitle; } - - // Queue - bool setupCache(SoundEntry *entry); - void addToQueue(SoundEntry *entry) { _soundList.push_back(entry); } - - SoundEntry *getEntry(SoundType type); - private: - typedef int32 *SoundBuffer; - - enum SoundState { - kSoundState0 = 0, - kSoundState1 = 1, - kSoundState2 = 2 - }; - - // Engine LastExpressEngine *_engine; - - // State flag - int _state; - SoundType _currentType; - - Common::Mutex _mutex; - - // Unknown data - uint32 _data0; - uint32 _data1; - uint32 _data2; - - // TODO: this seems to be a synchronization flag for the sound timer - uint32 _flag; - - // Filters - int32 _buffer[2940]; ///< Static sound buffer + SoundQueue *_queue; // Compartment warnings by Mertens or Coudert uint32 _lastWarning[12]; @@ -162,23 +76,10 @@ private: // Looping sound int _loopingSoundDuration; - // Sound entries - Common::List _soundList; ///< List of all sound entries - Common::List _soundCache; ///< List of entries with a data buffer - void *_soundCacheData; - - SoundEntry *getEntry(EntityIndex index); - SoundEntry *getEntry(Common::String name); - - void removeFromCache(SoundEntry *entry); - - // Subtitles - int _subtitlesFlag; - Common::List _subtitles; - SubtitleEntry *_currentSubtitle; - - // Sound filter - void applyFilter(SoundEntry *entry, int16 *buffer); + // Unknown data + uint32 _data0; + uint32 _data1; + uint32 _data2; }; } // End of namespace LastExpress diff --git a/engines/lastexpress/helpers.h b/engines/lastexpress/helpers.h index 594c8b0400..7f3f1e246c 100644 --- a/engines/lastexpress/helpers.h +++ b/engines/lastexpress/helpers.h @@ -63,6 +63,7 @@ // Sound #define getSound() _engine->getSoundManager() +#define getSoundQueue() _engine->getSoundManager()->getQueue() // Others #define getEntityData(entity) getEntities()->getData(entity) diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 73893c9982..2829f60740 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -32,6 +32,8 @@ #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/resource.h" @@ -151,8 +153,8 @@ Common::Error LastExpressEngine::run() { _menu->show(false, kSavegameTypeIndex, 0); while (!shouldQuit()) { - _soundMan->updateQueue(); - _soundMan->updateSubtitles(); + _soundMan->getQueue()->updateQueue(); + _soundMan->getQueue()->updateSubtitles(); if (handleEvents()) continue; @@ -280,7 +282,7 @@ void LastExpressEngine::soundTimer(void *refCon) { void LastExpressEngine::handleSoundTimer() { if (_frameCounter & 1) if (_soundMan) - _soundMan->handleTimer(); + _soundMan->getQueue()->handleTimer(); _frameCounter++; } diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index 74a2c77a01..288e53fc11 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -41,6 +41,8 @@ #include "lastexpress/menu/clock.h" #include "lastexpress/menu/trainline.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -336,7 +338,7 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { if (getFlags()->mouseRightClick) break; - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); } } } @@ -348,10 +350,10 @@ void Menu::show(bool doSavegame, SavegameType type, uint32 value) { init(doSavegame, type, value); // Setup sound - getSound()->unknownFunction4(); - getSound()->resetQueue(kSoundType11, kSoundType13); - if (getSound()->isBuffered("TIMER")) - getSound()->removeFromQueue("TIMER"); + getSoundQueue()->resetQueue(); + getSoundQueue()->resetQueue(kSoundType11, kSoundType13); + if (getSoundQueue()->isBuffered("TIMER")) + getSoundQueue()->removeFromQueue("TIMER"); // Init flags & misc _isShowingCredits = false; @@ -411,13 +413,13 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { if (clicked) { showFrame(kOverlayButtons, kButtonQuitPushed, true); - getSound()->clearStatus(); - getSound()->updateQueue(); + getSoundQueue()->clearStatus(); + getSoundQueue()->updateQueue(); getSound()->playSound(kEntityPlayer, "LIB046"); // FIXME uncomment when sound queue is properly implemented - /*while (getSound()->isBuffered("LIB046")) - getSound()->updateQueue();*/ + /*while (getSoundQueue()->isBuffered("LIB046")) + getSoundQueue()->updateQueue();*/ getFlags()->shouldRedraw = false; @@ -484,7 +486,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { setLogicEventHandlers(); if (_index) { - getSound()->processEntry(kSoundType11); + getSoundQueue()->processEntry(kSoundType11); } else { if (!getFlags()->mouseRightClick) { getScenes()->loadScene((SceneIndex)(5 * _gameId + 3)); @@ -496,7 +498,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { getScenes()->loadScene((SceneIndex)(5 * _gameId + 5)); if (!getFlags()->mouseRightClick) { - getSound()->processEntry(kSoundType11); + getSoundQueue()->processEntry(kSoundType11); // Show intro Animation animation; @@ -512,7 +514,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { if (!getEvent(kEventIntro)) { getEvent(kEventIntro) = 1; - getSound()->processEntry(kSoundType11); + getSoundQueue()->processEntry(kSoundType11); } } @@ -707,7 +709,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { while (nextFrameCount > getFrameCount()) { _engine->pollEvents(); - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); } } else { showFrame(kOverlayButtons, kButtonVolumeDown, true); @@ -742,7 +744,7 @@ bool Menu::handleEvent(StartMenuAction action, Common::EventType type) { while (nextFrameCount > getFrameCount()) { _engine->pollEvents(); - getSound()->updateQueue(); + getSoundQueue()->updateQueue(); } } else { showFrame(kOverlayButtons, kButtonVolumeUp, true); @@ -1117,8 +1119,8 @@ void Menu::updateTime(uint32 time) { _currentTime = time; if (_time != time) { - if (getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); getSound()->playSoundWithSubtitles((_currentTime >= _time) ? "LIB042" : "LIB041", kFlagMenuClock, kEntityChapters); adjustIndex(_currentTime, _time, false); @@ -1249,8 +1251,8 @@ void Menu::adjustTime() { _time = _currentTime; } - if (_currentTime == _time && getSound()->isBuffered(kEntityChapters)) - getSound()->removeFromQueue(kEntityChapters); + if (_currentTime == _time && getSoundQueue()->isBuffered(kEntityChapters)) + getSoundQueue()->removeFromQueue(kEntityChapters); _clock->draw(_time); _trainLine->draw(_time); diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index eff68efb73..355ecba33b 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -67,6 +67,7 @@ MODULE_OBJS := \ menu/menu.o \ menu/trainline.o \ sound/entry.o \ + sound/queue.o \ debug.o \ detection.o \ graphics.o \ diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h index d1730eefce..69816a3d6c 100644 --- a/engines/lastexpress/shared.h +++ b/engines/lastexpress/shared.h @@ -83,6 +83,12 @@ enum SoundFlag { kFlagType9 = 0x7000000 }; +enum SoundState { + kSoundState0 = 0, + kSoundState1 = 1, + kSoundState2 = 2 +}; + ////////////////////////////////////////////////////////////////////////// // Time values ////////////////////////////////////////////////////////////////////////// diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 304d524f45..817416110e 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -27,6 +27,8 @@ #include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/queue.h" + #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" @@ -70,6 +72,7 @@ SoundEntry::~SoundEntry() { delete _soundStream; + // Zero passed pointers _engine = NULL; } @@ -79,10 +82,10 @@ void SoundEntry::open(Common::String name, SoundFlag flag, int priority) { setStatus(flag); // Add entry to sound list - getSound()->addToQueue(this); + getSoundQueue()->addToQueue(this); // Add entry to cache and load sound data - getSound()->setupCache(this); + getSoundQueue()->setupCache(this); loadSoundData(name); } @@ -90,7 +93,7 @@ void SoundEntry::close() { _status.status |= kSoundStatusRemoved; // Loop until ready - while (!(_status.status1 & 4) && !(getSound()->getFlag() & 8) && (getSound()->getFlag() & 1)) + while (!(_status.status1 & 4) && !(getSoundQueue()->getFlag() & 8) && (getSoundQueue()->getFlag() & 1)) ; // empty loop body // The original game remove the entry from the cache here, @@ -115,16 +118,16 @@ void SoundEntry::setType(SoundFlag flag) { switch (flag & kFlagType9) { default: case kFlagNone: - _type = getSound()->getCurrentType(); - getSound()->setCurrentType((SoundType)(_type + 1)); + _type = getSoundQueue()->getCurrentType(); + getSoundQueue()->setCurrentType((SoundType)(_type + 1)); break; case kFlagType1_2: { - SoundEntry *previous2 = getSound()->getEntry(kSoundType2); + SoundEntry *previous2 = getSoundQueue()->getEntry(kSoundType2); if (previous2) previous2->update(0); - SoundEntry *previous = getSound()->getEntry(kSoundType1); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType1); if (previous) { previous->setType(kSoundType2); previous->update(0); @@ -135,7 +138,7 @@ void SoundEntry::setType(SoundFlag flag) { break; case kFlagType3: { - SoundEntry *previous = getSound()->getEntry(kSoundType3); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType3); if (previous) { previous->setType(kSoundType4); previous->update(0); @@ -146,7 +149,7 @@ void SoundEntry::setType(SoundFlag flag) { break; case kFlagType7: { - SoundEntry *previous = getSound()->getEntry(kSoundType7); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType7); if (previous) previous->setType(kSoundType8); @@ -155,7 +158,7 @@ void SoundEntry::setType(SoundFlag flag) { break; case kFlagType9: { - SoundEntry *previous = getSound()->getEntry(kSoundType9); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType9); if (previous) previous->setType(kSoundType10); @@ -164,7 +167,7 @@ void SoundEntry::setType(SoundFlag flag) { break; case kFlagType11: { - SoundEntry *previous = getSound()->getEntry(kSoundType11); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType11); if (previous) previous->setType(kSoundType14); @@ -173,7 +176,7 @@ void SoundEntry::setType(SoundFlag flag) { break; case kFlagType13: { - SoundEntry *previous = getSound()->getEntry(kSoundType13); + SoundEntry *previous = getSoundQueue()->getEntry(kSoundType13); if (previous) previous->setType(kSoundType14); @@ -221,7 +224,7 @@ void SoundEntry::update(uint val) { _status.status |= kSoundStatus_100000; if (val) { - if (getSound()->getFlag() & 32) { + if (getSoundQueue()->getFlag() & 32) { _field_40 = val; value2 = val * 2 + 1; } @@ -235,7 +238,7 @@ void SoundEntry::update(uint val) { } void SoundEntry::updateState() { - if (getSound()->getFlag() & 32) { + if (getSoundQueue()->getFlag() & 32) { if (_type != kSoundType9 && _type != kSoundType7 && _type != kSoundType5) { uint32 newStatus = _status.status & kSoundStatusClear1; @@ -318,7 +321,7 @@ SubtitleEntry::~SubtitleEntry() { void SubtitleEntry::load(Common::String filename, SoundEntry *soundEntry) { // Add ourselves to the list of active subtitles - getSound()->addSubtitle(this); + getSoundQueue()->addSubtitle(this); // Set sound entry and filename _filename = filename + ".SBE"; @@ -326,7 +329,7 @@ void SubtitleEntry::load(Common::String filename, SoundEntry *soundEntry) { // Load subtitle data if (_engine->getResourceManager()->hasFile(filename)) { - if (getSound()->getSubtitleFlag() & 2) + if (getSoundQueue()->getSubtitleFlag() & 2) return; loadData(); @@ -339,8 +342,8 @@ void SubtitleEntry::loadData() { _data = new SubtitleManager(_engine->getFont()); _data->load(getArchive(_filename)); - getSound()->setSubtitleFlag(getSound()->getSubtitleFlag() | 2); - getSound()->setCurrentSubtitle(this); + getSoundQueue()->setSubtitleFlag(getSoundQueue()->getSubtitleFlag() | 2); + getSoundQueue()->setCurrentSubtitle(this); } void SubtitleEntry::setupAndDraw() { @@ -354,32 +357,32 @@ void SubtitleEntry::setupAndDraw() { } else { _data->setTime((uint16)_sound->_time); - if (getSound()->getSubtitleFlag() & 1) + if (getSoundQueue()->getSubtitleFlag() & 1) drawOnScreen(); } - getSound()->setCurrentSubtitle(this); + getSoundQueue()->setCurrentSubtitle(this); } void SubtitleEntry::draw() { // Remove ourselves from the queue - getSound()->removeSubtitle(this); + getSoundQueue()->removeSubtitle(this); - if (this == getSound()->getCurrentSubtitle()) { + if (this == getSoundQueue()->getCurrentSubtitle()) { drawOnScreen(); - getSound()->setCurrentSubtitle(NULL); - getSound()->setSubtitleFlag(0); + getSoundQueue()->setCurrentSubtitle(NULL); + getSoundQueue()->setSubtitleFlag(0); } } void SubtitleEntry::drawOnScreen() { - getSound()->setSubtitleFlag(getSound()->getSubtitleFlag() & -1); + getSoundQueue()->setSubtitleFlag(getSoundQueue()->getSubtitleFlag() & -1); if (_data == NULL) return; - if (getSound()->getSubtitleFlag() & 1) + if (getSoundQueue()->getSubtitleFlag() & 1) _engine->getGraphicsManager()->draw(_data, GraphicsManager::kBackgroundOverlay); } diff --git a/engines/lastexpress/sound/queue.cpp b/engines/lastexpress/sound/queue.cpp new file mode 100644 index 0000000000..9126f5709d --- /dev/null +++ b/engines/lastexpress/sound/queue.cpp @@ -0,0 +1,795 @@ +/* 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 "lastexpress/sound/queue.h" + +#include "lastexpress/game/logic.h" +#include "lastexpress/game/state.h" + +#include "lastexpress/sound/entry.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/lastexpress.h" + +namespace LastExpress { + +#define SOUNDCACHE_ENTRY_SIZE 92160 +#define SOUNDCACHE_MAX_SIZE 6 + +SoundQueue::SoundQueue(LastExpressEngine *engine) : _engine(engine) { + _state = 0; + _currentType = kSoundType16; + _flag = 0; + + // Cache and filter buffers + memset(&_buffer, 0, sizeof(_buffer)); + _soundCacheData = malloc(6 * SOUNDCACHE_ENTRY_SIZE); + + _subtitlesFlag = 0; + _currentSubtitle = NULL; +} + +SoundQueue::~SoundQueue() { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + SAFE_DELETE(*i); + _soundList.clear(); + + // Entries in the cache are just pointers to sound list entries + _soundCache.clear(); + + for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) + SAFE_DELETE(*i); + _subtitles.clear(); + + _currentSubtitle = NULL; + + free(_soundCacheData); + + // Zero passed pointers + _engine = NULL; +} + +////////////////////////////////////////////////////////////////////////// +// Timer +////////////////////////////////////////////////////////////////////////// +void SoundQueue::handleTimer() { + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + SoundEntry *entry = (*i); + if (entry->_stream == NULL) { + SAFE_DELETE(*i); + i = _soundList.reverse_erase(i); + continue; + } else if (!entry->_soundStream) { + entry->_soundStream = new StreamedSound(); + + // TODO: stream any sound in the queue after filtering + entry->_soundStream->load(entry->_stream); + } + } +} + +////////////////////////////////////////////////////////////////////////// +// Sound queue management +////////////////////////////////////////////////////////////////////////// +void SoundQueue::addToQueue(SoundEntry *entry) { + _soundList.push_back(entry); +} + +void SoundQueue::removeFromQueue(EntityIndex entity) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(entity); + if (entry) + entry->reset(); +} + +void SoundQueue::removeFromQueue(Common::String filename) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(filename); + if (entry) + entry->reset(); +} + +void SoundQueue::updateQueue() { + Common::StackLock locker(_mutex); + + warning("Sound::updateQueue: not implemented!"); +} + +void SoundQueue::resetQueue() { + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->getType() == kSoundType1) { + (*i)->reset(); + break; + } + } + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->getType() == kSoundType2) { + (*i)->reset(); + break; + } + } +} + +void SoundQueue::resetQueue(SoundType type1, SoundType type2) { + if (!type2) + type2 = type1; + + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->getType() != type1 && (*i)->getType() != type2) + (*i)->reset(); + } +} + +void SoundQueue::clearQueue() { + _flag |= 4; + + // FIXME: Wait a while for a flag to be set + //for (int i = 0; i < 3000000; i++) + // if (_flag & 8) + // break; + + _flag |= 8; + + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + SoundEntry *entry = (*i); + + // Delete entry + entry->close(); + SAFE_DELETE(entry); + + i = _soundList.reverse_erase(i); + } + + updateSubtitles(); +} + +////////////////////////////////////////////////////////////////////////// +// State +////////////////////////////////////////////////////////////////////////// +void SoundQueue::clearStatus() { + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->_status.status |= kSoundStatusClear3; +} + +////////////////////////////////////////////////////////////////////////// +// Entry management +////////////////////////////////////////////////////////////////////////// +void SoundQueue::setupEntry(SoundType type, EntityIndex index) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(type); + if (entry) + entry->setEntity(index); +} + +void SoundQueue::processEntry(EntityIndex entity) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(entity); + if (entry) { + entry->update(0); + entry->setEntity(kEntityPlayer); + } +} + +void SoundQueue::processEntry(SoundType type) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(type); + if (entry) + entry->update(0); +} + +void SoundQueue::processEntry(Common::String filename) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(filename); + if (entry) { + entry->update(0); + entry->setEntity(kEntityPlayer); + } +} + +void SoundQueue::processEntries() { + _state = 0; + + processEntry(kSoundType1); + processEntry(kSoundType2); +} + +SoundEntry *SoundQueue::getEntry(EntityIndex index) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->getEntity() == index) + return *i; + } + + return NULL; +} + +SoundEntry *SoundQueue::getEntry(Common::String name) { + if (!name.contains('.')) + name += ".SND"; + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->_name2 == name) + return *i; + } + + return NULL; +} + +SoundEntry *SoundQueue::getEntry(SoundType type) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { + if ((*i)->getType() == type) + return *i; + } + + return NULL; +} + +uint32 SoundQueue::getEntryTime(EntityIndex index) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(index); + if (entry) + return entry->_time; + + return 0; +} + +bool SoundQueue::isBuffered(EntityIndex entity) { + Common::StackLock locker(_mutex); + + return (getEntry(entity) != NULL); +} + +bool SoundQueue::isBuffered(Common::String filename, bool testForEntity) { + Common::StackLock locker(_mutex); + + SoundEntry *entry = getEntry(filename); + + if (testForEntity) + return entry != NULL && entry->getEntity() != kEntityPlayer; + + return (entry != NULL); +} + +////////////////////////////////////////////////////////////////////////// +// Subtitles +////////////////////////////////////////////////////////////////////////// +void SoundQueue::updateSubtitles() { + Common::StackLock locker(_mutex); + + uint32 index = 0; + SubtitleEntry *subtitle = NULL; + + for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { + uint32 current_index = 0; + SoundEntry *soundEntry = (*i)->getSoundEntry(); + SoundStatus status = (SoundStatus)soundEntry->_status.status; + + if (!(status & kSoundStatus_40) + || status & kSoundStatus_180 + || soundEntry->_time == 0 + || (status & kSoundStatusClear1) < 6 + || ((getFlags()->nis & 0x8000) && soundEntry->_priority < 90)) { + current_index = 0; + } else { + current_index = soundEntry->_priority + (status & kSoundStatusClear1); + + if (_currentSubtitle == (*i)) + current_index += 4; + } + + if (index < current_index) { + index = current_index; + subtitle = (*i); + } + } + + if (_currentSubtitle == subtitle) { + if (subtitle) + subtitle->setupAndDraw(); + + return; + } + + if (_subtitlesFlag & 1) + subtitle->drawOnScreen(); + + if (subtitle) { + subtitle->loadData(); + subtitle->setupAndDraw(); + } +} + +////////////////////////////////////////////////////////////////////////// +// Cache +////////////////////////////////////////////////////////////////////////// +bool SoundQueue::setupCache(SoundEntry *entry) { + if (entry->_soundData) + return true; + + if (_soundCache.size() >= SOUNDCACHE_MAX_SIZE) { + + SoundEntry *cacheEntry = NULL; + uint32 size = 1000; + + for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { + if (!((*i)->_status.status & kSoundStatus_180)) { + uint32 newSize = (*i)->_priority + ((*i)->_status.status & kSoundStatusClear1); + + if (newSize < size) { + cacheEntry = (*i); + size = newSize; + } + } + } + + if (entry->_priority <= size) + return false; + + if (!cacheEntry) + error("[SoundManager::setupCache] Cannot find a valid entry"); + + cacheEntry->setInCache(); + + // TODO: Wait until the cache entry is ready to be removed + while (!(cacheEntry->_status.status1 & 1)) + ; + + if (cacheEntry->_soundData) + removeFromCache(cacheEntry); + + _soundCache.push_back(entry); + entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + } else { + _soundCache.push_back(entry); + entry->_soundData = (char *)_soundCacheData + SOUNDCACHE_ENTRY_SIZE * (_soundCache.size() - 1); + } + + return true; +} + +void SoundQueue::removeFromCache(SoundEntry *entry) { + for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { + if ((*i) == entry) { + // Remove sound buffer + entry->_soundData = NULL; + + // Remove entry from sound cache + i = _soundCache.reverse_erase(i); + } + } +} + +////////////////////////////////////////////////////////////////////////// +// Savegame +////////////////////////////////////////////////////////////////////////// +void SoundQueue::saveLoadWithSerializer(Common::Serializer &s) { + Common::StackLock locker(_mutex); + + s.syncAsUint32LE(_state); + s.syncAsUint32LE(_currentType); + + // Compute the number of entries to save + uint32 numEntries = count(); + s.syncAsUint32LE(numEntries); + + // Save or load each entry data + if (s.isSaving()) { + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->saveLoadWithSerializer(s); + } else { + warning("Sound::saveLoadWithSerializer: loading not implemented"); + s.skip(numEntries * 64); + } +} + + +// FIXME: We probably need another mutex here to protect during the whole savegame process +// as we could have removed an entry between the time we check the count and the time we +// save the entries +uint32 SoundQueue::count() { + Common::StackLock locker(_mutex); + + uint32 numEntries = 0; + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + if ((*i)->_name2.matchString("NISSND?")) + ++numEntries; + + return numEntries; +} + +////////////////////////////////////////////////////////////////////////// +// Sound filters +////////////////////////////////////////////////////////////////////////// +static const int filterData[1424] = { + 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256, + 384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0, + 192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640, + 64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128, + 320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576, + 704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192, + 192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448, + 576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832, + 320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320, + 320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704, + 832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448, + 448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448, + 640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960, + 1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576, + 576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576, + 576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832, + 960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088, + 1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704, + 704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768, + 768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960, + 1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280, + 1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896, + 896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896, + 896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152, + 1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408, + 1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, + 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088, + 1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088, + 1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152, + 1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152, + 1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408, + 1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536, + 1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728, + 1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856, + 1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344, + 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408, + 1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408, + 1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472, + 1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664, + 1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856, + 1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984, + 2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, + 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664, + 1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664, + 1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728, + 1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728, + 1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984, + 2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112, + 2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304, + 2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432, + 1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920, + 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984, + 1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984, + 1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048, + 2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240, + 2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432, + 2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560, + 2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, + 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240, + 2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240, + 2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304, + 2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304, + 2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560, + 2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688, + 2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880, + 3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008, + 2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496, + 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560, + 2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560, + 2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624, + 2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816, + 2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008, + 3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136, + 3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, + 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816, + 2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816, + 2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880, + 2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880, + 3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136, + 3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264, + 3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456, + 3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584, + 3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072, + 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136, + 3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136, + 3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200, + 3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392, + 3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584, + 3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712, + 3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, + 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392, + 3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392, + 3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456, + 3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456, + 3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712, + 3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840, + 3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032, + 4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160, + 3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648, + 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712, + 3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712, + 3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776, + 3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968, + 4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160, + 4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288, + 4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, + 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968, + 3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968, + 3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032, + 4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032, + 4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288, + 4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416, + 4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608, + 4736, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736, + 4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224, + 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288, + 4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288, + 4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352, + 4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544, + 4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736, + 4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864, + 4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, + 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544, + 4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544, + 4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608, + 4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608, + 4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864, + 4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992, + 5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184, + 5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312, + 4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800, + 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864, + 4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864, + 4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928, + 5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120, + 5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312, + 5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440, + 5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, + 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120, + 5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120, + 5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184, + 5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184, + 5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440, + 5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568, + 5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, + 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632, + 5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376, + 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440, + 5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440, + 5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, + 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632, + 5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, + 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632, + 5632 +}; + +static const int filterData2[1424] = { + 0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11, + -13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, + -11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5, + -7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18, + -1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12, + 15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4, + 7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19, + -22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14, + -17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5, + -8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26, + 30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10, + 14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27, + -31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16, + -21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2, + -7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25, + 31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3, + 9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34, + -40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17, + -24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50, + 58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21, + 29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55, + -63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32, + -41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5, + -15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50, + 61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6, + 18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56, + -68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20, + -34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82, + 97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8, + 24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74, + -90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9, + -27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70, + 90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130, + -150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55, + -77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133, + 157, 181, -12, -36, -60, -84, -109, -133, -157, -181, + 13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93, + -120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191, + 221, -14, -44, -73, -103, -132, -162, -191, -221, 16, + 48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113, + -146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232, + 268, -17, -53, -89, -125, -160, -196, -232, -268, 19, + 58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137, + -176, -215, -255, -294, 21, 64, 108, 151, 194, 237, + 281, 324, -21, -64, -108, -151, -194, -237, -281, -324, + 23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118, + -166, -213, -261, -308, -356, 26, 78, 130, 182, 235, + 287, 339, 391, -26, -78, -130, -182, -235, -287, -339, + -391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86, + -143, -201, -258, -316, -373, -431, 31, 94, 158, 221, + 284, 347, 411, 474, -31, -94, -158, -221, -284, -347, + -411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34, + -104, -174, -244, -313, -383, -453, -523, 38, 115, 191, + 268, 345, 422, 498, 575, -38, -115, -191, -268, -345, + -422, -498, -575, 42, 126, 210, 294, 379, 463, 547, + 631, -42, -126, -210, -294, -379, -463, -547, -631, + 46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231, + -324, -417, -510, -602, -695, 51, 153, 255, 357, 459, + 561, 663, 765, -51, -153, -255, -357, -459, -561, -663, + -765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168, + -280, -392, -505, -617, -729, -841, 61, 185, 308, 432, + 555, 679, 802, 926, -61, -185, -308, -432, -555, -679, + -802, -926, 68, 204, 340, 476, 612, 748, 884, 1020, + -68, -204, -340, -476, -612, -748, -884, -1020, 74, + 224, 373, 523, 672, 822, 971, 1121, -74, -224, -373, + -523, -672, -822, -971, -1121, 82, 246, 411, 575, 740, + 904, 1069, 1233, -82, -246, -411, -575, -740, -904, + -1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357, + -90, -271, -452, -633, -814, -995, -1176, -1357, 99, + 298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497, + -696, -895, -1094, -1293, -1492, 109, 328, 547, 766, + 985, 1204, 1423, 1642, -109, -328, -547, -766, -985, + -1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324, + 1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564, + -1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132, + -397, -662, -927, -1192, -1457, -1722, -1987, 145, 437, + 728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728, + -1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121, + 1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442, + -1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940, + 2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292, + -2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910, + -194, -582, -970, -1358, -1746, -2134, -2522, -2910, + 213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213, + -640, -1066, -1493, -1920, -2347, -2773, -3200, 234, + 704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704, + -1173, -1643, -2112, -2582, -3051, -3521, 258, 774, + 1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291, + -1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988, + 2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556, + -3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436, + 4060, 4685, -312, -937, -1561, -2186, -2811, -3436, + -4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467, + 5154, -343, -1030, -1718, -2405, -3092, -3779, -4467, + -5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670, + -378, -1134, -1890, -2646, -3402, -4158, -4914, -5670, + 415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415, + -1247, -2079, -2911, -3742, -4574, -5406, -6238, 457, + 1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372, + -2287, -3202, -4117, -5032, -5947, -6862, 503, 1509, + 2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516, + -3522, -4529, -5535, -6542, -7548, 553, 1660, 2767, + 3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874, + -4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479, + 6697, 7915, 9133, -608, -1826, -3044, -4262, -5479, + -6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367, + 8706, 10046, -669, -2009, -3348, -4688, -6027, -7367, + -8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577, + 11051, -736, -2210, -3683, -5157, -6630, -8104, -9577, + -11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157, + -810, -2431, -4052, -5673, -7294, -8915, -10536, -12157, + 891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891, + -2674, -4457, -6240, -8023, -9806, -11589, -13372, 980, + 2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941, + -4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236, + 5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236, + -5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559, + 5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559, + -5933, -8306, -10679, -13052, -15426, -17799, 1305, + 3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305, + -3915, -6526, -9136, -11747, -14357, -16968, -19578, + 1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538, + -1435, -4307, -7179, -10051, -12922, -15794, -18666, + -21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531, + 23690, -1579, -4738, -7896, -11055, -14214, -17373, + -20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111, + 22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111, + -22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022, + 24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022, + -24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124, + 27329, 31533, -2102, -6306, -10511, -14715, -18920, + -23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812, + 25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812, + -25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893, + 27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893, + -27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183, + 30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183, + -30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700, + 32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700, + -32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471, + 32767, 32767, 32767, -3385, -10157, -16928, -23700, + -30471, -32767, -32767, -32767, 3724, 11172, 18621, + 26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621, + -26069, -32767, -32767, -32767, -32767, 4095, 12287, + 20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287, + -20479, -28671, -32767, -32767, -32767, -32767 +}; + +static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0 }; +static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 }; + +static void soundFilter(byte *data, int16 *buffer, int p1, int p2); + +void SoundQueue::applyFilter(SoundEntry *entry, int16 *buffer) { + if ((((byte *)entry->_soundData)[1] << 6) > 0x1600) { + entry->_status.status |= 0x20000000; + } else { + int variant = entry->_status.status & 0x1f; + + soundFilter((byte *)entry->_soundData, buffer, p1s[variant], p2s[variant]); + } +} + + +static void soundFilter(byte *data, int16 *buffer, int p1, int p2) { + int data1, data2, data1p, data2p; + byte idx; + + data2 = data[0]; + data1 = data[1] << 6; + + data += 2; + + for (int count = 0; count < 735; count++) { + idx = data[count] >> 4; + data1p = filterData[idx + data1]; + data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767); + + buffer[2 * count] = (p2 * data2p) >> p1; + + idx = data[count] & 0xF; + + data1 = filterData[idx + data1p]; + data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767); + buffer[2 * count + 1] = (p2 * data2) >> p1; + } +} + +////////////////////////////////////////////////////////////////////////// +// Debug +////////////////////////////////////////////////////////////////////////// +void SoundQueue::stopAllSound() { + Common::StackLock locker(_mutex); + + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) + (*i)->_soundStream->stop(); +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/sound/queue.h b/engines/lastexpress/sound/queue.h new file mode 100644 index 0000000000..3748a266e0 --- /dev/null +++ b/engines/lastexpress/sound/queue.h @@ -0,0 +1,131 @@ +/* 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 LASTEXPRESS_SOUND_QUEUE_H +#define LASTEXPRESS_SOUND_QUEUE_H + +#include "lastexpress/shared.h" + +#include "common/array.h" +#include "common/mutex.h" +#include "common/serializer.h" + +namespace LastExpress { + +class LastExpressEngine; +class SoundEntry; +class SubtitleEntry; + +class SoundQueue : Common::Serializable { +public: + SoundQueue(LastExpressEngine *engine); + ~SoundQueue(); + + // Timer + void handleTimer(); + + // Queue + void addToQueue(SoundEntry *entry); + void removeFromQueue(Common::String filename); + void removeFromQueue(EntityIndex entity); + void updateQueue(); + void resetQueue(); + void resetQueue(SoundType type1, SoundType type2 = kSoundTypeNone); + void clearQueue(); + + // State + void clearStatus(); + int getSoundState() { return _state; } + void resetState() { resetState(kSoundState1); } + void resetState(SoundState state) { _state |= state; } + + // Entries + void setupEntry(SoundType type, EntityIndex index); + void processEntry(EntityIndex entity); + void processEntry(SoundType type); + void processEntry(Common::String filename); + void processEntries(); + SoundEntry *getEntry(SoundType type); + SoundEntry *getEntry(EntityIndex index); + SoundEntry *getEntry(Common::String name); + uint32 getEntryTime(EntityIndex index); + bool isBuffered(Common::String filename, bool testForEntity = false); + bool isBuffered(EntityIndex entity); + + // Subtitles + void updateSubtitles(); + void addSubtitle(SubtitleEntry *entry) { _subtitles.push_back(entry); } + void removeSubtitle(SubtitleEntry *entry) { _subtitles.remove(entry); } + void setCurrentSubtitle(SubtitleEntry *entry) { _currentSubtitle = entry; } + SubtitleEntry *getCurrentSubtitle() { return _currentSubtitle; } + + // Cache + bool setupCache(SoundEntry *entry); + + // Serializable + void saveLoadWithSerializer(Common::Serializer &ser); + uint32 count(); + + // Accessors + uint32 getFlag() { return _flag; } + int getSubtitleFlag() { return _subtitlesFlag; } + void setSubtitleFlag(int flag) { _subtitlesFlag = flag; } + SoundType getCurrentType() { return _currentType; } + void setCurrentType(SoundType type) { _currentType = type; } + +protected: + // Debug + void stopAllSound(); + +private: + LastExpressEngine *_engine; + + Common::Mutex _mutex; + + // State & shared data + int _state; + SoundType _currentType; + // TODO: this seems to be a synchronization flag for the sound timer + uint32 _flag; + + // Entries + Common::List _soundList; ///< List of all sound entries + Common::List _soundCache; ///< List of entries with a data buffer + void *_soundCacheData; + + // Subtitles + int _subtitlesFlag; + Common::List _subtitles; + SubtitleEntry *_currentSubtitle; + + // Filters + int32 _buffer[2940]; ///< Static sound buffer + + void removeFromCache(SoundEntry *entry); + void applyFilter(SoundEntry *entry, int16 *buffer); + + friend class Debugger; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_SOUND_QUEUE_H -- cgit v1.2.3 From 90dc4f9a8c3f77b15c7c6d49651338dbc40c40fa Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 22:30:24 -0400 Subject: LASTEXPRESS: Move Sound class to the sound folder --- engines/lastexpress/debug.cpp | 2 +- engines/lastexpress/entities/abbot.cpp | 2 +- engines/lastexpress/entities/alexei.cpp | 3 +- engines/lastexpress/entities/alouan.cpp | 3 +- engines/lastexpress/entities/anna.cpp | 2 +- engines/lastexpress/entities/august.cpp | 2 +- engines/lastexpress/entities/boutarel.cpp | 2 +- engines/lastexpress/entities/chapters.cpp | 2 +- engines/lastexpress/entities/cooks.cpp | 2 +- engines/lastexpress/entities/coudert.cpp | 2 +- engines/lastexpress/entities/entity.cpp | 3 +- engines/lastexpress/entities/entity.h | 2 +- engines/lastexpress/entities/gendarmes.h | 2 +- engines/lastexpress/entities/hadija.cpp | 3 +- engines/lastexpress/entities/ivo.cpp | 3 +- engines/lastexpress/entities/kahina.cpp | 2 +- engines/lastexpress/entities/kronos.cpp | 2 +- engines/lastexpress/entities/mahmud.cpp | 2 +- engines/lastexpress/entities/max.cpp | 2 +- engines/lastexpress/entities/mertens.cpp | 2 +- engines/lastexpress/entities/milos.cpp | 2 +- engines/lastexpress/entities/mmeboutarel.cpp | 2 +- engines/lastexpress/entities/pascale.cpp | 2 +- engines/lastexpress/entities/rebecca.cpp | 2 +- engines/lastexpress/entities/salko.cpp | 2 +- engines/lastexpress/entities/servers0.cpp | 3 +- engines/lastexpress/entities/servers1.cpp | 3 +- engines/lastexpress/entities/sophie.cpp | 3 +- engines/lastexpress/entities/tables.cpp | 2 +- engines/lastexpress/entities/tatiana.cpp | 2 +- engines/lastexpress/entities/train.cpp | 2 +- engines/lastexpress/entities/vassili.cpp | 2 +- engines/lastexpress/entities/verges.cpp | 2 +- engines/lastexpress/entities/vesna.cpp | 3 +- engines/lastexpress/entities/yasmin.cpp | 3 +- engines/lastexpress/fight/fighter.cpp | 3 +- engines/lastexpress/fight/fighter_anna.cpp | 3 +- engines/lastexpress/fight/fighter_ivo.cpp | 3 +- engines/lastexpress/fight/fighter_milos.cpp | 3 +- engines/lastexpress/fight/fighter_salko.cpp | 3 +- engines/lastexpress/fight/fighter_vesna.cpp | 3 +- engines/lastexpress/game/action.cpp | 2 +- engines/lastexpress/game/entities.cpp | 2 +- engines/lastexpress/game/inventory.cpp | 2 +- engines/lastexpress/game/logic.cpp | 2 +- engines/lastexpress/game/scenes.cpp | 2 +- engines/lastexpress/game/sound.cpp | 1379 -------------------------- engines/lastexpress/game/sound.h | 87 -- engines/lastexpress/lastexpress.cpp | 2 +- engines/lastexpress/menu/menu.cpp | 2 +- engines/lastexpress/module.mk | 2 +- engines/lastexpress/sound/entry.cpp | 2 +- engines/lastexpress/sound/sound.cpp | 1379 ++++++++++++++++++++++++++ engines/lastexpress/sound/sound.h | 87 ++ 54 files changed, 1527 insertions(+), 1521 deletions(-) delete mode 100644 engines/lastexpress/game/sound.cpp delete mode 100644 engines/lastexpress/game/sound.h create mode 100644 engines/lastexpress/sound/sound.cpp create mode 100644 engines/lastexpress/sound/sound.h diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index 2d22630381..dc2807db63 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -41,10 +41,10 @@ #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp index 6fcadcfa54..c5c6f2a44d 100644 --- a/engines/lastexpress/entities/abbot.cpp +++ b/engines/lastexpress/entities/abbot.cpp @@ -31,10 +31,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp index d723a5607c..073ca3f175 100644 --- a/engines/lastexpress/entities/alexei.cpp +++ b/engines/lastexpress/entities/alexei.cpp @@ -29,9 +29,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp index 715622aaab..cd79870559 100644 --- a/engines/lastexpress/entities/alouan.cpp +++ b/engines/lastexpress/entities/alouan.cpp @@ -26,9 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp index 2eb3a9ec85..b13aa21f6d 100644 --- a/engines/lastexpress/entities/anna.cpp +++ b/engines/lastexpress/entities/anna.cpp @@ -31,10 +31,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp index 44dd3eb579..eb3b09af59 100644 --- a/engines/lastexpress/entities/august.cpp +++ b/engines/lastexpress/entities/august.cpp @@ -33,10 +33,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index cf5d286d64..315b12a69e 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -29,10 +29,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index 53d89e9699..96e08ba808 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -60,10 +60,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/menu/menu.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/sound/queue.h" diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp index cd8fbfd8ff..42e888cc7c 100644 --- a/engines/lastexpress/entities/cooks.cpp +++ b/engines/lastexpress/entities/cooks.cpp @@ -26,10 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index fea08f4611..c3e7e37b88 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -29,10 +29,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index f6d24d69ca..60efd70329 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -33,9 +33,10 @@ #include "lastexpress/game/state.h" #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 1988aef6fe..6a4f4166bb 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -25,7 +25,7 @@ #include "lastexpress/shared.h" -#include "lastexpress/game/sound.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/gendarmes.h b/engines/lastexpress/entities/gendarmes.h index 5c3ff1d439..d999cfc1fd 100644 --- a/engines/lastexpress/entities/gendarmes.h +++ b/engines/lastexpress/entities/gendarmes.h @@ -26,7 +26,7 @@ #include "lastexpress/entities/entity.h" #include "lastexpress/entities/entity_intern.h" -#include "lastexpress/game/sound.h" +#include "lastexpress/sound/sound.h" namespace LastExpress { diff --git a/engines/lastexpress/entities/hadija.cpp b/engines/lastexpress/entities/hadija.cpp index ce2c9718db..8ec972b939 100644 --- a/engines/lastexpress/entities/hadija.cpp +++ b/engines/lastexpress/entities/hadija.cpp @@ -26,9 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/ivo.cpp b/engines/lastexpress/entities/ivo.cpp index 861c3cf9bd..f2261b438c 100644 --- a/engines/lastexpress/entities/ivo.cpp +++ b/engines/lastexpress/entities/ivo.cpp @@ -30,9 +30,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp index 6c73784b21..2918b1e8bd 100644 --- a/engines/lastexpress/entities/kahina.cpp +++ b/engines/lastexpress/entities/kahina.cpp @@ -29,10 +29,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp index 06ebd54694..134dce9c81 100644 --- a/engines/lastexpress/entities/kronos.cpp +++ b/engines/lastexpress/entities/kronos.cpp @@ -36,10 +36,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp index cb782854af..0e67b45cd2 100644 --- a/engines/lastexpress/entities/mahmud.cpp +++ b/engines/lastexpress/entities/mahmud.cpp @@ -31,10 +31,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp index 924f8f77aa..eacc38bf60 100644 --- a/engines/lastexpress/entities/max.cpp +++ b/engines/lastexpress/entities/max.cpp @@ -28,10 +28,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp index 464cc343bb..e222af4805 100644 --- a/engines/lastexpress/entities/mertens.cpp +++ b/engines/lastexpress/entities/mertens.cpp @@ -30,9 +30,9 @@ #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/state.h" -#include "lastexpress/game/sound.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp index 1526c281b2..ff3d2b6744 100644 --- a/engines/lastexpress/entities/milos.cpp +++ b/engines/lastexpress/entities/milos.cpp @@ -33,10 +33,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp index 1d4c52ca09..9ca10ca374 100644 --- a/engines/lastexpress/entities/mmeboutarel.cpp +++ b/engines/lastexpress/entities/mmeboutarel.cpp @@ -28,10 +28,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp index 8bbcf64e84..a191273702 100644 --- a/engines/lastexpress/entities/pascale.cpp +++ b/engines/lastexpress/entities/pascale.cpp @@ -27,10 +27,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp index 6d1c5244f2..b1a176b47e 100644 --- a/engines/lastexpress/entities/rebecca.cpp +++ b/engines/lastexpress/entities/rebecca.cpp @@ -27,10 +27,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp index 6dcab7121e..63d995dc42 100644 --- a/engines/lastexpress/entities/salko.cpp +++ b/engines/lastexpress/entities/salko.cpp @@ -30,10 +30,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/servers0.cpp b/engines/lastexpress/entities/servers0.cpp index 1fec775659..989bddd662 100644 --- a/engines/lastexpress/entities/servers0.cpp +++ b/engines/lastexpress/entities/servers0.cpp @@ -26,9 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/servers1.cpp b/engines/lastexpress/entities/servers1.cpp index cd0a162755..995fbbc01b 100644 --- a/engines/lastexpress/entities/servers1.cpp +++ b/engines/lastexpress/entities/servers1.cpp @@ -26,9 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/sophie.cpp b/engines/lastexpress/entities/sophie.cpp index e0c63f7297..57bd491949 100644 --- a/engines/lastexpress/entities/sophie.cpp +++ b/engines/lastexpress/entities/sophie.cpp @@ -25,9 +25,10 @@ #include "lastexpress/game/entities.h" #include "lastexpress/game/logic.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/entities/tables.cpp b/engines/lastexpress/entities/tables.cpp index 702b636c31..06ea4c597c 100644 --- a/engines/lastexpress/entities/tables.cpp +++ b/engines/lastexpress/entities/tables.cpp @@ -26,10 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp index 2f60b448ba..c8901b3e30 100644 --- a/engines/lastexpress/entities/tatiana.cpp +++ b/engines/lastexpress/entities/tatiana.cpp @@ -32,10 +32,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 74eed63bbf..7d90ea5e64 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -30,9 +30,9 @@ #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/state.h" -#include "lastexpress/game/sound.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp index a7fbc7cf32..22f41afa92 100644 --- a/engines/lastexpress/entities/vassili.cpp +++ b/engines/lastexpress/entities/vassili.cpp @@ -32,10 +32,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp index c18137c835..8246f85145 100644 --- a/engines/lastexpress/entities/verges.cpp +++ b/engines/lastexpress/entities/verges.cpp @@ -29,10 +29,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp index 74bc0d3ea9..7a1f1d3195 100644 --- a/engines/lastexpress/entities/vesna.cpp +++ b/engines/lastexpress/entities/vesna.cpp @@ -30,9 +30,10 @@ #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/entities/yasmin.cpp b/engines/lastexpress/entities/yasmin.cpp index 7e8b2f7348..45e5e11568 100644 --- a/engines/lastexpress/entities/yasmin.cpp +++ b/engines/lastexpress/entities/yasmin.cpp @@ -26,9 +26,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" +#include "lastexpress/sound/sound.h" + #include "lastexpress/lastexpress.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/fight/fighter.cpp b/engines/lastexpress/fight/fighter.cpp index fcd69183fb..bae7728a2b 100644 --- a/engines/lastexpress/fight/fighter.cpp +++ b/engines/lastexpress/fight/fighter.cpp @@ -25,7 +25,8 @@ #include "lastexpress/data/sequence.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" + +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/fight/fighter_anna.cpp b/engines/lastexpress/fight/fighter_anna.cpp index feb35515a0..c7660cab1a 100644 --- a/engines/lastexpress/fight/fighter_anna.cpp +++ b/engines/lastexpress/fight/fighter_anna.cpp @@ -24,9 +24,8 @@ #include "lastexpress/data/sequence.h" -#include "lastexpress/game/sound.h" - #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/fight/fighter_ivo.cpp b/engines/lastexpress/fight/fighter_ivo.cpp index 9988fca790..87a52c6be4 100644 --- a/engines/lastexpress/fight/fighter_ivo.cpp +++ b/engines/lastexpress/fight/fighter_ivo.cpp @@ -24,9 +24,8 @@ #include "lastexpress/data/sequence.h" -#include "lastexpress/game/sound.h" - #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/fight/fighter_milos.cpp b/engines/lastexpress/fight/fighter_milos.cpp index 82c965caf3..9f8e726165 100644 --- a/engines/lastexpress/fight/fighter_milos.cpp +++ b/engines/lastexpress/fight/fighter_milos.cpp @@ -25,9 +25,8 @@ #include "lastexpress/data/cursor.h" #include "lastexpress/data/sequence.h" -#include "lastexpress/game/sound.h" - #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/fight/fighter_salko.cpp b/engines/lastexpress/fight/fighter_salko.cpp index 166f7c3899..1082674235 100644 --- a/engines/lastexpress/fight/fighter_salko.cpp +++ b/engines/lastexpress/fight/fighter_salko.cpp @@ -25,9 +25,8 @@ #include "lastexpress/data/cursor.h" #include "lastexpress/data/sequence.h" -#include "lastexpress/game/sound.h" - #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/fight/fighter_vesna.cpp b/engines/lastexpress/fight/fighter_vesna.cpp index 075f158bda..02aaa1c16c 100644 --- a/engines/lastexpress/fight/fighter_vesna.cpp +++ b/engines/lastexpress/fight/fighter_vesna.cpp @@ -25,9 +25,8 @@ #include "lastexpress/data/cursor.h" #include "lastexpress/data/sequence.h" -#include "lastexpress/game/sound.h" - #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index f195825d6e..2c7b5b3c32 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -39,10 +39,10 @@ #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 8dd2c26c19..a56531891b 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -68,10 +68,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index c3a10225e9..d902c8860a 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -28,12 +28,12 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/menu/menu.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index cdde2a0e0a..2b7b1cfa50 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -42,12 +42,12 @@ #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/menu/menu.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 408f48044c..65efc80265 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -31,10 +31,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/object.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp deleted file mode 100644 index bc4f71e18d..0000000000 --- a/engines/lastexpress/game/sound.cpp +++ /dev/null @@ -1,1379 +0,0 @@ -/* 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 "lastexpress/game/sound.h" - -#include "lastexpress/game/action.h" -#include "lastexpress/game/entities.h" -#include "lastexpress/game/inventory.h" -#include "lastexpress/game/logic.h" -#include "lastexpress/game/object.h" -#include "lastexpress/game/savepoint.h" -#include "lastexpress/game/state.h" - -#include "lastexpress/sound/entry.h" -#include "lastexpress/sound/queue.h" - -#include "lastexpress/helpers.h" -#include "lastexpress/graphics.h" -#include "lastexpress/lastexpress.h" -#include "lastexpress/resource.h" - -namespace LastExpress { - -// Letters & messages -static const char *const messages[24] = { - "", - "TXT1001", // 1 - "TXT1001A", // 2 - "TXT1011", // 3 - "TXT1012", // 4 - "TXT1013", // 5 - "TXT1014", // 6 - "TXT1020", // 7 - "TXT1030", // 8 - "END1009B", // 50 - "END1046", // 51 - "END1047", // 52 - "END1112", // 53 - "END1112A", // 54 - "END1503", // 55 - "END1505A", // 56 - "END1505B", // 57 - "END1610", // 58 - "END1612A", // 59 - "END1612C", // 61 - "END1612D", // 62 - "ENDALRM1", // 63 - "ENDALRM2", // 64 - "ENDALRM3" // 65 -}; - -static const char *const cities[17] = { - "EPERNAY", - "CHALONS", - "BARLEDUC", - "NANCY", - "LUNEVILL", - "AVRICOUR", - "DEUTSCHA", - "STRASBOU", - "BADENOOS", - "SALZBURG", - "ATTNANG", - "WELS", - "LINZ", - "VIENNA", - "POZSONY", - "GALANTA", - "POLICE" -}; - -static const char *const locomotiveSounds[5] = { - "ZFX1005", - "ZFX1006", - "ZFX1007", - "ZFX1007A", - "ZFX1007B" -}; - -static const SoundFlag soundFlags[32] = { - kFlagDefault, - kFlag15, - kFlag14, - kFlag13, - kFlag12, - kFlag11, kFlag11, - kFlag10, kFlag10, - kFlag9, kFlag9, - kFlag8, kFlag8, - kFlag7, kFlag7, kFlag7, - kFlag6, kFlag6, kFlag6, - kFlag5, kFlag5, kFlag5, kFlag5, - kFlag4, kFlag4, kFlag4, kFlag4, - kFlag3, kFlag3, kFlag3, kFlag3, kFlag3 -}; - -SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine) { - _loopingSoundDuration = 0; - - _queue = new SoundQueue(engine); - - memset(&_lastWarning, 0, sizeof(_lastWarning)); - - // Initialize unknown data - _data0 = 0; - _data1 = 0; - _data2 = 0; -} - -SoundManager::~SoundManager() { - SAFE_DELETE(_queue); - - // Zero passed pointers - _engine = NULL; -} - -////////////////////////////////////////////////////////////////////////// -// Sound-related functions -////////////////////////////////////////////////////////////////////////// -void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundFlag flag, byte a4) { - if (_queue->isBuffered(entity) && entity) - _queue->removeFromQueue(entity); - - SoundFlag currentFlag = (flag == -1) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000); - - // Add .SND at the end of the filename if needed - if (!filename.contains('.')) - filename += ".SND"; - - if (!playSoundWithSubtitles(filename, currentFlag, entity, a4)) - if (entity) - getSavePoints()->push(kEntityPlayer, entity, kActionEndSound); -} - -bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4) { - SoundEntry *entry = new SoundEntry(_engine); - - entry->open(filename, flag, 30); - entry->_entity = entity; - - if (a4) { - entry->_field_48 = _data2 + 2 * a4; - entry->_status.status |= kSoundStatus_8000; - } else { - // Get subtitles name - while (filename.size() > 4) - filename.deleteLastChar(); - - entry->showSubtitle(filename); - entry->updateState(); - } - - return (entry->getType() != kSoundTypeNone); -} - -void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { - int values[5]; - - if (getEntityData(entity)->car != getEntityData(kEntityPlayer)->car) - return; - - if (getEntities()->isInSalon(entity) != getEntities()->isInSalon(kEntityPlayer)) - return; - - int _action = (int)action; - SoundFlag flag = getSoundFlag(entity); - - switch (action) { - case 36: { - int _param3 = (flag <= 9) ? flag + 7 : 16; - - if (_param3 > 7) { - _data0 = (uint)_param3; - _data1 = _data2 + 2 * a3; - } - break; - } - - case 37: - _data0 = 7; - _data1 = _data2 + 2 * a3; - break; - - case 150: - case 156: - case 162: - case 168: - case 188: - case 198: - _action += 1 + (int)rnd(5); - break; - - case 174: - case 184: - case 194: - _action += 1 + (int)rnd(3); - break; - - case 180: - _action += 1 + (int)rnd(4); - break; - - case 246: - values[0] = 0; - values[1] = 104; - values[2] = 105; - values[3] = 106; - values[4] = 116; - _action = values[rnd(5)]; - break; - - case 247: - values[0] = 11; - values[1] = 123; - values[2] = 124; - _action = values[rnd(3)]; - break; - - case 248: - values[0] = 0; - values[1] = 103; - values[2] = 108; - values[3] = 109; - _action = values[rnd(4)]; - break; - - case 249: - values[0] = 0; - values[1] = 56; - values[2] = 112; - values[3] = 113; - _action = values[rnd(4)]; - break; - - case 250: - values[0] = 0; - values[1] = 107; - values[2] = 115; - values[3] = 117; - _action = values[rnd(4)]; - break; - - case 251: - values[0] = 0; - values[1] = 11; - values[2] = 56; - values[3] = 113; - _action = values[rnd(4)]; - break; - - case 252: - values[0] = 0; - values[1] = 6; - values[2] = 109; - values[3] = 121; - _action = values[rnd(4)]; - break; - - case 254: - values[0] = 0; - values[1] = 104; - values[2] = 120; - values[3] = 121; - _action = values[rnd(4)]; - break; - - case 255: - values[0] = 0; - values[1] = 106; - values[2] = 115; - _action = values[rnd(3)]; - break; - - default: - break; - } - - if (_action && flag) - playSoundWithSubtitles(Common::String::format("LIB%03d.SND", _action), flag, kEntityPlayer, a3); -} - -void SoundManager::playSteam(CityIndex index) { - if (index >= ARRAYSIZE(cities)) - error("SoundManager::playSteam: invalid city index (was %d, max %d)", index, ARRAYSIZE(cities)); - - _queue->resetState(kSoundState2); - - if (!_queue->getEntry(kSoundType1)) - playSoundWithSubtitles("STEAM.SND", kFlagSteam, kEntitySteam); - - // Get the new sound entry and show subtitles - SoundEntry *entry = _queue->getEntry(kSoundType1); - if (entry) - entry->showSubtitle(cities[index]); -} - -void SoundManager::playFightSound(byte action, byte a4) { - int _action = (int)action; - int values[5]; - - switch (action) { - default: - break; - - case 174: - case 184: - case 194: - values[0] = action + 1; - values[1] = action + 2; - values[2] = action + 3; - _action = values[rnd(3)]; - break; - - case 180: - values[0] = action + 1; - values[1] = action + 2; - values[2] = action + 3; - values[3] = action + 4; - _action = values[rnd(4)]; - break; - - case 150: - case 156: - case 162: - case 168: - case 188: - case 198: - values[0] = action + 1; - values[1] = action + 2; - values[2] = action + 3; - values[3] = action + 4; - values[4] = action + 5; - _action = values[rnd(5)]; - break; - } - - if (_action) - playSound(kEntityTrain, Common::String::format("LIB%03d.SND", _action), kFlagDefault, a4); -} - -void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4) { - if (_queue->isBuffered(getDialogName(entityDialog))) - _queue->removeFromQueue(getDialogName(entityDialog)); - - playSound(entity, getDialogName(entityDialog), flag, a4); -} - -void SoundManager::playLocomotiveSound() { - playSound(kEntityPlayer, locomotiveSounds[rnd(5)], (SoundFlag)(rnd(15) + 2)); -} - -const char *SoundManager::getDialogName(EntityIndex entity) const { - switch (entity) { - case kEntityAnna: - if (getEvent(kEventAnnaDialogGoToJerusalem)) - return "XANN12"; - - if (getEvent(kEventLocomotiveRestartTrain)) - return "XANN11"; - - if (getEvent(kEventAnnaBaggageTies) || getEvent(kEventAnnaBaggageTies2) || getEvent(kEventAnnaBaggageTies3) || getEvent(kEventAnnaBaggageTies4)) - return "XANN10"; - - if (getEvent(kEventAnnaTired) || getEvent(kEventAnnaTiredKiss)) - return "XANN9"; - - if (getEvent(kEventAnnaBaggageArgument)) - return "XANN8"; - - if (getEvent(kEventKronosVisit)) - return "XANN7"; - - if (getEvent(kEventAbbotIntroduction)) - return "XANN6A"; - - if (getEvent(kEventVassiliSeizure)) - return "XANN6"; - - if (getEvent(kEventAugustPresentAnna) || getEvent(kEventAugustPresentAnnaFirstIntroduction)) - return "XANN5"; - - if (getProgress().field_60) - return "XANN4"; - - if (getEvent(kEventAnnaGiveScarf) || getEvent(kEventAnnaGiveScarfDiner) || getEvent(kEventAnnaGiveScarfSalon) - || getEvent(kEventAnnaGiveScarfMonogram) || getEvent(kEventAnnaGiveScarfDinerMonogram) || getEvent(kEventAnnaGiveScarfSalonMonogram)) - return "XANN3"; - - if (getEvent(kEventDinerMindJoin)) - return "XANN2"; - - if (getEvent(kEventGotALight) || getEvent(kEventGotALightD)) - return "XANN1"; - - break; - - case kEntityAugust: - if (getEvent(kEventAugustTalkCigar)) - return "XAUG6"; - - if (getEvent(kEventAugustBringBriefcase)) - return "XAUG5"; - - // Getting closer to Vienna... - if (getState()->time > kTime2200500 && !getEvent(kEventAugustMerchandise)) - return "XAUG4A"; - - if (getEvent(kEventAugustMerchandise)) - return "XAUG4"; - - if (getEvent(kEventDinerAugust) || getEvent(kEventDinerAugustAlexeiBackground) || getEvent(kEventMeetAugustTylerCompartment) - || getEvent(kEventMeetAugustTylerCompartmentBed) || getEvent(kEventMeetAugustHisCompartment) || getEvent(kEventMeetAugustHisCompartmentBed)) - return "XAUG3"; - - if (getEvent(kEventAugustPresentAnnaFirstIntroduction)) - return "XAUG2"; - - if (getProgress().eventMertensAugustWaiting) - return "XAUG1"; - - break; - - case kEntityTatiana: - if (getEvent(kEventTatianaTylerCompartment)) - return "XTAT6"; - - if (getEvent(kEventTatianaCompartmentStealEgg)) - return "XTAT5"; - - if (getEvent(kEventTatianaGivePoem)) - return "XTAT3"; - - if (getProgress().field_64) - return "XTAT1"; - - break; - - case kEntityVassili: - if (getEvent(kEventCathFreePassengers)) - return "XVAS4"; - - if (getEvent(kEventVassiliCompartmentStealEgg)) - return "XVAS3"; - - if (getEvent(kEventAbbotIntroduction)) - return "XVAS2"; - - if (getEvent(kEventVassiliSeizure)) - return "XVAS1A"; - - if (getProgress().field_64) - return "XVAS1"; - - break; - - case kEntityAlexei: - if (getProgress().field_88) - return "XALX6"; - - if (getProgress().field_8C) - return "XALX5"; - - if (getProgress().field_90) - return "XALX4A"; - - if (getProgress().field_68) - return "XALX4"; - - if (getEvent(kEventAlexeiSalonPoem)) - return "XALX3"; - - if (getEvent(kEventAlexeiSalonVassili)) - return "XALX2"; - - if (getEvent(kEventAlexeiDiner) || getEvent(kEventAlexeiDinerOriginalJacket)) - return "XALX1"; - - break; - - case kEntityAbbot: - if (getEvent(kEventAbbotDrinkDefuse)) - return "XABB4"; - - if (getEvent(kEventAbbotInvitationDrink) || getEvent(kEventDefuseBomb)) - return "XABB3"; - - if (getEvent(kEventAbbotWrongCompartment) || getEvent(kEventAbbotWrongCompartmentBed)) - return "XABB2"; - - if (getEvent(kEventAbbotIntroduction)) - return "XABB1"; - - break; - - case kEntityMilos: - if (getEvent(kEventLocomotiveMilosDay) || getEvent(kEventLocomotiveMilosNight)) - return "XMIL5"; - - if (getEvent(kEventMilosCompartmentVisitTyler) && (getProgress().chapter == kChapter3 || getProgress().chapter == kChapter4)) - return "XMIL4"; - - if (getEvent(kEventMilosCorridorThanks) || getProgress().chapter == kChapter5) - return "XMIL3"; - - if (getEvent(kEventMilosCompartmentVisitAugust)) - return "XMIL2"; - - if (getEvent(kEventMilosTylerCompartmentDefeat)) - return "XMIL1"; - - break; - - case kEntityVesna: - if (getProgress().field_94) - return "XVES2"; - - if (getProgress().field_98) - return "XVES1"; - - break; - - case kEntityKronos: - if (getEvent(kEventKronosReturnBriefcase)) - return "XKRO6"; - - if (getEvent(kEventKronosBringEggCeiling) || getEvent(kEventKronosBringEgg)) - return "XKRO5"; - - if (getEvent(kEventKronosConversation) || getEvent(kEventKronosConversationFirebird)) { - ObjectLocation location = getInventory()->get(kItemFirebird)->location; - if (location != kObjectLocation6 && location != kObjectLocation5 && location != kObjectLocation2 && location != kObjectLocation1) - return "XKRO4A"; - } - - if (getEvent(kEventKronosConversationFirebird)) - return "XKRO4"; - - if (getEvent(kEventKronosConversation)) { - if (!getEvent(kEventMilosCompartmentVisitAugust)) - return "XKRO3"; - else - return "XKRO2"; - } - - if (getProgress().eventMertensKronosInvitation) - return "XKRO1"; - - break; - - case kEntityFrancois: - if (getProgress().field_9C) - return "XFRA3"; - - if (getProgress().field_A0 - || getEvent(kEventFrancoisWhistle) || getEvent(kEventFrancoisWhistleD) - || getEvent(kEventFrancoisWhistleNight) || getEvent(kEventFrancoisWhistleNightD)) - return "XFRA2"; - - if (getState()->time > kTimeParisEpernay) // Between Paris and Epernay - return "XFRA1"; - - break; - - case kEntityMmeBoutarel: - if (getProgress().field_A4) - return "XMME4"; - - if (getProgress().field_A8) - return "XMME3"; - - if (getProgress().field_A0) - return "XMME2"; - - if (getProgress().field_AC) - return "XMME1"; - - break; - - case kEntityBoutarel: - if (getProgress().eventMetBoutarel) - return "XMRB1"; - - break; - - case kEntityRebecca: - if (getProgress().field_B4) - return "XREB1A"; - - if (getProgress().field_B8) - return "XREB1"; - - break; - - case kEntitySophie: - if (getProgress().field_B0) - return "XSOP2"; - - if (getProgress().field_BC) - return "XSOP1B"; - - if (getProgress().field_B4) - return "XSOP1A"; - - if (getProgress().field_B8) - return "XSOP1"; - - break; - - case kEntityMahmud: - if (getProgress().field_C4) - return "XMAH1"; - - break; - - case kEntityYasmin: - if (getProgress().eventMetYasmin) - return "XHAR2"; - - break; - - case kEntityHadija: - if (getProgress().eventMetHadija) - return "XHAR1"; - - break; - - case kEntityAlouan: - if (getProgress().field_DC) - return "XHAR3"; - - break; - - case kEntityGendarmes: - if (getProgress().field_E0) - return "XHAR4"; - - break; - - case kEntityChapters: - if (getEvent(kEventCathDream) || getEvent(kEventCathWakingUp)) - return "XTYL3"; - - return "XTYL1"; - - default: - break; - } - - return NULL; -} - -////////////////////////////////////////////////////////////////////////// -// Letters & Messages -////////////////////////////////////////////////////////////////////////// -void SoundManager::readText(int id){ - if (!_queue->isBuffered(kEntityTables4)) - return; - - if (id < 0 || (id > 8 && id < 50) || id > 64) - error("Sound::readText - attempting to use invalid id. Valid values [1;8] - [50;64], was %d", id); - - // Get proper message file (names are stored in sequence in the array but id is [1;8] - [50;64]) - const char *text = messages[id <= 8 ? id : id - 41]; - - // Check if file is in cache for id [1;8] - if (id <= 8) - if (_queue->isBuffered(text)) - _queue->removeFromQueue(text); - - playSound(kEntityTables4, text, kFlagDefault); -} - -////////////////////////////////////////////////////////////////////////// -// Sound bites -////////////////////////////////////////////////////////////////////////// -void SoundManager::playWarningCompartment(EntityIndex entity, ObjectIndex compartment) { - -#define PLAY_WARNING(index, sound1, sound2, sound3, sound4, sound5, sound6) { \ - if (_lastWarning[index] + 450 >= getState()->timeTicks) { \ - if (rnd(2)) \ - playSound(kEntityMertens, sound1, kFlagDefault); \ - else \ - playSound(kEntityMertens, rnd(2) ? sound2 : sound3, kFlagDefault); \ - } else { \ - if (rnd(2)) \ - playSound(kEntityMertens, sound4, kFlagDefault); \ - else \ - playSound(kEntityMertens, rnd(2) ? sound5 : sound6, kFlagDefault); \ - } \ - _lastWarning[index] = getState()->timeTicks; \ -} - - if (entity != kEntityMertens && entity != kEntityCoudert) - return; - - ////////////////////////////////////////////////////////////////////////// - // Mertens - if (entity == kEntityMertens) { - - switch (compartment) { - default: - break; - - case kObjectCompartment2: - PLAY_WARNING(0, "Con1502A", "Con1500B", "Con1500C", "Con1502", "Con1500", "Con1500A"); - break; - - case kObjectCompartment3: - PLAY_WARNING(1, "Con1501A", "Con1500B", "Con1500C", "Con1501", "Con1500", "Con1500A"); - break; - - case kObjectCompartment4: - PLAY_WARNING(2, "Con1503", "Con1500B", "Con1500C", "Con1503", "Con1500", "Con1500A"); - break; - - case kObjectCompartment5: - case kObjectCompartment6: - case kObjectCompartment7: - case kObjectCompartment8: - ++_lastWarning[3]; - - switch (_lastWarning[3]) { - default: - break; - - case 1: - getSound()->playSound(kEntityMertens, "Con1503C", kFlagDefault); - break; - - case 2: - getSound()->playSound(kEntityMertens, rnd(2) ? "Con1503E" : "Con1503A", kFlagDefault); - break; - - case 3: - getSound()->playSound(kEntityMertens, rnd(2) ? "Con1503B" : "Con1503D", kFlagDefault); - _lastWarning[3] = 0; - break; - } - } - - return; - } - - ////////////////////////////////////////////////////////////////////////// - // Coudert - switch (compartment) { - default: - break; - - case kObjectCompartmentA: - if (_lastWarning[4] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1508" : "Jac1508A", kFlagDefault); - break; - - case kObjectCompartmentB: - if (_lastWarning[5] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (getProgress().field_40 || (getState()->time > kTimeCityLinz && getState()->time < kTime2133000)) - getSound()->playSound(kEntityCoudert, "Jac1507A", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, "Jac1507", kFlagDefault); - break; - - case kObjectCompartmentC: - if (_lastWarning[6] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (getProgress().chapter < kChapter3) - getSound()->playSound(kEntityCoudert, "Jac1506", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1506A" : "Jac1506B", kFlagDefault); - break; - - case kObjectCompartmentD: - if (_lastWarning[7] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - getSound()->playSound(kEntityCoudert, "Jac1505", kFlagDefault); - break; - - case kObjectCompartmentE: - if (_lastWarning[8] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (getProgress().field_40 || (getState()->time > kTime2115000 && getState()->time < kTime2133000)) { - getSound()->playSound(kEntityCoudert, "Jac1504B", kFlagDefault); - break; - } - - if (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840)) - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1504" : "Jac1504A", kFlagDefault); - break; - - case kObjectCompartmentF: - if (_lastWarning[9] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (getProgress().field_40 || (getState()->time > kTime2083500 && getState()->time < kTime2133000)) { - getSound()->playSound(kEntityCoudert, "Jac1503B", kFlagDefault); - break; - } - - if (rnd(2) || getEntities()->isInsideCompartment(kEntityAnna, kCarRedSleeping, kPosition_4070)) - getSound()->playSound(kEntityCoudert, "Jac1503", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, "Jac1503A", kFlagDefault); - break; - - case kObjectCompartmentG: - if (_lastWarning[10] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (rnd(2) || getEntities()->isInsideCompartment(kEntityMilos, kCarRedSleeping, kPosition_3050)) - getSound()->playSound(kEntityCoudert, "Jac1502", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, "Jac1502A", kFlagDefault); - break; - - case kObjectCompartmentH: - if (_lastWarning[11] + 450 >= getState()->timeTicks) { - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - break; - } - - if (getEntities()->isInsideCompartment(kEntityIvo, kCarRedSleeping, kPosition_2740)) - getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); - else - getSound()->playSound(kEntityCoudert, "Jac1501", kFlagDefault); - break; - } - - // Update ticks (Compartments A - H are indexes 4 - 11) - _lastWarning[compartment - 28] = getState()->timeTicks; -} - -void SoundManager::excuseMe(EntityIndex entity, EntityIndex entity2, SoundFlag flag) { - if (_queue->isBuffered(entity) && entity != kEntityPlayer && entity != kEntityChapters && entity != kEntityTrain) - return; - - if (entity2 == kEntityFrancois || entity2 == kEntityMax) - return; - - if (entity == kEntityFrancois && getEntityData(kEntityFrancois)->field_4A3 != 30) - return; - - if (flag == kFlagNone) - flag = getSoundFlag(entity); - - switch (entity) { - default: - break; - - case kEntityAnna: - playSound(kEntityPlayer, "ANN1107A", flag); - break; - - case kEntityAugust: - switch(rnd(4)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "AUG1100A", flag); - break; - - case 1: - playSound(kEntityPlayer, "AUG1100B", flag); - break; - - case 2: - playSound(kEntityPlayer, "AUG1100C", flag); - break; - - case 3: - playSound(kEntityPlayer, "AUG1100D", flag); - break; - } - break; - - case kEntityMertens: - if (Entities::isFemale(entity2)) { - playSound(kEntityPlayer, (rnd(2) ? "CON1111" : "CON1111A"), flag); - } else { - if (entity2 || getProgress().jacket != kJacketGreen || !rnd(2)) { - switch(rnd(3)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "CON1110A", flag); - break; - - case 1: - playSound(kEntityPlayer, "CON1110C", flag); - break; - - case 2: - playSound(kEntityPlayer, "CON1110", flag); - break; - } - } else { - if (isNight()) { - playSound(kEntityPlayer, (getProgress().field_18 == 2 ? "CON1110F" : "CON1110E")); - } else { - playSound(kEntityPlayer, "CON1110D"); - } - } - } - break; - - case kEntityCoudert: - if (Entities::isFemale(entity2)) { - playSound(kEntityPlayer, "JAC1111D", flag); - } else { - if (entity2 || getProgress().jacket != kJacketGreen || !rnd(2)) { - switch(rnd(4)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "JAC1111", flag); - break; - - case 1: - playSound(kEntityPlayer, "JAC1111A", flag); - break; - - case 2: - playSound(kEntityPlayer, "JAC1111B", flag); - break; - - case 3: - playSound(kEntityPlayer, "JAC1111C", flag); - break; - } - } else { - playSound(kEntityPlayer, "JAC1113B", flag); - } - } - break; - - case kEntityPascale: - playSound(kEntityPlayer, (rnd(2) ? "HDE1002" : "HED1002A"), flag); - break; - - case kEntityServers0: - case kEntityServers1: - switch(rnd(3)) { - default: - break; - - case 0: - playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002" : "WAT1003", flag); - break; - - case 1: - playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002A" : "WAT1003A", flag); - break; - - case 2: - playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002B" : "WAT1003B", flag); - break; - } - break; - - case kEntityVerges: - if (Entities::isFemale(entity2)) { - playSound(kEntityPlayer, (rnd(2) ? "TRA1113A" : "TRA1113B")); - } else { - playSound(kEntityPlayer, "TRA1112", flag); - } - break; - - case kEntityTatiana: - playSound(kEntityPlayer, (rnd(2) ? "TAT1102A" : "TAT1102B"), flag); - break; - - case kEntityAlexei: - playSound(kEntityPlayer, (rnd(2) ? "ALX1099C" : "ALX1099D"), flag); - break; - - case kEntityAbbot: - if (Entities::isFemale(entity2)) { - playSound(kEntityPlayer, "ABB3002C", flag); - } else { - switch(rnd(3)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "ABB3002", flag); - break; - - case 1: - playSound(kEntityPlayer, "ABB3002A", flag); - break; - - case 2: - playSound(kEntityPlayer, "ABB3002B", flag); - break; - } - } - break; - - case kEntityVesna: - switch(rnd(3)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "VES1109A", flag); - break; - - case 1: - playSound(kEntityPlayer, "VES1109B", flag); - break; - - case 2: - playSound(kEntityPlayer, "VES1109C", flag); - break; - } - break; - - case kEntityKahina: - playSound(kEntityPlayer, (rnd(2) ? "KAH1001" : "KAH1001A"), flag); - break; - - case kEntityFrancois: - case kEntityMmeBoutarel: - switch(rnd(4)) { - default: - break; - - case 0: - playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001" : "MME1103A", flag); - break; - - case 1: - playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001A" : "MME1103B", flag); - break; - - case 2: - playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001B" : "MME1103C", flag); - break; - - case 3: - playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001C" : "MME1103D", flag); - break; - } - break; - - case kEntityBoutarel: - playSound(kEntityPlayer, "MRB1104", flag); - if (flag > 2) - getProgress().eventMetBoutarel = true; - break; - - case kEntityRebecca: - playSound(kEntityPlayer, (rnd(2) ? "REB1106" : "REB110A"), flag); - break; - - case kEntitySophie: { - switch(rnd(3)) { - default: - break; - - case 0: - playSound(kEntityPlayer, "SOP1105", flag); - break; - - case 1: - playSound(kEntityPlayer, Entities::isFemale(entity2) ? "SOP1105C" : "SOP1105A", flag); - break; - - case 2: - playSound(kEntityPlayer, Entities::isFemale(entity2) ? "SOP1105D" : "SOP1105B", flag); - break; - } - break; - } - - case kEntityMahmud: - playSound(kEntityPlayer, "MAH1101", flag); - break; - - case kEntityYasmin: - playSound(kEntityPlayer, "HAR1002", flag); - if (flag > 2) - getProgress().eventMetYasmin = true; - break; - - case kEntityHadija: - playSound(kEntityPlayer, (rnd(2) ? "HAR1001" : "HAR1001A"), flag); - if (flag > 2) - getProgress().eventMetHadija = true; - break; - - case kEntityAlouan: - playSound(kEntityPlayer, "HAR1004", flag); - break; - } -} - -void SoundManager::excuseMeCath() { - switch(rnd(3)) { - default: - playSound(kEntityPlayer, "CAT1126B"); - break; - - case 1: - playSound(kEntityPlayer, "CAT1126C"); - break; - - case 2: - playSound(kEntityPlayer, "CAT1126D"); - break; - } -} - -const char *SoundManager::justCheckingCath() const { - switch(rnd(4)) { - default: - break; - - case 0: - return "CAT5001"; - - case 1: - return "CAT5001A"; - - case 2: - return "CAT5001B"; - - case 3: - return "CAT5001C"; - } - - return "CAT5001"; -} - -const char *SoundManager::wrongDoorCath() const { - switch(rnd(5)) { - default: - break; - - case 0: - return "CAT1125"; - - case 1: - return "CAT1125A"; - - case 2: - return "CAT1125B"; - - case 3: - return "CAT1125C"; - - case 4: - return "CAT1125D"; - } - - return "CAT1125"; -} - -const char *SoundManager::justAMinuteCath() const { - switch(rnd(3)) { - default: - break; - - case 0: - return "CAT1520"; - - case 1: - return "CAT1521"; - - case 2: - return "CAT1125"; // ?? is this a bug in the original? - } - - return "CAT1520"; -} - -////////////////////////////////////////////////////////////////////////// -// Sound flags -////////////////////////////////////////////////////////////////////////// -SoundFlag SoundManager::getSoundFlag(EntityIndex entity) const { - if (entity == kEntityPlayer) - return kFlagDefault; - - if (getEntityData(entity)->car != getEntityData(kEntityPlayer)->car) - return kFlagNone; - - // Compute sound value - SoundFlag ret = kFlag2; - - // Get default value if valid - int index = ABS(getEntityData(entity)->entityPosition - getEntityData(kEntityPlayer)->entityPosition) / 230; - if (index < 32) - ret = soundFlags[index]; - - if (getEntityData(entity)->location == kLocationOutsideTrain) { - if (getEntityData(entity)->car != kCarKronos - && !getEntities()->isOutsideAlexeiWindow() - && !getEntities()->isOutsideAnnaWindow()) - return kFlagNone; - - return (SoundFlag)(ret / 6); - } - - switch (getEntityData(entity)->car) { - default: - break; - - case kCarKronos: - if (getEntities()->isInKronosSalon(entity) != getEntities()->isInKronosSalon(kEntityPlayer)) - ret = (SoundFlag)(ret * 2); - break; - - case kCarGreenSleeping: - case kCarRedSleeping: - if (getEntities()->isInGreenCarEntrance(kEntityPlayer) && !getEntities()->isInKronosSalon(entity)) - ret = (SoundFlag)(ret * 2); - - if (getEntityData(kEntityPlayer)->location - && (getEntityData(entity)->entityPosition != kPosition_1 || !getEntities()->isDistanceBetweenEntities(kEntityPlayer, entity, 400))) - ret = (SoundFlag)(ret * 2); - break; - - case kCarRestaurant: - if (getEntities()->isInSalon(entity) == getEntities()->isInSalon(kEntityPlayer) - && (getEntities()->isInRestaurant(entity) != getEntities()->isInRestaurant(kEntityPlayer))) - ret = (SoundFlag)(ret * 2); - else - ret = (SoundFlag)(ret * 4); - break; - } - - return ret; -} - -////////////////////////////////////////////////////////////////////////// -// Misc -////////////////////////////////////////////////////////////////////////// -void SoundManager::playLoopingSound(int param) { - SoundEntry *entry = _queue->getEntry(kSoundType1); - - static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, - kPosition_6470, kPosition_5790, - kPosition_4840, kPosition_4070, - kPosition_3050, kPosition_2740 }; - - byte numLoops[8]; - numLoops[1] = 4; - numLoops[2] = 2; - numLoops[3] = 2; - numLoops[4] = 2; - numLoops[5] = 2; - numLoops[6] = 2; - - char tmp[80]; - tmp[0] = 0; - - int partNumber = 1; - int fnameLen = 6; - - if (_queue->getSoundState() & 1 && param >= 0x45 && param <= 0x46) { - if (_queue->getSoundState() & 2) { - strcpy(tmp, "STEAM.SND"); - - _loopingSoundDuration = 32767; - } else { - if (getEntityData(kEntityPlayer)->location == kLocationOutsideTrain) { - partNumber = 6; - } else { - if (getEntities()->isInsideCompartments(kEntityPlayer)) { - int objNum = (getEntityData(kEntityPlayer)->car - 3) < 1 ? 9 : 40; // Weird numbers - - numLoops[0] = 0; - - for (int pos = 0; pos < 8; pos++) { - if (numLoops[0]) - break; - if (getEntities()->isInsideCompartment(kEntityPlayer, getEntityData(kEntityPlayer)->car, positions[pos])) { - numLoops[0] = 1; - partNumber = (getObjects()->get((ObjectIndex)objNum).location - 2) < 1 ? 6 : 1; - } - objNum++; - } - } else { - switch (getEntityData(kEntityPlayer)->car) { - case 1: - case 6: - partNumber = 4; - break; - case 2: - case 3: - case 4: - case 5: - partNumber = 1; - break; - case 7: - partNumber = 5; - break; - case 8: - partNumber = 99; - break; - case 9: - partNumber = 3; - break; - default: - partNumber = 6; - break; - } - } - } - - if (partNumber != 99) - sprintf(tmp, "LOOP%d%c.SND", partNumber, _engine->getRandom().getRandomNumber(numLoops[partNumber] - 1) + 'A'); - } - - if (getFlags()->flag_3) - fnameLen = 5; - - if (!entry || scumm_strnicmp(entry->_name2.c_str(), tmp, fnameLen)) { - _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; - - if (partNumber != 99) { - playSoundWithSubtitles(tmp, kFlagLoopedSound, kEntitySteam); - - if (entry) - entry->update(0); - - SoundEntry *entry1 = _queue->getEntry(kSoundType1); - if (entry1) - entry1->update(7); - } - } - } -} - -} // End of namespace LastExpress diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h deleted file mode 100644 index 797e52646e..0000000000 --- a/engines/lastexpress/game/sound.h +++ /dev/null @@ -1,87 +0,0 @@ -/* 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 LASTEXPRESS_SOUND_H -#define LASTEXPRESS_SOUND_H - -#include "lastexpress/shared.h" - -#include "common/str.h" - -namespace LastExpress { - -class LastExpressEngine; -class SoundQueue; - -class SoundManager { -public: - SoundManager(LastExpressEngine *engine); - ~SoundManager(); - - // Sound playing - void playSound(EntityIndex entity, Common::String filename, SoundFlag flag = kFlagInvalid, byte a4 = 0); - bool playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4 = 0); - void playSoundEvent(EntityIndex entity, byte action, byte a3 = 0); - void playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4); - void playSteam(CityIndex index); - void playFightSound(byte action, byte a4); - void playLocomotiveSound(); - void playWarningCompartment(EntityIndex entity, ObjectIndex compartment); - void playLoopingSound(int param); - - // Dialog & Letters - void readText(int id); - const char *getDialogName(EntityIndex entity) const; - - // Sound bites - void excuseMe(EntityIndex entity, EntityIndex entity2 = kEntityPlayer, SoundFlag flag = kFlagNone); - void excuseMeCath(); - const char *justCheckingCath() const; - const char *wrongDoorCath() const; - const char *justAMinuteCath() const; - - // Flags - SoundFlag getSoundFlag(EntityIndex index) const; - - // Accessors - SoundQueue *getQueue() { return _queue; } - uint32 getData2() { return _data2; } - -private: - LastExpressEngine *_engine; - SoundQueue *_queue; - - // Compartment warnings by Mertens or Coudert - uint32 _lastWarning[12]; - - // Looping sound - int _loopingSoundDuration; - - // Unknown data - uint32 _data0; - uint32 _data1; - uint32 _data2; -}; - -} // End of namespace LastExpress - -#endif // LASTEXPRESS_SOUND_H diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 2829f60740..5d83527525 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -28,11 +28,11 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/scenes.h" #include "lastexpress/game/state.h" -#include "lastexpress/game/sound.h" #include "lastexpress/menu/menu.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index 288e53fc11..bfead02ad0 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -35,13 +35,13 @@ #include "lastexpress/game/savegame.h" #include "lastexpress/game/savepoint.h" #include "lastexpress/game/scenes.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/menu/clock.h" #include "lastexpress/menu/trainline.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/module.mk b/engines/lastexpress/module.mk index 355ecba33b..a11a7c4b67 100644 --- a/engines/lastexpress/module.mk +++ b/engines/lastexpress/module.mk @@ -61,13 +61,13 @@ MODULE_OBJS := \ game/savegame.o \ game/savepoint.o \ game/scenes.o \ - game/sound.o \ game/state.o \ menu/clock.o \ menu/menu.o \ menu/trainline.o \ sound/entry.o \ sound/queue.o \ + sound/sound.o \ debug.o \ detection.o \ graphics.o \ diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 817416110e..5cdcc15d5a 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -24,10 +24,10 @@ #include "lastexpress/game/logic.h" #include "lastexpress/game/savepoint.h" -#include "lastexpress/game/sound.h" #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" +#include "lastexpress/sound/sound.h" #include "lastexpress/graphics.h" #include "lastexpress/helpers.h" diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp new file mode 100644 index 0000000000..16e502ad5a --- /dev/null +++ b/engines/lastexpress/sound/sound.cpp @@ -0,0 +1,1379 @@ +/* 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 "lastexpress/sound/sound.h" + +#include "lastexpress/game/action.h" +#include "lastexpress/game/entities.h" +#include "lastexpress/game/inventory.h" +#include "lastexpress/game/logic.h" +#include "lastexpress/game/object.h" +#include "lastexpress/game/savepoint.h" +#include "lastexpress/game/state.h" + +#include "lastexpress/sound/entry.h" +#include "lastexpress/sound/queue.h" + +#include "lastexpress/helpers.h" +#include "lastexpress/graphics.h" +#include "lastexpress/lastexpress.h" +#include "lastexpress/resource.h" + +namespace LastExpress { + +// Letters & messages +static const char *const messages[24] = { + "", + "TXT1001", // 1 + "TXT1001A", // 2 + "TXT1011", // 3 + "TXT1012", // 4 + "TXT1013", // 5 + "TXT1014", // 6 + "TXT1020", // 7 + "TXT1030", // 8 + "END1009B", // 50 + "END1046", // 51 + "END1047", // 52 + "END1112", // 53 + "END1112A", // 54 + "END1503", // 55 + "END1505A", // 56 + "END1505B", // 57 + "END1610", // 58 + "END1612A", // 59 + "END1612C", // 61 + "END1612D", // 62 + "ENDALRM1", // 63 + "ENDALRM2", // 64 + "ENDALRM3" // 65 +}; + +static const char *const cities[17] = { + "EPERNAY", + "CHALONS", + "BARLEDUC", + "NANCY", + "LUNEVILL", + "AVRICOUR", + "DEUTSCHA", + "STRASBOU", + "BADENOOS", + "SALZBURG", + "ATTNANG", + "WELS", + "LINZ", + "VIENNA", + "POZSONY", + "GALANTA", + "POLICE" +}; + +static const char *const locomotiveSounds[5] = { + "ZFX1005", + "ZFX1006", + "ZFX1007", + "ZFX1007A", + "ZFX1007B" +}; + +static const SoundFlag soundFlags[32] = { + kFlagDefault, + kFlag15, + kFlag14, + kFlag13, + kFlag12, + kFlag11, kFlag11, + kFlag10, kFlag10, + kFlag9, kFlag9, + kFlag8, kFlag8, + kFlag7, kFlag7, kFlag7, + kFlag6, kFlag6, kFlag6, + kFlag5, kFlag5, kFlag5, kFlag5, + kFlag4, kFlag4, kFlag4, kFlag4, + kFlag3, kFlag3, kFlag3, kFlag3, kFlag3 +}; + +SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine) { + _loopingSoundDuration = 0; + + _queue = new SoundQueue(engine); + + memset(&_lastWarning, 0, sizeof(_lastWarning)); + + // Initialize unknown data + _data0 = 0; + _data1 = 0; + _data2 = 0; +} + +SoundManager::~SoundManager() { + SAFE_DELETE(_queue); + + // Zero passed pointers + _engine = NULL; +} + +////////////////////////////////////////////////////////////////////////// +// Sound-related functions +////////////////////////////////////////////////////////////////////////// +void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundFlag flag, byte a4) { + if (_queue->isBuffered(entity) && entity) + _queue->removeFromQueue(entity); + + SoundFlag currentFlag = (flag == -1) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000); + + // Add .SND at the end of the filename if needed + if (!filename.contains('.')) + filename += ".SND"; + + if (!playSoundWithSubtitles(filename, currentFlag, entity, a4)) + if (entity) + getSavePoints()->push(kEntityPlayer, entity, kActionEndSound); +} + +bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4) { + SoundEntry *entry = new SoundEntry(_engine); + + entry->open(filename, flag, 30); + entry->_entity = entity; + + if (a4) { + entry->_field_48 = _data2 + 2 * a4; + entry->_status.status |= kSoundStatus_8000; + } else { + // Get subtitles name + while (filename.size() > 4) + filename.deleteLastChar(); + + entry->showSubtitle(filename); + entry->updateState(); + } + + return (entry->getType() != kSoundTypeNone); +} + +void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { + int values[5]; + + if (getEntityData(entity)->car != getEntityData(kEntityPlayer)->car) + return; + + if (getEntities()->isInSalon(entity) != getEntities()->isInSalon(kEntityPlayer)) + return; + + int _action = (int)action; + SoundFlag flag = getSoundFlag(entity); + + switch (action) { + case 36: { + int _param3 = (flag <= 9) ? flag + 7 : 16; + + if (_param3 > 7) { + _data0 = (uint)_param3; + _data1 = _data2 + 2 * a3; + } + break; + } + + case 37: + _data0 = 7; + _data1 = _data2 + 2 * a3; + break; + + case 150: + case 156: + case 162: + case 168: + case 188: + case 198: + _action += 1 + (int)rnd(5); + break; + + case 174: + case 184: + case 194: + _action += 1 + (int)rnd(3); + break; + + case 180: + _action += 1 + (int)rnd(4); + break; + + case 246: + values[0] = 0; + values[1] = 104; + values[2] = 105; + values[3] = 106; + values[4] = 116; + _action = values[rnd(5)]; + break; + + case 247: + values[0] = 11; + values[1] = 123; + values[2] = 124; + _action = values[rnd(3)]; + break; + + case 248: + values[0] = 0; + values[1] = 103; + values[2] = 108; + values[3] = 109; + _action = values[rnd(4)]; + break; + + case 249: + values[0] = 0; + values[1] = 56; + values[2] = 112; + values[3] = 113; + _action = values[rnd(4)]; + break; + + case 250: + values[0] = 0; + values[1] = 107; + values[2] = 115; + values[3] = 117; + _action = values[rnd(4)]; + break; + + case 251: + values[0] = 0; + values[1] = 11; + values[2] = 56; + values[3] = 113; + _action = values[rnd(4)]; + break; + + case 252: + values[0] = 0; + values[1] = 6; + values[2] = 109; + values[3] = 121; + _action = values[rnd(4)]; + break; + + case 254: + values[0] = 0; + values[1] = 104; + values[2] = 120; + values[3] = 121; + _action = values[rnd(4)]; + break; + + case 255: + values[0] = 0; + values[1] = 106; + values[2] = 115; + _action = values[rnd(3)]; + break; + + default: + break; + } + + if (_action && flag) + playSoundWithSubtitles(Common::String::format("LIB%03d.SND", _action), flag, kEntityPlayer, a3); +} + +void SoundManager::playSteam(CityIndex index) { + if (index >= ARRAYSIZE(cities)) + error("SoundManager::playSteam: invalid city index (was %d, max %d)", index, ARRAYSIZE(cities)); + + _queue->resetState(kSoundState2); + + if (!_queue->getEntry(kSoundType1)) + playSoundWithSubtitles("STEAM.SND", kFlagSteam, kEntitySteam); + + // Get the new sound entry and show subtitles + SoundEntry *entry = _queue->getEntry(kSoundType1); + if (entry) + entry->showSubtitle(cities[index]); +} + +void SoundManager::playFightSound(byte action, byte a4) { + int _action = (int)action; + int values[5]; + + switch (action) { + default: + break; + + case 174: + case 184: + case 194: + values[0] = action + 1; + values[1] = action + 2; + values[2] = action + 3; + _action = values[rnd(3)]; + break; + + case 180: + values[0] = action + 1; + values[1] = action + 2; + values[2] = action + 3; + values[3] = action + 4; + _action = values[rnd(4)]; + break; + + case 150: + case 156: + case 162: + case 168: + case 188: + case 198: + values[0] = action + 1; + values[1] = action + 2; + values[2] = action + 3; + values[3] = action + 4; + values[4] = action + 5; + _action = values[rnd(5)]; + break; + } + + if (_action) + playSound(kEntityTrain, Common::String::format("LIB%03d.SND", _action), kFlagDefault, a4); +} + +void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4) { + if (_queue->isBuffered(getDialogName(entityDialog))) + _queue->removeFromQueue(getDialogName(entityDialog)); + + playSound(entity, getDialogName(entityDialog), flag, a4); +} + +void SoundManager::playLocomotiveSound() { + playSound(kEntityPlayer, locomotiveSounds[rnd(5)], (SoundFlag)(rnd(15) + 2)); +} + +const char *SoundManager::getDialogName(EntityIndex entity) const { + switch (entity) { + case kEntityAnna: + if (getEvent(kEventAnnaDialogGoToJerusalem)) + return "XANN12"; + + if (getEvent(kEventLocomotiveRestartTrain)) + return "XANN11"; + + if (getEvent(kEventAnnaBaggageTies) || getEvent(kEventAnnaBaggageTies2) || getEvent(kEventAnnaBaggageTies3) || getEvent(kEventAnnaBaggageTies4)) + return "XANN10"; + + if (getEvent(kEventAnnaTired) || getEvent(kEventAnnaTiredKiss)) + return "XANN9"; + + if (getEvent(kEventAnnaBaggageArgument)) + return "XANN8"; + + if (getEvent(kEventKronosVisit)) + return "XANN7"; + + if (getEvent(kEventAbbotIntroduction)) + return "XANN6A"; + + if (getEvent(kEventVassiliSeizure)) + return "XANN6"; + + if (getEvent(kEventAugustPresentAnna) || getEvent(kEventAugustPresentAnnaFirstIntroduction)) + return "XANN5"; + + if (getProgress().field_60) + return "XANN4"; + + if (getEvent(kEventAnnaGiveScarf) || getEvent(kEventAnnaGiveScarfDiner) || getEvent(kEventAnnaGiveScarfSalon) + || getEvent(kEventAnnaGiveScarfMonogram) || getEvent(kEventAnnaGiveScarfDinerMonogram) || getEvent(kEventAnnaGiveScarfSalonMonogram)) + return "XANN3"; + + if (getEvent(kEventDinerMindJoin)) + return "XANN2"; + + if (getEvent(kEventGotALight) || getEvent(kEventGotALightD)) + return "XANN1"; + + break; + + case kEntityAugust: + if (getEvent(kEventAugustTalkCigar)) + return "XAUG6"; + + if (getEvent(kEventAugustBringBriefcase)) + return "XAUG5"; + + // Getting closer to Vienna... + if (getState()->time > kTime2200500 && !getEvent(kEventAugustMerchandise)) + return "XAUG4A"; + + if (getEvent(kEventAugustMerchandise)) + return "XAUG4"; + + if (getEvent(kEventDinerAugust) || getEvent(kEventDinerAugustAlexeiBackground) || getEvent(kEventMeetAugustTylerCompartment) + || getEvent(kEventMeetAugustTylerCompartmentBed) || getEvent(kEventMeetAugustHisCompartment) || getEvent(kEventMeetAugustHisCompartmentBed)) + return "XAUG3"; + + if (getEvent(kEventAugustPresentAnnaFirstIntroduction)) + return "XAUG2"; + + if (getProgress().eventMertensAugustWaiting) + return "XAUG1"; + + break; + + case kEntityTatiana: + if (getEvent(kEventTatianaTylerCompartment)) + return "XTAT6"; + + if (getEvent(kEventTatianaCompartmentStealEgg)) + return "XTAT5"; + + if (getEvent(kEventTatianaGivePoem)) + return "XTAT3"; + + if (getProgress().field_64) + return "XTAT1"; + + break; + + case kEntityVassili: + if (getEvent(kEventCathFreePassengers)) + return "XVAS4"; + + if (getEvent(kEventVassiliCompartmentStealEgg)) + return "XVAS3"; + + if (getEvent(kEventAbbotIntroduction)) + return "XVAS2"; + + if (getEvent(kEventVassiliSeizure)) + return "XVAS1A"; + + if (getProgress().field_64) + return "XVAS1"; + + break; + + case kEntityAlexei: + if (getProgress().field_88) + return "XALX6"; + + if (getProgress().field_8C) + return "XALX5"; + + if (getProgress().field_90) + return "XALX4A"; + + if (getProgress().field_68) + return "XALX4"; + + if (getEvent(kEventAlexeiSalonPoem)) + return "XALX3"; + + if (getEvent(kEventAlexeiSalonVassili)) + return "XALX2"; + + if (getEvent(kEventAlexeiDiner) || getEvent(kEventAlexeiDinerOriginalJacket)) + return "XALX1"; + + break; + + case kEntityAbbot: + if (getEvent(kEventAbbotDrinkDefuse)) + return "XABB4"; + + if (getEvent(kEventAbbotInvitationDrink) || getEvent(kEventDefuseBomb)) + return "XABB3"; + + if (getEvent(kEventAbbotWrongCompartment) || getEvent(kEventAbbotWrongCompartmentBed)) + return "XABB2"; + + if (getEvent(kEventAbbotIntroduction)) + return "XABB1"; + + break; + + case kEntityMilos: + if (getEvent(kEventLocomotiveMilosDay) || getEvent(kEventLocomotiveMilosNight)) + return "XMIL5"; + + if (getEvent(kEventMilosCompartmentVisitTyler) && (getProgress().chapter == kChapter3 || getProgress().chapter == kChapter4)) + return "XMIL4"; + + if (getEvent(kEventMilosCorridorThanks) || getProgress().chapter == kChapter5) + return "XMIL3"; + + if (getEvent(kEventMilosCompartmentVisitAugust)) + return "XMIL2"; + + if (getEvent(kEventMilosTylerCompartmentDefeat)) + return "XMIL1"; + + break; + + case kEntityVesna: + if (getProgress().field_94) + return "XVES2"; + + if (getProgress().field_98) + return "XVES1"; + + break; + + case kEntityKronos: + if (getEvent(kEventKronosReturnBriefcase)) + return "XKRO6"; + + if (getEvent(kEventKronosBringEggCeiling) || getEvent(kEventKronosBringEgg)) + return "XKRO5"; + + if (getEvent(kEventKronosConversation) || getEvent(kEventKronosConversationFirebird)) { + ObjectLocation location = getInventory()->get(kItemFirebird)->location; + if (location != kObjectLocation6 && location != kObjectLocation5 && location != kObjectLocation2 && location != kObjectLocation1) + return "XKRO4A"; + } + + if (getEvent(kEventKronosConversationFirebird)) + return "XKRO4"; + + if (getEvent(kEventKronosConversation)) { + if (!getEvent(kEventMilosCompartmentVisitAugust)) + return "XKRO3"; + else + return "XKRO2"; + } + + if (getProgress().eventMertensKronosInvitation) + return "XKRO1"; + + break; + + case kEntityFrancois: + if (getProgress().field_9C) + return "XFRA3"; + + if (getProgress().field_A0 + || getEvent(kEventFrancoisWhistle) || getEvent(kEventFrancoisWhistleD) + || getEvent(kEventFrancoisWhistleNight) || getEvent(kEventFrancoisWhistleNightD)) + return "XFRA2"; + + if (getState()->time > kTimeParisEpernay) // Between Paris and Epernay + return "XFRA1"; + + break; + + case kEntityMmeBoutarel: + if (getProgress().field_A4) + return "XMME4"; + + if (getProgress().field_A8) + return "XMME3"; + + if (getProgress().field_A0) + return "XMME2"; + + if (getProgress().field_AC) + return "XMME1"; + + break; + + case kEntityBoutarel: + if (getProgress().eventMetBoutarel) + return "XMRB1"; + + break; + + case kEntityRebecca: + if (getProgress().field_B4) + return "XREB1A"; + + if (getProgress().field_B8) + return "XREB1"; + + break; + + case kEntitySophie: + if (getProgress().field_B0) + return "XSOP2"; + + if (getProgress().field_BC) + return "XSOP1B"; + + if (getProgress().field_B4) + return "XSOP1A"; + + if (getProgress().field_B8) + return "XSOP1"; + + break; + + case kEntityMahmud: + if (getProgress().field_C4) + return "XMAH1"; + + break; + + case kEntityYasmin: + if (getProgress().eventMetYasmin) + return "XHAR2"; + + break; + + case kEntityHadija: + if (getProgress().eventMetHadija) + return "XHAR1"; + + break; + + case kEntityAlouan: + if (getProgress().field_DC) + return "XHAR3"; + + break; + + case kEntityGendarmes: + if (getProgress().field_E0) + return "XHAR4"; + + break; + + case kEntityChapters: + if (getEvent(kEventCathDream) || getEvent(kEventCathWakingUp)) + return "XTYL3"; + + return "XTYL1"; + + default: + break; + } + + return NULL; +} + +////////////////////////////////////////////////////////////////////////// +// Letters & Messages +////////////////////////////////////////////////////////////////////////// +void SoundManager::readText(int id){ + if (!_queue->isBuffered(kEntityTables4)) + return; + + if (id < 0 || (id > 8 && id < 50) || id > 64) + error("Sound::readText - attempting to use invalid id. Valid values [1;8] - [50;64], was %d", id); + + // Get proper message file (names are stored in sequence in the array but id is [1;8] - [50;64]) + const char *text = messages[id <= 8 ? id : id - 41]; + + // Check if file is in cache for id [1;8] + if (id <= 8) + if (_queue->isBuffered(text)) + _queue->removeFromQueue(text); + + playSound(kEntityTables4, text, kFlagDefault); +} + +////////////////////////////////////////////////////////////////////////// +// Sound bites +////////////////////////////////////////////////////////////////////////// +void SoundManager::playWarningCompartment(EntityIndex entity, ObjectIndex compartment) { + +#define PLAY_WARNING(index, sound1, sound2, sound3, sound4, sound5, sound6) { \ + if (_lastWarning[index] + 450 >= getState()->timeTicks) { \ + if (rnd(2)) \ + playSound(kEntityMertens, sound1, kFlagDefault); \ + else \ + playSound(kEntityMertens, rnd(2) ? sound2 : sound3, kFlagDefault); \ + } else { \ + if (rnd(2)) \ + playSound(kEntityMertens, sound4, kFlagDefault); \ + else \ + playSound(kEntityMertens, rnd(2) ? sound5 : sound6, kFlagDefault); \ + } \ + _lastWarning[index] = getState()->timeTicks; \ +} + + if (entity != kEntityMertens && entity != kEntityCoudert) + return; + + ////////////////////////////////////////////////////////////////////////// + // Mertens + if (entity == kEntityMertens) { + + switch (compartment) { + default: + break; + + case kObjectCompartment2: + PLAY_WARNING(0, "Con1502A", "Con1500B", "Con1500C", "Con1502", "Con1500", "Con1500A"); + break; + + case kObjectCompartment3: + PLAY_WARNING(1, "Con1501A", "Con1500B", "Con1500C", "Con1501", "Con1500", "Con1500A"); + break; + + case kObjectCompartment4: + PLAY_WARNING(2, "Con1503", "Con1500B", "Con1500C", "Con1503", "Con1500", "Con1500A"); + break; + + case kObjectCompartment5: + case kObjectCompartment6: + case kObjectCompartment7: + case kObjectCompartment8: + ++_lastWarning[3]; + + switch (_lastWarning[3]) { + default: + break; + + case 1: + getSound()->playSound(kEntityMertens, "Con1503C", kFlagDefault); + break; + + case 2: + getSound()->playSound(kEntityMertens, rnd(2) ? "Con1503E" : "Con1503A", kFlagDefault); + break; + + case 3: + getSound()->playSound(kEntityMertens, rnd(2) ? "Con1503B" : "Con1503D", kFlagDefault); + _lastWarning[3] = 0; + break; + } + } + + return; + } + + ////////////////////////////////////////////////////////////////////////// + // Coudert + switch (compartment) { + default: + break; + + case kObjectCompartmentA: + if (_lastWarning[4] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1508" : "Jac1508A", kFlagDefault); + break; + + case kObjectCompartmentB: + if (_lastWarning[5] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (getProgress().field_40 || (getState()->time > kTimeCityLinz && getState()->time < kTime2133000)) + getSound()->playSound(kEntityCoudert, "Jac1507A", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, "Jac1507", kFlagDefault); + break; + + case kObjectCompartmentC: + if (_lastWarning[6] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (getProgress().chapter < kChapter3) + getSound()->playSound(kEntityCoudert, "Jac1506", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1506A" : "Jac1506B", kFlagDefault); + break; + + case kObjectCompartmentD: + if (_lastWarning[7] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + getSound()->playSound(kEntityCoudert, "Jac1505", kFlagDefault); + break; + + case kObjectCompartmentE: + if (_lastWarning[8] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (getProgress().field_40 || (getState()->time > kTime2115000 && getState()->time < kTime2133000)) { + getSound()->playSound(kEntityCoudert, "Jac1504B", kFlagDefault); + break; + } + + if (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840)) + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1504" : "Jac1504A", kFlagDefault); + break; + + case kObjectCompartmentF: + if (_lastWarning[9] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (getProgress().field_40 || (getState()->time > kTime2083500 && getState()->time < kTime2133000)) { + getSound()->playSound(kEntityCoudert, "Jac1503B", kFlagDefault); + break; + } + + if (rnd(2) || getEntities()->isInsideCompartment(kEntityAnna, kCarRedSleeping, kPosition_4070)) + getSound()->playSound(kEntityCoudert, "Jac1503", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, "Jac1503A", kFlagDefault); + break; + + case kObjectCompartmentG: + if (_lastWarning[10] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (rnd(2) || getEntities()->isInsideCompartment(kEntityMilos, kCarRedSleeping, kPosition_3050)) + getSound()->playSound(kEntityCoudert, "Jac1502", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, "Jac1502A", kFlagDefault); + break; + + case kObjectCompartmentH: + if (_lastWarning[11] + 450 >= getState()->timeTicks) { + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + break; + } + + if (getEntities()->isInsideCompartment(kEntityIvo, kCarRedSleeping, kPosition_2740)) + getSound()->playSound(kEntityCoudert, rnd(2) ? "Jac1500" : "Jac1500A", kFlagDefault); + else + getSound()->playSound(kEntityCoudert, "Jac1501", kFlagDefault); + break; + } + + // Update ticks (Compartments A - H are indexes 4 - 11) + _lastWarning[compartment - 28] = getState()->timeTicks; +} + +void SoundManager::excuseMe(EntityIndex entity, EntityIndex entity2, SoundFlag flag) { + if (_queue->isBuffered(entity) && entity != kEntityPlayer && entity != kEntityChapters && entity != kEntityTrain) + return; + + if (entity2 == kEntityFrancois || entity2 == kEntityMax) + return; + + if (entity == kEntityFrancois && getEntityData(kEntityFrancois)->field_4A3 != 30) + return; + + if (flag == kFlagNone) + flag = getSoundFlag(entity); + + switch (entity) { + default: + break; + + case kEntityAnna: + playSound(kEntityPlayer, "ANN1107A", flag); + break; + + case kEntityAugust: + switch(rnd(4)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "AUG1100A", flag); + break; + + case 1: + playSound(kEntityPlayer, "AUG1100B", flag); + break; + + case 2: + playSound(kEntityPlayer, "AUG1100C", flag); + break; + + case 3: + playSound(kEntityPlayer, "AUG1100D", flag); + break; + } + break; + + case kEntityMertens: + if (Entities::isFemale(entity2)) { + playSound(kEntityPlayer, (rnd(2) ? "CON1111" : "CON1111A"), flag); + } else { + if (entity2 || getProgress().jacket != kJacketGreen || !rnd(2)) { + switch(rnd(3)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "CON1110A", flag); + break; + + case 1: + playSound(kEntityPlayer, "CON1110C", flag); + break; + + case 2: + playSound(kEntityPlayer, "CON1110", flag); + break; + } + } else { + if (isNight()) { + playSound(kEntityPlayer, (getProgress().field_18 == 2 ? "CON1110F" : "CON1110E")); + } else { + playSound(kEntityPlayer, "CON1110D"); + } + } + } + break; + + case kEntityCoudert: + if (Entities::isFemale(entity2)) { + playSound(kEntityPlayer, "JAC1111D", flag); + } else { + if (entity2 || getProgress().jacket != kJacketGreen || !rnd(2)) { + switch(rnd(4)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "JAC1111", flag); + break; + + case 1: + playSound(kEntityPlayer, "JAC1111A", flag); + break; + + case 2: + playSound(kEntityPlayer, "JAC1111B", flag); + break; + + case 3: + playSound(kEntityPlayer, "JAC1111C", flag); + break; + } + } else { + playSound(kEntityPlayer, "JAC1113B", flag); + } + } + break; + + case kEntityPascale: + playSound(kEntityPlayer, (rnd(2) ? "HDE1002" : "HED1002A"), flag); + break; + + case kEntityServers0: + case kEntityServers1: + switch(rnd(3)) { + default: + break; + + case 0: + playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002" : "WAT1003", flag); + break; + + case 1: + playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002A" : "WAT1003A", flag); + break; + + case 2: + playSound(kEntityPlayer, (entity == kEntityServers0) ? "WAT1002B" : "WAT1003B", flag); + break; + } + break; + + case kEntityVerges: + if (Entities::isFemale(entity2)) { + playSound(kEntityPlayer, (rnd(2) ? "TRA1113A" : "TRA1113B")); + } else { + playSound(kEntityPlayer, "TRA1112", flag); + } + break; + + case kEntityTatiana: + playSound(kEntityPlayer, (rnd(2) ? "TAT1102A" : "TAT1102B"), flag); + break; + + case kEntityAlexei: + playSound(kEntityPlayer, (rnd(2) ? "ALX1099C" : "ALX1099D"), flag); + break; + + case kEntityAbbot: + if (Entities::isFemale(entity2)) { + playSound(kEntityPlayer, "ABB3002C", flag); + } else { + switch(rnd(3)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "ABB3002", flag); + break; + + case 1: + playSound(kEntityPlayer, "ABB3002A", flag); + break; + + case 2: + playSound(kEntityPlayer, "ABB3002B", flag); + break; + } + } + break; + + case kEntityVesna: + switch(rnd(3)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "VES1109A", flag); + break; + + case 1: + playSound(kEntityPlayer, "VES1109B", flag); + break; + + case 2: + playSound(kEntityPlayer, "VES1109C", flag); + break; + } + break; + + case kEntityKahina: + playSound(kEntityPlayer, (rnd(2) ? "KAH1001" : "KAH1001A"), flag); + break; + + case kEntityFrancois: + case kEntityMmeBoutarel: + switch(rnd(4)) { + default: + break; + + case 0: + playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001" : "MME1103A", flag); + break; + + case 1: + playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001A" : "MME1103B", flag); + break; + + case 2: + playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001B" : "MME1103C", flag); + break; + + case 3: + playSound(kEntityPlayer, (entity == kEntityFrancois) ? "FRA1001C" : "MME1103D", flag); + break; + } + break; + + case kEntityBoutarel: + playSound(kEntityPlayer, "MRB1104", flag); + if (flag > 2) + getProgress().eventMetBoutarel = true; + break; + + case kEntityRebecca: + playSound(kEntityPlayer, (rnd(2) ? "REB1106" : "REB110A"), flag); + break; + + case kEntitySophie: { + switch(rnd(3)) { + default: + break; + + case 0: + playSound(kEntityPlayer, "SOP1105", flag); + break; + + case 1: + playSound(kEntityPlayer, Entities::isFemale(entity2) ? "SOP1105C" : "SOP1105A", flag); + break; + + case 2: + playSound(kEntityPlayer, Entities::isFemale(entity2) ? "SOP1105D" : "SOP1105B", flag); + break; + } + break; + } + + case kEntityMahmud: + playSound(kEntityPlayer, "MAH1101", flag); + break; + + case kEntityYasmin: + playSound(kEntityPlayer, "HAR1002", flag); + if (flag > 2) + getProgress().eventMetYasmin = true; + break; + + case kEntityHadija: + playSound(kEntityPlayer, (rnd(2) ? "HAR1001" : "HAR1001A"), flag); + if (flag > 2) + getProgress().eventMetHadija = true; + break; + + case kEntityAlouan: + playSound(kEntityPlayer, "HAR1004", flag); + break; + } +} + +void SoundManager::excuseMeCath() { + switch(rnd(3)) { + default: + playSound(kEntityPlayer, "CAT1126B"); + break; + + case 1: + playSound(kEntityPlayer, "CAT1126C"); + break; + + case 2: + playSound(kEntityPlayer, "CAT1126D"); + break; + } +} + +const char *SoundManager::justCheckingCath() const { + switch(rnd(4)) { + default: + break; + + case 0: + return "CAT5001"; + + case 1: + return "CAT5001A"; + + case 2: + return "CAT5001B"; + + case 3: + return "CAT5001C"; + } + + return "CAT5001"; +} + +const char *SoundManager::wrongDoorCath() const { + switch(rnd(5)) { + default: + break; + + case 0: + return "CAT1125"; + + case 1: + return "CAT1125A"; + + case 2: + return "CAT1125B"; + + case 3: + return "CAT1125C"; + + case 4: + return "CAT1125D"; + } + + return "CAT1125"; +} + +const char *SoundManager::justAMinuteCath() const { + switch(rnd(3)) { + default: + break; + + case 0: + return "CAT1520"; + + case 1: + return "CAT1521"; + + case 2: + return "CAT1125"; // ?? is this a bug in the original? + } + + return "CAT1520"; +} + +////////////////////////////////////////////////////////////////////////// +// Sound flags +////////////////////////////////////////////////////////////////////////// +SoundFlag SoundManager::getSoundFlag(EntityIndex entity) const { + if (entity == kEntityPlayer) + return kFlagDefault; + + if (getEntityData(entity)->car != getEntityData(kEntityPlayer)->car) + return kFlagNone; + + // Compute sound value + SoundFlag ret = kFlag2; + + // Get default value if valid + int index = ABS(getEntityData(entity)->entityPosition - getEntityData(kEntityPlayer)->entityPosition) / 230; + if (index < 32) + ret = soundFlags[index]; + + if (getEntityData(entity)->location == kLocationOutsideTrain) { + if (getEntityData(entity)->car != kCarKronos + && !getEntities()->isOutsideAlexeiWindow() + && !getEntities()->isOutsideAnnaWindow()) + return kFlagNone; + + return (SoundFlag)(ret / 6); + } + + switch (getEntityData(entity)->car) { + default: + break; + + case kCarKronos: + if (getEntities()->isInKronosSalon(entity) != getEntities()->isInKronosSalon(kEntityPlayer)) + ret = (SoundFlag)(ret * 2); + break; + + case kCarGreenSleeping: + case kCarRedSleeping: + if (getEntities()->isInGreenCarEntrance(kEntityPlayer) && !getEntities()->isInKronosSalon(entity)) + ret = (SoundFlag)(ret * 2); + + if (getEntityData(kEntityPlayer)->location + && (getEntityData(entity)->entityPosition != kPosition_1 || !getEntities()->isDistanceBetweenEntities(kEntityPlayer, entity, 400))) + ret = (SoundFlag)(ret * 2); + break; + + case kCarRestaurant: + if (getEntities()->isInSalon(entity) == getEntities()->isInSalon(kEntityPlayer) + && (getEntities()->isInRestaurant(entity) != getEntities()->isInRestaurant(kEntityPlayer))) + ret = (SoundFlag)(ret * 2); + else + ret = (SoundFlag)(ret * 4); + break; + } + + return ret; +} + +////////////////////////////////////////////////////////////////////////// +// Misc +////////////////////////////////////////////////////////////////////////// +void SoundManager::playLoopingSound(int param) { + SoundEntry *entry = _queue->getEntry(kSoundType1); + + static const EntityPosition positions[8] = { kPosition_8200, kPosition_7500, + kPosition_6470, kPosition_5790, + kPosition_4840, kPosition_4070, + kPosition_3050, kPosition_2740 }; + + byte numLoops[8]; + numLoops[1] = 4; + numLoops[2] = 2; + numLoops[3] = 2; + numLoops[4] = 2; + numLoops[5] = 2; + numLoops[6] = 2; + + char tmp[80]; + tmp[0] = 0; + + int partNumber = 1; + int fnameLen = 6; + + if (_queue->getSoundState() & 1 && param >= 0x45 && param <= 0x46) { + if (_queue->getSoundState() & 2) { + strcpy(tmp, "STEAM.SND"); + + _loopingSoundDuration = 32767; + } else { + if (getEntityData(kEntityPlayer)->location == kLocationOutsideTrain) { + partNumber = 6; + } else { + if (getEntities()->isInsideCompartments(kEntityPlayer)) { + int objNum = (getEntityData(kEntityPlayer)->car - 3) < 1 ? 9 : 40; // Weird numbers + + numLoops[0] = 0; + + for (int pos = 0; pos < 8; pos++) { + if (numLoops[0]) + break; + if (getEntities()->isInsideCompartment(kEntityPlayer, getEntityData(kEntityPlayer)->car, positions[pos])) { + numLoops[0] = 1; + partNumber = (getObjects()->get((ObjectIndex)objNum).location - 2) < 1 ? 6 : 1; + } + objNum++; + } + } else { + switch (getEntityData(kEntityPlayer)->car) { + case 1: + case 6: + partNumber = 4; + break; + case 2: + case 3: + case 4: + case 5: + partNumber = 1; + break; + case 7: + partNumber = 5; + break; + case 8: + partNumber = 99; + break; + case 9: + partNumber = 3; + break; + default: + partNumber = 6; + break; + } + } + } + + if (partNumber != 99) + sprintf(tmp, "LOOP%d%c.SND", partNumber, _engine->getRandom().getRandomNumber(numLoops[partNumber] - 1) + 'A'); + } + + if (getFlags()->flag_3) + fnameLen = 5; + + if (!entry || scumm_strnicmp(entry->_name2.c_str(), tmp, fnameLen)) { + _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; + + if (partNumber != 99) { + playSoundWithSubtitles(tmp, kFlagLoopedSound, kEntitySteam); + + if (entry) + entry->update(0); + + SoundEntry *entry1 = _queue->getEntry(kSoundType1); + if (entry1) + entry1->update(7); + } + } + } +} + +} // End of namespace LastExpress diff --git a/engines/lastexpress/sound/sound.h b/engines/lastexpress/sound/sound.h new file mode 100644 index 0000000000..797e52646e --- /dev/null +++ b/engines/lastexpress/sound/sound.h @@ -0,0 +1,87 @@ +/* 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 LASTEXPRESS_SOUND_H +#define LASTEXPRESS_SOUND_H + +#include "lastexpress/shared.h" + +#include "common/str.h" + +namespace LastExpress { + +class LastExpressEngine; +class SoundQueue; + +class SoundManager { +public: + SoundManager(LastExpressEngine *engine); + ~SoundManager(); + + // Sound playing + void playSound(EntityIndex entity, Common::String filename, SoundFlag flag = kFlagInvalid, byte a4 = 0); + bool playSoundWithSubtitles(Common::String filename, SoundFlag flag, EntityIndex entity, byte a4 = 0); + void playSoundEvent(EntityIndex entity, byte action, byte a3 = 0); + void playDialog(EntityIndex entity, EntityIndex entityDialog, SoundFlag flag, byte a4); + void playSteam(CityIndex index); + void playFightSound(byte action, byte a4); + void playLocomotiveSound(); + void playWarningCompartment(EntityIndex entity, ObjectIndex compartment); + void playLoopingSound(int param); + + // Dialog & Letters + void readText(int id); + const char *getDialogName(EntityIndex entity) const; + + // Sound bites + void excuseMe(EntityIndex entity, EntityIndex entity2 = kEntityPlayer, SoundFlag flag = kFlagNone); + void excuseMeCath(); + const char *justCheckingCath() const; + const char *wrongDoorCath() const; + const char *justAMinuteCath() const; + + // Flags + SoundFlag getSoundFlag(EntityIndex index) const; + + // Accessors + SoundQueue *getQueue() { return _queue; } + uint32 getData2() { return _data2; } + +private: + LastExpressEngine *_engine; + SoundQueue *_queue; + + // Compartment warnings by Mertens or Coudert + uint32 _lastWarning[12]; + + // Looping sound + int _loopingSoundDuration; + + // Unknown data + uint32 _data0; + uint32 _data1; + uint32 _data2; +}; + +} // End of namespace LastExpress + +#endif // LASTEXPRESS_SOUND_H -- cgit v1.2.3 From b4ac4988cca41c2a59e4de99b8fe5392372e21dd Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 22:54:51 -0400 Subject: LASTEXPRESS: Cleanup comments --- engines/lastexpress/data/animation.cpp | 12 +++--- engines/lastexpress/data/background.cpp | 2 +- engines/lastexpress/data/font.cpp | 8 ++-- engines/lastexpress/data/scene.cpp | 8 ++-- engines/lastexpress/data/sequence.cpp | 14 +++---- engines/lastexpress/data/snd.cpp | 4 +- engines/lastexpress/data/subtitle.cpp | 4 +- engines/lastexpress/entities/entity.cpp | 10 ++--- engines/lastexpress/entities/entity.h | 20 +++++----- engines/lastexpress/entities/entity_intern.h | 4 +- engines/lastexpress/entities/train.cpp | 2 +- engines/lastexpress/fight/fight.cpp | 8 ++-- engines/lastexpress/game/action.cpp | 4 +- engines/lastexpress/game/beetle.cpp | 14 +++---- engines/lastexpress/game/entities.cpp | 14 +++---- engines/lastexpress/game/inventory.cpp | 4 +- engines/lastexpress/game/logic.cpp | 4 +- engines/lastexpress/game/object.cpp | 2 +- engines/lastexpress/game/savegame.cpp | 56 ++++++++++++++-------------- engines/lastexpress/game/savepoint.cpp | 6 +-- engines/lastexpress/game/scenes.cpp | 6 +-- engines/lastexpress/game/state.cpp | 2 +- engines/lastexpress/game/state.h | 2 +- engines/lastexpress/graphics.cpp | 6 +-- engines/lastexpress/lastexpress.cpp | 2 +- engines/lastexpress/menu/clock.cpp | 2 +- engines/lastexpress/menu/menu.cpp | 2 +- engines/lastexpress/menu/trainline.cpp | 2 +- engines/lastexpress/resource.cpp | 4 +- engines/lastexpress/sound/entry.cpp | 2 +- engines/lastexpress/sound/queue.cpp | 4 +- engines/lastexpress/sound/sound.cpp | 4 +- 32 files changed, 119 insertions(+), 119 deletions(-) diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 1cbf7672d1..28d30ec7d1 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -77,7 +77,7 @@ bool Animation::load(Common::SeekableReadStream *stream, int flag) { // Check if there is enough data if (_stream->size() - _stream->pos() < (signed)(numChunks * sizeof(Chunk))) { - debugC(2, kLastExpressDebugGraphics, "NIS file seems to be corrupted!"); + debugC(2, kLastExpressDebugGraphics, "NIS file seems to be corrupted"); return false; } @@ -101,10 +101,10 @@ bool Animation::load(Common::SeekableReadStream *stream, int flag) { bool Animation::process() { if (!_currentChunk) - error("Animation::process - internal error: the current chunk iterator is invalid!"); + error("[Animation::process] Current chunk iterator is invalid"); if (_stream == NULL || _chunks.size() == 0) - error("Trying to show an animation before loading data"); + error("[Animation::process] Trying to show an animation before loading data"); // TODO: - subtract the time paused by the GUI // - Re-implement to be closer to the original engine @@ -191,7 +191,7 @@ bool Animation::process() { break; default: - error(" UNKNOWN chunk type=%x frame=%d size=%d", _currentChunk->type, _currentChunk->frame, _currentChunk->size); + error("[Animation::process] UNKNOWN chunk type=%x frame=%d size=%d", _currentChunk->type, _currentChunk->frame, _currentChunk->size); break; } _currentChunk++; @@ -206,7 +206,7 @@ bool Animation::hasEnded() { Common::Rect Animation::draw(Graphics::Surface *surface) { if (!_overlay) - error("Animation::draw - internal error: the current overlay animation frame is invalid!"); + error("[Animation::draw] Current overlay animation frame is invalid"); // Paint the background if (_backgroundCurrent == 1 && _background1) @@ -242,7 +242,7 @@ AnimFrame *Animation::processChunkFrame(Common::SeekableReadStream *in, const Ch void Animation::processChunkAudio(Common::SeekableReadStream *in, const Chunk &c) { if (!_audio) - error("Animation::processChunkAudio - internal error: the audio stream is invalid!"); + error("[Animation::processChunkAudio] Audio stream is invalid"); // Skip the Snd header, to queue just the audio blocks uint32 size = c.size; diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp index de6fd7eeae..3d866c26f9 100644 --- a/engines/lastexpress/data/background.cpp +++ b/engines/lastexpress/data/background.cpp @@ -85,7 +85,7 @@ bool Background::load(Common::SeekableReadStream *stream) { Common::Rect Background::draw(Graphics::Surface *surface) { if (!_data) { - debugC(2, kLastExpressDebugGraphics, "Trying to show a background before loading data!"); + debugC(2, kLastExpressDebugGraphics, "Trying to show a background before loading data"); return Common::Rect(); } diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp index 9a60b88a25..79cf64e617 100644 --- a/engines/lastexpress/data/font.cpp +++ b/engines/lastexpress/data/font.cpp @@ -89,17 +89,17 @@ bool Font::load(Common::SeekableReadStream *stream) { uint16 Font::getCharGlyph(uint16 c) const { //warning("%c", c); if (c >= 0x200) - error("Express::Font: Invalid character %d", c); + error("[Font::getCharGlyph] Invalid character %d", c); return _charMap[c]; } byte *Font::getGlyphImg(uint16 g) { if (!_glyphs) - error("Express::getGlyphImg: Invalid glyphs!"); + error("[Font::getGlyphImg] Invalid glyphs"); if (g >= _numGlyphs) - error("Express::getGlyphImg: Invalid glyph %d (%d available)", g, _numGlyphs); + error("[Font::getGlyphImg] Invalid glyph %d (%d available)", g, _numGlyphs); return _glyphs + g * 18 * 8; } @@ -140,7 +140,7 @@ uint8 Font::getCharWidth(uint16 c) const{ return 10; } else { if (!_glyphWidths) - error("Express::getCharWidth: Invalid glyphs widths!"); + error("[Font::getCharWidth] Invalid glyphs widths"); return _glyphWidths[getCharGlyph(c)]; } diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp index 2ec8e6935d..8f279ffbb3 100644 --- a/engines/lastexpress/data/scene.cpp +++ b/engines/lastexpress/data/scene.cpp @@ -187,10 +187,10 @@ bool Scene::checkHotSpot(const Common::Point &coord, SceneHotspot **hotspot) { SceneHotspot *Scene::getHotspot(uint index) { if (_hotspots.empty()) - error("Scene::getHotspot: scene does not have any hotspots!"); + error("[Scene::getHotspot] Scene does not have any hotspots"); if (index >= _hotspots.size()) - error("Scene::getHotspot: invalid index (was: %d, max: %d)", index, _hotspots.size() - 1); + error("[Scene::getHotspot] Invalid index (was: %d, max: %d)", index, _hotspots.size() - 1); return _hotspots[index]; } @@ -202,7 +202,7 @@ Common::Rect Scene::draw(Graphics::Surface *surface) { Common::String sceneName(_name); sceneName.trim(); if (sceneName.empty()) - error("Scene::draw: This scene is not a valid drawing scene!"); + error("[Scene::draw] This scene is not a valid drawing scene"); // Load background Background *background = ((LastExpressEngine *)g_engine)->getResourceManager()->loadBackground(sceneName); @@ -260,7 +260,7 @@ bool SceneLoader::load(Common::SeekableReadStream *stream) { // Read the default scene to get the total number of scenes Scene *header = Scene::load(_stream); if (!header) - error("SceneLoader::load: Invalid data file!"); + error("[SceneLoader::load] Invalid data file"); debugC(2, kLastExpressDebugScenes, " found %d entries", header->entityPosition); /* Header entityPosition is the scene count */ diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index a27c27de2e..a62348f6c0 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -115,7 +115,7 @@ AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f) : _pale decompFF(in, f); break; default: - error("Unknown frame compression: %d", f.compressionType); + error("[AnimFrame::AnimFrame] Unknown frame compression: %d", f.compressionType); } readPalette(in, f); @@ -379,11 +379,11 @@ bool Sequence::load(Common::SeekableReadStream *stream, byte field30) { // Move stream to start of frame _stream->seek((int32)(_sequenceHeaderSize + i * _sequenceFrameSize), SEEK_SET); if (_stream->eos()) - error("Couldn't seek to the current frame data"); + error("[Sequence::load] Couldn't seek to the current frame data"); // Check if there is enough data if ((unsigned)(_stream->size() - _stream->pos()) < _sequenceFrameSize) - error("The sequence frame does not have a valid header"); + error("[Sequence::load] The sequence frame does not have a valid header"); FrameInfo info; info.read(_stream, true); @@ -397,10 +397,10 @@ bool Sequence::load(Common::SeekableReadStream *stream, byte field30) { FrameInfo *Sequence::getFrameInfo(uint16 index) { if (_frames.size() == 0) - error("Trying to decode a sequence before loading its data"); + error("[Sequence::getFrameInfo] Trying to decode a sequence before loading its data"); if (index > _frames.size() - 1) - error("Invalid sequence frame requested: %d, max %d", index, _frames.size() - 1); + error("[Sequence::getFrameInfo] Invalid sequence frame requested: %d, max %d", index, _frames.size() - 1); return &_frames[index]; } @@ -463,14 +463,14 @@ bool SequenceFrame::nextFrame() { FrameInfo *SequenceFrame::getInfo() { if (!_sequence) - error("SequenceFrame::getFrameInfo: Invalid sequence!"); + error("[SequenceFrame::getInfo] Invalid sequence"); return _sequence->getFrameInfo(_frame); } Common::String SequenceFrame::getName() { if (!_sequence) - error("SequenceFrame::getName: Invalid sequence!"); + error("[SequenceFrame::getName] Invalid sequence"); return _sequence->getName(); } diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index 3ffe3ca14b..d92ebbc5e3 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -152,7 +152,7 @@ void AppendableSound::queueBuffer(const byte *data, uint32 size) { void AppendableSound::queueBuffer(Common::SeekableReadStream *bufferIn) { if (!_as) - error("AppendableSound::queueBuffer - internal error: the audio stream is invalid!"); + error("[AppendableSound::queueBuffer] Audio stream is invalid"); // Setup the ADPCM decoder uint32 sizeIn = (uint32)bufferIn->size(); @@ -164,7 +164,7 @@ void AppendableSound::queueBuffer(Common::SeekableReadStream *bufferIn) { void AppendableSound::finish() { if (!_as) - error("AppendableSound::queueBuffer - internal error: the audio stream is invalid!"); + error("[AppendableSound::finish] Audio stream is invalid"); if (!_finished) _as->finish(); diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp index c3a7397b66..0be832cbdd 100644 --- a/engines/lastexpress/data/subtitle.cpp +++ b/engines/lastexpress/data/subtitle.cpp @@ -168,13 +168,13 @@ bool SubtitleManager::load(Common::SeekableReadStream *stream) { // Read header to get the number of subtitles uint32 numSubtitles = stream->readUint16LE(); if (stream->eos()) - error("Cannot read from subtitle file"); + error("[SubtitleManager::load] Cannot read from subtitle file"); debugC(3, kLastExpressDebugSubtitle, "Number of subtitles in file: %d", numSubtitles); // TODO: Check that stream contain enough data //if (stream->size() < (signed)(numSubtitles * sizeof(SubtitleData))) { - //debugC(2, kLastExpressDebugSubtitle, "Subtitle file does not contain valid data!"); + //debugC(2, kLastExpressDebugSubtitle, "Subtitle file does not contain valid data"); //return false; //} diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 60efd70329..e136ca4776 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -105,24 +105,24 @@ void EntityData::EntityCallData::saveLoadWithSerializer(Common::Serializer &s) { ////////////////////////////////////////////////////////////////////////// EntityData::EntityParameters *EntityData::getParameters(uint callback, byte index) const { if (callback >= 9) - error("EntityData::getParameters: invalid callback value (was: %d, max: 9)", callback); + error("[EntityData::getParameters] Invalid callback value (was: %d, max: 9)", callback); if (index >= 4) - error("EntityData::getParameters: invalid index value (was: %d, max: 4)", index); + error("[EntityData::getParameters] Invalid index value (was: %d, max: 4)", index); return _parameters[callback].parameters[index]; } int EntityData::getCallback(uint callback) const { if (callback >= 16) - error("EntityData::getParameters: invalid callback value (was: %d, max: 16)", callback); + error("[EntityData::getCallback] Invalid callback value (was: %d, max: 16)", callback); return _data.callbacks[callback]; } void EntityData::setCallback(uint callback, byte index) { if (callback >= 16) - error("EntityData::getParameters: invalid callback value (was: %d, max: 16)", callback); + error("[EntityData::setCallback] Invalid callback value (was: %d, max: 16)", callback); _data.callbacks[callback] = index; } @@ -137,7 +137,7 @@ void EntityData::updateParameters(uint32 index) const { else if (index < 32) getParameters(8, 3)->update(index - 24); else - error("EntityData::updateParameters: invalid param index to update (was:%d, max:32)!", index); + error("[EntityData::updateParameters] Invalid param index to update (was:%d, max:32)", index); } void EntityData::saveLoadWithSerializer(Common::Serializer &s) { diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 6a4f4166bb..039f461c7b 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -85,7 +85,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersIIII::update: invalid index (was: %d)", index); + error("[EntityParametersIIII::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 1: param2 = 1; break; @@ -134,7 +134,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersSIII::update: invalid index (was: %d)", index); + error("[EntityParametersSIII::update] Invalid index (was: %d)", index); case 3: param4 = 1; break; case 4: param5 = 1; break; @@ -174,7 +174,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersSIIS::update: invalid index (was: %d)", index); + error("[EntityParametersSIIS::update] Invalid index (was: %d)", index); case 3: param4 = 1; break; case 4: param5 = 1; break; @@ -209,7 +209,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersISSI::update: invalid index (was: %d)", index); + error("[EntityParametersISSI::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 7: param8 = 1; break; @@ -248,7 +248,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersISII::update: invalid index (was: %d)", index); + error("[EntityParametersISII::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 4: param5 = 1; break; @@ -288,7 +288,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersSSII::update: invalid index (was: %d)", index); + error("[EntityParametersSSII::update] Invalid index (was: %d)", index); case 6: param7 = 1; break; case 7: param8 = 1; break; @@ -319,7 +319,7 @@ public: } void update(uint32) { - error("EntityParametersSSS::update: cannot update this type of parameters"); + error("[EntityParametersSSS::update] Cannot update this type of parameters"); } void saveLoadWithSerializer(Common::Serializer &s) { @@ -349,7 +349,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersIISS::update: invalid index (was: %d)", index); + error("[EntityParametersIISS::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 1: param2 = 1; break; @@ -388,7 +388,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersIISI::update: invalid index (was: %d)", index); + error("[EntityParametersIISI::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 1: param2 = 1; break; @@ -432,7 +432,7 @@ public: void update(uint32 index) { switch (index) { default: - error("EntityParametersIIIS::update: invalid index (was: %d)", index); + error("[EntityParametersIIIS::update] Invalid index (was: %d)", index); case 0: param1 = 1; break; case 1: param2 = 1; break; diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index 43d7f702c9..bf75e022de 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -96,7 +96,7 @@ void class::setup_##name() { \ #define EXPOSE_PARAMS(type) \ type *params = (type*)_data->getCurrentParameters(); \ if (!params) \ - error("Trying to call an entity function with invalid parameters!"); \ + error("[EXPOSE_PARAMS] Trying to call an entity function with invalid parameters"); \ // function signature without setup (we keep the index for consistency but never use it) @@ -413,7 +413,7 @@ void class::setup_##name() { \ ////////////////////////////////////////////////////////////////////////// #define CALLBACK_ACTION() { \ if (getData()->currentCall == 0) \ - error("CALLBACK_ACTION: currentCall is already 0, cannot proceed!"); \ + error("[CALLBACK_ACTION] currentCall is already 0, cannot proceed"); \ getData()->currentCall--; \ getSavePoints()->setCallback(_entityIndex, _callbacks[_data->getCurrentCallback()]); \ getSavePoints()->call(_entityIndex, _entityIndex, kActionCallback); \ diff --git a/engines/lastexpress/entities/train.cpp b/engines/lastexpress/entities/train.cpp index 7d90ea5e64..bced1da62b 100644 --- a/engines/lastexpress/entities/train.cpp +++ b/engines/lastexpress/entities/train.cpp @@ -92,7 +92,7 @@ IMPLEMENT_FUNCTION_II(7, Train, harem, ObjectIndex, uint32) switch (params->param1) { default: - error("Train::harem: Invalid value for parameter 1: %d", params->param1); + error("[Train::harem] Invalid value for parameter 1: %d", params->param1); break; case kObjectCompartment5: diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp index 38a93cfd94..b832d46a60 100644 --- a/engines/lastexpress/fight/fight.cpp +++ b/engines/lastexpress/fight/fight.cpp @@ -162,7 +162,7 @@ void Fight::handleTick(const Common::Event &ev, bool isProcessing) { // Blink egg if (getGlobalTimer()) { - warning("Fight::handleMouseMove - egg blinking not implemented!"); + warning("[Fight::handleTick] Egg blinking not implemented"); } if (!_data || _data->index) @@ -197,7 +197,7 @@ void Fight::handleTick(const Common::Event &ev, bool isProcessing) { ////////////////////////////////////////////////////////////////////////// Fight::FightEndType Fight::setup(FightType type) { if (_data) - error("Fight::setup - calling fight setup again while a fight is already in progress!"); + error("[Fight::setup] Calling fight setup again while a fight is already in progress"); ////////////////////////////////////////////////////////////////////////// // Prepare UI & state @@ -320,7 +320,7 @@ void Fight::clearData() { ////////////////////////////////////////////////////////////////////////// void Fight::loadData(FightType type) { if (!_data) - error("Fight::loadData - invalid data!"); + error("[Fight::loadData] Data not initialized"); switch (type) { default: @@ -353,7 +353,7 @@ void Fight::loadData(FightType type) { } if (!_data->player || !_data->opponent) - error("Fight::loadData - error loading fight data (type=%d)", type); + error("[Fight::loadData] Error loading fight data (type=%d)", type); // Setup opponent pointers setOpponents(); diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 2c7b5b3c32..2ef4c20d70 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -407,7 +407,7 @@ SceneIndex Action::processHotspot(const SceneHotspot &hotspot) { ////////////////////////////////////////////////////////////////////////// // Action 0 IMPLEMENT_ACTION(dummy) - warning("Action::action_dummy: Dummy action function called (hotspot action: %d)!", hotspot.action); + warning("[Action::action_dummy] Dummy action function called (hotspot action: %d)", hotspot.action); return kSceneInvalid; } @@ -1910,7 +1910,7 @@ LABEL_KEY: // Play an animation and add delta time to global game time void Action::playAnimation(EventIndex index, bool debugMode) const { if (index >= _animationListSize) - error("Action::playAnimation: invalid event index (value=%i, max=%i)", index, _animationListSize); + error("[Action::playAnimation] Invalid event index (value=%i, max=%i)", index, _animationListSize); // In debug mode, just show the animation if (debugMode) { diff --git a/engines/lastexpress/game/beetle.cpp b/engines/lastexpress/game/beetle.cpp index cb6f0a3306..ab707ddae9 100644 --- a/engines/lastexpress/game/beetle.cpp +++ b/engines/lastexpress/game/beetle.cpp @@ -131,7 +131,7 @@ bool Beetle::isLoaded() const { bool Beetle::catchBeetle() { if (!_data) - error("Beetle::catchBeetle: sequences have not been loaded!"); + error("[Beetle::catchBeetle] Sequences have not been loaded"); if (getInventory()->getSelectedItem() == kItemMatchBox && getInventory()->hasItem(kItemMatch) @@ -148,14 +148,14 @@ bool Beetle::catchBeetle() { bool Beetle::isCatchable() const { if (!_data) - error("Beetle::isCatchable: sequences have not been loaded!"); + error("[Beetle::isCatchable] Sequences have not been loaded"); return (_data->indexes[_data->offset] >= 30); } void Beetle::update() { if (!_data) - error("Beetle::update: sequences have not been loaded!"); + error("[Beetle::update] Sequences have not been loaded"); if (!_data->isLoaded) return; @@ -194,7 +194,7 @@ void Beetle::update() { void Beetle::drawUpdate() { if (!_data) - error("Beetle::drawUpdate: sequences have not been loaded!"); + error("[Beetle::drawUpdate] Sequences have not been loaded"); if (_data->frame != NULL) { getScenes()->setCoordinates(_data->frame); @@ -366,7 +366,7 @@ void Beetle::drawUpdate() { void Beetle::move() { if (!_data) - error("Beetle::move: sequences have not been loaded!"); + error("[Beetle::move] Sequences have not been loaded"); if (_data->indexes[_data->offset] >= 24 && _data->indexes[_data->offset] <= 29) return; @@ -444,7 +444,7 @@ update_data: // Update the beetle sequence to show the correct frames in the correct place void Beetle::updateFrame(SequenceFrame *frame) const { if (!_data) - error("Beetle::updateSequence: sequences have not been loaded!"); + error("[Beetle::updateFrame] Sequences have not been loaded"); if (!frame) return; @@ -459,7 +459,7 @@ void Beetle::updateFrame(SequenceFrame *frame) const { void Beetle::updateData(uint32 index) { if (!_data) - error("Beetle::updateData: sequences have not been loaded!"); + error("[Beetle::updateData] Sequences have not been loaded"); if (!_data->isLoaded) return; diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index a56531891b..f6bb2030f0 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -202,7 +202,7 @@ Entity *Entities::get(EntityIndex entity) { assert((uint)entity < _entities.size()); if (entity == kEntityPlayer) - error("Cannot get entity for index == 0!"); + error("[Entities::get] Cannot get entity for kEntityPlayer"); return _entities[entity]; } @@ -220,24 +220,24 @@ int Entities::getPosition(CarIndex car, Position position) const { int index = 100 * car + position; if (car > 10) - error("Entities::getPosition: trying to access an invalid car (was: %d, valid:0-9)", car); + error("[Entities::getPosition] Trying to access an invalid car (was: %d, valid:0-9)", car); if (position > 100) - error("Entities::getPosition: trying to access an invalid position (was: %d, valid:0-100)", position); + error("[Entities::getPosition] Trying to access an invalid position (was: %d, valid:0-100)", position); return _positions[index]; } int Entities::getCompartments(int index) const { if (index >= _compartmentsCount) - error("Entities::getCompartments: trying to access an invalid compartment (was: %d, valid:0-15)", index); + error("[Entities::getCompartments] Trying to access an invalid compartment (was: %d, valid:0-15)", index); return _compartments[index]; } int Entities::getCompartments1(int index) const { if (index >= _compartmentsCount) - error("Entities::getCompartments: trying to access an invalid compartment (was: %d, valid:0-15)", index); + error("[Entities::getCompartments] Trying to access an invalid compartment (was: %d, valid:0-15)", index); return _compartments1[index]; } @@ -1782,7 +1782,7 @@ void Entities::enterCompartment(EntityIndex entity, ObjectIndex compartment, boo // Update compartments int index = (compartment < 32 ? compartment - 1 : compartment - 24); if (index >= 16) - error("Entities::exitCompartment: invalid compartment index!"); + error("[Entities::enterCompartment] Invalid compartment index"); if (useCompartment1) _compartments1[index] |= STORE_VALUE(entity); @@ -1868,7 +1868,7 @@ void Entities::exitCompartment(EntityIndex entity, ObjectIndex compartment, bool // Update compartments int index = (compartment < 32 ? compartment - 1 : compartment - 24); if (index >= 16) - error("Entities::exitCompartment: invalid compartment index!"); + error("[Entities::exitCompartment] Invalid compartment index"); if (useCompartment1) _compartments1[index] &= ~STORE_VALUE(entity); diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp index d902c8860a..e417b1ec0d 100644 --- a/engines/lastexpress/game/inventory.cpp +++ b/engines/lastexpress/game/inventory.cpp @@ -439,7 +439,7 @@ void Inventory::showHourGlass(){ ////////////////////////////////////////////////////////////////////////// Inventory::InventoryEntry *Inventory::get(InventoryItem item) { if (item >= kPortraitOriginal) - error("Inventory::getEntry: Invalid inventory item!"); + error("[Inventory::get] Invalid inventory item"); return &_entries[item]; } @@ -623,7 +623,7 @@ void Inventory::drawEgg() { // Blinking egg: we need to blink the egg for delta time, with the blinking getting faster until it's always lit. void Inventory::drawBlinkingEgg() { - warning("Inventory::drawEgg - blinking not implemented!"); + warning("[Inventory::drawBlinkingEgg] Blinking not implemented"); //// TODO show egg (with or without mouseover) diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp index 2b7b1cfa50..aeac8cff98 100644 --- a/engines/lastexpress/game/logic.cpp +++ b/engines/lastexpress/game/logic.cpp @@ -413,7 +413,7 @@ void Logic::eventTick(const Common::Event &) { void Logic::resetState() { getState()->scene = kSceneDefault; - warning("Logic::resetState: not implemented! You need to restart the engine until this is implemented."); + warning("[Logic::resetState] Not implemented! You need to restart the engine until this is implemented."); } /** @@ -506,7 +506,7 @@ void Logic::playFinalSequence() const { } void Logic::showCredits() const { - error("Logic::showCredits: not implemented!"); + error("[Logic::showCredits] Not implemented"); } ////////////////////////////////////////////////////////////////////////// diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp index a600075953..d9e9e4279a 100644 --- a/engines/lastexpress/game/object.cpp +++ b/engines/lastexpress/game/object.cpp @@ -39,7 +39,7 @@ Objects::Objects(LastExpressEngine *engine) : _engine(engine) {} const Objects::Object Objects::get(ObjectIndex index) const { if (index >= kObjectMax) - error("Objects::get - internal error: invalid object index (%d)", index); + error("[Objects::get] Invalid object index (%d)", index); return _objects[index]; } diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp index 8dfc214913..ebada5dd4e 100644 --- a/engines/lastexpress/game/savegame.cpp +++ b/engines/lastexpress/game/savegame.cpp @@ -75,10 +75,10 @@ void SaveLoad::initStream() { void SaveLoad::flushStream(GameId id) { Common::OutSaveFile *save = openForSaving(id); if (!save) - error("SaveLoad::flushStream: cannot open savegame (%s)!", getFilename(id).c_str()); + error("[SaveLoad::flushStream] Cannot open savegame (%s)", getFilename(id).c_str()); if (!_savegame) - error("SaveLoad::flushStream: savegame stream is invalid"); + error("[SaveLoad::flushStream] Savegame stream is invalid"); save->write(_savegame->getData(), (uint32)_savegame->size()); @@ -109,7 +109,7 @@ uint32 SaveLoad::init(GameId id, bool resetHeaders) { SavegameMainHeader mainHeader; mainHeader.saveLoadWithSerializer(ser); if (!mainHeader.isValid()) - error("SaveLoad::init - Savegame seems to be corrupted (invalid header)"); + error("[SaveLoad::init] Savegame seems to be corrupted (invalid header)"); // Reset cached entry headers if needed if (resetHeaders) { @@ -148,10 +148,10 @@ uint32 SaveLoad::init(GameId id, bool resetHeaders) { void SaveLoad::loadStream(GameId id) { Common::InSaveFile *save = openForLoading(id); if (save->size() < 32) - error("SaveLoad::init - Savegame seems to be corrupted (not enough data: %i bytes)", save->size()); + error("[SaveLoad::loadStream] Savegame seems to be corrupted (not enough data: %i bytes)", save->size()); if (!_savegame) - error("SaveLoad::loadStream: savegame stream is invalid"); + error("[SaveLoad::loadStream] Savegame stream is invalid"); // Load all savegame data uint8* buf = new uint8[8192]; @@ -192,7 +192,7 @@ void SaveLoad::clear(bool clearStream) { // Load game void SaveLoad::loadGame(GameId id) { if (!_savegame) - error("SaveLoad::loadGame: No savegame stream present!"); + error("[SaveLoad::loadGame] No savegame stream present"); // Rewind current savegame _savegame->seek(0); @@ -200,12 +200,12 @@ void SaveLoad::loadGame(GameId id) { // Validate main header SavegameMainHeader header; if (!loadMainHeader(_savegame, &header)) { - debugC(2, kLastExpressDebugSavegame, "SaveLoad::saveGame - Cannot load main header: %s", getFilename(getMenu()->getGameId()).c_str()); + debugC(2, kLastExpressDebugSavegame, "Cannot load main header: %s", getFilename(getMenu()->getGameId()).c_str()); return; } if (!_savegame) - error("SaveLoad::loadGame: No savegame stream present!"); + error("[SaveLoad::loadGame] No savegame stream present"); // Load the last entry _savegame->seek(header.offsetEntry); @@ -230,7 +230,7 @@ void SaveLoad::loadGame(GameId id) { // Load a specific game entry void SaveLoad::loadGame(GameId id, uint32 index) { - error("SaveLoad::loadGame: not implemented! (only loading the last entry is working for now)"); + error("[SaveLoad::loadGame] Not implemented! (only loading the last entry is working for now)"); } // Save game @@ -241,12 +241,12 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) { // Validate main header SavegameMainHeader header; if (!loadMainHeader(_savegame, &header)) { - debugC(2, kLastExpressDebugSavegame, "SaveLoad::saveGame - Cannot load main header: %s", getFilename(getMenu()->getGameId()).c_str()); + debugC(2, kLastExpressDebugSavegame, "Cannot load main header: %s", getFilename(getMenu()->getGameId()).c_str()); return; } if (!_savegame) - error("SaveLoad::saveGame: savegame stream is invalid"); + error("[SaveLoad::saveGame] Savegame stream is invalid"); // Validate the current entry if it exists if (header.count > 0) { @@ -258,7 +258,7 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) { entry.saveLoadWithSerializer(ser); if (!entry.isValid()) { - warning("SaveLoad::saveGame: Invalid entry. This savegame might be corrupted!"); + warning("[SaveLoad::saveGame] Invalid entry. This savegame might be corrupted"); _savegame->seek(header.offset); } else if (getState()->time < entry.time || (type == kSavegameTypeTickInterval && getState()->time == entry.time)) { // Not ready to save a game, skipping! @@ -296,7 +296,7 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) { // Validate the main header if (!header.isValid()) - error("SaveLoad::saveGame: main game header is invalid!"); + error("[SaveLoad::saveGame] Main game header is invalid"); // Write the main header _savegame->seek(0); @@ -307,7 +307,7 @@ void SaveLoad::saveGame(SavegameType type, EntityIndex entity, uint32 value) { } void SaveLoad::saveVolumeBrightness() { - warning("SaveLoad::saveVolumeBrightness: not implemented!"); + warning("[SaveLoad::saveVolumeBrightness] Not implemented"); } ////////////////////////////////////////////////////////////////////////// @@ -319,7 +319,7 @@ bool SaveLoad::loadMainHeader(Common::InSaveFile *stream, SavegameMainHeader *he // Check there is enough data (32 bytes) if (stream->size() < 32) { - debugC(2, kLastExpressDebugSavegame, "SaveLoad::loadMainHeader - Savegame seems to be corrupted (not enough data: %i bytes)!", stream->size()); + debugC(2, kLastExpressDebugSavegame, "Savegame seems to be corrupted (not enough data: %i bytes)", stream->size()); return false; } @@ -331,7 +331,7 @@ bool SaveLoad::loadMainHeader(Common::InSaveFile *stream, SavegameMainHeader *he // Validate the header if (!header->isValid()) { - debugC(2, kLastExpressDebugSavegame, "SaveLoad::loadMainHeader - Cannot validate main header!"); + debugC(2, kLastExpressDebugSavegame, "Cannot validate main header"); return false; } @@ -348,11 +348,11 @@ void SaveLoad::writeEntry(SavegameType type, EntityIndex entity, uint32 value) { uint32 _count = (uint32)_savegame->pos() - _prevPosition; \ debugC(kLastExpressDebugSavegame, "Savegame: Writing " #name ": %d bytes", _count); \ if (_count != val)\ - error("SaveLoad::writeEntry: Number of bytes written (%d) differ from expected count (%d)", _count, val); \ + error("[SaveLoad::writeEntry] Number of bytes written (%d) differ from expected count (%d)", _count, val); \ } if (!_savegame) - error("SaveLoad::writeEntry: savegame stream is invalid"); + error("[SaveLoad::writeEntry] Savegame stream is invalid"); SavegameEntryHeader header; @@ -395,7 +395,7 @@ void SaveLoad::writeEntry(SavegameType type, EntityIndex entity, uint32 value) { // Validate entry header if (!header.isValid()) - error("SaveLoad::writeEntry: entry header is invalid"); + error("[SaveLoad::writeEntry] Entry header is invalid"); // Save the header with the updated info _savegame->seek(originalPosition); @@ -412,7 +412,7 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b uint32 _count = (uint32)_savegame->pos() - _prevPosition; \ debugC(kLastExpressDebugSavegame, "Savegame: Reading " #name ": %d bytes", _count); \ if (_count != val) \ - error("SaveLoad::readEntry: Number of bytes read (%d) differ from expected count (%d)", _count, val); \ + error("[SaveLoad::readEntry] Number of bytes read (%d) differ from expected count (%d)", _count, val); \ } #define LOAD_ENTRY_ONLY(name, func) { \ @@ -423,10 +423,10 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b } if (!type || !entity || !val) - error("SaveLoad::readEntry: Invalid parameters passed!"); + error("[SaveLoad::readEntry] Invalid parameters passed"); if (!_savegame) - error("SaveLoad::readEntry: No savegame stream present!"); + error("[SaveLoad::readEntry] No savegame stream present"); // Load entry header SavegameEntryHeader entry; @@ -434,7 +434,7 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b entry.saveLoadWithSerializer(ser); if (!entry.isValid()) - error("SaveLoad::readEntry: entry header is invalid!"); + error("[SaveLoad::readEntry] Entry header is invalid"); // Init type, entity & value *type = entry.type; @@ -469,7 +469,7 @@ void SaveLoad::readEntry(SavegameType *type, EntityIndex *entity, uint32 *val, b SaveLoad::SavegameEntryHeader *SaveLoad::getEntry(uint32 index) { if (index >= _gameHeaders.size()) - error("SaveLoad::getEntry: invalid index (was:%d, max:%d)", index, _gameHeaders.size() - 1); + error("[SaveLoad::getEntry] Invalid index (was:%d, max:%d)", index, _gameHeaders.size() - 1); return _gameHeaders[index]; } @@ -489,7 +489,7 @@ bool SaveLoad::isSavegamePresent(GameId id) { // Check if the game has been started in the specific savegame bool SaveLoad::isSavegameValid(GameId id) { if (!isSavegamePresent(id)) { - debugC(2, kLastExpressDebugSavegame, "SaveLoad::isSavegameValid - Savegame does not exist: %s", getFilename(id).c_str()); + debugC(2, kLastExpressDebugSavegame, "Savegame does not exist: %s", getFilename(id).c_str()); return false; } @@ -552,7 +552,7 @@ bool SaveLoad::isGameFinished(uint32 menuIndex, uint32 savegameIndex) { // Get the file name from the savegame ID Common::String SaveLoad::getFilename(GameId id) { if (id >= 6) - error("SaveLoad::getName - attempting to use an invalid game id. Valid values: 0 - 5, was %d", id); + error("[SaveLoad::getFilename] Attempting to use an invalid game id. Valid values: 0 - 5, was %d", id); return gameInfo[id].saveFile; } @@ -561,7 +561,7 @@ Common::InSaveFile *SaveLoad::openForLoading(GameId id) { Common::InSaveFile *load = g_system->getSavefileManager()->openForLoading(getFilename(id)); if (!load) - debugC(2, kLastExpressDebugSavegame, "SaveLoad::openForLoading - Cannot open savegame for loading: %s", getFilename(id).c_str()); + debugC(2, kLastExpressDebugSavegame, "Cannot open savegame for loading: %s", getFilename(id).c_str()); return load; } @@ -570,7 +570,7 @@ Common::OutSaveFile *SaveLoad::openForSaving(GameId id) { Common::OutSaveFile *save = g_system->getSavefileManager()->openForSaving(getFilename(id)); if (!save) - debugC(2, kLastExpressDebugSavegame, "SaveLoad::openForSaving - Cannot open savegame for writing: %s", getFilename(id).c_str()); + debugC(2, kLastExpressDebugSavegame, "Cannot open savegame for writing: %s", getFilename(id).c_str()); return save; } diff --git a/engines/lastexpress/game/savepoint.cpp b/engines/lastexpress/game/savepoint.cpp index 7ec7c241e9..64ae26c2be 100644 --- a/engines/lastexpress/game/savepoint.cpp +++ b/engines/lastexpress/game/savepoint.cpp @@ -128,17 +128,17 @@ void SavePoints::addData(EntityIndex entity, ActionIndex action, uint32 param) { ////////////////////////////////////////////////////////////////////////// void SavePoints::setCallback(EntityIndex index, Entity::Callback *callback) { if (index >= 40) - error("SavePoints::setCallback - attempting to use an invalid entity index. Valid values 0-39, was %d", index); + error("[SavePoints::setCallback] Attempting to use an invalid entity index. Valid values 0-39, was %d", index); if (!callback || !callback->isValid()) - error("SavePoints::setCallback - attempting to set an invalid callback for entity %s", ENTITY_NAME(index)); + error("[SavePoints::setCallback] Attempting to set an invalid callback for entity %s", ENTITY_NAME(index)); _callbacks[index] = callback; } Entity::Callback *SavePoints::getCallback(EntityIndex index) const { if (index >= 40) - error("SavePoints::getCallback - attempting to use an invalid entity index. Valid values 0-39, was %d", index); + error("[SavePoints::getCallback] Attempting to use an invalid entity index. Valid values 0-39, was %d", index); return _callbacks[index]; } diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp index 65efc80265..b886951e0b 100644 --- a/engines/lastexpress/game/scenes.cpp +++ b/engines/lastexpress/game/scenes.cpp @@ -81,12 +81,12 @@ void SceneManager::loadSceneDataFile(ArchiveIndex archive) { case kArchiveCd2: case kArchiveCd3: if (!_sceneLoader->load(getArchive(Common::String::format("CD%iTRAIN.DAT", archive)))) - error("SceneManager::loadSceneDataFile: cannot load data file CD%iTRAIN.DAT", archive); + error("[SceneManager::loadSceneDataFile] Cannot load data file CD%iTRAIN.DAT", archive); break; default: case kArchiveAll: - error("SceneManager::loadSceneDataFile: Invalid archive index (must be [1-3], was %d", archive); + error("[SceneManager::loadSceneDataFile] Invalid archive index (must be [1-3], was %d", archive); break; } } @@ -464,7 +464,7 @@ bool SceneManager::checkPosition(SceneIndex index, CheckPositionType type) const switch (type) { default: - error("SceneManager::checkPosition: Invalid position type: %d", type); + error("[SceneManager::checkPosition] Invalid position type: %d", type); case kCheckPositionLookingUp: return isInSleepingCar && (position >= 1 && position <= 19); diff --git a/engines/lastexpress/game/state.cpp b/engines/lastexpress/game/state.cpp index 0cf2ddba40..f3fd9720b1 100644 --- a/engines/lastexpress/game/state.cpp +++ b/engines/lastexpress/game/state.cpp @@ -57,7 +57,7 @@ bool State::isNightTime() const { void State::getHourMinutes(uint32 time, uint8 *hours, uint8 *minutes) { if (hours == NULL || minutes == NULL) - error("State::getHourMinutes: invalid parameters passed!"); + error("[State::getHourMinutes] Invalid parameters passed"); *hours = (uint8)((time % 1296000) / 54000); *minutes = (uint8)((time % 54000) / 900); diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index 8f71e7d424..c937fdce9f 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -325,7 +325,7 @@ public: switch (index) { default: - error("GameProgress::isEqual: invalid index value (was: %d, max:127)", index); + error("[GameProgress::getValueName] Invalid index value (was: %d, max:127)", index); break; EXPOSE_VALUE(0, field_0); diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp index abbdf2b766..e129457256 100644 --- a/engines/lastexpress/graphics.cpp +++ b/engines/lastexpress/graphics.cpp @@ -72,7 +72,7 @@ void GraphicsManager::clear(BackgroundType type) { void GraphicsManager::clear(BackgroundType type, const Common::Rect &rect) { switch (type) { default: - error("GraphicsManager::clear() - Unknown background type: %d", type); + error("[GraphicsManager::clear] Unknown background type: %d", type); break; case kBackgroundA: @@ -105,7 +105,7 @@ bool GraphicsManager::draw(Drawable *drawable, BackgroundType type, bool transit Graphics::Surface *GraphicsManager::getSurface(BackgroundType type) { switch (type) { default: - error("GraphicsManager::getSurface() - Unknown surface type: %d", type); + error("[GraphicsManager::getSurface] Unknown surface type: %d", type); break; case kBackgroundA: @@ -121,7 +121,7 @@ Graphics::Surface *GraphicsManager::getSurface(BackgroundType type) { return &_inventory; case kBackgroundAll: - error("GraphicsManager::getSurface() - cannot return a surface for kBackgroundAll!"); + error("[GraphicsManager::getSurface] Cannot return a surface for kBackgroundAll"); break; } } diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp index 5d83527525..885ca8b212 100644 --- a/engines/lastexpress/lastexpress.cpp +++ b/engines/lastexpress/lastexpress.cpp @@ -185,7 +185,7 @@ void LastExpressEngine::pollEvents() { bool LastExpressEngine::handleEvents() { // Make sure all the subsystems have been initialized if (!_debugger || !_graphicsMan) - error("LastExpressEngine::handleEvents: called before the required subsystems have been initialized!"); + error("[LastExpressEngine::handleEvents] Called before the required subsystems have been initialized"); // Execute stored commands if (_debugger->hasCommand()) { diff --git a/engines/lastexpress/menu/clock.cpp b/engines/lastexpress/menu/clock.cpp index b0e6a260d4..dedf045940 100644 --- a/engines/lastexpress/menu/clock.cpp +++ b/engines/lastexpress/menu/clock.cpp @@ -62,7 +62,7 @@ void Clock::draw(uint32 time) { // Check that sequences have been loaded if (!_frameMinutes || !_frameHour || !_frameSun || !_frameDate) - error("Clock::process: clock sequences have not been loaded correctly!"); + error("[Clock::draw] Clock sequences have not been loaded correctly"); // Clear existing frames clear(); diff --git a/engines/lastexpress/menu/menu.cpp b/engines/lastexpress/menu/menu.cpp index bfead02ad0..f1a8bebe94 100644 --- a/engines/lastexpress/menu/menu.cpp +++ b/engines/lastexpress/menu/menu.cpp @@ -860,7 +860,7 @@ void Menu::init(bool doSavegame, SavegameType type, uint32 value) { useSameIndex = false; // TODO remove existing savegame and reset index & savegame name - warning("Menu::initGame: not implemented!"); + warning("[Menu::initGame] Not implemented"); } doSavegame = false; diff --git a/engines/lastexpress/menu/trainline.cpp b/engines/lastexpress/menu/trainline.cpp index df08abf37b..f819776163 100644 --- a/engines/lastexpress/menu/trainline.cpp +++ b/engines/lastexpress/menu/trainline.cpp @@ -97,7 +97,7 @@ void TrainLine::draw(uint32 time) { // Check that sequences have been loaded if (!_frameLine1 || !_frameLine2) - error("TrainLine::process: Line sequences have not been loaded correctly!"); + error("[TrainLine::draw] Line sequences have not been loaded correctly"); // Clear existing frames clear(); diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp index f376a3a299..3910aaa010 100644 --- a/engines/lastexpress/resource.cpp +++ b/engines/lastexpress/resource.cpp @@ -52,7 +52,7 @@ bool ResourceManager::isArchivePresent(ArchiveIndex type) { switch (type) { default: case kArchiveAll: - error("ResourceManager::isArchivePresent: Only checks for single CDs are valid!"); + error("[ResourceManager::isArchivePresent] Only checks for single CDs are valid"); case kArchiveCd1: return Common::File::exists(archiveCD1Path); @@ -134,7 +134,7 @@ Common::SeekableReadStream *ResourceManager::getFileStream(const Common::String // Check if the file exits in the archive if (!hasFile(name)) { //#ifdef _DEBUG -// error("ResourceManager::getFileStream: cannot open file: %s", name.c_str()); +// error("[ResourceManager::getFileStream] Cannot open file: %s", name.c_str()); //#endif debugC(2, kLastExpressDebugResource, "Error opening file: %s", name.c_str()); return NULL; diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 5cdcc15d5a..f3f06b8128 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -211,7 +211,7 @@ void SoundEntry::loadSoundData(Common::String name) { _stream = getArchive("DEFAULT.SND"); if (_stream) { - warning("Sound::loadSoundData: not implemented!"); + warning("[Sound::loadSoundData] Not implemented"); } else { _status.status = kSoundStatusRemoved; } diff --git a/engines/lastexpress/sound/queue.cpp b/engines/lastexpress/sound/queue.cpp index 9126f5709d..7eb67b387c 100644 --- a/engines/lastexpress/sound/queue.cpp +++ b/engines/lastexpress/sound/queue.cpp @@ -115,7 +115,7 @@ void SoundQueue::removeFromQueue(Common::String filename) { void SoundQueue::updateQueue() { Common::StackLock locker(_mutex); - warning("Sound::updateQueue: not implemented!"); + warning("[Sound::updateQueue] Not implemented"); } void SoundQueue::resetQueue() { @@ -413,7 +413,7 @@ void SoundQueue::saveLoadWithSerializer(Common::Serializer &s) { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) (*i)->saveLoadWithSerializer(s); } else { - warning("Sound::saveLoadWithSerializer: loading not implemented"); + warning("[Sound::saveLoadWithSerializer] Loading not implemented"); s.skip(numEntries * 64); } } diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp index 16e502ad5a..45f8140d27 100644 --- a/engines/lastexpress/sound/sound.cpp +++ b/engines/lastexpress/sound/sound.cpp @@ -300,7 +300,7 @@ void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { void SoundManager::playSteam(CityIndex index) { if (index >= ARRAYSIZE(cities)) - error("SoundManager::playSteam: invalid city index (was %d, max %d)", index, ARRAYSIZE(cities)); + error("[SoundManager::playSteam] Invalid city index (was %d, max %d)", index, ARRAYSIZE(cities)); _queue->resetState(kSoundState2); @@ -676,7 +676,7 @@ void SoundManager::readText(int id){ return; if (id < 0 || (id > 8 && id < 50) || id > 64) - error("Sound::readText - attempting to use invalid id. Valid values [1;8] - [50;64], was %d", id); + error("[Sound::readText] Attempting to use invalid id. Valid values [1;8] - [50;64], was %d", id); // Get proper message file (names are stored in sequence in the array but id is [1;8] - [50;64]) const char *text = messages[id <= 8 ? id : id - 41]; -- cgit v1.2.3 From 04933a1937ef0de703a932e1392578aea4d38d64 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 23:17:13 -0400 Subject: LASTEXPRESS: Make SoundEntry members private --- engines/lastexpress/sound/entry.cpp | 11 +++++++++-- engines/lastexpress/sound/entry.h | 27 ++++++++++++++++++++------ engines/lastexpress/sound/queue.cpp | 38 ++++++++++++++++++------------------- engines/lastexpress/sound/sound.cpp | 8 ++++---- 4 files changed, 52 insertions(+), 32 deletions(-) diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index f3f06b8128..c34bb4f0cc 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -307,6 +307,13 @@ void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) { } } +void SoundEntry::loadStream() { + if (!_soundStream) + _soundStream = new StreamedSound(); + + _soundStream->load(_stream); +} + ////////////////////////////////////////////////////////////////////////// // SubtitleEntry ////////////////////////////////////////////////////////////////////////// @@ -352,10 +359,10 @@ void SubtitleEntry::setupAndDraw() { _data->load(getArchive(_filename)); } - if (_data->getMaxTime() > _sound->_time) { + if (_data->getMaxTime() > _sound->getTime()) { _status.status = kSoundStatus_400; } else { - _data->setTime((uint16)_sound->_time); + _data->setTime((uint16)_sound->getTime()); if (getSoundQueue()->getSubtitleFlag() & 1) drawOnScreen(); diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h index 929d3463d5..60795332f8 100644 --- a/engines/lastexpress/sound/entry.h +++ b/engines/lastexpress/sound/entry.h @@ -86,6 +86,7 @@ enum SoundStatus { kSoundStatus_8000 = 0x8000, kSoundStatus_20000 = 0x20000, kSoundStatus_100000 = 0x100000, + kSoundStatus_20000000 = 0x20000000, kSoundStatus_40000000 = 0x40000000, kSoundStatusClear0 = 0x10, @@ -127,6 +128,8 @@ public: void updateState(); void reset(); + void loadStream(); + // Subtitles void showSubtitle(Common::String filename); @@ -134,22 +137,34 @@ public: void saveLoadWithSerializer(Common::Serializer &ser); // Accessors - void setType(SoundType type) { _type = type; } - SoundType getType() { return _type; } - + void setStatus(int status) { _status.status = status; } + void setType(SoundType type) { _type = type; } void setEntity(EntityIndex entity) { _entity = entity; } - EntityIndex getEntity() { return _entity; } + void setField48(int val) { _field_48 = val; } + + SoundStatusUnion getStatus() { return _status; } + SoundType getType() { return _type; } + uint32 getTime() { return _time; } + EntityIndex getEntity() { return _entity; } + uint32 getPriority() { return _priority; } + Common::String getName2() { return _name2; } + + // Streams + Common::SeekableReadStream *getStream() { return _stream; } + StreamedSound *getStreamedSound() { return _soundStream; } + +public: + // TODO replace by on-the-fly allocated buffer + void *_soundData; private: LastExpressEngine *_engine; -public: SoundStatusUnion _status; SoundType _type; // int //int _data; //int _endOffset; int _currentDataPtr; - void *_soundData; //int _currentBufferPtr; int _blockCount; uint32 _time; diff --git a/engines/lastexpress/sound/queue.cpp b/engines/lastexpress/sound/queue.cpp index 7eb67b387c..cbd942f082 100644 --- a/engines/lastexpress/sound/queue.cpp +++ b/engines/lastexpress/sound/queue.cpp @@ -76,15 +76,13 @@ void SoundQueue::handleTimer() { for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { SoundEntry *entry = (*i); - if (entry->_stream == NULL) { + if (entry->getStream() == NULL) { SAFE_DELETE(*i); i = _soundList.reverse_erase(i); continue; - } else if (!entry->_soundStream) { - entry->_soundStream = new StreamedSound(); - + } else if (!entry->getStreamedSound()) { // TODO: stream any sound in the queue after filtering - entry->_soundStream->load(entry->_stream); + entry->loadStream(); } } } @@ -180,7 +178,7 @@ void SoundQueue::clearStatus() { Common::StackLock locker(_mutex); for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->_status.status |= kSoundStatusClear3; + (*i)->setStatus((*i)->getStatus().status | kSoundStatusClear3); } ////////////////////////////////////////////////////////////////////////// @@ -243,7 +241,7 @@ SoundEntry *SoundQueue::getEntry(Common::String name) { name += ".SND"; for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) { - if ((*i)->_name2 == name) + if ((*i)->getName2() == name) return *i; } @@ -264,7 +262,7 @@ uint32 SoundQueue::getEntryTime(EntityIndex index) { SoundEntry *entry = getEntry(index); if (entry) - return entry->_time; + return entry->getTime(); return 0; } @@ -298,16 +296,16 @@ void SoundQueue::updateSubtitles() { for (Common::List::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) { uint32 current_index = 0; SoundEntry *soundEntry = (*i)->getSoundEntry(); - SoundStatus status = (SoundStatus)soundEntry->_status.status; + SoundStatus status = (SoundStatus)soundEntry->getStatus().status; if (!(status & kSoundStatus_40) || status & kSoundStatus_180 - || soundEntry->_time == 0 + || soundEntry->getTime() == 0 || (status & kSoundStatusClear1) < 6 - || ((getFlags()->nis & 0x8000) && soundEntry->_priority < 90)) { + || ((getFlags()->nis & 0x8000) && soundEntry->getPriority() < 90)) { current_index = 0; } else { - current_index = soundEntry->_priority + (status & kSoundStatusClear1); + current_index = soundEntry->getPriority() + (status & kSoundStatusClear1); if (_currentSubtitle == (*i)) current_index += 4; @@ -348,8 +346,8 @@ bool SoundQueue::setupCache(SoundEntry *entry) { uint32 size = 1000; for (Common::List::iterator i = _soundCache.begin(); i != _soundCache.end(); ++i) { - if (!((*i)->_status.status & kSoundStatus_180)) { - uint32 newSize = (*i)->_priority + ((*i)->_status.status & kSoundStatusClear1); + if (!((*i)->getStatus().status & kSoundStatus_180)) { + uint32 newSize = (*i)->getPriority() + ((*i)->getStatus().status & kSoundStatusClear1); if (newSize < size) { cacheEntry = (*i); @@ -358,7 +356,7 @@ bool SoundQueue::setupCache(SoundEntry *entry) { } } - if (entry->_priority <= size) + if (entry->getPriority() <= size) return false; if (!cacheEntry) @@ -367,7 +365,7 @@ bool SoundQueue::setupCache(SoundEntry *entry) { cacheEntry->setInCache(); // TODO: Wait until the cache entry is ready to be removed - while (!(cacheEntry->_status.status1 & 1)) + while (!(cacheEntry->getStatus().status1 & 1)) ; if (cacheEntry->_soundData) @@ -427,7 +425,7 @@ uint32 SoundQueue::count() { uint32 numEntries = 0; for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - if ((*i)->_name2.matchString("NISSND?")) + if ((*i)->getName2().matchString("NISSND?")) ++numEntries; return numEntries; @@ -749,9 +747,9 @@ static void soundFilter(byte *data, int16 *buffer, int p1, int p2); void SoundQueue::applyFilter(SoundEntry *entry, int16 *buffer) { if ((((byte *)entry->_soundData)[1] << 6) > 0x1600) { - entry->_status.status |= 0x20000000; + entry->setStatus(entry->getStatus().status | kSoundStatus_20000000); } else { - int variant = entry->_status.status & 0x1f; + int variant = entry->getStatus().status & 0x1f; soundFilter((byte *)entry->_soundData, buffer, p1s[variant], p2s[variant]); } @@ -789,7 +787,7 @@ void SoundQueue::stopAllSound() { Common::StackLock locker(_mutex); for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->_soundStream->stop(); + (*i)->getStreamedSound()->stop(); } } // End of namespace LastExpress diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp index 45f8140d27..c726769495 100644 --- a/engines/lastexpress/sound/sound.cpp +++ b/engines/lastexpress/sound/sound.cpp @@ -155,11 +155,11 @@ bool SoundManager::playSoundWithSubtitles(Common::String filename, SoundFlag fla SoundEntry *entry = new SoundEntry(_engine); entry->open(filename, flag, 30); - entry->_entity = entity; + entry->setEntity(entity); if (a4) { - entry->_field_48 = _data2 + 2 * a4; - entry->_status.status |= kSoundStatus_8000; + entry->setField48(_data2 + 2 * a4); + entry->setStatus(entry->getStatus().status | kSoundStatus_8000); } else { // Get subtitles name while (filename.size() > 4) @@ -1359,7 +1359,7 @@ void SoundManager::playLoopingSound(int param) { if (getFlags()->flag_3) fnameLen = 5; - if (!entry || scumm_strnicmp(entry->_name2.c_str(), tmp, fnameLen)) { + if (!entry || scumm_strnicmp(entry->getName2().c_str(), tmp, fnameLen)) { _loopingSoundDuration = _engine->getRandom().getRandomNumber(319) + 260; if (partNumber != 99) { -- cgit v1.2.3 From c32a3ea0d30336771bab460ecccb58c4614e6294 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 28 Jun 2011 23:40:31 -0400 Subject: BACKENDS: Fix warnings in Win32TaskbarManager --- backends/taskbar/win32/win32-taskbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index d6be566263..18d99d6eca 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -234,18 +234,18 @@ Common::String Win32TaskbarManager::getIconPath(Common::String target) { // VerSetConditionMask and VerifyVersionInfo didn't appear until Windows 2000, // so we need to check for them at runtime -LONGLONG VerSetConditionMaskFunc(ULONGLONG conditionMask, DWORD typeMask, BYTE condition) { - typedef BOOL (WINAPI *VerSetConditionMaskFunction)(ULONGLONG ConditionMask, DWORD TypeMask, BYTE Condition); +LONGLONG VerSetConditionMaskFunc(ULONGLONG dwlConditionMask, DWORD dwTypeMask, BYTE dwConditionMask) { + typedef BOOL (WINAPI *VerSetConditionMaskFunction)(ULONGLONG conditionMask, DWORD typeMask, BYTE conditionOperator); VerSetConditionMaskFunction verSetConditionMask = (VerSetConditionMaskFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerSetConditionMask"); if (verSetConditionMask == NULL) return 0; - return verSetConditionMask(conditionMask, typeMask, condition); + return verSetConditionMask(dwlConditionMask, dwTypeMask, dwConditionMask); } BOOL VerifyVersionInfoFunc(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask) { - typedef BOOL (WINAPI *VerifyVersionInfoFunction)(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwTypeMask, DWORDLONG dwlConditionMask); + typedef BOOL (WINAPI *VerifyVersionInfoFunction)(LPOSVERSIONINFOEXA versionInformation, DWORD typeMask, DWORDLONG conditionMask); VerifyVersionInfoFunction verifyVersionInfo = (VerifyVersionInfoFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerifyVersionInfoA"); if (verifyVersionInfo == NULL) -- cgit v1.2.3